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:
authorOve Murberg Henriksen <sorayasilvermoon@hotmail.com>2012-04-03 15:55:39 +0400
committerOve Murberg Henriksen <sorayasilvermoon@hotmail.com>2012-04-03 15:55:39 +0400
commit244836b18da1bbb6be94b7a5353ae8beaff1eb9d (patch)
tree4ed1f20cb3fd9835b9eee8d49f3abfe4267c4008 /source/blender
parent4fb535070ecaae57dc3f6521e447d42c6cc57193 (diff)
parenta7798884a5ab806723a9e773fbd3a387369786b0 (diff)
svn merge ^/trunk/blender -r44562:45364
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/avi/intern/avi.c59
-rw-r--r--source/blender/avi/intern/avirgb.c3
-rw-r--r--source/blender/avi/intern/mjpeg.c17
-rw-r--r--source/blender/avi/intern/rgb32.c2
-rw-r--r--source/blender/blenfont/BLF_api.h71
-rw-r--r--source/blender/blenfont/BLF_translation.h23
-rw-r--r--source/blender/blenfont/intern/blf.c224
-rw-r--r--source/blender/blenfont/intern/blf_dir.c78
-rw-r--r--source/blender/blenfont/intern/blf_font.c420
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c239
-rw-r--r--source/blender/blenfont/intern/blf_internal.h2
-rw-r--r--source/blender/blenfont/intern/blf_lang.c84
-rw-r--r--source/blender/blenfont/intern/blf_translation.c40
-rw-r--r--source/blender/blenfont/intern/blf_util.c2
-rw-r--r--source/blender/blenkernel/BKE_DerivedMesh.h194
-rw-r--r--source/blender/blenkernel/BKE_animsys.h8
-rw-r--r--source/blender/blenkernel/BKE_armature.h3
-rw-r--r--source/blender/blenkernel/BKE_blender.h4
-rw-r--r--source/blender/blenkernel/BKE_bmesh.h7
-rw-r--r--source/blender/blenkernel/BKE_bmfont_types.h9
-rw-r--r--source/blender/blenkernel/BKE_bvhutils.h10
-rw-r--r--source/blender/blenkernel/BKE_cdderivedmesh.h25
-rw-r--r--source/blender/blenkernel/BKE_cloth.h52
-rw-r--r--source/blender/blenkernel/BKE_collision.h8
-rw-r--r--source/blender/blenkernel/BKE_context.h14
-rw-r--r--source/blender/blenkernel/BKE_curve.h54
-rw-r--r--source/blender/blenkernel/BKE_customdata.h39
-rw-r--r--source/blender/blenkernel/BKE_deform.h2
-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_fcurve.h2
-rw-r--r--source/blender/blenkernel/BKE_global.h14
-rw-r--r--source/blender/blenkernel/BKE_icons.h4
-rw-r--r--source/blender/blenkernel/BKE_idcode.h24
-rw-r--r--source/blender/blenkernel/BKE_idprop.h134
-rw-r--r--source/blender/blenkernel/BKE_lattice.h2
-rw-r--r--source/blender/blenkernel/BKE_mesh.h64
-rw-r--r--source/blender/blenkernel/BKE_modifier.h19
-rw-r--r--source/blender/blenkernel/BKE_movieclip.h3
-rw-r--r--source/blender/blenkernel/BKE_multires.h21
-rw-r--r--source/blender/blenkernel/BKE_node.h8
-rw-r--r--source/blender/blenkernel/BKE_object.h4
-rw-r--r--source/blender/blenkernel/BKE_paint.h9
-rw-r--r--source/blender/blenkernel/BKE_particle.h4
-rw-r--r--source/blender/blenkernel/BKE_report.h2
-rw-r--r--source/blender/blenkernel/BKE_screen.h2
-rw-r--r--source/blender/blenkernel/BKE_sequencer.h69
-rw-r--r--source/blender/blenkernel/BKE_shrinkwrap.h2
-rw-r--r--source/blender/blenkernel/BKE_subsurf.h42
-rw-r--r--source/blender/blenkernel/BKE_suggestions.h26
-rw-r--r--source/blender/blenkernel/BKE_tessmesh.h40
-rw-r--r--source/blender/blenkernel/BKE_tracking.h31
-rw-r--r--source/blender/blenkernel/CMakeLists.txt42
-rw-r--r--source/blender/blenkernel/SConscript3
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.c29
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.h6
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c736
-rw-r--r--source/blender/blenkernel/intern/action.c229
-rw-r--r--source/blender/blenkernel/intern/anim.c330
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c150
-rw-r--r--source/blender/blenkernel/intern/armature.c68
-rw-r--r--source/blender/blenkernel/intern/blender.c149
-rw-r--r--source/blender/blenkernel/intern/bmfont.c21
-rw-r--r--source/blender/blenkernel/intern/boids.c297
-rw-r--r--source/blender/blenkernel/intern/booleanops_mesh.c3
-rw-r--r--source/blender/blenkernel/intern/brush.c91
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c281
-rw-r--r--source/blender/blenkernel/intern/camera.c74
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c797
-rw-r--r--source/blender/blenkernel/intern/cloth.c180
-rw-r--r--source/blender/blenkernel/intern/collision.c303
-rw-r--r--source/blender/blenkernel/intern/colortools.c257
-rw-r--r--source/blender/blenkernel/intern/constraint.c232
-rw-r--r--source/blender/blenkernel/intern/context.c138
-rw-r--r--source/blender/blenkernel/intern/curve.c1016
-rw-r--r--source/blender/blenkernel/intern/customdata.c650
-rw-r--r--source/blender/blenkernel/intern/customdata_file.c101
-rw-r--r--source/blender/blenkernel/intern/deform.c311
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c754
-rw-r--r--source/blender/blenkernel/intern/displist.c395
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c277
-rw-r--r--source/blender/blenkernel/intern/editderivedmesh.c232
-rw-r--r--source/blender/blenkernel/intern/effect.c259
-rw-r--r--source/blender/blenkernel/intern/fcurve.c131
-rw-r--r--source/blender/blenkernel/intern/fluidsim.c26
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c76
-rw-r--r--source/blender/blenkernel/intern/font.c161
-rw-r--r--source/blender/blenkernel/intern/gpencil.c4
-rw-r--r--source/blender/blenkernel/intern/group.c138
-rw-r--r--source/blender/blenkernel/intern/icons.c50
-rw-r--r--source/blender/blenkernel/intern/idprop.c125
-rw-r--r--source/blender/blenkernel/intern/image.c714
-rw-r--r--source/blender/blenkernel/intern/image_gen.c60
-rw-r--r--source/blender/blenkernel/intern/implicit.c339
-rw-r--r--source/blender/blenkernel/intern/ipo.c100
-rw-r--r--source/blender/blenkernel/intern/key.c547
-rw-r--r--source/blender/blenkernel/intern/lamp.c48
-rw-r--r--source/blender/blenkernel/intern/lattice.c31
-rw-r--r--source/blender/blenkernel/intern/library.c302
-rw-r--r--source/blender/blenkernel/intern/material.c40
-rw-r--r--source/blender/blenkernel/intern/mball.c132
-rw-r--r--source/blender/blenkernel/intern/mesh.c510
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c643
-rw-r--r--source/blender/blenkernel/intern/modifier.c130
-rw-r--r--source/blender/blenkernel/intern/modifiers_bmesh.c46
-rw-r--r--source/blender/blenkernel/intern/movieclip.c690
-rw-r--r--source/blender/blenkernel/intern/multires.c348
-rw-r--r--source/blender/blenkernel/intern/navmesh_conversion.c9
-rw-r--r--source/blender/blenkernel/intern/nla.c85
-rw-r--r--source/blender/blenkernel/intern/node.c535
-rw-r--r--source/blender/blenkernel/intern/object.c112
-rw-r--r--source/blender/blenkernel/intern/ocean.c59
-rw-r--r--source/blender/blenkernel/intern/packedFile.c118
-rw-r--r--source/blender/blenkernel/intern/paint.c37
-rw-r--r--source/blender/blenkernel/intern/particle.c1195
-rw-r--r--source/blender/blenkernel/intern/particle_system.c1177
-rw-r--r--source/blender/blenkernel/intern/pointcache.c905
-rw-r--r--source/blender/blenkernel/intern/property.c51
-rw-r--r--source/blender/blenkernel/intern/report.c53
-rw-r--r--source/blender/blenkernel/intern/sca.c167
-rw-r--r--source/blender/blenkernel/intern/scene.c42
-rw-r--r--source/blender/blenkernel/intern/screen.c108
-rw-r--r--source/blender/blenkernel/intern/script.c5
-rw-r--r--source/blender/blenkernel/intern/seqcache.c8
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c692
-rw-r--r--source/blender/blenkernel/intern/sequencer.c2359
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c136
-rw-r--r--source/blender/blenkernel/intern/sketch.c15
-rw-r--r--source/blender/blenkernel/intern/smoke.c387
-rw-r--r--source/blender/blenkernel/intern/softbody.c161
-rw-r--r--source/blender/blenkernel/intern/sound.c23
-rw-r--r--source/blender/blenkernel/intern/speaker.c30
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c947
-rw-r--r--source/blender/blenkernel/intern/suggestions.c12
-rw-r--r--source/blender/blenkernel/intern/text.c696
-rw-r--r--source/blender/blenkernel/intern/texture.c360
-rw-r--r--source/blender/blenkernel/intern/tracking.c2218
-rw-r--r--source/blender/blenkernel/intern/unit.c330
-rw-r--r--source/blender/blenkernel/intern/world.c48
-rw-r--r--source/blender/blenkernel/intern/writeavi.c6
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c108
-rw-r--r--source/blender/blenkernel/intern/writeframeserver.c6
-rw-r--r--source/blender/blenlib/BLI_array.h2
-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.h4
-rw-r--r--source/blender/blenlib/BLI_callbacks.h2
-rw-r--r--source/blender/blenlib/BLI_dlrbTree.h8
-rw-r--r--source/blender/blenlib/BLI_dynstr.h34
-rw-r--r--source/blender/blenlib/BLI_editVert.h4
-rw-r--r--source/blender/blenlib/BLI_fileops.h9
-rw-r--r--source/blender/blenlib/BLI_fnmatch.h42
-rw-r--r--source/blender/blenlib/BLI_ghash.h24
-rw-r--r--source/blender/blenlib/BLI_graph.h2
-rw-r--r--source/blender/blenlib/BLI_gsqueue.h12
-rw-r--r--source/blender/blenlib/BLI_heap.h4
-rw-r--r--source/blender/blenlib/BLI_kdtree.h2
-rw-r--r--source/blender/blenlib/BLI_listbase.h3
-rw-r--r--source/blender/blenlib/BLI_math_base.h2
-rw-r--r--source/blender/blenlib/BLI_math_geom.h37
-rw-r--r--source/blender/blenlib/BLI_math_inline.h29
-rw-r--r--source/blender/blenlib/BLI_math_matrix.h9
-rw-r--r--source/blender/blenlib/BLI_math_vector.h11
-rw-r--r--source/blender/blenlib/BLI_md5.h10
-rw-r--r--source/blender/blenlib/BLI_mempool.h9
-rw-r--r--source/blender/blenlib/BLI_path_util.h48
-rw-r--r--source/blender/blenlib/BLI_pbvh.h66
-rw-r--r--source/blender/blenlib/BLI_rand.h4
-rw-r--r--source/blender/blenlib/BLI_rect.h2
-rw-r--r--source/blender/blenlib/BLI_scanfill.h12
-rw-r--r--source/blender/blenlib/BLI_sparsemap.h81
-rw-r--r--source/blender/blenlib/BLI_string.h42
-rw-r--r--source/blender/blenlib/BLI_string_cursor_utf8.h51
-rw-r--r--source/blender/blenlib/BLI_utildefines.h91
-rw-r--r--source/blender/blenlib/BLI_vfontdata.h4
-rw-r--r--source/blender/blenlib/BLI_winstuff.h2
-rw-r--r--source/blender/blenlib/CMakeLists.txt11
-rw-r--r--source/blender/blenlib/PIL_time.h4
-rw-r--r--source/blender/blenlib/SConscript1
-rw-r--r--source/blender/blenlib/intern/BLI_args.c17
-rw-r--r--source/blender/blenlib/intern/BLI_dynstr.c36
-rw-r--r--source/blender/blenlib/intern/BLI_ghash.c172
-rw-r--r--source/blender/blenlib/intern/BLI_heap.c36
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c344
-rw-r--r--source/blender/blenlib/intern/BLI_kdtree.c162
-rw-r--r--source/blender/blenlib/intern/BLI_linklist.c5
-rw-r--r--source/blender/blenlib/intern/BLI_memarena.c64
-rw-r--r--source/blender/blenlib/intern/BLI_mempool.c223
-rw-r--r--source/blender/blenlib/intern/DLRB_tree.c2
-rw-r--r--source/blender/blenlib/intern/boxpack2d.c322
-rw-r--r--source/blender/blenlib/intern/bpath.c122
-rw-r--r--source/blender/blenlib/intern/callbacks.c8
-rw-r--r--source/blender/blenlib/intern/dynamiclist.h58
-rw-r--r--source/blender/blenlib/intern/dynlib.c18
-rw-r--r--source/blender/blenlib/intern/edgehash.c2
-rw-r--r--source/blender/blenlib/intern/fileops.c609
-rw-r--r--source/blender/blenlib/intern/freetypefont.c160
-rw-r--r--source/blender/blenlib/intern/graph.c38
-rw-r--r--source/blender/blenlib/intern/gsqueue.c13
-rw-r--r--source/blender/blenlib/intern/jitter.c30
-rw-r--r--source/blender/blenlib/intern/listbase.c29
-rw-r--r--source/blender/blenlib/intern/math_base.c11
-rw-r--r--source/blender/blenlib/intern/math_base_inline.c47
-rw-r--r--source/blender/blenlib/intern/math_color.c462
-rw-r--r--source/blender/blenlib/intern/math_color_inline.c52
-rw-r--r--source/blender/blenlib/intern/math_geom.c2227
-rw-r--r--source/blender/blenlib/intern/math_geom_inline.c66
-rw-r--r--source/blender/blenlib/intern/math_matrix.c1271
-rw-r--r--source/blender/blenlib/intern/math_rotation.c1679
-rw-r--r--source/blender/blenlib/intern/math_vector.c337
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c412
-rw-r--r--source/blender/blenlib/intern/noise.c77
-rw-r--r--source/blender/blenlib/intern/path_util.c421
-rw-r--r--source/blender/blenlib/intern/pbvh.c795
-rw-r--r--source/blender/blenlib/intern/rand.c14
-rw-r--r--source/blender/blenlib/intern/rct.c140
-rw-r--r--source/blender/blenlib/intern/scanfill.c397
-rw-r--r--source/blender/blenlib/intern/storage.c128
-rw-r--r--source/blender/blenlib/intern/string.c62
-rw-r--r--source/blender/blenlib/intern/string_cursor_utf8.c197
-rw-r--r--source/blender/blenlib/intern/string_utf8.c68
-rw-r--r--source/blender/blenlib/intern/threads.c181
-rw-r--r--source/blender/blenlib/intern/time.c6
-rw-r--r--source/blender/blenlib/intern/uvproject.c101
-rw-r--r--source/blender/blenlib/intern/voxel.c8
-rw-r--r--source/blender/blenlib/intern/winstuff.c85
-rw-r--r--source/blender/blenloader/BLO_readfile.h82
-rw-r--r--source/blender/blenloader/BLO_sys_types.h2
-rw-r--r--source/blender/blenloader/intern/readblenentry.c25
-rw-r--r--source/blender/blenloader/intern/readfile.c3636
-rw-r--r--source/blender/blenloader/intern/runtime.c26
-rw-r--r--source/blender/blenloader/intern/undofile.c28
-rw-r--r--source/blender/blenloader/intern/writefile.c573
-rw-r--r--source/blender/blenpluginapi/documentation.h6
-rw-r--r--source/blender/blenpluginapi/iff.h6
-rw-r--r--source/blender/blenpluginapi/intern/pluginapi.c6
-rw-r--r--source/blender/bmesh/CMakeLists.txt61
-rw-r--r--source/blender/bmesh/SConscript39
-rw-r--r--source/blender/bmesh/bmesh.h138
-rw-r--r--source/blender/bmesh/bmesh_class.h79
-rw-r--r--source/blender/bmesh/intern/bmesh_construct.c357
-rw-r--r--source/blender/bmesh/intern/bmesh_construct.h4
-rw-r--r--source/blender/bmesh/intern/bmesh_core.c189
-rw-r--r--source/blender/bmesh/intern/bmesh_core.h24
-rw-r--r--source/blender/bmesh/intern/bmesh_error.h (renamed from source/blender/bmesh/bmesh_error.h)4
-rw-r--r--source/blender/bmesh/intern/bmesh_inline.c76
-rw-r--r--source/blender/bmesh/intern/bmesh_inline.h121
-rw-r--r--source/blender/bmesh/intern/bmesh_interp.c53
-rw-r--r--source/blender/bmesh/intern/bmesh_iterators.c25
-rw-r--r--source/blender/bmesh/intern/bmesh_iterators.h4
-rw-r--r--source/blender/bmesh/intern/bmesh_iterators_inline.h (renamed from source/blender/bmesh/intern/bmesh_iterators_inline.c)16
-rw-r--r--source/blender/bmesh/intern/bmesh_marking.c206
-rw-r--r--source/blender/bmesh/intern/bmesh_marking.h10
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.c83
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.h11
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh_conv.c898
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh_conv.h40
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh_validate.c186
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh_validate.h35
-rw-r--r--source/blender/bmesh/intern/bmesh_mods.c450
-rw-r--r--source/blender/bmesh/intern/bmesh_mods.h29
-rw-r--r--source/blender/bmesh/intern/bmesh_opdefines.c178
-rw-r--r--source/blender/bmesh/intern/bmesh_operator_api.h (renamed from source/blender/bmesh/bmesh_operator_api.h)132
-rw-r--r--source/blender/bmesh/intern/bmesh_operator_api_inline.h (renamed from source/blender/bmesh/intern/bmesh_operator_api_inline.c)76
-rw-r--r--source/blender/bmesh/intern/bmesh_operators.c516
-rw-r--r--source/blender/bmesh/intern/bmesh_operators.h2
-rw-r--r--source/blender/bmesh/intern/bmesh_operators_private.h1
-rw-r--r--source/blender/bmesh/intern/bmesh_polygon.c520
-rw-r--r--source/blender/bmesh/intern/bmesh_polygon.h6
-rw-r--r--source/blender/bmesh/intern/bmesh_private.h5
-rw-r--r--source/blender/bmesh/intern/bmesh_queries.c372
-rw-r--r--source/blender/bmesh/intern/bmesh_queries.h27
-rw-r--r--source/blender/bmesh/intern/bmesh_structure.c37
-rw-r--r--source/blender/bmesh/intern/bmesh_structure.h8
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers.c32
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers.h49
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers_impl.c578
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers_private.h60
-rw-r--r--source/blender/bmesh/operators/bmo_bevel.c19
-rw-r--r--source/blender/bmesh/operators/bmo_connect.c36
-rw-r--r--source/blender/bmesh/operators/bmo_create.c209
-rw-r--r--source/blender/bmesh/operators/bmo_dissolve.c83
-rw-r--r--source/blender/bmesh/operators/bmo_dupe.c162
-rw-r--r--source/blender/bmesh/operators/bmo_edgesplit.c459
-rw-r--r--source/blender/bmesh/operators/bmo_extrude.c222
-rw-r--r--source/blender/bmesh/operators/bmo_inset.c487
-rw-r--r--source/blender/bmesh/operators/bmo_join_triangles.c22
-rw-r--r--source/blender/bmesh/operators/bmo_mesh_conv.c861
-rw-r--r--source/blender/bmesh/operators/bmo_mirror.c11
-rw-r--r--source/blender/bmesh/operators/bmo_primitive.c36
-rw-r--r--source/blender/bmesh/operators/bmo_removedoubles.c43
-rw-r--r--source/blender/bmesh/operators/bmo_subdivide.c130
-rw-r--r--source/blender/bmesh/operators/bmo_subdivide.h6
-rw-r--r--source/blender/bmesh/operators/bmo_triangulate.c31
-rw-r--r--source/blender/bmesh/operators/bmo_utils.c229
-rw-r--r--source/blender/bmesh/tools/BME_bevel.c111
-rw-r--r--source/blender/collada/AnimationExporter.cpp66
-rw-r--r--source/blender/collada/AnimationImporter.cpp18
-rw-r--r--source/blender/collada/ArmatureExporter.cpp20
-rw-r--r--source/blender/collada/ArmatureImporter.cpp36
-rw-r--r--source/blender/collada/DocumentExporter.cpp30
-rw-r--r--source/blender/collada/DocumentImporter.cpp143
-rw-r--r--source/blender/collada/DocumentImporter.h4
-rw-r--r--source/blender/collada/EffectExporter.cpp24
-rw-r--r--source/blender/collada/ErrorHandler.cpp4
-rw-r--r--source/blender/collada/ExtraHandler.cpp6
-rw-r--r--source/blender/collada/ExtraTags.cpp14
-rw-r--r--source/blender/collada/GeometryExporter.cpp2
-rw-r--r--source/blender/collada/ImageExporter.cpp6
-rw-r--r--source/blender/collada/InstanceWriter.cpp2
-rw-r--r--source/blender/collada/LightExporter.cpp2
-rw-r--r--source/blender/collada/MaterialExporter.cpp4
-rw-r--r--source/blender/collada/MeshImporter.cpp28
-rw-r--r--source/blender/collada/SceneExporter.cpp8
-rw-r--r--source/blender/collada/TransformWriter.cpp6
-rw-r--r--source/blender/collada/collada.cpp6
-rw-r--r--source/blender/collada/collada_internal.cpp18
-rw-r--r--source/blender/collada/collada_utils.cpp4
-rw-r--r--source/blender/editors/animation/CMakeLists.txt5
-rw-r--r--source/blender/editors/animation/SConscript9
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c130
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c241
-rw-r--r--source/blender/editors/animation/anim_deps.c10
-rw-r--r--source/blender/editors/animation/anim_draw.c14
-rw-r--r--source/blender/editors/animation/anim_filter.c44
-rw-r--r--source/blender/editors/animation/anim_ipo_utils.c2
-rw-r--r--source/blender/editors/animation/anim_markers.c300
-rw-r--r--source/blender/editors/animation/anim_ops.c50
-rw-r--r--source/blender/editors/animation/drivers.c44
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c107
-rw-r--r--source/blender/editors/animation/keyframes_draw.c18
-rw-r--r--source/blender/editors/animation/keyframes_edit.c19
-rw-r--r--source/blender/editors/animation/keyframes_general.c8
-rw-r--r--source/blender/editors/animation/keyframing.c161
-rw-r--r--source/blender/editors/animation/keyingsets.c182
-rw-r--r--source/blender/editors/armature/CMakeLists.txt4
-rw-r--r--source/blender/editors/armature/SConscript7
-rw-r--r--source/blender/editors/armature/armature_ops.c60
-rw-r--r--source/blender/editors/armature/editarmature.c772
-rw-r--r--source/blender/editors/armature/editarmature_generate.c34
-rw-r--r--source/blender/editors/armature/editarmature_retarget.c30
-rw-r--r--source/blender/editors/armature/editarmature_sketch.c96
-rw-r--r--source/blender/editors/armature/meshlaplacian.c486
-rw-r--r--source/blender/editors/armature/poseSlide.c96
-rw-r--r--source/blender/editors/armature/poselib.c90
-rw-r--r--source/blender/editors/armature/poseobject.c364
-rw-r--r--source/blender/editors/armature/reeb.c178
-rw-r--r--source/blender/editors/curve/curve_ops.c16
-rw-r--r--source/blender/editors/curve/editcurve.c2355
-rw-r--r--source/blender/editors/curve/editfont.c718
-rw-r--r--source/blender/editors/datafiles/CMakeLists.txt1
-rw-r--r--source/blender/editors/datafiles/blender_icons.png.c13944
-rw-r--r--source/blender/editors/datafiles/claystrips.png.c290
-rw-r--r--source/blender/editors/datafiles/startup.blend.c15797
-rw-r--r--source/blender/editors/gpencil/CMakeLists.txt5
-rw-r--r--source/blender/editors/gpencil/SConscript9
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c40
-rw-r--r--source/blender/editors/gpencil/editaction_gpencil.c12
-rw-r--r--source/blender/editors/gpencil/gpencil_buttons.c163
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c74
-rw-r--r--source/blender/editors/gpencil/gpencil_ops.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c149
-rw-r--r--source/blender/editors/gpencil/gpencil_undo.c22
-rw-r--r--source/blender/editors/include/BIF_gl.h2
-rw-r--r--source/blender/editors/include/BIF_glutil.h60
-rw-r--r--source/blender/editors/include/ED_anim_api.h6
-rw-r--r--source/blender/editors/include/ED_armature.h38
-rw-r--r--source/blender/editors/include/ED_datafiles.h5
-rw-r--r--source/blender/editors/include/ED_keyframing.h9
-rw-r--r--source/blender/editors/include/ED_mesh.h234
-rw-r--r--source/blender/editors/include/ED_numinput.h9
-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_screen_types.h1
-rw-r--r--source/blender/editors/include/ED_space_api.h2
-rw-r--r--source/blender/editors/include/ED_transform.h4
-rw-r--r--source/blender/editors/include/ED_view3d.h91
-rw-r--r--source/blender/editors/include/UI_icons.h37
-rw-r--r--source/blender/editors/include/UI_interface.h12
-rw-r--r--source/blender/editors/include/UI_interface_icons.h4
-rw-r--r--source/blender/editors/include/UI_resources.h5
-rw-r--r--source/blender/editors/interface/interface.c2425
-rw-r--r--source/blender/editors/interface/interface_anim.c52
-rw-r--r--source/blender/editors/interface/interface_draw.c1009
-rw-r--r--source/blender/editors/interface/interface_handlers.c4589
-rw-r--r--source/blender/editors/interface/interface_icons.c466
-rw-r--r--source/blender/editors/interface/interface_intern.h9
-rw-r--r--source/blender/editors/interface/interface_layout.c1671
-rw-r--r--source/blender/editors/interface/interface_ops.c242
-rw-r--r--source/blender/editors/interface/interface_panel.c915
-rw-r--r--source/blender/editors/interface/interface_regions.c1754
-rw-r--r--source/blender/editors/interface/interface_style.c237
-rw-r--r--source/blender/editors/interface/interface_templates.c1479
-rw-r--r--source/blender/editors/interface/interface_utils.c118
-rw-r--r--source/blender/editors/interface/interface_widgets.c1928
-rw-r--r--source/blender/editors/interface/resources.c1972
-rw-r--r--source/blender/editors/interface/view2d.c1132
-rw-r--r--source/blender/editors/interface/view2d_ops.c718
-rw-r--r--source/blender/editors/mesh/CMakeLists.txt11
-rw-r--r--source/blender/editors/mesh/bmesh_selecthistory.c69
-rw-r--r--source/blender/editors/mesh/editface.c411
-rw-r--r--source/blender/editors/mesh/editmesh_add.c219
-rw-r--r--source/blender/editors/mesh/editmesh_bvh.c87
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c (renamed from source/blender/editors/mesh/knifetool.c)1751
-rw-r--r--source/blender/editors/mesh/editmesh_loopcut.c (renamed from source/blender/editors/mesh/loopcut.c)198
-rw-r--r--source/blender/editors/mesh/editmesh_select.c (renamed from source/blender/editors/mesh/bmesh_select.c)607
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c (renamed from source/blender/editors/mesh/bmesh_tools.c)2041
-rw-r--r--source/blender/editors/mesh/editmesh_utils.c (renamed from source/blender/editors/mesh/bmesh_utils.c)405
-rw-r--r--source/blender/editors/mesh/mesh_data.c655
-rw-r--r--source/blender/editors/mesh/mesh_intern.h61
-rw-r--r--source/blender/editors/mesh/mesh_navmesh.c449
-rw-r--r--source/blender/editors/mesh/mesh_ops.c80
-rw-r--r--source/blender/editors/mesh/meshtools.c711
-rw-r--r--source/blender/editors/metaball/mball_edit.c170
-rw-r--r--source/blender/editors/metaball/mball_ops.c4
-rw-r--r--source/blender/editors/object/object_add.c497
-rw-r--r--source/blender/editors/object/object_bake.c339
-rw-r--r--source/blender/editors/object/object_constraint.c281
-rw-r--r--source/blender/editors/object/object_edit.c584
-rw-r--r--source/blender/editors/object/object_group.c96
-rw-r--r--source/blender/editors/object/object_hook.c221
-rw-r--r--source/blender/editors/object/object_intern.h1
-rw-r--r--source/blender/editors/object/object_lattice.c76
-rw-r--r--source/blender/editors/object/object_modifier.c542
-rw-r--r--source/blender/editors/object/object_ops.c44
-rw-r--r--source/blender/editors/object/object_relations.c552
-rw-r--r--source/blender/editors/object/object_select.c217
-rw-r--r--source/blender/editors/object/object_shapekey.c142
-rw-r--r--source/blender/editors/object/object_transform.c240
-rw-r--r--source/blender/editors/object/object_vgroup.c961
-rw-r--r--source/blender/editors/physics/dynamicpaint_ops.c87
-rw-r--r--source/blender/editors/physics/particle_boids.c124
-rw-r--r--source/blender/editors/physics/particle_edit.c1039
-rw-r--r--source/blender/editors/physics/particle_object.c244
-rw-r--r--source/blender/editors/physics/physics_fluid.c137
-rw-r--r--source/blender/editors/physics/physics_ops.c6
-rw-r--r--source/blender/editors/physics/physics_pointcache.c112
-rw-r--r--source/blender/editors/render/render_internal.c344
-rw-r--r--source/blender/editors/render/render_opengl.c367
-rw-r--r--source/blender/editors/render/render_preview.c565
-rw-r--r--source/blender/editors/render/render_shading.c561
-rw-r--r--source/blender/editors/render/render_update.c150
-rw-r--r--source/blender/editors/render/render_view.c178
-rw-r--r--source/blender/editors/screen/CMakeLists.txt4
-rw-r--r--source/blender/editors/screen/SConscript5
-rw-r--r--source/blender/editors/screen/area.c454
-rw-r--r--source/blender/editors/screen/glutil.c141
-rw-r--r--source/blender/editors/screen/screen_context.c114
-rw-r--r--source/blender/editors/screen/screen_edit.c485
-rw-r--r--source/blender/editors/screen/screen_ops.c1163
-rw-r--r--source/blender/editors/screen/screendump.c80
-rw-r--r--source/blender/editors/sculpt_paint/CMakeLists.txt1
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c220
-rw-r--r--source/blender/editors/sculpt_paint/paint_hide.c392
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c2534
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h26
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c369
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c110
-rw-r--r--source/blender/editors/sculpt_paint/paint_undo.c122
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c274
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c1686
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c1609
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_intern.h13
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c374
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_uv.c148
-rw-r--r--source/blender/editors/sound/sound_ops.c145
-rw-r--r--source/blender/editors/space_action/action_draw.c6
-rw-r--r--source/blender/editors/space_action/action_edit.c266
-rw-r--r--source/blender/editors/space_action/action_ops.c20
-rw-r--r--source/blender/editors/space_action/action_select.c118
-rw-r--r--source/blender/editors/space_action/space_action.c26
-rw-r--r--source/blender/editors/space_api/spacetypes.c26
-rw-r--r--source/blender/editors/space_buttons/CMakeLists.txt4
-rw-r--r--source/blender/editors/space_buttons/SConscript3
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c325
-rw-r--r--source/blender/editors/space_buttons/buttons_header.c8
-rw-r--r--source/blender/editors/space_buttons/buttons_ops.c54
-rw-r--r--source/blender/editors/space_buttons/buttons_texture.c112
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c51
-rw-r--r--source/blender/editors/space_clip/clip_buttons.c185
-rw-r--r--source/blender/editors/space_clip/clip_draw.c913
-rw-r--r--source/blender/editors/space_clip/clip_editor.c167
-rw-r--r--source/blender/editors/space_clip/clip_graph_draw.c91
-rw-r--r--source/blender/editors/space_clip/clip_graph_ops.c433
-rw-r--r--source/blender/editors/space_clip/clip_intern.h7
-rw-r--r--source/blender/editors/space_clip/clip_ops.c542
-rw-r--r--source/blender/editors/space_clip/clip_toolbar.c112
-rw-r--r--source/blender/editors/space_clip/clip_utils.c112
-rw-r--r--source/blender/editors/space_clip/space_clip.c491
-rw-r--r--source/blender/editors/space_clip/tracking_ops.c2527
-rw-r--r--source/blender/editors/space_console/console_draw.c134
-rw-r--r--source/blender/editors/space_console/console_intern.h2
-rw-r--r--source/blender/editors/space_console/console_ops.c651
-rw-r--r--source/blender/editors/space_console/space_console.c135
-rw-r--r--source/blender/editors/space_file/CMakeLists.txt4
-rw-r--r--source/blender/editors/space_file/SConscript5
-rw-r--r--source/blender/editors/space_file/file_draw.c42
-rw-r--r--source/blender/editors/space_file/file_ops.c384
-rw-r--r--source/blender/editors/space_file/file_panels.c26
-rw-r--r--source/blender/editors/space_file/filelist.c254
-rw-r--r--source/blender/editors/space_file/filesel.c94
-rw-r--r--source/blender/editors/space_file/fsmenu.c43
-rw-r--r--source/blender/editors/space_file/fsmenu.h8
-rw-r--r--source/blender/editors/space_file/space_file.c65
-rw-r--r--source/blender/editors/space_graph/CMakeLists.txt4
-rw-r--r--source/blender/editors/space_graph/SConscript7
-rw-r--r--source/blender/editors/space_graph/graph_buttons.c131
-rw-r--r--source/blender/editors/space_graph/graph_draw.c57
-rw-r--r--source/blender/editors/space_graph/graph_edit.c369
-rw-r--r--source/blender/editors/space_graph/graph_ops.c42
-rw-r--r--source/blender/editors/space_graph/graph_select.c122
-rw-r--r--source/blender/editors/space_graph/graph_utils.c4
-rw-r--r--source/blender/editors/space_graph/space_graph.c32
-rw-r--r--source/blender/editors/space_image/image_buttons.c609
-rw-r--r--source/blender/editors/space_image/image_draw.c379
-rw-r--r--source/blender/editors/space_image/image_ops.c1299
-rw-r--r--source/blender/editors/space_image/space_image.c466
-rw-r--r--source/blender/editors/space_info/CMakeLists.txt4
-rw-r--r--source/blender/editors/space_info/SConscript3
-rw-r--r--source/blender/editors/space_info/info_draw.c152
-rw-r--r--source/blender/editors/space_info/info_ops.c173
-rw-r--r--source/blender/editors/space_info/info_report.c232
-rw-r--r--source/blender/editors/space_info/info_stats.c332
-rw-r--r--source/blender/editors/space_info/space_info.c113
-rw-r--r--source/blender/editors/space_info/textview.c139
-rw-r--r--source/blender/editors/space_logic/logic_buttons.c60
-rw-r--r--source/blender/editors/space_logic/logic_ops.c148
-rw-r--r--source/blender/editors/space_logic/logic_window.c713
-rw-r--r--source/blender/editors/space_logic/space_logic.c30
-rw-r--r--source/blender/editors/space_nla/CMakeLists.txt4
-rw-r--r--source/blender/editors/space_nla/SConscript7
-rw-r--r--source/blender/editors/space_nla/nla_buttons.c14
-rw-r--r--source/blender/editors/space_nla/nla_channels.c46
-rw-r--r--source/blender/editors/space_nla/nla_draw.c25
-rw-r--r--source/blender/editors/space_nla/nla_edit.c317
-rw-r--r--source/blender/editors/space_nla/nla_ops.c14
-rw-r--r--source/blender/editors/space_nla/nla_select.c72
-rw-r--r--source/blender/editors/space_nla/space_nla.c40
-rw-r--r--source/blender/editors/space_node/CMakeLists.txt4
-rw-r--r--source/blender/editors/space_node/SConscript5
-rw-r--r--source/blender/editors/space_node/drawnode.c394
-rw-r--r--source/blender/editors/space_node/node_buttons.c20
-rw-r--r--source/blender/editors/space_node/node_draw.c279
-rw-r--r--source/blender/editors/space_node/node_edit.c1232
-rw-r--r--source/blender/editors/space_node/node_header.c40
-rw-r--r--source/blender/editors/space_node/node_intern.h11
-rw-r--r--source/blender/editors/space_node/node_ops.c21
-rw-r--r--source/blender/editors/space_node/node_select.c341
-rw-r--r--source/blender/editors/space_node/node_state.c30
-rw-r--r--source/blender/editors/space_node/node_templates.c182
-rw-r--r--source/blender/editors/space_node/space_node.c124
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c307
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c332
-rw-r--r--source/blender/editors/space_outliner/outliner_intern.h28
-rw-r--r--source/blender/editors/space_outliner/outliner_ops.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c277
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c311
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c406
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c38
-rw-r--r--source/blender/editors/space_script/script_edit.c22
-rw-r--r--source/blender/editors/space_script/script_ops.c2
-rw-r--r--source/blender/editors/space_script/space_script.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c459
-rw-r--r--source/blender/editors/space_sequencer/sequencer_buttons.c30
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c818
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c1800
-rw-r--r--source/blender/editors/space_sequencer/sequencer_intern.h3
-rw-r--r--source/blender/editors/space_sequencer/sequencer_ops.c124
-rw-r--r--source/blender/editors/space_sequencer/sequencer_scopes.c309
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c645
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c322
-rw-r--r--source/blender/editors/space_text/space_text.c156
-rw-r--r--source/blender/editors/space_text/text_draw.c1387
-rw-r--r--source/blender/editors/space_text/text_header.c50
-rw-r--r--source/blender/editors/space_text/text_ops.c2004
-rw-r--r--source/blender/editors/space_text/text_python.c450
-rw-r--r--source/blender/editors/space_time/space_time.c32
-rw-r--r--source/blender/editors/space_time/time_ops.c69
-rw-r--r--source/blender/editors/space_view3d/CMakeLists.txt4
-rw-r--r--source/blender/editors/space_view3d/SConscript3
-rw-r--r--source/blender/editors/space_view3d/drawanimviz.c98
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c1175
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c391
-rw-r--r--source/blender/editors/space_view3d/drawobject.c4240
-rw-r--r--source/blender/editors/space_view3d/drawvolume.c137
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c503
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c1288
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c1373
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c1534
-rw-r--r--source/blender/editors/space_view3d/view3d_fly.c731
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c377
-rw-r--r--source/blender/editors/space_view3d/view3d_intern.h2
-rw-r--r--source/blender/editors/space_view3d/view3d_ops.c48
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c1433
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c575
-rw-r--r--source/blender/editors/space_view3d/view3d_toolbar.c90
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c971
-rw-r--r--source/blender/editors/transform/CMakeLists.txt4
-rw-r--r--source/blender/editors/transform/SConscript7
-rw-r--r--source/blender/editors/transform/transform.c589
-rw-r--r--source/blender/editors/transform/transform.h33
-rw-r--r--source/blender/editors/transform/transform_constraints.c102
-rw-r--r--source/blender/editors/transform/transform_conversions.c956
-rw-r--r--source/blender/editors/transform/transform_generics.c284
-rw-r--r--source/blender/editors/transform/transform_input.c51
-rw-r--r--source/blender/editors/transform/transform_manipulator.c485
-rw-r--r--source/blender/editors/transform/transform_ops.c122
-rw-r--r--source/blender/editors/transform/transform_orientations.c211
-rw-r--r--source/blender/editors/transform/transform_snap.c283
-rw-r--r--source/blender/editors/util/crazyspace.c348
-rw-r--r--source/blender/editors/util/ed_util.c92
-rw-r--r--source/blender/editors/util/editmode_undo.c242
-rw-r--r--source/blender/editors/util/numinput.c329
-rw-r--r--source/blender/editors/util/undo.c291
-rw-r--r--source/blender/editors/uvedit/uvedit_buttons.c24
-rw-r--r--source/blender/editors/uvedit/uvedit_draw.c321
-rw-r--r--source/blender/editors/uvedit/uvedit_intern.h2
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c1011
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.c76
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.h36
-rw-r--r--source/blender/editors/uvedit/uvedit_smart_stitch.c386
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c384
-rw-r--r--source/blender/gpu/GPU_buffers.h67
-rw-r--r--source/blender/gpu/GPU_extensions.h42
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c665
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c225
-rw-r--r--source/blender/gpu/intern/gpu_codegen.h8
-rw-r--r--source/blender/gpu/intern/gpu_draw.c315
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c134
-rw-r--r--source/blender/gpu/intern/gpu_material.c457
-rw-r--r--source/blender/ikplugin/intern/iksolver_plugin.c104
-rw-r--r--source/blender/ikplugin/intern/itasc_plugin.cpp189
-rw-r--r--source/blender/imbuf/CMakeLists.txt10
-rw-r--r--source/blender/imbuf/IMB_imbuf.h131
-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/IMB_thumbs.h2
-rw-r--r--source/blender/imbuf/SConscript3
-rw-r--r--source/blender/imbuf/intern/IMB_indexer.h36
-rw-r--r--source/blender/imbuf/intern/IMB_metadata.h40
-rw-r--r--source/blender/imbuf/intern/allocimbuf.c125
-rw-r--r--source/blender/imbuf/intern/anim_movie.c102
-rw-r--r--source/blender/imbuf/intern/bmp.c31
-rw-r--r--source/blender/imbuf/intern/cache.c86
-rw-r--r--source/blender/imbuf/intern/cineon/cineon_dpx.c12
-rw-r--r--source/blender/imbuf/intern/cineon/cineonlib.c36
-rw-r--r--source/blender/imbuf/intern/cineon/dpxlib.c26
-rw-r--r--source/blender/imbuf/intern/cineon/logImageLib.c15
-rw-r--r--source/blender/imbuf/intern/cineon/logmemfile.c10
-rw-r--r--source/blender/imbuf/intern/dds/BlockDXT.cpp48
-rw-r--r--source/blender/imbuf/intern/dds/ColorBlock.cpp96
-rw-r--r--source/blender/imbuf/intern/dds/DirectDrawSurface.cpp6
-rw-r--r--source/blender/imbuf/intern/dds/Image.h4
-rw-r--r--source/blender/imbuf/intern/dds/PixelFormat.h2
-rw-r--r--source/blender/imbuf/intern/dds/dds_api.cpp4
-rw-r--r--source/blender/imbuf/intern/divers.c245
-rw-r--r--source/blender/imbuf/intern/filetype.c10
-rw-r--r--source/blender/imbuf/intern/filter.c153
-rw-r--r--source/blender/imbuf/intern/imageprocess.c96
-rw-r--r--source/blender/imbuf/intern/imbuf_cocoa.m16
-rw-r--r--source/blender/imbuf/intern/indexer.c51
-rw-r--r--source/blender/imbuf/intern/indexer_dv.c20
-rw-r--r--source/blender/imbuf/intern/iris.c150
-rw-r--r--source/blender/imbuf/intern/jp2.c140
-rw-r--r--source/blender/imbuf/intern/jpeg.c45
-rw-r--r--source/blender/imbuf/intern/metadata.c3
-rw-r--r--source/blender/imbuf/intern/moviecache.c203
-rw-r--r--source/blender/imbuf/intern/openexr/SConscript3
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp226
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.h8
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_multi.h39
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_stub.cpp57
-rw-r--r--source/blender/imbuf/intern/png.c31
-rw-r--r--source/blender/imbuf/intern/radiance_hdr.c30
-rw-r--r--source/blender/imbuf/intern/readimage.c52
-rw-r--r--source/blender/imbuf/intern/rectop.c48
-rw-r--r--source/blender/imbuf/intern/rotate.c12
-rw-r--r--source/blender/imbuf/intern/scaling.c78
-rw-r--r--source/blender/imbuf/intern/targa.c149
-rw-r--r--source/blender/imbuf/intern/thumbs.c50
-rw-r--r--source/blender/imbuf/intern/thumbs_blend.c49
-rw-r--r--source/blender/imbuf/intern/tiff.c161
-rw-r--r--source/blender/imbuf/intern/util.c73
-rw-r--r--source/blender/imbuf/intern/writeimage.c10
-rw-r--r--source/blender/makesdna/DNA_ID.h7
-rw-r--r--source/blender/makesdna/DNA_action_types.h6
-rw-r--r--source/blender/makesdna/DNA_actuator_types.h9
-rw-r--r--source/blender/makesdna/DNA_anim_types.h14
-rw-r--r--source/blender/makesdna/DNA_armature_types.h16
-rw-r--r--source/blender/makesdna/DNA_brush_types.h107
-rw-r--r--source/blender/makesdna/DNA_camera_types.h4
-rw-r--r--source/blender/makesdna/DNA_cloth_types.h20
-rw-r--r--source/blender/makesdna/DNA_curve_types.h22
-rw-r--r--source/blender/makesdna/DNA_customdata_types.h10
-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_gpencil_types.h2
-rw-r--r--source/blender/makesdna/DNA_material_types.h6
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h35
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h45
-rw-r--r--source/blender/makesdna/DNA_meta_types.h4
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h40
-rw-r--r--source/blender/makesdna/DNA_movieclip_types.h10
-rw-r--r--source/blender/makesdna/DNA_node_types.h21
-rw-r--r--source/blender/makesdna/DNA_object_force.h23
-rw-r--r--source/blender/makesdna/DNA_object_types.h15
-rw-r--r--source/blender/makesdna/DNA_particle_types.h26
-rw-r--r--source/blender/makesdna/DNA_scene_types.h17
-rw-r--r--source/blender/makesdna/DNA_sdna_types.h12
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h31
-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.h20
-rw-r--r--source/blender/makesdna/DNA_texture_types.h8
-rw-r--r--source/blender/makesdna/DNA_tracking_types.h3
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h22
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h52
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h8
-rw-r--r--source/blender/makesdna/DNA_world_types.h2
-rw-r--r--source/blender/makesdna/intern/dna_genfile.c432
-rw-r--r--source/blender/makesdna/intern/makesdna.c248
-rw-r--r--source/blender/makesrna/RNA_access.h12
-rw-r--r--source/blender/makesrna/RNA_define.h10
-rw-r--r--source/blender/makesrna/RNA_enum_types.h3
-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.c1691
-rw-r--r--source/blender/makesrna/intern/rna_ID.c229
-rw-r--r--source/blender/makesrna/intern/rna_access.c2762
-rw-r--r--source/blender/makesrna/intern/rna_action.c225
-rw-r--r--source/blender/makesrna/intern/rna_action_api.c4
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c765
-rw-r--r--source/blender/makesrna/intern/rna_actuator_api.c12
-rw-r--r--source/blender/makesrna/intern/rna_animation.c319
-rw-r--r--source/blender/makesrna/intern/rna_animation_api.c15
-rw-r--r--source/blender/makesrna/intern/rna_animviz.c149
-rw-r--r--source/blender/makesrna/intern/rna_armature.c436
-rw-r--r--source/blender/makesrna/intern/rna_armature_api.c19
-rw-r--r--source/blender/makesrna/intern/rna_boid.c252
-rw-r--r--source/blender/makesrna/intern/rna_brush.c395
-rw-r--r--source/blender/makesrna/intern/rna_camera.c85
-rw-r--r--source/blender/makesrna/intern/rna_camera_api.c12
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c163
-rw-r--r--source/blender/makesrna/intern/rna_color.c196
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c897
-rw-r--r--source/blender/makesrna/intern/rna_context.c54
-rw-r--r--source/blender/makesrna/intern/rna_controller.c138
-rw-r--r--source/blender/makesrna/intern/rna_controller_api.c24
-rw-r--r--source/blender/makesrna/intern/rna_curve.c682
-rw-r--r--source/blender/makesrna/intern/rna_define.c1958
-rw-r--r--source/blender/makesrna/intern/rna_dynamicpaint.c342
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c641
-rw-r--r--source/blender/makesrna/intern/rna_fcurve_api.c8
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c294
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c118
-rw-r--r--source/blender/makesrna/intern/rna_group.c30
-rw-r--r--source/blender/makesrna/intern/rna_image.c267
-rw-r--r--source/blender/makesrna/intern/rna_image_api.c71
-rw-r--r--source/blender/makesrna/intern/rna_internal.h18
-rw-r--r--source/blender/makesrna/intern/rna_internal_types.h19
-rw-r--r--source/blender/makesrna/intern/rna_key.c279
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c253
-rw-r--r--source/blender/makesrna/intern/rna_lattice.c126
-rw-r--r--source/blender/makesrna/intern/rna_main.c118
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c600
-rw-r--r--source/blender/makesrna/intern/rna_material.c668
-rw-r--r--source/blender/makesrna/intern/rna_material_api.c8
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c1231
-rw-r--r--source/blender/makesrna/intern/rna_mesh_api.c26
-rw-r--r--source/blender/makesrna/intern/rna_mesh_utils.h171
-rw-r--r--source/blender/makesrna/intern/rna_meta.c99
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c1069
-rw-r--r--source/blender/makesrna/intern/rna_movieclip.c93
-rw-r--r--source/blender/makesrna/intern/rna_nla.c235
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c553
-rw-r--r--source/blender/makesrna/intern/rna_nodetree_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_object.c939
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c241
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c607
-rw-r--r--source/blender/makesrna/intern/rna_packedfile.c4
-rw-r--r--source/blender/makesrna/intern/rna_particle.c1112
-rw-r--r--source/blender/makesrna/intern/rna_pose.c457
-rw-r--r--source/blender/makesrna/intern/rna_pose_api.c15
-rw-r--r--source/blender/makesrna/intern/rna_property.c52
-rw-r--r--source/blender/makesrna/intern/rna_render.c194
-rw-r--r--source/blender/makesrna/intern/rna_rna.c510
-rw-r--r--source/blender/makesrna/intern/rna_scene.c1629
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c37
-rw-r--r--source/blender/makesrna/intern/rna_screen.c86
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c194
-rw-r--r--source/blender/makesrna/intern/rna_sensor.c295
-rw-r--r--source/blender/makesrna/intern/rna_sensor_api.c12
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c756
-rw-r--r--source/blender/makesrna/intern/rna_sequencer_api.c13
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c81
-rw-r--r--source/blender/makesrna/intern/rna_sound.c19
-rw-r--r--source/blender/makesrna/intern/rna_space.c1160
-rw-r--r--source/blender/makesrna/intern/rna_speaker.c79
-rw-r--r--source/blender/makesrna/intern/rna_test.c156
-rw-r--r--source/blender/makesrna/intern/rna_text.c92
-rw-r--r--source/blender/makesrna/intern/rna_text_api.c6
-rw-r--r--source/blender/makesrna/intern/rna_texture.c611
-rw-r--r--source/blender/makesrna/intern/rna_texture_api.c21
-rw-r--r--source/blender/makesrna/intern/rna_timeline.c24
-rw-r--r--source/blender/makesrna/intern/rna_tracking.c563
-rw-r--r--source/blender/makesrna/intern/rna_ui.c250
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c226
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c1175
-rw-r--r--source/blender/makesrna/intern/rna_vfont.c6
-rw-r--r--source/blender/makesrna/intern/rna_wm.c652
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c232
-rw-r--r--source/blender/makesrna/intern/rna_world.c190
-rw-r--r--source/blender/modifiers/CMakeLists.txt5
-rw-r--r--source/blender/modifiers/MOD_modifiertypes.h1
-rw-r--r--source/blender/modifiers/SConscript5
-rw-r--r--source/blender/modifiers/intern/MOD_armature.c16
-rw-r--r--source/blender/modifiers/intern/MOD_array.c373
-rw-r--r--source/blender/modifiers/intern/MOD_bevel.c38
-rw-r--r--source/blender/modifiers/intern/MOD_boolean.c23
-rw-r--r--source/blender/modifiers/intern/MOD_boolean_util.c62
-rw-r--r--source/blender/modifiers/intern/MOD_boolean_util.h10
-rw-r--r--source/blender/modifiers/intern/MOD_build.c13
-rw-r--r--source/blender/modifiers/intern/MOD_cast.c132
-rw-r--r--source/blender/modifiers/intern/MOD_cloth.c54
-rw-r--r--source/blender/modifiers/intern/MOD_collision.c62
-rw-r--r--source/blender/modifiers/intern/MOD_curve.c6
-rw-r--r--source/blender/modifiers/intern/MOD_decimate.c33
-rw-r--r--source/blender/modifiers/intern/MOD_displace.c30
-rw-r--r--source/blender/modifiers/intern/MOD_dynamicpaint.c14
-rw-r--r--source/blender/modifiers/intern/MOD_edgesplit.c22
-rw-r--r--source/blender/modifiers/intern/MOD_explode.c331
-rw-r--r--source/blender/modifiers/intern/MOD_fluidsim.c23
-rw-r--r--source/blender/modifiers/intern/MOD_fluidsim_util.c127
-rw-r--r--source/blender/modifiers/intern/MOD_hook.c56
-rw-r--r--source/blender/modifiers/intern/MOD_lattice.c18
-rw-r--r--source/blender/modifiers/intern/MOD_mask.c27
-rw-r--r--source/blender/modifiers/intern/MOD_meshdeform.c102
-rw-r--r--source/blender/modifiers/intern/MOD_mirror.c26
-rw-r--r--source/blender/modifiers/intern/MOD_multires.c44
-rw-r--r--source/blender/modifiers/intern/MOD_ocean.c8
-rw-r--r--source/blender/modifiers/intern/MOD_particleinstance.c80
-rw-r--r--source/blender/modifiers/intern/MOD_particlesystem.c42
-rw-r--r--source/blender/modifiers/intern/MOD_remesh.c8
-rw-r--r--source/blender/modifiers/intern/MOD_screw.c71
-rw-r--r--source/blender/modifiers/intern/MOD_shapekey.c16
-rw-r--r--source/blender/modifiers/intern/MOD_shrinkwrap.c12
-rw-r--r--source/blender/modifiers/intern/MOD_simpledeform.c74
-rw-r--r--source/blender/modifiers/intern/MOD_smoke.c54
-rw-r--r--source/blender/modifiers/intern/MOD_smooth.c10
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c117
-rw-r--r--source/blender/modifiers/intern/MOD_subsurf.c6
-rw-r--r--source/blender/modifiers/intern/MOD_surface.c39
-rw-r--r--source/blender/modifiers/intern/MOD_util.c51
-rw-r--r--source/blender/modifiers/intern/MOD_uvproject.c77
-rw-r--r--source/blender/modifiers/intern/MOD_warp.c52
-rw-r--r--source/blender/modifiers/intern/MOD_wave.c60
-rw-r--r--source/blender/modifiers/intern/MOD_weightvg_util.c20
-rw-r--r--source/blender/modifiers/intern/MOD_weightvg_util.h6
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgedit.c20
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgmix.c28
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgproximity.c60
-rw-r--r--source/blender/nodes/CMakeLists.txt8
-rw-r--r--source/blender/nodes/NOD_composite.h1
-rw-r--r--source/blender/nodes/SConscript3
-rw-r--r--source/blender/nodes/composite/node_composite_tree.c304
-rw-r--r--source/blender/nodes/composite/node_composite_util.c258
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_alphaOver.c20
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_bilateralblur.c62
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_blur.c157
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_brightness.c14
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_channelMatte.c14
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_chromaMatte.c14
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_colorMatte.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_colorSpill.c52
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_colorbalance.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_composite.c16
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_crop.c18
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_curves.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_defocus.c14
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_diffMatte.c18
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_dilate.c9
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_directionalblur.c14
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_displace.c20
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_distanceMatte.c14
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c2304
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_filter.c46
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_flip.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_gamma.c6
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_glare.c3
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_hueSatVal.c10
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_huecorrect.c6
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_idMask.c20
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_image.c168
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_invert.c19
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_levels.c46
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_lummaMatte.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_mapUV.c24
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_mapValue.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_math.c32
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_mixrgb.c6
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_movieclip.c23
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_moviedistortion.c27
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_normal.c6
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_normalize.c7
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_outputFile.c340
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_premulkey.c6
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_rotate.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_scale.c19
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c21
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c14
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c14
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c14
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_setalpha.c4
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_splitViewer.c24
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_stabilize2d.c4
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_texture.c16
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_tonemap.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_transform.c10
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_translate.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_valToRgb.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_vecBlur.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_viewer.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_zcombine.c28
-rw-r--r--source/blender/nodes/intern/node_common.c62
-rw-r--r--source/blender/nodes/intern/node_exec.c36
-rw-r--r--source/blender/nodes/intern/node_socket.c20
-rw-r--r--source/blender/nodes/intern/node_util.c88
-rw-r--r--source/blender/nodes/intern/node_util.h2
-rw-r--r--source/blender/nodes/shader/node_shader_tree.c50
-rw-r--r--source/blender/nodes/shader/node_shader_util.c71
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_camera.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_curves.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_dynamic.c16
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_geom.c16
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_hueSatVal.c4
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_mapping.c16
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_material.c64
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_math.c44
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_normal.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_output.c12
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_checker.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_environment.c7
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_gradient.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_image.c7
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_magic.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_noise.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_sky.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_wave.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_texture.c18
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_valToRgb.c4
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_vectMath.c20
-rw-r--r--source/blender/nodes/texture/node_texture_tree.c46
-rw-r--r--source/blender/nodes/texture/node_texture_util.c29
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_bricks.c7
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_checker.c5
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_compose.c2
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_curves.c2
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_hueSatVal.c8
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_image.c18
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_math.c26
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_output.c35
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_proc.c14
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_texture.c6
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_valToRgb.c2
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_viewer.c2
-rw-r--r--source/blender/python/bmesh/CMakeLists.txt8
-rw-r--r--source/blender/python/bmesh/bmesh_py_api.c72
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.c964
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.h39
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_customdata.c950
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_customdata.h81
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_meshdata.c603
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_meshdata.h59
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_select.c (renamed from source/blender/python/bmesh/bmesh_py_select.c)212
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_select.h (renamed from source/blender/python/bmesh/bmesh_py_select.h)11
-rw-r--r--source/blender/python/bmesh/bmesh_py_utils.c216
-rw-r--r--source/blender/python/generic/bgl.c344
-rw-r--r--source/blender/python/generic/bgl.h20
-rw-r--r--source/blender/python/generic/blf_py_api.c6
-rw-r--r--source/blender/python/generic/bpy_internal_import.c12
-rw-r--r--source/blender/python/generic/idprop_py_api.c589
-rw-r--r--source/blender/python/generic/py_capi_utils.c184
-rw-r--r--source/blender/python/intern/bpy.c27
-rw-r--r--source/blender/python/intern/bpy_app.c68
-rw-r--r--source/blender/python/intern/bpy_app_ffmpeg.c12
-rw-r--r--source/blender/python/intern/bpy_app_handlers.c118
-rw-r--r--source/blender/python/intern/bpy_driver.c6
-rw-r--r--source/blender/python/intern/bpy_interface.c45
-rw-r--r--source/blender/python/intern/bpy_interface_atexit.c4
-rw-r--r--source/blender/python/intern/bpy_library.c97
-rw-r--r--source/blender/python/intern/bpy_operator.c33
-rw-r--r--source/blender/python/intern/bpy_operator_wrap.c3
-rw-r--r--source/blender/python/intern/bpy_props.c88
-rw-r--r--source/blender/python/intern/bpy_rna.c2010
-rw-r--r--source/blender/python/intern/bpy_rna_anim.c18
-rw-r--r--source/blender/python/intern/bpy_rna_array.c164
-rw-r--r--source/blender/python/intern/bpy_rna_callback.c2
-rw-r--r--source/blender/python/intern/bpy_traceback.c28
-rw-r--r--source/blender/python/intern/bpy_util.c8
-rw-r--r--source/blender/python/intern/gpu.c107
-rw-r--r--source/blender/python/intern/gpu.h2
-rw-r--r--source/blender/python/mathutils/mathutils.c81
-rw-r--r--source/blender/python/mathutils/mathutils.h7
-rw-r--r--source/blender/python/mathutils/mathutils_Color.c274
-rw-r--r--source/blender/python/mathutils/mathutils_Color.h13
-rw-r--r--source/blender/python/mathutils/mathutils_Euler.c198
-rw-r--r--source/blender/python/mathutils/mathutils_Euler.h13
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.c427
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.h8
-rw-r--r--source/blender/python/mathutils/mathutils_Quaternion.c308
-rw-r--r--source/blender/python/mathutils/mathutils_Quaternion.h13
-rw-r--r--source/blender/python/mathutils/mathutils_Vector.c1125
-rw-r--r--source/blender/python/mathutils/mathutils_Vector.h3
-rw-r--r--source/blender/python/mathutils/mathutils_geometry.c206
-rw-r--r--source/blender/python/mathutils/mathutils_noise.c124
-rw-r--r--source/blender/python/simple_enum_gen.py4
-rw-r--r--source/blender/quicktime/apple/qtkit_export.m14
-rw-r--r--source/blender/quicktime/apple/qtkit_import.m4
-rw-r--r--source/blender/quicktime/apple/quicktime_export.c102
-rw-r--r--source/blender/quicktime/apple/quicktime_import.c95
-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.h14
-rw-r--r--source/blender/render/intern/include/gammaCorrectionTables.h2
-rw-r--r--source/blender/render/intern/include/pixelblending.h2
-rw-r--r--source/blender/render/intern/include/pixelshading.h11
-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.h12
-rw-r--r--source/blender/render/intern/include/shadbuf.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.cpp124
-rw-r--r--source/blender/render/intern/raytrace/rayobject_blibvh.cpp8
-rw-r--r--source/blender/render/intern/raytrace/rayobject_empty.cpp2
-rw-r--r--source/blender/render/intern/raytrace/rayobject_hint.h5
-rw-r--r--source/blender/render/intern/raytrace/rayobject_instance.cpp14
-rw-r--r--source/blender/render/intern/raytrace/rayobject_internal.h68
-rw-r--r--source/blender/render/intern/raytrace/rayobject_octree.cpp339
-rw-r--r--source/blender/render/intern/raytrace/rayobject_qbvh.cpp12
-rw-r--r--source/blender/render/intern/raytrace/rayobject_rtbuild.cpp134
-rw-r--r--source/blender/render/intern/raytrace/rayobject_svbvh.cpp16
-rw-r--r--source/blender/render/intern/raytrace/rayobject_vbvh.cpp16
-rw-r--r--source/blender/render/intern/raytrace/reorganize.h15
-rw-r--r--source/blender/render/intern/raytrace/svbvh.h4
-rw-r--r--source/blender/render/intern/raytrace/vbvh.h23
-rw-r--r--source/blender/render/intern/source/convertblender.c1573
-rw-r--r--source/blender/render/intern/source/envmap.c173
-rw-r--r--source/blender/render/intern/source/external_engine.c80
-rw-r--r--source/blender/render/intern/source/imagetexture.c403
-rw-r--r--source/blender/render/intern/source/initrender.c134
-rw-r--r--source/blender/render/intern/source/occlusion.c419
-rw-r--r--source/blender/render/intern/source/pipeline.c677
-rw-r--r--source/blender/render/intern/source/pixelblending.c69
-rw-r--r--source/blender/render/intern/source/pixelshading.c194
-rw-r--r--source/blender/render/intern/source/pointdensity.c32
-rw-r--r--source/blender/render/intern/source/rayshade.c467
-rw-r--r--source/blender/render/intern/source/render_result.c504
-rw-r--r--source/blender/render/intern/source/render_texture.c872
-rw-r--r--source/blender/render/intern/source/rendercore.c752
-rw-r--r--source/blender/render/intern/source/renderdatabase.c434
-rw-r--r--source/blender/render/intern/source/shadbuf.c808
-rw-r--r--source/blender/render/intern/source/shadeinput.c392
-rw-r--r--source/blender/render/intern/source/shadeoutput.c553
-rw-r--r--source/blender/render/intern/source/sss.c212
-rw-r--r--source/blender/render/intern/source/strand.c218
-rw-r--r--source/blender/render/intern/source/sunsky.c92
-rw-r--r--source/blender/render/intern/source/volume_precache.c65
-rw-r--r--source/blender/render/intern/source/volumetric.c92
-rw-r--r--source/blender/render/intern/source/voxeldata.c42
-rw-r--r--source/blender/render/intern/source/zbuf.c1388
-rw-r--r--source/blender/windowmanager/CMakeLists.txt6
-rw-r--r--source/blender/windowmanager/SConscript1
-rw-r--r--source/blender/windowmanager/WM_api.h5
-rw-r--r--source/blender/windowmanager/WM_types.h25
-rw-r--r--source/blender/windowmanager/intern/wm.c142
-rw-r--r--source/blender/windowmanager/intern/wm_apple.c49
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c798
-rw-r--r--source/blender/windowmanager/intern/wm_dragdrop.c196
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c443
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c1759
-rw-r--r--source/blender/windowmanager/intern/wm_files.c348
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c171
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c95
-rw-r--r--source/blender/windowmanager/intern/wm_jobs.c278
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c484
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c2022
-rw-r--r--source/blender/windowmanager/intern/wm_subwindow.c217
-rw-r--r--source/blender/windowmanager/intern/wm_window.c693
-rw-r--r--source/blender/windowmanager/wm_event_types.h4
-rw-r--r--source/blender/windowmanager/wm_window.h2
1094 files changed, 140318 insertions, 125318 deletions
diff --git a/source/blender/avi/intern/avi.c b/source/blender/avi/intern/avi.c
index 1da93d5ed50..dff22867d81 100644
--- a/source/blender/avi/intern/avi.c
+++ b/source/blender/avi/intern/avi.c
@@ -53,7 +53,7 @@
static int AVI_DEBUG=0;
static char DEBUG_FCC[4];
-#define DEBUG_PRINT(x) if(AVI_DEBUG) printf("AVI DEBUG: " x);
+#define DEBUG_PRINT(x) if (AVI_DEBUG) { printf("AVI DEBUG: " x); } (void)0
/* local functions */
char *fcc_to_char (unsigned int fcc);
@@ -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;
@@ -217,14 +216,15 @@ int AVI_is_avi (char *name)
!GET_FCC (fp) ||
GET_FCC (fp) != FCC("AVI ")) {
ret = 0;
- } else {
+ }
+ else {
ret = 1;
}
fclose(fp);
return ret;
}
-*/
+#endif
int AVI_is_avi (const char *name)
{
@@ -313,9 +313,11 @@ int AVI_is_avi (const char *name)
fcca == FCC ("RAW ") ||
fcca == 0) {
movie.streams[temp].format = AVI_FORMAT_AVI_RGB;
- } else if (fcca == FCC ("mjpg")||fcca == FCC ("MJPG")) {
+ }
+ else if (fcca == FCC ("mjpg")||fcca == FCC ("MJPG")) {
movie.streams[temp].format = AVI_FORMAT_MJPEG;
- } else {
+ }
+ else {
MEM_freeN(movie.streams);
fclose(movie.fp);
return 0;
@@ -380,10 +382,12 @@ int AVI_is_avi (const char *name)
fcca == FCC ("rgb ") ||
fcca == FCC ("RAW ") ||
fcca == 0 ) {
- } else if ( fcca == FCC ("mjpg") ||
+ }
+ else if ( fcca == FCC ("mjpg") ||
fcca == FCC ("MJPG")) {
movie.streams[temp].format = AVI_FORMAT_MJPEG;
- } else {
+ }
+ else {
MEM_freeN(movie.streams);
fclose(movie.fp);
return 0;
@@ -392,7 +396,8 @@ int AVI_is_avi (const char *name)
}
if (j > 0) fseek (movie.fp, j, SEEK_CUR);
- } else fseek (movie.fp, movie.streams[temp].sf_size, SEEK_CUR);
+ }
+ else fseek (movie.fp, movie.streams[temp].sf_size, SEEK_CUR);
/* Walk to the next LIST */
while (GET_FCC (movie.fp) != FCC("LIST")) {
@@ -496,9 +501,11 @@ AviError AVI_open_movie (const char *name, AviMovie *movie)
fcca == FCC ("RAW ") ||
fcca == 0) {
movie->streams[temp].format = AVI_FORMAT_AVI_RGB;
- } else if (fcca == FCC ("mjpg")||fcca == FCC ("MJPG")) {
+ }
+ else if (fcca == FCC ("mjpg")||fcca == FCC ("MJPG")) {
movie->streams[temp].format = AVI_FORMAT_MJPEG;
- } else {
+ }
+ else {
return AVI_ERROR_COMPRESSION;
}
}
@@ -559,17 +566,20 @@ AviError AVI_open_movie (const char *name, AviMovie *movie)
fcca == FCC ("rgb ") ||
fcca == FCC ("RAW ") ||
fcca == 0 ) {
- } else if ( fcca == FCC ("mjpg") ||
+ }
+ else if ( fcca == FCC ("mjpg") ||
fcca == FCC ("MJPG")) {
movie->streams[temp].format = AVI_FORMAT_MJPEG;
- } else {
+ }
+ else {
return AVI_ERROR_COMPRESSION;
}
}
}
if (j > 0) fseek (movie->fp, j, SEEK_CUR);
- } else fseek (movie->fp, movie->streams[temp].sf_size, SEEK_CUR);
+ }
+ else fseek (movie->fp, movie->streams[temp].sf_size, SEEK_CUR);
/* Walk to the next LIST */
while (GET_FCC (movie->fp) != FCC("LIST")) {
@@ -596,7 +606,8 @@ AviError AVI_open_movie (const char *name, AviMovie *movie)
break;
else
fseek (movie->fp, size-4, SEEK_CUR);
- } else {
+ }
+ else {
fseek (movie->fp, size, SEEK_CUR);
}
if (ftell(movie->fp) > movie->size) {
@@ -659,8 +670,8 @@ 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 */
- while(rewind && frame > -1) {
+ * If a chunk has Size 0 we need to rewind to previous frame */
+ while (rewind && frame > -1) {
i=0;
cur_frame=-1;
rewind = 0;
@@ -671,7 +682,8 @@ void *AVI_read_frame (AviMovie *movie, AviFormat format, int frame, int stream)
if ((cur_frame == frame -1) && (movie->entries[i].Size == 0)) {
rewind = 1;
frame = frame -1;
- } else {
+ }
+ else {
cur_frame++;
}
}
@@ -798,13 +810,14 @@ 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 {
-*/
+ }
+ else {
+#endif
movie->streams[i].sf = MEM_mallocN (sizeof(AviBitmapInfoHeader), "moviestreamformatS");
movie->streams[i].sf_size = sizeof(AviBitmapInfoHeader);
diff --git a/source/blender/avi/intern/avirgb.c b/source/blender/avi/intern/avirgb.c
index 42a094b1e1c..8e5806c09cf 100644
--- a/source/blender/avi/intern/avirgb.c
+++ b/source/blender/avi/intern/avirgb.c
@@ -94,7 +94,8 @@ void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *bu
MEM_freeN (buffer);
return buf;
- } else {
+ }
+ else {
buf = MEM_mallocN (movie->header->Height * movie->header->Width * 3, "fromavirgbbuf");
rowstride = movie->header->Width*3;
diff --git a/source/blender/avi/intern/mjpeg.c b/source/blender/avi/intern/mjpeg.c
index dab0b213d95..f6ebcab2aeb 100644
--- a/source/blender/avi/intern/mjpeg.c
+++ b/source/blender/avi/intern/mjpeg.c
@@ -159,7 +159,7 @@ static int Decode_JPEG(unsigned char *inBuffer, unsigned char *outBuffer, unsign
jpeg_create_decompress(&dinfo);
jpegmemsrcmgr_build(&dinfo, inBuffer, bufsize);
jpeg_read_header(&dinfo, TRUE);
- if (dinfo.dc_huff_tbl_ptrs[0] == NULL){
+ if (dinfo.dc_huff_tbl_ptrs[0] == NULL) {
std_huff_tables(&dinfo);
}
dinfo.out_color_space = JCS_RGB;
@@ -181,13 +181,13 @@ static int Decode_JPEG(unsigned char *inBuffer, unsigned char *outBuffer, unsign
numbytes= 0;
jpeg_read_header(&dinfo, TRUE);
- if (dinfo.dc_huff_tbl_ptrs[0] == NULL){
+ if (dinfo.dc_huff_tbl_ptrs[0] == NULL) {
std_huff_tables(&dinfo);
}
jpeg_start_decompress(&dinfo);
rowstride= dinfo.output_width*dinfo.output_components;
- for (y= 0; y<dinfo.output_height; y++){
+ for (y= 0; y<dinfo.output_height; y++) {
jpeg_read_scanlines(&dinfo, (JSAMPARRAY) &outBuffer, 1);
outBuffer += rowstride;
}
@@ -251,7 +251,7 @@ static void Compress_JPEG(int quality, unsigned char *outbuffer, unsigned char *
jpeg_write_marker (&cinfo, JPEG_COM, marker, 60);
rowstride= cinfo.image_width*cinfo.input_components;
- for (y = 0; y < cinfo.image_height; y++){
+ for (y = 0; y < cinfo.image_height; y++) {
jpeg_write_scanlines(&cinfo, (JSAMPARRAY) &inBuffer, 1);
inBuffer += rowstride;
}
@@ -301,7 +301,8 @@ static int check_and_decode_jpeg(unsigned char *inbuf, unsigned char *outbuf, in
MEM_freeN(tmpbuf);
return ret;
- } else {
+ }
+ else {
return Decode_JPEG(inbuf, outbuf, width, height, bufsize);
}
}
@@ -329,7 +330,8 @@ static void check_and_compress_jpeg(int quality, unsigned char *outbuf, unsigned
Compress_JPEG(quality, outbuf, tmpbuf, jwidth, jheight, bufsize);
MEM_freeN(tmpbuf);
- } else {
+ }
+ else {
Compress_JPEG(quality, outbuf, inbuf, width, height, bufsize);
}
}
@@ -369,7 +371,8 @@ void *avi_converter_to_mjpeg (AviMovie *movie, int stream, unsigned char *buffer
buf = MEM_mallocN (movie->header->Height * movie->header->Width * 3, "avi.avi_converter_to_mjpeg 1");
if (!movie->interlace) {
check_and_compress_jpeg(movie->streams[stream].sh.Quality/100, buf, buffer, movie->header->Width, movie->header->Height, bufsize);
- } else {
+ }
+ else {
deinterlace (movie->odd_fields, buf, buffer, movie->header->Width, movie->header->Height);
MEM_freeN (buffer);
diff --git a/source/blender/avi/intern/rgb32.c b/source/blender/avi/intern/rgb32.c
index e3be082cca6..c6830d9666a 100644
--- a/source/blender/avi/intern/rgb32.c
+++ b/source/blender/avi/intern/rgb32.c
@@ -82,7 +82,7 @@ void *avi_converter_to_rgb32 (AviMovie *movie, int stream, unsigned char *buffer
to= buf; from= buffer;
i=movie->header->Height*movie->header->Width;
- while(i--) {
+ while (i--) {
memcpy(to, from, 3);
to+=4; from+=3;
}
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index d7b441e70e1..911a94cb56a 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]);
@@ -76,61 +76,49 @@ void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t l
void BLF_draw(int fontid, const char *str, size_t len);
void BLF_draw_ascii(int fontid, const char *str, size_t len);
-/*
- * This function return the bounding box of the string
+/* This function return the bounding box of the string
* and are not multiplied by the aspect.
*/
void BLF_boundbox(int fontid, const char *str, struct rctf *box);
-/*
- * The next both function return the width and height
+/* The next both function return the width and height
* of the string, using the current font and both value
* are multiplied by the aspect of the font.
*/
float BLF_width(int fontid, const char *str);
float BLF_height(int fontid, const char *str);
-/*
- * Return dimensions of the font without any sample text.
- */
+/* Return dimensions of the font without any sample text. */
float BLF_height_max(int fontid);
float BLF_width_max(int fontid);
float BLF_descender(int fontid);
float BLF_ascender(int fontid);
-/*
- * The following function return the width and height of the string, but
+/* The following function return the width and height of the string, but
* just in one call, so avoid extra freetype2 stuff.
*/
void BLF_width_and_height(int fontid, const char *str, float *width, float *height);
-/*
- * For fixed width fonts only, returns the width of a
+/* For fixed width fonts only, returns the width of a
* character.
*/
float BLF_fixed_width(int fontid);
-/*
- * and this two function return the width and height
+/* and this two function return the width and height
* of the string, using the default font and both value
* are multiplied by the aspect of the font.
*/
float BLF_width_default(const char *str);
float BLF_height_default(const char *str);
-/*
- * Set rotation for default font.
- */
+/* Set rotation for default font. */
void BLF_rotation_default(float angle);
-/*
- * Enable/disable options to the default font.
- */
+/* Enable/disable options to the default font. */
void BLF_enable_default(int option);
void BLF_disable_default(int option);
-/*
- * By default, rotation and clipping are disable and
+/* By default, rotation and clipping are disable and
* have to be enable/disable using BLF_enable/disable.
*/
void BLF_rotation(int fontid, float angle);
@@ -141,39 +129,34 @@ void BLF_blur(int fontid, int size);
void BLF_enable(int fontid, int option);
void BLF_disable(int fontid, int option);
-/*
- * Shadow options, level is the blur level, can be 3, 5 or 0 and
+/* Shadow options, level is the blur level, can be 3, 5 or 0 and
* the other argument are the rgba color.
- * Take care that shadow need to be enable using BLF_enable!!.
+ * Take care that shadow need to be enable using BLF_enable!!!
*/
void BLF_shadow(int fontid, int level, float r, float g, float b, float a);
-/*
- * Set the offset for shadow text, this is the current cursor
+/* Set the offset for shadow text, this is the current cursor
* position plus this offset, don't need call BLF_position before
* this function, the current position is calculate only on
* BLF_draw, so it's safe call this whenever you like.
*/
void BLF_shadow_offset(int fontid, int x, int y);
-/*
- * Set the buffer, size and number of channels to draw, one thing to take care is call
+/* Set the buffer, size and number of channels to draw, one thing to take care is call
* this function with NULL pointer when we finish, for example:
- * BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4);
*
- * ... set color, position and draw ...
+ * BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4);
+ *
+ * ... set color, position and draw ...
*
- * BLF_buffer(NULL, NULL, 0, 0, 0);
+ * BLF_buffer(NULL, NULL, 0, 0, 0);
*/
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch);
-/*
- * Set the color to be used for text.
- */
+/* Set the color to be used for text. */
void BLF_buffer_col(int fontid, float r, float g, float b, float a);
-/*
- * Draw the string into the buffer, this function draw in both buffer, float and unsigned char _BUT_
+/* Draw the string into the buffer, this function draw in both buffer, float and unsigned char _BUT_
* it's not necessary set both buffer, NULL is valid here.
*/
void BLF_draw_buffer(int fontid, const char *str);
@@ -200,8 +183,8 @@ void BLF_dir_free(char **dirs, int count);
#define BLF_DRAW_STR_DUMMY_MAX 1024
-// XXX, bad design
+/* XXX, bad design */
extern int blf_mono_font;
-extern int blf_mono_font_render; // dont mess drawing with render threads.
+extern int blf_mono_font_render; /* don't mess drawing with render threads. */
#endif /* __BLF_API_H__ */
diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h
index 868a58d23c0..5e2fee36af0 100644
--- a/source/blender/blenfont/BLF_translation.h
+++ b/source/blender/blenfont/BLF_translation.h
@@ -47,8 +47,7 @@ const char *BLF_pgettext(const char *context, const char *message);
/* blf_lang.c */
-/*
- * Search the path directory to the locale files, this try all
+/* Search the path directory to the locale files, this try all
* the case for Linux, Win and Mac.
*/
void BLF_lang_init(void);
@@ -62,15 +61,25 @@ void BLF_lang_encoding(const char *str);
/* translation */
int BLF_translate_iface(void);
int BLF_translate_tooltips(void);
-const char *BLF_translate_do_iface(const char *msgid);
-const char *BLF_translate_do_tooltip(const char *msgid);
+const char *BLF_translate_do_iface(const char *contex, const char *msgid);
+const char *BLF_translate_do_tooltip(const char *contex, const char *msgid);
-/*#define _(msgid) BLF_gettext(msgid)*/
/* The "translation-marker" macro. */
#define N_(msgid) msgid
/* Those macros should be used everywhere in UI code. */
-#define IFACE_(msgid) BLF_translate_do_iface(msgid)
-#define TIP_(msgid) BLF_translate_do_tooltip(msgid)
+#ifdef WITH_INTERNATIONAL
+/* #define _(msgid) BLF_gettext(msgid) */
+ #define IFACE_(msgid) BLF_translate_do_iface(NULL, msgid)
+ #define TIP_(msgid) BLF_translate_do_tooltip(NULL, msgid)
+ #define CTX_IFACE_(context, msgid) BLF_translate_do_iface(context, msgid)
+ #define CTX_TIP_(context, msgid) BLF_translate_do_tooltip(context, msgid)
+#else
+/* #define _(msgid) msgid */
+ #define IFACE_(msgid) msgid
+ #define TIP_(msgid) msgid
+ #define CTX_IFACE_(context, msgid) msgid
+ #define CTX_TIP_(context, msgid) msgid
+#endif
#endif /* __BLF_TRANSLATION_H__ */
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index a387b416c38..626c591c40f 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -62,13 +62,13 @@
static FontBLF *global_font[BLF_MAX_FONT] = {0};
/* Default size and dpi, for BLF_draw_default. */
-static int global_font_default= -1;
-static int global_font_points= 11;
-static int global_font_dpi= 72;
+static int global_font_default = -1;
+static int global_font_points = 11;
+static int global_font_dpi = 72;
-// XXX, should these be made into global_font_'s too?
-int blf_mono_font= -1;
-int blf_mono_font_render= -1;
+/* XXX, should these be made into global_font_'s too? */
+int blf_mono_font = -1;
+int blf_mono_font_render = -1;
static FontBLF *BLF_get(int fontid)
{
@@ -81,11 +81,11 @@ int BLF_init(int points, int dpi)
{
int i;
- for (i= 0; i < BLF_MAX_FONT; i++)
- global_font[i]= NULL;
+ for (i = 0; i < BLF_MAX_FONT; i++)
+ global_font[i] = NULL;
- global_font_points= points;
- global_font_dpi= dpi;
+ global_font_points = points;
+ global_font_dpi = dpi;
return blf_font_init();
}
@@ -94,11 +94,11 @@ void BLF_exit(void)
FontBLF *font;
int i;
- for (i= 0; i < BLF_MAX_FONT; i++) {
- font= global_font[i];
+ for (i = 0; i < BLF_MAX_FONT; i++) {
+ font = global_font[i];
if (font) {
blf_font_free(font);
- global_font[i]= NULL;
+ global_font[i] = NULL;
}
}
@@ -110,8 +110,8 @@ void BLF_cache_clear(void)
FontBLF *font;
int i;
- for (i= 0; i < BLF_MAX_FONT; i++) {
- font= global_font[i];
+ for (i = 0; i < BLF_MAX_FONT; i++) {
+ font = global_font[i];
if (font)
blf_glyph_cache_clear(font);
}
@@ -122,8 +122,8 @@ static int blf_search(const char *name)
FontBLF *font;
int i;
- for (i= 0; i < BLF_MAX_FONT; i++) {
- font= global_font[i];
+ for (i = 0; i < BLF_MAX_FONT; i++) {
+ font = global_font[i];
if (font && (!strcmp(font->name, name)))
return i;
}
@@ -135,8 +135,8 @@ static int blf_search_available(void)
{
int i;
- for (i= 0; i < BLF_MAX_FONT; i++)
- if(!global_font[i])
+ for (i = 0; i < BLF_MAX_FONT; i++)
+ if (!global_font[i])
return i;
return -1;
@@ -152,7 +152,7 @@ int BLF_load(const char *name)
return -1;
/* check if we already load this font. */
- i= blf_search(name);
+ i = blf_search(name);
if (i >= 0) {
/*font= global_font[i];*/ /*UNUSED*/
return i;
@@ -164,13 +164,13 @@ int BLF_load(const char *name)
return -1;
}
- filename= blf_dir_search(name);
+ filename = blf_dir_search(name);
if (!filename) {
printf("Can't find font: %s\n", name);
return -1;
}
- font= blf_font_new(name, filename);
+ font = blf_font_new(name, filename);
MEM_freeN(filename);
if (!font) {
@@ -178,7 +178,7 @@ int BLF_load(const char *name)
return -1;
}
- global_font[i]= font;
+ global_font[i] = font;
return i;
}
@@ -200,13 +200,13 @@ int BLF_load_unique(const char *name)
return -1;
}
- filename= blf_dir_search(name);
+ filename = blf_dir_search(name);
if (!filename) {
printf("Can't find font: %s\n", name);
return -1;
}
- font= blf_font_new(name, filename);
+ font = blf_font_new(name, filename);
MEM_freeN(filename);
if (!font) {
@@ -214,13 +214,13 @@ int BLF_load_unique(const char *name)
return -1;
}
- global_font[i]= font;
+ global_font[i] = font;
return i;
}
void BLF_metrics_attach(int fontid, unsigned char *mem, int mem_size)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
blf_font_attach_from_mem(font, mem, mem_size);
@@ -235,7 +235,7 @@ int BLF_load_mem(const char *name, unsigned char *mem, int mem_size)
if (!name)
return -1;
- i= blf_search(name);
+ i = blf_search(name);
if (i >= 0) {
/*font= global_font[i];*/ /*UNUSED*/
return i;
@@ -252,13 +252,13 @@ int BLF_load_mem(const char *name, unsigned char *mem, int mem_size)
return -1;
}
- font= blf_font_new_from_mem(name, mem, mem_size);
+ font = blf_font_new_from_mem(name, mem, mem_size);
if (!font) {
printf("Can't load font: %s from memory!!\n", name);
return -1;
}
- global_font[i]= font;
+ global_font[i] = font;
return i;
}
@@ -285,13 +285,13 @@ int BLF_load_mem_unique(const char *name, unsigned char *mem, int mem_size)
return -1;
}
- font= blf_font_new_from_mem(name, mem, mem_size);
+ font = blf_font_new_from_mem(name, mem, mem_size);
if (!font) {
printf("Can't load font: %s from memory!!\n", name);
return -1;
}
- global_font[i]= font;
+ global_font[i] = font;
return i;
}
@@ -300,19 +300,19 @@ void BLF_unload(const char *name)
FontBLF *font;
int i;
- for (i= 0; i < BLF_MAX_FONT; i++) {
- font= global_font[i];
+ for (i = 0; i < BLF_MAX_FONT; i++) {
+ font = global_font[i];
if (font && (!strcmp(font->name, name))) {
blf_font_free(font);
- global_font[i]= NULL;
+ global_font[i] = NULL;
}
}
}
void BLF_enable(int fontid, int option)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
font->flags |= option;
@@ -321,7 +321,7 @@ void BLF_enable(int fontid, int option)
void BLF_disable(int fontid, int option)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
font->flags &= ~option;
@@ -330,7 +330,7 @@ void BLF_disable(int fontid, int option)
void BLF_enable_default(int option)
{
- FontBLF *font= BLF_get(global_font_default);
+ FontBLF *font = BLF_get(global_font_default);
if (font) {
font->flags |= option;
@@ -339,7 +339,7 @@ void BLF_enable_default(int option)
void BLF_disable_default(int option)
{
- FontBLF *font= BLF_get(global_font_default);
+ FontBLF *font = BLF_get(global_font_default);
if (font) {
font->flags &= ~option;
@@ -348,18 +348,18 @@ void BLF_disable_default(int option)
void BLF_aspect(int fontid, float x, float y, float z)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
- font->aspect[0]= x;
- font->aspect[1]= y;
- font->aspect[2]= z;
+ font->aspect[0] = x;
+ font->aspect[1] = y;
+ font->aspect[2] = z;
}
}
void BLF_matrix(int fontid, const double m[16])
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
memcpy(font->m, m, sizeof(font->m));
@@ -368,24 +368,24 @@ void BLF_matrix(int fontid, const double m[16])
void BLF_position(int fontid, float x, float y, float z)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
float xa, ya, za;
float remainder;
if (font->flags & BLF_ASPECT) {
- xa= font->aspect[0];
- ya= font->aspect[1];
- za= font->aspect[2];
+ xa = font->aspect[0];
+ ya = font->aspect[1];
+ za = font->aspect[2];
}
else {
- xa= 1.0f;
- ya= 1.0f;
- za= 1.0f;
+ xa = 1.0f;
+ ya = 1.0f;
+ za = 1.0f;
}
- remainder= x - floorf(x);
+ remainder = x - floorf(x);
if (remainder > 0.4f && remainder < 0.6f) {
if (remainder < 0.5f)
x -= 0.1f * xa;
@@ -393,7 +393,7 @@ void BLF_position(int fontid, float x, float y, float z)
x += 0.1f * xa;
}
- remainder= y - floorf(y);
+ remainder = y - floorf(y);
if (remainder > 0.4f && remainder < 0.6f) {
if (remainder < 0.5f)
y -= 0.1f * ya;
@@ -401,7 +401,7 @@ void BLF_position(int fontid, float x, float y, float z)
y += 0.1f * ya;
}
- remainder= z - floorf(z);
+ remainder = z - floorf(z);
if (remainder > 0.4f && remainder < 0.6f) {
if (remainder < 0.5f)
z -= 0.1f * za;
@@ -409,15 +409,15 @@ void BLF_position(int fontid, float x, float y, float z)
z += 0.1f * za;
}
- font->pos[0]= x;
- font->pos[1]= y;
- font->pos[2]= z;
+ font->pos[0] = x;
+ font->pos[1] = y;
+ font->pos[2] = z;
}
}
void BLF_size(int fontid, int size, int dpi)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
blf_font_size(font, size, dpi);
@@ -426,10 +426,10 @@ void BLF_size(int fontid, int size, int dpi)
void BLF_blur(int fontid, int size)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
- font->blur= size;
+ font->blur = size;
}
}
@@ -439,7 +439,7 @@ void BLF_draw_default(float x, float y, float z, const char *str, size_t len)
return;
if (global_font_default == -1)
- global_font_default= blf_search("default");
+ global_font_default = blf_search("default");
if (global_font_default == -1) {
printf("Warning: Can't found default font!!\n");
@@ -458,7 +458,7 @@ void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t l
return;
if (global_font_default == -1)
- global_font_default= blf_search("default");
+ global_font_default = blf_search("default");
if (global_font_default == -1) {
printf("Warning: Can't found default font!!\n");
@@ -472,10 +472,10 @@ void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t l
void BLF_rotation_default(float angle)
{
- FontBLF *font= BLF_get(global_font_default);
+ FontBLF *font = BLF_get(global_font_default);
if (font) {
- font->angle= angle;
+ font->angle = angle;
}
}
@@ -511,11 +511,11 @@ static void blf_draw__start(FontBLF *font, GLint *mode, GLint *param)
if (font->flags & BLF_ROTATION)
glRotatef(font->angle, 0.0f, 0.0f, 1.0f);
- if(font->shadow || font->blur)
+ if (font->shadow || font->blur)
glGetFloatv(GL_CURRENT_COLOR, font->orig_col);
/* always bind the texture for the first glyph */
- font->tex_bind_state= -1;
+ font->tex_bind_state = -1;
/* Save the current parameter to restore it later. */
glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, param);
@@ -544,7 +544,7 @@ static void blf_draw__end(GLint mode, GLint param)
void BLF_draw(int fontid, const char *str, size_t len)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
GLint mode, param;
if (font && font->glyph_cache) {
@@ -556,7 +556,7 @@ void BLF_draw(int fontid, const char *str, size_t len)
void BLF_draw_ascii(int fontid, const char *str, size_t len)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
GLint mode, param;
if (font && font->glyph_cache) {
@@ -568,7 +568,7 @@ void BLF_draw_ascii(int fontid, const char *str, size_t len)
void BLF_boundbox(int fontid, const char *str, rctf *box)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
blf_font_boundbox(font, str, box);
@@ -577,7 +577,7 @@ void BLF_boundbox(int fontid, const char *str, rctf *box)
void BLF_width_and_height(int fontid, const char *str, float *width, float *height)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font && font->glyph_cache) {
blf_font_width_and_height(font, str, width, height);
@@ -586,7 +586,7 @@ void BLF_width_and_height(int fontid, const char *str, float *width, float *heig
float BLF_width(int fontid, const char *str)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font && font->glyph_cache) {
return blf_font_width(font, str);
@@ -597,7 +597,7 @@ float BLF_width(int fontid, const char *str)
float BLF_fixed_width(int fontid)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font && font->glyph_cache) {
return blf_font_fixed_width(font);
@@ -609,7 +609,7 @@ float BLF_fixed_width(int fontid)
float BLF_width_default(const char *str)
{
if (global_font_default == -1)
- global_font_default= blf_search("default");
+ global_font_default = blf_search("default");
if (global_font_default == -1) {
printf("Error: Can't found default font!!\n");
@@ -622,7 +622,7 @@ float BLF_width_default(const char *str)
float BLF_height(int fontid, const char *str)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font && font->glyph_cache) {
return blf_font_height(font, str);
@@ -633,7 +633,7 @@ float BLF_height(int fontid, const char *str)
float BLF_height_max(int fontid)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font && font->glyph_cache) {
return font->glyph_cache->max_glyph_height;
@@ -644,7 +644,7 @@ float BLF_height_max(int fontid)
float BLF_width_max(int fontid)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font && font->glyph_cache) {
return font->glyph_cache->max_glyph_width;
@@ -655,7 +655,7 @@ float BLF_width_max(int fontid)
float BLF_descender(int fontid)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font && font->glyph_cache) {
return font->glyph_cache->descender;
@@ -666,7 +666,7 @@ float BLF_descender(int fontid)
float BLF_ascender(int fontid)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font && font->glyph_cache) {
return font->glyph_cache->ascender;
@@ -678,7 +678,7 @@ float BLF_ascender(int fontid)
float BLF_height_default(const char *str)
{
if (global_font_default == -1)
- global_font_default= blf_search("default");
+ global_font_default = blf_search("default");
if (global_font_default == -1) {
printf("Error: Can't found default font!!\n");
@@ -692,88 +692,88 @@ float BLF_height_default(const char *str)
void BLF_rotation(int fontid, float angle)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
- font->angle= angle;
+ font->angle = angle;
}
}
void BLF_clipping(int fontid, float xmin, float ymin, float xmax, float ymax)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
- font->clip_rec.xmin= xmin;
- font->clip_rec.ymin= ymin;
- font->clip_rec.xmax= xmax;
- font->clip_rec.ymax= ymax;
+ font->clip_rec.xmin = xmin;
+ font->clip_rec.ymin = ymin;
+ font->clip_rec.xmax = xmax;
+ font->clip_rec.ymax = ymax;
}
}
void BLF_clipping_default(float xmin, float ymin, float xmax, float ymax)
{
- FontBLF *font= BLF_get(global_font_default);
+ FontBLF *font = BLF_get(global_font_default);
if (font) {
- font->clip_rec.xmin= xmin;
- font->clip_rec.ymin= ymin;
- font->clip_rec.xmax= xmax;
- font->clip_rec.ymax= ymax;
+ font->clip_rec.xmin = xmin;
+ font->clip_rec.ymin = ymin;
+ font->clip_rec.xmax = xmax;
+ font->clip_rec.ymax = ymax;
}
}
void BLF_shadow(int fontid, int level, float r, float g, float b, float a)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
- font->shadow= level;
- font->shadow_col[0]= r;
- font->shadow_col[1]= g;
- font->shadow_col[2]= b;
- font->shadow_col[3]= a;
+ font->shadow = level;
+ font->shadow_col[0] = r;
+ font->shadow_col[1] = g;
+ font->shadow_col[2] = b;
+ font->shadow_col[3] = a;
}
}
void BLF_shadow_offset(int fontid, int x, int y)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
- font->shadow_x= x;
- font->shadow_y= y;
+ font->shadow_x = x;
+ font->shadow_y = y;
}
}
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
- font->b_fbuf= fbuf;
- font->b_cbuf= cbuf;
- font->bw= w;
- font->bh= h;
- font->bch= nch;
+ font->b_fbuf = fbuf;
+ font->b_cbuf = cbuf;
+ font->bw = w;
+ font->bh = h;
+ font->bch = nch;
}
}
void BLF_buffer_col(int fontid, float r, float g, float b, float a)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font) {
- font->b_col[0]= r;
- font->b_col[1]= g;
- font->b_col[2]= b;
- font->b_col[3]= a;
+ font->b_col[0] = r;
+ font->b_col[1] = g;
+ font->b_col[2] = b;
+ font->b_col[3] = a;
}
}
void BLF_draw_buffer(int fontid, const char *str)
{
- FontBLF *font= BLF_get(fontid);
+ FontBLF *font = BLF_get(fontid);
if (font && font->glyph_cache && (font->b_fbuf || font->b_cbuf)) {
blf_font_buffer(font, str);
diff --git a/source/blender/blenfont/intern/blf_dir.c b/source/blender/blenfont/intern/blf_dir.c
index b82393fad92..824f1715f3c 100644
--- a/source/blender/blenfont/intern/blf_dir.c
+++ b/source/blender/blenfont/intern/blf_dir.c
@@ -51,17 +51,17 @@
#include "blf_internal_types.h"
#include "blf_internal.h"
-static ListBase global_font_dir= { NULL, NULL };
+static ListBase global_font_dir = { NULL, NULL };
static DirBLF *blf_dir_find(const char *path)
{
DirBLF *p;
- p= global_font_dir.first;
+ p = global_font_dir.first;
while (p) {
if (BLI_path_cmp(p->path, path) == 0)
return p;
- p= p->next;
+ p = p->next;
}
return NULL;
}
@@ -70,12 +70,12 @@ void BLF_dir_add(const char *path)
{
DirBLF *dir;
- dir= blf_dir_find(path);
+ dir = blf_dir_find(path);
if (dir) /* already in the list ? just return. */
return;
- dir= (DirBLF *)MEM_callocN(sizeof(DirBLF), "BLF_dir_add");
- dir->path= BLI_strdup(path);
+ dir = (DirBLF *)MEM_callocN(sizeof(DirBLF), "BLF_dir_add");
+ dir->path = BLI_strdup(path);
BLI_addhead(&global_font_dir, dir);
}
@@ -83,7 +83,7 @@ void BLF_dir_rem(const char *path)
{
DirBLF *dir;
- dir= blf_dir_find(path);
+ dir = blf_dir_find(path);
if (dir) {
BLI_remlink(&global_font_dir, dir);
MEM_freeN(dir->path);
@@ -98,19 +98,19 @@ char **BLF_dir_get(int *ndir)
char *path;
int i, count;
- count= BLI_countlist(&global_font_dir);
+ count = BLI_countlist(&global_font_dir);
if (!count)
return NULL;
- dirs= (char **)MEM_callocN(sizeof(char *) * count, "BLF_dir_get");
- p= global_font_dir.first;
- i= 0;
+ dirs = (char **)MEM_callocN(sizeof(char *) * count, "BLF_dir_get");
+ p = global_font_dir.first;
+ i = 0;
while (p) {
- path= BLI_strdup(p->path);
- dirs[i]= path;
- p= p->next;
+ path = BLI_strdup(p->path);
+ dirs[i] = path;
+ p = p->next;
}
- *ndir= i;
+ *ndir = i;
return dirs;
}
@@ -119,8 +119,8 @@ void BLF_dir_free(char **dirs, int count)
char *path;
int i;
- for (i= 0; i < count; i++) {
- path= dirs[i];
+ for (i = 0; i < count; i++) {
+ path = dirs[i];
MEM_freeN(path);
}
MEM_freeN(dirs);
@@ -130,12 +130,12 @@ char *blf_dir_search(const char *file)
{
DirBLF *dir;
char full_path[FILE_MAX];
- char *s= NULL;
+ char *s = NULL;
- for(dir=global_font_dir.first; dir; dir= dir->next) {
+ for (dir = global_font_dir.first; dir; dir = dir->next) {
BLI_join_dirfile(full_path, sizeof(full_path), dir->path, file);
if (BLI_exists(full_path)) {
- s= BLI_strdup(full_path);
+ s = BLI_strdup(full_path);
break;
}
}
@@ -143,32 +143,32 @@ char *blf_dir_search(const char *file)
if (!s) {
/* check the current directory, why not ? */
if (BLI_exists(file))
- s= BLI_strdup(file);
+ s = BLI_strdup(file);
}
return s;
}
-#if 0 // UNUSED
+#if 0 /* UNUSED */
int blf_dir_split(const char *str, char *file, int *size)
{
int i, len;
char *s;
/* Window, Linux or Mac, this is always / */
- s= strrchr(str, '/');
+ s = strrchr(str, '/');
if (s) {
- len= s - str;
- for (i= 0; i < len; i++)
- file[i]= str[i];
-
- file[i]= '.';
- file[i+1]= 't';
- file[i+2]= 't';
- file[i+3]= 'f';
- file[i+4]= '\0';
+ len = s - str;
+ for (i = 0; i < len; i++)
+ file[i] = str[i];
+
+ file[i] = '.';
+ file[i+1] = 't';
+ file[i+2] = 't';
+ file[i+3] = 'f';
+ file[i+4] = '\0';
s++;
- *size= atoi(s);
+ *size = atoi(s);
return 1;
}
return 0;
@@ -183,24 +183,24 @@ char *blf_dir_metrics_search(const char *filename)
char *mfile;
char *s;
- mfile= BLI_strdup(filename);
- s= strrchr(mfile, '.');
+ mfile = BLI_strdup(filename);
+ s = strrchr(mfile, '.');
if (s) {
if (BLI_strnlen(s, 4) < 4) {
MEM_freeN(mfile);
return NULL;
}
s++;
- s[0]= 'a';
- s[1]= 'f';
- s[2]= 'm';
+ s[0] = 'a';
+ s[1] = 'f';
+ s[2] = 'm';
/* first check .afm */
if (BLI_exists(s))
return s;
/* and now check .pfm */
- s[0]= 'p';
+ s[0] = 'p';
if (BLI_exists(s))
return s;
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 7ec7e2357dd..84cefc923a0 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -73,43 +73,43 @@ void blf_font_size(FontBLF *font, int size, int dpi)
GlyphCacheBLF *gc;
FT_Error err;
- err= FT_Set_Char_Size(font->face, 0, (size * 64), dpi, dpi);
+ err = FT_Set_Char_Size(font->face, 0, (size * 64), dpi, dpi);
if (err) {
/* FIXME: here we can go through the fixed size and choice a close one */
printf("The current font don't support the size, %d and dpi, %d\n", size, dpi);
return;
}
- font->size= size;
- font->dpi= dpi;
+ font->size = size;
+ font->dpi = dpi;
- gc= blf_glyph_cache_find(font, size, dpi);
+ gc = blf_glyph_cache_find(font, size, dpi);
if (gc)
- font->glyph_cache= gc;
+ font->glyph_cache = gc;
else {
- gc= blf_glyph_cache_new(font);
+ gc = blf_glyph_cache_new(font);
if (gc)
- font->glyph_cache= gc;
+ font->glyph_cache = gc;
else
- font->glyph_cache= NULL;
+ font->glyph_cache = NULL;
}
}
static void blf_font_ensure_ascii_table(FontBLF *font)
{
- GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
+ GlyphBLF **glyph_ascii_table = font->glyph_cache->glyph_ascii_table;
/* build ascii on demand */
- if(glyph_ascii_table['0']==NULL) {
+ if (glyph_ascii_table['0'] == NULL) {
GlyphBLF *g;
unsigned int i;
- for(i=0; i<256; i++) {
- g= blf_glyph_search(font->glyph_cache, i);
+ for (i = 0; i<256; i++) {
+ g = blf_glyph_search(font->glyph_cache, i);
if (!g) {
- FT_UInt glyph_index= FT_Get_Char_Index(font->face, i);
- g= blf_glyph_add(font, glyph_index, i);
+ FT_UInt glyph_index = FT_Get_Char_Index(font->face, i);
+ g = blf_glyph_add(font, glyph_index, i);
}
- glyph_ascii_table[i]= g;
+ glyph_ascii_table[i] = g;
}
}
}
@@ -122,67 +122,69 @@ static void blf_font_ensure_ascii_table(FontBLF *font)
/* Note,
* blf_font_ensure_ascii_table(font); must be called before this macro */
-#define BLF_UTF8_NEXT_FAST(_font, _g, _str, _i, _c, _glyph_ascii_table) \
- if(((_c)= (_str)[_i]) < 0x80) { \
- _g= (_glyph_ascii_table)[_c]; \
- _i++; \
- } \
- else if ((_c= BLI_str_utf8_as_unicode_step(_str, &(_i)))!=BLI_UTF8_ERR) { \
- if ((_g= blf_glyph_search((_font)->glyph_cache, _c)) == NULL) { \
- _g= blf_glyph_add(_font, \
- FT_Get_Char_Index((_font)->face, _c), _c); \
- } \
- } \
-
-
-#define BLF_KERNING_VARS(_font, _has_kerning, _kern_mode) \
- const short _has_kerning= FT_HAS_KERNING((_font)->face); \
- const FT_UInt _kern_mode= (_has_kerning == 0) ? 0 : \
- (((_font)->flags & BLF_KERNING_DEFAULT) ? \
- ft_kerning_default : FT_KERNING_UNFITTED) \
-
-
-#define BLF_KERNING_STEP(_font, _kern_mode, _g_prev, _g, _delta, _pen_x) \
-{ \
- if (_g_prev) { \
- _delta.x= _delta.y= 0; \
- if (FT_Get_Kerning((_font)->face, \
- (_g_prev)->idx, \
- (_g)->idx, \
- _kern_mode, \
- &(_delta)) == 0) \
- { \
- _pen_x += delta.x >> 6; \
- } \
- } \
-} \
+#define BLF_UTF8_NEXT_FAST(_font, _g, _str, _i, _c, _glyph_ascii_table) \
+ if (((_c) = (_str)[_i]) < 0x80) { \
+ _g = (_glyph_ascii_table)[_c]; \
+ _i++; \
+ } \
+ else if ((_c = BLI_str_utf8_as_unicode_step(_str, &(_i))) != BLI_UTF8_ERR) { \
+ if ((_g = blf_glyph_search((_font)->glyph_cache, _c)) == NULL) { \
+ _g = blf_glyph_add(_font, \
+ FT_Get_Char_Index((_font)->face, _c), _c); \
+ } \
+ } \
+
+
+#define BLF_KERNING_VARS(_font, _has_kerning, _kern_mode) \
+ const short _has_kerning = FT_HAS_KERNING((_font)->face); \
+ const FT_UInt _kern_mode = (_has_kerning == 0) ? 0 : \
+ (((_font)->flags & BLF_KERNING_DEFAULT) ? \
+ ft_kerning_default : FT_KERNING_UNFITTED) \
+
+
+#define BLF_KERNING_STEP(_font, _kern_mode, _g_prev, _g, _delta, _pen_x) \
+{ \
+ if (_g_prev) { \
+ _delta.x = _delta.y = 0; \
+ if (FT_Get_Kerning((_font)->face, \
+ (_g_prev)->idx, \
+ (_g)->idx, \
+ _kern_mode, \
+ &(_delta)) == 0) \
+ { \
+ _pen_x += delta.x >> 6; \
+ } \
+ } \
+} \
void blf_font_draw(FontBLF *font, const char *str, unsigned int len)
{
unsigned int c;
- GlyphBLF *g, *g_prev= NULL;
+ GlyphBLF *g, *g_prev = NULL;
FT_Vector delta;
- int pen_x= 0, pen_y= 0;
- size_t i= 0;
- GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
+ int pen_x = 0, pen_y = 0;
+ size_t i = 0;
+ GlyphBLF **glyph_ascii_table = font->glyph_cache->glyph_ascii_table;
BLF_KERNING_VARS(font, has_kerning, kern_mode);
blf_font_ensure_ascii_table(font);
while (str[i] && i < len) {
-
BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
- if (c == BLI_UTF8_ERR) break;
- if (g == NULL) continue;
- if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
+ if (c == BLI_UTF8_ERR)
+ break;
+ if (g == NULL)
+ continue;
+ if (has_kerning)
+ BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
/* do not return this loop if clipped, we want every character tested */
blf_glyph_render(font, g, (float)pen_x, (float)pen_y);
pen_x += g->advance;
- g_prev= g;
+ g_prev = g;
}
}
@@ -190,24 +192,26 @@ void blf_font_draw(FontBLF *font, const char *str, unsigned int len)
void blf_font_draw_ascii(FontBLF *font, const char *str, unsigned int len)
{
unsigned char c;
- GlyphBLF *g, *g_prev= NULL;
+ GlyphBLF *g, *g_prev = NULL;
FT_Vector delta;
- int pen_x= 0, pen_y= 0;
- GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
+ int pen_x = 0, pen_y = 0;
+ GlyphBLF **glyph_ascii_table = font->glyph_cache->glyph_ascii_table;
BLF_KERNING_VARS(font, has_kerning, kern_mode);
blf_font_ensure_ascii_table(font);
- while ((c= *(str++)) && len--) {
- if ((g= glyph_ascii_table[c]) == NULL) continue;
- if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
+ while ((c = *(str++)) && len--) {
+ if ((g = glyph_ascii_table[c]) == NULL)
+ continue;
+ if (has_kerning)
+ BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
/* do not return this loop if clipped, we want every character tested */
blf_glyph_render(font, g, (float)pen_x, (float)pen_y);
pen_x += g->advance;
- g_prev= g;
+ g_prev = g;
}
}
@@ -215,17 +219,17 @@ void blf_font_draw_ascii(FontBLF *font, const char *str, unsigned int len)
void blf_font_buffer(FontBLF *font, const char *str)
{
unsigned int c;
- GlyphBLF *g, *g_prev= NULL;
+ GlyphBLF *g, *g_prev = NULL;
FT_Vector delta;
- int pen_x= (int)font->pos[0], pen_y= 0;
- size_t i= 0;
- GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
+ int pen_x = (int)font->pos[0], pen_y = 0;
+ size_t i = 0;
+ GlyphBLF **glyph_ascii_table = font->glyph_cache->glyph_ascii_table;
/* buffer specific vars*/
- const unsigned char b_col_char[4]= {font->b_col[0] * 255,
- font->b_col[1] * 255,
- font->b_col[2] * 255,
- font->b_col[3] * 255};
+ const unsigned char b_col_char[4] = {font->b_col[0] * 255,
+ font->b_col[1] * 255,
+ font->b_col[2] * 255,
+ font->b_col[3] * 255};
unsigned char *cbuf;
int chx, chy;
int y, x;
@@ -236,15 +240,17 @@ void blf_font_buffer(FontBLF *font, const char *str)
blf_font_ensure_ascii_table(font);
while (str[i]) {
-
BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
- if (c == BLI_UTF8_ERR) break;
- if (g == NULL) continue;
- if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
+ if (c == BLI_UTF8_ERR)
+ break;
+ if (g == NULL)
+ continue;
+ if (has_kerning)
+ BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
- chx= pen_x + ((int)g->pos_x);
- chy= (int)font->pos[1] + g->height;
+ chx = pen_x + ((int)g->pos_x);
+ chy = (int)font->pos[1] + g->height;
if (g->pitch < 0) {
pen_y = (int)font->pos[1] + (g->height - (int)g->pos_y);
@@ -254,42 +260,43 @@ void blf_font_buffer(FontBLF *font, const char *str)
}
if ((chx + g->width) >= 0 && chx < font->bw && (pen_y + g->height) >= 0 && pen_y < font->bh) {
- /* dont draw beyond the buffer bounds */
- int width_clip= g->width;
- int height_clip= g->height;
- int yb_start= g->pitch < 0 ? 0 : g->height-1;
-
- if (width_clip + chx > font->bw) width_clip -= chx + width_clip - font->bw;
- if (height_clip + pen_y > font->bh) height_clip -= pen_y + height_clip - font->bh;
+ /* don't draw beyond the buffer bounds */
+ int width_clip = g->width;
+ int height_clip = g->height;
+ int yb_start = g->pitch < 0 ? 0 : g->height-1;
+
+ if (width_clip + chx > font->bw)
+ width_clip -= chx + width_clip - font->bw;
+ if (height_clip + pen_y > font->bh)
+ height_clip -= pen_y + height_clip - font->bh;
/* drawing below the image? */
- if(pen_y < 0) {
+ if (pen_y < 0) {
yb_start += (g->pitch < 0) ? -pen_y : pen_y;
height_clip += pen_y;
- pen_y= 0;
+ pen_y = 0;
}
if (font->b_fbuf) {
- int yb= yb_start;
- for (y=(chy >= 0 ? 0:-chy); y < height_clip; y++) {
- for (x=(chx >= 0 ? 0:-chx); x < width_clip; x++) {
-
- a= *(g->bitmap + x + (yb * g->pitch)) / 255.0f;
+ int yb = yb_start;
+ for (y = (chy >= 0 ? 0:-chy); y < height_clip; y++) {
+ for (x = (chx >= 0 ? 0:-chx); x < width_clip; x++) {
+ a = *(g->bitmap + x + (yb * g->pitch)) / 255.0f;
- if(a > 0.0f) {
+ if (a > 0.0f) {
float alphatest;
- fbuf= font->b_fbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw));
+ fbuf = font->b_fbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw));
if (a >= 1.0f) {
- fbuf[0]= font->b_col[0];
- fbuf[1]= font->b_col[1];
- fbuf[2]= font->b_col[2];
- fbuf[3]= (alphatest= (fbuf[3] + (font->b_col[3]))) < 1.0f ? alphatest : 1.0f;
+ fbuf[0] = font->b_col[0];
+ fbuf[1] = font->b_col[1];
+ fbuf[2] = font->b_col[2];
+ fbuf[3] = (alphatest = (fbuf[3] + (font->b_col[3]))) < 1.0f ? alphatest : 1.0f;
}
else {
- fbuf[0]= (font->b_col[0]*a) + (fbuf[0] * (1-a));
- fbuf[1]= (font->b_col[1]*a) + (fbuf[1] * (1-a));
- fbuf[2]= (font->b_col[2]*a) + (fbuf[2] * (1-a));
- fbuf[3]= (alphatest= (fbuf[3] + (font->b_col[3]*a))) < 1.0f ? alphatest : 1.0f;
+ fbuf[0] = (font->b_col[0]*a) + (fbuf[0] * (1-a));
+ fbuf[1] = (font->b_col[1]*a) + (fbuf[1] * (1-a));
+ fbuf[2] = (font->b_col[2]*a) + (fbuf[2] * (1-a));
+ fbuf[3] = (alphatest = (fbuf[3] + (font->b_col[3]*a))) < 1.0f ? alphatest : 1.0f;
}
}
}
@@ -302,25 +309,26 @@ void blf_font_buffer(FontBLF *font, const char *str)
}
if (font->b_cbuf) {
- int yb= yb_start;
- for (y= 0; y < height_clip; y++) {
- for (x= 0; x < width_clip; x++) {
- a= *(g->bitmap + x + (yb * g->pitch)) / 255.0f;
+ int yb = yb_start;
+ for (y = 0; y < height_clip; y++) {
+ for (x = 0; x < width_clip; x++) {
+ a = *(g->bitmap + x + (yb * g->pitch)) / 255.0f;
- if(a > 0.0f) {
+ if (a > 0.0f) {
int alphatest;
- cbuf= font->b_cbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw));
+ cbuf = font->b_cbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw));
if (a >= 1.0f) {
- cbuf[0]= b_col_char[0];
- cbuf[1]= b_col_char[1];
- cbuf[2]= b_col_char[2];
- cbuf[3]= (alphatest= ((int)cbuf[3] + (int)b_col_char[3])) < 255 ? alphatest : 255;
+ cbuf[0] = b_col_char[0];
+ cbuf[1] = b_col_char[1];
+ cbuf[2] = b_col_char[2];
+ cbuf[3] = (alphatest = ((int)cbuf[3] + (int)b_col_char[3])) < 255 ? alphatest : 255;
}
else {
- cbuf[0]= (b_col_char[0]*a) + (cbuf[0] * (1-a));
- cbuf[1]= (b_col_char[1]*a) + (cbuf[1] * (1-a));
- cbuf[2]= (b_col_char[2]*a) + (cbuf[2] * (1-a));
- cbuf[3]= (alphatest= ((int)cbuf[3] + (int)((font->b_col[3]*a)*255.0f))) < 255 ? alphatest : 255;
+ cbuf[0] = (b_col_char[0]*a) + (cbuf[0] * (1-a));
+ cbuf[1] = (b_col_char[1]*a) + (cbuf[1] * (1-a));
+ cbuf[2] = (b_col_char[2]*a) + (cbuf[2] * (1-a));
+ cbuf[3] = (alphatest = ((int)cbuf[3] + (int)((font->b_col[3]*a)*255.0f))) <
+ 255 ? alphatest : 255;
}
}
}
@@ -334,58 +342,60 @@ void blf_font_buffer(FontBLF *font, const char *str)
}
pen_x += g->advance;
- g_prev= g;
+ g_prev = g;
}
}
void blf_font_boundbox(FontBLF *font, const char *str, rctf *box)
{
unsigned int c;
- GlyphBLF *g, *g_prev= NULL;
+ GlyphBLF *g, *g_prev = NULL;
FT_Vector delta;
- int pen_x= 0, pen_y= 0;
- size_t i= 0;
- GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
+ int pen_x = 0, pen_y = 0;
+ size_t i = 0;
+ GlyphBLF **glyph_ascii_table = font->glyph_cache->glyph_ascii_table;
rctf gbox;
BLF_KERNING_VARS(font, has_kerning, kern_mode);
- box->xmin= 32000.0f;
- box->xmax= -32000.0f;
- box->ymin= 32000.0f;
- box->ymax= -32000.0f;
+ box->xmin = 32000.0f;
+ box->xmax = -32000.0f;
+ box->ymin = 32000.0f;
+ box->ymax = -32000.0f;
blf_font_ensure_ascii_table(font);
while (str[i]) {
-
BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
- if (c == BLI_UTF8_ERR) break;
- if (g == NULL) continue;
- if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
+ if (c == BLI_UTF8_ERR)
+ break;
+ if (g == NULL)
+ continue;
+ if (has_kerning)
+ BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
- gbox.xmin= pen_x;
- gbox.xmax= pen_x + g->advance;
- gbox.ymin= g->box.ymin + pen_y;
- gbox.ymax= g->box.ymax + pen_y;
+ gbox.xmin = pen_x;
+ gbox.xmax = pen_x + g->advance;
+ gbox.ymin = g->box.ymin + pen_y;
+ gbox.ymax = g->box.ymax + pen_y;
- if (gbox.xmin < box->xmin) box->xmin= gbox.xmin;
- if (gbox.ymin < box->ymin) box->ymin= gbox.ymin;
+ if (gbox.xmin < box->xmin) box->xmin = gbox.xmin;
+ if (gbox.ymin < box->ymin) box->ymin = gbox.ymin;
- if (gbox.xmax > box->xmax) box->xmax= gbox.xmax;
- if (gbox.ymax > box->ymax) box->ymax= gbox.ymax;
+ if (gbox.xmax > box->xmax) box->xmax = gbox.xmax;
+ if (gbox.ymax > box->ymax) box->ymax = gbox.ymax;
pen_x += g->advance;
- g_prev= g;
+ g_prev = g;
}
if (box->xmin > box->xmax) {
- box->xmin= 0.0f;
- box->ymin= 0.0f;
- box->xmax= 0.0f;
- box->ymax= 0.0f;
+ box->xmin = 0.0f;
+ box->ymin = 0.0f;
+ box->xmax = 0.0f;
+ box->ymax = 0.0f;
}
}
@@ -395,17 +405,17 @@ void blf_font_width_and_height(FontBLF *font, const char *str, float *width, flo
rctf box;
if (font->flags & BLF_ASPECT) {
- xa= font->aspect[0];
- ya= font->aspect[1];
+ xa = font->aspect[0];
+ ya = font->aspect[1];
}
else {
- xa= 1.0f;
- ya= 1.0f;
+ xa = 1.0f;
+ ya = 1.0f;
}
blf_font_boundbox(font, str, &box);
- *width= ((box.xmax - box.xmin) * xa);
- *height= ((box.ymax - box.ymin) * ya);
+ *width = ((box.xmax - box.xmin) * xa);
+ *height = ((box.ymax - box.ymin) * ya);
}
float blf_font_width(FontBLF *font, const char *str)
@@ -414,9 +424,9 @@ float blf_font_width(FontBLF *font, const char *str)
rctf box;
if (font->flags & BLF_ASPECT)
- xa= font->aspect[0];
+ xa = font->aspect[0];
else
- xa= 1.0f;
+ xa = 1.0f;
blf_font_boundbox(font, str, &box);
return (box.xmax - box.xmin) * xa;
@@ -428,9 +438,9 @@ float blf_font_height(FontBLF *font, const char *str)
rctf box;
if (font->flags & BLF_ASPECT)
- ya= font->aspect[1];
+ ya = font->aspect[1];
else
- ya= 1.0f;
+ ya = 1.0f;
blf_font_boundbox(font, str, &box);
return (box.ymax - box.ymin) * ya;
@@ -439,9 +449,9 @@ float blf_font_height(FontBLF *font, const char *str)
float blf_font_fixed_width(FontBLF *font)
{
const unsigned int c = ' ';
- GlyphBLF *g= blf_glyph_search(font->glyph_cache, c);
+ GlyphBLF *g = blf_glyph_search(font->glyph_cache, c);
if (!g) {
- g= blf_glyph_add(font, FT_Get_Char_Index(font->face, c), c);
+ g = blf_glyph_add(font, FT_Get_Char_Index(font->face, c), c);
/* if we don't find the glyph. */
if (!g) {
@@ -456,9 +466,9 @@ void blf_font_free(FontBLF *font)
{
GlyphCacheBLF *gc;
- font->glyph_cache= NULL;
+ font->glyph_cache = NULL;
while (font->cache.first) {
- gc= font->cache.first;
+ gc = font->cache.first;
BLI_remlink(&font->cache, gc);
blf_glyph_cache_free(gc);
}
@@ -475,38 +485,38 @@ static void blf_font_fill(FontBLF *font)
{
unsigned int i;
- font->aspect[0]= 1.0f;
- font->aspect[1]= 1.0f;
- font->aspect[2]= 1.0f;
- font->pos[0]= 0.0f;
- font->pos[1]= 0.0f;
- font->angle= 0.0f;
-
- for (i= 0; i < 16; i++)
- font->m[i]= 0;
-
- font->clip_rec.xmin= 0.0f;
- font->clip_rec.xmax= 0.0f;
- font->clip_rec.ymin= 0.0f;
- font->clip_rec.ymax= 0.0f;
- font->flags= 0;
- font->dpi= 0;
- font->size= 0;
- font->cache.first= NULL;
- font->cache.last= NULL;
- font->glyph_cache= NULL;
- font->blur= 0;
- font->max_tex_size= -1;
- font->b_fbuf= NULL;
- font->b_cbuf= NULL;
- font->bw= 0;
- font->bh= 0;
- font->bch= 0;
- font->b_col[0]= 0;
- font->b_col[1]= 0;
- font->b_col[2]= 0;
- font->b_col[3]= 0;
- font->ft_lib= ft_lib;
+ font->aspect[0] = 1.0f;
+ font->aspect[1] = 1.0f;
+ font->aspect[2] = 1.0f;
+ font->pos[0] = 0.0f;
+ font->pos[1] = 0.0f;
+ font->angle = 0.0f;
+
+ for (i = 0; i < 16; i++)
+ font->m[i] = 0;
+
+ font->clip_rec.xmin = 0.0f;
+ font->clip_rec.xmax = 0.0f;
+ font->clip_rec.ymin = 0.0f;
+ font->clip_rec.ymax = 0.0f;
+ font->flags = 0;
+ font->dpi = 0;
+ font->size = 0;
+ font->cache.first = NULL;
+ font->cache.last = NULL;
+ font->glyph_cache = NULL;
+ font->blur = 0;
+ font->max_tex_size = -1;
+ font->b_fbuf = NULL;
+ font->b_cbuf = NULL;
+ font->bw = 0;
+ font->bh = 0;
+ font->bch = 0;
+ font->b_col[0] = 0;
+ font->b_col[1] = 0;
+ font->b_col[2] = 0;
+ font->b_col[3] = 0;
+ font->ft_lib = ft_lib;
}
FontBLF *blf_font_new(const char *name, const char *filename)
@@ -515,14 +525,14 @@ FontBLF *blf_font_new(const char *name, const char *filename)
FT_Error err;
char *mfile;
- font= (FontBLF *)MEM_callocN(sizeof(FontBLF), "blf_font_new");
- err= FT_New_Face(ft_lib, filename, 0, &font->face);
+ font = (FontBLF *)MEM_callocN(sizeof(FontBLF), "blf_font_new");
+ err = FT_New_Face(ft_lib, filename, 0, &font->face);
if (err) {
MEM_freeN(font);
return NULL;
}
- err= FT_Select_Charmap(font->face, ft_encoding_unicode);
+ err = FT_Select_Charmap(font->face, ft_encoding_unicode);
if (err) {
printf("Can't set the unicode character map!\n");
FT_Done_Face(font->face);
@@ -530,17 +540,17 @@ FontBLF *blf_font_new(const char *name, const char *filename)
return NULL;
}
- mfile= blf_dir_metrics_search(filename);
+ mfile = blf_dir_metrics_search(filename);
if (mfile) {
- err= FT_Attach_File(font->face, mfile);
- if(err) {
+ err = FT_Attach_File(font->face, mfile);
+ if (err) {
fprintf(stderr, "FT_Attach_File failed to load '%s' with error %d\n", filename, (int)err);
}
MEM_freeN(mfile);
}
- font->name= BLI_strdup(name);
- font->filename= BLI_strdup(filename);
+ font->name = BLI_strdup(name);
+ font->filename = BLI_strdup(filename);
blf_font_fill(font);
return font;
}
@@ -549,9 +559,9 @@ void blf_font_attach_from_mem(FontBLF *font, const unsigned char *mem, int mem_s
{
FT_Open_Args open;
- open.flags= FT_OPEN_MEMORY;
- open.memory_base= (FT_Byte *)mem;
- open.memory_size= mem_size;
+ open.flags = FT_OPEN_MEMORY;
+ open.memory_base = (FT_Byte *)mem;
+ open.memory_size = mem_size;
FT_Attach_Stream(font->face, &open);
}
@@ -560,14 +570,14 @@ FontBLF *blf_font_new_from_mem(const char *name, unsigned char *mem, int mem_siz
FontBLF *font;
FT_Error err;
- font= (FontBLF *)MEM_callocN(sizeof(FontBLF), "blf_font_new_from_mem");
- err= FT_New_Memory_Face(ft_lib, mem, mem_size, 0, &font->face);
+ font = (FontBLF *)MEM_callocN(sizeof(FontBLF), "blf_font_new_from_mem");
+ err = FT_New_Memory_Face(ft_lib, mem, mem_size, 0, &font->face);
if (err) {
MEM_freeN(font);
return NULL;
}
- err= FT_Select_Charmap(font->face, ft_encoding_unicode);
+ err = FT_Select_Charmap(font->face, ft_encoding_unicode);
if (err) {
printf("Can't set the unicode character map!\n");
FT_Done_Face(font->face);
@@ -575,8 +585,8 @@ FontBLF *blf_font_new_from_mem(const char *name, unsigned char *mem, int mem_siz
return NULL;
}
- font->name= BLI_strdup(name);
- font->filename= NULL;
+ font->name = BLI_strdup(name);
+ font->filename = NULL;
blf_font_fill(font);
return font;
}
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index f0cfcdc97b9..033efbfc1fc 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -59,11 +59,11 @@ GlyphCacheBLF *blf_glyph_cache_find(FontBLF *font, int size, int dpi)
{
GlyphCacheBLF *p;
- p= (GlyphCacheBLF *)font->cache.first;
+ p = (GlyphCacheBLF *)font->cache.first;
while (p) {
if (p->size == size && p->dpi == dpi)
return p;
- p= p->next;
+ p = p->next;
}
return NULL;
}
@@ -73,43 +73,43 @@ GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font)
{
GlyphCacheBLF *gc;
- gc= (GlyphCacheBLF *)MEM_callocN(sizeof(GlyphCacheBLF), "blf_glyph_cache_new");
- gc->next= NULL;
- gc->prev= NULL;
- gc->size= font->size;
- gc->dpi= font->dpi;
+ gc = (GlyphCacheBLF *)MEM_callocN(sizeof(GlyphCacheBLF), "blf_glyph_cache_new");
+ gc->next = NULL;
+ gc->prev = NULL;
+ gc->size = font->size;
+ gc->dpi = font->dpi;
memset(gc->glyph_ascii_table, 0, sizeof(gc->glyph_ascii_table));
memset(gc->bucket, 0, sizeof(gc->bucket));
- gc->textures= (GLuint *)malloc(sizeof(GLuint)*256);
- gc->ntex= 256;
- gc->cur_tex= -1;
- gc->x_offs= 0;
- gc->y_offs= 0;
- gc->pad= 3;
+ gc->textures = (GLuint *)malloc(sizeof(GLuint)*256);
+ gc->ntex = 256;
+ gc->cur_tex = -1;
+ gc->x_offs = 0;
+ gc->y_offs = 0;
+ gc->pad = 3;
- gc->num_glyphs= font->face->num_glyphs;
- gc->rem_glyphs= font->face->num_glyphs;
- gc->ascender= ((float)font->face->size->metrics.ascender) / 64.0f;
- gc->descender= ((float)font->face->size->metrics.descender) / 64.0f;
+ gc->num_glyphs = font->face->num_glyphs;
+ gc->rem_glyphs = font->face->num_glyphs;
+ gc->ascender = ((float)font->face->size->metrics.ascender) / 64.0f;
+ gc->descender = ((float)font->face->size->metrics.descender) / 64.0f;
if (FT_IS_SCALABLE(font->face)) {
- gc->max_glyph_width= (float)((font->face->bbox.xMax - font->face->bbox.xMin) *
- (((float)font->face->size->metrics.x_ppem) /
- ((float)font->face->units_per_EM)));
+ gc->max_glyph_width = (float)((font->face->bbox.xMax - font->face->bbox.xMin) *
+ (((float)font->face->size->metrics.x_ppem) /
+ ((float)font->face->units_per_EM)));
- gc->max_glyph_height= (float)((font->face->bbox.yMax - font->face->bbox.yMin) *
- (((float)font->face->size->metrics.y_ppem) /
- ((float)font->face->units_per_EM)));
+ gc->max_glyph_height = (float)((font->face->bbox.yMax - font->face->bbox.yMin) *
+ (((float)font->face->size->metrics.y_ppem) /
+ ((float)font->face->units_per_EM)));
}
else {
- gc->max_glyph_width= ((float)font->face->size->metrics.max_advance) / 64.0f;
- gc->max_glyph_height= ((float)font->face->size->metrics.height) / 64.0f;
+ gc->max_glyph_width = ((float)font->face->size->metrics.max_advance) / 64.0f;
+ gc->max_glyph_height = ((float)font->face->size->metrics.height) / 64.0f;
}
- gc->p2_width= 0;
- gc->p2_height= 0;
+ gc->p2_width = 0;
+ gc->p2_height = 0;
BLI_addhead(&font->cache, gc);
return gc;
@@ -121,10 +121,10 @@ void blf_glyph_cache_clear(FontBLF *font)
GlyphBLF *g;
int i;
- for(gc=font->cache.first; gc; gc=gc->next) {
- for (i= 0; i < 257; i++) {
+ for (gc = font->cache.first; gc; gc = gc->next) {
+ for (i = 0; i < 257; i++) {
while (gc->bucket[i].first) {
- g= gc->bucket[i].first;
+ g = gc->bucket[i].first;
BLI_remlink(&(gc->bucket[i]), g);
blf_glyph_free(g);
}
@@ -139,9 +139,9 @@ void blf_glyph_cache_free(GlyphCacheBLF *gc)
GlyphBLF *g;
int i;
- for (i= 0; i < 257; i++) {
+ for (i = 0; i < 257; i++) {
while (gc->bucket[i].first) {
- g= gc->bucket[i].first;
+ g = gc->bucket[i].first;
BLI_remlink(&(gc->bucket[i]), g);
blf_glyph_free(g);
}
@@ -163,25 +163,25 @@ static void blf_glyph_cache_texture(FontBLF *font, GlyphCacheBLF *gc)
if (gc->cur_tex >= gc->ntex) {
gc->ntex *= 2;
- gc->textures= (GLuint *)realloc((void *)gc->textures, sizeof(GLuint)*gc->ntex);
+ gc->textures = (GLuint *)realloc((void *)gc->textures, sizeof(GLuint)*gc->ntex);
}
- gc->p2_width= blf_next_p2((gc->rem_glyphs * gc->max_glyph_width) + (gc->pad * 2));
+ gc->p2_width = blf_next_p2((gc->rem_glyphs * gc->max_glyph_width) + (gc->pad * 2));
if (gc->p2_width > font->max_tex_size)
- gc->p2_width= font->max_tex_size;
+ gc->p2_width = font->max_tex_size;
- i= (int)((gc->p2_width - (gc->pad * 2)) / gc->max_glyph_width);
- gc->p2_height= blf_next_p2(((gc->num_glyphs / i) + 1) * gc->max_glyph_height);
+ i = (int)((gc->p2_width - (gc->pad * 2)) / gc->max_glyph_width);
+ gc->p2_height = blf_next_p2(((gc->num_glyphs / i) + 1) * gc->max_glyph_height);
if (gc->p2_height > font->max_tex_size)
- gc->p2_height= font->max_tex_size;
+ gc->p2_height = font->max_tex_size;
- tot_mem= gc->p2_width * gc->p2_height;
- buf= (unsigned char *)malloc(tot_mem);
+ tot_mem = gc->p2_width * gc->p2_height;
+ buf = (unsigned char *)malloc(tot_mem);
memset((void *)buf, 0, tot_mem);
glGenTextures(1, &gc->textures[gc->cur_tex]);
- glBindTexture(GL_TEXTURE_2D, (font->tex_bind_state= gc->textures[gc->cur_tex]));
+ glBindTexture(GL_TEXTURE_2D, (font->tex_bind_state = gc->textures[gc->cur_tex]));
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -196,12 +196,12 @@ GlyphBLF *blf_glyph_search(GlyphCacheBLF *gc, unsigned int c)
GlyphBLF *p;
unsigned int key;
- key= blf_hash(c);
- p= gc->bucket[key].first;
+ key = blf_hash(c);
+ p = gc->bucket[key].first;
while (p) {
if (p->c == c)
return p;
- p= p->next;
+ p = p->next;
}
return NULL;
}
@@ -216,7 +216,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
FT_BBox bbox;
unsigned int key;
- g= blf_glyph_search(font->glyph_cache, c);
+ g = blf_glyph_search(font->glyph_cache, c);
if (g)
return g;
@@ -228,7 +228,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
return NULL;
/* get the glyph. */
- slot= font->face->glyph;
+ slot = font->face->glyph;
if (sharp) {
err = FT_Render_Glyph(slot, FT_RENDER_MODE_MONO);
@@ -239,47 +239,48 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
err += FT_Bitmap_Convert(font->ft_lib, &slot->bitmap, &tempbitmap, 1); /* Does Blender use Pitch 1 always? It works so far */
err += FT_Bitmap_Copy(font->ft_lib, &tempbitmap, &slot->bitmap);
err += FT_Bitmap_Done(font->ft_lib, &tempbitmap);
- } else {
+ }
+ else {
err = FT_Render_Glyph(slot, FT_RENDER_MODE_NORMAL);
}
if (err || slot->format != FT_GLYPH_FORMAT_BITMAP)
return NULL;
- g= (GlyphBLF *)MEM_callocN(sizeof(GlyphBLF), "blf_glyph_add");
- g->c= c;
- g->idx= (FT_UInt)index;
- g->xoff= -1;
- g->yoff= -1;
- bitmap= slot->bitmap;
- g->width= bitmap.width;
- g->height= bitmap.rows;
+ g = (GlyphBLF *)MEM_callocN(sizeof(GlyphBLF), "blf_glyph_add");
+ g->c = c;
+ g->idx = (FT_UInt)index;
+ g->xoff = -1;
+ g->yoff = -1;
+ bitmap = slot->bitmap;
+ g->width = bitmap.width;
+ g->height = bitmap.rows;
if (g->width && g->height) {
if (sharp) {
/* Font buffer uses only 0 or 1 values, Blender expects full 0..255 range */
int i;
- for (i=0; i < (g->width * g->height); i++) {
+ for (i = 0; i < (g->width * g->height); i++) {
bitmap.buffer[i] = 255 * bitmap.buffer[i];
}
}
- g->bitmap= (unsigned char *)MEM_mallocN(g->width * g->height, "glyph bitmap");
+ g->bitmap = (unsigned char *)MEM_mallocN(g->width * g->height, "glyph bitmap");
memcpy((void *)g->bitmap, (void *)bitmap.buffer, g->width * g->height);
}
- g->advance= ((float)slot->advance.x) / 64.0f;
- g->pos_x= slot->bitmap_left;
- g->pos_y= slot->bitmap_top;
- g->pitch= slot->bitmap.pitch;
+ g->advance = ((float)slot->advance.x) / 64.0f;
+ g->pos_x = slot->bitmap_left;
+ g->pos_y = slot->bitmap_top;
+ g->pitch = slot->bitmap.pitch;
FT_Outline_Get_CBox(&(slot->outline), &bbox);
- g->box.xmin= ((float)bbox.xMin) / 64.0f;
- g->box.xmax= ((float)bbox.xMax) / 64.0f;
- g->box.ymin= ((float)bbox.yMin) / 64.0f;
- g->box.ymax= ((float)bbox.yMax) / 64.0f;
+ g->box.xmin = ((float)bbox.xMin) / 64.0f;
+ g->box.xmax = ((float)bbox.xMax) / 64.0f;
+ g->box.ymin = ((float)bbox.yMin) / 64.0f;
+ g->box.ymax = ((float)bbox.yMax) / 64.0f;
- key= blf_hash(g->c);
+ key = blf_hash(g->c);
BLI_addhead(&(font->glyph_cache->bucket[key]), g);
return g;
}
@@ -296,7 +297,6 @@ void blf_glyph_free(GlyphBLF *g)
static void blf_texture_draw(float uv[2][2], float dx, float y1, float dx1, float y2)
{
-
glBegin(GL_QUADS);
glTexCoord2f(uv[0][0], uv[0][1]);
glVertex2f(dx, y1);
@@ -310,27 +310,26 @@ static void blf_texture_draw(float uv[2][2], float dx, float y1, float dx1, floa
glTexCoord2f(uv[1][0], uv[0][1]);
glVertex2f(dx1, y1);
glEnd();
-
}
static void blf_texture5_draw(const float shadow_col[4], float uv[2][2], float x1, float y1, float x2, float y2)
{
- float soft[25]= {1/60.0f, 1/60.0f, 2/60.0f, 1/60.0f, 1/60.0f,
- 1/60.0f, 3/60.0f, 5/60.0f, 3/60.0f, 1/60.0f,
- 2/60.0f, 5/60.0f, 8/60.0f, 5/60.0f, 2/60.0f,
- 1/60.0f, 3/60.0f, 5/60.0f, 3/60.0f, 1/60.0f,
- 1/60.0f, 1/60.0f, 2/60.0f, 1/60.0f, 1/60.0f};
+ float soft[25] = {1/60.0f, 1/60.0f, 2/60.0f, 1/60.0f, 1/60.0f,
+ 1/60.0f, 3/60.0f, 5/60.0f, 3/60.0f, 1/60.0f,
+ 2/60.0f, 5/60.0f, 8/60.0f, 5/60.0f, 2/60.0f,
+ 1/60.0f, 3/60.0f, 5/60.0f, 3/60.0f, 1/60.0f,
+ 1/60.0f, 1/60.0f, 2/60.0f, 1/60.0f, 1/60.0f};
- float color[4], *fp= soft;
+ float color[4], *fp = soft;
int dx, dy;
- color[0]= shadow_col[0];
- color[1]= shadow_col[1];
- color[2]= shadow_col[2];
+ color[0] = shadow_col[0];
+ color[1] = shadow_col[1];
+ color[2] = shadow_col[2];
- for(dx=-2; dx<3; dx++) {
- for(dy=-2; dy<3; dy++, fp++) {
- color[3]= *(fp) * shadow_col[3];
+ for (dx = -2; dx < 3; dx++) {
+ for (dy = -2; dy < 3; dy++, fp++) {
+ color[3] = *(fp) * shadow_col[3];
glColor4fv(color);
blf_texture_draw(uv, x1+dx, y1+dy, x2+dx, y2+dy);
}
@@ -341,20 +340,20 @@ static void blf_texture5_draw(const float shadow_col[4], float uv[2][2], float x
static void blf_texture3_draw(const float shadow_col[4], float uv[2][2], float x1, float y1, float x2, float y2)
{
- float soft[9]= {1/16.0f, 2/16.0f, 1/16.0f,
- 2/16.0f,4/16.0f, 2/16.0f,
- 1/16.0f, 2/16.0f, 1/16.0f};
+ float soft[9] = {1/16.0f, 2/16.0f, 1/16.0f,
+ 2/16.0f,4/16.0f, 2/16.0f,
+ 1/16.0f, 2/16.0f, 1/16.0f};
- float color[4], *fp= soft;
+ float color[4], *fp = soft;
int dx, dy;
- color[0]= shadow_col[0];
- color[1]= shadow_col[1];
- color[2]= shadow_col[2];
+ color[0] = shadow_col[0];
+ color[1] = shadow_col[1];
+ color[2] = shadow_col[2];
- for(dx=-1; dx<2; dx++) {
- for(dy=-1; dy<2; dy++, fp++) {
- color[3]= *(fp) * shadow_col[3];
+ for (dx = -1; dx < 2; dx++) {
+ for (dy = -1; dy < 2; dy++, fp++) {
+ color[3] = *(fp) * shadow_col[3];
glColor4fv(color);
blf_texture_draw(uv, x1+dx, y1+dy, x2+dx, y2+dy);
}
@@ -373,30 +372,30 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
return 1;
if (g->build_tex == 0) {
- GlyphCacheBLF *gc= font->glyph_cache;
+ GlyphCacheBLF *gc = font->glyph_cache;
if (font->max_tex_size == -1)
glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint *)&font->max_tex_size);
if (gc->cur_tex == -1) {
blf_glyph_cache_texture(font, gc);
- gc->x_offs= gc->pad;
- gc->y_offs= gc->pad;
+ gc->x_offs = gc->pad;
+ gc->y_offs = gc->pad;
}
if (gc->x_offs > (gc->p2_width - gc->max_glyph_width)) {
- gc->x_offs= gc->pad;
+ gc->x_offs = gc->pad;
gc->y_offs += gc->max_glyph_height;
if (gc->y_offs > (gc->p2_height - gc->max_glyph_height)) {
- gc->y_offs= gc->pad;
+ gc->y_offs = gc->pad;
blf_glyph_cache_texture(font, gc);
}
}
- g->tex= gc->textures[gc->cur_tex];
- g->xoff= gc->x_offs;
- g->yoff= gc->y_offs;
+ g->tex = gc->textures[gc->cur_tex];
+ g->xoff = gc->x_offs;
+ g->yoff = gc->y_offs;
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
@@ -407,32 +406,32 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
glTexSubImage2D(GL_TEXTURE_2D, 0, g->xoff, g->yoff, g->width, g->height, GL_ALPHA, GL_UNSIGNED_BYTE, g->bitmap);
glPopClientAttrib();
- g->uv[0][0]= ((float)g->xoff) / ((float)gc->p2_width);
- g->uv[0][1]= ((float)g->yoff) / ((float)gc->p2_height);
- g->uv[1][0]= ((float)(g->xoff + g->width)) / ((float)gc->p2_width);
- g->uv[1][1]= ((float)(g->yoff + g->height)) / ((float)gc->p2_height);
+ g->uv[0][0] = ((float)g->xoff) / ((float)gc->p2_width);
+ g->uv[0][1] = ((float)g->yoff) / ((float)gc->p2_height);
+ g->uv[1][0] = ((float)(g->xoff + g->width)) / ((float)gc->p2_width);
+ g->uv[1][1] = ((float)(g->yoff + g->height)) / ((float)gc->p2_height);
/* update the x offset for the next glyph. */
gc->x_offs += (int)(g->box.xmax - g->box.xmin + gc->pad);
gc->rem_glyphs--;
- g->build_tex= 1;
+ g->build_tex = 1;
}
- xo= 0.0f;
- yo= 0.0f;
+ xo = 0.0f;
+ yo = 0.0f;
if (font->flags & BLF_SHADOW) {
- xo= x;
- yo= y;
+ xo = x;
+ yo = y;
x += font->shadow_x;
y += font->shadow_y;
}
- dx= floor(x + g->pos_x);
- dx1= dx + g->width;
- y1= y + g->pos_y;
- y2= y + g->pos_y - g->height;
+ dx = floor(x + g->pos_x);
+ dx1 = dx + g->width;
+ y1 = y + g->pos_y;
+ y2 = y + g->pos_y - g->height;
if (font->flags & BLF_CLIPPING) {
if (!BLI_in_rctf(&font->clip_rec, dx + font->pos[0], y1 + font->pos[1]))
@@ -446,12 +445,12 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
}
if (font->tex_bind_state != g->tex) {
- glBindTexture(GL_TEXTURE_2D, (font->tex_bind_state= g->tex));
+ glBindTexture(GL_TEXTURE_2D, (font->tex_bind_state = g->tex));
}
if (font->flags & BLF_SHADOW) {
- switch(font->shadow) {
+ switch (font->shadow) {
case 3:
blf_texture3_draw(font->shadow_col, g->uv, dx, y1, dx1, y2);
break;
@@ -466,16 +465,16 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
glColor4fv(font->orig_col);
- x= xo;
- y= yo;
+ x = xo;
+ y = yo;
- dx= floor(x + g->pos_x);
- dx1= dx + g->width;
- y1= y + g->pos_y;
- y2= y + g->pos_y - g->height;
+ dx = floor(x + g->pos_x);
+ dx1 = dx + g->width;
+ y1 = y + g->pos_y;
+ y2 = y + g->pos_y - g->height;
}
- switch(font->blur) {
+ switch (font->blur) {
case 3:
blf_texture3_draw(font->orig_col, g->uv, dx, y1, dx1, y2);
break;
diff --git a/source/blender/blenfont/intern/blf_internal.h b/source/blender/blenfont/intern/blf_internal.h
index 3ef0b3422fe..f43fa8a7458 100644
--- a/source/blender/blenfont/intern/blf_internal.h
+++ b/source/blender/blenfont/intern/blf_internal.h
@@ -41,7 +41,7 @@ unsigned int blf_hash(unsigned int val);
char *blf_dir_search(const char *file);
char *blf_dir_metrics_search(const char *filename);
-// int blf_dir_split(const char *str, char *file, int *size); // UNUSED
+/* int blf_dir_split(const char *str, char *file, int *size); *//* UNUSED */
int blf_font_init(void);
void blf_font_exit(void);
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
index 95203c2b1c0..8a4f8818f40 100644
--- a/source/blender/blenfont/intern/blf_lang.c
+++ b/source/blender/blenfont/intern/blf_lang.c
@@ -55,7 +55,7 @@
#include "MEM_guardedalloc.h"
-#include "BLI_linklist.h" /* linknode */
+#include "BLI_linklist.h" /* linknode */
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BLI_path_util.h"
@@ -82,7 +82,7 @@ static const char *locales[] = {
"spanish", "es",
"catalan", "ca_AD",
"czech", "cs_CZ",
- "ptb", "pt_BR",
+ "ptb", "pt",
#if defined (_WIN32) && !defined(FREE_WINDOWS)
"Chinese (Simplified)_China.1252", "zh_CN",
"Chinese (Traditional)_China.1252", "zh_TW",
@@ -104,12 +104,12 @@ static const char *locales[] = {
"persian", "fa_IR",
"indonesian", "id_ID",
"serbian (latin)", "sr_RS@latin",
- "kyrgyz", "ky",
+ "kyrgyz", "ky_KG",
};
void BLF_lang_init(void)
{
- char *messagepath= BLI_get_folder(BLENDER_DATAFILES, "locale");
+ char *messagepath = BLI_get_folder(BLENDER_DATAFILES, "locale");
BLI_strncpy(global_encoding_name, SYSTEM_ENCODING_DEFAULT, sizeof(global_encoding_name));
@@ -118,7 +118,7 @@ void BLF_lang_init(void)
}
else {
printf("%s: 'locale' data path for translations not found, continuing\n", __func__);
- global_messagepath[0]= '\0';
+ global_messagepath[0] = '\0';
}
}
@@ -126,18 +126,18 @@ void BLF_lang_init(void)
/* get LANG/LANGUAGE environment variable */
static void get_language_variable(const char *varname, char *var, int maxlen)
{
- char *env= getenv(varname);
+ char *env = getenv(varname);
- if(env) {
+ if (env) {
char *s;
/* store defaul locale */
BLI_strncpy(var, env, maxlen);
/* use first language as default */
- s= strchr(var, ':');
- if(s)
- s[0]= 0;
+ s = strchr(var, ':');
+ if (s)
+ s[0] = 0;
}
}
@@ -146,7 +146,7 @@ static void get_language_variable(const char *varname, char *var, int maxlen)
*/
static void get_language(const char *locale, const char *lang, char *language, int maxlen)
{
- if(locale[0]) {
+ if (locale[0]) {
BLI_strncpy(language, locale, maxlen);
}
else {
@@ -154,9 +154,9 @@ static void get_language(const char *locale, const char *lang, char *language, i
BLI_strncpy(language, lang, maxlen);
- s= strchr(language, '.');
- if(s)
- s[0]= 0;
+ s = strchr(language, '.');
+ if (s)
+ s[0] = 0;
}
}
@@ -165,22 +165,22 @@ void BLF_lang_set(const char *str)
{
char *locreturn;
const char *short_locale;
- int ok= 1;
+ int ok = 1;
const char *long_locale = locales[2 * U.language];
- if((U.transopts&USER_DOTRANSLATE)==0)
+ if ((U.transopts&USER_DOTRANSLATE) == 0)
return;
- if(str)
+ if (str)
short_locale = str;
else
short_locale = locales[ 2 * U.language + 1];
#if defined (_WIN32) && !defined(FREE_WINDOWS)
- if(short_locale) {
+ if (short_locale) {
char *envStr;
- if( U.language==0 )/* use system setting */
+ if (U.language == 0)/* use system setting */
envStr = BLI_sprintfN( "LANG=%s", getenv("LANG") );
else
envStr = BLI_sprintfN( "LANG=%s", short_locale );
@@ -189,48 +189,48 @@ void BLF_lang_set(const char *str)
MEM_freeN(envStr);
}
- locreturn= setlocale(LC_ALL, long_locale);
+ locreturn = setlocale(LC_ALL, long_locale);
if (locreturn == NULL) {
- if(G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("Could not change locale to %s\n", long_locale);
- ok= 0;
+ ok = 0;
}
#else
{
- static char default_lang[64]="\0";
- static char default_language[64]="\0";
+ static char default_lang[64] ="\0";
+ static char default_language[64] ="\0";
- if(default_lang[0]==0)
+ if (default_lang[0] == 0)
get_language_variable("LANG", default_lang, sizeof(default_lang));
- if(default_language[0]==0)
+ if (default_language[0] == 0)
get_language_variable("LANGUAGE", default_language, sizeof(default_language));
- if(short_locale[0]) {
- if(G.f & G_DEBUG)
+ if (short_locale[0]) {
+ if (G.debug & G_DEBUG)
printf("Setting LANG= and LANGUAGE to %s\n", short_locale);
BLI_setenv("LANG", short_locale);
BLI_setenv("LANGUAGE", short_locale);
}
else {
- if(G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("Setting LANG=%s and LANGUAGE=%s\n", default_lang, default_language);
BLI_setenv("LANG", default_lang);
BLI_setenv("LANGUAGE", default_language);
}
- locreturn= setlocale(LC_ALL, short_locale);
+ locreturn = setlocale(LC_ALL, short_locale);
- if(locreturn == NULL) {
- char *short_locale_utf8= NULL;
+ if (locreturn == NULL) {
+ char *short_locale_utf8 = NULL;
- if(short_locale[0]) {
- short_locale_utf8= BLI_sprintfN("%s.UTF-8", short_locale);
- locreturn= setlocale(LC_ALL, short_locale_utf8);
+ if (short_locale[0]) {
+ short_locale_utf8 = BLI_sprintfN("%s.UTF-8", short_locale);
+ locreturn = setlocale(LC_ALL, short_locale_utf8);
}
if (locreturn == NULL) {
@@ -238,8 +238,8 @@ void BLF_lang_set(const char *str)
get_language(long_locale, default_lang, language, sizeof(language));
- if(G.f & G_DEBUG) {
- if(short_locale[0])
+ if (G.debug & G_DEBUG) {
+ if (short_locale[0])
printf("Could not change locale to %s nor %s\n", short_locale, short_locale_utf8);
else
printf("Could not reset locale\n");
@@ -251,19 +251,19 @@ void BLF_lang_set(const char *str)
BLI_setenv("LANG", default_lang);
BLI_setenv("LANGUAGE", language);
- locreturn= setlocale(LC_ALL, "");
+ locreturn = setlocale(LC_ALL, "");
- ok= 0;
+ ok = 0;
}
- if(short_locale_utf8)
+ if (short_locale_utf8)
MEM_freeN(short_locale_utf8);
}
}
#endif
- if(ok) {
- //printf("Change locale to %s\n", locreturn );
+ if (ok) {
+ /*printf("Change locale to %s\n", locreturn ); */
BLI_strncpy(global_language, locreturn, sizeof(global_language));
}
diff --git a/source/blender/blenfont/intern/blf_translation.c b/source/blender/blenfont/intern/blf_translation.c
index 0ddb6549717..5d74a844425 100644
--- a/source/blender/blenfont/intern/blf_translation.c
+++ b/source/blender/blenfont/intern/blf_translation.c
@@ -57,34 +57,34 @@
#include "DNA_userdef_types.h" /* For user settings. */
#ifdef WITH_INTERNATIONAL
-static const char unifont_filename[]="droidsans.ttf.gz";
-static unsigned char *unifont_ttf= NULL;
-static int unifont_size= 0;
+static const char unifont_filename[] ="droidsans.ttf.gz";
+static unsigned char *unifont_ttf = NULL;
+static int unifont_size = 0;
unsigned char *BLF_get_unifont(int *unifont_size_r)
{
- if(unifont_ttf==NULL) {
+ if (unifont_ttf == NULL) {
char *fontpath = BLI_get_folder(BLENDER_DATAFILES, "fonts");
if (fontpath) {
char unifont_path[1024];
BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, unifont_filename);
- unifont_ttf= (unsigned char*)BLI_file_ungzip_to_mem(unifont_path, &unifont_size);
+ unifont_ttf = (unsigned char*)BLI_file_ungzip_to_mem(unifont_path, &unifont_size);
}
else {
printf("%s: 'fonts' data path not found for international font, continuing\n", __func__);
}
}
- *unifont_size_r= unifont_size;
+ *unifont_size_r = unifont_size;
return unifont_ttf;
}
void BLF_free_unifont(void)
{
- if(unifont_ttf)
+ if (unifont_ttf)
MEM_freeN(unifont_ttf);
}
@@ -93,8 +93,8 @@ void BLF_free_unifont(void)
const char* BLF_gettext(const char *msgid)
{
#ifdef WITH_INTERNATIONAL
- if( msgid[0] )
- return gettext( msgid );
+ if (msgid[0])
+ return gettext(msgid);
return "";
#else
return msgid;
@@ -154,26 +154,36 @@ int BLF_translate_tooltips(void)
#endif
}
-const char *BLF_translate_do_iface(const char *msgid)
+const char *BLF_translate_do_iface(const char *context, const char *msgid)
{
#ifdef WITH_INTERNATIONAL
- if(BLF_translate_iface())
- return BLF_gettext(msgid);
+ if (BLF_translate_iface()) {
+ if (context)
+ return BLF_pgettext(context, msgid);
+ else
+ return BLF_gettext(msgid);
+ }
else
return msgid;
#else
+ (void)context;
return msgid;
#endif
}
-const char *BLF_translate_do_tooltip(const char *msgid)
+const char *BLF_translate_do_tooltip(const char *context, const char *msgid)
{
#ifdef WITH_INTERNATIONAL
- if(BLF_translate_tooltips())
- return BLF_gettext(msgid);
+ if (BLF_translate_tooltips()) {
+ if (context)
+ return BLF_pgettext(context, msgid);
+ else
+ return BLF_gettext(msgid);
+ }
else
return msgid;
#else
+ (void)context;
return msgid;
#endif
}
diff --git a/source/blender/blenfont/intern/blf_util.c b/source/blender/blenfont/intern/blf_util.c
index 45e01e58312..8240906dd3b 100644
--- a/source/blender/blenfont/intern/blf_util.c
+++ b/source/blender/blenfont/intern/blf_util.c
@@ -53,7 +53,7 @@ unsigned int blf_hash(unsigned int val)
{
unsigned int key;
- key= val;
+ key = val;
key += ~(key << 16);
key ^= (key >> 5);
key += (key << 3);
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index 3103dde31dc..abdb1d8cc8b 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 tessellated data.
+ * Also, the mface origindex layer indexes mpolys, not mfaces.
+ */
typedef struct DMGridData {
float co[3];
@@ -112,12 +112,46 @@ 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 enum DMDirtyFlag {
+ /* dm has valid tessellated faces, but tessellated CDDATA need to be updated. */
+ DM_DIRTY_TESS_CDLAYERS = 1 << 0,
+} DMDirtyFlag;
+
typedef struct DerivedMesh DerivedMesh;
struct DerivedMesh {
/* Private DerivedMesh data, only for internal DerivedMesh use */
@@ -129,12 +163,13 @@ struct DerivedMesh {
struct GPUDrawObject *drawObject;
DerivedMeshType type;
float auto_bump_scale;
+ DMDirtyFlag dirty;
/* calculate vert and face normals */
void (*calcNormals)(DerivedMesh *dm);
- /* recalculates mesh tesselation */
- void (*recalcTesselation)(DerivedMesh *dm);
+ /* recalculates mesh tessellation */
+ void (*recalcTessellation)(DerivedMesh *dm);
/* Misc. Queries */
@@ -145,7 +180,7 @@ struct DerivedMesh {
int (*getNumLoops)(DerivedMesh *dm);
int (*getNumPolys)(DerivedMesh *dm);
- /* copy a single vert/edge/tesselated face from the derived mesh into
+ /* copy a single vert/edge/tessellated face from the derived mesh into
* *{vert/edge/face}_r. note that the current implementation
* of this function can be quite slow, iterating over all
* elements (editmesh)
@@ -199,8 +234,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 +253,9 @@ struct DerivedMesh {
DMGridData **(*getGridData)(DerivedMesh *dm);
DMGridAdjacency *(*getGridAdjacency)(DerivedMesh *dm);
int *(*getGridOffset)(DerivedMesh *dm);
+ DMFlagMat *(*getGridFlagMats)(DerivedMesh *dm);
+ unsigned int **(*getGridHidden)(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
@@ -269,7 +307,7 @@ struct DerivedMesh {
/* Get a map of vertices to faces
*/
- struct ListBase *(*getPolyMap)(struct Object *ob, DerivedMesh *dm);
+ const struct MeshElemMap *(*getPolyMap)(struct Object *ob, DerivedMesh *dm);
/* Get the BVH used for paint modes
*/
@@ -300,33 +338,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 +368,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 +388,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 +397,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 +408,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
@@ -407,19 +425,19 @@ struct DerivedMesh {
void (*release)(DerivedMesh *dm);
};
-/* utility function to initialise a DerivedMesh's function pointers to
+/* utility function to initialize a DerivedMesh's function pointers to
* the default implementation (for those functions which have a default)
*/
void DM_init_funcs(DerivedMesh *dm);
-/* utility function to initialise a DerivedMesh for the desired number
+/* utility function to initialize a DerivedMesh for the desired number
* of vertices, edges and faces (doesn't allocate memory for them, just
* sets up the custom data layers)
*/
void DM_init(DerivedMesh *dm, DerivedMeshType type, int numVerts, int numEdges,
int numFaces, int numLoops, int numPolys);
-/* utility function to initialise a DerivedMesh for the desired number
+/* utility function to initialize a DerivedMesh for the desired number
* of vertices, edges and faces, with a layer setup copied from source
*/
void DM_from_template(DerivedMesh *dm, DerivedMesh *source,
@@ -436,12 +454,12 @@ int DM_release(DerivedMesh *dm);
*/
void DM_to_mesh(DerivedMesh *dm, struct Mesh *me, struct Object *ob);
-struct BMEditMesh *DM_to_editbmesh(struct Object *ob, struct DerivedMesh *dm,
- struct BMEditMesh *existing, int do_tesselate);
+struct BMEditMesh *DM_to_editbmesh(struct DerivedMesh *dm,
+ struct BMEditMesh *existing, int do_tessellate);
/* conversion to bmesh only */
void DM_to_bmesh_ex(struct DerivedMesh *dm, struct BMesh *bm);
-struct BMesh *DM_to_bmesh(struct Object *ob, struct DerivedMesh *dm);
+struct BMesh *DM_to_bmesh(struct DerivedMesh *dm);
/* utility function to convert a DerivedMesh to a shape key block
@@ -528,6 +546,8 @@ void DM_DupPolys(DerivedMesh *source, DerivedMesh *target);
void DM_ensure_tessface(DerivedMesh *dm);
+void DM_update_tessface_data(DerivedMesh *dm);
+
/* interpolates vertex data from the vertices indexed by src_indices in the
* source mesh using the given weights and stores the result in the vertex
* indexed by dest_index in the dest mesh
@@ -576,8 +596,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 +645,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..e648523aec3 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);
@@ -105,10 +105,12 @@ void BKE_keyingsets_free(struct ListBase *list);
/* Path Fixing API */
/* Fix all the paths for the given ID+AnimData */
-void BKE_animdata_fix_paths_rename(struct ID *owner_id, struct AnimData *adt, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, int verify_paths);
+void BKE_animdata_fix_paths_rename(struct ID *owner_id, struct AnimData *adt, struct ID *ref_id, const char *prefix,
+ const char *oldName, const char *newName, int oldSubscript, int newSubscript,
+ int verify_paths);
/* Fix all the paths for the entire database... */
-void BKE_all_animdata_fix_paths_rename(const char *prefix, const char *oldName, const char *newName);
+void BKE_all_animdata_fix_paths_rename(ID *ref_id, const char *prefix, const char *oldName, const char *newName);
/* -------------------------------------- */
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 441d63be764..e4802cfa37f 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -82,6 +82,9 @@ void free_armature(struct bArmature *arm);
void make_local_armature(struct bArmature *arm);
struct bArmature *copy_armature(struct bArmature *arm);
+/* Bounding box. */
+struct BoundBox *BKE_armature_get_bb(struct Object *ob);
+
int bone_autoside_name (char name[64], int strip_number, short axis, float head, float tail);
struct Bone *get_named_bone (struct bArmature *arm, const char *name);
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index 1c661b3804f..ffabbcf32f0 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -42,7 +42,7 @@ extern "C" {
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 262
-#define BLENDER_SUBVERSION 0
+#define BLENDER_SUBVERSION 3
#define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0
@@ -51,7 +51,7 @@ extern "C" {
/* can be left blank, otherwise a,b,c... etc with no quotes */
#define BLENDER_VERSION_CHAR
/* alpha/beta/rc/release, docs use this */
-#define BLENDER_VERSION_CYCLE alpha
+#define BLENDER_VERSION_CYCLE beta
extern char versionstr[]; /* from blender.c */
diff --git a/source/blender/blenkernel/BKE_bmesh.h b/source/blender/blenkernel/BKE_bmesh.h
index 677614e26e3..bcb50a9c903 100644
--- a/source/blender/blenkernel/BKE_bmesh.h
+++ b/source/blender/blenkernel/BKE_bmesh.h
@@ -37,6 +37,9 @@
/*NOTE: this is the bmesh 1.0 code. it's completely outdated.*/
+/* uncomment to use the new bevel operator as a modifier */
+// #define USE_BM_BEVEL_OP_AS_MOD
+
/* bevel tool defines */
/* element flags */
#define BME_BEVEL_ORIG 1
@@ -84,6 +87,7 @@ typedef struct BME_TransData_Head {
int len;
} BME_TransData_Head;
+/* this is no longer used */
typedef struct BME_Glob { /* stored in Global G for Transform() purposes */
struct BMesh *bm;
BME_TransData_Head *td;
@@ -95,6 +99,7 @@ typedef struct BME_Glob { /* stored in Global G for Transform() purposes */
struct BME_TransData *BME_get_transdata(struct BME_TransData_Head *td, struct BMVert *v);
void BME_free_transdata(struct BME_TransData_Head *td);
-struct BMesh *BME_bevel(struct BMEditMesh *em, float value, int res, int options, int defgrp_index, float angle, BME_TransData_Head **rtd);
+struct BMesh *BME_bevel(struct BMEditMesh *em, float value, int res, int options, int defgrp_index, float angle,
+ BME_TransData_Head **rtd, int do_tessface);
#endif
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 d3d8546ddae..ab3d751cc8e 100644
--- a/source/blender/blenkernel/BKE_bvhutils.h
+++ b/source/blender/blenkernel/BKE_bvhutils.h
@@ -75,7 +75,7 @@ typedef struct BVHTreeFromMesh
*
* The tree is build in mesh space coordinates, this means special care must be made on queries
* so that the coordinates and rays are first translated on the mesh local coordinates.
- * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becames possible to reuse
+ * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becomes possible to reuse
* a BVHTree.
*
* free_bvhtree_from_mesh should be called when the tree is no longer needed.
@@ -88,7 +88,7 @@ BVHTree* bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMes
*
* The tree is build in mesh space coordinates, this means special care must be made on queries
* so that the coordinates and rays are first translated on the mesh local coordinates.
- * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becames possible to reuse
+ * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becomes possible to reuse
* a BVHTree.
*
* The returned value is the same as in data->tree, its only returned to make it easier to test
@@ -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]);
@@ -124,7 +124,7 @@ typedef struct LinkNode* BVHCache;
/*
- * Queries a bvhcache for the chache bvhtree of the request type
+ * Queries a bvhcache for the cache bvhtree of the request type
*/
BVHTree *bvhcache_find(BVHCache *cache, int type);
diff --git a/source/blender/blenkernel/BKE_cdderivedmesh.h b/source/blender/blenkernel/BKE_cdderivedmesh.h
index 5fda391cd80..bdfe7366f9e 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 */
@@ -76,7 +76,7 @@ struct DerivedMesh *CDDM_copy_from_tessface(struct DerivedMesh *dm);
/* creates a CDDerivedMesh with the same layer stack configuration as the
* given DerivedMesh and containing the requested numbers of elements.
- * elements are initialised to all zeros
+ * elements are initialized to all zeros
*/
struct DerivedMesh *CDDM_from_template(struct DerivedMesh *source,
int numVerts, int numEdges, int numFaces,
@@ -96,23 +96,24 @@ void CDDM_apply_vert_normals(struct DerivedMesh *cddm, short (*vertNormals)[3]);
/* recalculates vertex and face normals for a CDDerivedMesh
*/
+void CDDM_calc_normals_mapping_ex(struct DerivedMesh *dm, const short only_face_normals);
void CDDM_calc_normals_mapping(struct DerivedMesh *dm);
void CDDM_calc_normals(struct DerivedMesh *dm);
void CDDM_calc_normals_tessface(struct DerivedMesh *dm);
/* calculates edges for a CDDerivedMesh (from face data)
* this completely replaces the current edge data in the DerivedMesh
- * builds edges from the tesselated face data.
+ * builds edges from the tessellated face data.
*/
void CDDM_calc_edges_tessface(struct DerivedMesh *dm);
-/* same as CDDM_calc_edges_tessface only makes edges from ngon faces instead of tesselation
- faces*/
+/* same as CDDM_calc_edges_tessface only makes edges from ngon faces instead of tessellation
+ * faces*/
void CDDM_calc_edges(struct DerivedMesh *dm);
/* reconstitute face triangulation */
-void CDDM_recalc_tesselation(struct DerivedMesh *dm);
-void CDDM_recalc_tesselation_ex(struct DerivedMesh *dm, const int do_face_nor_cpy);
+void CDDM_recalc_tessellation(struct DerivedMesh *dm);
+void CDDM_recalc_tessellation_ex(struct DerivedMesh *dm, const int do_face_nor_cpy);
/* lowers the number of vertices/edges/faces in a CDDerivedMesh
* the layer data stays the same size
@@ -143,9 +144,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..435832f8c87 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. */
@@ -198,32 +198,32 @@ int cloth_bvh_objcollision (struct Object *ob, struct ClothModifierData * clmd,
////////////////////////////////////////////////
// needed for cloth.c
-int implicit_init ( struct Object *ob, struct ClothModifierData *clmd );
-int implicit_free ( struct ClothModifierData *clmd );
-int implicit_solver ( struct Object *ob, float frame, struct ClothModifierData *clmd, struct ListBase *effectors );
-void implicit_set_positions ( struct ClothModifierData *clmd );
+int implicit_init (struct Object *ob, struct ClothModifierData *clmd );
+int implicit_free (struct ClothModifierData *clmd );
+int implicit_solver (struct Object *ob, float frame, struct ClothModifierData *clmd, struct ListBase *effectors );
+void implicit_set_positions (struct ClothModifierData *clmd );
/////////////////////////////////////////////////
// cloth.c
////////////////////////////////////////////////
// needed for modifier.c
-void cloth_free_modifier_extern ( struct ClothModifierData *clmd );
-void cloth_free_modifier ( struct ClothModifierData *clmd );
-void cloth_init ( struct ClothModifierData *clmd );
-void clothModifier_do ( struct ClothModifierData *clmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm, float (*vertexCos)[3]);
+void cloth_free_modifier_extern (struct ClothModifierData *clmd );
+void cloth_free_modifier (struct ClothModifierData *clmd );
+void cloth_init (struct ClothModifierData *clmd );
+void clothModifier_do (struct ClothModifierData *clmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm, float (*vertexCos)[3]);
int cloth_uses_vgroup(struct ClothModifierData *clmd);
// needed for collision.c
-void bvhtree_update_from_cloth ( struct ClothModifierData *clmd, int moving );
-void bvhselftree_update_from_cloth ( struct ClothModifierData *clmd, int moving );
+void bvhtree_update_from_cloth (struct ClothModifierData *clmd, int moving );
+void bvhselftree_update_from_cloth (struct ClothModifierData *clmd, int moving );
// needed for button_object.c
-void cloth_clear_cache ( struct Object *ob, struct ClothModifierData *clmd, float framenr );
+void cloth_clear_cache (struct Object *ob, struct ClothModifierData *clmd, float framenr );
// needed for cloth.c
-int cloth_add_spring ( struct ClothModifierData *clmd, unsigned int indexA, unsigned int indexB, float restlength, int spring_type);
+int cloth_add_spring (struct ClothModifierData *clmd, unsigned int indexA, unsigned int indexB, float restlength, int spring_type);
////////////////////////////////////////////////
@@ -237,14 +237,14 @@ typedef enum
/* This structure defines how to call the solver.
-*/
+ */
typedef struct
{
const char *name;
CM_SOLVER_ID id;
- int ( *init ) ( struct Object *ob, struct ClothModifierData *clmd );
- int ( *solver ) ( struct Object *ob, float framenr, struct ClothModifierData *clmd, struct ListBase *effectors );
- int ( *free ) ( struct ClothModifierData *clmd );
+ int ( *init ) (struct Object *ob, struct ClothModifierData *clmd );
+ int ( *solver ) (struct Object *ob, float framenr, struct ClothModifierData *clmd, struct ListBase *effectors );
+ int ( *free ) (struct ClothModifierData *clmd );
}
CM_SOLVER_DEF;
diff --git a/source/blender/blenkernel/BKE_collision.h b/source/blender/blenkernel/BKE_collision.h
index 75fdc4981a0..24bce63ea3b 100644
--- a/source/blender/blenkernel/BKE_collision.h
+++ b/source/blender/blenkernel/BKE_collision.h
@@ -130,19 +130,19 @@ FaceCollPair;
// used in modifier.c from collision.c
/////////////////////////////////////////////////
-BVHTree *bvhtree_build_from_mvert ( struct MFace *mfaces, unsigned int numfaces, struct MVert *x, unsigned int numverts, float epsilon );
-void bvhtree_update_from_mvert ( BVHTree * bvhtree, struct MFace *faces, int numfaces, struct MVert *x, struct MVert *xnew, int numverts, int moving );
+BVHTree *bvhtree_build_from_mvert(struct MFace *mfaces, unsigned int numfaces, struct MVert *x, unsigned int numverts, float epsilon );
+void bvhtree_update_from_mvert(BVHTree * bvhtree, struct MFace *faces, int numfaces, struct MVert *x, struct MVert *xnew, int numverts, int moving );
/////////////////////////////////////////////////
// move Collision modifier object inter-frame with step = [0,1]
// defined in collisions.c
-void collision_move_object ( struct CollisionModifierData *collmd, float step, float prevstep );
+void collision_move_object(struct CollisionModifierData *collmd, float step, float prevstep);
/////////////////////////////////////////////////
// used in effect.c
/////////////////////////////////////////////////
-struct Object **get_collisionobjects(struct Scene *scene, struct Object *self, struct Group *group, unsigned int *numcollobj);
+struct Object **get_collisionobjects(struct Scene *scene, struct Object *self, struct Group *group, unsigned int *numcollobj, unsigned int modifier_type);
typedef struct ColliderCache {
struct ColliderCache *next, *prev;
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_curve.h b/source/blender/blenkernel/BKE_curve.h
index dd0c021f281..fa3a1a6897a 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -54,27 +54,27 @@ struct Scene;
#define CU_DO_RADIUS(cu, nu) ((CU_DO_TILT(cu, nu) || ((cu)->flag & CU_PATH_RADIUS) || (cu)->bevobj || (cu)->ext1!=0.0f || (cu)->ext2!=0.0f) ? 1:0)
-void unlink_curve( struct Curve *cu);
+void unlink_curve(struct Curve *cu);
void free_curve_editNurb_keyIndex(struct EditNurb *editnurb);
void free_curve_editNurb(struct Curve *cu);
-void free_curve( struct Curve *cu);
+void free_curve(struct Curve *cu);
void BKE_free_editfont(struct Curve *cu);
struct Curve *add_curve(const char *name, int type);
-struct Curve *copy_curve( struct Curve *cu);
-void make_local_curve( struct Curve *cu);
+struct Curve *copy_curve(struct Curve *cu);
+void make_local_curve(struct Curve *cu);
struct ListBase *curve_editnurbs(struct Curve *cu);
-short curve_type( struct Curve *cu);
-void test_curve_type( struct Object *ob);
-void update_curve_dimension( struct Curve *cu );
-void tex_space_curve( struct Curve *cu);
-int count_curveverts( struct ListBase *nurb);
-int count_curveverts_without_handles( struct ListBase *nurb);
-void freeNurb( struct Nurb *nu);
-void freeNurblist( struct ListBase *lb);
-struct Nurb *duplicateNurb( struct Nurb *nu);
-void duplicateNurblist( struct ListBase *lb1, struct ListBase *lb2);
-void test2DNurb( struct Nurb *nu);
-void minmaxNurb( struct Nurb *nu, float *min, float *max);
+short curve_type(struct Curve *cu);
+void test_curve_type(struct Object *ob);
+void update_curve_dimension(struct Curve *cu );
+void tex_space_curve(struct Curve *cu);
+int count_curveverts(struct ListBase *nurb);
+int count_curveverts_without_handles(struct ListBase *nurb);
+void freeNurb(struct Nurb *nu);
+void freeNurblist(struct ListBase *lb);
+struct Nurb *duplicateNurb(struct Nurb *nu);
+void duplicateNurblist(struct ListBase *lb1, struct ListBase *lb2);
+void test2DNurb(struct Nurb *nu);
+void minmaxNurb(struct Nurb *nu, float *min, float *max);
void nurbs_knot_calc_u(struct Nurb *nu);
void nurbs_knot_calc_v(struct Nurb *nu);
@@ -83,19 +83,19 @@ void makeNurbfaces(struct Nurb *nu, float *coord_array, int rowstride, int resol
void makeNurbcurve(struct Nurb *nu, float *coord_array, float *tilt_array, float *radius_array, float *weight_array, int resolu, int stride);
void forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int it, int stride);
float *make_orco_curve(struct Scene *scene, struct Object *ob);
-float *make_orco_surf( struct Object *ob);
+float *make_orco_surf(struct Object *ob);
void makebevelcurve(struct Scene *scene, struct Object *ob, struct ListBase *disp, int forRender);
-void makeBevelList( struct Object *ob);
+void makeBevelList(struct Object *ob);
-void calchandleNurb( struct BezTriple *bezt, struct BezTriple *prev, struct BezTriple *next, int mode);
-void calchandlesNurb( struct Nurb *nu);
-void testhandlesNurb( struct Nurb *nu);
-void autocalchandlesNurb( struct Nurb *nu, int flag);
+void calchandleNurb(struct BezTriple *bezt, struct BezTriple *prev, struct BezTriple *next, int mode);
+void calchandlesNurb(struct Nurb *nu);
+void testhandlesNurb(struct Nurb *nu);
+void autocalchandlesNurb(struct Nurb *nu, int flag);
void autocalchandlesNurb_all(ListBase *editnurb, int flag);
void sethandlesNurb(ListBase *editnurb, short code);
-void switchdirectionNurb( struct Nurb *nu);
+void switchdirectionNurb(struct Nurb *nu);
void addNurbPoints(struct Nurb *nu, int number);
void addNurbPointsBezier(struct Nurb *nu, int number);
@@ -107,11 +107,11 @@ float (*curve_getKeyVertexCos(struct Curve *cu, struct ListBase *lb, float *key)
void curve_applyKeyVertexTilts(struct Curve *cu, struct ListBase *lb, float *key);
/* nurb checks if they can be drawn, also clamp order func */
-int check_valid_nurb_u( struct Nurb *nu);
-int check_valid_nurb_v( struct Nurb *nu);
+int check_valid_nurb_u(struct Nurb *nu);
+int check_valid_nurb_v(struct Nurb *nu);
-int clamp_nurb_order_u( struct Nurb *nu);
-int clamp_nurb_order_v( struct Nurb *nu);
+int clamp_nurb_order_u(struct Nurb *nu);
+int clamp_nurb_order_v(struct Nurb *nu);
ListBase *BKE_curve_nurbs(struct Curve *cu);
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index 99676e444f3..9797aa1201f 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,18 +69,19 @@ 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))
-/* Checks if the layer at physical offset layern (in data->layers) support math
+/**
+ * Checks if the layer at physical offset \a layer_n (in data->layers) support math
* the below operations.
*/
-int CustomData_layer_has_math(struct CustomData *data, int layern);
+int CustomData_layer_has_math(struct CustomData *data, int layer_n);
-/*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 +93,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,11 +107,11 @@ 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, int type);
+ int mask, int alloctype, struct BMesh *bm, const char htype);
/* frees data associated with a CustomData object (doesn't free the object
* itself, though)
@@ -124,7 +125,7 @@ void CustomData_free_temporary(struct CustomData *data, int totelem);
* backed by an external data array. the different allocation types are
* defined above. returns the data of the layer.
*
- * in editmode, use EM_add_data_layer instead of this function
+ * in editmode, use EDBM_data_layer_add instead of this function
*/
void *CustomData_add_layer(struct CustomData *data, int type, int alloctype,
void *layer, int totelem);
@@ -135,14 +136,14 @@ void *CustomData_add_layer_named(struct CustomData *data, int type, int alloctyp
/* frees the active or first data layer with the give type.
* returns 1 on succes, 0 if no layer with the given type is found
*
- * in editmode, use EM_free_data_layer instead of this function
+ * in editmode, use EDBM_data_layer_free instead of this function
*/
int CustomData_free_layer(struct CustomData *data, int type, int totelem, int index);
/* frees the layer index with the give type.
* returns 1 on succes, 0 if no layer with the given type is found
*
- * in editmode, use EM_free_data_layer instead of this function
+ * in editmode, use EDBM_data_layer_free instead of this function
*/
int CustomData_free_layer_active(struct CustomData *data, int type, int totelem);
@@ -210,8 +211,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 +312,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*/
@@ -319,7 +320,7 @@ void CustomData_to_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata,
struct CustomData *ldata, int totloop, int totpoly);
void CustomData_from_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata, int total);
void CustomData_bmesh_update_active_layers(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata);
-void CustomData_bmesh_init_pool(struct CustomData *data, int allocsize);
+void CustomData_bmesh_init_pool(struct CustomData *data, int totelem, const char htype);
/* External file storage */
diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h
index 2e9c94a3bb1..17275b6ea7d 100644
--- a/source/blender/blenkernel/BKE_deform.h
+++ b/source/blender/blenkernel/BKE_deform.h
@@ -53,6 +53,7 @@ struct MDeformWeight *defvert_find_index(const struct MDeformVert *dv, const int
struct MDeformWeight *defvert_verify_index(struct MDeformVert *dv, const int defgroup);
void defvert_add_index_notest(struct MDeformVert *dv, int defgroup, const float weight);
void defvert_remove_group(struct MDeformVert *dvert, struct MDeformWeight *dw);
+void defvert_clear(struct MDeformVert *dvert);
float defvert_find_weight(const struct MDeformVert *dvert, const int defgroup);
float defvert_array_find_weight_safe(const struct MDeformVert *dvert, const int index, const int defgroup);
@@ -64,6 +65,7 @@ void defvert_sync_mapped(struct MDeformVert *dvert_dst, const struct MDeformVert
const int *flip_map, const int flip_map_len, const int use_verify);
void defvert_remap (struct MDeformVert *dvert, int *map, const int map_len);
void defvert_flip(struct MDeformVert *dvert, const int *flip_map, const int flip_map_len);
+void defvert_flip_merged(struct MDeformVert *dvert, const int *flip_map, const int flip_map_len);
void defvert_normalize(struct MDeformVert *dvert);
void defvert_normalize_lock(struct MDeformVert *dvert, const int def_nr_lock);
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_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h
index d79d6a204b9..b615ac60c3e 100644
--- a/source/blender/blenkernel/BKE_fcurve.h
+++ b/source/blender/blenkernel/BKE_fcurve.h
@@ -135,7 +135,7 @@ typedef struct FModifierTypeInfo {
void (*evaluate_modifier)(struct FCurve *fcu, struct FModifier *fcm, float *cvalue, float evaltime);
} FModifierTypeInfo;
-/* Values which describe the behaviour of a FModifier Type */
+/* Values which describe the behavior of a FModifier Type */
typedef enum eFMI_Action_Types {
/* modifier only modifies values outside of data range */
FMI_TYPE_EXTRAPOLATION = 0,
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index fab42b5667b..5f230e5fad9 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -69,6 +69,7 @@ typedef struct Global {
short rt;
int f;
+ int debug;
/* Used for BMesh transformations */
struct BME_Glob *editBMesh;
@@ -104,7 +105,6 @@ typedef struct Global {
/* #define G_FACESELECT (1 << 8) use (mesh->editflag & ME_EDIT_PAINT_MASK) */
-#define G_DEBUG (1 << 12)
#define G_SCRIPT_AUTOEXEC (1 << 13)
#define G_SCRIPT_OVERRIDE_PREF (1 << 14) /* when this flag is set ignore the userprefs */
@@ -113,6 +113,18 @@ typedef struct Global {
/* #define G_AUTOMATKEYS (1 << 30) also removed */
+/* G.debug */
+enum {
+ G_DEBUG = (1 << 0), /* general debug flag, print more info in unexpected cases */
+ G_DEBUG_FFMPEG = (1 << 1),
+ G_DEBUG_PYTHON = (1 << 2), /* extra python info */
+ G_DEBUG_EVENTS = (1 << 3), /* input/window/screen events */
+ G_DEBUG_WM = (1 << 4) /* operator, undo */
+};
+
+#define G_DEBUG_ALL (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM)
+
+
/* G.fileflags */
#define G_AUTOPACK (1 << 0)
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_idcode.h b/source/blender/blenkernel/BKE_idcode.h
index d8e77abc989..2a01ef3afdb 100644
--- a/source/blender/blenkernel/BKE_idcode.h
+++ b/source/blender/blenkernel/BKE_idcode.h
@@ -35,8 +35,8 @@
/**
* Convert an idcode into a name.
*
- * @param code The code to convert.
- * @return A static string representing the name of
+ * \param code The code to convert.
+ * \return A static string representing the name of
* the code.
*/
const char *BKE_idcode_to_name(int code);
@@ -44,8 +44,8 @@ const char *BKE_idcode_to_name(int code);
/**
* Convert an idcode into a name (plural).
*
- * @param code The code to convert.
- * @return A static string representing the name of
+ * \param code The code to convert.
+ * \return A static string representing the name of
* the code.
*/
const char *BKE_idcode_to_name_plural(int code);
@@ -53,32 +53,32 @@ const char *BKE_idcode_to_name_plural(int code);
/**
* Convert a name into an idcode (ie. ID_SCE)
*
- * @param name The name to convert.
- * @return The code for the name, or 0 if invalid.
+ * \param name The name to convert.
+ * \return The code for the name, or 0 if invalid.
*/
int BKE_idcode_from_name(const char *name);
/**
* Return non-zero when an ID type is linkable.
*
- * @param code The code to check.
- * @return Boolean, 0 when non linkable.
+ * \param code The code to check.
+ * \return Boolean, 0 when non linkable.
*/
int BKE_idcode_is_linkable(int code);
/**
* Return if the ID code is a valid ID code.
*
- * @param code The code to check.
- * @return Boolean, 0 when invalid.
+ * \param code The code to check.
+ * \return Boolean, 0 when invalid.
*/
int BKE_idcode_is_valid(int code);
/**
* Return an ID code and steps the index forward 1.
*
- * @param index start as 0.
- * @return the code, 0 when all codes have been returned.
+ * \param index start as 0.
+ * \return the code, 0 when all codes have been returned.
*/
int BKE_idcode_iter_step(int *index);
diff --git a/source/blender/blenkernel/BKE_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_lattice.h b/source/blender/blenkernel/BKE_lattice.h
index 8a1529a7ad0..29c78510fd8 100644
--- a/source/blender/blenkernel/BKE_lattice.h
+++ b/source/blender/blenkernel/BKE_lattice.h
@@ -63,7 +63,7 @@ void curve_deform_vector(struct Scene *scene, struct Object *cuOb, struct Object
void lattice_deform_verts(struct Object *laOb, struct Object *target,
struct DerivedMesh *dm, float (*vertexCos)[3],
- int numVerts, const char *vgroup);
+ int numVerts, const char *vgroup, float influence);
void armature_deform_verts(struct Object *armOb, struct Object *target,
struct DerivedMesh *dm, float (*vertexCos)[3],
float (*defMats)[3][3], int numVerts, int deformflag,
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 6c6153523b7..2d0719a78fa 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -64,19 +64,19 @@ extern "C" {
struct BMesh *BKE_mesh_to_bmesh(struct Mesh *me, struct Object *ob);
/*
- * this function recreates a tesselation.
- * returns number of tesselation faces.
+ * this function recreates a tessellation.
+ * returns number of tessellation faces.
*
- * use_poly_origindex sets whether or not the tesselation faces' origindex
+ * use_poly_origindex sets whether or not the tessellation faces' origindex
* layer should point to original poly indices or real poly indices.
*
- * use_face_origindex sets the tesselation faces' origindex layer
- * to point to the tesselation faces themselves, not the polys.
+ * use_face_origindex sets the tessellation faces' origindex layer
+ * to point to the tessellation faces themselves, not the polys.
*
* if both of the above are 0, it'll use the indices of the mpolys of the MPoly
* data in pdata, and ignore the origindex layer altogether.
*/
-int mesh_recalcTesselation(struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata,
+int mesh_recalcTessellation(struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata,
struct MVert *mvert,
int totface, int totloop, int totpoly,
const int do_face_normals);
@@ -100,17 +100,24 @@ 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);
+/* update the hide flag for edges and polys from the corresponding
+ flag in verts */
+void mesh_flush_hidden_from_verts(const struct MVert *mvert,
+ const struct MLoop *mloop,
+ struct MEdge *medge, int totedge,
+ struct MPoly *mpoly, int totpoly);
+
void unlink_mesh(struct Mesh *me);
void free_mesh(struct Mesh *me, int unlink);
struct Mesh *add_mesh(const char *name);
@@ -138,13 +145,13 @@ void free_dverts(struct MDeformVert *dvert, int totvert);
void copy_dverts(struct MDeformVert *dst, struct MDeformVert *src, int totvert); /* __NLA */
void mesh_delete_material_index(struct Mesh *me, short index);
void mesh_set_smooth_flag(struct Object *meshOb, int enableSmooth);
-void convert_mfaces_to_mpolys(struct Mesh *mesh);
+void BKE_mesh_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);
@@ -153,7 +160,8 @@ void mesh_get_texspace(struct Mesh *me, float r_loc[3], float r_rot[3], float r_
/* if old, it converts mface->edcode to edge drawflags */
void make_edges(struct Mesh *me, int old);
-void mesh_strip_loose_faces(struct Mesh *me);
+void mesh_strip_loose_faces(struct Mesh *me); /* Needed for compatibility (some old read code). */
+void mesh_strip_loose_polysloops(struct Mesh *me);
void mesh_strip_loose_edges(struct Mesh *me);
/* Calculate vertex and face normals, face normals are returned in *faceNors_r if non-NULL
@@ -198,7 +206,7 @@ typedef struct UvMapVert {
/* UvElement stores per uv information so that we can quickly access information for a uv.
* it is actually an improved UvMapVert, including an island and a direct pointer to the face
- * to avoid initialising face arrays */
+ * to avoid initializing face arrays */
typedef struct UvElement {
/* Next UvElement corresponding to same vertex */
struct UvElement *next;
@@ -243,13 +251,20 @@ UvMapVert *get_uv_map_vert(UvVertMap *vmap, unsigned int v);
void free_uv_vert_map(UvVertMap *vmap);
/* Connectivity data */
+typedef struct MeshElemMap {
+ int *indices;
+ int count;
+} MeshElemMap;
+
typedef struct IndexNode {
struct IndexNode *next, *prev;
int index;
} IndexNode;
-void create_vert_poly_map(struct ListBase **map, IndexNode **mem,
- struct MPoly *mface, struct MLoop *mloop,
- const int totvert, const int totface, const int totloop);
+
+void create_vert_poly_map(MeshElemMap **map, int **mem,
+ const struct MPoly *mface, const struct MLoop *mloop,
+ int totvert, int totface, int totloop);
+
void create_vert_edge_map(struct ListBase **map, IndexNode **mem, const struct MEdge *medge,
const int totvert, const int totedge);
@@ -261,11 +276,14 @@ int mesh_center_bounds(struct Mesh *me, float cent[3]);
void mesh_translate(struct Mesh *me, float offset[3], int do_keys);
/* mesh_validate.c */
+/* XXX Loop v/e are unsigned, so using max uint_32 value as invalid marker... */
+#define INVALID_LOOP_EDGE_MARKER 4294967295u
int BKE_mesh_validate_arrays(
- struct Mesh *me,
+ struct Mesh *me,
struct MVert *mverts, unsigned int totvert,
struct MEdge *medges, unsigned int totedge,
- struct MFace *mfaces, unsigned int totface,
+ struct MLoop *mloops, unsigned int totloop,
+ struct MPoly *mpolys, unsigned int totpoly,
struct MDeformVert *dverts, /* assume totvert length */
const short do_verbose, const short do_fixes);
int BKE_mesh_validate(struct Mesh *me, int do_verbose);
@@ -279,11 +297,11 @@ void BKE_mesh_tessface_calc(struct Mesh *mesh);
void BKE_mesh_tessface_ensure(struct Mesh *mesh);
void BKE_mesh_tessface_clear(struct Mesh *mesh);
-/*convert a triangle of loop facedata to mface facedata*/
+/* Convert a triangle or quadrangle of loop/poly data to tessface data */
void mesh_loops_to_mface_corners(struct CustomData *fdata, struct CustomData *ldata,
struct CustomData *pdata, int lindex[4], int findex,
const int polyindex, const int mf_len,
- const int numTex, const int numCol, const int hasWCol, const int hasOrigSpace);
+ const int numTex, const int numCol, const int hasPCol, const int hasOrigSpace);
#ifdef __cplusplus
}
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index de4f0a7eac6..b4320b7025a 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 */
@@ -101,7 +101,7 @@ typedef enum {
/* Some modifier can't be added manually by user */
eModifierTypeFlag_NoUserAdd = (1<<8),
- /* For modifiers that use CD_WEIGHT_MCOL for preview. */
+ /* For modifiers that use CD_PREVIEW_MCOL for preview. */
eModifierTypeFlag_UsesPreview = (1<<9)
} ModifierTypeFlag;
@@ -357,16 +357,21 @@ int modifiers_isPreview(struct Object *ob);
int modifiers_indexInObject(struct Object *ob, struct ModifierData *md);
+typedef struct CDMaskLink {
+ struct CDMaskLink *next;
+ CustomDataMask mask;
+} CDMaskLink;
+
/* Calculates and returns a linked list of CustomDataMasks indicating the
* data required by each modifier in the stack pointed to by md for correct
* evaluation, assuming the data indicated by dataMask is required at the
* end of the stack.
*/
-struct LinkNode *modifiers_calcDataMasks(struct Scene *scene,
- struct Object *ob,
- struct ModifierData *md,
- CustomDataMask dataMask,
- int required_mode);
+struct CDMaskLink *modifiers_calcDataMasks(struct Scene *scene,
+ struct Object *ob,
+ struct ModifierData *md,
+ CustomDataMask dataMask,
+ int required_mode);
struct ModifierData *modifiers_getLastPreview(struct Scene *scene,
struct ModifierData *md,
int required_mode);
diff --git a/source/blender/blenkernel/BKE_movieclip.h b/source/blender/blenkernel/BKE_movieclip.h
index 793ad4dca0e..d7b2f271a83 100644
--- a/source/blender/blenkernel/BKE_movieclip.h
+++ b/source/blender/blenkernel/BKE_movieclip.h
@@ -51,6 +51,7 @@ struct ImBuf *BKE_movieclip_get_postprocessed_ibuf(struct MovieClip *clip, struc
struct ImBuf *BKE_movieclip_get_stable_ibuf(struct MovieClip *clip, struct MovieClipUser *user, float loc[2], float *scale, float *angle, int postprocess_flag);
struct ImBuf *BKE_movieclip_get_ibuf_flag(struct MovieClip *clip, struct MovieClipUser *user, int flag, int cache_flag);
void BKE_movieclip_get_size(struct MovieClip *clip, struct MovieClipUser *user, int *width, int *height);
+int BKE_movieclip_get_duration(struct MovieClip *clip);
void BKE_movieclip_aspect(struct MovieClip *clip, float *aspx, float *aspy);
int BKE_movieclip_has_frame(struct MovieClip *clip, struct MovieClipUser *user);
void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr);
@@ -60,7 +61,7 @@ void BKE_movieclip_update_scopes(struct MovieClip *clip, struct MovieClipUser *u
void BKE_movieclip_get_cache_segments(struct MovieClip *clip, struct MovieClipUser *user, int *totseg_r, int **points_r);
void BKE_movieclip_build_proxy_frame(struct MovieClip *clip, int clip_flag, struct MovieDistortion *distortion,
- int cfra, int *build_sizes, int build_count, int undistorted);
+ int cfra, int *build_sizes, int build_count, int undistorted);
/* cacheing flags */
#define MOVIECLIP_CACHE_SKIP (1<<0)
diff --git a/source/blender/blenkernel/BKE_multires.h b/source/blender/blenkernel/BKE_multires.h
index b1fa375388a..69482706da6 100644
--- a/source/blender/blenkernel/BKE_multires.h
+++ b/source/blender/blenkernel/BKE_multires.h
@@ -32,26 +32,35 @@
* \ingroup bke
*/
+enum MultiresModifiedFlags;
struct DerivedMesh;
-struct Mesh;
+struct GridHidden;
+struct MDisps;
struct MFace;
+struct Mesh;
+struct ModifierData;
struct Multires;
struct MultiresModifierData;
-struct ModifierData;
struct Object;
struct Scene;
-struct MDisps;
-void multires_mark_as_modified(struct Object *ob);
+/* Delete mesh mdisps */
+void multires_customdata_delete(struct Mesh *me);
+
+void multires_mark_as_modified(struct Object *ob, enum MultiresModifiedFlags flags);
void multires_force_update(struct Object *ob);
void multires_force_render_update(struct Object *ob);
void multires_force_external_reload(struct Object *ob);
+/* internal, only called in subsurf_ccg.c */
+void multires_modifier_update_mdisps(struct DerivedMesh *dm);
+void multires_modifier_update_hidden(struct DerivedMesh *dm);
+
void multiresModifier_set_levels_from_disps(struct MultiresModifierData *mmd, struct Object *ob);
struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*,
- int local_mmd, struct DerivedMesh*, struct Object *, int, int);
+ int local_mmd, struct DerivedMesh*, struct Object *, int);
struct MultiresModifierData *find_multires_modifier_before(struct Scene *scene,
struct ModifierData *lastmd);
@@ -75,7 +84,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_node.h b/source/blender/blenkernel/BKE_node.h
index 753161d0788..cb161b26ee5 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -364,6 +364,7 @@ int nodeUpdateID(struct bNodeTree *ntree, struct ID *id);
void nodeFreePreview(struct bNode *node);
int nodeSocketIsHidden(struct bNodeSocket *sock);
+void nodeSocketSetType(struct bNodeSocket *sock, int type);
/* ************** NODE TYPE ACCESS *************** */
@@ -636,7 +637,7 @@ void ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMaterial *mat);
#define CMP_NODE_TRANSFORM 264
#define CMP_NODE_MOVIEDISTORTION 265
#define CMP_NODE_DOUBLEEDGEMASK 266
-#define CMP_NODE_OUTPUT_MULTI_FILE 267
+#define CMP_NODE_OUTPUT_MULTI_FILE__DEPRECATED 267 /* DEPRECATED multi file node has been merged into regular CMP_NODE_OUTPUT_FILE */
#define CMP_NODE_GLARE 301
#define CMP_NODE_TONEMAP 302
@@ -676,8 +677,9 @@ void ntreeCompositTagGenerators(struct bNodeTree *ntree);
void ntreeCompositForceHidden(struct bNodeTree *ntree, struct Scene *scene);
void ntreeCompositClearTags(struct bNodeTree *ntree);
-void ntreeCompositOutputMultiFileAddSocket(struct bNodeTree *ntree, struct bNode *node, struct ImageFormatData *im_format);
-int ntreeCompositOutputMultiFileRemoveActiveSocket(struct bNodeTree *ntree, struct bNode *node);
+struct bNodeSocket *ntreeCompositOutputFileAddSocket(struct bNodeTree *ntree, struct bNode *node,
+ const char *name, struct ImageFormatData *im_format);
+int ntreeCompositOutputFileRemoveActiveSocket(struct bNodeTree *ntree, struct bNode *node);
/* ************** TEXTURE NODES *************** */
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index 1e9bb85b549..971320765e9 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -67,6 +67,8 @@ void update_base_layer(struct Scene *scene, struct Object *ob);
void free_object(struct Object *ob);
void object_free_display(struct Object *ob);
+int object_support_modifier_type(struct Object *ob, int modifier_type);
+
void object_link_modifiers(struct Object *ob, struct Object *from);
void object_free_modifiers(struct Object *ob);
@@ -107,7 +109,7 @@ void object_boundbox_flag(struct Object *ob, int flag, int set);
void minmax_object(struct Object *ob, float min[3], float max[3]);
int minmax_object_duplis(struct Scene *scene, struct Object *ob, float min[3], float max[3]);
-/* sometimes min-max isnt enough, we need to loop over each point */
+/* sometimes min-max isn't enough, we need to loop over each point */
void BKE_object_foreach_display_point(
struct Object *ob, float obmat[4][4],
void (*func_cb)(const float[3], void *), void *user_data);
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 045e11c18b8..acf39d83370 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -33,6 +33,8 @@
*/
struct Brush;
+struct MDisps;
+struct MeshElemMap;
struct MFace;
struct MultireModifierData;
struct MVert;
@@ -61,6 +63,11 @@ void paint_brush_set(struct Paint *paint, struct Brush *br);
int paint_facesel_test(struct Object *ob);
int paint_vertsel_test(struct Object *ob);
+/* partial visibility */
+int paint_is_face_hidden(const struct MFace *f, const struct MVert *mvert);
+int paint_is_grid_face_hidden(const unsigned int *grid_hidden,
+ int gridsize, int x, int y);
+
/* Session data (mode-specific) */
typedef struct SculptSession {
@@ -74,7 +81,7 @@ typedef struct SculptSession {
struct KeyBlock *kb;
/* Mesh connectivity */
- struct ListBase *pmap;
+ const struct MeshElemMap *pmap;
/* PBVH acceleration structure */
struct PBVH *pbvh;
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_report.h b/source/blender/blenkernel/BKE_report.h
index fd372ae6d83..f6307806491 100644
--- a/source/blender/blenkernel/BKE_report.h
+++ b/source/blender/blenkernel/BKE_report.h
@@ -66,6 +66,8 @@ char *BKE_reports_string(ReportList *reports, ReportType level);
void BKE_reports_print(ReportList *reports, ReportType level);
Report *BKE_reports_last_displayable(ReportList *reports);
+
+int BKE_reports_contain(ReportList *reports, ReportType level);
#ifdef __cplusplus
}
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 d787993e030..7a84e71c763 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);
@@ -170,7 +176,7 @@ void give_ibuf_prefetch_request(SeqRenderData context, float cfra, int chan_show
int seqbase_recursive_apply(struct ListBase *seqbase, int (*apply_func)(struct Sequence *seq, void *), void *arg);
int seq_recursive_apply(struct Sequence *seq, int (*apply_func)(struct Sequence *, void *), void *arg);
-/* maintainance functions, mostly for RNA */
+/* maintenance functions, mostly for RNA */
// extern
void seq_free_sequence(struct Scene *scene, struct Sequence *seq);
void seq_free_sequence_recurse(struct Scene *scene, struct Sequence *seq);
@@ -181,7 +187,6 @@ struct Editing *seq_give_editing(struct Scene *scene, int alloc);
const char *give_seqname(struct Sequence *seq);
void calc_sequence(struct Scene *scene, struct Sequence *seq);
void calc_sequence_disp(struct Scene *scene, struct Sequence *seq);
-void new_tstripdata(struct Sequence *seq);
void reload_sequence_new_file(struct Scene *scene, struct Sequence * seq, int lock_range);
void sort_seq(struct Scene *scene);
void build_seqar_cb(struct ListBase *seqbase, struct Sequence ***seqar, int *totseq,
@@ -203,10 +208,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 +229,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 +254,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 +341,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_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h
index 446084053de..626dd64e21e 100644
--- a/source/blender/blenkernel/BKE_shrinkwrap.h
+++ b/source/blender/blenkernel/BKE_shrinkwrap.h
@@ -90,7 +90,7 @@ void space_transform_invert(const struct SpaceTransform *data, float *co);
* - Normal projection
*
* ShrinkwrapCalcData encapsulates all needed data for shrinkwrap functions.
- * (So that you dont have to pass an enormous amount of arguments to functions)
+ * (So that you don't have to pass an enormous amount of arguments to functions)
*/
struct Object;
diff --git a/source/blender/blenkernel/BKE_subsurf.h b/source/blender/blenkernel/BKE_subsurf.h
index 8f32063c243..7f9881926a6 100644
--- a/source/blender/blenkernel/BKE_subsurf.h
+++ b/source/blender/blenkernel/BKE_subsurf.h
@@ -31,12 +31,16 @@
* \ingroup bke
*/
+/* struct DerivedMesh is used directly */
+#include "BKE_DerivedMesh.h"
+
+struct DMFlagMat;
struct DMGridAdjacency;
struct DMGridData;
struct DerivedMesh;
-struct IndexNode;
-struct ListBase;
+struct MeshElemMap;
struct Mesh;
+struct MPoly;
struct MultiresSubsurf;
struct Object;
struct PBVH;
@@ -60,6 +64,26 @@ struct DerivedMesh *subsurf_make_derived_from_derived(
void subsurf_calculate_limit_positions(struct Mesh *me, float (*positions_r)[3]);
+/* get gridsize from 'level', level must be greater than zero */
+int ccg_gridsize(int level);
+
+/* x/y grid coordinates at 'low_level' can be multiplied by the result
+ of this function to convert to grid coordinates at 'high_level' */
+int ccg_factor(int low_level, int high_level);
+
+void subsurf_copy_grid_hidden(struct DerivedMesh *dm,
+ const struct MPoly *mpoly,
+ struct MVert *mvert,
+ const struct MDisps *mdisps);
+
+typedef enum MultiresModifiedFlags {
+ /* indicates the grids have been sculpted on, so MDisps
+ have to be updated */
+ MULTIRES_COORDS_MODIFIED = 1,
+ /* indicates elements have been hidden or unhidden */
+ MULTIRES_HIDDEN_MODIFIED = 2
+} MultiresModifiedFlags;
+
/**************************** Internal *****************************/
typedef struct CCGDerivedMesh {
@@ -75,21 +99,21 @@ typedef struct CCGDerivedMesh {
int startFace; struct CCGFace *face;} *faceMap;
short *edgeFlags;
- char *faceFlags;
+ struct DMFlagMat *faceFlags;
int *reverseFaceMap;
struct PBVH *pbvh;
- struct ListBase *fmap;
- struct IndexNode *fmap_mem;
- struct ListBase *pmap;
- struct IndexNode *pmap_mem;
+ struct MeshElemMap *pmap;
+ int *pmap_mem;
struct DMGridData **gridData;
struct DMGridAdjacency *gridAdjacency;
int *gridOffset;
struct CCGFace **gridFaces;
+ struct DMFlagMat *gridFlagMats;
+ unsigned int **gridHidden;
struct {
struct MultiresModifierData *mmd;
@@ -99,9 +123,7 @@ typedef struct CCGDerivedMesh {
float (*orco)[3];
struct Object *ob;
- int modified;
-
- void (*update)(DerivedMesh*);
+ MultiresModifiedFlags modified_flags;
} multires;
struct EdgeHash *ehash;
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 cc3f2870711..d9d2c21e2b3 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 tesselation, 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 tesselations 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;
@@ -62,7 +61,7 @@ typedef struct BMEditMesh {
int lastDataMask;
/* index tables, to map indices to elements via
- * EDBM_init_index_arrays and associated functions. don't
+ * EDBM_index_arrays_init and associated functions. don't
* touch this or read it directly.*/
struct BMVert **vert_index;
struct BMEdge **edge_index;
@@ -81,13 +80,10 @@ typedef struct BMEditMesh {
int mirr_free_arrays;
} BMEditMesh;
-/* undo triggers editmesh tessface update, this is odd but works OK.
- * BMESH_TODO, look into having the update elsewhere. */
-#define BMESH_EM_UNDO_RECALC_TESSFACE_WORKAROUND
-
-void BMEdit_RecalcTesselation(BMEditMesh *tm);
-BMEditMesh *BMEdit_Create(BMesh *bm, int do_tesselate);
+void BMEdit_RecalcTessellation(BMEditMesh *tm);
+BMEditMesh *BMEdit_Create(BMesh *bm, int do_tessellate);
BMEditMesh *BMEdit_Copy(BMEditMesh *tm);
+BMEditMesh *BMEdit_FromObject(struct Object *ob);
void BMEdit_Free(BMEditMesh *em);
void BMEdit_UpdateLinkedCustomData(BMEditMesh *em);
diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h
index f1daa5d63b3..2bb8fc691f0 100644
--- a/source/blender/blenkernel/BKE_tracking.h
+++ b/source/blender/blenkernel/BKE_tracking.h
@@ -52,9 +52,9 @@ void BKE_tracking_clamp_track(struct MovieTrackingTrack *track, int event);
void BKE_tracking_track_flag(struct MovieTrackingTrack *track, int area, int flag, int clear);
struct MovieTrackingTrack *BKE_tracking_add_track(struct MovieTracking *tracking, struct ListBase *tracksbase,
- float x, float y, int framenr, int width, int height);
+ float x, float y, int framenr, int width, int height);
struct MovieTrackingMarker *BKE_tracking_insert_marker(struct MovieTrackingTrack *track,
- struct MovieTrackingMarker *marker);
+ struct MovieTrackingMarker *marker);
void BKE_tracking_delete_marker(struct MovieTrackingTrack *track, int framenr);
struct MovieTrackingMarker *BKE_tracking_get_marker(struct MovieTrackingTrack *track, int framenr);
@@ -67,14 +67,15 @@ void BKE_tracking_free_track(struct MovieTrackingTrack *track);
void BKE_tracking_clear_path(struct MovieTrackingTrack *track, int ref_frame, int action);
-int BKE_tracking_test_join_tracks(struct MovieTrackingTrack *dst_track, struct MovieTrackingTrack *src_track);
void BKE_tracking_join_tracks(struct MovieTrackingTrack *dst_track, struct MovieTrackingTrack *src_track);
void BKE_tracking_free(struct MovieTracking *tracking);
struct ImBuf *BKE_tracking_get_pattern_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track,
- struct MovieTrackingMarker *marker, int margin, int anchored, float pos[2], int origin[2]);
+ struct MovieTrackingMarker *marker, int margin, int anchored,
+ float pos[2], int origin[2]);
struct ImBuf *BKE_tracking_get_search_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track,
- struct MovieTrackingMarker *marker, int margin, int anchored, float pos[2], int origin[2]);
+ struct MovieTrackingMarker *marker, int margin, int anchored,
+ float pos[2], int origin[2]);
void BKE_track_unique_name(struct ListBase *tracksbase, struct MovieTrackingTrack *track);
@@ -86,7 +87,7 @@ void BKE_tracking_camera_to_blender(struct MovieTracking *tracking, struct Scene
void BKE_get_tracking_mat(struct Scene *scene, struct Object *ob, float mat[4][4]);
void BKE_tracking_projection_matrix(struct MovieTracking *tracking, struct MovieTrackingObject *object,
- int framenr, int winx, int winy, float mat[4][4]);
+ int framenr, int winx, int winy, float mat[4][4]);
struct ListBase *BKE_tracking_get_tracks(struct MovieTracking *tracking);
struct MovieTrackingReconstruction *BKE_tracking_get_reconstruction(struct MovieTracking *tracking);
@@ -96,7 +97,7 @@ struct MovieTrackingObject *BKE_tracking_active_object(struct MovieTracking *tra
struct MovieTrackingObject *BKE_tracking_get_camera_object(struct MovieTracking *tracking);
struct ListBase *BKE_tracking_object_tracks(struct MovieTracking *tracking, struct MovieTrackingObject *object);
struct MovieTrackingReconstruction *BKE_tracking_object_reconstruction(struct MovieTracking *tracking,
- struct MovieTrackingObject *object);
+ struct MovieTrackingObject *object);
void BKE_tracking_disable_imbuf_channels(struct ImBuf *ibuf, int disable_red, int disable_green, int disable_blue, int grayscale);
@@ -116,24 +117,24 @@ int BKE_tracking_next(struct MovieTrackingContext *context);
/* Camera solving */
int BKE_tracking_can_reconstruct(struct MovieTracking *tracking, struct MovieTrackingObject *object,
- char *error_msg, int error_size);
+ char *error_msg, int error_size);
struct MovieReconstructContext* BKE_tracking_reconstruction_context_new(struct MovieTracking *tracking,
struct MovieTrackingObject *object, int keyframe1, int keyframe2, int width, int height);
void BKE_tracking_reconstruction_context_free(struct MovieReconstructContext *context);
-void BKE_tracking_solve_reconstruction(struct MovieReconstructContext *context,
- short *stop, short *do_update, float *progress, char *stats_message, int message_size);
+void BKE_tracking_solve_reconstruction(struct MovieReconstructContext *context, short *stop, short *do_update,
+ float *progress, char *stats_message, int message_size);
int BKE_tracking_finish_reconstruction(struct MovieReconstructContext *context, struct MovieTracking *tracking);
struct MovieReconstructedCamera *BKE_tracking_get_reconstructed_camera(struct MovieTracking *tracking,
struct MovieTrackingObject *object, int framenr);
-void BKE_tracking_get_interpolated_camera(struct MovieTracking *tracking,
- struct MovieTrackingObject *object, int framenr, float mat[4][4]);
+void BKE_tracking_get_interpolated_camera(struct MovieTracking *tracking, struct MovieTrackingObject *object,
+ int framenr, float mat[4][4]);
/* Feature detection */
void BKE_tracking_detect_fast(struct MovieTracking *tracking, struct ListBase *tracksbase, struct ImBuf *imbuf,
- int framenr, int margin, int min_trackness, int min_distance, struct bGPDlayer *layer,
- int place_outside_layer);
+ int framenr, int margin, int min_trackness, int min_distance, struct bGPDlayer *layer,
+ int place_outside_layer);
/* 2D stabilization */
void BKE_tracking_stabilization_data(struct MovieTracking *tracking, int framenr, int width, int height, float loc[2], float *scale, float *angle);
@@ -147,7 +148,7 @@ void BKE_tracking_invert_intrinsics(struct MovieTracking *tracking, float co[2],
struct MovieDistortion *BKE_tracking_distortion_create(void);
struct MovieDistortion *BKE_tracking_distortion_copy(struct MovieDistortion *distortion);
struct ImBuf *BKE_tracking_distortion_exec(struct MovieDistortion *distortion, struct MovieTracking *tracking,
- struct ImBuf *ibuf, int width, int height, float overscan, int undistort);
+ struct ImBuf *ibuf, int width, int height, float overscan, int undistort);
void BKE_tracking_distortion_destroy(struct MovieDistortion *distortion);
struct ImBuf *BKE_tracking_undistort(struct MovieTracking *tracking, struct ImBuf *ibuf, int width, int height, float overscan);
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 38946a465b6..c2a83b5c048 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -23,7 +23,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-set(INC
+set(INC
.
../avi
../blenfont
@@ -38,15 +38,11 @@ set(INC
../modifiers
../nodes
../render/extern/include
- ../../../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
../windowmanager
@@ -85,8 +81,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
@@ -114,8 +110,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
@@ -144,7 +140,6 @@ set(SRC
intern/unit.c
intern/world.c
intern/writeavi.c
- intern/writeffmpeg.c
intern/writeframeserver.c
BKE_DerivedMesh.h
@@ -200,8 +195,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
@@ -230,11 +225,10 @@ set(SRC
BKE_utildefines.h
BKE_world.h
BKE_writeavi.h
- BKE_writeffmpeg.h
BKE_writeframeserver.h
depsgraph_private.h
- intern/CCGSubSurf.h
nla_private.h
+ intern/CCGSubSurf.h
)
add_definitions(-DGLEW_STATIC)
@@ -299,6 +293,10 @@ if(WITH_CODEC_QUICKTIME)
endif()
if(WITH_CODEC_FFMPEG)
+ list(APPEND SRC
+ intern/writeffmpeg.c
+ BKE_writeffmpeg.h
+ )
list(APPEND INC
../../../intern/ffmpeg
)
@@ -331,10 +329,16 @@ if(WITH_OPENMP)
endif()
if(WITH_MOD_FLUID)
+ list(APPEND INC
+ ../../../intern/elbeem/extern
+ )
add_definitions(-DWITH_MOD_FLUID)
endif()
if(WITH_MOD_SMOKE)
+ list(APPEND INC
+ ../../../intern/smoke/extern
+ )
add_definitions(-DWITH_SMOKE)
endif()
@@ -342,6 +346,18 @@ if(WITH_MOD_OCEANSIM)
add_definitions(-DWITH_OCEANSIM)
endif()
+if(WITH_MOD_DECIMATE)
+ list(APPEND INC
+ ../../../intern/decimation/extern
+ )
+endif()
+
+if(WITH_MOD_BOOLEAN)
+ list(APPEND INC
+ ../../../intern/bsp/extern
+ )
+endif()
+
if(WITH_JACK)
add_definitions(-DWITH_JACK)
endif()
@@ -386,6 +402,10 @@ if(WITH_FFTW3)
add_definitions(-DFFTW3=1)
endif()
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
## Warnings as errors, this is too strict!
#if(MSVC)
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index d949f0c73db..684c3d8683b 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -108,6 +108,9 @@ if env['WITH_BF_FFTW3']:
defs.append('FFTW3=1')
incs += ' ' + env['BF_FFTW3_INC']
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c
index f843d21a975..f0075217102 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@ -8,6 +8,7 @@
#include <math.h>
#include "CCGSubSurf.h"
+#include "BKE_subsurf.h"
#include "MEM_guardedalloc.h"
#include "BLO_sys_types.h" // for intptr_t support
@@ -227,7 +228,7 @@ static CCGAllocatorIFC *_getStandardAllocatorIFC(void)
/***/
-static int ccg_gridsize(int level)
+int ccg_gridsize(int level)
{
BLI_assert(level > 0);
BLI_assert(level <= 31);
@@ -235,6 +236,14 @@ static int ccg_gridsize(int level)
return (1 << (level - 1)) + 1;
}
+int ccg_factor(int low_level, int high_level)
+{
+ BLI_assert(low_level > 0 && high_level > 0);
+ BLI_assert(low_level <= high_level);
+
+ return 1 << (high_level - low_level);
+}
+
static int ccg_edgesize(int level)
{
BLI_assert(level > 0);
@@ -732,7 +741,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 +1428,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 +1486,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 +2477,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 +2643,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 +2866,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 +2889,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 +2898,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 16dd722f1fc..65ef4e5b431 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -51,6 +51,8 @@
#include "BLI_utildefines.h"
#include "BLI_linklist.h"
+#include "BLF_translation.h"
+
#include "BKE_cdderivedmesh.h"
#include "BKE_displist.h"
#include "BKE_key.h"
@@ -65,6 +67,7 @@
#include "BKE_tessmesh.h"
#include "BKE_bvhutils.h"
#include "BKE_deform.h"
+#include "BKE_global.h" /* For debug flag, DM_update_tessface_data() func. */
#ifdef WITH_GAMEENGINE
#include "BKE_navmesh_conversion.h"
@@ -80,8 +83,6 @@ static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm);
#include "GPU_extensions.h"
#include "GPU_material.h"
-extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */
-
static void add_shapekey_layers(DerivedMesh *dm, Mesh *me, Object *ob);
static void shapekey_layers_to_keyblocks(DerivedMesh *dm, Mesh *me, int actshape_uid);
@@ -121,8 +122,17 @@ static MFace *dm_getTessFaceArray(DerivedMesh *dm)
MFace *mface = CustomData_get_layer(&dm->faceData, CD_MFACE);
if (!mface) {
- mface = CustomData_add_layer(&dm->faceData, CD_MFACE, CD_CALLOC, NULL,
- dm->getNumTessFaces(dm));
+ int numTessFaces = dm->getNumTessFaces(dm);
+
+ if (!numTessFaces) {
+ /* Do not add layer if there's no elements in it, this leads to issues later when
+ * this layer is needed with non-zero size, but currently CD stuff does not check
+ * for requested layer size on creation and just returns layer which was previously
+ * added (sergey) */
+ return NULL;
+ }
+
+ mface = CustomData_add_layer(&dm->faceData, CD_MFACE, CD_CALLOC, NULL, numTessFaces);
CustomData_set_layer_flag(&dm->faceData, CD_MFACE, CD_FLAG_TEMPORARY);
dm->copyTessFaceArray(dm, mface);
}
@@ -163,7 +173,7 @@ static MVert *dm_dupVertArray(DerivedMesh *dm)
MVert *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumVerts(dm),
"dm_dupVertArray tmp");
- if(tmp) dm->copyVertArray(dm, tmp);
+ if (tmp) dm->copyVertArray(dm, tmp);
return tmp;
}
@@ -173,7 +183,7 @@ static MEdge *dm_dupEdgeArray(DerivedMesh *dm)
MEdge *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumEdges(dm),
"dm_dupEdgeArray tmp");
- if(tmp) dm->copyEdgeArray(dm, tmp);
+ if (tmp) dm->copyEdgeArray(dm, tmp);
return tmp;
}
@@ -183,7 +193,7 @@ static MFace *dm_dupFaceArray(DerivedMesh *dm)
MFace *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumTessFaces(dm),
"dm_dupFaceArray tmp");
- if(tmp) dm->copyTessFaceArray(dm, tmp);
+ if (tmp) dm->copyTessFaceArray(dm, tmp);
return tmp;
}
@@ -193,7 +203,7 @@ static MLoop *dm_dupLoopArray(DerivedMesh *dm)
MLoop *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumLoops(dm),
"dm_dupLoopArray tmp");
- if(tmp) dm->copyLoopArray(dm, tmp);
+ if (tmp) dm->copyLoopArray(dm, tmp);
return tmp;
}
@@ -203,7 +213,7 @@ static MPoly *dm_dupPolyArray(DerivedMesh *dm)
MPoly *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumPolys(dm),
"dm_dupPolyArray tmp");
- if(tmp) dm->copyPolyArray(dm, tmp);
+ if (tmp) dm->copyPolyArray(dm, tmp);
return tmp;
}
@@ -277,6 +287,7 @@ void DM_init(DerivedMesh *dm, DerivedMeshType type, int numVerts, int numEdges,
dm->needsFree = 1;
dm->auto_bump_scale = -1.0f;
+ dm->dirty = 0;
}
void DM_from_template(DerivedMesh *dm, DerivedMesh *source, DerivedMeshType type,
@@ -304,6 +315,7 @@ void DM_from_template(DerivedMesh *dm, DerivedMesh *source, DerivedMeshType type
DM_init_funcs(dm);
dm->needsFree = 1;
+ dm->dirty = 0;
}
int DM_release(DerivedMesh *dm)
@@ -360,7 +372,7 @@ void DM_ensure_tessface(DerivedMesh *dm)
const int numPolys = dm->getNumPolys(dm);
if ( (numTessFaces == 0) && (numPolys != 0)) {
- dm->recalcTesselation(dm);
+ dm->recalcTessellation(dm);
if (dm->getNumTessFaces(dm) != 0) {
/* printf("info %s: polys -> ngons calculated\n", __func__); */
@@ -370,6 +382,80 @@ void DM_ensure_tessface(DerivedMesh *dm)
__func__, numPolys, dm->type);
}
}
+
+ else if (dm->dirty && DM_DIRTY_TESS_CDLAYERS) {
+ BLI_assert(CustomData_has_layer(&dm->faceData, CD_POLYINDEX));
+ DM_update_tessface_data(dm);
+ }
+
+ dm->dirty &= ~DM_DIRTY_TESS_CDLAYERS;
+}
+
+/* Update tessface CD data from loop/poly ones. Needed when not retessellating after modstack evaluation. */
+/* NOTE: Assumes dm has valid tessellated data! */
+void DM_update_tessface_data(DerivedMesh *dm)
+{
+ MFace *mf = dm->getTessFaceArray(dm);
+ MPoly *mp = dm->getPolyArray(dm);
+ MLoop *ml = dm->getLoopArray(dm);
+
+ CustomData *fdata = dm->getTessFaceDataLayout(dm);
+ CustomData *pdata = dm->getPolyDataLayout(dm);
+ CustomData *ldata = dm->getLoopDataLayout(dm);
+
+ const int numTex = CustomData_number_of_layers(pdata, CD_MTEXPOLY);
+ const int numCol = CustomData_number_of_layers(ldata, CD_MLOOPCOL);
+ const int hasPCol = CustomData_has_layer(ldata, CD_PREVIEW_MLOOPCOL);
+ const int hasOrigSpace = CustomData_has_layer(ldata, CD_ORIGSPACE_MLOOP);
+
+ int *polyindex = CustomData_get_layer(fdata, CD_POLYINDEX);
+
+ int mf_idx,
+ totface = dm->getNumTessFaces(dm),
+ ml_idx[4];
+
+ /* Should never occure, but better abort than segfault! */
+ if (!polyindex)
+ return;
+
+ CustomData_from_bmeshpoly(fdata, pdata, ldata, totface);
+
+ for (mf_idx = 0; mf_idx < totface; mf_idx++, mf++) {
+ const int mf_len = mf->v4 ? 4 : 3;
+ int i, not_done;
+
+ /* Find out loop indices. */
+ /* XXX Is there a better way to do this? */
+ /* NOTE: This assumes tessface are valid and in sync with loop/poly… Else, most likely, segfault! */
+ for (i = mp[polyindex[mf_idx]].loopstart, not_done = mf_len; not_done; i++) {
+ MLoop *tml = &ml[i];
+ if (tml->v == mf->v1) {
+ ml_idx[0] = i;
+ not_done--;
+ }
+ else if (tml->v == mf->v2) {
+ ml_idx[1] = i;
+ not_done--;
+ }
+ else if (tml->v == mf->v3) {
+ ml_idx[2] = i;
+ not_done--;
+ }
+ else if (mf_len == 4 && tml->v == mf->v4) {
+ ml_idx[3] = i;
+ not_done--;
+ }
+ }
+ mesh_loops_to_mface_corners(fdata, ldata, pdata,
+ ml_idx, mf_idx, polyindex[mf_idx],
+ mf_len,
+ numTex, numCol, hasPCol, hasOrigSpace);
+ }
+
+ if (G.debug & G_DEBUG)
+ printf("Updated tessellated customdata of dm %p\n", dm);
+
+ dm->dirty &= ~DM_DIRTY_TESS_CDLAYERS;
}
void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
@@ -421,12 +507,12 @@ 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 */
- if(!CustomData_has_layer(&tmp.vdata, CD_MVERT))
+ * 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))
+ if (!CustomData_has_layer(&tmp.edata, CD_MEDGE))
CustomData_add_layer(&tmp.edata, CD_MEDGE, CD_ASSIGN, dm->dupEdgeArray(dm), totedge);
- if(!CustomData_has_layer(&tmp.pdata, CD_MPOLY)) {
+ if (!CustomData_has_layer(&tmp.pdata, CD_MPOLY)) {
tmp.mloop = dm->dupLoopArray(dm);
tmp.mpoly = dm->dupPolyArray(dm);
@@ -436,14 +522,14 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
/* object had got displacement layer, should copy this layer to save sculpted data */
/* NOTE: maybe some other layers should be copied? nazgul */
- if(CustomData_has_layer(&me->ldata, CD_MDISPS)) {
+ if (CustomData_has_layer(&me->ldata, CD_MDISPS)) {
if (totloop == me->totloop) {
MDisps *mdisps = CustomData_get_layer(&me->ldata, CD_MDISPS);
CustomData_add_layer(&tmp.ldata, CD_MDISPS, CD_DUPLICATE, mdisps, totloop);
}
}
- /* yes, must be before _and_ after tesselate */
+ /* yes, must be before _and_ after tessellate */
mesh_update_customdata_pointers(&tmp, TRUE);
BKE_mesh_tessface_calc(&tmp);
@@ -454,12 +540,12 @@ 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*/
- if(tmp.totvert != me->totvert && !did_shapekeys && me->key) {
+ /* 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--;
+ if (tmp.key) tmp.key->id.us--;
tmp.key = NULL;
}
@@ -472,16 +558,16 @@ void DM_to_meshkey(DerivedMesh *dm, Mesh *me, KeyBlock *kb)
float *fp;
MVert *mvert;
- if(totvert==0 || me->totvert==0 || me->totvert!=totvert) return;
+ if (totvert==0 || me->totvert==0 || me->totvert!=totvert) return;
- if(kb->data) MEM_freeN(kb->data);
+ if (kb->data) MEM_freeN(kb->data);
kb->data= MEM_callocN(me->key->elemsize*me->totvert, "kb->data");
kb->totelem= totvert;
fp= kb->data;
mvert=dm->getVertDataArray(dm, CD_MVERT);
- for(a=0; a<kb->totelem; a++, fp+=3, mvert++) {
+ for (a=0; a<kb->totelem; a++, fp+=3, mvert++) {
copy_v3_v3(fp, mvert->co);
}
}
@@ -535,7 +621,7 @@ void *DM_get_tessface_data(DerivedMesh *dm, int index, int type)
void *DM_get_vert_data_layer(DerivedMesh *dm, int type)
{
- if(type == CD_MVERT)
+ if (type == CD_MVERT)
return dm->getVertArray(dm);
return CustomData_get_layer(&dm->vertData, type);
@@ -543,7 +629,7 @@ void *DM_get_vert_data_layer(DerivedMesh *dm, int type)
void *DM_get_edge_data_layer(DerivedMesh *dm, int type)
{
- if(type == CD_MEDGE)
+ if (type == CD_MEDGE)
return dm->getEdgeArray(dm);
return CustomData_get_layer(&dm->edgeData, type);
@@ -694,7 +780,7 @@ DerivedMesh *mesh_create_derived(Mesh *me, Object *ob, float (*vertCos)[3])
{
DerivedMesh *dm = CDDM_from_mesh(me, ob);
- if(!dm)
+ if (!dm)
return NULL;
if (vertCos)
@@ -735,7 +821,8 @@ DerivedMesh *mesh_create_derived_for_modifier(Scene *scene, Object *ob,
add_shapekey_layers(dm, me, ob);
MEM_freeN(deformedVerts);
- } else {
+ }
+ else {
DerivedMesh *tdm = mesh_create_derived(me, ob, NULL);
if (build_shapekey_layers)
@@ -743,7 +830,7 @@ DerivedMesh *mesh_create_derived_for_modifier(Scene *scene, Object *ob,
dm = mti->applyModifier(md, ob, tdm, 0, 0);
- if(tdm != dm) tdm->release(tdm);
+ if (tdm != dm) tdm->release(tdm);
}
return dm;
@@ -776,23 +863,23 @@ static void *get_orco_coords_dm(Object *ob, BMEditMesh *em, int layer, int *free
{
*free= 0;
- if(layer == CD_ORCO) {
+ if (layer == CD_ORCO) {
/* get original coordinates */
*free= 1;
- if(em)
+ if (em)
return (float(*)[3])get_editbmesh_orco_verts(em);
else
return (float(*)[3])get_mesh_orco_verts(ob);
}
- else if(layer == CD_CLOTH_ORCO) {
+ 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 */
- if(!em) {
+ * 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);
- if(kb->data)
+ if (kb->data)
return kb->data;
}
@@ -808,14 +895,14 @@ static DerivedMesh *create_orco_dm(Object *ob, Mesh *me, BMEditMesh *em, int lay
float (*orco)[3];
int free;
- if(em) dm= CDDM_from_BMEditMesh(em, me, FALSE, FALSE);
+ if (em) dm= CDDM_from_BMEditMesh(em, me, FALSE, FALSE);
else dm= CDDM_from_mesh(me, ob);
orco= get_orco_coords_dm(ob, em, layer, &free);
- if(orco) {
+ if (orco) {
CDDM_apply_vert_coords(dm, orco);
- if(free) MEM_freeN(orco);
+ if (free) MEM_freeN(orco);
}
CDDM_calc_normals(dm);
@@ -831,11 +918,11 @@ static void add_orco_dm(Object *ob, BMEditMesh *em, DerivedMesh *dm,
totvert= dm->getNumVerts(dm);
- if(orcodm) {
+ if (orcodm) {
orco= MEM_callocN(sizeof(float)*3*totvert, "dm orco");
free= 1;
- if(orcodm->getNumVerts(orcodm) == totvert)
+ if (orcodm->getNumVerts(orcodm) == totvert)
orcodm->getVertCos(orcodm, orco);
else
dm->getVertCos(dm, orco);
@@ -843,17 +930,17 @@ static void add_orco_dm(Object *ob, BMEditMesh *em, DerivedMesh *dm,
else
orco= get_orco_coords_dm(ob, em, layer, &free);
- if(orco) {
- if(layer == CD_ORCO)
+ if (orco) {
+ if (layer == CD_ORCO)
transform_mesh_orco_verts(ob->data, orco, totvert, 0);
- if(!(layerorco = DM_get_vert_data_layer(dm, layer))) {
+ if (!(layerorco = DM_get_vert_data_layer(dm, layer))) {
DM_add_vert_layer(dm, layer, CD_CALLOC, NULL);
layerorco = DM_get_vert_data_layer(dm, layer);
}
memcpy(layerorco, orco, sizeof(float)*3*totvert);
- if(free) MEM_freeN(orco);
+ if (free) MEM_freeN(orco);
}
}
@@ -908,13 +995,19 @@ static void weightpaint_color(unsigned char r_col[4], ColorBand *coba, const flo
{
float colf[4];
- if(coba) do_colorband(coba, input, colf);
- else weight_to_rgb(colf, input);
+ if (coba) {
+ do_colorband(coba, input, colf);
+ }
+ else {
+ weight_to_rgb(colf, input);
+ }
- r_col[3] = (unsigned char)(colf[0] * 255.0f);
- r_col[2] = (unsigned char)(colf[1] * 255.0f);
- r_col[1] = (unsigned char)(colf[2] * 255.0f);
- r_col[0] = 255;
+ /* don't use rgb_float_to_uchar() here because
+ * the resulting float doesn't need 0-1 clamp check */
+ r_col[0] = (unsigned char)(colf[0] * 255.0f);
+ r_col[1] = (unsigned char)(colf[1] * 255.0f);
+ r_col[2] = (unsigned char)(colf[2] * 255.0f);
+ r_col[3] = 255;
}
@@ -1039,30 +1132,34 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
unsigned char *wtcol_v;
#if 0 /* See coment below. */
- unsigned char *wtcol_f = dm->getTessFaceDataArray(dm, CD_WEIGHT_MCOL);
+ unsigned char *wtcol_f = dm->getTessFaceDataArray(dm, CD_PREVIEW_MCOL);
#endif
- unsigned char(*wtcol_l)[4] = CustomData_get_layer(dm->getLoopDataLayout(dm), CD_WEIGHT_MLOOPCOL);
+ unsigned char(*wtcol_l)[4] = CustomData_get_layer(dm->getLoopDataLayout(dm), CD_PREVIEW_MLOOPCOL);
#if 0 /* See coment below. */
MFace *mf = dm->getTessFaceArray(dm);
#endif
MLoop *mloop = dm->getLoopArray(dm), *ml;
MPoly *mp = dm->getPolyArray(dm);
+#if 0
int numFaces = dm->getNumTessFaces(dm);
+#endif
int numVerts = dm->getNumVerts(dm);
int totloop;
int i, j;
#if 0 /* See comment below */
- /* If no CD_WEIGHT_MCOL existed yet, add a new one! */
+ /* If no CD_PREVIEW_MCOL existed yet, add a new one! */
if (!wtcol_f)
- wtcol_f = CustomData_add_layer(&dm->faceData, CD_WEIGHT_MCOL, CD_CALLOC, NULL, numFaces);
+ wtcol_f = CustomData_add_layer(&dm->faceData, CD_PREVIEW_MCOL, CD_CALLOC, NULL, numFaces);
if (wtcol_f) {
unsigned char *wtcol_f_step = wtcol_f;
# else
- /* XXX We have to create a CD_WEIGHT_MCOL, else it might sigsev (after a SubSurf mod, eg)... */
- if(!dm->getTessFaceDataArray(dm, CD_WEIGHT_MCOL))
- CustomData_add_layer(&dm->faceData, CD_WEIGHT_MCOL, CD_CALLOC, NULL, numFaces);
+#if 0
+ /* XXX We have to create a CD_PREVIEW_MCOL, else it might sigsev (after a SubSurf mod, eg)... */
+ if (!dm->getTessFaceDataArray(dm, CD_PREVIEW_MCOL))
+ CustomData_add_layer(&dm->faceData, CD_PREVIEW_MCOL, CD_CALLOC, NULL, numFaces);
+#endif
{
#endif
@@ -1072,17 +1169,17 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
float *w = weights;
/* If indices is not NULL, it means we do not have weights for all vertices,
* so we must create them (and set them to zero)... */
- if(indices) {
+ if (indices) {
w = MEM_callocN(sizeof(float)*numVerts, "Temp weight array DM_update_weight_mcol");
i = num;
- while(i--)
+ while (i--)
w[indices[i]] = weights[i];
}
/* Convert float weights to colors. */
wtcol_v = calc_colors_from_weights_array(numVerts, w);
- if(indices)
+ if (indices)
MEM_freeN(w);
}
@@ -1091,9 +1188,9 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
wtcol_v = calc_weightpaint_vert_array(ob, dm, draw_flag, coba);
/* Now copy colors in all face verts. */
- /*first add colors to the tesselation faces*/
+ /*first add colors to the tessellation faces*/
/* XXX Why update that layer? We have to update WEIGHT_MLOOPCOL anyway,
- * and tesselation recreates mface layers from mloop/mpoly ones, so no
+ * and tessellation recreates mface layers from mloop/mpoly ones, so no
* need to fill WEIGHT_MCOL here. */
#if 0
for (i = 0; i < numFaces; i++, mf++, wtcol_f_step += (4 * 4)) {
@@ -1119,7 +1216,7 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
}
#endif
/*now add to loops, so the data can be passed through the modifier stack*/
- /* If no CD_WEIGHT_MLOOPCOL existed yet, we have to add a new one! */
+ /* If no CD_PREVIEW_MLOOPCOL existed yet, we have to add a new one! */
if (!wtcol_l) {
BLI_array_declare(wtcol_l);
totloop = 0;
@@ -1132,7 +1229,7 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
(char *)&wtcol_v[4 * ml->v]);
}
}
- CustomData_add_layer(&dm->loopData, CD_WEIGHT_MLOOPCOL, CD_ASSIGN, wtcol_l, totloop);
+ CustomData_add_layer(&dm->loopData, CD_PREVIEW_MLOOPCOL, CD_ASSIGN, wtcol_l, totloop);
}
else {
totloop = 0;
@@ -1147,6 +1244,8 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
}
MEM_freeN(wtcol_v);
}
+
+ dm->dirty |= DM_DIRTY_TESS_CDLAYERS;
}
@@ -1186,7 +1285,8 @@ static void shapekey_layers_to_keyblocks(DerivedMesh *dm, Mesh *me, int actshape
for (j=0; j<dm->numVertData; j++, kbcos++, mvert++) {
copy_v3_v3(*kbcos, mvert->co);
}
- } else {
+ }
+ else {
for (j=0; j<kb->totelem; j++, cos++, kbcos++) {
copy_v3_v3(*kbcos, *cos);
}
@@ -1258,8 +1358,9 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
{
Mesh *me = ob->data;
ModifierData *firstmd, *md, *previewmd = NULL;
- LinkNode *datamasks, *curr;
- CustomDataMask mask, nextmask, append_mask = 0;
+ CDMaskLink *datamasks, *curr;
+ /* XXX Always copying POLYINDEX, else tessellated data are no more valid! */
+ CustomDataMask mask, nextmask, append_mask = CD_MASK_POLYINDEX;
float (*deformedVerts)[3] = NULL;
DerivedMesh *dm=NULL, *orcodm, *clothorcodm, *finaldm;
int numVerts = me->totvert;
@@ -1278,20 +1379,20 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
const int do_final_wmcol = (scene->toolsettings->weights_preview == WP_WPREVIEW_FINAL) && do_wmcol;
#endif
const int do_final_wmcol = FALSE;
- int do_init_wmcol = ((dataMask & CD_MASK_WEIGHT_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT) && !do_final_wmcol);
+ int do_init_wmcol = ((dataMask & CD_MASK_PREVIEW_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT) && !do_final_wmcol);
/* XXX Same as above... For now, only weights preview in WPaint mode. */
const int do_mod_wmcol = do_init_wmcol;
- if(mmd && !mmd->sculptlvl)
+ if (mmd && !mmd->sculptlvl)
has_multires = 0;
- if(!skipVirtualArmature) {
+ if (!skipVirtualArmature) {
firstmd = modifiers_getVirtualModifierList(ob);
}
else {
/* game engine exception */
firstmd = ob->modifiers.first;
- if(firstmd && firstmd->type == eModifierType_Armature)
+ if (firstmd && firstmd->type == eModifierType_Armature)
firstmd = firstmd->next;
}
@@ -1299,13 +1400,13 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
modifiers_clearErrors(ob);
- if(useRenderParams) required_mode = eModifierMode_Render;
+ if (useRenderParams) required_mode = eModifierMode_Render;
else required_mode = eModifierMode_Realtime;
datamasks = modifiers_calcDataMasks(scene, ob, md, dataMask, required_mode);
curr = datamasks;
- if(do_mod_wmcol || do_mod_mcol) {
+ if (do_mod_wmcol || do_mod_mcol) {
/* Find the last active modifier generating a preview, or NULL if none. */
/* XXX Currently, DPaint modifier just ignores this.
* Needs a stupid hack...
@@ -1313,33 +1414,34 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
previewmd = modifiers_getLastPreview(scene, md, required_mode);
}
- if(deform_r) *deform_r = NULL;
+ if (deform_r) *deform_r = NULL;
*final_r = NULL;
- if(useDeform) {
- if(inputVertexCos)
+ if (useDeform) {
+ if (inputVertexCos)
deformedVerts = inputVertexCos;
/* Apply all leading deforming modifiers */
- for(;md; md = md->next, curr = curr->next) {
+ for (;md; md = md->next, curr = curr->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
md->scene= scene;
- if(!modifier_isEnabled(scene, md, required_mode)) continue;
- if(useDeform < 0 && mti->dependsOnTime && mti->dependsOnTime(md)) continue;
+ if (!modifier_isEnabled(scene, md, required_mode)) continue;
+ if (useDeform < 0 && mti->dependsOnTime && mti->dependsOnTime(md)) continue;
- if(mti->type == eModifierTypeType_OnlyDeform) {
- if(!deformedVerts)
+ if (mti->type == eModifierTypeType_OnlyDeform) {
+ if (!deformedVerts)
deformedVerts = mesh_getVertexCos(me, &numVerts);
mti->deformVerts(md, ob, NULL, deformedVerts, numVerts, useRenderParams, useDeform);
- } else {
+ }
+ else {
break;
}
/* grab modifiers until index i */
- if((index >= 0) && (modifiers_indexInObject(ob, md) >= index))
+ if ((index >= 0) && (modifiers_indexInObject(ob, md) >= index))
break;
}
@@ -1353,14 +1455,15 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
if (build_shapekey_layers)
add_shapekey_layers(dm, me, ob);
- if(deformedVerts) {
+ if (deformedVerts) {
CDDM_apply_vert_coords(*deform_r, deformedVerts);
CDDM_calc_normals(*deform_r);
}
}
- } else {
- /* default behaviour for meshes */
- if(inputVertexCos)
+ }
+ else {
+ /* default behavior for meshes */
+ if (inputVertexCos)
deformedVerts = inputVertexCos;
else
deformedVerts = mesh_getVertexCos(me, &numVerts);
@@ -1374,41 +1477,41 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
orcodm = NULL;
clothorcodm = NULL;
- for(;md; md = md->next, curr = curr->next) {
+ for (;md; md = md->next, curr = curr->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
md->scene= scene;
- if(!modifier_isEnabled(scene, md, required_mode)) continue;
- if(mti->type == eModifierTypeType_OnlyDeform && !useDeform) continue;
- if((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) {
- modifier_setError(md, "Modifier requires original data, bad stack position.");
+ if (!modifier_isEnabled(scene, md, required_mode)) continue;
+ if (mti->type == eModifierTypeType_OnlyDeform && !useDeform) continue;
+ if ((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) {
+ modifier_setError(md, "%s", TIP_("Modifier requires original data, bad stack position."));
continue;
}
- if(sculpt_mode && (!has_multires || multires_applied)) {
+ if (sculpt_mode && (!has_multires || multires_applied)) {
int unsupported= 0;
- if(scene->toolsettings->sculpt->flags & SCULPT_ONLY_DEFORM)
+ if (scene->toolsettings->sculpt->flags & SCULPT_ONLY_DEFORM)
unsupported|= mti->type != eModifierTypeType_OnlyDeform;
unsupported|= md->type == eModifierType_Multires && ((MultiresModifierData*)md)->sculptlvl==0;
unsupported|= multires_applied;
- if(unsupported) {
- modifier_setError(md, "Not supported in sculpt mode.");
+ if (unsupported) {
+ modifier_setError(md, "%s", TIP_("Not supported in sculpt mode."));
continue;
}
}
- if(needMapping && !modifier_supportsMapping(md)) continue;
- if(useDeform < 0 && mti->dependsOnTime && mti->dependsOnTime(md)) continue;
+ if (needMapping && !modifier_supportsMapping(md)) continue;
+ if (useDeform < 0 && mti->dependsOnTime && mti->dependsOnTime(md)) continue;
/* add an orco layer if needed by this modifier */
- if(mti->requiredDataMask)
+ if (mti->requiredDataMask)
mask = mti->requiredDataMask(ob, md);
else
mask = 0;
- if(dm && (mask & CD_MASK_ORCO))
+ if (dm && (mask & CD_MASK_ORCO))
add_orco_dm(ob, NULL, dm, orcodm, CD_ORCO);
/* How to apply modifier depends on (a) what we already have as
@@ -1416,10 +1519,10 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
* deformed vertices) and (b) what type the modifier is.
*/
- if(mti->type == eModifierTypeType_OnlyDeform) {
+ if (mti->type == eModifierTypeType_OnlyDeform) {
/* No existing verts to deform, need to build them. */
- if(!deformedVerts) {
- if(dm) {
+ if (!deformedVerts) {
+ if (dm) {
/* Deforming a derived mesh, read the vertex locations
* out of the mesh and deform them. Once done with this
* run of deformers verts will be written back.
@@ -1428,34 +1531,36 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
deformedVerts =
MEM_mallocN(sizeof(*deformedVerts) * numVerts, "dfmv");
dm->getVertCos(dm, deformedVerts);
- } else {
+ }
+ else {
deformedVerts = mesh_getVertexCos(me, &numVerts);
}
}
/* if this is not the last modifier in the stack then recalculate the normals
* to avoid giving bogus normals to the next modifier see: [#23673] */
- if(isPrevDeform && mti->dependsOnNormals && mti->dependsOnNormals(md)) {
+ if (isPrevDeform && mti->dependsOnNormals && mti->dependsOnNormals(md)) {
/* XXX, this covers bug #23673, but we may need normal calc for other types */
- if(dm && dm->type == DM_TYPE_CDDM) {
+ if (dm && dm->type == DM_TYPE_CDDM) {
CDDM_apply_vert_coords(dm, deformedVerts);
CDDM_calc_normals(dm);
}
}
mti->deformVerts(md, ob, dm, deformedVerts, numVerts, useRenderParams, useDeform);
- } else {
+ }
+ else {
DerivedMesh *ndm;
/* determine which data layers are needed by following modifiers */
- if(curr->next)
- nextmask= (CustomDataMask)GET_INT_FROM_POINTER(curr->next->link);
+ if (curr->next)
+ nextmask= curr->next->mask;
else
nextmask= dataMask;
/* apply vertex coordinates or build a DerivedMesh as necessary */
- if(dm) {
- if(deformedVerts) {
+ if (dm) {
+ if (deformedVerts) {
DerivedMesh *tdm = CDDM_copy(dm);
dm->release(dm);
dm = tdm;
@@ -1463,18 +1568,19 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
CDDM_apply_vert_coords(dm, deformedVerts);
CDDM_calc_normals(dm);
}
- } else {
+ }
+ else {
dm = CDDM_from_mesh(me, ob);
if (build_shapekey_layers)
add_shapekey_layers(dm, me, ob);
- if(deformedVerts) {
+ if (deformedVerts) {
CDDM_apply_vert_coords(dm, deformedVerts);
CDDM_calc_normals(dm);
}
- if(do_init_wmcol)
+ if (do_init_wmcol)
DM_update_weight_mcol(ob, dm, draw_flag, NULL, 0, NULL);
/* Constructive modifiers need to have an origindex
@@ -1484,7 +1590,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
* requests it, this way Mirror, Solidify etc will keep ORIGINDEX
* data by using generic DM_copy_vert_data() functions.
*/
- if(needMapping || (nextmask & CD_MASK_ORIGINDEX)) {
+ if (needMapping || (nextmask & CD_MASK_ORIGINDEX)) {
/* calc */
DM_add_vert_layer(dm, CD_ORIGINDEX, CD_CALLOC, NULL);
DM_add_edge_layer(dm, CD_ORIGINDEX, CD_CALLOC, NULL);
@@ -1498,19 +1604,19 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
/* set the DerivedMesh to only copy needed data */
- mask= (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
+ mask= curr->mask;
/* needMapping check here fixes bug [#28112], otherwise its
* possible that it wont be copied */
mask |= append_mask;
DM_set_only_copy(dm, mask | (needMapping ? CD_MASK_ORIGINDEX : 0));
/* add cloth rest shape key if need */
- if(mask & CD_MASK_CLOTH_ORCO)
+ if (mask & CD_MASK_CLOTH_ORCO)
add_orco_dm(ob, NULL, dm, clothorcodm, CD_CLOTH_ORCO);
/* add an origspace layer if needed */
- if(((CustomDataMask)GET_INT_FROM_POINTER(curr->link)) & CD_MASK_ORIGSPACE_MLOOP) {
- if(!CustomData_has_layer(&dm->loopData, CD_ORIGSPACE_MLOOP)) {
+ if ((curr->mask) & CD_MASK_ORIGSPACE_MLOOP) {
+ if (!CustomData_has_layer(&dm->loopData, CD_ORIGSPACE_MLOOP)) {
DM_add_loop_layer(dm, CD_ORIGSPACE_MLOOP, CD_CALLOC, NULL);
DM_init_origspace(dm);
}
@@ -1518,48 +1624,48 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
ndm = mti->applyModifier(md, ob, dm, useRenderParams, useCache);
- if(ndm) {
+ if (ndm) {
/* if the modifier returned a new dm, release the old one */
- if(dm && dm != ndm) dm->release(dm);
+ if (dm && dm != ndm) dm->release(dm);
dm = ndm;
- if(deformedVerts) {
- if(deformedVerts != inputVertexCos)
+ if (deformedVerts) {
+ if (deformedVerts != inputVertexCos)
MEM_freeN(deformedVerts);
deformedVerts = NULL;
}
- }
+ }
/* create an orco derivedmesh in parallel */
- if(nextmask & CD_MASK_ORCO) {
- if(!orcodm)
+ if (nextmask & CD_MASK_ORCO) {
+ if (!orcodm)
orcodm= create_orco_dm(ob, me, NULL, CD_ORCO);
nextmask &= ~CD_MASK_ORCO;
DM_set_only_copy(orcodm, nextmask | CD_MASK_ORIGINDEX);
ndm = mti->applyModifier(md, ob, orcodm, useRenderParams, 0);
- if(ndm) {
+ if (ndm) {
/* if the modifier returned a new dm, release the old one */
- if(orcodm && orcodm != ndm) orcodm->release(orcodm);
+ if (orcodm && orcodm != ndm) orcodm->release(orcodm);
orcodm = ndm;
}
}
/* create cloth orco derivedmesh in parallel */
- if(nextmask & CD_MASK_CLOTH_ORCO) {
- if(!clothorcodm)
+ if (nextmask & CD_MASK_CLOTH_ORCO) {
+ if (!clothorcodm)
clothorcodm= create_orco_dm(ob, me, NULL, CD_CLOTH_ORCO);
nextmask &= ~CD_MASK_CLOTH_ORCO;
DM_set_only_copy(clothorcodm, nextmask | CD_MASK_ORIGINDEX);
ndm = mti->applyModifier(md, ob, clothorcodm, useRenderParams, 0);
- if(ndm) {
+ if (ndm) {
/* if the modifier returned a new dm, release the old one */
- if(clothorcodm && clothorcodm != ndm) clothorcodm->release(clothorcodm);
+ if (clothorcodm && clothorcodm != ndm) clothorcodm->release(clothorcodm);
clothorcodm = ndm;
}
}
@@ -1567,32 +1673,32 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
/* in case of dynamic paint, make sure preview mask remains for following modifiers */
/* XXX Temp and hackish solution! */
if (md->type == eModifierType_DynamicPaint)
- append_mask |= CD_MASK_WEIGHT_MCOL;
+ append_mask |= CD_MASK_PREVIEW_MLOOPCOL;
/* In case of active preview modifier, make sure preview mask remains for following modifiers. */
else if ((md == previewmd) && (do_mod_wmcol)) {
DM_update_weight_mcol(ob, dm, draw_flag, NULL, 0, NULL);
- append_mask |= CD_MASK_WEIGHT_MCOL;
+ append_mask |= CD_MASK_PREVIEW_MLOOPCOL;
}
}
isPrevDeform= (mti->type == eModifierTypeType_OnlyDeform);
/* grab modifiers until index i */
- if((index >= 0) && (modifiers_indexInObject(ob, md) >= index))
+ if ((index >= 0) && (modifiers_indexInObject(ob, md) >= index))
break;
- if(sculpt_mode && md->type == eModifierType_Multires)
+ if (sculpt_mode && md->type == eModifierType_Multires)
multires_applied = 1;
}
- for(md=firstmd; md; md=md->next)
+ for (md=firstmd; md; md=md->next)
modifier_freeTemporaryData(md);
/* Yay, we are done. If we have a DerivedMesh and deformed vertices
* need to apply these back onto the DerivedMesh. If we have no
* DerivedMesh then we need to build one.
*/
- if(dm && deformedVerts) {
+ if (dm && deformedVerts) {
finaldm = CDDM_copy(dm);
dm->release(dm);
@@ -1601,47 +1707,49 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
CDDM_calc_normals(finaldm);
#if 0 /* For later nice mod preview! */
- /* In case we need modified weights in CD_WEIGHT_MCOL, we have to re-compute it. */
- if(do_final_wmcol)
+ /* In case we need modified weights in CD_PREVIEW_MCOL, we have to re-compute it. */
+ if (do_final_wmcol)
DM_update_weight_mcol(ob, finaldm, draw_flag, NULL, 0, NULL);
#endif
- } else if(dm) {
+ }
+ else if (dm) {
finaldm = dm;
#if 0 /* For later nice mod preview! */
- /* In case we need modified weights in CD_WEIGHT_MCOL, we have to re-compute it. */
- if(do_final_wmcol)
+ /* In case we need modified weights in CD_PREVIEW_MCOL, we have to re-compute it. */
+ if (do_final_wmcol)
DM_update_weight_mcol(ob, finaldm, draw_flag, NULL, 0, NULL);
#endif
- } else {
+ }
+ else {
int recalc_normals= 0;
finaldm = CDDM_from_mesh(me, ob);
- if(build_shapekey_layers) {
+ if (build_shapekey_layers) {
add_shapekey_layers(finaldm, me, ob);
recalc_normals= 1;
}
- if(deformedVerts) {
+ if (deformedVerts) {
CDDM_apply_vert_coords(finaldm, deformedVerts);
recalc_normals= 1;
}
- if(recalc_normals) {
+ if (recalc_normals) {
CDDM_calc_normals(finaldm);
}
/* In this case, we should never have weight-modifying modifiers in stack... */
- if(do_init_wmcol)
+ if (do_init_wmcol)
DM_update_weight_mcol(ob, finaldm, draw_flag, NULL, 0, NULL);
}
/* add an orco layer if needed */
- if(dataMask & CD_MASK_ORCO) {
+ if (dataMask & CD_MASK_ORCO) {
add_orco_dm(ob, NULL, finaldm, orcodm, CD_ORCO);
- if(deform_r && *deform_r)
+ if (deform_r && *deform_r)
add_orco_dm(ob, NULL, *deform_r, NULL, CD_ORCO);
}
@@ -1659,9 +1767,11 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
{
/* calculating normals can re-calculate tessfaces in some cases */
+#if 0
int num_tessface = finaldm->getNumTessFaces(finaldm);
+#endif
/* --------------------------------------------------------------------- */
- /* First calculate the polygon and vertex normals, re-tesselation
+ /* First calculate the polygon and vertex normals, re-tessellation
* copies these into the tessface's normal layer */
@@ -1673,31 +1783,54 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
finaldm->calcNormals(finaldm);
#endif
- /* Re-tesselation is necessary to push render data (uvs, textures, colors)
+ /* Re-tessellation is necessary to push render data (uvs, textures, colors)
* from loops and polys onto the tessfaces. This may be currently be
- * redundantin cases where the render mode doesn't use these inputs, but
- * ideally eventually tesselation would happen on-demand, and this is one
+ * redundant in cases where the render mode doesn't use these inputs, but
+ * ideally eventually tessellation would happen on-demand, and this is one
* of the primary places it would be needed. */
- if (num_tessface == 0 && finaldm->getNumTessFaces(finaldm) == 0) {
- finaldm->recalcTesselation(finaldm);
+#if 0
+ if (num_tessface == 0 && finaldm->getNumTessFaces(finaldm) == 0)
+#else
+ if (finaldm->getNumTessFaces(finaldm) == 0) /* || !CustomData_has_layer(&finaldm->faceData, CD_POLYINDEX)) */
+#endif
+ {
+ finaldm->recalcTessellation(finaldm);
+ }
+ /* Even if tessellation is not needed, some modifiers migh have modified CD layers
+ * (like mloopcol or mloopuv), hence we have to update those. */
+ else if (finaldm->dirty & DM_DIRTY_TESS_CDLAYERS) {
+ /* A tessellation already exists, it should always have a CD_POLYINDEX. */
+ BLI_assert(CustomData_has_layer(&finaldm->faceData, CD_POLYINDEX));
+ DM_update_tessface_data(finaldm);
}
/* Need to watch this, it can cause issues, see bug [#29338] */
/* take care with this block, we really need testing frameworks */
/* --------------------------------------------------------------------- */
- }
+ /* without this, drawing ngon tri's faces will show ugly tessellated face
+ * normals and will also have to calculate normals on the fly, try avoid
+ * this where possible since calculating polygon normals isn't fast,
+ * note that this isn't a problem for subsurf (only quads) or editmode
+ * which deals with drawing differently.
+ *
+ * Never calc vertex normals because other code ensures these are up to date.
+ */
+ if ((finaldm->type == DM_TYPE_CDDM) && (CustomData_has_layer(&finaldm->faceData, CD_NORMAL) == FALSE)) {
+ CDDM_calc_normals_mapping_ex(finaldm, TRUE);
+ }
+ }
*final_r = finaldm;
- if(orcodm)
+ if (orcodm)
orcodm->release(orcodm);
- if(clothorcodm)
+ if (clothorcodm)
clothorcodm->release(clothorcodm);
- if(deformedVerts && deformedVerts != inputVertexCos)
+ if (deformedVerts && deformedVerts != inputVertexCos)
MEM_freeN(deformedVerts);
- BLI_linklist_free(datamasks, NULL);
+ BLI_linklist_free((LinkNode*)datamasks, NULL);
}
float (*editbmesh_get_vertex_cos(BMEditMesh *em, int *numVerts_r))[3]
@@ -1722,9 +1855,9 @@ int editbmesh_modifier_is_enabled(Scene *scene, ModifierData *md, DerivedMesh *d
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
int required_mode = eModifierMode_Realtime | eModifierMode_Editmode;
- if(!modifier_isEnabled(scene, md, required_mode)) return 0;
- if((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) {
- modifier_setError(md, "Modifier requires original data, bad stack position.");
+ if (!modifier_isEnabled(scene, md, required_mode)) return 0;
+ if ((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) {
+ modifier_setError(md, "%s", TIP_("Modifier requires original data, bad stack position."));
return 0;
}
@@ -1740,12 +1873,12 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
CustomDataMask mask;
DerivedMesh *dm, *orcodm = NULL;
int i, numVerts = 0, cageIndex = modifiers_getCageIndex(scene, ob, NULL, 1);
- LinkNode *datamasks, *curr;
+ CDMaskLink *datamasks, *curr;
int required_mode = eModifierMode_Realtime | eModifierMode_Editmode;
modifiers_clearErrors(ob);
- if(cage_r && cageIndex == -1) {
+ if (cage_r && cageIndex == -1) {
*cage_r = getEditDerivedBMesh(em, ob, NULL);
}
@@ -1755,18 +1888,18 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
datamasks = modifiers_calcDataMasks(scene, ob, md, dataMask, required_mode);
curr = datamasks;
- for(i = 0; md; i++, md = md->next, curr = curr->next) {
+ for (i = 0; md; i++, md = md->next, curr = curr->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
md->scene= scene;
- if(!editbmesh_modifier_is_enabled(scene, md, dm))
+ if (!editbmesh_modifier_is_enabled(scene, md, dm))
continue;
/* add an orco layer if needed by this modifier */
- if(dm && mti->requiredDataMask) {
+ if (dm && mti->requiredDataMask) {
mask = mti->requiredDataMask(ob, md);
- if(mask & CD_MASK_ORCO)
+ if (mask & CD_MASK_ORCO)
add_orco_dm(ob, em, dm, orcodm, CD_ORCO);
}
@@ -1775,10 +1908,10 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
* deformed vertices) and (b) what type the modifier is.
*/
- if(mti->type == eModifierTypeType_OnlyDeform) {
+ if (mti->type == eModifierTypeType_OnlyDeform) {
/* No existing verts to deform, need to build them. */
- if(!deformedVerts) {
- if(dm) {
+ if (!deformedVerts) {
+ if (dm) {
/* Deforming a derived mesh, read the vertex locations
* out of the mesh and deform them. Once done with this
* run of deformers verts will be written back.
@@ -1787,7 +1920,8 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
deformedVerts =
MEM_mallocN(sizeof(*deformedVerts) * numVerts, "dfmv");
dm->getVertCos(dm, deformedVerts);
- } else {
+ }
+ else {
deformedVerts = editbmesh_get_vertex_cos(em, &numVerts);
}
}
@@ -1795,37 +1929,40 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
if (mti->deformVertsEM)
mti->deformVertsEM(md, ob, em, dm, deformedVerts, numVerts);
else mti->deformVerts(md, ob, dm, deformedVerts, numVerts, 0, 0);
- } else {
+ }
+ else {
DerivedMesh *ndm;
/* apply vertex coordinates or build a DerivedMesh as necessary */
- if(dm) {
- if(deformedVerts) {
+ if (dm) {
+ if (deformedVerts) {
DerivedMesh *tdm = CDDM_copy(dm);
- if(!(cage_r && dm == *cage_r)) dm->release(dm);
+ if (!(cage_r && dm == *cage_r)) dm->release(dm);
dm = tdm;
CDDM_apply_vert_coords(dm, deformedVerts);
CDDM_calc_normals(dm);
- } else if(cage_r && dm == *cage_r) {
+ }
+ else if (cage_r && dm == *cage_r) {
/* dm may be changed by this modifier, so we need to copy it
*/
dm = CDDM_copy(dm);
}
- } else {
+ }
+ else {
dm = CDDM_from_BMEditMesh(em, ob->data, FALSE, FALSE);
- if(deformedVerts) {
+ if (deformedVerts) {
CDDM_apply_vert_coords(dm, deformedVerts);
CDDM_calc_normals(dm);
}
}
/* create an orco derivedmesh in parallel */
- mask= (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
- if(mask & CD_MASK_ORCO) {
- if(!orcodm)
+ mask= curr->mask;
+ if (mask & CD_MASK_ORCO) {
+ if (!orcodm)
orcodm= create_orco_dm(ob, ob->data, em, CD_ORCO);
mask &= ~CD_MASK_ORCO;
@@ -1836,20 +1973,20 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
else
ndm = mti->applyModifier(md, ob, orcodm, 0, 0);
- if(ndm) {
+ if (ndm) {
/* if the modifier returned a new dm, release the old one */
- if(orcodm && orcodm != ndm) orcodm->release(orcodm);
+ if (orcodm && orcodm != ndm) orcodm->release(orcodm);
orcodm = ndm;
}
}
/* set the DerivedMesh to only copy needed data */
- mask= (CustomDataMask)GET_INT_FROM_POINTER(curr->link); /* CD_MASK_ORCO may have been cleared above */
+ mask= curr->mask; /* CD_MASK_ORCO may have been cleared above */
DM_set_only_copy(dm, mask | CD_MASK_ORIGINDEX);
- if(mask & CD_MASK_ORIGSPACE_MLOOP) {
- if(!CustomData_has_layer(&dm->loopData, CD_ORIGSPACE_MLOOP)) {
+ if (mask & CD_MASK_ORIGSPACE_MLOOP) {
+ if (!CustomData_has_layer(&dm->loopData, CD_ORIGSPACE_MLOOP)) {
DM_add_loop_layer(dm, CD_ORIGSPACE_MLOOP, CD_CALLOC, NULL);
DM_init_origspace(dm);
}
@@ -1861,7 +1998,7 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
ndm = mti->applyModifier(md, ob, dm, 0, 0);
if (ndm) {
- if(dm && dm != ndm)
+ if (dm && dm != ndm)
dm->release(dm);
dm = ndm;
@@ -1873,13 +2010,15 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
}
}
- if(cage_r && i == cageIndex) {
- if(dm && deformedVerts) {
+ if (cage_r && i == cageIndex) {
+ if (dm && deformedVerts) {
*cage_r = CDDM_copy(dm);
CDDM_apply_vert_coords(*cage_r, deformedVerts);
- } else if(dm) {
+ }
+ else if (dm) {
*cage_r = dm;
- } else {
+ }
+ else {
*cage_r =
getEditDerivedBMesh(em, ob,
deformedVerts ? MEM_dupallocN(deformedVerts) : NULL);
@@ -1887,16 +2026,16 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
}
}
- BLI_linklist_free(datamasks, NULL);
+ BLI_linklist_free((LinkNode*)datamasks, NULL);
/* Yay, we are done. If we have a DerivedMesh and deformed vertices need
* to apply these back onto the DerivedMesh. If we have no DerivedMesh
* then we need to build one.
*/
- if(dm && deformedVerts) {
+ if (dm && deformedVerts) {
*final_r = CDDM_copy(dm);
- if(!(cage_r && dm == *cage_r)) dm->release(dm);
+ if (!(cage_r && dm == *cage_r)) dm->release(dm);
CDDM_apply_vert_coords(*final_r, deformedVerts);
CDDM_calc_normals(*final_r); /* was CDDM_calc_normals_mapping - campbell */
@@ -1918,8 +2057,8 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
/* --- */
/* BMESH_ONLY, ensure tessface's used for drawing,
- * but dont recalculate if the last modifier in the stack gives us tessfaces
- * check if the derived meshes are DM_TYPE_EDITBMESH before calling, this isnt essential
+ * but don't recalculate if the last modifier in the stack gives us tessfaces
+ * check if the derived meshes are DM_TYPE_EDITBMESH before calling, this isn't essential
* but quiets annoying error messages since tessfaces wont be created. */
if ((*final_r)->type != DM_TYPE_EDITBMESH) {
DM_ensure_tessface(*final_r);
@@ -1934,13 +2073,13 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
/* --- */
/* add an orco layer if needed */
- if(dataMask & CD_MASK_ORCO)
+ if (dataMask & CD_MASK_ORCO)
add_orco_dm(ob, em, *final_r, orcodm, CD_ORCO);
- if(orcodm)
+ if (orcodm)
orcodm->release(orcodm);
- if(deformedVerts)
+ if (deformedVerts)
MEM_freeN(deformedVerts);
}
@@ -1971,7 +2110,7 @@ static void clear_mesh_caches(Object *ob)
ob->derivedDeform= NULL;
}
- if(ob->sculpt) {
+ if (ob->sculpt) {
object_sculpt_modifiers_changed(ob);
}
}
@@ -1995,6 +2134,12 @@ static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask,
ob->derivedFinal->needsFree = 0;
ob->derivedDeform->needsFree = 0;
ob->lastDataMask = dataMask;
+
+ if ((ob->mode & OB_MODE_SCULPT) && ob->sculpt) {
+ /* create PBVH immediately (would be created on the fly too,
+ but this avoids waiting on first stroke) */
+ ob->sculpt->pbvh= ob->derivedFinal->getPBVH(ob, ob->derivedFinal);
+ }
}
static void editbmesh_build_data(Scene *scene, Object *obedit, BMEditMesh *em, CustomDataMask dataMask)
@@ -2027,7 +2172,8 @@ void makeDerivedMesh(Scene *scene, Object *ob, BMEditMesh *em,
{
if (em) {
editbmesh_build_data(scene, ob, em, dataMask);
- } else {
+ }
+ else {
mesh_build_data(scene, ob, dataMask, build_shapekey_layers);
}
}
@@ -2039,7 +2185,7 @@ DerivedMesh *mesh_get_derived_final(Scene *scene, Object *ob, CustomDataMask dat
/* if there's no derived mesh or the last data mask used doesn't include
* the data we need, rebuild the derived mesh
*/
- if(!ob->derivedFinal || (dataMask & ob->lastDataMask) != dataMask)
+ if (!ob->derivedFinal || (dataMask & ob->lastDataMask) != dataMask)
mesh_build_data(scene, ob, dataMask, 0);
return ob->derivedFinal;
@@ -2050,7 +2196,7 @@ DerivedMesh *mesh_get_derived_deform(Scene *scene, Object *ob, CustomDataMask da
/* if there's no derived mesh or the last data mask used doesn't include
* the data we need, rebuild the derived mesh
*/
- if(!ob->derivedDeform || (dataMask & ob->lastDataMask) != dataMask)
+ if (!ob->derivedDeform || (dataMask & ob->lastDataMask) != dataMask)
mesh_build_data(scene, ob, dataMask, 0);
return ob->derivedDeform;
@@ -2132,7 +2278,7 @@ DerivedMesh *editbmesh_get_derived_cage_and_final(Scene *scene, Object *obedit,
/* if there's no derived mesh or the last data mask used doesn't include
* the data we need, rebuild the derived mesh
*/
- if(!em->derivedCage ||
+ if (!em->derivedCage ||
(em->lastDataMask & dataMask) != dataMask)
editbmesh_build_data(scene, obedit, em, dataMask);
@@ -2145,7 +2291,7 @@ DerivedMesh *editbmesh_get_derived_cage(Scene *scene, Object *obedit, BMEditMesh
/* if there's no derived mesh or the last data mask used doesn't include
* the data we need, rebuild the derived mesh
*/
- if(!em->derivedCage ||
+ if (!em->derivedCage ||
(em->lastDataMask & dataMask) != dataMask)
editbmesh_build_data(scene, obedit, em, dataMask);
@@ -2167,11 +2313,11 @@ static void make_vertexcosnos__mapFunc(void *userData, int index, float *co, flo
vec+= 6*index;
/* check if we've been here before (normal should not be 0) */
- if(vec[3] || vec[4] || vec[5]) return;
+ if (vec[3] || vec[4] || vec[5]) return;
copy_v3_v3(vec, co);
vec+= 3;
- if(no_f) {
+ if (no_f) {
copy_v3_v3(vec, no_f);
}
else {
@@ -2191,20 +2337,20 @@ float *mesh_get_mapped_verts_nors(Scene *scene, Object *ob)
float *vertexcosnos;
/* lets prevent crashing... */
- if(ob->type!=OB_MESH || me->totvert==0)
+ if (ob->type!=OB_MESH || me->totvert==0)
return NULL;
dm= mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH|CD_MASK_ORIGINDEX);
vertexcosnos= MEM_callocN(6*sizeof(float)*me->totvert, "vertexcosnos map");
- if(dm->foreachMappedVert) {
+ if (dm->foreachMappedVert) {
dm->foreachMappedVert(dm, make_vertexcosnos__mapFunc, vertexcosnos);
}
else {
float *fp= vertexcosnos;
int a;
- for(a=0; a< me->totvert; a++, fp+=6) {
+ for (a=0; a< me->totvert; a++, fp+=6) {
dm->getVertCo(dm, a, fp);
dm->getVertNo(dm, a, fp+3);
}
@@ -2256,7 +2402,7 @@ static void GetTextureCoordinate(const SMikkTSpaceContext * pContext, float fUV[
//assert(vert_index>=0 && vert_index<4);
SGLSLMeshToTangent * pMesh = (SGLSLMeshToTangent *) pContext->m_pUserData;
- if(pMesh->mtface!=NULL) {
+ if (pMesh->mtface!=NULL) {
float * uv = pMesh->mtface[face_num].uv[vert_index];
fUV[0]=uv[0]; fUV[1]=uv[1];
}
@@ -2272,8 +2418,8 @@ static void GetNormal(const SMikkTSpaceContext * pContext, float fNorm[], const
SGLSLMeshToTangent * pMesh = (SGLSLMeshToTangent *) pContext->m_pUserData;
const int smoothnormal = (pMesh->mface[face_num].flag & ME_SMOOTH);
- if(!smoothnormal) { // flat
- if(pMesh->precomputedFaceNormals) {
+ if (!smoothnormal) { // flat
+ if (pMesh->precomputedFaceNormals) {
copy_v3_v3(fNorm, &pMesh->precomputedFaceNormals[3*face_num]);
}
else {
@@ -2282,7 +2428,7 @@ static void GetNormal(const SMikkTSpaceContext * pContext, float fNorm[], const
float *p1= pMesh->mvert[mf->v2].co;
float *p2= pMesh->mvert[mf->v3].co;
- if(mf->v4) {
+ if (mf->v4) {
float *p3 = pMesh->mvert[mf->v4].co;
normal_quad_v3(fNorm, p0, p1, p2, p3);
}
@@ -2320,7 +2466,7 @@ void DM_add_tangent_layer(DerivedMesh *dm)
int i, j, len, mf_vi[4], totvert, totface, iCalcNewMethod;
float *nors;
- if(CustomData_get_layer_index(&dm->faceData, CD_TANGENT) != -1)
+ if (CustomData_get_layer_index(&dm->faceData, CD_TANGENT) != -1)
return;
nors = dm->getTessFaceDataArray(dm, CD_NORMAL);
@@ -2333,9 +2479,9 @@ void DM_add_tangent_layer(DerivedMesh *dm)
mface= dm->getTessFaceArray(dm);
mtface= dm->getTessFaceDataArray(dm, CD_MTFACE);
- if(!mtface) {
+ if (!mtface) {
orco= dm->getVertDataArray(dm, CD_ORCO);
- if(!orco)
+ if (!orco)
return;
}
@@ -2350,7 +2496,7 @@ void DM_add_tangent_layer(DerivedMesh *dm)
// new computation method
iCalcNewMethod = 1;
- if(iCalcNewMethod != 0) {
+ if (iCalcNewMethod != 0) {
SGLSLMeshToTangent mesh2tangent= {0};
SMikkTSpaceContext sContext= {0};
SMikkTSpaceInterface sInterface= {0};
@@ -2376,9 +2522,9 @@ void DM_add_tangent_layer(DerivedMesh *dm)
iCalcNewMethod = genTangSpaceDefault(&sContext);
}
- if(!iCalcNewMethod) {
+ if (!iCalcNewMethod) {
/* sum tangents at connected vertices */
- for(i=0, tf=mtface, mf=mface; i < totface; mf++, tf++, i++) {
+ for (i=0, tf=mtface, mf=mface; i < totface; mf++, tf++, i++) {
v1= &mvert[mf->v1];
v2= &mvert[mf->v2];
v3= &mvert[mf->v3];
@@ -2392,7 +2538,7 @@ void DM_add_tangent_layer(DerivedMesh *dm)
normal_tri_v3( fno,v3->co, v2->co, v1->co);
}
- if(mtface) {
+ if (mtface) {
uv1= tf->uv[0];
uv2= tf->uv[1];
uv3= tf->uv[2];
@@ -2403,7 +2549,7 @@ void DM_add_tangent_layer(DerivedMesh *dm)
map_to_sphere( &uv[0][0], &uv[0][1],orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]);
map_to_sphere( &uv[1][0], &uv[1][1],orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]);
map_to_sphere( &uv[2][0], &uv[2][1],orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]);
- if(v4)
+ if (v4)
map_to_sphere( &uv[3][0], &uv[3][1],orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]);
}
@@ -2412,7 +2558,7 @@ void DM_add_tangent_layer(DerivedMesh *dm)
sum_or_add_vertex_tangent(arena, &vtangents[mf->v2], tang, uv2);
sum_or_add_vertex_tangent(arena, &vtangents[mf->v3], tang, uv3);
- if(mf->v4) {
+ if (mf->v4) {
v4= &mvert[mf->v4];
tangent_from_uv(uv1, uv3, uv4, v1->co, v3->co, v4->co, fno, tang);
@@ -2423,14 +2569,14 @@ void DM_add_tangent_layer(DerivedMesh *dm)
}
/* write tangent to layer */
- for(i=0, tf=mtface, mf=mface; i < totface; mf++, tf++, i++, tangent+=4) {
+ for (i=0, tf=mtface, mf=mface; i < totface; mf++, tf++, i++, tangent+=4) {
len= (mf->v4)? 4 : 3;
- if(mtface == NULL) {
+ if (mtface == NULL) {
map_to_sphere( &uv[0][0], &uv[0][1],orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]);
map_to_sphere( &uv[1][0], &uv[1][1],orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]);
map_to_sphere( &uv[2][0], &uv[2][1],orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]);
- if(len==4)
+ if (len==4)
map_to_sphere( &uv[3][0], &uv[3][1],orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]);
}
@@ -2439,7 +2585,7 @@ void DM_add_tangent_layer(DerivedMesh *dm)
mf_vi[2]= mf->v3;
mf_vi[3]= mf->v4;
- for(j=0; j<len; j++) {
+ for (j=0; j<len; j++) {
vtang= find_vertex_tangent(vtangents[mf_vi[j]], mtface ? tf->uv[j] : uv[j]);
normalize_v3_v3(tangent[j], vtang);
((float *) tangent[j])[3]=1.0f;
@@ -2460,14 +2606,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,47 +2619,47 @@ 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];
}
// discard degenerate faces
is_degenerate = 0;
- if( equals_v3v3(verts[0], verts[1]) || equals_v3v3(verts[0], verts[2]) || equals_v3v3(verts[1], verts[2]) ||
+ if ( equals_v3v3(verts[0], verts[1]) || equals_v3v3(verts[0], verts[2]) || equals_v3v3(verts[1], verts[2]) ||
equals_v2v2(tex_coords[0], tex_coords[1]) || equals_v2v2(tex_coords[0], tex_coords[2]) || equals_v2v2(tex_coords[1], tex_coords[2]) )
{
is_degenerate = 1;
}
// 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 +2668,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 +2680,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 +2691,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 +2712,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 +2737,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;
}
}
@@ -2618,25 +2756,25 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
fdata = tfdata = dm->getTessFaceDataLayout(dm);
/* calc auto bump scale if necessary */
- if(dm->auto_bump_scale<=0.0f)
+ if (dm->auto_bump_scale<=0.0f)
DM_calc_auto_bump_scale(dm);
/* add a tangent layer if necessary */
- for(b = 0; b < gattribs->totlayer; b++)
- if(gattribs->layer[b].type == CD_TANGENT)
- if(CustomData_get_layer_index(fdata, CD_TANGENT) == -1)
+ for (b = 0; b < gattribs->totlayer; b++)
+ if (gattribs->layer[b].type == CD_TANGENT)
+ if (CustomData_get_layer_index(fdata, CD_TANGENT) == -1)
DM_add_tangent_layer(dm);
- for(b = 0; b < gattribs->totlayer; b++) {
- if(gattribs->layer[b].type == CD_MTFACE) {
+ for (b = 0; b < gattribs->totlayer; b++) {
+ if (gattribs->layer[b].type == CD_MTFACE) {
/* uv coordinates */
- if(gattribs->layer[b].name[0])
+ if (gattribs->layer[b].name[0])
layer = CustomData_get_named_layer_index(tfdata, CD_MTFACE,
gattribs->layer[b].name);
else
layer = CustomData_get_active_layer_index(tfdata, CD_MTFACE);
- if(layer != -1) {
+ if (layer != -1) {
a = attribs->tottface++;
attribs->tface[a].array = tfdata->layers[layer].data;
@@ -2644,12 +2782,13 @@ 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);
- if(gattribs->layer[b].name[0])
+ if (gattribs->layer[b].name[0])
player = CustomData_get_named_layer_index(pdata, CD_MTEXPOLY,
gattribs->layer[b].name);
else
@@ -2665,17 +2804,17 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
}
}
- */
+#endif
}
- else if(gattribs->layer[b].type == CD_MCOL) {
+ else if (gattribs->layer[b].type == CD_MCOL) {
/* vertex colors */
- if(gattribs->layer[b].name[0])
+ if (gattribs->layer[b].name[0])
layer = CustomData_get_named_layer_index(tfdata, CD_MCOL,
gattribs->layer[b].name);
else
layer = CustomData_get_active_layer_index(tfdata, CD_MCOL);
- if(layer != -1) {
+ if (layer != -1) {
a = attribs->totmcol++;
attribs->mcol[a].array = tfdata->layers[layer].data;
@@ -2683,11 +2822,11 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
attribs->mcol[a].glIndex = gattribs->layer[b].glindex;
}
}
- else if(gattribs->layer[b].type == CD_TANGENT) {
+ else if (gattribs->layer[b].type == CD_TANGENT) {
/* tangents */
layer = CustomData_get_layer_index(fdata, CD_TANGENT);
- if(layer != -1) {
+ if (layer != -1) {
attribs->tottang = 1;
attribs->tang.array = fdata->layers[layer].data;
@@ -2695,11 +2834,11 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
attribs->tang.glIndex = gattribs->layer[b].glindex;
}
}
- else if(gattribs->layer[b].type == CD_ORCO) {
+ else if (gattribs->layer[b].type == CD_ORCO) {
/* original coordinates */
layer = CustomData_get_layer_index(vdata, CD_ORCO);
- if(layer != -1) {
+ if (layer != -1) {
attribs->totorco = 1;
attribs->orco.array = vdata->layers[layer].data;
@@ -2720,7 +2859,7 @@ void DM_set_object_boundbox(Object *ob, DerivedMesh *dm)
dm->getMinMax(dm, min, max);
- if(!ob->bb)
+ if (!ob->bb)
ob->bb= MEM_callocN(sizeof(BoundBox), "DM-BoundBox");
boundbox_set_from_min_max(ob->bb, min, max);
@@ -2738,12 +2877,12 @@ void DM_set_object_boundbox(Object *ob, DerivedMesh *dm)
*/
-BM_INLINE int navmesh_bit(int a, int b)
+BLI_INLINE int navmesh_bit(int a, int b)
{
return (a & (1 << b)) >> b;
}
-BM_INLINE void navmesh_intToCol(int i, float col[3])
+BLI_INLINE void navmesh_intToCol(int i, float col[3])
{
int r = navmesh_bit(i, 0) + navmesh_bit(i, 3) * 2 + 1;
int g = navmesh_bit(i, 1) + navmesh_bit(i, 4) * 2 + 1;
@@ -2764,20 +2903,21 @@ 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 */
+ /* if (GPU_buffer_legacy(dm) ) */ { /* TODO - VBO draw code, not high priority - campbell */
DEBUG_VBO( "Using legacy code. drawNavMeshColored\n" );
//glShadeModel(GL_SMOOTH);
glBegin(glmode = GL_QUADS);
- for(a = 0; a < dm->numTessFaceData; a++, mface++) {
+ for (a = 0; a < dm->numTessFaceData; a++, mface++) {
int new_glmode = mface->v4?GL_QUADS:GL_TRIANGLES;
int pi = polygonIdx[a];
if (pi <= 0) {
@@ -2787,7 +2927,7 @@ static void navmesh_drawColored(DerivedMesh *dm)
navmesh_intToCol(pi, col);
}
- if(new_glmode != glmode) {
+ if (new_glmode != glmode) {
glEnd();
glBegin(glmode = new_glmode);
}
@@ -2795,7 +2935,7 @@ static void navmesh_drawColored(DerivedMesh *dm)
glVertex3fv(mvert[mface->v1].co);
glVertex3fv(mvert[mface->v2].co);
glVertex3fv(mvert[mface->v3].co);
- if(mface->v4) {
+ if (mface->v4) {
glVertex3fv(mvert[mface->v4].co);
}
}
@@ -2805,8 +2945,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 +2958,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;
@@ -2928,6 +3068,8 @@ void DM_init_origspace(DerivedMesh *dm)
}
}
}
+
+ dm->dirty |= DM_DIRTY_TESS_CDLAYERS;
}
@@ -3009,7 +3151,7 @@ char *DM_debug_info(DerivedMesh *dm)
void DM_debug_print(DerivedMesh *dm)
{
char *str = DM_debug_info(dm);
- printf("%s", str);
+ puts(str);
fflush(stdout);
MEM_freeN(str);
}
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index c181548eb19..78668a5a2e4 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 ************** */
@@ -415,7 +415,7 @@ bPoseChannel *get_pose_channel(const bPose *pose, const char *name)
if (ELEM(NULL, pose, name) || (name[0] == 0))
return NULL;
- if(pose->chanhash)
+ if (pose->chanhash)
return BLI_ghash_lookup(pose->chanhash, (void *)name);
return BLI_findstring(&((bPose *)pose)->chanbase, name, offsetof(bPoseChannel, name));
@@ -432,7 +432,7 @@ bPoseChannel *verify_pose_channel(bPose *pose, const char *name)
/* See if this channel exists */
chan= BLI_findstring(&pose->chanbase, name, offsetof(bPoseChannel, name));
- if(chan) {
+ if (chan) {
return chan;
}
@@ -464,10 +464,11 @@ bPoseChannel *get_active_posechannel (Object *ob)
{
bArmature *arm= (ob) ? ob->data : NULL;
bPoseChannel *pchan;
-
- if ELEM3(NULL, ob, ob->pose, arm)
+
+ if (ELEM3(NULL, ob, ob->pose, arm)) {
return NULL;
-
+ }
+
/* find active */
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
if ((pchan->bone) && (pchan->bone == arm->act_bone) && (pchan->bone->layer & arm->layer))
@@ -523,7 +524,7 @@ void copy_pose (bPose **dst, bPose *src, int copycon)
pchan->mpath= NULL; /* motion paths should not get copied yet... */
}
- if(pchan->prop) {
+ if (pchan->prop) {
pchan->prop= IDP_CopyProperty(pchan->prop);
}
}
@@ -570,18 +571,18 @@ void init_pose_ikparam(bPose *pose)
void make_pose_channels_hash(bPose *pose)
{
- if(!pose->chanhash) {
+ if (!pose->chanhash) {
bPoseChannel *pchan;
pose->chanhash= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "make_pose_chan gh");
- for(pchan=pose->chanbase.first; pchan; pchan=pchan->next)
+ for (pchan=pose->chanbase.first; pchan; pchan=pchan->next)
BLI_ghash_insert(pose->chanhash, pchan->name, pchan);
}
}
void free_pose_channels_hash(bPose *pose)
{
- if(pose->chanhash) {
+ if (pose->chanhash) {
BLI_ghash_free(pose->chanhash, NULL, NULL);
pose->chanhash= NULL;
}
@@ -656,7 +657,7 @@ static void copy_pose_channel_data(bPoseChannel *pchan, const bPoseChannel *chan
pchan->flag= chan->flag;
con= chan->constraints.first;
- for(pcon= pchan->constraints.first; pcon && con; pcon= pcon->next, con= con->next) {
+ for (pcon= pchan->constraints.first; pcon && con; pcon= pcon->next, con= con->next) {
pcon->enforce= con->enforce;
pcon->headtail= con->headtail;
}
@@ -689,13 +690,13 @@ void duplicate_pose_channel_data(bPoseChannel *pchan, const bPoseChannel *pchan_
copy_constraints(&pchan->constraints, &pchan_from->constraints, TRUE);
/* id-properties */
- if(pchan->prop) {
+ if (pchan->prop) {
/* unlikely but possible it exists */
IDP_FreeProperty(pchan->prop);
MEM_freeN(pchan->prop);
pchan->prop= NULL;
}
- if(pchan_from->prop) {
+ if (pchan_from->prop) {
pchan->prop= IDP_CopyProperty(pchan_from->prop);
}
@@ -727,19 +728,19 @@ void update_pose_constraint_flags(bPose *pose)
pchan->constflag |= PCHAN_HAS_IK;
- if(data->tar==NULL || (data->tar->type==OB_ARMATURE && data->subtarget[0]==0))
+ if (data->tar==NULL || (data->tar->type==OB_ARMATURE && data->subtarget[0]==0))
pchan->constflag |= PCHAN_HAS_TARGET;
/* negative rootbone = recalc rootbone index. used in do_versions */
- if(data->rootbone<0) {
+ if (data->rootbone<0) {
data->rootbone= 0;
- if(data->flag & CONSTRAINT_IK_TIP) parchan= pchan;
+ if (data->flag & CONSTRAINT_IK_TIP) parchan= pchan;
else parchan= pchan->parent;
- while(parchan) {
+ while (parchan) {
data->rootbone++;
- if((parchan->bone->flag & BONE_CONNECTED)==0)
+ if ((parchan->bone->flag & BONE_CONNECTED)==0)
break;
parchan= parchan->parent;
}
@@ -837,7 +838,7 @@ void pose_remove_group (Object *ob)
/* now, remove it from the pose */
BLI_freelinkN(&pose->agroups, grp);
pose->active_group--;
- if(pose->active_group < 0 || pose->agroups.first == NULL) {
+ if (pose->active_group < 0 || pose->agroups.first == NULL) {
pose->active_group= 0;
}
}
@@ -932,7 +933,7 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_
}
if (foundvert || foundmod) {
- if(min==max) max+= 1.0f;
+ if (min==max) max+= 1.0f;
*start= min;
*end= max;
}
@@ -1054,7 +1055,7 @@ short action_get_item_transforms (bAction *act, Object *ob, bPoseChannel *pchan,
/* Copy the data from the action-pose (src) into the pose */
/* both args are assumed to be valid */
/* exported to game engine */
-/* Note! this assumes both poses are aligned, this isnt always true when dealing with user poses */
+/* Note! this assumes both poses are aligned, this isn't always true when dealing with user poses */
void extract_pose_from_pose(bPose *pose, const bPose *src)
{
const bPoseChannel *schan;
@@ -1097,7 +1098,7 @@ void copy_pose_result(bPose *to, bPose *from)
{
bPoseChannel *pchanto, *pchanfrom;
- if(to==NULL || from==NULL) {
+ if (to==NULL || from==NULL) {
printf("pose result copy error to:%p from:%p\n", (void *)to, (void *)from); // debug temp
return;
}
@@ -1108,9 +1109,9 @@ void copy_pose_result(bPose *to, bPose *from)
}
- for(pchanfrom= from->chanbase.first; pchanfrom; pchanfrom= pchanfrom->next) {
+ for (pchanfrom= from->chanbase.first; pchanfrom; pchanfrom= pchanfrom->next) {
pchanto= get_pose_channel(to, pchanfrom->name);
- if(pchanto) {
+ if (pchanto) {
copy_m4_m4(pchanto->pose_mat, pchanfrom->pose_mat);
copy_m4_m4(pchanto->chan_mat, pchanfrom->chan_mat);
@@ -1214,23 +1215,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)
@@ -1238,15 +1238,15 @@ static void blend_pose_offset_bone(bActionStrip *strip, bPose *dst, bPose *src,
/* matching offset bones */
/* take dst offset, and put src on on that location */
- if(strip->offs_bone[0]==0)
+ if (strip->offs_bone[0]==0)
return;
/* are we also blending with matching bones? */
- if(strip->prev && strip->start>=strip->prev->start) {
+ if (strip->prev && strip->start>=strip->prev->start) {
bPoseChannel *dpchan= get_pose_channel(dst, strip->offs_bone);
- if(dpchan) {
+ if (dpchan) {
bPoseChannel *spchan= get_pose_channel(src, strip->offs_bone);
- if(spchan) {
+ if (spchan) {
float vec[3];
/* dst->ctime has the internal strip->prev action time */
@@ -1254,7 +1254,7 @@ static void blend_pose_offset_bone(bActionStrip *strip, bPose *dst, bPose *src,
float ctime= get_actionstrip_frame(strip, src->ctime, 1);
- if( ctime > strip->prev->end) {
+ if ( ctime > strip->prev->end) {
bActionChannel *achan;
/* add src to dest, minus the position of src on strip->prev->end */
@@ -1262,7 +1262,7 @@ static void blend_pose_offset_bone(bActionStrip *strip, bPose *dst, bPose *src,
ctime= get_actionstrip_frame(strip, strip->prev->end, 0);
achan= get_action_channel(strip->act, strip->offs_bone);
- if(achan && achan->ipo) {
+ if (achan && achan->ipo) {
bPoseChannel pchan;
/* Evaluates and sets the internal ipo value */
calc_ipo(achan->ipo, ctime);
@@ -1294,8 +1294,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;
@@ -1303,19 +1303,19 @@ static float stridechannel_frame(Object *ob, float sizecorr, bActionStrip *strip
bActionChannel *achan= get_action_channel(act, name);
int stride_axis= strip->stride_axis;
- if(achan && achan->ipo) {
+ if (achan && achan->ipo) {
IpoCurve *icu= NULL;
float minx=0.0f, maxx=0.0f, miny=0.0f, maxy=0.0f;
int foundvert= 0;
- if(stride_axis==0) stride_axis= AC_LOC_X;
- else if(stride_axis==1) stride_axis= AC_LOC_Y;
+ if (stride_axis==0) stride_axis= AC_LOC_X;
+ else if (stride_axis==1) stride_axis= AC_LOC_Y;
else stride_axis= AC_LOC_Z;
/* calculate the min/max */
for (icu=achan->ipo->curve.first; icu; icu=icu->next) {
- if(icu->adrcode==stride_axis) {
- if(icu->totvert>1) {
+ if (icu->adrcode==stride_axis) {
+ if (icu->totvert>1) {
foundvert= 1;
minx= icu->bezt[0].vec[1][0];
maxx= icu->bezt[icu->totvert-1].vec[1][0];
@@ -1327,7 +1327,7 @@ static float stridechannel_frame(Object *ob, float sizecorr, bActionStrip *strip
}
}
- if(foundvert && miny!=maxy) {
+ if (foundvert && miny!=maxy) {
float stridelen= sizecorr*fabs(maxy-miny), striptime;
float actiondist, pdist, pdistNewNormalized, offs;
float vec1[4], vec2[4], dir[3];
@@ -1367,10 +1367,10 @@ static float stridechannel_frame(Object *ob, float sizecorr, bActionStrip *strip
static void cyclic_offs_bone(Object *ob, bPose *pose, bActionStrip *strip, float time)
{
/* only called when strip has cyclic, so >= 1.0f works... */
- if(time >= 1.0f) {
+ if (time >= 1.0f) {
bActionChannel *achan= get_action_channel(strip->act, strip->offs_bone);
- if(achan && achan->ipo) {
+ if (achan && achan->ipo) {
IpoCurve *icu= NULL;
Bone *bone;
float min[3]={0.0f, 0.0f, 0.0f}, max[3]={0.0f, 0.0f, 0.0f};
@@ -1378,13 +1378,13 @@ static void cyclic_offs_bone(Object *ob, bPose *pose, bActionStrip *strip, float
/* calculate the min/max */
for (icu=achan->ipo->curve.first; icu; icu=icu->next) {
- if(icu->totvert>1) {
+ if (icu->totvert>1) {
- if(icu->adrcode==AC_LOC_X)
+ if (icu->adrcode==AC_LOC_X)
index= 0;
- else if(icu->adrcode==AC_LOC_Y)
+ else if (icu->adrcode==AC_LOC_Y)
index= 1;
- else if(icu->adrcode==AC_LOC_Z)
+ else if (icu->adrcode==AC_LOC_Z)
index= 2;
else
continue;
@@ -1394,11 +1394,11 @@ static void cyclic_offs_bone(Object *ob, bPose *pose, bActionStrip *strip, float
max[index]= icu->bezt[icu->totvert-1].vec[1][1];
}
}
- if(foundvert) {
+ if (foundvert) {
/* bring it into armature space */
sub_v3_v3v3(min, max, min);
bone= get_named_bone(ob->data, strip->offs_bone); /* weak */
- if(bone) {
+ if (bone) {
mul_mat3_m4_v3(bone->arm_mat, min);
/* dominant motion, cyclic_offset was cleared in rest_pose */
@@ -1406,10 +1406,11 @@ static void cyclic_offs_bone(Object *ob, bPose *pose, bActionStrip *strip, float
if (strip->flag & ACTSTRIP_CYCLIC_USEX) pose->cyclic_offset[0]= time*min[0];
if (strip->flag & ACTSTRIP_CYCLIC_USEY) pose->cyclic_offset[1]= time*min[1];
if (strip->flag & ACTSTRIP_CYCLIC_USEZ) pose->cyclic_offset[2]= time*min[2];
- } else {
- if( fabs(min[0]) >= fabs(min[1]) && fabs(min[0]) >= fabs(min[2]))
+ }
+ else {
+ if ( fabs(min[0]) >= fabs(min[1]) && fabs(min[0]) >= fabs(min[2]))
pose->cyclic_offset[0]= time*min[0];
- else if( fabs(min[1]) >= fabs(min[0]) && fabs(min[1]) >= fabs(min[2]))
+ else if ( fabs(min[1]) >= fabs(min[0]) && fabs(min[1]) >= fabs(min[2]))
pose->cyclic_offset[1]= time*min[1];
else
pose->cyclic_offset[2]= time*min[2];
@@ -1426,12 +1427,12 @@ static Object *get_parent_path(Object *ob)
{
bConstraint *con;
- if(ob->parent && ob->parent->type==OB_CURVE)
+ if (ob->parent && ob->parent->type==OB_CURVE)
return ob->parent;
for (con = ob->constraints.first; con; con=con->next) {
- if(con->type==CONSTRAINT_TYPE_FOLLOWPATH) {
- if(con->enforce>0.5f) {
+ if (con->type==CONSTRAINT_TYPE_FOLLOWPATH) {
+ if (con->enforce>0.5f) {
bFollowPathConstraint *data= con->data;
return data->tar;
}
@@ -1455,7 +1456,7 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
float scene_cfra= BKE_curframe(scene);
int doit, dostride;
- if(blocktype==ID_AR) {
+ if (blocktype==ID_AR) {
copy_pose(&tpose, ob->pose, 1);
rest_pose(ob->pose); // potentially destroying current not-keyed pose
}
@@ -1466,25 +1467,25 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
/* check on extend to left or right, when no strip is hit by 'cfra' */
for (strip=ob->nlastrips.first; strip; strip=strip->next) {
/* escape loop on a hit */
- if( scene_cfra >= strip->start && scene_cfra <= strip->end + 0.1f) /* note 0.1 comes back below */
+ if ( scene_cfra >= strip->start && scene_cfra <= strip->end + 0.1f) /* note 0.1 comes back below */
break;
- if(scene_cfra < strip->start) {
- if(stripfirst==NULL)
+ if (scene_cfra < strip->start) {
+ if (stripfirst==NULL)
stripfirst= strip;
- else if(stripfirst->start > strip->start)
+ else if (stripfirst->start > strip->start)
stripfirst= strip;
}
- else if(scene_cfra > strip->end) {
- if(striplast==NULL)
+ else if (scene_cfra > strip->end) {
+ if (striplast==NULL)
striplast= strip;
- else if(striplast->end < strip->end)
+ else if (striplast->end < strip->end)
striplast= strip;
}
}
- if(strip==NULL) { /* extend */
- if(striplast)
+ if (strip==NULL) { /* extend */
+ if (striplast)
scene_cfra= striplast->end;
- else if(stripfirst)
+ else if (stripfirst)
scene_cfra= stripfirst->start;
}
@@ -1502,7 +1503,7 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
if (striptime>=0.0) {
- if(blocktype==ID_AR)
+ if (blocktype==ID_AR)
rest_pose(tpose);
/* To handle repeat, we add 0.1 frame extra to make sure the last frame is included */
@@ -1518,20 +1519,20 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
if (cu->flag & CU_PATH) {
/* Ensure we have a valid path */
- if(cu->path==NULL || cu->path->data==NULL) makeDispListCurveTypes(scene, parent, 0);
- if(cu->path) {
+ if (cu->path==NULL || cu->path->data==NULL) makeDispListCurveTypes(scene, parent, 0);
+ if (cu->path) {
/* Find the position on the path */
ctime= bsystem_time(scene, ob, scene_cfra, 0.0);
- if(calc_ipo_spec(cu->ipo, CU_SPEED, &ctime)==0) {
+ if (calc_ipo_spec(cu->ipo, CU_SPEED, &ctime)==0) {
/* correct for actions not starting on zero */
ctime= (ctime - strip->actstart)/cu->pathlen;
CLAMP(ctime, 0.0, 1.0);
}
pdist = ctime*cu->path->totdist;
- if(tpose && strip->stridechannel[0]) {
+ if (tpose && strip->stridechannel[0]) {
striptime= stridechannel_frame(parent, ob->size[0], strip, cu->path, pdist, tpose->stride_offset);
}
else {
@@ -1546,12 +1547,12 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
frametime = (striptime * actlength) + strip->actstart;
frametime= bsystem_time(scene, ob, frametime, 0.0);
- if(blocktype==ID_AR) {
+ if (blocktype==ID_AR) {
extract_pose_from_action (tpose, strip->act, frametime);
}
- else if(blocktype==ID_OB) {
+ else if (blocktype==ID_OB) {
extract_ipochannels_from_action(&tchanbase, &ob->id, strip->act, "Object", frametime);
- if(key)
+ if (key)
extract_ipochannels_from_action(&tchanbase, &key->id, strip->act, "Shape", frametime);
}
doit=dostride= 1;
@@ -1563,25 +1564,25 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
else {
/* Mod to repeat */
- if(strip->repeat!=1.0f) {
+ if (strip->repeat!=1.0f) {
float cycle= striptime*strip->repeat;
striptime = (float)fmod (cycle, 1.0f + 0.1f/length);
cycle-= striptime;
- if(blocktype==ID_AR)
+ if (blocktype==ID_AR)
cyclic_offs_bone(ob, tpose, strip, cycle);
}
frametime = (striptime * actlength) + strip->actstart;
frametime= nla_time(scene, frametime, (float)strip->repeat);
- if(blocktype==ID_AR) {
+ if (blocktype==ID_AR) {
extract_pose_from_action (tpose, strip->act, frametime);
}
- else if(blocktype==ID_OB) {
+ else if (blocktype==ID_OB) {
extract_ipochannels_from_action(&tchanbase, &ob->id, strip->act, "Object", frametime);
- if(key)
+ if (key)
extract_ipochannels_from_action(&tchanbase, &key->id, strip->act, "Shape", frametime);
}
@@ -1594,20 +1595,20 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
/* we want the strip to hold on the exact fraction of the repeat value */
frametime = actlength * (strip->repeat-(int)strip->repeat);
- if(frametime<=0.000001f) frametime= actlength; /* rounding errors... */
+ if (frametime<=0.000001f) frametime= actlength; /* rounding errors... */
frametime= bsystem_time(scene, ob, frametime+strip->actstart, 0.0);
- if(blocktype==ID_AR)
+ if (blocktype==ID_AR)
extract_pose_from_action (tpose, strip->act, frametime);
- else if(blocktype==ID_OB) {
+ else if (blocktype==ID_OB) {
extract_ipochannels_from_action(&tchanbase, &ob->id, strip->act, "Object", frametime);
- if(key)
+ if (key)
extract_ipochannels_from_action(&tchanbase, &key->id, strip->act, "Shape", frametime);
}
/* handle cycle hold */
- if(strip->repeat!=1.0f) {
- if(blocktype==ID_AR)
+ if (strip->repeat!=1.0f) {
+ if (blocktype==ID_AR)
cyclic_offs_bone(ob, tpose, strip, strip->repeat-1.0f);
}
@@ -1628,12 +1629,12 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
else
blendfac = 1;
- if(blocktype==ID_AR) {/* Blend this pose with the accumulated pose */
+ if (blocktype==ID_AR) {/* Blend this pose with the accumulated pose */
/* offset bone, for matching cycles */
blend_pose_offset_bone (strip, ob->pose, tpose, blendfac, strip->mode);
blend_poses (ob->pose, tpose, blendfac, strip->mode);
- if(dostride)
+ if (dostride)
blend_pose_strides (ob->pose, tpose, blendfac, strip->mode);
}
else {
@@ -1645,10 +1646,10 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
}
}
- if(blocktype==ID_OB) {
+ if (blocktype==ID_OB) {
execute_ipochannels(&chanbase);
}
- else if(blocktype==ID_AR) {
+ else if (blocktype==ID_AR) {
/* apply stride offset to object */
add_v3_v3(ob->obmat[3], ob->pose->stride_offset);
}
@@ -1656,7 +1657,7 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
/* free */
if (tpose)
free_pose(tpose);
- if(chanbase.first)
+ if (chanbase.first)
BLI_freelistN(&chanbase);
}
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 77523980a64..19c4a654f9c 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -29,7 +29,6 @@
* \ingroup bke
*/
-
#include <stdio.h>
#include <math.h>
#include <string.h>
@@ -81,7 +80,7 @@ static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBas
/* ******************************************************************** */
/* Animation Visualisation */
-/* Initialise the default settings for animation visualisation */
+/* Initialize the default settings for animation visualisation */
void animviz_settings_init(bAnimVizSettings *avs)
{
/* sanity check */
@@ -234,7 +233,7 @@ typedef struct MPathTarget {
/* get list of motion paths to be baked for the given object
* - assumes the given list is ready to be used
*/
-// TODO: it would be nice in future to be able to update objects dependant on these bones too?
+// TODO: it would be nice in future to be able to update objects dependent on these bones too?
void animviz_get_object_motionpaths(Object *ob, ListBase *targets)
{
MPathTarget *mpt;
@@ -318,7 +317,7 @@ static void motionpaths_calc_update_scene(Scene *scene)
/* find the last object with the tag
* - all those afterwards are assumed to not be relevant for our calculations
*/
- // optimise further by moving out...
+ // optimize further by moving out...
for (base=scene->base.first; base; base=base->next) {
if (base->object->flag & BA_TEMP_TAG)
last = base;
@@ -416,7 +415,7 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets)
}
if (efra <= sfra) return;
- /* optimise the depsgraph for faster updates */
+ /* optimize the depsgraph for faster updates */
// TODO: whether this is used should depend on some setting for the level of optimisations used
motionpaths_calc_optimise_depsgraph(scene, targets);
@@ -453,11 +452,11 @@ 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)
{
- if(path->data) MEM_freeN(path->data);
+ if (path->data) MEM_freeN(path->data);
MEM_freeN(path);
}
@@ -480,29 +479,29 @@ void calc_curvepath(Object *ob)
/* in a path vertices are with equal differences: path->len = number of verts */
/* NOW WITH BEVELCURVE!!! */
- if(ob==NULL || ob->type != OB_CURVE) return;
+ if (ob==NULL || ob->type != OB_CURVE) return;
cu= ob->data;
nurbs= BKE_curve_nurbs(cu);
nu= nurbs->first;
- if(cu->path) free_path(cu->path);
+ if (cu->path) free_path(cu->path);
cu->path= NULL;
bl= cu->bev.first;
- if(bl==NULL || !bl->nr) return;
+ if (bl==NULL || !bl->nr) return;
cu->path=path= MEM_callocN(sizeof(Path), "calc_curvepath");
/* if POLY: last vertice != first vertice */
cycl= (bl->poly!= -1);
- if(cycl) tot= bl->nr;
+ if (cycl) tot= bl->nr;
else tot= bl->nr-1;
path->len= tot+1;
/* exception: vector handle paths and polygon paths should be subdivided at least a factor resolu */
- if(path->len<nu->resolu*SEGMENTSU(nu)) path->len= nu->resolu*SEGMENTSU(nu);
+ if (path->len<nu->resolu*SEGMENTSU(nu)) path->len= nu->resolu*SEGMENTSU(nu);
dist= (float *)MEM_mallocN((tot+1)*4, "calcpathdist");
@@ -510,9 +509,9 @@ void calc_curvepath(Object *ob)
bevp= bevpfirst= (BevPoint *)(bl+1);
fp= dist;
*fp= 0;
- for(a=0; a<tot; a++) {
+ for (a=0; a<tot; a++) {
fp++;
- if(cycl && a==tot-1)
+ if (cycl && a==tot-1)
sub_v3_v3v3(xyz, bevpfirst->vec, bevp->vec);
else
sub_v3_v3v3(xyz, (bevp+1)->vec, bevp->vec);
@@ -535,17 +534,17 @@ void calc_curvepath(Object *ob)
fac= 1.0f/((float)path->len-1.0f);
fac = fac * path->totdist;
- for(a=0; a<path->len; a++) {
+ for (a=0; a<path->len; a++) {
d= ((float)a)*fac;
/* we're looking for location (distance) 'd' in the array */
- while((d>= *fp) && fp<maxdist) {
+ while ((d>= *fp) && fp<maxdist) {
fp++;
- if(bevp<bevplast) bevp++;
+ if (bevp<bevplast) bevp++;
bevpn= bevp+1;
- if(bevpn>bevplast) {
- if(cycl) bevpn= bevpfirst;
+ if (bevpn>bevplast) {
+ if (cycl) bevpn= bevpfirst;
else bevpn= bevplast;
}
}
@@ -572,15 +571,15 @@ void calc_curvepath(Object *ob)
/* is this only used internally?*/
int interval_test(int min, int max, int p1, int cycl)
{
- if(cycl) {
- if(p1 < min)
+ if (cycl) {
+ if (p1 < min)
p1= ((p1 -min) % (max-min+1)) + max+1;
- else if(p1 > max)
+ else if (p1 > max)
p1= ((p1 -min) % (max-min+1)) + min;
}
else {
- if(p1 < min) p1= min;
- else if(p1 > max) p1= max;
+ if (p1 < min) p1= min;
+ else if (p1 > max) p1= max;
}
return p1;
}
@@ -604,9 +603,9 @@ int where_on_path(Object *ob, float ctime, float vec[4], float dir[3], float qua
float data[4];
int cycl=0, s0, s1, s2, s3;
- if(ob==NULL || ob->type != OB_CURVE) return 0;
+ if (ob==NULL || ob->type != OB_CURVE) return 0;
cu= ob->data;
- if(cu->path==NULL || cu->path->data==NULL) {
+ if (cu->path==NULL || cu->path->data==NULL) {
printf("no path!\n");
return 0;
}
@@ -617,7 +616,7 @@ int where_on_path(Object *ob, float ctime, float vec[4], float dir[3], float qua
bl= cu->bev.first;
if (!bl) return 0;
if (!bl->nr) return 0;
- if(bl->poly> -1) cycl= 1;
+ if (bl->poly> -1) cycl= 1;
ctime *= (path->len-1);
@@ -649,9 +648,9 @@ int where_on_path(Object *ob, float ctime, float vec[4], float dir[3], float qua
nu= cu->nurb.first;
/* make sure that first and last frame are included in the vectors here */
- if(nu->type == CU_POLY) key_curve_position_weights(1.0f-fac, data, KEY_LINEAR);
- else if(nu->type == CU_BEZIER) key_curve_position_weights(1.0f-fac, data, KEY_LINEAR);
- else if(s0==s1 || p2==p3) key_curve_position_weights(1.0f-fac, data, KEY_CARDINAL);
+ if (nu->type == CU_POLY) key_curve_position_weights(1.0f-fac, data, KEY_LINEAR);
+ else if (nu->type == CU_BEZIER) key_curve_position_weights(1.0f-fac, data, KEY_LINEAR);
+ else if (s0==s1 || p2==p3) key_curve_position_weights(1.0f-fac, data, KEY_CARDINAL);
else key_curve_position_weights(1.0f-fac, data, KEY_BSPLINE);
vec[0]= data[0]*p0->vec[0] + data[1]*p1->vec[0] + data[2]*p2->vec[0] + data[3]*p3->vec[0] ; /* X */
@@ -663,22 +662,22 @@ int where_on_path(Object *ob, float ctime, float vec[4], float dir[3], float qua
float totfac, q1[4], q2[4];
totfac= data[0]+data[3];
- if(totfac>FLT_EPSILON) interp_qt_qtqt(q1, p0->quat, p3->quat, data[3] / totfac);
+ if (totfac>FLT_EPSILON) interp_qt_qtqt(q1, p0->quat, p3->quat, data[3] / totfac);
else copy_qt_qt(q1, p1->quat);
totfac= data[1]+data[2];
- if(totfac>FLT_EPSILON) interp_qt_qtqt(q2, p1->quat, p2->quat, data[2] / totfac);
+ if (totfac>FLT_EPSILON) interp_qt_qtqt(q2, p1->quat, p2->quat, data[2] / totfac);
else copy_qt_qt(q2, p3->quat);
totfac = data[0]+data[1]+data[2]+data[3];
- if(totfac>FLT_EPSILON) interp_qt_qtqt(quat, q1, q2, (data[1]+data[2]) / totfac);
+ if (totfac>FLT_EPSILON) interp_qt_qtqt(quat, q1, q2, (data[1]+data[2]) / totfac);
else copy_qt_qt(quat, q2);
}
- if(radius)
+ if (radius)
*radius= data[0]*p0->radius + data[1]*p1->radius + data[2]*p2->radius + data[3]*p3->radius;
- if(weight)
+ if (weight)
*weight= data[0]*p0->weight + data[1]*p1->weight + data[2]*p2->weight + data[3]*p3->weight;
return 1;
@@ -711,23 +710,23 @@ static void group_duplilist(ListBase *lb, Scene *scene, Object *ob, int level, i
GroupObject *go;
float mat[4][4], tmat[4][4];
- if(ob->dup_group==NULL) return;
+ if (ob->dup_group==NULL) return;
group= ob->dup_group;
/* simple preventing of too deep nested groups */
- if(level>MAX_DUPLI_RECUR) return;
+ if (level>MAX_DUPLI_RECUR) return;
/* handles animated groups, and */
/* we need to check update for objects that are not in scene... */
group_handle_recalc_and_update(scene, ob, group);
animated= animated || group_is_animated(ob, group);
- for(go= group->gobject.first; go; go= go->next) {
+ for (go= group->gobject.first; go; go= go->next) {
/* note, if you check on layer here, render goes wrong... it still deforms verts and uses parent imat */
- if(go->ob!=ob) {
+ if (go->ob!=ob) {
/* group dupli offset, should apply after everything else */
- if(!is_zero_v3(group->dupli_ofs)) {
+ if (!is_zero_v3(group->dupli_ofs)) {
copy_m4_m4(tmat, go->ob->obmat);
sub_v3_v3v3(tmat[3], tmat[3], group->dupli_ofs);
mult_m4_m4m4(mat, ob->obmat, tmat);
@@ -739,7 +738,7 @@ static void group_duplilist(ListBase *lb, Scene *scene, Object *ob, int level, i
dob= new_dupli_object(lb, go->ob, mat, ob->lay, 0, OB_DUPLIGROUP, animated);
/* check the group instance and object layers match, also that the object visible flags are ok. */
- if( (dob->origlay & group->layer)==0 ||
+ if ( (dob->origlay & group->layer)==0 ||
(G.rendering==0 && dob->ob->restrictflag & OB_RESTRICT_VIEW) ||
(G.rendering && dob->ob->restrictflag & OB_RESTRICT_RENDER)
) {
@@ -749,7 +748,7 @@ static void group_duplilist(ListBase *lb, Scene *scene, Object *ob, int level, i
dob->no_draw= 0;
}
- if(go->ob->transflag & OB_DUPLI) {
+ if (go->ob->transflag & OB_DUPLI) {
copy_m4_m4(dob->ob->obmat, dob->mat);
object_duplilist_recursive(&group->id, scene, go->ob, lb, ob->obmat, level+1, animated);
copy_m4_m4(dob->ob->obmat, dob->omat);
@@ -855,11 +854,11 @@ static void vertex_dupli__mapFunc(void *userData, int index, float *co, float *n
copy_m4_m4(obmat, vdd->obmat);
copy_v3_v3(obmat[3], vec);
- if(vdd->par->transflag & OB_DUPLIROT) {
- if(no_f) {
+ if (vdd->par->transflag & OB_DUPLIROT) {
+ if (no_f) {
vec[0]= -no_f[0]; vec[1]= -no_f[1]; vec[2]= -no_f[2];
}
- else if(no_s) {
+ else if (no_s) {
vec[0]= -no_s[0]; vec[1]= -no_s[1]; vec[2]= -no_s[2];
}
@@ -877,10 +876,10 @@ static void vertex_dupli__mapFunc(void *userData, int index, float *co, float *n
/* restore the original layer so that each dupli will have proper dob->origlay */
vdd->ob->lay = origlay;
- if(vdd->orco)
+ if (vdd->orco)
copy_v3_v3(dob->orco, vdd->orco[index]);
- if(vdd->ob->transflag & OB_DUPLI) {
+ if (vdd->ob->transflag & OB_DUPLI) {
float tmpmat[4][4];
copy_m4_m4(tmpmat, vdd->ob->obmat);
copy_m4_m4(vdd->ob->obmat, obmat); /* pretend we are really this mat */
@@ -907,16 +906,17 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
copy_m4_m4(pmat, par->obmat);
/* simple preventing of too deep nested groups */
- if(level>MAX_DUPLI_RECUR) return;
+ if (level>MAX_DUPLI_RECUR) return;
em = me->edit_btmesh;
- if(em) {
+ if (em) {
dm= editbmesh_get_derived_cage(scene, par, em, CD_MASK_BAREMESH);
- } else
+ }
+ else
dm= mesh_get_derived_deform(scene, par, CD_MASK_BAREMESH);
- if(G.rendering) {
+ if (G.rendering) {
vdd.orco= (float(*)[3])get_mesh_orco_verts(par);
transform_mesh_orco_verts(me, vdd.orco, me->totvert, 0);
}
@@ -930,7 +930,8 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
sce = (Scene *)id;
lay= sce->lay;
base= sce->base.first;
- } else {
+ }
+ else {
group = (Group *)id;
lay= group->layer;
go = group->gobject.first;
@@ -941,23 +942,24 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
if (sce) {
ob_iter= base->object;
oblay = base->lay;
- } else {
+ }
+ else {
ob_iter= go->ob;
oblay = ob_iter->lay;
}
if (lay & oblay && scene->obedit!=ob_iter) {
ob=ob_iter->parent;
- while(ob) {
- if(ob==par) {
+ while (ob) {
+ if (ob==par) {
ob = ob_iter;
/* 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
- */
- if(par_space_mat)
+ * 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
copy_m4_m4(vdd.obmat, ob->obmat);
@@ -972,20 +974,20 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
copy_m4_m4(vdd.pmat, pmat);
/* mballs have a different dupli handling */
- if(ob->type!=OB_MBALL) ob->flag |= OB_DONE; /* doesnt render */
+ if (ob->type!=OB_MBALL) ob->flag |= OB_DONE; /* doesnt render */
- if(me->edit_btmesh) {
+ if (me->edit_btmesh) {
dm->foreachMappedVert(dm, vertex_dupli__mapFunc, (void*) &vdd);
}
else {
- for(a=0; a<totvert; a++) {
+ for (a=0; a<totvert; a++) {
dm->getVertCo(dm, a, vec);
dm->getVertNo(dm, a, no);
vertex_dupli__mapFunc(&vdd, a, vec, no, NULL);
}
}
- if(sce) {
+ if (sce) {
/* Set proper layer in case of scene looping,
* in case of groups the object layer will be
* changed when it's duplicated due to the
@@ -1003,7 +1005,7 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
else go= go->next; /* group loop */
}
- if(vdd.orco)
+ if (vdd.orco)
MEM_freeN(vdd.orco);
dm->release(dm);
}
@@ -1028,12 +1030,12 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
float ob__obmat[4][4]; /* needed for groups where the object matrix needs to be modified */
/* simple preventing of too deep nested groups */
- if(level>MAX_DUPLI_RECUR) return;
+ if (level>MAX_DUPLI_RECUR) return;
copy_m4_m4(pmat, par->obmat);
em = me->edit_btmesh;
- if(em) {
+ if (em) {
dm= editbmesh_get_derived_cage(scene, par, em, CD_MASK_BAREMESH);
}
else {
@@ -1045,7 +1047,7 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
mloop= dm->getLoopArray(dm);
mvert= dm->getVertArray(dm);
- if(G.rendering) {
+ if (G.rendering) {
orco= (float(*)[3])get_mesh_orco_verts(par);
transform_mesh_orco_verts(me, orco, me->totvert, 0);
@@ -1061,7 +1063,8 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
sce = (Scene *)id;
lay= sce->lay;
base= sce->base.first;
- } else {
+ }
+ else {
group = (Group *)id;
lay= group->layer;
go = group->gobject.first;
@@ -1072,22 +1075,23 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
if (sce) {
ob_iter= base->object;
oblay = base->lay;
- } else {
+ }
+ else {
ob_iter= go->ob;
oblay = ob_iter->lay;
}
if (lay & oblay && scene->obedit!=ob_iter) {
ob=ob_iter->parent;
- while(ob) {
- if(ob==par) {
+ while (ob) {
+ if (ob==par) {
ob = ob_iter;
/* 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
- */
- if(par_space_mat)
+ * 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
copy_m4_m4(ob__obmat, ob->obmat);
@@ -1095,9 +1099,9 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
copy_m3_m4(imat, ob->parentinv);
/* mballs have a different dupli handling */
- if(ob->type!=OB_MBALL) ob->flag |= OB_DONE; /* doesnt render */
+ if (ob->type!=OB_MBALL) ob->flag |= OB_DONE; /* doesnt render */
- for(a=0, mp= mpoly; a<totface; a++, mp++) {
+ for (a=0, mp= mpoly; a<totface; a++, mp++) {
int mv1;
int mv2;
int mv3;
@@ -1117,11 +1121,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 */
@@ -1141,7 +1145,7 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
quat_to_mat3( mat,quat);
/* scale */
- if(par->transflag & OB_DUPLIFACES_SCALE) {
+ if (par->transflag & OB_DUPLIFACES_SCALE) {
float size= mesh_calc_poly_area(mp, loopstart, mvert, NULL);
size= sqrtf(size) * par->dupfacesca;
mul_m3_fl(mat, size);
@@ -1154,17 +1158,17 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
mul_m4_m4m3(obmat, tmat, mat);
dob= new_dupli_object(lb, ob, obmat, par->lay, a, OB_DUPLIFACES, animated);
- if(G.rendering) {
+ if (G.rendering) {
w= 1.0f / (float)mp->totloop;
- if(orco) {
+ if (orco) {
int j;
for (j = 0; j < mpoly->totloop; j++) {
madd_v3_v3fl(dob->orco, orco[loopstart[j].v], w);
}
}
- if(mloopuv) {
+ if (mloopuv) {
int j;
for (j = 0; j < mpoly->totloop; j++) {
madd_v2_v2fl(dob->orco, mloopuv[loopstart[j].v].uv, w);
@@ -1172,7 +1176,7 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
}
}
- if(ob->transflag & OB_DUPLI) {
+ if (ob->transflag & OB_DUPLI) {
float tmpmat[4][4];
copy_m4_m4(tmpmat, ob->obmat);
copy_m4_m4(ob->obmat, obmat); /* pretend we are really this mat */
@@ -1190,7 +1194,7 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
else go= go->next; /* group loop */
}
- if(orco)
+ if (orco)
MEM_freeN(orco);
dm->release(dm);
@@ -1215,20 +1219,20 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
int no_draw_flag = PARS_UNEXIST;
- if(psys==NULL) return;
+ if (psys==NULL) return;
/* simple preventing of too deep nested groups */
- if(level>MAX_DUPLI_RECUR) return;
+ if (level>MAX_DUPLI_RECUR) return;
part=psys->part;
- if(part==NULL)
+ if (part==NULL)
return;
- if(!psys_check_enabled(par, psys))
+ if (!psys_check_enabled(par, psys))
return;
- if(G.rendering == 0)
+ if (G.rendering == 0)
no_draw_flag |= PARS_NO_DISP;
ctime = BKE_curframe(scene); /* NOTE: in old animsys, used parent object's timeoffset... */
@@ -1238,7 +1242,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
BLI_srandom(31415926 + psys->seed);
- if((psys->renderdata || part->draw_as==PART_DRAW_REND) && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
+ if ((psys->renderdata || part->draw_as==PART_DRAW_REND) && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
ParticleSimulationData sim= {NULL};
sim.scene= scene;
sim.ob= par;
@@ -1248,24 +1252,24 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
invert_m4_m4(par->imat, par->obmat);
/* first check for loops (particle system object used as dupli object) */
- if(part->ren_as == PART_DRAW_OB) {
- if(ELEM(part->dup_ob, NULL, par))
+ if (part->ren_as == PART_DRAW_OB) {
+ if (ELEM(part->dup_ob, NULL, par))
return;
}
else { /*PART_DRAW_GR */
- if(part->dup_group == NULL || part->dup_group->gobject.first == NULL)
+ if (part->dup_group == NULL || part->dup_group->gobject.first == NULL)
return;
- for(go=part->dup_group->gobject.first; go; go=go->next)
- if(go->ob == par)
+ for (go=part->dup_group->gobject.first; go; go=go->next)
+ if (go->ob == par)
return;
}
/* if we have a hair particle system, use the path cache */
- if(part->type == PART_HAIR) {
- if(psys->flag & PSYS_HAIR_DONE)
+ if (part->type == PART_HAIR) {
+ if (psys->flag & PSYS_HAIR_DONE)
hair= (totchild == 0 || psys->childcache) && psys->pathcache;
- if(!hair)
+ if (!hair)
return;
/* we use cache, update totchild according to cached data */
@@ -1278,15 +1282,15 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
psys->lattice = psys_get_lattice(&sim);
/* gather list of objects or single object */
- if(part->ren_as==PART_DRAW_GR) {
+ if (part->ren_as==PART_DRAW_GR) {
group_handle_recalc_and_update(scene, par, part->dup_group);
- if(part->draw & PART_DRAW_COUNT_GR) {
- for(dw=part->dupliweights.first; dw; dw=dw->next)
+ if (part->draw & PART_DRAW_COUNT_GR) {
+ for (dw=part->dupliweights.first; dw; dw=dw->next)
totgroup += dw->count;
}
else {
- for(go=part->dup_group->gobject.first; go; go=go->next)
+ for (go=part->dup_group->gobject.first; go; go=go->next)
totgroup++;
}
@@ -1296,11 +1300,11 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
obcopylist = MEM_callocN(totgroup*sizeof(Object), "dupgroup copy list");
- if(part->draw & PART_DRAW_COUNT_GR && totgroup) {
+ if (part->draw & PART_DRAW_COUNT_GR && totgroup) {
dw = part->dupliweights.first;
- for(a=0; a<totgroup; dw=dw->next) {
- for(b=0; b<dw->count; b++, a++) {
+ for (a=0; a<totgroup; dw=dw->next) {
+ for (b=0; b<dw->count; b++, a++) {
oblist[a] = dw->ob;
obcopylist[a] = *dw->ob;
}
@@ -1308,7 +1312,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
}
else {
go = part->dup_group->gobject.first;
- for(a=0; a<totgroup; a++, go=go->next) {
+ for (a=0; a<totgroup; a++, go=go->next) {
oblist[a] = go->ob;
obcopylist[a] = *go->ob;
}
@@ -1319,15 +1323,15 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
obcopy = *ob;
}
- if(totchild==0 || part->draw & PART_DRAW_PARENT)
+ if (totchild==0 || part->draw & PART_DRAW_PARENT)
a = 0;
else
a = totpart;
- for(pa=psys->particles,counter=0; a<totpart+totchild; a++,pa++,counter++) {
- if(a<totpart) {
+ for (pa=psys->particles,counter=0; a<totpart+totchild; a++,pa++,counter++) {
+ if (a<totpart) {
/* handle parent particle */
- if(pa->flag & no_draw_flag)
+ if (pa->flag & no_draw_flag)
continue;
/* pa_num = pa->num; */ /* UNUSED */
@@ -1344,18 +1348,18 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
}
/* some hair paths might be non-existent so they can't be used for duplication */
- if(hair &&
+ if (hair &&
((a < totpart && psys->pathcache[a]->steps < 0) ||
(a >= totpart && psys->childcache[a-totpart]->steps < 0)))
continue;
- if(part->ren_as==PART_DRAW_GR) {
+ if (part->ren_as==PART_DRAW_GR) {
/* prevent divide by zero below [#28336] */
- if(totgroup == 0)
+ if (totgroup == 0)
continue;
/* for groups, pick the object based on settings */
- if(part->draw&PART_DRAW_RAND_GR)
+ if (part->draw&PART_DRAW_RAND_GR)
b= BLI_rand() % totgroup;
else
b= a % totgroup;
@@ -1369,9 +1373,9 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
oldobmat= obcopy.obmat;
}
- if(hair) {
+ if (hair) {
/* hair we handle separate and compute transform based on hair keys */
- if(a < totpart) {
+ if (a < totpart) {
cache = psys->pathcache[a];
psys_get_dupli_path_transform(&sim, pa, NULL, cache, pamat, &scale);
}
@@ -1387,7 +1391,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
else {
/* first key */
state.time = ctime;
- if(psys_get_particle_state(&sim, a, &state, 0) == 0) {
+ if (psys_get_particle_state(&sim, a, &state, 0) == 0) {
continue;
}
else {
@@ -1399,11 +1403,11 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
}
}
- if(part->ren_as==PART_DRAW_GR && psys->part->draw & PART_DRAW_WHOLE_GR) {
- for(go= part->dup_group->gobject.first, b=0; go; go= go->next, b++) {
+ if (part->ren_as==PART_DRAW_GR && psys->part->draw & PART_DRAW_WHOLE_GR) {
+ for (go= part->dup_group->gobject.first, b=0; go; go= go->next, b++) {
/* group dupli offset, should apply after everything else */
- if(!is_zero_v3(part->dup_group->dupli_ofs)) {
+ if (!is_zero_v3(part->dup_group->dupli_ofs)) {
copy_m4_m4(tmat, oblist[b]->obmat);
sub_v3_v3v3(tmat[3], tmat[3], part->dup_group->dupli_ofs);
mult_m4_m4m4(tmat, pamat, tmat);
@@ -1413,14 +1417,14 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
}
mul_mat3_m4_fl(tmat, size*scale);
- if(par_space_mat)
+ if (par_space_mat)
mult_m4_m4m4(mat, par_space_mat, tmat);
else
copy_m4_m4(mat, tmat);
dob= new_dupli_object(lb, go->ob, mat, par->lay, counter, OB_DUPLIPARTS, animated);
copy_m4_m4(dob->omat, obcopylist[b].obmat);
- if(G.rendering)
+ if (G.rendering)
psys_get_dupli_texture(psys, part, sim.psmd, pa, cpa, dob->uv, dob->orco);
}
}
@@ -1432,7 +1436,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
obmat[3][0] = obmat[3][1] = obmat[3][2] = 0.0f;
/* particle rotation uses x-axis as the aligned axis, so pre-rotate the object accordingly */
- if((part->draw & PART_DRAW_ROTATE_OB) == 0) {
+ if ((part->draw & PART_DRAW_ROTATE_OB) == 0) {
float xvec[3], q[4];
xvec[0] = -1.f;
xvec[1] = xvec[2] = 0;
@@ -1444,7 +1448,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
/* Normal particles and cached hair live in global space so we need to
* remove the real emitter's transformation before 2nd order duplication.
*/
- if(par_space_mat && GS(id->name) != ID_GR)
+ if (par_space_mat && GS(id->name) != ID_GR)
mult_m4_m4m4(mat, psys->imat, pamat);
else
copy_m4_m4(mat, pamat);
@@ -1452,24 +1456,24 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
mult_m4_m4m4(tmat, mat, obmat);
mul_mat3_m4_fl(tmat, size*scale);
- if(par_space_mat)
+ if (par_space_mat)
mult_m4_m4m4(mat, par_space_mat, tmat);
else
copy_m4_m4(mat, tmat);
- if(part->draw & PART_DRAW_GLOBAL_OB)
+ if (part->draw & PART_DRAW_GLOBAL_OB)
add_v3_v3v3(mat[3], mat[3], vec);
dob= new_dupli_object(lb, ob, mat, ob->lay, counter, GS(id->name) == ID_GR ? OB_DUPLIGROUP : OB_DUPLIPARTS, animated);
copy_m4_m4(dob->omat, oldobmat);
- if(G.rendering)
+ if (G.rendering)
psys_get_dupli_texture(psys, part, sim.psmd, pa, cpa, dob->uv, dob->orco);
}
}
/* restore objects since they were changed in where_is_object_time */
- if(part->ren_as==PART_DRAW_GR) {
- for(a=0; a<totgroup; a++)
+ if (part->ren_as==PART_DRAW_GR) {
+ for (a=0; a<totgroup; a++)
*(oblist[a])= obcopylist[a];
}
else
@@ -1477,12 +1481,12 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
}
/* clean up */
- if(oblist)
+ if (oblist)
MEM_freeN(oblist);
- if(obcopylist)
+ if (obcopylist)
MEM_freeN(obcopylist);
- if(psys->lattice) {
+ if (psys->lattice) {
end_latt_deform(psys->lattice);
psys->lattice = NULL;
}
@@ -1493,14 +1497,14 @@ static Object *find_family_object(Object **obar, char *family, char ch)
Object *ob;
int flen;
- if( obar[(int)ch] ) return obar[(int)ch];
+ if ( obar[(int)ch] ) return obar[(int)ch];
flen= strlen(family);
ob= G.main->object.first;
- while(ob) {
- if( ob->id.name[flen+2]==ch ) {
- if( strncmp(ob->id.name+2, family, flen)==0 ) break;
+ while (ob) {
+ if ( ob->id.name[flen+2]==ch ) {
+ if ( strncmp(ob->id.name+2, family, flen)==0 ) break;
}
ob= ob->id.next;
}
@@ -1520,14 +1524,14 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, i
int slen, a;
/* simple preventing of too deep nested groups */
- if(level>MAX_DUPLI_RECUR) return;
+ if (level>MAX_DUPLI_RECUR) return;
copy_m4_m4(pmat, par->obmat);
/* in par the family name is stored, use this to find the other objects */
chartransdata= BKE_text_to_curve(G.main, scene, par, FO_DUPLI);
- if(chartransdata==NULL) return;
+ if (chartransdata==NULL) return;
cu= par->data;
slen= strlen(cu->str);
@@ -1537,10 +1541,10 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, i
ct= chartransdata;
- for(a=0; a<slen; a++, ct++) {
+ for (a=0; a<slen; a++, ct++) {
ob= find_family_object(obar, cu->family, cu->str[a]);
- if(ob) {
+ if (ob) {
vec[0]= fsize*(ct->xof - xof);
vec[1]= fsize*(ct->yof - yof);
vec[2]= 0.0;
@@ -1561,7 +1565,7 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, i
static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBase *duplilist, float par_space_mat[][4], int level, int animated)
{
- if((ob->transflag & OB_DUPLI)==0)
+ if ((ob->transflag & OB_DUPLI)==0)
return;
/* Should the dupli's be generated for this object? - Respect restrict flags */
@@ -1569,43 +1573,45 @@ static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBas
if (ob->restrictflag & OB_RESTRICT_RENDER) {
return;
}
- } else {
+ }
+ else {
if (ob->restrictflag & OB_RESTRICT_VIEW) {
return;
}
}
- if(ob->transflag & OB_DUPLIPARTS) {
+ if (ob->transflag & OB_DUPLIPARTS) {
ParticleSystem *psys = ob->particlesystem.first;
- for(; psys; psys=psys->next)
+ for (; psys; psys=psys->next)
new_particle_duplilist(duplilist, id, scene, ob, par_space_mat, psys, level+1, animated);
}
- else if(ob->transflag & OB_DUPLIVERTS) {
- if(ob->type==OB_MESH) {
+ else if (ob->transflag & OB_DUPLIVERTS) {
+ if (ob->type==OB_MESH) {
vertex_duplilist(duplilist, id, scene, ob, par_space_mat, level+1, animated);
}
- else if(ob->type==OB_FONT) {
+ else if (ob->type==OB_FONT) {
if (GS(id->name)==ID_SCE) { /* TODO - support dupligroups */
font_duplilist(duplilist, scene, ob, level+1, animated);
}
}
}
- else if(ob->transflag & OB_DUPLIFACES) {
- if(ob->type==OB_MESH)
+ else if (ob->transflag & OB_DUPLIFACES) {
+ if (ob->type==OB_MESH)
face_duplilist(duplilist, id, scene, ob, par_space_mat, level+1, animated);
}
- else if(ob->transflag & OB_DUPLIFRAMES) {
+ else if (ob->transflag & OB_DUPLIFRAMES) {
if (GS(id->name)==ID_SCE) { /* TODO - support dupligroups */
frames_duplilist(duplilist, scene, ob, level+1, animated);
}
- } else if(ob->transflag & OB_DUPLIGROUP) {
+ }
+ else if (ob->transflag & OB_DUPLIGROUP) {
DupliObject *dob;
group_duplilist(duplilist, scene, ob, level+1, animated); /* now recursive */
if (level==0) {
- for(dob= duplilist->first; dob; dob= dob->next)
- if(dob->type == OB_DUPLIGROUP)
+ for (dob= duplilist->first; dob; dob= dob->next)
+ if (dob->type == OB_DUPLIGROUP)
copy_m4_m4(dob->ob->obmat, dob->mat);
}
}
@@ -1626,9 +1632,9 @@ 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 */
- for(dob= lb->last; dob; dob= dob->prev) {
+ * 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);
}
@@ -1639,17 +1645,17 @@ void free_object_duplilist(ListBase *lb)
int count_duplilist(Object *ob)
{
- if(ob->transflag & OB_DUPLI) {
- if(ob->transflag & OB_DUPLIVERTS) {
- if(ob->type==OB_MESH) {
- if(ob->transflag & OB_DUPLIVERTS) {
+ if (ob->transflag & OB_DUPLI) {
+ if (ob->transflag & OB_DUPLIVERTS) {
+ if (ob->type==OB_MESH) {
+ if (ob->transflag & OB_DUPLIVERTS) {
ParticleSystem *psys = ob->particlesystem.first;
int pdup=0;
- for(; psys; psys=psys->next)
+ for (; psys; psys=psys->next)
pdup += psys->totpart;
- if(pdup==0) {
+ if (pdup==0) {
Mesh *me= ob->data;
return me->totvert;
}
@@ -1658,7 +1664,7 @@ int count_duplilist(Object *ob)
}
}
}
- else if(ob->transflag & OB_DUPLIFRAMES) {
+ else if (ob->transflag & OB_DUPLIFRAMES) {
int tot= ob->dupend - ob->dupsta;
tot/= (ob->dupon+ob->dupoff);
return tot*ob->dupon;
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index c3d2425f280..fc58799eb18 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -45,6 +45,7 @@
#include "DNA_anim_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
+#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
@@ -397,8 +398,8 @@ void action_move_fcurves_by_basepath (bAction *srcAct, bAction *dstAct, const ch
FCurve *fcu, *fcn=NULL;
/* sanity checks */
- if ELEM3(NULL, srcAct, dstAct, basepath) {
- if (G.f & G_DEBUG) {
+ if (ELEM3(NULL, srcAct, dstAct, basepath)) {
+ if (G.debug & G_DEBUG) {
printf("ERROR: action_partition_fcurves_by_basepath(%p, %p, %p) has insufficient info to work with\n",
(void *)srcAct, (void *)dstAct, (void *)basepath);
}
@@ -478,8 +479,8 @@ void BKE_animdata_separate_by_basepath (ID *srcID, ID *dstID, ListBase *basepath
LinkData *ld;
/* sanity checks */
- if ELEM(NULL, srcID, dstID) {
- if (G.f & G_DEBUG)
+ if (ELEM(NULL, srcID, dstID)) {
+ if (G.debug & G_DEBUG)
printf("ERROR: no source or destination ID to separate AnimData with\n");
return;
}
@@ -488,8 +489,8 @@ void BKE_animdata_separate_by_basepath (ID *srcID, ID *dstID, ListBase *basepath
srcAdt = BKE_animdata_from_id(srcID);
dstAdt = BKE_id_add_animdata(dstID);
- if ELEM(NULL, srcAdt, dstAdt) {
- if (G.f & G_DEBUG)
+ if (ELEM(NULL, srcAdt, dstAdt)) {
+ if (G.debug & G_DEBUG)
printf("ERROR: no AnimData for this pair of ID's\n");
return;
}
@@ -632,7 +633,8 @@ static void fcurves_path_rename_fix (ID *owner_id, const char *prefix, char *old
}
/* Check RNA-Paths for a list of Drivers */
-static void drivers_path_rename_fix (ID *owner_id, const char *prefix, const char *oldName, const char *newName, const char *oldKey, const char *newKey, ListBase *curves, int verify_paths)
+static void drivers_path_rename_fix(ID *owner_id, ID *ref_id, const char *prefix, const char *oldName, const char *newName,
+ const char *oldKey, const char *newKey, ListBase *curves, int verify_paths)
{
FCurve *fcu;
@@ -658,7 +660,7 @@ static void drivers_path_rename_fix (ID *owner_id, const char *prefix, const cha
/* also fix the bone-name (if applicable) */
if (strstr(prefix, "bones")) {
- if ( ((dtar->id) && (GS(dtar->id->name) == ID_OB)) &&
+ if ( ((dtar->id) && (GS(dtar->id->name) == ID_OB) && (!ref_id || ((Object*)(dtar->id))->data == ref_id)) &&
(dtar->pchan_name[0]) && (strcmp(oldName, dtar->pchan_name)==0) )
{
BLI_strncpy(dtar->pchan_name, newName, sizeof(dtar->pchan_name));
@@ -692,7 +694,8 @@ static void nlastrips_path_rename_fix (ID *owner_id, const char *prefix, char *o
* NOTE: it is assumed that the structure we're replacing is <prefix><["><name><"]>
* i.e. pose.bones["Bone"]
*/
-void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, int verify_paths)
+void BKE_animdata_fix_paths_rename(ID *owner_id, AnimData *adt, ID *ref_id, const char *prefix, const char *oldName,
+ const char *newName, int oldSubscript, int newSubscript, int verify_paths)
{
NlaTrack *nlt;
char *oldN, *newN;
@@ -718,7 +721,7 @@ void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, const char *pre
fcurves_path_rename_fix(owner_id, prefix, oldN, newN, &adt->tmpact->curves, verify_paths);
/* Drivers - Drivers are really F-Curves */
- drivers_path_rename_fix(owner_id, prefix, oldName, newName, oldN, newN, &adt->drivers, verify_paths);
+ drivers_path_rename_fix(owner_id, ref_id, prefix, oldName, newName, oldN, newN, &adt->drivers, verify_paths);
/* NLA Data - Animation Data for Strips */
for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next)
@@ -812,7 +815,7 @@ void BKE_animdata_main_cb (Main *mainptr, ID_AnimData_Edit_Callback func, void *
* i.e. pose.bones["Bone"]
*/
/* TODO: use BKE_animdata_main_cb for looping over all data */
-void BKE_all_animdata_fix_paths_rename (const char *prefix, const char *oldName, const char *newName)
+void BKE_all_animdata_fix_paths_rename(ID *ref_id, const char *prefix, const char *oldName, const char *newName)
{
Main *mainptr= G.main;
ID *id;
@@ -824,7 +827,7 @@ void BKE_all_animdata_fix_paths_rename (const char *prefix, const char *oldName,
#define RENAMEFIX_ANIM_IDS(first) \
for (id= first; id; id= id->next) { \
AnimData *adt= BKE_animdata_from_id(id); \
- BKE_animdata_fix_paths_rename(id, adt, prefix, oldName, newName, 0, 0, 1);\
+ BKE_animdata_fix_paths_rename(id, adt, ref_id, prefix, oldName, newName, 0, 0, 1);\
}
/* another version of this macro for nodetrees */
@@ -834,9 +837,9 @@ void BKE_all_animdata_fix_paths_rename (const char *prefix, const char *oldName,
NtId_Type *ntp= (NtId_Type *)id; \
if (ntp->nodetree) { \
AnimData *adt2= BKE_animdata_from_id((ID *)ntp); \
- BKE_animdata_fix_paths_rename((ID *)ntp, adt2, prefix, oldName, newName, 0, 0, 1);\
+ BKE_animdata_fix_paths_rename((ID *)ntp, adt2, ref_id, prefix, oldName, newName, 0, 0, 1);\
} \
- BKE_animdata_fix_paths_rename(id, adt, prefix, oldName, newName, 0, 0, 1);\
+ BKE_animdata_fix_paths_rename(id, adt, ref_id, prefix, oldName, newName, 0, 0, 1);\
}
/* nodes */
@@ -903,7 +906,7 @@ KS_Path *BKE_keyingset_find_path (KeyingSet *ks, ID *id, const char group_name[]
KS_Path *ksp;
/* sanity checks */
- if ELEM3(NULL, ks, rna_path, id)
+ if (ELEM3(NULL, ks, rna_path, id))
return NULL;
/* loop over paths in the current KeyingSet, finding the first one where all settings match
@@ -941,14 +944,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;
@@ -956,8 +961,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;
@@ -971,21 +979,21 @@ KS_Path *BKE_keyingset_add_path (KeyingSet *ks, ID *id, const char group_name[],
KS_Path *ksp;
/* sanity checks */
- if ELEM(NULL, ks, rna_path) {
- printf("ERROR: no Keying Set and/or RNA Path to add path with \n");
+ if (ELEM(NULL, ks, rna_path)) {
+ printf("ERROR: no Keying Set and/or RNA Path to add path with\n");
return NULL;
}
/* ID is required for all types of KeyingSets */
if (id == NULL) {
- printf("ERROR: No ID provided for Keying Set Path. \n");
+ printf("ERROR: No ID provided for Keying Set Path\n");
return NULL;
}
/* don't add if there is already a matching KS_Path in the KeyingSet */
if (BKE_keyingset_find_path(ks, id, group_name, rna_path, array_index, groupmode)) {
- if (G.f & G_DEBUG)
- printf("ERROR: destination already exists in Keying Set \n");
+ if (G.debug & G_DEBUG)
+ printf("ERROR: destination already exists in Keying Set\n");
return NULL;
}
@@ -1023,11 +1031,11 @@ KS_Path *BKE_keyingset_add_path (KeyingSet *ks, ID *id, const char group_name[],
void BKE_keyingset_free_path (KeyingSet *ks, KS_Path *ksp)
{
/* sanity check */
- if ELEM(NULL, ks, ksp)
+ if (ELEM(NULL, ks, ksp))
return;
/* free RNA-path info */
- if(ksp->rna_path)
+ if (ksp->rna_path)
MEM_freeN(ksp->rna_path);
/* free path itself */
@@ -1124,17 +1132,14 @@ 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 (G.f & G_DEBUG) {
- printf("Animato: Invalid array index. ID = '%s', '%s[%d]', array length is %d \n",
+ if (array_len && array_index >= array_len) {
+ if (G.debug & 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>",
path, array_index, array_len-1);
}
@@ -1142,8 +1147,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));
@@ -1176,7 +1180,7 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
if (RNA_property_update_check(prop)) {
short skip_updates_hack = 0;
- /* optimisation hacks: skip property updates for those properties
+ /* optimization hacks: skip property updates for those properties
* for we know that which the updates in RNA were really just for
* flushing property editing via UI/Py
*/
@@ -1191,9 +1195,9 @@ 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 */
- if(new_ptr.id.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;
DAG_id_type_tag(G.main, GS(id->name));
@@ -1207,8 +1211,8 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
/* failed to get path */
// XXX don't tag as failed yet though, as there are some legit situations (Action Constraint)
// where some channels will not exist, but shouldn't lock up Action
- if (G.f & G_DEBUG) {
- printf("Animato: Invalid path. ID = '%s', '%s[%d]' \n",
+ if (G.debug & G_DEBUG) {
+ printf("Animato: Invalid path. ID = '%s', '%s[%d]'\n",
(ptr && ptr->id.data) ? (((ID *)ptr->id.data)->name+2) : "<No ID>",
path, array_index);
}
@@ -1251,8 +1255,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);
}
@@ -1277,8 +1280,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 */
@@ -1324,7 +1326,7 @@ static void action_idcode_patch_check (ID *id, bAction *act)
}
else if (act->idroot != idcode) {
/* only report this error if debug mode is enabled (to save performance everywhere else) */
- if (G.f & G_DEBUG) {
+ if (G.debug & G_DEBUG) {
printf("AnimSys Safety Check Failed: Action '%s' is not meant to be used from ID-Blocks of type %d such as '%s'\n",
act->id.name+2, idcode, id->name);
}
@@ -1339,7 +1341,7 @@ void animsys_evaluate_action_group (PointerRNA *ptr, bAction *act, bActionGroup
FCurve *fcu;
/* check if mapper is appropriate for use here (we set to NULL if it's inappropriate) */
- if ELEM(NULL, act, agrp) return;
+ if (ELEM(NULL, act, agrp)) return;
if ((remap) && (remap->target != act)) remap= NULL;
action_idcode_patch_check(ptr->id.data, act);
@@ -1352,8 +1354,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);
}
@@ -1379,7 +1380,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);
@@ -1589,14 +1590,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");
+ if (G.debug & 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.debug & G_DEBUG) printf("NLA Strip Eval: Property not animatable\n");
return NULL;
}
@@ -1676,7 +1677,7 @@ static void nlaevalchan_buffers_accumulate (ListBase *channels, ListBase *tmp_bu
{
NlaEvalChannel *nec, *necn, *necd;
- /* optimise - abort if no channels */
+ /* optimize - abort if no channels */
if (tmp_buffer->first == NULL)
return;
@@ -1712,14 +1713,14 @@ static void nlaeval_fmodifiers_join_stacks (ListBase *result, ListBase *list1, L
FModifier *fcm1, *fcm2;
/* if list1 is invalid... */
- if ELEM(NULL, list1, list1->first) {
+ if (ELEM(NULL, list1, list1->first)) {
if (list2 && list2->first) {
result->first= list2->first;
result->last= list2->last;
}
}
/* if list 2 is invalid... */
- else if ELEM(NULL, list2, list2->first) {
+ else if (ELEM(NULL, list2, list2->first)) {
result->first= list1->first;
result->last= list1->last;
}
@@ -1744,9 +1745,9 @@ static void nlaeval_fmodifiers_split_stacks (ListBase *list1, ListBase *list2)
FModifier *fcm1, *fcm2;
/* if list1/2 is invalid... just skip */
- if ELEM(NULL, list1, list2)
+ if (ELEM(NULL, list1, list2))
return;
- if ELEM(NULL, list1->first, list2->first)
+ if (ELEM(NULL, list1->first, list2->first))
return;
/* get endpoints */
@@ -2144,7 +2145,7 @@ static void animsys_evaluate_overrides (PointerRNA *ptr, AnimData *adt)
/* Overview of how this system works:
* 1) Depsgraph sorts data as necessary, so that data is in an order that means
- * that all dependences are resolved before dependants.
+ * that all dependencies are resolved before dependants.
* 2) All normal animation is evaluated, so that drivers have some basis values to
* work with
* a. NLA stacks are done first, as the Active Actions act as 'tweaking' tracks
@@ -2153,14 +2154,14 @@ static void animsys_evaluate_overrides (PointerRNA *ptr, AnimData *adt)
*
* --------------< often in a separate phase... >------------------
*
- * 3) Drivers/expressions are evaluated on top of this, in an order where dependences are
+ * 3) Drivers/expressions are evaluated on top of this, in an order where dependencies are
* resolved nicely.
* Note: it may be necessary to have some tools to handle the cases where some higher-level
* drivers are added and cause some problematic dependencies that didn't exist in the local levels...
*
* --------------< always executed >------------------
*
- * Maintainance of editability of settings (XXX):
+ * Maintenance of editability of settings (XXX):
* In order to ensure that settings that are animated can still be manipulated in the UI without requiring
* that keyframes are added to prevent these values from being overwritten, we use 'overrides'.
*
@@ -2184,7 +2185,7 @@ void BKE_animsys_evaluate_animdata (Scene *scene, ID *id, AnimData *adt, float c
PointerRNA id_ptr;
/* sanity checks */
- if ELEM(NULL, id, adt)
+ if (ELEM(NULL, id, adt))
return;
/* get pointer to ID-block for RNA to use */
@@ -2195,11 +2196,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
*/
@@ -2232,8 +2231,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();
@@ -2254,8 +2252,8 @@ void BKE_animsys_evaluate_all_animation (Main *main, Scene *scene, float ctime)
{
ID *id;
- if (G.f & G_DEBUG)
- printf("Evaluate all animation - %f \n", ctime);
+ if (G.debug & G_DEBUG)
+ printf("Evaluate all animation - %f\n", ctime);
/* macros for less typing
* - only evaluate animation data for id if it has users (and not just fake ones)
@@ -2288,16 +2286,16 @@ void BKE_animsys_evaluate_all_animation (Main *main, Scene *scene, float ctime)
} \
}
- /* optimisation:
+ /* optimization:
* when there are no actions, don't go over database and loop over heaps of datablocks,
* which should ultimately be empty, since it is not possible for now to have any animation
* without some actions, and drivers wouldn't get affected by any state changes
*
* however, if there are some curves, we will need to make sure that their 'ctime' property gets
- * set correctly, so this optimisation must be skipped in that case...
+ * set correctly, so this optimization must be skipped in that case...
*/
if ((main->action.first == NULL) && (main->curve.first == NULL)) {
- if (G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("\tNo Actions, so no animation needs to be evaluated...\n");
return;
@@ -2347,7 +2345,7 @@ void BKE_animsys_evaluate_all_animation (Main *main, Scene *scene, float ctime)
/* objects */
/* ADT_RECALC_ANIM doesn't need to be supplied here, since object AnimData gets
- * this tagged by Depsgraph on framechange. This optimisation means that objects
+ * this tagged by Depsgraph on framechange. This optimization means that objects
* linked from other (not-visible) scenes will not need their data calculated.
*/
EVAL_ANIM_IDS(main->object.first, 0);
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index bc18332844b..0f3e27a9b6e 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])
@@ -1513,8 +1513,11 @@ void vec_roll_to_mat3(const float vec[3], const float roll, float mat[][3])
*
* was 0.00001, causes bug [#27675], with 0.00000495,
* so a value inbetween these is needed.
+ *
+ * was 0.000001, causes bug [#30438] (which is same as [#27675, imho).
+ * Reseting it to org value seems to cause no more [#23954]...
*/
- if (dot_v3v3(axis,axis) > 0.000001f) {
+ if (dot_v3v3(axis,axis) > 1.0e-13f) {
/* if nor is *not* a multiple of target ... */
normalize_v3(axis);
@@ -1584,7 +1587,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 +1904,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 +2081,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 +2258,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
*/
@@ -2599,3 +2602,54 @@ int get_selected_defgroups(Object *ob, char *dg_selection, int defbase_tot)
return dg_flags_sel_tot;
}
+
+/************** Bounding box ********************/
+int minmax_armature(Object *ob, float min[3], float max[3])
+{
+ bPoseChannel *pchan;
+
+ /* For now, we assume where_is_pose has already been called (hence we have valid data in pachan). */
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ DO_MINMAX(pchan->pose_head, min, max);
+ DO_MINMAX(pchan->pose_tail, min, max);
+ }
+
+ return (ob->pose->chanbase.first != NULL);
+}
+
+void boundbox_armature(Object *ob, float *loc, float *size)
+{
+ BoundBox *bb;
+ float min[3], max[3];
+ float mloc[3], msize[3];
+
+ if (ob->bb == NULL)
+ ob->bb = MEM_callocN(sizeof(BoundBox), "Armature boundbox");
+ bb = ob->bb;
+
+ if (!loc)
+ loc = mloc;
+ if (!size)
+ size = msize;
+
+ INIT_MINMAX(min, max);
+ if (!minmax_armature(ob, min, max)) {
+ min[0] = min[1] = min[2] = -1.0f;
+ max[0] = max[1] = max[2] = 1.0f;
+ }
+
+ mid_v3_v3v3(loc, min, max);
+
+ size[0] = (max[0] - min[0]) / 2.0f;
+ size[1] = (max[1] - min[1]) / 2.0f;
+ size[2] = (max[2] - min[2]) / 2.0f;
+
+ boundbox_set_from_min_max(bb, min, max);
+}
+
+BoundBox *BKE_armature_get_bb(Object *ob)
+{
+ boundbox_armature(ob, NULL, NULL);
+
+ return ob->bb;
+}
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index a8644618945..f111640145f 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -31,13 +31,13 @@
#ifndef _WIN32
- #include <unistd.h> // for read close
+# include <unistd.h> // for read close
#else
- #include <io.h> // for open close read
- #define open _open
- #define read _read
- #define close _close
- #define write _write
+# include <io.h> // for open close read
+# define open _open
+# define read _read
+# define close _close
+# define write _write
#endif
#include <stdlib.h>
@@ -78,6 +78,7 @@
#include "BKE_screen.h"
#include "BKE_sequencer.h"
#include "BKE_sound.h"
+#include "RE_pipeline.h"
#include "BLO_undofile.h"
@@ -127,7 +128,7 @@ void initglobals(void)
strcpy(G.ima, "//");
- if(BLENDER_SUBVERSION)
+ if (BLENDER_SUBVERSION)
BLI_snprintf(versionstr, sizeof(versionstr), "blender.org %d.%d", BLENDER_VERSION, BLENDER_SUBVERSION);
else
BLI_snprintf(versionstr, sizeof(versionstr), "blender.org %d", BLENDER_VERSION);
@@ -174,7 +175,7 @@ static void clean_paths(Main *main)
bpath_traverse_main(main, clean_paths_visit_cb, BPATH_TRAVERSE_SKIP_MULTIFILE, NULL);
- for(scene= main->scene.first; scene; scene= scene->id.next) {
+ for (scene= main->scene.first; scene; scene= scene->id.next) {
BLI_clean(scene->r.pic);
}
}
@@ -193,21 +194,26 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
char mode;
/* 'u' = undo save, 'n' = no UI load */
- if(bfd->main->screen.first==NULL) mode= 'u';
- else if(G.fileflags & G_FILE_NO_UI) mode= 'n';
+ if (bfd->main->screen.first==NULL) mode= 'u';
+ else if (G.fileflags & G_FILE_NO_UI) mode= 'n';
else mode= 0;
recover= (G.fileflags & G_FILE_RECOVER);
+ /* Free all render results, without this stale data gets displayed after loading files */
+ if (mode != 'u') {
+ RE_FreeAllRenderResults();
+ }
+
/* Only make filepaths compatible when loading for real (not undo) */
- if(mode != 'u') {
+ if (mode != 'u') {
clean_paths(bfd->main);
}
/* XXX here the complex windowmanager matching */
/* no load screens? */
- if(mode) {
+ if (mode) {
/* comes from readfile.c */
extern void lib_link_screen_restore(Main *, bScreen *, Scene *);
@@ -219,9 +225,9 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
curscreen= CTX_wm_screen(C);
/* but use new Scene pointer */
curscene= bfd->curscene;
- if(curscene==NULL) curscene= bfd->main->scene.first;
+ if (curscene==NULL) curscene= bfd->main->scene.first;
/* and we enforce curscene to be in current screen */
- if(curscreen) curscreen->scene= curscene; /* can run in bgmode */
+ if (curscreen) curscreen->scene= curscene; /* can run in bgmode */
/* clear_global will free G.main, here we can still restore pointers */
lib_link_screen_restore(bfd->main, curscreen, curscene);
@@ -250,7 +256,7 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
}
/* case G_FILE_NO_UI or no screens in file */
- if(mode) {
+ if (mode) {
/* leave entire context further unaltered? */
CTX_data_scene_set(C, curscene);
}
@@ -267,15 +273,15 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
}
/* this can happen when active scene was lib-linked, and doesnt exist anymore */
- if(CTX_data_scene(C)==NULL) {
+ if (CTX_data_scene(C)==NULL) {
CTX_data_scene_set(C, bfd->main->scene.first);
CTX_wm_screen(C)->scene= CTX_data_scene(C);
curscene= CTX_data_scene(C);
}
/* special cases, override loaded flags: */
- if(G.f != bfd->globalf) {
- const int flags_keep= (G_DEBUG | G_SWAP_EXCHANGE | G_SCRIPT_AUTOEXEC | G_SCRIPT_OVERRIDE_PREF);
+ if (G.f != bfd->globalf) {
+ const int flags_keep = (G_SWAP_EXCHANGE | G_SCRIPT_AUTOEXEC | G_SCRIPT_OVERRIDE_PREF);
bfd->globalf= (bfd->globalf & ~flags_keep) | (G.f & flags_keep);
}
@@ -291,7 +297,7 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
if (G.main->versionfile < 250)
do_versions_ipos_to_animato(G.main);
- if(recover && bfd->filename[0] && G.relbase_valid) {
+ if (recover && bfd->filename[0] && G.relbase_valid) {
/* in case of autosave or quit.blend, use original filename instead
* use relbase_valid to make sure the file is saved, else we get <memory2> in the filename */
filepath= bfd->filename;
@@ -304,7 +310,7 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
#endif
/* these are the same at times, should never copy to the same location */
- if(G.main->name != filepath)
+ if (G.main->name != filepath)
BLI_strncpy(G.main->name, filepath, FILE_MAX);
/* baseflags, groups, make depsgraph, etc */
@@ -317,7 +323,7 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
static int handle_subversion_warning(Main *main, ReportList *reports)
{
- if(main->minversionfile > BLENDER_VERSION ||
+ if (main->minversionfile > BLENDER_VERSION ||
(main->minversionfile == BLENDER_VERSION &&
main->minsubversionfile > BLENDER_SUBVERSION)) {
BKE_reportf(reports, RPT_ERROR, "File written by newer Blender binary: %d.%d , expect loss of data!", main->minversionfile, main->minsubversionfile);
@@ -328,11 +334,11 @@ static int handle_subversion_warning(Main *main, ReportList *reports)
static void keymap_item_free(wmKeyMapItem *kmi)
{
- if(kmi->properties) {
+ if (kmi->properties) {
IDP_FreeProperty(kmi->properties);
MEM_freeN(kmi->properties);
}
- if(kmi->ptr)
+ if (kmi->ptr)
MEM_freeN(kmi->ptr);
}
@@ -342,19 +348,19 @@ void BKE_userdef_free(void)
wmKeyMapItem *kmi;
wmKeyMapDiffItem *kmdi;
- for(km=U.user_keymaps.first; km; km=km->next) {
- for(kmdi=km->diff_items.first; kmdi; kmdi=kmdi->next) {
- if(kmdi->add_item) {
+ for (km=U.user_keymaps.first; km; km=km->next) {
+ for (kmdi=km->diff_items.first; kmdi; kmdi=kmdi->next) {
+ if (kmdi->add_item) {
keymap_item_free(kmdi->add_item);
MEM_freeN(kmdi->add_item);
}
- if(kmdi->remove_item) {
+ if (kmdi->remove_item) {
keymap_item_free(kmdi->remove_item);
MEM_freeN(kmdi->remove_item);
}
}
- for(kmi=km->items.first; kmi; kmi=kmi->next)
+ for (kmi=km->items.first; kmi; kmi=kmi->next)
keymap_item_free(kmi);
BLI_freelistN(&km->diff_items);
@@ -373,14 +379,14 @@ int BKE_read_file(bContext *C, const char *filepath, ReportList *reports)
BlendFileData *bfd;
int retval= BKE_READ_FILE_OK;
- if(strstr(filepath, BLENDER_STARTUP_FILE)==NULL) /* dont print user-pref loading */
+ if (strstr(filepath, BLENDER_STARTUP_FILE)==NULL) /* don't print user-pref loading */
printf("read blend: %s\n", filepath);
bfd= BLO_read_from_file(filepath, reports);
if (bfd) {
- if(bfd->user) retval= BKE_READ_FILE_OK_USERPREFS;
+ if (bfd->user) retval= BKE_READ_FILE_OK_USERPREFS;
- if(0==handle_subversion_warning(bfd->main, reports)) {
+ if (0==handle_subversion_warning(bfd->main, reports)) {
free_main(bfd->main);
MEM_freeN(bfd);
bfd= NULL;
@@ -474,7 +480,7 @@ static int read_undosave(bContext *C, UndoElem *uel)
fileflags= G.fileflags;
G.fileflags |= G_FILE_NO_UI;
- if(UNDO_DISK)
+ if (UNDO_DISK)
success= (BKE_read_file(C, uel->str, NULL) != BKE_READ_FILE_FAIL);
else
success= BKE_read_file_from_memfile(C, &uel->memfile, NULL);
@@ -483,7 +489,7 @@ static int read_undosave(bContext *C, UndoElem *uel)
BLI_strncpy(G.main->name, mainstr, sizeof(G.main->name)); /* restore */
G.fileflags= fileflags;
- if(success) {
+ if (success) {
/* important not to update time here, else non keyed tranforms are lost */
DAG_on_visible_update(G.main, FALSE);
}
@@ -498,11 +504,11 @@ void BKE_write_undo(bContext *C, const char *name)
int nr /*, success */ /* UNUSED */;
UndoElem *uel;
- if( (U.uiflag & USER_GLOBALUNDO)==0) return;
- if( U.undosteps==0) return;
+ if ( (U.uiflag & USER_GLOBALUNDO)==0) return;
+ if ( U.undosteps==0) return;
/* remove all undos after (also when curundo==NULL) */
- while(undobase.last != curundo) {
+ while (undobase.last != curundo) {
uel= undobase.last;
BLI_remlink(&undobase, uel);
BLO_free_memfile(&uel->memfile);
@@ -517,13 +523,13 @@ void BKE_write_undo(bContext *C, const char *name)
/* and limit amount to the maximum */
nr= 0;
uel= undobase.last;
- while(uel) {
+ while (uel) {
nr++;
- if(nr==U.undosteps) break;
+ if (nr==U.undosteps) break;
uel= uel->prev;
}
- if(uel) {
- while(undobase.first!=uel) {
+ if (uel) {
+ while (undobase.first!=uel) {
UndoElem *first= undobase.first;
BLI_remlink(&undobase, first);
/* the merge is because of compression */
@@ -534,7 +540,7 @@ void BKE_write_undo(bContext *C, const char *name)
/* disk save version */
- if(UNDO_DISK) {
+ if (UNDO_DISK) {
static int counter= 0;
char filepath[FILE_MAX];
char numstr[32];
@@ -554,31 +560,31 @@ void BKE_write_undo(bContext *C, const char *name)
else {
MemFile *prevfile=NULL;
- if(curundo->prev) prevfile= &(curundo->prev->memfile);
+ if (curundo->prev) prevfile= &(curundo->prev->memfile);
memused= MEM_get_memory_in_use();
/* success= */ /* UNUSED */ BLO_write_file_mem(CTX_data_main(C), prevfile, &curundo->memfile, G.fileflags);
curundo->undosize= MEM_get_memory_in_use() - memused;
}
- if(U.undomemory != 0) {
+ if (U.undomemory != 0) {
/* limit to maximum memory (afterwards, we can't know in advance) */
totmem= 0;
maxmem= ((uintptr_t)U.undomemory)*1024*1024;
/* keep at least two (original + other) */
uel= undobase.last;
- while(uel && uel->prev) {
+ while (uel && uel->prev) {
totmem+= uel->undosize;
- if(totmem>maxmem) break;
+ if (totmem>maxmem) break;
uel= uel->prev;
}
- if(uel) {
- if(uel->prev && uel->prev->prev)
+ if (uel) {
+ if (uel->prev && uel->prev->prev)
uel= uel->prev;
- while(undobase.first!=uel) {
+ while (undobase.first!=uel) {
UndoElem *first= undobase.first;
BLI_remlink(&undobase, first);
/* the merge is because of compression */
@@ -593,27 +599,26 @@ void BKE_write_undo(bContext *C, const char *name)
void BKE_undo_step(bContext *C, int step)
{
- if(step==0) {
+ if (step==0) {
read_undosave(C, curundo);
}
- else if(step==1) {
+ else if (step==1) {
/* curundo should never be NULL, after restart or load file it should call undo_save */
- if(curundo==NULL || curundo->prev==NULL) ; // XXX error("No undo available");
+ if (curundo==NULL || curundo->prev==NULL) ; // XXX error("No undo available");
else {
- if(G.f & G_DEBUG) printf("undo %s\n", curundo->name);
+ if (G.debug & G_DEBUG) printf("undo %s\n", curundo->name);
curundo= curundo->prev;
read_undosave(C, curundo);
}
}
else {
-
/* curundo has to remain current situation! */
- if(curundo==NULL || curundo->next==NULL) ; // XXX error("No redo available");
+ if (curundo==NULL || curundo->next==NULL) ; // XXX error("No redo available");
else {
read_undosave(C, curundo->next);
curundo= curundo->next;
- if(G.f & G_DEBUG) printf("redo %s\n", curundo->name);
+ if (G.debug & G_DEBUG) printf("redo %s\n", curundo->name);
}
}
}
@@ -623,7 +628,7 @@ void BKE_reset_undo(void)
UndoElem *uel;
uel= undobase.first;
- while(uel) {
+ while (uel) {
BLO_free_memfile(&uel->memfile);
uel= uel->next;
}
@@ -644,7 +649,7 @@ void BKE_undo_name(bContext *C, const char *name)
{
UndoElem *uel= BLI_rfindstring(&undobase, name, offsetof(UndoElem, name));
- if(uel && uel->prev) {
+ if (uel && uel->prev) {
curundo= uel->prev;
BKE_undo_step(C, 0);
}
@@ -653,7 +658,7 @@ void BKE_undo_name(bContext *C, const char *name)
/* name optional */
int BKE_undo_valid(const char *name)
{
- if(name) {
+ if (name) {
UndoElem *uel= BLI_rfindstring(&undobase, name, offsetof(UndoElem, name));
return uel && uel->prev;
}
@@ -667,10 +672,10 @@ const char *BKE_undo_get_name(int nr, int *active)
{
UndoElem *uel= BLI_findlink(&undobase, nr);
- if(active) *active= 0;
+ if (active) *active= 0;
- if(uel) {
- if(active && uel==curundo)
+ if (uel) {
+ if (active && uel==curundo)
*active= 1;
return uel->name;
}
@@ -685,7 +690,7 @@ char *BKE_undo_menu_string(void)
BLI_dynstr_append(ds, "Global Undo History %t");
- for(uel= undobase.first; uel; uel= uel->next) {
+ for (uel= undobase.first; uel; uel= uel->next) {
BLI_dynstr_append(ds, "|");
BLI_dynstr_append(ds, uel->name);
}
@@ -704,34 +709,34 @@ void BKE_undo_save_quit(void)
int file;
char str[FILE_MAX];
- if( (U.uiflag & USER_GLOBALUNDO)==0) return;
+ if ( (U.uiflag & USER_GLOBALUNDO)==0) return;
uel= curundo;
- if(uel==NULL) {
+ if (uel==NULL) {
printf("No undo buffer to save recovery file\n");
return;
}
/* no undo state to save */
- if(undobase.first==undobase.last) return;
+ if (undobase.first==undobase.last) return;
BLI_make_file_string("/", str, BLI_temporary_dir(), "quit.blend");
- file = open(str,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
- if(file == -1) {
+ file = BLI_open(str,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
+ if (file == -1) {
//XXX error("Unable to save %s, check you have permissions", str);
return;
}
chunk= uel->memfile.chunks.first;
- while(chunk) {
- if( write(file, chunk->buf, chunk->size) != chunk->size) break;
+ while (chunk) {
+ if ( write(file, chunk->buf, chunk->size) != chunk->size) break;
chunk= chunk->next;
}
close(file);
- if(chunk) ; //XXX error("Unable to save %s, internal error", str);
+ if (chunk) ; //XXX error("Unable to save %s, internal error", str);
else printf("Saved session recovery to %s\n", str);
}
@@ -741,9 +746,9 @@ Main *BKE_undo_get_main(Scene **scene)
Main *mainp= NULL;
BlendFileData *bfd= BLO_read_from_memfile(G.main, G.main->name, &curundo->memfile, NULL);
- if(bfd) {
+ if (bfd) {
mainp= bfd->main;
- if(scene)
+ if (scene)
*scene= bfd->curscene;
MEM_freeN(bfd);
diff --git a/source/blender/blenkernel/intern/bmfont.c b/source/blender/blenkernel/intern/bmfont.c
index 0211dcdf42c..04ac6cbfb4c 100644
--- a/source/blender/blenkernel/intern/bmfont.c
+++ b/source/blender/blenkernel/intern/bmfont.c
@@ -138,14 +138,14 @@ void readBitmapFontVersion0(ImBuf * ibuf, unsigned char * rect, int step)
bmfont->glyphs[i].sizey = buffer[index++];
bmfont->glyphs[i].advance = buffer[index++];
bmfont->glyphs[i].reserved = buffer[index++];
- if (G.f & G_DEBUG) {
+ if (G.debug & G_DEBUG) {
printfGlyph(&bmfont->glyphs[i]);
}
}
MEM_freeN(buffer);
- if (G.f & G_DEBUG) {
+ if (G.debug & G_DEBUG) {
printf("Oldy = %d Newy = %d\n", ibuf->y, ibuf->y - ysize);
printf("glyphcount = %d\n", glyphcount);
printf("bytes = %d\n", bytes);
@@ -163,7 +163,8 @@ void readBitmapFontVersion0(ImBuf * ibuf, unsigned char * rect, int step)
// we're going to fake alpha here:
calcAlpha(ibuf);
}
- } else {
+ }
+ else {
printf("readBitmapFontVersion0: corrupted bitmapfont\n");
}
}
@@ -183,7 +184,8 @@ void detectBitmapFont(ImBuf *ibuf)
// printf("found 8bit font !\n");
// round y size down
// do the 8 bit font stuff. (not yet)
- } else {
+ }
+ else {
// we try all 4 possible combinations
for (i = 0; i < 4; i++) {
if (rect[0] == 'B' && rect[4] == 'F' && rect[8] == 'N' && rect[12] == 'T') {
@@ -194,7 +196,8 @@ void detectBitmapFont(ImBuf *ibuf)
if (version == 0) {
readBitmapFontVersion0(ibuf, rect, 4);
- } else {
+ }
+ else {
printf("detectBitmapFont :Unsupported version %d\n", version);
}
@@ -223,10 +226,12 @@ int locateGlyph(bmFont *bmfont, unsigned short unicode)
if (bmfont->glyphs[current].unicode == unicode) {
break;
- } else if (bmfont->glyphs[current].unicode < unicode) {
+ }
+ else if (bmfont->glyphs[current].unicode < unicode) {
// have to move up
min = current;
- } else {
+ }
+ else {
// have to move down
max = current;
}
@@ -281,7 +286,7 @@ void matrixGlyph(ImBuf * ibuf, unsigned short unicode,
*advance = 2.0f * bmfont->glyphs[index].advance / (float) bmfont->glyphs[0].advance;
// printfGlyph(&bmfont->glyphs[index]);
- // printf("%c %d %0.5f %0.5f %0.5f %0.5f %0.5f \n", unicode, index, *sizex, *sizey, *transx, *transy, *advance);
+ // printf("%c %d %0.5f %0.5f %0.5f %0.5f %0.5f\n", unicode, index, *sizex, *sizey, *transx, *transy, *advance);
}
}
}
diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c
index f3f4d7c9598..a14988d78b1 100644
--- a/source/blender/blenkernel/intern/boids.c
+++ b/source/blender/blenkernel/intern/boids.c
@@ -83,15 +83,15 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
pd_point_from_particle(bbd->sim, pa, &pa->state, &epoint);
/* first find out goal/predator with highest priority */
- if(effectors) for(cur = effectors->first; cur; cur=cur->next) {
+ if (effectors) for (cur = effectors->first; cur; cur=cur->next) {
Object *eob = cur->ob;
PartDeflect *pd = cur->pd;
- if(gabr->ob && (rule->type != eBoidRuleType_Goal || gabr->ob != bpa->ground)) {
- if(gabr->ob == eob) {
+ if (gabr->ob && (rule->type != eBoidRuleType_Goal || gabr->ob != bpa->ground)) {
+ if (gabr->ob == eob) {
/* TODO: effectors with multiple points */
- if(get_effector_data(cur, &efd, &epoint, 0)) {
- if(cur->pd && cur->pd->forcefield == PFIELD_BOID)
+ if (get_effector_data(cur, &efd, &epoint, 0)) {
+ if (cur->pd && cur->pd->forcefield == PFIELD_BOID)
priority = mul * pd->f_strength * effector_falloff(cur, &efd, &epoint, bbd->part->effector_weights);
else
priority = 1.0;
@@ -101,21 +101,21 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
break;
}
}
- else if(rule->type == eBoidRuleType_Goal && eob == bpa->ground)
+ else if (rule->type == eBoidRuleType_Goal && eob == bpa->ground)
; /* skip current object */
- else if(pd->forcefield == PFIELD_BOID && mul * pd->f_strength > 0.0f && get_effector_data(cur, &cur_efd, &epoint, 0)) {
+ else if (pd->forcefield == PFIELD_BOID && mul * pd->f_strength > 0.0f && get_effector_data(cur, &cur_efd, &epoint, 0)) {
float temp = mul * pd->f_strength * effector_falloff(cur, &cur_efd, &epoint, bbd->part->effector_weights);
- if(temp == 0.0f)
+ if (temp == 0.0f)
; /* do nothing */
- else if(temp > priority) {
+ else if (temp > priority) {
priority = temp;
eff = cur;
efd = cur_efd;
len = efd.distance;
}
/* choose closest object with same priority */
- else if(temp == priority && efd.distance < len) {
+ else if (temp == priority && efd.distance < len) {
eff = cur;
efd = cur_efd;
len = efd.distance;
@@ -124,7 +124,7 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
}
/* if the object doesn't have effector data we have to fake it */
- if(eff == NULL && gabr->ob) {
+ if (eff == NULL && gabr->ob) {
memset(&temp_eff, 0, sizeof(EffectorCache));
temp_eff.ob = gabr->ob;
temp_eff.scene = bbd->sim->scene;
@@ -134,12 +134,12 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
}
/* then use that effector */
- if(priority > (rule->type==eBoidRuleType_Avoid ? gabr->fear_factor : 0.0f)) { /* with avoid, factor is "fear factor" */
+ if (priority > (rule->type==eBoidRuleType_Avoid ? gabr->fear_factor : 0.0f)) { /* with avoid, factor is "fear factor" */
Object *eob = eff->ob;
PartDeflect *pd = eff->pd;
float surface = (pd && pd->shape == PFIELD_SHAPE_SURFACE) ? 1.0f : 0.0f;
- if(gabr->options & BRULE_GOAL_AVOID_PREDICT) {
+ if (gabr->options & BRULE_GOAL_AVOID_PREDICT) {
/* estimate future location of target */
get_effector_data(eff, &efd, &epoint, 1);
@@ -149,14 +149,14 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
efd.distance = len_v3(efd.vec_to_point);
}
- if(rule->type == eBoidRuleType_Goal && boids->options & BOID_ALLOW_CLIMB && surface!=0.0f) {
- if(!bbd->goal_ob || bbd->goal_priority < priority) {
+ if (rule->type == eBoidRuleType_Goal && boids->options & BOID_ALLOW_CLIMB && surface!=0.0f) {
+ if (!bbd->goal_ob || bbd->goal_priority < priority) {
bbd->goal_ob = eob;
copy_v3_v3(bbd->goal_co, efd.loc);
copy_v3_v3(bbd->goal_nor, efd.nor);
}
}
- else if(rule->type == eBoidRuleType_Avoid && bpa->data.mode == eBoidMode_Climbing &&
+ else if (rule->type == eBoidRuleType_Avoid && bpa->data.mode == eBoidMode_Climbing &&
priority > 2.0f * gabr->fear_factor) {
/* detach from surface and try to fly away from danger */
negate_v3_v3(efd.vec_to_point, bpa->gravity);
@@ -168,12 +168,12 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
bbd->wanted_speed = val->max_speed * priority;
/* with goals factor is approach velocity factor */
- if(rule->type == eBoidRuleType_Goal && boids->landing_smoothness > 0.0f) {
+ if (rule->type == eBoidRuleType_Goal && boids->landing_smoothness > 0.0f) {
float len2 = 2.0f*len_v3(pa->prev_state.vel);
surface *= pa->size * boids->height;
- if(len2 > 0.0f && efd.distance - surface < len2) {
+ if (len2 > 0.0f && efd.distance - surface < len2) {
len2 = (efd.distance - surface)/len2;
bbd->wanted_speed *= powf(len2, boids->landing_smoothness);
}
@@ -199,7 +199,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
int ret = 0;
//check deflector objects first
- if(acbr->options & BRULE_ACOLL_WITH_DEFLECTORS && bbd->sim->colliders) {
+ if (acbr->options & BRULE_ACOLL_WITH_DEFLECTORS && bbd->sim->colliders) {
ParticleCollision col;
BVHTreeRayHit hit;
float radius = val->personal_space * pa->size, ray_dir[3];
@@ -213,23 +213,23 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
hit.dist = col.original_ray_length = len_v3(ray_dir);
/* find out closest deflector object */
- for(coll = bbd->sim->colliders->first; coll; coll=coll->next) {
+ for (coll = bbd->sim->colliders->first; coll; coll=coll->next) {
/* don't check with current ground object */
- if(coll->ob == bpa->ground)
+ if (coll->ob == bpa->ground)
continue;
col.current = coll->ob;
col.md = coll->collmd;
- if(col.md && col.md->bvhtree)
+ if (col.md && col.md->bvhtree)
BLI_bvhtree_ray_cast(col.md->bvhtree, col.co1, ray_dir, radius, &hit, BKE_psys_collision_neartest_cb, &col);
}
/* then avoid that object */
- if(hit.index>=0) {
+ if (hit.index>=0) {
t = hit.dist/col.original_ray_length;
/* avoid head-on collision */
- if(dot_v3v3(col.pce.nor, pa->prev_state.ave) < -0.99f) {
+ if (dot_v3v3(col.pce.nor, pa->prev_state.ave) < -0.99f) {
/* don't know why, but uneven range [0.0,1.0] */
/* works much better than even [-1.0,1.0] */
bbd->wanted_co[0] = BLI_frand();
@@ -250,10 +250,9 @@ 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++) {
+ if (neighbors > 1) for (n=1; n<neighbors; n++) {
copy_v3_v3(co1, pa->prev_state.co);
copy_v3_v3(vel1, pa->prev_state.vel);
copy_v3_v3(co2, (bbd->sim->psys->particles + ptn[n].index)->prev_state.co);
@@ -266,10 +265,10 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
inp = dot_v3v3(vec,vec);
/* velocities not parallel */
- if(inp != 0.0f) {
+ if (inp != 0.0f) {
t = -dot_v3v3(loc, vec)/inp;
/* cpa is not too far in the future so investigate further */
- if(t > 0.0f && t < t_min) {
+ if (t > 0.0f && t < t_min) {
madd_v3_v3fl(co1, vel1, t);
madd_v3_v3fl(co2, vel2, t);
@@ -278,7 +277,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
len = normalize_v3(vec);
/* distance of cpa is close enough */
- if(len < 2.0f * val->personal_space * pa->size) {
+ if (len < 2.0f * val->personal_space * pa->size) {
t_min = t;
mul_v3_fl(vec, len_v3(vel1));
@@ -294,12 +293,12 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
if (ptn) { MEM_freeN(ptn); ptn=NULL; }
/* check boids in other systems */
- for(pt=bbd->sim->psys->targets.first; pt; pt=pt->next) {
+ for (pt=bbd->sim->psys->targets.first; pt; pt=pt->next) {
ParticleSystem *epsys = psys_get_target_system(bbd->sim->ob, pt);
- if(epsys) {
+ if (epsys) {
neighbors = BLI_kdtree_range_search(epsys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn);
- if(neighbors > 0) for(n=0; n<neighbors; n++) {
+ if (neighbors > 0) for (n=0; n<neighbors; n++) {
copy_v3_v3(co1, pa->prev_state.co);
copy_v3_v3(vel1, pa->prev_state.vel);
copy_v3_v3(co2, (epsys->particles + ptn[n].index)->prev_state.co);
@@ -312,10 +311,10 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
inp = dot_v3v3(vec,vec);
/* velocities not parallel */
- if(inp != 0.0f) {
+ if (inp != 0.0f) {
t = -dot_v3v3(loc, vec)/inp;
/* cpa is not too far in the future so investigate further */
- if(t > 0.0f && t < t_min) {
+ if (t > 0.0f && t < t_min) {
madd_v3_v3fl(co1, vel1, t);
madd_v3_v3fl(co2, vel2, t);
@@ -324,7 +323,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
len = normalize_v3(vec);
/* distance of cpa is close enough */
- if(len < 2.0f * val->personal_space * pa->size) {
+ if (len < 2.0f * val->personal_space * pa->size) {
t_min = t;
mul_v3_fl(vec, len_v3(vel1));
@@ -342,7 +341,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
}
- if(ptn && nearest==0)
+ if (ptn && nearest==0)
MEM_freeN(ptn);
return ret;
@@ -356,7 +355,7 @@ static int rule_separate(BoidRule *UNUSED(rule), BoidBrainData *bbd, BoidValues
int neighbors = BLI_kdtree_range_search(bbd->sim->psys->tree, 2.0f * val->personal_space * pa->size, pa->prev_state.co, NULL, &ptn);
int ret = 0;
- if(neighbors > 1 && ptn[1].dist!=0.0f) {
+ if (neighbors > 1 && ptn[1].dist!=0.0f) {
sub_v3_v3v3(vec, pa->prev_state.co, bbd->sim->psys->particles[ptn[1].index].state.co);
mul_v3_fl(vec, (2.0f * val->personal_space * pa->size - ptn[1].dist) / ptn[1].dist);
add_v3_v3(bbd->wanted_co, vec);
@@ -367,13 +366,13 @@ static int rule_separate(BoidRule *UNUSED(rule), BoidBrainData *bbd, BoidValues
if (ptn) { MEM_freeN(ptn); ptn=NULL; }
/* check other boid systems */
- for(pt=bbd->sim->psys->targets.first; pt; pt=pt->next) {
+ for (pt=bbd->sim->psys->targets.first; pt; pt=pt->next) {
ParticleSystem *epsys = psys_get_target_system(bbd->sim->ob, pt);
- if(epsys) {
+ if (epsys) {
neighbors = BLI_kdtree_range_search(epsys->tree, 2.0f * val->personal_space * pa->size, pa->prev_state.co, NULL, &ptn);
- if(neighbors > 0 && ptn[0].dist < len) {
+ if (neighbors > 0 && ptn[0].dist < len) {
sub_v3_v3v3(vec, pa->prev_state.co, ptn[0].co);
mul_v3_fl(vec, (2.0f * val->personal_space * pa->size - ptn[0].dist) / ptn[1].dist);
add_v3_v3(bbd->wanted_co, vec);
@@ -395,8 +394,8 @@ static int rule_flock(BoidRule *UNUSED(rule), BoidBrainData *bbd, BoidValues *UN
int n;
int ret = 0;
- if(neighbors > 1) {
- for(n=1; n<neighbors; n++) {
+ if (neighbors > 1) {
+ for (n=1; n<neighbors; n++) {
add_v3_v3(loc, bbd->sim->psys->particles[ptn[n].index].prev_state.co);
add_v3_v3(vec, bbd->sim->psys->particles[ptn[n].index].prev_state.vel);
}
@@ -423,7 +422,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
int n = (flbr->queue_size <= 1) ? bbd->sim->psys->totpart : flbr->queue_size;
int i, ret = 0, p = pa - bbd->sim->psys->particles;
- if(flbr->ob) {
+ if (flbr->ob) {
float vec2[3], t;
/* first check we're not blocking the leader*/
@@ -435,10 +434,10 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
mul = dot_v3v3(vec, vec);
/* leader is not moving */
- if(mul < 0.01f) {
+ if (mul < 0.01f) {
len = len_v3(loc);
/* too close to leader */
- if(len < 2.0f * val->personal_space * pa->size) {
+ if (len < 2.0f * val->personal_space * pa->size) {
copy_v3_v3(bbd->wanted_co, loc);
bbd->wanted_speed = val->max_speed;
return 1;
@@ -448,7 +447,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
t = dot_v3v3(loc, vec)/mul;
/* possible blocking of leader in near future */
- if(t > 0.0f && t < 3.0f) {
+ if (t > 0.0f && t < 3.0f) {
copy_v3_v3(vec2, vec);
mul_v3_fl(vec2, t);
@@ -456,7 +455,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
len = len_v3(vec2);
- if(len < 2.0f * val->personal_space * pa->size) {
+ if (len < 2.0f * val->personal_space * pa->size) {
copy_v3_v3(bbd->wanted_co, vec2);
bbd->wanted_speed = val->max_speed * (3.0f - t)/3.0f;
return 1;
@@ -465,7 +464,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
}
/* not blocking so try to follow leader */
- if(p && flbr->options & BRULE_LEADER_IN_LINE) {
+ if (p && flbr->options & BRULE_LEADER_IN_LINE) {
copy_v3_v3(vec, bbd->sim->psys->particles[p-1].prev_state.vel);
copy_v3_v3(loc, bbd->sim->psys->particles[p-1].prev_state.co);
}
@@ -483,11 +482,11 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
ret = 1;
}
- else if(p % n) {
+ else if (p % n) {
float vec2[3], t, t_min = 3.0f;
/* first check we're not blocking any leaders */
- for(i = 0; i< bbd->sim->psys->totpart; i+=n) {
+ for (i = 0; i< bbd->sim->psys->totpart; i+=n) {
copy_v3_v3(vec, bbd->sim->psys->particles[i].prev_state.vel);
sub_v3_v3v3(loc, pa->prev_state.co, bbd->sim->psys->particles[i].prev_state.co);
@@ -495,10 +494,10 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
mul = dot_v3v3(vec, vec);
/* leader is not moving */
- if(mul < 0.01f) {
+ if (mul < 0.01f) {
len = len_v3(loc);
/* too close to leader */
- if(len < 2.0f * val->personal_space * pa->size) {
+ if (len < 2.0f * val->personal_space * pa->size) {
copy_v3_v3(bbd->wanted_co, loc);
bbd->wanted_speed = val->max_speed;
return 1;
@@ -508,7 +507,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
t = dot_v3v3(loc, vec)/mul;
/* possible blocking of leader in near future */
- if(t > 0.0f && t < t_min) {
+ if (t > 0.0f && t < t_min) {
copy_v3_v3(vec2, vec);
mul_v3_fl(vec2, t);
@@ -516,7 +515,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
len = len_v3(vec2);
- if(len < 2.0f * val->personal_space * pa->size) {
+ if (len < 2.0f * val->personal_space * pa->size) {
t_min = t;
copy_v3_v3(bbd->wanted_co, loc);
bbd->wanted_speed = val->max_speed * (3.0f - t)/3.0f;
@@ -526,10 +525,10 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
}
}
- if(ret) return 1;
+ if (ret) return 1;
/* not blocking so try to follow leader */
- if(flbr->options & BRULE_LEADER_IN_LINE) {
+ if (flbr->options & BRULE_LEADER_IN_LINE) {
copy_v3_v3(vec, bbd->sim->psys->particles[p-1].prev_state.vel);
copy_v3_v3(loc, bbd->sim->psys->particles[p-1].prev_state.co);
}
@@ -555,7 +554,7 @@ static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
BoidRuleAverageSpeed *asbr = (BoidRuleAverageSpeed*)rule;
float vec[3] = {0.0f, 0.0f, 0.0f};
- if(asbr->wander > 0.0f) {
+ if (asbr->wander > 0.0f) {
/* abuse pa->r_ave for wandering */
bpa->wander[0] += asbr->wander * (-1.0f + 2.0f * BLI_frand());
bpa->wander[1] += asbr->wander * (-1.0f + 2.0f * BLI_frand());
@@ -574,7 +573,7 @@ static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
add_v3_v3(bbd->wanted_co, vec);
/* leveling */
- if(asbr->level > 0.0f && psys_uses_gravity(bbd->sim)) {
+ if (asbr->level > 0.0f && psys_uses_gravity(bbd->sim)) {
project_v3_v3v3(vec, bbd->wanted_co, bbd->sim->scene->physics_settings.gravity);
mul_v3_fl(vec, asbr->level);
sub_v3_v3(bbd->wanted_co, vec);
@@ -584,14 +583,14 @@ static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
copy_v3_v3(bbd->wanted_co, pa->prev_state.ave);
/* may happen at birth */
- if(dot_v2v2(bbd->wanted_co,bbd->wanted_co)==0.0f) {
+ if (dot_v2v2(bbd->wanted_co,bbd->wanted_co)==0.0f) {
bbd->wanted_co[0] = 2.0f*(0.5f - BLI_frand());
bbd->wanted_co[1] = 2.0f*(0.5f - BLI_frand());
bbd->wanted_co[2] = 2.0f*(0.5f - BLI_frand());
}
/* leveling */
- if(asbr->level > 0.0f && psys_uses_gravity(bbd->sim)) {
+ if (asbr->level > 0.0f && psys_uses_gravity(bbd->sim)) {
project_v3_v3v3(vec, bbd->wanted_co, bbd->sim->scene->physics_settings.gravity);
mul_v3_fl(vec, asbr->level);
sub_v3_v3(bbd->wanted_co, vec);
@@ -619,7 +618,7 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
/* calculate own group strength */
int neighbors = BLI_kdtree_range_search(bbd->sim->psys->tree, fbr->distance, pa->prev_state.co, NULL, &ptn);
- for(n=0; n<neighbors; n++) {
+ for (n=0; n<neighbors; n++) {
bpa = bbd->sim->psys->particles[ptn[n].index].boid;
health += bpa->data.health;
}
@@ -629,39 +628,39 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
if (ptn) { MEM_freeN(ptn); ptn=NULL; }
/* add other friendlies and calculate enemy strength and find closest enemy */
- for(pt=bbd->sim->psys->targets.first; pt; pt=pt->next) {
+ for (pt=bbd->sim->psys->targets.first; pt; pt=pt->next) {
ParticleSystem *epsys = psys_get_target_system(bbd->sim->ob, pt);
- if(epsys) {
+ if (epsys) {
epars = epsys->particles;
neighbors = BLI_kdtree_range_search(epsys->tree, fbr->distance, pa->prev_state.co, NULL, &ptn);
health = 0.0f;
- for(n=0; n<neighbors; n++) {
+ for (n=0; n<neighbors; n++) {
bpa = epars[ptn[n].index].boid;
health += bpa->data.health;
- if(n==0 && pt->mode==PTARGET_MODE_ENEMY && ptn[n].dist < closest_dist) {
+ if (n==0 && pt->mode==PTARGET_MODE_ENEMY && ptn[n].dist < closest_dist) {
copy_v3_v3(closest_enemy, ptn[n].co);
closest_dist = ptn[n].dist;
enemy_pa = epars + ptn[n].index;
}
}
- if(pt->mode==PTARGET_MODE_ENEMY)
+ if (pt->mode==PTARGET_MODE_ENEMY)
e_strength += epsys->part->boids->strength * health;
- else if(pt->mode==PTARGET_MODE_FRIEND)
+ else if (pt->mode==PTARGET_MODE_FRIEND)
f_strength += epsys->part->boids->strength * health;
if (ptn) { MEM_freeN(ptn); ptn=NULL; }
}
}
/* decide action if enemy presence found */
- if(e_strength > 0.0f) {
+ if (e_strength > 0.0f) {
sub_v3_v3v3(bbd->wanted_co, closest_enemy, pa->prev_state.co);
/* attack if in range */
- if(closest_dist <= bbd->part->boids->range + pa->size + enemy_pa->size) {
+ if (closest_dist <= bbd->part->boids->range + pa->size + enemy_pa->size) {
float damage = BLI_frand();
float enemy_dir[3];
@@ -671,7 +670,7 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
bbd->wanted_speed = 0.0f;
/* must face enemy to fight */
- if(dot_v3v3(pa->prev_state.ave, enemy_dir)>0.5f) {
+ if (dot_v3v3(pa->prev_state.ave, enemy_dir)>0.5f) {
bpa = enemy_pa->boid;
bpa->data.health -= bbd->part->boids->strength * bbd->timestep * ((1.0f-bbd->part->boids->accuracy)*damage + bbd->part->boids->accuracy);
}
@@ -683,9 +682,9 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
/* check if boid doesn't want to fight */
bpa = pa->boid;
- if(bpa->data.health/bbd->part->boids->health * bbd->part->boids->aggression < e_strength / f_strength) {
+ if (bpa->data.health/bbd->part->boids->health * bbd->part->boids->aggression < e_strength / f_strength) {
/* decide to flee */
- if(closest_dist < fbr->flee_distance * fbr->distance) {
+ if (closest_dist < fbr->flee_distance * fbr->distance) {
negate_v3(bbd->wanted_co);
bbd->wanted_speed = val->max_speed;
}
@@ -723,7 +722,7 @@ static void set_boid_values(BoidValues *val, BoidSettings *boids, ParticleData *
{
BoidParticle *bpa = pa->boid;
- if(ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing)) {
+ if (ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing)) {
val->max_speed = boids->land_max_speed * bpa->data.health/boids->health;
val->max_acc = boids->land_max_acc * val->max_speed;
val->max_ave = boids->land_max_ave * (float)M_PI * bpa->data.health/boids->health;
@@ -745,7 +744,7 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float grou
{
BoidParticle *bpa = pa->boid;
- if(bpa->data.mode == eBoidMode_Climbing) {
+ if (bpa->data.mode == eBoidMode_Climbing) {
SurfaceModifierData *surmd = NULL;
float x[3], v[3];
@@ -767,7 +766,7 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float grou
BVHTreeRayHit hit;
float radius = 0.0f, t, ray_dir[3];
- if(!bbd->sim->colliders)
+ if (!bbd->sim->colliders)
return NULL;
/* first try to find below boid */
@@ -779,16 +778,16 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float grou
hit.dist = col.original_ray_length = len_v3(ray_dir);
col.pce.inside = 0;
- for(coll = bbd->sim->colliders->first; coll; coll = coll->next) {
+ for (coll = bbd->sim->colliders->first; coll; coll = coll->next) {
col.current = coll->ob;
col.md = coll->collmd;
col.fac1 = col.fac2 = 0.f;
- if(col.md && col.md->bvhtree)
+ if (col.md && col.md->bvhtree)
BLI_bvhtree_ray_cast(col.md->bvhtree, col.co1, ray_dir, radius, &hit, BKE_psys_collision_neartest_cb, &col);
}
/* then use that object */
- if(hit.index>=0) {
+ if (hit.index>=0) {
t = hit.dist/col.original_ray_length;
interp_v3_v3v3(ground_co, col.co1, col.co2, t);
normalize_v3_v3(ground_nor, col.pce.nor);
@@ -804,15 +803,15 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float grou
hit.index = -1;
hit.dist = col.original_ray_length = len_v3(ray_dir);
- for(coll = bbd->sim->colliders->first; coll; coll = coll->next) {
+ for (coll = bbd->sim->colliders->first; coll; coll = coll->next) {
col.current = coll->ob;
col.md = coll->collmd;
- if(col.md && col.md->bvhtree)
+ if (col.md && col.md->bvhtree)
BLI_bvhtree_ray_cast(col.md->bvhtree, col.co1, ray_dir, radius, &hit, BKE_psys_collision_neartest_cb, &col);
}
/* then use that object */
- if(hit.index>=0) {
+ if (hit.index>=0) {
t = hit.dist/col.original_ray_length;
interp_v3_v3v3(ground_co, col.co1, col.co2, t);
normalize_v3_v3(ground_nor, col.pce.nor);
@@ -831,13 +830,13 @@ static int boid_rule_applies(ParticleData *pa, BoidSettings *UNUSED(boids), Boid
{
BoidParticle *bpa = pa->boid;
- if(rule==NULL)
+ if (rule==NULL)
return 0;
- if(ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing) && rule->flag & BOIDRULE_ON_LAND)
+ if (ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing) && rule->flag & BOIDRULE_ON_LAND)
return 1;
- if(bpa->data.mode==eBoidMode_InAir && rule->flag & BOIDRULE_IN_AIR)
+ if (bpa->data.mode==eBoidMode_InAir && rule->flag & BOIDRULE_IN_AIR)
return 1;
return 0;
@@ -846,12 +845,12 @@ void boids_precalc_rules(ParticleSettings *part, float cfra)
{
BoidState *state = part->boids->states.first;
BoidRule *rule;
- for(; state; state=state->next) {
- for(rule = state->rules.first; rule; rule=rule->next) {
- if(rule->type==eBoidRuleType_FollowLeader) {
+ for (; state; state=state->next) {
+ for (rule = state->rules.first; rule; rule=rule->next) {
+ if (rule->type==eBoidRuleType_FollowLeader) {
BoidRuleFollowLeader *flbr = (BoidRuleFollowLeader*) rule;
- if(flbr->ob && flbr->cfra != cfra) {
+ if (flbr->ob && flbr->cfra != cfra) {
/* save object locations for velocity calculations */
copy_v3_v3(flbr->oloc, flbr->loc);
copy_v3_v3(flbr->loc, flbr->ob->obmat[3]);
@@ -890,16 +889,16 @@ static float boid_goal_signed_dist(float *boid_co, float *goal_co, float *goal_n
/* wanted_co is relative to boid location */
static int apply_boid_rule(BoidBrainData *bbd, BoidRule *rule, BoidValues *val, ParticleData *pa, float fuzziness)
{
- if(rule==NULL)
+ if (rule==NULL)
return 0;
- if(boid_rule_applies(pa, bbd->part->boids, rule)==0)
+ if (boid_rule_applies(pa, bbd->part->boids, rule)==0)
return 0;
- if(boid_rules[rule->type](rule, bbd, val, pa)==0)
+ if (boid_rules[rule->type](rule, bbd, val, pa)==0)
return 0;
- if(fuzziness < 0.0f || compare_len_v3v3(bbd->wanted_co, pa->prev_state.vel, fuzziness * len_v3(pa->prev_state.vel))==0)
+ if (fuzziness < 0.0f || compare_len_v3v3(bbd->wanted_co, pa->prev_state.vel, fuzziness * len_v3(pa->prev_state.vel))==0)
return 1;
else
return 0;
@@ -909,14 +908,14 @@ static BoidState *get_boid_state(BoidSettings *boids, ParticleData *pa)
BoidState *state = boids->states.first;
BoidParticle *bpa = pa->boid;
- for(; state; state=state->next) {
- if(state->id==bpa->data.state_id)
+ for (; state; state=state->next) {
+ if (state->id==bpa->data.state_id)
return state;
}
/* for some reason particle isn't at a valid state */
state = boids->states.first;
- if(state)
+ if (state)
bpa->data.state_id = state->id;
return state;
@@ -938,7 +937,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
int rand;
//BoidCondition *cond;
- if(bpa->data.health <= 0.0f) {
+ if (bpa->data.health <= 0.0f) {
pa->alive = PARS_DYING;
pa->dietime = bbd->cfra;
return;
@@ -946,8 +945,8 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
//planned for near future
//cond = state->conditions.first;
- //for(; cond; cond=cond->next) {
- // if(boid_condition_is_true(cond)) {
+ //for (; cond; cond=cond->next) {
+ // if (boid_condition_is_true(cond)) {
// pa->boid->state_id = cond->state_id;
// state = get_boid_state(boids, pa);
// break; /* only first true condition is used */
@@ -966,8 +965,8 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
switch(state->ruleset_type) {
case eBoidRulesetType_Fuzzy:
{
- for(rule = state->rules.first; rule; rule = rule->next) {
- if(apply_boid_rule(bbd, rule, &val, pa, state->rule_fuzziness))
+ for (rule = state->rules.first; rule; rule = rule->next) {
+ if (apply_boid_rule(bbd, rule, &val, pa, state->rule_fuzziness))
break; /* only first nonzero rule that comes through fuzzy rule is applied */
}
break;
@@ -983,8 +982,8 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
{
float wanted_co[3] = {0.0f, 0.0f, 0.0f}, wanted_speed = 0.0f;
int n = 0;
- for(rule = state->rules.first; rule; rule=rule->next) {
- if(apply_boid_rule(bbd, rule, &val, pa, -1.0f)) {
+ for (rule = state->rules.first; rule; rule=rule->next) {
+ if (apply_boid_rule(bbd, rule, &val, pa, -1.0f)) {
add_v3_v3(wanted_co, bbd->wanted_co);
wanted_speed += bbd->wanted_speed;
n++;
@@ -992,7 +991,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
}
}
- if(n > 1) {
+ if (n > 1) {
mul_v3_fl(wanted_co, 1.0f/(float)n);
wanted_speed /= (float)n;
}
@@ -1005,11 +1004,11 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
}
/* decide on jumping & liftoff */
- if(bpa->data.mode == eBoidMode_OnLand) {
+ if (bpa->data.mode == eBoidMode_OnLand) {
/* fuzziness makes boids capable of misjudgement */
float mul = 1.0f + state->rule_fuzziness;
- if(boids->options & BOID_ALLOW_FLIGHT && bbd->wanted_co[2] > 0.0f) {
+ if (boids->options & BOID_ALLOW_FLIGHT && bbd->wanted_co[2] > 0.0f) {
float cvel[3], dir[3];
copy_v3_v3(dir, pa->prev_state.ave);
@@ -1018,15 +1017,15 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
copy_v3_v3(cvel, bbd->wanted_co);
normalize_v2(cvel);
- if(dot_v2v2(cvel, dir) > 0.95f / mul)
+ if (dot_v2v2(cvel, dir) > 0.95f / mul)
bpa->data.mode = eBoidMode_Liftoff;
}
- else if(val.jump_speed > 0.0f) {
+ else if (val.jump_speed > 0.0f) {
float jump_v[3];
int jump = 0;
/* jump to get to a location */
- if(bbd->wanted_co[2] > 0.0f) {
+ if (bbd->wanted_co[2] > 0.0f) {
float cvel[3], dir[3];
float z_v, ground_v, cur_v;
float len;
@@ -1041,7 +1040,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
/* first of all, are we going in a suitable direction? */
/* or at a suitably slow speed */
- if(dot_v2v2(cvel, dir) > 0.95f / mul || len <= state->rule_fuzziness) {
+ if (dot_v2v2(cvel, dir) > 0.95f / mul || len <= state->rule_fuzziness) {
/* try to reach goal at highest point of the parabolic path */
cur_v = len_v2(pa->prev_state.vel);
z_v = sasqrt(-2.0f * bbd->sim->scene->physics_settings.gravity[2] * bbd->wanted_co[2]);
@@ -1049,7 +1048,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
len = sasqrt((ground_v-cur_v)*(ground_v-cur_v) + z_v*z_v);
- if(len < val.jump_speed * mul || bbd->part->boids->options & BOID_ALLOW_FLIGHT) {
+ if (len < val.jump_speed * mul || bbd->part->boids->options & BOID_ALLOW_FLIGHT) {
jump = 1;
len = MIN2(len, val.jump_speed);
@@ -1066,11 +1065,11 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
}
/* jump to go faster */
- if(jump == 0 && val.jump_speed > val.max_speed && bbd->wanted_speed > val.max_speed) {
+ if (jump == 0 && val.jump_speed > val.max_speed && bbd->wanted_speed > val.max_speed) {
}
- if(jump) {
+ if (jump) {
copy_v3_v3(pa->prev_state.vel, jump_v);
bpa->data.mode = eBoidMode_Falling;
}
@@ -1099,14 +1098,14 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
/* make sure there's something in new velocity, location & rotation */
copy_particle_key(&pa->state,&pa->prev_state,0);
- if(bbd->part->flag & PART_SIZEMASS)
+ if (bbd->part->flag & PART_SIZEMASS)
pa_mass*=pa->size;
/* if boids can't fly they fall to the ground */
- if((boids->options & BOID_ALLOW_FLIGHT)==0 && ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing)==0 && psys_uses_gravity(bbd->sim))
+ if ((boids->options & BOID_ALLOW_FLIGHT)==0 && ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing)==0 && psys_uses_gravity(bbd->sim))
bpa->data.mode = eBoidMode_Falling;
- if(bpa->data.mode == eBoidMode_Falling) {
+ if (bpa->data.mode == eBoidMode_Falling) {
/* Falling boids are only effected by gravity. */
acc[2] = bbd->sim->scene->physics_settings.gravity[2];
}
@@ -1116,11 +1115,11 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
float level = landing_level + 1.0f;
float new_vel[3];
- if(bpa->data.mode == eBoidMode_Liftoff) {
+ if (bpa->data.mode == eBoidMode_Liftoff) {
bpa->data.mode = eBoidMode_InAir;
bpa->ground = boid_find_ground(bbd, pa, ground_co, ground_nor);
}
- else if(bpa->data.mode == eBoidMode_InAir && boids->options & BOID_ALLOW_LAND) {
+ else if (bpa->data.mode == eBoidMode_InAir && boids->options & BOID_ALLOW_LAND) {
/* auto-leveling & landing if close to ground */
bpa->ground = boid_find_ground(bbd, pa, ground_co, ground_nor);
@@ -1130,13 +1129,13 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
landing_level = - boids->landing_smoothness * pa->prev_state.vel[2] * pa_mass;
- if(pa->prev_state.vel[2] < 0.0f) {
- if(level < 1.0f) {
+ if (pa->prev_state.vel[2] < 0.0f) {
+ if (level < 1.0f) {
bbd->wanted_co[0] = bbd->wanted_co[1] = bbd->wanted_co[2] = 0.0f;
bbd->wanted_speed = 0.0f;
bpa->data.mode = eBoidMode_Falling;
}
- else if(level < landing_level) {
+ else if (level < landing_level) {
bbd->wanted_speed *= (level - 1.0f)/landing_level;
bbd->wanted_co[2] *= (level - 1.0f)/landing_level;
}
@@ -1147,7 +1146,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
new_speed = normalize_v3_v3(wanted_dir, bbd->wanted_co);
/* first check if we have valid direction we want to go towards */
- if(new_speed == 0.0f) {
+ if (new_speed == 0.0f) {
copy_v3_v3(new_dir, old_dir);
}
else {
@@ -1159,7 +1158,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
/* choose random direction to turn if wanted velocity */
/* is directly behind regardless of z-coordinate */
- if(dot_v2v2(old_dir2, wanted_dir2) < -0.99f) {
+ if (dot_v2v2(old_dir2, wanted_dir2) < -0.99f) {
wanted_dir[0] = 2.0f*(0.5f - BLI_frand());
wanted_dir[1] = 2.0f*(0.5f - BLI_frand());
wanted_dir[2] = 2.0f*(0.5f - BLI_frand());
@@ -1186,7 +1185,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
/* constrain speed with maximum acceleration */
old_speed = len_v3(pa->prev_state.vel);
- if(bbd->wanted_speed < old_speed)
+ if (bbd->wanted_speed < old_speed)
new_speed = MAX2(bbd->wanted_speed, old_speed - val.max_acc);
else
new_speed = MIN2(bbd->wanted_speed, old_speed + val.max_acc);
@@ -1196,7 +1195,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
mul_v3_fl(new_vel, new_speed);
/* maintain minimum flying velocity if not landing */
- if(level >= landing_level) {
+ if (level >= landing_level) {
float len2 = dot_v2v2(new_vel,new_vel);
float root;
@@ -1225,7 +1224,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
pd_point_from_particle(bbd->sim, pa, &pa->state, &epoint);
pdDoEffectors(bbd->sim->psys->effectors, bbd->sim->colliders, bbd->part->effector_weights, &epoint, force, NULL);
- if(ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing)) {
+ if (ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing)) {
float length = normalize_v3(force);
length = MAX2(0.0f, length - boids->land_stick_force);
@@ -1269,7 +1268,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
grav[2]= bbd->sim->scene->physics_settings.gravity[2] < 0.0f ? -1.0f : 0.0f;
/* don't take forward acceleration into account (better banking) */
- if(dot_v3v3(bpa->data.acc, pa->state.vel) > 0.0f) {
+ if (dot_v3v3(bpa->data.acc, pa->state.vel) > 0.0f) {
project_v3_v3v3(dvec, bpa->data.acc, pa->state.vel);
sub_v3_v3v3(dvec, bpa->data.acc, dvec);
}
@@ -1282,21 +1281,21 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
normalize_v3(bpa->gravity);
/* stick boid on goal when close enough */
- if(bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= pa->size * boids->height) {
+ if (bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= pa->size * boids->height) {
bpa->data.mode = eBoidMode_Climbing;
bpa->ground = bbd->goal_ob;
boid_find_ground(bbd, pa, ground_co, ground_nor);
boid_climb(boids, pa, ground_co, ground_nor);
}
- else if(pa->state.co[2] <= ground_co[2] + pa->size * boids->height) {
+ else if (pa->state.co[2] <= ground_co[2] + pa->size * boids->height) {
/* land boid when below ground */
- if(boids->options & BOID_ALLOW_LAND) {
+ if (boids->options & BOID_ALLOW_LAND) {
pa->state.co[2] = ground_co[2] + pa->size * boids->height;
pa->state.vel[2] = 0.0f;
bpa->data.mode = eBoidMode_OnLand;
}
/* fly above ground */
- else if(bpa->ground) {
+ else if (bpa->ground) {
pa->state.co[2] = ground_co[2] + pa->size * boids->height;
pa->state.vel[2] = 0.0f;
}
@@ -1316,22 +1315,22 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
madd_v3_v3fl(bpa->gravity, grav, dtime);
normalize_v3(bpa->gravity);
- if(boids->options & BOID_ALLOW_LAND) {
+ if (boids->options & BOID_ALLOW_LAND) {
/* stick boid on goal when close enough */
- if(bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= pa->size * boids->height) {
+ if (bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= pa->size * boids->height) {
bpa->data.mode = eBoidMode_Climbing;
bpa->ground = bbd->goal_ob;
boid_find_ground(bbd, pa, ground_co, ground_nor);
boid_climb(boids, pa, ground_co, ground_nor);
}
/* land boid when really near ground */
- else if(pa->state.co[2] <= ground_co[2] + 1.01f * pa->size * boids->height) {
+ else if (pa->state.co[2] <= ground_co[2] + 1.01f * pa->size * boids->height) {
pa->state.co[2] = ground_co[2] + pa->size * boids->height;
pa->state.vel[2] = 0.0f;
bpa->data.mode = eBoidMode_OnLand;
}
/* if we're falling, can fly and want to go upwards lets fly */
- else if(boids->options & BOID_ALLOW_FLIGHT && bbd->wanted_co[2] > 0.0f)
+ else if (boids->options & BOID_ALLOW_FLIGHT && bbd->wanted_co[2] > 0.0f)
bpa->data.mode = eBoidMode_InAir;
}
else
@@ -1360,14 +1359,14 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
case eBoidMode_OnLand:
{
/* stick boid on goal when close enough */
- if(bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= pa->size * boids->height) {
+ if (bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= pa->size * boids->height) {
bpa->data.mode = eBoidMode_Climbing;
bpa->ground = bbd->goal_ob;
boid_find_ground(bbd, pa, ground_co, ground_nor);
boid_climb(boids, pa, ground_co, ground_nor);
}
/* ground is too far away so boid falls */
- else if(pa->state.co[2]-ground_co[2] > 1.1f * pa->size * boids->height)
+ else if (pa->state.co[2]-ground_co[2] > 1.1f * pa->size * boids->height)
bpa->data.mode = eBoidMode_Falling;
else {
/* constrain to surface */
@@ -1375,7 +1374,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
pa->state.vel[2] = 0.0f;
}
- if(boids->banking > 0.0f) {
+ if (boids->banking > 0.0f) {
float grav[3];
/* Don't take gravity's strength in to account, */
/* otherwise amount of banking is hard to control. */
@@ -1399,18 +1398,18 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
/* save direction to state.ave unless the boid is falling */
/* (boids can't effect their direction when falling) */
- if(bpa->data.mode!=eBoidMode_Falling && len_v3(pa->state.vel) > 0.1f*pa->size) {
+ if (bpa->data.mode!=eBoidMode_Falling && len_v3(pa->state.vel) > 0.1f*pa->size) {
copy_v3_v3(pa->state.ave, pa->state.vel);
pa->state.ave[2] *= bbd->part->boids->pitch;
normalize_v3(pa->state.ave);
}
/* apply damping */
- if(ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing))
+ if (ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing))
mul_v3_fl(pa->state.vel, 1.0f - 0.2f*bbd->part->dampfac);
/* calculate rotation matrix based on forward & down vectors */
- if(bpa->data.mode == eBoidMode_InAir) {
+ if (bpa->data.mode == eBoidMode_InAir) {
copy_v3_v3(mat[0], pa->state.ave);
project_v3_v3v3(dvec, bpa->gravity, pa->state.ave);
@@ -1435,7 +1434,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
BoidRule *boid_new_rule(int type)
{
BoidRule *rule = NULL;
- if(type <= 0)
+ if (type <= 0)
return NULL;
switch(type) {
@@ -1502,7 +1501,7 @@ BoidState *boid_new_state(BoidSettings *boids)
BoidState *state = MEM_callocN(sizeof(BoidState), "BoidState");
state->id = boids->last_state_id++;
- if(state->id)
+ if (state->id)
BLI_snprintf(state->name, sizeof(state->name), "State %i", state->id);
else
strcpy(state->name, "State");
@@ -1528,10 +1527,10 @@ BoidState *boid_duplicate_state(BoidSettings *boids, BoidState *state)
}
void boid_free_settings(BoidSettings *boids)
{
- if(boids) {
+ if (boids) {
BoidState *state = boids->states.first;
- for(; state; state=state->next) {
+ for (; state; state=state->next) {
BLI_freelistN(&state->rules);
BLI_freelistN(&state->conditions);
BLI_freelistN(&state->actions);
@@ -1546,7 +1545,7 @@ BoidSettings *boid_copy_settings(BoidSettings *boids)
{
BoidSettings *nboids = NULL;
- if(boids) {
+ if (boids) {
BoidState *state;
BoidState *nstate;
@@ -1556,7 +1555,7 @@ BoidSettings *boid_copy_settings(BoidSettings *boids)
state = boids->states.first;
nstate = nboids->states.first;
- for(; state; state=state->next, nstate=nstate->next) {
+ for (; state; state=state->next, nstate=nstate->next) {
BLI_duplicatelist(&nstate->rules, &state->rules);
BLI_duplicatelist(&nstate->conditions, &state->conditions);
BLI_duplicatelist(&nstate->actions, &state->actions);
@@ -1569,8 +1568,8 @@ BoidState *boid_get_current_state(BoidSettings *boids)
{
BoidState *state = boids->states.first;
- for(; state; state=state->next) {
- if(state->flag & BOIDSTATE_CURRENT)
+ for (; state; state=state->next) {
+ if (state->flag & BOIDSTATE_CURRENT)
break;
}
diff --git a/source/blender/blenkernel/intern/booleanops_mesh.c b/source/blender/blenkernel/intern/booleanops_mesh.c
index ea626df5018..31c90d54d14 100644
--- a/source/blender/blenkernel/intern/booleanops_mesh.c
+++ b/source/blender/blenkernel/intern/booleanops_mesh.c
@@ -208,7 +208,8 @@ CSG_PerformOp(
mesh2->m_vertex_iterator,
InterpFaceVertexData
);
- } else {
+ }
+ else {
success =
CSG_PerformBooleanOperation(
bool_op,
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 9e706c48430..e7ba09d3959 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -197,23 +197,23 @@ void make_local_brush(Brush *brush)
Scene *scene;
int is_local= FALSE, is_lib= FALSE;
- if(brush->id.lib==NULL) return;
+ if (brush->id.lib==NULL) return;
- if(brush->clone.image) {
+ 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);
}
- for(scene= bmain->scene.first; scene && ELEM(0, is_lib, is_local); scene=scene->id.next) {
- if(paint_brush(&scene->toolsettings->imapaint.paint)==brush) {
- if(scene->id.lib) is_lib= TRUE;
+ for (scene= bmain->scene.first; scene && ELEM(0, is_lib, is_local); scene=scene->id.next) {
+ if (paint_brush(&scene->toolsettings->imapaint.paint)==brush) {
+ if (scene->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
}
- if(is_local && is_lib == FALSE) {
+ if (is_local && is_lib == FALSE) {
id_clear_lib_data(bmain, &brush->id);
extern_local_brush(brush);
@@ -223,7 +223,7 @@ void make_local_brush(Brush *brush)
brush->id.us++;
}
}
- else if(is_local && is_lib) {
+ else if (is_local && is_lib) {
Brush *brush_new= copy_brush(brush);
brush_new->id.us= 1; /* only keep fake user */
brush_new->id.flag |= LIB_FAKEUSER;
@@ -231,9 +231,9 @@ void make_local_brush(Brush *brush)
/* Remap paths of new ID using old library as base. */
BKE_id_lib_local_paths(bmain, brush->id.lib, &brush_new->id);
- for(scene= bmain->scene.first; scene; scene=scene->id.next) {
- if(paint_brush(&scene->toolsettings->imapaint.paint)==brush) {
- if(scene->id.lib==NULL) {
+ for (scene= bmain->scene.first; scene; scene=scene->id.next) {
+ if (paint_brush(&scene->toolsettings->imapaint.paint)==brush) {
+ if (scene->id.lib==NULL) {
paint_brush_set(&scene->toolsettings->imapaint.paint, brush_new);
}
}
@@ -248,13 +248,13 @@ void brush_debug_print_state(Brush *br)
brush_set_defaults(&def);
#define BR_TEST(field, t) \
- if(br->field != def.field) \
+ if (br->field != def.field) \
printf("br->" #field " = %" #t ";\n", br->field)
#define BR_TEST_FLAG(_f) \
- if((br->flag & _f) && !(def.flag & _f)) \
+ if ((br->flag & _f) && !(def.flag & _f)) \
printf("br->flag |= " #_f ";\n"); \
- else if(!(br->flag & _f) && (def.flag & _f)) \
+ else if (!(br->flag & _f) && (def.flag & _f)) \
printf("br->flag &= ~" #_f ";\n")
@@ -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);
@@ -414,7 +412,7 @@ void brush_curve_preset(Brush *b, /*CurveMappingPreset*/int preset)
{
CurveMap *cm = NULL;
- if(!b->curve)
+ if (!b->curve)
b->curve = curvemapping_add(1, 0, 0, 1, 1);
cm = b->curve->cm;
@@ -432,12 +430,12 @@ int brush_texture_set_nr(Brush *brush, int nr)
id= (ID *)brush->mtex.tex;
idtest= (ID*)BLI_findlink(&G.main->tex, nr-1);
- if(idtest==NULL) { /* new tex */
- if(id) idtest= (ID *)copy_texture((Tex *)id);
+ if (idtest==NULL) { /* new tex */
+ if (id) idtest= (ID *)copy_texture((Tex *)id);
else idtest= (ID *)add_texture("Tex");
idtest->us--;
}
- if(idtest!=id) {
+ if (idtest!=id) {
brush_texture_delete(brush);
brush->mtex.tex= (Tex*)idtest;
@@ -451,7 +449,7 @@ int brush_texture_set_nr(Brush *brush, int nr)
int brush_texture_delete(Brush *brush)
{
- if(brush->mtex.tex)
+ if (brush->mtex.tex)
brush->mtex.tex->id.us--;
return 1;
@@ -459,10 +457,10 @@ int brush_texture_delete(Brush *brush)
int brush_clone_image_set_nr(Brush *brush, int nr)
{
- if(brush && nr > 0) {
+ if (brush && nr > 0) {
Image *ima= (Image*)BLI_findlink(&G.main->image, nr-1);
- if(ima) {
+ if (ima) {
brush_clone_image_delete(brush);
brush->clone.image= ima;
id_us_plus(&ima->id);
@@ -719,7 +717,7 @@ void brush_scale_unprojected_radius(float *unprojected_radius,
{
float scale = new_brush_size;
/* avoid division by zero */
- if(old_brush_size != 0)
+ if (old_brush_size != 0)
scale /= (float)old_brush_size;
(*unprojected_radius) *= scale;
}
@@ -731,7 +729,7 @@ void brush_scale_size(int *brush_size,
{
float scale = new_unprojected_radius;
/* avoid division by zero */
- if(old_unprojected_radius != 0)
+ if (old_unprojected_radius != 0)
scale /= new_unprojected_radius;
(*brush_size)= (int)((float)(*brush_size) * scale);
}
@@ -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) {
@@ -1079,7 +1077,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2
int totpaintops= 0;
if (pressure == 0.0f) {
- if(painter->lastpressure) // XXX - hack, operator misses
+ if (painter->lastpressure) // XXX - hack, operator misses
pressure= painter->lastpressure;
else
pressure = 1.0f; /* zero pressure == not using tablet */
@@ -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;
@@ -1174,7 +1172,8 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2
painter->accumdistance -= spacing;
startdistance -= spacing;
}
- } else {
+ }
+ else {
brush_jitter_pos(scene, brush, pos, finalpos);
if (painter->cache.enabled)
@@ -1188,8 +1187,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;
@@ -1232,19 +1231,19 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2
/* Uses the brush curve control to find a strength value between 0 and 1 */
float brush_curve_strength_clamp(Brush *br, float p, const float len)
{
- if(p >= len) return 0;
+ if (p >= len) return 0;
else p= p/len;
p= curvemapping_evaluateF(br->curve, 0, p);
- if(p < 0.0f) p= 0.0f;
- else if(p > 1.0f) p= 1.0f;
+ if (p < 0.0f) p= 0.0f;
+ else if (p > 1.0f) p= 1.0f;
return p;
}
/* same as above but can return negative values if the curve enables
* used for sculpt only */
float brush_curve_strength(Brush *br, float p, const float len)
{
- if(p >= len)
+ if (p >= len)
p= 1.0f;
else
p= p/len;
@@ -1261,7 +1260,7 @@ unsigned int *brush_gen_texture_cache(Brush *br, int half_side)
int hasrgb, ix, iy;
int side = half_side * 2;
- if(mtex->tex) {
+ if (mtex->tex) {
float x, y, step = 2.0 / side, co[3];
texcache = MEM_callocN(sizeof(int) * side * side, "Brush texture cache");
@@ -1282,7 +1281,7 @@ unsigned int *brush_gen_texture_cache(Brush *br, int half_side)
* intensity, so calculate one (formula from do_material_tex).
* if the texture didn't give an RGB value, copy the intensity across
*/
- if(hasrgb & TEX_RGB)
+ if (hasrgb & TEX_RGB)
texres.tin = (0.35f * texres.tr + 0.45f *
texres.tg + 0.2f * texres.tb);
@@ -1311,17 +1310,17 @@ struct ImBuf *brush_gen_radial_control_imbuf(Brush *br)
im->rect_float = MEM_callocN(sizeof(float) * side * side, "radial control rect");
im->x = im->y = side;
- for(i=0; i<side; ++i) {
- for(j=0; j<side; ++j) {
+ for (i=0; i<side; ++i) {
+ for (j=0; j<side; ++j) {
float magn= sqrt(pow(i - half, 2) + pow(j - half, 2));
im->rect_float[i*side + j]= brush_curve_strength_clamp(br, magn, half);
}
}
/* Modulate curve with texture */
- if(texcache) {
- for(i=0; i<side; ++i) {
- for(j=0; j<side; ++j) {
+ if (texcache) {
+ for (i=0; i<side; ++i) {
+ for (j=0; j<side; ++j) {
const int col= texcache[i*side+j];
im->rect_float[i*side+j]*= (((char*)&col)[0]+((char*)&col)[1]+((char*)&col)[2])/3.0f/255.0f;
}
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index f4416b8f5d6..d7c7a9a569b 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -51,7 +51,7 @@ float bvhtree_ray_tri_intersection(const BVHTreeRay *ray, const float UNUSED(m_d
{
float dist;
- if(isect_ray_tri_epsilon_v3(ray->origin, ray->direction, v0, v1, v2, &dist, NULL, FLT_EPSILON))
+ if (isect_ray_tri_epsilon_v3(ray->origin, ray->direction, v0, v1, v2, &dist, NULL, FLT_EPSILON))
return dist;
return FLT_MAX;
@@ -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,24 +110,18 @@ 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
- {
- if(fabsf(A00) > FLT_EPSILON)
+ else {
+ if (fabsf(A00) > FLT_EPSILON)
S = -B0/A00;
else
S = 0.0f;
@@ -136,24 +129,20 @@ 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
- {
- if(fabsf(A11) > FLT_EPSILON)
+ else {
+ if (fabsf(A11) > FLT_EPSILON)
T = -B1 / A11;
else
T = 0.0f;
@@ -162,24 +151,20 @@ 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
- {
- if(fabsf(A11) > FLT_EPSILON)
+ else {
+ if (fabsf(A11) > FLT_EPSILON)
T = -B1 / A11;
else
T = 0.0;
@@ -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,69 +194,59 @@ 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)
+ if (fabsf(Det) > FLT_EPSILON)
invDet = 1.0f / Det;
else
invDet = 0.0f;
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
- {
- if(fabsf(denom) > FLT_EPSILON)
+ 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
- {
- if(fabsf(A11) > FLT_EPSILON)
+ else {
+ if (fabsf(A11) > FLT_EPSILON)
T = -B1 / A11;
else
T = 0.0f;
@@ -284,51 +255,43 @@ 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
- {
- if(fabsf(denom) > FLT_EPSILON)
+ 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
- {
- if(fabsf(A00) > FLT_EPSILON)
+ else {
+ if (fabsf(A00) > FLT_EPSILON)
S = -B0 / A00;
else
S = 0.0f;
@@ -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
- {
- if(fabsf(denom) > FLT_EPSILON)
+ 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);
@@ -433,7 +390,7 @@ static void mesh_faces_nearest_point(void *userdata, int index, const float co[3
t2 = t3;
t3 = NULL;
- } while(t2);
+ } while (t2);
}
// Callback to bvh tree raycast. The tree must bust have been built using bvhtree_from_mesh_faces.
@@ -454,13 +411,12 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r
do
{
float dist;
- if(data->sphere_radius == 0.0f)
+ if (data->sphere_radius == 0.0f)
dist = bvhtree_ray_tri_intersection(ray, hit->dist, t0, t1, t2);
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);
@@ -472,7 +428,7 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r
t2 = t3;
t3 = NULL;
- } while(t2);
+ } while (t2);
}
// Callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_edges.
@@ -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,37 +519,34 @@ 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);
- /* BMESH spesific check that we have tessfaces,
- * we _could_ tesselate here but rather not - campbell
+ /* BMESH specific check that we have tessfaces,
+ * we _could_ tessellate here but rather not - campbell
*
* this assert checks we have tessfaces,
* 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).*/
+ 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).*/
/* XXX, for snap only, em & dm are assumed to be aligned, since dm is the em's cage */
- /*Insert BMesh-tesselation triangles into the bvh tree, unless they are hidden
- 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 tessellated
+ * 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 tessellated 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 tessellated 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 tessellated 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 tessellated 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);
@@ -651,12 +598,12 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float
MFace *face = mesh->getTessFaceDataArray(mesh, CD_MFACE);
if (vert != NULL && face != NULL) {
- for(i = 0; i < numFaces; i++) {
+ for (i = 0; i < numFaces; i++) {
float co[4][3];
copy_v3_v3(co[0], vert[ face[i].v1 ].co);
copy_v3_v3(co[1], vert[ face[i].v2 ].co);
copy_v3_v3(co[2], vert[ face[i].v3 ].co);
- if(face[i].v4)
+ if (face[i].v4)
copy_v3_v3(co[3], vert[ face[i].v4 ].co);
BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3);
@@ -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;
@@ -704,21 +649,18 @@ BVHTree* bvhtree_from_mesh_edges(BVHTreeFromMesh *data, DerivedMesh *mesh, float
BVHTree *tree = bvhcache_find(&mesh->bvhCache, BVHTREE_FROM_EDGES);
//Not in cache
- if(tree == NULL)
+ if (tree == NULL)
{
int i;
int numEdges= mesh->getNumEdges(mesh);
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,9 +704,8 @@ 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->cached)
+ if (data->tree) {
+ if (!data->cached)
BLI_bvhtree_free(data->tree);
memset( data, 0, sizeof(*data) );
@@ -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;
}
}
@@ -815,7 +754,7 @@ void bvhcache_insert(BVHCache *cache, BVHTree *tree, int type)
item->type = type;
item->tree = tree;
- BLI_linklist_prepend( cache, item );
+ BLI_linklist_prepend(cache, item);
}
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index f55ceab7de8..12801228950 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -91,23 +91,23 @@ void make_local_camera(Camera *cam)
* - mixed: make copy
*/
- if(cam->id.lib==NULL) return;
- if(cam->id.us==1) {
+ if (cam->id.lib==NULL) return;
+ if (cam->id.us==1) {
id_clear_lib_data(bmain, &cam->id);
return;
}
- for(ob= bmain->object.first; ob && ELEM(0, is_lib, is_local); ob= ob->id.next) {
- if(ob->data==cam) {
- if(ob->id.lib) is_lib= TRUE;
+ for (ob= bmain->object.first; ob && ELEM(0, is_lib, is_local); ob= ob->id.next) {
+ if (ob->data==cam) {
+ if (ob->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
}
- if(is_local && is_lib == FALSE) {
+ if (is_local && is_lib == FALSE) {
id_clear_lib_data(bmain, &cam->id);
}
- else if(is_local && is_lib) {
+ else if (is_local && is_lib) {
Camera *cam_new= copy_camera(cam);
cam_new->id.us= 0;
@@ -115,9 +115,9 @@ void make_local_camera(Camera *cam)
/* Remap paths of new ID using old library as base. */
BKE_id_lib_local_paths(bmain, cam->id.lib, &cam_new->id);
- for(ob= bmain->object.first; ob; ob= ob->id.next) {
- if(ob->data == cam) {
- if(ob->id.lib==NULL) {
+ for (ob= bmain->object.first; ob; ob= ob->id.next) {
+ if (ob->data == cam) {
+ if (ob->id.lib==NULL) {
ob->data= cam_new;
cam_new->id.us++;
cam->id.us--;
@@ -138,10 +138,10 @@ void object_camera_mode(RenderData *rd, Object *cam_ob)
{
rd->mode &= ~(R_ORTHO|R_PANORAMA);
- if(cam_ob && cam_ob->type==OB_CAMERA) {
+ if (cam_ob && cam_ob->type==OB_CAMERA) {
Camera *cam= cam_ob->data;
- if(cam->type == CAM_ORTHO) rd->mode |= R_ORTHO;
- if(cam->flag & CAM_PANORAMA) rd->mode |= R_PANORAMA;
+ if (cam->type == CAM_ORTHO) rd->mode |= R_ORTHO;
+ if (cam->flag & CAM_PANORAMA) rd->mode |= R_PANORAMA;
}
}
@@ -168,7 +168,7 @@ float object_camera_dof_distance(Object *ob)
float camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y)
{
/* sensor size used to fit to. for auto, sensor_x is both x and y. */
- if(sensor_fit == CAMERA_SENSOR_FIT_VERT)
+ if (sensor_fit == CAMERA_SENSOR_FIT_VERT)
return sensor_y;
return sensor_x;
@@ -176,8 +176,8 @@ float camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y)
int camera_sensor_fit(int sensor_fit, float sizex, float sizey)
{
- if(sensor_fit == CAMERA_SENSOR_FIT_AUTO) {
- if(sizex >= sizey)
+ if (sensor_fit == CAMERA_SENSOR_FIT_AUTO) {
+ if (sizex >= sizey)
return CAMERA_SENSOR_FIT_HOR;
else
return CAMERA_SENSOR_FIT_VERT;
@@ -202,14 +202,14 @@ void camera_params_init(CameraParams *params)
void camera_params_from_object(CameraParams *params, Object *ob)
{
- if(!ob)
+ if (!ob)
return;
- if(ob->type==OB_CAMERA) {
+ if (ob->type==OB_CAMERA) {
/* camera object */
Camera *cam= ob->data;
- if(cam->type == CAM_ORTHO)
+ if (cam->type == CAM_ORTHO)
params->is_ortho= TRUE;
params->lens= cam->lens;
params->ortho_scale= cam->ortho_scale;
@@ -224,14 +224,14 @@ void camera_params_from_object(CameraParams *params, Object *ob)
params->clipsta= cam->clipsta;
params->clipend= cam->clipend;
}
- else if(ob->type==OB_LAMP) {
+ else if (ob->type==OB_LAMP) {
/* lamp object */
Lamp *la= ob->data;
float fac= cosf((float)M_PI*la->spotsize/360.0f);
float phi= acos(fac);
params->lens= 16.0f*fac/sinf(phi);
- if(params->lens==0.0f)
+ if (params->lens==0.0f)
params->lens= 35.0f;
params->clipsta= la->clipsta;
@@ -246,7 +246,7 @@ void camera_params_from_view3d(CameraParams *params, View3D *v3d, RegionView3D *
params->clipsta= v3d->near;
params->clipend= v3d->far;
- if(rv3d->persp==RV3D_CAMOB) {
+ if (rv3d->persp==RV3D_CAMOB) {
/* camera view */
camera_params_from_object(params, v3d->camera);
@@ -260,7 +260,7 @@ void camera_params_from_view3d(CameraParams *params, View3D *v3d, RegionView3D *
params->zoom= 1.0f/params->zoom;
}
- else if(rv3d->persp==RV3D_ORTHO) {
+ else if (rv3d->persp==RV3D_ORTHO) {
/* orthographic view */
params->clipend *= 0.5f; // otherwise too extreme low zbuffer quality
params->clipsta= - params->clipend;
@@ -283,10 +283,10 @@ void camera_params_compute_viewplane(CameraParams *params, int winx, int winy, f
/* fields rendering */
params->ycor= yasp/xasp;
- if(params->use_fields)
+ if (params->use_fields)
params->ycor *= 2.0f;
- if(params->is_ortho) {
+ if (params->is_ortho) {
/* orthographic camera */
/* scale == 1.0 means exact 1 to 1 mapping */
pixsize= params->ortho_scale;
@@ -300,7 +300,7 @@ void camera_params_compute_viewplane(CameraParams *params, int winx, int winy, f
/* determine sensor fit */
sensor_fit = camera_sensor_fit(params->sensor_fit, xasp*winx, yasp*winy);
- if(sensor_fit==CAMERA_SENSOR_FIT_HOR)
+ if (sensor_fit==CAMERA_SENSOR_FIT_HOR)
viewfac= winx;
else
viewfac= params->ycor * winy;
@@ -312,10 +312,10 @@ void camera_params_compute_viewplane(CameraParams *params, int winx, int winy, f
/* compute view plane:
* fully centered, zbuffer fills in jittered between -.5 and +.5 */
- viewplane.xmin= -0.5f*(float)winx;
- viewplane.ymin= -0.5f*params->ycor*(float)winy;
- viewplane.xmax= 0.5f*(float)winx;
- viewplane.ymax= 0.5f*params->ycor*(float)winy;
+ viewplane.xmin = -0.5f*(float)winx;
+ viewplane.ymin = -0.5f*params->ycor*(float)winy;
+ viewplane.xmax = 0.5f*(float)winx;
+ viewplane.ymax = 0.5f*params->ycor*(float)winy;
/* lens shift and offset */
dx= params->shiftx*viewfac + winx*params->offsetx;
@@ -327,8 +327,8 @@ void camera_params_compute_viewplane(CameraParams *params, int winx, int winy, f
viewplane.ymax += dy;
/* fields offset */
- if(params->field_second) {
- if(params->field_odd) {
+ if (params->field_second) {
+ if (params->field_odd) {
viewplane.ymin-= 0.5f * params->ycor;
viewplane.ymax-= 0.5f * params->ycor;
}
@@ -356,7 +356,7 @@ void camera_params_compute_matrix(CameraParams *params)
rctf viewplane= params->viewplane;
/* compute projection matrix */
- if(params->is_ortho)
+ if (params->is_ortho)
orthographic_m4(params->winmat, viewplane.xmin, viewplane.xmax,
viewplane.ymin, viewplane.ymax, params->clipsta, params->clipend);
else
@@ -378,7 +378,7 @@ void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const sh
float aspy= (float) scene->r.ysch*scene->r.yasp;
int sensor_fit= camera_sensor_fit(camera->sensor_fit, aspx, aspy);
- if(sensor_fit==CAMERA_SENSOR_FIT_HOR) {
+ if (sensor_fit==CAMERA_SENSOR_FIT_HOR) {
r_asp[0]= 1.0;
r_asp[1]= aspy / aspx;
}
@@ -392,7 +392,7 @@ void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const sh
r_asp[1]= 1.0f;
}
- if(camera->type==CAM_ORTHO) {
+ if (camera->type==CAM_ORTHO) {
facx= 0.5f * camera->ortho_scale * r_asp[0] * scale[0];
facy= 0.5f * camera->ortho_scale * r_asp[1] * scale[1];
r_shift[0]= camera->shiftx * camera->ortho_scale * scale[0];
@@ -408,7 +408,7 @@ void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const sh
*r_drawsize= drawsize / ((scale[0] + scale[1] + scale[2]) / 3.0f);
- if(do_clip) {
+ if (do_clip) {
/* fixed depth, variable size (avoids exceeding clipping range) */
depth = -(camera->clipsta + 0.1f);
fac = depth / (camera->lens/(-half_sensor) * scale[2]);
@@ -465,7 +465,7 @@ static void camera_to_frame_view_cb(const float co[3], void *user_data)
data->tot++;
}
-/* dont move the camera, just yield the fit location */
+/* don't move the camera, just yield the fit location */
/* only valid for perspective cameras */
int camera_view_frame_fit_to_scene(Scene *scene, struct View3D *v3d, Object *camera_ob, float r_co[3])
{
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 39cfd1ad9e6..2b38c5fff4b 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -36,14 +36,6 @@
#include "GL/glew.h"
-#include "BKE_cdderivedmesh.h"
-#include "BKE_global.h"
-#include "BKE_mesh.h"
-#include "BKE_paint.h"
-#include "BKE_utildefines.h"
-#include "BKE_tessmesh.h"
-
-#include "BLI_scanfill.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_edgehash.h"
@@ -52,12 +44,14 @@
#include "BLI_array.h"
#include "BLI_smallhash.h"
#include "BLI_utildefines.h"
+#include "BLI_scanfill.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_global.h"
#include "BKE_mesh.h"
#include "BKE_paint.h"
-
+#include "BKE_utildefines.h"
+#include "BKE_tessmesh.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
@@ -79,7 +73,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;
@@ -91,11 +85,8 @@ typedef struct {
int pbvh_draw;
/* Mesh connectivity */
- struct ListBase *fmap;
- struct IndexNode *fmap_mem;
-
- struct ListBase *pmap;
- struct IndexNode *pmap_mem;
+ MeshElemMap *pmap;
+ int *pmap_mem;
} CDDerivedMesh;
/**************** DerivedMesh interface functions ****************/
@@ -188,8 +179,10 @@ static void cdDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3])
for (i=0; i<dm->numVertData; i++) {
DO_MINMAX(cddm->mvert[i].co, min_r, max_r);
}
- } else {
- min_r[0] = min_r[1] = min_r[2] = max_r[0] = max_r[1] = max_r[2] = 0.0;
+ }
+ else {
+ zero_v3(min_r);
+ zero_v3(max_r);
}
}
@@ -205,7 +198,7 @@ static void cdDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3])
MVert *mv = CDDM_get_verts(dm);
int i;
- for(i = 0; i < dm->numVertData; i++, mv++)
+ for (i = 0; i < dm->numVertData; i++, mv++)
copy_v3_v3(cos_r[i], mv->co);
}
@@ -215,11 +208,11 @@ static void cdDM_getVertNo(DerivedMesh *dm, int index, float no_r[3])
normal_short_to_float_v3(no_r, cddm->mvert[index].no);
}
-static ListBase *cdDM_getPolyMap(Object *ob, DerivedMesh *dm)
+static const MeshElemMap *cdDM_getPolyMap(Object *ob, DerivedMesh *dm)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
- if(!cddm->pmap && ob->type == OB_MESH) {
+ if (!cddm->pmap && ob->type == OB_MESH) {
Mesh *me= ob->data;
create_vert_poly_map(&cddm->pmap, &cddm->pmap_mem,
@@ -237,16 +230,16 @@ 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)
+ if (deformed)
return 0;
return cddm->mvert == me->mvert || ob->sculpt->kb;
@@ -256,31 +249,33 @@ static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
- if(!ob) {
+ if (!ob) {
cddm->pbvh= NULL;
return NULL;
}
- if(!ob->sculpt)
+ if (!ob->sculpt)
return NULL;
- if(ob->sculpt->pbvh) {
+ if (ob->sculpt->pbvh) {
cddm->pbvh= ob->sculpt->pbvh;
cddm->pbvh_draw = can_pbvh_draw(ob, 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 */
- if(!cddm->pbvh && ob->type == OB_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;
cddm->pbvh = BLI_pbvh_new();
cddm->pbvh_draw = can_pbvh_draw(ob, dm);
- BLI_assert(!(me->mface == NULL && me->mpoly != NULL)); /* BMESH ONLY complain if mpoly is valid but not mface */
+
+ BKE_mesh_tessface_ensure(me);
+
BLI_pbvh_build_mesh(cddm->pbvh, me->mface, me->mvert,
me->totface, me->totvert);
- if(ss->modifiers_active && ob->derivedDeform) {
+ if (ss->modifiers_active && ob->derivedDeform) {
DerivedMesh *deformdm= ob->derivedDeform;
float (*vertCos)[3];
int totvert;
@@ -297,13 +292,13 @@ 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;
float (*face_nors)[3];
- if(!cddm->pbvh || !cddm->pbvh_draw || !dm->numTessFaceData)
+ if (!cddm->pbvh || !cddm->pbvh_draw || !dm->numTessFaceData)
return;
face_nors = CustomData_get_layer(&dm->faceData, CD_NORMAL);
@@ -317,16 +312,16 @@ static void cdDM_drawVerts(DerivedMesh *dm)
MVert *mv = cddm->mvert;
int i;
- if( GPU_buffer_legacy(dm) ) {
+ if ( GPU_buffer_legacy(dm) ) {
glBegin(GL_POINTS);
- for(i = 0; i < dm->numVertData; i++, mv++)
+ for (i = 0; i < dm->numVertData; i++, mv++)
glVertex3fv(mv->co);
glEnd();
}
else { /* use OpenGL VBOs or Vertex Arrays instead for better, faster rendering */
GPU_vertex_setup(dm);
- if( !GPU_buffer_legacy(dm) ) {
- if(dm->drawObject->tot_triangle_point)
+ if ( !GPU_buffer_legacy(dm) ) {
+ if (dm->drawObject->tot_triangle_point)
glDrawArrays(GL_POINTS,0, dm->drawObject->tot_triangle_point);
else
glDrawArrays(GL_POINTS,0, dm->drawObject->tot_loose_point);
@@ -342,21 +337,22 @@ static void cdDM_drawUVEdges(DerivedMesh *dm)
MTFace *tf = DM_get_tessface_data_layer(dm, CD_MTFACE);
int i;
- if(mf) {
- if( GPU_buffer_legacy(dm) ) {
+ if (mf) {
+ if ( GPU_buffer_legacy(dm) ) {
glBegin(GL_LINES);
- for(i = 0; i < dm->numTessFaceData; i++, mf++, tf++) {
- if(!(mf->flag&ME_HIDE)) {
+ for (i = 0; i < dm->numTessFaceData; i++, mf++, tf++) {
+ if (!(mf->flag&ME_HIDE)) {
glVertex2fv(tf->uv[0]);
glVertex2fv(tf->uv[1]);
glVertex2fv(tf->uv[1]);
glVertex2fv(tf->uv[2]);
- if(!mf->v4) {
+ if (!mf->v4) {
glVertex2fv(tf->uv[2]);
glVertex2fv(tf->uv[0]);
- } else {
+ }
+ else {
glVertex2fv(tf->uv[2]);
glVertex2fv(tf->uv[3]);
@@ -374,21 +370,21 @@ static void cdDM_drawUVEdges(DerivedMesh *dm)
int curpos = 0;
GPU_uvedge_setup(dm);
- if( !GPU_buffer_legacy(dm) ) {
- for(i = 0; i < dm->numTessFaceData; i++, mf++) {
- if(!(mf->flag&ME_HIDE)) {
+ if ( !GPU_buffer_legacy(dm) ) {
+ for (i = 0; i < dm->numTessFaceData; i++, mf++) {
+ if (!(mf->flag&ME_HIDE)) {
draw = 1;
}
else {
draw = 0;
}
- if( prevdraw != draw ) {
- if( prevdraw > 0 && (curpos-prevstart) > 0) {
+ if ( prevdraw != draw ) {
+ if ( prevdraw > 0 && (curpos-prevstart) > 0) {
glDrawArrays(GL_LINES,prevstart,curpos-prevstart);
}
prevstart = curpos;
}
- if( mf->v4 ) {
+ if ( mf->v4 ) {
curpos += 8;
}
else {
@@ -396,7 +392,7 @@ static void cdDM_drawUVEdges(DerivedMesh *dm)
}
prevdraw = draw;
}
- if( prevdraw > 0 && (curpos-prevstart) > 0 ) {
+ if ( prevdraw > 0 && (curpos-prevstart) > 0 ) {
glDrawArrays(GL_LINES,prevstart,curpos-prevstart);
}
}
@@ -412,11 +408,11 @@ static void cdDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int drawAllEdges
MEdge *medge = cddm->medge;
int i;
- if( GPU_buffer_legacy(dm) ) {
+ if ( GPU_buffer_legacy(dm) ) {
DEBUG_VBO( "Using legacy code. cdDM_drawEdges\n" );
glBegin(GL_LINES);
- for(i = 0; i < dm->numEdgeData; i++, medge++) {
- if((drawAllEdges || (medge->flag&ME_EDGEDRAW))
+ for (i = 0; i < dm->numEdgeData; i++, medge++) {
+ if ((drawAllEdges || (medge->flag&ME_EDGEDRAW))
&& (drawLooseEdges || !(medge->flag&ME_LOOSEEDGE))) {
glVertex3fv(mvert[medge->v1].co);
glVertex3fv(mvert[medge->v2].co);
@@ -430,25 +426,25 @@ static void cdDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int drawAllEdges
int draw = 1;
GPU_edge_setup(dm);
- if( !GPU_buffer_legacy(dm) ) {
- for(i = 0; i < dm->numEdgeData; i++, medge++) {
- if((drawAllEdges || (medge->flag&ME_EDGEDRAW))
+ if ( !GPU_buffer_legacy(dm) ) {
+ for (i = 0; i < dm->numEdgeData; i++, medge++) {
+ if ((drawAllEdges || (medge->flag&ME_EDGEDRAW))
&& (drawLooseEdges || !(medge->flag&ME_LOOSEEDGE))) {
draw = 1;
}
else {
draw = 0;
}
- if( prevdraw != draw ) {
- if( prevdraw > 0 && (i-prevstart) > 0 ) {
- GPU_buffer_draw_elements( dm->drawObject->edges, GL_LINES, prevstart*2, (i-prevstart)*2 );
+ if ( prevdraw != draw ) {
+ if ( prevdraw > 0 && (i-prevstart) > 0 ) {
+ GPU_buffer_draw_elements(dm->drawObject->edges, GL_LINES, prevstart * 2, (i - prevstart) * 2);
}
prevstart = i;
}
prevdraw = draw;
}
- if( prevdraw > 0 && (i-prevstart) > 0 ) {
- GPU_buffer_draw_elements( dm->drawObject->edges, GL_LINES, prevstart*2, (i-prevstart)*2 );
+ if ( prevdraw > 0 && (i-prevstart) > 0 ) {
+ GPU_buffer_draw_elements(dm->drawObject->edges, GL_LINES, prevstart * 2, (i-prevstart) * 2);
}
}
GPU_buffer_unbind();
@@ -462,11 +458,11 @@ static void cdDM_drawLooseEdges(DerivedMesh *dm)
MEdge *medge = cddm->medge;
int i;
- if( GPU_buffer_legacy(dm) ) {
+ if ( GPU_buffer_legacy(dm) ) {
DEBUG_VBO( "Using legacy code. cdDM_drawLooseEdges\n" );
glBegin(GL_LINES);
- for(i = 0; i < dm->numEdgeData; i++, medge++) {
- if(medge->flag&ME_LOOSEEDGE) {
+ for (i = 0; i < dm->numEdgeData; i++, medge++) {
+ if (medge->flag&ME_LOOSEEDGE) {
glVertex3fv(mvert[medge->v1].co);
glVertex3fv(mvert[medge->v2].co);
}
@@ -479,24 +475,24 @@ static void cdDM_drawLooseEdges(DerivedMesh *dm)
int draw = 1;
GPU_edge_setup(dm);
- if( !GPU_buffer_legacy(dm) ) {
- for(i = 0; i < dm->numEdgeData; i++, medge++) {
- if(medge->flag&ME_LOOSEEDGE) {
+ if ( !GPU_buffer_legacy(dm) ) {
+ for (i = 0; i < dm->numEdgeData; i++, medge++) {
+ if (medge->flag&ME_LOOSEEDGE) {
draw = 1;
}
else {
draw = 0;
}
- if( prevdraw != draw ) {
- if( prevdraw > 0 && (i-prevstart) > 0) {
- GPU_buffer_draw_elements( dm->drawObject->edges, GL_LINES, prevstart*2, (i-prevstart)*2 );
+ if ( prevdraw != draw ) {
+ if ( prevdraw > 0 && (i-prevstart) > 0) {
+ GPU_buffer_draw_elements(dm->drawObject->edges, GL_LINES, prevstart * 2, (i - prevstart) * 2);
}
prevstart = i;
}
prevdraw = draw;
}
- if( prevdraw > 0 && (i-prevstart) > 0 ) {
- GPU_buffer_draw_elements( dm->drawObject->edges, GL_LINES, prevstart*2, (i-prevstart)*2 );
+ if ( prevdraw > 0 && (i-prevstart) > 0 ) {
+ GPU_buffer_draw_elements(dm->drawObject->edges, GL_LINES, prevstart * 2, (i - prevstart) * 2);
}
}
GPU_buffer_unbind();
@@ -505,7 +501,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;
@@ -514,40 +510,35 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm,
int a, glmode = -1, shademodel = -1, matnr = -1, drawCurrentMat = 1;
#define PASSVERT(index) { \
- if(shademodel == GL_SMOOTH) { \
+ if (shademodel == GL_SMOOTH) { \
short *no = mvert[index].no; \
glNormal3sv(no); \
} \
glVertex3fv(mvert[index].co); \
}
- if(cddm->pbvh && cddm->pbvh_draw) {
- if(dm->numTessFaceData) {
+ if (cddm->pbvh && cddm->pbvh_draw) {
+ 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);
}
return;
}
- if( GPU_buffer_legacy(dm) ) {
+ if ( GPU_buffer_legacy(dm) ) {
DEBUG_VBO( "Using legacy code. cdDM_drawFacesSolid\n" );
glBegin(glmode = GL_QUADS);
- for(a = 0; a < dm->numTessFaceData; a++, mface++) {
+ for (a = 0; a < dm->numTessFaceData; a++, mface++) {
int new_glmode, new_matnr, new_shademodel;
new_glmode = mface->v4?GL_QUADS:GL_TRIANGLES;
new_matnr = mface->mat_nr + 1;
new_shademodel = (mface->flag & ME_SMOOTH)?GL_SMOOTH:GL_FLAT;
- if(new_glmode != glmode || new_matnr != matnr
+ if (new_glmode != glmode || new_matnr != matnr
|| new_shademodel != shademodel) {
glEnd();
@@ -557,17 +548,18 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm,
glBegin(glmode = new_glmode);
}
- if(drawCurrentMat) {
- if(shademodel == GL_FLAT) {
+ if (drawCurrentMat) {
+ if (shademodel == GL_FLAT) {
if (nors) {
glNormal3fv(nors);
}
else {
/* TODO make this better (cache facenormals as layer?) */
float nor[3];
- if(mface->v4) {
+ if (mface->v4) {
normal_quad_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co, mvert[mface->v4].co);
- } else {
+ }
+ else {
normal_tri_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
}
glNormal3fv(nor);
@@ -577,24 +569,25 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm,
PASSVERT(mface->v1);
PASSVERT(mface->v2);
PASSVERT(mface->v3);
- if(mface->v4) {
+ if (mface->v4) {
PASSVERT(mface->v4);
}
}
- if(nors) nors += 3;
+ if (nors) nors += 3;
}
glEnd();
}
else { /* use OpenGL VBOs or Vertex Arrays instead for better, faster rendering */
GPU_vertex_setup( dm );
GPU_normal_setup( dm );
- if( !GPU_buffer_legacy(dm) ) {
+ if ( !GPU_buffer_legacy(dm) ) {
glShadeModel(GL_SMOOTH);
- for( a = 0; a < dm->drawObject->totmaterial; a++ ) {
- if( setMaterial(dm->drawObject->materials[a].mat_nr+1, NULL) )
+ for (a = 0; a < dm->drawObject->totmaterial; a++) {
+ if (setMaterial(dm->drawObject->materials[a].mat_nr + 1, NULL)) {
glDrawArrays(GL_TRIANGLES, dm->drawObject->materials[a].start,
- dm->drawObject->materials[a].totpoint);
+ dm->drawObject->materials[a].totpoint);
+ }
}
}
GPU_buffer_unbind( );
@@ -604,97 +597,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;
@@ -705,47 +611,48 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
MTFace *tf = DM_get_tessface_data_layer(dm, CD_MTFACE);
int i, j, orig, *index = DM_get_tessface_data_layer(dm, CD_ORIGINDEX);
int startFace = 0 /*, lastFlag = 0xdeadbeef */ /* UNUSED */;
- MCol *mcol = dm->getTessFaceDataArray(dm, CD_WEIGHT_MCOL);
- if(!mcol)
+ MCol *mcol = dm->getTessFaceDataArray(dm, CD_PREVIEW_MCOL);
+ if (!mcol)
mcol = dm->getTessFaceDataArray(dm, CD_MCOL);
cdDM_update_normals_from_pbvh(dm);
- if( GPU_buffer_legacy(dm) ) {
+ if ( GPU_buffer_legacy(dm) ) {
DEBUG_VBO( "Using legacy code. cdDM_drawFacesTex_common\n" );
- for(i = 0; i < dm->numTessFaceData; i++, mf++) {
+ 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);
+ if (drawParams) {
+ draw_option = drawParams(tf? &tf[i]: NULL, (mcol != NULL), mf->mat_nr);
}
else {
- if(index) {
+ if (index) {
orig = *index++;
- if(orig == ORIGINDEX_NONE) { if(nors) nors += 3; continue; }
- if(drawParamsMapped) flag = drawParamsMapped(userData, orig);
- else { if(nors) nors += 3; continue; }
+ if (orig == ORIGINDEX_NONE) { if (nors) nors += 3; continue; }
+ if (drawParamsMapped) draw_option = drawParamsMapped(userData, orig);
+ else { if (nors) nors += 3; continue; }
}
else
- if(drawParamsMapped) flag = drawParamsMapped(userData, i);
- else { if(nors) nors += 3; continue; }
+ 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)) {
+ if (!(mf->flag&ME_SMOOTH)) {
if (nors) {
glNormal3fv(nors);
}
else {
float nor[3];
- if(mf->v4) {
+ if (mf->v4) {
normal_quad_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co, mv[mf->v4].co);
- } else {
+ }
+ else {
normal_tri_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
}
glNormal3fv(nor);
@@ -753,55 +660,57 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
}
glBegin(mf->v4?GL_QUADS:GL_TRIANGLES);
- if(tf) glTexCoord2fv(tf[i].uv[0]);
- if(cp) glColor3ub(cp[3], cp[2], cp[1]);
+ if (tf) glTexCoord2fv(tf[i].uv[0]);
+ if (cp) glColor3ub(cp[3], cp[2], cp[1]);
mvert = &mv[mf->v1];
- if(mf->flag&ME_SMOOTH) glNormal3sv(mvert->no);
+ if (mf->flag&ME_SMOOTH) glNormal3sv(mvert->no);
glVertex3fv(mvert->co);
- if(tf) glTexCoord2fv(tf[i].uv[1]);
- if(cp) glColor3ub(cp[7], cp[6], cp[5]);
+ if (tf) glTexCoord2fv(tf[i].uv[1]);
+ if (cp) glColor3ub(cp[7], cp[6], cp[5]);
mvert = &mv[mf->v2];
- if(mf->flag&ME_SMOOTH) glNormal3sv(mvert->no);
+ if (mf->flag&ME_SMOOTH) glNormal3sv(mvert->no);
glVertex3fv(mvert->co);
- if(tf) glTexCoord2fv(tf[i].uv[2]);
- if(cp) glColor3ub(cp[11], cp[10], cp[9]);
+ if (tf) glTexCoord2fv(tf[i].uv[2]);
+ if (cp) glColor3ub(cp[11], cp[10], cp[9]);
mvert = &mv[mf->v3];
- if(mf->flag&ME_SMOOTH) glNormal3sv(mvert->no);
+ if (mf->flag&ME_SMOOTH) glNormal3sv(mvert->no);
glVertex3fv(mvert->co);
- if(mf->v4) {
- if(tf) glTexCoord2fv(tf[i].uv[3]);
- if(cp) glColor3ub(cp[15], cp[14], cp[13]);
+ if (mf->v4) {
+ if (tf) glTexCoord2fv(tf[i].uv[3]);
+ if (cp) glColor3ub(cp[15], cp[14], cp[13]);
mvert = &mv[mf->v4];
- if(mf->flag&ME_SMOOTH) glNormal3sv(mvert->no);
+ if (mf->flag&ME_SMOOTH) glNormal3sv(mvert->no);
glVertex3fv(mvert->co);
}
glEnd();
}
- if(nors) nors += 3;
+ if (nors) nors += 3;
}
- } else { /* use OpenGL VBOs or Vertex Arrays instead for better, faster rendering */
+ }
+ else { /* use OpenGL VBOs or Vertex Arrays instead for better, faster rendering */
MCol *col = realcol;
- if(!col)
+ if (!col)
col = mcol;
GPU_vertex_setup( dm );
GPU_normal_setup( dm );
GPU_uv_setup( dm );
- if( col != NULL ) {
+ if ( col != NULL ) {
/*if( realcol && dm->drawObject->colType == CD_TEXTURE_MCOL ) {
col = 0;
- } else if( mcol && dm->drawObject->colType == CD_MCOL ) {
+ }
+ else if ( mcol && dm->drawObject->colType == CD_MCOL ) {
col = 0;
}
- if( col != 0 ) {*/
+ if ( col != 0 ) {*/
unsigned char *colors = MEM_mallocN(dm->getNumTessFaces(dm)*4*3*sizeof(unsigned char), "cdDM_drawFacesTex_common");
- for( i=0; i < dm->getNumTessFaces(dm); i++ ) {
- for( j=0; j < 4; j++ ) {
+ for ( i=0; i < dm->getNumTessFaces(dm); i++ ) {
+ for ( j=0; j < 4; j++ ) {
/* bgr -> rgb is intentional (and stupid), but how its stored internally */
colors[i*12+j*3] = col[i*4+j].b;
colors[i*12+j*3+1] = col[i*4+j].g;
@@ -810,57 +719,58 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
}
GPU_color3_upload(dm,colors);
MEM_freeN(colors);
- if(realcol)
+ if (realcol)
dm->drawObject->colType = CD_TEXTURE_MCOL;
- else if(mcol)
+ else if (mcol)
dm->drawObject->colType = CD_MCOL;
//}
GPU_color_setup( dm );
}
- if( !GPU_buffer_legacy(dm) ) {
+ if ( !GPU_buffer_legacy(dm) ) {
int tottri = dm->drawObject->tot_triangle_point/3;
int next_actualFace= dm->drawObject->triangle_to_mface[0];
glShadeModel( GL_SMOOTH );
/* lastFlag = 0; */ /* UNUSED */
- for(i = 0; i < tottri; i++) {
+ 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)
+ 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);
+ if (drawParams) {
+ draw_option = drawParams(tf? &tf[actualFace]: NULL, (mcol != NULL), mf[actualFace].mat_nr);
}
else {
- if(index) {
+ if (index) {
orig = index[actualFace];
- if(orig == ORIGINDEX_NONE) continue;
- if(drawParamsMapped)
- flag = drawParamsMapped(userData, orig);
+ if (orig == ORIGINDEX_NONE) continue;
+ if (drawParamsMapped)
+ draw_option = drawParamsMapped(userData, orig);
}
else
- if(drawParamsMapped)
- flag = drawParamsMapped(userData, actualFace);
+ if (drawParamsMapped)
+ 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) {
+ 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) {
+ 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 (count) {
if (col)
GPU_color_switch(1);
else
@@ -880,57 +790,58 @@ 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);
- if(!mc)
- mc = DM_get_tessface_data_layer(dm, CD_WEIGHT_MCOL);
- if(!mc)
+ if (!mc)
+ mc = DM_get_tessface_data_layer(dm, CD_PREVIEW_MCOL);
+ if (!mc)
mc = DM_get_tessface_data_layer(dm, CD_MCOL);
cdDM_update_normals_from_pbvh(dm);
/* back-buffer always uses legacy since VBO's would need the
* color array temporarily overwritten for drawing, then reset. */
- if( GPU_buffer_legacy(dm) || G.f & G_BACKBUFSEL) {
+ 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;
+ for (i = 0; i < dm->numTessFaceData; i++, mf++) {
+ 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);
+ if (orig == ORIGINDEX_NONE)
+ 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)
+ 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);
@@ -940,36 +851,38 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
}
else {
float nor[3];
- if(mf->v4) {
+ if (mf->v4) {
normal_quad_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co, mv[mf->v4].co);
- } else {
+ }
+ else {
normal_tri_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
}
glNormal3fv(nor);
}
- if(cp) glColor3ub(cp[3], cp[2], cp[1]);
+ if (cp) glColor3ub(cp[3], cp[2], cp[1]);
glVertex3fv(mv[mf->v1].co);
- if(cp) glColor3ub(cp[7], cp[6], cp[5]);
+ if (cp) glColor3ub(cp[7], cp[6], cp[5]);
glVertex3fv(mv[mf->v2].co);
- if(cp) glColor3ub(cp[11], cp[10], cp[9]);
+ if (cp) glColor3ub(cp[11], cp[10], cp[9]);
glVertex3fv(mv[mf->v3].co);
- if(mf->v4) {
- if(cp) glColor3ub(cp[15], cp[14], cp[13]);
+ if (mf->v4) {
+ if (cp) glColor3ub(cp[15], cp[14], cp[13]);
glVertex3fv(mv[mf->v4].co);
}
- } else {
- if(cp) glColor3ub(cp[3], cp[2], cp[1]);
+ }
+ else {
+ if (cp) glColor3ub(cp[3], cp[2], cp[1]);
glNormal3sv(mv[mf->v1].no);
glVertex3fv(mv[mf->v1].co);
- if(cp) glColor3ub(cp[7], cp[6], cp[5]);
+ if (cp) glColor3ub(cp[7], cp[6], cp[5]);
glNormal3sv(mv[mf->v2].no);
glVertex3fv(mv[mf->v2].co);
- if(cp) glColor3ub(cp[11], cp[10], cp[9]);
+ if (cp) glColor3ub(cp[11], cp[10], cp[9]);
glNormal3sv(mv[mf->v3].no);
glVertex3fv(mv[mf->v3].co);
- if(mf->v4) {
- if(cp) glColor3ub(cp[15], cp[14], cp[13]);
+ if (mf->v4) {
+ if (cp) glColor3ub(cp[15], cp[14], cp[13]);
glNormal3sv(mv[mf->v4].no);
glVertex3fv(mv[mf->v4].co);
}
@@ -985,16 +898,16 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
int prevstart = 0;
GPU_vertex_setup(dm);
GPU_normal_setup(dm);
- if( useColors && mc )
+ if ( useColors && mc )
GPU_color_setup(dm);
- if( !GPU_buffer_legacy(dm) ) {
+ if ( !GPU_buffer_legacy(dm) ) {
int tottri = dm->drawObject->tot_triangle_point/3;
glShadeModel(GL_SMOOTH);
- if(tottri == 0) {
+ if (tottri == 0) {
/* avoid buffer problems in following code */
}
- if(setDrawOptions == NULL) {
+ if (setDrawOptions == NULL) {
/* just draw the entire face array */
glDrawArrays(GL_TRIANGLES, 0, (tottri) * 3);
}
@@ -1002,43 +915,44 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
/* we need to check if the next material changes */
int next_actualFace= dm->drawObject->triangle_to_mface[0];
- for( i = 0; i < tottri; i++ ) {
+ for ( i = 0; i < tottri; i++ ) {
//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)
+ if (i != tottri-1)
next_actualFace= dm->drawObject->triangle_to_mface[i+1];
orig= (index==NULL) ? actualFace : index[actualFace];
- if(orig == ORIGINDEX_NONE)
- draw= setMaterial(mface->mat_nr + 1, NULL);
+ if (orig == ORIGINDEX_NONE)
+ 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;
- if(!flush && compareDrawOptions) {
+ if (!flush && compareDrawOptions) {
flush|= compareDrawOptions(userData, actualFace, next_actualFace) == 0;
}
- if(flush) {
+ 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)
+ if (count)
glDrawArrays(GL_TRIANGLES, first, count);
prevstart = i + 1;
@@ -1053,8 +967,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);
@@ -1065,25 +979,25 @@ static void cddm_draw_attrib_vertex(DMVertexAttribs *attribs, MVert *mvert, int
int b;
/* orco texture coordinates */
- if(attribs->totorco) {
- if(attribs->orco.glTexco)
+ if (attribs->totorco) {
+ if (attribs->orco.glTexco)
glTexCoord3fv(attribs->orco.array[index]);
else
glVertexAttrib3fvARB(attribs->orco.glIndex, attribs->orco.array[index]);
}
/* uv texture coordinates */
- for(b = 0; b < attribs->tottface; b++) {
+ for (b = 0; b < attribs->tottface; b++) {
MTFace *tf = &attribs->tface[b].array[a];
- if(attribs->tface[b].glTexco)
+ if (attribs->tface[b].glTexco)
glTexCoord2fv(tf->uv[vert]);
else
glVertexAttrib2fvARB(attribs->tface[b].glIndex, tf->uv[vert]);
}
/* vertex colors */
- for(b = 0; b < attribs->totmcol; b++) {
+ for (b = 0; b < attribs->totmcol; b++) {
MCol *cp = &attribs->mcol[b].array[a*4 + vert];
GLubyte col[4];
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
@@ -1091,13 +1005,13 @@ static void cddm_draw_attrib_vertex(DMVertexAttribs *attribs, MVert *mvert, int
}
/* tangent for normal mapping */
- if(attribs->tottang) {
+ if (attribs->tottang) {
float *tang = attribs->tang.array[a*4 + vert];
glVertexAttrib4fvARB(attribs->tang.glIndex, tang);
}
/* vertex normal */
- if(smoothnormal)
+ if (smoothnormal)
glNormal3sv(mvert[index].no);
/* vertex coordinate */
@@ -1105,8 +1019,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;
@@ -1126,52 +1040,53 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
glShadeModel(GL_SMOOTH);
- if( GPU_buffer_legacy(dm) || setDrawOptions != NULL ) {
+ if ( GPU_buffer_legacy(dm) || setDrawOptions != NULL ) {
DEBUG_VBO( "Using legacy code. cdDM_drawMappedFacesGLSL\n" );
memset(&attribs, 0, sizeof(attribs));
glBegin(GL_QUADS);
- for(a = 0; a < dm->numTessFaceData; a++, mface++) {
+ for (a = 0; a < dm->numTessFaceData; a++, mface++) {
const int smoothnormal = (mface->flag & ME_SMOOTH);
new_matnr = mface->mat_nr + 1;
- if(new_matnr != matnr) {
+ if (new_matnr != matnr) {
glEnd();
dodraw = setMaterial(matnr = new_matnr, &gattribs);
- if(dodraw)
+ if (dodraw)
DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs);
glBegin(GL_QUADS);
}
- if(!dodraw) {
+ if (!dodraw) {
continue;
}
- else if(setDrawOptions) {
+ else if (setDrawOptions) {
orig = (index)? index[a]: a;
- if(orig == ORIGINDEX_NONE) {
+ if (orig == ORIGINDEX_NONE) {
/* since the material is set by setMaterial(), faces with no
* origin can be assumed to be generated by a modifier */
/* continue */
}
- else if(!setDrawOptions(userData, orig))
+ else if (setDrawOptions(userData, orig) == DM_DRAW_OPTION_SKIP)
continue;
}
- if(!smoothnormal) {
- if(nors) {
+ if (!smoothnormal) {
+ if (nors) {
glNormal3fv(nors[a]);
}
else {
/* TODO ideally a normal layer should always be available */
float nor[3];
- if(mface->v4) {
+ if (mface->v4) {
normal_quad_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co, mvert[mface->v4].co);
- } else {
+ }
+ else {
normal_tri_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
}
glNormal3fv(nor);
@@ -1182,7 +1097,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
cddm_draw_attrib_vertex(&attribs, mvert, a, mface->v2, 1, smoothnormal);
cddm_draw_attrib_vertex(&attribs, mvert, a, mface->v3, 2, smoothnormal);
- if(mface->v4)
+ if (mface->v4)
cddm_draw_attrib_vertex(&attribs, mvert, a, mface->v4, 3, smoothnormal);
else
cddm_draw_attrib_vertex(&attribs, mvert, a, mface->v3, 2, smoothnormal);
@@ -1203,21 +1118,21 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
GPU_vertex_setup(dm);
GPU_normal_setup(dm);
- if( !GPU_buffer_legacy(dm) ) {
- for( i = 0; i < dm->drawObject->tot_triangle_point/3; i++ ) {
+ if ( !GPU_buffer_legacy(dm) ) {
+ for ( i = 0; i < dm->drawObject->tot_triangle_point/3; i++ ) {
a = dm->drawObject->triangle_to_mface[i];
mface = mf + a;
new_matnr = mface->mat_nr + 1;
- if(new_matnr != matnr ) {
+ if (new_matnr != matnr ) {
numfaces = curface - start;
- if( numfaces > 0 ) {
+ if ( numfaces > 0 ) {
- if( dodraw ) {
+ if ( dodraw ) {
- if( numdata != 0 ) {
+ if ( numdata != 0 ) {
GPU_buffer_unlock(buffer);
@@ -1226,7 +1141,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
glDrawArrays(GL_TRIANGLES,start*3,numfaces*3);
- if( numdata != 0 ) {
+ if ( numdata != 0 ) {
GPU_buffer_free(buffer);
@@ -1239,43 +1154,43 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
start = curface;
/* prevdraw = dodraw; */ /* UNUSED */
dodraw = setMaterial(matnr = new_matnr, &gattribs);
- if(dodraw) {
+ if (dodraw) {
DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs);
- if(attribs.totorco) {
+ if (attribs.totorco) {
datatypes[numdata].index = attribs.orco.glIndex;
datatypes[numdata].size = 3;
datatypes[numdata].type = GL_FLOAT;
numdata++;
}
- for(b = 0; b < attribs.tottface; b++) {
+ for (b = 0; b < attribs.tottface; b++) {
datatypes[numdata].index = attribs.tface[b].glIndex;
datatypes[numdata].size = 2;
datatypes[numdata].type = GL_FLOAT;
numdata++;
}
- for(b = 0; b < attribs.totmcol; b++) {
+ for (b = 0; b < attribs.totmcol; b++) {
datatypes[numdata].index = attribs.mcol[b].glIndex;
datatypes[numdata].size = 4;
datatypes[numdata].type = GL_UNSIGNED_BYTE;
numdata++;
}
- if(attribs.tottang) {
+ if (attribs.tottang) {
datatypes[numdata].index = attribs.tang.glIndex;
datatypes[numdata].size = 4;
datatypes[numdata].type = GL_FLOAT;
numdata++;
}
- if( numdata != 0 ) {
+ if ( numdata != 0 ) {
elementsize = GPU_attrib_element_size( datatypes, numdata );
buffer = GPU_buffer_alloc( elementsize*dm->drawObject->tot_triangle_point);
- if( buffer == NULL ) {
+ if ( buffer == NULL ) {
GPU_buffer_unbind();
dm->drawObject->legacy = 1;
return;
}
varray = GPU_buffer_lock_stream(buffer);
- if( varray == NULL ) {
+ if ( varray == NULL ) {
GPU_buffer_unbind();
GPU_buffer_free(buffer);
dm->drawObject->legacy = 1;
@@ -1283,7 +1198,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
}
}
else {
- /* if the buffer was set, dont use it again.
+ /* if the buffer was set, don't use it again.
* prevdraw was assumed true but didnt run so set to false - [#21036] */
/* prevdraw= 0; */ /* UNUSED */
buffer= NULL;
@@ -1291,15 +1206,15 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
}
}
- if(dodraw && numdata != 0 ) {
+ if (dodraw && numdata != 0 ) {
offset = 0;
- if(attribs.totorco) {
+ if (attribs.totorco) {
copy_v3_v3((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v1]);
copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v2]);
copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v3]);
offset += sizeof(float)*3;
}
- for(b = 0; b < attribs.tottface; b++) {
+ for (b = 0; b < attribs.tottface; b++) {
MTFace *tf = &attribs.tface[b].array[a];
copy_v2_v2((float *)&varray[elementsize*curface*3+offset],tf->uv[0]);
copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[1]);
@@ -1307,7 +1222,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[2]);
offset += sizeof(float)*2;
}
- for(b = 0; b < attribs.totmcol; b++) {
+ for (b = 0; b < attribs.totmcol; b++) {
MCol *cp = &attribs.mcol[b].array[a*4 + 0];
GLubyte col[4];
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
@@ -1320,7 +1235,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset+elementsize*2], (char *)col);
offset += sizeof(unsigned char)*4;
}
- if(attribs.tottang) {
+ if (attribs.tottang) {
float *tang = attribs.tang.array[a*4 + 0];
copy_v4_v4((float *)&varray[elementsize*curface*3+offset], tang);
tang = attribs.tang.array[a*4 + 1];
@@ -1332,23 +1247,23 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
(void)offset;
}
curface++;
- if(mface->v4) {
- if(dodraw && numdata != 0 ) {
+ if (mface->v4) {
+ if (dodraw && numdata != 0 ) {
offset = 0;
- if(attribs.totorco) {
+ if (attribs.totorco) {
copy_v3_v3((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v3]);
copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v4]);
copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v1]);
offset += sizeof(float)*3;
}
- for(b = 0; b < attribs.tottface; b++) {
+ for (b = 0; b < attribs.tottface; b++) {
MTFace *tf = &attribs.tface[b].array[a];
copy_v2_v2((float *)&varray[elementsize*curface*3+offset],tf->uv[2]);
copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[3]);
copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[0]);
offset += sizeof(float)*2;
}
- for(b = 0; b < attribs.totmcol; b++) {
+ for (b = 0; b < attribs.totmcol; b++) {
MCol *cp = &attribs.mcol[b].array[a*4 + 2];
GLubyte col[4];
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
@@ -1361,7 +1276,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset+elementsize*2], (char *)col);
offset += sizeof(unsigned char)*4;
}
- if(attribs.tottang) {
+ if (attribs.tottang) {
float *tang = attribs.tang.array[a*4 + 2];
copy_v4_v4((float *)&varray[elementsize*curface*3+offset], tang);
tang = attribs.tang.array[a*4 + 3];
@@ -1377,9 +1292,9 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
}
}
numfaces = curface - start;
- if( numfaces > 0 ) {
- if( dodraw ) {
- if( numdata != 0 ) {
+ if ( numfaces > 0 ) {
+ if ( dodraw ) {
+ if ( numdata != 0 ) {
GPU_buffer_unlock(buffer);
GPU_interleaved_attrib_setup(buffer,datatypes,numdata);
}
@@ -1394,7 +1309,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);
}
@@ -1422,13 +1337,13 @@ static void cdDM_drawMappedFacesMat(DerivedMesh *dm,
glBegin(GL_QUADS);
- for(a = 0; a < dm->numTessFaceData; a++, mf++) {
+ for (a = 0; a < dm->numTessFaceData; a++, mf++) {
const int smoothnormal = (mf->flag & ME_SMOOTH);
/* material */
new_matnr = mf->mat_nr + 1;
- if(new_matnr != matnr) {
+ if (new_matnr != matnr) {
glEnd();
setMaterial(userData, matnr = new_matnr, &gattribs);
@@ -1438,23 +1353,23 @@ static void cdDM_drawMappedFacesMat(DerivedMesh *dm,
}
/* skipping faces */
- if(setFace) {
+ if (setFace) {
orig = (index)? index[a]: a;
- if(orig != ORIGINDEX_NONE && !setFace(userData, orig))
+ if (orig != ORIGINDEX_NONE && !setFace(userData, orig))
continue;
}
/* smooth normal */
- if(!smoothnormal) {
- if(nors) {
+ if (!smoothnormal) {
+ if (nors) {
glNormal3fv(nors[a]);
}
else {
/* TODO ideally a normal layer should always be available */
float nor[3];
- if(mf->v4)
+ if (mf->v4)
normal_quad_v3( nor,mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co, mvert[mf->v4].co);
else
normal_tri_v3( nor,mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co);
@@ -1468,7 +1383,7 @@ static void cdDM_drawMappedFacesMat(DerivedMesh *dm,
cddm_draw_attrib_vertex(&attribs, mvert, a, mf->v2, 1, smoothnormal);
cddm_draw_attrib_vertex(&attribs, mvert, a, mf->v3, 2, smoothnormal);
- if(mf->v4)
+ if (mf->v4)
cddm_draw_attrib_vertex(&attribs, mvert, a, mf->v4, 3, smoothnormal);
else
cddm_draw_attrib_vertex(&attribs, mvert, a, mf->v3, 2, smoothnormal);
@@ -1478,7 +1393,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;
@@ -1486,15 +1401,15 @@ static void cdDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *us
int i, orig, *index = DM_get_edge_data_layer(dm, CD_ORIGINDEX);
glBegin(GL_LINES);
- for(i = 0; i < dm->numEdgeData; i++, edge++) {
- if(index) {
+ for (i = 0; i < dm->numEdgeData; i++, edge++) {
+ if (index) {
orig = *index++;
- if(setDrawOptions && orig == ORIGINDEX_NONE) continue;
+ if (setDrawOptions && orig == ORIGINDEX_NONE) continue;
}
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);
}
@@ -1511,10 +1426,10 @@ static void cdDM_foreachMappedVert(
MVert *mv = CDDM_get_verts(dm);
int i, orig, *index = DM_get_vert_data_layer(dm, CD_ORIGINDEX);
- for(i = 0; i < dm->numVertData; i++, mv++) {
- if(index) {
+ for (i = 0; i < dm->numVertData; i++, mv++) {
+ if (index) {
orig = *index++;
- if(orig == ORIGINDEX_NONE) continue;
+ if (orig == ORIGINDEX_NONE) continue;
func(userData, orig, mv->co, NULL, mv->no);
}
else
@@ -1533,10 +1448,10 @@ static void cdDM_foreachMappedEdge(
MEdge *med = cddm->medge;
int i, orig, *index = DM_get_edge_data_layer(dm, CD_ORIGINDEX);
- for(i = 0; i < dm->numEdgeData; i++, med++) {
+ for (i = 0; i < dm->numEdgeData; i++, med++) {
if (index) {
orig = *index++;
- if(orig == ORIGINDEX_NONE) continue;
+ if (orig == ORIGINDEX_NONE) continue;
func(userData, orig, mv[med->v1].co, mv[med->v2].co);
}
else
@@ -1558,13 +1473,13 @@ static void cdDM_foreachMappedFaceCenter(
index = CustomData_get_layer(&dm->polyData, CD_ORIGINDEX);
mf = cddm->mpoly;
- for(i = 0; i < dm->numPolyData; i++, mf++) {
+ for (i = 0; i < dm->numPolyData; i++, mf++) {
float cent[3];
float no[3];
if (index) {
orig = *index++;
- if(orig == ORIGINDEX_NONE) continue;
+ if (orig == ORIGINDEX_NONE) continue;
}
else
orig = i;
@@ -1580,7 +1495,8 @@ static void cdDM_foreachMappedFaceCenter(
if (j > 3) {
normal_quad_v3(no, mv[ml->v].co, mv[(ml+1)->v].co,
mv[(ml+2)->v].co, mv[(ml+3)->v].co);
- } else {
+ }
+ else {
normal_tri_v3(no, mv[ml->v].co, mv[(ml+1)->v].co, mv[(ml+2)->v].co);
}
@@ -1589,11 +1505,11 @@ static void cdDM_foreachMappedFaceCenter(
}
-void CDDM_recalc_tesselation_ex(DerivedMesh *dm, const int do_face_nor_cpy)
+void CDDM_recalc_tessellation_ex(DerivedMesh *dm, const int do_face_nor_cpy)
{
CDDerivedMesh *cddm = (CDDerivedMesh*)dm;
- dm->numTessFaceData = mesh_recalcTesselation(&dm->faceData, &dm->loopData, &dm->polyData,
+ dm->numTessFaceData = mesh_recalcTessellation(&dm->faceData, &dm->loopData, &dm->polyData,
cddm->mvert,
dm->numTessFaceData, dm->numLoopData, dm->numPolyData,
do_face_nor_cpy);
@@ -1605,23 +1521,20 @@ void CDDM_recalc_tesselation_ex(DerivedMesh *dm, const int do_face_nor_cpy)
cddm->mface = CustomData_get_layer(&dm->faceData, CD_MFACE);
- /* Tesselation recreated faceData, and the active layer indices need to get re-propagated
- from loops and polys to faces */
+ /* Tessellation recreated faceData, and the active layer indices need to get re-propagated
+ * from loops and polys to faces */
CustomData_bmesh_update_active_layers(&dm->faceData, &dm->polyData, &dm->loopData);
}
-void CDDM_recalc_tesselation(DerivedMesh *dm)
+void CDDM_recalc_tessellation(DerivedMesh *dm)
{
- CDDM_recalc_tesselation_ex(dm, TRUE);
+ CDDM_recalc_tessellation_ex(dm, TRUE);
}
static void cdDM_free_internal(CDDerivedMesh *cddm)
{
- if(cddm->fmap) MEM_freeN(cddm->fmap);
- if(cddm->fmap_mem) MEM_freeN(cddm->fmap_mem);
-
- if(cddm->pmap) MEM_freeN(cddm->pmap);
- if(cddm->pmap_mem) MEM_freeN(cddm->pmap_mem);
+ if (cddm->pmap) MEM_freeN(cddm->pmap);
+ if (cddm->pmap_mem) MEM_freeN(cddm->pmap_mem);
}
static void cdDM_release(DerivedMesh *dm)
@@ -1674,7 +1587,7 @@ static CDDerivedMesh *cdDM_create(const char *desc)
dm->getTessFaceDataArray = DM_get_tessface_data_layer;
dm->calcNormals = CDDM_calc_normals_mapping;
- dm->recalcTesselation = CDDM_recalc_tesselation;
+ dm->recalcTessellation = CDDM_recalc_tessellation;
dm->getVertCos = cdDM_getVertCos;
dm->getVertCo = cdDM_getVertCo;
@@ -1691,7 +1604,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;
@@ -1836,7 +1748,7 @@ static void loops_to_customdata_corners(BMesh *bm, CustomData *facedata,
MCol *mcol;
MLoopCol *mloopcol;
MLoopUV *mloopuv;
- int i, j, hasWCol = CustomData_has_layer(&bm->ldata, CD_WEIGHT_MLOOPCOL);
+ int i, j, hasPCol = CustomData_has_layer(&bm->ldata, CD_PREVIEW_MLOOPCOL);
for (i=0; i < numTex; i++) {
texface = CustomData_get_n(facedata, CD_MTFACE, cdindex, i);
@@ -1857,23 +1769,17 @@ static void loops_to_customdata_corners(BMesh *bm, CustomData *facedata,
for (j=0; j<3; j++) {
l = l3[j];
mloopcol = CustomData_bmesh_get_n(&bm->ldata, l->head.data, CD_MLOOPCOL, i);
- mcol[j].r = mloopcol->r;
- mcol[j].g = mloopcol->g;
- mcol[j].b = mloopcol->b;
- mcol[j].a = mloopcol->a;
+ MESH_MLOOPCOL_TO_MCOL(mloopcol, &mcol[j]);
}
}
- if (hasWCol) {
- mcol = CustomData_get(facedata, cdindex, CD_WEIGHT_MCOL);
+ if (hasPCol) {
+ mcol = CustomData_get(facedata, cdindex, CD_PREVIEW_MCOL);
for (j=0; j<3; j++) {
l = l3[j];
- mloopcol = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_WEIGHT_MLOOPCOL);
- mcol[j].r = mloopcol->r;
- mcol[j].g = mloopcol->g;
- mcol[j].b = mloopcol->b;
- mcol[j].a = mloopcol->a;
+ mloopcol = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_PREVIEW_MLOOPCOL);
+ MESH_MLOOPCOL_TO_MCOL(mloopcol, &mcol[j]);
}
}
}
@@ -1916,8 +1822,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);
@@ -1928,7 +1834,7 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
CustomData_merge(&bm->pdata, &dm->polyData, mask,
CD_CALLOC, dm->numPolyData);
- /*add tesselation mface layers*/
+ /*add tessellation mface layers*/
if (use_tessface) {
CustomData_from_bmeshpoly(&dm->faceData, &dm->polyData, &dm->loopData, em->tottri);
}
@@ -1986,7 +1892,7 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
polyindex = dm->getTessFaceDataArray(dm, CD_POLYINDEX);
index = dm->getTessFaceDataArray(dm, CD_ORIGINDEX);
- for(i = 0; i < dm->numTessFaceData; i++, index++, polyindex++) {
+ for (i = 0; i < dm->numTessFaceData; i++, index++, polyindex++) {
MFace *mf = &mface[i];
BMLoop **l = em->looptris[i];
efa = l[0]->f;
@@ -2057,6 +1963,7 @@ static DerivedMesh *cddm_copy_ex(DerivedMesh *source, int faces_from_tessfaces)
DM_from_template(dm, source, DM_TYPE_CDDM, numVerts, numEdges, numTessFaces,
numLoops, numPolys);
dm->deformedOnly = source->deformedOnly;
+ dm->dirty = source->dirty;
CustomData_copy_data(&source->vertData, &dm->vertData, 0, 0, numVerts);
CustomData_copy_data(&source->edgeData, &dm->edgeData, 0, 0, numEdges);
@@ -2082,8 +1989,8 @@ 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. */
- CDDM_recalc_tesselation((DerivedMesh *)cddm);
+ * it). If it is necessary, add a comment explaining why. */
+ CDDM_recalc_tessellation((DerivedMesh *)cddm);
#endif
return dm;
@@ -2100,7 +2007,7 @@ DerivedMesh *CDDM_copy_from_tessface(DerivedMesh *source)
}
/* note, the CD_ORIGINDEX layers are all 0, so if there is a direct
- * relationship betwen mesh data this needs to be set by the caller. */
+ * relationship between mesh data this needs to be set by the caller. */
DerivedMesh *CDDM_from_template(DerivedMesh *source,
int numVerts, int numEdges, int numTessFaces,
int numLoops, int numPolys)
@@ -2123,13 +2030,13 @@ DerivedMesh *CDDM_from_template(DerivedMesh *source,
CustomData_add_layer(&dm->loopData, CD_MLOOP, CD_CALLOC, NULL, numLoops);
CustomData_add_layer(&dm->polyData, CD_MPOLY, CD_CALLOC, NULL, numPolys);
- if(!CustomData_get_layer(&dm->vertData, CD_ORIGINDEX))
+ if (!CustomData_get_layer(&dm->vertData, CD_ORIGINDEX))
CustomData_add_layer(&dm->vertData, CD_ORIGINDEX, CD_CALLOC, NULL, numVerts);
- if(!CustomData_get_layer(&dm->edgeData, CD_ORIGINDEX))
+ if (!CustomData_get_layer(&dm->edgeData, CD_ORIGINDEX))
CustomData_add_layer(&dm->edgeData, CD_ORIGINDEX, CD_CALLOC, NULL, numEdges);
- if(!CustomData_get_layer(&dm->faceData, CD_ORIGINDEX))
+ if (!CustomData_get_layer(&dm->faceData, CD_ORIGINDEX))
CustomData_add_layer(&dm->faceData, CD_ORIGINDEX, CD_CALLOC, NULL, numTessFaces);
- if(!CustomData_get_layer(&dm->faceData, CD_POLYINDEX))
+ if (!CustomData_get_layer(&dm->faceData, CD_POLYINDEX))
CustomData_add_layer(&dm->faceData, CD_POLYINDEX, CD_CALLOC, NULL, numTessFaces);
cddm->mvert = CustomData_get_layer(&dm->vertData, CD_MVERT);
@@ -2151,7 +2058,7 @@ void CDDM_apply_vert_coords(DerivedMesh *dm, float (*vertCoords)[3])
vert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MVERT, dm->numVertData);
cddm->mvert = vert;
- for(i = 0; i < dm->numVertData; ++i, ++vert)
+ for (i = 0; i < dm->numVertData; ++i, ++vert)
copy_v3_v3(vert->co, vertCoords[i]);
}
@@ -2165,57 +2072,61 @@ void CDDM_apply_vert_normals(DerivedMesh *dm, short (*vertNormals)[3])
vert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MVERT, dm->numVertData);
cddm->mvert = vert;
- for(i = 0; i < dm->numVertData; ++i, ++vert)
+ for (i = 0; i < dm->numVertData; ++i, ++vert)
copy_v3_v3_short(vert->no, vertNormals[i]);
}
-void CDDM_calc_normals_mapping(DerivedMesh *dm)
+void CDDM_calc_normals_mapping_ex(DerivedMesh *dm, const short only_face_normals)
{
CDDerivedMesh *cddm = (CDDerivedMesh*)dm;
float (*face_nors)[3] = NULL;
- /* use this to skip calculating normals on original vert's, this may need to be changed */
- const short only_face_normals = CustomData_is_referenced_layer(&dm->vertData, CD_MVERT);
-
- if(dm->numVertData == 0) return;
+ if (dm->numVertData == 0) return;
/* now we skip calculating vertex normals for referenced layer,
* no need to duplicate verts.
* WATCH THIS, bmesh only change!,
* need to take care of the side effects here - campbell */
-#if 0
+ #if 0
/* we don't want to overwrite any referenced layers */
cddm->mvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MVERT, dm->numVertData);
-#endif
+ #endif
if (dm->numTessFaceData == 0) {
- /* No tesselation on this mesh yet, need to calculate one.
+ /* No tessellation on this mesh yet, need to calculate one.
*
* Important not to update face normals from polys since it
* interfears with assigning the new normal layer in the following code.
*/
- CDDM_recalc_tesselation_ex(dm, FALSE);
+ CDDM_recalc_tessellation_ex(dm, FALSE);
}
else {
- /* A tesselation already exists, it should always have a CD_POLYINDEX */
+ /* A tessellation already exists, it should always have a CD_POLYINDEX */
BLI_assert(CustomData_has_layer(&dm->faceData, CD_POLYINDEX));
CustomData_free_layers(&dm->faceData, CD_NORMAL, dm->numTessFaceData);
}
face_nors = MEM_mallocN(sizeof(float)*3*dm->numTessFaceData, "face_nors");
-
+
/* calculate face normals */
mesh_calc_normals_mapping_ex(cddm->mvert, dm->numVertData, CDDM_get_loops(dm), CDDM_get_polys(dm),
- dm->numLoopData, dm->numPolyData, NULL, cddm->mface, dm->numTessFaceData,
- CustomData_get_layer(&dm->faceData, CD_POLYINDEX), face_nors,
- only_face_normals);
-
- CustomData_add_layer(&dm->faceData, CD_NORMAL, CD_ASSIGN,
- face_nors, dm->numTessFaceData);
+ dm->numLoopData, dm->numPolyData, NULL, cddm->mface, dm->numTessFaceData,
+ CustomData_get_layer(&dm->faceData, CD_POLYINDEX), face_nors,
+ only_face_normals);
+
+ CustomData_add_layer(&dm->faceData, CD_NORMAL, CD_ASSIGN,
+ face_nors, dm->numTessFaceData);
+}
+void CDDM_calc_normals_mapping(DerivedMesh *dm)
+{
+ /* use this to skip calculating normals on original vert's, this may need to be changed */
+ const short only_face_normals = CustomData_is_referenced_layer(&dm->vertData, CD_MVERT);
+
+ CDDM_calc_normals_mapping_ex(dm, only_face_normals);
}
/* bmesh note: this matches what we have in trunk */
@@ -2224,7 +2135,7 @@ void CDDM_calc_normals(DerivedMesh *dm)
CDDerivedMesh *cddm = (CDDerivedMesh*)dm;
float (*poly_nors)[3];
- if(dm->numVertData == 0) return;
+ if (dm->numVertData == 0) return;
/* we don't want to overwrite any referenced layers */
cddm->mvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MVERT, dm->numVertData);
@@ -2244,7 +2155,7 @@ void CDDM_calc_normals_tessface(DerivedMesh *dm)
CDDerivedMesh *cddm = (CDDerivedMesh*)dm;
float (*face_nors)[3];
- if(dm->numVertData == 0) return;
+ if (dm->numVertData == 0) return;
/* we don't want to overwrite any referenced layers */
cddm->mvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MVERT, dm->numVertData);
@@ -2269,7 +2180,7 @@ void CDDM_calc_normals_tessface(DerivedMesh *dm)
*
* this is a really horribly written function. ger. - joeedh
*
- * note, CDDM_recalc_tesselation has to run on the returned DM if you want to access tessfaces.
+ * note, CDDM_recalc_tessellation has to run on the returned DM if you want to access tessfaces.
*/
DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
{
@@ -2316,7 +2227,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];
@@ -2467,7 +2377,8 @@ void CDDM_calc_edges_tessface(DerivedMesh *dm)
BLI_edgehash_insert(eh, mf->v3, mf->v4, NULL);
if (!BLI_edgehash_haskey(eh, mf->v4, mf->v1))
BLI_edgehash_insert(eh, mf->v4, mf->v1, NULL);
- } else {
+ }
+ else {
if (!BLI_edgehash_haskey(eh, mf->v3, mf->v1))
BLI_edgehash_insert(eh, mf->v3, mf->v1, NULL);
}
@@ -2483,7 +2394,7 @@ void CDDM_calc_edges_tessface(DerivedMesh *dm)
ehi = BLI_edgehashIterator_new(eh);
med = CustomData_get_layer(&edgeData, CD_MEDGE);
index = CustomData_get_layer(&edgeData, CD_ORIGINDEX);
- for(i = 0; !BLI_edgehashIterator_isDone(ehi);
+ for (i = 0; !BLI_edgehashIterator_isDone(ehi);
BLI_edgehashIterator_step(ehi), ++i, ++med, ++index) {
BLI_edgehashIterator_getKey(ehi, &med->v1, &med->v2);
@@ -2546,7 +2457,7 @@ void CDDM_calc_edges(DerivedMesh *dm)
ehi = BLI_edgehashIterator_new(eh);
med = CustomData_get_layer(&edgeData, CD_MEDGE);
index = CustomData_get_layer(&edgeData, CD_ORIGINDEX);
- for(i = 0; !BLI_edgehashIterator_isDone(ehi);
+ for (i = 0; !BLI_edgehashIterator_isDone(ehi);
BLI_edgehashIterator_step(ehi), ++i, ++med, ++index) {
BLI_edgehashIterator_getKey(ehi, &med->v1, &med->v2);
j = GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi));
@@ -2672,9 +2583,21 @@ void CDDM_tessfaces_to_faces(DerivedMesh *dm)
MEdge *me;
EdgeHash *eh = BLI_edgehash_new();
int i, totloop;
-
- /*ensure we have all the edges we need*/
+
+ /* ... on second thaughts, better comment this and assume caller knows edge state. */
+#if 0
+ /* ensure we have all the edges we need */
CDDM_calc_edges_tessface(dm);
+#else
+# ifndef NDEBUG
+ {
+ /* ensure we have correct edges on non release builds */
+ i = cddm->dm.numEdgeData;
+ CDDM_calc_edges_tessface(dm);
+ BLI_assert(cddm->dm.numEdgeData == i);
+ }
+# endif
+#endif
/*build edge hash*/
me = cddm->medge;
@@ -2713,7 +2636,7 @@ void CDDM_tessfaces_to_faces(DerivedMesh *dm)
mp = cddm->mpoly;
ml = cddm->mloop;
l = 0;
- for (i=0; i<cddm->dm.numTessFaceData; i++, mf++, mp++) {
+ for (i=0; i<cddm->dm.numTessFaceData; i++, mf++, mp++, polyindex++) {
mp->flag = mf->flag;
mp->loopstart = l;
mp->mat_nr = mf->mat_nr;
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index e2d12c04bf2..0dd7687f998 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -41,6 +41,8 @@
#include "BLI_utildefines.h"
#include "BLI_linklist.h"
+#include "BLF_translation.h"
+
#include "BKE_cdderivedmesh.h"
#include "BKE_cloth.h"
#include "BKE_effect.h"
@@ -156,10 +158,10 @@ void cloth_init ( ClothModifierData *clmd )
clmd->sim_parms->goalfrict = 0.0f;
clmd->sim_parms->velocity_smooth = 0.0f;
- if(!clmd->sim_parms->effector_weights)
+ if (!clmd->sim_parms->effector_weights)
clmd->sim_parms->effector_weights = BKE_add_effector_weights(NULL);
- if(clmd->point_cache)
+ if (clmd->point_cache)
clmd->point_cache->step = 1;
}
@@ -171,25 +173,25 @@ static BVHTree *bvhselftree_build_from_cloth (ClothModifierData *clmd, float eps
ClothVertex *verts;
float co[12];
- if(!clmd)
+ if (!clmd)
return NULL;
cloth = clmd->clothObject;
- if(!cloth)
+ if (!cloth)
return NULL;
verts = cloth->verts;
// in the moment, return zero if no faces there
- if(!cloth->numverts)
+ if (!cloth->numverts)
return NULL;
// create quadtree with k=26
bvhtree = BLI_bvhtree_new(cloth->numverts, epsilon, 4, 6);
// fill tree
- for(i = 0; i < cloth->numverts; i++, verts++)
+ for (i = 0; i < cloth->numverts; i++, verts++)
{
copy_v3_v3(&co[0*3], verts->xold);
@@ -211,32 +213,32 @@ static BVHTree *bvhtree_build_from_cloth (ClothModifierData *clmd, float epsilon
MFace *mfaces;
float co[12];
- if(!clmd)
+ if (!clmd)
return NULL;
cloth = clmd->clothObject;
- if(!cloth)
+ if (!cloth)
return NULL;
verts = cloth->verts;
mfaces = cloth->mfaces;
// in the moment, return zero if no faces there
- if(!cloth->numfaces)
+ if (!cloth->numfaces)
return NULL;
// create quadtree with k=26
bvhtree = BLI_bvhtree_new(cloth->numfaces, epsilon, 4, 26);
// fill tree
- for(i = 0; i < cloth->numfaces; i++, mfaces++)
+ for (i = 0; i < cloth->numfaces; i++, mfaces++)
{
copy_v3_v3(&co[0*3], verts[mfaces->v1].xold);
copy_v3_v3(&co[1*3], verts[mfaces->v2].xold);
copy_v3_v3(&co[2*3], verts[mfaces->v3].xold);
- if(mfaces->v4)
+ if (mfaces->v4)
copy_v3_v3(&co[3*3], verts[mfaces->v4].xold);
BLI_bvhtree_insert(bvhtree, i, co, (mfaces->v4 ? 4 : 3));
@@ -258,43 +260,42 @@ void bvhtree_update_from_cloth(ClothModifierData *clmd, int moving)
float co[12], co_moving[12];
int ret = 0;
- if(!bvhtree)
+ if (!bvhtree)
return;
mfaces = cloth->mfaces;
// update vertex position in bvh tree
- if(verts && mfaces)
+ if (verts && mfaces)
{
- for(i = 0; i < cloth->numfaces; i++, mfaces++)
+ for (i = 0; i < cloth->numfaces; i++, mfaces++)
{
copy_v3_v3(&co[0*3], verts[mfaces->v1].txold);
copy_v3_v3(&co[1*3], verts[mfaces->v2].txold);
copy_v3_v3(&co[2*3], verts[mfaces->v3].txold);
- if(mfaces->v4)
+ if (mfaces->v4)
copy_v3_v3(&co[3*3], verts[mfaces->v4].txold);
// copy new locations into array
- if(moving)
+ if (moving)
{
// update moving positions
copy_v3_v3(&co_moving[0*3], verts[mfaces->v1].tx);
copy_v3_v3(&co_moving[1*3], verts[mfaces->v2].tx);
copy_v3_v3(&co_moving[2*3], verts[mfaces->v3].tx);
- if(mfaces->v4)
+ if (mfaces->v4)
copy_v3_v3(&co_moving[3*3], verts[mfaces->v4].tx);
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));
}
// check if tree is already full
- if(!ret)
+ if (!ret)
break;
}
@@ -312,33 +313,32 @@ void bvhselftree_update_from_cloth(ClothModifierData *clmd, int moving)
float co[12], co_moving[12];
int ret = 0;
- if(!bvhtree)
+ if (!bvhtree)
return;
mfaces = cloth->mfaces;
// update vertex position in bvh tree
- if(verts && mfaces)
+ if (verts && mfaces)
{
- for(i = 0; i < cloth->numverts; i++, verts++)
+ for (i = 0; i < cloth->numverts; i++, verts++)
{
copy_v3_v3(&co[0*3], verts->txold);
// copy new locations into array
- if(moving)
+ if (moving)
{
// update moving positions
copy_v3_v3(&co_moving[0*3], verts->tx);
ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, 1);
}
- else
- {
+ else {
ret = BLI_bvhtree_update_node(bvhtree, i, co, NULL, 1);
}
// check if tree is already full
- if(!ret)
+ if (!ret)
break;
}
@@ -353,7 +353,7 @@ void cloth_clear_cache(Object *ob, ClothModifierData *clmd, float framenr)
BKE_ptcache_id_from_cloth(&pid, ob, clmd);
// don't do anything as long as we're in editmode!
- if(pid.cache->edit && ob->mode & OB_MODE_PARTICLE_EDIT)
+ if (pid.cache->edit && ob->mode & OB_MODE_PARTICLE_EDIT)
return;
BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_AFTER, framenr);
@@ -366,13 +366,13 @@ static int do_init_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul
cache= clmd->point_cache;
/* initialize simulation data if it didn't exist already */
- if(clmd->clothObject == NULL) {
- if(!cloth_from_object(ob, clmd, result, framenr, 1)) {
+ if (clmd->clothObject == NULL) {
+ if (!cloth_from_object(ob, clmd, result, framenr, 1)) {
BKE_ptcache_invalidate(cache);
return 0;
}
- if(clmd->clothObject == NULL) {
+ if (clmd->clothObject == NULL) {
BKE_ptcache_invalidate(cache);
return 0;
}
@@ -400,7 +400,7 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul
mvert = result->getVertArray(result);
/* force any pinned verts to their constrained location. */
- for(i = 0; i < clmd->clothObject->numverts; i++, verts++) {
+ for (i = 0; i < clmd->clothObject->numverts; i++, verts++) {
/* save the previous position. */
copy_v3_v3(verts->xold, verts->xconst);
copy_v3_v3(verts->txold, verts->x);
@@ -415,7 +415,7 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul
tstart();
/* call the solver. */
- if(solvers [clmd->sim_parms->solver_type].solver)
+ if (solvers [clmd->sim_parms->solver_type].solver)
ret = solvers[clmd->sim_parms->solver_type].solver(ob, framenr, clmd, effectors);
tend();
@@ -446,7 +446,7 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived
BKE_ptcache_id_time(&pid, scene, framenr, &startframe, &endframe, &timescale);
clmd->sim_parms->timescale= timescale;
- if(clmd->sim_parms->reset
+ if (clmd->sim_parms->reset
|| (framenr == (startframe - clmd->sim_parms->preroll) && clmd->sim_parms->preroll != 0)
|| (clmd->clothObject && dm->getNumVerts(dm) != clmd->clothObject->numverts))
{
@@ -463,11 +463,11 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived
clmd->sim_parms->dt = clmd->sim_parms->timescale / clmd->sim_parms->stepsPerFrame;
/* handle continuous simulation with the play button */
- if(BKE_ptcache_get_continue_physics() || ((clmd->sim_parms->preroll > 0) && (framenr > startframe - clmd->sim_parms->preroll) && (framenr < startframe))) {
+ if (BKE_ptcache_get_continue_physics() || ((clmd->sim_parms->preroll > 0) && (framenr > startframe - clmd->sim_parms->preroll) && (framenr < startframe))) {
BKE_ptcache_invalidate(cache);
/* do simulation */
- if(!do_init_cloth(ob, clmd, dm, framenr))
+ if (!do_init_cloth(ob, clmd, dm, framenr))
return;
do_step_cloth(ob, clmd, dm, framenr);
@@ -479,19 +479,19 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived
}
/* simulation is only active during a specific period */
- if(framenr < startframe) {
+ if (framenr < startframe) {
BKE_ptcache_invalidate(cache);
return;
}
- else if(framenr > endframe) {
+ else if (framenr > endframe) {
framenr= endframe;
}
/* initialize simulation data if it didn't exist already */
- if(!do_init_cloth(ob, clmd, dm, framenr))
+ if (!do_init_cloth(ob, clmd, dm, framenr))
return;
- if((framenr == startframe) && (clmd->sim_parms->preroll == 0)) {
+ if ((framenr == startframe) && (clmd->sim_parms->preroll == 0)) {
BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
do_init_cloth(ob, clmd, dm, framenr);
BKE_ptcache_validate(cache, framenr);
@@ -503,33 +503,33 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived
/* try to read from cache */
cache_result = BKE_ptcache_read(&pid, (float)framenr+scene->r.subframe);
- if(cache_result == PTCACHE_READ_EXACT || cache_result == PTCACHE_READ_INTERPOLATED) {
+ if (cache_result == PTCACHE_READ_EXACT || cache_result == PTCACHE_READ_INTERPOLATED) {
implicit_set_positions(clmd);
cloth_to_object (ob, clmd, vertexCos);
BKE_ptcache_validate(cache, framenr);
- if(cache_result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED)
+ if (cache_result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED)
BKE_ptcache_write(&pid, framenr);
clmd->clothObject->last_frame= framenr;
return;
}
- else if(cache_result==PTCACHE_READ_OLD) {
+ else if (cache_result==PTCACHE_READ_OLD) {
implicit_set_positions(clmd);
}
- else if( /*ob->id.lib ||*/ (cache->flag & PTCACHE_BAKED)) { /* 2.4x disabled lib, but this can be used in some cases, testing further - campbell */
+ else if ( /*ob->id.lib ||*/ (cache->flag & PTCACHE_BAKED)) { /* 2.4x disabled lib, but this can be used in some cases, testing further - campbell */
/* if baked and nothing in cache, do nothing */
BKE_ptcache_invalidate(cache);
return;
}
- if(framenr!=clmd->clothObject->last_frame+1)
+ if (framenr!=clmd->clothObject->last_frame+1)
return;
/* if on second frame, write cache for first frame */
- if(cache->simframe == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0))
+ if (cache->simframe == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0))
BKE_ptcache_write(&pid, startframe);
clmd->sim_parms->timescale *= framenr - cache->simframe;
@@ -537,7 +537,7 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived
/* do simulation */
BKE_ptcache_validate(cache, framenr);
- if(!do_step_cloth(ob, clmd, dm, framenr)) {
+ if (!do_step_cloth(ob, clmd, dm, framenr)) {
BKE_ptcache_invalidate(cache);
}
else
@@ -577,7 +577,7 @@ void cloth_free_modifier(ClothModifierData *clmd )
if ( cloth->springs != NULL )
{
LinkNode *search = cloth->springs;
- while(search)
+ while (search)
{
ClothSpring *spring = search->link;
@@ -603,12 +603,12 @@ void cloth_free_modifier(ClothModifierData *clmd )
if ( cloth->mfaces )
MEM_freeN ( cloth->mfaces );
- if(cloth->edgehash)
+ if (cloth->edgehash)
BLI_edgehash_free ( cloth->edgehash, NULL );
/*
- if(clmd->clothObject->facemarks)
+ if (clmd->clothObject->facemarks)
MEM_freeN(clmd->clothObject->facemarks);
*/
MEM_freeN ( cloth );
@@ -620,7 +620,7 @@ void cloth_free_modifier(ClothModifierData *clmd )
void cloth_free_modifier_extern ( ClothModifierData *clmd )
{
Cloth *cloth = NULL;
- if(G.rt > 0)
+ if (G.rt > 0)
printf("cloth_free_modifier_extern\n");
if ( !clmd )
@@ -630,7 +630,7 @@ void cloth_free_modifier_extern ( ClothModifierData *clmd )
if ( cloth )
{
- if(G.rt > 0)
+ if (G.rt > 0)
printf("cloth_free_modifier_extern in\n");
// If our solver provides a free function, call it
@@ -650,7 +650,7 @@ void cloth_free_modifier_extern ( ClothModifierData *clmd )
if ( cloth->springs != NULL )
{
LinkNode *search = cloth->springs;
- while(search)
+ while (search)
{
ClothSpring *spring = search->link;
@@ -676,12 +676,12 @@ void cloth_free_modifier_extern ( ClothModifierData *clmd )
if ( cloth->mfaces )
MEM_freeN ( cloth->mfaces );
- if(cloth->edgehash)
+ if (cloth->edgehash)
BLI_edgehash_free ( cloth->edgehash, NULL );
/*
- if(clmd->clothObject->facemarks)
+ if (clmd->clothObject->facemarks)
MEM_freeN(clmd->clothObject->facemarks);
*/
MEM_freeN ( cloth );
@@ -777,20 +777,20 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm )
if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SCALING )
{
- if( dvert->dw[j].def_nr == (clmd->sim_parms->vgroup_struct-1))
+ if ( dvert->dw[j].def_nr == (clmd->sim_parms->vgroup_struct-1))
{
verts->struct_stiff = dvert->dw [j].weight;
verts->shear_stiff = dvert->dw [j].weight;
}
- if( dvert->dw[j].def_nr == (clmd->sim_parms->vgroup_bend-1))
+ if ( dvert->dw[j].def_nr == (clmd->sim_parms->vgroup_bend-1))
{
verts->bend_stiff = dvert->dw [j].weight;
}
}
/*
// for later
- if( dvert->dw[j].def_nr == (clmd->sim_parms->vgroup_weight-1))
+ if ( dvert->dw[j].def_nr == (clmd->sim_parms->vgroup_weight-1))
{
verts->mass = dvert->dw [j].weight;
}
@@ -815,7 +815,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
if ( clmd->clothObject != NULL )
{
cloth_free_modifier ( clmd );
- if(G.rt > 0)
+ if (G.rt > 0)
printf("cloth_free_modifier cloth_from_object\n");
}
@@ -828,9 +828,8 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
cloth = clmd->clothObject;
clmd->clothObject->edgehash = NULL;
}
- else if ( !clmd->clothObject )
- {
- modifier_setError ( & ( clmd->modifier ), "Out of memory on allocating clmd->clothObject." );
+ else if (!clmd->clothObject) {
+ modifier_setError(&(clmd->modifier), "%s", TIP_("Out of memory on allocating clmd->clothObject."));
return 0;
}
@@ -844,7 +843,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
clmd->clothObject->springs = NULL;
clmd->clothObject->numsprings = -1;
- if( clmd->sim_parms->shapekey_rest )
+ if ( clmd->sim_parms->shapekey_rest )
shapekey_rest = dm->getVertDataArray ( dm, CD_CLOTH_ORCO );
mvert = dm->getVertArray ( dm );
@@ -854,13 +853,13 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
// set initial values
for ( i = 0; i < dm->getNumVerts(dm); i++, verts++ )
{
- if(first)
+ if (first)
{
copy_v3_v3( verts->x, mvert[i].co );
mul_m4_v3( ob->obmat, verts->x );
- if( shapekey_rest ) {
+ if ( shapekey_rest ) {
verts->xrest= shapekey_rest[i];
mul_m4_v3( ob->obmat, verts->xrest );
}
@@ -895,14 +894,14 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
if ( !cloth_build_springs ( clmd, dm ) )
{
cloth_free_modifier ( clmd );
- modifier_setError ( & ( clmd->modifier ), "Can't build springs." );
+ modifier_setError(&(clmd->modifier), "%s", TIP_("Can't build springs."));
printf("cloth_free_modifier cloth_build_springs\n");
return 0;
}
for ( i = 0; i < dm->getNumVerts(dm); i++)
{
- if((!(cloth->verts[i].flags & CLOTH_VERT_FLAG_PINNED)) && (cloth->verts[i].goal > ALMOST_ZERO))
+ if ((!(cloth->verts[i].flags & CLOTH_VERT_FLAG_PINNED)) && (cloth->verts[i].goal > ALMOST_ZERO))
{
cloth_add_spring (clmd, i, i, 0.0, CLOTH_SPRING_TYPE_GOAL);
}
@@ -913,12 +912,12 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
solvers [clmd->sim_parms->solver_type].init ( ob, clmd );
}
- if(!first)
+ if (!first)
implicit_set_positions(clmd);
clmd->clothObject->bvhtree = bvhtree_build_from_cloth ( clmd, MAX2(clmd->coll_parms->epsilon, clmd->coll_parms->distance_repel) );
- for(i = 0; i < dm->getNumVerts(dm); i++)
+ for (i = 0; i < dm->getNumVerts(dm); i++)
{
maxdist = MAX2(maxdist, clmd->coll_parms->selfepsilon* ( cloth->verts[i].avg_spring_len*2.0f));
}
@@ -941,7 +940,7 @@ static void cloth_from_mesh ( ClothModifierData *clmd, DerivedMesh *dm )
if ( clmd->clothObject->verts == NULL )
{
cloth_free_modifier ( clmd );
- modifier_setError ( & ( clmd->modifier ), "Out of memory on allocating clmd->clothObject->verts." );
+ modifier_setError(&(clmd->modifier), "%s", TIP_("Out of memory on allocating clmd->clothObject->verts."));
printf("cloth_free_modifier clmd->clothObject->verts\n");
return;
}
@@ -952,7 +951,7 @@ static void cloth_from_mesh ( ClothModifierData *clmd, DerivedMesh *dm )
if ( clmd->clothObject->mfaces == NULL )
{
cloth_free_modifier ( clmd );
- modifier_setError ( & ( clmd->modifier ), "Out of memory on allocating clmd->clothObject->mfaces." );
+ modifier_setError(&(clmd->modifier), "%s", TIP_("Out of memory on allocating clmd->clothObject->mfaces."));
printf("cloth_free_modifier clmd->clothObject->mfaces\n");
return;
}
@@ -978,13 +977,13 @@ int cloth_add_spring ( ClothModifierData *clmd, unsigned int indexA, unsigned in
Cloth *cloth = clmd->clothObject;
ClothSpring *spring = NULL;
- if(cloth)
+ if (cloth)
{
// TODO: look if this spring is already there
spring = ( ClothSpring * ) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
- if(!spring)
+ if (!spring)
return 0;
spring->ij = indexA;
@@ -1010,7 +1009,7 @@ static void cloth_free_errorsprings(Cloth *cloth, EdgeHash *UNUSED(edgehash), Li
if ( cloth->springs != NULL )
{
LinkNode *search = cloth->springs;
- while(search)
+ while (search)
{
ClothSpring *spring = search->link;
@@ -1022,7 +1021,7 @@ static void cloth_free_errorsprings(Cloth *cloth, EdgeHash *UNUSED(edgehash), Li
cloth->springs = NULL;
}
- if(edgelist)
+ if (edgelist)
{
for ( i = 0; i < cloth->numverts; i++ )
{
@@ -1032,7 +1031,7 @@ static void cloth_free_errorsprings(Cloth *cloth, EdgeHash *UNUSED(edgehash), Li
MEM_freeN ( edgelist );
}
- if(cloth->edgehash)
+ if (cloth->edgehash)
BLI_edgehash_free ( cloth->edgehash, NULL );
}
@@ -1060,7 +1059,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
edgelist = MEM_callocN ( sizeof ( LinkNode * ) * numverts, "cloth_edgelist_alloc" );
- if(!edgelist)
+ if (!edgelist)
return 0;
for ( i = 0; i < numverts; i++ )
@@ -1096,17 +1095,16 @@ 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;
}
}
- if(struct_springs > 0)
+ if (struct_springs > 0)
clmd->sim_parms->avg_spring_len /= struct_springs;
- for(i = 0; i < numverts; i++)
+ for (i = 0; i < numverts; i++)
{
cloth->verts[i].avg_spring_len = cloth->verts[i].avg_spring_len * 0.49f / ((float)cloth->verts[i].spring_count);
}
@@ -1120,7 +1118,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
spring = ( ClothSpring *) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
- if(!spring)
+ if (!spring)
{
cloth_free_errorsprings(cloth, edgehash, edgelist);
return 0;
@@ -1142,7 +1140,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
// if ( mface[i].v4 ) --> Quad face
spring = ( ClothSpring * ) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
- if(!spring)
+ if (!spring)
{
cloth_free_errorsprings(cloth, edgehash, edgelist);
return 0;
@@ -1161,7 +1159,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
BLI_linklist_prepend ( &cloth->springs, spring );
}
- if(numfaces) {
+ if (numfaces) {
// bending springs
search2 = cloth->springs;
for ( i = struct_springs; i < struct_springs+shear_springs; i++ )
@@ -1183,7 +1181,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
{
spring = ( ClothSpring * ) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
- if(!spring)
+ if (!spring)
{
cloth_free_errorsprings(cloth, edgehash, edgelist);
return 0;
@@ -1204,7 +1202,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
search2 = search2->next;
}
}
- else if(struct_springs > 2) {
+ else if (struct_springs > 2) {
/* bending springs for hair strands */
/* The current algorightm only goes through the edges in order of the mesh edges list */
/* and makes springs between the outer vert of edges sharing a vertice. This works just */
@@ -1214,15 +1212,15 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
/* of the strands. -jahka */
search = cloth->springs;
search2 = search->next;
- while(search && search2)
+ while (search && search2)
{
tspring = search->link;
tspring2 = search2->link;
- if(tspring->ij == tspring2->kl) {
+ if (tspring->ij == tspring2->kl) {
spring = ( ClothSpring * ) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
- if(!spring)
+ if (!spring)
{
cloth_free_errorsprings(cloth, edgehash, edgelist);
return 0;
@@ -1249,7 +1247,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
for ( i = 0; i < numfaces; i++ ) // edge springs
{
- if(mface[i].v4)
+ if (mface[i].v4)
{
BLI_edgehash_insert ( edgehash, MIN2(mface[i].v1, mface[i].v3), MAX2(mface[i].v3, mface[i].v1), NULL );
@@ -1272,7 +1270,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
cloth->edgehash = edgehash;
- if(G.rt>0)
+ if (G.rt>0)
printf("avg_len: %f\n",clmd->sim_parms->avg_spring_len);
return 1;
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index ecb1ae4bed3..f6a6ef068d6 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -75,17 +75,17 @@ Collision modifier code start
***********************************/
/* step is limited from 0 (frame start position) to 1 (frame end position) */
-void collision_move_object ( CollisionModifierData *collmd, float step, float prevstep )
+void collision_move_object(CollisionModifierData *collmd, float step, float prevstep)
{
float tv[3] = {0, 0, 0};
unsigned int i = 0;
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 );
@@ -174,7 +174,7 @@ Collision modifier code end
* copied from SOLVE_CUBIC.C --> GSL
*/
-#define mySWAP(a,b) do { double tmp = b ; b = a ; a = tmp ; } while(0)
+#define mySWAP(a,b) do { double tmp = b ; b = a ; a = tmp ; } while (0)
#if 0 /* UNUSED */
static int
gsl_poly_solve_cubic (double a, double b, double c,
@@ -486,10 +486,10 @@ static void collision_compute_barycentric ( float pv[3], float p1[3], float p2[3
DO_INLINE void collision_interpolateOnTriangle ( float to[3], float v1[3], float v2[3], float v3[3], double w1, double w2, double w3 )
{
- to[0] = to[1] = to[2] = 0;
- VECADDMUL ( to, v1, w1 );
- VECADDMUL ( to, v2, w2 );
- VECADDMUL ( to, v3, w3 );
+ zero_v3(to);
+ VECADDMUL(to, v1, w1);
+ VECADDMUL(to, v2, w2);
+ VECADDMUL(to, v3, w3);
}
#ifndef WITH_ELTOPO
@@ -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 )
@@ -1021,16 +1021,17 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
result = 1;
}
- } else {
+ }
+ else {
w1 = collpair->bary[0]; w2 = collpair->bary[1]; w3 = collpair->bary[2];
// 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 +1043,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 )
@@ -1353,7 +1354,8 @@ static CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTree
collpair->flag = COLLISION_USE_COLLFACE;
collpair++;
- } else if (ret && j >= 3) { /*coll vert versus cloth face*/
+ }
+ else if (ret && j >= 3) { /*coll vert versus cloth face*/
collpair->ap1 = ap1; collpair->ap2 = ap2; collpair->ap3 = ap3;
collpair->collp = collp;
@@ -1380,7 +1382,7 @@ static void machine_epsilon_offset(Cloth *cloth)
cv = cloth->verts;
for (i=0; i<cloth->numverts; i++, cv++) {
- /*aggrevatingly enough, it's necassary to offset the coordinates
+ /*aggrevatingly enough, it's necessary to offset the coordinates
by a multiple of the 32-bit floating point epsilon when switching
into doubles*/
#define RNDSIGN (float)(-1*(BLI_rand()%2==0)|1)
@@ -1545,9 +1547,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 +1594,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 +1614,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 +1677,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 +1687,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 +1699,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 +1710,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 +1737,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 +1750,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 +1766,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,40 +1781,40 @@ 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);
}
}
CLAMP(*out_a1, 0.0, 1.0);
calculateEENormal(np11, np12, np21, np22, out_normal);
- if(*out_a1 > .5)
+ if (*out_a1 > .5)
{
- if(*out_a2 > .5)
+ 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)
+ 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 +1829,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 +1860,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 +1870,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 +1882,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 +1892,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);
}
}
@@ -1920,11 +1922,11 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
cloth1 = clmd->clothObject;
verts1 = cloth1->verts;
- for(i = 0; i < 9; i++)
+ for (i = 0; i < 9; i++)
{
// 9 edge - edge possibilities
- if(i == 0) // cloth edge: 1-2; coll edge: 1-2
+ if (i == 0) // cloth edge: 1-2; coll edge: 1-2
{
edgecollpair.p11 = collpair->ap1;
edgecollpair.p12 = collpair->ap2;
@@ -1932,7 +1934,7 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
edgecollpair.p21 = collpair->bp1;
edgecollpair.p22 = collpair->bp2;
}
- else if(i == 1) // cloth edge: 1-2; coll edge: 2-3
+ else if (i == 1) // cloth edge: 1-2; coll edge: 2-3
{
edgecollpair.p11 = collpair->ap1;
edgecollpair.p12 = collpair->ap2;
@@ -1940,7 +1942,7 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
edgecollpair.p21 = collpair->bp2;
edgecollpair.p22 = collpair->bp3;
}
- else if(i == 2) // cloth edge: 1-2; coll edge: 1-3
+ else if (i == 2) // cloth edge: 1-2; coll edge: 1-3
{
edgecollpair.p11 = collpair->ap1;
edgecollpair.p12 = collpair->ap2;
@@ -1948,7 +1950,7 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
edgecollpair.p21 = collpair->bp1;
edgecollpair.p22 = collpair->bp3;
}
- else if(i == 3) // cloth edge: 2-3; coll edge: 1-2
+ else if (i == 3) // cloth edge: 2-3; coll edge: 1-2
{
edgecollpair.p11 = collpair->ap2;
edgecollpair.p12 = collpair->ap3;
@@ -1956,7 +1958,7 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
edgecollpair.p21 = collpair->bp1;
edgecollpair.p22 = collpair->bp2;
}
- else if(i == 4) // cloth edge: 2-3; coll edge: 2-3
+ else if (i == 4) // cloth edge: 2-3; coll edge: 2-3
{
edgecollpair.p11 = collpair->ap2;
edgecollpair.p12 = collpair->ap3;
@@ -1964,7 +1966,7 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
edgecollpair.p21 = collpair->bp2;
edgecollpair.p22 = collpair->bp3;
}
- else if(i == 5) // cloth edge: 2-3; coll edge: 1-3
+ else if (i == 5) // cloth edge: 2-3; coll edge: 1-3
{
edgecollpair.p11 = collpair->ap2;
edgecollpair.p12 = collpair->ap3;
@@ -1972,7 +1974,7 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
edgecollpair.p21 = collpair->bp1;
edgecollpair.p22 = collpair->bp3;
}
- else if(i ==6) // cloth edge: 1-3; coll edge: 1-2
+ else if (i ==6) // cloth edge: 1-3; coll edge: 1-2
{
edgecollpair.p11 = collpair->ap1;
edgecollpair.p12 = collpair->ap3;
@@ -1980,7 +1982,7 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
edgecollpair.p21 = collpair->bp1;
edgecollpair.p22 = collpair->bp2;
}
- else if(i ==7) // cloth edge: 1-3; coll edge: 2-3
+ else if (i ==7) // cloth edge: 1-3; coll edge: 2-3
{
edgecollpair.p11 = collpair->ap1;
edgecollpair.p12 = collpair->ap3;
@@ -1988,7 +1990,7 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
edgecollpair.p21 = collpair->bp2;
edgecollpair.p22 = collpair->bp3;
}
- else if(i == 8) // cloth edge: 1-3; coll edge: 1-3
+ else if (i == 8) // cloth edge: 1-3; coll edge: 1-3
{
edgecollpair.p11 = collpair->ap1;
edgecollpair.p12 = collpair->ap3;
@@ -1997,29 +1999,29 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
edgecollpair.p22 = collpair->bp3;
}
/*
- if((edgecollpair.p11 == 3) && (edgecollpair.p12 == 16))
+ if ((edgecollpair.p11 == 3) && (edgecollpair.p12 == 16))
printf("Ahier!\n");
- if((edgecollpair.p11 == 16) && (edgecollpair.p12 == 3))
+ if ((edgecollpair.p11 == 16) && (edgecollpair.p12 == 3))
printf("Ahier!\n");
*/
// 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 );
- if((edgecollpair.p11 == 3 && edgecollpair.p12==16)|| (edgecollpair.p11==16 && edgecollpair.p12==3))
+ if ((edgecollpair.p11 == 3 && edgecollpair.p12==16)|| (edgecollpair.p11==16 && edgecollpair.p12==3))
{
- if(edgecollpair.p21==6 || edgecollpair.p22 == 6)
+ if (edgecollpair.p21==6 || edgecollpair.p22 == 6)
{
printf("dist: %f, sol[k]: %f, sol2[k]: %f\n", distance, solution[k], solution2[k]);
printf("a1: %f, a2: %f, b1: %f, b2: %f\n", x1[0], x2[0], x3[0], v1[0]);
@@ -2048,30 +2050,30 @@ 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)
+ if (out_normalVelocity < 0.0)
{
out_normalVelocity*= -1.0;
negate_v3(out_normal);
@@ -2131,20 +2133,20 @@ static int cloth_collision_moving ( ClothModifierData *clmd, CollisionModifierDa
}
#endif
-static void add_collision_object(Object ***objs, unsigned int *numobj, unsigned int *maxobj, Object *ob, Object *self, int level)
+static void add_collision_object(Object ***objs, unsigned int *numobj, unsigned int *maxobj, Object *ob, Object *self, int level, unsigned int modifier_type)
{
CollisionModifierData *cmd= NULL;
- if(ob == self)
+ if (ob == self)
return;
/* only get objects with collision modifier */
- if(ob->pd && ob->pd->deflect)
- cmd= (CollisionModifierData *)modifiers_findByType(ob, eModifierType_Collision);
+ if (((modifier_type == eModifierType_Collision) && ob->pd && ob->pd->deflect) || (modifier_type != eModifierType_Collision))
+ cmd= (CollisionModifierData *)modifiers_findByType(ob, modifier_type);
- if(cmd) {
+ if (cmd) {
/* extend array */
- if(*numobj >= *maxobj) {
+ if (*numobj >= *maxobj) {
*maxobj *= 2;
*objs= MEM_reallocN(*objs, sizeof(Object*)*(*maxobj));
}
@@ -2154,19 +2156,19 @@ static void add_collision_object(Object ***objs, unsigned int *numobj, unsigned
}
/* objects in dupli groups, one level only for now */
- if(ob->dup_group && level == 0) {
+ if (ob->dup_group && level == 0) {
GroupObject *go;
Group *group= ob->dup_group;
/* add objects */
- for(go= group->gobject.first; go; go= go->next)
- add_collision_object(objs, numobj, maxobj, go->ob, self, level+1);
+ for (go= group->gobject.first; go; go= go->next)
+ add_collision_object(objs, numobj, maxobj, go->ob, self, level+1, modifier_type);
}
}
// return all collision objects in scene
// collision object will exclude self
-Object **get_collisionobjects(Scene *scene, Object *self, Group *group, unsigned int *numcollobj)
+Object **get_collisionobjects(Scene *scene, Object *self, Group *group, unsigned int *numcollobj, unsigned int modifier_type)
{
Base *base;
Object **objs;
@@ -2176,17 +2178,17 @@ Object **get_collisionobjects(Scene *scene, Object *self, Group *group, unsigned
objs= MEM_callocN(sizeof(Object *)*maxobj, "CollisionObjectsArray");
/* gather all collision objects */
- if(group) {
+ if (group) {
/* use specified group */
- for(go= group->gobject.first; go; go= go->next)
- add_collision_object(&objs, &numobj, &maxobj, go->ob, self, 0);
+ for (go= group->gobject.first; go; go= go->next)
+ add_collision_object(&objs, &numobj, &maxobj, go->ob, self, 0, modifier_type);
}
else {
Scene *sce_iter;
/* add objects in same layer in scene */
- for(SETLOOPER(scene, sce_iter, base)) {
- if(base->lay & self->lay)
- add_collision_object(&objs, &numobj, &maxobj, base->object, self, 0);
+ for (SETLOOPER(scene, sce_iter, base)) {
+ if (base->lay & self->lay)
+ add_collision_object(&objs, &numobj, &maxobj, base->object, self, 0, modifier_type);
}
}
@@ -2201,14 +2203,14 @@ static void add_collider_cache_object(ListBase **objs, Object *ob, Object *self,
CollisionModifierData *cmd= NULL;
ColliderCache *col;
- if(ob == self)
+ if (ob == self)
return;
- if(ob->pd && ob->pd->deflect)
+ if (ob->pd && ob->pd->deflect)
cmd =(CollisionModifierData *)modifiers_findByType(ob, eModifierType_Collision);
- if(cmd && cmd->bvhtree) {
- if(*objs == NULL)
+ if (cmd && cmd->bvhtree) {
+ if (*objs == NULL)
*objs = MEM_callocN(sizeof(ListBase), "ColliderCache array");
col = MEM_callocN(sizeof(ColliderCache), "ColliderCache");
@@ -2220,12 +2222,12 @@ static void add_collider_cache_object(ListBase **objs, Object *ob, Object *self,
}
/* objects in dupli groups, one level only for now */
- if(ob->dup_group && level == 0) {
+ if (ob->dup_group && level == 0) {
GroupObject *go;
Group *group= ob->dup_group;
/* add objects */
- for(go= group->gobject.first; go; go= go->next)
+ for (go= group->gobject.first; go; go= go->next)
add_collider_cache_object(objs, go->ob, self, level+1);
}
}
@@ -2236,8 +2238,8 @@ ListBase *get_collider_cache(Scene *scene, Object *self, Group *group)
ListBase *objs= NULL;
/* add object in same layer in scene */
- if(group) {
- for(go= group->gobject.first; go; go= go->next)
+ if (group) {
+ for (go= group->gobject.first; go; go= go->next)
add_collider_cache_object(&objs, go->ob, self, 0);
}
else {
@@ -2245,8 +2247,8 @@ ListBase *get_collider_cache(Scene *scene, Object *self, Group *group)
Base *base;
/* add objects in same layer in scene */
- for(SETLOOPER(scene, sce_iter, base)) {
- if(!self || (base->lay & self->lay))
+ for (SETLOOPER(scene, sce_iter, base)) {
+ if (!self || (base->lay & self->lay))
add_collider_cache_object(&objs, base->object, self, 0);
}
@@ -2257,7 +2259,7 @@ ListBase *get_collider_cache(Scene *scene, Object *self, Group *group)
void free_collider_cache(ListBase **colliders)
{
- if(*colliders) {
+ if (*colliders) {
BLI_freelistN(*colliders);
MEM_freeN(*colliders);
*colliders = NULL;
@@ -2385,9 +2387,9 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
bvhtree_update_from_cloth ( clmd, 1 ); // 0 means STATIC, 1 means MOVING (see later in this function)
bvhselftree_update_from_cloth ( clmd, 0 ); // 0 means STATIC, 1 means MOVING (see later in this function)
- collobjs = get_collisionobjects(clmd->scene, ob, clmd->coll_parms->group, &numcollobj);
+ collobjs = get_collisionobjects(clmd->scene, ob, clmd->coll_parms->group, &numcollobj, eModifierType_Collision);
- if(!collobjs)
+ if (!collobjs)
return 0;
do
@@ -2400,14 +2402,14 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
collisions_index = MEM_callocN(sizeof(CollPair *) *numcollobj , "CollPair");
// check all collision objects
- for(i = 0; i < numcollobj; i++)
+ for (i = 0; i < numcollobj; i++)
{
Object *collob= collobjs[i];
CollisionModifierData *collmd = (CollisionModifierData*)modifiers_findByType(collob, eModifierType_Collision);
BVHTreeOverlap *overlap = NULL;
unsigned int result = 0;
- if(!collmd->bvhtree)
+ if (!collmd->bvhtree)
continue;
/* move object to position (step) in time */
@@ -2418,7 +2420,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
overlap = BLI_bvhtree_overlap ( cloth_bvh, collmd->bvhtree, &result );
// go to next object if no overlap is there
- if( result && overlap ) {
+ if ( result && overlap ) {
/* check if collisions really happen (costly near check) */
cloth_bvh_objcollisions_nearcheck ( clmd, collmd, &collisions[i],
&collisions_index[i], result, overlap, dt/(float)clmd->coll_parms->loop_count);
@@ -2433,7 +2435,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
}
rounds++;
- for(i = 0; i < numcollobj; i++)
+ for (i = 0; i < numcollobj; i++)
{
if ( collisions[i] ) MEM_freeN ( collisions[i] );
}
@@ -2467,7 +2469,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
////////////////////////////////////////////////////////////
if ( clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_SELF )
{
- for(l = 0; l < (unsigned int)clmd->coll_parms->self_loop_count; l++)
+ for (l = 0; l < (unsigned int)clmd->coll_parms->self_loop_count; l++)
{
// TODO: add coll quality rounds again
BVHTreeOverlap *overlap = NULL;
@@ -2507,7 +2509,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 +2540,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 +2566,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 );
}
}
}
@@ -2574,7 +2575,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
}
while ( ret2 && ( clmd->coll_parms->loop_count>rounds ) );
- if(collobjs)
+ if (collobjs)
MEM_freeN(collobjs);
return 1|MIN2 ( ret, 1 );
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 108b4e48a95..8ec3ad567a2 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -64,7 +64,7 @@ CurveMapping *curvemapping_add(int tot, float minx, float miny, float maxx, floa
cumap= MEM_callocN(sizeof(CurveMapping), "new curvemap");
cumap->flag= CUMA_DO_CLIP;
- if(tot==4) cumap->cur= 3; /* rhms, hack for 'col' curve? */
+ if (tot==4) cumap->cur= 3; /* rhms, hack for 'col' curve? */
clipminx = MIN2(minx, maxx);
clipminy = MIN2(miny, maxy);
@@ -77,7 +77,7 @@ CurveMapping *curvemapping_add(int tot, float minx, float miny, float maxx, floa
cumap->white[0]= cumap->white[1]= cumap->white[2]= 1.0f;
cumap->bwmul[0]= cumap->bwmul[1]= cumap->bwmul[2]= 1.0f;
- for(a=0; a<tot; a++) {
+ for (a=0; a<tot; a++) {
cumap->cm[a].flag= CUMA_EXTEND_EXTRAPOLATE;
cumap->cm[a].totpoint= 2;
cumap->cm[a].curve= MEM_callocN(2*sizeof(CurveMapPoint), "curve points");
@@ -97,11 +97,11 @@ void curvemapping_free(CurveMapping *cumap)
{
int a;
- if(cumap) {
- for(a=0; a<CM_TOT; a++) {
- if(cumap->cm[a].curve) MEM_freeN(cumap->cm[a].curve);
- if(cumap->cm[a].table) MEM_freeN(cumap->cm[a].table);
- if(cumap->cm[a].premultable) MEM_freeN(cumap->cm[a].premultable);
+ if (cumap) {
+ for (a=0; a<CM_TOT; a++) {
+ if (cumap->cm[a].curve) MEM_freeN(cumap->cm[a].curve);
+ if (cumap->cm[a].table) MEM_freeN(cumap->cm[a].table);
+ if (cumap->cm[a].premultable) MEM_freeN(cumap->cm[a].premultable);
}
MEM_freeN(cumap);
}
@@ -111,14 +111,14 @@ CurveMapping *curvemapping_copy(CurveMapping *cumap)
{
int a;
- if(cumap) {
+ if (cumap) {
CurveMapping *cumapn= MEM_dupallocN(cumap);
- for(a=0; a<CM_TOT; a++) {
- if(cumap->cm[a].curve)
+ for (a=0; a<CM_TOT; a++) {
+ if (cumap->cm[a].curve)
cumapn->cm[a].curve= MEM_dupallocN(cumap->cm[a].curve);
- if(cumap->cm[a].table)
+ if (cumap->cm[a].table)
cumapn->cm[a].table= MEM_dupallocN(cumap->cm[a].table);
- if(cumap->cm[a].premultable)
+ if (cumap->cm[a].premultable)
cumapn->cm[a].premultable= MEM_dupallocN(cumap->cm[a].premultable);
}
return cumapn;
@@ -130,13 +130,13 @@ void curvemapping_set_black_white(CurveMapping *cumap, const float black[3], con
{
int a;
- if(white)
+ if (white)
copy_v3_v3(cumap->white, white);
- if(black)
+ if (black)
copy_v3_v3(cumap->black, black);
- for(a=0; a<3; a++) {
- if(cumap->white[a]==cumap->black[a])
+ for (a=0; a<3; a++) {
+ if (cumap->white[a]==cumap->black[a])
cumap->bwmul[a]= 0.0f;
else
cumap->bwmul[a]= 1.0f/(cumap->white[a] - cumap->black[a]);
@@ -154,8 +154,8 @@ void curvemap_remove(CurveMap *cuma, int flag)
/* well, lets keep the two outer points! */
cmp[0]= cuma->curve[0];
- for(a=1, b=1; a<cuma->totpoint-1; a++) {
- if(!(cuma->curve[a].flag & flag)) {
+ for (a=1, b=1; a<cuma->totpoint-1; a++) {
+ if (!(cuma->curve[a].flag & flag)) {
cmp[b]= cuma->curve[a];
b++;
}
@@ -175,8 +175,8 @@ void curvemap_insert(CurveMap *cuma, float x, float y)
/* insert fragments of the old one and the new point to the new curve */
cuma->totpoint++;
- for(a=0, b=0; a<cuma->totpoint; a++) {
- if((x < cuma->curve[a].x) && !foundloc) {
+ for (a=0, b=0; a<cuma->totpoint; a++) {
+ if ((x < cuma->curve[a].x) && !foundloc) {
cmp[a].x= x;
cmp[a].y= y;
cmp[a].flag= CUMA_SELECT;
@@ -199,7 +199,7 @@ void curvemap_insert(CurveMap *cuma, float x, float y)
void curvemap_reset(CurveMap *cuma, rctf *clipr, int preset, int slope)
{
- if(cuma->curve)
+ if (cuma->curve)
MEM_freeN(cuma->curve);
switch(preset) {
@@ -295,7 +295,7 @@ void curvemap_reset(CurveMap *cuma, rctf *clipr, int preset, int slope)
cuma->curve = newpoints;
}
- if(cuma->table) {
+ if (cuma->table) {
MEM_freeN(cuma->table);
cuma->table= NULL;
}
@@ -306,9 +306,9 @@ void curvemap_sethandle(CurveMap *cuma, int type)
{
int a;
- for(a=0; a<cuma->totpoint; a++) {
- if(cuma->curve[a].flag & CUMA_SELECT) {
- if(type) cuma->curve[a].flag |= CUMA_VECTOR;
+ for (a=0; a<cuma->totpoint; a++) {
+ if (cuma->curve[a].flag & CUMA_SELECT) {
+ if (type) cuma->curve[a].flag |= CUMA_VECTOR;
else cuma->curve[a].flag &= ~CUMA_VECTOR;
}
}
@@ -323,13 +323,13 @@ static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *nex
float len,len_a, len_b;
float dvec_a[2], dvec_b[2];
- if(bezt->h1==0 && bezt->h2==0) {
+ if (bezt->h1==0 && bezt->h2==0) {
return;
}
p2= bezt->vec[1];
- if(prev==NULL) {
+ if (prev==NULL) {
p3= next->vec[1];
pt[0]= 2.0f*p2[0] - p3[0];
pt[1]= 2.0f*p2[1] - p3[1];
@@ -339,7 +339,7 @@ static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *nex
p1= prev->vec[1];
}
- if(next==NULL) {
+ if (next==NULL) {
p1= prev->vec[1];
pt[0]= 2.0f*p2[0] - p1[0];
pt[1]= 2.0f*p2[1] - p1[1];
@@ -355,59 +355,59 @@ static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *nex
len_a= len_v2(dvec_a);
len_b= len_v2(dvec_b);
- if(len_a==0.0f) len_a=1.0f;
- if(len_b==0.0f) len_b=1.0f;
+ if (len_a==0.0f) len_a=1.0f;
+ if (len_b==0.0f) len_b=1.0f;
- if(bezt->h1==HD_AUTO || bezt->h2==HD_AUTO) { /* auto */
+ if (bezt->h1==HD_AUTO || bezt->h2==HD_AUTO) { /* auto */
float tvec[2];
tvec[0]= dvec_b[0]/len_b + dvec_a[0]/len_a;
tvec[1]= dvec_b[1]/len_b + dvec_a[1]/len_a;
len= len_v2(tvec) * 2.5614f;
- if(len!=0.0f) {
+ if (len!=0.0f) {
- if(bezt->h1==HD_AUTO) {
+ if (bezt->h1==HD_AUTO) {
len_a/=len;
madd_v2_v2v2fl(p2-3, p2, tvec, -len_a);
}
- if(bezt->h2==HD_AUTO) {
+ if (bezt->h2==HD_AUTO) {
len_b/=len;
madd_v2_v2v2fl(p2+3, p2, tvec, len_b);
}
}
}
- if(bezt->h1==HD_VECT) { /* vector */
+ if (bezt->h1==HD_VECT) { /* vector */
madd_v2_v2v2fl(p2-3, p2, dvec_a, -1.0f/3.0f);
}
- if(bezt->h2==HD_VECT) {
+ if (bezt->h2==HD_VECT) {
madd_v2_v2v2fl(p2+3, p2, dvec_b, 1.0f/3.0f);
}
}
/* 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]) {
- if((cuma->flag & CUMA_EXTEND_EXTRAPOLATE)==0) {
+ if (x <= first[0]) {
+ if ((cuma->flag & CUMA_EXTEND_EXTRAPOLATE)==0) {
/* no extrapolate */
return first[1];
}
else {
- if(cuma->ext_in[0]==0.0f)
+ if (cuma->ext_in[0]==0.0f)
return first[1] + cuma->ext_in[1]*10000.0f;
else
return first[1] + cuma->ext_in[1]*(x - first[0])/cuma->ext_in[0];
}
}
- else if(x >= last[0]) {
- if((cuma->flag & CUMA_EXTEND_EXTRAPOLATE)==0) {
+ else if (x >= last[0]) {
+ if ((cuma->flag & CUMA_EXTEND_EXTRAPOLATE)==0) {
/* no extrapolate */
return last[1];
}
else {
- if(cuma->ext_out[0]==0.0f)
+ if (cuma->ext_out[0]==0.0f)
return last[1] - cuma->ext_out[1]*10000.0f;
else
return last[1] + cuma->ext_out[1]*(x - last[0])/cuma->ext_out[0];
@@ -424,7 +424,7 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr)
float *fp, *allpoints, *lastpoint, curf, range;
int a, totpoint;
- if(cuma->curve==NULL) return;
+ if (cuma->curve==NULL) return;
/* default rect also is table range */
cuma->mintable= clipr->xmin;
@@ -433,59 +433,59 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr)
/* hrmf... we now rely on blender ipo beziers, these are more advanced */
bezt= MEM_callocN(cuma->totpoint*sizeof(BezTriple), "beztarr");
- for(a=0; a<cuma->totpoint; a++) {
+ for (a=0; a<cuma->totpoint; a++) {
cuma->mintable= MIN2(cuma->mintable, cmp[a].x);
cuma->maxtable= MAX2(cuma->maxtable, cmp[a].x);
bezt[a].vec[1][0]= cmp[a].x;
bezt[a].vec[1][1]= cmp[a].y;
- if(cmp[a].flag & CUMA_VECTOR)
+ if (cmp[a].flag & CUMA_VECTOR)
bezt[a].h1= bezt[a].h2= HD_VECT;
else
bezt[a].h1= bezt[a].h2= HD_AUTO;
}
- for(a=0; a<cuma->totpoint; a++) {
- if(a==0)
+ for (a=0; a<cuma->totpoint; a++) {
+ if (a==0)
calchandle_curvemap(bezt, NULL, bezt+1, 0);
- else if(a==cuma->totpoint-1)
+ else if (a==cuma->totpoint-1)
calchandle_curvemap(bezt+a, bezt+a-1, NULL, 0);
else
calchandle_curvemap(bezt+a, bezt+a-1, bezt+a+1, 0);
}
/* first and last handle need correction, instead of pointing to center of next/prev,
- we let it point to the closest handle */
- if(cuma->totpoint>2) {
+ * we let it point to the closest handle */
+ if (cuma->totpoint>2) {
float hlen, nlen, vec[3];
- if(bezt[0].h2==HD_AUTO) {
+ if (bezt[0].h2==HD_AUTO) {
hlen= len_v3v3(bezt[0].vec[1], bezt[0].vec[2]); /* original handle length */
/* clip handle point */
copy_v3_v3(vec, bezt[1].vec[0]);
- if(vec[0] < bezt[0].vec[1][0])
+ if (vec[0] < bezt[0].vec[1][0])
vec[0]= bezt[0].vec[1][0];
sub_v3_v3(vec, bezt[0].vec[1]);
nlen= len_v3(vec);
- if(nlen>FLT_EPSILON) {
+ if (nlen>FLT_EPSILON) {
mul_v3_fl(vec, hlen/nlen);
add_v3_v3v3(bezt[0].vec[2], vec, bezt[0].vec[1]);
sub_v3_v3v3(bezt[0].vec[0], bezt[0].vec[1], vec);
}
}
a= cuma->totpoint-1;
- if(bezt[a].h2==HD_AUTO) {
+ if (bezt[a].h2==HD_AUTO) {
hlen= len_v3v3(bezt[a].vec[1], bezt[a].vec[0]); /* original handle length */
/* clip handle point */
copy_v3_v3(vec, bezt[a-1].vec[2]);
- if(vec[0] > bezt[a].vec[1][0])
+ if (vec[0] > bezt[a].vec[1][0])
vec[0]= bezt[a].vec[1][0];
sub_v3_v3(vec, bezt[a].vec[1]);
nlen= len_v3(vec);
- if(nlen>FLT_EPSILON) {
+ if (nlen>FLT_EPSILON) {
mul_v3_fl(vec, hlen/nlen);
add_v3_v3v3(bezt[a].vec[0], vec, bezt[a].vec[1]);
sub_v3_v3v3(bezt[a].vec[2], bezt[a].vec[1], vec);
@@ -493,12 +493,12 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr)
}
}
/* make the bezier curve */
- if(cuma->table)
+ if (cuma->table)
MEM_freeN(cuma->table);
totpoint= (cuma->totpoint-1)*CM_RESOL;
fp= allpoints= MEM_callocN(totpoint*2*sizeof(float), "table");
- for(a=0; a<cuma->totpoint-1; a++, fp += 2*CM_RESOL) {
+ for (a=0; a<cuma->totpoint-1; a++, fp += 2*CM_RESOL) {
correct_bezpart(bezt[a].vec[1], bezt[a].vec[2], bezt[a+1].vec[0], bezt[a+1].vec[1]);
forward_diff_bezier(bezt[a].vec[1][0], bezt[a].vec[2][0], bezt[a+1].vec[0][0], bezt[a+1].vec[1][0], fp, CM_RESOL-1, 2*sizeof(float));
forward_diff_bezier(bezt[a].vec[1][1], bezt[a].vec[2][1], bezt[a+1].vec[0][1], bezt[a+1].vec[1][1], fp+1, CM_RESOL-1, 2*sizeof(float));
@@ -529,20 +529,20 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr)
lastpoint= allpoints + 2*(totpoint-1);
cmp= MEM_callocN((CM_TABLE+1)*sizeof(CurveMapPoint), "dist table");
- for(a=0; a<=CM_TABLE; a++) {
+ for (a=0; a<=CM_TABLE; a++) {
curf= cuma->mintable + range*(float)a;
cmp[a].x= curf;
/* get the first x coordinate larger than curf */
- while(curf >= fp[0] && fp!=lastpoint) {
+ while (curf >= fp[0] && fp!=lastpoint) {
fp+=2;
}
- if(fp==allpoints || (curf >= fp[0] && fp==lastpoint))
+ if (fp==allpoints || (curf >= fp[0] && fp==lastpoint))
cmp[a].y= curvemap_calc_extend(cuma, curf, allpoints, lastpoint);
else {
float fac1= fp[0] - fp[-2];
float fac2= fp[0] - curf;
- if(fac1 > FLT_EPSILON)
+ if (fac1 > FLT_EPSILON)
fac1= fac2/fac1;
else
fac1= 0.0f;
@@ -560,9 +560,9 @@ void curvemapping_premultiply(CurveMapping *cumap, int restore)
{
int a;
- if(restore) {
- if(cumap->flag & CUMA_PREMULLED) {
- for(a=0; a<3; a++) {
+ if (restore) {
+ if (cumap->flag & CUMA_PREMULLED) {
+ for (a=0; a<3; a++) {
MEM_freeN(cumap->cm[a].table);
cumap->cm[a].table= cumap->cm[a].premultable;
cumap->cm[a].premultable= NULL;
@@ -572,23 +572,23 @@ void curvemapping_premultiply(CurveMapping *cumap, int restore)
}
}
else {
- if((cumap->flag & CUMA_PREMULLED)==0) {
+ if ((cumap->flag & CUMA_PREMULLED)==0) {
/* verify and copy */
- for(a=0; a<3; a++) {
- if(cumap->cm[a].table==NULL)
+ for (a=0; a<3; a++) {
+ if (cumap->cm[a].table==NULL)
curvemap_make_table(cumap->cm+a, &cumap->clipr);
cumap->cm[a].premultable= cumap->cm[a].table;
cumap->cm[a].table= MEM_mallocN((CM_TABLE+1)*sizeof(CurveMapPoint), "premul table");
memcpy(cumap->cm[a].table, cumap->cm[a].premultable, (CM_TABLE+1)*sizeof(CurveMapPoint));
}
- if(cumap->cm[3].table==NULL)
+ if (cumap->cm[3].table==NULL)
curvemap_make_table(cumap->cm+3, &cumap->clipr);
/* premul */
- for(a=0; a<3; a++) {
+ for (a=0; a<3; a++) {
int b;
- for(b=0; b<=CM_TABLE; b++) {
+ for (b=0; b<=CM_TABLE; b++) {
cumap->cm[a].table[b].y= curvemap_evaluateF(cumap->cm+3, cumap->cm[a].table[b].y);
}
}
@@ -602,8 +602,8 @@ static int sort_curvepoints(const void *a1, const void *a2)
{
const struct CurveMapPoint *x1=a1, *x2=a2;
- if( x1->x > x2->x ) return 1;
- else if( x1->x < x2->x) return -1;
+ if ( x1->x > x2->x ) return 1;
+ else if ( x1->x < x2->x) return -1;
return 0;
}
@@ -622,21 +622,21 @@ void curvemapping_changed(CurveMapping *cumap, int rem_doubles)
cumap->changed_timestamp++;
/* clamp with clip */
- if(cumap->flag & CUMA_DO_CLIP) {
- for(a=0; a<cuma->totpoint; a++) {
- if(cmp[a].flag & CUMA_SELECT) {
- if(cmp[a].x < clipr->xmin)
+ if (cumap->flag & CUMA_DO_CLIP) {
+ for (a=0; a<cuma->totpoint; a++) {
+ if (cmp[a].flag & CUMA_SELECT) {
+ if (cmp[a].x < clipr->xmin)
dx= MIN2(dx, cmp[a].x - clipr->xmin);
- else if(cmp[a].x > clipr->xmax)
+ else if (cmp[a].x > clipr->xmax)
dx= MAX2(dx, cmp[a].x - clipr->xmax);
- if(cmp[a].y < clipr->ymin)
+ if (cmp[a].y < clipr->ymin)
dy= MIN2(dy, cmp[a].y - clipr->ymin);
- else if(cmp[a].y > clipr->ymax)
+ else if (cmp[a].y > clipr->ymax)
dy= MAX2(dy, cmp[a].y - clipr->ymax);
}
}
- for(a=0; a<cuma->totpoint; a++) {
- if(cmp[a].flag & CUMA_SELECT) {
+ for (a=0; a<cuma->totpoint; a++) {
+ if (cmp[a].flag & CUMA_SELECT) {
cmp[a].x -= dx;
cmp[a].y -= dy;
}
@@ -647,25 +647,25 @@ void curvemapping_changed(CurveMapping *cumap, int rem_doubles)
qsort(cmp, cuma->totpoint, sizeof(CurveMapPoint), sort_curvepoints);
/* remove doubles, threshold set on 1% of default range */
- if(rem_doubles && cuma->totpoint>2) {
- for(a=0; a<cuma->totpoint-1; a++) {
+ if (rem_doubles && cuma->totpoint>2) {
+ for (a=0; a<cuma->totpoint-1; a++) {
dx= cmp[a].x - cmp[a+1].x;
dy= cmp[a].y - cmp[a+1].y;
- if( sqrtf(dx*dx + dy*dy) < thresh ) {
- if(a==0) {
+ if ( sqrtf(dx*dx + dy*dy) < thresh ) {
+ if (a==0) {
cmp[a+1].flag|= 2;
- if(cmp[a+1].flag & CUMA_SELECT)
+ if (cmp[a+1].flag & CUMA_SELECT)
cmp[a].flag |= CUMA_SELECT;
}
else {
cmp[a].flag|= 2;
- if(cmp[a].flag & CUMA_SELECT)
+ if (cmp[a].flag & CUMA_SELECT)
cmp[a+1].flag |= CUMA_SELECT;
}
break; /* we assume 1 deletion per edit is ok */
}
}
- if(a != cuma->totpoint-1)
+ if (a != cuma->totpoint-1)
curvemap_remove(cuma, 2);
}
curvemap_make_table(cuma, clipr);
@@ -682,11 +682,11 @@ float curvemap_evaluateF(CurveMap *cuma, float value)
i= (int)fi;
/* fi is table float index and should check against table range i.e. [0.0 CM_TABLE] */
- if(fi<0.0f || fi>CM_TABLE)
+ if (fi<0.0f || fi>CM_TABLE)
return curvemap_calc_extend(cuma, value, &cuma->table[0].x, &cuma->table[CM_TABLE].x);
else {
- if(i<0) return cuma->table[0].y;
- if(i>=CM_TABLE) return cuma->table[CM_TABLE].y;
+ if (i<0) return cuma->table[0].y;
+ if (i>=CM_TABLE) return cuma->table[CM_TABLE].y;
fi= fi-(float)i;
return (1.0f-fi)*cuma->table[i].y + (fi)*cuma->table[i+1].y;
@@ -699,9 +699,9 @@ float curvemapping_evaluateF(CurveMapping *cumap, int cur, float value)
CurveMap *cuma= cumap->cm+cur;
/* allocate or bail out */
- if(cuma->table==NULL) {
+ if (cuma->table==NULL) {
curvemap_make_table(cuma, &cumap->clipr);
- if(cuma->table==NULL)
+ if (cuma->table==NULL)
return 1.0f-value;
}
return curvemap_evaluateF(cuma, value);
@@ -750,11 +750,11 @@ void curvemapping_do_ibuf(CurveMapping *cumap, ImBuf *ibuf)
int stride= 4;
float *pix_out;
- if(ibuf==NULL)
+ if (ibuf==NULL)
return;
- if(ibuf->rect_float==NULL)
+ if (ibuf->rect_float==NULL)
IMB_float_from_rect(ibuf);
- else if(ibuf->rect==NULL)
+ else if (ibuf->rect==NULL)
imb_addrectImBuf(ibuf);
if (!ibuf->rect || !ibuf->rect_float)
@@ -769,11 +769,11 @@ void curvemapping_do_ibuf(CurveMapping *cumap, ImBuf *ibuf)
pix_in= ibuf->rect_float;
pix_out= tmpbuf->rect_float;
- if(ibuf->channels)
+ if (ibuf->channels)
stride= ibuf->channels;
- for(pixel= ibuf->x*ibuf->y; pixel>0; pixel--, pix_in+=stride, pix_out+=stride) {
- if(stride<3) {
+ for (pixel= ibuf->x*ibuf->y; pixel>0; pixel--, pix_in+=stride, pix_out+=stride) {
+ if (stride<3) {
col[0]= curvemap_evaluateF(cumap->cm, *pix_in);
pix_out[1]= pix_out[2]= pix_out[3]= pix_out[0]= col[0];
@@ -783,7 +783,7 @@ void curvemapping_do_ibuf(CurveMapping *cumap, ImBuf *ibuf)
pix_out[0]= col[0];
pix_out[1]= col[1];
pix_out[2]= col[2];
- if(stride>3)
+ if (stride>3)
pix_out[3]= pix_in[3];
else
pix_out[3]= 1.f;
@@ -801,21 +801,21 @@ int curvemapping_RGBA_does_something(CurveMapping *cumap)
{
int a;
- if(cumap->black[0]!=0.0f) return 1;
- if(cumap->black[1]!=0.0f) return 1;
- if(cumap->black[2]!=0.0f) return 1;
- if(cumap->white[0]!=1.0f) return 1;
- if(cumap->white[1]!=1.0f) return 1;
- if(cumap->white[2]!=1.0f) return 1;
+ if (cumap->black[0]!=0.0f) return 1;
+ if (cumap->black[1]!=0.0f) return 1;
+ if (cumap->black[2]!=0.0f) return 1;
+ if (cumap->white[0]!=1.0f) return 1;
+ if (cumap->white[1]!=1.0f) return 1;
+ if (cumap->white[2]!=1.0f) return 1;
- for(a=0; a<CM_TOT; a++) {
- if(cumap->cm[a].curve) {
- if(cumap->cm[a].totpoint!=2) return 1;
+ for (a=0; a<CM_TOT; a++) {
+ if (cumap->cm[a].curve) {
+ if (cumap->cm[a].totpoint!=2) return 1;
- if(cumap->cm[a].curve[0].x != 0.0f) return 1;
- if(cumap->cm[a].curve[0].y != 0.0f) return 1;
- if(cumap->cm[a].curve[1].x != 1.0f) return 1;
- if(cumap->cm[a].curve[1].y != 1.0f) return 1;
+ if (cumap->cm[a].curve[0].x != 0.0f) return 1;
+ if (cumap->cm[a].curve[0].y != 0.0f) return 1;
+ if (cumap->cm[a].curve[1].x != 1.0f) return 1;
+ if (cumap->cm[a].curve[1].y != 1.0f) return 1;
}
}
return 0;
@@ -825,10 +825,10 @@ void curvemapping_initialize(CurveMapping *cumap)
{
int a;
- if(cumap==NULL) return;
+ if (cumap==NULL) return;
- for(a=0; a<CM_TOT; a++) {
- if(cumap->cm[a].table==NULL)
+ for (a=0; a<CM_TOT; a++) {
+ if (cumap->cm[a].table==NULL)
curvemap_make_table(cumap->cm+a, &cumap->clipr);
}
}
@@ -841,14 +841,14 @@ void curvemapping_table_RGBA(CurveMapping *cumap, float **array, int *size)
*array = MEM_callocN(sizeof(float)*(*size)*4, "CurveMapping");
curvemapping_initialize(cumap);
- for(a=0; a<*size; a++) {
- if(cumap->cm[0].table)
+ for (a=0; a<*size; a++) {
+ if (cumap->cm[0].table)
(*array)[a*4+0]= cumap->cm[0].table[a].y;
- if(cumap->cm[1].table)
+ if (cumap->cm[1].table)
(*array)[a*4+1]= cumap->cm[1].table[a].y;
- if(cumap->cm[2].table)
+ if (cumap->cm[2].table)
(*array)[a*4+2]= cumap->cm[2].table[a].y;
- if(cumap->cm[3].table)
+ if (cumap->cm[3].table)
(*array)[a*4+3]= cumap->cm[3].table[a].y;
}
}
@@ -986,8 +986,11 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
for (y = 0; y < ibuf->y; y++) {
if (savedlines<scopes->sample_lines && y>=((savedlines)*ibuf->y)/(scopes->sample_lines+1)) {
- saveline=1;
- } else saveline=0;
+ saveline = 1;
+ }
+ else {
+ saveline = 0;
+ }
for (x = 0; x < ibuf->x; x++) {
if (is_float) {
@@ -1005,7 +1008,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
luma = rgb_to_luma(rgb);
/* check for min max */
- if(ycc_mode == -1 ) {
+ if (ycc_mode == -1 ) {
for (c=0; c<3; c++) {
if (rgb[c] < scopes->minmax[c][0]) scopes->minmax[c][0] = rgb[c];
if (rgb[c] > scopes->minmax[c][1]) scopes->minmax[c][1] = rgb[c];
@@ -1026,7 +1029,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
bin_lum[ get_bin_float(luma) ] += 1;
/* save sample if needed */
- if(saveline) {
+ if (saveline) {
const float fx = (float)x / (float)ibuf->x;
const int idx = 2*(ibuf->x*savedlines+x);
save_sample_line(scopes, idx, fx, rgb, ycc);
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index e8cd1526880..0a6e8a163cc 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -279,7 +279,7 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
/* prevent crashes in these unlikely events */
if (ob==NULL || mat==NULL) return;
- /* optimise trick - check if need to do anything */
+ /* optimize trick - check if need to do anything */
if (from == to) return;
/* are we dealing with pose-channels or objects */
@@ -490,7 +490,7 @@ static void contarget_get_mesh_mat (Object *ob, const char *substring, float mat
copy_v3_v3(plane, tmat[1]);
cross_v3_v3v3(mat[0], normal, plane);
- if(len_v3(mat[0]) < 1e-3f) {
+ if (len_v3(mat[0]) < 1e-3f) {
copy_v3_v3(plane, tmat[0]);
cross_v3_v3v3(mat[0], normal, plane);
}
@@ -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.
@@ -671,7 +671,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *UNUSED(cob), bC
}
/* This following macro should be used for all standard single-target *_get_tars functions
- * to save typing and reduce maintainance woes.
+ * to save typing and reduce maintenance woes.
* (Hopefully all compilers will be happy with the lines with just a space on them. Those are
* really just to help this code easier to read)
*/
@@ -705,7 +705,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *UNUSED(cob), bC
}
/* This following macro should be used for all standard single-target *_get_tars functions
- * to save typing and reduce maintainance woes. It does not do the subtarget related operations
+ * to save typing and reduce maintenance woes. It does not do the subtarget related operations
* (Hopefully all compilers will be happy with the lines with just a space on them. Those are
* really just to help this code easier to read)
*/
@@ -724,7 +724,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *UNUSED(cob), bC
}
/* This following macro should be used for all standard single-target *_flush_tars functions
- * to save typing and reduce maintainance woes.
+ * to save typing and reduce maintenance woes.
* Note: the pointer to ct will be changed to point to the next in the list (as it gets removed)
* (Hopefully all compilers will be happy with the lines with just a space on them. Those are
* really just to help this code easier to read)
@@ -745,7 +745,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *UNUSED(cob), bC
}
/* This following macro should be used for all standard single-target *_flush_tars functions
- * to save typing and reduce maintainance woes. It does not do the subtarget related operations.
+ * to save typing and reduce maintenance woes. It does not do the subtarget related operations.
* Note: the pointer to ct will be changed to point to the next in the list (as it gets removed)
* (Hopefully all compilers will be happy with the lines with just a space on them. Those are
* really just to help this code easier to read)
@@ -820,7 +820,7 @@ static void childof_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
float parmat[4][4];
/* simple matrix parenting */
- if(data->flag == CHILDOF_ALL) {
+ if (data->flag == CHILDOF_ALL) {
/* multiply target (parent matrix) by offset (parent inverse) to get
* the effect of the parent that will be exherted on the owner
@@ -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];
@@ -2148,7 +2148,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
float s, t;
short axis;
- /* initialise return matrix */
+ /* initialize return matrix */
unit_m4(ct->matrix);
/* get the transform matrix of the target */
@@ -2182,8 +2182,8 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
CLAMP(s, 0, 1);
t = (s * (data->end-data->start)) + data->start;
- if (G.f & G_DEBUG)
- printf("do Action Constraint %s - Ob %s Pchan %s \n", con->name, cob->ob->id.name+2, (cob->pchan)?cob->pchan->name:NULL);
+ if (G.debug & G_DEBUG)
+ printf("do Action Constraint %s - Ob %s Pchan %s\n", con->name, cob->ob->id.name+2, (cob->pchan)?cob->pchan->name:NULL);
/* Get the appropriate information from the action */
if (cob->type == CONSTRAINT_OBTYPE_BONE) {
@@ -2221,7 +2221,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
object_to_mat4(&workob, ct->matrix);
}
else {
- /* behaviour undefined... */
+ /* behavior undefined... */
puts("Error: unknown owner type for Action Constraint");
}
}
@@ -2878,7 +2878,7 @@ static void minmax_new_data (void *cdata)
data->minmaxflag = TRACK_Z;
data->offset = 0.0f;
- data->cache[0] = data->cache[1] = data->cache[2] = 0.0f;
+ zero_v3(data->cache);
data->flag = 0;
}
@@ -3188,25 +3188,15 @@ static void clampto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
/* find bounding-box range where target is located */
if (ownLoc[clamp_axis] < curveMin[clamp_axis]) {
/* bounding-box range is before */
- offset= curveMin[clamp_axis];
-
- while (ownLoc[clamp_axis] < offset)
- offset -= len;
-
+ offset = curveMin[clamp_axis] - ceil((curveMin[clamp_axis] - ownLoc[clamp_axis]) / len) * len;
+
/* now, we calculate as per normal, except using offset instead of curveMin[clamp_axis] */
curvetime = (ownLoc[clamp_axis] - offset) / (len);
}
else if (ownLoc[clamp_axis] > curveMax[clamp_axis]) {
/* bounding-box range is after */
- offset= curveMax[clamp_axis];
-
- while (ownLoc[clamp_axis] > offset) {
- if ((offset + len) > ownLoc[clamp_axis])
- break;
- else
- offset += len;
- }
-
+ offset= curveMax[clamp_axis] + (int)((ownLoc[clamp_axis] - curveMax[clamp_axis]) / len) * len;
+
/* now, we calculate as per normal, except using offset instead of curveMax[clamp_axis] */
curvetime = (ownLoc[clamp_axis] - offset) / (len);
}
@@ -3449,7 +3439,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
{
bShrinkwrapConstraint *scon = (bShrinkwrapConstraint *) con->data;
- if( VALID_CONS_TARGET(ct) && (ct->tar->type == OB_MESH) )
+ if ( VALID_CONS_TARGET(ct) && (ct->tar->type == OB_MESH) )
{
int fail = FALSE;
float co[3] = {0.0f, 0.0f, 0.0f};
@@ -3471,7 +3461,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
unit_m4(ct->matrix);
- if(target != NULL)
+ if (target != NULL)
{
space_transform_from_matrixs(&transform, cob->matrix, ct->tar->obmat);
@@ -3480,12 +3470,12 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
case MOD_SHRINKWRAP_NEAREST_SURFACE:
case MOD_SHRINKWRAP_NEAREST_VERTEX:
- if(scon->shrinkType == MOD_SHRINKWRAP_NEAREST_VERTEX)
+ if (scon->shrinkType == MOD_SHRINKWRAP_NEAREST_VERTEX)
bvhtree_from_mesh_verts(&treeData, target, 0.0, 2, 6);
else
bvhtree_from_mesh_faces(&treeData, target, 0.0, 2, 6);
- if(treeData.tree == NULL)
+ if (treeData.tree == NULL)
{
fail = TRUE;
break;
@@ -3496,19 +3486,18 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
BLI_bvhtree_find_nearest(treeData.tree, co, &nearest, treeData.nearest_callback, &treeData);
dist = len_v3v3(co, nearest.co);
- if(dist != 0.0f) {
+ if (dist != 0.0f) {
interp_v3_v3v3(co, co, nearest.co, (dist - scon->dist)/dist); /* linear interpolation */
}
space_transform_invert(&transform, co);
break;
case MOD_SHRINKWRAP_PROJECT:
- if(scon->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) no[0] = 1.0f;
- 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 (scon->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) no[0] = 1.0f;
+ 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;
}
@@ -3517,13 +3506,13 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
bvhtree_from_mesh_faces(&treeData, target, scon->dist, 4, 6);
- if(treeData.tree == NULL)
+ if (treeData.tree == NULL)
{
fail = TRUE;
break;
}
- if(normal_projection_project_vertex(0, co, no, &transform, treeData.tree, &hit, treeData.raycast_callback, &treeData) == FALSE)
+ if (normal_projection_project_vertex(0, co, no, &transform, treeData.tree, &hit, treeData.raycast_callback, &treeData) == FALSE)
{
fail = TRUE;
break;
@@ -3536,10 +3525,9 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
target->release(target);
- if(fail == TRUE)
- {
+ if (fail == TRUE) {
/* Don't move the point */
- co[0] = co[1] = co[2] = 0.0f;
+ zero_v3(co);
}
/* co is in local object coordinates, change it to global and update target position */
@@ -3637,7 +3625,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]);
@@ -3894,7 +3882,7 @@ static void pivotcon_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
/* correct the pivot by the rotation axis otherwise the pivot translates when it shouldnt */
mat3_to_axis_angle(axis, &angle, rotMat);
- if(angle) {
+ if (angle) {
float dvec[3];
sub_v3_v3v3(vec, pivot, cob->matrix[3]);
project_v3_v3v3(dvec, vec, axis);
@@ -3920,7 +3908,7 @@ static bConstraintTypeInfo CTI_PIVOT = {
NULL, /* relink data */
pivotcon_id_looper, /* id looper */
NULL, /* copy data */
- NULL, /* new data */ // XXX: might be needed to get 'normal' pivot behaviour...
+ NULL, /* new data */ // XXX: might be needed to get 'normal' pivot behavior...
pivotcon_get_tars, /* get constraint targets */
pivotcon_flush_tars, /* flush constraint targets */
default_get_tarmat, /* get target matrix */
@@ -3929,28 +3917,28 @@ static bConstraintTypeInfo CTI_PIVOT = {
/* ----------- Follow Track ------------- */
-static void followtrack_new_data (void *cdata)
+static void followtrack_new_data(void *cdata)
{
- bFollowTrackConstraint *data= (bFollowTrackConstraint *)cdata;
-
- data->clip= NULL;
+ bFollowTrackConstraint *data = (bFollowTrackConstraint *)cdata;
+
+ data->clip = NULL;
data->flag |= FOLLOWTRACK_ACTIVECLIP;
}
-static void followtrack_id_looper (bConstraint *con, ConstraintIDFunc func, void *userdata)
+static void followtrack_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
{
- bFollowTrackConstraint *data= con->data;
-
+ bFollowTrackConstraint *data = con->data;
+
func(con, (ID**)&data->clip, userdata);
func(con, (ID**)&data->camera, userdata);
func(con, (ID**)&data->depth_ob, userdata);
}
-static void followtrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets))
+static void followtrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets))
{
- Scene *scene= cob->scene;
- bFollowTrackConstraint *data= con->data;
- MovieClip *clip= data->clip;
+ Scene *scene = cob->scene;
+ bFollowTrackConstraint *data = con->data;
+ MovieClip *clip = data->clip;
MovieTracking *tracking;
MovieTrackingTrack *track;
MovieTrackingObject *tracking_object;
@@ -3962,17 +3950,17 @@ static void followtrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
if (!clip || !data->track[0] || !camob)
return;
- tracking= &clip->tracking;
+ tracking = &clip->tracking;
- if(data->object[0])
- tracking_object= BKE_tracking_named_object(tracking, data->object);
+ if (data->object[0])
+ tracking_object = BKE_tracking_named_object(tracking, data->object);
else
- tracking_object= BKE_tracking_get_camera_object(tracking);
+ tracking_object = BKE_tracking_get_camera_object(tracking);
- if(!tracking_object)
+ if (!tracking_object)
return;
- track= BKE_tracking_named_track(tracking, tracking_object, data->track);
+ track = BKE_tracking_named_track(tracking, tracking_object, data->track);
if (!track)
return;
@@ -3983,7 +3971,7 @@ static void followtrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
copy_m4_m4(obmat, cob->matrix);
- if((tracking_object->flag&TRACKING_OBJECT_CAMERA)==0) {
+ if ((tracking_object->flag & TRACKING_OBJECT_CAMERA)==0) {
float imat[4][4];
copy_m4_m4(mat, camob->obmat);
@@ -4005,15 +3993,15 @@ static void followtrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
else {
MovieTrackingMarker *marker;
float vec[3], disp[3], axis[3], mat[4][4];
- float aspect= (scene->r.xsch*scene->r.xasp) / (scene->r.ysch*scene->r.yasp);
+ float aspect= (scene->r.xsch * scene->r.xasp) / (scene->r.ysch * scene->r.yasp);
float len, d;
where_is_object_mat(scene, camob, mat);
/* camera axis */
- vec[0]= 0.0f;
- vec[1]= 0.0f;
- vec[2]= 1.0f;
+ vec[0] = 0.0f;
+ vec[1] = 0.0f;
+ vec[2] = 1.0f;
mul_v3_m4v3(axis, mat, vec);
/* distance to projection plane */
@@ -4021,13 +4009,13 @@ static void followtrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
sub_v3_v3(vec, mat[3]);
project_v3_v3v3(disp, vec, axis);
- len= len_v3(disp);
+ len = len_v3(disp);
if (len > FLT_EPSILON) {
CameraParams params;
float pos[2], rmat[4][4];
- marker= BKE_tracking_get_marker(track, scene->r.cfra);
+ marker = BKE_tracking_get_marker(track, scene->r.cfra);
add_v2_v2v2(pos, marker->pos, track->offset);
@@ -4035,12 +4023,14 @@ static void followtrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
camera_params_from_object(&params, camob);
if (params.is_ortho) {
- vec[0]= params.ortho_scale * (pos[0]-0.5f+params.shiftx);
- vec[1]= params.ortho_scale * (pos[1]-0.5f+params.shifty);
- vec[2]= -len;
+ vec[0] = params.ortho_scale * (pos[0] - 0.5f + params.shiftx);
+ vec[1] = params.ortho_scale * (pos[1] - 0.5f + params.shifty);
+ vec[2] = -len;
- if (aspect > 1.0f) vec[1] /= aspect;
- else vec[0] *= aspect;
+ if (aspect > 1.0f)
+ vec[1] /= aspect;
+ else
+ vec[0] *= aspect;
mul_v3_m4v3(disp, camob->obmat, vec);
@@ -4051,14 +4041,16 @@ static void followtrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
copy_v3_v3(cob->matrix[3], disp);
}
else {
- d= (len*params.sensor_x) / (2.0f*params.lens);
+ d= (len * params.sensor_x) / (2.0f * params.lens);
- vec[0]= d*(2.0f*(pos[0]+params.shiftx)-1.0f);
- vec[1]= d*(2.0f*(pos[1]+params.shifty)-1.0f);
- vec[2]= -len;
+ vec[0] = d * (2.0f * (pos[0] + params.shiftx) - 1.0f);
+ vec[1] = d * (2.0f * (pos[1] + params.shifty) - 1.0f);
+ vec[2] = -len;
- if (aspect > 1.0f) vec[1] /= aspect;
- else vec[0] *= aspect;
+ if (aspect > 1.0f)
+ vec[1] /= aspect;
+ else
+ vec[0] *= aspect;
mul_v3_m4v3(disp, camob->obmat, vec);
@@ -4070,9 +4062,9 @@ static void followtrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
copy_v3_v3(cob->matrix[3], disp);
}
- if(data->depth_ob && data->depth_ob->derivedFinal) {
- Object *depth_ob= data->depth_ob;
- BVHTreeFromMesh treeData= NULL_BVHTreeFromMesh;
+ if (data->depth_ob && data->depth_ob->derivedFinal) {
+ Object *depth_ob = data->depth_ob;
+ BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh;
BVHTreeRayHit hit;
float ray_start[3], ray_end[3], ray_nor[3], imat[4][4];
int result;
@@ -4086,12 +4078,12 @@ static void followtrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
bvhtree_from_mesh_faces(&treeData, depth_ob->derivedFinal, 0.0f, 4, 6);
- hit.dist= FLT_MAX;
- hit.index= -1;
+ hit.dist = FLT_MAX;
+ hit.index = -1;
- result= BLI_bvhtree_ray_cast(treeData.tree, ray_start, ray_nor, 0.0f, &hit, treeData.raycast_callback, &treeData);
+ result = BLI_bvhtree_ray_cast(treeData.tree, ray_start, ray_nor, 0.0f, &hit, treeData.raycast_callback, &treeData);
- if(result != -1) {
+ if (result != -1) {
mul_v3_m4v3(cob->matrix[3], depth_ob->obmat, hit.co);
}
@@ -4119,34 +4111,34 @@ static bConstraintTypeInfo CTI_FOLLOWTRACK = {
/* ----------- Camre Solver ------------- */
-static void camerasolver_new_data (void *cdata)
+static void camerasolver_new_data(void *cdata)
{
- bCameraSolverConstraint *data= (bCameraSolverConstraint *)cdata;
-
+ bCameraSolverConstraint *data = (bCameraSolverConstraint *)cdata;
+
data->clip = NULL;
data->flag |= CAMERASOLVER_ACTIVECLIP;
}
-static void camerasolver_id_looper (bConstraint *con, ConstraintIDFunc func, void *userdata)
+static void camerasolver_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
{
- bCameraSolverConstraint *data= con->data;
-
+ bCameraSolverConstraint *data = con->data;
+
func(con, (ID**)&data->clip, userdata);
}
-static void camerasolver_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets))
+static void camerasolver_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets))
{
- Scene *scene= cob->scene;
- bCameraSolverConstraint *data= con->data;
- MovieClip *clip= data->clip;
+ Scene *scene = cob->scene;
+ bCameraSolverConstraint *data = con->data;
+ MovieClip *clip = data->clip;
if (data->flag & CAMERASOLVER_ACTIVECLIP)
- clip= scene->clip;
+ clip = scene->clip;
if (clip) {
float mat[4][4], obmat[4][4];
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingObject *object= BKE_tracking_get_camera_object(tracking);
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingObject *object = BKE_tracking_get_camera_object(tracking);
BKE_tracking_get_interpolated_camera(tracking, object, scene->r.cfra, mat);
@@ -4174,16 +4166,16 @@ static bConstraintTypeInfo CTI_CAMERASOLVER = {
/* ----------- Object Solver ------------- */
-static void objectsolver_new_data (void *cdata)
+static void objectsolver_new_data(void *cdata)
{
- bObjectSolverConstraint *data= (bObjectSolverConstraint *)cdata;
+ bObjectSolverConstraint *data = (bObjectSolverConstraint *)cdata;
data->clip = NULL;
data->flag |= OBJECTSOLVER_ACTIVECLIP;
unit_m4(data->invmat);
}
-static void objectsolver_id_looper (bConstraint *con, ConstraintIDFunc func, void *userdata)
+static void objectsolver_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
{
bObjectSolverConstraint *data= con->data;
@@ -4191,26 +4183,26 @@ static void objectsolver_id_looper (bConstraint *con, ConstraintIDFunc func, voi
func(con, (ID**)&data->camera, userdata);
}
-static void objectsolver_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets))
+static void objectsolver_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets))
{
- Scene *scene= cob->scene;
- bObjectSolverConstraint *data= con->data;
- MovieClip *clip= data->clip;
- Object *camob= data->camera ? data->camera : scene->camera;
+ Scene *scene = cob->scene;
+ bObjectSolverConstraint *data = con->data;
+ MovieClip *clip = data->clip;
+ Object *camob = data->camera ? data->camera : scene->camera;
if (data->flag & OBJECTSOLVER_ACTIVECLIP)
clip= scene->clip;
- if(!camob || !clip)
+ if (!camob || !clip)
return;
if (clip) {
- MovieTracking *tracking= &clip->tracking;
+ MovieTracking *tracking = &clip->tracking;
MovieTrackingObject *object;
- object= BKE_tracking_named_object(tracking, data->object);
+ object = BKE_tracking_named_object(tracking, data->object);
- if(object) {
+ if (object) {
float mat[4][4], obmat[4][4], imat[4][4], cammat[4][4], camimat[4][4], parmat[4][4];
where_is_object_mat(scene, camob, cammat);
@@ -4294,7 +4286,7 @@ static void constraints_init_typeinfo (void)
*/
bConstraintTypeInfo *get_constraint_typeinfo (int type)
{
- /* initialise the type-info list? */
+ /* initialize the type-info list? */
if (CTI_INIT) {
constraints_init_typeinfo();
CTI_INIT = 0;
@@ -4308,7 +4300,7 @@ bConstraintTypeInfo *get_constraint_typeinfo (int type)
return constraintsTypeInfo[type];
}
else {
- printf("No valid constraint type-info data available. Type = %i \n", type);
+ printf("No valid constraint type-info data available. Type = %i\n", type);
}
return NULL;
@@ -4398,7 +4390,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");
@@ -4412,7 +4404,7 @@ static bConstraint *add_new_constraint_internal (const char *name, short type)
/* Determine a basic name, and info */
if (cti) {
- /* initialise constraint data */
+ /* initialize constraint data */
con->data = MEM_callocN(cti->size, cti->structName);
/* only constraints that change any settings need this */
@@ -4576,7 +4568,7 @@ void copy_constraints (ListBase *dst, const ListBase *src, int do_extern)
if (cti->copy_data)
cti->copy_data(con, srccon);
- /* for proxies we dont want to make extern */
+ /* for proxies we don't want to make extern */
if (do_extern) {
/* go over used ID-links for this constraint to ensure that they are valid for proxies */
if (cti->id_looper)
@@ -4722,7 +4714,7 @@ void get_constraint_target_matrix (struct Scene *scene, bConstraint *con, int n,
/* only calculate the target matrix on the first target */
ct= (bConstraintTarget *)targets.first;
- while(ct && n-- > 0)
+ while (ct && n-- > 0)
ct= ct->next;
if (ct) {
@@ -4757,7 +4749,7 @@ void get_constraint_targets_for_solving (bConstraint *con, bConstraintOb *cob, L
cti->get_constraint_targets(con, targets);
/* set matrices
- * - calculate if possible, otherwise just initialise as identity matrix
+ * - calculate if possible, otherwise just initialize as identity matrix
*/
if (cti->get_target_matrix) {
for (ct= targets->first; ct; ct= ct->next)
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index 05c56fa8101..a725b5f4c52 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -120,8 +120,8 @@ bContextStore *CTX_store_add(ListBase *contexts, const char *name, PointerRNA *p
* we have to copy the context to ensure */
ctx= contexts->last;
- if(!ctx || ctx->used) {
- if(ctx) {
+ if (!ctx || ctx->used) {
+ if (ctx) {
lastctx= ctx;
ctx= MEM_dupallocN(lastctx);
BLI_duplicatelist(&ctx->entries, &lastctx->entries);
@@ -166,7 +166,7 @@ void CTX_store_free_list(ListBase *contexts)
{
bContextStore *ctx;
- while((ctx= contexts->first)) {
+ while ((ctx= contexts->first)) {
BLI_remlink(contexts, ctx);
CTX_store_free(ctx);
}
@@ -243,127 +243,127 @@ struct ReportList *CTX_wm_reports(const bContext *C)
View3D *CTX_wm_view3d(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_VIEW3D)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_VIEW3D)
return C->wm.area->spacedata.first;
return NULL;
}
RegionView3D *CTX_wm_region_view3d(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_VIEW3D)
- if(C->wm.region)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_VIEW3D)
+ if (C->wm.region)
return C->wm.region->regiondata;
return NULL;
}
struct SpaceText *CTX_wm_space_text(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_TEXT)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_TEXT)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceConsole *CTX_wm_space_console(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_CONSOLE)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_CONSOLE)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceImage *CTX_wm_space_image(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_IMAGE)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_IMAGE)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceButs *CTX_wm_space_buts(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_BUTS)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_BUTS)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceFile *CTX_wm_space_file(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_FILE)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_FILE)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceSeq *CTX_wm_space_seq(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_SEQ)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_SEQ)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceOops *CTX_wm_space_outliner(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_OUTLINER)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_OUTLINER)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceNla *CTX_wm_space_nla(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_NLA)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_NLA)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceTime *CTX_wm_space_time(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_TIME)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_TIME)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceNode *CTX_wm_space_node(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_NODE)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_NODE)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceLogic *CTX_wm_space_logic(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_LOGIC)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_LOGIC)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceIpo *CTX_wm_space_graph(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_IPO)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_IPO)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceAction *CTX_wm_space_action(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_ACTION)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_ACTION)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceInfo *CTX_wm_space_info(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_INFO)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_INFO)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceUserPref *CTX_wm_space_userpref(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_USERPREF)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_USERPREF)
return C->wm.area->spacedata.first;
return NULL;
}
struct SpaceClip *CTX_wm_space_clip(const bContext *C)
{
- if(C->wm.area && C->wm.area->spacetype==SPACE_CLIP)
+ if (C->wm.area && C->wm.area->spacetype==SPACE_CLIP)
return C->wm.area->spacedata.first;
return NULL;
}
@@ -381,7 +381,7 @@ void CTX_wm_window_set(bContext *C, wmWindow *win)
{
C->wm.window= win;
C->wm.screen= (win)? win->screen: NULL;
- if(C->wm.screen)
+ if (C->wm.screen)
C->data.scene= C->wm.screen->scene;
C->wm.area= NULL;
C->wm.region= NULL;
@@ -390,7 +390,7 @@ void CTX_wm_window_set(bContext *C, wmWindow *win)
void CTX_wm_screen_set(bContext *C, bScreen *screen)
{
C->wm.screen= screen;
- if(C->wm.screen)
+ if (C->wm.screen)
C->data.scene= C->wm.screen->scene;
C->wm.area= NULL;
C->wm.region= NULL;
@@ -438,7 +438,7 @@ static int ctx_data_get(bContext *C, const char *member, bContextDataResult *res
memset(result, 0, sizeof(bContextDataResult));
#ifdef WITH_PYTHON
- if(CTX_py_dict_get(C)) {
+ if (CTX_py_dict_get(C)) {
return BPY_context_member_get(C, member, result);
// if (BPY_context_member_get(C, member, result))
// return 1;
@@ -448,43 +448,43 @@ static int ctx_data_get(bContext *C, const char *member, bContextDataResult *res
* loops requesting data from ourselfs in a context callback */
/* Ok, this looks evil...
- * if(ret) done= -(-ret | -done);
+ * if (ret) done= -(-ret | -done);
*
* Values in order of importance
* (0, -1, 1) - Where 1 is highest priority
* */
- if(done!=1 && recursion < 1 && C->wm.store) {
+ if (done!=1 && recursion < 1 && C->wm.store) {
bContextStoreEntry *entry;
C->data.recursion= 1;
entry= BLI_rfindstring(&C->wm.store->entries, member, offsetof(bContextStoreEntry, name));
- if(entry) {
+ if (entry) {
result->ptr= entry->ptr;
done= 1;
}
}
- if(done!=1 && recursion < 2 && C->wm.region) {
+ if (done!=1 && recursion < 2 && C->wm.region) {
C->data.recursion= 2;
- if(C->wm.region->type && C->wm.region->type->context) {
+ if (C->wm.region->type && C->wm.region->type->context) {
ret = C->wm.region->type->context(C, member, result);
- if(ret) done= -(-ret | -done);
+ if (ret) done= -(-ret | -done);
}
}
- if(done!=1 && recursion < 3 && C->wm.area) {
+ if (done!=1 && recursion < 3 && C->wm.area) {
C->data.recursion= 3;
- if(C->wm.area->type && C->wm.area->type->context) {
+ if (C->wm.area->type && C->wm.area->type->context) {
ret = C->wm.area->type->context(C, member, result);
- if(ret) done= -(-ret | -done);
+ if (ret) done= -(-ret | -done);
}
}
- if(done!=1 && recursion < 4 && C->wm.screen) {
+ if (done!=1 && recursion < 4 && C->wm.screen) {
bContextDataCallback cb= C->wm.screen->context;
C->data.recursion= 4;
- if(cb) {
+ if (cb) {
ret = cb(C, member, result);
- if(ret) done= -(-ret | -done);
+ if (ret) done= -(-ret | -done);
}
}
@@ -497,7 +497,7 @@ static void *ctx_data_pointer_get(const bContext *C, const char *member)
{
bContextDataResult result;
- if(C && ctx_data_get((bContext*)C, member, &result)==1)
+ if (C && ctx_data_get((bContext*)C, member, &result)==1)
return result.ptr.data;
return NULL;
@@ -512,7 +512,7 @@ static int ctx_data_pointer_verify(const bContext *C, const char *member, void *
*pointer= NULL;
return 1;
}
- else if(ctx_data_get((bContext*)C, member, &result)==1) {
+ else if (ctx_data_get((bContext*)C, member, &result)==1) {
*pointer= result.ptr.data;
return 1;
}
@@ -526,7 +526,7 @@ static int ctx_data_collection_get(const bContext *C, const char *member, ListBa
{
bContextDataResult result;
- if(ctx_data_get((bContext*)C, member, &result)==1) {
+ if (ctx_data_get((bContext*)C, member, &result)==1) {
*list= result.list;
return 1;
}
@@ -541,7 +541,7 @@ PointerRNA CTX_data_pointer_get(const bContext *C, const char *member)
{
bContextDataResult result;
- if(ctx_data_get((bContext*)C, member, &result)==1)
+ if (ctx_data_get((bContext*)C, member, &result)==1)
return result.ptr;
else
return PointerRNA_NULL;
@@ -551,7 +551,7 @@ PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, Stru
{
PointerRNA ptr = CTX_data_pointer_get(C, member);
- if(ptr.data && RNA_struct_is_a(ptr.type, type))
+ if (ptr.data && RNA_struct_is_a(ptr.type, type))
return ptr;
return PointerRNA_NULL;
@@ -561,7 +561,7 @@ ListBase CTX_data_collection_get(const bContext *C, const char *member)
{
bContextDataResult result;
- if(ctx_data_get((bContext*)C, member, &result)==1) {
+ if (ctx_data_get((bContext*)C, member, &result)==1) {
return result.list;
}
else {
@@ -576,7 +576,7 @@ int CTX_data_get(const bContext *C, const char *member, PointerRNA *r_ptr, ListB
bContextDataResult result;
int ret= ctx_data_get((bContext*)C, member, &result);
- if(ret==1) {
+ if (ret==1) {
*r_ptr= result.ptr;
*r_lb= result.list;
*r_type= result.type;
@@ -594,10 +594,10 @@ static void data_dir_add(ListBase *lb, const char *member)
{
LinkData *link;
- if(strcmp(member, "scene") == 0) /* exception */
+ if (strcmp(member, "scene") == 0) /* exception */
return;
- if(BLI_findstring(lb, member, offsetof(LinkData, data)))
+ if (BLI_findstring(lb, member, offsetof(LinkData, data)))
return;
link= MEM_callocN(sizeof(LinkData), "LinkData");
@@ -613,35 +613,35 @@ ListBase CTX_data_dir_get(const bContext *C)
memset(&lb, 0, sizeof(lb));
- if(C->wm.store) {
+ if (C->wm.store) {
bContextStoreEntry *entry;
- for(entry=C->wm.store->entries.first; entry; entry=entry->next)
+ for (entry=C->wm.store->entries.first; entry; entry=entry->next)
data_dir_add(&lb, entry->name);
}
- if(C->wm.region && C->wm.region->type && C->wm.region->type->context) {
+ if (C->wm.region && C->wm.region->type && C->wm.region->type->context) {
memset(&result, 0, sizeof(result));
C->wm.region->type->context(C, "", &result);
- if(result.dir)
- for(a=0; result.dir[a]; a++)
+ if (result.dir)
+ for (a=0; result.dir[a]; a++)
data_dir_add(&lb, result.dir[a]);
}
- if(C->wm.area && C->wm.area->type && C->wm.area->type->context) {
+ if (C->wm.area && C->wm.area->type && C->wm.area->type->context) {
memset(&result, 0, sizeof(result));
C->wm.area->type->context(C, "", &result);
- if(result.dir)
- for(a=0; result.dir[a]; a++)
+ if (result.dir)
+ for (a=0; result.dir[a]; a++)
data_dir_add(&lb, result.dir[a]);
}
- if(C->wm.screen && C->wm.screen->context) {
+ if (C->wm.screen && C->wm.screen->context) {
bContextDataCallback cb= C->wm.screen->context;
memset(&result, 0, sizeof(result));
cb(C, "", &result);
- if(result.dir)
- for(a=0; result.dir[a]; a++)
+ if (result.dir)
+ for (a=0; result.dir[a]; a++)
data_dir_add(&lb, result.dir[a]);
}
@@ -692,7 +692,7 @@ int ctx_data_list_count(const bContext *C, int (*func)(const bContext*, ListBase
{
ListBase list;
- if(func(C, &list)) {
+ if (func(C, &list)) {
int tot= BLI_countlist(&list);
BLI_freelistN(&list);
return tot;
@@ -722,7 +722,7 @@ Main *CTX_data_main(const bContext *C)
{
Main *bmain;
- if(ctx_data_pointer_verify(C, "blend_data", (void*)&bmain))
+ if (ctx_data_pointer_verify(C, "blend_data", (void*)&bmain))
return bmain;
else
return C->data.main;
@@ -737,7 +737,7 @@ Scene *CTX_data_scene(const bContext *C)
{
Scene *scene;
- if(ctx_data_pointer_verify(C, "scene", (void*)&scene))
+ if (ctx_data_pointer_verify(C, "scene", (void*)&scene))
return scene;
else
return C->data.scene;
@@ -747,7 +747,7 @@ int CTX_data_mode_enum(const bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
- if(obedit) {
+ if (obedit) {
switch(obedit->type) {
case OB_MESH:
return CTX_MODE_EDIT_MESH;
@@ -768,13 +768,13 @@ int CTX_data_mode_enum(const bContext *C)
else {
Object *ob = CTX_data_active_object(C);
- if(ob) {
- if(ob->mode & OB_MODE_POSE) return CTX_MODE_POSE;
- else if(ob->mode & OB_MODE_SCULPT) return CTX_MODE_SCULPT;
- else if(ob->mode & OB_MODE_WEIGHT_PAINT) return CTX_MODE_PAINT_WEIGHT;
- else if(ob->mode & OB_MODE_VERTEX_PAINT) return CTX_MODE_PAINT_VERTEX;
- else if(ob->mode & OB_MODE_TEXTURE_PAINT) return CTX_MODE_PAINT_TEXTURE;
- else if(ob->mode & OB_MODE_PARTICLE_EDIT) return CTX_MODE_PARTICLE;
+ if (ob) {
+ if (ob->mode & OB_MODE_POSE) return CTX_MODE_POSE;
+ else if (ob->mode & OB_MODE_SCULPT) return CTX_MODE_SCULPT;
+ else if (ob->mode & OB_MODE_WEIGHT_PAINT) return CTX_MODE_PAINT_WEIGHT;
+ else if (ob->mode & OB_MODE_VERTEX_PAINT) return CTX_MODE_PAINT_VERTEX;
+ else if (ob->mode & OB_MODE_TEXTURE_PAINT) return CTX_MODE_PAINT_TEXTURE;
+ else if (ob->mode & OB_MODE_PARTICLE_EDIT) return CTX_MODE_PARTICLE;
}
}
@@ -815,7 +815,7 @@ ToolSettings *CTX_data_tool_settings(const bContext *C)
{
Scene *scene = CTX_data_scene(C);
- if(scene)
+ if (scene)
return scene->toolsettings;
else
return NULL;
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 931934f8052..9232fe8ec04 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -74,38 +74,38 @@ void unlink_curve(Curve *cu)
{
int a;
- for(a=0; a<cu->totcol; a++) {
- if(cu->mat[a]) cu->mat[a]->id.us--;
+ for (a=0; a<cu->totcol; a++) {
+ if (cu->mat[a]) cu->mat[a]->id.us--;
cu->mat[a]= NULL;
}
- if(cu->vfont) cu->vfont->id.us--;
+ if (cu->vfont) cu->vfont->id.us--;
cu->vfont= NULL;
- if(cu->vfontb) cu->vfontb->id.us--;
+ if (cu->vfontb) cu->vfontb->id.us--;
cu->vfontb= NULL;
- if(cu->vfonti) cu->vfonti->id.us--;
+ if (cu->vfonti) cu->vfonti->id.us--;
cu->vfonti= NULL;
- if(cu->vfontbi) cu->vfontbi->id.us--;
+ if (cu->vfontbi) cu->vfontbi->id.us--;
cu->vfontbi= NULL;
- if(cu->key) cu->key->id.us--;
+ if (cu->key) cu->key->id.us--;
cu->key= NULL;
}
/* frees editcurve entirely */
void BKE_free_editfont(Curve *cu)
{
- if(cu->editfont) {
+ if (cu->editfont) {
EditFont *ef= cu->editfont;
- if(ef->oldstr) MEM_freeN(ef->oldstr);
- if(ef->oldstrinfo) MEM_freeN(ef->oldstrinfo);
- if(ef->textbuf) MEM_freeN(ef->textbuf);
- if(ef->textbufinfo) MEM_freeN(ef->textbufinfo);
- if(ef->copybuf) MEM_freeN(ef->copybuf);
- if(ef->copybufinfo) MEM_freeN(ef->copybufinfo);
+ if (ef->oldstr) MEM_freeN(ef->oldstr);
+ if (ef->oldstrinfo) MEM_freeN(ef->oldstrinfo);
+ if (ef->textbuf) MEM_freeN(ef->textbuf);
+ if (ef->textbufinfo) MEM_freeN(ef->textbufinfo);
+ if (ef->copybuf) MEM_freeN(ef->copybuf);
+ if (ef->copybufinfo) MEM_freeN(ef->copybufinfo);
MEM_freeN(ef);
cu->editfont= NULL;
@@ -123,7 +123,7 @@ void free_curve_editNurb_keyIndex(EditNurb *editnurb)
void free_curve_editNurb (Curve *cu)
{
- if(cu->editnurb) {
+ if (cu->editnurb) {
freeNurblist(&cu->editnurb->nurbs);
free_curve_editNurb_keyIndex(cu->editnurb);
MEM_freeN(cu->editnurb);
@@ -143,21 +143,20 @@ void free_curve(Curve *cu)
unlink_curve(cu);
BKE_free_animdata((ID *)cu);
- if(cu->mat) MEM_freeN(cu->mat);
- if(cu->str) MEM_freeN(cu->str);
- if(cu->strinfo) MEM_freeN(cu->strinfo);
- if(cu->bb) MEM_freeN(cu->bb);
- if(cu->path) free_path(cu->path);
- if(cu->tb) MEM_freeN(cu->tb);
+ if (cu->mat) MEM_freeN(cu->mat);
+ if (cu->str) MEM_freeN(cu->str);
+ if (cu->strinfo) MEM_freeN(cu->strinfo);
+ if (cu->bb) MEM_freeN(cu->bb);
+ if (cu->path) free_path(cu->path);
+ if (cu->tb) MEM_freeN(cu->tb);
}
Curve *add_curve(const char *name, int type)
{
Curve *cu;
- cu= alloc_libblock(&G.main->curve, ID_CU, name);
-
- cu->size[0]= cu->size[1]= cu->size[2]= 1.0;
+ cu = alloc_libblock(&G.main->curve, ID_CU, name);
+ copy_v3_fl(cu->size, 1.0f);
cu->flag= CU_FRONT|CU_BACK|CU_DEFORM_BOUNDS_OFF|CU_PATH_RADIUS;
cu->pathlen= 100;
cu->resolu= cu->resolv= (type == OB_SURF) ? 4 : 12;
@@ -173,7 +172,7 @@ Curve *add_curve(const char *name, int type)
cu->bb= unit_boundbox();
- if(type==OB_FONT) {
+ if (type==OB_FONT) {
cu->vfont= cu->vfontb= cu->vfonti= cu->vfontbi= get_builtin_font();
cu->vfont->id.us+=4;
cu->str= MEM_mallocN(12, "str");
@@ -198,7 +197,7 @@ Curve *copy_curve(Curve *cu)
duplicateNurblist( &(cun->nurb), &(cu->nurb));
cun->mat= MEM_dupallocN(cu->mat);
- for(a=0; a<cun->totcol; a++) {
+ for (a=0; a<cun->totcol; a++) {
id_us_plus((ID *)cun->mat[a]);
}
@@ -208,7 +207,7 @@ Curve *copy_curve(Curve *cu)
cun->bb= MEM_dupallocN(cu->bb);
cun->key= copy_key(cu->key);
- if(cun->key) cun->key->from= (ID *)cun;
+ if (cun->key) cun->key->from= (ID *)cun;
cun->disp.first= cun->disp.last= NULL;
cun->bev.first= cun->bev.last= NULL;
@@ -220,7 +219,7 @@ Curve *copy_curve(Curve *cu)
#if 0 // XXX old animation system
/* single user ipo too */
- if(cun->ipo) cun->ipo= copy_ipo(cun->ipo);
+ if (cun->ipo) cun->ipo= copy_ipo(cun->ipo);
#endif // XXX old animation system
id_us_plus((ID *)cun->vfont);
@@ -238,7 +237,7 @@ static void extern_local_curve(Curve *cu)
id_lib_extern((ID *)cu->vfonti);
id_lib_extern((ID *)cu->vfontbi);
- if(cu->mat) {
+ if (cu->mat) {
extern_local_matarar(cu->mat, cu->totcol);
}
}
@@ -254,34 +253,34 @@ void make_local_curve(Curve *cu)
* - mixed: do a copy
*/
- if(cu->id.lib==NULL) return;
+ if (cu->id.lib==NULL) return;
- if(cu->id.us==1) {
+ if (cu->id.us==1) {
id_clear_lib_data(bmain, &cu->id);
extern_local_curve(cu);
return;
}
- for(ob= bmain->object.first; ob && ELEM(0, is_lib, is_local); ob= ob->id.next) {
- if(ob->data == cu) {
- if(ob->id.lib) is_lib= TRUE;
+ for (ob= bmain->object.first; ob && ELEM(0, is_lib, is_local); ob= ob->id.next) {
+ if (ob->data == cu) {
+ if (ob->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
}
- if(is_local && is_lib == FALSE) {
+ if (is_local && is_lib == FALSE) {
id_clear_lib_data(bmain, &cu->id);
extern_local_curve(cu);
}
- else if(is_local && is_lib) {
+ else if (is_local && is_lib) {
Curve *cu_new= copy_curve(cu);
cu_new->id.us= 0;
BKE_id_lib_local_paths(bmain, cu->id.lib, &cu_new->id);
- for(ob= bmain->object.first; ob; ob= ob->id.next) {
- if(ob->data==cu) {
- if(ob->id.lib==NULL) {
+ for (ob= bmain->object.first; ob; ob= ob->id.next) {
+ if (ob->data==cu) {
+ if (ob->id.lib==NULL) {
ob->data= cu_new;
cu_new->id.us++;
cu->id.us--;
@@ -306,15 +305,15 @@ short curve_type(Curve *cu)
Nurb *nu;
int type= cu->type;
- if(cu->vfont) {
+ if (cu->vfont) {
return OB_FONT;
}
- if(!cu->type) {
+ if (!cu->type) {
type= OB_CURVE;
for (nu= cu->nurb.first; nu; nu= nu->next) {
- if(nu->pntsv>1) {
+ if (nu->pntsv>1) {
type= OB_SURF;
}
}
@@ -328,18 +327,18 @@ void update_curve_dimension(Curve *cu)
ListBase *nurbs= BKE_curve_nurbs(cu);
Nurb *nu= nurbs->first;
- if(cu->flag&CU_3D) {
- for( ; nu; nu= nu->next) {
+ if (cu->flag&CU_3D) {
+ for ( ; nu; nu= nu->next) {
nu->flag &= ~CU_2D;
}
}
else {
- for( ; nu; nu= nu->next) {
+ for ( ; nu; nu= nu->next) {
nu->flag |= CU_2D;
test2DNurb(nu);
/* since the handles are moved they need to be auto-located again */
- if(nu->type == CU_BEZIER)
+ if (nu->type == CU_BEZIER)
calchandlesNurb(nu);
}
}
@@ -349,7 +348,7 @@ void test_curve_type(Object *ob)
{
ob->type= curve_type(ob->data);
- if(ob->type==OB_CURVE)
+ if (ob->type==OB_CURVE)
update_curve_dimension((Curve *)ob->data);
}
@@ -360,51 +359,51 @@ void tex_space_curve(Curve *cu)
float *fp, min[3], max[3];
int tot, doit= 0;
- if(cu->bb==NULL) cu->bb= MEM_callocN(sizeof(BoundBox), "boundbox");
+ if (cu->bb==NULL) cu->bb= MEM_callocN(sizeof(BoundBox), "boundbox");
bb= cu->bb;
INIT_MINMAX(min, max);
dl= cu->disp.first;
- while(dl) {
+ while (dl) {
tot = ELEM(dl->type, DL_INDEX3, DL_INDEX4) ? dl->nr : dl->nr * dl->parts;
- if(tot) doit= 1;
+ if (tot) doit= 1;
fp= dl->verts;
- while(tot--) {
+ while (tot--) {
DO_MINMAX(fp, min, max);
fp += 3;
}
dl= dl->next;
}
- if(!doit) {
+ if (!doit) {
min[0] = min[1] = min[2] = -1.0f;
max[0] = max[1] = max[2] = 1.0f;
}
boundbox_set_from_min_max(bb, min, max);
- if(cu->texflag & CU_AUTOSPACE) {
+ if (cu->texflag & CU_AUTOSPACE) {
mid_v3_v3v3(cu->loc, min, max);
cu->size[0]= (max[0]-min[0])/2.0f;
cu->size[1]= (max[1]-min[1])/2.0f;
cu->size[2]= (max[2]-min[2])/2.0f;
- cu->rot[0]= cu->rot[1]= cu->rot[2]= 0.0f;
+ zero_v3(cu->rot);
- if(cu->size[0]==0.0f) cu->size[0]= 1.0f;
- else if(cu->size[0]>0.0f && cu->size[0]<0.00001f) cu->size[0]= 0.00001f;
- else if(cu->size[0]<0.0f && cu->size[0]> -0.00001f) cu->size[0]= -0.00001f;
+ if (cu->size[0]==0.0f) cu->size[0]= 1.0f;
+ else if (cu->size[0]>0.0f && cu->size[0]<0.00001f) cu->size[0]= 0.00001f;
+ else if (cu->size[0]<0.0f && cu->size[0]> -0.00001f) cu->size[0]= -0.00001f;
- if(cu->size[1]==0.0f) cu->size[1]= 1.0f;
- else if(cu->size[1]>0.0f && cu->size[1]<0.00001f) cu->size[1]= 0.00001f;
- else if(cu->size[1]<0.0f && cu->size[1]> -0.00001f) cu->size[1]= -0.00001f;
+ if (cu->size[1]==0.0f) cu->size[1]= 1.0f;
+ else if (cu->size[1]>0.0f && cu->size[1]<0.00001f) cu->size[1]= 0.00001f;
+ else if (cu->size[1]<0.0f && cu->size[1]> -0.00001f) cu->size[1]= -0.00001f;
- if(cu->size[2]==0.0f) cu->size[2]= 1.0f;
- else if(cu->size[2]>0.0f && cu->size[2]<0.00001f) cu->size[2]= 0.00001f;
- else if(cu->size[2]<0.0f && cu->size[2]> -0.00001f) cu->size[2]= -0.00001f;
+ if (cu->size[2]==0.0f) cu->size[2]= 1.0f;
+ else if (cu->size[2]>0.0f && cu->size[2]<0.00001f) cu->size[2]= 0.00001f;
+ else if (cu->size[2]<0.0f && cu->size[2]> -0.00001f) cu->size[2]= -0.00001f;
}
}
@@ -415,9 +414,9 @@ int count_curveverts(ListBase *nurb)
int tot=0;
nu= nurb->first;
- while(nu) {
- if(nu->bezt) tot+= 3*nu->pntsu;
- else if(nu->bp) tot+= nu->pntsu*nu->pntsv;
+ while (nu) {
+ if (nu->bezt) tot+= 3*nu->pntsu;
+ else if (nu->bp) tot+= nu->pntsu*nu->pntsv;
nu= nu->next;
}
@@ -430,9 +429,9 @@ int count_curveverts_without_handles(ListBase *nurb)
int tot=0;
nu= nurb->first;
- while(nu) {
- if(nu->bezt) tot+= nu->pntsu;
- else if(nu->bp) tot+= nu->pntsu*nu->pntsv;
+ while (nu) {
+ if (nu->bezt) tot+= nu->pntsu;
+ else if (nu->bp) tot+= nu->pntsu*nu->pntsv;
nu= nu->next;
}
@@ -444,17 +443,17 @@ int count_curveverts_without_handles(ListBase *nurb)
void freeNurb(Nurb *nu)
{
- if(nu==NULL) return;
+ if (nu==NULL) return;
- if(nu->bezt) MEM_freeN(nu->bezt);
+ if (nu->bezt) MEM_freeN(nu->bezt);
nu->bezt= NULL;
- if(nu->bp) MEM_freeN(nu->bp);
+ if (nu->bp) MEM_freeN(nu->bp);
nu->bp= NULL;
- if(nu->knotsu) MEM_freeN(nu->knotsu);
+ if (nu->knotsu) MEM_freeN(nu->knotsu);
nu->knotsu= NULL;
- if(nu->knotsv) MEM_freeN(nu->knotsv);
+ if (nu->knotsv) MEM_freeN(nu->knotsv);
nu->knotsv= NULL;
- /* if(nu->trim.first) freeNurblist(&(nu->trim)); */
+ /* if (nu->trim.first) freeNurblist(&(nu->trim)); */
MEM_freeN(nu);
@@ -465,10 +464,10 @@ void freeNurblist(ListBase *lb)
{
Nurb *nu, *next;
- if(lb==NULL) return;
+ if (lb==NULL) return;
nu= lb->first;
- while(nu) {
+ while (nu) {
next= nu->next;
freeNurb(nu);
nu= next;
@@ -482,10 +481,10 @@ Nurb *duplicateNurb(Nurb *nu)
int len;
newnu= (Nurb*)MEM_mallocN(sizeof(Nurb),"duplicateNurb");
- if(newnu==NULL) return NULL;
+ if (newnu==NULL) return NULL;
memcpy(newnu, nu, sizeof(Nurb));
- if(nu->bezt) {
+ if (nu->bezt) {
newnu->bezt=
(BezTriple*)MEM_mallocN((nu->pntsu)* sizeof(BezTriple),"duplicateNurb2");
memcpy(newnu->bezt, nu->bezt, nu->pntsu*sizeof(BezTriple));
@@ -498,16 +497,16 @@ Nurb *duplicateNurb(Nurb *nu)
newnu->knotsu= newnu->knotsv= NULL;
- if(nu->knotsu) {
+ if (nu->knotsu) {
len= KNOTSU(nu);
- if(len) {
+ if (len) {
newnu->knotsu= MEM_mallocN(len*sizeof(float), "duplicateNurb4");
memcpy(newnu->knotsu, nu->knotsu, sizeof(float)*len);
}
}
- if(nu->pntsv>1 && nu->knotsv) {
+ if (nu->pntsv>1 && nu->knotsv) {
len= KNOTSV(nu);
- if(len) {
+ if (len) {
newnu->knotsv= MEM_mallocN(len*sizeof(float), "duplicateNurb5");
memcpy(newnu->knotsv, nu->knotsv, sizeof(float)*len);
}
@@ -523,7 +522,7 @@ void duplicateNurblist(ListBase *lb1, ListBase *lb2)
freeNurblist(lb1);
nu= lb2->first;
- while(nu) {
+ while (nu) {
nun= duplicateNurb(nu);
BLI_addtail(lb1, nun);
@@ -537,13 +536,13 @@ void test2DNurb(Nurb *nu)
BPoint *bp;
int a;
- if((nu->flag & CU_2D)==0)
+ if ((nu->flag & CU_2D)==0)
return;
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
a= nu->pntsu;
bezt= nu->bezt;
- while(a--) {
+ while (a--) {
bezt->vec[0][2]= 0.0;
bezt->vec[1][2]= 0.0;
bezt->vec[2][2]= 0.0;
@@ -553,7 +552,7 @@ void test2DNurb(Nurb *nu)
else {
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- while(a--) {
+ while (a--) {
bp->vec[2]= 0.0;
bp++;
}
@@ -566,10 +565,10 @@ void minmaxNurb(Nurb *nu, float *min, float *max)
BPoint *bp;
int a;
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
a= nu->pntsu;
bezt= nu->bezt;
- while(a--) {
+ while (a--) {
DO_MINMAX(bezt->vec[0], min, max);
DO_MINMAX(bezt->vec[1], min, max);
DO_MINMAX(bezt->vec[2], min, max);
@@ -579,7 +578,7 @@ void minmaxNurb(Nurb *nu, float *min, float *max)
else {
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- while(a--) {
+ while (a--) {
DO_MINMAX(bp->vec, min, max);
bp++;
}
@@ -593,14 +592,14 @@ void addNurbPoints(Nurb *nu, int number)
int i;
nu->bp= (BPoint *)MEM_mallocN((nu->pntsu + number) * sizeof(BPoint), "rna_Curve_spline_points_add");
- if(tmp) {
+ if (tmp) {
memmove(nu->bp, tmp, nu->pntsu * sizeof(BPoint));
MEM_freeN(tmp);
}
memset(nu->bp + nu->pntsu, 0, number * sizeof(BPoint));
- for(i=0, tmp= nu->bp + nu->pntsu; i < number; i++, tmp++) {
+ for (i=0, tmp= nu->bp + nu->pntsu; i < number; i++, tmp++) {
tmp->radius= 1.0f;
}
@@ -613,14 +612,14 @@ void addNurbPointsBezier(Nurb *nu, int number)
int i;
nu->bezt= (BezTriple *)MEM_mallocN((nu->pntsu + number) * sizeof(BezTriple), "rna_Curve_spline_points_add");
- if(tmp) {
+ if (tmp) {
memmove(nu->bezt, tmp, nu->pntsu * sizeof(BezTriple));
MEM_freeN(tmp);
}
memset(nu->bezt + nu->pntsu, 0, number * sizeof(BezTriple));
- for(i=0, tmp= nu->bezt + nu->pntsu; i < number; i++, tmp++) {
+ for (i=0, tmp= nu->bezt + nu->pntsu; i < number; i++, tmp++) {
tmp->radius= 1.0f;
}
@@ -640,25 +639,25 @@ static void calcknots(float *knots, const short pnts, const short order, const s
switch(flag & (CU_NURB_ENDPOINT|CU_NURB_BEZIER)) {
case CU_NURB_ENDPOINT:
k= 0.0;
- for(a=1; a <= pnts_order; a++) {
+ for (a=1; a <= pnts_order; a++) {
knots[a-1]= k;
- if(a >= order && a <= pnts) k+= 1.0f;
+ if (a >= order && a <= pnts) k+= 1.0f;
}
break;
case CU_NURB_BEZIER:
/* Warning, the order MUST be 2 or 4,
* if this is not enforced, the displist will be corrupt */
- if(order==4) {
+ if (order==4) {
k= 0.34;
- for(a=0; a < pnts_order; a++) {
+ for (a=0; a < pnts_order; a++) {
knots[a]= floorf(k);
k+= (1.0f/3.0f);
}
}
- else if(order==3) {
+ else if (order==3) {
k= 0.6f;
- for(a=0; a < pnts_order; a++) {
- if(a >= order && a <= pnts) k+= 0.5f;
+ for (a=0; a < pnts_order; a++) {
+ if (a >= order && a <= pnts) k+= 0.5f;
knots[a]= floorf(k);
}
}
@@ -667,7 +666,7 @@ static void calcknots(float *knots, const short pnts, const short order, const s
}
break;
default:
- for(a=0; a < pnts_order; a++) {
+ for (a=0; a < pnts_order; a++) {
knots[a]= (float)a;
}
break;
@@ -679,22 +678,22 @@ static void makecyclicknots(float *knots, short pnts, short order)
{
int a, b, order2, c;
- if(knots==NULL) return;
+ if (knots==NULL) return;
order2=order-1;
/* do first long rows (order -1), remove identical knots at endpoints */
- if(order>2) {
+ if (order>2) {
b= pnts+order2;
- for(a=1; a<order2; a++) {
- if(knots[b]!= knots[b-a]) break;
+ for (a=1; a<order2; a++) {
+ if (knots[b]!= knots[b-a]) break;
}
- if(a==order2) knots[pnts+order-2]+= 1.0f;
+ if (a==order2) knots[pnts+order-2]+= 1.0f;
}
b= order;
c=pnts + order + order2;
- for(a=pnts+order2; a<c; a++) {
+ for (a=pnts+order2; a<c; a++) {
knots[a]= knots[a-1]+ (knots[b]-knots[b-1]);
b--;
}
@@ -704,28 +703,31 @@ static void makecyclicknots(float *knots, short pnts, short order)
static void makeknots(Nurb *nu, short uv)
{
- if(nu->type == CU_NURBS) {
- if(uv == 1) {
- if(nu->knotsu) MEM_freeN(nu->knotsu);
- if(check_valid_nurb_u(nu)) {
+ if (nu->type == CU_NURBS) {
+ if (uv == 1) {
+ if (nu->knotsu) MEM_freeN(nu->knotsu);
+ if (check_valid_nurb_u(nu)) {
nu->knotsu= MEM_callocN(4+sizeof(float)*KNOTSU(nu), "makeknots");
- if(nu->flagu & CU_NURB_CYCLIC) {
+ if (nu->flagu & CU_NURB_CYCLIC) {
calcknots(nu->knotsu, nu->pntsu, nu->orderu, 0); /* cyclic should be uniform */
makecyclicknots(nu->knotsu, nu->pntsu, nu->orderu);
- } else {
+ }
+ else {
calcknots(nu->knotsu, nu->pntsu, nu->orderu, nu->flagu);
}
}
else nu->knotsu= NULL;
- } else if(uv == 2) {
- if(nu->knotsv) MEM_freeN(nu->knotsv);
- if(check_valid_nurb_v(nu)) {
+ }
+ else if (uv == 2) {
+ if (nu->knotsv) MEM_freeN(nu->knotsv);
+ if (check_valid_nurb_v(nu)) {
nu->knotsv= MEM_callocN(4+sizeof(float)*KNOTSV(nu), "makeknots");
- if(nu->flagv & CU_NURB_CYCLIC) {
+ if (nu->flagv & CU_NURB_CYCLIC) {
calcknots(nu->knotsv, nu->pntsv, nu->orderv, 0); /* cyclic should be uniform */
makecyclicknots(nu->knotsv, nu->pntsv, nu->orderv);
- } else {
+ }
+ else {
calcknots(nu->knotsv, nu->pntsv, nu->orderv, nu->flagv);
}
}
@@ -753,19 +755,19 @@ static void basisNurb(float t, short order, short pnts, float *knots, float *bas
opp2 = orderpluspnts-1;
/* this is for float inaccuracy */
- if(t < knots[0]) t= knots[0];
- else if(t > knots[opp2]) t= knots[opp2];
+ if (t < knots[0]) t= knots[0];
+ else if (t > knots[opp2]) t= knots[opp2];
/* this part is order '1' */
o2 = order + 1;
- for(i=0;i<opp2;i++) {
- if(knots[i]!=knots[i+1] && t>= knots[i] && t<=knots[i+1]) {
+ for (i=0;i<opp2;i++) {
+ if (knots[i]!=knots[i+1] && t>= knots[i] && t<=knots[i+1]) {
basis[i]= 1.0;
i1= i-o2;
- if(i1<0) i1= 0;
+ if (i1<0) i1= 0;
i2= i;
i++;
- while(i<opp2) {
+ while (i<opp2) {
basis[i]= 0.0;
i++;
}
@@ -776,17 +778,17 @@ static void basisNurb(float t, short order, short pnts, float *knots, float *bas
basis[i]= 0.0;
/* this is order 2,3,... */
- for(j=2; j<=order; j++) {
+ for (j=2; j<=order; j++) {
- if(i2+j>= orderpluspnts) i2= opp2-j;
+ if (i2+j>= orderpluspnts) i2= opp2-j;
- for(i= i1; i<=i2; i++) {
- if(basis[i]!=0.0f)
+ for (i= i1; i<=i2; i++) {
+ if (basis[i]!=0.0f)
d= ((t-knots[i])*basis[i]) / (knots[i+j-1]-knots[i]);
else
d= 0.0f;
- if(basis[i+1] != 0.0f)
+ if (basis[i+1] != 0.0f)
e= ((knots[i+j]-t)*basis[i+1]) / (knots[i+j]-knots[i+1]);
else
e= 0.0;
@@ -798,10 +800,10 @@ static void basisNurb(float t, short order, short pnts, float *knots, float *bas
*start= 1000;
*end= 0;
- for(i=i1; i<=i2; i++) {
- if(basis[i] > 0.0f) {
+ for (i=i1; i<=i2; i++) {
+ if (basis[i] > 0.0f) {
*end= i;
- if(*start==1000) *start= i;
+ if (*start==1000) *start= i;
}
}
}
@@ -818,21 +820,21 @@ void makeNurbfaces(Nurb *nu, float *coord_array, int rowstride, int resolu, int
int totu = nu->pntsu*resolu, totv = nu->pntsv*resolv;
- if(nu->knotsu==NULL || nu->knotsv==NULL) return;
- if(nu->orderu>nu->pntsu) return;
- if(nu->orderv>nu->pntsv) return;
- if(coord_array==NULL) return;
+ if (nu->knotsu==NULL || nu->knotsv==NULL) return;
+ if (nu->orderu>nu->pntsu) return;
+ if (nu->orderv>nu->pntsv) return;
+ if (coord_array==NULL) return;
/* allocate and initialize */
len = totu * totv;
- if(len==0) return;
+ if (len==0) return;
sum= (float *)MEM_callocN(sizeof(float)*len, "makeNurbfaces1");
len= totu*totv;
- if(len==0) {
+ if (len==0) {
MEM_freeN(sum);
return;
}
@@ -840,8 +842,8 @@ void makeNurbfaces(Nurb *nu, float *coord_array, int rowstride, int resolu, int
bp= nu->bp;
i= nu->pntsu*nu->pntsv;
ratcomp=0;
- while(i--) {
- if(bp->vec[3] != 1.0f) {
+ while (i--) {
+ if (bp->vec[3] != 1.0f) {
ratcomp= 1;
break;
}
@@ -850,7 +852,7 @@ void makeNurbfaces(Nurb *nu, float *coord_array, int rowstride, int resolu, int
fp= nu->knotsu;
ustart= fp[nu->orderu-1];
- if(nu->flagu & CU_NURB_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1];
+ if (nu->flagu & CU_NURB_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1];
else uend= fp[nu->pntsu];
ustep= (uend-ustart)/((nu->flagu & CU_NURB_CYCLIC) ? totu : totu - 1);
@@ -859,7 +861,7 @@ void makeNurbfaces(Nurb *nu, float *coord_array, int rowstride, int resolu, int
fp= nu->knotsv;
vstart= fp[nu->orderv-1];
- if(nu->flagv & CU_NURB_CYCLIC) vend= fp[nu->pntsv+nu->orderv-1];
+ if (nu->flagv & CU_NURB_CYCLIC) vend= fp[nu->pntsv+nu->orderv-1];
else vend= fp[nu->pntsv];
vstep= (vend-vstart)/((nu->flagv & CU_NURB_CYCLIC) ? totv : totv - 1);
@@ -869,29 +871,29 @@ void makeNurbfaces(Nurb *nu, float *coord_array, int rowstride, int resolu, int
jend= (int *)MEM_mallocN(sizeof(float)*totv, "makeNurbfaces5");
/* precalculation of basisv and jstart,jend */
- if(nu->flagv & CU_NURB_CYCLIC) cycl= nu->orderv-1;
+ if (nu->flagv & CU_NURB_CYCLIC) cycl= nu->orderv-1;
else cycl= 0;
v= vstart;
basis= basisv;
curv= totv;
- while(curv--) {
+ while (curv--) {
basisNurb(v, nu->orderv, (short)(nu->pntsv+cycl), nu->knotsv, basis, jstart+curv, jend+curv);
basis+= KNOTSV(nu);
v+= vstep;
}
- if(nu->flagu & CU_NURB_CYCLIC) cycl= nu->orderu-1;
+ if (nu->flagu & CU_NURB_CYCLIC) cycl= nu->orderu-1;
else cycl= 0;
in= coord_array;
u= ustart;
curu= totu;
- while(curu--) {
+ while (curu--) {
basisNurb(u, nu->orderu, (short)(nu->pntsu+cycl), nu->knotsu, basisu, &istart, &iend);
basis= basisv;
curv= totv;
- while(curv--) {
+ while (curv--) {
jsta= jstart[curv];
jen= jend[curv];
@@ -900,21 +902,21 @@ void makeNurbfaces(Nurb *nu, float *coord_array, int rowstride, int resolu, int
sumdiv= 0.0;
fp= sum;
- for(j= jsta; j<=jen; j++) {
+ for (j= jsta; j<=jen; j++) {
- if(j>=nu->pntsv) jofs= (j - nu->pntsv);
+ if (j>=nu->pntsv) jofs= (j - nu->pntsv);
else jofs= j;
bp= nu->bp+ nu->pntsu*jofs+istart-1;
- for(i= istart; i<=iend; i++, fp++) {
+ for (i= istart; i<=iend; i++, fp++) {
- if(i>= nu->pntsu) {
+ if (i>= nu->pntsu) {
iofs= i- nu->pntsu;
bp= nu->bp+ nu->pntsu*jofs+iofs;
}
else bp++;
- if(ratcomp) {
+ if (ratcomp) {
*fp= basisu[i]*basis[j]*bp->vec[3];
sumdiv+= *fp;
}
@@ -922,10 +924,10 @@ void makeNurbfaces(Nurb *nu, float *coord_array, int rowstride, int resolu, int
}
}
- if(ratcomp) {
+ if (ratcomp) {
fp= sum;
- for(j= jsta; j<=jen; j++) {
- for(i= istart; i<=iend; i++, fp++) {
+ for (j= jsta; j<=jen; j++) {
+ for (i= istart; i<=iend; i++, fp++) {
*fp/= sumdiv;
}
}
@@ -933,21 +935,21 @@ void makeNurbfaces(Nurb *nu, float *coord_array, int rowstride, int resolu, int
/* one! (1.0) real point now */
fp= sum;
- for(j= jsta; j<=jen; j++) {
+ for (j= jsta; j<=jen; j++) {
- if(j>=nu->pntsv) jofs= (j - nu->pntsv);
+ if (j>=nu->pntsv) jofs= (j - nu->pntsv);
else jofs= j;
bp= nu->bp+ nu->pntsu*jofs+istart-1;
- for(i= istart; i<=iend; i++, fp++) {
+ for (i= istart; i<=iend; i++, fp++) {
- if(i>= nu->pntsu) {
+ if (i>= nu->pntsu) {
iofs= i- nu->pntsu;
bp= nu->bp+ nu->pntsu*jofs+iofs;
}
else bp++;
- if(*fp != 0.0f) {
+ if (*fp != 0.0f) {
in[0]+= (*fp) * bp->vec[0];
in[1]+= (*fp) * bp->vec[1];
in[2]+= (*fp) * bp->vec[2];
@@ -980,53 +982,53 @@ void makeNurbcurve(Nurb *nu, float *coord_array, float *tilt_array, float *radiu
float *coord_fp= coord_array, *tilt_fp= tilt_array, *radius_fp= radius_array, *weight_fp= weight_array;
int i, len, istart, iend, cycl;
- if(nu->knotsu==NULL) return;
- if(nu->orderu>nu->pntsu) return;
- if(coord_array==NULL) return;
+ if (nu->knotsu==NULL) return;
+ if (nu->orderu>nu->pntsu) return;
+ if (coord_array==NULL) return;
/* allocate and initialize */
len= nu->pntsu;
- if(len==0) return;
+ if (len==0) return;
sum= (float *)MEM_callocN(sizeof(float)*len, "makeNurbcurve1");
resolu= (resolu*SEGMENTSU(nu));
- if(resolu==0) {
+ if (resolu==0) {
MEM_freeN(sum);
return;
}
fp= nu->knotsu;
ustart= fp[nu->orderu-1];
- if(nu->flagu & CU_NURB_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1];
+ if (nu->flagu & CU_NURB_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1];
else uend= fp[nu->pntsu];
ustep= (uend-ustart)/(resolu - ((nu->flagu & CU_NURB_CYCLIC) ? 0 : 1));
basisu= (float *)MEM_mallocN(sizeof(float)*KNOTSU(nu), "makeNurbcurve3");
- if(nu->flagu & CU_NURB_CYCLIC) cycl= nu->orderu-1;
+ if (nu->flagu & CU_NURB_CYCLIC) cycl= nu->orderu-1;
else cycl= 0;
u= ustart;
- while(resolu--) {
+ while (resolu--) {
basisNurb(u, nu->orderu, (short)(nu->pntsu+cycl), nu->knotsu, basisu, &istart, &iend);
/* calc sum */
sumdiv= 0.0;
fp= sum;
bp= nu->bp+ istart-1;
- for(i= istart; i<=iend; i++, fp++) {
+ for (i= istart; i<=iend; i++, fp++) {
- if(i>=nu->pntsu) bp= nu->bp+(i - nu->pntsu);
+ if (i>=nu->pntsu) bp= nu->bp+(i - nu->pntsu);
else bp++;
*fp= basisu[i]*bp->vec[3];
sumdiv+= *fp;
}
- if(sumdiv != 0.0f) if(sumdiv < 0.999f || sumdiv > 1.001f) {
+ if (sumdiv != 0.0f) if (sumdiv < 0.999f || sumdiv > 1.001f) {
/* is normalizing needed? */
fp= sum;
- for(i= istart; i<=iend; i++, fp++) {
+ for (i= istart; i<=iend; i++, fp++) {
*fp/= sumdiv;
}
}
@@ -1034,12 +1036,12 @@ void makeNurbcurve(Nurb *nu, float *coord_array, float *tilt_array, float *radiu
/* one! (1.0) real point */
fp= sum;
bp= nu->bp+ istart-1;
- for(i= istart; i<=iend; i++, fp++) {
+ for (i= istart; i<=iend; i++, fp++) {
- if(i>=nu->pntsu) bp= nu->bp+(i - nu->pntsu);
+ if (i>=nu->pntsu) bp= nu->bp+(i - nu->pntsu);
else bp++;
- if(*fp != 0.0f) {
+ if (*fp != 0.0f) {
coord_fp[0]+= (*fp) * bp->vec[0];
coord_fp[1]+= (*fp) * bp->vec[1];
@@ -1090,7 +1092,7 @@ void forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int i
q2= 2*rt2+6*rt3;
q3= 6*rt3;
- for(a=0; a<=it; a++) {
+ for (a=0; a<=it; a++) {
*p= q0;
p = (float *)(((char *)p)+stride);
q0+= q1;
@@ -1106,11 +1108,11 @@ static void forward_diff_bezier_cotangent(float *p0, float *p1, float *p2, float
*
* This could also be optimized like forward_diff_bezier */
int a;
- for(a=0; a<=it; a++) {
+ for (a=0; a<=it; a++) {
float t = (float)a / (float)it;
int i;
- for(i=0; i<3; i++) {
+ for (i=0; i<3; i++) {
p[i]= (-6*t + 6)*p0[i] + (18*t - 12)*p1[i] + (-18*t + 6)*p2[i] + (6*t)*p3[i];
}
normalize_v3(p);
@@ -1133,15 +1135,15 @@ float *make_orco_surf(Object *ob)
/* first calculate the size of the datablock */
nu= cu->nurb.first;
- while(nu) {
+ 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;
@@ -1150,7 +1152,7 @@ float *make_orco_surf(Object *ob)
sizev = nu->pntsv*resolv;
if (nu->flagu & CU_NURB_CYCLIC) sizeu++;
if (nu->flagv & CU_NURB_CYCLIC) sizev++;
- if(nu->pntsv>1) tot+= sizeu * sizev;
+ if (nu->pntsv>1) tot+= sizeu * sizev;
nu= nu->next;
}
@@ -1158,24 +1160,24 @@ float *make_orco_surf(Object *ob)
fp= coord_array= MEM_callocN(3*sizeof(float)*tot, "make_orco");
nu= cu->nurb.first;
- while(nu) {
+ while (nu) {
resolu= cu->resolu_ren ? cu->resolu_ren : nu->resolu;
resolv= cu->resolv_ren ? cu->resolv_ren : nu->resolv;
- if(nu->pntsv>1) {
+ if (nu->pntsv>1) {
sizeu = nu->pntsu*resolu;
sizev = nu->pntsv*resolv;
if (nu->flagu & CU_NURB_CYCLIC) sizeu++;
if (nu->flagv & CU_NURB_CYCLIC) sizev++;
- if(cu->flag & CU_UV_ORCO) {
- for(b=0; b< sizeu; b++) {
- for(a=0; a< sizev; a++) {
+ if (cu->flag & CU_UV_ORCO) {
+ for (b=0; b< sizeu; b++) {
+ for (a=0; a< sizev; a++) {
- if(sizev <2) fp[0]= 0.0f;
+ if (sizev <2) fp[0]= 0.0f;
else fp[0]= -1.0f + 2.0f*((float)a)/(sizev - 1);
- if(sizeu <2) fp[1]= 0.0f;
+ if (sizeu <2) fp[1]= 0.0f;
else fp[1]= -1.0f + 2.0f*((float)b)/(sizeu - 1);
fp[2]= 0.0;
@@ -1190,12 +1192,12 @@ float *make_orco_surf(Object *ob)
makeNurbfaces(nu, tdata, 0, resolu, resolv);
- for(b=0; b<sizeu; b++) {
+ for (b=0; b<sizeu; b++) {
int use_b= b;
if (b==sizeu-1 && (nu->flagu & CU_NURB_CYCLIC))
use_b= 0;
- for(a=0; a<sizev; a++) {
+ for (a=0; a<sizev; a++) {
int use_a= a;
if (a==sizev-1 && (nu->flagv & CU_NURB_CYCLIC))
use_a= 0;
@@ -1236,7 +1238,8 @@ float *make_orco_curve(Scene *scene, Object *ob)
for (dl=disp.first; dl; dl=dl->next) {
if (dl->type==DL_INDEX3) {
numVerts += dl->nr;
- } else if (dl->type==DL_SURF) {
+ }
+ else if (dl->type==DL_SURF) {
/* convertblender.c uses the Surface code for creating renderfaces when cyclic U only (closed circle beveling) */
if (dl->flag & DL_CYCL_U) {
if (dl->flag & DL_CYCL_V)
@@ -1257,7 +1260,8 @@ float *make_orco_curve(Scene *scene, Object *ob)
fp[0]= 2.0f*u/(dl->nr-1) - 1.0f;
fp[1]= 0.0;
fp[2]= 0.0;
- } else {
+ }
+ else {
copy_v3_v3(fp, &dl->verts[u*3]);
fp[0]= (fp[0]-cu->loc[0])/cu->size[0];
@@ -1265,7 +1269,8 @@ float *make_orco_curve(Scene *scene, Object *ob)
fp[2]= (fp[2]-cu->loc[2])/cu->size[2];
}
}
- } else if (dl->type==DL_SURF) {
+ }
+ else if (dl->type==DL_SURF) {
int sizeu= dl->nr, sizev= dl->parts;
/* exception as handled in convertblender.c too */
@@ -1281,7 +1286,8 @@ float *make_orco_curve(Scene *scene, Object *ob)
fp[0]= 2.0f*u/(sizev - 1) - 1.0f;
fp[1]= 2.0f*v/(sizeu - 1) - 1.0f;
fp[2]= 0.0;
- } else {
+ }
+ else {
float *vert;
int realv= v % dl->nr;
int realu= u % dl->parts;
@@ -1317,13 +1323,13 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
disp->first = disp->last = NULL;
/* if a font object is being edited, then do nothing */
-// XXX if( ob == obedit && ob->type == OB_FONT ) return;
+// XXX if ( ob == obedit && ob->type == OB_FONT ) return;
- if(cu->bevobj) {
+ if (cu->bevobj) {
if (cu->bevobj->type!=OB_CURVE) return;
bevcu= cu->bevobj->data;
- if(bevcu->ext1==0.0f && bevcu->ext2==0.0f) {
+ if (bevcu->ext1==0.0f && bevcu->ext2==0.0f) {
ListBase bevdisp= {NULL, NULL};
facx= cu->bevobj->size[0];
facy= cu->bevobj->size[1];
@@ -1331,27 +1337,28 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
if (forRender) {
makeDispListCurveTypes_forRender(scene, cu->bevobj, &bevdisp, NULL, 0);
dl= bevdisp.first;
- } else {
+ }
+ else {
dl= cu->bevobj->disp.first;
- if(dl==NULL) {
+ if (dl==NULL) {
makeDispListCurveTypes(scene, cu->bevobj, 0);
dl= cu->bevobj->disp.first;
}
}
- while(dl) {
- if ELEM(dl->type, DL_POLY, DL_SEGM) {
+ while (dl) {
+ if (ELEM(dl->type, DL_POLY, DL_SEGM)) {
dlnew= MEM_mallocN(sizeof(DispList), "makebevelcurve1");
*dlnew= *dl;
dlnew->verts= MEM_mallocN(3*sizeof(float)*dl->parts*dl->nr, "makebevelcurve1");
memcpy(dlnew->verts, dl->verts, 3*sizeof(float)*dl->parts*dl->nr);
- if(dlnew->type==DL_SEGM) dlnew->flag |= (DL_FRONT_CURVE|DL_BACK_CURVE);
+ if (dlnew->type==DL_SEGM) dlnew->flag |= (DL_FRONT_CURVE|DL_BACK_CURVE);
BLI_addtail(disp, dlnew);
fp= dlnew->verts;
nr= dlnew->parts*dlnew->nr;
- while(nr--) {
+ while (nr--) {
fp[2]= fp[1]*facy;
fp[1]= -fp[0]*facx;
fp[0]= 0.0;
@@ -1364,10 +1371,10 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
freedisplist(&bevdisp);
}
}
- else if(cu->ext1==0.0f && cu->ext2==0.0f) {
+ else if (cu->ext1==0.0f && cu->ext2==0.0f) {
;
}
- else if(cu->ext2==0.0f) {
+ else if (cu->ext2==0.0f) {
dl= MEM_callocN(sizeof(DispList), "makebevelcurve2");
dl->verts= MEM_mallocN(2*3*sizeof(float), "makebevelcurve2");
BLI_addtail(disp, dl);
@@ -1382,7 +1389,7 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
fp[3]= fp[4]= 0.0;
fp[5]= cu->ext1;
}
- else if( (cu->flag & (CU_FRONT|CU_BACK))==0 && cu->ext1==0.0f) { // we make a full round bevel in that case
+ else if ( (cu->flag & (CU_FRONT|CU_BACK))==0 && cu->ext1==0.0f) { // we make a full round bevel in that case
nr= 4+ 2*cu->bevresol;
@@ -1399,7 +1406,7 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
dangle= (2.0f*(float)M_PI/(nr));
angle= -(nr-1)*dangle;
- for(a=0; a<nr; a++) {
+ for (a=0; a<nr; a++) {
fp[0]= 0.0;
fp[1]= (cosf(angle)*(cu->ext2));
fp[2]= (sinf(angle)*(cu->ext2)) - cu->ext1;
@@ -1413,9 +1420,9 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
/* bevel now in three parts, for proper vertex normals */
/* part 1, back */
- if((cu->flag & CU_BACK) || !(cu->flag & CU_FRONT)) {
+ if ((cu->flag & CU_BACK) || !(cu->flag & CU_FRONT)) {
dnr= nr= 2+ cu->bevresol;
- if( (cu->flag & (CU_FRONT|CU_BACK))==0)
+ if ( (cu->flag & (CU_FRONT|CU_BACK))==0)
nr= 3+ 2*cu->bevresol;
dl= MEM_callocN(sizeof(DispList), "makebevelcurve p1");
@@ -1431,7 +1438,7 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
dangle= (0.5*M_PI/(dnr-1));
angle= -(nr-1)*dangle;
- for(a=0; a<nr; a++) {
+ for (a=0; a<nr; a++) {
fp[0]= 0.0;
fp[1]= (float)(cosf(angle)*(cu->ext2));
fp[2]= (float)(sinf(angle)*(cu->ext2)) - cu->ext1;
@@ -1441,7 +1448,7 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
}
/* part 2, sidefaces */
- if(cu->ext1!=0.0f) {
+ if (cu->ext1!=0.0f) {
nr= 2;
dl= MEM_callocN(sizeof(DispList), "makebevelcurve p2");
@@ -1457,7 +1464,7 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
fp[4]= cu->ext2;
fp[5]= cu->ext1;
- if( (cu->flag & (CU_FRONT|CU_BACK))==0) {
+ if ( (cu->flag & (CU_FRONT|CU_BACK))==0) {
dl= MEM_dupallocN(dl);
dl->verts= MEM_dupallocN(dl->verts);
BLI_addtail(disp, dl);
@@ -1471,9 +1478,9 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
}
/* part 3, front */
- if((cu->flag & CU_FRONT) || !(cu->flag & CU_BACK)) {
+ if ((cu->flag & CU_FRONT) || !(cu->flag & CU_BACK)) {
dnr= nr= 2+ cu->bevresol;
- if( (cu->flag & (CU_FRONT|CU_BACK))==0)
+ if ( (cu->flag & (CU_FRONT|CU_BACK))==0)
nr= 3+ 2*cu->bevresol;
dl= MEM_callocN(sizeof(DispList), "makebevelcurve p3");
@@ -1489,7 +1496,7 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
angle= 0.0;
dangle= (0.5*M_PI/(dnr-1));
- for(a=0; a<nr; a++) {
+ for (a=0; a<nr; a++) {
fp[0]= 0.0;
fp[1]= (float)(cosf(angle)*(cu->ext2));
fp[2]= (float)(sinf(angle)*(cu->ext2)) + cu->ext1;
@@ -1505,31 +1512,32 @@ 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]);
- if(deler==0.0f) return -1;
+ if (deler==0.0f) return -1;
*labda= (v1[coy]-v3[coy])*(v3[cox]-v4[cox])-(v1[cox]-v3[cox])*(v3[coy]-v4[coy]);
*labda= -(*labda/deler);
deler= v3[coy]-v4[coy];
- if(deler==0) {
+ if (deler==0) {
deler=v3[cox]-v4[cox];
*mu= -(*labda*(v2[cox]-v1[cox])+v1[cox]-v3[cox])/deler;
- } else {
+ }
+ else {
*mu= -(*labda*(v2[coy]-v1[coy])+v1[coy]-v3[coy])/deler;
}
vec[cox]= *labda*(v2[cox]-v1[cox])+v1[cox];
vec[coy]= *labda*(v2[coy]-v1[coy])+v1[coy];
- if(*labda>=0.0f && *labda<=1.0f && *mu>=0.0f && *mu<=1.0f) {
- if(*labda==0.0f || *labda==1.0f || *mu==0.0f || *mu==1.0f) return 1;
+ if (*labda>=0.0f && *labda<=1.0f && *mu>=0.0f && *mu<=1.0f) {
+ if (*labda==0.0f || *labda==1.0f || *mu==0.0f || *mu==1.0f) return 1;
return 2;
}
return 0;
@@ -1560,22 +1568,22 @@ static short bevelinside(BevList *bl1,BevList *bl2)
nr= bl1->nr;
prevbevp= bevp+(nr-1);
- while(nr--) {
+ while (nr--) {
min= prevbevp->vec[1];
max= bevp->vec[1];
- if(max<min) {
+ if (max<min) {
min= max;
max= prevbevp->vec[1];
}
- if(min!=max) {
- if(min<=hvec1[1] && max>=hvec1[1]) {
+ if (min!=max) {
+ if (min<=hvec1[1] && max>=hvec1[1]) {
/* 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++;
+ if (mode >= 0 && lab != 0.0f) {
+ if (vec[0]<hvec1[0]) links++;
else rechts++;
}
}
@@ -1584,7 +1592,7 @@ static short bevelinside(BevList *bl1,BevList *bl2)
bevp++;
}
- if( (links & 1) && (rechts & 1) ) return 1;
+ if ( (links & 1) && (rechts & 1) ) return 1;
return 0;
}
@@ -1599,8 +1607,8 @@ static int vergxcobev(const void *a1, const void *a2)
{
const struct bevelsort *x1=a1,*x2=a2;
- if( x1->left > x2->left ) return 1;
- else if( x1->left < x2->left) return -1;
+ if ( x1->left > x2->left ) return 1;
+ else if ( x1->left < x2->left) return -1;
return 0;
}
@@ -1612,8 +1620,8 @@ static void calc_bevel_sin_cos(float x1, float y1, float x2, float y2, float *si
t01= (float)sqrt(x1*x1+y1*y1);
t02= (float)sqrt(x2*x2+y2*y2);
- if(t01==0.0f) t01= 1.0f;
- if(t02==0.0f) t02= 1.0f;
+ if (t01==0.0f) t01= 1.0f;
+ if (t02==0.0f) t02= 1.0f;
x1/=t01;
y1/=t01;
@@ -1621,18 +1629,19 @@ static void calc_bevel_sin_cos(float x1, float y1, float x2, float y2, float *si
y2/=t02;
t02= x1*x2+y1*y2;
- if(fabs(t02)>=1.0) t02= .5*M_PI;
+ if (fabs(t02)>=1.0) t02= .5*M_PI;
else t02= (saacos(t02))/2.0f;
t02= (float)sin(t02);
- if(t02==0.0f) t02= 1.0f;
+ if (t02==0.0f) t02= 1.0f;
x3= x1-x2;
y3= y1-y2;
- if(x3==0 && y3==0) {
+ if (x3==0 && y3==0) {
x3= y1;
y3= -x1;
- } else {
+ }
+ else {
t01= (float)sqrt(x3*x3+y3*y3);
x3/=t01;
y3/=t01;
@@ -1649,21 +1658,21 @@ static void alfa_bezpart(BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float *
float fac, dfac, t[4];
int a;
- if(tilt_array==NULL && radius_array==NULL)
+ if (tilt_array==NULL && radius_array==NULL)
return;
last= nu->bezt+(nu->pntsu-1);
/* returns a point */
- if(prevbezt==nu->bezt) {
- if(nu->flagu & CU_NURB_CYCLIC) pprev= last;
+ if (prevbezt==nu->bezt) {
+ if (nu->flagu & CU_NURB_CYCLIC) pprev= last;
else pprev= prevbezt;
}
else pprev= prevbezt-1;
/* next point */
- if(bezt==last) {
- if(nu->flagu & CU_NURB_CYCLIC) next= nu->bezt;
+ if (bezt==last) {
+ if (nu->flagu & CU_NURB_CYCLIC) next= nu->bezt;
else next= bezt;
}
else next= bezt+1;
@@ -1671,11 +1680,12 @@ static void alfa_bezpart(BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float *
fac= 0.0;
dfac= 1.0f/(float)resolu;
- for(a=0; a<resolu; a++, fac+= dfac) {
+ for (a=0; a<resolu; a++, fac+= dfac) {
if (tilt_array) {
if (nu->tilt_interp==KEY_CU_EASE) { /* May as well support for tilt also 2.47 ease interp */
*tilt_array = prevbezt->alfa + (bezt->alfa - prevbezt->alfa)*(3.0f*fac*fac - 2.0f*fac*fac*fac);
- } else {
+ }
+ else {
key_curve_position_weights(fac, t, nu->tilt_interp);
*tilt_array= t[0]*pprev->alfa + t[1]*prevbezt->alfa + t[2]*bezt->alfa + t[3]*next->alfa;
}
@@ -1689,7 +1699,8 @@ static void alfa_bezpart(BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float *
* Note! - this only takes the 2 points into account,
* giving much more localized results to changes in radius, sometimes you want that */
*radius_array = prevbezt->radius + (bezt->radius - prevbezt->radius)*(3.0f*fac*fac - 2.0f*fac*fac*fac);
- } else {
+ }
+ else {
/* reuse interpolation from tilt if we can */
if (tilt_array==NULL || nu->tilt_interp != nu->radius_interp) {
@@ -1701,7 +1712,7 @@ static void alfa_bezpart(BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float *
radius_array = (float *)(((char *)radius_array) + stride);
}
- if(weight_array) {
+ if (weight_array) {
/* basic interpolation for now, could copy tilt interp too */
*weight_array = prevbezt->weight + (bezt->weight - prevbezt->weight)*(3.0f*fac*fac - 2.0f*fac*fac*fac);
@@ -1742,7 +1753,7 @@ static void bevel_list_calc_bisect(BevList *bl)
bevp0= bevp1-1;
nr= bl->nr;
- while(nr--) {
+ while (nr--) {
/* totally simple */
bisect_v3_v3v3v3(bevp1->dir, bevp0->vec, bevp1->vec, bevp2->vec);
@@ -1761,8 +1772,8 @@ static void bevel_list_flip_tangents(BevList *bl)
bevp0= bevp1-1;
nr= bl->nr;
- while(nr--) {
- if(RAD2DEGF(angle_v2v2(bevp0->tan, bevp1->tan)) > 90.0f)
+ while (nr--) {
+ if (RAD2DEGF(angle_v2v2(bevp0->tan, bevp1->tan)) > 90.0f)
negate_v3(bevp1->tan);
bevp0= bevp1;
@@ -1781,7 +1792,7 @@ static void bevel_list_apply_tilt(BevList *bl)
bevp1= bevp2+(bl->nr-1);
nr= bl->nr;
- while(nr--) {
+ while (nr--) {
axis_angle_to_quat(q, bevp1->dir, bevp1->alfa);
mul_qt_qtqt(bevp1->quat, q, bevp1->quat);
normalize_qt(bevp1->quat);
@@ -1800,7 +1811,7 @@ static void bevel_list_smooth(BevList *bl, int smooth_iter)
float bevp0_quat[4];
int a;
- for(a=0; a < smooth_iter; a++) {
+ for (a=0; a < smooth_iter; a++) {
bevp2= (BevPoint *)(bl+1);
bevp1= bevp2+(bl->nr-1);
@@ -1808,7 +1819,7 @@ static void bevel_list_smooth(BevList *bl, int smooth_iter)
nr= bl->nr;
- if(bl->poly== -1) { /* check its not cyclic */
+ if (bl->poly== -1) { /* check its not cyclic */
/* skip the first point */
/* bevp0= bevp1; */
bevp1= bevp2;
@@ -1824,7 +1835,7 @@ static void bevel_list_smooth(BevList *bl, int smooth_iter)
copy_qt_qt(bevp0_quat, bevp0->quat);
- while(nr--) {
+ while (nr--) {
/* interpolate quats */
float zaxis[3] = {0,0,1}, cross[3], q2[4];
interp_qt_qtqt(q, bevp0_quat, bevp2->quat, 0.5);
@@ -1858,7 +1869,7 @@ static void make_bevel_list_3D_zup(BevList *bl)
bevp0= bevp1-1;
nr= bl->nr;
- while(nr--) {
+ while (nr--) {
/* totally simple */
bisect_v3_v3v3v3(bevp1->dir, bevp0->vec, bevp1->vec, bevp2->vec);
vec_to_quat( bevp1->quat,bevp1->dir, 5, 1);
@@ -1882,15 +1893,15 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl)
bevp0= bevp1-1;
nr= bl->nr;
- while(nr--) {
+ while (nr--) {
- if(nr+4 > bl->nr) { /* first time and second time, otherwise first point adjusts last */
+ if (nr+4 > bl->nr) { /* first time and second time, otherwise first point adjusts last */
vec_to_quat( bevp1->quat,bevp1->dir, 5, 1);
}
else {
float angle= angle_normalized_v3v3(bevp0->dir, bevp1->dir);
- if(angle > 0.0f) { /* otherwise we can keep as is */
+ if (angle > 0.0f) { /* otherwise we can keep as is */
float cross_tmp[3];
cross_v3_v3v3(cross_tmp, bevp0->dir, bevp1->dir);
axis_angle_to_quat(q, cross_tmp, angle);
@@ -1906,7 +1917,7 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl)
bevp2++;
}
- if(bl->poly != -1) { /* check for cyclic */
+ if (bl->poly != -1) { /* check for cyclic */
/* Need to correct for the start/end points not matching
* do this by calculating the tilt angle difference, then apply
@@ -1950,7 +1961,7 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl)
/* flip rotation if needs be */
cross_v3_v3v3(cross_tmp, vec_1, vec_2);
normalize_v3(cross_tmp);
- if(angle_normalized_v3v3(bevp_first->dir, cross_tmp) < DEG2RADF(90.0f))
+ if (angle_normalized_v3v3(bevp_first->dir, cross_tmp) < DEG2RADF(90.0f))
angle = -angle;
bevp2= (BevPoint *)(bl+1);
@@ -1958,7 +1969,7 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl)
bevp0= bevp1-1;
nr= bl->nr;
- while(nr--) {
+ while (nr--) {
ang_fac= angle * (1.0f-((float)nr/bl->nr)); /* also works */
axis_angle_to_quat(q, bevp1->dir, ang_fac);
@@ -1979,7 +1990,7 @@ static void make_bevel_list_3D_tangent(BevList *bl)
float bevp0_tan[3], cross_tmp[3];
bevel_list_calc_bisect(bl);
- if(bl->poly== -1) /* check its not cyclic */
+ if (bl->poly== -1) /* check its not cyclic */
bevel_list_cyclic_fix_3D(bl); // XXX - run this now so tangents will be right before doing the flipping
bevel_list_flip_tangents(bl);
@@ -1989,7 +2000,7 @@ static void make_bevel_list_3D_tangent(BevList *bl)
bevp0= bevp1-1;
nr= bl->nr;
- while(nr--) {
+ while (nr--) {
cross_v3_v3v3(cross_tmp, bevp1->tan, bevp1->dir);
cross_v3_v3v3(bevp1->tan, cross_tmp, bevp1->dir);
@@ -2009,7 +2020,7 @@ static void make_bevel_list_3D_tangent(BevList *bl)
copy_v3_v3(bevp0_tan, bevp0->tan);
nr= bl->nr;
- while(nr--) {
+ while (nr--) {
/* make perpendicular, modify tan in place, is ok */
float cross_tmp[3];
@@ -2038,10 +2049,10 @@ static void make_bevel_list_3D(BevList *bl, int smooth_iter, int twist_mode)
make_bevel_list_3D_zup(bl);
}
- if(bl->poly== -1) /* check its not cyclic */
+ if (bl->poly== -1) /* check its not cyclic */
bevel_list_cyclic_fix_3D(bl);
- if(smooth_iter)
+ if (smooth_iter)
bevel_list_smooth(bl, smooth_iter);
bevel_list_apply_tilt(bl);
@@ -2075,11 +2086,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;
@@ -2100,12 +2111,15 @@ void makeBevelList(Object *ob)
/* STEP 1: MAKE POLYS */
BLI_freelistN(&(cu->bev));
- if(cu->editnurb && ob->type!=OB_FONT) {
+ if (cu->editnurb && ob->type!=OB_FONT) {
ListBase *nurbs= curve_editnurbs(cu);
- nu= nurbs->first;
- } else nu= cu->nurb.first;
+ nu = nurbs->first;
+ }
+ else {
+ nu = cu->nurb.first;
+ }
- while(nu) {
+ while (nu) {
/* check if we will calculate tilt data */
do_tilt = CU_DO_TILT(cu, nu);
@@ -2114,29 +2128,30 @@ void makeBevelList(Object *ob)
/* check we are a single point? also check we are not a surface and that the orderu is sane,
* enforced in the UI but can go wrong possibly */
- if(!check_valid_nurb_u(nu)) {
+ if (!check_valid_nurb_u(nu)) {
bl= MEM_callocN(sizeof(BevList)+1*sizeof(BevPoint), "makeBevelList1");
BLI_addtail(&(cu->bev), bl);
bl->nr= 0;
- } else {
- if(G.rendering && cu->resolu_ren!=0)
+ }
+ else {
+ if (G.rendering && cu->resolu_ren!=0)
resolu= cu->resolu_ren;
else
resolu= nu->resolu;
- if(nu->type == CU_POLY) {
+ if (nu->type == CU_POLY) {
len= nu->pntsu;
bl= MEM_callocN(sizeof(BevList)+len*sizeof(BevPoint), "makeBevelList2");
BLI_addtail(&(cu->bev), bl);
- if(nu->flagu & CU_NURB_CYCLIC) bl->poly= 0;
+ if (nu->flagu & CU_NURB_CYCLIC) bl->poly= 0;
else bl->poly= -1;
bl->nr= len;
bl->dupe_nr= 0;
bevp= (BevPoint *)(bl+1);
bp= nu->bp;
- while(len--) {
+ while (len--) {
copy_v3_v3(bevp->vec, bp->vec);
bevp->alfa= bp->alfa;
bevp->radius= bp->radius;
@@ -2146,19 +2161,19 @@ void makeBevelList(Object *ob)
bp++;
}
}
- else if(nu->type == CU_BEZIER) {
+ else if (nu->type == CU_BEZIER) {
len= resolu*(nu->pntsu+ (nu->flagu & CU_NURB_CYCLIC) -1)+1; /* in case last point is not cyclic */
bl= MEM_callocN(sizeof(BevList)+len*sizeof(BevPoint), "makeBevelBPoints");
BLI_addtail(&(cu->bev), bl);
- if(nu->flagu & CU_NURB_CYCLIC) bl->poly= 0;
+ if (nu->flagu & CU_NURB_CYCLIC) bl->poly= 0;
else bl->poly= -1;
bevp= (BevPoint *)(bl+1);
a= nu->pntsu-1;
bezt= nu->bezt;
- if(nu->flagu & CU_NURB_CYCLIC) {
+ if (nu->flagu & CU_NURB_CYCLIC) {
a++;
prevbezt= nu->bezt+(nu->pntsu-1);
}
@@ -2167,8 +2182,8 @@ void makeBevelList(Object *ob)
bezt++;
}
- while(a--) {
- if(prevbezt->h2==HD_VECT && bezt->h1==HD_VECT) {
+ while (a--) {
+ if (prevbezt->h2==HD_VECT && bezt->h1==HD_VECT) {
copy_v3_v3(bevp->vec, prevbezt->vec[1]);
bevp->alfa= prevbezt->alfa;
@@ -2185,7 +2200,7 @@ void makeBevelList(Object *ob)
int j;
/* BevPoint must stay aligned to 4 so sizeof(BevPoint)/sizeof(float) works */
- for(j=0; j<3; j++) {
+ for (j=0; j<3; j++) {
forward_diff_bezier( prevbezt->vec[1][j], prevbezt->vec[2][j],
bezt->vec[0][j], bezt->vec[1][j],
&(bevp->vec[j]), resolu, sizeof(BevPoint));
@@ -2199,7 +2214,7 @@ void makeBevelList(Object *ob)
resolu, sizeof(BevPoint));
- if(cu->twist_mode==CU_TWIST_TANGENT) {
+ if (cu->twist_mode==CU_TWIST_TANGENT) {
forward_diff_bezier_cotangent(
prevbezt->vec[1], prevbezt->vec[2],
bezt->vec[0], bezt->vec[1],
@@ -2207,12 +2222,12 @@ void makeBevelList(Object *ob)
}
/* indicate with handlecodes double points */
- if(prevbezt->h1==prevbezt->h2) {
- if(prevbezt->h1==0 || prevbezt->h1==HD_VECT) bevp->split_tag= TRUE;
+ if (prevbezt->h1==prevbezt->h2) {
+ if (prevbezt->h1==0 || prevbezt->h1==HD_VECT) bevp->split_tag= TRUE;
}
else {
- if(prevbezt->h1==0 || prevbezt->h1==HD_VECT) bevp->split_tag= TRUE;
- else if(prevbezt->h2==0 || prevbezt->h2==HD_VECT) bevp->split_tag= TRUE;
+ if (prevbezt->h1==0 || prevbezt->h1==HD_VECT) bevp->split_tag= TRUE;
+ else if (prevbezt->h2==0 || prevbezt->h2==HD_VECT) bevp->split_tag= TRUE;
}
bl->nr+= resolu;
bevp+= resolu;
@@ -2221,7 +2236,7 @@ void makeBevelList(Object *ob)
bezt++;
}
- if((nu->flagu & CU_NURB_CYCLIC)==0) { /* not cyclic: endpoint */
+ if ((nu->flagu & CU_NURB_CYCLIC)==0) { /* not cyclic: endpoint */
copy_v3_v3(bevp->vec, prevbezt->vec[1]);
bevp->alfa= prevbezt->alfa;
bevp->radius= prevbezt->radius;
@@ -2229,15 +2244,15 @@ void makeBevelList(Object *ob)
bl->nr++;
}
}
- else if(nu->type == CU_NURBS) {
- if(nu->pntsv==1) {
+ else if (nu->type == CU_NURBS) {
+ if (nu->pntsv==1) {
len= (resolu*SEGMENTSU(nu));
bl= MEM_callocN(sizeof(BevList)+len*sizeof(BevPoint), "makeBevelList3");
BLI_addtail(&(cu->bev), bl);
bl->nr= len;
bl->dupe_nr= 0;
- if(nu->flagu & CU_NURB_CYCLIC) bl->poly= 0;
+ if (nu->flagu & CU_NURB_CYCLIC) bl->poly= 0;
else bl->poly= -1;
bevp= (BevPoint *)(bl+1);
@@ -2254,16 +2269,16 @@ void makeBevelList(Object *ob)
/* STEP 2: DOUBLE POINTS AND AUTOMATIC RESOLUTION, REDUCE DATABLOCKS */
bl= cu->bev.first;
- while(bl) {
+ while (bl) {
if (bl->nr) { /* null bevel items come from single points */
nr= bl->nr;
bevp1= (BevPoint *)(bl+1);
bevp0= bevp1+(nr-1);
nr--;
- while(nr--) {
- if( fabs(bevp0->vec[0]-bevp1->vec[0])<0.00001 ) {
- if( fabs(bevp0->vec[1]-bevp1->vec[1])<0.00001 ) {
- if( fabs(bevp0->vec[2]-bevp1->vec[2])<0.00001 ) {
+ while (nr--) {
+ if ( fabs(bevp0->vec[0]-bevp1->vec[0])<0.00001 ) {
+ if ( fabs(bevp0->vec[1]-bevp1->vec[1])<0.00001 ) {
+ if ( fabs(bevp0->vec[2]-bevp1->vec[2])<0.00001 ) {
bevp0->dupe_tag= TRUE;
bl->dupe_nr++;
}
@@ -2276,9 +2291,9 @@ void makeBevelList(Object *ob)
bl= bl->next;
}
bl= cu->bev.first;
- while(bl) {
+ while (bl) {
blnext= bl->next;
- if(bl->nr && bl->dupe_nr) {
+ if (bl->nr && bl->dupe_nr) {
nr= bl->nr- bl->dupe_nr+1; /* +1 because vectorbezier sets flag too */
blnew= MEM_mallocN(sizeof(BevList)+nr*sizeof(BevPoint), "makeBevelList4");
memcpy(blnew, bl, sizeof(BevList));
@@ -2288,8 +2303,8 @@ void makeBevelList(Object *ob)
bevp0= (BevPoint *)(bl+1);
bevp1= (BevPoint *)(blnew+1);
nr= bl->nr;
- while(nr--) {
- if(bevp0->dupe_tag==0) {
+ while (nr--) {
+ if (bevp0->dupe_tag==0) {
memcpy(bevp1, bevp0, sizeof(BevPoint));
bevp1++;
blnew->nr++;
@@ -2305,8 +2320,8 @@ void makeBevelList(Object *ob)
/* STEP 3: POLYS COUNT AND AUTOHOLE */
bl= cu->bev.first;
poly= 0;
- while(bl) {
- if(bl->nr && bl->poly>=0) {
+ while (bl) {
+ if (bl->nr && bl->poly>=0) {
poly++;
bl->poly= poly;
bl->hole= 0;
@@ -2316,17 +2331,17 @@ void makeBevelList(Object *ob)
/* find extreme left points, also test (turning) direction */
- if(poly>0) {
+ if (poly>0) {
sd= sortdata= MEM_mallocN(sizeof(struct bevelsort)*poly, "makeBevelList5");
bl= cu->bev.first;
- while(bl) {
- if(bl->poly>0) {
+ while (bl) {
+ if (bl->poly>0) {
min= 300000.0;
bevp= (BevPoint *)(bl+1);
nr= bl->nr;
- while(nr--) {
- if(min>bevp->vec[0]) {
+ while (nr--) {
+ if (min>bevp->vec[0]) {
min= bevp->vec[0];
bevp1= bevp;
}
@@ -2336,15 +2351,15 @@ void makeBevelList(Object *ob)
sd->left= min;
bevp= (BevPoint *)(bl+1);
- if(bevp1== bevp) bevp0= bevp+ (bl->nr-1);
+ if (bevp1== bevp) bevp0= bevp+ (bl->nr-1);
else bevp0= bevp1-1;
bevp= bevp+ (bl->nr-1);
- if(bevp1== bevp) bevp2= (BevPoint *)(bl+1);
+ if (bevp1== bevp) bevp2= (BevPoint *)(bl+1);
else bevp2= bevp1+1;
inp= (bevp1->vec[0]- bevp0->vec[0]) * (bevp0->vec[1]- bevp2->vec[1]) + (bevp0->vec[1]- bevp1->vec[1]) * (bevp0->vec[0]- bevp2->vec[0]);
- if(inp > 0.0f) sd->dir= 1;
+ if (inp > 0.0f) sd->dir= 1;
else sd->dir= 0;
sd++;
@@ -2355,11 +2370,11 @@ void makeBevelList(Object *ob)
qsort(sortdata,poly,sizeof(struct bevelsort), vergxcobev);
sd= sortdata+1;
- for(a=1; a<poly; a++, sd++) {
+ for (a=1; a<poly; a++, sd++) {
bl= sd->bl; /* is bl a hole? */
sd1= sortdata+ (a-1);
- for(b=a-1; b>=0; b--, sd1--) { /* all polys to the left */
- if(bevelinside(sd1->bl, bl)) {
+ for (b=a-1; b>=0; b--, sd1--) { /* all polys to the left */
+ if (bevelinside(sd1->bl, bl)) {
bl->hole= 1- sd1->bl->hole;
break;
}
@@ -2367,15 +2382,15 @@ void makeBevelList(Object *ob)
}
/* turning direction */
- if((cu->flag & CU_3D)==0) {
+ if ((cu->flag & CU_3D)==0) {
sd= sortdata;
- for(a=0; a<poly; a++, sd++) {
- if(sd->bl->hole==sd->dir) {
+ for (a=0; a<poly; a++, sd++) {
+ if (sd->bl->hole==sd->dir) {
bl= sd->bl;
bevp1= (BevPoint *)(bl+1);
bevp2= bevp1+ (bl->nr-1);
nr= bl->nr/2;
- while(nr--) {
+ while (nr--) {
SWAP(BevPoint, *bevp1, *bevp2);
bevp1++;
bevp2--;
@@ -2387,16 +2402,16 @@ void makeBevelList(Object *ob)
}
/* STEP 4: 2D-COSINES or 3D ORIENTATION */
- if((cu->flag & CU_3D)==0) {
+ if ((cu->flag & CU_3D)==0) {
/* note: bevp->dir and bevp->quat are not needed for beveling but are
* used when making a path from a 2D curve, therefor they need to be set - Campbell */
bl= cu->bev.first;
- while(bl) {
+ while (bl) {
- if(bl->nr < 2) {
+ if (bl->nr < 2) {
/* do nothing */
}
- else if(bl->nr==2) { /* 2 pnt, treat separate */
+ else if (bl->nr==2) { /* 2 pnt, treat separate */
bevp2= (BevPoint *)(bl+1);
bevp1= bevp2+1;
@@ -2416,7 +2431,7 @@ void makeBevelList(Object *ob)
bevp0= bevp1-1;
nr= bl->nr;
- while(nr--) {
+ while (nr--) {
x1= bevp1->vec[0]- bevp0->vec[0];
x2= bevp1->vec[0]- bevp2->vec[0];
y1= bevp1->vec[1]- bevp0->vec[1];
@@ -2436,7 +2451,7 @@ void makeBevelList(Object *ob)
}
/* correct non-cyclic cases */
- if(bl->poly== -1) {
+ if (bl->poly== -1) {
bevp= (BevPoint *)(bl+1);
bevp1= bevp+1;
bevp->sina= bevp1->sina;
@@ -2456,12 +2471,12 @@ void makeBevelList(Object *ob)
}
else { /* 3D Curves */
bl= cu->bev.first;
- while(bl) {
+ while (bl) {
- if(bl->nr < 2) {
+ if (bl->nr < 2) {
/* do nothing */
}
- else if(bl->nr==2) { /* 2 pnt, treat separate */
+ else if (bl->nr==2) { /* 2 pnt, treat separate */
make_bevel_list_segment_3D(bl);
}
else {
@@ -2480,20 +2495,20 @@ void makeBevelList(Object *ob)
*/
/* mode: is not zero when FCurve, is 2 when forced horizontal for autohandles */
-void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
+static void calchandleNurb_intern(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode, int skip_align)
{
float *p1,*p2,*p3, pt[3];
float dvec_a[3], dvec_b[3];
float len, len_a, len_b;
const float eps= 1e-5;
- if(bezt->h1==0 && bezt->h2==0) {
+ if (bezt->h1==0 && bezt->h2==0) {
return;
}
p2= bezt->vec[1];
- if(prev==NULL) {
+ if (prev==NULL) {
p3= next->vec[1];
pt[0]= 2.0f*p2[0] - p3[0];
pt[1]= 2.0f*p2[1] - p3[1];
@@ -2504,7 +2519,7 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
p1= prev->vec[1];
}
- if(next==NULL) {
+ if (next==NULL) {
pt[0]= 2.0f*p2[0] - p1[0];
pt[1]= 2.0f*p2[1] - p1[1];
pt[2]= 2.0f*p2[2] - p1[2];
@@ -2526,42 +2541,42 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
len_b= len_v3(dvec_b);
}
- if(len_a==0.0f) len_a=1.0f;
- if(len_b==0.0f) len_b=1.0f;
+ if (len_a==0.0f) len_a=1.0f;
+ if (len_b==0.0f) len_b=1.0f;
- if(ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM) || ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) { /* auto */
+ if (ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM) || ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) { /* auto */
float tvec[3];
tvec[0]= dvec_b[0]/len_b + dvec_a[0]/len_a;
tvec[1]= dvec_b[1]/len_b + dvec_a[1]/len_a;
tvec[2]= dvec_b[2]/len_b + dvec_a[2]/len_a;
len= len_v3(tvec) * 2.5614f;
- if(len!=0.0f) {
+ if (len!=0.0f) {
int leftviolate=0, rightviolate=0; /* for mode==2 */
- if(len_a>5.0f*len_b) len_a= 5.0f*len_b;
- if(len_b>5.0f*len_a) len_b= 5.0f*len_a;
+ if (len_a>5.0f*len_b) len_a= 5.0f*len_b;
+ if (len_b>5.0f*len_a) len_b= 5.0f*len_a;
- if(ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM)) {
+ if (ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM)) {
len_a/=len;
madd_v3_v3v3fl(p2-3, p2, tvec, -len_a);
- if((bezt->h1==HD_AUTO_ANIM) && next && prev) { /* keep horizontal if extrema */
+ if ((bezt->h1==HD_AUTO_ANIM) && next && prev) { /* keep horizontal if extrema */
float ydiff1= prev->vec[1][1] - bezt->vec[1][1];
float ydiff2= next->vec[1][1] - bezt->vec[1][1];
- if( (ydiff1 <= 0.0f && ydiff2 <= 0.0f) || (ydiff1 >= 0.0f && ydiff2 >= 0.0f) ) {
+ if ( (ydiff1 <= 0.0f && ydiff2 <= 0.0f) || (ydiff1 >= 0.0f && ydiff2 >= 0.0f) ) {
bezt->vec[0][1]= bezt->vec[1][1];
}
else { /* handles should not be beyond y coord of two others */
- if(ydiff1 <= 0.0f) {
- if(prev->vec[1][1] > bezt->vec[0][1]) {
+ if (ydiff1 <= 0.0f) {
+ if (prev->vec[1][1] > bezt->vec[0][1]) {
bezt->vec[0][1]= prev->vec[1][1];
leftviolate= 1;
}
}
else {
- if(prev->vec[1][1] < bezt->vec[0][1]) {
+ if (prev->vec[1][1] < bezt->vec[0][1]) {
bezt->vec[0][1]= prev->vec[1][1];
leftviolate= 1;
}
@@ -2569,25 +2584,25 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
}
}
}
- if(ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) {
+ if (ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) {
len_b/=len;
madd_v3_v3v3fl(p2+3, p2, tvec, len_b);
- if((bezt->h2==HD_AUTO_ANIM) && next && prev) { /* keep horizontal if extrema */
+ if ((bezt->h2==HD_AUTO_ANIM) && next && prev) { /* keep horizontal if extrema */
float ydiff1= prev->vec[1][1] - bezt->vec[1][1];
float ydiff2= next->vec[1][1] - bezt->vec[1][1];
- if( (ydiff1 <= 0.0f && ydiff2 <= 0.0f) || (ydiff1 >= 0.0f && ydiff2 >= 0.0f) ) {
+ if ( (ydiff1 <= 0.0f && ydiff2 <= 0.0f) || (ydiff1 >= 0.0f && ydiff2 >= 0.0f) ) {
bezt->vec[2][1]= bezt->vec[1][1];
}
else { /* andles should not be beyond y coord of two others */
- if(ydiff1 <= 0.0f) {
- if(next->vec[1][1] < bezt->vec[2][1]) {
+ if (ydiff1 <= 0.0f) {
+ if (next->vec[1][1] < bezt->vec[2][1]) {
bezt->vec[2][1]= next->vec[1][1];
rightviolate= 1;
}
}
else {
- if(next->vec[1][1] > bezt->vec[2][1]) {
+ if (next->vec[1][1] > bezt->vec[2][1]) {
bezt->vec[2][1]= next->vec[1][1];
rightviolate= 1;
}
@@ -2595,7 +2610,7 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
}
}
}
- if(leftviolate || rightviolate) { /* align left handle */
+ if (leftviolate || rightviolate) { /* align left handle */
float h1[3], h2[3];
float dot;
@@ -2607,7 +2622,7 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
dot= dot_v3v3(h1, h2);
- if(leftviolate) {
+ if (leftviolate) {
mul_v3_fl(h1, dot * len_b);
sub_v3_v3v3(p2+3, p2, h1);
}
@@ -2620,29 +2635,36 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
}
}
- if(bezt->h1==HD_VECT) { /* vector */
+ if (bezt->h1==HD_VECT) { /* vector */
madd_v3_v3v3fl(p2-3, p2, dvec_a, -1.0f/3.0f);
}
- if(bezt->h2==HD_VECT) {
+ if (bezt->h2==HD_VECT) {
madd_v3_v3v3fl(p2+3, p2, dvec_b, 1.0f/3.0f);
}
+ if (skip_align) {
+ /* handles need to be updated during animation and applying stuff like hooks,
+ * but in such situatios it's quite difficult to distinguish in which order
+ * align handles should be aligned so skip them for now */
+ return;
+ }
+
len_b= len_v3v3(p2, p2+3);
len_a= len_v3v3(p2, p2-3);
- if(len_a==0.0f) len_a= 1.0f;
- if(len_b==0.0f) len_b= 1.0f;
+ if (len_a==0.0f) len_a= 1.0f;
+ if (len_b==0.0f) len_b= 1.0f;
- if(bezt->f1 & SELECT) { /* order of calculation */
- if(bezt->h2==HD_ALIGN) { /* aligned */
- if(len_a>eps) {
+ if (bezt->f1 & SELECT) { /* order of calculation */
+ if (bezt->h2==HD_ALIGN) { /* aligned */
+ if (len_a>eps) {
len= len_b/len_a;
p2[3]= p2[0]+len*(p2[0] - p2[-3]);
p2[4]= p2[1]+len*(p2[1] - p2[-2]);
p2[5]= p2[2]+len*(p2[2] - p2[-1]);
}
}
- if(bezt->h1==HD_ALIGN) {
- if(len_b>eps) {
+ if (bezt->h1==HD_ALIGN) {
+ if (len_b>eps) {
len= len_a/len_b;
p2[-3]= p2[0]+len*(p2[0] - p2[3]);
p2[-2]= p2[1]+len*(p2[1] - p2[4]);
@@ -2651,16 +2673,16 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
}
}
else {
- if(bezt->h1==HD_ALIGN) {
- if(len_b>eps) {
+ if (bezt->h1==HD_ALIGN) {
+ if (len_b>eps) {
len= len_a/len_b;
p2[-3]= p2[0]+len*(p2[0] - p2[3]);
p2[-2]= p2[1]+len*(p2[1] - p2[4]);
p2[-1]= p2[2]+len*(p2[2] - p2[5]);
}
}
- if(bezt->h2==HD_ALIGN) { /* aligned */
- if(len_a>eps) {
+ if (bezt->h2==HD_ALIGN) { /* aligned */
+ if (len_a>eps) {
len= len_b/len_a;
p2[3]= p2[0]+len*(p2[0] - p2[-3]);
p2[4]= p2[1]+len*(p2[1] - p2[-2]);
@@ -2670,25 +2692,25 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
}
}
-void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */
+static void calchandlesNurb_intern(Nurb *nu, int skip_align)
{
BezTriple *bezt, *prev, *next;
short a;
- if(nu->type != CU_BEZIER) return;
- if(nu->pntsu<2) return;
+ if (nu->type != CU_BEZIER) return;
+ if (nu->pntsu<2) return;
a= nu->pntsu;
bezt= nu->bezt;
- if(nu->flagu & CU_NURB_CYCLIC) prev= bezt+(a-1);
+ if (nu->flagu & CU_NURB_CYCLIC) prev= bezt+(a-1);
else prev= NULL;
next= bezt+1;
- while(a--) {
- calchandleNurb(bezt, prev, next, 0);
+ while (a--) {
+ calchandleNurb_intern(bezt, prev, next, 0, skip_align);
prev= bezt;
- if(a==1) {
- if(nu->flagu & CU_NURB_CYCLIC) next= nu->bezt;
+ if (a==1) {
+ if (nu->flagu & CU_NURB_CYCLIC) next= nu->bezt;
else next= NULL;
}
else next++;
@@ -2697,42 +2719,52 @@ void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */
}
}
+void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
+{
+ calchandleNurb_intern(bezt, prev, next, mode, FALSE);
+}
+
+void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */
+{
+ calchandlesNurb_intern(nu, FALSE);
+}
+
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;
- if(nu->type != CU_BEZIER) return;
+ if (nu->type != CU_BEZIER) return;
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
+ while (a--) {
flag= 0;
- if(bezt->f1 & SELECT) flag++;
- if(bezt->f2 & SELECT) flag += 2;
- if(bezt->f3 & SELECT) flag += 4;
+ if (bezt->f1 & SELECT) flag++;
+ if (bezt->f2 & SELECT) flag += 2;
+ if (bezt->f3 & SELECT) flag += 4;
- if( !(flag==0 || flag==7) ) {
- if(ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM)) { /* auto */
+ if ( !(flag==0 || flag==7) ) {
+ if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM)) { /* auto */
bezt->h1= HD_ALIGN;
}
- if(ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) { /* auto */
+ if (ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) { /* auto */
bezt->h2= HD_ALIGN;
}
- if(bezt->h1==HD_VECT) { /* vector */
- if(flag < 4) bezt->h1= 0;
+ if (bezt->h1==HD_VECT) { /* vector */
+ if (flag < 4) bezt->h1= 0;
}
- if(bezt->h2==HD_VECT) { /* vector */
- if( flag > 3) bezt->h2= 0;
+ if (bezt->h2==HD_VECT) { /* vector */
+ if ( flag > 3) bezt->h2= 0;
}
}
bezt++;
@@ -2748,61 +2780,61 @@ void autocalchandlesNurb(Nurb *nu, int flag)
BezTriple *bezt2, *bezt1, *bezt0;
int i, align, leftsmall, rightsmall;
- if(nu==NULL || nu->bezt==NULL) return;
+ if (nu==NULL || nu->bezt==NULL) return;
bezt2 = nu->bezt;
bezt1 = bezt2 + (nu->pntsu-1);
bezt0 = bezt1 - 1;
i = nu->pntsu;
- while(i--) {
+ while (i--) {
align= leftsmall= rightsmall= 0;
/* left handle: */
- if(flag==0 || (bezt1->f1 & flag) ) {
+ if (flag==0 || (bezt1->f1 & flag) ) {
bezt1->h1= 0;
/* distance too short: vectorhandle */
- if( len_v3v3( bezt1->vec[1], bezt0->vec[1] ) < 0.0001f) {
+ if ( len_v3v3( bezt1->vec[1], bezt0->vec[1] ) < 0.0001f) {
bezt1->h1= HD_VECT;
leftsmall= 1;
}
else {
/* aligned handle? */
- if(dist_to_line_v2(bezt1->vec[1], bezt1->vec[0], bezt1->vec[2]) < 0.0001f) {
+ if (dist_to_line_v2(bezt1->vec[1], bezt1->vec[0], bezt1->vec[2]) < 0.0001f) {
align= 1;
bezt1->h1= HD_ALIGN;
}
/* or vector handle? */
- if(dist_to_line_v2(bezt1->vec[0], bezt1->vec[1], bezt0->vec[1]) < 0.0001f)
+ if (dist_to_line_v2(bezt1->vec[0], bezt1->vec[1], bezt0->vec[1]) < 0.0001f)
bezt1->h1= HD_VECT;
}
}
/* right handle: */
- if(flag==0 || (bezt1->f3 & flag) ) {
+ if (flag==0 || (bezt1->f3 & flag) ) {
bezt1->h2= 0;
/* distance too short: vectorhandle */
- if( len_v3v3( bezt1->vec[1], bezt2->vec[1] ) < 0.0001f) {
+ if ( len_v3v3( bezt1->vec[1], bezt2->vec[1] ) < 0.0001f) {
bezt1->h2= HD_VECT;
rightsmall= 1;
}
else {
/* aligned handle? */
- if(align) bezt1->h2= HD_ALIGN;
+ if (align) bezt1->h2= HD_ALIGN;
/* or vector handle? */
- if(dist_to_line_v2(bezt1->vec[2], bezt1->vec[1], bezt2->vec[1]) < 0.0001f)
+ if (dist_to_line_v2(bezt1->vec[2], bezt1->vec[1], bezt2->vec[1]) < 0.0001f)
bezt1->h2= HD_VECT;
}
}
- if(leftsmall && bezt1->h2==HD_ALIGN) bezt1->h2= 0;
- if(rightsmall && bezt1->h1==HD_ALIGN) bezt1->h1= 0;
+ if (leftsmall && bezt1->h2==HD_ALIGN) bezt1->h2= 0;
+ if (rightsmall && bezt1->h1==HD_ALIGN) bezt1->h1= 0;
/* undesired combination: */
- if(bezt1->h1==HD_ALIGN && bezt1->h2==HD_VECT) bezt1->h1= 0;
- if(bezt1->h2==HD_ALIGN && bezt1->h1==HD_VECT) bezt1->h2= 0;
+ if (bezt1->h1==HD_ALIGN && bezt1->h2==HD_VECT) bezt1->h1= 0;
+ if (bezt1->h2==HD_ALIGN && bezt1->h1==HD_VECT) bezt1->h2= 0;
bezt0= bezt1;
bezt1= bezt2;
@@ -2817,7 +2849,7 @@ void autocalchandlesNurb_all(ListBase *editnurb, int flag)
Nurb *nu;
nu= editnurb->first;
- while(nu) {
+ while (nu) {
autocalchandlesNurb(nu, flag);
nu= nu->next;
}
@@ -2835,19 +2867,19 @@ void sethandlesNurb(ListBase *editnurb, short code)
BezTriple *bezt;
short a, ok=0;
- if(code==1 || code==2) {
+ if (code==1 || code==2) {
nu= editnurb->first;
- while(nu) {
- if(nu->type == CU_BEZIER) {
+ while (nu) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
- if((bezt->f1 & SELECT) || (bezt->f3 & SELECT)) {
- if(bezt->f1 & SELECT) bezt->h1= code;
- if(bezt->f3 & SELECT) bezt->h2= code;
- if(bezt->h1!=bezt->h2) {
- if ELEM(bezt->h1, HD_ALIGN, HD_AUTO) bezt->h1= HD_FREE;
- if ELEM(bezt->h2, HD_ALIGN, HD_AUTO) bezt->h2= HD_FREE;
+ while (a--) {
+ if ((bezt->f1 & SELECT) || (bezt->f3 & SELECT)) {
+ if (bezt->f1 & SELECT) bezt->h1= code;
+ if (bezt->f3 & SELECT) bezt->h2= code;
+ if (bezt->h1!=bezt->h2) {
+ if (ELEM(bezt->h1, HD_ALIGN, HD_AUTO)) bezt->h1 = HD_FREE;
+ if (ELEM(bezt->h2, HD_ALIGN, HD_AUTO)) bezt->h2 = HD_FREE;
}
}
bezt++;
@@ -2863,34 +2895,36 @@ void sethandlesNurb(ListBase *editnurb, short code)
nu= editnurb->first;
if (code == 5) {
ok = HD_ALIGN;
- } else if (code == 6) {
+ }
+ else if (code == 6) {
ok = HD_FREE;
- } else {
+ }
+ else {
/* Toggle */
- while(nu) {
- if(nu->type == CU_BEZIER) {
+ while (nu) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
- if((bezt->f1 & SELECT) && bezt->h1) ok= 1;
- if((bezt->f3 & SELECT) && bezt->h2) ok= 1;
- if(ok) break;
+ while (a--) {
+ if ((bezt->f1 & SELECT) && bezt->h1) ok= 1;
+ if ((bezt->f3 & SELECT) && bezt->h2) ok= 1;
+ if (ok) break;
bezt++;
}
}
nu= nu->next;
}
- if(ok) ok= HD_FREE;
+ if (ok) ok= HD_FREE;
else ok= HD_ALIGN;
}
nu= editnurb->first;
- while(nu) {
- if(nu->type == CU_BEZIER) {
+ while (nu) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
- if(bezt->f1 & SELECT) bezt->h1= ok;
- if(bezt->f3 & SELECT) bezt->h2= ok;
+ while (a--) {
+ if (bezt->f1 & SELECT) bezt->h1= ok;
+ if (bezt->f3 & SELECT) bezt->h2= ok;
bezt++;
}
@@ -2904,9 +2938,9 @@ void sethandlesNurb(ListBase *editnurb, short code)
static void swapdata(void *adr1, void *adr2, int len)
{
- if(len<=0) return;
+ if (len<=0) return;
- if(len<65) {
+ if (len<65) {
char adr[64];
memcpy(adr, adr1, len);
@@ -2931,24 +2965,24 @@ void switchdirectionNurb(Nurb *nu)
float *fp1, *fp2, *tempf;
int a, b;
- if(nu->pntsu==1 && nu->pntsv==1) return;
+ if (nu->pntsu==1 && nu->pntsv==1) return;
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
a= nu->pntsu;
bezt1= nu->bezt;
bezt2= bezt1+(a-1);
- if(a & 1) a+= 1; /* if odd, also swap middle content */
+ if (a & 1) a+= 1; /* if odd, also swap middle content */
a/= 2;
- while(a>0) {
- if(bezt1!=bezt2) SWAP(BezTriple, *bezt1, *bezt2);
+ while (a>0) {
+ if (bezt1!=bezt2) SWAP(BezTriple, *bezt1, *bezt2);
swapdata(bezt1->vec[0], bezt1->vec[2], 12);
- if(bezt1!=bezt2) swapdata(bezt2->vec[0], bezt2->vec[2], 12);
+ if (bezt1!=bezt2) swapdata(bezt2->vec[0], bezt2->vec[2], 12);
SWAP(char, bezt1->h1, bezt1->h2);
SWAP(short, bezt1->f1, bezt1->f3);
- if(bezt1!=bezt2) {
+ if (bezt1!=bezt2) {
SWAP(char, bezt2->h1, bezt2->h2);
SWAP(short, bezt2->f1, bezt2->f3);
bezt1->alfa= -bezt1->alfa;
@@ -2959,12 +2993,12 @@ void switchdirectionNurb(Nurb *nu)
bezt2--;
}
}
- else if(nu->pntsv==1) {
+ else if (nu->pntsv==1) {
a= nu->pntsu;
bp1= nu->bp;
bp2= bp1+(a-1);
a/= 2;
- while(bp1!=bp2 && a>0) {
+ while (bp1!=bp2 && a>0) {
SWAP(BPoint, *bp1, *bp2);
a--;
bp1->alfa= -bp1->alfa;
@@ -2972,15 +3006,15 @@ void switchdirectionNurb(Nurb *nu)
bp1++;
bp2--;
}
- if(nu->type == CU_NURBS) {
+ if (nu->type == CU_NURBS) {
/* no knots for too short paths */
- if(nu->knotsu) {
+ if (nu->knotsu) {
/* inverse knots */
a= KNOTSU(nu);
fp1= nu->knotsu;
fp2= fp1+(a-1);
a/= 2;
- while(fp1!=fp2 && a>0) {
+ while (fp1!=fp2 && a>0) {
SWAP(float, *fp1, *fp2);
a--;
fp1++;
@@ -2990,7 +3024,7 @@ void switchdirectionNurb(Nurb *nu)
a= KNOTSU(nu);
fp1= nu->knotsu;
fp2=tempf= MEM_mallocN(sizeof(float)*a, "switchdirect");
- while(a--) {
+ while (a--) {
fp2[0]= fabs(fp1[1]-fp1[0]);
fp1++;
fp2++;
@@ -3001,7 +3035,7 @@ void switchdirectionNurb(Nurb *nu)
fp2= tempf;
fp1[0]= 0.0;
fp1++;
- while(a--) {
+ while (a--) {
fp1[0]= fp1[-1]+fp2[0];
fp1++;
fp2++;
@@ -3012,14 +3046,14 @@ void switchdirectionNurb(Nurb *nu)
}
else {
- for(b=0; b<nu->pntsv; b++) {
+ for (b=0; b<nu->pntsv; b++) {
bp1= nu->bp+b*nu->pntsu;
a= nu->pntsu;
bp2= bp1+(a-1);
a/= 2;
- while(bp1!=bp2 && a>0) {
+ while (bp1!=bp2 && a>0) {
SWAP(BPoint, *bp1, *bp2);
a--;
bp1++;
@@ -3046,7 +3080,8 @@ float (*curve_getVertexCos(Curve *UNUSED(cu), ListBase *lb, int *numVerts_r))[3]
copy_v3_v3(co, bezt->vec[1]); co+=3;
copy_v3_v3(co, bezt->vec[2]); co+=3;
}
- } else {
+ }
+ else {
BPoint *bp = nu->bp;
for (i=0; i<nu->pntsu*nu->pntsv; i++,bp++) {
@@ -3073,13 +3108,16 @@ void curve_applyVertexCos(Curve *UNUSED(cu), ListBase *lb, float (*vertexCos)[3]
copy_v3_v3(bezt->vec[1], co); co+=3;
copy_v3_v3(bezt->vec[2], co); co+=3;
}
- } else {
+ }
+ else {
BPoint *bp = nu->bp;
for (i=0; i<nu->pntsu*nu->pntsv; i++,bp++) {
copy_v3_v3(bp->vec, co); co+=3;
}
}
+
+ calchandlesNurb_intern(nu, TRUE);
}
}
@@ -3104,7 +3142,7 @@ float (*curve_getKeyVertexCos(Curve *UNUSED(cu), ListBase *lb, float *key))[3]
else {
BPoint *bp = nu->bp;
- for(i=0; i<nu->pntsu*nu->pntsv; i++,bp++) {
+ for (i=0; i<nu->pntsu*nu->pntsv; i++,bp++) {
copy_v3_v3(co, key); co+=3; key+=3;
key++; /* skip tilt */
}
@@ -3119,11 +3157,11 @@ void curve_applyKeyVertexTilts(Curve *UNUSED(cu), ListBase *lb, float *key)
Nurb *nu;
int i;
- for(nu=lb->first; nu; nu=nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu=lb->first; nu; nu=nu->next) {
+ if (nu->type == CU_BEZIER) {
BezTriple *bezt = nu->bezt;
- for(i=0; i<nu->pntsu; i++,bezt++) {
+ for (i=0; i<nu->pntsu; i++,bezt++) {
key+=3*3;
bezt->alfa= *key;
key+=3;
@@ -3132,7 +3170,7 @@ void curve_applyKeyVertexTilts(Curve *UNUSED(cu), ListBase *lb, float *key)
else {
BPoint *bp = nu->bp;
- for(i=0; i<nu->pntsu*nu->pntsv; i++,bp++) {
+ for (i=0; i<nu->pntsu*nu->pntsv; i++,bp++) {
key+=3;
bp->alfa= *key;
key++;
@@ -3151,7 +3189,8 @@ int check_valid_nurb_u( struct Nurb *nu )
if (((nu->flag & CU_NURB_CYCLIC)==0) && (nu->flagu & CU_NURB_BEZIER)) { /* Bezier U Endpoints */
if (nu->orderu==4) {
if (nu->pntsu < 5) return 0; /* bezier with 4 orderu needs 5 points */
- } else if (nu->orderu != 3) return 0; /* order must be 3 or 4 */
+ }
+ else if (nu->orderu != 3) return 0; /* order must be 3 or 4 */
}
return 1;
}
@@ -3165,7 +3204,8 @@ int check_valid_nurb_v( struct Nurb *nu)
if (((nu->flag & CU_NURB_CYCLIC)==0) && (nu->flagv & CU_NURB_BEZIER)) { /* Bezier V Endpoints */
if (nu->orderv==4) {
if (nu->pntsv < 5) return 0; /* bezier with 4 orderu needs 5 points */
- } else if (nu->orderv != 3) return 0; /* order must be 3 or 4 */
+ }
+ else if (nu->orderv != 3) return 0; /* order must be 3 or 4 */
}
return 1;
}
@@ -3173,11 +3213,11 @@ int check_valid_nurb_v( struct Nurb *nu)
int clamp_nurb_order_u( struct Nurb *nu )
{
int change = 0;
- if(nu->pntsu<nu->orderu) {
+ if (nu->pntsu<nu->orderu) {
nu->orderu= nu->pntsu;
change= 1;
}
- if(((nu->flagu & CU_NURB_CYCLIC)==0) && (nu->flagu & CU_NURB_BEZIER)) {
+ if (((nu->flagu & CU_NURB_CYCLIC)==0) && (nu->flagu & CU_NURB_BEZIER)) {
CLAMP(nu->orderu, 3,4);
change= 1;
}
@@ -3187,11 +3227,11 @@ int clamp_nurb_order_u( struct Nurb *nu )
int clamp_nurb_order_v( struct Nurb *nu)
{
int change = 0;
- if(nu->pntsv<nu->orderv) {
+ if (nu->pntsv<nu->orderv) {
nu->orderv= nu->pntsv;
change= 1;
}
- if(((nu->flagv & CU_NURB_CYCLIC)==0) && (nu->flagv & CU_NURB_BEZIER)) {
+ if (((nu->flagv & CU_NURB_CYCLIC)==0) && (nu->flagv & CU_NURB_BEZIER)) {
CLAMP(nu->orderv, 3,4);
change= 1;
}
@@ -3215,7 +3255,7 @@ int minmax_curve(Curve *cu, float min[3], float max[3])
ListBase *nurb_lb= BKE_curve_nurbs(cu);
Nurb *nu;
- for(nu= nurb_lb->first; nu; nu= nu->next)
+ for (nu= nurb_lb->first; nu; nu= nu->next)
minmaxNurb(nu, min, max);
return (nurb_lb->first != NULL);
@@ -3229,14 +3269,14 @@ int curve_center_median(Curve *cu, float cent[3])
zero_v3(cent);
- for(nu= nurb_lb->first; nu; nu= nu->next) {
+ for (nu= nurb_lb->first; nu; nu= nu->next) {
int i;
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
BezTriple *bezt;
i= nu->pntsu;
total += i * 3;
- for(bezt= nu->bezt; i--; bezt++) {
+ for (bezt= nu->bezt; i--; bezt++) {
add_v3_v3(cent, bezt->vec[0]);
add_v3_v3(cent, bezt->vec[1]);
add_v3_v3(cent, bezt->vec[2]);
@@ -3246,7 +3286,7 @@ int curve_center_median(Curve *cu, float cent[3])
BPoint *bp;
i= nu->pntsu*nu->pntsv;
total += i;
- for(bp= nu->bp; i--; bp++) {
+ for (bp= nu->bp; i--; bp++) {
add_v3_v3(cent, bp->vec);
}
}
@@ -3261,7 +3301,7 @@ int curve_center_bounds(Curve *cu, float cent[3])
{
float min[3], max[3];
INIT_MINMAX(min, max);
- if(minmax_curve(cu, min, max)) {
+ if (minmax_curve(cu, min, max)) {
mid_v3_v3v3(cent, min, max);
return 1;
}
@@ -3275,13 +3315,13 @@ void curve_translate(Curve *cu, float offset[3], int do_keys)
Nurb *nu;
int i;
- for(nu= nurb_lb->first; nu; nu= nu->next) {
+ for (nu= nurb_lb->first; nu; nu= nu->next) {
BezTriple *bezt;
BPoint *bp;
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
i= nu->pntsu;
- for(bezt= nu->bezt; i--; bezt++) {
+ for (bezt= nu->bezt; i--; bezt++) {
add_v3_v3(bezt->vec[0], offset);
add_v3_v3(bezt->vec[1], offset);
add_v3_v3(bezt->vec[2], offset);
@@ -3289,7 +3329,7 @@ void curve_translate(Curve *cu, float offset[3], int do_keys)
}
else {
i= nu->pntsu*nu->pntsv;
- for(bp= nu->bp; i--; bp++) {
+ for (bp= nu->bp; i--; bp++) {
add_v3_v3(bp->vec, offset);
}
}
@@ -3310,10 +3350,10 @@ void curve_delete_material_index(Curve *cu, int index)
{
const int curvetype= curve_type(cu);
- if(curvetype == OB_FONT) {
+ if (curvetype == OB_FONT) {
struct CharInfo *info= cu->strinfo;
int i;
- for(i= cu->len-1; i >= 0; i--, info++) {
+ for (i= cu->len-1; i >= 0; i--, info++) {
if (info->mat_nr && info->mat_nr>=index) {
info->mat_nr--;
}
@@ -3323,7 +3363,7 @@ void curve_delete_material_index(Curve *cu, int index)
Nurb *nu;
for (nu= cu->nurb.first; nu; nu= nu->next) {
- if(nu->mat_nr && nu->mat_nr>=index) {
+ if (nu->mat_nr && nu->mat_nr>=index) {
nu->mat_nr--;
if (curvetype == OB_CURVE) nu->charidx--;
}
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 7ed9a7603ac..638ba2ddc4d 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -51,6 +51,7 @@
#include "BLI_mempool.h"
#include "BLI_utildefines.h"
+#include "BKE_utildefines.h"
#include "BKE_customdata.h"
#include "BKE_customdata_file.h"
#include "BKE_global.h"
@@ -101,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 necassary for geometry collapse*/
+ /* functions necessary for geometry collapse*/
int (*equal)(void *data1, void *data2);
void (*multiply)(void *data, float fac);
void (*initminmax)(void *min, void *max);
@@ -129,10 +130,10 @@ static void layerCopy_mdeformvert(const void *source, void *dest,
memcpy(dest, source, count * size);
- for(i = 0; i < count; ++i) {
+ for (i = 0; i < count; ++i) {
MDeformVert *dvert = (MDeformVert *)((char *)dest + i * size);
- if(dvert->totweight) {
+ if (dvert->totweight) {
MDeformWeight *dw = MEM_callocN(dvert->totweight * sizeof(*dw),
"layerCopy_mdeformvert dw");
@@ -148,10 +149,10 @@ static void layerFree_mdeformvert(void *data, int count, int size)
{
int i;
- for(i = 0; i < count; ++i) {
+ for (i = 0; i < count; ++i) {
MDeformVert *dvert = (MDeformVert *)((char *)data + i * size);
- if(dvert->dw) {
+ if (dvert->dw) {
MEM_freeN(dvert->dw);
dvert->dw = NULL;
dvert->totweight = 0;
@@ -165,19 +166,26 @@ static void layerCopy_bmesh_elem_py_ptr(const void *UNUSED(source), void *dest,
{
int i, size = sizeof(void *);
- for(i = 0; i < count; ++i) {
+ for (i = 0; i < count; ++i) {
void **ptr = (void **)((char *)dest + i * size);
*ptr = NULL;
}
}
+#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);
int i;
- for(i = 0; i < count; ++i) {
+ for (i = 0; i < count; ++i) {
void **ptr = (void *)((char *)data + i * size);
if (*ptr) {
bpy_bm_generic_invalidate(*ptr);
@@ -199,28 +207,28 @@ static void layerInterp_mdeformvert(void **sources, float *weights,
LinkNode *node;
int i, j, totweight;
- if(count <= 0) return;
+ if (count <= 0) return;
/* build a list of unique def_nrs for dest */
totweight = 0;
- for(i = 0; i < count; ++i) {
+ for (i = 0; i < count; ++i) {
MDeformVert *source = sources[i];
float interp_weight = weights ? weights[i] : 1.0f;
- for(j = 0; j < source->totweight; ++j) {
+ for (j = 0; j < source->totweight; ++j) {
MDeformWeight *dw = &source->dw[j];
- for(node = dest_dw; node; node = node->next) {
+ for (node = dest_dw; node; node = node->next) {
MDeformWeight *tmp_dw = (MDeformWeight *)node->link;
- if(tmp_dw->def_nr == dw->def_nr) {
+ if (tmp_dw->def_nr == dw->def_nr) {
tmp_dw->weight += dw->weight * interp_weight;
break;
}
}
/* if this def_nr is not in the list, add it */
- if(!node) {
+ if (!node) {
MDeformWeight *tmp_dw = MEM_callocN(sizeof(*tmp_dw),
"layerInterp_mdeformvert tmp_dw");
tmp_dw->def_nr = dw->def_nr;
@@ -232,14 +240,14 @@ static void layerInterp_mdeformvert(void **sources, float *weights,
}
/* now we know how many unique deform weights there are, so realloc */
- if(dvert->dw) MEM_freeN(dvert->dw);
+ if (dvert->dw) MEM_freeN(dvert->dw);
- if(totweight) {
+ if (totweight) {
dvert->dw = MEM_callocN(sizeof(*dvert->dw) * totweight,
"layerInterp_mdeformvert dvert->dw");
dvert->totweight = totweight;
- for(i = 0, node = dest_dw; node; node = node->next, ++i)
+ for (i = 0, node = dest_dw; node; node = node->next, ++i)
dvert->dw[i] = *((MDeformWeight *)node->link);
}
else
@@ -257,7 +265,7 @@ static void layerInterp_msticky(void **sources, float *weights,
int i;
co[0] = co[1] = 0.0f;
- for(i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
w = weights ? weights[i] : 1.0f;
mst = (MSticky*)sources[i];
@@ -275,7 +283,7 @@ static void layerCopy_tface(const void *source, void *dest, int count)
MTFace *dest_tf = (MTFace*)dest;
int i;
- for(i = 0; i < count; ++i)
+ for (i = 0; i < count; ++i)
dest_tf[i] = source_tf[i];
}
@@ -287,16 +295,16 @@ static void layerInterp_tface(void **sources, float *weights,
float uv[4][2] = {{0.0f}};
float *sub_weight;
- if(count <= 0) return;
+ if (count <= 0) return;
sub_weight = sub_weights;
- for(i = 0; i < count; ++i) {
+ for (i = 0; i < count; ++i) {
float weight = weights ? weights[i] : 1;
MTFace *src = sources[i];
- for(j = 0; j < 4; ++j) {
- if(sub_weights) {
- for(k = 0; k < 4; ++k, ++sub_weight) {
+ for (j = 0; j < 4; ++j) {
+ if (sub_weights) {
+ for (k = 0; k < 4; ++k, ++sub_weight) {
madd_v2_v2fl(uv[j], src->uv[k], (*sub_weight) * weight);
}
}
@@ -322,18 +330,18 @@ static void layerSwap_tface(void *data, const int *corner_indices)
char flag = tf->flag & ~(TF_SEL1 | TF_SEL2 | TF_SEL3 | TF_SEL4);
int j;
- for(j = 0; j < 4; ++j) {
+ for (j = 0; j < 4; ++j) {
const int source_index = corner_indices[j];
copy_v2_v2(uv[j], tf->uv[source_index]);
// swap pinning flags around
- if(tf->unwrap & pin_flags[source_index]) {
+ if (tf->unwrap & pin_flags[source_index]) {
unwrap |= pin_flags[j];
}
// swap selection flags around
- if(tf->flag & sel_flags[source_index]) {
+ if (tf->flag & sel_flags[source_index]) {
flag |= sel_flags[j];
}
}
@@ -350,7 +358,7 @@ static void layerDefault_tface(void *data, int count)
MTFace *tf = (MTFace*)data;
int i;
- for(i = 0; i < count; i++)
+ for (i = 0; i < count; i++)
tf[i] = default_tf;
}
@@ -378,7 +386,7 @@ static void layerCopy_origspace_face(const void *source, void *dest, int count)
OrigSpaceFace *dest_tf = (OrigSpaceFace*)dest;
int i;
- for(i = 0; i < count; ++i)
+ for (i = 0; i < count; ++i)
dest_tf[i] = source_tf[i];
}
@@ -390,19 +398,20 @@ static void layerInterp_origspace_face(void **sources, float *weights,
float uv[4][2] = {{0.0f}};
float *sub_weight;
- if(count <= 0) return;
+ if (count <= 0) return;
sub_weight = sub_weights;
- for(i = 0; i < count; ++i) {
+ for (i = 0; i < count; ++i) {
float weight = weights ? weights[i] : 1;
OrigSpaceFace *src = sources[i];
- for(j = 0; j < 4; ++j) {
- if(sub_weights) {
- for(k = 0; k < 4; ++k, ++sub_weight) {
+ for (j = 0; j < 4; ++j) {
+ if (sub_weights) {
+ for (k = 0; k < 4; ++k, ++sub_weight) {
madd_v2_v2fl(uv[j], src->uv[k], (*sub_weight) * weight);
}
- } else {
+ }
+ else {
madd_v2_v2fl(uv[j], src->uv[j], weight);
}
}
@@ -420,7 +429,7 @@ static void layerSwap_origspace_face(void *data, const int *corner_indices)
float uv[4][2];
int j;
- for(j = 0; j < 4; ++j) {
+ for (j = 0; j < 4; ++j) {
copy_v2_v2(uv[j], osf->uv[corner_indices[j]]);
}
memcpy(osf->uv, uv, sizeof(osf->uv));
@@ -432,7 +441,7 @@ static void layerDefault_origspace_face(void *data, int count)
OrigSpaceFace *osf = (OrigSpaceFace*)data;
int i;
- for(i = 0; i < count; i++)
+ for (i = 0; i < count; i++)
osf[i] = default_osf;
}
@@ -442,14 +451,14 @@ static void layerSwap_mdisps(void *data, const int *ci)
float (*d)[3] = NULL;
int corners, cornersize, S;
- if(s->disps) {
+ if (s->disps) {
int nverts= (ci[1] == 3) ? 4 : 3; /* silly way to know vertex count of face */
corners= multires_mdisp_corners(s);
cornersize= s->totdisp/corners;
- if(corners!=nverts) {
+ 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;
@@ -459,7 +468,7 @@ static void layerSwap_mdisps(void *data, const int *ci)
d= MEM_callocN(sizeof(float) * 3 * s->totdisp, "mdisps swap");
- for(S = 0; S < corners; S++)
+ for (S = 0; S < corners; S++)
memcpy(d + cornersize*S, s->disps + cornersize*ci[S], cornersize*3*sizeof(float));
MEM_freeN(s->disps);
@@ -473,14 +482,18 @@ static void layerCopy_mdisps(const void *source, void *dest, int count)
const MDisps *s = source;
MDisps *d = dest;
- for(i = 0; i < count; ++i) {
- if(s[i].disps) {
+ for (i = 0; i < count; ++i) {
+ if (s[i].disps) {
d[i].disps = MEM_dupallocN(s[i].disps);
+ d[i].hidden = MEM_dupallocN(s[i].hidden);
d[i].totdisp = s[i].totdisp;
+ d[i].level = s[i].level;
}
else {
d[i].disps = NULL;
+ d[i].hidden = NULL;
d[i].totdisp = 0;
+ d[i].level = 0;
}
}
@@ -491,11 +504,15 @@ static void layerFree_mdisps(void *data, int count, int UNUSED(size))
int i;
MDisps *d = data;
- for(i = 0; i < count; ++i) {
- if(d[i].disps)
+ for (i = 0; i < count; ++i) {
+ if (d[i].disps)
MEM_freeN(d[i].disps);
+ if (d[i].hidden)
+ MEM_freeN(d[i].hidden);
d[i].disps = NULL;
+ d[i].hidden = NULL;
d[i].totdisp = 0;
+ d[i].level = 0;
}
}
@@ -504,11 +521,11 @@ static int layerRead_mdisps(CDataFile *cdf, void *data, int count)
MDisps *d = data;
int i;
- for(i = 0; i < count; ++i) {
- if(!d[i].disps)
+ for (i = 0; i < count; ++i) {
+ if (!d[i].disps)
d[i].disps = MEM_callocN(sizeof(float)*3*d[i].totdisp, "mdisps read");
- if(!cdf_read_data(cdf, d[i].totdisp*3*sizeof(float), d[i].disps)) {
+ if (!cdf_read_data(cdf, d[i].totdisp*3*sizeof(float), d[i].disps)) {
printf("failed to read multires displacement %d/%d %d\n", i, count, d[i].totdisp);
return 0;
}
@@ -522,8 +539,8 @@ static int layerWrite_mdisps(CDataFile *cdf, void *data, int count)
MDisps *d = data;
int i;
- for(i = 0; i < count; ++i) {
- if(!cdf_write_data(cdf, d[i].totdisp*3*sizeof(float), d[i].disps)) {
+ for (i = 0; i < count; ++i) {
+ if (!cdf_write_data(cdf, d[i].totdisp*3*sizeof(float), d[i].disps)) {
printf("failed to write multires displacement %d/%d %d\n", i, count, d[i].totdisp);
return 0;
}
@@ -538,7 +555,7 @@ static size_t layerFilesize_mdisps(CDataFile *UNUSED(cdf), void *data, int count
size_t size = 0;
int i;
- for(i = 0; i < count; ++i)
+ for (i = 0; i < count; ++i)
size += d[i].totdisp*3*sizeof(float);
return size;
@@ -624,7 +641,7 @@ static void layerDefault_mloopcol(void *data, int count)
MLoopCol default_mloopcol = {255,255,255,255};
MLoopCol *mlcol = (MLoopCol*)data;
int i;
- for(i = 0; i < count; i++)
+ for (i = 0; i < count; i++)
mlcol[i] = default_mloopcol;
}
@@ -648,17 +665,17 @@ static void layerInterp_mloopcol(void **sources, float *weights,
float weight = weights ? weights[i] : 1;
MLoopCol *src = sources[i];
if (sub_weights) {
- col.a += src->a * (*sub_weight) * weight;
col.r += src->r * (*sub_weight) * weight;
col.g += src->g * (*sub_weight) * weight;
col.b += src->b * (*sub_weight) * weight;
+ col.a += src->a * (*sub_weight) * weight;
sub_weight++;
}
else {
- col.a += src->a * weight;
col.r += src->r * weight;
col.g += src->g * weight;
col.b += src->b * weight;
+ col.a += src->a * weight;
}
}
@@ -669,10 +686,10 @@ static void layerInterp_mloopcol(void **sources, float *weights,
CLAMP(col.g, 0.0f, 255.0f);
CLAMP(col.b, 0.0f, 255.0f);
- mc->a = (int)col.a;
mc->r = (int)col.r;
mc->g = (int)col.g;
mc->b = (int)col.b;
+ mc->a = (int)col.a;
}
static void layerCopyValue_mloopuv(void *source, void *dest)
@@ -728,7 +745,7 @@ static void layerInterp_mloopuv(void **sources, float *weights,
if (sub_weights) {
const float *sub_weight = sub_weights;
- for(i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
float weight = weights ? weights[i] : 1.0f;
MLoopUV *src = sources[i];
madd_v2_v2fl(uv, src->uv, (*sub_weight) * weight);
@@ -736,7 +753,7 @@ static void layerInterp_mloopuv(void **sources, float *weights,
}
}
else {
- for(i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
float weight = weights ? weights[i] : 1;
MLoopUV *src = sources[i];
madd_v2_v2fl(uv, src->uv, weight);
@@ -798,7 +815,7 @@ static void layerInterp_mloop_origspace(void **sources, float *weights,
if (sub_weights) {
const float *sub_weight = sub_weights;
- for(i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
float weight = weights ? weights[i] : 1.0f;
OrigSpaceLoop *src = sources[i];
madd_v2_v2fl(uv, src->uv, (*sub_weight) * weight);
@@ -806,7 +823,7 @@ static void layerInterp_mloop_origspace(void **sources, float *weights,
}
}
else {
- for(i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
float weight = weights ? weights[i] : 1;
OrigSpaceLoop *src = sources[i];
madd_v2_v2fl(uv, src->uv, weight);
@@ -829,23 +846,24 @@ static void layerInterp_mcol(void **sources, float *weights,
float *sub_weight;
- if(count <= 0) return;
+ if (count <= 0) return;
sub_weight = sub_weights;
- for(i = 0; i < count; ++i) {
+ for (i = 0; i < count; ++i) {
float weight = weights ? weights[i] : 1;
- for(j = 0; j < 4; ++j) {
- if(sub_weights) {
+ for (j = 0; j < 4; ++j) {
+ if (sub_weights) {
MCol *src = sources[i];
- for(k = 0; k < 4; ++k, ++sub_weight, ++src) {
+ for (k = 0; k < 4; ++k, ++sub_weight, ++src) {
const float w= (*sub_weight) * weight;
col[j].a += src->a * w;
col[j].r += src->r * w;
col[j].g += src->g * w;
col[j].b += src->b * w;
}
- } else {
+ }
+ else {
MCol *src = sources[i];
col[j].a += src[j].a * weight;
col[j].r += src[j].r * weight;
@@ -855,7 +873,7 @@ static void layerInterp_mcol(void **sources, float *weights,
}
}
- for(j = 0; j < 4; ++j) {
+ for (j = 0; j < 4; ++j) {
/* Subdivide smooth or fractal can cause problems without clamping
* although weights should also not cause this situation */
@@ -877,7 +895,7 @@ static void layerSwap_mcol(void *data, const int *corner_indices)
MCol col[4];
int j;
- for(j = 0; j < 4; ++j)
+ for (j = 0; j < 4; ++j)
col[j] = mcol[corner_indices[j]];
memcpy(mcol, col, sizeof(col));
@@ -889,7 +907,7 @@ static void layerDefault_mcol(void *data, int count)
MCol *mcol = (MCol*)data;
int i;
- for(i = 0; i < 4*count; i++) {
+ for (i = 0; i < 4*count; i++) {
mcol[i] = default_mcol;
}
}
@@ -901,17 +919,17 @@ static void layerInterp_bweight(void **sources, float *weights,
float **in = (float **)sources;
int i;
- if(count <= 0) return;
+ if (count <= 0) return;
*f = 0.0f;
if (weights) {
- for(i = 0; i < count; ++i) {
+ for (i = 0; i < count; ++i) {
*f += *in[i] * weights[i];
}
}
else {
- for(i = 0; i < count; ++i) {
+ for (i = 0; i < count; ++i) {
*f += *in[i];
}
}
@@ -924,17 +942,17 @@ static void layerInterp_shapekey(void **sources, float *weights,
float **in = (float **)sources;
int i;
- if(count <= 0) return;
+ if (count <= 0) return;
zero_v3(co);
if (weights) {
- for(i = 0; i < count; ++i) {
+ for (i = 0; i < count; ++i) {
madd_v3_v3fl(co, in[i], weights[i]);
}
}
else {
- for(i = 0; i < count; ++i) {
+ for (i = 0; i < count; ++i) {
add_v3_v3(co, in[i]);
}
}
@@ -996,8 +1014,8 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
layerFree_mdisps, NULL, layerSwap_mdisps, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
layerRead_mdisps, layerWrite_mdisps, layerFilesize_mdisps},
- /* 20: CD_WEIGHT_MCOL */
- {sizeof(MCol)*4, "MCol", 4, "WeightCol", NULL, NULL, layerInterp_mcol,
+ /* 20: CD_PREVIEW_MCOL */
+ {sizeof(MCol)*4, "MCol", 4, "PreviewCol", NULL, NULL, layerInterp_mcol,
layerSwap_mcol, layerDefault_mcol},
/* 21: CD_ID_MCOL */
{sizeof(MCol)*4, "MCol", 4, "IDCol", NULL, NULL, layerInterp_mcol,
@@ -1028,8 +1046,8 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
{sizeof(OrigSpaceLoop), "OrigSpaceLoop", 1, "OS Loop", NULL, NULL, layerInterp_mloop_origspace, NULL, NULL,
layerEqual_mloop_origspace, layerMultiply_mloop_origspace, layerInitMinMax_mloop_origspace,
layerAdd_mloop_origspace, layerDoMinMax_mloop_origspace, layerCopyValue_mloop_origspace},
- /* 32: CD_WEIGHT_MLOOPCOL */
- {sizeof(MLoopCol), "MLoopCol", 1, "WeightLoopCol", NULL, NULL, layerInterp_mloopcol, NULL,
+ /* 32: CD_PREVIEW_MLOOPCOL */
+ {sizeof(MLoopCol), "MLoopCol", 1, "PreviewLoopCol", NULL, NULL, layerInterp_mloopcol, NULL,
layerDefault_mloopcol, layerEqual_mloopcol, layerMultiply_mloopcol, layerInitMinMax_mloopcol,
layerAdd_mloopcol, layerDoMinMax_mloopcol, layerCopyValue_mloopcol},
/* 33: CD_BM_ELEM_PYPTR */
@@ -1048,12 +1066,12 @@ static const char *LAYERTYPENAMES[CD_NUMTYPES] = {
/* 5-9 */ "CDMTFace", "CDMCol", "CDOrigIndex", "CDNormal", "CDFlags",
/* 10-14 */ "CDMFloatProperty", "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco",
/* 15-19 */ "CDMTexPoly", "CDMLoopUV", "CDMloopCol", "CDTangent", "CDMDisps",
- /* 20-24 */"CDWeightMCol", "CDIDMCol", "CDTextureMCol", "CDClothOrco", "CDMRecast"
+ /* 20-24 */"CDPreviewMCol", "CDIDMCol", "CDTextureMCol", "CDClothOrco", "CDMRecast"
/* BMESH ONLY */
,
/* 25-29 */ "CDMPoly", "CDMLoop", "CDShapeKeyIndex", "CDShapeKey", "CDBevelWeight",
- /* 30-32 */ "CDSubSurfCrease", "CDOrigSpaceLoop", "CDWeightLoopCol"
+ /* 30-32 */ "CDSubSurfCrease", "CDOrigSpaceLoop", "CDPreviewLoopCol"
/* END BMESH ONLY */
};
@@ -1075,27 +1093,27 @@ const CustomDataMask CD_MASK_EDITMESH =
const CustomDataMask CD_MASK_DERIVEDMESH =
CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_MTFACE |
CD_MASK_MCOL | CD_MASK_PROP_FLT | CD_MASK_PROP_INT | CD_MASK_CLOTH_ORCO |
- CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL | CD_MASK_MTEXPOLY | CD_MASK_WEIGHT_MLOOPCOL |
+ CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL | CD_MASK_MTEXPOLY | CD_MASK_PREVIEW_MLOOPCOL |
CD_MASK_PROP_STR | CD_MASK_ORIGSPACE | CD_MASK_ORIGSPACE_MLOOP | CD_MASK_ORCO | CD_MASK_TANGENT |
- CD_MASK_WEIGHT_MCOL | CD_MASK_NORMAL | CD_MASK_SHAPEKEY | CD_MASK_RECAST |
+ CD_MASK_PREVIEW_MCOL | CD_MASK_NORMAL | CD_MASK_SHAPEKEY | CD_MASK_RECAST |
CD_MASK_ORIGINDEX | CD_MASK_POLYINDEX;
const CustomDataMask CD_MASK_BMESH = CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL | CD_MASK_MTEXPOLY |
CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_PROP_FLT | CD_MASK_PROP_INT |
- CD_MASK_PROP_STR | CD_MASK_SHAPEKEY | CD_MASK_SHAPE_KEYINDEX | CD_MASK_MDISPS;
+ CD_MASK_PROP_STR | CD_MASK_SHAPEKEY | CD_MASK_SHAPE_KEYINDEX | CD_MASK_MDISPS | CD_MASK_CREASE | CD_MASK_BWEIGHT;
const CustomDataMask CD_MASK_FACECORNERS =
CD_MASK_MTFACE | CD_MASK_MCOL | CD_MASK_MTEXPOLY | CD_MASK_MLOOPUV |
CD_MASK_MLOOPCOL;
static const LayerTypeInfo *layerType_getInfo(int type)
{
- if(type < 0 || type >= CD_NUMTYPES) return NULL;
+ if (type < 0 || type >= CD_NUMTYPES) return NULL;
return &LAYERTYPEINFO[type];
}
static const char *layerType_getName(int type)
{
- if(type < 0 || type >= CD_NUMTYPES) return NULL;
+ if (type < 0 || type >= CD_NUMTYPES) return NULL;
return LAYERTYPENAMES[type];
}
@@ -1133,7 +1151,7 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
void *data;
int i, type, number = 0, lasttype = -1, lastactive = 0, lastrender = 0, lastclone = 0, lastmask = 0, lastflag = 0;
- for(i = 0; i < source->totlayer; ++i) {
+ for (i = 0; i < source->totlayer; ++i) {
layer = &source->layers[i];
/*typeInfo = layerType_getInfo(layer->type);*/ /*UNUSED*/
@@ -1151,9 +1169,9 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
else
number++;
- if(lastflag & CD_FLAG_NOCOPY) continue;
- else if(!(mask & CD_TYPE_AS_MASK(type))) continue;
- else if(number < CustomData_number_of_layers(dest, type)) continue;
+ if (lastflag & CD_FLAG_NOCOPY) continue;
+ else if (!(mask & CD_TYPE_AS_MASK(type))) continue;
+ else if (number < CustomData_number_of_layers(dest, type)) continue;
switch (alloctype) {
case CD_ASSIGN:
@@ -1166,14 +1184,14 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
break;
}
- if((alloctype == CD_ASSIGN) && (lastflag & CD_FLAG_NOFREE))
+ if ((alloctype == CD_ASSIGN) && (lastflag & CD_FLAG_NOFREE))
newlayer = customData_add_layer__internal(dest, type, CD_REFERENCE,
data, totelem, layer->name);
else
newlayer = customData_add_layer__internal(dest, type, alloctype,
data, totelem, layer->name);
- if(newlayer) {
+ if (newlayer) {
newlayer->uid = layer->uid;
newlayer->active = lastactive;
@@ -1192,7 +1210,7 @@ void CustomData_copy(const struct CustomData *source, struct CustomData *dest,
{
memset(dest, 0, sizeof(*dest));
- if(source->external)
+ if (source->external)
dest->external= MEM_dupallocN(source->external);
CustomData_merge(source, dest, mask, alloctype, totelem);
@@ -1202,20 +1220,20 @@ static void customData_free_layer__internal(CustomDataLayer *layer, int totelem)
{
const LayerTypeInfo *typeInfo;
- if(!(layer->flag & CD_FLAG_NOFREE) && layer->data) {
+ if (!(layer->flag & CD_FLAG_NOFREE) && layer->data) {
typeInfo = layerType_getInfo(layer->type);
- if(typeInfo->free)
+ if (typeInfo->free)
typeInfo->free(layer->data, totelem, typeInfo->size);
- if(layer->data)
+ if (layer->data)
MEM_freeN(layer->data);
}
}
static void CustomData_external_free(CustomData *data)
{
- if(data->external) {
+ if (data->external) {
MEM_freeN(data->external);
data->external= NULL;
}
@@ -1225,10 +1243,10 @@ void CustomData_free(CustomData *data, int totelem)
{
int i;
- for(i = 0; i < data->totlayer; ++i)
+ for (i = 0; i < data->totlayer; ++i)
customData_free_layer__internal(&data->layers[i], totelem);
- if(data->layers)
+ if (data->layers)
MEM_freeN(data->layers);
CustomData_external_free(data);
@@ -1241,7 +1259,7 @@ static void customData_update_offsets(CustomData *data)
const LayerTypeInfo *typeInfo;
int i, offset = 0;
- for(i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; ++i) {
typeInfo = layerType_getInfo(data->layers[i].type);
data->layers[i].offset = offset;
@@ -1256,8 +1274,8 @@ int CustomData_get_layer_index(const CustomData *data, int type)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
return i;
return -1;
@@ -1278,8 +1296,8 @@ int CustomData_get_named_layer_index(const CustomData *data, int type, const cha
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type && strcmp(data->layers[i].name, name)==0)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type && strcmp(data->layers[i].name, name)==0)
return i;
return -1;
@@ -1301,8 +1319,8 @@ int CustomData_get_render_layer_index(const CustomData *data, int type)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
return i + data->layers[i].active_rnd;
return -1;
@@ -1312,8 +1330,8 @@ int CustomData_get_clone_layer_index(const CustomData *data, int type)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
return i + data->layers[i].active_clone;
return -1;
@@ -1323,8 +1341,8 @@ int CustomData_get_stencil_layer_index(const CustomData *data, int type)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
return i + data->layers[i].active_mask;
return -1;
@@ -1334,8 +1352,8 @@ int CustomData_get_active_layer(const CustomData *data, int type)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
return data->layers[i].active;
return -1;
@@ -1345,8 +1363,8 @@ int CustomData_get_render_layer(const CustomData *data, int type)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
return data->layers[i].active_rnd;
return -1;
@@ -1356,8 +1374,8 @@ int CustomData_get_clone_layer(const CustomData *data, int type)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
return data->layers[i].active_clone;
return -1;
@@ -1367,8 +1385,8 @@ int CustomData_get_stencil_layer(const CustomData *data, int type)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
return data->layers[i].active_mask;
return -1;
@@ -1378,8 +1396,8 @@ void CustomData_set_layer_active(CustomData *data, int type, int n)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
data->layers[i].active = n;
}
@@ -1387,8 +1405,8 @@ void CustomData_set_layer_render(CustomData *data, int type, int n)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
data->layers[i].active_rnd = n;
}
@@ -1396,8 +1414,8 @@ void CustomData_set_layer_clone(CustomData *data, int type, int n)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
data->layers[i].active_clone = n;
}
@@ -1405,8 +1423,8 @@ void CustomData_set_layer_stencil(CustomData *data, int type, int n)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
data->layers[i].active_mask = n;
}
@@ -1415,8 +1433,8 @@ void CustomData_set_layer_active_index(CustomData *data, int type, int n)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
data->layers[i].active = n-i;
}
@@ -1424,8 +1442,8 @@ void CustomData_set_layer_render_index(CustomData *data, int type, int n)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
data->layers[i].active_rnd = n-i;
}
@@ -1433,8 +1451,8 @@ void CustomData_set_layer_clone_index(CustomData *data, int type, int n)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
data->layers[i].active_clone = n-i;
}
@@ -1442,8 +1460,8 @@ void CustomData_set_layer_stencil_index(CustomData *data, int type, int n)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
data->layers[i].active_mask = n-i;
}
@@ -1451,8 +1469,8 @@ void CustomData_set_layer_flag(struct CustomData *data, int type, int flag)
{
int i;
- for(i=0; i < data->totlayer; ++i)
- if(data->layers[i].type == type)
+ for (i=0; i < data->totlayer; ++i)
+ if (data->layers[i].type == type)
data->layers[i].flag |= flag;
}
@@ -1460,7 +1478,7 @@ static int customData_resize(CustomData *data, int amount)
{
CustomDataLayer *tmp = MEM_callocN(sizeof(*tmp)*(data->maxlayer + amount),
"CustomData->layers");
- if(!tmp) return 0;
+ if (!tmp) return 0;
data->maxlayer += amount;
if (data->layers) {
@@ -1480,7 +1498,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) ||
@@ -1489,31 +1507,31 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data,
if (!typeInfo->defaultname && CustomData_has_layer(data, type))
return &data->layers[CustomData_get_layer_index(data, type)];
- if((alloctype == CD_ASSIGN) || (alloctype == CD_REFERENCE)) {
+ if ((alloctype == CD_ASSIGN) || (alloctype == CD_REFERENCE)) {
newlayerdata = layerdata;
}
else if (size > 0) {
newlayerdata = MEM_callocN(size, layerType_getName(type));
- if(!newlayerdata)
+ if (!newlayerdata)
return NULL;
}
if (alloctype == CD_DUPLICATE && layerdata) {
- if(typeInfo->copy)
+ if (typeInfo->copy)
typeInfo->copy(layerdata, newlayerdata, totelem);
else
memcpy(newlayerdata, layerdata, size);
}
else if (alloctype == CD_DEFAULT) {
- if(typeInfo->set_default)
+ if (typeInfo->set_default)
typeInfo->set_default((char*)newlayerdata, totelem);
}
else if (alloctype == CD_REFERENCE)
flag |= CD_FLAG_NOFREE;
- if(index >= data->maxlayer) {
- if(!customData_resize(data, CUSTOMDATA_GROW)) {
- if(newlayerdata != layerdata)
+ if (index >= data->maxlayer) {
+ if (!customData_resize(data, CUSTOMDATA_GROW)) {
+ if (newlayerdata != layerdata)
MEM_freeN(newlayerdata);
return NULL;
}
@@ -1522,26 +1540,27 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data,
data->totlayer++;
/* keep layers ordered by type */
- for( ; index > 0 && data->layers[index - 1].type > type; --index)
+ for ( ; index > 0 && data->layers[index - 1].type > type; --index)
data->layers[index] = data->layers[index - 1];
data->layers[index].type = type;
data->layers[index].flag = flag;
data->layers[index].data = newlayerdata;
- if(name || (name=typeInfo->defaultname)) {
+ if (name || (name=typeInfo->defaultname)) {
BLI_strncpy(data->layers[index].name, name, sizeof(data->layers[index].name));
CustomData_set_layer_unique_name(data, index);
}
else
data->layers[index].name[0] = '\0';
- if(index > 0 && data->layers[index-1].type == type) {
+ if (index > 0 && data->layers[index-1].type == type) {
data->layers[index].active = data->layers[index-1].active;
data->layers[index].active_rnd = data->layers[index-1].active_rnd;
data->layers[index].active_clone = data->layers[index-1].active_clone;
data->layers[index].active_mask = data->layers[index-1].active_mask;
- } else {
+ }
+ else {
data->layers[index].active = 0;
data->layers[index].active_rnd = 0;
data->layers[index].active_clone = 0;
@@ -1563,7 +1582,7 @@ void *CustomData_add_layer(CustomData *data, int type, int alloctype,
totelem, typeInfo->defaultname);
CustomData_update_typemap(data);
- if(layer)
+ if (layer)
return layer->data;
return NULL;
@@ -1579,7 +1598,7 @@ void *CustomData_add_layer_named(CustomData *data, int type, int alloctype,
totelem, name);
CustomData_update_typemap(data);
- if(layer)
+ if (layer)
return layer->data;
return NULL;
@@ -1645,8 +1664,8 @@ int CustomData_number_of_layers(const CustomData *data, int type)
{
int i, number = 0;
- for(i = 0; i < data->totlayer; i++)
- if(data->layers[i].type == type)
+ for (i = 0; i < data->totlayer; i++)
+ if (data->layers[i].type == type)
number++;
return number;
@@ -1659,18 +1678,18 @@ void *CustomData_duplicate_referenced_layer(struct CustomData *data, const int t
/* get the layer index of the first layer of type */
layer_index = CustomData_get_active_layer_index(data, type);
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
layer = &data->layers[layer_index];
if (layer->flag & CD_FLAG_NOFREE) {
- /* MEM_dupallocN won’t work in case of complex layers, like e.g.
+ /* MEM_dupallocN won't work in case of complex layers, like e.g.
* CD_MDEFORMVERT, which has pointers to allocated data...
* So in case a custom copy function is defined, use it!
*/
const LayerTypeInfo *typeInfo = layerType_getInfo(layer->type);
- if(typeInfo->copy) {
+ if (typeInfo->copy) {
char *dest_data = MEM_mallocN(typeInfo->size * totelem, "CD duplicate ref layer");
typeInfo->copy(layer->data, dest_data, totelem);
layer->data = dest_data;
@@ -1692,18 +1711,18 @@ void *CustomData_duplicate_referenced_layer_named(struct CustomData *data,
/* get the layer index of the desired layer */
layer_index = CustomData_get_named_layer_index(data, type, name);
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
layer = &data->layers[layer_index];
if (layer->flag & CD_FLAG_NOFREE) {
- /* MEM_dupallocN won’t work in case of complex layers, like e.g.
+ /* MEM_dupallocN won't work in case of complex layers, like e.g.
* CD_MDEFORMVERT, which has pointers to allocated data...
* So in case a custom copy function is defined, use it!
*/
const LayerTypeInfo *typeInfo = layerType_getInfo(layer->type);
- if(typeInfo->copy) {
+ if (typeInfo->copy) {
char *dest_data = MEM_mallocN(typeInfo->size * totelem, "CD duplicate ref layer");
typeInfo->copy(layer->data, dest_data, totelem);
layer->data = dest_data;
@@ -1724,7 +1743,7 @@ int CustomData_is_referenced_layer(struct CustomData *data, int type)
/* get the layer index of the first layer of type */
layer_index = CustomData_get_active_layer_index(data, type);
- if(layer_index < 0) return 0;
+ if (layer_index < 0) return 0;
layer = &data->layers[layer_index];
@@ -1736,7 +1755,7 @@ void CustomData_free_temporary(CustomData *data, int totelem)
CustomDataLayer *layer;
int i, j;
- for(i = 0, j = 0; i < data->totlayer; ++i) {
+ for (i = 0, j = 0; i < data->totlayer; ++i) {
layer = &data->layers[i];
if (i != j)
@@ -1750,7 +1769,7 @@ void CustomData_free_temporary(CustomData *data, int totelem)
data->totlayer = j;
- if(data->totlayer <= data->maxlayer-CUSTOMDATA_GROW)
+ if (data->totlayer <= data->maxlayer-CUSTOMDATA_GROW)
customData_resize(data, -CUSTOMDATA_GROW);
customData_update_offsets(data);
@@ -1761,8 +1780,8 @@ void CustomData_set_only_copy(const struct CustomData *data,
{
int i;
- for(i = 0; i < data->totlayer; ++i)
- if(!(mask & CD_TYPE_AS_MASK(data->layers[i].type)))
+ for (i = 0; i < data->totlayer; ++i)
+ if (!(mask & CD_TYPE_AS_MASK(data->layers[i].type)))
data->layers[i].flag |= CD_FLAG_NOCOPY;
}
@@ -1786,20 +1805,20 @@ void CustomData_copy_data(const CustomData *source, CustomData *dest,
/* copies a layer at a time */
dest_i = 0;
- for(src_i = 0; src_i < source->totlayer; ++src_i) {
+ for (src_i = 0; src_i < source->totlayer; ++src_i) {
/* find the first dest layer with type >= the source type
* (this should work because layers are ordered by type)
*/
- while(dest_i < dest->totlayer
+ while (dest_i < dest->totlayer
&& dest->layers[dest_i].type < source->layers[src_i].type)
++dest_i;
/* if there are no more dest layers, we're done */
- if(dest_i >= dest->totlayer) return;
+ if (dest_i >= dest->totlayer) return;
/* if we found a matching layer, copy the data */
- if(dest->layers[dest_i].type == source->layers[src_i].type) {
+ if (dest->layers[dest_i].type == source->layers[src_i].type) {
char *src_data = source->layers[src_i].data;
char *dest_data = dest->layers[dest_i].data;
@@ -1809,13 +1828,15 @@ 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;
}
- if(typeInfo->copy)
+ if (typeInfo->copy)
typeInfo->copy(src_data + src_offset,
dest_data + dest_offset,
count);
@@ -1838,11 +1859,11 @@ void CustomData_free_elem(CustomData *data, int index, int count)
int i;
const LayerTypeInfo *typeInfo;
- for(i = 0; i < data->totlayer; ++i) {
- if(!(data->layers[i].flag & CD_FLAG_NOFREE)) {
+ for (i = 0; i < data->totlayer; ++i) {
+ if (!(data->layers[i].flag & CD_FLAG_NOFREE)) {
typeInfo = layerType_getInfo(data->layers[i].type);
- if(typeInfo->free) {
+ if (typeInfo->free) {
int offset = typeInfo->size * index;
typeInfo->free((char *)data->layers[i].data + offset,
@@ -1867,31 +1888,31 @@ void CustomData_interp(const CustomData *source, CustomData *dest,
/* slow fallback in case we're interpolating a ridiculous number of
* elements
*/
- if(count > SOURCE_BUF_SIZE)
+ if (count > SOURCE_BUF_SIZE)
sources = MEM_callocN(sizeof(*sources) * count,
"CustomData_interp sources");
/* interpolates a layer at a time */
dest_i = 0;
- for(src_i = 0; src_i < source->totlayer; ++src_i) {
+ for (src_i = 0; src_i < source->totlayer; ++src_i) {
const LayerTypeInfo *typeInfo= layerType_getInfo(source->layers[src_i].type);
- if(!typeInfo->interp) continue;
+ if (!typeInfo->interp) continue;
/* find the first dest layer with type >= the source type
* (this should work because layers are ordered by type)
*/
- while(dest_i < dest->totlayer
+ while (dest_i < dest->totlayer
&& dest->layers[dest_i].type < source->layers[src_i].type)
++dest_i;
/* if there are no more dest layers, we're done */
- if(dest_i >= dest->totlayer) return;
+ if (dest_i >= dest->totlayer) return;
/* if we found a matching layer, copy the data */
- if(dest->layers[dest_i].type == source->layers[src_i].type) {
+ if (dest->layers[dest_i].type == source->layers[src_i].type) {
void *src_data = source->layers[src_i].data;
- for(j = 0; j < count; ++j)
+ for (j = 0; j < count; ++j)
sources[j] = (char *)src_data
+ typeInfo->size * src_indices[j];
@@ -1908,7 +1929,7 @@ void CustomData_interp(const CustomData *source, CustomData *dest,
}
}
- if(count > SOURCE_BUF_SIZE) MEM_freeN(sources);
+ if (count > SOURCE_BUF_SIZE) MEM_freeN(sources);
}
void CustomData_swap(struct CustomData *data, int index, const int *corner_indices)
@@ -1916,10 +1937,10 @@ void CustomData_swap(struct CustomData *data, int index, const int *corner_indic
const LayerTypeInfo *typeInfo;
int i;
- for(i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; ++i) {
typeInfo = layerType_getInfo(data->layers[i].type);
- if(typeInfo->swap) {
+ if (typeInfo->swap) {
int offset = typeInfo->size * index;
typeInfo->swap((char *)data->layers[i].data + offset, corner_indices);
@@ -1934,7 +1955,7 @@ void *CustomData_get(const CustomData *data, int index, int type)
/* get the layer index of the active layer of type */
layer_index = CustomData_get_active_layer_index(data, type);
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
/* get the offset of the desired element */
offset = layerType_getInfo(type)->size * index;
@@ -1949,7 +1970,7 @@ void *CustomData_get_n(const CustomData *data, int type, int index, int n)
/* get the layer index of the first layer of type */
layer_index = data->typemap[type];
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
offset = layerType_getInfo(type)->size * index;
return (char *)data->layers[layer_index+n].data + offset;
@@ -1959,7 +1980,7 @@ void *CustomData_get_layer(const CustomData *data, int type)
{
/* get the layer index of the active layer of type */
int layer_index = CustomData_get_active_layer_index(data, type);
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
return data->layers[layer_index].data;
}
@@ -1968,7 +1989,7 @@ void *CustomData_get_layer_n(const CustomData *data, int type, int n)
{
/* get the layer index of the active layer of type */
int layer_index = CustomData_get_layer_index_n(data, type, n);
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
return data->layers[layer_index].data;
}
@@ -1977,7 +1998,7 @@ void *CustomData_get_layer_named(const struct CustomData *data, int type,
const char *name)
{
int layer_index = CustomData_get_named_layer_index(data, type, name);
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
return data->layers[layer_index].data;
}
@@ -1988,7 +2009,7 @@ int CustomData_set_layer_name(const CustomData *data, int type, int n, const cha
/* get the layer index of the first layer of type */
int layer_index = CustomData_get_layer_index_n(data, type, n);
- if(layer_index < 0) return 0;
+ if (layer_index < 0) return 0;
if (!name) return 0;
strcpy(data->layers[layer_index].name, name);
@@ -2001,7 +2022,7 @@ void *CustomData_set_layer(const CustomData *data, int type, void *ptr)
/* get the layer index of the first layer of type */
int layer_index = CustomData_get_active_layer_index(data, type);
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
data->layers[layer_index].data = ptr;
@@ -2012,7 +2033,7 @@ void *CustomData_set_layer_n(const struct CustomData *data, int type, int n, voi
{
/* get the layer index of the first layer of type */
int layer_index = CustomData_get_layer_index_n(data, type, n);
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
data->layers[layer_index].data = ptr;
@@ -2024,9 +2045,9 @@ void CustomData_set(const CustomData *data, int index, int type, void *source)
void *dest = CustomData_get(data, index, type);
const LayerTypeInfo *typeInfo = layerType_getInfo(type);
- if(!dest) return;
+ if (!dest) return;
- if(typeInfo->copy)
+ if (typeInfo->copy)
typeInfo->copy(source, dest, 1);
else
memcpy(dest, source, typeInfo->size);
@@ -2038,8 +2059,8 @@ void CustomData_to_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData *l
int totloop, int totpoly)
{
int i;
- for(i=0; i < fdata->totlayer; i++) {
- if(fdata->layers[i].type == CD_MTFACE) {
+ for (i=0; i < fdata->totlayer; i++) {
+ if (fdata->layers[i].type == CD_MTFACE) {
CustomData_add_layer_named(pdata, CD_MTEXPOLY, CD_CALLOC, NULL, totpoly, fdata->layers[i].name);
CustomData_add_layer_named(ldata, CD_MLOOPUV, CD_CALLOC, NULL, totloop, fdata->layers[i].name);
}
@@ -2055,17 +2076,17 @@ void CustomData_to_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData *l
void CustomData_from_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData *ldata, int total)
{
int i;
- for(i=0; i < pdata->totlayer; i++) {
+ for (i=0; i < pdata->totlayer; i++) {
if (pdata->layers[i].type == CD_MTEXPOLY) {
CustomData_add_layer_named(fdata, CD_MTFACE, CD_CALLOC, NULL, total, pdata->layers[i].name);
}
}
- for(i=0; i < ldata->totlayer; i++) {
+ for (i=0; i < ldata->totlayer; i++) {
if (ldata->layers[i].type == CD_MLOOPCOL) {
CustomData_add_layer_named(fdata, CD_MCOL, CD_CALLOC, NULL, total, ldata->layers[i].name);
}
- else if (ldata->layers[i].type == CD_WEIGHT_MLOOPCOL) {
- CustomData_add_layer_named(fdata, CD_WEIGHT_MCOL, CD_CALLOC, NULL, total, ldata->layers[i].name);
+ else if (ldata->layers[i].type == CD_PREVIEW_MLOOPCOL) {
+ CustomData_add_layer_named(fdata, CD_PREVIEW_MCOL, CD_CALLOC, NULL, total, ldata->layers[i].name);
}
else if (ldata->layers[i].type == CD_ORIGSPACE_MLOOP) {
CustomData_add_layer_named(fdata, CD_ORIGSPACE, CD_CALLOC, NULL, total, ldata->layers[i].name);
@@ -2110,19 +2131,32 @@ void CustomData_bmesh_update_active_layers(CustomData *fdata, CustomData *pdata,
}
}
-void CustomData_bmesh_init_pool(CustomData *data, int allocsize)
+void CustomData_bmesh_init_pool(CustomData *data, int totelem, const char htype)
{
+ int chunksize;
+
/* Dispose old pools before calling here to avoid leaks */
BLI_assert(data->pool == NULL);
+ switch (htype) {
+ case BM_VERT: chunksize = bm_mesh_chunksize_default.totvert; break;
+ case BM_EDGE: chunksize = bm_mesh_chunksize_default.totedge; break;
+ case BM_LOOP: chunksize = bm_mesh_chunksize_default.totloop; break;
+ case BM_FACE: chunksize = bm_mesh_chunksize_default.totface; break;
+ default:
+ BLI_assert(0);
+ chunksize = 512;
+ break;
+ }
+
/* If there are no layers, no pool is needed just yet */
if (data->totlayer) {
- data->pool = BLI_mempool_create(data->totsize, allocsize, allocsize, TRUE, FALSE);
+ data->pool = BLI_mempool_create(data->totsize, totelem, chunksize, BLI_MEMPOOL_SYSMALLOC);
}
}
void CustomData_bmesh_merge(CustomData *source, CustomData *dest,
- int mask, int alloctype, BMesh *bm, int type)
+ int mask, int alloctype, BMesh *bm, const char htype)
{
BMHeader *h;
BMIter iter;
@@ -2131,9 +2165,10 @@ void CustomData_bmesh_merge(CustomData *source, CustomData *dest,
int t;
CustomData_merge(source, dest, mask, alloctype, 0);
- CustomData_bmesh_init_pool(dest, 512);
+ dest->pool = NULL;
+ CustomData_bmesh_init_pool(dest, 512, htype);
- switch (type) {
+ switch (htype) {
case BM_VERT:
t = BM_VERTS_OF_MESH; break;
case BM_EDGE:
@@ -2150,11 +2185,13 @@ void CustomData_bmesh_merge(CustomData *source, CustomData *dest,
if (t != BM_LOOPS_OF_FACE) {
/*ensure all current elements follow new customdata layout*/
BM_ITER(h, &iter, bm, t, NULL) {
+ tmp = NULL;
CustomData_bmesh_copy_data(&destold, dest, h->data, &tmp);
CustomData_bmesh_free_block(&destold, &h->data);
h->data = tmp;
}
- } else {
+ }
+ else {
BMFace *f;
BMLoop *l;
BMIter liter;
@@ -2162,6 +2199,7 @@ void CustomData_bmesh_merge(CustomData *source, CustomData *dest,
/*ensure all current elements follow new customdata layout*/
BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
+ tmp = NULL;
CustomData_bmesh_copy_data(&destold, dest, l->head.data, &tmp);
CustomData_bmesh_free_block(&destold, &l->head.data);
l->head.data = tmp;
@@ -2177,12 +2215,12 @@ void CustomData_bmesh_free_block(CustomData *data, void **block)
const LayerTypeInfo *typeInfo;
int i;
- if(!*block) return;
- for(i = 0; i < data->totlayer; ++i) {
- if(!(data->layers[i].flag & CD_FLAG_NOFREE)) {
+ if (!*block) return;
+ for (i = 0; i < data->totlayer; ++i) {
+ if (!(data->layers[i].flag & CD_FLAG_NOFREE)) {
typeInfo = layerType_getInfo(data->layers[i].type);
- if(typeInfo->free) {
+ if (typeInfo->free) {
int offset = data->layers[i].offset;
typeInfo->free((char*)*block + offset, 1, typeInfo->size);
}
@@ -2218,27 +2256,27 @@ void CustomData_bmesh_copy_data(const CustomData *source, CustomData *dest,
/* copies a layer at a time */
dest_i = 0;
- for(src_i = 0; src_i < source->totlayer; ++src_i) {
+ for (src_i = 0; src_i < source->totlayer; ++src_i) {
/* find the first dest layer with type >= the source type
* (this should work because layers are ordered by type)
*/
- while(dest_i < dest->totlayer
+ while (dest_i < dest->totlayer
&& dest->layers[dest_i].type < source->layers[src_i].type)
++dest_i;
/* if there are no more dest layers, we're done */
- if(dest_i >= dest->totlayer) return;
+ if (dest_i >= dest->totlayer) return;
/* if we found a matching layer, copy the data */
- if(dest->layers[dest_i].type == source->layers[src_i].type &&
+ if (dest->layers[dest_i].type == source->layers[src_i].type &&
strcmp(dest->layers[dest_i].name, source->layers[src_i].name) == 0) {
char *src_data = (char*)src_block + source->layers[src_i].offset;
char *dest_data = (char*)*dest_block + dest->layers[dest_i].offset;
typeInfo = layerType_getInfo(source->layers[src_i].type);
- if(typeInfo->copy)
+ if (typeInfo->copy)
typeInfo->copy(src_data, dest_data, 1);
else
memcpy(dest_data, src_data, typeInfo->size);
@@ -2259,7 +2297,7 @@ void *CustomData_bmesh_get(const CustomData *data, void *block, int type)
/* get the layer index of the first layer of type */
layer_index = CustomData_get_active_layer_index(data, type);
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
return (char *)block + data->layers[layer_index].offset;
}
@@ -2270,7 +2308,7 @@ void *CustomData_bmesh_get_n(const CustomData *data, void *block, int type, int
/* get the layer index of the first layer of type */
layer_index = CustomData_get_layer_index(data, type);
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
return (char *)block + data->layers[layer_index+n].offset;
}
@@ -2278,14 +2316,14 @@ void *CustomData_bmesh_get_n(const CustomData *data, void *block, int type, int
/*gets from the layer at physical index n, note: doesn't check type.*/
void *CustomData_bmesh_get_layer_n(const CustomData *data, void *block, int n)
{
- if(n < 0 || n >= data->totlayer) return NULL;
+ if (n < 0 || n >= data->totlayer) return NULL;
return (char *)block + data->layers[n].offset;
}
-int CustomData_layer_has_math(struct CustomData *data, int layern)
+int CustomData_layer_has_math(struct CustomData *data, int layer_n)
{
- const LayerTypeInfo *typeInfo = layerType_getInfo(data->layers[layern].type);
+ const LayerTypeInfo *typeInfo = layerType_getInfo(data->layers[layer_n].type);
if (typeInfo->equal && typeInfo->add && typeInfo->multiply &&
typeInfo->initminmax && typeInfo->dominmax) return 1;
@@ -2293,15 +2331,15 @@ 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);
- if(!dest) return;
+ if (!dest) return;
- if(typeInfo->copyvalue)
+ if (typeInfo->copyvalue)
typeInfo->copyvalue(source, dest);
else
memcpy(dest, source, typeInfo->size);
@@ -2356,9 +2394,9 @@ void CustomData_bmesh_set(const CustomData *data, void *block, int type, void *s
void *dest = CustomData_bmesh_get(data, block, type);
const LayerTypeInfo *typeInfo = layerType_getInfo(type);
- if(!dest) return;
+ if (!dest) return;
- if(typeInfo->copy)
+ if (typeInfo->copy)
typeInfo->copy(source, dest, 1);
else
memcpy(dest, source, typeInfo->size);
@@ -2369,9 +2407,9 @@ void CustomData_bmesh_set_n(CustomData *data, void *block, int type, int n, void
void *dest = CustomData_bmesh_get_n(data, block, type, n);
const LayerTypeInfo *typeInfo = layerType_getInfo(type);
- if(!dest) return;
+ if (!dest) return;
- if(typeInfo->copy)
+ if (typeInfo->copy)
typeInfo->copy(source, dest, 1);
else
memcpy(dest, source, typeInfo->size);
@@ -2382,9 +2420,9 @@ void CustomData_bmesh_set_layer_n(CustomData *data, void *block, int n, void *so
void *dest = CustomData_bmesh_get_layer_n(data, block, n);
const LayerTypeInfo *typeInfo = layerType_getInfo(data->layers[n].type);
- if(!dest) return;
+ if (!dest) return;
- if(typeInfo->copy)
+ if (typeInfo->copy)
typeInfo->copy(source, dest, 1);
else
memcpy(dest, source, typeInfo->size);
@@ -2400,16 +2438,16 @@ void CustomData_bmesh_interp(CustomData *data, void **src_blocks, float *weights
/* slow fallback in case we're interpolating a ridiculous number of
* elements
*/
- if(count > SOURCE_BUF_SIZE)
+ if (count > SOURCE_BUF_SIZE)
sources = MEM_callocN(sizeof(*sources) * count,
"CustomData_interp sources");
/* interpolates a layer at a time */
- for(i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; ++i) {
CustomDataLayer *layer = &data->layers[i];
const LayerTypeInfo *typeInfo = layerType_getInfo(layer->type);
- if(typeInfo->interp) {
- for(j = 0; j < count; ++j)
+ if (typeInfo->interp) {
+ for (j = 0; j < count; ++j)
sources[j] = (char *)src_blocks[j] + layer->offset;
typeInfo->interp(sources, weights, sub_weights, count,
@@ -2417,7 +2455,7 @@ void CustomData_bmesh_interp(CustomData *data, void **src_blocks, float *weights
}
}
- if(count > SOURCE_BUF_SIZE) MEM_freeN(sources);
+ if (count > SOURCE_BUF_SIZE) MEM_freeN(sources);
}
void CustomData_bmesh_set_default(CustomData *data, void **block)
@@ -2428,12 +2466,12 @@ void CustomData_bmesh_set_default(CustomData *data, void **block)
if (!*block)
CustomData_bmesh_alloc_block(data, block);
- for(i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; ++i) {
int offset = data->layers[i].offset;
typeInfo = layerType_getInfo(data->layers[i].type);
- if(typeInfo->set_default)
+ if (typeInfo->set_default)
typeInfo->set_default((char*)*block + offset, 1);
else memset((char*)*block + offset, 0, typeInfo->size);
}
@@ -2450,20 +2488,20 @@ void CustomData_to_bmesh_block(const CustomData *source, CustomData *dest,
/* copies a layer at a time */
dest_i = 0;
- for(src_i = 0; src_i < source->totlayer; ++src_i) {
+ for (src_i = 0; src_i < source->totlayer; ++src_i) {
/* find the first dest layer with type >= the source type
* (this should work because layers are ordered by type)
*/
- while(dest_i < dest->totlayer
+ while (dest_i < dest->totlayer
&& dest->layers[dest_i].type < source->layers[src_i].type)
++dest_i;
/* if there are no more dest layers, we're done */
- if(dest_i >= dest->totlayer) return;
+ if (dest_i >= dest->totlayer) return;
/* if we found a matching layer, copy the data */
- if(dest->layers[dest_i].type == source->layers[src_i].type) {
+ if (dest->layers[dest_i].type == source->layers[src_i].type) {
int offset = dest->layers[dest_i].offset;
char *src_data = source->layers[src_i].data;
char *dest_data = (char*)*dest_block + offset;
@@ -2471,7 +2509,7 @@ void CustomData_to_bmesh_block(const CustomData *source, CustomData *dest,
typeInfo = layerType_getInfo(dest->layers[dest_i].type);
src_offset = src_index * typeInfo->size;
- if(typeInfo->copy)
+ if (typeInfo->copy)
typeInfo->copy(src_data + src_offset, dest_data, 1);
else
memcpy(dest_data, src_data + src_offset, typeInfo->size);
@@ -2493,20 +2531,20 @@ void CustomData_from_bmesh_block(const CustomData *source, CustomData *dest,
/* copies a layer at a time */
dest_i = 0;
- for(src_i = 0; src_i < source->totlayer; ++src_i) {
+ for (src_i = 0; src_i < source->totlayer; ++src_i) {
/* find the first dest layer with type >= the source type
* (this should work because layers are ordered by type)
*/
- while(dest_i < dest->totlayer
+ while (dest_i < dest->totlayer
&& dest->layers[dest_i].type < source->layers[src_i].type)
++dest_i;
/* if there are no more dest layers, we're done */
- if(dest_i >= dest->totlayer) return;
+ if (dest_i >= dest->totlayer) return;
/* if we found a matching layer, copy the data */
- if(dest->layers[dest_i].type == source->layers[src_i].type) {
+ if (dest->layers[dest_i].type == source->layers[src_i].type) {
int offset = source->layers[src_i].offset;
char *src_data = (char*)src_block + offset;
char *dest_data = dest->layers[dest_i].data;
@@ -2514,7 +2552,7 @@ void CustomData_from_bmesh_block(const CustomData *source, CustomData *dest,
typeInfo = layerType_getInfo(dest->layers[dest_i].type);
dest_offset = dest_index * typeInfo->size;
- if(typeInfo->copy)
+ if (typeInfo->copy)
typeInfo->copy(src_data, dest_data + dest_offset, 1);
else
memcpy(dest_data + dest_offset, src_data, typeInfo->size);
@@ -2551,7 +2589,7 @@ const char *CustomData_layertype_name(int type)
static int CustomData_is_property_layer(int type)
{
- if((type == CD_PROP_FLT) || (type == CD_PROP_INT) || (type == CD_PROP_STR))
+ if ((type == CD_PROP_FLT) || (type == CD_PROP_INT) || (type == CD_PROP_STR))
return 1;
return 0;
}
@@ -2560,17 +2598,17 @@ static int cd_layer_find_dupe(CustomData *data, const char *name, int type, int
{
int i;
/* see if there is a duplicate */
- for(i=0; i<data->totlayer; i++) {
- if(i != index) {
+ for (i=0; i<data->totlayer; i++) {
+ if (i != index) {
CustomDataLayer *layer= &data->layers[i];
- if(CustomData_is_property_layer(type)) {
- if(CustomData_is_property_layer(layer->type) && strcmp(layer->name, name)==0) {
+ if (CustomData_is_property_layer(type)) {
+ if (CustomData_is_property_layer(layer->type) && strcmp(layer->name, name)==0) {
return 1;
}
}
- else{
- if(i!=index && layer->type==type && strcmp(layer->name, name)==0) {
+ else {
+ if (i!=index && layer->type==type && strcmp(layer->name, name)==0) {
return 1;
}
}
@@ -2607,13 +2645,13 @@ void CustomData_validate_layer_name(const CustomData *data, int type, char *name
int index = -1;
/* if a layer name was given, try to find that layer */
- if(name[0])
+ if (name[0])
index = CustomData_get_named_layer_index(data, type, name);
- if(index < 0) {
+ 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);
}
@@ -2661,13 +2699,13 @@ void CustomData_external_reload(CustomData *data, ID *UNUSED(id), CustomDataMask
const LayerTypeInfo *typeInfo;
int i;
- for(i=0; i<data->totlayer; i++) {
+ for (i=0; i<data->totlayer; i++) {
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
- if(!(mask & CD_TYPE_AS_MASK(layer->type)));
- else if((layer->flag & CD_FLAG_EXTERNAL) && (layer->flag & CD_FLAG_IN_MEMORY)) {
- if(typeInfo->free)
+ if (!(mask & CD_TYPE_AS_MASK(layer->type)));
+ else if ((layer->flag & CD_FLAG_EXTERNAL) && (layer->flag & CD_FLAG_IN_MEMORY)) {
+ if (typeInfo->free)
typeInfo->free(layer->data, totelem, typeInfo->size);
layer->flag &= ~CD_FLAG_IN_MEMORY;
}
@@ -2684,42 +2722,42 @@ void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int
const LayerTypeInfo *typeInfo;
int i, update = 0;
- if(!external)
+ if (!external)
return;
- for(i=0; i<data->totlayer; i++) {
+ for (i=0; i<data->totlayer; i++) {
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
- if(!(mask & CD_TYPE_AS_MASK(layer->type)));
- else if(layer->flag & CD_FLAG_IN_MEMORY);
- else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read)
+ if (!(mask & CD_TYPE_AS_MASK(layer->type)));
+ else if (layer->flag & CD_FLAG_IN_MEMORY);
+ else if ((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read)
update= 1;
}
- if(!update)
+ if (!update)
return;
customdata_external_filename(filename, id, external);
cdf= cdf_create(CDF_TYPE_MESH);
- if(!cdf_read_open(cdf, filename)) {
+ if (!cdf_read_open(cdf, filename)) {
fprintf(stderr, "Failed to read %s layer from %s.\n", layerType_getName(layer->type), filename);
return;
}
- for(i=0; i<data->totlayer; i++) {
+ for (i=0; i<data->totlayer; i++) {
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
- if(!(mask & CD_TYPE_AS_MASK(layer->type)));
- else if(layer->flag & CD_FLAG_IN_MEMORY);
- else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read) {
+ if (!(mask & CD_TYPE_AS_MASK(layer->type)));
+ else if (layer->flag & CD_FLAG_IN_MEMORY);
+ else if ((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read) {
blay= cdf_layer_find(cdf, layer->type, layer->name);
- if(blay) {
- if(cdf_read_layer(cdf, blay)) {
- if(typeInfo->read(cdf, layer->data, totelem));
+ if (blay) {
+ if (cdf_read_layer(cdf, blay)) {
+ if (typeInfo->read(cdf, layer->data, totelem));
else break;
layer->flag |= CD_FLAG_IN_MEMORY;
}
@@ -2743,20 +2781,20 @@ void CustomData_external_write(CustomData *data, ID *id, CustomDataMask mask, in
int i, update = 0;
char filename[FILE_MAX];
- if(!external)
+ if (!external)
return;
/* test if there is anything to write */
- for(i=0; i<data->totlayer; i++) {
+ for (i=0; i<data->totlayer; i++) {
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
- if(!(mask & CD_TYPE_AS_MASK(layer->type)));
- else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->write)
+ if (!(mask & CD_TYPE_AS_MASK(layer->type)));
+ else if ((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->write)
update= 1;
}
- if(!update)
+ if (!update)
return;
/* make sure data is read before we try to write */
@@ -2765,12 +2803,12 @@ void CustomData_external_write(CustomData *data, ID *id, CustomDataMask mask, in
cdf= cdf_create(CDF_TYPE_MESH);
- for(i=0; i<data->totlayer; i++) {
+ for (i=0; i<data->totlayer; i++) {
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
- if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->filesize) {
- if(layer->flag & CD_FLAG_IN_MEMORY) {
+ if ((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->filesize) {
+ if (layer->flag & CD_FLAG_IN_MEMORY) {
cdf_layer_add(cdf, layer->type, layer->name,
typeInfo->filesize(cdf, layer->data, totelem));
}
@@ -2781,20 +2819,20 @@ void CustomData_external_write(CustomData *data, ID *id, CustomDataMask mask, in
}
}
- if(!cdf_write_open(cdf, filename)) {
+ if (!cdf_write_open(cdf, filename)) {
fprintf(stderr, "Failed to open %s for writing.\n", filename);
return;
}
- for(i=0; i<data->totlayer; i++) {
+ for (i=0; i<data->totlayer; i++) {
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
- if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->write) {
+ if ((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->write) {
blay= cdf_layer_find(cdf, layer->type, layer->name);
- if(cdf_write_layer(cdf, blay)) {
- if(typeInfo->write(cdf, layer->data, totelem));
+ if (cdf_write_layer(cdf, blay)) {
+ if (typeInfo->write(cdf, layer->data, totelem));
else break;
}
else
@@ -2802,19 +2840,19 @@ void CustomData_external_write(CustomData *data, ID *id, CustomDataMask mask, in
}
}
- if(i != data->totlayer) {
+ if (i != data->totlayer) {
fprintf(stderr, "Failed to write data to %s.\n", filename);
cdf_free(cdf);
return;
}
- for(i=0; i<data->totlayer; i++) {
+ for (i=0; i<data->totlayer; i++) {
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
- if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->write) {
- if(free) {
- if(typeInfo->free)
+ if ((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->write) {
+ if (free) {
+ if (typeInfo->free)
typeInfo->free(layer->data, totelem, typeInfo->size);
layer->flag &= ~CD_FLAG_IN_MEMORY;
}
@@ -2832,14 +2870,14 @@ void CustomData_external_add(CustomData *data, ID *UNUSED(id), int type, int UNU
int layer_index;
layer_index = CustomData_get_active_layer_index(data, type);
- if(layer_index < 0) return;
+ if (layer_index < 0) return;
layer = &data->layers[layer_index];
- if(layer->flag & CD_FLAG_EXTERNAL)
+ if (layer->flag & CD_FLAG_EXTERNAL)
return;
- if(!external) {
+ if (!external) {
external= MEM_callocN(sizeof(CustomDataExternal), "CustomDataExternal");
data->external= external;
}
@@ -2856,26 +2894,26 @@ void CustomData_external_remove(CustomData *data, ID *id, int type, int totelem)
int layer_index; // i, remove_file;
layer_index = CustomData_get_active_layer_index(data, type);
- if(layer_index < 0) return;
+ if (layer_index < 0) return;
layer = &data->layers[layer_index];
- if(!external)
+ if (!external)
return;
- if(layer->flag & CD_FLAG_EXTERNAL) {
- if(!(layer->flag & CD_FLAG_IN_MEMORY))
+ if (layer->flag & CD_FLAG_EXTERNAL) {
+ if (!(layer->flag & CD_FLAG_IN_MEMORY))
CustomData_external_read(data, id, CD_TYPE_AS_MASK(layer->type), totelem);
layer->flag &= ~CD_FLAG_EXTERNAL;
#if 0
remove_file= 1;
- for(i=0; i<data->totlayer; i++)
- if(data->layers[i].flag & CD_FLAG_EXTERNAL)
+ for (i=0; i<data->totlayer; i++)
+ if (data->layers[i].flag & CD_FLAG_EXTERNAL)
remove_file= 0;
- if(remove_file) {
+ if (remove_file) {
customdata_external_filename(filename, id, external);
cdf_remove(filename);
CustomData_external_free(data);
@@ -2890,7 +2928,7 @@ int CustomData_external_test(CustomData *data, int type)
int layer_index;
layer_index = CustomData_get_active_layer_index(data, type);
- if(layer_index < 0) return 0;
+ if (layer_index < 0) return 0;
layer = &data->layers[layer_index];
return (layer->flag & CD_FLAG_EXTERNAL);
@@ -2902,7 +2940,7 @@ void CustomData_external_remove_object(CustomData *data, ID *id)
CustomDataExternal *external= data->external;
char filename[FILE_MAX];
- if(!external)
+ if (!external)
return;
customdata_external_filename(filename, id, external);
diff --git a/source/blender/blenkernel/intern/customdata_file.c b/source/blender/blenkernel/intern/customdata_file.c
index 75898018a2b..6d0dabede47 100644
--- a/source/blender/blenkernel/intern/customdata_file.c
+++ b/source/blender/blenkernel/intern/customdata_file.c
@@ -103,19 +103,21 @@ struct CDataFile {
static int cdf_endian(void)
{
- if(ENDIAN_ORDER == L_ENDIAN)
+ if (ENDIAN_ORDER == L_ENDIAN)
return CDF_ENDIAN_LITTLE;
else
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)
+ if (datatype == CDF_DATA_FLOAT)
return sizeof(float);
return 0;
-}*/
+}
+#endif
CDataFile *cdf_create(int type)
{
@@ -131,7 +133,7 @@ void cdf_free(CDataFile *cdf)
cdf_read_close(cdf);
cdf_write_close(cdf);
- if(cdf->layer)
+ if (cdf->layer)
MEM_freeN(cdf->layer);
MEM_freeN(cdf);
@@ -151,38 +153,38 @@ static int cdf_read_header(CDataFile *cdf)
header= &cdf->header;
- if(!fread(header, sizeof(CDataFileHeader), 1, cdf->readf))
+ if (!fread(header, sizeof(CDataFileHeader), 1, cdf->readf))
return 0;
- if(memcmp(header->ID, "BCDF", sizeof(header->ID)) != 0)
+ if (memcmp(header->ID, "BCDF", sizeof(header->ID)) != 0)
return 0;
- if(header->version > CDF_VERSION)
+ if (header->version > CDF_VERSION)
return 0;
cdf->switchendian= header->endian != cdf_endian();
header->endian= cdf_endian();
- if(cdf->switchendian) {
+ if (cdf->switchendian) {
SWITCH_INT(header->type);
SWITCH_INT(header->totlayer);
SWITCH_INT(header->structbytes);
}
- if(!ELEM(header->type, CDF_TYPE_IMAGE, CDF_TYPE_MESH))
+ if (!ELEM(header->type, CDF_TYPE_IMAGE, CDF_TYPE_MESH))
return 0;
offset += header->structbytes;
header->structbytes= sizeof(CDataFileHeader);
- if(fseek(f, offset, SEEK_SET) != 0)
+ if (fseek(f, offset, SEEK_SET) != 0)
return 0;
- if(header->type == CDF_TYPE_IMAGE) {
+ if (header->type == CDF_TYPE_IMAGE) {
image= &cdf->btype.image;
- if(!fread(image, sizeof(CDataFileImageHeader), 1, f))
+ if (!fread(image, sizeof(CDataFileImageHeader), 1, f))
return 0;
- if(cdf->switchendian) {
+ if (cdf->switchendian) {
SWITCH_INT(image->width);
SWITCH_INT(image->height);
SWITCH_INT(image->tile_size);
@@ -192,44 +194,44 @@ static int cdf_read_header(CDataFile *cdf)
offset += image->structbytes;
image->structbytes= sizeof(CDataFileImageHeader);
}
- else if(header->type == CDF_TYPE_MESH) {
+ else if (header->type == CDF_TYPE_MESH) {
mesh= &cdf->btype.mesh;
- if(!fread(mesh, sizeof(CDataFileMeshHeader), 1, f))
+ if (!fread(mesh, sizeof(CDataFileMeshHeader), 1, f))
return 0;
- if(cdf->switchendian)
+ if (cdf->switchendian)
SWITCH_INT(mesh->structbytes);
offset += mesh->structbytes;
mesh->structbytes= sizeof(CDataFileMeshHeader);
}
- if(fseek(f, offset, SEEK_SET) != 0)
+ if (fseek(f, offset, SEEK_SET) != 0)
return 0;
cdf->layer= MEM_callocN(sizeof(CDataFileLayer)*header->totlayer, "CDataFileLayer");
cdf->totlayer= header->totlayer;
- for(a=0; a<header->totlayer; a++) {
+ for (a=0; a<header->totlayer; a++) {
layer= &cdf->layer[a];
- if(!fread(layer, sizeof(CDataFileLayer), 1, f))
+ if (!fread(layer, sizeof(CDataFileLayer), 1, f))
return 0;
- if(cdf->switchendian) {
+ if (cdf->switchendian) {
SWITCH_INT(layer->type);
SWITCH_INT(layer->datatype);
SWITCH_INT64(layer->datasize);
SWITCH_INT(layer->structbytes);
}
- if(layer->datatype != CDF_DATA_FLOAT)
+ if (layer->datatype != CDF_DATA_FLOAT)
return 0;
offset += layer->structbytes;
layer->structbytes= sizeof(CDataFileLayer);
- if(fseek(f, offset, SEEK_SET) != 0)
+ if (fseek(f, offset, SEEK_SET) != 0)
return 0;
}
@@ -249,24 +251,24 @@ static int cdf_write_header(CDataFile *cdf)
header= &cdf->header;
- if(!fwrite(header, sizeof(CDataFileHeader), 1, f))
+ if (!fwrite(header, sizeof(CDataFileHeader), 1, f))
return 0;
- if(header->type == CDF_TYPE_IMAGE) {
+ if (header->type == CDF_TYPE_IMAGE) {
image= &cdf->btype.image;
- if(!fwrite(image, sizeof(CDataFileImageHeader), 1, f))
+ if (!fwrite(image, sizeof(CDataFileImageHeader), 1, f))
return 0;
}
- else if(header->type == CDF_TYPE_MESH) {
+ else if (header->type == CDF_TYPE_MESH) {
mesh= &cdf->btype.mesh;
- if(!fwrite(mesh, sizeof(CDataFileMeshHeader), 1, f))
+ if (!fwrite(mesh, sizeof(CDataFileMeshHeader), 1, f))
return 0;
}
- for(a=0; a<header->totlayer; a++) {
+ for (a=0; a<header->totlayer; a++) {
layer= &cdf->layer[a];
- if(!fwrite(layer, sizeof(CDataFileLayer), 1, f))
+ if (!fwrite(layer, sizeof(CDataFileLayer), 1, f))
return 0;
}
@@ -277,18 +279,18 @@ int cdf_read_open(CDataFile *cdf, const char *filename)
{
FILE *f;
- f= fopen(filename, "rb");
- if(!f)
+ f= BLI_fopen(filename, "rb");
+ if (!f)
return 0;
cdf->readf= f;
- if(!cdf_read_header(cdf)) {
+ if (!cdf_read_header(cdf)) {
cdf_read_close(cdf);
return 0;
}
- if(cdf->header.type != cdf->type) {
+ if (cdf->header.type != cdf->type) {
cdf_read_close(cdf);
return 0;
}
@@ -303,8 +305,8 @@ int cdf_read_layer(CDataFile *cdf, CDataFileLayer *blay)
/* seek to right location in file */
offset= cdf->dataoffset;
- for(a=0; a<cdf->totlayer; a++) {
- if(&cdf->layer[a] == blay)
+ for (a=0; a<cdf->totlayer; a++) {
+ if (&cdf->layer[a] == blay)
break;
else
offset += cdf->layer[a].datasize;
@@ -319,15 +321,16 @@ int cdf_read_data(CDataFile *cdf, unsigned int size, void *data)
unsigned int a;
/* read data */
- if(!fread(data, size, 1, cdf->readf))
+ if (!fread(data, size, 1, cdf->readf))
return 0;
/* switch endian if necessary */
- if(cdf->switchendian) {
+ if (cdf->switchendian) {
fdata= data;
- for(a=0; a<size/sizeof(float); a++)
- SWITCH_INT(fdata[a])
+ for (a=0; a<size/sizeof(float); a++) {
+ SWITCH_INT(fdata[a]);
+ }
}
return 1;
@@ -335,7 +338,7 @@ int cdf_read_data(CDataFile *cdf, unsigned int size, void *data)
void cdf_read_close(CDataFile *cdf)
{
- if(cdf->readf) {
+ if (cdf->readf) {
fclose(cdf->readf);
cdf->readf= NULL;
}
@@ -348,8 +351,8 @@ int cdf_write_open(CDataFile *cdf, const char *filename)
CDataFileMeshHeader *mesh;
FILE *f;
- f= fopen(filename, "wb");
- if(!f)
+ f= BLI_fopen(filename, "wb");
+ if (!f)
return 0;
cdf->writef= f;
@@ -366,13 +369,13 @@ int cdf_write_open(CDataFile *cdf, const char *filename)
header->type= cdf->type;
header->totlayer= cdf->totlayer;
- if(cdf->type == CDF_TYPE_IMAGE) {
+ if (cdf->type == CDF_TYPE_IMAGE) {
/* fill image header */
image= &cdf->btype.image;
image->structbytes= sizeof(CDataFileImageHeader);
image->tile_size= CDF_TILE_SIZE;
}
- else if(cdf->type == CDF_TYPE_MESH) {
+ else if (cdf->type == CDF_TYPE_MESH) {
/* fill mesh header */
mesh= &cdf->btype.mesh;
mesh->structbytes= sizeof(CDataFileMeshHeader);
@@ -391,7 +394,7 @@ int cdf_write_layer(CDataFile *UNUSED(cdf), CDataFileLayer *UNUSED(blay))
int cdf_write_data(CDataFile *cdf, unsigned int size, void *data)
{
/* write data */
- if(!fwrite(data, size, 1, cdf->writef))
+ if (!fwrite(data, size, 1, cdf->writef))
return 0;
return 1;
@@ -399,7 +402,7 @@ int cdf_write_data(CDataFile *cdf, unsigned int size, void *data)
void cdf_write_close(CDataFile *cdf)
{
- if(cdf->writef) {
+ if (cdf->writef) {
fclose(cdf->writef);
cdf->writef= NULL;
}
@@ -417,10 +420,10 @@ CDataFileLayer *cdf_layer_find(CDataFile *cdf, int type, const char *name)
CDataFileLayer *layer;
int a;
- for(a=0; a<cdf->totlayer; a++) {
+ for (a=0; a<cdf->totlayer; a++) {
layer= &cdf->layer[a];
- if(layer->type == type && strcmp(layer->name, name) == 0)
+ if (layer->type == type && strcmp(layer->name, name) == 0)
return layer;
}
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index 822293c35e1..c41f5b6f86f 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -49,10 +49,10 @@ void defgroup_copy_list(ListBase *outbase, ListBase *inbase)
{
bDeformGroup *defgroup, *defgroupn;
- outbase->first= outbase->last= NULL;
+ outbase->first = outbase->last = NULL;
- for (defgroup = inbase->first; defgroup; defgroup=defgroup->next) {
- defgroupn= defgroup_duplicate(defgroup);
+ for (defgroup = inbase->first; defgroup; defgroup = defgroup->next) {
+ defgroupn = defgroup_duplicate(defgroup);
BLI_addtail(outbase, defgroupn);
}
}
@@ -64,12 +64,12 @@ bDeformGroup *defgroup_duplicate(bDeformGroup *ingroup)
if (!ingroup)
return NULL;
- outgroup=MEM_callocN(sizeof(bDeformGroup), "copy deformGroup");
+ outgroup = MEM_callocN(sizeof(bDeformGroup), "copy deformGroup");
/* For now, just copy everything over. */
- memcpy (outgroup, ingroup, sizeof(bDeformGroup));
+ memcpy(outgroup, ingroup, sizeof(bDeformGroup));
- outgroup->next=outgroup->prev=NULL;
+ outgroup->next = outgroup->prev = NULL;
return outgroup;
}
@@ -86,9 +86,9 @@ void defvert_copy(MDeformVert *dvert_dst, const MDeformVert *dvert_src)
MEM_freeN(dvert_dst->dw);
if (dvert_src->totweight)
- dvert_dst->dw= MEM_dupallocN(dvert_src->dw);
+ dvert_dst->dw = MEM_dupallocN(dvert_src->dw);
else
- dvert_dst->dw= NULL;
+ dvert_dst->dw = NULL;
dvert_dst->totweight = dvert_src->totweight;
}
@@ -102,19 +102,19 @@ void defvert_copy_index(MDeformVert *dvert_dst, const MDeformVert *dvert_src, co
{
MDeformWeight *dw_src, *dw_dst;
- dw_src= defvert_find_index(dvert_src, defgroup);
+ dw_src = defvert_find_index(dvert_src, defgroup);
if (dw_src) {
/* source is valid, verify destination */
- dw_dst= defvert_verify_index(dvert_dst, defgroup);
- dw_dst->weight= dw_src->weight;
+ dw_dst = defvert_verify_index(dvert_dst, defgroup);
+ dw_dst->weight = dw_src->weight;
}
else {
/* source was NULL, assign zero, could also remove */
- dw_dst= defvert_find_index(dvert_dst, defgroup);
+ dw_dst = defvert_find_index(dvert_dst, defgroup);
if (dw_dst) {
- dw_dst->weight= 0.0f;
+ dw_dst->weight = 0.0f;
}
}
}
@@ -127,13 +127,13 @@ void defvert_sync(MDeformVert *dvert_dst, const MDeformVert *dvert_src, int use_
if (dvert_src->totweight && dvert_dst->totweight) {
int i;
MDeformWeight *dw_src;
- for (i=0, dw_src=dvert_src->dw; i < dvert_src->totweight; i++, dw_src++) {
+ for (i = 0, dw_src = dvert_src->dw; i < dvert_src->totweight; i++, dw_src++) {
MDeformWeight *dw_dst;
- if (use_verify) dw_dst= defvert_verify_index(dvert_dst, dw_src->def_nr);
- else dw_dst= defvert_find_index(dvert_dst, dw_src->def_nr);
+ if (use_verify) dw_dst = defvert_verify_index(dvert_dst, dw_src->def_nr);
+ else dw_dst = defvert_find_index(dvert_dst, dw_src->def_nr);
if (dw_dst) {
- dw_dst->weight= dw_src->weight;
+ dw_dst->weight = dw_src->weight;
}
}
}
@@ -146,14 +146,14 @@ void defvert_sync_mapped(MDeformVert *dvert_dst, const MDeformVert *dvert_src,
if (dvert_src->totweight && dvert_dst->totweight) {
int i;
MDeformWeight *dw_src;
- for (i=0, dw_src=dvert_src->dw; i < dvert_src->totweight; i++, dw_src++) {
+ for (i = 0, dw_src = dvert_src->dw; i < dvert_src->totweight; i++, dw_src++) {
if (dw_src->def_nr < flip_map_len) {
MDeformWeight *dw_dst;
- if (use_verify) dw_dst= defvert_verify_index(dvert_dst, flip_map[dw_src->def_nr]);
- else dw_dst= defvert_find_index(dvert_dst, flip_map[dw_src->def_nr]);
+ if (use_verify) dw_dst = defvert_verify_index(dvert_dst, flip_map[dw_src->def_nr]);
+ else dw_dst = defvert_find_index(dvert_dst, flip_map[dw_src->def_nr]);
if (dw_dst) {
- dw_dst->weight= dw_src->weight;
+ dw_dst->weight = dw_src->weight;
}
}
}
@@ -163,13 +163,13 @@ void defvert_sync_mapped(MDeformVert *dvert_dst, const MDeformVert *dvert_src,
/* be sure all flip_map values are valid */
void defvert_remap(MDeformVert *dvert, int *map, const int map_len)
{
- MDeformWeight *dw= dvert->dw;
+ MDeformWeight *dw = dvert->dw;
unsigned int i;
- for (i= dvert->totweight; i != 0; i--, dw++) {
+ for (i = dvert->totweight; i != 0; i--, dw++) {
if (dw->def_nr < map_len) {
- dw->def_nr= map[dw->def_nr];
+ dw->def_nr = map[dw->def_nr];
- /* just incase */
+ /* just in case */
BLI_assert(dw->def_nr >= 0);
}
}
@@ -180,24 +180,24 @@ void defvert_normalize(MDeformVert *dvert)
if (dvert->totweight <= 0) {
/* nothing */
}
- else if (dvert->totweight==1) {
- dvert->dw[0].weight= 1.0f;
+ else if (dvert->totweight == 1) {
+ dvert->dw[0].weight = 1.0f;
}
else {
MDeformWeight *dw;
unsigned int i;
- float tot_weight= 0.0f;
+ float tot_weight = 0.0f;
- for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+ for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
tot_weight += dw->weight;
}
if (tot_weight > 0.0f) {
- float scalar= 1.0f / tot_weight;
- for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+ float scalar = 1.0f / tot_weight;
+ 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);
}
}
@@ -209,36 +209,36 @@ void defvert_normalize_lock(MDeformVert *dvert, const int def_nr_lock)
if (dvert->totweight <= 0) {
/* nothing */
}
- else if (dvert->totweight==1) {
- dvert->dw[0].weight= 1.0f;
+ else if (dvert->totweight == 1) {
+ dvert->dw[0].weight = 1.0f;
}
else {
MDeformWeight *dw_lock = NULL;
MDeformWeight *dw;
unsigned int i;
- float tot_weight= 0.0f;
- float lock_iweight= 1.0f;
+ float tot_weight = 0.0f;
+ float lock_iweight = 1.0f;
- for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
- if(dw->def_nr != def_nr_lock) {
+ for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
+ if (dw->def_nr != def_nr_lock) {
tot_weight += dw->weight;
}
else {
- dw_lock= dw;
+ dw_lock = dw;
lock_iweight = (1.0f - dw_lock->weight);
CLAMP(lock_iweight, 0.0f, 1.0f);
}
}
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) {
+ 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);
}
}
@@ -251,15 +251,39 @@ void defvert_flip(MDeformVert *dvert, const int *flip_map, const int flip_map_le
MDeformWeight *dw;
int i;
- for (dw= dvert->dw, i=0; i<dvert->totweight; dw++, i++) {
+ for (dw = dvert->dw, i = 0; i<dvert->totweight; dw++, i++) {
if (dw->def_nr < flip_map_len) {
if (flip_map[dw->def_nr] >= 0) {
- dw->def_nr= flip_map[dw->def_nr];
+ dw->def_nr = flip_map[dw->def_nr];
}
}
}
}
+void defvert_flip_merged(MDeformVert *dvert, const int *flip_map, const int flip_map_len)
+{
+ MDeformWeight *dw, *dw_cpy;
+ float weight;
+ int i, totweight = dvert->totweight;
+
+ /* copy weights */
+ for (dw = dvert->dw, i = 0; i < totweight; dw++, i++) {
+ if (dw->def_nr < flip_map_len) {
+ if (flip_map[dw->def_nr] >= 0) {
+ /* error checkers complain of this but we'll never get NULL return */
+ dw_cpy = defvert_verify_index(dvert, flip_map[dw->def_nr]);
+ dw = &dvert->dw[i]; /* in case array got realloced */
+
+ /* distribute weights: if only one of the vertex groups was
+ * assigned this will halve the weights, otherwise it gets
+ * evened out. this keeps it proportional to other groups */
+ weight = 0.5f * (dw_cpy->weight + dw->weight);
+ dw_cpy->weight = weight;
+ dw->weight = weight;
+ }
+ }
+ }
+}
bDeformGroup *defgroup_find_name(Object *ob, const char *name)
{
@@ -268,7 +292,7 @@ bDeformGroup *defgroup_find_name(Object *ob, const char *name)
*/
bDeformGroup *curdef;
- for (curdef = ob->defbase.first; curdef; curdef=curdef->next) {
+ for (curdef = ob->defbase.first; curdef; curdef = curdef->next) {
if (!strcmp(curdef->name, name)) {
return curdef;
}
@@ -287,7 +311,7 @@ int defgroup_name_index(Object *ob, const char *name)
int def_nr;
if (name && name[0] != '\0') {
- for (curdef=ob->defbase.first, def_nr=0; curdef; curdef=curdef->next, def_nr++) {
+ for (curdef = ob->defbase.first, def_nr = 0; curdef; curdef = curdef->next, def_nr++) {
if (!strcmp(curdef->name, name))
return def_nr;
}
@@ -299,33 +323,33 @@ int defgroup_name_index(Object *ob, const char *name)
/* note, must be freed */
int *defgroup_flip_map(Object *ob, int *flip_map_len, int use_default)
{
- int defbase_tot= *flip_map_len= BLI_countlist(&ob->defbase);
+ int defbase_tot = *flip_map_len = BLI_countlist(&ob->defbase);
- if (defbase_tot==0) {
+ if (defbase_tot == 0) {
return NULL;
}
else {
bDeformGroup *dg;
char name[sizeof(dg->name)];
- int i, flip_num, *map= MEM_mallocN(defbase_tot * sizeof(int), __func__);
+ int i, flip_num, *map = MEM_mallocN(defbase_tot * sizeof(int), __func__);
- for (i=0; i < defbase_tot; i++) {
- map[i]= -1;
+ for (i = 0; i < defbase_tot; i++) {
+ map[i] = -1;
}
- for (dg=ob->defbase.first, i=0; dg; dg=dg->next, i++) {
+ 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;
+ map[i] = i;
flip_side_name(name, dg->name, FALSE);
if (strcmp(name, dg->name)) {
- flip_num= defgroup_name_index(ob, name);
+ flip_num = defgroup_name_index(ob, name);
if (flip_num >= 0) {
- map[i]= flip_num;
- map[flip_num]= i; /* save an extra lookup */
+ map[i] = flip_num;
+ map[flip_num] = i; /* save an extra lookup */
}
}
}
@@ -337,30 +361,29 @@ int *defgroup_flip_map(Object *ob, int *flip_map_len, int use_default)
/* note, must be freed */
int *defgroup_flip_map_single(Object *ob, int *flip_map_len, int use_default, int defgroup)
{
- int defbase_tot= *flip_map_len= BLI_countlist(&ob->defbase);
+ int defbase_tot = *flip_map_len = BLI_countlist(&ob->defbase);
- if (defbase_tot==0) {
+ if (defbase_tot == 0) {
return NULL;
}
else {
bDeformGroup *dg;
char name[sizeof(dg->name)];
- int i, flip_num, *map= MEM_mallocN(defbase_tot * sizeof(int), __func__);
+ int i, flip_num, *map = MEM_mallocN(defbase_tot * sizeof(int), __func__);
- for (i=0; i < defbase_tot; i++) {
- if (use_default) map[i]= i;
- else map[i]= -1;
+ for (i = 0; i < defbase_tot; i++) {
+ map[i] = use_default ? i : -1;
}
- dg= BLI_findlink(&ob->defbase, defgroup);
+ dg = BLI_findlink(&ob->defbase, defgroup);
flip_side_name(name, dg->name, FALSE);
if (strcmp(name, dg->name)) {
- flip_num= defgroup_name_index(ob, name);
+ flip_num = defgroup_name_index(ob, name);
if (flip_num >= 0) {
- map[defgroup]= flip_num;
- map[flip_num]= defgroup;
+ map[defgroup] = flip_num;
+ map[flip_num] = defgroup;
}
}
@@ -370,7 +393,7 @@ int *defgroup_flip_map_single(Object *ob, int *flip_map_len, int use_default, in
int defgroup_flip_index(Object *ob, int index, int use_default)
{
- bDeformGroup *dg= BLI_findlink(&ob->defbase, index);
+ bDeformGroup *dg = BLI_findlink(&ob->defbase, index);
int flip_index = -1;
if (dg) {
@@ -378,18 +401,18 @@ int defgroup_flip_index(Object *ob, int index, int use_default)
flip_side_name(name, dg->name, 0);
if (strcmp(name, dg->name))
- flip_index= defgroup_name_index(ob, name);
+ flip_index = defgroup_name_index(ob, name);
}
- return (flip_index==-1 && use_default) ? index : flip_index;
+ return (flip_index == -1 && use_default) ? index : flip_index;
}
static int defgroup_find_name_dupe(const char *name, bDeformGroup *dg, Object *ob)
{
bDeformGroup *curdef;
- for (curdef = ob->defbase.first; curdef; curdef=curdef->next) {
- if (dg!=curdef) {
+ for (curdef = ob->defbase.first; curdef; curdef = curdef->next) {
+ if (dg != curdef) {
if (!strcmp(curdef->name, name)) {
return 1;
}
@@ -401,147 +424,149 @@ static int defgroup_find_name_dupe(const char *name, bDeformGroup *dg, Object *o
static int defgroup_unique_check(void *arg, const char *name)
{
- struct {Object *ob; void *dg;} *data= arg;
+ struct {Object *ob; void *dg;} *data = arg;
return defgroup_find_name_dupe(name, data->dg, data->ob);
}
void defgroup_unique_name(bDeformGroup *dg, Object *ob)
{
struct {Object *ob; void *dg;} data;
- data.ob= ob;
- data.dg= dg;
+ data.ob = ob;
+ data.dg = dg;
BLI_uniquename_cb(defgroup_unique_check, &data, "Group", '.', dg->name, sizeof(dg->name));
}
+BLI_INLINE int is_char_sep(const char c)
+{
+ return ELEM4(c, '.', ' ', '-', '_');
+}
+
/* finds the best possible flipped name. For renaming; check for unique names afterwards */
/* if strip_number: removes number extensions
- * note: dont use sizeof() for 'name' or 'from_name' */
+ * note: don't use sizeof() for 'name' or 'from_name' */
void flip_side_name(char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP_NAME], int strip_number)
{
int len;
- char prefix[MAX_VGROUP_NAME]= ""; /* The part before the facing */
- char suffix[MAX_VGROUP_NAME]= ""; /* The part after the facing */
- char replace[MAX_VGROUP_NAME]= ""; /* The replacement string */
- char number[MAX_VGROUP_NAME]= ""; /* The number extension string */
- char *index=NULL;
+ char prefix[MAX_VGROUP_NAME] = ""; /* The part before the facing */
+ char suffix[MAX_VGROUP_NAME] = ""; /* The part after the facing */
+ char replace[MAX_VGROUP_NAME] = ""; /* The replacement string */
+ char number[MAX_VGROUP_NAME] = ""; /* The number extension string */
+ char *index = NULL;
/* always copy the name, since this can be called with an uninitialized string */
BLI_strncpy(name, from_name, MAX_VGROUP_NAME);
- len= BLI_strnlen(from_name, MAX_VGROUP_NAME);
+ len = BLI_strnlen(from_name, MAX_VGROUP_NAME);
if (len < 3) {
/* we don't do names like .R or .L */
return;
}
/* We first check the case with a .### extension, let's find the last period */
- if (isdigit(name[len-1])) {
- index= strrchr(name, '.'); // last occurrence
+ if (isdigit(name[len - 1])) {
+ index = strrchr(name, '.'); // last occurrence
if (index && isdigit(index[1]) ) { // doesnt handle case bone.1abc2 correct..., whatever!
- if (strip_number==0)
+ if (strip_number == 0) {
BLI_strncpy(number, index, sizeof(number));
- *index= 0;
- len= BLI_strnlen(name, MAX_VGROUP_NAME);
+ }
+ *index = 0;
+ len = BLI_strnlen(name, MAX_VGROUP_NAME);
}
}
BLI_strncpy(prefix, name, sizeof(prefix));
-#define IS_SEPARATOR(a) ((a)=='.' || (a)==' ' || (a)=='-' || (a)=='_')
-
/* first case; separator . - _ with extensions r R l L */
- if (IS_SEPARATOR(name[len-2]) ) {
- switch(name[len-1]) {
+ if (is_char_sep(name[len - 2]) ) {
+ switch(name[len - 1]) {
case 'l':
- prefix[len-1]= 0;
+ prefix[len - 1] = 0;
strcpy(replace, "r");
break;
case 'r':
- prefix[len-1]= 0;
+ prefix[len - 1] = 0;
strcpy(replace, "l");
break;
case 'L':
- prefix[len-1]= 0;
+ prefix[len - 1] = 0;
strcpy(replace, "R");
break;
case 'R':
- prefix[len-1]= 0;
+ prefix[len - 1] = 0;
strcpy(replace, "L");
break;
}
}
/* case; beginning with r R l L , with separator after it */
- else if (IS_SEPARATOR(name[1]) ) {
+ else if (is_char_sep(name[1]) ) {
switch(name[0]) {
case 'l':
strcpy(replace, "r");
- BLI_strncpy(suffix, name+1, sizeof(suffix));
- prefix[0]= 0;
+ BLI_strncpy(suffix, name + 1, sizeof(suffix));
+ prefix[0] = 0;
break;
case 'r':
strcpy(replace, "l");
- BLI_strncpy(suffix, name+1, sizeof(suffix));
- prefix[0]= 0;
+ BLI_strncpy(suffix, name + 1, sizeof(suffix));
+ prefix[0] = 0;
break;
case 'L':
strcpy(replace, "R");
- BLI_strncpy(suffix, name+1, sizeof(suffix));
- prefix[0]= 0;
+ BLI_strncpy(suffix, name + 1, sizeof(suffix));
+ prefix[0] = 0;
break;
case 'R':
strcpy(replace, "L");
- BLI_strncpy(suffix, name+1, sizeof(suffix));
- prefix[0]= 0;
+ BLI_strncpy(suffix, name + 1, sizeof(suffix));
+ prefix[0] = 0;
break;
}
}
else if (len > 5) {
/* hrms, why test for a separator? lets do the rule 'ultimate left or right' */
index = BLI_strcasestr(prefix, "right");
- if (index==prefix || index==prefix+len-5) {
- if (index[0]=='r')
+ if (index == prefix || index == prefix + len - 5) {
+ if (index[0] == 'r')
strcpy(replace, "left");
else {
- if (index[1]=='I')
+ if (index[1] == 'I')
strcpy(replace, "LEFT");
else
strcpy(replace, "Left");
}
- *index= 0;
- BLI_strncpy(suffix, index+5, sizeof(suffix));
+ *index = 0;
+ BLI_strncpy(suffix, index + 5, sizeof(suffix));
}
else {
index = BLI_strcasestr(prefix, "left");
- if (index==prefix || index==prefix+len-4) {
- if (index[0]=='l')
+ if (index == prefix || index == prefix + len - 4) {
+ if (index[0] == 'l')
strcpy(replace, "right");
else {
- if (index[1]=='E')
+ if (index[1] == 'E')
strcpy(replace, "RIGHT");
else
strcpy(replace, "Right");
}
- *index= 0;
+ *index = 0;
BLI_strncpy(suffix, index + 4, sizeof(suffix));
}
}
}
-#undef IS_SEPARATOR
-
BLI_snprintf (name, MAX_VGROUP_NAME, "%s%s%s%s", prefix, replace, suffix, number);
}
float defvert_find_weight(const struct MDeformVert *dvert, const int defgroup)
{
- MDeformWeight *dw= defvert_find_index(dvert, defgroup);
+ MDeformWeight *dw = defvert_find_index(dvert, defgroup);
return dw ? dw->weight : 0.0f;
}
/* take care with this the rationale is:
- * - if the object has no vertex group. act like vertex group isnt set and return 1.0,
- * - if the vertex group exists but the 'defgroup' isnt found on this vertex, _still_ return 0.0
+ * - if the object has no vertex group. act like vertex group isn't set and return 1.0,
+ * - if the vertex group exists but the 'defgroup' isn't found on this vertex, _still_ return 0.0
*
* This is a bit confusing, just saves some checks from the caller.
*/
@@ -550,7 +575,7 @@ float defvert_array_find_weight_safe(const struct MDeformVert *dvert, const int
if (defgroup == -1 || dvert == NULL)
return 1.0f;
- return defvert_find_weight(dvert+index, defgroup);
+ return defvert_find_weight(dvert + index, defgroup);
}
@@ -560,7 +585,7 @@ MDeformWeight *defvert_find_index(const MDeformVert *dvert, const int defgroup)
MDeformWeight *dw = dvert->dw;
unsigned int i;
- for (i= dvert->totweight; i != 0; i--, dw++) {
+ for (i = dvert->totweight; i != 0; i--, dw++) {
if (dw->def_nr == defgroup) {
return dw;
}
@@ -580,19 +605,19 @@ MDeformWeight *defvert_verify_index(MDeformVert *dvert, const int defgroup)
if (!dvert || defgroup < 0)
return NULL;
- dw_new= defvert_find_index(dvert, defgroup);
+ dw_new = defvert_find_index(dvert, defgroup);
if (dw_new)
return dw_new;
- dw_new= MEM_callocN(sizeof(MDeformWeight)*(dvert->totweight+1), "deformWeight");
+ dw_new = MEM_callocN(sizeof(MDeformWeight) * (dvert->totweight + 1), "deformWeight");
if (dvert->dw) {
- memcpy(dw_new, dvert->dw, sizeof(MDeformWeight)*dvert->totweight);
+ memcpy(dw_new, dvert->dw, sizeof(MDeformWeight) * dvert->totweight);
MEM_freeN(dvert->dw);
}
- dvert->dw= dw_new;
+ dvert->dw = dw_new;
dw_new += dvert->totweight;
- dw_new->weight= 0.0f;
- dw_new->def_nr= defgroup;
+ dw_new->weight = 0.0f;
+ dw_new->def_nr = defgroup;
/* Group index */
dvert->totweight++;
@@ -603,7 +628,7 @@ MDeformWeight *defvert_verify_index(MDeformVert *dvert, const int defgroup)
/* TODO. merge with code above! */
/* Adds the given vertex to the specified vertex group, with given weight.
- * warning, this does NOT check for existign, assume caller already knows its not there */
+ * warning, this does NOT check for existing, assume caller already knows its not there */
void defvert_add_index_notest(MDeformVert *dvert, int defgroup, const float weight)
{
MDeformWeight *dw_new;
@@ -612,9 +637,9 @@ void defvert_add_index_notest(MDeformVert *dvert, int defgroup, const float weig
if (!dvert || defgroup < 0)
return;
- dw_new = MEM_callocN(sizeof(MDeformWeight)*(dvert->totweight+1), "defvert_add_to group, new deformWeight");
- if(dvert->dw) {
- memcpy(dw_new, dvert->dw, sizeof(MDeformWeight)*dvert->totweight);
+ dw_new = MEM_callocN(sizeof(MDeformWeight) * (dvert->totweight + 1), "defvert_add_to group, new deformWeight");
+ if (dvert->dw) {
+ memcpy(dw_new, dvert->dw, sizeof(MDeformWeight) * dvert->totweight);
MEM_freeN(dvert->dw);
}
dvert->dw = dw_new;
@@ -634,7 +659,7 @@ void defvert_remove_group(MDeformVert *dvert, MDeformWeight *dw)
int i = dw - dvert->dw;
/* Security check! */
- if(i < 0 || i >= dvert->totweight) {
+ if (i < 0 || i >= dvert->totweight) {
return;
}
@@ -643,16 +668,16 @@ void defvert_remove_group(MDeformVert *dvert, MDeformWeight *dw)
* this deform weight, and reshuffle the others.
*/
if (dvert->totweight) {
- dw_new = MEM_mallocN(sizeof(MDeformWeight)*(dvert->totweight), __func__);
+ dw_new = MEM_mallocN(sizeof(MDeformWeight) * (dvert->totweight), __func__);
if (dvert->dw) {
-#if 1 /* since we dont care about order, swap this with the last, save a memcpy */
+#if 1 /* since we don't care about order, swap this with the last, save a memcpy */
if (i != dvert->totweight) {
- dvert->dw[i]= dvert->dw[dvert->totweight];
+ dvert->dw[i] = dvert->dw[dvert->totweight];
}
memcpy(dw_new, dvert->dw, sizeof(MDeformWeight) * dvert->totweight);
#else
- memcpy(dw_new, dvert->dw, sizeof(MDeformWeight)*i);
- memcpy(dw_new+i, dvert->dw+i+1, sizeof(MDeformWeight)*(dvert->totweight-i));
+ memcpy(dw_new, dvert->dw, sizeof(MDeformWeight) * i);
+ memcpy(dw_new + i, dvert->dw + i + 1, sizeof(MDeformWeight) * (dvert->totweight - i));
#endif
MEM_freeN(dvert->dw);
}
@@ -665,3 +690,13 @@ void defvert_remove_group(MDeformVert *dvert, MDeformWeight *dw)
}
}
}
+
+void defvert_clear(MDeformVert *dvert)
+{
+ if (dvert->dw) {
+ MEM_freeN(dvert->dw);
+ dvert->dw = NULL;
+ }
+
+ dvert->totweight = 0;
+}
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index a5097054de2..dd8471f0a1f 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)
@@ -156,7 +156,7 @@ void push_queue(DagNodeQueue *queue, DagNode *node)
int i;
if (node == NULL) {
- fprintf(stderr,"pushing null node \n");
+ fprintf(stderr,"pushing null node\n");
return;
}
/*fprintf(stderr,"BFS push : %s %d\n",((ID *) node->ob)->name, queue->count);*/
@@ -169,7 +169,8 @@ void push_queue(DagNodeQueue *queue, DagNode *node)
queue->freenodes->first = NULL;
}
queue->freenodes->count--;
- } else { /* alllocating more */
+ }
+ else { /* alllocating more */
elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem1");
elem->node = NULL;
elem->next = NULL;
@@ -213,7 +214,8 @@ void push_stack(DagNodeQueue *queue, DagNode *node)
queue->freenodes->first = NULL;
}
queue->freenodes->count--;
- } else { /* alllocating more */
+ }
+ else { /* alllocating more */
elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem1");
elem->node = NULL;
elem->next = NULL;
@@ -263,8 +265,9 @@ DagNode * pop_queue(DagNodeQueue *queue)
elem->next = NULL;
queue->freenodes->count++;
return node;
- } else {
- fprintf(stderr,"return null \n");
+ }
+ else {
+ fprintf(stderr,"return null\n");
return NULL;
}
}
@@ -346,10 +349,10 @@ static void dag_add_collision_field_relation(DagForest *dag, Scene *scene, Objec
// would be nice to have a list of colliders here
// so for now walk all objects in scene check 'same layer rule'
- for(base = scene->base.first; base; base= base->next) {
- if((base->lay & ob->lay) && base->object->pd) {
+ for (base = scene->base.first; base; base= base->next) {
+ if ((base->lay & ob->lay) && base->object->pd) {
Object *ob1= base->object;
- if((ob1->pd->deflect || ob1->pd->forcefield) && (ob1 != ob)) {
+ if ((ob1->pd->deflect || ob1->pd->forcefield) && (ob1 != ob)) {
node2 = dag_get_node(dag, ob1);
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Field Collision");
}
@@ -395,15 +398,15 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
for (ct= targets.first; ct; ct= ct->next) {
if (ct->tar && ct->tar != ob) {
- // fprintf(stderr,"armature %s target :%s \n", ob->id.name, target->id.name);
+ // fprintf(stderr,"armature %s target :%s\n", ob->id.name, target->id.name);
node3 = dag_get_node(dag, ct->tar);
if (ct->subtarget[0]) {
dag_add_relation(dag,node3,node, DAG_RL_OB_DATA|DAG_RL_DATA_DATA, cti->name);
- if(ct->tar->type == OB_MESH)
+ if (ct->tar->type == OB_MESH)
node3->customdata_mask |= CD_MASK_MDEFORMVERT;
}
- else if(ELEM3(con->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO, CONSTRAINT_TYPE_SPLINEIK))
+ else if (ELEM3(con->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO, CONSTRAINT_TYPE_SPLINEIK))
dag_add_relation(dag,node3,node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, cti->name);
else
dag_add_relation(dag,node3,node, DAG_RL_OB_DATA, cti->name);
@@ -421,14 +424,14 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
/* driver dependencies, nla modifiers */
#if 0 // XXX old animation system
- if(ob->nlastrips.first) {
+ if (ob->nlastrips.first) {
bActionStrip *strip;
bActionChannel *chan;
- for(strip= ob->nlastrips.first; strip; strip= strip->next) {
- if(strip->modifiers.first) {
+ for (strip= ob->nlastrips.first; strip; strip= strip->next) {
+ if (strip->modifiers.first) {
bActionModifier *amod;
- for(amod= strip->modifiers.first; amod; amod= amod->next) {
- if(amod->ob) {
+ for (amod= strip->modifiers.first; amod; amod= amod->next) {
+ if (amod->ob) {
node2 = dag_get_node(dag, amod->ob);
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "NLA Strip Modifier");
}
@@ -447,7 +450,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
if (ob->modifiers.first) {
ModifierData *md;
- for(md=ob->modifiers.first; md; md=md->next) {
+ for (md=ob->modifiers.first; md; md=md->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
if (mti->updateDepgraph) mti->updateDepgraph(md, dag, scene, ob, node);
@@ -468,11 +471,11 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
dag_add_relation(dag,node2,node,DAG_RL_DATA_OB|DAG_RL_OB_OB, "Bone Parent");
break;
default:
- if(ob->parent->type==OB_LATTICE)
+ if (ob->parent->type==OB_LATTICE)
dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Lattice Parent");
- else if(ob->parent->type==OB_CURVE) {
+ else if (ob->parent->type==OB_CURVE) {
Curve *cu= ob->parent->data;
- if(cu->flag & CU_PATH)
+ if (cu->flag & CU_PATH)
dag_add_relation(dag,node2,node,DAG_RL_DATA_OB|DAG_RL_OB_OB, "Curve Parent");
else
dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Curve Parent");
@@ -481,7 +484,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Parent");
}
/* exception case: parent is duplivert */
- if(ob->type==OB_MBALL && (ob->parent->transflag & OB_DUPLIVERTS)) {
+ if (ob->type==OB_MBALL && (ob->parent->transflag & OB_DUPLIVERTS)) {
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Duplivert");
}
@@ -494,10 +497,10 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
}
if (ob->transflag & OB_DUPLI) {
- if((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) {
+ if ((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) {
GroupObject *go;
- for(go= ob->dup_group->gobject.first; go; go= go->next) {
- if(go->ob) {
+ for (go= ob->dup_group->gobject.first; go; go= go->next) {
+ if (go->ob) {
node2 = dag_get_node(dag, go->ob);
/* node2 changes node1, this keeps animations updated in groups?? not logical? */
dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Dupligroup");
@@ -508,7 +511,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
/* softbody collision */
if ((ob->type==OB_MESH) || (ob->type==OB_CURVE) || (ob->type==OB_LATTICE)) {
- if(modifiers_isSoftbodyEnabled(ob) || modifiers_isClothEnabled(ob) || ob->particlesystem.first)
+ if (modifiers_isSoftbodyEnabled(ob) || modifiers_isClothEnabled(ob) || ob->particlesystem.first)
dag_add_collision_field_relation(dag, scene, ob, node); /* TODO: use effectorweight->group */
}
@@ -535,7 +538,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
{
Object *mom= find_basis_mball(scene, ob);
- if(mom!=ob) {
+ if (mom!=ob) {
node2 = dag_get_node(dag, mom);
dag_add_relation(dag,node,node2,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Metaball"); // mom depends on children!
}
@@ -546,16 +549,16 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
{
Curve *cu= ob->data;
- if(cu->bevobj) {
+ if (cu->bevobj) {
node2 = dag_get_node(dag, cu->bevobj);
dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Bevel");
}
- if(cu->taperobj) {
+ if (cu->taperobj) {
node2 = dag_get_node(dag, cu->taperobj);
dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Taper");
}
- if(ob->type == OB_FONT) {
- if(cu->textoncurve) {
+ if (ob->type == OB_FONT) {
+ if (cu->textoncurve) {
node2 = dag_get_node(dag, cu->textoncurve);
dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Texture On Curve");
}
@@ -566,10 +569,10 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
/* particles */
psys= ob->particlesystem.first;
- if(psys) {
+ if (psys) {
GroupObject *go;
- for(; psys; psys=psys->next) {
+ for (; psys; psys=psys->next) {
BoidRule *rule = NULL;
BoidState *state = NULL;
ParticleSettings *part= psys->part;
@@ -578,32 +581,32 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
dag_add_relation(dag, node, node, DAG_RL_OB_DATA, "Particle-Object Relation");
- if(!psys_check_enabled(ob, psys))
+ if (!psys_check_enabled(ob, psys))
continue;
- if(ELEM(part->phystype,PART_PHYS_KEYED,PART_PHYS_BOIDS)) {
+ if (ELEM(part->phystype,PART_PHYS_KEYED,PART_PHYS_BOIDS)) {
ParticleTarget *pt = psys->targets.first;
- for(; pt; pt=pt->next) {
- if(pt->ob && BLI_findlink(&pt->ob->particlesystem, pt->psys-1)) {
+ for (; pt; pt=pt->next) {
+ if (pt->ob && BLI_findlink(&pt->ob->particlesystem, pt->psys-1)) {
node2 = dag_get_node(dag, pt->ob);
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Particle Targets");
}
}
}
- if(part->ren_as == PART_DRAW_OB && part->dup_ob) {
+ 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)
+ if (part->dup_ob->type == OB_MBALL)
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA, "Particle Object Visualisation");
}
- if(part->ren_as == PART_DRAW_GR && part->dup_group) {
- for(go=part->dup_group->gobject.first; go; go=go->next) {
+ if (part->ren_as == PART_DRAW_GR && part->dup_group) {
+ for (go=part->dup_group->gobject.first; go; go=go->next) {
node2 = dag_get_node(dag, go->ob);
dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Particle Group Visualisation");
}
@@ -611,8 +614,8 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
effectors = pdInitEffectors(scene, ob, psys, part->effector_weights);
- if(effectors) for(eff = effectors->first; eff; eff=eff->next) {
- if(eff->psys) {
+ if (effectors) for (eff = effectors->first; eff; eff=eff->next) {
+ if (eff->psys) {
node2 = dag_get_node(dag, eff->ob);
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Particle Field");
}
@@ -620,16 +623,16 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
pdEndEffectors(&effectors);
- if(part->boids) {
- for(state = part->boids->states.first; state; state=state->next) {
- for(rule = state->rules.first; rule; rule=rule->next) {
+ if (part->boids) {
+ for (state = part->boids->states.first; state; state=state->next) {
+ for (rule = state->rules.first; rule; rule=rule->next) {
Object *ruleob = NULL;
- if(rule->type==eBoidRuleType_Avoid)
+ if (rule->type==eBoidRuleType_Avoid)
ruleob = ((BoidRuleGoalAvoid*)rule)->ob;
- else if(rule->type==eBoidRuleType_FollowLeader)
+ else if (rule->type==eBoidRuleType_FollowLeader)
ruleob = ((BoidRuleFollowLeader*)rule)->ob;
- if(ruleob) {
+ if (ruleob) {
node2 = dag_get_node(dag, ruleob);
dag_add_relation(dag, node2, node, DAG_RL_OB_DATA, "Boid Rule");
}
@@ -645,28 +648,28 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
ListBase targets = {NULL, NULL};
bConstraintTarget *ct;
- if(!cti)
+ if (!cti)
continue;
/* special case for camera tracking -- it doesn't use targets to define relations */
- if(ELEM3(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER, CONSTRAINT_TYPE_OBJECTSOLVER)) {
+ if (ELEM3(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER, CONSTRAINT_TYPE_OBJECTSOLVER)) {
int depends_on_camera= 0;
- if(cti->type==CONSTRAINT_TYPE_FOLLOWTRACK) {
+ if (cti->type==CONSTRAINT_TYPE_FOLLOWTRACK) {
bFollowTrackConstraint *data= (bFollowTrackConstraint *)con->data;
- if((data->clip || data->flag&FOLLOWTRACK_ACTIVECLIP) && data->track[0])
+ if ((data->clip || data->flag&FOLLOWTRACK_ACTIVECLIP) && data->track[0])
depends_on_camera= 1;
- if(data->depth_ob) {
+ if (data->depth_ob) {
node2 = dag_get_node(dag, data->depth_ob);
dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB, cti->name);
}
}
- else if(cti->type==CONSTRAINT_TYPE_OBJECTSOLVER)
+ else if (cti->type==CONSTRAINT_TYPE_OBJECTSOLVER)
depends_on_camera= 1;
- if(depends_on_camera && scene->camera) {
+ if (depends_on_camera && scene->camera) {
node2 = dag_get_node(dag, scene->camera);
dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB, cti->name);
}
@@ -733,22 +736,22 @@ struct DagForest *build_dag(Main *bmain, Scene *sce, short mask)
scenenode = dag_add_node(dag, sce);
/* add current scene objects */
- for(base = sce->base.first; base; base= base->next) {
+ for (base = sce->base.first; base; base= base->next) {
ob= base->object;
build_dag_object(dag, scenenode, sce, ob, mask);
- if(ob->proxy)
+ if (ob->proxy)
build_dag_object(dag, scenenode, sce, ob->proxy, mask);
/* handled in next loop */
- if(ob->dup_group)
+ if (ob->dup_group)
ob->dup_group->id.flag |= LIB_DOIT;
}
/* add groups used in current scene objects */
- for(group= bmain->group.first; group; group= group->id.next) {
- if(group->id.flag & LIB_DOIT) {
- for(go= group->gobject.first; go; go= go->next) {
+ for (group= bmain->group.first; group; group= group->id.next) {
+ if (group->id.flag & LIB_DOIT) {
+ for (go= group->gobject.first; go; go= go->next) {
build_dag_object(dag, scenenode, sce, go->ob, mask);
}
group->id.flag &= ~LIB_DOIT;
@@ -756,14 +759,14 @@ 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) {
- if(node->type==ID_OB) {
- for(itA = node->child; itA; itA= itA->next) {
- if(itA->node->type==ID_OB) {
+ for (node = sce->theDag->DagNode.first; node; node= node->next) {
+ if (node->type==ID_OB) {
+ for (itA = node->child; itA; itA= itA->next) {
+ if (itA->node->type==ID_OB) {
itA->node->color |= itA->type;
}
}
@@ -773,10 +776,10 @@ struct DagForest *build_dag(Main *bmain, Scene *sce, short mask)
}
}
/* now set relations equal, so that when only one parent changes, the correct recalcs are found */
- for(node = sce->theDag->DagNode.first; node; node= node->next) {
- if(node->type==ID_OB) {
- for(itA = node->child; itA; itA= itA->next) {
- if(itA->node->type==ID_OB) {
+ for (node = sce->theDag->DagNode.first; node; node= node->next) {
+ if (node->type==ID_OB) {
+ for (itA = node->child; itA; itA= itA->next) {
+ if (itA->node->type==ID_OB) {
itA->type |= itA->node->color;
}
}
@@ -827,7 +830,7 @@ void free_forest(DagForest *Dag)
DagNode * dag_find_node (DagForest *forest,void * fob)
{
- if(forest->nodeHash)
+ if (forest->nodeHash)
return BLI_ghash_lookup(forest->nodeHash, fob);
return NULL;
@@ -846,18 +849,19 @@ DagNode * dag_add_node (DagForest *forest, void * fob)
node->ob = fob;
node->color = DAG_WHITE;
- if(ugly_hack_sorry) node->type = GS(((ID *) fob)->name); // sorry, done for pose sorting
+ if (ugly_hack_sorry) node->type = GS(((ID *) fob)->name); // sorry, done for pose sorting
if (forest->numNodes) {
((DagNode *) forest->DagNode.last)->next = node;
forest->DagNode.last = node;
forest->numNodes++;
- } else {
+ }
+ else {
forest->DagNode.last = node;
forest->DagNode.first = node;
forest->numNodes = 1;
}
- if(!forest->nodeHash)
+ if (!forest->nodeHash)
forest->nodeHash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "dag_add_node gh");
BLI_ghash_insert(forest->nodeHash, fob, node);
}
@@ -890,7 +894,8 @@ DagNode * dag_get_sub_node (DagForest *forest,void * fob)
prev->next = mainchild->next;
MEM_freeN(mainchild);
break;
- } else {
+ }
+ else {
((DagNode *) forest->DagNode.first)->child = mainchild->next;
MEM_freeN(mainchild);
break;
@@ -954,9 +959,9 @@ void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel
static const char *dag_node_name(DagNode *node)
{
- if(node->ob == NULL)
+ if (node->ob == NULL)
return "null";
- else if(ugly_hack_sorry)
+ else if (ugly_hack_sorry)
return ((ID*)(node->ob))->name+2;
else
return ((bPoseChannel*)(node->ob))->name;
@@ -968,7 +973,7 @@ static void dag_node_print_dependencies(DagNode *node)
printf("%s depends on:\n", dag_node_name(node));
- for(itA= node->parent; itA; itA= itA->next)
+ for (itA= node->parent; itA; itA= itA->next)
printf(" %s through %s\n", dag_node_name(itA->node), itA->name);
printf("\n");
}
@@ -977,16 +982,16 @@ static int dag_node_print_dependency_recurs(DagNode *node, DagNode *endnode)
{
DagAdjList *itA;
- if(node->color == DAG_BLACK)
+ if (node->color == DAG_BLACK)
return 0;
node->color= DAG_BLACK;
- if(node == endnode)
+ if (node == endnode)
return 1;
- for(itA= node->parent; itA; itA= itA->next) {
- if(dag_node_print_dependency_recurs(itA->node, endnode)) {
+ for (itA= node->parent; itA; itA= itA->next) {
+ if (dag_node_print_dependency_recurs(itA->node, endnode)) {
printf(" %s depends on %s through %s.\n", dag_node_name(node), dag_node_name(itA->node), itA->name);
return 1;
}
@@ -999,7 +1004,7 @@ static void dag_node_print_dependency_cycle(DagForest *dag, DagNode *startnode,
{
DagNode *node;
- for(node = dag->DagNode.first; node; node= node->next)
+ for (node = dag->DagNode.first; node; node= node->next)
node->color= DAG_WHITE;
printf(" %s depends on %s through %s.\n", dag_node_name(endnode), dag_node_name(startnode), name);
@@ -1015,8 +1020,8 @@ static int dag_node_recurs_level(DagNode *node, int level)
node->color= DAG_BLACK; /* done */
newlevel= ++level;
- for(itA= node->parent; itA; itA= itA->next) {
- if(itA->node->color==DAG_WHITE) {
+ for (itA= node->parent; itA; itA= itA->next) {
+ if (itA->node->color==DAG_WHITE) {
itA->node->ancestor_count= dag_node_recurs_level(itA->node, level);
newlevel= MAX2(newlevel, level+itA->node->ancestor_count);
}
@@ -1033,25 +1038,25 @@ static void dag_check_cycle(DagForest *dag)
DagAdjList *itA;
/* debugging print */
- if(dag_print_dependencies)
- for(node = dag->DagNode.first; node; node= node->next)
+ if (dag_print_dependencies)
+ for (node = dag->DagNode.first; node; node= node->next)
dag_node_print_dependencies(node);
/* tag nodes unchecked */
- for(node = dag->DagNode.first; node; node= node->next)
+ for (node = dag->DagNode.first; node; node= node->next)
node->color= DAG_WHITE;
- for(node = dag->DagNode.first; node; node= node->next) {
- if(node->color==DAG_WHITE) {
+ for (node = dag->DagNode.first; node; node= node->next) {
+ if (node->color==DAG_WHITE) {
node->ancestor_count= dag_node_recurs_level(node, 0);
}
}
/* check relations, and print errors */
- for(node = dag->DagNode.first; node; node= node->next) {
- for(itA= node->parent; itA; itA= itA->next) {
- if(itA->node->ancestor_count > node->ancestor_count) {
- if(node->ob && itA->node->ob) {
+ for (node = dag->DagNode.first; node; node= node->next) {
+ for (itA= node->parent; itA; itA= itA->next) {
+ if (itA->node->ancestor_count > node->ancestor_count) {
+ if (node->ob && itA->node->ob) {
printf("Dependency cycle detected:\n");
dag_node_print_dependency_cycle(dag, itA->node, node, itA->name);
}
@@ -1060,7 +1065,7 @@ static void dag_check_cycle(DagForest *dag)
}
/* parent relations are only needed for cycle checking, so free now */
- for(node = dag->DagNode.first; node; node= node->next) {
+ for (node = dag->DagNode.first; node; node= node->next) {
while (node->parent) {
itA = node->parent->next;
MEM_freeN(node->parent);
@@ -1110,16 +1115,16 @@ void graph_bfs(void)
DagAdjList *itA;
int minheight;
- /* fprintf(stderr,"starting BFS \n ------------\n"); */
+ /* fprintf(stderr,"starting BFS\n ------------\n"); */
nqueue = queue_create(DAGQUEUEALLOC);
for ( i=0; i<50; i++)
pos[i] = 0;
/* Init
- * dagnode.first is alway the root (scene)
+ * dagnode.first is always the root (scene)
*/
node = MainDag->DagNode.first;
- while(node) {
+ while (node) {
node->color = DAG_WHITE;
node->BFS_dist = 9999;
node->k = 0;
@@ -1131,13 +1136,13 @@ void graph_bfs(void)
node->color = DAG_GRAY;
node->BFS_dist = 1;
push_queue(nqueue,node);
- while(nqueue->count) {
+ while (nqueue->count) {
node = pop_queue(nqueue);
minheight = pos[node->BFS_dist];
itA = node->child;
- while(itA != NULL) {
- if(itA->node->color == DAG_WHITE) {
+ while (itA != NULL) {
+ if (itA->node->color == DAG_WHITE) {
itA->node->color = DAG_GRAY;
itA->node->BFS_dist = node->BFS_dist + 1;
itA->node->k = (float) minheight;
@@ -1145,7 +1150,7 @@ void graph_bfs(void)
}
else {
- fprintf(stderr,"bfs not dag tree edge color :%i \n",itA->node->color);
+ fprintf(stderr,"bfs not dag tree edge color :%i\n",itA->node->color);
}
@@ -1154,14 +1159,14 @@ void graph_bfs(void)
if (pos[node->BFS_dist] > node->k ) {
pos[node->BFS_dist] += 1;
node->k = (float) pos[node->BFS_dist];
- } else {
+ }
+ else {
pos[node->BFS_dist] = (int) node->k +1;
}
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);
@@ -1182,14 +1187,14 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a
DagNodeQueue *nqueue;
DagAdjList *itA;
int retval = 0;
- /* fprintf(stderr,"starting BFS \n ------------\n"); */
+ /* fprintf(stderr,"starting BFS\n ------------\n"); */
/* Init
- * dagnode.first is alway the root (scene)
- */
+ * dagnode.first is always the root (scene)
+ */
node = dag->DagNode.first;
nqueue = queue_create(DAGQUEUEALLOC);
- while(node) {
+ while (node) {
node->color = DAG_WHITE;
node->BFS_dist = 9999;
node = node->next;
@@ -1201,12 +1206,12 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a
node->BFS_dist = 1;
pre_func(node->ob,data);
- while(nqueue->count) {
+ while (nqueue->count) {
node = pop_queue(nqueue);
itA = node->child;
- while(itA != NULL) {
- if((itA->node->color == DAG_WHITE) && (itA->type & mask)) {
+ while (itA != NULL) {
+ if ((itA->node->color == DAG_WHITE) && (itA->type & mask)) {
itA->node->color = DAG_GRAY;
itA->node->BFS_dist = node->BFS_dist + 1;
push_queue(nqueue,itA->node);
@@ -1220,9 +1225,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);
@@ -1244,7 +1248,7 @@ DagNodeQueue * graph_dfs(void)
int maxpos=0;
/* int is_cycle = 0; */ /* UNUSED */
/*
- *fprintf(stderr,"starting DFS \n ------------\n");
+ *fprintf(stderr,"starting DFS\n ------------\n");
*/
nqueue = queue_create(DAGQUEUEALLOC);
retqueue = queue_create(MainDag->numNodes);
@@ -1252,10 +1256,10 @@ DagNodeQueue * graph_dfs(void)
pos[i] = 0;
/* Init
- * dagnode.first is alway the root (scene)
+ * dagnode.first is always the root (scene)
*/
node = MainDag->DagNode.first;
- while(node) {
+ while (node) {
node->color = DAG_WHITE;
node->DFS_dist = 9999;
node->DFS_dvtm = node->DFS_fntm = 9999;
@@ -1275,7 +1279,7 @@ DagNodeQueue * graph_dfs(void)
time++;
push_stack(nqueue,node);
- while(nqueue->count) {
+ while (nqueue->count) {
//graph_print_queue(nqueue);
skip = 0;
@@ -1284,8 +1288,8 @@ DagNodeQueue * graph_dfs(void)
minheight = pos[node->DFS_dist];
itA = node->child;
- while(itA != NULL) {
- if(itA->node->color == DAG_WHITE) {
+ while (itA != NULL) {
+ if (itA->node->color == DAG_WHITE) {
itA->node->DFS_dvtm = time;
itA->node->color = DAG_GRAY;
@@ -1295,19 +1299,21 @@ DagNodeQueue * graph_dfs(void)
push_stack(nqueue,itA->node);
skip = 1;
break;
- } else {
+ }
+ else {
if (itA->node->color == DAG_GRAY) { // back edge
- fprintf(stderr,"dfs back edge :%15s %15s \n",((ID *) node->ob)->name, ((ID *) itA->node->ob)->name);
+ fprintf(stderr,"dfs back edge :%15s %15s\n",((ID *) node->ob)->name, ((ID *) itA->node->ob)->name);
/* is_cycle = 1; */ /* UNUSED */
- } else if (itA->node->color == DAG_BLACK) {
+ }
+ else if (itA->node->color == DAG_BLACK) {
;
/* 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;
- fprintf(stderr,"dfs forward or cross edge :%15s %i-%i %15s %i-%i \n",
+ fprintf(stderr,"dfs forward or cross edge :%15s %i-%i %15s %i-%i\n",
((ID *) node->ob)->name,
node->DFS_dvtm,
node->DFS_fntm,
@@ -1315,8 +1321,9 @@ DagNodeQueue * graph_dfs(void)
itA->node->DFS_dvtm,
itA->node->DFS_fntm);
*/
- } else
- fprintf(stderr,"dfs unknown edge \n");
+ }
+ else
+ fprintf(stderr,"dfs unknown edge\n");
}
itA = itA->next;
}
@@ -1332,14 +1339,14 @@ DagNodeQueue * graph_dfs(void)
if (pos[node->DFS_dist] > node->k ) {
pos[node->DFS_dist] += 1;
node->k = (float) pos[node->DFS_dist];
- } else {
+ }
+ else {
pos[node->DFS_dist] = (int) node->k +1;
}
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);
}
@@ -1347,7 +1354,7 @@ DagNodeQueue * graph_dfs(void)
}
node = node->next;
} while (node);
-// fprintf(stderr,"i size : %i \n", maxpos);
+// fprintf(stderr,"i size : %i\n", maxpos);
queue_delete(nqueue);
return(retqueue);
@@ -1371,15 +1378,15 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a
int skip = 0;
int retval = 0;
/*
- *fprintf(stderr,"starting DFS \n ------------\n");
+ *fprintf(stderr,"starting DFS\n ------------\n");
*/
nqueue = queue_create(DAGQUEUEALLOC);
/* Init
- * dagnode.first is alway the root (scene)
- */
+ * dagnode.first is always the root (scene)
+ */
node = dag->DagNode.first;
- while(node) {
+ while (node) {
node->color = DAG_WHITE;
node->DFS_dist = 9999;
node->DFS_dvtm = node->DFS_fntm = 9999;
@@ -1399,13 +1406,13 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a
push_stack(nqueue,node);
pre_func(node->ob,data);
- while(nqueue->count) {
+ while (nqueue->count) {
skip = 0;
node = get_top_node_queue(nqueue);
itA = node->child;
- while(itA != NULL) {
- if((itA->node->color == DAG_WHITE) && (itA->type & mask) ) {
+ while (itA != NULL) {
+ if ((itA->node->color == DAG_WHITE) && (itA->type & mask) ) {
itA->node->DFS_dvtm = time;
itA->node->color = DAG_GRAY;
@@ -1416,7 +1423,8 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a
skip = 1;
break;
- } else {
+ }
+ else {
if (itA->node->color == DAG_GRAY) {// back edge
retval = 1;
}
@@ -1452,20 +1460,21 @@ struct DagNodeQueue *get_obparents(struct DagForest *dag, void *ob)
DagAdjList *itA;
node = dag_find_node(dag,ob);
- if(node==NULL) {
+ if (node==NULL) {
return NULL;
}
else if (node->ancestor_count == 1) { // simple case
nqueue = queue_create(1);
push_queue(nqueue,node);
- } else { // need to go over the whole dag for adj list
+ }
+ else { /* need to go over the whole dag for adj list */
nqueue = queue_create(node->ancestor_count);
node1 = dag->DagNode.first;
do {
if (node1->DFS_fntm > node->DFS_fntm) { // a parent is finished after child. must check adj list
itA = node->child;
- while(itA != NULL) {
+ while (itA != NULL) {
if ((itA->node == node) && (itA->type == DAG_RL_DATA)) {
push_queue(nqueue,node);
}
@@ -1493,7 +1502,7 @@ struct DagNodeQueue *get_first_ancestors(struct DagForest *dag, void *ob)
do {
if (node1->DFS_fntm > node->DFS_fntm) {
itA = node->child;
- while(itA != NULL) {
+ while (itA != NULL) {
if (itA->node == node) {
push_queue(nqueue,node);
}
@@ -1520,7 +1529,7 @@ struct DagNodeQueue *get_all_childs(struct DagForest *dag, void *ob)
retqueue = queue_create(dag->numNodes); // was MainDag... why? (ton)
node = dag->DagNode.first;
- while(node) {
+ while (node) {
node->color = DAG_WHITE;
node = node->next;
}
@@ -1528,20 +1537,20 @@ struct DagNodeQueue *get_all_childs(struct DagForest *dag, void *ob)
time = 1;
node = dag_find_node(dag, ob); // could be done in loop above (ton)
- if(node) { // can be null for newly added objects
+ if (node) { // can be null for newly added objects
node->color = DAG_GRAY;
time++;
push_stack(nqueue,node);
- while(nqueue->count) {
+ while (nqueue->count) {
skip = 0;
node = get_top_node_queue(nqueue);
itA = node->child;
- while(itA != NULL) {
- if(itA->node->color == DAG_WHITE) {
+ while (itA != NULL) {
+ if (itA->node->color == DAG_WHITE) {
itA->node->DFS_dvtm = time;
itA->node->color = DAG_GRAY;
@@ -1575,8 +1584,8 @@ short are_obs_related(struct DagForest *dag, void *ob1, void *ob2)
node = dag_find_node(dag, ob1);
itA = node->child;
- while(itA != NULL) {
- if(itA->node->ob == ob2) {
+ while (itA != NULL) {
+ if (itA->node->ob == ob2) {
return itA->node->type;
}
itA = itA->next;
@@ -1603,7 +1612,7 @@ void graph_print_queue(DagNodeQueue *nqueue)
DagNodeQueueElem *queueElem;
queueElem = nqueue->first;
- while(queueElem) {
+ while (queueElem) {
fprintf(stderr,"** %s %i %i-%i ",((ID *) queueElem->node->ob)->name,queueElem->node->color,queueElem->node->DFS_dvtm,queueElem->node->DFS_fntm);
queueElem = queueElem->next;
}
@@ -1617,7 +1626,7 @@ void graph_print_queue_dist(DagNodeQueue *nqueue)
queueElem = nqueue->first;
count = 0;
- while(queueElem) {
+ while (queueElem) {
fprintf(stderr,"** %25s %2.2i-%2.2i ",((ID *) queueElem->node->ob)->name,queueElem->node->DFS_dvtm,queueElem->node->DFS_fntm);
while (count < queueElem->node->DFS_dvtm-1) { fputc(' ',stderr); count++;}
fputc('|',stderr);
@@ -1636,7 +1645,7 @@ void graph_print_adj_list(void)
DagAdjList *itA;
node = (getMainDag())->DagNode.first;
- while(node) {
+ while (node) {
fprintf(stderr,"node : %s col: %i",((ID *) node->ob)->name, node->color);
itA = node->child;
while (itA) {
@@ -1652,7 +1661,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;
@@ -1664,13 +1673,13 @@ void DAG_editors_update_cb(void (*id_func)(Main *bmain, ID *id), void (*scene_fu
static void dag_editors_id_update(Main *bmain, ID *id)
{
- if(EditorsUpdateIDCb)
+ if (EditorsUpdateIDCb)
EditorsUpdateIDCb(bmain, id);
}
static void dag_editors_scene_update(Main *bmain, Scene *scene, int updated)
{
- if(EditorsUpdateSceneCb)
+ if (EditorsUpdateSceneCb)
EditorsUpdateSceneCb(bmain, scene, updated);
}
@@ -1683,29 +1692,29 @@ static void scene_sort_groups(Main *bmain, Scene *sce)
Object *ob;
/* test; are group objects all in this scene? */
- for(ob= bmain->object.first; ob; ob= ob->id.next) {
+ for (ob= bmain->object.first; ob; ob= ob->id.next) {
ob->id.flag &= ~LIB_DOIT;
ob->id.newid= NULL; /* newid abuse for GroupObject */
}
- for(base = sce->base.first; base; base= base->next)
+ for (base = sce->base.first; base; base= base->next)
base->object->id.flag |= LIB_DOIT;
- for(group= bmain->group.first; group; group= group->id.next) {
- for(go= group->gobject.first; go; go= go->next) {
- if((go->ob->id.flag & LIB_DOIT)==0)
+ for (group= bmain->group.first; group; group= group->id.next) {
+ for (go= group->gobject.first; go; go= go->next) {
+ if ((go->ob->id.flag & LIB_DOIT)==0)
break;
}
/* this group is entirely in this scene */
- if(go==NULL) {
+ if (go==NULL) {
ListBase listb= {NULL, NULL};
- for(go= group->gobject.first; go; go= go->next)
+ for (go= group->gobject.first; go; go= go->next)
go->ob->id.newid= (ID *)go;
/* in order of sorted bases we reinsert group objects */
- for(base = sce->base.first; base; base= base->next) {
+ for (base = sce->base.first; base; base= base->next) {
- if(base->object->id.newid) {
+ if (base->object->id.newid) {
go= (GroupObject *)base->object->id.newid;
base->object->id.newid= NULL;
BLI_remlink( &group->gobject, go);
@@ -1737,7 +1746,7 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
nqueue = queue_create(DAGQUEUEALLOC);
- for(node = sce->theDag->DagNode.first; node; node= node->next) {
+ for (node = sce->theDag->DagNode.first; node; node= node->next) {
node->color = DAG_WHITE;
}
@@ -1748,14 +1757,14 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
time++;
push_stack(nqueue,rootnode);
- while(nqueue->count) {
+ while (nqueue->count) {
skip = 0;
node = get_top_node_queue(nqueue);
itA = node->child;
- while(itA != NULL) {
- if(itA->node->color == DAG_WHITE) {
+ while (itA != NULL) {
+ if (itA->node->color == DAG_WHITE) {
itA->node->DFS_dvtm = time;
itA->node->color = DAG_GRAY;
@@ -1778,7 +1787,7 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
base = sce->base.first;
while (base && base->object != node->ob)
base = base->next;
- if(base) {
+ if (base) {
BLI_remlink(&sce->base,base);
BLI_addhead(&tempbase,base);
}
@@ -1791,7 +1800,7 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
while (base) {
BLI_remlink(&sce->base,base);
BLI_addhead(&tempbase,base);
- //if(G.f & G_DEBUG)
+ //if(G.debug & G_DEBUG)
printf("cyclic %s\n", base->object->id.name);
base = sce->base.first;
}
@@ -1802,9 +1811,9 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
/* all groups with objects in this scene gets resorted too */
scene_sort_groups(bmain, sce);
- if(G.f & G_DEBUG) {
+ if (G.debug & G_DEBUG) {
printf("\nordered\n");
- for(base = sce->base.first; base; base= base->next) {
+ for (base = sce->base.first; base; base= base->next) {
printf(" %s\n", base->object->id.name);
}
}
@@ -1836,51 +1845,51 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime)
node->lasttime= curtime;
ob= node->ob;
- if(ob && (ob->recalc & OB_RECALC_ALL)) {
+ if (ob && (ob->recalc & OB_RECALC_ALL)) {
all_layer= node->scelay;
/* got an object node that changes, now check relations */
- for(itA = node->child; itA; itA= itA->next) {
+ for (itA = node->child; itA; itA= itA->next) {
all_layer |= itA->lay;
/* the relationship is visible */
- if((itA->lay & layer)) { // XXX || (itA->node->ob == obedit)
- if(itA->node->type==ID_OB) {
+ if ((itA->lay & layer)) { // XXX || (itA->node->ob == obedit)
+ if (itA->node->type==ID_OB) {
obc= itA->node->ob;
oldflag= obc->recalc;
/* got a ob->obc relation, now check if flag needs flush */
- if(ob->recalc & OB_RECALC_OB) {
- if(itA->type & DAG_RL_OB_OB) {
+ if (ob->recalc & OB_RECALC_OB) {
+ if (itA->type & DAG_RL_OB_OB) {
//printf("ob %s changes ob %s\n", ob->id.name, obc->id.name);
obc->recalc |= OB_RECALC_OB;
lib_id_recalc_tag(bmain, &obc->id);
}
- if(itA->type & DAG_RL_OB_DATA) {
+ if (itA->type & DAG_RL_OB_DATA) {
//printf("ob %s changes obdata %s\n", ob->id.name, obc->id.name);
obc->recalc |= OB_RECALC_DATA;
lib_id_recalc_data_tag(bmain, &obc->id);
}
}
- if(ob->recalc & OB_RECALC_DATA) {
- if(itA->type & DAG_RL_DATA_OB) {
+ if (ob->recalc & OB_RECALC_DATA) {
+ if (itA->type & DAG_RL_DATA_OB) {
//printf("obdata %s changes ob %s\n", ob->id.name, obc->id.name);
obc->recalc |= OB_RECALC_OB;
lib_id_recalc_tag(bmain, &obc->id);
}
- if(itA->type & DAG_RL_DATA_DATA) {
+ if (itA->type & DAG_RL_DATA_DATA) {
//printf("obdata %s changes obdata %s\n", ob->id.name, obc->id.name);
obc->recalc |= OB_RECALC_DATA;
lib_id_recalc_data_tag(bmain, &obc->id);
}
}
- if(oldflag!=obc->recalc) changed= 1;
+ if (oldflag!=obc->recalc) changed= 1;
}
}
}
/* even nicer, we can clear recalc flags... */
- if((all_layer & layer)==0) { // XXX && (ob != obedit)) {
+ if ((all_layer & layer)==0) { // XXX && (ob != obedit)) {
/* but existing displaylists or derivedmesh should be freed */
- if(ob->recalc & OB_RECALC_DATA)
+ if (ob->recalc & OB_RECALC_DATA)
object_free_display(ob);
ob->recalc &= ~OB_RECALC_ALL;
@@ -1890,15 +1899,15 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime)
/* check case where child changes and parent forcing obdata to change */
/* should be done regardless if this ob has recalc set */
/* could merge this in with loop above...? (ton) */
- for(itA = node->child; itA; itA= itA->next) {
+ for (itA = node->child; itA; itA= itA->next) {
/* the relationship is visible */
- if((itA->lay & layer)) { // XXX || (itA->node->ob == obedit)
- if(itA->node->type==ID_OB) {
+ if ((itA->lay & layer)) { // XXX || (itA->node->ob == obedit)
+ if (itA->node->type==ID_OB) {
obc= itA->node->ob;
/* child moves */
- if((obc->recalc & OB_RECALC_ALL)==OB_RECALC_OB) {
+ if ((obc->recalc & OB_RECALC_ALL)==OB_RECALC_OB) {
/* parent has deforming info */
- if(itA->type & (DAG_RL_OB_DATA|DAG_RL_DATA_DATA)) {
+ if (itA->type & (DAG_RL_OB_DATA|DAG_RL_DATA_DATA)) {
// printf("parent %s changes ob %s\n", ob->id.name, obc->id.name);
obc->recalc |= OB_RECALC_DATA;
lib_id_recalc_data_tag(bmain, &obc->id);
@@ -1909,8 +1918,8 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime)
}
/* we only go deeper if node not checked or something changed */
- for(itA = node->child; itA; itA= itA->next) {
- if(changed || itA->node->lasttime!=curtime)
+ for (itA = node->child; itA; itA= itA->next) {
+ if (changed || itA->node->lasttime!=curtime)
flush_update_node(itA->node, layer, curtime);
}
@@ -1924,9 +1933,9 @@ static unsigned int flush_layer_node(Scene *sce, DagNode *node, int curtime)
node->lasttime= curtime;
node->lay= node->scelay;
- for(itA = node->child; itA; itA= itA->next) {
- if(itA->node->type==ID_OB) {
- if(itA->node->lasttime!=curtime) {
+ for (itA = node->child; itA; itA= itA->next) {
+ if (itA->node->type==ID_OB) {
+ if (itA->node->lasttime!=curtime) {
itA->lay= flush_layer_node(sce, itA->node, curtime); // lay is only set once for each relation
}
else itA->lay= itA->node->lay;
@@ -1947,13 +1956,13 @@ static void flush_pointcache_reset(Scene *scene, DagNode *node, int curtime, int
node->lasttime= curtime;
- for(itA = node->child; itA; itA= itA->next) {
- if(itA->node->type==ID_OB) {
- if(itA->node->lasttime!=curtime) {
+ for (itA = node->child; itA; itA= itA->next) {
+ if (itA->node->type==ID_OB) {
+ if (itA->node->lasttime!=curtime) {
ob= (Object*)(itA->node->ob);
- if(reset || (ob->recalc & OB_RECALC_ALL)) {
- if(BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH)) {
+ if (reset || (ob->recalc & OB_RECALC_ALL)) {
+ if (BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH)) {
ob->recalc |= OB_RECALC_DATA;
lib_id_recalc_data_tag(bmain, &ob->id);
}
@@ -1977,14 +1986,14 @@ static void dag_scene_flush_layers(Scene *sce, int lay)
firstnode= sce->theDag->DagNode.first; // always scene node
- for(itA = firstnode->child; itA; itA= itA->next)
+ for (itA = firstnode->child; itA; itA= itA->next)
itA->lay= 0;
sce->theDag->time++; // so we know which nodes were accessed
lasttime= sce->theDag->time;
/* update layer flags in nodes */
- for(base= sce->base.first; base; base= base->next) {
+ for (base= sce->base.first; base; base= base->next) {
node= dag_get_node(sce->theDag, base->object);
node->scelay= base->object->lay;
}
@@ -1993,7 +2002,7 @@ static void dag_scene_flush_layers(Scene *sce, int lay)
* they ared still used for rendering or setting the camera view
*
* XXX, this wont work for local view / unlocked camera's */
- if(sce->camera) {
+ if (sce->camera) {
node= dag_get_node(sce->theDag, sce->camera);
node->scelay |= lay;
}
@@ -2002,8 +2011,8 @@ static void dag_scene_flush_layers(Scene *sce, int lay)
{
TimeMarker *m;
- for(m= sce->markers.first; m; m= m->next) {
- if(m->camera) {
+ for (m= sce->markers.first; m; m= m->next) {
+ if (m->camera) {
node= dag_get_node(sce->theDag, m->camera);
node->scelay |= lay;
}
@@ -2012,27 +2021,27 @@ static void dag_scene_flush_layers(Scene *sce, int lay)
#endif
/* flush layer nodes to dependencies */
- for(itA = firstnode->child; itA; itA= itA->next)
- if(itA->node->lasttime!=lasttime && itA->node->type==ID_OB)
+ for (itA = firstnode->child; itA; itA= itA->next)
+ if (itA->node->lasttime!=lasttime && itA->node->type==ID_OB)
flush_layer_node(sce, itA->node, lasttime);
}
static void dag_tag_renderlayers(Scene *sce, unsigned int lay)
{
- if(sce->nodetree) {
+ if (sce->nodetree) {
bNode *node;
Base *base;
unsigned int lay_changed= 0;
- for(base= sce->base.first; base; base= base->next)
- if(base->lay & lay)
- if(base->object->recalc)
+ for (base= sce->base.first; base; base= base->next)
+ if (base->lay & lay)
+ if (base->object->recalc)
lay_changed |= base->lay;
- for(node= sce->nodetree->nodes.first; node; node= node->next) {
- if(node->id==(ID *)sce) {
+ for (node= sce->nodetree->nodes.first; node; node= node->next) {
+ if (node->id==(ID *)sce) {
SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1);
- if(srl && (srl->lay & lay_changed))
+ if (srl && (srl->lay & lay_changed))
nodeUpdate(sce->nodetree, node);
}
}
@@ -2047,7 +2056,7 @@ void DAG_scene_flush_update(Main *bmain, Scene *sce, unsigned int lay, const sho
Object *ob;
int lasttime;
- if(sce->theDag==NULL) {
+ if (sce->theDag==NULL) {
printf("DAG zero... not allowed to happen!\n");
DAG_scene_sort(bmain, sce);
}
@@ -2060,20 +2069,20 @@ void DAG_scene_flush_update(Main *bmain, Scene *sce, unsigned int lay, const sho
/* then we use the relationships + layer info to flush update events */
sce->theDag->time++; // so we know which nodes were accessed
lasttime= sce->theDag->time;
- for(itA = firstnode->child; itA; itA= itA->next)
- if(itA->node->lasttime!=lasttime && itA->node->type==ID_OB)
+ for (itA = firstnode->child; itA; itA= itA->next)
+ if (itA->node->lasttime!=lasttime && itA->node->type==ID_OB)
flush_update_node(itA->node, lay, lasttime);
/* if update is not due to time change, do pointcache clears */
- if(!time) {
+ if (!time) {
sce->theDag->time++; // so we know which nodes were accessed
lasttime= sce->theDag->time;
- for(itA = firstnode->child; itA; itA= itA->next) {
- if(itA->node->lasttime!=lasttime && itA->node->type==ID_OB) {
+ for (itA = firstnode->child; itA; itA= itA->next) {
+ if (itA->node->lasttime!=lasttime && itA->node->type==ID_OB) {
ob= (Object*)(itA->node->ob);
- if(ob->recalc & OB_RECALC_ALL) {
- if(BKE_ptcache_object_reset(sce, ob, PTCACHE_RESET_DEPSGRAPH)) {
+ if (ob->recalc & OB_RECALC_ALL) {
+ if (BKE_ptcache_object_reset(sce, ob, PTCACHE_RESET_DEPSGRAPH)) {
ob->recalc |= OB_RECALC_DATA;
lib_id_recalc_data_tag(bmain, &ob->id);
}
@@ -2133,7 +2142,7 @@ static short animdata_use_time(AnimData *adt)
{
NlaTrack *nlt;
- if(adt==NULL) return 0;
+ if (adt==NULL) return 0;
/* check action - only if assigned, and it has anim curves */
if (adt->action && adt->action->curves.first)
@@ -2167,7 +2176,7 @@ static short animdata_use_time(AnimData *adt)
static void dag_object_time_update_flags(Object *ob)
{
- if(ob->constraints.first) {
+ if (ob->constraints.first) {
bConstraint *con;
for (con = ob->constraints.first; con; con=con->next) {
bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
@@ -2176,7 +2185,7 @@ static void dag_object_time_update_flags(Object *ob)
if (cti) {
/* special case for camera tracking -- it doesn't use targets to define relations */
- if(ELEM3(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER, CONSTRAINT_TYPE_OBJECTSOLVER)) {
+ if (ELEM3(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER, CONSTRAINT_TYPE_OBJECTSOLVER)) {
ob->recalc |= OB_RECALC_OB;
}
else if (cti->get_constraint_targets) {
@@ -2197,33 +2206,33 @@ static void dag_object_time_update_flags(Object *ob)
}
}
- if(ob->parent) {
+ if (ob->parent) {
/* motion path or bone child */
- if(ob->parent->type==OB_CURVE || ob->parent->type==OB_ARMATURE) ob->recalc |= OB_RECALC_OB;
+ if (ob->parent->type==OB_CURVE || ob->parent->type==OB_ARMATURE) ob->recalc |= OB_RECALC_OB;
}
#if 0 // XXX old animation system
- if(ob->nlastrips.first) {
- if(ob->dup_group) {
+ if (ob->nlastrips.first) {
+ if (ob->dup_group) {
bActionStrip *strip;
/* this case is for groups with nla, whilst nla target has no action or nla */
- for(strip= ob->nlastrips.first; strip; strip= strip->next) {
- if(strip->object)
+ for (strip= ob->nlastrips.first; strip; strip= strip->next) {
+ if (strip->object)
strip->object->recalc |= OB_RECALC_ALL;
}
}
}
#endif // XXX old animation system
- if(animdata_use_time(ob->adt)) {
+ if (animdata_use_time(ob->adt)) {
ob->recalc |= OB_RECALC_OB;
ob->adt->recalc |= ADT_RECALC_ANIM;
}
- if((ob->adt) && (ob->type==OB_ARMATURE)) ob->recalc |= OB_RECALC_DATA;
+ if ((ob->adt) && (ob->type==OB_ARMATURE)) ob->recalc |= OB_RECALC_DATA;
- if(object_modifiers_use_time(ob)) ob->recalc |= OB_RECALC_DATA;
- if((ob->pose) && (ob->pose->flag & POSE_CONSTRAINTS_TIMEDEPEND)) ob->recalc |= OB_RECALC_DATA;
+ if (object_modifiers_use_time(ob)) ob->recalc |= OB_RECALC_DATA;
+ if ((ob->pose) && (ob->pose->flag & POSE_CONSTRAINTS_TIMEDEPEND)) ob->recalc |= OB_RECALC_DATA;
{
AnimData *adt= BKE_animdata_from_id((ID *)ob->data);
@@ -2234,51 +2243,51 @@ static void dag_object_time_update_flags(Object *ob)
switch(ob->type) {
case OB_MESH:
me= ob->data;
- if(me->key) {
- if(!(ob->shapeflag & OB_SHAPE_LOCK)) {
+ if (me->key) {
+ if (!(ob->shapeflag & OB_SHAPE_LOCK)) {
ob->recalc |= OB_RECALC_DATA;
}
}
- if(ob->particlesystem.first)
+ if (ob->particlesystem.first)
ob->recalc |= OB_RECALC_DATA;
break;
case OB_CURVE:
case OB_SURF:
cu= ob->data;
- if(cu->key) {
- if(!(ob->shapeflag & OB_SHAPE_LOCK)) {
+ if (cu->key) {
+ if (!(ob->shapeflag & OB_SHAPE_LOCK)) {
ob->recalc |= OB_RECALC_DATA;
}
}
break;
case OB_FONT:
cu= ob->data;
- if(cu->nurb.first==NULL && cu->str && cu->vfont)
+ if (cu->nurb.first==NULL && cu->str && cu->vfont)
ob->recalc |= OB_RECALC_DATA;
break;
case OB_LATTICE:
lt= ob->data;
- if(lt->key) {
- if(!(ob->shapeflag & OB_SHAPE_LOCK)) {
+ if (lt->key) {
+ if (!(ob->shapeflag & OB_SHAPE_LOCK)) {
ob->recalc |= OB_RECALC_DATA;
}
}
break;
case OB_MBALL:
- if(ob->transflag & OB_DUPLI) ob->recalc |= OB_RECALC_DATA;
+ if (ob->transflag & OB_DUPLI) ob->recalc |= OB_RECALC_DATA;
break;
}
- if(animdata_use_time(adt)) {
+ if (animdata_use_time(adt)) {
ob->recalc |= OB_RECALC_DATA;
adt->recalc |= ADT_RECALC_ANIM;
}
- if(ob->particlesystem.first) {
+ if (ob->particlesystem.first) {
ParticleSystem *psys= ob->particlesystem.first;
- for(; psys; psys=psys->next) {
- if(psys_check_enabled(ob, psys)) {
+ for (; psys; psys=psys->next) {
+ if (psys_check_enabled(ob, psys)) {
ob->recalc |= OB_RECALC_DATA;
break;
}
@@ -2286,9 +2295,9 @@ static void dag_object_time_update_flags(Object *ob)
}
}
- if(ob->recalc & OB_RECALC_OB)
+ if (ob->recalc & OB_RECALC_OB)
lib_id_recalc_tag(G.main, &ob->id);
- if(ob->recalc & OB_RECALC_DATA)
+ if (ob->recalc & OB_RECALC_DATA)
lib_id_recalc_data_tag(G.main, &ob->id);
}
@@ -2303,51 +2312,51 @@ void DAG_scene_update_flags(Main *bmain, Scene *scene, unsigned int lay, const s
Scene *sce_iter;
/* set ob flags where animated systems are */
- for(SETLOOPER(scene, sce_iter, base)) {
+ for (SETLOOPER(scene, sce_iter, base)) {
ob= base->object;
- if(do_time) {
+ if (do_time) {
/* now if DagNode were part of base, the node->lay could be checked... */
/* we do all now, since the scene_flush checks layers and clears recalc flags even */
dag_object_time_update_flags(ob);
}
/* handled in next loop */
- if(ob->dup_group)
+ if (ob->dup_group)
ob->dup_group->id.flag |= LIB_DOIT;
}
- if(do_time) {
+ if (do_time) {
/* we do groups each once */
- for(group= bmain->group.first; group; group= group->id.next) {
- if(group->id.flag & LIB_DOIT) {
- for(go= group->gobject.first; go; go= go->next) {
+ for (group= bmain->group.first; group; group= group->id.next) {
+ if (group->id.flag & LIB_DOIT) {
+ for (go= group->gobject.first; go; go= go->next) {
dag_object_time_update_flags(go->ob);
}
}
}
}
- for(sce_iter= scene; sce_iter; sce_iter= sce_iter->set)
+ for (sce_iter= scene; sce_iter; sce_iter= sce_iter->set)
DAG_scene_flush_update(bmain, sce_iter, lay, 1);
- if(do_time) {
+ if (do_time) {
/* test: set time flag, to disable baked systems to update */
- for(SETLOOPER(scene, sce_iter, base)) {
+ for (SETLOOPER(scene, sce_iter, base)) {
ob= base->object;
- if(ob->recalc)
+ if (ob->recalc)
ob->recalc |= OB_RECALC_TIME;
}
/* hrmf... an exception to look at once, for invisible camera object we do it over */
- if(scene->camera)
+ if (scene->camera)
dag_object_time_update_flags(scene->camera);
}
/* and store the info in groupobject */
- for(group= bmain->group.first; group; group= group->id.next) {
- if(group->id.flag & LIB_DOIT) {
- for(go= group->gobject.first; go; go= go->next) {
+ for (group= bmain->group.first; group; group= group->id.next) {
+ if (group->id.flag & LIB_DOIT) {
+ for (go= group->gobject.first; go; go= go->next) {
go->recalc= go->ob->recalc;
// printf("ob %s recalc %d\n", go->ob->id.name, go->recalc);
}
@@ -2363,16 +2372,16 @@ 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;
- if((wm= bmain->wm.first)) {
+ if ((wm= bmain->wm.first)) {
/* if we have a windowmanager, look into windows */
- for(win=wm->windows.first; win; win=win->next) {
- if(win->screen) {
- if(!*sce) *sce= win->screen->scene;
+ for (win=wm->windows.first; win; win=win->next) {
+ if (win->screen) {
+ if (!*sce) *sce= win->screen->scene;
*lay |= BKE_screen_visible_layers(win->screen, win->screen->scene);
}
}
@@ -2380,11 +2389,11 @@ static void dag_current_scene_layers(Main *bmain, Scene **sce, unsigned int *lay
else {
/* if not, use the first sce */
*sce= bmain->scene.first;
- if(*sce) *lay= (*sce)->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? */
}
}
@@ -2395,7 +2404,7 @@ void DAG_ids_flush_update(Main *bmain, int time)
dag_current_scene_layers(bmain, &sce, &lay);
- if(sce)
+ if (sce)
DAG_scene_flush_update(bmain, sce, lay, time);
}
@@ -2411,33 +2420,33 @@ void DAG_on_visible_update(Main *bmain, const short do_time)
dag_current_scene_layers(bmain, &scene, &lay);
- if(scene && scene->theDag) {
+ 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)) {
+ for (SETLOOPER(scene, sce_iter, base)) {
ob= base->object;
node= (sce_iter->theDag)? dag_get_node(sce_iter->theDag, ob): NULL;
oblay= (node)? node->lay: ob->lay;
- if((oblay & lay) & ~scene->lay_updated) {
- if(ELEM6(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE))
+ if ((oblay & lay) & ~scene->lay_updated) {
+ if (ELEM6(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE))
ob->recalc |= OB_RECALC_DATA;
- if(ob->dup_group)
+ if (ob->dup_group)
ob->dup_group->id.flag |= LIB_DOIT;
}
}
- for(group= bmain->group.first; group; group= group->id.next) {
- if(group->id.flag & LIB_DOIT) {
- for(go= group->gobject.first; go; go= go->next) {
- if(ELEM6(go->ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE))
+ for (group= bmain->group.first; group; group= group->id.next) {
+ if (group->id.flag & LIB_DOIT) {
+ for (go= group->gobject.first; go; go= go->next) {
+ if (ELEM6(go->ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE))
go->ob->recalc |= OB_RECALC_DATA;
- if(go->ob->proxy_from)
+ if (go->ob->proxy_from)
go->ob->recalc |= OB_RECALC_OB;
}
@@ -2458,7 +2467,7 @@ static void dag_id_flush_update__isDependentTexture(void *userData, Object *UNUS
{
struct { ID *id; int is_dependent; } *data = userData;
- if(*idpoin && GS((*idpoin)->name)==ID_TE) {
+ if (*idpoin && GS((*idpoin)->name)==ID_TE) {
if (data->id == (*idpoin))
data->is_dependent = 1;
}
@@ -2471,19 +2480,19 @@ 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) {
+ if (GS(id->name) == ID_OB) {
ob= (Object*)id;
BKE_ptcache_object_reset(sce, ob, PTCACHE_RESET_DEPSGRAPH);
- if(ob->recalc & OB_RECALC_DATA) {
+ if (ob->recalc & OB_RECALC_DATA) {
/* all users of this ob->data should be checked */
id= ob->data;
/* no point in trying in this cases */
- if(id && id->us <= 1) {
+ if (id && id->us <= 1) {
dag_editors_id_update(bmain, id);
id= NULL;
}
@@ -2491,12 +2500,12 @@ static void dag_id_flush_update(Scene *sce, ID *id)
}
/* set flags & pointcache for object data */
- if(id) {
+ if (id) {
idtype= GS(id->name);
- if(ELEM8(idtype, ID_ME, ID_CU, ID_MB, ID_LA, ID_LT, ID_CA, ID_AR, ID_SPK)) {
- for(obt=bmain->object.first; obt; obt= obt->id.next) {
- if(!(ob && obt == ob) && obt->data == id) {
+ if (ELEM8(idtype, ID_ME, ID_CU, ID_MB, ID_LA, ID_LT, ID_CA, ID_AR, ID_SPK)) {
+ for (obt=bmain->object.first; obt; obt= obt->id.next) {
+ if (!(ob && obt == ob) && obt->data == id) {
obt->recalc |= OB_RECALC_DATA;
lib_id_recalc_data_tag(bmain, &obt->id);
BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH);
@@ -2505,8 +2514,8 @@ static void dag_id_flush_update(Scene *sce, ID *id)
}
/* set flags based on textures - can influence depgraph via modifiers */
- if(idtype == ID_TE) {
- for(obt=bmain->object.first; obt; obt= obt->id.next) {
+ if (idtype == ID_TE) {
+ for (obt=bmain->object.first; obt; obt= obt->id.next) {
struct { ID *id; int is_dependent; } data;
data.id= id;
data.is_dependent= 0;
@@ -2518,21 +2527,21 @@ static void dag_id_flush_update(Scene *sce, ID *id)
}
/* particle settings can use the texture as well */
- if(obt->particlesystem.first) {
+ if (obt->particlesystem.first) {
ParticleSystem *psys = obt->particlesystem.first;
MTex **mtexp, *mtex;
int a;
- for(; psys; psys=psys->next) {
+ for (; psys; psys=psys->next) {
mtexp = psys->part->mtex;
- for(a=0; a<MAX_MTEX; a++, mtexp++) {
+ for (a=0; a<MAX_MTEX; a++, mtexp++) {
mtex = *mtexp;
- if(mtex && mtex->tex == (Tex*)id) {
+ if (mtex && mtex->tex == (Tex*)id) {
obt->recalc |= OB_RECALC_DATA;
lib_id_recalc_data_tag(bmain, &obt->id);
- if(mtex->mapto & PAMAP_INIT)
+ if (mtex->mapto & PAMAP_INIT)
psys->recalc |= PSYS_RECALC_RESET;
- if(mtex->mapto & PAMAP_CHILD)
+ if (mtex->mapto & PAMAP_CHILD)
psys->recalc |= PSYS_RECALC_CHILD;
BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH);
@@ -2544,10 +2553,10 @@ static void dag_id_flush_update(Scene *sce, ID *id)
}
/* set flags based on ShapeKey */
- if(idtype == ID_KE) {
- for(obt=bmain->object.first; obt; obt= obt->id.next) {
+ if (idtype == ID_KE) {
+ for (obt=bmain->object.first; obt; obt= obt->id.next) {
Key *key= ob_get_key(obt);
- if(!(ob && obt == ob) && ((ID *)key == id)) {
+ if (!(ob && obt == ob) && ((ID *)key == id)) {
obt->flag |= (OB_RECALC_OB|OB_RECALC_DATA);
lib_id_recalc_tag(bmain, &obt->id);
lib_id_recalc_data_tag(bmain, &obt->id);
@@ -2557,20 +2566,20 @@ static void dag_id_flush_update(Scene *sce, ID *id)
}
/* set flags based on particle settings */
- if(idtype == ID_PA) {
+ if (idtype == ID_PA) {
ParticleSystem *psys;
- for(obt=bmain->object.first; obt; obt= obt->id.next)
- for(psys=obt->particlesystem.first; psys; psys=psys->next)
- if(&psys->part->id == id)
+ for (obt=bmain->object.first; obt; obt= obt->id.next)
+ for (psys=obt->particlesystem.first; psys; psys=psys->next)
+ if (&psys->part->id == id)
BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH);
}
- if(idtype == ID_MC) {
- for(obt=bmain->object.first; obt; obt= obt->id.next) {
+ if (idtype == ID_MC) {
+ for (obt=bmain->object.first; obt; obt= obt->id.next) {
bConstraint *con;
for (con = obt->constraints.first; con; con=con->next) {
bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
- if(ELEM3(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER,
+ if (ELEM3(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER,
CONSTRAINT_TYPE_OBJECTSOLVER))
{
obt->recalc |= OB_RECALC_OB;
@@ -2579,11 +2588,11 @@ static void dag_id_flush_update(Scene *sce, ID *id)
}
}
- if(sce->nodetree) {
+ if (sce->nodetree) {
bNode *node;
- for(node= sce->nodetree->nodes.first; node; node= node->next) {
- if(node->id==id) {
+ for (node= sce->nodetree->nodes.first; node; node= node->next) {
+ if (node->id==id) {
nodeUpdate(sce->nodetree, node);
}
}
@@ -2591,10 +2600,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 */
@@ -2611,21 +2623,21 @@ void DAG_ids_flush_tagged(Main *bmain)
dag_current_scene_layers(bmain, &sce, &lay);
- if(!sce || !sce->theDag)
+ if (!sce || !sce->theDag)
return;
/* loop over all ID types */
a = set_listbasepointers(bmain, lbarray);
- while(a--) {
+ while (a--) {
ListBase *lb = lbarray[a];
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 */
- if(id && bmain->id_tag_update[id->name[0]]) {
- for(; id; id=id->next) {
- if(id->flag & (LIB_ID_RECALC|LIB_ID_RECALC_DATA)) {
+ * 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)) {
dag_id_flush_update(sce, id);
do_flush = 1;
}
@@ -2634,7 +2646,7 @@ void DAG_ids_flush_tagged(Main *bmain)
}
/* flush changes to other objects */
- if(do_flush)
+ if (do_flush)
DAG_scene_flush_update(bmain, sce, lay, 0);
}
@@ -2646,13 +2658,13 @@ void DAG_ids_check_recalc(Main *bmain, Scene *scene, int time)
/* loop over all ID types */
a = set_listbasepointers(bmain, lbarray);
- while(a--) {
+ while (a--) {
ListBase *lb = lbarray[a];
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 */
- if(id && bmain->id_tag_update[id->name[0]]) {
+ * looping over all ID's in case there are no tags */
+ if (id && bmain->id_tag_update[id->name[0]]) {
updated= 1;
break;
}
@@ -2669,15 +2681,15 @@ void DAG_ids_clear_recalc(Main *bmain)
/* loop over all ID types */
a = set_listbasepointers(bmain, lbarray);
- while(a--) {
+ while (a--) {
ListBase *lb = lbarray[a];
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 */
- if(id && bmain->id_tag_update[id->name[0]]) {
- for(; id; id=id->next)
- if(id->flag & (LIB_ID_RECALC|LIB_ID_RECALC_DATA))
+ * 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))
id->flag &= ~(LIB_ID_RECALC|LIB_ID_RECALC_DATA);
}
}
@@ -2689,34 +2701,34 @@ void DAG_id_tag_update(ID *id, short flag)
{
Main *bmain= G.main;
- if(id==NULL) return;
+ if (id==NULL) return;
/* tag ID for update */
- if(flag) {
- if(flag & OB_RECALC_OB)
+ if (flag) {
+ if (flag & OB_RECALC_OB)
lib_id_recalc_tag(bmain, id);
- if(flag & (OB_RECALC_DATA|PSYS_RECALC))
+ if (flag & (OB_RECALC_DATA|PSYS_RECALC))
lib_id_recalc_data_tag(bmain, id);
}
else
lib_id_recalc_tag(bmain, id);
/* flag is for objects and particle systems */
- if(flag) {
+ if (flag) {
Object *ob;
- ParticleSystem *psys;
short idtype = GS(id->name);
- if(idtype == ID_OB) {
+ if (idtype == ID_OB) {
/* only quick tag */
ob = (Object*)id;
ob->recalc |= (flag & OB_RECALC_ALL);
}
- else if(idtype == ID_PA) {
+ else if (idtype == ID_PA) {
+ ParticleSystem *psys;
/* this is weak still, should be done delayed as well */
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- if(&psys->part->id == id) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next) {
+ for (psys=ob->particlesystem.first; psys; psys=psys->next) {
+ if (&psys->part->id == id) {
ob->recalc |= (flag & OB_RECALC_ALL);
psys->recalc |= (flag & PSYS_RECALC);
lib_id_recalc_tag(bmain, &ob->id);
@@ -2752,20 +2764,20 @@ static int parent_check_node(DagNode *node, int curtime)
node->lasttime= curtime;
- if(node->color==DAG_GRAY)
+ if (node->color==DAG_GRAY)
return DAG_GRAY;
- for(itA = node->child; itA; itA= itA->next) {
- if(itA->node->type==ID_OB) {
+ for (itA = node->child; itA; itA= itA->next) {
+ if (itA->node->type==ID_OB) {
- if(itA->node->color==DAG_GRAY)
+ if (itA->node->color==DAG_GRAY)
return DAG_GRAY;
/* descend if not done */
- if(itA->node->lasttime!=curtime) {
+ if (itA->node->lasttime!=curtime) {
itA->node->color= parent_check_node(itA->node, curtime);
- if(itA->node->color==DAG_GRAY)
+ if (itA->node->color==DAG_GRAY)
return DAG_GRAY;
}
}
@@ -2798,12 +2810,12 @@ void DAG_pose_sort(Object *ob)
rootnode = dag_add_node(dag, NULL); // node->ob becomes NULL
/* we add the hierarchy and the constraints */
- for(pchan = pose->chanbase.first; pchan; pchan= pchan->next) {
+ for (pchan = pose->chanbase.first; pchan; pchan= pchan->next) {
int addtoroot = 1;
node = dag_get_node(dag, pchan);
- if(pchan->parent) {
+ if (pchan->parent) {
node2 = dag_get_node(dag, pchan->parent);
dag_add_relation(dag, node2, node, 0, "Parent Relation");
addtoroot = 0;
@@ -2829,7 +2841,7 @@ void DAG_pose_sort(Object *ob)
int segcount= 0;
/* exclude tip from chain? */
- if(!(data->flag & CONSTRAINT_IK_TIP))
+ if (!(data->flag & CONSTRAINT_IK_TIP))
parchan= pchan->parent;
else
parchan= pchan;
@@ -2865,20 +2877,20 @@ void DAG_pose_sort(Object *ob)
nqueue = queue_create(DAGQUEUEALLOC);
/* tag nodes unchecked */
- for(node = dag->DagNode.first; node; node= node->next)
+ for (node = dag->DagNode.first; node; node= node->next)
node->color = DAG_WHITE;
rootnode->color = DAG_GRAY;
push_stack(nqueue, rootnode);
- while(nqueue->count) {
+ while (nqueue->count) {
skip = 0;
node = get_top_node_queue(nqueue);
itA = node->child;
- while(itA != NULL) {
- if(itA->node->color == DAG_WHITE) {
+ while (itA != NULL) {
+ if (itA->node->color == DAG_WHITE) {
itA->node->color = DAG_GRAY;
push_stack(nqueue,itA->node);
skip = 1;
@@ -2902,7 +2914,7 @@ void DAG_pose_sort(Object *ob)
}
// temporal correction for circular dependancies
- while(pose->chanbase.first) {
+ while (pose->chanbase.first) {
pchan= pose->chanbase.first;
BLI_remlink(&pose->chanbase, pchan);
BLI_addhead(&tempbase, pchan);
@@ -2914,7 +2926,7 @@ void DAG_pose_sort(Object *ob)
queue_delete(nqueue);
// printf("\nordered\n");
-// for(pchan = pose->chanbase.first; pchan; pchan= pchan->next) {
+// for (pchan = pose->chanbase.first; pchan; pchan= pchan->next) {
// printf(" %s\n", pchan->name);
// }
@@ -2931,7 +2943,7 @@ void DAG_print_dependencies(Main *bmain, Scene *scene, Object *ob)
/* utility for debugging dependencies */
dag_print_dependencies= 1;
- if(ob && (ob->mode & OB_MODE_POSE)) {
+ if (ob && (ob->mode & OB_MODE_POSE)) {
printf("\nDEPENDENCY RELATIONS for %s\n\n", ob->id.name+2);
DAG_pose_sort(ob);
}
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index ea84f73b27f..c54461a5a13 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -62,19 +62,17 @@
#include "BLO_sys_types.h" // for intptr_t support
-extern Material defmaterial; /* material.c */
-
static void boundbox_displist(Object *ob);
void free_disp_elem(DispList *dl)
{
- if(dl) {
- if(dl->verts) MEM_freeN(dl->verts);
- if(dl->nors) MEM_freeN(dl->nors);
- if(dl->index) MEM_freeN(dl->index);
- if(dl->col1) MEM_freeN(dl->col1);
- if(dl->col2) MEM_freeN(dl->col2);
- if(dl->bevelSplitFlag) MEM_freeN(dl->bevelSplitFlag);
+ if (dl) {
+ if (dl->verts) MEM_freeN(dl->verts);
+ if (dl->nors) MEM_freeN(dl->nors);
+ if (dl->index) MEM_freeN(dl->index);
+ if (dl->col1) MEM_freeN(dl->col1);
+ if (dl->col2) MEM_freeN(dl->col2);
+ if (dl->bevelSplitFlag) MEM_freeN(dl->bevelSplitFlag);
MEM_freeN(dl);
}
}
@@ -84,7 +82,7 @@ void freedisplist(ListBase *lb)
DispList *dl;
dl= lb->first;
- while(dl) {
+ while (dl) {
BLI_remlink(lb, dl);
free_disp_elem(dl);
dl= lb->first;
@@ -96,8 +94,8 @@ DispList *find_displist_create(ListBase *lb, int type)
DispList *dl;
dl= lb->first;
- while(dl) {
- if(dl->type==type) return dl;
+ while (dl) {
+ if (dl->type==type) return dl;
dl= dl->next;
}
@@ -113,8 +111,8 @@ DispList *find_displist(ListBase *lb, int type)
DispList *dl;
dl= lb->first;
- while(dl) {
- if(dl->type==type) return dl;
+ while (dl) {
+ if (dl->type==type) return dl;
dl= dl->next;
}
@@ -124,9 +122,10 @@ DispList *find_displist(ListBase *lb, int type)
int displist_has_faces(ListBase *lb)
{
DispList *dl;
- for(dl= lb->first; dl; dl= dl->next) {
- if ELEM3(dl->type, DL_INDEX3, DL_INDEX4, DL_SURF)
+ for (dl= lb->first; dl; dl= dl->next) {
+ if (ELEM3(dl->type, DL_INDEX3, DL_INDEX4, DL_SURF)) {
return 1;
+ }
}
return 0;
}
@@ -138,7 +137,7 @@ void copy_displist(ListBase *lbn, ListBase *lb)
freedisplist(lbn);
dl= lb->first;
- while(dl) {
+ while (dl) {
dln= MEM_dupallocN(dl);
BLI_addtail(lbn, dln);
@@ -148,7 +147,7 @@ void copy_displist(ListBase *lbn, ListBase *lb)
dln->col1= MEM_dupallocN(dl->col1);
dln->col2= MEM_dupallocN(dl->col2);
- if(dl->bevelSplitFlag)
+ if (dl->bevelSplitFlag)
dln->bevelSplitFlag= MEM_dupallocN(dl->bevelSplitFlag);
dl= dl->next;
@@ -166,22 +165,22 @@ void addnormalsDispList(ListBase *lb)
dl= lb->first;
- while(dl) {
- if(dl->type==DL_INDEX3) {
- if(dl->nors==NULL) {
+ while (dl) {
+ if (dl->type==DL_INDEX3) {
+ if (dl->nors==NULL) {
dl->nors= MEM_callocN(sizeof(float)*3, "dlnors");
- if(dl->verts[2] < 0.0f) dl->nors[2]= -1.0f;
+ if (dl->verts[2] < 0.0f) dl->nors[2]= -1.0f;
else dl->nors[2]= 1.0f;
}
}
- else if(dl->type==DL_SURF) {
- if(dl->nors==NULL) {
+ else if (dl->type==DL_SURF) {
+ if (dl->nors==NULL) {
dl->nors= MEM_callocN(sizeof(float)*3*dl->nr*dl->parts, "dlnors");
vdata= dl->verts;
ndata= dl->nors;
- for(a=0; a<dl->parts; a++) {
+ for (a=0; a<dl->parts; a++) {
if (surfindex_displist(dl, a, &b, &p1, &p2, &p3, &p4)==0)
break;
@@ -195,7 +194,7 @@ void addnormalsDispList(ListBase *lb)
v4= vdata+ 3*p4;
n4= ndata+ 3*p4;
- for(; b<dl->nr; b++) {
+ for (; b<dl->nr; b++) {
normal_quad_v3( nor,v1, v3, v4, v2);
@@ -212,7 +211,7 @@ void addnormalsDispList(ListBase *lb)
}
a= dl->parts*dl->nr;
v1= ndata;
- while(a--) {
+ while (a--) {
normalize_v3(v1);
v1+= 3;
}
@@ -227,7 +226,7 @@ void count_displist(ListBase *lb, int *totvert, int *totface)
DispList *dl;
dl= lb->first;
- while(dl) {
+ while (dl) {
switch(dl->type) {
case DL_SURF:
@@ -250,17 +249,18 @@ void count_displist(ListBase *lb, int *totvert, int *totface)
int surfindex_displist(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4)
{
- if((dl->flag & DL_CYCL_V)==0 && a==(dl->parts)-1) {
+ if ((dl->flag & DL_CYCL_V)==0 && a==(dl->parts)-1) {
return 0;
}
- if(dl->flag & DL_CYCL_U) {
+ if (dl->flag & DL_CYCL_U) {
(*p1)= dl->nr*a;
(*p2)= (*p1)+ dl->nr-1;
(*p3)= (*p1)+ dl->nr;
(*p4)= (*p2)+ dl->nr;
(*b)= 0;
- } else {
+ }
+ else {
(*p2)= dl->nr*a;
(*p1)= (*p2)+1;
(*p4)= (*p2)+ dl->nr;
@@ -268,7 +268,7 @@ int surfindex_displist(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, i
(*b)= 1;
}
- if( (dl->flag & DL_CYCL_V) && a==dl->parts-1) {
+ if ( (dl->flag & DL_CYCL_V) && a==dl->parts-1) {
(*p3)-= dl->nr*dl->parts;
(*p4)-= dl->nr*dl->parts;
}
@@ -288,31 +288,31 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
int a, len, resolu;
nu= nubase->first;
- while(nu) {
- if(nu->hide==0) {
+ while (nu) {
+ if (nu->hide==0) {
- if(forRender && cu->resolu_ren!=0)
+ if (forRender && cu->resolu_ren!=0)
resolu= cu->resolu_ren;
else
resolu= nu->resolu;
- if(!check_valid_nurb_u(nu));
- else if(nu->type == CU_BEZIER) {
+ if (!check_valid_nurb_u(nu));
+ else if (nu->type == CU_BEZIER) {
/* count */
len= 0;
a= nu->pntsu-1;
- if(nu->flagu & CU_NURB_CYCLIC) a++;
+ if (nu->flagu & CU_NURB_CYCLIC) a++;
prevbezt= nu->bezt;
bezt= prevbezt+1;
- while(a--) {
- if(a==0 && (nu->flagu & CU_NURB_CYCLIC)) bezt= nu->bezt;
+ while (a--) {
+ if (a==0 && (nu->flagu & CU_NURB_CYCLIC)) bezt= nu->bezt;
- if(prevbezt->h2==HD_VECT && bezt->h1==HD_VECT) len++;
+ if (prevbezt->h2==HD_VECT && bezt->h1==HD_VECT) len++;
else len+= resolu;
- if(a==0 && (nu->flagu & CU_NURB_CYCLIC)==0) len++;
+ if (a==0 && (nu->flagu & CU_NURB_CYCLIC)==0) len++;
prevbezt= bezt;
bezt++;
@@ -329,7 +329,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
data= dl->verts;
- if(nu->flagu & CU_NURB_CYCLIC) {
+ if (nu->flagu & CU_NURB_CYCLIC) {
dl->type= DL_POLY;
a= nu->pntsu;
}
@@ -341,16 +341,16 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
prevbezt= nu->bezt;
bezt= prevbezt+1;
- while(a--) {
- if(a==0 && dl->type== DL_POLY) bezt= nu->bezt;
+ while (a--) {
+ if (a==0 && dl->type== DL_POLY) bezt= nu->bezt;
- if(prevbezt->h2==HD_VECT && bezt->h1==HD_VECT) {
+ if (prevbezt->h2==HD_VECT && bezt->h1==HD_VECT) {
copy_v3_v3(data, prevbezt->vec[1]);
data+= 3;
}
else {
int j;
- for(j=0; j<3; j++) {
+ for (j=0; j<3; j++) {
forward_diff_bezier( prevbezt->vec[1][j],
prevbezt->vec[2][j],
bezt->vec[0][j],
@@ -361,7 +361,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
data+= 3*resolu;
}
- if(a==0 && dl->type==DL_SEGM) {
+ if (a==0 && dl->type==DL_SEGM) {
copy_v3_v3(data, bezt->vec[1]);
}
@@ -369,7 +369,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
bezt++;
}
}
- else if(nu->type == CU_NURBS) {
+ else if (nu->type == CU_NURBS) {
len= (resolu*SEGMENTSU(nu));
dl= MEM_callocN(sizeof(DispList), "makeDispListsurf");
@@ -382,11 +382,11 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
dl->charidx = nu->charidx;
data= dl->verts;
- if(nu->flagu & CU_NURB_CYCLIC) dl->type= DL_POLY;
+ if (nu->flagu & CU_NURB_CYCLIC) dl->type= DL_POLY;
else dl->type= DL_SEGM;
makeNurbcurve(nu, data, NULL, NULL, NULL, resolu, 3*sizeof(float));
}
- else if(nu->type == CU_POLY) {
+ else if (nu->type == CU_POLY) {
len= nu->pntsu;
dl= MEM_callocN(sizeof(DispList), "makeDispListpoly");
dl->verts= MEM_callocN(len*3*sizeof(float), "dlverts");
@@ -397,12 +397,12 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
dl->charidx = nu->charidx;
data= dl->verts;
- if(nu->flagu & CU_NURB_CYCLIC) dl->type= DL_POLY;
+ if (nu->flagu & CU_NURB_CYCLIC) dl->type= DL_POLY;
else dl->type= DL_SEGM;
a= len;
bp= nu->bp;
- while(a--) {
+ while (a--) {
copy_v3_v3(data, bp->vec);
bp++;
data+= 3;
@@ -423,10 +423,10 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
int colnr=0, charidx=0, cont=1, tot, a, *index, nextcol= 0;
intptr_t totvert;
- if(dispbase==NULL) return;
- if(dispbase->first==NULL) return;
+ if (dispbase==NULL) return;
+ if (dispbase->first==NULL) return;
- while(cont) {
+ while (cont) {
cont= 0;
totvert= 0;
nextcol= 0;
@@ -434,34 +434,35 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
BLI_begin_edgefill();
dl= dispbase->first;
- while(dl) {
+ while (dl) {
- if(dl->type==DL_POLY) {
- if(charidx<dl->charidx) cont= 1;
- else if(charidx==dl->charidx) { /* character with needed index */
- if(colnr==dl->col) {
+ if (dl->type==DL_POLY) {
+ if (charidx<dl->charidx) cont= 1;
+ else if (charidx==dl->charidx) { /* character with needed index */
+ if (colnr==dl->col) {
/* make editverts and edges */
f1= dl->verts;
a= dl->nr;
eve= v1= NULL;
- while(a--) {
+ while (a--) {
vlast= eve;
eve= BLI_addfillvert(f1);
totvert++;
- if(vlast==NULL) v1= eve;
+ if (vlast==NULL) v1= eve;
else {
BLI_addfilledge(vlast, eve);
}
f1+=3;
}
- if(eve!=NULL && v1!=NULL) {
+ if (eve!=NULL && v1!=NULL) {
BLI_addfilledge(eve, v1);
}
- } else if (colnr<dl->col) {
+ }
+ else if (colnr<dl->col) {
/* got poly with next material at current char */
cont= 1;
nextcol= 1;
@@ -471,8 +472,8 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
dl= dl->next;
}
- if(totvert && (tot= BLI_edgefill(0))) { // XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) {
- if(tot) {
+ if (totvert && (tot= BLI_edgefill(0))) { // XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) {
+ if (tot) {
dlnew= MEM_callocN(sizeof(DispList), "filldisplist");
dlnew->type= DL_INDEX3;
dlnew->col= colnr;
@@ -486,7 +487,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
f1= dlnew->verts;
totvert= 0;
eve= fillvertbase.first;
- while(eve) {
+ while (eve) {
copy_v3_v3(f1, eve->co);
f1+= 3;
@@ -500,12 +501,12 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
/* index data */
efa= fillfacebase.first;
index= dlnew->index;
- while(efa) {
+ while (efa) {
index[0]= (intptr_t)efa->v1->tmp.l;
index[1]= (intptr_t)efa->v2->tmp.l;
index[2]= (intptr_t)efa->v3->tmp.l;
- if(flipnormal)
+ if (flipnormal)
SWAP(int, index[0], index[2]);
index+= 3;
@@ -518,10 +519,11 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
}
BLI_end_edgefill();
- if(nextcol) {
+ if (nextcol) {
/* stay at current char but fill polys with next material */
colnr++;
- } else {
+ }
+ else {
/* switch to next char and start filling from first material */
charidx++;
colnr= 0;
@@ -542,10 +544,10 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
front.first= front.last= back.first= back.last= NULL;
dl= dispbase->first;
- while(dl) {
- if(dl->type==DL_SURF) {
- if( (dl->flag & DL_CYCL_V) && (dl->flag & DL_CYCL_U)==0 ) {
- if( (cu->flag & CU_BACK) && (dl->flag & DL_BACK_CURVE) ) {
+ while (dl) {
+ if (dl->type==DL_SURF) {
+ if ( (dl->flag & DL_CYCL_V) && (dl->flag & DL_CYCL_U)==0 ) {
+ if ( (cu->flag & CU_BACK) && (dl->flag & DL_BACK_CURVE) ) {
dlnew= MEM_callocN(sizeof(DispList), "filldisp");
BLI_addtail(&front, dlnew);
dlnew->verts= fp1= MEM_mallocN(sizeof(float)*3*dl->parts, "filldisp1");
@@ -559,13 +561,13 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
dpoly= 3*dl->nr;
a= dl->parts;
- while(a--) {
+ while (a--) {
copy_v3_v3(fp1, fp);
fp1+= 3;
fp+= dpoly;
}
}
- if( (cu->flag & CU_FRONT) && (dl->flag & DL_FRONT_CURVE) ) {
+ if ( (cu->flag & CU_FRONT) && (dl->flag & DL_FRONT_CURVE) ) {
dlnew= MEM_callocN(sizeof(DispList), "filldisp");
BLI_addtail(&back, dlnew);
dlnew->verts= fp1= MEM_mallocN(sizeof(float)*3*dl->parts, "filldisp1");
@@ -579,7 +581,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
dpoly= 3*dl->nr;
a= dl->parts;
- while(a--) {
+ while (a--) {
copy_v3_v3(fp1, fp);
fp1+= 3;
fp+= dpoly;
@@ -602,9 +604,9 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
static void curve_to_filledpoly(Curve *cu, ListBase *UNUSED(nurb), ListBase *dispbase)
{
- if(cu->flag & CU_3D) return;
+ if (cu->flag & CU_3D) return;
- if(dispbase->first && ((DispList*) dispbase->first)->type==DL_SURF) {
+ if (dispbase->first && ((DispList*) dispbase->first)->type==DL_SURF) {
bevels_to_filledpoly(cu, dispbase);
}
else {
@@ -613,22 +615,22 @@ 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;
- if(taperobj==NULL || taperobj->type!=OB_CURVE) return 1.0;
+ if (taperobj==NULL || taperobj->type!=OB_CURVE) return 1.0;
dl= taperobj->disp.first;
- if(dl==NULL) {
+ if (dl==NULL) {
makeDispListCurveTypes(scene, taperobj, 0);
dl= taperobj->disp.first;
}
- if(dl) {
+ if (dl) {
float fac= ((float)cur)/(float)(tot-1);
float minx, dx, *fp;
int a;
@@ -636,16 +638,16 @@ float calc_taper(Scene *scene, Object *taperobj, int cur, int tot)
/* horizontal size */
minx= dl->verts[0];
dx= dl->verts[3*(dl->nr-1)] - minx;
- if(dx > 0.0f) {
+ if (dx > 0.0f) {
fp= dl->verts;
- for(a=0; a<dl->nr; a++, fp+=3) {
- if( (fp[0]-minx)/dx >= fac) {
+ for (a=0; a<dl->nr; a++, fp+=3) {
+ if ( (fp[0]-minx)/dx >= fac) {
/* interpolate with prev */
- if(a>0) {
+ if (a>0) {
float fac1= (fp[-3]-minx)/dx;
float fac2= (fp[0]-minx)/dx;
- if(fac1!=fac2)
+ if (fac1!=fac2)
return fp[1]*(fac1-fac)/(fac1-fac2) + fp[-2]*(fac-fac2)/(fac1-fac2);
}
return fp[1];
@@ -660,16 +662,16 @@ float calc_taper(Scene *scene, Object *taperobj, int cur, int tot)
void makeDispListMBall(Scene *scene, Object *ob)
{
- if(!ob || ob->type!=OB_MBALL) return;
+ if (!ob || ob->type!=OB_MBALL) return;
// XXX: mball stuff uses plenty of global variables
// while this is unchanged updating during render is unsafe
- if(G.rendering) return;
+ if (G.rendering) return;
freedisplist(&(ob->disp));
- if(ob->type==OB_MBALL) {
- if(ob==find_basis_mball(scene, ob)) {
+ if (ob->type==OB_MBALL) {
+ if (ob==find_basis_mball(scene, ob)) {
metaball_polygonize(scene, ob, &ob->disp);
tex_space_mball(ob);
@@ -688,43 +690,44 @@ void makeDispListMBall_forRender(Scene *scene, Object *ob, ListBase *dispbase)
object_deform_mball(ob, dispbase);
}
-static ModifierData *curve_get_tesselate_point(Scene *scene, Object *ob, int forRender, int editmode)
+static ModifierData *curve_get_tessellate_point(Scene *scene, Object *ob, int forRender, int editmode)
{
ModifierData *md = modifiers_getVirtualModifierList(ob);
- ModifierData *preTesselatePoint;
+ ModifierData *pretessellatePoint;
int required_mode;
- if(forRender) required_mode = eModifierMode_Render;
+ if (forRender) required_mode = eModifierMode_Render;
else required_mode = eModifierMode_Realtime;
- if(editmode) required_mode |= eModifierMode_Editmode;
+ if (editmode) required_mode |= eModifierMode_Editmode;
- preTesselatePoint = NULL;
+ pretessellatePoint = NULL;
for (; md; md=md->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
if (!modifier_isEnabled(scene, md, required_mode)) continue;
- if (mti->type == eModifierTypeType_Constructive) return preTesselatePoint;
+ if (mti->type == eModifierTypeType_Constructive) return pretessellatePoint;
if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
- preTesselatePoint = md;
+ pretessellatePoint = md;
- /* this modifiers are moving point of tesselation automatically
- (some of them even can't be applied on tesselated curve), set flag
- for incformation button in modifier's header */
+ /* this modifiers are moving point of tessellation automatically
+ * (some of them even can't be applied on tessellated curve), set flag
+ * for incformation button in modifier's header */
md->mode |= eModifierMode_ApplyOnSpline;
- } else if(md->mode&eModifierMode_ApplyOnSpline) {
- preTesselatePoint = md;
+ }
+ else if (md->mode&eModifierMode_ApplyOnSpline) {
+ pretessellatePoint = md;
}
}
- return preTesselatePoint;
+ return pretessellatePoint;
}
static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, float (**originalVerts_r)[3], float (**deformedVerts_r)[3], int *numVerts_r)
{
ModifierData *md = modifiers_getVirtualModifierList(ob);
- ModifierData *preTesselatePoint;
+ ModifierData *pretessellatePoint;
Curve *cu= ob->data;
ListBase *nurb= BKE_curve_nurbs(cu);
int numVerts = 0;
@@ -734,27 +737,28 @@ static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, fl
float *keyVerts= NULL;
int required_mode;
- if(forRender) required_mode = eModifierMode_Render;
+ if (forRender) required_mode = eModifierMode_Render;
else required_mode = eModifierMode_Realtime;
- preTesselatePoint = curve_get_tesselate_point(scene, ob, forRender, editmode);
+ pretessellatePoint = curve_get_tessellate_point(scene, ob, forRender, editmode);
- if(editmode) required_mode |= eModifierMode_Editmode;
+ if (editmode) required_mode |= eModifierMode_Editmode;
- if(cu->editnurb==NULL) {
+ if (cu->editnurb==NULL) {
keyVerts= do_ob_key(scene, ob);
- if(keyVerts) {
+ 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);
+ numVerts = count_curveverts_without_handles(nurb);
}
}
- if (preTesselatePoint) {
+ if (pretessellatePoint) {
for (; md; md=md->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
@@ -771,7 +775,7 @@ static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, fl
mti->deformVerts(md, ob, NULL, deformedVerts, numVerts, forRender, editmode);
- if (md==preTesselatePoint)
+ if (md==pretessellatePoint)
break;
}
}
@@ -781,7 +785,7 @@ static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, fl
if (keyVerts) /* these are not passed through modifier stack */
curve_applyKeyVertexTilts(cu, nurb, keyVerts);
- if(keyVerts)
+ if (keyVerts)
MEM_freeN(keyVerts);
*originalVerts_r = originalVerts;
@@ -827,7 +831,7 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
DerivedMesh **derivedFinal, int forRender, float (*originalVerts)[3], float (*deformedVerts)[3])
{
ModifierData *md = modifiers_getVirtualModifierList(ob);
- ModifierData *preTesselatePoint;
+ ModifierData *pretessellatePoint;
Curve *cu= ob->data;
ListBase *nurb= BKE_curve_nurbs(cu);
int required_mode = 0, totvert = 0;
@@ -836,15 +840,15 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
float (*vertCos)[3] = NULL;
int useCache = !forRender;
- if(forRender) required_mode = eModifierMode_Render;
+ if (forRender) required_mode = eModifierMode_Render;
else required_mode = eModifierMode_Realtime;
- preTesselatePoint = curve_get_tesselate_point(scene, ob, forRender, editmode);
+ pretessellatePoint = curve_get_tessellate_point(scene, ob, forRender, editmode);
- if(editmode) required_mode |= eModifierMode_Editmode;
+ if (editmode) required_mode |= eModifierMode_Editmode;
- if (preTesselatePoint) {
- md = preTesselatePoint->next;
+ if (pretessellatePoint) {
+ md = pretessellatePoint->next;
}
if (derivedFinal && *derivedFinal) {
@@ -869,14 +873,16 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
}
mti->deformVerts(md, ob, dm, vertCos, totvert, forRender, editmode);
- } else {
+ }
+ else {
if (!vertCos) {
vertCos= displist_get_allverts(dispbase, &totvert);
}
mti->deformVerts(md, ob, NULL, vertCos, totvert, forRender, editmode);
}
- } else {
+ }
+ else {
if (!derivedFinal) {
/* makeDisplistCurveTypes could be used for beveling, where derived mesh */
/* is totally unnecessary, so we could stop modifiers applying */
@@ -893,7 +899,8 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
CDDM_apply_vert_coords(dm, vertCos);
CDDM_calc_normals_mapping(dm);
}
- } else {
+ }
+ else {
if (vertCos) {
displist_apply_allverts(dispbase, vertCos);
}
@@ -934,7 +941,8 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
CDDM_apply_vert_coords(dm, vertCos);
CDDM_calc_normals_mapping(dm);
MEM_freeN(vertCos);
- } else {
+ }
+ else {
displist_apply_allverts(dispbase, vertCos);
MEM_freeN(vertCos);
vertCos= NULL;
@@ -962,12 +970,12 @@ static void displist_surf_indices(DispList *dl)
index=dl->index= MEM_mallocN( 4*sizeof(int)*(dl->parts+1)*(dl->nr+1), "index array nurbs");
- for(a=0; a<dl->parts; a++) {
+ for (a=0; a<dl->parts; a++) {
if (surfindex_displist(dl, a, &b, &p1, &p2, &p3, &p4)==0)
break;
- for(; b<dl->nr; b++, index+=4) {
+ for (; b<dl->nr; b++, index+=4) {
index[0]= p1;
index[1]= p2;
index[2]= p4;
@@ -1005,10 +1013,10 @@ static void add_orco_dm(Scene *scene, Object *ob, DerivedMesh *dm, DerivedMesh *
totvert= dm->getNumVerts(dm);
- if(orcodm) {
+ if (orcodm) {
orco= MEM_callocN(sizeof(float)*3*totvert, "dm orco");
- if(orcodm->getNumVerts(orcodm) == totvert)
+ if (orcodm->getNumVerts(orcodm) == totvert)
orcodm->getVertCos(orcodm, orco);
else
dm->getVertCos(dm, orco);
@@ -1017,14 +1025,14 @@ static void add_orco_dm(Scene *scene, Object *ob, DerivedMesh *dm, DerivedMesh *
orco= (float(*)[3])make_orco_curve(scene, ob);
}
- for(a=0; a<totvert; a++) {
+ for (a=0; a<totvert; a++) {
float *co = orco[a];
co[0] = (co[0]-cu->loc[0])/cu->size[0];
co[1] = (co[1]-cu->loc[1])/cu->size[1];
co[2] = (co[2]-cu->loc[2])/cu->size[2];
}
- if((layerorco = DM_get_vert_data_layer(dm, CD_ORCO))) {
+ if ((layerorco = DM_get_vert_data_layer(dm, CD_ORCO))) {
memcpy(layerorco, orco, sizeof(float)*totvert);
MEM_freeN(orco);
}
@@ -1038,21 +1046,21 @@ static void curve_calc_orcodm(Scene *scene, Object *ob, DerivedMesh *derivedFina
/* for displist-based objects */
ModifierData *md = modifiers_getVirtualModifierList(ob);
- ModifierData *preTesselatePoint;
+ ModifierData *pretessellatePoint;
Curve *cu= ob->data;
int required_mode;
int editmode = (!forRender && cu->editnurb);
DerivedMesh *ndm, *orcodm= NULL;
- if(forRender) required_mode = eModifierMode_Render;
+ if (forRender) required_mode = eModifierMode_Render;
else required_mode = eModifierMode_Realtime;
- preTesselatePoint = curve_get_tesselate_point(scene, ob, forRender, editmode);
+ pretessellatePoint = curve_get_tessellate_point(scene, ob, forRender, editmode);
- if(editmode) required_mode |= eModifierMode_Editmode;
+ if (editmode) required_mode |= eModifierMode_Editmode;
- if (preTesselatePoint) {
- md = preTesselatePoint->next;
+ if (pretessellatePoint) {
+ md = pretessellatePoint->next;
}
for (; md; md=md->next) {
@@ -1064,14 +1072,14 @@ static void curve_calc_orcodm(Scene *scene, Object *ob, DerivedMesh *derivedFina
if (mti->isDisabled && mti->isDisabled(md, forRender)) continue;
if (mti->type!=eModifierTypeType_Constructive) continue;
- if(!orcodm)
+ if (!orcodm)
orcodm= create_orco_dm(scene, ob);
ndm = mti->applyModifier(md, ob, orcodm, forRender, 0);
- if(ndm) {
+ if (ndm) {
/* if the modifier returned a new dm, release the old one */
- if(orcodm && orcodm != ndm) {
+ if (orcodm && orcodm != ndm) {
orcodm->release(orcodm);
}
orcodm = ndm;
@@ -1081,7 +1089,7 @@ static void curve_calc_orcodm(Scene *scene, Object *ob, DerivedMesh *derivedFina
/* add an orco layer if needed */
add_orco_dm(scene, ob, derivedFinal, orcodm);
- if(orcodm)
+ if (orcodm)
orcodm->release(orcodm);
}
@@ -1098,24 +1106,24 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
float (*originalVerts)[3];
float (*deformedVerts)[3];
- if(!forRender && cu->editnurb)
+ if (!forRender && cu->editnurb)
nubase= curve_editnurbs(cu);
else
nubase= &cu->nurb;
- if(!forOrco)
+ if (!forOrco)
curve_calc_modifiers_pre(scene, ob, forRender, &originalVerts, &deformedVerts, &numVerts);
for (nu=nubase->first; nu; nu=nu->next) {
- if(forRender || nu->hide==0) {
+ if (forRender || nu->hide==0) {
int resolu= nu->resolu, resolv= nu->resolv;
- if(forRender) {
- if(cu->resolu_ren) resolu= cu->resolu_ren;
- if(cu->resolv_ren) resolv= cu->resolv_ren;
+ if (forRender) {
+ if (cu->resolu_ren) resolu= cu->resolu_ren;
+ if (cu->resolv_ren) resolv= cu->resolv_ren;
}
- if(nu->pntsv==1) {
+ if (nu->pntsv==1) {
len= SEGMENTSU(nu)*resolu;
dl= MEM_callocN(sizeof(DispList), "makeDispListsurf");
@@ -1132,7 +1140,7 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
dl->rt= nu->flag & ~CU_2D;
data= dl->verts;
- if(nu->flagu & CU_NURB_CYCLIC) dl->type= DL_POLY;
+ if (nu->flagu & CU_NURB_CYCLIC) dl->type= DL_POLY;
else dl->type= DL_SEGM;
makeNurbcurve(nu, data, NULL, NULL, NULL, resolu, 3*sizeof(float));
@@ -1156,8 +1164,8 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
dl->parts= (nu->pntsu*resolu); /* in reverse, because makeNurbfaces works that way */
dl->nr= (nu->pntsv*resolv);
- if(nu->flagv & CU_NURB_CYCLIC) dl->flag|= DL_CYCL_U; /* reverse too! */
- if(nu->flagu & CU_NURB_CYCLIC) dl->flag|= DL_CYCL_V;
+ if (nu->flagv & CU_NURB_CYCLIC) dl->flag|= DL_CYCL_U; /* reverse too! */
+ if (nu->flagu & CU_NURB_CYCLIC) dl->flag|= DL_CYCL_V;
makeNurbfaces(nu, data, 0, resolu, resolv);
@@ -1168,15 +1176,15 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
}
/* make copy of 'undeformed" displist for texture space calculation
- actually, it's not totally undeformed -- pre-tesselation modifiers are
- 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) {
tex_space_curve(cu);
}
- if(!forOrco)
+ if (!forOrco)
curve_calc_modifiers_post(scene, ob, dispbase, derivedFinal,
forRender, originalVerts, deformedVerts);
}
@@ -1188,7 +1196,7 @@ static void rotateBevelPiece(Curve *cu, BevPoint *bevp, DispList *dlb, float wid
fp = dlb->verts;
for (b = 0; b<dlb->nr; b++,fp += 3,data += 3) {
- if(cu->flag & CU_3D) {
+ if (cu->flag & CU_3D) {
float vec[3];
vec[0] = fp[1]+widfac;
@@ -1241,9 +1249,9 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
Curve *cu = ob->data;
/* we do allow duplis... this is only displist on curve level */
- if(!ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT)) return;
+ if (!ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT)) return;
- if(ob->type==OB_SURF) {
+ if (ob->type==OB_SURF) {
makeDispListSurf(scene, ob, dispbase, derivedFinal, forRender, forOrco);
}
else if (ELEM(ob->type, OB_CURVE, OB_FONT)) {
@@ -1257,12 +1265,12 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
BLI_freelistN(&(cu->bev));
- if(cu->path) free_path(cu->path);
+ if (cu->path) free_path(cu->path);
cu->path= NULL;
- if(ob->type==OB_FONT) BKE_text_to_curve(G.main, scene, ob, 0);
+ if (ob->type==OB_FONT) BKE_text_to_curve(G.main, scene, ob, 0);
- if(!forOrco) curve_calc_modifiers_pre(scene, ob, forRender, &originalVerts, &deformedVerts, &numVerts);
+ if (!forOrco) curve_calc_modifiers_pre(scene, ob, forRender, &originalVerts, &deformedVerts, &numVerts);
makeBevelList(ob);
@@ -1272,7 +1280,8 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
/* no bevel or extrude, and no width correction? */
if (!dlbev.first && cu->width==1.0f) {
curve_to_displist(cu, nubase, dispbase, forRender);
- } else {
+ }
+ else {
float widfac= cu->width - 1.0f;
BevList *bl= cu->bev.first;
Nurb *nu= nubase->first;
@@ -1286,15 +1295,15 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
if (bl->nr) { /* blank bevel lists can happen */
/* exception handling; curve without bevel or extrude, with width correction */
- if(dlbev.first==NULL) {
+ if (dlbev.first==NULL) {
dl= MEM_callocN(sizeof(DispList), "makeDispListbev");
dl->verts= MEM_callocN(3*sizeof(float)*bl->nr, "dlverts");
BLI_addtail(dispbase, dl);
- if(bl->poly!= -1) dl->type= DL_POLY;
+ if (bl->poly!= -1) dl->type= DL_POLY;
else dl->type= DL_SEGM;
- if(dl->type==DL_SEGM) dl->flag = (DL_FRONT_CURVE|DL_BACK_CURVE);
+ if (dl->type==DL_SEGM) dl->flag = (DL_FRONT_CURVE|DL_BACK_CURVE);
dl->parts= 1;
dl->nr= bl->nr;
@@ -1308,7 +1317,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
a= dl->nr;
bevp= (BevPoint *)(bl+1);
data= dl->verts;
- while(a--) {
+ while (a--) {
data[0]= bevp->vec[0]+widfac*bevp->sina;
data[1]= bevp->vec[1]+widfac*bevp->cosa;
data[2]= bevp->vec[2];
@@ -1330,8 +1339,8 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
dl->type= DL_SURF;
dl->flag= dlb->flag & (DL_FRONT_CURVE|DL_BACK_CURVE);
- if(dlb->type==DL_POLY) dl->flag |= DL_CYCL_U;
- if(bl->poly>=0) dl->flag |= DL_CYCL_V;
+ if (dlb->type==DL_POLY) dl->flag |= DL_CYCL_U;
+ if (bl->poly>=0) dl->flag |= DL_CYCL_V;
dl->parts= bl->nr;
dl->nr= dlb->nr;
@@ -1346,12 +1355,13 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
/* for each point of poly make a bevel piece */
bevp= (BevPoint *)(bl+1);
- for(a=0; a<bl->nr; a++,bevp++) {
+ for (a=0; a<bl->nr; a++,bevp++) {
float fac=1.0;
if (cu->taperobj==NULL) {
if ( (cu->bevobj!=NULL) || !((cu->flag & CU_FRONT) || (cu->flag & CU_BACK)) )
fac = bevp->radius;
- } else {
+ }
+ else {
fac = calc_taper(scene, cu->taperobj, a, bl->nr);
}
@@ -1374,7 +1384,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
displist_surf_indices(dl);
}
- if(bottom_capbase.first) {
+ if (bottom_capbase.first) {
filldisplist(&bottom_capbase, dispbase, 1);
filldisplist(&top_capbase, dispbase, 0);
freedisplist(&bottom_capbase);
@@ -1391,18 +1401,18 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
curve_to_filledpoly(cu, nubase, dispbase);
}
- if(cu->flag & CU_PATH) calc_curvepath(ob);
+ if ((cu->flag & CU_PATH) && !forOrco) calc_curvepath(ob);
/* make copy of 'undeformed" displist for texture space calculation
- actually, it's not totally undeformed -- pre-tesselation 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) {
tex_space_curve(cu);
}
- if(!forOrco) curve_calc_modifiers_post(scene, ob, dispbase, derivedFinal, forRender, originalVerts, deformedVerts);
+ if (!forOrco) curve_calc_modifiers_post(scene, ob, dispbase, derivedFinal, forRender, originalVerts, deformedVerts);
if (cu->flag & CU_DEFORM_FILL && !ob->derivedFinal) {
curve_to_filledpoly(cu, nubase, dispbase);
@@ -1416,9 +1426,9 @@ 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. */
- if(!ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT)) return;
+ * 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));
dispbase= &(ob->disp);
@@ -1431,7 +1441,8 @@ void makeDispListCurveTypes(Scene *scene, Object *ob, int forOrco)
if (ob->derivedFinal) {
DM_set_object_boundbox (ob, ob->derivedFinal);
- } else {
+ }
+ else {
boundbox_displist (ob);
/* if there is no derivedMesh, object's boundbox is unneeded */
@@ -1467,7 +1478,7 @@ float *makeOrcoDispList(Scene *scene, Object *ob, DerivedMesh *derivedFinal, int
orco= derivedFinal->getVertDataArray(derivedFinal, CD_ORCO);
- if(orco) {
+ if (orco) {
orco= MEM_dupallocN(orco);
}
@@ -1485,21 +1496,21 @@ static void boundbox_displist(Object *ob)
INIT_MINMAX(min, max);
- if(ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
+ if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
Curve *cu= ob->data;
int doit= 0;
- if(cu->bb==NULL) cu->bb= MEM_callocN(sizeof(BoundBox), "boundbox");
+ if (cu->bb==NULL) cu->bb= MEM_callocN(sizeof(BoundBox), "boundbox");
bb= cu->bb;
dl= ob->disp.first;
while (dl) {
- if(dl->type==DL_INDEX3) tot= dl->nr;
+ if (dl->type==DL_INDEX3) tot= dl->nr;
else tot= dl->nr*dl->parts;
vert= dl->verts;
- for(a=0; a<tot; a++, vert+=3) {
+ for (a=0; a<tot; a++, vert+=3) {
doit= 1;
DO_MINMAX(vert, min, max);
}
@@ -1507,7 +1518,7 @@ static void boundbox_displist(Object *ob)
dl= dl->next;
}
- if(!doit) {
+ if (!doit) {
/* there's no geometry in displist, use zero-sized boundbox */
zero_v3(min);
zero_v3(max);
@@ -1515,7 +1526,7 @@ static void boundbox_displist(Object *ob)
}
- if(bb) {
+ if (bb) {
boundbox_set_from_min_max(bb, min, max);
}
}
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index edd1bc6d679..872f678d456 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -84,7 +84,7 @@ static float gaussianFactors[5] = { 0.996849f,
0.524141f};
static float gaussianTotal = 3.309425f;
-/* UV Image neighbouring pixel table x and y list */
+/* UV Image neighboring pixel table x and y list */
static int neighX[8] = {1,1,0,-1,-1,-1, 0, 1};
static int neighY[8] = {0,1,1, 1, 0,-1,-1,-1};
@@ -139,7 +139,7 @@ typedef struct Vec3f {
} Vec3f;
typedef struct BakeAdjPoint {
- float dir[3]; /* vector pointing towards this neighbour */
+ float dir[3]; /* vector pointing towards this neighbor */
float dist; /* distance to */
} BakeAdjPoint;
@@ -156,11 +156,11 @@ 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 */
- BakeAdjPoint *bNeighs; /* current global neighbour distances and directions, if required */
+ BakeAdjPoint *bNeighs; /* current global neighbor distances and directions, if required */
double average_dist;
/* space partitioning */
VolumeGrid *grid; /* space partitioning grid to optimize brush checks */
@@ -183,7 +183,7 @@ typedef struct PaintUVPoint {
unsigned int v1, v2, v3; /* vertex indexes */
unsigned int neighbour_pixel; /* If this pixel isn't uv mapped to any face,
- but it's neighbouring pixel is */
+ but it's neighboring pixel is */
short quad;
} PaintUVPoint;
@@ -196,7 +196,7 @@ typedef struct ImgSeqFormatData {
#define ADJ_ON_MESH_EDGE (1<<0)
typedef struct PaintAdjData {
- int *n_target; /* array of neighbouring point indexes,
+ int *n_target; /* array of neighboring point indexes,
for single sample use (n_index+neigh_num) */
int *n_index; /* index to start reading n_target for each point */
int *n_num; /* num of neighs for each point */
@@ -246,8 +246,8 @@ struct DynamicPaintSurface *get_activeSurface(DynamicPaintCanvasSettings *canvas
DynamicPaintSurface *surface = canvas->surfaces.first;
int i;
- for(i=0; surface; surface=surface->next) {
- if(i == canvas->active_sur)
+ for (i=0; surface; surface=surface->next) {
+ if (i == canvas->active_sur)
return surface;
i++;
}
@@ -260,7 +260,7 @@ void dynamicPaint_resetPreview(DynamicPaintCanvasSettings *canvas)
DynamicPaintSurface *surface = canvas->surfaces.first;
int done=0;
- for(; surface; surface=surface->next) {
+ for (; surface; surface=surface->next) {
if (!done && dynamicPaint_surfaceHasColorPreview(surface)) {
surface->flags |= MOD_DPAINT_PREVIEW;
done=1;
@@ -274,7 +274,7 @@ void dynamicPaint_resetPreview(DynamicPaintCanvasSettings *canvas)
static void dynamicPaint_setPreview(DynamicPaintSurface *t_surface)
{
DynamicPaintSurface *surface = t_surface->canvas->surfaces.first;
- for(; surface; surface=surface->next) {
+ for (; surface; surface=surface->next) {
if (surface == t_surface)
surface->flags |= MOD_DPAINT_PREVIEW;
else
@@ -310,11 +310,11 @@ static int surface_duplicateOutputExists(void *arg, const char *name)
DynamicPaintSurface *t_surface = (DynamicPaintSurface*)arg;
DynamicPaintSurface *surface = t_surface->canvas->surfaces.first;
- for(; surface; surface=surface->next) {
+ 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;
@@ -336,7 +336,7 @@ static int surface_duplicateNameExists(void *arg, const char *name)
DynamicPaintSurface *t_surface = (DynamicPaintSurface*)arg;
DynamicPaintSurface *surface = t_surface->canvas->surfaces.first;
- for(; surface; surface=surface->next) {
+ for (; surface; surface=surface->next) {
if (surface!=t_surface && !strcmp(name, surface->name)) return 1;
}
return 0;
@@ -455,8 +455,8 @@ static void object_cacheIgnoreClear(Object *ob, int state)
PTCacheID *pid;
BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->cache) {
+ for (pid=pidlist.first; pid; pid=pid->next) {
+ if (pid->cache) {
if (state)
pid->cache->flag |= PTCACHE_IGNORE_CLEAR;
else
@@ -472,7 +472,7 @@ static int subframe_updateObject(Scene *scene, Object *ob, int flags, float fram
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)modifiers_findByType(ob, eModifierType_DynamicPaint);
bConstraint *con;
- /* if other is dynamic paint canvas, dont update */
+ /* if other is dynamic paint canvas, don't update */
if (pmd && pmd->canvas)
return 1;
@@ -506,12 +506,13 @@ static int subframe_updateObject(Scene *scene, Object *ob, int flags, float fram
}
}
/* for curve following objects, parented curve has to be updated too */
- if(ob->type==OB_CURVE) {
+ if (ob->type==OB_CURVE) {
Curve *cu= ob->data;
BKE_animsys_evaluate_animdata(scene, &cu->id, cu->adt, frame, ADT_RECALC_ANIM);
}
- ob->recalc |= OB_RECALC_ALL;
+ /* was originally OB_RECALC_ALL - TODO - which flags are really needed??? */
+ ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, frame, ADT_RECALC_ANIM);
if (flags & UPDATE_MESH) {
/* ignore cache clear during subframe updates
@@ -542,7 +543,7 @@ static int surface_getBrushFlags(DynamicPaintSurface *surface, Scene *scene)
int flags = 0;
- if(surface->brush_group)
+ if (surface->brush_group)
go = surface->brush_group->gobject.first;
else
base = scene->base.first;
@@ -552,26 +553,26 @@ static int surface_getBrushFlags(DynamicPaintSurface *surface, Scene *scene)
brushObj = NULL;
/* select object */
- if(surface->brush_group) {
- if(go->ob) brushObj = go->ob;
+ if (surface->brush_group) {
+ if (go->ob) brushObj = go->ob;
}
else
brushObj = base->object;
- if(!brushObj)
+ if (!brushObj)
{
- if(surface->brush_group) go = go->next;
+ if (surface->brush_group) go = go->next;
else base= base->next;
continue;
}
- if(surface->brush_group)
+ if (surface->brush_group)
go = go->next;
else
base= base->next;
md = modifiers_findByType(brushObj, eModifierType_DynamicPaint);
- if(md && md->mode & (eModifierMode_Realtime | eModifierMode_Render))
+ if (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render))
{
DynamicPaintModifierData *pmd2 = (DynamicPaintModifierData *)md;
@@ -745,7 +746,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;
@@ -832,15 +833,15 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface)
/* Free brush data */
void dynamicPaint_freeBrush(struct DynamicPaintModifierData *pmd)
{
- if(pmd->brush) {
- if(pmd->brush->dm)
+ if (pmd->brush) {
+ if (pmd->brush->dm)
pmd->brush->dm->release(pmd->brush->dm);
pmd->brush->dm = NULL;
- if(pmd->brush->paint_ramp)
+ if (pmd->brush->paint_ramp)
MEM_freeN(pmd->brush->paint_ramp);
pmd->brush->paint_ramp = NULL;
- if(pmd->brush->vel_ramp)
+ if (pmd->brush->vel_ramp)
MEM_freeN(pmd->brush->vel_ramp);
pmd->brush->vel_ramp = NULL;
@@ -922,7 +923,7 @@ void dynamicPaint_freeSurface(DynamicPaintSurface *surface)
BKE_ptcache_free_list(&(surface->ptcaches));
surface->pointcache = NULL;
- if(surface->effector_weights)
+ if (surface->effector_weights)
MEM_freeN(surface->effector_weights);
surface->effector_weights = NULL;
@@ -934,7 +935,7 @@ void dynamicPaint_freeSurface(DynamicPaintSurface *surface)
/* Free canvas data */
void dynamicPaint_freeCanvas(DynamicPaintModifierData *pmd)
{
- if(pmd->canvas) {
+ if (pmd->canvas) {
/* Free surface data */
DynamicPaintSurface *surface = pmd->canvas->surfaces.first;
DynamicPaintSurface *next_surface = NULL;
@@ -958,7 +959,7 @@ void dynamicPaint_freeCanvas(DynamicPaintModifierData *pmd)
/* Free whole dp modifier */
void dynamicPaint_Modifier_free(struct DynamicPaintModifierData *pmd)
{
- if(pmd) {
+ if (pmd) {
dynamicPaint_freeCanvas(pmd);
dynamicPaint_freeBrush(pmd);
}
@@ -1047,10 +1048,10 @@ struct DynamicPaintSurface *dynamicPaint_createNewSurface(DynamicPaintCanvasSett
*/
int dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene)
{
- if(pmd) {
- if(type == MOD_DYNAMICPAINT_TYPE_CANVAS) {
+ if (pmd) {
+ if (type == MOD_DYNAMICPAINT_TYPE_CANVAS) {
DynamicPaintCanvasSettings *canvas;
- if(pmd->canvas)
+ if (pmd->canvas)
dynamicPaint_freeCanvas(pmd);
canvas = pmd->canvas = MEM_callocN(sizeof(DynamicPaintCanvasSettings), "DynamicPaint Canvas");
@@ -1064,9 +1065,9 @@ int dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, stru
return 0;
}
- else if(type == MOD_DYNAMICPAINT_TYPE_BRUSH) {
+ else if (type == MOD_DYNAMICPAINT_TYPE_BRUSH) {
DynamicPaintBrushSettings *brush;
- if(pmd->brush)
+ if (pmd->brush)
dynamicPaint_freeBrush(pmd);
brush = pmd->brush = MEM_callocN(sizeof(DynamicPaintBrushSettings), "DynamicPaint Paint");
@@ -1148,8 +1149,8 @@ void dynamicPaint_Modifier_copy(struct DynamicPaintModifierData *pmd, struct Dyn
/* Copy data */
if (tpmd->canvas) {
tpmd->canvas->pmd = tpmd;
-
- } else if (tpmd->brush) {
+ }
+ else if (tpmd->brush) {
DynamicPaintBrushSettings *brush = pmd->brush, *t_brush = tpmd->brush;
t_brush->pmd = tpmd;
@@ -1235,7 +1236,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)
@@ -1308,7 +1309,7 @@ static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, int for
n_pos += ad->n_num[i];
}
- /* and now add neighbour data using that info */
+ /* and now add neighbor data using that info */
for (i=0; i<numOfEdges; i++) {
/* first vertex */
int index = edge[i].v1;
@@ -1506,7 +1507,7 @@ int dynamicPaint_resetSurface(DynamicPaintSurface *surface)
/* free existing data */
if (surface->data) dynamicPaint_freeSurfaceData(surface);
- /* dont reallocate for image sequence types. they get handled only on bake */
+ /* don't reallocate for image sequence types. they get handled only on bake */
if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) return 1;
if (numOfPoints < 1) return 0;
@@ -1574,7 +1575,7 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData
{
DerivedMesh *result = CDDM_copy(dm);
- if(pmd->canvas && !(pmd->canvas->flags & MOD_DPAINT_BAKING)) {
+ if (pmd->canvas && !(pmd->canvas->flags & MOD_DPAINT_BAKING)) {
DynamicPaintSurface *surface = pmd->canvas->surfaces.first;
int update_normals = 0;
@@ -1612,23 +1613,27 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData
MPoly *mp = CDDM_get_polys(result);
int totpoly = result->numPolyData;
- /* XXX We have to create a CD_WEIGHT_MCOL, else it might sigsev
+#if 0
+ /* XXX We have to create a CD_PREVIEW_MCOL, else it might sigsev
* (after a SubSurf mod, eg)... */
- if(!result->getTessFaceDataArray(result, CD_WEIGHT_MCOL)) {
+ if (!result->getTessFaceDataArray(result, CD_PREVIEW_MCOL)) {
int numFaces = result->getNumTessFaces(result);
- CustomData_add_layer(&result->faceData, CD_WEIGHT_MCOL, CD_CALLOC, NULL, numFaces);
+ CustomData_add_layer(&result->faceData, CD_PREVIEW_MCOL, CD_CALLOC, NULL, numFaces);
}
+#endif
/* Save preview results to weight layer to be
* able to share same drawing methods */
- col = CustomData_get_layer(&result->loopData, CD_WEIGHT_MLOOPCOL);
- if (!col) col = CustomData_add_layer(&result->loopData, CD_WEIGHT_MLOOPCOL, CD_CALLOC, NULL, totloop);
+ col = CustomData_get_layer(&result->loopData, CD_PREVIEW_MLOOPCOL);
+ if (!col)
+ col = CustomData_add_layer(&result->loopData, CD_PREVIEW_MLOOPCOL, CD_CALLOC,
+ NULL, totloop);
if (col) {
#pragma omp parallel for schedule(static)
for (i=0; i<totpoly; i++) {
int j=0;
- Material *material = give_current_material(ob, mp[i].mat_nr+1);
+ Material *material = give_current_material(ob, mp[i].mat_nr + 1);
for (; j<mp[i].totloop; j++) {
int l_index = mp[i].loopstart + j;
@@ -1653,15 +1658,13 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData
/* mix surface color */
interp_v3_v3v3(c, c, &fcolor[v_index], fcolor[v_index+3]);
- col[l_index].r = FTOCHAR(c[2]);
- col[l_index].g = FTOCHAR(c[1]);
- col[l_index].b = FTOCHAR(c[0]);
+ rgb_float_to_uchar((unsigned char *)&col[l_index].r, c);
}
else {
- col[l_index].a = 255;
col[l_index].r =
col[l_index].g =
col[l_index].b = FTOCHAR(pPoint[v_index].wetness);
+ col[l_index].a = 255;
}
}
}
@@ -1681,10 +1684,8 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData
#pragma omp parallel for schedule(static)
for (i=0; i<totloop; i++) {
int index = mloop[i].v*4;
- col[i].a = FTOCHAR(fcolor[index+3]);
- col[i].r = FTOCHAR(fcolor[index+2]);
- col[i].g = FTOCHAR(fcolor[index+1]);
- col[i].b = FTOCHAR(fcolor[index]);
+ rgb_float_to_uchar((unsigned char *)&col[i].r, &fcolor[index]);
+ col[i].a = FTOCHAR(fcolor[index+3]); /* IS THIS NEEDED? */
}
}
@@ -1700,12 +1701,15 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData
#pragma omp parallel for schedule(static)
for (i=0; i<totloop; i++) {
int index = mloop[i].v;
- col[i].a = 255;
col[i].r =
col[i].g =
col[i].b = FTOCHAR(pPoint[index].wetness);
+ col[i].a = 255;
}
}
+
+ /* Mark tessellated CD layers as dirty. */
+ result->dirty |= DM_DIRTY_TESS_CDLAYERS;
}
/* vertex group paint */
else if (surface->type == MOD_DPAINT_SURFACE_T_WEIGHT) {
@@ -1716,7 +1720,8 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData
/* viewport preview */
if (surface->flags & MOD_DPAINT_PREVIEW) {
/* Save preview results to weight layer to be
- * able to share same drawing methods */
+ * able to share same drawing methods.
+ * Note this func also sets DM_DIRTY_TESS_CDLAYERS flag! */
DM_update_weight_mcol(ob, result, 0, weight, 0, NULL);
}
@@ -1726,7 +1731,7 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData
NULL, sData->total_points, surface->output_name);
if (defgrp_index >= 0 && dvert) {
int i;
- for(i=0; i<sData->total_points; i++) {
+ for (i=0; i<sData->total_points; i++) {
MDeformVert *dv= &dvert[i];
MDeformWeight *def_weight = defvert_find_index(dv, defgrp_index);
@@ -1800,7 +1805,7 @@ void canvas_copyDerivedMesh(DynamicPaintCanvasSettings *canvas, DerivedMesh *dm)
*/
static void dynamicPaint_frameUpdate(DynamicPaintModifierData *pmd, Scene *scene, Object *ob, DerivedMesh *dm)
{
- if(pmd->canvas) {
+ if (pmd->canvas) {
DynamicPaintCanvasSettings *canvas = pmd->canvas;
DynamicPaintSurface *surface = canvas->surfaces.first;
@@ -1839,7 +1844,7 @@ static void dynamicPaint_frameUpdate(DynamicPaintModifierData *pmd, Scene *scene
BKE_ptcache_id_time(&pid, scene, (float)scene->r.cfra, NULL, NULL, NULL);
/* reset non-baked cache at first frame */
- if((int)scene->r.cfra == surface->start_frame && !(cache->flag & PTCACHE_BAKED))
+ if ((int)scene->r.cfra == surface->start_frame && !(cache->flag & PTCACHE_BAKED))
{
cache->flag |= PTCACHE_REDO_NEEDED;
BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
@@ -1847,7 +1852,7 @@ static void dynamicPaint_frameUpdate(DynamicPaintModifierData *pmd, Scene *scene
}
/* try to read from cache */
- if(BKE_ptcache_read(&pid, (float)scene->r.cfra)) {
+ if (BKE_ptcache_read(&pid, (float)scene->r.cfra)) {
BKE_ptcache_validate(cache, (int)scene->r.cfra);
}
/* if read failed and we're on surface range do recalculate */
@@ -1889,7 +1894,7 @@ struct DerivedMesh *dynamicPaint_Modifier_do(DynamicPaintModifierData *pmd, Scen
/***************************** Image Sequence / UV Image Surface Calls ******************************/
/*
-* Tries to find the neighbouring pixel in given (uv space) direction.
+* Tries to find the neighboring pixel in given (uv space) direction.
* Result is used by effect system to move paint on the surface.
*
* px,py : origin pixel x and y
@@ -1898,7 +1903,7 @@ struct DerivedMesh *dynamicPaint_Modifier_do(DynamicPaintModifierData *pmd, Scen
static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh *dm,
const char *uvname, int w, int h, int px, int py, int n_index)
{
- /* Note: Current method only uses polygon edges to detect neighbouring pixels.
+ /* Note: Current method only uses polygon edges to detect neighboring pixels.
* -> It doesn't always lead to the optimum pixel but is accurate enough
* and faster/simplier than including possible face tip point links)
*/
@@ -1914,11 +1919,11 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh
if (x<0 || x>=w) return OUT_OF_TEXTURE;
if (y<0 || y>=h) return OUT_OF_TEXTURE;
- tPoint = &tempPoints[x+w*y]; /* UV neighbour */
+ tPoint = &tempPoints[x+w*y]; /* UV neighbor */
cPoint = &tempPoints[px+w*py]; /* Origin point */
/*
- * Check if shifted point is on same face -> it's a correct neighbour
+ * Check if shifted point is on same face -> it's a correct neighbor
* (and if it isn't marked as an "edge pixel")
*/
if ((tPoint->face_index == cPoint->face_index) && (tPoint->neighbour_pixel == -1))
@@ -1937,11 +1942,11 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh
}
/*
- * If we get here, the actual neighbouring pixel
+ * If we get here, the actual neighboring pixel
* is located on a non-linked uv face, and we have to find
* it's "real" position.
*
- * Simple neighbouring face finding algorithm:
+ * Simple neighboring face finding algorithm:
* - find closest uv edge to shifted pixel and get
* the another face that shares that edge
* - find corresponding position of that new face edge
@@ -2075,7 +2080,7 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh
if (tempPoints[final_index].face_index != target_face) return NOT_FOUND;
/*
- * If final point is an "edge pixel", use it's "real" neighbour instead
+ * If final point is an "edge pixel", use it's "real" neighbor instead
*/
if (tempPoints[final_index].neighbour_pixel != -1) final_index = cPoint->neighbour_pixel;
@@ -2322,7 +2327,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
/*
* Now loop through every pixel that was left without index
- * and find if they have neighbouring pixels that have an index.
+ * and find if they have neighboring pixels that have an index.
* If so use that polygon as pixel surface.
* (To avoid seams on uv island edges)
*/
@@ -2335,7 +2340,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
int index = tx+w*ty;
PaintUVPoint *tPoint = (&tempPoints[index]);
- /* If point isnt't on canvas mesh */
+ /* If point isn't't on canvas mesh */
if (tPoint->face_index == -1) {
int u_min, u_max, v_min, v_max;
int u,v, ind;
@@ -2350,14 +2355,14 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
point[0] = ((float)tx + 0.5f) / w;
point[1] = ((float)ty + 0.5f) / h;
- /* search through defined area for neighbour */
+ /* search through defined area for neighbor */
for (u=u_min; u<=u_max; u++)
for (v=v_min; v<=v_max; v++) {
/* if not this pixel itself */
if (u!=0 || v!=0) {
ind = (tx+u)+w*(ty+v);
- /* if neighbour has index */
+ /* if neighbor has index */
if (tempPoints[ind].face_index != -1) {
float uv1co[2], uv2co[2], uv3co[2], uv[2];
@@ -2402,7 +2407,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
}
/*
- * When base loop is over convert found neighbour indexes to real ones
+ * When base loop is over convert found neighbor indexes to real ones
* Also count the final number of active surface points
*/
for (ty = 0; ty < h; ty++)
@@ -2450,7 +2455,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
for (i=0; i<8; i++) {
- /* Try to find a neighbouring pixel in defined direction
+ /* Try to find a neighboring pixel in defined direction
* If not found, -1 is returned */
int n_target = dynamicPaint_findNeighbourPixel(tempPoints, dm, uvname, w, h, tx, ty, i);
@@ -2495,7 +2500,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
sData->total_points = active_points;
sData->format_data = f_data;
- for(index = 0; index < (w*h); index++) {
+ for (index = 0; index < (w*h); index++) {
if (tempPoints[index].face_index != -1) {
memcpy(&f_data->uv_p[cursor], &tempPoints[index], sizeof(PaintUVPoint));
memcpy(&f_data->barycentricWeights[cursor*aa_samples], &tempWeights[index*aa_samples], sizeof(Vec3f)*aa_samples);
@@ -2639,7 +2644,7 @@ void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, char* filenam
}
}
- /* Set output format, png in case exr isnt supported */
+ /* Set output format, png in case exr isn't supported */
ibuf->ftype= PNG|95;
#ifdef WITH_OPENEXR
if (format == R_IMF_IMTYPE_OPENEXR) { /* OpenEXR 32-bit float */
@@ -2756,7 +2761,7 @@ static void mesh_faces_spherecast_dp(void *userdata, int index, const BVHTreeRay
{
float dist = bvhtree_ray_tri_intersection(ray, hit->dist, t0, t1, t2);
- if(dist >= 0 && dist < hit->dist)
+ if (dist >= 0 && dist < hit->dist)
{
hit->index = index;
hit->dist = dist;
@@ -2768,7 +2773,7 @@ static void mesh_faces_spherecast_dp(void *userdata, int index, const BVHTreeRay
t3 = NULL;
quad = 1;
- } while(t2);
+ } while (t2);
}
/* A modified callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_faces.
@@ -2796,7 +2801,7 @@ static void mesh_faces_nearest_point_dp(void *userdata, int index, const float *
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;
@@ -2809,7 +2814,7 @@ static void mesh_faces_nearest_point_dp(void *userdata, int index, const float *
t3 = NULL;
quad = 1;
- } while(t2);
+ } while (t2);
}
@@ -3183,7 +3188,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
}
/* check bounding box collision */
- if(grid && meshBrush_boundsIntersect(&grid->grid_bounds, &mesh_bb, brush, brush_radius))
+ if (grid && meshBrush_boundsIntersect(&grid->grid_bounds, &mesh_bb, brush, brush_radius))
/* Build a bvh tree from transformed vertices */
if (bvhtree_from_mesh_faces(&treeData, dm, 0.0f, 4, 8))
{
@@ -3260,7 +3265,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
/* Check volume collision */
if (brush->collision == MOD_DPAINT_COL_VOLUME || brush->collision == MOD_DPAINT_COL_VOLDIST)
- if(BLI_bvhtree_ray_cast(treeData.tree, ray_start, ray_dir, 0.0f, &hit, mesh_faces_spherecast_dp, &treeData) != -1)
+ if (BLI_bvhtree_ray_cast(treeData.tree, ray_start, ray_dir, 0.0f, &hit, mesh_faces_spherecast_dp, &treeData) != -1)
{
/* We hit a triangle, now check if collision point normal is facing the point */
@@ -3287,7 +3292,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
BLI_bvhtree_ray_cast(treeData.tree, ray_start, ray_dir, 0.0f, &hit, mesh_faces_spherecast_dp, &treeData);
- if(hit.index != -1) {
+ if (hit.index != -1) {
/* Add factor on supersample filter */
volume_factor = 1.0f;
hit_found = HIT_VOLUME;
@@ -3339,7 +3344,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
hit.dist = brush_radius;
/* Do a face normal directional raycast, and use that distance */
- if(BLI_bvhtree_ray_cast(treeData.tree, ray_start, proj_ray, 0.0f, &hit, mesh_faces_spherecast_dp, &treeData) != -1)
+ if (BLI_bvhtree_ray_cast(treeData.tree, ray_start, proj_ray, 0.0f, &hit, mesh_faces_spherecast_dp, &treeData) != -1)
{
proxDist = hit.dist;
madd_v3_v3v3fl(hitCo, ray_start, proj_ray, hit.dist); /* Calculate final hit coordinates */
@@ -3552,12 +3557,12 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface,
tree= BLI_kdtree_new(psys->totpart);
/* loop through particles and insert valid ones to the tree */
- for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++) {
+ for (p=0, pa=psys->particles; p<psys->totpart; p++, pa++) {
/* Proceed only if particle is active */
- if(pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN)==0) continue;
- else if(pa->alive == PARS_DEAD && (part->flag & PART_DIED)==0) continue;
- else if(pa->flag & PARS_UNEXIST) continue;
+ if (pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN)==0) continue;
+ else if (pa->alive == PARS_DEAD && (part->flag & PART_DIED)==0) continue;
+ else if (pa->flag & PARS_UNEXIST) continue;
/* for debug purposes check if any NAN particle proceeds
* For some reason they get past activity check, this should rule most of them out */
@@ -3664,7 +3669,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface,
particles = BLI_kdtree_range_search(tree, max_range, bData->realCoord[bData->s_pos[index]].v, NULL, &nearest);
/* Find particle that produces highest influence */
- for(n=0; n<particles; n++) {
+ for (n=0; n<particles; n++) {
ParticleData *pa = psys->particles + nearest[n].index;
float s_range;
@@ -3948,7 +3953,7 @@ void surface_determineForceTargetPoints(PaintSurfaceData *sData, int index, floa
if (n_index == closest_id[0]) continue;
- /* only accept neighbour at "other side" of the first one in relation to force dir
+ /* only accept neighbor at "other side" of the first one in relation to force dir
* so make sure angle between this and closest neigh is greater than first angle */
if (dir_dot>closest_d[1] && closest_dot<closest_d[0] && dir_dot>0.0f) {closest_d[1]=dir_dot; closest_id[1]=n_index;}
}
@@ -3970,7 +3975,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;
@@ -3983,7 +3988,7 @@ void surface_determineForceTargetPoints(PaintSurfaceData *sData, int index, floa
closest_d[1] *= acosf(temp)/1.57079633f;
}
else {
- /* if only single neighbour, still linearize force intersection effect */
+ /* if only single neighbor, still linearize force intersection effect */
closest_d[0] = 1.0f - acosf(closest_d[0])/1.57079633f;
}
}
@@ -4145,9 +4150,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 +4164,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,9 +4180,9 @@ 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 neighbouring points */
+ /* Loop through neighboring points */
for (i=0; i<numOfNeighs; i++) {
int n_index = sData->adj_data->n_index[index]+i;
float w_factor;
@@ -4202,8 +4207,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;
@@ -4226,8 +4231,8 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
totalAlpha += ePoint->e_alpha;
- /* Check if neighbouring point has lower alpha,
- * if so, decrease this point's alpha as well*/
+ /* Check if neighboring point has lower alpha,
+ * if so, decrease this point's alpha as well*/
if (pPoint->alpha <= 0.0f && pPoint->e_alpha <= 0.0f && pPoint->wetness <= 0.0f) continue;
/* decrease factor for dry paint alpha */
@@ -4251,8 +4256,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 +4455,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 +4469,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 +4640,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 +4650,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 +4660,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 +4721,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 +4768,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 +4780,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;
@@ -4788,7 +4793,7 @@ static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *su
float scene_subframe = scene->r.subframe;
/* either from group or from all objects */
- if(surface->brush_group)
+ if (surface->brush_group)
go = surface->brush_group->gobject.first;
else
base = scene->base.first;
@@ -4797,28 +4802,28 @@ static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *su
{
brushObj = NULL;
/* select object */
- if(surface->brush_group) {
- if(go->ob) brushObj = go->ob;
+ if (surface->brush_group) {
+ if (go->ob) brushObj = go->ob;
}
else
brushObj = base->object;
- if(!brushObj) {
+ if (!brushObj) {
/* skip item */
- if(surface->brush_group) go = go->next;
+ if (surface->brush_group) go = go->next;
else base= base->next;
continue;
}
/* next item */
- if(surface->brush_group)
+ if (surface->brush_group)
go = go->next;
else
base= base->next;
/* check if target has an active dp modifier */
md = modifiers_findByType(brushObj, eModifierType_DynamicPaint);
- if(md && md->mode & (eModifierMode_Realtime | eModifierMode_Render))
+ if (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render))
{
DynamicPaintModifierData *pmd2 = (DynamicPaintModifierData *)md;
/* make sure we're dealing with a brush */
@@ -4889,16 +4894,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 +4927,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;
@@ -4937,7 +4940,7 @@ int dynamicPaint_calculateFrame(DynamicPaintSurface *surface, Scene *scene, Obje
/* update bake data */
dynamicPaint_generateBakeData(surface, scene, cObject);
- /* dont do substeps for first frame */
+ /* don't do substeps for first frame */
if (surface->substeps && (frame != surface->start_frame)) {
int st;
timescale = 1.0f / (surface->substeps+1);
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index f73a2ff6c1a..04ad8276365 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -47,9 +47,9 @@
#include "BKE_paint.h"
+#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
-#include "DNA_curve_types.h" /* for Curve */
#include "MEM_guardedalloc.h"
@@ -69,13 +69,13 @@
extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */
-BMEditMesh *BMEdit_Create(BMesh *bm, int do_tesselate)
+BMEditMesh *BMEdit_Create(BMesh *bm, int do_tessellate)
{
BMEditMesh *tm = MEM_callocN(sizeof(BMEditMesh), __func__);
tm->bm = bm;
- if (do_tesselate) {
- BMEdit_RecalcTesselation(tm);
+ if (do_tessellate) {
+ BMEdit_RecalcTessellation(tm);
}
return tm;
@@ -90,13 +90,13 @@ BMEditMesh *BMEdit_Copy(BMEditMesh *tm)
tm2->bm = BM_mesh_copy(tm->bm);
- /*The tesselation is NOT calculated on the copy here,
- because currently all the callers of this function use
- it to make a backup copy of the BMEditMesh to restore
- it in the case of errors in an operation. For perf
- reasons, in that case it makes more sense to do the
- tesselation only when/if that copy ends up getting
- 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;
@@ -106,7 +106,7 @@ BMEditMesh *BMEdit_Copy(BMEditMesh *tm)
return tm2;
}
-static void BMEdit_RecalcTesselation_intern(BMEditMesh *tm)
+static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
{
/* use this to avoid locking pthread for _every_ polygon
* and calling the fill function */
@@ -136,7 +136,7 @@ static void BMEdit_RecalcTesselation_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_RecalcTesselation_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_RecalcTesselation_intern(BMEditMesh *tm)
v->tmp.p = l;
if (lastv) {
- e = BLI_addfilledge(lastv, v);
+ /* e = */ BLI_addfilledge(lastv, v);
}
lastv = v;
@@ -245,21 +245,21 @@ static void BMEdit_RecalcTesselation_intern(BMEditMesh *tm)
}
-void BMEdit_RecalcTesselation(BMEditMesh *em)
+void BMEdit_RecalcTessellation(BMEditMesh *em)
{
- BMEdit_RecalcTesselation_intern(em);
+ BMEdit_RecalcTessellation_intern(em);
/* commented because editbmesh_build_data() ensures we get tessfaces */
#if 0
if (em->derivedFinal && em->derivedFinal == em->derivedCage) {
- if (em->derivedFinal->recalcTesselation)
- em->derivedFinal->recalcTesselation(em->derivedFinal);
+ if (em->derivedFinal->recalcTessellation)
+ em->derivedFinal->recalcTessellation(em->derivedFinal);
}
else if (em->derivedFinal) {
- if (em->derivedCage->recalcTesselation)
- em->derivedCage->recalcTesselation(em->derivedCage);
- if (em->derivedFinal->recalcTesselation)
- em->derivedFinal->recalcTesselation(em->derivedFinal);
+ if (em->derivedCage->recalcTessellation)
+ em->derivedCage->recalcTessellation(em->derivedCage);
+ if (em->derivedFinal->recalcTessellation)
+ em->derivedFinal->recalcTessellation(em->derivedFinal);
}
#endif
}
@@ -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 tesselations
-for each face. this cache will smartly update as needed (though at first
-it'll simply be more brute force). keeping track of face/edge counts may
-be a small problbm.
-
-this won't be the most efficient thing, considering that internal edges and
-faces of tesselations are exposed. looking up an edge by index in particular
-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,10 +342,10 @@ 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_recalcTesselation(DerivedMesh *UNUSED(dm))
+static void emDM_recalcTessellation(DerivedMesh *UNUSED(dm))
{
/* do nothing */
}
@@ -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,16 +795,15 @@ 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;
+ dummylcol.r = dummylcol.g = dummylcol.b = dummylcol.a = 255;
/* always use smooth shading even for flat faces, else vertex colors wont interpolate */
glShadeModel(GL_SMOOTH);
@@ -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])
+ glColor3ubv((const GLubyte *)&(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])
+ glColor3ubv((const GLubyte *)&(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])
+ glColor3ubv((const GLubyte *)&(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])
+ glColor3ubv((const GLubyte *)&(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])
+ glColor3ubv((const GLubyte *)&(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])
+ glColor3ubv((const GLubyte *)&(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) {
@@ -906,22 +917,19 @@ static void emDM_drawFacesTex_common(
if (luv[0])
glTexCoord2fv(luv[0]->uv);
if (lcol[0])
- glColor3ub(lcol[0]->b, lcol[0]->g, lcol[0]->r);
- else glColor3ub(0, 0, 0);
+ glColor3ubv((const GLubyte *)&(lcol[0]->r));
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);
+ glColor3ubv((const GLubyte *)&(lcol[1]->r));
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);
+ glColor3ubv((const GLubyte *)&(lcol[2]->r));
glVertex3fv(ls[2]->v->co);
}
else {
@@ -930,24 +938,21 @@ static void emDM_drawFacesTex_common(
if (luv[0])
glTexCoord2fv(luv[0]->uv);
if (lcol[0])
- glColor3ub(lcol[0]->b, lcol[0]->g, lcol[0]->r);
- else glColor3ub(0, 0, 0);
+ glColor3ubv((const GLubyte *)&(lcol[0]->r));
glNormal3fv(ls[0]->v->no);
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);
+ glColor3ubv((const GLubyte *)&(lcol[1]->r));
glNormal3fv(ls[1]->v->no);
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);
+ glColor3ubv((const GLubyte *)&(lcol[2]->r));
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;
@@ -1245,7 +1250,8 @@ static void emDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3])
}
}
else {
- min_r[0] = min_r[1] = min_r[2] = max_r[0] = max_r[1] = max_r[2] = 0.0;
+ zero_v3(min_r);
+ zero_v3(max_r);
}
}
static int emDM_getNumVerts(DerivedMesh *dm)
@@ -1308,7 +1314,7 @@ static void emDM_getVert(DerivedMesh *dm, int index, MVert *vert_r)
return;
}
- // ev = EDBM_get_vert_for_index(bmdm->tc, index);
+ // ev = EDBM_vert_at_index(bmdm->tc, index);
ev = BM_vert_at_index(bmdm->tc->bm, index); /* warning, does list loop, _not_ ideal */
bmvert_to_mvert(bmdm->tc->bm, ev, vert_r);
@@ -1325,7 +1331,7 @@ static void emDM_getEdge(DerivedMesh *dm, int index, MEdge *edge_r)
return;
}
- // e = EDBM_get_edge_for_index(bmdm->tc, index);
+ // e = EDBM_edge_at_index(bmdm->tc, index);
e = BM_edge_at_index(bmdm->tc->bm, index); /* warning, does list loop, _not_ ideal */
if (CustomData_has_layer(&bm->edata, CD_BWEIGHT)) {
@@ -1511,8 +1517,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);
}
@@ -1635,7 +1641,7 @@ DerivedMesh *getEditDerivedBMesh(
bmdm->dm.getTessFaceDataArray = emDM_getTessFaceDataArray;
bmdm->dm.calcNormals = emDM_calcNormals;
- bmdm->dm.recalcTesselation = emDM_recalcTesselation;
+ bmdm->dm.recalcTessellation = emDM_recalcTessellation;
bmdm->dm.foreachMappedVert = emDM_foreachMappedVert;
bmdm->dm.foreachMappedEdge = emDM_foreachMappedEdge;
@@ -1684,7 +1690,7 @@ DerivedMesh *getEditDerivedBMesh(
i = 0;
BM_ITER(efa, &fiter, bm, BM_FACES_OF_MESH, NULL) {
BM_elem_index_set(efa, i); /* set_inline */
- BM_face_normal_update_vcos(bm, efa, bmdm->polyNos[i], vertexCos);
+ BM_face_normal_update_vcos(bm, efa, bmdm->polyNos[i], (float const (*)[3])vertexCos);
i++;
}
bm->elem_index_dirty &= ~BM_FACE;
@@ -1707,3 +1713,15 @@ DerivedMesh *getEditDerivedBMesh(
return (DerivedMesh*) bmdm;
}
+
+/**
+ * \brief Return the BMEditMesh for a given object
+ *
+ * \note this function assumes this is a mesh object,
+ * don't add NULL data check here. caller must do that
+ */
+BMEditMesh *BMEdit_FromObject(Object *ob)
+{
+ BLI_assert(ob->type == OB_MESH);
+ return ((Mesh *)ob->data)->edit_btmesh;
+}
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 82a5d9aba3a..cb8220c8fb3 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -105,7 +105,7 @@ EffectorWeights *BKE_add_effector_weights(Group *group)
EffectorWeights *weights = MEM_callocN(sizeof(EffectorWeights), "EffectorWeights");
int i;
- for(i=0; i<NUM_PFIELD_TYPES; i++)
+ for (i=0; i<NUM_PFIELD_TYPES; i++)
weights->weight[i] = 1.0f;
weights->global_gravity = 1.0f;
@@ -157,13 +157,13 @@ typedef struct VeNoCo {
/* -------------------------- Effectors ------------------ */
void free_partdeflect(PartDeflect *pd)
{
- if(!pd)
+ if (!pd)
return;
- if(pd->tex)
+ if (pd->tex)
pd->tex->id.us--;
- if(pd->rng)
+ if (pd->rng)
rng_free(pd->rng);
MEM_freeN(pd);
@@ -172,34 +172,34 @@ void free_partdeflect(PartDeflect *pd)
static void precalculate_effector(EffectorCache *eff)
{
unsigned int cfra = (unsigned int)(eff->scene->r.cfra >= 0 ? eff->scene->r.cfra : -eff->scene->r.cfra);
- if(!eff->pd->rng)
+ if (!eff->pd->rng)
eff->pd->rng = rng_new(eff->pd->seed + cfra);
else
rng_srandom(eff->pd->rng, eff->pd->seed + cfra);
- if(eff->pd->forcefield == PFIELD_GUIDE && eff->ob->type==OB_CURVE) {
+ if (eff->pd->forcefield == PFIELD_GUIDE && eff->ob->type==OB_CURVE) {
Curve *cu= eff->ob->data;
- if(cu->flag & CU_PATH) {
- if(cu->path==NULL || cu->path->data==NULL)
+ if (cu->flag & CU_PATH) {
+ if (cu->path==NULL || cu->path->data==NULL)
makeDispListCurveTypes(eff->scene, eff->ob, 0);
- if(cu->path && cu->path->data) {
+ if (cu->path && cu->path->data) {
where_on_path(eff->ob, 0.0, eff->guide_loc, eff->guide_dir, NULL, &eff->guide_radius, NULL);
mul_m4_v3(eff->ob->obmat, eff->guide_loc);
mul_mat3_m4_v3(eff->ob->obmat, eff->guide_dir);
}
}
}
- else if(eff->pd->shape == PFIELD_SHAPE_SURFACE) {
+ else if (eff->pd->shape == PFIELD_SHAPE_SURFACE) {
eff->surmd = (SurfaceModifierData *)modifiers_findByType ( eff->ob, eModifierType_Surface );
- if(eff->ob->type == OB_CURVE)
+ if (eff->ob->type == OB_CURVE)
eff->flag |= PE_USE_NORMAL_DATA;
}
- else if(eff->psys)
+ else if (eff->psys)
psys_update_particle_tree(eff->psys, eff->scene->r.cfra);
/* Store object velocity */
- if(eff->ob) {
+ if (eff->ob) {
float old_vel[3];
where_is_object_time(eff->scene, eff->ob, cfra - 1.0f);
@@ -225,13 +225,13 @@ static void add_object_to_effectors(ListBase **effectors, Scene *scene, Effector
{
EffectorCache *eff = NULL;
- if( ob == ob_src || weights->weight[ob->pd->forcefield] == 0.0f )
+ if ( ob == ob_src || weights->weight[ob->pd->forcefield] == 0.0f )
return;
if (ob->pd->shape == PFIELD_SHAPE_POINTS && !ob->derivedFinal )
return;
- if(*effectors == NULL)
+ if (*effectors == NULL)
*effectors = MEM_callocN(sizeof(ListBase), "effectors list");
eff = new_effector_cache(scene, ob, NULL, ob->pd);
@@ -245,21 +245,21 @@ static void add_particles_to_effectors(ListBase **effectors, Scene *scene, Effec
{
ParticleSettings *part= psys->part;
- if( !psys_check_enabled(ob, psys) )
+ if ( !psys_check_enabled(ob, psys) )
return;
- if( psys == psys_src && (part->flag & PART_SELF_EFFECT) == 0)
+ if ( psys == psys_src && (part->flag & PART_SELF_EFFECT) == 0)
return;
- if( part->pd && part->pd->forcefield && weights->weight[part->pd->forcefield] != 0.0f) {
- if(*effectors == NULL)
+ if ( part->pd && part->pd->forcefield && weights->weight[part->pd->forcefield] != 0.0f) {
+ if (*effectors == NULL)
*effectors = MEM_callocN(sizeof(ListBase), "effectors list");
BLI_addtail(*effectors, new_effector_cache(scene, ob, psys, part->pd));
}
if (part->pd2 && part->pd2->forcefield && weights->weight[part->pd2->forcefield] != 0.0f) {
- if(*effectors == NULL)
+ if (*effectors == NULL)
*effectors = MEM_callocN(sizeof(ListBase), "effectors list");
BLI_addtail(*effectors, new_effector_cache(scene, ob, psys, part->pd2));
@@ -273,33 +273,33 @@ ListBase *pdInitEffectors(Scene *scene, Object *ob_src, ParticleSystem *psys_src
unsigned int layer= ob_src->lay;
ListBase *effectors = NULL;
- if(weights->group) {
+ if (weights->group) {
GroupObject *go;
- for(go= weights->group->gobject.first; go; go= go->next) {
- if( (go->ob->lay & layer) ) {
- if( go->ob->pd && go->ob->pd->forcefield )
+ for (go= weights->group->gobject.first; go; go= go->next) {
+ if ( (go->ob->lay & layer) ) {
+ if ( go->ob->pd && go->ob->pd->forcefield )
add_object_to_effectors(&effectors, scene, weights, go->ob, ob_src);
- if( go->ob->particlesystem.first ) {
+ if ( go->ob->particlesystem.first ) {
ParticleSystem *psys= go->ob->particlesystem.first;
- for( ; psys; psys=psys->next )
+ for ( ; psys; psys=psys->next )
add_particles_to_effectors(&effectors, scene, weights, go->ob, psys, psys_src);
}
}
}
}
else {
- for(base = scene->base.first; base; base= base->next) {
- if( (base->lay & layer) ) {
- if( base->object->pd && base->object->pd->forcefield )
+ for (base = scene->base.first; base; base= base->next) {
+ if ( (base->lay & layer) ) {
+ if ( base->object->pd && base->object->pd->forcefield )
add_object_to_effectors(&effectors, scene, weights, base->object, ob_src);
- if( base->object->particlesystem.first ) {
+ if ( base->object->particlesystem.first ) {
ParticleSystem *psys= base->object->particlesystem.first;
- for( ; psys; psys=psys->next )
+ for ( ; psys; psys=psys->next )
add_particles_to_effectors(&effectors, scene, weights, base->object, psys, psys_src);
}
}
@@ -310,11 +310,11 @@ ListBase *pdInitEffectors(Scene *scene, Object *ob_src, ParticleSystem *psys_src
void pdEndEffectors(ListBase **effectors)
{
- if(*effectors) {
+ if (*effectors) {
EffectorCache *eff = (*effectors)->first;
- for(; eff; eff=eff->next) {
- if(eff->guide_data)
+ for (; eff; eff=eff->next) {
+ if (eff->guide_data)
MEM_freeN(eff->guide_data);
}
@@ -334,10 +334,10 @@ void pd_point_from_particle(ParticleSimulationData *sim, ParticleData *pa, Parti
point->size = pa->size;
point->charge = 0.0f;
- if(part->pd && part->pd->forcefield == PFIELD_CHARGE)
+ if (part->pd && part->pd->forcefield == PFIELD_CHARGE)
point->charge += part->pd->f_strength;
- if(part->pd2 && part->pd2->forcefield == PFIELD_CHARGE)
+ if (part->pd2 && part->pd2->forcefield == PFIELD_CHARGE)
point->charge += part->pd2->f_strength;
point->vel_to_sec = 1.0f;
@@ -345,7 +345,7 @@ void pd_point_from_particle(ParticleSimulationData *sim, ParticleData *pa, Parti
point->flag = 0;
- if(sim->psys->part->flag & PART_ROT_DYN) {
+ if (sim->psys->part->flag & PART_ROT_DYN) {
point->ave = state->ave;
point->rot = state->rot;
}
@@ -406,48 +406,46 @@ static float eff_calc_visibility(ListBase *colliders, EffectorCache *eff, Effect
float norm[3], len = 0.0;
float visibility = 1.0, absorption = 0.0;
- if(!(eff->pd->flag & PFIELD_VISIBILITY))
+ if (!(eff->pd->flag & PFIELD_VISIBILITY))
return visibility;
- if(!colls)
+ if (!colls)
colls = get_collider_cache(eff->scene, eff->ob, NULL);
- if(!colls)
+ if (!colls)
return visibility;
negate_v3_v3(norm, efd->vec_to_point);
len = normalize_v3(norm);
// check all collision objects
- for(col = colls->first; col; col = col->next)
+ for (col = colls->first; col; col = col->next)
{
CollisionModifierData *collmd = col->collmd;
- if(col->ob == eff->ob)
+ 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
visibility *= CLAMPIS(1.0f-absorption, 0.0f, 1.0f);
- if(visibility <= 0.0f)
+ if (visibility <= 0.0f)
break;
}
}
}
- if(!colliders)
+ if (!colliders)
free_collider_cache(&colls);
return visibility;
@@ -474,13 +472,13 @@ static float wind_func(struct RNG *rng, float strength)
static float falloff_func(float fac, int usemin, float mindist, int usemax, float maxdist, float power)
{
/* first quick checks */
- if(usemax && fac > maxdist)
+ if (usemax && fac > maxdist)
return 0.0f;
- if(usemin && fac < mindist)
+ if (usemin && fac < mindist)
return 1.0f;
- if(!usemin)
+ if (!usemin)
mindist = 0.0;
return pow((double)(1.0f+fac-mindist), (double)(-power));
@@ -504,9 +502,9 @@ float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *UNU
fac = dot_v3v3(efd->nor, efd->vec_to_point2);
- if(eff->pd->zdir == PFIELD_Z_POS && fac < 0.0f)
+ if (eff->pd->zdir == PFIELD_Z_POS && fac < 0.0f)
falloff=0.0f;
- else if(eff->pd->zdir == PFIELD_Z_NEG && fac > 0.0f)
+ else if (eff->pd->zdir == PFIELD_Z_NEG && fac > 0.0f)
falloff=0.0f;
else switch(eff->pd->falloff) {
case PFIELD_FALL_SPHERE:
@@ -515,7 +513,7 @@ float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *UNU
case PFIELD_FALL_TUBE:
falloff*= falloff_func_dist(eff->pd, ABS(fac));
- if(falloff == 0.0f)
+ if (falloff == 0.0f)
break;
madd_v3_v3v3fl(temp, efd->vec_to_point, efd->nor, -fac);
@@ -524,7 +522,7 @@ float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *UNU
break;
case PFIELD_FALL_CONE:
falloff*= falloff_func_dist(eff->pd, ABS(fac));
- if(falloff == 0.0f)
+ if (falloff == 0.0f)
break;
r_fac= RAD2DEGF(saacos(fac/len_v3(efd->vec_to_point)));
@@ -545,20 +543,20 @@ int closest_point_on_surface(SurfaceModifierData *surmd, const float co[3], floa
BLI_bvhtree_find_nearest(surmd->bvhtree->tree, co, &nearest, surmd->bvhtree->nearest_callback, surmd->bvhtree);
- if(nearest.index != -1) {
+ if (nearest.index != -1) {
copy_v3_v3(surface_co, nearest.co);
- if(surface_nor) {
+ if (surface_nor) {
copy_v3_v3(surface_nor, nearest.no);
}
- if(surface_vel) {
+ if (surface_vel) {
MFace *mface = CDDM_get_tessface(surmd->dm, nearest.index);
copy_v3_v3(surface_vel, surmd->v[mface->v1].co);
add_v3_v3(surface_vel, surmd->v[mface->v2].co);
add_v3_v3(surface_vel, surmd->v[mface->v3].co);
- if(mface->v4)
+ if (mface->v4)
add_v3_v3(surface_vel, surmd->v[mface->v4].co);
mul_v3_fl(surface_vel, mface->v4 ? 0.25f : 0.333f);
@@ -573,7 +571,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
float cfra = eff->scene->r.cfra;
int ret = 0;
- if(eff->pd && eff->pd->shape==PFIELD_SHAPE_SURFACE && eff->surmd) {
+ if (eff->pd && eff->pd->shape==PFIELD_SHAPE_SURFACE && eff->surmd) {
/* closest point in the object surface is an effector */
float vec[3];
@@ -586,9 +584,9 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
efd->size = 0.0f;
}
- else if(eff->pd && eff->pd->shape==PFIELD_SHAPE_POINTS) {
+ else if (eff->pd && eff->pd->shape==PFIELD_SHAPE_POINTS) {
- if(eff->ob->derivedFinal) {
+ if (eff->ob->derivedFinal) {
DerivedMesh *dm = eff->ob->derivedFinal;
dm->getVertCo(dm, *efd->index, efd->loc);
@@ -605,12 +603,12 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
ret = 1;
}
}
- else if(eff->psys) {
+ else if (eff->psys) {
ParticleData *pa = eff->psys->particles + *efd->index;
ParticleKey state;
/* exclude the particle itself for self effecting particles */
- if(eff->psys == point->psys && *efd->index == point->index) {
+ if (eff->psys == point->psys && *efd->index == point->index) {
/* pass */
}
else {
@@ -625,7 +623,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
/* TODO */
//if(eff->pd->forcefiled == PFIELD_HARMONIC && ret==0) {
- // if(pa->dietime < eff->psys->cfra)
+ // if (pa->dietime < eff->psys->cfra)
// eff->flag |= PE_VELOCITY_TO_IMPULSE;
//}
@@ -636,7 +634,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
efd->nor[1] = efd->nor[2] = 0.f;
mul_qt_v3(state.rot, efd->nor);
- if(real_velocity)
+ if (real_velocity)
copy_v3_v3(efd->vel, state.vel);
efd->size = pa->size;
@@ -650,13 +648,13 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
/* use z-axis as normal*/
normalize_v3_v3(efd->nor, ob->obmat[2]);
- if(eff->pd && eff->pd->shape == PFIELD_SHAPE_PLANE) {
+ if (eff->pd && eff->pd->shape == PFIELD_SHAPE_PLANE) {
float temp[3], translate[3];
sub_v3_v3v3(temp, point->loc, ob->obmat[3]);
project_v3_v3v3(translate, temp, efd->nor);
/* for vortex the shape chooses between old / new force */
- if(eff->pd->forcefield == PFIELD_VORTEX)
+ if (eff->pd->forcefield == PFIELD_VORTEX)
add_v3_v3v3(efd->loc, ob->obmat[3], translate);
else /* normally efd->loc is closest point on effector xy-plane */
sub_v3_v3v3(efd->loc, point->loc, translate);
@@ -665,7 +663,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
copy_v3_v3(efd->loc, ob->obmat[3]);
}
- if(real_velocity)
+ if (real_velocity)
copy_v3_v3(efd->vel, eff->velocity);
*eff->ob = obcopy;
@@ -675,15 +673,15 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
ret = 1;
}
- if(ret) {
+ if (ret) {
sub_v3_v3v3(efd->vec_to_point, point->loc, efd->loc);
efd->distance = len_v3(efd->vec_to_point);
/* rest length for harmonic effector, will have to see later if this could be extended to other effectors */
- if(eff->pd && eff->pd->forcefield == PFIELD_HARMONIC && eff->pd->f_size)
+ if (eff->pd && eff->pd->forcefield == PFIELD_HARMONIC && eff->pd->f_size)
mul_v3_fl(efd->vec_to_point, (efd->distance-eff->pd->f_size)/efd->distance);
- if(eff->flag & PE_USE_NORMAL_DATA) {
+ if (eff->flag & PE_USE_NORMAL_DATA) {
copy_v3_v3(efd->vec_to_point2, efd->vec_to_point);
copy_v3_v3(efd->nor2, efd->nor);
}
@@ -698,39 +696,39 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
}
static void get_effector_tot(EffectorCache *eff, EffectorData *efd, EffectedPoint *point, int *tot, int *p, int *step)
{
- if(eff->pd->shape == PFIELD_SHAPE_POINTS) {
+ if (eff->pd->shape == PFIELD_SHAPE_POINTS) {
efd->index = p;
*p = 0;
*tot = eff->ob->derivedFinal ? eff->ob->derivedFinal->numVertData : 1;
- if(*tot && eff->pd->forcefield == PFIELD_HARMONIC && point->index >= 0) {
+ if (*tot && eff->pd->forcefield == PFIELD_HARMONIC && point->index >= 0) {
*p = point->index % *tot;
*tot = *p+1;
}
}
- else if(eff->psys) {
+ else if (eff->psys) {
efd->index = p;
*p = 0;
*tot = eff->psys->totpart;
- if(eff->pd->forcefield == PFIELD_CHARGE) {
+ 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) {
+ else if (eff->pd->forcefield == PFIELD_HARMONIC && (eff->pd->flag & PFIELD_MULTIPLE_SPRINGS)==0) {
/* every particle is mapped to only one harmonic effector particle */
*p= point->index % eff->psys->totpart;
*tot= *p + 1;
}
- if(eff->psys->part->effector_amount) {
+ if (eff->psys->part->effector_amount) {
int totpart = eff->psys->totpart;
int amount = eff->psys->part->effector_amount;
@@ -750,7 +748,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
int hasrgb;
short mode = eff->pd->tex_mode;
- if(!eff->pd->tex)
+ if (!eff->pd->tex)
return;
result[0].nor = result[1].nor = result[2].nor = result[3].nor = NULL;
@@ -759,18 +757,18 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
copy_v3_v3(tex_co,point->loc);
- if(eff->pd->flag & PFIELD_TEX_2D) {
+ if (eff->pd->flag & PFIELD_TEX_2D) {
float fac=-dot_v3v3(tex_co, efd->nor);
madd_v3_v3fl(tex_co, efd->nor, fac);
}
- if(eff->pd->flag & PFIELD_TEX_OBJECT) {
+ if (eff->pd->flag & PFIELD_TEX_OBJECT) {
mul_m4_v3(eff->ob->imat, tex_co);
}
hasrgb = multitex_ext(eff->pd->tex, tex_co, NULL,NULL, 0, result);
- if(hasrgb && mode==PFIELD_TEX_RGB) {
+ if (hasrgb && mode==PFIELD_TEX_RGB) {
force[0] = (0.5f - result->tr) * strength;
force[1] = (0.5f - result->tg) * strength;
force[2] = (0.5f - result->tb) * strength;
@@ -789,7 +787,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
tex_co[2] += nabla;
multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+3);
- if(mode == PFIELD_TEX_GRAD || !hasrgb) { /* if we dont have rgb fall back to grad */
+ if (mode == PFIELD_TEX_GRAD || !hasrgb) { /* if we don't have rgb fall back to grad */
force[0] = (result[0].tin - result[1].tin) * strength;
force[1] = (result[0].tin - result[2].tin) * strength;
force[2] = (result[0].tin - result[3].tin) * strength;
@@ -810,7 +808,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
}
}
- if(eff->pd->flag & PFIELD_TEX_2D) {
+ if (eff->pd->flag & PFIELD_TEX_2D) {
float fac = -dot_v3v3(force, efd->nor);
madd_v3_v3fl(force, efd->nor, fac);
}
@@ -828,10 +826,10 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
float damp = pd->f_damp;
float noise_factor = pd->f_noise;
- if(noise_factor > 0.0f) {
+ if (noise_factor > 0.0f) {
strength += wind_func(rng, noise_factor);
- if(ELEM(pd->forcefield, PFIELD_HARMONIC, PFIELD_DRAG))
+ if (ELEM(pd->forcefield, PFIELD_HARMONIC, PFIELD_DRAG))
damp += wind_func(rng, noise_factor);
}
@@ -848,7 +846,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
break;
case PFIELD_VORTEX:
/* old vortex force */
- if(pd->shape == PFIELD_SHAPE_POINT) {
+ if (pd->shape == PFIELD_SHAPE_POINT) {
cross_v3_v3v3(force, efd->nor, efd->vec_to_point);
normalize_v3(force);
mul_v3_fl(force, strength * efd->distance * efd->falloff);
@@ -866,7 +864,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
}
break;
case PFIELD_MAGNET:
- if(eff->pd->shape == PFIELD_SHAPE_POINT)
+ if (eff->pd->shape == PFIELD_SHAPE_POINT)
/* magnetic field of a moving charge */
cross_v3_v3v3(temp, efd->nor, efd->vec_to_point);
else
@@ -900,7 +898,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
/* Boid field is handled completely in boids code. */
return;
case PFIELD_TURBULENCE:
- if(pd->flag & PFIELD_GLOBAL_CO) {
+ if (pd->flag & PFIELD_GLOBAL_CO) {
copy_v3_v3(temp, point->loc);
}
else {
@@ -922,20 +920,20 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
break;
}
- if(pd->flag & PFIELD_DO_LOCATION) {
+ if (pd->flag & PFIELD_DO_LOCATION) {
madd_v3_v3fl(total_force, force, 1.0f/point->vel_to_sec);
- if(ELEM(pd->forcefield, PFIELD_HARMONIC, PFIELD_DRAG)==0 && pd->f_flow != 0.0f) {
+ if (ELEM(pd->forcefield, PFIELD_HARMONIC, PFIELD_DRAG)==0 && pd->f_flow != 0.0f) {
madd_v3_v3fl(total_force, point->vel, -pd->f_flow * efd->falloff);
}
}
- if(pd->flag & PFIELD_DO_ROTATION && point->ave && point->rot) {
+ if (pd->flag & PFIELD_DO_ROTATION && point->ave && point->rot) {
float xvec[3] = {1.0f, 0.0f, 0.0f};
float dave[3];
mul_qt_v3(point->rot, xvec);
cross_v3_v3v3(dave, xvec, force);
- if(pd->f_flow != 0.0f) {
+ if (pd->f_flow != 0.0f) {
madd_v3_v3fl(dave, point->ave, -pd->f_flow * efd->falloff);
}
add_v3_v3(point->ave, dave);
@@ -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;
@@ -978,21 +975,21 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we
/* Cycle through collected objects, get total of (1/(gravity_strength * dist^gravity_power)) */
/* Check for min distance here? (yes would be cool to add that, ton) */
- if(effectors) for(eff = effectors->first; eff; eff=eff->next) {
+ if (effectors) for (eff = effectors->first; eff; eff=eff->next) {
/* object effectors were fully checked to be OK to evaluate! */
get_effector_tot(eff, &efd, point, &tot, &p, &step);
- for(; p<tot; p+=step) {
- if(get_effector_data(eff, &efd, point, 0)) {
+ for (; p<tot; p+=step) {
+ if (get_effector_data(eff, &efd, point, 0)) {
efd.falloff= effector_falloff(eff, &efd, point, weights);
- if(efd.falloff > 0.0f)
+ if (efd.falloff > 0.0f)
efd.falloff *= eff_calc_visibility(colliders, eff, &efd, point);
- if(efd.falloff <= 0.0f)
+ if (efd.falloff <= 0.0f)
; /* don't do anything */
- else if(eff->pd->forcefield == PFIELD_TEXTURE)
+ else if (eff->pd->forcefield == PFIELD_TEXTURE)
do_texture_effector(eff, &efd, point, force);
else {
float temp1[3]={0,0,0}, temp2[3];
@@ -1001,13 +998,13 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we
do_physical_effector(eff, &efd, point, force);
// for softbody backward compatibility
- if(point->flag & PE_WIND_AS_SPEED && impulse) {
+ if (point->flag & PE_WIND_AS_SPEED && impulse) {
sub_v3_v3v3(temp2, force, temp1);
sub_v3_v3v3(impulse, impulse, temp2);
}
}
}
- else if(eff->flag & PE_VELOCITY_TO_IMPULSE && impulse) {
+ else if (eff->flag & PE_VELOCITY_TO_IMPULSE && impulse) {
/* special case for harmonic effector */
add_v3_v3v3(impulse, impulse, efd.vel);
}
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index fa20db0fe72..bb8cfe37a88 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -156,7 +156,7 @@ void copy_fcurves (ListBase *dst, ListBase *src)
FCurve *dfcu, *sfcu;
/* sanity checks */
- if ELEM(NULL, dst, src)
+ if (ELEM(NULL, dst, src))
return;
/* clear destination list first */
@@ -183,7 +183,7 @@ FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *pro
PropertyRNA *prop;
char *path;
- if(driven)
+ if (driven)
*driven = FALSE;
/* only use the current action ??? */
@@ -204,7 +204,7 @@ FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *pro
/* if not animated, check if driven */
if ((fcu == NULL) && (adt->drivers.first)) {
fcu= list_find_fcurve(&adt->drivers, path, index);
- if(fcu && driven)
+ if (fcu && driven)
*driven = TRUE;
fcu = NULL;
}
@@ -362,7 +362,7 @@ int binarysearch_bezt_index (BezTriple array[], float frame, int arraylen, short
int start=0, end=arraylen;
int loopbreaker= 0, maxloop= arraylen * 2;
- /* initialise replace-flag first */
+ /* initialize replace-flag first */
*replace= 0;
/* sneaky optimisations (don't go through searching process if...):
@@ -370,7 +370,7 @@ int binarysearch_bezt_index (BezTriple array[], float frame, int arraylen, short
* - keyframe to be added would replace one of the existing ones on bounds
*/
if ((arraylen <= 0) || (array == NULL)) {
- printf("Warning: binarysearch_bezt_index() encountered invalid array \n");
+ printf("Warning: binarysearch_bezt_index() encountered invalid array\n");
return 0;
}
else {
@@ -420,10 +420,10 @@ int binarysearch_bezt_index (BezTriple array[], float frame, int arraylen, short
/* print error if loop-limit exceeded */
if (loopbreaker == (maxloop-1)) {
- printf("Error: binarysearch_bezt_index() was taking too long \n");
+ printf("Error: binarysearch_bezt_index() was taking too long\n");
// include debug info
- printf("\tround = %d: start = %d, end = %d, arraylen = %d \n", loopbreaker, start, end, arraylen);
+ printf("\tround = %d: start = %d, end = %d, arraylen = %d\n", loopbreaker, start, end, arraylen);
}
/* not found, so return where to place it */
@@ -546,7 +546,7 @@ void calc_fcurve_bounds (FCurve *fcu, float *xmin, float *xmax, float *ymin, flo
if (ymax) *ymax= ymaxv;
}
else {
- if (G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("F-Curve calc bounds didn't find anything, so assuming minimum bounds of 1.0\n");
if (xmin) *xmin= 0.0f;
@@ -738,12 +738,12 @@ void fcurve_store_samples (FCurve *fcu, void *data, int start, int end, FcuSampl
/* sanity checks */
// TODO: make these tests report errors using reports not printf's
- if ELEM(NULL, fcu, sample_cb) {
+ if (ELEM(NULL, fcu, sample_cb)) {
printf("Error: No F-Curve with F-Curve Modifiers to Bake\n");
return;
}
if (start >= end) {
- printf("Error: Frame range for Sampled F-Curve creation is inappropriate \n");
+ printf("Error: Frame range for Sampled F-Curve creation is inappropriate\n");
return;
}
@@ -827,26 +827,26 @@ 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;
unsigned int a;
/* only beztriples have handles (bpoints don't though) */
- if ELEM(NULL, fcu, fcu->bezt)
+ if (ELEM(NULL, fcu, fcu->bezt))
return;
/* loop over beztriples */
for (a=0, bezt=fcu->bezt; a < fcu->totvert; a++, bezt++) {
short flag= 0;
- /* flag is initialised as selection status
+ /* flag is initialized as selection status
* of beztriple control-points (labelled 0,1,2)
*/
if (bezt->f2 & SELECT) flag |= (1<<1); // == 2
- if(use_handle == FALSE) {
- if(flag & 2) {
+ if (use_handle == FALSE) {
+ if (flag & 2) {
flag |= (1<<0) | (1<<2);
}
}
@@ -1001,7 +1001,7 @@ static float dtar_get_prop_val (ChannelDriver *driver, DriverTarget *dtar)
float value= 0.0f;
/* sanity check */
- if ELEM(NULL, driver, dtar)
+ if (ELEM(NULL, driver, dtar))
return 0.0f;
id= dtar_id_ensure_proxy_from(dtar->id);
@@ -1009,8 +1009,8 @@ static float dtar_get_prop_val (ChannelDriver *driver, DriverTarget *dtar)
/* error check for missing pointer... */
// TODO: tag the specific target too as having issues
if (id == NULL) {
- printf("Error: driver has an invalid target to use \n");
- if (G.f & G_DEBUG) printf("\tpath = %s\n", dtar->rna_path);
+ printf("Error: driver has an invalid target to use\n");
+ if (G.debug & G_DEBUG) printf("\tpath = %s\n", dtar->rna_path);
driver->flag |= DRIVER_FLAG_INVALID;
return 0.0f;
}
@@ -1020,7 +1020,7 @@ static float dtar_get_prop_val (ChannelDriver *driver, DriverTarget *dtar)
/* get property to read from, and get value as appropriate */
if (RNA_path_resolve_full(&id_ptr, dtar->rna_path, &ptr, &prop, &index)) {
- if(RNA_property_array_check(prop)) {
+ if (RNA_property_array_check(prop)) {
/* array */
if (index < RNA_property_array_length(&ptr, prop)) {
switch (RNA_property_type(prop)) {
@@ -1060,8 +1060,8 @@ static float dtar_get_prop_val (ChannelDriver *driver, DriverTarget *dtar)
}
else {
- if (G.f & G_DEBUG)
- printf("Driver Evaluation Error: cannot resolve target for %s -> %s \n", id->name, dtar->rna_path);
+ if (G.debug & G_DEBUG)
+ printf("Driver Evaluation Error: cannot resolve target for %s -> %s\n", id->name, dtar->rna_path);
driver->flag |= DRIVER_FLAG_INVALID;
return 0.0f;
@@ -1075,7 +1075,7 @@ static bPoseChannel *dtar_get_pchan_ptr (ChannelDriver *driver, DriverTarget *dt
{
ID *id;
/* sanity check */
- if ELEM(NULL, driver, dtar)
+ if (ELEM(NULL, driver, dtar))
return NULL;
id= dtar_id_ensure_proxy_from(dtar->id);
@@ -1118,11 +1118,11 @@ static float dvar_eval_rotDiff (ChannelDriver *driver, DriverVar *dvar)
/* check what the error was */
if ((pchan == NULL) && (pchan2 == NULL))
- printf("Driver Evaluation Error: Rotational difference failed - first 2 targets invalid \n");
+ printf("Driver Evaluation Error: Rotational difference failed - first 2 targets invalid\n");
else if (pchan == NULL)
- printf("Driver Evaluation Error: Rotational difference failed - first target not valid PoseChannel \n");
+ printf("Driver Evaluation Error: Rotational difference failed - first target not valid PoseChannel\n");
else if (pchan2 == NULL)
- printf("Driver Evaluation Error: Rotational difference failed - second target not valid PoseChannel \n");
+ printf("Driver Evaluation Error: Rotational difference failed - second target not valid PoseChannel\n");
/* stop here... */
return 0.0f;
@@ -1418,7 +1418,7 @@ void driver_free_variable (ChannelDriver *driver, DriverVar *dvar)
#ifdef WITH_PYTHON
/* since driver variables are cached, the expression needs re-compiling too */
- if(driver->type==DRIVER_TYPE_PYTHON)
+ if (driver->type==DRIVER_TYPE_PYTHON)
driver->flag |= DRIVER_FLAG_RENAMEVAR;
#endif
}
@@ -1446,7 +1446,7 @@ void driver_change_variable_type (DriverVar *dvar, int type)
/* store the flags */
dtar->flag = flags;
- /* object ID types only, or idtype not yet initialised*/
+ /* object ID types only, or idtype not yet initialized*/
if ((flags & DTAR_FLAG_ID_OB_ONLY) || (dtar->idtype == 0))
dtar->idtype= ID_OB;
}
@@ -1490,7 +1490,7 @@ void fcurve_free_driver(FCurve *fcu)
DriverVar *dvar, *dvarn;
/* sanity checks */
- if ELEM(NULL, fcu, fcu->driver)
+ if (ELEM(NULL, fcu, fcu->driver))
return;
driver= fcu->driver;
@@ -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) {
+ 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/fluidsim.c b/source/blender/blenkernel/intern/fluidsim.c
index 587fe75031f..a930818dd15 100644
--- a/source/blender/blenkernel/intern/fluidsim.c
+++ b/source/blender/blenkernel/intern/fluidsim.c
@@ -30,7 +30,11 @@
*/
-#include <stddef.h>
+// headers for fluidsim bobj meshes
+#include <stdlib.h>
+#include <zlib.h>
+#include <string.h>
+#include <stdio.h>
#include "MEM_guardedalloc.h"
@@ -54,14 +58,6 @@
#include "BKE_modifier.h"
#include "BKE_mesh.h"
-
-// headers for fluidsim bobj meshes
-#include <stdlib.h>
-#include "LBM_fluidsim.h"
-#include <zlib.h>
-#include <string.h>
-#include <stdio.h>
-
/* ************************* fluidsim bobj file handling **************************** */
@@ -91,20 +87,20 @@ void initElbeemMesh(struct Scene *scene, struct Object *ob,
*numVertices = totvert;
verts = MEM_callocN( totvert*3*sizeof(float), "elbeemmesh_vertices");
- for(i=0; i<totvert; i++) {
+ for (i=0; i<totvert; i++) {
copy_v3_v3(&verts[i*3], mvert[i].co);
- if(useGlobalCoords) { mul_m4_v3(ob->obmat, &verts[i*3]); }
+ if (useGlobalCoords) { mul_m4_v3(ob->obmat, &verts[i*3]); }
}
*vertices = verts;
- for(i=0; i<totface; i++) {
+ for (i=0; i<totface; i++) {
countTris++;
- if(mface[i].v4) { countTris++; }
+ if (mface[i].v4) { countTris++; }
}
*numTriangles = countTris;
tris = MEM_callocN( countTris*3*sizeof(int), "elbeemmesh_triangles");
countTris = 0;
- for(i=0; i<totface; i++) {
+ for (i=0; i<totface; i++) {
int face[4];
face[0] = mface[i].v1;
face[1] = mface[i].v2;
@@ -115,7 +111,7 @@ void initElbeemMesh(struct Scene *scene, struct Object *ob,
tris[countTris*3+1] = face[1];
tris[countTris*3+2] = face[2];
countTris++;
- if(face[3]) {
+ if (face[3]) {
tris[countTris*3+0] = face[0];
tris[countTris*3+1] = face[2];
tris[countTris*3+2] = face[3];
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index 8098706e370..ed5cf5e7924 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"
@@ -99,7 +101,7 @@ static FModifierTypeInfo FMI_MODNAME = {
/* Generators available:
* 1) simple polynomial generator:
* - Exanded form - (y = C[0]*(x^(n)) + C[1]*(x^(n-1)) + ... + C[n])
- * - Factorised form - (y = (C[0][0]*x + C[0][1]) * (C[1][0]*x + C[1][1]) * ... * (C[n][0]*x + C[n][1]))
+ * - Factorized form - (y = (C[0][0]*x + C[0][1]) * (C[1][0]*x + C[1][1]) * ... * (C[n][0]*x + C[n][1]))
*/
static void fcm_generator_free (FModifier *fcm)
@@ -198,7 +200,7 @@ static void fcm_generator_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *
{
FMod_Generator *data= (FMod_Generator *)fcm->data;
- /* behaviour depends on mode
+ /* behavior depends on mode
* NOTE: the data in its default state is fine too
*/
switch (data->mode) {
@@ -238,7 +240,7 @@ static void fcm_generator_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *
}
break;
- case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* factorised polynomial */
+ case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* Factorized polynomial */
{
float value= 1.0f, *cp=NULL;
unsigned int i;
@@ -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 */
@@ -333,7 +335,7 @@ static void fcm_fn_generator_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, floa
case FCM_GENERATOR_FN_TAN: /* tangent wave */
{
/* check that argument is not on one of the discontinuities (i.e. 90deg, 270 deg, etc) */
- if IS_EQ(fmod((arg - M_PI_2), M_PI), 0.0) {
+ if (IS_EQ(fmod((arg - M_PI_2), M_PI), 0.0)) {
if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0)
*cvalue = 0.0f; /* no value possible here */
}
@@ -367,7 +369,7 @@ static void fcm_fn_generator_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, floa
break;
default:
- printf("Invalid Function-Generator for F-Modifier - %d \n", data->type);
+ printf("Invalid Function-Generator for F-Modifier - %d\n", data->type);
}
/* execute function callback to set value if appropriate */
@@ -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 */
@@ -506,13 +508,15 @@ static FModifierTypeInfo FMI_ENVELOPE = {
/* Cycles F-Curve Modifier --------------------------- */
/* This modifier changes evaltime to something that exists within the curve's frame-range,
- * then re-evaluates modifier stack up to this point using the new time. This re-entrant behaviour
- * is very likely to be more time-consuming than the original approach... (which was tighly integrated into
+ * then re-evaluates modifier stack up to this point using the new time. This re-entrant behavior
+ * is very likely to be more time-consuming than the original approach... (which was tightly integrated into
* the calculation code...).
*
- * NOTE: this needs to be at the start of the stack to be of use, as it needs to know the extents of the keyframes/sample-data
- * Possible TODO - store length of cycle information that can be initialised from the extents of the keyframes/sample-data, and adjusted
- * as appropriate
+ * NOTE: this needs to be at the start of the stack to be of use, as it needs to know the extents of the
+ * keyframes/sample-data.
+ *
+ * Possible TODO - store length of cycle information that can be initialized from the extents of the
+ * keyframes/sample-data, and adjusted as appropriate.
*/
/* temp data used during evaluation */
@@ -586,7 +590,7 @@ static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float UNUSED(cvalue),
ofs= lastkey[0];
}
}
- if ELEM(0, side, mode)
+ if ((ELEM(0, side, mode)))
return evaltime;
/* find relative place within a cycle */
@@ -623,7 +627,7 @@ static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float UNUSED(cvalue),
/* check if 'cyclic extrapolation', and thus calculate y-offset for this cycle */
if (mode == FCM_EXTRAPOLATE_CYCLIC_OFFSET) {
- if(side < 0)
+ if (side < 0)
cycyofs = (float)floor((evaltime - ofs) / cycdx);
else
cycyofs = (float)ceil((evaltime - ofs) / cycdx);
@@ -631,10 +635,10 @@ static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float UNUSED(cvalue),
}
/* special case for cycle start/end */
- if(cyct == 0.0f) {
+ if (cyct == 0.0f) {
evaltime = (side == 1 ? lastkey[0] : prevkey[0]);
- if((mode == FCM_EXTRAPOLATE_MIRROR) && ((int)cycle % 2))
+ if ((mode == FCM_EXTRAPOLATE_MIRROR) && ((int)cycle % 2))
evaltime = (side == 1 ? prevkey[0] : lastkey[0]);
}
/* calculate where in the cycle we are (overwrite evaltime to reflect this) */
@@ -688,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 */
@@ -746,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 */
@@ -764,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 */
@@ -820,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 */
@@ -863,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 */
@@ -916,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 */
@@ -955,7 +959,7 @@ static void fmods_init_typeinfo (void)
*/
FModifierTypeInfo *get_fmodifier_typeinfo (int type)
{
- /* initialise the type-info list? */
+ /* initialize the type-info list? */
if (FMI_INIT) {
fmods_init_typeinfo();
FMI_INIT = 0;
@@ -969,7 +973,7 @@ FModifierTypeInfo *get_fmodifier_typeinfo (int type)
return fmodifiersTypeInfo[type];
}
else {
- printf("No valid F-Curve Modifier type-info data available. Type = %i \n", type);
+ printf("No valid F-Curve Modifier type-info data available. Type = %i\n", type);
}
return NULL;
@@ -996,14 +1000,14 @@ FModifier *add_fmodifier (ListBase *modifiers, int type)
FModifier *fcm;
/* sanity checks */
- if ELEM(NULL, modifiers, fmi)
+ if (ELEM(NULL, modifiers, fmi))
return NULL;
/* special checks for whether modifier can be added */
if ((modifiers->first) && (type == FMODIFIER_TYPE_CYCLES)) {
/* cycles modifier must be first in stack, so for now, don't add if it can't be */
// TODO: perhaps there is some better way, but for now,
- printf("Error: Cannot add 'Cycles' modifier to F-Curve, as 'Cycles' modifier can only be first in stack. \n");
+ printf("Error: Cannot add 'Cycles' modifier to F-Curve, as 'Cycles' modifier can only be first in stack.\n");
return NULL;
}
@@ -1059,7 +1063,7 @@ void copy_fmodifiers (ListBase *dst, ListBase *src)
{
FModifier *fcm, *srcfcm;
- if ELEM(NULL, dst, src)
+ if (ELEM(NULL, dst, src))
return;
dst->first= dst->last= NULL;
@@ -1102,7 +1106,7 @@ int remove_fmodifier (ListBase *modifiers, FModifier *fcm)
}
else {
// XXX this case can probably be removed some day, as it shouldn't happen...
- printf("remove_fmodifier() - no modifier stack given \n");
+ printf("remove_fmodifier() - no modifier stack given\n");
MEM_freeN(fcm);
return 0;
}
@@ -1130,7 +1134,7 @@ FModifier *find_active_fmodifier (ListBase *modifiers)
FModifier *fcm;
/* sanity checks */
- if ELEM(NULL, modifiers, modifiers->first)
+ if (ELEM(NULL, modifiers, modifiers->first))
return NULL;
/* loop over modifiers until 'active' one is found */
@@ -1149,7 +1153,7 @@ void set_active_fmodifier (ListBase *modifiers, FModifier *fcm)
FModifier *fm;
/* sanity checks */
- if ELEM(NULL, modifiers, modifiers->first)
+ if (ELEM(NULL, modifiers, modifiers->first))
return;
/* deactivate all, and set current one active */
@@ -1174,7 +1178,7 @@ short list_has_suitable_fmodifier (ListBase *modifiers, int mtype, short acttype
return (modifiers && modifiers->first);
/* sanity checks */
- if ELEM(NULL, modifiers, modifiers->first)
+ if (ELEM(NULL, modifiers, modifiers->first))
return 0;
/* find the first mdifier fitting these criteria */
@@ -1241,7 +1245,7 @@ static float eval_fmodifier_influence (FModifier *fcm, float evaltime)
}
/* evaluate time modifications imposed by some F-Curve Modifiers
- * - this step acts as an optimisation to prevent the F-Curve stack being evaluated
+ * - this step acts as an optimization to prevent the F-Curve stack being evaluated
* several times by modifiers requesting the time be modified, as the final result
* would have required using the modified time
* - modifiers only ever receive the unmodified time, as subsequent modifiers should be
@@ -1254,7 +1258,7 @@ float evaluate_time_fmodifiers (ListBase *modifiers, FCurve *fcu, float cvalue,
FModifier *fcm;
/* sanity checks */
- if ELEM(NULL, modifiers, modifiers->last)
+ if (ELEM(NULL, modifiers, modifiers->last))
return evaltime;
/* Starting from the end of the stack, calculate the time effects of various stacked modifiers
@@ -1303,7 +1307,7 @@ void evaluate_value_fmodifiers (ListBase *modifiers, FCurve *fcu, float *cvalue,
FModifier *fcm;
/* sanity checks */
- if ELEM(NULL, modifiers, modifiers->first)
+ if (ELEM(NULL, modifiers, modifiers->first))
return;
/* evaluate modifiers */
@@ -1341,7 +1345,7 @@ void fcurve_bake_modifiers (FCurve *fcu, int start, int end)
/* sanity checks */
// TODO: make these tests report errors using reports not printf's
- if ELEM(NULL, fcu, fcu->modifiers.first) {
+ if (ELEM(NULL, fcu, fcu->modifiers.first)) {
printf("Error: No F-Curve with F-Curve Modifiers to Bake\n");
return;
}
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 5a37a65ddbf..b2759f18e9b 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -68,7 +68,7 @@ void free_vfont(struct VFont *vf)
if (vf == NULL) return;
if (vf->data) {
- while(vf->data->characters.first)
+ while (vf->data->characters.first)
{
VChar *che = vf->data->characters.first;
@@ -106,7 +106,8 @@ static PackedFile *get_builtin_packedfile(void)
printf("Internal error, builtin font not loaded\n");
return NULL;
- } else {
+ }
+ else {
void *mem= MEM_mallocN(builtin_font_size, "vfd_builtin");
memcpy(mem, builtin_font_data, builtin_font_size);
@@ -119,8 +120,8 @@ void free_ttfont(void)
{
struct TmpFont *tf;
- for(tf= ttfdata.first; tf; tf= tf->next) {
- if(tf->pf) freePackedFile(tf->pf); /* NULL when the font file can't be found on disk */
+ for (tf= ttfdata.first; tf; tf= tf->next) {
+ if (tf->pf) freePackedFile(tf->pf); /* NULL when the font file can't be found on disk */
tf->pf= NULL;
tf->vfont= NULL;
}
@@ -131,13 +132,13 @@ struct TmpFont *vfont_find_tmpfont(VFont *vfont)
{
struct TmpFont *tmpfnt = NULL;
- if(vfont==NULL) return NULL;
+ if (vfont==NULL) return NULL;
// Try finding the font from font list
tmpfnt = ttfdata.first;
- while(tmpfnt)
+ while (tmpfnt)
{
- if(tmpfnt->vfont == vfont)
+ if (tmpfnt->vfont == vfont)
break;
tmpfnt = tmpfnt->next;
}
@@ -149,7 +150,7 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
struct TmpFont *tmpfnt = NULL;
PackedFile *tpf;
- if(vfont==NULL) return NULL;
+ if (vfont==NULL) return NULL;
// Try finding the font from font list
tmpfnt = vfont_find_tmpfont(vfont);
@@ -160,13 +161,13 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
if (strcmp(vfont->name, FO_BUILTIN_NAME)==0) {
pf= get_builtin_packedfile();
- } else {
+ }
+ else {
if (vfont->packedfile) {
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 +179,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
@@ -192,7 +193,7 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
BLI_addtail(&ttfdata, tmpfnt);
}
}
- if(!pf) {
+ if (!pf) {
printf("Font file doesn't exist: %s\n", vfont->name);
strcpy(vfont->name, FO_BUILTIN_NAME);
@@ -225,7 +226,8 @@ VFont *load_vfont(Main *bmain, const char *name)
pf= get_builtin_packedfile();
is_builtin= 1;
- } else {
+ }
+ else {
char dir[FILE_MAXDIR];
BLI_strncpy(dir, name, sizeof(dir));
@@ -257,8 +259,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;
@@ -306,8 +307,8 @@ static VChar *find_vfont_char(VFontData *vfd, intptr_t character)
{
VChar *che= NULL;
- for(che = vfd->characters.first; che; che = che->next) {
- if(che->index == character)
+ for (che = vfd->characters.first; che; che = che->next) {
+ if (che->index == character)
break;
}
return che; /* NULL if not found */
@@ -372,7 +373,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 +382,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;
@@ -392,11 +393,11 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
che= find_vfont_char(vfd, character);
// Select the glyph data
- if(che)
+ if (che)
nu1 = che->nurbsbase.first;
// Create the character
- while(nu1)
+ while (nu1)
{
bezt1 = nu1->bezt;
if (bezt1) {
@@ -436,7 +437,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
bezt2++;
}
}
- if(rot != 0.0f) {
+ if (rot != 0.0f) {
bezt2= nu2->bezt;
for (i=nu2->pntsu; i > 0; i--) {
fp= bezt2->vec[0];
@@ -456,7 +457,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
}
bezt2 = nu2->bezt;
- if(info->flag & CU_CHINFO_SMALLCAPS_CHECK) {
+ if (info->flag & CU_CHINFO_SMALLCAPS_CHECK) {
const float sca= cu->smallcaps_scale;
for (i= nu2->pntsu; i > 0; i--) {
fp= bezt2->vec[0];
@@ -511,10 +512,10 @@ int BKE_font_getselection(Object *ob, int *start, int *end)
static float char_width(Curve *cu, VChar *che, CharInfo *info)
{
// The character wasn't found, propably ascii = 0, then the width shall be 0 as well
- if(che == NULL) {
+ if (che == NULL) {
return 0.0f;
}
- else if(info->flag & CU_CHINFO_SMALLCAPS_CHECK) {
+ else if (info->flag & CU_CHINFO_SMALLCAPS_CHECK) {
return che->width * cu->smallcaps_scale;
}
else {
@@ -541,16 +542,16 @@ 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;
+ if (ob->type!=OB_FONT) return NULL;
// Set font data
cu= (Curve *) ob->data;
vfont= cu->vfont;
- if(cu->str == NULL) return NULL;
- if(vfont == NULL) return NULL;
+ if (cu->str == NULL) return NULL;
+ if (vfont == NULL) return NULL;
// Create unicode string
utf8len = BLI_strlen_utf8(cu->str);
@@ -577,8 +578,8 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
vfd= vfont_get_data(bmain, vfont);
/* The VFont Data can not be found */
- if(!vfd) {
- if(mem)
+ if (!vfd) {
+ if (mem)
MEM_freeN(mem);
return NULL;
}
@@ -617,9 +618,9 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
// Characters in the list
info = &(custrinfo[i]);
ascii = mem[i];
- if(info->flag & CU_CHINFO_SMALLCAPS) {
+ if (info->flag & CU_CHINFO_SMALLCAPS) {
ascii = towupper(ascii);
- if(mem[i] != ascii) {
+ if (mem[i] != ascii) {
mem[i]= ascii;
info->flag |= CU_CHINFO_SMALLCAPS_CHECK;
}
@@ -627,7 +628,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
vfont = which_vfont(cu, info);
- if(vfont==NULL) break;
+ if (vfont==NULL) break;
che= find_vfont_char(vfd, ascii);
@@ -636,7 +637,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
* But if the font is FO_BUILTIN_NAME then do not try loading since
* whole font is in the memory already
*/
- if(che == NULL && strcmp(vfont->name, FO_BUILTIN_NAME)) {
+ if (che == NULL && strcmp(vfont->name, FO_BUILTIN_NAME)) {
BLI_vfontchar_from_freetypefont(vfont, ascii);
}
@@ -645,7 +646,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
/* No VFont found */
if (vfont==NULL) {
- if(mem)
+ if (mem)
MEM_freeN(mem);
MEM_freeN(chartransdata);
return NULL;
@@ -658,7 +659,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
/* VFont Data for VFont couldn't be found */
if (!vfd) {
- if(mem)
+ if (mem)
MEM_freeN(mem);
MEM_freeN(chartransdata);
return NULL;
@@ -667,7 +668,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
twidth = char_width(cu, che, info);
// Calculate positions
- if((tb->w != 0.0f) && (ct->dobreak==0) && ((xof-(tb->x/cu->fsize)+twidth)*cu->fsize) > tb->w + cu->xof*cu->fsize) {
+ if ((tb->w != 0.0f) && (ct->dobreak==0) && ((xof-(tb->x/cu->fsize)+twidth)*cu->fsize) > tb->w + cu->xof*cu->fsize) {
// fprintf(stderr, "linewidth exceeded: %c%c%c...\n", mem[i], mem[i+1], mem[i+2]);
for (j=i; j && (mem[j] != '\n') && (mem[j] != '\r') && (chartransdata[j].dobreak==0); j--) {
if (mem[j]==' ' || mem[j]=='-') {
@@ -693,7 +694,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
}
}
}
- if(ascii== '\n' || ascii== '\r' || ascii==0 || ct->dobreak) {
+ if (ascii== '\n' || ascii== '\r' || ascii==0 || ct->dobreak) {
ct->xof= xof;
ct->yof= yof;
ct->linenr= lnr;
@@ -718,7 +719,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
/* XXX, has been unused for years, need to check if this is useful, r4613 r5282 - campbell */
#if 0
- if(ascii == '\n' || ascii == '\r')
+ if (ascii == '\n' || ascii == '\r')
xof = cu->xof;
else
xof= cu->xof + (tb->x/cu->fsize);
@@ -729,7 +730,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
cnr= 0;
wsnr= 0;
}
- else if(ascii==9) { /* TAB */
+ else if (ascii==9) { /* TAB */
float tabfac;
ct->xof= xof;
@@ -779,7 +780,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
tmp = mem;
for (i= 0; i<=slen; i++, tmp++, ct++) {
ascii = *tmp;
- if(ascii== '\n' || ascii== '\r' || ct->dobreak) cu->lines++;
+ if (ascii== '\n' || ascii== '\r' || ct->dobreak) cu->lines++;
}
// linedata is now: width of line
@@ -787,25 +788,27 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
// linedata3 is now: maxlen of that line
// linedata4 is now: number of whitespaces of line
- if(cu->spacemode!=CU_LEFT) {
+ if (cu->spacemode!=CU_LEFT) {
ct= chartransdata;
- if(cu->spacemode==CU_RIGHT) {
- for(i=0;i<lnr;i++) linedata[i]= linedata3[i]-linedata[i];
+ if (cu->spacemode==CU_RIGHT) {
+ for (i=0;i<lnr;i++) linedata[i]= linedata3[i]-linedata[i];
for (i=0; i<=slen; i++) {
ct->xof+= linedata[ct->linenr];
ct++;
}
- } else if(cu->spacemode==CU_MIDDLE) {
- for(i=0;i<lnr;i++) linedata[i]= (linedata3[i]-linedata[i])/2;
+ }
+ else if (cu->spacemode==CU_MIDDLE) {
+ for (i=0;i<lnr;i++) linedata[i]= (linedata3[i]-linedata[i])/2;
for (i=0; i<=slen; i++) {
ct->xof+= linedata[ct->linenr];
ct++;
}
- } else if((cu->spacemode==CU_FLUSH) &&
+ }
+ else if ((cu->spacemode==CU_FLUSH) &&
(cu->tb[0].w != 0.0f)) {
- for(i=0;i<lnr;i++)
- if(linedata2[i]>1)
+ for (i=0;i<lnr;i++)
+ if (linedata2[i]>1)
linedata[i]= (linedata3[i]-linedata[i])/(linedata2[i]-1);
for (i=0; i<=slen; i++) {
for (j=i; (!ELEM3(mem[j], '\0', '\n', '\r')) && (chartransdata[j].dobreak == 0) && (j < slen); j++) {
@@ -818,7 +821,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
ct++;
}
}
- else if((cu->spacemode==CU_JUSTIFY) && (cu->tb[0].w != 0.0f)) {
+ else if ((cu->spacemode==CU_JUSTIFY) && (cu->tb[0].w != 0.0f)) {
float curofs= 0.0f;
for (i=0; i<=slen; i++) {
for (j=i; (mem[j]) && (mem[j]!='\n') &&
@@ -836,14 +839,14 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
/* TEXT ON CURVE */
/* Note: Only OB_CURVE objects could have a path */
- if(cu->textoncurve && cu->textoncurve->type==OB_CURVE) {
+ if (cu->textoncurve && cu->textoncurve->type==OB_CURVE) {
Curve *cucu= cu->textoncurve->data;
int oldflag= cucu->flag;
cucu->flag |= (CU_PATH+CU_FOLLOW);
- if(cucu->path==NULL) makeDispListCurveTypes(scene, cu->textoncurve, 0);
- if(cucu->path) {
+ if (cucu->path==NULL) makeDispListCurveTypes(scene, cu->textoncurve, 0);
+ if (cucu->path) {
float distfac, imat[4][4], imat3[3][3], cmat[3][3];
float minx, maxx, miny, maxy;
float timeofs, sizefac;
@@ -859,10 +862,10 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
maxx=maxy= -1.0e20f;
ct= chartransdata;
for (i=0; i<=slen; i++, ct++) {
- if(minx>ct->xof) minx= ct->xof;
- if(maxx<ct->xof) maxx= ct->xof;
- if(miny>ct->yof) miny= ct->yof;
- if(maxy<ct->yof) maxy= ct->yof;
+ if (minx>ct->xof) minx= ct->xof;
+ if (maxx<ct->xof) maxx= ct->xof;
+ if (miny>ct->yof) miny= ct->yof;
+ if (maxy<ct->yof) maxy= ct->yof;
}
/* we put the x-coordinaat exact at the curve, the y is rotated */
@@ -871,17 +874,17 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
distfac= sizefac*cucu->path->totdist/(maxx-minx);
timeofs= 0.0f;
- if(distfac > 1.0f) {
+ if (distfac > 1.0f) {
/* path longer than text: spacemode involves */
distfac= 1.0f/distfac;
- if(cu->spacemode==CU_RIGHT) {
+ if (cu->spacemode==CU_RIGHT) {
timeofs= 1.0f-distfac;
}
- else if(cu->spacemode==CU_MIDDLE) {
+ else if (cu->spacemode==CU_MIDDLE) {
timeofs= (1.0f-distfac)/2.0f;
}
- else if(cu->spacemode==CU_FLUSH) distfac= 1.0f;
+ else if (cu->spacemode==CU_FLUSH) distfac= 1.0f;
}
else distfac= 1.0;
@@ -939,13 +942,13 @@ 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) {
+ 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);
- else if((mode==FO_CURSDOWN || mode==FO_PAGEDOWN) && ct->linenr==lnr);
+ if ((mode==FO_CURSUP || mode==FO_PAGEUP) && ct->linenr==0);
+ else if ((mode==FO_CURSDOWN || mode==FO_PAGEDOWN) && ct->linenr==lnr);
else {
switch(mode) {
case FO_CURSUP: lnr= ct->linenr-1; break;
@@ -958,11 +961,11 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
cu->pos= 0;
ct= chartransdata;
for (i= 0; i<slen; i++) {
- if(ct->linenr==lnr) {
- if(ct->charnr==cnr) break;
- if( (ct+1)->charnr==0) break;
+ if (ct->linenr==lnr) {
+ if (ct->charnr==cnr) break;
+ if ( (ct+1)->charnr==0) break;
}
- else if(ct->linenr>lnr) break;
+ else if (ct->linenr>lnr) break;
cu->pos++;
ct++;
}
@@ -970,7 +973,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
}
/* cursor first */
- if(cu->editfont) {
+ if (cu->editfont) {
float si, co;
ct= chartransdata+cu->pos;
@@ -1004,7 +1007,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
return NULL;
}
- if(mode == FO_EDIT) {
+ if (mode == FO_EDIT) {
/* make nurbdata */
freeNurblist(&cu->nurb);
@@ -1018,7 +1021,7 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
info->mat_nr = 0;
}
// We do not want to see any character for \n or \r
- if(cha != '\n' && cha != '\r')
+ if (cha != '\n' && cha != '\r')
buildchar(bmain, cu, cha, info, ct->xof, ct->yof, ct->rot, i);
if ((info->flag & CU_CHINFO_UNDERLINE) && (cu->textoncurve == NULL) && (cha != '\n') && (cha != '\r')) {
@@ -1069,12 +1072,12 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
}
}
- if(mode==FO_DUPLI) {
+ if (mode==FO_DUPLI) {
MEM_freeN(mem);
return chartransdata;
}
- if(mem)
+ if (mem)
MEM_freeN(mem);
MEM_freeN(chartransdata);
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index adbc0f03528..811cb881f6e 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -151,7 +151,7 @@ bGPDframe *gpencil_frame_addnew (bGPDlayer *gpl, int cframe)
/* check whether frame was added successfully */
if (state == -1) {
MEM_freeN(gpf);
- printf("Error: frame (%d) existed already for this layer \n", cframe);
+ printf("Error: frame (%d) existed already for this layer\n", cframe);
}
else if (state == 0) {
/* add to end then! */
@@ -428,7 +428,7 @@ bGPDframe *gpencil_layer_getframe (bGPDlayer *gpl, int cframe, short addnew)
gpl->actframe= gpf;
else {
/* unresolved errogenous situation! */
- printf("Error: cannot find appropriate gp-frame \n");
+ printf("Error: cannot find appropriate gp-frame\n");
/* gpl->actframe should still be NULL */
}
}
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index 183483ef7a8..b20a59ed6f8 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -66,7 +66,7 @@ void free_group_objects(Group *group)
/* don't free group itself */
GroupObject *go;
- while(group->gobject.first) {
+ while (group->gobject.first) {
go= group->gobject.first;
BLI_remlink(&group->gobject, go);
free_group_object(go);
@@ -82,52 +82,52 @@ void unlink_group(Group *group)
SceneRenderLayer *srl;
ParticleSystem *psys;
- for(ma= bmain->mat.first; ma; ma= ma->id.next) {
- if(ma->group==group)
+ for (ma= bmain->mat.first; ma; ma= ma->id.next) {
+ if (ma->group==group)
ma->group= NULL;
}
- for(ma= bmain->mat.first; ma; ma= ma->id.next) {
- if(ma->group==group)
+ for (ma= bmain->mat.first; ma; ma= ma->id.next) {
+ if (ma->group==group)
ma->group= NULL;
}
for (sce= bmain->scene.first; sce; sce= sce->id.next) {
Base *base= sce->base.first;
/* ensure objects are not in this group */
- for(; base; base= base->next) {
- if(rem_from_group(group, base->object, sce, base) && find_group(base->object, NULL)==NULL) {
+ for (; base; base= base->next) {
+ if (rem_from_group(group, base->object, sce, base) && find_group(base->object, NULL)==NULL) {
base->object->flag &= ~OB_FROMGROUP;
base->flag &= ~OB_FROMGROUP;
}
}
- for(srl= sce->r.layers.first; srl; srl= srl->next) {
+ for (srl= sce->r.layers.first; srl; srl= srl->next) {
if (srl->light_override==group)
srl->light_override= NULL;
}
}
- for(ob= bmain->object.first; ob; ob= ob->id.next) {
+ for (ob= bmain->object.first; ob; ob= ob->id.next) {
- if(ob->dup_group==group) {
+ if (ob->dup_group==group) {
ob->dup_group= NULL;
#if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */
{
bActionStrip *strip;
/* duplicator strips use a group object, we remove it */
- for(strip= ob->nlastrips.first; strip; strip= strip->next) {
- if(strip->object)
+ for (strip= ob->nlastrips.first; strip; strip= strip->next) {
+ if (strip->object)
strip->object= NULL;
}
}
#endif
}
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- if(psys->part->dup_group==group)
+ for (psys=ob->particlesystem.first; psys; psys=psys->next) {
+ if (psys->part->dup_group==group)
psys->part->dup_group= NULL;
#if 0 /* not used anymore, only keps for readfile.c, no need to account for this */
- if(psys->part->eff_group==group)
+ if (psys->part->eff_group==group)
psys->part->eff_group= NULL;
#endif
}
@@ -162,11 +162,11 @@ static int add_to_group_internal(Group *group, Object *ob)
{
GroupObject *go;
- if(group==NULL || ob==NULL) return 0;
+ if (group==NULL || ob==NULL) return 0;
/* check if the object has been added already */
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob==ob) return 0;
+ for (go= group->gobject.first; go; go= go->next) {
+ if (go->ob==ob) return 0;
}
go= MEM_callocN(sizeof(GroupObject), "groupobject");
@@ -179,15 +179,15 @@ static int add_to_group_internal(Group *group, Object *ob)
int add_to_group(Group *group, Object *object, Scene *scene, Base *base)
{
- if(add_to_group_internal(group, object)) {
- if((object->flag & OB_FROMGROUP)==0) {
+ if (add_to_group_internal(group, object)) {
+ if ((object->flag & OB_FROMGROUP)==0) {
- if(scene && base==NULL)
+ if (scene && base==NULL)
base= object_in_scene(object, scene);
object->flag |= OB_FROMGROUP;
- if(base)
+ if (base)
base->flag |= OB_FROMGROUP;
}
return 1;
@@ -202,12 +202,12 @@ static int rem_from_group_internal(Group *group, Object *ob)
{
GroupObject *go, *gon;
int removed = 0;
- if(group==NULL) return 0;
+ if (group==NULL) return 0;
go= group->gobject.first;
- while(go) {
+ while (go) {
gon= go->next;
- if(go->ob==ob) {
+ if (go->ob==ob) {
BLI_remlink(&group->gobject, go);
free_group_object(go);
removed = 1;
@@ -220,15 +220,15 @@ static int rem_from_group_internal(Group *group, Object *ob)
int rem_from_group(Group *group, Object *object, Scene *scene, Base *base)
{
- if(rem_from_group_internal(group, object)) {
+ if (rem_from_group_internal(group, object)) {
/* object can be NULL */
- if(object && find_group(object, NULL) == NULL) {
- if(scene && base==NULL)
+ if (object && find_group(object, NULL) == NULL) {
+ if (scene && base==NULL)
base= object_in_scene(object, scene);
object->flag &= ~OB_FROMGROUP;
- if(base)
+ if (base)
base->flag &= ~OB_FROMGROUP;
}
return 1;
@@ -242,10 +242,10 @@ int object_in_group(Object *ob, Group *group)
{
GroupObject *go;
- if(group==NULL || ob==NULL) return 0;
+ if (group==NULL || ob==NULL) return 0;
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob==ob)
+ for (go= group->gobject.first; go; go= go->next) {
+ if (go->ob==ob)
return 1;
}
return 0;
@@ -258,8 +258,8 @@ Group *find_group(Object *ob, Group *group)
else
group= G.main->group.first;
- while(group) {
- if(object_in_group(ob, group))
+ while (group) {
+ if (object_in_group(ob, group))
return group;
group= group->id.next;
}
@@ -270,10 +270,10 @@ void group_tag_recalc(Group *group)
{
GroupObject *go;
- if(group==NULL) return;
+ if (group==NULL) return;
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob)
+ for (go= group->gobject.first; go; go= go->next) {
+ if (go->ob)
go->ob->recalc= go->recalc;
}
}
@@ -283,12 +283,12 @@ int group_is_animated(Object *UNUSED(parent), Group *group)
GroupObject *go;
#if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */
- if(parent->nlastrips.first)
+ if (parent->nlastrips.first)
return 1;
#endif
- for(go= group->gobject.first; go; go= go->next)
- if(go->ob && go->ob->proxy)
+ for (go= group->gobject.first; go; go= go->next)
+ if (go->ob && go->ob->proxy)
return 1;
return 0;
@@ -304,11 +304,11 @@ static void group_replaces_nla(Object *parent, Object *target, char mode)
static int done= 0;
bActionStrip *strip, *nstrip;
- if(mode=='s') {
+ if (mode=='s') {
- for(strip= parent->nlastrips.first; strip; strip= strip->next) {
- if(strip->object==target) {
- if(done==0) {
+ for (strip= parent->nlastrips.first; strip; strip= strip->next) {
+ if (strip->object==target) {
+ if (done==0) {
/* clear nla & action from object */
nlastrips= target->nlastrips;
target->nlastrips.first= target->nlastrips.last= NULL;
@@ -322,8 +322,8 @@ static void group_replaces_nla(Object *parent, Object *target, char mode)
}
}
}
- else if(mode=='e') {
- if(done) {
+ else if (mode=='e') {
+ if (done) {
BLI_freelistN(&target->nlastrips);
target->nlastrips= nlastrips;
target->action= action;
@@ -337,28 +337,28 @@ 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)
{
GroupObject *go;
-#if 0 /* warning, isnt clearing the recalc flag on the object which causes it to run all the time,
+#if 0 /* warning, isn't clearing the recalc flag on the object which causes it to run all the time,
* not just on frame change.
- * This isnt working because the animation data is only re-evalyated on frame change so commenting for now
+ * This isn't working because the animation data is only re-evalyated on frame change so commenting for now
* but when its enabled at some point it will need to be changed so as not to update so much - campbell */
/* if animated group... */
- if(parent->nlastrips.first) {
+ if (parent->nlastrips.first) {
int cfrao;
/* switch to local time */
cfrao= scene->r.cfra;
/* we need a DAG per group... */
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob && go->recalc) {
+ for (go= group->gobject.first; go; go= go->next) {
+ if (go->ob && go->recalc) {
go->ob->recalc= go->recalc;
group_replaces_nla(parent, go->ob, 's');
@@ -377,9 +377,9 @@ void group_handle_recalc_and_update(Scene *scene, Object *UNUSED(parent), Group
#endif
{
/* only do existing tags, as set by regular depsgraph */
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob) {
- if(go->ob->recalc) {
+ for (go= group->gobject.first; go; go= go->next) {
+ if (go->ob) {
+ if (go->ob->recalc) {
object_handle_update(scene, go->ob);
}
}
@@ -392,17 +392,17 @@ Object *group_get_member_with_action(Group *group, bAction *act)
{
GroupObject *go;
- if(group==NULL || act==NULL) return NULL;
+ if (group==NULL || act==NULL) return NULL;
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob) {
- if(go->ob->action==act)
+ for (go= group->gobject.first; go; go= go->next) {
+ if (go->ob) {
+ if (go->ob->action==act)
return go->ob;
- if(go->ob->nlastrips.first) {
+ if (go->ob->nlastrips.first) {
bActionStrip *strip;
- for(strip= go->ob->nlastrips.first; strip; strip= strip->next) {
- if(strip->act==act)
+ for (strip= go->ob->nlastrips.first; strip; strip= strip->next) {
+ if (strip->act==act)
return go->ob;
}
}
@@ -419,18 +419,18 @@ void group_relink_nla_objects(Object *ob)
GroupObject *go;
bActionStrip *strip;
- if(ob==NULL || ob->dup_group==NULL) return;
+ if (ob==NULL || ob->dup_group==NULL) return;
group= ob->dup_group;
- for(strip= ob->nlastrips.first; strip; strip= strip->next) {
- if(strip->object) {
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob) {
- if(strcmp(go->ob->id.name, strip->object->id.name)==0)
+ for (strip= ob->nlastrips.first; strip; strip= strip->next) {
+ if (strip->object) {
+ for (go= group->gobject.first; go; go= go->next) {
+ if (go->ob) {
+ if (strcmp(go->ob->id.name, strip->object->id.name)==0)
break;
}
}
- if(go)
+ if (go)
strip->object= go->ob;
else
strip->object= NULL;
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c
index 58c88682d3f..edde21ed7c8 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;
@@ -92,7 +91,7 @@ static int get_next_free_id(void)
while (BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(startId)) && startId>=gFirstIconId)
startId++;
- /* if we found a suitable one that isnt used yet, return it */
+ /* if we found a suitable one that isn't used yet, return it */
if (startId>=gFirstIconId)
return startId;
@@ -111,7 +110,7 @@ void BKE_icons_init(int first_dyn_id)
void BKE_icons_free(void)
{
- if(gIcons)
+ if (gIcons)
BLI_ghash_free(gIcons, NULL, icon_free);
gIcons = NULL;
}
@@ -148,7 +147,7 @@ void BKE_previewimg_freefunc(void *link)
void BKE_previewimg_free(PreviewImage **prv)
{
- if(prv && (*prv)) {
+ if (prv && (*prv)) {
BKE_previewimg_freefunc(*prv);
*prv = NULL;
}
@@ -164,7 +163,8 @@ struct PreviewImage* BKE_previewimg_copy(PreviewImage *prv)
for (i=0; i < NUM_ICON_SIZES; ++i) {
if (prv->rect[i]) {
prv_img->rect[i] = MEM_dupallocN(prv->rect[i]);
- } else {
+ }
+ else {
prv_img->rect[i] = NULL;
}
}
@@ -177,19 +177,24 @@ void BKE_previewimg_free_id(ID *id)
if (GS(id->name) == ID_MA) {
Material *mat = (Material*)id;
BKE_previewimg_free(&mat->preview);
- } else if (GS(id->name) == ID_TE) {
+ }
+ else if (GS(id->name) == ID_TE) {
Tex *tex = (Tex*)id;
BKE_previewimg_free(&tex->preview);
- } else if (GS(id->name) == ID_WO) {
+ }
+ else if (GS(id->name) == ID_WO) {
World *wo = (World*)id;
BKE_previewimg_free(&wo->preview);
- } else if (GS(id->name) == ID_LA) {
+ }
+ else if (GS(id->name) == ID_LA) {
Lamp *la = (Lamp*)id;
BKE_previewimg_free(&la->preview);
- } else if (GS(id->name) == ID_IM) {
+ }
+ else if (GS(id->name) == ID_IM) {
Image *img = (Image*)id;
BKE_previewimg_free(&img->preview);
- } else if (GS(id->name) == ID_BR) {
+ }
+ else if (GS(id->name) == ID_BR) {
Brush *br = (Brush*)id;
BKE_previewimg_free(&br->preview);
}
@@ -203,23 +208,28 @@ PreviewImage* BKE_previewimg_get(ID *id)
Material *mat = (Material*)id;
if (!mat->preview) mat->preview = BKE_previewimg_create();
prv_img = mat->preview;
- } else if (GS(id->name) == ID_TE) {
+ }
+ else if (GS(id->name) == ID_TE) {
Tex *tex = (Tex*)id;
if (!tex->preview) tex->preview = BKE_previewimg_create();
prv_img = tex->preview;
- } else if (GS(id->name) == ID_WO) {
+ }
+ else if (GS(id->name) == ID_WO) {
World *wo = (World*)id;
if (!wo->preview) wo->preview = BKE_previewimg_create();
prv_img = wo->preview;
- } else if (GS(id->name) == ID_LA) {
+ }
+ else if (GS(id->name) == ID_LA) {
Lamp *la = (Lamp*)id;
if (!la->preview) la->preview = BKE_previewimg_create();
prv_img = la->preview;
- } else if (GS(id->name) == ID_IM) {
+ }
+ else if (GS(id->name) == ID_IM) {
Image *img = (Image*)id;
if (!img->preview) img->preview = BKE_previewimg_create();
prv_img = img->preview;
- } else if (GS(id->name) == ID_BR) {
+ }
+ else if (GS(id->name) == ID_BR) {
Brush *br = (Brush*)id;
if (!br->preview) br->preview = BKE_previewimg_create();
prv_img = br->preview;
@@ -236,8 +246,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 +311,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 093399832a1..1fee5cfa359 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");
@@ -74,7 +74,7 @@ IDProperty *IDP_NewIDPArray(const char *name)
IDProperty *IDP_CopyIDPArray(IDProperty *array)
{
- /* dont use MEM_dupallocN because this may be part of an array */
+ /* don't use MEM_dupallocN because this may be part of an array */
IDProperty *narray = MEM_mallocN(sizeof(IDProperty), "IDP_CopyIDPArray"), *tmp;
int i;
@@ -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);
@@ -103,7 +103,7 @@ void IDP_FreeIDPArray(IDProperty *prop)
for (i=0; i<prop->len; i++)
IDP_FreeProperty(GETPROP(prop, i));
- if(prop->data.pointer)
+ if (prop->data.pointer)
MEM_freeN(prop->data.pointer);
}
@@ -139,7 +139,7 @@ void IDP_ResizeIDPArray(IDProperty *prop, int newlen)
if (newlen <= prop->totallen && prop->totallen - newlen < 200) {
int i;
- for(i=newlen; i<prop->len; i++)
+ for (i=newlen; i<prop->len; i++)
IDP_FreeProperty(GETPROP(prop, i));
prop->len = newlen;
@@ -170,7 +170,7 @@ void IDP_ResizeIDPArray(IDProperty *prop, int newlen)
memcpy(newarr, prop->data.pointer, newlen*sizeof(IDProperty));
}
- if(prop->data.pointer)
+ if (prop->data.pointer)
MEM_freeN(prop->data.pointer);
prop->data.pointer = newarr;
prop->len = newlen;
@@ -180,16 +180,16 @@ void IDP_ResizeIDPArray(IDProperty *prop, int newlen)
/* ----------- Numerical Array Type ----------- */
static void idp_resize_group_array(IDProperty *prop, int newlen, void *newarr)
{
- if(prop->subtype != IDP_GROUP)
+ if (prop->subtype != IDP_GROUP)
return;
- if(newlen >= prop->len) {
+ if (newlen >= prop->len) {
/* bigger */
IDProperty **array= newarr;
IDPropertyTemplate val;
int a;
- for(a=prop->len; a<newlen; a++) {
+ for (a=prop->len; a<newlen; a++) {
val.i = 0; /* silence MSVC warning about uninitialized var when debugging */
array[a]= IDP_New(IDP_GROUP, &val, "IDP_ResizeArray group");
}
@@ -199,7 +199,7 @@ static void idp_resize_group_array(IDProperty *prop, int newlen, void *newarr)
IDProperty **array= prop->data.pointer;
int a;
- for(a=newlen; a<prop->len; a++) {
+ for (a=newlen; a<prop->len; a++) {
IDP_FreeProperty(array[a]);
MEM_freeN(array[a]);
}
@@ -277,11 +277,11 @@ static IDProperty *IDP_CopyArray(IDProperty *prop)
if (prop->data.pointer) {
newp->data.pointer = MEM_dupallocN(prop->data.pointer);
- if(prop->type == IDP_GROUP) {
+ if (prop->type == IDP_GROUP) {
IDProperty **array= newp->data.pointer;
int a;
- for(a=0; a<prop->len; a++)
+ for (a=0; a<prop->len; a++)
array[a]= IDP_CopyProperty(array[a]);
}
}
@@ -316,7 +316,7 @@ IDProperty *IDP_NewString(const char *st, const char *name, int maxlen)
else {
int stlen = strlen(st);
- if(maxlen > 0 && maxlen < stlen)
+ if (maxlen > 0 && maxlen < stlen)
stlen = maxlen;
stlen++; /* null terminator '\0' */
@@ -349,7 +349,7 @@ void IDP_AssignString(IDProperty *prop, const char *st, int maxlen)
{
int stlen = strlen(st);
- if(maxlen > 0 && maxlen < stlen)
+ if (maxlen > 0 && maxlen < stlen)
stlen= maxlen;
if (prop->subtype == IDP_STRING_SUB_BYTE) {
@@ -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);
@@ -387,7 +387,7 @@ void IDP_ConcatString(IDProperty *str1, IDProperty *append)
void IDP_FreeString(IDProperty *prop)
{
- if(prop->data.pointer)
+ if (prop->data.pointer)
MEM_freeN(prop->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;
@@ -608,9 +608,9 @@ IDProperty *IDP_GetProperties(ID *id, int create_if_needed)
if (create_if_needed) {
id->properties = MEM_callocN(sizeof(IDProperty), "IDProperty");
id->properties->type = IDP_GROUP;
- /* dont overwite the data's name and type
+ /* don't overwrite the data's name and type
* some functions might need this if they
- * dont have a real ID, should be named elsewhere - Campbell */
+ * don't have a real ID, should be named elsewhere - Campbell */
/* strcpy(id->name, "top_level_group");*/
}
return id->properties;
@@ -619,59 +619,59 @@ IDProperty *IDP_GetProperties(ID *id, int create_if_needed)
int IDP_EqualsProperties(IDProperty *prop1, IDProperty *prop2)
{
- if(prop1 == NULL && prop2 == NULL)
+ if (prop1 == NULL && prop2 == NULL)
return 1;
- else if(prop1 == NULL || prop2 == NULL)
+ else if (prop1 == NULL || prop2 == NULL)
return 0;
- else if(prop1->type != prop2->type)
+ else if (prop1->type != prop2->type)
return 0;
- if(prop1->type == IDP_INT)
+ if (prop1->type == IDP_INT)
return (IDP_Int(prop1) == IDP_Int(prop2));
- else if(prop1->type == IDP_FLOAT)
+ else if (prop1->type == IDP_FLOAT)
return (IDP_Float(prop1) == IDP_Float(prop2));
- else if(prop1->type == IDP_DOUBLE)
+ else if (prop1->type == IDP_DOUBLE)
return (IDP_Double(prop1) == IDP_Double(prop2));
- else if(prop1->type == IDP_STRING)
+ else if (prop1->type == IDP_STRING)
return ((prop1->len == prop2->len) && strncmp(IDP_String(prop1), IDP_String(prop2), prop1->len) == 0);
- else if(prop1->type == IDP_ARRAY) {
- if(prop1->len == prop2->len && prop1->subtype == prop2->subtype)
+ else if (prop1->type == IDP_ARRAY) {
+ if (prop1->len == prop2->len && prop1->subtype == prop2->subtype)
return memcmp(IDP_Array(prop1), IDP_Array(prop2), idp_size_table[(int)prop1->subtype]*prop1->len);
else
return 0;
}
- else if(prop1->type == IDP_GROUP) {
+ else if (prop1->type == IDP_GROUP) {
IDProperty *link1, *link2;
- if(BLI_countlist(&prop1->data.group) != BLI_countlist(&prop2->data.group))
+ if (BLI_countlist(&prop1->data.group) != BLI_countlist(&prop2->data.group))
return 0;
- for(link1=prop1->data.group.first; link1; link1=link1->next) {
+ for (link1=prop1->data.group.first; link1; link1=link1->next) {
link2= IDP_GetPropertyFromGroup(prop2, link1->name);
- if(!IDP_EqualsProperties(link1, link2))
+ if (!IDP_EqualsProperties(link1, link2))
return 0;
}
return 1;
}
- else if(prop1->type == IDP_IDPARRAY) {
+ else if (prop1->type == IDP_IDPARRAY) {
IDProperty *array1= IDP_IDPArray(prop1);
IDProperty *array2= IDP_IDPArray(prop2);
int i;
- if(prop1->len != prop2->len)
+ if (prop1->len != prop2->len)
return 0;
- for(i=0; i<prop1->len; i++)
- if(!IDP_EqualsProperties(&array1[i], &array2[i]))
+ for (i=0; i<prop1->len; i++)
+ if (!IDP_EqualsProperties(&array1[i], &array2[i]))
return 0;
}
return 1;
}
-/* 'val' is never NULL, dont check */
+/* 'val' is never NULL, don't check */
IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *name)
{
IDProperty *prop=NULL;
@@ -703,7 +703,8 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n
prop->data.pointer = MEM_callocN(idp_size_table[val->array.type]*val->array.len, "id property array");
prop->len = prop->totallen = val->array.len;
break;
- } else {
+ }
+ else {
return NULL;
}
}
@@ -761,9 +762,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 +783,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..3b91afbc126 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -160,8 +160,8 @@ static void de_interlace_st(struct ImBuf *ibuf) /* standard fields */
void image_de_interlace(Image *ima, int odd)
{
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
- if(ibuf) {
- if(odd)
+ if (ibuf) {
+ if (odd)
de_interlace_st(ibuf);
else
de_interlace_ng(ibuf);
@@ -174,7 +174,7 @@ static void image_free_buffers(Image *ima)
{
ImBuf *ibuf;
- while((ibuf = ima->ibufs.first)) {
+ while ((ibuf = ima->ibufs.first)) {
BLI_remlink(&ima->ibufs, ibuf);
if (ibuf->userdata) {
@@ -184,10 +184,10 @@ static void image_free_buffers(Image *ima)
IMB_freeImBuf(ibuf);
}
- if(ima->anim) IMB_free_anim(ima->anim);
+ if (ima->anim) IMB_free_anim(ima->anim);
ima->anim= NULL;
- if(ima->rr) {
+ if (ima->rr) {
RE_FreeRenderResult(ima->rr);
ima->rr= NULL;
}
@@ -212,8 +212,8 @@ void free_image(Image *ima)
BKE_previewimg_free(&ima->preview);
- for(a=0; a<IMA_MAX_RENDER_SLOT; a++) {
- if(ima->renders[a]) {
+ for (a=0; a<IMA_MAX_RENDER_SLOT; a++) {
+ if (ima->renders[a]) {
RE_FreeRenderResult(ima->renders[a]);
ima->renders[a]= NULL;
}
@@ -226,7 +226,7 @@ static Image *image_alloc(const char *name, short source, short type)
Image *ima;
ima= alloc_libblock(&G.main->image, ID_IM, name);
- if(ima) {
+ if (ima) {
ima->ok= IMA_OK;
ima->xrep= ima->yrep= 1;
@@ -246,14 +246,14 @@ static ImBuf *image_get_ibuf(Image *ima, int index, int frame)
/* this function is intended to be thread safe. with IMA_NO_INDEX this
* should be OK, but when iterating over the list this is more tricky
* */
- if(index==IMA_NO_INDEX)
+ if (index==IMA_NO_INDEX)
return ima->ibufs.first;
else {
ImBuf *ibuf;
index= IMA_MAKE_INDEX(frame, index);
- for(ibuf= ima->ibufs.first; ibuf; ibuf= ibuf->next)
- if(ibuf->index==index)
+ for (ibuf= ima->ibufs.first; ibuf; ibuf= ibuf->next)
+ if (ibuf->index==index)
return ibuf;
return NULL;
@@ -263,7 +263,7 @@ static ImBuf *image_get_ibuf(Image *ima, int index, int frame)
/* no ima->ibuf anymore, but listbase */
static void image_remove_ibuf(Image *ima, ImBuf *ibuf)
{
- if(ibuf) {
+ if (ibuf) {
BLI_remlink(&ima->ibufs, ibuf);
IMB_freeImBuf(ibuf);
}
@@ -273,19 +273,19 @@ static void image_remove_ibuf(Image *ima, ImBuf *ibuf)
/* no ima->ibuf anymore, but listbase */
static void image_assign_ibuf(Image *ima, ImBuf *ibuf, int index, int frame)
{
- if(ibuf) {
+ if (ibuf) {
ImBuf *link;
- if(index!=IMA_NO_INDEX)
+ if (index!=IMA_NO_INDEX)
index= IMA_MAKE_INDEX(frame, index);
/* insert based on index */
- for(link= ima->ibufs.first; link; link= link->next)
- if(link->index>=index)
+ for (link= ima->ibufs.first; link; link= link->next)
+ if (link->index>=index)
break;
ibuf->index= index;
- if(ima->flag & IMA_CM_PREDIVIDE)
+ if (ima->flag & IMA_CM_PREDIVIDE)
ibuf->flags |= IB_cm_predivide;
else
ibuf->flags &= ~IB_cm_predivide;
@@ -294,7 +294,7 @@ static void image_assign_ibuf(Image *ima, ImBuf *ibuf, int index, int frame)
BLI_insertlinkbefore(&ima->ibufs, link, ibuf);
/* now we don't want copies? */
- if(link && ibuf->index==link->index)
+ if (link && ibuf->index==link->index)
image_remove_ibuf(ima, link);
}
}
@@ -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)
@@ -340,42 +340,42 @@ void make_local_image(struct Image *ima)
* - mixed: make copy
*/
- if(ima->id.lib==NULL) return;
+ 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) {
+ if (ima->id.us==1) {
id_clear_lib_data(bmain, &ima->id);
extern_local_image(ima);
return;
}
#endif
- for(tex= bmain->tex.first; tex; tex= tex->id.next) {
- if(tex->ima == ima) {
- if(tex->id.lib) is_lib= TRUE;
+ for (tex= bmain->tex.first; tex; tex= tex->id.next) {
+ if (tex->ima == ima) {
+ if (tex->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
}
- for(brush= bmain->brush.first; brush; brush= brush->id.next) {
- if(brush->clone.image == ima) {
- if(brush->id.lib) is_lib= TRUE;
+ for (brush= bmain->brush.first; brush; brush= brush->id.next) {
+ if (brush->clone.image == ima) {
+ if (brush->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
}
- for(me= bmain->mesh.first; me; me= me->id.next) {
- if(me->mtface) {
+ for (me= bmain->mesh.first; me; me= me->id.next) {
+ if (me->mtface) {
MTFace *tface;
int a, i;
- for(i=0; i<me->fdata.totlayer; i++) {
- if(me->fdata.layers[i].type == CD_MTFACE) {
+ for (i=0; i<me->fdata.totlayer; i++) {
+ if (me->fdata.layers[i].type == CD_MTFACE) {
tface= (MTFace*)me->fdata.layers[i].data;
- for(a=0; a<me->totface; a++, tface++) {
- if(tface->tpage == ima) {
- if(me->id.lib) is_lib= TRUE;
+ for (a=0; a<me->totface; a++, tface++) {
+ if (tface->tpage == ima) {
+ if (me->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
}
@@ -383,17 +383,17 @@ void make_local_image(struct Image *ima)
}
}
- if(me->mtpoly) {
+ if (me->mtpoly) {
MTexPoly *mtpoly;
int a, i;
- for(i=0; i<me->pdata.totlayer; i++) {
- if(me->pdata.layers[i].type == CD_MTEXPOLY) {
+ for (i=0; i<me->pdata.totlayer; i++) {
+ if (me->pdata.layers[i].type == CD_MTEXPOLY) {
mtpoly= (MTexPoly*)me->pdata.layers[i].data;
- for(a=0; a<me->totpoly; a++, mtpoly++) {
- if(mtpoly->tpage == ima) {
- if(me->id.lib) is_lib= TRUE;
+ for (a=0; a<me->totpoly; a++, mtpoly++) {
+ if (mtpoly->tpage == ima) {
+ if (me->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
}
@@ -403,11 +403,11 @@ void make_local_image(struct Image *ima)
}
- if(is_local && is_lib == FALSE) {
+ if (is_local && is_lib == FALSE) {
id_clear_lib_data(bmain, &ima->id);
extern_local_image(ima);
}
- else if(is_local && is_lib) {
+ else if (is_local && is_lib) {
Image *ima_new= copy_image(ima);
ima_new->id.us= 0;
@@ -416,9 +416,9 @@ void make_local_image(struct Image *ima)
BKE_id_lib_local_paths(bmain, ima->id.lib, &ima_new->id);
tex= bmain->tex.first;
- while(tex) {
- if(tex->id.lib==NULL) {
- if(tex->ima==ima) {
+ while (tex) {
+ if (tex->id.lib==NULL) {
+ if (tex->ima==ima) {
tex->ima = ima_new;
ima_new->id.us++;
ima->id.us--;
@@ -427,9 +427,9 @@ void make_local_image(struct Image *ima)
tex= tex->id.next;
}
brush= bmain->brush.first;
- while(brush) {
- if(brush->id.lib==NULL) {
- if(brush->clone.image==ima) {
+ while (brush) {
+ if (brush->id.lib==NULL) {
+ if (brush->clone.image==ima) {
brush->clone.image = ima_new;
ima_new->id.us++;
ima->id.us--;
@@ -438,22 +438,22 @@ 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) {
+ while (me) {
+ if (me->mtface) {
MTFace *tface;
int a, i;
- for(i=0; i<me->fdata.totlayer; i++) {
- if(me->fdata.layers[i].type == CD_MTFACE) {
+ for (i=0; i<me->fdata.totlayer; i++) {
+ if (me->fdata.layers[i].type == CD_MTFACE) {
tface= (MTFace*)me->fdata.layers[i].data;
- for(a=0; a<me->totface; a++, tface++) {
- if(tface->tpage == ima) {
+ for (a=0; a<me->totface; a++, tface++) {
+ if (tface->tpage == ima) {
tface->tpage = ima_new;
- if(ima_new->id.us == 0) {
+ if (ima_new->id.us == 0) {
tface->tpage->id.us= 1;
}
id_lib_extern((ID*)ima_new);
@@ -463,18 +463,18 @@ void make_local_image(struct Image *ima)
}
}
- if(me->mtpoly) {
+ if (me->mtpoly) {
MTexPoly *mtpoly;
int a, i;
- for(i=0; i<me->pdata.totlayer; i++) {
- if(me->pdata.layers[i].type == CD_MTEXPOLY) {
+ for (i=0; i<me->pdata.totlayer; i++) {
+ if (me->pdata.layers[i].type == CD_MTEXPOLY) {
mtpoly= (MTexPoly*)me->pdata.layers[i].data;
- for(a=0; a<me->totpoly; a++, mtpoly++) {
- if(mtpoly->tpage == ima) {
+ for (a=0; a<me->totpoly; a++, mtpoly++) {
+ if (mtpoly->tpage == ima) {
mtpoly->tpage = ima_new;
- if(ima_new->id.us == 0) {
+ if (ima_new->id.us == 0) {
mtpoly->tpage->id.us= 1;
}
id_lib_extern((ID*)ima_new);
@@ -494,9 +494,9 @@ void BKE_image_merge(Image *dest, Image *source)
ImBuf *ibuf;
/* sanity check */
- if(dest && source && dest!=source) {
+ if (dest && source && dest!=source) {
- while((ibuf= source->ibufs.first)) {
+ while ((ibuf= source->ibufs.first)) {
BLI_remlink(&source->ibufs, ibuf);
image_assign_ibuf(dest, ibuf, IMA_INDEX_PASS(ibuf->index), IMA_INDEX_FRAME(ibuf->index));
}
@@ -521,23 +521,23 @@ Image *BKE_add_image_file(const char *name)
BLI_path_abs(str, G.main->name);
/* exists? */
- file= open(str, O_BINARY|O_RDONLY);
- if(file== -1) return NULL;
+ file= BLI_open(str, O_BINARY|O_RDONLY, 0);
+ if (file== -1) return NULL;
close(file);
/* first search an identical image */
- for(ima= G.main->image.first; ima; ima= ima->id.next) {
- if(ima->source!=IMA_SRC_VIEWER && ima->source!=IMA_SRC_GENERATED) {
+ for (ima= G.main->image.first; ima; ima= ima->id.next) {
+ if (ima->source!=IMA_SRC_VIEWER && ima->source!=IMA_SRC_GENERATED) {
BLI_strncpy(strtest, ima->name, sizeof(ima->name));
BLI_path_abs(strtest, G.main->name);
- if( strcmp(strtest, str)==0 ) {
- if(ima->anim==NULL || ima->id.us==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)
+ if (ima->ok==0)
ima->ok= IMA_OK;
- /* RETURN! */
+ /* RETURN! */
return ima;
}
}
@@ -554,7 +554,7 @@ Image *BKE_add_image_file(const char *name)
ima= image_alloc(libname, IMA_SRC_FILE, IMA_TYPE_IMAGE);
BLI_strncpy(ima->name, name, sizeof(ima->name));
- if(BLI_testextensie_array(name, imb_ext_movie))
+ if (BLI_testextensie_array(name, imb_ext_movie))
ima->source= IMA_SRC_MOVIE;
return ima;
@@ -601,7 +601,7 @@ Image *BKE_add_image_size(unsigned int width, unsigned int height, const char *n
if (ima) {
ImBuf *ibuf;
- /* BLI_strncpy(ima->name, name, FILE_MAX); */ /* dont do this, this writes in ain invalid filepath! */
+ /* BLI_strncpy(ima->name, name, FILE_MAX); */ /* don't do this, this writes in ain invalid filepath! */
ima->gen_x= width;
ima->gen_y= height;
ima->gen_type= uvtestgrid;
@@ -638,7 +638,7 @@ void BKE_image_memorypack(Image *ima)
{
ImBuf *ibuf= image_get_ibuf(ima, IMA_NO_INDEX, 0);
- if(ibuf==NULL)
+ if (ibuf==NULL)
return;
if (ima->packedfile) {
freePackedFile(ima->packedfile);
@@ -649,7 +649,7 @@ void BKE_image_memorypack(Image *ima)
ibuf->planes= R_IMF_PLANES_RGBA;
IMB_saveiff(ibuf, ibuf->name, IB_rect | IB_mem);
- if(ibuf->encodedbuffer==NULL) {
+ if (ibuf->encodedbuffer==NULL) {
printf("memory save for pack error\n");
}
else {
@@ -662,7 +662,7 @@ void BKE_image_memorypack(Image *ima)
ibuf->encodedsize= 0;
ibuf->userflags &= ~IB_BITMAPDIRTY;
- if(ima->source==IMA_SRC_GENERATED) {
+ if (ima->source==IMA_SRC_GENERATED) {
ima->source= IMA_SRC_FILE;
ima->type= IMA_TYPE_IMAGE;
}
@@ -682,8 +682,8 @@ static void tag_all_images_time()
int ctime = (int)PIL_check_seconds_timer();
ima= G.main->image.first;
- while(ima) {
- if(ima->bindcode || ima->repbind || ima->ibufs.first) {
+ while (ima) {
+ if (ima->bindcode || ima->repbind || ima->ibufs.first) {
ima->lastused = ctime;
}
}
@@ -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;
@@ -710,13 +710,11 @@ void free_old_images(void)
lasttime = ctime;
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(ima->bindcode || ima->repbind) {
+ 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 (ima->bindcode || ima->repbind) {
GPU_free_image(ima);
ima->lastused = ctime;
}
@@ -738,18 +736,18 @@ static uintptr_t image_mem_size(Image *ima)
size= 0;
/* viewers have memory depending on other rules, has no valid rect pointer */
- if(ima->source==IMA_SRC_VIEWER)
+ if (ima->source==IMA_SRC_VIEWER)
return 0;
- for(ibuf= ima->ibufs.first; ibuf; ibuf= ibuf->next) {
- if(ibuf->rect) size += MEM_allocN_len(ibuf->rect);
- else if(ibuf->rect_float) size += MEM_allocN_len(ibuf->rect_float);
+ for (ibuf= ima->ibufs.first; ibuf; ibuf= ibuf->next) {
+ if (ibuf->rect) size += MEM_allocN_len(ibuf->rect);
+ else if (ibuf->rect_float) size += MEM_allocN_len(ibuf->rect_float);
- for(level=0; level<IB_MIPMAP_LEVELS; level++) {
+ for (level=0; level<IB_MIPMAP_LEVELS; level++) {
ibufm= ibuf->mipmap[level];
- if(ibufm) {
- if(ibufm->rect) size += MEM_allocN_len(ibufm->rect);
- else if(ibufm->rect_float) size += MEM_allocN_len(ibufm->rect_float);
+ if (ibufm) {
+ if (ibufm->rect) size += MEM_allocN_len(ibufm->rect);
+ else if (ibufm->rect_float) size += MEM_allocN_len(ibufm->rect_float);
}
}
}
@@ -762,15 +760,15 @@ void BKE_image_print_memlist(void)
Image *ima;
uintptr_t size, totsize= 0;
- for(ima= G.main->image.first; ima; ima= ima->id.next)
+ for (ima= G.main->image.first; ima; ima= ima->id.next)
totsize += image_mem_size(ima);
printf("\ntotal image memory len: %.3f MB\n", (double)totsize/(double)(1024*1024));
- for(ima= G.main->image.first; ima; ima= ima->id.next) {
+ for (ima= G.main->image.first; ima; ima= ima->id.next) {
size= image_mem_size(ima);
- if(size)
+ if (size)
printf("%s len: %.3f MB\n", ima->id.name+2, (double)size/(double)(1024*1024));
}
}
@@ -781,29 +779,30 @@ void BKE_image_free_all_textures(void)
Image *ima;
/* unsigned int totsize= 0; */
- for(ima= G.main->image.first; ima; ima= ima->id.next)
+ for (ima= G.main->image.first; ima; ima= ima->id.next)
ima->id.flag &= ~LIB_DOIT;
- for(tex= G.main->tex.first; tex; tex= tex->id.next)
- if(tex->ima)
+ for (tex= G.main->tex.first; tex; tex= tex->id.next)
+ if (tex->ima)
tex->ima->id.flag |= LIB_DOIT;
- for(ima= G.main->image.first; ima; ima= ima->id.next) {
- if(ima->ibufs.first && (ima->id.flag & LIB_DOIT)) {
+ for (ima= G.main->image.first; ima; ima= ima->id.next) {
+ if (ima->ibufs.first && (ima->id.flag & LIB_DOIT)) {
ImBuf *ibuf;
- for(ibuf= ima->ibufs.first; ibuf; ibuf= ibuf->next) {
+ for (ibuf= ima->ibufs.first; ibuf; ibuf= ibuf->next) {
/* escape when image is painted on */
- if(ibuf->userflags & IB_BITMAPDIRTY)
+ 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)
+ if (ibuf==NULL)
image_free_buffers(ima);
}
}
@@ -815,13 +814,13 @@ void BKE_image_free_anim_ibufs(Image *ima, int except_frame)
{
ImBuf *ibuf, *nbuf;
- for(ibuf= ima->ibufs.first; ibuf; ibuf= nbuf) {
+ for (ibuf= ima->ibufs.first; ibuf; ibuf= nbuf) {
nbuf= ibuf->next;
- if(ibuf->userflags & IB_BITMAPDIRTY)
+ if (ibuf->userflags & IB_BITMAPDIRTY)
continue;
- if(ibuf->index==IMA_NO_INDEX)
+ if (ibuf->index==IMA_NO_INDEX)
continue;
- if(except_frame!=IMA_INDEX_FRAME(ibuf->index)) {
+ if (except_frame!=IMA_INDEX_FRAME(ibuf->index)) {
BLI_remlink(&ima->ibufs, ibuf);
if (ibuf->userdata) {
@@ -837,8 +836,8 @@ void BKE_image_all_free_anim_ibufs(int cfra)
{
Image *ima;
- for(ima= G.main->image.first; ima; ima= ima->id.next)
- if(ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE))
+ for (ima= G.main->image.first; ima; ima= ima->id.next)
+ if (ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE))
BKE_image_free_anim_ibufs(ima, cfra);
}
@@ -847,11 +846,11 @@ void BKE_image_all_free_anim_ibufs(int cfra)
int BKE_imtype_to_ftype(const char imtype)
{
- if(imtype==R_IMF_IMTYPE_TARGA)
+ if (imtype==R_IMF_IMTYPE_TARGA)
return TGA;
- else if(imtype==R_IMF_IMTYPE_RAWTGA)
+ else if (imtype==R_IMF_IMTYPE_RAWTGA)
return RAWTGA;
- else if(imtype== R_IMF_IMTYPE_IRIS)
+ else if (imtype== R_IMF_IMTYPE_IRIS)
return IMAGIC;
#ifdef WITH_HDR
else if (imtype==R_IMF_IMTYPE_RADHDR)
@@ -878,7 +877,7 @@ int BKE_imtype_to_ftype(const char imtype)
return DPX;
#endif
#ifdef WITH_OPENJPEG
- else if(imtype==R_IMF_IMTYPE_JP2)
+ else if (imtype==R_IMF_IMTYPE_JP2)
return JP2;
#endif
else
@@ -887,9 +886,9 @@ int BKE_imtype_to_ftype(const char imtype)
char BKE_ftype_to_imtype(const int ftype)
{
- if(ftype==0)
+ if (ftype==0)
return R_IMF_IMTYPE_TARGA;
- else if(ftype == IMAGIC)
+ else if (ftype == IMAGIC)
return R_IMF_IMTYPE_IRIS;
#ifdef WITH_HDR
else if (ftype & RADHDR)
@@ -917,10 +916,10 @@ char BKE_ftype_to_imtype(const int ftype)
#endif
else if (ftype & TGA)
return R_IMF_IMTYPE_TARGA;
- else if(ftype & RAWTGA)
+ else if (ftype & RAWTGA)
return R_IMF_IMTYPE_RAWTGA;
#ifdef WITH_OPENJPEG
- else if(ftype & JP2)
+ else if (ftype & JP2)
return R_IMF_IMTYPE_JP2;
#endif
else
@@ -1077,79 +1076,79 @@ int BKE_add_image_extension(char *string, const char imtype)
{
const char *extension= NULL;
- if(imtype== R_IMF_IMTYPE_IRIS) {
- if(!BLI_testextensie(string, ".rgb"))
+ if (imtype== R_IMF_IMTYPE_IRIS) {
+ if (!BLI_testextensie(string, ".rgb"))
extension= ".rgb";
}
- else if(imtype==R_IMF_IMTYPE_IRIZ) {
- if(!BLI_testextensie(string, ".rgb"))
+ else if (imtype==R_IMF_IMTYPE_IRIZ) {
+ if (!BLI_testextensie(string, ".rgb"))
extension= ".rgb";
}
#ifdef WITH_HDR
- else if(imtype==R_IMF_IMTYPE_RADHDR) {
- if(!BLI_testextensie(string, ".hdr"))
+ else if (imtype==R_IMF_IMTYPE_RADHDR) {
+ if (!BLI_testextensie(string, ".hdr"))
extension= ".hdr";
}
#endif
else if (ELEM5(imtype, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_XVID)) {
- if(!BLI_testextensie(string, ".png"))
+ if (!BLI_testextensie(string, ".png"))
extension= ".png";
}
#ifdef WITH_DDS
- else if(imtype==R_IMF_IMTYPE_DDS) {
- if(!BLI_testextensie(string, ".dds"))
+ else if (imtype==R_IMF_IMTYPE_DDS) {
+ if (!BLI_testextensie(string, ".dds"))
extension= ".dds";
}
#endif
- else if(imtype==R_IMF_IMTYPE_RAWTGA) {
- if(!BLI_testextensie(string, ".tga"))
+ else if (imtype==R_IMF_IMTYPE_RAWTGA) {
+ if (!BLI_testextensie(string, ".tga"))
extension= ".tga";
}
- else if(imtype==R_IMF_IMTYPE_BMP) {
- if(!BLI_testextensie(string, ".bmp"))
+ else if (imtype==R_IMF_IMTYPE_BMP) {
+ if (!BLI_testextensie(string, ".bmp"))
extension= ".bmp";
}
#ifdef WITH_TIFF
- else if(imtype==R_IMF_IMTYPE_TIFF) {
- if(!BLI_testextensie(string, ".tif") &&
+ else if (imtype==R_IMF_IMTYPE_TIFF) {
+ if (!BLI_testextensie(string, ".tif") &&
!BLI_testextensie(string, ".tiff")) extension= ".tif";
}
#endif
#ifdef WITH_OPENEXR
- else if( ELEM(imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER)) {
- if(!BLI_testextensie(string, ".exr"))
+ else if ( ELEM(imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER)) {
+ if (!BLI_testextensie(string, ".exr"))
extension= ".exr";
}
#endif
#ifdef WITH_CINEON
- else if(imtype==R_IMF_IMTYPE_CINEON) {
+ else if (imtype==R_IMF_IMTYPE_CINEON) {
if (!BLI_testextensie(string, ".cin"))
extension= ".cin";
}
- else if(imtype==R_IMF_IMTYPE_DPX) {
+ else if (imtype==R_IMF_IMTYPE_DPX) {
if (!BLI_testextensie(string, ".dpx"))
extension= ".dpx";
}
#endif
- else if(imtype==R_IMF_IMTYPE_TARGA) {
- if(!BLI_testextensie(string, ".tga"))
+ else if (imtype==R_IMF_IMTYPE_TARGA) {
+ if (!BLI_testextensie(string, ".tga"))
extension= ".tga";
}
#ifdef WITH_OPENJPEG
- else if(imtype==R_IMF_IMTYPE_JP2) {
- if(!BLI_testextensie(string, ".jp2"))
+ else if (imtype==R_IMF_IMTYPE_JP2) {
+ if (!BLI_testextensie(string, ".jp2"))
extension= ".jp2";
}
#endif
else { // R_IMF_IMTYPE_AVICODEC, R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_JPEG90, R_IMF_IMTYPE_QUICKTIME etc
- if(!( BLI_testextensie(string, ".jpg") || BLI_testextensie(string, ".jpeg")))
+ if (!( BLI_testextensie(string, ".jpg") || BLI_testextensie(string, ".jpeg")))
extension= ".jpg";
}
- if(extension) {
+ if (extension) {
/* prefer this in many cases to avoid .png.tga, but in certain cases it breaks */
/* remove any other known image extension */
- if(BLI_testextensie_array(string, imb_ext_image)
+ if (BLI_testextensie_array(string, imb_ext_image)
|| (G.have_quicktime && BLI_testextensie_array(string, imb_ext_image_qt))) {
return BLI_replace_extension(string, FILE_MAX, extension);
}
@@ -1186,14 +1185,16 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
if (scene->r.stamp & R_STAMP_FILENAME) {
BLI_snprintf(stamp_data->file, sizeof(stamp_data->file), do_prefix ? "File %s":"%s", G.relbase_valid ? G.main->name:"<untitled>");
- } else {
+ }
+ else {
stamp_data->file[0] = '\0';
}
if (scene->r.stamp & R_STAMP_NOTE) {
/* Never do prefix for Note */
BLI_snprintf(stamp_data->note, sizeof(stamp_data->note), "%s", scene->r.stamp_udata);
- } else {
+ }
+ else {
stamp_data->note[0] = '\0';
}
@@ -1202,7 +1203,8 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
tl = localtime(&t);
BLI_snprintf(text, sizeof(text), "%04d/%02d/%02d %02d:%02d:%02d", tl->tm_year+1900, tl->tm_mon+1, tl->tm_mday, tl->tm_hour, tl->tm_min, tl->tm_sec);
BLI_snprintf(stamp_data->date, sizeof(stamp_data->date), do_prefix ? "Date %s":"%s", text);
- } else {
+ }
+ else {
stamp_data->date[0] = '\0';
}
@@ -1213,7 +1215,8 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
else BLI_strncpy(text, "<none>", sizeof(text));
BLI_snprintf(stamp_data->marker, sizeof(stamp_data->marker), do_prefix ? "Marker %s":"%s", text);
- } else {
+ }
+ else {
stamp_data->marker[0] = '\0';
}
@@ -1239,7 +1242,8 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
BLI_snprintf(text, sizeof(text), "%02d:%02d:%02d.%03d", h, m, s, f);
BLI_snprintf(stamp_data->time, sizeof(stamp_data->time), do_prefix ? "Time %s":"%s", text);
- } else {
+ }
+ else {
stamp_data->time[0] = '\0';
}
@@ -1247,18 +1251,20 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
char fmtstr[32];
int digits= 1;
- if(scene->r.efra>9)
+ if (scene->r.efra>9)
digits= 1 + (int) log10(scene->r.efra);
BLI_snprintf(fmtstr, sizeof(fmtstr), do_prefix ? "Frame %%0%di":"%%0%di", digits);
BLI_snprintf (stamp_data->frame, sizeof(stamp_data->frame), fmtstr, scene->r.cfra);
- } else {
+ }
+ else {
stamp_data->frame[0] = '\0';
}
if (scene->r.stamp & R_STAMP_CAMERA) {
BLI_snprintf(stamp_data->camera, sizeof(stamp_data->camera), do_prefix ? "Camera %s":"%s", camera ? camera->id.name+2 : "<none>");
- } else {
+ }
+ else {
stamp_data->camera[0] = '\0';
}
@@ -1269,13 +1275,15 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
else BLI_strncpy(text, "<none>", sizeof(text));
BLI_snprintf(stamp_data->cameralens, sizeof(stamp_data->cameralens), do_prefix ? "Lens %s":"%s", text);
- } else {
+ }
+ else {
stamp_data->cameralens[0] = '\0';
}
if (scene->r.stamp & R_STAMP_SCENE) {
BLI_snprintf(stamp_data->scene, sizeof(stamp_data->scene), do_prefix ? "Scene %s":"%s", scene->id.name+2);
- } else {
+ }
+ else {
stamp_data->scene[0] = '\0';
}
@@ -1286,7 +1294,8 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
else BLI_strncpy(text, "<none>", sizeof(text));
BLI_snprintf(stamp_data->strip, sizeof(stamp_data->strip), do_prefix ? "Strip %s":"%s", text);
- } else {
+ }
+ else {
stamp_data->strip[0] = '\0';
}
@@ -1298,7 +1307,8 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
BLI_timestr(stats->lastframetime, text);
BLI_snprintf(stamp_data->rendertime, sizeof(stamp_data->rendertime), do_prefix ? "RenderTime %s":"%s", text);
- } else {
+ }
+ else {
stamp_data->rendertime[0] = '\0';
}
}
@@ -1321,7 +1331,7 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
stampdata(scene, camera, &stamp_data, 1);
/* TODO, do_versions */
- if(scene->r.stamp_font_id < 8)
+ if (scene->r.stamp_font_id < 8)
scene->r.stamp_font_id= 12;
/* set before return */
@@ -1524,18 +1534,18 @@ void BKE_stamp_info(Scene *scene, Object *camera, struct ImBuf *ibuf)
int BKE_alphatest_ibuf(ImBuf *ibuf)
{
int tot;
- if(ibuf->rect_float) {
+ if (ibuf->rect_float) {
float *buf= ibuf->rect_float;
- for(tot= ibuf->x * ibuf->y; tot--; buf+=4) {
- if(buf[3] < 1.0f) {
+ for (tot= ibuf->x * ibuf->y; tot--; buf+=4) {
+ if (buf[3] < 1.0f) {
return TRUE;
}
}
}
else if (ibuf->rect) {
unsigned char *buf= (unsigned char *)ibuf->rect;
- for(tot= ibuf->x * ibuf->y; tot--; buf+=4) {
- if(buf[3] != 255) {
+ for (tot= ibuf->x * ibuf->y; tot--; buf+=4) {
+ if (buf[3] != 255) {
return TRUE;
}
}
@@ -1554,7 +1564,7 @@ int BKE_write_ibuf(ImBuf *ibuf, const char *name, ImageFormatData *imf)
int ok;
- if(imtype== R_IMF_IMTYPE_IRIS) {
+ if (imtype== R_IMF_IMTYPE_IRIS) {
ibuf->ftype= IMAGIC;
}
#ifdef WITH_HDR
@@ -1565,7 +1575,7 @@ int BKE_write_ibuf(ImBuf *ibuf, const char *name, ImageFormatData *imf)
else if (ELEM5(imtype, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_XVID)) {
ibuf->ftype= PNG;
- if(imtype==R_IMF_IMTYPE_PNG)
+ if (imtype==R_IMF_IMTYPE_PNG)
ibuf->ftype |= compress;
}
@@ -1581,18 +1591,18 @@ int BKE_write_ibuf(ImBuf *ibuf, const char *name, ImageFormatData *imf)
else if (imtype==R_IMF_IMTYPE_TIFF) {
ibuf->ftype= TIF;
- if(imf->depth == R_IMF_CHAN_DEPTH_16)
+ if (imf->depth == R_IMF_CHAN_DEPTH_16)
ibuf->ftype |= TIF_16BIT;
}
#endif
#ifdef WITH_OPENEXR
else if (imtype==R_IMF_IMTYPE_OPENEXR || imtype==R_IMF_IMTYPE_MULTILAYER) {
ibuf->ftype= OPENEXR;
- if(imf->depth == R_IMF_CHAN_DEPTH_16)
+ if (imf->depth == R_IMF_CHAN_DEPTH_16)
ibuf->ftype |= OPENEXR_HALF;
ibuf->ftype |= (imf->exr_codec & OPENEXR_COMPRESS);
- if(!(imf->flag & R_IMF_FLAG_ZBUF))
+ if (!(imf->flag & R_IMF_FLAG_ZBUF))
ibuf->zbuf_float = NULL; /* signal for exr saving */
}
@@ -1608,17 +1618,18 @@ int BKE_write_ibuf(ImBuf *ibuf, const char *name, ImageFormatData *imf)
else if (imtype==R_IMF_IMTYPE_TARGA) {
ibuf->ftype= TGA;
}
- else if(imtype==R_IMF_IMTYPE_RAWTGA) {
+ else if (imtype==R_IMF_IMTYPE_RAWTGA) {
ibuf->ftype= RAWTGA;
}
#ifdef WITH_OPENJPEG
- else if(imtype==R_IMF_IMTYPE_JP2) {
- if(quality < 10) quality= 90;
+ else if (imtype==R_IMF_IMTYPE_JP2) {
+ if (quality < 10) quality= 90;
ibuf->ftype= JP2|quality;
if (imf->depth == R_IMF_CHAN_DEPTH_16) {
ibuf->ftype |= JP2_16BIT;
- } else if (imf->depth == R_IMF_CHAN_DEPTH_12) {
+ }
+ else if (imf->depth == R_IMF_CHAN_DEPTH_12) {
ibuf->ftype |= JP2_12BIT;
}
@@ -1635,7 +1646,7 @@ int BKE_write_ibuf(ImBuf *ibuf, const char *name, ImageFormatData *imf)
#endif
else {
/* R_IMF_IMTYPE_JPEG90, etc. default we save jpegs */
- if(quality < 10) quality= 90;
+ if (quality < 10) quality= 90;
ibuf->ftype= JPG|quality;
}
@@ -1674,7 +1685,7 @@ int BKE_write_ibuf_as(ImBuf *ibuf, const char *name, ImageFormatData *imf,
int BKE_write_ibuf_stamp(Scene *scene, struct Object *camera, ImBuf *ibuf, const char *name, struct ImageFormatData *imf)
{
- if(scene && scene->r.stamp & R_STAMP_ALL)
+ if (scene && scene->r.stamp & R_STAMP_ALL)
BKE_stamp_info(scene, camera, ibuf);
return BKE_write_ibuf(ibuf, name, imf);
@@ -1687,10 +1698,10 @@ void BKE_makepicstring(char *string, const char *base, const char *relbase, int
BLI_strncpy(string, base, FILE_MAX - 10); /* weak assumption */
BLI_path_abs(string, relbase);
- if(use_frames)
+ if (use_frames)
BLI_path_frame(string, frame, 4);
- if(use_ext)
+ if (use_ext)
BKE_add_image_extension(string, imtype);
}
@@ -1706,7 +1717,7 @@ struct anim *openanim(const char *name, int flags, int streamindex)
ibuf = IMB_anim_absolute(anim, 0, IMB_TC_NONE, IMB_PROXY_NONE);
if (ibuf == NULL) {
- if(BLI_exists(name))
+ if (BLI_exists(name))
printf("not an anim: %s\n", name);
else
printf("anim file doesn't exist: %s\n", name);
@@ -1722,22 +1733,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 */
@@ -1746,16 +1756,16 @@ Image *BKE_image_verify_viewer(int type, const char *name)
{
Image *ima;
- for(ima=G.main->image.first; ima; ima= ima->id.next)
- if(ima->source==IMA_SRC_VIEWER)
- if(ima->type==type)
+ for (ima=G.main->image.first; ima; ima= ima->id.next)
+ if (ima->source==IMA_SRC_VIEWER)
+ if (ima->type==type)
break;
- if(ima==NULL)
+ if (ima==NULL)
ima= image_alloc(name, IMA_SRC_VIEWER, type);
/* happens on reload, imagewindow cannot be image user when hidden*/
- if(ima->id.us==0)
+ if (ima->id.us==0)
id_us_plus(&ima->id);
return ima;
@@ -1768,24 +1778,24 @@ void BKE_image_assign_ibuf(Image *ima, ImBuf *ibuf)
void BKE_image_signal(Image *ima, ImageUser *iuser, int signal)
{
- if(ima==NULL)
+ if (ima==NULL)
return;
switch(signal) {
case IMA_SIGNAL_FREE:
image_free_buffers(ima);
- if(iuser)
+ if (iuser)
iuser->ok= 1;
break;
case IMA_SIGNAL_SRC_CHANGE:
- if(ima->type == IMA_TYPE_UV_TEST)
- if(ima->source != IMA_SRC_GENERATED)
+ if (ima->type == IMA_TYPE_UV_TEST)
+ if (ima->source != IMA_SRC_GENERATED)
ima->type= IMA_TYPE_IMAGE;
- if(ima->source==IMA_SRC_GENERATED) {
- if(ima->gen_x==0 || ima->gen_y==0) {
+ if (ima->source==IMA_SRC_GENERATED) {
+ if (ima->gen_x==0 || ima->gen_y==0) {
ImBuf *ibuf= image_get_ibuf(ima, IMA_NO_INDEX, 0);
- if(ibuf) {
+ if (ibuf) {
ima->gen_x= ibuf->x;
ima->gen_y= ibuf->y;
}
@@ -1793,39 +1803,40 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal)
}
/* force reload on first use, but not for multilayer, that makes nodes and buttons in ui drawing fail */
- if(ima->type!=IMA_TYPE_MULTILAYER)
+ if (ima->type!=IMA_TYPE_MULTILAYER)
image_free_buffers(ima);
ima->ok= 1;
- if(iuser)
+ if (iuser)
iuser->ok= 1;
break;
case IMA_SIGNAL_RELOAD:
/* try to repack file */
- if(ima->packedfile) {
+ if (ima->packedfile) {
PackedFile *pf;
pf = newPackedFile(NULL, ima->name, ID_BLEND_PATH(G.main, &ima->id));
if (pf) {
freePackedFile(ima->packedfile);
ima->packedfile = pf;
image_free_buffers(ima);
- } else {
+ }
+ else {
printf("ERROR: Image not available. Keeping packed image\n");
}
}
else
image_free_buffers(ima);
- if(iuser)
+ if (iuser)
iuser->ok= 1;
break;
case IMA_SIGNAL_USER_NEW_IMAGE:
- if(iuser) {
+ if (iuser) {
iuser->ok= 1;
- if(ima->source==IMA_SRC_FILE || ima->source==IMA_SRC_SEQUENCE) {
- if(ima->type==IMA_TYPE_MULTILAYER) {
+ if (ima->source==IMA_SRC_FILE || ima->source==IMA_SRC_SEQUENCE) {
+ if (ima->type==IMA_TYPE_MULTILAYER) {
iuser->multi_index= 0;
iuser->layer= iuser->pass= 0;
}
@@ -1834,12 +1845,12 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal)
break;
}
- /* dont use notifiers because they are not 100% sure to succseed
+ /* don't use notifiers because they are not 100% sure to succeeded
* this also makes sure all scenes are accounted for. */
{
Scene *scene;
- for(scene= G.main->scene.first; scene; scene= scene->id.next) {
- if(scene->nodetree) {
+ for (scene= G.main->scene.first; scene; scene= scene->id.next) {
+ if (scene->nodetree) {
nodeUpdateID(scene->nodetree, &ima->id);
}
}
@@ -1854,29 +1865,29 @@ RenderPass *BKE_image_multilayer_index(RenderResult *rr, ImageUser *iuser)
RenderLayer *rl;
RenderPass *rpass= NULL;
- if(rr==NULL)
+ if (rr==NULL)
return NULL;
- if(iuser) {
+ if (iuser) {
short index= 0, rl_index= 0, rp_index;
- for(rl= rr->layers.first; rl; rl= rl->next, rl_index++) {
+ for (rl= rr->layers.first; rl; rl= rl->next, rl_index++) {
rp_index= 0;
- for(rpass= rl->passes.first; rpass; rpass= rpass->next, index++, rp_index++)
- if(iuser->layer==rl_index && iuser->pass==rp_index)
+ for (rpass= rl->passes.first; rpass; rpass= rpass->next, index++, rp_index++)
+ if (iuser->layer==rl_index && iuser->pass==rp_index)
break;
- if(rpass)
+ if (rpass)
break;
}
- if(rpass)
+ if (rpass)
iuser->multi_index= index;
else
iuser->multi_index= 0;
}
- if(rpass==NULL) {
+ if (rpass==NULL) {
rl= rr->layers.first;
- if(rl)
+ if (rl)
rpass= rl->passes.first;
}
@@ -1885,11 +1896,11 @@ RenderPass *BKE_image_multilayer_index(RenderResult *rr, ImageUser *iuser)
RenderResult *BKE_image_acquire_renderresult(Scene *scene, Image *ima)
{
- if(ima->rr) {
+ if (ima->rr) {
return ima->rr;
}
- else if(ima->type==IMA_TYPE_R_RESULT) {
- if(ima->render_slot == ima->last_render_slot)
+ else if (ima->type==IMA_TYPE_R_RESULT) {
+ if (ima->render_slot == ima->last_render_slot)
return RE_AcquireResultRead(RE_GetRender(scene->id.name));
else
return ima->renders[ima->render_slot];
@@ -1900,9 +1911,9 @@ RenderResult *BKE_image_acquire_renderresult(Scene *scene, Image *ima)
void BKE_image_release_renderresult(Scene *scene, Image *ima)
{
- if(ima->rr);
- else if(ima->type==IMA_TYPE_R_RESULT) {
- if(ima->render_slot == ima->last_render_slot)
+ if (ima->rr);
+ else if (ima->type==IMA_TYPE_R_RESULT) {
+ if (ima->render_slot == ima->last_render_slot)
RE_ReleaseResult(RE_GetRender(scene->id.name));
}
}
@@ -1910,12 +1921,12 @@ 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;
- if(slot != last) {
- if(ima->renders[slot]) {
+ if (slot != last) {
+ if (ima->renders[slot]) {
RE_FreeRenderResult(ima->renders[slot]);
ima->renders[slot]= NULL;
}
@@ -1939,7 +1950,7 @@ static void image_create_multilayer(Image *ima, ImBuf *ibuf, int framenr)
#endif
ibuf->userdata= NULL;
- if(ima->rr)
+ if (ima->rr)
ima->rr->framenr= framenr;
}
@@ -1947,12 +1958,12 @@ static void image_create_multilayer(Image *ima, ImBuf *ibuf, int framenr)
static void image_initialize_after_load(Image *ima, ImBuf *ibuf)
{
/* preview is NULL when it has never been used as an icon before */
- if(G.background==0 && ima->preview==NULL)
+ if (G.background==0 && ima->preview==NULL)
BKE_icon_changed(BKE_icon_getid(&ima->id));
/* fields */
if (ima->flag & IMA_FIELDS) {
- if(ima->flag & IMA_STD_FIELD) de_interlace_st(ibuf);
+ if (ima->flag & IMA_STD_FIELD) de_interlace_st(ibuf);
else de_interlace_ng(ibuf);
}
/* timer */
@@ -1970,7 +1981,7 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame)
int flag;
/* XXX temp stuff? */
- if(ima->lastframe != frame)
+ if (ima->lastframe != frame)
ima->tpageflag |= IMA_TPAGE_REFRESH;
ima->lastframe= frame;
@@ -1981,16 +1992,17 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame)
BLI_path_abs(name, ID_BLEND_PATH(G.main, &ima->id));
flag= IB_rect|IB_multilayer;
- if(ima->flag & IMA_DO_PREMUL)
+ if (ima->flag & IMA_DO_PREMUL)
flag |= IB_premul;
/* read ibuf */
ibuf = IMB_loadiffname(name, flag);
#if 0
- if(ibuf) {
+ if (ibuf) {
printf(AT" loaded %s\n", name);
- } else {
+ }
+ else {
printf(AT" missed %s\n", name);
}
#endif
@@ -2016,7 +2028,7 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame)
else
ima->ok= 0;
- if(iuser)
+ if (iuser)
iuser->ok= ima->ok;
return ibuf;
@@ -2029,32 +2041,32 @@ static ImBuf *image_load_sequence_multilayer(Image *ima, ImageUser *iuser, int f
/* either we load from RenderResult, or we have to load a new one */
/* check for new RenderResult */
- if(ima->rr==NULL || frame!=ima->rr->framenr) {
+ if (ima->rr==NULL || frame!=ima->rr->framenr) {
/* copy to survive not found multilayer image */
RenderResult *oldrr= ima->rr;
ima->rr= NULL;
ibuf = image_load_sequence_file(ima, iuser, frame);
- if(ibuf) { /* actually an error */
+ if (ibuf) { /* actually an error */
ima->type= IMA_TYPE_IMAGE;
printf("error, multi is normal image\n");
}
// printf("loaded new result %p\n", ima->rr);
/* free result if new one found */
- if(ima->rr) {
- // if(oldrr) printf("freed previous result %p\n", oldrr);
- if(oldrr) RE_FreeRenderResult(oldrr);
+ if (ima->rr) {
+ // if (oldrr) printf("freed previous result %p\n", oldrr);
+ if (oldrr) RE_FreeRenderResult(oldrr);
}
else {
ima->rr= oldrr;
}
}
- if(ima->rr) {
+ if (ima->rr) {
RenderPass *rpass= BKE_image_multilayer_index(ima->rr, iuser);
- if(rpass) {
+ if (rpass) {
// printf("load from pass %s\n", rpass->name);
/* since we free render results, we copy the rect */
ibuf= IMB_allocImBuf(ima->rr->rectx, ima->rr->recty, 32, 0);
@@ -2073,7 +2085,7 @@ static ImBuf *image_load_sequence_multilayer(Image *ima, ImageUser *iuser, int f
else
ima->ok= 0;
- if(iuser)
+ if (iuser)
iuser->ok= ima->ok;
return ibuf;
@@ -2086,7 +2098,7 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame)
ima->lastframe= frame;
- if(ima->anim==NULL) {
+ if (ima->anim==NULL) {
char str[FILE_MAX];
BLI_strncpy(str, ima->name, FILE_MAX);
@@ -2096,24 +2108,24 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame)
ima->anim = openanim(str, IB_rect, 0);
/* let's initialize this user */
- if(ima->anim && iuser && iuser->frames==0)
+ if (ima->anim && iuser && iuser->frames==0)
iuser->frames= IMB_anim_get_duration(ima->anim,
IMB_TC_RECORD_RUN);
}
- if(ima->anim) {
+ if (ima->anim) {
int dur = IMB_anim_get_duration(ima->anim,
IMB_TC_RECORD_RUN);
int fra= frame-1;
- if(fra<0) fra = 0;
- if(fra>(dur-1)) fra= dur-1;
+ if (fra<0) fra = 0;
+ if (fra>(dur-1)) fra= dur-1;
ibuf = IMB_makeSingleUser(
IMB_anim_absolute(ima->anim, fra,
IMB_TC_RECORD_RUN,
IMB_PROXY_NONE));
- if(ibuf) {
+ if (ibuf) {
image_initialize_after_load(ima, ibuf);
image_assign_ibuf(ima, ibuf, 0, frame);
}
@@ -2123,7 +2135,7 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame)
else
ima->ok= 0;
- if(iuser)
+ if (iuser)
iuser->ok= ima->ok;
return ibuf;
@@ -2142,13 +2154,13 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
/* is there a PackedFile with this image ? */
if (ima->packedfile) {
flag = IB_rect|IB_multilayer;
- if(ima->flag & IMA_DO_PREMUL) flag |= IB_premul;
+ if (ima->flag & IMA_DO_PREMUL) flag |= IB_premul;
ibuf = IMB_ibImageFromMemory((unsigned char*)ima->packedfile->data, ima->packedfile->size, flag, "<packed data>");
}
else {
flag= IB_rect|IB_multilayer|IB_metadata;
- if(ima->flag & IMA_DO_PREMUL)
+ if (ima->flag & IMA_DO_PREMUL)
flag |= IB_premul;
/* get the right string */
@@ -2182,10 +2194,10 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
else
ima->ok= 0;
- if(assign)
+ if (assign)
image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
- if(iuser)
+ if (iuser)
iuser->ok= ima->ok;
return ibuf;
@@ -2195,17 +2207,17 @@ static ImBuf *image_get_ibuf_multilayer(Image *ima, ImageUser *iuser)
{
ImBuf *ibuf= NULL;
- if(ima->rr==NULL) {
+ if (ima->rr==NULL) {
ibuf = image_load_image_file(ima, iuser, 0);
- if(ibuf) { /* actually an error */
+ if (ibuf) { /* actually an error */
ima->type= IMA_TYPE_IMAGE;
return ibuf;
}
}
- if(ima->rr) {
+ if (ima->rr) {
RenderPass *rpass= BKE_image_multilayer_index(ima->rr, iuser);
- if(rpass) {
+ if (rpass) {
ibuf= IMB_allocImBuf(ima->rr->rectx, ima->rr->recty, 32, 0);
image_initialize_after_load(ima, ibuf);
@@ -2219,9 +2231,9 @@ static ImBuf *image_get_ibuf_multilayer(Image *ima, ImageUser *iuser)
}
}
- if(ibuf==NULL)
+ if (ibuf==NULL)
ima->ok= 0;
- if(iuser)
+ if (iuser)
iuser->ok= ima->ok;
return ibuf;
@@ -2229,7 +2241,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)
{
@@ -2242,11 +2254,11 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
ImBuf *ibuf;
int from_render= (ima->render_slot == ima->last_render_slot);
- if(!(iuser && iuser->scene))
+ if (!(iuser && iuser->scene))
return NULL;
/* if we the caller is not going to release the lock, don't give the image */
- if(!lock_r)
+ if (!lock_r)
return NULL;
re= RE_GetRender(iuser->scene->id.name);
@@ -2255,24 +2267,24 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
layer= (iuser)? iuser->layer: 0;
pass= (iuser)? iuser->pass: 0;
- if(from_render) {
+ if (from_render) {
RE_AcquireResultImage(re, &rres);
}
- else if(ima->renders[ima->render_slot]) {
+ else if (ima->renders[ima->render_slot]) {
rres= *(ima->renders[ima->render_slot]);
rres.have_combined= rres.rectf != NULL;
}
else
memset(&rres, 0, sizeof(RenderResult));
- if(!(rres.rectx > 0 && rres.recty > 0)) {
- if(from_render)
+ if (!(rres.rectx > 0 && rres.recty > 0)) {
+ if (from_render)
RE_ReleaseResultImage(re);
return NULL;
}
/* release is done in BKE_image_release_ibuf using lock_r */
- if(from_render) {
+ if (from_render) {
BLI_lock_thread(LOCK_VIEWER);
*lock_r= re;
}
@@ -2284,27 +2296,27 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
dither= iuser->scene->r.dither_intensity;
/* combined layer gets added as first layer */
- if(rres.have_combined && layer==0);
- else if(rres.layers.first) {
+ if (rres.have_combined && layer==0);
+ else if (rres.layers.first) {
RenderLayer *rl= BLI_findlink(&rres.layers, layer-(rres.have_combined?1:0));
- if(rl) {
+ if (rl) {
RenderPass *rpass;
/* there's no combined pass, is in renderlayer itself */
- if(pass==0) {
+ if (pass==0) {
rectf= rl->rectf;
}
else {
rpass= BLI_findlink(&rl->passes, pass-1);
- if(rpass) {
+ if (rpass) {
channels= rpass->channels;
rectf= rpass->rect;
dither= 0.0f; /* don't dither passes */
}
}
- for(rpass= rl->passes.first; rpass; rpass= rpass->next)
- if(rpass->passtype == SCE_PASS_Z)
+ for (rpass= rl->passes.first; rpass; rpass= rpass->next)
+ if (rpass->passtype == SCE_PASS_Z)
rectz= rpass->rect;
}
}
@@ -2312,7 +2324,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
ibuf= image_get_ibuf(ima, IMA_NO_INDEX, 0);
/* make ibuf if needed, and initialize it */
- if(ibuf==NULL) {
+ if (ibuf==NULL) {
ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, 0);
image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
}
@@ -2321,15 +2333,15 @@ 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 */
- if(ibuf->rect_float!=rectf || rect || !rectf)
+ * 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);
- if(rect)
+ if (rect)
ibuf->rect= rect;
- if(rectf) {
+ if (rectf) {
ibuf->rect_float= rectf;
ibuf->flags |= IB_rectfloat;
ibuf->channels= channels;
@@ -2339,7 +2351,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
ibuf->flags &= ~IB_rectfloat;
}
- if(rectz) {
+ if (rectz) {
ibuf->zbuf_float= rectz;
ibuf->flags |= IB_zbuffloat;
}
@@ -2352,7 +2364,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
ibuf->profile= (iuser->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) ? IB_PROFILE_LINEAR_RGB : IB_PROFILE_NONE;
ibuf->dither= dither;
- if(iuser->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT_PREDIVIDE) {
+ if (iuser->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT_PREDIVIDE) {
ibuf->flags |= IB_cm_predivide;
ima->flag |= IMA_CM_PREDIVIDE;
}
@@ -2372,41 +2384,41 @@ static ImBuf *image_get_ibuf_threadsafe(Image *ima, ImageUser *iuser, int *frame
int frame = 0, index = 0;
/* see if we already have an appropriate ibuf, with image source and type */
- if(ima->source==IMA_SRC_MOVIE) {
+ if (ima->source==IMA_SRC_MOVIE) {
frame= iuser?iuser->framenr:ima->lastframe;
ibuf= image_get_ibuf(ima, 0, frame);
/* XXX temp stuff? */
- if(ima->lastframe != frame)
+ if (ima->lastframe != frame)
ima->tpageflag |= IMA_TPAGE_REFRESH;
ima->lastframe = frame;
}
- else if(ima->source==IMA_SRC_SEQUENCE) {
- if(ima->type==IMA_TYPE_IMAGE) {
+ else if (ima->source==IMA_SRC_SEQUENCE) {
+ if (ima->type==IMA_TYPE_IMAGE) {
frame= iuser?iuser->framenr:ima->lastframe;
ibuf= image_get_ibuf(ima, 0, frame);
/* XXX temp stuff? */
- if(ima->lastframe != frame) {
+ if (ima->lastframe != frame) {
ima->tpageflag |= IMA_TPAGE_REFRESH;
}
ima->lastframe = frame;
}
- else if(ima->type==IMA_TYPE_MULTILAYER) {
+ else if (ima->type==IMA_TYPE_MULTILAYER) {
frame= iuser?iuser->framenr:ima->lastframe;
index= iuser?iuser->multi_index:IMA_NO_INDEX;
ibuf= image_get_ibuf(ima, index, frame);
}
}
- else if(ima->source==IMA_SRC_FILE) {
- if(ima->type==IMA_TYPE_IMAGE)
+ else if (ima->source==IMA_SRC_FILE) {
+ if (ima->type==IMA_TYPE_IMAGE)
ibuf= image_get_ibuf(ima, IMA_NO_INDEX, 0);
- else if(ima->type==IMA_TYPE_MULTILAYER)
+ else if (ima->type==IMA_TYPE_MULTILAYER)
ibuf= image_get_ibuf(ima, iuser?iuser->multi_index:IMA_NO_INDEX, 0);
}
- else if(ima->source == IMA_SRC_GENERATED) {
+ else if (ima->source == IMA_SRC_GENERATED) {
ibuf= image_get_ibuf(ima, IMA_NO_INDEX, 0);
}
- else if(ima->source == IMA_SRC_VIEWER) {
+ else if (ima->source == IMA_SRC_VIEWER) {
/* always verify entirely, not that this shouldn't happen
* as part of texture sampling in rendering anyway, so not
* a big bottleneck */
@@ -2438,87 +2450,87 @@ ImBuf *BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **lock_r)
* That means, the last two steps must be, 1) add the ibuf to the list and
* 2) set ima/iuser->ok to 0 to IMA_OK_LOADED */
- if(lock_r)
+ if (lock_r)
*lock_r= NULL;
/* quick reject tests */
- if(ima==NULL)
+ if (ima==NULL)
return NULL;
- if(iuser) {
- if(iuser->ok==0)
+ if (iuser) {
+ if (iuser->ok==0)
return NULL;
}
- else if(ima->ok==0)
+ else if (ima->ok==0)
return NULL;
/* try to get the ibuf without locking */
ibuf= image_get_ibuf_threadsafe(ima, iuser, &frame, &index);
- if(ibuf == NULL) {
+ if (ibuf == NULL) {
/* couldn't get ibuf and image is not ok, so let's lock and try to
* load the image */
BLI_lock_thread(LOCK_IMAGE);
/* need to check ok flag and loading ibuf again, because the situation
* might have changed in the meantime */
- if(iuser) {
- if(iuser->ok==0) {
+ if (iuser) {
+ if (iuser->ok==0) {
BLI_unlock_thread(LOCK_IMAGE);
return NULL;
}
}
- else if(ima->ok==0) {
+ else if (ima->ok==0) {
BLI_unlock_thread(LOCK_IMAGE);
return NULL;
}
ibuf= image_get_ibuf_threadsafe(ima, iuser, &frame, &index);
- if(ibuf == NULL) {
+ if (ibuf == NULL) {
/* we are sure we have to load the ibuf, using source and type */
- if(ima->source==IMA_SRC_MOVIE) {
+ if (ima->source==IMA_SRC_MOVIE) {
/* source is from single file, use flipbook to store ibuf */
ibuf= image_load_movie_file(ima, iuser, frame);
}
- else if(ima->source==IMA_SRC_SEQUENCE) {
- if(ima->type==IMA_TYPE_IMAGE) {
+ else if (ima->source==IMA_SRC_SEQUENCE) {
+ if (ima->type==IMA_TYPE_IMAGE) {
/* regular files, ibufs in flipbook, allows saving */
ibuf= image_load_sequence_file(ima, iuser, frame);
}
/* no else; on load the ima type can change */
- if(ima->type==IMA_TYPE_MULTILAYER) {
+ if (ima->type==IMA_TYPE_MULTILAYER) {
/* only 1 layer/pass stored in imbufs, no exrhandle anim storage, no saving */
ibuf= image_load_sequence_multilayer(ima, iuser, frame);
}
}
- else if(ima->source==IMA_SRC_FILE) {
+ else if (ima->source==IMA_SRC_FILE) {
- if(ima->type==IMA_TYPE_IMAGE)
+ if (ima->type==IMA_TYPE_IMAGE)
ibuf= image_load_image_file(ima, iuser, frame); /* cfra only for '#', this global is OK */
/* no else; on load the ima type can change */
- if(ima->type==IMA_TYPE_MULTILAYER)
+ if (ima->type==IMA_TYPE_MULTILAYER)
/* keeps render result, stores ibufs in listbase, allows saving */
ibuf= image_get_ibuf_multilayer(ima, iuser);
}
- else if(ima->source == IMA_SRC_GENERATED) {
+ else if (ima->source == IMA_SRC_GENERATED) {
/* generated is: ibuf is allocated dynamically */
/* UV testgrid or black or solid etc */
- if(ima->gen_x==0) ima->gen_x= 1024;
- if(ima->gen_y==0) ima->gen_y= 1024;
+ if (ima->gen_x==0) ima->gen_x= 1024;
+ if (ima->gen_y==0) ima->gen_y= 1024;
ibuf= add_ibuf_size(ima->gen_x, ima->gen_y, ima->name, 24, (ima->gen_flag & IMA_GEN_FLOAT) != 0, ima->gen_type, color);
image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
ima->ok= IMA_OK_LOADED;
}
- else if(ima->source == IMA_SRC_VIEWER) {
- if(ima->type==IMA_TYPE_R_RESULT) {
+ 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) {
+ else if (ima->type==IMA_TYPE_COMPOSITE) {
/* requires lock/unlock, otherwise don't return image */
- if(lock_r) {
+ if (lock_r) {
/* unlock in BKE_image_release_ibuf */
BLI_lock_thread(LOCK_VIEWER);
*lock_r= ima;
@@ -2527,7 +2539,7 @@ ImBuf *BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **lock_r)
frame= 0; // XXX iuser?iuser->framenr:0;
ibuf= image_get_ibuf(ima, 0, frame);
- if(!ibuf) {
+ if (!ibuf) {
/* Composite Viewer, all handled in compositor */
/* fake ibuf, will be filled in compositor */
ibuf= IMB_allocImBuf(256, 256, 32, IB_rect);
@@ -2549,10 +2561,10 @@ ImBuf *BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **lock_r)
void BKE_image_release_ibuf(Image *ima, void *lock)
{
/* for getting image during threaded render / compositing, need to release */
- if(lock == ima) {
+ if (lock == ima) {
BLI_unlock_thread(LOCK_VIEWER); /* viewer image */
}
- else if(lock) {
+ else if (lock) {
RE_ReleaseResultImage(lock); /* render result */
BLI_unlock_thread(LOCK_VIEWER); /* view image imbuf */
}
@@ -2569,7 +2581,7 @@ int BKE_image_user_get_frame(const ImageUser *iuser, int cfra, int fieldnr)
{
const int len= (iuser->fie_ima*iuser->frames)/2;
- if(len==0) {
+ if (len==0) {
return 0;
}
else {
@@ -2577,28 +2589,28 @@ int BKE_image_user_get_frame(const ImageUser *iuser, int cfra, int fieldnr)
cfra= cfra - iuser->sfra+1;
/* cyclic */
- if(iuser->cycl) {
+ if (iuser->cycl) {
cfra= ( (cfra) % len );
- if(cfra < 0) cfra+= len;
- if(cfra==0) cfra= len;
+ if (cfra < 0) cfra+= len;
+ if (cfra==0) cfra= len;
}
- if(cfra<0) cfra= 0;
- else if(cfra>len) cfra= len;
+ if (cfra<0) cfra= 0;
+ else if (cfra>len) cfra= len;
/* convert current frame to current field */
cfra= 2*(cfra);
- if(fieldnr) cfra++;
+ if (fieldnr) cfra++;
/* transform to images space */
framenr= (cfra+iuser->fie_ima-2)/iuser->fie_ima;
- if(framenr>iuser->frames) framenr= iuser->frames;
+ if (framenr>iuser->frames) framenr= iuser->frames;
framenr+= iuser->offset;
- if(iuser->cycl) {
+ if (iuser->cycl) {
framenr= ( (framenr) % len );
- while(framenr < 0) framenr+= len;
- if(framenr==0) framenr= len;
+ while (framenr < 0) framenr+= len;
+ if (framenr==0) framenr= len;
}
return framenr;
@@ -2610,12 +2622,12 @@ void BKE_image_user_calc_frame(ImageUser *iuser, int cfra, int fieldnr)
const int framenr= BKE_image_user_get_frame(iuser, cfra, fieldnr);
/* allows image users to handle redraws */
- if(iuser->flag & IMA_ANIM_ALWAYS)
- if(framenr!=iuser->framenr)
+ if (iuser->flag & IMA_ANIM_ALWAYS)
+ if (framenr!=iuser->framenr)
iuser->flag |= IMA_ANIM_REFRESHED;
iuser->framenr= framenr;
- if(iuser->ok==0) iuser->ok= 1;
+ if (iuser->ok==0) iuser->ok= 1;
}
int BKE_image_has_alpha(struct Image *image)
diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c
index c6cb8c9582a..675c0771140 100644
--- a/source/blender/blenkernel/intern/image_gen.c
+++ b/source/blender/blenkernel/intern/image_gen.c
@@ -38,22 +38,22 @@ void BKE_image_buf_fill_color(unsigned char *rect, float *rect_float, int width,
int x, y;
/* blank image */
- if(rect_float) {
- for(y= 0; y<height; y++) {
- for(x= 0; x<width; x++) {
+ if (rect_float) {
+ for (y= 0; y<height; y++) {
+ for (x= 0; x<width; x++) {
copy_v4_v4(rect_float, color);
rect_float+= 4;
}
}
}
- if(rect) {
+ if (rect) {
unsigned char ccol[4];
rgba_float_to_uchar(ccol, color);
- for(y= 0; y<height; y++) {
- for(x= 0; x<width; x++) {
+ for (y= 0; y<height; y++) {
+ for (x= 0; x<width; x++) {
rect[0]= ccol[0];
rect[1]= ccol[1];
@@ -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;
@@ -81,17 +81,18 @@ void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int widt
float h=0.0, hoffs=0.0, hue=0.0, s=0.9, v=0.9, r, g, b;
/* checkers */
- for(y= 0; y<height; y++) {
+ for (y= 0; y<height; y++) {
dark= powf(-1.0f, floorf(y / checkerwidth));
- for(x= 0; x<width; x++) {
+ for (x= 0; x<width; x++) {
if (x % checkerwidth == 0) dark= -dark;
if (rect_float) {
if (dark > 0) {
rect_float[0]= rect_float[1]= rect_float[2]= 0.25f;
rect_float[3]= 1.0f;
- } else {
+ }
+ else {
rect_float[0]= rect_float[1]= rect_float[2]= 0.58f;
rect_float[3]= 1.0f;
}
@@ -101,7 +102,8 @@ void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int widt
if (dark > 0) {
rect[0]= rect[1]= rect[2]= 64;
rect[3]= 255;
- } else {
+ }
+ else {
rect[0]= rect[1]= rect[2]= 150;
rect[3]= 255;
}
@@ -114,10 +116,10 @@ void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int widt
rect_float= rect_float_orig;
/* 2nd pass, colored + */
- for(y= 0; y<height; y++) {
+ for (y= 0; y<height; y++) {
hoffs= 0.125f * floorf(y / checkerwidth);
- for(x= 0; x<width; x++) {
+ for (x= 0; x<width; x++) {
h= 0.125f * floorf(x / checkerwidth);
if ((fabs((x % checkerwidth) - (checkerwidth / 2)) < 4) &&
@@ -165,13 +167,13 @@ static void checker_board_color_fill(unsigned char *rect, float *rect_float, int
sat= 1.0;
hue_step= power_of_2_max_i(width / 8);
- if(hue_step < 8) hue_step= 8;
+ if (hue_step < 8) hue_step= 8;
- for(y= 0; y < height; y++)
+ for (y= 0; y < height; y++)
{
val= 0.1 + (y * (0.4 / height)); /* use a number lower then 1.0 else its too bright */
- for(x= 0; x < width; x++)
+ for (x= 0; x < width; x++)
{
hue= (float)((double)(x/hue_step) * 1.0 / width * hue_step);
hsv_to_rgb(hue, sat, val, &r, &g, &b);
@@ -202,12 +204,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 +250,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);
@@ -275,8 +271,8 @@ static void checker_board_grid_fill(unsigned char *rect, float *rect_float, int
}
}
else {
- if(rect_float) rect_float += 4;
- if(rect) rect += 4;
+ if (rect_float) rect_float += 4;
+ if (rect) rect += 4;
}
}
}
@@ -295,11 +291,11 @@ static void checker_board_text(unsigned char *rect, float *rect_float, int width
BLF_buffer(mono, rect_float, rect, width, height, 4);
- for(y= 0; y < height; y+=step)
+ for (y= 0; y < height; y+=step)
{
text[1]= '1';
- for(x= 0; x < width; x+=step)
+ for (x= 0; x < width; x+=step)
{
/* hard coded offset */
pen_x = x + 33;
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c
index f54a885c55e..23aa03b0331 100644
--- a/source/blender/blenkernel/intern/implicit.c
+++ b/source/blender/blenkernel/intern/implicit.c
@@ -57,7 +57,7 @@ static LARGE_INTEGER ifreq;
static void itstart(void)
{
static int first = 1;
- if(first) {
+ if (first) {
QueryPerformanceFrequency(&ifreq);
first = 0;
}
@@ -178,7 +178,7 @@ static void print_fvector(float m3[3])
DO_INLINE void print_lfvector(float (*fLongVector)[3], unsigned int verts)
{
unsigned int i = 0;
- for(i = 0; i < verts; i++)
+ for (i = 0; i < verts; i++)
{
print_fvector(fLongVector[i]);
}
@@ -208,9 +208,9 @@ DO_INLINE void cp_lfvector(float (*to)[3], float (*from)[3], unsigned int verts)
DO_INLINE void init_lfvector(float (*fLongVector)[3], float vector[3], unsigned int verts)
{
unsigned int i = 0;
- for(i = 0; i < verts; i++)
+ for (i = 0; i < verts; i++)
{
- VECCOPY(fLongVector[i], vector);
+ copy_v3_v3(fLongVector[i], vector);
}
}
/* zero long vector with float[3] */
@@ -223,7 +223,7 @@ DO_INLINE void mul_lfvectorS(float (*to)[3], float (*fLongVector)[3], float scal
{
unsigned int i = 0;
- for(i = 0; i < verts; i++)
+ for (i = 0; i < verts; i++)
{
mul_fvector_S(to[i], fLongVector[i], scalar);
}
@@ -233,7 +233,7 @@ DO_INLINE void mul_lfvectorS(float (*to)[3], float (*fLongVector)[3], float scal
DO_INLINE void submul_lfvectorS(float (*to)[3], float (*fLongVector)[3], float scalar, unsigned int verts)
{
unsigned int i = 0;
- for(i = 0; i < verts; i++)
+ for (i = 0; i < verts; i++)
{
VECSUBMUL(to[i], fLongVector[i], scalar);
}
@@ -247,10 +247,9 @@ DO_INLINE float dot_lfvector(float (*fLongVectorA)[3], float (*fLongVectorB)[3],
// due to non-commutative nature of floating point ops this makes the sim give
// 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]);
+//#pragma omp parallel for reduction(+: temp) if (verts > CLOTH_OPENMP_LIMIT)
+ for (i = 0; i < (long)verts; i++) {
+ temp += dot_v3v3(fLongVectorA[i], fLongVectorB[i]);
}
return temp;
}
@@ -259,7 +258,7 @@ DO_INLINE void add_lfvector_lfvector(float (*to)[3], float (*fLongVectorA)[3], f
{
unsigned int i = 0;
- for(i = 0; i < verts; i++)
+ for (i = 0; i < verts; i++)
{
VECADD(to[i], fLongVectorA[i], fLongVectorB[i]);
}
@@ -270,7 +269,7 @@ DO_INLINE void add_lfvector_lfvectorS(float (*to)[3], float (*fLongVectorA)[3],
{
unsigned int i = 0;
- for(i = 0; i < verts; i++)
+ for (i = 0; i < verts; i++)
{
VECADDS(to[i], fLongVectorA[i], fLongVectorB[i], bS);
@@ -281,7 +280,7 @@ DO_INLINE void add_lfvectorS_lfvectorS(float (*to)[3], float (*fLongVectorA)[3],
{
unsigned int i = 0;
- for(i = 0; i < verts; i++)
+ for (i = 0; i < verts; i++)
{
VECADDSS(to[i], fLongVectorA[i], aS, fLongVectorB[i], bS);
}
@@ -290,7 +289,7 @@ DO_INLINE void add_lfvectorS_lfvectorS(float (*to)[3], float (*fLongVectorA)[3],
DO_INLINE void sub_lfvector_lfvectorS(float (*to)[3], float (*fLongVectorA)[3], float (*fLongVectorB)[3], float bS, unsigned int verts)
{
unsigned int i = 0;
- for(i = 0; i < verts; i++)
+ for (i = 0; i < verts; i++)
{
VECSUBS(to[i], fLongVectorA[i], fLongVectorB[i], bS);
}
@@ -301,9 +300,9 @@ DO_INLINE void sub_lfvector_lfvector(float (*to)[3], float (*fLongVectorA)[3], f
{
unsigned int i = 0;
- for(i = 0; i < verts; i++)
+ 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 */
@@ -351,14 +350,14 @@ DO_INLINE void inverse_fmatrix(float to[3][3], float from[3][3])
unsigned int i, j;
float d;
- if((d=det_fmatrix(from))==0)
+ if ((d=det_fmatrix(from))==0)
{
printf("can't build inverse");
exit(0);
}
- for(i=0;i<3;i++)
+ for (i=0;i<3;i++)
{
- for(j=0;j<3;j++)
+ for (j=0;j<3;j++)
{
int i1=(i+1)%3;
int i2=(i+2)%3;
@@ -367,7 +366,7 @@ DO_INLINE void inverse_fmatrix(float to[3][3], float from[3][3])
// reverse indexs i&j to take transpose
to[j][i] = (from[i1][j1]*from[i2][j2]-from[i1][j2]*from[i2][j1])/d;
/*
- if(i==j)
+ if (i==j)
to[i][j] = 1.0f / from[i][j];
else
to[i][j] = 0;
@@ -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);
}
/////////////////////////////////////////////////////////////////
@@ -517,7 +516,7 @@ static void print_bfmatrix(fmatrix3x3 *m3)
{
unsigned int i = 0;
- for(i = 0; i < m3[0].vcount + m3[0].scount; i++)
+ for (i = 0; i < m3[0].vcount + m3[0].scount; i++)
{
print_fmatrix(m3[i].m);
}
@@ -555,7 +554,7 @@ DO_INLINE void init_bfmatrix(fmatrix3x3 *matrix, float m3[3][3])
{
unsigned int i;
- for(i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
+ for (i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
{
cp_fmatrix(matrix[i].m, m3);
}
@@ -568,11 +567,11 @@ DO_INLINE void initdiag_bfmatrix(fmatrix3x3 *matrix, float m3[3][3])
unsigned int i,j;
float tmatrix[3][3] = {{0,0,0},{0,0,0},{0,0,0}};
- for(i = 0; i < matrix[0].vcount; i++)
+ for (i = 0; i < matrix[0].vcount; i++)
{
cp_fmatrix(matrix[i].m, m3);
}
- for(j = matrix[0].vcount; j < matrix[0].vcount+matrix[0].scount; j++)
+ for (j = matrix[0].vcount; j < matrix[0].vcount+matrix[0].scount; j++)
{
cp_fmatrix(matrix[j].m, tmatrix);
}
@@ -582,7 +581,7 @@ DO_INLINE void initdiag_bfmatrix(fmatrix3x3 *matrix, float m3[3][3])
DO_INLINE void mul_bfmatrix_S(fmatrix3x3 *matrix, float scalar)
{
unsigned int i = 0;
- for(i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
+ for (i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
{
mul_fmatrix_S(matrix[i].m, scalar);
}
@@ -598,18 +597,18 @@ DO_INLINE void mul_bfmatrix_lfvector( float (*to)[3], fmatrix3x3 *from, lfVector
zero_lfvector(to, vcount);
-#pragma omp parallel sections private(i) if(vcount > CLOTH_OPENMP_LIMIT)
+#pragma omp parallel sections private(i) if (vcount > CLOTH_OPENMP_LIMIT)
{
#pragma omp section
{
- for(i = from[0].vcount; i < from[0].vcount+from[0].scount; i++)
+ for (i = from[0].vcount; i < from[0].vcount+from[0].scount; i++)
{
muladd_fmatrix_fvector(to[from[i].c], from[i].m, fLongVector[from[i].r]);
}
}
#pragma omp section
{
- for(i = 0; i < from[0].vcount+from[0].scount; i++)
+ for (i = 0; i < from[0].vcount+from[0].scount; i++)
{
muladd_fmatrix_fvector(temp[from[i].r], from[i].m, fLongVector[from[i].c]);
}
@@ -628,7 +627,7 @@ DO_INLINE void mul_prevfmatrix_lfvector( float (*to)[3], fmatrix3x3 *from, lfVec
{
unsigned int i = 0;
- for(i = 0; i < from[0].vcount; i++)
+ for (i = 0; i < from[0].vcount; i++)
{
mul_fmatrix_fvector(to[from[i].r], from[i].m, fLongVector[from[i].c]);
}
@@ -640,7 +639,7 @@ DO_INLINE void add_bfmatrix_bfmatrix( fmatrix3x3 *to, fmatrix3x3 *from, fmatrix
unsigned int i = 0;
/* process diagonal elements */
- for(i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
+ for (i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
{
add_fmatrix_fmatrix(to[i].m, from[i].m, matrix[i].m);
}
@@ -652,7 +651,7 @@ DO_INLINE void addadd_bfmatrix_bfmatrix( fmatrix3x3 *to, fmatrix3x3 *from, fmat
unsigned int i = 0;
/* process diagonal elements */
- for(i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
+ for (i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
{
addadd_fmatrix_fmatrix(to[i].m, from[i].m, matrix[i].m);
}
@@ -664,7 +663,7 @@ DO_INLINE void subadd_bfmatrix_bfmatrix( fmatrix3x3 *to, fmatrix3x3 *from, fmat
unsigned int i = 0;
/* process diagonal elements */
- for(i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
+ for (i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
{
subadd_fmatrix_fmatrix(to[i].m, from[i].m, matrix[i].m);
}
@@ -676,7 +675,7 @@ DO_INLINE void sub_bfmatrix_bfmatrix( fmatrix3x3 *to, fmatrix3x3 *from, fmatrix
unsigned int i = 0;
/* process diagonal elements */
- for(i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
+ for (i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
{
sub_fmatrix_fmatrix(to[i].m, from[i].m, matrix[i].m);
}
@@ -688,7 +687,7 @@ DO_INLINE void sub_bfmatrix_Smatrix( fmatrix3x3 *to, fmatrix3x3 *from, fmatrix3
unsigned int i = 0;
/* process diagonal elements */
- for(i = 0; i < matrix[0].vcount; i++)
+ for (i = 0; i < matrix[0].vcount; i++)
{
sub_fmatrix_fmatrix(to[matrix[i].c].m, from[matrix[i].c].m, matrix[i].m);
}
@@ -700,7 +699,7 @@ DO_INLINE void addsub_bfmatrix_bfmatrix( fmatrix3x3 *to, fmatrix3x3 *from, fmat
unsigned int i = 0;
/* process diagonal elements */
- for(i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
+ for (i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
{
addsub_fmatrix_fmatrix(to[i].m, from[i].m, matrix[i].m);
}
@@ -714,7 +713,7 @@ DO_INLINE void subadd_bfmatrixS_bfmatrixS( fmatrix3x3 *to, fmatrix3x3 *from, flo
unsigned int i = 0;
/* process diagonal elements */
- for(i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
+ for (i = 0; i < matrix[0].vcount+matrix[0].scount; i++)
{
subadd_fmatrixS_fmatrixS(to[i].m, from[i].m, aS, matrix[i].m, bS);
}
@@ -740,7 +739,7 @@ int implicit_init (Object *UNUSED(ob), ClothModifierData *clmd)
Implicit_Data *id = NULL;
LinkNode *search = NULL;
- if(G.rt > 0)
+ if (G.rt > 0)
printf("implicit_init\n");
// init memory guard
@@ -773,11 +772,11 @@ int implicit_init (Object *UNUSED(ob), ClothModifierData *clmd)
id->dV = create_lfvector(cloth->numverts);
id->z = create_lfvector(cloth->numverts);
- for(i=0;i<cloth->numverts;i++)
+ for (i=0;i<cloth->numverts;i++)
{
id->A[i].r = id->A[i].c = id->dFdV[i].r = id->dFdV[i].c = id->dFdX[i].r = id->dFdX[i].c = id->P[i].c = id->P[i].r = id->Pinv[i].c = id->Pinv[i].r = id->bigI[i].c = id->bigI[i].r = id->M[i].r = id->M[i].c = i;
- if(verts [i].flags & CLOTH_VERT_FLAG_PINNED)
+ if (verts [i].flags & CLOTH_VERT_FLAG_PINNED)
{
id->S[pinned].pinned = 1;
id->S[pinned].c = id->S[pinned].r = i;
@@ -792,7 +791,7 @@ int implicit_init (Object *UNUSED(ob), ClothModifierData *clmd)
// init springs
search = cloth->springs;
- for(i=0;i<cloth->numsprings;i++)
+ for (i=0;i<cloth->numsprings;i++)
{
spring = search->link;
@@ -811,9 +810,9 @@ int implicit_init (Object *UNUSED(ob), ClothModifierData *clmd)
initdiag_bfmatrix(id->bigI, I);
- for(i = 0; i < cloth->numverts; i++)
+ 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;
@@ -824,11 +823,11 @@ int implicit_free (ClothModifierData *clmd)
Cloth *cloth;
cloth = (Cloth *)clmd->clothObject;
- if(cloth)
+ if (cloth)
{
id = cloth->implicit;
- if(id)
+ if (id)
{
del_bfmatrix(id->A);
del_bfmatrix(id->dFdV);
@@ -875,7 +874,7 @@ DO_INLINE float fbstar(float length, float L, float kb, float cb)
float fbstar = cb * (length - L);
- if(tempfb < fbstar)
+ if (tempfb < fbstar)
return fbstar;
else
return tempfb;
@@ -887,7 +886,7 @@ DO_INLINE float fbstar_jacobi(float length, float L, float kb, float cb)
float tempfb = kb * fb(length, L);
float fbstar = cb * (length - L);
- if(tempfb < fbstar)
+ if (tempfb < fbstar)
{
return cb;
}
@@ -901,7 +900,7 @@ DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
{
unsigned int i=0;
- for(i=0;i<S[0].vcount;i++)
+ for (i=0;i<S[0].vcount;i++)
{
mul_fvector_fmatrix(V[S[i].r], V[S[i].r], S[i].m);
}
@@ -937,7 +936,7 @@ static int cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z
s = dot_lfvector(r, r, numverts);
starget = s * sqrt(conjgrad_epsilon);
- while(s>starget && conjgrad_loopcount < conjgrad_looplimit)
+ while (s>starget && conjgrad_loopcount < conjgrad_looplimit)
{
// Mul(q,A,d); // q = A*d;
mul_bfmatrix_lfvector(q, lA, d);
@@ -979,8 +978,8 @@ DO_INLINE void BuildPPinv(fmatrix3x3 *lA, fmatrix3x3 *P, fmatrix3x3 *Pinv)
unsigned int i = 0;
// Take only the diagonal blocks of A
-// #pragma omp parallel for private(i) if(lA[0].vcount > CLOTH_OPENMP_LIMIT)
- for(i = 0; i<lA[0].vcount; i++)
+// #pragma omp parallel for private(i) if (lA[0].vcount > CLOTH_OPENMP_LIMIT)
+ for (i = 0; i<lA[0].vcount; i++)
{
// block diagonalizer
cp_fmatrix(P[i].m, lA[i].m);
@@ -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,24 +1243,24 @@ 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;
- if(length > ALMOST_ZERO)
+ if (length > ALMOST_ZERO)
{
/*
- if(length>L)
+ if (length>L)
{
- if((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED)
+ if ((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED)
&& ((((length-L)*100.0f/L) > clmd->sim_parms->maxspringlen))) // cut spring!
{
s->flags |= CSPRING_FLAG_DEACTIVATE;
@@ -1277,9 +1276,9 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
}
// calculate force of structural + shear springs
- if((s->type & CLOTH_SPRING_TYPE_STRUCTURAL) || (s->type & CLOTH_SPRING_TYPE_SHEAR))
+ if ((s->type & CLOTH_SPRING_TYPE_STRUCTURAL) || (s->type & CLOTH_SPRING_TYPE_SHEAR))
{
- if(length > L || no_compress)
+ if (length > L || no_compress)
{
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!!!!
@@ -1341,7 +1339,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
}
else // calculate force of bending springs
{
- if(length < L)
+ if (length < L)
{
s->flags |= CLOTH_SPRING_FLAG_NEEDED;
@@ -1360,9 +1358,9 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
DO_INLINE void cloth_apply_spring_force(ClothModifierData *UNUSED(clmd), ClothSpring *s, lfVector *lF, lfVector *UNUSED(X), lfVector *UNUSED(V), fmatrix3x3 *dFdV, fmatrix3x3 *dFdX)
{
- if(s->flags & CLOTH_SPRING_FLAG_NEEDED)
+ if (s->flags & CLOTH_SPRING_FLAG_NEEDED)
{
- if(!(s->type & CLOTH_SPRING_TYPE_BENDING))
+ if (!(s->type & CLOTH_SPRING_TYPE_BENDING))
{
sub_fmatrix_fmatrix(dFdV[s->ij].m, dFdV[s->ij].m, s->dfdv);
sub_fmatrix_fmatrix(dFdV[s->kl].m, dFdV[s->kl].m, s->dfdv);
@@ -1371,8 +1369,8 @@ 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);
+ if (!(s->type & CLOTH_SPRING_TYPE_GOAL))
+ 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,14 +1414,14 @@ 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 {
float velocity[3];
float density;
} HairGridVert;
-#define HAIR_GRID_INDEX(vec, min, max, axis) (int)( (vec[axis] - min[axis]) / (max[axis] - min[axis]) * 9.99f );
+#define HAIR_GRID_INDEX(vec, min, max, axis) (int)((vec[axis] - min[axis]) / (max[axis] - min[axis]) * 9.99f)
/* Smoothing of hair velocities:
* adapted from
Volumetric Methods for Simulation and Rendering of Hair
@@ -1453,13 +1451,13 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
INIT_MINMAX(gmin, gmax);
- for(i = 0; i < numverts; i++)
+ for (i = 0; i < numverts; i++)
DO_MINMAX(lX[i], gmin, gmax);
/* initialize grid */
- for(i = 0; i < 10; i++) {
- for(j = 0; j < 10; j++) {
- for(k = 0; k < 10; k++) {
+ for (i = 0; i < 10; i++) {
+ for (j = 0; j < 10; j++) {
+ for (k = 0; k < 10; k++) {
grid[i][j][k].velocity[0] = 0.0f;
grid[i][j][k].velocity[1] = 0.0f;
grid[i][j][k].velocity[2] = 0.0f;
@@ -1474,7 +1472,7 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
}
/* gather velocities & density */
- if(smoothfac > 0.0f) for(v = 0; v < numverts; v++) {
+ if (smoothfac > 0.0f) for (v = 0; v < numverts; v++) {
i = HAIR_GRID_INDEX(lX[v], gmin, gmax, 0);
j = HAIR_GRID_INDEX(lX[v], gmin, gmax, 1);
k = HAIR_GRID_INDEX(lX[v], gmin, gmax, 2);
@@ -1488,23 +1486,23 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
}
/* gather colliders */
- if(colliders && collfac > 0.0f) for(col = colliders->first; col; col = col->next)
+ if (colliders && collfac > 0.0f) for (col = colliders->first; col; col = col->next)
{
MVert *loc0 = col->collmd->x;
MVert *loc1 = col->collmd->xnew;
float vel[3];
- for(v=0; v<col->collmd->numverts; v++, loc0++, loc1++) {
+ for (v=0; v<col->collmd->numverts; v++, loc0++, loc1++) {
i = HAIR_GRID_INDEX(loc1->co, gmin, gmax, 0);
- if(i>=0 && i<10) {
+ if (i>=0 && i<10) {
j = HAIR_GRID_INDEX(loc1->co, gmin, gmax, 1);
- if(j>=0 && j<10) {
+ if (j>=0 && j<10) {
k = HAIR_GRID_INDEX(loc1->co, gmin, gmax, 2);
- if(k>=0 && k<10) {
- VECSUB(vel, loc1->co, loc0->co);
+ if (k>=0 && k<10) {
+ sub_v3_v3v3(vel, loc1->co, loc0->co);
colg[i][j][k].velocity[0] += vel[0];
colg[i][j][k].velocity[1] += vel[1];
@@ -1518,18 +1516,18 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
/* divide velocity with density */
- for(i = 0; i < 10; i++) {
- for(j = 0; j < 10; j++) {
- for(k = 0; k < 10; k++) {
+ for (i = 0; i < 10; i++) {
+ for (j = 0; j < 10; j++) {
+ for (k = 0; k < 10; k++) {
density = grid[i][j][k].density;
- if(density > 0.0f) {
+ if (density > 0.0f) {
grid[i][j][k].velocity[0] /= density;
grid[i][j][k].velocity[1] /= density;
grid[i][j][k].velocity[2] /= density;
}
density = colg[i][j][k].density;
- if(density > 0.0f) {
+ if (density > 0.0f) {
colg[i][j][k].velocity[0] /= density;
colg[i][j][k].velocity[1] /= density;
colg[i][j][k].velocity[2] /= density;
@@ -1539,7 +1537,7 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
}
/* calculate forces */
- for(v = 0; v < numverts; v++) {
+ for (v = 0; v < numverts; v++) {
i = HAIR_GRID_INDEX(lX[v], gmin, gmax, 0);
j = HAIR_GRID_INDEX(lX[v], gmin, gmax, 1);
k = HAIR_GRID_INDEX(lX[v], gmin, gmax, 2);
@@ -1550,7 +1548,7 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
lF[v][1] += smoothfac * (grid[i][j][k].velocity[1] - lV[v][1]);
lF[v][2] += smoothfac * (grid[i][j][k].velocity[2] - lV[v][2]);
- if(colg[i][j][k].density > 0.0f) {
+ if (colg[i][j][k].density > 0.0f) {
lF[v][0] += collfac * (colg[i][j][k].velocity[0] - lV[v][0]);
lF[v][1] += collfac * (colg[i][j][k].velocity[1] - lV[v][1]);
lF[v][2] += collfac * (colg[i][j][k].velocity[2] - lV[v][2]);
@@ -1577,8 +1575,8 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
tm2[0][0]= tm2[1][1]= tm2[2][2]= -spring_air;
/* global acceleration (gravitation) */
- if(clmd->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
- VECCOPY(gravity, clmd->scene->physics_settings.gravity);
+ if (clmd->scene->physics_settings.flag & PHYS_GLOBAL_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 */
}
@@ -1589,38 +1587,38 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
init_lfvector(lF, gravity, numverts);
- if(clmd->sim_parms->velocity_smooth > 0.0f || clmd->sim_parms->collider_friction > 0.0f)
+ if (clmd->sim_parms->velocity_smooth > 0.0f || clmd->sim_parms->collider_friction > 0.0f)
hair_velocity_smoothing(clmd, lF, lX, lV, numverts);
/* multiply lF with mass matrix
// force = mass * acceleration (in this case: gravity)
*/
- for(i = 0; i < numverts; i++)
+ 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);
}
submul_lfvectorS(lF, lV, spring_air, numverts);
/* handle external forces like wind */
- if(effectors)
+ if (effectors)
{
// 0 = force, 1 = normalized force
winvec = create_lfvector(cloth->numverts);
- if(!winvec)
+ if (!winvec)
printf("winvec: out of memory in implicit.c\n");
// precalculate wind forces
- for(i = 0; i < cloth->numverts; i++)
+ for (i = 0; i < cloth->numverts; i++)
{
pd_point_from_loc(clmd->scene, (float*)lX[i], (float*)lV[i], i, &epoint);
pdDoEffectors(effectors, NULL, clmd->sim_parms->effector_weights, &epoint, winvec[i], NULL);
}
- for(i = 0; i < cloth->numfaces; i++)
+ for (i = 0; i < cloth->numfaces; i++)
{
float trinormal[3]={0,0,0}; // normalized triangle normal
float triunnormal[3]={0,0,0}; // not-normalized-triangle normal
@@ -1629,7 +1627,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
factor *= 0.02;
// calculate face normal
- if(mfaces[i].v4)
+ if (mfaces[i].v4)
CalcFloat4(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],lX[mfaces[i].v4],triunnormal);
else
CalcFloat(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],triunnormal);
@@ -1637,31 +1635,31 @@ 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)
+ 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);
}
}
/* Hair has only edges */
- if(cloth->numfaces == 0) {
+ if (cloth->numfaces == 0) {
ClothSpring *spring;
float edgevec[3]={0,0,0}; //edge vector
float edgeunnormal[3]={0,0,0}; // not-normalized-edge normal
@@ -1669,19 +1667,19 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
float factor = 0.01;
search = cloth->springs;
- while(search) {
+ while (search) {
spring = search->link;
- if(spring->type == CLOTH_SPRING_TYPE_STRUCTURAL) {
- VECSUB(edgevec, (float*)lX[spring->ij], (float*)lX[spring->kl]);
+ if (spring->type == CLOTH_SPRING_TYPE_STRUCTURAL) {
+ 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);
}
@@ -1694,10 +1692,10 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
// calculate spring forces
search = cloth->springs;
- while(search)
+ while (search)
{
// only handle active springs
- // if(((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED)) {}
+ // if (((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED)) {}
cloth_calc_spring_force(clmd, search->link, lF, lX, lV, dFdV, dFdX, time);
search = search->next;
@@ -1705,10 +1703,10 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
// apply spring forces
search = cloth->springs;
- while(search)
+ while (search)
{
// only handle active springs
- // if(((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED))
+ // if (((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED))
cloth_apply_spring_force(clmd, search->link, lF, lX, lV, dFdV, dFdX);
search = search->next;
}
@@ -1767,7 +1765,8 @@ int cloth_calc_helper_forces(Object *UNUSED(ob), ClothModifierData * clmd, float
if (cv->goal == 1.0f || len_v3v3(initial_cos[i], cv->tx) != 0.0) {
masses[i] = 1e+10;
- } else {
+ }
+ else {
masses[i] = cv->mass;
}
}
@@ -1837,20 +1836,20 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
Implicit_Data *id = cloth->implicit;
int do_extra_solve;
- if(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) /* do goal stuff */
+ if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) /* do goal stuff */
{
- for(i = 0; i < numverts; i++)
+ for (i = 0; i < numverts; i++)
{
// update velocities with constrained velocities from pinned verts
- if(verts [i].flags & CLOTH_VERT_FLAG_PINNED)
+ 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);
}
}
}
- while(step < tf)
+ while (step < tf)
{
// damping velocity for artistic reasons
mul_lfvectorS(id->V, id->V, clmd->sim_parms->vel_damping, numverts);
@@ -1865,35 +1864,35 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
add_lfvector_lfvectorS(id->Xnew, id->X, id->Vnew, dt, numverts);
/* move pinned verts to correct position */
- for(i = 0; i < numverts; i++)
+ for (i = 0; i < numverts; i++)
{
- if(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL)
+ if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL)
{
- if(verts [i].flags & CLOTH_VERT_FLAG_PINNED)
+ 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)
+ if (clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_ENABLED && clmd->clothObject->bvhtree)
{
// collisions
// itstart();
// update verts to current positions
- for(i = 0; i < numverts; i++)
+ 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++) {
@@ -1905,26 +1904,26 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
do_extra_solve = cloth_bvh_objcollision(ob, clmd, step/clmd->sim_parms->timescale, dt/clmd->sim_parms->timescale);
// copy corrected positions back to simulation
- for(i = 0; i < numverts; i++)
+ 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)
// cloth_calc_helper_forces(ob, clmd, initial_cos, step/clmd->sim_parms->timescale, dt/clmd->sim_parms->timescale);
- for(i = 0; i < numverts; i++)
+ for (i = 0; i < numverts; i++)
{
- if(do_extra_solve)
+ if (do_extra_solve)
{
- if((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) && (verts [i].flags & CLOTH_VERT_FLAG_PINNED))
+ 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);
}
}
@@ -1934,7 +1933,7 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
// if there were collisions, advance the velocity from v_n+1/2 to v_n+1
- if(do_extra_solve)
+ if (do_extra_solve)
{
// V = Vnew;
cp_lfvector(id->V, id->Vnew, numverts);
@@ -1960,19 +1959,19 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
step += dt;
}
- for(i = 0; i < numverts; i++)
+ for (i = 0; i < numverts; i++)
{
- if((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) && (verts [i].flags & CLOTH_VERT_FLAG_PINNED))
+ 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]);
}
}
@@ -1988,12 +1987,12 @@ void implicit_set_positions (ClothModifierData *clmd)
unsigned int numverts = cloth->numverts, i;
Implicit_Data *id = cloth->implicit;
- for(i = 0; i < numverts; i++)
+ 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)
+ 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..51c4caa1cf4 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -97,8 +97,8 @@ void free_ipo (Ipo *ipo)
BLI_freelinkN(&ipo->curve, icu);
}
- if (G.f & G_DEBUG)
- printf("Freed %d (Unconverted) Ipo-Curves from IPO '%s' \n", n, ipo->id.name+2);
+ if (G.debug & G_DEBUG)
+ printf("Freed %d (Unconverted) Ipo-Curves from IPO '%s'\n", n, ipo->id.name+2);
}
/* *************************************************** */
@@ -296,7 +296,7 @@ static const char *pchan_adrcodes_to_paths (int adrcode, int *array_index)
}
/* for debugging only */
- printf("ERROR: unmatched PoseChannel setting (code %d) \n", adrcode);
+ printf("ERROR: unmatched PoseChannel setting (code %d)\n", adrcode);
return NULL;
}
@@ -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;
}
/* ------- */
@@ -889,7 +893,7 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
// TODO... add other blocktypes...
default:
- printf("IPO2ANIMATO WARNING: No path for blocktype %d, adrcode %d yet \n", blocktype, adrcode);
+ printf("IPO2ANIMATO WARNING: No path for blocktype %d, adrcode %d yet\n", blocktype, adrcode);
break;
}
@@ -1115,7 +1119,7 @@ static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, c
}
/* add F-Curve to group */
- /* WARNING: this func should only need to look at the stuff we initialised, if not, things may crash */
+ /* WARNING: this func should only need to look at the stuff we initialized, if not, things may crash */
action_groups_add_channel(&tmp_act, agrp, fcu);
if (agrp->flag & AGRP_MUTED) /* flush down */
@@ -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;
@@ -1195,7 +1199,7 @@ static void icu_to_fcurves (ID *id, ListBase *groups, ListBase *list, IpoCurve *
FCurve *fcurve;
int b;
- if (G.f & G_DEBUG) printf("\tconvert bitflag ipocurve, totbits = %d \n", totbits);
+ if (G.debug & G_DEBUG) printf("\tconvert bitflag ipocurve, totbits = %d\n", totbits);
/* add the 'only int values' flag */
fcu->flag |= (FCURVE_INT_VALUES|FCURVE_DISCRETE_VALUES);
@@ -1392,7 +1396,7 @@ static void ipo_to_animato (ID *id, Ipo *ipo, char actname[], char constname[],
if (ELEM3(NULL, ipo, anim, drivers))
return;
- if (G.f & G_DEBUG) printf("ipo_to_animato \n");
+ if (G.debug & G_DEBUG) printf("ipo_to_animato\n");
/* validate actname and constname
* - clear actname if it was one of the generic <builtin> ones (i.e. 'Object', or 'Shapes')
@@ -1514,15 +1518,15 @@ static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[],
ListBase drivers = {NULL, NULL};
/* sanity check */
- if ELEM(NULL, id, ipo)
+ if (ELEM(NULL, id, ipo))
return;
if (adt == NULL) {
- printf("ERROR ipo_to_animdata(): adt invalid \n");
+ printf("ERROR ipo_to_animdata(): adt invalid\n");
return;
}
- if (G.f & G_DEBUG) {
- printf("ipo to animdata - ID:%s, IPO:%s, actname:%s constname:%s seqname:%s curves:%d \n",
+ if (G.debug & G_DEBUG) {
+ printf("ipo to animdata - ID:%s, IPO:%s, actname:%s constname:%s seqname:%s curves:%d\n",
id->name+2, ipo->id.name+2, (actname)?actname:"<None>", (constname)?constname:"<None>", (seq)?(seq->name+2):"<None>",
BLI_countlist(&ipo->curve));
}
@@ -1535,7 +1539,7 @@ static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[],
/* deal with animation first */
if (anim.first) {
- if (G.f & G_DEBUG) printf("\thas anim \n");
+ if (G.debug & G_DEBUG) printf("\thas anim\n");
/* try to get action */
if (adt->action == NULL) {
char nameBuf[MAX_ID_NAME];
@@ -1543,7 +1547,7 @@ static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[],
BLI_snprintf(nameBuf, sizeof(nameBuf), "CDA:%s", ipo->id.name+2);
adt->action= add_empty_action(nameBuf);
- if (G.f & G_DEBUG) printf("\t\tadded new action - '%s' \n", nameBuf);
+ if (G.debug & G_DEBUG) printf("\t\tadded new action - '%s'\n", nameBuf);
}
/* add F-Curves to action */
@@ -1552,7 +1556,7 @@ static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[],
/* deal with drivers */
if (drivers.first) {
- if (G.f & G_DEBUG) printf("\thas drivers \n");
+ if (G.debug & G_DEBUG) printf("\thas drivers\n");
/* add drivers to end of driver stack */
BLI_movelisttolist(&adt->drivers, &drivers);
}
@@ -1572,7 +1576,7 @@ static void action_to_animdata (ID *id, bAction *act)
/* check if we need to set this Action as the AnimData's action */
if (adt->action == NULL) {
/* set this Action as AnimData's Action */
- if (G.f & G_DEBUG) printf("act_to_adt - set adt action to act \n");
+ if (G.debug & G_DEBUG) printf("act_to_adt - set adt action to act\n");
adt->action= act;
}
@@ -1681,17 +1685,17 @@ void do_versions_ipos_to_animato(Main *main)
ID *id;
if (main == NULL) {
- printf("Argh! Main is NULL in do_versions_ipos_to_animato() \n");
+ printf("Argh! Main is NULL in do_versions_ipos_to_animato()\n");
return;
}
/* only convert if version is right */
if (main->versionfile >= 250) {
- printf("WARNING: Animation data too new to convert (Version %d) \n", main->versionfile);
+ printf("WARNING: Animation data too new to convert (Version %d)\n", main->versionfile);
return;
}
- else if (G.f & G_DEBUG)
- printf("INFO: Converting to Animato... \n");
+ else if (G.debug & G_DEBUG)
+ printf("INFO: Converting to Animato...\n");
/* ----------- Animation Attached to Data -------------- */
@@ -1702,7 +1706,7 @@ void do_versions_ipos_to_animato(Main *main)
bConstraint *con;
bConstraintChannel *conchan, *conchann;
- if (G.f & G_DEBUG) printf("\tconverting ob %s \n", id->name+2);
+ if (G.debug & G_DEBUG) printf("\tconverting ob %s\n", id->name+2);
/* check if object has any animation data */
if (ob->nlastrips.first) {
@@ -1827,7 +1831,7 @@ void do_versions_ipos_to_animato(Main *main)
for (id= main->key.first; id; id= id->next) {
Key *key= (Key *)id;
- if (G.f & G_DEBUG) printf("\tconverting key %s \n", id->name+2);
+ if (G.debug & G_DEBUG) printf("\tconverting key %s\n", id->name+2);
/* we're only interested in the IPO
* NOTE: for later, it might be good to port these over to Object instead, as many of these
@@ -1852,7 +1856,7 @@ void do_versions_ipos_to_animato(Main *main)
for (id= main->mat.first; id; id= id->next) {
Material *ma= (Material *)id;
- if (G.f & G_DEBUG) printf("\tconverting material %s \n", id->name+2);
+ if (G.debug & G_DEBUG) printf("\tconverting material %s\n", id->name+2);
/* we're only interested in the IPO */
if (ma->ipo) {
@@ -1874,7 +1878,7 @@ void do_versions_ipos_to_animato(Main *main)
for (id= main->world.first; id; id= id->next) {
World *wo= (World *)id;
- if (G.f & G_DEBUG) printf("\tconverting world %s \n", id->name+2);
+ if (G.debug & G_DEBUG) printf("\tconverting world %s\n", id->name+2);
/* we're only interested in the IPO */
if (wo->ipo) {
@@ -1905,8 +1909,8 @@ void do_versions_ipos_to_animato(Main *main)
IpoCurve *icu = (seq->ipo) ? seq->ipo->curve.first : NULL;
short adrcode = SEQ_FAC1;
- if (G.f & G_DEBUG)
- printf("\tconverting sequence strip %s \n", seq->name+2);
+ if (G.debug & G_DEBUG)
+ printf("\tconverting sequence strip %s\n", seq->name+2);
if (ELEM(NULL, seq->ipo, icu)) {
seq->flag |= SEQ_USE_EFFECT_DEFAULT_FADE;
@@ -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:
@@ -1949,7 +1953,7 @@ void do_versions_ipos_to_animato(Main *main)
for (id= main->tex.first; id; id= id->next) {
Tex *te= (Tex *)id;
- if (G.f & G_DEBUG) printf("\tconverting texture %s \n", id->name+2);
+ if (G.debug & G_DEBUG) printf("\tconverting texture %s\n", id->name+2);
/* we're only interested in the IPO */
if (te->ipo) {
@@ -1971,7 +1975,7 @@ void do_versions_ipos_to_animato(Main *main)
for (id= main->camera.first; id; id= id->next) {
Camera *ca= (Camera *)id;
- if (G.f & G_DEBUG) printf("\tconverting camera %s \n", id->name+2);
+ if (G.debug & G_DEBUG) printf("\tconverting camera %s\n", id->name+2);
/* we're only interested in the IPO */
if (ca->ipo) {
@@ -1993,7 +1997,7 @@ void do_versions_ipos_to_animato(Main *main)
for (id= main->lamp.first; id; id= id->next) {
Lamp *la= (Lamp *)id;
- if (G.f & G_DEBUG) printf("\tconverting lamp %s \n", id->name+2);
+ if (G.debug & G_DEBUG) printf("\tconverting lamp %s\n", id->name+2);
/* we're only interested in the IPO */
if (la->ipo) {
@@ -2015,7 +2019,7 @@ void do_versions_ipos_to_animato(Main *main)
for (id= main->curve.first; id; id= id->next) {
Curve *cu= (Curve *)id;
- if (G.f & G_DEBUG) printf("\tconverting curve %s \n", id->name+2);
+ if (G.debug & G_DEBUG) printf("\tconverting curve %s\n", id->name+2);
/* we're only interested in the IPO */
if (cu->ipo) {
@@ -2048,7 +2052,7 @@ void do_versions_ipos_to_animato(Main *main)
for (id= main->action.first; id; id= id->next) {
bAction *act= (bAction *)id;
- if (G.f & G_DEBUG) printf("\tconverting action %s \n", id->name+2);
+ if (G.debug & G_DEBUG) printf("\tconverting action %s\n", id->name+2);
/* if old action, it will be object-only... */
if (act->chanbase.first)
@@ -2062,7 +2066,7 @@ void do_versions_ipos_to_animato(Main *main)
for (id= main->ipo.first; id; id= id->next) {
Ipo *ipo= (Ipo *)id;
- if (G.f & G_DEBUG) printf("\tconverting ipo %s \n", id->name+2);
+ if (G.debug & G_DEBUG) printf("\tconverting ipo %s\n", id->name+2);
/* most likely this IPO has already been processed, so check if any curves left to convert */
if (ipo->curve.first) {
@@ -2082,7 +2086,7 @@ void do_versions_ipos_to_animato(Main *main)
/* free unused drivers from actions + ipos */
free_fcurves(&drivers);
- if (G.f & G_DEBUG)
- printf("INFO: Animato convert done \n");
+ if (G.debug & G_DEBUG)
+ printf("INFO: Animato convert done\n");
}
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 1b678225135..fe776bd5eae 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -83,9 +83,9 @@ void free_key(Key *key)
BKE_free_animdata((ID *)key);
- while( (kb= key->block.first) ) {
+ while ( (kb= key->block.first) ) {
- if(kb->data) MEM_freeN(kb->data);
+ if (kb->data) MEM_freeN(kb->data);
BLI_remlink(&key->block, kb);
MEM_freeN(kb);
@@ -97,9 +97,9 @@ void free_key_nolib(Key *key)
{
KeyBlock *kb;
- while( (kb= key->block.first) ) {
+ while ( (kb= key->block.first) ) {
- if(kb->data) MEM_freeN(kb->data);
+ if (kb->data) MEM_freeN(kb->data);
BLI_remlink(&key->block, kb);
MEM_freeN(kb);
@@ -133,7 +133,7 @@ Key *add_key(ID *id) /* common function */
key->uidgen = 1;
// XXX the code here uses some defines which will soon be depreceated...
- if( GS(id->name)==ID_ME) {
+ if ( GS(id->name)==ID_ME) {
el= key->elemstr;
el[0]= 3;
@@ -142,7 +142,7 @@ Key *add_key(ID *id) /* common function */
key->elemsize= 12;
}
- else if( GS(id->name)==ID_LT) {
+ else if ( GS(id->name)==ID_LT) {
el= key->elemstr;
el[0]= 3;
@@ -151,7 +151,7 @@ Key *add_key(ID *id) /* common function */
key->elemsize= 12;
}
- else if( GS(id->name)==ID_CU) {
+ else if ( GS(id->name)==ID_CU) {
el= key->elemstr;
el[0]= 4;
@@ -169,7 +169,7 @@ Key *copy_key(Key *key)
Key *keyn;
KeyBlock *kbn, *kb;
- if(key==NULL) return NULL;
+ if (key==NULL) return NULL;
keyn= copy_libblock(&key->id);
@@ -177,10 +177,10 @@ Key *copy_key(Key *key)
kb= key->block.first;
kbn= keyn->block.first;
- while(kbn) {
+ while (kbn) {
- if(kbn->data) kbn->data= MEM_dupallocN(kbn->data);
- if(kb==key->refkey) keyn->refkey= kbn;
+ if (kbn->data) kbn->data= MEM_dupallocN(kbn->data);
+ if (kb==key->refkey) keyn->refkey= kbn;
kbn= kbn->next;
kb= kb->next;
@@ -195,7 +195,7 @@ Key *copy_key_nolib(Key *key)
Key *keyn;
KeyBlock *kbn, *kb;
- if(key==0) return 0;
+ if (key==0) return 0;
keyn= MEM_dupallocN(key);
@@ -205,10 +205,10 @@ Key *copy_key_nolib(Key *key)
kb= key->block.first;
kbn= keyn->block.first;
- while(kbn) {
+ while (kbn) {
- if(kbn->data) kbn->data= MEM_dupallocN(kbn->data);
- if(kb==key->refkey) keyn->refkey= kbn;
+ if (kbn->data) kbn->data= MEM_dupallocN(kbn->data);
+ if (kb==key->refkey) keyn->refkey= kbn;
kbn= kbn->next;
kb= kb->next;
@@ -221,10 +221,10 @@ void make_local_key(Key *key)
{
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
- if(key==NULL) return;
+ * - only local users: set flag
+ * - mixed: make copy
+ */
+ if (key==NULL) return;
key->id.lib= NULL;
new_id(NULL, &key->id, NULL);
@@ -262,15 +262,15 @@ void sort_keys(Key *key)
/* if more than one Ipo curve, see if this key had a curve */
#if 0 // XXX old animation system
- if(key->ipo && key->ipo->curve.first != key->ipo->curve.last ) {
- for(icu= key->ipo->curve.first; icu; icu= icu->next) {
+ 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 */
- if(icu->adrcode==kb->adrcode) {
+ * right place */
+ if (icu->adrcode==kb->adrcode) {
IpoCurve *icu2;
BLI_remlink(&key->ipo->curve, icu);
- for(icu2= key->ipo->curve.first; icu2; icu2= icu2->next) {
- if(icu2->adrcode >= kb2->adrcode) {
+ for (icu2= key->ipo->curve.first; icu2; icu2= icu2->next) {
+ if (icu2->adrcode >= kb2->adrcode) {
BLI_insertlink(&key->ipo->curve, icu2->prev, icu);
break;
}
@@ -287,7 +287,7 @@ void sort_keys(Key *key)
adrcode = kb2->adrcode;
for (i = kb->adrcode - adrcode; i >= 0; i--, adrcode++) {
/* if the next ipo curve matches the current key, renumber it */
- if(icu && icu->adrcode == kb->adrcode ) {
+ if (icu && icu->adrcode == kb->adrcode ) {
icu->adrcode = adrcode;
icu = icu->next;
}
@@ -308,13 +308,13 @@ void key_curve_position_weights(float t, float *data, int type)
{
float t2, t3, fc;
- if(type==KEY_LINEAR) {
+ if (type==KEY_LINEAR) {
data[0]= 0.0f;
data[1]= -t + 1.0f;
data[2]= t;
data[3]= 0.0f;
}
- else if(type==KEY_CARDINAL) {
+ else if (type==KEY_CARDINAL) {
t2= t*t;
t3= t2*t;
fc= 0.71f;
@@ -324,7 +324,7 @@ void key_curve_position_weights(float t, float *data, int type)
data[2]= (fc-2.0f)*t3 + (3.0f-2.0f*fc)*t2 + fc*t;
data[3]= fc*t3 - fc*t2;
}
- else if(type==KEY_BSPLINE) {
+ else if (type==KEY_BSPLINE) {
t2= t*t;
t3= t2*t;
@@ -340,13 +340,13 @@ void key_curve_tangent_weights(float t, float *data, int type)
{
float t2, fc;
- if(type==KEY_LINEAR) {
+ if (type==KEY_LINEAR) {
data[0]= 0.0f;
data[1]= -1.0f;
data[2]= 1.0f;
data[3]= 0.0f;
}
- else if(type==KEY_CARDINAL) {
+ else if (type==KEY_CARDINAL) {
t2= t*t;
fc= 0.71f;
@@ -355,7 +355,7 @@ void key_curve_tangent_weights(float t, float *data, int type)
data[2]= 3.0f*(fc-2.0f)*t2 +2.0f*(3.0f-2.0f*fc)*t + fc;
data[3]= 3.0f*fc*t2 -2.0f*fc*t;
}
- else if(type==KEY_BSPLINE) {
+ else if (type==KEY_BSPLINE) {
t2= t*t;
data[0]= -0.5f*t2 + t - 0.5f;
@@ -370,13 +370,13 @@ void key_curve_normal_weights(float t, float *data, int type)
{
float fc;
- if(type==KEY_LINEAR) {
+ if (type==KEY_LINEAR) {
data[0]= 0.0f;
data[1]= 0.0f;
data[2]= 0.0f;
data[3]= 0.0f;
}
- else if(type==KEY_CARDINAL) {
+ else if (type==KEY_CARDINAL) {
fc= 0.71f;
data[0]= -6.0f*fc*t + 4.0f*fc;
@@ -384,7 +384,7 @@ void key_curve_normal_weights(float t, float *data, int type)
data[2]= 6.0f*(fc-2.0f)*t + 2.0f*(3.0f-2.0f*fc);
data[3]= 6.0f*fc*t - 2.0f*fc;
}
- else if(type==KEY_BSPLINE) {
+ else if (type==KEY_BSPLINE) {
data[0]= -1.0f*t + 1.0f;
data[1]= 3.0f*t - 2.0f;
data[2]= -3.0f*t + 1.0f;
@@ -404,22 +404,22 @@ static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl)
lastpos= k1->pos;
dpos= lastpos - firstkey->pos;
- if(fac < firstkey->pos) fac= firstkey->pos;
- else if(fac > k1->pos) fac= k1->pos;
+ if (fac < firstkey->pos) fac= firstkey->pos;
+ else if (fac > k1->pos) fac= k1->pos;
k1=k[0]=k[1]=k[2]=k[3]= firstkey;
t[0]=t[1]=t[2]=t[3]= k1->pos;
- /* if(fac<0.0 || fac>1.0) return 1; */
+ /* if (fac<0.0 || fac>1.0) return 1; */
- if(k1->next==NULL) return 1;
+ if (k1->next==NULL) return 1;
- if(cycl) { /* pre-sort */
+ if (cycl) { /* pre-sort */
k[2]= k1->next;
k[3]= k[2]->next;
- if(k[3]==NULL) k[3]=k1;
- while(k1) {
- if(k1->next==NULL) k[0]=k1;
+ if (k[3]==NULL) k[3]=k1;
+ while (k1) {
+ if (k1->next==NULL) k[0]=k1;
k1=k1->next;
}
/* k1= k[1]; */ /* UNUSED */
@@ -429,29 +429,29 @@ static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl)
t[3]= k[3]->pos + dpos;
fac+= dpos;
ofs= dpos;
- if(k[3]==k[1]) {
+ if (k[3]==k[1]) {
t[3]+= dpos;
ofs= 2.0f*dpos;
}
- if(fac<t[1]) fac+= dpos;
+ if (fac<t[1]) fac+= dpos;
k1= k[3];
}
else { /* pre-sort */
k[2]= k1->next;
t[2]= k[2]->pos;
k[3]= k[2]->next;
- if(k[3]==NULL) k[3]= k[2];
+ if (k[3]==NULL) k[3]= k[2];
t[3]= k[3]->pos;
k1= k[3];
}
- while( t[2]<fac ) { /* find correct location */
- if(k1->next==NULL) {
- if(cycl) {
+ while ( t[2]<fac ) { /* find correct location */
+ if (k1->next==NULL) {
+ if (cycl) {
k1= firstkey;
ofs+= dpos;
}
- else if(t[2]==t[3]) break;
+ else if (t[2]==t[3]) break;
}
else k1= k1->next;
@@ -464,25 +464,25 @@ static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl)
t[3]= k1->pos+ofs;
k[3]= k1;
- if(ofs > 2.1f + lastpos) break;
+ if (ofs > 2.1f + lastpos) break;
}
bsplinetype= 0;
- if(k[1]->type==KEY_BSPLINE || k[2]->type==KEY_BSPLINE) bsplinetype= 1;
+ if (k[1]->type==KEY_BSPLINE || k[2]->type==KEY_BSPLINE) bsplinetype= 1;
- if(cycl==0) {
- if(bsplinetype==0) { /* B spline doesn't go through the control points */
- if(fac<=t[1]) { /* fac for 1st key */
+ if (cycl==0) {
+ if (bsplinetype==0) { /* B spline doesn't go through the control points */
+ if (fac<=t[1]) { /* fac for 1st key */
t[2]= t[1];
k[2]= k[1];
return 1;
}
- if(fac>=t[2] ) { /* fac after 2nd key */
+ if (fac>=t[2] ) { /* fac after 2nd key */
return 1;
}
}
- else if(fac>t[2]) { /* last key */
+ else if (fac>t[2]) { /* last key */
fac= t[2];
k[3]= k[2];
t[3]= t[2];
@@ -490,8 +490,8 @@ static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl)
}
d= t[2]-t[1];
- if(d == 0.0f) {
- if(bsplinetype==0) {
+ if (d == 0.0f) {
+ if (bsplinetype==0) {
return 1; /* both keys equal */
}
}
@@ -501,7 +501,7 @@ static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl)
key_curve_position_weights(d, t, k[1]->type);
- if(k[1]->type != k[2]->type) {
+ if (k[1]->type != k[2]->type) {
key_curve_position_weights(d, fval, k[2]->type);
temp= 1.0f-d;
@@ -519,7 +519,7 @@ static void flerp(int tot, float *in, float *f0, float *f1, float *f2, float *f3
{
int a;
- for(a=0; a<tot; a++) {
+ for (a=0; a<tot; a++) {
in[a]= t[0]*f0[a]+t[1]*f1[a]+t[2]*f2[a]+t[3]*f3[a];
}
}
@@ -528,17 +528,17 @@ static void rel_flerp(int tot, float *in, float *ref, float *out, float fac)
{
int a;
- for(a=0; a<tot; a++) {
+ for (a=0; a<tot; a++) {
in[a]-= fac*(ref[a]-out[a]);
}
}
static char *key_block_get_data(Key *key, KeyBlock *actkb, KeyBlock *kb, char **freedata)
{
- if(kb == actkb) {
+ if (kb == actkb) {
/* this hack makes it possible to edit shape keys in
- edit mode with shape keys blending applied */
- if(GS(key->from->name) == ID_ME) {
+ * edit mode with shape keys blending applied */
+ if (GS(key->from->name) == ID_ME) {
Mesh *me;
BMVert *eve;
BMIter iter;
@@ -547,7 +547,7 @@ static char *key_block_get_data(Key *key, KeyBlock *actkb, KeyBlock *kb, char **
me= (Mesh*)key->from;
- if(me->edit_btmesh && me->edit_btmesh->bm->totvert == kb->totelem) {
+ if (me->edit_btmesh && me->edit_btmesh->bm->totvert == kb->totelem) {
a= 0;
co= MEM_callocN(sizeof(float)*3*me->edit_btmesh->bm->totvert, "key_block_get_data");
@@ -570,7 +570,7 @@ static char *key_block_get_data(Key *key, KeyBlock *actkb, KeyBlock *kb, char **
/* currently only the first value of 'ofs' may be set. */
static short key_pointer_size(const Key *key, const int mode, int *poinsize, int *ofs)
{
- if(key->from==NULL) {
+ if (key->from==NULL) {
return FALSE;
}
@@ -584,10 +584,11 @@ static short key_pointer_size(const Key *key, const int mode, int *poinsize, int
*poinsize= *ofs;
break;
case ID_CU:
- if(mode == KEY_MODE_BPOINT) {
+ if (mode == KEY_MODE_BPOINT) {
*ofs= sizeof(float)*4;
*poinsize= *ofs;
- } else {
+ }
+ else {
ofs[0]= sizeof(float)*12;
*poinsize= (*ofs) / 3;
}
@@ -611,15 +612,15 @@ static void cp_key(const int start, int end, const int tot, char *poin, Key *key
/* currently always 0, in future key_pointer_size may assign */
ofs[1]= 0;
- if(!key_pointer_size(key, mode, &poinsize, &ofs[0]))
+ if (!key_pointer_size(key, mode, &poinsize, &ofs[0]))
return;
- if(end>tot) end= tot;
+ if (end>tot) end= tot;
- if(tot != kb->totelem) {
+ if (tot != kb->totelem) {
ktot= 0.0;
flagflo= 1;
- if(kb->totelem) {
+ if (kb->totelem) {
kd= kb->totelem/(float)tot;
}
else return;
@@ -629,14 +630,14 @@ static void cp_key(const int start, int end, const int tot, char *poin, Key *key
kref= key_block_get_data(key, actkb, key->refkey, &freekref);
/* this exception is needed for slurphing */
- if(start!=0) {
+ if (start!=0) {
poin+= poinsize*start;
- if(flagflo) {
+ if (flagflo) {
ktot+= start*kd;
a= (int)floor(ktot);
- if(a) {
+ if (a) {
ktot-= a;
k1+= a*key->elemsize;
}
@@ -644,7 +645,7 @@ static void cp_key(const int start, int end, const int tot, char *poin, Key *key
else k1+= start*key->elemsize;
}
- if(mode == KEY_MODE_BEZTRIPLE) {
+ if (mode == KEY_MODE_BEZTRIPLE) {
elemstr[0]= 1;
elemstr[1]= IPO_BEZTRIPLE;
elemstr[2]= 0;
@@ -652,21 +653,21 @@ static void cp_key(const int start, int end, const int tot, char *poin, Key *key
/* just do it here, not above! */
elemsize= key->elemsize;
- if(mode == KEY_MODE_BEZTRIPLE) elemsize*= 3;
+ if (mode == KEY_MODE_BEZTRIPLE) elemsize*= 3;
- for(a=start; a<end; a++) {
+ for (a=start; a<end; a++) {
cp= key->elemstr;
- if(mode == KEY_MODE_BEZTRIPLE) cp= elemstr;
+ if (mode == KEY_MODE_BEZTRIPLE) cp= elemstr;
ofsp= ofs;
- while( cp[0] ) {
+ while ( cp[0] ) {
switch(cp[1]) {
case IPO_FLOAT:
- if(weights) {
+ if (weights) {
memcpy(poin, kref, sizeof(float)*3);
- if(*weights!=0.0f)
+ if (*weights!=0.0f)
rel_flerp(cp[0], (float *)poin, (float *)kref, (float *)k1, *weights);
weights++;
}
@@ -681,8 +682,8 @@ static void cp_key(const int start, int end, const int tot, char *poin, Key *key
break;
default:
/* should never happen */
- if(freek1) MEM_freeN(freek1);
- if(freekref) MEM_freeN(freekref);
+ if (freek1) MEM_freeN(freek1);
+ if (freekref) MEM_freeN(freekref);
BLI_assert(!"invalid 'cp[1]'");
return;
}
@@ -692,9 +693,9 @@ static void cp_key(const int start, int end, const int tot, char *poin, Key *key
}
/* are we going to be nasty? */
- if(flagflo) {
+ if (flagflo) {
ktot+= kd;
- while(ktot >= 1.0f) {
+ while (ktot >= 1.0f) {
ktot -= 1.0f;
k1+= elemsize;
kref+= elemsize;
@@ -705,11 +706,11 @@ static void cp_key(const int start, int end, const int tot, char *poin, Key *key
kref+= elemsize;
}
- if(mode == KEY_MODE_BEZTRIPLE) a+=2;
+ if (mode == KEY_MODE_BEZTRIPLE) a+=2;
}
- if(freek1) MEM_freeN(freek1);
- if(freekref) MEM_freeN(freekref);
+ if (freek1) MEM_freeN(freek1);
+ if (freekref) MEM_freeN(freekref);
}
static void cp_cu_key(Curve *cu, Key *key, KeyBlock *actkb, KeyBlock *kb, const int start, int end, char *out, const int tot)
@@ -717,23 +718,23 @@ static void cp_cu_key(Curve *cu, Key *key, KeyBlock *actkb, KeyBlock *kb, const
Nurb *nu;
int a, step, a1, a2;
- for(a=0, nu=cu->nurb.first; nu; nu=nu->next, a+=step) {
- if(nu->bp) {
+ for (a=0, nu=cu->nurb.first; nu; nu=nu->next, a+=step) {
+ if (nu->bp) {
step= nu->pntsu*nu->pntsv;
a1= MAX2(a, start);
a2= MIN2(a+step, end);
- if(a1<a2) cp_key(a1, a2, tot, out, key, actkb, kb, NULL, KEY_MODE_BPOINT);
+ if (a1<a2) cp_key(a1, a2, tot, out, key, actkb, kb, NULL, KEY_MODE_BPOINT);
}
- else if(nu->bezt) {
+ else if (nu->bezt) {
step= 3*nu->pntsu;
/* exception because keys prefer to work with complete blocks */
a1= MAX2(a, start);
a2= MIN2(a+step, end);
- if(a1<a2) cp_key(a1, a2, tot, out, key, actkb, kb, NULL, KEY_MODE_BEZTRIPLE);
+ if (a1<a2) cp_key(a1, a2, tot, out, key, actkb, kb, NULL, KEY_MODE_BEZTRIPLE);
}
else
step= 0;
@@ -751,10 +752,10 @@ void do_rel_key(const int start, int end, const int tot, char *basispoin, Key *k
/* currently always 0, in future key_pointer_size may assign */
ofs[1]= 0;
- if(!key_pointer_size(key, mode, &poinsize, &ofs[0]))
+ if (!key_pointer_size(key, mode, &poinsize, &ofs[0]))
return;
- if(end>tot) end= tot;
+ if (end>tot) end= tot;
/* in case of beztriple */
elemstr[0]= 1; /* nr of ipofloats */
@@ -763,25 +764,25 @@ void do_rel_key(const int start, int end, const int tot, char *basispoin, Key *k
/* just here, not above! */
elemsize= key->elemsize;
- if(mode == KEY_MODE_BEZTRIPLE) elemsize*= 3;
+ if (mode == KEY_MODE_BEZTRIPLE) elemsize*= 3;
/* step 1 init */
cp_key(start, end, tot, basispoin, key, actkb, key->refkey, NULL, mode);
/* step 2: do it */
- for(kb=key->block.first; kb; kb=kb->next) {
- if(kb!=key->refkey) {
+ for (kb=key->block.first; kb; kb=kb->next) {
+ if (kb!=key->refkey) {
float icuval= kb->curval;
/* only with value, and no difference allowed */
- if(!(kb->flag & KEYBLOCK_MUTE) && icuval!=0.0f && kb->totelem==tot) {
+ if (!(kb->flag & KEYBLOCK_MUTE) && icuval!=0.0f && kb->totelem==tot) {
KeyBlock *refb;
float weight, *weights= kb->weights;
/* reference now can be any block */
refb= BLI_findlink(&key->block, kb->relative);
- if(refb==NULL) continue;
+ if (refb==NULL) continue;
poin= basispoin;
from= key_block_get_data(key, actkb, kb, &freefrom);
@@ -791,19 +792,19 @@ void do_rel_key(const int start, int end, const int tot, char *basispoin, Key *k
reffrom+= key->elemsize*start; // key elemsize yes!
from+= key->elemsize*start;
- for(b=start; b<end; b++) {
+ for (b=start; b<end; b++) {
- if(weights)
+ if (weights)
weight= *weights * icuval;
else
weight= icuval;
cp= key->elemstr;
- if(mode == KEY_MODE_BEZTRIPLE) cp= elemstr;
+ if (mode == KEY_MODE_BEZTRIPLE) cp= elemstr;
ofsp= ofs;
- while( cp[0] ) { /* cp[0]==amount */
+ while ( cp[0] ) { /* cp[0]==amount */
switch(cp[1]) {
case IPO_FLOAT:
@@ -817,8 +818,8 @@ void do_rel_key(const int start, int end, const int tot, char *basispoin, Key *k
break;
default:
/* should never happen */
- if(freefrom) MEM_freeN(freefrom);
- if(freereffrom) MEM_freeN(freereffrom);
+ if (freefrom) MEM_freeN(freefrom);
+ if (freereffrom) MEM_freeN(freereffrom);
BLI_assert(!"invalid 'cp[1]'");
return;
}
@@ -832,12 +833,12 @@ void do_rel_key(const int start, int end, const int tot, char *basispoin, Key *k
reffrom+= elemsize;
from+= elemsize;
- if(mode == KEY_MODE_BEZTRIPLE) b+= 2;
- if(weights) weights++;
+ if (mode == KEY_MODE_BEZTRIPLE) b+= 2;
+ if (weights) weights++;
}
- if(freefrom) MEM_freeN(freefrom);
- if(freereffrom) MEM_freeN(freereffrom);
+ if (freefrom) MEM_freeN(freefrom);
+ if (freereffrom) MEM_freeN(freereffrom);
}
}
}
@@ -856,10 +857,10 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
/* currently always 0, in future key_pointer_size may assign */
ofs[1]= 0;
- if(!key_pointer_size(key, mode, &poinsize, &ofs[0]))
+ if (!key_pointer_size(key, mode, &poinsize, &ofs[0]))
return;
- if(end>tot) end= tot;
+ if (end>tot) end= tot;
k1= key_block_get_data(key, actkb, k[0], &freek1);
k2= key_block_get_data(key, actkb, k[1], &freek2);
@@ -867,82 +868,82 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
k4= key_block_get_data(key, actkb, k[3], &freek4);
/* test for more or less points (per key!) */
- if(tot != k[0]->totelem) {
+ if (tot != k[0]->totelem) {
k1tot= 0.0;
flagflo |= 1;
- if(k[0]->totelem) {
+ if (k[0]->totelem) {
k1d= k[0]->totelem/(float)tot;
}
else flagdo -= 1;
}
- if(tot != k[1]->totelem) {
+ if (tot != k[1]->totelem) {
k2tot= 0.0;
flagflo |= 2;
- if(k[0]->totelem) {
+ if (k[0]->totelem) {
k2d= k[1]->totelem/(float)tot;
}
else flagdo -= 2;
}
- if(tot != k[2]->totelem) {
+ if (tot != k[2]->totelem) {
k3tot= 0.0;
flagflo |= 4;
- if(k[0]->totelem) {
+ if (k[0]->totelem) {
k3d= k[2]->totelem/(float)tot;
}
else flagdo -= 4;
}
- if(tot != k[3]->totelem) {
+ if (tot != k[3]->totelem) {
k4tot= 0.0;
flagflo |= 8;
- if(k[0]->totelem) {
+ if (k[0]->totelem) {
k4d= k[3]->totelem/(float)tot;
}
else flagdo -= 8;
}
/* this exception needed for slurphing */
- if(start!=0) {
+ if (start!=0) {
poin+= poinsize*start;
- if(flagdo & 1) {
- if(flagflo & 1) {
+ if (flagdo & 1) {
+ if (flagflo & 1) {
k1tot+= start*k1d;
a= (int)floor(k1tot);
- if(a) {
+ if (a) {
k1tot-= a;
k1+= a*key->elemsize;
}
}
else k1+= start*key->elemsize;
}
- if(flagdo & 2) {
- if(flagflo & 2) {
+ if (flagdo & 2) {
+ if (flagflo & 2) {
k2tot+= start*k2d;
a= (int)floor(k2tot);
- if(a) {
+ if (a) {
k2tot-= a;
k2+= a*key->elemsize;
}
}
else k2+= start*key->elemsize;
}
- if(flagdo & 4) {
- if(flagflo & 4) {
+ if (flagdo & 4) {
+ if (flagflo & 4) {
k3tot+= start*k3d;
a= (int)floor(k3tot);
- if(a) {
+ if (a) {
k3tot-= a;
k3+= a*key->elemsize;
}
}
else k3+= start*key->elemsize;
}
- if(flagdo & 8) {
- if(flagflo & 8) {
+ if (flagdo & 8) {
+ if (flagflo & 8) {
k4tot+= start*k4d;
a= (int)floor(k4tot);
- if(a) {
+ if (a) {
k4tot-= a;
k4+= a*key->elemsize;
}
@@ -959,16 +960,16 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
/* only here, not above! */
elemsize= key->elemsize;
- if(mode == KEY_MODE_BEZTRIPLE) elemsize*= 3;
+ if (mode == KEY_MODE_BEZTRIPLE) elemsize*= 3;
- for(a=start; a<end; a++) {
+ for (a=start; a<end; a++) {
cp= key->elemstr;
- if(mode == KEY_MODE_BEZTRIPLE) cp= elemstr;
+ if (mode == KEY_MODE_BEZTRIPLE) cp= elemstr;
ofsp= ofs;
- while( cp[0] ) { /* cp[0]==amount */
+ while ( cp[0] ) { /* cp[0]==amount */
switch(cp[1]) {
case IPO_FLOAT:
@@ -982,10 +983,10 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
break;
default:
/* should never happen */
- if(freek1) MEM_freeN(freek1);
- if(freek2) MEM_freeN(freek2);
- if(freek3) MEM_freeN(freek3);
- if(freek4) MEM_freeN(freek4);
+ if (freek1) MEM_freeN(freek1);
+ if (freek2) MEM_freeN(freek2);
+ if (freek3) MEM_freeN(freek3);
+ if (freek4) MEM_freeN(freek4);
BLI_assert(!"invalid 'cp[1]'");
return;
}
@@ -995,40 +996,40 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
ofsp++;
}
/* lets do it the difficult way: when keys have a different size */
- if(flagdo & 1) {
- if(flagflo & 1) {
+ if (flagdo & 1) {
+ if (flagflo & 1) {
k1tot+= k1d;
- while(k1tot >= 1.0f) {
+ while (k1tot >= 1.0f) {
k1tot -= 1.0f;
k1+= elemsize;
}
}
else k1+= elemsize;
}
- if(flagdo & 2) {
- if(flagflo & 2) {
+ if (flagdo & 2) {
+ if (flagflo & 2) {
k2tot+= k2d;
- while(k2tot >= 1.0f) {
+ while (k2tot >= 1.0f) {
k2tot -= 1.0f;
k2+= elemsize;
}
}
else k2+= elemsize;
}
- if(flagdo & 4) {
- if(flagflo & 4) {
+ if (flagdo & 4) {
+ if (flagflo & 4) {
k3tot+= k3d;
- while(k3tot >= 1.0f) {
+ while (k3tot >= 1.0f) {
k3tot -= 1.0f;
k3+= elemsize;
}
}
else k3+= elemsize;
}
- if(flagdo & 8) {
- if(flagflo & 8) {
+ if (flagdo & 8) {
+ if (flagflo & 8) {
k4tot+= k4d;
- while(k4tot >= 1.0f) {
+ while (k4tot >= 1.0f) {
k4tot -= 1.0f;
k4+= elemsize;
}
@@ -1036,13 +1037,13 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
else k4+= elemsize;
}
- if(mode == KEY_MODE_BEZTRIPLE) a+= 2;
+ if (mode == KEY_MODE_BEZTRIPLE) a+= 2;
}
- if(freek1) MEM_freeN(freek1);
- if(freek2) MEM_freeN(freek2);
- if(freek3) MEM_freeN(freek3);
- if(freek4) MEM_freeN(freek4);
+ if (freek1) MEM_freeN(freek1);
+ if (freek2) MEM_freeN(freek2);
+ if (freek3) MEM_freeN(freek3);
+ if (freek4) MEM_freeN(freek4);
}
static float *get_weights_array(Object *ob, char *vgroup)
@@ -1054,45 +1055,45 @@ static float *get_weights_array(Object *ob, char *vgroup)
int totvert= 0, defgrp_index= 0;
/* no vgroup string set? */
- if(vgroup[0]==0) return NULL;
+ if (vgroup[0]==0) return NULL;
/* gather dvert and totvert */
- if(ob->type==OB_MESH) {
+ if (ob->type==OB_MESH) {
Mesh *me= ob->data;
dvert= me->dvert;
totvert= me->totvert;
- if(me->edit_btmesh && me->edit_btmesh->bm->totvert == totvert)
+ if (me->edit_btmesh && me->edit_btmesh->bm->totvert == totvert)
em= me->edit_btmesh;
}
- else if(ob->type==OB_LATTICE) {
+ else if (ob->type==OB_LATTICE) {
Lattice *lt= ob->data;
dvert= lt->dvert;
totvert= lt->pntsu*lt->pntsv*lt->pntsw;
}
- if(dvert==NULL) return NULL;
+ if (dvert==NULL) return NULL;
/* find the group (weak loop-in-loop) */
defgrp_index= defgroup_name_index(ob, vgroup);
- if(defgrp_index >= 0) {
+ if (defgrp_index >= 0) {
float *weights;
int i;
weights= MEM_callocN(totvert*sizeof(float), "weights");
- if(em) {
+ if (em) {
eve = BM_iter_new(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
for (i=0; eve; eve=BM_iter_step(&iter), i++) {
dvert= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
- if(dvert) {
+ if (dvert) {
weights[i]= defvert_find_weight(dvert, defgrp_index);
}
}
}
else {
- for(i=0; i < totvert; i++, dvert++) {
+ for (i=0; i < totvert; i++, dvert++) {
weights[i]= defvert_find_weight(dvert, defgrp_index);
}
}
@@ -1108,12 +1109,12 @@ static void do_mesh_key(Scene *scene, Object *ob, Key *key, char *out, const int
float cfra, ctime, t[4], delta;
int a, flag = 0, step;
- if(key->slurph && key->type!=KEY_RELATIVE ) {
+ if (key->slurph && key->type!=KEY_RELATIVE ) {
delta= key->slurph;
delta/= tot;
step= 1;
- if(tot>100 && slurph_opt) {
+ if (tot>100 && slurph_opt) {
step= tot/50;
delta*= step;
/* in do_key and cp_key the case a>tot is handled */
@@ -1121,11 +1122,11 @@ static void do_mesh_key(Scene *scene, Object *ob, Key *key, char *out, const int
cfra= (float)scene->r.cfra;
- for(a=0; a<tot; a+=step, cfra+= delta) {
+ for (a=0; a<tot; a+=step, cfra+= delta) {
ctime= BKE_curframe(scene);
#if 0 // XXX old animation system
- if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
+ if (calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
ctime /= 100.0;
CLAMP(ctime, 0.0, 1.0);
}
@@ -1136,23 +1137,23 @@ static void do_mesh_key(Scene *scene, Object *ob, Key *key, char *out, const int
flag= setkeys(ctime, &key->block, k, t, 0);
- if(flag==0)
+ if (flag==0)
do_key(a, a+step, tot, (char *)out, key, actkb, k, t, KEY_MODE_DUMMY);
else
cp_key(a, a+step, tot, (char *)out, key, actkb, k[2], NULL, KEY_MODE_DUMMY);
}
}
else {
- if(key->type==KEY_RELATIVE) {
+ if (key->type==KEY_RELATIVE) {
KeyBlock *kb;
- for(kb= key->block.first; kb; kb= kb->next)
+ for (kb= key->block.first; kb; kb= kb->next)
kb->weights= get_weights_array(ob, kb->vgroup);
do_rel_key(0, tot, tot, (char *)out, key, actkb, KEY_MODE_DUMMY);
- for(kb= key->block.first; kb; kb= kb->next) {
- if(kb->weights) MEM_freeN(kb->weights);
+ for (kb= key->block.first; kb; kb= kb->next) {
+ if (kb->weights) MEM_freeN(kb->weights);
kb->weights= NULL;
}
}
@@ -1160,7 +1161,7 @@ static void do_mesh_key(Scene *scene, Object *ob, Key *key, char *out, const int
ctime= BKE_curframe(scene);
#if 0 // XXX old animation system
- if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
+ if (calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
ctime /= 100.0;
CLAMP(ctime, 0.0, 1.0);
}
@@ -1171,7 +1172,7 @@ static void do_mesh_key(Scene *scene, Object *ob, Key *key, char *out, const int
flag= setkeys(ctime, &key->block, k, t, 0);
- if(flag==0)
+ if (flag==0)
do_key(0, tot, tot, (char *)out, key, actkb, k, t, KEY_MODE_DUMMY);
else
cp_key(0, tot, tot, (char *)out, key, actkb, k[2], NULL, KEY_MODE_DUMMY);
@@ -1184,12 +1185,12 @@ static void do_cu_key(Curve *cu, Key *key, KeyBlock *actkb, KeyBlock **k, float
Nurb *nu;
int a, step;
- for(a=0, nu=cu->nurb.first; nu; nu=nu->next, a+=step) {
- if(nu->bp) {
+ for (a=0, nu=cu->nurb.first; nu; nu=nu->next, a+=step) {
+ if (nu->bp) {
step= nu->pntsu*nu->pntsv;
do_key(a, a+step, tot, out, key, actkb, k, t, KEY_MODE_BPOINT);
}
- else if(nu->bezt) {
+ else if (nu->bezt) {
step= 3*nu->pntsu;
do_key(a, a+step, tot, out, key, actkb, k, t, KEY_MODE_BEZTRIPLE);
}
@@ -1203,12 +1204,12 @@ static void do_rel_cu_key(Curve *cu, Key *key, KeyBlock *actkb, float UNUSED(cti
Nurb *nu;
int a, step;
- for(a=0, nu=cu->nurb.first; nu; nu=nu->next, a+=step) {
- if(nu->bp) {
+ for (a=0, nu=cu->nurb.first; nu; nu=nu->next, a+=step) {
+ if (nu->bp) {
step= nu->pntsu*nu->pntsv;
do_rel_key(a, a+step, tot, out, key, actkb, KEY_MODE_BPOINT);
}
- else if(nu->bezt) {
+ else if (nu->bezt) {
step= 3*nu->pntsu;
do_rel_key(a, a+step, tot, out, key, actkb, KEY_MODE_BEZTRIPLE);
}
@@ -1224,14 +1225,14 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const in
float cfra, ctime, t[4], delta;
int a, flag = 0, step = 0;
- if(key->slurph && key->type!=KEY_RELATIVE) {
+ if (key->slurph && key->type!=KEY_RELATIVE) {
Nurb *nu;
int mode=0, i= 0, remain= 0, estep=0, count=0;
delta= (float)key->slurph / tot;
step= 1;
- if(tot>100 && slurph_opt) {
+ if (tot>100 && slurph_opt) {
step= tot/50;
delta*= step;
/* in do_key and cp_key the case a>tot has been handled */
@@ -1239,12 +1240,12 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const in
cfra= (float)scene->r.cfra;
- for(nu=cu->nurb.first; nu; nu=nu->next) {
- if(nu->bp) {
+ for (nu=cu->nurb.first; nu; nu=nu->next) {
+ if (nu->bp) {
mode= KEY_MODE_BPOINT;
estep= nu->pntsu*nu->pntsv;
}
- else if(nu->bezt) {
+ else if (nu->bezt) {
mode= KEY_MODE_BEZTRIPLE;
estep= 3*nu->pntsu;
}
@@ -1269,7 +1270,7 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const in
count += 3 - count % 3;
}
- if(flag==0)
+ if (flag==0)
do_key(i, i+count, tot, (char *)out, key, actkb, k, t, mode);
else
cp_key(i, i+count, tot, (char *)out, key, actkb, k[2], NULL, mode);
@@ -1284,12 +1285,12 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const in
ctime= BKE_curframe(scene);
- if(key->type==KEY_RELATIVE) {
+ if (key->type==KEY_RELATIVE) {
do_rel_cu_key(cu, cu->key, actkb, ctime, out, tot);
}
else {
#if 0 // XXX old animation system
- if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
+ if (calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
ctime /= 100.0;
CLAMP(ctime, 0.0, 1.0);
}
@@ -1297,7 +1298,7 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const in
flag= setkeys(ctime, &key->block, k, t, 0);
- if(flag==0) do_cu_key(cu, key, actkb, k, t, out, tot);
+ if (flag==0) do_cu_key(cu, key, actkb, k, t, out, tot);
else cp_cu_key(cu, key, actkb, k[2], 0, tot, out, tot);
}
}
@@ -1310,17 +1311,17 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int
float delta, cfra, ctime, t[4];
int a, flag;
- if(key->slurph) {
+ if (key->slurph) {
delta= key->slurph;
delta/= (float)tot;
cfra= (float)scene->r.cfra;
- for(a=0; a<tot; a++, cfra+= delta) {
+ for (a=0; a<tot; a++, cfra+= delta) {
ctime= BKE_curframe(scene);
#if 0 // XXX old animation system
- if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
+ if (calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
ctime /= 100.0;
CLAMP(ctime, 0.0, 1.0);
}
@@ -1328,23 +1329,23 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int
flag= setkeys(ctime, &key->block, k, t, 0);
- if(flag==0)
+ if (flag==0)
do_key(a, a+1, tot, out, key, actkb, k, t, KEY_MODE_DUMMY);
else
cp_key(a, a+1, tot, out, key, actkb, k[2], NULL, KEY_MODE_DUMMY);
}
}
else {
- if(key->type==KEY_RELATIVE) {
+ if (key->type==KEY_RELATIVE) {
KeyBlock *kb;
- for(kb= key->block.first; kb; kb= kb->next)
+ for (kb= key->block.first; kb; kb= kb->next)
kb->weights= get_weights_array(ob, kb->vgroup);
do_rel_key(0, tot, tot, out, key, actkb, KEY_MODE_DUMMY);
- for(kb= key->block.first; kb; kb= kb->next) {
- if(kb->weights) MEM_freeN(kb->weights);
+ for (kb= key->block.first; kb; kb= kb->next) {
+ if (kb->weights) MEM_freeN(kb->weights);
kb->weights= NULL;
}
}
@@ -1352,7 +1353,7 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int
ctime= BKE_curframe(scene);
#if 0 // XXX old animation system
- if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
+ if (calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
ctime /= 100.0;
CLAMP(ctime, 0.0, 1.0);
}
@@ -1360,14 +1361,14 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int
flag= setkeys(ctime, &key->block, k, t, 0);
- if(flag==0)
+ if (flag==0)
do_key(0, tot, tot, (char *)out, key, actkb, k, t, KEY_MODE_DUMMY);
else
cp_key(0, tot, tot, (char *)out, key, actkb, k[2], NULL, KEY_MODE_DUMMY);
}
}
- if(lt->flag & LT_OUTSIDE) outside_lattice(lt);
+ if (lt->flag & LT_OUTSIDE) outside_lattice(lt);
}
/* returns key coordinates (+ tilt) when key applied, NULL otherwise */
@@ -1378,32 +1379,32 @@ float *do_ob_key(Scene *scene, Object *ob)
char *out;
int tot= 0, size= 0;
- if(key==NULL || key->block.first==NULL)
+ if (key==NULL || key->block.first==NULL)
return NULL;
/* compute size of output array */
- if(ob->type == OB_MESH) {
+ if (ob->type == OB_MESH) {
Mesh *me= ob->data;
tot= me->totvert;
size= tot*3*sizeof(float);
}
- else if(ob->type == OB_LATTICE) {
+ else if (ob->type == OB_LATTICE) {
Lattice *lt= ob->data;
tot= lt->pntsu*lt->pntsv*lt->pntsw;
size= tot*3*sizeof(float);
}
- else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu= ob->data;
Nurb *nu;
- for(nu=cu->nurb.first; nu; nu=nu->next) {
- if(nu->bezt) {
+ for (nu=cu->nurb.first; nu; nu=nu->next) {
+ if (nu->bezt) {
tot += 3*nu->pntsu;
size += nu->pntsu*12*sizeof(float);
}
- else if(nu->bp) {
+ else if (nu->bp) {
tot += nu->pntsu*nu->pntsv;
size += nu->pntsu*nu->pntsv*12*sizeof(float);
}
@@ -1411,7 +1412,7 @@ float *do_ob_key(Scene *scene, Object *ob)
}
/* if nothing to interpolate, cancel */
- if(tot == 0 || size == 0)
+ if (tot == 0 || size == 0)
return NULL;
/* allocate array */
@@ -1420,14 +1421,14 @@ float *do_ob_key(Scene *scene, Object *ob)
/* prevent python from screwing this up? anyhoo, the from pointer could be dropped */
key->from= (ID *)ob->data;
- if(ob->shapeflag & OB_SHAPE_LOCK) {
+ if (ob->shapeflag & OB_SHAPE_LOCK) {
/* shape locked, copy the locked shape instead of blending */
KeyBlock *kb= BLI_findlink(&key->block, ob->shapenr-1);
- if(kb && (kb->flag & KEYBLOCK_MUTE))
+ if (kb && (kb->flag & KEYBLOCK_MUTE))
kb= key->refkey;
- if(kb==NULL) {
+ if (kb==NULL) {
kb= key->block.first;
ob->shapenr= 1;
}
@@ -1437,9 +1438,9 @@ float *do_ob_key(Scene *scene, Object *ob)
cp_key(0, tot, tot, out, key, actkb, kb, weights, 0);
- if(weights) MEM_freeN(weights);
+ if (weights) MEM_freeN(weights);
}
- else if(ELEM(ob->type, OB_CURVE, OB_SURF))
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF))
cp_cu_key(ob->data, key, actkb, kb, 0, tot, out, tot);
}
else {
@@ -1448,10 +1449,10 @@ float *do_ob_key(Scene *scene, Object *ob)
BKE_animsys_evaluate_animdata(scene, &key->id, key->adt, ctime, ADT_RECALC_DRIVERS);
- if(ob->type==OB_MESH) do_mesh_key(scene, ob, key, out, tot);
- else if(ob->type==OB_LATTICE) do_latt_key(scene, ob, key, out, tot);
- else if(ob->type==OB_CURVE) do_curve_key(scene, ob, key, out, tot);
- else if(ob->type==OB_SURF) do_curve_key(scene, ob, key, out, tot);
+ if (ob->type==OB_MESH) do_mesh_key(scene, ob, key, out, tot);
+ else if (ob->type==OB_LATTICE) do_latt_key(scene, ob, key, out, tot);
+ else if (ob->type==OB_CURVE) do_curve_key(scene, ob, key, out, tot);
+ else if (ob->type==OB_SURF) do_curve_key(scene, ob, key, out, tot);
}
return (float*)out;
@@ -1459,17 +1460,17 @@ float *do_ob_key(Scene *scene, Object *ob)
Key *ob_get_key(Object *ob)
{
- if(ob==NULL) return NULL;
+ if (ob==NULL) return NULL;
- if(ob->type==OB_MESH) {
+ if (ob->type==OB_MESH) {
Mesh *me= ob->data;
return me->key;
}
- else if ELEM(ob->type, OB_CURVE, OB_SURF) {
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu= ob->data;
return cu->key;
}
- else if(ob->type==OB_LATTICE) {
+ else if (ob->type==OB_LATTICE) {
Lattice *lt= ob->data;
return lt->key;
}
@@ -1483,17 +1484,18 @@ KeyBlock *add_keyblock(Key *key, const char *name)
int tot;
kb= key->block.last;
- if(kb) curpos= kb->pos;
+ if (kb) curpos= kb->pos;
kb= MEM_callocN(sizeof(KeyBlock), "Keyblock");
BLI_addtail(&key->block, kb);
kb->type= KEY_CARDINAL;
tot= BLI_countlist(&key->block);
- if(name) {
+ if (name) {
BLI_strncpy(kb->name, name, sizeof(kb->name));
- } else {
- if(tot==1) BLI_strncpy(kb->name, "Basis", sizeof(kb->name));
+ }
+ else {
+ if (tot==1) BLI_strncpy(kb->name, "Basis", sizeof(kb->name));
else BLI_snprintf(kb->name, sizeof(kb->name), "Key %d", tot-1);
}
@@ -1504,18 +1506,18 @@ KeyBlock *add_keyblock(Key *key, const char *name)
kb->uid = key->uidgen++;
key->totkey++;
- if(key->totkey==1) key->refkey= kb;
+ if (key->totkey==1) key->refkey= kb;
kb->slidermin= 0.0f;
kb->slidermax= 1.0f;
// XXX kb->pos is the confusing old horizontal-line RVK crap in old IPO Editor...
- if(key->type == KEY_RELATIVE)
+ if (key->type == KEY_RELATIVE)
kb->pos= curpos + 0.1f;
else {
#if 0 // XXX old animation system
curpos= BKE_curframe(scene);
- if(calc_ipo_spec(key->ipo, KEY_SPEED, &curpos)==0) {
+ if (calc_ipo_spec(key->ipo, KEY_SPEED, &curpos)==0) {
curpos /= 100.0;
}
kb->pos= curpos;
@@ -1579,7 +1581,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)
{
@@ -1587,7 +1589,7 @@ char *key_get_curValue_rnaPath(Key *key, KeyBlock *kb)
PropertyRNA *prop;
/* sanity checks */
- if ELEM(NULL, key, kb)
+ if (ELEM(NULL, key, kb))
return NULL;
/* create the RNA pointer */
@@ -1610,16 +1612,16 @@ void latt_to_key(Lattice *lt, KeyBlock *kb)
int a, tot;
tot= lt->pntsu*lt->pntsv*lt->pntsw;
- if(tot==0) return;
+ if (tot==0) return;
- if(kb->data) MEM_freeN(kb->data);
+ if (kb->data) MEM_freeN(kb->data);
kb->data= MEM_callocN(lt->key->elemsize*tot, "kb->data");
kb->totelem= tot;
bp= lt->def;
fp= kb->data;
- for(a=0; a<kb->totelem; a++, fp+=3, bp++) {
+ for (a=0; a<kb->totelem; a++, fp+=3, bp++) {
copy_v3_v3(fp, bp->vec);
}
}
@@ -1636,7 +1638,7 @@ void key_to_latt(KeyBlock *kb, Lattice *lt)
tot= lt->pntsu*lt->pntsv*lt->pntsw;
tot= MIN2(kb->totelem, tot);
- for(a=0; a<tot; a++, fp+=3, bp++) {
+ for (a=0; a<tot; a++, fp+=3, bp++) {
copy_v3_v3(bp->vec, fp);
}
}
@@ -1652,21 +1654,21 @@ void curve_to_key(Curve *cu, KeyBlock *kb, ListBase *nurb)
/* count */
tot= count_curveverts(nurb);
- if(tot==0) return;
+ if (tot==0) return;
- if(kb->data) MEM_freeN(kb->data);
+ if (kb->data) MEM_freeN(kb->data);
kb->data= MEM_callocN(cu->key->elemsize*tot, "kb->data");
kb->totelem= tot;
nu= nurb->first;
fp= kb->data;
- while(nu) {
+ while (nu) {
- if(nu->bezt) {
+ if (nu->bezt) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
+ while (a--) {
copy_v3_v3(fp, bezt->vec[0]);
fp+= 3;
copy_v3_v3(fp, bezt->vec[1]);
@@ -1681,7 +1683,7 @@ void curve_to_key(Curve *cu, KeyBlock *kb, ListBase *nurb)
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
+ while (a--) {
copy_v3_v3(fp, bp->vec);
fp[3]= bp->alfa;
@@ -1708,12 +1710,12 @@ void key_to_curve(KeyBlock *kb, Curve *UNUSED(cu), ListBase *nurb)
tot= MIN2(kb->totelem, tot);
- while(nu && tot>0) {
+ while (nu && tot>0) {
- if(nu->bezt) {
+ if (nu->bezt) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a-- && tot>0) {
+ while (a-- && tot>0) {
copy_v3_v3(bezt->vec[0], fp);
fp+= 3;
copy_v3_v3(bezt->vec[1], fp);
@@ -1730,7 +1732,7 @@ void key_to_curve(KeyBlock *kb, Curve *UNUSED(cu), ListBase *nurb)
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a-- && tot>0) {
+ while (a-- && tot>0) {
copy_v3_v3(bp->vec, fp);
bp->alfa= fp[3];
@@ -1750,16 +1752,16 @@ void mesh_to_key(Mesh *me, KeyBlock *kb)
float *fp;
int a;
- if(me->totvert==0) return;
+ if (me->totvert==0) return;
- if(kb->data) MEM_freeN(kb->data);
+ if (kb->data) MEM_freeN(kb->data);
kb->data= MEM_callocN(me->key->elemsize*me->totvert, "kb->data");
kb->totelem= me->totvert;
mvert= me->mvert;
fp= kb->data;
- for(a=0; a<kb->totelem; a++, fp+=3, mvert++) {
+ for (a=0; a<kb->totelem; a++, fp+=3, mvert++) {
copy_v3_v3(fp, mvert->co);
}
@@ -1776,7 +1778,7 @@ void key_to_mesh(KeyBlock *kb, Mesh *me)
tot= MIN2(kb->totelem, me->totvert);
- for(a=0; a<tot; a++, fp+=3, mvert++) {
+ for (a=0; a<tot; a++, fp+=3, mvert++) {
copy_v3_v3(mvert->co, fp);
}
}
@@ -1789,13 +1791,15 @@ float (*key_to_vertcos(Object *ob, KeyBlock *kb))[3]
int tot= 0, a;
/* Count of vertex coords in array */
- if(ob->type == OB_MESH) {
+ if (ob->type == OB_MESH) {
Mesh *me= (Mesh*)ob->data;
tot= me->totvert;
- } else if(ob->type == OB_LATTICE) {
+ }
+ else if (ob->type == OB_LATTICE) {
Lattice *lt= (Lattice*)ob->data;
tot= lt->pntsu*lt->pntsv*lt->pntsw;
- } else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ }
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu= (Curve*)ob->data;
tot= count_curveverts(&cu->nurb);
}
@@ -1807,18 +1811,19 @@ float (*key_to_vertcos(Object *ob, KeyBlock *kb))[3]
/* Copy coords to array */
co= (float*)vertCos;
- if(ELEM(ob->type, OB_MESH, OB_LATTICE)) {
+ if (ELEM(ob->type, OB_MESH, OB_LATTICE)) {
for (a= 0; a<tot; a++, fp+=3, co+=3) {
copy_v3_v3(co, fp);
}
- } else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ }
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu= (Curve*)ob->data;
Nurb *nu= cu->nurb.first;
BezTriple *bezt;
BPoint *bp;
while (nu) {
- if(nu->bezt) {
+ if (nu->bezt) {
int i;
bezt= nu->bezt;
a= nu->pntsu;
@@ -1863,15 +1868,17 @@ void vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3])
if (kb->data) MEM_freeN(kb->data);
/* Count of vertex coords in array */
- if(ob->type == OB_MESH) {
+ if (ob->type == OB_MESH) {
Mesh *me= (Mesh*)ob->data;
tot= me->totvert;
elemsize= me->key->elemsize;
- } else if(ob->type == OB_LATTICE) {
+ }
+ else if (ob->type == OB_LATTICE) {
Lattice *lt= (Lattice*)ob->data;
tot= lt->pntsu*lt->pntsv*lt->pntsw;
elemsize= lt->key->elemsize;
- } else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ }
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu= (Curve*)ob->data;
elemsize= cu->key->elemsize;
tot= count_curveverts(&cu->nurb);
@@ -1886,18 +1893,19 @@ void vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3])
/* Copy coords to keyblock */
- if(ELEM(ob->type, OB_MESH, OB_LATTICE)) {
+ if (ELEM(ob->type, OB_MESH, OB_LATTICE)) {
for (a= 0; a<tot; a++, fp+=3, co+=3) {
copy_v3_v3(fp, co);
}
- } else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ }
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu= (Curve*)ob->data;
Nurb *nu= cu->nurb.first;
BezTriple *bezt;
BPoint *bp;
while (nu) {
- if(nu->bezt) {
+ if (nu->bezt) {
int i;
bezt= nu->bezt;
a= nu->pntsu;
@@ -1937,18 +1945,19 @@ void offset_to_key(Object *ob, KeyBlock *kb, float (*ofs)[3])
int a;
float *co= (float*)ofs, *fp= kb->data;
- if(ELEM(ob->type, OB_MESH, OB_LATTICE)) {
+ if (ELEM(ob->type, OB_MESH, OB_LATTICE)) {
for (a= 0; a<kb->totelem; a++, fp+=3, co+=3) {
add_v3_v3(fp, co);
}
- } else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ }
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu= (Curve*)ob->data;
Nurb *nu= cu->nurb.first;
BezTriple *bezt;
BPoint *bp;
while (nu) {
- if(nu->bezt) {
+ if (nu->bezt) {
int i;
bezt= nu->bezt;
a= nu->pntsu;
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c
index 6b4cdc70aea..e981d772df6 100644
--- a/source/blender/blenkernel/intern/lamp.c
+++ b/source/blender/blenkernel/intern/lamp.c
@@ -108,8 +108,8 @@ Lamp *copy_lamp(Lamp *la)
lan= copy_libblock(&la->id);
- for(a=0; a<MAX_MTEX; a++) {
- if(lan->mtex[a]) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (lan->mtex[a]) {
lan->mtex[a]= MEM_mallocN(sizeof(MTex), "copylamptex");
memcpy(lan->mtex[a], la->mtex[a], sizeof(MTex));
id_us_plus((ID *)lan->mtex[a]->tex);
@@ -118,10 +118,10 @@ Lamp *copy_lamp(Lamp *la)
lan->curfalloff = curvemapping_copy(la->curfalloff);
- if(la->nodetree)
+ if (la->nodetree)
lan->nodetree= ntreeCopyTree(la->nodetree);
- if(la->preview)
+ if (la->preview)
lan->preview = BKE_previewimg_copy(la->preview);
return lan;
@@ -135,8 +135,8 @@ Lamp *localize_lamp(Lamp *la)
lan= copy_libblock(&la->id);
BLI_remlink(&G.main->lamp, lan);
- for(a=0; a<MAX_MTEX; a++) {
- if(lan->mtex[a]) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (lan->mtex[a]) {
lan->mtex[a]= MEM_mallocN(sizeof(MTex), "localize_lamp");
memcpy(lan->mtex[a], la->mtex[a], sizeof(MTex));
/* free lamp decrements */
@@ -146,7 +146,7 @@ Lamp *localize_lamp(Lamp *la)
lan->curfalloff = curvemapping_copy(la->curfalloff);
- if(la->nodetree)
+ if (la->nodetree)
lan->nodetree= ntreeLocalize(la->nodetree);
lan->preview= NULL;
@@ -161,29 +161,29 @@ 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) {
+ if (la->id.lib==NULL) return;
+ if (la->id.us==1) {
id_clear_lib_data(bmain, &la->id);
return;
}
ob= bmain->object.first;
- while(ob) {
- if(ob->data==la) {
- if(ob->id.lib) is_lib= TRUE;
+ while (ob) {
+ if (ob->data==la) {
+ if (ob->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
ob= ob->id.next;
}
- if(is_local && is_lib == FALSE) {
+ if (is_local && is_lib == FALSE) {
id_clear_lib_data(bmain, &la->id);
}
- else if(is_local && is_lib) {
+ else if (is_local && is_lib) {
Lamp *la_new= copy_lamp(la);
la_new->id.us= 0;
@@ -191,10 +191,10 @@ void make_local_lamp(Lamp *la)
BKE_id_lib_local_paths(bmain, la->id.lib, &la_new->id);
ob= bmain->object.first;
- while(ob) {
- if(ob->data==la) {
+ while (ob) {
+ if (ob->data==la) {
- if(ob->id.lib==NULL) {
+ if (ob->id.lib==NULL) {
ob->data= la_new;
la_new->id.us++;
la->id.us--;
@@ -210,10 +210,10 @@ void free_lamp(Lamp *la)
MTex *mtex;
int a;
- for(a=0; a<MAX_MTEX; a++) {
+ for (a=0; a<MAX_MTEX; a++) {
mtex= la->mtex[a];
- if(mtex && mtex->tex) mtex->tex->id.us--;
- if(mtex) MEM_freeN(mtex);
+ if (mtex && mtex->tex) mtex->tex->id.us--;
+ if (mtex) MEM_freeN(mtex);
}
BKE_free_animdata((ID *)la);
@@ -221,7 +221,7 @@ void free_lamp(Lamp *la)
curvemapping_free(la->curfalloff);
/* is no lib link block, but lamp extension */
- if(la->nodetree) {
+ if (la->nodetree) {
ntreeFreeTree(la->nodetree);
MEM_freeN(la->nodetree);
}
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 79922e47564..f182d7bcb7c 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -96,7 +96,7 @@ void resizelattice(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
lt->dvert= NULL;
}
- while(uNew*vNew*wNew > 32000) {
+ while (uNew*vNew*wNew > 32000) {
if ( uNew>=vNew && uNew>=wNew) uNew--;
else if ( vNew>=uNew && vNew>=wNew) vNew--;
else wNew--;
@@ -153,7 +153,7 @@ void resizelattice(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
copy_m4_m4(mat, ltOb->obmat);
unit_m4(ltOb->obmat);
- lattice_deform_verts(ltOb, NULL, NULL, vertexCos, uNew*vNew*wNew, NULL);
+ lattice_deform_verts(ltOb, NULL, NULL, vertexCos, uNew*vNew*wNew, NULL, 1.0f);
copy_m4_m4(ltOb->obmat, mat);
lt->typeu = typeu;
@@ -329,7 +329,8 @@ void init_latt_deform(Object *oblatt, Object *ob)
fp[0] = co[0] - fu;
fp[1] = co[1] - fv;
fp[2] = co[2] - fw;
- } else {
+ }
+ else {
fp[0] = bp->vec[0] - fu;
fp[1] = bp->vec[1] - fv;
fp[2] = bp->vec[2] - fw;
@@ -459,7 +460,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];
@@ -661,8 +662,10 @@ void curve_deform_verts(Scene *scene, Object *cuOb, Object *target,
use_vgroups = 0;
else
use_vgroups = 1;
- } else
+ }
+ else {
use_vgroups = 0;
+ }
if (vgroup && vgroup[0] && use_vgroups) {
Mesh *me= target->data;
@@ -782,7 +785,7 @@ void curve_deform_vector(Scene *scene, Object *cuOb, Object *target,
}
void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm,
- float (*vertexCos)[3], int numVerts, const char *vgroup)
+ float (*vertexCos)[3], int numVerts, const char *vgroup, float fac)
{
int a;
int use_vgroups;
@@ -802,8 +805,10 @@ void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm,
use_vgroups = 0;
else
use_vgroups = 1;
- } else
+ }
+ else {
use_vgroups = 0;
+ }
if (vgroup && vgroup[0] && use_vgroups) {
Mesh *me = target->data;
@@ -819,12 +824,13 @@ void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm,
weight= defvert_find_weight(dvert, index);
if (weight > 0.0f)
- calc_latt_deform(laOb, vertexCos[a], weight);
+ calc_latt_deform(laOb, vertexCos[a], weight * fac);
}
}
- } else {
+ }
+ else {
for (a = 0; a < numVerts; a++) {
- calc_latt_deform(laOb, vertexCos[a], 1.0f);
+ calc_latt_deform(laOb, vertexCos[a], fac);
}
}
end_latt_deform(laOb);
@@ -837,11 +843,12 @@ int object_deform_mball(Object *ob, ListBase *dispbase)
for (dl=dispbase->first; dl; dl=dl->next) {
lattice_deform_verts(ob->parent, ob, NULL,
- (float(*)[3]) dl->verts, dl->nr, NULL);
+ (float(*)[3]) dl->verts, dl->nr, NULL, 1.0f);
}
return 1;
- } else {
+ }
+ else {
return 0;
}
}
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 63c9d799f04..3c6c3f8c232 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -27,16 +27,11 @@
/** \file blender/blenkernel/intern/library.c
* \ingroup bke
+ *
+ * Contains management of ID's and libraries
+ * allocate and free of all library data
*/
-
-/*
- * Contains management of ID's and libraries
- * allocate and free of all library data
- *
- */
-
-
#include <stdio.h>
#include <ctype.h>
#include <string.h>
@@ -123,8 +118,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)))
@@ -148,8 +143,8 @@ void BKE_id_lib_local_paths(Main *bmain, Library *lib, ID *id)
void id_lib_extern(ID *id)
{
- if(id) {
- if(id->flag & LIB_INDIRECT) {
+ if (id) {
+ if (id->flag & LIB_INDIRECT) {
id->flag -= LIB_INDIRECT;
id->flag |= LIB_EXTERN;
}
@@ -158,9 +153,9 @@ void id_lib_extern(ID *id)
void id_us_plus(ID *id)
{
- if(id) {
+ if (id) {
id->us++;
- if(id->flag & LIB_INDIRECT) {
+ if (id->flag & LIB_INDIRECT) {
id->flag -= LIB_INDIRECT;
id->flag |= LIB_EXTERN;
}
@@ -169,19 +164,22 @@ void id_us_plus(ID *id)
void id_us_min(ID *id)
{
- if(id) {
- if(id->us<2 && (id->flag & LIB_FAKEUSER))
- id->us= 1;
- else if(id->us<=0)
- printf("ID user decrement error: %s \n", id->name);
- else
+ if (id) {
+ if (id->us < 2 && (id->flag & LIB_FAKEUSER)) {
+ id->us= 1;
+ }
+ else if (id->us <= 0) {
+ printf("ID user decrement error: %s\n", id->name);
+ }
+ else {
id->us--;
+ }
}
}
int id_make_local(ID *id, int test)
{
- if(id->flag & LIB_INDIRECT)
+ if (id->flag & LIB_INDIRECT)
return 0;
switch(GS(id->name)) {
@@ -190,54 +188,54 @@ int id_make_local(ID *id, int test)
case ID_LI:
return 0; /* can't be linked */
case ID_OB:
- if(!test) make_local_object((Object*)id);
+ if (!test) make_local_object((Object*)id);
return 1;
case ID_ME:
- if(!test) {
+ if (!test) {
make_local_mesh((Mesh*)id);
make_local_key(((Mesh*)id)->key);
}
return 1;
case ID_CU:
- if(!test) {
+ if (!test) {
make_local_curve((Curve*)id);
make_local_key(((Curve*)id)->key);
}
return 1;
case ID_MB:
- if(!test) make_local_mball((MetaBall*)id);
+ if (!test) make_local_mball((MetaBall*)id);
return 1;
case ID_MA:
- if(!test) make_local_material((Material*)id);
+ if (!test) make_local_material((Material*)id);
return 1;
case ID_TE:
- if(!test) make_local_texture((Tex*)id);
+ if (!test) make_local_texture((Tex*)id);
return 1;
case ID_IM:
- if(!test) make_local_image((Image*)id);
+ if (!test) make_local_image((Image*)id);
return 1;
case ID_LT:
- if(!test) {
+ if (!test) {
make_local_lattice((Lattice*)id);
make_local_key(((Lattice*)id)->key);
}
return 1;
case ID_LA:
- if(!test) make_local_lamp((Lamp*)id);
+ if (!test) make_local_lamp((Lamp*)id);
return 1;
case ID_CA:
- if(!test) make_local_camera((Camera*)id);
+ if (!test) make_local_camera((Camera*)id);
return 1;
case ID_SPK:
- if(!test) make_local_speaker((Speaker*)id);
+ if (!test) make_local_speaker((Speaker*)id);
return 1;
case ID_IP:
return 0; /* deprecated */
case ID_KE:
- if(!test) make_local_key((Key*)id);
+ if (!test) make_local_key((Key*)id);
return 1;
case ID_WO:
- if(!test) make_local_world((World*)id);
+ if (!test) make_local_world((World*)id);
return 1;
case ID_SCR:
return 0; /* can't be linked */
@@ -252,18 +250,18 @@ int id_make_local(ID *id, int test)
case ID_GR:
return 0; /* not implemented */
case ID_AR:
- if(!test) make_local_armature((bArmature*)id);
+ if (!test) make_local_armature((bArmature*)id);
return 1;
case ID_AC:
- if(!test) make_local_action((bAction*)id);
+ if (!test) make_local_action((bAction*)id);
return 1;
case ID_NT:
return 0; /* not implemented */
case ID_BR:
- if(!test) make_local_brush((Brush*)id);
+ if (!test) make_local_brush((Brush*)id);
return 1;
case ID_PA:
- if(!test) make_local_particlesettings((ParticleSettings*)id);
+ if (!test) make_local_particlesettings((ParticleSettings*)id);
return 1;
case ID_WM:
return 0; /* can't be linked */
@@ -276,7 +274,7 @@ int id_make_local(ID *id, int test)
int id_copy(ID *id, ID **newid, int test)
{
- if(!test) *newid= NULL;
+ if (!test) *newid= NULL;
/* conventions:
* - make shallow copy, only this ID block
@@ -287,74 +285,74 @@ int id_copy(ID *id, ID **newid, int test)
case ID_LI:
return 0; /* can't be copied from here */
case ID_OB:
- if(!test) *newid= (ID*)copy_object((Object*)id);
+ if (!test) *newid= (ID*)copy_object((Object*)id);
return 1;
case ID_ME:
- if(!test) *newid= (ID*)copy_mesh((Mesh*)id);
+ if (!test) *newid= (ID*)copy_mesh((Mesh*)id);
return 1;
case ID_CU:
- if(!test) *newid= (ID*)copy_curve((Curve*)id);
+ if (!test) *newid= (ID*)copy_curve((Curve*)id);
return 1;
case ID_MB:
- if(!test) *newid= (ID*)copy_mball((MetaBall*)id);
+ if (!test) *newid= (ID*)copy_mball((MetaBall*)id);
return 1;
case ID_MA:
- if(!test) *newid= (ID*)copy_material((Material*)id);
+ if (!test) *newid= (ID*)copy_material((Material*)id);
return 1;
case ID_TE:
- if(!test) *newid= (ID*)copy_texture((Tex*)id);
+ if (!test) *newid= (ID*)copy_texture((Tex*)id);
return 1;
case ID_IM:
- if(!test) *newid= (ID*)copy_image((Image*)id);
+ if (!test) *newid= (ID*)copy_image((Image*)id);
return 1;
case ID_LT:
- if(!test) *newid= (ID*)copy_lattice((Lattice*)id);
+ if (!test) *newid= (ID*)copy_lattice((Lattice*)id);
return 1;
case ID_LA:
- if(!test) *newid= (ID*)copy_lamp((Lamp*)id);
+ if (!test) *newid= (ID*)copy_lamp((Lamp*)id);
return 1;
case ID_SPK:
- if(!test) *newid= (ID*)copy_speaker((Speaker*)id);
+ if (!test) *newid= (ID*)copy_speaker((Speaker*)id);
return 1;
case ID_CA:
- if(!test) *newid= (ID*)copy_camera((Camera*)id);
+ if (!test) *newid= (ID*)copy_camera((Camera*)id);
return 1;
case ID_IP:
return 0; /* deprecated */
case ID_KE:
- if(!test) *newid= (ID*)copy_key((Key*)id);
+ if (!test) *newid= (ID*)copy_key((Key*)id);
return 1;
case ID_WO:
- if(!test) *newid= (ID*)copy_world((World*)id);
+ if (!test) *newid= (ID*)copy_world((World*)id);
return 1;
case ID_SCR:
return 0; /* can't be copied from here */
case ID_VF:
return 0; /* not implemented */
case ID_TXT:
- if(!test) *newid= (ID*)copy_text((Text*)id);
+ if (!test) *newid= (ID*)copy_text((Text*)id);
return 1;
case ID_SCRIPT:
return 0; /* deprecated */
case ID_SO:
return 0; /* not implemented */
case ID_GR:
- if(!test) *newid= (ID*)copy_group((Group*)id);
+ if (!test) *newid= (ID*)copy_group((Group*)id);
return 1;
case ID_AR:
- if(!test) *newid= (ID*)copy_armature((bArmature*)id);
+ if (!test) *newid= (ID*)copy_armature((bArmature*)id);
return 1;
case ID_AC:
- if(!test) *newid= (ID*)copy_action((bAction*)id);
+ if (!test) *newid= (ID*)copy_action((bAction*)id);
return 1;
case ID_NT:
- if(!test) *newid= (ID*)ntreeCopyTree((bNodeTree*)id);
+ if (!test) *newid= (ID*)ntreeCopyTree((bNodeTree*)id);
return 1;
case ID_BR:
- if(!test) *newid= (ID*)copy_brush((Brush*)id);
+ if (!test) *newid= (ID*)copy_brush((Brush*)id);
return 1;
case ID_PA:
- if(!test) *newid= (ID*)psys_copy_settings((ParticleSettings*)id);
+ if (!test) *newid= (ID*)psys_copy_settings((ParticleSettings*)id);
return 1;
case ID_WM:
return 0; /* can't be copied from here */
@@ -372,21 +370,21 @@ int id_unlink(ID *id, int test)
switch(GS(id->name)) {
case ID_TXT:
- if(test) return 1;
+ if (test) return 1;
unlink_text(mainlib, (Text*)id);
break;
case ID_GR:
- if(test) return 1;
+ if (test) return 1;
unlink_group((Group*)id);
break;
case ID_OB:
- if(test) return 1;
+ if (test) return 1;
unlink_object((Object*)id);
break;
}
- if(id->us == 0) {
- if(test) return 1;
+ if (id->us == 0) {
+ if (test) return 1;
lb= which_libbase(mainlib, GS(id->name));
free_libblock(lb, id);
@@ -409,8 +407,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);
@@ -497,10 +495,11 @@ void flag_listbase_ids(ListBase *lb, short flag, short value)
{
ID *id;
if (value) {
- for(id= lb->first; id; id= id->next) id->flag |= flag;
- } else {
+ for (id= lb->first; id; id= id->next) id->flag |= flag;
+ }
+ else {
flag = ~flag;
- for(id= lb->first; id; id= id->next) id->flag &= flag;
+ for (id= lb->first; id; id= id->next) id->flag &= flag;
}
}
@@ -510,7 +509,7 @@ void flag_all_listbases_ids(short flag, short value)
ListBase *lbarray[MAX_LIBARRAY];
int a;
a= set_listbasepointers(G.main, lbarray);
- while(a--) flag_listbase_ids(lbarray[a], flag, value);
+ while (a--) flag_listbase_ids(lbarray[a], flag, value);
}
void recalc_all_library_objects(Main *main)
@@ -518,8 +517,8 @@ void recalc_all_library_objects(Main *main)
Object *ob;
/* flag for full recalc */
- for(ob=main->object.first; ob; ob=ob->id.next)
- if(ob->id.lib)
+ for (ob=main->object.first; ob; ob=ob->id.next)
+ if (ob->id.lib)
ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
}
@@ -577,14 +576,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)
{
@@ -691,7 +690,7 @@ void *alloc_libblock(ListBase *lb, short type, const char *name)
ID *id= NULL;
id= alloc_libblock_notest(type);
- if(id) {
+ if (id) {
BLI_addtail(lb, id);
id->us= 1;
id->icon_id = 0;
@@ -737,7 +736,7 @@ void *copy_libblock(ID *id)
assert(idn != NULL);
idn_len= MEM_allocN_len(idn);
- if((int)idn_len - (int)sizeof(ID) > 0) { /* signed to allow neg result */
+ if ((int)idn_len - (int)sizeof(ID) > 0) { /* signed to allow neg result */
const char *cp= (const char *)id;
char *cpn= (char *)idn;
@@ -880,7 +879,7 @@ void free_libblock(ListBase *lb, void *idv)
psys_free_settings((ParticleSettings *)id);
break;
case ID_WM:
- if(free_windowmanager_cb)
+ if (free_windowmanager_cb)
free_windowmanager_cb(NULL, (wmWindowManager *)id);
break;
case ID_GD:
@@ -910,12 +909,12 @@ void free_libblock_us(ListBase *lb, void *idv) /* test users */
id->us--;
- if(id->us<0) {
- if(id->lib) printf("ERROR block %s %s users %d\n", id->lib->name, id->name, id->us);
+ if (id->us<0) {
+ if (id->lib) printf("ERROR block %s %s users %d\n", id->lib->name, id->name, id->us);
else printf("ERROR block %s users %d\n", id->name, id->us);
}
- if(id->us==0) {
- if( GS(id->name)==ID_OB ) unlink_object((Object *)id);
+ if (id->us==0) {
+ if ( GS(id->name)==ID_OB ) unlink_object((Object *)id);
free_libblock(lb, id);
}
@@ -929,7 +928,7 @@ void free_main(Main *mainvar)
int a;
a= set_listbasepointers(mainvar, lbarray);
- while(a--) {
+ while (a--) {
ListBase *lb= lbarray[a];
ID *id;
@@ -961,16 +960,16 @@ static void get_flags_for_id(ID *id, char *buf)
* to have that explicit, oh well - zr
*/
- if(GS(id->name)==ID_MA)
+ if (GS(id->name)==ID_MA)
isnode= ((Material *)id)->use_nodes;
- if(GS(id->name)==ID_TE)
+ if (GS(id->name)==ID_TE)
isnode= ((Tex *)id)->use_nodes;
if (id->us<0)
strcpy(buf, "-1W ");
else if (!id->lib && !isfake && id->us && !isnode)
strcpy(buf, " ");
- else if(isnode)
+ else if (isnode)
sprintf(buf, "%c%cN%c ", id->lib?'L':' ', isfake?'F':' ', (id->us==0)?'O':' ');
else
sprintf(buf, "%c%c%c ", id->lib?'L':' ', isfake?'F':' ', (id->us==0)?'O':' ');
@@ -987,7 +986,8 @@ static void IDnames_to_dyn_pupstring(DynStr *pupds, ListBase *lb, ID *link, shor
if (nr && nids>MAX_IDPUP) {
BLI_dynstr_append(pupds, "DataBrowse %x-2");
*nr= -2;
- } else {
+ }
+ else {
ID *id;
for (i=0, id= lb->first; id; id= id->next, i++) {
@@ -1024,7 +1024,7 @@ static void IDnames_to_dyn_pupstring(DynStr *pupds, ListBase *lb, ID *link, shor
break;
}
- if(id->next)
+ if (id->next)
BLI_dynstr_append(pupds, "|");
}
}
@@ -1081,19 +1081,19 @@ static void sort_alpha_id(ListBase *lb, ID *id)
ID *idtest;
/* insert alphabetically */
- if(lb->first!=lb->last) {
+ if (lb->first!=lb->last) {
BLI_remlink(lb, id);
idtest= lb->first;
- while(idtest) {
- if(BLI_strcasecmp(idtest->name, id->name)>0 || idtest->lib) {
+ while (idtest) {
+ if (BLI_strcasecmp(idtest->name, id->name)>0 || idtest->lib) {
BLI_insertlinkbefore(lb, idtest, id);
break;
}
idtest= idtest->next;
}
/* as last */
- if(idtest==NULL) {
+ if (idtest==NULL) {
BLI_addtail(lb, id);
}
}
@@ -1108,13 +1108,13 @@ static ID *is_dupid(ListBase *lb, ID *id, const char *name)
{
ID *idtest=NULL;
- for( idtest = lb->first; idtest; idtest = idtest->next ) {
+ for ( idtest = lb->first; idtest; idtest = idtest->next ) {
/* if idtest is not a lib */
- if( id != idtest && idtest->lib == NULL ) {
+ if ( id != idtest && idtest->lib == NULL ) {
/* do not test alphabetic! */
/* optimized */
- if( idtest->name[2] == name[0] ) {
- if(strcmp(name, idtest->name+2)==0) break;
+ if ( idtest->name[2] == name[0] ) {
+ if (strcmp(name, idtest->name+2)==0) break;
}
}
}
@@ -1141,7 +1141,7 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name)
char left[MAX_ID_NAME + 8], leftest[MAX_ID_NAME + 8];
/* make sure input name is terminated properly */
- /* if( strlen(name) > MAX_ID_NAME-3 ) name[MAX_ID_NAME-3]= 0; */
+ /* if ( strlen(name) > MAX_ID_NAME-3 ) name[MAX_ID_NAME-3]= 0; */
/* removed since this is only ever called from one place - campbell */
while (1) {
@@ -1150,7 +1150,7 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name)
idtest = is_dupid(lb, id, name);
/* if there is no double, done */
- if( idtest == NULL ) return 0;
+ if ( idtest == NULL ) return 0;
/* we have a dup; need to make a new name */
/* quick check so we can reuse one of first 64 ids if vacant */
@@ -1160,33 +1160,33 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name)
left_len= BLI_split_name_num(left, &nr, name, '.');
/* if new name will be too long, truncate it */
- if(nr > 999 && left_len > (MAX_ID_NAME - 8)) {
+ if (nr > 999 && left_len > (MAX_ID_NAME - 8)) {
left[MAX_ID_NAME - 8]= 0;
left_len= MAX_ID_NAME - 8;
}
- else if(left_len > (MAX_ID_NAME - 7)) {
+ else if (left_len > (MAX_ID_NAME - 7)) {
left[MAX_ID_NAME - 7]= 0;
left_len= MAX_ID_NAME - 7;
}
- for(idtest= lb->first; idtest; idtest= idtest->next) {
- if( (id != idtest) &&
+ for (idtest= lb->first; idtest; idtest= idtest->next) {
+ if ( (id != idtest) &&
(idtest->lib == NULL) &&
(*name == *(idtest->name+2)) &&
(strncmp(name, idtest->name+2, left_len)==0) &&
(BLI_split_name_num(leftest, &nrtest, idtest->name+2, '.') == left_len)
) {
- if(nrtest < sizeof(in_use))
+ if (nrtest < sizeof(in_use))
in_use[nrtest]= 1; /* mark as used */
- if(nr <= nrtest)
+ if (nr <= nrtest)
nr= nrtest+1; /* track largest unused */
}
}
/* decide which value of nr to use */
- for(a=0; a < sizeof(in_use); a++) {
- if(a>=nr) break; /* stop when we've check up to biggest */
- if( in_use[a]==0 ) { /* found an unused value */
+ for (a=0; a < sizeof(in_use); a++) {
+ if (a>=nr) break; /* stop when we've check up to biggest */
+ if ( in_use[a]==0 ) { /* found an unused value */
nr = a;
break;
}
@@ -1195,7 +1195,7 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name)
/* If the original name has no numeric suffix,
* rather than just chopping and adding numbers,
* shave off the end chars until we have a unique name.
- * Check the null terminators match as well so we dont get Cube.000 -> Cube.00 */
+ * Check the null terminators match as well so we don't get Cube.000 -> Cube.00 */
if (nr==0 && name[left_len]== '\0') {
int len = left_len-1;
idtest= is_dupid(lb, id, name);
@@ -1208,10 +1208,10 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name)
/* otherwise just continue and use a number suffix */
}
- if(nr > 999 && left_len > (MAX_ID_NAME - 8)) {
+ if (nr > 999 && left_len > (MAX_ID_NAME - 8)) {
/* this would overflow name buffer */
left[MAX_ID_NAME - 8] = 0;
- /* left_len = MAX_ID_NAME - 8; */ /* for now this isnt used again */
+ /* left_len = MAX_ID_NAME - 8; */ /* for now this isn't used again */
memcpy(name, left, sizeof(char) * (MAX_ID_NAME - 7));
continue;
}
@@ -1235,14 +1235,14 @@ int new_id(ListBase *lb, ID *id, const char *tname)
char name[MAX_ID_NAME-2];
/* if library, don't rename */
- if(id->lib) return 0;
+ if (id->lib) return 0;
/* if no libdata given, look up based on ID */
- if(lb==NULL) lb= which_libbase(G.main, GS(id->name));
+ if (lb==NULL) lb= which_libbase(G.main, GS(id->name));
/* if no name given, use name of current ID
* else make a copy (tname args can be const) */
- if(tname==NULL)
+ if (tname==NULL)
tname= id->name+2;
strncpy(name, tname, sizeof(name)-1);
@@ -1251,13 +1251,13 @@ int new_id(ListBase *lb, ID *id, const char *tname)
* easier to assign each time then to check if its needed */
name[sizeof(name)-1]= 0;
- if(name[0] == '\0') {
+ if (name[0] == '\0') {
/* disallow empty names */
strcpy(name, ID_FALLBACK_NAME);
}
else {
/* disallow non utf8 chars,
- * the interface checks for this but new ID's based on file names dont */
+ * the interface checks for this but new ID's based on file names don't */
BLI_utf8_invalid_strip(name, strlen(name));
}
@@ -1268,16 +1268,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);
@@ -1295,9 +1297,9 @@ void clear_id_newpoins(void)
int a;
a= set_listbasepointers(G.main, lbarray);
- while(a--) {
+ while (a--) {
id= lbarray[a]->first;
- while(id) {
+ while (id) {
id->newid= NULL;
id->flag &= ~LIB_NEW;
id= id->next;
@@ -1305,21 +1307,21 @@ void clear_id_newpoins(void)
}
}
-#define LIBTAG(a) if(a && a->id.lib) {a->id.flag &=~LIB_INDIRECT; a->id.flag |= LIB_EXTERN;}
+#define LIBTAG(a) if (a && a->id.lib) {a->id.flag &=~LIB_INDIRECT; a->id.flag |= LIB_EXTERN;}
static void lib_indirect_test_id(ID *id, Library *lib)
{
- if(id->lib) {
+ if (id->lib) {
/* datablocks that were indirectly related are now direct links
* without this, appending data that has a link to other data will fail to write */
- if(lib && id->lib->parent == lib) {
+ if (lib && id->lib->parent == lib) {
id_lib_extern(id);
}
return;
}
- if(GS(id->name)==ID_OB) {
+ if (GS(id->name)==ID_OB) {
Object *ob= (Object *)id;
Mesh *me;
@@ -1338,7 +1340,7 @@ static void lib_indirect_test_id(ID *id, Library *lib)
// XXX: new animation system needs something like this?
#endif
- for(a=0; a<ob->totcol; a++) {
+ for (a=0; a<ob->totcol; a++) {
LIBTAG(ob->mat[a]);
}
@@ -1353,13 +1355,13 @@ static void lib_indirect_test_id(ID *id, Library *lib)
void tag_main_lb(ListBase *lb, const short tag)
{
ID *id;
- if(tag) {
- for(id= lb->first; id; id= id->next) {
+ if (tag) {
+ for (id= lb->first; id; id= id->next) {
id->flag |= LIB_DOIT;
}
}
else {
- for(id= lb->first; id; id= id->next) {
+ for (id= lb->first; id; id= id->next) {
id->flag &= ~LIB_DOIT;
}
}
@@ -1378,7 +1380,7 @@ void tag_main(struct Main *mainvar, const short tag)
int a;
a= set_listbasepointers(mainvar, lbarray);
- while(a--) {
+ while (a--) {
tag_main_lb(lbarray[a], tag);
}
}
@@ -1392,23 +1394,23 @@ void BKE_library_make_local(Main *bmain, Library *lib, int untagged_only)
int a;
a= set_listbasepointers(bmain, lbarray);
- while(a--) {
+ while (a--) {
id= lbarray[a]->first;
- while(id) {
+ while (id) {
id->newid= NULL;
idn= id->next; /* id is possibly being inserted again */
/* The check on the second line (LIB_PRE_EXISTING) is done so its
- * possible to tag data you dont want to be made local, used for
+ * possible to tag data you don't want to be made local, used for
* appending data, so any libdata already linked wont become local
* (very nasty to discover all your links are lost after appending)
* */
- if(id->flag & (LIB_EXTERN|LIB_INDIRECT|LIB_NEW) &&
+ if (id->flag & (LIB_EXTERN|LIB_INDIRECT|LIB_NEW) &&
(untagged_only==0 || !(id->flag & LIB_PRE_EXISTING)))
{
- if(lib==NULL || id->lib==lib) {
- if(id->lib) {
+ if (lib==NULL || id->lib==lib) {
+ if (id->lib) {
id_clear_lib_data(bmain, id); /* sets 'id->flag' */
/* why sort alphabetically here but not in
@@ -1424,7 +1426,7 @@ void BKE_library_make_local(Main *bmain, Library *lib, int untagged_only)
}
/* patch2: make it aphabetically */
- while( (id=tempbase.first) ) {
+ while ( (id=tempbase.first) ) {
BLI_remlink(&tempbase, id);
BLI_addtail(lbarray[a], id);
new_id(lbarray[a], id, NULL);
@@ -1433,8 +1435,8 @@ void BKE_library_make_local(Main *bmain, Library *lib, int untagged_only)
/* patch 3: make sure library data isn't indirect falsely... */
a= set_listbasepointers(bmain, lbarray);
- while(a--) {
- for(id= lbarray[a]->first; id; id=id->next)
+ while (a--) {
+ for (id= lbarray[a]->first; id; id=id->next)
lib_indirect_test_id(id, lib);
}
}
@@ -1448,22 +1450,22 @@ void test_idbutton(char *name)
lb= which_libbase(G.main, GS(name-2) );
- if(lb==NULL) return;
+ if (lb==NULL) return;
/* search for id */
idtest= BLI_findstring(lb, name, offsetof(ID, name) + 2);
- if(idtest) if( new_id(lb, idtest, name)==0 ) sort_alpha_id(lb, idtest);
+ if (idtest) if ( new_id(lb, idtest, name)==0 ) sort_alpha_id(lb, idtest);
}
void text_idbutton(struct ID *id, char *text)
{
- if(id) {
- if(GS(id->name)==ID_SCE)
+ if (id) {
+ if (GS(id->name)==ID_SCE)
strcpy(text, "SCE: ");
- else if(GS(id->name)==ID_SCR)
+ else if (GS(id->name)==ID_SCR)
strcpy(text, "SCR: ");
- else if(GS(id->name)==ID_MA && ((Material*)id)->use_nodes)
+ else if (GS(id->name)==ID_MA && ((Material*)id)->use_nodes)
strcpy(text, "NT: ");
else {
text[0]= id->name[0];
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 43270447dad..f7351887b55 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -290,9 +290,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;
@@ -304,10 +304,10 @@ 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) {
+ while (ob) {
if (ob->mat) {
for (a=0; a<ob->totcol; a++) {
if (ob->mat[a]==ma) {
@@ -320,7 +320,7 @@ void make_local_material(Material *ma)
}
/* test meshes */
me= bmain->mesh.first;
- while(me) {
+ while (me) {
if (me->mat) {
for (a=0; a<me->totcol; a++) {
if (me->mat[a]==ma) {
@@ -333,7 +333,7 @@ void make_local_material(Material *ma)
}
/* test curves */
cu= bmain->curve.first;
- while(cu) {
+ while (cu) {
if (cu->mat) {
for (a=0; a<cu->totcol; a++) {
if (cu->mat[a]==ma) {
@@ -346,7 +346,7 @@ void make_local_material(Material *ma)
}
/* test mballs */
mb= bmain->mball.first;
- while(mb) {
+ while (mb) {
if (mb->mat) {
for (a=0; a<mb->totcol; a++) {
if (mb->mat[a]==ma) {
@@ -374,7 +374,7 @@ void make_local_material(Material *ma)
/* do objects */
ob= bmain->object.first;
- while(ob) {
+ while (ob) {
if (ob->mat) {
for (a=0; a<ob->totcol; a++) {
if (ob->mat[a]==ma) {
@@ -390,7 +390,7 @@ void make_local_material(Material *ma)
}
/* do meshes */
me= bmain->mesh.first;
- while(me) {
+ while (me) {
if (me->mat) {
for (a=0; a<me->totcol; a++) {
if (me->mat[a]==ma) {
@@ -406,7 +406,7 @@ void make_local_material(Material *ma)
}
/* do curves */
cu= bmain->curve.first;
- while(cu) {
+ while (cu) {
if (cu->mat) {
for (a=0; a<cu->totcol; a++) {
if (cu->mat[a]==ma) {
@@ -422,7 +422,7 @@ void make_local_material(Material *ma)
}
/* do mballs */
mb= bmain->mball.first;
- while(mb) {
+ while (mb) {
if (mb->mat) {
for (a=0; a<mb->totcol; a++) {
if (mb->mat[a]==ma) {
@@ -458,7 +458,7 @@ Material ***give_matarar(Object *ob)
me= ob->data;
return &(me->mat);
}
- else if ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF) {
+ else if (ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
cu= ob->data;
return &(cu->mat);
}
@@ -479,7 +479,7 @@ short *give_totcolp(Object *ob)
me= ob->data;
return &(me->totcol);
}
- else if ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF) {
+ else if (ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
cu= ob->data;
return &(cu->totcol);
}
@@ -533,7 +533,7 @@ static void data_delete_material_index_id(ID *id, short index)
curve_delete_material_index((Curve *)id, index);
break;
case ID_MB:
- /* meta-elems dont have materials atm */
+ /* meta-elems don't have materials atm */
break;
}
}
@@ -840,7 +840,7 @@ void assign_matarar(struct Object *ob, struct Material ***matar, short totcol)
int actcol_orig= ob->actcol;
short i;
- while(object_remove_material_slot(ob)) {};
+ while (object_remove_material_slot(ob)) {};
/* now we have the right number of slots */
for (i=0; i<totcol; i++)
@@ -903,7 +903,7 @@ static void do_init_render_material(Material *ma, int r_mode, float *amb)
ma->mapto |= mtex->mapto;
/* always get derivatives for these textures */
- if ELEM3(mtex->tex->type, TEX_IMAGE, TEX_PLUGIN, TEX_ENVMAP) ma->texco |= TEXCO_OSA;
+ if (ELEM3(mtex->tex->type, TEX_IMAGE, TEX_PLUGIN, TEX_ENVMAP)) ma->texco |= TEXCO_OSA;
else if (mtex->texflag & (MTEX_COMPAT_BUMP|MTEX_3TAP_BUMP|MTEX_5TAP_BUMP|MTEX_BICUBIC_BUMP)) ma->texco |= TEXCO_OSA;
if (ma->texco & (TEXCO_ORCO|TEXCO_REFL|TEXCO_NORM|TEXCO_STRAND|TEXCO_STRESS)) needuv= 1;
@@ -1144,7 +1144,7 @@ int object_remove_material_slot(Object *ob)
actcol= ob->actcol;
obt= G.main->object.first;
- while(obt) {
+ while (obt) {
if (obt->data==ob->data) {
@@ -1614,7 +1614,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);
}
@@ -1886,7 +1886,7 @@ int do_version_tface(Main *main, int fileload)
ma->game.flag = -flag;
/* some people uses multitexture with TexFace by creating a texture
- * channel which not neccessarly the tf->tpage image. But the game engine
+ * channel which not necessarily the tf->tpage image. But the game engine
* was enabling it. Now it's required to set "Face Texture [Alpha] in the
* material settings. */
if (!fileload)
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 52e9dcaa578..da5e02c17f1 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -77,7 +77,7 @@ void unlink_mball(MetaBall *mb)
{
int a;
- for(a=0; a<mb->totcol; a++) {
+ for (a=0; a<mb->totcol; a++) {
if (mb->mat[a]) mb->mat[a]->id.us--;
mb->mat[a]= NULL;
}
@@ -125,7 +125,7 @@ MetaBall *copy_mball(MetaBall *mb)
BLI_duplicatelist(&mbn->elems, &mb->elems);
mbn->mat= MEM_dupallocN(mb->mat);
- for(a=0; a<mbn->totcol; a++) {
+ for (a=0; a<mbn->totcol; a++) {
id_us_plus((ID *)mbn->mat[a]);
}
mbn->bb= MEM_dupallocN(mb->bb);
@@ -162,7 +162,7 @@ void make_local_mball(MetaBall *mb)
return;
}
- for(ob= G.main->object.first; ob && ELEM(0, is_lib, is_local); ob= ob->id.next) {
+ for (ob= G.main->object.first; ob && ELEM(0, is_lib, is_local); ob= ob->id.next) {
if (ob->data == mb) {
if (ob->id.lib) is_lib= TRUE;
else is_local= TRUE;
@@ -180,7 +180,7 @@ void make_local_mball(MetaBall *mb)
/* Remap paths of new ID using old library as base. */
BKE_id_lib_local_paths(bmain, mb->id.lib, &mb_new->id);
- for(ob= G.main->object.first; ob; ob= ob->id.next) {
+ for (ob= G.main->object.first; ob; ob= ob->id.next) {
if (ob->data == mb) {
if (ob->id.lib==NULL) {
ob->data= mb_new;
@@ -262,11 +262,11 @@ void tex_space_mball(Object *ob)
(max)[0]= (max)[1]= (max)[2]= -1.0e30f;
dl= ob->disp.first;
- while(dl) {
+ while (dl) {
tot= dl->nr;
if (tot) doit= 1;
data= dl->verts;
- while(tot--) {
+ while (tot--) {
/* Also weird... but longer. From utildefines. */
DO_MINMAX(data, min, max);
data+= 3;
@@ -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);
}
@@ -313,7 +313,7 @@ float *make_orco_mball(Object *ob, ListBase *dispbase)
data= dl->verts;
orco= orcodata;
a= dl->nr;
- while(a--) {
+ while (a--) {
orco[0]= (data[0]-loc[0])/size[0];
orco[1]= (data[1]-loc[1])/size[1];
orco[2]= (data[2]-loc[2])/size[2];
@@ -353,7 +353,7 @@ int is_basis_mball(Object *ob)
}
/* return nonzero if ob1 is a basis mball for ob */
-int is_mball_basis_for(Object *ob1, Object *ob2)
+int is_mball_basis_for (Object *ob1, Object *ob2)
{
int basis1nr, basis2nr;
char basis1name[MAX_ID_NAME], basis2name[MAX_ID_NAME];
@@ -386,7 +386,7 @@ void copy_mball_properties(Scene *scene, Object *active_object)
if (F_ERROR==next_object(&sce_iter, 0, NULL, NULL))
return;
- while(next_object(&sce_iter, 1, &base, &ob)) {
+ while (next_object(&sce_iter, 1, &base, &ob)) {
if (ob->type==OB_MBALL) {
if (ob != active_object) {
BLI_split_name_num(obname, &obnr, ob->id.name+2, '.');
@@ -432,7 +432,7 @@ Object *find_basis_mball(Scene *scene, Object *basis)
if (F_ERROR==next_object(&sce_iter, 0, NULL, NULL))
return NULL;
- while(next_object(&sce_iter, 1, &base, &ob)) {
+ while (next_object(&sce_iter, 1, &base, &ob)) {
if (ob->type==OB_MBALL) {
if (ob==bob) {
@@ -444,7 +444,7 @@ Object *find_basis_mball(Scene *scene, Object *basis)
/* if bob object is in object mode */
else ml= mb->elems.first;
}
- else{
+ else {
BLI_split_name_num(obname, &obnr, ob->id.name+2, '.');
/* object ob has to be in same "group" ... it means, that it has to have
@@ -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
@@ -617,21 +617,21 @@ octal_node* find_metaball_octal_node(octal_node *node, float x, float y, float z
else
return node;
}
- else{
+ else {
if (node->nodes[1])
return find_metaball_octal_node(node->nodes[1],x,y,z,depth--);
else
return node;
}
}
- else{
+ else {
if (x < node->x) {
if (node->nodes[3])
return find_metaball_octal_node(node->nodes[3],x,y,z,depth--);
else
return node;
}
- else{
+ else {
if (node->nodes[2])
return find_metaball_octal_node(node->nodes[2],x,y,z,depth--);
else
@@ -639,7 +639,7 @@ octal_node* find_metaball_octal_node(octal_node *node, float x, float y, float z
}
}
}
- else{
+ else {
if (y < node->y) {
if (x < node->x) {
if (node->nodes[4])
@@ -647,21 +647,21 @@ octal_node* find_metaball_octal_node(octal_node *node, float x, float y, float z
else
return node;
}
- else{
+ else {
if (node->nodes[5])
return find_metaball_octal_node(node->nodes[5],x,y,z,depth--);
else
return node;
}
}
- else{
+ else {
if (x < node->x) {
if (node->nodes[7])
return find_metaball_octal_node(node->nodes[7],x,y,z,depth--);
else
return node;
}
- else{
+ else {
if (node->nodes[6])
return find_metaball_octal_node(node->nodes[6],x,y,z,depth--);
else
@@ -686,7 +686,7 @@ float metaball(float x, float y, float z)
if (node) {
ml_p= node->elems.first;
- while(ml_p) {
+ while (ml_p) {
dens+=densfunc(ml_p->ml, x, y, z);
ml_p= ml_p->next;
}
@@ -694,14 +694,14 @@ float metaball(float x, float y, float z)
dens+= -0.5f*(metaball_tree->pos - node->pos);
dens+= 0.5f*(metaball_tree->neg - node->neg);
}
- else{
- for(a=0; a<totelem; a++) {
- dens+= densfunc( mainb[a], x, y, z);
+ else {
+ for (a=0; a<totelem; a++) {
+ dens += densfunc(mainb[a], x, y, z);
}
}
}
- else{
- dens+= densfunc( mainb[0], x, y, z);
+ else {
+ dens += densfunc(mainb[0], x, y, z);
}
return thresh - dens;
@@ -762,7 +762,7 @@ void *new_pgn_element(int size)
}
else if (size== -1) {
cur= lb.first;
- while(cur) {
+ while (cur) {
MEM_freeN(cur->data);
cur= cur->next;
}
@@ -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)
{
@@ -1078,11 +1078,11 @@ void BKE_freecubetable(void)
for (i = 0; i < 256; i++) {
lists= cubetable[i];
- while(lists) {
+ while (lists) {
nlists= lists->next;
ints= lists->list;
- while(ints) {
+ while (ints) {
nints= ints->next;
MEM_freeN(ints);
ints= nints;
@@ -1387,7 +1387,7 @@ void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2,
pos.y = p->y;
pos.z = p->z;
}
- else{
+ else {
neg.x = p->x;
neg.y = p->y;
neg.z = p->z;
@@ -1404,9 +1404,9 @@ void add_cube(PROCESS *mbproc, int i, int j, int k, int count)
/* hmmm, not only one, but eight cube will be added on the stack
* ... */
- for(a=i-1; a<i+count; a++)
- for(b=j-1; b<j+count; b++)
- for(c=k-1; c<k+count; c++) {
+ for (a=i-1; a<i+count; a++)
+ for (b=j-1; b<j+count; b++)
+ for (c=k-1; c<k+count; c++) {
/* test if cube has been found before */
if ( setcenter(mbproc->centers, a, b, c)==0 ) {
/* push cube on stack: */
@@ -1451,7 +1451,7 @@ void find_first_points(PROCESS *mbproc, MetaBall *mb, int a)
calc_mballco(ml, (float *)&in);
in_v = mbproc->function(in.x, in.y, in.z);
- for(i=0;i<3;i++) {
+ for (i=0;i<3;i++) {
switch (ml->type) {
case MB_BALL:
OUT.x = out.x= IN.x + index[i]*ml->rad;
@@ -1464,7 +1464,7 @@ void find_first_points(PROCESS *mbproc, MetaBall *mb, int a)
break;
}
- for(j=0;j<3;j++) {
+ for (j=0;j<3;j++) {
switch (ml->type) {
case MB_BALL:
OUT.y = out.y= IN.y + index[j]*ml->rad;
@@ -1477,7 +1477,7 @@ void find_first_points(PROCESS *mbproc, MetaBall *mb, int a)
break;
}
- for(k=0;k<3;k++) {
+ for (k=0;k<3;k++) {
out.x = OUT.x;
out.y = OUT.y;
switch (ml->type) {
@@ -1514,7 +1514,7 @@ void find_first_points(PROCESS *mbproc, MetaBall *mb, int a)
dz = (out.z - in.z)/MAXN;
len = 0.0;
- while(len<=max_len) {
+ while (len<=max_len) {
workp.x += dx;
workp.y += dy;
workp.z += dz;
@@ -1560,7 +1560,7 @@ void polygonize(PROCESS *mbproc, MetaBall *mb)
mbproc->edges = MEM_callocN(2*HASHSIZE * sizeof(EDGELIST *), "mbproc->edges");
makecubetable();
- for(a=0; a<totelem; a++) {
+ for (a=0; a<totelem; a++) {
/* try to find 8 points on the surface for each MetaElem */
find_first_points(mbproc, mb, a);
@@ -1606,7 +1606,7 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
/* make main array */
next_object(&sce_iter, 0, NULL, NULL);
- while(next_object(&sce_iter, 1, &base, &bob)) {
+ while (next_object(&sce_iter, 1, &base, &bob)) {
if (bob->type==OB_MBALL) {
zero_size= 0;
@@ -1638,7 +1638,7 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
}
else if (bob->parent) {
struct Object *pob=bob->parent;
- while(pob) {
+ while (pob) {
if (pob->size[0]==0.0f || pob->size[1]==0.0f || pob->size[2]==0.0f) {
zero_size= 1;
break;
@@ -1649,14 +1649,14 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
if (zero_size) {
unsigned int ml_count=0;
- while(ml) {
+ while (ml) {
ml_count++;
ml= ml->next;
}
totelem -= ml_count;
}
else {
- while(ml) {
+ while (ml) {
if (!(ml->flag & MB_HIDE)) {
int i;
float temp1[4][4], temp2[4][4], temp3[4][4];
@@ -1737,11 +1737,11 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
mainb[a]->bb->vec[7][2]= ml->expz;
/* transformation of Metalem bb */
- for(i=0; i<8; i++)
+ for (i=0; i<8; i++)
mul_m4_v3((float ( * )[4])mat, mainb[a]->bb->vec[i]);
/* find max and min of transformed bb */
- for(i=0; i<8; i++) {
+ for (i=0; i<8; i++) {
/* find maximums */
if (mainb[a]->bb->vec[i][0] > max_x) max_x = mainb[a]->bb->vec[i][0];
if (mainb[a]->bb->vec[i][1] > max_y) max_y = mainb[a]->bb->vec[i][1];
@@ -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;
@@ -1773,7 +1773,7 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
/* totsize (= 'manhattan' radius) */
totsize= 0.0;
- for(a=0; a<totelem; a++) {
+ for (a=0; a<totelem; a++) {
vec[0]= mainb[a]->x + mainb[a]->rad + mainb[a]->expx;
vec[1]= mainb[a]->y + mainb[a]->rad + mainb[a]->expy;
@@ -1802,8 +1802,8 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
if ( size > totsize ) totsize= size;
}
- for(a=0; a<totelem; a++) {
- thresh+= densfunc( mainb[a], 2.0f*totsize, 2.0f*totsize, 2.0f*totsize);
+ for (a=0; a<totelem; a++) {
+ thresh += densfunc(mainb[a], 2.0f * totsize, 2.0f * totsize, 2.0f * totsize);
}
return totsize;
@@ -1824,12 +1824,12 @@ void fill_metaball_octal_node(octal_node *node, MetaElem *ml, short i)
if (ml->flag & MB_NEGATIVE) {
node->nodes[i]->neg++;
}
- else{
+ else {
node->nodes[i]->pos++;
}
}
-/* Node is subdivided as is ilustrated on the following figure:
+/* Node is subdivided as is illustrated on the following figure:
*
* +------+------+
* / / /|
@@ -1852,9 +1852,9 @@ void subdivide_metaball_octal_node(octal_node *node, float size_x, float size_y,
int a,i;
/* create new nodes */
- for(a=0;a<8;a++) {
+ for (a=0;a<8;a++) {
node->nodes[a]= MEM_mallocN(sizeof(octal_node),"octal_node");
- for(i=0;i<8;i++)
+ for (i=0;i<8;i++)
node->nodes[a]->nodes[i]= NULL;
node->nodes[a]->parent= node;
node->nodes[a]->elems.first= NULL;
@@ -1933,7 +1933,7 @@ void subdivide_metaball_octal_node(octal_node *node, float size_x, float size_y,
ml_p= node->elems.first;
/* setting up references of MetaElems for new nodes */
- while(ml_p) {
+ while (ml_p) {
ml= ml_p->ml;
if (ml->bb->vec[0][2] < z) {
if (ml->bb->vec[0][1] < y) {
@@ -1982,7 +1982,7 @@ void subdivide_metaball_octal_node(octal_node *node, float size_x, float size_y,
}
/* vec[0][0] is in the (1)second octant */
- else{
+ else {
/* ml belong to the (1)2nd node */
fill_metaball_octal_node(node, ml, 1);
@@ -2003,7 +2003,7 @@ void subdivide_metaball_octal_node(octal_node *node, float size_x, float size_y,
}
}
}
- else{
+ else {
/* vec[0][0] is in the (3)4th octant */
if (ml->bb->vec[0][0] < x) {
/* ml belongs to the (3)4nd node */
@@ -2039,7 +2039,7 @@ void subdivide_metaball_octal_node(octal_node *node, float size_x, float size_y,
}
}
}
- else{
+ else {
if (ml->bb->vec[0][1] < y) {
/* vec[0][0] lies in (4)5th octant */
if (ml->bb->vec[0][0] < x) {
@@ -2059,7 +2059,7 @@ void subdivide_metaball_octal_node(octal_node *node, float size_x, float size_y,
}
}
/* vec[0][0] lies in (5)6th octant */
- else{
+ else {
fill_metaball_octal_node(node, ml, 5);
if (ml->bb->vec[6][1] >= y) {
@@ -2067,7 +2067,7 @@ void subdivide_metaball_octal_node(octal_node *node, float size_x, float size_y,
}
}
}
- else{
+ else {
/* vec[0][0] lies in (7)8th octant */
if (ml->bb->vec[0][0] < x) {
fill_metaball_octal_node(node, ml, 7);
@@ -2093,7 +2093,7 @@ void subdivide_metaball_octal_node(octal_node *node, float size_x, float size_y,
depth--;
if (depth>0) {
- for(a=0;a<8;a++) {
+ for (a=0;a<8;a++) {
if (node->nodes[a]->count > 0) /* if node is not empty, then it is subdivided */
subdivide_metaball_octal_node(node->nodes[a], size_x, size_y, size_z, depth);
}
@@ -2104,7 +2104,7 @@ void subdivide_metaball_octal_node(octal_node *node, float size_x, float size_y,
void free_metaball_octal_node(octal_node *node)
{
int a;
- for(a=0;a<8;a++) {
+ for (a=0;a<8;a++) {
if (node->nodes[a]!=NULL) free_metaball_octal_node(node->nodes[a]);
}
BLI_freelistN(&node->elems);
@@ -2131,14 +2131,14 @@ void init_metaball_octal_tree(int depth)
node->elems.last= NULL;
node->count=0;
- for(a=0;a<8;a++)
+ for (a=0;a<8;a++)
node->nodes[a]=NULL;
node->x_min= node->y_min= node->z_min= FLT_MAX;
node->x_max= node->y_max= node->z_max= -FLT_MAX;
/* size of octal tree scene */
- for(a=0;a<totelem;a++) {
+ for (a=0;a<totelem;a++) {
if (mainb[a]->bb->vec[0][0] < node->x_min) node->x_min= mainb[a]->bb->vec[0][0];
if (mainb[a]->bb->vec[0][1] < node->y_min) node->y_min= mainb[a]->bb->vec[0][1];
if (mainb[a]->bb->vec[0][2] < node->z_min) node->z_min= mainb[a]->bb->vec[0][2];
@@ -2155,7 +2155,7 @@ void init_metaball_octal_tree(int depth)
/* number of negative MetaElem in scene */
metaball_tree->neg++;
}
- else{
+ else {
/* number of positive MetaElem in scene */
metaball_tree->pos++;
}
@@ -2268,7 +2268,7 @@ void metaball_polygonize(Scene *scene, Object *ob, ListBase *dispbase)
dl->verts= ve= MEM_mallocN(sizeof(float)*3*a, "mballverts");
dl->nors= no= MEM_mallocN(sizeof(float)*3*a, "mballnors");
- for(a=0; a<mbproc.vertices.count; a++, no+=3, ve+=3) {
+ for (a=0; a<mbproc.vertices.count; a++, no+=3, ve+=3) {
ve[0]= mbproc.vertices.ptr[a].position.x;
ve[1]= mbproc.vertices.ptr[a].position.y;
ve[2]= mbproc.vertices.ptr[a].position.z;
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index c9b73376a3d..ea061c99156 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;
@@ -303,28 +303,36 @@ const char *mesh_cmp(Mesh *me1, Mesh *me2, float thresh)
return NULL;
}
-static void mesh_ensure_tesselation_customdata(Mesh *me)
+static void mesh_ensure_tessellation_customdata(Mesh *me)
{
- const int tottex_original = CustomData_number_of_layers(&me->pdata, CD_MTEXPOLY);
- const int totcol_original = CustomData_number_of_layers(&me->ldata, CD_MLOOPCOL);
+ if (UNLIKELY((me->totface != 0) && (me->totpoly == 0))) {
+ /* Pass, otherwise this function clears 'mface' before
+ * versioning 'mface -> mpoly' code kicks in [#30583]
+ *
+ * Callers could also check but safer to do here - campbell */
+ }
+ else {
+ const int tottex_original = CustomData_number_of_layers(&me->pdata, CD_MTEXPOLY);
+ const int totcol_original = CustomData_number_of_layers(&me->ldata, CD_MLOOPCOL);
- const int tottex_tessface = CustomData_number_of_layers(&me->fdata, CD_MTFACE);
- const int totcol_tessface = CustomData_number_of_layers(&me->fdata, CD_MCOL);
+ const int tottex_tessface = CustomData_number_of_layers(&me->fdata, CD_MTFACE);
+ const int totcol_tessface = CustomData_number_of_layers(&me->fdata, CD_MCOL);
- if (tottex_tessface != tottex_original ||
- totcol_tessface != totcol_original )
- {
- BKE_mesh_tessface_clear(me);
+ if (tottex_tessface != tottex_original ||
+ totcol_tessface != totcol_original )
+ {
+ BKE_mesh_tessface_clear(me);
- CustomData_from_bmeshpoly(&me->fdata, &me->pdata, &me->ldata, me->totface);
+ CustomData_from_bmeshpoly(&me->fdata, &me->pdata, &me->ldata, me->totface);
- /* note: this warning may be un-called for if we are inirializing the mesh for the
- * first time from bmesh, rather then giving a warning about this we could be smarter
- * and check if there was any data to begin with, for now just print the warning with
- * some info to help troubleshoot whats going on - campbell */
- printf("%s: warning! Tesselation uvs or vcol data got out of sync, "
- "had to reset!\n CD_MTFACE: %d != CD_MTEXPOLY: %d || CD_MCOL: %d != CD_MLOOPCOL: %d\n",
- __func__, tottex_tessface, tottex_original, totcol_tessface, totcol_original);
+ /* note: this warning may be un-called for if we are inirializing the mesh for the
+ * first time from bmesh, rather then giving a warning about this we could be smarter
+ * and check if there was any data to begin with, for now just print the warning with
+ * some info to help troubleshoot whats going on - campbell */
+ printf("%s: warning! Tessellation uvs or vcol data got out of sync, "
+ "had to reset!\n CD_MTFACE: %d != CD_MTEXPOLY: %d || CD_MCOL: %d != CD_MLOOPCOL: %d\n",
+ __func__, tottex_tessface, tottex_original, totcol_tessface, totcol_original);
+ }
}
}
@@ -332,7 +340,7 @@ static void mesh_ensure_tesselation_customdata(Mesh *me)
* mloopcol and mcol) have the same relative active/render/clone/mask indices.
*
* note that for undo mesh data we want to skip 'ensure_tess_cd' call since
- * we dont want to store memory for tessface when its only used for older
+ * we don't want to store memory for tessface when its only used for older
* versions of the mesh. - campbell*/
static void mesh_update_linked_customdata(Mesh *me, const short do_ensure_tess_cd)
{
@@ -340,7 +348,7 @@ static void mesh_update_linked_customdata(Mesh *me, const short do_ensure_tess_c
BMEdit_UpdateLinkedCustomData(me->edit_btmesh);
if (do_ensure_tess_cd) {
- mesh_ensure_tesselation_customdata(me);
+ mesh_ensure_tessellation_customdata(me);
}
CustomData_bmesh_update_active_layers(&me->fdata, &me->pdata, &me->ldata);
@@ -438,8 +446,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 +460,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 +495,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 +507,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++) {
@@ -526,9 +554,9 @@ BMesh *BKE_mesh_to_bmesh(Mesh *me, Object *ob)
{
BMesh *bm;
- bm = BM_mesh_create(ob, bm_mesh_allocsize_default);
+ bm = BM_mesh_create(&bm_mesh_allocsize_default);
- BMO_op_callf(bm, "mesh_to_bmesh mesh=%p object=%p set_shapekey=%b", me, ob, TRUE);
+ BM_mesh_bm_from_me(bm, me, TRUE, ob->shapenr);
return bm;
}
@@ -547,9 +575,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 +588,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 +762,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 */
@@ -1000,45 +1024,139 @@ void make_edges(Mesh *me, int old)
mesh_strip_loose_faces(me);
}
+/* We need to keep this for edge creation (for now?), and some old readfile code... */
void mesh_strip_loose_faces(Mesh *me)
{
- int a,b;
+ MFace *f;
+ int a, b;
- for (a=b=0; a<me->totface; a++) {
- if (me->mface[a].v3) {
- if (a!=b) {
- memcpy(&me->mface[b],&me->mface[a],sizeof(me->mface[b]));
+ for (a = b = 0, f = me->mface; a < me->totface; a++, f++) {
+ if (f->v3) {
+ if (a != b) {
+ memcpy(&me->mface[b], f, sizeof(me->mface[b]));
CustomData_copy_data(&me->fdata, &me->fdata, a, b, 1);
- CustomData_free_elem(&me->fdata, a, 1);
}
b++;
}
}
- me->totface = b;
+ if (a != b) {
+ CustomData_free_elem(&me->fdata, b, a - b);
+ me->totface = b;
+ }
+}
+
+/* Works on both loops and polys! */
+/* Note: It won't try to guess which loops of an invalid poly to remove!
+ * this is the work of the caller, to mark those loops...
+ * See e.g. BKE_mesh_validate_arrays(). */
+void mesh_strip_loose_polysloops(Mesh *me)
+{
+ MPoly *p;
+ MLoop *l;
+ int a, b;
+ /* New loops idx! */
+ int *new_idx = MEM_mallocN(sizeof(int) * me->totloop, "strip_loose_polysloops old2new idx mapping for polys.");
+
+ for (a = b = 0, p = me->mpoly; a < me->totpoly; a++, p++) {
+ int invalid = FALSE;
+ int i = p->loopstart;
+ int stop = i + p->totloop;
+
+ if (stop > me->totloop || stop < i) {
+ invalid = TRUE;
+ }
+ else {
+ l = &me->mloop[i];
+ i = stop - i;
+ /* If one of the poly's loops is invalid, the whole poly is invalid! */
+ for (; i--; l++) {
+ if (l->e == INVALID_LOOP_EDGE_MARKER) {
+ invalid = TRUE;
+ break;
+ }
+ }
+ }
+
+ if (p->totloop >= 3 && !invalid) {
+ if (a != b) {
+ memcpy(&me->mpoly[b], p, sizeof(me->mpoly[b]));
+ CustomData_copy_data(&me->pdata, &me->pdata, a, b, 1);
+ }
+ b++;
+ }
+ }
+ if (a != b) {
+ CustomData_free_elem(&me->pdata, b, a - b);
+ me->totpoly = b;
+ }
+
+ /* And now, get rid of invalid loops. */
+ for (a = b = 0, l = me->mloop; a < me->totloop; a++, l++) {
+ if (l->e != INVALID_LOOP_EDGE_MARKER) {
+ if (a != b) {
+ memcpy(&me->mloop[b], l, sizeof(me->mloop[b]));
+ CustomData_copy_data(&me->ldata, &me->ldata, a, b, 1);
+ }
+ new_idx[a] = b;
+ b++;
+ }
+ else {
+ /* XXX Theorically, we should be able to not do this, as no remaining poly
+ * should use any stripped loop. But for security's sake... */
+ new_idx[a] = -a;
+ }
+ }
+ if (a != b) {
+ CustomData_free_elem(&me->ldata, b, a - b);
+ me->totloop = b;
+ }
+
+ /* And now, update polys' start loop index. */
+ /* Note: At this point, there should never be any poly using a striped loop! */
+ for (a = 0, p = me->mpoly; a < me->totpoly; a++, p++) {
+ p->loopstart = new_idx[p->loopstart];
+ }
}
void mesh_strip_loose_edges(Mesh *me)
{
- int a,b;
+ MEdge *e;
+ MLoop *l;
+ int a, b;
+ unsigned int *new_idx = MEM_mallocN(sizeof(int) * me->totedge, "strip_loose_edges old2new idx mapping for loops.");
- for (a=b=0; a<me->totedge; a++) {
- if (me->medge[a].v1!=me->medge[a].v2) {
- if (a!=b) {
- memcpy(&me->medge[b],&me->medge[a],sizeof(me->medge[b]));
+ for (a = b = 0, e = me->medge; a < me->totedge; a++, e++) {
+ if (e->v1 != e->v2) {
+ if (a != b) {
+ memcpy(&me->medge[b], e, sizeof(me->medge[b]));
CustomData_copy_data(&me->edata, &me->edata, a, b, 1);
- CustomData_free_elem(&me->edata, a, 1);
}
+ new_idx[a] = b;
b++;
}
+ else {
+ new_idx[a] = INVALID_LOOP_EDGE_MARKER;
+ }
+ }
+ if (a != b) {
+ CustomData_free_elem(&me->edata, b, a - b);
+ me->totedge = b;
+ }
+
+ /* And now, update loops' edge indices. */
+ /* XXX We hope no loop was pointing to a striped edge!
+ * Else, its e will be set to INVALID_LOOP_EDGE_MARKER :/ */
+ for (a = 0, l = me->mloop; a < me->totloop; a++, l++) {
+ l->e = new_idx[l->e];
}
- me->totedge = b;
}
void mball_to_mesh(ListBase *lb, Mesh *me)
{
DispList *dl;
MVert *mvert;
- MFace *mface;
+ MLoop *mloop, *allloop;
+ MPoly *mpoly;
float *nors, *verts;
int a, *index;
@@ -1046,13 +1164,14 @@ void mball_to_mesh(ListBase *lb, Mesh *me)
if (dl==NULL) return;
if (dl->type==DL_INDEX4) {
- me->totvert= dl->nr;
- me->totface= dl->parts;
-
mvert= CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, dl->nr);
- mface= CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, dl->parts);
+ allloop= mloop= CustomData_add_layer(&me->ldata, CD_MLOOP, CD_CALLOC, NULL, dl->parts * 4);
+ mpoly= CustomData_add_layer(&me->pdata, CD_MPOLY, CD_CALLOC, NULL, dl->parts);
me->mvert= mvert;
- me->mface= mface;
+ me->mloop= mloop;
+ me->mpoly= mpoly;
+ me->totvert= dl->nr;
+ me->totpoly= dl->parts;
a= dl->nr;
nors= dl->nors;
@@ -1068,25 +1187,30 @@ void mball_to_mesh(ListBase *lb, Mesh *me)
a= dl->parts;
index= dl->index;
while (a--) {
- mface->v1= index[0];
- mface->v2= index[1];
- mface->v3= index[2];
- mface->v4= index[3];
- mface->flag= ME_SMOOTH;
+ int count= index[2] != index[3] ? 4 : 3;
+
+ mloop[0].v= index[0];
+ mloop[1].v= index[1];
+ mloop[2].v= index[2];
+ if (count == 4)
+ mloop[3].v= index[3];
+
+ mpoly->totloop= count;
+ mpoly->loopstart= (int)(mloop - allloop);
+ mpoly->flag= ME_SMOOTH;
- test_index_face(mface, NULL, 0, (mface->v3==mface->v4)? 3: 4);
- mface++;
+ mpoly++;
+ mloop+= count;
+ me->totloop+= count;
index+= 4;
}
- make_edges(me, 0); // all edges
-
+ mesh_update_customdata_pointers(me, TRUE);
- /* BMESH_TODO - low priority, should make polygons instead */
- convert_mfaces_to_mpolys(me);
+ mesh_calc_normals(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL);
- mesh_update_customdata_pointers(me, TRUE);
+ BKE_mesh_calc_edges(me, TRUE);
}
}
@@ -1359,7 +1483,8 @@ void nurbs_to_mesh(Object *ob)
mesh_calc_normals(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL);
BKE_mesh_calc_edges(me, TRUE);
- } else {
+ }
+ else {
me= add_mesh("Mesh");
DM_to_mesh(dm, me, ob);
}
@@ -1449,7 +1574,8 @@ void mesh_to_curve(Scene *scene, Object *ob)
BLI_edgehash_insert(eh, mf->v3, mf->v4, NULL);
if (!BLI_edgehash_haskey(eh, mf->v4, mf->v1))
BLI_edgehash_insert(eh, mf->v4, mf->v1, NULL);
- } else {
+ }
+ else {
if (!BLI_edgehash_haskey(eh, mf->v3, mf->v1))
BLI_edgehash_insert(eh, mf->v3, mf->v1, NULL);
}
@@ -1613,7 +1739,8 @@ void mesh_set_smooth_flag(Object *meshOb, int enableSmooth)
if (enableSmooth) {
mp->flag |= ME_SMOOTH;
- } else {
+ }
+ else {
mp->flag &= ~ME_SMOOTH;
}
}
@@ -1623,7 +1750,8 @@ void mesh_set_smooth_flag(Object *meshOb, int enableSmooth)
if (enableSmooth) {
mf->flag |= ME_SMOOTH;
- } else {
+ }
+ else {
mf->flag &= ~ME_SMOOTH;
}
}
@@ -1688,7 +1816,7 @@ void mesh_calc_normals_mapping_ex(MVert *mverts, int numVerts,
}
else {
/* eek, we're not corresponding to polys */
- printf("error in mesh_calc_normals; tesselation face indices are incorrect. normals may look bad.\n");
+ printf("error in mesh_calc_normals; tessellation face indices are incorrect. normals may look bad.\n");
}
}
}
@@ -1833,11 +1961,11 @@ static void bm_corners_to_loops(Mesh *me, int findex, int loopstart, int numTex,
mloopcol = CustomData_get_n(&me->ldata, CD_MLOOPCOL, loopstart, i);
mcol = CustomData_get_n(&me->fdata, CD_MCOL, findex, i);
- mloopcol->r = mcol[0].r; mloopcol->g = mcol[0].g; mloopcol->b = mcol[0].b; mloopcol->a = mcol[0].a; mloopcol++;
- mloopcol->r = mcol[1].r; mloopcol->g = mcol[1].g; mloopcol->b = mcol[1].b; mloopcol->a = mcol[1].a; mloopcol++;
- mloopcol->r = mcol[2].r; mloopcol->g = mcol[2].g; mloopcol->b = mcol[2].b; mloopcol->a = mcol[2].a; mloopcol++;
+ MESH_MLOOPCOL_FROM_MCOL(mloopcol, &mcol[0]); mloopcol++;
+ MESH_MLOOPCOL_FROM_MCOL(mloopcol, &mcol[1]); mloopcol++;
+ MESH_MLOOPCOL_FROM_MCOL(mloopcol, &mcol[2]); mloopcol++;
if (mf->v4) {
- mloopcol->r = mcol[3].r; mloopcol->g = mcol[3].g; mloopcol->b = mcol[3].b; mloopcol->a = mcol[3].a; mloopcol++;
+ MESH_MLOOPCOL_FROM_MCOL(mloopcol, &mcol[3]); mloopcol++;
}
}
@@ -1852,8 +1980,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 {
@@ -1861,6 +1989,7 @@ static void bm_corners_to_loops(Mesh *me, int findex, int loopstart, int numTex,
for (i=0; i<tot; i++, disps += side*side, ld++) {
ld->totdisp = side*side;
+ ld->level = (int)(logf(side - 1.0f) / M_LN2) + 1;
if (ld->disps)
MEM_freeN(ld->disps);
@@ -1874,7 +2003,7 @@ static void bm_corners_to_loops(Mesh *me, int findex, int loopstart, int numTex,
}
}
-void convert_mfaces_to_mpolys(Mesh *mesh)
+void BKE_mesh_convert_mfaces_to_mpolys(Mesh *mesh)
{
MFace *mf;
MLoop *ml;
@@ -1884,6 +2013,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);
@@ -1931,7 +2066,8 @@ void convert_mfaces_to_mpolys(Mesh *mesh)
if (mf->v4) {
ML(v3, v4);
ML(v4, v1);
- } else {
+ }
+ else {
ML(v3, v1);
}
@@ -1940,7 +2076,7 @@ void convert_mfaces_to_mpolys(Mesh *mesh)
bm_corners_to_loops(mesh, i, mp->loopstart, numTex, numCol);
}
- /* note, we dont convert FGons at all, these are not even real ngons,
+ /* note, we don't convert FGons at all, these are not even real ngons,
* they have their own UV's, colors etc - its more an editing feature. */
mesh_update_customdata_pointers(mesh, TRUE);
@@ -1961,7 +2097,7 @@ float (*mesh_getVertexCos(Mesh *me, int *numVerts_r))[3]
}
-/* ngon version wip, based on EDBM_make_uv_vert_map */
+/* ngon version wip, based on EDBM_uv_vert_map_create */
/* this replaces the non bmesh function (in trunk) which takes MTFace's, if we ever need it back we could
* but for now this replaces it because its unused. */
@@ -2071,34 +2207,52 @@ 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. */
-void create_vert_poly_map(ListBase **map, IndexNode **mem,
- MPoly *mpoly, MLoop *mloop,
- const int totvert, const int totpoly, const int totloop)
+ * of polys that use that vertex as a corner. The lists are allocated
+ * from one memory pool. */
+void create_vert_poly_map(MeshElemMap **map, int **mem,
+ const MPoly *mpoly, const MLoop *mloop,
+ int totvert, int totpoly, int totloop)
{
- int i,j;
- IndexNode *node = NULL;
- MPoly *mp;
- MLoop *ml;
+ int i, j;
+ int *indices;
- (*map) = MEM_callocN(sizeof(ListBase) * totvert, "vert face map");
- (*mem) = MEM_callocN(sizeof(IndexNode) * totloop, "vert poly map mem");
- node = *mem;
+ (*map) = MEM_callocN(sizeof(MeshElemMap) * totvert, "vert poly map");
+ (*mem) = MEM_mallocN(sizeof(int) * totloop, "vert poly map mem");
+ /* Count number of polys for each vertex */
+ for (i = 0; i < totpoly; i++) {
+ const MPoly *p = &mpoly[i];
+
+ for (j = 0; j < p->totloop; j++)
+ (*map)[mloop[p->loopstart + j].v].count++;
+ }
+
+ /* Assign indices mem */
+ indices = (*mem);
+ for (i = 0; i < totvert; i++) {
+ (*map)[i].indices = indices;
+ indices += (*map)[i].count;
+
+ /* Reset 'count' for use as index in last loop */
+ (*map)[i].count = 0;
+ }
+
/* Find the users */
- for (i = 0, mp = mpoly; i < totpoly; ++i, ++mp) {
- ml = &mloop[mp->loopstart];
- for (j = 0; j < mp->totloop; ++j, ++node, ++ml) {
- node->index = i;
- BLI_addtail(&(*map)[ml->v], node);
+ for (i = 0; i < totpoly; i++) {
+ const MPoly *p = &mpoly[i];
+
+ for (j = 0; j < p->totloop; j++) {
+ int v = mloop[p->loopstart + j].v;
+
+ (*map)[v].indices[(*map)[v].count] = i;
+ (*map)[v].count++;
}
}
}
/* 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;
@@ -2125,7 +2279,7 @@ void mesh_loops_to_mface_corners(CustomData *fdata, CustomData *ldata,
/* cache values to avoid lookups every time */
const int numTex, /* CustomData_number_of_layers(pdata, CD_MTEXPOLY) */
const int numCol, /* CustomData_number_of_layers(ldata, CD_MLOOPCOL) */
- const int hasWCol, /* CustomData_has_layer(ldata, CD_WEIGHT_MLOOPCOL) */
+ const int hasPCol, /* CustomData_has_layer(ldata, CD_PREVIEW_MLOOPCOL) */
const int hasOrigSpace /* CustomData_has_layer(ldata, CD_ORIGSPACE_MLOOP) */
)
{
@@ -2153,22 +2307,16 @@ void mesh_loops_to_mface_corners(CustomData *fdata, CustomData *ldata,
for (j=0; j < mf_len; j++) {
mloopcol = CustomData_get_n(ldata, CD_MLOOPCOL, lindex[j], i);
- mcol[j].r = mloopcol->r;
- mcol[j].g = mloopcol->g;
- mcol[j].b = mloopcol->b;
- mcol[j].a = mloopcol->a;
+ MESH_MLOOPCOL_TO_MCOL(mloopcol, &mcol[j]);
}
}
- if (hasWCol) {
- mcol = CustomData_get(fdata, findex, CD_WEIGHT_MCOL);
+ if (hasPCol) {
+ mcol = CustomData_get(fdata, findex, CD_PREVIEW_MCOL);
for (j=0; j < mf_len; j++) {
- mloopcol = CustomData_get(ldata, lindex[j], CD_WEIGHT_MLOOPCOL);
- mcol[j].r = mloopcol->r;
- mcol[j].g = mloopcol->g;
- mcol[j].b = mloopcol->b;
- mcol[j].a = mloopcol->a;
+ mloopcol = CustomData_get(ldata, lindex[j], CD_PREVIEW_MLOOPCOL);
+ MESH_MLOOPCOL_TO_MCOL(mloopcol, &mcol[j]);
}
}
@@ -2178,21 +2326,20 @@ void mesh_loops_to_mface_corners(CustomData *fdata, CustomData *ldata,
for (j=0; j < mf_len; j++) {
lof = CustomData_get(ldata, lindex[j], CD_ORIGSPACE_MLOOP);
- of->uv[j][0] = lof->uv[0];
- of->uv[j][1] = lof->uv[1];
+ copy_v2_v2(of->uv[j], lof->uv);
}
}
}
/*
- this function recreates a tesselation.
- returns number of tesselation faces.
+ * this function recreates a tessellation.
+ * returns number of tessellation faces.
*/
-int mesh_recalcTesselation(CustomData *fdata,
+int mesh_recalcTessellation(CustomData *fdata,
CustomData *ldata, CustomData *pdata,
MVert *mvert, int totface, int UNUSED(totloop),
int totpoly,
- /* when teseelating to recalcilate normals after
+ /* when tessellating to recalculate normals after
* we can skip copying here */
const int do_face_nor_cpy)
{
@@ -2222,7 +2369,7 @@ int mesh_recalcTesselation(CustomData *fdata,
const int numTex = CustomData_number_of_layers(pdata, CD_MTEXPOLY);
const int numCol = CustomData_number_of_layers(ldata, CD_MLOOPCOL);
- const int hasWCol = CustomData_has_layer(ldata, CD_WEIGHT_MLOOPCOL);
+ const int hasPCol = CustomData_has_layer(ldata, CD_PREVIEW_MLOOPCOL);
const int hasOrigSpace = CustomData_has_layer(ldata, CD_ORIGSPACE_MLOOP);
mpoly = CustomData_get_layer(pdata, CD_MPOLY);
@@ -2259,6 +2406,7 @@ int mesh_recalcTesselation(CustomData *fdata,
BLI_array_append(mface_orig_index, \
poly_orig_index[poly_index]); \
} \
+ (void)0
/* ALMOST IDENTICAL TO DEFINE ABOVE (see EXCEPTION) */
#define ML_TO_MF_QUAD() \
@@ -2278,23 +2426,21 @@ int mesh_recalcTesselation(CustomData *fdata,
poly_orig_index[poly_index]); \
} \
mf->edcode |= TESSFACE_IS_QUAD; /* EXCEPTION */ \
+ (void)0
else if (mp->totloop == 3) {
- ml = mloop + mp->loopstart;
- ML_TO_MF(0, 1, 2)
+ 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()
+ ML_TO_MF_QUAD();
mface_index++;
#else
- ml = mloop + mp->loopstart;
- ML_TO_MF(0, 1, 2)
+ ML_TO_MF(0, 1, 2);
mface_index++;
- ML_TO_MF(0, 2, 3)
+ ML_TO_MF(0, 2, 3);
mface_index++;
#endif
}
@@ -2343,7 +2489,7 @@ int mesh_recalcTesselation(CustomData *fdata,
mf->flag = mp->flag;
#ifdef USE_TESSFACE_SPEEDUP
- mf->edcode |= TESSFACE_SCANFILL; /* tag for sorting loop indicies */
+ mf->edcode |= TESSFACE_SCANFILL; /* tag for sorting loop indices */
#endif
if (poly_orig_index) {
@@ -2375,12 +2521,12 @@ int mesh_recalcTesselation(CustomData *fdata,
CustomData_add_layer(fdata, CD_MFACE, CD_ASSIGN, mface, totface);
/* CD_POLYINDEX will contain an array of indices from tessfaces to the polygons
- * they are directly tesselated from */
+ * they are directly tessellated from */
CustomData_add_layer(fdata, CD_POLYINDEX, CD_ASSIGN, mface_to_poly_map, totface);
if (mface_orig_index) {
- /* If polys had a CD_ORIGINDEX layer, then the tesselated faces will get this
+ /* If polys had a CD_ORIGINDEX layer, then the tessellated faces will get this
* layer as well, pointing to polys from the original mesh (not the polys
- * that just got tesselated) */
+ * that just got tessellated) */
CustomData_add_layer(fdata, CD_ORIGINDEX, CD_ASSIGN, mface_orig_index, totface);
}
@@ -2448,7 +2594,7 @@ int mesh_recalcTesselation(CustomData *fdata,
#else
3,
#endif
- numTex, numCol, hasWCol, hasOrigSpace);
+ numTex, numCol, hasPCol, hasOrigSpace);
#ifdef USE_TESSFACE_QUADS
@@ -2467,8 +2613,8 @@ int mesh_recalcTesselation(CustomData *fdata,
#ifdef USE_BMESH_SAVE_AS_COMPAT
/*
- * this function recreates a tesselation.
- * returns number of tesselation faces.
+ * this function recreates a tessellation.
+ * returns number of tessellation faces.
*/
int mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
struct CustomData *pdata, int totface, int UNUSED(totloop), int totpoly)
@@ -2485,7 +2631,7 @@ int mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
const int numTex = CustomData_number_of_layers(pdata, CD_MTEXPOLY);
const int numCol = CustomData_number_of_layers(ldata, CD_MLOOPCOL);
- const int hasWCol = CustomData_has_layer(ldata, CD_WEIGHT_MLOOPCOL);
+ const int hasPCol = CustomData_has_layer(ldata, CD_PREVIEW_MLOOPCOL);
const int hasOrigSpace = CustomData_has_layer(ldata, CD_ORIGSPACE_MLOOP);
mpoly = CustomData_get_layer(pdata, CD_MPOLY);
@@ -2544,7 +2690,7 @@ int mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
mesh_loops_to_mface_corners(fdata, ldata, pdata,
lindex, k, i, 3,
- numTex, numCol, hasWCol, hasOrigSpace);
+ numTex, numCol, hasPCol, hasOrigSpace);
test_index_face(mf, fdata, k, 3);
}
else {
@@ -2564,7 +2710,7 @@ int mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
mesh_loops_to_mface_corners(fdata, ldata, pdata,
lindex, k, i, 4,
- numTex, numCol, hasWCol, hasOrigSpace);
+ numTex, numCol, hasPCol, hasOrigSpace);
test_index_face(mf, fdata, k, 4);
}
@@ -2585,7 +2731,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 +2746,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 +2758,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]);
@@ -2637,7 +2783,8 @@ static void mesh_calc_ngon_normal(MPoly *mpoly, MLoop *loopstart,
normal[2] = 1.0f;
return;
- } else l = 1.0f / l;
+ }
+ else l = 1.0f / l;
n[0] *= l;
n[1] *= l;
@@ -2690,9 +2837,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) {
@@ -2715,7 +2862,10 @@ static void mesh_calc_ngon_normal_coords(MPoly *mpoly, MLoop *loopstart,
normal[2] = 1.0f;
return;
- } else l = 1.0f / l;
+ }
+ else {
+ l = 1.0f / l;
+ }
n[0] *= l;
n[1] *= l;
@@ -2834,7 +2984,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 +2998,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)
{
@@ -2857,7 +3007,7 @@ int poly_get_adj_loops_from_vert(unsigned adj_r[3], const MPoly *poly,
&mloop[poly->loopstart],
vert);
- if(corner != -1) {
+ if (corner != -1) {
const MLoop *ml = &mloop[poly->loopstart + corner];
/* vertex was found */
@@ -2869,6 +3019,33 @@ int poly_get_adj_loops_from_vert(unsigned adj_r[3], const MPoly *poly,
return corner;
}
+/* update the hide flag for edges and faces from the corresponding
+ flag in verts */
+void mesh_flush_hidden_from_verts(const MVert *mvert,
+ const MLoop *mloop,
+ MEdge *medge, int totedge,
+ MPoly *mpoly, int totpoly)
+{
+ int i, j;
+
+ for (i = 0; i < totedge; i++) {
+ MEdge *e = &medge[i];
+ if (mvert[e->v1].flag & ME_HIDE ||
+ mvert[e->v2].flag & ME_HIDE)
+ e->flag |= ME_HIDE;
+ else
+ e->flag &= ~ME_HIDE;
+ }
+ for (i = 0; i < totpoly; i++) {
+ MPoly *p = &mpoly[i];
+ p->flag &= ~ME_HIDE;
+ for (j = 0; j < p->totloop; j++) {
+ if (mvert[mloop[p->loopstart + j].v].flag & ME_HIDE)
+ p->flag |= ME_HIDE;
+ }
+ }
+}
+
/* basic vertex data functions */
int minmax_mesh(Mesh *me, float min[3], float max[3])
{
@@ -2934,7 +3111,7 @@ void BKE_mesh_ensure_navmesh(Mesh *me)
if (!CustomData_has_layer(&me->pdata, CD_RECAST)) {
int i;
int numFaces = me->totpoly;
- int* recastData;
+ int *recastData;
CustomData_add_layer_named(&me->pdata, CD_RECAST, CD_CALLOC, NULL, numFaces, "recastData");
recastData = (int*)CustomData_get_layer(&me->pdata, CD_RECAST);
for (i=0; i<numFaces; i++) {
@@ -2946,10 +3123,10 @@ void BKE_mesh_ensure_navmesh(Mesh *me)
void BKE_mesh_tessface_calc(Mesh *mesh)
{
- mesh->totface = mesh_recalcTesselation(&mesh->fdata, &mesh->ldata, &mesh->pdata,
+ mesh->totface = mesh_recalcTessellation(&mesh->fdata, &mesh->ldata, &mesh->pdata,
mesh->mvert,
mesh->totface, mesh->totloop, mesh->totpoly,
- /* calc normals right after, dont copy from polys here */
+ /* calc normals right after, don't copy from polys here */
FALSE);
mesh_update_customdata_pointers(mesh, TRUE);
@@ -2964,12 +3141,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..cd49002a351 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -33,111 +33,91 @@
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
+#include "DNA_object_types.h"
#include "BLO_sys_types.h"
-#include "BLI_utildefines.h"
#include "BLI_edgehash.h"
#include "BLI_math_base.h"
+#include "BLI_utildefines.h"
+#include "BKE_deform.h"
+#include "BKE_depsgraph.h"
#include "BKE_DerivedMesh.h"
+#include "BKE_mesh.h"
#include "MEM_guardedalloc.h"
-#include "BKE_mesh.h"
-#include "BKE_deform.h"
-
#define SELECT 1
-typedef union {
- uint32_t verts[2];
- int64_t edval;
-} EdgeUUID;
-
-typedef struct SortFace {
-// unsigned int v[4];
- EdgeUUID es[4];
- unsigned int index;
-} SortFace;
-
-static void edge_store_assign(uint32_t verts[2], const uint32_t v1, const uint32_t v2)
+/* Used to detect polys (faces) using exactly the same vertices. */
+/* Used to detect loops used by no (disjoint) or more than one (intersect) polys. */
+typedef struct SortPoly {
+ int *verts;
+ int numverts;
+ int loopstart;
+ unsigned int index;
+ int invalid; /* Poly index. */
+} SortPoly;
+
+/* TODO check there is not some standard define of this somewhere! */
+static int int_cmp(const void *v1, const void *v2)
{
- if(v1 < v2) {
- verts[0]= v1;
- verts[1]= v2;
- }
- else {
- verts[0]= v2;
- verts[1]= v1;
- }
+ return *(int*)v1 > *(int*)v2 ? 1 : *(int*)v1 < *(int*)v2 ? -1 : 0;
}
-static void edge_store_from_mface_quad(EdgeUUID es[4], MFace *mf)
+static int search_poly_cmp(const void *v1, const void *v2)
{
- edge_store_assign(es[0].verts, mf->v1, mf->v2);
- edge_store_assign(es[1].verts, mf->v2, mf->v3);
- edge_store_assign(es[2].verts, mf->v3, mf->v4);
- edge_store_assign(es[3].verts, mf->v4, mf->v1);
+ const SortPoly *sp1 = v1, *sp2 = v2;
+ const int max_idx = sp1->numverts > sp2->numverts ? sp2->numverts : sp1->numverts;
+ int idx = 0;
+
+ /* Reject all invalid polys at end of list! */
+ if (sp1->invalid || sp2->invalid)
+ return sp1->invalid && sp2->invalid ? 0 : sp1->invalid ? 1 : -1;
+ /* Else, sort on first non-egal verts (remember verts of valid polys are sorted). */
+ while (idx < max_idx && sp1->verts[idx] == sp2->verts[idx])
+ idx++;
+ return sp1->verts[idx] > sp2->verts[idx] ? 1 : sp1->verts[idx] < sp2->verts[idx] ? -1 :
+ sp1->numverts > sp2->numverts ? 1 : sp1->numverts < sp2->numverts ? -1 : 0;
}
-static void edge_store_from_mface_tri(EdgeUUID es[4], MFace *mf)
+static int search_polyloop_cmp(const void *v1, const void *v2)
{
- edge_store_assign(es[0].verts, mf->v1, mf->v2);
- edge_store_assign(es[1].verts, mf->v2, mf->v3);
- edge_store_assign(es[2].verts, mf->v3, mf->v1);
- es[3].verts[0] = es[3].verts[1] = UINT_MAX;
-}
-
-static int int64_cmp(const void *v1, const void *v2)
-{
- const int64_t x1= *(const int64_t *)v1;
- const int64_t x2= *(const int64_t *)v2;
-
- if( x1 > x2 ) return 1;
- else if( x1 < x2 ) return -1;
- return 0;
-}
-
-static int search_face_cmp(const void *v1, const void *v2)
-{
- const SortFace *sfa= v1, *sfb= v2;
-
- if (sfa->es[0].edval > sfb->es[0].edval) return 1;
- else if (sfa->es[0].edval < sfb->es[0].edval) return -1;
-
- else if (sfa->es[1].edval > sfb->es[1].edval) return 1;
- else if (sfa->es[1].edval < sfb->es[1].edval) return -1;
-
- else if (sfa->es[2].edval > sfb->es[2].edval) return 1;
- else if (sfa->es[2].edval < sfb->es[2].edval) return -1;
-
- else if (sfa->es[3].edval > sfb->es[3].edval) return 1;
- else if (sfa->es[3].edval < sfb->es[3].edval) return -1;
- else return 0;
+ const SortPoly *sp1 = v1, *sp2 = v2;
+ /* Reject all invalid polys at end of list! */
+ if (sp1->invalid || sp2->invalid)
+ return sp1->invalid && sp2->invalid ? 0 : sp1->invalid ? 1 : -1;
+ /* Else, sort on loopstart. */
+ return sp1->loopstart > sp2->loopstart ? 1 : sp1->loopstart < sp2->loopstart ? -1 : 0;
}
-#define PRINT if(do_verbose) printf
+#define PRINT if (do_verbose) printf
-int BKE_mesh_validate_arrays( Mesh *me,
- MVert *mverts, unsigned int totvert,
- MEdge *medges, unsigned int totedge,
- MFace *mfaces, unsigned int totface,
- MDeformVert *dverts, /* assume totvert length */
- const short do_verbose, const short do_fixes)
+int BKE_mesh_validate_arrays(Mesh *mesh,
+ MVert *mverts, unsigned int totvert,
+ MEdge *medges, unsigned int totedge,
+ MLoop *mloops, unsigned int totloop,
+ MPoly *mpolys, unsigned int totpoly,
+ MDeformVert *dverts, /* assume totvert length */
+ const short do_verbose, const short do_fixes)
{
-# define REMOVE_EDGE_TAG(_med) { _med->v2= _med->v1; do_edge_free= 1; }
-# define REMOVE_FACE_TAG(_mf) { _mf->v3=0; do_face_free= 1; }
+# define REMOVE_EDGE_TAG(_me) { _me->v2 = _me->v1; do_edge_free = TRUE; }
+# define IS_REMOVED_EDGE(_me) (_me->v2 == _me->v1)
+
+# define REMOVE_LOOP_TAG(_ml) { _ml->e = INVALID_LOOP_EDGE_MARKER; do_polyloop_free = TRUE; }
+# define REMOVE_POLY_TAG(_mp) { _mp->totloop *= -1; do_polyloop_free = TRUE; }
-// MVert *mv;
- MEdge *med;
- MFace *mf;
- MFace *mf_prev;
- MVert *mvert= mverts;
- unsigned int i;
+ MVert *mv = mverts;
+ MEdge *me;
+ MLoop *ml;
+ MPoly *mp;
+ unsigned int i, j;
+ int *v;
- short do_face_free= FALSE;
short do_edge_free= FALSE;
+ short do_polyloop_free= FALSE; /* This regroups loops and polys! */
short verts_fixed= FALSE;
short vert_weights_fixed= FALSE;
@@ -146,189 +126,356 @@ int BKE_mesh_validate_arrays( Mesh *me,
EdgeHash *edge_hash = BLI_edgehash_new();
- SortFace *sort_faces= MEM_callocN(sizeof(SortFace) * totface, "search faces");
- SortFace *sf;
- SortFace *sf_prev;
- unsigned int totsortface= 0;
-
- BLI_assert(!(do_fixes && me == NULL));
+ BLI_assert(!(do_fixes && mesh == NULL));
- PRINT("%s: verts(%u), edges(%u), faces(%u)\n", __func__, totvert, totedge, totface);
+ PRINT("%s: verts(%u), edges(%u), loops(%u), polygons(%u)\n",
+ __func__, totvert, totedge, totloop, totpoly);
- if(totedge == 0 && totface != 0) {
- PRINT(" locical error, %u faces and 0 edges\n", totface);
- do_edge_recalc= TRUE;
+ if (totedge == 0 && totpoly != 0) {
+ PRINT(" logical error, %u polygons and 0 edges\n", totpoly);
+ do_edge_recalc = do_fixes;
}
- for(i=1; i<totvert; i++, mvert++) {
+ for (i=1; i<totvert; i++, mv++) {
int j;
int fix_normal= TRUE;
- for(j=0; j<3; j++) {
- if(!finite(mvert->co[j])) {
+ for (j=0; j<3; j++) {
+ if (!finite(mv->co[j])) {
PRINT(" vertex %u: has invalid coordinate\n", i);
if (do_fixes) {
- zero_v3(mvert->co);
+ zero_v3(mv->co);
verts_fixed= TRUE;
}
}
- if(mvert->no[j]!=0)
+ if (mv->no[j]!=0)
fix_normal= FALSE;
}
- if(fix_normal) {
+ if (fix_normal) {
PRINT(" vertex %u: has zero normal, assuming Z-up normal\n", i);
if (do_fixes) {
- mvert->no[2]= SHRT_MAX;
+ mv->no[2]= SHRT_MAX;
verts_fixed= TRUE;
}
}
}
- for(i=0, med= medges; i<totedge; i++, med++) {
+ for (i=0, me= medges; i<totedge; i++, me++) {
int remove= FALSE;
- if(med->v1 == med->v2) {
- PRINT(" edge %u: has matching verts, both %u\n", i, med->v1);
+ if (me->v1 == me->v2) {
+ PRINT(" edge %u: has matching verts, both %u\n", i, me->v1);
remove= do_fixes;
}
- if(med->v1 >= totvert) {
- PRINT(" edge %u: v1 index out of range, %u\n", i, med->v1);
+ if (me->v1 >= totvert) {
+ PRINT(" edge %u: v1 index out of range, %u\n", i, me->v1);
remove= do_fixes;
}
- if(med->v2 >= totvert) {
- PRINT(" edge %u: v2 index out of range, %u\n", i, med->v2);
+ if (me->v2 >= totvert) {
+ PRINT(" edge %u: v2 index out of range, %u\n", i, me->v2);
remove= do_fixes;
}
- if(BLI_edgehash_haskey(edge_hash, med->v1, med->v2)) {
- PRINT(" edge %u: is a duplicate of, %d\n", i, GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, med->v1, med->v2)));
+ if (BLI_edgehash_haskey(edge_hash, me->v1, me->v2)) {
+ PRINT(" edge %u: is a duplicate of %d\n", i,
+ GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, me->v1, me->v2)));
remove= do_fixes;
}
- if(remove == FALSE) {
- BLI_edgehash_insert(edge_hash, med->v1, med->v2, SET_INT_IN_POINTER(i));
+ if (remove == FALSE) {
+ BLI_edgehash_insert(edge_hash, me->v1, me->v2, SET_INT_IN_POINTER(i));
}
else {
- REMOVE_EDGE_TAG(med);
+ REMOVE_EDGE_TAG(me);
}
}
- for(i=0, mf=mfaces, sf=sort_faces; i<totface; i++, mf++) {
- int remove= FALSE;
- int fidx;
- unsigned int fv[4];
-
- fidx = mf->v4 ? 3:2;
- do {
- fv[fidx]= *(&(mf->v1) + fidx);
- if(fv[fidx] >= totvert) {
- PRINT(" face %u: 'v%d' index out of range, %u\n", i, fidx + 1, fv[fidx]);
- remove= do_fixes;
+ /* Checking loops and polys is a bit tricky, as they are quite intricated...
+ *
+ * Polys must have:
+ * - a valid loopstart value.
+ * - a valid totloop value (>= 3 and loopstart+totloop < me.totloop).
+ *
+ * Loops must have:
+ * - a valid v value.
+ * - a valid e value (corresponding to the edge it defines with the next loop in poly).
+ *
+ * Also, loops not used by polys can be discarded.
+ * And "intersecting" loops (i.e. loops used by more than one poly) are invalid,
+ * so be sure to leave at most one poly/loop!
+ */
+ {
+ SortPoly *sort_polys = MEM_callocN(sizeof(SortPoly) * totpoly, "mesh validate's sort_polys");
+ SortPoly *prev_sp, *sp = sort_polys;
+ int prev_end;
+ for (i = 0, mp = mpolys; i < totpoly; i++, mp++, sp++) {
+ sp->index = i;
+
+ if (mp->loopstart < 0 || mp->totloop < 3) {
+ /* Invalid loop data. */
+ PRINT(" poly %u is invalid (loopstart: %u, totloop: %u)\n", sp->index, mp->loopstart, mp->totloop);
+ sp->invalid = TRUE;
}
- } while (fidx--);
-
- if(remove == FALSE) {
- if(mf->v4) {
- if(mf->v1 == mf->v2) { PRINT(" face %u: verts invalid, v1/v2 both %u\n", i, mf->v1); remove= do_fixes; }
- if(mf->v1 == mf->v3) { PRINT(" face %u: verts invalid, v1/v3 both %u\n", i, mf->v1); remove= do_fixes; }
- if(mf->v1 == mf->v4) { PRINT(" face %u: verts invalid, v1/v4 both %u\n", i, mf->v1); remove= do_fixes; }
-
- if(mf->v2 == mf->v3) { PRINT(" face %u: verts invalid, v2/v3 both %u\n", i, mf->v2); remove= do_fixes; }
- if(mf->v2 == mf->v4) { PRINT(" face %u: verts invalid, v2/v4 both %u\n", i, mf->v2); remove= do_fixes; }
-
- if(mf->v3 == mf->v4) { PRINT(" face %u: verts invalid, v3/v4 both %u\n", i, mf->v3); remove= do_fixes; }
+ else if (mp->loopstart + mp->totloop > totloop) {
+ /* Invalid loop data. */
+ PRINT(" poly %u uses loops out of range (loopstart: %u, loopend: %u, max nbr of loops: %u)\n",
+ sp->index, mp->loopstart, mp->loopstart + mp->totloop - 1, totloop - 1);
+ sp->invalid = TRUE;
}
else {
- if(mf->v1 == mf->v2) { PRINT(" faceT %u: verts invalid, v1/v2 both %u\n", i, mf->v1); remove= do_fixes; }
- if(mf->v1 == mf->v3) { PRINT(" faceT %u: verts invalid, v1/v3 both %u\n", i, mf->v1); remove= do_fixes; }
-
- if(mf->v2 == mf->v3) { PRINT(" faceT %u: verts invalid, v2/v3 both %u\n", i, mf->v2); remove= do_fixes; }
- }
+ /* Poly itself is valid, for now. */
+ int v1, v2; /* v1 is prev loop vert idx, v2 is current loop one. */
+ sp->invalid = FALSE;
+ sp->verts = v = MEM_mallocN(sizeof(int) * mp->totloop, "Vert idx of SortPoly");
+ sp->numverts = mp->totloop;
+ sp->loopstart = mp->loopstart;
+
+ /* Test all poly's loops' vert idx. */
+ for (j = 0, ml = &mloops[sp->loopstart]; j < mp->totloop; j++, ml++, v++) {
+ if (ml->v >= totvert) {
+ /* Invalid vert idx. */
+ PRINT(" loop %u has invalid vert reference (%u)\n", sp->loopstart + j, ml->v);
+ sp->invalid = TRUE;
+ }
+ *v = ml->v;
+ }
- if(remove == FALSE) {
- if(totedge) {
- if(mf->v4) {
- if(!BLI_edgehash_haskey(edge_hash, mf->v1, mf->v2)) { PRINT(" face %u: edge v1/v2 (%u,%u) is missing egde data\n", i, mf->v1, mf->v2); do_edge_recalc= TRUE; }
- if(!BLI_edgehash_haskey(edge_hash, mf->v2, mf->v3)) { PRINT(" face %u: edge v2/v3 (%u,%u) is missing egde data\n", i, mf->v2, mf->v3); do_edge_recalc= TRUE; }
- if(!BLI_edgehash_haskey(edge_hash, mf->v3, mf->v4)) { PRINT(" face %u: edge v3/v4 (%u,%u) is missing egde data\n", i, mf->v3, mf->v4); do_edge_recalc= TRUE; }
- if(!BLI_edgehash_haskey(edge_hash, mf->v4, mf->v1)) { PRINT(" face %u: edge v4/v1 (%u,%u) is missing egde data\n", i, mf->v4, mf->v1); do_edge_recalc= TRUE; }
+ if (sp->invalid)
+ continue;
+
+ /* Test all poly's loops. */
+ for (j = 0, ml = &mloops[sp->loopstart]; j < mp->totloop; j++, ml++) {
+ v1 = ml->v;
+ v2 = mloops[sp->loopstart + (j + 1) % mp->totloop].v;
+ if (!BLI_edgehash_haskey(edge_hash, v1, v2)) {
+ /* Edge not existing. */
+ PRINT(" poly %u needs missing edge (%u, %u)\n", sp->index, v1, v2);
+ if (do_fixes)
+ do_edge_recalc = TRUE;
+ else
+ sp->invalid = TRUE;
+ }
+ else if (ml->e >= totedge) {
+ /* Invalid edge idx.
+ * We already know from previous text that a valid edge exists, use it (if allowed)! */
+ if (do_fixes) {
+ int prev_e = ml->e;
+ ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2));
+ PRINT(" loop %u has invalid edge reference (%u), fixed using edge %u\n",
+ sp->loopstart + j, prev_e, ml->e);
+ }
+ else {
+ PRINT(" loop %u has invalid edge reference (%u)\n", sp->loopstart + j, ml->e);
+ sp->invalid = TRUE;
+ }
}
else {
- if(!BLI_edgehash_haskey(edge_hash, mf->v1, mf->v2)) { PRINT(" face %u: edge v1/v2 (%u,%u) is missing egde data\n", i, mf->v1, mf->v2); do_edge_recalc= TRUE; }
- if(!BLI_edgehash_haskey(edge_hash, mf->v2, mf->v3)) { PRINT(" face %u: edge v2/v3 (%u,%u) is missing egde data\n", i, mf->v2, mf->v3); do_edge_recalc= TRUE; }
- if(!BLI_edgehash_haskey(edge_hash, mf->v3, mf->v1)) { PRINT(" face %u: edge v3/v1 (%u,%u) is missing egde data\n", i, mf->v3, mf->v1); do_edge_recalc= TRUE; }
+ me = &medges[ml->e];
+ if (IS_REMOVED_EDGE(me) || !((me->v1 == v1 && me->v2 == v2) || (me->v1 == v2 && me->v2 == v1))) {
+ /* The pointed edge is invalid (tagged as removed, or vert idx mismatch),
+ * and we already know from previous test that a valid one exists, use it (if allowed)! */
+ if (do_fixes) {
+ int prev_e = ml->e;
+ ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2));
+ PRINT(" poly %u has invalid edge reference (%u), fixed using edge %u\n",
+ sp->index, prev_e, ml->e);
+ }
+ else {
+ PRINT(" poly %u has invalid edge reference (%u)\n", sp->index, ml->e);
+ sp->invalid = TRUE;
+ }
+ }
}
}
- sf->index = i;
-
- if(mf->v4) {
- edge_store_from_mface_quad(sf->es, mf);
+ /* Now check that that poly does not use a same vertex more than once! */
+ if (!sp->invalid) {
+ int *prev_v = v = sp->verts;
+ j = sp->numverts;
+
+ qsort(sp->verts, j, sizeof(int), int_cmp);
+
+ for (j--, v++; j; j--, v++) {
+ if (*v != *prev_v) {
+ int dlt = v - prev_v;
+ if (dlt > 1) {
+ PRINT(" poly %u is invalid, it multi-uses vertex %u (%u times)\n",
+ sp->index, *prev_v, dlt);
+ sp->invalid = TRUE;
+ }
+ prev_v = v;
+ }
+ }
+ if (v - prev_v > 1) { /* Don’t forget final verts! */
+ PRINT(" poly %u is invalid, it multi-uses vertex %u (%u times)\n",
+ sp->index, *prev_v, (int)(v - prev_v));
+ sp->invalid = TRUE;
+ }
+ }
+
+ }
+ }
- qsort(sf->es, 4, sizeof(int64_t), int64_cmp);
+ /* Second check pass, testing polys using the same verts. */
+ qsort(sort_polys, totpoly, sizeof(SortPoly), search_poly_cmp);
+ sp = prev_sp = sort_polys;
+ sp++;
+
+ for (i = 1; i < totpoly; i++, sp++) {
+ int p1_nv = sp->numverts, p2_nv = prev_sp->numverts;
+ int *p1_v = sp->verts, *p2_v = prev_sp->verts;
+ short p1_sub = TRUE, p2_sub = TRUE;
+ if (sp->invalid)
+ break;
+ /* Test same polys. */
+#if 0
+ /* NOTE: This performs a sub-set test. */
+ /* XXX This (and the sort of verts list) is better than systematic
+ * search of all verts of one list into the other if lists have
+ * a fair amount of elements.
+ * Not sure however it's worth it in this case?
+ * But as we also need sorted vert list to check verts multi-used
+ * (in first pass of checks)... */
+ /* XXX If we consider only "equal" polys (i.e. using exactly same set of verts)
+ * as invalid, better to replace this by a simple memory cmp... */
+ while ((p1_nv && p2_nv) && (p1_sub || p2_sub)) {
+ if (*p1_v < *p2_v) {
+ if (p1_sub)
+ p1_sub = FALSE;
+ p1_nv--;
+ p1_v++;
+ }
+ else if (*p2_v < *p1_v) {
+ if (p2_sub)
+ p2_sub = FALSE;
+ p2_nv--;
+ p2_v++;
}
else {
- edge_store_from_mface_tri(sf->es, mf);
- qsort(sf->es, 3, sizeof(int64_t), int64_cmp);
+ /* Equality, both next verts. */
+ p1_nv--;
+ p2_nv--;
+ p1_v++;
+ p2_v++;
}
-
- totsortface++;
- sf++;
+ }
+ if (p1_nv && p1_sub)
+ p1_sub = FALSE;
+ else if (p2_nv && p2_sub)
+ p2_sub = FALSE;
+
+ if (p1_sub && p2_sub) {
+ PRINT(" polys %u and %u use same vertices, considering poly %u as invalid.\n",
+ prev_sp->index, sp->index, sp->index);
+ sp->invalid = TRUE;
+ }
+ /* XXX In fact, these might be valid? :/ */
+ else if (p1_sub) {
+ PRINT(" %u is a sub-poly of %u, considering it as invalid.\n", sp->index, prev_sp->index);
+ sp->invalid = TRUE;
+ }
+ else if (p2_sub) {
+ PRINT(" %u is a sub-poly of %u, considering it as invalid.\n", prev_sp->index, sp->index);
+ prev_sp->invalid = TRUE;
+ prev_sp = sp; /* sp is new reference poly. */
+ }
+#else
+ if (0) {
+ p1_sub += 0;
+ p2_sub += 0;
+ }
+ if ((p1_nv == p2_nv) && (memcmp(p1_v, p2_v, p1_nv * sizeof(*p1_v)) == 0)) {
+ if (do_verbose) {
+ PRINT(" polys %u and %u use same vertices (%u",
+ prev_sp->index, sp->index, *p1_v);
+ for (j = 1; j < p1_nv; j++)
+ PRINT(", %u", p1_v[j]);
+ PRINT("), considering poly %u as invalid.\n", sp->index);
+ }
+ sp->invalid = TRUE;
+ }
+#endif
+ else {
+ prev_sp = sp;
}
}
- if(remove) {
- REMOVE_FACE_TAG(mf);
- }
- }
-
- qsort(sort_faces, totsortface, sizeof(SortFace), search_face_cmp);
- sf= sort_faces;
- sf_prev= sf;
- sf++;
-
- for(i=1; i<totsortface; i++, sf++) {
- int remove= FALSE;
- /* on a valid mesh, code below will never run */
- if(memcmp(sf->es, sf_prev->es, sizeof(sf_prev->es)) == 0) {
- mf= mfaces + sf->index;
-
- if(do_verbose) {
- mf_prev= mfaces + sf_prev->index;
- if(mf->v4) {
- PRINT(" face %u & %u: are duplicates (%u,%u,%u,%u) (%u,%u,%u,%u)\n", sf->index, sf_prev->index, mf->v1, mf->v2, mf->v3, mf->v4, mf_prev->v1, mf_prev->v2, mf_prev->v3, mf_prev->v4);
+ /* Third check pass, testing loops used by none or more than one poly. */
+ qsort(sort_polys, totpoly, sizeof(SortPoly), search_polyloop_cmp);
+ sp = sort_polys;
+ prev_sp = NULL;
+ prev_end = 0;
+ for (i = 0; i < totpoly; i++, sp++) {
+ /* Free this now, we don't need it anymore, and avoid us another loop! */
+ if (sp->verts)
+ MEM_freeN(sp->verts);
+
+ /* Note above prev_sp: in following code, we make sure it is always valid poly (or NULL). */
+ if (sp->invalid) {
+ if (do_fixes) {
+ REMOVE_POLY_TAG((&mpolys[sp->index]));
+ /* DO NOT REMOVE ITS LOOPS!!!
+ * As already invalid polys are at the end of the SortPoly list, the loops they
+ * were the only users have already been tagged as "to remove" during previous
+ * iterations, and we don’t want to remove some loops that may be used by
+ * another valid poly! */
+ }
+ }
+ /* Test loops users. */
+ else {
+ /* Unused loops. */
+ if (prev_end < sp->loopstart) {
+ for (j = prev_end, ml = &mloops[prev_end]; j < sp->loopstart; j++, ml++) {
+ PRINT(" loop %u is unused.\n", j);
+ if (do_fixes)
+ REMOVE_LOOP_TAG(ml);
+ }
+ prev_end = sp->loopstart + sp->numverts;
+ prev_sp = sp;
+ }
+ /* Multi-used loops. */
+ else if (prev_end > sp->loopstart) {
+ PRINT(" polys %u and %u share loops from %u to %u, considering poly %u as invalid.\n",
+ prev_sp->index, sp->index, sp->loopstart, prev_end, sp->index);
+ if (do_fixes) {
+ REMOVE_POLY_TAG((&mpolys[sp->index]));
+ /* DO NOT REMOVE ITS LOOPS!!!
+ * They might be used by some next, valid poly!
+ * Just not updating prev_end/prev_sp vars is enough to ensure the loops
+ * effectively no more needed will be marked as "to be removed"! */
+ }
}
else {
- PRINT(" face %u & %u: are duplicates (%u,%u,%u) (%u,%u,%u)\n", sf->index, sf_prev->index, mf->v1, mf->v2, mf->v3, mf_prev->v1, mf_prev->v2, mf_prev->v3);
+ prev_end = sp->loopstart + sp->numverts;
+ prev_sp = sp;
}
}
-
- remove= do_fixes;
}
- else {
- sf_prev= sf;
+ /* We may have some remaining unused loops to get rid of! */
+ if (prev_end < totloop) {
+ for (j = prev_end, ml = &mloops[prev_end]; j < totloop; j++, ml++) {
+ PRINT(" loop %u is unused.\n", j);
+ if (do_fixes)
+ REMOVE_LOOP_TAG(ml);
+ }
}
- if(remove) {
- REMOVE_FACE_TAG(mf);
- }
+ MEM_freeN(sort_polys);
}
BLI_edgehash_free(edge_hash, NULL);
- MEM_freeN(sort_faces);
-
/* fix deform verts */
if (dverts) {
MDeformVert *dv;
- for(i=0, dv= dverts; i<totvert; i++, dv++) {
+ for (i=0, dv= dverts; i<totvert; i++, dv++) {
MDeformWeight *dw;
unsigned int j;
- for(j=0, dw= dv->dw; j < dv->totweight; j++, dw++) {
+ for (j=0, dw= dv->dw; j < dv->totweight; j++, dw++) {
/* note, greater then max defgroups is accounted for in our code, but not < 0 */
if (!finite(dw->weight)) {
PRINT(" vertex deform %u, group %d has weight: %f\n", i, dw->def_nr, dw->weight);
@@ -366,49 +513,50 @@ int BKE_mesh_validate_arrays( Mesh *me,
}
}
-
PRINT("BKE_mesh_validate: finished\n\n");
-# undef REMOVE_EDGE_TAG
-# undef REMOVE_FACE_TAG
+# undef REMOVE_EDGE_TAG
+# undef IS_REMOVED_EDGE
+# undef REMOVE_LOOP_TAG
+# undef REMOVE_POLY_TAG
- if(me) {
- if(do_face_free) {
- mesh_strip_loose_faces(me);
+ if (mesh) {
+ if (do_polyloop_free) {
+ mesh_strip_loose_polysloops(mesh);
}
if (do_edge_free) {
- mesh_strip_loose_edges(me);
+ mesh_strip_loose_edges(mesh);
}
- if(do_fixes && do_edge_recalc) {
- BKE_mesh_calc_edges(me, TRUE);
+ if (do_edge_recalc) {
+ BKE_mesh_calc_edges(mesh, TRUE);
}
}
- return (verts_fixed || vert_weights_fixed || do_face_free || do_edge_free || do_edge_recalc);
+ return (verts_fixed || vert_weights_fixed || do_polyloop_free || do_edge_free || do_edge_recalc);
}
static int mesh_validate_customdata(CustomData *data, short do_verbose, const short do_fixes)
{
int i= 0, has_fixes= 0;
- while(i<data->totlayer) {
+ while (i<data->totlayer) {
CustomDataLayer *layer= &data->layers[i];
CustomDataMask mask= CD_TYPE_AS_MASK(layer->type);
int ok= 1;
- if((mask&CD_MASK_MESH)==0) {
+ if ((mask&CD_MASK_MESH)==0) {
PRINT("CustomDataLayer type %d which isn't in CD_MASK_MESH is stored in Mehs structure\n", layer->type);
- if(do_fixes) {
+ if (do_fixes) {
CustomData_free_layer(data, layer->type, 0, i);
ok= 0;
has_fixes= 1;
}
}
- if(ok)
+ if (ok)
i++;
}
@@ -417,99 +565,85 @@ static int mesh_validate_customdata(CustomData *data, short do_verbose, const sh
#undef PRINT
-static int BKE_mesh_validate_all_customdata(CustomData *vdata, CustomData *edata, CustomData *fdata,
+static int BKE_mesh_validate_all_customdata(CustomData *vdata, CustomData *edata,
+ CustomData *ldata, CustomData *pdata,
short do_verbose, const short do_fixes)
{
- int vfixed= 0, efixed= 0, ffixed= 0;
+ int vfixed= 0, efixed= 0, lfixed = 0, pfixed = 0;
vfixed= mesh_validate_customdata(vdata, do_verbose, do_fixes);
efixed= mesh_validate_customdata(edata, do_verbose, do_fixes);
- ffixed= mesh_validate_customdata(fdata, do_verbose, do_fixes);
+ lfixed= mesh_validate_customdata(ldata, do_verbose, do_fixes);
+ pfixed= mesh_validate_customdata(pdata, do_verbose, do_fixes);
- return vfixed || efixed || ffixed;
+ return vfixed || efixed || lfixed || pfixed;
}
int BKE_mesh_validate(Mesh *me, int do_verbose)
{
int layers_fixed= 0, arrays_fixed= 0;
- if(do_verbose) {
+ if (do_verbose) {
printf("MESH: %s\n", me->id.name+2);
}
- layers_fixed= BKE_mesh_validate_all_customdata(&me->vdata, &me->edata, &me->fdata, do_verbose, TRUE);
+ layers_fixed= BKE_mesh_validate_all_customdata(&me->vdata, &me->edata, &me->ldata, &me->pdata, do_verbose, TRUE);
arrays_fixed= BKE_mesh_validate_arrays(me,
me->mvert, me->totvert,
me->medge, me->totedge,
- me->mface, me->totface,
+ me->mloop, me->totloop,
+ me->mpoly, me->totpoly,
me->dvert,
do_verbose, TRUE);
- return layers_fixed || arrays_fixed;
+ if (layers_fixed || arrays_fixed) {
+ DAG_id_tag_update(&me->id, OB_RECALC_DATA);
+ return TRUE;
+ }
+ return FALSE;
}
int BKE_mesh_validate_dm(DerivedMesh *dm)
{
return BKE_mesh_validate_arrays(NULL,
- dm->getVertArray(dm), dm->getNumVerts(dm),
- dm->getEdgeArray(dm), dm->getNumEdges(dm),
- dm->getTessFaceArray(dm), dm->getNumTessFaces(dm),
- dm->getVertDataArray(dm, CD_MDEFORMVERT),
- TRUE, FALSE);
+ dm->getVertArray(dm), dm->getNumVerts(dm),
+ dm->getEdgeArray(dm), dm->getNumEdges(dm),
+ dm->getLoopArray(dm), dm->getNumLoops(dm),
+ dm->getPolyArray(dm), dm->getNumPolys(dm),
+ dm->getVertDataArray(dm, CD_MDEFORMVERT),
+ TRUE, FALSE);
}
void BKE_mesh_calc_edges(Mesh *mesh, int update)
{
CustomData edata;
EdgeHashIterator *ehi;
- MFace *mf = mesh->mface;
+ MPoly *mp = mesh->mpoly;
MEdge *med, *med_orig;
EdgeHash *eh = BLI_edgehash_new();
- int i, totedge, totface = mesh->totface;
+ int i, totedge, totpoly = mesh->totpoly;
int med_index;
- if(mesh->totedge==0)
+ if (mesh->totedge==0)
update= 0;
- if(update) {
+ if (update) {
/* assume existing edges are valid
* useful when adding more faces and generating edges from them */
med= mesh->medge;
- for(i= 0; i<mesh->totedge; i++, med++)
+ for (i= 0; i<mesh->totedge; i++, med++)
BLI_edgehash_insert(eh, med->v1, med->v2, med);
}
- if(mesh->totpoly) {
- /* mesh loops (bmesh only) */
- MPoly *mp= mesh->mpoly;
- for(i=0; i < mesh->totpoly; i++, mp++) {
- MLoop *l= &mesh->mloop[mp->loopstart];
- int j, l_prev= (l + (mp->totloop-1))->v;
- for (j=0; j < mp->totloop; j++, l++) {
- if (!BLI_edgehash_haskey(eh, l_prev, l->v)) {
- BLI_edgehash_insert(eh, l_prev, l->v, NULL);
- }
- l_prev= l->v;
- }
- }
- }
- else {
- /* regular faces (note, we could remove this for bmesh - campbell) */
- for (i = 0; i < totface; i++, mf++) {
- if (!BLI_edgehash_haskey(eh, mf->v1, mf->v2))
- BLI_edgehash_insert(eh, mf->v1, mf->v2, NULL);
- if (!BLI_edgehash_haskey(eh, mf->v2, mf->v3))
- BLI_edgehash_insert(eh, mf->v2, mf->v3, NULL);
-
- if (mf->v4) {
- if (!BLI_edgehash_haskey(eh, mf->v3, mf->v4))
- BLI_edgehash_insert(eh, mf->v3, mf->v4, NULL);
- if (!BLI_edgehash_haskey(eh, mf->v4, mf->v1))
- BLI_edgehash_insert(eh, mf->v4, mf->v1, NULL);
- } else {
- if (!BLI_edgehash_haskey(eh, mf->v3, mf->v1))
- BLI_edgehash_insert(eh, mf->v3, mf->v1, NULL);
+ /* mesh loops (bmesh only) */
+ for (i=0; i < totpoly; i++, mp++) {
+ MLoop *l= &mesh->mloop[mp->loopstart];
+ int j, l_prev= (l + (mp->totloop-1))->v;
+ for (j=0; j < mp->totloop; j++, l++) {
+ if (!BLI_edgehash_haskey(eh, l_prev, l->v)) {
+ BLI_edgehash_insert(eh, l_prev, l->v, NULL);
}
+ l_prev= l->v;
}
}
@@ -521,12 +655,13 @@ void BKE_mesh_calc_edges(Mesh *mesh, int update)
ehi = BLI_edgehashIterator_new(eh);
med = CustomData_get_layer(&edata, CD_MEDGE);
- for(i = 0; !BLI_edgehashIterator_isDone(ehi);
+ for (i = 0; !BLI_edgehashIterator_isDone(ehi);
BLI_edgehashIterator_step(ehi), ++i, ++med) {
- if(update && (med_orig=BLI_edgehashIterator_getValue(ehi))) {
+ if (update && (med_orig=BLI_edgehashIterator_getValue(ehi))) {
*med= *med_orig; /* copy from the original */
- } else {
+ }
+ else {
BLI_edgehashIterator_getKey(ehi, &med->v1, &med->v2);
med->flag = ME_EDGEDRAW|ME_EDGERENDER|SELECT; /* select for newly created meshes which are selected [#25595] */
}
@@ -538,9 +673,9 @@ 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++) {
+ for (i=0; i < mesh->totpoly; i++, mp++) {
MLoop *l= &mesh->mloop[mp->loopstart];
MLoop *l_prev= (l + (mp->totloop-1));
int j;
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 9a67260ded4..6c855b8f242 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -77,7 +77,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
}
/* type unsigned, no need to chech < 0 */
- if(type < NUM_MODIFIER_TYPES && types[type]->name[0] != '\0') {
+ if (type < NUM_MODIFIER_TYPES && types[type]->name[0] != '\0') {
return types[type];
}
else {
@@ -205,8 +205,8 @@ void modifiers_foreachIDLink(Object *ob, IDWalkFunc walk, void *userData)
for (; md; md=md->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
- if(mti->foreachIDLink) mti->foreachIDLink(md, ob, walk, userData);
- else if(mti->foreachObjectLink) {
+ if (mti->foreachIDLink) mti->foreachIDLink(md, ob, walk, userData);
+ else if (mti->foreachObjectLink) {
/* each Object can masquerade as an ID, so this should be OK */
ObjectWalkFunc fp = (ObjectWalkFunc)walk;
mti->foreachObjectLink(md, ob, fp, userData);
@@ -221,7 +221,7 @@ void modifiers_foreachTexLink(Object *ob, TexWalkFunc walk, void *userData)
for (; md; md=md->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
- if(mti->foreachTexLink)
+ if (mti->foreachTexLink)
mti->foreachTexLink(md, ob, walk, userData);
}
}
@@ -290,7 +290,7 @@ int modifiers_getCageIndex(struct Scene *scene, Object *ob, int *lastPossibleCag
ModifierData *md = (virtual_)? modifiers_getVirtualModifierList(ob): ob->modifiers.first;
int i, cageIndex = -1;
- if(lastPossibleCageIndex_r) {
+ if (lastPossibleCageIndex_r) {
/* ensure the value is initialized */
*lastPossibleCageIndex_r= -1;
}
@@ -346,53 +346,57 @@ int modifier_isEnabled(struct Scene *scene, ModifierData *md, int required_mode)
md->scene= scene;
- if((md->mode & required_mode) != required_mode) return 0;
- if(mti->isDisabled && mti->isDisabled(md, required_mode == eModifierMode_Render)) return 0;
- if(md->mode & eModifierMode_DisableTemporary) return 0;
- if(required_mode & eModifierMode_Editmode)
- if(!(mti->flags & eModifierTypeFlag_SupportsEditmode)) return 0;
+ if ((md->mode & required_mode) != required_mode) return 0;
+ if (mti->isDisabled && mti->isDisabled(md, required_mode == eModifierMode_Render)) return 0;
+ if (md->mode & eModifierMode_DisableTemporary) return 0;
+ if (required_mode & eModifierMode_Editmode)
+ if (!(mti->flags & eModifierTypeFlag_SupportsEditmode)) return 0;
return 1;
}
-LinkNode *modifiers_calcDataMasks(struct Scene *scene, Object *ob, ModifierData *md, CustomDataMask dataMask, int required_mode)
+CDMaskLink *modifiers_calcDataMasks(struct Scene *scene, Object *ob, ModifierData *md, CustomDataMask dataMask, int required_mode)
{
- LinkNode *dataMasks = NULL;
- LinkNode *curr, *prev;
+ CDMaskLink *dataMasks = NULL;
+ CDMaskLink *curr, *prev;
/* build a list of modifier data requirements in reverse order */
- for(; md; md = md->next) {
+ for (; md; md = md->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
- CustomDataMask mask = 0;
- if(modifier_isEnabled(scene, md, required_mode))
- if(mti->requiredDataMask)
- mask = mti->requiredDataMask(ob, md);
+ curr = MEM_callocN(sizeof(CDMaskLink), "CDMaskLink");
+
+ if (modifier_isEnabled(scene, md, required_mode))
+ if (mti->requiredDataMask)
+ curr->mask = mti->requiredDataMask(ob, md);
- BLI_linklist_prepend(&dataMasks, SET_INT_IN_POINTER(mask));
+ /* prepend new datamask */
+ curr->next = dataMasks;
+ dataMasks = curr;
}
/* 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
- */
- for(curr = dataMasks, prev = NULL; curr; prev = curr, curr = curr->next) {
- if(prev) {
- CustomDataMask prev_mask = (CustomDataMask)GET_INT_FROM_POINTER(prev->link);
- CustomDataMask curr_mask = (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
-
- curr->link = SET_INT_IN_POINTER(curr_mask | prev_mask);
- } else {
- CustomDataMask curr_mask = (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
-
- curr->link = SET_INT_IN_POINTER(curr_mask | dataMask);
+ * 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 = prev->mask;
+ CustomDataMask curr_mask = curr->mask;
+
+ curr->mask = curr_mask | prev_mask;
+ }
+ else {
+ CustomDataMask curr_mask = curr->mask;
+
+ curr->mask = curr_mask | dataMask;
}
}
/* reverse the list so it's in the correct order */
- BLI_linklist_reverse(&dataMasks);
+ BLI_linklist_reverse((LinkNode**)&dataMasks);
return dataMasks;
}
@@ -405,8 +409,8 @@ ModifierData *modifiers_getLastPreview(struct Scene *scene, ModifierData *md, in
return tmp_md;
/* Find the latest modifier in stack generating preview. */
- for(; md; md = md->next) {
- if(modifier_isEnabled(scene, md, required_mode) && modifier_isPreview(md))
+ for (; md; md = md->next) {
+ if (modifier_isEnabled(scene, md, required_mode) && modifier_isPreview(md))
tmp_md = md;
}
return tmp_md;
@@ -414,9 +418,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;
@@ -451,18 +455,20 @@ ModifierData *modifiers_getVirtualModifierList(Object *ob)
md = ob->modifiers.first;
- if(ob->parent) {
- if(ob->parent->type==OB_ARMATURE && ob->partype==PARSKEL) {
+ if (ob->parent) {
+ if (ob->parent->type==OB_ARMATURE && ob->partype==PARSKEL) {
amd.object = ob->parent;
amd.modifier.next = md;
amd.deformflag= ((bArmature *)(ob->parent->data))->deformflag;
md = &amd.modifier;
- } else if(ob->parent->type==OB_CURVE && ob->partype==PARSKEL) {
+ }
+ else if (ob->parent->type==OB_CURVE && ob->partype==PARSKEL) {
cmd.object = ob->parent;
cmd.defaxis = ob->trackflag + 1;
cmd.modifier.next = md;
md = &cmd.modifier;
- } else if(ob->parent->type==OB_LATTICE && ob->partype==PARSKEL) {
+ }
+ else if (ob->parent->type==OB_LATTICE && ob->partype==PARSKEL) {
lmd.object = ob->parent;
lmd.modifier.next = md;
md = &lmd.modifier;
@@ -470,8 +476,8 @@ ModifierData *modifiers_getVirtualModifierList(Object *ob)
}
/* shape key modifier, not yet for curves */
- if(ELEM(ob->type, OB_MESH, OB_LATTICE) && ob_get_key(ob)) {
- if(ob->type == OB_MESH && (ob->shapeflag & OB_SHAPE_EDIT_MODE))
+ if (ELEM(ob->type, OB_MESH, OB_LATTICE) && ob_get_key(ob)) {
+ if (ob->type == OB_MESH && (ob->shapeflag & OB_SHAPE_EDIT_MODE))
smd.modifier.mode |= eModifierMode_Editmode|eModifierMode_OnCage;
else
smd.modifier.mode &= ~eModifierMode_Editmode|eModifierMode_OnCage;
@@ -491,8 +497,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 +513,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;
@@ -564,9 +568,9 @@ int modifiers_isCorrectableDeformed(Object *ob)
ModifierData *md = modifiers_getVirtualModifierList(ob);
for (; md; md=md->next) {
- if(ob->mode==OB_MODE_EDIT && (md->mode & eModifierMode_Editmode)==0);
+ if (ob->mode==OB_MODE_EDIT && (md->mode & eModifierMode_Editmode)==0);
else
- if(modifier_isCorrectableDeformed(md))
+ if (modifier_isCorrectableDeformed(md))
return 1;
}
return 0;
@@ -592,16 +596,16 @@ int modifiers_indexInObject(Object *ob, ModifierData *md_seek)
ModifierData *md;
for (md=ob->modifiers.first; (md && md_seek!=md); md=md->next, i++);
- if (!md) return -1; /* modifier isnt in the object */
+ if (!md) return -1; /* modifier isn't in the object */
return i;
}
void modifier_freeTemporaryData(ModifierData *md)
{
- if(md->type == eModifierType_Armature) {
+ if (md->type == eModifierType_Armature) {
ArmatureModifierData *amd= (ArmatureModifierData*)md;
- if(amd->prevCos) {
+ if (amd->prevCos) {
MEM_freeN(amd->prevCos);
amd->prevCos= NULL;
}
@@ -614,12 +618,12 @@ 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;
+ if (ob->type != OB_MESH) return;
- for(md = ob->modifiers.first; md; md = md->next) {
- if(md->type == eModifierType_Multires) {
+ for (md = ob->modifiers.first; md; md = md->next) {
+ if (md->type == eModifierType_Multires) {
MultiresModifierData *mmd = (MultiresModifierData*)md;
multiresModifier_set_levels_from_disps(mmd, ob);
@@ -636,7 +640,7 @@ void test_object_modifiers(Object *ob)
*
* - if the ID is from a library, return library path
* - else if the file has been saved return the blend file path.
- * - else if the file isn't saved and the ID isnt from a library, return the temp dir.
+ * - else if the file isn't saved and the ID isn't from a library, return the temp dir.
*/
const char *modifier_path_relbase(Object *ob)
{
diff --git a/source/blender/blenkernel/intern/modifiers_bmesh.c b/source/blender/blenkernel/intern/modifiers_bmesh.c
index 6bca40be1e2..52b76eabc6c 100644
--- a/source/blender/blenkernel/intern/modifiers_bmesh.c
+++ b/source/blender/blenkernel/intern/modifiers_bmesh.c
@@ -45,15 +45,16 @@ 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;
+ float has_face_normals;
BMFace *f;
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 +64,10 @@ 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 */
+
+ /* add crease layer */
+ BM_data_layer_add(bm, &bm->edata, CD_CREASE);
vtable = MEM_callocN(sizeof(void**) * totvert, "vert table in BMDM_Copy");
etable = MEM_callocN(sizeof(void**) * totedge, "edge table in BMDM_Copy");
@@ -89,12 +93,16 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
CustomData_to_bmesh_block(&dm->edgeData, &bm->edata, i, &e->head.data);
etable[i] = e;
+
+ /* add crease */
+ BM_elem_float_data_set(&bm->edata, e, CD_CREASE, (float)me->crease / 255.0f);
}
MEM_freeN(medge);
/*do faces*/
- mpoly = mp = dm->getPolyArray(dm);
+ mp = dm->getPolyArray(dm);
mloop = dm->getLoopArray(dm);
+ has_face_normals = CustomData_has_layer(&dm->polyData, CD_NORMAL);
for (i = 0; i < dm->numPolyData; i++, mp++) {
BMLoop *l;
@@ -120,13 +128,19 @@ 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);
}
CustomData_to_bmesh_block(&dm->polyData, &bm->pdata, i, &f->head.data);
+
+ if (has_face_normals) {
+ float *fno;
+
+ fno = CustomData_bmesh_get(&bm->pdata, &f->head.data, CD_NORMAL);
+ copy_v3_v3(f->no, fno);
+ }
}
MEM_freeN(vtable);
@@ -138,33 +152,37 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
/* converts a cddm to a BMEditMesh. if existing is non-NULL, the
* new geometry will be put in there.*/
-BMEditMesh *DM_to_editbmesh(Object *ob, DerivedMesh *dm, BMEditMesh *existing, int do_tesselate)
+BMEditMesh *DM_to_editbmesh(DerivedMesh *dm, BMEditMesh *existing, int do_tessellate)
{
BMEditMesh *em = existing;
BMesh *bm;
- if (em) bm = em->bm;
- else bm = BM_mesh_create(ob, bm_mesh_allocsize_default);
+ if (em) {
+ bm = em->bm;
+ }
+ else {
+ bm = BM_mesh_create(&bm_mesh_allocsize_default);
+ }
DM_to_bmesh_ex(dm, bm);
if (!em) {
- em = BMEdit_Create(bm, do_tesselate);
+ em = BMEdit_Create(bm, do_tessellate);
}
else {
- if (do_tesselate) {
- BMEdit_RecalcTesselation(em);
+ if (do_tessellate) {
+ BMEdit_RecalcTessellation(em);
}
}
return em;
}
-BMesh *DM_to_bmesh(Object *ob, DerivedMesh *dm)
+BMesh *DM_to_bmesh(DerivedMesh *dm)
{
BMesh *bm;
- bm = BM_mesh_create(ob, bm_mesh_allocsize_default);
+ bm = BM_mesh_create(&bm_mesh_allocsize_default);
DM_to_bmesh_ex(dm, bm);
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index 4d8f76467b1..e375262c045 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -82,19 +82,19 @@
static int sequence_guess_offset(const char *full_name, int head_len, int numlen)
{
- char num[FILE_MAX]= {0};
+ char num[FILE_MAX] = {0};
- BLI_strncpy(num, full_name+head_len, numlen+1);
+ BLI_strncpy(num, full_name + head_len, numlen + 1);
return atoi(num);
}
static int rendersize_to_proxy(MovieClipUser *user, int flag)
{
- if((flag&MCLIP_USE_PROXY)==0)
+ if ((flag & MCLIP_USE_PROXY) == 0)
return IMB_PROXY_NONE;
- switch(user->render_size) {
+ switch (user->render_size) {
case MCLIP_PROXY_RENDER_SIZE_25:
return IMB_PROXY_25;
@@ -116,7 +116,7 @@ static int rendersize_to_proxy(MovieClipUser *user, int flag)
static int rendersize_to_number(int render_size)
{
- switch(render_size) {
+ switch (render_size) {
case MCLIP_PROXY_RENDER_SIZE_25:
return 25;
@@ -138,7 +138,7 @@ static int rendersize_to_number(int render_size)
static int get_timecode(MovieClip *clip, int flag)
{
- if((flag&MCLIP_USE_PROXY)==0)
+ if ((flag & MCLIP_USE_PROXY) == 0)
return IMB_TC_NONE;
return clip->proxy.tc;
@@ -154,11 +154,13 @@ 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);
- else BLI_strncpy(name, clip->name, sizeof(clip->name));
+ if (numlen)
+ BLI_stringenc(name, head, tail, numlen, offset + framenr - 1);
+ else
+ BLI_strncpy(name, clip->name, sizeof(clip->name));
BLI_path_abs(name, ID_BLEND_PATH(G.main, &clip->id));
}
@@ -166,18 +168,19 @@ static void get_sequence_fname(MovieClip *clip, int framenr, char *name)
/* supposed to work with sequences only */
static void get_proxy_fname(MovieClip *clip, int proxy_render_size, int undistorted, int framenr, char *name)
{
- int size= rendersize_to_number(proxy_render_size);
+ int size = rendersize_to_number(proxy_render_size);
char dir[FILE_MAX], clipdir[FILE_MAX], clipfile[FILE_MAX];
BLI_split_dirfile(clip->name, clipdir, clipfile, FILE_MAX, FILE_MAX);
- if(clip->flag&MCLIP_USE_PROXY_CUSTOM_DIR) {
+ if (clip->flag & MCLIP_USE_PROXY_CUSTOM_DIR) {
BLI_strncpy(dir, clip->proxy.dir, sizeof(dir));
- } else {
+ }
+ else {
BLI_snprintf(dir, FILE_MAX, "%s/BL_proxy", clipdir);
}
- if(undistorted)
+ if (undistorted)
BLI_snprintf(name, FILE_MAX, "%s/%s/proxy_%d_undistorted/%08d", dir, clipfile, size, framenr);
else
BLI_snprintf(name, FILE_MAX, "%s/%s/proxy_%d/%08d", dir, clipfile, size, framenr);
@@ -194,37 +197,35 @@ static ImBuf *movieclip_load_sequence_file(MovieClip *clip, MovieClipUser *user,
char name[FILE_MAX];
int loadflag, use_proxy= 0;
- use_proxy= (flag&MCLIP_USE_PROXY) && user->render_size != MCLIP_PROXY_RENDER_SIZE_FULL;
- if(use_proxy) {
- int undistort= user->render_flag&MCLIP_PROXY_RENDER_UNDISTORT;
+ use_proxy = (flag & MCLIP_USE_PROXY) && user->render_size != MCLIP_PROXY_RENDER_SIZE_FULL;
+ if (use_proxy) {
+ int undistort = user->render_flag & MCLIP_PROXY_RENDER_UNDISTORT;
get_proxy_fname(clip, user->render_size, undistort, framenr, name);
- } else
+ }
+ else
get_sequence_fname(clip, framenr, name);
- loadflag= IB_rect|IB_multilayer;
+ loadflag = IB_rect|IB_multilayer;
/* read ibuf */
- ibuf= IMB_loadiffname(name, loadflag);
+ ibuf = IMB_loadiffname(name, loadflag);
return ibuf;
}
-static ImBuf *movieclip_load_movie_file(MovieClip *clip, MovieClipUser *user, int framenr, int flag)
+static void movieclip_open_anim_file(MovieClip *clip)
{
- ImBuf *ibuf= NULL;
- int tc= get_timecode(clip, flag);
- int proxy= rendersize_to_proxy(user, flag);
char str[FILE_MAX];
- if(!clip->anim) {
+ if (!clip->anim) {
BLI_strncpy(str, clip->name, FILE_MAX);
BLI_path_abs(str, ID_BLEND_PATH(G.main, &clip->id));
/* FIXME: make several stream accessible in image editor, too */
- clip->anim= openanim(str, IB_rect, 0);
+ clip->anim = openanim(str, IB_rect, 0);
- if(clip->anim) {
- if(clip->flag&MCLIP_USE_PROXY_CUSTOM_DIR) {
+ if (clip->anim) {
+ if (clip->flag & MCLIP_USE_PROXY_CUSTOM_DIR) {
char dir[FILE_MAX];
BLI_strncpy(dir, clip->proxy.dir, sizeof(dir));
BLI_path_abs(dir, G.main->name);
@@ -232,26 +233,61 @@ static ImBuf *movieclip_load_movie_file(MovieClip *clip, MovieClipUser *user, in
}
}
}
+}
+
+static ImBuf *movieclip_load_movie_file(MovieClip *clip, MovieClipUser *user, int framenr, int flag)
+{
+ ImBuf *ibuf = NULL;
+ int tc = get_timecode(clip, flag);
+ int proxy = rendersize_to_proxy(user, flag);
- if(clip->anim) {
+ movieclip_open_anim_file(clip);
+
+ if (clip->anim) {
int dur;
int fra;
- dur= IMB_anim_get_duration(clip->anim, tc);
- fra= framenr-1;
+ dur = IMB_anim_get_duration(clip->anim, tc);
+ fra = framenr - 1;
- if(fra<0)
- fra= 0;
+ if (fra<0)
+ fra = 0;
- if(fra>(dur-1))
- fra= dur-1;
+ if (fra > (dur - 1))
+ fra = dur - 1;
- ibuf= IMB_anim_absolute(clip->anim, fra, tc, proxy);
+ ibuf = IMB_anim_absolute(clip->anim, fra, tc, proxy);
}
return ibuf;
}
+static void movieclip_calc_length(MovieClip *clip)
+{
+ if (clip->source == MCLIP_SRC_MOVIE) {
+ movieclip_open_anim_file(clip);
+
+ if (clip->anim) {
+ clip->len = IMB_anim_get_duration(clip->anim, clip->proxy.tc);
+ }
+ }
+ else if (clip->source == MCLIP_SRC_SEQUENCE) {
+ int framenr = 1;
+ char name[FILE_MAX];
+
+ for (;;) {
+ get_sequence_fname(clip, framenr, name);
+
+ if (!BLI_exists(name)) {
+ clip->len = framenr + 1;
+ break;
+ }
+
+ framenr++;
+ }
+ }
+}
+
/*********************** image buffer cache *************************/
typedef struct MovieClipCache {
@@ -293,52 +329,58 @@ typedef struct MovieClipImBufCacheKey {
static void moviecache_keydata(void *userkey, int *framenr, int *proxy, int *render_flags)
{
- MovieClipImBufCacheKey *key= (MovieClipImBufCacheKey*)userkey;
+ MovieClipImBufCacheKey *key = (MovieClipImBufCacheKey*)userkey;
- *framenr= key->framenr;
- *proxy= key->proxy;
- *render_flags= key->render_flag;
+ *framenr = key->framenr;
+ *proxy = key->proxy;
+ *render_flags = key->render_flag;
}
static unsigned int moviecache_hashhash(const void *keyv)
{
- MovieClipImBufCacheKey *key= (MovieClipImBufCacheKey*)keyv;
- int rval= key->framenr;
+ MovieClipImBufCacheKey *key = (MovieClipImBufCacheKey*)keyv;
+ int rval = key->framenr;
return rval;
}
static int moviecache_hashcmp(const void *av, const void *bv)
{
- const MovieClipImBufCacheKey *a= (MovieClipImBufCacheKey*)av;
- const MovieClipImBufCacheKey *b= (MovieClipImBufCacheKey*)bv;
+ const MovieClipImBufCacheKey *a = (MovieClipImBufCacheKey*)av;
+ const MovieClipImBufCacheKey *b = (MovieClipImBufCacheKey*)bv;
- if(a->framenr<b->framenr) return -1;
- else if(a->framenr>b->framenr) return 1;
+ if (a->framenr < b->framenr)
+ return -1;
+ else if (a->framenr > b->framenr)
+ return 1;
- if(a->proxy<b->proxy) return -1;
- else if(a->proxy>b->proxy) return 1;
+ if (a->proxy < b->proxy)
+ return -1;
+ else if (a->proxy > b->proxy)
+ return 1;
- if(a->render_flag<b->render_flag) return -1;
- else if(a->render_flag>b->render_flag) return 1;
+ if (a->render_flag < b->render_flag)
+ return -1;
+ else if (a->render_flag > b->render_flag)
+ return 1;
return 0;
}
static ImBuf *get_imbuf_cache(MovieClip *clip, MovieClipUser *user, int flag)
{
- if(clip->cache) {
+ if (clip->cache) {
MovieClipImBufCacheKey key;
- key.framenr= user->framenr;
+ key.framenr = user->framenr;
- if(flag&MCLIP_USE_PROXY) {
- key.proxy= rendersize_to_proxy(user, flag);
- key.render_flag= user->render_flag;
+ if (flag & MCLIP_USE_PROXY) {
+ key.proxy = rendersize_to_proxy(user, flag);
+ key.render_flag = user->render_flag;
}
else {
- key.proxy= IMB_PROXY_NONE;
- key.render_flag= 0;
+ key.proxy = IMB_PROXY_NONE;
+ key.render_flag = 0;
}
return IMB_moviecache_get(clip->cache->moviecache, &key);
@@ -351,22 +393,22 @@ static void put_imbuf_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, i
{
MovieClipImBufCacheKey key;
- if(!clip->cache) {
- clip->cache= MEM_callocN(sizeof(MovieClipCache), "movieClipCache");
+ if (!clip->cache) {
+ clip->cache = MEM_callocN(sizeof(MovieClipCache), "movieClipCache");
- clip->cache->moviecache= IMB_moviecache_create(sizeof(MovieClipImBufCacheKey), moviecache_hashhash,
+ clip->cache->moviecache = IMB_moviecache_create(sizeof(MovieClipImBufCacheKey), moviecache_hashhash,
moviecache_hashcmp, moviecache_keydata);
}
- key.framenr= user->framenr;
+ key.framenr = user->framenr;
- if(flag&MCLIP_USE_PROXY) {
- key.proxy= rendersize_to_proxy(user, flag);
- key.render_flag= user->render_flag;
+ if (flag & MCLIP_USE_PROXY) {
+ key.proxy = rendersize_to_proxy(user, flag);
+ key.render_flag = user->render_flag;
}
else {
- key.proxy= IMB_PROXY_NONE;
- key.render_flag= 0;
+ key.proxy = IMB_PROXY_NONE;
+ key.render_flag = 0;
}
IMB_moviecache_put(clip->cache->moviecache, &key, ibuf);
@@ -379,26 +421,26 @@ static MovieClip *movieclip_alloc(const char *name)
{
MovieClip *clip;
- clip= alloc_libblock(&G.main->movieclip, ID_MC, name);
+ clip = alloc_libblock(&G.main->movieclip, ID_MC, name);
- clip->aspx= clip->aspy= 1.0f;
+ clip->aspx = clip->aspy= 1.0f;
BKE_tracking_init_settings(&clip->tracking);
- clip->proxy.build_size_flag= IMB_PROXY_25;
- clip->proxy.build_tc_flag= IMB_TC_RECORD_RUN |
- IMB_TC_FREE_RUN |
- IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN |
- IMB_TC_RECORD_RUN_NO_GAPS;
- clip->proxy.quality= 90;
+ clip->proxy.build_size_flag = IMB_PROXY_25;
+ clip->proxy.build_tc_flag = IMB_TC_RECORD_RUN |
+ IMB_TC_FREE_RUN |
+ IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN |
+ IMB_TC_RECORD_RUN_NO_GAPS;
+ clip->proxy.quality = 90;
return clip;
}
/* 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;
@@ -411,16 +453,17 @@ MovieClip *BKE_add_movieclip_file(const char *name)
BLI_path_abs(str, G.main->name);
/* exists? */
- file= open(str, O_BINARY|O_RDONLY);
- if(file== -1) return NULL;
+ file = BLI_open(str, O_BINARY|O_RDONLY,0);
+ if (file == -1)
+ return NULL;
close(file);
/* ** first search an identical clip ** */
- for(clip= G.main->movieclip.first; clip; clip= clip->id.next) {
+ for (clip = G.main->movieclip.first; clip; clip = clip->id.next) {
BLI_strncpy(strtest, clip->name, sizeof(clip->name));
BLI_path_abs(strtest, G.main->name);
- if(strcmp(strtest, str)==0) {
+ if (strcmp(strtest, str) == 0) {
BLI_strncpy(clip->name, name, sizeof(clip->name)); /* for stringcode */
clip->id.us++; /* officially should not, it doesn't link here! */
@@ -431,49 +474,54 @@ MovieClip *BKE_add_movieclip_file(const char *name)
/* ** add new movieclip ** */
/* create a short library name */
- len= strlen(name);
+ len = strlen(name);
- while (len > 0 && name[len - 1] != '/' && name[len - 1] != '\\') len--;
- libname= name+len;
+ while (len > 0 && name[len - 1] != '/' && name[len - 1] != '\\')
+ len--;
+ libname = name + len;
- clip= movieclip_alloc(libname);
+ clip = movieclip_alloc(libname);
BLI_strncpy(clip->name, name, sizeof(clip->name));
- if(BLI_testextensie_array(name, imb_ext_movie)) clip->source= MCLIP_SRC_MOVIE;
- else clip->source= MCLIP_SRC_SEQUENCE;
+ if (BLI_testextensie_array(name, imb_ext_movie))
+ clip->source = MCLIP_SRC_MOVIE;
+ else
+ clip->source = MCLIP_SRC_SEQUENCE;
- user.framenr= 1;
+ user.framenr = 1;
BKE_movieclip_get_size(clip, &user, &width, &height);
- if(width && height) {
- clip->tracking.camera.principal[0]= ((float)width)/2;
- clip->tracking.camera.principal[1]= ((float)height)/2;
+ if (width && height) {
+ clip->tracking.camera.principal[0] = ((float)width) / 2.0f;
+ clip->tracking.camera.principal[1] = ((float)height) / 2.0f;
- clip->tracking.camera.focal= 24.0f*width/clip->tracking.camera.sensor_width;
+ clip->tracking.camera.focal = 24.0f * width / clip->tracking.camera.sensor_width;
}
+ movieclip_calc_length(clip);
+
return clip;
}
static void real_ibuf_size(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, int *width, int *height)
{
- *width= ibuf->x;
- *height= ibuf->y;
+ *width = ibuf->x;
+ *height = ibuf->y;
- if(clip->flag&MCLIP_USE_PROXY) {
+ if (clip->flag & MCLIP_USE_PROXY) {
switch(user->render_size) {
case MCLIP_PROXY_RENDER_SIZE_25:
- (*width)*= 4;
- (*height)*= 4;
+ (*width) *= 4;
+ (*height) *= 4;
break;
case MCLIP_PROXY_RENDER_SIZE_50:
- (*width)*= 2.0f;
- (*height)*= 2.0f;
+ (*width) *= 2.0f;
+ (*height) *= 2.0f;
break;
case MCLIP_PROXY_RENDER_SIZE_75:
- *width= ((float)*width)*4.0f/3.0f;
- *height= ((float)*height)*4.0f/3.0f;
+ *width = ((float)*width)*4.0f/3.0f;
+ *height = ((float)*height)*4.0f/3.0f;
break;
}
}
@@ -484,16 +532,16 @@ 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)
- undistibuf= BKE_tracking_distortion_exec(distortion, &clip->tracking, ibuf, ibuf->x, ibuf->y, 0.0f, 1);
+ if (distortion)
+ undistibuf = BKE_tracking_distortion_exec(distortion, &clip->tracking, ibuf, ibuf->x, ibuf->y, 0.0f, 1);
else
- undistibuf= BKE_tracking_undistort(&clip->tracking, ibuf, ibuf->x, ibuf->y, 0.0f);
+ undistibuf = BKE_tracking_undistort(&clip->tracking, ibuf, ibuf->x, ibuf->y, 0.0f);
- if(undistibuf->userflags&IB_RECT_INVALID) {
- ibuf->userflags&= ~IB_RECT_INVALID;
+ if (undistibuf->userflags & IB_RECT_INVALID) {
+ ibuf->userflags &= ~IB_RECT_INVALID;
IMB_rect_from_float(undistibuf);
}
@@ -507,7 +555,7 @@ static int need_undistortion_postprocess(MovieClipUser *user, int flag)
int result = 0;
/* only full undistorted render can be used as on-fly undistorting image */
- if(flag & MCLIP_USE_PROXY) {
+ if (flag & MCLIP_USE_PROXY) {
result |= (user->render_size == MCLIP_PROXY_RENDER_SIZE_FULL) &&
(user->render_flag & MCLIP_PROXY_RENDER_UNDISTORT) != 0;
}
@@ -526,51 +574,51 @@ static int need_postprocessed_frame(MovieClipUser *user, int flag, int postproce
static int check_undistortion_cache_flags(MovieClip *clip)
{
- MovieClipCache *cache= clip->cache;
- MovieTrackingCamera *camera= &clip->tracking.camera;
+ MovieClipCache *cache = clip->cache;
+ MovieTrackingCamera *camera = &clip->tracking.camera;
/* check for distortion model changes */
- if(!equals_v2v2(camera->principal, cache->postprocessed.principal))
- return 0;
+ if (!equals_v2v2(camera->principal, cache->postprocessed.principal))
+ return FALSE;
- if(!equals_v3v3(&camera->k1, &cache->postprocessed.k1))
- return 0;
+ if (!equals_v3v3(&camera->k1, &cache->postprocessed.k1))
+ return FALSE;
- return 1;
+ return TRUE;
}
static ImBuf *get_postprocessed_cached_frame(MovieClip *clip, MovieClipUser *user, int flag, int postprocess_flag)
{
- MovieClipCache *cache= clip->cache;
- int framenr= user->framenr;
- short proxy= IMB_PROXY_NONE;
- int render_flag= 0;
-
- if(flag&MCLIP_USE_PROXY) {
- proxy= rendersize_to_proxy(user, flag);
- render_flag= user->render_flag;
+ MovieClipCache *cache = clip->cache;
+ int framenr = user->framenr;
+ short proxy = IMB_PROXY_NONE;
+ int render_flag = 0;
+
+ if (flag & MCLIP_USE_PROXY) {
+ proxy = rendersize_to_proxy(user, flag);
+ render_flag = user->render_flag;
}
/* no cache or no cached postprocessed image */
- if(!clip->cache || !clip->cache->postprocessed.ibuf)
+ if (!clip->cache || !clip->cache->postprocessed.ibuf)
return NULL;
/* postprocessing happened for other frame */
- if(cache->postprocessed.framenr != framenr)
+ if (cache->postprocessed.framenr != framenr)
return NULL;
/* cached ibuf used different proxy settings */
- if(cache->postprocessed.render_flag != render_flag || cache->postprocessed.proxy != proxy)
+ if (cache->postprocessed.render_flag != render_flag || cache->postprocessed.proxy != proxy)
return NULL;
- if(cache->postprocessed.flag != postprocess_flag)
+ if (cache->postprocessed.flag != postprocess_flag)
return NULL;
- if(need_undistortion_postprocess(user, flag)) {
- if(!check_undistortion_cache_flags(clip))
+ if (need_undistortion_postprocess(user, flag)) {
+ if (!check_undistortion_cache_flags(clip))
return NULL;
}
- else if(cache->postprocessed.undistoriton_used)
+ else if (cache->postprocessed.undistoriton_used)
return NULL;
IMB_refImBuf(cache->postprocessed.ibuf);
@@ -580,54 +628,56 @@ static ImBuf *get_postprocessed_cached_frame(MovieClip *clip, MovieClipUser *use
static ImBuf *put_postprocessed_frame_to_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, int flag, int postprocess_flag)
{
- MovieClipCache *cache= clip->cache;
- MovieTrackingCamera *camera= &clip->tracking.camera;
+ MovieClipCache *cache = clip->cache;
+ MovieTrackingCamera *camera = &clip->tracking.camera;
ImBuf *postproc_ibuf = NULL;
- if(cache->postprocessed.ibuf)
+ if (cache->postprocessed.ibuf)
IMB_freeImBuf(cache->postprocessed.ibuf);
- cache->postprocessed.framenr= user->framenr;
+ cache->postprocessed.framenr = user->framenr;
cache->postprocessed.flag = postprocess_flag;
- if(flag&MCLIP_USE_PROXY) {
- cache->postprocessed.proxy= rendersize_to_proxy(user, flag);
- cache->postprocessed.render_flag= user->render_flag;
+ if (flag & MCLIP_USE_PROXY) {
+ cache->postprocessed.proxy = rendersize_to_proxy(user, flag);
+ cache->postprocessed.render_flag = user->render_flag;
}
else {
cache->postprocessed.proxy = IMB_PROXY_NONE;
cache->postprocessed.render_flag = 0;
}
- if(need_undistortion_postprocess(user, flag)) {
+ if (need_undistortion_postprocess(user, flag)) {
copy_v2_v2(cache->postprocessed.principal, camera->principal);
copy_v3_v3(&cache->postprocessed.k1, &camera->k1);
- cache->postprocessed.undistoriton_used = 1;
+ cache->postprocessed.undistoriton_used = TRUE;
postproc_ibuf= get_undistorted_ibuf(clip, NULL, ibuf);
}
- else cache->postprocessed.undistoriton_used = 0;
+ else {
+ cache->postprocessed.undistoriton_used = FALSE;
+ }
- if(postprocess_flag) {
+ if (postprocess_flag) {
int disable_red = postprocess_flag & MOVIECLIP_DISABLE_RED,
disable_green = postprocess_flag & MOVIECLIP_DISABLE_GREEN,
disable_blue = postprocess_flag & MOVIECLIP_DISABLE_BLUE,
grayscale = postprocess_flag & MOVIECLIP_PREVIEW_GRAYSCALE;
- if(!postproc_ibuf)
+ if (!postproc_ibuf)
postproc_ibuf = IMB_dupImBuf(ibuf);
- if(disable_red || disable_green || disable_blue || grayscale)
+ if (disable_red || disable_green || disable_blue || grayscale)
BKE_tracking_disable_imbuf_channels(postproc_ibuf, disable_red, disable_green, disable_blue, 1);
}
IMB_refImBuf(postproc_ibuf);
- cache->postprocessed.ibuf= postproc_ibuf;
+ cache->postprocessed.ibuf = postproc_ibuf;
- if(cache->stabilized.ibuf) {
+ if (cache->stabilized.ibuf) {
/* force stable buffer be re-calculated */
IMB_freeImBuf(cache->stabilized.ibuf);
- cache->stabilized.ibuf= NULL;
+ cache->stabilized.ibuf = NULL;
}
return postproc_ibuf;
@@ -636,49 +686,50 @@ static ImBuf *put_postprocessed_frame_to_cache(MovieClip *clip, MovieClipUser *u
static ImBuf *movieclip_get_postprocessed_ibuf(MovieClip *clip, MovieClipUser *user, int flag,
int postprocess_flag, int cache_flag)
{
- ImBuf *ibuf= NULL;
- int framenr= user->framenr, need_postprocess= 0;
+ ImBuf *ibuf = NULL;
+ int framenr = user->framenr, need_postprocess = FALSE;
/* 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 */
- if(need_postprocessed_frame(user, flag, postprocess_flag)) {
+ if (need_postprocessed_frame(user, flag, postprocess_flag)) {
ibuf= get_postprocessed_cached_frame(clip, user, flag, postprocess_flag);
- if(!ibuf)
- need_postprocess= 1;
+ if (!ibuf)
+ need_postprocess = TRUE;
}
- if(!ibuf)
+ if (!ibuf)
ibuf= get_imbuf_cache(clip, user, flag);
- if(!ibuf) {
- int use_sequence= 0;
+ if (!ibuf) {
+ int use_sequence = FALSE;
/* undistorted proxies for movies should be read as image sequence */
- use_sequence= (user->render_flag&MCLIP_PROXY_RENDER_UNDISTORT) &&
- (user->render_size!=MCLIP_PROXY_RENDER_SIZE_FULL);
+ use_sequence = (user->render_flag & MCLIP_PROXY_RENDER_UNDISTORT) &&
+ (user->render_size != MCLIP_PROXY_RENDER_SIZE_FULL);
- if(clip->source==MCLIP_SRC_SEQUENCE || use_sequence)
- ibuf= movieclip_load_sequence_file(clip, user, framenr, flag);
+ if (clip->source == MCLIP_SRC_SEQUENCE || use_sequence) {
+ ibuf = movieclip_load_sequence_file(clip, user, framenr, flag);
+ }
else {
- ibuf= movieclip_load_movie_file(clip, user, framenr, flag);
+ ibuf = movieclip_load_movie_file(clip, user, framenr, flag);
}
- if(ibuf && (cache_flag & MOVIECLIP_CACHE_SKIP) == 0)
+ if (ibuf && (cache_flag & MOVIECLIP_CACHE_SKIP) == 0)
put_imbuf_cache(clip, user, ibuf, flag);
}
- if(ibuf) {
- clip->lastframe= framenr;
+ if (ibuf) {
+ clip->lastframe = framenr;
real_ibuf_size(clip, user, ibuf, &clip->lastsize[0], &clip->lastsize[1]);
/* postprocess frame and put to cache */
- if(need_postprocess) {
- ImBuf *tmpibuf= ibuf;
- ibuf= put_postprocessed_frame_to_cache(clip, user, tmpibuf, flag, postprocess_flag);
+ if (need_postprocess) {
+ ImBuf *tmpibuf = ibuf;
+ ibuf = put_postprocessed_frame_to_cache(clip, user, tmpibuf, flag, postprocess_flag);
IMB_freeImBuf(tmpibuf);
}
}
@@ -712,27 +763,27 @@ static ImBuf *get_stable_cached_frame(MovieClip *clip, MovieClipUser *user, int
short proxy = IMB_PROXY_NONE;
int render_flag = 0;
- if(clip->flag&MCLIP_USE_PROXY) {
+ if (clip->flag & MCLIP_USE_PROXY) {
proxy = rendersize_to_proxy(user, clip->flag);
render_flag = user->render_flag;
}
/* there's no cached frame or it was calculated for another frame */
- if(!cache->stabilized.ibuf || cache->stabilized.framenr != framenr)
+ if (!cache->stabilized.ibuf || cache->stabilized.framenr != framenr)
return NULL;
/* cached ibuf used different proxy settings */
- if(cache->stabilized.render_flag!=render_flag || cache->stabilized.proxy!=proxy)
+ if (cache->stabilized.render_flag != render_flag || cache->stabilized.proxy != proxy)
return NULL;
- if(cache->stabilized.postprocess_flag != postprocess_flag)
+ if (cache->stabilized.postprocess_flag != postprocess_flag)
return NULL;
/* stabilization also depends on pixel aspect ratio */
- if(cache->stabilized.aspect != tracking->camera.pixel_aspect)
+ if (cache->stabilized.aspect != tracking->camera.pixel_aspect)
return NULL;
- if(cache->stabilized.filter != tracking->stabilization.filter)
+ if (cache->stabilized.filter != tracking->stabilization.filter)
return NULL;
stableibuf = cache->stabilized.ibuf;
@@ -740,7 +791,7 @@ static ImBuf *get_stable_cached_frame(MovieClip *clip, MovieClipUser *user, int
BKE_tracking_stabilization_data(&clip->tracking, framenr, stableibuf->x, stableibuf->y, tloc, &tscale, &tangle);
/* check for stabilization parameters */
- if(tscale != cache->stabilized.scale ||
+ if (tscale != cache->stabilized.scale ||
tangle != cache->stabilized.angle ||
!equals_v2v2(tloc, cache->stabilized.loc))
{
@@ -760,7 +811,7 @@ static ImBuf *put_stabilized_frame_to_cache(MovieClip *clip, MovieClipUser *user
ImBuf *stableibuf;
float tloc[2], tscale, tangle;
- if(cache->stabilized.ibuf)
+ if (cache->stabilized.ibuf)
IMB_freeImBuf(cache->stabilized.ibuf);
stableibuf = BKE_tracking_stabilize(&clip->tracking, framenr, ibuf, tloc, &tscale, &tangle);
@@ -775,9 +826,9 @@ static ImBuf *put_stabilized_frame_to_cache(MovieClip *clip, MovieClipUser *user
cache->stabilized.aspect = tracking->camera.pixel_aspect;
cache->stabilized.filter = tracking->stabilization.filter;
- if(clip->flag&MCLIP_USE_PROXY) {
- cache->stabilized.proxy= rendersize_to_proxy(user, clip->flag);
- cache->stabilized.render_flag= user->render_flag;
+ if (clip->flag & MCLIP_USE_PROXY) {
+ cache->stabilized.proxy = rendersize_to_proxy(user, clip->flag);
+ cache->stabilized.render_flag = user->render_flag;
}
else {
cache->stabilized.proxy = IMB_PROXY_NONE;
@@ -793,36 +844,47 @@ static ImBuf *put_stabilized_frame_to_cache(MovieClip *clip, MovieClipUser *user
ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip, MovieClipUser *user, float loc[2], float *scale, float *angle, int postprocess_flag)
{
- ImBuf *ibuf, *stableibuf= NULL;
- int framenr= user->framenr;
+ ImBuf *ibuf, *stableibuf = NULL;
+ int framenr = user->framenr;
- ibuf= BKE_movieclip_get_postprocessed_ibuf(clip, user, postprocess_flag);
+ ibuf = BKE_movieclip_get_postprocessed_ibuf(clip, user, postprocess_flag);
- if(!ibuf)
+ if (!ibuf)
return NULL;
- if(clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) {
+ if (clip->tracking.stabilization.flag & TRACKING_2D_STABILIZATION) {
MovieClipCache *cache= clip->cache;
- stableibuf= get_stable_cached_frame(clip, user, framenr, postprocess_flag);
+ stableibuf = get_stable_cached_frame(clip, user, framenr, postprocess_flag);
+
+ if (!stableibuf)
+ stableibuf = put_stabilized_frame_to_cache(clip, user, ibuf, framenr, postprocess_flag);
+
+ if (loc)
+ copy_v2_v2(loc, cache->stabilized.loc);
+
+ if (scale)
+ *scale= cache->stabilized.scale;
- if(!stableibuf)
- stableibuf= put_stabilized_frame_to_cache(clip, user, ibuf, framenr, postprocess_flag);
+ if (angle)
+ *angle= cache->stabilized.angle;
+ }
+ else {
+ if (loc)
+ zero_v2(loc);
- if(loc) copy_v2_v2(loc, cache->stabilized.loc);
- if(scale) *scale= cache->stabilized.scale;
- if(angle) *angle= cache->stabilized.angle;
- } else {
- if(loc) zero_v2(loc);
- if(scale) *scale= 1.0f;
- if(angle) *angle= 0.0f;
+ if (scale)
+ *scale= 1.0f;
- stableibuf= ibuf;
+ if (angle)
+ *angle= 0.0f;
+
+ stableibuf = ibuf;
}
- if(stableibuf!=ibuf) {
+ if (stableibuf != ibuf) {
IMB_freeImBuf(ibuf);
- ibuf= stableibuf;
+ ibuf = stableibuf;
}
return ibuf;
@@ -831,52 +893,63 @@ ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip, MovieClipUser *user, float
int BKE_movieclip_has_frame(MovieClip *clip, MovieClipUser *user)
{
- ImBuf *ibuf= BKE_movieclip_get_ibuf(clip, user);
+ ImBuf *ibuf = BKE_movieclip_get_ibuf(clip, user);
- if(ibuf) {
+ if (ibuf) {
IMB_freeImBuf(ibuf);
- return 1;
+ return TRUE;
}
- return 0;
+ return FALSE;
}
void BKE_movieclip_get_size(MovieClip *clip, MovieClipUser *user, int *width, int *height)
{
- if(user->framenr==clip->lastframe) {
- *width= clip->lastsize[0];
- *height= clip->lastsize[1];
- } else {
- ImBuf *ibuf= BKE_movieclip_get_ibuf(clip, user);
+ if (user->framenr == clip->lastframe) {
+ *width = clip->lastsize[0];
+ *height = clip->lastsize[1];
+ }
+ else {
+ ImBuf *ibuf = BKE_movieclip_get_ibuf(clip, user);
- if(ibuf && ibuf->x && ibuf->y) {
+ if (ibuf && ibuf->x && ibuf->y) {
real_ibuf_size(clip, user, ibuf, width, height);
- } else {
- *width= 0;
- *height= 0;
+ }
+ else {
+ *width = 0;
+ *height = 0;
}
- if(ibuf)
+ if (ibuf)
IMB_freeImBuf(ibuf);
}
}
+int BKE_movieclip_get_duration(MovieClip *clip)
+{
+ if (!clip->len) {
+ movieclip_calc_length(clip);
+ }
+
+ return clip->len;
+}
+
void BKE_movieclip_aspect(MovieClip *clip, float *aspx, float *aspy)
{
- *aspx= *aspy= 1.0;
+ *aspx = *aspy = 1.0;
/* x is always 1 */
- *aspy = clip->aspy/clip->aspx/clip->tracking.camera.pixel_aspect;
+ *aspy = clip->aspy / clip->aspx / clip->tracking.camera.pixel_aspect;
}
/* get segments of cached frames. useful for debugging cache policies */
void BKE_movieclip_get_cache_segments(MovieClip *clip, MovieClipUser *user, int *totseg_r, int **points_r)
{
- *totseg_r= 0;
- *points_r= NULL;
+ *totseg_r = 0;
+ *points_r = NULL;
- if(clip->cache) {
- int proxy= rendersize_to_proxy(user, clip->flag);
+ if (clip->cache) {
+ int proxy = rendersize_to_proxy(user, clip->flag);
IMB_moviecache_get_cache_segments(clip->cache->moviecache, proxy, user->render_flag, totseg_r, points_r);
}
@@ -886,27 +959,27 @@ void BKE_movieclip_user_set_frame(MovieClipUser *iuser, int framenr)
{
/* TODO: clamp framenr here? */
- iuser->framenr= framenr;
+ iuser->framenr = framenr;
}
static void free_buffers(MovieClip *clip)
{
- if(clip->cache) {
+ if (clip->cache) {
IMB_moviecache_free(clip->cache->moviecache);
- if(clip->cache->postprocessed.ibuf)
+ if (clip->cache->postprocessed.ibuf)
IMB_freeImBuf(clip->cache->postprocessed.ibuf);
- if(clip->cache->stabilized.ibuf)
+ if (clip->cache->stabilized.ibuf)
IMB_freeImBuf(clip->cache->stabilized.ibuf);
MEM_freeN(clip->cache);
- clip->cache= NULL;
+ clip->cache = NULL;
}
- if(clip->anim) {
+ if (clip->anim) {
IMB_free_anim(clip->anim);
- clip->anim= FALSE;
+ clip->anim = NULL;
}
BKE_free_animdata((ID *) clip);
@@ -917,67 +990,72 @@ void BKE_movieclip_reload(MovieClip *clip)
/* clear cache */
free_buffers(clip);
- clip->tracking.stabilization.ok= 0;
+ clip->tracking.stabilization.ok = FALSE;
/* update clip source */
- if(BLI_testextensie_array(clip->name, imb_ext_movie)) clip->source= MCLIP_SRC_MOVIE;
- else clip->source= MCLIP_SRC_SEQUENCE;
+ if (BLI_testextensie_array(clip->name, imb_ext_movie))
+ clip->source = MCLIP_SRC_MOVIE;
+ else
+ clip->source = MCLIP_SRC_SEQUENCE;
+
+ movieclip_calc_length(clip);
}
void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClipScopes *scopes)
{
- if(scopes->ok)
+ if (scopes->ok)
return;
- if(scopes->track_preview) {
+ if (scopes->track_preview) {
IMB_freeImBuf(scopes->track_preview);
- scopes->track_preview= NULL;
+ scopes->track_preview = NULL;
}
- scopes->marker= NULL;
- scopes->track= NULL;
+ scopes->marker = NULL;
+ scopes->track = NULL;
- if(clip) {
- MovieTrackingTrack *act_track= BKE_tracking_active_track(&clip->tracking);
+ if (clip) {
+ MovieTrackingTrack *act_track = BKE_tracking_active_track(&clip->tracking);
- if(act_track) {
- MovieTrackingTrack *track= act_track;
- MovieTrackingMarker *marker= BKE_tracking_get_marker(track, user->framenr);
+ if (act_track) {
+ MovieTrackingTrack *track = act_track;
+ MovieTrackingMarker *marker = BKE_tracking_get_marker(track, user->framenr);
- if(marker->flag&MARKER_DISABLED) {
- scopes->track_disabled= 1;
- } else {
- ImBuf *ibuf= BKE_movieclip_get_ibuf(clip, user);
+ if (marker->flag & MARKER_DISABLED) {
+ scopes->track_disabled = TRUE;
+ }
+ else {
+ ImBuf *ibuf = BKE_movieclip_get_ibuf(clip, user);
- scopes->track_disabled= 0;
+ scopes->track_disabled = FALSE;
- if(ibuf && ibuf->rect) {
+ if (ibuf && ibuf->rect) {
ImBuf *tmpibuf;
- MovieTrackingMarker undist_marker= *marker;
+ MovieTrackingMarker undist_marker = *marker;
- if(user->render_flag&MCLIP_PROXY_RENDER_UNDISTORT) {
+ if (user->render_flag & MCLIP_PROXY_RENDER_UNDISTORT) {
int width, height;
- float aspy= 1.0f/clip->tracking.camera.pixel_aspect;
+ float aspy= 1.0f / clip->tracking.camera.pixel_aspect;
BKE_movieclip_get_size(clip, user, &width, &height);
- undist_marker.pos[0]*= width;
- undist_marker.pos[1]*= height*aspy;
+ undist_marker.pos[0] *= width;
+ undist_marker.pos[1] *= height*aspy;
BKE_tracking_invert_intrinsics(&clip->tracking, undist_marker.pos, undist_marker.pos);
- undist_marker.pos[0]/= width;
- undist_marker.pos[1]/= height*aspy;
+ undist_marker.pos[0] /= width;
+ undist_marker.pos[1] /= height*aspy;
}
/* NOTE: margin should be kept in sync with value from ui_draw_but_TRACKPREVIEW */
tmpibuf= BKE_tracking_get_pattern_imbuf(ibuf, track, &undist_marker, 3 /* margin */,
1 /* anchor */, scopes->track_pos, NULL);
- if(tmpibuf->rect_float)
+ if (tmpibuf->rect_float)
IMB_rect_from_float(tmpibuf);
- if(tmpibuf->rect)
+ if (tmpibuf->rect)
scopes->track_preview= tmpibuf;
else
IMB_freeImBuf(tmpibuf);
@@ -986,46 +1064,46 @@ void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClip
IMB_freeImBuf(ibuf);
}
- if((track->flag&TRACK_LOCKED)==0) {
- scopes->marker= marker;
- scopes->track= track;
- scopes->slide_scale[0]= track->pat_max[0]-track->pat_min[0];
- scopes->slide_scale[1]= track->pat_max[1]-track->pat_min[1];
+ if ((track->flag & TRACK_LOCKED)==0) {
+ scopes->marker = marker;
+ scopes->track = track;
+ scopes->slide_scale[0] = track->pat_max[0]-track->pat_min[0];
+ scopes->slide_scale[1] = track->pat_max[1]-track->pat_min[1];
}
}
}
- scopes->framenr= user->framenr;
- scopes->ok= 1;
+ scopes->framenr = user->framenr;
+ scopes->ok = TRUE;
}
static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, int proxy_render_size, int undistorted)
{
char name[FILE_MAX];
int quality, rectx, recty;
- int size= rendersize_to_number(proxy_render_size);
+ int size = rendersize_to_number(proxy_render_size);
ImBuf *scaleibuf;
get_proxy_fname(clip, proxy_render_size, undistorted, cfra, name);
- rectx= ibuf->x*size/100.0f;
- recty= ibuf->y*size/100.0f;
+ rectx = ibuf->x * size / 100.0f;
+ recty = ibuf->y * size / 100.0f;
- scaleibuf= IMB_dupImBuf(ibuf);
+ scaleibuf = IMB_dupImBuf(ibuf);
IMB_scaleImBuf(scaleibuf, (short)rectx, (short)recty);
- quality= clip->proxy.quality;
- scaleibuf->ftype= JPG | quality;
+ quality = clip->proxy.quality;
+ scaleibuf->ftype = JPG | quality;
/* unsupported feature only confuses other s/w */
- if(scaleibuf->planes==32)
- scaleibuf->planes= 24;
+ if (scaleibuf->planes == 32)
+ scaleibuf->planes = 24;
BLI_lock_thread(LOCK_MOVIECLIP);
BLI_make_existing_file(name);
- if(IMB_saveiff(scaleibuf, name, IB_rect)==0)
+ if (IMB_saveiff(scaleibuf, name, IB_rect) == 0)
perror(name);
BLI_unlock_thread(LOCK_MOVIECLIP);
@@ -1034,30 +1112,30 @@ static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, i
}
void BKE_movieclip_build_proxy_frame(MovieClip *clip, int clip_flag, struct MovieDistortion *distortion,
- int cfra, int *build_sizes, int build_count, int undistorted)
+ int cfra, int *build_sizes, int build_count, int undistorted)
{
ImBuf *ibuf;
MovieClipUser user;
- user.framenr= cfra;
- user.render_flag= 0;
- user.render_size= MCLIP_PROXY_RENDER_SIZE_FULL;
+ user.framenr = cfra;
+ user.render_flag = 0;
+ user.render_size = MCLIP_PROXY_RENDER_SIZE_FULL;
- ibuf= BKE_movieclip_get_ibuf_flag(clip, &user, clip_flag, MOVIECLIP_CACHE_SKIP);
+ ibuf = BKE_movieclip_get_ibuf_flag(clip, &user, clip_flag, MOVIECLIP_CACHE_SKIP);
- if(ibuf) {
- ImBuf *tmpibuf= ibuf;
+ if (ibuf) {
+ ImBuf *tmpibuf = ibuf;
int i;
- if(undistorted)
- tmpibuf= get_undistorted_ibuf(clip, distortion, ibuf);
+ if (undistorted)
+ tmpibuf = get_undistorted_ibuf(clip, distortion, ibuf);
- for(i= 0; i<build_count; i++)
+ for (i = 0; i < build_count; i++)
movieclip_build_proxy_ibuf(clip, tmpibuf, cfra, build_sizes[i], undistorted);
IMB_freeImBuf(ibuf);
- if(tmpibuf!=ibuf)
+ if (tmpibuf != ibuf)
IMB_freeImBuf(tmpibuf);
}
}
@@ -1077,53 +1155,59 @@ void unlink_movieclip(Main *bmain, MovieClip *clip)
Scene *sce;
Object *ob;
- for(scr= bmain->screen.first; scr; scr= scr->id.next) {
- for(area= scr->areabase.first; area; area= area->next) {
- for(sl= area->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_CLIP) {
- SpaceClip *sc= (SpaceClip *) sl;
+ for (scr = bmain->screen.first; scr; scr = scr->id.next) {
+ for (area = scr->areabase.first; area; area = area->next) {
+ for (sl = area->spacedata.first; sl; sl = sl->next) {
+ if (sl->spacetype == SPACE_CLIP) {
+ SpaceClip *sc = (SpaceClip *) sl;
- if(sc->clip==clip)
- sc->clip= NULL;
+ if (sc->clip == clip)
+ sc->clip = NULL;
}
- else if(sl->spacetype==SPACE_VIEW3D) {
- View3D *v3d= (View3D *) sl;
+ else if (sl->spacetype == SPACE_VIEW3D) {
+ View3D *v3d = (View3D *) sl;
BGpic *bgpic;
- for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) {
- if(bgpic->clip==clip)
- bgpic->clip= NULL;
+ for (bgpic = v3d->bgpicbase.first; bgpic; bgpic = bgpic->next) {
+ if (bgpic->clip == clip)
+ bgpic->clip = NULL;
}
}
}
}
}
- for(sce= bmain->scene.first; sce; sce= sce->id.next) {
- if(sce->clip==clip)
- sce->clip= NULL;
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
+ if (sce->clip == clip)
+ sce->clip = NULL;
}
- for(ob= bmain->object.first; ob; ob= ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
bConstraint *con;
- for(con= ob->constraints.first; con; con= con->next) {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
+ for (con = ob->constraints.first; con; con = con->next) {
+ bConstraintTypeInfo *cti = constraint_get_typeinfo(con);
+
+ if (cti->type == CONSTRAINT_TYPE_FOLLOWTRACK) {
+ bFollowTrackConstraint *data = (bFollowTrackConstraint *) con->data;
- if(cti->type==CONSTRAINT_TYPE_FOLLOWTRACK) {
- bFollowTrackConstraint *data= (bFollowTrackConstraint *) con->data;
+ if (data->clip == clip)
+ data->clip = NULL;
+ }
+ else if (cti->type == CONSTRAINT_TYPE_CAMERASOLVER) {
+ bCameraSolverConstraint *data = (bCameraSolverConstraint *) con->data;
- if(data->clip==clip)
- data->clip= NULL;
+ if (data->clip == clip)
+ data->clip = NULL;
}
- else if(cti->type==CONSTRAINT_TYPE_CAMERASOLVER) {
- bCameraSolverConstraint *data= (bCameraSolverConstraint *) con->data;
+ else if (cti->type == CONSTRAINT_TYPE_OBJECTSOLVER) {
+ bObjectSolverConstraint *data = (bObjectSolverConstraint *) con->data;
- if(data->clip==clip)
- data->clip= NULL;
+ if (data->clip == clip)
+ data->clip = NULL;
}
}
}
- clip->id.us= 0;
+ clip->id.us = 0;
}
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index 95f4b465beb..d8117aa1344 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -40,6 +40,7 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
+#include "BLI_bitmap.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_pbvh.h"
@@ -76,6 +77,201 @@ typedef enum {
static void multires_mvert_to_ss(DerivedMesh *dm, MVert *mvert);
static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, DerivedMesh *dm2, DispOp op, DMGridData **oldGridData, int totlvl);
+/** Customdata **/
+
+void multires_customdata_delete(Mesh *me)
+{
+ 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 */
+ CustomData_external_remove(&em->bm->ldata, &me->id,
+ CD_MDISPS, 0);
+ BM_data_layer_free(em->bm, &em->bm->ldata, CD_MDISPS);
+ }
+ else {
+ CustomData_external_remove(&me->ldata, &me->id,
+ CD_MDISPS, me->totloop);
+ CustomData_free_layer_active(&me->ldata, CD_MDISPS,
+ me->totloop);
+ }
+}
+
+/** Grid hiding **/
+static BLI_bitmap multires_mdisps_upsample_hidden(BLI_bitmap lo_hidden,
+ int lo_level,
+ int hi_level,
+
+ /* assumed to be at hi_level (or
+ null) */
+ BLI_bitmap prev_hidden)
+{
+ BLI_bitmap subd;
+ int hi_gridsize = ccg_gridsize(hi_level);
+ int lo_gridsize = ccg_gridsize(lo_level);
+ int yh, xh, xl, yl, xo, yo, hi_ndx;
+ int offset, factor;
+
+ BLI_assert(lo_level <= hi_level);
+
+ /* fast case */
+ if (lo_level == hi_level)
+ return MEM_dupallocN(lo_hidden);
+
+ subd = BLI_BITMAP_NEW(hi_gridsize * hi_gridsize, "MDisps.hidden upsample");
+
+ factor = ccg_factor(lo_level, hi_level);
+ offset = 1 << (hi_level - lo_level - 1);
+
+ /* low-res blocks */
+ for (yl = 0; yl < lo_gridsize; yl++) {
+ for (xl = 0; xl < lo_gridsize; xl++) {
+ int lo_val = BLI_BITMAP_GET(lo_hidden, yl * lo_gridsize + xl);
+
+ /* high-res blocks */
+ for (yo = -offset; yo <= offset; yo++) {
+ yh = yl * factor + yo;
+ if (yh < 0 || yh >= hi_gridsize)
+ continue;
+
+ for (xo = -offset; xo <= offset; xo++) {
+ xh = xl * factor + xo;
+ if (xh < 0 || xh >= hi_gridsize)
+ continue;
+
+ hi_ndx = yh * hi_gridsize + xh;
+
+ if (prev_hidden) {
+ /* If prev_hidden is available, copy it to
+ subd, except when the equivalent element in
+ lo_hidden is different */
+ if (lo_val != prev_hidden[hi_ndx])
+ BLI_BITMAP_MODIFY(subd, hi_ndx, lo_val);
+ else
+ BLI_BITMAP_MODIFY(subd, hi_ndx, prev_hidden[hi_ndx]);
+ }
+ else {
+ BLI_BITMAP_MODIFY(subd, hi_ndx, lo_val);
+ }
+ }
+ }
+ }
+ }
+
+ return subd;
+}
+
+static BLI_bitmap multires_mdisps_downsample_hidden(BLI_bitmap old_hidden,
+ int old_level,
+ int new_level)
+{
+ BLI_bitmap new_hidden;
+ int new_gridsize = ccg_gridsize(new_level);
+ int old_gridsize = ccg_gridsize(old_level);
+ int x, y, factor, old_value;
+
+ BLI_assert(new_level <= old_level);
+ factor = ccg_factor(new_level, old_level);
+ new_hidden = BLI_BITMAP_NEW(new_gridsize * new_gridsize,
+ "downsample hidden");
+
+
+
+ for (y = 0; y < new_gridsize; y++) {
+ for (x = 0; x < new_gridsize; x++) {
+ old_value = BLI_BITMAP_GET(old_hidden,
+ factor*y*old_gridsize + x*factor);
+
+ BLI_BITMAP_MODIFY(new_hidden, y*new_gridsize + x, old_value);
+ }
+ }
+
+ return new_hidden;
+}
+
+static void multires_output_hidden_to_ccgdm(CCGDerivedMesh *ccgdm,
+ Mesh *me, int level)
+{
+ const MDisps *mdisps = CustomData_get_layer(&me->ldata, CD_MDISPS);
+ BLI_bitmap *grid_hidden = ccgdm->gridHidden;
+ int *gridOffset;
+ int i, j;
+
+ gridOffset = ccgdm->dm.getGridOffset(&ccgdm->dm);
+
+ for (i = 0; i < me->totpoly; i++) {
+ for (j = 0; j < me->mpoly[i].totloop; j++) {
+ int g = gridOffset[i] + j;
+ const MDisps *md = &mdisps[g];
+ BLI_bitmap gh = md->hidden;
+
+ if (gh) {
+ grid_hidden[g] =
+ multires_mdisps_downsample_hidden(gh, md->level, level);
+ }
+ }
+ }
+}
+
+/* subdivide mdisps.hidden if needed (assumes that md.level reflects
+ the current level of md.hidden) */
+static void multires_mdisps_subdivide_hidden(MDisps *md, int new_level)
+{
+ BLI_bitmap subd;
+
+ BLI_assert(md->hidden);
+
+ /* nothing to do if already subdivided enough */
+ if (md->level >= new_level)
+ return;
+
+ subd = multires_mdisps_upsample_hidden(md->hidden,
+ md->level,
+ new_level,
+ NULL);
+
+ /* swap in the subdivided data */
+ MEM_freeN(md->hidden);
+ md->hidden = subd;
+}
+
+static MDisps *multires_mdisps_initialize_hidden(Mesh *me, int level)
+{
+ MDisps *mdisps = CustomData_add_layer(&me->ldata, CD_MDISPS,
+ CD_CALLOC, 0, me->totloop);
+ int gridsize = ccg_gridsize(level);
+ int gridarea = gridsize * gridsize;
+ int i, j, k;
+
+ for (i = 0; i < me->totpoly; i++) {
+ int hide = 0;
+
+ for (j = 0; j < me->mpoly[i].totloop; j++) {
+ if (me->mvert[me->mloop[me->mpoly[i].loopstart + j].v].flag & ME_HIDE) {
+ hide = 1;
+ break;
+ }
+ }
+
+ if (!hide)
+ continue;
+
+ for (j = 0; j < me->mpoly[i].totloop; j++) {
+ MDisps *md = &mdisps[me->mpoly[i].loopstart + j];
+
+ BLI_assert(!md->hidden);
+
+ md->hidden = BLI_BITMAP_NEW(gridarea, "MDisps.hidden initialize");
+
+ for (k = 0; k < gridarea; k++)
+ BLI_BITMAP_SET(md->hidden, k);
+ }
+ }
+
+ return mdisps;
+}
+
DerivedMesh *get_multires_dm(Scene *scene, MultiresModifierData *mmd, Object *ob)
{
ModifierData *md= (ModifierData *)mmd;
@@ -106,8 +302,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 +324,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;
}
@@ -156,16 +352,16 @@ static void multires_set_tot_level(Object *ob, MultiresModifierData *mmd, int lv
mmd->renderlvl = CLAMPIS(MAX2(mmd->renderlvl, lvl), 0, mmd->totlvl);
}
-static void multires_dm_mark_as_modified(DerivedMesh *dm)
+static void multires_dm_mark_as_modified(DerivedMesh *dm, MultiresModifiedFlags flags)
{
CCGDerivedMesh *ccgdm = (CCGDerivedMesh*)dm;
- ccgdm->multires.modified = 1;
+ ccgdm->multires.modified_flags |= flags;
}
-void multires_mark_as_modified(Object *ob)
+void multires_mark_as_modified(Object *ob, MultiresModifiedFlags flags)
{
if (ob && ob->derivedFinal)
- multires_dm_mark_as_modified(ob->derivedFinal);
+ multires_dm_mark_as_modified(ob->derivedFinal, flags);
}
void multires_force_update(Object *ob)
@@ -205,7 +401,7 @@ int multiresModifier_reshapeFromDM(Scene *scene, MultiresModifierData *mmd,
if (mrdm && srcdm && mrdm->getNumVerts(mrdm) == srcdm->getNumVerts(srcdm)) {
multires_mvert_to_ss(mrdm, srcdm->getVertArray(srcdm));
- multires_dm_mark_as_modified(mrdm);
+ multires_dm_mark_as_modified(mrdm, MULTIRES_COORDS_MODIFIED);
multires_force_update(ob);
mrdm->release(mrdm);
@@ -269,15 +465,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)
@@ -321,6 +516,7 @@ static void multires_set_tot_mdisps(Mesh *me, int lvl)
if (mdisps) {
for (i = 0; i < me->totloop; i++, mdisps++) {
mdisps->totdisp = multires_grid_tot[lvl];
+ mdisps->level = lvl;
}
}
}
@@ -336,9 +532,13 @@ static void multires_reallocate_mdisps(int totloop, MDisps *mdisps, int lvl)
if (mdisps[i].disps)
MEM_freeN(mdisps[i].disps);
+
+ if (mdisps[i].level && mdisps[i].hidden)
+ multires_mdisps_subdivide_hidden(&mdisps[i], lvl);
mdisps[i].disps = disps;
mdisps[i].totdisp = totdisp;
+ mdisps[i].level = lvl;
}
}
@@ -420,6 +620,14 @@ static void multires_del_higher(MultiresModifierData *mmd, Object *ob, int lvl)
hdisps = mdisp->disps;
multires_copy_grid(ndisps, hdisps, nsize, hsize);
+ if (mdisp->hidden) {
+ BLI_bitmap gh =
+ multires_mdisps_downsample_hidden(mdisp->hidden,
+ mdisp->level,
+ lvl);
+ MEM_freeN(mdisp->hidden);
+ mdisp->hidden = gh;
+ }
ndisps += nsize*nsize;
hdisps += hsize*hsize;
@@ -427,12 +635,12 @@ static void multires_del_higher(MultiresModifierData *mmd, Object *ob, int lvl)
MEM_freeN(mdisp->disps);
mdisp->disps = disps;
mdisp->totdisp = totdisp;
+ mdisp->level = lvl;
}
}
}
else {
- CustomData_external_remove(&me->ldata, &me->id, CD_MDISPS, me->totloop);
- CustomData_free_layer_active(&me->ldata, CD_MDISPS, me->totloop);
+ multires_customdata_delete(me);
}
}
@@ -470,7 +678,7 @@ static DerivedMesh *multires_dm_create_local(Object *ob, DerivedMesh *dm, int lv
mmd.totlvl = totlvl;
mmd.simple = simple;
- return multires_dm_create_from_derived(&mmd, 1, dm, ob, 0, 0);
+ return multires_dm_create_from_derived(&mmd, 1, dm, ob, 0);
}
static DerivedMesh *subsurf_dm_create_local(Object *ob, DerivedMesh *dm, int lvl, int simple, int optimal, int plain_uv)
@@ -491,7 +699,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];
@@ -503,9 +711,9 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Object *ob)
{
DerivedMesh *cddm, *dispdm, *origdm;
Mesh *me;
- ListBase *pmap;
+ const MeshElemMap *pmap;
float (*origco)[3];
- int i, j, offset, totlvl;
+ int i, j, k, offset, totlvl;
multires_force_update(ob);
@@ -539,22 +747,21 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Object *ob)
copy_v3_v3(origco[i], me->mvert[i].co);
for (i = 0; i < me->totvert; ++i) {
- IndexNode *n;
float avg_no[3] = {0,0,0}, center[3] = {0,0,0}, push[3];
float dist;
- int tot;
+ int tot = 0;
/* don't adjust verts not used by at least one poly */
- if (!pmap[i].first)
+ if (!pmap[i].count)
continue;
/* find center */
- for (n = pmap[i].first, tot = 0; n; n = n->next) {
- const MPoly *p = &me->mpoly[n->index];
+ for (j = 0; j < pmap[i].count; j++) {
+ const MPoly *p = &me->mpoly[pmap[i].indices[j]];
/* this double counts, not sure if that's bad or good */
- for (j = 0; j < p->totloop; ++j) {
- int vndx = me->mloop[p->loopstart + j].v;
+ for (k = 0; k < p->totloop; ++k) {
+ int vndx = me->mloop[p->loopstart + k].v;
if (vndx != i) {
add_v3_v3(center, origco[vndx]);
++tot;
@@ -564,29 +771,29 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Object *ob)
mul_v3_fl(center, 1.0f / tot);
/* find normal */
- for (n = pmap[i].first; n; n = n->next) {
- const MPoly *p = &me->mpoly[n->index];
+ for (j = 0; j < pmap[i].count; j++) {
+ const MPoly *p = &me->mpoly[pmap[i].indices[j]];
MPoly fake_poly;
MLoop *fake_loops;
float (*fake_co)[3];
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");
fake_co = MEM_mallocN(sizeof(float) * 3 * p->totloop, "fake_co");
- for (j = 0; j < p->totloop; ++j) {
- int vndx = me->mloop[p->loopstart + j].v;
+ for (k = 0; k < p->totloop; ++k) {
+ int vndx = me->mloop[p->loopstart + k].v;
- fake_loops[j].v = j;
+ fake_loops[k].v = k;
if (vndx == i)
- copy_v3_v3(fake_co[j], center);
+ copy_v3_v3(fake_co[k], center);
else
- copy_v3_v3(fake_co[j], origco[vndx]);
+ copy_v3_v3(fake_co[k], origco[vndx]);
}
mesh_calc_poly_normal_coords(&fake_poly, fake_loops,
@@ -635,7 +842,7 @@ static void multires_subdivide(MultiresModifierData *mmd, Object *ob, int totlvl
mdisps = CustomData_get_layer(&me->ldata, CD_MDISPS);
if (!mdisps)
- mdisps = CustomData_add_layer(&me->ldata, CD_MDISPS, CD_DEFAULT, NULL, me->totloop);
+ mdisps = multires_mdisps_initialize_hidden(me, totlvl);
if (mdisps->disps && !updateblock && totlvl > 1) {
/* upsample */
@@ -813,20 +1020,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);
@@ -843,7 +1050,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, DerivedMesh *dm
}
}
-static void multiresModifier_update(DerivedMesh *dm)
+void multires_modifier_update_mdisps(struct DerivedMesh *dm)
{
CCGDerivedMesh *ccgdm= (CCGDerivedMesh*)dm;
Object *ob;
@@ -938,6 +1145,37 @@ static void multiresModifier_update(DerivedMesh *dm)
}
}
+void multires_modifier_update_hidden(DerivedMesh *dm)
+{
+ CCGDerivedMesh *ccgdm= (CCGDerivedMesh*)dm;
+ BLI_bitmap *grid_hidden= ccgdm->gridHidden;
+ Mesh *me = ccgdm->multires.ob->data;
+ MDisps *mdisps = CustomData_get_layer(&me->ldata, CD_MDISPS);
+ int totlvl = ccgdm->multires.totlvl;
+ int lvl = ccgdm->multires.lvl;
+
+ if (mdisps) {
+ int i;
+
+ for (i = 0; i < me->totloop; i++) {
+ MDisps *md = &mdisps[i];
+ BLI_bitmap gh = grid_hidden[i];
+
+ if (!gh && md->hidden) {
+ MEM_freeN(md->hidden);
+ md->hidden = NULL;
+ }
+ else if (gh) {
+ gh = multires_mdisps_upsample_hidden(gh, lvl, totlvl,
+ md->hidden);
+ if (md->hidden)
+ MEM_freeN(md->hidden);
+
+ md->hidden = gh;
+ }
+ }
+ }
+}
void multires_set_space(DerivedMesh *dm, Object *ob, int from, int to)
{
@@ -1000,6 +1238,7 @@ void multires_set_space(DerivedMesh *dm, Object *ob, int from, int to)
/* when adding new faces in edit mode, need to allocate disps */
if (!mdisp->disps) {
mdisp->totdisp = gridSize*gridSize;
+ mdisp->level = totlvl;
mdisp->disps = MEM_callocN(sizeof(float)*3*mdisp->totdisp, "disp in multires_set_space");
}
@@ -1084,12 +1323,13 @@ void multires_stitch_grids(Object *ob)
}
}
-DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, int local_mmd, DerivedMesh *dm, Object *ob,
- int useRenderParams, int UNUSED(isFinalCalc))
+DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd,
+ int local_mmd, DerivedMesh *dm,
+ Object *ob, int useRenderParams)
{
Mesh *me= ob->data;
DerivedMesh *result;
- CCGDerivedMesh *ccgdm;
+ CCGDerivedMesh *ccgdm = NULL;
DMGridData **gridData, **subGridData;
int lvl= multires_get_level(ob, mmd, useRenderParams);
int i, gridSize, numGrids;
@@ -1109,8 +1349,7 @@ DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, int loca
ccgdm->multires.local_mmd = local_mmd;
ccgdm->multires.lvl = lvl;
ccgdm->multires.totlvl = mmd->totlvl;
- ccgdm->multires.modified = 0;
- ccgdm->multires.update = multiresModifier_update;
+ ccgdm->multires.modified_flags = 0;
}
numGrids = result->getNumGrids(result);
@@ -1130,6 +1369,10 @@ DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, int loca
/*run displacement*/
multiresModifier_disp_run(result, ob->data, dm, APPLY_DISPLACEMENTS, subGridData, mmd->totlvl);
+ /* copy hidden elements for this level */
+ if (ccgdm)
+ multires_output_hidden_to_ccgdm(ccgdm, me, lvl);
+
for (i = 0; i < numGrids; i++)
MEM_freeN(subGridData[i]);
MEM_freeN(subGridData);
@@ -1138,7 +1381,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)
@@ -1226,6 +1469,7 @@ static void old_mdisps_convert(MFace *mface, MDisps *mdisp)
MEM_freeN(mdisp->disps);
mdisp->totdisp= newtotdisp;
+ mdisp->level= newlvl;
mdisp->disps= disps;
}
@@ -1254,6 +1498,7 @@ void multires_load_old_250(Mesh *me)
for (j=0; j < mf->v4 ? 4 : 3; j++, k++) {
mdisps2[k].disps = MEM_callocN(sizeof(float)*3*totdisp, "multires disp in conversion");
mdisps2[k].totdisp = totdisp;
+ mdisps2[k].level = mdisps[i].level;
memcpy(mdisps2[k].disps, mdisps[i].disps + totdisp*j, totdisp);
}
@@ -1669,7 +1914,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;
@@ -1745,11 +1990,11 @@ void multires_load_old(Object *ob, Mesh *me)
mmd->lvl = mmd->totlvl;
orig = CDDM_from_mesh(me, NULL);
- dm = multires_dm_create_from_derived(mmd, 0, orig, ob, 0, 0);
+ dm = multires_dm_create_from_derived(mmd, 0, orig, ob, 0);
multires_load_old_dm(dm, me, mmd->totlvl+1);
- multires_dm_mark_as_modified(dm);
+ multires_dm_mark_as_modified(dm, MULTIRES_COORDS_MODIFIED);
dm->release(dm);
orig->release(orig);
@@ -1776,14 +2021,11 @@ 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) */
-
- Mesh *me= (Mesh*)ob->data;
+ * 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) */
- CustomData_external_remove(&me->ldata, &me->id, CD_MDISPS, me->totloop);
- CustomData_free_layer_active(&me->ldata, CD_MDISPS, me->totloop);
+ multires_customdata_delete(ob->data);
}
if (!mmd || !to_mmd) return;
diff --git a/source/blender/blenkernel/intern/navmesh_conversion.c b/source/blender/blenkernel/intern/navmesh_conversion.c
index 4c9c0a3a1fc..27e309e9d20 100644
--- a/source/blender/blenkernel/intern/navmesh_conversion.c
+++ b/source/blender/blenkernel/intern/navmesh_conversion.c
@@ -44,12 +44,12 @@
#include "recast-capi.h"
-BM_INLINE float area2(const float* a, const float* b, const float* c)
+BLI_INLINE float area2(const float* a, const float* b, const float* c)
{
return (b[0] - a[0]) * (c[2] - a[2]) - (c[0] - a[0]) * (b[2] - a[2]);
}
-BM_INLINE int left(const float* a, const float* b, const float* c)
+BLI_INLINE int left(const float* a, const float* b, const float* c)
{
return area2(a, b, c) < 0;
}
@@ -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++)
@@ -502,7 +501,7 @@ exit:
int polyFindVertex(const unsigned short* p, const int vertsPerPoly, unsigned short vertexIdx)
{
int i, res = -1;
- for(i=0; i<vertsPerPoly; i++)
+ for (i=0; i<vertsPerPoly; i++)
{
if (p[i]==0xffff)
break;
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index a6795ed3a7d..56fec119cce 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -140,7 +140,7 @@ void free_nladata (ListBase *tracks)
NlaTrack *nlt, *nltn;
/* sanity checks */
- if ELEM(NULL, tracks, tracks->first)
+ if (ELEM(NULL, tracks, tracks->first))
return;
/* free tracks one by one */
@@ -221,7 +221,7 @@ void copy_nladata (ListBase *dst, ListBase *src)
NlaTrack *nlt, *nlt_d;
/* sanity checks */
- if ELEM(NULL, dst, src)
+ if (ELEM(NULL, dst, src))
return;
/* clear out the destination list first for precautions... */
@@ -286,7 +286,7 @@ NlaStrip *add_nlastrip (bAction *act)
* - selected flag to highlight this to the user
* - auto-blends to ensure that blend in/out values are automatically
* determined by overlaps of strips
- * - (XXX) synchronisation of strip-length in accordance with changes to action-length
+ * - (XXX) synchronization of strip-length in accordance with changes to action-length
* is not done though, since this should only really happens in editmode for strips now
* though this decision is still subject to further review...
*/
@@ -319,7 +319,7 @@ NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act)
NlaTrack *nlt;
/* sanity checks */
- if ELEM(NULL, adt, act)
+ if (ELEM(NULL, adt, act))
return NULL;
/* create a new NLA strip */
@@ -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);
@@ -587,7 +586,7 @@ void BKE_nlastrips_sort_strips (ListBase *strips)
NlaStrip *strip, *sstrip, *stripn;
/* sanity checks */
- if ELEM(NULL, strips, strips->first)
+ if (ELEM(NULL, strips, strips->first))
return;
/* we simply perform insertion sort on this list, since it is assumed that per track,
@@ -631,7 +630,7 @@ short BKE_nlastrips_add_strip (ListBase *strips, NlaStrip *strip)
short not_added = 1;
/* sanity checks */
- if ELEM(NULL, strips, strip)
+ if (ELEM(NULL, strips, strip))
return 0;
/* check if any space to add */
@@ -669,7 +668,7 @@ void BKE_nlastrips_make_metas (ListBase *strips, short temp)
NlaStrip *strip, *stripn;
/* sanity checks */
- if ELEM(NULL, strips, strips->first)
+ if (ELEM(NULL, strips, strips->first))
return;
/* group all continuous chains of selected strips into meta-strips */
@@ -720,7 +719,7 @@ void BKE_nlastrips_clear_metastrip (ListBase *strips, NlaStrip *strip)
NlaStrip *cs, *csn;
/* sanity check */
- if ELEM(NULL, strips, strip)
+ if (ELEM(NULL, strips, strip))
return;
/* move each one of the meta-strip's children before the meta-strip
@@ -745,7 +744,7 @@ void BKE_nlastrips_clear_metas (ListBase *strips, short onlySel, short onlyTemp)
NlaStrip *strip, *stripn;
/* sanity checks */
- if ELEM(NULL, strips, strips->first)
+ if (ELEM(NULL, strips, strips->first))
return;
/* remove meta-strips fitting the criteria of the arguments */
@@ -770,7 +769,7 @@ void BKE_nlastrips_clear_metas (ListBase *strips, short onlySel, short onlyTemp)
short BKE_nlameta_add_strip (NlaStrip *mstrip, NlaStrip *strip)
{
/* sanity checks */
- if ELEM(NULL, mstrip, strip)
+ if (ELEM(NULL, mstrip, strip))
return 0;
/* firstly, check if the meta-strip has space for this */
@@ -778,7 +777,7 @@ short BKE_nlameta_add_strip (NlaStrip *mstrip, NlaStrip *strip)
return 0;
/* check if this would need to be added to the ends of the meta,
- * and subsequently, if the neighbouring strips allow us enough room
+ * and subsequently, if the neighboring strips allow us enough room
*/
if (strip->start < mstrip->start) {
/* check if strip to the left (if it exists) ends before the
@@ -828,7 +827,7 @@ void BKE_nlameta_flush_transforms (NlaStrip *mstrip)
* - strip must exist
* - strip must be a meta-strip with some contents
*/
- if ELEM(NULL, mstrip, mstrip->strips.first)
+ if (ELEM(NULL, mstrip, mstrip->strips.first))
return;
if (mstrip->type != NLASTRIP_TYPE_META)
return;
@@ -841,7 +840,7 @@ void BKE_nlameta_flush_transforms (NlaStrip *mstrip)
oEnd= ((NlaStrip *)mstrip->strips.last)->end;
offset= mstrip->start - oStart;
- /* optimisation:
+ /* optimization:
* don't flush if nothing changed yet
* TODO: maybe we need a flag to say always flush?
*/
@@ -900,7 +899,7 @@ NlaTrack *BKE_nlatrack_find_active (ListBase *tracks)
NlaTrack *nlt;
/* sanity check */
- if ELEM(NULL, tracks, tracks->first)
+ if (ELEM(NULL, tracks, tracks->first))
return NULL;
/* try to find the first active track */
@@ -921,7 +920,7 @@ void BKE_nlatrack_solo_toggle (AnimData *adt, NlaTrack *nlt)
NlaTrack *nt;
/* sanity check */
- if ELEM(NULL, adt, adt->nla_tracks.first)
+ if (ELEM(NULL, adt, adt->nla_tracks.first))
return;
/* firstly, make sure 'solo' flag for all tracks is disabled */
@@ -953,7 +952,7 @@ void BKE_nlatrack_set_active (ListBase *tracks, NlaTrack *nlt_a)
NlaTrack *nlt;
/* sanity check */
- if ELEM(NULL, tracks, tracks->first)
+ if (ELEM(NULL, tracks, tracks->first))
return;
/* deactive all the rest */
@@ -991,7 +990,7 @@ short BKE_nlatrack_has_space (NlaTrack *nlt, float start, float end)
void BKE_nlatrack_sort_strips (NlaTrack *nlt)
{
/* sanity checks */
- if ELEM(NULL, nlt, nlt->strips.first)
+ if (ELEM(NULL, nlt, nlt->strips.first))
return;
/* sort the strips with a more generic function */
@@ -1004,7 +1003,7 @@ void BKE_nlatrack_sort_strips (NlaTrack *nlt)
short BKE_nlatrack_add_strip (NlaTrack *nlt, NlaStrip *strip)
{
/* sanity checks */
- if ELEM(NULL, nlt, strip)
+ if (ELEM(NULL, nlt, strip))
return 0;
/* try to add the strip to the track using a more generic function */
@@ -1018,14 +1017,14 @@ short BKE_nlatrack_get_bounds (NlaTrack *nlt, float bounds[2])
{
NlaStrip *strip;
- /* initialise bounds */
+ /* initialize bounds */
if (bounds)
bounds[0] = bounds[1] = 0.0f;
else
return 0;
/* sanity checks */
- if ELEM(NULL, nlt, nlt->strips.first)
+ if (ELEM(NULL, nlt, nlt->strips.first))
return 0;
/* lower bound is first strip's start frame */
@@ -1048,7 +1047,7 @@ NlaStrip *BKE_nlastrip_find_active (NlaTrack *nlt)
NlaStrip *strip;
/* sanity check */
- if ELEM(NULL, nlt, nlt->strips.first)
+ if (ELEM(NULL, nlt, nlt->strips.first))
return NULL;
/* try to find the first active strip */
@@ -1147,7 +1146,7 @@ static short nlastrip_is_first (AnimData *adt, NlaStrip *strip)
NlaStrip *ns;
/* sanity checks */
- if ELEM(NULL, adt, strip)
+ if (ELEM(NULL, adt, strip))
return 0;
/* check if strip has any strips before it */
@@ -1177,7 +1176,7 @@ short BKE_nlatrack_has_animated_strips (NlaTrack *nlt)
NlaStrip *strip;
/* sanity checks */
- if ELEM(NULL, nlt, nlt->strips.first)
+ if (ELEM(NULL, nlt, nlt->strips.first))
return 0;
/* check each strip for F-Curves only (don't care about whether the flags are set) */
@@ -1196,7 +1195,7 @@ short BKE_nlatracks_have_animated_strips (ListBase *tracks)
NlaTrack *nlt;
/* sanity checks */
- if ELEM(NULL, tracks, tracks->first)
+ if (ELEM(NULL, tracks, tracks->first))
return 0;
/* check each track, stopping on the first hit */
@@ -1235,7 +1234,7 @@ void BKE_nlastrip_validate_fcurves (NlaStrip *strip)
/* store path - make copy, and store that */
fcu->rna_path= BLI_strdupn("influence", 9);
- // TODO: insert a few keyframes to ensure default behaviour?
+ // TODO: insert a few keyframes to ensure default behavior?
}
}
@@ -1256,7 +1255,7 @@ void BKE_nlastrip_validate_fcurves (NlaStrip *strip)
/* store path - make copy, and store that */
fcu->rna_path= BLI_strdupn("strip_time", 10);
- // TODO: insert a few keyframes to ensure default behaviour?
+ // TODO: insert a few keyframes to ensure default behavior?
}
}
}
@@ -1280,7 +1279,7 @@ void BKE_nlastrip_validate_name (AnimData *adt, NlaStrip *strip)
NlaTrack *nlt;
/* sanity checks */
- if ELEM(NULL, adt, strip)
+ if (ELEM(NULL, adt, strip))
return;
/* give strip a default name if none already */
@@ -1377,7 +1376,7 @@ static void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls)
float *ns=NULL, *ne=NULL;
/* sanity checks */
- if ELEM(NULL, nls, nlt)
+ if (ELEM(NULL, nls, nlt))
return;
if ((nlt->prev == NULL) && (nlt->next == NULL))
return;
@@ -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;
@@ -1425,7 +1422,7 @@ void BKE_nla_validate_state (AnimData *adt)
NlaTrack *nlt;
/* sanity checks */
- if ELEM(NULL, adt, adt->nla_tracks.first)
+ if (ELEM(NULL, adt, adt->nla_tracks.first))
return;
/* adjust blending values for auto-blending, and also do an initial pass to find the earliest strip */
@@ -1479,7 +1476,7 @@ void BKE_nla_action_pushdown (AnimData *adt)
/* sanity checks */
// TODO: need to report the error for this
- if ELEM(NULL, adt, adt->action)
+ if (ELEM(NULL, adt, adt->action))
return;
/* if the action is empty, we also shouldn't try to add to stack,
@@ -1487,7 +1484,7 @@ void BKE_nla_action_pushdown (AnimData *adt)
*/
// TODO: what about modifiers?
if (action_has_motion(adt->action) == 0) {
- printf("BKE_nla_action_pushdown(): action has no data \n");
+ printf("BKE_nla_action_pushdown(): action has no data\n");
return;
}
@@ -1527,7 +1524,7 @@ short BKE_nla_tweakmode_enter (AnimData *adt)
NlaStrip *strip, *activeStrip=NULL;
/* verify that data is valid */
- if ELEM(NULL, adt, adt->nla_tracks.first)
+ if (ELEM(NULL, adt, adt->nla_tracks.first))
return 0;
/* if block is already in tweakmode, just leave, but we should report
@@ -1578,10 +1575,10 @@ short BKE_nla_tweakmode_enter (AnimData *adt)
}
}
- if ELEM3(NULL, activeTrack, activeStrip, activeStrip->act) {
- if (G.f & G_DEBUG) {
- printf("NLA tweakmode enter - neither active requirement found \n");
- printf("\tactiveTrack = %p, activeStrip = %p \n", (void *)activeTrack, (void *)activeStrip);
+ if (ELEM3(NULL, activeTrack, activeStrip, activeStrip->act)) {
+ if (G.debug & G_DEBUG) {
+ printf("NLA tweakmode enter - neither active requirement found\n");
+ printf("\tactiveTrack = %p, activeStrip = %p\n", (void *)activeTrack, (void *)activeStrip);
}
return 0;
}
@@ -1628,7 +1625,7 @@ void BKE_nla_tweakmode_exit (AnimData *adt)
NlaTrack *nlt;
/* verify that data is valid */
- if ELEM(NULL, adt, adt->nla_tracks.first)
+ if (ELEM(NULL, adt, adt->nla_tracks.first))
return;
/* hopefully the flag is correct - skip if not on */
@@ -1670,7 +1667,7 @@ static void UNUSED_FUNCTION(BKE_nla_bake) (Scene *scene, ID *UNUSED(id), AnimDat
* 1) Scene and AnimData must be provided
* 2) there must be tracks to merge...
*/
- if ELEM3(NULL, scene, adt, adt->nla_tracks.first)
+ if (ELEM3(NULL, scene, adt, adt->nla_tracks.first))
return;
/* if animdata currently has an action, 'push down' this onto the stack first */
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index c394a5354f1..cbdbf0317b4 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -55,6 +55,8 @@
#include "BLI_path_util.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_animsys.h"
#include "BKE_action.h"
#include "BKE_fcurve.h"
@@ -66,8 +68,6 @@
#include "BKE_utildefines.h"
#include "BKE_utildefines.h"
-#include "BLI_listbase.h"
-
#include "RNA_access.h"
#include "NOD_socket.h"
@@ -87,7 +87,7 @@ bNodeTreeType *ntreeGetType(int type)
types_init = 0;
}
- if(type >= 0 && type < NUM_NTREE_TYPES) {
+ if (type >= 0 && type < NUM_NTREE_TYPES) {
return types[type];
}
else {
@@ -98,8 +98,8 @@ bNodeTreeType *ntreeGetType(int type)
static bNodeType *node_get_type(bNodeTree *ntree, int type)
{
bNodeType *ntype = ntreeGetType(ntree->type)->node_types.first;
- for(; ntype; ntype= ntype->next)
- if(ntype->type==type)
+ for (; ntype; ntype= ntype->next)
+ if (ntype->type==type)
return ntype;
return NULL;
@@ -120,7 +120,7 @@ bNodeSocketType *ntreeGetSocketType(int type)
types_init= 0;
}
- if(type < NUM_SOCKET_TYPES) {
+ if (type < NUM_SOCKET_TYPES) {
return types[type];
}
else {
@@ -132,23 +132,23 @@ void ntreeInitTypes(bNodeTree *ntree)
{
bNode *node, *next;
- for(node= ntree->nodes.first; node; node= next) {
+ for (node= ntree->nodes.first; node; node= next) {
next= node->next;
node->typeinfo= node_get_type(ntree, node->type);
- if(node->type==NODE_DYNAMIC) {
+ if (node->type==NODE_DYNAMIC) {
/* needed info if the pynode script fails now: */
node->storage= ntree;
- if(node->id!=NULL) { /* not an empty script node */
+ if (node->id!=NULL) { /* not an empty script node */
node->custom1= 0;
node->custom1= BSET(node->custom1,NODE_DYNAMIC_ADDEXIST);
}
-// if(node->typeinfo)
+// if (node->typeinfo)
// node->typeinfo->initfunc(node);
}
- if(node->typeinfo==NULL) {
+ if (node->typeinfo==NULL) {
printf("Error: Node type %s doesn't exist anymore, removed\n", node->name);
nodeFreeNode(ntree, node);
}
@@ -204,9 +204,9 @@ void nodeRemoveSocket(bNodeTree *ntree, bNode *node, bNodeSocket *sock)
{
bNodeLink *link, *next;
- for(link= ntree->links.first; link; link= next) {
+ for (link= ntree->links.first; link; link= next) {
next= link->next;
- if(link->fromsock==sock || link->tosock==sock) {
+ if (link->fromsock==sock || link->tosock==sock) {
nodeRemLink(ntree, link);
}
}
@@ -226,9 +226,9 @@ void nodeRemoveAllSockets(bNodeTree *ntree, bNode *node)
bNodeSocket *sock;
bNodeLink *link, *next;
- for(link= ntree->links.first; link; link= next) {
+ for (link= ntree->links.first; link; link= next) {
next= link->next;
- if(link->fromnode==node || link->tonode==node) {
+ if (link->fromnode==node || link->tonode==node) {
nodeRemLink(ntree, link);
}
}
@@ -256,28 +256,28 @@ int nodeFindNode(bNodeTree *ntree, bNodeSocket *sock, bNode **nodep, int *sockin
bNodeSocket *tsock;
int index= 0;
- for(node= ntree->nodes.first; node; node= node->next) {
- for(index=0, tsock= node->inputs.first; tsock; tsock= tsock->next, index++) {
- if(tsock==sock) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ for (index=0, tsock= node->inputs.first; tsock; tsock= tsock->next, index++) {
+ if (tsock==sock) {
if (in_out) *in_out= SOCK_IN;
break;
}
}
- if(tsock)
+ if (tsock)
break;
- for(index=0, tsock= node->outputs.first; tsock; tsock= tsock->next, index++) {
- if(tsock==sock) {
+ for (index=0, tsock= node->outputs.first; tsock; tsock= tsock->next, index++) {
+ if (tsock==sock) {
if (in_out) *in_out= SOCK_OUT;
break;
}
}
- if(tsock)
+ if (tsock)
break;
}
- if(node) {
+ if (node) {
*nodep= node;
- if(sockindex) *sockindex= index;
+ if (sockindex) *sockindex= index;
return 1;
}
@@ -291,17 +291,17 @@ static void node_add_sockets_from_type(bNodeTree *ntree, bNode *node, bNodeType
bNodeSocketTemplate *sockdef;
/* bNodeSocket *sock; */ /* UNUSED */
- if(ntype->inputs) {
+ if (ntype->inputs) {
sockdef= ntype->inputs;
- while(sockdef->type != -1) {
+ while (sockdef->type != -1) {
/* sock = */ node_add_input_from_template(ntree, node, sockdef);
sockdef++;
}
}
- if(ntype->outputs) {
+ if (ntype->outputs) {
sockdef= ntype->outputs;
- while(sockdef->type != -1) {
+ while (sockdef->type != -1) {
/* sock = */ node_add_output_from_template(ntree, node, sockdef);
sockdef++;
@@ -321,7 +321,7 @@ bNode *nodeAddNode(bNodeTree *ntree, struct bNodeTemplate *ntemp)
bNodeType *ntype;
ntype= node_get_type(ntree, ntemp->type);
- if(ntype == NULL) {
+ if (ntype == NULL) {
printf("nodeAddNodeType() error: '%d' type invalid\n", ntemp->type);
return NULL;
}
@@ -339,7 +339,7 @@ bNode *nodeAddNode(bNodeTree *ntree, struct bNodeTemplate *ntemp)
node_add_sockets_from_type(ntree, node, ntype);
- if(ntype->initfunc!=NULL)
+ if (ntype->initfunc!=NULL)
ntype->initfunc(ntree, node, ntemp);
/* initialize the node name with the node label */
@@ -357,14 +357,14 @@ void nodeMakeDynamicType(bNode *node)
{
/* find SH_DYNAMIC_NODE ntype */
bNodeType *ntype= ntreeGetType(NTREE_SHADER)->node_types.first;
- while(ntype) {
- if(ntype->type==NODE_DYNAMIC)
+ while (ntype) {
+ if (ntype->type==NODE_DYNAMIC)
break;
ntype= ntype->next;
}
/* make own type struct to fill */
- if(ntype) {
+ if (ntype) {
/*node->typeinfo= MEM_dupallocN(ntype);*/
bNodeType *newtype= MEM_callocN(sizeof(bNodeType), "dynamic bNodeType");
*newtype= *ntype;
@@ -387,7 +387,7 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node)
BLI_duplicatelist(&nnode->inputs, &node->inputs);
oldsock= node->inputs.first;
- for(sock= nnode->inputs.first; sock; sock= sock->next, oldsock= oldsock->next) {
+ for (sock= nnode->inputs.first; sock; sock= sock->next, oldsock= oldsock->next) {
oldsock->new_sock= sock;
sock->stack_index= 0;
@@ -402,7 +402,7 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node)
BLI_duplicatelist(&nnode->outputs, &node->outputs);
oldsock= node->outputs.first;
- for(sock= nnode->outputs.first; sock; sock= sock->next, oldsock= oldsock->next) {
+ for (sock= nnode->outputs.first; sock; sock= sock->next, oldsock= oldsock->next) {
oldsock->new_sock= sock;
sock->stack_index= 0;
@@ -417,7 +417,7 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node)
/* don't increase node->id users, freenode doesn't decrement either */
- if(node->typeinfo->copystoragefunc)
+ if (node->typeinfo->copystoragefunc)
node->typeinfo->copystoragefunc(node, nnode);
node->new_node= nnode;
@@ -436,67 +436,67 @@ bNodeLink *nodeAddLink(bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock,
bNodeLink *link= NULL;
int from= 0, to= 0;
- if(fromnode) {
+ if (fromnode) {
/* test valid input */
- for(sock= fromnode->outputs.first; sock; sock= sock->next)
- if(sock==fromsock)
+ for (sock= fromnode->outputs.first; sock; sock= sock->next)
+ if (sock==fromsock)
break;
- if(sock)
+ if (sock)
from= 1; /* OK */
else {
- for(sock= fromnode->inputs.first; sock; sock= sock->next)
- if(sock==fromsock)
+ for (sock= fromnode->inputs.first; sock; sock= sock->next)
+ if (sock==fromsock)
break;
- if(sock)
+ if (sock)
from= -1; /* OK but flip */
}
}
else {
/* check tree sockets */
- for(sock= ntree->inputs.first; sock; sock= sock->next)
- if(sock==fromsock)
+ for (sock= ntree->inputs.first; sock; sock= sock->next)
+ if (sock==fromsock)
break;
- if(sock)
+ if (sock)
from= 1; /* OK */
else {
- for(sock= ntree->outputs.first; sock; sock= sock->next)
- if(sock==fromsock)
+ for (sock= ntree->outputs.first; sock; sock= sock->next)
+ if (sock==fromsock)
break;
- if(sock)
+ if (sock)
from= -1; /* OK but flip */
}
}
- if(tonode) {
- for(sock= tonode->inputs.first; sock; sock= sock->next)
- if(sock==tosock)
+ if (tonode) {
+ for (sock= tonode->inputs.first; sock; sock= sock->next)
+ if (sock==tosock)
break;
- if(sock)
+ if (sock)
to= 1; /* OK */
else {
- for(sock= tonode->outputs.first; sock; sock= sock->next)
- if(sock==tosock)
+ for (sock= tonode->outputs.first; sock; sock= sock->next)
+ if (sock==tosock)
break;
- if(sock)
+ if (sock)
to= -1; /* OK but flip */
}
}
else {
/* check tree sockets */
- for(sock= ntree->outputs.first; sock; sock= sock->next)
- if(sock==tosock)
+ for (sock= ntree->outputs.first; sock; sock= sock->next)
+ if (sock==tosock)
break;
- if(sock)
+ if (sock)
to= 1; /* OK */
else {
- for(sock= ntree->inputs.first; sock; sock= sock->next)
- if(sock==tosock)
+ for (sock= ntree->inputs.first; sock; sock= sock->next)
+ if (sock==tosock)
break;
- if(sock)
+ if (sock)
to= -1; /* OK but flip */
}
}
- if(from >= 0 && to >= 0) {
+ if (from >= 0 && to >= 0) {
link= MEM_callocN(sizeof(bNodeLink), "link");
BLI_addtail(&ntree->links, link);
link->fromnode= fromnode;
@@ -504,7 +504,7 @@ bNodeLink *nodeAddLink(bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock,
link->tonode= tonode;
link->tosock= tosock;
}
- else if(from <= 0 && to <= 0) {
+ else if (from <= 0 && to <= 0) {
link= MEM_callocN(sizeof(bNodeLink), "link");
BLI_addtail(&ntree->links, link);
link->fromnode= tonode;
@@ -521,7 +521,7 @@ bNodeLink *nodeAddLink(bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock,
void nodeRemLink(bNodeTree *ntree, bNodeLink *link)
{
BLI_remlink(&ntree->links, link);
- if(link->tosock)
+ if (link->tosock)
link->tosock->link= NULL;
MEM_freeN(link);
@@ -532,9 +532,9 @@ void nodeRemSocketLinks(bNodeTree *ntree, bNodeSocket *sock)
{
bNodeLink *link, *next;
- for(link= ntree->links.first; link; link= next) {
+ for (link= ntree->links.first; link; link= next) {
next= link->next;
- if(link->fromsock==sock || link->tosock==sock) {
+ if (link->fromsock==sock || link->tosock==sock) {
nodeRemLink(ntree, link);
}
}
@@ -660,7 +660,7 @@ bNodeTree *ntreeAddTree(const char *name, int type, int nodetype)
/* Warning: this function gets called during some rather unexpected times
* - this gets called when executing compositing updates (for threaded previews)
* - when the nodetree datablock needs to be copied (i.e. when users get copied)
- * - for scene duplication use ntreeSwapID() after so we dont have stale pointers.
+ * - for scene duplication use ntreeSwapID() after so we don't have stale pointers.
*/
bNodeTree *ntreeCopyTree(bNodeTree *ntree)
{
@@ -669,14 +669,15 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree)
bNodeLink *link;
bNodeSocket *gsock, *oldgsock;
- if(ntree==NULL) return NULL;
+ if (ntree==NULL) return NULL;
/* is ntree part of library? */
- for(newtree=G.main->nodetree.first; newtree; newtree= newtree->id.next)
- if(newtree==ntree) break;
- if(newtree) {
+ for (newtree=G.main->nodetree.first; newtree; newtree= newtree->id.next)
+ if (newtree==ntree) break;
+ if (newtree) {
newtree= copy_libblock(&ntree->id);
- } else {
+ }
+ else {
newtree= MEM_dupallocN(ntree);
copy_libblock_data(&newtree->id, &ntree->id, TRUE); /* copy animdata and ID props */
}
@@ -690,7 +691,7 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree)
newtree->links.first= newtree->links.last= NULL;
last = ntree->nodes.last;
- for(node= ntree->nodes.first; node; node= node->next) {
+ for (node= ntree->nodes.first; node; node= node->next) {
node->new_node= NULL;
/* nnode= */ nodeCopyNode(newtree, node); /* sets node->new */
@@ -701,14 +702,14 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree)
/* socket definition for group usage */
BLI_duplicatelist(&newtree->inputs, &ntree->inputs);
- for(gsock= newtree->inputs.first, oldgsock= ntree->inputs.first; gsock; gsock=gsock->next, oldgsock=oldgsock->next) {
+ for (gsock= newtree->inputs.first, oldgsock= ntree->inputs.first; gsock; gsock=gsock->next, oldgsock=oldgsock->next) {
oldgsock->new_sock= gsock;
gsock->groupsock = (oldgsock->groupsock ? oldgsock->groupsock->new_sock : NULL);
gsock->default_value = node_socket_make_default_value(oldgsock->type);
node_socket_copy_default_value(oldgsock->type, gsock->default_value, oldgsock->default_value);
}
BLI_duplicatelist(&newtree->outputs, &ntree->outputs);
- for(gsock= newtree->outputs.first, oldgsock= ntree->outputs.first; gsock; gsock=gsock->next, oldgsock=oldgsock->next) {
+ for (gsock= newtree->outputs.first, oldgsock= ntree->outputs.first; gsock; gsock=gsock->next, oldgsock=oldgsock->next) {
oldgsock->new_sock= gsock;
gsock->groupsock = (oldgsock->groupsock ? oldgsock->groupsock->new_sock : NULL);
gsock->default_value = node_socket_make_default_value(oldgsock->type);
@@ -717,7 +718,7 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree)
/* copy links */
BLI_duplicatelist(&newtree->links, &ntree->links);
- for(link= newtree->links.first; link; link= link->next) {
+ for (link= newtree->links.first; link; link= link->next) {
link->fromnode = (link->fromnode ? link->fromnode->new_node : NULL);
link->fromsock = (link->fromsock ? link->fromsock->new_sock : NULL);
link->tonode = (link->tonode ? link->tonode->new_node : NULL);
@@ -741,8 +742,8 @@ void ntreeSwitchID(bNodeTree *ntree, ID *id_from, ID *id_to)
{
bNode *node;
/* for scene duplication only */
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->id==id_from) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->id==id_from) {
node->id= id_to;
}
}
@@ -753,8 +754,8 @@ void ntreeSwitchID(bNodeTree *ntree, ID *id_from, ID *id_to)
void nodeFreePreview(bNode *node)
{
- if(node->preview) {
- if(node->preview->rect)
+ if (node->preview) {
+ if (node->preview->rect)
MEM_freeN(node->preview->rect);
MEM_freeN(node->preview);
node->preview= NULL;
@@ -764,24 +765,24 @@ void nodeFreePreview(bNode *node)
static void node_init_preview(bNode *node, int xsize, int ysize)
{
- if(node->preview==NULL) {
+ if (node->preview==NULL) {
node->preview= MEM_callocN(sizeof(bNodePreview), "node preview");
// printf("added preview %s\n", node->name);
}
/* node previews can get added with variable size this way */
- if(xsize==0 || ysize==0)
+ if (xsize==0 || ysize==0)
return;
/* sanity checks & initialize */
- if(node->preview->rect) {
- if(node->preview->xsize!=xsize && node->preview->ysize!=ysize) {
+ if (node->preview->rect) {
+ if (node->preview->xsize!=xsize && node->preview->ysize!=ysize) {
MEM_freeN(node->preview->rect);
node->preview->rect= NULL;
}
}
- if(node->preview->rect==NULL) {
+ if (node->preview->rect==NULL) {
node->preview->rect= MEM_callocN(4*xsize + xsize*ysize*sizeof(char)*4, "node preview rect");
node->preview->xsize= xsize;
node->preview->ysize= ysize;
@@ -793,20 +794,20 @@ void ntreeInitPreview(bNodeTree *ntree, int xsize, int ysize)
{
bNode *node;
- if(ntree==NULL)
+ if (ntree==NULL)
return;
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->typeinfo->flag & NODE_PREVIEW) /* hrms, check for closed nodes? */
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->typeinfo->flag & NODE_PREVIEW) /* hrms, check for closed nodes? */
node_init_preview(node, xsize, ysize);
- if(node->type==NODE_GROUP && (node->flag & NODE_GROUP_EDIT))
+ if (node->type==NODE_GROUP && (node->flag & NODE_GROUP_EDIT))
ntreeInitPreview((bNodeTree *)node->id, xsize, ysize);
}
}
static void nodeClearPreview(bNode *node)
{
- if(node->preview && node->preview->rect)
+ if (node->preview && node->preview->rect)
memset(node->preview->rect, 0, MEM_allocN_len(node->preview->rect));
}
@@ -815,29 +816,29 @@ void ntreeClearPreview(bNodeTree *ntree)
{
bNode *node;
- if(ntree==NULL)
+ if (ntree==NULL)
return;
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->typeinfo->flag & NODE_PREVIEW)
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->typeinfo->flag & NODE_PREVIEW)
nodeClearPreview(node);
- if(node->type==NODE_GROUP && (node->flag & NODE_GROUP_EDIT))
+ if (node->type==NODE_GROUP && (node->flag & NODE_GROUP_EDIT))
ntreeClearPreview((bNodeTree *)node->id);
}
}
/* 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;
- if(preview) {
- if(x>=0 && y>=0) {
- if(x<preview->xsize && y<preview->ysize) {
+ if (preview) {
+ if (x>=0 && y>=0) {
+ if (x<preview->xsize && y<preview->ysize) {
unsigned char *tar= preview->rect+ 4*((preview->xsize*y) + x);
- if(do_manage) {
+ if (do_manage) {
linearrgb_to_srgb_uchar4(tar, col);
}
else {
@@ -859,25 +860,25 @@ void nodeUnlinkNode(bNodeTree *ntree, bNode *node)
bNodeSocket *sock;
ListBase *lb;
- for(link= ntree->links.first; link; link= next) {
+ for (link= ntree->links.first; link; link= next) {
next= link->next;
- if(link->fromnode==node) {
+ if (link->fromnode==node) {
lb= &node->outputs;
if (link->tonode)
link->tonode->update |= NODE_UPDATE;
}
- else if(link->tonode==node)
+ else if (link->tonode==node)
lb= &node->inputs;
else
lb= NULL;
- if(lb) {
- for(sock= lb->first; sock; sock= sock->next) {
- if(link->fromsock==sock || link->tosock==sock)
+ if (lb) {
+ for (sock= lb->first; sock; sock= sock->next) {
+ if (link->fromsock==sock || link->tosock==sock)
break;
}
- if(sock) {
+ if (sock) {
nodeRemLink(ntree, link);
}
}
@@ -903,12 +904,15 @@ void nodeFreeNode(bNodeTree *ntree, bNode *node)
node_unlink_attached(ntree, node);
BLI_remlink(&ntree->nodes, node);
-
+
/* since it is called while free database, node->id is undefined */
if (treetype->free_node_cache)
treetype->free_node_cache(ntree, node);
+ if (node->typeinfo && node->typeinfo->freestoragefunc)
+ node->typeinfo->freestoragefunc(node);
+
for (sock=node->inputs.first; sock; sock = nextsock) {
nextsock = sock->next;
node_socket_free_default_value(sock->type, sock->default_value);
@@ -922,10 +926,6 @@ void nodeFreeNode(bNodeTree *ntree, bNode *node)
nodeFreePreview(node);
- if(node->typeinfo && node->typeinfo->freestoragefunc) {
- node->typeinfo->freestoragefunc(node);
- }
-
MEM_freeN(node);
ntree->update |= NTREE_UPDATE_NODES;
@@ -937,7 +937,7 @@ void ntreeFreeTree(bNodeTree *ntree)
bNode *node, *next;
bNodeSocket *sock;
- if(ntree==NULL) return;
+ if (ntree==NULL) return;
/* XXX hack! node trees should not store execution graphs at all.
* This should be removed when old tree types no longer require it.
@@ -964,7 +964,7 @@ void ntreeFreeTree(bNodeTree *ntree)
BLI_freelistN(&ntree->links); /* do first, then unlink_node goes fast */
- for(node= ntree->nodes.first; node; node= next) {
+ for (node= ntree->nodes.first; node; node= next) {
next= node->next;
nodeFreeNode(ntree, node);
}
@@ -981,7 +981,7 @@ void ntreeFreeCache(bNodeTree *ntree)
{
bNodeTreeType *treetype;
- if(ntree==NULL) return;
+ if (ntree==NULL) return;
treetype= ntreeGetType(ntree->type);
if (treetype->free_cache)
@@ -992,52 +992,52 @@ void ntreeSetOutput(bNodeTree *ntree)
{
bNode *node;
- /* find the active outputs, might become tree type dependant handler */
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->typeinfo->nclass==NODE_CLASS_OUTPUT) {
+ /* find the active outputs, might become tree type dependent handler */
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->typeinfo->nclass==NODE_CLASS_OUTPUT) {
bNode *tnode;
int output= 0;
/* we need a check for which output node should be tagged like this, below an exception */
- if(node->type==CMP_NODE_OUTPUT_FILE)
+ if (node->type==CMP_NODE_OUTPUT_FILE)
continue;
/* there is more types having output class, each one is checked */
- for(tnode= ntree->nodes.first; tnode; tnode= tnode->next) {
- if(tnode->typeinfo->nclass==NODE_CLASS_OUTPUT) {
+ for (tnode= ntree->nodes.first; tnode; tnode= tnode->next) {
+ if (tnode->typeinfo->nclass==NODE_CLASS_OUTPUT) {
- if(ntree->type==NTREE_COMPOSIT) {
+ if (ntree->type==NTREE_COMPOSIT) {
/* same type, exception for viewer */
- if(tnode->type==node->type ||
+ if (tnode->type==node->type ||
(ELEM(tnode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER) &&
ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))) {
- if(tnode->flag & NODE_DO_OUTPUT) {
+ if (tnode->flag & NODE_DO_OUTPUT) {
output++;
- if(output>1)
+ if (output>1)
tnode->flag &= ~NODE_DO_OUTPUT;
}
}
}
else {
/* same type */
- if(tnode->type==node->type) {
- if(tnode->flag & NODE_DO_OUTPUT) {
+ if (tnode->type==node->type) {
+ if (tnode->flag & NODE_DO_OUTPUT) {
output++;
- if(output>1)
+ if (output>1)
tnode->flag &= ~NODE_DO_OUTPUT;
}
}
}
}
}
- if(output==0)
+ if (output==0)
node->flag |= NODE_DO_OUTPUT;
}
}
/* 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 {
@@ -1052,9 +1052,9 @@ static void ntreeMakeLocal_CheckLocal(void *calldata, ID *owner_id, bNodeTree *n
bNode *node;
/* find if group is in tree */
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->id == cd->group_id) {
- if(owner_id->lib) cd->lib= 1;
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->id == cd->group_id) {
+ if (owner_id->lib) cd->lib= 1;
else cd->local= 1;
}
}
@@ -1066,9 +1066,9 @@ static void ntreeMakeLocal_LinkNew(void *calldata, ID *owner_id, bNodeTree *ntre
bNode *node;
/* find if group is in tree */
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->id == cd->group_id) {
- if(owner_id->lib==NULL) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->id == cd->group_id) {
+ if (owner_id->lib==NULL) {
node->id= cd->new_id;
cd->new_id->us++;
cd->group_id->us--;
@@ -1084,12 +1084,12 @@ 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) {
+ if (ntree->id.lib==NULL) return;
+ if (ntree->id.us==1) {
id_clear_lib_data(bmain, (ID *)ntree);
return;
}
@@ -1103,10 +1103,10 @@ void ntreeMakeLocal(bNodeTree *ntree)
treetype->foreach_nodetree(G.main, &cd, &ntreeMakeLocal_CheckLocal);
/* if all users are local, we simply make tree local */
- if(cd.local && cd.lib==0) {
+ if (cd.local && cd.lib==0) {
id_clear_lib_data(bmain, (ID *)ntree);
}
- else if(cd.local && cd.lib) {
+ else if (cd.local && cd.lib) {
/* this is the mixed case, we copy the tree and assign it to local users */
bNodeTree *newtree= ntreeCopyTree(ntree);
@@ -1121,8 +1121,8 @@ void ntreeMakeLocal(bNodeTree *ntree)
int ntreeNodeExists(bNodeTree *ntree, bNode *testnode)
{
bNode *node= ntree->nodes.first;
- for(; node; node= node->next)
- if(node==testnode)
+ for (; node; node= node->next)
+ if (node==testnode)
return 1;
return 0;
}
@@ -1130,8 +1130,8 @@ int ntreeNodeExists(bNodeTree *ntree, bNode *testnode)
int ntreeOutputExists(bNode *node, bNodeSocket *testsock)
{
bNodeSocket *sock= node->outputs.first;
- for(; sock; sock= sock->next)
- if(sock==testsock)
+ for (; sock; sock= sock->next)
+ if (sock==testsock)
return 1;
return 0;
}
@@ -1147,10 +1147,10 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
bAction *action_backup= NULL, *tmpact_backup= NULL;
/* Workaround for copying an action on each render!
- * set action to NULL so animdata actions dont get copied */
+ * set action to NULL so animdata actions don't get copied */
AnimData *adt= BKE_animdata_from_id(&ntree->id);
- if(adt) {
+ if (adt) {
action_backup= adt->action;
tmpact_backup= adt->tmpact;
@@ -1161,14 +1161,14 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
/* node copy func */
ltree= ntreeCopyTree(ntree);
- if(adt) {
+ if (adt) {
AnimData *ladt= BKE_animdata_from_id(&ltree->id);
adt->action= ladt->action= action_backup;
adt->tmpact= ladt->tmpact= tmpact_backup;
- if(action_backup) action_backup->id.us++;
- if(tmpact_backup) tmpact_backup->id.us++;
+ if (action_backup) action_backup->id.us++;
+ if (tmpact_backup) tmpact_backup->id.us++;
}
/* end animdata uglyness */
@@ -1176,7 +1176,7 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
/* ensures only a single output node is enabled */
ntreeSetOutput(ntree);
- for(node= ntree->nodes.first; node; node= node->next) {
+ for (node= ntree->nodes.first; node; node= node->next) {
/* store new_node pointer to original */
node->new_node->new_node= node;
}
@@ -1206,9 +1206,9 @@ void ntreeLocalMerge(bNodeTree *localtree, bNodeTree *ntree)
bNode *lnode;
/* move over the compbufs and previews */
- for(lnode= localtree->nodes.first; lnode; lnode= lnode->next) {
- if(ntreeNodeExists(ntree, lnode->new_node)) {
- if(lnode->preview && lnode->preview->rect) {
+ for (lnode= localtree->nodes.first; lnode; lnode= lnode->next) {
+ if (ntreeNodeExists(ntree, lnode->new_node)) {
+ if (lnode->preview && lnode->preview->rect) {
nodeFreePreview(lnode->new_node);
lnode->new_node->preview= lnode->preview;
lnode->preview= NULL;
@@ -1229,9 +1229,9 @@ int ntreeHasType(bNodeTree *ntree, int type)
{
bNode *node;
- if(ntree)
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->type == type)
+ if (ntree)
+ for (node= ntree->nodes.first; node; node= node->next)
+ if (node->type == type)
return 1;
return 0;
}
@@ -1240,10 +1240,10 @@ bNodeLink *nodeFindLink(bNodeTree *ntree, bNodeSocket *from, bNodeSocket *to)
{
bNodeLink *link;
- for(link= ntree->links.first; link; link= link->next) {
- if(link->fromsock==from && link->tosock==to)
+ for (link= ntree->links.first; link; link= link->next) {
+ if (link->fromsock==from && link->tosock==to)
return link;
- if(link->fromsock==to && link->tosock==from) /* hrms? */
+ if (link->fromsock==to && link->tosock==from) /* hrms? */
return link;
}
return NULL;
@@ -1254,8 +1254,8 @@ int nodeCountSocketLinks(bNodeTree *ntree, bNodeSocket *sock)
bNodeLink *link;
int tot= 0;
- for(link= ntree->links.first; link; link= link->next) {
- if(link->fromsock==sock || link->tosock==sock)
+ for (link= ntree->links.first; link; link= link->next) {
+ if (link->fromsock==sock || link->tosock==sock)
tot++;
}
return tot;
@@ -1265,10 +1265,10 @@ bNode *nodeGetActive(bNodeTree *ntree)
{
bNode *node;
- if(ntree==NULL) return NULL;
+ if (ntree==NULL) return NULL;
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->flag & NODE_ACTIVE)
+ for (node= ntree->nodes.first; node; node= node->next)
+ if (node->flag & NODE_ACTIVE)
break;
return node;
}
@@ -1278,20 +1278,20 @@ bNode *nodeGetActiveID(bNodeTree *ntree, short idtype)
{
bNode *node;
- if(ntree==NULL) return NULL;
+ if (ntree==NULL) return NULL;
/* check for group edit */
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->flag & NODE_GROUP_EDIT)
+ for (node= ntree->nodes.first; node; node= node->next)
+ if (node->flag & NODE_GROUP_EDIT)
break;
- if(node)
+ if (node)
ntree= (bNodeTree*)node->id;
/* now find active node with this id */
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->id && GS(node->id->name)==idtype)
- if(node->flag & NODE_ACTIVE_ID)
+ for (node= ntree->nodes.first; node; node= node->next)
+ if (node->id && GS(node->id->name)==idtype)
+ if (node->flag & NODE_ACTIVE_ID)
break;
return node;
@@ -1302,23 +1302,24 @@ int nodeSetActiveID(bNodeTree *ntree, short idtype, ID *id)
bNode *node;
int ok= FALSE;
- if(ntree==NULL) return ok;
+ if (ntree==NULL) return ok;
/* check for group edit */
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->flag & NODE_GROUP_EDIT)
+ for (node= ntree->nodes.first; node; node= node->next)
+ if (node->flag & NODE_GROUP_EDIT)
break;
- if(node)
+ if (node)
ntree= (bNodeTree*)node->id;
/* now find active node with this id */
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->id && GS(node->id->name)==idtype) {
- if(id && ok==FALSE && node->id==id) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->id && GS(node->id->name)==idtype) {
+ if (id && ok==FALSE && node->id==id) {
node->flag |= NODE_ACTIVE_ID;
ok= TRUE;
- } else {
+ }
+ else {
node->flag &= ~NODE_ACTIVE_ID;
}
}
@@ -1333,10 +1334,10 @@ void nodeClearActiveID(bNodeTree *ntree, short idtype)
{
bNode *node;
- if(ntree==NULL) return;
+ if (ntree==NULL) return;
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->id && GS(node->id->name)==idtype)
+ for (node= ntree->nodes.first; node; node= node->next)
+ if (node->id && GS(node->id->name)==idtype)
node->flag &= ~NODE_ACTIVE_ID;
}
@@ -1346,21 +1347,21 @@ void nodeSetActive(bNodeTree *ntree, bNode *node)
bNode *tnode;
/* make sure only one node is active, and only one per ID type */
- for(tnode= ntree->nodes.first; tnode; tnode= tnode->next) {
+ for (tnode= ntree->nodes.first; tnode; tnode= tnode->next) {
tnode->flag &= ~NODE_ACTIVE;
- if(node->id && tnode->id) {
- if(GS(node->id->name) == GS(tnode->id->name))
+ if (node->id && tnode->id) {
+ if (GS(node->id->name) == GS(tnode->id->name))
tnode->flag &= ~NODE_ACTIVE_ID;
}
- if(node->typeinfo->nclass == NODE_CLASS_TEXTURE)
+ if (node->typeinfo->nclass == NODE_CLASS_TEXTURE)
tnode->flag &= ~NODE_ACTIVE_TEXTURE;
}
node->flag |= NODE_ACTIVE;
- if(node->id)
+ if (node->id)
node->flag |= NODE_ACTIVE_ID;
- if(node->typeinfo->nclass == NODE_CLASS_TEXTURE)
+ if (node->typeinfo->nclass == NODE_CLASS_TEXTURE)
node->flag |= NODE_ACTIVE_TEXTURE;
}
@@ -1369,6 +1370,19 @@ int nodeSocketIsHidden(bNodeSocket *sock)
return ((sock->flag & (SOCK_HIDDEN | SOCK_AUTO_HIDDEN | SOCK_UNAVAIL)) != 0);
}
+void nodeSocketSetType(bNodeSocket *sock, int type)
+{
+ int old_type = sock->type;
+ void *old_default_value = sock->default_value;
+
+ sock->type = type;
+
+ sock->default_value = node_socket_make_default_value(sock->type);
+ node_socket_init_default_value(type, sock->default_value);
+ node_socket_convert_default_value(sock->type, sock->default_value, old_type, old_default_value);
+ node_socket_free_default_value(old_type, old_default_value);
+}
+
/* ************** dependency stuff *********** */
/* node is guaranteed to be not checked before */
@@ -1381,10 +1395,10 @@ static int node_get_deplist_recurs(bNode *node, bNode ***nsort)
node->done= 1;
/* check linked nodes */
- for(sock= node->inputs.first; sock; sock= sock->next) {
- if(sock->link) {
+ for (sock= node->inputs.first; sock; sock= sock->next) {
+ if (sock->link) {
fromnode= sock->link->fromnode;
- if(fromnode) {
+ if (fromnode) {
if (fromnode->done==0)
fromnode->level= node_get_deplist_recurs(fromnode, nsort);
if (fromnode->level <= level)
@@ -1416,11 +1430,11 @@ void ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***deplist, in
*totnodes=0;
/* first clear data */
- for(node= ntree->nodes.first; node; node= node->next) {
+ for (node= ntree->nodes.first; node; node= node->next) {
node->done= 0;
(*totnodes)++;
}
- if(*totnodes==0) {
+ if (*totnodes==0) {
*deplist = NULL;
return;
}
@@ -1428,13 +1442,31 @@ void ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***deplist, in
nsort= *deplist= MEM_callocN((*totnodes)*sizeof(bNode*), "sorted node array");
/* recursive check */
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->done==0) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->done==0) {
node->level= node_get_deplist_recurs(node, &nsort);
}
}
}
+/* 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;
@@ -1442,24 +1474,24 @@ static void ntree_update_link_pointers(bNodeTree *ntree)
bNodeLink *link;
/* first clear data */
- for(node= ntree->nodes.first; node; node= node->next) {
- for(sock= node->inputs.first; sock; sock= sock->next) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ for (sock= node->inputs.first; sock; sock= sock->next) {
sock->link= NULL;
sock->flag &= ~SOCK_IN_USE;
}
- for(sock= node->outputs.first; sock; sock= sock->next) {
+ for (sock= node->outputs.first; sock; sock= sock->next) {
sock->flag &= ~SOCK_IN_USE;
}
}
- for(sock= ntree->inputs.first; sock; sock= sock->next) {
+ for (sock= ntree->inputs.first; sock; sock= sock->next) {
sock->flag &= ~SOCK_IN_USE;
}
- for(sock= ntree->outputs.first; sock; sock= sock->next) {
+ for (sock= ntree->outputs.first; sock; sock= sock->next) {
sock->link= NULL;
sock->flag &= ~SOCK_IN_USE;
}
- for(link= ntree->links.first; link; link= link->next) {
+ for (link= ntree->links.first; link; link= link->next) {
link->tosock->link= link;
link->fromsock->flag |= SOCK_IN_USE;
@@ -1512,39 +1544,33 @@ void ntreeUpdateTree(bNodeTree *ntree)
{
bNodeTreeType *ntreetype= ntreeGetType(ntree->type);
bNode *node;
- bNode **deplist;
- int totnodes, n;
-
- ntree_update_link_pointers(ntree);
- /* also updates the node level! */
- ntreeGetDependencyList(ntree, &deplist, &totnodes);
+ if (ntree->update & (NTREE_UPDATE_LINKS|NTREE_UPDATE_NODES)) {
+ /* set the bNodeSocket->link pointers */
+ ntree_update_link_pointers(ntree);
+
+ /* update the node level from link dependencies */
+ 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 {
@@ -1581,14 +1607,14 @@ int nodeUpdateID(bNodeTree *ntree, ID *id)
bNode *node;
int change = FALSE;
- if(ELEM(NULL, id, ntree))
+ if (ELEM(NULL, id, ntree))
return change;
ntreetype = ntreeGetType(ntree->type);
if (ntreetype->update_node) {
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->id==id) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->id==id) {
change = TRUE;
ntreetype->update_node(ntree, node);
/* clear update flag */
@@ -1597,8 +1623,8 @@ int nodeUpdateID(bNodeTree *ntree, ID *id)
}
}
else {
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->id==id) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->id==id) {
change = TRUE;
if (node->typeinfo->updatefunc)
node->typeinfo->updatefunc(ntree, node);
@@ -1634,7 +1660,7 @@ const char* nodeLabel(bNode *node)
else if (node->typeinfo->labelfunc)
return node->typeinfo->labelfunc(node);
else
- return node->typeinfo->name;
+ return IFACE_(node->typeinfo->name);
}
struct bNodeTree *nodeGroupEditGet(struct bNode *node)
@@ -1682,7 +1708,7 @@ void node_type_base(bNodeTreeType *ttype, bNodeType *ntype, int type, const char
ntype->flag = flag;
/* Default muting stuff. */
- if(ttype)
+ if (ttype)
ntype->internal_connect = ttype->internal_connect;
/* default size values */
@@ -1803,8 +1829,8 @@ static bNodeType *is_nodetype_registered(ListBase *typelist, int type)
{
bNodeType *ntype= typelist->first;
- for(;ntype; ntype= ntype->next )
- if(ntype->type==type)
+ for (;ntype; ntype= ntype->next )
+ if (ntype->type==type)
return ntype;
return NULL;
@@ -1815,7 +1841,7 @@ void nodeRegisterType(bNodeTreeType *ttype, bNodeType *ntype)
ListBase *typelist = &(ttype->node_types);
bNodeType *found= is_nodetype_registered(typelist, ntype->type);
- if(found==NULL)
+ if (found==NULL)
BLI_addtail(typelist, ntype);
}
@@ -1839,7 +1865,6 @@ static void registerCompositNodes(bNodeTreeType *ttype)
register_node_type_cmp_viewer(ttype);
register_node_type_cmp_splitviewer(ttype);
register_node_type_cmp_output_file(ttype);
- register_node_type_cmp_output_multi_file(ttype);
register_node_type_cmp_view_levels(ttype);
register_node_type_cmp_curve_rgb(ttype);
@@ -1888,7 +1913,7 @@ static void registerCompositNodes(bNodeTreeType *ttype)
register_node_type_cmp_channel_matte(ttype);
register_node_type_cmp_color_spill(ttype);
register_node_type_cmp_luma_matte(ttype);
- register_node_type_cmp_doubleedgemask(ttype);
+ register_node_type_cmp_doubleedgemask(ttype);
register_node_type_cmp_translate(ttype);
register_node_type_cmp_rotate(ttype);
@@ -2025,14 +2050,14 @@ static void registerTextureNodes(bNodeTreeType *ttype)
static void free_dynamic_typeinfo(bNodeType *ntype)
{
- if(ntype->type==NODE_DYNAMIC) {
- if(ntype->inputs) {
+ if (ntype->type==NODE_DYNAMIC) {
+ if (ntype->inputs) {
MEM_freeN(ntype->inputs);
}
- if(ntype->outputs) {
+ if (ntype->outputs) {
MEM_freeN(ntype->outputs);
}
- if(ntype->name) {
+ if (ntype->name) {
MEM_freeN((void *)ntype->name);
}
}
@@ -2041,13 +2066,13 @@ static void free_dynamic_typeinfo(bNodeType *ntype)
static void free_typeinfos(ListBase *list)
{
bNodeType *ntype, *next;
- for(ntype=list->first; ntype; ntype=next) {
+ for (ntype=list->first; ntype; ntype=next) {
next = ntype->next;
- if(ntype->type==NODE_DYNAMIC)
+ if (ntype->type==NODE_DYNAMIC)
free_dynamic_typeinfo(ntype);
- if(ntype->needs_free)
+ if (ntype->needs_free)
MEM_freeN(ntype);
}
}
@@ -2076,11 +2101,11 @@ void clear_scene_in_nodes(Main *bmain, Scene *sce)
Scene *sce1;
bNode *node;
- for(sce1= bmain->scene.first; sce1; sce1=sce1->id.next) {
- if(sce1!=sce) {
- if(sce1->nodetree) {
- for(node= sce1->nodetree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS) {
+ for (sce1= bmain->scene.first; sce1; sce1=sce1->id.next) {
+ if (sce1!=sce) {
+ if (sce1->nodetree) {
+ for (node= sce1->nodetree->nodes.first; node; node= node->next) {
+ if (node->type==CMP_NODE_R_LAYERS) {
Scene *nodesce= (Scene *)node->id;
if (nodesce==sce) node->id = NULL;
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 37fb8b4a550..c62653b29e7 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -103,7 +103,9 @@
#include "BKE_material.h"
#include "BKE_camera.h"
+#ifdef WITH_MOD_FLUID
#include "LBM_fluidsim.h"
+#endif
#ifdef WITH_PYTHON
#include "BPY_extern.h"
@@ -199,16 +201,40 @@ void object_free_modifiers(Object *ob)
object_free_softbody(ob);
}
+int object_support_modifier_type(Object *ob, int modifier_type)
+{
+ ModifierTypeInfo *mti;
+
+ mti = modifierType_getInfo(modifier_type);
+
+ if (!((mti->flags & eModifierTypeFlag_AcceptsCVs) ||
+ (ob->type==OB_MESH && (mti->flags & eModifierTypeFlag_AcceptsMesh))))
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
void object_link_modifiers(struct Object *ob, struct Object *from)
{
ModifierData *md;
object_free_modifiers(ob);
+ if (!ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
+ /* only objects listed above can have modifiers and linking them to objects
+ * which doesn't have modifiers stack is quite silly */
+ return;
+ }
+
for (md=from->modifiers.first; md; md=md->next) {
ModifierData *nmd = NULL;
if (ELEM4(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_ParticleInstance, eModifierType_Collision)) continue;
+ if (!object_support_modifier_type(ob, md->type))
+ continue;
+
nmd = modifier_new(md->type);
modifier_copyData(md, nmd);
BLI_addtail(&ob->modifiers, nmd);
@@ -389,7 +415,7 @@ void unlink_object(Object *ob)
modifiers_foreachObjectLink(obt, unlink_object__unlinkModifierLinks, ob);
- if ELEM(obt->type, OB_CURVE, OB_FONT) {
+ if (ELEM(obt->type, OB_CURVE, OB_FONT)) {
cu= obt->data;
if (cu->bevobj==ob) {
@@ -621,6 +647,16 @@ void unlink_object(Object *ob)
if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D*) sl;
+ /* found doesn't need to be set here */
+ if (v3d->ob_centre == ob) {
+ v3d->ob_centre = NULL;
+ v3d->ob_centre_bone[0] = '\0';
+ }
+ if (v3d->localvd && v3d->localvd->ob_centre == ob) {
+ v3d->localvd->ob_centre = NULL;
+ v3d->localvd->ob_centre_bone[0] = '\0';
+ }
+
found= 0;
if (v3d->camera==ob) {
v3d->camera= NULL;
@@ -954,6 +990,11 @@ void copy_object_particlesystems(Object *obn, Object *ob)
ParticleSystem *psys, *npsys;
ModifierData *md;
+ if (obn->type != OB_MESH) {
+ /* currently only mesh objects can have soft body */
+ return;
+ }
+
obn->particlesystem.first= obn->particlesystem.last= NULL;
for (psys=ob->particlesystem.first; psys; psys=psys->next) {
npsys= copy_particlesystem(psys);
@@ -1364,7 +1405,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
ob->mat = MEM_dupallocN(target->mat);
ob->matbits = MEM_dupallocN(target->matbits);
for (i=0; i<target->totcol; i++) {
- /* dont need to run test_object_materials since we know this object is new and not used elsewhere */
+ /* don't need to run test_object_materials since we know this object is new and not used elsewhere */
id_us_plus((ID *)ob->mat[i]);
}
}
@@ -1760,9 +1801,11 @@ static void give_parvert(Object *par, int nr, float vec[3])
if (count==0) {
/* keep as 0,0,0 */
- } else if (count > 0) {
+ }
+ else if (count > 0) {
mul_v3_fl(vec, 1.0f / count);
- } else {
+ }
+ else {
/* use first index if its out of range */
dm->getVertCo(dm, 0, vec);
}
@@ -1950,9 +1993,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;
@@ -2008,7 +2051,7 @@ static void solve_parenting (Scene *scene, Object *ob, Object *par, float obmat[
if (simul) {
copy_v3_v3(totmat[3], par->obmat[3]);
}
- else{
+ else {
give_parvert(par, ob->par1, vec);
mul_v3_m4v3(totmat[3], par->obmat, vec);
}
@@ -2034,7 +2077,7 @@ static void solve_parenting (Scene *scene, Object *ob, Object *par, float obmat[
if (simul) {
}
- else{
+ else {
// external usable originmat
copy_m3_m4(originmat, tmat);
@@ -2058,7 +2101,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;
@@ -2184,8 +2227,9 @@ void object_get_dimensions(Object *ob, float vec[3])
vec[0] = fabsf(scale[0]) * (bb->vec[4][0] - bb->vec[0][0]);
vec[1] = fabsf(scale[1]) * (bb->vec[2][1] - bb->vec[0][1]);
vec[2] = fabsf(scale[2]) * (bb->vec[1][2] - bb->vec[0][2]);
- } else {
- vec[0] = vec[1] = vec[2] = 0.f;
+ }
+ else {
+ zero_v3(vec);
}
}
@@ -2297,7 +2341,8 @@ int minmax_object_duplis(Scene *scene, Object *ob, float min[3], float max[3])
int ok= 0;
if ((ob->transflag & OB_DUPLI)==0) {
return ok;
- } else {
+ }
+ else {
ListBase *lb;
DupliObject *dob;
@@ -2472,20 +2517,20 @@ 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) {
- if (G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("recalcob %s\n", ob->id.name+2);
/* handle proxy copy for target */
@@ -2513,7 +2558,7 @@ void object_handle_update(Scene *scene, Object *ob)
ListBase pidlist;
PTCacheID *pid;
- if (G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("recalcdata %s\n", ob->id.name+2);
if (adt) {
@@ -2527,7 +2572,7 @@ void object_handle_update(Scene *scene, Object *ob)
case OB_MESH:
{
#if 0 // XXX, comment for 2.56a release, background wont set 'scene->customdata_mask'
- BMEditMesh *em = (ob == scene->obedit)? ((Mesh*)ob->data)->edit_btmesh : NULL;
+ BMEditMesh *em = (ob == scene->obedit) ? BMEdit_FromObject(ob) : NULL;
BLI_assert((scene->customdata_mask & CD_MASK_BAREMESH) == CD_MASK_BAREMESH);
if (em) {
makeDerivedMesh(scene, ob, em, scene->customdata_mask, 0); /* was CD_MASK_BAREMESH */
@@ -2537,7 +2582,7 @@ void object_handle_update(Scene *scene, Object *ob)
}
#else /* ensure CD_MASK_BAREMESH for now */
- BMEditMesh *em = (ob == scene->obedit)? ((Mesh*)ob->data)->edit_btmesh : NULL;
+ BMEditMesh *em = (ob == scene->obedit) ? BMEdit_FromObject(ob) : NULL;
uint64_t data_mask= scene->customdata_mask | ob->customdata_mask | CD_MASK_BAREMESH;
if (em) {
makeDerivedMesh(scene, ob, em, data_mask, 0); /* was CD_MASK_BAREMESH */
@@ -2658,15 +2703,16 @@ 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;
}
free_sculptsession_deformMats(ob->sculpt);
- } else {
+ }
+ else {
PBVHNode **nodes;
int n, totnode;
@@ -2916,11 +2962,19 @@ static KeyBlock *insert_curvekey(Scene *scene, Object *ob, const char *name, int
}
KeyBlock *object_insert_shape_key(Scene *scene, Object *ob, const char *name, int from_mix)
-{
- if (ob->type==OB_MESH) return insert_meshkey(scene, ob, name, from_mix);
- else if ELEM(ob->type, OB_CURVE, OB_SURF)return insert_curvekey(scene, ob, name, from_mix);
- else if (ob->type==OB_LATTICE) return insert_lattkey(scene, ob, name, from_mix);
- else return NULL;
+{
+ switch (ob->type) {
+ case OB_MESH:
+ return insert_meshkey(scene, ob, name, from_mix);
+ case OB_CURVE:
+ case OB_SURF:
+ return insert_curvekey(scene, ob, name, from_mix);
+ case OB_LATTICE:
+ return insert_lattkey(scene, ob, name, from_mix);
+ default:
+ return NULL;
+ }
+
}
/* most important if this is modified it should _always_ return True, in certain
diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c
index 00a66edc2b4..907de7888cb 100644
--- a/source/blender/blenkernel/intern/ocean.c
+++ b/source/blender/blenkernel/intern/ocean.c
@@ -170,7 +170,7 @@ static float gaussRand (void)
}
/**
- * Som usefull functions
+ * Some useful functions
* */
MINLINE float lerp(float a,float b,float f)
{
@@ -355,7 +355,8 @@ void BKE_ocean_eval_uv(struct Ocean *oc, struct OceanResult *ocr, float u,float
if (oc->_do_chop) {
ocr->disp[0] = BILERP(oc->_disp_x);
ocr->disp[2] = BILERP(oc->_disp_z);
- } else {
+ }
+ else {
ocr->disp[0] = 0.0;
ocr->disp[2] = 0.0;
}
@@ -435,8 +436,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 +479,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 +725,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
@@ -762,7 +761,7 @@ static void set_height_normalize_factor(struct Ocean *oc)
{
for (j = 0; j < oc->_N; ++j)
{
- if( max_h < fabsf(oc->_disp_y[i*oc->_N+j]))
+ if ( max_h < fabsf(oc->_disp_y[i*oc->_N+j]))
{
max_h = fabsf(oc->_disp_y[i*oc->_N+j]);
}
@@ -918,7 +917,7 @@ void BKE_init_ocean(struct Ocean* o, int M,int N, float Lx, float Lz, float V, f
void BKE_free_ocean_data(struct Ocean *oc)
{
- if(!oc) return;
+ if (!oc) return;
BLI_rw_mutex_lock(&oc->oceanmutex, THREAD_LOCK_WRITE);
@@ -965,7 +964,7 @@ void BKE_free_ocean_data(struct Ocean *oc)
if (oc->_fft_in)
MEM_freeN(oc->_fft_in);
- /* check that ocean data has been initialised */
+ /* check that ocean data has been initialized */
if (oc->_htilda) {
MEM_freeN(oc->_htilda);
MEM_freeN(oc->_k);
@@ -980,7 +979,7 @@ void BKE_free_ocean_data(struct Ocean *oc)
void BKE_free_ocean(struct Ocean *oc)
{
- if(!oc) return;
+ if (!oc) return;
BKE_free_ocean_data(oc);
BLI_rw_mutex_end(&oc->oceanmutex);
@@ -1174,18 +1173,18 @@ void BKE_simulate_ocean_cache(struct OceanCache *och, int frame)
cache_filename(string, och->bakepath, och->relbase, frame, CACHE_TYPE_DISPLACE);
och->ibufs_disp[f] = IMB_loadiffname(string, 0);
- //if (och->ibufs_disp[f] == NULL) printf("error loading %s \n", string);
- //else printf("loaded cache %s \n", string);
+ //if (och->ibufs_disp[f] == NULL) printf("error loading %s\n", string);
+ //else printf("loaded cache %s\n", string);
cache_filename(string, och->bakepath, och->relbase, frame, CACHE_TYPE_FOAM);
och->ibufs_foam[f] = IMB_loadiffname(string, 0);
- //if (och->ibufs_foam[f] == NULL) printf("error loading %s \n", string);
- //else printf("loaded cache %s \n", string);
+ //if (och->ibufs_foam[f] == NULL) printf("error loading %s\n", string);
+ //else printf("loaded cache %s\n", string);
cache_filename(string, och->bakepath, och->relbase, frame, CACHE_TYPE_NORMAL);
och->ibufs_norm[f] = IMB_loadiffname(string, 0);
- //if (och->ibufs_norm[f] == NULL) printf("error loading %s \n", string);
- //else printf("loaded cache %s \n", string);
+ //if (och->ibufs_norm[f] == NULL) printf("error loading %s\n", string);
+ //else printf("loaded cache %s\n", string);
}
@@ -1260,12 +1259,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;
@@ -1301,18 +1300,18 @@ void BKE_bake_ocean(struct Ocean *o, struct OceanCache *och, void (*update_cb)(v
/* write the images */
cache_filename(string, och->bakepath, och->relbase, f, CACHE_TYPE_DISPLACE);
- if(0 == BKE_write_ibuf(ibuf_disp, string, &imf))
+ if (0 == BKE_write_ibuf(ibuf_disp, string, &imf))
printf("Cannot save Displacement File Output to %s\n", string);
if (o->_do_jacobian) {
cache_filename(string, och->bakepath, och->relbase, f, CACHE_TYPE_FOAM);
- if(0 == BKE_write_ibuf(ibuf_foam, string, &imf))
+ if (0 == BKE_write_ibuf(ibuf_foam, string, &imf))
printf("Cannot save Foam File Output to %s\n", string);
}
if (o->_do_normals) {
cache_filename(string, och->bakepath, och->relbase, f, CACHE_TYPE_NORMAL);
- if(0 == BKE_write_ibuf(ibuf_normal, string, &imf))
+ if (0 == BKE_write_ibuf(ibuf_normal, string, &imf))
printf("Cannot save Normal File Output to %s\n", string);
}
@@ -1391,7 +1390,7 @@ void BKE_free_ocean_data(struct Ocean *UNUSED(oc))
void BKE_free_ocean(struct Ocean *oc)
{
- if(!oc) return;
+ if (!oc) return;
MEM_freeN(oc);
}
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index 2decc40da81..8a940e339bc 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -87,7 +87,8 @@ int seekPackedFile(PackedFile *pf, int offset, int whence)
}
if (seek < 0) {
seek = 0;
- } else if (seek > pf->size) {
+ }
+ else if (seek > pf->size) {
seek = pf->size;
}
pf->seek = seek;
@@ -110,12 +111,14 @@ int readPackedFile(PackedFile *pf, void *data, int size)
if (size > 0) {
memcpy(data, ((char *) pf->data) + pf->seek, size);
- } else {
+ }
+ else {
size = 0;
}
pf->seek += size;
- } else {
+ }
+ else {
size = -1;
}
@@ -130,16 +133,16 @@ int countPackedFiles(Main *bmain)
int count = 0;
// let's check if there are packed files...
- for(ima=bmain->image.first; ima; ima=ima->id.next)
- if(ima->packedfile)
+ for (ima=bmain->image.first; ima; ima=ima->id.next)
+ if (ima->packedfile)
count++;
- for(vf=bmain->vfont.first; vf; vf=vf->id.next)
- if(vf->packedfile)
+ for (vf=bmain->vfont.first; vf; vf=vf->id.next)
+ if (vf->packedfile)
count++;
- for(sound=bmain->sound.first; sound; sound=sound->id.next)
- if(sound->packedfile)
+ for (sound=bmain->sound.first; sound; sound=sound->id.next)
+ if (sound->packedfile)
count++;
return count;
@@ -147,7 +150,7 @@ int countPackedFiles(Main *bmain)
void freePackedFile(PackedFile *pf)
{
- if(pf) {
+ if (pf) {
MEM_freeN(pf->data);
MEM_freeN(pf);
}
@@ -173,7 +176,7 @@ PackedFile *newPackedFile(ReportList *reports, const char *filename, const char
/* render result has no filename and can be ignored
* any other files with no name can be ignored too */
- if(filename[0]=='\0')
+ if (filename[0]=='\0')
return NULL;
//XXX waitcursor(1);
@@ -186,17 +189,19 @@ PackedFile *newPackedFile(ReportList *reports, const char *filename, const char
// open the file
// and create a PackedFile structure
- file= open(name, O_BINARY|O_RDONLY);
+ file= BLI_open(name, O_BINARY|O_RDONLY,0);
if (file <= 0) {
BKE_reportf(reports, RPT_ERROR, "Unable to pack file, source path not found: \"%s\"", name);
- } else {
+ }
+ else {
filelen = BLI_file_descriptor_size(file);
if (filelen == 0) {
// MEM_mallocN complains about MEM_mallocN(0, "bla");
// we don't care....
data = MEM_mallocN(1, "packFile");
- } else {
+ }
+ else {
data = MEM_mallocN(filelen, "packFile");
}
if (read(file, data, filelen) == filelen) {
@@ -217,23 +222,23 @@ void packAll(Main *bmain, ReportList *reports)
VFont *vf;
bSound *sound;
- for(ima=bmain->image.first; ima; ima=ima->id.next) {
- if(ima->packedfile == NULL && ima->id.lib==NULL) {
- if(ima->source==IMA_SRC_FILE) {
+ for (ima=bmain->image.first; ima; ima=ima->id.next) {
+ if (ima->packedfile == NULL && ima->id.lib==NULL) {
+ if (ima->source==IMA_SRC_FILE) {
ima->packedfile = newPackedFile(reports, ima->name, ID_BLEND_PATH(bmain, &ima->id));
}
- else if(ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) {
+ else if (ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) {
BKE_reportf(reports, RPT_WARNING, "Image '%s' skipped, movies and image sequences not supported.", ima->id.name+2);
}
}
}
- for(vf=bmain->vfont.first; vf; vf=vf->id.next)
- if(vf->packedfile == NULL && vf->id.lib==NULL && strcmp(vf->name, FO_BUILTIN_NAME) != 0)
+ for (vf=bmain->vfont.first; vf; vf=vf->id.next)
+ if (vf->packedfile == NULL && vf->id.lib==NULL && strcmp(vf->name, FO_BUILTIN_NAME) != 0)
vf->packedfile = newPackedFile(reports, vf->name, bmain->name);
- for(sound=bmain->sound.first; sound; sound=sound->id.next)
- if(sound->packedfile == NULL && sound->id.lib==NULL)
+ for (sound=bmain->sound.first; sound; sound=sound->id.next)
+ if (sound->packedfile == NULL && sound->id.lib==NULL)
sound->packedfile = newPackedFile(reports, sound->name, bmain->name);
}
@@ -292,14 +297,15 @@ int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, i
// make sure the path to the file exists...
BLI_make_existing_file(name);
- file = open(name, O_BINARY + O_WRONLY + O_CREAT + O_TRUNC, 0666);
+ file = BLI_open(name, O_BINARY + O_WRONLY + O_CREAT + O_TRUNC, 0666);
if (file >= 0) {
if (write(file, pf->data, pf->size) != pf->size) {
BKE_reportf(reports, RPT_ERROR, "Error writing file: %s", name);
ret_value = RET_ERROR;
}
close(file);
- } else {
+ }
+ else {
BKE_reportf(reports, RPT_ERROR, "Error creating file: %s", name);
ret_value = RET_ERROR;
}
@@ -309,28 +315,27 @@ int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, i
if (BLI_rename(tempname, name) != 0) {
BKE_reportf(reports, RPT_ERROR, "Error restoring tempfile. Check files: '%s' '%s'", tempname, name);
}
- } else {
+ }
+ else {
if (BLI_delete(tempname, 0, 0) != 0) {
BKE_reportf(reports, RPT_ERROR, "Error deleting '%s' (ignored)", tempname);
}
}
}
- if(guimode) {} //XXX waitcursor(0);
+ if (guimode) {} //XXX waitcursor(0);
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)
{
@@ -344,15 +349,18 @@ int checkPackedFile(const char *filename, PackedFile *pf)
if (stat(name, &st)) {
ret_val = PF_NOFILE;
- } else if (st.st_size != pf->size) {
+ }
+ else if (st.st_size != pf->size) {
ret_val = PF_DIFFERS;
- } else {
+ }
+ else {
// we'll have to compare the two...
- file = open(name, O_BINARY | O_RDONLY);
+ file = BLI_open(name, O_BINARY | O_RDONLY, 0);
if (file < 0) {
ret_val = PF_NOFILE;
- } else {
+ }
+ else {
ret_val = PF_EQUAL;
for (i = 0; i < pf->size; i += sizeof(buf)) {
@@ -365,7 +373,8 @@ int checkPackedFile(const char *filename, PackedFile *pf)
// read error ...
ret_val = PF_DIFFERS;
break;
- } else {
+ }
+ else {
if (memcmp(buf, ((char *)pf->data) + i, len)) {
ret_val = PF_DIFFERS;
break;
@@ -380,14 +389,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)
{
@@ -502,7 +508,7 @@ int unpackImage(ReportList *reports, Image *ima, int how)
char *newname;
int ret_value = RET_ERROR;
- if (ima != NULL) {
+ if (ima != NULL && ima->name[0]) {
BLI_strncpy(localname, ima->name, sizeof(localname));
BLI_splitdirstring(localname, fi);
BLI_snprintf(localname, sizeof(localname), "//textures/%s", fi);
@@ -527,16 +533,16 @@ void unpackAll(Main *bmain, ReportList *reports, int how)
VFont *vf;
bSound *sound;
- for(ima=bmain->image.first; ima; ima=ima->id.next)
- if(ima->packedfile)
+ for (ima=bmain->image.first; ima; ima=ima->id.next)
+ if (ima->packedfile)
unpackImage(reports, ima, how);
- for(vf=bmain->vfont.first; vf; vf=vf->id.next)
- if(vf->packedfile)
+ for (vf=bmain->vfont.first; vf; vf=vf->id.next)
+ if (vf->packedfile)
unpackVFont(reports, vf, how);
- for(sound=bmain->sound.first; sound; sound=sound->id.next)
- if(sound->packedfile)
+ for (sound=bmain->sound.first; sound; sound=sound->id.next)
+ if (sound->packedfile)
unpackSound(bmain, reports, sound, how);
}
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 2b3f792f777..975602c2918 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -33,15 +33,17 @@
#include "DNA_object_types.h"
#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
#include "DNA_scene_types.h"
#include "DNA_brush_types.h"
+#include "BLI_bitmap.h"
#include "BLI_utildefines.h"
-
#include "BKE_brush.h"
#include "BKE_library.h"
#include "BKE_paint.h"
+#include "BKE_subsurf.h"
#include <stdlib.h>
#include <string.h>
@@ -53,10 +55,10 @@ const char PAINT_CURSOR_TEXTURE_PAINT[3] = {255, 255, 255};
Paint *paint_get_active(Scene *sce)
{
- if(sce) {
+ if (sce) {
ToolSettings *ts = sce->toolsettings;
- if(sce->basact && sce->basact->object) {
+ if (sce->basact && sce->basact->object) {
switch(sce->basact->object->mode) {
case OB_MODE_SCULPT:
return &ts->sculpt->paint;
@@ -67,7 +69,7 @@ Paint *paint_get_active(Scene *sce)
case OB_MODE_TEXTURE_PAINT:
return &ts->imapaint.paint;
case OB_MODE_EDIT:
- if(ts->use_uv_sculpt)
+ if (ts->use_uv_sculpt)
return &ts->uvsculpt->paint;
else
return &ts->imapaint.paint;
@@ -88,7 +90,7 @@ Brush *paint_brush(Paint *p)
void paint_brush_set(Paint *p, Brush *br)
{
- if(p) {
+ if (p) {
id_us_min((ID *)p->brush);
id_us_plus((ID *)br);
p->brush= br;
@@ -123,7 +125,7 @@ void paint_init(Paint *p, const char col[3])
/* If there's no brush, create one */
brush = paint_brush(p);
- if(brush == NULL)
+ if (brush == NULL)
brush= add_brush("Brush");
paint_brush_set(p, brush);
@@ -147,3 +149,26 @@ void copy_paint(Paint *src, Paint *tar)
tar->brush= src->brush;
id_us_plus((ID *)tar->brush);
}
+
+/* returns non-zero if any of the face's vertices
+ are hidden, zero otherwise */
+int paint_is_face_hidden(const MFace *f, const MVert *mvert)
+{
+ return ((mvert[f->v1].flag & ME_HIDE) ||
+ (mvert[f->v2].flag & ME_HIDE) ||
+ (mvert[f->v3].flag & ME_HIDE) ||
+ (f->v4 && (mvert[f->v4].flag & ME_HIDE)));
+}
+
+/* returns non-zero if any of the corners of the grid
+ face whose inner corner is at (x,y) are hidden,
+ zero otherwise */
+int paint_is_grid_face_hidden(const unsigned int *grid_hidden,
+ int gridsize, int x, int y)
+{
+ /* skip face if any of its corners are hidden */
+ return (BLI_BITMAP_GET(grid_hidden, y * gridsize + x) ||
+ BLI_BITMAP_GET(grid_hidden, y * gridsize + x+1) ||
+ BLI_BITMAP_GET(grid_hidden, (y+1) * gridsize + x+1) ||
+ BLI_BITMAP_GET(grid_hidden, (y+1) * gridsize + x));
+}
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 2e91d76cf21..dd1546d694b 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -97,8 +97,8 @@ int count_particles(ParticleSystem *psys)
int tot=0;
LOOP_SHOWN_PARTICLES {
- if(pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN)==0);
- else if(pa->alive == PARS_DEAD && (part->flag & PART_DIED)==0);
+ if (pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN)==0);
+ else if (pa->alive == PARS_DEAD && (part->flag & PART_DIED)==0);
else tot++;
}
return tot;
@@ -110,9 +110,9 @@ int count_particles_mod(ParticleSystem *psys, int totgr, int cur)
int tot=0;
LOOP_SHOWN_PARTICLES {
- if(pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN)==0);
- else if(pa->alive == PARS_DEAD && (part->flag & PART_DIED)==0);
- else if(p%totgr==cur) tot++;
+ if (pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN)==0);
+ else if (pa->alive == PARS_DEAD && (part->flag & PART_DIED)==0);
+ else if (p%totgr==cur) tot++;
}
return tot;
}
@@ -131,12 +131,12 @@ static ParticleCacheKey **psys_alloc_path_cache_buffers(ListBase *bufs, int tot,
totkey = 0;
cache = MEM_callocN(tot*sizeof(void*), "PathCacheArray");
- while(totkey < tot) {
+ while (totkey < tot) {
totbufkey= MIN2(tot-totkey, PATH_CACHE_BUF_SIZE);
buf= MEM_callocN(sizeof(LinkData), "PathCacheLinkData");
buf->data= MEM_callocN(sizeof(ParticleCacheKey)*totbufkey*steps, "ParticleCacheKey");
- for(i=0; i<totbufkey; i++)
+ for (i=0; i<totbufkey; i++)
cache[totkey+i] = ((ParticleCacheKey*)buf->data) + i*steps;
totkey += totbufkey;
@@ -150,10 +150,10 @@ static void psys_free_path_cache_buffers(ParticleCacheKey **cache, ListBase *buf
{
LinkData *buf;
- if(cache)
+ if (cache)
MEM_freeN(cache);
- for(buf= bufs->first; buf; buf=buf->next)
+ for (buf= bufs->first; buf; buf=buf->next)
MEM_freeN(buf->data);
BLI_freelistN(bufs);
}
@@ -165,10 +165,10 @@ static void psys_free_path_cache_buffers(ParticleCacheKey **cache, ListBase *buf
ParticleSystem *psys_get_current(Object *ob)
{
ParticleSystem *psys;
- if(ob==NULL) return NULL;
+ if (ob==NULL) return NULL;
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- if(psys->flag & PSYS_CURRENT)
+ for (psys=ob->particlesystem.first; psys; psys=psys->next) {
+ if (psys->flag & PSYS_CURRENT)
return psys;
}
@@ -179,10 +179,10 @@ short psys_get_current_num(Object *ob)
ParticleSystem *psys;
short i;
- if(ob==NULL) return 0;
+ if (ob==NULL) return 0;
- for(psys=ob->particlesystem.first, i=0; psys; psys=psys->next, i++)
- if(psys->flag & PSYS_CURRENT)
+ for (psys=ob->particlesystem.first, i=0; psys; psys=psys->next, i++)
+ if (psys->flag & PSYS_CURRENT)
return i;
return i;
@@ -192,10 +192,10 @@ void psys_set_current_num(Object *ob, int index)
ParticleSystem *psys;
short i;
- if(ob==NULL) return;
+ if (ob==NULL) return;
- for(psys=ob->particlesystem.first, i=0; psys; psys=psys->next, i++) {
- if(i == index)
+ for (psys=ob->particlesystem.first, i=0; psys; psys=psys->next, i++) {
+ if (i == index)
psys->flag |= PSYS_CURRENT;
else
psys->flag &= ~PSYS_CURRENT;
@@ -206,9 +206,9 @@ Object *psys_find_object(Scene *scene, ParticleSystem *psys)
Base *base;
ParticleSystem *tpsys;
- for(base = scene->base.first; base; base = base->next) {
- for(tpsys = base->object->particlesystem.first; psys; psys=psys->next) {
- if(tpsys == psys)
+ for (base = scene->base.first; base; base = base->next) {
+ for (tpsys = base->object->particlesystem.first; psys; psys=psys->next) {
+ if (tpsys == psys)
return base->object;
}
}
@@ -219,18 +219,18 @@ Object *psys_get_lattice(ParticleSimulationData *sim)
{
Object *lattice=NULL;
- if(psys_in_edit_mode(sim->scene, sim->psys)==0) {
+ if (psys_in_edit_mode(sim->scene, sim->psys)==0) {
ModifierData *md = (ModifierData*)psys_get_modifier(sim->ob, sim->psys);
- for(; md; md=md->next) {
- if(md->type==eModifierType_Lattice) {
+ for (; md; md=md->next) {
+ if (md->type==eModifierType_Lattice) {
LatticeModifierData *lmd = (LatticeModifierData *)md;
lattice=lmd->object;
break;
}
}
- if(lattice)
+ if (lattice)
init_latt_deform(lattice, NULL);
}
@@ -240,14 +240,14 @@ void psys_disable_all(Object *ob)
{
ParticleSystem *psys=ob->particlesystem.first;
- for(; psys; psys=psys->next)
+ for (; psys; psys=psys->next)
psys->flag |= PSYS_DISABLED;
}
void psys_enable_all(Object *ob)
{
ParticleSystem *psys=ob->particlesystem.first;
- for(; psys; psys=psys->next)
+ for (; psys; psys=psys->next)
psys->flag &= ~PSYS_DISABLED;
}
int psys_in_edit_mode(Scene *scene, ParticleSystem *psys)
@@ -261,28 +261,28 @@ static void psys_create_frand(ParticleSystem *psys)
BLI_srandom(psys->seed);
- for(i=0; i<1024; i++, rand++)
+ for (i=0; i<1024; i++, rand++)
*rand = BLI_frand();
}
int psys_check_enabled(Object *ob, ParticleSystem *psys)
{
ParticleSystemModifierData *psmd;
- if(psys->flag & PSYS_DISABLED || psys->flag & PSYS_DELETE || !psys->part)
+ if (psys->flag & PSYS_DISABLED || psys->flag & PSYS_DELETE || !psys->part)
return 0;
psmd= psys_get_modifier(ob, psys);
- if(psys->renderdata || G.rendering) {
- if(!(psmd->modifier.mode & eModifierMode_Render))
+ if (psys->renderdata || G.rendering) {
+ if (!(psmd->modifier.mode & eModifierMode_Render))
return 0;
}
- else if(!(psmd->modifier.mode & eModifierMode_Realtime))
+ else if (!(psmd->modifier.mode & eModifierMode_Realtime))
return 0;
/* perhaps not the perfect place, but we have to be sure the rands are there before usage */
- if(!psys->frand)
+ if (!psys->frand)
psys_create_frand(psys);
- else if(psys->recalc & PSYS_RECALC_RESET) {
+ else if (psys->recalc & PSYS_RECALC_RESET) {
MEM_freeN(psys->frand);
psys_create_frand(psys);
}
@@ -292,7 +292,7 @@ int psys_check_enabled(Object *ob, ParticleSystem *psys)
int psys_check_edited(ParticleSystem *psys)
{
- 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);
@@ -304,11 +304,11 @@ void psys_check_group_weights(ParticleSettings *part)
GroupObject *go;
int current = 0;
- if(part->ren_as == PART_DRAW_GR && part->dup_group && part->dup_group->gobject.first) {
+ if (part->ren_as == PART_DRAW_GR && part->dup_group && part->dup_group->gobject.first) {
/* first remove all weights that don't have an object in the group */
dw = part->dupliweights.first;
- while(dw) {
- if(!object_in_group(dw->ob, part->dup_group)) {
+ while (dw) {
+ if (!object_in_group(dw->ob, part->dup_group)) {
tdw = dw->next;
BLI_freelinkN(&part->dupliweights, dw);
dw = tdw;
@@ -319,12 +319,12 @@ void psys_check_group_weights(ParticleSettings *part)
/* then add objects in the group to new list */
go = part->dup_group->gobject.first;
- while(go) {
+ while (go) {
dw = part->dupliweights.first;
- while(dw && dw->ob != go->ob)
+ while (dw && dw->ob != go->ob)
dw = dw->next;
- if(!dw) {
+ if (!dw) {
dw = MEM_callocN(sizeof(ParticleDupliWeight), "ParticleDupliWeight");
dw->ob = go->ob;
dw->count = 1;
@@ -335,16 +335,16 @@ void psys_check_group_weights(ParticleSettings *part)
}
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) {
current = 1;
break;
}
}
- if(!current) {
+ if (!current) {
dw = part->dupliweights.first;
- if(dw)
+ if (dw)
dw->flag |= PART_DUPLIW_CURRENT;
}
}
@@ -361,7 +361,7 @@ int psys_uses_gravity(ParticleSimulationData *sim)
/************************************************/
static void fluid_free_settings(SPHFluidSettings *fluid)
{
- if(fluid)
+ if (fluid)
MEM_freeN(fluid);
}
@@ -373,7 +373,7 @@ void psys_free_settings(ParticleSettings *part)
free_partdeflect(part->pd);
free_partdeflect(part->pd2);
- if(part->effector_weights)
+ if (part->effector_weights)
MEM_freeN(part->effector_weights);
BLI_freelistN(&part->dupliweights);
@@ -381,10 +381,10 @@ void psys_free_settings(ParticleSettings *part)
boid_free_settings(part->boids);
fluid_free_settings(part->fluid);
- for(a=0; a<MAX_MTEX; a++) {
+ for (a=0; a<MAX_MTEX; a++) {
mtex= part->mtex[a];
- if(mtex && mtex->tex) mtex->tex->id.us--;
- if(mtex) MEM_freeN(mtex);
+ if (mtex && mtex->tex) mtex->tex->id.us--;
+ if (mtex) MEM_freeN(mtex);
}
}
@@ -393,7 +393,7 @@ void free_hair(Object *UNUSED(ob), ParticleSystem *psys, int dynamics)
PARTICLE_P;
LOOP_PARTICLES {
- if(pa->hair)
+ if (pa->hair)
MEM_freeN(pa->hair);
pa->hair = NULL;
pa->totkey = 0;
@@ -401,8 +401,8 @@ void free_hair(Object *UNUSED(ob), ParticleSystem *psys, int dynamics)
psys->flag &= ~PSYS_HAIR_DONE;
- if(psys->clmd) {
- if(dynamics) {
+ if (psys->clmd) {
+ if (dynamics) {
BKE_ptcache_free_list(&psys->ptcaches);
psys->clmd->point_cache = psys->pointcache = NULL;
psys->clmd->ptcaches.first = psys->clmd->ptcaches.last = NULL;
@@ -417,11 +417,11 @@ void free_hair(Object *UNUSED(ob), ParticleSystem *psys, int dynamics)
}
}
- if(psys->hair_in_dm)
+ if (psys->hair_in_dm)
psys->hair_in_dm->release(psys->hair_in_dm);
psys->hair_in_dm = NULL;
- if(psys->hair_out_dm)
+ if (psys->hair_out_dm)
psys->hair_out_dm->release(psys->hair_out_dm);
psys->hair_out_dm = NULL;
}
@@ -429,14 +429,14 @@ void free_keyed_keys(ParticleSystem *psys)
{
PARTICLE_P;
- if(psys->part->type == PART_HAIR)
+ if (psys->part->type == PART_HAIR)
return;
- if(psys->particles && psys->particles->keys) {
+ if (psys->particles && psys->particles->keys) {
MEM_freeN(psys->particles->keys);
LOOP_PARTICLES {
- if(pa->keys) {
+ if (pa->keys) {
pa->keys= NULL;
pa->totkey= 0;
}
@@ -451,12 +451,12 @@ static void free_child_path_cache(ParticleSystem *psys)
}
void psys_free_path_cache(ParticleSystem *psys, PTCacheEdit *edit)
{
- if(edit) {
+ if (edit) {
psys_free_path_cache_buffers(edit->pathcache, &edit->pathcachebufs);
edit->pathcache= NULL;
edit->totcached= 0;
}
- if(psys) {
+ if (psys) {
psys_free_path_cache_buffers(psys->pathcache, &psys->pathcachebufs);
psys->pathcache= NULL;
psys->totcached= 0;
@@ -466,7 +466,7 @@ void psys_free_path_cache(ParticleSystem *psys, PTCacheEdit *edit)
}
void psys_free_children(ParticleSystem *psys)
{
- if(psys->child) {
+ if (psys->child) {
MEM_freeN(psys->child);
psys->child= NULL;
psys->totchild=0;
@@ -478,18 +478,18 @@ void psys_free_particles(ParticleSystem *psys)
{
PARTICLE_P;
- if(psys->particles) {
- if(psys->part->type==PART_HAIR) {
+ if (psys->particles) {
+ if (psys->part->type==PART_HAIR) {
LOOP_PARTICLES {
- if(pa->hair)
+ if (pa->hair)
MEM_freeN(pa->hair);
}
}
- if(psys->particles->keys)
+ if (psys->particles->keys)
MEM_freeN(psys->particles->keys);
- if(psys->particles->boid)
+ if (psys->particles->boid)
MEM_freeN(psys->particles->boid);
MEM_freeN(psys->particles);
@@ -499,20 +499,20 @@ void psys_free_particles(ParticleSystem *psys)
}
void psys_free_pdd(ParticleSystem *psys)
{
- if(psys->pdd) {
- if(psys->pdd->cdata)
+ if (psys->pdd) {
+ if (psys->pdd->cdata)
MEM_freeN(psys->pdd->cdata);
psys->pdd->cdata = NULL;
- if(psys->pdd->vdata)
+ if (psys->pdd->vdata)
MEM_freeN(psys->pdd->vdata);
psys->pdd->vdata = NULL;
- if(psys->pdd->ndata)
+ if (psys->pdd->ndata)
MEM_freeN(psys->pdd->ndata);
psys->pdd->ndata = NULL;
- if(psys->pdd->vedata)
+ if (psys->pdd->vedata)
MEM_freeN(psys->pdd->vedata);
psys->pdd->vedata = NULL;
@@ -523,7 +523,7 @@ void psys_free_pdd(ParticleSystem *psys)
/* free everything */
void psys_free(Object *ob, ParticleSystem * psys)
{
- if(psys) {
+ if (psys) {
int nr = 0;
ParticleSystem * tpsys;
@@ -533,31 +533,29 @@ void psys_free(Object *ob, ParticleSystem * psys)
psys_free_particles(psys);
- if(psys->edit && psys->free_edit)
+ if (psys->edit && psys->free_edit)
psys->free_edit(psys->edit);
- if(psys->child) {
+ if (psys->child) {
MEM_freeN(psys->child);
psys->child = NULL;
psys->totchild = 0;
}
// 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;
}
}
}
// clear do-not-draw-flag
- if(!nr)
+ if (!nr)
ob->transflag &= ~OB_DUPLIPARTS;
- if(psys->part) {
+ if (psys->part) {
psys->part->id.us--;
psys->part=NULL;
}
@@ -570,15 +568,15 @@ void psys_free(Object *ob, ParticleSystem * psys)
BLI_bvhtree_free(psys->bvhtree);
BLI_kdtree_free(psys->tree);
- if(psys->fluid_springs)
+ if (psys->fluid_springs)
MEM_freeN(psys->fluid_springs);
pdEndEffectors(&psys->effectors);
- if(psys->frand)
+ if (psys->frand)
MEM_freeN(psys->frand);
- if(psys->pdd) {
+ if (psys->pdd) {
psys_free_pdd(psys);
MEM_freeN(psys->pdd);
}
@@ -650,7 +648,7 @@ static float psys_render_projected_area(ParticleSystem *psys, const float center
/* project point on screen */
mul_m4_v4(data->winmat, co);
- if(co[3] != 0.0f) {
+ if (co[3] != 0.0f) {
co[0]= 0.5f*data->winx*(1.0f + co[0]/co[3]);
co[1]= 0.5f*data->winy*(1.0f + co[1]/co[3]);
}
@@ -661,14 +659,14 @@ static float psys_render_projected_area(ParticleSystem *psys, const float center
/* make smaller using fallof once over screen edge */
*viewport= 1.0f;
- if(co[0]+radius < 0.0f)
+ if (co[0]+radius < 0.0f)
*viewport *= psys_render_viewport_falloff(vprate, -(co[0]+radius), data->winx);
- else if(co[0]-radius > data->winx)
+ else if (co[0]-radius > data->winx)
*viewport *= psys_render_viewport_falloff(vprate, (co[0]-radius) - data->winx, data->winx);
- if(co[1]+radius < 0.0f)
+ if (co[1]+radius < 0.0f)
*viewport *= psys_render_viewport_falloff(vprate, -(co[1]+radius), data->winy);
- else if(co[1]-radius > data->winy)
+ else if (co[1]-radius > data->winy)
*viewport *= psys_render_viewport_falloff(vprate, (co[1]-radius) - data->winy, data->winy);
return area;
@@ -679,9 +677,9 @@ void psys_render_set(Object *ob, ParticleSystem *psys, float viewmat[][4], float
ParticleRenderData*data;
ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys);
- if(!G.rendering)
+ if (!G.rendering)
return;
- if(psys->renderdata)
+ if (psys->renderdata)
return;
data= MEM_callocN(sizeof(ParticleRenderData), "ParticleRenderData");
@@ -697,7 +695,7 @@ void psys_render_set(Object *ob, ParticleSystem *psys, float viewmat[][4], float
data->childcachebufs.last = psys->childcachebufs.last;
data->totchildcache= psys->totchildcache;
- if(psmd->dm)
+ if (psmd->dm)
data->dm= CDDM_copy(psmd->dm);
data->totdmvert= psmd->totdmvert;
data->totdmedge= psmd->totdmedge;
@@ -721,7 +719,7 @@ void psys_render_set(Object *ob, ParticleSystem *psys, float viewmat[][4], float
psys->renderdata= data;
/* Hair can and has to be recalculated if everything isn't displayed. */
- if(psys->part->disp != 100 && psys->part->type == PART_HAIR)
+ if (psys->part->disp != 100 && psys->part->type == PART_HAIR)
psys->recalc |= PSYS_RECALC_RESET;
}
@@ -731,20 +729,20 @@ void psys_render_restore(Object *ob, ParticleSystem *psys)
ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys);
data= psys->renderdata;
- if(!data)
+ if (!data)
return;
- if(data->elems)
+ if (data->elems)
MEM_freeN(data->elems);
- if(psmd->dm) {
+ if (psmd->dm) {
psmd->dm->needsFree= 1;
psmd->dm->release(psmd->dm);
}
psys_free_path_cache(psys, NULL);
- if(psys->child) {
+ if (psys->child) {
MEM_freeN(psys->child);
psys->child= 0;
psys->totchild= 0;
@@ -767,7 +765,7 @@ void psys_render_restore(Object *ob, ParticleSystem *psys)
psmd->totdmface= data->totdmface;
psmd->flag &= ~eParticleSystemFlag_psys_updated;
- if(psmd->dm)
+ if (psmd->dm)
psys_calc_dmcache(ob, psmd->dm, psys);
MEM_freeN(data);
@@ -791,15 +789,15 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
int *origindex, *facetotvert;
int a, b, totorigface, totface, newtot, skipped;
- if(part->ren_as!=PART_DRAW_PATH || !(part->draw & PART_DRAW_REN_STRAND))
+ if (part->ren_as!=PART_DRAW_PATH || !(part->draw & PART_DRAW_REN_STRAND))
return tot;
- if(!ctx->sim.psys->renderdata)
+ if (!ctx->sim.psys->renderdata)
return tot;
data= ctx->sim.psys->renderdata;
- if(data->timeoffset)
+ if (data->timeoffset)
return 0;
- if(!(part->simplify_flag & PART_SIMPLIFY_ENABLE))
+ if (!(part->simplify_flag & PART_SIMPLIFY_ENABLE))
return tot;
mvert= dm->getVertArray(dm);
@@ -808,7 +806,7 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
totface= dm->getNumTessFaces(dm);
totorigface= me->totpoly;
- if(totface == 0 || totorigface == 0)
+ if (totface == 0 || totorigface == 0)
return tot;
facearea= MEM_callocN(sizeof(float)*totorigface, "SimplifyFaceArea");
@@ -816,7 +814,7 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
facetotvert= MEM_callocN(sizeof(int)*totorigface, "SimplifyFaceArea");
elems= MEM_callocN(sizeof(ParticleRenderElem)*totorigface, "SimplifyFaceElem");
- if(data->elems)
+ if (data->elems)
MEM_freeN(data->elems);
data->dosimplify= 1;
@@ -824,17 +822,17 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
data->origindex= origindex;
/* compute number of children per original face */
- for(a=0; a<tot; a++) {
+ for (a=0; a<tot; a++) {
b= (origindex)? origindex[ctx->index[a]]: ctx->index[a];
- if(b != -1)
+ if (b != -1)
elems[b].totchild++;
}
/* compute areas and centers of original faces */
- for(mf=mface, a=0; a<totface; a++, mf++) {
+ for (mf=mface, a=0; a<totface; a++, mf++) {
b= (origindex)? origindex[a]: a;
- if(b != -1) {
+ if (b != -1) {
copy_v3_v3(co1, mvert[mf->v1].co);
copy_v3_v3(co2, mvert[mf->v2].co);
copy_v3_v3(co3, mvert[mf->v3].co);
@@ -843,7 +841,7 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
add_v3_v3(facecenter[b], co2);
add_v3_v3(facecenter[b], co3);
- if(mf->v4) {
+ if (mf->v4) {
copy_v3_v3(co4, mvert[mf->v4].co);
add_v3_v3(facecenter[b], co4);
facearea[b] += area_quad_v3(co1, co2, co3, co4);
@@ -856,8 +854,8 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
}
}
- for(a=0; a<totorigface; a++)
- if(facetotvert[a] > 0)
+ for (a=0; a<totorigface; a++)
+ if (facetotvert[a] > 0)
mul_v3_fl(facecenter[a], 1.0f/facetotvert[a]);
/* for conversion from BU area / pixel area to reference screen size */
@@ -866,17 +864,17 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
fac= fac*fac;
powrate= log(0.5f)/log(part->simplify_rate*0.5f);
- if(part->simplify_flag & PART_SIMPLIFY_VIEWPORT)
+ if (part->simplify_flag & PART_SIMPLIFY_VIEWPORT)
vprate= pow(1.0f - part->simplify_viewport, 5.0);
else
vprate= 1.0;
/* set simplification parameters per original face */
- for(a=0, elem=elems; a<totorigface; a++, elem++) {
+ for (a=0, elem=elems; a<totorigface; a++, elem++) {
area = psys_render_projected_area(ctx->sim.psys, facecenter[a], facearea[a], vprate, &viewport);
arearatio= fac*area/facearea[a];
- if((arearatio < 1.0f || viewport < 1.0f) && elem->totchild) {
+ if ((arearatio < 1.0f || viewport < 1.0f) && elem->totchild) {
/* lambda is percentage of elements to keep */
lambda= (arearatio < 1.0f)? powf(arearatio, powrate): 1.0f;
lambda *= viewport;
@@ -902,7 +900,7 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
/* extend lambda to include transition */
lambda= lambda + elem->t;
- if(lambda > 1.0f)
+ if (lambda > 1.0f)
lambda= 1.0f;
}
else {
@@ -927,10 +925,10 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
ctx->skip= MEM_callocN(sizeof(int)*tot, "SimplificationSkip");
skipped= 0;
- for(a=0, newtot=0; a<tot; a++) {
+ for (a=0, newtot=0; a<tot; a++) {
b= (origindex)? origindex[ctx->index[a]]: ctx->index[a];
- if(b != -1) {
- if(elems[b].curchild++ < ceil(elems[b].lambda*elems[b].totchild)) {
+ if (b != -1) {
+ if (elems[b].curchild++ < ceil(elems[b].lambda*elems[b].totchild)) {
ctx->index[newtot]= ctx->index[a];
ctx->skip[newtot]= skipped;
skipped= 0;
@@ -941,7 +939,7 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
else skipped++;
}
- for(a=0, elem=elems; a<totorigface; a++, elem++)
+ for (a=0, elem=elems; a<totorigface; a++, elem++)
elem->curchild= 0;
return newtot;
@@ -954,15 +952,15 @@ int psys_render_simplify_params(ParticleSystem *psys, ChildParticle *cpa, float
float x, w, scale, alpha, lambda, t, scalemin, scalemax;
int b;
- if(!(psys->renderdata && (psys->part->simplify_flag & PART_SIMPLIFY_ENABLE)))
+ if (!(psys->renderdata && (psys->part->simplify_flag & PART_SIMPLIFY_ENABLE)))
return 0;
data= psys->renderdata;
- if(!data->dosimplify)
+ if (!data->dosimplify)
return 0;
b= (data->origindex)? data->origindex[cpa->num]: cpa->num;
- if(b == -1)
+ if (b == -1)
return 0;
elem= &data->elems[b];
@@ -972,17 +970,17 @@ int psys_render_simplify_params(ParticleSystem *psys, ChildParticle *cpa, float
scalemin= elem->scalemin;
scalemax= elem->scalemax;
- if(!elem->reduce) {
+ if (!elem->reduce) {
scale= scalemin;
alpha= 1.0f;
}
else {
x= (elem->curchild+0.5f)/elem->totchild;
- if(x < lambda-t) {
+ if (x < lambda-t) {
scale= scalemax;
alpha= 1.0f;
}
- else if(x >= lambda+t) {
+ else if (x >= lambda+t) {
scale= scalemin;
alpha= 0.0f;
}
@@ -1009,7 +1007,7 @@ static float interpolate_particle_value(float v1, float v2, float v3, float v4,
float value;
value= w[0]*v1 + w[1]*v2 + w[2]*v3;
- if(four)
+ if (four)
value += w[3]*v4;
CLAMP(value, 0.f, 1.f);
@@ -1021,7 +1019,7 @@ void psys_interpolate_particle(short type, ParticleKey keys[4], float dt, Partic
{
float t[4];
- if(type<0) {
+ if (type<0) {
interp_cubic_v3( result->co, result->vel,keys[1].co, keys[1].vel, keys[2].co, keys[2].vel, dt);
}
else {
@@ -1029,15 +1027,15 @@ void psys_interpolate_particle(short type, ParticleKey keys[4], float dt, Partic
interp_v3_v3v3v3v3(result->co, keys[0].co, keys[1].co, keys[2].co, keys[3].co, t);
- if(velocity) {
+ if (velocity) {
float temp[3];
- if(dt>0.999f) {
+ if (dt>0.999f) {
key_curve_position_weights(dt-0.001f, t, type);
interp_v3_v3v3v3v3(temp, keys[0].co, keys[1].co, keys[2].co, keys[3].co, t);
sub_v3_v3v3(result->vel, result->co, temp);
}
- else{
+ else {
key_curve_position_weights(dt+0.001f, t, type);
interp_v3_v3v3v3v3(temp, keys[0].co, keys[1].co, keys[2].co, keys[3].co, t);
sub_v3_v3v3(result->vel, temp, result->co);
@@ -1073,15 +1071,15 @@ static void get_pointcache_keys_for_time(Object *UNUSED(ob), PointCache *cache,
static PTCacheMem *pm = NULL;
int index1, index2;
- if(index < 0) { /* initialize */
+ if (index < 0) { /* initialize */
*cur = cache->mem_cache.first;
- if(*cur)
+ if (*cur)
*cur = (*cur)->next;
}
else {
- if(*cur) {
- while(*cur && (*cur)->next && (float)(*cur)->frame < t)
+ if (*cur) {
+ while (*cur && (*cur)->next && (float)(*cur)->frame < t)
*cur = (*cur)->next;
pm = *cur;
@@ -1090,12 +1088,12 @@ static void get_pointcache_keys_for_time(Object *UNUSED(ob), PointCache *cache,
index1 = BKE_ptcache_mem_index_find(pm->prev, index);
BKE_ptcache_make_particle_key(key2, index2, pm->data, (float)pm->frame);
- if(index1 < 0)
+ if (index1 < 0)
copy_particle_key(key1, key2, 1);
else
BKE_ptcache_make_particle_key(key1, index1, pm->prev->data, (float)pm->prev->frame);
}
- else if(cache->mem_cache.first) {
+ else if (cache->mem_cache.first) {
pm = cache->mem_cache.first;
index2 = BKE_ptcache_mem_index_find(pm, index);
BKE_ptcache_make_particle_key(key2, index2, pm->data, (float)pm->frame);
@@ -1108,16 +1106,16 @@ static int get_pointcache_times_for_particle(PointCache *cache, int index, float
PTCacheMem *pm;
int ret = 0;
- for(pm=cache->mem_cache.first; pm; pm=pm->next) {
- if(BKE_ptcache_mem_index_find(pm, index) >= 0) {
+ for (pm=cache->mem_cache.first; pm; pm=pm->next) {
+ if (BKE_ptcache_mem_index_find(pm, index) >= 0) {
*start = pm->frame;
ret++;
break;
}
}
- for(pm=cache->mem_cache.last; pm; pm=pm->prev) {
- if(BKE_ptcache_mem_index_find(pm, index) >= 0) {
+ for (pm=cache->mem_cache.last; pm; pm=pm->prev) {
+ if (BKE_ptcache_mem_index_find(pm, index) >= 0) {
*end = pm->frame;
ret++;
break;
@@ -1132,8 +1130,8 @@ float psys_get_dietime_from_cache(PointCache *cache, int index)
PTCacheMem *pm;
int dietime = 10000000; /* some max value so that we can default to pa->time+lifetime */
- for(pm=cache->mem_cache.last; pm; pm=pm->prev) {
- if(BKE_ptcache_mem_index_find(pm, index) >= 0)
+ for (pm=cache->mem_cache.last; pm; pm=pm->prev) {
+ if (BKE_ptcache_mem_index_find(pm, index) >= 0)
return (float)pm->frame;
}
@@ -1143,7 +1141,7 @@ float psys_get_dietime_from_cache(PointCache *cache, int index)
static void init_particle_interpolation(Object *ob, ParticleSystem *psys, ParticleData *pa, ParticleInterpolationData *pind)
{
- if(pind->epoint) {
+ if (pind->epoint) {
PTCacheEditPoint *point = pind->epoint;
pind->ekey[0] = point->keys;
@@ -1152,7 +1150,7 @@ static void init_particle_interpolation(Object *ob, ParticleSystem *psys, Partic
pind->birthtime = *(point->keys->time);
pind->dietime = *((point->keys + point->totkey - 1)->time);
}
- else if(pind->keyed) {
+ else if (pind->keyed) {
ParticleKey *key = pa->keys;
pind->kkey[0] = key;
pind->kkey[1] = pa->totkey > 1 ? key + 1 : NULL;
@@ -1160,13 +1158,13 @@ static void init_particle_interpolation(Object *ob, ParticleSystem *psys, Partic
pind->birthtime = key->time;
pind->dietime = (key + pa->totkey - 1)->time;
}
- else if(pind->cache) {
+ else if (pind->cache) {
float start=0.0f, end=0.0f;
get_pointcache_keys_for_time(ob, pind->cache, &pind->pm, -1, 0.0f, NULL, NULL);
pind->birthtime = pa ? pa->time : pind->cache->startframe;
pind->dietime = pa ? pa->dietime : pind->cache->endframe;
- if(get_pointcache_times_for_particle(pind->cache, pa - psys->particles, &start, &end)) {
+ if (get_pointcache_times_for_particle(pind->cache, pa - psys->particles, &start, &end)) {
pind->birthtime = MAX2(pind->birthtime, start);
pind->dietime = MIN2(pind->dietime, end);
}
@@ -1179,7 +1177,7 @@ static void init_particle_interpolation(Object *ob, ParticleSystem *psys, Partic
pind->birthtime = key->time;
pind->dietime = (key + pa->totkey - 1)->time;
- if(pind->dm) {
+ if (pind->dm) {
pind->mvert[0] = CDDM_get_vert(pind->dm, pa->hair_index);
pind->mvert[1] = pind->mvert[0] + 1;
}
@@ -1188,7 +1186,7 @@ static void init_particle_interpolation(Object *ob, ParticleSystem *psys, Partic
static void edit_to_particle(ParticleKey *key, PTCacheEditKey *ekey)
{
copy_v3_v3(key->co, ekey->co);
- if(ekey->vel) {
+ if (ekey->vel) {
copy_v3_v3(key->vel, ekey->vel);
}
key->time = *(ekey->time);
@@ -1216,41 +1214,41 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
memset(keys, 0, sizeof(keys));
/* interpret timing and find keys */
- if(point) {
- if(result->time < 0.0f)
+ if (point) {
+ if (result->time < 0.0f)
real_t = -result->time;
else
real_t = *(pind->ekey[0]->time) + t * (*(pind->ekey[0][point->totkey-1].time) - *(pind->ekey[0]->time));
- while(*(pind->ekey[1]->time) < real_t)
+ while (*(pind->ekey[1]->time) < real_t)
pind->ekey[1]++;
pind->ekey[0] = pind->ekey[1] - 1;
}
- else if(pind->keyed) {
+ else if (pind->keyed) {
/* we have only one key, so let's use that */
- if(pind->kkey[1]==NULL) {
+ if (pind->kkey[1]==NULL) {
copy_particle_key(result, pind->kkey[0], 1);
return;
}
- if(result->time < 0.0f)
+ if (result->time < 0.0f)
real_t = -result->time;
else
real_t = pind->kkey[0]->time + t * (pind->kkey[0][pa->totkey-1].time - pind->kkey[0]->time);
- if(psys->part->phystype==PART_PHYS_KEYED && psys->flag & PSYS_KEYED_TIMING) {
+ if (psys->part->phystype==PART_PHYS_KEYED && psys->flag & PSYS_KEYED_TIMING) {
ParticleTarget *pt = psys->targets.first;
pt=pt->next;
- while(pt && pa->time + pt->time < real_t)
+ while (pt && pa->time + pt->time < real_t)
pt= pt->next;
- if(pt) {
+ if (pt) {
pt=pt->prev;
- if(pa->time + pt->time + pt->duration > real_t)
+ if (pa->time + pt->time + pt->duration > real_t)
real_t = pa->time + pt->time;
}
else
@@ -1259,24 +1257,24 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
CLAMP(real_t, pa->time, pa->dietime);
- while(pind->kkey[1]->time < real_t)
+ while (pind->kkey[1]->time < real_t)
pind->kkey[1]++;
pind->kkey[0] = pind->kkey[1] - 1;
}
- else if(pind->cache) {
- if(result->time < 0.0f) /* flag for time in frames */
+ else if (pind->cache) {
+ if (result->time < 0.0f) /* flag for time in frames */
real_t = -result->time;
else
real_t = pa->time + t * (pa->dietime - pa->time);
}
else {
- if(result->time < 0.0f)
+ if (result->time < 0.0f)
real_t = -result->time;
else
real_t = pind->hkey[0]->time + t * (pind->hkey[0][pa->totkey-1].time - pind->hkey[0]->time);
- while(pind->hkey[1]->time < real_t) {
+ while (pind->hkey[1]->time < real_t) {
pind->hkey[1]++;
pind->mvert[1]++;
}
@@ -1285,20 +1283,20 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
}
/* set actual interpolation keys */
- if(point) {
+ if (point) {
edit_to_particle(keys + 1, pind->ekey[0]);
edit_to_particle(keys + 2, pind->ekey[1]);
}
- else if(pind->dm) {
+ else if (pind->dm) {
pind->mvert[0] = pind->mvert[1] - 1;
mvert_to_particle(keys + 1, pind->mvert[0], pind->hkey[0]);
mvert_to_particle(keys + 2, pind->mvert[1], pind->hkey[1]);
}
- else if(pind->keyed) {
+ else if (pind->keyed) {
memcpy(keys + 1, pind->kkey[0], sizeof(ParticleKey));
memcpy(keys + 2, pind->kkey[1], sizeof(ParticleKey));
}
- else if(pind->cache) {
+ else if (pind->cache) {
get_pointcache_keys_for_time(NULL, pind->cache, &pind->pm, p, real_t, keys+1, keys+2);
}
else {
@@ -1307,40 +1305,40 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
}
/* set secondary interpolation keys for hair */
- if(!pind->keyed && !pind->cache && !point_vel) {
- if(point) {
- if(pind->ekey[0] != point->keys)
+ if (!pind->keyed && !pind->cache && !point_vel) {
+ if (point) {
+ if (pind->ekey[0] != point->keys)
edit_to_particle(keys, pind->ekey[0] - 1);
else
edit_to_particle(keys, pind->ekey[0]);
}
- else if(pind->dm) {
- if(pind->hkey[0] != pa->hair)
+ else if (pind->dm) {
+ if (pind->hkey[0] != pa->hair)
mvert_to_particle(keys, pind->mvert[0] - 1, pind->hkey[0] - 1);
else
mvert_to_particle(keys, pind->mvert[0], pind->hkey[0]);
}
else {
- if(pind->hkey[0] != pa->hair)
+ if (pind->hkey[0] != pa->hair)
hair_to_particle(keys, pind->hkey[0] - 1);
else
hair_to_particle(keys, pind->hkey[0]);
}
- if(point) {
- if(pind->ekey[1] != point->keys + point->totkey - 1)
+ if (point) {
+ if (pind->ekey[1] != point->keys + point->totkey - 1)
edit_to_particle(keys + 3, pind->ekey[1] + 1);
else
edit_to_particle(keys + 3, pind->ekey[1]);
}
- else if(pind->dm) {
- if(pind->hkey[1] != pa->hair + pa->totkey - 1)
+ else if (pind->dm) {
+ if (pind->hkey[1] != pa->hair + pa->totkey - 1)
mvert_to_particle(keys + 3, pind->mvert[1] + 1, pind->hkey[1] + 1);
else
mvert_to_particle(keys + 3, pind->mvert[1], pind->hkey[1]);
}
else {
- if(pind->hkey[1] != pa->hair + pa->totkey - 1)
+ if (pind->hkey[1] != pa->hair + pa->totkey - 1)
hair_to_particle(keys + 3, pind->hkey[1] + 1);
else
hair_to_particle(keys + 3, pind->hkey[1]);
@@ -1351,7 +1349,7 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
keytime = (real_t - keys[1].time) / dfra;
/* convert velocity to timestep size */
- if(pind->keyed || pind->cache || point_vel) {
+ if (pind->keyed || pind->cache || point_vel) {
invdt = dfra * 0.04f * (psys ? psys->part->timetweak : 1.f);
mul_v3_fl(keys[1].vel, invdt);
mul_v3_fl(keys[2].vel, invdt);
@@ -1364,7 +1362,7 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
,keys, keytime, result, 1);
/* the velocity needs to be converted back from cubic interpolation */
- if(pind->keyed || pind->cache || point_vel)
+ if (pind->keyed || pind->cache || point_vel)
mul_v3_fl(result->vel, 1.f/invdt);
}
@@ -1376,10 +1374,10 @@ static void interpolate_pathcache(ParticleCacheKey *first, float t, ParticleCach
/* scale the requested time to fit the entire path even if the path is cut early */
t *= (first+first->steps)->time;
- while(i<first->steps && cur->time < t)
+ while (i<first->steps && cur->time < t)
cur++;
- if(cur->time == t)
+ if (cur->time == t)
*result = *cur;
else {
float dt = (t-(cur-1)->time)/(cur->time-(cur-1)->time);
@@ -1390,7 +1388,7 @@ static void interpolate_pathcache(ParticleCacheKey *first, float t, ParticleCach
}
/* first is actual base rotation, others are incremental from first */
- if(cur==first || cur-1==first)
+ if (cur==first || cur-1==first)
copy_qt_qt(result->rot, first->rot);
else
mul_qt_qtqt(result->rot, first->rot, result->rot);
@@ -1418,14 +1416,14 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
normal_short_to_float_v3(n2, mvert[mface->v2].no);
normal_short_to_float_v3(n3, mvert[mface->v3].no);
- if(mface->v4) {
+ if (mface->v4) {
v4= mvert[mface->v4].co;
normal_short_to_float_v3(n4, mvert[mface->v4].no);
interp_v3_v3v3v3v3(vec, v1, v2, v3, v4, w);
- if(nor) {
- if(mface->flag & ME_SMOOTH)
+ if (nor) {
+ if (mface->flag & ME_SMOOTH)
interp_v3_v3v3v3v3(nor, n1, n2, n3, n4, w);
else
normal_quad_v3(nor,v1,v2,v3,v4);
@@ -1434,8 +1432,8 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
else {
interp_v3_v3v3v3(vec, v1, v2, v3, w);
- if(nor) {
- if(mface->flag & ME_SMOOTH)
+ if (nor) {
+ if (mface->flag & ME_SMOOTH)
interp_v3_v3v3v3(nor, n1, n2, n3, w);
else
normal_tri_v3(nor,v1,v2,v3);
@@ -1443,23 +1441,23 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
}
/* calculate tangent vectors */
- if(utan && vtan) {
- if(tface) {
+ if (utan && vtan) {
+ if (tface) {
uv1= tface->uv[0];
uv2= tface->uv[1];
uv3= tface->uv[2];
uv4= tface->uv[3];
}
- else{
+ else {
uv1= tuv[0]; uv2= tuv[1]; uv3= tuv[2]; uv4= tuv[3];
map_to_sphere( uv1, uv1+1,v1[0], v1[1], v1[2]);
map_to_sphere( uv2, uv2+1,v2[0], v2[1], v2[2]);
map_to_sphere( uv3, uv3+1,v3[0], v3[1], v3[2]);
- if(v4)
+ if (v4)
map_to_sphere( uv4, uv4+1,v4[0], v4[1], v4[2]);
}
- if(v4) {
+ if (v4) {
s1= uv3[0] - uv1[0];
s2= uv4[0] - uv1[0];
@@ -1469,7 +1467,7 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
sub_v3_v3v3(e1, v3, v1);
sub_v3_v3v3(e2, v4, v1);
}
- else{
+ else {
s1= uv2[0] - uv1[0];
s2= uv3[0] - uv1[0];
@@ -1489,30 +1487,30 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
utan[2] = (t1*e2[2] - t2*e1[2]);
}
- if(orco) {
- if(orcodata) {
+ if (orco) {
+ if (orcodata) {
o1= orcodata[mface->v1];
o2= orcodata[mface->v2];
o3= orcodata[mface->v3];
- if(mface->v4) {
+ if (mface->v4) {
o4= orcodata[mface->v4];
interp_v3_v3v3v3v3(orco, o1, o2, o3, o4, w);
- if(ornor)
+ if (ornor)
normal_quad_v3( ornor,o1, o2, o3, o4);
}
else {
interp_v3_v3v3v3(orco, o1, o2, o3, w);
- if(ornor)
+ if (ornor)
normal_tri_v3( ornor,o1, o2, o3);
}
}
else {
copy_v3_v3(orco, vec);
- if(ornor && nor)
+ if (ornor && nor)
copy_v3_v3(ornor, nor);
}
}
@@ -1527,7 +1525,7 @@ void psys_interpolate_uvs(const MTFace *tface, int quad, const float w[4], float
float v31= tface->uv[2][1];
float v40,v41;
- if(quad) {
+ if (quad) {
v40= tface->uv[3][0];
v41= tface->uv[3][1];
@@ -1549,7 +1547,7 @@ void psys_interpolate_mcol(const MCol *mcol, int quad, const float w[4], MCol *m
cp2= (char *)&mcol[1];
cp3= (char *)&mcol[2];
- if(quad) {
+ if (quad) {
cp4= (char *)&mcol[3];
cp[0]= (int)(w[0]*cp1[0] + w[1]*cp2[0] + w[2]*cp3[0] + w[3]*cp4[0]);
@@ -1567,7 +1565,7 @@ void psys_interpolate_mcol(const MCol *mcol, int quad, const float w[4], MCol *m
static float psys_interpolate_value_from_verts(DerivedMesh *dm, short from, int index, const float fw[4], const float *values)
{
- if(values==0 || index==-1)
+ if (values==0 || index==-1)
return 0.0;
switch(from) {
@@ -1603,7 +1601,7 @@ static void psys_origspace_to_w(OrigSpaceFace *osface, int quad, const float w[4
psys_w_to_origspace(w, co);
co[2]= 0.0f;
- if(quad) {
+ if (quad) {
v[3][0]= osface->uv[3][0]; v[3][1]= osface->uv[3][1]; v[3][2]= 0.0f;
interp_weights_poly_v3(neww, v, 4, co);
}
@@ -1630,50 +1628,51 @@ int psys_particle_dm_face_lookup(Object *ob, DerivedMesh *dm, int index, const f
totface = dm->getNumTessFaces(dm);
- if(osface==NULL || origindex==NULL) {
- /* Assume we dont need osface data */
+ if (osface==NULL || origindex==NULL) {
+ /* Assume we don't need osface data */
if (index <totface) {
//printf("\tNO CD_ORIGSPACE, assuming not needed\n");
return index;
- } else {
+ }
+ else {
printf("\tNO CD_ORIGSPACE, error out of range\n");
return DMCACHE_NOTFOUND;
}
}
- else if(index >= me->totpoly)
+ else if (index >= me->totpoly)
return DMCACHE_NOTFOUND; /* index not in the original mesh */
psys_w_to_origspace(fw, uv);
- if(node) { /* we have a linked list of faces that we use, faster! */
- for(;node; node=node->next) {
+ if (node) { /* we have a linked list of faces that we use, faster! */
+ for (;node; node=node->next) {
findex= GET_INT_FROM_POINTER(node->link);
faceuv= osface[findex].uv;
quad = (mface[findex].totloop == 4);
/* check that this intersects - Its possible this misses :/ -
* could also check its not between */
- if(quad) {
- if(isect_point_quad_v2(uv, faceuv[0], faceuv[1], faceuv[2], faceuv[3]))
+ if (quad) {
+ if (isect_point_quad_v2(uv, faceuv[0], faceuv[1], faceuv[2], faceuv[3]))
return findex;
}
- else if(isect_point_tri_v2(uv, faceuv[0], faceuv[1], faceuv[2]))
+ else if (isect_point_tri_v2(uv, faceuv[0], faceuv[1], faceuv[2]))
return findex;
}
}
else { /* if we have no node, try every face */
- for(findex=0; findex<totface; findex++) {
- if(origindex[findex] == index) {
+ for (findex=0; findex<totface; findex++) {
+ if (origindex[findex] == index) {
faceuv= osface[findex].uv;
quad = (mface[findex].totloop == 4);
/* check that this intersects - Its possible this misses :/ -
* could also check its not between */
- if(quad) {
- if(isect_point_quad_v2(uv, faceuv[0], faceuv[1], faceuv[2], faceuv[3]))
+ if (quad) {
+ if (isect_point_quad_v2(uv, faceuv[0], faceuv[1], faceuv[2], faceuv[3]))
return findex;
}
- else if(isect_point_tri_v2(uv, faceuv[0], faceuv[1], faceuv[2]))
+ else if (isect_point_tri_v2(uv, faceuv[0], faceuv[1], faceuv[2]))
return findex;
}
}
@@ -1684,30 +1683,31 @@ int psys_particle_dm_face_lookup(Object *ob, DerivedMesh *dm, int index, const f
static int psys_map_index_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache, const float fw[4], float UNUSED(foffset), int *mapindex, float mapfw[4])
{
- if(index < 0)
+ if (index < 0)
return 0;
if (dm->deformedOnly || index_dmcache == DMCACHE_ISCHILD) {
/* for meshes that are either only defined or for child particles, the
* index and fw do not require any mapping, so we can directly use it */
- if(from == PART_FROM_VERT) {
- if(index >= dm->getNumVerts(dm))
+ if (from == PART_FROM_VERT) {
+ if (index >= dm->getNumVerts(dm))
return 0;
*mapindex = index;
}
else { /* FROM_FACE/FROM_VOLUME */
- if(index >= dm->getNumTessFaces(dm))
+ if (index >= dm->getNumTessFaces(dm))
return 0;
*mapindex = index;
copy_v4_v4(mapfw, fw);
}
- } else {
+ }
+ else {
/* for other meshes that have been modified, we try to map the particle
* to their new location, which means a different index, and for faces
* also a new face interpolation weights */
- if(from == PART_FROM_VERT) {
+ if (from == PART_FROM_VERT) {
if (index_dmcache == DMCACHE_NOTFOUND || index_dmcache > dm->getNumVerts(dm))
return 0;
@@ -1721,7 +1721,7 @@ static int psys_map_index_on_dm(DerivedMesh *dm, int from, int index, int index_
i = index_dmcache;
- if(i== DMCACHE_NOTFOUND || i >= dm->getNumTessFaces(dm))
+ if (i== DMCACHE_NOTFOUND || i >= dm->getNumTessFaces(dm))
return 0;
*mapindex = i;
@@ -1731,7 +1731,7 @@ static int psys_map_index_on_dm(DerivedMesh *dm, int from, int index, int index_
osface= dm->getTessFaceDataArray(dm, CD_ORIGSPACE);
mface= dm->getTessFaceData(dm, i, CD_MFACE);
- if(osface == NULL)
+ if (osface == NULL)
mapfw[0]= mapfw[1]= mapfw[2]= mapfw[3]= 0.0f;
else
psys_origspace_to_w(&osface[i], mface->v4, fw, mapfw);
@@ -1748,36 +1748,36 @@ void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache
float (*orcodata)[3];
int mapindex;
- if(!psys_map_index_on_dm(dm, from, index, index_dmcache, fw, foffset, &mapindex, mapfw)) {
- if(vec) { vec[0]=vec[1]=vec[2]=0.0; }
- if(nor) { nor[0]=nor[1]=0.0; nor[2]=1.0; }
- if(orco) { orco[0]=orco[1]=orco[2]=0.0; }
- if(ornor) { ornor[0]=ornor[1]=0.0; ornor[2]=1.0; }
- if(utan) { utan[0]=utan[1]=utan[2]=0.0; }
- if(vtan) { vtan[0]=vtan[1]=vtan[2]=0.0; }
+ if (!psys_map_index_on_dm(dm, from, index, index_dmcache, fw, foffset, &mapindex, mapfw)) {
+ if (vec) { vec[0]=vec[1]=vec[2]=0.0; }
+ if (nor) { nor[0]=nor[1]=0.0; nor[2]=1.0; }
+ if (orco) { orco[0]=orco[1]=orco[2]=0.0; }
+ if (ornor) { ornor[0]=ornor[1]=0.0; ornor[2]=1.0; }
+ if (utan) { utan[0]=utan[1]=utan[2]=0.0; }
+ if (vtan) { vtan[0]=vtan[1]=vtan[2]=0.0; }
return;
}
orcodata= dm->getVertDataArray(dm, CD_ORCO);
- if(from == PART_FROM_VERT) {
+ if (from == PART_FROM_VERT) {
dm->getVertCo(dm,mapindex,vec);
- if(nor) {
+ if (nor) {
dm->getVertNo(dm,mapindex,nor);
normalize_v3(nor);
}
- if(orco)
+ if (orco)
copy_v3_v3(orco, orcodata[mapindex]);
- if(ornor) {
+ if (ornor) {
dm->getVertNo(dm,mapindex,nor);
normalize_v3(nor);
}
- if(utan && vtan) {
+ if (utan && vtan) {
utan[0]= utan[1]= utan[2]= 0.0f;
vtan[0]= vtan[1]= vtan[2]= 0.0f;
}
@@ -1791,12 +1791,12 @@ void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache
mvert=dm->getVertDataArray(dm,CD_MVERT);
mtface=CustomData_get_layer(&dm->faceData,CD_MTFACE);
- if(mtface)
+ if (mtface)
mtface += mapindex;
- if(from==PART_FROM_VOLUME) {
+ if (from==PART_FROM_VOLUME) {
psys_interpolate_face(mvert,mface,mtface,orcodata,mapfw,vec,tmpnor,utan,vtan,orco,ornor);
- if(nor)
+ if (nor)
copy_v3_v3(nor,tmpnor);
normalize_v3(tmpnor);
@@ -1813,7 +1813,7 @@ float psys_particle_value_from_verts(DerivedMesh *dm, short from, ParticleData *
float mapfw[4];
int mapindex;
- if(!psys_map_index_on_dm(dm, from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, &mapindex, mapfw))
+ if (!psys_map_index_on_dm(dm, from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, &mapindex, mapfw))
return 0.0f;
return psys_interpolate_value_from_verts(dm, from, mapindex, mapfw, values);
@@ -1824,10 +1824,10 @@ ParticleSystemModifierData *psys_get_modifier(Object *ob, ParticleSystem *psys)
ModifierData *md;
ParticleSystemModifierData *psmd;
- for(md=ob->modifiers.first; md; md=md->next) {
- if(md->type==eModifierType_ParticleSystem) {
+ for (md=ob->modifiers.first; md; md=md->next) {
+ if (md->type==eModifierType_ParticleSystem) {
psmd= (ParticleSystemModifierData*) md;
- if(psmd->psys==psys) {
+ if (psmd->psys==psys) {
return psmd;
}
}
@@ -1842,22 +1842,22 @@ static void psys_particle_on_shape(int UNUSED(distr), int UNUSED(index), float *
{
/* TODO */
float zerovec[3]={0.0f,0.0f,0.0f};
- if(vec) {
+ if (vec) {
copy_v3_v3(vec,zerovec);
}
- if(nor) {
+ if (nor) {
copy_v3_v3(nor,zerovec);
}
- if(utan) {
+ if (utan) {
copy_v3_v3(utan,zerovec);
}
- if(vtan) {
+ if (vtan) {
copy_v3_v3(vtan,zerovec);
}
- if(orco) {
+ if (orco) {
copy_v3_v3(orco,zerovec);
}
- if(ornor) {
+ if (ornor) {
copy_v3_v3(ornor,zerovec);
}
}
@@ -1866,12 +1866,12 @@ static void psys_particle_on_shape(int UNUSED(distr), int UNUSED(index), float *
/************************************************/
void psys_particle_on_emitter(ParticleSystemModifierData *psmd, int from, int index, int index_dmcache, float *fuv, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor)
{
- if(psmd) {
- if(psmd->psys->part->distr==PART_DISTR_GRID && psmd->psys->part->from != PART_FROM_VERT) {
- if(vec)
+ if (psmd) {
+ if (psmd->psys->part->distr==PART_DISTR_GRID && psmd->psys->part->from != PART_FROM_VERT) {
+ if (vec)
copy_v3_v3(vec,fuv);
- if(orco)
+ if (orco)
copy_v3_v3(orco, fuv);
return;
}
@@ -1891,13 +1891,13 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
float kink[3]={1.f,0.f,0.f}, par_vec[3], q1[4]={1.f,0.f,0.f,0.f};
float t, dt=1.f, result[3];
- if(par == NULL || type == PART_KINK_NO)
+ if (par == NULL || type == PART_KINK_NO)
return;
CLAMP(time, 0.f, 1.f);
- if(shape!=0.0f && type!=PART_KINK_BRAID) {
- if(shape<0.0f)
+ if (shape!=0.0f && type!=PART_KINK_BRAID) {
+ if (shape<0.0f)
time= (float)pow(time, 1.f+shape);
else
time= (float)pow(time, 1.f/(1.f-shape));
@@ -1905,22 +1905,22 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
t = time * freq *(float)M_PI;
- if(smooth_start) {
+ if (smooth_start) {
dt = fabs(t);
/* smooth the beginning of kink */
CLAMP(dt, 0.f, (float)M_PI);
dt = sin(dt/2.f);
}
- if(type != PART_KINK_RADIAL) {
+ if (type != PART_KINK_RADIAL) {
float temp[3];
kink[axis]=1.f;
- if(obmat)
+ if (obmat)
mul_mat3_m4_v3(obmat, kink);
- if(par_rot)
+ if (par_rot)
mul_qt_v3(par_rot, kink);
/* make sure kink is normal to strand */
@@ -1937,7 +1937,7 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
{
negate_v3(par_vec);
- if(flat > 0.f) {
+ if (flat > 0.f) {
float proj[3];
project_v3_v3v3(proj, par_vec, par->vel);
madd_v3_v3fl(par_vec, proj, -flat);
@@ -1953,7 +1953,7 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
madd_v3_v3fl(par_vec, kink, amplitude);
/* rotate kink vector around strand tangent */
- if(t!=0.f) {
+ if (t!=0.f) {
axis_angle_to_quat(q1, par->vel, t);
mul_qt_v3(q1, par_vec);
}
@@ -1963,7 +1963,7 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
}
case PART_KINK_RADIAL:
{
- if(flat > 0.f) {
+ if (flat > 0.f) {
float proj[3];
/* flatten along strand */
project_v3_v3v3(proj, par_vec, par->vel);
@@ -1977,7 +1977,7 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
{
madd_v3_v3fl(result, kink, amplitude*(float)sin(t));
- if(flat > 0.f) {
+ if (flat > 0.f) {
float proj[3];
/* flatten along wave */
project_v3_v3v3(proj, par_vec, kink);
@@ -1996,7 +1996,7 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
float vec_one[3], state_co[3];
float inp_y, inp_z, length;
- if(par_rot) {
+ if (par_rot) {
mul_qt_v3(par_rot, y_vec);
mul_qt_v3(par_rot, z_vec);
}
@@ -2007,20 +2007,20 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
inp_y=dot_v3v3(y_vec, vec_one);
inp_z=dot_v3v3(z_vec, vec_one);
- if(inp_y > 0.5f) {
+ if (inp_y > 0.5f) {
copy_v3_v3(state_co, y_vec);
mul_v3_fl(y_vec, amplitude*(float)cos(t));
mul_v3_fl(z_vec, amplitude/2.f*(float)sin(2.f*t));
}
- else if(inp_z > 0.0f) {
+ else if (inp_z > 0.0f) {
mul_v3_v3fl(state_co, z_vec, (float)sin((float)M_PI/3.f));
madd_v3_v3fl(state_co, y_vec, -0.5f);
mul_v3_fl(y_vec, -amplitude * (float)cos(t + (float)M_PI/3.f));
mul_v3_fl(z_vec, amplitude/2.f * (float)cos(2.f*t + (float)M_PI/6.f));
}
- else{
+ else {
mul_v3_v3fl(state_co, z_vec, -(float)sin((float)M_PI/3.f));
madd_v3_v3fl(state_co, y_vec, -0.5f);
@@ -2041,12 +2041,12 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
shape = 2.f*(float)M_PI * (1.f+shape);
- if(t<shape) {
+ if (t<shape) {
shape = t/shape;
shape = (float)sqrt((double)shape);
interp_v3_v3v3(result, result, state_co, shape);
}
- else{
+ else {
copy_v3_v3(result, state_co);
}
break;
@@ -2054,7 +2054,7 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
}
/* blend the start of the kink */
- if(dt < 1.f)
+ if (dt < 1.f)
interp_v3_v3v3(state->co, state->co, result, dt);
else
copy_v3_v3(state->co, result);
@@ -2064,15 +2064,15 @@ static float do_clump(ParticleKey *state, ParticleKey *par, float time, float cl
{
float clump = 0.f;
- if(par && clumpfac!=0.0f) {
+ if (par && clumpfac!=0.0f) {
float cpow;
- if(clumppow < 0.0f)
+ if (clumppow < 0.0f)
cpow=1.0f+clumppow;
else
cpow=1.0f+9.0f*clumppow;
- if(clumpfac < 0.0f) /* clump roots instead of tips */
+ if (clumpfac < 0.0f) /* clump roots instead of tips */
clump = -clumpfac*pa_clump*(float)pow(1.0-(double)time,(double)cpow);
else
clump = clumpfac*pa_clump*(float)pow((double)time,(double)cpow);
@@ -2093,7 +2093,7 @@ void precalc_guides(ParticleSimulationData *sim, ListBase *effectors)
GuideEffectorData *data;
PARTICLE_P;
- if(!effectors)
+ if (!effectors)
return;
LOOP_PARTICLES {
@@ -2104,11 +2104,11 @@ void precalc_guides(ParticleSimulationData *sim, ListBase *effectors)
pd_point_from_particle(sim, pa, &state, &point);
- for(eff = effectors->first; eff; eff=eff->next) {
- if(eff->pd->forcefield != PFIELD_GUIDE)
+ for (eff = effectors->first; eff; eff=eff->next) {
+ if (eff->pd->forcefield != PFIELD_GUIDE)
continue;
- if(!eff->guide_data)
+ if (!eff->guide_data)
eff->guide_data = MEM_callocN(sizeof(GuideEffectorData)*psys->totpart, "GuideEffectorData");
data = eff->guide_data + p;
@@ -2135,30 +2135,30 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
float guidetime, radius, weight, angle, totstrength = 0.0f;
float vec_to_point[3];
- if(effectors) for(eff = effectors->first; eff; eff=eff->next) {
+ if (effectors) for (eff = effectors->first; eff; eff=eff->next) {
pd = eff->pd;
- if(pd->forcefield != PFIELD_GUIDE)
+ if (pd->forcefield != PFIELD_GUIDE)
continue;
data = eff->guide_data + index;
- if(data->strength <= 0.0f)
+ if (data->strength <= 0.0f)
continue;
guidetime = time / (1.0f - pd->free_end);
- if(guidetime>1.0f)
+ if (guidetime>1.0f)
continue;
cu = (Curve*)eff->ob->data;
- if(pd->flag & PFIELD_GUIDE_PATH_ADD) {
- if(where_on_path(eff->ob, data->strength * guidetime, guidevec, guidedir, NULL, &radius, &weight)==0)
+ if (pd->flag & PFIELD_GUIDE_PATH_ADD) {
+ if (where_on_path(eff->ob, data->strength * guidetime, guidevec, guidedir, NULL, &radius, &weight)==0)
return 0;
}
else {
- if(where_on_path(eff->ob, guidetime, guidevec, guidedir, NULL, &radius, &weight)==0)
+ if (where_on_path(eff->ob, guidetime, guidevec, guidedir, NULL, &radius, &weight)==0)
return 0;
}
@@ -2169,7 +2169,7 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
copy_v3_v3(vec_to_point, data->vec_to_point);
- if(guidetime != 0.0f) {
+ if (guidetime != 0.0f) {
/* curve direction */
cross_v3_v3v3(temp, eff->guide_dir, guidedir);
angle = dot_v3v3(eff->guide_dir, guidedir)/(len_v3(eff->guide_dir));
@@ -2183,11 +2183,11 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
}
/* curve taper */
- if(cu->taperobj)
+ if (cu->taperobj)
mul_v3_fl(vec_to_point, calc_taper(eff->scene, cu->taperobj, (int)(data->strength*guidetime*100.0f), 100));
- else{ /* curve size*/
- if(cu->flag & CU_PATH_RADIUS) {
+ else { /* curve size*/
+ if (cu->flag & CU_PATH_RADIUS) {
mul_v3_fl(vec_to_point, radius);
}
}
@@ -2204,12 +2204,12 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
madd_v3_v3fl(veffect, guidedir, data->strength);
totstrength += data->strength;
- if(pd->flag & PFIELD_GUIDE_PATH_WEIGHT)
+ if (pd->flag & PFIELD_GUIDE_PATH_WEIGHT)
totstrength *= weight;
}
- if(totstrength != 0.0f) {
- if(totstrength > 1.0f)
+ if (totstrength != 0.0f) {
+ if (totstrength > 1.0f)
mul_v3_fl(effect, 1.0f / totstrength);
CLAMP(totstrength, 0.0f, 1.0f);
//add_v3_v3(effect,pa_zero);
@@ -2227,8 +2227,8 @@ static void do_rough(float *loc, float mat[4][4], float t, float fac, float size
float rough[3];
float rco[3];
- if(thres != 0.0f)
- if((float)fabs((float)(-1.5f+loc[0]+loc[1]+loc[2]))<1.5f*thres) return;
+ if (thres != 0.0f)
+ if ((float)fabs((float)(-1.5f+loc[0]+loc[1]+loc[2]))<1.5f*thres) return;
copy_v3_v3(rco,loc);
mul_v3_fl(rco,t);
@@ -2261,7 +2261,7 @@ static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheK
EffectedPoint epoint;
/* Don't apply effectors for dynamic hair, otherwise the effectors don't get applied twice. */
- if(sim->psys->flag & PSYS_HAIR_DYNAMICS)
+ if (sim->psys->flag & PSYS_HAIR_DYNAMICS)
return;
copy_v3_v3(eff_key.co,(ca-1)->co);
@@ -2277,17 +2277,17 @@ static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheK
normalize_v3(force);
- if(k < steps)
+ if (k < steps)
sub_v3_v3v3(vec, (ca+1)->co, ca->co);
madd_v3_v3v3fl(ca->co, (ca-1)->co, force, *length);
- if(k < steps)
+ if (k < steps)
*length = len_v3(vec);
}
static int check_path_length(int k, ParticleCacheKey *keys, ParticleCacheKey *state, float max_length, float *cur_length, float length, float *dvec)
{
- if(*cur_length + length > max_length) {
+ if (*cur_length + length > max_length) {
mul_v3_fl(dvec, (max_length - *cur_length) / length);
add_v3_v3v3(state->co, (state - 1)->co, dvec);
keys->steps = k;
@@ -2308,7 +2308,7 @@ static void offset_child(ChildParticle *cpa, ParticleKey *par, float *par_rot, P
copy_v3_v3(child->vel, par->vel);
- if(par_rot) {
+ if (par_rot) {
mul_qt_v3(par_rot, child->co);
copy_qt_qt(child->rot, par_rot);
}
@@ -2321,21 +2321,21 @@ float *psys_cache_vgroup(DerivedMesh *dm, ParticleSystem *psys, int vgroup)
{
float *vg=0;
- if(vgroup < 0) {
+ if (vgroup < 0) {
/* hair dynamics pinning vgroup */
}
- else if(psys->vgroup[vgroup]) {
+ else if (psys->vgroup[vgroup]) {
MDeformVert *dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
- if(dvert) {
+ if (dvert) {
int totvert=dm->getNumVerts(dm), i;
vg=MEM_callocN(sizeof(float)*totvert, "vg_cache");
- if(psys->vg_neg&(1<<vgroup)) {
- for(i=0; i<totvert; i++)
+ if (psys->vg_neg&(1<<vgroup)) {
+ for (i=0; i<totvert; i++)
vg[i]= 1.0f - defvert_find_weight(&dvert[i], psys->vgroup[vgroup] - 1);
}
- else{
- for(i=0; i<totvert; i++)
+ else {
+ for (i=0; i<totvert; i++)
vg[i]= defvert_find_weight(&dvert[i], psys->vgroup[vgroup] - 1);
}
}
@@ -2352,19 +2352,19 @@ void psys_find_parents(ParticleSimulationData *sim)
int from=PART_FROM_FACE;
totparent=(int)(totchild*part->parents*0.3f);
- if(G.rendering && part->child_nbr && part->ren_child_nbr)
+ if (G.rendering && part->child_nbr && part->ren_child_nbr)
totparent*=(float)part->child_nbr/(float)part->ren_child_nbr;
tree=BLI_kdtree_new(totparent);
- for(p=0,cpa=sim->psys->child; p<totparent; p++,cpa++) {
+ for (p=0,cpa=sim->psys->child; p<totparent; p++,cpa++) {
psys_particle_on_emitter(sim->psmd,from,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,co,0,0,0,orco,0);
BLI_kdtree_insert(tree, p, orco, NULL);
}
BLI_kdtree_balance(tree);
- for(; p<totchild; p++,cpa++) {
+ for (; p<totchild; p++,cpa++) {
psys_particle_on_emitter(sim->psmd,from,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,co,0,0,0,orco,0);
cpa->parent=BLI_kdtree_find_nearest(tree, orco, NULL, NULL);
}
@@ -2372,18 +2372,18 @@ 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;
- if(!((ma->mode & MA_STR_SURFDIFF) || (ma->strand_surfnor > 0.0f)))
+ if (!((ma->mode & MA_STR_SURFDIFF) || (ma->strand_surfnor > 0.0f)))
return;
- if(ma->mode & MA_STR_SURFDIFF) {
+ if (ma->mode & MA_STR_SURFDIFF) {
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);
@@ -2393,8 +2393,8 @@ static void get_strand_normal(Material *ma, float *surfnor, float surfdist, floa
copy_v3_v3(vnor, nor);
}
- if(ma->strand_surfnor > 0.0f) {
- if(ma->strand_surfnor > surfdist) {
+ if (ma->strand_surfnor > 0.0f) {
+ if (ma->strand_surfnor > surfdist) {
blend= (ma->strand_surfnor - surfdist)/ma->strand_surfnor;
interp_v3_v3v3(vnor, vnor, surfnor, blend);
normalize_v3(vnor);
@@ -2417,41 +2417,41 @@ static int psys_threads_init_path(ParticleThread *threads, Scene *scene, float c
int i, seed, totthread= threads[0].tot;
/*---start figuring out what is actually wanted---*/
- if(psys_in_edit_mode(scene, psys)) {
+ if (psys_in_edit_mode(scene, psys)) {
ParticleEditSettings *pset = &scene->toolsettings->particle;
- if(psys->renderdata==0 && (psys->edit==NULL || pset->flag & PE_DRAW_PART)==0)
+ if (psys->renderdata==0 && (psys->edit==NULL || pset->flag & PE_DRAW_PART)==0)
totchild=0;
steps = (int)pow(2.0, (double)pset->draw_step);
}
- if(totchild && part->childtype==PART_CHILD_FACES) {
+ if (totchild && part->childtype==PART_CHILD_FACES) {
totparent=(int)(totchild*part->parents*0.3f);
- if(G.rendering && part->child_nbr && part->ren_child_nbr)
+ if (G.rendering && part->child_nbr && part->ren_child_nbr)
totparent*=(float)part->child_nbr/(float)part->ren_child_nbr;
/* part->parents could still be 0 so we can't test with totparent */
between=1;
}
- if(psys->renderdata)
+ if (psys->renderdata)
steps=(int)pow(2.0,(double)part->ren_step);
- else{
+ else {
totchild=(int)((float)totchild*(float)part->disp/100.0f);
totparent=MIN2(totparent,totchild);
}
- if(totchild==0) return 0;
+ if (totchild==0) return 0;
/* init random number generator */
seed= 31415926 + ctx->sim.psys->seed;
- if(ctx->editupdate || totchild < 10000)
+ if (ctx->editupdate || totchild < 10000)
totthread= 1;
- for(i=0; i<totthread; i++) {
+ for (i=0; i<totthread; i++) {
threads[i].rng_path= rng_new(seed);
threads[i].tot= totthread;
}
@@ -2474,12 +2474,12 @@ static int psys_threads_init_path(ParticleThread *threads, Scene *scene, float c
ctx->vg_rough1 = psys_cache_vgroup(ctx->dm,psys,PSYS_VG_ROUGH1);
ctx->vg_rough2 = psys_cache_vgroup(ctx->dm,psys,PSYS_VG_ROUGH2);
ctx->vg_roughe = psys_cache_vgroup(ctx->dm,psys,PSYS_VG_ROUGHE);
- if(psys->part->flag & PART_CHILD_EFFECT)
+ if (psys->part->flag & PART_CHILD_EFFECT)
ctx->vg_effector = psys_cache_vgroup(ctx->dm,psys,PSYS_VG_EFFECTOR);
/* set correct ipo timing */
#if 0 // XXX old animation system
- if(part->flag&PART_ABS_TIME && part->ipo) {
+ if (part->flag&PART_ABS_TIME && part->ipo) {
calc_ipo(part->ipo, cfra);
execute_ipo((ID *)part, part->ipo);
}
@@ -2506,10 +2506,10 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
int k, cpa_num;
short cpa_from;
- if(!pcache)
+ if (!pcache)
return;
- if(ctx->between) {
+ if (ctx->between) {
ParticleData *pa = psys->particles + cpa->pa[0];
int w, needupdate;
float foffset, wsum=0.f;
@@ -2519,26 +2519,26 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
/* Virtual parents don't work nicely with parting. */
float p_fac = part->parents > 0.f ? 0.f : part->parting_fac;
- if(ctx->editupdate) {
+ if (ctx->editupdate) {
needupdate= 0;
w= 0;
- while(w<4 && cpa->pa[w]>=0) {
- if(psys->edit->points[cpa->pa[w]].flag & PEP_EDIT_RECALC) {
+ while (w<4 && cpa->pa[w]>=0) {
+ if (psys->edit->points[cpa->pa[w]].flag & PEP_EDIT_RECALC) {
needupdate= 1;
break;
}
w++;
}
- if(!needupdate)
+ if (!needupdate)
return;
else
memset(child_keys, 0, sizeof(*child_keys)*(ctx->steps+1));
}
/* get parent paths */
- for(w=0; w<4; w++) {
- if(cpa->pa[w] >= 0) {
+ for (w=0; w<4; w++) {
+ if (cpa->pa[w] >= 0) {
key[w] = pcache[cpa->pa[w]];
weight[w] = cpa->w[w];
}
@@ -2549,11 +2549,11 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
}
/* modify weights to create parting */
- if(p_fac > 0.f) {
- for(w=0; w<4; w++) {
- if(w && weight[w] > 0.f) {
+ if (p_fac > 0.f) {
+ for (w=0; w<4; w++) {
+ if (w && weight[w] > 0.f) {
float d;
- if(part->flag & PART_CHILD_LONG_HAIR) {
+ if (part->flag & PART_CHILD_LONG_HAIR) {
/* For long hair use tip distance/root distance as parting factor instead of root to tip angle. */
float d1 = len_v3v3(key[0]->co, key[w]->co);
float d2 = len_v3v3((key[0]+key[0]->steps-1)->co, (key[w]+key[w]->steps-1)->co);
@@ -2570,19 +2570,19 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
d = RAD2DEGF(saacos(dot_v3v3(v1, v2)));
}
- if(p_max > p_min)
+ if (p_max > p_min)
d = (d - p_min)/(p_max - p_min);
else
d = (d - p_min) <= 0.f ? 0.f : 1.f;
CLAMP(d, 0.f, 1.f);
- if(d > 0.f)
+ if (d > 0.f)
weight[w] *= (1.f - d);
}
wsum += weight[w];
}
- for(w=0; w<4; w++)
+ for (w=0; w<4; w++)
weight[w] /= wsum;
interp_v4_v4v4(weight, cpa->w, weight, p_fac);
@@ -2599,16 +2599,16 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
mul_m4_v3(ob->obmat, co);
- for(w=0; w<4; w++)
+ for (w=0; w<4; w++)
sub_v3_v3v3(off1[w], co, key[w]->co);
psys_mat_hair_to_global(ob, ctx->sim.psmd->dm, psys->part->from, pa, hairmat);
}
- else{
+ else {
ParticleData *pa = psys->particles + cpa->parent;
float co[3];
- if(ctx->editupdate) {
- if(!(psys->edit->points[cpa->parent].flag & PEP_EDIT_RECALC))
+ if (ctx->editupdate) {
+ if (!(psys->edit->points[cpa->parent].flag & PEP_EDIT_RECALC))
return;
memset(child_keys, 0, sizeof(*child_keys)*(ctx->steps+1));
@@ -2632,26 +2632,26 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
/* get different child parameters from textures & vgroups */
get_child_modifier_parameters(part, ctx, cpa, cpa_from, cpa_num, cpa_fuv, orco, &ptex);
- if(ptex.exist < PSYS_FRAND(i + 24)) {
+ if (ptex.exist < PSYS_FRAND(i + 24)) {
child_keys->steps = -1;
return;
}
/* create the child path */
- for(k=0,child=child_keys; k<=ctx->steps; k++,child++) {
- if(ctx->between) {
+ for (k=0,child=child_keys; k<=ctx->steps; k++,child++) {
+ if (ctx->between) {
int w=0;
zero_v3(child->co);
zero_v3(child->vel);
unit_qt(child->rot);
- for(w=0; w<4; w++) {
+ for (w=0; w<4; w++) {
copy_v3_v3(off2[w], off1[w]);
- if(part->flag & PART_CHILD_LONG_HAIR) {
+ if (part->flag & PART_CHILD_LONG_HAIR) {
/* Use parent rotation (in addition to emission location) to determine child offset. */
- if(k)
+ if (k)
mul_qt_v3((key[w]+k)->rot, off2[w]);
/* Fade the effect of rotation for even lengths in the end */
@@ -2668,8 +2668,8 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
copy_qt_qt(child->rot, (key[0]+k)->rot);
}
- else{
- if(k) {
+ else {
+ if (k) {
mul_qt_qtqt(rot, (key[0]+k)->rot, key[0]->rot);
par_rot = rot;
}
@@ -2684,9 +2684,9 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
}
/* apply effectors */
- if(part->flag & PART_CHILD_EFFECT) {
- for(k=0,child=child_keys; k<=ctx->steps; k++,child++) {
- if(k) {
+ if (part->flag & PART_CHILD_EFFECT) {
+ for (k=0,child=child_keys; k<=ctx->steps; k++,child++) {
+ if (k) {
do_path_effectors(&ctx->sim, cpa->pa[0], child, k, ctx->steps, child_keys->co, ptex.effector, 0.0f, ctx->cfra, &eff_length, eff_vec);
}
else {
@@ -2696,17 +2696,17 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
}
}
- for(k=0,child=child_keys; k<=ctx->steps; k++,child++) {
+ for (k=0,child=child_keys; k<=ctx->steps; k++,child++) {
t = (float)k/(float)ctx->steps;
- if(ctx->totparent)
+ if (ctx->totparent)
/* this is now threadsafe, virtual parents are calculated before rest of children */
par = (i >= ctx->totparent) ? cache[cpa->parent] : NULL;
- else if(cpa->parent >= 0)
+ else if (cpa->parent >= 0)
par = pcache[cpa->parent];
- if(par) {
- if(k) {
+ if (par) {
+ if (k) {
mul_qt_qtqt(rot, (par+k)->rot, par->rot);
par_rot = rot;
}
@@ -2720,37 +2720,37 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
do_child_modifiers(&ctx->sim, &ptex, (ParticleKey *)par, par_rot, cpa, orco, hairmat, (ParticleKey *)child, t);
/* we have to correct velocity because of kink & clump */
- if(k>1) {
+ if (k>1) {
sub_v3_v3v3((child-1)->vel, child->co, (child-2)->co);
mul_v3_fl((child-1)->vel, 0.5);
- if(ctx->ma && (part->draw_col == PART_DRAW_COL_MAT))
+ if (ctx->ma && (part->draw_col == PART_DRAW_COL_MAT))
get_strand_normal(ctx->ma, ornor, cur_length, (child-1)->vel);
}
- if(k == ctx->steps)
+ if (k == ctx->steps)
sub_v3_v3v3(child->vel, child->co, (child-1)->co);
/* check if path needs to be cut before actual end of data points */
- if(k) {
+ if (k) {
sub_v3_v3v3(dvec, child->co, (child-1)->co);
length = 1.0f/(float)ctx->steps;
k = check_path_length(k, child_keys, child, max_length, &cur_length, length, dvec);
}
- else{
+ else {
/* initialize length calculation */
max_length = ptex.length;
cur_length = 0.0f;
}
- if(ctx->ma && (part->draw_col == PART_DRAW_COL_MAT)) {
+ if (ctx->ma && (part->draw_col == PART_DRAW_COL_MAT)) {
copy_v3_v3(child->col, &ctx->ma->r);
get_strand_normal(ctx->ma, ornor, cur_length, child->vel);
}
}
/* Hide virtual parents */
- if(i < ctx->totparent)
+ if (i < ctx->totparent)
child_keys->steps = -1;
}
@@ -2763,13 +2763,13 @@ static void *exec_child_path_cache(void *data)
ChildParticle *cpa;
int i, totchild= ctx->totchild, first= 0;
- if(thread->tot > 1) {
+ if (thread->tot > 1) {
first= ctx->parent_pass? 0 : ctx->totparent;
totchild= ctx->parent_pass? ctx->totparent : ctx->totchild;
}
cpa= psys->child + first + thread->num;
- for(i=first+thread->num; i<totchild; i+=thread->tot, cpa+=thread->tot)
+ for (i=first+thread->num; i<totchild; i+=thread->tot, cpa+=thread->tot)
psys_thread_create_path(thread, cpa, cache[i], i);
return 0;
@@ -2782,12 +2782,12 @@ void psys_cache_child_paths(ParticleSimulationData *sim, float cfra, int editupd
ListBase threads;
int i, totchild, totparent, totthread;
- if(sim->psys->flag & PSYS_GLOBAL_HAIR)
+ if (sim->psys->flag & PSYS_GLOBAL_HAIR)
return;
pthreads= psys_threads_create(sim);
- if(!psys_threads_init_path(pthreads, sim->scene, cfra, editupdate)) {
+ if (!psys_threads_init_path(pthreads, sim->scene, cfra, editupdate)) {
psys_threads_free(pthreads);
return;
}
@@ -2796,7 +2796,7 @@ void psys_cache_child_paths(ParticleSimulationData *sim, float cfra, int editupd
totchild= ctx->totchild;
totparent= ctx->totparent;
- if(editupdate && sim->psys->childcache && totchild == sim->psys->totchildcache) {
+ if (editupdate && sim->psys->childcache && totchild == sim->psys->totchildcache) {
; /* just overwrite the existing cache */
}
else {
@@ -2808,26 +2808,26 @@ void psys_cache_child_paths(ParticleSimulationData *sim, float cfra, int editupd
totthread= pthreads[0].tot;
- if(totthread > 1) {
+ if (totthread > 1) {
/* make virtual child parents thread safe by calculating them first */
- if(totparent) {
+ if (totparent) {
BLI_init_threads(&threads, exec_child_path_cache, totthread);
- for(i=0; i<totthread; i++) {
+ for (i=0; i<totthread; i++) {
pthreads[i].ctx->parent_pass = 1;
BLI_insert_thread(&threads, &pthreads[i]);
}
BLI_end_threads(&threads);
- for(i=0; i<totthread; i++)
+ for (i=0; i<totthread; i++)
pthreads[i].ctx->parent_pass = 0;
}
BLI_init_threads(&threads, exec_child_path_cache, totthread);
- for(i=0; i<totthread; i++)
+ for (i=0; i<totthread; i++)
BLI_insert_thread(&threads, &pthreads[i]);
BLI_end_threads(&threads);
@@ -2859,9 +2859,9 @@ 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 */
- if(cosangle > 0.999999f) {
+ * angle, since floating point accuracy makes it give
+ * different results across platforms */
+ if (cosangle > 0.999999f) {
copy_v4_v4(key1->rot, key2->rot);
}
else {
@@ -2874,10 +2874,12 @@ static void cache_key_incremental_rotation(ParticleCacheKey *key0, ParticleCache
copy_v3_v3(prev_tangent, tangent);
}
}
-/* Calculates paths ready for drawing/rendering. */
-/* -Usefull for making use of opengl vertex arrays for super fast strand drawing. */
-/* -Makes child strands possible and creates them too into the cache. */
-/* -Cached path data is also used to determine cut position for the editmode tool. */
+
+/**
+ * Calculates paths ready for drawing/rendering
+ * - Useful for making use of opengl vertex arrays for super fast strand drawing.
+ * - Makes child strands possible and creates them too into the cache.
+ * - Cached path data is also used to determine cut position for the editmode tool. */
void psys_cache_paths(ParticleSimulationData *sim, float cfra)
{
PARTICLE_PSMD;
@@ -2910,11 +2912,11 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
int keyed, baked;
/* we don't have anything valid to create paths from so let's quit here */
- if((psys->flag & PSYS_HAIR_DONE || psys->flag & PSYS_KEYED || psys->pointcache)==0)
+ if ((psys->flag & PSYS_HAIR_DONE || psys->flag & PSYS_KEYED || psys->pointcache)==0)
return;
- if(psys_in_edit_mode(sim->scene, psys))
- if(psys->renderdata==0 && (psys->edit==NULL || pset->flag & PE_DRAW_PART)==0)
+ if (psys_in_edit_mode(sim->scene, psys))
+ if (psys->renderdata==0 && (psys->edit==NULL || pset->flag & PE_DRAW_PART)==0)
return;
keyed = psys->flag & PSYS_KEYED;
@@ -2926,14 +2928,14 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
psys->lattice = psys_get_lattice(sim);
ma= give_current_material(sim->ob, psys->part->omat);
- if(ma && (psys->part->draw_col == PART_DRAW_COL_MAT))
+ if (ma && (psys->part->draw_col == PART_DRAW_COL_MAT))
copy_v3_v3(col, &ma->r);
- if((psys->flag & PSYS_GLOBAL_HAIR)==0) {
- if((psys->part->flag & PART_CHILD_EFFECT)==0)
+ if ((psys->flag & PSYS_GLOBAL_HAIR)==0) {
+ if ((psys->part->flag & PART_CHILD_EFFECT)==0)
vg_effector = psys_cache_vgroup(psmd->dm, psys, PSYS_VG_EFFECTOR);
- if(!psys->totchild)
+ if (!psys->totchild)
vg_length = psys_cache_vgroup(psmd->dm, psys, PSYS_VG_LENGTH);
}
@@ -2944,10 +2946,10 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
/*---first main loop: create all actual particles' paths---*/
LOOP_SHOWN_PARTICLES {
- if(!psys->totchild) {
+ if (!psys->totchild) {
psys_get_texture(sim, pa, &ptex, PAMAP_LENGTH, 0.f);
pa_length = ptex.length * (1.0f - part->randlength * PSYS_FRAND(psys->seed + p));
- if(vg_length)
+ if (vg_length)
pa_length *= psys_particle_value_from_verts(psmd->dm,part->from,pa,vg_length);
}
@@ -2970,7 +2972,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
copy_v3_v3(rotmat[1], hairmat[1]);
copy_v3_v3(rotmat[2], hairmat[0]);
- if(part->draw & PART_ABS_PATH_TIME) {
+ if (part->draw & PART_ABS_PATH_TIME) {
birthtime = MAX2(pind.birthtime, part->path_start);
dietime = MIN2(pind.dietime, part->path_end);
}
@@ -2980,7 +2982,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
dietime = tb + part->path_end * (pind.dietime - tb);
}
- if(birthtime >= dietime) {
+ if (birthtime >= dietime) {
cache[p]->steps = -1;
continue;
}
@@ -2988,7 +2990,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
dietime = birthtime + pa_length * (dietime - birthtime);
/*--interpolate actual path from data points--*/
- for(k=0, ca=cache[p]; k<=steps; k++, ca++) {
+ for (k=0, ca=cache[p]; k<=steps; k++, ca++) {
time = (float)k / (float)steps;
t = birthtime + time * (dietime - birthtime);
result.time = -t;
@@ -2997,9 +2999,9 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
/* dynamic hair is in object space */
/* keyed and baked are already in global space */
- if(hair_dm)
+ if (hair_dm)
mul_m4_v3(sim->ob->obmat, ca->co);
- else if(!keyed && !baked && !(psys->flag & PSYS_GLOBAL_HAIR))
+ else if (!keyed && !baked && !(psys->flag & PSYS_GLOBAL_HAIR))
mul_m4_v3(hairmat, ca->co);
copy_v3_v3(ca->col, col);
@@ -3007,45 +3009,45 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
/*--modify paths and calculate rotation & velocity--*/
- if(!(psys->flag & PSYS_GLOBAL_HAIR)) {
+ if (!(psys->flag & PSYS_GLOBAL_HAIR)) {
/* apply effectors */
- if((psys->part->flag & PART_CHILD_EFFECT) == 0) {
+ if ((psys->part->flag & PART_CHILD_EFFECT) == 0) {
float effector= 1.0f;
- if(vg_effector)
+ if (vg_effector)
effector*= psys_particle_value_from_verts(psmd->dm,psys->part->from,pa,vg_effector);
sub_v3_v3v3(vec,(cache[p]+1)->co,cache[p]->co);
length = len_v3(vec);
- for(k=1, ca=cache[p]+1; k<=steps; k++, ca++)
+ for (k=1, ca=cache[p]+1; k<=steps; k++, ca++)
do_path_effectors(sim, p, ca, k, steps, cache[p]->co, effector, dfra, cfra, &length, vec);
}
/* apply guide curves to path data */
- if(sim->psys->effectors && (psys->part->flag & PART_CHILD_EFFECT)==0) {
- for(k=0, ca=cache[p]; k<=steps; k++, ca++)
+ if (sim->psys->effectors && (psys->part->flag & PART_CHILD_EFFECT)==0) {
+ for (k=0, ca=cache[p]; k<=steps; k++, ca++)
/* ca is safe to cast, since only co and vel are used */
do_guides(sim->psys->effectors, (ParticleKey*)ca, p, (float)k/(float)steps);
}
/* lattices have to be calculated separately to avoid mixups between effector calculations */
- if(psys->lattice) {
- for(k=0, ca=cache[p]; k<=steps; k++, ca++)
+ if (psys->lattice) {
+ for (k=0, ca=cache[p]; k<=steps; k++, ca++)
calc_latt_deform(psys->lattice, ca->co, 1.0f);
}
}
/* finally do rotation & velocity */
- for(k=1, ca=cache[p]+1; k<=steps; k++, ca++) {
+ for (k=1, ca=cache[p]+1; k<=steps; k++, ca++) {
cache_key_incremental_rotation(ca, ca - 1, ca - 2, prev_tangent, k);
- if(k == steps)
+ if (k == steps)
copy_qt_qt(ca->rot, (ca - 1)->rot);
/* set velocity */
sub_v3_v3v3(ca->vel, ca->co, (ca-1)->co);
- if(k==1)
+ if (k==1)
copy_v3_v3((ca-1)->vel, ca->vel);
ca->time = (float)k/(float)steps;
@@ -3062,15 +3064,15 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
psys->totcached = totpart;
- if(psys->lattice) {
+ if (psys->lattice) {
end_latt_deform(psys->lattice);
psys->lattice= NULL;
}
- if(vg_effector)
+ if (vg_effector)
MEM_freeN(vg_effector);
- if(vg_length)
+ if (vg_length)
MEM_freeN(vg_length);
}
void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cfra)
@@ -3099,23 +3101,23 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
steps = MAX2(steps, 4);
- if(!cache || edit->totpoint != edit->totcached) {
+ if (!cache || edit->totpoint != edit->totcached) {
/* clear out old and create new empty path cache */
psys_free_path_cache(edit->psys, edit);
cache= edit->pathcache= psys_alloc_path_cache_buffers(&edit->pathcachebufs, totpart, steps+1);
/* set flag for update (child particles check this too) */
- for(i=0, point=edit->points; i<totpart; i++, point++)
+ for (i=0, point=edit->points; i<totpart; i++, point++)
point->flag |= PEP_EDIT_RECALC;
recalc_set = 1;
}
/* frs_sec = (psys || edit->pid.flag & PTCACHE_VEL_PER_SEC) ? 25.0f : 1.0f; */ /* UNUSED */
- if(pset->brushtype == PE_BRUSH_WEIGHT) {
+ if (pset->brushtype == PE_BRUSH_WEIGHT) {
;/* use weight painting colors now... */
}
- else{
+ else {
sel_col[0] = (float)edit->sel_col[0] / 255.0f;
sel_col[1] = (float)edit->sel_col[1] / 255.0f;
sel_col[2] = (float)edit->sel_col[2] / 255.0f;
@@ -3125,11 +3127,11 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
}
/*---first main loop: create all actual particles' paths---*/
- for(i=0, point=edit->points; i<totpart; i++, pa+=pa?1:0, point++) {
- if(edit->totcached && !(point->flag & PEP_EDIT_RECALC))
+ for (i=0, point=edit->points; i<totpart; i++, pa+=pa?1:0, point++) {
+ if (edit->totcached && !(point->flag & PEP_EDIT_RECALC))
continue;
- if(point->totkey == 0)
+ if (point->totkey == 0)
continue;
ekey = point->keys;
@@ -3142,7 +3144,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
/* should init_particle_interpolation set this ? */
- if(pset->brushtype==PE_BRUSH_WEIGHT) {
+ if (pset->brushtype==PE_BRUSH_WEIGHT) {
pind.hkey[0] = NULL;
/* pa != NULL since the weight brush is only available for hair */
pind.hkey[1] = pa->hair;
@@ -3156,7 +3158,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
/*--get the first data points--*/
init_particle_interpolation(ob, psys, pa, &pind);
- if(psys) {
+ if (psys) {
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
copy_v3_v3(rotmat[0], hairmat[2]);
copy_v3_v3(rotmat[1], hairmat[1]);
@@ -3166,13 +3168,13 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
birthtime = pind.birthtime;
dietime = pind.dietime;
- if(birthtime >= dietime) {
+ if (birthtime >= dietime) {
cache[i]->steps = -1;
continue;
}
/*--interpolate actual path from data points--*/
- for(k=0, ca=cache[i]; k<=steps; k++, ca++) {
+ for (k=0, ca=cache[i]; k<=steps; k++, ca++) {
time = (float)k / (float)steps;
t = birthtime + time * (dietime - birthtime);
result.time = -t;
@@ -3180,19 +3182,19 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
copy_v3_v3(ca->co, result.co);
/* non-hair points are already in global space */
- if(psys && !(psys->flag & PSYS_GLOBAL_HAIR)) {
+ if (psys && !(psys->flag & PSYS_GLOBAL_HAIR)) {
mul_m4_v3(hairmat, ca->co);
- if(k) {
+ if (k) {
cache_key_incremental_rotation(ca, ca - 1, ca - 2, prev_tangent, k);
- if(k == steps)
+ if (k == steps)
copy_qt_qt(ca->rot, (ca - 1)->rot);
/* set velocity */
sub_v3_v3v3(ca->vel, ca->co, (ca - 1)->co);
- if(k==1)
+ if (k==1)
copy_v3_v3((ca - 1)->vel, ca->vel);
}
}
@@ -3202,12 +3204,13 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
}
/* selection coloring in edit mode */
- if(pset->brushtype==PE_BRUSH_WEIGHT) {
+ if (pset->brushtype==PE_BRUSH_WEIGHT) {
float t2;
- if(k==0) {
+ if (k==0) {
weight_to_rgb(ca->col, pind.hkey[1]->weight);
- } else {
+ }
+ else {
float w1[3], w2[3];
keytime = (t - (*pind.ekey[0]->time))/((*pind.ekey[1]->time) - (*pind.ekey[0]->time));
@@ -3225,21 +3228,21 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
pind.hkey[0] = pind.hkey[1] - 1;
}
else {
- if((ekey + (pind.ekey[0] - point->keys))->flag & PEK_SELECT) {
- if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT) {
+ if ((ekey + (pind.ekey[0] - point->keys))->flag & PEK_SELECT) {
+ if ((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT) {
copy_v3_v3(ca->col, sel_col);
}
- else{
+ else {
keytime = (t - (*pind.ekey[0]->time))/((*pind.ekey[1]->time) - (*pind.ekey[0]->time));
interp_v3_v3v3(ca->col, sel_col, nosel_col, keytime);
}
}
- else{
- if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT) {
+ else {
+ if ((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT) {
keytime = (t - (*pind.ekey[0]->time))/((*pind.ekey[1]->time) - (*pind.ekey[0]->time));
interp_v3_v3v3(ca->col, nosel_col, sel_col, keytime);
}
- else{
+ else {
copy_v3_v3(ca->col, nosel_col);
}
}
@@ -3247,7 +3250,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
ca->time = t;
}
- if(psys && !(psys->flag & PSYS_GLOBAL_HAIR)) {
+ if (psys && !(psys->flag & PSYS_GLOBAL_HAIR)) {
/* First rotation is based on emitting face orientation.
* This is way better than having flipping rotations resulting
* from using a global axis as a rotation pole (vec_to_quat()).
@@ -3261,7 +3264,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
edit->totcached = totpart;
- if(psys) {
+ if (psys) {
ParticleSimulationData sim= {0};
sim.scene= scene;
sim.ob= ob;
@@ -3272,8 +3275,8 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
}
/* clear recalc flag if set here */
- if(recalc_set) {
- for(i=0, point=edit->points; i<totpart; i++, point++)
+ if (recalc_set) {
+ for (i=0, point=edit->points; i<totpart; i++, point++)
point->flag &= ~PEP_EDIT_RECALC;
}
}
@@ -3282,10 +3285,10 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
/************************************************/
void copy_particle_key(ParticleKey *to, ParticleKey *from, int time)
{
- if(time) {
+ if (time) {
memcpy(to,from,sizeof(ParticleKey));
}
- else{
+ else {
float to_time=to->time;
memcpy(to,from,sizeof(ParticleKey));
to->time=to_time;
@@ -3293,10 +3296,10 @@ void copy_particle_key(ParticleKey *to, ParticleKey *from, int time)
}
void psys_get_from_key(ParticleKey *key, float *loc, float *vel, float *rot, float *time)
{
- if(loc) copy_v3_v3(loc,key->co);
- if(vel) copy_v3_v3(vel,key->vel);
- if(rot) copy_qt_qt(rot,key->rot);
- if(time) *time=key->time;
+ if (loc) copy_v3_v3(loc,key->co);
+ if (vel) copy_v3_v3(vel,key->vel);
+ if (rot) copy_qt_qt(rot,key->rot);
+ if (time) *time=key->time;
}
/*-------changing particle keys from space to another-------*/
#if 0
@@ -3326,7 +3329,7 @@ static void triatomat(float *v1, float *v2, float *v3, float (*uv)[2], float mat
normal_tri_v3( mat[2],v1, v2, v3);
/* second axis along (1, 0) in uv space */
- if(uv) {
+ if (uv) {
d1[0]= uv[1][0] - uv[0][0];
d1[1]= uv[1][1] - uv[0][1];
d2[0]= uv[2][0] - uv[0][0];
@@ -3334,7 +3337,7 @@ static void triatomat(float *v1, float *v2, float *v3, float (*uv)[2], float mat
det = d2[0]*d1[1] - d2[1]*d1[0];
- if(det != 0.0f) {
+ if (det != 0.0f) {
det= 1.0f/det;
w1= -d2[1]*det;
w2= d1[1]*det;
@@ -3370,14 +3373,14 @@ static void psys_face_mat(Object *ob, DerivedMesh *dm, ParticleData *pa, float m
mface=dm->getTessFaceData(dm,i,CD_MFACE);
osface=dm->getTessFaceData(dm,i,CD_ORIGSPACE);
- if(orco && (orcodata=dm->getVertDataArray(dm, CD_ORCO))) {
+ if (orco && (orcodata=dm->getVertDataArray(dm, CD_ORCO))) {
copy_v3_v3(v[0], orcodata[mface->v1]);
copy_v3_v3(v[1], orcodata[mface->v2]);
copy_v3_v3(v[2], orcodata[mface->v3]);
/* ugly hack to use non-transformed orcos, since only those
* give symmetric results for mirroring in particle mode */
- if(DM_get_vert_data_layer(dm, CD_ORIGINDEX))
+ if (DM_get_vert_data_layer(dm, CD_ORIGINDEX))
transform_mesh_orco_verts(ob->data, v, 3, 1);
}
else {
@@ -3406,7 +3409,7 @@ void psys_mat_hair_to_orco(Object *ob, DerivedMesh *dm, short from, ParticleData
psys_particle_on_dm(dm, from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, vec, 0, 0, 0, orco, 0);
/* see psys_face_mat for why this function is called */
- if(DM_get_vert_data_layer(dm, CD_ORIGINDEX))
+ if (DM_get_vert_data_layer(dm, CD_ORIGINDEX))
transform_mesh_orco_verts(ob->data, &orco, 1, 1);
copy_v3_v3(hairmat[3],orco);
}
@@ -3438,11 +3441,11 @@ ModifierData *object_add_particle_system(Scene *scene, Object *ob, const char *n
ModifierData *md;
ParticleSystemModifierData *psmd;
- if(!ob || ob->type != OB_MESH)
+ if (!ob || ob->type != OB_MESH)
return NULL;
psys = ob->particlesystem.first;
- for(; psys; psys=psys->next)
+ for (; psys; psys=psys->next)
psys->flag &= ~PSYS_CURRENT;
psys = MEM_callocN(sizeof(ParticleSystem), "particle_system");
@@ -3451,14 +3454,14 @@ ModifierData *object_add_particle_system(Scene *scene, Object *ob, const char *n
psys->part = psys_new_settings("ParticleSettings", NULL);
- if(BLI_countlist(&ob->particlesystem)>1)
+ if (BLI_countlist(&ob->particlesystem)>1)
BLI_snprintf(psys->name, sizeof(psys->name), "ParticleSystem %i", BLI_countlist(&ob->particlesystem));
else
strcpy(psys->name, "ParticleSystem");
md= modifier_new(eModifierType_ParticleSystem);
- if(name) BLI_strncpy(md->name, name, sizeof(md->name));
+ if (name) BLI_strncpy(md->name, name, sizeof(md->name));
else BLI_snprintf(md->name, sizeof(md->name), "ParticleSystem %i", BLI_countlist(&ob->particlesystem));
modifier_unique_name(&ob->modifiers, md);
@@ -3481,23 +3484,21 @@ void object_remove_particle_system(Scene *scene, Object *ob)
ParticleSystemModifierData *psmd;
ModifierData *md;
- if(!psys)
+ if (!psys)
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)
+ 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)
+ if (pmd->brush && pmd->brush->psys)
+ if (pmd->brush->psys == psys)
pmd->brush->psys = NULL;
}
@@ -3510,7 +3511,7 @@ void object_remove_particle_system(Scene *scene, Object *ob)
BLI_remlink(&ob->particlesystem, psys);
psys_free(ob,psys);
- if(ob->particlesystem.first)
+ if (ob->particlesystem.first)
((ParticleSystem *) ob->particlesystem.first)->flag |= PSYS_CURRENT;
else
ob->mode &= ~OB_MODE_PARTICLE_EDIT;
@@ -3559,7 +3560,7 @@ static void default_particle_settings(ParticleSettings *part)
part->childsize=1.0;
part->rotmode = PART_ROT_VEL;
- part->avemode = PART_AVE_SPIN;
+ part->avemode = PART_AVE_VELOCITY;
part->child_nbr=10;
part->ren_child_nbr=100;
@@ -3593,7 +3594,7 @@ static void default_particle_settings(ParticleSettings *part)
part->simplify_transition= 0.1f;
part->simplify_viewport= 0.8;
- if(!part->effector_weights)
+ if (!part->effector_weights)
part->effector_weights = BKE_add_effector_weights(NULL);
}
@@ -3602,7 +3603,7 @@ ParticleSettings *psys_new_settings(const char *name, Main *main)
{
ParticleSettings *part;
- if(main==NULL)
+ if (main==NULL)
main = G.main;
part= alloc_libblock(&main->particle, ID_PA, name);
@@ -3625,8 +3626,8 @@ ParticleSettings *psys_copy_settings(ParticleSettings *part)
partn->boids = boid_copy_settings(part->boids);
- for(a=0; a<MAX_MTEX; a++) {
- if(part->mtex[a]) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (part->mtex[a]) {
partn->mtex[a]= MEM_mallocN(sizeof(MTex), "psys_copy_tex");
memcpy(partn->mtex[a], part->mtex[a], sizeof(MTex));
id_us_plus((ID *)partn->mtex[a]->tex);
@@ -3643,8 +3644,8 @@ static void expand_local_particlesettings(ParticleSettings *part)
int i;
id_lib_extern((ID *)part->dup_group);
- for(i=0; i<MAX_MTEX; i++) {
- if(part->mtex[i]) id_lib_extern((ID *)part->mtex[i]->tex);
+ for (i=0; i<MAX_MTEX; i++) {
+ if (part->mtex[i]) id_lib_extern((ID *)part->mtex[i]->tex);
}
}
@@ -3659,29 +3660,29 @@ void make_local_particlesettings(ParticleSettings *part)
* - mixed: make copy
*/
- if(part->id.lib==0) return;
- if(part->id.us==1) {
+ if (part->id.lib==0) return;
+ if (part->id.us==1) {
id_clear_lib_data(bmain, &part->id);
expand_local_particlesettings(part);
return;
}
/* test objects */
- for(ob= bmain->object.first; ob && ELEM(FALSE, is_lib, is_local); ob= ob->id.next) {
+ for (ob= bmain->object.first; ob && ELEM(FALSE, is_lib, is_local); ob= ob->id.next) {
ParticleSystem *psys=ob->particlesystem.first;
- for(; psys; psys=psys->next) {
- if(psys->part==part) {
- if(ob->id.lib) is_lib= TRUE;
+ for (; psys; psys=psys->next) {
+ if (psys->part==part) {
+ if (ob->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
}
}
- if(is_local && is_lib==FALSE) {
+ if (is_local && is_lib==FALSE) {
id_clear_lib_data(bmain, &part->id);
expand_local_particlesettings(part);
}
- else if(is_local && is_lib) {
+ else if (is_local && is_lib) {
ParticleSettings *part_new= psys_copy_settings(part);
part_new->id.us= 0;
@@ -3689,10 +3690,10 @@ void make_local_particlesettings(ParticleSettings *part)
BKE_id_lib_local_paths(bmain, part->id.lib, &part_new->id);
/* do objects */
- for(ob= bmain->object.first; ob; ob= ob->id.next) {
+ for (ob= bmain->object.first; ob; ob= ob->id.next) {
ParticleSystem *psys;
- for(psys= ob->particlesystem.first; psys; psys=psys->next) {
- if(psys->part==part && ob->id.lib==0) {
+ for (psys= ob->particlesystem.first; psys; psys=psys->next) {
+ if (psys->part==part && ob->id.lib==0) {
psys->part= part_new;
part_new->id.us++;
part->id.us--;
@@ -3714,15 +3715,15 @@ static int get_particle_uv(DerivedMesh *dm, ParticleData *pa, int face_index, co
tf= CustomData_get_layer_named(&dm->faceData, CD_MTFACE, name);
- if(tf == NULL)
+ if (tf == NULL)
tf= CustomData_get_layer(&dm->faceData, CD_MTFACE);
- if(tf == NULL)
+ if (tf == NULL)
return 0;
- if(pa) {
+ if (pa) {
i= (pa->num_dmcache==DMCACHE_NOTFOUND)? pa->num: pa->num_dmcache;
- if(i >= dm->getNumTessFaces(dm))
+ if (i >= dm->getNumTessFaces(dm))
i = -1;
}
else
@@ -3746,9 +3747,9 @@ static int get_particle_uv(DerivedMesh *dm, ParticleData *pa, int face_index, co
return 1;
}
-#define SET_PARTICLE_TEXTURE(type, pvalue, texfac) if((event & mtex->mapto) & type) {pvalue = texture_value_blend(def, pvalue, value, texfac, blend);}
-#define CLAMP_PARTICLE_TEXTURE_POS(type, pvalue) if(event & type) { if(pvalue < 0.f) pvalue = 1.f+pvalue; CLAMP(pvalue, 0.0f, 1.0f); }
-#define CLAMP_PARTICLE_TEXTURE_POSNEG(type, pvalue) if(event & type) { CLAMP(pvalue, -1.0f, 1.0f); }
+#define SET_PARTICLE_TEXTURE(type, pvalue, texfac) if ((event & mtex->mapto) & type) {pvalue = texture_value_blend(def, pvalue, value, texfac, blend);}
+#define CLAMP_PARTICLE_TEXTURE_POS(type, pvalue) if (event & type) { if (pvalue < 0.f) pvalue = 1.f+pvalue; CLAMP(pvalue, 0.0f, 1.0f); }
+#define CLAMP_PARTICLE_TEXTURE_POSNEG(type, pvalue) if (event & type) { CLAMP(pvalue, -1.0f, 1.0f); }
static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSettings *part, ParticleData *par, int child_index, int face_index, const float fw[4], float *orco, ParticleTexture *ptex, int event, float cfra)
{
@@ -3763,14 +3764,14 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti
ptex->length= 1.0f - part->randlength * PSYS_FRAND(child_index + 26);
ptex->length*= part->clength_thres < PSYS_FRAND(child_index + 27) ? part->clength : 1.0f;
- for(m=0; m<MAX_MTEX; m++, mtexp++) {
+ for (m=0; m<MAX_MTEX; m++, mtexp++) {
mtex = *mtexp;
- if(mtex && mtex->mapto) {
+ if (mtex && mtex->mapto) {
float def=mtex->def_var;
short blend=mtex->blendtype;
short texco = mtex->texco;
- if(ELEM(texco, TEXCO_UV, TEXCO_ORCO) && (ELEM(part->from, PART_FROM_FACE, PART_FROM_VOLUME) == 0 || part->distr == PART_DISTR_GRID))
+ if (ELEM(texco, TEXCO_UV, TEXCO_ORCO) && (ELEM(part->from, PART_FROM_FACE, PART_FROM_VOLUME) == 0 || part->distr == PART_DISTR_GRID))
texco = TEXCO_GLOB;
switch(texco) {
@@ -3779,11 +3780,11 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti
break;
case TEXCO_OBJECT:
copy_v3_v3(texvec, par->state.co);
- if(mtex->object)
+ if (mtex->object)
mul_m4_v3(mtex->object->imat, texvec);
break;
case TEXCO_UV:
- if(fw && get_particle_uv(dm, NULL, face_index, fw, mtex->uvname, texvec))
+ if (fw && get_particle_uv(dm, NULL, face_index, fw, mtex->uvname, texvec))
break;
/* no break, failed to get uv's, so let's try orco's */
case TEXCO_ORCO:
@@ -3799,7 +3800,7 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti
externtex(mtex, texvec, &value, rgba, rgba+1, rgba+2, rgba+3, 0);
- if((event & mtex->mapto) & PAMAP_ROUGH)
+ if ((event & mtex->mapto) & PAMAP_ROUGH)
ptex->rough1= ptex->rough2= ptex->roughe= texture_value_blend(def,ptex->rough1,value,mtex->roughfac,blend);
SET_PARTICLE_TEXTURE(PAMAP_LENGTH, ptex->length, mtex->lengthfac);
@@ -3831,14 +3832,14 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex
ptex->time = (float)(pa - sim->psys->particles)/(float)sim->psys->totpart;
- for(m=0; m<MAX_MTEX; m++, mtexp++) {
+ for (m=0; m<MAX_MTEX; m++, mtexp++) {
mtex = *mtexp;
- if(mtex && mtex->mapto) {
+ if (mtex && mtex->mapto) {
float def=mtex->def_var;
short blend=mtex->blendtype;
short texco = mtex->texco;
- if(texco == TEXCO_UV && (ELEM(part->from, PART_FROM_FACE, PART_FROM_VOLUME) == 0 || part->distr == PART_DISTR_GRID))
+ if (texco == TEXCO_UV && (ELEM(part->from, PART_FROM_FACE, PART_FROM_VOLUME) == 0 || part->distr == PART_DISTR_GRID))
texco = TEXCO_GLOB;
switch(texco) {
@@ -3847,11 +3848,11 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex
break;
case TEXCO_OBJECT:
copy_v3_v3(texvec, pa->state.co);
- if(mtex->object)
+ if (mtex->object)
mul_m4_v3(mtex->object->imat, texvec);
break;
case TEXCO_UV:
- if(get_particle_uv(sim->psmd->dm, pa, 0, pa->fuv, mtex->uvname, texvec))
+ if (get_particle_uv(sim->psmd->dm, pa, 0, pa->fuv, mtex->uvname, texvec))
break;
/* no break, failed to get uv's, so let's try orco's */
case TEXCO_ORCO:
@@ -3867,9 +3868,9 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex
externtex(mtex, texvec, &value, rgba, rgba+1, rgba+2, rgba+3, 0);
- if((event & mtex->mapto) & PAMAP_TIME) {
+ if ((event & mtex->mapto) & PAMAP_TIME) {
/* the first time has to set the base value for time regardless of blend mode */
- if((setvars&MAP_PA_TIME)==0) {
+ if ((setvars&MAP_PA_TIME)==0) {
int flip= (mtex->timefac < 0.0f);
float timefac= fabsf(mtex->timefac);
ptex->time *= 1.0f - timefac;
@@ -3912,26 +3913,26 @@ float psys_get_child_time(ParticleSystem *psys, ChildParticle *cpa, float cfra,
ParticleSettings *part = psys->part;
float time, life;
- if(part->childtype==PART_CHILD_FACES) {
+ if (part->childtype==PART_CHILD_FACES) {
int w=0;
time=0.0;
- while(w<4 && cpa->pa[w]>=0) {
+ while (w<4 && cpa->pa[w]>=0) {
time+=cpa->w[w]*(psys->particles+cpa->pa[w])->time;
w++;
}
life = part->lifetime * (1.0f - part->randlife * PSYS_FRAND(cpa - psys->child + 25));
}
- else{
+ else {
ParticleData *pa = psys->particles + cpa->parent;
time = pa->time;
life = pa->lifetime;
}
- if(birthtime)
+ if (birthtime)
*birthtime = time;
- if(dietime)
+ if (dietime)
*dietime = time+life;
return (cfra-time)/life;
@@ -3941,14 +3942,14 @@ float psys_get_child_size(ParticleSystem *psys, ChildParticle *cpa, float UNUSED
ParticleSettings *part = psys->part;
float size; // time XXX
- if(part->childtype==PART_CHILD_FACES)
+ if (part->childtype==PART_CHILD_FACES)
size=part->size;
else
size=psys->particles[cpa->parent].size;
size*=part->childsize;
- if(part->childrandsize != 0.0f)
+ if (part->childrandsize != 0.0f)
size *= 1.0f - part->childrandsize * PSYS_FRAND(cpa - psys->child + 26);
return size;
@@ -3961,22 +3962,22 @@ static void get_child_modifier_parameters(ParticleSettings *part, ParticleThread
get_cpa_texture(ctx->dm, psys, part, psys->particles + cpa->pa[0], i, cpa_num, cpa_fuv, orco, ptex, PAMAP_DENS|PAMAP_CHILD, psys->cfra);
- if(ptex->exist < PSYS_FRAND(i + 24))
+ if (ptex->exist < PSYS_FRAND(i + 24))
return;
- if(ctx->vg_length)
+ if (ctx->vg_length)
ptex->length*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_length);
- if(ctx->vg_clump)
+ if (ctx->vg_clump)
ptex->clump*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_clump);
- if(ctx->vg_kink)
+ if (ctx->vg_kink)
ptex->kink*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_kink);
- if(ctx->vg_rough1)
+ if (ctx->vg_rough1)
ptex->rough1*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_rough1);
- if(ctx->vg_rough2)
+ if (ctx->vg_rough2)
ptex->rough2*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_rough2);
- if(ctx->vg_roughe)
+ if (ctx->vg_roughe)
ptex->roughe*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_roughe);
- if(ctx->vg_effector)
+ if (ctx->vg_effector)
ptex->effector*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_effector);
}
static void do_child_modifiers(ParticleSimulationData *sim, ParticleTexture *ptex, ParticleKey *par, float *par_rot, ChildParticle *cpa, float *orco, float mat[4][4], ParticleKey *state, float t)
@@ -3990,21 +3991,21 @@ static void do_child_modifiers(ParticleSimulationData *sim, ParticleTexture *pte
float rough2 = part->rough2;
float rough_end = part->rough_end;
- if(ptex) {
+ if (ptex) {
kink_freq *= ptex->kink;
rough1 *= ptex->rough1;
rough2 *= ptex->rough2;
rough_end *= ptex->roughe;
}
- if(part->flag & PART_CHILD_EFFECT)
+ if (part->flag & PART_CHILD_EFFECT)
/* state is safe to cast, since only co and vel are used */
guided = do_guides(sim->psys->effectors, (ParticleKey*)state, cpa->parent, t);
- if(guided==0) {
+ if (guided==0) {
float clump = do_clump(state, par, t, part->clumpfac, part->clumppow, ptex ? ptex->clump : 1.f);
- if(kink_freq != 0.f) {
+ if (kink_freq != 0.f) {
float kink_amp = part->kink_amp * (1.f - part->kink_amp_clump * clump);
do_kink(state, par, par_rot, t, kink_freq, part->kink_shape,
@@ -4013,13 +4014,13 @@ static void do_child_modifiers(ParticleSimulationData *sim, ParticleTexture *pte
}
}
- if(rough1 > 0.f)
+ if (rough1 > 0.f)
do_rough(orco, mat, t, rough1, part->rough1_size, 0.0, state);
- if(rough2 > 0.f)
+ if (rough2 > 0.f)
do_rough(sim->psys->frand + ((i + 27) % (PSYS_FRAND_COUNT - 3)), mat, t, rough2, part->rough2_size, part->rough2_thres, state);
- if(rough_end > 0.f)
+ if (rough_end > 0.f)
do_rough_end(sim->psys->frand + ((i + 27) % (PSYS_FRAND_COUNT - 3)), mat, t, rough_end, part->rough_end_shape, state);
}
/* get's hair (or keyed) particles state at the "path time" specified in state->time */
@@ -4054,9 +4055,9 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
t=state->time;
CLAMP(t, 0.0f, 1.0f);
- if(p<totpart) {
+ if (p<totpart) {
/* interpolate pathcache directly if it exist */
- if(psys->pathcache) {
+ if (psys->pathcache) {
ParticleCacheKey result;
interpolate_pathcache(psys->pathcache[p], t, &result);
copy_v3_v3(state->co, result.co);
@@ -4071,38 +4072,38 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
pind.cache = cached ? psys->pointcache : NULL;
pind.epoint = NULL;
pind.bspline = (psys->part->flag & PART_HAIR_BSPLINE);
- /* pind.dm disabled in editmode means we dont get effectors taken into
+ /* pind.dm disabled in editmode means we don't get effectors taken into
* account when subdividing for instance */
pind.dm = psys_in_edit_mode(sim->scene, psys) ? NULL : psys->hair_out_dm;
init_particle_interpolation(sim->ob, psys, pa, &pind);
do_particle_interpolation(psys, p, pa, t, &pind, state);
- if(pind.dm) {
+ if (pind.dm) {
mul_m4_v3(sim->ob->obmat, state->co);
mul_mat3_m4_v3(sim->ob->obmat, state->vel);
}
- else if(!keyed && !cached && !(psys->flag & PSYS_GLOBAL_HAIR)) {
- if((pa->flag & PARS_REKEY)==0) {
+ else if (!keyed && !cached && !(psys->flag & PSYS_GLOBAL_HAIR)) {
+ if ((pa->flag & PARS_REKEY)==0) {
psys_mat_hair_to_global(sim->ob, sim->psmd->dm, part->from, pa, hairmat);
mul_m4_v3(hairmat, state->co);
mul_mat3_m4_v3(hairmat, state->vel);
- if(sim->psys->effectors && (part->flag & PART_CHILD_GUIDE)==0) {
+ if (sim->psys->effectors && (part->flag & PART_CHILD_GUIDE)==0) {
do_guides(sim->psys->effectors, state, p, state->time);
/* TODO: proper velocity handling */
}
- if(psys->lattice && edit==0)
+ if (psys->lattice && edit==0)
calc_latt_deform(psys->lattice, state->co,1.0f);
}
}
}
}
- else if(totchild) {
+ else if (totchild) {
//invert_m4_m4(imat,ob->obmat);
/* interpolate childcache directly if it exists */
- if(psys->childcache) {
+ if (psys->childcache) {
ParticleCacheKey result;
interpolate_pathcache(psys->childcache[p-totpart], t, &result);
copy_v3_v3(state->co, result.co);
@@ -4112,19 +4113,19 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
else {
cpa=psys->child+p-totpart;
- if(state->time < 0.0f)
+ if (state->time < 0.0f)
t = psys_get_child_time(psys, cpa, -state->time, NULL, NULL);
- if(totchild && part->childtype==PART_CHILD_FACES) {
+ if (totchild && part->childtype==PART_CHILD_FACES) {
/* part->parents could still be 0 so we can't test with totparent */
between=1;
}
- if(between) {
+ if (between) {
int w = 0;
float foffset;
/* get parent states */
- while(w<4 && cpa->pa[w]>=0) {
+ while (w<4 && cpa->pa[w]>=0) {
keys[w].time = state->time;
psys_get_particle_on_path(sim, cpa->pa[w], keys+w, 1);
w++;
@@ -4146,14 +4147,14 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
pa = psys->particles + cpa->parent;
- if(part->type == PART_HAIR)
+ if (part->type == PART_HAIR)
psys_mat_hair_to_global(sim->ob, sim->psmd->dm, psys->part->from, pa, hairmat);
else
unit_m4(hairmat);
pa=0;
}
- else{
+ else {
/* get the parent state */
keys->time = state->time;
psys_get_particle_on_path(sim, cpa->parent, keys,1);
@@ -4167,7 +4168,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
- if(part->type == PART_HAIR) {
+ if (part->type == PART_HAIR) {
psys_particle_on_emitter(psmd,cpa_from,cpa_num,DMCACHE_ISCHILD,cpa_fuv,pa->foffset,co,0,0,0,orco,0);
psys_mat_hair_to_global(sim->ob, sim->psmd->dm, psys->part->from, pa, hairmat);
}
@@ -4179,7 +4180,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
/* correct child ipo timing */
#if 0 // XXX old animation system
- if((part->flag&PART_ABS_TIME)==0 && part->ipo) {
+ if ((part->flag&PART_ABS_TIME)==0 && part->ipo) {
calc_ipo(part->ipo, 100.0f*t);
execute_ipo((ID *)part, part->ipo);
}
@@ -4193,14 +4194,14 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
/* TODO: assign vertex groups */
get_child_modifier_parameters(part, &ctx, cpa, cpa_from, cpa_num, cpa_fuv, orco, &ptex);
- if(between) {
+ if (between) {
int w=0;
state->co[0] = state->co[1] = state->co[2] = 0.0f;
state->vel[0] = state->vel[1] = state->vel[2] = 0.0f;
/* child position is the weighted sum of parent positions */
- while(w<4 && cpa->pa[w]>=0) {
+ while (w<4 && cpa->pa[w]>=0) {
state->co[0] += cpa->w[w] * keys[w].co[0];
state->co[1] += cpa->w[w] * keys[w].co[1];
state->co[2] += cpa->w[w] * keys[w].co[2];
@@ -4213,31 +4214,31 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
/* apply offset for correct positioning */
//add_v3_v3(state->co, cpa_1st);
}
- else{
+ else {
/* offset the child from the parent position */
offset_child(cpa, keys, keys->rot, state, part->childflat, part->childrad);
}
par = keys;
- if(vel)
+ if (vel)
copy_particle_key(&tstate, state, 1);
/* apply different deformations to the child path */
do_child_modifiers(sim, &ptex, par, par->rot, cpa, orco, hairmat, state, t);
/* try to estimate correct velocity */
- if(vel) {
+ if (vel) {
ParticleKey tstate;
float length = len_v3(state->vel);
- if(t>=0.001f) {
+ if (t>=0.001f) {
tstate.time=t-0.001f;
psys_get_particle_on_path(sim,p,&tstate,0);
sub_v3_v3v3(state->vel,state->co,tstate.co);
normalize_v3(state->vel);
}
- else{
+ else {
tstate.time=t+0.001f;
psys_get_particle_on_path(sim,p,&tstate,0);
sub_v3_v3v3(state->vel,tstate.co,state->co);
@@ -4263,20 +4264,20 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta
/* negative time means "use current time" */
cfra = state->time > 0 ? state->time : BKE_curframe(sim->scene);
- if(p>=totpart) {
- if(!psys->totchild)
+ if (p>=totpart) {
+ if (!psys->totchild)
return 0;
- if(part->childtype == PART_CHILD_FACES) {
- if(!(psys->flag & PSYS_KEYED))
+ if (part->childtype == PART_CHILD_FACES) {
+ if (!(psys->flag & PSYS_KEYED))
return 0;
cpa = psys->child + p - totpart;
state->time = psys_get_child_time(psys, cpa, cfra, NULL, NULL);
- if(!always)
- if((state->time < 0.0f && !(part->flag & PART_UNBORN))
+ if (!always)
+ if ((state->time < 0.0f && !(part->flag & PART_UNBORN))
|| (state->time > 1.0f && !(part->flag & PART_DIED)))
return 0;
@@ -4294,22 +4295,22 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta
pa = sim->psys->particles + p;
}
- if(pa) {
- if(!always)
- if((cfra < pa->time && (part->flag & PART_UNBORN)==0)
+ if (pa) {
+ if (!always)
+ if ((cfra < pa->time && (part->flag & PART_UNBORN)==0)
|| (cfra > pa->dietime && (part->flag & PART_DIED)==0))
return 0;
cfra = MIN2(cfra, pa->dietime);
}
- if(sim->psys->flag & PSYS_KEYED) {
+ if (sim->psys->flag & PSYS_KEYED) {
state->time= -cfra;
psys_get_particle_on_path(sim, p, state,1);
return 1;
}
- else{
- if(cpa) {
+ else {
+ if (cpa) {
float mat[4][4];
ParticleKey *key1;
float t = (cfra - pa->time) / pa->lifetime;
@@ -4322,19 +4323,19 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta
unit_m4(mat);
do_child_modifiers(sim, NULL, key1, key1->rot, cpa, cpa->fuv, mat, state, t);
- if(psys->lattice)
+ if (psys->lattice)
calc_latt_deform(sim->psys->lattice, state->co,1.0f);
}
- else{
- if(pa->state.time==cfra || ELEM(part->phystype,PART_PHYS_NO,PART_PHYS_KEYED))
+ else {
+ if (pa->state.time==cfra || ELEM(part->phystype,PART_PHYS_NO,PART_PHYS_KEYED))
copy_particle_key(state, &pa->state, 1);
- else if(pa->prev_state.time==cfra)
+ else if (pa->prev_state.time==cfra)
copy_particle_key(state, &pa->prev_state, 1);
else {
float dfra, frs_sec = sim->scene->r.frs_sec;
/* let's interpolate to try to be as accurate as possible */
- if(pa->state.time + 2.f >= state->time && pa->prev_state.time - 2.f <= state->time) {
- if(pa->prev_state.time >= pa->state.time || pa->prev_state.time < 0.f) {
+ if (pa->state.time + 2.f >= state->time && pa->prev_state.time - 2.f <= state->time) {
+ if (pa->prev_state.time >= pa->state.time || pa->prev_state.time < 0.f) {
/* prev_state is wrong so let's not use it, this can happen at frames 1, 0 or particle birth */
dfra = state->time - pa->state.time;
@@ -4366,7 +4367,7 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta
interp_qt_qtqt(state->rot, keys[1].rot, keys[2].rot, keytime);
}
}
- else if(pa->state.time + 1.f >= state->time && pa->state.time - 1.f <= state->time) {
+ else if (pa->state.time + 1.f >= state->time && pa->state.time - 1.f <= state->time) {
/* linear interpolation using only pa->state */
dfra = state->time - pa->state.time;
@@ -4381,7 +4382,7 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta
}
}
- if(sim->psys->lattice)
+ if (sim->psys->lattice)
calc_latt_deform(sim->psys->lattice, state->co,1.0f);
}
@@ -4398,10 +4399,10 @@ void psys_get_dupli_texture(ParticleSystem *psys, ParticleSettings *part, Partic
uv[0] = uv[1] = 0.f;
- if(cpa) {
- if(part->childtype == PART_CHILD_FACES) {
+ if (cpa) {
+ if (part->childtype == PART_CHILD_FACES) {
mtface= CustomData_get_layer(&psmd->dm->faceData, CD_MTFACE);
- if(mtface) {
+ if (mtface) {
mface= psmd->dm->getTessFaceData(psmd->dm, cpa->num, CD_MFACE);
mtface += cpa->num;
psys_interpolate_uvs(mtface, mface->v4, cpa->fuv, uv);
@@ -4415,20 +4416,20 @@ void psys_get_dupli_texture(ParticleSystem *psys, ParticleSettings *part, Partic
}
}
- if(part->from == PART_FROM_FACE) {
+ if (part->from == PART_FROM_FACE) {
mtface= CustomData_get_layer(&psmd->dm->faceData, CD_MTFACE);
num= pa->num_dmcache;
- if(num == DMCACHE_NOTFOUND)
+ if (num == DMCACHE_NOTFOUND)
num= pa->num;
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;
}
- if(mtface && num != DMCACHE_NOTFOUND) {
+ if (mtface && num != DMCACHE_NOTFOUND) {
mface= psmd->dm->getTessFaceData(psmd->dm, num, CD_MFACE);
mtface += num;
psys_interpolate_uvs(mtface, mface->v4, pa->fuv, uv);
@@ -4449,23 +4450,23 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa
sub_v3_v3v3(vec, (cache+cache->steps)->co, cache->co);
len= normalize_v3(vec);
- if(pa == NULL && psys->part->childflat != PART_CHILD_FACES)
+ if (pa == NULL && psys->part->childflat != PART_CHILD_FACES)
pa = psys->particles + cpa->pa[0];
- if(pa)
+ if (pa)
psys_particle_on_emitter(psmd,sim->psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,loc,nor,0,0,0,0);
else
psys_particle_on_emitter(psmd,PART_FROM_FACE,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,loc,nor,0,0,0,0);
- if(psys->part->rotmode == PART_ROT_VEL) {
+ if (psys->part->rotmode == PART_ROT_VEL) {
copy_m3_m4(nmat, ob->imat);
transpose_m3(nmat);
mul_m3_v3(nmat, nor);
normalize_v3(nor);
/* make sure that we get a proper side vector */
- if(fabs(dot_v3v3(nor,vec))>0.999999) {
- if(fabs(dot_v3v3(nor,xvec))>0.999999) {
+ if (fabs(dot_v3v3(nor,vec))>0.999999) {
+ if (fabs(dot_v3v3(nor,xvec))>0.999999) {
nor[0] = 0.0f;
nor[1] = 1.0f;
nor[2] = 0.0f;
@@ -4480,10 +4481,10 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa
normalize_v3(side);
/* rotate side vector around vec */
- if(psys->part->phasefac != 0) {
+ if (psys->part->phasefac != 0) {
float q_phase[4];
float phasefac = psys->part->phasefac;
- if(psys->part->randphasefac != 0.0f)
+ if (psys->part->randphasefac != 0.0f)
phasefac += psys->part->randphasefac * PSYS_FRAND((pa-psys->particles) + 20);
axis_angle_to_quat( q_phase, vec, phasefac*(float)M_PI);
@@ -4514,7 +4515,7 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3]
/* can happen with bad pointcache or physics calculation
* since this becomes geometry, nan's and inf's crash raytrace code.
* better not allow this. */
- if( !finite(bb->vec[0]) || !finite(bb->vec[1]) || !finite(bb->vec[2]) ||
+ if ( !finite(bb->vec[0]) || !finite(bb->vec[1]) || !finite(bb->vec[2]) ||
!finite(bb->vel[0]) || !finite(bb->vel[1]) || !finite(bb->vel[2]) )
{
zero_v3(bb->vec);
@@ -4528,22 +4529,22 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3]
return;
}
- if(bb->align < PART_BB_VIEW)
+ if (bb->align < PART_BB_VIEW)
onevec[bb->align]=1.0f;
- if(bb->lock && (bb->align == PART_BB_VIEW)) {
+ if (bb->lock && (bb->align == PART_BB_VIEW)) {
normalize_v3_v3(xvec, bb->ob->obmat[0]);
normalize_v3_v3(yvec, bb->ob->obmat[1]);
normalize_v3_v3(zvec, bb->ob->obmat[2]);
}
- else if(bb->align == PART_BB_VEL) {
+ else if (bb->align == PART_BB_VEL) {
float temp[3];
normalize_v3_v3(temp, bb->vel);
sub_v3_v3v3(zvec, bb->ob->obmat[3], bb->vec);
- if(bb->lock) {
+ if (bb->lock) {
float fac = -dot_v3v3(zvec, temp);
madd_v3_v3fl(zvec, temp, fac);
@@ -4557,11 +4558,11 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3]
}
else {
sub_v3_v3v3(zvec, bb->ob->obmat[3], bb->vec);
- if(bb->lock)
+ if (bb->lock)
zvec[bb->align] = 0.0f;
normalize_v3(zvec);
- if(bb->align < PART_BB_VIEW)
+ if (bb->align < PART_BB_VIEW)
cross_v3_v3v3(xvec, onevec, zvec);
else
cross_v3_v3v3(xvec, bb->ob->obmat[1], zvec);
@@ -4598,18 +4599,18 @@ void psys_apply_hair_lattice(Scene *scene, Object *ob, ParticleSystem *psys)
psys->lattice = psys_get_lattice(&sim);
- if(psys->lattice) {
+ if (psys->lattice) {
ParticleData *pa = psys->particles;
HairKey *hkey;
int p, h;
float hairmat[4][4], imat[4][4];
- for(p=0; p<psys->totpart; p++, pa++) {
+ for (p=0; p<psys->totpart; p++, pa++) {
psys_mat_hair_to_global(sim.ob, sim.psmd->dm, psys->part->from, pa, hairmat);
invert_m4_m4(imat, hairmat);
hkey = pa->hair;
- for(h=0; h<pa->totkey; h++, hkey++) {
+ for (h=0; h<pa->totkey; h++, hkey++) {
mul_m4_v3(hairmat, hkey->co);
calc_latt_deform(psys->lattice, hkey->co, 1.0f);
mul_m4_v3(imat, hkey->co);
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 206d9036ba7..aadd9d675b0 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -113,10 +113,10 @@
static int particles_are_dynamic(ParticleSystem *psys)
{
- if(psys->pointcache->flag & PTCACHE_BAKED)
+ if (psys->pointcache->flag & PTCACHE_BAKED)
return 0;
- if(psys->part->type == PART_HAIR)
+ if (psys->part->type == PART_HAIR)
return psys->flag & PSYS_HAIR_DYNAMICS;
else
return ELEM3(psys->part->phystype, PART_PHYS_NEWTON, PART_PHYS_BOIDS, PART_PHYS_FLUID);
@@ -126,7 +126,7 @@ static int psys_get_current_display_percentage(ParticleSystem *psys)
{
ParticleSettings *part=psys->part;
- if((psys->renderdata && !particles_are_dynamic(psys)) /* non-dynamic particles can be rendered fully */
+ if ((psys->renderdata && !particles_are_dynamic(psys)) /* non-dynamic particles can be rendered fully */
|| (part->child_nbr && part->childtype) /* display percentage applies to children */
|| (psys->pointcache->flag & PTCACHE_BAKING)) /* baking is always done with full amount */
return 100;
@@ -136,9 +136,9 @@ static int psys_get_current_display_percentage(ParticleSystem *psys)
static int tot_particles(ParticleSystem *psys, PTCacheID *pid)
{
- if(pid && psys->pointcache->flag & PTCACHE_EXTERNAL)
+ if (pid && psys->pointcache->flag & PTCACHE_EXTERNAL)
return pid->cache->totpoint;
- else if(psys->part->distr == PART_DISTR_GRID && psys->part->from != PART_FROM_VERT)
+ else if (psys->part->distr == PART_DISTR_GRID && psys->part->from != PART_FROM_VERT)
return psys->part->grid_res * psys->part->grid_res * psys->part->grid_res - psys->totunexist;
else
return psys->part->totpart - psys->totunexist;
@@ -148,10 +148,10 @@ void psys_reset(ParticleSystem *psys, int mode)
{
PARTICLE_P;
- if(ELEM(mode, PSYS_RESET_ALL, PSYS_RESET_DEPSGRAPH)) {
- if(mode == PSYS_RESET_ALL || !(psys->flag & PSYS_EDITED)) {
+ if (ELEM(mode, PSYS_RESET_ALL, PSYS_RESET_DEPSGRAPH)) {
+ if (mode == PSYS_RESET_ALL || !(psys->flag & PSYS_EDITED)) {
/* don't free if not absolutely necessary */
- if(psys->totpart != tot_particles(psys, NULL)) {
+ if (psys->totpart != tot_particles(psys, NULL)) {
psys_free_particles(psys);
psys->totpart= 0;
}
@@ -159,21 +159,21 @@ void psys_reset(ParticleSystem *psys, int mode)
psys->totkeyed= 0;
psys->flag &= ~(PSYS_HAIR_DONE|PSYS_KEYED);
- if(psys->edit && psys->free_edit) {
+ if (psys->edit && psys->free_edit) {
psys->free_edit(psys->edit);
psys->edit = NULL;
psys->free_edit = NULL;
}
}
}
- else if(mode == PSYS_RESET_CACHE_MISS) {
+ else if (mode == PSYS_RESET_CACHE_MISS) {
/* set all particles to be skipped */
LOOP_PARTICLES
pa->flag |= PARS_NO_DISP;
}
/* reset children */
- if(psys->child) {
+ if (psys->child) {
MEM_freeN(psys->child);
psys->child= NULL;
}
@@ -186,7 +186,7 @@ void psys_reset(ParticleSystem *psys, int mode)
/* reset point cache */
BKE_ptcache_invalidate(psys->pointcache);
- if(psys->fluid_springs) {
+ if (psys->fluid_springs) {
MEM_freeN(psys->fluid_springs);
psys->fluid_springs = NULL;
}
@@ -203,8 +203,8 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart)
PARTICLE_P;
int totpart, totsaved = 0;
- if(new_totpart<0) {
- if(part->distr==PART_DISTR_GRID && part->from != PART_FROM_VERT) {
+ if (new_totpart<0) {
+ if (part->distr==PART_DISTR_GRID && part->from != PART_FROM_VERT) {
totpart= part->grid_res;
totpart*=totpart*totpart;
}
@@ -214,55 +214,55 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart)
else
totpart=new_totpart;
- if(totpart != psys->totpart) {
- if(psys->edit && psys->free_edit) {
+ if (totpart != psys->totpart) {
+ if (psys->edit && psys->free_edit) {
psys->free_edit(psys->edit);
psys->edit = NULL;
psys->free_edit = NULL;
}
- if(totpart) {
+ if (totpart) {
newpars= MEM_callocN(totpart*sizeof(ParticleData), "particles");
- if(newpars == NULL)
+ if (newpars == NULL)
return;
- if(psys->part->phystype == PART_PHYS_BOIDS) {
+ if (psys->part->phystype == PART_PHYS_BOIDS) {
newboids= MEM_callocN(totpart*sizeof(BoidParticle), "boid particles");
- if(newboids == NULL) {
+ if (newboids == NULL) {
/* allocation error! */
- if(newpars)
+ if (newpars)
MEM_freeN(newpars);
return;
}
}
}
- if(psys->particles) {
+ if (psys->particles) {
totsaved=MIN2(psys->totpart,totpart);
/*save old pars*/
- if(totsaved) {
+ if (totsaved) {
memcpy(newpars,psys->particles,totsaved*sizeof(ParticleData));
- if(psys->particles->boid)
+ if (psys->particles->boid)
memcpy(newboids, psys->particles->boid, totsaved*sizeof(BoidParticle));
}
- if(psys->particles->keys)
+ if (psys->particles->keys)
MEM_freeN(psys->particles->keys);
- if(psys->particles->boid)
+ if (psys->particles->boid)
MEM_freeN(psys->particles->boid);
- for(p=0, pa=newpars; p<totsaved; p++, pa++) {
- if(pa->keys) {
+ for (p=0, pa=newpars; p<totsaved; p++, pa++) {
+ if (pa->keys) {
pa->keys= NULL;
pa->totkey= 0;
}
}
- for(p=totsaved, pa=psys->particles+totsaved; p<psys->totpart; p++, pa++)
- if(pa->hair) MEM_freeN(pa->hair);
+ for (p=totsaved, pa=psys->particles+totsaved; p<psys->totpart; p++, pa++)
+ if (pa->hair) MEM_freeN(pa->hair);
MEM_freeN(psys->particles);
psys_free_pdd(psys);
@@ -271,13 +271,13 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart)
psys->particles=newpars;
psys->totpart=totpart;
- if(newboids) {
+ if (newboids) {
LOOP_PARTICLES
pa->boid = newboids++;
}
}
- if(psys->child) {
+ if (psys->child) {
MEM_freeN(psys->child);
psys->child=NULL;
psys->totchild=0;
@@ -288,10 +288,10 @@ static int get_psys_child_number(struct Scene *scene, ParticleSystem *psys)
{
int nbr;
- if(!psys->part->childtype)
+ if (!psys->part->childtype)
return 0;
- if(psys->renderdata)
+ if (psys->renderdata)
nbr= psys->part->ren_child_nbr;
else
nbr= psys->part->child_nbr;
@@ -306,9 +306,9 @@ static int get_psys_tot_child(struct Scene *scene, ParticleSystem *psys)
static void alloc_child_particles(ParticleSystem *psys, int tot)
{
- if(psys->child) {
+ if (psys->child) {
/* only re-allocate if we have to */
- if(psys->part->childtype && psys->totchild == tot) {
+ if (psys->part->childtype && psys->totchild == tot) {
memset(psys->child, 0, tot*sizeof(ChildParticle));
return;
}
@@ -318,9 +318,9 @@ static void alloc_child_particles(ParticleSystem *psys, int tot)
psys->totchild=0;
}
- if(psys->part->childtype) {
+ if (psys->part->childtype) {
psys->totchild= tot;
- if(psys->totchild)
+ if (psys->totchild)
psys->child= MEM_callocN(psys->totchild*sizeof(ChildParticle), "child_particles");
}
}
@@ -332,21 +332,21 @@ 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;
/* CACHE LOCATIONS */
- if(!dm->deformedOnly) {
+ if (!dm->deformedOnly) {
/* Will use later to speed up subsurf/derivedmesh */
LinkNode *node, *nodedmelem, **nodearray;
int totdmelem, totelem, i, *origindex;
- if(psys->part->from == PART_FROM_VERT) {
+ if (psys->part->from == PART_FROM_VERT) {
totdmelem= dm->getNumVerts(dm);
totelem= me->totvert;
origindex= dm->getVertDataArray(dm, CD_ORIGINDEX);
@@ -360,11 +360,11 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys)
nodedmelem= MEM_callocN(sizeof(LinkNode)*totdmelem, "psys node elems");
nodearray= MEM_callocN(sizeof(LinkNode *)*totelem, "psys node array");
- for(i=0, node=nodedmelem; i<totdmelem; i++, origindex++, node++) {
+ for (i=0, node=nodedmelem; i<totdmelem; i++, origindex++, node++) {
node->link= SET_INT_IN_POINTER(i);
- if(*origindex != -1) {
- if(nodearray[*origindex]) {
+ if (*origindex != -1) {
+ if (nodearray[*origindex]) {
/* prepend */
node->next = nodearray[*origindex];
nodearray[*origindex]= node;
@@ -376,13 +376,13 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys)
/* cache the verts/faces! */
LOOP_PARTICLES {
- if(pa->num < 0) {
+ if (pa->num < 0) {
pa->num_dmcache = -1;
continue;
}
- if(psys->part->from == PART_FROM_VERT) {
- if(nodearray[pa->num])
+ if (psys->part->from == PART_FROM_VERT) {
+ if (nodearray[pa->num])
pa->num_dmcache= GET_INT_FROM_POINTER(nodearray[pa->num]->link);
}
else { /* FROM_FACE/FROM_VOLUME */
@@ -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;
@@ -415,13 +415,13 @@ static void distribute_simple_children(Scene *scene, Object *ob, DerivedMesh *fi
alloc_child_particles(psys, totpart);
cpa = psys->child;
- for(i=0; i<child_nbr; i++) {
- for(p=0; p<psys->totpart; p++,cpa++) {
+ for (i=0; i<child_nbr; i++) {
+ for (p=0; p<psys->totpart; p++,cpa++) {
float length=2.0;
cpa->parent=p;
/* create even spherical distribution inside unit sphere */
- while(length>=1.0f) {
+ while (length>=1.0f) {
cpa->fuv[0]=2.0f*BLI_frand()-1.0f;
cpa->fuv[1]=2.0f*BLI_frand()-1.0f;
cpa->fuv[2]=2.0f*BLI_frand()-1.0f;
@@ -449,7 +449,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
copy_v3_v3(max, mv->co);
mv++;
- for(i=1; i<totvert; i++, mv++) {
+ for (i=1; i<totvert; i++, mv++) {
min[0]=MIN2(min[0],mv->co[0]);
min[1]=MIN2(min[1],mv->co[1]);
min[2]=MIN2(min[2],mv->co[2]);
@@ -483,9 +483,9 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
min[1]+= d < delta[1] ? d/2.f : delta[1]/2.f;
min[2]+= d < delta[2] ? d/2.f : delta[2]/2.f;
- for(i=0,p=0,pa=psys->particles; i<res; i++) {
- for(j=0; j<res; j++) {
- for(k=0; k<res; k++,p++,pa++) {
+ for (i=0,p=0,pa=psys->particles; i<res; i++) {
+ for (j=0; j<res; j++) {
+ for (k=0; k<res; k++,p++,pa++) {
pa->fuv[0] = min[0] + (float)i*d;
pa->fuv[1] = min[1] + (float)j*d;
pa->fuv[2] = min[2] + (float)k*d;
@@ -496,7 +496,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
}
/* enable particles near verts/edges/faces/inside surface */
- if(from==PART_FROM_VERT) {
+ if (from==PART_FROM_VERT) {
float vec[3];
pa=psys->particles;
@@ -505,7 +505,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
min[1] -= d/2.0f;
min[2] -= d/2.0f;
- for(i=0,mv=mvert; i<totvert; i++,mv++) {
+ for (i=0,mv=mvert; i<totvert; i++,mv++) {
sub_v3_v3v3(vec,mv->co,min);
vec[0]/=delta[0];
vec[1]/=delta[1];
@@ -515,7 +515,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
+(int)(vec[2]*(size[2]-1)))->flag &= ~PARS_UNEXIST;
}
}
- else if(ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)) {
+ else if (ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)) {
float co1[3], co2[3];
MFace *mface= NULL, *mface_array;
@@ -526,13 +526,13 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
totface=dm->getNumTessFaces(dm);
mface=mface_array=dm->getTessFaceDataArray(dm,CD_MFACE);
- for(a=0; a<amax; a++) {
- if(a==0) { a0mul=res*res; a1mul=res; a2mul=1; }
- else if(a==1) { a0mul=res; a1mul=1; a2mul=res*res; }
- else{ a0mul=1; a1mul=res*res; a2mul=res; }
+ for (a=0; a<amax; a++) {
+ if (a==0) { a0mul=res*res; a1mul=res; a2mul=1; }
+ else if (a==1) { a0mul=res; a1mul=1; a2mul=res*res; }
+ else { a0mul=1; a1mul=res*res; a2mul=res; }
- for(a1=0; a1<size[(a+1)%3]; a1++) {
- for(a2=0; a2<size[(a+2)%3]; a2++) {
+ for (a1=0; a1<size[(a+1)%3]; a1++) {
+ for (a2=0; a2<size[(a+2)%3]; a2++) {
mface= mface_array;
pa = psys->particles + a1*a1mul + a2*a2mul;
@@ -543,23 +543,23 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
co1[a] -= 0.001f*d;
/* lets intersect the faces */
- for(i=0; i<totface; i++,mface++) {
+ for (i=0; i<totface; i++,mface++) {
copy_v3_v3(v1, mvert[mface->v1].co);
copy_v3_v3(v2, mvert[mface->v2].co);
copy_v3_v3(v3, mvert[mface->v3].co);
- if(isect_axial_line_tri_v3(a, co1, co2, v2, v3, v1, &lambda)) {
- if(from==PART_FROM_FACE)
+ if (isect_axial_line_tri_v3(a, co1, co2, v2, v3, v1, &lambda)) {
+ if (from==PART_FROM_FACE)
(pa+(int)(lambda*size[a])*a0mul)->flag &= ~PARS_UNEXIST;
else /* store number of intersections */
(pa+(int)(lambda*size[a])*a0mul)->hair_index++;
}
- if(mface->v4) {
+ if (mface->v4) {
copy_v3_v3(v4, mvert[mface->v4].co);
- if(isect_axial_line_tri_v3(a, co1, co2, v4, v1, v3, &lambda)) {
- if(from==PART_FROM_FACE)
+ if (isect_axial_line_tri_v3(a, co1, co2, v4, v1, v3, &lambda)) {
+ if (from==PART_FROM_FACE)
(pa+(int)(lambda*size[a])*a0mul)->flag &= ~PARS_UNEXIST;
else
(pa+(int)(lambda*size[a])*a0mul)->hair_index++;
@@ -567,11 +567,11 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
}
}
- if(from==PART_FROM_VOLUME) {
+ if (from==PART_FROM_VOLUME) {
int in=pa->hair_index%2;
- if(in) pa->hair_index++;
- for(i=0; i<size[0]; i++) {
- if(in || (pa+i*a0mul)->hair_index%2)
+ if (in) pa->hair_index++;
+ for (i=0; i<size[0]; i++) {
+ if (in || (pa+i*a0mul)->hair_index%2)
(pa+i*a0mul)->flag &= ~PARS_UNEXIST;
/* odd intersections == in->out / out->in */
/* even intersections -> in stays same */
@@ -583,14 +583,14 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
}
}
- if(psys->part->flag & PART_GRID_HEXAGONAL) {
- for(i=0,p=0,pa=psys->particles; i<res; i++) {
- for(j=0; j<res; j++) {
- for(k=0; k<res; k++,p++,pa++) {
- if(j%2)
+ if (psys->part->flag & PART_GRID_HEXAGONAL) {
+ for (i=0,p=0,pa=psys->particles; i<res; i++) {
+ for (j=0; j<res; j++) {
+ for (k=0; k<res; k++,p++,pa++) {
+ if (j%2)
pa->fuv[0] += d/2.f;
- if(k%2) {
+ if (k%2) {
pa->fuv[0] += d/2.f;
pa->fuv[1] += d/2.f;
}
@@ -599,21 +599,21 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
}
}
- if(psys->part->flag & PART_GRID_INVERT) {
- for(i=0; i<size[0]; i++) {
- for(j=0; j<size[1]; j++) {
+ if (psys->part->flag & PART_GRID_INVERT) {
+ for (i=0; i<size[0]; i++) {
+ for (j=0; j<size[1]; j++) {
pa=psys->particles + res*(i*res + j);
- for(k=0; k<size[2]; k++, pa++) {
+ for (k=0; k<size[2]; k++, pa++) {
pa->flag ^= PARS_UNEXIST;
}
}
}
}
- if(psys->part->grid_rand > 0.f) {
+ if (psys->part->grid_rand > 0.f) {
float rfac = d * psys->part->grid_rand;
- for(p=0,pa=psys->particles; p<psys->totpart; p++,pa++) {
- if(pa->flag & PARS_UNEXIST)
+ for (p=0,pa=psys->particles; p<psys->totpart; p++,pa++) {
+ if (pa->flag & PARS_UNEXIST)
continue;
pa->fuv[0] += rfac * (PSYS_FRAND(p + 31) - 0.5f);
@@ -653,7 +653,7 @@ static void init_mv_jit(float *jit, int num, int seed2, float amount)
float *jit2, x, rad1, rad2, rad3;
int i, num2;
- if(num==0) return;
+ if (num==0) return;
rad1= (float)(1.0f/sqrtf((float)num));
rad2= (float)(1.0f/((float)num));
@@ -662,7 +662,7 @@ static void init_mv_jit(float *jit, int num, int seed2, float amount)
rng = rng_new(31415926 + num + seed2);
x= 0;
num2 = 2 * num;
- for(i=0; i<num2; i+=2) {
+ for (i=0; i<num2; i+=2) {
jit[i]= x + amount*rad1*(0.5f - rng_getFloat(rng));
jit[i+1]= i/(2.0f*num) + amount*rad1*(0.5f - rng_getFloat(rng));
@@ -689,8 +689,8 @@ static void psys_uv_to_w(float u, float v, int quad, float *w)
{
float vert[4][3], co[3];
- if(!quad) {
- if(u+v > 1.0f)
+ if (!quad) {
+ if (u+v > 1.0f)
v= 1.0f-v;
else
u= 1.0f-u;
@@ -704,7 +704,7 @@ static void psys_uv_to_w(float u, float v, int quad, float *w)
co[1]= v;
co[2]= 0.0f;
- if(quad) {
+ if (quad) {
vert[3][0]= 0.0f; vert[3][1]= 1.0f; vert[3][2]= 0.0f;
interp_weights_poly_v3( w,vert, 4, co);
}
@@ -719,18 +719,18 @@ static int distribute_binary_search(float *sum, int n, float value)
{
int mid, low=0, high=n;
- if(value == 0.f)
+ if (value == 0.f)
return 0;
- while(low <= high) {
+ while (low <= high) {
mid= (low + high)/2;
- if(sum[mid] < value && value <= sum[mid+1])
+ if (sum[mid] < value && value <= sum[mid+1])
return mid;
- if(sum[mid] >= value)
+ if (sum[mid] >= value)
high= mid - 1;
- else if(sum[mid] < value)
+ else if (sum[mid] < value)
low= mid + 1;
else
return mid;
@@ -758,14 +758,14 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
int i, intersect, tot;
int rng_skip_tot= PSYS_RND_DIST_SKIP; /* count how many rng_* calls wont need skipping */
- if(from == PART_FROM_VERT) {
+ if (from == PART_FROM_VERT) {
/* TODO_PARTICLE - use original index */
pa->num= ctx->index[p];
pa->fuv[0] = 1.0f;
pa->fuv[1] = pa->fuv[2] = pa->fuv[3] = 0.0;
#if ONLY_WORKING_WITH_PA_VERTS
- if(ctx->tree) {
+ if (ctx->tree) {
KDTreeNearest ptn[3];
int w, maxw;
@@ -773,13 +773,13 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
transform_mesh_orco_verts((Mesh*)ob->data, &orco1, 1, 1);
maxw = BLI_kdtree_find_n_nearest(ctx->tree,3,orco1,NULL,ptn);
- for(w=0; w<maxw; w++) {
+ for (w=0; w<maxw; w++) {
pa->verts[w]=ptn->num;
}
}
#endif
}
- else if(from == PART_FROM_FACE || from == PART_FROM_VOLUME) {
+ else if (from == PART_FROM_FACE || from == PART_FROM_VOLUME) {
MFace *mface;
pa->num = i = ctx->index[p];
@@ -787,8 +787,8 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
switch(distr) {
case PART_DISTR_JIT:
- if(ctx->jitlevel == 1) {
- if(mface->v4)
+ if (ctx->jitlevel == 1) {
+ if (mface->v4)
psys_uv_to_w(0.5f, 0.5f, mface->v4, pa->fuv);
else
psys_uv_to_w(0.33333f, 0.33333f, mface->v4, pa->fuv);
@@ -810,7 +810,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
pa->foffset= 0.0f;
/* experimental */
- if(from==PART_FROM_VOLUME) {
+ if (from==PART_FROM_VOLUME) {
MVert *mvert=dm->getVertDataArray(dm,CD_MVERT);
tot=dm->getNumTessFaces(dm);
@@ -825,25 +825,25 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
min_d=2.0;
intersect=0;
- for(i=0,mface=dm->getTessFaceDataArray(dm,CD_MFACE); i<tot; i++,mface++) {
- if(i==pa->num) continue;
+ for (i=0,mface=dm->getTessFaceDataArray(dm,CD_MFACE); i<tot; i++,mface++) {
+ if (i==pa->num) continue;
v1=mvert[mface->v1].co;
v2=mvert[mface->v2].co;
v3=mvert[mface->v3].co;
- if(isect_line_tri_v3(co1, co2, v2, v3, v1, &cur_d, 0)) {
- if(cur_d<min_d) {
+ if (isect_line_tri_v3(co1, co2, v2, v3, v1, &cur_d, 0)) {
+ if (cur_d<min_d) {
min_d=cur_d;
pa->foffset=cur_d*50.0f; /* to the middle of volume */
intersect=1;
}
}
- if(mface->v4) {
+ if (mface->v4) {
v4=mvert[mface->v4].co;
- if(isect_line_tri_v3(co1, co2, v4, v1, v3, &cur_d, 0)) {
- if(cur_d<min_d) {
+ if (isect_line_tri_v3(co1, co2, v4, v1, v3, &cur_d, 0)) {
+ if (cur_d<min_d) {
min_d=cur_d;
pa->foffset=cur_d*50.0f; /* to the middle of volume */
intersect=1;
@@ -851,7 +851,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
}
}
}
- if(intersect==0)
+ if (intersect==0)
pa->foffset=0.0;
else switch(distr) {
case PART_DISTR_JIT:
@@ -863,10 +863,10 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
}
}
}
- else if(from == PART_FROM_CHILD) {
+ else if (from == PART_FROM_CHILD) {
MFace *mf;
- if(ctx->index[p] < 0) {
+ if (ctx->index[p] < 0) {
cpa->num=0;
cpa->fuv[0]=cpa->fuv[1]=cpa->fuv[2]=cpa->fuv[3]=0.0f;
cpa->pa[0]=cpa->pa[1]=cpa->pa[2]=cpa->pa[3]=0;
@@ -883,7 +883,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
cpa->num = ctx->index[p];
- if(ctx->tree) {
+ if (ctx->tree) {
KDTreeNearest ptn[10];
int w,maxw;//, do_seams;
float maxd /*, mind,dd */, totw= 0.0f;
@@ -898,36 +898,36 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
/* mind=ptn[0].dist; */ /* UNUSED */
/* the weights here could be done better */
- for(w=0; w<maxw; w++) {
+ for (w=0; w<maxw; w++) {
parent[w]=ptn[w].index;
pweight[w]=(float)pow(2.0,(double)(-6.0f*ptn[w].dist/maxd));
}
- for(;w<10; w++) {
+ for (;w<10; w++) {
parent[w]=-1;
pweight[w]=0.0f;
}
- for(w=0,i=0; w<maxw && i<4; w++) {
- if(parent[w]>=0) {
+ for (w=0,i=0; w<maxw && i<4; w++) {
+ if (parent[w]>=0) {
cpa->pa[i]=parent[w];
cpa->w[i]=pweight[w];
totw+=pweight[w];
i++;
}
}
- for(;i<4; i++) {
+ for (;i<4; i++) {
cpa->pa[i]=-1;
cpa->w[i]=0.0f;
}
- if(totw>0.0f) for(w=0; w<4; w++)
+ if (totw>0.0f) for (w=0; w<4; w++)
cpa->w[w]/=totw;
cpa->parent=cpa->pa[0];
}
}
- if(rng_skip_tot > 0) /* should never be below zero */
+ if (rng_skip_tot > 0) /* should never be below zero */
rng_skip(thread->rng, rng_skip_tot);
}
@@ -939,15 +939,15 @@ static void *distribute_threads_exec_cb(void *data)
ChildParticle *cpa;
int p, totpart;
- if(thread->ctx->from == PART_FROM_CHILD) {
+ if (thread->ctx->from == PART_FROM_CHILD) {
totpart= psys->totchild;
cpa= psys->child;
- for(p=0; p<totpart; p++, cpa++) {
- if(thread->ctx->skip) /* simplification skip */
+ for (p=0; p<totpart; p++, cpa++) {
+ if (thread->ctx->skip) /* simplification skip */
rng_skip(thread->rng, PSYS_RND_DIST_SKIP * thread->ctx->skip[p]);
- if((p+thread->num) % thread->tot == 0)
+ if ((p+thread->num) % thread->tot == 0)
distribute_threads_exec(thread, NULL, cpa, p);
else /* thread skip */
rng_skip(thread->rng, PSYS_RND_DIST_SKIP);
@@ -956,7 +956,7 @@ static void *distribute_threads_exec_cb(void *data)
else {
totpart= psys->totpart;
pa= psys->particles + thread->num;
- for(p=thread->num; p<totpart; p+=thread->tot, pa+=thread->tot)
+ for (p=thread->num; p<totpart; p+=thread->tot, pa+=thread->tot)
distribute_threads_exec(thread, pa, NULL, p);
}
@@ -970,14 +970,14 @@ static int distribute_compare_orig_index(const void *p1, const void *p2)
int index1 = COMPARE_ORIG_INDEX[*(const int*)p1];
int index2 = COMPARE_ORIG_INDEX[*(const int*)p2];
- if(index1 < index2)
+ if (index1 < index2)
return -1;
- else if(index1 == index2) {
+ else if (index1 == index2) {
/* this pointer comparison appears to make qsort stable for glibc,
- * and apparently on solaris too, makes the renders reproducable */
- if(p1 < p2)
+ * and apparently on solaris too, makes the renders reproducible */
+ if (p1 < p2)
return -1;
- else if(p1 == p2)
+ else if (p1 == p2)
return 0;
else
return 1;
@@ -988,12 +988,12 @@ static int distribute_compare_orig_index(const void *p1, const void *p2)
static void distribute_invalid(Scene *scene, ParticleSystem *psys, int from)
{
- if(from == PART_FROM_CHILD) {
+ if (from == PART_FROM_CHILD) {
ChildParticle *cpa;
int p, totchild = get_psys_tot_child(scene, psys);
- if(psys->child && totchild) {
- for(p=0,cpa=psys->child; p<totchild; p++,cpa++) {
+ if (psys->child && totchild) {
+ for (p=0,cpa=psys->child; p<totchild; p++,cpa++) {
cpa->fuv[0]=cpa->fuv[1]=cpa->fuv[2]=cpa->fuv[3]= 0.0;
cpa->foffset= 0.0f;
cpa->parent=0;
@@ -1032,12 +1032,12 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
float *element_weight=NULL,*element_sum=NULL,*jitter_offset=NULL, *vweight=NULL;
float cur, maxweight=0.0, tweight, totweight, inv_totweight, co[3], nor[3], orco[3], ornor[3];
- if(ELEM3(NULL, ob, psys, psys->part))
+ if (ELEM3(NULL, ob, psys, psys->part))
return 0;
part=psys->part;
totpart=psys->totpart;
- if(totpart==0)
+ if (totpart==0)
return 0;
if (!finaldm->deformedOnly && !finaldm->getTessFaceDataArray(finaldm, CD_ORIGINDEX)) {
@@ -1047,9 +1047,9 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
}
/* First handle special cases */
- if(from == PART_FROM_CHILD) {
+ if (from == PART_FROM_CHILD) {
/* Simple children */
- if(part->childtype != PART_CHILD_FACES) {
+ if (part->childtype != PART_CHILD_FACES) {
BLI_srandom(31415926 + psys->seed + psys->child_seed);
distribute_simple_children(scene, ob, finaldm, psys);
return 0;
@@ -1057,7 +1057,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
}
else {
/* Grid distribution */
- if(part->distr==PART_DISTR_GRID && from != PART_FROM_VERT) {
+ if (part->distr==PART_DISTR_GRID && from != PART_FROM_VERT) {
BLI_srandom(31415926 + psys->seed);
dm= CDDM_from_mesh((Mesh*)ob->data, ob);
distribute_grid(dm,psys);
@@ -1067,7 +1067,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
}
/* Create trees and original coordinates if needed */
- if(from == PART_FROM_CHILD) {
+ if (from == PART_FROM_CHILD) {
distr=PART_DISTR_RAND;
BLI_srandom(31415926 + psys->seed + psys->child_seed);
dm= finaldm;
@@ -1079,7 +1079,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
tree=BLI_kdtree_new(totpart);
- for(p=0,pa=psys->particles; p<totpart; p++,pa++) {
+ for (p=0,pa=psys->particles; p<totpart; p++,pa++) {
psys_particle_on_dm(dm,part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,nor,0,0,orco,ornor);
transform_mesh_orco_verts((Mesh*)ob->data, &orco, 1, 1);
BLI_kdtree_insert(tree, p, orco, ornor);
@@ -1096,7 +1096,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
dm= CDDM_from_mesh((Mesh*)ob->data, ob);
- /* BMESH ONLY, for verts we dont care about tessfaces */
+ /* BMESH ONLY, for verts we don't care about tessfaces */
if (from != PART_FROM_VERT) {
DM_ensure_tessface(dm);
}
@@ -1104,15 +1104,15 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
/* we need orco for consistent distributions */
DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, get_mesh_orco_verts(ob));
- if(from == PART_FROM_VERT) {
+ if (from == PART_FROM_VERT) {
MVert *mv= dm->getVertDataArray(dm, CD_MVERT);
float (*orcodata)[3]= dm->getVertDataArray(dm, CD_ORCO);
int totvert = dm->getNumVerts(dm);
tree=BLI_kdtree_new(totvert);
- for(p=0; p<totvert; p++) {
- if(orcodata) {
+ for (p=0; p<totvert; p++) {
+ if (orcodata) {
copy_v3_v3(co,orcodata[p]);
transform_mesh_orco_verts((Mesh*)ob->data, &co, 1, 1);
}
@@ -1128,13 +1128,13 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
/* Get total number of emission elements and allocate needed arrays */
totelem = (from == PART_FROM_VERT) ? dm->getNumVerts(dm) : dm->getNumTessFaces(dm);
- if(totelem == 0) {
+ if (totelem == 0) {
distribute_invalid(scene, psys, children ? PART_FROM_CHILD : 0);
- if(G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
fprintf(stderr,"Particle distribution error: Nothing to emit from!\n");
- if(dm != finaldm) dm->release(dm);
+ if (dm != finaldm) dm->release(dm);
BLI_kdtree_free(tree);
@@ -1147,24 +1147,24 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
jitter_offset = MEM_callocN(sizeof(float)*totelem, "particle_distribution_jitoff");
/* Calculate weights from face areas */
- if((part->flag&PART_EDISTR || children) && from != PART_FROM_VERT) {
+ if ((part->flag&PART_EDISTR || children) && from != PART_FROM_VERT) {
MVert *v1, *v2, *v3, *v4;
float totarea=0.f, co1[3], co2[3], co3[3], co4[3];
float (*orcodata)[3];
orcodata= dm->getVertDataArray(dm, CD_ORCO);
- for(i=0; i<totelem; i++) {
+ for (i=0; i<totelem; i++) {
MFace *mf=dm->getTessFaceData(dm,i,CD_MFACE);
- if(orcodata) {
+ if (orcodata) {
copy_v3_v3(co1, orcodata[mf->v1]);
copy_v3_v3(co2, orcodata[mf->v2]);
copy_v3_v3(co3, orcodata[mf->v3]);
transform_mesh_orco_verts((Mesh*)ob->data, &co1, 1, 1);
transform_mesh_orco_verts((Mesh*)ob->data, &co2, 1, 1);
transform_mesh_orco_verts((Mesh*)ob->data, &co3, 1, 1);
- if(mf->v4) {
+ if (mf->v4) {
copy_v3_v3(co4, orcodata[mf->v4]);
transform_mesh_orco_verts((Mesh*)ob->data, &co4, 1, 1);
}
@@ -1176,7 +1176,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
copy_v3_v3(co1, v1->co);
copy_v3_v3(co2, v2->co);
copy_v3_v3(co3, v3->co);
- if(mf->v4) {
+ if (mf->v4) {
v4= (MVert*)dm->getVertData(dm,mf->v4,CD_MVERT);
copy_v3_v3(co4, v4->co);
}
@@ -1184,21 +1184,21 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
cur = mf->v4 ? area_quad_v3(co1, co2, co3, co4) : area_tri_v3(co1, co2, co3);
- if(cur > maxweight)
+ if (cur > maxweight)
maxweight = cur;
element_weight[i] = cur;
totarea += cur;
}
- for(i=0; i<totelem; i++)
+ for (i=0; i<totelem; i++)
element_weight[i] /= totarea;
maxweight /= totarea;
}
- else{
+ else {
float min=1.0f/(float)(MIN2(totelem,totpart));
- for(i=0; i<totelem; i++)
+ for (i=0; i<totelem; i++)
element_weight[i]=min;
maxweight=min;
}
@@ -1206,17 +1206,17 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
/* Calculate weights from vgroup */
vweight = psys_cache_vgroup(dm,psys,PSYS_VG_DENSITY);
- if(vweight) {
- if(from==PART_FROM_VERT) {
- for(i=0;i<totelem; i++)
+ if (vweight) {
+ if (from==PART_FROM_VERT) {
+ for (i=0;i<totelem; i++)
element_weight[i]*=vweight[i];
}
else { /* PART_FROM_FACE / PART_FROM_VOLUME */
- for(i=0;i<totelem; i++) {
+ for (i=0;i<totelem; i++) {
MFace *mf=dm->getTessFaceData(dm,i,CD_MFACE);
tweight = vweight[mf->v1] + vweight[mf->v2] + vweight[mf->v3];
- if(mf->v4) {
+ if (mf->v4) {
tweight += vweight[mf->v4];
tweight /= 4.0f;
}
@@ -1232,21 +1232,21 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
/* Calculate total weight of all elements */
totweight= 0.0f;
- for(i=0;i<totelem; i++)
+ for (i=0;i<totelem; i++)
totweight += element_weight[i];
inv_totweight = (totweight > 0.f ? 1.f/totweight : 0.f);
/* Calculate cumulative weights */
element_sum[0]= 0.0f;
- for(i=0; i<totelem; i++)
+ for (i=0; i<totelem; i++)
element_sum[i+1]= element_sum[i] + element_weight[i] * inv_totweight;
/* Finally assign elements to particles */
- if((part->flag&PART_TRAND) || (part->simplify_flag&PART_SIMPLIFY_ENABLE)) {
+ if ((part->flag&PART_TRAND) || (part->simplify_flag&PART_SIMPLIFY_ENABLE)) {
float pos;
- for(p=0; p<totpart; p++) {
+ for (p=0; p<totpart; p++) {
/* In theory element_sum[totelem] should be 1.0, but due to float errors this is not necessarily always true, so scale pos accordingly. */
pos= BLI_frand() * element_sum[totelem];
particle_element[p]= distribute_binary_search(element_sum, totelem, pos);
@@ -1261,14 +1261,14 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
pos= 1e-6; /* tiny offset to avoid zero weight face */
i= 0;
- for(p=0; p<totpart; p++, pos+=step) {
- while((i < totelem) && (pos > element_sum[i+1]))
+ for (p=0; p<totpart; p++, pos+=step) {
+ while ((i < totelem) && (pos > element_sum[i+1]))
i++;
particle_element[p]= MIN2(totelem-1, i);
/* avoid zero weight face */
- if(p == totpart-1 && element_weight[particle_element[p]] == 0.0f)
+ if (p == totpart-1 && element_weight[particle_element[p]] == 0.0f)
particle_element[p]= particle_element[p-1];
jitter_offset[particle_element[p]]= pos;
@@ -1277,34 +1277,34 @@ 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)) {
+ if (part->type == PART_HAIR && !(part->childtype==PART_CHILD_FACES && part->parents!=0.0f)) {
COMPARE_ORIG_INDEX = NULL;
- if(from == PART_FROM_VERT) {
- if(dm->numVertData)
+ if (from == PART_FROM_VERT) {
+ if (dm->numVertData)
COMPARE_ORIG_INDEX= dm->getVertDataArray(dm, CD_ORIGINDEX);
}
else {
- if(dm->numTessFaceData)
+ if (dm->numTessFaceData)
COMPARE_ORIG_INDEX= dm->getTessFaceDataArray(dm, CD_ORIGINDEX);
}
- if(COMPARE_ORIG_INDEX) {
+ if (COMPARE_ORIG_INDEX) {
qsort(particle_element, totpart, sizeof(int), distribute_compare_orig_index);
COMPARE_ORIG_INDEX = NULL;
}
}
/* Create jittering if needed */
- if(distr==PART_DISTR_JIT && ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)) {
+ if (distr==PART_DISTR_JIT && ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)) {
jitlevel= part->userjit;
- if(jitlevel == 0) {
+ if (jitlevel == 0) {
jitlevel= totpart/totelem;
- if(part->flag & PART_EDISTR) jitlevel*= 2; /* looks better in general, not very scietific */
- if(jitlevel<3) jitlevel= 3;
+ if (part->flag & PART_EDISTR) jitlevel*= 2; /* looks better in general, not very scietific */
+ if (jitlevel<3) jitlevel= 3;
}
jit= MEM_callocN((2+ jitlevel*2)*sizeof(float), "jit");
@@ -1312,7 +1312,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
/* for small amounts of particles we use regular jitter since it looks
* a bit better, for larger amounts we switch to hammersley sequence
* because it is much faster */
- if(jitlevel < 25)
+ if (jitlevel < 25)
init_mv_jit(jit, jitlevel, psys->seed, part->jitfac);
else
hammersley_create(jit, jitlevel+1, psys->seed, part->jitfac);
@@ -1336,16 +1336,16 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
ctx->dm= dm;
ctx->tpars= tpars;
- if(children) {
+ if (children) {
totpart= psys_render_simplify_distribution(ctx, totpart);
alloc_child_particles(psys, totpart);
}
- if(!children || psys->totchild < 10000)
+ if (!children || psys->totchild < 10000)
totthread= 1;
seed= 31415926 + ctx->sim.psys->seed;
- for(i=0; i<totthread; i++) {
+ for (i=0; i<totthread; i++) {
threads[i].rng= rng_new(seed);
threads[i].tot= totthread;
}
@@ -1363,16 +1363,16 @@ static void distribute_particles_on_dm(ParticleSimulationData *sim, int from)
pthreads= psys_threads_create(sim);
- if(!distribute_threads_init_data(pthreads, sim->scene, finaldm, from)) {
+ if (!distribute_threads_init_data(pthreads, sim->scene, finaldm, from)) {
psys_threads_free(pthreads);
return;
}
totthread= pthreads[0].tot;
- if(totthread > 1) {
+ if (totthread > 1) {
BLI_init_threads(&threads, distribute_threads_exec_cb, totthread);
- for(i=0; i<totthread; i++)
+ for (i=0; i<totthread; i++)
BLI_insert_thread(&threads, &pthreads[i]);
BLI_end_threads(&threads);
@@ -1383,7 +1383,7 @@ static void distribute_particles_on_dm(ParticleSimulationData *sim, int from)
psys_calc_dmcache(sim->ob, finaldm, sim->psys);
ctx= pthreads[0].ctx;
- if(ctx->dm != finaldm)
+ if (ctx->dm != finaldm)
ctx->dm->release(ctx->dm);
psys_threads_free(pthreads);
@@ -1402,8 +1402,8 @@ static void distribute_particles(ParticleSimulationData *sim, int from)
PARTICLE_PSMD;
int distr_error=0;
- if(psmd) {
- if(psmd->dm)
+ if (psmd) {
+ if (psmd->dm)
distribute_particles_on_dm(sim, from);
else
distr_error=1;
@@ -1411,7 +1411,7 @@ static void distribute_particles(ParticleSimulationData *sim, int from)
else
distribute_particles_on_shape(sim, from);
- if(distr_error) {
+ if (distr_error) {
distribute_invalid(sim->scene, sim->psys, from);
fprintf(stderr,"Particle distribution error!\n");
@@ -1425,7 +1425,7 @@ ParticleThread *psys_threads_create(ParticleSimulationData *sim)
ParticleThreadContext *ctx;
int i, totthread;
- if(sim->scene->r.mode & R_FIXED_THREADS)
+ if (sim->scene->r.mode & R_FIXED_THREADS)
totthread= sim->scene->r.threads;
else
totthread= BLI_system_thread_count();
@@ -1439,7 +1439,7 @@ ParticleThread *psys_threads_create(ParticleSimulationData *sim)
memset(threads, 0, sizeof(ParticleThread)*totthread);
- for(i=0; i<totthread; i++) {
+ for (i=0; i<totthread; i++) {
threads[i].ctx= ctx;
threads[i].num= i;
threads[i].tot= totthread;
@@ -1454,39 +1454,39 @@ void psys_threads_free(ParticleThread *threads)
int i, totthread= threads[0].tot;
/* path caching */
- if(ctx->vg_length)
+ if (ctx->vg_length)
MEM_freeN(ctx->vg_length);
- if(ctx->vg_clump)
+ if (ctx->vg_clump)
MEM_freeN(ctx->vg_clump);
- if(ctx->vg_kink)
+ if (ctx->vg_kink)
MEM_freeN(ctx->vg_kink);
- if(ctx->vg_rough1)
+ if (ctx->vg_rough1)
MEM_freeN(ctx->vg_rough1);
- if(ctx->vg_rough2)
+ if (ctx->vg_rough2)
MEM_freeN(ctx->vg_rough2);
- if(ctx->vg_roughe)
+ if (ctx->vg_roughe)
MEM_freeN(ctx->vg_roughe);
- if(ctx->sim.psys->lattice) {
+ if (ctx->sim.psys->lattice) {
end_latt_deform(ctx->sim.psys->lattice);
ctx->sim.psys->lattice= NULL;
}
/* distribution */
- if(ctx->jit) MEM_freeN(ctx->jit);
- if(ctx->jitoff) MEM_freeN(ctx->jitoff);
- if(ctx->weight) MEM_freeN(ctx->weight);
- if(ctx->index) MEM_freeN(ctx->index);
- if(ctx->skip) MEM_freeN(ctx->skip);
- if(ctx->seams) MEM_freeN(ctx->seams);
+ if (ctx->jit) MEM_freeN(ctx->jit);
+ if (ctx->jitoff) MEM_freeN(ctx->jitoff);
+ if (ctx->weight) MEM_freeN(ctx->weight);
+ if (ctx->index) MEM_freeN(ctx->index);
+ if (ctx->skip) MEM_freeN(ctx->skip);
+ if (ctx->seams) MEM_freeN(ctx->seams);
//if(ctx->vertpart) MEM_freeN(ctx->vertpart);
BLI_kdtree_free(ctx->tree);
/* threads */
- for(i=0; i<totthread; i++) {
- if(threads[i].rng)
+ for (i=0; i<totthread; i++) {
+ if (threads[i].rng)
rng_free(threads[i].rng);
- if(threads[i].rng_path)
+ if (threads[i].rng_path)
rng_free(threads[i].rng_path);
}
@@ -1503,10 +1503,10 @@ void initialize_particle(ParticleSimulationData *sim, ParticleData *pa, int p)
pa->flag &= ~PARS_UNEXIST;
- if(part->type != PART_FLUID) {
+ if (part->type != PART_FLUID) {
psys_get_texture(sim, pa, &ptex, PAMAP_INIT, 0.f);
- if(ptex.exist < PSYS_FRAND(p+125))
+ if (ptex.exist < PSYS_FRAND(p+125))
pa->flag |= PARS_UNEXIST;
pa->time = (part->type == PART_HAIR) ? 0.f : part->sta + (part->end - part->sta)*ptex.time;
@@ -1515,7 +1515,7 @@ void initialize_particle(ParticleSimulationData *sim, ParticleData *pa, int p)
pa->hair_index = 0;
/* we can't reset to -1 anymore since we've figured out correct index in distribute_particles */
/* usage other than straight after distribute has to handle this index by itself - jahka*/
- //pa->num_dmcache = DMCACHE_NOTFOUND; /* assume we dont have a derived mesh face */
+ //pa->num_dmcache = DMCACHE_NOTFOUND; /* assume we don't have a derived mesh face */
}
static void initialize_all_particles(ParticleSimulationData *sim)
{
@@ -1525,16 +1525,16 @@ static void initialize_all_particles(ParticleSimulationData *sim)
psys->totunexist = 0;
LOOP_PARTICLES {
- if((pa->flag & PARS_UNEXIST)==0)
+ if ((pa->flag & PARS_UNEXIST)==0)
initialize_particle(sim, pa, p);
- if(pa->flag & PARS_UNEXIST)
+ if (pa->flag & PARS_UNEXIST)
psys->totunexist++;
}
/* Free unexisting particles. */
- if(psys->totpart && psys->totunexist == psys->totpart) {
- if(psys->particles->boid)
+ if (psys->totpart && psys->totunexist == psys->totpart) {
+ if (psys->particles->boid)
MEM_freeN(psys->particles->boid);
MEM_freeN(psys->particles);
@@ -1542,26 +1542,26 @@ static void initialize_all_particles(ParticleSimulationData *sim)
psys->totpart = psys->totunexist = 0;
}
- if(psys->totunexist) {
+ if (psys->totunexist) {
int newtotpart = psys->totpart - psys->totunexist;
ParticleData *npa, *newpars;
npa = newpars = MEM_callocN(newtotpart * sizeof(ParticleData), "particles");
- for(p=0, pa=psys->particles; p<newtotpart; p++, pa++, npa++) {
- while(pa->flag & PARS_UNEXIST)
+ for (p=0, pa=psys->particles; p<newtotpart; p++, pa++, npa++) {
+ while (pa->flag & PARS_UNEXIST)
pa++;
memcpy(npa, pa, sizeof(ParticleData));
}
- if(psys->particles->boid)
+ if (psys->particles->boid)
MEM_freeN(psys->particles->boid);
MEM_freeN(psys->particles);
psys->particles = newpars;
psys->totpart -= psys->totunexist;
- if(psys->particles->boid) {
+ if (psys->particles->boid) {
BoidParticle *newboids = MEM_callocN(psys->totpart * sizeof(BoidParticle), "boid particles");
LOOP_PARTICLES
@@ -1570,6 +1570,45 @@ static void initialize_all_particles(ParticleSimulationData *sim)
}
}
}
+
+static void get_angular_velocity_vector(short avemode, ParticleKey *state, float *vec)
+{
+ switch(avemode) {
+ case PART_AVE_VELOCITY:
+ copy_v3_v3(vec, state->vel);
+ break;
+ case PART_AVE_HORIZONTAL:
+ {
+ float zvec[3];
+ zvec[0] = zvec[1] = 0;
+ zvec[2] = 1.f;
+ cross_v3_v3v3(vec, state->vel, zvec);
+ break;
+ }
+ case PART_AVE_VERTICAL:
+ {
+ float zvec[3], temp[3];
+ zvec[0] = zvec[1] = 0;
+ zvec[2] = 1.f;
+ cross_v3_v3v3(temp, state->vel, zvec);
+ cross_v3_v3v3(vec, temp, state->vel);
+ break;
+ }
+ case PART_AVE_GLOBAL_X:
+ vec[0] = 1.f;
+ vec[1] = vec[2] = 0;
+ break;
+ case PART_AVE_GLOBAL_Y:
+ vec[1] = 1.f;
+ vec[0] = vec[2] = 0;
+ break;
+ case PART_AVE_GLOBAL_Z:
+ vec[2] = 1.f;
+ vec[0] = vec[1] = 0;
+ break;
+ }
+}
+
void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, ParticleKey *state, float dtime, float cfra)
{
Object *ob = sim->ob;
@@ -1584,7 +1623,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
part=psys->part;
/* get birth location from object */
- if(part->tanfac != 0.f)
+ if (part->tanfac != 0.f)
psys_particle_on_emitter(sim->psmd, part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,utan,vtan,0,0);
else
psys_particle_on_emitter(sim->psmd, part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,0,0,0,0);
@@ -1602,7 +1641,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
normalize_v3(nor);
/* -tangent */
- if(part->tanfac!=0.0f) {
+ if (part->tanfac!=0.0f) {
//float phase=vg_rot?2.0f*(psys_particle_value_from_verts(sim->psmd->dm,part->from,pa,vg_rot)-0.5f):0.0f;
float phase=0.0f;
mul_v3_fl(vtan,-cosf((float)M_PI*(part->tanphase+phase)));
@@ -1620,7 +1659,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
/* -velocity (boids need this even if there's no random velocity) */
- if(part->randfac != 0.0f || (part->phystype==PART_PHYS_BOIDS && pa->boid)) {
+ if (part->randfac != 0.0f || (part->phystype==PART_PHYS_BOIDS && pa->boid)) {
r_vel[0] = 2.0f * (PSYS_FRAND(p + 10) - 0.5f);
r_vel[1] = 2.0f * (PSYS_FRAND(p + 11) - 0.5f);
r_vel[2] = 2.0f * (PSYS_FRAND(p + 12) - 0.5f);
@@ -1630,7 +1669,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
}
/* -angular velocity */
- if(part->avemode==PART_AVE_RAND) {
+ if (part->avemode==PART_AVE_RAND) {
r_ave[0] = 2.0f * (PSYS_FRAND(p + 13) - 0.5f);
r_ave[1] = 2.0f * (PSYS_FRAND(p + 14) - 0.5f);
r_ave[2] = 2.0f * (PSYS_FRAND(p + 15) - 0.5f);
@@ -1640,7 +1679,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
}
/* -rotation */
- if(part->randrotfac != 0.0f) {
+ if (part->randrotfac != 0.0f) {
r_rot[0] = 2.0f * (PSYS_FRAND(p + 16) - 0.5f);
r_rot[1] = 2.0f * (PSYS_FRAND(p + 17) - 0.5f);
r_rot[2] = 2.0f * (PSYS_FRAND(p + 18) - 0.5f);
@@ -1651,7 +1690,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
mul_qt_qtqt(r_rot,r_rot,rot);
}
- if(part->phystype==PART_PHYS_BOIDS && pa->boid) {
+ if (part->phystype==PART_PHYS_BOIDS && pa->boid) {
float dvec[3], q[4], mat[3][3];
copy_v3_v3(state->co,loc);
@@ -1660,7 +1699,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
zero_v3(state->vel);
/* boids store direction in ave */
- if(fabsf(nor[2])==1.0f) {
+ if (fabsf(nor[2])==1.0f) {
sub_v3_v3v3(state->ave, loc, ob->obmat[3]);
normalize_v3(state->ave);
}
@@ -1685,34 +1724,34 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
/* -velocity from: */
/* *reactions */
- if(dtime > 0.f) {
+ if (dtime > 0.f) {
sub_v3_v3v3(vel, pa->state.vel, pa->prev_state.vel);
}
/* *emitter velocity */
- if(dtime != 0.f && part->obfac != 0.f) {
+ if (dtime != 0.f && part->obfac != 0.f) {
sub_v3_v3v3(vel, loc, state->co);
mul_v3_fl(vel, part->obfac/dtime);
}
/* *emitter normal */
- if(part->normfac != 0.f)
+ if (part->normfac != 0.f)
madd_v3_v3fl(vel, nor, part->normfac);
/* *emitter tangent */
- if(sim->psmd && part->tanfac != 0.f)
+ if (sim->psmd && part->tanfac != 0.f)
madd_v3_v3fl(vel, vtan, part->tanfac);
/* *emitter object orientation */
- if(part->ob_vel[0] != 0.f) {
+ if (part->ob_vel[0] != 0.f) {
normalize_v3_v3(vec, ob->obmat[0]);
madd_v3_v3fl(vel, vec, part->ob_vel[0]);
}
- if(part->ob_vel[1] != 0.f) {
+ if (part->ob_vel[1] != 0.f) {
normalize_v3_v3(vec, ob->obmat[1]);
madd_v3_v3fl(vel, vec, part->ob_vel[1]);
}
- if(part->ob_vel[2] != 0.f) {
+ if (part->ob_vel[2] != 0.f) {
normalize_v3_v3(vec, ob->obmat[2]);
madd_v3_v3fl(vel, vec, part->ob_vel[2]);
}
@@ -1721,11 +1760,11 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
/* TODO */
/* *random */
- if(part->randfac != 0.f)
+ if (part->randfac != 0.f)
madd_v3_v3fl(vel, r_vel, part->randfac);
/* *particle */
- if(part->partfac != 0.f)
+ if (part->partfac != 0.f)
madd_v3_v3fl(vel, p_vel, part->partfac);
mul_v3_v3fl(state->vel, vel, ptex.ivel);
@@ -1736,7 +1775,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
/* -rotation */
unit_qt(state->rot);
- if(part->rotmode) {
+ if (part->rotmode) {
/* create vector into which rotation is aligned */
switch(part->rotmode) {
case PART_ROT_NOR:
@@ -1762,14 +1801,14 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
vec_to_quat( q2,rot_vec, OB_POSX, OB_POSZ);
/* randomize rotation quat */
- if(part->randrotfac!=0.0f)
+ if (part->randrotfac!=0.0f)
interp_qt_qtqt(rot, q2, r_rot, part->randrotfac);
else
copy_qt_qt(rot,q2);
/* rotation phase */
phasefac = part->phasefac;
- if(part->randphasefac != 0.0f)
+ if (part->randphasefac != 0.0f)
phasefac += part->randphasefac * PSYS_FRAND(p + 20);
axis_angle_to_quat( q_phase,x_vec, phasefac*(float)M_PI);
@@ -1781,15 +1820,12 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
zero_v3(state->ave);
- if(part->avemode) {
- switch(part->avemode) {
- case PART_AVE_SPIN:
- copy_v3_v3(state->ave, vel);
- break;
- case PART_AVE_RAND:
- copy_v3_v3(state->ave, r_ave);
- break;
- }
+ if (part->avemode) {
+ if (part->avemode == PART_AVE_RAND)
+ copy_v3_v3(state->ave, r_ave);
+ else
+ get_angular_velocity_vector(part->avemode, state, state->ave);
+
normalize_v3(state->ave);
mul_v3_fl(state->ave, part->avefac);
}
@@ -1806,25 +1842,27 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
part=psys->part;
/* get precise emitter matrix if particle is born */
- if(part->type!=PART_HAIR && dtime > 0.f && pa->time < cfra && pa->time >= sim->psys->cfra) {
+ if (part->type!=PART_HAIR && dtime > 0.f && pa->time < cfra && pa->time >= sim->psys->cfra) {
/* we have to force RECALC_ANIM here since where_is_objec_time only does drivers */
- while(ob) {
+ while (ob) {
BKE_animsys_evaluate_animdata(sim->scene, &ob->id, ob->adt, pa->time, ADT_RECALC_ANIM);
ob = ob->parent;
}
ob = sim->ob;
where_is_object_time(sim->scene, ob, pa->time);
+
+ psys->flag |= PSYS_OB_ANIM_RESTORE;
}
psys_get_birth_coordinates(sim, pa, &pa->state, dtime, cfra);
- if(part->phystype==PART_PHYS_BOIDS && pa->boid) {
+ if (part->phystype==PART_PHYS_BOIDS && pa->boid) {
BoidParticle *bpa = pa->boid;
/* and gravity in r_ve */
bpa->gravity[0] = bpa->gravity[1] = 0.0f;
bpa->gravity[2] = -1.0f;
- if((sim->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY)
+ if ((sim->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY)
&& sim->scene->physics_settings.gravity[2]!=0.0f)
bpa->gravity[2] = sim->scene->physics_settings.gravity[2];
@@ -1835,30 +1873,30 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
}
- if(part->type == PART_HAIR) {
+ if (part->type == PART_HAIR) {
pa->lifetime = 100.0f;
}
- else{
+ else {
/* get possible textural influence */
psys_get_texture(sim, pa, &ptex, PAMAP_LIFE, cfra);
pa->lifetime = part->lifetime * ptex.life;
- if(part->randlife != 0.0f)
+ if (part->randlife != 0.0f)
pa->lifetime *= 1.0f - part->randlife * PSYS_FRAND(p + 21);
}
pa->dietime = pa->time + pa->lifetime;
- if(sim->psys->pointcache && sim->psys->pointcache->flag & PTCACHE_BAKED &&
+ if (sim->psys->pointcache && sim->psys->pointcache->flag & PTCACHE_BAKED &&
sim->psys->pointcache->mem_cache.first) {
float dietime = psys_get_dietime_from_cache(sim->psys->pointcache, p);
pa->dietime = MIN2(pa->dietime, dietime);
}
- if(pa->time > cfra)
+ if (pa->time > cfra)
pa->alive = PARS_UNBORN;
- else if(pa->dietime <= cfra)
+ else if (pa->dietime <= cfra)
pa->alive = PARS_DEAD;
else
pa->alive = PARS_ALIVE;
@@ -1870,7 +1908,7 @@ static void reset_all_particles(ParticleSimulationData *sim, float dtime, float
ParticleData *pa;
int p, totpart=sim->psys->totpart;
- for(p=from, pa=sim->psys->particles+from; p<totpart; p++, pa++)
+ for (p=from, pa=sim->psys->particles+from; p<totpart; p++, pa++)
reset_particle(sim, pa, dtime, cfra);
}
/************************************************/
@@ -1880,12 +1918,12 @@ ParticleSystem *psys_get_target_system(Object *ob, ParticleTarget *pt)
{
ParticleSystem *psys = NULL;
- if(pt->ob == NULL || pt->ob == ob)
+ if (pt->ob == NULL || pt->ob == ob)
psys = BLI_findlink(&ob->particlesystem, pt->psys-1);
else
psys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1);
- if(psys)
+ if (psys)
pt->flag |= PTARGET_VALID;
else
pt->flag &= ~PTARGET_VALID;
@@ -1903,12 +1941,12 @@ void psys_count_keyed_targets(ParticleSimulationData *sim)
int keys_valid = 1;
psys->totkeyed = 0;
- for(; pt; pt=pt->next) {
+ for (; pt; pt=pt->next) {
kpsys = psys_get_target_system(sim->ob, pt);
- if(kpsys && kpsys->totpart) {
+ if (kpsys && kpsys->totpart) {
psys->totkeyed += keys_valid;
- if(psys->flag & PSYS_KEYED_TIMING && pt->duration != 0.0f)
+ if (psys->flag & PSYS_KEYED_TIMING && pt->duration != 0.0f)
psys->totkeyed += 1;
}
else {
@@ -1932,13 +1970,13 @@ static void set_keyed_keys(ParticleSimulationData *sim)
ksim.scene= sim->scene;
/* no proper targets so let's clear and bail out */
- if(psys->totkeyed==0) {
+ if (psys->totkeyed==0) {
free_keyed_keys(psys);
psys->flag &= ~PSYS_KEYED;
return;
}
- if(totpart && psys->particles->totkey != totkeys) {
+ if (totpart && psys->particles->totkey != totkeys) {
free_keyed_keys(psys);
key = MEM_callocN(totpart*totkeys*sizeof(ParticleKey), "Keyed keys");
@@ -1954,7 +1992,7 @@ static void set_keyed_keys(ParticleSimulationData *sim)
pt = psys->targets.first;
- for(k=0; k<totkeys; k++) {
+ for (k=0; k<totkeys; k++) {
ksim.ob = pt->ob ? pt->ob : sim->ob;
ksim.psys = BLI_findlink(&ksim.ob->particlesystem, pt->psys - 1);
keyed_flag = (ksim.psys->flag & PSYS_KEYED);
@@ -1966,20 +2004,20 @@ static void set_keyed_keys(ParticleSimulationData *sim)
psys_get_particle_state(&ksim, p%ksim.psys->totpart, key, 1);
- if(psys->flag & PSYS_KEYED_TIMING) {
+ if (psys->flag & PSYS_KEYED_TIMING) {
key->time = pa->time + pt->time;
- if(pt->duration != 0.0f && k+1 < totkeys) {
+ if (pt->duration != 0.0f && k+1 < totkeys) {
copy_particle_key(key+1, key, 1);
(key+1)->time = pa->time + pt->time + pt->duration;
}
}
- else if(totkeys > 1)
+ else if (totkeys > 1)
key->time = pa->time + (float)k / (float)(totkeys - 1) * pa->lifetime;
else
key->time = pa->time;
}
- if(psys->flag & PSYS_KEYED_TIMING && pt->duration!=0.0f)
+ if (psys->flag & PSYS_KEYED_TIMING && pt->duration!=0.0f)
k++;
ksim.psys->flag |= keyed_flag;
@@ -1997,7 +2035,7 @@ void psys_make_temp_pointcache(Object *ob, ParticleSystem *psys)
{
PointCache *cache = psys->pointcache;
- if(cache->flag & PTCACHE_DISK_CACHE && cache->mem_cache.first == NULL) {
+ if (cache->flag & PTCACHE_DISK_CACHE && cache->mem_cache.first == NULL) {
PTCacheID pid;
BKE_ptcache_id_from_particles(&pid, ob, psys);
cache->flag &= ~PTCACHE_DISK_CACHE;
@@ -2007,7 +2045,7 @@ void psys_make_temp_pointcache(Object *ob, ParticleSystem *psys)
}
static void psys_clear_temp_pointcache(ParticleSystem *psys)
{
- if(psys->pointcache->flag & PTCACHE_DISK_CACHE)
+ if (psys->pointcache->flag & PTCACHE_DISK_CACHE)
BKE_ptcache_free_mem(&psys->pointcache->mem_cache);
}
void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra, int *efra)
@@ -2023,11 +2061,11 @@ void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra
/************************************************/
static void psys_update_particle_bvhtree(ParticleSystem *psys, float cfra)
{
- if(psys) {
+ if (psys) {
PARTICLE_P;
int totpart = 0;
- if(!psys->bvhtree || psys->bvhtree_frame != cfra) {
+ if (!psys->bvhtree || psys->bvhtree_frame != cfra) {
LOOP_SHOWN_PARTICLES {
totpart++;
}
@@ -2036,8 +2074,8 @@ static void psys_update_particle_bvhtree(ParticleSystem *psys, float cfra)
psys->bvhtree = BLI_bvhtree_new(totpart, 0.0, 4, 6);
LOOP_SHOWN_PARTICLES {
- if(pa->alive == PARS_ALIVE) {
- if(pa->state.time == cfra)
+ if (pa->alive == PARS_ALIVE) {
+ if (pa->state.time == cfra)
BLI_bvhtree_insert(psys->bvhtree, p, pa->prev_state.co, 1);
else
BLI_bvhtree_insert(psys->bvhtree, p, pa->state.co, 1);
@@ -2051,11 +2089,11 @@ static void psys_update_particle_bvhtree(ParticleSystem *psys, float cfra)
}
void psys_update_particle_tree(ParticleSystem *psys, float cfra)
{
- if(psys) {
+ if (psys) {
PARTICLE_P;
int totpart = 0;
- if(!psys->tree || psys->tree_frame != cfra) {
+ if (!psys->tree || psys->tree_frame != cfra) {
LOOP_SHOWN_PARTICLES {
totpart++;
}
@@ -2064,8 +2102,8 @@ void psys_update_particle_tree(ParticleSystem *psys, float cfra)
psys->tree = BLI_kdtree_new(psys->totpart);
LOOP_SHOWN_PARTICLES {
- if(pa->alive == PARS_ALIVE) {
- if(pa->state.time == cfra)
+ if (pa->alive == PARS_ALIVE) {
+ if (pa->state.time == cfra)
BLI_kdtree_insert(psys->tree, p, pa->prev_state.co, NULL);
else
BLI_kdtree_insert(psys->tree, p, pa->state.co, NULL);
@@ -2096,7 +2134,7 @@ static void integrate_particle(ParticleSettings *part, ParticleData *pa, float d
copy_v3_v3(oldpos, pa->state.co);
/* Verlet integration behaves strangely with moving emitters, so do first step with euler. */
- if(pa->prev_state.time < 0.f && integrator == PART_INT_VERLET)
+ if (pa->prev_state.time < 0.f && integrator == PART_INT_VERLET)
integrator = PART_INT_EULER;
switch(integrator) {
@@ -2118,7 +2156,7 @@ static void integrate_particle(ParticleSettings *part, ParticleData *pa, float d
states->time = 0.f;
- for(i=0; i<steps; i++) {
+ for (i=0; i<steps; i++) {
zero_v3(force);
zero_v3(impulse);
@@ -2127,7 +2165,7 @@ static void integrate_particle(ParticleSettings *part, ParticleData *pa, float d
/* force to acceleration*/
mul_v3_v3fl(acceleration, force, 1.0f/pa_mass);
- if(external_acceleration)
+ if (external_acceleration)
add_v3_v3(acceleration, external_acceleration);
/* calculate next state */
@@ -2139,13 +2177,13 @@ static void integrate_particle(ParticleSettings *part, ParticleData *pa, float d
madd_v3_v3v3fl(pa->state.vel, states->vel, acceleration, dtime);
break;
case PART_INT_MIDPOINT:
- if(i==0) {
+ if (i==0) {
madd_v3_v3v3fl(states[1].co, states->co, states->vel, dtime*0.5f);
madd_v3_v3v3fl(states[1].vel, states->vel, acceleration, dtime*0.5f);
states[1].time = dtime*0.5f;
/*fra=sim->psys->cfra+0.5f*dfra;*/
}
- else{
+ else {
madd_v3_v3v3fl(pa->state.co, states->co, states[1].vel, dtime);
madd_v3_v3v3fl(pa->state.vel, states->vel, acceleration, dtime);
}
@@ -2213,28 +2251,28 @@ 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)
{
/* Are more refs required? */
- if(psys->alloc_fluidsprings == 0 || psys->fluid_springs == NULL) {
+ if (psys->alloc_fluidsprings == 0 || psys->fluid_springs == NULL) {
psys->alloc_fluidsprings = PSYS_FLUID_SPRINGS_INITIAL_SIZE;
psys->fluid_springs = (ParticleSpring*)MEM_callocN(psys->alloc_fluidsprings * sizeof(ParticleSpring), "Particle Fluid Springs");
}
- else if(psys->tot_fluidsprings == psys->alloc_fluidsprings) {
+ else if (psys->tot_fluidsprings == psys->alloc_fluidsprings) {
/* Double the number of refs allocated */
psys->alloc_fluidsprings *= 2;
psys->fluid_springs = (ParticleSpring*)MEM_reallocN(psys->fluid_springs, psys->alloc_fluidsprings * sizeof(ParticleSpring));
@@ -2271,11 +2309,11 @@ static void sph_springs_modify(ParticleSystem *psys, float dtime)
/* scale things according to dtime */
float timefix = 25.f * dtime;
- if((fluid->flag & SPH_VISCOELASTIC_SPRINGS)==0 || fluid->spring_k == 0.f)
+ if ((fluid->flag & SPH_VISCOELASTIC_SPRINGS)==0 || fluid->spring_k == 0.f)
return;
/* Loop through the springs */
- for(i=0; i<psys->tot_fluidsprings; i++, spring++) {
+ for (i=0; i<psys->tot_fluidsprings; i++, spring++) {
pa1 = psys->particles + spring->particle_index[0];
pa2 = psys->particles + spring->particle_index[1];
@@ -2288,18 +2326,18 @@ static void sph_springs_modify(ParticleSystem *psys, float dtime)
if (rij > Lij + d) // Stretch
spring->rest_length += plasticity * (rij - Lij - d) * timefix;
- else if(rij < Lij - d) // Compress
+ else if (rij < Lij - d) // Compress
spring->rest_length -= plasticity * (Lij - d - rij) * timefix;
h = 4.f*pa1->size;
- if(spring->rest_length > h)
+ if (spring->rest_length > h)
spring->delete_flag = 1;
}
/* Loop through springs backwaqrds - for efficient delete function */
for (i=psys->tot_fluidsprings-1; i >= 0; i--) {
- if(psys->fluid_springs[i].delete_flag)
+ if (psys->fluid_springs[i].delete_flag)
sph_spring_delete(psys, i);
}
}
@@ -2311,7 +2349,7 @@ static EdgeHash *sph_springhash_build(ParticleSystem *psys)
springhash = BLI_edgehash_new();
- for(i=0, spring=psys->fluid_springs; i<psys->tot_fluidsprings; i++, spring++)
+ for (i=0, spring=psys->fluid_springs; i<psys->tot_fluidsprings; i++, spring++)
BLI_edgehash_insert(springhash, spring->particle_index[0], spring->particle_index[1], SET_INT_IN_POINTER(i+1));
return springhash;
@@ -2343,8 +2381,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];
@@ -2361,7 +2399,7 @@ static void sph_density_accum_cb(void *userdata, int index, float squared_dist)
float q;
float dist;
- if(npa == pfr->pa || squared_dist < FLT_EPSILON)
+ if (npa == pfr->pa || squared_dist < FLT_EPSILON)
return;
/* Ugh! One particle has too many neighbors! If some aren't taken into
@@ -2370,7 +2408,7 @@ static void sph_density_accum_cb(void *userdata, int index, float squared_dist)
* But, we have to stop somewhere, and it's not the end of the world.
* - jahka and z0r
*/
- if(pfr->tot_neighbors >= SPH_NEIGHBORS)
+ if (pfr->tot_neighbors >= SPH_NEIGHBORS)
return;
pfr->neighbors[pfr->tot_neighbors].index = index;
@@ -2380,7 +2418,7 @@ static void sph_density_accum_cb(void *userdata, int index, float squared_dist)
dist = sqrtf(squared_dist);
q = (1.f - dist/pfr->h) * pfr->massfac;
- if(pfr->use_size)
+ if (pfr->use_size)
q *= npa->size;
pfr->density += q*q;
@@ -2409,9 +2447,10 @@ static void sph_particle_courant(SPHData *sphdata, SPHRangeData *pfr)
dist += sphdata->psys[0]->part->fluid->radius; // TODO: remove this? - z0r
sphdata->element_size = dist / pfr->tot_neighbors;
mul_v3_v3fl(sphdata->flow, flow, 1.0f / pfr->tot_neighbors);
- } else {
+ }
+ 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))
@@ -2455,7 +2494,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa
pfr.h = h;
pfr.pa = pa;
- for(i=0; i<10 && psys[i]; i++) {
+ for (i=0; i<10 && psys[i]; i++) {
pfr.npsys = psys[i];
pfr.massfac = psys[i]->part->mass*inv_mass;
pfr.use_size = psys[i]->part->flag & PART_SIZEMASS;
@@ -2467,7 +2506,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa
near_pressure = stiffness_near_fac * pfr.near_density;
pfn = pfr.neighbors;
- for(i=0; i<pfr.tot_neighbors; i++, pfn++) {
+ for (i=0; i<pfr.tot_neighbors; i++, pfn++) {
npa = pfn->psys->particles + pfn->index;
madd_v3_v3v3fl(co, npa->prev_state.co, npa->prev_state.vel, state->time);
@@ -2477,7 +2516,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa
q = (1.f - rij/h) * pfn->psys->part->mass * inv_mass;
- if(pfn->psys->part->flag & PART_SIZEMASS)
+ if (pfn->psys->part->flag & PART_SIZEMASS)
q *= npa->size;
copy_v3_v3(vel, npa->prev_state.vel);
@@ -2486,29 +2525,29 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa
madd_v3_v3fl(force, vec, -(pressure + near_pressure*q)*q);
/* Viscosity */
- if(visc > 0.f || stiff_visc > 0.f) {
+ if (visc > 0.f || stiff_visc > 0.f) {
sub_v3_v3v3(dv, vel, state->vel);
u = dot_v3v3(vec, dv);
- if(u < 0.f && visc > 0.f)
+ if (u < 0.f && visc > 0.f)
madd_v3_v3fl(force, vec, 0.5f * q * visc * u );
- if(u > 0.f && stiff_visc > 0.f)
+ if (u > 0.f && stiff_visc > 0.f)
madd_v3_v3fl(force, vec, 0.5f * q * stiff_visc * u );
}
- if(spring_constant > 0.f) {
+ if (spring_constant > 0.f) {
/* Viscoelastic spring force */
if (pfn->psys == psys[0] && fluid->flag & SPH_VISCOELASTIC_SPRINGS && springhash) {
/* BLI_edgehash_lookup appears to be thread-safe. - z0r */
spring_index = GET_INT_FROM_POINTER(BLI_edgehash_lookup(springhash, index, pfn->index));
- if(spring_index) {
+ if (spring_index) {
spring = psys[0]->fluid_springs + spring_index - 1;
madd_v3_v3fl(force, vec, -10.f * spring_constant * (1.f - rij/h) * (spring->rest_length - rij));
}
- else if(fluid->spring_frames == 0 || (pa->prev_state.time-pa->time) <= fluid->spring_frames) {
+ else if (fluid->spring_frames == 0 || (pa->prev_state.time-pa->time) <= fluid->spring_frames) {
ParticleSpring temp_spring;
temp_spring.particle_index[0] = index;
temp_spring.particle_index[1] = pfn->index;
@@ -2542,7 +2581,7 @@ static void sph_solver_init(ParticleSimulationData *sim, SPHData *sphdata)
// Add other coupled particle systems.
sphdata->psys[0] = sim->psys;
- for(i=1, pt=sim->psys->targets.first; i<10; i++, pt=(pt?pt->next:NULL))
+ for (i=1, pt=sim->psys->targets.first; i<10; i++, pt=(pt?pt->next:NULL))
sphdata->psys[i] = pt ? psys_get_target_system(sim->ob, pt) : NULL;
if (psys_uses_gravity(sim))
@@ -2610,18 +2649,18 @@ static void basic_force_cb(void *efdata_v, ParticleKey *state, float *force, flo
/* add effectors */
pd_point_from_particle(efdata->sim, efdata->pa, state, &epoint);
- if(part->type != PART_HAIR || part->effector_weights->flag & EFF_WEIGHT_DO_HAIR)
+ if (part->type != PART_HAIR || part->effector_weights->flag & EFF_WEIGHT_DO_HAIR)
pdDoEffectors(sim->psys->effectors, sim->colliders, part->effector_weights, &epoint, force, impulse);
mul_v3_fl(force, efdata->ptex.field);
mul_v3_fl(impulse, efdata->ptex.field);
/* calculate air-particle interaction */
- if(part->dragfac != 0.0f)
+ if (part->dragfac != 0.0f)
madd_v3_v3fl(force, state->vel, -part->dragfac * pa->size * pa->size * len_v3(state->vel));
/* brownian force */
- if(part->brownfac != 0.0f) {
+ if (part->brownfac != 0.0f) {
force[0] += (BLI_frand()-0.5f) * part->brownfac;
force[1] += (BLI_frand()-0.5f) * part->brownfac;
force[2] += (BLI_frand()-0.5f) * part->brownfac;
@@ -2643,7 +2682,7 @@ static void basic_integrate(ParticleSimulationData *sim, int p, float dfra, floa
efdata.sim = sim;
/* add global acceleration (gravitation) */
- if(psys_uses_gravity(sim)
+ if (psys_uses_gravity(sim)
/* normal gravity is too strong for hair so it's disabled by default */
&& (part->type != PART_HAIR || part->effector_weights->flag & EFF_WEIGHT_DO_HAIR)) {
zero_v3(gr);
@@ -2657,7 +2696,7 @@ static void basic_integrate(ParticleSimulationData *sim, int p, float dfra, floa
integrate_particle(part, pa, dtime, gravity, basic_force_cb, &efdata);
/* damp affects final velocity */
- if(part->dampfac != 0.f)
+ if (part->dampfac != 0.f)
mul_v3_fl(pa->state.vel, 1.f - part->dampfac * efdata.ptex.damp * 25.f * dtime);
//copy_v3_v3(pa->state.ave, states->ave);
@@ -2670,8 +2709,8 @@ static void basic_integrate(ParticleSimulationData *sim, int p, float dfra, floa
copy_v3_v3(tkey.vel,pa->state.vel);
tkey.time=pa->state.time;
- if(part->type != PART_HAIR) {
- if(do_guides(sim->psys->effectors, &tkey, p, time)) {
+ if (part->type != PART_HAIR) {
+ if (do_guides(sim->psys->effectors, &tkey, p, time)) {
copy_v3_v3(pa->state.co,tkey.co);
/* guides don't produce valid velocity */
sub_v3_v3v3(pa->state.vel, tkey.co, pa->prev_state.co);
@@ -2684,31 +2723,37 @@ static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, f
{
float rotfac, rot1[4], rot2[4]={1.0,0.0,0.0,0.0}, dtime=dfra*timestep;
- if((part->flag & PART_ROT_DYN)==0) {
- if(part->avemode==PART_AVE_SPIN) {
- float angle;
- float len1 = len_v3(pa->prev_state.vel);
- float len2 = len_v3(pa->state.vel);
-
- if(len1==0.0f || len2==0.0f)
- pa->state.ave[0]=pa->state.ave[1]=pa->state.ave[2]=0.0f;
- else{
- cross_v3_v3v3(pa->state.ave,pa->prev_state.vel,pa->state.vel);
- normalize_v3(pa->state.ave);
- angle=dot_v3v3(pa->prev_state.vel,pa->state.vel)/(len1*len2);
- mul_v3_fl(pa->state.ave,saacos(angle)/dtime);
- }
+ if ((part->flag & PART_ROTATIONS)==0) {
+ pa->state.rot[0]=1.0f;
+ pa->state.rot[1]=pa->state.rot[2]=pa->state.rot[3]=0;
+ return;
+ }
+
+ if ((part->flag & PART_ROT_DYN)==0 && ELEM3(part->avemode, PART_AVE_VELOCITY, PART_AVE_HORIZONTAL, PART_AVE_VERTICAL)) {
+ float angle;
+ float len1 = len_v3(pa->prev_state.vel);
+ float len2 = len_v3(pa->state.vel);
+ float vec[3];
- axis_angle_to_quat(rot2,pa->state.vel,dtime*part->avefac);
+ if (len1==0.0f || len2==0.0f)
+ pa->state.ave[0] = pa->state.ave[1] = pa->state.ave[2] = 0.0f;
+ else {
+ cross_v3_v3v3(pa->state.ave, pa->prev_state.vel, pa->state.vel);
+ normalize_v3(pa->state.ave);
+ angle = dot_v3v3(pa->prev_state.vel, pa->state.vel) / (len1 * len2);
+ mul_v3_fl(pa->state.ave, saacos(angle) / dtime);
}
+
+ get_angular_velocity_vector(part->avemode, &pa->state, vec);
+ axis_angle_to_quat(rot2, vec, dtime*part->avefac);
}
- rotfac=len_v3(pa->state.ave);
- if(rotfac == 0.0f) { /* unit_qt(in VecRotToQuat) doesn't give unit quat [1,0,0,0]?? */
+ rotfac = len_v3(pa->state.ave);
+ if (rotfac == 0.0f) { /* unit_qt(in VecRotToQuat) doesn't give unit quat [1,0,0,0]?? */
rot1[0]=1.0f;
rot1[1]=rot1[2]=rot1[3]=0;
}
- else{
+ else {
axis_angle_to_quat(rot1,pa->state.ave,rotfac*dtime);
}
mul_qt_qtqt(pa->state.rot,rot1,pa->prev_state.rot);
@@ -2739,14 +2784,14 @@ static float nr_signed_distance_to_plane(float *p, float radius, ParticleCollisi
d = dot_v3v3(p0, nor);
- if(pce->inv_nor == -1) {
- if(d < 0.f)
+ if (pce->inv_nor == -1) {
+ if (d < 0.f)
pce->inv_nor = 1;
else
pce->inv_nor = 0;
}
- if(pce->inv_nor == 1) {
+ if (pce->inv_nor == 1) {
negate_v3(nor);
d = -d;
}
@@ -2776,13 +2821,13 @@ static void collision_interpolate_element(ParticleCollisionElement *pce, float t
/* the col->fac's are factors for the particle subframe step start and end during collision modifier step */
float f = fac + t*(1.f-fac);
float mul = col->fac1 + f * (col->fac2-col->fac1);
- if(pce->tot > 0) {
+ if (pce->tot > 0) {
madd_v3_v3v3fl(pce->x0, pce->x[0], pce->v[0], mul);
- if(pce->tot > 1) {
+ if (pce->tot > 1) {
madd_v3_v3v3fl(pce->x1, pce->x[1], pce->v[1], mul);
- if(pce->tot > 2)
+ if (pce->tot > 2)
madd_v3_v3v3fl(pce->x2, pce->x[2], pce->v[2], mul);
}
}
@@ -2793,11 +2838,11 @@ static void collision_point_velocity(ParticleCollisionElement *pce)
copy_v3_v3(pce->vel, pce->v[0]);
- if(pce->tot > 1) {
+ if (pce->tot > 1) {
sub_v3_v3v3(v, pce->v[1], pce->v[0]);
madd_v3_v3fl(pce->vel, v, pce->uv[0]);
- if(pce->tot > 2) {
+ if (pce->tot > 2) {
sub_v3_v3v3(v, pce->v[2], pce->v[0]);
madd_v3_v3fl(pce->vel, v, pce->uv[1]);
}
@@ -2805,7 +2850,7 @@ static void collision_point_velocity(ParticleCollisionElement *pce)
}
static float collision_point_distance_with_normal(float p[3], ParticleCollisionElement *pce, float fac, ParticleCollision *col, float *nor)
{
- if(fac >= 0.f)
+ if (fac >= 0.f)
collision_interpolate_element(pce, 0.f, fac, col);
switch(pce->tot) {
@@ -2866,7 +2911,7 @@ static void collision_point_on_surface(float p[3], ParticleCollisionElement *pce
cross_v3_v3v3(nor, e1, e2);
normalize_v3(nor);
- if(pce->inv_nor == 1)
+ if (pce->inv_nor == 1)
negate_v3(nor);
madd_v3_v3v3fl(co, pce->x0, nor, col->radius);
@@ -2891,7 +2936,7 @@ static float collision_newton_rhapson(ParticleCollision *col, float radius, Part
t1 = 0.001f;
d1 = 0.f;
- for(iter=0; iter<10; iter++) {//, itersum++) {
+ for (iter=0; iter<10; iter++) {//, itersum++) {
/* get current location */
collision_interpolate_element(pce, t1, col->f, col);
interp_v3_v3v3(pce->p, col->co1, col->co2, t1);
@@ -2899,12 +2944,12 @@ static float collision_newton_rhapson(ParticleCollision *col, float radius, Part
d1 = distance_func(pce->p, radius, pce, n);
/* no movement, so no collision */
- if(d1 == d0) {
+ if (d1 == d0) {
return -1.f;
}
/* particle already inside face, so report collision */
- if(iter == 0 && d0 < 0.f && d0 > -radius) {
+ if (iter == 0 && d0 < 0.f && d0 > -radius) {
copy_v3_v3(pce->p, col->co1);
copy_v3_v3(pce->nor, n);
pce->inside = 1;
@@ -2919,7 +2964,7 @@ static float collision_newton_rhapson(ParticleCollision *col, float radius, Part
t1 -= d1*dd;
/* particle movin away from plane could also mean a strangely rotating face, so check from end */
- if(iter == 0 && t1 < 0.f) {
+ if (iter == 0 && t1 < 0.f) {
t0 = 1.f;
collision_interpolate_element(pce, t0, col->f, col);
d0 = distance_func(col->co2, radius, pce, n);
@@ -2928,12 +2973,12 @@ static float collision_newton_rhapson(ParticleCollision *col, float radius, Part
continue;
}
- else if(iter == 1 && (t1 < -COLLISION_ZERO || t1 > 1.f))
+ else if (iter == 1 && (t1 < -COLLISION_ZERO || t1 > 1.f))
return -1.f;
- if(d1 <= COLLISION_ZERO && d1 >= -COLLISION_ZERO) {
- if(t1 >= -COLLISION_ZERO && t1 <= 1.f) {
- if(distance_func == nr_signed_distance_to_plane)
+ if (d1 <= COLLISION_ZERO && d1 >= -COLLISION_ZERO) {
+ if (t1 >= -COLLISION_ZERO && t1 <= 1.f) {
+ if (distance_func == nr_signed_distance_to_plane)
copy_v3_v3(pce->nor, n);
CLAMP(t1, 0.f, 1.f);
@@ -2956,7 +3001,7 @@ static int collision_sphere_to_tri(ParticleCollision *col, float radius, Particl
ct = collision_newton_rhapson(col, radius, pce, nr_signed_distance_to_plane);
- if(ct >= 0.f && ct < *t && (result->inside==0 || pce->inside==1) ) {
+ if (ct >= 0.f && ct < *t && (result->inside==0 || pce->inside==1) ) {
float e1[3], e2[3], p0[3];
float e1e1, e1e2, e1p0, e2e2, e2p0, inv;
@@ -2975,7 +3020,7 @@ static int collision_sphere_to_tri(ParticleCollision *col, float radius, Particl
u = (e2e2 * e1p0 - e1e2 * e2p0) * inv;
v = (e1e1 * e2p0 - e1e2 * e1p0) * inv;
- if(u>=0.f && u<=1.f && v>=0.f && u+v<=1.f) {
+ if (u>=0.f && u<=1.f && v>=0.f && u+v<=1.f) {
*result = *pce;
/* normal already calculated in pce */
@@ -2997,9 +3042,9 @@ static int collision_sphere_to_edges(ParticleCollision *col, float radius, Parti
float ct;
int i;
- for(i=0; i<3; i++) {
+ for (i=0; i<3; i++) {
/* in case of a quad, no need to check "edge" that goes through face twice */
- if((pce->x[3] && i==2))
+ if ((pce->x[3] && i==2))
continue;
cur = edge+i;
@@ -3010,14 +3055,14 @@ static int collision_sphere_to_edges(ParticleCollision *col, float radius, Parti
ct = collision_newton_rhapson(col, radius, cur, nr_distance_to_edge);
- if(ct >= 0.f && ct < *t) {
+ if (ct >= 0.f && ct < *t) {
float u, e[3], vec[3];
sub_v3_v3v3(e, cur->x1, cur->x0);
sub_v3_v3v3(vec, cur->p, cur->x0);
u = dot_v3v3(vec, e) / dot_v3v3(e, e);
- if(u < 0.f || u > 1.f)
+ if (u < 0.f || u > 1.f)
break;
*result = *cur;
@@ -3044,9 +3089,9 @@ static int collision_sphere_to_verts(ParticleCollision *col, float radius, Parti
float ct;
int i;
- for(i=0; i<3; i++) {
+ for (i=0; i<3; i++) {
/* in case of quad, only check one vert the first time */
- if(pce->x[3] && i != 1)
+ if (pce->x[3] && i != 1)
continue;
cur = vert+i;
@@ -3057,7 +3102,7 @@ static int collision_sphere_to_verts(ParticleCollision *col, float radius, Parti
ct = collision_newton_rhapson(col, radius, cur, nr_distance_to_vert);
- if(ct >= 0.f && ct < *t) {
+ if (ct >= 0.f && ct < *t) {
*result = *cur;
sub_v3_v3v3(result->nor, cur->p, cur->x0);
@@ -3097,18 +3142,18 @@ void BKE_psys_collision_neartest_cb(void *userdata, int index, const BVHTreeRay
pce.index = index;
/* don't collide with same face again */
- if(col->hit == col->current && col->pce.index == index && col->pce.tot == 3)
+ if (col->hit == col->current && col->pce.index == index && col->pce.tot == 3)
return;
do
{
collision = collision_sphere_to_tri(col, ray->radius, &pce, &t);
- if(col->pce.inside == 0) {
+ if (col->pce.inside == 0) {
collision += collision_sphere_to_edges(col, ray->radius, &pce, &t);
collision += collision_sphere_to_verts(col, ray->radius, &pce, &t);
}
- if(collision) {
+ if (collision) {
hit->dist = col->original_ray_length * t;
hit->index = index;
@@ -3125,14 +3170,14 @@ void BKE_psys_collision_neartest_cb(void *userdata, int index, const BVHTreeRay
pce.v[2] = pce.v[3];
pce.v[3] = NULL;
- } while(pce.x[2]);
+ } while (pce.x[2]);
}
static int collision_detect(ParticleData *pa, ParticleCollision *col, BVHTreeRayHit *hit, ListBase *colliders)
{
ColliderCache *coll;
float ray_dir[3];
- if(colliders->first == NULL)
+ if (colliders->first == NULL)
return 0;
sub_v3_v3v3(ray_dir, col->co2, col->co1);
@@ -3142,16 +3187,16 @@ static int collision_detect(ParticleData *pa, ParticleCollision *col, BVHTreeRay
/* even if particle is stationary we want to check for moving colliders */
/* if hit.dist is zero the bvhtree_ray_cast will just ignore everything */
- if(hit->dist == 0.0f)
+ if (hit->dist == 0.0f)
hit->dist = col->original_ray_length = 0.000001f;
- for(coll = colliders->first; coll; coll=coll->next) {
+ for (coll = colliders->first; coll; coll=coll->next) {
/* for boids: don't check with current ground object */
- if(coll->ob == col->skip)
+ if (coll->ob == col->skip)
continue;
/* particles should not collide with emitter at birth */
- if(coll->ob == col->emitter && pa->time < col->cfra && pa->time >= col->old_cfra)
+ if (coll->ob == col->emitter && pa->time < col->cfra && pa->time >= col->old_cfra)
continue;
col->current = coll->ob;
@@ -3159,7 +3204,7 @@ static int collision_detect(ParticleData *pa, ParticleCollision *col, BVHTreeRay
col->fac1 = (col->old_cfra - coll->collmd->time_x) / (coll->collmd->time_xnew - coll->collmd->time_x);
col->fac2 = (col->cfra - coll->collmd->time_x) / (coll->collmd->time_xnew - coll->collmd->time_x);
- if(col->md && col->md->bvhtree)
+ if (col->md && col->md->bvhtree)
BLI_bvhtree_ray_cast(col->md->bvhtree, col->co1, ray_dir, col->radius, hit, BKE_psys_collision_neartest_cb, col);
}
@@ -3180,7 +3225,7 @@ static int collision_response(ParticleData *pa, ParticleCollision *col, BVHTreeR
interp_v3_v3v3(co, col->co1, col->co2, x);
/* particle dies in collision */
- if(through == 0 && (kill || pd->flag & PDEFLE_KILL_PART)) {
+ if (through == 0 && (kill || pd->flag & PDEFLE_KILL_PART)) {
pa->alive = PARS_DYING;
pa->dietime = col->old_cfra + (col->cfra - col->old_cfra) * f;
@@ -3221,9 +3266,9 @@ static int collision_response(ParticleData *pa, ParticleCollision *col, BVHTreeR
madd_v3_v3v3fl(vc_tan, pce->vel, pce->nor, -vc_dot);
/* handle friction effects (tangential and angular velocity) */
- if(frict > 0.0f) {
+ if (frict > 0.0f) {
/* angular <-> linear velocity */
- if(dynamic_rotation) {
+ if (dynamic_rotation) {
float vr_tan[3], v1_tan[3], ave[3];
/* linear velocity of particle surface */
@@ -3234,9 +3279,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) */
@@ -3265,9 +3310,9 @@ static int collision_response(ParticleData *pa, ParticleCollision *col, BVHTreeR
/* stickness was possibly added before, so cancel that before calculating new normal velocity */
/* otherwise particles go flying out of the surface because of high reversed sticky velocity */
- if(v0_dot < 0.0f) {
+ if (v0_dot < 0.0f) {
v0_dot += pd->pdef_stickness;
- if(v0_dot > 0.0f)
+ if (v0_dot > 0.0f)
v0_dot = 0.0f;
}
@@ -3277,9 +3322,9 @@ static int collision_response(ParticleData *pa, ParticleCollision *col, BVHTreeR
/* calculate normal particle velocity */
/* special case for object hitting the particle from behind */
- if(through==0 && ((vc_dot>0.0f && v0_dot>0.0f && vc_dot>v0_dot) || (vc_dot<0.0f && v0_dot<0.0f && vc_dot<v0_dot)))
+ if (through==0 && ((vc_dot>0.0f && v0_dot>0.0f && vc_dot>v0_dot) || (vc_dot<0.0f && v0_dot<0.0f && vc_dot<v0_dot)))
mul_v3_v3fl(v0_nor, pce->nor, vc_dot);
- else if(v0_dot > 0.f)
+ else if (v0_dot > 0.f)
mul_v3_v3fl(v0_nor, pce->nor, vc_dot + (through ? -1.0f : 1.0f) * v0_dot);
else
mul_v3_v3fl(v0_nor, pce->nor, vc_dot + (through ? 1.0f : -1.0f) * v0_dot);
@@ -3287,10 +3332,10 @@ static int collision_response(ParticleData *pa, ParticleCollision *col, BVHTreeR
/* combine components together again */
add_v3_v3v3(v0, v0_nor, v0_tan);
- if(col->boid) {
+ if (col->boid) {
/* keep boids above ground */
BoidParticle *bpa = pa->boid;
- if(bpa->data.mode == eBoidMode_OnLand || co[2] <= col->boid_z) {
+ if (bpa->data.mode == eBoidMode_OnLand || co[2] <= col->boid_z) {
co[2] = col->boid_z;
v0[2] = 0.0f;
}
@@ -3302,23 +3347,23 @@ static int collision_response(ParticleData *pa, ParticleCollision *col, BVHTreeR
madd_v3_v3v3fl(pa->state.vel, v0, col->acc, dt2);
/* make sure particle stays on the right side of the surface */
- if(!through) {
+ if (!through) {
distance = collision_point_distance_with_normal(co, pce, -1.f, col, nor);
- if(distance < col->radius + COLLISION_MIN_DISTANCE)
+ if (distance < col->radius + COLLISION_MIN_DISTANCE)
madd_v3_v3fl(co, nor, col->radius + COLLISION_MIN_DISTANCE - distance);
dot = dot_v3v3(nor, v0);
- if(dot < 0.f)
+ if (dot < 0.f)
madd_v3_v3fl(v0, nor, -dot);
distance = collision_point_distance_with_normal(pa->state.co, pce, 1.f, col, nor);
- if(distance < col->radius + COLLISION_MIN_DISTANCE)
+ if (distance < col->radius + COLLISION_MIN_DISTANCE)
madd_v3_v3fl(pa->state.co, nor, col->radius + COLLISION_MIN_DISTANCE - distance);
dot = dot_v3v3(nor, pa->state.vel);
- if(dot < 0.f)
+ if (dot < 0.f)
madd_v3_v3fl(pa->state.vel, nor, -dot);
}
@@ -3393,21 +3438,21 @@ static void collision_check(ParticleSimulationData *sim, int p, float dfra, floa
col.radius = ((part->flag & PART_SIZE_DEFL) || (part->phystype == PART_PHYS_BOIDS)) ? pa->size : COLLISION_MIN_RADIUS;
/* override for boids */
- if(part->phystype == PART_PHYS_BOIDS && part->boids->options & BOID_ALLOW_LAND) {
+ if (part->phystype == PART_PHYS_BOIDS && part->boids->options & BOID_ALLOW_LAND) {
col.boid = 1;
col.boid_z = pa->state.co[2];
col.skip = pa->boid->ground;
}
/* 10 iterations to catch multiple collisions */
- while(collision_count < COLLISION_MAX_COLLISIONS) {
- if(collision_detect(pa, &col, &hit, sim->colliders)) {
+ while (collision_count < COLLISION_MAX_COLLISIONS) {
+ if (collision_detect(pa, &col, &hit, sim->colliders)) {
collision_count++;
- if(collision_count == COLLISION_MAX_COLLISIONS)
+ if (collision_count == COLLISION_MAX_COLLISIONS)
collision_fail(pa, &col);
- else if(collision_response(pa, &col, &hit, part->flag & PART_DIE_ON_COL, part->flag & PART_ROT_DYN)==0)
+ else if (collision_response(pa, &col, &hit, part->flag & PART_DIE_ON_COL, part->flag & PART_ROT_DYN)==0)
return;
}
else
@@ -3426,22 +3471,22 @@ static void psys_update_path_cache(ParticleSimulationData *sim, float cfra)
Base *base;
int distr=0, alloc=0, skip=0;
- if((psys->part->childtype && psys->totchild != get_psys_tot_child(sim->scene, psys)) || psys->recalc&PSYS_RECALC_RESET)
+ if ((psys->part->childtype && psys->totchild != get_psys_tot_child(sim->scene, psys)) || psys->recalc&PSYS_RECALC_RESET)
alloc=1;
- if(alloc || psys->recalc&PSYS_RECALC_CHILD || (psys->vgroup[PSYS_VG_DENSITY] && (sim->ob && sim->ob->mode & OB_MODE_WEIGHT_PAINT)))
+ if (alloc || psys->recalc&PSYS_RECALC_CHILD || (psys->vgroup[PSYS_VG_DENSITY] && (sim->ob && sim->ob->mode & OB_MODE_WEIGHT_PAINT)))
distr=1;
- if(distr) {
- if(alloc)
+ if (distr) {
+ if (alloc)
realloc_particles(sim, sim->psys->totpart);
- if(get_psys_tot_child(sim->scene, psys)) {
+ if (get_psys_tot_child(sim->scene, psys)) {
/* don't generate children while computing the hair keys */
- if(!(psys->part->type == PART_HAIR) || (psys->flag & PSYS_HAIR_DONE)) {
+ if (!(psys->part->type == PART_HAIR) || (psys->flag & PSYS_HAIR_DONE)) {
distribute_particles(sim, PART_FROM_CHILD);
- if(part->childtype==PART_CHILD_FACES && part->parents != 0.0f)
+ if (part->childtype==PART_CHILD_FACES && part->parents != 0.0f)
psys_find_parents(sim);
}
}
@@ -3449,19 +3494,19 @@ static void psys_update_path_cache(ParticleSimulationData *sim, float cfra)
psys_free_children(psys);
}
- if((part->type==PART_HAIR || psys->flag&PSYS_KEYED || psys->pointcache->flag & PTCACHE_BAKED)==0)
+ if ((part->type==PART_HAIR || psys->flag&PSYS_KEYED || psys->pointcache->flag & PTCACHE_BAKED)==0)
skip = 1; /* only hair, keyed and baked stuff can have paths */
- else if(part->ren_as != PART_DRAW_PATH && !(part->type==PART_HAIR && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)))
+ else if (part->ren_as != PART_DRAW_PATH && !(part->type==PART_HAIR && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)))
skip = 1; /* particle visualization must be set as path */
- else if(!psys->renderdata) {
- if(part->draw_as != PART_DRAW_REND)
+ else if (!psys->renderdata) {
+ if (part->draw_as != PART_DRAW_REND)
skip = 1; /* draw visualization */
- else if(psys->pointcache->flag & PTCACHE_BAKING)
+ else if (psys->pointcache->flag & PTCACHE_BAKING)
skip = 1; /* no need to cache paths while baking dynamics */
- else if(psys_in_edit_mode(sim->scene, psys)) {
- if((pset->flag & PE_DRAW_PART)==0)
+ else if (psys_in_edit_mode(sim->scene, psys)) {
+ if ((pset->flag & PE_DRAW_PART)==0)
skip = 1;
- else if(part->childtype==0 && (psys->flag & PSYS_HAIR_DYNAMICS && psys->pointcache->flag & PTCACHE_BAKED)==0)
+ else if (part->childtype==0 && (psys->flag & PSYS_HAIR_DYNAMICS && psys->pointcache->flag & PTCACHE_BAKED)==0)
skip = 1; /* in edit mode paths are needed for child particles and dynamic hair */
}
}
@@ -3470,30 +3515,30 @@ static void psys_update_path_cache(ParticleSimulationData *sim, float cfra)
/* particle instance modifier with "path" option need cached paths even if particle system doesn't */
for (base = sim->scene->base.first; base; base= base->next) {
ModifierData *md = modifiers_findByType(base->object, eModifierType_ParticleInstance);
- if(md) {
+ if (md) {
ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *)md;
- if(pimd->flag & eParticleInstanceFlag_Path && pimd->ob == sim->ob && pimd->psys == (psys - (ParticleSystem*)sim->ob->particlesystem.first)) {
+ if (pimd->flag & eParticleInstanceFlag_Path && pimd->ob == sim->ob && pimd->psys == (psys - (ParticleSystem*)sim->ob->particlesystem.first)) {
skip = 0;
break;
}
}
}
- if(!skip) {
+ if (!skip) {
psys_cache_paths(sim, cfra);
/* for render, child particle paths are computed on the fly */
- if(part->childtype) {
- if(!psys->totchild)
+ if (part->childtype) {
+ if (!psys->totchild)
skip = 1;
- else if(psys->part->type == PART_HAIR && (psys->flag & PSYS_HAIR_DONE)==0)
+ else if (psys->part->type == PART_HAIR && (psys->flag & PSYS_HAIR_DONE)==0)
skip = 1;
- if(!skip)
+ if (!skip)
psys_cache_child_paths(sim, cfra, 0);
}
}
- else if(psys->pathcache)
+ else if (psys->pathcache)
psys_free_path_cache(psys, NULL);
}
@@ -3512,7 +3557,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
float hairmat[4][4];
float (*deformedVerts)[3];
- if(!psys->clmd) {
+ if (!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;
@@ -3526,12 +3571,12 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
totedge = totpoint;
totpoint += psys->totpart;
- if(dm && (totpoint != dm->getNumVerts(dm) || totedge != dm->getNumEdges(dm))) {
+ if (dm && (totpoint != dm->getNumVerts(dm) || totedge != dm->getNumEdges(dm))) {
dm->release(dm);
dm = psys->hair_in_dm = NULL;
}
- if(!dm) {
+ if (!dm) {
dm = psys->hair_in_dm = CDDM_new(totpoint, totedge, 0, 0, 0);
DM_add_vert_layer(dm, CD_MDEFORMVERT, CD_CALLOC, NULL);
}
@@ -3545,15 +3590,15 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
/* make vgroup for pin roots etc.. */
psys->particles->hair_index = 1;
LOOP_PARTICLES {
- if(p)
+ if (p)
pa->hair_index = (pa-1)->hair_index + (pa-1)->totkey + 1;
psys_mat_hair_to_object(sim->ob, sim->psmd->dm, psys->part->from, pa, hairmat);
- for(k=0, key=pa->hair; k<pa->totkey; k++,key++) {
+ for (k=0, key=pa->hair; k<pa->totkey; k++,key++) {
/* create fake root before actual root to resist bending */
- if(k==0) {
+ if (k==0) {
float temp[3];
sub_v3_v3v3(temp, key->co, (key+1)->co);
copy_v3_v3(mvert->co, key->co);
@@ -3565,8 +3610,8 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
medge->v2 = pa->hair_index;
medge++;
- if(dvert) {
- if(!dvert->totweight) {
+ if (dvert) {
+ if (!dvert->totweight) {
dvert->dw = MEM_callocN(sizeof(MDeformWeight), "deformWeight");
dvert->totweight = 1;
}
@@ -3580,14 +3625,14 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
mul_m4_v3(hairmat, mvert->co);
mvert++;
- if(k) {
+ if (k) {
medge->v1 = pa->hair_index + k - 1;
medge->v2 = pa->hair_index + k;
medge++;
}
- if(dvert) {
- if(!dvert->totweight) {
+ if (dvert) {
+ if (!dvert->totweight) {
dvert->dw = MEM_callocN(sizeof(MDeformWeight), "deformWeight");
dvert->totweight = 1;
}
@@ -3598,7 +3643,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
}
}
- if(psys->hair_out_dm)
+ if (psys->hair_out_dm)
psys->hair_out_dm->release(psys->hair_out_dm);
psys->clmd->point_cache = psys->pointcache;
@@ -3625,25 +3670,25 @@ static void hair_step(ParticleSimulationData *sim, float cfra)
LOOP_PARTICLES {
pa->size = part->size;
- if(part->randsize > 0.0f)
+ if (part->randsize > 0.0f)
pa->size *= 1.0f - part->randsize * PSYS_FRAND(p + 1);
- if(PSYS_FRAND(p) > disp)
+ if (PSYS_FRAND(p) > disp)
pa->flag |= PARS_NO_DISP;
else
pa->flag &= ~PARS_NO_DISP;
}
- if(psys->recalc & PSYS_RECALC_RESET) {
+ if (psys->recalc & PSYS_RECALC_RESET) {
/* need this for changing subsurf levels */
psys_calc_dmcache(sim->ob, sim->psmd->dm, psys);
- if(psys->clmd)
+ if (psys->clmd)
cloth_free_modifier(psys->clmd);
}
/* dynamics with cloth simulation, psys->particles can be NULL with 0 particles [#25519] */
- if(psys->part->type==PART_HAIR && psys->flag & PSYS_HAIR_DYNAMICS && psys->particles)
+ if (psys->part->type==PART_HAIR && psys->flag & PSYS_HAIR_DYNAMICS && psys->particles)
do_hair_dynamics(sim);
/* following lines were removed r29079 but cause bug [#22811], see report for details */
@@ -3664,12 +3709,12 @@ static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra))
psys->lattice= psys_get_lattice(sim);
- if(psys->totpart==0) return;
+ if (psys->totpart==0) return;
/* save new keys for elements if needed */
LOOP_PARTICLES {
/* first time alloc */
- if(pa->totkey==0 || pa->hair==NULL) {
+ if (pa->totkey==0 || pa->hair==NULL) {
pa->hair = MEM_callocN((psys->part->hair_step + 1) * sizeof(HairKey), "HairKeys");
pa->totkey = 0;
}
@@ -3681,7 +3726,7 @@ static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra))
copy_v3_v3(key->co, pa->state.co);
mul_m4_v3(ob->imat, key->co);
- if(pa->totkey) {
+ if (pa->totkey) {
sub_v3_v3(key->co, root->co);
psys_vec_rot_to_face(sim->psmd->dm, pa, key->co);
}
@@ -3693,23 +3738,23 @@ static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra))
pa->totkey++;
/* root is always in the origin of hair space so we set it to be so after the last key is saved*/
- if(pa->totkey == psys->part->hair_step + 1)
+ if (pa->totkey == psys->part->hair_step + 1)
root->co[0] = root->co[1] = root->co[2] = 0.0f;
}
}
/* 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)
{
@@ -3762,11 +3807,11 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
timestep = psys_get_timestep(sim);
dtime= dfra*timestep;
- if(dfra < 0.0f) {
+ if (dfra < 0.0f) {
LOOP_EXISTING_PARTICLES {
psys_get_texture(sim, pa, &ptex, PAMAP_SIZE, cfra);
pa->size = part->size*ptex.size;
- if(part->randsize > 0.0f)
+ if (part->randsize > 0.0f)
pa->size *= 1.0f - part->randsize * PSYS_FRAND(p + 1);
reset_particle(sim, pa, dtime, cfra);
@@ -3778,7 +3823,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
psys_update_effectors(sim);
- if(part->type != PART_HAIR)
+ if (part->type != PART_HAIR)
sim->colliders = get_collider_cache(sim->scene, sim->ob, NULL);
/* initialize physics type specific stuff */
@@ -3796,8 +3841,8 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
boids_precalc_rules(part, cfra);
- for(; pt; pt=pt->next) {
- if(pt->ob)
+ for (; pt; pt=pt->next) {
+ if (pt->ob)
psys_update_particle_tree(BLI_findlink(&pt->ob->particlesystem, pt->psys-1), cfra);
}
break;
@@ -3807,8 +3852,8 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
ParticleTarget *pt = psys->targets.first;
psys_update_particle_bvhtree(psys, cfra);
- for(; pt; pt=pt->next) { /* Updating others systems particle tree for fluid-fluid interaction */
- if(pt->ob)
+ for (; pt; pt=pt->next) { /* Updating others systems particle tree for fluid-fluid interaction */
+ if (pt->ob)
psys_update_particle_bvhtree(BLI_findlink(&pt->ob->particlesystem, pt->psys-1), cfra);
}
break;
@@ -3821,7 +3866,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
psys_get_texture(sim, pa, &ptex, PAMAP_SIZE, cfra);
pa->size = part->size*ptex.size;
- if(part->randsize > 0.0f)
+ if (part->randsize > 0.0f)
pa->size *= 1.0f - part->randsize * PSYS_FRAND(p + 1);
birthtime = pa->time;
@@ -3830,29 +3875,29 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
/* store this, so we can do multiple loops over particles */
pa->state.time = dfra;
- if(dietime <= cfra && psys->cfra < dietime) {
+ if (dietime <= cfra && psys->cfra < dietime) {
/* particle dies some time between this and last step */
pa->state.time = dietime - ((birthtime > psys->cfra) ? birthtime : psys->cfra);
pa->alive = PARS_DYING;
}
- else if(birthtime <= cfra && birthtime >= psys->cfra) {
+ else if (birthtime <= cfra && birthtime >= psys->cfra) {
/* particle is born some time between this and last step*/
reset_particle(sim, pa, dfra*timestep, cfra);
pa->alive = PARS_ALIVE;
pa->state.time = cfra - birthtime;
}
- else if(dietime < cfra) {
+ else if (dietime < cfra) {
/* nothing to be done when particle is dead */
}
/* only reset unborn particles if they're shown or if the particle is born soon*/
- if(pa->alive==PARS_UNBORN
+ if (pa->alive==PARS_UNBORN
&& (part->flag & PART_UNBORN || cfra + psys->pointcache->step > pa->time))
reset_particle(sim, pa, dtime, cfra);
- else if(part->phystype == PART_PHYS_NO)
+ else if (part->phystype == PART_PHYS_NO)
reset_particle(sim, pa, dtime, cfra);
- if(ELEM(pa->alive, PARS_ALIVE, PARS_DYING)==0 || (pa->flag & (PARS_UNEXIST|PARS_NO_DISP)))
+ if (ELEM(pa->alive, PARS_ALIVE, PARS_DYING)==0 || (pa->flag & (PARS_UNEXIST|PARS_NO_DISP)))
pa->state.time = -1.f;
}
@@ -3864,7 +3909,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
basic_integrate(sim, p, pa->state.time, cfra);
/* deflection */
- if(sim->colliders)
+ if (sim->colliders)
collision_check(sim, p, pa->state.time, cfra);
/* rotations */
@@ -3879,11 +3924,11 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
boid_brain(&bbd, p, pa);
- if(pa->alive != PARS_DYING) {
+ if (pa->alive != PARS_DYING) {
boid_body(&bbd, pa);
/* deflection */
- if(sim->colliders)
+ if (sim->colliders)
collision_check(sim, p, pa->state.time, cfra);
}
}
@@ -3902,7 +3947,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
/* actual fluids calculations */
sph_integrate(sim, pa, pa->state.time, &sphdata);
- if(sim->colliders)
+ if (sim->colliders)
collision_check(sim, p, pa->state.time, cfra);
/* SPH particles are not physical particles, just interpolation
@@ -3923,7 +3968,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
/* finalize particle state and time after dynamics */
LOOP_DYNAMIC_PARTICLES {
- if(pa->alive == PARS_DYING) {
+ if (pa->alive == PARS_DYING) {
pa->alive=PARS_DEAD;
pa->state.time=pa->dietime;
}
@@ -3935,11 +3980,11 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
}
static void update_children(ParticleSimulationData *sim)
{
- if((sim->psys->part->type == PART_HAIR) && (sim->psys->flag & PSYS_HAIR_DONE)==0)
+ if ((sim->psys->part->type == PART_HAIR) && (sim->psys->flag & PSYS_HAIR_DONE)==0)
/* don't generate children while growing hair - waste of time */
psys_free_children(sim->psys);
- else if(sim->psys->part->childtype) {
- if(sim->psys->totchild != get_psys_tot_child(sim->scene, sim->psys))
+ else if (sim->psys->part->childtype) {
+ if (sim->psys->totchild != get_psys_tot_child(sim->scene, sim->psys))
distribute_particles(sim, PART_FROM_CHILD);
else {
/* Children are up to date, nothing to do. */
@@ -3964,7 +4009,7 @@ static void cached_step(ParticleSimulationData *sim, float cfra)
LOOP_PARTICLES {
psys_get_texture(sim, pa, &ptex, PAMAP_SIZE, cfra);
pa->size = part->size*ptex.size;
- if(part->randsize > 0.0f)
+ if (part->randsize > 0.0f)
pa->size *= 1.0f - part->randsize * PSYS_FRAND(p + 1);
psys->lattice= psys_get_lattice(sim);
@@ -3972,22 +4017,22 @@ static void cached_step(ParticleSimulationData *sim, float cfra)
dietime = pa->dietime;
/* update alive status and push events */
- if(pa->time > cfra) {
+ if (pa->time > cfra) {
pa->alive = PARS_UNBORN;
- if(part->flag & PART_UNBORN && (psys->pointcache->flag & PTCACHE_EXTERNAL) == 0)
+ if (part->flag & PART_UNBORN && (psys->pointcache->flag & PTCACHE_EXTERNAL) == 0)
reset_particle(sim, pa, 0.0f, cfra);
}
- else if(dietime <= cfra)
+ else if (dietime <= cfra)
pa->alive = PARS_DEAD;
else
pa->alive = PARS_ALIVE;
- if(psys->lattice) {
+ if (psys->lattice) {
end_latt_deform(psys->lattice);
psys->lattice= NULL;
}
- if(PSYS_FRAND(p) > disp)
+ if (PSYS_FRAND(p) > disp)
pa->flag |= PARS_NO_DISP;
else
pa->flag &= ~PARS_NO_DISP;
@@ -3997,7 +4042,7 @@ static void cached_step(ParticleSimulationData *sim, float cfra)
static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
{
ParticleSystem *psys = sim->psys;
- if(psys->particles) {
+ if (psys->particles) {
MEM_freeN(psys->particles);
psys->particles = 0;
psys->totpart = 0;
@@ -4008,7 +4053,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
{
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(sim->ob, eModifierType_Fluidsim);
- if( fluidmd && fluidmd->fss) {
+ if ( fluidmd && fluidmd->fss) {
FluidsimSettings *fss= fluidmd->fss;
ParticleSettings *part = psys->part;
ParticleData *pa=NULL;
@@ -4019,7 +4064,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
int readMask, activeParts = 0, fileParts = 0;
gzFile gzf;
-// XXX if(ob==G.obedit) // off...
+// XXX if (ob==G.obedit) // off...
// return;
// ok, start loading
@@ -4029,9 +4074,9 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
BLI_path_frame(filename, curFrame, 0); // fixed #frame-no
- gzf = gzopen(filename, "rb");
+ gzf = BLI_gzopen(filename, "rb");
if (!gzf) {
- BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer),"readFsPartData::error - Unable to open file for reading '%s' \n", filename);
+ BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer),"readFsPartData::error - Unable to open file for reading '%s'\n", filename);
// XXX bad level call elbeemDebugOut(debugStrBuffer);
return;
}
@@ -4049,24 +4094,24 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
// set up reading mask
readMask = fss->typeFlags;
- for(p=0, pa=psys->particles; p<totpart; p++, pa++) {
+ for (p=0, pa=psys->particles; p<totpart; p++, pa++) {
int ptype=0;
gzread(gzf, &ptype, sizeof( ptype ));
- if(ptype&readMask) {
+ if (ptype&readMask) {
activeParts++;
gzread(gzf, &(pa->size), sizeof( float ));
pa->size /= 10.0f;
- for(j=0; j<3; j++) {
+ for (j=0; j<3; j++) {
float wrf;
gzread(gzf, &wrf, sizeof( wrf ));
pa->state.co[j] = wrf;
//fprintf(stderr,"Rj%d ",j);
}
- for(j=0; j<3; j++) {
+ for (j=0; j<3; j++) {
float wrf;
gzread(gzf, &wrf, sizeof( wrf ));
pa->state.vel[j] = wrf;
@@ -4080,19 +4125,20 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
pa->dietime = sim->scene->r.efra + 1;
pa->lifetime = sim->scene->r.efra;
pa->alive = PARS_ALIVE;
- //if(a<25) fprintf(stderr,"FSPARTICLE debug set %s , a%d = %f,%f,%f , life=%f \n", filename, a, pa->co[0],pa->co[1],pa->co[2], pa->lifetime );
- } else {
+ //if(a<25) fprintf(stderr,"FSPARTICLE debug set %s , a%d = %f,%f,%f , life=%f\n", filename, a, pa->co[0],pa->co[1],pa->co[2], pa->lifetime );
+ }
+ else {
// skip...
- for(j=0; j<2*3+1; j++) {
+ for (j=0; j<2*3+1; j++) {
float wrf; gzread(gzf, &wrf, sizeof( wrf ));
}
}
fileParts++;
}
- gzclose( gzf );
+ gzclose(gzf);
totpart = psys->totpart = activeParts;
- BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"readFsPartData::done - particles:%d, active:%d, file:%d, mask:%d \n", psys->totpart,activeParts,fileParts,readMask);
+ BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"readFsPartData::done - particles:%d, active:%d, file:%d, mask:%d\n", psys->totpart,activeParts,fileParts,readMask);
// bad level call
// XXX elbeemDebugOut(debugStrBuffer);
@@ -4107,7 +4153,7 @@ static int emit_particles(ParticleSimulationData *sim, PTCacheID *pid, float UNU
int oldtotpart = psys->totpart;
int totpart = tot_particles(psys, pid);
- if(totpart != oldtotpart)
+ if (totpart != oldtotpart)
realloc_particles(sim, totpart);
return totpart - oldtotpart;
@@ -4130,11 +4176,11 @@ static void system_step(ParticleSimulationData *sim, float cfra)
int startframe = 0, endframe = 100, oldtotpart = 0;
/* cache shouldn't be used for hair or "continue physics" */
- if(part->type != PART_HAIR && BKE_ptcache_get_continue_physics() == 0) {
+ if (part->type != PART_HAIR && BKE_ptcache_get_continue_physics() == 0) {
psys_clear_temp_pointcache(psys);
/* set suitable cache range automatically */
- if((cache->flag & (PTCACHE_BAKING|PTCACHE_BAKED))==0)
+ if ((cache->flag & (PTCACHE_BAKING|PTCACHE_BAKED))==0)
psys_get_pointcache_start_end(sim->scene, psys, &cache->startframe, &cache->endframe);
pid = &ptcacheid;
@@ -4143,7 +4189,7 @@ static void system_step(ParticleSimulationData *sim, float cfra)
BKE_ptcache_id_time(pid, sim->scene, 0.0f, &startframe, &endframe, NULL);
/* clear everythin on start frame */
- if(cfra == startframe) {
+ if (cfra == startframe) {
BKE_ptcache_id_reset(sim->scene, pid, PTCACHE_RESET_OUTDATED);
BKE_ptcache_validate(cache, startframe);
cache->flag &= ~PTCACHE_REDO_NEEDED;
@@ -4154,7 +4200,7 @@ static void system_step(ParticleSimulationData *sim, float cfra)
/* 1. emit particles and redo particles if needed */
oldtotpart = psys->totpart;
- if(emit_particles(sim, pid, cfra) || psys->recalc & PSYS_RECALC_RESET) {
+ if (emit_particles(sim, pid, cfra) || psys->recalc & PSYS_RECALC_RESET) {
distribute_particles(sim, part->from);
initialize_all_particles(sim);
/* reset only just created particles (on startframe all particles are recreated) */
@@ -4174,33 +4220,33 @@ static void system_step(ParticleSimulationData *sim, float cfra)
}
/* 2. try to read from the cache */
- if(pid) {
+ if (pid) {
int cache_result = BKE_ptcache_read(pid, cache_cfra);
- if(ELEM(cache_result, PTCACHE_READ_EXACT, PTCACHE_READ_INTERPOLATED)) {
+ if (ELEM(cache_result, PTCACHE_READ_EXACT, PTCACHE_READ_INTERPOLATED)) {
cached_step(sim, cfra);
update_children(sim);
psys_update_path_cache(sim, cfra);
BKE_ptcache_validate(cache, (int)cache_cfra);
- if(cache_result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED)
+ if (cache_result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED)
BKE_ptcache_write(pid, (int)cache_cfra);
return;
}
/* Cache is supposed to be baked, but no data was found so bail out */
- else if(cache->flag & PTCACHE_BAKED) {
+ else if (cache->flag & PTCACHE_BAKED) {
psys_reset(psys, PSYS_RESET_CACHE_MISS);
return;
}
- else if(cache_result == PTCACHE_READ_OLD) {
+ else if (cache_result == PTCACHE_READ_OLD) {
psys->cfra = (float)cache->simframe;
cached_step(sim, psys->cfra);
}
/* if on second frame, write cache for first frame */
- if(psys->cfra == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0))
+ if (psys->cfra == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0))
BKE_ptcache_write(pid, startframe);
}
else
@@ -4211,33 +4257,35 @@ static void system_step(ParticleSimulationData *sim, float cfra)
disp= (float)psys_get_current_display_percentage(psys)/100.0f;
LOOP_PARTICLES {
- if(PSYS_FRAND(p) > disp)
+ if (PSYS_FRAND(p) > disp)
pa->flag |= PARS_NO_DISP;
else
pa->flag &= ~PARS_NO_DISP;
}
- if(psys->totpart) {
+ if (psys->totpart) {
int dframe, totframesback = 0;
float t_frac, dt_frac;
/* handle negative frame start at the first frame by doing
* all the steps before the first frame */
- if((int)cfra == startframe && part->sta < startframe)
+ if ((int)cfra == startframe && part->sta < startframe)
totframesback = (startframe - (int)part->sta);
if (!(part->time_flag & PART_TIME_AUTOSF)) {
/* Constant time step */
psys->dt_frac = 1.0f / (float) (part->subframes + 1);
- } else if ((int)cfra == startframe) {
+ }
+ else if ((int)cfra == startframe) {
/* Variable time step; use a very conservative value at the start.
* If it doesn't need to be so small, it will quickly grow. */
psys->dt_frac = 1.0;
- } else if (psys->dt_frac < MIN_TIMESTEP) {
+ }
+ else if (psys->dt_frac < MIN_TIMESTEP) {
psys->dt_frac = MIN_TIMESTEP;
}
- for(dframe=-totframesback; dframe<=0; dframe++) {
+ for (dframe=-totframesback; dframe<=0; dframe++) {
/* simulate each subframe */
dt_frac = psys->dt_frac;
for (t_frac = dt_frac; t_frac <= 1.0f; t_frac += dt_frac) {
@@ -4254,16 +4302,16 @@ static void system_step(ParticleSimulationData *sim, float cfra)
}
/* 4. only write cache starting from second frame */
- if(pid) {
+ if (pid) {
BKE_ptcache_validate(cache, (int)cache_cfra);
- if((int)cache_cfra != startframe)
+ if ((int)cache_cfra != startframe)
BKE_ptcache_write(pid, (int)cache_cfra);
}
update_children(sim);
/* cleanup */
- if(psys->lattice) {
+ if (psys->lattice) {
end_latt_deform(psys->lattice);
psys->lattice= NULL;
}
@@ -4277,17 +4325,17 @@ static void psys_changed_type(ParticleSimulationData *sim)
BKE_ptcache_id_from_particles(&pid, sim->ob, sim->psys);
- if(part->phystype != PART_PHYS_KEYED)
+ if (part->phystype != PART_PHYS_KEYED)
sim->psys->flag &= ~PSYS_KEYED;
- if(part->type == PART_HAIR) {
- if(ELEM4(part->ren_as, PART_DRAW_NOT, PART_DRAW_PATH, PART_DRAW_OB, PART_DRAW_GR)==0)
+ if (part->type == PART_HAIR) {
+ if (ELEM4(part->ren_as, PART_DRAW_NOT, PART_DRAW_PATH, PART_DRAW_OB, PART_DRAW_GR)==0)
part->ren_as = PART_DRAW_PATH;
- if(part->distr == PART_DISTR_GRID)
+ if (part->distr == PART_DISTR_GRID)
part->distr = PART_DISTR_JIT;
- if(ELEM3(part->draw_as, PART_DRAW_NOT, PART_DRAW_REND, PART_DRAW_PATH)==0)
+ if (ELEM3(part->draw_as, PART_DRAW_NOT, PART_DRAW_REND, PART_DRAW_PATH)==0)
part->draw_as = PART_DRAW_REND;
CLAMP(part->path_start, 0.0f, 100.0f);
@@ -4311,18 +4359,18 @@ void psys_check_boid_data(ParticleSystem *psys)
pa = psys->particles;
- if(!pa)
+ if (!pa)
return;
- if(psys->part && psys->part->phystype==PART_PHYS_BOIDS) {
- if(!pa->boid) {
+ if (psys->part && psys->part->phystype==PART_PHYS_BOIDS) {
+ if (!pa->boid) {
bpa = MEM_callocN(psys->totpart * sizeof(BoidParticle), "Boid Data");
LOOP_PARTICLES
pa->boid = bpa++;
}
}
- else if(pa->boid) {
+ else if (pa->boid) {
MEM_freeN(pa->boid);
LOOP_PARTICLES
pa->boid = NULL;
@@ -4351,7 +4399,7 @@ static void psys_prepare_physics(ParticleSimulationData *sim)
{
ParticleSettings *part = sim->psys->part;
- if(ELEM(part->phystype, PART_PHYS_NO, PART_PHYS_KEYED)) {
+ if (ELEM(part->phystype, PART_PHYS_NO, PART_PHYS_KEYED)) {
PTCacheID pid;
BKE_ptcache_id_from_particles(&pid, sim->ob, sim->psys);
BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_ALL, 0);
@@ -4361,7 +4409,7 @@ static void psys_prepare_physics(ParticleSimulationData *sim)
sim->psys->flag &= ~PSYS_KEYED;
}
- if(part->phystype == PART_PHYS_BOIDS && part->boids == NULL) {
+ if (part->phystype == PART_PHYS_BOIDS && part->boids == NULL) {
BoidState *state;
part->boids = MEM_callocN(sizeof(BoidSettings), "Boid Settings");
@@ -4376,7 +4424,7 @@ static void psys_prepare_physics(ParticleSimulationData *sim)
state->flag |= BOIDSTATE_CURRENT;
BLI_addtail(&part->boids->states, state);
}
- else if(part->phystype == PART_PHYS_FLUID && part->fluid == NULL) {
+ else if (part->phystype == PART_PHYS_FLUID && part->fluid == NULL) {
part->fluid = MEM_callocN(sizeof(SPHFluidSettings), "SPH Fluid Settings");
fluid_default_settings(part);
}
@@ -4385,7 +4433,7 @@ static void psys_prepare_physics(ParticleSimulationData *sim)
}
static int hair_needs_recalc(ParticleSystem *psys)
{
- if(!(psys->flag & PSYS_EDITED) && (!psys->edit || !psys->edit->edited) &&
+ if (!(psys->flag & PSYS_EDITED) && (!psys->edit || !psys->edit->edited) &&
((psys->flag & PSYS_HAIR_DONE)==0 || psys->recalc & PSYS_RECALC_RESET || (psys->part->flag & PART_HAIR_REGROW && !psys->edit))) {
return 1;
}
@@ -4402,9 +4450,9 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
float cfra;
/* drawdata is outdated after ANY change */
- if(psys->pdd) psys->pdd->flag &= ~PARTICLE_DRAW_DATA_UPDATED;
+ if (psys->pdd) psys->pdd->flag &= ~PARTICLE_DRAW_DATA_UPDATED;
- if(!psys_check_enabled(ob, psys))
+ if (!psys_check_enabled(ob, psys))
return;
cfra= BKE_curframe(scene);
@@ -4415,14 +4463,14 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
sim.psmd= psys_get_modifier(ob, psys);
/* system was already updated from modifier stack */
- if(sim.psmd->flag & eParticleSystemFlag_psys_updated) {
+ if (sim.psmd->flag & eParticleSystemFlag_psys_updated) {
sim.psmd->flag &= ~eParticleSystemFlag_psys_updated;
/* make sure it really was updated to cfra */
- if(psys->cfra == cfra)
+ if (psys->cfra == cfra)
return;
}
- if(!sim.psmd->dm)
+ if (!sim.psmd->dm)
return;
if (part->from != PART_FROM_VERT) {
@@ -4432,10 +4480,13 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
/* execute drivers only, as animation has already been done */
BKE_animsys_evaluate_animdata(scene, &part->id, part->adt, cfra, ADT_RECALC_DRIVERS);
- if(psys->recalc & PSYS_RECALC_TYPE)
+ /* to verify if we need to restore object afterwards */
+ psys->flag &= ~PSYS_OB_ANIM_RESTORE;
+
+ if (psys->recalc & PSYS_RECALC_TYPE)
psys_changed_type(&sim);
- if(psys->recalc & PSYS_RECALC_RESET)
+ if (psys->recalc & PSYS_RECALC_RESET)
psys->totunexist = 0;
/* setup necessary physics type dependent additional data if it doesn't yet exist */
@@ -4445,19 +4496,19 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
case PART_HAIR:
{
/* nothing to do so bail out early */
- if(psys->totpart == 0 && part->totpart == 0) {
+ if (psys->totpart == 0 && part->totpart == 0) {
psys_free_path_cache(psys, NULL);
free_hair(ob, psys, 0);
psys->flag |= PSYS_HAIR_DONE;
}
/* (re-)create hair */
- else if(hair_needs_recalc(psys)) {
+ else if (hair_needs_recalc(psys)) {
float hcfra=0.0f;
int i, recalc = psys->recalc;
free_hair(ob, psys, 0);
- if(psys->edit && psys->free_edit) {
+ if (psys->edit && psys->free_edit) {
psys->free_edit(psys->edit);
psys->edit = NULL;
psys->free_edit = NULL;
@@ -4466,9 +4517,9 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
/* first step is negative so particles get killed and reset */
psys->cfra= 1.0f;
- for(i=0; i<=part->hair_step; i++) {
+ for (i=0; i<=part->hair_step; i++) {
hcfra=100.0f*(float)i/(float)psys->part->hair_step;
- if((part->flag & PART_HAIR_REGROW)==0)
+ if ((part->flag & PART_HAIR_REGROW)==0)
BKE_animsys_evaluate_animdata(scene, &part->id, part->adt, hcfra, ADT_RECALC_ANIM);
system_step(&sim, hcfra);
psys->cfra = hcfra;
@@ -4479,10 +4530,10 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
psys->flag |= PSYS_HAIR_DONE;
psys->recalc = recalc;
}
- else if(psys->flag & PSYS_EDITED)
+ else if (psys->flag & PSYS_EDITED)
psys->flag |= PSYS_HAIR_DONE;
- if(psys->flag & PSYS_HAIR_DONE)
+ if (psys->flag & PSYS_HAIR_DONE)
hair_step(&sim, cfra);
break;
}
@@ -4501,10 +4552,10 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
float disp = (float)psys_get_current_display_percentage(psys)/100.0f;
/* Particles without dynamics haven't been reset yet because they don't use pointcache */
- if(psys->recalc & PSYS_RECALC_RESET)
+ if (psys->recalc & PSYS_RECALC_RESET)
psys_reset(psys, PSYS_RESET_ALL);
- if(emit_particles(&sim, NULL, cfra) || (psys->recalc & PSYS_RECALC_RESET)) {
+ if (emit_particles(&sim, NULL, cfra) || (psys->recalc & PSYS_RECALC_RESET)) {
free_keyed_keys(psys);
distribute_particles(&sim, part->from);
initialize_all_particles(&sim);
@@ -4515,18 +4566,18 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
LOOP_EXISTING_PARTICLES {
pa->size = part->size;
- if(part->randsize > 0.0f)
+ if (part->randsize > 0.0f)
pa->size *= 1.0f - part->randsize * PSYS_FRAND(p + 1);
reset_particle(&sim, pa, 0.0, cfra);
- if(PSYS_FRAND(p) > disp)
+ if (PSYS_FRAND(p) > disp)
pa->flag |= PARS_NO_DISP;
else
pa->flag &= ~PARS_NO_DISP;
}
- if(part->phystype == PART_PHYS_KEYED) {
+ if (part->phystype == PART_PHYS_KEYED) {
psys_count_keyed_targets(&sim);
set_keyed_keys(&sim);
psys_update_path_cache(&sim,(int)cfra);
@@ -4544,21 +4595,23 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
}
}
- if(psys->cfra < cfra) {
- /* make sure emitter is left at correct time (particle emission can change this) */
- while(ob) {
+ /* make sure emitter is left at correct time (particle emission can change this) */
+ if (psys->flag & PSYS_OB_ANIM_RESTORE) {
+ while (ob) {
BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, cfra, ADT_RECALC_ANIM);
ob = ob->parent;
}
ob = sim.ob;
where_is_object_time(scene, ob, cfra);
+
+ psys->flag &= ~PSYS_OB_ANIM_RESTORE;
}
psys->cfra = cfra;
psys->recalc = 0;
/* save matrix for duplicators, at rendertime the actual dupliobject's matrix is used so don't update! */
- if(psys->renderdata==0)
+ if (psys->renderdata==0)
invert_m4_m4(psys->imat, ob->obmat);
}
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 705f198865a..a383fac07c9 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -74,7 +74,9 @@
#include "BIK_api.h"
/* both in intern */
+#ifdef WITH_SMOKE
#include "smoke_API.h"
+#endif
#ifdef WITH_LZO
#include "minilzo.h"
@@ -90,15 +92,15 @@
/* needed for directory lookup */
/* untitled blend's need getpid for a unique name */
#ifndef WIN32
- #include <dirent.h>
-#include <unistd.h>
+# include <dirent.h>
+# include <unistd.h>
#else
-#include <process.h>
- #include "BLI_winstuff.h"
+# include <process.h>
+# include "BLI_winstuff.h"
#endif
-#define PTCACHE_DATA_FROM(data, type, from) if(data[type]) { memcpy(data[type], from, ptcache_data_size[type]); }
-#define PTCACHE_DATA_TO(data, type, index, to) if(data[type]) { memcpy(to, (char*)data[type] + (index ? index * ptcache_data_size[type] : 0), ptcache_data_size[type]); }
+#define PTCACHE_DATA_FROM(data, type, from) if (data[type]) { memcpy(data[type], from, ptcache_data_size[type]); }
+#define PTCACHE_DATA_TO(data, type, index, to) if (data[type]) { memcpy(to, (char*)data[type] + (index ? index * ptcache_data_size[type] : 0), ptcache_data_size[type]); }
/* could be made into a pointcache option */
#define DURIAN_POINTCACHE_LIB_OK 1
@@ -131,10 +133,10 @@ static int ptcache_basic_header_read(PTCacheFile *pf)
int error=0;
/* Custom functions should read these basic elements too! */
- if(!error && !fread(&pf->totpoint, sizeof(unsigned int), 1, pf->fp))
+ if (!error && !fread(&pf->totpoint, sizeof(unsigned int), 1, pf->fp))
error = 1;
- if(!error && !fread(&pf->data_types, sizeof(unsigned int), 1, pf->fp))
+ if (!error && !fread(&pf->data_types, sizeof(unsigned int), 1, pf->fp))
error = 1;
return !error;
@@ -142,10 +144,10 @@ static int ptcache_basic_header_read(PTCacheFile *pf)
static int ptcache_basic_header_write(PTCacheFile *pf)
{
/* Custom functions should write these basic elements too! */
- if(!fwrite(&pf->totpoint, sizeof(unsigned int), 1, pf->fp))
+ if (!fwrite(&pf->totpoint, sizeof(unsigned int), 1, pf->fp))
return 0;
- if(!fwrite(&pf->data_types, sizeof(unsigned int), 1, pf->fp))
+ if (!fwrite(&pf->data_types, sizeof(unsigned int), 1, pf->fp))
return 0;
return 1;
@@ -166,7 +168,7 @@ static void ptcache_softbody_read(int index, void *soft_v, void **data, float UN
SoftBody *soft= soft_v;
BodyPoint *bp = soft->bpoint + index;
- if(old_data) {
+ if (old_data) {
memcpy(bp->pos, data, 3 * sizeof(float));
memcpy(bp->vec, data + 3, 3 * sizeof(float));
}
@@ -182,13 +184,13 @@ static void ptcache_softbody_interpolate(int index, void *soft_v, void **data, f
ParticleKey keys[4];
float dfra;
- if(cfra1 == cfra2)
+ if (cfra1 == cfra2)
return;
copy_v3_v3(keys[1].co, bp->pos);
copy_v3_v3(keys[1].vel, bp->vec);
- if(old_data) {
+ if (old_data) {
memcpy(keys[2].co, old_data, 3 * sizeof(float));
memcpy(keys[2].vel, old_data + 3, 3 * sizeof(float));
}
@@ -219,7 +221,7 @@ void BKE_ptcache_make_particle_key(ParticleKey *key, int index, void **data, flo
PTCACHE_DATA_TO(data, BPHYS_DATA_VELOCITY, index, key->vel);
/* no rotation info, so make something nice up */
- if(data[BPHYS_DATA_ROTATION]==NULL) {
+ if (data[BPHYS_DATA_ROTATION]==NULL) {
vec_to_quat( key->rot, key->vel, OB_NEGX, OB_POSZ);
}
else {
@@ -238,7 +240,7 @@ static int ptcache_particle_write(int index, void *psys_v, void **data, int cfr
int step = psys->pointcache->step;
/* No need to store unborn or died particles outside cache step bounds */
- if(data[BPHYS_DATA_INDEX] && (cfra < pa->time - step || cfra > pa->dietime + step))
+ if (data[BPHYS_DATA_INDEX] && (cfra < pa->time - step || cfra > pa->dietime + step))
return 0;
times[0]= pa->time;
@@ -253,7 +255,7 @@ static int ptcache_particle_write(int index, void *psys_v, void **data, int cfr
PTCACHE_DATA_FROM(data, BPHYS_DATA_SIZE, &pa->size);
PTCACHE_DATA_FROM(data, BPHYS_DATA_TIMES, times);
- if(boid)
+ if (boid)
PTCACHE_DATA_FROM(data, BPHYS_DATA_BOIDS, &boid->data);
/* return flag 1+1=2 for newly born particles to copy exact birth location to previously cached frame */
@@ -266,16 +268,16 @@ static void ptcache_particle_read(int index, void *psys_v, void **data, float cf
BoidParticle *boid;
float timestep = 0.04f*psys->part->timetweak;
- if(index >= psys->totpart)
+ if (index >= psys->totpart)
return;
pa = psys->particles + index;
boid = (psys->part->phystype == PART_PHYS_BOIDS) ? pa->boid : NULL;
- if(cfra > pa->state.time)
+ if (cfra > pa->state.time)
memcpy(&pa->prev_state, &pa->state, sizeof(ParticleKey));
- if(old_data) {
+ if (old_data) {
/* old format cache */
memcpy(&pa->state, old_data, sizeof(ParticleKey));
return;
@@ -284,15 +286,15 @@ static void ptcache_particle_read(int index, void *psys_v, void **data, float cf
BKE_ptcache_make_particle_key(&pa->state, 0, data, cfra);
/* set frames cached before birth to birth time */
- if(cfra < pa->time)
+ if (cfra < pa->time)
pa->state.time = pa->time;
- else if(cfra > pa->dietime)
+ else if (cfra > pa->dietime)
pa->state.time = pa->dietime;
- if(data[BPHYS_DATA_SIZE])
+ if (data[BPHYS_DATA_SIZE])
PTCACHE_DATA_TO(data, BPHYS_DATA_SIZE, 0, &pa->size);
- if(data[BPHYS_DATA_TIMES]) {
+ if (data[BPHYS_DATA_TIMES]) {
float times[3];
PTCACHE_DATA_TO(data, BPHYS_DATA_TIMES, 0, &times);
pa->time = times[0];
@@ -300,12 +302,12 @@ static void ptcache_particle_read(int index, void *psys_v, void **data, float cf
pa->lifetime = times[2];
}
- if(boid)
+ if (boid)
PTCACHE_DATA_TO(data, BPHYS_DATA_BOIDS, 0, &boid->data);
/* determine velocity from previous location */
- if(data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_VELOCITY]) {
- if(cfra > pa->prev_state.time) {
+ if (data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_VELOCITY]) {
+ if (cfra > pa->prev_state.time) {
sub_v3_v3v3(pa->state.vel, pa->state.co, pa->prev_state.co);
mul_v3_fl(pa->state.vel, (cfra - pa->prev_state.time) * timestep);
}
@@ -315,9 +317,10 @@ static void ptcache_particle_read(int index, void *psys_v, void **data, float cf
}
}
- /* determine rotation from velocity */
- if(data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_ROTATION]) {
- vec_to_quat( pa->state.rot,pa->state.vel, OB_NEGX, OB_POSZ);
+ /* default to no rotation */
+ if (data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_ROTATION]) {
+ pa->state.rot[0]=1.0f;
+ pa->state.rot[1]=pa->state.rot[2]=pa->state.rot[3]=0;
}
}
static void ptcache_particle_interpolate(int index, void *psys_v, void **data, float cfra, float cfra1, float cfra2, float *old_data)
@@ -327,31 +330,31 @@ static void ptcache_particle_interpolate(int index, void *psys_v, void **data, f
ParticleKey keys[4];
float dfra, timestep = 0.04f*psys->part->timetweak;
- if(index >= psys->totpart)
+ if (index >= psys->totpart)
return;
pa = psys->particles + index;
/* particle wasn't read from first cache so can't interpolate */
- if((int)cfra1 < pa->time - psys->pointcache->step || (int)cfra1 > pa->dietime + psys->pointcache->step)
+ if ((int)cfra1 < pa->time - psys->pointcache->step || (int)cfra1 > pa->dietime + psys->pointcache->step)
return;
cfra = MIN2(cfra, pa->dietime);
cfra1 = MIN2(cfra1, pa->dietime);
cfra2 = MIN2(cfra2, pa->dietime);
- if(cfra1 == cfra2)
+ if (cfra1 == cfra2)
return;
memcpy(keys+1, &pa->state, sizeof(ParticleKey));
- if(old_data)
+ if (old_data)
memcpy(keys+2, old_data, sizeof(ParticleKey));
else
BKE_ptcache_make_particle_key(keys+2, 0, data, cfra2);
/* determine velocity from previous location */
- if(data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_VELOCITY]) {
- if(keys[1].time > keys[2].time) {
+ if (data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_VELOCITY]) {
+ if (keys[1].time > keys[2].time) {
sub_v3_v3v3(keys[2].vel, keys[1].co, keys[2].co);
mul_v3_fl(keys[2].vel, (keys[1].time - keys[2].time) * timestep);
}
@@ -362,11 +365,11 @@ static void ptcache_particle_interpolate(int index, void *psys_v, void **data, f
}
/* determine rotation from velocity */
- if(data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_ROTATION]) {
+ if (data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_ROTATION]) {
vec_to_quat( keys[2].rot,keys[2].vel, OB_NEGX, OB_POSZ);
}
- if(cfra > pa->time)
+ if (cfra > pa->time)
cfra1 = MAX2(cfra1, pa->time);
dfra = cfra2 - cfra1;
@@ -394,10 +397,10 @@ static int ptcache_particle_totwrite(void *psys_v, int cfra)
int p, step = psys->pointcache->step;
int totwrite = 0;
- if(cfra == 0)
+ if (cfra == 0)
return psys->totpart;
- for(p=0; p<psys->totpart; p++,pa++)
+ for (p=0; p<psys->totpart; p++,pa++)
totwrite += (cfra >= pa->time - step && cfra <= pa->dietime + step);
return totwrite;
@@ -408,7 +411,7 @@ static void ptcache_particle_extra_write(void *psys_v, PTCacheMem *pm, int UNUSE
ParticleSystem *psys = psys_v;
PTCacheExtra *extra = NULL;
- if(psys->part->phystype == PART_PHYS_FLUID &&
+ if (psys->part->phystype == PART_PHYS_FLUID &&
psys->part->fluid && psys->part->fluid->flag & SPH_VISCOELASTIC_SPRINGS &&
psys->tot_fluidsprings && psys->fluid_springs) {
@@ -429,11 +432,11 @@ static void ptcache_particle_extra_read(void *psys_v, PTCacheMem *pm, float UNUS
ParticleSystem *psys = psys_v;
PTCacheExtra *extra = pm->extradata.first;
- for(; extra; extra=extra->next) {
+ for (; extra; extra=extra->next) {
switch(extra->type) {
case BPHYS_EXTRA_FLUID_SPRINGS:
{
- if(psys->fluid_springs)
+ if (psys->fluid_springs)
MEM_freeN(psys->fluid_springs);
psys->fluid_springs = MEM_dupallocN(extra->data);
@@ -463,7 +466,7 @@ static void ptcache_cloth_read(int index, void *cloth_v, void **data, float UNUS
Cloth *cloth= clmd->clothObject;
ClothVertex *vert = cloth->verts + index;
- if(old_data) {
+ if (old_data) {
memcpy(vert->x, data, 3 * sizeof(float));
memcpy(vert->xconst, data + 3, 3 * sizeof(float));
memcpy(vert->v, data + 6, 3 * sizeof(float));
@@ -482,13 +485,13 @@ static void ptcache_cloth_interpolate(int index, void *cloth_v, void **data, flo
ParticleKey keys[4];
float dfra;
- if(cfra1 == cfra2)
+ if (cfra1 == cfra2)
return;
copy_v3_v3(keys[1].co, vert->x);
copy_v3_v3(keys[1].vel, vert->v);
- if(old_data) {
+ if (old_data) {
memcpy(keys[2].co, old_data, 3 * sizeof(float));
memcpy(keys[2].vel, old_data + 6, 3 * sizeof(float));
}
@@ -523,7 +526,7 @@ static int ptcache_smoke_totpoint(void *smoke_v, int UNUSED(cfra))
SmokeModifierData *smd= (SmokeModifierData *)smoke_v;
SmokeDomainSettings *sds = smd->domain;
- if(sds->fluid) {
+ if (sds->fluid) {
return sds->res[0]*sds->res[1]*sds->res[2];
}
else
@@ -535,7 +538,7 @@ static int ptcache_smoke_write(PTCacheFile *pf, void *smoke_v)
SmokeDomainSettings *sds = smd->domain;
int ret = 0;
- if(sds->fluid) {
+ if (sds->fluid) {
size_t res = sds->res[0]*sds->res[1]*sds->res[2];
float dt, dx, *dens, *densold, *heat, *heatold, *vx, *vy, *vz, *vxold, *vyold, *vzold;
unsigned char *obstacles;
@@ -567,7 +570,7 @@ static int ptcache_smoke_write(PTCacheFile *pf, void *smoke_v)
ret = 1;
}
- if(sds->wt) {
+ if (sds->wt) {
int res_big_array[3];
int res_big;
int res = sds->res[0]*sds->res[1]*sds->res[2];
@@ -608,7 +611,7 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
SmokeModifierData *smd= (SmokeModifierData *)smoke_v;
SmokeDomainSettings *sds = smd->domain;
- if(sds->fluid) {
+ if (sds->fluid) {
size_t res = sds->res[0]*sds->res[1]*sds->res[2];
float dt, dx, *dens, *densold, *heat, *heatold, *vx, *vy, *vz, *vxold, *vyold, *vzold;
unsigned char *obstacles;
@@ -631,7 +634,7 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
ptcache_file_read(pf, &dt, 1, sizeof(float));
ptcache_file_read(pf, &dx, 1, sizeof(float));
- if(pf->data_types & (1<<BPHYS_DATA_SMOKE_HIGH) && sds->wt) {
+ if (pf->data_types & (1<<BPHYS_DATA_SMOKE_HIGH) && sds->wt) {
int res = sds->res[0]*sds->res[1]*sds->res[2];
int res_big, res_big_array[3];
float *dens, *densold, *tcu, *tcv, *tcw;
@@ -679,7 +682,7 @@ static int ptcache_dynamicpaint_write(PTCacheFile *pf, void *dp_v)
/* version header */
ptcache_file_write(pf, DPAINT_CACHE_VERSION, 1, sizeof(char)*4);
- if(surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ && surface->data) {
+ if (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ && surface->data) {
int total_points=surface->data->total_points;
unsigned int in_len;
unsigned char *out;
@@ -713,7 +716,7 @@ static int ptcache_dynamicpaint_read(PTCacheFile *pf, void *dp_v)
ptcache_file_read(pf, version, 1, sizeof(char)*4);
if (strncmp(version, DPAINT_CACHE_VERSION,4)) {printf("Dynamic Paint: Invalid cache version: %s!\n",version); return 0;}
- if(surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ && surface->data) {
+ if (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ && surface->data) {
unsigned int data_len;
int surface_type;
@@ -786,7 +789,7 @@ void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *p
pid->cache_ptr= &psys->pointcache;
pid->ptcaches= &psys->ptcaches;
- if(psys->part->type != PART_HAIR)
+ if (psys->part->type != PART_HAIR)
pid->flag |= PTCACHE_VEL_PER_SEC;
pid->totpoint = ptcache_particle_totpoint;
@@ -808,20 +811,21 @@ void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *p
pid->data_types = (1<<BPHYS_DATA_LOCATION) | (1<<BPHYS_DATA_VELOCITY) | (1<<BPHYS_DATA_INDEX);
- if(psys->part->phystype == PART_PHYS_BOIDS)
+ if (psys->part->phystype == PART_PHYS_BOIDS)
pid->data_types|= (1<<BPHYS_DATA_AVELOCITY) | (1<<BPHYS_DATA_ROTATION) | (1<<BPHYS_DATA_BOIDS);
- else if(psys->part->phystype == PART_PHYS_FLUID && psys->part->fluid && psys->part->fluid->flag & SPH_VISCOELASTIC_SPRINGS) {
+ else if (psys->part->phystype == PART_PHYS_FLUID && psys->part->fluid && psys->part->fluid->flag & SPH_VISCOELASTIC_SPRINGS) {
pid->write_extra_data = ptcache_particle_extra_write;
pid->read_extra_data = ptcache_particle_extra_read;
}
- if(psys->part->rotmode!=PART_ROT_VEL
- || psys->part->avemode!=PART_AVE_SPIN || psys->part->avefac!=0.0f)
- pid->data_types|= (1<<BPHYS_DATA_AVELOCITY) | (1<<BPHYS_DATA_ROTATION);
-
- if(psys->part->flag & PART_ROT_DYN)
+ if (psys->part->flag & PART_ROTATIONS) {
pid->data_types|= (1<<BPHYS_DATA_ROTATION);
+ if (psys->part->rotmode!=PART_ROT_VEL
+ || psys->part->avemode==PART_AVE_RAND || psys->part->avefac!=0.0f)
+ pid->data_types|= (1<<BPHYS_DATA_AVELOCITY);
+ }
+
pid->info_types= (1<<BPHYS_DATA_TIMES);
pid->default_step = 10;
@@ -895,9 +899,9 @@ void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeMo
pid->data_types= 0;
pid->info_types= 0;
- if(sds->fluid)
+ if (sds->fluid)
pid->data_types |= (1<<BPHYS_DATA_SMOKE_LOW);
- if(sds->wt)
+ if (sds->wt)
pid->data_types |= (1<<BPHYS_DATA_SMOKE_HIGH);
pid->default_step = 1;
@@ -948,25 +952,25 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup
lb->first= lb->last= NULL;
- if(ob->soft) {
+ if (ob->soft) {
pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID");
BKE_ptcache_id_from_softbody(pid, ob, ob->soft);
BLI_addtail(lb, pid);
}
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- if(psys->part==NULL)
+ for (psys=ob->particlesystem.first; psys; psys=psys->next) {
+ if (psys->part==NULL)
continue;
/* check to make sure point cache is actually used by the particles */
- if(ELEM(psys->part->phystype, PART_PHYS_NO, PART_PHYS_KEYED))
+ if (ELEM(psys->part->phystype, PART_PHYS_NO, PART_PHYS_KEYED))
continue;
/* hair needs to be included in id-list for cache edit mode to work */
- /* if(psys->part->type == PART_HAIR && (psys->flag & PSYS_HAIR_DYNAMICS)==0) */
+ /* if (psys->part->type == PART_HAIR && (psys->flag & PSYS_HAIR_DYNAMICS)==0) */
/* continue; */
- if(psys->part->type == PART_FLUID)
+ if (psys->part->type == PART_FLUID)
continue;
pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID");
@@ -974,24 +978,24 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup
BLI_addtail(lb, pid);
}
- for(md=ob->modifiers.first; md; md=md->next) {
- if(md->type == eModifierType_Cloth) {
+ for (md=ob->modifiers.first; md; md=md->next) {
+ if (md->type == eModifierType_Cloth) {
pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID");
BKE_ptcache_id_from_cloth(pid, ob, (ClothModifierData*)md);
BLI_addtail(lb, pid);
}
- else if(md->type == eModifierType_Smoke) {
+ else if (md->type == eModifierType_Smoke) {
SmokeModifierData *smd = (SmokeModifierData *)md;
- if(smd->type & MOD_SMOKE_TYPE_DOMAIN)
+ if (smd->type & MOD_SMOKE_TYPE_DOMAIN)
{
pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID");
BKE_ptcache_id_from_smoke(pid, ob, (SmokeModifierData*)md);
BLI_addtail(lb, pid);
}
}
- else if(md->type == eModifierType_DynamicPaint) {
+ else if (md->type == eModifierType_DynamicPaint) {
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
- if(pmd->canvas)
+ if (pmd->canvas)
{
DynamicPaintSurface *surface = pmd->canvas->surfaces.first;
@@ -1004,17 +1008,17 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup
}
}
- if(scene && (duplis-- > 0) && (ob->transflag & OB_DUPLI)) {
+ if (scene && (duplis-- > 0) && (ob->transflag & OB_DUPLI)) {
ListBase *lb_dupli_ob;
- if((lb_dupli_ob=object_duplilist(scene, ob))) {
+ if ((lb_dupli_ob=object_duplilist(scene, ob))) {
DupliObject *dob;
- for(dob= lb_dupli_ob->first; dob; dob= dob->next) {
- if(dob->ob != ob) { /* avoids recursive loops with dupliframes: bug 22988 */
+ for (dob= lb_dupli_ob->first; dob; dob= dob->next) {
+ if (dob->ob != ob) { /* avoids recursive loops with dupliframes: bug 22988 */
ListBase lb_dupli_pid;
BKE_ptcache_ids_from_object(&lb_dupli_pid, dob->ob, scene, duplis);
BLI_movelisttolist(lb, &lb_dupli_pid);
- if(lb_dupli_pid.first)
+ if (lb_dupli_pid.first)
printf("Adding Dupli\n");
}
}
@@ -1026,11 +1030,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)
@@ -1041,16 +1045,16 @@ static int ptcache_path(PTCacheID *pid, char *filename)
const char *blendfilename= (lib && (pid->cache->flag & PTCACHE_IGNORE_LIBPATH)==0) ? lib->filepath: G.main->name;
size_t i;
- if(pid->cache->flag & PTCACHE_EXTERNAL) {
+ if (pid->cache->flag & PTCACHE_EXTERNAL) {
strcpy(filename, pid->cache->path);
- if(strncmp(filename, "//", 2)==0)
+ if (strncmp(filename, "//", 2)==0)
BLI_path_abs(filename, blendfilename);
return BLI_add_slash(filename); /* new strlen() */
}
else if (G.relbase_valid || lib) {
- char file[MAX_PTCACHE_PATH]; /* we dont want the dir, only the file */
+ char file[MAX_PTCACHE_PATH]; /* we don't want the dir, only the file */
BLI_split_file_part(blendfilename, file, sizeof(file));
i = strlen(file);
@@ -1086,10 +1090,10 @@ static int ptcache_filename(PTCacheID *pid, char *filename, int cfra, short do_p
len = ptcache_path(pid, filename);
newname += len;
}
- if(pid->cache->name[0] == '\0' && (pid->cache->flag & PTCACHE_EXTERNAL)==0) {
+ if (pid->cache->name[0] == '\0' && (pid->cache->flag & PTCACHE_EXTERNAL)==0) {
idname = (pid->ob->id.name+2);
/* convert chars to hex so they are always a valid filename */
- while('\0' != *idname) {
+ while ('\0' != *idname) {
BLI_snprintf(newname, MAX_PTCACHE_FILE, "%02X", (char)(*idname++));
newname+=2;
len += 2;
@@ -1104,11 +1108,11 @@ static int ptcache_filename(PTCacheID *pid, char *filename, int cfra, short do_p
if (do_ext) {
- if(pid->cache->index < 0)
+ if (pid->cache->index < 0)
pid->cache->index = pid->stack_index = object_insert_ptcache(pid->ob);
- if(pid->cache->flag & PTCACHE_EXTERNAL) {
- if(pid->cache->index >= 0)
+ if (pid->cache->flag & PTCACHE_EXTERNAL) {
+ if (pid->cache->index >= 0)
BLI_snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02u"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */
else
BLI_snprintf(newname, MAX_PTCACHE_FILE, "_%06d"PTCACHE_EXT, cfra); /* always 6 chars */
@@ -1131,7 +1135,7 @@ static PTCacheFile *ptcache_file_open(PTCacheID *pid, int mode, int cfra)
#ifndef DURIAN_POINTCACHE_LIB_OK
/* don't allow writing for linked objects */
- if(pid->ob->id.lib && mode == PTCACHE_FILE_WRITE)
+ if (pid->ob->id.lib && mode == PTCACHE_FILE_WRITE)
return NULL;
#endif
if (!G.relbase_valid && (pid->cache->flag & PTCACHE_EXTERNAL)==0) return NULL; /* save blend file before using disk pointcache */
@@ -1142,13 +1146,15 @@ static PTCacheFile *ptcache_file_open(PTCacheID *pid, int mode, int cfra)
if (!BLI_exists(filename)) {
return NULL;
}
- fp = fopen(filename, "rb");
- } else if (mode==PTCACHE_FILE_WRITE) {
+ fp = BLI_fopen(filename, "rb");
+ }
+ else if (mode==PTCACHE_FILE_WRITE) {
BLI_make_existing_file(filename); /* will create the dir if needs be, same as //textures is created */
- fp = fopen(filename, "wb");
- } else if (mode==PTCACHE_FILE_UPDATE) {
+ fp = BLI_fopen(filename, "wb");
+ }
+ else if (mode==PTCACHE_FILE_UPDATE) {
BLI_make_existing_file(filename);
- fp = fopen(filename, "rb+");
+ fp = BLI_fopen(filename, "rb+");
}
if (!fp)
@@ -1163,7 +1169,7 @@ static PTCacheFile *ptcache_file_open(PTCacheID *pid, int mode, int cfra)
}
static void ptcache_file_close(PTCacheFile *pf)
{
- if(pf) {
+ if (pf) {
fclose(pf->fp);
MEM_freeN(pf);
}
@@ -1181,22 +1187,22 @@ static int ptcache_file_compressed_read(PTCacheFile *pf, unsigned char *result,
unsigned char *props = MEM_callocN(16*sizeof(char), "tmp");
ptcache_file_read(pf, &compressed, 1, sizeof(unsigned char));
- if(compressed) {
+ if (compressed) {
unsigned int size;
ptcache_file_read(pf, &size, 1, sizeof(unsigned int));
in_len = (size_t)size;
- if(in_len==0) {
+ if (in_len==0) {
/* do nothing */
}
else {
in = (unsigned char *)MEM_callocN(sizeof(unsigned char)*in_len, "pointcache_compressed_buffer");
ptcache_file_read(pf, in, in_len, sizeof(unsigned char));
#ifdef WITH_LZO
- if(compressed == 1)
+ if (compressed == 1)
r = lzo1x_decompress_safe(in, (lzo_uint)in_len, result, (lzo_uint *)&out_len, NULL);
#endif
#ifdef WITH_LZMA
- if(compressed == 2)
+ if (compressed == 2)
{
size_t sizeOfIt;
size_t leni = in_len, leno = out_len;
@@ -1229,7 +1235,7 @@ static int ptcache_file_compressed_write(PTCacheFile *pf, unsigned char *in, uns
#ifdef WITH_LZO
out_len= LZO_OUT_LEN(in_len);
- if(mode == 1) {
+ if (mode == 1) {
LZO_HEAP_ALLOC(wrkmem, LZO1X_MEM_COMPRESS);
r = lzo1x_1_compress(in, (lzo_uint)in_len, out, (lzo_uint *)&out_len, wrkmem);
@@ -1240,12 +1246,12 @@ static int ptcache_file_compressed_write(PTCacheFile *pf, unsigned char *in, uns
}
#endif
#ifdef WITH_LZMA
- if(mode == 2) {
+ if (mode == 2) {
r = LzmaCompress(out, &out_len, in, in_len,//assume sizeof(char)==1....
props, &sizeOfIt, 5, 1 << 24, 3, 0, 2, 32, 2);
- if(!(r == SZ_OK) || (out_len >= in_len))
+ if (!(r == SZ_OK) || (out_len >= in_len))
compressed = 0;
else
compressed = 2;
@@ -1253,7 +1259,7 @@ static int ptcache_file_compressed_write(PTCacheFile *pf, unsigned char *in, uns
#endif
ptcache_file_write(pf, &compressed, 1, sizeof(unsigned char));
- if(compressed) {
+ if (compressed) {
unsigned int size = out_len;
ptcache_file_write(pf, &size, 1, sizeof(unsigned int));
ptcache_file_write(pf, out, out_len, sizeof(unsigned char));
@@ -1261,7 +1267,7 @@ static int ptcache_file_compressed_write(PTCacheFile *pf, unsigned char *in, uns
else
ptcache_file_write(pf, in, in_len, sizeof(unsigned char));
- if(compressed == 2)
+ if (compressed == 2)
{
unsigned int size = sizeOfIt;
ptcache_file_write(pf, &sizeOfIt, 1, sizeof(unsigned int));
@@ -1284,8 +1290,8 @@ static int ptcache_file_data_read(PTCacheFile *pf)
{
int i;
- for(i=0; i<BPHYS_TOT_DATA; i++) {
- if((pf->data_types & (1<<i)) && !ptcache_file_read(pf, pf->cur[i], 1, ptcache_data_size[i]))
+ for (i=0; i<BPHYS_TOT_DATA; i++) {
+ if ((pf->data_types & (1<<i)) && !ptcache_file_read(pf, pf->cur[i], 1, ptcache_data_size[i]))
return 0;
}
@@ -1295,8 +1301,8 @@ static int ptcache_file_data_write(PTCacheFile *pf)
{
int i;
- for(i=0; i<BPHYS_TOT_DATA; i++) {
- if((pf->data_types & (1<<i)) && !ptcache_file_write(pf, pf->cur[i], 1, ptcache_data_size[i]))
+ for (i=0; i<BPHYS_TOT_DATA; i++) {
+ if ((pf->data_types & (1<<i)) && !ptcache_file_write(pf, pf->cur[i], 1, ptcache_data_size[i]))
return 0;
}
@@ -1310,20 +1316,20 @@ static int ptcache_file_header_begin_read(PTCacheFile *pf)
pf->data_types = 0;
- if(fread(bphysics, sizeof(char), 8, pf->fp) != 8)
+ if (fread(bphysics, sizeof(char), 8, pf->fp) != 8)
error = 1;
- if(!error && strncmp(bphysics, "BPHYSICS", 8))
+ if (!error && strncmp(bphysics, "BPHYSICS", 8))
error = 1;
- if(!error && !fread(&typeflag, sizeof(unsigned int), 1, pf->fp))
+ if (!error && !fread(&typeflag, sizeof(unsigned int), 1, pf->fp))
error = 1;
pf->type = (typeflag & PTCACHE_TYPEFLAG_TYPEMASK);
pf->flag = (typeflag & PTCACHE_TYPEFLAG_FLAGMASK);
/* if there was an error set file as it was */
- if(error)
+ if (error)
fseek(pf->fp, 0, SEEK_SET);
return !error;
@@ -1333,10 +1339,10 @@ static int ptcache_file_header_begin_write(PTCacheFile *pf)
const char *bphysics = "BPHYSICS";
unsigned int typeflag = pf->type + pf->flag;
- if(fwrite(bphysics, sizeof(char), 8, pf->fp) != 8)
+ if (fwrite(bphysics, sizeof(char), 8, pf->fp) != 8)
return 0;
- if(!fwrite(&typeflag, sizeof(unsigned int), 1, pf->fp))
+ if (!fwrite(&typeflag, sizeof(unsigned int), 1, pf->fp))
return 0;
return 1;
@@ -1365,23 +1371,23 @@ static void ptcache_file_pointers_init(PTCacheFile *pf)
/* Check to see if point number "index" is in pm, uses binary search for index data. */
int BKE_ptcache_mem_index_find(PTCacheMem *pm, unsigned int index)
{
- if(pm->data[BPHYS_DATA_INDEX]) {
+ if (pm->data[BPHYS_DATA_INDEX]) {
unsigned int *data = pm->data[BPHYS_DATA_INDEX];
unsigned int mid, low = 0, high = pm->totpoint - 1;
- if(index < *data || index > *(data+high))
+ if (index < *data || index > *(data+high))
return -1;
/* check simple case for continuous indexes first */
- if(index-*data < high && data[index-*data] == index)
+ if (index-*data < high && data[index-*data] == index)
return index-*data;
- while(low <= high) {
+ while (low <= high) {
mid= (low + high)/2;
- if(data[mid] > index)
+ if (data[mid] > index)
high = mid - 1;
- else if(data[mid] < index)
+ else if (data[mid] < index)
low = mid + 1;
else
return mid;
@@ -1399,7 +1405,7 @@ void BKE_ptcache_mem_pointers_init(PTCacheMem *pm)
int data_types = pm->data_types;
int i;
- for(i=0; i<BPHYS_TOT_DATA; i++)
+ for (i=0; i<BPHYS_TOT_DATA; i++)
pm->cur[i] = ((data_types & (1<<i)) ? pm->data[i] : NULL);
}
@@ -1407,8 +1413,8 @@ void BKE_ptcache_mem_pointers_incr(PTCacheMem *pm)
{
int i;
- for(i=0; i<BPHYS_TOT_DATA; i++) {
- if(pm->cur[i])
+ for (i=0; i<BPHYS_TOT_DATA; i++) {
+ if (pm->cur[i])
pm->cur[i] = (char*)pm->cur[i] + ptcache_data_size[i];
}
}
@@ -1417,7 +1423,7 @@ int BKE_ptcache_mem_pointers_seek(int point_index, PTCacheMem *pm)
int data_types = pm->data_types;
int i, index = BKE_ptcache_mem_index_find(pm, point_index);
- if(index < 0) {
+ if (index < 0) {
/* Can't give proper location without reallocation, so don't give any location.
* Some points will be cached improperly, but this only happens with simulation
* steps bigger than cache->step, so the cache has to be recalculated anyways
@@ -1426,7 +1432,7 @@ int BKE_ptcache_mem_pointers_seek(int point_index, PTCacheMem *pm)
return 0;
}
- for(i=0; i<BPHYS_TOT_DATA; i++)
+ for (i=0; i<BPHYS_TOT_DATA; i++)
pm->cur[i] = data_types & (1<<i) ? (char*)pm->data[i] + index * ptcache_data_size[i] : NULL;
return 1;
@@ -1437,8 +1443,8 @@ static void ptcache_data_alloc(PTCacheMem *pm)
int totpoint = pm->totpoint;
int i;
- for(i=0; i<BPHYS_TOT_DATA; i++) {
- if(data_types & (1<<i))
+ for (i=0; i<BPHYS_TOT_DATA; i++) {
+ if (data_types & (1<<i))
pm->data[i] = MEM_callocN(totpoint * ptcache_data_size[i], "PTCache Data");
}
}
@@ -1447,18 +1453,18 @@ static void ptcache_data_free(PTCacheMem *pm)
void **data = pm->data;
int i;
- for(i=0; i<BPHYS_TOT_DATA; i++) {
- if(data[i])
+ for (i=0; i<BPHYS_TOT_DATA; i++) {
+ if (data[i])
MEM_freeN(data[i]);
}
}
static void ptcache_data_copy(void *from[], void *to[])
{
int i;
- for(i=0; i<BPHYS_TOT_DATA; i++) {
+ for (i=0; i<BPHYS_TOT_DATA; i++) {
/* note, durian file 03.4b_comp crashes if to[i] is not tested
* its NULL, not sure if this should be fixed elsewhere but for now its needed */
- if(from[i] && to[i])
+ if (from[i] && to[i])
memcpy(to[i], from[i], ptcache_data_size[i]);
}
}
@@ -1467,9 +1473,9 @@ static void ptcache_extra_free(PTCacheMem *pm)
{
PTCacheExtra *extra = pm->extradata.first;
- if(extra) {
- for(; extra; extra=extra->next) {
- if(extra->data)
+ if (extra) {
+ for (; extra; extra=extra->next) {
+ if (extra->data)
MEM_freeN(extra->data);
}
@@ -1478,11 +1484,11 @@ static void ptcache_extra_free(PTCacheMem *pm)
}
static int ptcache_old_elemsize(PTCacheID *pid)
{
- if(pid->type==PTCACHE_TYPE_SOFTBODY)
+ if (pid->type==PTCACHE_TYPE_SOFTBODY)
return 6 * sizeof(float);
- else if(pid->type==PTCACHE_TYPE_PARTICLES)
+ else if (pid->type==PTCACHE_TYPE_PARTICLES)
return sizeof(ParticleKey);
- else if(pid->type==PTCACHE_TYPE_CLOTH)
+ else if (pid->type==PTCACHE_TYPE_CLOTH)
return 9 * sizeof(float);
return 0;
@@ -1490,22 +1496,22 @@ static int ptcache_old_elemsize(PTCacheID *pid)
static void ptcache_find_frames_around(PTCacheID *pid, unsigned int frame, int *fra1, int *fra2)
{
- if(pid->cache->flag & PTCACHE_DISK_CACHE) {
+ if (pid->cache->flag & PTCACHE_DISK_CACHE) {
int cfra1=frame, cfra2=frame+1;
- while(cfra1 >= pid->cache->startframe && !BKE_ptcache_id_exist(pid, cfra1))
+ while (cfra1 >= pid->cache->startframe && !BKE_ptcache_id_exist(pid, cfra1))
cfra1--;
- if(cfra1 < pid->cache->startframe)
+ if (cfra1 < pid->cache->startframe)
cfra1 = 0;
- while(cfra2 <= pid->cache->endframe && !BKE_ptcache_id_exist(pid, cfra2))
+ while (cfra2 <= pid->cache->endframe && !BKE_ptcache_id_exist(pid, cfra2))
cfra2++;
- if(cfra2 > pid->cache->endframe)
+ if (cfra2 > pid->cache->endframe)
cfra2 = 0;
- if(cfra1 && !cfra2) {
+ if (cfra1 && !cfra2) {
*fra1 = 0;
*fra2 = cfra1;
}
@@ -1514,23 +1520,23 @@ static void ptcache_find_frames_around(PTCacheID *pid, unsigned int frame, int *
*fra2 = cfra2;
}
}
- else if(pid->cache->mem_cache.first) {
+ else if (pid->cache->mem_cache.first) {
PTCacheMem *pm = pid->cache->mem_cache.first;
PTCacheMem *pm2 = pid->cache->mem_cache.last;
- while(pm->next && pm->next->frame <= frame)
+ while (pm->next && pm->next->frame <= frame)
pm= pm->next;
- if(pm2->frame < frame) {
+ if (pm2->frame < frame) {
pm2 = NULL;
}
else {
- while(pm2->prev && pm2->prev->frame > frame) {
+ while (pm2->prev && pm2->prev->frame > frame) {
pm2= pm2->prev;
}
}
- if(!pm2) {
+ if (!pm2) {
*fra1 = 0;
*fra2 = pm->frame;
}
@@ -1547,16 +1553,16 @@ static PTCacheMem *ptcache_disk_frame_to_mem(PTCacheID *pid, int cfra)
PTCacheMem *pm = NULL;
unsigned int i, error = 0;
- if(pf == NULL)
+ if (pf == NULL)
return NULL;
- if(!ptcache_file_header_begin_read(pf))
+ if (!ptcache_file_header_begin_read(pf))
error = 1;
- if(!error && (pf->type != pid->type || !pid->read_header(pf)))
+ if (!error && (pf->type != pid->type || !pid->read_header(pf)))
error = 1;
- if(!error) {
+ if (!error) {
pm = MEM_callocN(sizeof(PTCacheMem), "Pointcache mem");
pm->totpoint = pf->totpoint;
@@ -1565,10 +1571,10 @@ static PTCacheMem *ptcache_disk_frame_to_mem(PTCacheID *pid, int cfra)
ptcache_data_alloc(pm);
- if(pf->flag & PTCACHE_TYPEFLAG_COMPRESS) {
- for(i=0; i<BPHYS_TOT_DATA; i++) {
+ if (pf->flag & PTCACHE_TYPEFLAG_COMPRESS) {
+ for (i=0; i<BPHYS_TOT_DATA; i++) {
unsigned int out_len = pm->totpoint*ptcache_data_size[i];
- if(pf->data_types & (1<<i))
+ if (pf->data_types & (1<<i))
ptcache_file_compressed_read(pf, (unsigned char*)(pm->data[i]), out_len);
}
}
@@ -1576,8 +1582,8 @@ static PTCacheMem *ptcache_disk_frame_to_mem(PTCacheID *pid, int cfra)
BKE_ptcache_mem_pointers_init(pm);
ptcache_file_pointers_init(pf);
- for(i=0; i<pm->totpoint; i++) {
- if(!ptcache_file_data_read(pf)) {
+ for (i=0; i<pm->totpoint; i++) {
+ if (!ptcache_file_data_read(pf)) {
error = 1;
break;
}
@@ -1587,10 +1593,10 @@ static PTCacheMem *ptcache_disk_frame_to_mem(PTCacheID *pid, int cfra)
}
}
- if(!error && pf->flag & PTCACHE_TYPEFLAG_EXTRADATA) {
+ if (!error && pf->flag & PTCACHE_TYPEFLAG_EXTRADATA) {
unsigned int extratype = 0;
- while(ptcache_file_read(pf, &extratype, 1, sizeof(unsigned int))) {
+ while (ptcache_file_read(pf, &extratype, 1, sizeof(unsigned int))) {
PTCacheExtra *extra = MEM_callocN(sizeof(PTCacheExtra), "Pointcache extradata");
extra->type = extratype;
@@ -1599,7 +1605,7 @@ static PTCacheMem *ptcache_disk_frame_to_mem(PTCacheID *pid, int cfra)
extra->data = MEM_callocN(extra->totdata * ptcache_extra_datasize[extra->type], "Pointcache extradata->data");
- if(pf->flag & PTCACHE_TYPEFLAG_COMPRESS)
+ if (pf->flag & PTCACHE_TYPEFLAG_COMPRESS)
ptcache_file_compressed_read(pf, (unsigned char*)(extra->data), extra->totdata*ptcache_extra_datasize[extra->type]);
else
ptcache_file_read(pf, extra->data, extra->totdata, ptcache_extra_datasize[extra->type]);
@@ -1608,7 +1614,7 @@ static PTCacheMem *ptcache_disk_frame_to_mem(PTCacheID *pid, int cfra)
}
}
- if(error && pm) {
+ if (error && pm) {
ptcache_data_free(pm);
ptcache_extra_free(pm);
MEM_freeN(pm);
@@ -1617,7 +1623,7 @@ static PTCacheMem *ptcache_disk_frame_to_mem(PTCacheID *pid, int cfra)
ptcache_file_close(pf);
- if (error && G.f & G_DEBUG)
+ if (error && G.debug & G_DEBUG)
printf("Error reading from disk cache\n");
return pm;
@@ -1631,8 +1637,8 @@ static int ptcache_mem_frame_to_disk(PTCacheID *pid, PTCacheMem *pm)
pf = ptcache_file_open(pid, PTCACHE_FILE_WRITE, pm->frame);
- if(pf==NULL) {
- if (G.f & G_DEBUG)
+ if (pf==NULL) {
+ if (G.debug & G_DEBUG)
printf("Error opening disk cache file for writing\n");
return 0;
}
@@ -1642,19 +1648,19 @@ static int ptcache_mem_frame_to_disk(PTCacheID *pid, PTCacheMem *pm)
pf->type = pid->type;
pf->flag = 0;
- if(pm->extradata.first)
+ if (pm->extradata.first)
pf->flag |= PTCACHE_TYPEFLAG_EXTRADATA;
- if(pid->cache->compression)
+ if (pid->cache->compression)
pf->flag |= PTCACHE_TYPEFLAG_COMPRESS;
- if(!ptcache_file_header_begin_write(pf) || !pid->write_header(pf))
+ if (!ptcache_file_header_begin_write(pf) || !pid->write_header(pf))
error = 1;
- if(!error) {
- if(pid->cache->compression) {
- for(i=0; i<BPHYS_TOT_DATA; i++) {
- if(pm->data[i]) {
+ if (!error) {
+ if (pid->cache->compression) {
+ for (i=0; i<BPHYS_TOT_DATA; i++) {
+ if (pm->data[i]) {
unsigned int in_len = pm->totpoint*ptcache_data_size[i];
unsigned char *out = (unsigned char *)MEM_callocN(LZO_OUT_LEN(in_len)*4, "pointcache_lzo_buffer");
ptcache_file_compressed_write(pf, (unsigned char*)(pm->data[i]), in_len, out, pid->cache->compression);
@@ -1666,9 +1672,9 @@ static int ptcache_mem_frame_to_disk(PTCacheID *pid, PTCacheMem *pm)
BKE_ptcache_mem_pointers_init(pm);
ptcache_file_pointers_init(pf);
- for(i=0; i<pm->totpoint; i++) {
+ for (i=0; i<pm->totpoint; i++) {
ptcache_data_copy(pm->cur, pf->cur);
- if(!ptcache_file_data_write(pf)) {
+ if (!ptcache_file_data_write(pf)) {
error = 1;
break;
}
@@ -1677,17 +1683,17 @@ static int ptcache_mem_frame_to_disk(PTCacheID *pid, PTCacheMem *pm)
}
}
- if(!error && pm->extradata.first) {
+ if (!error && pm->extradata.first) {
PTCacheExtra *extra = pm->extradata.first;
- for(; extra; extra=extra->next) {
- if(extra->data == NULL || extra->totdata == 0)
+ for (; extra; extra=extra->next) {
+ if (extra->data == NULL || extra->totdata == 0)
continue;
ptcache_file_write(pf, &extra->type, 1, sizeof(unsigned int));
ptcache_file_write(pf, &extra->totdata, 1, sizeof(unsigned int));
- if(pid->cache->compression) {
+ if (pid->cache->compression) {
unsigned int in_len = extra->totdata * ptcache_extra_datasize[extra->type];
unsigned char *out = (unsigned char *)MEM_callocN(LZO_OUT_LEN(in_len)*4, "pointcache_lzo_buffer");
ptcache_file_compressed_write(pf, (unsigned char*)(extra->data), in_len, out, pid->cache->compression);
@@ -1701,7 +1707,7 @@ static int ptcache_mem_frame_to_disk(PTCacheID *pid, PTCacheMem *pm)
ptcache_file_close(pf);
- if (error && G.f & G_DEBUG)
+ if (error && G.debug & G_DEBUG)
printf("Error writing to disk cache\n");
return error==0;
@@ -1712,25 +1718,25 @@ static int ptcache_read_stream(PTCacheID *pid, int cfra)
PTCacheFile *pf = ptcache_file_open(pid, PTCACHE_FILE_READ, cfra);
int error = 0;
- if(pid->read_stream == NULL)
+ if (pid->read_stream == NULL)
return 0;
- if(pf == NULL) {
- if (G.f & G_DEBUG)
+ if (pf == NULL) {
+ if (G.debug & G_DEBUG)
printf("Error opening disk cache file for reading\n");
return 0;
}
- if(!ptcache_file_header_begin_read(pf))
+ if (!ptcache_file_header_begin_read(pf))
error = 1;
- if(!error && (pf->type != pid->type || !pid->read_header(pf)))
+ if (!error && (pf->type != pid->type || !pid->read_header(pf)))
error = 1;
- if(!error && pf->totpoint != pid->totpoint(pid->calldata, cfra))
+ if (!error && pf->totpoint != pid->totpoint(pid->calldata, cfra))
error = 1;
- if(!error) {
+ if (!error) {
ptcache_file_pointers_init(pf);
// we have stream reading here
@@ -1749,27 +1755,27 @@ static int ptcache_read(PTCacheID *pid, int cfra)
int *index = &i;
/* get a memory cache to read from */
- if(pid->cache->flag & PTCACHE_DISK_CACHE) {
+ if (pid->cache->flag & PTCACHE_DISK_CACHE) {
pm = ptcache_disk_frame_to_mem(pid, cfra);
}
else {
pm = pid->cache->mem_cache.first;
- while(pm && pm->frame != cfra)
+ while (pm && pm->frame != cfra)
pm = pm->next;
}
/* read the cache */
- if(pm) {
+ if (pm) {
int totpoint = pm->totpoint;
- if((pid->data_types & (1<<BPHYS_DATA_INDEX)) == 0)
+ if ((pid->data_types & (1<<BPHYS_DATA_INDEX)) == 0)
totpoint = MIN2(totpoint, pid->totpoint(pid->calldata, cfra));
BKE_ptcache_mem_pointers_init(pm);
- for(i=0; i<totpoint; i++) {
- if(pm->data_types & (1<<BPHYS_DATA_INDEX))
+ for (i=0; i<totpoint; i++) {
+ if (pm->data_types & (1<<BPHYS_DATA_INDEX))
index = pm->cur[BPHYS_DATA_INDEX];
pid->read_point(*index, pid->calldata, pm->cur, (float)pm->frame, NULL);
@@ -1777,11 +1783,11 @@ static int ptcache_read(PTCacheID *pid, int cfra)
BKE_ptcache_mem_pointers_incr(pm);
}
- if(pid->read_extra_data && pm->extradata.first)
+ if (pid->read_extra_data && pm->extradata.first)
pid->read_extra_data(pid->calldata, pm, (float)pm->frame);
/* clean up temporary memory cache */
- if(pid->cache->flag & PTCACHE_DISK_CACHE) {
+ if (pid->cache->flag & PTCACHE_DISK_CACHE) {
ptcache_data_free(pm);
ptcache_extra_free(pm);
MEM_freeN(pm);
@@ -1797,38 +1803,38 @@ static int ptcache_interpolate(PTCacheID *pid, float cfra, int cfra1, int cfra2)
int *index = &i;
/* get a memory cache to read from */
- if(pid->cache->flag & PTCACHE_DISK_CACHE) {
+ if (pid->cache->flag & PTCACHE_DISK_CACHE) {
pm = ptcache_disk_frame_to_mem(pid, cfra2);
}
else {
pm = pid->cache->mem_cache.first;
- while(pm && pm->frame != cfra2)
+ while (pm && pm->frame != cfra2)
pm = pm->next;
}
/* read the cache */
- if(pm) {
+ if (pm) {
int totpoint = pm->totpoint;
- if((pid->data_types & (1<<BPHYS_DATA_INDEX)) == 0)
+ if ((pid->data_types & (1<<BPHYS_DATA_INDEX)) == 0)
totpoint = MIN2(totpoint, pid->totpoint(pid->calldata, (int)cfra));
BKE_ptcache_mem_pointers_init(pm);
- for(i=0; i<totpoint; i++) {
- if(pm->data_types & (1<<BPHYS_DATA_INDEX))
+ for (i=0; i<totpoint; i++) {
+ if (pm->data_types & (1<<BPHYS_DATA_INDEX))
index = pm->cur[BPHYS_DATA_INDEX];
pid->interpolate_point(*index, pid->calldata, pm->cur, cfra, (float)cfra1, (float)cfra2, NULL);
BKE_ptcache_mem_pointers_incr(pm);
}
- if(pid->interpolate_extra_data && pm->extradata.first)
+ if (pid->interpolate_extra_data && pm->extradata.first)
pid->interpolate_extra_data(pid->calldata, pm, cfra, (float)cfra1, (float)cfra2);
/* clean up temporary memory cache */
- if(pid->cache->flag & PTCACHE_DISK_CACHE) {
+ if (pid->cache->flag & PTCACHE_DISK_CACHE) {
ptcache_data_free(pm);
ptcache_extra_free(pm);
MEM_freeN(pm);
@@ -1845,70 +1851,70 @@ int BKE_ptcache_read(PTCacheID *pid, float cfra)
int ret = 0;
/* nothing to read to */
- if(pid->totpoint(pid->calldata, cfrai) == 0)
+ if (pid->totpoint(pid->calldata, cfrai) == 0)
return 0;
- if(pid->cache->flag & PTCACHE_READ_INFO) {
+ if (pid->cache->flag & PTCACHE_READ_INFO) {
pid->cache->flag &= ~PTCACHE_READ_INFO;
ptcache_read(pid, 0);
}
/* first check if we have the actual frame cached */
- if(cfra == (float)cfrai && BKE_ptcache_id_exist(pid, cfrai))
+ if (cfra == (float)cfrai && BKE_ptcache_id_exist(pid, cfrai))
cfra1 = cfrai;
/* no exact cache frame found so try to find cached frames around cfra */
- if(cfra1 == 0)
+ if (cfra1 == 0)
ptcache_find_frames_around(pid, cfrai, &cfra1, &cfra2);
- if(cfra1 == 0 && cfra2 == 0)
+ if (cfra1 == 0 && cfra2 == 0)
return 0;
/* don't read old cache if already simulated past cached frame */
- if(cfra1 == 0 && cfra2 && cfra2 <= pid->cache->simframe)
+ if (cfra1 == 0 && cfra2 && cfra2 <= pid->cache->simframe)
return 0;
- if(cfra1 && cfra1 == cfra2)
+ if (cfra1 && cfra1 == cfra2)
return 0;
- if(cfra1) {
+ if (cfra1) {
- if(pid->read_stream) {
+ if (pid->read_stream) {
if (!ptcache_read_stream(pid, cfra1))
return 0;
}
- else if(pid->read_point)
+ else if (pid->read_point)
ptcache_read(pid, cfra1);
}
- if(cfra2) {
+ if (cfra2) {
- if(pid->read_stream) {
+ if (pid->read_stream) {
if (!ptcache_read_stream(pid, cfra2))
return 0;
}
- else if(pid->read_point) {
- if(cfra1 && cfra2 && pid->interpolate_point)
+ else if (pid->read_point) {
+ if (cfra1 && cfra2 && pid->interpolate_point)
ptcache_interpolate(pid, cfra, cfra1, cfra2);
else
ptcache_read(pid, cfra2);
}
}
- if(cfra1)
+ if (cfra1)
ret = (cfra2 ? PTCACHE_READ_INTERPOLATED : PTCACHE_READ_EXACT);
- else if(cfra2) {
+ else if (cfra2) {
ret = PTCACHE_READ_OLD;
pid->cache->simframe = cfra2;
}
- if((pid->cache->flag & PTCACHE_QUICK_CACHE)==0) {
+ if ((pid->cache->flag & PTCACHE_QUICK_CACHE)==0) {
cfrai = (int)cfra;
/* clear invalid cache frames so that better stuff can be simulated */
- if(pid->cache->flag & PTCACHE_OUTDATED) {
+ if (pid->cache->flag & PTCACHE_OUTDATED) {
BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_AFTER, cfrai);
}
- else if(pid->cache->flag & PTCACHE_FRAMES_SKIPPED) {
- if(cfra <= pid->cache->last_exact)
+ else if (pid->cache->flag & PTCACHE_FRAMES_SKIPPED) {
+ if (cfra <= pid->cache->last_exact)
pid->cache->flag &= ~PTCACHE_FRAMES_SKIPPED;
BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_AFTER, MAX2(cfrai, pid->cache->last_exact));
@@ -1926,8 +1932,8 @@ static int ptcache_write_stream(PTCacheID *pid, int cfra, int totpoint)
pf = ptcache_file_open(pid, PTCACHE_FILE_WRITE, cfra);
- if(pf==NULL) {
- if (G.f & G_DEBUG)
+ if (pf==NULL) {
+ if (G.debug & G_DEBUG)
printf("Error opening disk cache file for writing\n");
return 0;
}
@@ -1937,15 +1943,15 @@ static int ptcache_write_stream(PTCacheID *pid, int cfra, int totpoint)
pf->type = pid->type;
pf->flag = 0;
- if(!error && (!ptcache_file_header_begin_write(pf) || !pid->write_header(pf)))
+ if (!error && (!ptcache_file_header_begin_write(pf) || !pid->write_header(pf)))
error = 1;
- if(!error && pid->write_stream)
+ if (!error && pid->write_stream)
pid->write_stream(pf, pid->calldata);
ptcache_file_close(pf);
- if (error && G.f & G_DEBUG)
+ if (error && G.debug & G_DEBUG)
printf("Error writing to disk cache\n");
return error == 0;
@@ -1965,11 +1971,11 @@ static int ptcache_write(PTCacheID *pid, int cfra, int overwrite)
ptcache_data_alloc(pm);
BKE_ptcache_mem_pointers_init(pm);
- if(overwrite) {
- if(cache->flag & PTCACHE_DISK_CACHE) {
+ if (overwrite) {
+ if (cache->flag & PTCACHE_DISK_CACHE) {
int fra = cfra-1;
- while(fra >= cache->startframe && !BKE_ptcache_id_exist(pid, fra))
+ while (fra >= cache->startframe && !BKE_ptcache_id_exist(pid, fra))
fra--;
pm2 = ptcache_disk_frame_to_mem(pid, fra);
@@ -1978,35 +1984,35 @@ static int ptcache_write(PTCacheID *pid, int cfra, int overwrite)
pm2 = cache->mem_cache.last;
}
- if(pid->write_point) {
- for(i=0; i<totpoint; i++) {
+ if (pid->write_point) {
+ for (i=0; i<totpoint; i++) {
int write = pid->write_point(i, pid->calldata, pm->cur, cfra);
- if(write) {
+ if (write) {
BKE_ptcache_mem_pointers_incr(pm);
/* newly born particles have to be copied to previous cached frame */
- if(overwrite && write == 2 && pm2 && BKE_ptcache_mem_pointers_seek(i, pm2))
+ if (overwrite && write == 2 && pm2 && BKE_ptcache_mem_pointers_seek(i, pm2))
pid->write_point(i, pid->calldata, pm2->cur, cfra);
}
}
}
- if(pid->write_extra_data)
+ if (pid->write_extra_data)
pid->write_extra_data(pid->calldata, pm, cfra);
pm->frame = cfra;
- if(cache->flag & PTCACHE_DISK_CACHE) {
+ if (cache->flag & PTCACHE_DISK_CACHE) {
error += !ptcache_mem_frame_to_disk(pid, pm);
- // if(pm) /* pm is always set */
+ // if (pm) /* pm is always set */
{
ptcache_data_free(pm);
ptcache_extra_free(pm);
MEM_freeN(pm);
}
- if(pm2) {
+ if (pm2) {
error += !ptcache_mem_frame_to_disk(pid, pm2);
ptcache_data_free(pm2);
ptcache_extra_free(pm2);
@@ -2025,40 +2031,40 @@ static int ptcache_write_needed(PTCacheID *pid, int cfra, int *overwrite)
int ofra = 0, efra = cache->endframe;
/* allways start from scratch on the first frame */
- if(cfra && cfra == cache->startframe) {
+ if (cfra && cfra == cache->startframe) {
BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, cfra);
cache->flag &= ~PTCACHE_REDO_NEEDED;
return 1;
}
- if(pid->cache->flag & PTCACHE_DISK_CACHE) {
- if(cfra==0 && cache->startframe > 0)
+ if (pid->cache->flag & PTCACHE_DISK_CACHE) {
+ if (cfra==0 && cache->startframe > 0)
return 1;
/* find last cached frame */
- while(efra > cache->startframe && !BKE_ptcache_id_exist(pid, efra))
+ while (efra > cache->startframe && !BKE_ptcache_id_exist(pid, efra))
efra--;
/* find second last cached frame */
ofra = efra-1;
- while(ofra > cache->startframe && !BKE_ptcache_id_exist(pid, ofra))
+ while (ofra > cache->startframe && !BKE_ptcache_id_exist(pid, ofra))
ofra--;
}
else {
PTCacheMem *pm = cache->mem_cache.last;
/* don't write info file in memory */
- if(cfra == 0)
+ if (cfra == 0)
return 0;
- if(pm == NULL)
+ if (pm == NULL)
return 1;
efra = pm->frame;
ofra = (pm->prev ? pm->prev->frame : efra - cache->step);
}
- if(efra >= cache->startframe && cfra > efra) {
- if(ofra >= cache->startframe && efra - ofra < cache->step) {
+ if (efra >= cache->startframe && cfra > efra) {
+ if (ofra >= cache->startframe && efra - ofra < cache->step) {
/* overwrite previous frame */
BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_FRAME, efra);
*overwrite = 1;
@@ -2075,30 +2081,30 @@ int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra)
int totpoint = pid->totpoint(pid->calldata, cfra);
int overwrite = 0, error = 0;
- if(totpoint == 0 || (cfra ? pid->data_types == 0 : pid->info_types == 0))
+ if (totpoint == 0 || (cfra ? pid->data_types == 0 : pid->info_types == 0))
return 0;
- if(ptcache_write_needed(pid, cfra, &overwrite)==0)
+ if (ptcache_write_needed(pid, cfra, &overwrite)==0)
return 0;
- if(pid->write_stream) {
+ if (pid->write_stream) {
ptcache_write_stream(pid, cfra, totpoint);
}
- else if(pid->write_point) {
+ else if (pid->write_point) {
error += ptcache_write(pid, cfra, overwrite);
}
/* Mark frames skipped if more than 1 frame forwards since last non-skipped frame. */
- if(cfra - cache->last_exact == 1 || cfra == cache->startframe) {
+ if (cfra - cache->last_exact == 1 || cfra == cache->startframe) {
cache->last_exact = cfra;
cache->flag &= ~PTCACHE_FRAMES_SKIPPED;
}
/* Don't mark skipped when writing info file (frame 0) */
- else if(cfra)
+ else if (cfra)
cache->flag |= PTCACHE_FRAMES_SKIPPED;
/* Update timeline cache display */
- if(cfra && cache->cached_frames)
+ if (cfra && cache->cached_frames)
cache->cached_frames[cfra-cache->startframe] = 1;
BKE_ptcache_update_info(pid);
@@ -2107,8 +2113,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)
{
@@ -2123,7 +2129,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
char path_full[MAX_PTCACHE_FILE];
char ext[MAX_PTCACHE_PATH];
- if(!pid || !pid->cache || pid->cache->flag & PTCACHE_BAKED)
+ if (!pid || !pid->cache || pid->cache->flag & PTCACHE_BAKED)
return;
if (pid->cache->flag & PTCACHE_IGNORE_CLEAR)
@@ -2134,7 +2140,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
#ifndef DURIAN_POINTCACHE_LIB_OK
/* don't allow clearing for linked objects */
- if(pid->ob->id.lib)
+ if (pid->ob->id.lib)
return;
#endif
@@ -2145,7 +2151,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
case PTCACHE_CLEAR_ALL:
case PTCACHE_CLEAR_BEFORE:
case PTCACHE_CLEAR_AFTER:
- if(pid->cache->flag & PTCACHE_DISK_CACHE) {
+ if (pid->cache->flag & PTCACHE_DISK_CACHE) {
ptcache_path(pid, path);
len = ptcache_filename(pid, filename, cfra, 0, 0); /* no path */
@@ -2163,7 +2169,8 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
BLI_delete(path_full, 0, 0);
- } else {
+ }
+ else {
/* read the number of the file */
unsigned int frame, len2 = (int)strlen(de->d_name);
char num[7];
@@ -2172,12 +2179,12 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
BLI_strncpy(num, de->d_name + (strlen(de->d_name) - 15), sizeof(num));
frame = atoi(num);
- if((mode==PTCACHE_CLEAR_BEFORE && frame < cfra) ||
+ if ((mode==PTCACHE_CLEAR_BEFORE && frame < cfra) ||
(mode==PTCACHE_CLEAR_AFTER && frame > cfra) ) {
BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
BLI_delete(path_full, 0, 0);
- if(pid->cache->cached_frames && frame >=sta && frame <= end)
+ if (pid->cache->cached_frames && frame >=sta && frame <= end)
pid->cache->cached_frames[frame-sta] = 0;
}
}
@@ -2187,30 +2194,31 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
}
closedir(dir);
- if(mode == PTCACHE_CLEAR_ALL && pid->cache->cached_frames)
+ if (mode == PTCACHE_CLEAR_ALL && pid->cache->cached_frames)
memset(pid->cache->cached_frames, 0, MEM_allocN_len(pid->cache->cached_frames));
}
else {
PTCacheMem *pm= pid->cache->mem_cache.first;
PTCacheMem *link= NULL;
- if(mode == PTCACHE_CLEAR_ALL) {
+ if (mode == PTCACHE_CLEAR_ALL) {
/*we want startframe if the cache starts before zero*/
pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
- for(; pm; pm=pm->next) {
+ for (; pm; pm=pm->next) {
ptcache_data_free(pm);
ptcache_extra_free(pm);
}
BLI_freelistN(&pid->cache->mem_cache);
- if(pid->cache->cached_frames)
+ if (pid->cache->cached_frames)
memset(pid->cache->cached_frames, 0, MEM_allocN_len(pid->cache->cached_frames));
- } else {
- while(pm) {
- if((mode==PTCACHE_CLEAR_BEFORE && pm->frame < cfra) ||
+ }
+ else {
+ while (pm) {
+ if ((mode==PTCACHE_CLEAR_BEFORE && pm->frame < cfra) ||
(mode==PTCACHE_CLEAR_AFTER && pm->frame > cfra) ) {
link = pm;
- if(pid->cache->cached_frames && pm->frame >=sta && pm->frame <= end)
+ if (pid->cache->cached_frames && pm->frame >=sta && pm->frame <= end)
pid->cache->cached_frames[pm->frame-sta] = 0;
ptcache_data_free(pm);
ptcache_extra_free(pm);
@@ -2225,8 +2233,8 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
break;
case PTCACHE_CLEAR_FRAME:
- if(pid->cache->flag & PTCACHE_DISK_CACHE) {
- if(BKE_ptcache_id_exist(pid, cfra)) {
+ if (pid->cache->flag & PTCACHE_DISK_CACHE) {
+ if (BKE_ptcache_id_exist(pid, cfra)) {
ptcache_filename(pid, filename, cfra, 1, 1); /* no path */
BLI_delete(filename, 0, 0);
}
@@ -2234,8 +2242,8 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
else {
PTCacheMem *pm = pid->cache->mem_cache.first;
- for(; pm; pm=pm->next) {
- if(pm->frame == cfra) {
+ for (; pm; pm=pm->next) {
+ if (pm->frame == cfra) {
ptcache_data_free(pm);
ptcache_extra_free(pm);
BLI_freelinkN(&pid->cache->mem_cache, pm);
@@ -2243,7 +2251,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
}
}
}
- if(pid->cache->cached_frames && cfra>=sta && cfra<=end)
+ if (pid->cache->cached_frames && cfra>=sta && cfra<=end)
pid->cache->cached_frames[cfra-sta] = 0;
break;
}
@@ -2252,16 +2260,16 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
}
int BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
{
- if(!pid->cache)
+ if (!pid->cache)
return 0;
- if(cfra<pid->cache->startframe || cfra > pid->cache->endframe)
+ if (cfra<pid->cache->startframe || cfra > pid->cache->endframe)
return 0;
- if(pid->cache->cached_frames && pid->cache->cached_frames[cfra-pid->cache->startframe]==0)
+ if (pid->cache->cached_frames && pid->cache->cached_frames[cfra-pid->cache->startframe]==0)
return 0;
- if(pid->cache->flag & PTCACHE_DISK_CACHE) {
+ if (pid->cache->flag & PTCACHE_DISK_CACHE) {
char filename[MAX_PTCACHE_FILE];
ptcache_filename(pid, filename, cfra, 1, 1);
@@ -2271,8 +2279,8 @@ int BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
else {
PTCacheMem *pm = pid->cache->mem_cache.first;
- for(; pm; pm=pm->next) {
- if(pm->frame==cfra)
+ for (; pm; pm=pm->next) {
+ if (pm->frame==cfra)
return 1;
}
return 0;
@@ -2300,14 +2308,14 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
/* ob= pid->ob; */ /* UNUSED */
cache= pid->cache;
- if(timescale) {
+ if (timescale) {
time= BKE_curframe(scene);
nexttime= BKE_frame_to_ctime(scene, CFRA+1);
*timescale= MAX2(nexttime - time, 0.0f);
}
- if(startframe && endframe) {
+ if (startframe && endframe) {
*startframe= cache->startframe;
*endframe= cache->endframe;
@@ -2326,20 +2334,20 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
}
/* verify cached_frames array is up to date */
- if(cache->cached_frames) {
- if(MEM_allocN_len(cache->cached_frames) != sizeof(char) * (cache->endframe-cache->startframe+1)) {
+ if (cache->cached_frames) {
+ if (MEM_allocN_len(cache->cached_frames) != sizeof(char) * (cache->endframe-cache->startframe+1)) {
MEM_freeN(cache->cached_frames);
cache->cached_frames = NULL;
}
}
- if(cache->cached_frames==NULL && cache->endframe > cache->startframe) {
+ if (cache->cached_frames==NULL && cache->endframe > cache->startframe) {
unsigned int sta=cache->startframe;
unsigned int end=cache->endframe;
cache->cached_frames = MEM_callocN(sizeof(char) * (cache->endframe-cache->startframe+1), "cached frames array");
- if(pid->cache->flag & PTCACHE_DISK_CACHE) {
+ if (pid->cache->flag & PTCACHE_DISK_CACHE) {
/* mode is same as fopen's modes */
DIR *dir;
struct dirent *de;
@@ -2369,7 +2377,7 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
BLI_strncpy(num, de->d_name + (strlen(de->d_name) - 15), sizeof(num));
frame = atoi(num);
- if(frame >= sta && frame <= end)
+ if (frame >= sta && frame <= end)
cache->cached_frames[frame-sta] = 1;
}
}
@@ -2380,8 +2388,8 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
else {
PTCacheMem *pm= pid->cache->mem_cache.first;
- while(pm) {
- if(pm->frame >= sta && pm->frame <= end)
+ while (pm) {
+ if (pm->frame >= sta && pm->frame <= end)
cache->cached_frames[pm->frame-sta] = 1;
pm = pm->next;
}
@@ -2393,7 +2401,7 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
PointCache *cache;
int reset, clear, after;
- if(!pid->cache)
+ if (!pid->cache)
return 0;
cache= pid->cache;
@@ -2401,9 +2409,9 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
clear= 0;
after= 0;
- if(mode == PTCACHE_RESET_DEPSGRAPH) {
- if(!(cache->flag & PTCACHE_BAKED) && !BKE_ptcache_get_continue_physics()) {
- if(cache->flag & PTCACHE_QUICK_CACHE)
+ if (mode == PTCACHE_RESET_DEPSGRAPH) {
+ if (!(cache->flag & PTCACHE_BAKED) && !BKE_ptcache_get_continue_physics()) {
+ if (cache->flag & PTCACHE_QUICK_CACHE)
clear= 1;
after= 1;
@@ -2411,43 +2419,43 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
cache->flag |= PTCACHE_OUTDATED;
}
- else if(mode == PTCACHE_RESET_BAKED) {
- if(!BKE_ptcache_get_continue_physics()) {
+ else if (mode == PTCACHE_RESET_BAKED) {
+ if (!BKE_ptcache_get_continue_physics()) {
reset= 1;
clear= 1;
}
else
cache->flag |= PTCACHE_OUTDATED;
}
- else if(mode == PTCACHE_RESET_OUTDATED) {
+ else if (mode == PTCACHE_RESET_OUTDATED) {
reset = 1;
- if(cache->flag & PTCACHE_OUTDATED && !(cache->flag & PTCACHE_BAKED)) {
+ if (cache->flag & PTCACHE_OUTDATED && !(cache->flag & PTCACHE_BAKED)) {
clear= 1;
cache->flag &= ~PTCACHE_OUTDATED;
}
}
- if(reset) {
+ if (reset) {
BKE_ptcache_invalidate(cache);
cache->flag &= ~PTCACHE_REDO_NEEDED;
- if(pid->type == PTCACHE_TYPE_CLOTH)
+ if (pid->type == PTCACHE_TYPE_CLOTH)
cloth_free_modifier(pid->calldata);
- else if(pid->type == PTCACHE_TYPE_SOFTBODY)
+ else if (pid->type == PTCACHE_TYPE_SOFTBODY)
sbFreeSimulation(pid->calldata);
- else if(pid->type == PTCACHE_TYPE_PARTICLES)
+ else if (pid->type == PTCACHE_TYPE_PARTICLES)
psys_reset(pid->calldata, PSYS_RESET_DEPSGRAPH);
- else if(pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
+ else if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
smokeModifier_reset(pid->calldata);
- else if(pid->type == PTCACHE_TYPE_SMOKE_HIGHRES)
+ else if (pid->type == PTCACHE_TYPE_SMOKE_HIGHRES)
smokeModifier_reset_turbulence(pid->calldata);
- else if(pid->type == PTCACHE_TYPE_DYNAMICPAINT)
+ else if (pid->type == PTCACHE_TYPE_DYNAMICPAINT)
dynamicPaint_clearSurface((DynamicPaintSurface*)pid->calldata);
}
- if(clear)
+ if (clear)
BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
- else if(after)
+ else if (after)
BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_AFTER, CFRA);
return (reset || clear || after);
@@ -2462,47 +2470,47 @@ int BKE_ptcache_object_reset(Scene *scene, Object *ob, int mode)
reset= 0;
skip= 0;
- if(ob->soft) {
+ if (ob->soft) {
BKE_ptcache_id_from_softbody(&pid, ob, ob->soft);
reset |= BKE_ptcache_id_reset(scene, &pid, mode);
}
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
+ for (psys=ob->particlesystem.first; psys; psys=psys->next) {
/* children or just redo can be calculated without reseting anything */
- if(psys->recalc & PSYS_RECALC_REDO || psys->recalc & PSYS_RECALC_CHILD)
+ if (psys->recalc & PSYS_RECALC_REDO || psys->recalc & PSYS_RECALC_CHILD)
skip = 1;
/* Baked cloth hair has to be checked too, because we don't want to reset */
/* particles or cloth in that case -jahka */
- else if(psys->clmd) {
+ else if (psys->clmd) {
BKE_ptcache_id_from_cloth(&pid, ob, psys->clmd);
- if(mode == PSYS_RESET_ALL || !(psys->part->type == PART_HAIR && (pid.cache->flag & PTCACHE_BAKED)))
+ if (mode == PSYS_RESET_ALL || !(psys->part->type == PART_HAIR && (pid.cache->flag & PTCACHE_BAKED)))
reset |= BKE_ptcache_id_reset(scene, &pid, mode);
else
skip = 1;
}
- if(skip == 0 && psys->part) {
+ if (skip == 0 && psys->part) {
BKE_ptcache_id_from_particles(&pid, ob, psys);
reset |= BKE_ptcache_id_reset(scene, &pid, mode);
}
}
- for(md=ob->modifiers.first; md; md=md->next) {
- if(md->type == eModifierType_Cloth) {
+ for (md=ob->modifiers.first; md; md=md->next) {
+ if (md->type == eModifierType_Cloth) {
BKE_ptcache_id_from_cloth(&pid, ob, (ClothModifierData*)md);
reset |= BKE_ptcache_id_reset(scene, &pid, mode);
}
- if(md->type == eModifierType_Smoke) {
+ if (md->type == eModifierType_Smoke) {
SmokeModifierData *smd = (SmokeModifierData *)md;
- if(smd->type & MOD_SMOKE_TYPE_DOMAIN)
+ if (smd->type & MOD_SMOKE_TYPE_DOMAIN)
{
BKE_ptcache_id_from_smoke(&pid, ob, (SmokeModifierData*)md);
reset |= BKE_ptcache_id_reset(scene, &pid, mode);
}
}
- if(md->type == eModifierType_DynamicPaint) {
+ if (md->type == eModifierType_DynamicPaint) {
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
- if(pmd->canvas)
+ if (pmd->canvas)
{
DynamicPaintSurface *surface = pmd->canvas->surfaces.first;
@@ -2540,18 +2548,21 @@ void BKE_ptcache_remove(void)
return;
while ((de = readdir(dir)) != NULL) {
- if( strcmp(de->d_name, ".")==0 || strcmp(de->d_name, "..")==0) {
+ if ( strcmp(de->d_name, ".")==0 || strcmp(de->d_name, "..")==0) {
/* do nothing */
- } else if (strstr(de->d_name, PTCACHE_EXT)) { /* do we have the right extension?*/
+ }
+ else if (strstr(de->d_name, PTCACHE_EXT)) { /* do we have the right extension?*/
BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
BLI_delete(path_full, 0, 0);
- } else {
- rmdir = 0; /* unknown file, dont remove the dir */
+ }
+ else {
+ rmdir = 0; /* unknown file, don't remove the dir */
}
}
closedir(dir);
- } else {
+ }
+ else {
rmdir = 0; /* path dosnt exist */
}
@@ -2568,12 +2579,12 @@ void BKE_ptcache_set_continue_physics(Main *bmain, Scene *scene, int enable)
{
Object *ob;
- if(CONTINUE_PHYSICS != enable) {
+ if (CONTINUE_PHYSICS != enable) {
CONTINUE_PHYSICS = enable;
- if(CONTINUE_PHYSICS == 0) {
- for(ob=bmain->object.first; ob; ob=ob->id.next)
- if(BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_OUTDATED))
+ if (CONTINUE_PHYSICS == 0) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next)
+ if (BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_OUTDATED))
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
}
@@ -2605,8 +2616,8 @@ void BKE_ptcache_free_mem(ListBase *mem_cache)
{
PTCacheMem *pm = mem_cache->first;
- if(pm) {
- for(; pm; pm=pm->next) {
+ if (pm) {
+ for (; pm; pm=pm->next) {
ptcache_data_free(pm);
ptcache_extra_free(pm);
}
@@ -2617,9 +2628,9 @@ void BKE_ptcache_free_mem(ListBase *mem_cache)
void BKE_ptcache_free(PointCache *cache)
{
BKE_ptcache_free_mem(&cache->mem_cache);
- if(cache->edit && cache->free_edit)
+ if (cache->edit && cache->free_edit)
cache->free_edit(cache->edit);
- if(cache->cached_frames)
+ if (cache->cached_frames)
MEM_freeN(cache->cached_frames);
MEM_freeN(cache);
}
@@ -2627,7 +2638,7 @@ void BKE_ptcache_free_list(ListBase *ptcaches)
{
PointCache *cache = ptcaches->first;
- while(cache) {
+ while (cache) {
BLI_remlink(ptcaches, cache);
BKE_ptcache_free(cache);
cache = ptcaches->first;
@@ -2658,7 +2669,7 @@ PointCache *BKE_ptcache_copy_list(ListBase *ptcaches_new, ListBase *ptcaches_old
ptcaches_new->first = ptcaches_new->last = NULL;
- for(; cache; cache=cache->next)
+ for (; cache; cache=cache->next)
BLI_addtail(ptcaches_new, ptcache_copy(cache));
return ptcaches_new->first;
@@ -2687,7 +2698,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;
@@ -2700,8 +2711,8 @@ typedef struct {
static void ptcache_dt_to_str(char *str, double dtime)
{
- if(dtime > 60.0) {
- if(dtime > 3600.0)
+ if (dtime > 60.0) {
+ if (dtime > 3600.0)
sprintf(str, "%ih %im %is", (int)(dtime/3600), ((int)(dtime/60))%60, ((int)dtime) % 60);
else
sprintf(str, "%im %is", ((int)(dtime/60))%60, ((int)dtime) % 60);
@@ -2722,9 +2733,9 @@ static void *ptcache_bake_thread(void *ptr)
sfra = *data->cfra_ptr;
efra = data->endframe;
- for(; (*data->cfra_ptr <= data->endframe) && !data->break_operation; *data->cfra_ptr+=data->step) {
+ for (; (*data->cfra_ptr <= data->endframe) && !data->break_operation; *data->cfra_ptr+=data->step) {
scene_update_for_newframe(data->main, data->scene, data->scene->lay);
- if(G.background) {
+ if (G.background) {
printf("bake: frame %d :: %d\n", (int)*data->cfra_ptr, data->endframe);
}
else {
@@ -2732,22 +2743,22 @@ static void *ptcache_bake_thread(void *ptr)
fetd = (ctime-ptime)*(efra-*data->cfra_ptr)/data->step;
- if(usetimer || fetd > 60.0) {
+ if (usetimer || fetd > 60.0) {
usetimer = 1;
ptcache_dt_to_str(cur, ctime-ptime);
ptcache_dt_to_str(run, ctime-stime);
ptcache_dt_to_str(etd, fetd);
- printf("Baked for %s, current frame: %i/%i (%.3fs), ETC: %s \r", run, *data->cfra_ptr-sfra+1, efra-sfra+1, ctime-ptime, etd);
+ printf("Baked for %s, current frame: %i/%i (%.3fs), ETC: %s\r", run, *data->cfra_ptr-sfra+1, efra-sfra+1, ctime-ptime, etd);
}
ptime = ctime;
}
}
- if(usetimer) {
+ if (usetimer) {
ptcache_dt_to_str(run, PIL_check_seconds_timer()-stime);
- printf("Bake %s %s (%i frames simulated). \n", (data->break_operation ? "canceled after" : "finished in"), run, *data->cfra_ptr-sfra);
+ printf("Bake %s %s (%i frames simulated).\n", (data->break_operation ? "canceled after" : "finished in"), run, *data->cfra_ptr-sfra);
}
data->thread_ended = TRUE;
@@ -2782,29 +2793,29 @@ void BKE_ptcache_bake(PTCacheBaker* baker)
G.afbreek = 0;
/* set caches to baking mode and figure out start frame */
- if(pid) {
+ if (pid) {
/* cache/bake a single object */
cache = pid->cache;
- if((cache->flag & PTCACHE_BAKED)==0) {
- if(pid->type==PTCACHE_TYPE_PARTICLES) {
+ if ((cache->flag & PTCACHE_BAKED)==0) {
+ if (pid->type==PTCACHE_TYPE_PARTICLES) {
ParticleSystem *psys= pid->calldata;
/* a bit confusing, could make this work better in the UI */
- if(psys->part->type == PART_EMITTER)
+ if (psys->part->type == PART_EMITTER)
psys_get_pointcache_start_end(scene, pid->calldata, &cache->startframe, &cache->endframe);
}
- else if(pid->type == PTCACHE_TYPE_SMOKE_HIGHRES) {
+ else if (pid->type == PTCACHE_TYPE_SMOKE_HIGHRES) {
/* get all pids from the object and search for smoke low res */
ListBase pidlist2;
PTCacheID *pid2;
BKE_ptcache_ids_from_object(&pidlist2, pid->ob, scene, MAX_DUPLI_RECUR);
- for(pid2=pidlist2.first; pid2; pid2=pid2->next) {
- if(pid2->type == PTCACHE_TYPE_SMOKE_DOMAIN)
+ for (pid2=pidlist2.first; pid2; pid2=pid2->next) {
+ if (pid2->type == PTCACHE_TYPE_SMOKE_DOMAIN)
{
- if(pid2->cache && !(pid2->cache->flag & PTCACHE_BAKED)) {
- if(bake || pid2->cache->flag & PTCACHE_REDO_NEEDED)
+ if (pid2->cache && !(pid2->cache->flag & PTCACHE_BAKED)) {
+ if (bake || pid2->cache->flag & PTCACHE_REDO_NEEDED)
BKE_ptcache_id_clear(pid2, PTCACHE_CLEAR_ALL, 0);
- if(bake) {
+ if (bake) {
pid2->cache->flag |= PTCACHE_BAKING;
pid2->cache->flag &= ~PTCACHE_BAKED;
}
@@ -2814,12 +2825,12 @@ void BKE_ptcache_bake(PTCacheBaker* baker)
BLI_freelistN(&pidlist2);
}
- if(bake || cache->flag & PTCACHE_REDO_NEEDED)
+ if (bake || cache->flag & PTCACHE_REDO_NEEDED)
BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
startframe = MAX2(cache->last_exact, cache->startframe);
- if(bake) {
+ if (bake) {
thread_data.endframe = cache->endframe;
cache->flag |= PTCACHE_BAKING;
}
@@ -2830,40 +2841,44 @@ void BKE_ptcache_bake(PTCacheBaker* baker)
cache->flag &= ~PTCACHE_BAKED;
}
}
- else for(SETLOOPER(scene, sce_iter, base)) {
- /* cache/bake everything in the scene */
- BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR);
+ else {
+ for (SETLOOPER(scene, sce_iter, base)) {
+ /* cache/bake everything in the scene */
+ BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR);
+
+ for (pid=pidlist.first; pid; pid=pid->next) {
+ cache = pid->cache;
+ if ((cache->flag & PTCACHE_BAKED)==0) {
+ if (pid->type==PTCACHE_TYPE_PARTICLES) {
+ ParticleSystem *psys = (ParticleSystem*)pid->calldata;
+ /* skip hair & keyed particles */
+ if (psys->part->type == PART_HAIR || psys->part->phystype == PART_PHYS_KEYED)
+ continue;
+
+ psys_get_pointcache_start_end(scene, pid->calldata, &cache->startframe, &cache->endframe);
+ }
- for(pid=pidlist.first; pid; pid=pid->next) {
- cache = pid->cache;
- if((cache->flag & PTCACHE_BAKED)==0) {
- if(pid->type==PTCACHE_TYPE_PARTICLES) {
- ParticleSystem *psys = (ParticleSystem*)pid->calldata;
- /* skip hair & keyed particles */
- if(psys->part->type == PART_HAIR || psys->part->phystype == PART_PHYS_KEYED)
- continue;
+ if ((cache->flag & PTCACHE_REDO_NEEDED || (cache->flag & PTCACHE_SIMULATION_VALID)==0) &&
+ ((cache->flag & PTCACHE_QUICK_CACHE)==0 || render || bake))
+ {
+ BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
+ }
- psys_get_pointcache_start_end(scene, pid->calldata, &cache->startframe, &cache->endframe);
- }
+ startframe = MIN2(startframe, cache->startframe);
- if((cache->flag & PTCACHE_REDO_NEEDED || (cache->flag & PTCACHE_SIMULATION_VALID)==0)
- && ((cache->flag & PTCACHE_QUICK_CACHE)==0 || render || bake))
- BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
+ if (bake || render) {
+ cache->flag |= PTCACHE_BAKING;
- startframe = MIN2(startframe, cache->startframe);
+ if (bake)
+ thread_data.endframe = MAX2(thread_data.endframe, cache->endframe);
+ }
- if(bake || render) {
- cache->flag |= PTCACHE_BAKING;
+ cache->flag &= ~PTCACHE_BAKED;
- if(bake)
- thread_data.endframe = MAX2(thread_data.endframe, cache->endframe);
}
-
- cache->flag &= ~PTCACHE_BAKED;
-
}
+ BLI_freelistN(&pidlist);
}
- BLI_freelistN(&pidlist);
}
CFRA = startframe;
@@ -2874,7 +2889,7 @@ void BKE_ptcache_bake(PTCacheBaker* baker)
WM_cursor_wait(1);
- if(G.background) {
+ if (G.background) {
ptcache_bake_thread((void*)&thread_data);
}
else {
@@ -2883,7 +2898,7 @@ void BKE_ptcache_bake(PTCacheBaker* baker)
while (thread_data.thread_ended == FALSE) {
- if(bake)
+ if (bake)
progress = (int)(100.0f * (float)(CFRA - startframe)/(float)(thread_data.endframe-startframe));
else
progress = CFRA;
@@ -2898,7 +2913,7 @@ void BKE_ptcache_bake(PTCacheBaker* baker)
PIL_sleep_ms(200);
/* NOTE: breaking baking should leave calculated frames in cache, not clear it */
- if(blender_test_break() && !thread_data.break_operation) {
+ if (blender_test_break() && !thread_data.break_operation) {
thread_data.break_operation = TRUE;
if (baker->progressend)
baker->progressend(baker->progresscontext);
@@ -2909,46 +2924,48 @@ void BKE_ptcache_bake(PTCacheBaker* baker)
BLI_end_threads(&threads);
}
/* clear baking flag */
- if(pid) {
+ if (pid) {
cache->flag &= ~(PTCACHE_BAKING|PTCACHE_REDO_NEEDED);
cache->flag |= PTCACHE_SIMULATION_VALID;
- if(bake) {
+ if (bake) {
cache->flag |= PTCACHE_BAKED;
/* write info file */
- if(cache->flag & PTCACHE_DISK_CACHE)
+ if (cache->flag & PTCACHE_DISK_CACHE)
BKE_ptcache_write(pid, 0);
}
}
- else for(SETLOOPER(scene, sce_iter, base)) {
- BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR);
+ else {
+ for (SETLOOPER(scene, sce_iter, base)) {
+ BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR);
- for(pid=pidlist.first; pid; pid=pid->next) {
- /* skip hair particles */
- if(pid->type==PTCACHE_TYPE_PARTICLES && ((ParticleSystem*)pid->calldata)->part->type == PART_HAIR)
- continue;
-
- cache = pid->cache;
+ for (pid=pidlist.first; pid; pid=pid->next) {
+ /* skip hair particles */
+ if (pid->type==PTCACHE_TYPE_PARTICLES && ((ParticleSystem*)pid->calldata)->part->type == PART_HAIR)
+ continue;
- if(thread_data.step > 1)
- cache->flag &= ~(PTCACHE_BAKING|PTCACHE_OUTDATED);
- else
- cache->flag &= ~(PTCACHE_BAKING|PTCACHE_REDO_NEEDED);
+ cache = pid->cache;
- cache->flag |= PTCACHE_SIMULATION_VALID;
+ if (thread_data.step > 1)
+ cache->flag &= ~(PTCACHE_BAKING|PTCACHE_OUTDATED);
+ else
+ cache->flag &= ~(PTCACHE_BAKING|PTCACHE_REDO_NEEDED);
- if(bake) {
- cache->flag |= PTCACHE_BAKED;
- if(cache->flag & PTCACHE_DISK_CACHE)
- BKE_ptcache_write(pid, 0);
+ cache->flag |= PTCACHE_SIMULATION_VALID;
+
+ if (bake) {
+ cache->flag |= PTCACHE_BAKED;
+ if (cache->flag & PTCACHE_DISK_CACHE)
+ BKE_ptcache_write(pid, 0);
+ }
}
+ BLI_freelistN(&pidlist);
}
- BLI_freelistN(&pidlist);
}
scene->r.framelen = frameleno;
CFRA = cfrao;
- if(bake) /* already on cfra unless baking */
+ if (bake) /* already on cfra unless baking */
scene_update_for_newframe(bmain, scene, scene->lay);
if (thread_data.break_operation)
@@ -2977,10 +2994,10 @@ void BKE_ptcache_disk_to_mem(PTCacheID *pid)
/* restore possible bake flag */
cache->flag |= baked;
- for(cfra=sfra; cfra <= efra; cfra++) {
+ for (cfra=sfra; cfra <= efra; cfra++) {
pm = ptcache_disk_frame_to_mem(pid, cfra);
- if(pm)
+ if (pm)
BLI_addtail(&pid->cache->mem_cache, pm);
}
}
@@ -2999,15 +3016,15 @@ void BKE_ptcache_mem_to_disk(PTCacheID *pid)
/* restore possible bake flag */
cache->flag |= baked;
- for(; pm; pm=pm->next) {
- if(ptcache_mem_frame_to_disk(pid, pm)==0) {
+ for (; pm; pm=pm->next) {
+ if (ptcache_mem_frame_to_disk(pid, pm)==0) {
cache->flag &= ~PTCACHE_DISK_CACHE;
break;
}
}
/* write info file */
- if(cache->flag & PTCACHE_BAKED)
+ if (cache->flag & PTCACHE_BAKED)
BKE_ptcache_write(pid, 0);
}
void BKE_ptcache_toggle_disk_cache(PTCacheID *pid)
@@ -3017,17 +3034,17 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid)
if (!G.relbase_valid) {
cache->flag &= ~PTCACHE_DISK_CACHE;
- if (G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("File must be saved before using disk cache!\n");
return;
}
- if(cache->cached_frames) {
+ if (cache->cached_frames) {
MEM_freeN(cache->cached_frames);
cache->cached_frames=NULL;
}
- if(cache->flag & PTCACHE_DISK_CACHE)
+ if (cache->flag & PTCACHE_DISK_CACHE)
BKE_ptcache_mem_to_disk(pid);
else
BKE_ptcache_disk_to_mem(pid);
@@ -3066,7 +3083,7 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, const char *name_src, const c
ptcache_path(pid, path);
dir = opendir(path);
- if(dir==NULL) {
+ if (dir==NULL) {
BLI_strncpy(pid->cache->name, old_name, sizeof(pid->cache->name));
return;
}
@@ -3115,7 +3132,7 @@ void BKE_ptcache_load_external(PTCacheID *pid)
char filename[MAX_PTCACHE_FILE];
char ext[MAX_PTCACHE_PATH];
- if(!cache)
+ if (!cache)
return;
ptcache_path(pid, path);
@@ -3126,7 +3143,7 @@ void BKE_ptcache_load_external(PTCacheID *pid)
if (dir==NULL)
return;
- if(cache->index >= 0)
+ if (cache->index >= 0)
BLI_snprintf(ext, sizeof(ext), "_%02d"PTCACHE_EXT, cache->index);
else
BLI_strncpy(ext, PTCACHE_EXT, sizeof(ext));
@@ -3142,7 +3159,7 @@ void BKE_ptcache_load_external(PTCacheID *pid)
BLI_strncpy(num, de->d_name + (strlen(de->d_name) - 15), sizeof(num));
frame = atoi(num);
- if(frame) {
+ if (frame) {
start = MIN2(start, frame);
end = MAX2(end, frame);
}
@@ -3154,22 +3171,22 @@ void BKE_ptcache_load_external(PTCacheID *pid)
}
closedir(dir);
- if(start != MAXFRAME) {
+ if (start != MAXFRAME) {
PTCacheFile *pf;
cache->startframe = start;
cache->endframe = end;
cache->totpoint = 0;
- if(pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
+ if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
; /*necessary info in every file*/
/* read totpoint from info file (frame 0) */
- else if(info) {
+ else if (info) {
pf= ptcache_file_open(pid, PTCACHE_FILE_READ, 0);
- if(pf) {
- if(ptcache_file_header_begin_read(pf)) {
- if(pf->type == pid->type && pid->read_header(pf)) {
+ if (pf) {
+ if (ptcache_file_header_begin_read(pf)) {
+ if (pf->type == pid->type && pid->read_header(pf)) {
cache->totpoint = pf->totpoint;
cache->flag |= PTCACHE_READ_INFO;
}
@@ -3186,8 +3203,8 @@ void BKE_ptcache_load_external(PTCacheID *pid)
int elemsize = ptcache_old_elemsize(pid);
pf= ptcache_file_open(pid, PTCACHE_FILE_READ, cache->startframe);
- if(pf) {
- while(ptcache_file_read(pf, old_data, 1, elemsize))
+ if (pf) {
+ while (ptcache_file_read(pf, old_data, 1, elemsize))
cache->totpoint++;
ptcache_file_close(pf);
@@ -3207,30 +3224,30 @@ void BKE_ptcache_update_info(PTCacheID *pid)
int totframes = 0;
char mem_info[64];
- if(cache->flag & PTCACHE_EXTERNAL) {
+ if (cache->flag & PTCACHE_EXTERNAL) {
int cfra = cache->startframe;
- for(; cfra<=cache->endframe; cfra++) {
- if(BKE_ptcache_id_exist(pid, cfra))
+ for (; cfra<=cache->endframe; cfra++) {
+ if (BKE_ptcache_id_exist(pid, cfra))
totframes++;
}
/* smoke doesn't use frame 0 as info frame so can't check based on totpoint */
- if(pid->type == PTCACHE_TYPE_SMOKE_DOMAIN && totframes)
+ if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN && totframes)
BLI_snprintf(cache->info, sizeof(cache->info), "%i frames found!", totframes);
- else if(totframes && cache->totpoint)
+ else if (totframes && cache->totpoint)
BLI_snprintf(cache->info, sizeof(cache->info), "%i points found!", cache->totpoint);
else
BLI_snprintf(cache->info, sizeof(cache->info), "No valid data to read!");
return;
}
- if(cache->flag & PTCACHE_DISK_CACHE) {
- if(pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
+ if (cache->flag & PTCACHE_DISK_CACHE) {
+ if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
{
int totpoint = pid->totpoint(pid->calldata, 0);
- if(cache->totpoint > totpoint)
+ if (cache->totpoint > totpoint)
BLI_snprintf(mem_info, sizeof(mem_info), "%i cells + High Resolution cached", totpoint);
else
BLI_snprintf(mem_info, sizeof(mem_info), "%i cells cached", totpoint);
@@ -3238,8 +3255,8 @@ void BKE_ptcache_update_info(PTCacheID *pid)
else {
int cfra = cache->startframe;
- for(; cfra<=cache->endframe; cfra++) {
- if(BKE_ptcache_id_exist(pid, cfra))
+ for (; cfra<=cache->endframe; cfra++) {
+ if (BKE_ptcache_id_exist(pid, cfra))
totframes++;
}
@@ -3251,11 +3268,11 @@ void BKE_ptcache_update_info(PTCacheID *pid)
float bytes = 0.0f;
int i, mb;
- for(; pm; pm=pm->next) {
- for(i=0; i<BPHYS_TOT_DATA; i++)
+ for (; pm; pm=pm->next) {
+ for (i=0; i<BPHYS_TOT_DATA; i++)
bytes += MEM_allocN_len(pm->data[i]);
- for(extra=pm->extradata.first; extra; extra=extra->next) {
+ for (extra=pm->extradata.first; extra; extra=extra->next) {
bytes += MEM_allocN_len(extra->data);
bytes += sizeof(PTCacheExtra);
}
@@ -3273,10 +3290,10 @@ void BKE_ptcache_update_info(PTCacheID *pid)
mb ? "Mb" : "kb");
}
- if(cache->flag & PTCACHE_OUTDATED) {
+ if (cache->flag & PTCACHE_OUTDATED) {
BLI_snprintf(cache->info, sizeof(cache->info), "%s, cache is outdated!", mem_info);
}
- else if(cache->flag & PTCACHE_FRAMES_SKIPPED) {
+ else if (cache->flag & PTCACHE_FRAMES_SKIPPED) {
BLI_snprintf(cache->info, sizeof(cache->info), "%s, not exact since frame %i.", mem_info, cache->last_exact);
}
else {
@@ -3286,14 +3303,14 @@ void BKE_ptcache_update_info(PTCacheID *pid)
void BKE_ptcache_validate(PointCache *cache, int framenr)
{
- if(cache) {
+ if (cache) {
cache->flag |= PTCACHE_SIMULATION_VALID;
cache->simframe = framenr;
}
}
void BKE_ptcache_invalidate(PointCache *cache)
{
- if(cache) {
+ if (cache) {
cache->flag &= ~PTCACHE_SIMULATION_VALID;
cache->simframe = 0;
cache->last_exact = MIN2(cache->startframe, 0);
diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c
index 5668907b094..066de61575d 100644
--- a/source/blender/blenkernel/intern/property.c
+++ b/source/blender/blenkernel/intern/property.c
@@ -48,7 +48,7 @@
void free_property(bProperty *prop)
{
- if(prop->poin && prop->poin != &prop->data) MEM_freeN(prop->poin);
+ if (prop->poin && prop->poin != &prop->data) MEM_freeN(prop->poin);
MEM_freeN(prop);
}
@@ -57,7 +57,7 @@ void free_properties(ListBase *lb)
{
bProperty *prop;
- while( (prop= lb->first) ) {
+ while ( (prop= lb->first) ) {
BLI_remlink(lb, prop);
free_property(prop);
}
@@ -68,7 +68,7 @@ bProperty *copy_property(bProperty *prop)
bProperty *propn;
propn= MEM_dupallocN(prop);
- if(prop->poin && prop->poin != &prop->data) {
+ if (prop->poin && prop->poin != &prop->data) {
propn->poin= MEM_dupallocN(prop->poin);
}
else propn->poin= &propn->data;
@@ -79,9 +79,9 @@ 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) {
+ while (prop) {
propn= copy_property(prop);
BLI_addtail(lbn, propn);
prop= prop->next;
@@ -94,7 +94,7 @@ void init_property(bProperty *prop)
{
/* also use when property changes type */
- if(prop->poin && prop->poin != &prop->data) MEM_freeN(prop->poin);
+ if (prop->poin && prop->poin != &prop->data) MEM_freeN(prop->poin);
prop->poin= NULL;
prop->data= 0;
@@ -131,7 +131,7 @@ bProperty *new_property(int type)
static bProperty *get_property__internal(bProperty *first, bProperty *self, const char *name)
{
bProperty *p;
- for(p= first; p; p= p->next) {
+ for (p= first; p; p= p->next) {
if (p!=self && (strcmp(p->name, name)==0))
return p;
}
@@ -142,21 +142,22 @@ void unique_property(bProperty *first, bProperty *prop, int force)
bProperty *p;
/* set the first if its not set */
- if(first==NULL) {
+ if (first==NULL) {
first= prop;
- while(first->prev) {
+ while (first->prev) {
first= first->prev;
}
}
- if(force) {
+ if (force) {
/* change other names to make them unique */
- while((p = get_property__internal(first, prop, prop->name))) {
+ while ((p = get_property__internal(first, prop, prop->name))) {
unique_property(first, p, 0);
}
- }else {
+ }
+ else {
/* change our own name until its unique */
- if(get_property__internal(first, prop, prop->name)) {
+ if (get_property__internal(first, prop, prop->name)) {
/* there is a collision */
char new_name[sizeof(prop->name)];
char base_name[sizeof(prop->name)];
@@ -165,7 +166,7 @@ void unique_property(bProperty *first, bProperty *prop, int force)
/* strip numbers */
BLI_strncpy(base_name, prop->name, sizeof(base_name));
- for(i= strlen(base_name)-1; (i>=0 && isdigit(base_name[i])); i--) {
+ for (i= strlen(base_name)-1; (i>=0 && isdigit(base_name[i])); i--) {
base_name[i]= '\0';
}
i= 0;
@@ -174,7 +175,7 @@ void unique_property(bProperty *first, bProperty *prop, int force)
BLI_snprintf(num, sizeof(num), "%d", i++);
BLI_strncpy(new_name, base_name, sizeof(prop->name) - strlen(num));
strcat(new_name, num);
- } while(get_property__internal(first, prop, new_name));
+ } while (get_property__internal(first, prop, new_name));
BLI_strncpy(prop->name, new_name, sizeof(prop->name));
}
@@ -190,7 +191,7 @@ void set_ob_property(Object *ob, bProperty *propc)
{
bProperty *prop;
prop= get_ob_property(ob, propc->name);
- if(prop) {
+ if (prop) {
free_property(prop);
BLI_remlink(&ob->prop, prop);
}
@@ -207,12 +208,12 @@ int compare_property(bProperty *prop, const char *str)
switch(prop->type) {
case GPROP_BOOL:
- if(BLI_strcasecmp(str, "true")==0) {
- if(prop->data==1) return 0;
+ if (BLI_strcasecmp(str, "true")==0) {
+ if (prop->data==1) return 0;
else return 1;
}
- else if(BLI_strcasecmp(str, "false")==0) {
- if(prop->data==0) return 0;
+ else if (BLI_strcasecmp(str, "false")==0) {
+ if (prop->data==0) return 0;
else return 1;
}
/* no break, do GPROP_int too! */
@@ -226,8 +227,8 @@ int compare_property(bProperty *prop, const char *str)
// function isn't used currently
fvalue= *((float *)&prop->data);
ftest= (float)atof(str);
- if( fvalue > ftest) return 1;
- else if( fvalue < ftest) return -1;
+ if ( fvalue > ftest) return 1;
+ else if ( fvalue < ftest) return -1;
return 0;
case GPROP_STRING:
@@ -243,8 +244,8 @@ void set_property(bProperty *prop, const char *str)
switch(prop->type) {
case GPROP_BOOL:
- if(BLI_strcasecmp(str, "true")==0) prop->data= 1;
- else if(BLI_strcasecmp(str, "false")==0) prop->data= 0;
+ if (BLI_strcasecmp(str, "true")==0) prop->data= 1;
+ else if (BLI_strcasecmp(str, "false")==0) prop->data= 0;
else prop->data= (atoi(str)!=0);
break;
case GPROP_INT:
@@ -285,7 +286,7 @@ void set_property_valstr(bProperty *prop, char *str)
{
// extern int Gdfra; /* sector.c */
- if(str == NULL) return;
+ if (str == NULL) return;
switch(prop->type) {
case GPROP_BOOL:
diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c
index ffa9e027108..b3e288dfc74 100644
--- a/source/blender/blenkernel/intern/report.c
+++ b/source/blender/blenkernel/intern/report.c
@@ -37,7 +37,6 @@
#include "BKE_report.h"
#include "BKE_global.h" /* G.background only */
-
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
@@ -59,7 +58,7 @@ static const char *report_type_str(int type)
void BKE_reports_init(ReportList *reports, int flag)
{
- if(!reports)
+ if (!reports)
return;
memset(reports, 0, sizeof(ReportList));
@@ -73,7 +72,7 @@ void BKE_reports_clear(ReportList *reports)
{
Report *report, *report_next;
- if(!reports)
+ if (!reports)
return;
report= reports->list.first;
@@ -95,12 +94,12 @@ void BKE_report(ReportList *reports, ReportType type, const char *message)
/* in background mode always print otherwise there are cases the errors wont be displayed,
* but still add to the report list since this is used for python exception handling */
- if(G.background || !reports || ((reports->flag & RPT_PRINT) && (type >= reports->printlevel))) {
+ if (G.background || !reports || ((reports->flag & RPT_PRINT) && (type >= reports->printlevel))) {
printf("%s: %s\n", report_type_str(type), message);
fflush(stdout); /* this ensures the message is printed before a crash */
}
- if(reports && (reports->flag & RPT_STORE) && (type >= reports->storelevel)) {
+ if (reports && (reports->flag & RPT_STORE) && (type >= reports->storelevel)) {
char *message_alloc;
report= MEM_callocN(sizeof(Report), "Report");
report->type= type;
@@ -121,7 +120,7 @@ void BKE_reportf(ReportList *reports, ReportType type, const char *format, ...)
Report *report;
va_list args;
- if(G.background || !reports || ((reports->flag & RPT_PRINT) && (type >= reports->printlevel))) {
+ if (G.background || !reports || ((reports->flag & RPT_PRINT) && (type >= reports->printlevel))) {
va_start(args, format);
vprintf(format, args);
va_end(args);
@@ -129,7 +128,7 @@ void BKE_reportf(ReportList *reports, ReportType type, const char *format, ...)
fflush(stdout); /* this ensures the message is printed before a crash */
}
- if(reports && (reports->flag & RPT_STORE) && (type >= reports->storelevel)) {
+ if (reports && (reports->flag & RPT_STORE) && (type >= reports->storelevel)) {
report= MEM_callocN(sizeof(Report), "Report");
ds= BLI_dynstr_new();
@@ -153,10 +152,10 @@ void BKE_reports_prepend(ReportList *reports, const char *prepend)
Report *report;
DynStr *ds;
- if(!reports)
+ if (!reports)
return;
- for(report=reports->list.first; report; report=report->next) {
+ for (report=reports->list.first; report; report=report->next) {
ds= BLI_dynstr_new();
BLI_dynstr_append(ds, prepend);
@@ -176,10 +175,10 @@ void BKE_reports_prependf(ReportList *reports, const char *prepend, ...)
DynStr *ds;
va_list args;
- if(!reports)
+ if (!reports)
return;
- for(report=reports->list.first; report; report=report->next) {
+ for (report=reports->list.first; report; report=report->next) {
ds= BLI_dynstr_new();
va_start(args, prepend);
BLI_dynstr_vappendf(ds, prepend, args);
@@ -197,7 +196,7 @@ void BKE_reports_prependf(ReportList *reports, const char *prepend, ...)
ReportType BKE_report_print_level(ReportList *reports)
{
- if(!reports)
+ if (!reports)
return RPT_ERROR;
return reports->printlevel;
@@ -205,7 +204,7 @@ ReportType BKE_report_print_level(ReportList *reports)
void BKE_report_print_level_set(ReportList *reports, ReportType level)
{
- if(!reports)
+ if (!reports)
return;
reports->printlevel= level;
@@ -213,7 +212,7 @@ void BKE_report_print_level_set(ReportList *reports, ReportType level)
ReportType BKE_report_store_level(ReportList *reports)
{
- if(!reports)
+ if (!reports)
return RPT_ERROR;
return reports->storelevel;
@@ -221,7 +220,7 @@ ReportType BKE_report_store_level(ReportList *reports)
void BKE_report_store_level_set(ReportList *reports, ReportType level)
{
- if(!reports)
+ if (!reports)
return;
reports->storelevel= level;
@@ -233,12 +232,12 @@ char *BKE_reports_string(ReportList *reports, ReportType level)
DynStr *ds;
char *cstring;
- if(!reports || !reports->list.first)
+ if (!reports || !reports->list.first)
return NULL;
ds= BLI_dynstr_new();
- for(report=reports->list.first; report; report=report->next)
- if(report->type >= level)
+ for (report=reports->list.first; report; report=report->next)
+ if (report->type >= level)
BLI_dynstr_appendf(ds, "%s: %s\n", report->typestr, report->message);
if (BLI_dynstr_get_len(ds))
@@ -257,19 +256,31 @@ void BKE_reports_print(ReportList *reports, ReportType level)
if (cstring == NULL)
return;
- printf("%s", cstring);
+ puts(cstring);
fflush(stdout);
MEM_freeN(cstring);
}
Report *BKE_reports_last_displayable(ReportList *reports)
{
- Report *report=NULL;
+ Report *report;
- for (report= (Report *)reports->list.last; report; report=report->prev) {
+ for (report= reports->list.last; report; report=report->prev) {
if (ELEM3(report->type, RPT_ERROR, RPT_WARNING, RPT_INFO))
return report;
}
return NULL;
}
+
+int BKE_reports_contain(ReportList *reports, ReportType level)
+{
+ Report *report;
+ if (reports != NULL) {
+ for (report=reports->list.first; report; report=report->next)
+ if (report->type >= level)
+ return TRUE;
+ }
+ return FALSE;
+}
+
diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c
index 92dfe90eec1..8123cbf3f0b 100644
--- a/source/blender/blenkernel/intern/sca.c
+++ b/source/blender/blenkernel/intern/sca.c
@@ -54,8 +54,8 @@
void free_sensor(bSensor *sens)
{
- if(sens->links) MEM_freeN(sens->links);
- if(sens->data) MEM_freeN(sens->data);
+ if (sens->links) MEM_freeN(sens->links);
+ if (sens->data) MEM_freeN(sens->data);
MEM_freeN(sens);
}
@@ -64,7 +64,7 @@ void free_sensors(ListBase *lb)
{
bSensor *sens;
- while((sens= lb->first)) {
+ while ((sens= lb->first)) {
BLI_remlink(lb, sens);
free_sensor(sens);
}
@@ -76,11 +76,11 @@ bSensor *copy_sensor(bSensor *sens)
sensn= MEM_dupallocN(sens);
sensn->flag |= SENS_NEW;
- if(sens->data) {
+ if (sens->data) {
sensn->data= MEM_dupallocN(sens->data);
}
- if(sens->links) sensn->links= MEM_dupallocN(sens->links);
+ if (sens->links) sensn->links= MEM_dupallocN(sens->links);
return sensn;
}
@@ -91,7 +91,7 @@ void copy_sensors(ListBase *lbn, ListBase *lbo)
lbn->first= lbn->last= NULL;
sens= lbo->first;
- while(sens) {
+ while (sens) {
sensn= copy_sensor(sens);
BLI_addtail(lbn, sensn);
sens= sens->next;
@@ -106,7 +106,7 @@ void init_sensor(bSensor *sens)
bJoystickSensor *js;
bRaySensor *rs;
- if(sens->data) MEM_freeN(sens->data);
+ if (sens->data) MEM_freeN(sens->data);
sens->data= NULL;
sens->pulse = 0;
@@ -196,9 +196,9 @@ void unlink_controller(bController *cont)
/* check for controller pointers in sensors */
ob= G.main->object.first;
- while(ob) {
+ while (ob) {
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
unlink_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks);
sens= sens->next;
}
@@ -216,10 +216,10 @@ void unlink_controllers(ListBase *lb)
void free_controller(bController *cont)
{
- if(cont->links) MEM_freeN(cont->links);
+ if (cont->links) MEM_freeN(cont->links);
/* the controller itself */
- if(cont->data) MEM_freeN(cont->data);
+ if (cont->data) MEM_freeN(cont->data);
MEM_freeN(cont);
}
@@ -228,9 +228,9 @@ void free_controllers(ListBase *lb)
{
bController *cont;
- while((cont= lb->first)) {
+ while ((cont= lb->first)) {
BLI_remlink(lb, cont);
- if(cont->slinks) MEM_freeN(cont->slinks);
+ if (cont->slinks) MEM_freeN(cont->slinks);
free_controller(cont);
}
}
@@ -241,11 +241,11 @@ bController *copy_controller(bController *cont)
cont->mynew=contn= MEM_dupallocN(cont);
contn->flag |= CONT_NEW;
- if(cont->data) {
+ if (cont->data) {
contn->data= MEM_dupallocN(cont->data);
}
- if(cont->links) contn->links= MEM_dupallocN(cont->links);
+ if (cont->links) contn->links= MEM_dupallocN(cont->links);
contn->slinks= NULL;
contn->totslinks= 0;
@@ -258,7 +258,7 @@ void copy_controllers(ListBase *lbn, ListBase *lbo)
lbn->first= lbn->last= NULL;
cont= lbo->first;
- while(cont) {
+ while (cont) {
contn= copy_controller(cont);
BLI_addtail(lbn, contn);
cont= cont->next;
@@ -269,7 +269,7 @@ void init_controller(bController *cont)
{
/* also use when controller changes type, leave actuators... */
- if(cont->data) MEM_freeN(cont->data);
+ if (cont->data) MEM_freeN(cont->data);
cont->data= NULL;
switch(cont->type) {
@@ -307,9 +307,9 @@ void unlink_actuator(bActuator *act)
/* check for actuator pointers in controllers */
ob= G.main->object.first;
- while(ob) {
+ while (ob) {
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
unlink_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks);
cont= cont->next;
}
@@ -329,11 +329,11 @@ void free_actuator(bActuator *act)
{
bSoundActuator *sa;
- if(act->data) {
+ if (act->data) {
switch (act->type) {
case ACT_SOUND:
sa = (bSoundActuator *) act->data;
- if(sa->sound)
+ if (sa->sound)
id_us_min((ID *) sa->sound);
break;
}
@@ -347,7 +347,7 @@ void free_actuators(ListBase *lb)
{
bActuator *act;
- while((act= lb->first)) {
+ while ((act= lb->first)) {
BLI_remlink(lb, act);
free_actuator(act);
}
@@ -360,14 +360,14 @@ bActuator *copy_actuator(bActuator *act)
act->mynew=actn= MEM_dupallocN(act);
actn->flag |= ACT_NEW;
- if(act->data) {
+ if (act->data) {
actn->data= MEM_dupallocN(act->data);
}
switch (act->type) {
case ACT_SOUND:
sa= (bSoundActuator *)act->data;
- if(sa->sound)
+ if (sa->sound)
id_us_plus((ID *) sa->sound);
break;
}
@@ -380,7 +380,7 @@ void copy_actuators(ListBase *lbn, ListBase *lbo)
lbn->first= lbn->last= NULL;
act= lbo->first;
- while(act) {
+ while (act) {
actn= copy_actuator(act);
BLI_addtail(lbn, actn);
act= act->next;
@@ -395,8 +395,9 @@ void init_actuator(bActuator *act)
bRandomActuator *ra;
bSoundActuator *sa;
bSteeringActuator *sta;
+ bArmatureActuator *arma;
- if(act->data) MEM_freeN(act->data);
+ if (act->data) MEM_freeN(act->data);
act->data= NULL;
switch(act->type) {
@@ -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");
@@ -509,18 +512,18 @@ void clear_sca_new_poins_ob(Object *ob)
bActuator *act;
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
sens->flag &= ~SENS_NEW;
sens= sens->next;
}
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
cont->mynew= NULL;
cont->flag &= ~CONT_NEW;
cont= cont->next;
}
act= ob->actuators.first;
- while(act) {
+ while (act) {
act->mynew= NULL;
act->flag &= ~ACT_NEW;
act= act->next;
@@ -532,7 +535,7 @@ void clear_sca_new_poins(void)
Object *ob;
ob= G.main->object.first;
- while(ob) {
+ while (ob) {
clear_sca_new_poins_ob(ob);
ob= ob->id.next;
}
@@ -546,10 +549,10 @@ void set_sca_new_poins_ob(Object *ob)
int a;
sens= ob->sensors.first;
- while(sens) {
- if(sens->flag & SENS_NEW) {
- for(a=0; a<sens->totlinks; a++) {
- if(sens->links[a] && sens->links[a]->mynew)
+ while (sens) {
+ if (sens->flag & SENS_NEW) {
+ for (a=0; a<sens->totlinks; a++) {
+ if (sens->links[a] && sens->links[a]->mynew)
sens->links[a]= sens->links[a]->mynew;
}
}
@@ -557,10 +560,10 @@ void set_sca_new_poins_ob(Object *ob)
}
cont= ob->controllers.first;
- while(cont) {
- if(cont->flag & CONT_NEW) {
- for(a=0; a<cont->totlinks; a++) {
- if( cont->links[a] && cont->links[a]->mynew)
+ while (cont) {
+ if (cont->flag & CONT_NEW) {
+ for (a=0; a<cont->totlinks; a++) {
+ if ( cont->links[a] && cont->links[a]->mynew)
cont->links[a]= cont->links[a]->mynew;
}
}
@@ -569,42 +572,42 @@ void set_sca_new_poins_ob(Object *ob)
act= ob->actuators.first;
- while(act) {
- if(act->flag & ACT_NEW) {
- if(act->type==ACT_EDIT_OBJECT) {
+ while (act) {
+ if (act->flag & ACT_NEW) {
+ if (act->type==ACT_EDIT_OBJECT) {
bEditObjectActuator *eoa= act->data;
ID_NEW(eoa->ob);
}
- else if(act->type==ACT_SCENE) {
+ else if (act->type==ACT_SCENE) {
bSceneActuator *sca= act->data;
ID_NEW(sca->camera);
}
- else if(act->type==ACT_CAMERA) {
+ else if (act->type==ACT_CAMERA) {
bCameraActuator *ca= act->data;
ID_NEW(ca->ob);
}
- else if(act->type==ACT_OBJECT) {
+ else if (act->type==ACT_OBJECT) {
bObjectActuator *oa= act->data;
ID_NEW(oa->reference);
}
- else if(act->type==ACT_MESSAGE) {
+ else if (act->type==ACT_MESSAGE) {
bMessageActuator *ma= act->data;
ID_NEW(ma->toObject);
}
- else if(act->type==ACT_PARENT) {
+ else if (act->type==ACT_PARENT) {
bParentActuator *para = act->data;
ID_NEW(para->ob);
}
- else if(act->type==ACT_ARMATURE) {
+ else if (act->type==ACT_ARMATURE) {
bArmatureActuator *aa = act->data;
ID_NEW(aa->target);
ID_NEW(aa->subtarget);
}
- else if(act->type==ACT_PROPERTY) {
+ else if (act->type==ACT_PROPERTY) {
bPropertyActuator *pa= act->data;
ID_NEW(pa->ob);
}
- else if(act->type==ACT_STEERING) {
+ else if (act->type==ACT_STEERING) {
bSteeringActuator *sta = act->data;
ID_NEW(sta->navmesh);
ID_NEW(sta->target);
@@ -620,7 +623,7 @@ void set_sca_new_poins(void)
Object *ob;
ob= G.main->object.first;
- while(ob) {
+ while (ob) {
set_sca_new_poins_ob(ob);
ob= ob->id.next;
}
@@ -643,41 +646,41 @@ void sca_remove_ob_poin(Object *obt, Object *ob)
sens= obt->sensors.first;
- while(sens) {
+ while (sens) {
switch(sens->type) {
case SENS_MESSAGE:
ms= sens->data;
- if(ms->fromObject==ob) ms->fromObject= NULL;
+ if (ms->fromObject==ob) ms->fromObject= NULL;
}
sens= sens->next;
}
act= obt->actuators.first;
- while(act) {
+ while (act) {
switch(act->type) {
case ACT_CAMERA:
ca= act->data;
- if(ca->ob==ob) ca->ob= NULL;
+ if (ca->ob==ob) ca->ob= NULL;
break;
case ACT_OBJECT:
oa= act->data;
- if(oa->reference==ob) oa->reference= NULL;
+ if (oa->reference==ob) oa->reference= NULL;
break;
case ACT_PROPERTY:
pa= act->data;
- if(pa->ob==ob) pa->ob= NULL;
+ if (pa->ob==ob) pa->ob= NULL;
break;
case ACT_SCENE:
sa= act->data;
- if(sa->camera==ob) sa->camera= NULL;
+ if (sa->camera==ob) sa->camera= NULL;
break;
case ACT_EDIT_OBJECT:
eoa= act->data;
- if(eoa->ob==ob) eoa->ob= NULL;
+ if (eoa->ob==ob) eoa->ob= NULL;
break;
case ACT_MESSAGE:
ma= act->data;
- if(ma->toObject==ob) ma->toObject= NULL;
+ if (ma->toObject==ob) ma->toObject= NULL;
break;
case ACT_PARENT:
para = act->data;
@@ -707,14 +710,14 @@ void sca_move_sensor(bSensor *sens_to_move, Object *ob, int move_up)
/* make sure this sensor belongs to this object */
sens= ob->sensors.first;
- while(sens) {
- if(sens == sens_to_move) break;
+ while (sens) {
+ if (sens == sens_to_move) break;
sens= sens->next;
}
- if(!sens) return;
+ if (!sens) return;
/* move up */
- if( val==1 && sens->prev) {
+ if ( val==1 && sens->prev) {
for (tmp=sens->prev; tmp; tmp=tmp->prev) {
if (tmp->flag & SENS_VISIBLE)
break;
@@ -725,7 +728,7 @@ void sca_move_sensor(bSensor *sens_to_move, Object *ob, int move_up)
}
}
/* move down */
- else if( val==2 && sens->next) {
+ else if ( val==2 && sens->next) {
for (tmp=sens->next; tmp; tmp=tmp->next) {
if (tmp->flag & SENS_VISIBLE)
break;
@@ -746,18 +749,18 @@ void sca_move_controller(bController *cont_to_move, Object *ob, int move_up)
/* make sure this controller belongs to this object */
cont= ob->controllers.first;
- while(cont) {
- if(cont == cont_to_move) break;
+ while (cont) {
+ if (cont == cont_to_move) break;
cont= cont->next;
}
- if(!cont) return;
+ if (!cont) return;
/* move up */
- if( val==1 && cont->prev) {
+ if ( val==1 && cont->prev) {
/* locate the controller that has the same state mask but is earlier in the list */
tmp = cont->prev;
- while(tmp) {
- if(tmp->state_mask & cont->state_mask)
+ while (tmp) {
+ if (tmp->state_mask & cont->state_mask)
break;
tmp = tmp->prev;
}
@@ -768,10 +771,10 @@ void sca_move_controller(bController *cont_to_move, Object *ob, int move_up)
}
/* move down */
- else if( val==2 && cont->next) {
+ else if ( val==2 && cont->next) {
tmp = cont->next;
- while(tmp) {
- if(tmp->state_mask & cont->state_mask)
+ while (tmp) {
+ if (tmp->state_mask & cont->state_mask)
break;
tmp = tmp->next;
}
@@ -789,14 +792,14 @@ void sca_move_actuator(bActuator *act_to_move, Object *ob, int move_up)
/* make sure this actuator belongs to this object */
act= ob->actuators.first;
- while(act) {
- if(act == act_to_move) break;
+ while (act) {
+ if (act == act_to_move) break;
act= act->next;
}
- if(!act) return;
+ if (!act) return;
/* move up */
- if( val==1 && act->prev) {
+ if ( val==1 && act->prev) {
/* locate the first visible actuators before this one */
for (tmp = act->prev; tmp; tmp=tmp->prev) {
if (tmp->flag & ACT_VISIBLE)
@@ -808,7 +811,7 @@ void sca_move_actuator(bActuator *act_to_move, Object *ob, int move_up)
}
}
/* move down */
- else if( val==2 && act->next) {
+ else if ( val==2 && act->next) {
/* locate the first visible actuators after this one */
for (tmp=act->next; tmp; tmp=tmp->next) {
if (tmp->flag & ACT_VISIBLE)
@@ -844,7 +847,7 @@ void link_logicbricks(void **poin, void ***ppoin, short *tot, short size)
}
(*ppoin)[ibrick] = *poin;
- if(old_links) MEM_freeN(old_links);
+ if (old_links) MEM_freeN(old_links);
}
else {
(*tot) = 1;
@@ -859,14 +862,14 @@ void unlink_logicbricks(void **poin, void ***ppoin, short *tot)
removed= 0;
for (ibrick=0; ibrick < *tot; ibrick++) {
- if(removed) (*ppoin)[ibrick - removed] = (*ppoin)[ibrick];
- else if((*ppoin)[ibrick] == *poin) removed = 1;
+ if (removed) (*ppoin)[ibrick - removed] = (*ppoin)[ibrick];
+ else if ((*ppoin)[ibrick] == *poin) removed = 1;
}
if (removed) {
(*tot) --;
- if(*tot == 0) {
+ if (*tot == 0) {
MEM_freeN(*ppoin);
(*ppoin)= NULL;
}
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index e01cd992ad8..7c242da9aff 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -250,7 +250,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--;
@@ -396,10 +396,10 @@ Scene *add_scene(const char *name)
sce->r.simplify_shadowsamples= 16;
sce->r.simplify_aosss= 1.0f;
- sce->r.border.xmin= 0.0f;
- sce->r.border.ymin= 0.0f;
- sce->r.border.xmax= 1.0f;
- sce->r.border.ymax= 1.0f;
+ sce->r.border.xmin = 0.0f;
+ sce->r.border.ymin = 0.0f;
+ sce->r.border.xmax = 1.0f;
+ sce->r.border.ymax = 1.0f;
sce->toolsettings = MEM_callocN(sizeof(struct ToolSettings),"Tool Settings Struct");
sce->toolsettings->cornertype=1;
@@ -662,7 +662,7 @@ int next_object(Scene **scene, int val, Base **base, Object **ob)
/* XXX particle systems with metas+dupligroups call this recursively */
/* see bug #18725 */
if (in_next_object) {
- printf("ERROR: MetaBall generation called recursively, not supported\n");
+ printf("ERROR: Metaball generation called recursively, not supported\n");
return F_ERROR;
}
@@ -719,8 +719,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);
@@ -757,10 +757,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;
@@ -836,7 +838,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;
@@ -973,7 +975,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);
@@ -1009,10 +1011,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) */
@@ -1057,12 +1059,12 @@ 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
- * so dont call within 'scene_update_tagged_recursive' */
+ * so don't call within 'scene_update_tagged_recursive' */
DAG_scene_update_flags(bmain, sce, lay, TRUE); // only stuff that moves or needs display still
/* All 'standard' (i.e. without any dependencies) animation is handled here,
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 3d28e45f6b7..158fc91c03c 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -59,15 +59,15 @@ static void spacetype_free(SpaceType *st)
PanelType *pt;
HeaderType *ht;
- for(art= st->regiontypes.first; art; art= art->next) {
+ for (art= st->regiontypes.first; art; art= art->next) {
BLI_freelistN(&art->drawcalls);
- for(pt= art->paneltypes.first; pt; pt= pt->next)
- if(pt->ext.free)
+ for (pt= art->paneltypes.first; pt; pt= pt->next)
+ if (pt->ext.free)
pt->ext.free(pt->ext.data);
- for(ht= art->headertypes.first; ht; ht= ht->next)
- if(ht->ext.free)
+ for (ht= art->headertypes.first; ht; ht= ht->next)
+ if (ht->ext.free)
ht->ext.free(ht->ext.data);
BLI_freelistN(&art->paneltypes);
@@ -83,7 +83,7 @@ void BKE_spacetypes_free(void)
{
SpaceType *st;
- for(st= spacetypes.first; st; st= st->next) {
+ for (st= spacetypes.first; st; st= st->next) {
spacetype_free(st);
}
@@ -94,8 +94,8 @@ SpaceType *BKE_spacetype_from_id(int spaceid)
{
SpaceType *st;
- for(st= spacetypes.first; st; st= st->next) {
- if(st->spaceid==spaceid)
+ for (st= spacetypes.first; st; st= st->next) {
+ if (st->spaceid==spaceid)
return st;
}
return NULL;
@@ -105,8 +105,8 @@ ARegionType *BKE_regiontype_from_id(SpaceType *st, int regionid)
{
ARegionType *art;
- for(art= st->regiontypes.first; art; art= art->next)
- if(art->regionid==regionid)
+ for (art= st->regiontypes.first; art; art= art->next)
+ if (art->regionid==regionid)
return art;
printf("Error, region type missing in - name:\"%s\", id:%d\n", st->name, st->spaceid);
@@ -125,7 +125,7 @@ void BKE_spacetype_register(SpaceType *st)
/* sanity check */
stype= BKE_spacetype_from_id(st->spaceid);
- if(stype) {
+ if (stype) {
printf("error: redefinition of spacetype %s\n", stype->name);
spacetype_free(stype);
MEM_freeN(stype);
@@ -145,12 +145,12 @@ void BKE_spacedata_freelist(ListBase *lb)
SpaceType *st= BKE_spacetype_from_id(sl->spacetype);
/* free regions for pushed spaces */
- for(ar=sl->regionbase.first; ar; ar=ar->next)
+ for (ar=sl->regionbase.first; ar; ar=ar->next)
BKE_area_region_free(st, ar);
BLI_freelistN(&sl->regionbase);
- if(st && st->free)
+ if (st && st->free)
st->free(sl);
}
@@ -168,27 +168,27 @@ ARegion *BKE_area_region_copy(SpaceType *st, ARegion *ar)
newar->swinid= 0;
/* use optional regiondata callback */
- if(ar->regiondata) {
+ if (ar->regiondata) {
ARegionType *art= BKE_regiontype_from_id(st, ar->regiontype);
- if(art && art->duplicate)
+ if (art && art->duplicate)
newar->regiondata= art->duplicate(ar->regiondata);
else
newar->regiondata= MEM_dupallocN(ar->regiondata);
}
- if(ar->v2d.tab_offset)
+ if (ar->v2d.tab_offset)
newar->v2d.tab_offset= MEM_dupallocN(ar->v2d.tab_offset);
newar->panels.first= newar->panels.last= NULL;
BLI_duplicatelist(&newar->panels, &ar->panels);
/* copy panel pointers */
- for(newpa= newar->panels.first; newpa; newpa= newpa->next) {
+ for (newpa= newar->panels.first; newpa; newpa= newpa->next) {
patab= newar->panels.first;
pa= ar->panels.first;
- while(patab) {
- if(newpa->paneltab == pa) {
+ while (patab) {
+ if (newpa->paneltab == pa) {
newpa->paneltab = patab;
break;
}
@@ -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;
@@ -209,7 +209,7 @@ static void region_copylist(SpaceType *st, ListBase *lb1, ListBase *lb2)
/* to be sure */
lb1->first= lb1->last= NULL;
- for(ar= lb2->first; ar; ar= ar->next) {
+ for (ar= lb2->first; ar; ar= ar->next) {
ARegion *arnew= BKE_area_region_copy(st, ar);
BLI_addtail(lb1, arnew);
}
@@ -226,7 +226,7 @@ void BKE_spacedata_copylist(ListBase *lb1, ListBase *lb2)
for (sl= lb2->first; sl; sl= sl->next) {
SpaceType *st= BKE_spacetype_from_id(sl->spacetype);
- if(st && st->duplicate) {
+ if (st && st->duplicate) {
SpaceLink *slnew= st->duplicate(sl);
BLI_addtail(lb1, slnew);
@@ -243,11 +243,11 @@ void BKE_spacedata_draw_locks(int set)
{
SpaceType *st;
- for(st= spacetypes.first; st; st= st->next) {
+ for (st= spacetypes.first; st; st= st->next) {
ARegionType *art;
- for(art= st->regiontypes.first; art; art= art->next) {
- if(set)
+ for (art= st->regiontypes.first; art; art= art->next) {
+ if (set)
art->do_lock= art->lock;
else
art->do_lock= 0;
@@ -259,19 +259,19 @@ void BKE_spacedata_draw_locks(int set)
/* not region itself */
void BKE_area_region_free(SpaceType *st, ARegion *ar)
{
- if(st) {
+ if (st) {
ARegionType *art= BKE_regiontype_from_id(st, ar->regiontype);
- if(art && art->free)
+ if (art && art->free)
art->free(ar);
- if(ar->regiondata)
+ if (ar->regiondata)
printf("regiondata free error\n");
}
- else if(ar->type && ar->type->free)
+ else if (ar->type && ar->type->free)
ar->type->free(ar);
- if(ar->v2d.tab_offset) {
+ if (ar->v2d.tab_offset) {
MEM_freeN(ar->v2d.tab_offset);
ar->v2d.tab_offset= NULL;
}
@@ -285,7 +285,7 @@ void BKE_screen_area_free(ScrArea *sa)
SpaceType *st= BKE_spacetype_from_id(sa->spacetype);
ARegion *ar;
- for(ar=sa->regionbase.first; ar; ar=ar->next)
+ for (ar=sa->regionbase.first; ar; ar=ar->next)
BKE_area_region_free(st, ar);
BLI_freelistN(&sa->regionbase);
@@ -301,12 +301,12 @@ void free_screen(bScreen *sc)
ScrArea *sa, *san;
ARegion *ar;
- for(ar=sc->regionbase.first; ar; ar=ar->next)
+ for (ar=sc->regionbase.first; ar; ar=ar->next)
BKE_area_region_free(NULL, ar);
BLI_freelistN(&sc->regionbase);
- for(sa= sc->areabase.first; sa; sa= san) {
+ for (sa= sc->areabase.first; sa; sa= san) {
san= sa->next;
BKE_screen_area_free(sa);
}
@@ -322,14 +322,14 @@ unsigned int BKE_screen_visible_layers(bScreen *screen, Scene *scene)
ScrArea *sa;
unsigned int layer= 0;
- if(screen) {
+ if (screen) {
/* get all used view3d layers */
- for(sa= screen->areabase.first; sa; sa= sa->next)
- if(sa->spacetype==SPACE_VIEW3D)
+ for (sa= screen->areabase.first; sa; sa= sa->next)
+ if (sa->spacetype==SPACE_VIEW3D)
layer |= ((View3D *)sa->spacedata.first)->lay;
}
- if(!layer)
+ if (!layer)
return scene->lay;
return layer;
@@ -359,7 +359,7 @@ struct ScrArea *BKE_screen_find_big_area(struct bScreen *sc, const int spacetype
ScrArea *sa, *big= NULL;
int size, maxsize= 0;
- for(sa= sc->areabase.first; sa; sa= sa->next) {
+ for (sa= sc->areabase.first; sa; sa= sa->next) {
if ((spacetype == -1) || sa->spacetype == spacetype) {
if (min <= sa->winx && min <= sa->winy) {
size= sa->winx*sa->winy;
@@ -378,25 +378,25 @@ void BKE_screen_view3d_sync(struct View3D *v3d, struct Scene *scene)
{
int bit;
- if(v3d->scenelock && v3d->localvd==NULL) {
+ if (v3d->scenelock && v3d->localvd==NULL) {
v3d->lay= scene->lay;
v3d->camera= scene->camera;
- if(v3d->camera==NULL) {
+ if (v3d->camera==NULL) {
ARegion *ar;
- for(ar=v3d->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype == RGN_TYPE_WINDOW) {
+ for (ar=v3d->regionbase.first; ar; ar= ar->next) {
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
RegionView3D *rv3d= ar->regiondata;
- if(rv3d->persp==RV3D_CAMOB)
+ if (rv3d->persp==RV3D_CAMOB)
rv3d->persp= RV3D_PERSP;
}
}
}
- if((v3d->lay & v3d->layact) == 0) {
- for(bit= 0; bit<32; bit++) {
- if(v3d->lay & (1<<bit)) {
+ if ((v3d->lay & v3d->layact) == 0) {
+ for (bit= 0; bit<32; bit++) {
+ if (v3d->lay & (1<<bit)) {
v3d->layact= 1<<bit;
break;
}
@@ -409,10 +409,10 @@ void BKE_screen_view3d_scene_sync(bScreen *sc)
{
/* are there cameras in the views that are not in the scene? */
ScrArea *sa;
- for(sa= sc->areabase.first; sa; sa= sa->next) {
+ for (sa= sc->areabase.first; sa; sa= sa->next) {
SpaceLink *sl;
- for(sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_VIEW3D) {
+ for (sl= sa->spacedata.first; sl; sl= sl->next) {
+ if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D*) sl;
BKE_screen_view3d_sync(v3d, sc->scene);
}
@@ -427,13 +427,13 @@ void BKE_screen_view3d_main_sync(ListBase *screen_lb, Scene *scene)
SpaceLink *sl;
/* from scene copy to the other views */
- for(sc=screen_lb->first; sc; sc=sc->id.next) {
- if(sc->scene!=scene)
+ for (sc=screen_lb->first; sc; sc=sc->id.next) {
+ if (sc->scene!=scene)
continue;
- for(sa=sc->areabase.first; sa; sa=sa->next)
- for(sl=sa->spacedata.first; sl; sl=sl->next)
- if(sl->spacetype==SPACE_VIEW3D)
+ for (sa=sc->areabase.first; sa; sa=sa->next)
+ for (sl=sa->spacedata.first; sl; sl=sl->next)
+ if (sl->spacetype==SPACE_VIEW3D)
BKE_screen_view3d_sync((View3D*)sl, scene);
}
}
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/seqcache.c b/source/blender/blenkernel/intern/seqcache.c
index c5761dcc456..f1f3dd47d8b 100644
--- a/source/blender/blenkernel/intern/seqcache.c
+++ b/source/blender/blenkernel/intern/seqcache.c
@@ -91,13 +91,13 @@ static int seqcache_hashcmp(const void *a_, const void *b_)
void seq_stripelem_cache_destruct(void)
{
- if(moviecache)
+ if (moviecache)
IMB_moviecache_free(moviecache);
}
void seq_stripelem_cache_cleanup(void)
{
- if(moviecache) {
+ if (moviecache) {
IMB_moviecache_free(moviecache);
moviecache = IMB_moviecache_create(sizeof(seqCacheKey), seqcache_hashhash,
seqcache_hashcmp, NULL);
@@ -109,7 +109,7 @@ struct ImBuf * seq_stripelem_cache_get(
float cfra, seq_stripelem_ibuf_t type)
{
- if(moviecache && seq) {
+ if (moviecache && seq) {
seqCacheKey key;
key.seq = seq;
@@ -133,7 +133,7 @@ void seq_stripelem_cache_put(
return;
}
- if(!moviecache) {
+ if (!moviecache) {
moviecache = IMB_moviecache_create(sizeof(seqCacheKey), seqcache_hashhash,
seqcache_hashcmp, NULL);
}
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index aebdf3cef65..3aadfa309c5 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -85,13 +85,15 @@ static struct ImBuf * prepare_effect_imbufs(
if (!ibuf1 && !ibuf2 && !ibuf3) {
/* hmmm, global float option ? */
out = IMB_allocImBuf((short)x, (short)y, 32, IB_rect);
- } else if ((ibuf1 && ibuf1->rect_float) ||
+ }
+ else if ((ibuf1 && ibuf1->rect_float) ||
(ibuf2 && ibuf2->rect_float) ||
(ibuf3 && ibuf3->rect_float)) {
/* if any inputs are rectfloat, output is float too */
out = IMB_allocImBuf((short)x, (short)y, 32, IB_rectfloat);
- } else {
+ }
+ else {
out = IMB_allocImBuf((short)x, (short)y, 32, IB_rect);
}
@@ -119,8 +121,8 @@ static struct ImBuf * prepare_effect_imbufs(
}
/* **********************************************************************
- PLUGINS
- ********************************************************************** */
+ * PLUGINS
+ * ********************************************************************** */
static void open_plugin_seq(PluginSeq *pis, const char *seqname)
{
@@ -139,12 +141,12 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname)
/* clear the error list */
BLI_dynlib_get_error_as_string(NULL);
- /* if(pis->handle) BLI_dynlib_close(pis->handle); */
+ /* if (pis->handle) BLI_dynlib_close(pis->handle); */
/* pis->handle= 0; */
/* open the needed object */
pis->handle= BLI_dynlib_open(pis->name);
- if(test_dlerr(pis->name, pis->name)) return;
+ if (test_dlerr(pis->name, pis->name)) return;
if (pis->handle != NULL) {
/* find the address of the version function */
@@ -159,7 +161,7 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname)
info_func= (int (*)(PluginInfo *))BLI_dynlib_find_symbol(pis->handle, "plugin_getinfo");
- if(info_func == NULL) error("No info func");
+ if (info_func == NULL) error("No info func");
else {
info_func(info);
@@ -176,8 +178,9 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname)
MEM_freeN(info);
cp= BLI_dynlib_find_symbol(pis->handle, "seqname");
- if(cp) BLI_strncpy(cp, seqname, SEQ_NAME_MAXSTR);
- } else {
+ if (cp) BLI_strncpy(cp, seqname, SEQ_NAME_MAXSTR);
+ }
+ else {
printf ("Plugin returned unrecognized version number\n");
return;
}
@@ -205,8 +208,8 @@ static PluginSeq *add_plugin_seq(const char *str, const char *seqname)
BLI_strncpy(pis->name, str, FILE_MAX);
open_plugin_seq(pis, seqname);
- if(pis->doit==NULL) {
- if(pis->handle==NULL) error("no plugin: %s", str);
+ if (pis->doit==NULL) {
+ if (pis->handle==NULL) error("no plugin: %s", str);
else error("in plugin: %s", str);
MEM_freeN(pis);
return NULL;
@@ -214,10 +217,10 @@ static PluginSeq *add_plugin_seq(const char *str, const char *seqname)
/* default values */
varstr= pis->varstr;
- for(a=0; a<pis->vars; a++, varstr++) {
- if( (varstr->type & FLO)==FLO)
+ for (a=0; a<pis->vars; a++, varstr++) {
+ if ( (varstr->type & FLO)==FLO)
pis->data[a]= varstr->def;
- else if( (varstr->type & INT)==INT)
+ else if ( (varstr->type & INT)==INT)
*((int *)(pis->data+a))= (int) varstr->def;
}
@@ -226,7 +229,7 @@ static PluginSeq *add_plugin_seq(const char *str, const char *seqname)
static void free_plugin_seq(PluginSeq *pis)
{
- if(pis==NULL) return;
+ if (pis==NULL) return;
/* no BLI_dynlib_close: same plugin can be opened multiple times with 1 handle */
@@ -265,7 +268,7 @@ static void load_plugin(Sequence * seq)
static void copy_plugin(Sequence * dst, Sequence * src)
{
- if(src->plugin) {
+ if (src->plugin) {
dst->plugin= MEM_dupallocN(src->plugin);
open_plugin_seq(dst->plugin, dst->name+2);
}
@@ -288,16 +291,16 @@ 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;
int y = context.recty;
- if(seq->plugin && seq->plugin->doit) {
+ if (seq->plugin && seq->plugin->doit) {
- if(seq->plugin->cfra)
+ if (seq->plugin->cfra)
*(seq->plugin->cfra)= cfra;
cp = BLI_dynlib_find_symbol(
@@ -306,7 +309,7 @@ static struct ImBuf * do_plugin_effect(
/* XXX: it's crappy to limit copying buffer by it's lemgth,
* but assuming plugin stuff is using correct buffer size
* it should be fine */
- if(cp) strncpy(cp, seq->name+2, sizeof(seq->name)-2);
+ if (cp) strncpy(cp, seq->name+2, sizeof(seq->name)-2);
if (seq->plugin->current_private_data) {
*seq->plugin->current_private_data
@@ -342,9 +345,9 @@ static struct ImBuf * do_plugin_effect(
}
if (seq->plugin->version<=2) {
- if(ibuf1) IMB_convert_rgba_to_abgr(ibuf1);
- if(ibuf2) IMB_convert_rgba_to_abgr(ibuf2);
- if(ibuf3) IMB_convert_rgba_to_abgr(ibuf3);
+ if (ibuf1) IMB_convert_rgba_to_abgr(ibuf1);
+ if (ibuf2) IMB_convert_rgba_to_abgr(ibuf2);
+ if (ibuf3) IMB_convert_rgba_to_abgr(ibuf3);
}
if (seq->plugin->version<=4) {
@@ -354,7 +357,8 @@ static struct ImBuf * do_plugin_effect(
IMB_cast_away_list(ibuf2),
IMB_cast_away_list(out),
IMB_cast_away_list(ibuf3));
- } else {
+ }
+ else {
((SeqDoit)seq->plugin->doit)(
seq->plugin->data, facf0, facf1, x, y,
ibuf1, ibuf2, out, ibuf3);
@@ -362,9 +366,9 @@ static struct ImBuf * do_plugin_effect(
if (seq->plugin->version<=2) {
if (!use_temp_bufs) {
- if(ibuf1) IMB_convert_rgba_to_abgr(ibuf1);
- if(ibuf2) IMB_convert_rgba_to_abgr(ibuf2);
- if(ibuf3) IMB_convert_rgba_to_abgr(ibuf3);
+ if (ibuf1) IMB_convert_rgba_to_abgr(ibuf1);
+ if (ibuf2) IMB_convert_rgba_to_abgr(ibuf2);
+ if (ibuf3) IMB_convert_rgba_to_abgr(ibuf3);
}
IMB_convert_rgba_to_abgr(out);
}
@@ -394,8 +398,8 @@ static void free_plugin(struct Sequence * seq)
}
/* **********************************************************************
- ALPHA OVER
- ********************************************************************** */
+ * ALPHA OVER
+ * ********************************************************************** */
static void init_alpha_over_or_under(Sequence * seq)
{
@@ -421,51 +425,51 @@ static void do_alphaover_effect_byte(float facf0, float facf1, int x, int y,
fac2= (int)(256.0f*facf0);
fac4= (int)(256.0f*facf1);
- while(y--) {
+ while (y--) {
x= xo;
- while(x--) {
+ while (x--) {
/* rt = rt1 over rt2 (alpha from rt1) */
fac= fac2;
mfac= 256 - ( (fac2*rt1[3])>>8 );
- if(fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
- else if(mfac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt1);
+ if (fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
+ else if (mfac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt1);
else {
tempc= ( fac*rt1[0] + mfac*rt2[0])>>8;
- if(tempc>255) rt[0]= 255; else rt[0]= tempc;
+ if (tempc>255) rt[0]= 255; else rt[0]= tempc;
tempc= ( fac*rt1[1] + mfac*rt2[1])>>8;
- if(tempc>255) rt[1]= 255; else rt[1]= tempc;
+ if (tempc>255) rt[1]= 255; else rt[1]= tempc;
tempc= ( fac*rt1[2] + mfac*rt2[2])>>8;
- if(tempc>255) rt[2]= 255; else rt[2]= tempc;
+ if (tempc>255) rt[2]= 255; else rt[2]= tempc;
tempc= ( fac*rt1[3] + mfac*rt2[3])>>8;
- if(tempc>255) rt[3]= 255; else rt[3]= tempc;
+ if (tempc>255) rt[3]= 255; else rt[3]= tempc;
}
rt1+= 4; rt2+= 4; rt+= 4;
}
- if(y==0) break;
+ if (y==0) break;
y--;
x= xo;
- while(x--) {
+ while (x--) {
fac= fac4;
mfac= 256 - ( (fac4*rt1[3])>>8 );
- if(fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
- else if(mfac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt1);
+ if (fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
+ else if (mfac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt1);
else {
tempc= ( fac*rt1[0] + mfac*rt2[0])>>8;
- if(tempc>255) rt[0]= 255; else rt[0]= tempc;
+ if (tempc>255) rt[0]= 255; else rt[0]= tempc;
tempc= ( fac*rt1[1] + mfac*rt2[1])>>8;
- if(tempc>255) rt[1]= 255; else rt[1]= tempc;
+ if (tempc>255) rt[1]= 255; else rt[1]= tempc;
tempc= ( fac*rt1[2] + mfac*rt2[2])>>8;
- if(tempc>255) rt[2]= 255; else rt[2]= tempc;
+ if (tempc>255) rt[2]= 255; else rt[2]= tempc;
tempc= ( fac*rt1[3] + mfac*rt2[3])>>8;
- if(tempc>255) rt[3]= 255; else rt[3]= tempc;
+ if (tempc>255) rt[3]= 255; else rt[3]= tempc;
}
rt1+= 4; rt2+= 4; rt+= 4;
}
@@ -487,21 +491,23 @@ static void do_alphaover_effect_float(float facf0, float facf1, int x, int y,
fac2= facf0;
fac4= facf1;
- while(y--) {
+ while (y--) {
x= xo;
- while(x--) {
+ while (x--) {
/* rt = rt1 over rt2 (alpha from rt1) */
fac= fac2;
mfac= 1.0f - (fac2 * rt1[3]);
- if(fac <= 0.0f) {
+ if (fac <= 0.0f) {
memcpy(rt, rt2, 4 * sizeof(float));
- } else if(mfac <=0) {
+ }
+ else if (mfac <=0) {
memcpy(rt, rt1, 4 * sizeof(float));
- } else {
+ }
+ else {
rt[0] = fac*rt1[0] + mfac*rt2[0];
rt[1] = fac*rt1[1] + mfac*rt2[1];
rt[2] = fac*rt1[2] + mfac*rt2[2];
@@ -510,20 +516,22 @@ static void do_alphaover_effect_float(float facf0, float facf1, int x, int y,
rt1+= 4; rt2+= 4; rt+= 4;
}
- if(y==0) break;
+ if (y==0) break;
y--;
x= xo;
- while(x--) {
+ while (x--) {
fac= fac4;
mfac= 1.0f - (fac4*rt1[3]);
- if(fac <= 0.0f) {
+ if (fac <= 0.0f) {
memcpy(rt, rt2, 4 * sizeof(float));
- } else if(mfac <= 0.0f) {
+ }
+ else if (mfac <= 0.0f) {
memcpy(rt, rt1, 4 * sizeof(float));
- } else {
+ }
+ else {
rt[0] = fac*rt1[0] + mfac*rt2[0];
rt[1] = fac*rt1[1] + mfac*rt2[1];
rt[2] = fac*rt1[2] + mfac*rt2[2];
@@ -547,7 +555,8 @@ static struct ImBuf * do_alphaover_effect(
facf0, facf1, context.rectx, context.recty,
ibuf1->rect_float, ibuf2->rect_float,
out->rect_float);
- } else {
+ }
+ else {
do_alphaover_effect_byte(
facf0, facf1, context.rectx, context.recty,
(char*) ibuf1->rect, (char*) ibuf2->rect,
@@ -558,8 +567,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,
@@ -577,23 +586,23 @@ static void do_alphaunder_effect_byte(
fac2= (int)(256.0f*facf0);
fac4= (int)(256.0f*facf1);
- while(y--) {
+ while (y--) {
x= xo;
- while(x--) {
+ while (x--) {
/* rt = rt1 under rt2 (alpha from rt2) */
/* this complex optimalisation is because the
* 'skybuf' can be crossed in
*/
- if(rt2[3]==0 && fac2==256) *( (unsigned int *)rt) = *( (unsigned int *)rt1);
- else if(rt2[3]==255) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
+ if (rt2[3]==0 && fac2==256) *( (unsigned int *)rt) = *( (unsigned int *)rt1);
+ else if (rt2[3]==255) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
else {
mfac= rt2[3];
fac= (fac2*(256-mfac))>>8;
- if(fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
+ if (fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
else {
rt[0]= ( fac*rt1[0] + mfac*rt2[0])>>8;
rt[1]= ( fac*rt1[1] + mfac*rt2[1])>>8;
@@ -604,19 +613,19 @@ static void do_alphaunder_effect_byte(
rt1+= 4; rt2+= 4; rt+= 4;
}
- if(y==0) break;
+ if (y==0) break;
y--;
x= xo;
- while(x--) {
+ while (x--) {
- if(rt2[3]==0 && fac4==256) *( (unsigned int *)rt) = *( (unsigned int *)rt1);
- else if(rt2[3]==255) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
+ if (rt2[3]==0 && fac4==256) *( (unsigned int *)rt) = *( (unsigned int *)rt1);
+ else if (rt2[3]==255) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
else {
mfac= rt2[3];
fac= (fac4*(256-mfac))>>8;
- if(fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
+ if (fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
else {
rt[0]= ( fac*rt1[0] + mfac*rt2[0])>>8;
rt[1]= ( fac*rt1[1] + mfac*rt2[1])>>8;
@@ -646,27 +655,30 @@ static void do_alphaunder_effect_float(float facf0, float facf1, int x, int y,
fac2= facf0;
fac4= facf1;
- while(y--) {
+ while (y--) {
x= xo;
- while(x--) {
+ while (x--) {
/* rt = rt1 under rt2 (alpha from rt2) */
/* this complex optimalisation is because the
* 'skybuf' can be crossed in
*/
- if( rt2[3]<=0 && fac2 >= 1.0f) {
+ if ( rt2[3]<=0 && fac2 >= 1.0f) {
memcpy(rt, rt1, 4 * sizeof(float));
- } else if(rt2[3] >= 1.0f) {
+ }
+ else if (rt2[3] >= 1.0f) {
memcpy(rt, rt2, 4 * sizeof(float));
- } else {
+ }
+ else {
mfac = rt2[3];
fac = fac2 * (1.0f - mfac);
- if(fac == 0) {
+ if (fac == 0) {
memcpy(rt, rt2, 4 * sizeof(float));
- } else {
+ }
+ else {
rt[0]= fac*rt1[0] + mfac*rt2[0];
rt[1]= fac*rt1[1] + mfac*rt2[1];
rt[2]= fac*rt1[2] + mfac*rt2[2];
@@ -676,24 +688,27 @@ static void do_alphaunder_effect_float(float facf0, float facf1, int x, int y,
rt1+= 4; rt2+= 4; rt+= 4;
}
- if(y==0) break;
+ if (y==0) break;
y--;
x= xo;
- while(x--) {
+ while (x--) {
- if(rt2[3]<=0 && fac4 >= 1.0f) {
+ if (rt2[3]<=0 && fac4 >= 1.0f) {
memcpy(rt, rt1, 4 * sizeof(float));
- } else if(rt2[3]>=1.0f) {
+ }
+ else if (rt2[3]>=1.0f) {
memcpy(rt, rt2, 4 * sizeof(float));
- } else {
+ }
+ else {
mfac= rt2[3];
fac= fac4*(1.0f-mfac);
- if(fac == 0) {
+ if (fac == 0) {
memcpy(rt, rt2, 4 * sizeof(float));
- } else {
+ }
+ else {
rt[0]= fac * rt1[0] + mfac * rt2[0];
rt[1]= fac * rt1[1] + mfac * rt2[1];
rt[2]= fac * rt1[2] + mfac * rt2[2];
@@ -719,7 +734,8 @@ static struct ImBuf* do_alphaunder_effect(
facf0, facf1, context.rectx, context.recty,
ibuf1->rect_float, ibuf2->rect_float,
out->rect_float);
- } else {
+ }
+ else {
do_alphaunder_effect_byte(
facf0, facf1, context.rectx, context.recty,
(char*) ibuf1->rect, (char*) ibuf2->rect,
@@ -730,8 +746,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,
@@ -751,10 +767,10 @@ static void do_cross_effect_byte(float facf0, float facf1, int x, int y,
fac4= (int)(256.0f*facf1);
fac3= 256-fac4;
- while(y--) {
+ while (y--) {
x= xo;
- while(x--) {
+ while (x--) {
rt[0]= (fac1*rt1[0] + fac2*rt2[0])>>8;
rt[1]= (fac1*rt1[1] + fac2*rt2[1])>>8;
@@ -764,11 +780,11 @@ static void do_cross_effect_byte(float facf0, float facf1, int x, int y,
rt1+= 4; rt2+= 4; rt+= 4;
}
- if(y==0) break;
+ if (y==0) break;
y--;
x= xo;
- while(x--) {
+ while (x--) {
rt[0]= (fac3*rt1[0] + fac4*rt2[0])>>8;
rt[1]= (fac3*rt1[1] + fac4*rt2[1])>>8;
@@ -798,10 +814,10 @@ static void do_cross_effect_float(float facf0, float facf1, int x, int y,
fac4= facf1;
fac3= 1.0f - fac4;
- while(y--) {
+ while (y--) {
x= xo;
- while(x--) {
+ while (x--) {
rt[0]= fac1*rt1[0] + fac2*rt2[0];
rt[1]= fac1*rt1[1] + fac2*rt2[1];
@@ -811,11 +827,11 @@ static void do_cross_effect_float(float facf0, float facf1, int x, int y,
rt1+= 4; rt2+= 4; rt+= 4;
}
- if(y==0) break;
+ if (y==0) break;
y--;
x= xo;
- while(x--) {
+ while (x--) {
rt[0]= fac3*rt1[0] + fac4*rt2[0];
rt[1]= fac3*rt1[1] + fac4*rt2[1];
@@ -844,7 +860,8 @@ static struct ImBuf* do_cross_effect(
facf0, facf1, context.rectx, context.recty,
ibuf1->rect_float, ibuf2->rect_float,
out->rect_float);
- } else {
+ }
+ else {
do_cross_effect_byte(
facf0, facf1, context.rectx, context.recty,
(char*) ibuf1->rect, (char*) ibuf2->rect,
@@ -855,8 +872,8 @@ static struct ImBuf* do_cross_effect(
/* **********************************************************************
- GAMMA CROSS
- ********************************************************************** */
+ * GAMMA CROSS
+ * ********************************************************************** */
/* copied code from initrender.c */
static unsigned short gamtab[65536];
@@ -956,19 +973,19 @@ static void gamtabs(float gamma)
int a;
/* gamtab: in short, out short */
- for(a=0; a<65536; a++) {
+ for (a=0; a<65536; a++) {
val= a;
val/= 65535.0f;
- if(gamma==2.0f) val= sqrt(val);
- else if(gamma!=1.0f) val= pow(val, igamma);
+ if (gamma==2.0f) val= sqrt(val);
+ else if (gamma!=1.0f) val= pow(val, igamma);
gamtab[a]= (65535.99f*val);
}
/* inverse gamtab1 : in byte, out short */
- for(a=1; a<=256; a++) {
- if(gamma==2.0f) igamtab1[a-1]= a*a-1;
- else if(gamma==1.0f) igamtab1[a-1]= 256*a-1;
+ for (a=1; a<=256; a++) {
+ if (gamma==2.0f) igamtab1[a-1]= a*a-1;
+ else if (gamma==1.0f) igamtab1[a-1]= 256*a-1;
else {
val= a/256.0f;
igamtab1[a - 1]= (65535.0 * pow(val, gamma)) - 1;
@@ -1016,37 +1033,37 @@ static void do_gammacross_effect_byte(float facf0, float UNUSED(facf1),
fac2= (int)(256.0f*facf0);
fac1= 256-fac2;
- while(y--) {
+ while (y--) {
x= xo;
- while(x--) {
+ while (x--) {
col= (fac1*igamtab1[rt1[0]] + fac2*igamtab1[rt2[0]])>>8;
- if(col>65535) rt[0]= 255; else rt[0]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
+ if (col>65535) rt[0]= 255; else rt[0]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
col=(fac1*igamtab1[rt1[1]] + fac2*igamtab1[rt2[1]])>>8;
- if(col>65535) rt[1]= 255; else rt[1]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
+ if (col>65535) rt[1]= 255; else rt[1]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
col= (fac1*igamtab1[rt1[2]] + fac2*igamtab1[rt2[2]])>>8;
- if(col>65535) rt[2]= 255; else rt[2]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
+ if (col>65535) rt[2]= 255; else rt[2]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
col= (fac1*igamtab1[rt1[3]] + fac2*igamtab1[rt2[3]])>>8;
- if(col>65535) rt[3]= 255; else rt[3]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
+ if (col>65535) rt[3]= 255; else rt[3]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
rt1+= 4; rt2+= 4; rt+= 4;
}
- if(y==0) break;
+ if (y==0) break;
y--;
x= xo;
- while(x--) {
+ while (x--) {
col= (fac1*igamtab1[rt1[0]] + fac2*igamtab1[rt2[0]])>>8;
- if(col>65535) rt[0]= 255; else rt[0]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
+ if (col>65535) rt[0]= 255; else rt[0]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
col= (fac1*igamtab1[rt1[1]] + fac2*igamtab1[rt2[1]])>>8;
- if(col>65535) rt[1]= 255; else rt[1]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
+ if (col>65535) rt[1]= 255; else rt[1]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
col= (fac1*igamtab1[rt1[2]] + fac2*igamtab1[rt2[2]])>>8;
- if(col>65535) rt[2]= 255; else rt[2]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
+ if (col>65535) rt[2]= 255; else rt[2]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
col= (fac1*igamtab1[rt1[3]] + fac2*igamtab1[rt2[3]])>>8;
- if(col>65535) rt[3]= 255; else rt[3]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
+ if (col>65535) rt[3]= 255; else rt[3]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
rt1+= 4; rt2+= 4; rt+= 4;
}
@@ -1071,10 +1088,10 @@ static void do_gammacross_effect_float(float facf0, float UNUSED(facf1),
fac2= facf0;
fac1= 1.0f - fac2;
- while(y--) {
+ while (y--) {
x= xo * 4;
- while(x--) {
+ while (x--) {
*rt= gammaCorrect(
fac1 * invGammaCorrect(*rt1)
@@ -1082,11 +1099,11 @@ static void do_gammacross_effect_float(float facf0, float UNUSED(facf1),
rt1++; rt2++; rt++;
}
- if(y==0) break;
+ if (y==0) break;
y--;
x= xo * 4;
- while(x--) {
+ while (x--) {
*rt= gammaCorrect(
fac1*invGammaCorrect(*rt1)
@@ -1113,7 +1130,8 @@ static struct ImBuf * do_gammacross_effect(
facf0, facf1, context.rectx, context.recty,
ibuf1->rect_float, ibuf2->rect_float,
out->rect_float);
- } else {
+ }
+ else {
do_gammacross_effect_byte(
facf0, facf1, context.rectx, context.recty,
(unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect,
@@ -1124,8 +1142,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,
@@ -1142,37 +1160,37 @@ static void do_add_effect_byte(float facf0, float facf1, int x, int y,
fac1= (int)(256.0f*facf0);
fac3= (int)(256.0f*facf1);
- while(y--) {
+ while (y--) {
x= xo;
- while(x--) {
+ while (x--) {
col= rt1[0]+ ((fac1*rt2[0])>>8);
- if(col>255) rt[0]= 255; else rt[0]= col;
+ if (col>255) rt[0]= 255; else rt[0]= col;
col= rt1[1]+ ((fac1*rt2[1])>>8);
- if(col>255) rt[1]= 255; else rt[1]= col;
+ if (col>255) rt[1]= 255; else rt[1]= col;
col= rt1[2]+ ((fac1*rt2[2])>>8);
- if(col>255) rt[2]= 255; else rt[2]= col;
+ if (col>255) rt[2]= 255; else rt[2]= col;
col= rt1[3]+ ((fac1*rt2[3])>>8);
- if(col>255) rt[3]= 255; else rt[3]= col;
+ if (col>255) rt[3]= 255; else rt[3]= col;
rt1+= 4; rt2+= 4; rt+= 4;
}
- if(y==0) break;
+ if (y==0) break;
y--;
x= xo;
- while(x--) {
+ while (x--) {
col= rt1[0]+ ((fac3*rt2[0])>>8);
- if(col>255) rt[0]= 255; else rt[0]= col;
+ if (col>255) rt[0]= 255; else rt[0]= col;
col= rt1[1]+ ((fac3*rt2[1])>>8);
- if(col>255) rt[1]= 255; else rt[1]= col;
+ if (col>255) rt[1]= 255; else rt[1]= col;
col= rt1[2]+ ((fac3*rt2[2])>>8);
- if(col>255) rt[2]= 255; else rt[2]= col;
+ if (col>255) rt[2]= 255; else rt[2]= col;
col= rt1[3]+ ((fac3*rt2[3])>>8);
- if(col>255) rt[3]= 255; else rt[3]= col;
+ if (col>255) rt[3]= 255; else rt[3]= col;
rt1+= 4; rt2+= 4; rt+= 4;
}
@@ -1195,20 +1213,20 @@ static void do_add_effect_float(float facf0, float facf1, int x, int y,
fac1= facf0;
fac3= facf1;
- while(y--) {
+ while (y--) {
x= xo * 4;
- while(x--) {
+ while (x--) {
*rt = *rt1 + fac1 * (*rt2);
rt1++; rt2++; rt++;
}
- if(y==0) break;
+ if (y==0) break;
y--;
x= xo * 4;
- while(x--) {
+ while (x--) {
*rt = *rt1 + fac3 * (*rt2);
rt1++; rt2++; rt++;
@@ -1229,7 +1247,8 @@ static struct ImBuf * do_add_effect(SeqRenderData context,
facf0, facf1, context.rectx, context.recty,
ibuf1->rect_float, ibuf2->rect_float,
out->rect_float);
- } else {
+ }
+ else {
do_add_effect_byte(
facf0, facf1, context.rectx, context.recty,
(unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect,
@@ -1240,8 +1259,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,
@@ -1258,37 +1277,37 @@ static void do_sub_effect_byte(float facf0, float facf1,
fac1= (int)(256.0f*facf0);
fac3= (int)(256.0f*facf1);
- while(y--) {
+ while (y--) {
x= xo;
- while(x--) {
+ while (x--) {
col= rt1[0]- ((fac1*rt2[0])>>8);
- if(col<0) rt[0]= 0; else rt[0]= col;
+ if (col<0) rt[0]= 0; else rt[0]= col;
col= rt1[1]- ((fac1*rt2[1])>>8);
- if(col<0) rt[1]= 0; else rt[1]= col;
+ if (col<0) rt[1]= 0; else rt[1]= col;
col= rt1[2]- ((fac1*rt2[2])>>8);
- if(col<0) rt[2]= 0; else rt[2]= col;
+ if (col<0) rt[2]= 0; else rt[2]= col;
col= rt1[3]- ((fac1*rt2[3])>>8);
- if(col<0) rt[3]= 0; else rt[3]= col;
+ if (col<0) rt[3]= 0; else rt[3]= col;
rt1+= 4; rt2+= 4; rt+= 4;
}
- if(y==0) break;
+ if (y==0) break;
y--;
x= xo;
- while(x--) {
+ while (x--) {
col= rt1[0]- ((fac3*rt2[0])>>8);
- if(col<0) rt[0]= 0; else rt[0]= col;
+ if (col<0) rt[0]= 0; else rt[0]= col;
col= rt1[1]- ((fac3*rt2[1])>>8);
- if(col<0) rt[1]= 0; else rt[1]= col;
+ if (col<0) rt[1]= 0; else rt[1]= col;
col= rt1[2]- ((fac3*rt2[2])>>8);
- if(col<0) rt[2]= 0; else rt[2]= col;
+ if (col<0) rt[2]= 0; else rt[2]= col;
col= rt1[3]- ((fac3*rt2[3])>>8);
- if(col<0) rt[3]= 0; else rt[3]= col;
+ if (col<0) rt[3]= 0; else rt[3]= col;
rt1+= 4; rt2+= 4; rt+= 4;
}
@@ -1311,20 +1330,20 @@ static void do_sub_effect_float(float facf0, float facf1, int x, int y,
fac1= facf0;
fac3= facf1;
- while(y--) {
+ while (y--) {
x= xo * 4;
- while(x--) {
+ while (x--) {
*rt = *rt1 - fac1 * (*rt2);
rt1++; rt2++; rt++;
}
- if(y==0) break;
+ if (y==0) break;
y--;
x= xo * 4;
- while(x--) {
+ while (x--) {
*rt = *rt1 - fac3 * (*rt2);
rt1++; rt2++; rt++;
@@ -1345,7 +1364,8 @@ static struct ImBuf * do_sub_effect(
facf0, facf1, context.rectx, context.recty,
ibuf1->rect_float, ibuf2->rect_float,
out->rect_float);
- } else {
+ }
+ else {
do_sub_effect_byte(
facf0, facf1, context.rectx, context.recty,
(char*) ibuf1->rect, (char*) ibuf2->rect,
@@ -1355,8 +1375,8 @@ static struct ImBuf * do_sub_effect(
}
/* **********************************************************************
- DROP
- ********************************************************************** */
+ * DROP
+ * ********************************************************************** */
/* Must be > 0 or add precopy, etc to the function */
#define XOFF 8
@@ -1380,7 +1400,7 @@ static void do_drop_effect_byte(float facf0, float facf1, int x, int y,
rt1= (char*) rect1i;
out= (char*) outi;
for (y=0; y<height-YOFF; y++) {
- if(field) fac= fac1;
+ if (field) fac= fac1;
else fac= fac2;
field= !field;
@@ -1421,7 +1441,7 @@ static void do_drop_effect_float(float facf0, float facf1, int x, int y,
rt1= rect1i;
out= outi;
for (y=0; y<height-YOFF; y++) {
- if(field) fac= fac1;
+ if (field) fac= fac1;
else fac= fac2;
field= !field;
@@ -1444,8 +1464,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,13 +1484,13 @@ 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--) {
+ while (y--) {
x= xo;
- while(x--) {
+ while (x--) {
rt[0]= rt1[0] + ((fac1*rt1[0]*(rt2[0]-256))>>16);
rt[1]= rt1[1] + ((fac1*rt1[1]*(rt2[1]-256))>>16);
@@ -1480,11 +1500,11 @@ static void do_mul_effect_byte(float facf0, float facf1, int x, int y,
rt1+= 4; rt2+= 4; rt+= 4;
}
- if(y==0) break;
+ if (y==0) break;
y--;
x= xo;
- while(x--) {
+ while (x--) {
rt[0]= rt1[0] + ((fac3*rt1[0]*(rt2[0]-256))>>16);
rt[1]= rt1[1] + ((fac3*rt1[1]*(rt2[1]-256))>>16);
@@ -1516,10 +1536,10 @@ static void do_mul_effect_float(float facf0, float facf1, int x, int y,
* fac*(a*b) + (1-fac)*a => fac*a*(b-1)+a
*/
- while(y--) {
+ while (y--) {
x= xo;
- while(x--) {
+ while (x--) {
rt[0]= rt1[0] + fac1*rt1[0]*(rt2[0]-1.0f);
rt[1]= rt1[1] + fac1*rt1[1]*(rt2[1]-1.0f);
@@ -1529,11 +1549,11 @@ static void do_mul_effect_float(float facf0, float facf1, int x, int y,
rt1+= 4; rt2+= 4; rt+= 4;
}
- if(y==0) break;
+ if (y==0) break;
y--;
x= xo;
- while(x--) {
+ while (x--) {
rt[0]= rt1[0] + fac3*rt1[0]*(rt2[0]-1.0f);
rt[1]= rt1[1] + fac3*rt1[1]*(rt2[1]-1.0f);
@@ -1558,7 +1578,8 @@ static struct ImBuf * do_mul_effect(
facf0, facf1, context.rectx, context.recty,
ibuf1->rect_float, ibuf2->rect_float,
out->rect_float);
- } else {
+ }
+ else {
do_mul_effect_byte(
facf0, facf1, context.rectx, context.recty,
(unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect,
@@ -1569,8 +1590,8 @@ static struct ImBuf * do_mul_effect(
}
/* **********************************************************************
- WIPE
- ********************************************************************** */
+ * WIPE
+ * ********************************************************************** */
typedef struct WipeZone {
float angle;
@@ -1595,18 +1616,18 @@ static float in_band(float width,float dist,int side,int dir)
{
float alpha;
- if(width == 0)
+ if (width == 0)
return (float)side;
- if(width < dist)
+ if (width < dist)
return (float)side;
- if(side == 1)
+ if (side == 1)
alpha = (dist+0.5f*width) / (width);
else
alpha = (0.5f*width-dist) / (width);
- if(dir == 0)
+ if (dir == 0)
alpha = 1-alpha;
return alpha;
@@ -1616,9 +1637,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;
@@ -1628,13 +1648,14 @@ float hyp3,hyp4,b4,b5
WipeVars *wipe = (WipeVars *)seq->effectdata;
int width;
- if(wipezone->flip) x = xo - x;
+ if (wipezone->flip) x = xo - x;
angle = wipezone->angle;
- if(wipe->forward) {
+ if (wipe->forward) {
posx = facf0 * xo;
posy = facf0 * yo;
- } else{
+ }
+ else {
posx = xo - facf0 * xo;
posy = yo - facf0 * yo;
}
@@ -1643,7 +1664,7 @@ float hyp3,hyp4,b4,b5
case DO_SINGLE_WIPE:
width = wipezone->width;
- if(angle == 0.0f) {
+ if (angle == 0.0f) {
b1 = posy;
b2 = y;
hyp = fabs(y - posy);
@@ -1654,20 +1675,20 @@ float hyp3,hyp4,b4,b5
hyp = fabsf(angle*x+y+(-posy-angle*posx))*wipezone->pythangle;
}
- if(angle < 0) {
+ if (angle < 0) {
temp1 = b1;
b1 = b2;
b2 = temp1;
}
- if(wipe->forward) {
- if(b1 < b2)
+ if (wipe->forward) {
+ if (b1 < b2)
output = in_band(width,hyp,1,1);
else
output = in_band(width,hyp,0,1);
}
else {
- if(b1 < b2)
+ if (b1 < b2)
output = in_band(width,hyp,0,1);
else
output = in_band(width,hyp,1,1);
@@ -1675,7 +1696,7 @@ float hyp3,hyp4,b4,b5
break;
case DO_DOUBLE_WIPE:
- if(!wipe->forward)
+ if (!wipe->forward)
facf0 = 1.0f-facf0; // Go the other direction
width = wipezone->width; // calculate the blur width
@@ -1699,32 +1720,34 @@ float hyp3,hyp4,b4,b5
hwidth = minf(hwidth, fabsf(b3-b1)/2.0f);
- if(b2 < b1 && b2 < b3 ) {
+ if (b2 < b1 && b2 < b3 ) {
output = in_band(hwidth,hyp,0,1);
- } else if(b2 > b1 && b2 > b3 ) {
+ }
+ else if (b2 > b1 && b2 > b3 ) {
output = in_band(hwidth,hyp2,0,1);
- } else {
- if( hyp < hwidth && hyp2 > hwidth )
+ }
+ else {
+ if ( hyp < hwidth && hyp2 > hwidth )
output = in_band(hwidth,hyp,1,1);
- else if( hyp > hwidth && hyp2 < hwidth )
+ else if ( hyp > hwidth && hyp2 < hwidth )
output = in_band(hwidth,hyp2,1,1);
else
output = in_band(hwidth,hyp2,1,1) * in_band(hwidth,hyp,1,1);
}
- if(!wipe->forward)output = 1-output;
+ 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;
- if(wipe->forward) {
+ if (wipe->forward) {
temp1 = 2.0f*(float)M_PI - temp1;
}
@@ -1732,14 +1755,15 @@ float hyp3,hyp4,b4,b5
y = y - halfy;
temp2 = asin(abs(y)/sqrt(x*x + y*y));
- if(x <= 0 && y >= 0) temp2 = (float)M_PI - temp2;
- else if(x<=0 && y <= 0) temp2 += (float)M_PI;
- else if(x >= 0 && y <= 0) temp2 = 2.0f*(float)M_PI - temp2;
+ if (x <= 0 && y >= 0) temp2 = (float)M_PI - temp2;
+ else if (x<=0 && y <= 0) temp2 += (float)M_PI;
+ else if (x >= 0 && y <= 0) temp2 = 2.0f*(float)M_PI - temp2;
- if(wipe->forward) {
+ if (wipe->forward) {
temp3 = temp1-(widthf*0.5f)*facf0;
temp4 = temp1+(widthf*0.5f)*(1-facf0);
- } else{
+ }
+ else {
temp3 = temp1-(widthf*0.5f)*(1-facf0);
temp4 = temp1+(widthf*0.5f)*facf0;
}
@@ -1747,19 +1771,19 @@ float hyp3,hyp4,b4,b5
if (temp4 > 2.0f*(float)M_PI) temp4 = 2.0f*(float)M_PI;
- if(temp2 < temp3) output = 0;
+ if (temp2 < temp3) output = 0;
else if (temp2 > temp4) output = 1;
else output = (temp2-temp3)/(temp4-temp3);
- if(x == 0 && y == 0) output = 1;
- if(output != output) output = 1;
- if(wipe->forward) output = 1 - output;
+ if (x == 0 && y == 0) output = 1;
+ if (output != output) output = 1;
+ if (wipe->forward) output = 1 - output;
break;
/* BOX WIPE IS NOT WORKING YET */
/* case DO_CROSS_WIPE: */
/* BOX WIPE IS NOT WORKING YET */
/*
case DO_BOX_WIPE:
- if(invert)facf0 = 1-facf0;
+ if (invert)facf0 = 1-facf0;
width = (int)(wipe->edgeWidth*((xo+yo)/2.0));
hwidth = (float)width/2.0;
@@ -1775,22 +1799,24 @@ float hyp3,hyp4,b4,b5
temp2 = yo*(1-facf0/2)-yo*facf0/2;
pointdist = sqrt(temp1*temp1 + temp2*temp2);
- if(b2 < b1 && b2 < b3 ) {
- if(hwidth < pointdist)
+ if (b2 < b1 && b2 < b3 ) {
+ if (hwidth < pointdist)
output = in_band(wipezone,hwidth,hyp,facf0,0,1);
- } else if(b2 > b1 && b2 > b3 ) {
- if(hwidth < pointdist)
+ }
+ else if (b2 > b1 && b2 > b3 ) {
+ if (hwidth < pointdist)
output = in_band(wipezone,hwidth,hyp2,facf0,0,1);
- } else {
- if( hyp < hwidth && hyp2 > hwidth )
+ }
+ else {
+ if ( hyp < hwidth && hyp2 > hwidth )
output = in_band(wipezone,hwidth,hyp,facf0,1,1);
- else if( hyp > hwidth && hyp2 < hwidth )
+ else if ( hyp > hwidth && hyp2 < hwidth )
output = in_band(wipezone,hwidth,hyp2,facf0,1,1);
else
output = in_band(wipezone,hwidth,hyp2,facf0,1,1) * in_band(wipezone,hwidth,hyp,facf0,1,1);
}
- if(invert)facf0 = 1-facf0;
+ if (invert)facf0 = 1-facf0;
angle = -1/angle;
b1 = posy/2 - (-angle)*posx/2;
b3 = (yo-posy/2) - (-angle)*(xo-posx/2);
@@ -1799,16 +1825,18 @@ float hyp3,hyp4,b4,b5
hyp = abs(angle*x+y+(-posy/2-angle*posx/2))*wipezone->pythangle;
hyp2 = abs(angle*x+y+(-(yo-posy/2)-angle*(xo-posx/2)))*wipezone->pythangle;
- if(b2 < b1 && b2 < b3 ) {
- if(hwidth < pointdist)
+ if (b2 < b1 && b2 < b3 ) {
+ if (hwidth < pointdist)
output *= in_band(wipezone,hwidth,hyp,facf0,0,1);
- } else if(b2 > b1 && b2 > b3 ) {
- if(hwidth < pointdist)
+ }
+ else if (b2 > b1 && b2 > b3 ) {
+ if (hwidth < pointdist)
output *= in_band(wipezone,hwidth,hyp2,facf0,0,1);
- } else {
- if( hyp < hwidth && hyp2 > hwidth )
+ }
+ else {
+ if ( hyp < hwidth && hyp2 > hwidth )
output *= in_band(wipezone,hwidth,hyp,facf0,1,1);
- else if( hyp > hwidth && hyp2 < hwidth )
+ else if ( hyp > hwidth && hyp2 < hwidth )
output *= in_band(wipezone,hwidth,hyp2,facf0,1,1);
else
output *= in_band(wipezone,hwidth,hyp2,facf0,1,1) * in_band(wipezone,hwidth,hyp,facf0,1,1);
@@ -1817,10 +1845,10 @@ float hyp3,hyp4,b4,b5
break;
*/
case DO_IRIS_WIPE:
- if(xo > yo) yo = xo;
+ if (xo > yo) yo = xo;
else xo = yo;
- if(!wipe->forward) facf0 = 1-facf0;
+ if (!wipe->forward) facf0 = 1-facf0;
width = wipezone->width;
hwidth = width*0.5f;
@@ -1829,21 +1857,21 @@ float hyp3,hyp4,b4,b5
pointdist = sqrt(temp1*temp1 + temp1*temp1);
temp2 = sqrt((halfx-x)*(halfx-x) + (halfy-y)*(halfy-y));
- if(temp2 > pointdist) output = in_band(hwidth,fabs(temp2-pointdist),0,1);
+ if (temp2 > pointdist) output = in_band(hwidth,fabs(temp2-pointdist),0,1);
else output = in_band(hwidth,fabs(temp2-pointdist),1,1);
- if(!wipe->forward) output = 1-output;
+ if (!wipe->forward) output = 1-output;
break;
}
if (output < 0) output = 0;
- else if(output > 1) output = 1;
+ else if (output > 1) output = 1;
return output;
}
static void init_wipe_effect(Sequence *seq)
{
- if(seq->effectdata)MEM_freeN(seq->effectdata);
+ if (seq->effectdata)MEM_freeN(seq->effectdata);
seq->effectdata = MEM_callocN(sizeof(struct WipeVars), "wipevars");
}
@@ -1854,7 +1882,7 @@ static int num_inputs_wipe(void)
static void free_wipe_effect(Sequence *seq)
{
- if(seq->effectdata)MEM_freeN(seq->effectdata);
+ if (seq->effectdata)MEM_freeN(seq->effectdata);
seq->effectdata = NULL;
}
@@ -1881,8 +1909,8 @@ static void do_wipe_effect_byte(Sequence *seq, float facf0, float UNUSED(facf1),
xo = x;
yo = y;
- for(y=0;y<yo;y++) {
- for(x=0;x<xo;x++) {
+ for (y=0;y<yo;y++) {
+ for (x=0;x<xo;x++) {
float check = check_zone(&wipezone,x,y,seq,facf0);
if (check) {
if (rt1) {
@@ -1890,19 +1918,22 @@ static void do_wipe_effect_byte(Sequence *seq, float facf0, float UNUSED(facf1),
rt[1] = (int)(rt1[1]*check)+ (int)(rt2[1]*(1-check));
rt[2] = (int)(rt1[2]*check)+ (int)(rt2[2]*(1-check));
rt[3] = (int)(rt1[3]*check)+ (int)(rt2[3]*(1-check));
- } else {
+ }
+ else {
rt[0] = 0;
rt[1] = 0;
rt[2] = 0;
rt[3] = 255;
}
- } else {
+ }
+ else {
if (rt2) {
rt[0] = rt2[0];
rt[1] = rt2[1];
rt[2] = rt2[2];
rt[3] = rt2[3];
- } else {
+ }
+ else {
rt[0] = 0;
rt[1] = 0;
rt[2] = 0;
@@ -1911,10 +1942,10 @@ static void do_wipe_effect_byte(Sequence *seq, float facf0, float UNUSED(facf1),
}
rt+=4;
- if(rt1 !=NULL) {
+ if (rt1 !=NULL) {
rt1+=4;
}
- if(rt2 !=NULL) {
+ if (rt2 !=NULL) {
rt2+=4;
}
}
@@ -1939,8 +1970,8 @@ static void do_wipe_effect_float(Sequence *seq, float facf0, float UNUSED(facf1)
xo = x;
yo = y;
- for(y=0;y<yo;y++) {
- for(x=0;x<xo;x++) {
+ for (y=0;y<yo;y++) {
+ for (x=0;x<xo;x++) {
float check = check_zone(&wipezone,x,y,seq,facf0);
if (check) {
if (rt1) {
@@ -1948,19 +1979,22 @@ static void do_wipe_effect_float(Sequence *seq, float facf0, float UNUSED(facf1)
rt[1] = rt1[1]*check+ rt2[1]*(1-check);
rt[2] = rt1[2]*check+ rt2[2]*(1-check);
rt[3] = rt1[3]*check+ rt2[3]*(1-check);
- } else {
+ }
+ else {
rt[0] = 0;
rt[1] = 0;
rt[2] = 0;
rt[3] = 1.0;
}
- } else {
+ }
+ else {
if (rt2) {
rt[0] = rt2[0];
rt[1] = rt2[1];
rt[2] = rt2[2];
rt[3] = rt2[3];
- } else {
+ }
+ else {
rt[0] = 0;
rt[1] = 0;
rt[2] = 0;
@@ -1969,10 +2003,10 @@ static void do_wipe_effect_float(Sequence *seq, float facf0, float UNUSED(facf1)
}
rt+=4;
- if(rt1 !=NULL) {
+ if (rt1 !=NULL) {
rt1+=4;
}
- if(rt2 !=NULL) {
+ if (rt2 !=NULL) {
rt2+=4;
}
}
@@ -1992,7 +2026,8 @@ static struct ImBuf * do_wipe_effect(
facf0, facf1, context.rectx, context.recty,
ibuf1->rect_float, ibuf2->rect_float,
out->rect_float);
- } else {
+ }
+ else {
do_wipe_effect_byte(seq,
facf0, facf1, context.rectx, context.recty,
(unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect,
@@ -2002,13 +2037,13 @@ static struct ImBuf * do_wipe_effect(
return out;
}
/* **********************************************************************
- TRANSFORM
- ********************************************************************** */
+ * TRANSFORM
+ * ********************************************************************** */
static void init_transform_effect(Sequence *seq)
{
TransformVars *transform;
- if(seq->effectdata)MEM_freeN(seq->effectdata);
+ if (seq->effectdata)MEM_freeN(seq->effectdata);
seq->effectdata = MEM_callocN(sizeof(struct TransformVars), "transformvars");
transform = (TransformVars *)seq->effectdata;
@@ -2033,7 +2068,7 @@ static int num_inputs_transform(void)
static void free_transform_effect(Sequence *seq)
{
- if(seq->effectdata)MEM_freeN(seq->effectdata);
+ if (seq->effectdata)MEM_freeN(seq->effectdata);
seq->effectdata = NULL;
}
@@ -2101,18 +2136,20 @@ static void do_transform(Scene *scene, Sequence *seq, float UNUSED(facf0), int x
// Scale
if (transform->uniform_scale) {
scale_x = scale_y = transform->ScalexIni;
- } else {
+ }
+ else {
scale_x = transform->ScalexIni;
scale_y = transform->ScaleyIni;
}
// Translate
- if(!transform->percent) {
+ if (!transform->percent) {
float rd_s = (scene->r.size/100.0f);
translate_x = transform->xIni*rd_s+(x/2.0f);
translate_y = transform->yIni*rd_s+(y/2.0f);
- }else{
+ }
+ else {
translate_x = x*(transform->xIni/100.0f)+(x/2.0f);
translate_y = y*(transform->yIni/100.0f)+(y/2.0f);
}
@@ -2140,8 +2177,8 @@ static struct ImBuf * do_transform_effect(
/* **********************************************************************
- GLOW
- ********************************************************************** */
+ * GLOW
+ * ********************************************************************** */
static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
float blur,
@@ -2206,8 +2243,8 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
for (x=0;x<halfWidth;x++) {
index=(x+y*width)*4;
fx=0;
- curColor[0]=curColor[1]=curColor[2]=0;
- curColor2[0]=curColor2[1]=curColor2[2]=0;
+ zero_v3(curColor);
+ zero_v3(curColor2);
for (i=x-halfWidth;i<x+halfWidth;i++) {
if ((i>=0)&&(i<width)) {
@@ -2237,7 +2274,7 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
for (x=halfWidth;x<width-halfWidth;x++) {
index=(x+y*width)*4;
fx=0;
- curColor[0]=curColor[1]=curColor[2]=0;
+ zero_v3(curColor);
for (i=x-halfWidth;i<x+halfWidth;i++) {
curColor[0]+=map[(i+y*width)*4+GlowR]*filter[fx];
curColor[1]+=map[(i+y*width)*4+GlowG]*filter[fx];
@@ -2260,8 +2297,8 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
for (y=0;y<halfWidth;y++) {
index=(x+y*width)*4;
fy=0;
- curColor[0]=curColor[1]=curColor[2]=0;
- curColor2[0]=curColor2[1]=curColor2[2]=0;
+ zero_v3(curColor);
+ zero_v3(curColor2);
for (i=y-halfWidth;i<y+halfWidth;i++) {
if ((i>=0)&&(i<height)) {
/* Bottom */
@@ -2290,7 +2327,7 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
for (y=halfWidth;y<height-halfWidth;y++) {
index=(x+y*width)*4;
fy=0;
- curColor[0]=curColor[1]=curColor[2]=0;
+ zero_v3(curColor);
for (i=y-halfWidth;i<y+halfWidth;i++) {
curColor[0]+=map[(x+i*width)*4+GlowR]*filter[fy];
curColor[1]+=map[(x+i*width)*4+GlowG]*filter[fy];
@@ -2407,7 +2444,7 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
for (x=halfWidth;x<width-halfWidth;x++) {
index=(x+y*width)*4;
fx=0;
- curColor[0]=curColor[1]=curColor[2]=0;
+ zero_v3(curColor);
for (i=x-halfWidth;i<x+halfWidth;i++) {
curColor[0]+=map[(i+y*width)*4+GlowR]*filter[fx];
curColor[1]+=map[(i+y*width)*4+GlowG]*filter[fx];
@@ -2430,8 +2467,8 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
for (y=0;y<halfWidth;y++) {
index=(x+y*width)*4;
fy=0;
- curColor[0]=curColor[1]=curColor[2]=0;
- curColor2[0]=curColor2[1]=curColor2[2]=0;
+ zero_v3(curColor);
+ zero_v3(curColor2);
for (i=y-halfWidth;i<y+halfWidth;i++) {
if ((i>=0)&&(i<height)) {
/* Bottom */
@@ -2460,7 +2497,7 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
for (y=halfWidth;y<height-halfWidth;y++) {
index=(x+y*width)*4;
fy=0;
- curColor[0]=curColor[1]=curColor[2]=0;
+ zero_v3(curColor);
for (i=y-halfWidth;i<y+halfWidth;i++) {
curColor[0]+=map[(x+i*width)*4+GlowR]*filter[fy];
curColor[1]+=map[(x+i*width)*4+GlowG]*filter[fy];
@@ -2528,7 +2565,7 @@ static void RVIsolateHighlights_byte (unsigned char* in, unsigned char* out,
int intensity;
- for(y=0;y< height;y++) {
+ for (y=0;y< height;y++) {
for (x=0;x< width;x++) {
index= (x+y*width)*4;
@@ -2539,7 +2576,8 @@ static void RVIsolateHighlights_byte (unsigned char* in, unsigned char* out,
out[index+GlowG]=MIN2(255*clamp, (in[index+GlowG]*boost*intensity)/255);
out[index+GlowB]=MIN2(255*clamp, (in[index+GlowB]*boost*intensity)/255);
out[index+GlowA]=MIN2(255*clamp, (in[index+GlowA]*boost*intensity)/255);
- } else{
+ }
+ else {
out[index+GlowR]=0;
out[index+GlowG]=0;
out[index+GlowB]=0;
@@ -2557,7 +2595,7 @@ static void RVIsolateHighlights_float (float* in, float* out,
float intensity;
- for(y=0;y< height;y++) {
+ for (y=0;y< height;y++) {
for (x=0;x< width;x++) {
index= (x+y*width)*4;
@@ -2568,7 +2606,8 @@ static void RVIsolateHighlights_float (float* in, float* out,
out[index+GlowG]=MIN2(clamp, (in[index+GlowG]*boost*intensity));
out[index+GlowB]=MIN2(clamp, (in[index+GlowB]*boost*intensity));
out[index+GlowA]=MIN2(clamp, (in[index+GlowA]*boost*intensity));
- } else{
+ }
+ else {
out[index+GlowR]=0;
out[index+GlowG]=0;
out[index+GlowB]=0;
@@ -2582,7 +2621,7 @@ static void init_glow_effect(Sequence *seq)
{
GlowVars *glow;
- if(seq->effectdata)MEM_freeN(seq->effectdata);
+ if (seq->effectdata)MEM_freeN(seq->effectdata);
seq->effectdata = MEM_callocN(sizeof(struct GlowVars), "glowvars");
glow = (GlowVars *)seq->effectdata;
@@ -2601,7 +2640,7 @@ static int num_inputs_glow(void)
static void free_glow_effect(Sequence *seq)
{
- if(seq->effectdata)MEM_freeN(seq->effectdata);
+ if (seq->effectdata)MEM_freeN(seq->effectdata);
seq->effectdata = NULL;
}
@@ -2655,7 +2694,8 @@ static struct ImBuf * do_glow_effect(
context.rectx, context.recty,
ibuf1->rect_float, ibuf2->rect_float,
out->rect_float);
- } else {
+ }
+ else {
do_glow_effect_byte(seq, render_size,
facf0, facf1,
context.rectx, context.recty,
@@ -2667,14 +2707,14 @@ static struct ImBuf * do_glow_effect(
}
/* **********************************************************************
- SOLID COLOR
- ********************************************************************** */
+ * SOLID COLOR
+ * ********************************************************************** */
static void init_solid_color(Sequence *seq)
{
SolidColorVars *cv;
- if(seq->effectdata)MEM_freeN(seq->effectdata);
+ if (seq->effectdata)MEM_freeN(seq->effectdata);
seq->effectdata = MEM_callocN(sizeof(struct SolidColorVars), "solidcolor");
cv = (SolidColorVars *)seq->effectdata;
@@ -2688,7 +2728,7 @@ static int num_inputs_color(void)
static void free_solid_color(Sequence *seq)
{
- if(seq->effectdata)MEM_freeN(seq->effectdata);
+ if (seq->effectdata)MEM_freeN(seq->effectdata);
seq->effectdata = NULL;
}
@@ -2732,8 +2772,8 @@ static struct ImBuf * do_solid_color(
rect = (unsigned char *)out->rect;
- for(y=0; y<out->y; y++) {
- for(x=0; x<out->x; x++, rect+=4) {
+ for (y=0; y<out->y; y++) {
+ for (x=0; x<out->x; x++, rect+=4) {
rect[0]= col0[0];
rect[1]= col0[1];
rect[2]= col0[2];
@@ -2741,7 +2781,7 @@ static struct ImBuf * do_solid_color(
}
y++;
if (y<out->y) {
- for(x=0; x<out->x; x++, rect+=4) {
+ for (x=0; x<out->x; x++, rect+=4) {
rect[0]= col1[0];
rect[1]= col1[1];
rect[2]= col1[2];
@@ -2750,7 +2790,8 @@ static struct ImBuf * do_solid_color(
}
}
- } else if (out->rect_float) {
+ }
+ else if (out->rect_float) {
float col0[3];
float col1[3];
@@ -2764,8 +2805,8 @@ static struct ImBuf * do_solid_color(
rect_float = out->rect_float;
- for(y=0; y<out->y; y++) {
- for(x=0; x<out->x; x++, rect_float+=4) {
+ for (y=0; y<out->y; y++) {
+ for (x=0; x<out->x; x++, rect_float+=4) {
rect_float[0]= col0[0];
rect_float[1]= col0[1];
rect_float[2]= col0[2];
@@ -2773,7 +2814,7 @@ static struct ImBuf * do_solid_color(
}
y++;
if (y<out->y) {
- for(x=0; x<out->x; x++, rect_float+=4) {
+ for (x=0; x<out->x; x++, rect_float+=4) {
rect_float[0]= col1[0];
rect_float[1]= col1[1];
rect_float[2]= col1[2];
@@ -2786,8 +2827,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)
@@ -2832,7 +2873,8 @@ static struct ImBuf * do_multicam(
if (input_have_to_preprocess(context, seq, cfra)) {
out = IMB_dupImBuf(i);
IMB_freeImBuf(i);
- } else {
+ }
+ else {
out = i;
}
@@ -2840,8 +2882,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 +2913,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;
@@ -2909,7 +2951,8 @@ static struct ImBuf * do_adjustment(
if (input_have_to_preprocess(context, seq, cfra)) {
out = IMB_dupImBuf(i);
IMB_freeImBuf(i);
- } else {
+ }
+ else {
out = i;
}
@@ -2917,13 +2960,13 @@ static struct ImBuf * do_adjustment(
}
/* **********************************************************************
- SPEED
- ********************************************************************** */
+ * SPEED
+ * ********************************************************************** */
static void init_speed_effect(Sequence *seq)
{
SpeedControlVars * v;
- if(seq->effectdata) MEM_freeN(seq->effectdata);
+ if (seq->effectdata) MEM_freeN(seq->effectdata);
seq->effectdata = MEM_callocN(sizeof(struct SpeedControlVars),
"speedcontrolvars");
@@ -2950,8 +2993,8 @@ static int num_inputs_speed(void)
static void free_speed_effect(Sequence *seq)
{
SpeedControlVars * v = (SpeedControlVars *)seq->effectdata;
- if(v->frameMap) MEM_freeN(v->frameMap);
- if(seq->effectdata) MEM_freeN(seq->effectdata);
+ if (v->frameMap) MEM_freeN(v->frameMap);
+ if (seq->effectdata) MEM_freeN(seq->effectdata);
seq->effectdata = NULL;
}
@@ -2981,11 +3024,13 @@ static void store_icu_yrange_speed(struct Sequence * seq,
if ((v->flags & SEQ_SPEED_INTEGRATE) != 0) {
*ymin = -100.0;
*ymax = 100.0;
- } else {
+ }
+ else {
if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) {
*ymin = 0.0;
*ymax = 1.0;
- } else {
+ }
+ else {
*ymin = 0.0;
*ymax = seq->len;
}
@@ -3010,8 +3055,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;
}
@@ -3039,7 +3083,8 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
flags = SEQ_SPEED_INTEGRATE;
fcu = NULL;
}
- } else {
+ }
+ else {
/* if there is no fcurve, use value as simple multiplier */
if (!fcu) {
fallback_fac = seq->speed_fader; /* same as speed_factor in rna*/
@@ -3054,9 +3099,10 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
v->lastValidFrame = 0;
for (cfra = 1; cfra < v->length; cfra++) {
- if(fcu) {
+ if (fcu) {
facf = evaluate_fcurve(fcu, seq->startdisp + cfra);
- } else {
+ }
+ else {
facf = fallback_fac;
}
facf *= v->globalSpeed;
@@ -3065,20 +3111,23 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
if (cursor >= seq->seq1->len) {
v->frameMap[cfra] = seq->seq1->len - 1;
- } else {
+ }
+ else {
v->frameMap[cfra] = cursor;
v->lastValidFrame = cfra;
}
}
- } else {
+ }
+ else {
float facf;
v->lastValidFrame = 0;
for (cfra = 0; cfra < v->length; cfra++) {
- if(fcu) {
+ if (fcu) {
facf = evaluate_fcurve(fcu, seq->startdisp + cfra);
- } else {
+ }
+ else {
facf = fallback_fac;
}
@@ -3089,7 +3138,8 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
if (facf >= seq->seq1->len) {
facf = seq->seq1->len - 1;
- } else {
+ }
+ else {
v->lastValidFrame = cfra;
}
v->frameMap[cfra] = facf;
@@ -3098,8 +3148,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))
@@ -3138,7 +3188,8 @@ static int early_out_fade(struct Sequence *UNUSED(seq),
{
if (facf0 == 0.0f && facf1 == 0.0f) {
return 1;
- } else if (facf0 == 1.0f && facf1 == 1.0f) {
+ }
+ else if (facf0 == 1.0f && facf1 == 1.0f) {
return 2;
}
return 0;
@@ -3195,7 +3246,8 @@ static struct ImBuf * do_overdrop_effect(SeqRenderData context,
facf0, facf1, x, y,
ibuf1->rect_float, ibuf2->rect_float,
out->rect_float);
- } else {
+ }
+ else {
do_drop_effect_byte(
facf0, facf1, x, y,
(char*) ibuf1->rect,
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 92199eadf5b..10cc64890b9 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -39,6 +39,7 @@
#include "MEM_CacheLimiterC-Api.h"
#include "DNA_sequence_types.h"
+#include "DNA_movieclip_types.h"
#include "DNA_scene_types.h"
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
@@ -57,6 +58,7 @@
#include "BKE_image.h"
#include "BKE_main.h"
#include "BKE_sequencer.h"
+#include "BKE_movieclip.h"
#include "BKE_fcurve.h"
#include "BKE_scene.h"
#include "BKE_utildefines.h"
@@ -77,11 +79,11 @@
# include "AUD_C-API.h"
#endif
-static ImBuf* seq_render_strip_stack(
- SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown);
+static ImBuf *seq_render_strip_stack(
+ SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown);
-static ImBuf * seq_render_strip(
- SeqRenderData context, Sequence * seq, float cfra);
+static ImBuf *seq_render_strip(
+ SeqRenderData context, Sequence *seq, float cfra);
static void seq_free_animdata(Scene *scene, Sequence *seq);
@@ -90,52 +92,42 @@ static void seq_free_animdata(Scene *scene, Sequence *seq);
#define SELECT 1
ListBase seqbase_clipboard;
int seqbase_clipboard_frame;
-SequencerDrawView sequencer_view3d_cb= NULL; /* NULL in background mode */
+SequencerDrawView sequencer_view3d_cb = NULL; /* NULL in background mode */
void printf_strip(Sequence *seq)
{
fprintf(stderr, "name: '%s', len:%d, start:%d, (startofs:%d, endofs:%d), (startstill:%d, endstill:%d), machine:%d, (startdisp:%d, enddisp:%d)\n",
- seq->name, seq->len, seq->start, seq->startofs, seq->endofs, seq->startstill, seq->endstill, seq->machine, seq->startdisp, seq->enddisp);
+ seq->name, seq->len, seq->start, seq->startofs, seq->endofs, seq->startstill, seq->endstill, seq->machine, seq->startdisp, seq->enddisp);
fprintf(stderr, "\tseq_tx_set_final_left: %d %d\n\n", seq_tx_get_final_left(seq, 0), seq_tx_get_final_right(seq, 0));
}
int seqbase_recursive_apply(ListBase *seqbase, int (*apply_func)(Sequence *seq, void *), void *arg)
{
Sequence *iseq;
- for(iseq= seqbase->first; iseq; iseq= iseq->next) {
- if(seq_recursive_apply(iseq, apply_func, arg) == -1)
- return -1; /* bail out */
+ for (iseq = seqbase->first; iseq; iseq = iseq->next) {
+ if (seq_recursive_apply(iseq, apply_func, arg) == -1)
+ return -1; /* bail out */
}
return 1;
}
int seq_recursive_apply(Sequence *seq, int (*apply_func)(Sequence *, void *), void *arg)
{
- int ret= apply_func(seq, arg);
+ int ret = apply_func(seq, arg);
- if(ret == -1)
+ if (ret == -1)
return -1; /* bail out */
- if(ret && seq->seqbase.first)
+ if (ret && seq->seqbase.first)
ret = seqbase_recursive_apply(&seq->seqbase, apply_func, arg);
return ret;
}
/* **********************************************************************
- alloc / free functions
- ********************************************************************** */
-
-
-
-void new_tstripdata(Sequence *seq)
-{
- if(seq->strip) {
- seq->strip->len= seq->len;
- }
-}
-
+ * alloc / free functions
+ * ********************************************************************** */
/* free */
@@ -150,8 +142,8 @@ static void free_proxy_seq(Sequence *seq)
void seq_free_strip(Strip *strip)
{
strip->us--;
- if(strip->us>0) return;
- if(strip->us<0) {
+ if (strip->us > 0) return;
+ if (strip->us < 0) {
printf("error: negative users in strip\n");
return;
}
@@ -182,9 +174,9 @@ void seq_free_strip(Strip *strip)
void seq_free_sequence(Scene *scene, Sequence *seq)
{
- if(seq->strip) seq_free_strip(seq->strip);
+ if (seq->strip) seq_free_strip(seq->strip);
- if(seq->anim) IMB_free_anim(seq->anim);
+ if (seq->anim) IMB_free_anim(seq->anim);
if (seq->type & SEQ_EFFECT) {
struct SeqEffectHandle sh = get_sequence_effect(seq);
@@ -192,18 +184,18 @@ void seq_free_sequence(Scene *scene, Sequence *seq)
sh.free(seq);
}
- if(seq->sound) {
+ if (seq->sound) {
((ID *)seq->sound)->us--;
}
/* clipboard has no scene and will never have a sound handle or be active */
- if(scene) {
+ if (scene) {
Editing *ed = scene->ed;
- if (ed->act_seq==seq)
- ed->act_seq= NULL;
+ if (ed->act_seq == seq)
+ ed->act_seq = NULL;
- if(seq->scene_sound && ELEM(seq->type, SEQ_SOUND, SEQ_SCENE))
+ if (seq->scene_sound && ELEM(seq->type, SEQ_SOUND, SEQ_SCENE))
sound_remove_scene_sound(scene, seq->scene_sound);
seq_free_animdata(scene, seq);
@@ -216,7 +208,7 @@ void seq_free_sequence_recurse(Scene *scene, Sequence *seq)
{
Sequence *iseq;
- for(iseq= seq->seqbase.first; iseq; iseq= iseq->next) {
+ for (iseq = seq->seqbase.first; iseq; iseq = iseq->next) {
seq_free_sequence_recurse(scene, iseq);
}
@@ -229,8 +221,8 @@ Editing *seq_give_editing(Scene *scene, int alloc)
if (scene->ed == NULL && alloc) {
Editing *ed;
- ed= scene->ed= MEM_callocN( sizeof(Editing), "addseq");
- ed->seqbasep= &ed->seqbase;
+ ed = scene->ed = MEM_callocN(sizeof(Editing), "addseq");
+ ed->seqbasep = &ed->seqbase;
}
return scene->ed;
}
@@ -239,8 +231,8 @@ static void seq_free_clipboard_recursive(Sequence *seq_parent)
{
Sequence *seq, *nseq;
- for(seq= seq_parent->seqbase.first; seq; seq= nseq) {
- nseq= seq->next;
+ for (seq = seq_parent->seqbase.first; seq; seq = nseq) {
+ nseq = seq->next;
seq_free_clipboard_recursive(seq);
}
@@ -251,11 +243,11 @@ void seq_free_clipboard(void)
{
Sequence *seq, *nseq;
- for(seq= seqbase_clipboard.first; seq; seq= nseq) {
- nseq= seq->next;
+ for (seq = seqbase_clipboard.first; seq; seq = nseq) {
+ nseq = seq->next;
seq_free_clipboard_recursive(seq);
}
- seqbase_clipboard.first= seqbase_clipboard.last= NULL;
+ seqbase_clipboard.first = seqbase_clipboard.last = NULL;
}
void seq_free_editing(Scene *scene)
@@ -264,15 +256,16 @@ void seq_free_editing(Scene *scene)
MetaStack *ms;
Sequence *seq;
- if(ed==NULL)
+ if (ed == NULL)
return;
- SEQ_BEGIN(ed, seq) {
+ SEQ_BEGIN(ed, seq)
+ {
seq_free_sequence(scene, seq);
}
SEQ_END
- while((ms= ed->metastack.first)) {
+ while ((ms = ed->metastack.first)) {
BLI_remlink(&ed->metastack, ms);
MEM_freeN(ms);
}
@@ -281,12 +274,12 @@ void seq_free_editing(Scene *scene)
}
/* **********************************************************************
- * sequencer pipeline functions
- ********************************************************************** */
+ * sequencer pipeline functions
+ * ********************************************************************** */
SeqRenderData seq_new_render_data(
- struct Main * bmain, struct Scene * scene,
- int rectx, int recty, int preview_render_size)
+ struct Main *bmain, struct Scene *scene,
+ int rectx, int recty, int preview_render_size)
{
SeqRenderData rval;
@@ -301,7 +294,7 @@ SeqRenderData seq_new_render_data(
return rval;
}
-int seq_cmp_render_data(const SeqRenderData * a, const SeqRenderData * b)
+int seq_cmp_render_data(const SeqRenderData *a, const SeqRenderData *b)
{
if (a->preview_render_size < b->preview_render_size) {
return -1;
@@ -355,14 +348,14 @@ int seq_cmp_render_data(const SeqRenderData * a, const SeqRenderData * b)
return 0;
}
-unsigned int seq_hash_render_data(const SeqRenderData * a)
+unsigned int seq_hash_render_data(const SeqRenderData *a)
{
unsigned int rval = a->rectx + a->recty;
rval ^= a->preview_render_size;
rval ^= ((intptr_t) a->bmain) << 6;
rval ^= ((intptr_t) a->scene) << 6;
- rval ^= (int) (a->motion_blur_shutter * 100.0f) << 10;
+ rval ^= (int)(a->motion_blur_shutter * 100.0f) << 10;
rval ^= a->motion_blur_samples << 24;
return rval;
@@ -379,10 +372,10 @@ static void seq_count(ListBase *seqbase, int *tot)
{
Sequence *seq;
- for(seq=seqbase->first; seq; seq=seq->next) {
+ for (seq = seqbase->first; seq; seq = seq->next) {
(*tot)++;
- if(seq->seqbase.first)
+ if (seq->seqbase.first)
seq_count(&seq->seqbase, tot);
}
}
@@ -391,13 +384,13 @@ static void seq_build_array(ListBase *seqbase, Sequence ***array, int depth)
{
Sequence *seq;
- for(seq=seqbase->first; seq; seq=seq->next) {
- seq->depth= depth;
+ for (seq = seqbase->first; seq; seq = seq->next) {
+ seq->depth = depth;
- if(seq->seqbase.first)
- seq_build_array(&seq->seqbase, array, depth+1);
+ if (seq->seqbase.first)
+ seq_build_array(&seq->seqbase, array, depth + 1);
- **array= seq;
+ **array = seq;
(*array)++;
}
}
@@ -406,22 +399,22 @@ void seq_array(Editing *ed, Sequence ***seqarray, int *tot, int use_pointer)
{
Sequence **array;
- *seqarray= NULL;
- *tot= 0;
+ *seqarray = NULL;
+ *tot = 0;
- if(ed == NULL)
+ if (ed == NULL)
return;
- if(use_pointer)
+ if (use_pointer)
seq_count(ed->seqbasep, tot);
else
seq_count(&ed->seqbase, tot);
- if(*tot == 0)
+ if (*tot == 0)
return;
- *seqarray= array= MEM_mallocN(sizeof(Sequence *)*(*tot), "SeqArray");
- if(use_pointer)
+ *seqarray = array = MEM_mallocN(sizeof(Sequence *) * (*tot), "SeqArray");
+ if (use_pointer)
seq_build_array(ed->seqbasep, &array, 0);
else
seq_build_array(&ed->seqbase, &array, 0);
@@ -432,94 +425,94 @@ void seq_begin(Editing *ed, SeqIterator *iter, int use_pointer)
memset(iter, 0, sizeof(*iter));
seq_array(ed, &iter->array, &iter->tot, use_pointer);
- if(iter->tot) {
- iter->cur= 0;
- iter->seq= iter->array[iter->cur];
- iter->valid= 1;
+ if (iter->tot) {
+ iter->cur = 0;
+ iter->seq = iter->array[iter->cur];
+ iter->valid = 1;
}
}
void seq_next(SeqIterator *iter)
{
- if(++iter->cur < iter->tot)
- iter->seq= iter->array[iter->cur];
+ if (++iter->cur < iter->tot)
+ iter->seq = iter->array[iter->cur];
else
- iter->valid= 0;
+ iter->valid = 0;
}
void seq_end(SeqIterator *iter)
{
- if(iter->array)
+ if (iter->array)
MEM_freeN(iter->array);
- iter->valid= 0;
+ iter->valid = 0;
}
/*
- **********************************************************************
- * 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))
+ int (*test_func)(Sequence *seq))
{
Sequence *seq;
- seq= seqbase->first;
- while(seq) {
+ seq = seqbase->first;
+ while (seq) {
int test = test_func(seq);
if (test & BUILD_SEQAR_COUNT_CURRENT) {
(*totseq)++;
}
- if(seq->seqbase.first && (test & BUILD_SEQAR_COUNT_CHILDREN)) {
+ if (seq->seqbase.first && (test & BUILD_SEQAR_COUNT_CHILDREN)) {
do_seq_count_cb(&seq->seqbase, totseq, test_func);
}
- seq= seq->next;
+ seq = seq->next;
}
}
static void do_build_seqar_cb(ListBase *seqbase, Sequence ***seqar, int depth,
- int (*test_func)(Sequence * seq))
+ int (*test_func)(Sequence *seq))
{
Sequence *seq;
- seq= seqbase->first;
- while(seq) {
+ seq = seqbase->first;
+ while (seq) {
int test = test_func(seq);
- seq->depth= depth;
+ seq->depth = depth;
- if(seq->seqbase.first && (test & BUILD_SEQAR_COUNT_CHILDREN)) {
- do_build_seqar_cb(&seq->seqbase, seqar, depth+1, test_func);
+ if (seq->seqbase.first && (test & BUILD_SEQAR_COUNT_CHILDREN)) {
+ do_build_seqar_cb(&seq->seqbase, seqar, depth + 1, test_func);
}
if (test & BUILD_SEQAR_COUNT_CURRENT) {
- **seqar= seq;
+ **seqar = seq;
(*seqar)++;
}
- seq= seq->next;
+ seq = seq->next;
}
}
void build_seqar_cb(ListBase *seqbase, Sequence ***seqar, int *totseq,
- int (*test_func)(Sequence * seq))
+ int (*test_func)(Sequence *seq))
{
Sequence **tseqar;
- *totseq= 0;
+ *totseq = 0;
do_seq_count_cb(seqbase, totseq, test_func);
- if(*totseq==0) {
- *seqar= NULL;
+ if (*totseq == 0) {
+ *seqar = NULL;
return;
}
- *seqar= MEM_mallocN(sizeof(void *)* *totseq, "seqar");
- tseqar= *seqar;
+ *seqar = MEM_mallocN(sizeof(void *) * *totseq, "seqar");
+ tseqar = *seqar;
do_build_seqar_cb(seqbase, seqar, 0, test_func);
- *seqar= tseqar;
+ *seqar = tseqar;
}
@@ -529,20 +522,20 @@ static void seq_update_sound_bounds_recursive(Scene *scene, Sequence *metaseq)
/* for sound we go over full meta tree to update bounds of the sound strips,
* since sound is played outside of evaluating the imbufs, */
- for(seq=metaseq->seqbase.first; seq; seq=seq->next) {
- if(seq->type == SEQ_META) {
+ for (seq = metaseq->seqbase.first; seq; seq = seq->next) {
+ if (seq->type == SEQ_META) {
seq_update_sound_bounds_recursive(scene, seq);
}
- else if(ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) {
- if(seq->scene_sound) {
+ else if (ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) {
+ if (seq->scene_sound) {
int startofs = seq->startofs;
int endofs = seq->endofs;
- if(seq->startofs + seq->start < metaseq->start + metaseq->startofs)
+ if (seq->startofs + seq->start < metaseq->start + metaseq->startofs)
startofs = metaseq->start + metaseq->startofs - seq->start;
- if(seq->start + seq->len - seq->endofs > metaseq->start + metaseq->len - metaseq->endofs)
+ if (seq->start + seq->len - seq->endofs > metaseq->start + metaseq->len - metaseq->endofs)
endofs = seq->start + seq->len - metaseq->start - metaseq->len + metaseq->endofs;
- sound_move_scene_sound(scene, seq->scene_sound, seq->start + startofs, seq->start+seq->len - endofs, startofs);
+ sound_move_scene_sound(scene, seq->scene_sound, seq->start + startofs, seq->start + seq->len - endofs, startofs);
}
}
}
@@ -550,24 +543,24 @@ static void seq_update_sound_bounds_recursive(Scene *scene, Sequence *metaseq)
void calc_sequence_disp(Scene *scene, Sequence *seq)
{
- if(seq->startofs && seq->startstill) seq->startstill= 0;
- if(seq->endofs && seq->endstill) seq->endstill= 0;
+ if (seq->startofs && seq->startstill) seq->startstill = 0;
+ if (seq->endofs && seq->endstill) seq->endstill = 0;
- seq->startdisp= seq->start + seq->startofs - seq->startstill;
- seq->enddisp= seq->start+seq->len - seq->endofs + seq->endstill;
+ seq->startdisp = seq->start + seq->startofs - seq->startstill;
+ seq->enddisp = seq->start + seq->len - seq->endofs + seq->endstill;
- seq->handsize= 10.0; /* 10 frames */
- if( seq->enddisp-seq->startdisp < 10 ) {
- seq->handsize= (float)(0.5*(seq->enddisp-seq->startdisp));
+ seq->handsize = 10.0; /* 10 frames */
+ if (seq->enddisp - seq->startdisp < 10) {
+ seq->handsize = (float)(0.5 * (seq->enddisp - seq->startdisp));
}
- else if(seq->enddisp-seq->startdisp > 250) {
- seq->handsize= (float)((seq->enddisp-seq->startdisp)/25);
+ else if (seq->enddisp - seq->startdisp > 250) {
+ seq->handsize = (float)((seq->enddisp - seq->startdisp) / 25);
}
- if(ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) {
+ if (ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) {
seq_update_sound_bounds(scene, seq);
}
- else if(seq->type == SEQ_META)
+ else if (seq->type == SEQ_META)
seq_update_sound_bounds_recursive(scene, seq);
}
@@ -577,18 +570,18 @@ void calc_sequence(Scene *scene, Sequence *seq)
int min, max;
/* check all metas recursively */
- seqm= seq->seqbase.first;
- while(seqm) {
- if(seqm->seqbase.first) calc_sequence(scene, seqm);
- seqm= seqm->next;
+ seqm = seq->seqbase.first;
+ while (seqm) {
+ if (seqm->seqbase.first) calc_sequence(scene, seqm);
+ seqm = seqm->next;
}
/* effects and meta: automatic start and end */
- if(seq->type & SEQ_EFFECT) {
+ if (seq->type & SEQ_EFFECT) {
/* pointers */
- if(seq->seq2==NULL) seq->seq2= seq->seq1;
- if(seq->seq3==NULL) seq->seq3= seq->seq1;
+ if (seq->seq2 == NULL) seq->seq2 = seq->seq1;
+ if (seq->seq3 == NULL) seq->seq3 = seq->seq1;
/* effecten go from seq1 -> seq2: test */
@@ -601,51 +594,42 @@ void calc_sequence(Scene *scene, Sequence *seq)
/* XXX These resets should not be necessary, but users used to be able to
* edit effect's length, leading to strange results. See #29190. */
seq->startofs = seq->endofs = seq->startstill = seq->endstill = 0;
- seq->start= seq->startdisp= MAX3(seq->seq1->startdisp, seq->seq2->startdisp, seq->seq3->startdisp);
- seq->enddisp= MIN3(seq->seq1->enddisp, seq->seq2->enddisp, seq->seq3->enddisp);
+ seq->start = seq->startdisp = MAX3(seq->seq1->startdisp, seq->seq2->startdisp, seq->seq3->startdisp);
+ seq->enddisp = MIN3(seq->seq1->enddisp, seq->seq2->enddisp, seq->seq3->enddisp);
/* we cant help if strips don't overlap, it wont give useful results.
* but at least ensure 'len' is never negative which causes bad bugs elsewhere. */
- if(seq->enddisp < seq->startdisp) {
+ if (seq->enddisp < seq->startdisp) {
/* simple start/end swap */
- seq->start= seq->enddisp;
+ seq->start = seq->enddisp;
seq->enddisp = seq->startdisp;
- seq->startdisp= seq->start;
+ seq->startdisp = seq->start;
seq->flag |= SEQ_INVALID_EFFECT;
}
else {
seq->flag &= ~SEQ_INVALID_EFFECT;
}
- seq->len= seq->enddisp - seq->startdisp;
+ seq->len = seq->enddisp - seq->startdisp;
}
else {
calc_sequence_disp(scene, seq);
}
-
- if(seq->strip && seq->len!=seq->strip->len) {
- new_tstripdata(seq);
- }
-
}
else {
- if(seq->type==SEQ_META) {
- seqm= seq->seqbase.first;
- if(seqm) {
- min= MAXFRAME * 2;
- max= -MAXFRAME * 2;
- while(seqm) {
- if(seqm->startdisp < min) min= seqm->startdisp;
- if(seqm->enddisp > max) max= seqm->enddisp;
- seqm= seqm->next;
+ if (seq->type == SEQ_META) {
+ seqm = seq->seqbase.first;
+ if (seqm) {
+ min = MAXFRAME * 2;
+ max = -MAXFRAME * 2;
+ while (seqm) {
+ if (seqm->startdisp < min) min = seqm->startdisp;
+ if (seqm->enddisp > max) max = seqm->enddisp;
+ seqm = seqm->next;
}
- seq->start= min + seq->anim_startofs;
- seq->len = max-min;
+ seq->start = min + seq->anim_startofs;
+ seq->len = max - min;
seq->len -= seq->anim_startofs;
seq->len -= seq->anim_endofs;
-
- if(seq->strip && seq->len!=seq->strip->len) {
- new_tstripdata(seq);
- }
}
seq_update_sound_bounds_recursive(scene, seq);
}
@@ -654,115 +638,100 @@ void calc_sequence(Scene *scene, Sequence *seq)
}
/* note: caller should run calc_sequence(scene, seq) after */
-void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range)
+void reload_sequence_new_file(Scene *scene, Sequence *seq, int lock_range)
{
char str[FILE_MAX];
- int prev_startdisp=0, prev_enddisp=0;
- /* note: dont rename the strip, will break animation curves */
+ int prev_startdisp = 0, prev_enddisp = 0;
+ /* note: don't rename the strip, will break animation curves */
- if (ELEM5(seq->type, SEQ_MOVIE, SEQ_IMAGE, SEQ_SOUND, SEQ_SCENE, SEQ_META)==0) {
+ if (ELEM6(seq->type, SEQ_MOVIE, SEQ_IMAGE, SEQ_SOUND, SEQ_SCENE, SEQ_META, SEQ_MOVIECLIP) == 0) {
return;
}
- if(lock_range) {
- /* keep so we dont have to move the actual start and end points (only the data) */
+ if (lock_range) {
+ /* keep so we don't have to move the actual start and end points (only the data) */
calc_sequence_disp(scene, seq);
- prev_startdisp= seq->startdisp;
- prev_enddisp= seq->enddisp;
+ prev_startdisp = seq->startdisp;
+ prev_enddisp = seq->enddisp;
}
+ switch (seq->type) {
+ case SEQ_IMAGE:
+ {
+ /* Hack? */
+ size_t olen = MEM_allocN_len(seq->strip->stripdata) / sizeof(struct StripElem);
+
+ seq->len = olen;
+ seq->len -= seq->anim_startofs;
+ seq->len -= seq->anim_endofs;
+ if (seq->len < 0) {
+ seq->len = 0;
+ }
+ break;
+ }
+ case SEQ_MOVIE:
+ BLI_join_dirfile(str, sizeof(str), seq->strip->dir,
+ seq->strip->stripdata->name);
+ BLI_path_abs(str, G.main->name);
- new_tstripdata(seq);
-
- if (ELEM3(seq->type, SEQ_SCENE, SEQ_META, SEQ_IMAGE)==0) {
- BLI_join_dirfile(str, sizeof(str), seq->strip->dir, seq->strip->stripdata->name);
- BLI_path_abs(str, G.main->name);
- }
-
- switch(seq->type) {
- case SEQ_IMAGE:
- {
- /* Hack? */
- size_t olen = MEM_allocN_len(seq->strip->stripdata)/sizeof(struct StripElem);
+ if (seq->anim) IMB_free_anim(seq->anim);
+ seq->anim = openanim(str, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), seq->streamindex);
- seq->len = olen;
- seq->len -= seq->anim_startofs;
- seq->len -= seq->anim_endofs;
- if (seq->len < 0) {
- seq->len = 0;
- }
- seq->strip->len = seq->len;
- break;
- }
- case SEQ_MOVIE:
- if(seq->anim) IMB_free_anim(seq->anim);
- seq->anim = openanim(str, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), seq->streamindex);
+ if (!seq->anim) {
+ return;
+ }
- if (!seq->anim) {
- return;
- }
+ seq->len = IMB_anim_get_duration(seq->anim,
+ seq->strip->proxy ?
+ seq->strip->proxy->tc :
+ IMB_TC_RECORD_RUN);
- seq->len = IMB_anim_get_duration(seq->anim,
- seq->strip->proxy ?
- seq->strip->proxy->tc :
- IMB_TC_RECORD_RUN);
-
- seq->anim_preseek = IMB_anim_get_preseek(seq->anim);
+ seq->anim_preseek = IMB_anim_get_preseek(seq->anim);
- seq->len -= seq->anim_startofs;
- seq->len -= seq->anim_endofs;
- if (seq->len < 0) {
- seq->len = 0;
- }
- seq->strip->len = seq->len;
- break;
- case SEQ_SOUND:
+ seq->len -= seq->anim_startofs;
+ seq->len -= seq->anim_endofs;
+ if (seq->len < 0) {
+ seq->len = 0;
+ }
+ break;
+ case SEQ_MOVIECLIP:
+ seq->len = BKE_movieclip_get_duration(seq->clip);
+
+ seq->len -= seq->anim_startofs;
+ seq->len -= seq->anim_endofs;
+ if (seq->len < 0) {
+ seq->len = 0;
+ }
+ break;
+ case SEQ_SOUND:
#ifdef WITH_AUDASPACE
- if(!seq->sound)
- return;
- seq->len = ceil(AUD_getInfo(seq->sound->playback_handle).length * FPS);
- seq->len -= seq->anim_startofs;
- seq->len -= seq->anim_endofs;
- if (seq->len < 0) {
- seq->len = 0;
- }
- seq->strip->len = seq->len;
+ if (!seq->sound)
+ return;
+ seq->len = ceil(AUD_getInfo(seq->sound->playback_handle).length * FPS);
+ seq->len -= seq->anim_startofs;
+ seq->len -= seq->anim_endofs;
+ if (seq->len < 0) {
+ seq->len = 0;
+ }
#else
- return;
+ return;
#endif
- break;
- case SEQ_SCENE:
- {
- /* 'seq->scenenr' should be replaced with something more reliable */
- Scene * sce = G.main->scene.first;
- int nr = 1;
-
- while(sce) {
- if(nr == seq->scenenr) {
- break;
+ break;
+ case SEQ_SCENE:
+ {
+ seq->len = (seq->scene) ? seq->scene->r.efra - seq->scene->r.sfra + 1 : 0;
+ seq->len -= seq->anim_startofs;
+ seq->len -= seq->anim_endofs;
+ if (seq->len < 0) {
+ seq->len = 0;
}
- nr++;
- sce= sce->id.next;
- }
-
- if (sce) {
- seq->scene = sce;
- }
-
- seq->len= (seq->scene)? seq->scene->r.efra - seq->scene->r.sfra + 1: 0;
- seq->len -= seq->anim_startofs;
- seq->len -= seq->anim_endofs;
- if (seq->len < 0) {
- seq->len = 0;
+ break;
}
- seq->strip->len = seq->len;
- break;
- }
}
free_proxy_seq(seq);
- if(lock_range) {
+ if (lock_range) {
seq_tx_set_final_left(seq, prev_startdisp);
seq_tx_set_final_right(seq, prev_enddisp);
seq_single_fix(seq);
@@ -775,51 +744,51 @@ void sort_seq(Scene *scene)
{
/* all strips together per kind, and in order of y location ("machine") */
ListBase seqbase, effbase;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq, *seqt;
- if(ed==NULL) return;
+ if (ed == NULL) return;
- seqbase.first= seqbase.last= NULL;
- effbase.first= effbase.last= NULL;
+ seqbase.first = seqbase.last = NULL;
+ effbase.first = effbase.last = NULL;
- while( (seq= ed->seqbasep->first) ) {
+ while ( (seq = ed->seqbasep->first) ) {
BLI_remlink(ed->seqbasep, seq);
- if(seq->type & SEQ_EFFECT) {
- seqt= effbase.first;
- while(seqt) {
- if(seqt->machine>=seq->machine) {
+ if (seq->type & SEQ_EFFECT) {
+ seqt = effbase.first;
+ while (seqt) {
+ if (seqt->machine >= seq->machine) {
BLI_insertlinkbefore(&effbase, seqt, seq);
break;
}
- seqt= seqt->next;
+ seqt = seqt->next;
}
- if(seqt==NULL) BLI_addtail(&effbase, seq);
+ if (seqt == NULL) BLI_addtail(&effbase, seq);
}
else {
- seqt= seqbase.first;
- while(seqt) {
- if(seqt->machine>=seq->machine) {
+ seqt = seqbase.first;
+ while (seqt) {
+ if (seqt->machine >= seq->machine) {
BLI_insertlinkbefore(&seqbase, seqt, seq);
break;
}
- seqt= seqt->next;
+ seqt = seqt->next;
}
- if(seqt==NULL) BLI_addtail(&seqbase, seq);
+ if (seqt == NULL) BLI_addtail(&seqbase, seq);
}
}
BLI_movelisttolist(&seqbase, &effbase);
- *(ed->seqbasep)= seqbase;
+ *(ed->seqbasep) = seqbase;
}
static int clear_scene_in_allseqs_cb(Sequence *seq, void *arg_pt)
{
- if(seq->scene==(Scene *)arg_pt)
- seq->scene= NULL;
+ if (seq->scene == (Scene *)arg_pt)
+ seq->scene = NULL;
return 1;
}
@@ -828,8 +797,8 @@ void clear_scene_in_allseqs(Main *bmain, Scene *scene)
Scene *scene_iter;
/* when a scene is deleted: test all seqs */
- for(scene_iter= bmain->scene.first; scene_iter; scene_iter= scene_iter->id.next) {
- if(scene_iter != scene && scene_iter->ed) {
+ for (scene_iter = bmain->scene.first; scene_iter; scene_iter = scene_iter->id.next) {
+ if (scene_iter != scene && scene_iter->ed) {
seqbase_recursive_apply(&scene_iter->ed->seqbase, clear_scene_in_allseqs_cb, scene);
}
}
@@ -843,27 +812,28 @@ typedef struct SeqUniqueInfo {
int match;
} SeqUniqueInfo;
-/*
+#if 0
static void seqbase_unique_name(ListBase *seqbasep, Sequence *seq)
{
BLI_uniquename(seqbasep, seq, "Sequence", '.', offsetof(Sequence, name), SEQ_NAME_MAXSTR);
-}*/
+}
+#endif
static void seqbase_unique_name(ListBase *seqbasep, SeqUniqueInfo *sui)
{
Sequence *seq;
- for(seq=seqbasep->first; seq; seq= seq->next) {
- if (sui->seq != seq && strcmp(sui->name_dest, seq->name+2)==0) {
+ for (seq = seqbasep->first; seq; seq = seq->next) {
+ if (sui->seq != seq && strcmp(sui->name_dest, seq->name + 2) == 0) {
/* SEQ_NAME_MAXSTR - 2 for prefix, -1 for \0, -4 for the number */
BLI_snprintf(sui->name_dest, sizeof(sui->name_dest), "%.59s.%03d", sui->name_src, sui->count++);
- sui->match= 1; /* be sure to re-scan */
+ sui->match = 1; /* be sure to re-scan */
}
}
}
static int seqbase_unique_name_recursive_cb(Sequence *seq, void *arg_pt)
{
- if(seq->seqbase.first)
+ if (seq->seqbase.first)
seqbase_unique_name(&seq->seqbase, (SeqUniqueInfo *)arg_pt);
return 1;
}
@@ -872,56 +842,57 @@ void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq)
{
SeqUniqueInfo sui;
char *dot;
- sui.seq= seq;
- BLI_strncpy(sui.name_src, seq->name+2, sizeof(sui.name_src));
- BLI_strncpy(sui.name_dest, seq->name+2, sizeof(sui.name_dest));
+ sui.seq = seq;
+ BLI_strncpy(sui.name_src, seq->name + 2, sizeof(sui.name_src));
+ BLI_strncpy(sui.name_dest, seq->name + 2, sizeof(sui.name_dest));
- sui.count= 1;
- sui.match= 1; /* assume the worst to start the loop */
+ sui.count = 1;
+ sui.match = 1; /* assume the worst to start the loop */
/* Strip off the suffix */
- if ((dot=strrchr(sui.name_src, '.'))) {
- *dot= '\0';
+ if ((dot = strrchr(sui.name_src, '.'))) {
+ *dot = '\0';
dot++;
- if(*dot)
- sui.count= atoi(dot) + 1;
+ if (*dot)
+ sui.count = atoi(dot) + 1;
}
- while(sui.match) {
- sui.match= 0;
+ while (sui.match) {
+ sui.match = 0;
seqbase_unique_name(seqbasep, &sui);
seqbase_recursive_apply(seqbasep, seqbase_unique_name_recursive_cb, &sui);
}
- BLI_strncpy(seq->name+2, sui.name_dest, sizeof(seq->name)-2);
+ BLI_strncpy(seq->name + 2, sui.name_dest, sizeof(seq->name) - 2);
}
static const char *give_seqname_by_type(int type)
{
- switch(type) {
- case SEQ_META: return "Meta";
- case SEQ_IMAGE: return "Image";
- case SEQ_SCENE: return "Scene";
- case SEQ_MOVIE: return "Movie";
- case SEQ_SOUND: return "Audio";
- case SEQ_CROSS: return "Cross";
- case SEQ_GAMCROSS: return "Gamma Cross";
- case SEQ_ADD: return "Add";
- case SEQ_SUB: return "Sub";
- case SEQ_MUL: return "Mul";
- case SEQ_ALPHAOVER: return "Alpha Over";
- case SEQ_ALPHAUNDER: return "Alpha Under";
- case SEQ_OVERDROP: return "Over Drop";
- case SEQ_WIPE: return "Wipe";
- case SEQ_GLOW: return "Glow";
- case SEQ_TRANSFORM: return "Transform";
- case SEQ_COLOR: return "Color";
- case SEQ_MULTICAM: return "Multicam";
- case SEQ_ADJUSTMENT: return "Adjustment";
- case SEQ_SPEED: return "Speed";
- default:
- return NULL;
+ switch (type) {
+ case SEQ_META: return "Meta";
+ case SEQ_IMAGE: return "Image";
+ case SEQ_SCENE: return "Scene";
+ case SEQ_MOVIE: return "Movie";
+ case SEQ_MOVIECLIP: return "Clip";
+ case SEQ_SOUND: return "Audio";
+ case SEQ_CROSS: return "Cross";
+ case SEQ_GAMCROSS: return "Gamma Cross";
+ case SEQ_ADD: return "Add";
+ case SEQ_SUB: return "Sub";
+ case SEQ_MUL: return "Mul";
+ case SEQ_ALPHAOVER: return "Alpha Over";
+ case SEQ_ALPHAUNDER: return "Alpha Under";
+ case SEQ_OVERDROP: return "Over Drop";
+ case SEQ_WIPE: return "Wipe";
+ case SEQ_GLOW: return "Glow";
+ case SEQ_TRANSFORM: return "Transform";
+ case SEQ_COLOR: return "Color";
+ case SEQ_MULTICAM: return "Multicam";
+ case SEQ_ADJUSTMENT: return "Adjustment";
+ case SEQ_SPEED: return "Speed";
+ default:
+ return NULL;
}
}
@@ -930,16 +901,20 @@ const char *give_seqname(Sequence *seq)
const char *name = give_seqname_by_type(seq->type);
if (!name) {
- if(seq->type<SEQ_EFFECT) {
+ if (seq->type < SEQ_EFFECT) {
return seq->strip->dir;
- } else if(seq->type==SEQ_PLUGIN) {
- if(!(seq->flag & SEQ_EFFECT_NOT_LOADED) &&
- seq->plugin && seq->plugin->doit) {
+ }
+ else if (seq->type == SEQ_PLUGIN) {
+ if (!(seq->flag & SEQ_EFFECT_NOT_LOADED) &&
+ seq->plugin && seq->plugin->doit)
+ {
return seq->plugin->pname;
- } else {
+ }
+ else {
return "Plugin";
}
- } else {
+ }
+ else {
return "Effect";
}
}
@@ -954,11 +929,13 @@ static void make_black_ibuf(ImBuf *ibuf)
float *rect_float;
int tot;
- if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) return;
+ if (ibuf == NULL || (ibuf->rect == NULL && ibuf->rect_float == NULL)) {
+ return;
+ }
- tot= ibuf->x*ibuf->y;
+ tot = ibuf->x * ibuf->y;
- rect= ibuf->rect;
+ rect = ibuf->rect;
rect_float = ibuf->rect_float;
if (rect) {
@@ -977,29 +954,29 @@ static void multibuf(ImBuf *ibuf, float fmul)
int a, mul, icol;
- mul= (int)(256.0f * fmul);
- rt= (char *)ibuf->rect;
+ mul = (int)(256.0f * fmul);
+ rt = (char *)ibuf->rect;
rt_float = ibuf->rect_float;
if (rt) {
- a= ibuf->x*ibuf->y;
- while(a--) {
-
- icol= (mul*rt[0])>>8;
- if(icol>254) rt[0]= 255; else rt[0]= icol;
- icol= (mul*rt[1])>>8;
- if(icol>254) rt[1]= 255; else rt[1]= icol;
- icol= (mul*rt[2])>>8;
- if(icol>254) rt[2]= 255; else rt[2]= icol;
- icol= (mul*rt[3])>>8;
- if(icol>254) rt[3]= 255; else rt[3]= icol;
+ a = ibuf->x * ibuf->y;
+ while (a--) {
+
+ icol = (mul * rt[0]) >> 8;
+ if (icol > 254) rt[0] = 255; else rt[0] = icol;
+ icol = (mul * rt[1]) >> 8;
+ if (icol > 254) rt[1] = 255; else rt[1] = icol;
+ icol = (mul * rt[2]) >> 8;
+ if (icol > 254) rt[2] = 255; else rt[2] = icol;
+ icol = (mul * rt[3]) >> 8;
+ if (icol > 254) rt[3] = 255; else rt[3] = icol;
- rt+= 4;
+ rt += 4;
}
}
if (rt_float) {
- a= ibuf->x*ibuf->y;
- while(a--) {
+ a = ibuf->x * ibuf->y;
+ while (a--) {
rt_float[0] *= fmul;
rt_float[1] *= fmul;
rt_float[2] *= fmul;
@@ -1014,25 +991,26 @@ static float give_stripelem_index(Sequence *seq, float cfra)
{
float nr;
int sta = seq->start;
- int end = seq->start+seq->len-1;
+ int end = seq->start + seq->len - 1;
if (seq->type & SEQ_EFFECT) {
end = seq->enddisp;
}
- if(end < sta) {
+ if (end < sta) {
return -1;
}
- if(seq->flag&SEQ_REVERSE_FRAMES) {
+ if (seq->flag & SEQ_REVERSE_FRAMES) {
/*reverse frame in this sequence */
- if(cfra <= sta) nr= end - sta;
- else if(cfra >= end) nr= 0;
- else nr= end - cfra;
- } else {
- if(cfra <= sta) nr= 0;
- else if(cfra >= end) nr= end - sta;
- else nr= cfra - sta;
+ if (cfra <= sta) nr = end - sta;
+ else if (cfra >= end) nr = 0;
+ else nr = end - cfra;
+ }
+ else {
+ if (cfra <= sta) nr = 0;
+ else if (cfra >= end) nr = end - sta;
+ else nr = cfra - sta;
}
if (seq->strobe < 1.0f) seq->strobe = 1.0f;
@@ -1046,14 +1024,14 @@ static float give_stripelem_index(Sequence *seq, float cfra)
StripElem *give_stripelem(Sequence *seq, int cfra)
{
- StripElem *se= seq->strip->stripdata;
+ 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... */
- int nr = (int) give_stripelem_index(seq, cfra);
+ 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;
@@ -1062,20 +1040,20 @@ StripElem *give_stripelem(Sequence *seq, int cfra)
return se;
}
-static int evaluate_seq_frame_gen(Sequence ** seq_arr, ListBase *seqbase, int cfra)
+static int evaluate_seq_frame_gen(Sequence **seq_arr, ListBase *seqbase, int cfra)
{
Sequence *seq;
- int totseq=0;
+ int totseq = 0;
- memset(seq_arr, 0, sizeof(Sequence*) * (MAXSEQ+1));
+ memset(seq_arr, 0, sizeof(Sequence *) * (MAXSEQ + 1));
- seq= seqbase->first;
- while(seq) {
- if(seq->startdisp <=cfra && seq->enddisp > cfra) {
- seq_arr[seq->machine]= seq;
+ seq = seqbase->first;
+ while (seq) {
+ if (seq->startdisp <= cfra && seq->enddisp > cfra) {
+ seq_arr[seq->machine] = seq;
totseq++;
}
- seq= seq->next;
+ seq = seq->next;
}
return totseq;
@@ -1083,21 +1061,21 @@ static int evaluate_seq_frame_gen(Sequence ** seq_arr, ListBase *seqbase, int cf
int evaluate_seq_frame(Scene *scene, int cfra)
{
- Editing *ed= seq_give_editing(scene, FALSE);
- Sequence *seq_arr[MAXSEQ+1];
+ Editing *ed = seq_give_editing(scene, FALSE);
+ Sequence *seq_arr[MAXSEQ + 1];
- if(ed==NULL) return 0;
+ if (ed == NULL) return 0;
return evaluate_seq_frame_gen(seq_arr, ed->seqbasep, cfra);
}
-static int video_seq_is_rendered(Sequence * seq)
+static int video_seq_is_rendered(Sequence *seq)
{
return (seq && !(seq->flag & SEQ_MUTE) && seq->type != SEQ_SOUND);
}
-static int get_shown_sequences( ListBase * seqbasep, int cfra, int chanshown, Sequence ** seq_arr_out)
+static int get_shown_sequences(ListBase *seqbasep, int cfra, int chanshown, Sequence **seq_arr_out)
{
- Sequence *seq_arr[MAXSEQ+1];
+ Sequence *seq_arr[MAXSEQ + 1];
int b = chanshown;
int cnt = 0;
@@ -1105,7 +1083,7 @@ static int get_shown_sequences( ListBase * seqbasep, int cfra, int chanshown, Se
return 0;
}
- if(evaluate_seq_frame_gen(seq_arr, seqbasep, cfra)) {
+ if (evaluate_seq_frame_gen(seq_arr, seqbasep, cfra)) {
if (b == 0) {
b = MAXSEQ;
}
@@ -1118,7 +1096,7 @@ static int get_shown_sequences( ListBase * seqbasep, int cfra, int chanshown, Se
chanshown = b;
- for (;b > 0; b--) {
+ for (; b > 0; b--) {
if (video_seq_is_rendered(seq_arr[b])) {
if (seq_arr[b]->blend_mode == SEQ_BLEND_REPLACE) {
break;
@@ -1126,7 +1104,7 @@ static int get_shown_sequences( ListBase * seqbasep, int cfra, int chanshown, Se
}
}
- for (;b <= chanshown && b >= 0; b++) {
+ for (; b <= chanshown && b >= 0; b++) {
if (video_seq_is_rendered(seq_arr[b])) {
seq_arr_out[cnt++] = seq_arr[b];
}
@@ -1137,8 +1115,8 @@ static int get_shown_sequences( ListBase * seqbasep, int cfra, int chanshown, Se
/* **********************************************************************
- proxy management
- ********************************************************************** */
+ * proxy management
+ * ********************************************************************** */
typedef struct SeqIndexBuildContext {
struct IndexBuildContext *index_context;
@@ -1152,7 +1130,7 @@ typedef struct SeqIndexBuildContext {
Sequence *seq, *orig_seq;
} SeqIndexBuildContext;
-#define PROXY_MAXFILE (2*FILE_MAXDIR+FILE_MAXFILE)
+#define PROXY_MAXFILE (2 * FILE_MAXDIR + FILE_MAXFILE)
static IMB_Proxy_Size seq_rendersize_to_proxysize(int size)
{
@@ -1171,12 +1149,26 @@ static IMB_Proxy_Size seq_rendersize_to_proxysize(int size)
return IMB_PROXY_25;
}
-static void seq_open_anim_file(Sequence * seq)
+static double seq_rendersize_to_scale_factor(int size)
+{
+ if (size >= 99) {
+ return 1.0;
+ }
+ if (size >= 75) {
+ return 0.75;
+ }
+ if (size >= 50) {
+ return 0.50;
+ }
+ return 0.25;
+}
+
+static void seq_open_anim_file(Sequence *seq)
{
char name[FILE_MAX];
- StripProxy * proxy;
+ StripProxy *proxy;
- if(seq->anim != NULL) {
+ if (seq->anim != NULL) {
return;
}
@@ -1186,7 +1178,7 @@ static void seq_open_anim_file(Sequence * seq)
seq->anim = openanim(name, IB_rect |
((seq->flag & SEQ_FILTERY) ?
- IB_animdeinterlace : 0), seq->streamindex);
+ IB_animdeinterlace : 0), seq->streamindex);
if (seq->anim == NULL) {
return;
@@ -1204,7 +1196,7 @@ static void seq_open_anim_file(Sequence * seq)
}
-static int seq_proxy_get_fname(Sequence * seq, int cfra, int render_size, char * name)
+static int seq_proxy_get_fname(Sequence *seq, int cfra, int render_size, char *name)
{
int frameno;
char dir[PROXY_MAXFILE];
@@ -1214,18 +1206,20 @@ 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... */
-
- if (seq->flag & (SEQ_USE_PROXY_CUSTOM_DIR|SEQ_USE_PROXY_CUSTOM_FILE)) {
+ * 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));
- } else if (seq->type == SEQ_IMAGE) {
+ }
+ else if (seq->type == SEQ_IMAGE) {
BLI_snprintf(dir, PROXY_MAXFILE, "%s/BL_proxy", seq->strip->dir);
- } else {
+ }
+ else {
return FALSE;
}
@@ -1244,8 +1238,9 @@ static int seq_proxy_get_fname(Sequence * seq, int cfra, int render_size, char *
render_size,
give_stripelem(seq, cfra)->name);
frameno = 1;
- } else {
- frameno = (int) give_stripelem_index(seq, cfra) + seq->anim_startofs;
+ }
+ else {
+ frameno = (int)give_stripelem_index(seq, cfra) + seq->anim_startofs;
BLI_snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/####", dir,
render_size);
}
@@ -1258,11 +1253,10 @@ static int seq_proxy_get_fname(Sequence * seq, int cfra, int render_size, char *
return TRUE;
}
-static struct ImBuf * seq_proxy_fetch(SeqRenderData context, Sequence * seq, int cfra)
+static ImBuf *seq_proxy_fetch(SeqRenderData context, Sequence *seq, int cfra)
{
char name[PROXY_MAXFILE];
- IMB_Proxy_Size psize = seq_rendersize_to_proxysize(
- context.preview_render_size);
+ IMB_Proxy_Size psize = seq_rendersize_to_proxysize(context.preview_render_size);
int size_flags;
int render_size = context.preview_render_size;
@@ -1283,25 +1277,25 @@ static struct ImBuf * seq_proxy_fetch(SeqRenderData context, Sequence * seq, int
}
if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) {
- int frameno = (int) give_stripelem_index(seq, cfra) + seq->anim_startofs;
+ int frameno = (int)give_stripelem_index(seq, cfra) + seq->anim_startofs;
if (seq->strip->proxy->anim == NULL) {
- if (seq_proxy_get_fname(seq, cfra, render_size, name)==0) {
+ if (seq_proxy_get_fname(seq, cfra, render_size, name) == 0) {
return NULL;
}
seq->strip->proxy->anim = openanim(name, IB_rect, 0);
}
- if (seq->strip->proxy->anim==NULL) {
+ if (seq->strip->proxy->anim == NULL) {
return NULL;
}
seq_open_anim_file(seq);
- frameno = IMB_anim_index_get_frame_index(
- seq->anim, seq->strip->proxy->tc, frameno);
+ frameno = IMB_anim_index_get_frame_index(seq->anim, seq->strip->proxy->tc,
+ frameno);
return IMB_anim_absolute(seq->strip->proxy->anim, frameno,
- IMB_TC_NONE, IMB_PROXY_NONE);
+ IMB_TC_NONE, IMB_PROXY_NONE);
}
if (seq_proxy_get_fname(seq, cfra, render_size, name) == 0) {
@@ -1310,20 +1304,21 @@ static struct ImBuf * seq_proxy_fetch(SeqRenderData context, Sequence * seq, int
if (BLI_exists(name)) {
return IMB_loadiffname(name, IB_rect);
- } else {
+ }
+ else {
return NULL;
}
}
static void seq_proxy_build_frame(SeqRenderData context,
- Sequence* seq, int cfra,
- int proxy_render_size)
+ Sequence *seq, int cfra,
+ int proxy_render_size)
{
char name[PROXY_MAXFILE];
int quality;
int rectx, recty;
int ok;
- struct ImBuf * ibuf;
+ ImBuf *ibuf;
if (!seq_proxy_get_fname(seq, cfra, proxy_render_size, name)) {
return;
@@ -1339,13 +1334,13 @@ 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;
+ ibuf->ftype = JPG | quality;
/* unsupported feature only confuses other s/w */
- if(ibuf->planes==32)
- ibuf->planes= 24;
+ if (ibuf->planes == 32)
+ ibuf->planes = 24;
BLI_make_existing_file(name);
@@ -1357,8 +1352,7 @@ static void seq_proxy_build_frame(SeqRenderData context,
IMB_freeImBuf(ibuf);
}
-struct SeqIndexBuildContext *seq_proxy_rebuild_context(Main *bmain, Scene *scene, Sequence *seq)
-{
+struct SeqIndexBuildContext *seq_proxy_rebuild_context(Main *bmain, Scene *scene, Sequence *seq){
SeqIndexBuildContext *context;
Sequence *nseq;
@@ -1388,7 +1382,7 @@ struct SeqIndexBuildContext *seq_proxy_rebuild_context(Main *bmain, Scene *scene
if (nseq->anim) {
context->index_context = IMB_anim_index_rebuild_context(nseq->anim,
- context->tc_flags, context->size_flags, context->quality);
+ context->tc_flags, context->size_flags, context->quality);
}
}
@@ -1422,10 +1416,10 @@ void seq_proxy_rebuild(SeqIndexBuildContext *context, short *stop, short *do_upd
/* fail safe code */
render_context = seq_new_render_data(
- context->bmain, context->scene,
- (scene->r.size * (float) scene->r.xsch) / 100.0f + 0.5f,
- (scene->r.size * (float) scene->r.ysch) / 100.0f + 0.5f,
- 100);
+ context->bmain, context->scene,
+ (scene->r.size * (float)scene->r.xsch) / 100.0f + 0.5f,
+ (scene->r.size * (float)scene->r.ysch) / 100.0f + 0.5f,
+ 100);
for (cfra = seq->startdisp + seq->startstill;
cfra < seq->enddisp - seq->endstill; cfra++) {
@@ -1442,11 +1436,11 @@ void seq_proxy_rebuild(SeqIndexBuildContext *context, short *stop, short *do_upd
seq_proxy_build_frame(render_context, seq, cfra, 100);
}
- *progress= (float)cfra/(seq->enddisp - seq->endstill
- - seq->startdisp + seq->startstill);
- *do_update= 1;
+ *progress = (float)cfra / (seq->enddisp - seq->endstill -
+ seq->startdisp + seq->startstill);
+ *do_update = 1;
- if(*stop || G.afbreek)
+ if (*stop || G.afbreek)
break;
}
}
@@ -1465,10 +1459,10 @@ void seq_proxy_rebuild_finish(SeqIndexBuildContext *context, short stop)
}
/* **********************************************************************
- color balance
- ********************************************************************** */
+ * color balance
+ * ********************************************************************** */
-static StripColorBalance calc_cb(StripColorBalance * cb_)
+static StripColorBalance calc_cb(StripColorBalance *cb_)
{
StripColorBalance cb = *cb_;
int c;
@@ -1477,11 +1471,11 @@ static StripColorBalance calc_cb(StripColorBalance * cb_)
cb.lift[c] = 2.0f - cb.lift[c];
}
- if(cb.flag & SEQ_COLOR_BALANCE_INVERSE_LIFT) {
+ if (cb.flag & SEQ_COLOR_BALANCE_INVERSE_LIFT) {
for (c = 0; c < 3; c++) {
/* tweak to give more subtle results
* values above 1.0 are scaled */
- if(cb.lift[c] > 1.0f)
+ if (cb.lift[c] > 1.0f)
cb.lift[c] = pow(cb.lift[c] - 1.0f, 2.0) + 1.0;
cb.lift[c] = 2.0f - cb.lift[c];
@@ -1492,7 +1486,8 @@ static StripColorBalance calc_cb(StripColorBalance * cb_)
for (c = 0; c < 3; c++) {
if (cb.gain[c] != 0.0f) {
cb.gain[c] = 1.0f / cb.gain[c];
- } else {
+ }
+ else {
cb.gain[c] = 1000000; /* should be enough :) */
}
}
@@ -1501,8 +1496,9 @@ static StripColorBalance calc_cb(StripColorBalance * cb_)
if (!(cb.flag & SEQ_COLOR_BALANCE_INVERSE_GAMMA)) {
for (c = 0; c < 3; c++) {
if (cb.gamma[c] != 0.0f) {
- cb.gamma[c] = 1.0f/cb.gamma[c];
- } else {
+ cb.gamma[c] = 1.0f / cb.gamma[c];
+ }
+ else {
cb.gamma[c] = 1000000; /* should be enough :) */
}
}
@@ -1514,7 +1510,7 @@ static StripColorBalance calc_cb(StripColorBalance * cb_)
/* note: lift is actually 2-lift */
MINLINE float color_balance_fl(float in, const float lift, const float gain, const float gamma, const float mul)
{
- float x= (((in - 1.0f) * lift) + 1.0f) * gain;
+ float x = (((in - 1.0f) * lift) + 1.0f) * gain;
/* prevent NaN */
if (x < 0.f) x = 0.f;
@@ -1523,34 +1519,34 @@ MINLINE float color_balance_fl(float in, const float lift, const float gain, con
}
static void make_cb_table_byte(float lift, float gain, float gamma,
- unsigned char * table, float mul)
+ unsigned char *table, float mul)
{
int y;
for (y = 0; y < 256; y++) {
- float v= color_balance_fl((float)y * (1.0f / 255.0f), lift, gain, gamma, mul);
+ float v = color_balance_fl((float)y * (1.0f / 255.0f), lift, gain, gamma, mul);
CLAMP(v, 0.0f, 1.0f);
table[y] = v * 255;
}
}
static void make_cb_table_float(float lift, float gain, float gamma,
- float * table, float mul)
+ float *table, float mul)
{
int y;
for (y = 0; y < 256; y++) {
- float v= color_balance_fl((float)y * (1.0f / 255.0f), lift, gain, gamma, mul);
+ float v = color_balance_fl((float)y * (1.0f / 255.0f), lift, gain, gamma, mul);
table[y] = v;
}
}
-static void color_balance_byte_byte(Sequence * seq, ImBuf* ibuf, float mul)
+static void color_balance_byte_byte(Sequence *seq, ImBuf *ibuf, float mul)
{
unsigned char cb_tab[3][256];
int c;
- unsigned char * p = (unsigned char*) ibuf->rect;
- unsigned char * e = p + ibuf->x * 4 * ibuf->y;
+ unsigned char *p = (unsigned char *) ibuf->rect;
+ unsigned char *e = p + ibuf->x * 4 * ibuf->y;
StripColorBalance cb = calc_cb(seq->strip->color_balance);
@@ -1568,13 +1564,13 @@ static void color_balance_byte_byte(Sequence * seq, ImBuf* ibuf, float mul)
}
}
-static void color_balance_byte_float(Sequence * seq, ImBuf* ibuf, float mul)
+static void color_balance_byte_float(Sequence *seq, ImBuf *ibuf, float mul)
{
float cb_tab[4][256];
- int c,i;
- unsigned char * p = (unsigned char*) ibuf->rect;
- unsigned char * e = p + ibuf->x * 4 * ibuf->y;
- float * o;
+ int c, i;
+ unsigned char *p = (unsigned char *) ibuf->rect;
+ unsigned char *e = p + ibuf->x * 4 * ibuf->y;
+ float *o;
StripColorBalance cb;
imb_addrectfloatImBuf(ibuf);
@@ -1588,7 +1584,7 @@ static void color_balance_byte_float(Sequence * seq, ImBuf* ibuf, float mul)
}
for (i = 0; i < 256; i++) {
- cb_tab[3][i] = ((float)i)*(1.0f/255.0f);
+ cb_tab[3][i] = ((float)i) * (1.0f / 255.0f);
}
while (p < e) {
@@ -1601,64 +1597,65 @@ static void color_balance_byte_float(Sequence * seq, ImBuf* ibuf, float mul)
}
}
-static void color_balance_float_float(Sequence * seq, ImBuf* ibuf, float mul)
+static void color_balance_float_float(Sequence *seq, ImBuf *ibuf, float mul)
{
- float * p = ibuf->rect_float;
- float * e = ibuf->rect_float + ibuf->x * 4* ibuf->y;
+ float *p = ibuf->rect_float;
+ float *e = ibuf->rect_float + ibuf->x * 4 * ibuf->y;
StripColorBalance cb = calc_cb(seq->strip->color_balance);
while (p < e) {
int c;
for (c = 0; c < 3; c++) {
- p[c]= color_balance_fl(p[c], cb.lift[c], cb.gain[c], cb.gamma[c], mul);
+ p[c] = color_balance_fl(p[c], cb.lift[c], cb.gain[c], cb.gamma[c], mul);
}
p += 4;
}
}
-static void color_balance(Sequence * seq, ImBuf* ibuf, float mul)
+static void color_balance(Sequence *seq, ImBuf *ibuf, float mul)
{
if (ibuf->rect_float) {
color_balance_float_float(seq, ibuf, mul);
- } else if(seq->flag & SEQ_MAKE_FLOAT) {
+ }
+ else if (seq->flag & SEQ_MAKE_FLOAT) {
color_balance_byte_float(seq, ibuf, mul);
- } else {
+ }
+ else {
color_balance_byte_byte(seq, ibuf, 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, SEQ_MOVIECLIP 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))
+ SeqRenderData UNUSED(context), Sequence *seq, float UNUSED(cfra))
{
float mul;
- if (seq->flag & (SEQ_FILTERY|SEQ_USE_CROP|SEQ_USE_TRANSFORM|SEQ_FLIPX|
- SEQ_FLIPY|SEQ_USE_COLOR_BALANCE|SEQ_MAKE_PREMUL)) {
+ if (seq->flag & (SEQ_FILTERY | SEQ_USE_CROP | SEQ_USE_TRANSFORM | SEQ_FLIPX |
+ SEQ_FLIPY | SEQ_USE_COLOR_BALANCE | SEQ_MAKE_PREMUL)) {
return TRUE;
}
mul = seq->mul;
- if(seq->blend_mode == SEQ_BLEND_REPLACE) {
+ if (seq->blend_mode == SEQ_BLEND_REPLACE) {
mul *= seq->blend_opacity / 100.0f;
}
@@ -1673,46 +1670,83 @@ int input_have_to_preprocess(
return FALSE;
}
-static ImBuf * input_preprocess(
- SeqRenderData context, Sequence *seq, float UNUSED(cfra), ImBuf * ibuf)
+static ImBuf *input_preprocess(
+ SeqRenderData context, Sequence *seq, float UNUSED(cfra), ImBuf *ibuf,
+ int is_proxy_image, int is_preprocessed)
{
float mul;
ibuf = IMB_makeSingleUser(ibuf);
- if((seq->flag & SEQ_FILTERY) && seq->type != SEQ_MOVIE) {
+ if ((seq->flag & SEQ_FILTERY) &&
+ !ELEM(seq->type, SEQ_MOVIE, SEQ_MOVIECLIP))
+ {
IMB_filtery(ibuf);
}
- if(seq->flag & (SEQ_USE_CROP|SEQ_USE_TRANSFORM)) {
- StripCrop c= {0};
- StripTransform t= {0};
- int sx,sy,dx,dy;
+ if (seq->flag & (SEQ_USE_CROP | SEQ_USE_TRANSFORM)) {
+ StripCrop c = {0};
+ StripTransform t = {0};
+ int sx, sy, dx, dy;
+ double xscale = 1.0;
+ double yscale = 1.0;
- if(seq->flag & SEQ_USE_CROP && seq->strip->crop) {
+ if (is_proxy_image) {
+ double f = seq_rendersize_to_scale_factor(
+ context.preview_render_size);
+
+ if (f != 1.0) {
+ IMB_scalefastImBuf(
+ ibuf, ibuf->x / f, ibuf->y / f);
+ }
+ }
+
+ if (seq->flag & SEQ_USE_CROP && seq->strip->crop) {
c = *seq->strip->crop;
}
- if(seq->flag & SEQ_USE_TRANSFORM && seq->strip->transform) {
+ if (seq->flag & SEQ_USE_TRANSFORM && seq->strip->transform) {
t = *seq->strip->transform;
}
+ xscale = context.scene->r.xsch ?
+ ((double) context.rectx /
+ (double) context.scene->r.xsch) : 1.0;
+ yscale = context.scene->r.ysch ?
+ ((double) context.recty /
+ (double) context.scene->r.ysch) : 1.0;
+
+ c.left *= xscale; c.right *= xscale;
+ c.top *= yscale; c.bottom *= yscale;
+
+ t.xofs *= xscale; t.yofs *= yscale;
+
sx = ibuf->x - c.left - c.right;
sy = ibuf->y - c.top - c.bottom;
dx = sx;
dy = sy;
if (seq->flag & SEQ_USE_TRANSFORM) {
- dx = context.scene->r.xsch;
- dy = context.scene->r.ysch;
+ if (is_preprocessed) {
+ dx = context.rectx;
+ dy = context.recty;
+ }
+ else {
+ dx = context.scene->r.xsch;
+ dy = context.scene->r.ysch;
+ }
}
if (c.top + c.bottom >= ibuf->y || c.left + c.right >= ibuf->x ||
- t.xofs >= dx || t.yofs >= dy) {
+ t.xofs >= dx || t.yofs >= dy) {
make_black_ibuf(ibuf);
- } else {
- ImBuf * i = IMB_allocImBuf(dx, dy,32, ibuf->rect_float ? IB_rectfloat : IB_rect);
+ }
+ else {
+ ImBuf *i = IMB_allocImBuf(
+ dx, dy, 32,
+ ibuf->rect_float ? IB_rectfloat : IB_rect);
- IMB_rectcpy(i, ibuf, t.xofs, t.yofs, c.left, c.bottom, sx, sy);
+ IMB_rectcpy(i, ibuf,
+ t.xofs, t.yofs, c.left, c.bottom, sx, sy);
IMB_freeImBuf(ibuf);
@@ -1720,52 +1754,30 @@ static ImBuf * input_preprocess(
}
}
- if(seq->flag & SEQ_FLIPX) {
+ if (seq->flag & SEQ_FLIPX) {
IMB_flipx(ibuf);
}
- if(seq->flag & SEQ_FLIPY) {
+ if (seq->flag & SEQ_FLIPY) {
IMB_flipy(ibuf);
}
- if(seq->sat != 1.0f) {
- /* inline for now, could become an imbuf function */
- int i;
- unsigned char *rct= (unsigned char *)ibuf->rect;
- float *rctf= ibuf->rect_float;
- const float sat= seq->sat;
- float hsv[3];
-
- if(rct) {
- float rgb[3];
- for (i = ibuf->x * ibuf->y; i > 0; i--, rct+=4) {
- rgb_uchar_to_float(rgb, rct);
- rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
- hsv_to_rgb(hsv[0], hsv[1] * sat, hsv[2], rgb, rgb+1, rgb+2);
- rgb_float_to_uchar(rct, rgb);
- }
- }
-
- if(rctf) {
- for (i = ibuf->x * ibuf->y; i > 0; i--, rctf+=4) {
- rgb_to_hsv(rctf[0], rctf[1], rctf[2], hsv, hsv+1, hsv+2);
- hsv_to_rgb(hsv[0], hsv[1] * sat, hsv[2], rctf, rctf+1, rctf+2);
- }
- }
+ if (seq->sat != 1.0f) {
+ IMB_saturation(ibuf, seq->sat);
}
mul = seq->mul;
- if(seq->blend_mode == SEQ_BLEND_REPLACE) {
+ if (seq->blend_mode == SEQ_BLEND_REPLACE) {
mul *= seq->blend_opacity / 100.0f;
}
- if(seq->flag & SEQ_USE_COLOR_BALANCE && seq->strip->color_balance) {
+ if (seq->flag & SEQ_USE_COLOR_BALANCE && seq->strip->color_balance) {
color_balance(seq, ibuf, mul);
mul = 1.0;
}
- if(seq->flag & SEQ_MAKE_FLOAT) {
+ if (seq->flag & SEQ_MAKE_FLOAT) {
if (!ibuf->rect_float)
IMB_float_from_rect_simple(ibuf);
@@ -1774,41 +1786,43 @@ static ImBuf * input_preprocess(
}
}
- if(mul != 1.0f) {
+ if (mul != 1.0f) {
multibuf(ibuf, mul);
}
- if(seq->flag & SEQ_MAKE_PREMUL) {
- if(ibuf->planes == 32 && ibuf->zbuf == NULL) {
+ if (seq->flag & SEQ_MAKE_PREMUL) {
+ if (ibuf->planes == 32 && ibuf->zbuf == NULL) {
IMB_premultiply_alpha(ibuf);
}
}
- if(ibuf->x != context.rectx || ibuf->y != context.recty ) {
- if(context.scene->r.mode & R_OSA) {
+ if (ibuf->x != context.rectx || ibuf->y != context.recty) {
+ if (context.scene->r.mode & R_OSA) {
IMB_scaleImBuf(ibuf, (short)context.rectx, (short)context.recty);
- } else {
+ }
+ else {
IMB_scalefastImBuf(ibuf, (short)context.rectx, (short)context.recty);
}
}
return ibuf;
}
-static ImBuf * copy_from_ibuf_still(SeqRenderData context, Sequence * seq,
- float nr)
+static ImBuf *copy_from_ibuf_still(SeqRenderData context, Sequence *seq,
+ float nr)
{
- ImBuf * rval = NULL;
- ImBuf * ibuf = NULL;
+ ImBuf *rval = NULL;
+ ImBuf *ibuf = NULL;
if (nr == 0) {
ibuf = seq_stripelem_cache_get(
- context, seq, seq->start,
- SEQ_STRIPELEM_IBUF_STARTSTILL);
- } else if (nr == seq->len - 1) {
+ context, seq, seq->start,
+ SEQ_STRIPELEM_IBUF_STARTSTILL);
+ }
+ else if (nr == seq->len - 1) {
ibuf = seq_stripelem_cache_get(
- context, seq, seq->start,
- SEQ_STRIPELEM_IBUF_ENDSTILL);
+ context, seq, seq->start,
+ SEQ_STRIPELEM_IBUF_ENDSTILL);
}
if (ibuf) {
@@ -1819,25 +1833,25 @@ static ImBuf * copy_from_ibuf_still(SeqRenderData context, Sequence * seq,
return rval;
}
-static void copy_to_ibuf_still(SeqRenderData context, Sequence * seq, float nr,
- ImBuf * ibuf)
+static void copy_to_ibuf_still(SeqRenderData context, Sequence *seq, float nr,
+ ImBuf *ibuf)
{
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) {
seq_stripelem_cache_put(
- context, seq, seq->start,
- SEQ_STRIPELEM_IBUF_STARTSTILL, ibuf);
+ context, seq, seq->start,
+ SEQ_STRIPELEM_IBUF_STARTSTILL, ibuf);
}
if (nr == seq->len - 1) {
seq_stripelem_cache_put(
- context, seq, seq->start,
- SEQ_STRIPELEM_IBUF_ENDSTILL, ibuf);
+ context, seq, seq->start,
+ SEQ_STRIPELEM_IBUF_ENDSTILL, ibuf);
}
IMB_freeImBuf(ibuf);
@@ -1845,27 +1859,27 @@ 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);
+static ImBuf *seq_render_strip_stack(
+ SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown);
-static ImBuf * seq_render_strip(
- SeqRenderData context, Sequence * seq, float cfra);
+static ImBuf *seq_render_strip(
+ SeqRenderData context, Sequence *seq, float cfra);
-static ImBuf* seq_render_effect_strip_impl(
- SeqRenderData context, Sequence *seq, float cfra)
+static ImBuf *seq_render_effect_strip_impl(
+ SeqRenderData context, Sequence *seq, float cfra)
{
float fac, facf;
int early_out;
int i;
struct SeqEffectHandle sh = get_sequence_effect(seq);
- FCurve *fcu= NULL;
- ImBuf * ibuf[3];
+ FCurve *fcu = NULL;
+ ImBuf *ibuf[3];
Sequence *input[3];
- ImBuf * out = NULL;
+ ImBuf *out = NULL;
ibuf[0] = ibuf[1] = ibuf[2] = NULL;
@@ -1873,24 +1887,25 @@ static ImBuf* seq_render_effect_strip_impl(
if (!sh.execute) { /* effect not supported in this version... */
out = IMB_allocImBuf((short)context.rectx,
- (short)context.recty, 32, IB_rect);
+ (short)context.recty, 32, IB_rect);
return out;
}
if (seq->flag & SEQ_USE_EFFECT_DEFAULT_FADE) {
sh.get_default_fac(seq, cfra, &fac, &facf);
- if ((context.scene->r.mode & R_FIELDS)==0)
- facf= fac;
+ if ((context.scene->r.mode & R_FIELDS) == 0)
+ facf = fac;
}
else {
fcu = id_data_find_fcurve(&context.scene->id, seq, &RNA_Sequence, "effect_fader", 0, NULL);
if (fcu) {
fac = facf = evaluate_fcurve(fcu, cfra);
- if( context.scene->r.mode & R_FIELDS ) {
+ if (context.scene->r.mode & R_FIELDS) {
facf = evaluate_fcurve(fcu, cfra + 0.5f);
}
- } else {
+ }
+ else {
fac = facf = seq->effect_fader;
}
}
@@ -1898,48 +1913,50 @@ static ImBuf* seq_render_effect_strip_impl(
early_out = sh.early_out(seq, fac, facf);
switch (early_out) {
- case EARLY_NO_INPUT:
- out = sh.execute(context, seq, cfra, fac, facf,
- NULL, NULL, NULL);
- break;
- case EARLY_DO_EFFECT:
- for(i=0; i<3; i++) {
- if(input[i])
- ibuf[i] = seq_render_strip(
- context, input[i], cfra);
- }
-
- if (ibuf[0] && ibuf[1]) {
+ case EARLY_NO_INPUT:
out = sh.execute(context, seq, cfra, fac, facf,
- ibuf[0], ibuf[1], ibuf[2]);
- }
- break;
- case EARLY_USE_INPUT_1:
- if (input[0]) {
- ibuf[0] = seq_render_strip(context, input[0], cfra);
- }
- if (ibuf[0]) {
- if (input_have_to_preprocess(context, seq, cfra)) {
- out = IMB_dupImBuf(ibuf[0]);
- } else {
- out = ibuf[0];
- IMB_refImBuf(out);
+ NULL, NULL, NULL);
+ break;
+ case EARLY_DO_EFFECT:
+ for (i = 0; i < 3; i++) {
+ if (input[i])
+ ibuf[i] = seq_render_strip(
+ context, input[i], cfra);
}
- }
- break;
- case EARLY_USE_INPUT_2:
- if (input[1]) {
- ibuf[1] = seq_render_strip(context, input[1], cfra);
- }
- if (ibuf[1]) {
- if (input_have_to_preprocess(context, seq, cfra)) {
- out = IMB_dupImBuf(ibuf[1]);
- } else {
- out = ibuf[1];
- IMB_refImBuf(out);
+
+ if (ibuf[0] && ibuf[1]) {
+ out = sh.execute(context, seq, cfra, fac, facf,
+ ibuf[0], ibuf[1], ibuf[2]);
}
- }
- break;
+ break;
+ case EARLY_USE_INPUT_1:
+ if (input[0]) {
+ ibuf[0] = seq_render_strip(context, input[0], cfra);
+ }
+ if (ibuf[0]) {
+ if (input_have_to_preprocess(context, seq, cfra)) {
+ out = IMB_dupImBuf(ibuf[0]);
+ }
+ else {
+ out = ibuf[0];
+ IMB_refImBuf(out);
+ }
+ }
+ break;
+ case EARLY_USE_INPUT_2:
+ if (input[1]) {
+ ibuf[1] = seq_render_strip(context, input[1], cfra);
+ }
+ if (ibuf[1]) {
+ if (input_have_to_preprocess(context, seq, cfra)) {
+ out = IMB_dupImBuf(ibuf[1]);
+ }
+ else {
+ out = ibuf[1];
+ IMB_refImBuf(out);
+ }
+ }
+ break;
}
for (i = 0; i < 3; i++) {
@@ -1953,100 +1970,153 @@ static ImBuf* seq_render_effect_strip_impl(
return out;
}
+static ImBuf *seq_render_movieclip_strip(
+ SeqRenderData context, Sequence *seq, float nr)
+{
+ ImBuf *ibuf = NULL;
+ MovieClipUser user;
+ float tloc[2], tscale, tangle;
+
+ if (!seq->clip) {
+ return NULL;
+ }
-static ImBuf * seq_render_scene_strip_impl(
- SeqRenderData context, Sequence * seq, float nr)
+ memset(&user, 0, sizeof(MovieClipUser));
+
+ BKE_movieclip_user_set_frame(&user, nr + seq->anim_startofs);
+
+ user.render_size = MCLIP_PROXY_RENDER_SIZE_FULL;
+
+ switch (seq_rendersize_to_proxysize(context.preview_render_size)) {
+ case IMB_PROXY_NONE:
+ user.render_size = MCLIP_PROXY_RENDER_SIZE_FULL;
+ break;
+ case IMB_PROXY_100:
+ user.render_size = MCLIP_PROXY_RENDER_SIZE_100;
+ break;
+ case IMB_PROXY_75:
+ user.render_size = MCLIP_PROXY_RENDER_SIZE_75;
+ break;
+ case IMB_PROXY_50:
+ user.render_size = MCLIP_PROXY_RENDER_SIZE_50;
+ break;
+ case IMB_PROXY_25:
+ user.render_size = MCLIP_PROXY_RENDER_SIZE_25;
+ break;
+ }
+
+ if (seq->clip_flag & SEQ_MOVIECLIP_RENDER_UNDISTORTED) {
+ user.render_flag = MCLIP_PROXY_RENDER_UNDISTORT;
+ }
+
+ if (seq->clip_flag & SEQ_MOVIECLIP_RENDER_STABILIZED) {
+ ibuf = BKE_movieclip_get_stable_ibuf(
+ seq->clip, &user, tloc, &tscale, &tangle,
+ 0);
+ }
+ else {
+ ibuf = BKE_movieclip_get_ibuf_flag(
+ seq->clip, &user, 0, MOVIECLIP_CACHE_SKIP);
+ }
+
+ return ibuf;
+}
+
+static ImBuf *seq_render_scene_strip(
+ SeqRenderData context, Sequence *seq, float nr)
{
- ImBuf * ibuf = NULL;
- float frame= seq->sfra + nr + seq->anim_startofs;
+ ImBuf *ibuf = NULL;
+ float frame;
float oldcfra;
Object *camera;
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;
- int doseq_gl= G.rendering ? /*(scene->r.seq_flag & R_SEQ_GL_REND)*/ 0 : /*(scene->r.seq_flag & R_SEQ_GL_PREV)*/ 1;
- int have_seq= FALSE;
+ int doseq_gl = G.rendering ? /*(scene->r.seq_flag & R_SEQ_GL_REND)*/ 0 : /*(scene->r.seq_flag & R_SEQ_GL_PREV)*/ 1;
+ int have_seq = FALSE;
Scene *scene;
- /* dont refer to seq->scene above this point!, it can be NULL */
- if(seq->scene == NULL) {
+ /* don't refer to seq->scene above this point!, it can be NULL */
+ if (seq->scene == NULL) {
return NULL;
}
- scene= seq->scene;
+ scene = seq->scene;
+ frame = scene->r.sfra + nr + seq->anim_startofs;
- have_seq= (scene->r.scemode & R_DOSEQ) && scene->ed && scene->ed->seqbase.first;
+ have_seq = (scene->r.scemode & R_DOSEQ) && scene->ed && scene->ed->seqbase.first;
- oldcfra= scene->r.cfra;
- scene->r.cfra= frame;
+ oldcfra = scene->r.cfra;
+ scene->r.cfra = frame;
- if(seq->scene_camera)
- camera= seq->scene_camera;
+ if (seq->scene_camera)
+ camera = seq->scene_camera;
else {
scene_camera_switch_update(scene);
- camera= scene->camera;
+ camera = scene->camera;
}
- if(have_seq==FALSE && camera==NULL) {
- scene->r.cfra= oldcfra;
+ if (have_seq == FALSE && camera == NULL) {
+ scene->r.cfra = oldcfra;
return NULL;
}
/* prevent eternal loop */
- doseq= context.scene->r.scemode & R_DOSEQ;
+ doseq = context.scene->r.scemode & R_DOSEQ;
context.scene->r.scemode &= ~R_DOSEQ;
#ifdef DURIAN_CAMERA_SWITCH
/* stooping to new low's in hackyness :( */
- oldmarkers= scene->markers;
- scene->markers.first= scene->markers.last= NULL;
+ oldmarkers = scene->markers;
+ scene->markers.first = scene->markers.last = NULL;
#else
(void)oldmarkers;
#endif
- if(sequencer_view3d_cb && BLI_thread_is_main() && doseq_gl && (scene == context.scene || have_seq==0) && camera) {
- char err_out[256]= "unknown";
+ if (sequencer_view3d_cb && BLI_thread_is_main() && doseq_gl && (scene == context.scene || have_seq == 0) && camera) {
+ char err_out[256] = "unknown";
/* for old scened this can be uninitialized, should probably be added to do_versions at some point if the functionality stays */
- if(context.scene->r.seq_prev_type==0)
+ if (context.scene->r.seq_prev_type == 0)
context.scene->r.seq_prev_type = 3 /* ==OB_SOLID */;
/* 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);
- if(ibuf == NULL) {
- fprintf(stderr, "seq_render_scene_strip_impl failed to get opengl buffer: %s\n", 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 failed to get opengl buffer: %s\n", err_out);
}
}
else {
@@ -2054,9 +2124,9 @@ static ImBuf * seq_render_scene_strip_impl(
RenderResult rres;
/* XXX: this if can be removed when sequence preview rendering uses the job system */
- if(rendering || context.scene != scene) {
- if(re==NULL)
- re= RE_NewRender(scene->id.name);
+ if (rendering || context.scene != scene) {
+ if (re == NULL)
+ re = RE_NewRender(scene->id.name);
RE_BlenderFrame(re, context.bmain, scene, NULL, camera, scene->lay, frame, FALSE);
@@ -2066,24 +2136,24 @@ static ImBuf * seq_render_scene_strip_impl(
RE_AcquireResultImage(re, &rres);
- if(rres.rectf) {
- ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rectfloat);
- memcpy(ibuf->rect_float, rres.rectf, 4*sizeof(float)*rres.rectx*rres.recty);
- if(rres.rectz) {
+ if (rres.rectf) {
+ ibuf = IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rectfloat);
+ memcpy(ibuf->rect_float, rres.rectf, 4 * sizeof(float) * rres.rectx * rres.recty);
+ if (rres.rectz) {
addzbuffloatImBuf(ibuf);
- memcpy(ibuf->zbuf_float, rres.rectz, sizeof(float)*rres.rectx*rres.recty);
+ memcpy(ibuf->zbuf_float, rres.rectz, sizeof(float) * rres.rectx * rres.recty);
}
/* float buffers in the sequencer are not linear */
- if(scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
- ibuf->profile= IB_PROFILE_LINEAR_RGB;
+ if (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
+ ibuf->profile = IB_PROFILE_LINEAR_RGB;
else
- ibuf->profile= IB_PROFILE_NONE;
+ ibuf->profile = IB_PROFILE_NONE;
IMB_convert_profile(ibuf, IB_PROFILE_SRGB);
}
else if (rres.rect32) {
- ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rect);
- memcpy(ibuf->rect, rres.rect32, 4*rres.rectx*rres.recty);
+ ibuf = IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rect);
+ memcpy(ibuf->rect, rres.rect32, 4 * rres.rectx * rres.recty);
}
RE_ReleaseResultImage(re);
@@ -2096,156 +2166,177 @@ static ImBuf * seq_render_scene_strip_impl(
scene->r.cfra = oldcfra;
- if(frame != oldcfra)
+ if (frame != oldcfra)
scene_update_for_newframe(context.bmain, scene, scene->lay);
#ifdef DURIAN_CAMERA_SWITCH
/* stooping to new low's in hackyness :( */
- scene->markers= oldmarkers;
+ scene->markers = oldmarkers;
#endif
return ibuf;
}
-static ImBuf * seq_render_strip(SeqRenderData context, Sequence * seq, float cfra)
+static ImBuf *seq_render_strip(SeqRenderData context, Sequence *seq, float cfra)
{
- ImBuf * ibuf = NULL;
+ ImBuf *ibuf = NULL;
char name[FILE_MAX];
int use_preprocess = input_have_to_preprocess(context, seq, cfra);
+ int is_proxy_image = FALSE;
float nr = give_stripelem_index(seq, cfra);
/* all effects are handled similarly with the exception of speed effect */
int type = (seq->type & SEQ_EFFECT && seq->type != SEQ_SPEED) ? SEQ_EFFECT : seq->type;
+ int is_preprocessed = !ELEM3(type, SEQ_IMAGE, SEQ_MOVIE, SEQ_SCENE);
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;
if (ibuf == NULL)
ibuf = copy_from_ibuf_still(context, seq, nr);
- if (ibuf == NULL)
+ /* MOVIECLIPs have their own proxy management */
+ if (ibuf == NULL && seq->type != SEQ_MOVIECLIP) {
ibuf = seq_proxy_fetch(context, seq, cfra);
+ is_proxy_image = (ibuf != NULL);
+ }
- if(ibuf == NULL) switch(type) {
- case SEQ_META:
- {
- ImBuf * meta_ibuf = NULL;
+ if (ibuf == NULL) switch (type) {
+ case SEQ_META:
+ {
+ ImBuf *meta_ibuf = NULL;
- if(seq->seqbase.first)
- meta_ibuf = seq_render_strip_stack(
- context, &seq->seqbase,
- seq->start + nr, 0);
+ if (seq->seqbase.first)
+ meta_ibuf = seq_render_strip_stack(
+ context, &seq->seqbase,
+ seq->start + nr, 0);
- if(meta_ibuf) {
- ibuf = meta_ibuf;
- if(ibuf && use_preprocess) {
- struct ImBuf * i = IMB_dupImBuf(ibuf);
+ if (meta_ibuf) {
+ ibuf = meta_ibuf;
+ if (ibuf && use_preprocess) {
+ ImBuf *i = IMB_dupImBuf(ibuf);
- IMB_freeImBuf(ibuf);
+ IMB_freeImBuf(ibuf);
- ibuf = i;
+ ibuf = i;
+ }
}
+
+ break;
}
- break;
- }
- case SEQ_SPEED:
- {
- ImBuf * child_ibuf = NULL;
+ case SEQ_SPEED:
+ {
+ ImBuf *child_ibuf = NULL;
- float f_cfra;
- SpeedControlVars * s = (SpeedControlVars *)seq->effectdata;
+ float f_cfra;
+ SpeedControlVars *s = (SpeedControlVars *)seq->effectdata;
- sequence_effect_speed_rebuild_map(context.scene,seq, 0);
+ sequence_effect_speed_rebuild_map(context.scene, seq, 0);
- /* weeek! */
- f_cfra = seq->start + s->frameMap[(int) nr];
+ /* weeek! */
+ f_cfra = seq->start + s->frameMap[(int)nr];
- child_ibuf = seq_render_strip(context,seq->seq1,f_cfra);
+ child_ibuf = seq_render_strip(context, seq->seq1, f_cfra);
- if (child_ibuf) {
- ibuf = child_ibuf;
- if(ibuf && use_preprocess) {
- struct ImBuf * i = IMB_dupImBuf(ibuf);
+ if (child_ibuf) {
+ ibuf = child_ibuf;
+ if (ibuf && use_preprocess) {
+ ImBuf *i = IMB_dupImBuf(ibuf);
- IMB_freeImBuf(ibuf);
+ IMB_freeImBuf(ibuf);
- ibuf = i;
+ ibuf = i;
+ }
}
+ break;
}
- break;
- }
- case SEQ_EFFECT:
- {
- ibuf = seq_render_effect_strip_impl(
- context, seq, seq->start + nr);
- break;
- }
- case SEQ_IMAGE:
- {
- StripElem * s_elem = give_stripelem(seq, cfra);
-
- if (s_elem) {
- BLI_join_dirfile(name, sizeof(name), seq->strip->dir, s_elem->name);
- BLI_path_abs(name, G.main->name);
+ case SEQ_EFFECT:
+ {
+ ibuf = seq_render_effect_strip_impl(
+ context, seq, seq->start + nr);
+ break;
}
+ case SEQ_IMAGE:
+ {
+ StripElem *s_elem = give_stripelem(seq, cfra);
- if (s_elem && (ibuf = IMB_loadiffname(name, IB_rect))) {
- /* we don't need both (speed reasons)! */
- if (ibuf->rect_float && ibuf->rect)
- imb_freerectImBuf(ibuf);
+ if (s_elem) {
+ BLI_join_dirfile(name, sizeof(name), seq->strip->dir, s_elem->name);
+ BLI_path_abs(name, G.main->name);
+ }
- /* all sequencer color is done in SRGB space, linear gives odd crossfades */
- if(ibuf->profile == IB_PROFILE_LINEAR_RGB)
- IMB_convert_profile(ibuf, IB_PROFILE_NONE);
+ if (s_elem && (ibuf = IMB_loadiffname(name, IB_rect))) {
+ /* we don't need both (speed reasons)! */
+ if (ibuf->rect_float && ibuf->rect)
+ imb_freerectImBuf(ibuf);
- copy_to_ibuf_still(context, seq, nr, ibuf);
+ /* all sequencer color is done in SRGB space, linear gives odd crossfades */
+ if (ibuf->profile == IB_PROFILE_LINEAR_RGB)
+ IMB_convert_profile(ibuf, IB_PROFILE_NONE);
- s_elem->orig_width = ibuf->x;
- s_elem->orig_height = ibuf->y;
+ copy_to_ibuf_still(context, seq, nr, ibuf);
+
+ s_elem->orig_width = ibuf->x;
+ s_elem->orig_height = ibuf->y;
+ }
+ break;
}
- break;
- }
- case SEQ_MOVIE:
- {
- seq_open_anim_file(seq);
-
- if(seq->anim) {
- IMB_anim_set_preseek(seq->anim,
- seq->anim_preseek);
-
- ibuf = IMB_anim_absolute(
- seq->anim, nr + seq->anim_startofs,
- seq->strip->proxy ?
- seq->strip->proxy->tc
- : IMB_TC_RECORD_RUN,
- seq_rendersize_to_proxysize(
- context.preview_render_size));
-
- /* we don't need both (speed reasons)! */
- if (ibuf && ibuf->rect_float && ibuf->rect)
- imb_freerectImBuf(ibuf);
- if (ibuf) {
- seq->strip->stripdata->orig_width = ibuf->x;
- seq->strip->stripdata->orig_height = ibuf->y;
+ case SEQ_MOVIE:
+ {
+ seq_open_anim_file(seq);
+
+ if (seq->anim) {
+ IMB_anim_set_preseek(seq->anim,
+ seq->anim_preseek);
+
+ ibuf = IMB_anim_absolute(
+ seq->anim, nr + seq->anim_startofs,
+ seq->strip->proxy ?
+ seq->strip->proxy->tc :
+ IMB_TC_RECORD_RUN,
+ seq_rendersize_to_proxysize(
+ context.preview_render_size));
+
+ /* we don't need both (speed reasons)! */
+ if (ibuf && ibuf->rect_float && ibuf->rect)
+ imb_freerectImBuf(ibuf);
+ if (ibuf) {
+ seq->strip->stripdata->orig_width = ibuf->x;
+ seq->strip->stripdata->orig_height = ibuf->y;
+ }
}
+ copy_to_ibuf_still(context, seq, nr, ibuf);
+ break;
}
- copy_to_ibuf_still(context, seq, nr, ibuf);
- break;
- }
- case SEQ_SCENE:
- { // scene can be NULL after deletions
- ibuf = seq_render_scene_strip_impl(context, seq, nr);
+ case SEQ_SCENE:
+ { // scene can be NULL after deletions
+ ibuf = seq_render_scene_strip(context, seq, nr);
- /* Scene strips update all animation, so we need to restore original state.*/
- BKE_animsys_evaluate_all_animation(context.bmain, context.scene, cfra);
+ /* Scene strips update all animation, so we need to restore original state.*/
+ BKE_animsys_evaluate_all_animation(context.bmain, context.scene, cfra);
- copy_to_ibuf_still(context, seq, nr, ibuf);
- break;
+ copy_to_ibuf_still(context, seq, nr, ibuf);
+ break;
+ }
+ case SEQ_MOVIECLIP:
+ {
+ ibuf = seq_render_movieclip_strip(context, seq, nr);
+
+ if (ibuf && use_preprocess) {
+ ImBuf *i = IMB_dupImBuf(ibuf);
+
+ IMB_freeImBuf(ibuf);
+
+ ibuf = i;
+ }
+
+ copy_to_ibuf_still(context, seq, nr, ibuf);
+ break;
+ }
}
- }
if (ibuf == NULL)
ibuf = IMB_allocImBuf((short)context.rectx, (short)context.recty, 32, IB_rect);
@@ -2254,7 +2345,8 @@ static ImBuf * seq_render_strip(SeqRenderData context, Sequence * seq, float cfr
use_preprocess = TRUE;
if (use_preprocess)
- ibuf = input_preprocess(context, seq, cfra, ibuf);
+ ibuf = input_preprocess(context, seq, cfra, ibuf,
+ is_proxy_image, is_preprocessed);
seq_stripelem_cache_put(context, seq, cfra, SEQ_STRIPELEM_IBUF, ibuf);
@@ -2262,15 +2354,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)
+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;
@@ -2279,7 +2371,7 @@ static int seq_must_swap_input_in_blend_mode(Sequence * seq)
return swap_input;
}
-static int seq_get_early_out_for_blend_mode(Sequence * seq)
+static int seq_get_early_out_for_blend_mode(Sequence *seq)
{
struct SeqEffectHandle sh = get_sequence_blend(seq);
float facf = seq->blend_opacity / 100.0f;
@@ -2292,20 +2384,21 @@ static int seq_get_early_out_for_blend_mode(Sequence * seq)
if (seq_must_swap_input_in_blend_mode(seq)) {
if (early_out == EARLY_USE_INPUT_2) {
return EARLY_USE_INPUT_1;
- } else if (early_out == EARLY_USE_INPUT_1) {
+ }
+ else if (early_out == EARLY_USE_INPUT_1) {
return EARLY_USE_INPUT_2;
}
}
return early_out;
}
-static ImBuf* seq_render_strip_stack(
- SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown)
+static ImBuf *seq_render_strip_stack(
+ SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown)
{
- Sequence* seq_arr[MAXSEQ+1];
+ Sequence *seq_arr[MAXSEQ + 1];
int count;
int i;
- ImBuf* out = NULL;
+ ImBuf *out = NULL;
count = get_shown_sequences(seqbasep, cfra, chanshown, (Sequence **)&seq_arr);
@@ -2314,24 +2407,24 @@ static ImBuf* seq_render_strip_stack(
}
#if 0 /* commentind since this breaks keyframing, since it resets the value on draw */
- if(scene->r.cfra != cfra) {
+ if (scene->r.cfra != cfra) {
// XXX for prefetch and overlay offset!..., very bad!!!
- AnimData *adt= BKE_animdata_from_id(&scene->id);
+ AnimData *adt = BKE_animdata_from_id(&scene->id);
BKE_animsys_evaluate_animdata(scene, &scene->id, adt, cfra, ADT_RECALC_ANIM);
}
#endif
out = seq_stripelem_cache_get(context, seq_arr[count - 1],
- cfra, SEQ_STRIPELEM_IBUF_COMP);
+ cfra, SEQ_STRIPELEM_IBUF_COMP);
if (out) {
return out;
}
- if(count == 1) {
+ if (count == 1) {
out = seq_render_strip(context, seq_arr[0], cfra);
seq_stripelem_cache_put(context, seq_arr[0], cfra,
- SEQ_STRIPELEM_IBUF_COMP, out);
+ SEQ_STRIPELEM_IBUF_COMP, out);
return out;
}
@@ -2342,7 +2435,7 @@ static ImBuf* seq_render_strip_stack(
Sequence *seq = seq_arr[i];
out = seq_stripelem_cache_get(
- context, seq, cfra, SEQ_STRIPELEM_IBUF_COMP);
+ context, seq, cfra, SEQ_STRIPELEM_IBUF_COMP);
if (out) {
break;
@@ -2355,21 +2448,21 @@ static ImBuf* seq_render_strip_stack(
early_out = seq_get_early_out_for_blend_mode(seq);
switch (early_out) {
- case EARLY_NO_INPUT:
- case EARLY_USE_INPUT_2:
- out = seq_render_strip(context, seq, cfra);
- break;
- case EARLY_USE_INPUT_1:
- if (i == 0) {
- out = IMB_allocImBuf((short)context.rectx, (short)context.recty, 32, IB_rect);
- }
- break;
- case EARLY_DO_EFFECT:
- if (i == 0) {
+ case EARLY_NO_INPUT:
+ case EARLY_USE_INPUT_2:
out = seq_render_strip(context, seq, cfra);
- }
+ break;
+ case EARLY_USE_INPUT_1:
+ if (i == 0) {
+ out = IMB_allocImBuf((short)context.rectx, (short)context.recty, 32, IB_rect);
+ }
+ break;
+ case EARLY_DO_EFFECT:
+ if (i == 0) {
+ out = seq_render_strip(context, seq, cfra);
+ }
- break;
+ break;
}
if (out) {
break;
@@ -2377,30 +2470,31 @@ static ImBuf* seq_render_strip_stack(
}
seq_stripelem_cache_put(context, seq_arr[i], cfra,
- SEQ_STRIPELEM_IBUF_COMP, out);
+ SEQ_STRIPELEM_IBUF_COMP, out);
i++;
for (; i < count; i++) {
- Sequence * seq = seq_arr[i];
+ Sequence *seq = seq_arr[i];
if (seq_get_early_out_for_blend_mode(seq) == EARLY_DO_EFFECT) {
struct SeqEffectHandle sh = get_sequence_blend(seq);
- ImBuf * ibuf1 = out;
- ImBuf * ibuf2 = seq_render_strip(context, seq, cfra);
+ ImBuf *ibuf1 = out;
+ ImBuf *ibuf2 = seq_render_strip(context, seq, cfra);
float facf = seq->blend_opacity / 100.0f;
int swap_input = seq_must_swap_input_in_blend_mode(seq);
if (swap_input) {
out = sh.execute(context, seq, cfra,
- facf, facf,
- ibuf2, ibuf1, NULL);
- } else {
+ facf, facf,
+ ibuf2, ibuf1, NULL);
+ }
+ else {
out = sh.execute(context, seq, cfra,
- facf, facf,
- ibuf1, ibuf2, NULL);
+ facf, facf,
+ ibuf1, ibuf2, NULL);
}
IMB_freeImBuf(ibuf1);
@@ -2408,7 +2502,7 @@ static ImBuf* seq_render_strip_stack(
}
seq_stripelem_cache_put(context, seq_arr[i], cfra,
- SEQ_STRIPELEM_IBUF_COMP, out);
+ SEQ_STRIPELEM_IBUF_COMP, out);
}
return out;
@@ -2421,18 +2515,19 @@ static ImBuf* seq_render_strip_stack(
ImBuf *give_ibuf_seq(SeqRenderData context, float cfra, int chanshown)
{
- Editing *ed= seq_give_editing(context.scene, FALSE);
+ Editing *ed = seq_give_editing(context.scene, FALSE);
int count;
ListBase *seqbasep;
- if(ed==NULL) return NULL;
+ if (ed == NULL) return NULL;
count = BLI_countlist(&ed->metastack);
- if((chanshown < 0) && (count > 0)) {
+ if ((chanshown < 0) && (count > 0)) {
count = MAX2(count + chanshown, 0);
- seqbasep= ((MetaStack*)BLI_findlink(&ed->metastack, count))->oldbasep;
- } else {
- seqbasep= ed->seqbasep;
+ seqbasep = ((MetaStack *)BLI_findlink(&ed->metastack, count))->oldbasep;
+ }
+ else {
+ seqbasep = ed->seqbasep;
}
return seq_render_strip_stack(context, seqbasep, cfra, chanshown);
@@ -2455,7 +2550,8 @@ static int seq_can_blend(Sequence *seq)
{
if (ELEM4(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE)) {
return 1;
- } else {
+ }
+ else {
return 0;
}
}
@@ -2469,13 +2565,13 @@ static ListBase prefetch_done;
static pthread_mutex_t queue_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t wakeup_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t wakeup_cond = PTHREAD_COND_INITIALIZER;
+static pthread_cond_t wakeup_cond = PTHREAD_COND_INITIALIZER;
//static pthread_mutex_t prefetch_ready_lock = PTHREAD_MUTEX_INITIALIZER;
//static pthread_cond_t prefetch_ready_cond = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t frame_done_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t frame_done_cond = PTHREAD_COND_INITIALIZER;
+static pthread_cond_t frame_done_cond = PTHREAD_COND_INITIALIZER;
static volatile int seq_thread_shutdown = TRUE;
static volatile int seq_last_given_monoton_cfra = 0;
@@ -2502,13 +2598,13 @@ typedef struct PrefetchQueueElem {
int monoton_cfra;
- struct ImBuf * ibuf;
+ ImBuf *ibuf;
} PrefetchQueueElem;
#if 0
-static void *seq_prefetch_thread(void * This_)
+static void *seq_prefetch_thread(void *This_)
{
- PrefetchThread * This = This_;
+ PrefetchThread *This = This_;
while (!seq_thread_shutdown) {
PrefetchQueueElem *e;
@@ -2545,8 +2641,8 @@ static void *seq_prefetch_thread(void * This_)
if (e->cfra >= s_last) {
e->ibuf = give_ibuf_seq_impl(This->scene,
- e->rectx, e->recty, e->cfra, e->chanshown,
- e->preview_render_size);
+ e->rectx, e->recty, e->cfra, e->chanshown,
+ e->preview_render_size);
}
pthread_mutex_lock(&queue_lock);
@@ -2592,13 +2688,13 @@ static void seq_start_threads(Scene *scene)
(but we code, in the hope, that we can remove this restriction
soon...)
- */
+ */
fprintf(stderr, "SEQ-THREAD: seq_start_threads\n");
for (i = 0; i < 1; i++) {
PrefetchThread *t = MEM_callocN(sizeof(PrefetchThread), "prefetch_thread");
- t->scene= scene;
+ t->scene = scene;
t->running = TRUE;
BLI_addtail(&running_threads, t);
@@ -2628,7 +2724,7 @@ static void seq_stop_threads()
pthread_cond_broadcast(&wakeup_cond);
pthread_mutex_unlock(&wakeup_lock);
- for(tslot = running_threads.first; tslot; tslot= tslot->next) {
+ for (tslot = running_threads.first; tslot; tslot = tslot->next) {
pthread_join(tslot->pthread, NULL);
}
@@ -2687,8 +2783,8 @@ static void seq_wait_for_prefetch_ready()
pthread_mutex_lock(&prefetch_ready_lock);
- for(;;) {
- for(tslot = running_threads.first; tslot; tslot= tslot->next) {
+ for (;; ) {
+ for (tslot = running_threads.first; tslot; tslot = tslot->next) {
if (tslot->running) {
break;
}
@@ -2720,10 +2816,11 @@ ImBuf *give_ibuf_seq_threaded(SeqRenderData context, float cfra, int chanshown)
for (e = prefetch_done.first; e; e = e->next) {
if (cfra == e->cfra &&
- chanshown == e->chanshown &&
- context.rectx == e->rectx &&
- context.recty == e->recty &&
- context.preview_render_size == e->preview_render_size) {
+ chanshown == e->chanshown &&
+ context.rectx == e->rectx &&
+ context.recty == e->recty &&
+ context.preview_render_size == e->preview_render_size)
+ {
success = TRUE;
found_something = TRUE;
break;
@@ -2733,10 +2830,11 @@ ImBuf *give_ibuf_seq_threaded(SeqRenderData context, float cfra, int chanshown)
if (!e) {
for (e = prefetch_wait.first; e; e = e->next) {
if (cfra == e->cfra &&
- chanshown == e->chanshown &&
- context.rectx == e->rectx &&
- context.recty == e->recty &&
- context.preview_render_size == e->preview_render_size) {
+ chanshown == e->chanshown &&
+ context.rectx == e->rectx &&
+ context.recty == e->recty &&
+ context.preview_render_size == e->preview_render_size)
+ {
found_something = TRUE;
break;
}
@@ -2748,14 +2846,14 @@ ImBuf *give_ibuf_seq_threaded(SeqRenderData context, float cfra, int chanshown)
for (tslot = running_threads.first;
tslot;
- tslot= tslot->next)
+ tslot = tslot->next)
{
if (tslot->current &&
cfra == tslot->current->cfra &&
chanshown == tslot->current->chanshown &&
context.rectx == tslot->current->rectx &&
context.recty == tslot->current->recty &&
- context.preview_render_size== tslot->current->preview_render_size)
+ context.preview_render_size == tslot->current->preview_render_size)
{
found_something = TRUE;
break;
@@ -2776,8 +2874,8 @@ ImBuf *give_ibuf_seq_threaded(SeqRenderData context, float cfra, int chanshown)
if (!found_something) {
fprintf(stderr,
- "SEQ-THREAD: Requested frame "
- "not in queue ???\n");
+ "SEQ-THREAD: Requested frame "
+ "not in queue ???\n");
break;
}
pthread_mutex_lock(&frame_done_lock);
@@ -2793,34 +2891,34 @@ ImBuf *give_ibuf_seq_threaded(SeqRenderData context, float cfra, int chanshown)
static void free_anim_seq(Sequence *seq)
{
- if(seq->anim) {
+ if (seq->anim) {
IMB_free_anim(seq->anim);
seq->anim = NULL;
}
}
-void free_imbuf_seq(Scene *scene, ListBase * seqbase, int check_mem_usage,
- int keep_file_handles)
+void free_imbuf_seq(Scene *scene, ListBase *seqbase, int check_mem_usage,
+ int keep_file_handles)
{
Sequence *seq;
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;
uintptr_t max;
- mem_in_use= MEM_get_memory_in_use();
- mmap_in_use= MEM_get_mapped_memory_in_use();
+ mem_in_use = MEM_get_memory_in_use();
+ mmap_in_use = MEM_get_mapped_memory_in_use();
max = MEM_CacheLimiter_get_maximum();
if (max == 0 || mem_in_use + mmap_in_use <= max) {
@@ -2830,18 +2928,18 @@ void free_imbuf_seq(Scene *scene, ListBase * seqbase, int check_mem_usage,
seq_stripelem_cache_cleanup();
- for(seq= seqbase->first; seq; seq= seq->next) {
- if(seq->strip) {
- if(seq->type==SEQ_MOVIE && !keep_file_handles)
+ for (seq = seqbase->first; seq; seq = seq->next) {
+ if (seq->strip) {
+ if (seq->type == SEQ_MOVIE && !keep_file_handles)
free_anim_seq(seq);
- if(seq->type==SEQ_SPEED) {
+ if (seq->type == SEQ_SPEED) {
sequence_effect_speed_rebuild_map(scene, seq, 1);
}
}
- if(seq->type==SEQ_META) {
+ if (seq->type == SEQ_META) {
free_imbuf_seq(scene, &seq->seqbase, FALSE, keep_file_handles);
}
- if(seq->type==SEQ_SCENE) {
+ if (seq->type == SEQ_SCENE) {
/* FIXME: recurs downwards,
but do recurs protection somehow! */
}
@@ -2856,36 +2954,36 @@ static int update_changed_seq_recurs(Scene *scene, Sequence *seq, Sequence *chan
/* recurs downwards to see if this seq depends on the changed seq */
- if(seq == NULL)
+ if (seq == NULL)
return 0;
- if(seq == changed_seq)
+ if (seq == changed_seq)
free_imbuf = 1;
- for(subseq=seq->seqbase.first; subseq; subseq=subseq->next)
- if(update_changed_seq_recurs(scene, subseq, changed_seq, len_change, ibuf_change))
+ for (subseq = seq->seqbase.first; subseq; subseq = subseq->next)
+ if (update_changed_seq_recurs(scene, subseq, changed_seq, len_change, ibuf_change))
free_imbuf = TRUE;
- if(seq->seq1)
- if(update_changed_seq_recurs(scene, seq->seq1, changed_seq, len_change, ibuf_change))
+ if (seq->seq1)
+ if (update_changed_seq_recurs(scene, seq->seq1, changed_seq, len_change, ibuf_change))
free_imbuf = TRUE;
- if(seq->seq2 && (seq->seq2 != seq->seq1))
- if(update_changed_seq_recurs(scene, seq->seq2, changed_seq, len_change, ibuf_change))
+ if (seq->seq2 && (seq->seq2 != seq->seq1))
+ if (update_changed_seq_recurs(scene, seq->seq2, changed_seq, len_change, ibuf_change))
free_imbuf = TRUE;
- if(seq->seq3 && (seq->seq3 != seq->seq1) && (seq->seq3 != seq->seq2))
- if(update_changed_seq_recurs(scene, seq->seq3, changed_seq, len_change, ibuf_change))
+ if (seq->seq3 && (seq->seq3 != seq->seq1) && (seq->seq3 != seq->seq2))
+ if (update_changed_seq_recurs(scene, seq->seq3, changed_seq, len_change, ibuf_change))
free_imbuf = TRUE;
- if(free_imbuf) {
- if(ibuf_change) {
- if(seq->type == SEQ_MOVIE)
+ if (free_imbuf) {
+ if (ibuf_change) {
+ if (seq->type == SEQ_MOVIE)
free_anim_seq(seq);
- if(seq->type == SEQ_SPEED) {
+ if (seq->type == SEQ_SPEED) {
sequence_effect_speed_rebuild_map(scene, seq, 1);
}
}
- if(len_change)
+ if (len_change)
calc_sequence(scene, seq);
}
@@ -2894,36 +2992,37 @@ static int update_changed_seq_recurs(Scene *scene, Sequence *seq, Sequence *chan
void update_changed_seq_and_deps(Scene *scene, Sequence *changed_seq, int len_change, int ibuf_change)
{
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
- if (ed==NULL) return;
+ if (ed == NULL) return;
- for (seq=ed->seqbase.first; seq; seq=seq->next)
+ for (seq = ed->seqbase.first; seq; seq = seq->next)
update_changed_seq_recurs(scene, seq, changed_seq, len_change, ibuf_change);
}
/* 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;
}
int seq_tx_get_end(Sequence *seq)
{
- return seq->start+seq->len;
+ return seq->start + seq->len;
}
int seq_tx_get_final_left(Sequence *seq, int metaclip)
{
if (metaclip && seq->tmp) {
/* return the range clipped by the parents range */
- return MAX2( seq_tx_get_final_left(seq, 0), seq_tx_get_final_left((Sequence *)seq->tmp, 1) );
- } else {
+ return MAX2(seq_tx_get_final_left(seq, 0), seq_tx_get_final_left((Sequence *)seq->tmp, 1) );
+ }
+ else {
return (seq->start - seq->startstill) + seq->startofs;
}
@@ -2932,9 +3031,10 @@ int seq_tx_get_final_right(Sequence *seq, int metaclip)
{
if (metaclip && seq->tmp) {
/* return the range clipped by the parents range */
- return MIN2( seq_tx_get_final_right(seq, 0), seq_tx_get_final_right((Sequence *)seq->tmp, 1) );
- } else {
- return ((seq->start+seq->len) + seq->endstill) - seq->endofs;
+ return MIN2(seq_tx_get_final_right(seq, 0), seq_tx_get_final_right((Sequence *)seq->tmp, 1) );
+ }
+ else {
+ return ((seq->start + seq->len) + seq->endstill) - seq->endofs;
}
}
@@ -2943,7 +3043,8 @@ void seq_tx_set_final_left(Sequence *seq, int val)
if (val < (seq)->start) {
seq->startstill = abs(val - (seq)->start);
seq->startofs = 0;
- } else {
+ }
+ else {
seq->startofs = abs(val - (seq)->start);
seq->startstill = 0;
}
@@ -2954,20 +3055,21 @@ void seq_tx_set_final_right(Sequence *seq, int val)
if (val > (seq)->start + (seq)->len) {
seq->endstill = abs(val - (seq->start + (seq)->len));
seq->endofs = 0;
- } else {
+ }
+ else {
seq->endofs = abs(val - ((seq)->start + (seq)->len));
seq->endstill = 0;
}
}
/* 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 && (
- seq->type == SEQ_IMAGE
- || ((seq->type & SEQ_EFFECT) &&
- get_sequence_effect_num_inputs(seq->type) == 0)));
+ return (seq->len == 1 && (
+ seq->type == SEQ_IMAGE
+ || ((seq->type & SEQ_EFFECT) &&
+ get_sequence_effect_num_inputs(seq->type) == 0)));
}
/* check if the selected seq's reference unselected seq's */
@@ -2975,33 +3077,33 @@ int seqbase_isolated_sel_check(ListBase *seqbase)
{
Sequence *seq;
/* is there more than 1 select */
- int ok= FALSE;
+ int ok = FALSE;
- for(seq= seqbase->first; seq; seq= seq->next) {
- if(seq->flag & SELECT) {
- ok= TRUE;
+ for (seq = seqbase->first; seq; seq = seq->next) {
+ if (seq->flag & SELECT) {
+ ok = TRUE;
break;
}
}
- if(ok == FALSE)
+ if (ok == FALSE)
return FALSE;
/* test relationships */
- for(seq= seqbase->first; seq; seq= seq->next) {
- if((seq->type & SEQ_EFFECT)==0)
+ for (seq = seqbase->first; seq; seq = seq->next) {
+ if ((seq->type & SEQ_EFFECT) == 0)
continue;
- if(seq->flag & SELECT) {
- if( (seq->seq1 && (seq->seq1->flag & SELECT)==0) ||
- (seq->seq2 && (seq->seq2->flag & SELECT)==0) ||
- (seq->seq3 && (seq->seq3->flag & SELECT)==0) )
+ if (seq->flag & SELECT) {
+ if ( (seq->seq1 && (seq->seq1->flag & SELECT) == 0) ||
+ (seq->seq2 && (seq->seq2->flag & SELECT) == 0) ||
+ (seq->seq3 && (seq->seq3->flag & SELECT) == 0) )
return FALSE;
}
else {
- if( (seq->seq1 && (seq->seq1->flag & SELECT)) ||
- (seq->seq2 && (seq->seq2->flag & SELECT)) ||
- (seq->seq3 && (seq->seq3->flag & SELECT)) )
+ if ( (seq->seq1 && (seq->seq1->flag & SELECT)) ||
+ (seq->seq2 && (seq->seq2->flag & SELECT)) ||
+ (seq->seq3 && (seq->seq3->flag & SELECT)) )
return FALSE;
}
}
@@ -3009,48 +3111,48 @@ int seqbase_isolated_sel_check(ListBase *seqbase)
return TRUE;
}
-/* use to impose limits when dragging/extending - so impossible situations dont happen
+/* use to impose limits when dragging/extending - so impossible situations don't happen
* Cant use the SEQ_LEFTSEL and SEQ_LEFTSEL directly because the strip may be in a metastrip */
void seq_tx_handle_xlimits(Sequence *seq, int leftflag, int rightflag)
{
- if(leftflag) {
+ if (leftflag) {
if (seq_tx_get_final_left(seq, 0) >= seq_tx_get_final_right(seq, 0)) {
- seq_tx_set_final_left(seq, seq_tx_get_final_right(seq, 0)-1);
+ seq_tx_set_final_left(seq, seq_tx_get_final_right(seq, 0) - 1);
}
- if (seq_single_check(seq)==0) {
+ if (seq_single_check(seq) == 0) {
if (seq_tx_get_final_left(seq, 0) >= seq_tx_get_end(seq)) {
- seq_tx_set_final_left(seq, seq_tx_get_end(seq)-1);
+ seq_tx_set_final_left(seq, seq_tx_get_end(seq) - 1);
}
/* 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 );
- }*/
-
+ seq_tx_set_final_left(seq, seq_tx_get_final_left(seq, 0) + ofs);
+ }
+#endif
}
}
- if(rightflag) {
+ if (rightflag) {
if (seq_tx_get_final_right(seq, 0) <= seq_tx_get_final_left(seq, 0)) {
- seq_tx_set_final_right(seq, seq_tx_get_final_left(seq, 0)+1);
+ seq_tx_set_final_right(seq, seq_tx_get_final_left(seq, 0) + 1);
}
- if (seq_single_check(seq)==0) {
+ if (seq_single_check(seq) == 0) {
if (seq_tx_get_final_right(seq, 0) <= seq_tx_get_start(seq)) {
- seq_tx_set_final_right(seq, seq_tx_get_start(seq)+1);
+ seq_tx_set_final_right(seq, seq_tx_get_start(seq) + 1);
}
}
}
/* sounds cannot be extended past their endpoints */
if (seq->type == SEQ_SOUND) {
- seq->startstill= 0;
- seq->endstill= 0;
+ seq->startstill = 0;
+ seq->endstill = 0;
}
}
@@ -3061,18 +3163,18 @@ 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) {
offset = left - start;
- seq_tx_set_final_left( seq, seq_tx_get_final_left(seq, 0) - offset );
- seq_tx_set_final_right( seq, seq_tx_get_final_right(seq, 0) - offset );
+ seq_tx_set_final_left(seq, seq_tx_get_final_left(seq, 0) - offset);
+ seq_tx_set_final_right(seq, seq_tx_get_final_right(seq, 0) - offset);
seq->start += offset;
}
}
-int seq_tx_test(Sequence * seq)
+int seq_tx_test(Sequence *seq)
{
return (seq->type < SEQ_EFFECT) || (get_sequence_effect_num_inputs(seq->type) == 0);
}
@@ -3080,19 +3182,19 @@ int seq_tx_test(Sequence * seq)
static int seq_overlap(Sequence *seq1, Sequence *seq2)
{
return (seq1 != seq2 && seq1->machine == seq2->machine &&
- ((seq1->enddisp <= seq2->startdisp) || (seq1->startdisp >= seq2->enddisp))==0);
+ ((seq1->enddisp <= seq2->startdisp) || (seq1->startdisp >= seq2->enddisp)) == 0);
}
-int seq_test_overlap(ListBase * seqbasep, Sequence *test)
+int seq_test_overlap(ListBase *seqbasep, Sequence *test)
{
Sequence *seq;
- seq= seqbasep->first;
- while(seq) {
- if(seq_overlap(test, seq))
+ seq = seqbasep->first;
+ while (seq) {
+ if (seq_overlap(test, seq))
return 1;
- seq= seq->next;
+ seq = seq->next;
}
return 0;
}
@@ -3103,9 +3205,9 @@ void seq_translate(Scene *evil_scene, Sequence *seq, int delta)
seq_offset_animdata(evil_scene, seq, delta);
seq->start += delta;
- if(seq->type==SEQ_META) {
+ if (seq->type == SEQ_META) {
Sequence *seq_child;
- for(seq_child= seq->seqbase.first; seq_child; seq_child= seq_child->next) {
+ for (seq_child = seq->seqbase.first; seq_child; seq_child = seq_child->next) {
seq_translate(evil_scene, seq_child, delta);
}
}
@@ -3115,17 +3217,17 @@ void seq_translate(Scene *evil_scene, Sequence *seq, int delta)
void seq_sound_init(Scene *scene, Sequence *seq)
{
- if(seq->type==SEQ_META) {
+ if (seq->type == SEQ_META) {
Sequence *seq_child;
- for(seq_child= seq->seqbase.first; seq_child; seq_child= seq_child->next) {
+ for (seq_child = seq->seqbase.first; seq_child; seq_child = seq_child->next) {
seq_sound_init(scene, seq_child);
}
}
else {
- if(seq->sound) {
+ if (seq->sound) {
seq->scene_sound = sound_add_scene_sound_defaults(scene, seq);
}
- if(seq->scene) {
+ if (seq->scene) {
sound_scene_add_scene_sound_defaults(scene, seq);
}
}
@@ -3133,14 +3235,14 @@ void seq_sound_init(Scene *scene, Sequence *seq)
Sequence *seq_foreground_frame_get(Scene *scene, int frame)
{
- Editing *ed= seq_give_editing(scene, FALSE);
- Sequence *seq, *best_seq=NULL;
+ Editing *ed = seq_give_editing(scene, FALSE);
+ Sequence *seq, *best_seq = NULL;
int best_machine = -1;
- if(!ed) return NULL;
+ if (!ed) return NULL;
- for (seq=ed->seqbasep->first; seq; seq= seq->next) {
- if(seq->flag & SEQ_MUTE || seq->startdisp > frame || seq->enddisp <= frame)
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if (seq->flag & SEQ_MUTE || seq->startdisp > frame || seq->enddisp <= frame)
continue;
/* only use elements you can see - not */
if (ELEM5(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE, SEQ_COLOR)) {
@@ -3154,57 +3256,58 @@ Sequence *seq_foreground_frame_get(Scene *scene, int frame)
}
/* return 0 if there werent enough space */
-int shuffle_seq(ListBase * seqbasep, Sequence *test, Scene *evil_scene)
+int shuffle_seq(ListBase *seqbasep, Sequence *test, Scene *evil_scene)
{
- int orig_machine= test->machine;
+ int orig_machine = test->machine;
test->machine++;
calc_sequence(evil_scene, test);
- while( seq_test_overlap(seqbasep, test) ) {
- if(test->machine >= MAXSEQ) {
+ while (seq_test_overlap(seqbasep, test) ) {
+ if (test->machine >= MAXSEQ) {
break;
}
test->machine++;
- calc_sequence(evil_scene, test); // XXX - I dont think this is needed since were only moving vertically, Campbell.
+ calc_sequence(evil_scene, test); // XXX - I don't think this is needed since were only moving vertically, Campbell.
}
- if(test->machine >= MAXSEQ) {
+ if (test->machine >= MAXSEQ) {
/* Blender 2.4x would remove the strip.
* nicer to move it to the end */
Sequence *seq;
- int new_frame= test->enddisp;
+ int new_frame = test->enddisp;
- for(seq= seqbasep->first; seq; seq= seq->next) {
+ for (seq = seqbasep->first; seq; seq = seq->next) {
if (seq->machine == orig_machine)
new_frame = MAX2(new_frame, seq->enddisp);
}
- test->machine= orig_machine;
- new_frame = new_frame + (test->start-test->startdisp); /* adjust by the startdisp */
+ test->machine = orig_machine;
+ new_frame = new_frame + (test->start - test->startdisp); /* adjust by the startdisp */
seq_translate(evil_scene, test, new_frame - test->start);
calc_sequence(evil_scene, test);
return 0;
- } else {
+ }
+ else {
return 1;
}
}
-static int shuffle_seq_time_offset_test(ListBase * seqbasep, char dir)
+static int shuffle_seq_time_offset_test(ListBase *seqbasep, char dir)
{
- int offset= 0;
+ int offset = 0;
Sequence *seq, *seq_other;
- for(seq= seqbasep->first; seq; seq= seq->next) {
- if(seq->tmp) {
- for(seq_other= seqbasep->first; seq_other; seq_other= seq_other->next) {
- if(!seq_other->tmp && seq_overlap(seq, seq_other)) {
- if(dir=='L') {
- offset= MIN2(offset, seq_other->startdisp - seq->enddisp);
+ for (seq = seqbasep->first; seq; seq = seq->next) {
+ if (seq->tmp) {
+ for (seq_other = seqbasep->first; seq_other; seq_other = seq_other->next) {
+ if (!seq_other->tmp && seq_overlap(seq, seq_other)) {
+ if (dir == 'L') {
+ offset = MIN2(offset, seq_other->startdisp - seq->enddisp);
}
else {
- offset= MAX2(offset, seq_other->enddisp - seq->startdisp);
+ offset = MAX2(offset, seq_other->enddisp - seq->startdisp);
}
}
}
@@ -3213,32 +3316,32 @@ static int shuffle_seq_time_offset_test(ListBase * seqbasep, char dir)
return offset;
}
-static int shuffle_seq_time_offset(Scene* scene, ListBase * seqbasep, char dir)
+static int shuffle_seq_time_offset(Scene *scene, ListBase *seqbasep, char dir)
{
- int ofs= 0;
- int tot_ofs= 0;
+ int ofs = 0;
+ int tot_ofs = 0;
Sequence *seq;
- while( (ofs= shuffle_seq_time_offset_test(seqbasep, dir)) ) {
- for(seq= seqbasep->first; seq; seq= seq->next) {
- if(seq->tmp) {
+ while ( (ofs = shuffle_seq_time_offset_test(seqbasep, dir)) ) {
+ for (seq = seqbasep->first; seq; seq = seq->next) {
+ if (seq->tmp) {
/* seq_test_overlap only tests display values */
- seq->startdisp += ofs;
- seq->enddisp += ofs;
+ seq->startdisp += ofs;
+ seq->enddisp += ofs;
}
}
- tot_ofs+= ofs;
+ tot_ofs += ofs;
}
- for(seq= seqbasep->first; seq; seq= seq->next) {
- if(seq->tmp)
- calc_sequence_disp(scene, seq); /* corrects dummy startdisp/enddisp values */
+ for (seq = seqbasep->first; seq; seq = seq->next) {
+ if (seq->tmp)
+ calc_sequence_disp(scene, seq); /* corrects dummy startdisp/enddisp values */
}
return tot_ofs;
}
-int shuffle_seq_time(ListBase * seqbasep, Scene *evil_scene)
+int shuffle_seq_time(ListBase *seqbasep, Scene *evil_scene)
{
/* note: seq->tmp is used to tag strips to move */
@@ -3246,39 +3349,39 @@ int shuffle_seq_time(ListBase * seqbasep, Scene *evil_scene)
int offset_l = shuffle_seq_time_offset(evil_scene, seqbasep, 'L');
int offset_r = shuffle_seq_time_offset(evil_scene, seqbasep, 'R');
- int offset = (-offset_l < offset_r) ? offset_l:offset_r;
+ int offset = (-offset_l < offset_r) ? offset_l : offset_r;
- if(offset) {
- for(seq= seqbasep->first; seq; seq= seq->next) {
- if(seq->tmp) {
+ if (offset) {
+ for (seq = seqbasep->first; seq; seq = seq->next) {
+ if (seq->tmp) {
seq_translate(evil_scene, seq, offset);
seq->flag &= ~SEQ_OVERLAP;
}
}
}
- return offset? 0:1;
+ return offset ? 0 : 1;
}
void seq_update_sound_bounds_all(Scene *scene)
{
Editing *ed = scene->ed;
- if(ed) {
+ if (ed) {
Sequence *seq;
- for(seq = ed->seqbase.first; seq; seq = seq->next) {
- if(seq->type == SEQ_META) {
+ for (seq = ed->seqbase.first; seq; seq = seq->next) {
+ if (seq->type == SEQ_META) {
seq_update_sound_bounds_recursive(scene, seq);
}
- else if(ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) {
+ else if (ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) {
seq_update_sound_bounds(scene, seq);
}
}
}
}
-void seq_update_sound_bounds(Scene* scene, Sequence *seq)
+void seq_update_sound_bounds(Scene *scene, Sequence *seq)
{
sound_move_scene_sound_defaults(scene, seq);
/* mute is set in seq_update_muting_recursive */
@@ -3290,20 +3393,20 @@ 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, */
- for(seq=seqbasep->first; seq; seq=seq->next) {
- seqmute= (mute || (seq->flag & SEQ_MUTE));
+ * 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 (seq->type == SEQ_META) {
/* if this is the current meta sequence, unmute because
- all sequences above this were set to mute */
- if(seq == metaseq)
- seqmute= 0;
+ * all sequences above this were set to mute */
+ if (seq == metaseq)
+ seqmute = 0;
seq_update_muting_recursive(&seq->seqbase, metaseq, seqmute);
}
- else if(ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) {
- if(seq->scene_sound) {
+ else if (ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) {
+ if (seq->scene_sound) {
sound_mute_scene_sound(seq->scene_sound, seqmute);
}
}
@@ -3312,11 +3415,11 @@ static void seq_update_muting_recursive(ListBase *seqbasep, Sequence *metaseq, i
void seq_update_muting(Editing *ed)
{
- if(ed) {
+ if (ed) {
/* mute all sounds up to current metastack list */
- MetaStack *ms= ed->metastack.last;
+ MetaStack *ms = ed->metastack.last;
- if(ms)
+ if (ms)
seq_update_muting_recursive(&ed->seqbase, ms->parseq, 1);
else
seq_update_muting_recursive(&ed->seqbase, NULL, 0);
@@ -3327,12 +3430,12 @@ static void seq_update_sound_recursive(Scene *scene, ListBase *seqbasep, bSound
{
Sequence *seq;
- for(seq=seqbasep->first; seq; seq=seq->next) {
- if(seq->type == SEQ_META) {
+ for (seq = seqbasep->first; seq; seq = seq->next) {
+ if (seq->type == SEQ_META) {
seq_update_sound_recursive(scene, &seq->seqbase, sound);
}
- else if(seq->type == SEQ_SOUND) {
- if(seq->scene_sound && sound == seq->sound) {
+ else if (seq->type == SEQ_SOUND) {
+ if (seq->scene_sound && sound == seq->sound) {
sound_update_scene_sound(seq->scene_sound, sound);
}
}
@@ -3341,7 +3444,7 @@ static void seq_update_sound_recursive(Scene *scene, ListBase *seqbasep, bSound
void seq_update_sound(struct Scene *scene, struct bSound *sound)
{
- if(scene->ed) {
+ if (scene->ed) {
seq_update_sound_recursive(scene, &scene->ed->seqbase, sound);
}
}
@@ -3350,13 +3453,13 @@ void seq_update_sound(struct Scene *scene, struct bSound *sound)
ListBase *seq_seqbase(ListBase *seqbase, Sequence *seq)
{
Sequence *iseq;
- ListBase *lb= NULL;
+ ListBase *lb = NULL;
- for(iseq= seqbase->first; iseq; iseq= iseq->next) {
- if(seq==iseq) {
+ for (iseq = seqbase->first; iseq; iseq = iseq->next) {
+ if (seq == iseq) {
return seqbase;
}
- else if(iseq->seqbase.first && (lb= seq_seqbase(&iseq->seqbase, seq))) {
+ else if (iseq->seqbase.first && (lb = seq_seqbase(&iseq->seqbase, seq))) {
return lb;
}
}
@@ -3364,17 +3467,18 @@ ListBase *seq_seqbase(ListBase *seqbase, Sequence *seq)
return NULL;
}
-Sequence *seq_metastrip(ListBase * seqbase, Sequence * meta, Sequence *seq)
+Sequence *seq_metastrip(ListBase *seqbase, Sequence *meta, Sequence *seq)
{
- Sequence * iseq;
+ Sequence *iseq;
- for(iseq = seqbase->first; iseq; iseq = iseq->next) {
- Sequence * rval;
+ for (iseq = seqbase->first; iseq; iseq = iseq->next) {
+ Sequence *rval;
if (seq == iseq) {
return meta;
- } else if(iseq->seqbase.first &&
- (rval = seq_metastrip(&iseq->seqbase, iseq, seq))) {
+ }
+ else if (iseq->seqbase.first &&
+ (rval = seq_metastrip(&iseq->seqbase, iseq, seq))) {
return rval;
}
}
@@ -3386,27 +3490,27 @@ int seq_swap(Sequence *seq_a, Sequence *seq_b, const char **error_str)
{
char name[sizeof(seq_a->name)];
- if(seq_a->len != seq_b->len) {
- *error_str= "Strips must be the same length";
+ if (seq_a->len != seq_b->len) {
+ *error_str = "Strips must be the same length";
return 0;
}
/* type checking, could be more advanced but disalow sound vs non-sound copy */
- if(seq_a->type != seq_b->type) {
- if(seq_a->type == SEQ_SOUND || seq_b->type == SEQ_SOUND) {
- *error_str= "Strips were not compatible";
+ if (seq_a->type != seq_b->type) {
+ if (seq_a->type == SEQ_SOUND || seq_b->type == SEQ_SOUND) {
+ *error_str = "Strips were not compatible";
return 0;
}
/* disallow effects to swap with non-effects strips */
- if((seq_a->type & SEQ_EFFECT) != (seq_b->type & SEQ_EFFECT)) {
- *error_str= "Strips were not compatible";
+ if ((seq_a->type & SEQ_EFFECT) != (seq_b->type & SEQ_EFFECT)) {
+ *error_str = "Strips were not compatible";
return 0;
}
- if((seq_a->type & SEQ_EFFECT) && (seq_b->type & SEQ_EFFECT)) {
- if(get_sequence_effect_num_inputs(seq_a->type) != get_sequence_effect_num_inputs(seq_b->type)) {
- *error_str= "Strips must have the same number of inputs";
+ if ((seq_a->type & SEQ_EFFECT) && (seq_b->type & SEQ_EFFECT)) {
+ if (get_sequence_effect_num_inputs(seq_a->type) != get_sequence_effect_num_inputs(seq_b->type)) {
+ *error_str = "Strips must have the same number of inputs";
return 0;
}
}
@@ -3414,10 +3518,10 @@ int seq_swap(Sequence *seq_a, Sequence *seq_b, const char **error_str)
SWAP(Sequence, *seq_a, *seq_b);
- /* swap back names so animation fcurves dont get swapped */
- BLI_strncpy(name, seq_a->name+2, sizeof(name));
- BLI_strncpy(seq_a->name+2, seq_b->name+2, sizeof(seq_b->name)-2);
- BLI_strncpy(seq_b->name+2, name, sizeof(seq_b->name)-2);
+ /* swap back names so animation fcurves don't get swapped */
+ BLI_strncpy(name, seq_a->name + 2, sizeof(name));
+ BLI_strncpy(seq_a->name + 2, seq_b->name + 2, sizeof(seq_b->name) - 2);
+ BLI_strncpy(seq_b->name + 2, name, sizeof(seq_b->name) - 2);
/* swap back opacity, and overlay mode */
SWAP(int, seq_a->blend_mode, seq_b->blend_mode);
@@ -3441,19 +3545,19 @@ int seq_swap(Sequence *seq_a, Sequence *seq_b, const char **error_str)
/* XXX - hackish function needed for transforming strips! TODO - have some better solution */
void seq_offset_animdata(Scene *scene, Sequence *seq, int ofs)
{
- char str[SEQ_NAME_MAXSTR+3];
+ char str[SEQ_NAME_MAXSTR + 3];
FCurve *fcu;
- if(scene->adt==NULL || ofs==0 || scene->adt->action==NULL)
+ if (scene->adt == NULL || ofs == 0 || scene->adt->action == NULL)
return;
- BLI_snprintf(str, sizeof(str), "[\"%s\"]", seq->name+2);
+ BLI_snprintf(str, sizeof(str), "[\"%s\"]", seq->name + 2);
- for (fcu= scene->adt->action->curves.first; fcu; fcu= fcu->next) {
- if(strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str)) {
+ for (fcu = scene->adt->action->curves.first; fcu; fcu = fcu->next) {
+ if (strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str)) {
unsigned int i;
for (i = 0; i < fcu->totvert; i++) {
- BezTriple *bezt= &fcu->bezt[i];
+ BezTriple *bezt = &fcu->bezt[i];
bezt->vec[0][0] += ofs;
bezt->vec[1][0] += ofs;
bezt->vec[2][0] += ofs;
@@ -3464,28 +3568,28 @@ void seq_offset_animdata(Scene *scene, Sequence *seq, int ofs)
void seq_dupe_animdata(Scene *scene, const char *name_src, const char *name_dst)
{
- char str_from[SEQ_NAME_MAXSTR+3];
+ char str_from[SEQ_NAME_MAXSTR + 3];
FCurve *fcu;
FCurve *fcu_last;
FCurve *fcu_cpy;
- ListBase lb= {NULL, NULL};
+ ListBase lb = {NULL, NULL};
- if(scene->adt==NULL || scene->adt->action==NULL)
+ if (scene->adt == NULL || scene->adt->action == NULL)
return;
BLI_snprintf(str_from, sizeof(str_from), "[\"%s\"]", name_src);
- fcu_last= scene->adt->action->curves.last;
+ fcu_last = scene->adt->action->curves.last;
- for (fcu= scene->adt->action->curves.first; fcu && fcu->prev != fcu_last; fcu= fcu->next) {
- if(strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str_from)) {
- fcu_cpy= copy_fcurve(fcu);
+ for (fcu = scene->adt->action->curves.first; fcu && fcu->prev != fcu_last; fcu = fcu->next) {
+ if (strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str_from)) {
+ fcu_cpy = copy_fcurve(fcu);
BLI_addtail(&lb, fcu_cpy);
}
}
/* notice validate is 0, keep this because the seq may not be added to the scene yet */
- BKE_animdata_fix_paths_rename(&scene->id, scene->adt, "sequence_editor.sequences_all", name_src, name_dst, 0, 0, 0);
+ BKE_animdata_fix_paths_rename(&scene->id, scene->adt, NULL, "sequence_editor.sequences_all", name_src, name_dst, 0, 0, 0);
/* add the original fcurves back */
BLI_movelisttolist(&scene->adt->action->curves, &lb);
@@ -3494,25 +3598,26 @@ void seq_dupe_animdata(Scene *scene, const char *name_src, const char *name_dst)
/* XXX - hackish function needed to remove all fcurves belonging to a sequencer strip */
static void seq_free_animdata(Scene *scene, Sequence *seq)
{
- char str[SEQ_NAME_MAXSTR+3];
+ char str[SEQ_NAME_MAXSTR + 3];
FCurve *fcu;
- if(scene->adt==NULL || scene->adt->action==NULL)
+ if (scene->adt == NULL || scene->adt->action == NULL)
return;
- BLI_snprintf(str, sizeof(str), "[\"%s\"]", seq->name+2);
+ BLI_snprintf(str, sizeof(str), "[\"%s\"]", seq->name + 2);
- fcu= scene->adt->action->curves.first;
+ fcu = scene->adt->action->curves.first;
while (fcu) {
- if(strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str)) {
+ if (strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str)) {
FCurve *next_fcu = fcu->next;
BLI_remlink(&scene->adt->action->curves, fcu);
free_fcurve(fcu);
fcu = next_fcu;
- } else {
+ }
+ else {
fcu = fcu->next;
}
}
@@ -3521,13 +3626,13 @@ static void seq_free_animdata(Scene *scene, Sequence *seq)
Sequence *get_seq_by_name(ListBase *seqbase, const char *name, int recursive)
{
- Sequence *iseq=NULL;
- Sequence *rseq=NULL;
+ Sequence *iseq = NULL;
+ Sequence *rseq = NULL;
- for (iseq=seqbase->first; iseq; iseq=iseq->next) {
- if (strcmp(name, iseq->name+2) == 0)
+ for (iseq = seqbase->first; iseq; iseq = iseq->next) {
+ if (strcmp(name, iseq->name + 2) == 0)
return iseq;
- else if(recursive && (iseq->seqbase.first) && (rseq=get_seq_by_name(&iseq->seqbase, name, 1))) {
+ else if (recursive && (iseq->seqbase.first) && (rseq = get_seq_by_name(&iseq->seqbase, name, 1))) {
return rseq;
}
}
@@ -3538,40 +3643,40 @@ Sequence *get_seq_by_name(ListBase *seqbase, const char *name, int recursive)
Sequence *seq_active_get(Scene *scene)
{
- Editing *ed= seq_give_editing(scene, FALSE);
- if(ed==NULL) return NULL;
+ Editing *ed = seq_give_editing(scene, FALSE);
+ if (ed == NULL) return NULL;
return ed->act_seq;
}
void seq_active_set(Scene *scene, Sequence *seq)
{
- Editing *ed= seq_give_editing(scene, FALSE);
- if(ed==NULL) return;
+ Editing *ed = seq_give_editing(scene, FALSE);
+ if (ed == NULL) return;
- ed->act_seq= seq;
+ ed->act_seq = seq;
}
int seq_active_pair_get(Scene *scene, Sequence **seq_act, Sequence **seq_other)
{
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
- *seq_act= seq_active_get(scene);
+ *seq_act = seq_active_get(scene);
- if(*seq_act == NULL) {
+ if (*seq_act == NULL) {
return 0;
}
else {
Sequence *seq;
- *seq_other= NULL;
+ *seq_other = NULL;
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- if(seq->flag & SELECT && (seq != (*seq_act))) {
- if(*seq_other) {
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if (seq->flag & SELECT && (seq != (*seq_act))) {
+ if (*seq_other) {
return 0;
}
else {
- *seq_other= seq;
+ *seq_other = seq;
}
}
}
@@ -3584,21 +3689,21 @@ int seq_active_pair_get(Scene *scene, Sequence **seq_act, Sequence **seq_other)
void seq_load_apply(Scene *scene, Sequence *seq, SeqLoadInfo *seq_load)
{
- if(seq) {
- BLI_strncpy(seq->name+2, seq_load->name, sizeof(seq->name)-2);
+ if (seq) {
+ BLI_strncpy(seq->name + 2, seq_load->name, sizeof(seq->name) - 2);
seqbase_unique_name_recursive(&scene->ed->seqbase, seq);
- if(seq_load->flag & SEQ_LOAD_FRAME_ADVANCE) {
+ if (seq_load->flag & SEQ_LOAD_FRAME_ADVANCE) {
seq_load->start_frame += (seq->enddisp - seq->startdisp);
}
- if(seq_load->flag & SEQ_LOAD_REPLACE_SEL) {
+ if (seq_load->flag & SEQ_LOAD_REPLACE_SEL) {
seq_load->flag |= SELECT;
seq_active_set(scene, seq);
}
- if(seq_load->flag & SEQ_LOAD_SOUND_CACHE) {
- if(seq->sound)
+ if (seq_load->flag & SEQ_LOAD_SOUND_CACHE) {
+ if (seq->sound)
sound_cache(seq->sound);
}
@@ -3613,17 +3718,17 @@ Sequence *alloc_sequence(ListBase *lb, int cfra, int machine)
{
Sequence *seq;
- seq= MEM_callocN( sizeof(Sequence), "addseq");
+ seq = MEM_callocN(sizeof(Sequence), "addseq");
BLI_addtail(lb, seq);
- *( (short *)seq->name )= ID_SEQ;
- seq->name[2]= 0;
+ *( (short *)seq->name) = ID_SEQ;
+ seq->name[2] = 0;
- seq->flag= SELECT;
- seq->start= cfra;
- seq->machine= machine;
- seq->sat= 1.0;
- seq->mul= 1.0;
+ seq->flag = SELECT;
+ seq->start = cfra;
+ seq->machine = machine;
+ seq->sat = 1.0;
+ seq->mul = 1.0;
seq->blend_opacity = 100.0;
seq->volume = 1.0f;
seq->pitch = 1.0f;
@@ -3635,20 +3740,20 @@ Sequence *alloc_sequence(ListBase *lb, int cfra, int machine)
/* NOTE: this function doesn't fill in image names */
Sequence *sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
{
- Scene *scene= CTX_data_scene(C); /* only for active seq */
+ Scene *scene = CTX_data_scene(C); /* only for active seq */
Sequence *seq;
Strip *strip;
seq = alloc_sequence(seqbasep, seq_load->start_frame, seq_load->channel);
- seq->type= SEQ_IMAGE;
- seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */
+ seq->type = SEQ_IMAGE;
+ seq->blend_mode = SEQ_CROSS; /* so alpha adjustment fade to the strip below */
/* basic defaults */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
+ seq->strip = strip = MEM_callocN(sizeof(Strip), "strip");
- strip->len = seq->len = seq_load->len ? seq_load->len : 1;
- strip->us= 1;
- strip->stripdata= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
+ seq->len = seq_load->len ? seq_load->len : 1;
+ strip->us = 1;
+ strip->stripdata = MEM_callocN(seq->len * sizeof(StripElem), "stripelem");
BLI_strncpy(strip->dir, seq_load->path, sizeof(strip->dir));
seq_load_apply(scene, seq, seq_load);
@@ -3659,12 +3764,12 @@ Sequence *sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
#ifdef WITH_AUDASPACE
Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C); /* only for sound */
- Editing *ed= seq_give_editing(scene, TRUE);
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C); /* only for sound */
+ Editing *ed = seq_give_editing(scene, TRUE);
bSound *sound;
- Sequence *seq; /* generic strip vars */
+ Sequence *seq; /* generic strip vars */
Strip *strip;
StripElem *se;
@@ -3672,7 +3777,7 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
sound = sound_new_file(CTX_data_main(C), seq_load->path); /* handles relative paths */
- if (sound==NULL || sound->playback_handle == NULL) {
+ if (sound == NULL || sound->playback_handle == NULL) {
//if(op)
// BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
return NULL;
@@ -3689,22 +3794,22 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
seq = alloc_sequence(seqbasep, seq_load->start_frame, seq_load->channel);
- seq->type= SEQ_SOUND;
- seq->sound= sound;
- BLI_strncpy(seq->name+2, "Sound", SEQ_NAME_MAXSTR-2);
+ seq->type = SEQ_SOUND;
+ seq->sound = sound;
+ BLI_strncpy(seq->name + 2, "Sound", SEQ_NAME_MAXSTR - 2);
seqbase_unique_name_recursive(&scene->ed->seqbase, seq);
/* basic defaults */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len = seq->len = ceil(info.length * FPS);
- strip->us= 1;
+ seq->strip = strip = MEM_callocN(sizeof(Strip), "strip");
+ seq->len = ceil(info.length * FPS);
+ strip->us = 1;
/* we only need 1 element to store the filename */
- strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
+ strip->stripdata = se = MEM_callocN(sizeof(StripElem), "stripelem");
BLI_split_dirfile(seq_load->path, strip->dir, se->name, sizeof(strip->dir), sizeof(se->name));
- seq->scene_sound = sound_add_scene_sound(scene, seq, seq_load->start_frame, seq_load->start_frame + strip->len, 0);
+ seq->scene_sound = sound_add_scene_sound(scene, seq, seq_load->start_frame, seq_load->start_frame + seq->len, 0);
calc_sequence_disp(scene, seq);
@@ -3727,10 +3832,10 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
{
- Scene *scene= CTX_data_scene(C); /* only for sound */
+ Scene *scene = CTX_data_scene(C); /* only for sound */
char path[sizeof(seq_load->path)];
- Sequence *seq; /* generic strip vars */
+ Sequence *seq; /* generic strip vars */
Strip *strip;
StripElem *se;
@@ -3741,42 +3846,42 @@ Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
an = openanim(path, IB_rect, 0);
- if(an==NULL)
+ if (an == NULL)
return NULL;
seq = alloc_sequence(seqbasep, seq_load->start_frame, seq_load->channel);
- seq->type= SEQ_MOVIE;
- seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */
+ seq->type = SEQ_MOVIE;
+ seq->blend_mode = SEQ_CROSS; /* so alpha adjustment fade to the strip below */
- seq->anim= an;
+ seq->anim = an;
seq->anim_preseek = IMB_anim_get_preseek(an);
- BLI_strncpy(seq->name+2, "Movie", SEQ_NAME_MAXSTR-2);
+ BLI_strncpy(seq->name + 2, "Movie", SEQ_NAME_MAXSTR - 2);
seqbase_unique_name_recursive(&scene->ed->seqbase, seq);
/* basic defaults */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len = seq->len = IMB_anim_get_duration( an, IMB_TC_RECORD_RUN );
- strip->us= 1;
+ seq->strip = strip = MEM_callocN(sizeof(Strip), "strip");
+ seq->len = IMB_anim_get_duration(an, IMB_TC_RECORD_RUN);
+ strip->us = 1;
/* we only need 1 element for MOVIE strips */
- strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
+ strip->stripdata = se = MEM_callocN(sizeof(StripElem), "stripelem");
BLI_split_dirfile(seq_load->path, strip->dir, se->name, sizeof(strip->dir), sizeof(se->name));
calc_sequence_disp(scene, seq);
- if(seq_load->flag & SEQ_LOAD_MOVIE_SOUND) {
- int start_frame_back= seq_load->start_frame;
+ if (seq_load->flag & SEQ_LOAD_MOVIE_SOUND) {
+ int start_frame_back = seq_load->start_frame;
seq_load->channel++;
sequencer_add_sound_strip(C, seqbasep, seq_load);
- seq_load->start_frame= start_frame_back;
+ seq_load->start_frame = start_frame_back;
seq_load->channel--;
}
- if(seq_load->name[0] == '\0')
+ if (seq_load->name[0] == '\0')
BLI_strncpy(seq_load->name, se->name, sizeof(seq_load->name));
/* can be NULL */
@@ -3788,11 +3893,11 @@ Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
static Sequence *seq_dupli(struct Scene *scene, struct Scene *scene_to, Sequence *seq, int dupe_flag)
{
- Scene *sce_audio= scene_to ? scene_to : scene;
+ Scene *sce_audio = scene_to ? scene_to : scene;
Sequence *seqn = MEM_dupallocN(seq);
seq->tmp = seqn;
- seqn->strip= MEM_dupallocN(seq->strip);
+ seqn->strip = MEM_dupallocN(seq->strip);
// XXX: add F-Curve duplication stuff?
@@ -3811,68 +3916,74 @@ static Sequence *seq_dupli(struct Scene *scene, struct Scene *scene_to, Sequence
if (seq->strip->color_balance) {
seqn->strip->color_balance
- = MEM_dupallocN(seq->strip->color_balance);
+ = MEM_dupallocN(seq->strip->color_balance);
}
- if(seq->type==SEQ_META) {
+ if (seq->type == SEQ_META) {
seqn->strip->stripdata = NULL;
- seqn->seqbase.first= seqn->seqbase.last= NULL;
+ seqn->seqbase.first = seqn->seqbase.last = NULL;
/* WATCH OUT!!! - This metastrip is not recursively duplicated here - do this after!!! */
/* - seq_dupli_recursive(&seq->seqbase,&seqn->seqbase);*/
- } else if(seq->type == SEQ_SCENE) {
+ }
+ else if (seq->type == SEQ_SCENE) {
seqn->strip->stripdata = NULL;
- if(seq->scene_sound)
+ if (seq->scene_sound)
seqn->scene_sound = sound_scene_add_scene_sound_defaults(sce_audio, seqn);
- } else if(seq->type == SEQ_MOVIE) {
+ }
+ else if (seq->type == SEQ_MOVIE) {
seqn->strip->stripdata =
- MEM_dupallocN(seq->strip->stripdata);
- seqn->anim= NULL;
- } else if(seq->type == SEQ_SOUND) {
+ MEM_dupallocN(seq->strip->stripdata);
+ seqn->anim = NULL;
+ }
+ else if (seq->type == SEQ_SOUND) {
seqn->strip->stripdata =
- MEM_dupallocN(seq->strip->stripdata);
- if(seq->scene_sound)
+ MEM_dupallocN(seq->strip->stripdata);
+ if (seq->scene_sound)
seqn->scene_sound = sound_add_scene_sound_defaults(sce_audio, seqn);
seqn->sound->id.us++;
- } else if(seq->type == SEQ_IMAGE) {
+ }
+ else if (seq->type == SEQ_IMAGE) {
seqn->strip->stripdata =
- MEM_dupallocN(seq->strip->stripdata);
- } else if(seq->type >= SEQ_EFFECT) {
- if(seq->seq1 && seq->seq1->tmp) seqn->seq1= seq->seq1->tmp;
- if(seq->seq2 && seq->seq2->tmp) seqn->seq2= seq->seq2->tmp;
- if(seq->seq3 && seq->seq3->tmp) seqn->seq3= seq->seq3->tmp;
+ MEM_dupallocN(seq->strip->stripdata);
+ }
+ else if (seq->type >= SEQ_EFFECT) {
+ if (seq->seq1 && seq->seq1->tmp) seqn->seq1 = seq->seq1->tmp;
+ if (seq->seq2 && seq->seq2->tmp) seqn->seq2 = seq->seq2->tmp;
+ if (seq->seq3 && seq->seq3->tmp) seqn->seq3 = seq->seq3->tmp;
if (seq->type & SEQ_EFFECT) {
struct SeqEffectHandle sh;
sh = get_sequence_effect(seq);
- if(sh.copy)
+ if (sh.copy)
sh.copy(seq, seqn);
}
seqn->strip->stripdata = NULL;
- } else {
+ }
+ else {
fprintf(stderr, "Aiiiiekkk! sequence type not "
- "handled in duplicate!\nExpect a crash"
- " now...\n");
+ "handled in duplicate!\nExpect a crash"
+ " now...\n");
}
- if(dupe_flag & SEQ_DUPE_UNIQUE_NAME)
+ if (dupe_flag & SEQ_DUPE_UNIQUE_NAME)
seqbase_unique_name_recursive(&scene->ed->seqbase, seqn);
- if(dupe_flag & SEQ_DUPE_ANIM)
- seq_dupe_animdata(scene, seq->name+2, seqn->name+2);
+ if (dupe_flag & SEQ_DUPE_ANIM)
+ seq_dupe_animdata(scene, seq->name + 2, seqn->name + 2);
return seqn;
}
-Sequence * seq_dupli_recursive(struct Scene *scene, struct Scene *scene_to, Sequence * seq, int dupe_flag)
+Sequence *seq_dupli_recursive(struct Scene *scene, struct Scene *scene_to, Sequence *seq, int dupe_flag)
{
- Sequence * seqn = seq_dupli(scene, scene_to, seq, dupe_flag);
+ Sequence *seqn = seq_dupli(scene, scene_to, seq, dupe_flag);
if (seq->type == SEQ_META) {
Sequence *s;
- for(s= seq->seqbase.first; s; s = s->next) {
+ for (s = seq->seqbase.first; s; s = s->next) {
Sequence *n = seq_dupli_recursive(scene, scene_to, s, dupe_flag);
if (n) {
BLI_addtail(&seqn->seqbase, n);
@@ -3888,21 +3999,21 @@ void seqbase_dupli_recursive(Scene *scene, Scene *scene_to, ListBase *nseqbase,
Sequence *seqn = NULL;
Sequence *last_seq = seq_active_get(scene);
- for(seq= seqbase->first; seq; seq= seq->next) {
- seq->tmp= NULL;
- if((seq->flag & SELECT) || (dupe_flag & SEQ_DUPE_ALL)) {
+ for (seq = seqbase->first; seq; seq = seq->next) {
+ seq->tmp = NULL;
+ if ((seq->flag & SELECT) || (dupe_flag & SEQ_DUPE_ALL)) {
seqn = seq_dupli(scene, scene_to, seq, dupe_flag);
if (seqn) { /*should never fail */
- if(dupe_flag & SEQ_DUPE_CONTEXT) {
+ if (dupe_flag & SEQ_DUPE_CONTEXT) {
seq->flag &= ~SEQ_ALLSEL;
- seqn->flag &= ~(SEQ_LEFTSEL+SEQ_RIGHTSEL+SEQ_LOCK);
+ seqn->flag &= ~(SEQ_LEFTSEL + SEQ_RIGHTSEL + SEQ_LOCK);
}
BLI_addtail(nseqbase, seqn);
- if(seq->type==SEQ_META)
+ if (seq->type == SEQ_META)
seqbase_dupli_recursive(scene, scene_to, &seqn->seqbase, &seq->seqbase, dupe_flag);
- if(dupe_flag & SEQ_DUPE_CONTEXT) {
+ if (dupe_flag & SEQ_DUPE_CONTEXT) {
if (seq == last_seq) {
seq_active_set(scene, seqn);
}
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index 84513f83204..6513399c962 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -75,7 +75,7 @@
_t1 = ( double ) _tstart.tv_sec + ( double ) _tstart.tv_usec/ ( 1000*1000 ); \
_t2 = ( double ) _tend.tv_sec + ( double ) _tend.tv_usec/ ( 1000*1000 ); \
printf("%s: %fs (real) %fs (cpu)\n", #a, _t2-_t1, (float)(clock()-_clock_init)/CLOCKS_PER_SEC);\
- } while(0)
+ } while (0)
#else
@@ -86,13 +86,13 @@
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;
BMEditMesh *em = me->edit_btmesh;
- if(em) {
+ if (em) {
DerivedMesh *dm = em->derivedFinal;
return dm;
}
@@ -146,7 +146,7 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
BENCH(bvhtree_from_mesh_verts(&treeData, calc->target, 0.0, 2, 6));
- if(treeData.tree == NULL)
+ if (treeData.tree == NULL)
{
OUT_OF_MEMORY();
return;
@@ -158,16 +158,16 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
#ifndef __APPLE__
#pragma omp parallel for default(none) private(i) firstprivate(nearest) shared(treeData,calc) schedule(static)
#endif
- for(i = 0; i<calc->numVerts; ++i)
+ for (i = 0; i<calc->numVerts; ++i)
{
float *co = calc->vertexCos[i];
float tmp_co[3];
float weight = defvert_array_find_weight_safe(calc->dvert, i, calc->vgroup);
- if(weight == 0.0f) continue;
+ 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 {
@@ -180,7 +180,7 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
//If we already had an hit before.. we assume this vertex is going to have a close hit to that other vertex
//so we can initiate the "nearest.dist" with the expected value to that last hit.
//This will lead in prunning of the search tree.
- if(nearest.index != -1)
+ if (nearest.index != -1)
nearest.dist = len_squared_v3v3(tmp_co, nearest.co);
else
nearest.dist = FLT_MAX;
@@ -189,11 +189,11 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
//Found the nearest vertex
- if(nearest.index != -1)
+ if (nearest.index != -1)
{
//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) weight *= (dist - calc->keepDist)/dist;
+ if (dist > FLT_EPSILON) weight *= (dist - calc->keepDist)/dist;
//Convert the coordinates back to mesh coordinates
copy_v3_v3(tmp_co, nearest.co);
@@ -224,7 +224,7 @@ int normal_projection_project_vertex(char options, const float *vert, const floa
memcpy( &hit_tmp, hit, sizeof(hit_tmp) );
//Apply space transform (TODO readjust dist)
- if(transf)
+ if (transf)
{
copy_v3_v3( tmp_co, vert );
space_transform_apply( transf, tmp_co );
@@ -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;
}
@@ -246,23 +245,23 @@ int normal_projection_project_vertex(char options, const float *vert, const floa
BLI_bvhtree_ray_cast(tree, co, no, 0.0f, &hit_tmp, callback, userdata);
- if(hit_tmp.index != -1) {
+ if (hit_tmp.index != -1) {
/* invert the normal first so face culling works on rotated objects */
- if(transf) {
+ if (transf) {
space_transform_invert_normal(transf, hit_tmp.no);
}
if (options & (MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE|MOD_SHRINKWRAP_CULL_TARGET_BACKFACE)) {
/* apply backface */
const float dot= dot_v3v3(dir, hit_tmp.no);
- if( ((options & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && dot <= 0.0f) ||
+ if ( ((options & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && dot <= 0.0f) ||
((options & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && dot >= 0.0f)
) {
return FALSE; /* Ignore hit */
}
}
- if(transf) {
+ if (transf) {
/* Inverting space transform (TODO make coeherent with the initial dist readjust) */
space_transform_invert(transf, hit_tmp.co);
hit_tmp.dist = len_v3v3((float *)vert, hit_tmp.co);
@@ -287,108 +286,107 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
BVHTreeRayHit hit;
BVHTreeFromMesh treeData= NULL_BVHTreeFromMesh;
- //auxiliar target
+ //auxiliary target
DerivedMesh *auxMesh = NULL;
BVHTreeFromMesh auxData = NULL_BVHTreeFromMesh;
SpaceTransform local2aux;
//If the user doesn't allows to project in any direction of projection axis
//then theres nothing todo.
- if((use_normal & (MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR | MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR)) == 0)
+ if ((use_normal & (MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR | MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR)) == 0)
return;
//Prepare data to retrieve the direction in which we should project each vertex
- if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL)
+ if (calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL)
{
- if(calc->vert == NULL) return;
+ if (calc->vert == NULL) return;
}
- else
- {
+ else {
//The code supports any axis that is a combination of X,Y,Z
- //altought currently UI only allows to set the 3 diferent axis
- if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) proj_axis[0] = 1.0f;
- if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS) proj_axis[1] = 1.0f;
- if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS) proj_axis[2] = 1.0f;
+ //although currently UI only allows to set the 3 different axis
+ if (calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) proj_axis[0] = 1.0f;
+ if (calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS) proj_axis[1] = 1.0f;
+ if (calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS) proj_axis[2] = 1.0f;
normalize_v3(proj_axis);
//Invalid projection direction
- if(dot_v3v3(proj_axis, proj_axis) < FLT_EPSILON)
+ if (dot_v3v3(proj_axis, proj_axis) < FLT_EPSILON)
return;
}
- if(calc->smd->auxTarget)
+ if (calc->smd->auxTarget)
{
auxMesh = object_get_derived_final(calc->smd->auxTarget);
- if(!auxMesh)
+ if (!auxMesh)
return;
space_transform_setup( &local2aux, calc->ob, calc->smd->auxTarget);
}
//After sucessufuly build the trees, start projection vertexs
- if( bvhtree_from_mesh_faces(&treeData, calc->target, 0.0, 4, 6)
+ if ( bvhtree_from_mesh_faces(&treeData, calc->target, 0.0, 4, 6)
&& (auxMesh == NULL || bvhtree_from_mesh_faces(&auxData, auxMesh, 0.0, 4, 6)))
{
#ifndef __APPLE__
#pragma omp parallel for private(i,hit) schedule(static)
#endif
- for(i = 0; i<calc->numVerts; ++i)
+ for (i = 0; i<calc->numVerts; ++i)
{
float *co = calc->vertexCos[i];
float tmp_co[3], tmp_no[3];
float weight = defvert_array_find_weight_safe(calc->dvert, i, calc->vgroup);
- if(weight == 0.0f) continue;
+ if (weight == 0.0f) continue;
- if(calc->vert)
+ if (calc->vert)
{
/* calc->vert contains verts from derivedMesh */
/* this coordinated are deformed by vertexCos only for normal projection (to get correct normals) */
/* for other cases calc->varts contains undeformed coordinates and vertexCos should be used */
- if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) {
+ if (calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) {
copy_v3_v3(tmp_co, calc->vert[i].co);
normal_short_to_float_v3(tmp_no, calc->vert[i].no);
- } else {
+ }
+ else {
copy_v3_v3(tmp_co, co);
copy_v3_v3(tmp_no, proj_axis);
}
}
- else
- {
+ else {
copy_v3_v3(tmp_co, co);
copy_v3_v3(tmp_no, proj_axis);
}
hit.index = -1;
- hit.dist = 10000.0f; //TODO: we should use FLT_MAX here, but sweepsphere code isnt prepared for that
+ hit.dist = 10000.0f; //TODO: we should use FLT_MAX here, but sweepsphere code isn't prepared for that
//Project over positive direction of axis
- if(use_normal & MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR)
+ if (use_normal & MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR)
{
- if(auxData.tree)
+ if (auxData.tree)
normal_projection_project_vertex(0, tmp_co, tmp_no, &local2aux, auxData.tree, &hit, auxData.raycast_callback, &auxData);
normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no, &calc->local2target, treeData.tree, &hit, treeData.raycast_callback, &treeData);
}
//Project over negative direction of axis
- if(use_normal & MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR && hit.index == -1)
+ if (use_normal & MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR && hit.index == -1)
{
float inv_no[3];
negate_v3_v3(inv_no, tmp_no);
- if(auxData.tree)
+ if (auxData.tree)
normal_projection_project_vertex(0, tmp_co, inv_no, &local2aux, auxData.tree, &hit, auxData.raycast_callback, &auxData);
normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no, &calc->local2target, treeData.tree, &hit, treeData.raycast_callback, &treeData);
}
- if(hit.index != -1)
+ if (hit.index != -1)
{
madd_v3_v3v3fl(hit.co, hit.co, tmp_no, calc->keepDist);
interp_v3_v3v3(co, co, hit.co, weight);
@@ -405,7 +403,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
* Shrinkwrap moving vertexs to the nearest surface point on the target
*
* it builds a BVHTree from the target mesh and then performs a
- * NN matchs for each vertex
+ * NN matches for each vertex
*/
static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
{
@@ -416,7 +414,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
//Create a bvh-tree of the given target
BENCH(bvhtree_from_mesh_faces( &treeData, calc->target, 0.0, 2, 6));
- if(treeData.tree == NULL)
+ if (treeData.tree == NULL)
{
OUT_OF_MEMORY();
return;
@@ -431,20 +429,18 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
#ifndef __APPLE__
#pragma omp parallel for default(none) private(i) firstprivate(nearest) shared(calc,treeData) schedule(static)
#endif
- for(i = 0; i<calc->numVerts; ++i)
+ for (i = 0; i<calc->numVerts; ++i)
{
float *co = calc->vertexCos[i];
float tmp_co[3];
float weight = defvert_array_find_weight_safe(calc->dvert, i, calc->vgroup);
- if(weight == 0.0f) continue;
+ 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);
@@ -454,7 +450,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
//If we already had an hit before.. we assume this vertex is going to have a close hit to that other vertex
//so we can initiate the "nearest.dist" with the expected value to that last hit.
//This will lead in prunning of the search tree.
- if(nearest.index != -1)
+ if (nearest.index != -1)
nearest.dist = len_squared_v3v3(tmp_co, nearest.co);
else
nearest.dist = FLT_MAX;
@@ -462,18 +458,17 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
BLI_bvhtree_find_nearest(treeData.tree, tmp_co, &nearest, treeData.nearest_callback, &treeData);
//Found the nearest vertex
- if(nearest.index != -1)
+ if (nearest.index != -1)
{
- if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE)
+ if (calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE)
{
//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)
+ if (dist > FLT_EPSILON)
interp_v3_v3v3(tmp_co, tmp_co, nearest.co, (dist - calc->keepDist)/dist); //linear interpolation
else
copy_v3_v3( tmp_co, nearest.co );
@@ -496,8 +491,8 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM
ShrinkwrapCalcData calc = NULL_ShrinkwrapCalcData;
//remove loop dependencies on derived meshs (TODO should this be done elsewhere?)
- if(smd->target == ob) smd->target = NULL;
- if(smd->auxTarget == ob) smd->auxTarget = NULL;
+ if (smd->target == ob) smd->target = NULL;
+ if (smd->auxTarget == ob) smd->auxTarget = NULL;
//Configure Shrinkwrap calc data
@@ -508,17 +503,15 @@ 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);
}
- if(smd->target)
+ if (smd->target)
{
calc.target = object_get_derived_final(smd->target);
@@ -535,14 +528,14 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM
calc.vgroup = defgroup_name_index(calc.ob, smd->vgroup_name);
- if(dm != NULL && smd->shrinkType == MOD_SHRINKWRAP_PROJECT)
+ if (dm != NULL && smd->shrinkType == MOD_SHRINKWRAP_PROJECT)
{
//Setup arrays to get vertexs positions, normals and deform weights
calc.vert = dm->getVertDataArray(dm, CD_MVERT);
calc.dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
//Using vertexs positions/normals as if a subsurface was applied
- if(smd->subsurfLevels)
+ if (smd->subsurfLevels)
{
SubsurfModifierData ssmd= {{NULL}};
ssmd.subdivType = ME_CC_SUBSURF; //catmull clark
@@ -550,10 +543,10 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM
ss_mesh = subsurf_make_derived_from_derived(dm, &ssmd, FALSE, NULL, 0, 0, (ob->mode & OB_MODE_EDIT));
- if(ss_mesh)
+ if (ss_mesh)
{
calc.vert = ss_mesh->getVertDataArray(ss_mesh, CD_MVERT);
- if(calc.vert)
+ if (calc.vert)
{
//TRICKY: this code assumes subsurface will have the transformed original vertices
//in their original order at the end of the vert array.
@@ -568,8 +561,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:
@@ -587,7 +579,7 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM
}
//free memory
- if(ss_mesh)
+ if (ss_mesh)
ss_mesh->release(ss_mesh);
}
diff --git a/source/blender/blenkernel/intern/sketch.c b/source/blender/blenkernel/intern/sketch.c
index 7134f5ac8c1..71ea85de716 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);
@@ -415,7 +414,7 @@ void sk_filterStroke(SK_Stroke *stk, int start, int end)
float max_dist = 16; /* more than 4 pixels */
/* find the next marked point */
- while(marked[le] == 0)
+ while (marked[le] == 0)
{
le++;
}
@@ -425,7 +424,7 @@ void sk_filterStroke(SK_Stroke *stk, int start, int end)
v1[0] = old_points[ls].p2d[1] - old_points[le].p2d[1];
- for( i = ls + 1; i < le; i++ )
+ for ( i = ls + 1; i < le; i++ )
{
float mul;
float dist;
@@ -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 e7dbbf44223..466f6edcaf7 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -73,8 +73,6 @@
#include "DNA_scene_types.h"
#include "DNA_smoke_types.h"
-#include "smoke_API.h"
-
#include "BKE_smoke.h"
/* UNUSED so far, may be enabled later */
@@ -82,6 +80,8 @@
#ifdef WITH_SMOKE
+#include "smoke_API.h"
+
#ifdef _WIN32
#include <time.h>
#include <stdio.h>
@@ -159,7 +159,7 @@ void smokeModifier_do(SmokeModifierData *UNUSED(smd), Scene *UNUSED(scene), Obje
static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, DerivedMesh *dm)
{
- if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain && !smd->domain->fluid)
+ if ((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain && !smd->domain->fluid)
{
size_t i;
float min[3] = {FLT_MAX, FLT_MAX, FLT_MAX}, max[3] = {-FLT_MAX, -FLT_MAX, -FLT_MAX};
@@ -171,7 +171,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
res = smd->domain->maxres;
// get BB of domain
- for(i = 0; i < dm->getNumVerts(dm); i++)
+ for (i = 0; i < dm->getNumVerts(dm); i++)
{
float tmp[3];
@@ -198,12 +198,12 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
// printf("size: %f, %f, %f\n", size[0], size[1], size[2]);
// prevent crash when initializing a plane as domain
- if((size[0] < FLT_EPSILON) || (size[1] < FLT_EPSILON) || (size[2] < FLT_EPSILON))
+ if ((size[0] < FLT_EPSILON) || (size[1] < FLT_EPSILON) || (size[2] < FLT_EPSILON))
return 0;
- if(size[0] > size[1])
+ if (size[0] > size[1])
{
- if(size[0] > size[2])
+ if (size[0] > size[2])
{
scale = res / size[0];
smd->domain->dx = size[0] / res;
@@ -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,9 +219,8 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
smd->domain->res[1] = (int)(size[1] * scale + 0.5);
}
}
- else
- {
- if(size[1] > size[2])
+ else {
+ if (size[1] > size[2])
{
scale = res / size[1];
smd->domain->dx = size[1] / res;
@@ -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;
@@ -249,7 +246,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
smd->domain->fluid = smoke_init(smd->domain->res, smd->domain->p0);
smd->time = scene->r.cfra;
- if(smd->domain->flags & MOD_SMOKE_HIGHRES)
+ if (smd->domain->flags & MOD_SMOKE_HIGHRES)
{
smd->domain->wt = smoke_turbulence_init(smd->domain->res, smd->domain->amplify + 1, smd->domain->noise);
smd->domain->res_wt[0] = smd->domain->res[0] * (smd->domain->amplify + 1);
@@ -260,19 +257,19 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
// printf("(smd->domain->flags & MOD_SMOKE_HIGHRES)\n");
}
- if(!smd->domain->shadow)
+ if (!smd->domain->shadow)
smd->domain->shadow = MEM_callocN(sizeof(float) * smd->domain->res[0] * smd->domain->res[1] * smd->domain->res[2], "SmokeDomainShadow");
smoke_initBlenderRNA(smd->domain->fluid, &(smd->domain->alpha), &(smd->domain->beta), &(smd->domain->time_scale), &(smd->domain->vorticity), &(smd->domain->border_collisions));
- if(smd->domain->wt)
+ if (smd->domain->wt)
{
smoke_initWaveletBlenderRNA(smd->domain->wt, &(smd->domain->strength));
// printf("smoke_initWaveletBlenderRNA\n");
}
return 1;
}
- else if((smd->type & MOD_SMOKE_TYPE_FLOW) && smd->flow)
+ else if ((smd->type & MOD_SMOKE_TYPE_FLOW) && smd->flow)
{
// handle flow object here
// XXX TODO
@@ -282,7 +279,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
// update particle lifetime to be one frame
// smd->flow->psys->part->lifetime = scene->r.efra + 1;
/*
- if(!smd->flow->bvh)
+ if (!smd->flow->bvh)
{
// smd->flow->bvh = MEM_callocN(sizeof(BVHTreeFromMesh), "smoke_bvhfromfaces");
// bvhtree_from_mesh_faces(smd->flow->bvh, dm, 0.0, 2, 6);
@@ -295,15 +292,15 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
return 1;
}
- else if((smd->type & MOD_SMOKE_TYPE_COLL))
+ else if ((smd->type & MOD_SMOKE_TYPE_COLL))
{
smd->time = scene->r.cfra;
// todo: delete this when loading colls work -dg
- if(!smd->coll)
+ if (!smd->coll)
smokeModifier_createType(smd);
- if(!smd->coll->points)
+ if (!smd->coll->points)
{
// init collision points
SmokeCollSettings *scs = smd->coll;
@@ -312,10 +309,11 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
copy_m4_m4(scs->mat, ob->obmat);
copy_m4_m4(scs->mat_old, ob->obmat);
+ DM_ensure_tessface(dm);
fill_scs_points(ob, dm, scs);
}
- if(!smd->coll->bvhtree)
+ if (!smd->coll->bvhtree)
{
smd->coll->bvhtree = NULL; // bvhtree_build_from_smoke ( ob->obmat, dm->getTessFaceArray(dm), dm->getNumTessFaces(dm), dm->getVertArray(dm), dm->getNumVerts(dm), 0.0 );
}
@@ -336,16 +334,16 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
int quads = 0, facecounter = 0;
// count quads
- for(i = 0; i < dm->getNumTessFaces(dm); i++)
+ for (i = 0; i < dm->getNumTessFaces(dm); i++)
{
- if(mface[i].v4)
+ if (mface[i].v4)
quads++;
}
calcTriangleDivs(ob, mvert, dm->getNumVerts(dm), mface, dm->getNumTessFaces(dm), dm->getNumTessFaces(dm) + quads, &tridivs, cell_len);
// count triangle divisions
- for(i = 0; i < dm->getNumTessFaces(dm) + quads; i++)
+ for (i = 0; i < dm->getNumTessFaces(dm) + quads; i++)
{
divs += (tridivs[3 * i] + 1) * (tridivs[3 * i + 1] + 1) * (tridivs[3 * i + 2] + 1);
}
@@ -354,7 +352,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
scs->points = MEM_callocN(sizeof(float) * (dm->getNumVerts(dm) + divs) * 3, "SmokeCollPoints");
- for(i = 0; i < dm->getNumVerts(dm); i++)
+ for (i = 0; i < dm->getNumVerts(dm); i++)
{
float tmpvec[3];
copy_v3_v3(tmpvec, mvert[i].co);
@@ -362,7 +360,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
copy_v3_v3(&scs->points[i * 3], tmpvec);
}
- for(i = 0, facecounter = 0; i < dm->getNumTessFaces(dm); i++)
+ for (i = 0, facecounter = 0; i < dm->getNumTessFaces(dm); i++)
{
int again = 0;
do
@@ -373,13 +371,12 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
//int divs3 = tridivs[3 * facecounter + 2];
float side1[3], side2[3], trinormorg[3], trinorm[3];
- if(again == 1 && mface[i].v4)
+ if (again == 1 && mface[i].v4)
{
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);
}
@@ -389,29 +386,28 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
copy_v3_v3(trinorm, trinormorg);
mul_v3_fl(trinorm, 0.25 * cell_len);
- for(j = 0; j <= divs1; j++)
+ for (j = 0; j <= divs1; j++)
{
- for(k = 0; k <= divs2; k++)
+ for (k = 0; k <= divs2; k++)
{
float p1[3], p2[3], p3[3], p[3]={0,0,0};
const float uf = (float)(j + TRI_UVOFFSET) / (float)(divs1 + 0.0);
const float vf = (float)(k + TRI_UVOFFSET) / (float)(divs2 + 0.0);
float tmpvec[3];
- if(uf+vf > 1.0)
+ if (uf+vf > 1.0)
{
// printf("bigger - divs1: %d, divs2: %d\n", divs1, divs2);
continue;
}
copy_v3_v3(p1, mvert[ mface[i].v1 ].co);
- if(again == 1 && mface[i].v4)
+ if (again == 1 && mface[i].v4)
{
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);
}
@@ -423,7 +419,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
add_v3_v3v3(p, p1, p2);
add_v3_v3(p, p3);
- if(newdivs > divs)
+ if (newdivs > divs)
printf("mem problem\n");
// mMovPoints.push_back(p + trinorm);
@@ -432,7 +428,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
copy_v3_v3(&scs->points[3 * (dm->getNumVerts(dm) + newdivs)], tmpvec);
newdivs++;
- if(newdivs > divs)
+ if (newdivs > divs)
printf("mem problem\n");
// mMovPoints.push_back(p - trinorm);
@@ -444,14 +440,14 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
}
}
- if(again == 0 && mface[i].v4)
+ if (again == 0 && mface[i].v4)
again++;
else
again = 0;
facecounter++;
- } while(again!=0);
+ } while (again!=0);
}
scs->numpoints = dm->getNumVerts(dm) + newdivs;
@@ -471,18 +467,18 @@ static void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFa
float maxpart = ABS(maxscale[0]);
float scaleFac = 0;
float fsTri = 0;
- if(ABS(maxscale[1])>maxpart) maxpart = ABS(maxscale[1]);
- if(ABS(maxscale[2])>maxpart) maxpart = ABS(maxscale[2]);
+ if (ABS(maxscale[1])>maxpart) maxpart = ABS(maxscale[1]);
+ if (ABS(maxscale[2])>maxpart) maxpart = ABS(maxscale[2]);
scaleFac = 1.0 / maxpart;
// featureSize = mLevel[mMaxRefine].nodeSize
fsTri = cell_len * 0.5 * scaleFac;
- if(*tridivs)
+ if (*tridivs)
MEM_freeN(*tridivs);
*tridivs = MEM_callocN(sizeof(int) * numtris * 3, "Smoke_Tridivs");
- for(i = 0, facecounter = 0; i < numfaces; i++)
+ for (i = 0, facecounter = 0; i < numfaces; i++)
{
float p0[3], p1[3], p2[3];
float side1[3];
@@ -501,19 +497,19 @@ static void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFa
sub_v3_v3v3(side2, p2, p0);
sub_v3_v3v3(side3, p1, p2);
- if(dot_v3v3(side1, side1) > fsTri*fsTri)
+ if (dot_v3v3(side1, side1) > fsTri*fsTri)
{
float tmp = normalize_v3(side1);
divs1 = (int)ceil(tmp/fsTri);
}
- if(dot_v3v3(side2, side2) > fsTri*fsTri)
+ if (dot_v3v3(side2, side2) > fsTri*fsTri)
{
float tmp = normalize_v3(side2);
divs2 = (int)ceil(tmp/fsTri);
/*
// debug
- if(i==0)
+ if (i==0)
printf("b tmp: %f, fsTri: %f, divs2: %d\n", tmp, fsTri, divs2);
*/
}
@@ -523,7 +519,7 @@ static void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFa
(*tridivs)[3 * facecounter + 2] = divs3;
// TODO quad case
- if(faces[i].v4)
+ if (faces[i].v4)
{
divs1=0, divs2=0, divs3=0;
@@ -540,12 +536,12 @@ static void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFa
sub_v3_v3v3(side2, p2, p0);
sub_v3_v3v3(side3, p1, p2);
- if(dot_v3v3(side1, side1) > fsTri*fsTri)
+ if (dot_v3v3(side1, side1) > fsTri*fsTri)
{
float tmp = normalize_v3(side1);
divs1 = (int)ceil(tmp/fsTri);
}
- if(dot_v3v3(side2, side2) > fsTri*fsTri)
+ if (dot_v3v3(side2, side2) > fsTri*fsTri)
{
float tmp = normalize_v3(side2);
divs2 = (int)ceil(tmp/fsTri);
@@ -563,19 +559,19 @@ static void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFa
static void smokeModifier_freeDomain(SmokeModifierData *smd)
{
- if(smd->domain)
+ if (smd->domain)
{
- if(smd->domain->shadow)
+ if (smd->domain->shadow)
MEM_freeN(smd->domain->shadow);
smd->domain->shadow = NULL;
- if(smd->domain->fluid)
+ if (smd->domain->fluid)
smoke_free(smd->domain->fluid);
- if(smd->domain->wt)
+ if (smd->domain->wt)
smoke_turbulence_free(smd->domain->wt);
- if(smd->domain->effector_weights)
+ if (smd->domain->effector_weights)
MEM_freeN(smd->domain->effector_weights);
smd->domain->effector_weights = NULL;
@@ -589,10 +585,10 @@ static void smokeModifier_freeDomain(SmokeModifierData *smd)
static void smokeModifier_freeFlow(SmokeModifierData *smd)
{
- if(smd->flow)
+ if (smd->flow)
{
/*
- if(smd->flow->bvh)
+ if (smd->flow->bvh)
{
free_bvhtree_from_mesh(smd->flow->bvh);
MEM_freeN(smd->flow->bvh);
@@ -606,22 +602,22 @@ static void smokeModifier_freeFlow(SmokeModifierData *smd)
static void smokeModifier_freeCollision(SmokeModifierData *smd)
{
- if(smd->coll)
+ if (smd->coll)
{
- if(smd->coll->points)
+ if (smd->coll->points)
{
MEM_freeN(smd->coll->points);
smd->coll->points = NULL;
}
- if(smd->coll->bvhtree)
+ if (smd->coll->bvhtree)
{
BLI_bvhtree_free(smd->coll->bvhtree);
smd->coll->bvhtree = NULL;
}
#ifdef USE_SMOKE_COLLISION_DM
- if(smd->coll->dm)
+ if (smd->coll->dm)
smd->coll->dm->release(smd->coll->dm);
smd->coll->dm = NULL;
#endif
@@ -633,7 +629,7 @@ static void smokeModifier_freeCollision(SmokeModifierData *smd)
void smokeModifier_reset_turbulence(struct SmokeModifierData *smd)
{
- if(smd && smd->domain && smd->domain->wt)
+ if (smd && smd->domain && smd->domain->wt)
{
smoke_turbulence_free(smd->domain->wt);
smd->domain->wt = NULL;
@@ -642,15 +638,15 @@ void smokeModifier_reset_turbulence(struct SmokeModifierData *smd)
void smokeModifier_reset(struct SmokeModifierData *smd)
{
- if(smd)
+ if (smd)
{
- if(smd->domain)
+ if (smd->domain)
{
- if(smd->domain->shadow)
+ if (smd->domain->shadow)
MEM_freeN(smd->domain->shadow);
smd->domain->shadow = NULL;
- if(smd->domain->fluid)
+ if (smd->domain->fluid)
{
smoke_free(smd->domain->fluid);
smd->domain->fluid = NULL;
@@ -662,10 +658,10 @@ void smokeModifier_reset(struct SmokeModifierData *smd)
// printf("reset domain end\n");
}
- else if(smd->flow)
+ else if (smd->flow)
{
/*
- if(smd->flow->bvh)
+ if (smd->flow->bvh)
{
free_bvhtree_from_mesh(smd->flow->bvh);
MEM_freeN(smd->flow->bvh);
@@ -673,22 +669,22 @@ void smokeModifier_reset(struct SmokeModifierData *smd)
smd->flow->bvh = NULL;
*/
}
- else if(smd->coll)
+ else if (smd->coll)
{
- if(smd->coll->points)
+ if (smd->coll->points)
{
MEM_freeN(smd->coll->points);
smd->coll->points = NULL;
}
- if(smd->coll->bvhtree)
+ if (smd->coll->bvhtree)
{
BLI_bvhtree_free(smd->coll->bvhtree);
smd->coll->bvhtree = NULL;
}
#ifdef USE_SMOKE_COLLISION_DM
- if(smd->coll->dm)
+ if (smd->coll->dm)
smd->coll->dm->release(smd->coll->dm);
smd->coll->dm = NULL;
#endif
@@ -699,7 +695,7 @@ void smokeModifier_reset(struct SmokeModifierData *smd)
void smokeModifier_free (SmokeModifierData *smd)
{
- if(smd)
+ if (smd)
{
smokeModifier_freeDomain(smd);
smokeModifier_freeFlow(smd);
@@ -709,11 +705,11 @@ void smokeModifier_free (SmokeModifierData *smd)
void smokeModifier_createType(struct SmokeModifierData *smd)
{
- if(smd)
+ if (smd)
{
- if(smd->type & MOD_SMOKE_TYPE_DOMAIN)
+ if (smd->type & MOD_SMOKE_TYPE_DOMAIN)
{
- if(smd->domain)
+ if (smd->domain)
smokeModifier_freeDomain(smd);
smd->domain = MEM_callocN(sizeof(SmokeDomainSettings), "SmokeDomain");
@@ -750,9 +746,9 @@ void smokeModifier_createType(struct SmokeModifierData *smd)
smd->domain->viewsettings = MOD_SMOKE_VIEW_SHOWBIG;
smd->domain->effector_weights = BKE_add_effector_weights(NULL);
}
- else if(smd->type & MOD_SMOKE_TYPE_FLOW)
+ else if (smd->type & MOD_SMOKE_TYPE_FLOW)
{
- if(smd->flow)
+ if (smd->flow)
smokeModifier_freeFlow(smd);
smd->flow = MEM_callocN(sizeof(SmokeFlowSettings), "SmokeFlow");
@@ -768,9 +764,9 @@ void smokeModifier_createType(struct SmokeModifierData *smd)
smd->flow->psys = NULL;
}
- else if(smd->type & MOD_SMOKE_TYPE_COLL)
+ else if (smd->type & MOD_SMOKE_TYPE_COLL)
{
- if(smd->coll)
+ if (smd->coll)
smokeModifier_freeCollision(smd);
smd->coll = MEM_callocN(sizeof(SmokeCollSettings), "SmokeColl");
@@ -813,16 +809,18 @@ void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData
MEM_freeN(tsmd->domain->effector_weights);
tsmd->domain->effector_weights = MEM_dupallocN(smd->domain->effector_weights);
- } else if (tsmd->flow) {
+ }
+ else if (tsmd->flow) {
tsmd->flow->density = smd->flow->density;
tsmd->flow->temp = smd->flow->temp;
tsmd->flow->psys = smd->flow->psys;
tsmd->flow->type = smd->flow->type;
tsmd->flow->flags = smd->flow->flags;
tsmd->flow->vel_multi = smd->flow->vel_multi;
- } else if (tsmd->coll) {
+ }
+ else if (tsmd->coll) {
;
- /* leave it as initialised, collision settings is mostly caches */
+ /* leave it as initialized, collision settings is mostly caches */
}
}
@@ -838,15 +836,15 @@ static int get_lamp(Scene *scene, float *light)
int found_lamp = 0;
// try to find a lamp, preferably local
- for(base_tmp = scene->base.first; base_tmp; base_tmp= base_tmp->next) {
- if(base_tmp->object->type == OB_LAMP) {
+ for (base_tmp = scene->base.first; base_tmp; base_tmp= base_tmp->next) {
+ if (base_tmp->object->type == OB_LAMP) {
Lamp *la = base_tmp->object->data;
- if(la->type == LA_LOCAL) {
+ if (la->type == LA_LOCAL) {
copy_v3_v3(light, base_tmp->object->obmat[3]);
return 1;
}
- else if(!found_lamp) {
+ else if (!found_lamp) {
copy_v3_v3(light, base_tmp->object->obmat[3]);
found_lamp = 1;
}
@@ -863,29 +861,29 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
Base *base = NULL;
// do collisions, needs to be done before emission, so that smoke isn't emitted inside collision cells
- if(1)
+ if (1)
{
Object *otherobj = NULL;
ModifierData *md = NULL;
- if(sds->coll_group) // we use groups since we have 2 domains
+ if (sds->coll_group) // we use groups since we have 2 domains
go = sds->coll_group->gobject.first;
else
base = scene->base.first;
- while(base || go)
+ while (base || go)
{
otherobj = NULL;
- if(sds->coll_group)
+ if (sds->coll_group)
{
- if(go->ob)
+ if (go->ob)
otherobj = go->ob;
}
else
otherobj = base->object;
- if(!otherobj)
+ if (!otherobj)
{
- if(sds->coll_group)
+ if (sds->coll_group)
go = go->next;
else
base= base->next;
@@ -894,18 +892,18 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
md = modifiers_findByType(otherobj, eModifierType_Smoke);
// check for active smoke modifier
- if(md && md->mode & (eModifierMode_Realtime | eModifierMode_Render))
+ if (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render))
{
SmokeModifierData *smd2 = (SmokeModifierData *)md;
- if((smd2->type & MOD_SMOKE_TYPE_COLL) && smd2->coll && smd2->coll->points)
+ if ((smd2->type & MOD_SMOKE_TYPE_COLL) && smd2->coll && smd2->coll->points)
{
// we got nice collision object
SmokeCollSettings *scs = smd2->coll;
size_t i, j;
unsigned char *obstacles = smoke_get_obstacle(smd->domain->fluid);
- for(i = 0; i < scs->numpoints; i++)
+ for (i = 0; i < scs->numpoints; i++)
{
int badcell = 0;
size_t index = 0;
@@ -915,14 +913,14 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
get_cell(smd->domain->p0, smd->domain->res, smd->domain->dx, &scs->points[3 * i], cell, 0);
// check if cell is valid (in the domain boundary)
- for(j = 0; j < 3; j++)
- if((cell[j] > sds->res[j] - 1) || (cell[j] < 0))
+ for (j = 0; j < 3; j++)
+ if ((cell[j] > sds->res[j] - 1) || (cell[j] < 0))
{
badcell = 1;
break;
}
- if(badcell)
+ if (badcell)
continue;
// 2. set cell values (heat, density and velocity)
index = smoke_get_index(cell[0], sds->res[0], cell[1], sds->res[1], cell[2]);
@@ -939,11 +937,11 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
{
const LbmFloat usqr = (objvel[0]*objvel[0]+objvel[1]*objvel[1]+objvel[2]*objvel[2])*1.5;
USQRMAXCHECK(usqr, objvel[0],objvel[1],objvel[2], mMaxVlen, mMxvx,mMxvy,mMxvz);
- if(usqr>maxusqr) {
+ if (usqr>maxusqr) {
// cutoff at maxVelVal
- for(int jj=0; jj<3; jj++) {
- if(objvel[jj]>0.) objvel[jj] = maxVelVal;
- if(objvel[jj]<0.) objvel[jj] = -maxVelVal;
+ for (int jj=0; jj<3; jj++) {
+ if (objvel[jj]>0.) objvel[jj] = maxVelVal;
+ if (objvel[jj]<0.) objvel[jj] = -maxVelVal;
}
}
}
@@ -955,7 +953,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
}
}
- if(sds->coll_group)
+ if (sds->coll_group)
go = go->next;
else
base= base->next;
@@ -963,27 +961,27 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
}
// do flows and fluids
- if(1)
+ if (1)
{
Object *otherobj = NULL;
ModifierData *md = NULL;
- if(sds->fluid_group) // we use groups since we have 2 domains
+ if (sds->fluid_group) // we use groups since we have 2 domains
go = sds->fluid_group->gobject.first;
else
base = scene->base.first;
- while(base || go)
+ while (base || go)
{
otherobj = NULL;
- if(sds->fluid_group)
+ if (sds->fluid_group)
{
- if(go->ob)
+ if (go->ob)
otherobj = go->ob;
}
else
otherobj = base->object;
- if(!otherobj)
+ if (!otherobj)
{
- if(sds->fluid_group)
+ if (sds->fluid_group)
go = go->next;
else
base= base->next;
@@ -994,17 +992,17 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
md = modifiers_findByType(otherobj, eModifierType_Smoke);
// check for active smoke modifier
- if(md && md->mode & (eModifierMode_Realtime | eModifierMode_Render))
+ if (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render))
{
SmokeModifierData *smd2 = (SmokeModifierData *)md;
// check for initialized smoke object
- if((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow)
+ if ((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow)
{
// we got nice flow object
SmokeFlowSettings *sfs = smd2->flow;
- if(sfs && sfs->psys && sfs->psys->part && sfs->psys->part->type==PART_EMITTER) // is particle system selected
+ if (sfs && sfs->psys && sfs->psys->part && sfs->psys->part->type==PART_EMITTER) // is particle system selected
{
ParticleSimulationData sim;
ParticleSystem *psys = sfs->psys;
@@ -1033,7 +1031,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
sim.psys = psys;
// initialize temp emission map
- if(!(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW))
+ if (!(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW))
{
int i;
temp_emission_map = MEM_callocN(sizeof(float) * sds->res[0]*sds->res[1]*sds->res[2], "SmokeTempEmission");
@@ -1044,10 +1042,10 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
}
// mostly copied from particle code
- if(psys->part->type==PART_HAIR)
+ if (psys->part->type==PART_HAIR)
{
/*
- if(psys->childcache)
+ if (psys->childcache)
{
totchild = psys->totchildcache;
}
@@ -1060,7 +1058,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
else
totchild=psys->totchild*psys->part->disp/100;
- for(p=0; p<totpart+totchild; p++)
+ for (p=0; p<totpart+totchild; p++)
{
int cell[3];
size_t i = 0;
@@ -1068,22 +1066,21 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
int badcell = 0;
ParticleKey state;
- if(p < totpart)
+ if (p < totpart)
{
- if(psys->particles[p].flag & (PARS_NO_DISP|PARS_UNEXIST))
+ if (psys->particles[p].flag & (PARS_NO_DISP|PARS_UNEXIST))
continue;
}
- else
- {
+ else {
/* handle child particle */
ChildParticle *cpa = &psys->child[p - totpart];
- if(psys->particles[cpa->parent].flag & (PARS_NO_DISP|PARS_UNEXIST))
+ if (psys->particles[cpa->parent].flag & (PARS_NO_DISP|PARS_UNEXIST))
continue;
}
state.time = smd->time;
- if(psys_get_particle_state(&sim, p, &state, 0) == 0)
+ if (psys_get_particle_state(&sim, p, &state, 0) == 0)
continue;
// copy_v3_v3(pos, pa->state.co);
@@ -1091,19 +1088,19 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
// 1. get corresponding cell
get_cell(smd->domain->p0, smd->domain->res, smd->domain->dx, state.co, cell, 0);
// check if cell is valid (in the domain boundary)
- for(i = 0; i < 3; i++)
+ for (i = 0; i < 3; i++)
{
- if((cell[i] > sds->res[i] - 1) || (cell[i] < 0))
+ if ((cell[i] > sds->res[i] - 1) || (cell[i] < 0))
{
badcell = 1;
break;
}
}
- if(badcell)
+ if (badcell)
continue;
// 2. set cell values (heat, density and velocity)
index = smoke_get_index(cell[0], sds->res[0], cell[1], sds->res[1], cell[2]);
- if(!(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW) && !(obstacle[index])) // this is inflow
+ if (!(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW) && !(obstacle[index])) // this is inflow
{
// heat[index] += sfs->temp * 0.1;
// density[index] += sfs->density * 0.1;
@@ -1113,14 +1110,14 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
temp_emission_map[index] = sfs->density;
// Uses particle velocity as initial velocity for smoke
- if(sfs->flags & MOD_SMOKE_FLOW_INITVELOCITY && (psys->part->phystype != PART_PHYS_NO))
+ if (sfs->flags & MOD_SMOKE_FLOW_INITVELOCITY && (psys->part->phystype != PART_PHYS_NO))
{
velocity_x[index] = state.vel[0]*sfs->vel_multi;
velocity_y[index] = state.vel[1]*sfs->vel_multi;
velocity_z[index] = state.vel[2]*sfs->vel_multi;
}
}
- else if(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW) // outflow
+ else if (sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW) // outflow
{
heat[index] = 0.f;
density[index] = 0.f;
@@ -1128,15 +1125,15 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
velocity_y[index] = 0.f;
velocity_z[index] = 0.f;
// we need different handling for the high-res feature
- if(bigdensity)
+ if (bigdensity)
{
// init all surrounding cells according to amplification, too
int i, j, k;
smoke_turbulence_get_res(smd->domain->wt, bigres);
- for(i = 0; i < smd->domain->amplify + 1; i++)
- for(j = 0; j < smd->domain->amplify + 1; j++)
- for(k = 0; k < smd->domain->amplify + 1; k++)
+ for (i = 0; i < smd->domain->amplify + 1; i++)
+ for (j = 0; j < smd->domain->amplify + 1; j++)
+ for (k = 0; k < smd->domain->amplify + 1; k++)
{
index = smoke_get_index((smd->domain->amplify + 1)* cell[0] + i, bigres[0], (smd->domain->amplify + 1)* cell[1] + j, bigres[1], (smd->domain->amplify + 1)* cell[2] + k);
bigdensity[index] = 0.f;
@@ -1147,7 +1144,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
// apply emission values
- if(!(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW)) {
+ if (!(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW)) {
// initialize variables
int ii, jj, kk, x, y, z, block_size;
@@ -1158,12 +1155,12 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
// loop through every low res cell
- for(x = 0; x < sds->res[0]; x++)
- for(y = 0; y < sds->res[1]; y++)
- for(z = 0; z < sds->res[2]; z++)
+ for (x = 0; x < sds->res[0]; x++)
+ for (y = 0; y < sds->res[1]; y++)
+ for (z = 0; z < sds->res[2]; z++)
{
- // neighbour cell emission densities (for high resolution smoke smooth interpolation)
+ // neighbor cell emission densities (for high resolution smoke smooth interpolation)
float c000, c001, c010, c011, c100, c101, c110, c111;
c000 = (x>0 && y>0 && z>0) ? temp_emission_map[smoke_get_index(x-1, sds->res[0], y-1, sds->res[1], z-1)] : 0;
@@ -1196,9 +1193,9 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
loop through high res blocks if high res enabled
*/
if (bigdensity)
- for(ii = 0; ii < block_size; ii++)
- for(jj = 0; jj < block_size; jj++)
- for(kk = 0; kk < block_size; kk++)
+ for (ii = 0; ii < block_size; ii++)
+ for (jj = 0; jj < block_size; jj++)
+ for (kk = 0; kk < block_size; kk++)
{
float fx,fy,fz, interpolated_value;
@@ -1272,10 +1269,9 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
}
- else
- {
+ else {
/*
- for()
+ for ()
{
// no psys
BVHTreeNearest nearest;
@@ -1287,7 +1283,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
}
}
}
- if(sds->fluid_group)
+ if (sds->fluid_group)
go = go->next;
else
base= base->next;
@@ -1298,7 +1294,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
{
ListBase *effectors = pdInitEffectors(scene, ob, NULL, sds->effector_weights);
- if(effectors)
+ if (effectors)
{
float *density = smoke_get_density(sds->fluid);
float *force_x = smoke_get_force_x(sds->fluid);
@@ -1310,15 +1306,15 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
int x, y, z;
// precalculate wind forces
- for(x = 0; x < sds->res[0]; x++)
- for(y = 0; y < sds->res[1]; y++)
- for(z = 0; z < sds->res[2]; z++)
+ for (x = 0; x < sds->res[0]; x++)
+ for (y = 0; y < sds->res[1]; y++)
+ for (z = 0; z < sds->res[2]; z++)
{
EffectedPoint epoint;
float voxelCenter[3] = {0,0,0} , vel[3] = {0,0,0} , retvel[3] = {0,0,0};
unsigned int index = smoke_get_index(x, sds->res[0], y, sds->res[1], z);
- if(density[index] < FLT_EPSILON)
+ if (density[index] < FLT_EPSILON)
continue;
vel[0] = velocity_x[index];
@@ -1345,12 +1341,12 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
}
void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedMesh *dm)
{
- if((smd->type & MOD_SMOKE_TYPE_FLOW))
+ if ((smd->type & MOD_SMOKE_TYPE_FLOW))
{
- if(scene->r.cfra >= smd->time)
+ if (scene->r.cfra >= smd->time)
smokeModifier_init(smd, ob, scene, dm);
- if(scene->r.cfra > smd->time)
+ if (scene->r.cfra > smd->time)
{
// XXX TODO
smd->time = scene->r.cfra;
@@ -1361,24 +1357,24 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
copy_m4_m4(smd->flow->mat, ob->obmat);
*/
}
- else if(scene->r.cfra < smd->time)
+ else if (scene->r.cfra < smd->time)
{
smd->time = scene->r.cfra;
smokeModifier_reset(smd);
}
}
- else if(smd->type & MOD_SMOKE_TYPE_COLL)
+ else if (smd->type & MOD_SMOKE_TYPE_COLL)
{
- if(scene->r.cfra >= smd->time)
+ if (scene->r.cfra >= smd->time)
smokeModifier_init(smd, ob, scene, dm);
- if(scene->r.cfra > smd->time)
+ if (scene->r.cfra > smd->time)
{
// XXX TODO
smd->time = scene->r.cfra;
#ifdef USE_SMOKE_COLLISION_DM
- if(smd->coll->dm)
+ if (smd->coll->dm)
smd->coll->dm->release(smd->coll->dm);
smd->coll->dm = CDDM_copy_from_tessface(dm);
@@ -1388,13 +1384,13 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
copy_m4_m4(smd->coll->mat_old, smd->coll->mat);
copy_m4_m4(smd->coll->mat, ob->obmat);
}
- else if(scene->r.cfra < smd->time)
+ else if (scene->r.cfra < smd->time)
{
smd->time = scene->r.cfra;
smokeModifier_reset(smd);
}
}
- else if(smd->type & MOD_SMOKE_TYPE_DOMAIN)
+ else if (smd->type & MOD_SMOKE_TYPE_DOMAIN)
{
SmokeDomainSettings *sds = smd->domain;
float light[3];
@@ -1411,14 +1407,14 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
BKE_ptcache_id_from_smoke(&pid, ob, smd);
BKE_ptcache_id_time(&pid, scene, framenr, &startframe, &endframe, &timescale);
- if(!smd->domain->fluid || framenr == startframe)
+ if (!smd->domain->fluid || framenr == startframe)
{
BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
BKE_ptcache_validate(cache, framenr);
cache->flag &= ~PTCACHE_REDO_NEEDED;
}
- if(!smd->domain->fluid && (framenr != startframe) && (smd->domain->flags & MOD_SMOKE_FILE_LOAD)==0 && (cache->flag & PTCACHE_BAKED)==0)
+ if (!smd->domain->fluid && (framenr != startframe) && (smd->domain->flags & MOD_SMOKE_FILE_LOAD)==0 && (cache->flag & PTCACHE_BAKED)==0)
return;
smd->domain->flags &= ~MOD_SMOKE_FILE_LOAD;
@@ -1431,21 +1427,21 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
// printf("startframe: %d, framenr: %d\n", startframe, framenr);
- if(smokeModifier_init(smd, ob, scene, dm)==0)
+ if (smokeModifier_init(smd, ob, scene, dm)==0)
{
printf("bad smokeModifier_init\n");
return;
}
/* try to read from cache */
- if(BKE_ptcache_read(&pid, (float)framenr) == PTCACHE_READ_EXACT) {
+ if (BKE_ptcache_read(&pid, (float)framenr) == PTCACHE_READ_EXACT) {
BKE_ptcache_validate(cache, framenr);
smd->time = framenr;
return;
}
/* only calculate something when we advanced a single frame */
- if(framenr != (int)smd->time+1)
+ if (framenr != (int)smd->time+1)
return;
/* don't simulate if viewing start frame, but scene frame is not real start frame */
@@ -1457,14 +1453,14 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
smoke_calc_domain(scene, ob, smd);
/* if on second frame, write cache for first frame */
- if((int)smd->time == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0)) {
+ if ((int)smd->time == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0)) {
// create shadows straight after domain initialization so we get nice shadows for startframe, too
- if(get_lamp(scene, light))
+ if (get_lamp(scene, light))
smoke_calc_transparency(sds->shadow, smoke_get_density(sds->fluid), sds->p0, sds->p1, sds->res, sds->dx, light, calc_voxel_transp, -7.0*sds->dx);
- if(sds->wt)
+ if (sds->wt)
{
- if(sds->flags & MOD_SMOKE_DISSOLVE)
+ if (sds->flags & MOD_SMOKE_DISSOLVE)
smoke_dissolve_wavelet(sds->wt, sds->diss_speed, sds->flags & MOD_SMOKE_DISSOLVE_LOG);
smoke_turbulence_step(sds->wt, sds->fluid);
}
@@ -1481,26 +1477,26 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
// simulate the actual smoke (c++ code in intern/smoke)
// DG: interesting commenting this line + deactivating loading of noise files
- if(framenr!=startframe)
+ if (framenr!=startframe)
{
- if(sds->flags & MOD_SMOKE_DISSOLVE)
+ if (sds->flags & MOD_SMOKE_DISSOLVE)
smoke_dissolve(sds->fluid, sds->diss_speed, sds->flags & MOD_SMOKE_DISSOLVE_LOG);
smoke_step(sds->fluid, smd->time, scene->r.frs_sec / scene->r.frs_sec_base);
}
// create shadows before writing cache so they get stored
- if(get_lamp(scene, light))
+ if (get_lamp(scene, light))
smoke_calc_transparency(sds->shadow, smoke_get_density(sds->fluid), sds->p0, sds->p1, sds->res, sds->dx, light, calc_voxel_transp, -7.0*sds->dx);
- if(sds->wt)
+ if (sds->wt)
{
- if(sds->flags & MOD_SMOKE_DISSOLVE)
+ if (sds->flags & MOD_SMOKE_DISSOLVE)
smoke_dissolve_wavelet(sds->wt, sds->diss_speed, sds->flags & MOD_SMOKE_DISSOLVE_LOG);
smoke_turbulence_step(sds->wt, sds->fluid);
}
BKE_ptcache_validate(cache, framenr);
- if(framenr != startframe)
+ if (framenr != startframe)
BKE_ptcache_write(&pid, framenr);
tend();
@@ -1515,7 +1511,7 @@ static float calc_voxel_transp(float *result, float *input, int res[3], int *pix
// T_ray *= T_vox
*tRay *= exp(input[index]*correct);
- if(result[index] < 0.0f)
+ if (result[index] < 0.0f)
{
#pragma omp critical
result[index] = *tRay;
@@ -1569,7 +1565,7 @@ static void bresenham_linie_3D(int x1, int y1, int z1, int x2, int y2, int z2, f
err_1 = dy2 - l;
err_2 = dz2 - l;
for (i = 0; i < l; i++) {
- if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON)
+ if (cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON)
break;
if (err_1 > 0) {
pixel[1] += y_inc;
@@ -1583,11 +1579,12 @@ static void bresenham_linie_3D(int x1, int y1, int z1, int x2, int y2, int z2, f
err_2 += dz2;
pixel[0] += x_inc;
}
- } else if ((m >= l) && (m >= n)) {
+ }
+ else if ((m >= l) && (m >= n)) {
err_1 = dx2 - m;
err_2 = dz2 - m;
for (i = 0; i < m; i++) {
- if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON)
+ if (cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON)
break;
if (err_1 > 0) {
pixel[0] += x_inc;
@@ -1601,11 +1598,12 @@ static void bresenham_linie_3D(int x1, int y1, int z1, int x2, int y2, int z2, f
err_2 += dz2;
pixel[1] += y_inc;
}
- } else {
+ }
+ else {
err_1 = dy2 - n;
err_2 = dx2 - n;
for (i = 0; i < n; i++) {
- if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON)
+ if (cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON)
break;
if (err_1 > 0) {
pixel[1] += y_inc;
@@ -1630,14 +1628,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]);
@@ -1649,7 +1645,7 @@ static void smoke_calc_transparency(float *result, float *input, float *p0, floa
float bv[6];
int a, z, slabsize=res[0]*res[1], size= res[0]*res[1]*res[2];
- for(a=0; a<size; a++)
+ for (a=0; a<size; a++)
result[a]= -1.0f;
bv[0] = p0[0];
@@ -1662,33 +1658,32 @@ static void smoke_calc_transparency(float *result, float *input, float *p0, floa
bv[5] = p1[2];
#pragma omp parallel for schedule(static,1)
- for(z = 0; z < res[2]; z++)
+ for (z = 0; z < res[2]; z++)
{
size_t index = z*slabsize;
int x,y;
- for(y = 0; y < res[1]; y++)
- for(x = 0; x < res[0]; x++, index++)
+ for (y = 0; y < res[1]; y++)
+ for (x = 0; x < res[0]; x++, index++)
{
float voxelCenter[3];
float pos[3];
int cell[3];
float tRay = 1.0;
- if(result[index] >= 0.0f)
+ if (result[index] >= 0.0f)
continue;
voxelCenter[0] = p0[0] + dx * x + dx * 0.5;
voxelCenter[1] = p0[1] + dx * y + dx * 0.5;
voxelCenter[2] = p0[2] + dx * z + dx * 0.5;
// get starting position (in voxel coords)
- if(BLI_bvhtree_bb_raycast(bv, light, voxelCenter, pos) > FLT_EPSILON)
+ if (BLI_bvhtree_bb_raycast(bv, light, voxelCenter, pos) > FLT_EPSILON)
{
// 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 063a274715c..dc7a211a3c1 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -236,7 +236,7 @@ static float _final_goal(Object *ob,BodyPoint *bp)/*jow_go_for2_5 */
return (f);
}
}
- printf("_final_goal failed! sb or bp ==NULL \n" );
+ printf("_final_goal failed! sb or bp ==NULL\n" );
return f; /*using crude but spot able values some times helps debuggin */
}
@@ -248,7 +248,7 @@ static float _final_mass(Object *ob,BodyPoint *bp)
return(bp->mass*sb->nodemass);
}
}
- printf("_final_mass failed! sb or bp ==NULL \n" );
+ printf("_final_mass failed! sb or bp ==NULL\n" );
return 1.0f;
}
/* helper functions for everything is animateble jow_go_for2_5 ------*/
@@ -860,7 +860,7 @@ static void renew_softbody(Scene *scene, Object *ob, int totpoint, int totspring
if (totspring)
sb->bspring= MEM_mallocN( totspring*sizeof(BodySpring), "bodyspring");
- /* initialise BodyPoint array */
+ /* initialize BodyPoint array */
for (i=0; i<totpoint; i++) {
BodyPoint *bp = &sb->bpoint[i];
@@ -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
@@ -988,7 +988,7 @@ static void Vec3PlusStVec(float *v, float s, float *v1)
v[2] += s*v1[2];
}
-/* +++ dependancy information functions*/
+/* +++ dependency information functions*/
static int are_there_deflectors(Scene *scene, unsigned int layer)
{
@@ -1007,7 +1007,7 @@ static int query_external_colliders(Scene *scene, Object *me)
{
return(are_there_deflectors(scene, me->lay));
}
-/* --- dependancy information functions*/
+/* --- dependency information functions*/
/* +++ the aabb "force" section*/
@@ -1055,7 +1055,7 @@ static int sb_detect_aabb_collisionCached( float UNUSED(force[3]), unsigned int
(aabbmin[0] > ccdm->bbmax[0]) ||
(aabbmin[1] > ccdm->bbmax[1]) ||
(aabbmin[2] > ccdm->bbmax[2]) ) {
- /* boxes dont intersect */
+ /* boxes don't intersect */
BLI_ghashIterator_step(ihash);
continue;
}
@@ -1065,9 +1065,9 @@ static int sb_detect_aabb_collisionCached( float UNUSED(force[3]), unsigned int
deflected = 2;
}
- else{
+ else {
/*aye that should be cached*/
- printf("missing cache error \n");
+ printf("missing cache error\n");
BLI_ghashIterator_step(ihash);
continue;
}
@@ -1126,15 +1126,15 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
(aabbmin[0] > ccdm->bbmax[0]) ||
(aabbmin[1] > ccdm->bbmax[1]) ||
(aabbmin[2] > ccdm->bbmax[2]) ) {
- /* boxes dont intersect */
+ /* boxes don't intersect */
BLI_ghashIterator_step(ihash);
continue;
}
}
- else{
+ else {
/*aye that should be cached*/
- printf("missing cache error \n");
+ printf("missing cache error\n");
BLI_ghashIterator_step(ihash);
continue;
}
@@ -1142,7 +1142,7 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
/* use mesh*/
if (mvert) {
- while(a) {
+ while (a) {
copy_v3_v3(nv1,mvert[a-1].co);
if (mprevvert) {
mul_v3_fl(nv1,time);
@@ -1169,7 +1169,7 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
}
}
a--;
- }/* while(a)*/
+ }/* while (a)*/
} /* if (mvert) */
} /* if (ob->pd && ob->pd->deflect) */
BLI_ghashIterator_step(ihash);
@@ -1221,15 +1221,15 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
(aabbmin[0] > ccdm->bbmax[0]) ||
(aabbmin[1] > ccdm->bbmax[1]) ||
(aabbmin[2] > ccdm->bbmax[2]) ) {
- /* boxes dont intersect */
+ /* boxes don't intersect */
BLI_ghashIterator_step(ihash);
continue;
}
}
- else{
+ else {
/*aye that should be cached*/
- printf("missing cache error \n");
+ printf("missing cache error\n");
BLI_ghashIterator_step(ihash);
continue;
}
@@ -1449,15 +1449,15 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
(aabbmin[0] > ccdm->bbmax[0]) ||
(aabbmin[1] > ccdm->bbmax[1]) ||
(aabbmin[2] > ccdm->bbmax[2]) ) {
- /* boxes dont intersect */
+ /* boxes don't intersect */
BLI_ghashIterator_step(ihash);
continue;
}
}
- else{
+ else {
/*aye that should be cached*/
- printf("missing cache error \n");
+ printf("missing cache error\n");
BLI_ghashIterator_step(ihash);
continue;
}
@@ -1601,12 +1601,12 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
add_v3_v3(vel, speed);
}
/* media in rest */
- else{
+ else {
add_v3_v3v3(vel, sb->bpoint[bs->v1].vec , sb->bpoint[bs->v2].vec);
}
f = normalize_v3(vel);
f = -0.0001f*f*f*sb->aeroedge;
- /* (todo) add a nice angle dependant function done for now BUT */
+ /* (todo) add a nice angle dependent function done for now BUT */
/* still there could be some nice drag/lift function, but who needs it */
sub_v3_v3v3(sp, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos);
@@ -1617,7 +1617,7 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
normalize_v3(sp);
Vec3PlusStVec(bs->ext_force,f*(1.0f-ABS(dot_v3v3(vel,sp))),vel);
}
- else{
+ else {
Vec3PlusStVec(bs->ext_force,f,vel); // to keep compatible with 2.45 release files
}
}
@@ -1792,9 +1792,9 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
continue;
}
}
- else{
+ else {
/*aye that should be cached*/
- printf("missing cache error \n");
+ printf("missing cache error\n");
BLI_ghashIterator_step(ihash);
continue;
}
@@ -2048,7 +2048,7 @@ static void dfdx_spring(int ia, int ic, int op, float dir[3],float L,float len,f
nlMatrixAdd(ia+i,op+ic+j,m);
}
}
- else{
+ else {
for (i=0;i<3;i++)
for (j=0;j<3;j++) {
m=factor*dir[i]*dir[j];
@@ -2097,7 +2097,7 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float UN
ic =3*bs->v1;
#endif
}
- else{
+ else {
/* TODO make this debug option */
/**/
printf("bodypoint <bpi> is not attached to spring <*bs> --> sb_spring_force()\n");
@@ -2185,7 +2185,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
/* --- could be done on object level to squeeze out the last bits of it */
}
else {
- printf("Error expected a SB here \n");
+ printf("Error expected a SB here\n");
return (999);
}
@@ -2217,7 +2217,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
compare = (obp->colball + bp->colball);
sub_v3_v3v3(def, bp->pos, obp->pos);
/* rather check the AABBoxes before ever calulating the real distance */
- /* mathematically it is completly nuts, but performace is pretty much (3) times faster */
+ /* mathematically it is completly nuts, but performance is pretty much (3) times faster */
if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue;
distance = normalize_v3(def);
if (distance < compare ) {
@@ -2395,7 +2395,7 @@ static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float t
totthread--;
}
- /* printf("sb_cf_threads_run spawning %d threads \n",totthread); */
+ /* printf("sb_cf_threads_run spawning %d threads\n",totthread); */
sb_threads= MEM_callocN(sizeof(SB_thread_context)*totthread, "SBThread");
memset(sb_threads, 0, sizeof(SB_thread_context)*totthread);
@@ -2490,7 +2490,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
softbody_calc_forcesEx(scene, ob, forcetime, timenow, nl_flags);
return;
}
- else{
+ else {
/* so the following will die */
/* |||||||||||||||||||||||||| */
/* VVVVVVVVVVVVVVVVVVVVVVVVVV */
@@ -2588,7 +2588,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
sub_v3_v3v3(def, bp->pos, obp->pos);
/* rather check the AABBoxes before ever calulating the real distance */
- /* mathematically it is completly nuts, but performace is pretty much (3) times faster */
+ /* mathematically it is completly nuts, but performance is pretty much (3) times faster */
if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue;
distance = normalize_v3(def);
@@ -2756,13 +2756,13 @@ 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
*/
Vec3PlusStVec(bp->pos,-intrusion,facenormal);
}
- else{
+ else {
sub_v3_v3v3(cfforce,bp->vec,vel);
Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
@@ -2773,7 +2773,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
bp->loc_flag |= SBF_DOFUZZY;
bp->choke = sb->choke*0.01f;
}
- else{
+ else {
sub_v3_v3v3(cfforce,bp->vec,vel);
Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
}
@@ -2873,8 +2873,8 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
}
*/
}
- else{
- printf("Matrix inversion failed \n");
+ else {
+ printf("Matrix inversion failed\n");
for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
copy_v3_v3(bp->impdv,bp->force);
}
@@ -2963,7 +2963,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
if ((dot_v3v3(dx,dx)<freezeloc )&&(dot_v3v3(bp->force,bp->force)<freezeforce )) {
bp->frozen /=2;
}
- else{
+ else {
bp->frozen = MIN2(bp->frozen*1.05f,1.0f);
}
mul_v3_fl(dx,bp->frozen);
@@ -3017,7 +3017,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
*err = MAX2(maxerrpos,maxerrvel);
else
*err = maxerrpos;
- //printf("EP %f EV %f \n",maxerrpos,maxerrvel);
+ //printf("EP %f EV %f\n",maxerrpos,maxerrvel);
if (fuzzy) {
*err /= sb->fuzzyness;
}
@@ -3289,13 +3289,13 @@ 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 */
// bp->goal= sb->mingoal + bp->goal*goalfac; /* do not do here jow_go_for2_5 */
}
- else{
+ else {
/* in consequence if no group was set .. but we want to animate it laters */
/* logically attach to goal with default first */
if (ob->softflag & OB_SB_GOAL) {bp->goal = sb->defgoal;}
@@ -3308,11 +3308,11 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
if (sb->namedVG_Mass[0])
{
int grp= defgroup_name_index (ob,sb->namedVG_Mass);
- /* printf("VGN %s %d \n",sb->namedVG_Mass,grp); */
+ /* printf("VGN %s %d\n",sb->namedVG_Mass,grp); */
if (grp > -1) {
get_scalar_from_vertexgroup(ob, a,(short) (grp), &bp->mass);
/* 2.5 bp->mass = bp->mass * sb->nodemass; */
- /* printf("bp->mass %f \n",bp->mass); */
+ /* printf("bp->mass %f\n",bp->mass); */
}
}
@@ -3322,10 +3322,10 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
if (sb->namedVG_Spring_K[0])
{
int grp= defgroup_name_index (ob,sb->namedVG_Spring_K);
- //printf("VGN %s %d \n",sb->namedVG_Spring_K,grp);
+ //printf("VGN %s %d\n",sb->namedVG_Spring_K,grp);
if (grp > -1) {
get_scalar_from_vertexgroup(ob, a,(short) (grp), &bp->springweight);
- //printf("bp->springweight %f \n",bp->springweight);
+ //printf("bp->springweight %f\n",bp->springweight);
}
}
@@ -3405,7 +3405,7 @@ static void reference_to_scratch(Object *ob)
}
mul_v3_fl(accu_pos,1.0f/accu_mass);
copy_v3_v3(sb->scratch->Ref.com,accu_pos);
- /* printf("reference_to_scratch \n"); */
+ /* printf("reference_to_scratch\n"); */
}
/*
@@ -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) {
@@ -3610,13 +3610,13 @@ static void curve_surf_to_softbody(Scene *scene, Object *ob)
bs->v1= curindex;
bs->v2= curindex+1;
bs->springtype=SB_HANDLE;
- bs->len= globallen( bezt->vec[0], bezt->vec[1], ob );
+ bs->len= globallen(bezt->vec[0], bezt->vec[1], ob);
bs++;
bs->v1= curindex+1;
bs->v2= curindex+2;
bs->springtype=SB_HANDLE;
- bs->len= globallen( bezt->vec[1], bezt->vec[2], ob );
+ bs->len= globallen(bezt->vec[1], bezt->vec[2], ob);
bs++;
}
}
@@ -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 */
@@ -4013,7 +4012,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
interpolate_exciter(ob, 2, 2);
softbody_apply_goalsnap(ob);
- // if (G.f & G_DEBUG) {
+ // if (G.debug & G_DEBUG) {
if (sb->solverflags & SBSO_MONITOR ) {
if (loops > HEUNWARNLIMIT) /* monitor high loop counts */
printf("\r needed %d steps/frame",loops);
@@ -4033,14 +4032,14 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
//removed
}/*SOLVER SELECT*/
- else{
+ else {
printf("softbody no valid solver ID!");
}/*SOLVER SELECT*/
if (sb->plastic) { apply_spring_memory(ob);}
if (sb->solverflags & SBSO_MONITOR ) {
sct=PIL_check_seconds_timer();
- if ((sct-sst > 0.5f) || (G.f & G_DEBUG)) printf(" solver time %f sec %s \n",sct-sst,ob->id.name);
+ if ((sct-sst > 0.5f) || (G.debug & G_DEBUG)) printf(" solver time %f sec %s\n",sct-sst,ob->id.name);
}
}
@@ -4133,7 +4132,7 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
}
/* try to read from cache */
- cache_result = BKE_ptcache_read(&pid, framenr);
+ cache_result = BKE_ptcache_read(&pid, (float)framenr+scene->r.subframe);
if (cache_result == PTCACHE_READ_EXACT || cache_result == PTCACHE_READ_INTERPOLATED) {
softbody_to_object(ob, vertexCos, numVerts, sb->local);
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 594c7a9a2f3..c2dbb518837 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -86,7 +86,7 @@ struct bSound* sound_new_file(struct Main *bmain, const char *filename)
BLI_path_abs(str, path);
len = strlen(filename);
- while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\')
+ while (len > 0 && filename[len-1] != '/' && filename[len-1] != '\\')
len--;
sound = alloc_libblock(&bmain->sound, ID_SO, filename+len);
@@ -141,7 +141,7 @@ static void sound_sync_callback(void* data, int mode, float time)
struct Scene* scene;
scene = bmain->scene.first;
- while(scene)
+ while (scene)
{
if (scene->audio.flag & AUDIO_SYNC)
{
@@ -351,7 +351,7 @@ void sound_load(struct Main *bmain, struct bSound* sound)
/* load sound */
PackedFile* pf = sound->packedfile;
- /* dont modify soundact->sound->name, only change a copy */
+ /* don't modify soundact->sound->name, only change a copy */
BLI_strncpy(fullpath, sound->name, sizeof(fullpath));
BLI_path_abs(fullpath, ID_BLEND_PATH(bmain, &sound->id));
@@ -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);
@@ -770,7 +765,7 @@ void sound_update_scene(struct Scene* scene)
}
}
- while((handle = AUD_getSet(scene->speaker_handles)))
+ while ((handle = AUD_getSet(scene->speaker_handles)))
{
AUD_removeSequence(scene->sound_scene, handle);
}
diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c
index d2c8a8031ee..5466630f621 100644
--- a/source/blender/blenkernel/intern/speaker.c
+++ b/source/blender/blenkernel/intern/speaker.c
@@ -70,7 +70,7 @@ Speaker *copy_speaker(Speaker *spk)
Speaker *spkn;
spkn= copy_libblock(&spk->id);
- if(spkn->sound)
+ if (spkn->sound)
spkn->sound->id.us++;
return spkn;
@@ -83,29 +83,29 @@ 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) {
+ if (spk->id.lib==NULL) return;
+ if (spk->id.us==1) {
id_clear_lib_data(bmain, &spk->id);
return;
}
ob= bmain->object.first;
- while(ob) {
- if(ob->data==spk) {
- if(ob->id.lib) is_lib= TRUE;
+ while (ob) {
+ if (ob->data==spk) {
+ if (ob->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
ob= ob->id.next;
}
- if(is_local && is_lib == FALSE) {
+ if (is_local && is_lib == FALSE) {
id_clear_lib_data(bmain, &spk->id);
}
- else if(is_local && is_lib) {
+ else if (is_local && is_lib) {
Speaker *spk_new= copy_speaker(spk);
spk_new->id.us= 0;
@@ -113,10 +113,10 @@ void make_local_speaker(Speaker *spk)
BKE_id_lib_local_paths(bmain, spk->id.lib, &spk_new->id);
ob= bmain->object.first;
- while(ob) {
- if(ob->data==spk) {
+ while (ob) {
+ if (ob->data==spk) {
- if(ob->id.lib==NULL) {
+ if (ob->id.lib==NULL) {
ob->data= spk_new;
spk_new->id.us++;
spk->id.us--;
@@ -129,7 +129,7 @@ void make_local_speaker(Speaker *spk)
void free_speaker(Speaker *spk)
{
- if(spk->sound)
+ if (spk->sound)
spk->sound->id.us--;
BKE_free_animdata((ID *)spk);
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index a63dfa486d4..6e0149553a2 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -45,6 +45,7 @@
#include "DNA_scene_types.h"
#include "BLI_utildefines.h"
+#include "BLI_bitmap.h"
#include "BLI_blenlib.h"
#include "BLI_edgehash.h"
#include "BLI_math.h"
@@ -55,6 +56,7 @@
#include "BKE_global.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
+#include "BKE_multires.h"
#include "BKE_paint.h"
#include "BKE_scene.h"
#include "BKE_subsurf.h"
@@ -128,7 +130,8 @@ static CCGSubSurf *_getSubSurf(CCGSubSurf *prevSS, int subdivLevels, CCGFlags fl
if (oldUseAging!=useAging) {
ccgSubSurf_free(prevSS);
- } else {
+ }
+ else {
ccgSubSurf_setSubdivisionLevels(prevSS, subdivLevels);
return prevSS;
@@ -137,7 +140,8 @@ static CCGSubSurf *_getSubSurf(CCGSubSurf *prevSS, int subdivLevels, CCGFlags fl
if (useAging) {
ifc.vertUserSize = ifc.edgeUserSize = ifc.faceUserSize = 12;
- } else {
+ }
+ else {
ifc.vertUserSize = ifc.edgeUserSize = ifc.faceUserSize = 8;
}
ifc.vertDataSize = sizeof(float) * (flags & CCG_CALC_NORMALS ? 6 : 3);
@@ -152,7 +156,8 @@ static CCGSubSurf *_getSubSurf(CCGSubSurf *prevSS, int subdivLevels, CCGFlags fl
allocatorIFC.release = arena_release;
ccgSS = ccgSubSurf_new(&ifc, subdivLevels, &allocatorIFC, allocator);
- } else {
+ }
+ else {
ccgSS = ccgSubSurf_new(&ifc, subdivLevels, NULL, NULL);
}
@@ -178,9 +183,11 @@ static int getEdgeIndex(CCGSubSurf *ss, CCGEdge *e, int x, int edgeSize)
if (x==0) {
return v0idx;
- } else if (x==edgeSize-1) {
+ }
+ else if (x==edgeSize-1) {
return v1idx;
- } else {
+ }
+ else {
return edgeBase + x-1;
}
}
@@ -191,34 +198,42 @@ 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);
+ }
+ else if (x==gridSize-1) {
+ 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;
- } else {
+ }
+ else {
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);
+ }
+ else if (y==gridSize-1) {
+ 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;
- } else {
+ }
+ else {
return edgeBase + (edgeSize-2-1)-((gridSize-1-x)-1);
}
- } else if (x==0 && y==0) {
+ }
+ else if (x==0 && y==0) {
return faceBase;
- } else if (x==0) {
+ }
+ else if (x==0) {
S = (S+numVerts-1)%numVerts;
return faceBase + 1 + (gridSize-2)*S + (y-1);
- } else if (y==0) {
+ }
+ else if (y==0) {
return faceBase + 1 + (gridSize-2)*S + (x-1);
- } else {
+ }
+ else {
return faceBase + 1 + (gridSize-2)*numVerts + S*(gridSize-2)*(gridSize-2) + (y-1)*(gridSize-2) + (x-1);
}
}
@@ -309,7 +324,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;
@@ -362,13 +377,13 @@ static void set_subsurf_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *result,
MTFace *tface = CustomData_get_layer_n(&result->faceData, CD_MTFACE, n);
MLoopUV *mloopuv = CustomData_get_layer_n(&result->loopData, CD_MLOOPUV, n);
- if(!dmloopuv || (!tface && !mloopuv))
+ if (!dmloopuv || (!tface && !mloopuv))
return;
/* create a CCGSubSurf from uv's */
uvss = _getSubSurf(NULL, ccgSubSurf_getSubdivisionLevels(ss), CCG_USE_ARENA);
- if(!ss_sync_from_uv(uvss, ss, dm, dmloopuv)) {
+ if (!ss_sync_from_uv(uvss, ss, dm, dmloopuv)) {
ccgSubSurf_free(uvss);
return;
}
@@ -383,9 +398,9 @@ static void set_subsurf_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *result,
faceMap = MEM_mallocN(totface*sizeof(*faceMap), "facemapuv");
fi = ccgSubSurf_getFaceIterator(uvss);
- for(; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
+ 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);
@@ -393,36 +408,36 @@ static void set_subsurf_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *result,
tf= tface;
mluv= mloopuv;
- for(index = 0; index < totface; index++) {
+ for (index = 0; index < totface; index++) {
CCGFace *f = faceMap[index];
int numVerts = ccgSubSurf_getFaceNumVerts(f);
for (S=0; S<numVerts; S++) {
float (*faceGridData)[3]= ccgSubSurf_getFaceGridDataArray(uvss, f, S);
- for(y = 0; y < gridFaces; y++) {
- for(x = 0; x < gridFaces; x++) {
+ for (y = 0; y < gridFaces; y++) {
+ for (x = 0; x < gridFaces; x++) {
float *a = faceGridData[(y + 0)*gridSize + x + 0];
float *b = faceGridData[(y + 0)*gridSize + x + 1];
float *c = faceGridData[(y + 1)*gridSize + x + 1];
float *d = faceGridData[(y + 1)*gridSize + x + 0];
- if (tface) {
- tf->uv[0][0] = a[0]; tf->uv[0][1] = a[1];
- tf->uv[1][0] = d[0]; tf->uv[1][1] = d[1];
- tf->uv[2][0] = c[0]; tf->uv[2][1] = c[1];
- tf->uv[3][0] = b[0]; tf->uv[3][1] = b[1];
+ if (tf) {
+ copy_v2_v2(tf->uv[0], a);
+ copy_v2_v2(tf->uv[1], d);
+ copy_v2_v2(tf->uv[2], c);
+ copy_v2_v2(tf->uv[3], b);
+ tf++;
}
- if (mloopuv) {
- mluv[0].uv[0] = a[0]; mluv[0].uv[1] = a[1];
- mluv[1].uv[0] = d[0]; mluv[1].uv[1] = d[1];
- mluv[2].uv[0] = c[0]; mluv[2].uv[1] = c[1];
- mluv[3].uv[0] = b[0]; mluv[3].uv[1] = b[1];
+ if (mluv) {
+ copy_v2_v2(mluv[0].uv, a);
+ copy_v2_v2(mluv[1].uv, d);
+ copy_v2_v2(mluv[2].uv, c);
+ copy_v2_v2(mluv[3].uv, b);
+ mluv += 4;
}
- tf++;
- mluv+=4;
}
}
}
@@ -533,12 +548,13 @@ static void ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm,
mv = mvert;
index = (int *)dm->getVertDataArray(dm, CD_ORIGINDEX);
- for(i = 0; i < totvert; i++, mv++) {
+ for (i = 0; i < totvert; i++, mv++) {
CCGVert *v;
- if(vertexCos) {
+ if (vertexCos) {
ccgSubSurf_syncVert(ss, SET_INT_IN_POINTER(i), vertexCos[i], 0, &v);
- } else {
+ }
+ else {
ccgSubSurf_syncVert(ss, SET_INT_IN_POINTER(i), mv->co, 0, &v);
}
@@ -547,7 +563,7 @@ static void ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm,
me = medge;
index = (int *)dm->getEdgeDataArray(dm, CD_ORIGINDEX);
- for(i = 0; i < totedge; i++, me++) {
+ for (i = 0; i < totedge; i++, me++) {
CCGEdge *e;
float crease;
@@ -577,11 +593,11 @@ static void ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm,
* it is not really possible to continue without modifying
* other parts of code significantly to handle missing faces.
* since this really shouldn't even be possible we just bail.*/
- if(ccgSubSurf_syncFace(ss, SET_INT_IN_POINTER(i), mp->totloop,
+ if (ccgSubSurf_syncFace(ss, SET_INT_IN_POINTER(i), mp->totloop,
fVerts, &f) == eCCGError_InvalidValue) {
static int hasGivenError = 0;
- if(!hasGivenError) {
+ if (!hasGivenError) {
//XXX error("Unrecoverable error in SubSurf calculation,"
// " mesh is inconsistent.");
@@ -700,7 +716,7 @@ static void ccgDM_getFinalVert(DerivedMesh *dm, int vertNum, MVert *mv)
memset(mv, 0, sizeof(*mv));
- if((vertNum < ccgdm->edgeMap[0].startVert) && (ccgSubSurf_getNumFaces(ss) > 0)) {
+ if ((vertNum < ccgdm->edgeMap[0].startVert) && (ccgSubSurf_getNumFaces(ss) > 0)) {
/* this vert comes from face data */
int lastface = ccgSubSurf_getNumFaces(ss) - 1;
CCGFace *f;
@@ -713,7 +729,7 @@ static void ccgDM_getFinalVert(DerivedMesh *dm, int vertNum, MVert *mv)
int gridInternalEnd;
i = 0;
- while(i < lastface && vertNum >= ccgdm->faceMap[i + 1].startVert)
+ while (i < lastface && vertNum >= ccgdm->faceMap[i + 1].startVert)
++i;
f = ccgdm->faceMap[i].face;
@@ -726,18 +742,20 @@ static void ccgDM_getFinalVert(DerivedMesh *dm, int vertNum, MVert *mv)
gridInternalEnd = gridSideEnd + numVerts * gridInternalVerts;
offset = vertNum - ccgdm->faceMap[i].startVert;
- if(offset < 1) {
+ if (offset < 1) {
vd = ccgSubSurf_getFaceCenterData(f);
copy_v3_v3(mv->co, vd->co);
normal_float_to_short_v3(mv->no, vd->no);
- } else if(offset < gridSideEnd) {
+ }
+ else if (offset < gridSideEnd) {
offset -= 1;
grid = offset / gridSideVerts;
x = offset % gridSideVerts + 1;
vd = ccgSubSurf_getFaceGridEdgeData(ss, f, grid, x);
copy_v3_v3(mv->co, vd->co);
normal_float_to_short_v3(mv->no, vd->no);
- } else if(offset < gridInternalEnd) {
+ }
+ else if (offset < gridInternalEnd) {
offset -= gridSideEnd;
grid = offset / gridInternalVerts;
offset %= gridInternalVerts;
@@ -747,14 +765,15 @@ static void ccgDM_getFinalVert(DerivedMesh *dm, int vertNum, MVert *mv)
copy_v3_v3(mv->co, vd->co);
normal_float_to_short_v3(mv->no, vd->no);
}
- } else if((vertNum < ccgdm->vertMap[0].startVert) && (ccgSubSurf_getNumEdges(ss) > 0)) {
+ }
+ else if ((vertNum < ccgdm->vertMap[0].startVert) && (ccgSubSurf_getNumEdges(ss) > 0)) {
/* this vert comes from edge data */
CCGEdge *e;
int lastedge = ccgSubSurf_getNumEdges(ss) - 1;
int x;
i = 0;
- while(i < lastedge && vertNum >= ccgdm->edgeMap[i + 1].startVert)
+ while (i < lastedge && vertNum >= ccgdm->edgeMap[i + 1].startVert)
++i;
e = ccgdm->edgeMap[i].edge;
@@ -763,7 +782,8 @@ static void ccgDM_getFinalVert(DerivedMesh *dm, int vertNum, MVert *mv)
vd = ccgSubSurf_getEdgeData(ss, e, x);
copy_v3_v3(mv->co, vd->co);
normal_float_to_short_v3(mv->no, vd->no);
- } else {
+ }
+ else {
/* this vert comes from vert data */
CCGVert *v;
i = vertNum - ccgdm->vertMap[0].startVert;
@@ -799,7 +819,7 @@ static void ccgDM_getFinalEdge(DerivedMesh *dm, int edgeNum, MEdge *med)
memset(med, 0, sizeof(*med));
- if(edgeNum < ccgdm->edgeMap[0].startEdge) {
+ if (edgeNum < ccgdm->edgeMap[0].startEdge) {
/* this edge comes from face data */
int lastface = ccgSubSurf_getNumFaces(ss) - 1;
CCGFace *f;
@@ -819,9 +839,11 @@ static void ccgDM_getFinalEdge(DerivedMesh *dm, int edgeNum, MEdge *med)
previ = i;
if (ccgdm->faceMap[i].startEdge >= edgeNum) {
i -= fabsf(i-lasti)/2.0f;
- } else if (ccgdm->faceMap[i].startEdge < edgeNum) {
+ }
+ else if (ccgdm->faceMap[i].startEdge < edgeNum) {
i += fabsf(i-lasti)/2.0f;
- } else {
+ }
+ else {
break;
}
@@ -846,7 +868,7 @@ static void ccgDM_getFinalEdge(DerivedMesh *dm, int edgeNum, MEdge *med)
#endif
i = 0;
- while(i < lastface && edgeNum >= ccgdm->faceMap[i + 1].startEdge)
+ while (i < lastface && edgeNum >= ccgdm->faceMap[i + 1].startEdge)
++i;
f = ccgdm->faceMap[i].face;
@@ -859,23 +881,26 @@ static void ccgDM_getFinalEdge(DerivedMesh *dm, int edgeNum, MEdge *med)
grid = offset / (gridSideEdges + gridInternalEdges);
offset %= (gridSideEdges + gridInternalEdges);
- if(offset < gridSideEdges) {
+ if (offset < gridSideEdges) {
x = offset;
med->v1 = getFaceIndex(ss, f, grid, x, 0, edgeSize, gridSize);
med->v2 = getFaceIndex(ss, f, grid, x+1, 0, edgeSize, gridSize);
- } else {
+ }
+ else {
offset -= gridSideEdges;
x = (offset / 2) / gridSideEdges + 1;
y = (offset / 2) % gridSideEdges;
- if(offset % 2 == 0) {
+ if (offset % 2 == 0) {
med->v1 = getFaceIndex(ss, f, grid, x, y, edgeSize, gridSize);
med->v2 = getFaceIndex(ss, f, grid, x, y+1, edgeSize, gridSize);
- } else {
+ }
+ else {
med->v1 = getFaceIndex(ss, f, grid, y, x, edgeSize, gridSize);
med->v2 = getFaceIndex(ss, f, grid, y+1, x, edgeSize, gridSize);
}
}
- } else {
+ }
+ else {
/* this vert comes from edge data */
CCGEdge *e;
int edgeSize = ccgSubSurf_getEdgeSize(ss);
@@ -887,7 +912,7 @@ static void ccgDM_getFinalEdge(DerivedMesh *dm, int edgeNum, MEdge *med)
e = ccgdm->edgeMap[i].edge;
- if(!ccgSubSurf_getEdgeNumFaces(e)) flags |= ME_LOOSEEDGE;
+ if (!ccgSubSurf_getEdgeNumFaces(e)) flags |= ME_LOOSEEDGE;
x = edgeNum - ccgdm->edgeMap[i].startEdge;
@@ -895,7 +920,7 @@ static void ccgDM_getFinalEdge(DerivedMesh *dm, int edgeNum, MEdge *med)
med->v2 = getEdgeIndex(ss, e, x+1, edgeSize);
edgeFlag = (ccgdm->edgeFlags)? &ccgdm->edgeFlags[i]: NULL;
- if(edgeFlag)
+ if (edgeFlag)
flags |= (*edgeFlag & (ME_SEAM | ME_SHARP))
| ME_EDGEDRAW | ME_EDGERENDER;
else
@@ -920,7 +945,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)
@@ -942,13 +967,51 @@ static void ccgDM_getFinalFace(DerivedMesh *dm, int faceNum, MFace *mf)
mf->v3 = getFaceIndex(ss, f, grid, x+1, y+1, edgeSize, gridSize);
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];
+ if (faceFlags) {
+ mf->flag = faceFlags[i].flag;
+ mf->mat_nr = faceFlags[i].mat_nr;
}
else mf->flag = ME_SMOOTH;
}
+/* Translate GridHidden into the ME_HIDE flag for MVerts. Assumes
+ vertices are in the order output by ccgDM_copyFinalVertArray. */
+void subsurf_copy_grid_hidden(DerivedMesh *dm, const MPoly *mpoly,
+ MVert *mvert, const MDisps *mdisps)
+{
+ CCGDerivedMesh *ccgdm = (CCGDerivedMesh*)dm;
+ CCGSubSurf *ss = ccgdm->ss;
+ int level = ccgSubSurf_getSubdivisionLevels(ss);
+ int gridSize = ccgSubSurf_getGridSize(ss);
+ int edgeSize = ccgSubSurf_getEdgeSize(ss);
+ int totface = ccgSubSurf_getNumFaces(ss);
+ int i, j, x, y;
+
+ for (i = 0; i < totface; i++) {
+ CCGFace *f = ccgdm->faceMap[i].face;
+
+ for (j = 0; j < mpoly[i].totloop; j++) {
+ const MDisps *md = &mdisps[mpoly[i].loopstart + j];
+ int hidden_gridsize = ccg_gridsize(md->level);
+ int factor = ccg_factor(level, md->level);
+
+ if (!md->hidden)
+ continue;
+
+ for (y = 0; y < gridSize; y++) {
+ for (x = 0; x < gridSize; x++) {
+ int vndx, offset;
+
+ vndx = getFaceIndex(ss, f, j, x, y, edgeSize, gridSize);
+ offset = (y*factor) * hidden_gridsize + (x*factor);
+ if (BLI_BITMAP_GET(md->hidden, offset))
+ mvert[vndx].flag |= ME_HIDE;
+ }
+ }
+ }
+ }
+}
+
static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
{
CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
@@ -961,7 +1024,7 @@ static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
int i = 0;
totface = ccgSubSurf_getNumFaces(ss);
- for(index = 0; index < totface; index++) {
+ for (index = 0; index < totface; index++) {
CCGFace *f = ccgdm->faceMap[index].face;
int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f);
@@ -970,17 +1033,17 @@ static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
normal_float_to_short_v3(mvert[i].no, vd->no);
i++;
- for(S = 0; S < numVerts; S++) {
- for(x = 1; x < gridSize - 1; x++, i++) {
+ for (S = 0; S < numVerts; S++) {
+ for (x = 1; x < gridSize - 1; x++, i++) {
vd= ccgSubSurf_getFaceGridEdgeData(ss, f, S, x);
copy_v3_v3(mvert[i].co, vd->co);
normal_float_to_short_v3(mvert[i].no, vd->no);
}
}
- for(S = 0; S < numVerts; S++) {
- for(y = 1; y < gridSize - 1; y++) {
- for(x = 1; x < gridSize - 1; x++, i++) {
+ for (S = 0; S < numVerts; S++) {
+ for (y = 1; y < gridSize - 1; y++) {
+ for (x = 1; x < gridSize - 1; x++, i++) {
vd= ccgSubSurf_getFaceGridData(ss, f, S, x, y);
copy_v3_v3(mvert[i].co, vd->co);
normal_float_to_short_v3(mvert[i].no, vd->no);
@@ -990,15 +1053,15 @@ static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
}
totedge = ccgSubSurf_getNumEdges(ss);
- for(index = 0; index < totedge; index++) {
+ for (index = 0; index < totedge; index++) {
CCGEdge *e = ccgdm->edgeMap[index].edge;
int x;
- for(x = 1; x < edgeSize - 1; x++, i++) {
+ for (x = 1; x < edgeSize - 1; x++, i++) {
vd= ccgSubSurf_getEdgeData(ss, e, x);
copy_v3_v3(mvert[i].co, vd->co);
/* This gives errors with -debug-fpe
- * the normals dont seem to be unit length.
+ * the normals don't seem to be unit length.
* this is most likely caused by edges with no
* faces which are now zerod out, see comment in:
* ccgSubSurf__calcVertNormals(), - campbell */
@@ -1007,7 +1070,7 @@ static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
}
totvert = ccgSubSurf_getNumVerts(ss);
- for(index = 0; index < totvert; index++) {
+ for (index = 0; index < totvert; index++) {
CCGVert *v = ccgdm->vertMap[index].vert;
vd= ccgSubSurf_getVertData(ss, v);
@@ -1029,27 +1092,27 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge)
short *edgeFlags = ccgdm->edgeFlags;
totface = ccgSubSurf_getNumFaces(ss);
- for(index = 0; index < totface; index++) {
+ for (index = 0; index < totface; index++) {
CCGFace *f = ccgdm->faceMap[index].face;
int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f);
- for(S = 0; S < numVerts; S++) {
- for(x = 0; x < gridSize - 1; x++) {
+ for (S = 0; S < numVerts; S++) {
+ for (x = 0; x < gridSize - 1; x++) {
MEdge *med = &medge[i];
- if(ccgdm->drawInteriorEdges)
+ if (ccgdm->drawInteriorEdges)
med->flag = ME_EDGEDRAW | ME_EDGERENDER;
med->v1 = getFaceIndex(ss, f, S, x, 0, edgeSize, gridSize);
med->v2 = getFaceIndex(ss, f, S, x + 1, 0, edgeSize, gridSize);
i++;
}
- for(x = 1; x < gridSize - 1; x++) {
- for(y = 0; y < gridSize - 1; y++) {
+ for (x = 1; x < gridSize - 1; x++) {
+ for (y = 0; y < gridSize - 1; y++) {
MEdge *med;
med = &medge[i];
- if(ccgdm->drawInteriorEdges)
+ if (ccgdm->drawInteriorEdges)
med->flag = ME_EDGEDRAW | ME_EDGERENDER;
med->v1 = getFaceIndex(ss, f, S, x, y,
edgeSize, gridSize);
@@ -1058,7 +1121,7 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge)
i++;
med = &medge[i];
- if(ccgdm->drawInteriorEdges)
+ if (ccgdm->drawInteriorEdges)
med->flag = ME_EDGEDRAW | ME_EDGERENDER;
med->v1 = getFaceIndex(ss, f, S, y, x,
edgeSize, gridSize);
@@ -1071,24 +1134,25 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge)
}
totedge = ccgSubSurf_getNumEdges(ss);
- for(index = 0; index < totedge; index++) {
+ for (index = 0; index < totedge; index++) {
CCGEdge *e = ccgdm->edgeMap[index].edge;
unsigned int flags = 0;
int x;
int edgeIdx = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e));
- if(!ccgSubSurf_getEdgeNumFaces(e)) flags |= ME_LOOSEEDGE;
+ if (!ccgSubSurf_getEdgeNumFaces(e)) flags |= ME_LOOSEEDGE;
- if(edgeFlags) {
- if(edgeIdx != -1) {
+ if (edgeFlags) {
+ if (edgeIdx != -1) {
flags |= (edgeFlags[index] & (ME_SEAM | ME_SHARP))
| ME_EDGEDRAW | ME_EDGERENDER;
}
- } else {
+ }
+ else {
flags |= ME_EDGEDRAW | ME_EDGERENDER;
}
- for(x = 0; x < edgeSize - 1; x++) {
+ for (x = 0; x < edgeSize - 1; x++) {
MEdge *med = &medge[i];
med->v1 = getEdgeIndex(ss, e, x, edgeSize);
med->v2 = getEdgeIndex(ss, e, x + 1, edgeSize);
@@ -1107,19 +1171,19 @@ 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++) {
+ 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++) {
- for(x = 0; x < gridSize - 1; x++) {
+ for (S = 0; S < numVerts; S++) {
+ for (y = 0; y < gridSize - 1; y++) {
+ for (x = 0; x < gridSize - 1; x++) {
MFace *mf = &mface[i];
mf->v1 = getFaceIndex(ss, f, S, x + 0, y + 0,
edgeSize, gridSize);
@@ -1149,7 +1213,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;
@@ -1164,15 +1228,15 @@ static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop)
totface = ccgSubSurf_getNumFaces(ss);
mv = mloop;
- for(index = 0; index < totface; index++) {
+ 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; */ /* UNUSED */
/* int mat_nr = (faceFlags)? faceFlags[index*2+1]: 0; */ /* UNUSED */
- for(S = 0; S < numVerts; S++) {
- for(y = 0; y < gridSize - 1; y++) {
- for(x = 0; x < gridSize - 1; x++) {
+ for (S = 0; S < numVerts; S++) {
+ for (y = 0; y < gridSize - 1; y++) {
+ for (x = 0; x < gridSize - 1; x++) {
int v1, v2, v3, v4;
v1 = getFaceIndex(ss, f, S, x + 0, y + 0,
@@ -1215,18 +1279,18 @@ 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++) {
+ 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++) {
- for(x = 0; x < gridSize - 1; x++) {
+ for (S = 0; S < numVerts; S++) {
+ for (y = 0; y < gridSize - 1; y++) {
+ for (x = 0; x < gridSize - 1; x++) {
MPoly *mf = &mface[i];
mf->mat_nr = mat_nr;
@@ -1282,7 +1346,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);
@@ -1413,12 +1477,12 @@ static void ccgDM_drawVerts(DerivedMesh *dm)
static void ccgdm_pbvh_update(CCGDerivedMesh *ccgdm)
{
- if(ccgdm->pbvh && ccgDM_use_grid_pbvh(ccgdm)) {
+ if (ccgdm->pbvh && ccgDM_use_grid_pbvh(ccgdm)) {
CCGFace **faces;
int totface;
BLI_pbvh_get_grid_updates(ccgdm->pbvh, 1, (void***)&faces, &totface);
- if(totface) {
+ if (totface) {
ccgSubSurf_updateFromFaces(ccgdm->ss, 0, faces, totface);
ccgSubSurf_updateNormals(ccgdm->ss, faces, totface);
MEM_freeN(faces);
@@ -1426,7 +1490,7 @@ static void ccgdm_pbvh_update(CCGDerivedMesh *ccgdm)
}
}
-static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int UNUSED(drawAllEdges))
+static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int drawAllEdges)
{
CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
CCGSubSurf *ss = ccgdm->ss;
@@ -1446,7 +1510,7 @@ static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int UNUSED(draw
if (!drawLooseEdges && !ccgSubSurf_getEdgeNumFaces(e))
continue;
- if(ccgdm->edgeFlags && !(ccgdm->edgeFlags[j] & ME_EDGEDRAW))
+ if (!drawAllEdges && ccgdm->edgeFlags && !(ccgdm->edgeFlags[j] & ME_EDGEDRAW))
continue;
if (useAging && !(G.f&G_BACKBUFSEL)) {
@@ -1469,7 +1533,7 @@ static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int UNUSED(draw
if (ccgdm->drawInteriorEdges) {
int totface = ccgSubSurf_getNumFaces(ss);
- for(j = 0; j < totface; j++) {
+ for (j = 0; j < totface; j++) {
CCGFace *f = ccgdm->faceMap[j].face;
int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f);
@@ -1534,48 +1598,43 @@ 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;
ccgdm_pbvh_update(ccgdm);
- 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));
+ if (ccgdm->pbvh && ccgdm->multires.mmd && !fast) {
+ if (dm->numTessFaceData) {
+ BLI_pbvh_draw(ccgdm->pbvh, partial_redraw_planes, NULL, setMaterial);
glShadeModel(GL_FLAT);
}
return;
}
- for(i = 0; i < totface; i++) {
+ 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];
+ if (faceFlags) {
+ new_shademodel = (faceFlags[index].flag & ME_SMOOTH)? GL_SMOOTH: GL_FLAT;
+ new_matnr= faceFlags[index].mat_nr;
}
else {
new_shademodel = GL_SMOOTH;
new_matnr= 0;
}
- if(shademodel != new_shademodel || matnr != new_matnr) {
+ if (shademodel != new_shademodel || matnr != new_matnr) {
matnr= new_matnr;
shademodel= new_shademodel;
@@ -1584,7 +1643,7 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)
glShadeModel(shademodel);
}
- if(!drawcurrent)
+ if (!drawcurrent)
continue;
for (S=0; S<numVerts; S++) {
@@ -1604,7 +1663,8 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)
}
glEnd();
}
- } else {
+ }
+ else {
glBegin(GL_QUADS);
for (y=0; y<gridSize-1; y+=step) {
for (x=0; x<gridSize-1; x+=step) {
@@ -1629,8 +1689,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 +1701,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);
@@ -1650,51 +1710,52 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm,
matnr = -1;
#define PASSATTRIB(dx, dy, vert) { \
- if(attribs.totorco) { \
+ if (attribs.totorco) { \
index = getFaceIndex(ss, f, S, x+dx, y+dy, edgeSize, gridSize); \
glVertexAttrib3fvARB(attribs.orco.glIndex, attribs.orco.array[index]); \
} \
- for(b = 0; b < attribs.tottface; b++) { \
+ for (b = 0; b < attribs.tottface; b++) { \
MTFace *tf = &attribs.tface[b].array[a]; \
glVertexAttrib2fvARB(attribs.tface[b].glIndex, tf->uv[vert]); \
} \
- for(b = 0; b < attribs.totmcol; b++) { \
+ for (b = 0; b < attribs.totmcol; b++) { \
MCol *cp = &attribs.mcol[b].array[a*4 + vert]; \
GLubyte col[4]; \
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; \
glVertexAttrib4ubvARB(attribs.mcol[b].glIndex, col); \
} \
- if(attribs.tottang) { \
+ if (attribs.tottang) { \
float *tang = attribs.tang.array[a*4 + vert]; \
glVertexAttrib4fvARB(attribs.tang.glIndex, tang); \
} \
}
totface = ccgSubSurf_getNumFaces(ss);
- for(a = 0, i = 0; i < totface; i++) {
+ 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;
+ if (faceFlags) {
+ drawSmooth = (faceFlags[index].flag & ME_SMOOTH);
+ new_matnr= faceFlags[index].mat_nr + 1;
}
else {
drawSmooth = 1;
new_matnr= 1;
}
- if(new_matnr != matnr) {
+ if (new_matnr != matnr) {
doDraw = setMaterial(matnr = new_matnr, &gattribs);
- if(doDraw)
+ if (doDraw)
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;
}
@@ -1719,7 +1780,7 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm,
glNormal3fv(vdb->no);
glVertex3fv(vdb->co);
- if(x != gridFaces-1)
+ if (x != gridFaces-1)
a++;
}
@@ -1738,7 +1799,8 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm,
a++;
}
- } else {
+ }
+ else {
glBegin(GL_QUADS);
for (y=0; y<gridFaces; y++) {
for (x=0; x<gridFaces; x++) {
@@ -1769,7 +1831,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 +1846,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);
@@ -1792,45 +1854,45 @@ static void ccgDM_drawMappedFacesMat(DerivedMesh *dm, void (*setMaterial)(void *
matnr = -1;
#define PASSATTRIB(dx, dy, vert) { \
- if(attribs.totorco) { \
+ if (attribs.totorco) { \
index = getFaceIndex(ss, f, S, x+dx, y+dy, edgeSize, gridSize); \
- if(attribs.orco.glTexco) \
+ if (attribs.orco.glTexco) \
glTexCoord3fv(attribs.orco.array[index]); \
else \
glVertexAttrib3fvARB(attribs.orco.glIndex, attribs.orco.array[index]); \
} \
- for(b = 0; b < attribs.tottface; b++) { \
+ for (b = 0; b < attribs.tottface; b++) { \
MTFace *tf = &attribs.tface[b].array[a]; \
- if(attribs.tface[b].glTexco) \
+ if (attribs.tface[b].glTexco) \
glTexCoord2fv(tf->uv[vert]); \
else \
glVertexAttrib2fvARB(attribs.tface[b].glIndex, tf->uv[vert]); \
} \
- for(b = 0; b < attribs.totmcol; b++) { \
+ for (b = 0; b < attribs.totmcol; b++) { \
MCol *cp = &attribs.mcol[b].array[a*4 + vert]; \
GLubyte col[4]; \
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; \
glVertexAttrib4ubvARB(attribs.mcol[b].glIndex, col); \
} \
- if(attribs.tottang) { \
+ if (attribs.tottang) { \
float *tang = attribs.tang.array[a*4 + vert]; \
glVertexAttrib4fvARB(attribs.tang.glIndex, tang); \
} \
}
totface = ccgSubSurf_getNumFaces(ss);
- for(a = 0, i = 0; i < totface; i++) {
+ 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;
+ if (faceFlags) {
+ drawSmooth = (faceFlags[index].flag & ME_SMOOTH);
+ new_matnr= faceFlags[index].mat_nr + 1;
}
else {
drawSmooth = 1;
@@ -1838,13 +1900,13 @@ static void ccgDM_drawMappedFacesMat(DerivedMesh *dm, void (*setMaterial)(void *
}
/* material */
- if(new_matnr != matnr) {
+ if (new_matnr != matnr) {
setMaterial(userData, matnr = new_matnr, &gattribs);
DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs);
}
/* face hiding */
- if((setFace && (origIndex != ORIGINDEX_NONE) && !setFace(userData, origIndex))) {
+ if ((setFace && (origIndex != ORIGINDEX_NONE) && !setFace(userData, origIndex))) {
a += gridFaces*gridFaces*numVerts;
continue;
}
@@ -1870,7 +1932,7 @@ static void ccgDM_drawMappedFacesMat(DerivedMesh *dm, void (*setMaterial)(void *
glNormal3fv(vdb->no);
glVertex3fv(vdb->co);
- if(x != gridFaces-1)
+ if (x != gridFaces-1)
a++;
}
@@ -1889,7 +1951,8 @@ static void ccgDM_drawMappedFacesMat(DerivedMesh *dm, void (*setMaterial)(void *
a++;
}
- } else {
+ }
+ else {
glBegin(GL_QUADS);
for (y=0; y<gridFaces; y++) {
for (x=0; x<gridFaces; x++) {
@@ -1920,134 +1983,67 @@ 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);
+ MCol *mcol = dm->getTessFaceDataArray(dm, CD_PREVIEW_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;
ccgdm_pbvh_update(ccgdm);
- if(!mcol)
+ if (!mcol)
mcol = dm->getTessFaceDataArray(dm, CD_MCOL);
- if(!mcol)
+ if (!mcol)
mcol = dm->getTessFaceDataArray(dm, CD_TEXTURE_MCOL);
totface = ccgSubSurf_getNumFaces(ss);
- for(i = 0; i < totface; i++) {
+ for (i = 0; i < totface; i++) {
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];
+ if (faceFlags) {
+ drawSmooth = (faceFlags[origIndex].flag & ME_SMOOTH);
+ mat_nr= faceFlags[origIndex].mat_nr;
}
else {
drawSmooth = 1;
mat_nr= 0;
}
- if(drawParams)
- flag = drawParams(tf, (mcol != NULL), mat_nr);
+ if (drawParams)
+ 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(tf) tf += gridFaces*gridFaces*numVerts;
- if(mcol) mcol += gridFaces*gridFaces*numVerts*4;
+ if (draw_option == DM_DRAW_OPTION_SKIP) {
+ if (tf) tf += gridFaces*gridFaces*numVerts;
+ if (mcol) mcol += gridFaces*gridFaces*numVerts*4;
continue;
}
/* flag 1 == use vertex colors */
- if(mcol) {
- if(flag==1) cp= (unsigned char*)mcol;
+ if (mcol) {
+ if (draw_option != DM_DRAW_OPTION_NO_MCOL)
+ cp= (unsigned char*)mcol;
mcol += gridFaces*gridFaces*numVerts*4;
}
@@ -2063,41 +2059,42 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
a = &faceGridData[(y+0)*gridSize + x];
b = &faceGridData[(y+1)*gridSize + x];
- if(tf) glTexCoord2fv(tf->uv[0]);
- if(cp) glColor3ub(cp[3], cp[2], cp[1]);
+ if (tf) glTexCoord2fv(tf->uv[0]);
+ if (cp) glColor3ub(cp[3], cp[2], cp[1]);
glNormal3fv(a->no);
glVertex3fv(a->co);
- if(tf) glTexCoord2fv(tf->uv[1]);
- if(cp) glColor3ub(cp[7], cp[6], cp[5]);
+ if (tf) glTexCoord2fv(tf->uv[1]);
+ if (cp) glColor3ub(cp[7], cp[6], cp[5]);
glNormal3fv(b->no);
glVertex3fv(b->co);
- if(x != gridFaces-1) {
- if(tf) tf++;
- if(cp) cp += 16;
+ if (x != gridFaces-1) {
+ if (tf) tf++;
+ if (cp) cp += 16;
}
}
a = &faceGridData[(y+0)*gridSize + x];
b = &faceGridData[(y+1)*gridSize + x];
- if(tf) glTexCoord2fv(tf->uv[3]);
- if(cp) glColor3ub(cp[15], cp[14], cp[13]);
+ if (tf) glTexCoord2fv(tf->uv[3]);
+ if (cp) glColor3ub(cp[15], cp[14], cp[13]);
glNormal3fv(a->no);
glVertex3fv(a->co);
- if(tf) glTexCoord2fv(tf->uv[2]);
- if(cp) glColor3ub(cp[11], cp[10], cp[9]);
+ if (tf) glTexCoord2fv(tf->uv[2]);
+ if (cp) glColor3ub(cp[11], cp[10], cp[9]);
glNormal3fv(b->no);
glVertex3fv(b->co);
- if(tf) tf++;
- if(cp) cp += 16;
+ if (tf) tf++;
+ if (cp) cp += 16;
glEnd();
}
- } else {
+ }
+ else {
glShadeModel(GL_FLAT);
glBegin(GL_QUADS);
for (y=0; y<gridFaces; y++) {
@@ -2109,24 +2106,24 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
ccgDM_glNormalFast(a_co, b_co, c_co, d_co);
- if(tf) glTexCoord2fv(tf->uv[1]);
- if(cp) glColor3ub(cp[7], cp[6], cp[5]);
+ if (tf) glTexCoord2fv(tf->uv[1]);
+ if (cp) glColor3ub(cp[7], cp[6], cp[5]);
glVertex3fv(d_co);
- if(tf) glTexCoord2fv(tf->uv[2]);
- if(cp) glColor3ub(cp[11], cp[10], cp[9]);
+ if (tf) glTexCoord2fv(tf->uv[2]);
+ if (cp) glColor3ub(cp[11], cp[10], cp[9]);
glVertex3fv(c_co);
- if(tf) glTexCoord2fv(tf->uv[3]);
- if(cp) glColor3ub(cp[15], cp[14], cp[13]);
+ if (tf) glTexCoord2fv(tf->uv[3]);
+ if (cp) glColor3ub(cp[15], cp[14], cp[13]);
glVertex3fv(b_co);
- if(tf) glTexCoord2fv(tf->uv[0]);
- if(cp) glColor3ub(cp[3], cp[2], cp[1]);
+ if (tf) glTexCoord2fv(tf->uv[0]);
+ if (cp) glColor3ub(cp[3], cp[2], cp[1]);
glVertex3fv(a_co);
- if(tf) tf++;
- if(cp) cp += 16;
+ if (tf) tf++;
+ if (cp) cp += 16;
}
}
glEnd();
@@ -2136,16 +2133,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);
@@ -2160,18 +2157,19 @@ static void ccgDM_drawUVEdges(DerivedMesh *dm)
if (tf) {
glBegin(GL_LINES);
- for(i = 0; i < dm->numTessFaceData; i++, mf++, tf++) {
- if(!(mf->flag&ME_HIDE)) {
+ for (i = 0; i < dm->numTessFaceData; i++, mf++, tf++) {
+ if (!(mf->flag&ME_HIDE)) {
glVertex2fv(tf->uv[0]);
glVertex2fv(tf->uv[1]);
glVertex2fv(tf->uv[1]);
glVertex2fv(tf->uv[2]);
- if(!mf->v4) {
+ if (!mf->v4) {
glVertex2fv(tf->uv[2]);
glVertex2fv(tf->uv[0]);
- } else {
+ }
+ else {
glVertex2fv(tf->uv[2]);
glVertex2fv(tf->uv[3]);
@@ -2185,61 +2183,63 @@ 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 */
(void)compareDrawOptions;
- if(useColors) {
- mcol = dm->getTessFaceDataArray(dm, CD_WEIGHT_MCOL);
- if(!mcol)
+ if (useColors) {
+ mcol = dm->getTessFaceDataArray(dm, CD_PREVIEW_MCOL);
+ if (!mcol)
mcol = dm->getTessFaceDataArray(dm, CD_MCOL);
}
totface = ccgSubSurf_getNumFaces(ss);
- for(i = 0; i < totface; i++) {
+ for (i = 0; i < totface; i++) {
CCGFace *f = ccgdm->faceMap[i].face;
int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f);
int drawSmooth, index = ccgDM_getFaceMapIndex(ss, f);
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) {
+ if (mcol) {
cp= (unsigned char*)mcol;
mcol += gridFaces*gridFaces*numVerts*4;
}
{
- 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 */
+ if (index == ORIGINDEX_NONE)
+ 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++) {
@@ -2252,33 +2252,34 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm,
a = &faceGridData[(y+0)*gridSize + x];
b = &faceGridData[(y+1)*gridSize + x];
- if(cp) glColor3ub(cp[3], cp[2], cp[1]);
+ if (cp) glColor3ub(cp[3], cp[2], cp[1]);
glNormal3fv(a->no);
glVertex3fv(a->co);
- if(cp) glColor3ub(cp[7], cp[6], cp[5]);
+ if (cp) glColor3ub(cp[7], cp[6], cp[5]);
glNormal3fv(b->no);
glVertex3fv(b->co);
- if(x != gridFaces-1) {
- if(cp) cp += 16;
+ if (x != gridFaces-1) {
+ if (cp) cp += 16;
}
}
a = &faceGridData[(y+0)*gridSize + x];
b = &faceGridData[(y+1)*gridSize + x];
- if(cp) glColor3ub(cp[15], cp[14], cp[13]);
+ if (cp) glColor3ub(cp[15], cp[14], cp[13]);
glNormal3fv(a->no);
glVertex3fv(a->co);
- if(cp) glColor3ub(cp[11], cp[10], cp[9]);
+ if (cp) glColor3ub(cp[11], cp[10], cp[9]);
glNormal3fv(b->no);
glVertex3fv(b->co);
- if(cp) cp += 16;
+ if (cp) cp += 16;
glEnd();
}
- } else {
+ }
+ else {
glBegin(GL_QUADS);
for (y=0; y<gridFaces; y++) {
for (x=0; x<gridFaces; x++) {
@@ -2289,29 +2290,31 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm,
ccgDM_glNormalFast(a, b, c, d);
- if(cp) glColor3ub(cp[7], cp[6], cp[5]);
+ if (cp) glColor3ub(cp[7], cp[6], cp[5]);
glVertex3fv(d);
- if(cp) glColor3ub(cp[11], cp[10], cp[9]);
+ if (cp) glColor3ub(cp[11], cp[10], cp[9]);
glVertex3fv(c);
- if(cp) glColor3ub(cp[15], cp[14], cp[13]);
+ if (cp) glColor3ub(cp[15], cp[14], cp[13]);
glVertex3fv(b);
- if(cp) glColor3ub(cp[3], cp[2], cp[1]);
+ if (cp) glColor3ub(cp[3], cp[2], cp[1]);
glVertex3fv(a);
- if(cp) cp += 16;
+ if (cp) cp += 16;
}
}
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 +2329,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 +2346,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 +2364,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));
@@ -2403,27 +2409,40 @@ static void ccgDM_release(DerivedMesh *dm)
if (DM_release(dm)) {
/* Before freeing, need to update the displacement map */
- if(ccgdm->multires.modified) {
+ if (ccgdm->multires.modified_flags) {
/* Check that mmd still exists */
- if(!ccgdm->multires.local_mmd && BLI_findindex(&ccgdm->multires.ob->modifiers, ccgdm->multires.mmd) < 0)
+ if (!ccgdm->multires.local_mmd &&
+ BLI_findindex(&ccgdm->multires.ob->modifiers, ccgdm->multires.mmd) < 0)
ccgdm->multires.mmd = NULL;
- if(ccgdm->multires.mmd)
- ccgdm->multires.update(dm);
+
+ if (ccgdm->multires.mmd) {
+ if (ccgdm->multires.modified_flags & MULTIRES_COORDS_MODIFIED)
+ multires_modifier_update_mdisps(dm);
+ if (ccgdm->multires.modified_flags & MULTIRES_HIDDEN_MODIFIED)
+ multires_modifier_update_hidden(dm);
+ }
}
if (ccgdm->ehash)
BLI_edgehash_free(ccgdm->ehash, NULL);
- if(ccgdm->reverseFaceMap) MEM_freeN(ccgdm->reverseFaceMap);
- if(ccgdm->gridFaces) MEM_freeN(ccgdm->gridFaces);
- if(ccgdm->gridData) MEM_freeN(ccgdm->gridData);
- if(ccgdm->gridAdjacency) MEM_freeN(ccgdm->gridAdjacency);
- if(ccgdm->gridOffset) MEM_freeN(ccgdm->gridOffset);
- if(ccgdm->freeSS) ccgSubSurf_free(ccgdm->ss);
- if(ccgdm->fmap) MEM_freeN(ccgdm->fmap);
- if(ccgdm->fmap_mem) MEM_freeN(ccgdm->fmap_mem);
- if(ccgdm->pmap) MEM_freeN(ccgdm->pmap);
- if(ccgdm->pmap_mem) MEM_freeN(ccgdm->pmap_mem);
+ if (ccgdm->reverseFaceMap) MEM_freeN(ccgdm->reverseFaceMap);
+ if (ccgdm->gridFaces) MEM_freeN(ccgdm->gridFaces);
+ 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->gridHidden) {
+ int i, numGrids = dm->getNumGrids(dm);
+ for (i = 0; i < numGrids; i++) {
+ if (ccgdm->gridHidden[i])
+ MEM_freeN(ccgdm->gridHidden[i]);
+ }
+ MEM_freeN(ccgdm->gridHidden);
+ }
+ if (ccgdm->freeSS) ccgSubSurf_free(ccgdm->ss);
+ if (ccgdm->pmap) MEM_freeN(ccgdm->pmap);
+ if (ccgdm->pmap_mem) MEM_freeN(ccgdm->pmap_mem);
MEM_freeN(ccgdm->edgeFlags);
MEM_freeN(ccgdm->faceFlags);
MEM_freeN(ccgdm->vertMap);
@@ -2435,7 +2454,7 @@ static void ccgDM_release(DerivedMesh *dm)
static void ccg_loops_to_corners(CustomData *fdata, CustomData *ldata,
CustomData *pdata, int loopstart, int findex, int polyindex,
- const int numTex, const int numCol, const int hasWCol, const int hasOrigSpace)
+ const int numTex, const int numCol, const int hasPCol, const int hasOrigSpace)
{
MTFace *texface;
MTexPoly *texpoly;
@@ -2444,7 +2463,7 @@ static void ccg_loops_to_corners(CustomData *fdata, CustomData *ldata,
MLoopUV *mloopuv;
int i, j;
- for(i=0; i < numTex; i++) {
+ for (i=0; i < numTex; i++) {
texface = CustomData_get_n(fdata, CD_MTFACE, findex, i);
texpoly = CustomData_get_n(pdata, CD_MTEXPOLY, polyindex, i);
@@ -2456,27 +2475,21 @@ static void ccg_loops_to_corners(CustomData *fdata, CustomData *ldata,
}
}
- for(i=0; i < numCol; i++) {
+ for (i=0; i < numCol; i++) {
mloopcol = CustomData_get_n(ldata, CD_MLOOPCOL, loopstart, i);
mcol = CustomData_get_n(fdata, CD_MCOL, findex, i);
for (j=0; j<4; j++, mloopcol++) {
- mcol[j].r = mloopcol->r;
- mcol[j].g = mloopcol->g;
- mcol[j].b = mloopcol->b;
- mcol[j].a = mloopcol->a;
+ MESH_MLOOPCOL_TO_MCOL(mloopcol, &mcol[j]);
}
}
- if (hasWCol) {
- mloopcol = CustomData_get(ldata, loopstart, CD_WEIGHT_MLOOPCOL);
- mcol = CustomData_get(fdata, findex, CD_WEIGHT_MCOL);
+ if (hasPCol) {
+ mloopcol = CustomData_get(ldata, loopstart, CD_PREVIEW_MLOOPCOL);
+ mcol = CustomData_get(fdata, findex, CD_PREVIEW_MCOL);
for (j=0; j<4; j++, mloopcol++) {
- mcol[j].r = mloopcol->r;
- mcol[j].g = mloopcol->g;
- mcol[j].b = mloopcol->b;
- mcol[j].a = mloopcol->a;
+ MESH_MLOOPCOL_TO_MCOL(mloopcol, &mcol[j]);
}
}
@@ -2493,7 +2506,7 @@ static void ccg_loops_to_corners(CustomData *fdata, CustomData *ldata,
static void *ccgDM_get_vert_data_layer(DerivedMesh *dm, int type)
{
- if(type == CD_ORIGINDEX) {
+ if (type == CD_ORIGINDEX) {
/* create origindex on demand to save memory */
CCGDerivedMesh *ccgdm= (CCGDerivedMesh*)dm;
CCGSubSurf *ss= ccgdm->ss;
@@ -2513,10 +2526,10 @@ static void *ccgDM_get_vert_data_layer(DerivedMesh *dm, int type)
totnone= dm->numVertData - totorig;
/* original vertices are at the end */
- for(a=0; a<totnone; a++)
+ for (a=0; a<totnone; a++)
origindex[a]= ORIGINDEX_NONE;
- for(index=0; index<totorig; index++, a++) {
+ for (index=0; index<totorig; index++, a++) {
CCGVert *v = ccgdm->vertMap[index].vert;
origindex[a] = ccgDM_getVertMapIndex(ccgdm->ss, v);
}
@@ -2529,7 +2542,7 @@ static void *ccgDM_get_vert_data_layer(DerivedMesh *dm, int type)
static void *ccgDM_get_edge_data_layer(DerivedMesh *dm, int type)
{
- if(type == CD_ORIGINDEX) {
+ if (type == CD_ORIGINDEX) {
/* create origindex on demand to save memory */
CCGDerivedMesh *ccgdm= (CCGDerivedMesh*)dm;
CCGSubSurf *ss= ccgdm->ss;
@@ -2551,14 +2564,14 @@ static void *ccgDM_get_edge_data_layer(DerivedMesh *dm, int type)
totnone= dm->numEdgeData - totorig;
/* original edges are at the end */
- for(a=0; a<totnone; a++)
+ for (a=0; a<totnone; a++)
origindex[a]= ORIGINDEX_NONE;
- for(index=0; index<totedge; index++) {
+ for (index=0; index<totedge; index++) {
CCGEdge *e= ccgdm->edgeMap[index].edge;
int mapIndex= ccgDM_getEdgeMapIndex(ss, e);
- for(i = 0; i < edgeSize - 1; i++, a++)
+ for (i = 0; i < edgeSize - 1; i++, a++)
origindex[a]= mapIndex;
}
@@ -2570,7 +2583,7 @@ static void *ccgDM_get_edge_data_layer(DerivedMesh *dm, int type)
static void *ccgDM_get_tessface_data_layer(DerivedMesh *dm, int type)
{
- if(type == CD_ORIGINDEX) {
+ if (type == CD_ORIGINDEX) {
/* create origindex on demand to save memory */
CCGDerivedMesh *ccgdm= (CCGDerivedMesh*)dm;
CCGSubSurf *ss= ccgdm->ss;
@@ -2589,12 +2602,12 @@ static void *ccgDM_get_tessface_data_layer(DerivedMesh *dm, int type)
totface= ccgSubSurf_getNumFaces(ss);
- for(a=0, index=0; index<totface; index++) {
+ for (a=0, index=0; index<totface; index++) {
CCGFace *f = ccgdm->faceMap[index].face;
int numVerts = ccgSubSurf_getFaceNumVerts(f);
int mapIndex = ccgDM_getFaceMapIndex(ss, f);
- for(i=0; i<gridFaces*gridFaces*numVerts; i++, a++)
+ for (i=0; i<gridFaces*gridFaces*numVerts; i++, a++)
origindex[a]= mapIndex;
}
@@ -2642,7 +2655,7 @@ static int ccgDM_getNumGrids(DerivedMesh *dm)
numFaces= ccgSubSurf_getNumFaces(ccgdm->ss);
numGrids= 0;
- for(index=0; index<numFaces; index++) {
+ for (index=0; index<numFaces; index++) {
CCGFace *f = ccgdm->faceMap[index].face;
numGrids += ccgSubSurf_getFaceNumVerts(f);
}
@@ -2656,36 +2669,36 @@ 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)
+ if (numFaces != 2)
return -1;
- for(i = 0; i < numFaces; i++) {
+ for (i = 0; i < numFaces; i++) {
adjf = ccgSubSurf_getEdgeFace(e, i);
- if(adjf != f) {
+ if (adjf != f) {
numEdges = ccgSubSurf_getFaceNumVerts(adjf);
- for(j = 0; j < numEdges; j++)
- if(ccgSubSurf_getFaceEdge(ss, adjf, j) == e)
+ for (j = 0; j < numEdges; j++)
+ if (ccgSubSurf_getFaceEdge(adjf, j) == e)
break;
- if(j != numEdges)
+ if (j != numEdges)
break;
}
}
- if(numEdges == 0)
+ 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,11 +2709,12 @@ 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*/;
- if(ccgdm->gridData)
+ if (ccgdm->gridData)
return;
numGrids = ccgDM_getNumGrids(dm);
@@ -2710,7 +2724,7 @@ static void ccgdm_create_grids(DerivedMesh *dm)
/* compute offset into grid array for each face */
gridOffset = MEM_mallocN(sizeof(int)*numFaces, "ccgdm.gridOffset");
- for(gIndex = 0, index = 0; index < numFaces; index++) {
+ for (gIndex = 0, index = 0; index < numFaces; index++) {
CCGFace *f = ccgdm->faceMap[index].face;
int numVerts = ccgSubSurf_getFaceNumVerts(f);
@@ -2722,25 +2736,29 @@ 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");
+
+ ccgdm->gridHidden = MEM_callocN(sizeof(BLI_bitmap)*numGrids, "ccgdm.gridHidden");
- for(gIndex = 0, index = 0; index < numFaces; index++) {
+ for (gIndex = 0, index = 0; index < numFaces; index++) {
CCGFace *f = ccgdm->faceMap[index].face;
int numVerts = ccgSubSurf_getFaceNumVerts(f);
- for(S = 0; S < numVerts; S++, gIndex++) {
+ for (S = 0; S < numVerts; S++, gIndex++) {
int prevS = (S - 1 + numVerts) % numVerts;
int nextS = (S + 1 + numVerts) % numVerts;
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 +2769,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,11 +2796,27 @@ static int *ccgDM_getGridOffset(DerivedMesh *dm)
return ccgdm->gridOffset;
}
-static ListBase *ccgDM_getPolyMap(Object *ob, DerivedMesh *dm)
+static DMFlagMat *ccgDM_getGridFlagMats(DerivedMesh *dm)
+{
+ CCGDerivedMesh *ccgdm= (CCGDerivedMesh*)dm;
+
+ ccgdm_create_grids(dm);
+ return ccgdm->gridFlagMats;
+}
+
+static BLI_bitmap *ccgDM_getGridHidden(DerivedMesh *dm)
+{
+ CCGDerivedMesh *ccgdm= (CCGDerivedMesh*)dm;
+
+ ccgdm_create_grids(dm);
+ return ccgdm->gridHidden;
+}
+
+static const MeshElemMap *ccgDM_getPolyMap(Object *ob, DerivedMesh *dm)
{
CCGDerivedMesh *ccgdm= (CCGDerivedMesh*)dm;
- if(!ccgdm->multires.mmd && !ccgdm->pmap && ob->type == OB_MESH) {
+ if (!ccgdm->multires.mmd && !ccgdm->pmap && ob->type == OB_MESH) {
Mesh *me= ob->data;
create_vert_poly_map(&ccgdm->pmap, &ccgdm->pmap_mem,
@@ -2796,9 +2831,9 @@ 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 */
- if(!mmd)
+ /* both of multires and subsurf modifiers are CCG, but
+ * grids should only be used when sculpting on multires */
+ if (!mmd)
return 0;
return 1;
@@ -2809,22 +2844,22 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
CCGDerivedMesh *ccgdm= (CCGDerivedMesh*)dm;
int gridSize, numGrids, grid_pbvh;
- if(!ob) {
+ if (!ob) {
ccgdm->pbvh= NULL;
return NULL;
}
- if(!ob->sculpt)
+ if (!ob->sculpt)
return NULL;
grid_pbvh= ccgDM_use_grid_pbvh(ccgdm);
- if(ob->sculpt->pbvh) {
- if(grid_pbvh) {
+ 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);
}
@@ -2832,13 +2867,13 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
ccgdm->pbvh = ob->sculpt->pbvh;
}
- if(ccgdm->pbvh)
+ if (ccgdm->pbvh)
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. */
- if(grid_pbvh) {
+ * 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);
gridSize = ccgDM_getGridSize(dm);
@@ -2846,8 +2881,9 @@ 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);
- } else if(ob->type == OB_MESH) {
+ numGrids, gridSize, (void**)ccgdm->gridFaces, ccgdm->gridFlagMats, ccgdm->gridHidden);
+ }
+ else if (ob->type == OB_MESH) {
Mesh *me= ob->data;
ob->sculpt->pbvh= ccgdm->pbvh = BLI_pbvh_new();
BLI_assert(!(me->mface == NULL && me->mpoly != NULL)); /* BMESH ONLY complain if mpoly is valid but not mface */
@@ -2858,7 +2894,7 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
return ccgdm->pbvh;
}
-static void ccgDM_recalcTesselation(DerivedMesh *UNUSED(dm))
+static void ccgDM_recalcTessellation(DerivedMesh *UNUSED(dm))
{
/* Nothing to do: CCG handles creating its own tessfaces */
}
@@ -2882,8 +2918,8 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
int vertNum, edgeNum, faceNum;
int *vertOrigIndex, *faceOrigIndex, *polyOrigIndex, *base_polyOrigIndex; /* *edgeOrigIndex - as yet, unused */
short *edgeFlags;
- char *faceFlags;
- int *loopidx = NULL, *vertidx = NULL;
+ DMFlagMat *faceFlags;
+ int *loopidx = NULL, *vertidx = NULL, *polyidx = NULL;
BLI_array_declare(loopidx);
BLI_array_declare(vertidx);
int loopindex, loopindex2;
@@ -2893,7 +2929,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
/*int gridSideVerts;*/
int gridSideEdges;
int numTex, numCol;
- int hasWCol, hasOrigSpace;
+ int hasPCol, hasOrigSpace;
int gridInternalEdges;
float *w = NULL;
WeightTable wtable = {0};
@@ -2908,15 +2944,19 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgSubSurf_getNumFinalFaces(ss),
ccgSubSurf_getNumFinalFaces(ss)*4,
ccgSubSurf_getNumFinalFaces(ss));
+
+ CustomData_free_layer_active(&ccgdm->dm.polyData, CD_NORMAL,
+ ccgdm->dm.numPolyData);
numTex = CustomData_number_of_layers(&ccgdm->dm.loopData, CD_MLOOPUV);
numCol = CustomData_number_of_layers(&ccgdm->dm.loopData, CD_MLOOPCOL);
- hasWCol = CustomData_has_layer(&ccgdm->dm.loopData, CD_WEIGHT_MLOOPCOL);
+ hasPCol = CustomData_has_layer(&ccgdm->dm.loopData, CD_PREVIEW_MLOOPCOL);
hasOrigSpace = CustomData_has_layer(&ccgdm->dm.loopData, CD_ORIGSPACE_MLOOP);
if (
(numTex && CustomData_number_of_layers(&ccgdm->dm.faceData, CD_MTFACE) != numTex) ||
(numCol && CustomData_number_of_layers(&ccgdm->dm.faceData, CD_MCOL) != numCol) ||
+ (hasPCol && !CustomData_has_layer(&ccgdm->dm.faceData, CD_PREVIEW_MCOL)) ||
(hasOrigSpace && !CustomData_has_layer(&ccgdm->dm.faceData, CD_ORIGSPACE)) )
{
CustomData_from_bmeshpoly(&ccgdm->dm.faceData,
@@ -2925,6 +2965,10 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgSubSurf_getNumFinalFaces(ss));
}
+ /* We absolutely need that layer, else it's no valid tessellated data! */
+ polyidx = CustomData_add_layer(&ccgdm->dm.faceData, CD_POLYINDEX, CD_CALLOC,
+ NULL, ccgSubSurf_getNumFinalFaces(ss));
+
ccgdm->dm.getMinMax = ccgDM_getMinMax;
ccgdm->dm.getNumVerts = ccgDM_getNumVerts;
ccgdm->dm.getNumEdges = ccgDM_getNumEdges;
@@ -2958,6 +3002,8 @@ 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.getGridHidden = ccgDM_getGridHidden;
ccgdm->dm.getPolyMap = ccgDM_getPolyMap;
ccgdm->dm.getPBVH = ccgDM_getPBVH;
@@ -2967,7 +3013,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgdm->dm.copyTessFaceArray = ccgDM_copyFinalFaceArray;
ccgdm->dm.calcNormals = ccgDM_calcNormals;
- ccgdm->dm.recalcTesselation = ccgDM_recalcTesselation;
+ ccgdm->dm.recalcTessellation = ccgDM_recalcTessellation;
ccgdm->dm.getVertCos = ccgdm_getVertCos;
ccgdm->dm.foreachMappedVert = ccgDM_foreachMappedVert;
@@ -2978,7 +3024,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;
@@ -2999,7 +3044,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
totvert = ccgSubSurf_getNumVerts(ss);
ccgdm->vertMap = MEM_mallocN(totvert * sizeof(*ccgdm->vertMap), "vertMap");
vi = ccgSubSurf_getVertIterator(ss);
- for(; !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) {
+ for (; !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) {
CCGVert *v = ccgVertIterator_getCurrent(vi);
ccgdm->vertMap[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v))].vert = v;
@@ -3009,7 +3054,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
totedge = ccgSubSurf_getNumEdges(ss);
ccgdm->edgeMap = MEM_mallocN(totedge * sizeof(*ccgdm->edgeMap), "edgeMap");
ei = ccgSubSurf_getEdgeIterator(ss);
- for(; !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
+ for (; !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
ccgdm->edgeMap[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e))].edge = e;
@@ -3018,10 +3063,10 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
totface = ccgSubSurf_getNumFaces(ss);
ccgdm->faceMap = MEM_mallocN(totface * sizeof(*ccgdm->faceMap), "faceMap");
fi = ccgSubSurf_getFaceIterator(ss);
- for(; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
+ 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 +3092,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);*/
@@ -3058,7 +3103,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
#if 0
/* this is not in trunk, can gives problems because colors initialize
- * as black, just dont do it!, it works fine - campbell */
+ * as black, just don't do it!, it works fine - campbell */
if (!CustomData_has_layer(&ccgdm->dm.faceData, CD_MCOL))
DM_add_tessface_layer(&ccgdm->dm, CD_MCOL, CD_CALLOC, NULL);
mcol = DM_get_tessface_data_layer(&ccgdm->dm, CD_MCOL);
@@ -3066,13 +3111,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 +3130,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 +3146,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));
}
@@ -3118,8 +3163,8 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
++vertNum;
/*interpolate per-vert data*/
- for(s = 0; s < numVerts; s++) {
- for(x = 1; x < gridFaces; x++) {
+ for (s = 0; s < numVerts; s++) {
+ for (x = 1; x < gridFaces; x++) {
w2 = w + s*numVerts*g2_wid*g2_wid + x*numVerts;
DM_interp_vert_data(dm, &ccgdm->dm, vertidx, w2,
numVerts, vertNum);
@@ -3134,9 +3179,9 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
}
/*interpolate per-vert data*/
- for(s = 0; s < numVerts; s++) {
- for(y = 1; y < gridFaces; y++) {
- for(x = 1; x < gridFaces; x++) {
+ for (s = 0; s < numVerts; s++) {
+ for (y = 1; y < gridFaces; y++) {
+ for (x = 1; x < gridFaces; x++) {
w2 = w + s*numVerts*g2_wid*g2_wid + (y*g2_wid+x)*numVerts;
DM_interp_vert_data(dm, &ccgdm->dm, vertidx, w2,
numVerts, vertNum);
@@ -3152,7 +3197,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
}
if (has_edge_origindex) {
- for(i = 0; i < numFinalEdges; ++i)
+ for (i = 0; i < numFinalEdges; ++i)
*(int *)DM_get_edge_data(&ccgdm->dm, edgeNum + i,
CD_ORIGINDEX) = ORIGINDEX_NONE;
}
@@ -3184,10 +3229,10 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
/*copy over poly data, e.g. mtexpoly*/
CustomData_copy_data(&dm->polyData, &ccgdm->dm.polyData, origIndex, faceNum, 1);
- /*generate tesselated face data used for drawing*/
+ /*generate tessellated face data used for drawing*/
ccg_loops_to_corners(&ccgdm->dm.faceData, &ccgdm->dm.loopData,
&ccgdm->dm.polyData, loopindex2-4, faceNum, faceNum,
- numTex, numCol, hasWCol, hasOrigSpace);
+ numTex, numCol, hasPCol, hasOrigSpace);
/*set original index data*/
if (faceOrigIndex) {
@@ -3201,6 +3246,9 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgdm->reverseFaceMap[faceNum] = index;
+ /* This is a simple one to one mapping, here... */
+ polyidx[faceNum] = faceNum;
+
faceNum++;
}
}
@@ -3209,7 +3257,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
edgeNum += numFinalEdges;
}
- for(index = 0; index < totedge; ++index) {
+ for (index = 0; index < totedge; ++index) {
CCGEdge *e = ccgdm->edgeMap[index].edge;
int numFinalEdges = edgeSize - 1;
int mapIndex = ccgDM_getEdgeMapIndex(ss, e);
@@ -3226,13 +3274,13 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgdm->edgeMap[index].startVert = vertNum;
ccgdm->edgeMap[index].startEdge = edgeNum;
- if(edgeIdx >= 0 && edgeFlags)
+ if (edgeIdx >= 0 && edgeFlags)
edgeFlags[edgeIdx] = medge[edgeIdx].flag;
/* set the edge base vert */
*((int*)ccgSubSurf_getEdgeUserData(ss, e)) = vertNum;
- for(x = 1; x < edgeSize - 1; x++) {
+ for (x = 1; x < edgeSize - 1; x++) {
float w[2];
w[1] = (float) x / (edgeSize - 1);
w[0] = 1 - w[1];
@@ -3244,7 +3292,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
++vertNum;
}
- for(i = 0; i < numFinalEdges; ++i) {
+ for (i = 0; i < numFinalEdges; ++i) {
if (has_edge_origindex) {
*(int *)DM_get_edge_data(&ccgdm->dm, edgeNum + i,
CD_ORIGINDEX) = mapIndex;
@@ -3254,7 +3302,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
edgeNum += numFinalEdges;
}
- if(useSubsurfUv) {
+ if (useSubsurfUv) {
CustomData *ldata = &ccgdm->dm.loopData;
CustomData *dmldata = &dm->loopData;
int numlayer = CustomData_number_of_layers(ldata, CD_MLOOPUV);
@@ -3264,7 +3312,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
set_subsurf_uv(ss, dm, &ccgdm->dm, i);
}
- for(index = 0; index < totvert; ++index) {
+ for (index = 0; index < totvert; ++index) {
CCGVert *v = ccgdm->vertMap[index].vert;
int mapIndex = ccgDM_getVertMapIndex(ccgdm->ss, v);
int vertIdx;
@@ -3291,6 +3339,9 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgdm->dm.numLoopData = loopindex2;
ccgdm->dm.numPolyData = faceNum;
+ /* All tessellated CD layers were updated! */
+ ccgdm->dm.dirty &= ~DM_DIRTY_TESS_CDLAYERS;
+
BLI_array_free(vertidx);
BLI_array_free(loopidx);
free_ss_weights(&wtable);
@@ -3312,7 +3363,7 @@ struct DerivedMesh *subsurf_make_derived_from_derived(
int drawInteriorEdges = !(smd->flags & eSubsurfModifierFlag_ControlEdges);
CCGDerivedMesh *result;
- if(forEditMode) {
+ if (forEditMode) {
int levels= (smd->modifier.scene)? get_render_subsurf_level(&smd->modifier.scene->r, smd->levels): smd->levels;
smd->emCache = _getSubSurf(smd->emCache, levels, useAging|CCG_CALC_NORMALS);
@@ -3321,12 +3372,13 @@ struct DerivedMesh *subsurf_make_derived_from_derived(
result = getCCGDerivedMesh(smd->emCache,
drawInteriorEdges,
useSubsurfUv, dm);
- } else if(useRenderParams) {
+ }
+ else if (useRenderParams) {
/* Do not use cache in render mode. */
CCGSubSurf *ss;
int levels= (smd->modifier.scene)? get_render_subsurf_level(&smd->modifier.scene->r, smd->renderLevels): smd->renderLevels;
- if(levels == 0)
+ if (levels == 0)
return dm;
ss = _getSubSurf(NULL, levels, CCG_USE_ARENA|CCG_CALC_NORMALS);
@@ -3337,13 +3389,14 @@ struct DerivedMesh *subsurf_make_derived_from_derived(
drawInteriorEdges, useSubsurfUv, dm);
result->freeSS = 1;
- } else {
+ }
+ else {
int useIncremental = (smd->flags & eSubsurfModifierFlag_Incremental);
int levels= (smd->modifier.scene)? get_render_subsurf_level(&smd->modifier.scene->r, smd->levels): smd->levels;
CCGSubSurf *ss;
/* It is quite possible there is a much better place to do this. It
- * depends a bit on how rigourously we expect this function to never
+ * depends a bit on how rigorously we expect this function to never
* be called in editmode. In semi-theory we could share a single
* cache, but the handles used inside and outside editmode are not
* the same so we would need some way of converting them. Its probably
@@ -3353,12 +3406,12 @@ struct DerivedMesh *subsurf_make_derived_from_derived(
* Addendum: we can't really ensure that this is never called in edit
* mode, so now we have a parameter to verify it. - brecht
*/
- if(!inEditMode && smd->emCache) {
+ if (!inEditMode && smd->emCache) {
ccgSubSurf_free(smd->emCache);
smd->emCache = NULL;
}
- if(useIncremental && isFinalCalc) {
+ if (useIncremental && isFinalCalc) {
smd->mCache = ss = _getSubSurf(smd->mCache, levels, useAging|CCG_CALC_NORMALS);
ss_sync_from_derivedmesh(ss, dm, vertCos, useSimple);
@@ -3366,7 +3419,8 @@ struct DerivedMesh *subsurf_make_derived_from_derived(
result = getCCGDerivedMesh(smd->mCache,
drawInteriorEdges,
useSubsurfUv, dm);
- } else {
+ }
+ else {
if (smd->mCache && isFinalCalc) {
ccgSubSurf_free(smd->mCache);
smd->mCache = NULL;
@@ -3377,7 +3431,7 @@ struct DerivedMesh *subsurf_make_derived_from_derived(
result = getCCGDerivedMesh(ss, drawInteriorEdges, useSubsurfUv, dm);
- if(isFinalCalc)
+ if (isFinalCalc)
smd->mCache = ss;
else
result->freeSS = 1;
@@ -3423,8 +3477,8 @@ 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) */
- if(numFaces && numFaces != N)
+ * moving completely out of place (brecht) */
+ if (numFaces && numFaces != N)
mul_v3_fl(face_sum, (float)N/(float)numFaces);
co = ccgSubSurf_getVertData(ss, v);
@@ -3438,4 +3492,3 @@ void subsurf_calculate_limit_positions(Mesh *me, float (*positions_r)[3])
dm->release(dm);
}
-
diff --git a/source/blender/blenkernel/intern/suggestions.c b/source/blender/blenkernel/intern/suggestions.c
index e1e872c42b6..8b3138066d3 100644
--- a/source/blender/blenkernel/intern/suggestions.c
+++ b/source/blender/blenkernel/intern/suggestions.c
@@ -132,7 +132,8 @@ void texttool_suggest_add(const char *name, char type)
/* Perform simple linear search for ordered storage */
if (!suggestions.first || !suggestions.last) {
suggestions.first = suggestions.last = newitem;
- } else {
+ }
+ else {
cmp = -1;
for (item=suggestions.last; item; item=item->prev) {
cmp = txttl_cmp(name, item->name, len);
@@ -182,7 +183,8 @@ void texttool_suggest_prefix(const char *prefix)
first = match;
suggestions.top = top;
}
- } else if (cmp<0) {
+ }
+ else if (cmp<0) {
if (!last) {
last = match->prev;
break;
@@ -195,7 +197,8 @@ void texttool_suggest_prefix(const char *prefix)
suggestions.firstmatch = first;
suggestions.lastmatch = last;
suggestions.selected = first;
- } else {
+ }
+ else {
suggestions.firstmatch = NULL;
suggestions.lastmatch = NULL;
suggestions.selected = NULL;
@@ -255,7 +258,8 @@ void texttool_docs_show(const char *docs)
documentation = MEM_mallocN(len+2, "Documentation");
strncpy(documentation, docs, len);
documentation[len++] = '\n';
- } else {
+ }
+ else {
documentation = MEM_mallocN(len+1, "Documentation");
strncpy(documentation, docs, len);
}
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 888d59b78b5..9715058c51f 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,8 +38,13 @@
#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 "BLI_fileops.h"
#include "DNA_constraint_types.h"
#include "DNA_controller_types.h"
@@ -61,68 +66,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 behaviour 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
+ *
+ */
/***/
@@ -169,7 +173,7 @@ void free_text(Text *text)
BLI_freelistN(&text->lines);
BLI_freelistN(&text->markers);
- if(text->name) MEM_freeN(text->name);
+ if (text->name) MEM_freeN(text->name);
MEM_freeN(text->undo_buf);
#ifdef WITH_PYTHON
if (text->compiled) BPY_text_free_code(text);
@@ -191,7 +195,7 @@ Text *add_empty_text(const char *name)
ta->nlines=1;
ta->flags= TXT_ISDIRTY | TXT_ISMEM;
- if((U.flag & USER_TXT_TABSTOSPACES_DISABLE)==0)
+ if ((U.flag & USER_TXT_TABSTOSPACES_DISABLE)==0)
ta->flags |= TXT_TABSTOSPACES;
ta->lines.first= ta->lines.last= NULL;
@@ -225,7 +229,7 @@ int txt_extended_ascii_as_utf8(char **str)
int length = strlen(*str);
while ((*str)[i]) {
- if((bad_char= BLI_utf8_invalid_byte(*str+i, length-i)) == -1)
+ if ((bad_char= BLI_utf8_invalid_byte(*str+i, length-i)) == -1)
break;
added++;
@@ -238,7 +242,7 @@ int txt_extended_ascii_as_utf8(char **str)
i= 0;
while ((*str)[i]) {
- if((bad_char= BLI_utf8_invalid_byte((*str)+i, length-i)) == -1) {
+ if ((bad_char= BLI_utf8_invalid_byte((*str)+i, length-i)) == -1) {
memcpy(newstr+mi, (*str)+i, length - i + 1);
break;
}
@@ -288,8 +292,8 @@ int reopen_text(Text *text)
BLI_strncpy(str, text->name, FILE_MAX);
BLI_path_abs(str, G.main->name);
- fp= fopen(str, "r");
- if(fp==NULL) return 0;
+ fp= BLI_fopen(str, "r");
+ if (fp==NULL) return 0;
/* free memory: */
@@ -325,13 +329,13 @@ int reopen_text(Text *text)
text->nlines=0;
llen=0;
- for(i=0; i<len; i++) {
+ for (i=0; i<len; i++) {
if (buffer[i]=='\n') {
tmp= (TextLine*) MEM_mallocN(sizeof(TextLine), "textline");
tmp->line= (char*) MEM_mallocN(llen+1, "textline_string");
tmp->format= NULL;
- if(llen) memcpy(tmp->line, &buffer[i-llen], llen);
+ if (llen) memcpy(tmp->line, &buffer[i-llen], llen);
tmp->line[llen]=0;
tmp->len= llen;
@@ -351,7 +355,7 @@ int reopen_text(Text *text)
tmp->line= (char*) MEM_mallocN(llen+1, "textline_string");
tmp->format= NULL;
- if(llen) memcpy(tmp->line, &buffer[i-llen], llen);
+ if (llen) memcpy(tmp->line, &buffer[i-llen], llen);
tmp->line[llen]=0;
tmp->len= llen;
@@ -384,8 +388,8 @@ Text *add_text(const char *file, const char *relpath)
if (relpath) /* can be NULL (bg mode) */
BLI_path_abs(str, relpath);
- fp= fopen(str, "r");
- if(fp==NULL) return NULL;
+ fp= BLI_fopen(str, "r");
+ if (fp==NULL) return NULL;
ta= alloc_libblock(&bmain->text, ID_TXT, BLI_path_basename(str));
ta->id.us= 1;
@@ -394,7 +398,7 @@ Text *add_text(const char *file, const char *relpath)
ta->markers.first= ta->markers.last= NULL;
ta->curl= ta->sell= NULL;
- if((U.flag & USER_TXT_TABSTOSPACES_DISABLE)==0)
+ if ((U.flag & USER_TXT_TABSTOSPACES_DISABLE)==0)
ta->flags= TXT_TABSTOSPACES;
fseek(fp, 0L, SEEK_END);
@@ -418,13 +422,13 @@ Text *add_text(const char *file, const char *relpath)
ta->nlines=0;
llen=0;
- for(i=0; i<len; i++) {
+ for (i=0; i<len; i++) {
if (buffer[i]=='\n') {
tmp= (TextLine*) MEM_mallocN(sizeof(TextLine), "textline");
tmp->line= (char*) MEM_mallocN(llen+1, "textline_string");
tmp->format= NULL;
- if(llen) memcpy(tmp->line, &buffer[i-llen], llen);
+ if (llen) memcpy(tmp->line, &buffer[i-llen], llen);
tmp->line[llen]=0;
tmp->len= llen;
@@ -440,17 +444,17 @@ 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");
tmp->format= NULL;
- if(llen) memcpy(tmp->line, &buffer[i-llen], llen);
+ if (llen) memcpy(tmp->line, &buffer[i-llen], llen);
tmp->line[llen]=0;
tmp->len= llen;
@@ -477,7 +481,7 @@ Text *copy_text(Text *ta)
tan= copy_libblock(&ta->id);
/* file name can be NULL */
- if(ta->name) {
+ if (ta->name) {
tan->name= MEM_mallocN(strlen(ta->name)+1, "text_name");
strcpy(tan->name, ta->name);
}
@@ -527,25 +531,25 @@ void unlink_text(Main *bmain, Text *text)
bConstraint *con;
short update;
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next) {
/* game controllers */
- for(cont=ob->controllers.first; cont; cont=cont->next) {
- if(cont->type==CONT_PYTHON) {
+ for (cont=ob->controllers.first; cont; cont=cont->next) {
+ if (cont->type==CONT_PYTHON) {
bPythonCont *pc;
pc= cont->data;
- if(pc->text==text) pc->text= NULL;
+ if (pc->text==text) pc->text= NULL;
}
}
/* pyconstraints */
update = 0;
- if(ob->type==OB_ARMATURE && ob->pose) {
+ if (ob->type==OB_ARMATURE && ob->pose) {
bPoseChannel *pchan;
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- for(con = pchan->constraints.first; con; con=con->next) {
- if(con->type==CONSTRAINT_TYPE_PYTHON) {
+ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ for (con = pchan->constraints.first; con; con=con->next) {
+ if (con->type==CONSTRAINT_TYPE_PYTHON) {
bPythonConstraint *data = con->data;
if (data->text==text) data->text = NULL;
update = 1;
@@ -555,15 +559,15 @@ void unlink_text(Main *bmain, Text *text)
}
}
- for(con = ob->constraints.first; con; con=con->next) {
- if(con->type==CONSTRAINT_TYPE_PYTHON) {
+ for (con = ob->constraints.first; con; con=con->next) {
+ if (con->type==CONSTRAINT_TYPE_PYTHON) {
bPythonConstraint *data = con->data;
if (data->text==text) data->text = NULL;
update = 1;
}
}
- if(update)
+ if (update)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
@@ -571,13 +575,13 @@ void unlink_text(Main *bmain, Text *text)
// XXX nodeDynamicUnlinkText(&text->id);
/* text space */
- for(scr= bmain->screen.first; scr; scr= scr->id.next) {
- for(area= scr->areabase.first; area; area= area->next) {
- for(sl= area->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_TEXT) {
+ for (scr= bmain->screen.first; scr; scr= scr->id.next) {
+ for (area= scr->areabase.first; area; area= area->next) {
+ for (sl= area->spacedata.first; sl; sl= sl->next) {
+ if (sl->spacetype==SPACE_TEXT) {
SpaceText *st= (SpaceText*) sl;
- if(st->text==text) {
+ if (st->text==text) {
st->text= NULL;
st->top= 0;
}
@@ -597,7 +601,7 @@ void clear_text(Text *text) /* called directly from rna */
txt_set_undostate( 1 );
txt_sel_all( text );
txt_delete_sel(text);
- txt_set_undostate( oldstate );
+ txt_set_undostate(oldstate);
txt_make_dirty(text);
}
@@ -606,10 +610,10 @@ void write_text(Text *text, const char *str) /* called directly from rna */
{
int oldstate;
- oldstate = txt_get_undostate( );
- txt_insert_buf( text, str );
- txt_move_eof( text, 0 );
- txt_set_undostate( oldstate );
+ oldstate = txt_get_undostate();
+ txt_insert_buf(text, str);
+ txt_move_eof(text, 0);
+ txt_set_undostate(oldstate);
txt_make_dirty(text);
}
@@ -632,7 +636,7 @@ static TextLine *txt_new_line(const char *str)
{
TextLine *tmp;
- if(!str) str= "";
+ if (!str) str= "";
tmp= (TextLine *) MEM_mallocN(sizeof(TextLine), "textline");
tmp->line= MEM_mallocN(strlen(str)+1, "textline_string");
@@ -681,13 +685,13 @@ void txt_clean_text (Text *text)
while ((*top)->prev) *top= (*top)->prev;
while ((*bot)->next) *bot= (*bot)->next;
- if(!text->curl) {
- if(text->sell) text->curl= text->sell;
+ if (!text->curl) {
+ if (text->sell) text->curl= text->sell;
else text->curl= text->lines.first;
text->curc= 0;
}
- if(!text->sell) {
+ if (!text->sell) {
text->sell= text->curl;
text->selc= 0;
}
@@ -712,12 +716,12 @@ int txt_get_span (TextLine *from, TextLine *to)
if (!tmp) {
tmp= from;
ret=0;
- while(tmp) {
+ while (tmp) {
if (tmp == to) break;
ret--;
tmp= tmp->prev;
}
- if(!tmp) ret=0;
+ if (!tmp) ret=0;
}
return ret;
@@ -731,14 +735,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 */
/****************************/
@@ -759,10 +755,12 @@ static void txt_curs_first (Text *text, TextLine **linep, int *charp)
*linep= text->curl;
if (text->curc<text->selc) *charp= text->curc;
else *charp= text->selc;
- } else if (txt_get_span(text->lines.first, text->curl)<txt_get_span(text->lines.first, text->sell)) {
+ }
+ else if (txt_get_span(text->lines.first, text->curl)<txt_get_span(text->lines.first, text->sell)) {
*linep= text->curl;
*charp= text->curc;
- } else {
+ }
+ else {
*linep= text->sell;
*charp= text->selc;
}
@@ -812,24 +810,25 @@ void txt_move_up(Text *text, short sel)
/* int old; */ /* UNUSED */
if (!text) return;
- if(sel) txt_curs_sel(text, &linep, &charp);
+ if (sel) txt_curs_sel(text, &linep, &charp);
else { txt_pop_first(text); txt_curs_cur(text, &linep, &charp); }
if (!*linep) return;
/* old= *charp; */ /* UNUSED */
- if((*linep)->prev) {
+ if ((*linep)->prev) {
int index = txt_utf8_offset_to_index((*linep)->line, *charp);
*linep= (*linep)->prev;
if (index > txt_utf8_len((*linep)->line)) *charp= (*linep)->len;
else *charp= txt_utf8_index_to_offset((*linep)->line, index);
- if(!undoing)
+ if (!undoing)
txt_undo_add_op(text, sel?UNDO_SUP:UNDO_CUP);
- } else {
+ }
+ else {
txt_move_bol(text, sel);
}
- if(!sel) txt_pop_sel(text);
+ if (!sel) txt_pop_sel(text);
}
void txt_move_down(Text *text, short sel)
@@ -839,24 +838,25 @@ void txt_move_down(Text *text, short sel)
/* int old; */ /* UNUSED */
if (!text) return;
- if(sel) txt_curs_sel(text, &linep, &charp);
+ if (sel) txt_curs_sel(text, &linep, &charp);
else { txt_pop_last(text); txt_curs_cur(text, &linep, &charp); }
if (!*linep) return;
/* old= *charp; */ /* UNUSED */
- if((*linep)->next) {
+ if ((*linep)->next) {
int index = txt_utf8_offset_to_index((*linep)->line, *charp);
*linep= (*linep)->next;
if (index > txt_utf8_len((*linep)->line)) *charp= (*linep)->len;
else *charp= txt_utf8_index_to_offset((*linep)->line, index);
- if(!undoing)
+ if (!undoing)
txt_undo_add_op(text, sel?UNDO_SDOWN:UNDO_CDOWN);
- } else {
+ }
+ else {
txt_move_eol(text, sel);
}
- if(!sel) txt_pop_sel(text);
+ if (!sel) txt_pop_sel(text);
}
void txt_move_left(Text *text, short sel)
@@ -866,7 +866,7 @@ void txt_move_left(Text *text, short sel)
int tabsize= 0, i= 0;
if (!text) return;
- if(sel) txt_curs_sel(text, &linep, &charp);
+ if (sel) txt_curs_sel(text, &linep, &charp);
else { txt_pop_first(text); txt_curs_cur(text, &linep, &charp); }
if (!*linep) return;
@@ -904,9 +904,9 @@ void txt_move_left(Text *text, short sel)
}
undoing= oundoing;
- if(!undoing) txt_undo_add_op(text, sel?UNDO_SLEFT:UNDO_CLEFT);
+ if (!undoing) txt_undo_add_op(text, sel?UNDO_SLEFT:UNDO_CLEFT);
- if(!sel) txt_pop_sel(text);
+ if (!sel) txt_pop_sel(text);
}
void txt_move_right(Text *text, short sel)
@@ -915,7 +915,7 @@ void txt_move_right(Text *text, short sel)
int *charp, oundoing= undoing, do_tab= 0, i;
if (!text) return;
- if(sel) txt_curs_sel(text, &linep, &charp);
+ if (sel) txt_curs_sel(text, &linep, &charp);
else { txt_pop_last(text); txt_curs_cur(text, &linep, &charp); }
if (!*linep) return;
@@ -949,77 +949,77 @@ void txt_move_right(Text *text, short sel)
}
undoing= oundoing;
- if(!undoing) txt_undo_add_op(text, sel?UNDO_SRIGHT:UNDO_CRIGHT);
+ if (!undoing) txt_undo_add_op(text, sel?UNDO_SRIGHT:UNDO_CRIGHT);
- if(!sel) txt_pop_sel(text);
+ if (!sel) txt_pop_sel(text);
}
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);
+ 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);
+ 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);
}
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);
+ 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);
+ 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);
}
void txt_move_bol (Text *text, short sel)
@@ -1028,15 +1028,15 @@ void txt_move_bol (Text *text, short sel)
int *charp, old;
if (!text) return;
- if(sel) txt_curs_sel(text, &linep, &charp);
+ if (sel) txt_curs_sel(text, &linep, &charp);
else txt_curs_cur(text, &linep, &charp);
if (!*linep) return;
old= *charp;
*charp= 0;
- if(!sel) txt_pop_sel(text);
- if(!undoing) txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, txt_get_span(text->lines.first, *linep), old, txt_get_span(text->lines.first, *linep), (unsigned short)*charp);
+ if (!sel) txt_pop_sel(text);
+ if (!undoing) txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, txt_get_span(text->lines.first, *linep), old, txt_get_span(text->lines.first, *linep), (unsigned short)*charp);
}
void txt_move_eol (Text *text, short sel)
@@ -1045,15 +1045,15 @@ void txt_move_eol (Text *text, short sel)
int *charp, old;
if (!text) return;
- if(sel) txt_curs_sel(text, &linep, &charp);
+ if (sel) txt_curs_sel(text, &linep, &charp);
else txt_curs_cur(text, &linep, &charp);
if (!*linep) return;
old= *charp;
*charp= (*linep)->len;
- if(!sel) txt_pop_sel(text);
- if(!undoing) txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, txt_get_span(text->lines.first, *linep), old, txt_get_span(text->lines.first, *linep), (unsigned short)*charp);
+ if (!sel) txt_pop_sel(text);
+ if (!undoing) txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, txt_get_span(text->lines.first, *linep), old, txt_get_span(text->lines.first, *linep), (unsigned short)*charp);
}
void txt_move_bof (Text *text, short sel)
@@ -1062,7 +1062,7 @@ void txt_move_bof (Text *text, short sel)
int *charp, old;
if (!text) return;
- if(sel) txt_curs_sel(text, &linep, &charp);
+ if (sel) txt_curs_sel(text, &linep, &charp);
else txt_curs_cur(text, &linep, &charp);
if (!*linep) return;
old= *charp;
@@ -1070,8 +1070,8 @@ void txt_move_bof (Text *text, short sel)
*linep= text->lines.first;
*charp= 0;
- if(!sel) txt_pop_sel(text);
- if(!undoing) txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, txt_get_span(text->lines.first, *linep), old, txt_get_span(text->lines.first, *linep), (unsigned short)*charp);
+ if (!sel) txt_pop_sel(text);
+ if (!undoing) txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, txt_get_span(text->lines.first, *linep), old, txt_get_span(text->lines.first, *linep), (unsigned short)*charp);
}
void txt_move_eof (Text *text, short sel)
@@ -1080,7 +1080,7 @@ void txt_move_eof (Text *text, short sel)
int *charp, old;
if (!text) return;
- if(sel) txt_curs_sel(text, &linep, &charp);
+ if (sel) txt_curs_sel(text, &linep, &charp);
else txt_curs_cur(text, &linep, &charp);
if (!*linep) return;
old= *charp;
@@ -1088,8 +1088,8 @@ void txt_move_eof (Text *text, short sel)
*linep= text->lines.last;
*charp= (*linep)->len;
- if(!sel) txt_pop_sel(text);
- if(!undoing) txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, txt_get_span(text->lines.first, *linep), old, txt_get_span(text->lines.first, *linep), (unsigned short)*charp);
+ if (!sel) txt_pop_sel(text);
+ if (!undoing) txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, txt_get_span(text->lines.first, *linep), old, txt_get_span(text->lines.first, *linep), (unsigned short)*charp);
}
void txt_move_toline (Text *text, unsigned int line, short sel)
@@ -1105,7 +1105,7 @@ void txt_move_to (Text *text, unsigned int line, unsigned int ch, short sel)
unsigned int i;
if (!text) return;
- if(sel) txt_curs_sel(text, &linep, &charp);
+ if (sel) txt_curs_sel(text, &linep, &charp);
else txt_curs_cur(text, &linep, &charp);
if (!*linep) return;
oldc= *charp;
@@ -1120,8 +1120,8 @@ void txt_move_to (Text *text, unsigned int line, unsigned int ch, short sel)
ch= (unsigned int)((*linep)->len);
*charp= ch;
- if(!sel) txt_pop_sel(text);
- 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);
+ if (!sel) txt_pop_sel(text);
+ 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);
}
/****************************/
@@ -1141,7 +1141,7 @@ static void txt_curs_swap (Text *text)
text->curc= text->selc;
text->selc= tmpc;
- if(!undoing) txt_undo_add_op(text, UNDO_SWAP);
+ if (!undoing) txt_undo_add_op(text, UNDO_SWAP);
}
static void txt_pop_first (Text *text)
@@ -1152,7 +1152,7 @@ static void txt_pop_first (Text *text)
txt_curs_swap(text);
}
- if(!undoing) txt_undo_add_toop(text, UNDO_STO,
+ if (!undoing) txt_undo_add_toop(text, UNDO_STO,
txt_get_span(text->lines.first, text->sell),
text->selc,
txt_get_span(text->lines.first, text->curl),
@@ -1168,7 +1168,7 @@ static void txt_pop_last (Text *text)
txt_curs_swap(text);
}
- if(!undoing) txt_undo_add_toop(text, UNDO_STO,
+ if (!undoing) txt_undo_add_toop(text, UNDO_STO,
txt_get_span(text->lines.first, text->sell),
text->selc,
txt_get_span(text->lines.first, text->curl),
@@ -1218,7 +1218,7 @@ static void txt_delete_sel (Text *text)
txt_order_cursors(text);
- if(!undoing) {
+ if (!undoing) {
buf= txt_sel_to_buf(text);
txt_undo_add_block(text, UNDO_DBLOCK, buf);
MEM_freeN(buf);
@@ -1229,7 +1229,8 @@ static void txt_delete_sel (Text *text)
if (text->curl != text->sell) {
txt_clear_marker_region(text, text->curl, text->curc, text->curl->len, 0, 0);
move= txt_get_span(text->curl, text->sell);
- } else {
+ }
+ else {
mrk= txt_find_marker_region(text, text->curl, text->curc, text->selc, 0, 0);
if (mrk && (mrk->start > text->curc || mrk->end < text->selc))
txt_clear_marker_region(text, text->curl, text->curc, text->selc, 0, 0);
@@ -1315,7 +1316,8 @@ char *txt_to_buf (Text *text)
BLI_strncpy(buf, linef->line + charf, length+1);
buf[length]=0;
- } else {
+ }
+ else {
length= linef->len - charf;
length+= charl;
length+= 2; /* For the 2 '\n' */
@@ -1364,7 +1366,7 @@ int txt_find_string(Text *text, const char *findstr, int wrap, int match_case)
tl= startl= text->sell;
- if(match_case) s= strstr(&tl->line[text->selc], findstr);
+ if (match_case) s= strstr(&tl->line[text->selc], findstr);
else s= BLI_strcasestr(&tl->line[text->selc], findstr);
while (!s) {
tl= tl->next;
@@ -1375,7 +1377,7 @@ int txt_find_string(Text *text, const char *findstr, int wrap, int match_case)
break;
}
- if(match_case) s= strstr(tl->line, findstr);
+ if (match_case) s= strstr(tl->line, findstr);
else s= BLI_strcasestr(tl->line, findstr);
if (tl==startl)
break;
@@ -1387,7 +1389,8 @@ int txt_find_string(Text *text, const char *findstr, int wrap, int match_case)
txt_move_to(text, newl, newc, 0);
txt_move_to(text, newl, newc + strlen(findstr), 1);
return 1;
- } else
+ }
+ else
return 0;
}
@@ -1408,17 +1411,20 @@ char *txt_sel_to_buf (Text *text)
if (text->curc < text->selc) {
charf= text->curc;
charl= text->selc;
- } else{
+ }
+ else {
charf= text->selc;
charl= text->curc;
}
- } else if (txt_get_span(text->curl, text->sell)<0) {
+ }
+ else if (txt_get_span(text->curl, text->sell)<0) {
linef= text->sell;
linel= text->curl;
charf= text->selc;
charl= text->curc;
- } else {
+ }
+ else {
linef= text->curl;
linel= text->sell;
@@ -1432,7 +1438,8 @@ char *txt_sel_to_buf (Text *text)
buf= MEM_mallocN(length+1, "sel buffer");
BLI_strncpy(buf, linef->line + charf, length+1);
- } else {
+ }
+ else {
length+= linef->len - charf;
length+= charl;
length++; /* For the '\n' */
@@ -1494,7 +1501,7 @@ void txt_insert_buf(Text *text, const char *in_buffer)
buffer= BLI_strdupn(in_buffer, len);
len+= txt_extended_ascii_as_utf8(&buffer);
- if(!undoing) txt_undo_add_block(text, UNDO_IBLOCK, buffer);
+ if (!undoing) txt_undo_add_block(text, UNDO_IBLOCK, buffer);
u= undoing;
undoing= 1;
@@ -1517,13 +1524,14 @@ void txt_insert_buf(Text *text, const char *in_buffer)
i++; l++;
}
- if(buffer[i]=='\n') {
+ if (buffer[i]=='\n') {
add= txt_new_linen(buffer +(i-l), l);
BLI_insertlinkbefore(&text->lines, text->curl, add);
i++;
count++;
- } else {
- if(count) {
+ }
+ else {
+ if (count) {
txt_shift_markers(text, lineno, count);
count= 0;
}
@@ -1536,7 +1544,7 @@ void txt_insert_buf(Text *text, const char *in_buffer)
MEM_freeN(buffer);
- if(count) {
+ if (count) {
txt_shift_markers(text, lineno, count);
}
@@ -1550,12 +1558,13 @@ void txt_insert_buf(Text *text, const char *in_buffer)
static int max_undo_test(Text *text, int x)
{
while (text->undo_pos+x >= text->undo_len) {
- if(text->undo_len*2 > TXT_MAX_UNDO) {
+ if (text->undo_len*2 > TXT_MAX_UNDO) {
/* XXX error("Undo limit reached, buffer cleared\n"); */
MEM_freeN(text->undo_buf);
init_undo_text(text);
return 0;
- } else {
+ }
+ else {
void *tmp= text->undo_buf;
text->undo_buf= MEM_callocN(text->undo_len*2, "undo buf");
memcpy(text->undo_buf, tmp, text->undo_len);
@@ -1592,63 +1601,92 @@ void txt_print_undo(Text *text)
if (op==UNDO_CLEFT) {
ops= "Cursor left";
- } else if (op==UNDO_CRIGHT) {
+ }
+ else if (op==UNDO_CRIGHT) {
ops= "Cursor right";
- } else if (op==UNDO_CUP) {
+ }
+ else if (op==UNDO_CUP) {
ops= "Cursor up";
- } else if (op==UNDO_CDOWN) {
+ }
+ else if (op==UNDO_CDOWN) {
ops= "Cursor down";
- } else if (op==UNDO_SLEFT) {
+ }
+ else if (op==UNDO_SLEFT) {
ops= "Selection left";
- } else if (op==UNDO_SRIGHT) {
+ }
+ else if (op==UNDO_SRIGHT) {
ops= "Selection right";
- } else if (op==UNDO_SUP) {
+ }
+ else if (op==UNDO_SUP) {
ops= "Selection up";
- } else if (op==UNDO_SDOWN) {
+ }
+ else if (op==UNDO_SDOWN) {
ops= "Selection down";
- } else if (op==UNDO_STO) {
+ }
+ else if (op==UNDO_STO) {
ops= "Selection ";
- } else if (op==UNDO_CTO) {
+ }
+ else if (op==UNDO_CTO) {
ops= "Cursor ";
- } else if (op==UNDO_INSERT_1) {
+ }
+ else if (op==UNDO_INSERT_1) {
ops= "Insert ascii ";
- } else if (op==UNDO_INSERT_2) {
+ }
+ else if (op==UNDO_INSERT_2) {
ops= "Insert 2 bytes ";
- } else if (op==UNDO_INSERT_3) {
+ }
+ else if (op==UNDO_INSERT_3) {
ops= "Insert 3 bytes ";
- } else if (op==UNDO_INSERT_4) {
+ }
+ else if (op==UNDO_INSERT_4) {
ops= "Insert unicode ";
- } else if (op==UNDO_BS_1) {
+ }
+ else if (op==UNDO_BS_1) {
ops= "Backspace for ascii ";
- } else if (op==UNDO_BS_2) {
+ }
+ else if (op==UNDO_BS_2) {
ops= "Backspace for 2 bytes ";
- } else if (op==UNDO_BS_3) {
+ }
+ else if (op==UNDO_BS_3) {
ops= "Backspace for 3 bytes ";
- } else if (op==UNDO_BS_4) {
+ }
+ else if (op==UNDO_BS_4) {
ops= "Backspace for unicode ";
- } else if (op==UNDO_DEL_1) {
+ }
+ else if (op==UNDO_DEL_1) {
ops= "Delete ascii ";
- } else if (op==UNDO_DEL_2) {
+ }
+ else if (op==UNDO_DEL_2) {
ops= "Delete 2 bytes ";
- } else if (op==UNDO_DEL_3) {
+ }
+ else if (op==UNDO_DEL_3) {
ops= "Delete 3 bytes ";
- } else if (op==UNDO_DEL_4) {
+ }
+ else if (op==UNDO_DEL_4) {
ops= "Delete unicode ";
- } else if (op==UNDO_SWAP) {
+ }
+ else if (op==UNDO_SWAP) {
ops= "Cursor swap";
- } else if (op==UNDO_DBLOCK) {
+ }
+ else if (op==UNDO_DBLOCK) {
ops= "Delete text block";
- } else if (op==UNDO_IBLOCK) {
+ }
+ else if (op==UNDO_IBLOCK) {
ops= "Insert text block";
- } else if (op==UNDO_INDENT) {
+ }
+ else if (op==UNDO_INDENT) {
ops= "Indent ";
- } else if (op==UNDO_UNINDENT) {
+ }
+ else if (op==UNDO_UNINDENT) {
ops= "Unindent ";
- } else if (op==UNDO_COMMENT) {
+ }
+ else if (op==UNDO_COMMENT) {
ops= "Comment ";
- } else if (op==UNDO_UNCOMMENT) {
+ }
+ else if (op==UNDO_UNCOMMENT) {
ops= "Uncomment ";
- } else {
+ }
+ else {
ops= "Unknown";
}
@@ -1679,10 +1717,11 @@ void txt_print_undo(Text *text)
uc= uc+(text->undo_buf[i]<<24); i++;
c_len= BLI_str_utf8_from_unicode(uc, c);
c[c_len]= '\0';
- printf ("%s", c);
+ puts(c);
}
}
- } else if (op==UNDO_STO || op==UNDO_CTO) {
+ }
+ else if (op==UNDO_STO || op==UNDO_CTO) {
i++;
charp= text->undo_buf[i]; i++;
@@ -1704,7 +1743,8 @@ void txt_print_undo(Text *text)
linep= linep+(text->undo_buf[i]<<24); i++;
printf ("from <%d, %d>", linep, charp);
- } else if (op==UNDO_DBLOCK || op==UNDO_IBLOCK) {
+ }
+ else if (op==UNDO_DBLOCK || op==UNDO_IBLOCK) {
i++;
linep= text->undo_buf[i]; i++;
@@ -1724,7 +1764,8 @@ void txt_print_undo(Text *text)
linep= linep+(text->undo_buf[i]<<16); i++;
linep= linep+(text->undo_buf[i]<<24); i++;
printf ("> (%d)", linep);
- } else if (op==UNDO_INDENT || op==UNDO_UNINDENT) {
+ }
+ else if (op==UNDO_INDENT || op==UNDO_UNINDENT) {
i++;
charp= text->undo_buf[i]; i++;
@@ -1755,7 +1796,7 @@ void txt_print_undo(Text *text)
static void txt_undo_add_op(Text *text, int op)
{
- if(!max_undo_test(text, 2))
+ if (!max_undo_test(text, 2))
return;
text->undo_pos++;
@@ -1787,7 +1828,7 @@ static void txt_undo_add_block(Text *text, int op, const char *buf)
{
unsigned int length= strlen(buf);
- if(!max_undo_test(text, length+11))
+ if (!max_undo_test(text, length+11))
return;
text->undo_pos++;
@@ -1807,7 +1848,7 @@ static void txt_undo_add_block(Text *text, int op, const char *buf)
void txt_undo_add_toop(Text *text, int op, unsigned int froml, unsigned short fromc, unsigned int tol, unsigned short toc)
{
- if(!max_undo_test(text, 15))
+ if (!max_undo_test(text, 15))
return;
if (froml==tol && fromc==toc) return;
@@ -1832,7 +1873,7 @@ static void txt_undo_add_charop(Text *text, int op_start, unsigned int c)
char utf8[BLI_UTF8_MAX];
size_t i, utf8_size = BLI_str_utf8_from_unicode(c, utf8);
- if(!max_undo_test(text, 3 + utf8_size))
+ if (!max_undo_test(text, 3 + utf8_size))
return;
text->undo_pos++;
@@ -1847,7 +1888,8 @@ static void txt_undo_add_charop(Text *text, int op_start, unsigned int c)
}
text->undo_buf[text->undo_pos]= op_start + utf8_size - 1;
- } else {
+ }
+ else {
text->undo_buf[text->undo_pos]= op_start + 3;
text->undo_pos++;
txt_undo_store_uint32(text->undo_buf, &text->undo_pos, c);
@@ -2026,7 +2068,8 @@ void txt_do_undo(Text *text)
txt_move_toline(text, linep, 0);
text->curc= charp;
txt_pop_sel(text);
- } else {
+ }
+ else {
txt_move_toline(text, linep, 1);
text->selc= charp;
}
@@ -2075,7 +2118,7 @@ void txt_do_undo(Text *text)
text->curl= text->lines.first;
while (holdln>0) {
- if(text->curl->next)
+ if (text->curl->next)
text->curl= text->curl->next;
holdln--;
@@ -2149,11 +2192,14 @@ void txt_do_undo(Text *text)
if (op==UNDO_INDENT) {
txt_unindent(text);
- } else if (op== UNDO_UNINDENT) {
+ }
+ else if (op== UNDO_UNINDENT) {
txt_indent(text);
- } else if (op == UNDO_COMMENT) {
+ }
+ else if (op == UNDO_COMMENT) {
txt_uncomment(text);
- } else if (op == UNDO_UNCOMMENT) {
+ }
+ else if (op == UNDO_UNCOMMENT) {
txt_comment(text);
}
@@ -2274,7 +2320,8 @@ void txt_do_redo(Text *text)
txt_move_toline(text, linep, 0);
text->curc= charp;
txt_pop_sel(text);
- } else {
+ }
+ else {
txt_move_toline(text, linep, 1);
text->selc= charp;
}
@@ -2344,11 +2391,14 @@ void txt_do_redo(Text *text)
if (op==UNDO_INDENT) {
txt_indent(text);
- } else if (op== UNDO_UNINDENT) {
+ }
+ else if (op== UNDO_UNINDENT) {
txt_unindent(text);
- } else if (op == UNDO_COMMENT) {
+ }
+ else if (op == UNDO_COMMENT) {
txt_comment(text);
- } else if (op == UNDO_UNCOMMENT) {
+ }
+ else if (op == UNDO_UNCOMMENT) {
txt_uncomment(text);
}
break;
@@ -2387,7 +2437,8 @@ void txt_split_curline (Text *text)
mrk->lineno++;
mrk->start -= text->curc;
mrk->end -= text->curc;
- } else if (mrk->lineno > lineno) {
+ }
+ else if (mrk->lineno > lineno) {
mrk->lineno++;
}
mrk= mrk->next;
@@ -2424,7 +2475,7 @@ void txt_split_curline (Text *text)
txt_clean_text(text);
txt_pop_sel(text);
- if(!undoing) txt_undo_add_charop(text, UNDO_INSERT_1, '\n');
+ if (!undoing) txt_undo_add_charop(text, UNDO_INSERT_1, '\n');
}
static void txt_delete_line (Text *text, TextLine *line)
@@ -2465,7 +2516,7 @@ static void txt_combine_lines (Text *text, TextLine *linea, TextLine *lineb)
if (!text) return;
- if(!linea || !lineb) return;
+ if (!linea || !lineb) return;
mrk= txt_find_marker_region(text, lineb, 0, lineb->len, 0, 0);
if (mrk) {
@@ -2509,7 +2560,8 @@ void txt_delete_char(Text *text)
txt_combine_lines(text, text->curl, text->curl->next);
txt_pop_sel(text);
}
- } else { /* Just deleting a char */
+ }
+ else { /* Just deleting a char */
size_t c_len = 0;
TextMarker *mrk;
c= BLI_str_utf8_as_unicode_and_size(text->curl->line + text->curc, &c_len);
@@ -2520,7 +2572,8 @@ void txt_delete_char(Text *text)
if (mrk->end==text->curc) {
if ((mrk->flags & TMARK_TEMP) && !(mrk->flags & TMARK_EDITALL)) {
txt_clear_markers(text, mrk->group, TMARK_TEMP);
- } else {
+ }
+ else {
BLI_freelinkN(&text->markers, mrk);
}
return;
@@ -2542,7 +2595,7 @@ void txt_delete_char(Text *text)
txt_make_dirty(text);
txt_clean_text(text);
- if(!undoing) txt_undo_add_charop(text, UNDO_DEL_1, c);
+ if (!undoing) txt_undo_add_charop(text, UNDO_DEL_1, c);
}
void txt_delete_word (Text *text)
@@ -2584,7 +2637,8 @@ void txt_backspace_char (Text *text)
if (mrk->start==text->curc) {
if ((mrk->flags & TMARK_TEMP) && !(mrk->flags & TMARK_EDITALL)) {
txt_clear_markers(text, mrk->group, TMARK_TEMP);
- } else {
+ }
+ else {
BLI_freelinkN(&text->markers, mrk);
}
return;
@@ -2607,7 +2661,7 @@ void txt_backspace_char (Text *text)
txt_make_dirty(text);
txt_clean_text(text);
- if(!undoing) txt_undo_add_charop(text, UNDO_BS_1, c);
+ if (!undoing) txt_undo_add_charop(text, UNDO_BS_1, c);
}
void txt_backspace_word (Text *text)
@@ -2617,7 +2671,7 @@ void txt_backspace_word (Text *text)
}
/* Max spaces to replace a tab with, currently hardcoded to TXT_TABSIZE = 4.
- * Used by txt_convert_tab_to_spaces, indent and unintent.
+ * Used by txt_convert_tab_to_spaces, indent and unindent.
* Remember to change this string according to max tab size */
static char tab_to_spaces[] = " ";
@@ -2680,7 +2734,7 @@ static int txt_add_char_intern (Text *text, unsigned int add, int replace_tabs)
txt_make_dirty(text);
txt_clean_text(text);
- if(!undoing) txt_undo_add_charop(text, UNDO_INSERT_1, add);
+ if (!undoing) txt_undo_add_charop(text, UNDO_INSERT_1, add);
return 1;
}
@@ -2726,7 +2780,8 @@ int txt_replace_char (Text *text, unsigned int add)
memcpy(tmp+text->curc+add_size, text->curl->line+text->curc+del_size, text->curl->len-text->curc-del_size+1);
MEM_freeN(text->curl->line);
text->curl->line = tmp;
- } else if (add_size < del_size) {
+ }
+ else if (add_size < del_size) {
char *tmp= text->curl->line;
memmove(tmp+text->curc+add_size, tmp+text->curc+del_size, text->curl->len-text->curc-del_size+1);
}
@@ -2739,7 +2794,7 @@ int txt_replace_char (Text *text, unsigned int add)
txt_clean_text(text);
/* Should probably create a new op for this */
- if(!undoing) {
+ if (!undoing) {
txt_undo_add_charop(text, UNDO_DEL_1, del);
txt_undo_add_charop(text, UNDO_INSERT_1, add);
}
@@ -2777,11 +2832,11 @@ void txt_indent(Text *text)
tmp= MEM_mallocN(text->curl->len+indentlen+1, "textline_string");
text->curc = 0;
- if(text->curc) memcpy(tmp, text->curl->line, text->curc); /* XXX never true, check prev line */
+ if (text->curc) memcpy(tmp, text->curl->line, text->curc); /* XXX never true, check prev line */
memcpy(tmp+text->curc, add, indentlen);
len= text->curl->len - text->curc;
- if(len>0) memcpy(tmp+text->curc+indentlen, text->curl->line+text->curc, len);
+ if (len>0) memcpy(tmp+text->curc+indentlen, text->curl->line+text->curc, len);
tmp[text->curl->len+indentlen]= 0;
make_new_line(text->curl, tmp);
@@ -2791,23 +2846,24 @@ void txt_indent(Text *text)
txt_make_dirty(text);
txt_clean_text(text);
- if(text->curl == text->sell)
+ if (text->curl == text->sell)
{
text->selc = text->sell->len;
break;
- } else {
+ }
+ else {
text->curl = text->curl->next;
num++;
}
}
text->curc = 0;
- while( num > 0 )
+ while ( num > 0 )
{
text->curl = text->curl->prev;
num--;
}
- if(!undoing)
+ if (!undoing)
{
txt_undo_add_toop(text, UNDO_INDENT, txt_get_span(text->lines.first, text->curl), text->curc, txt_get_span(text->lines.first, text->sell), text->selc);
}
@@ -2832,13 +2888,13 @@ void txt_unindent(Text *text)
indent = spaceslen;
}
- while(TRUE)
+ while (TRUE)
{
int i = 0;
if (BLI_strncasecmp(text->curl->line, remove, indent) == 0)
{
- while(i< text->curl->len) {
+ while (i< text->curl->len) {
text->curl->line[i]= text->curl->line[i+indent];
i++;
}
@@ -2848,24 +2904,25 @@ void txt_unindent(Text *text)
txt_make_dirty(text);
txt_clean_text(text);
- if(text->curl == text->sell)
+ if (text->curl == text->sell)
{
text->selc = text->sell->len;
break;
- } else {
+ }
+ else {
text->curl = text->curl->next;
num++;
}
}
text->curc = 0;
- while( num > 0 )
+ while ( num > 0 )
{
text->curl = text->curl->prev;
num--;
}
- if(!undoing)
+ if (!undoing)
{
txt_undo_add_toop(text, UNDO_UNINDENT, txt_get_span(text->lines.first, text->curl), text->curc, txt_get_span(text->lines.first, text->sell), text->selc);
}
@@ -2887,11 +2944,11 @@ void txt_comment(Text *text)
tmp= MEM_mallocN(text->curl->len+2, "textline_string");
text->curc = 0;
- if(text->curc) memcpy(tmp, text->curl->line, text->curc);
+ if (text->curc) memcpy(tmp, text->curl->line, text->curc);
tmp[text->curc]= add;
len= text->curl->len - text->curc;
- if(len>0) memcpy(tmp+text->curc+1, text->curl->line+text->curc, len);
+ if (len>0) memcpy(tmp+text->curc+1, text->curl->line+text->curc, len);
tmp[text->curl->len+1]=0;
make_new_line(text->curl, tmp);
@@ -2901,23 +2958,24 @@ void txt_comment(Text *text)
txt_make_dirty(text);
txt_clean_text(text);
- if(text->curl == text->sell)
+ if (text->curl == text->sell)
{
text->selc = text->sell->len;
break;
- } else {
+ }
+ else {
text->curl = text->curl->next;
num++;
}
}
text->curc = 0;
- while( num > 0 )
+ while ( num > 0 )
{
text->curl = text->curl->prev;
num--;
}
- if(!undoing)
+ if (!undoing)
{
txt_undo_add_toop(text, UNDO_COMMENT, txt_get_span(text->lines.first, text->curl), text->curc, txt_get_span(text->lines.first, text->sell), text->selc);
}
@@ -2932,13 +2990,13 @@ void txt_uncomment(Text *text)
if (!text->curl) return;
if (!text->sell) return;
- while(TRUE)
+ while (TRUE)
{
int i = 0;
if (text->curl->line[i] == remove)
{
- while(i< text->curl->len) {
+ while (i< text->curl->len) {
text->curl->line[i]= text->curl->line[i+1];
i++;
}
@@ -2949,24 +3007,25 @@ void txt_uncomment(Text *text)
txt_make_dirty(text);
txt_clean_text(text);
- if(text->curl == text->sell)
+ if (text->curl == text->sell)
{
text->selc = text->sell->len;
break;
- } else {
+ }
+ else {
text->curl = text->curl->next;
num++;
}
}
text->curc = 0;
- while( num > 0 )
+ while ( num > 0 )
{
text->curl = text->curl->prev;
num--;
}
- if(!undoing)
+ if (!undoing)
{
txt_undo_add_toop(text, UNDO_UNCOMMENT, txt_get_span(text->lines.first, text->curl), text->curc, txt_get_span(text->lines.first, text->sell), text->selc);
}
@@ -2989,11 +3048,12 @@ int setcurr_tab_spaces (Text *text, int space)
if (i == text->curc)
{
return i;
- } else {
+ }
+ else {
i++;
}
}
- if(strstr(text->curl->line, word))
+ if (strstr(text->curl->line, word))
{
/* if we find a ':' on this line, then add a tab but not if it is:
* 1) in a comment
@@ -3001,14 +3061,16 @@ int setcurr_tab_spaces (Text *text, int space)
* 3) after the cursor (text->curc), i.e. when creating space before a function def [#25414]
*/
int a, is_indent = 0;
- for(a=0; (a < text->curc) && (text->curl->line[a] != '\0'); a++)
+ for (a=0; (a < text->curc) && (text->curl->line[a] != '\0'); a++)
{
char ch= text->curl->line[a];
if (ch=='#') {
break;
- } else if (ch==':') {
+ }
+ else if (ch==':') {
is_indent = 1;
- } else if (ch!=' ' && ch!='\t') {
+ }
+ else if (ch!=' ' && ch!='\t') {
is_indent = 0;
}
}
@@ -3017,12 +3079,12 @@ int setcurr_tab_spaces (Text *text, int space)
}
}
- for(test=0; back_words[test]; test++)
+ for (test=0; back_words[test]; test++)
{
/* if there are these key words then remove a tab because we are done with the block */
- if(strstr(text->curl->line, back_words[test]) && i > 0)
+ if (strstr(text->curl->line, back_words[test]) && i > 0)
{
- if(strcspn(text->curl->line, back_words[test]) < strcspn(text->curl->line, comm))
+ if (strcspn(text->curl->line, back_words[test]) < strcspn(text->curl->line, comm))
{
i -= space;
}
@@ -3062,8 +3124,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 +3147,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 +3173,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 +3193,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 +3212,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 +3226,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;
@@ -3188,10 +3250,10 @@ int text_check_bracket(char ch)
char opens[] = "([{";
char close[] = ")]}";
- for(a=0; a<(sizeof(opens)-1); a++) {
- if(ch==opens[a])
+ for (a=0; a<(sizeof(opens)-1); a++) {
+ if (ch==opens[a])
return a+1;
- else if(ch==close[a])
+ else if (ch==close[a])
return -(a+1);
}
return 0;
@@ -3202,8 +3264,8 @@ int text_check_delim(char ch)
int a;
char delims[] = "():\"\' ~!%^&*-+=[]{};/<>|.#\t,";
- for(a=0; a<(sizeof(delims)-1); a++) {
- if(ch==delims[a])
+ for (a=0; a<(sizeof(delims)-1); a++) {
+ if (ch==delims[a])
return 1;
}
return 0;
@@ -3211,25 +3273,25 @@ int text_check_delim(char ch)
int text_check_digit(char ch)
{
- if(ch < '0') return 0;
- if(ch <= '9') return 1;
+ if (ch < '0') return 0;
+ if (ch <= '9') return 1;
return 0;
}
int text_check_identifier(char ch)
{
- if(ch < '0') return 0;
- if(ch <= '9') return 1;
- if(ch < 'A') return 0;
- if(ch <= 'Z' || ch == '_') return 1;
- if(ch < 'a') return 0;
- if(ch <= 'z') return 1;
+ if (ch < '0') return 0;
+ if (ch <= '9') return 1;
+ if (ch < 'A') return 0;
+ if (ch <= 'Z' || ch == '_') return 1;
+ if (ch < 'a') return 0;
+ if (ch <= 'z') return 1;
return 0;
}
int text_check_whitespace(char ch)
{
- if(ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n')
+ if (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n')
return 1;
return 0;
}
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 4c40dca3365..3f40c2bd429 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -81,7 +81,7 @@ int test_dlerr(const char *name, const char *symbol)
char *err;
err= BLI_dynlib_get_error_as_string(NULL);
- if(err) {
+ if (err) {
printf("var1: %s, var2: %s, var3: %s\n", name, symbol, err);
return 1;
}
@@ -109,12 +109,12 @@ void open_plugin_tex(PluginTex *pit)
BLI_dynlib_get_error_as_string(NULL);
/* no BLI_dynlib_close! multiple opened plugins... */
- /* if(pit->handle) BLI_dynlib_close(pit->handle); */
+ /* if (pit->handle) BLI_dynlib_close(pit->handle); */
/* pit->handle= 0; */
/* open the needed object */
pit->handle= BLI_dynlib_open(pit->name);
- if(test_dlerr(pit->name, pit->name)) return;
+ if (test_dlerr(pit->name, pit->name)) return;
if (pit->handle != NULL) {
/* find the address of the version function */
@@ -123,7 +123,7 @@ void open_plugin_tex(PluginTex *pit)
if (version != NULL) {
pit->version= version();
- if( pit->version >= 2 && pit->version <=6) {
+ if ( pit->version >= 2 && pit->version <=6) {
int (*info_func)(PluginInfo *);
PluginInfo *info= (PluginInfo*) MEM_mallocN(sizeof(PluginInfo), "plugin_info");
@@ -146,7 +146,8 @@ void open_plugin_tex(PluginTex *pit)
if (info->init) info->init();
}
MEM_freeN(info);
- } else {
+ }
+ else {
printf ("Plugin returned unrecognized version number\n");
return;
}
@@ -171,18 +172,18 @@ PluginTex *add_plugin_tex(char *str)
BLI_strncpy(pit->name, str, sizeof(pit->name));
open_plugin_tex(pit);
- if(pit->doit==NULL) {
- if(pit->handle==NULL) {;} //XXX error("no plugin: %s", str);
+ if (pit->doit==NULL) {
+ if (pit->handle==NULL) {;} //XXX error("no plugin: %s", str);
else {;} //XXX error("in plugin: %s", str);
MEM_freeN(pit);
return NULL;
}
varstr= pit->varstr;
- for(a=0; a<pit->vars; a++, varstr++) {
- if( (varstr->type & FLO)==FLO)
+ for (a=0; a<pit->vars; a++, varstr++) {
+ if ( (varstr->type & FLO)==FLO)
pit->data[a]= varstr->def;
- else if( (varstr->type & INT)==INT)
+ else if ( (varstr->type & INT)==INT)
*((int *)(pit->data+a))= (int) varstr->def;
}
@@ -196,7 +197,7 @@ PluginTex *add_plugin_tex(char *str)
void free_plugin_tex(PluginTex *pit)
{
- if(pit==NULL) return;
+ if (pit==NULL) return;
/* no BLI_dynlib_close: same plugin can be opened multiple times, 1 handle */
MEM_freeN(pit);
@@ -231,7 +232,7 @@ void init_tex_mapping(TexMapping *texmap)
{
float smat[3][3], rmat[3][3], mat[3][3], proj[3][3];
- if(texmap->projx == PROJ_X && texmap->projy == PROJ_Y && texmap->projz == PROJ_Z &&
+ if (texmap->projx == PROJ_X && texmap->projy == PROJ_Y && texmap->projz == PROJ_Z &&
is_zero_v3(texmap->loc) && is_zero_v3(texmap->rot) && is_one_v3(texmap->size)) {
unit_m4(texmap->mat);
@@ -241,11 +242,11 @@ void init_tex_mapping(TexMapping *texmap)
/* axis projection */
zero_m3(proj);
- if(texmap->projx != PROJ_N)
+ if (texmap->projx != PROJ_N)
proj[texmap->projx-1][0]= 1.0f;
- if(texmap->projy != PROJ_N)
+ if (texmap->projy != PROJ_N)
proj[texmap->projy-1][1]= 1.0f;
- if(texmap->projz != PROJ_N)
+ if (texmap->projz != PROJ_N)
proj[texmap->projz-1][2]= 1.0f;
/* scale */
@@ -302,7 +303,7 @@ void init_colorband(ColorBand *coba, int rangetype)
coba->data[0].pos= 0.0;
coba->data[1].pos= 1.0;
- if(rangetype==0) {
+ if (rangetype==0) {
coba->data[0].r= 0.0;
coba->data[0].g= 0.0;
coba->data[0].b= 0.0;
@@ -325,7 +326,7 @@ void init_colorband(ColorBand *coba, int rangetype)
coba->data[1].a= 1.0;
}
- for(a=2; a<MAXCOLORBAND; a++) {
+ for (a=2; a<MAXCOLORBAND; a++) {
coba->data[a].r= 0.5;
coba->data[a].g= 0.5;
coba->data[a].b= 0.5;
@@ -355,17 +356,17 @@ int do_colorband(const ColorBand *coba, float in, float out[4])
float fac, mfac, t[4];
int a;
- if(coba==NULL || coba->tot==0) return 0;
+ if (coba==NULL || coba->tot==0) return 0;
cbd1= coba->data;
- if(coba->tot==1) {
+ if (coba->tot==1) {
out[0]= cbd1->r;
out[1]= cbd1->g;
out[2]= cbd1->b;
out[3]= cbd1->a;
}
else {
- if(in <= cbd1->pos && coba->ipotype<2) {
+ if (in <= cbd1->pos && coba->ipotype<2) {
out[0]= cbd1->r;
out[1]= cbd1->g;
out[2]= cbd1->b;
@@ -375,22 +376,22 @@ int do_colorband(const ColorBand *coba, float in, float out[4])
CBData left, right;
/* we're looking for first pos > in */
- for(a=0; a<coba->tot; a++, cbd1++) if(cbd1->pos > in) break;
+ for (a=0; a<coba->tot; a++, cbd1++) if (cbd1->pos > in) break;
- if(a==coba->tot) {
+ if (a==coba->tot) {
cbd2= cbd1-1;
right= *cbd2;
right.pos= 1.0f;
cbd1= &right;
}
- else if(a==0) {
+ else if (a==0) {
left= *cbd1;
left.pos= 0.0f;
cbd2= &left;
}
else cbd2= cbd1-1;
- if(in >= cbd1->pos && coba->ipotype<2) {
+ if (in >= cbd1->pos && coba->ipotype<2) {
out[0]= cbd1->r;
out[1]= cbd1->g;
out[2]= cbd1->b;
@@ -398,7 +399,7 @@ int do_colorband(const ColorBand *coba, float in, float out[4])
}
else {
- if(cbd2->pos!=cbd1->pos)
+ if (cbd2->pos!=cbd1->pos)
fac= (in-cbd1->pos)/(cbd2->pos-cbd1->pos);
else {
/* was setting to 0.0 in 2.56 & previous, but this
@@ -415,17 +416,17 @@ int do_colorband(const ColorBand *coba, float in, float out[4])
return 1;
}
- if(coba->ipotype>=2) {
+ if (coba->ipotype>=2) {
/* ipo from right to left: 3 2 1 0 */
- if(a>=coba->tot-1) cbd0= cbd1;
+ if (a>=coba->tot-1) cbd0= cbd1;
else cbd0= cbd1+1;
- if(a<2) cbd3= cbd2;
+ if (a<2) cbd3= cbd2;
else cbd3= cbd2-1;
CLAMP(fac, 0.0f, 1.0f);
- if(coba->ipotype==3)
+ if (coba->ipotype==3)
key_curve_position_weights(fac, t, KEY_CARDINAL);
else
key_curve_position_weights(fac, t, KEY_BSPLINE);
@@ -441,7 +442,7 @@ int do_colorband(const ColorBand *coba, float in, float out[4])
}
else {
- if(coba->ipotype==1) { /* EASE */
+ if (coba->ipotype==1) { /* EASE */
mfac= fac*fac;
fac= 3.0f*mfac-2.0f*mfac*fac;
}
@@ -465,7 +466,7 @@ void colorband_table_RGBA(ColorBand *coba, float **array, int *size)
*size = CM_TABLE+1;
*array = MEM_callocN(sizeof(float)*(*size)*4, "ColorBand");
- for(a=0; a<*size; a++)
+ for (a=0; a<*size; a++)
do_colorband(coba, (float)a/(float)CM_TABLE, &(*array)[a*4]);
}
@@ -473,8 +474,8 @@ int vergcband(const void *a1, const void *a2)
{
const CBData *x1=a1, *x2=a2;
- if( x1->pos > x2->pos ) return 1;
- else if( x1->pos < x2->pos) return -1;
+ if ( x1->pos > x2->pos ) return 1;
+ else if ( x1->pos < x2->pos) return -1;
return 0;
}
@@ -482,16 +483,16 @@ void colorband_update_sort(ColorBand *coba)
{
int a;
- if(coba->tot<2)
+ if (coba->tot<2)
return;
- for(a=0; a<coba->tot; a++)
+ for (a=0; a<coba->tot; a++)
coba->data[a].cur= a;
qsort(coba->data, coba->tot, sizeof(CBData), vergcband);
- for(a=0; a<coba->tot; a++) {
- if(coba->data[a].cur==coba->cur) {
+ for (a=0; a<coba->tot; a++) {
+ if (coba->data[a].cur==coba->cur) {
coba->cur= a;
break;
}
@@ -500,10 +501,10 @@ void colorband_update_sort(ColorBand *coba)
CBData *colorband_element_add(struct ColorBand *coba, float position)
{
- if(coba->tot==MAXCOLORBAND) {
+ if (coba->tot==MAXCOLORBAND) {
return NULL;
}
- else if(coba->tot > 0) {
+ else if (coba->tot > 0) {
CBData *xnew;
float col[4];
@@ -530,16 +531,16 @@ int colorband_element_remove(struct ColorBand *coba, int index)
{
int a;
- if(coba->tot < 2)
+ if (coba->tot < 2)
return 0;
- if(index < 0 || index >= coba->tot)
+ if (index < 0 || index >= coba->tot)
return 0;
- for(a = index; a < coba->tot; a++) {
+ for (a = index; a < coba->tot; a++) {
coba->data[a] = coba->data[a + 1];
}
- if(coba->cur) coba->cur--;
+ if (coba->cur) coba->cur--;
coba->tot--;
return 1;
}
@@ -550,18 +551,18 @@ void free_texture(Tex *tex)
{
free_plugin_tex(tex->plugin);
- if(tex->coba) MEM_freeN(tex->coba);
- if(tex->env) BKE_free_envmap(tex->env);
- if(tex->pd) BKE_free_pointdensity(tex->pd);
- if(tex->vd) BKE_free_voxeldata(tex->vd);
- if(tex->ot) BKE_free_oceantex(tex->ot);
+ if (tex->coba) MEM_freeN(tex->coba);
+ if (tex->env) BKE_free_envmap(tex->env);
+ if (tex->pd) BKE_free_pointdensity(tex->pd);
+ if (tex->vd) BKE_free_voxeldata(tex->vd);
+ if (tex->ot) BKE_free_oceantex(tex->ot);
BKE_free_animdata((struct ID *)tex);
BKE_previewimg_free(&tex->preview);
BKE_icon_delete((struct ID*)tex);
tex->id.icon_id = 0;
- if(tex->nodetree) {
+ if (tex->nodetree) {
ntreeFreeTree(tex->nodetree);
MEM_freeN(tex->nodetree);
}
@@ -645,8 +646,8 @@ void default_tex(Tex *tex)
pit = tex->plugin;
if (pit) {
varstr= pit->varstr;
- if(varstr) {
- for(a=0; a<pit->vars; a++, varstr++) {
+ if (varstr) {
+ for (a=0; a<pit->vars; a++, varstr++) {
pit->data[a] = varstr->def;
}
}
@@ -786,11 +787,11 @@ MTex *add_mtex_id(ID *id, int slot)
give_active_mtex(id, &mtex_ar, &act);
- if(mtex_ar==NULL) {
+ if (mtex_ar==NULL) {
return NULL;
}
- if(slot==-1) {
+ if (slot==-1) {
/* find first free */
int i;
for (i= 0; i < MAX_MTEX; i++) {
@@ -799,13 +800,13 @@ MTex *add_mtex_id(ID *id, int slot)
break;
}
}
- if(slot == -1) {
+ if (slot == -1) {
return NULL;
}
}
else {
/* make sure slot is valid */
- if(slot < 0 || slot >= MAX_MTEX) {
+ if (slot < 0 || slot >= MAX_MTEX) {
return NULL;
}
}
@@ -828,22 +829,22 @@ Tex *copy_texture(Tex *tex)
Tex *texn;
texn= copy_libblock(&tex->id);
- if(texn->type==TEX_IMAGE) id_us_plus((ID *)texn->ima);
+ if (texn->type==TEX_IMAGE) id_us_plus((ID *)texn->ima);
else texn->ima= NULL;
- if(texn->plugin) {
+ if (texn->plugin) {
texn->plugin= MEM_dupallocN(texn->plugin);
open_plugin_tex(texn->plugin);
}
- if(texn->coba) texn->coba= MEM_dupallocN(texn->coba);
- if(texn->env) texn->env= BKE_copy_envmap(texn->env);
- if(texn->pd) texn->pd= BKE_copy_pointdensity(texn->pd);
- if(texn->vd) texn->vd= MEM_dupallocN(texn->vd);
- if(texn->ot) texn->ot= BKE_copy_oceantex(texn->ot);
- if(tex->preview) texn->preview = BKE_previewimg_copy(tex->preview);
+ if (texn->coba) texn->coba= MEM_dupallocN(texn->coba);
+ if (texn->env) texn->env= BKE_copy_envmap(texn->env);
+ if (texn->pd) texn->pd= BKE_copy_pointdensity(texn->pd);
+ if (texn->vd) texn->vd= MEM_dupallocN(texn->vd);
+ if (texn->ot) texn->ot= BKE_copy_oceantex(texn->ot);
+ if (tex->preview) texn->preview = BKE_previewimg_copy(tex->preview);
- if(tex->nodetree) {
+ if (tex->nodetree) {
if (tex->nodetree->execdata) {
ntreeTexEndExecTree(tex->nodetree->execdata, 1);
}
@@ -863,29 +864,29 @@ Tex *localize_texture(Tex *tex)
/* image texture: free_texture also doesn't decrease */
- if(texn->plugin) {
+ if (texn->plugin) {
texn->plugin= MEM_dupallocN(texn->plugin);
open_plugin_tex(texn->plugin);
}
- if(texn->coba) texn->coba= MEM_dupallocN(texn->coba);
- if(texn->env) {
+ if (texn->coba) texn->coba= MEM_dupallocN(texn->coba);
+ if (texn->env) {
texn->env= BKE_copy_envmap(texn->env);
id_us_min(&texn->env->ima->id);
}
- if(texn->pd) texn->pd= BKE_copy_pointdensity(texn->pd);
- if(texn->vd) {
+ if (texn->pd) texn->pd= BKE_copy_pointdensity(texn->pd);
+ if (texn->vd) {
texn->vd= MEM_dupallocN(texn->vd);
- if(texn->vd->dataset)
+ if (texn->vd->dataset)
texn->vd->dataset= MEM_dupallocN(texn->vd->dataset);
}
- if(texn->ot) {
+ if (texn->ot) {
texn->ot= BKE_copy_oceantex(tex->ot);
}
texn->preview = NULL;
- if(tex->nodetree) {
+ if (tex->nodetree) {
texn->nodetree= ntreeLocalize(tex->nodetree);
}
@@ -911,72 +912,72 @@ 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;
+ if (tex->id.lib==NULL) return;
- if(tex->id.us==1) {
+ if (tex->id.us==1) {
id_clear_lib_data(bmain, &tex->id);
extern_local_texture(tex);
return;
}
ma= bmain->mat.first;
- while(ma) {
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a] && ma->mtex[a]->tex==tex) {
- if(ma->id.lib) is_lib= TRUE;
+ while (ma) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (ma->mtex[a] && ma->mtex[a]->tex==tex) {
+ if (ma->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
}
ma= ma->id.next;
}
la= bmain->lamp.first;
- while(la) {
- for(a=0; a<MAX_MTEX; a++) {
- if(la->mtex[a] && la->mtex[a]->tex==tex) {
- if(la->id.lib) is_lib= TRUE;
+ while (la) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (la->mtex[a] && la->mtex[a]->tex==tex) {
+ if (la->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
}
la= la->id.next;
}
wrld= bmain->world.first;
- while(wrld) {
- for(a=0; a<MAX_MTEX; a++) {
- if(wrld->mtex[a] && wrld->mtex[a]->tex==tex) {
- if(wrld->id.lib) is_lib= TRUE;
+ while (wrld) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (wrld->mtex[a] && wrld->mtex[a]->tex==tex) {
+ if (wrld->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
}
wrld= wrld->id.next;
}
br= bmain->brush.first;
- while(br) {
- if(br->mtex.tex==tex) {
- if(br->id.lib) is_lib= TRUE;
+ while (br) {
+ if (br->mtex.tex==tex) {
+ if (br->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
br= br->id.next;
}
pa= bmain->particle.first;
- while(pa) {
- for(a=0; a<MAX_MTEX; a++) {
- if(pa->mtex[a] && pa->mtex[a]->tex==tex) {
- if(pa->id.lib) is_lib= TRUE;
+ while (pa) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (pa->mtex[a] && pa->mtex[a]->tex==tex) {
+ if (pa->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
}
pa= pa->id.next;
}
- if(is_local && is_lib == FALSE) {
+ if (is_local && is_lib == FALSE) {
id_clear_lib_data(bmain, &tex->id);
extern_local_texture(tex);
}
- else if(is_local && is_lib) {
+ else if (is_local && is_lib) {
Tex *tex_new= copy_texture(tex);
tex_new->id.us= 0;
@@ -985,10 +986,10 @@ void make_local_texture(Tex *tex)
BKE_id_lib_local_paths(bmain, tex->id.lib, &tex_new->id);
ma= bmain->mat.first;
- while(ma) {
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a] && ma->mtex[a]->tex==tex) {
- if(ma->id.lib==NULL) {
+ while (ma) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (ma->mtex[a] && ma->mtex[a]->tex==tex) {
+ if (ma->id.lib==NULL) {
ma->mtex[a]->tex= tex_new;
tex_new->id.us++;
tex->id.us--;
@@ -998,10 +999,10 @@ void make_local_texture(Tex *tex)
ma= ma->id.next;
}
la= bmain->lamp.first;
- while(la) {
- for(a=0; a<MAX_MTEX; a++) {
- if(la->mtex[a] && la->mtex[a]->tex==tex) {
- if(la->id.lib==NULL) {
+ while (la) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (la->mtex[a] && la->mtex[a]->tex==tex) {
+ if (la->id.lib==NULL) {
la->mtex[a]->tex= tex_new;
tex_new->id.us++;
tex->id.us--;
@@ -1011,10 +1012,10 @@ void make_local_texture(Tex *tex)
la= la->id.next;
}
wrld= bmain->world.first;
- while(wrld) {
- for(a=0; a<MAX_MTEX; a++) {
- if(wrld->mtex[a] && wrld->mtex[a]->tex==tex) {
- if(wrld->id.lib==NULL) {
+ while (wrld) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (wrld->mtex[a] && wrld->mtex[a]->tex==tex) {
+ if (wrld->id.lib==NULL) {
wrld->mtex[a]->tex= tex_new;
tex_new->id.us++;
tex->id.us--;
@@ -1024,9 +1025,9 @@ void make_local_texture(Tex *tex)
wrld= wrld->id.next;
}
br= bmain->brush.first;
- while(br) {
- if(br->mtex.tex==tex) {
- if(br->id.lib==NULL) {
+ while (br) {
+ if (br->mtex.tex==tex) {
+ if (br->id.lib==NULL) {
br->mtex.tex= tex_new;
tex_new->id.us++;
tex->id.us--;
@@ -1035,10 +1036,10 @@ void make_local_texture(Tex *tex)
br= br->id.next;
}
pa= bmain->particle.first;
- while(pa) {
- for(a=0; a<MAX_MTEX; a++) {
- if(pa->mtex[a] && pa->mtex[a]->tex==tex) {
- if(pa->id.lib==NULL) {
+ while (pa) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (pa->mtex[a] && pa->mtex[a]->tex==tex) {
+ if (pa->id.lib==NULL) {
pa->mtex[a]->tex= tex_new;
tex_new->id.us++;
tex->id.us--;
@@ -1061,14 +1062,14 @@ void autotexname(Tex *tex)
Image *ima;
char di[FILE_MAXDIR], fi[FILE_MAXFILE];
- if(tex) {
- if(tex->use_nodes) {
+ if (tex) {
+ if (tex->use_nodes) {
new_id(&bmain->tex, (ID *)tex, "Noddy");
}
else
- if(tex->type==TEX_IMAGE) {
+ if (tex->type==TEX_IMAGE) {
ima= tex->ima;
- if(ima) {
+ if (ima) {
BLI_strncpy(di, ima->name, sizeof(di));
BLI_splitdirstring(di, fi);
strcpy(di, "I.");
@@ -1077,7 +1078,7 @@ void autotexname(Tex *tex)
}
else new_id(&bmain->tex, (ID *)tex, texstr[tex->type]);
}
- else if(tex->type==TEX_PLUGIN && tex->plugin) new_id(&bmain->tex, (ID *)tex, tex->plugin->pname);
+ else if (tex->type==TEX_PLUGIN && tex->plugin) new_id(&bmain->tex, (ID *)tex, tex->plugin->pname);
else new_id(&bmain->tex, (ID *)tex, texstr[tex->type]);
}
}
@@ -1089,15 +1090,16 @@ Tex *give_current_object_texture(Object *ob)
Material *ma, *node_ma;
Tex *tex= NULL;
- if(ob==NULL) return NULL;
- if(ob->totcol==0 && !(ob->type==OB_LAMP)) return NULL;
+ if (ob==NULL) return NULL;
+ if (ob->totcol==0 && !(ob->type==OB_LAMP)) return NULL;
- if(ob->type==OB_LAMP) {
+ if (ob->type==OB_LAMP) {
tex= give_current_lamp_texture(ob->data);
- } else {
+ }
+ else {
ma= give_current_material(ob, ob->actcol);
- if((node_ma=give_node_material(ma)))
+ if ((node_ma=give_node_material(ma)))
ma= node_ma;
tex= give_current_material_texture(ma);
@@ -1111,9 +1113,9 @@ Tex *give_current_lamp_texture(Lamp *la)
MTex *mtex= NULL;
Tex *tex= NULL;
- if(la) {
+ if (la) {
mtex= la->mtex[(int)(la->texact)];
- if(mtex) tex= mtex->tex;
+ if (mtex) tex= mtex->tex;
}
return tex;
@@ -1123,11 +1125,11 @@ void set_current_lamp_texture(Lamp *la, Tex *newtex)
{
int act= la->texact;
- if(la->mtex[act] && la->mtex[act]->tex)
+ if (la->mtex[act] && la->mtex[act]->tex)
id_us_min(&la->mtex[act]->tex->id);
- if(newtex) {
- if(!la->mtex[act]) {
+ if (newtex) {
+ if (!la->mtex[act]) {
la->mtex[act]= add_mtex();
la->mtex[act]->texco= TEXCO_GLOB;
}
@@ -1135,7 +1137,7 @@ void set_current_lamp_texture(Lamp *la, Tex *newtex)
la->mtex[act]->tex= newtex;
id_us_plus(&newtex->id);
}
- else if(la->mtex[act]) {
+ else if (la->mtex[act]) {
MEM_freeN(la->mtex[act]);
la->mtex[act]= NULL;
}
@@ -1143,7 +1145,7 @@ void set_current_lamp_texture(Lamp *la, Tex *newtex)
bNode *give_current_material_texture_node(Material *ma)
{
- if(ma && ma->use_nodes && ma->nodetree)
+ if (ma && ma->use_nodes && ma->nodetree)
return nodeGetActiveID(ma->nodetree, ID_TE);
return NULL;
@@ -1155,21 +1157,21 @@ Tex *give_current_material_texture(Material *ma)
Tex *tex= NULL;
bNode *node;
- if(ma && ma->use_nodes && ma->nodetree) {
+ 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) {
+ if (node) {
tex= (Tex *)node->id;
ma= NULL;
}
}
- if(ma) {
+ if (ma) {
mtex= ma->mtex[(int)(ma->texact)];
- if(mtex) tex= mtex->tex;
+ if (mtex) tex= mtex->tex;
}
return tex;
@@ -1180,23 +1182,23 @@ int give_active_mtex(ID *id, MTex ***mtex_ar, short *act)
switch(GS(id->name)) {
case ID_MA:
*mtex_ar= ((Material *)id)->mtex;
- if(act) *act= (((Material *)id)->texact);
+ if (act) *act= (((Material *)id)->texact);
break;
case ID_WO:
*mtex_ar= ((World *)id)->mtex;
- if(act) *act= (((World *)id)->texact);
+ if (act) *act= (((World *)id)->texact);
break;
case ID_LA:
*mtex_ar= ((Lamp *)id)->mtex;
- if(act) *act= (((Lamp *)id)->texact);
+ if (act) *act= (((Lamp *)id)->texact);
break;
case ID_PA:
*mtex_ar= ((ParticleSettings *)id)->mtex;
- if(act) *act= (((ParticleSettings *)id)->texact);
+ if (act) *act= (((ParticleSettings *)id)->texact);
break;
default:
*mtex_ar = NULL;
- if(act) *act= 0;
+ if (act) *act= 0;
return FALSE;
}
@@ -1205,8 +1207,8 @@ int give_active_mtex(ID *id, MTex ***mtex_ar, short *act)
void set_active_mtex(ID *id, short act)
{
- if(act<0) act= 0;
- else if(act>=MAX_MTEX) act= MAX_MTEX-1;
+ if (act<0) act= 0;
+ else if (act>=MAX_MTEX) act= MAX_MTEX-1;
switch(GS(id->name)) {
case ID_MA:
@@ -1229,10 +1231,10 @@ void set_current_material_texture(Material *ma, Tex *newtex)
Tex *tex= NULL;
bNode *node;
- if(ma && ma->use_nodes && ma->nodetree) {
+ if (ma && ma->use_nodes && ma->nodetree) {
node= nodeGetActiveID(ma->nodetree, ID_TE);
- if(node) {
+ if (node) {
tex= (Tex *)node->id;
id_us_min(&tex->id);
node->id= &newtex->id;
@@ -1240,20 +1242,20 @@ void set_current_material_texture(Material *ma, Tex *newtex)
ma= NULL;
}
}
- if(ma) {
+ if (ma) {
int act= (int)ma->texact;
tex= (ma->mtex[act])? ma->mtex[act]->tex: NULL;
id_us_min(&tex->id);
- if(newtex) {
- if(!ma->mtex[act])
+ if (newtex) {
+ if (!ma->mtex[act])
ma->mtex[act]= add_mtex();
ma->mtex[act]->tex= newtex;
id_us_plus(&newtex->id);
}
- else if(ma->mtex[act]) {
+ else if (ma->mtex[act]) {
MEM_freeN(ma->mtex[act]);
ma->mtex[act]= NULL;
}
@@ -1264,10 +1266,10 @@ int has_current_material_texture(Material *ma)
{
bNode *node;
- if(ma && ma->use_nodes && ma->nodetree) {
+ if (ma && ma->use_nodes && ma->nodetree) {
node= nodeGetActiveID(ma->nodetree, ID_TE);
- if(node)
+ if (node)
return 1;
}
@@ -1279,10 +1281,10 @@ Tex *give_current_world_texture(World *world)
MTex *mtex= NULL;
Tex *tex= NULL;
- if(!world) return NULL;
+ if (!world) return NULL;
mtex= world->mtex[(int)(world->texact)];
- if(mtex) tex= mtex->tex;
+ if (mtex) tex= mtex->tex;
return tex;
}
@@ -1291,11 +1293,11 @@ void set_current_world_texture(World *wo, Tex *newtex)
{
int act= wo->texact;
- if(wo->mtex[act] && wo->mtex[act]->tex)
+ if (wo->mtex[act] && wo->mtex[act]->tex)
id_us_min(&wo->mtex[act]->tex->id);
- if(newtex) {
- if(!wo->mtex[act]) {
+ if (newtex) {
+ if (!wo->mtex[act]) {
wo->mtex[act]= add_mtex();
wo->mtex[act]->texco= TEXCO_VIEW;
}
@@ -1303,7 +1305,7 @@ void set_current_world_texture(World *wo, Tex *newtex)
wo->mtex[act]->tex= newtex;
id_us_plus(&newtex->id);
}
- else if(wo->mtex[act]) {
+ else if (wo->mtex[act]) {
MEM_freeN(wo->mtex[act]);
wo->mtex[act]= NULL;
}
@@ -1316,10 +1318,10 @@ Tex *give_current_brush_texture(Brush *br)
void set_current_brush_texture(Brush *br, Tex *newtex)
{
- if(br->mtex.tex)
+ if (br->mtex.tex)
id_us_min(&br->mtex.tex->id);
- if(newtex) {
+ if (newtex) {
br->mtex.tex= newtex;
id_us_plus(&newtex->id);
}
@@ -1330,10 +1332,10 @@ Tex *give_current_particle_texture(ParticleSettings *part)
MTex *mtex= NULL;
Tex *tex= NULL;
- if(!part) return NULL;
+ if (!part) return NULL;
mtex= part->mtex[(int)(part->texact)];
- if(mtex) tex= mtex->tex;
+ if (mtex) tex= mtex->tex;
return tex;
}
@@ -1342,11 +1344,11 @@ void set_current_particle_texture(ParticleSettings *part, Tex *newtex)
{
int act= part->texact;
- if(part->mtex[act] && part->mtex[act]->tex)
+ if (part->mtex[act] && part->mtex[act]->tex)
id_us_min(&part->mtex[act]->tex->id);
- if(newtex) {
- if(!part->mtex[act]) {
+ if (newtex) {
+ if (!part->mtex[act]) {
part->mtex[act]= add_mtex();
part->mtex[act]->texco= TEXCO_ORCO;
part->mtex[act]->blendtype= MTEX_MUL;
@@ -1355,7 +1357,7 @@ void set_current_particle_texture(ParticleSettings *part, Tex *newtex)
part->mtex[act]->tex= newtex;
id_us_plus(&newtex->id);
}
- else if(part->mtex[act]) {
+ else if (part->mtex[act]) {
MEM_freeN(part->mtex[act]);
part->mtex[act]= NULL;
}
@@ -1387,8 +1389,8 @@ EnvMap *BKE_copy_envmap(EnvMap *env)
envn= MEM_dupallocN(env);
envn->ok= 0;
- for(a=0; a<6; a++) envn->cube[a]= NULL;
- if(envn->ima) id_us_plus((ID *)envn->ima);
+ for (a=0; a<6; a++) envn->cube[a]= NULL;
+ if (envn->ima) id_us_plus((ID *)envn->ima);
return envn;
}
@@ -1399,8 +1401,8 @@ void BKE_free_envmapdata(EnvMap *env)
{
unsigned int part;
- for(part=0; part<6; part++) {
- if(env->cube[part])
+ for (part=0; part<6; part++) {
+ if (env->cube[part])
IMB_freeImBuf(env->cube[part]);
env->cube[part]= NULL;
}
@@ -1458,7 +1460,7 @@ PointDensity *BKE_copy_pointdensity(PointDensity *pd)
pdn= MEM_dupallocN(pd);
pdn->point_tree = NULL;
pdn->point_data = NULL;
- if(pdn->coba) pdn->coba= MEM_dupallocN(pdn->coba);
+ if (pdn->coba) pdn->coba= MEM_dupallocN(pdn->coba);
pdn->falloff_curve = curvemapping_copy(pdn->falloff_curve); /* can be NULL */
return pdn;
}
@@ -1473,7 +1475,7 @@ void BKE_free_pointdensitydata(PointDensity *pd)
MEM_freeN(pd->point_data);
pd->point_data = NULL;
}
- if(pd->coba) {
+ if (pd->coba) {
MEM_freeN(pd->coba);
pd->coba = NULL;
}
@@ -1561,19 +1563,19 @@ void BKE_free_oceantex(struct OceanTex *ot)
/* ------------------------------------------------------------------------- */
int BKE_texture_dependsOnTime(const struct Tex *texture)
{
- if(texture->plugin) {
+ if (texture->plugin) {
// assume all plugins depend on time
return 1;
}
- else if( texture->ima &&
+ else if ( texture->ima &&
ELEM(texture->ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) {
return 1;
}
- else if(texture->adt) {
+ else if (texture->adt) {
// assume anything in adt means the texture is animated
return 1;
}
- else if(texture->type == TEX_NOISE) {
+ else if (texture->type == TEX_NOISE) {
// noise always varies with time
return 1;
}
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index ede2eb7f461..0af8f2cf625 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -55,7 +55,6 @@
#include "BKE_movieclip.h"
#include "BKE_object.h"
#include "BKE_scene.h"
-#include "BKE_main.h" // XXX: ...
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
@@ -78,24 +77,24 @@ static struct {
void BKE_tracking_init_settings(MovieTracking *tracking)
{
- tracking->camera.sensor_width= 35.0f;
- tracking->camera.pixel_aspect= 1.0f;
- tracking->camera.units= CAMERA_UNITS_MM;
-
- tracking->settings.default_tracker= TRACKER_HYBRID;
- tracking->settings.default_minimum_correlation= 0.75;
- tracking->settings.default_pattern_size= 11;
- tracking->settings.default_search_size= 51;
- tracking->settings.default_pyramid_levels= 2;
- tracking->settings.keyframe1= 1;
- tracking->settings.keyframe2= 30;
- tracking->settings.dist= 1;
- tracking->settings.object_distance= 1;
-
- tracking->stabilization.scaleinf= 1.0f;
- tracking->stabilization.locinf= 1.0f;
- tracking->stabilization.rotinf= 1.0f;
- tracking->stabilization.maxscale= 2.0f;
+ tracking->camera.sensor_width = 35.0f;
+ tracking->camera.pixel_aspect = 1.0f;
+ tracking->camera.units = CAMERA_UNITS_MM;
+
+ tracking->settings.default_tracker = TRACKER_HYBRID;
+ tracking->settings.default_minimum_correlation = 0.75;
+ tracking->settings.default_pattern_size = 11;
+ tracking->settings.default_search_size = 61;
+ tracking->settings.default_pyramid_levels = 2;
+ tracking->settings.keyframe1 = 1;
+ tracking->settings.keyframe2 = 30;
+ tracking->settings.dist = 1;
+ tracking->settings.object_distance = 1;
+
+ tracking->stabilization.scaleinf = 1.0f;
+ tracking->stabilization.locinf = 1.0f;
+ tracking->stabilization.rotinf = 1.0f;
+ tracking->stabilization.maxscale = 2.0f;
BKE_tracking_new_object(tracking, "Camera");
}
@@ -112,142 +111,152 @@ void BKE_tracking_clamp_track(MovieTrackingTrack *track, int event)
}
/* sort */
- for(a= 0; a<2; a++) {
- if(track->pat_min[a]>track->pat_max[a])
+ for (a = 0; a < 2; a++) {
+ if (track->pat_min[a] > track->pat_max[a])
SWAP(float, track->pat_min[a], track->pat_max[a]);
- if(track->search_min[a]>track->search_max[a])
+ if (track->search_min[a] > track->search_max[a])
SWAP(float, track->search_min[a], track->search_max[a]);
}
/* compute the effective pattern size, which differs from the fine resolution
* pattern size for the pyramid KLT tracker */
- for(a= 0; a<2; a++) {
+ for (a = 0; a < 2; a++) {
pat_min[a] = max_pyramid_level_factor * track->pat_min[a];
pat_max[a] = max_pyramid_level_factor * track->pat_max[a];
}
- if(event==CLAMP_PAT_DIM) {
- for(a= 0; a<2; a++) {
+ if (event == CLAMP_PAT_DIM) {
+ for (a = 0; a < 2; a++) {
/* search shouldn't be resized smaller than pattern */
- track->search_min[a]= MIN2(pat_min[a], track->search_min[a]);
- track->search_max[a]= MAX2(pat_max[a], track->search_max[a]);
+ track->search_min[a] = MIN2(pat_min[a], track->search_min[a]);
+ track->search_max[a] = MAX2(pat_max[a], track->search_max[a]);
}
}
- else if(event==CLAMP_PAT_POS) {
+ else if (event == CLAMP_PAT_POS) {
float dim[2];
+
sub_v2_v2v2(dim, track->pat_max, track->pat_min);
- for(a= 0; a<2; a++) {
+ for (a = 0; a < 2; a++) {
/* pattern shouldn't be moved outside of search */
- if(pat_min[a] < track->search_min[a]) {
- track->pat_min[a]= track->search_min[a] - (pat_min[a] - track->pat_min[a]);
- track->pat_max[a]= track->pat_min[a] + dim[a];
+ if (pat_min[a] < track->search_min[a]) {
+ track->pat_min[a] = track->search_min[a] - (pat_min[a] - track->pat_min[a]);
+ track->pat_max[a] = track->pat_min[a] + dim[a];
}
- if(track->pat_max[a] > track->search_max[a]) {
- track->pat_max[a]= track->search_max[a] - (pat_max[a] - track->pat_max[a]);
- track->pat_min[a]= track->pat_max[a] - dim[a];
+ if (track->pat_max[a] > track->search_max[a]) {
+ track->pat_max[a] = track->search_max[a] - (pat_max[a] - track->pat_max[a]);
+ track->pat_min[a] = track->pat_max[a] - dim[a];
}
}
}
- else if(event==CLAMP_SEARCH_DIM) {
- for(a= 0; a<2; a++) {
+ else if (event == CLAMP_SEARCH_DIM) {
+ for (a = 0; a < 2; a++) {
/* search shouldn't be resized smaller than pattern */
- track->search_min[a]= MIN2(pat_min[a], track->search_min[a]);
- track->search_max[a]= MAX2(pat_max[a], track->search_max[a]);
+ track->search_min[a] = MIN2(pat_min[a], track->search_min[a]);
+ track->search_max[a] = MAX2(pat_max[a], track->search_max[a]);
}
}
- else if(event==CLAMP_SEARCH_POS) {
+ else if (event == CLAMP_SEARCH_POS) {
float dim[2];
+
sub_v2_v2v2(dim, track->search_max, track->search_min);
- for(a= 0; a<2; a++) {
+ for (a = 0; a < 2; a++) {
/* search shouldn't be moved inside pattern */
- if(track->search_min[a] > pat_min[a]) {
- track->search_min[a]= pat_min[a];
- track->search_max[a]= track->search_min[a]+dim[a];
+ if (track->search_min[a] > pat_min[a]) {
+ track->search_min[a] = pat_min[a];
+ track->search_max[a] = track->search_min[a]+dim[a];
}
- if(track->search_max[a] < pat_max[a]) {
- track->search_max[a]= pat_max[a];
- track->search_min[a]= track->search_max[a]-dim[a];
+ if (track->search_max[a] < pat_max[a]) {
+ track->search_max[a] = pat_max[a];
+ track->search_min[a] = track->search_max[a]-dim[a];
}
}
}
- else if(event==CLAMP_PYRAMID_LEVELS || (event==CLAMP_SEARCH_DIM && track->tracker == TRACKER_KLT)) {
+ else if (event == CLAMP_PYRAMID_LEVELS || (event == CLAMP_SEARCH_DIM && track->tracker == TRACKER_KLT)) {
float dim[2];
sub_v2_v2v2(dim, track->pat_max, track->pat_min);
{
- float search_ratio= 2.3f * max_pyramid_level_factor;
+ float search_ratio = 2.3f * max_pyramid_level_factor;
/* resize the search area to something sensible based
* on the number of pyramid levels */
- for(a= 0; a<2; a++) {
- track->search_min[a]= search_ratio * track->pat_min[a];
- track->search_max[a]= search_ratio * track->pat_max[a];
+ for (a = 0; a < 2; a++) {
+ track->search_min[a] = search_ratio * track->pat_min[a];
+ track->search_max[a] = search_ratio * track->pat_max[a];
}
}
}
/* marker's center should be in center of pattern */
- if(event==CLAMP_PAT_DIM || event==CLAMP_PAT_POS) {
+ if (event == CLAMP_PAT_DIM || event == CLAMP_PAT_POS) {
float dim[2];
+
sub_v2_v2v2(dim, track->pat_max, track->pat_min);
- for(a= 0; a<2; a++) {
- track->pat_min[a]= -dim[a]/2.0f;
- track->pat_max[a]= dim[a]/2.0f;
+ for (a = 0; a < 2; a++) {
+ track->pat_min[a] = -dim[a]/2.0f;
+ track->pat_max[a] = dim[a]/2.0f;
}
}
}
void BKE_tracking_track_flag(MovieTrackingTrack *track, int area, int flag, int clear)
{
- if(area==TRACK_AREA_NONE)
+ if (area == TRACK_AREA_NONE)
return;
- if(clear) {
- if(area&TRACK_AREA_POINT) track->flag&= ~flag;
- if(area&TRACK_AREA_PAT) track->pat_flag&= ~flag;
- if(area&TRACK_AREA_SEARCH) track->search_flag&= ~flag;
- } else {
- if(area&TRACK_AREA_POINT) track->flag|= flag;
- if(area&TRACK_AREA_PAT) track->pat_flag|= flag;
- if(area&TRACK_AREA_SEARCH) track->search_flag|= flag;
+ if (clear) {
+ if (area & TRACK_AREA_POINT)
+ track->flag &= ~flag;
+ if (area & TRACK_AREA_PAT)
+ track->pat_flag &= ~flag;
+ if (area & TRACK_AREA_SEARCH)
+ track->search_flag &= ~flag;
+ }
+ else {
+ if (area & TRACK_AREA_POINT)
+ track->flag |= flag;
+ if (area & TRACK_AREA_PAT)
+ track->pat_flag |= flag;
+ if (area & TRACK_AREA_SEARCH)
+ track->search_flag |= flag;
}
}
MovieTrackingTrack *BKE_tracking_add_track(MovieTracking *tracking, ListBase *tracksbase, float x, float y,
- int framenr, int width, int height)
+ int framenr, int width, int height)
{
MovieTrackingTrack *track;
MovieTrackingMarker marker;
- MovieTrackingSettings *settings= &tracking->settings;
+ MovieTrackingSettings *settings = &tracking->settings;
- float half_pattern= (float)settings->default_pattern_size/2.0f;
- float half_search= (float)settings->default_search_size/2.0f;
+ float half_pattern = (float)settings->default_pattern_size / 2.0f;
+ float half_search = (float)settings->default_search_size / 2.0f;
float pat[2], search[2];
- pat[0]= half_pattern/(float)width;
- pat[1]= half_pattern/(float)height;
+ pat[0] = half_pattern / (float)width;
+ pat[1] = half_pattern / (float)height;
- search[0]= half_search/(float)width;
- search[1]= half_search/(float)height;
+ search[0] = half_search / (float)width;
+ search[1] = half_search / (float)height;
- track= MEM_callocN(sizeof(MovieTrackingTrack), "add_marker_exec track");
+ track = MEM_callocN(sizeof(MovieTrackingTrack), "add_marker_exec track");
strcpy(track->name, "Track");
- track->tracker= settings->default_tracker;
- track->pyramid_levels= settings->default_pyramid_levels;
- track->minimum_correlation= settings->default_minimum_correlation;
- track->margin= settings->default_margin;
- track->pattern_match= settings->default_pattern_match;
- track->frames_limit= settings->default_frames_limit;
- track->flag= settings->default_flag;
+ track->tracker = settings->default_tracker;
+ track->pyramid_levels = settings->default_pyramid_levels;
+ track->minimum_correlation = settings->default_minimum_correlation;
+ track->margin = settings->default_margin;
+ track->pattern_match = settings->default_pattern_match;
+ track->frames_limit = settings->default_frames_limit;
+ track->flag = settings->default_flag;
memset(&marker, 0, sizeof(marker));
- marker.pos[0]= x;
- marker.pos[1]= y;
- marker.framenr= framenr;
+ marker.pos[0] = x;
+ marker.pos[1] = y;
+ marker.framenr = framenr;
copy_v2_v2(track->pat_max, pat);
negate_v2_v2(track->pat_min, pat);
@@ -257,7 +266,7 @@ MovieTrackingTrack *BKE_tracking_add_track(MovieTracking *tracking, ListBase *tr
BKE_tracking_insert_marker(track, &marker);
- if(track->tracker == TRACKER_KLT)
+ if (track->tracker == TRACKER_KLT)
BKE_tracking_clamp_track(track, CLAMP_PYRAMID_LEVELS);
BLI_addtail(tracksbase, track);
@@ -270,32 +279,35 @@ MovieTrackingMarker *BKE_tracking_insert_marker(MovieTrackingTrack *track, Movie
{
MovieTrackingMarker *old_marker= NULL;
- if(track->markersnr)
- old_marker= BKE_tracking_exact_marker(track, marker->framenr);
+ if (track->markersnr)
+ old_marker = BKE_tracking_exact_marker(track, marker->framenr);
- if(old_marker) {
- *old_marker= *marker;
+ if (old_marker) {
+ *old_marker = *marker;
return old_marker;
- } else {
- int a= track->markersnr;
+ }
+ else {
+ int a = track->markersnr;
- while(a--) {
- if(track->markers[a].framenr<marker->framenr)
+ while (a--) {
+ if (track->markers[a].framenr < marker->framenr)
break;
}
track->markersnr++;
- if(track->markers) track->markers= MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr);
- else track->markers= MEM_callocN(sizeof(MovieTrackingMarker), "MovieTracking markers");
+ if (track->markers)
+ track->markers = MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr);
+ else
+ track->markers = MEM_callocN(sizeof(MovieTrackingMarker), "MovieTracking markers");
memmove(track->markers+a+2, track->markers+a+1, (track->markersnr-a-2)*sizeof(MovieTrackingMarker));
- track->markers[a+1]= *marker;
+ track->markers[a+1] = *marker;
- track->last_marker= a+1;
+ track->last_marker = a + 1;
- return &track->markers[a+1];
+ return &track->markers[a + 1];
}
}
@@ -303,16 +315,17 @@ void BKE_tracking_delete_marker(MovieTrackingTrack *track, int framenr)
{
int a= 0;
- while(a<track->markersnr) {
- if(track->markers[a].framenr==framenr) {
- if(track->markersnr>1) {
+ while (a<track->markersnr) {
+ if (track->markers[a].framenr == framenr) {
+ if (track->markersnr > 1) {
memmove(track->markers+a, track->markers+a+1, (track->markersnr-a-1)*sizeof(MovieTrackingMarker));
track->markersnr--;
- track->markers= MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr);
- } else {
+ track->markers = MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr);
+ }
+ else {
MEM_freeN(track->markers);
- track->markers= NULL;
- track->markersnr= 0;
+ track->markers = NULL;
+ track->markersnr = 0;
}
break;
@@ -324,22 +337,23 @@ void BKE_tracking_delete_marker(MovieTrackingTrack *track, int framenr)
MovieTrackingMarker *BKE_tracking_get_marker(MovieTrackingTrack *track, int framenr)
{
- int a= track->markersnr-1;
+ int a = track->markersnr-1;
- if(!track->markersnr)
+ if (!track->markersnr)
return NULL;
/* approximate pre-first framenr marker with first marker */
- if(framenr<track->markers[0].framenr)
+ if (framenr < track->markers[0].framenr)
return &track->markers[0];
- if(track->last_marker<track->markersnr)
- a= track->last_marker;
+ if (track->last_marker < track->markersnr)
+ a = track->last_marker;
+
+ if (track->markers[a].framenr <= framenr) {
+ while (a < track->markersnr && track->markers[a].framenr <= framenr) {
+ if (track->markers[a].framenr == framenr) {
+ track->last_marker = a;
- if(track->markers[a].framenr<=framenr) {
- while(a<track->markersnr && track->markers[a].framenr<=framenr) {
- if(track->markers[a].framenr==framenr) {
- track->last_marker= a;
return &track->markers[a];
}
a++;
@@ -347,10 +361,12 @@ MovieTrackingMarker *BKE_tracking_get_marker(MovieTrackingTrack *track, int fram
/* if there's no marker for exact position, use nearest marker from left side */
return &track->markers[a-1];
- } else {
- while(a>=0 && track->markers[a].framenr>=framenr) {
- if(track->markers[a].framenr==framenr) {
- track->last_marker= a;
+ }
+ else {
+ while (a >= 0 && track->markers[a].framenr >= framenr) {
+ if (track->markers[a].framenr == framenr) {
+ track->last_marker = a;
+
return &track->markers[a];
}
@@ -366,16 +382,16 @@ MovieTrackingMarker *BKE_tracking_get_marker(MovieTrackingTrack *track, int fram
MovieTrackingMarker *BKE_tracking_ensure_marker(MovieTrackingTrack *track, int framenr)
{
- MovieTrackingMarker *marker= BKE_tracking_get_marker(track, framenr);
+ MovieTrackingMarker *marker = BKE_tracking_get_marker(track, framenr);
- if(marker->framenr!=framenr) {
+ if (marker->framenr != framenr) {
MovieTrackingMarker marker_new;
- marker_new= *marker;
- marker_new.framenr= framenr;
+ marker_new = *marker;
+ marker_new.framenr = framenr;
BKE_tracking_insert_marker(track, &marker_new);
- marker= BKE_tracking_get_marker(track, framenr);
+ marker = BKE_tracking_get_marker(track, framenr);
}
return marker;
@@ -383,9 +399,9 @@ MovieTrackingMarker *BKE_tracking_ensure_marker(MovieTrackingTrack *track, int f
MovieTrackingMarker *BKE_tracking_exact_marker(MovieTrackingTrack *track, int framenr)
{
- MovieTrackingMarker *marker= BKE_tracking_get_marker(track, framenr);
+ MovieTrackingMarker *marker = BKE_tracking_get_marker(track, framenr);
- if(marker->framenr!=framenr)
+ if (marker->framenr != framenr)
return NULL;
return marker;
@@ -405,21 +421,24 @@ int BKE_tracking_has_enabled_marker(MovieTrackingTrack *track, int framenr)
void BKE_tracking_free_track(MovieTrackingTrack *track)
{
- if(track->markers) MEM_freeN(track->markers);
+ if (track->markers)
+ MEM_freeN(track->markers);
}
static void put_disabled_marker(MovieTrackingTrack *track, MovieTrackingMarker *ref_marker, int before, int overwrite)
{
MovieTrackingMarker marker_new;
- marker_new= *ref_marker;
- marker_new.flag&= ~MARKER_TRACKED;
- marker_new.flag|= MARKER_DISABLED;
+ marker_new = *ref_marker;
+ marker_new.flag &= ~MARKER_TRACKED;
+ marker_new.flag |= MARKER_DISABLED;
- if(before) marker_new.framenr--;
- else marker_new.framenr++;
+ if (before)
+ marker_new.framenr--;
+ else
+ marker_new.framenr++;
- if(!BKE_tracking_has_marker(track, marker_new.framenr) || overwrite)
+ if (!BKE_tracking_has_marker(track, marker_new.framenr) || overwrite)
BKE_tracking_insert_marker(track, &marker_new);
}
@@ -427,12 +446,13 @@ void BKE_tracking_clear_path(MovieTrackingTrack *track, int ref_frame, int actio
{
int a;
- if(action==TRACK_CLEAR_REMAINED) {
- a= 1;
- while(a<track->markersnr) {
- if(track->markers[a].framenr>ref_frame) {
- track->markersnr= a;
- track->markers= MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr);
+ if (action == TRACK_CLEAR_REMAINED) {
+ a = 1;
+
+ while (a < track->markersnr) {
+ if (track->markers[a].framenr > ref_frame) {
+ track->markersnr = a;
+ track->markers = MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr);
break;
}
@@ -440,16 +460,18 @@ void BKE_tracking_clear_path(MovieTrackingTrack *track, int ref_frame, int actio
a++;
}
- if(track->markersnr)
+ if (track->markersnr)
put_disabled_marker(track, &track->markers[track->markersnr-1], 0, 1);
- } else if(action==TRACK_CLEAR_UPTO) {
+ }
+ else if (action == TRACK_CLEAR_UPTO) {
a= track->markersnr-1;
- while(a>=0) {
- if(track->markers[a].framenr<=ref_frame) {
+
+ while (a >= 0) {
+ if (track->markers[a].framenr <= ref_frame) {
memmove(track->markers, track->markers+a, (track->markersnr-a)*sizeof(MovieTrackingMarker));
- track->markersnr= track->markersnr-a;
- track->markers= MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr);
+ track->markersnr = track->markersnr-a;
+ track->markers = MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr);
break;
}
@@ -457,17 +479,18 @@ void BKE_tracking_clear_path(MovieTrackingTrack *track, int ref_frame, int actio
a--;
}
- if(track->markersnr)
+ if (track->markersnr)
put_disabled_marker(track, &track->markers[0], 1, 1);
- } else if(action==TRACK_CLEAR_ALL) {
+ }
+ else if (action == TRACK_CLEAR_ALL) {
MovieTrackingMarker *marker, marker_new;
- marker= BKE_tracking_get_marker(track, ref_frame);
- marker_new= *marker;
+ marker = BKE_tracking_get_marker(track, ref_frame);
+ marker_new = *marker;
MEM_freeN(track->markers);
- track->markers= NULL;
- track->markersnr= 0;
+ track->markers = NULL;
+ track->markersnr = 0;
BKE_tracking_insert_marker(track, &marker_new);
@@ -476,79 +499,111 @@ void BKE_tracking_clear_path(MovieTrackingTrack *track, int ref_frame, int actio
}
}
-int BKE_tracking_test_join_tracks(MovieTrackingTrack *dst_track, MovieTrackingTrack *src_track)
+void BKE_tracking_join_tracks(MovieTrackingTrack *dst_track, MovieTrackingTrack *src_track)
{
- int a= 0, b= 0;
- int count= 0;
+ int i = 0, a = 0, b = 0, tot;
+ MovieTrackingMarker *markers;
- while(a<src_track->markersnr || b<dst_track->markersnr) {
- if(b>=dst_track->markersnr) {
- a++;
- count++;
+ tot = dst_track->markersnr + src_track->markersnr;
+ markers = MEM_callocN(tot * sizeof(MovieTrackingMarker), "tmp tracking joined tracks");
+
+ while (a < src_track->markersnr || b < dst_track->markersnr) {
+ if (b >= dst_track->markersnr) {
+ markers[i] = src_track->markers[a++];
}
- else if(a>=src_track->markersnr) {
- b++;
- count++;
+ else if (a >= src_track->markersnr) {
+ markers[i] = dst_track->markers[b++];
}
- else if(src_track->markers[a].framenr<dst_track->markers[b].framenr) {
- a++;
- count++;
- } else if(src_track->markers[a].framenr>dst_track->markers[b].framenr) {
- b++;
- count++;
- } else {
- if((src_track->markers[a].flag&MARKER_DISABLED)==0 && (dst_track->markers[b].flag&MARKER_DISABLED)==0)
- return 0;
-
- a++;
- b++;
- count++;
+ else if (src_track->markers[a].framenr < dst_track->markers[b].framenr) {
+ markers[i] = src_track->markers[a++];
}
- }
+ else if (src_track->markers[a].framenr > dst_track->markers[b].framenr) {
+ markers[i] = dst_track->markers[b++];
+ }
+ else {
+ if ((src_track->markers[a].flag & MARKER_DISABLED)==0) {
+ if ((dst_track->markers[b].flag & MARKER_DISABLED)==0) {
+ /* both tracks are enabled on this frame, so find the whole segment
+ * on which tracks are intersecting and blend tracks using linear
+ * interpolation to prevent jumps */
+
+ MovieTrackingMarker *marker_a, *marker_b;
+ int start_a = a, start_b = b, len = 0, frame = src_track->markers[a].framenr;
+ int j, inverse = 0;
+
+ inverse = (b == 0) ||
+ (dst_track->markers[b-1].flag & MARKER_DISABLED) ||
+ (dst_track->markers[b-1].framenr != frame - 1);
+
+ /* find length of intersection */
+ while (a < src_track->markersnr && b < dst_track->markersnr) {
+ marker_a = &src_track->markers[a];
+ marker_b = &dst_track->markers[b];
+
+ if (marker_a->flag & MARKER_DISABLED || marker_b->flag & MARKER_DISABLED)
+ break;
+
+ if (marker_a->framenr != frame || marker_b->framenr != frame)
+ break;
+
+ frame++;
+ len++;
+ a++;
+ b++;
+ }
- return count;
-}
+ a = start_a;
+ b = start_b;
-void BKE_tracking_join_tracks(MovieTrackingTrack *dst_track, MovieTrackingTrack *src_track)
-{
- int i, a= 0, b= 0, tot;
- MovieTrackingMarker *markers;
+ /* linear interpolation for intersecting frames */
+ for (j = 0; j < len; j++) {
+ float fac = 0.5f;
- tot= BKE_tracking_test_join_tracks(dst_track, src_track);
+ if (len > 1)
+ fac = 1.0f / (len - 1) * j;
- markers= MEM_callocN(tot*sizeof(MovieTrackingMarker), "tracking joined tracks");
+ if (inverse)
+ fac = 1.0f - fac;
- for(i= 0; i<tot; i++) {
- if(b>=dst_track->markersnr) {
- markers[i]= src_track->markers[a++];
- }
- else if(a>=src_track->markersnr) {
- markers[i]= dst_track->markers[b++];
- }
- else if(src_track->markers[a].framenr<dst_track->markers[b].framenr) {
- markers[i]= src_track->markers[a++];
- } else if(src_track->markers[a].framenr>dst_track->markers[b].framenr) {
- markers[i]= dst_track->markers[b++];
- } else {
- if((src_track->markers[a].flag&MARKER_DISABLED)) markers[i]= dst_track->markers[b];
- else markers[i]= src_track->markers[a++];
+ marker_a = &src_track->markers[a];
+ marker_b = &dst_track->markers[b];
+
+ markers[i] = dst_track->markers[b];
+ interp_v2_v2v2(markers[i].pos, marker_b->pos, marker_a->pos, fac);
+ a++;
+ b++;
+ i++;
+ }
+
+ /* this values will be incremented at the end of the loop cycle */
+ a--; b--; i--;
+ }
+ else markers[i] = src_track->markers[a];
+ }
+ else markers[i] = dst_track->markers[b];
a++;
b++;
}
+
+ i++;
}
MEM_freeN(dst_track->markers);
- dst_track->markers= markers;
- dst_track->markersnr= tot;
+ dst_track->markers = MEM_callocN(i*sizeof(MovieTrackingMarker), "tracking joined tracks");
+ memcpy(dst_track->markers, markers, i*sizeof(MovieTrackingMarker));
+
+ dst_track->markersnr = i;
+
+ MEM_freeN(markers);
}
static void tracking_tracks_free(ListBase *tracks)
{
MovieTrackingTrack *track;
- for(track= tracks->first; track; track= track->next) {
+ for (track = tracks->first; track; track = track->next) {
BKE_tracking_free_track(track);
}
@@ -557,7 +612,7 @@ static void tracking_tracks_free(ListBase *tracks)
static void tracking_reconstruction_free(MovieTrackingReconstruction *reconstruction)
{
- if(reconstruction->cameras)
+ if (reconstruction->cameras)
MEM_freeN(reconstruction->cameras);
}
@@ -571,7 +626,7 @@ static void tracking_objects_free(ListBase *objects)
{
MovieTrackingObject *object;
- for(object= objects->first; object; object= object->next)
+ for (object = objects->first; object; object = object->next)
tracking_object_free(object);
BLI_freelistN(objects);
@@ -583,10 +638,10 @@ void BKE_tracking_free(MovieTracking *tracking)
tracking_reconstruction_free(&tracking->reconstruction);
tracking_objects_free(&tracking->objects);
- if(tracking->stabilization.scaleibuf)
+ if (tracking->stabilization.scaleibuf)
IMB_freeImBuf(tracking->stabilization.scaleibuf);
- if(tracking->camera.intrinsics)
+ if (tracking->camera.intrinsics)
BKE_tracking_distortion_destroy(tracking->camera.intrinsics);
}
@@ -596,7 +651,7 @@ static MovieTrackingTrack *duplicate_track(MovieTrackingTrack *track)
new_track = MEM_callocN(sizeof(MovieTrackingTrack), "tracksMapMerge new_track");
- *new_track= *track;
+ *new_track = *track;
new_track->next = new_track->prev = NULL;
new_track->markers = MEM_dupallocN(new_track->markers);
@@ -675,20 +730,20 @@ typedef struct TracksMap {
static TracksMap *tracks_map_new(const char *object_name, int is_camera, int num_tracks, int customdata_size)
{
- TracksMap *map= MEM_callocN(sizeof(TracksMap), "TrackingsMap");
+ TracksMap *map = MEM_callocN(sizeof(TracksMap), "TrackingsMap");
BLI_strncpy(map->object_name, object_name, sizeof(map->object_name));
- map->is_camera= is_camera;
+ map->is_camera = is_camera;
- map->num_tracks= num_tracks;
- map->customdata_size= customdata_size;
+ map->num_tracks = num_tracks;
+ map->customdata_size = customdata_size;
- map->tracks= MEM_callocN(sizeof(MovieTrackingTrack)*num_tracks, "TrackingsMap tracks");
+ map->tracks = MEM_callocN(sizeof(MovieTrackingTrack)*num_tracks, "TrackingsMap tracks");
- if(customdata_size)
- map->customdata= MEM_callocN(customdata_size*num_tracks, "TracksMap customdata");
+ if (customdata_size)
+ map->customdata = MEM_callocN(customdata_size*num_tracks, "TracksMap customdata");
- map->hash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "TracksMap hash");
+ map->hash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "TracksMap hash");
return map;
}
@@ -700,21 +755,21 @@ static int tracks_map_size(TracksMap *map)
static void tracks_map_get(TracksMap *map, int index, MovieTrackingTrack **track, void **customdata)
{
- *track= &map->tracks[index];
+ *track = &map->tracks[index];
- if(map->customdata)
- *customdata= &map->customdata[index*map->customdata_size];
+ if (map->customdata)
+ *customdata = &map->customdata[index*map->customdata_size];
}
static void tracks_map_insert(TracksMap *map, MovieTrackingTrack *track, void *customdata)
{
MovieTrackingTrack new_track= *track;
- new_track.markers= MEM_dupallocN(new_track.markers);
+ new_track.markers = MEM_dupallocN(new_track.markers);
- map->tracks[map->ptr]= new_track;
+ map->tracks[map->ptr] = new_track;
- if(customdata)
+ if (customdata)
memcpy(&map->customdata[map->ptr*map->customdata_size], customdata, map->customdata_size);
BLI_ghash_insert(map->hash, &map->tracks[map->ptr], track);
@@ -725,95 +780,96 @@ static void tracks_map_insert(TracksMap *map, MovieTrackingTrack *track, void *c
static void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
{
MovieTrackingTrack *track;
- MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking);
- MovieTrackingTrack *rot_track= tracking->stabilization.rot_track;
- ListBase tracks= {NULL, NULL}, new_tracks= {NULL, NULL};
+ MovieTrackingTrack *act_track = BKE_tracking_active_track(tracking);
+ MovieTrackingTrack *rot_track = tracking->stabilization.rot_track;
+ ListBase tracks = {NULL, NULL}, new_tracks = {NULL, NULL};
ListBase *old_tracks;
int a;
- if(map->is_camera) {
- old_tracks= &tracking->tracks;
- } else {
- MovieTrackingObject *object= BKE_tracking_named_object(tracking, map->object_name);
+ if (map->is_camera) {
+ old_tracks = &tracking->tracks;
+ }
+ else {
+ MovieTrackingObject *object = BKE_tracking_named_object(tracking, map->object_name);
- if(!object) {
+ if (!object) {
/* object was deleted by user, create new one */
- object= BKE_tracking_new_object(tracking, map->object_name);
+ object = BKE_tracking_new_object(tracking, map->object_name);
}
- old_tracks= &object->tracks;
+ old_tracks = &object->tracks;
}
/* 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) */
- for(a= 0; a<map->num_tracks; a++) {
- int replace_sel= 0, replace_rot= 0;
+ * 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;
- track= &map->tracks[a];
+ track = &map->tracks[a];
/* find original of operating track in list of previously displayed tracks */
- old= BLI_ghash_lookup(map->hash, track);
- if(old) {
- MovieTrackingTrack *cur= old_tracks->first;
+ old = BLI_ghash_lookup(map->hash, track);
+ if (old) {
+ MovieTrackingTrack *cur = old_tracks->first;
- while(cur) {
- if(cur==old)
+ while (cur) {
+ if (cur == old)
break;
- cur= cur->next;
+ cur = cur->next;
}
/* original track was found, re-use flags and remove this track */
- if(cur) {
- if(cur==act_track)
- replace_sel= 1;
- if(cur==rot_track)
- replace_rot= 1;
+ if (cur) {
+ if (cur == act_track)
+ replace_sel = 1;
+ if (cur == rot_track)
+ replace_rot = 1;
- track->flag= cur->flag;
- track->pat_flag= cur->pat_flag;
- track->search_flag= cur->search_flag;
+ track->flag = cur->flag;
+ track->pat_flag = cur->pat_flag;
+ track->search_flag = cur->search_flag;
BKE_tracking_free_track(cur);
BLI_freelinkN(old_tracks, cur);
}
}
- new_track= duplicate_track(track);
+ new_track = duplicate_track(track);
BLI_ghash_remove(map->hash, track, NULL, NULL); /* XXX: are we actually need this */
BLI_ghash_insert(map->hash, track, new_track);
- if(replace_sel) /* update current selection in clip */
+ if (replace_sel) /* update current selection in clip */
tracking->act_track= new_track;
- if(replace_rot) /* update track used for rotation stabilization */
+ if (replace_rot) /* update track used for rotation stabilization */
tracking->stabilization.rot_track= new_track;
BLI_addtail(&tracks, new_track);
}
/* move all tracks, which aren't operating */
- track= old_tracks->first;
- while(track) {
- MovieTrackingTrack *next= track->next;
+ track = old_tracks->first;
+ while (track) {
+ MovieTrackingTrack *next = track->next;
- track->next= track->prev= NULL;
+ track->next = track->prev = NULL;
BLI_addtail(&new_tracks, track);
track= next;
}
/* now move all tracks which are currently operating and keep their names unique */
- track= tracks.first;
- while(track) {
- MovieTrackingTrack *next= track->next;
+ track = tracks.first;
+ while (track) {
+ MovieTrackingTrack *next = track->next;
BLI_remlink(&tracks, track);
- track->next= track->prev= NULL;
+ track->next = track->prev = NULL;
BLI_addtail(&new_tracks, track);
BLI_uniquename(&new_tracks, track, "Track", '.', offsetof(MovieTrackingTrack, name), sizeof(track->name));
@@ -830,14 +886,14 @@ static void tracks_map_free(TracksMap *map, void (*customdata_free) (void *custo
BLI_ghash_free(map->hash, NULL, NULL);
- for(i= 0; i<map->num_tracks; i++) {
- if(map->customdata && customdata_free)
+ for (i = 0; i < map->num_tracks; i++) {
+ if (map->customdata && customdata_free)
customdata_free(&map->customdata[i*map->customdata_size]);
BKE_tracking_free_track(&map->tracks[i]);
}
- if(map->customdata)
+ if (map->customdata)
MEM_freeN(map->customdata);
MEM_freeN(map->tracks);
@@ -850,14 +906,8 @@ typedef struct TrackContext {
#ifdef WITH_LIBMV
float keyframed_pos[2];
- /* ** KLT tracker ** */
struct libmv_RegionTracker *region_tracker;
float *patch; /* keyframed patch */
-
- /* ** SAD tracker ** */
- int pattern_size; /* size of pattern */
- unsigned char *pattern; /* keyframed pattern */
- unsigned char *warped; /* warped version of reference */
#else
int pad;
#endif
@@ -879,83 +929,85 @@ typedef struct MovieTrackingContext {
MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *user, short backwards, short sequence)
{
- MovieTrackingContext *context= MEM_callocN(sizeof(MovieTrackingContext), "trackingContext");
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingSettings *settings= &tracking->settings;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
+ MovieTrackingContext *context = MEM_callocN(sizeof(MovieTrackingContext), "trackingContext");
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingSettings *settings = &tracking->settings;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
MovieTrackingTrack *track;
- MovieTrackingObject *object= BKE_tracking_active_object(tracking);
- int num_tracks= 0;
+ MovieTrackingObject *object = BKE_tracking_active_object(tracking);
+ int num_tracks = 0;
- context->settings= *settings;
- context->backwards= backwards;
- context->sync_frame= user->framenr;
- context->first_time= 1;
- context->sequence= sequence;
+ context->settings = *settings;
+ context->backwards = backwards;
+ context->sync_frame = user->framenr;
+ context->first_time = TRUE;
+ context->sequence = sequence;
/* count */
- track= tracksbase->first;
- while(track) {
- if(TRACK_SELECTED(track) && (track->flag & (TRACK_LOCKED | TRACK_HIDDEN))==0) {
- MovieTrackingMarker *marker= BKE_tracking_get_marker(track, user->framenr);
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_SELECTED(track) && (track->flag & (TRACK_LOCKED | TRACK_HIDDEN))==0) {
+ MovieTrackingMarker *marker = BKE_tracking_get_marker(track, user->framenr);
- if((marker->flag&MARKER_DISABLED)==0)
+ if ((marker->flag & MARKER_DISABLED) == 0)
num_tracks++;
}
- track= track->next;
+ track = track->next;
}
- if(num_tracks) {
+ if (num_tracks) {
int width, height;
- context->tracks_map= tracks_map_new(object->name, object->flag & TRACKING_OBJECT_CAMERA,
- num_tracks, sizeof(TrackContext));
+ context->tracks_map = tracks_map_new(object->name, object->flag & TRACKING_OBJECT_CAMERA,
+ num_tracks, sizeof(TrackContext));
BKE_movieclip_get_size(clip, user, &width, &height);
/* create tracking data */
- track= tracksbase->first;
- while(track) {
- if(TRACK_SELECTED(track) && (track->flag & (TRACK_HIDDEN | TRACK_LOCKED))==0) {
- MovieTrackingMarker *marker= BKE_tracking_get_marker(track, user->framenr);
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_SELECTED(track) && (track->flag & (TRACK_HIDDEN | TRACK_LOCKED)) == 0) {
+ MovieTrackingMarker *marker = BKE_tracking_get_marker(track, user->framenr);
- if((marker->flag&MARKER_DISABLED)==0) {
+ if ((marker->flag & MARKER_DISABLED) == 0) {
TrackContext track_context;
memset(&track_context, 0, sizeof(TrackContext));
#ifdef WITH_LIBMV
{
- float patx, paty;
- patx= (int)((track->pat_max[0]-track->pat_min[0])*width);
- paty= (int)((track->pat_max[1]-track->pat_min[1])*height);
+ float patx = (int)((track->pat_max[0]-track->pat_min[0])*width),
+ paty = (int)((track->pat_max[1]-track->pat_min[1])*height);
- if(ELEM(track->tracker, TRACKER_KLT, TRACKER_HYBRID)) {
- float search_size_x= (track->search_max[0]-track->search_min[0])*width;
- float search_size_y= (track->search_max[1]-track->search_min[1])*height;
- float pattern_size_x= (track->pat_max[0]-track->pat_min[0])*width;
- float pattern_size_y= (track->pat_max[1]-track->pat_min[1])*height;
- int wndx= (int)patx/2, wndy= (int)paty/2;
+ float search_size_x = (track->search_max[0]-track->search_min[0])*width;
+ float search_size_y = (track->search_max[1]-track->search_min[1])*height;
+ float pattern_size_x = (track->pat_max[0]-track->pat_min[0])*width;
+ float pattern_size_y = (track->pat_max[1]-track->pat_min[1])*height;
+ int wndx = (int)patx / 2, wndy = (int)paty / 2;
+ int half_wnd = MAX2(wndx, wndy);
/* compute the maximum pyramid size */
- float search_to_pattern_ratio= MIN2(search_size_x, search_size_y)
- / MAX2(pattern_size_x, pattern_size_y);
- float log2_search_to_pattern_ratio = log(floor(search_to_pattern_ratio)) / M_LN2;
- int max_pyramid_levels= floor(log2_search_to_pattern_ratio + 1);
-
- /* try to accomodate the user's choice of pyramid level in a way
- * that doesn't cause the coarsest pyramid pattern to be larger
- * than the search size */
- int level= MIN2(track->pyramid_levels, max_pyramid_levels);
-
- if(track->tracker==TRACKER_KLT)
- track_context.region_tracker= libmv_pyramidRegionTrackerNew(100, level, MAX2(wndx, wndy), track->minimum_correlation);
- else
- track_context.region_tracker= libmv_hybridRegionTrackerNew(100, MAX2(wndx, wndy), track->minimum_correlation);
+ float search_to_pattern_ratio = MIN2(search_size_x, search_size_y)
+ / MAX2(pattern_size_x, pattern_size_y);
+ float log2_search_to_pattern_ratio = log(floor(search_to_pattern_ratio)) / M_LN2;
+ int max_pyramid_levels = floor(log2_search_to_pattern_ratio + 1);
+
+ /* try to accommodate the user's choice of pyramid level in a way
+ * that doesn't cause the coarsest pyramid pattern to be larger
+ * than the search size */
+ int level = MIN2(track->pyramid_levels, max_pyramid_levels);
+
+ if (track->tracker==TRACKER_KLT) {
+ track_context.region_tracker =
+ libmv_pyramidRegionTrackerNew(100, level, half_wnd, track->minimum_correlation);
+ }
+ else if (track->tracker == TRACKER_HYBRID) {
+ track_context.region_tracker =
+ libmv_hybridRegionTrackerNew(100, half_wnd, track->minimum_correlation);
}
- else if(track->tracker==TRACKER_SAD) {
- track_context.pattern_size= MAX2(patx, paty);
+ else if (track->tracker == TRACKER_SAD) {
+ track_context.region_tracker= libmv_bruteRegionTrackerNew(MAX2(wndx, wndy), track->minimum_correlation);
}
}
#endif
@@ -964,11 +1016,11 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u
}
}
- track= track->next;
+ track = track->next;
}
}
- context->clip= clip;
+ context->clip = clip;
/* store needed clip flags passing to get_buffer functions
* - MCLIP_USE_PROXY is needed to because timecode affects on movie clip
@@ -977,14 +1029,14 @@ 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 */
- context->clip_flag= clip->flag&MCLIP_TIMECODE_FLAGS;
+ * ignore all the rest possible flags for now */
+ context->clip_flag = clip->flag&MCLIP_TIMECODE_FLAGS;
- context->user= *user;
- context->user.render_size= MCLIP_PROXY_RENDER_SIZE_FULL;
- context->user.render_flag= 0;
+ context->user = *user;
+ context->user.render_size = MCLIP_PROXY_RENDER_SIZE_FULL;
+ context->user.render_flag = 0;
- if(!sequence)
+ if (!sequence)
BLI_begin_threaded_malloc();
return context;
@@ -992,20 +1044,15 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u
static void track_context_free(void *customdata)
{
- TrackContext *track_context= (TrackContext *)customdata;
+ TrackContext *track_context = (TrackContext *)customdata;
#if WITH_LIBMV
- if(track_context->region_tracker)
+ if (track_context->region_tracker)
libmv_regionTrackerDestroy(track_context->region_tracker);
- if(track_context->patch)
+ if (track_context->patch)
MEM_freeN(track_context->patch);
- if(track_context->pattern)
- MEM_freeN(track_context->pattern);
-
- if(track_context->warped)
- MEM_freeN(track_context->warped);
#else
(void) track_context;
#endif
@@ -1013,7 +1060,7 @@ static void track_context_free(void *customdata)
void BKE_tracking_context_free(MovieTrackingContext *context)
{
- if(!context->sequence)
+ if (!context->sequence)
BLI_end_threaded_malloc();
tracks_map_free(context->tracks_map, track_context_free);
@@ -1029,7 +1076,7 @@ void BKE_tracking_disable_imbuf_channels(ImBuf *ibuf, int disable_red, int disab
int x, y;
float scale;
- if(!disable_red && !disable_green && !disable_blue && !grayscale)
+ if (!disable_red && !disable_green && !disable_blue && !grayscale)
return;
/* If only some components are selected, it's important to rescale the result
@@ -1038,32 +1085,39 @@ void BKE_tracking_disable_imbuf_channels(ImBuf *ibuf, int disable_red, int disab
(disable_green ? 0.0f : 0.7152f) +
(disable_blue ? 0.0f : 0.0722f);
- for(y= 0; y<ibuf->y; y++) {
- for (x= 0; x<ibuf->x; x++) {
- int pixel= ibuf->x*y + x;
+ for (y = 0; y < ibuf->y; y++) {
+ for (x = 0; x < ibuf->x; x++) {
+ int pixel = ibuf->x*y + x;
- if(ibuf->rect_float) {
- float *rrgbf= ibuf->rect_float + pixel*4;
+ if (ibuf->rect_float) {
+ float *rrgbf = ibuf->rect_float + pixel*4;
float r = disable_red ? 0.0f : rrgbf[0];
float g = disable_green ? 0.0f : rrgbf[1];
float b = disable_blue ? 0.0f : rrgbf[2];
+
if (grayscale) {
float gray = (0.2126f*r + 0.7152f*g + 0.0722f*b) / scale;
+
rrgbf[0] = rrgbf[1] = rrgbf[2] = gray;
- } else {
+ }
+ else {
rrgbf[0] = r;
rrgbf[1] = g;
rrgbf[2] = b;
}
- } else {
- char *rrgb= (char*)ibuf->rect + pixel*4;
+ }
+ else {
+ char *rrgb = (char*)ibuf->rect + pixel*4;
char r = disable_red ? 0 : rrgb[0];
char g = disable_green ? 0 : rrgb[1];
char b = disable_blue ? 0 : rrgb[2];
+
if (grayscale) {
float gray = (0.2126f*r + 0.7152f*g + 0.0722f*b) / scale;
+
rrgb[0] = rrgb[1] = rrgb[2] = gray;
- } else {
+ }
+ else {
rrgb[0] = r;
rrgb[1] = g;
rrgb[2] = b;
@@ -1075,12 +1129,12 @@ void BKE_tracking_disable_imbuf_channels(ImBuf *ibuf, int disable_red, int disab
static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int grayscale)
{
- BKE_tracking_disable_imbuf_channels(ibuf, track->flag&TRACK_DISABLE_RED,
- track->flag&TRACK_DISABLE_GREEN, track->flag&TRACK_DISABLE_BLUE, grayscale);
+ BKE_tracking_disable_imbuf_channels(ibuf, track->flag & TRACK_DISABLE_RED,
+ track->flag & TRACK_DISABLE_GREEN, track->flag & TRACK_DISABLE_BLUE, grayscale);
}
static ImBuf *get_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
- float min[2], float max[2], int margin, int anchored, float pos[2], int origin[2])
+ float min[2], float max[2], int margin, int anchored, float pos[2], int origin[2])
{
ImBuf *tmpibuf;
int x, y;
@@ -1088,90 +1142,94 @@ static ImBuf *get_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTracki
float mpos[2];
copy_v2_v2(mpos, marker->pos);
- if(anchored)
+ if (anchored)
add_v2_v2(mpos, track->offset);
- if(pos)
+ if (pos)
zero_v2(pos);
- x= mpos[0]*ibuf->x;
- y= mpos[1]*ibuf->y;
+ x = mpos[0]*ibuf->x;
+ y = mpos[1]*ibuf->y;
- w= (max[0]-min[0])*ibuf->x;
- h= (max[1]-min[1])*ibuf->y;
+ w = (max[0] - min[0]) * ibuf->x;
+ h = (max[1] - min[1]) * ibuf->y;
/* dimensions should be odd */
- w= w|1;
- h= h|1;
+ w = w|1;
+ h = h|1;
- x1= x-(int)(w * (-min[0] / (max[0] - min[0])));
- y1= y-(int)(h * (-min[1] / (max[1] - min[1])));
+ x1 = x-(int)(w * (-min[0] / (max[0] - min[0])));
+ y1 = y-(int)(h * (-min[1] / (max[1] - min[1])));
- tmpibuf= IMB_allocImBuf(w+margin*2, h+margin*2, 32, IB_rect);
- IMB_rectcpy(tmpibuf, ibuf, 0, 0, x1-margin, y1-margin, w+margin*2, h+margin*2);
+ tmpibuf = IMB_allocImBuf(w+margin*2, h+margin*2, 32, IB_rect);
+ IMB_rectcpy(tmpibuf, ibuf, 0, 0, x1 - margin, y1 - margin, w + margin * 2, h + margin * 2);
- if(pos != NULL) {
- pos[0]= mpos[0]*ibuf->x-x1+margin;
- pos[1]= mpos[1]*ibuf->y-y1+margin;
+ if (pos != NULL) {
+ pos[0] = mpos[0] * ibuf->x - x1 + margin;
+ pos[1] = mpos[1] * ibuf->y - y1 + margin;
}
- if(origin != NULL) {
- origin[0]= x1-margin;
- origin[1]= y1-margin;
+ if (origin != NULL) {
+ origin[0] = x1 - margin;
+ origin[1] = y1 - margin;
}
- if((track->flag & TRACK_PREVIEW_GRAYSCALE) ||
+ if ((track->flag & TRACK_PREVIEW_GRAYSCALE) ||
(track->flag & TRACK_DISABLE_RED) ||
(track->flag & TRACK_DISABLE_GREEN) ||
(track->flag & TRACK_DISABLE_BLUE))
{
- disable_imbuf_channels(tmpibuf, track, 1 /* grayscale */);
+ disable_imbuf_channels(tmpibuf, track, TRUE /* grayscale */);
}
return tmpibuf;
}
ImBuf *BKE_tracking_get_pattern_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
- int margin, int anchored, float pos[2], int origin[2])
+ int margin, int anchored, float pos[2], int origin[2])
{
return get_area_imbuf(ibuf, track, marker, track->pat_min, track->pat_max, margin, anchored, pos, origin);
}
ImBuf *BKE_tracking_get_search_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
- int margin, int anchored, float pos[2], int origin[2])
+ int margin, int anchored, float pos[2], int origin[2])
{
return get_area_imbuf(ibuf, track, marker, track->search_min, track->search_max, margin, anchored, pos, origin);
}
#ifdef WITH_LIBMV
static float *get_search_floatbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
- int *width_r, int *height_r, float pos[2], int origin[2])
+ int *width_r, int *height_r, float pos[2], int origin[2])
{
ImBuf *tmpibuf;
float *pixels, *fp;
int x, y, width, height;
- width= (track->search_max[0]-track->search_min[0])*ibuf->x;
- height= (track->search_max[1]-track->search_min[1])*ibuf->y;
+ width = (track->search_max[0] - track->search_min[0]) * ibuf->x;
+ height = (track->search_max[1] - track->search_min[1]) * ibuf->y;
+
+ tmpibuf = BKE_tracking_get_search_imbuf(ibuf, track, marker, 0, 0, pos, origin);
+ disable_imbuf_channels(tmpibuf, track, FALSE /* don't grayscale */);
- tmpibuf= BKE_tracking_get_search_imbuf(ibuf, track, marker, 0, 0, pos, origin);
- disable_imbuf_channels(tmpibuf, track, 0 /* don't grayscale */);
+ *width_r = width;
+ *height_r = height;
- *width_r= width;
- *height_r= height;
+ fp = pixels = MEM_callocN(width * height * sizeof(float), "tracking floatBuf");
+ for (y = 0; y < (int)height; y++) {
+ for (x = 0; x < (int)width; x++) {
+ int pixel = tmpibuf->x * y + x;
- fp= pixels= MEM_callocN(width*height*sizeof(float), "tracking floatBuf");
- for(y= 0; y<(int)height; y++) {
- for (x= 0; x<(int)width; x++) {
- int pixel= tmpibuf->x*y + x;
+ if (tmpibuf->rect_float) {
+ float *rrgbf = tmpibuf->rect_float + pixel * 4;
- if(tmpibuf->rect_float) {
- float *rrgbf= tmpibuf->rect_float + pixel*4;
- *fp= 0.2126*rrgbf[0] + 0.7152*rrgbf[1] + 0.0722*rrgbf[2];
- } else {
- unsigned char *rrgb= (unsigned char*)tmpibuf->rect + pixel*4;
- *fp= (0.2126*rrgb[0] + 0.7152*rrgb[1] + 0.0722*rrgb[2])/255.0f;
+ *fp = 0.2126 * rrgbf[0] + 0.7152 * rrgbf[1] + 0.0722 * rrgbf[2];
}
+ else {
+ unsigned char *rrgb = (unsigned char*)tmpibuf->rect + pixel * 4;
+
+ *fp = (0.2126 * rrgb[0] + 0.7152 * rrgb[1] + 0.0722 * rrgb[2]) / 255.0f;
+ }
+
fp++;
}
}
@@ -1186,41 +1244,26 @@ static unsigned char *get_ucharbuf(ImBuf *ibuf)
int x, y;
unsigned char *pixels, *cp;
- cp= pixels= MEM_callocN(ibuf->x*ibuf->y*sizeof(unsigned char), "tracking ucharBuf");
- for(y= 0; y<ibuf->y; y++) {
- for (x= 0; x<ibuf->x; x++) {
- int pixel= ibuf->x*y + x;
-
- if(ibuf->rect_float) {
- const float *rrgbf= ibuf->rect_float + pixel*4;
- const float grey_f= 0.2126f*rrgbf[0] + 0.7152f*rrgbf[1] + 0.0722f*rrgbf[2];
- *cp= FTOCHAR(grey_f);
- } else {
- const unsigned char *rrgb= (unsigned char*)ibuf->rect + pixel*4;
- *cp= 0.2126f*rrgb[0] + 0.7152f*rrgb[1] + 0.0722f*rrgb[2];
- }
- cp++;
- }
- }
+ cp = pixels = MEM_callocN(ibuf->x * ibuf->y * sizeof(unsigned char), "tracking ucharBuf");
+ for (y = 0; y < ibuf->y; y++) {
+ for (x = 0; x < ibuf->x; x++) {
+ int pixel = ibuf->x * y + x;
- return pixels;
-}
+ if (ibuf->rect_float) {
+ const float *rrgbf = ibuf->rect_float + pixel*4;
+ const float grey_f = 0.2126f * rrgbf[0] + 0.7152f * rrgbf[1] + 0.0722f * rrgbf[2];
-static unsigned char *get_search_bytebuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
- int *width_r, int *height_r, float pos[2], int origin[2])
-{
- ImBuf *tmpibuf;
- unsigned char *pixels;
-
- tmpibuf= BKE_tracking_get_search_imbuf(ibuf, track, marker, 0, 0, pos, origin);
- disable_imbuf_channels(tmpibuf, track, 0 /* don't grayscale */);
-
- *width_r= tmpibuf->x;
- *height_r= tmpibuf->y;
+ *cp = FTOCHAR(grey_f);
+ }
+ else {
+ const unsigned char *rrgb = (unsigned char*)ibuf->rect + pixel * 4;
- pixels= get_ucharbuf(tmpibuf);
+ *cp = 0.2126f * rrgb[0] + 0.7152f * rrgb[1] + 0.0722f * rrgb[2];
+ }
- IMB_freeImBuf(tmpibuf);
+ cp++;
+ }
+ }
return pixels;
}
@@ -1228,273 +1271,205 @@ static unsigned char *get_search_bytebuf(ImBuf *ibuf, MovieTrackingTrack *track,
static ImBuf *get_frame_ibuf(MovieTrackingContext *context, int framenr)
{
ImBuf *ibuf;
- MovieClipUser user= context->user;
+ MovieClipUser user = context->user;
- user.framenr= framenr;
+ user.framenr = framenr;
- ibuf= BKE_movieclip_get_ibuf_flag(context->clip, &user, context->clip_flag, MOVIECLIP_CACHE_SKIP);
+ ibuf = BKE_movieclip_get_ibuf_flag(context->clip, &user, context->clip_flag, MOVIECLIP_CACHE_SKIP);
return ibuf;
}
static ImBuf *get_keyframed_ibuf(MovieTrackingContext *context, MovieTrackingTrack *track,
- MovieTrackingMarker *marker, MovieTrackingMarker **marker_keyed)
+ MovieTrackingMarker *marker, MovieTrackingMarker **marker_keyed)
{
- int framenr= marker->framenr;
- int a= marker-track->markers;
+ int framenr = marker->framenr;
+ int a = marker-track->markers;
- *marker_keyed= marker;
+ *marker_keyed = marker;
- while(a>=0 && a<track->markersnr) {
- int next= (context->backwards) ? a+1 : a-1;
- int is_keyframed= 0;
- MovieTrackingMarker *cur_marker= &track->markers[a];
- MovieTrackingMarker *next_marker= NULL;
+ while (a >= 0 && a < track->markersnr) {
+ int next = (context->backwards) ? a+1 : a-1;
+ int is_keyframed = FALSE;
+ MovieTrackingMarker *cur_marker = &track->markers[a];
+ MovieTrackingMarker *next_marker = NULL;
- if(next>=0 && next<track->markersnr)
+ if (next>=0 && next<track->markersnr)
next_marker= &track->markers[next];
/* if next mrker is disabled, stop searching keyframe and use current frame as keyframe */
- if(next_marker && next_marker->flag&MARKER_DISABLED)
- is_keyframed= 1;
+ if (next_marker && next_marker->flag & MARKER_DISABLED)
+ is_keyframed = TRUE;
+
+ is_keyframed |= (cur_marker->flag & MARKER_TRACKED) == 0;
- is_keyframed|= (cur_marker->flag&MARKER_TRACKED)==0;
+ if (is_keyframed) {
+ framenr = cur_marker->framenr;
+ *marker_keyed = cur_marker;
- if(is_keyframed) {
- framenr= cur_marker->framenr;
- *marker_keyed= cur_marker;
break;
}
- a= next;
+ a = next;
}
return get_frame_ibuf(context, framenr);
}
static ImBuf *get_adjust_ibuf(MovieTrackingContext *context, MovieTrackingTrack *track, MovieTrackingMarker *marker,
- int curfra, MovieTrackingMarker **marker_keyed)
+ int curfra, MovieTrackingMarker **marker_keyed)
{
- ImBuf *ibuf= NULL;
+ ImBuf *ibuf = NULL;
- if(track->pattern_match == TRACK_MATCH_KEYFRAME) {
- ibuf= get_keyframed_ibuf(context, track, marker, marker_keyed);
- } else {
- ibuf= get_frame_ibuf(context, curfra);
+ if (track->pattern_match == TRACK_MATCH_KEYFRAME) {
+ ibuf = get_keyframed_ibuf(context, track, marker, marker_keyed);
+ }
+ else {
+ ibuf = get_frame_ibuf(context, curfra);
/* use current marker as keyframed position */
- *marker_keyed= marker;
+ *marker_keyed = marker;
}
return ibuf;
}
-static void get_warped(TrackContext *track_context, int x, int y, int width, unsigned char *image)
-{
- int i, j;
-
- for(i=0; i<track_context->pattern_size; i++) {
- for(j=0; j<track_context->pattern_size; j++) {
- track_context->warped[i*track_context->pattern_size+j]=
- image[(y+i-track_context->pattern_size/2)*width+x+j-track_context->pattern_size/2];
- }
- }
-}
-
#endif
void BKE_tracking_sync(MovieTrackingContext *context)
{
- MovieTracking *tracking= &context->clip->tracking;
+ MovieTracking *tracking = &context->clip->tracking;
int newframe;
tracks_map_merge(context->tracks_map, tracking);
- if(context->backwards) newframe= context->user.framenr+1;
- else newframe= context->user.framenr-1;
+ if (context->backwards)
+ newframe = context->user.framenr + 1;
+ else
+ newframe = context->user.framenr - 1;
- context->sync_frame= newframe;
+ context->sync_frame = newframe;
}
void BKE_tracking_sync_user(MovieClipUser *user, MovieTrackingContext *context)
{
- user->framenr= context->sync_frame;
+ user->framenr = context->sync_frame;
}
int BKE_tracking_next(MovieTrackingContext *context)
{
ImBuf *ibuf_new;
- int curfra= context->user.framenr;
- int a, ok= 0, map_size;
+ int curfra = context->user.framenr;
+ int a, ok = FALSE, map_size;
- map_size= tracks_map_size(context->tracks_map);
+ map_size = tracks_map_size(context->tracks_map);
/* nothing to track, avoid unneeded frames reading to save time and memory */
- if(!map_size)
- return 0;
+ if (!map_size)
+ return FALSE;
- if(context->backwards) context->user.framenr--;
- else context->user.framenr++;
+ if (context->backwards)
+ context->user.framenr--;
+ else
+ context->user.framenr++;
- ibuf_new= BKE_movieclip_get_ibuf_flag(context->clip, &context->user, context->clip_flag, MOVIECLIP_CACHE_SKIP);
- if(!ibuf_new)
- return 0;
+ ibuf_new = BKE_movieclip_get_ibuf_flag(context->clip, &context->user, context->clip_flag, MOVIECLIP_CACHE_SKIP);
+ if (!ibuf_new)
+ return FALSE;
- #pragma omp parallel for private(a) shared(ibuf_new, ok) if(map_size>1)
- for(a= 0; a<map_size; a++) {
+ #pragma omp parallel for private(a) shared(ibuf_new, ok) if (map_size>1)
+ for (a = 0; a < map_size; a++) {
TrackContext *track_context = NULL;
MovieTrackingTrack *track;
MovieTrackingMarker *marker;
tracks_map_get(context->tracks_map, a, &track, (void**)&track_context);
- marker= BKE_tracking_exact_marker(track, curfra);
+ marker = BKE_tracking_exact_marker(track, curfra);
- if(marker && (marker->flag&MARKER_DISABLED)==0) {
+ if (marker && (marker->flag & MARKER_DISABLED) == 0) {
#ifdef WITH_LIBMV
- int width, height, origin[2], tracked= 0, need_readjust= 0;
+ int width, height, origin[2], tracked = 0, need_readjust = 0;
float pos[2], margin[2], dim[2];
double x1, y1, x2, y2;
- ImBuf *ibuf= NULL;
+ ImBuf *ibuf = NULL;
MovieTrackingMarker marker_new, *marker_keyed;
- int onbound= 0, nextfra;
+ int onbound = FALSE, nextfra;
- if(track->pattern_match==TRACK_MATCH_KEYFRAME)
- need_readjust= context->first_time;
+ if (track->pattern_match == TRACK_MATCH_KEYFRAME)
+ need_readjust = context->first_time;
else
- need_readjust= 1;
+ need_readjust = TRUE;
- if(context->backwards) nextfra= curfra-1;
- else nextfra= curfra+1;
+ if (context->backwards)
+ nextfra = curfra - 1;
+ else
+ nextfra = curfra + 1;
/* margin from frame boundaries */
sub_v2_v2v2(dim, track->pat_max, track->pat_min);
- margin[0]= margin[1]= MAX2(dim[0], dim[1]) / 2.0f;
+ margin[0] = margin[1] = MAX2(dim[0], dim[1]) / 2.0f;
- margin[0]= MAX2(margin[0], (float)track->margin / ibuf_new->x);
- margin[1]= MAX2(margin[1], (float)track->margin / ibuf_new->y);
+ margin[0] = MAX2(margin[0], (float)track->margin / ibuf_new->x);
+ margin[1] = MAX2(margin[1], (float)track->margin / ibuf_new->y);
/* do not track markers which are too close to boundary */
- if(marker->pos[0]<margin[0] || marker->pos[0]>1.0f-margin[0] ||
- marker->pos[1]<margin[1] || marker->pos[1]>1.0f-margin[1]) {
- onbound= 1;
+ if (marker->pos[0]<margin[0] || marker->pos[0]>1.0f-margin[0] ||
+ marker->pos[1]<margin[1] || marker->pos[1]>1.0f-margin[1])
+ {
+ onbound = TRUE;
}
- else if(ELEM(track->tracker, TRACKER_KLT, TRACKER_HYBRID)) {
+ else {
float *patch_new;
- if(need_readjust) {
+ if (need_readjust) {
/* calculate patch for keyframed position */
- ibuf= get_adjust_ibuf(context, track, marker, curfra, &marker_keyed);
+ ibuf = get_adjust_ibuf(context, track, marker, curfra, &marker_keyed);
- if(track_context->patch)
+ if (track_context->patch)
MEM_freeN(track_context->patch);
- track_context->patch= get_search_floatbuf(ibuf, track, marker_keyed, &width, &height, track_context->keyframed_pos, origin);
+ track_context->patch = get_search_floatbuf(ibuf, track, marker_keyed, &width, &height,
+ track_context->keyframed_pos, origin);
IMB_freeImBuf(ibuf);
}
- patch_new= get_search_floatbuf(ibuf_new, track, marker, &width, &height, pos, origin);
+ patch_new = get_search_floatbuf(ibuf_new, track, marker, &width, &height, pos, origin);
- x1= track_context->keyframed_pos[0];
- y1= track_context->keyframed_pos[1];
+ x1 = track_context->keyframed_pos[0];
+ y1 = track_context->keyframed_pos[1];
- x2= pos[0];
- y2= pos[1];
+ x2 = pos[0];
+ y2 = pos[1];
- tracked= libmv_regionTrackerTrack(track_context->region_tracker, track_context->patch, patch_new,
+ tracked = libmv_regionTrackerTrack(track_context->region_tracker, track_context->patch, patch_new,
width, height, x1, y1, &x2, &y2);
MEM_freeN(patch_new);
}
- else if(track->tracker==TRACKER_SAD) {
- unsigned char *image_new;
- float correlation;
- float warp[3][2]={{0}};
-
- if(need_readjust) {
- unsigned char *image;
-
- /* calculate pattern for keyframed position */
- ibuf= get_adjust_ibuf(context, track, marker, curfra, &marker_keyed);
-
- image= get_search_bytebuf(ibuf, track, marker_keyed, &width, &height, pos, origin);
- memset(warp, 0, sizeof(warp));
- warp[0][0]= 1;
- warp[1][1]= 1;
- warp[2][0]= pos[0];
- warp[2][1]= pos[1];
-
- if(!track_context->pattern) {
- int square= track_context->pattern_size*track_context->pattern_size;
- track_context->pattern= MEM_callocN(sizeof(unsigned char)*square, "trackking pattern");
- }
-
- libmv_SADSamplePattern(image, width, warp, track_context->pattern, track_context->pattern_size);
-
- MEM_freeN(image);
- IMB_freeImBuf(ibuf);
- }
-
- image_new= get_search_bytebuf(ibuf_new, track, marker, &width, &height, pos, origin);
-
- if(track_context->warped==NULL) {
- unsigned char *image_old;
-
- ibuf= get_frame_ibuf(context, curfra);
-
- if(track_context->warped==NULL) {
- int square= track_context->pattern_size*track_context->pattern_size;
- track_context->warped= MEM_callocN(sizeof(unsigned char)*square, "trackking warped");
- }
-
- image_old= get_search_bytebuf(ibuf, track, marker, &width, &height, pos, origin);
- get_warped(track_context, pos[0], pos[1], width, image_old);
- IMB_freeImBuf(ibuf);
- MEM_freeN(image_old);
- }
-
- memset(warp, 0, sizeof(warp));
- warp[0][0]= 1;
- warp[1][1]= 1;
- warp[2][0]= pos[0];
- warp[2][1]= pos[1];
-
- correlation= libmv_SADTrackerTrack(track_context->pattern, track_context->warped,
- track_context->pattern_size, image_new, width, width, height, warp);
-
- x2= warp[2][0];
- y2= warp[2][1];
-
- tracked= track->minimum_correlation < correlation;
-
- if(tracked)
- get_warped(track_context, x2, y2, width, image_new);
-
- MEM_freeN(image_new);
- }
-
- if(tracked && !onbound && finite(x2) && finite(y2)) {
- if(context->first_time) {
+ if (tracked && !onbound && finite(x2) && finite(y2)) {
+ if (context->first_time) {
#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);
}
}
memset(&marker_new, 0, sizeof(marker_new));
- if(!onbound) {
- marker_new.pos[0]= (origin[0]+x2)/ibuf_new->x;
- marker_new.pos[1]= (origin[1]+y2)/ibuf_new->y;
- } else {
+ if (!onbound) {
+ marker_new.pos[0] = (origin[0] + x2) / ibuf_new->x;
+ marker_new.pos[1] = (origin[1] + y2) / ibuf_new->y;
+ }
+ else {
copy_v2_v2(marker_new.pos, marker->pos);
}
- marker_new.flag|= MARKER_TRACKED;
+ marker_new.flag |= MARKER_TRACKED;
marker_new.framenr= nextfra;
#pragma omp critical
@@ -1507,11 +1482,12 @@ int BKE_tracking_next(MovieTrackingContext *context)
{
put_disabled_marker(track, &marker_new, context->backwards, 0);
}
- } else {
- marker_new= *marker;
+ }
+ else {
+ marker_new = *marker;
- marker_new.framenr= nextfra;
- marker_new.flag|= MARKER_DISABLED;
+ marker_new.framenr = nextfra;
+ marker_new.flag |= MARKER_DISABLED;
#pragma omp critical
{
@@ -1519,14 +1495,14 @@ int BKE_tracking_next(MovieTrackingContext *context)
}
}
- ok= 1;
+ ok = TRUE;
#endif
}
}
IMB_freeImBuf(ibuf_new);
- context->first_time= 0;
+ context->first_time = FALSE;
context->frames++;
return ok;
@@ -1567,23 +1543,24 @@ typedef struct ReconstructProgressData {
#if WITH_LIBMV
static struct libmv_Tracks *create_libmv_tracks(ListBase *tracksbase, int width, int height)
{
- int tracknr= 0;
+ int tracknr = 0;
MovieTrackingTrack *track;
- struct libmv_Tracks *tracks= libmv_tracksNew();
+ struct libmv_Tracks *tracks = libmv_tracksNew();
- track= tracksbase->first;
- while(track) {
- int a= 0;
+ track = tracksbase->first;
+ while (track) {
+ int a = 0;
- for(a= 0; a<track->markersnr; a++) {
- MovieTrackingMarker *marker= &track->markers[a];
+ for (a = 0; a < track->markersnr; a++) {
+ MovieTrackingMarker *marker = &track->markers[a];
- if((marker->flag&MARKER_DISABLED)==0)
+ if ((marker->flag & MARKER_DISABLED) == 0) {
libmv_tracksInsert(tracks, marker->framenr, tracknr,
- marker->pos[0]*width, marker->pos[1]*height);
+ marker->pos[0] * width, marker->pos[1] * height);
+ }
}
- track= track->next;
+ track = track->next;
tracknr++;
}
@@ -1592,122 +1569,123 @@ static struct libmv_Tracks *create_libmv_tracks(ListBase *tracksbase, int width,
static void retrieve_libmv_reconstruct_intrinscis(MovieReconstructContext *context, MovieTracking *tracking)
{
- struct libmv_Reconstruction *libmv_reconstruction= context->reconstruction;
+ struct libmv_Reconstruction *libmv_reconstruction = context->reconstruction;
struct libmv_CameraIntrinsics *libmv_intrinsics = libmv_ReconstructionExtractIntrinsics(libmv_reconstruction);
- float aspy= 1.0f/tracking->camera.pixel_aspect;
+ float aspy = 1.0f / tracking->camera.pixel_aspect;
double focal_length, principal_x, principal_y, k1, k2, k3;
int width, height;
libmv_CameraIntrinsicsExtract(libmv_intrinsics, &focal_length, &principal_x, &principal_y,
- &k1, &k2, &k3, &width, &height);
+ &k1, &k2, &k3, &width, &height);
- tracking->camera.focal= focal_length;
- tracking->camera.principal[0]= principal_x;
+ tracking->camera.focal = focal_length;
+ tracking->camera.principal[0] = principal_x;
- /* todo: verify divide by aspy is correct */
- tracking->camera.principal[1]= principal_y / aspy;
- tracking->camera.k1= k1;
- tracking->camera.k2= k2;
+ tracking->camera.principal[1] = principal_y / aspy;
+ tracking->camera.k1 = k1;
+ tracking->camera.k2 = k2;
}
static int retrieve_libmv_reconstruct_tracks(MovieReconstructContext *context, MovieTracking *tracking)
{
- struct libmv_Reconstruction *libmv_reconstruction= context->reconstruction;
- MovieTrackingReconstruction *reconstruction= NULL;
+ struct libmv_Reconstruction *libmv_reconstruction = context->reconstruction;
+ MovieTrackingReconstruction *reconstruction = NULL;
MovieReconstructedCamera *reconstructed;
MovieTrackingTrack *track;
- ListBase *tracksbase= NULL;
- int ok= 1, tracknr= 0, a, origin_set= 0;
- int sfra= context->sfra, efra= context->efra;
+ ListBase *tracksbase = NULL;
+ int ok = TRUE, tracknr = 0, a, origin_set = FALSE;
+ int sfra = context->sfra, efra = context->efra;
float imat[4][4];
- if(context->is_camera) {
- tracksbase= &tracking->tracks;
- reconstruction= &tracking->reconstruction;
+ if (context->is_camera) {
+ tracksbase = &tracking->tracks;
+ reconstruction = &tracking->reconstruction;
}
else {
- MovieTrackingObject *object= BKE_tracking_named_object(tracking, context->object_name);
+ MovieTrackingObject *object = BKE_tracking_named_object(tracking, context->object_name);
- tracksbase= &object->tracks;
- reconstruction= &object->reconstruction;
+ tracksbase = &object->tracks;
+ reconstruction = &object->reconstruction;
}
unit_m4(imat);
- track= tracksbase->first;
- while(track) {
+ track = tracksbase->first;
+ while (track) {
double pos[3];
- if(libmv_reporojectionPointForTrack(libmv_reconstruction, tracknr, pos)) {
- track->bundle_pos[0]= pos[0];
- track->bundle_pos[1]= pos[1];
- track->bundle_pos[2]= pos[2];
+ if (libmv_reporojectionPointForTrack(libmv_reconstruction, tracknr, pos)) {
+ track->bundle_pos[0] = pos[0];
+ track->bundle_pos[1] = pos[1];
+ track->bundle_pos[2] = pos[2];
- track->flag|= TRACK_HAS_BUNDLE;
- track->error= libmv_reporojectionErrorForTrack(libmv_reconstruction, tracknr);
- } else {
- track->flag&= ~TRACK_HAS_BUNDLE;
- ok= 0;
+ track->flag |= TRACK_HAS_BUNDLE;
+ track->error = libmv_reporojectionErrorForTrack(libmv_reconstruction, tracknr);
+ }
+ else {
+ track->flag &= ~TRACK_HAS_BUNDLE;
+ ok = FALSE;
printf("No bundle for track #%d '%s'\n", tracknr, track->name);
}
- track= track->next;
+ track = track->next;
tracknr++;
}
- if(reconstruction->cameras)
+ if (reconstruction->cameras)
MEM_freeN(reconstruction->cameras);
- reconstruction->camnr= 0;
- reconstruction->cameras= NULL;
- reconstructed= MEM_callocN((efra-sfra+1)*sizeof(MovieReconstructedCamera), "temp reconstructed camera");
+ reconstruction->camnr = 0;
+ reconstruction->cameras = NULL;
+ reconstructed = MEM_callocN((efra-sfra+1)*sizeof(MovieReconstructedCamera), "temp reconstructed camera");
- for(a= sfra; a<=efra; a++) {
+ for (a = sfra; a <= efra; a++) {
double matd[4][4];
- if(libmv_reporojectionCameraForImage(libmv_reconstruction, a, matd)) {
+ if (libmv_reporojectionCameraForImage(libmv_reconstruction, a, matd)) {
int i, j;
float mat[4][4];
- float error= libmv_reporojectionErrorForImage(libmv_reconstruction, a);
+ float error = libmv_reporojectionErrorForImage(libmv_reconstruction, a);
- for(i=0; i<4; i++)
- for(j= 0; j<4; j++)
- mat[i][j]= matd[i][j];
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 4; j++)
+ mat[i][j] = matd[i][j];
- if(!origin_set) {
+ if (!origin_set) {
copy_m4_m4(imat, mat);
invert_m4(imat);
- origin_set= 1;
+ origin_set = TRUE;
}
- if(origin_set)
+ if (origin_set)
mult_m4_m4m4(mat, imat, mat);
copy_m4_m4(reconstructed[reconstruction->camnr].mat, mat);
- reconstructed[reconstruction->camnr].framenr= a;
- reconstructed[reconstruction->camnr].error= error;
+ reconstructed[reconstruction->camnr].framenr = a;
+ reconstructed[reconstruction->camnr].error = error;
reconstruction->camnr++;
- } else {
- ok= 0;
+ }
+ else {
+ ok = FALSE;
printf("No camera for frame %d\n", a);
}
}
- if(reconstruction->camnr) {
- reconstruction->cameras= MEM_callocN(reconstruction->camnr*sizeof(MovieReconstructedCamera), "reconstructed camera");
- memcpy(reconstruction->cameras, reconstructed, reconstruction->camnr*sizeof(MovieReconstructedCamera));
+ if (reconstruction->camnr) {
+ reconstruction->cameras = MEM_callocN(reconstruction->camnr * sizeof(MovieReconstructedCamera), "reconstructed camera");
+ memcpy(reconstruction->cameras, reconstructed, reconstruction->camnr * sizeof(MovieReconstructedCamera));
}
- if(origin_set) {
- track= tracksbase->first;
- while(track) {
- if(track->flag&TRACK_HAS_BUNDLE)
+ if (origin_set) {
+ track = tracksbase->first;
+ while (track) {
+ if (track->flag & TRACK_HAS_BUNDLE)
mul_v3_m4v3(track->bundle_pos, imat, track->bundle_pos);
- track= track->next;
+ track = track->next;
}
}
@@ -1726,40 +1704,40 @@ static int retrieve_libmv_reconstruct(MovieReconstructContext *context, MovieTra
static int get_refine_intrinsics_flags(MovieTracking *tracking, MovieTrackingObject *object)
{
- int refine= tracking->settings.refine_camera_intrinsics;
- int flags= 0;
+ int refine = tracking->settings.refine_camera_intrinsics;
+ int flags = 0;
- if((object->flag&TRACKING_OBJECT_CAMERA)==0)
+ if ((object->flag & TRACKING_OBJECT_CAMERA) == 0)
return 0;
- if(refine&REFINE_FOCAL_LENGTH)
- flags|= LIBMV_REFINE_FOCAL_LENGTH;
+ if (refine & REFINE_FOCAL_LENGTH)
+ flags |= LIBMV_REFINE_FOCAL_LENGTH;
- if(refine&REFINE_PRINCIPAL_POINT)
- flags|= LIBMV_REFINE_PRINCIPAL_POINT;
+ if (refine & REFINE_PRINCIPAL_POINT)
+ flags |= LIBMV_REFINE_PRINCIPAL_POINT;
- if(refine&REFINE_RADIAL_DISTORTION_K1)
- flags|= REFINE_RADIAL_DISTORTION_K1;
+ if (refine & REFINE_RADIAL_DISTORTION_K1)
+ flags |= REFINE_RADIAL_DISTORTION_K1;
- if(refine&REFINE_RADIAL_DISTORTION_K2)
- flags|= REFINE_RADIAL_DISTORTION_K2;
+ if (refine & REFINE_RADIAL_DISTORTION_K2)
+ flags |= REFINE_RADIAL_DISTORTION_K2;
return flags;
}
static int count_tracks_on_both_keyframes(MovieTracking *tracking, ListBase *tracksbase)
{
- int tot= 0;
- int frame1= tracking->settings.keyframe1, frame2= tracking->settings.keyframe2;
+ int tot = 0;
+ int frame1 = tracking->settings.keyframe1, frame2= tracking->settings.keyframe2;
MovieTrackingTrack *track;
- track= tracksbase->first;
- while(track) {
- if(BKE_tracking_has_enabled_marker(track, frame1))
- if(BKE_tracking_has_enabled_marker(track, frame2))
+ track = tracksbase->first;
+ while (track) {
+ if (BKE_tracking_has_enabled_marker(track, frame1))
+ if (BKE_tracking_has_enabled_marker(track, frame2))
tot++;
- track= track->next;
+ track = track->next;
}
return tot;
@@ -1769,76 +1747,78 @@ static int count_tracks_on_both_keyframes(MovieTracking *tracking, ListBase *tra
int BKE_tracking_can_reconstruct(MovieTracking *tracking, MovieTrackingObject *object, char *error_msg, int error_size)
{
#if WITH_LIBMV
- ListBase *tracksbase= BKE_tracking_object_tracks(tracking, object);
+ ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object);
- if(count_tracks_on_both_keyframes(tracking, tracksbase)<8) {
+ if (count_tracks_on_both_keyframes(tracking, tracksbase)<8) {
BLI_strncpy(error_msg, "At least 8 common tracks on both of keyframes are needed for reconstruction", error_size);
- return 0;
+
+ return FALSE;
}
- return 1;
+ return TRUE;
#else
BLI_strncpy(error_msg, "Blender is compiled without motion tracking library", error_size);
- (void)tracking;
- (void)object;
+
+ (void) tracking;
+ (void) object;
return 0;
#endif
}
-MovieReconstructContext* BKE_tracking_reconstruction_context_new(MovieTracking *tracking,
- MovieTrackingObject *object, int keyframe1, int keyframe2, int width, int height)
+MovieReconstructContext* BKE_tracking_reconstruction_context_new(MovieTracking *tracking, MovieTrackingObject *object,
+ int keyframe1, int keyframe2, int width, int height)
{
- MovieReconstructContext *context= MEM_callocN(sizeof(MovieReconstructContext), "MovieReconstructContext data");
- MovieTrackingCamera *camera= &tracking->camera;
- ListBase *tracksbase= BKE_tracking_object_tracks(tracking, object);
- float aspy= 1.0f/tracking->camera.pixel_aspect;
- int num_tracks= BLI_countlist(tracksbase);
- int sfra= INT_MAX, efra= INT_MIN;
+ MovieReconstructContext *context = MEM_callocN(sizeof(MovieReconstructContext), "MovieReconstructContext data");
+ MovieTrackingCamera *camera = &tracking->camera;
+ ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object);
+ float aspy = 1.0f / tracking->camera.pixel_aspect;
+ int num_tracks = BLI_countlist(tracksbase);
+ int sfra = INT_MAX, efra = INT_MIN;
MovieTrackingTrack *track;
BLI_strncpy(context->object_name, object->name, sizeof(context->object_name));
context->is_camera = object->flag&TRACKING_OBJECT_CAMERA;
- context->tracks_map= tracks_map_new(context->object_name, context->is_camera, num_tracks, 0);
+ context->tracks_map = tracks_map_new(context->object_name, context->is_camera, num_tracks, 0);
- track= tracksbase->first;
- while(track) {
- int first= 0, last= track->markersnr-1;
- MovieTrackingMarker *first_marker= &track->markers[0];
- MovieTrackingMarker *last_marker= &track->markers[track->markersnr-1];
+ track = tracksbase->first;
+ while (track) {
+ int first = 0, last = track->markersnr-1;
+ MovieTrackingMarker *first_marker = &track->markers[0];
+ MovieTrackingMarker *last_marker = &track->markers[track->markersnr - 1];
/* find first not-disabled marker */
- while(first<=track->markersnr-1 && first_marker->flag&MARKER_DISABLED) {
+ while (first <= track->markersnr - 1 && first_marker->flag & MARKER_DISABLED) {
first++;
first_marker++;
}
/* find last not-disabled marker */
- while(last>=0 && last_marker->flag&MARKER_DISABLED) {
+ while (last >= 0 && last_marker->flag & MARKER_DISABLED) {
last--;
last_marker--;
}
- if(first<track->markersnr-1)
- sfra= MIN2(sfra, first_marker->framenr);
+ if (first<track->markersnr - 1)
+ sfra = MIN2(sfra, first_marker->framenr);
- if(last>=0)
- efra= MAX2(efra, last_marker->framenr);
+ if (last >= 0)
+ efra = MAX2(efra, last_marker->framenr);
tracks_map_insert(context->tracks_map, track, NULL);
- track= track->next;
+ track = track->next;
}
- context->sfra= sfra;
- context->efra= efra;
+ context->sfra = sfra;
+ context->efra = efra;
#ifdef WITH_LIBMV
- context->tracks= create_libmv_tracks(tracksbase, width, height*aspy);
- context->keyframe1= keyframe1;
- context->keyframe2= keyframe2;
- context->refine_flags= get_refine_intrinsics_flags(tracking, object);
+ context->tracks = create_libmv_tracks(tracksbase, width, height*aspy);
+ context->keyframe1 = keyframe1;
+ context->keyframe2 = keyframe2;
+ context->refine_flags = get_refine_intrinsics_flags(tracking, object);
#else
(void) width;
(void) height;
@@ -1846,13 +1826,13 @@ MovieReconstructContext* BKE_tracking_reconstruction_context_new(MovieTracking *
(void) keyframe2;
#endif
- context->focal_length= camera->focal;
- context->principal_point[0]= camera->principal[0];
- context->principal_point[1]= camera->principal[1]*aspy;
+ context->focal_length = camera->focal;
+ context->principal_point[0] = camera->principal[0];
+ context->principal_point[1] = camera->principal[1] * aspy;
- context->k1= camera->k1;
- context->k2= camera->k2;
- context->k3= camera->k3;
+ context->k1 = camera->k1;
+ context->k2 = camera->k2;
+ context->k3 = camera->k3;
return context;
}
@@ -1860,7 +1840,7 @@ MovieReconstructContext* BKE_tracking_reconstruction_context_new(MovieTracking *
void BKE_tracking_reconstruction_context_free(MovieReconstructContext *context)
{
#ifdef WITH_LIBMV
- if(context->reconstruction)
+ if (context->reconstruction)
libmv_destroyReconstruction(context->reconstruction);
libmv_tracksDestroy(context->tracks);
@@ -1876,41 +1856,40 @@ static void solve_reconstruction_update_cb(void *customdata, double progress, co
{
ReconstructProgressData *progressdata= customdata;
- if(progressdata->progress) {
- *progressdata->progress= progress;
- *progressdata->do_update= 1;
+ if (progressdata->progress) {
+ *progressdata->progress = progress;
+ *progressdata->do_update = TRUE;
}
- BLI_snprintf(progressdata->stats_message, progressdata->message_size,
- "Solving camera | %s", message);
+ BLI_snprintf(progressdata->stats_message, progressdata->message_size, "Solving camera | %s", message);
}
#endif
#if 0
static int solve_reconstruction_testbreak_cb(void *customdata)
{
- ReconstructProgressData *progressdata= customdata;
+ ReconstructProgressData *progressdata = customdata;
- if(progressdata->stop && *progressdata->stop)
- return 1;
+ if (progressdata->stop && *progressdata->stop)
+ return TRUE;
return G.afbreek;
}
#endif
-void BKE_tracking_solve_reconstruction(MovieReconstructContext *context, short *stop,
- short *do_update, float *progress, char *stats_message, int message_size)
+void BKE_tracking_solve_reconstruction(MovieReconstructContext *context, short *stop, short *do_update,
+ float *progress, char *stats_message, int message_size)
{
#ifdef WITH_LIBMV
float error;
ReconstructProgressData progressdata;
- progressdata.stop= stop;
- progressdata.do_update= do_update;
- progressdata.progress= progress;
- progressdata.stats_message= stats_message;
- progressdata.message_size= message_size;
+ progressdata.stop = stop;
+ progressdata.do_update = do_update;
+ progressdata.progress = progress;
+ progressdata.stats_message = stats_message;
+ progressdata.message_size = message_size;
context->reconstruction = libmv_solveReconstruction(context->tracks,
context->keyframe1, context->keyframe2,
@@ -1920,9 +1899,9 @@ void BKE_tracking_solve_reconstruction(MovieReconstructContext *context, short *
context->k1, context->k2, context->k3,
solve_reconstruction_update_cb, &progressdata);
- error= libmv_reprojectionError(context->reconstruction);
+ error = libmv_reprojectionError(context->reconstruction);
- context->reprojection_error= error;
+ context->reprojection_error = error;
#else
(void) context;
(void) stop;
@@ -1939,25 +1918,25 @@ int BKE_tracking_finish_reconstruction(MovieReconstructContext *context, MovieTr
tracks_map_merge(context->tracks_map, tracking);
- if(context->is_camera) {
- reconstruction= &tracking->reconstruction;
+ if (context->is_camera) {
+ reconstruction = &tracking->reconstruction;
}
else {
MovieTrackingObject *object;
- object= BKE_tracking_named_object(tracking, context->object_name);
- reconstruction= &object->reconstruction;
+ object = BKE_tracking_named_object(tracking, context->object_name);
+ reconstruction = &object->reconstruction;
}
- reconstruction->error= context->reprojection_error;
- reconstruction->flag|= TRACKING_RECONSTRUCTED;
+ reconstruction->error = context->reprojection_error;
+ reconstruction->flag |= TRACKING_RECONSTRUCTED;
#ifdef WITH_LIBMV
- if(!retrieve_libmv_reconstruct(context, tracking))
- return 0;
+ if (!retrieve_libmv_reconstruct(context, tracking))
+ return FALSE;
#endif
- return 1;
+ return TRUE;
}
void BKE_track_unique_name(ListBase *tracksbase, MovieTrackingTrack *track)
@@ -1967,14 +1946,14 @@ void BKE_track_unique_name(ListBase *tracksbase, MovieTrackingTrack *track)
MovieTrackingTrack *BKE_tracking_named_track(MovieTracking *tracking, MovieTrackingObject *object, const char *name)
{
- ListBase *tracksbase= BKE_tracking_object_tracks(tracking, object);
- MovieTrackingTrack *track= tracksbase->first;
+ ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object);
+ MovieTrackingTrack *track = tracksbase->first;
- while(track) {
- if(!strcmp(track->name, name))
+ while (track) {
+ if (!strcmp(track->name, name))
return track;
- track= track->next;
+ track = track->next;
}
return NULL;
@@ -1983,51 +1962,59 @@ MovieTrackingTrack *BKE_tracking_named_track(MovieTracking *tracking, MovieTrack
static int reconstruction_camera_index(MovieTrackingReconstruction *reconstruction, int framenr, int nearest)
{
MovieReconstructedCamera *cameras= reconstruction->cameras;
- int a= 0, d= 1;
+ int a = 0, d = 1;
- if(!reconstruction->camnr)
+ if (!reconstruction->camnr)
return -1;
- if(framenr<cameras[0].framenr) {
- if(nearest) return 0;
- else return -1;
+ if (framenr<cameras[0].framenr) {
+ if (nearest)
+ return 0;
+ else
+ return -1;
}
- if(framenr>cameras[reconstruction->camnr-1].framenr) {
- if(nearest) return reconstruction->camnr-1;
- else return -1;
+ if (framenr>cameras[reconstruction->camnr - 1].framenr) {
+ if (nearest)
+ return reconstruction->camnr - 1;
+ else
+ return -1;
}
- if(reconstruction->last_camera<reconstruction->camnr)
- a= reconstruction->last_camera;
+ if (reconstruction->last_camera<reconstruction->camnr)
+ a = reconstruction->last_camera;
- if(cameras[a].framenr>=framenr)
- d= -1;
+ if (cameras[a].framenr >= framenr)
+ d = -1;
- while(a>=0 && a<reconstruction->camnr) {
- int cfra= cameras[a].framenr;
+ while (a >= 0 && a < reconstruction->camnr) {
+ int cfra = cameras[a].framenr;
/* check if needed framenr was "skipped" -- no data for requested frame */
- if(d>0 && cfra>framenr) {
+ if (d > 0 && cfra > framenr) {
/* interpolate with previous position */
- if(nearest) return a-1;
- else break;
+ if (nearest)
+ return a - 1;
+ else
+ break;
}
- if(d<0 && cfra<framenr) {
+ if (d < 0 && cfra < framenr) {
/* interpolate with next position */
- if(nearest) return a;
- else break;
+ if (nearest)
+ return a;
+ else
+ break;
}
- if(cfra==framenr) {
- reconstruction->last_camera= a;
+ if (cfra == framenr) {
+ reconstruction->last_camera = a;
return a;
}
- a+= d;
+ a += d;
}
return -1;
@@ -2035,50 +2022,52 @@ static int reconstruction_camera_index(MovieTrackingReconstruction *reconstructi
static void scale_reconstructed_camera(MovieTrackingObject *object, float mat[4][4])
{
- if((object->flag&TRACKING_OBJECT_CAMERA)==0) {
+ if ((object->flag & TRACKING_OBJECT_CAMERA) == 0) {
float smat[4][4];
- scale_m4_fl(smat, 1.0f/object->scale);
+ scale_m4_fl(smat, 1.0f / object->scale);
mult_m4_m4m4(mat, mat, smat);
}
}
MovieReconstructedCamera *BKE_tracking_get_reconstructed_camera(MovieTracking *tracking,
- MovieTrackingObject *object, int framenr)
+ MovieTrackingObject *object, int framenr)
{
MovieTrackingReconstruction *reconstruction;
int a;
- reconstruction= BKE_tracking_object_reconstruction(tracking, object);
- a= reconstruction_camera_index(reconstruction, framenr, 0);
+ reconstruction = BKE_tracking_object_reconstruction(tracking, object);
+ a = reconstruction_camera_index(reconstruction, framenr, FALSE);
- if(a==-1)
+ if (a ==-1)
return NULL;
return &reconstruction->cameras[a];
}
void BKE_tracking_get_interpolated_camera(MovieTracking *tracking, MovieTrackingObject *object,
- int framenr, float mat[4][4])
+ int framenr, float mat[4][4])
{
MovieTrackingReconstruction *reconstruction;
MovieReconstructedCamera *cameras;
int a;
- reconstruction= BKE_tracking_object_reconstruction(tracking, object);
- cameras= reconstruction->cameras;
- a= reconstruction_camera_index(reconstruction, framenr, 1);
+ reconstruction = BKE_tracking_object_reconstruction(tracking, object);
+ cameras = reconstruction->cameras;
+ a = reconstruction_camera_index(reconstruction, framenr, 1);
- if(a==-1) {
+ if (a == -1) {
unit_m4(mat);
+
return;
}
- if(cameras[a].framenr!=framenr && a>0 && a<reconstruction->camnr-1) {
- float t= ((float)framenr-cameras[a].framenr) / (cameras[a+1].framenr-cameras[a].framenr);
+ if (cameras[a].framenr != framenr && a > 0 && a < reconstruction->camnr - 1) {
+ float t = ((float)framenr-cameras[a].framenr) / (cameras[a + 1].framenr-cameras[a].framenr);
blend_m4_m4m4(mat, cameras[a].mat, cameras[a+1].mat, t);
- } else {
+ }
+ else {
copy_m4_m4(mat, cameras[a].mat);
}
@@ -2087,12 +2076,14 @@ void BKE_tracking_get_interpolated_camera(MovieTracking *tracking, MovieTracking
void BKE_get_tracking_mat(Scene *scene, Object *ob, float mat[4][4])
{
- if(!ob) {
- if(scene->camera) ob= scene->camera;
- else ob= scene_find_camera(scene);
+ if (!ob) {
+ if (scene->camera)
+ ob = scene->camera;
+ else
+ ob = scene_find_camera(scene);
}
- if(ob)
+ if (ob)
where_is_object_mat(scene, ob, mat);
else
unit_m4(mat);
@@ -2100,53 +2091,54 @@ void BKE_get_tracking_mat(Scene *scene, Object *ob, float mat[4][4])
void BKE_tracking_camera_shift(MovieTracking *tracking, int winx, int winy, float *shiftx, float *shifty)
{
- *shiftx= (0.5f*winx-tracking->camera.principal[0]) / winx;
- *shifty= (0.5f*winy-tracking->camera.principal[1]) / winx;
+ /* indeed in both of cases it should be winx -- it's just how camera shift works for blender's camera */
+ *shiftx = (0.5f * winx-tracking->camera.principal[0]) / winx;
+ *shifty = (0.5f * winy-tracking->camera.principal[1]) / winx;
}
void BKE_tracking_camera_to_blender(MovieTracking *tracking, Scene *scene, Camera *camera, int width, int height)
{
- float focal= tracking->camera.focal;
+ float focal = tracking->camera.focal;
- camera->sensor_x= tracking->camera.sensor_width;
- camera->sensor_fit= CAMERA_SENSOR_FIT_AUTO;
- camera->lens= focal*camera->sensor_x/width;
+ camera->sensor_x = tracking->camera.sensor_width;
+ camera->sensor_fit = CAMERA_SENSOR_FIT_AUTO;
+ camera->lens = focal*camera->sensor_x/width;
- scene->r.xsch= width*tracking->camera.pixel_aspect;
- scene->r.ysch= height;
+ scene->r.xsch = width*tracking->camera.pixel_aspect;
+ scene->r.ysch = height;
- scene->r.xasp= 1.0f;
- scene->r.yasp= 1.0f;
+ scene->r.xasp = 1.0f;
+ scene->r.yasp = 1.0f;
BKE_tracking_camera_shift(tracking, width, height, &camera->shiftx, &camera->shifty);
}
void BKE_tracking_projection_matrix(MovieTracking *tracking, MovieTrackingObject *object,
- int framenr, int winx, int winy, float mat[4][4])
+ int framenr, int winx, int winy, float mat[4][4])
{
MovieReconstructedCamera *camera;
- float lens= tracking->camera.focal*tracking->camera.sensor_width/(float)winx;
+ float lens = tracking->camera.focal*tracking->camera.sensor_width/(float)winx;
float viewfac, pixsize, left, right, bottom, top, clipsta, clipend;
float winmat[4][4];
- float ycor= 1.0f/tracking->camera.pixel_aspect;
- float shiftx, shifty, winside= MAX2(winx, winy);
+ float ycor = 1.0f / tracking->camera.pixel_aspect;
+ float shiftx, shifty, winside = MAX2(winx, winy);
BKE_tracking_camera_shift(tracking, winx, winy, &shiftx, &shifty);
- clipsta= 0.1f;
- clipend= 1000.0f;
+ clipsta = 0.1f;
+ clipend = 1000.0f;
- if(winx >= winy)
- viewfac= (lens*winx)/tracking->camera.sensor_width;
+ if (winx >= winy)
+ viewfac = (lens*winx)/tracking->camera.sensor_width;
else
- viewfac= (ycor*lens*winy)/tracking->camera.sensor_width;
+ viewfac = (ycor*lens*winy)/tracking->camera.sensor_width;
- pixsize= clipsta/viewfac;
+ pixsize = clipsta/viewfac;
- left= -0.5f*(float)winx + shiftx*winside;
- bottom= -0.5f*(ycor)*(float)winy + shifty*winside;
- right= 0.5f*(float)winx + shiftx*winside;
- top= 0.5f*(ycor)*(float)winy + shifty*winside;
+ left = -0.5f * (float)winx + shiftx * winside;
+ bottom = -0.5f * (ycor) * (float)winy + shifty * winside;
+ right = 0.5f * (float)winx + shiftx * winside;
+ top = 0.5f * (ycor) * (float)winy + shifty * winside;
left *= pixsize;
right *= pixsize;
@@ -2155,21 +2147,22 @@ void BKE_tracking_projection_matrix(MovieTracking *tracking, MovieTrackingObject
perspective_m4(winmat, left, right, bottom, top, clipsta, clipend);
- camera= BKE_tracking_get_reconstructed_camera(tracking, object, framenr);
+ camera = BKE_tracking_get_reconstructed_camera(tracking, object, framenr);
- if(camera) {
+ if (camera) {
float imat[4][4];
invert_m4_m4(imat, camera->mat);
mult_m4_m4m4(mat, winmat, imat);
- } else copy_m4_m4(mat, winmat);
+ }
+ else copy_m4_m4(mat, winmat);
}
ListBase *BKE_tracking_get_tracks(MovieTracking *tracking)
{
- MovieTrackingObject *object= BKE_tracking_active_object(tracking);
+ MovieTrackingObject *object = BKE_tracking_active_object(tracking);
- if(object && (object->flag & TRACKING_OBJECT_CAMERA) == 0) {
+ if (object && (object->flag & TRACKING_OBJECT_CAMERA) == 0) {
return &object->tracks;
}
@@ -2180,13 +2173,13 @@ MovieTrackingTrack *BKE_tracking_active_track(MovieTracking *tracking)
{
ListBase *tracksbase;
- if(!tracking->act_track)
+ if (!tracking->act_track)
return NULL;
- tracksbase= BKE_tracking_get_tracks(tracking);
+ tracksbase = BKE_tracking_get_tracks(tracking);
/* check that active track is in current tracks list */
- if(BLI_findindex(tracksbase, tracking->act_track) >= 0)
+ if (BLI_findindex(tracksbase, tracking->act_track) >= 0)
return tracking->act_track;
return NULL;
@@ -2199,10 +2192,10 @@ MovieTrackingObject *BKE_tracking_active_object(MovieTracking *tracking)
MovieTrackingObject *BKE_tracking_get_camera_object(MovieTracking *tracking)
{
- MovieTrackingObject *object= tracking->objects.first;
+ MovieTrackingObject *object = tracking->objects.first;
- while(object) {
- if(object->flag & TRACKING_OBJECT_CAMERA)
+ while (object) {
+ if (object->flag & TRACKING_OBJECT_CAMERA)
return object;
object= object->next;
@@ -2213,7 +2206,7 @@ MovieTrackingObject *BKE_tracking_get_camera_object(MovieTracking *tracking)
ListBase *BKE_tracking_object_tracks(MovieTracking *tracking, MovieTrackingObject *object)
{
- if(object->flag & TRACKING_OBJECT_CAMERA) {
+ if (object->flag & TRACKING_OBJECT_CAMERA) {
return &tracking->tracks;
}
@@ -2222,7 +2215,7 @@ ListBase *BKE_tracking_object_tracks(MovieTracking *tracking, MovieTrackingObjec
MovieTrackingReconstruction *BKE_tracking_object_reconstruction(MovieTracking *tracking, MovieTrackingObject *object)
{
- if(object->flag & TRACKING_OBJECT_CAMERA) {
+ if (object->flag & TRACKING_OBJECT_CAMERA) {
return &tracking->reconstruction;
}
@@ -2231,7 +2224,7 @@ MovieTrackingReconstruction *BKE_tracking_object_reconstruction(MovieTracking *t
MovieTrackingReconstruction *BKE_tracking_get_reconstruction(MovieTracking *tracking)
{
- MovieTrackingObject *object= BKE_tracking_active_object(tracking);
+ MovieTrackingObject *object = BKE_tracking_active_object(tracking);
return BKE_tracking_object_reconstruction(tracking, object);
}
@@ -2242,42 +2235,42 @@ void BKE_tracking_apply_intrinsics(MovieTracking *tracking, float co[2], float n
#ifdef WITH_LIBMV
double x, y;
- float aspy= 1.0f/tracking->camera.pixel_aspect;
+ float aspy = 1.0f/tracking->camera.pixel_aspect;
/* normalize coords */
- x= (co[0]-camera->principal[0]) / camera->focal;
- y= (co[1]-camera->principal[1] * aspy) / camera->focal;
+ x = (co[0] - camera->principal[0]) / camera->focal;
+ y = (co[1] - camera->principal[1] * aspy) / camera->focal;
libmv_applyCameraIntrinsics(camera->focal, camera->principal[0], camera->principal[1] * aspy,
- camera->k1, camera->k2, camera->k3, x, y, &x, &y);
+ camera->k1, camera->k2, camera->k3, x, y, &x, &y);
/* result is in image coords already */
- nco[0]= x;
- nco[1]= y;
+ nco[0] = x;
+ nco[1] = y;
#else
- (void)camera;
- (void)co;
- (void)nco;
+ (void) camera;
+ (void) co;
+ (void) nco;
#endif
}
void BKE_tracking_invert_intrinsics(MovieTracking *tracking, float co[2], float nco[2])
{
- MovieTrackingCamera *camera= &tracking->camera;
+ MovieTrackingCamera *camera = &tracking->camera;
#ifdef WITH_LIBMV
- double x= co[0], y= co[1];
- float aspy= 1.0f/tracking->camera.pixel_aspect;
+ double x = co[0], y = co[1];
+ float aspy = 1.0f / tracking->camera.pixel_aspect;
libmv_InvertIntrinsics(camera->focal, camera->principal[0], camera->principal[1] * aspy,
- camera->k1, camera->k2, camera->k3, x, y, &x, &y);
+ camera->k1, camera->k2, camera->k3, x, y, &x, &y);
- nco[0]= x * camera->focal + camera->principal[0];
- nco[1]= y * camera->focal + camera->principal[1] * aspy;
+ nco[0] = x * camera->focal + camera->principal[0];
+ nco[1] = y * camera->focal + camera->principal[1] * aspy;
#else
- (void)camera;
- (void)co;
- (void)nco;
+ (void) camera;
+ (void) co;
+ (void) nco;
#endif
}
@@ -2285,125 +2278,126 @@ void BKE_tracking_invert_intrinsics(MovieTracking *tracking, float co[2], float
static int point_in_stroke(bGPDstroke *stroke, float x, float y)
{
int i, prev;
- int count= 0;
- bGPDspoint *points= stroke->points;
+ int count = 0;
+ bGPDspoint *points = stroke->points;
- prev= stroke->totpoints-1;
+ prev = stroke->totpoints - 1;
- for(i= 0; i<stroke->totpoints; i++) {
- if((points[i].y<y && points[prev].y>=y) || (points[prev].y<y && points[i].y>=y)) {
- float fac= (y-points[i].y)/(points[prev].y-points[i].y);
+ for (i = 0; i<stroke->totpoints; i++) {
+ if ((points[i].y < y && points[prev].y >= y) || (points[prev].y < y && points[i].y >= y)) {
+ float fac = (y - points[i].y) / (points[prev].y - points[i].y);
- if (points[i].x+fac*(points[prev].x-points[i].x)<x)
+ if (points[i].x + fac * (points[prev].x - points[i].x) < x)
count++;
}
prev= i;
}
- return count%2;
+ return count % 2;
}
static int point_in_layer(bGPDlayer *layer, float x, float y)
{
- bGPDframe *frame= layer->frames.first;
+ bGPDframe *frame = layer->frames.first;
+
+ while (frame) {
+ bGPDstroke *stroke = frame->strokes.first;
- while(frame) {
- bGPDstroke *stroke= frame->strokes.first;
- while(stroke) {
- if(point_in_stroke(stroke, x, y))
- return 1;
+ while (stroke) {
+ if (point_in_stroke(stroke, x, y))
+ return TRUE;
- stroke= stroke->next;
+ stroke = stroke->next;
}
- frame= frame->next;
+ frame = frame->next;
}
- return 0;
+ return FALSE;
}
static void retrieve_libmv_features(MovieTracking *tracking, ListBase *tracksbase,
- struct libmv_Features *features, int framenr, int width, int height,
- bGPDlayer *layer, int place_outside_layer)
+ struct libmv_Features *features, int framenr, int width, int height,
+ bGPDlayer *layer, int place_outside_layer)
{
int a;
- a= libmv_countFeatures(features);
- while(a--) {
+ a = libmv_countFeatures(features);
+ while (a--) {
MovieTrackingTrack *track;
double x, y, size, score;
- int ok= 1;
+ int ok = TRUE;
float xu, yu;
libmv_getFeature(features, a, &x, &y, &score, &size);
- xu= x/width;
- yu= y/height;
+ xu = x / width;
+ yu = y / height;
- if(layer)
- ok= point_in_layer(layer, xu, yu)!=place_outside_layer;
+ if (layer)
+ ok = point_in_layer(layer, xu, yu) != place_outside_layer;
- if(ok) {
- track= BKE_tracking_add_track(tracking, tracksbase, xu, yu, framenr, width, height);
- track->flag|= SELECT;
- track->pat_flag|= SELECT;
- track->search_flag|= SELECT;
+ if (ok) {
+ track = BKE_tracking_add_track(tracking, tracksbase, xu, yu, framenr, width, height);
+ track->flag |= SELECT;
+ track->pat_flag |= SELECT;
+ track->search_flag |= SELECT;
}
}
}
#endif
void BKE_tracking_detect_fast(MovieTracking *tracking, ListBase *tracksbase, ImBuf *ibuf,
- int framenr, int margin, int min_trackness, int min_distance, bGPDlayer *layer,
- int place_outside_layer)
+ int framenr, int margin, int min_trackness, int min_distance, bGPDlayer *layer,
+ int place_outside_layer)
{
#ifdef WITH_LIBMV
struct libmv_Features *features;
- unsigned char *pixels= get_ucharbuf(ibuf);
+ unsigned char *pixels = get_ucharbuf(ibuf);
- features= libmv_detectFeaturesFAST(pixels, ibuf->x, ibuf->y, ibuf->x,
- margin, min_trackness, min_distance);
+ features = libmv_detectFeaturesFAST(pixels, ibuf->x, ibuf->y, ibuf->x,
+ margin, min_trackness, min_distance);
MEM_freeN(pixels);
retrieve_libmv_features(tracking, tracksbase, features, framenr,
- ibuf->x, ibuf->y, layer, place_outside_layer);
+ ibuf->x, ibuf->y, layer, place_outside_layer);
libmv_destroyFeatures(features);
#else
- (void)tracking;
- (void)tracksbase;
- (void)ibuf;
- (void)framenr;
- (void)margin;
- (void)min_trackness;
- (void)min_distance;
- (void)layer;
- (void)place_outside_layer;
+ (void) tracking;
+ (void) tracksbase;
+ (void) ibuf;
+ (void) framenr;
+ (void) margin;
+ (void) min_trackness;
+ (void) min_distance;
+ (void) layer;
+ (void) place_outside_layer;
#endif
}
MovieTrackingTrack *BKE_tracking_indexed_track(MovieTracking *tracking, int tracknr, ListBase **tracksbase_r)
{
MovieTrackingObject *object;
- int cur= 1;
+ int cur = 1;
- object= tracking->objects.first;
- while(object) {
- ListBase *tracksbase= BKE_tracking_object_tracks(tracking, object);
- MovieTrackingTrack *track= tracksbase->first;
+ object = tracking->objects.first;
+ while (object) {
+ ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object);
+ MovieTrackingTrack *track = tracksbase->first;
- while(track) {
- if(track->flag&TRACK_HAS_BUNDLE) {
- if(cur==tracknr) {
- *tracksbase_r= tracksbase;
+ while (track) {
+ if (track->flag & TRACK_HAS_BUNDLE) {
+ if (cur == tracknr) {
+ *tracksbase_r = tracksbase;
return track;
}
cur++;
}
- track= track->next;
+ track = track->next;
}
object= object->next;
@@ -2416,167 +2410,183 @@ MovieTrackingTrack *BKE_tracking_indexed_track(MovieTracking *tracking, int trac
static int stabilization_median_point(MovieTracking *tracking, int framenr, float median[2])
{
- int ok= 0;
+ int ok = FALSE;
float min[2], max[2];
MovieTrackingTrack *track;
INIT_MINMAX2(min, max);
- (void) tracking;
-
- track= tracking->tracks.first;
- while(track) {
- if(track->flag&TRACK_USE_2D_STAB) {
- MovieTrackingMarker *marker= BKE_tracking_get_marker(track, framenr);
+ track = tracking->tracks.first;
+ while (track) {
+ if (track->flag & TRACK_USE_2D_STAB) {
+ MovieTrackingMarker *marker = BKE_tracking_get_marker(track, framenr);
DO_MINMAX2(marker->pos, min, max);
- ok= 1;
+ ok = TRUE;
}
- track= track->next;
+ track = track->next;
}
- median[0]= (max[0]+min[0])/2.0f;
- median[1]= (max[1]+min[1])/2.0f;
+ median[0] = (max[0] + min[0]) / 2.0f;
+ median[1] = (max[1] + min[1]) / 2.0f;
return ok;
}
static void calculate_stabdata(MovieTracking *tracking, int framenr, float width, float height,
- float firstmedian[2], float median[2], float loc[2], float *scale, float *angle)
+ float firstmedian[2], float median[2], float loc[2], float *scale, float *angle)
{
- MovieTrackingStabilization *stab= &tracking->stabilization;
+ MovieTrackingStabilization *stab = &tracking->stabilization;
- *scale= (stab->scale-1.0f)*stab->scaleinf+1.0f;
- *angle= 0.0f;
+ *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);
- if((stab->flag&TRACKING_STABILIZE_ROTATION) && stab->rot_track && stab->rotinf) {
+ if ((stab->flag & TRACKING_STABILIZE_ROTATION) && stab->rot_track && stab->rotinf) {
MovieTrackingMarker *marker;
float a[2], b[2];
- float x0= (float)width/2.0f, y0= (float)height/2.0f;
- float x= median[0]*width, y= median[1]*height;
+ float x0 = (float)width / 2.0f, y0 = (float)height / 2.0f;
+ float x = median[0] * width, y = median[1] * height;
- marker= BKE_tracking_get_marker(stab->rot_track, 1);
+ marker = BKE_tracking_get_marker(stab->rot_track, 1);
sub_v2_v2v2(a, marker->pos, firstmedian);
- a[0]*= width;
- a[1]*= height;
+ a[0] *= width;
+ a[1] *= height;
- marker= BKE_tracking_get_marker(stab->rot_track, framenr);
+ marker = BKE_tracking_get_marker(stab->rot_track, framenr);
sub_v2_v2v2(b, marker->pos, median);
- b[0]*= width;
- b[1]*= height;
+ b[0] *= width;
+ b[1] *= height;
- *angle= -atan2(a[0]*b[1]-a[1]*b[0], a[0]*b[0]+a[1]*b[1]);
- *angle*= stab->rotinf;
+ *angle = -atan2(a[0]*b[1]-a[1]*b[0], a[0]*b[0]+a[1]*b[1]);
+ *angle *= stab->rotinf;
/* convert to rotation around image center */
- loc[0]-= (x0 + (x-x0)*cosf(*angle)-(y-y0)*sinf(*angle) - x)*(*scale);
- loc[1]-= (y0 + (x-x0)*sinf(*angle)+(y-y0)*cosf(*angle) - y)*(*scale);
+ loc[0] -= (x0 + (x - x0) * cosf(*angle) - (y - y0) * sinf(*angle) - x) * (*scale);
+ loc[1] -= (y0 + (x - x0) * sinf(*angle) + (y - y0) * cosf(*angle) - y) * (*scale);
}
}
static float stabilization_auto_scale_factor(MovieTracking *tracking, int width, int height)
{
float firstmedian[2];
- MovieTrackingStabilization *stab= &tracking->stabilization;
- float aspect= tracking->camera.pixel_aspect;
+ MovieTrackingStabilization *stab = &tracking->stabilization;
+ float aspect = tracking->camera.pixel_aspect;
- if(stab->ok)
+ if (stab->ok)
return stab->scale;
- 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;
+ if (stabilization_median_point(tracking, 1, firstmedian)) {
+ int sfra = INT_MAX, efra = INT_MIN, cfra;
+ float scale = 1.0f;
MovieTrackingTrack *track;
- stab->scale= 1.0f;
+ stab->scale = 1.0f;
- track= tracking->tracks.first;
- while(track) {
- if(track->flag&TRACK_USE_2D_STAB ||
- ((stab->flag&TRACKING_STABILIZE_ROTATION) && track==stab->rot_track)) {
- sfra= MIN2(sfra, track->markers[0].framenr);
- efra= MAX2(efra, track->markers[track->markersnr-1].framenr);
+ track = tracking->tracks.first;
+ while (track) {
+ if (track->flag & TRACK_USE_2D_STAB ||
+ ((stab->flag & TRACKING_STABILIZE_ROTATION) && track == stab->rot_track))
+ {
+ sfra = MIN2(sfra, track->markers[0].framenr);
+ efra = MAX2(efra, track->markers[track->markersnr - 1].framenr);
}
- track= track->next;
+ track = track->next;
}
- for(cfra=sfra; cfra<=efra; cfra++) {
- float median[2], near[2];
- float loc[2], scale, angle;
+ for (cfra = sfra; cfra <= efra; cfra++) {
+ 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]);
- BKE_tracking_stabdata_to_mat4(width, height, aspect, loc, scale, angle, mat);
+ mul_m4_v3(mat, a);
+ mul_m4_v3(mat, b);
- 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};
+ for (j = 0; j < 4; j++) {
+ float point[3] = {points[j][0], points[j][1], 0.0f};
+ float v1[3], v2[3];
- copy_v3_v3(a, points[i]);
- copy_v3_v3(b, points[(i+1)%4]);
+ sub_v3_v3v3(v1, b, a);
+ sub_v3_v3v3(v2, point, a);
- mul_m4_v3(mat, a);
- mul_m4_v3(mat, b);
+ 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}};
- for(j= 0; j<4; j++) {
- float point[3]= {points[j][0], points[j][1], 0.0f};
- float v1[3], v2[3];
+ float dx = loc[0] * rotDx[j][0] + loc[1] * rotDx[j][1],
+ dy = loc[0] * rotDy[j][0] + loc[1] * rotDy[j][1];
- sub_v3_v3v3(v1, b, a);
- sub_v3_v3v3(v2, point, a);
+ float w, h, E, F, G, H, I, J, K, S;
- 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 (j % 2) {
+ w = (float)height / 2.0f;
+ h = (float)width / 2.0f;
}
+ else {
+ w = (float)width / 2.0f;
+ h = (float)height / 2.0f;
+ }
+
+ E = -w*co + h*si;
+ F = -h*co - w*si;
+
+ 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);
- } else {
- stab->scale= 1.0f;
+ if (stab->maxscale>0.0f)
+ stab->scale = MIN2(stab->scale, stab->maxscale);
+ }
+ else {
+ stab->scale = 1.0f;
}
- stab->ok= 1;
+ stab->ok = TRUE;
return stab->scale;
}
@@ -2585,25 +2595,26 @@ static ImBuf* stabilize_alloc_ibuf(ImBuf *cacheibuf, ImBuf *srcibuf, int fill)
{
int flags;
- if(cacheibuf && (cacheibuf->x != srcibuf->x || cacheibuf->y != srcibuf->y)) {
+ if (cacheibuf && (cacheibuf->x != srcibuf->x || cacheibuf->y != srcibuf->y)) {
IMB_freeImBuf(cacheibuf);
- cacheibuf= NULL;
+ cacheibuf = NULL;
}
- flags= IB_rect;
+ flags = IB_rect;
- if(srcibuf->rect_float)
- flags|= IB_rectfloat;
+ if (srcibuf->rect_float)
+ flags |= IB_rectfloat;
+
+ if (cacheibuf) {
+ if (fill) {
+ float col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
- if(cacheibuf) {
- if(fill) {
- float col[4]= {0.0f, 0.0f, 0.0f, 0.0f};
IMB_rectfill(cacheibuf, col);
}
}
else {
- cacheibuf= IMB_allocImBuf(srcibuf->x, srcibuf->y, srcibuf->planes, flags);
- cacheibuf->profile= srcibuf->profile;
+ cacheibuf = IMB_allocImBuf(srcibuf->x, srcibuf->y, srcibuf->planes, flags);
+ cacheibuf->profile = srcibuf->profile;
}
return cacheibuf;
@@ -2612,9 +2623,9 @@ static ImBuf* stabilize_alloc_ibuf(ImBuf *cacheibuf, ImBuf *srcibuf, int fill)
void BKE_tracking_stabilization_data(MovieTracking *tracking, int framenr, int width, int height, float loc[2], float *scale, float *angle)
{
float firstmedian[2], median[2];
- MovieTrackingStabilization *stab= &tracking->stabilization;
+ MovieTrackingStabilization *stab = &tracking->stabilization;
- if((stab->flag&TRACKING_2D_STABILIZATION)==0) {
+ if ((stab->flag & TRACKING_2D_STABILIZATION) == 0) {
zero_v2(loc);
*scale= 1.0f;
*angle= 0.0f;
@@ -2622,88 +2633,103 @@ void BKE_tracking_stabilization_data(MovieTracking *tracking, int framenr, int w
return;
}
- if(stabilization_median_point(tracking, 1, firstmedian)) {
+ if (stabilization_median_point(tracking, 1, firstmedian)) {
stabilization_median_point(tracking, framenr, median);
- if((stab->flag&TRACKING_AUTOSCALE)==0)
- stab->scale= 1.0f;
+ if ((stab->flag & TRACKING_AUTOSCALE) == 0)
+ stab->scale = 1.0f;
- if(!stab->ok) {
- if(stab->flag&TRACKING_AUTOSCALE)
+ if (!stab->ok) {
+ if (stab->flag & TRACKING_AUTOSCALE)
stabilization_auto_scale_factor(tracking, width, height);
calculate_stabdata(tracking, framenr, width, height, firstmedian, median, loc, scale, angle);
- stab->ok= 1;
- } else {
+ stab->ok = TRUE;
+ }
+ else {
calculate_stabdata(tracking, framenr, width, height, firstmedian, median, loc, scale, angle);
}
- } else {
+ }
+ else {
zero_v2(loc);
- *scale= 1.0f;
- *angle= 0.0f;
+ *scale = 1.0f;
+ *angle = 0.0f;
}
}
ImBuf *BKE_tracking_stabilize(MovieTracking *tracking, int framenr, ImBuf *ibuf, float loc[2], float *scale, float *angle)
{
float tloc[2], tscale, tangle;
- MovieTrackingStabilization *stab= &tracking->stabilization;
+ MovieTrackingStabilization *stab = &tracking->stabilization;
ImBuf *tmpibuf;
- float width= ibuf->x, height= ibuf->y;
- float aspect= tracking->camera.pixel_aspect;
+ float width = ibuf->x, height = ibuf->y;
+ float aspect = tracking->camera.pixel_aspect;
+
+ if (loc)
+ copy_v2_v2(tloc, loc);
- if(loc) copy_v2_v2(tloc, loc);
- if(scale) tscale= *scale;
+ if (scale)
+ tscale = *scale;
- if((stab->flag&TRACKING_2D_STABILIZATION)==0) {
- if(loc) zero_v2(loc);
- if(scale) *scale= 1.0f;
+ if ((stab->flag & TRACKING_2D_STABILIZATION) == 0) {
+ if (loc)
+ zero_v2(loc);
+
+ if (scale)
+ *scale = 1.0f;
return ibuf;
}
BKE_tracking_stabilization_data(tracking, framenr, width, height, tloc, &tscale, &tangle);
- tmpibuf= stabilize_alloc_ibuf(NULL, ibuf, 1);
+ tmpibuf = stabilize_alloc_ibuf(NULL, ibuf, TRUE);
/* scale would be handled by matrix transformation when angle is non-zero */
- if(tscale!=1.0f && tangle==0.0f) {
+ if (tscale != 1.0f && tangle == 0.0f) {
ImBuf *scaleibuf;
stabilization_auto_scale_factor(tracking, width, height);
- scaleibuf= stabilize_alloc_ibuf(stab->scaleibuf, ibuf, 0);
- stab->scaleibuf= scaleibuf;
+ scaleibuf = stabilize_alloc_ibuf(stab->scaleibuf, ibuf, 0);
+ stab->scaleibuf = scaleibuf;
IMB_rectcpy(scaleibuf, ibuf, 0, 0, 0, 0, ibuf->x, ibuf->y);
IMB_scalefastImBuf(scaleibuf, ibuf->x*tscale, ibuf->y*tscale);
- ibuf= scaleibuf;
+ ibuf = scaleibuf;
}
- if(tangle==0.0f) {
+ if (tangle == 0.0f) {
/* if angle is zero, then it's much faster to use rect copy
- 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 {
+ * 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];
- int i, j, filter= tracking->stabilization.filter;
+ int i, j, filter = tracking->stabilization.filter;
void (*interpolation) (struct ImBuf*, struct ImBuf*, float, float, int, int) = NULL;
BKE_tracking_stabdata_to_mat4(ibuf->x, ibuf->y, aspect, tloc, tscale, tangle, mat);
invert_m4(mat);
- if(filter == TRACKING_FILTER_NEAREAST)
+ if (filter == TRACKING_FILTER_NEAREAST)
interpolation = neareast_interpolation;
- else if(filter == TRACKING_FILTER_BILINEAR)
+ else if (filter == TRACKING_FILTER_BILINEAR)
interpolation = bilinear_interpolation;
- else if(filter == TRACKING_FILTER_BICUBIC)
+ else if (filter == TRACKING_FILTER_BICUBIC)
interpolation = bicubic_interpolation;
+ else
+ /* fallback to default interpolation method */
+ interpolation = neareast_interpolation;
- for(j=0; j<tmpibuf->y; j++) {
- for(i=0; i<tmpibuf->x;i++) {
- float vec[3]= {i, j, 0};
+ for (j = 0; j < tmpibuf->y; j++) {
+ for (i = 0; i < tmpibuf->x;i++) {
+ float vec[3] = {i, j, 0};
mul_v3_m4v3(vec, mat, vec);
@@ -2712,14 +2738,19 @@ ImBuf *BKE_tracking_stabilize(MovieTracking *tracking, int framenr, ImBuf *ibuf,
}
}
- tmpibuf->userflags|= IB_MIPMAP_INVALID;
+ tmpibuf->userflags |= IB_MIPMAP_INVALID;
+
+ if (tmpibuf->rect_float)
+ tmpibuf->userflags |= IB_RECT_INVALID;
+
+ if (loc)
+ copy_v2_v2(loc, tloc);
- if(tmpibuf->rect_float)
- tmpibuf->userflags|= IB_RECT_INVALID;
+ if (scale)
+ *scale= tscale;
- if(loc) copy_v2_v2(loc, tloc);
- if(scale) *scale= tscale;
- if(angle) *angle= tangle;
+ if (angle)
+ *angle= tangle;
return tmpibuf;
}
@@ -2740,8 +2771,8 @@ void BKE_tracking_stabdata_to_mat4(int width, int height, float aspect, float lo
invert_m4_m4(iamat, amat);
/* image center as rotation center */
- cmat[3][0]= (float)width/2.0f;
- cmat[3][1]= (float)height/2.0f;
+ cmat[3][0] = (float)width / 2.0f;
+ cmat[3][1] = (float)height / 2.0f;
invert_m4_m4(icmat, cmat);
size_to_mat4(smat, svec); /* scale matrix */
@@ -2749,14 +2780,14 @@ 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)
{
MovieDistortion *distortion;
- distortion= MEM_callocN(sizeof(MovieDistortion), "BKE_tracking_distortion_create");
+ distortion = MEM_callocN(sizeof(MovieDistortion), "BKE_tracking_distortion_create");
return distortion;
}
@@ -2765,12 +2796,12 @@ MovieDistortion *BKE_tracking_distortion_copy(MovieDistortion *distortion)
{
MovieDistortion *new_distortion;
- new_distortion= MEM_callocN(sizeof(MovieDistortion), "BKE_tracking_distortion_create");
+ new_distortion = MEM_callocN(sizeof(MovieDistortion), "BKE_tracking_distortion_create");
#ifdef WITH_LIBMV
- new_distortion->intrinsics= libmv_CameraIntrinsicsCopy(distortion->intrinsics);
+ new_distortion->intrinsics = libmv_CameraIntrinsicsCopy(distortion->intrinsics);
#else
- (void)distortion;
+ (void) distortion;
#endif
return new_distortion;
@@ -2778,58 +2809,62 @@ MovieDistortion *BKE_tracking_distortion_copy(MovieDistortion *distortion)
void BKE_tracking_distortion_update(MovieDistortion *distortion, MovieTracking *tracking, int width, int height)
{
- MovieTrackingCamera *camera= &tracking->camera;
- float aspy= 1.0f/tracking->camera.pixel_aspect;
+ MovieTrackingCamera *camera = &tracking->camera;
+ float aspy = 1.0f / tracking->camera.pixel_aspect;
#ifdef WITH_LIBMV
- if(!distortion->intrinsics) {
- distortion->intrinsics= libmv_CameraIntrinsicsNew(camera->focal,
+ if (!distortion->intrinsics) {
+ distortion->intrinsics = libmv_CameraIntrinsicsNew(camera->focal,
camera->principal[0], camera->principal[1] * aspy,
camera->k1, camera->k2, camera->k3, width, height * aspy);
- } else {
+ }
+ else {
libmv_CameraIntrinsicsUpdate(distortion->intrinsics, camera->focal,
camera->principal[0], camera->principal[1] * aspy,
camera->k1, camera->k2, camera->k3, width, height * aspy);
}
#else
- (void)distortion;
- (void)width;
- (void)height;
- (void)camera;
- (void)aspy;
+ (void) distortion;
+ (void) width;
+ (void) height;
+ (void) camera;
+ (void) aspy;
#endif
}
ImBuf *BKE_tracking_distortion_exec(MovieDistortion *distortion, MovieTracking *tracking,
- ImBuf *ibuf, int width, int height, float overscan, int undistort)
+ ImBuf *ibuf, int width, int height, float overscan, int undistort)
{
ImBuf *resibuf;
BKE_tracking_distortion_update(distortion, tracking, width, height);
- resibuf= IMB_dupImBuf(ibuf);
+ resibuf = IMB_dupImBuf(ibuf);
- if(ibuf->rect_float) {
+ if (ibuf->rect_float) {
#ifdef WITH_LIBMV
- if(undistort) {
+ if (undistort) {
libmv_CameraIntrinsicsUndistortFloat(distortion->intrinsics,
ibuf->rect_float, resibuf->rect_float,
ibuf->x, ibuf->y, overscan, ibuf->channels);
- } else {
+ }
+ else {
libmv_CameraIntrinsicsDistortFloat(distortion->intrinsics,
ibuf->rect_float, resibuf->rect_float,
ibuf->x, ibuf->y, overscan, ibuf->channels);
}
#endif
- ibuf->userflags|= IB_RECT_INVALID;
- } else {
+ ibuf->userflags |= IB_RECT_INVALID;
+ }
+ else {
#ifdef WITH_LIBMV
- if(undistort) {
+ if (undistort) {
libmv_CameraIntrinsicsUndistortByte(distortion->intrinsics,
(unsigned char*)ibuf->rect, (unsigned char*)resibuf->rect,
ibuf->x, ibuf->y, overscan, ibuf->channels);
- } else {
+ }
+ else {
libmv_CameraIntrinsicsDistortByte(distortion->intrinsics,
(unsigned char*)ibuf->rect, (unsigned char*)resibuf->rect,
ibuf->x, ibuf->y, overscan, ibuf->channels);
@@ -2838,8 +2873,8 @@ ImBuf *BKE_tracking_distortion_exec(MovieDistortion *distortion, MovieTracking *
}
#ifndef WITH_LIBMV
- (void)overscan;
- (void)undistort;
+ (void) overscan;
+ (void) undistort;
#endif
return resibuf;
@@ -2856,20 +2891,20 @@ void BKE_tracking_distortion_destroy(MovieDistortion *distortion)
ImBuf *BKE_tracking_undistort(MovieTracking *tracking, ImBuf *ibuf, int width, int height, float overscan)
{
- MovieTrackingCamera *camera= &tracking->camera;
+ MovieTrackingCamera *camera = &tracking->camera;
- if(camera->intrinsics == NULL)
- camera->intrinsics= BKE_tracking_distortion_create();
+ if (camera->intrinsics == NULL)
+ camera->intrinsics = BKE_tracking_distortion_create();
return BKE_tracking_distortion_exec(camera->intrinsics, tracking, ibuf, width, height, overscan, 1);
}
ImBuf *BKE_tracking_distort(MovieTracking *tracking, ImBuf *ibuf, int width, int height, float overscan)
{
- MovieTrackingCamera *camera= &tracking->camera;
+ MovieTrackingCamera *camera = &tracking->camera;
- if(camera->intrinsics == NULL)
- camera->intrinsics= BKE_tracking_distortion_create();
+ if (camera->intrinsics == NULL)
+ camera->intrinsics = BKE_tracking_distortion_create();
return BKE_tracking_distortion_exec(camera->intrinsics, tracking, ibuf, width, height, overscan, 0);
}
@@ -2877,14 +2912,15 @@ ImBuf *BKE_tracking_distort(MovieTracking *tracking, ImBuf *ibuf, int width, int
/* area - which part of marker should be selected. see TRACK_AREA_* constants */
void BKE_tracking_select_track(ListBase *tracksbase, MovieTrackingTrack *track, int area, int extend)
{
- if(extend) {
+ if (extend) {
BKE_tracking_track_flag(track, area, SELECT, 0);
- } else {
- MovieTrackingTrack *cur= tracksbase->first;
+ }
+ else {
+ MovieTrackingTrack *cur = tracksbase->first;
- while(cur) {
+ while (cur) {
if ((cur->flag & TRACK_HIDDEN) == 0) {
- if(cur==track) {
+ if (cur == track) {
BKE_tracking_track_flag(cur, TRACK_AREA_ALL, SELECT, 1);
BKE_tracking_track_flag(cur, area, SELECT, 0);
}
@@ -2893,7 +2929,7 @@ void BKE_tracking_select_track(ListBase *tracksbase, MovieTrackingTrack *track,
}
}
- cur= cur->next;
+ cur = cur->next;
}
}
}
@@ -2905,13 +2941,13 @@ void BKE_tracking_deselect_track(MovieTrackingTrack *track, int area)
MovieTrackingObject *BKE_tracking_new_object(MovieTracking *tracking, const char *name)
{
- MovieTrackingObject *object= MEM_callocN(sizeof(MovieTrackingObject), "tracking object");
+ MovieTrackingObject *object = MEM_callocN(sizeof(MovieTrackingObject), "tracking object");
- if(tracking->tot_object==0) {
+ if (tracking->tot_object == 0) {
/* first object is always camera */
BLI_strncpy(object->name, "Camera", sizeof(object->name));
- object->flag|= TRACKING_OBJECT_CAMERA;
+ object->flag |= TRACKING_OBJECT_CAMERA;
}
else {
BLI_strncpy(object->name, name, sizeof(object->name));
@@ -2920,7 +2956,9 @@ MovieTrackingObject *BKE_tracking_new_object(MovieTracking *tracking, const char
BLI_addtail(&tracking->objects, object);
tracking->tot_object++;
- tracking->objectnr= BLI_countlist(&tracking->objects) - 1;
+ tracking->objectnr = BLI_countlist(&tracking->objects) - 1;
+
+ object->scale = 1.0f;
BKE_tracking_object_unique_name(tracking, object);
@@ -2930,20 +2968,20 @@ MovieTrackingObject *BKE_tracking_new_object(MovieTracking *tracking, const char
void BKE_tracking_remove_object(MovieTracking *tracking, MovieTrackingObject *object)
{
MovieTrackingTrack *track;
- int index= BLI_findindex(&tracking->objects, object);
+ int index = BLI_findindex(&tracking->objects, object);
- if(index<0)
+ if (index<0)
return;
- if(object->flag & TRACKING_OBJECT_CAMERA) {
+ if (object->flag & TRACKING_OBJECT_CAMERA) {
/* object used for camera solving can't be deleted */
return;
}
- track= object->tracks.first;
- while(track) {
- if(track==tracking->act_track)
- tracking->act_track= NULL;
+ track = object->tracks.first;
+ while (track) {
+ if (track == tracking->act_track)
+ tracking->act_track = NULL;
track= track->next;
}
@@ -2953,10 +2991,10 @@ void BKE_tracking_remove_object(MovieTracking *tracking, MovieTrackingObject *ob
tracking->tot_object--;
- if(index>0)
- tracking->objectnr= index-1;
+ if (index>0)
+ tracking->objectnr = index - 1;
else
- tracking->objectnr= 0;
+ tracking->objectnr = 0;
}
void BKE_tracking_object_unique_name(MovieTracking *tracking, MovieTrackingObject *object)
@@ -2966,13 +3004,13 @@ void BKE_tracking_object_unique_name(MovieTracking *tracking, MovieTrackingObjec
MovieTrackingObject *BKE_tracking_named_object(MovieTracking *tracking, const char *name)
{
- MovieTrackingObject *object= tracking->objects.first;
+ MovieTrackingObject *object = tracking->objects.first;
- while(object) {
- if(!strcmp(object->name, name))
+ while (object) {
+ if (!strcmp(object->name, name))
return object;
- object= object->next;
+ object = object->next;
}
return NULL;
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..07a83da3d8c 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -56,17 +56,17 @@ void free_world(World *wrld)
MTex *mtex;
int a;
- for(a=0; a<MAX_MTEX; a++) {
+ for (a=0; a<MAX_MTEX; a++) {
mtex= wrld->mtex[a];
- if(mtex && mtex->tex) mtex->tex->id.us--;
- if(mtex) MEM_freeN(mtex);
+ if (mtex && mtex->tex) mtex->tex->id.us--;
+ if (mtex) MEM_freeN(mtex);
}
BKE_previewimg_free(&wrld->preview);
BKE_free_animdata((ID *)wrld);
/* is no lib link block, but world extension */
- if(wrld->nodetree) {
+ if (wrld->nodetree) {
ntreeFreeTree(wrld->nodetree);
MEM_freeN(wrld->nodetree);
}
@@ -120,18 +120,18 @@ World *copy_world(World *wrld)
wrldn= copy_libblock(&wrld->id);
- for(a=0; a<MAX_MTEX; a++) {
- if(wrld->mtex[a]) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (wrld->mtex[a]) {
wrldn->mtex[a]= MEM_mallocN(sizeof(MTex), "copy_world");
memcpy(wrldn->mtex[a], wrld->mtex[a], sizeof(MTex));
id_us_plus((ID *)wrldn->mtex[a]->tex);
}
}
- if(wrld->nodetree)
+ if (wrld->nodetree)
wrldn->nodetree= ntreeCopyTree(wrld->nodetree);
- if(wrld->preview)
+ if (wrld->preview)
wrldn->preview = BKE_previewimg_copy(wrld->preview);
return wrldn;
@@ -145,8 +145,8 @@ World *localize_world(World *wrld)
wrldn= copy_libblock(&wrld->id);
BLI_remlink(&G.main->world, wrldn);
- for(a=0; a<MAX_MTEX; a++) {
- if(wrld->mtex[a]) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (wrld->mtex[a]) {
wrldn->mtex[a]= MEM_mallocN(sizeof(MTex), "localize_world");
memcpy(wrldn->mtex[a], wrld->mtex[a], sizeof(MTex));
/* free world decrements */
@@ -154,7 +154,7 @@ World *localize_world(World *wrld)
}
}
- if(wrld->nodetree)
+ if (wrld->nodetree)
wrldn->nodetree= ntreeLocalize(wrld->nodetree);
wrldn->preview= NULL;
@@ -169,36 +169,36 @@ 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) {
+ if (wrld->id.lib==NULL) return;
+ if (wrld->id.us==1) {
id_clear_lib_data(bmain, &wrld->id);
return;
}
- for(sce= bmain->scene.first; sce && ELEM(FALSE, is_lib, is_local); sce= sce->id.next) {
- if(sce->world == wrld) {
- if(sce->id.lib) is_lib= TRUE;
+ for (sce= bmain->scene.first; sce && ELEM(FALSE, is_lib, is_local); sce= sce->id.next) {
+ if (sce->world == wrld) {
+ if (sce->id.lib) is_lib= TRUE;
else is_local= TRUE;
}
}
- if(is_local && is_lib==FALSE) {
+ if (is_local && is_lib==FALSE) {
id_clear_lib_data(bmain, &wrld->id);
}
- else if(is_local && is_lib) {
+ else if (is_local && is_lib) {
World *wrld_new= copy_world(wrld);
wrld_new->id.us= 0;
/* Remap paths of new ID using old library as base. */
BKE_id_lib_local_paths(bmain, wrld->id.lib, &wrld_new->id);
- for(sce= bmain->scene.first; sce; sce= sce->id.next) {
- if(sce->world == wrld) {
- if(sce->id.lib==NULL) {
+ for (sce= bmain->scene.first; sce; sce= sce->id.next) {
+ if (sce->world == wrld) {
+ if (sce->id.lib==NULL) {
sce->world= wrld_new;
wrld_new->id.us++;
wrld->id.us--;
diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c
index dbb37ad9c1d..ba8a46256c5 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;
@@ -201,7 +201,7 @@ static int append_avi(RenderData *UNUSED(rd), int start_frame, int frame, int *p
memcpy (rt1, rt2, rectx*sizeof(int));
cp= (char *)rt1;
- for(x= rectx; x>0; x--) {
+ for (x= rectx; x>0; x--) {
rt= cp[0];
cp[0]= cp[3];
cp[3]= rt;
@@ -231,7 +231,7 @@ static void end_avi(void)
void BKE_makeanimstring(char *string, RenderData *rd)
{
bMovieHandle *mh= BKE_get_movie_handle(rd->im_format.imtype);
- if(mh->get_movie_path)
+ if (mh->get_movie_path)
mh->get_movie_path(string, rd);
else
string[0]= '\0';
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 9d68e1d899c..740deb5c7db 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -123,7 +123,7 @@ static int write_audio_frame(void)
audio_outbuf_size,
(short*) audio_input_buffer);
- if(pkt.size < 0)
+ if (pkt.size < 0)
{
// XXX error("Error writing audio packet");
return -1;
@@ -131,7 +131,7 @@ static int write_audio_frame(void)
pkt.data = audio_output_buffer;
- if(c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE)
+ if (c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE)
{
pkt.pts = av_rescale_q(c->coded_frame->pts,
c->time_base, audio_stream->time_base);
@@ -262,7 +262,8 @@ static int write_video_frame(RenderData *rd, int cfra, AVFrame* frame, ReportLis
c->time_base,
video_stream->time_base);
fprintf(stderr, "Video Frame PTS: %d\n", (int)packet.pts);
- } else {
+ }
+ else {
fprintf(stderr, "Video Frame PTS: not set\n");
}
if (c->coded_frame->key_frame)
@@ -272,7 +273,8 @@ static int write_video_frame(RenderData *rd, int cfra, AVFrame* frame, ReportLis
packet.size = outsize;
ret = av_interleaved_write_frame(outfile, &packet);
success = (ret == 0);
- } else if (outsize < 0) {
+ }
+ else if (outsize < 0) {
success = 0;
}
@@ -298,7 +300,8 @@ static AVFrame* generate_video_frame(uint8_t* pixels, ReportList *reports)
BKE_report(reports, RPT_ERROR, "Couldn't allocate temporary frame.");
return NULL;
}
- } else {
+ }
+ else {
rgb_frame = current_frame;
}
@@ -324,7 +327,8 @@ static AVFrame* generate_video_frame(uint8_t* pixels, ReportList *reports)
src += 4;
}
}
- } else {
+ }
+ else {
int y;
for (y = 0; y < height; y++) {
uint8_t* target = rgb_frame->data[0]
@@ -383,10 +387,12 @@ static void set_ffmpeg_property_option(AVCodecContext* c, IDProperty * prop)
if (param) {
if (IDP_Int(prop)) {
av_set_string3(c, name, param, 1, &rv);
- } else {
+ }
+ else {
return;
}
- } else {
+ }
+ else {
rv = av_set_int(c, prop->name, IDP_Int(prop));
}
break;
@@ -402,8 +408,8 @@ static int ffmpeg_proprty_valid(AVCodecContext *c, const char *prop_name, IDProp
{
int valid= 1;
- if(strcmp(prop_name, "video")==0) {
- if(strcmp(curr->name, "bf")==0) {
+ if (strcmp(prop_name, "video")==0) {
+ if (strcmp(curr->name, "bf")==0) {
/* flash codec doesn't support b frames */
valid&= c->codec_id!=CODEC_ID_FLV1;
}
@@ -430,7 +436,7 @@ static void set_ffmpeg_properties(RenderData *rd, AVCodecContext *c, const char
iter = IDP_GetGroupIterator(prop);
while ((curr = IDP_GroupIterNext(iter)) != NULL) {
- if(ffmpeg_proprty_valid(c, prop_name, curr))
+ if (ffmpeg_proprty_valid(c, prop_name, curr))
set_ffmpeg_property_option(c, curr);
}
}
@@ -462,11 +468,13 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
if (ffmpeg_type == FFMPEG_DV && rd->frs_sec != 25) {
c->time_base.den = 2997;
c->time_base.num = 100;
- } else if ((double) ((int) rd->frs_sec_base) ==
+ }
+ else if ((double) ((int) rd->frs_sec_base) ==
rd->frs_sec_base) {
c->time_base.den = rd->frs_sec;
c->time_base.num = (int) rd->frs_sec_base;
- } else {
+ }
+ else {
c->time_base.den = rd->frs_sec * 100000;
c->time_base.num = ((double) rd->frs_sec_base) * 100000;
}
@@ -488,7 +496,8 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
if (codec->pix_fmts) {
c->pix_fmt = codec->pix_fmts[0];
- } else {
+ }
+ else {
/* makes HuffYUV happy ... */
c->pix_fmt = PIX_FMT_YUV422P;
}
@@ -625,12 +634,11 @@ static AVStream* alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex
audio_outbuf_size = FF_MIN_BUFFER_SIZE;
- if((c->codec_id >= CODEC_ID_PCM_S16LE) && (c->codec_id <= CODEC_ID_PCM_DVD))
+ 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)
+ 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;
}
@@ -697,7 +705,8 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report
of->packet_size= rd->ffcodecdata.mux_packet_size;
if (ffmpeg_audio_codec != CODEC_ID_NONE) {
of->mux_rate = rd->ffcodecdata.mux_rate;
- } else {
+ }
+ else {
of->mux_rate = 0;
}
@@ -847,7 +856,8 @@ void flush_ffmpeg(void)
c->time_base,
video_stream->time_base);
fprintf(stderr, "Video Frame PTS: %d\n", (int)packet.pts);
- } else {
+ }
+ else {
fprintf(stderr, "Video Frame PTS: not set\n");
}
if (c->coded_frame->key_frame) {
@@ -903,7 +913,8 @@ void filepath_ffmpeg(char* string, RenderData* rd)
BLI_path_frame_range(string, rd->sfra, rd->efra, 4);
strcat(string, *exts);
- } else {
+ }
+ else {
*(string + strlen(string) - strlen(*fe)) = 0;
strcat(string, autosplit);
strcat(string, *fe);
@@ -918,7 +929,7 @@ int start_ffmpeg(struct Scene *scene, RenderData *rd, int rectx, int recty, Repo
success = start_ffmpeg_impl(rd, rectx, recty, reports);
#ifdef WITH_AUDASPACE
- if(audio_stream)
+ if (audio_stream)
{
AVCodecContext* c = audio_stream->codec;
AUD_DeviceSpecs specs;
@@ -943,7 +954,7 @@ static void write_audio_frames(double to_pts)
int finished = 0;
while (audio_stream && !finished) {
- if((audio_time >= to_pts) ||
+ if ((audio_time >= to_pts) ||
(write_audio_frame())) {
finished = 1;
}
@@ -963,7 +974,7 @@ int append_ffmpeg(RenderData *rd, int start_frame, int frame, int *pixels, int r
// why is this done before writing the video frame and again at end_ffmpeg?
// write_audio_frames(frame / (((double)rd->frs_sec) / rd->frs_sec_base));
- if(video_stream)
+ if (video_stream)
{
avframe= generate_video_frame((unsigned char*) pixels, reports);
success= (avframe && write_video_frame(rd, frame - start_frame, avframe, reports));
@@ -994,8 +1005,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;
}
@@ -1111,7 +1121,8 @@ IDProperty *ffmpeg_property_add(RenderData *rd, const char *type, int opt_index,
if (parent_index) {
BLI_snprintf(name, sizeof(name), "%s:%s", parent->name, o->name);
- } else {
+ }
+ else {
BLI_strncpy(name, o->name, sizeof(name));
}
@@ -1160,8 +1171,8 @@ static const AVOption *my_av_find_opt(void *v, const char *name,
AVClass *c= *(AVClass**)v;
const AVOption *o= c->option;
- for(;o && o->name; o++) {
- if(!strcmp(o->name, name) &&
+ for (;o && o->name; o++) {
+ if (!strcmp(o->name, name) &&
(!unit || (o->unit && !strcmp(o->unit, unit))) &&
(o->flags & mask) == flags )
return o;
@@ -1208,7 +1219,8 @@ int ffmpeg_property_add_string(RenderData *rd, const char * type, const char * s
prop = ffmpeg_property_add(rd,
(char*) type, p - c.av_class->option,
o - c.av_class->option);
- } else {
+ }
+ else {
prop = ffmpeg_property_add(rd,
(char*) type, o - c.av_class->option, 0);
}
@@ -1238,10 +1250,10 @@ static void ffmpeg_set_expert_options(RenderData *rd)
{
int codec_id = rd->ffcodecdata.codec;
- if(rd->ffcodecdata.properties)
+ if (rd->ffcodecdata.properties)
IDP_FreeProperty(rd->ffcodecdata.properties);
- if(codec_id == CODEC_ID_H264) {
+ if (codec_id == CODEC_ID_H264) {
/*
* All options here are for x264, but must be set via ffmpeg.
* The names are therefore different - Search for "x264 to FFmpeg option mapping"
@@ -1281,12 +1293,12 @@ static void ffmpeg_set_expert_options(RenderData *rd)
ffmpeg_property_add_string(rd, "video", "flags2:fastpskip");
ffmpeg_property_add_string(rd, "video", "wpredp:2");
- if(rd->ffcodecdata.flags & FFMPEG_LOSSLESS_OUTPUT)
+ if (rd->ffcodecdata.flags & FFMPEG_LOSSLESS_OUTPUT)
ffmpeg_property_add_string(rd, "video", "cqp:0");
}
#if 0 /* disabled for after release */
- else if(codec_id == CODEC_ID_DNXHD) {
- if(rd->ffcodecdata.flags & FFMPEG_LOSSLESS_OUTPUT)
+ else if (codec_id == CODEC_ID_DNXHD) {
+ if (rd->ffcodecdata.flags & FFMPEG_LOSSLESS_OUTPUT)
ffmpeg_property_add_string(rd, "video", "mbd:rd");
}
#endif
@@ -1296,7 +1308,7 @@ void ffmpeg_set_preset(RenderData *rd, int preset)
{
int isntsc = (rd->frs_sec != 25);
- if(rd->ffcodecdata.properties)
+ if (rd->ffcodecdata.properties)
IDP_FreeProperty(rd->ffcodecdata.properties);
switch (preset) {
@@ -1363,11 +1375,11 @@ void ffmpeg_set_preset(RenderData *rd, int preset)
case FFMPEG_PRESET_THEORA:
case FFMPEG_PRESET_XVID:
- if(preset == FFMPEG_PRESET_XVID) {
+ if (preset == FFMPEG_PRESET_XVID) {
rd->ffcodecdata.type = FFMPEG_AVI;
rd->ffcodecdata.codec = CODEC_ID_MPEG4;
}
- else if(preset == FFMPEG_PRESET_THEORA) {
+ else if (preset == FFMPEG_PRESET_THEORA) {
rd->ffcodecdata.type = FFMPEG_OGG; // XXX broken
rd->ffcodecdata.codec = CODEC_ID_THEORA;
}
@@ -1390,8 +1402,8 @@ void ffmpeg_verify_image_type(RenderData *rd, ImageFormatData *imf)
{
int audio= 0;
- if(imf->imtype == R_IMF_IMTYPE_FFMPEG) {
- if(rd->ffcodecdata.type <= 0 ||
+ if (imf->imtype == R_IMF_IMTYPE_FFMPEG) {
+ if (rd->ffcodecdata.type <= 0 ||
rd->ffcodecdata.codec <= 0 ||
rd->ffcodecdata.audio_codec <= 0 ||
rd->ffcodecdata.video_bitrate <= 1) {
@@ -1400,32 +1412,32 @@ void ffmpeg_verify_image_type(RenderData *rd, ImageFormatData *imf)
ffmpeg_set_preset(rd, FFMPEG_PRESET_DVD);
}
- if(rd->ffcodecdata.type == FFMPEG_OGG) {
+ if (rd->ffcodecdata.type == FFMPEG_OGG) {
rd->ffcodecdata.type = FFMPEG_MPEG2;
}
audio= 1;
}
- else if(imf->imtype == R_IMF_IMTYPE_H264) {
- if(rd->ffcodecdata.codec != CODEC_ID_H264) {
+ else if (imf->imtype == R_IMF_IMTYPE_H264) {
+ if (rd->ffcodecdata.codec != CODEC_ID_H264) {
ffmpeg_set_preset(rd, FFMPEG_PRESET_H264);
audio= 1;
}
}
- else if(imf->imtype == R_IMF_IMTYPE_XVID) {
- if(rd->ffcodecdata.codec != CODEC_ID_MPEG4) {
+ else if (imf->imtype == R_IMF_IMTYPE_XVID) {
+ if (rd->ffcodecdata.codec != CODEC_ID_MPEG4) {
ffmpeg_set_preset(rd, FFMPEG_PRESET_XVID);
audio= 1;
}
}
- else if(imf->imtype == R_IMF_IMTYPE_THEORA) {
- if(rd->ffcodecdata.codec != CODEC_ID_THEORA) {
+ else if (imf->imtype == R_IMF_IMTYPE_THEORA) {
+ if (rd->ffcodecdata.codec != CODEC_ID_THEORA) {
ffmpeg_set_preset(rd, FFMPEG_PRESET_THEORA);
audio= 1;
}
}
- if(audio && rd->ffcodecdata.audio_codec < 0) {
+ if (audio && rd->ffcodecdata.audio_codec < 0) {
rd->ffcodecdata.audio_codec = CODEC_ID_NONE;
rd->ffcodecdata.audio_bitrate = 128;
}
diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c
index c163155c8fb..4bb9c497980 100644
--- a/source/blender/blenkernel/intern/writeframeserver.c
+++ b/source/blender/blenkernel/intern/writeframeserver.c
@@ -301,9 +301,11 @@ int frameserver_loop(RenderData *rd, ReportList *UNUSED(reports))
rval = select(connsock + 1, &readfds, NULL, NULL, &tv);
if (rval > 0) {
break;
- } else if (rval == 0) {
+ }
+ else if (rval == 0) {
return -1;
- } else if (rval < 0) {
+ }
+ else if (rval < 0) {
if (!select_was_interrupted_by_signal()) {
return -1;
}
diff --git a/source/blender/blenlib/BLI_array.h b/source/blender/blenlib/BLI_array.h
index 9fa66e91393..a8a7cf39066 100644
--- a/source/blender/blenlib/BLI_array.h
+++ b/source/blender/blenlib/BLI_array.h
@@ -51,7 +51,7 @@
*
* arrays are buffered, using double-buffering (so on each reallocation,
* the array size is doubled). supposedly this should give good Big Oh
- * behaviour, though it may not be the best in practice.
+ * behavior, though it may not be the best in practice.
*/
#define BLI_array_declare(arr) \
diff --git a/source/blender/blenlib/BLI_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..91252d3beb5 100644
--- a/source/blender/blenlib/BLI_bpath.h
+++ b/source/blender/blenlib/BLI_bpath.h
@@ -28,7 +28,7 @@
/** \file BLI_bpath.h
* \ingroup bli
* \attention Based on ghash, difference is ghash is not a fixed size,
- * so for BPath we dont need to malloc
+ * so for BPath we don't need to malloc
*/
#ifndef __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_callbacks.h b/source/blender/blenlib/BLI_callbacks.h
index f4f92a0cbee..b32a1e272c8 100644
--- a/source/blender/blenlib/BLI_callbacks.h
+++ b/source/blender/blenlib/BLI_callbacks.h
@@ -42,6 +42,8 @@ typedef enum {
BLI_CB_EVT_RENDER_PRE,
BLI_CB_EVT_RENDER_POST,
BLI_CB_EVT_RENDER_STATS,
+ BLI_CB_EVT_RENDER_COMPLETE,
+ BLI_CB_EVT_RENDER_CANCEL,
BLI_CB_EVT_LOAD_PRE,
BLI_CB_EVT_LOAD_POST,
BLI_CB_EVT_SAVE_PRE,
diff --git a/source/blender/blenlib/BLI_dlrbTree.h b/source/blender/blenlib/BLI_dlrbTree.h
index f048e319d5d..7443d7a07fe 100644
--- a/source/blender/blenlib/BLI_dlrbTree.h
+++ b/source/blender/blenlib/BLI_dlrbTree.h
@@ -77,7 +77,7 @@ typedef struct DLRBT_Tree {
/* return -1, 0, 1 for whether the given data is less than, equal to, or greater than the given node
* - node: <DLRBT_Node> the node to compare to
- * - data: pointer to the relevant data or values stored in the bitpattern dependant on the function
+ * - data: pointer to the relevant data or values stored in the bitpattern dependent on the function
*/
typedef short (*DLRBT_Comparator_FP)(void *node, void *data);
@@ -88,7 +88,7 @@ typedef DLRBT_Node *(*DLRBT_NAlloc_FP)(void *data);
/* update an existing node instance accordingly to be in sync with the given data *
* - node: <DLRBT_Node> the node to update
- * - data: pointer to the relevant data or values stored in the bitpattern dependant on the function
+ * - data: pointer to the relevant data or values stored in the bitpattern dependent on the function
*/
typedef void (*DLRBT_NUpdate_FP)(void *node, void *data);
@@ -97,10 +97,10 @@ typedef void (*DLRBT_NUpdate_FP)(void *node, void *data);
/* ADT Management ------------------------------- */
-/* Create a new tree, and initialise as necessary */
+/* Create a new tree, and initialize as necessary */
DLRBT_Tree *BLI_dlrbTree_new(void);
-/* Initialises some given trees */
+/* 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 6b499c3bbcf..f2e62d6e6bd 100644
--- a/source/blender/blenlib/BLI_dynstr.h
+++ b/source/blender/blenlib/BLI_dynstr.h
@@ -48,32 +48,32 @@ typedef struct DynStr DynStr;
/**
* Create a new DynStr.
*
- * @return Pointer to a new DynStr.
+ * \return Pointer to a new DynStr.
*/
DynStr* BLI_dynstr_new (void);
/**
* Append a c-string to a DynStr.
*
- * @param ds The DynStr to append to.
- * @param cstr The c-string to append.
+ * \param ds The DynStr to append to.
+ * \param cstr The c-string to append.
*/
void BLI_dynstr_append (DynStr *ds, const char *cstr);
/**
* Append a length clamped c-string to a DynStr.
*
- * @param ds The DynStr to append to.
- * @param cstr The c-string to append.
- * @param len The maximum length of the c-string to copy.
+ * \param ds The DynStr to append to.
+ * \param cstr The c-string to append.
+ * \param len The maximum length of the c-string to copy.
*/
void BLI_dynstr_nappend (DynStr *ds, const char *cstr, int len);
/**
* Append a c-string to a DynStr, but with formatting like printf.
*
- * @param ds The DynStr to append to.
- * @param format The printf format string to use.
+ * \param ds The DynStr to append to.
+ * \param format The printf format string to use.
*/
void BLI_dynstr_appendf (DynStr *ds, const char *format, ...)
#ifdef __GNUC__
@@ -85,18 +85,18 @@ void BLI_dynstr_vappendf (DynStr *ds, const char *format, va_list args);
/**
* Find the length of a DynStr.
*
- * @param ds The DynStr of interest.
- * @return The length of @a ds.
+ * \param ds The DynStr of interest.
+ * \return The length of \a ds.
*/
int BLI_dynstr_get_len (DynStr *ds);
/**
* 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.
- * @return The contents of @a ds as a c-string.
+ * \param ds The DynStr of interest.
+ * \return The contents of \a ds as a c-string.
*/
char* BLI_dynstr_get_cstring (DynStr *ds);
@@ -105,16 +105,16 @@ char* BLI_dynstr_get_cstring (DynStr *ds);
* <i> The str argument must be allocated to be at
* least the size of BLI_dynstr_get_len(ds) + 1. </i>
*
- * @param ds The DynStr of interest.
- * @param str The string to fill.
- * @return The contents of @a ds as a c-string.
+ * \param ds The DynStr of interest.
+ * \param str The string to fill.
+ * \return The contents of \a ds as a c-string.
*/
void BLI_dynstr_get_cstring_ex (DynStr *ds, char *str);
/**
* Free the DynStr
*
- * @param ds The DynStr to free.
+ * \param ds The DynStr to free.
*/
void BLI_dynstr_free (DynStr *ds);
diff --git a/source/blender/blenlib/BLI_editVert.h b/source/blender/blenlib/BLI_editVert.h
index b5096abc5bc..0f754d5fc98 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_fileops.h b/source/blender/blenlib/BLI_fileops.h
index 8fe8456e845..73220cbd739 100644
--- a/source/blender/blenlib/BLI_fileops.h
+++ b/source/blender/blenlib/BLI_fileops.h
@@ -33,6 +33,9 @@
#ifndef __BLI_FILEOPS_H__
#define __BLI_FILEOPS_H__
+#include <stdio.h>
+
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -42,6 +45,8 @@ extern "C" {
/* for size_t (needed on windows) */
#include <stddef.h>
+struct gzFile;
+
/* Common */
int BLI_exists(const char *path);
@@ -65,6 +70,10 @@ unsigned int BLI_dir_contents(const char *dir, struct direntry **filelist);
/* Files */
+FILE *BLI_fopen(const char *filename, const char *mode);
+void *BLI_gzopen(const char *filename, const char *mode);
+int BLI_open(const char *filename, int oflag, int pmode);
+
int BLI_file_is_writable(const char *file);
int BLI_file_touch(const char *file);
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_ghash.h b/source/blender/blenlib/BLI_ghash.h
index ccad3250a5f..457f098bff7 100644
--- a/source/blender/blenlib/BLI_ghash.h
+++ b/source/blender/blenlib/BLI_ghash.h
@@ -80,8 +80,8 @@ int BLI_ghash_size (GHash *gh);
* while the iterator is in use, and the iterator will step exactly
* BLI_ghash_size(gh) times before becoming done.
*
- * @param gh The GHash to iterate over.
- * @return Pointer to a new DynStr.
+ * \param gh The GHash to iterate over.
+ * \return Pointer to a new DynStr.
*/
GHashIterator* BLI_ghashIterator_new (GHash *gh);
/**
@@ -89,45 +89,45 @@ GHashIterator* BLI_ghashIterator_new (GHash *gh);
* be mutated while the iterator is in use, and the iterator will
* step exactly BLI_ghash_size(gh) times before becoming done.
*
- * @param ghi The GHashIterator to initialize.
- * @param gh The GHash to iterate over.
+ * \param ghi The GHashIterator to initialize.
+ * \param gh The GHash to iterate over.
*/
void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh);
/**
* Free a GHashIterator.
*
- * @param ghi The iterator to free.
+ * \param ghi The iterator to free.
*/
void BLI_ghashIterator_free (GHashIterator *ghi);
/**
* Retrieve the key from an iterator.
*
- * @param ghi The iterator.
- * @return The key at the current index, or NULL if the
+ * \param ghi The iterator.
+ * \return The key at the current index, or NULL if the
* iterator is done.
*/
void* BLI_ghashIterator_getKey (GHashIterator *ghi);
/**
* Retrieve the value from an iterator.
*
- * @param ghi The iterator.
- * @return The value at the current index, or NULL if the
+ * \param ghi The iterator.
+ * \return The value at the current index, or NULL if the
* iterator is done.
*/
void* BLI_ghashIterator_getValue (GHashIterator *ghi);
/**
* Steps the iterator to the next index.
*
- * @param ghi The iterator.
+ * \param ghi The iterator.
*/
void BLI_ghashIterator_step (GHashIterator *ghi);
/**
* Determine if an iterator is done (has reached the end of
* the hash table).
*
- * @param ghi The iterator.
- * @return True if done, False otherwise.
+ * \param ghi The iterator.
+ * \return True if done, False otherwise.
*/
int BLI_ghashIterator_isDone (GHashIterator *ghi);
diff --git a/source/blender/blenlib/BLI_graph.h b/source/blender/blenlib/BLI_graph.h
index effa2c3bc03..52613f9869f 100644
--- a/source/blender/blenlib/BLI_graph.h
+++ b/source/blender/blenlib/BLI_graph.h
@@ -177,7 +177,7 @@ void BLI_mirrorAlongAxis(float v[3], float center[3], float axis[3]);
/* BArc symmetry flags
*
- * axial symetry sides */
+ * axial symmetry sides */
#define SYM_SIDE_POSITIVE 1
#define SYM_SIDE_NEGATIVE 2
/* Anything higher is the order in radial symmetry */
diff --git a/source/blender/blenlib/BLI_gsqueue.h b/source/blender/blenlib/BLI_gsqueue.h
index 53fdb5a541a..29c31c19047 100644
--- a/source/blender/blenlib/BLI_gsqueue.h
+++ b/source/blender/blenlib/BLI_gsqueue.h
@@ -39,8 +39,8 @@ typedef struct _GSQueue GSQueue;
/**
* Create a new GSQueue.
*
- * @param elem_size The size of the structures in the queue.
- * @retval The new queue
+ * \param elem_size The size of the structures in the queue.
+ * \retval The new queue
*/
GSQueue* BLI_gsqueue_new (int elem_size);
@@ -58,7 +58,7 @@ int BLI_gsqueue_size(GSQueue *gq);
* Access the item at the head of the queue
* without removing it.
*
- * @param item_r A pointer to an appropriatly
+ * \param item_r A pointer to an appropriately
* sized structure (the size passed to BLI_gsqueue_new)
*/
void BLI_gsqueue_peek (GSQueue *gq, void *item_r);
@@ -67,7 +67,7 @@ void BLI_gsqueue_peek (GSQueue *gq, void *item_r);
* Access the item at the head of the queue
* and remove it.
*
- * @param item_r A pointer to an appropriatly
+ * \param item_r A pointer to an appropriately
* sized structure (the size passed to BLI_gsqueue_new).
* Can be NULL if desired.
*/
@@ -76,7 +76,7 @@ void BLI_gsqueue_pop (GSQueue *gq, void *item_r);
/**
* Push an element onto the tail of the queue.
*
- * @param item A pointer to an appropriatly
+ * \param item A pointer to an appropriately
* sized structure (the size passed to BLI_gsqueue_new).
*/
void BLI_gsqueue_push (GSQueue *gq, void *item);
@@ -85,7 +85,7 @@ void BLI_gsqueue_push (GSQueue *gq, void *item);
* Push an element back onto the head of the queue (so
* it would be returned from the next call to BLI_gsqueue_pop).
*
- * @param item A pointer to an appropriatly
+ * \param item A pointer to an appropriately
* sized structure (the size passed to BLI_gsqueue_new).
*/
void BLI_gsqueue_pushback (GSQueue *gq, void *item);
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_kdtree.h b/source/blender/blenlib/BLI_kdtree.h
index 0ec514b4480..a58f58020d7 100644
--- a/source/blender/blenlib/BLI_kdtree.h
+++ b/source/blender/blenlib/BLI_kdtree.h
@@ -31,7 +31,7 @@
/** \file BLI_kdtree.h
* \ingroup bli
- * \brief A kd-tree for nearest neighbour search.
+ * \brief A kd-tree for nearest neighbor search.
* \author Janne Karhu
* \author Brecht van Lommel
*/
diff --git a/source/blender/blenlib/BLI_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_base.h b/source/blender/blenlib/BLI_math_base.h
index d0a1311f2bc..7e5f1f2a72a 100644
--- a/source/blender/blenlib/BLI_math_base.h
+++ b/source/blender/blenlib/BLI_math_base.h
@@ -167,7 +167,7 @@ MINLINE float signf(float f);
MINLINE float power_of_2(float f);
-/* these dont really fit anywhere but were being copied about a lot */
+/* these don't really fit anywhere but were being copied about a lot */
MINLINE int is_power_of_2_i(int n);
MINLINE int power_of_2_max_i(int n);
MINLINE int power_of_2_min_i(int n);
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index b46f79fb2e6..9b5e3638609 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -54,7 +54,7 @@ float area_tri_v3(const float a[3], const float b[3], const float c[3]);
float area_quad_v3(const float a[3], const float b[3], const float c[3], const float d[3]);
float area_poly_v3(int nr, float verts[][3], const float normal[3]);
-int is_quad_convex_v3(const float *v1, const float *v2, const float *v3, const float *v4);
+int is_quad_convex_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
/********************************* Distance **********************************/
@@ -73,6 +73,7 @@ void closest_to_plane_v3(float r[3], const float plane_co[3], const float plane
float line_point_factor_v3(const float p[3], const float l1[3], const float l2[3]);
float line_point_factor_v2(const float p[2], const float l1[2], const float l2[2]);
+void limit_dist_v3(float v1[3], float v2[3], const float dist);
/******************************* Intersection ********************************/
@@ -103,20 +104,20 @@ 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);
/**
* Intersect line/plane, optionally treat line as directional (like a ray) with the no_flip argument.
- * @param out The intersection point.
- * @param l1 The first point of the line.
- * @param l2 The second point of the line.
- * @param plane_co A point on the plane to intersect with.
- * @param plane_no The direction of the plane (does not need to be normalized).
- * @param no_flip When true, the intersection point will always be from l1 to l2, even if this is not on the plane.
+ * \param out The intersection point.
+ * \param l1 The first point of the line.
+ * \param l2 The second point of the line.
+ * \param plane_co A point on the plane to intersect with.
+ * \param plane_no The direction of the plane (does not need to be normalized).
+ * \param no_flip When true, the intersection point will always be from l1 to l2, even if this is not on the plane.
*/
int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3],
const float plane_co[3], const float plane_no[3], const short no_flip);
@@ -125,12 +126,12 @@ int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3],
* Intersect two planes, return a point on the intersection and a vector
* that runs on the direction of the intersection.
* Return error code is the same as 'isect_line_line_v3'.
- * @param r_isect_co The resulting intersection point.
- * @param r_isect_no The resulting vector of the intersection.
- * @param plane_a_co The point on the first plane.
- * @param plane_a_no The normal of the first plane.
- * @param plane_b_co The point on the second plane.
- * @param plane_b_no The normal of the second plane.
+ * \param r_isect_co The resulting intersection point.
+ * \param r_isect_no The resulting vector of the intersection.
+ * \param plane_a_co The point on the first plane.
+ * \param plane_a_no The normal of the first plane.
+ * \param plane_b_co The point on the second plane.
+ * \param plane_b_no The normal of the second plane.
*/
void isect_plane_plane_v3(float r_isect_co[3], float r_isect_no[3],
const float plane_a_co[3], const float plane_a_no[3],
@@ -248,9 +249,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_inline.h b/source/blender/blenlib/BLI_math_inline.h
index fcc5fb744bb..ce43d5fb941 100644
--- a/source/blender/blenlib/BLI_math_inline.h
+++ b/source/blender/blenlib/BLI_math_inline.h
@@ -38,21 +38,21 @@ extern "C" {
#define __BLI_MATH_INLINE_H__
#ifdef __BLI_MATH_INLINE_H__
-#ifdef _MSC_VER
-#define MINLINE static __forceinline
-#define MALWAYS_INLINE MINLINE
+# ifdef _MSC_VER
+# define MINLINE static __forceinline
+# define MALWAYS_INLINE MINLINE
+# else
+# define MINLINE static inline
+# if (defined(__APPLE__) && defined(__ppc__))
+ /* static inline __attribute__ here breaks osx ppc gcc42 build */
+# define MALWAYS_INLINE static __attribute__((always_inline))
+# else
+# define MALWAYS_INLINE static inline __attribute__((always_inline))
+# endif
+# endif
#else
-#define MINLINE static inline
-#if (defined(__APPLE__) && defined(__ppc__))
-/* static inline __attribute__ here breaks osx ppc gcc42 build */
-#define MALWAYS_INLINE static __attribute__((always_inline))
-#else
-#define MALWAYS_INLINE static inline __attribute__((always_inline))
-#endif
-#endif
-#else
-#define MINLINE
-#define MALWAYS_INLINE
+# define MINLINE
+# define MALWAYS_INLINE
#endif
#ifdef __cplusplus
@@ -60,4 +60,3 @@ extern "C" {
#endif
#endif /* __BLI_MATH_INLINE_H__ */
-
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h
index 8c19941e18c..00a751f9da3 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]);
@@ -118,6 +123,8 @@ void orthogonalize_m4(float R[4][4], int axis);
int is_orthogonal_m3(float mat[3][3]);
int is_orthogonal_m4(float mat[4][4]);
+int is_orthonormal_m3(float mat[3][3]);
+int is_orthonormal_m4(float mat[4][4]);
void adjoint_m3_m3(float R[3][3], float A[3][3]);
void adjoint_m4_m4(float R[4][4], float A[4][4]);
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index 7a39fc8b8ce..b4e1a71d45e 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 ********************************/
@@ -121,6 +129,7 @@ MINLINE void star_m3_v3(float rmat[3][3],float a[3]);
/*********************************** Length **********************************/
MINLINE float len_squared_v2(const float v[2]);
+MINLINE float len_squared_v3(const float v[3]);
MINLINE float len_v2(const float a[2]);
MINLINE float len_v2v2(const float a[2], const float b[2]);
MINLINE float len_squared_v2v2(const float a[2], const float b[2]);
@@ -168,6 +177,7 @@ MINLINE float line_point_side_v2(const float l1[2], const float l2[2], const flo
/* - angle_normalized_* is faster equivalent if vectors are normalized */
float angle_v2v2(const float a[2], const float b[2]);
+float angle_signed_v2v2(const float v1[2], const float v2[2]);
float angle_v2v2v2(const float a[2], const float b[2], const float c[2]);
float angle_normalized_v2v2(const float a[2], const float b[2]);
float angle_v3v3(const float a[3], const float b[3]);
@@ -181,6 +191,7 @@ void angle_poly_v3(float* angles, const float* verts[3], int len);
void project_v2_v2v2(float c[2], const float v1[2], const float v2[2]);
void project_v3_v3v3(float r[3], const float p[3], const float n[3]);
+void project_v3_plane(float v[3], const float n[3], const float p[3]);
void reflect_v3_v3v3(float r[3], const float v[3], const float n[3]);
void ortho_basis_v3v3_v3(float r1[3], float r2[3], const float a[3]);
void bisect_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3]);
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_mempool.h b/source/blender/blenlib/BLI_mempool.h
index 0b190c63559..9d7c7d496c8 100644
--- a/source/blender/blenlib/BLI_mempool.h
+++ b/source/blender/blenlib/BLI_mempool.h
@@ -48,8 +48,7 @@ typedef struct BLI_mempool BLI_mempool;
* first four bytes of the elements never contain the character string
* 'free'. use with care.*/
-BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk,
- short use_sysmalloc, short allow_iter);
+BLI_mempool *BLI_mempool_create(int esize, int totelem, int pchunk, int flag);
void *BLI_mempool_alloc(BLI_mempool *pool);
void *BLI_mempool_calloc(BLI_mempool *pool);
void BLI_mempool_free(BLI_mempool *pool, void *addr);
@@ -65,6 +64,12 @@ typedef struct BLI_mempool_iter {
int curindex;
} BLI_mempool_iter;
+/* flag */
+enum {
+ BLI_MEMPOOL_SYSMALLOC = (1 << 0),
+ BLI_MEMPOOL_ALLOW_ITER = (1 << 1)
+};
+
void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter);
void *BLI_mempool_iterstep(BLI_mempool_iter *iter);
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h
index a2d432b492a..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..210238efcfd 100644
--- a/source/blender/blenlib/BLI_pbvh.h
+++ b/source/blender/blenlib/BLI_pbvh.h
@@ -26,13 +26,16 @@
* \brief A BVH for high poly meshes.
*/
-struct MFace;
-struct MVert;
+#include "BLI_bitmap.h"
+
+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 +59,13 @@ 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,
+ unsigned int **grid_hidden);
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 +76,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);
@@ -84,8 +88,19 @@ int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
/* Drawing */
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));
+
+/* PBVH Access */
+typedef enum {
+ PBVH_FACES,
+ PBVH_GRIDS,
+} PBVHType;
+
+PBVHType BLI_pbvh_type(const PBVH *bvh);
+
+/* multires hidden data, only valid for type == PBVH_GRIDS */
+unsigned int **BLI_pbvh_grid_hidden(const PBVH *bvh);
/* Node Access */
@@ -96,10 +111,15 @@ typedef enum {
PBVH_UpdateBB = 4,
PBVH_UpdateOriginalBB = 8,
PBVH_UpdateDrawBuffers = 16,
- PBVH_UpdateRedraw = 32
+ PBVH_UpdateRedraw = 32,
+
+ PBVH_RebuildDrawBuffers = 64,
+ PBVH_FullyHidden = 128
} PBVHNodeFlags;
void BLI_pbvh_node_mark_update(PBVHNode *node);
+void BLI_pbvh_node_mark_rebuild_draw(PBVHNode *node);
+void BLI_pbvh_node_fully_hidden_set(PBVHNode *node, int fully_hidden);
void BLI_pbvh_node_get_grids(PBVH *bvh, PBVHNode *node,
int **grid_indices, int *totgrid, int *maxgrid, int *gridsize,
@@ -114,6 +134,11 @@ void BLI_pbvh_node_get_original_BB(PBVHNode *node, float bb_min[3], float bb_max
float BLI_pbvh_node_get_tmin(PBVHNode* node);
+/* test if AABB is at least partially inside the planes' volume */
+int BLI_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data);
+/* test if AABB is at least partially outside the planes' volume */
+int BLI_pbvh_node_planes_exclude_AABB(PBVHNode *node, void *data);
+
/* Update Normals/Bounding Box/Draw Buffers/Redraw and clear flags */
void BLI_pbvh_update(PBVH *bvh, int flags, float (*face_nors)[3]);
@@ -131,9 +156,11 @@ 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 */
+/* note: PBVH_ITER_ALL does not skip hidden vertices,
+ PBVH_ITER_UNIQUE does */
#define PBVH_ITER_ALL 0
#define PBVH_ITER_UNIQUE 1
@@ -149,6 +176,7 @@ typedef struct PBVHVertexIter {
/* grid */
struct DMGridData **grids;
struct DMGridData *grid;
+ BLI_bitmap *grid_hidden, gh;
int *grid_indices;
int totgrid;
int gridsize;
@@ -159,7 +187,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;
@@ -181,6 +209,8 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node,
vi.width= vi.gridsize; \
vi.height= vi.gridsize; \
vi.grid= vi.grids[vi.grid_indices[vi.g]]; \
+ if(mode == PBVH_ITER_UNIQUE) \
+ vi.gh= vi.grid_hidden[vi.grid_indices[vi.g]]; \
} \
else { \
vi.width= vi.totvert; \
@@ -193,9 +223,15 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node,
vi.co= vi.grid->co; \
vi.fno= vi.grid->no; \
vi.grid++; \
+ if(vi.gh) { \
+ if(BLI_BITMAP_GET(vi.gh, vi.gy * vi.gridsize + vi.gx)) \
+ continue; \
+ } \
} \
else { \
vi.mvert= &vi.mverts[vi.vert_indices[vi.gx]]; \
+ if(mode == PBVH_ITER_UNIQUE && vi.mvert->flag & ME_HIDE) \
+ continue; \
vi.co= vi.mvert->co; \
vi.no= vi.mvert->no; \
} \
diff --git a/source/blender/blenlib/BLI_rand.h b/source/blender/blenlib/BLI_rand.h
index 1749bbcc38a..d4d6563ac99 100644
--- a/source/blender/blenlib/BLI_rand.h
+++ b/source/blender/blenlib/BLI_rand.h
@@ -68,8 +68,8 @@ double BLI_drand (void);
/** Return a pseudo-random number N where 0.0f<=N<1.0f */
float BLI_frand (void);
- /** Fills a block of memory starting at @a addr
- * and extending @a len bytes with pseudo-random
+ /** Fills a block of memory starting at \a addr
+ * and extending \a len bytes with pseudo-random
* contents. This routine does not use nor modify
* the state of the BLI random number generator.
*/
diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h
index 4ff203737a0..d1209524c15 100644
--- a/source/blender/blenlib/BLI_rect.h
+++ b/source/blender/blenlib/BLI_rect.h
@@ -46,7 +46,7 @@ extern "C" {
* rect is one with a zero (or negative)
* width or height.
*
- * @return True if @a rect is empty.
+ * \return True if \a rect is empty.
*/
int BLI_rcti_is_empty(struct rcti *rect);
int BLI_rctf_is_empty(struct rctf *rect);
diff --git a/source/blender/blenlib/BLI_scanfill.h b/source/blender/blenlib/BLI_scanfill.h
index 1f0e455fa45..1fe71bffba8 100644
--- a/source/blender/blenlib/BLI_scanfill.h
+++ b/source/blender/blenlib/BLI_scanfill.h
@@ -36,7 +36,7 @@
*/
/**
- * @attention Defined in scanfill.c
+ * \attention Defined in scanfill.c
*/
extern struct ListBase fillvertbase;
extern struct ListBase filledgebase;
@@ -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);
@@ -94,8 +94,8 @@ void BLI_end_edgefill(void);
/**
* Set a function taking a char* as argument to flag errors. If the
* callback is not set, the error is discarded.
- * @param f The function to use as callback
- * @attention used in creator.c
+ * \param f The function to use as callback
+ * \attention used in creator.c
*/
void BLI_setErrorCallBack(void (*f)(const char*));
@@ -104,8 +104,8 @@ void BLI_setErrorCallBack(void (*f)(const char*));
* in this module. If the function returns true, the execution will
* terminate gracefully. If the callback is not set, interruption is
* not possible.
- * @param f The function to use as callback
- * @attention used in creator.c
+ * \param f The function to use as callback
+ * \attention used in creator.c
*/
void BLI_setInterruptCallBack(int (*f)(void));
diff --git a/source/blender/blenlib/BLI_sparsemap.h b/source/blender/blenlib/BLI_sparsemap.h
deleted file mode 100644
index 654cafbc200..00000000000
--- a/source/blender/blenlib/BLI_sparsemap.h
+++ /dev/null
@@ -1,81 +0,0 @@
-#if 0
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2009 Blender Foundation, Joshua Leung
- * All rights reserved.
- *
- * Contributor(s): Joseph Eagar (original author)
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef __BLI_SPARSEMAP_H__
-#define __BLI_SPARSEMAP_H__
-
-/** \file BLI_sparsemap.h
- * \ingroup bli
- */
-
-#include "BLI_math_inline.h"
-
-typedef struct SparseMap {
- int max;
- int blocksize;
- void **blocks;
- int totblock;
-} SparseMap;
-
-MALWAYS_INLINE SparseMap *BLI_sparsemap_new(int blocksize, char *name)
-{
- SparseMap *sm = MEM_callocN(sizeof(SparseMap), name);
-
- sm->blocksize = blocksize;
- return sm;
-}
-
-MALWAYS_INLINE void BLI_sparsemap_free(SparseMap *sm)
-{
- if (sm->blocks)
- MEM_freeN(sm->blocks);
-
- MEM_freeN(sm);
-}
-
-MALWAYS_INLINE void BLI_sparsemap_set(SparseMap *sm, int index, void *ptr)
-{
- if (index >= sm->max || (sm->blocks && !sm->blocks[index/sm->blocksize])) {
- int totblock = MAX2((index+1)/sm->blocksize, 2);
- void *blocks = MEM_callocN(sizeof(void*)*totblock);
-
- if (sm->blocks)
- memcpy(blocks, sm->blocks, sizeof(void*)*sm->totblock);
- sm->totblock = totblock;
- MEM_freeN(sm->blocks);
- sm->blocks = blocks;
- }
-
- if (!sm->blocks[index/sm->blocksize]) {
- sm->blocks[index/sm->blocksize] = MEM_mallocN(sizeof(void*)*sm->blocksize);
- }
-
- sm->blocks[index/sm->blocksize] = ptr;
-}
-
-#endif /* __BLI_SPARSEMAP_H__ */
-
-#endif
diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h
index 25eb2ebecc2..ec36d587d92 100644
--- a/source/blender/blenlib/BLI_string.h
+++ b/source/blender/blenlib/BLI_string.h
@@ -37,30 +37,30 @@ extern "C" {
#endif
/**
- * Duplicates the cstring @a str into a newly mallocN'd
+ * Duplicates the cstring \a str into a newly mallocN'd
* string and returns it.
*
- * @param str The string to be duplicated
- * @retval Returns the duplicated string
+ * \param str The string to be duplicated
+ * \retval Returns the duplicated string
*/
char *BLI_strdup(const char *str);
/**
- * Duplicates the first @a len bytes of cstring @a str
- * into a newly mallocN'd string and returns it. @a str
+ * Duplicates the first \a len bytes of cstring \a str
+ * into a newly mallocN'd string and returns it. \a str
* is assumed to be at least len bytes long.
*
- * @param str The string to be duplicated
- * @param len The number of bytes to duplicate
- * @retval Returns the duplicated string
+ * \param str The string to be duplicated
+ * \param len The number of bytes to duplicate
+ * \retval Returns the duplicated string
*/
char *BLI_strdupn(const char *str, const size_t len);
/**
* Appends the two strings, and returns new mallocN'ed string
- * @param str1 first string for copy
- * @param str2 second string for append
- * @retval Returns dst
+ * \param str1 first string for copy
+ * \param str2 second string for append
+ * \retval Returns dst
*/
char *BLI_strdupcat(const char *str1, const char *str2);
@@ -68,11 +68,11 @@ char *BLI_strdupcat(const char *str1, const char *str2);
* Like strncpy but ensures dst is always
* '\0' terminated.
*
- * @param dst Destination for copy
- * @param src Source string to copy
- * @param maxncpy Maximum number of characters to copy (generally
+ * \param dst Destination for copy
+ * \param src Source string to copy
+ * \param maxncpy Maximum number of characters to copy (generally
* the size of dst)
- * @retval Returns dst
+ * \retval Returns dst
*/
char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy);
@@ -88,14 +88,14 @@ char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy);
char *BLI_getQuotedStr(const char *str, const char *prefix);
/**
- * Returns a copy of the cstring @a str into a newly mallocN'd
+ * Returns a copy of the cstring \a str into a newly mallocN'd
* string with all instances of oldText replaced with newText,
* and returns it.
*
- * @param str The string to replace occurances of oldText in
- * @param oldText The text in the string to find and replace
- * @param newText The text in the string to find and replace
- * @retval Returns the duplicated string
+ * \param str The string to replace occurrences of oldText in
+ * \param oldText The text in the string to find and replace
+ * \param newText The text in the string to find and replace
+ * \retval Returns the duplicated string
*/
char *BLI_replacestr(char *str, const char *oldText, const char *newText);
@@ -123,7 +123,7 @@ size_t BLI_strescape(char *dst, const char *src, const size_t maxlen);
/**
* Compare two strings without regard to case.
*
- * @retval True if the strings are equal, false otherwise.
+ * \retval True if the strings are equal, false otherwise.
*/
int BLI_strcaseeq(const char *a, const char *b);
diff --git a/source/blender/blenlib/BLI_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..3a533f73d9d 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -53,8 +53,21 @@
#define ELEM11(a, b, c, d, e, f, g, h, i, j, k, l) ( ELEM4(a, b, c, d, e) || ELEM7(a, f, g, h, i, j, k, l) )
/* shift around elements */
-#define SHIFT3(type, a, b, c) { type tmp; tmp = a; a = c; c = b; b = tmp; }
-#define SHIFT4(type, a, b, c, d) { type tmp; tmp = a; a = d; d = c; c = b; b = tmp; }
+#define SHIFT3(type, a, b, c) { \
+ type tmp; \
+ tmp = a; \
+ a = c; \
+ c = b; \
+ b = tmp; \
+ } (void)0
+#define SHIFT4(type, a, b, c, d) { \
+ type tmp; \
+ tmp = a; \
+ a = d; \
+ d = c; \
+ c = b; \
+ b = tmp; \
+ } (void)0
/* min/max */
#define MIN2(x,y) ( (x)<(y) ? (x) : (y) )
@@ -72,17 +85,17 @@
#define INIT_MINMAX2(min, max) { \
(min)[0]= (min)[1]= 1.0e30f; \
(max)[0]= (max)[1]= -1.0e30f; \
- }
+ } (void)0
#define DO_MIN(vec, min) { \
if( (min)[0]>(vec)[0] ) (min)[0]= (vec)[0]; \
if( (min)[1]>(vec)[1] ) (min)[1]= (vec)[1]; \
if( (min)[2]>(vec)[2] ) (min)[2]= (vec)[2]; \
- }
+ } (void)0
#define DO_MAX(vec, max) { \
if( (max)[0]<(vec)[0] ) (max)[0]= (vec)[0]; \
if( (max)[1]<(vec)[1] ) (max)[1]= (vec)[1]; \
if( (max)[2]<(vec)[2] ) (max)[2]= (vec)[2]; \
- }
+ } (void)0
#define DO_MINMAX(vec, min, max) { \
if( (min)[0]>(vec)[0] ) (min)[0]= (vec)[0]; \
if( (min)[1]>(vec)[1] ) (min)[1]= (vec)[1]; \
@@ -90,13 +103,13 @@
if( (max)[0]<(vec)[0] ) (max)[0]= (vec)[0]; \
if( (max)[1]<(vec)[1] ) (max)[1]= (vec)[1]; \
if( (max)[2]<(vec)[2] ) (max)[2]= (vec)[2]; \
- }
+ } (void)0
#define DO_MINMAX2(vec, min, max) { \
if( (min)[0]>(vec)[0] ) (min)[0]= (vec)[0]; \
if( (min)[1]>(vec)[1] ) (min)[1]= (vec)[1]; \
if( (max)[0]<(vec)[0] ) (max)[0]= (vec)[0]; \
if( (max)[1]<(vec)[1] ) (max)[1]= (vec)[1]; \
- }
+ } (void)0
/* some math and copy defines */
@@ -113,71 +126,65 @@
(v1)[0]= FTOCHAR((v2[0])); \
(v1)[1]= FTOCHAR((v2[1])); \
(v1)[2]= FTOCHAR((v2[2])); \
- }
+ } (void)0
#define F3TOCHAR4(v2, v1) { \
(v1)[0]= FTOCHAR((v2[0])); \
(v1)[1]= FTOCHAR((v2[1])); \
(v1)[2]= FTOCHAR((v2[2])); \
(v1)[3]= 255; \
- }
+ } (void)0
#define F4TOCHAR4(v2, v1) { \
(v1)[0]= FTOCHAR((v2[0])); \
(v1)[1]= FTOCHAR((v2[1])); \
(v1)[2]= FTOCHAR((v2[2])); \
(v1)[3]= FTOCHAR((v2[3])); \
- }
+ } (void)0
#define VECCOPY(v1, v2) { \
*(v1)= *(v2); \
*(v1+1)= *(v2+1); \
*(v1+2)= *(v2+2); \
- }
+ } (void)0
#define VECCOPY2D(v1, v2) { \
*(v1)= *(v2); \
*(v1+1)= *(v2+1); \
- }
-#define QUATCOPY(v1, v2) { \
- *(v1)= *(v2); \
- *(v1+1)= *(v2+1); \
- *(v1+2)= *(v2+2); \
- *(v1+3)= *(v2+3); \
- }
+ } (void)0
#define VECADD(v1,v2,v3) { \
*(v1)= *(v2) + *(v3); \
*(v1+1)= *(v2+1) + *(v3+1); \
*(v1+2)= *(v2+2) + *(v3+2); \
- }
+ } (void)0
#define VECSUB(v1,v2,v3) { \
*(v1)= *(v2) - *(v3); \
*(v1+1)= *(v2+1) - *(v3+1); \
*(v1+2)= *(v2+2) - *(v3+2); \
- }
+ } (void)0
#define VECSUB2D(v1,v2,v3) { \
*(v1)= *(v2) - *(v3); \
*(v1+1)= *(v2+1) - *(v3+1); \
- }
+ } (void)0
#define VECADDFAC(v1,v2,v3,fac) { \
*(v1)= *(v2) + *(v3)*(fac); \
*(v1+1)= *(v2+1) + *(v3+1)*(fac); \
*(v1+2)= *(v2+2) + *(v3+2)*(fac); \
- }
+ } (void)0
#define VECSUBFAC(v1,v2,v3,fac) { \
*(v1)= *(v2) - *(v3)*(fac); \
*(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); \
- }
+ } (void)0
#define INPR(v1, v2) ( (v1)[0]*(v2)[0] + (v1)[1]*(v2)[1] + (v1)[2]*(v2)[2] )
/* some misc stuff.... */
#define CLAMP(a, b, c) if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c)
#define CLAMPIS(a, b, c) ((a)<(b) ? (b) : (a)>(c) ? (c) : (a))
-#define CLAMPTEST(a, b, c) if((b)<(c)) {CLAMP(a, b, c);} else {CLAMP(a, c, b);}
+#define CLAMPTEST(a, b, c) \
+ if ((b) < (c)) { \
+ CLAMP(a, b, c); \
+ } \
+ else { \
+ CLAMP(a, c, b); \
+ } (void)
#define IS_EQ(a,b) ((fabs((double)(a)-(b)) >= (double) FLT_EPSILON) ? 0 : 1)
#define IS_EQF(a,b) ((fabsf((float)(a)-(b)) >= (float) FLT_EPSILON) ? 0 : 1)
@@ -203,26 +210,26 @@
s_i= p_i[1]; p_i[1]= p_i[6]; p_i[6]= s_i; \
s_i= p_i[2]; p_i[2]= p_i[5]; p_i[5]= s_i; \
s_i= p_i[3]; p_i[3]= p_i[4]; p_i[4]= s_i; \
- }
+ } (void)0
#define SWITCH_INT(a) { \
char s_i, *p_i; \
p_i= (char *)&(a); \
s_i= p_i[0]; p_i[0]= p_i[3]; p_i[3]= s_i; \
s_i= p_i[1]; p_i[1]= p_i[2]; p_i[2]= s_i; \
- }
+ } (void)0
#define SWITCH_SHORT(a) { \
char s_i, *p_i; \
p_i= (char *)&(a); \
s_i=p_i[0]; p_i[0]=p_i[1]; p_i[1]=s_i; \
- }
+ } (void)0
/* Warning-free macros for storing ints in pointers. Use these _only_
* for storing an int in a pointer, not a pointer in an int (64bit)! */
-#define SET_INT_IN_POINTER(i) ((void*)(intptr_t)(i))
-#define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i))
+#define SET_INT_IN_POINTER(i) ((void *)(intptr_t)(i))
+#define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i))
/* Macro to convert a value to string in the preprocessor
* STRINGIFY_ARG: gives the argument as a string
@@ -263,19 +270,19 @@
/*little macro so inline keyword works*/
#if defined(_MSC_VER)
-# define BM_INLINE static __forceinline
+# define BLI_INLINE static __forceinline
#elif defined(__GNUC__)
-# define BM_INLINE static inline __attribute((always_inline))
+# define BLI_INLINE static inline __attribute((always_inline))
#else
/* #warning "MSC/GNUC defines not found, inline non-functional" */
-# define BM_INLINE static
+# define BLI_INLINE static
#endif
/* 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
@@ -286,8 +293,8 @@
(void)((!(a)) ? ( \
( \
fprintf(stderr, \
- "BLI_assert failed: %s, %s(), %d at \'%s\'\n", \
- __FILE__, __func__, __LINE__, STRINGIFY(a)), \
+ "BLI_assert failed: %s:%d, %s(), at \'%s\'\n", \
+ __FILE__, __LINE__, __func__, STRINGIFY(a)), \
_BLI_DUMMY_ABORT(), \
NULL)) : NULL)
# else
@@ -295,7 +302,7 @@
(void)((!(a)) ? ( \
( \
fprintf(stderr, \
- "BLI_assert failed: %s, %d at \'%s\'\n", \
+ "BLI_assert failed: %s:%d, at \'%s\'\n", \
__FILE__, __LINE__, STRINGIFY(a)), \
_BLI_DUMMY_ABORT(), \
NULL)) : NULL)
diff --git a/source/blender/blenlib/BLI_vfontdata.h b/source/blender/blenlib/BLI_vfontdata.h
index 5f7b7c39036..0020ba308af 100644
--- a/source/blender/blenlib/BLI_vfontdata.h
+++ b/source/blender/blenlib/BLI_vfontdata.h
@@ -70,8 +70,8 @@ struct TmpFont
* Construct a new VFontData structure from
* Freetype font data in a PackedFile.
*
- * @param pf The font data.
- * @retval A new VFontData structure, or NULL
+ * \param pf The font data.
+ * \retval A new VFontData structure, or NULL
* if unable to load.
*/
VFontData*
diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h
index d939882b105..c393b219785 100644
--- a/source/blender/blenlib/BLI_winstuff.h
+++ b/source/blender/blenlib/BLI_winstuff.h
@@ -124,7 +124,7 @@ struct dirent {
typedef struct _DIR {
HANDLE handle;
- WIN32_FIND_DATA data;
+ WIN32_FIND_DATAW data;
char path[MAX_PATH];
long dd_loc;
long dd_size;
diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt
index 46538a6e0c1..c06a1240729 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -82,6 +82,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
@@ -92,7 +93,6 @@ set(SRC
BLI_array.h
BLI_bitmap.h
BLI_smallhash.h
- BLI_sparsemap.h
BLI_args.h
BLI_blenlib.h
BLI_boxpack2d.h
@@ -103,6 +103,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 +134,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 +143,6 @@ set(SRC
BLI_voxel.h
BLI_winstuff.h
PIL_time.h
- intern/dynamiclist.h
)
if(WITH_BINRELOC)
@@ -159,4 +160,10 @@ if(WITH_XDG_USER_DIRS)
add_definitions(-DWITH_XDG_USER_DIRS)
endif()
+if(WIN32)
+ list(APPEND INC
+ ../../../intern/utfconv
+ )
+endif()
+
blender_add_lib(bf_blenlib "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/blenlib/PIL_time.h b/source/blender/blenlib/PIL_time.h
index fa2ad8644e9..7d34d33d686 100644
--- a/source/blender/blenlib/PIL_time.h
+++ b/source/blender/blenlib/PIL_time.h
@@ -42,14 +42,14 @@ extern "C" {
extern
/** Return an indication of time, expressed as
* seconds since some fixed point. Successive calls
- * are guarenteed to generate values greator than or
+ * are guaranteed to generate values greater than or
* equal to the last call.
*/
double PIL_check_seconds_timer (void);
/**
* Platform-independent sleep function.
- * @param ms Number of milliseconds to sleep
+ * \param ms Number of milliseconds to sleep
*/
void PIL_sleep_ms (int ms);
diff --git a/source/blender/blenlib/SConscript b/source/blender/blenlib/SConscript
index dda8303eea7..ea51e5b6ab5 100644
--- a/source/blender/blenlib/SConscript
+++ b/source/blender/blenlib/SConscript
@@ -18,6 +18,7 @@ if env['WITH_BF_BINRELOC']:
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
+ incs += ' ../../../intern/utfconv'
if env['OURPLATFORM'] == 'linuxcross':
if env['WITH_BF_OPENMP']:
diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c
index bbf005e79ac..cd904030bb9 100644
--- a/source/blender/blenlib/intern/BLI_args.c
+++ b/source/blender/blenlib/intern/BLI_args.c
@@ -103,7 +103,8 @@ static int keycmp(const void *a, const void *b)
return BLI_strcasecmp(ka->arg, kb->arg);
else
return strcmp(ka->arg, kb->arg);
- } else {
+ }
+ else {
return BLI_ghashutil_intcmp((const void*)ka->pass, (const void*)kb->pass);
}
}
@@ -237,8 +238,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 +251,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);
}
}
@@ -264,7 +262,7 @@ void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *
{
int i = 0;
- for( i = 1; i < ba->argc; i++) { /* skip argv[0] */
+ for ( i = 1; i < ba->argc; i++) { /* skip argv[0] */
if (ba->passes[i] == 0) {
/* -1 signal what side of the comparison it is */
bArgument *a = lookUp(ba, ba->argv[i], pass, -1);
@@ -274,7 +272,8 @@ void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *
if (a) {
func = a->func;
data = a->data;
- } else {
+ }
+ else {
func = default_cb;
data = default_data;
}
diff --git a/source/blender/blenlib/intern/BLI_dynstr.c b/source/blender/blenlib/intern/BLI_dynstr.c
index ad52de180aa..ed049a573d9 100644
--- a/source/blender/blenlib/intern/BLI_dynstr.c
+++ b/source/blender/blenlib/intern/BLI_dynstr.c
@@ -119,9 +119,9 @@ void BLI_dynstr_vappendf(DynStr *ds, const char *format, va_list args)
const int maxlen= 65536;
int retval;
- while(1) {
+ while (1) {
va_list args_cpy;
- if(len == sizeof(fixedmessage))
+ if (len == sizeof(fixedmessage))
message= fixedmessage;
else
message= MEM_callocN(sizeof(char) * len, "BLI_dynstr_appendf");
@@ -131,22 +131,22 @@ void BLI_dynstr_vappendf(DynStr *ds, const char *format, va_list args)
retval= vsnprintf(message, len, format, args_cpy);
va_end(args_cpy);
- if(retval == -1) {
+ if (retval == -1) {
/* -1 means not enough space, but on windows it may also mean
* there is a formatting error, so we impose a maximum length */
- if(message != fixedmessage)
+ if (message != fixedmessage)
MEM_freeN(message);
message= NULL;
len *= 2;
- if(len > maxlen) {
+ if (len > maxlen) {
fprintf(stderr, "BLI_dynstr_append text too long or format error.\n");
break;
}
}
- else if(retval >= len) {
+ else if (retval >= len) {
/* in C99 the actual length required is returned */
- if(message != fixedmessage)
+ if (message != fixedmessage)
MEM_freeN(message);
message= NULL;
@@ -157,10 +157,10 @@ void BLI_dynstr_vappendf(DynStr *ds, const char *format, va_list args)
break;
}
- if(message) {
+ if (message) {
BLI_dynstr_append(ds, message);
- if(message != fixedmessage)
+ if (message != fixedmessage)
MEM_freeN(message);
}
}
@@ -177,8 +177,8 @@ void BLI_dynstr_appendf(DynStr *ds, const char *format, ...)
* and avoid code duplication, that crashes on some system because
* va_start/va_end have to be called for each vsnprintf call */
- while(1) {
- if(len == sizeof(fixedmessage))
+ while (1) {
+ if (len == sizeof(fixedmessage))
message= fixedmessage;
else
message= MEM_callocN(sizeof(char)*(len), "BLI_dynstr_appendf");
@@ -187,22 +187,22 @@ void BLI_dynstr_appendf(DynStr *ds, const char *format, ...)
retval= vsnprintf(message, len, format, args);
va_end(args);
- if(retval == -1) {
+ if (retval == -1) {
/* -1 means not enough space, but on windows it may also mean
* there is a formatting error, so we impose a maximum length */
- if(message != fixedmessage)
+ if (message != fixedmessage)
MEM_freeN(message);
message= NULL;
len *= 2;
- if(len > maxlen) {
+ if (len > maxlen) {
fprintf(stderr, "BLI_dynstr_append text too long or format error.\n");
break;
}
}
- else if(retval >= len) {
+ else if (retval >= len) {
/* in C99 the actual length required is returned */
- if(message != fixedmessage)
+ if (message != fixedmessage)
MEM_freeN(message);
message= NULL;
@@ -213,10 +213,10 @@ void BLI_dynstr_appendf(DynStr *ds, const char *format, ...)
break;
}
- if(message) {
+ if (message) {
BLI_dynstr_append(ds, message);
- if(message != fixedmessage)
+ if (message != fixedmessage)
MEM_freeN(message);
}
}
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index 943b67cce8e..28b4794ed1b 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -33,11 +33,8 @@
#include <string.h>
#include <stdlib.h>
-
#include "MEM_guardedalloc.h"
-
-
// #include "BLI_blenlib.h"
#include "BLI_utildefines.h"
@@ -47,7 +44,7 @@
#include "BLO_sys_types.h" // for intptr_t support
/***/
-unsigned int hashsizes[]= {
+unsigned int hashsizes[] = {
5, 11, 17, 37, 67, 131, 257, 521, 1031, 2053, 4099, 8209,
16411, 32771, 65537, 131101, 262147, 524309, 1048583, 2097169,
4194319, 8388617, 16777259, 33554467, 67108879, 134217757,
@@ -58,18 +55,18 @@ unsigned int hashsizes[]= {
GHash *BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info)
{
- GHash *gh= MEM_mallocN(sizeof(*gh), info);
- gh->hashfp= hashfp;
- gh->cmpfp= cmpfp;
- gh->entrypool = BLI_mempool_create(sizeof(Entry), 64, 64, FALSE, FALSE);
-
- gh->cursize= 0;
- gh->nentries= 0;
- gh->nbuckets= hashsizes[gh->cursize];
-
- gh->buckets= MEM_mallocN(gh->nbuckets*sizeof(*gh->buckets), "buckets");
- memset(gh->buckets, 0, gh->nbuckets*sizeof(*gh->buckets));
-
+ GHash *gh = MEM_mallocN(sizeof(*gh), info);
+ gh->hashfp = hashfp;
+ gh->cmpfp = cmpfp;
+ gh->entrypool = BLI_mempool_create(sizeof(Entry), 64, 64, 0);
+
+ gh->cursize = 0;
+ gh->nentries = 0;
+ gh->nbuckets = hashsizes[gh->cursize];
+
+ gh->buckets = MEM_mallocN(gh->nbuckets * sizeof(*gh->buckets), "buckets");
+ memset(gh->buckets, 0, gh->nbuckets * sizeof(*gh->buckets));
+
return gh;
}
@@ -80,31 +77,31 @@ int BLI_ghash_size(GHash *gh)
void BLI_ghash_insert(GHash *gh, void *key, void *val)
{
- unsigned int hash= gh->hashfp(key)%gh->nbuckets;
- Entry *e= (Entry*) BLI_mempool_alloc(gh->entrypool);
+ unsigned int hash = gh->hashfp(key) % gh->nbuckets;
+ Entry *e = (Entry*)BLI_mempool_alloc(gh->entrypool);
- e->key= key;
- e->val= val;
- e->next= gh->buckets[hash];
- gh->buckets[hash]= e;
+ e->key = key;
+ e->val = val;
+ e->next = gh->buckets[hash];
+ gh->buckets[hash] = e;
- if (++gh->nentries>(float)gh->nbuckets/2) {
- Entry **old= gh->buckets;
- int i, nold= gh->nbuckets;
+ if (++gh->nentries > (float)gh->nbuckets / 2) {
+ Entry **old = gh->buckets;
+ int i, nold = gh->nbuckets;
- gh->nbuckets= hashsizes[++gh->cursize];
- gh->buckets= (Entry**)MEM_mallocN(gh->nbuckets*sizeof(*gh->buckets), "buckets");
- memset(gh->buckets, 0, gh->nbuckets*sizeof(*gh->buckets));
+ gh->nbuckets = hashsizes[++gh->cursize];
+ gh->buckets = (Entry**)MEM_mallocN(gh->nbuckets * sizeof(*gh->buckets), "buckets");
+ memset(gh->buckets, 0, gh->nbuckets * sizeof(*gh->buckets));
- for (i=0; i<nold; i++) {
- for (e= old[i]; e;) {
- Entry *n= e->next;
+ for (i = 0; i < nold; i++) {
+ for (e = old[i]; e;) {
+ Entry *n = e->next;
- hash= gh->hashfp(e->key)%gh->nbuckets;
- e->next= gh->buckets[hash];
- gh->buckets[hash]= e;
+ hash = gh->hashfp(e->key) % gh->nbuckets;
+ e->next = gh->buckets[hash];
+ gh->buckets[hash] = e;
- e= n;
+ e = n;
}
}
@@ -114,33 +111,35 @@ void BLI_ghash_insert(GHash *gh, void *key, void *val)
void *BLI_ghash_lookup(GHash *gh, const void *key)
{
- if(gh) {
- unsigned int hash= gh->hashfp(key)%gh->nbuckets;
+ if (gh) {
+ unsigned int hash = gh->hashfp(key) % gh->nbuckets;
Entry *e;
- for (e= gh->buckets[hash]; e; e= e->next)
- if (gh->cmpfp(key, e->key)==0)
+ for (e = gh->buckets[hash]; e; e = e->next)
+ if (gh->cmpfp(key, e->key) == 0)
return e->val;
}
return NULL;
}
-int BLI_ghash_remove (GHash *gh, void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
+int BLI_ghash_remove(GHash *gh, void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
{
- unsigned int hash= gh->hashfp(key)%gh->nbuckets;
+ unsigned int hash = gh->hashfp(key) % gh->nbuckets;
Entry *e;
Entry *p = NULL;
- for (e= gh->buckets[hash]; e; e= e->next) {
- if (gh->cmpfp(key, e->key)==0) {
- Entry *n= e->next;
+ for (e = gh->buckets[hash]; e; e = e->next) {
+ if (gh->cmpfp(key, e->key) == 0) {
+ Entry *n = e->next;
- if (keyfreefp) keyfreefp(e->key);
- if (valfreefp) valfreefp(e->val);
+ if (keyfreefp)
+ keyfreefp(e->key);
+ if (valfreefp)
+ valfreefp(e->val);
BLI_mempool_free(gh->entrypool, e);
- /* correct but 'e' isnt used before return */
- /* e= n; */ /*UNUSED*/
+ /* correct but 'e' isn't used before return */
+ /* e= n; *//*UNUSED*/
if (p)
p->next = n;
else
@@ -157,11 +156,11 @@ int BLI_ghash_remove (GHash *gh, void *key, GHashKeyFreeFP keyfreefp, GHashValFr
int BLI_ghash_haskey(GHash *gh, void *key)
{
- unsigned int hash= gh->hashfp(key)%gh->nbuckets;
+ unsigned int hash = gh->hashfp(key) % gh->nbuckets;
Entry *e;
- for (e= gh->buckets[hash]; e; e= e->next)
- if (gh->cmpfp(key, e->key)==0)
+ for (e = gh->buckets[hash]; e; e = e->next)
+ if (gh->cmpfp(key, e->key) == 0)
return 1;
return 0;
@@ -170,22 +169,22 @@ int BLI_ghash_haskey(GHash *gh, void *key)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
{
int i;
-
+
if (keyfreefp || valfreefp) {
- for (i=0; i<gh->nbuckets; i++) {
+ for (i = 0; i < gh->nbuckets; i++) {
Entry *e;
-
- for (e= gh->buckets[i]; e; ) {
- Entry *n= e->next;
-
+
+ for (e = gh->buckets[i]; e;) {
+ Entry *n = e->next;
+
if (keyfreefp) keyfreefp(e->key);
if (valfreefp) valfreefp(e->val);
- e= n;
+ e = n;
}
}
}
-
+
MEM_freeN(gh->buckets);
BLI_mempool_destroy(gh->entrypool);
gh->buckets = NULL;
@@ -198,28 +197,28 @@ void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreef
GHashIterator *BLI_ghashIterator_new(GHash *gh)
{
- GHashIterator *ghi= MEM_mallocN(sizeof(*ghi), "ghash iterator");
- ghi->gh= gh;
- ghi->curEntry= NULL;
- ghi->curBucket= -1;
+ GHashIterator *ghi = MEM_mallocN(sizeof(*ghi), "ghash iterator");
+ ghi->gh = gh;
+ ghi->curEntry = NULL;
+ ghi->curBucket = -1;
while (!ghi->curEntry) {
ghi->curBucket++;
- if (ghi->curBucket==ghi->gh->nbuckets)
+ if (ghi->curBucket == ghi->gh->nbuckets)
break;
- ghi->curEntry= ghi->gh->buckets[ghi->curBucket];
+ ghi->curEntry = ghi->gh->buckets[ghi->curBucket];
}
return ghi;
}
void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh)
{
- ghi->gh= gh;
- ghi->curEntry= NULL;
- ghi->curBucket= -1;
+ ghi->gh = gh;
+ ghi->curEntry = NULL;
+ ghi->curBucket = -1;
while (!ghi->curEntry) {
ghi->curBucket++;
- if (ghi->curBucket==ghi->gh->nbuckets)
+ if (ghi->curBucket == ghi->gh->nbuckets)
break;
- ghi->curEntry= ghi->gh->buckets[ghi->curBucket];
+ ghi->curEntry = ghi->gh->buckets[ghi->curBucket];
}
}
void BLI_ghashIterator_free(GHashIterator *ghi)
@@ -229,22 +228,22 @@ void BLI_ghashIterator_free(GHashIterator *ghi)
void *BLI_ghashIterator_getKey(GHashIterator *ghi)
{
- return ghi->curEntry?ghi->curEntry->key:NULL;
+ return ghi->curEntry ? ghi->curEntry->key : NULL;
}
void *BLI_ghashIterator_getValue(GHashIterator *ghi)
{
- return ghi->curEntry?ghi->curEntry->val:NULL;
+ return ghi->curEntry ? ghi->curEntry->val : NULL;
}
void BLI_ghashIterator_step(GHashIterator *ghi)
{
if (ghi->curEntry) {
- ghi->curEntry= ghi->curEntry->next;
+ ghi->curEntry = ghi->curEntry->next;
while (!ghi->curEntry) {
ghi->curBucket++;
- if (ghi->curBucket==ghi->gh->nbuckets)
+ if (ghi->curBucket == ghi->gh->nbuckets)
break;
- ghi->curEntry= ghi->gh->buckets[ghi->curBucket];
+ ghi->curEntry = ghi->gh->buckets[ghi->curBucket];
}
}
}
@@ -261,10 +260,10 @@ unsigned int BLI_ghashutil_ptrhash(const void *key)
}
int BLI_ghashutil_ptrcmp(const void *a, const void *b)
{
- if (a==b)
+ if (a == b)
return 0;
else
- return (a<b)?-1:1;
+ return (a < b) ? -1 : 1;
}
unsigned int BLI_ghashutil_inthash(const void *ptr)
@@ -283,21 +282,22 @@ unsigned int BLI_ghashutil_inthash(const void *ptr)
int BLI_ghashutil_intcmp(const void *a, const void *b)
{
- if (a==b)
+ if (a == b)
return 0;
else
- return (a<b)?-1:1;
+ return (a < b) ? -1 : 1;
}
unsigned int BLI_ghashutil_strhash(const void *ptr)
{
- const char *s= ptr;
- unsigned int i= 0;
+ const char *s = ptr;
+ unsigned int i = 0;
unsigned char c;
-
- while ( (c= *s++) )
- i= i*37 + c;
-
+
+ while ((c = *s++)) {
+ i = i * 37 + c;
+ }
+
return i;
}
int BLI_ghashutil_strcmp(const void *a, const void *b)
@@ -326,7 +326,7 @@ int BLI_ghashutil_paircmp(const void *a, const void *b)
const GHashPair *B = b;
int cmp = BLI_ghashutil_ptrcmp(A->first, B->first);
- if(cmp == 0)
+ if (cmp == 0)
return BLI_ghashutil_intcmp(SET_INT_IN_POINTER(A->second), SET_INT_IN_POINTER(B->second));
return cmp;
}
diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c
index 62a38e7933a..fa7b91b8539 100644
--- a/source/blender/blenlib/intern/BLI_heap.c
+++ b/source/blender/blenlib/intern/BLI_heap.c
@@ -30,12 +30,12 @@
* \ingroup bli
*/
-
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_memarena.h"
#include "BLI_heap.h"
+#include "BLI_utildefines.h"
/***/
@@ -54,27 +54,25 @@ struct Heap {
HeapNode **tree;
};
-#define SWAP(type, a, b) \
- { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
-#define HEAP_PARENT(i) ((i-1)>>1)
-#define HEAP_LEFT(i) ((i<<1)+1)
-#define HEAP_RIGHT(i) ((i<<1)+2)
+#define HEAP_PARENT(i) ((i - 1) >> 1)
+#define HEAP_LEFT(i) ((i << 1) + 1)
+#define HEAP_RIGHT(i) ((i << 1) + 2)
#define HEAP_COMPARE(a, b) (a->value < b->value)
#define HEAP_EQUALS(a, b) (a->value == b->value)
#define HEAP_SWAP(heap, i, j) \
{ \
SWAP(int, heap->tree[i]->index, heap->tree[j]->index); \
- SWAP(HeapNode*, heap->tree[i], heap->tree[j]); \
+ SWAP(HeapNode *, heap->tree[i], heap->tree[j]); \
}
/***/
Heap *BLI_heap_new(void)
{
- Heap *heap = (Heap*)MEM_callocN(sizeof(Heap), "BLIHeap");
+ Heap *heap = (Heap *)MEM_callocN(sizeof(Heap), __func__);
heap->bufsize = 1;
- heap->tree = (HeapNode**)MEM_mallocN(sizeof(HeapNode*), "BLIHeapTree");
- heap->arena = BLI_memarena_new(1<<16, "heap arena");
+ heap->tree = (HeapNode **)MEM_mallocN(sizeof(HeapNode *), "BLIHeapTree");
+ heap->arena = BLI_memarena_new(1 << 16, "heap arena");
return heap;
}
@@ -86,7 +84,7 @@ void BLI_heap_free(Heap *heap, HeapFreeFP ptrfreefp)
if (ptrfreefp)
for (i = 0; i < heap->size; i++)
ptrfreefp(heap->tree[i]->ptr);
-
+
MEM_freeN(heap->tree);
BLI_memarena_free(heap->arena);
MEM_freeN(heap);
@@ -99,11 +97,11 @@ static void BLI_heap_down(Heap *heap, int i)
int l = HEAP_LEFT(i);
int r = HEAP_RIGHT(i);
- smallest = ((l < size) && HEAP_COMPARE(heap->tree[l], heap->tree[i]))? l: i;
+ smallest = ((l < size) && HEAP_COMPARE(heap->tree[l], heap->tree[i])) ? l : i;
if ((r < size) && HEAP_COMPARE(heap->tree[r], heap->tree[smallest]))
smallest = r;
-
+
if (smallest == i)
break;
@@ -130,11 +128,11 @@ HeapNode *BLI_heap_insert(Heap *heap, float value, void *ptr)
HeapNode *node;
if ((heap->size + 1) > heap->bufsize) {
- int newsize = heap->bufsize*2;
+ int newsize = heap->bufsize * 2;
HeapNode **newtree;
- newtree = (HeapNode**)MEM_mallocN(newsize*sizeof(*newtree), "BLIHeapTree");
- memcpy(newtree, heap->tree, sizeof(HeapNode*)*heap->size);
+ newtree = (HeapNode **)MEM_mallocN(newsize * sizeof(*newtree), __func__);
+ memcpy(newtree, heap->tree, sizeof(HeapNode *) * heap->size);
MEM_freeN(heap->tree);
heap->tree = newtree;
@@ -143,10 +141,10 @@ HeapNode *BLI_heap_insert(Heap *heap, float value, void *ptr)
if (heap->freenodes) {
node = heap->freenodes;
- heap->freenodes = (HeapNode*)(((HeapNode*)heap->freenodes)->ptr);
+ heap->freenodes = (HeapNode *)(((HeapNode *)heap->freenodes)->ptr);
}
else
- node = (HeapNode*)BLI_memarena_alloc(heap->arena, sizeof *node);
+ node = (HeapNode *)BLI_memarena_alloc(heap->arena, sizeof *node);
node->value = value;
node->ptr = ptr;
@@ -156,7 +154,7 @@ HeapNode *BLI_heap_insert(Heap *heap, float value, void *ptr)
heap->size++;
- BLI_heap_up(heap, heap->size-1);
+ BLI_heap_up(heap, heap->size - 1);
return node;
}
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index f01777bdce1..cc05a8a2628 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -133,10 +133,10 @@ static float KDOP_AXES[13][3] =
{ \
HEAP_TYPE element = heap[heap_size-1]; \
int child = heap_size-1; \
- while(child != 0) \
+ while (child != 0) \
{ \
int parent = (child-1) / 2; \
- if(PRIORITY(element, heap[parent])) \
+ if (PRIORITY(element, heap[parent])) \
{ \
heap[child] = heap[parent]; \
child = parent; \
@@ -150,13 +150,13 @@ static float KDOP_AXES[13][3] =
{ \
HEAP_TYPE element = heap[heap_size-1]; \
int parent = 0; \
- while(parent < (heap_size-1)/2 ) \
+ while (parent < (heap_size-1)/2 ) \
{ \
int child2 = (parent+1)*2; \
- if(PRIORITY(heap[child2-1], heap[child2])) \
+ if (PRIORITY(heap[child2-1], heap[child2])) \
--child2; \
\
- if(PRIORITY(element, heap[child2])) \
+ if (PRIORITY(element, heap[child2])) \
break; \
\
heap[parent] = heap[child2]; \
@@ -171,10 +171,10 @@ static int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, in
int new_max_size = *max_size * 2;
void *new_memblock = NULL;
- if(new_size <= *max_size)
+ if (new_size <= *max_size)
return TRUE;
- if(*memblock == local_memblock)
+ if (*memblock == local_memblock)
{
new_memblock = malloc( size_per_item * new_max_size );
memcpy( new_memblock, *memblock, size_per_item * *max_size );
@@ -182,7 +182,7 @@ static int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, in
else
new_memblock = realloc(*memblock, size_per_item * new_max_size );
- if(new_memblock)
+ if (new_memblock)
{
*memblock = new_memblock;
*max_size = new_max_size;
@@ -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;
@@ -219,7 +221,7 @@ static void bvh_insertionsort(BVHNode **a, int lo, int hi, int axis)
{
j=i;
t = a[i];
- while((j!=lo) && (t->bv[axis] < (a[j-1])->bv[axis]))
+ while ((j!=lo) && (t->bv[axis] < (a[j-1])->bv[axis]))
{
a[j] = a[j-1];
j--;
@@ -236,7 +238,7 @@ static int bvh_partition(BVHNode **a, int lo, int hi, BVHNode * x, int axis)
while ((a[i])->bv[axis] < x->bv[axis]) i++;
j--;
while (x->bv[axis] < (a[j])->bv[axis]) j--;
- if(!(i < j))
+ if (!(i < j))
return i;
SWAP( BVHNode* , a[i], a[j]);
i++;
@@ -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;
@@ -352,10 +354,10 @@ static void sort_along_axis(BVHTree *tree, int start, int end, int axis)
static int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis)
{
int begin = _begin, end = _end, cut;
- while(end-begin > 3)
+ while (end-begin > 3)
{
cut = bvh_partition(a, begin, end, bvh_medianof3(a, begin, (begin+end)/2, end-1, axis), axis );
- if(cut <= n)
+ if (cut <= n)
begin = cut;
else
end = cut;
@@ -375,7 +377,7 @@ static void build_skip_links(BVHTree *tree, BVHNode *node, BVHNode *left, BVHNod
for (i = 0; i < node->totnode; i++)
{
- if(i+1 < node->totnode)
+ if (i+1 < node->totnode)
build_skip_links(tree, node->children[i], left, node->children[i+1] );
else
build_skip_links(tree, node->children[i], left, right );
@@ -394,7 +396,7 @@ static void create_kdop_hull(BVHTree *tree, BVHNode *node, const float *co, int
int i, k;
// don't init boudings for the moving case
- if(!moving)
+ if (!moving)
{
for (i = tree->start_axis; i < tree->stop_axis; i++)
{
@@ -403,7 +405,7 @@ static void create_kdop_hull(BVHTree *tree, BVHNode *node, const float *co, int
}
}
- for(k = 0; k < numpoints; k++)
+ for (k = 0; k < numpoints; k++)
{
// for all Axes.
for (i = tree->start_axis; i < tree->stop_axis; i++)
@@ -512,14 +514,14 @@ static void node_join(BVHTree *tree, BVHNode *node)
static void bvhtree_print_tree(BVHTree *tree, BVHNode *node, int depth)
{
int i;
- for(i=0; i<depth; i++) printf(" ");
+ for (i=0; i<depth; i++) printf(" ");
printf(" - %d (%ld): ", node->index, node - tree->nodearray);
- for(i=2*tree->start_axis; i<2*tree->stop_axis; i++)
+ for (i=2*tree->start_axis; i<2*tree->stop_axis; i++)
printf("%.3f ", node->bv[i]);
printf("\n");
- for(i=0; i<tree->tree_type; i++)
- if(node->children[i])
+ for (i=0; i<tree->tree_type; i++)
+ if (node->children[i])
bvhtree_print_tree(tree, node->children[i], depth+1);
}
@@ -550,18 +552,18 @@ static void verify_tree(BVHTree *tree)
int i, j, check = 0;
// check the pointer list
- for(i = 0; i < tree->totleaf; i++)
+ for (i = 0; i < tree->totleaf; i++)
{
- if(tree->nodes[i]->parent == NULL)
+ if (tree->nodes[i]->parent == NULL)
printf("Leaf has no parent: %d\n", i);
else
{
- for(j = 0; j < tree->tree_type; j++)
+ for (j = 0; j < tree->tree_type; j++)
{
- if(tree->nodes[i]->parent->children[j] == tree->nodes[i])
+ if (tree->nodes[i]->parent->children[j] == tree->nodes[i])
check = 1;
}
- if(!check)
+ if (!check)
{
printf("Parent child relationship doesn't match: %d\n", i);
}
@@ -570,18 +572,18 @@ static void verify_tree(BVHTree *tree)
}
// check the leaf list
- for(i = 0; i < tree->totleaf; i++)
+ for (i = 0; i < tree->totleaf; i++)
{
- if(tree->nodearray[i].parent == NULL)
+ if (tree->nodearray[i].parent == NULL)
printf("Leaf has no parent: %d\n", i);
else
{
- for(j = 0; j < tree->tree_type; j++)
+ for (j = 0; j < tree->tree_type; j++)
{
- if(tree->nodearray[i].parent->children[j] == &tree->nodearray[i])
+ if (tree->nodearray[i].parent->children[j] == &tree->nodearray[i])
check = 1;
}
- if(!check)
+ if (!check)
{
printf("Parent child relationship doesn't match: %d\n", i);
}
@@ -617,7 +619,7 @@ static void build_implicit_tree_helper(BVHTree *tree, BVHBuildHelper *data)
data->tree_type= tree->tree_type;
//Calculate the smallest tree_type^n such that tree_type^n >= num_leafs
- for(
+ for (
data->leafs_per_child[0] = 1;
data->leafs_per_child[0] < data->totleafs;
data->leafs_per_child[0] *= data->tree_type
@@ -626,7 +628,7 @@ static void build_implicit_tree_helper(BVHTree *tree, BVHBuildHelper *data)
data->branches_on_level[0] = 1;
//We could stop the loop first (but I am lazy to find out when)
- for(depth = 1; depth < 32; depth++)
+ for (depth = 1; depth < 32; depth++)
{
data->branches_on_level[depth] = data->branches_on_level[depth-1] * data->tree_type;
data->leafs_per_child [depth] = data->leafs_per_child [depth-1] / data->tree_type;
@@ -641,9 +643,9 @@ static void build_implicit_tree_helper(BVHTree *tree, BVHBuildHelper *data)
static int implicit_leafs_index(BVHBuildHelper *data, int depth, int child_index)
{
int min_leaf_index = child_index * data->leafs_per_child[depth-1];
- if(min_leaf_index <= data->remain_leafs)
+ if (min_leaf_index <= data->remain_leafs)
return min_leaf_index;
- else if(data->leafs_per_child[depth])
+ else if (data->leafs_per_child[depth])
return data->totleafs - (data->branches_on_level[depth-1] - child_index) * data->leafs_per_child[depth];
else
return data->remain_leafs;
@@ -656,14 +658,14 @@ static int implicit_leafs_index(BVHBuildHelper *data, int depth, int child_index
* Its possible to find the position of the child or the parent with simple maths (multiplication and adittion). This type
* of tree is for example used on heaps.. where node N has its childs at indexs N*2 and N*2+1.
*
- * Altought in this case the tree type is general.. and not know until runtime.
+ * Although in this case the tree type is general.. and not know until runtime.
* tree_type stands for the maximum number of childs that a tree node can have.
* All tree types >= 2 are supported.
*
* Advantages of the used trees include:
* - No need to store child/parent relations (they are implicit);
* - Any node child always has an index greater than the parent;
- * - Brother nodes are sequencial in memory;
+ * - Brother nodes are sequential in memory;
*
*
* Some math relations derived for general implicit trees:
@@ -688,7 +690,7 @@ static int implicit_needed_branches(int tree_type, int leafs)
*
* It arranges the elements in the given partitions such that:
* - any element in partition N is less or equal to any element in partition N+1.
- * - if all elements are diferent all partition will get the same subset of elements
+ * - if all elements are different all partition will get the same subset of elements
* as if the array was sorted.
*
* partition P is described as the elements in the range ( nth[P] , nth[P+1] ]
@@ -698,9 +700,9 @@ static int implicit_needed_branches(int tree_type, int leafs)
static void split_leafs(BVHNode **leafs_array, int *nth, int partitions, int split_axis)
{
int i;
- for(i=0; i < partitions-1; i++)
+ for (i=0; i < partitions-1; i++)
{
- if(nth[i] >= nth[partitions])
+ if (nth[i] >= nth[partitions])
break;
partition_nth_element(leafs_array, nth[i], nth[partitions], nth[i+1], split_axis);
@@ -716,12 +718,12 @@ 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
- * implicit_needed_branches and implicit_leafs_index are auxiliar functions to solve that "optimal-split".
+ * implicit_needed_branches and implicit_leafs_index are auxiliary functions to solve that "optimal-split".
*/
static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array, BVHNode **leafs_array, int num_leafs)
{
@@ -740,7 +742,7 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array,
//Most of bvhtree code relies on 1-leaf trees having at least one branch
//We handle that special case here
- if(num_leafs == 1)
+ if (num_leafs == 1)
{
BVHNode *root = branches_array+0;
refit_kdop_hull(tree, root, 0, num_leafs);
@@ -756,7 +758,7 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array,
build_implicit_tree_helper(tree, &data);
//Loop tree levels (log N) loops
- for(i=1, depth = 1; i <= num_branches; i = i*tree_type + tree_offset, depth++)
+ for (i=1, depth = 1; i <= num_branches; i = i*tree_type + tree_offset, depth++)
{
const int first_of_next_level = i*tree_type + tree_offset;
const int end_j = MIN2(first_of_next_level, num_branches + 1); //index of last branch on this level
@@ -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;
}
@@ -838,10 +836,10 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis)
int numnodes, i;
// theres not support for trees below binary-trees :P
- if(tree_type < 2)
+ if (tree_type < 2)
return NULL;
- if(tree_type > MAX_TREETYPE)
+ if (tree_type > MAX_TREETYPE)
return NULL;
tree = (BVHTree *)MEM_callocN(sizeof(BVHTree), "BVHTree");
@@ -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;
}
@@ -894,21 +885,21 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis)
tree->nodes = (BVHNode **)MEM_callocN(sizeof(BVHNode *)*numnodes, "BVHNodes");
- if(!tree->nodes)
+ if (!tree->nodes)
{
MEM_freeN(tree);
return NULL;
}
tree->nodebv = (float*)MEM_callocN(sizeof(float)* axis * numnodes, "BVHNodeBV");
- if(!tree->nodebv)
+ if (!tree->nodebv)
{
MEM_freeN(tree->nodes);
MEM_freeN(tree);
}
tree->nodechild = (BVHNode**)MEM_callocN(sizeof(BVHNode*) * tree_type * numnodes, "BVHNodeBV");
- if(!tree->nodechild)
+ if (!tree->nodechild)
{
MEM_freeN(tree->nodebv);
MEM_freeN(tree->nodes);
@@ -917,7 +908,7 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis)
tree->nodearray = (BVHNode *)MEM_callocN(sizeof(BVHNode)* numnodes, "BVHNodeArray");
- if(!tree->nodearray)
+ if (!tree->nodearray)
{
MEM_freeN(tree->nodechild);
MEM_freeN(tree->nodebv);
@@ -927,7 +918,7 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis)
}
//link the dynamic bv and child links
- for(i=0; i< numnodes; i++)
+ for (i=0; i< numnodes; i++)
{
tree->nodearray[i].bv = tree->nodebv + i * axis;
tree->nodearray[i].children = tree->nodechild + i * tree_type;
@@ -940,7 +931,7 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis)
void BLI_bvhtree_free(BVHTree *tree)
{
- if(tree)
+ if (tree)
{
MEM_freeN(tree->nodes);
MEM_freeN(tree->nodearray);
@@ -966,7 +957,7 @@ void BLI_bvhtree_balance(BVHTree *tree)
//current code expects the branches to be linked to the nodes array
//we perform that linkage here
tree->totbranch = implicit_needed_branches(tree->tree_type, tree->totleaf);
- for(i = 0; i < tree->totbranch; i++)
+ for (i = 0; i < tree->totbranch; i++)
tree->nodes[tree->totleaf + i] = branches_array + i;
build_skip_links(tree, tree->nodes[tree->totleaf], NULL, NULL);
@@ -979,10 +970,10 @@ int BLI_bvhtree_insert(BVHTree *tree, int index, const float *co, int numpoints)
BVHNode *node = NULL;
// insert should only possible as long as tree->totbranch is 0
- if(tree->totbranch > 0)
+ if (tree->totbranch > 0)
return 0;
- if(tree->totleaf+1 >= MEM_allocN_len(tree->nodes)/sizeof(*(tree->nodes)))
+ if (tree->totleaf+1 >= MEM_allocN_len(tree->nodes)/sizeof(*(tree->nodes)))
return 0;
// TODO check if have enough nodes in array
@@ -1011,14 +1002,14 @@ int BLI_bvhtree_update_node(BVHTree *tree, int index, const float *co, const flo
BVHNode *node= NULL;
// check if index exists
- if(index > tree->totleaf)
+ if (index > tree->totleaf)
return 0;
node = tree->nodearray + index;
create_kdop_hull(tree, node, co, numpoints, 0);
- if(co_moving)
+ if (co_moving)
create_kdop_hull(tree, node, co_moving, numpoints, 1);
// inflate the bv with some epsilon
@@ -1079,26 +1070,26 @@ static void traverse(BVHOverlapData *data, BVHNode *node1, BVHNode *node2)
{
int j;
- if(tree_overlap(node1, node2, data->start_axis, data->stop_axis))
+ if (tree_overlap(node1, node2, data->start_axis, data->stop_axis))
{
// check if node1 is a leaf
- if(!node1->totnode)
+ if (!node1->totnode)
{
// check if node2 is a leaf
- if(!node2->totnode)
+ if (!node2->totnode)
{
- if(node1 == node2)
+ if (node1 == node2)
{
return;
}
- if(data->i >= data->max_overlap)
+ if (data->i >= data->max_overlap)
{
// try to make alloc'ed memory bigger
data->overlap = realloc(data->overlap, sizeof(BVHTreeOverlap)*data->max_overlap*2);
- if(!data->overlap)
+ if (!data->overlap)
{
printf("Out of Memory in traverse\n");
return;
@@ -1114,9 +1105,9 @@ static void traverse(BVHOverlapData *data, BVHNode *node1, BVHNode *node2)
}
else
{
- for(j = 0; j < data->tree2->tree_type; j++)
+ for (j = 0; j < data->tree2->tree_type; j++)
{
- if(node2->children[j])
+ if (node2->children[j])
traverse(data, node1, node2->children[j]);
}
}
@@ -1124,9 +1115,9 @@ static void traverse(BVHOverlapData *data, BVHNode *node1, BVHNode *node2)
else
{
- for(j = 0; j < data->tree2->tree_type; j++)
+ for (j = 0; j < data->tree2->tree_type; j++)
{
- if(node1->children[j])
+ if (node1->children[j])
traverse(data, node1->children[j], node2);
}
}
@@ -1142,16 +1133,16 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, unsigned int
BVHOverlapData **data;
// check for compatibility of both trees (can't compare 14-DOP with 18-DOP)
- if((tree1->axis != tree2->axis) && (tree1->axis == 14 || tree2->axis == 14) && (tree1->axis == 18 || tree2->axis == 18))
+ if ((tree1->axis != tree2->axis) && (tree1->axis == 14 || tree2->axis == 14) && (tree1->axis == 18 || tree2->axis == 18))
return NULL;
// fast check root nodes for collision before doing big splitting + traversal
- if(!tree_overlap(tree1->nodes[tree1->totleaf], tree2->nodes[tree2->totleaf], MIN2(tree1->start_axis, tree2->start_axis), MIN2(tree1->stop_axis, tree2->stop_axis)))
+ if (!tree_overlap(tree1->nodes[tree1->totleaf], tree2->nodes[tree2->totleaf], MIN2(tree1->start_axis, tree2->start_axis), MIN2(tree1->stop_axis, tree2->stop_axis)))
return NULL;
data = MEM_callocN(sizeof(BVHOverlapData *)* tree1->tree_type, "BVHOverlapData_star");
- for(j = 0; j < tree1->tree_type; j++)
+ for (j = 0; j < tree1->tree_type; j++)
{
data[j] = (BVHOverlapData *)MEM_callocN(sizeof(BVHOverlapData), "BVHOverlapData");
@@ -1166,23 +1157,23 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, unsigned int
}
#pragma omp parallel for private(j) schedule(static)
- for(j = 0; j < MIN2(tree1->tree_type, tree1->nodes[tree1->totleaf]->totnode); j++)
+ for (j = 0; j < MIN2(tree1->tree_type, tree1->nodes[tree1->totleaf]->totnode); j++)
{
traverse(data[j], tree1->nodes[tree1->totleaf]->children[j], tree2->nodes[tree2->totleaf]);
}
- for(j = 0; j < tree1->tree_type; j++)
+ for (j = 0; j < tree1->tree_type; j++)
total += data[j]->i;
to = overlap = (BVHTreeOverlap *)MEM_callocN(sizeof(BVHTreeOverlap)*total, "BVHTreeOverlap");
- for(j = 0; j < tree1->tree_type; j++)
+ for (j = 0; j < tree1->tree_type; j++)
{
memcpy(to, data[j]->overlap, data[j]->i*sizeof(BVHTreeOverlap));
to+=data[j]->i;
}
- for(j = 0; j < tree1->tree_type; j++)
+ for (j = 0; j < tree1->tree_type; j++)
{
free(data[j]->overlap);
MEM_freeN(data[j]);
@@ -1200,35 +1191,34 @@ static float calc_nearest_point(const float proj[3], BVHNode *node, float *neare
const float *bv = node->bv;
//nearest on AABB hull
- for(i=0; i != 3; i++, bv += 2)
+ for (i=0; i != 3; i++, bv += 2)
{
- if(bv[0] > proj[i])
+ if (bv[0] > proj[i])
nearest[i] = bv[0];
- else if(bv[1] < proj[i])
+ else if (bv[1] < proj[i])
nearest[i] = bv[1];
else
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)
+ for (i = data->tree->start_axis; i != data->tree->stop_axis; i++, bv+=2)
{
float proj = dot_v3v3( nearest, KDOP_AXES[i]);
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);
}
@@ -1245,9 +1235,9 @@ typedef struct NodeDistance
// TODO: use a priority queue to reduce the number of nodes looked on
static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
{
- if(node->totnode == 0)
+ if (node->totnode == 0)
{
- if(data->callback)
+ if (data->callback)
data->callback(data->userdata , node->index, data->co, &data->nearest);
else
{
@@ -1261,20 +1251,20 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
int i;
float nearest[3];
- if(data->proj[ node->main_axis ] <= node->children[0]->bv[node->main_axis*2+1])
+ if (data->proj[ node->main_axis ] <= node->children[0]->bv[node->main_axis*2+1])
{
- for(i=0; i != node->totnode; i++)
+ for (i=0; i != node->totnode; i++)
{
- if( calc_nearest_point(data->proj, node->children[i], nearest) >= data->nearest.dist) continue;
+ if ( calc_nearest_point(data->proj, node->children[i], nearest) >= data->nearest.dist) continue;
dfs_find_nearest_dfs(data, node->children[i]);
}
}
else
{
- for(i=node->totnode-1; i >= 0 ; i--)
+ for (i=node->totnode-1; i >= 0 ; i--)
{
- if( calc_nearest_point(data->proj, node->children[i], nearest) >= data->nearest.dist) continue;
+ if ( calc_nearest_point(data->proj, node->children[i], nearest) >= data->nearest.dist) continue;
dfs_find_nearest_dfs(data, node->children[i]);
}
}
@@ -1285,7 +1275,7 @@ static void dfs_find_nearest_begin(BVHNearestData *data, BVHNode *node)
{
float nearest[3], sdist;
sdist = calc_nearest_point(data->proj, node, nearest);
- if(sdist >= data->nearest.dist) return;
+ if (sdist >= data->nearest.dist) return;
dfs_find_nearest_dfs(data, node);
}
@@ -1315,7 +1305,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
int callbacks = 0, push_heaps = 0;
- if(node->totnode == 0)
+ if (node->totnode == 0)
{
dfs_find_nearest_dfs(data, node);
return;
@@ -1324,13 +1314,13 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
current.node = node;
current.dist = calc_nearest_point(data->proj, node, nearest);
- while(current.dist < data->nearest.dist)
+ while (current.dist < data->nearest.dist)
{
// printf("%f : %f\n", current.dist, data->nearest.dist);
- for(i=0; i< current.node->totnode; i++)
+ for (i=0; i< current.node->totnode; i++)
{
BVHNode *child = current.node->children[i];
- if(child->totnode == 0)
+ if (child->totnode == 0)
{
callbacks++;
dfs_find_nearest_dfs(data, child);
@@ -1338,12 +1328,12 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
else
{
//adjust heap size
- if(heap_size >= max_heap_size
+ if (heap_size >= max_heap_size
&& ADJUST_MEMORY(default_heap, (void**)&heap, heap_size+1, &max_heap_size, sizeof(heap[0])) == FALSE)
{
printf("WARNING: bvh_find_nearest got out of memory\n");
- if(heap != default_heap)
+ if (heap != default_heap)
free(heap);
return;
@@ -1352,7 +1342,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
heap[heap_size].node = current.node->children[i];
heap[heap_size].dist = calc_nearest_point(data->proj, current.node->children[i], nearest);
- if(heap[heap_size].dist >= data->nearest.dist) continue;
+ if (heap[heap_size].dist >= data->nearest.dist) continue;
heap_size++;
NodeDistance_push_heap(heap, heap_size);
@@ -1361,7 +1351,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
}
}
- if(heap_size == 0) break;
+ if (heap_size == 0) break;
current = heap[0];
NodeDistance_pop_heap(heap, heap_size);
@@ -1371,7 +1361,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
// printf("hsize=%d, callbacks=%d, pushs=%d\n", heap_size, callbacks, push_heaps);
- if(heap != default_heap)
+ if (heap != default_heap)
free(heap);
}
#endif
@@ -1391,12 +1381,12 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *n
data.callback = callback;
data.userdata = userdata;
- for(i = data.tree->start_axis; i != data.tree->stop_axis; i++)
+ for (i = data.tree->start_axis; i != data.tree->stop_axis; i++)
{
data.proj[i] = dot_v3v3(data.co, KDOP_AXES[i]);
}
- if(nearest)
+ if (nearest)
{
memcpy( &data.nearest , nearest, sizeof(*nearest) );
}
@@ -1407,11 +1397,11 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *n
}
//dfs search
- if(root)
+ if (root)
dfs_find_nearest_begin(&data, root);
//copy back results
- if(nearest)
+ if (nearest)
{
memcpy(nearest, &data.nearest, sizeof(*nearest));
}
@@ -1434,12 +1424,12 @@ static float ray_nearest_hit(BVHRayCastData *data, float *bv)
float low = 0, upper = data->hit.dist;
- for(i=0; i != 3; i++, bv += 2)
+ for (i=0; i != 3; i++, bv += 2)
{
- if(data->ray_dot_axis[i] == 0.0f)
+ if (data->ray_dot_axis[i] == 0.0f)
{
//axis aligned ray
- if(data->ray.origin[i] < bv[0] - data->ray.radius
+ if (data->ray.origin[i] < bv[0] - data->ray.radius
|| data->ray.origin[i] > bv[1] + data->ray.radius)
return FLT_MAX;
}
@@ -1448,18 +1438,18 @@ static float ray_nearest_hit(BVHRayCastData *data, float *bv)
float ll = (bv[0] - data->ray.radius - data->ray.origin[i]) / data->ray_dot_axis[i];
float lu = (bv[1] + data->ray.radius - data->ray.origin[i]) / data->ray_dot_axis[i];
- if(data->ray_dot_axis[i] > 0.0f)
+ if (data->ray_dot_axis[i] > 0.0f)
{
- if(ll > low) low = ll;
- if(lu < upper) upper = lu;
+ if (ll > low) low = ll;
+ if (lu < upper) upper = lu;
}
else
{
- if(lu > low) low = lu;
- if(ll < upper) upper = ll;
+ if (lu > low) low = lu;
+ if (ll < upper) upper = ll;
}
- if(low > upper) return FLT_MAX;
+ if (low > upper) return FLT_MAX;
}
}
return low;
@@ -1482,9 +1472,9 @@ static float fast_ray_nearest_hit(const BVHRayCastData *data, const BVHNode *nod
float t1z = (bv[data->index[4]] - data->ray.origin[2]) * data->idot_axis[2];
float t2z = (bv[data->index[5]] - data->ray.origin[2]) * data->idot_axis[2];
- if(t1x > t2y || t2x < t1y || t1x > t2z || t2x < t1z || t1y > t2z || t2y < t1z) return FLT_MAX;
- if(t2x < 0.0f || t2y < 0.0f || t2z < 0.0f) return FLT_MAX;
- if(t1x > data->hit.dist || t1y > data->hit.dist || t1z > data->hit.dist) return FLT_MAX;
+ if (t1x > t2y || t2x < t1y || t1x > t2z || t2x < t1z || t1y > t2z || t2y < t1z) return FLT_MAX;
+ if (t2x < 0.0f || t2y < 0.0f || t2z < 0.0f) return FLT_MAX;
+ if (t1x > data->hit.dist || t1y > data->hit.dist || t1z > data->hit.dist) return FLT_MAX;
dist = t1x;
if (t1y > dist) dist = t1y;
@@ -1498,13 +1488,13 @@ 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;
+ if (dist >= data->hit.dist) return;
- if(node->totnode == 0)
+ if (node->totnode == 0)
{
- if(data->callback)
+ if (data->callback)
data->callback(data->userdata, node->index, &data->ray, &data->hit);
else
{
@@ -1516,16 +1506,16 @@ static void dfs_raycast(BVHRayCastData *data, BVHNode *node)
else
{
//pick loop direction to dive into the tree (based on ray direction and split axis)
- if(data->ray_dot_axis[ (int)node->main_axis ] > 0.0f)
+ if (data->ray_dot_axis[ (int)node->main_axis ] > 0.0f)
{
- for(i=0; i != node->totnode; i++)
+ for (i=0; i != node->totnode; i++)
{
dfs_raycast(data, node->children[i]);
}
}
else
{
- for(i=node->totnode-1; i >= 0; i--)
+ for (i=node->totnode-1; i >= 0; i--)
{
dfs_raycast(data, node->children[i]);
}
@@ -1536,18 +1526,18 @@ static void dfs_raycast(BVHRayCastData *data, BVHNode *node)
#if 0
static void iterative_raycast(BVHRayCastData *data, BVHNode *node)
{
- while(node)
+ while (node)
{
float dist = fast_ray_nearest_hit(data, node);
- if(dist >= data->hit.dist)
+ if (dist >= data->hit.dist)
{
node = node->skip[1];
continue;
}
- if(node->totnode == 0)
+ if (node->totnode == 0)
{
- if(data->callback)
+ if (data->callback)
data->callback(data->userdata, node->index, &data->ray, &data->hit);
else
{
@@ -1583,12 +1573,12 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float dir[3], f
normalize_v3(data.ray.direction);
- for(i=0; i<3; i++)
+ for (i=0; i<3; i++)
{
data.ray_dot_axis[i] = dot_v3v3(data.ray.direction, KDOP_AXES[i]);
data.idot_axis[i] = 1.0f / data.ray_dot_axis[i];
- if(fabsf(data.ray_dot_axis[i]) < FLT_EPSILON)
+ if (fabsf(data.ray_dot_axis[i]) < FLT_EPSILON)
{
data.ray_dot_axis[i] = 0.0;
}
@@ -1599,7 +1589,7 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float dir[3], f
}
- if(hit)
+ if (hit)
memcpy( &data.hit, hit, sizeof(*hit) );
else
{
@@ -1607,14 +1597,14 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float dir[3], f
data.hit.dist = FLT_MAX;
}
- if(root)
+ if (root)
{
dfs_raycast(&data, root);
// iterative_raycast(&data, root);
}
- if(hit)
+ if (hit)
memcpy( hit, &data.hit, sizeof(*hit) );
return data.hit.index;
@@ -1643,7 +1633,7 @@ float BLI_bvhtree_bb_raycast(float *bv, const float light_start[3], const float
dist = ray_nearest_hit(&data, bv);
- if(dist > 0.0f)
+ if (dist > 0.0f)
{
madd_v3_v3v3fl(pos, light_start, data.ray.direction, dist);
}
@@ -1674,7 +1664,7 @@ typedef struct RangeQueryData
static void dfs_range_query(RangeQueryData *data, BVHNode *node)
{
- if(node->totnode == 0)
+ if (node->totnode == 0)
{
#if 0 /*UNUSED*/
//Calculate the node min-coords (if the node was a point then this is the point coordinates)
@@ -1687,17 +1677,17 @@ static void dfs_range_query(RangeQueryData *data, BVHNode *node)
else
{
int i;
- for(i=0; i != node->totnode; i++)
+ for (i=0; i != node->totnode; i++)
{
float nearest[3];
float dist = calc_nearest_point(data->center, node->children[i], nearest);
- if(dist < data->radius)
+ if (dist < data->radius)
{
//Its a leaf.. call the callback
- if(node->children[i]->totnode == 0)
+ if (node->children[i]->totnode == 0)
{
data->hits++;
- data->callback( data->userdata, node->children[i]->index, dist );
+ data->callback(data->userdata, node->children[i]->index, dist);
}
else
dfs_range_query( data, node->children[i] );
@@ -1719,17 +1709,17 @@ int BLI_bvhtree_range_query(BVHTree *tree, const float co[3], float radius, BVHT
data.callback = callback;
data.userdata = userdata;
- if(root != NULL)
+ if (root != NULL)
{
float nearest[3];
float dist = calc_nearest_point(data.center, root, nearest);
- if(dist < data.radius)
+ if (dist < data.radius)
{
//Its a leaf.. call the callback
- if(root->totnode == 0)
+ if (root->totnode == 0)
{
data.hits++;
- data.callback( data.userdata, root->index, dist );
+ data.callback(data.userdata, root->index, dist);
}
else
dfs_range_query( &data, root );
diff --git a/source/blender/blenlib/intern/BLI_kdtree.c b/source/blender/blenlib/intern/BLI_kdtree.c
index 6db21ec14a6..388c61ec9dd 100644
--- a/source/blender/blenlib/intern/BLI_kdtree.c
+++ b/source/blender/blenlib/intern/BLI_kdtree.c
@@ -67,7 +67,7 @@ KDTree *BLI_kdtree_new(int maxsize)
void BLI_kdtree_free(KDTree *tree)
{
- if(tree) {
+ if (tree) {
MEM_freeN(tree->nodes);
MEM_freeN(tree);
}
@@ -79,7 +79,7 @@ void BLI_kdtree_insert(KDTree *tree, int index, float *co, float *nor)
node->index= index;
copy_v3_v3(node->co, co);
- if(nor) copy_v3_v3(node->nor, nor);
+ if (nor) copy_v3_v3(node->nor, nor);
}
static KDTreeNode *kdtree_balance(KDTreeNode *nodes, int totnode, int axis)
@@ -88,9 +88,9 @@ static KDTreeNode *kdtree_balance(KDTreeNode *nodes, int totnode, int axis)
float co;
int left, right, median, i, j;
- if(totnode <= 0)
+ if (totnode <= 0)
return NULL;
- else if(totnode == 1)
+ else if (totnode == 1)
return nodes;
/* quicksort style sorting around median */
@@ -98,23 +98,23 @@ static KDTreeNode *kdtree_balance(KDTreeNode *nodes, int totnode, int axis)
right= totnode-1;
median= totnode/2;
- while(right > left) {
+ while (right > left) {
co= nodes[right].co[axis];
i= left-1;
j= right;
- while(1) {
- while(nodes[++i].co[axis] < co);
- while(nodes[--j].co[axis] > co && j>left);
+ while (1) {
+ while (nodes[++i].co[axis] < co);
+ while (nodes[--j].co[axis] > co && j>left);
- if(i >= j) break;
+ if (i >= j) break;
SWAP(KDTreeNode, nodes[i], nodes[j]);
}
SWAP(KDTreeNode, nodes[i], nodes[right]);
- if(i >= median)
+ if (i >= median)
right= i-1;
- if(i <= median)
+ if (i <= median)
left= i+1;
}
@@ -145,7 +145,7 @@ static float squared_distance(const float v2[3], const float v1[3], float *UNUSE
//if(n1 && n2 && (dot_v3v3(n1, n2) < 0.0f))
/* can someone explain why this is done?*/
- if(n2 && (dot_v3v3(d, n2) < 0.0f)) {
+ if (n2 && (dot_v3v3(d, n2) < 0.0f)) {
dist *= 10.0f;
}
@@ -159,7 +159,7 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *
float min_dist, cur_dist;
int totstack, cur=0;
- if(!tree->root)
+ if (!tree->root)
return -1;
stack= defaultstack;
@@ -169,71 +169,71 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *
min_node= root;
min_dist= squared_distance(root->co,co,root->nor,nor);
- if(co[root->d] < root->co[root->d]) {
- if(root->right)
+ if (co[root->d] < root->co[root->d]) {
+ if (root->right)
stack[cur++]=root->right;
- if(root->left)
+ if (root->left)
stack[cur++]=root->left;
}
else {
- if(root->left)
+ if (root->left)
stack[cur++]=root->left;
- if(root->right)
+ if (root->right)
stack[cur++]=root->right;
}
- while(cur--) {
+ while (cur--) {
node=stack[cur];
cur_dist = node->co[node->d] - co[node->d];
- if(cur_dist<0.0f) {
+ if (cur_dist<0.0f) {
cur_dist= -cur_dist*cur_dist;
- if(-cur_dist<min_dist) {
+ if (-cur_dist<min_dist) {
cur_dist=squared_distance(node->co,co,node->nor,nor);
- if(cur_dist<min_dist) {
+ if (cur_dist<min_dist) {
min_dist=cur_dist;
min_node=node;
}
- if(node->left)
+ if (node->left)
stack[cur++]=node->left;
}
- if(node->right)
+ if (node->right)
stack[cur++]=node->right;
}
- else{
+ else {
cur_dist= cur_dist*cur_dist;
- if(cur_dist<min_dist) {
+ if (cur_dist<min_dist) {
cur_dist=squared_distance(node->co,co,node->nor,nor);
- if(cur_dist<min_dist) {
+ if (cur_dist<min_dist) {
min_dist=cur_dist;
min_node=node;
}
- if(node->right)
+ if (node->right)
stack[cur++]=node->right;
}
- if(node->left)
+ if (node->left)
stack[cur++]=node->left;
}
- if(cur+3 > totstack) {
+ if (cur+3 > totstack) {
KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack");
memcpy(temp,stack,totstack*sizeof(KDTreeNode*));
- if(stack != defaultstack)
+ if (stack != defaultstack)
MEM_freeN(stack);
stack=temp;
totstack+=100;
}
}
- if(nearest) {
+ if (nearest) {
nearest->index= min_node->index;
nearest->dist= sqrt(min_dist);
copy_v3_v3(nearest->co, min_node->co);
}
- if(stack != defaultstack)
+ if (stack != defaultstack)
MEM_freeN(stack);
return min_node->index;
@@ -243,10 +243,10 @@ static void add_nearest(KDTreeNearest *ptn, int *found, int n, int index, float
{
int i;
- if(*found<n) (*found)++;
+ if (*found<n) (*found)++;
- for(i=*found-1; i>0; i--) {
- if(dist >= ptn[i-1].dist)
+ for (i=*found-1; i>0; i--) {
+ if (dist >= ptn[i-1].dist)
break;
else
ptn[i]= ptn[i-1];
@@ -265,7 +265,7 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree
float cur_dist;
int i, totstack, cur=0, found=0;
- if(!tree->root)
+ if (!tree->root)
return 0;
stack= defaultstack;
@@ -276,67 +276,67 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree
cur_dist= squared_distance(root->co,co,root->nor,nor);
add_nearest(nearest,&found,n,root->index,cur_dist,root->co);
- if(co[root->d] < root->co[root->d]) {
- if(root->right)
+ if (co[root->d] < root->co[root->d]) {
+ if (root->right)
stack[cur++]=root->right;
- if(root->left)
+ if (root->left)
stack[cur++]=root->left;
}
else {
- if(root->left)
+ if (root->left)
stack[cur++]=root->left;
- if(root->right)
+ if (root->right)
stack[cur++]=root->right;
}
- while(cur--) {
+ while (cur--) {
node=stack[cur];
cur_dist = node->co[node->d] - co[node->d];
- if(cur_dist<0.0f) {
+ if (cur_dist<0.0f) {
cur_dist= -cur_dist*cur_dist;
- if(found<n || -cur_dist<nearest[found-1].dist) {
+ if (found<n || -cur_dist<nearest[found-1].dist) {
cur_dist=squared_distance(node->co,co,node->nor,nor);
- if(found<n || cur_dist<nearest[found-1].dist)
+ if (found<n || cur_dist<nearest[found-1].dist)
add_nearest(nearest,&found,n,node->index,cur_dist,node->co);
- if(node->left)
+ if (node->left)
stack[cur++]=node->left;
}
- if(node->right)
+ if (node->right)
stack[cur++]=node->right;
}
- else{
+ else {
cur_dist= cur_dist*cur_dist;
- if(found<n || cur_dist<nearest[found-1].dist) {
+ if (found<n || cur_dist<nearest[found-1].dist) {
cur_dist=squared_distance(node->co,co,node->nor,nor);
- if(found<n || cur_dist<nearest[found-1].dist)
+ if (found<n || cur_dist<nearest[found-1].dist)
add_nearest(nearest,&found,n,node->index,cur_dist,node->co);
- if(node->right)
+ if (node->right)
stack[cur++]=node->right;
}
- if(node->left)
+ if (node->left)
stack[cur++]=node->left;
}
- if(cur+3 > totstack) {
+ if (cur+3 > totstack) {
KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack");
memcpy(temp,stack,totstack*sizeof(KDTreeNode*));
- if(stack != defaultstack)
+ if (stack != defaultstack)
MEM_freeN(stack);
stack=temp;
totstack+=100;
}
}
- for(i=0; i<found; i++)
+ for (i=0; i<found; i++)
nearest[i].dist= sqrt(nearest[i].dist);
- if(stack != defaultstack)
+ if (stack != defaultstack)
MEM_freeN(stack);
return found;
@@ -347,9 +347,9 @@ static int range_compare(const void * a, const void * b)
const KDTreeNearest *kda = a;
const KDTreeNearest *kdb = b;
- if(kda->dist < kdb->dist)
+ if (kda->dist < kdb->dist)
return -1;
- else if(kda->dist > kdb->dist)
+ else if (kda->dist > kdb->dist)
return 1;
else
return 0;
@@ -358,10 +358,10 @@ static void add_in_range(KDTreeNearest **ptn, int found, int *totfoundstack, int
{
KDTreeNearest *to;
- if(found+1 > *totfoundstack) {
+ if (found+1 > *totfoundstack) {
KDTreeNearest *temp=MEM_callocN((*totfoundstack+50)*sizeof(KDTreeNode), "psys_treefoundstack");
memcpy(temp, *ptn, *totfoundstack * sizeof(KDTreeNearest));
- if(*ptn)
+ if (*ptn)
MEM_freeN(*ptn);
*ptn = temp;
*totfoundstack+=50;
@@ -381,7 +381,7 @@ int BLI_kdtree_range_search(KDTree *tree, float range, float *co, float *nor, KD
float range2 = range*range, dist2;
int totstack, cur=0, found=0, totfoundstack=0;
- if(!tree || !tree->root)
+ if (!tree || !tree->root)
return 0;
stack= defaultstack;
@@ -389,61 +389,61 @@ int BLI_kdtree_range_search(KDTree *tree, float range, float *co, float *nor, KD
root= tree->root;
- if(co[root->d] + range < root->co[root->d]) {
- if(root->left)
+ if (co[root->d] + range < root->co[root->d]) {
+ if (root->left)
stack[cur++]=root->left;
}
- else if(co[root->d] - range > root->co[root->d]) {
- if(root->right)
+ else if (co[root->d] - range > root->co[root->d]) {
+ if (root->right)
stack[cur++]=root->right;
}
else {
dist2 = squared_distance(root->co, co, root->nor, nor);
- if(dist2 <= range2)
+ if (dist2 <= range2)
add_in_range(&foundstack, found++, &totfoundstack, root->index, dist2, root->co);
- if(root->left)
+ if (root->left)
stack[cur++]=root->left;
- if(root->right)
+ if (root->right)
stack[cur++]=root->right;
}
- while(cur--) {
+ while (cur--) {
node=stack[cur];
- if(co[node->d] + range < node->co[node->d]) {
- if(node->left)
+ if (co[node->d] + range < node->co[node->d]) {
+ if (node->left)
stack[cur++]=node->left;
}
- else if(co[node->d] - range > node->co[node->d]) {
- if(node->right)
+ else if (co[node->d] - range > node->co[node->d]) {
+ if (node->right)
stack[cur++]=node->right;
}
else {
dist2 = squared_distance(node->co, co, node->nor, nor);
- if(dist2 <= range2)
+ if (dist2 <= range2)
add_in_range(&foundstack, found++, &totfoundstack, node->index, dist2, node->co);
- if(node->left)
+ if (node->left)
stack[cur++]=node->left;
- if(node->right)
+ if (node->right)
stack[cur++]=node->right;
}
- if(cur+3 > totstack) {
+ if (cur+3 > totstack) {
KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack");
memcpy(temp,stack,totstack*sizeof(KDTreeNode*));
- if(stack != defaultstack)
+ if (stack != defaultstack)
MEM_freeN(stack);
stack=temp;
totstack+=100;
}
}
- if(stack != defaultstack)
+ if (stack != defaultstack)
MEM_freeN(stack);
- if(found)
+ if (found)
qsort(foundstack, found, sizeof(KDTreeNearest), range_compare);
*nearest = foundstack;
diff --git a/source/blender/blenlib/intern/BLI_linklist.c b/source/blender/blenlib/intern/BLI_linklist.c
index 7529904c1ea..5c7d7089825 100644
--- a/source/blender/blenlib/intern/BLI_linklist.c
+++ b/source/blender/blenlib/intern/BLI_linklist.c
@@ -39,7 +39,8 @@ int BLI_linklist_length(LinkNode *list)
{
if (0) {
return list?(1+BLI_linklist_length(list->next)):0;
- } else {
+ }
+ else {
int len;
for (len=0; list; list= list->next)
@@ -131,7 +132,7 @@ void BLI_linklist_insert_after(LinkNode **listp, void *ptr)
nlink->link = ptr;
- if(node) {
+ if (node) {
nlink->next = node->next;
node->next = nlink;
}
diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c
index 4debe1a4b04..95a007db43e 100644
--- a/source/blender/blenlib/intern/BLI_memarena.c
+++ b/source/blender/blenlib/intern/BLI_memarena.c
@@ -30,8 +30,6 @@
* \ingroup bli
*/
-
-
#include "MEM_guardedalloc.h"
#include "BLI_memarena.h"
@@ -41,31 +39,31 @@ struct MemArena {
unsigned char *curbuf;
int bufsize, cursize;
const char *name;
-
- int use_calloc;
+
+ int use_calloc;
int align;
-
+
LinkNode *bufs;
};
MemArena *BLI_memarena_new(int bufsize, const char *name)
{
- MemArena *ma= MEM_callocN(sizeof(*ma), "memarena");
- ma->bufsize= bufsize;
+ MemArena *ma = MEM_callocN(sizeof(*ma), "memarena");
+ ma->bufsize = bufsize;
ma->align = 8;
- ma->name= name;
-
+ ma->name = name;
+
return ma;
}
void BLI_memarena_use_calloc(MemArena *ma)
{
- ma->use_calloc= 1;
+ ma->use_calloc = 1;
}
void BLI_memarena_use_malloc(MemArena *ma)
{
- ma->use_calloc= 0;
+ ma->use_calloc = 0;
}
void BLI_memarena_use_align(struct MemArena *ma, int align)
@@ -76,47 +74,47 @@ void BLI_memarena_use_align(struct MemArena *ma, int align)
void BLI_memarena_free(MemArena *ma)
{
- BLI_linklist_free(ma->bufs, (void(*)(void*)) MEM_freeN);
+ BLI_linklist_free(ma->bufs, (void(*)(void *))MEM_freeN);
MEM_freeN(ma);
}
- /* amt must be power of two */
-#define PADUP(num, amt) ((num+(amt-1))&~(amt-1))
+/* amt must be power of two */
+#define PADUP(num, amt) ((num + (amt - 1)) &~ (amt-1))
void *BLI_memarena_alloc(MemArena *ma, int size)
{
void *ptr;
- /* ensure proper alignment by rounding
- * size up to multiple of 8 */
- size= PADUP(size, ma->align);
-
- if (size>ma->cursize) {
+ /* ensure proper alignment by rounding
+ * size up to multiple of 8 */
+ size = PADUP(size, ma->align);
+
+ 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;
+ else
+ ma->cursize = ma->bufsize;
- if(ma->use_calloc)
- ma->curbuf= MEM_callocN(ma->cursize, ma->name);
+ if (ma->use_calloc)
+ ma->curbuf = MEM_callocN(ma->cursize, ma->name);
else
- ma->curbuf= MEM_mallocN(ma->cursize, ma->name);
-
+ ma->curbuf = MEM_mallocN(ma->cursize, ma->name);
+
BLI_linklist_prepend(&ma->bufs, ma->curbuf);
/* align alloc'ed memory (needed if align > 8) */
tmp = (unsigned char*)PADUP( (intptr_t) ma->curbuf, ma->align);
ma->cursize -= (tmp - ma->curbuf);
- ma->curbuf = tmp;
+ ma->curbuf = tmp;
}
-
- ptr= ma->curbuf;
- ma->curbuf+= size;
- ma->cursize-= size;
-
+
+ ptr = ma->curbuf;
+ ma->curbuf += size;
+ ma->cursize -= size;
+
return ptr;
}
diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c
index aac36e5b79b..3d16b3af4de 100644
--- a/source/blender/blenlib/intern/BLI_mempool.c
+++ b/source/blender/blenlib/intern/BLI_mempool.c
@@ -45,7 +45,7 @@
#include <string.h>
#include <stdlib.h>
-/* note: copied from BKE_utildefines.h, dont use here because we're in BLI */
+/* note: copied from BKE_utildefines.h, don't use here because we're in BLI */
#ifdef __BIG_ENDIAN__
/* Big Endian */
# define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
@@ -71,120 +71,159 @@ struct BLI_mempool {
int esize; /* element size in bytes */
int csize; /* chunk size in bytes */
int pchunk; /* number of elements per chunk */
- short use_sysmalloc, allow_iter;
+ int flag;
/* keeps aligned to 16 bits */
- BLI_freenode *free; /* free element list. Interleaved into chunk datas.*/
- int totalloc, totused; /* total number of elements allocated in total,
- * and currently in use*/
+ BLI_freenode *free; /* free element list. Interleaved into chunk datas. */
+ int totalloc, totused; /* total number of elements allocated in total,
+ * and currently in use */
};
#define MEMPOOL_ELEM_SIZE_MIN (sizeof(void *) * 2)
-BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk,
- short use_sysmalloc, short allow_iter)
+BLI_mempool *BLI_mempool_create(int esize, int totelem, int pchunk, int flag)
{
- BLI_mempool *pool = NULL;
+ BLI_mempool *pool = NULL;
BLI_freenode *lasttail = NULL, *curnode = NULL;
- int i,j, maxchunks;
+ int i, j, maxchunks;
char *addr;
- if (esize < MEMPOOL_ELEM_SIZE_MIN)
+ /* allocate the pool structure */
+ if (flag & BLI_MEMPOOL_SYSMALLOC) {
+ pool = malloc(sizeof(BLI_mempool));
+ }
+ else {
+ pool = MEM_mallocN(sizeof(BLI_mempool), "memory pool");
+ }
+
+ /* set the elem size */
+ if (esize < MEMPOOL_ELEM_SIZE_MIN) {
esize = MEMPOOL_ELEM_SIZE_MIN;
+ }
+
+ if (flag & BLI_MEMPOOL_ALLOW_ITER) {
+ pool->esize = MAX2(esize, sizeof(BLI_freenode));
+ }
+ else {
+ pool->esize = esize;
+ }
- /*allocate the pool structure*/
- pool = use_sysmalloc ? malloc(sizeof(BLI_mempool)) : MEM_mallocN(sizeof(BLI_mempool), "memory pool");
- pool->esize = allow_iter ? MAX2(esize, sizeof(BLI_freenode)) : esize;
- pool->use_sysmalloc = use_sysmalloc;
+ pool->flag = flag;
pool->pchunk = pchunk;
pool->csize = esize * pchunk;
pool->chunks.first = pool->chunks.last = NULL;
- pool->totused= 0;
- pool->allow_iter= allow_iter;
-
- maxchunks = tote / pchunk + 1;
- if (maxchunks==0) maxchunks = 1;
-
- /*allocate the actual chunks*/
- for (i=0; i < maxchunks; i++) {
- BLI_mempool_chunk *mpchunk = use_sysmalloc ? malloc(sizeof(BLI_mempool_chunk)) : MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk");
+ pool->totused = 0;
+
+ maxchunks = totelem / pchunk + 1;
+ if (maxchunks == 0) {
+ maxchunks = 1;
+ }
+
+ /* allocate the actual chunks */
+ for (i = 0; i < maxchunks; i++) {
+ BLI_mempool_chunk *mpchunk;
+
+ if (flag & BLI_MEMPOOL_SYSMALLOC) {
+ mpchunk = malloc(sizeof(BLI_mempool_chunk));
+ mpchunk->data = malloc(pool->csize);
+ }
+ else {
+ mpchunk = MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk");
+ mpchunk->data = MEM_mallocN(pool->csize, "BLI Mempool Chunk Data");
+ }
+
mpchunk->next = mpchunk->prev = NULL;
- mpchunk->data = use_sysmalloc ? malloc(pool->csize) : MEM_mallocN(pool->csize, "BLI Mempool Chunk Data");
BLI_addtail(&(pool->chunks), mpchunk);
-
- if (i==0) {
- pool->free = mpchunk->data; /*start of the list*/
- if (pool->allow_iter)
+
+ if (i == 0) {
+ pool->free = mpchunk->data; /* start of the list */
+ if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) {
pool->free->freeword = FREEWORD;
+ }
}
- /*loop through the allocated data, building the pointer structures*/
- for (addr = mpchunk->data, j=0; j < pool->pchunk; j++) {
- curnode = ((BLI_freenode*)addr);
+ /* loop through the allocated data, building the pointer structures */
+ for (addr = mpchunk->data, j = 0; j < pool->pchunk; j++) {
+ curnode = ((BLI_freenode *)addr);
addr += pool->esize;
- curnode->next = (BLI_freenode*)addr;
- if (pool->allow_iter) {
- if (j != pool->pchunk-1)
+ curnode->next = (BLI_freenode *)addr;
+ if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) {
+ if (j != pool->pchunk - 1)
curnode->next->freeword = FREEWORD;
curnode->freeword = FREEWORD;
}
}
- /*final pointer in the previously allocated chunk is wrong.*/
+ /* final pointer in the previously allocated chunk is wrong */
if (lasttail) {
lasttail->next = mpchunk->data;
- if (pool->allow_iter)
+ if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) {
lasttail->freeword = FREEWORD;
+ }
}
- /*set the end of this chunks memoryy to the new tail for next iteration*/
+ /* set the end of this chunks memoryy to the new tail for next iteration */
lasttail = curnode;
pool->totalloc += pool->pchunk;
}
- /*terminate the list*/
+ /* terminate the list */
curnode->next = NULL;
return pool;
}
void *BLI_mempool_alloc(BLI_mempool *pool)
{
- void *retval=NULL;
+ void *retval = NULL;
pool->totused++;
if (!(pool->free)) {
- BLI_freenode *curnode=NULL;
+ BLI_freenode *curnode = NULL;
char *addr;
int j;
- /*need to allocate a new chunk*/
- BLI_mempool_chunk *mpchunk = pool->use_sysmalloc ? malloc(sizeof(BLI_mempool_chunk)) : MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk");
+ /* need to allocate a new chunk */
+ BLI_mempool_chunk *mpchunk;
+
+ if (pool->flag & BLI_MEMPOOL_SYSMALLOC) {
+ mpchunk = malloc(sizeof(BLI_mempool_chunk));
+ mpchunk->data = malloc(pool->csize);
+ }
+ else {
+ mpchunk = MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk");
+ mpchunk->data = MEM_mallocN(pool->csize, "BLI_Mempool Chunk Data");
+ }
+
mpchunk->next = mpchunk->prev = NULL;
- mpchunk->data = pool->use_sysmalloc ? malloc(pool->csize) : MEM_mallocN(pool->csize, "BLI_Mempool Chunk Data");
BLI_addtail(&(pool->chunks), mpchunk);
- pool->free = mpchunk->data; /*start of the list*/
- if (pool->allow_iter)
+ pool->free = mpchunk->data; /* start of the list */
+
+ if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) {
pool->free->freeword = FREEWORD;
- for(addr = mpchunk->data, j=0; j < pool->pchunk; j++) {
- curnode = ((BLI_freenode*)addr);
+ }
+
+ for (addr = mpchunk->data, j = 0; j < pool->pchunk; j++) {
+ curnode = ((BLI_freenode *)addr);
addr += pool->esize;
- curnode->next = (BLI_freenode*)addr;
+ curnode->next = (BLI_freenode *)addr;
- if (pool->allow_iter) {
+ if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) {
curnode->freeword = FREEWORD;
- if (j != pool->pchunk-1)
+ if (j != pool->pchunk - 1)
curnode->next->freeword = FREEWORD;
}
}
- curnode->next = NULL; /*terminate the list*/
+ curnode->next = NULL; /* terminate the list */
pool->totalloc += pool->pchunk;
}
retval = pool->free;
- if (pool->allow_iter)
+
+ if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) {
pool->free->freeword = 0x7FFFFFFF;
+ }
pool->free = pool->free->next;
//memset(retval, 0, pool->esize);
@@ -193,51 +232,59 @@ void *BLI_mempool_alloc(BLI_mempool *pool)
void *BLI_mempool_calloc(BLI_mempool *pool)
{
- void *retval= BLI_mempool_alloc(pool);
+ void *retval = BLI_mempool_alloc(pool);
memset(retval, 0, pool->esize);
return retval;
}
-/* doesnt protect against double frees, dont be stupid! */
+/* doesnt protect against double frees, don't be stupid! */
void BLI_mempool_free(BLI_mempool *pool, void *addr)
{
BLI_freenode *newhead = addr;
- if (pool->allow_iter)
+ if (pool->flag & BLI_MEMPOOL_ALLOW_ITER) {
newhead->freeword = FREEWORD;
+ }
+
newhead->next = pool->free;
pool->free = newhead;
pool->totused--;
- /*nothing is in use; free all the chunks except the first*/
+ /* nothing is in use; free all the chunks except the first */
if (pool->totused == 0) {
- BLI_freenode *curnode=NULL;
- char *tmpaddr=NULL;
+ BLI_freenode *curnode = NULL;
+ char *tmpaddr = NULL;
int i;
- BLI_mempool_chunk *mpchunk=NULL;
- BLI_mempool_chunk *first= pool->chunks.first;
+ BLI_mempool_chunk *mpchunk = NULL;
+ BLI_mempool_chunk *first = pool->chunks.first;
BLI_remlink(&pool->chunks, first);
- for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
- if (pool->use_sysmalloc) free(mpchunk->data);
- else MEM_freeN(mpchunk->data);
+ if (pool->flag & BLI_MEMPOOL_SYSMALLOC) {
+ for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
+ free(mpchunk->data);
+ }
+ BLI_freelist(&(pool->chunks));
+ }
+ else {
+ for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
+ MEM_freeN(mpchunk->data);
+ }
+ BLI_freelistN(&(pool->chunks));
}
- pool->use_sysmalloc ? BLI_freelist(&(pool->chunks)) : BLI_freelistN(&(pool->chunks));
-
BLI_addtail(&pool->chunks, first);
pool->totalloc = pool->pchunk;
- pool->free = first->data; /*start of the list*/
- for (tmpaddr = first->data, i=0; i < pool->pchunk; i++) {
- curnode = ((BLI_freenode*)tmpaddr);
+ pool->free = first->data; /* start of the list */
+ for (tmpaddr = first->data, i = 0; i < pool->pchunk; i++) {
+ curnode = ((BLI_freenode *)tmpaddr);
tmpaddr += pool->esize;
- curnode->next = (BLI_freenode*)tmpaddr;
+ curnode->next = (BLI_freenode *)tmpaddr;
}
- curnode->next = NULL; /*terminate the list*/
+ curnode->next = NULL; /* terminate the list */
}
}
@@ -248,7 +295,7 @@ int BLI_mempool_count(BLI_mempool *pool)
void *BLI_mempool_findelem(BLI_mempool *pool, int index)
{
- if (!pool->allow_iter) {
+ if (!(pool->flag & BLI_MEMPOOL_ALLOW_ITER)) {
fprintf(stderr, "%s: Error! you can't iterate over this mempool!\n", __func__);
return NULL;
}
@@ -257,7 +304,9 @@ void *BLI_mempool_findelem(BLI_mempool *pool, int index)
BLI_mempool_iter iter;
void *elem;
BLI_mempool_iternew(pool, &iter);
- for (elem= BLI_mempool_iterstep(&iter); index-- != 0; elem= BLI_mempool_iterstep(&iter)) { };
+ for (elem = BLI_mempool_iterstep(&iter); index-- != 0; elem = BLI_mempool_iterstep(&iter)) {
+ /* do nothing */
+ };
return elem;
}
@@ -266,14 +315,14 @@ void *BLI_mempool_findelem(BLI_mempool *pool, int index)
void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter)
{
- if (!pool->allow_iter) {
+ if (!(pool->flag & BLI_MEMPOOL_ALLOW_ITER)) {
fprintf(stderr, "%s: Error! you can't iterate over this mempool!\n", __func__);
iter->curchunk = NULL;
iter->curindex = 0;
-
+
return;
}
-
+
iter->pool = pool;
iter->curchunk = pool->chunks.first;
iter->curindex = 0;
@@ -285,29 +334,29 @@ void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter)
static void *bli_mempool_iternext(BLI_mempool_iter *iter)
{
void *ret = NULL;
-
+
if (!iter->curchunk || !iter->pool->totused) return NULL;
-
- ret = ((char*)iter->curchunk->data) + iter->pool->esize*iter->curindex;
-
+
+ ret = ((char *)iter->curchunk->data) + iter->pool->esize * iter->curindex;
+
iter->curindex++;
-
+
if (iter->curindex >= iter->pool->pchunk) {
iter->curchunk = iter->curchunk->next;
iter->curindex = 0;
}
-
+
return ret;
}
void *BLI_mempool_iterstep(BLI_mempool_iter *iter)
{
BLI_freenode *ret;
-
+
do {
ret = bli_mempool_iternext(iter);
} while (ret && ret->freeword == FREEWORD);
-
+
return ret;
}
@@ -325,7 +374,7 @@ void *BLI_mempool_iterstep(BLI_mempool_iter *iter)
do {
if (LIKELY(iter->curchunk)) {
- ret = (BLI_freenode *)(((char*)iter->curchunk->data) + iter->pool->esize*iter->curindex);
+ ret = (BLI_freenode *)(((char *)iter->curchunk->data) + iter->pool->esize * iter->curindex);
}
else {
return NULL;
@@ -336,7 +385,7 @@ void *BLI_mempool_iterstep(BLI_mempool_iter *iter)
iter->curchunk = iter->curchunk->next;
}
} while (ret->freeword == FREEWORD);
-
+
return ret;
}
@@ -344,9 +393,9 @@ void *BLI_mempool_iterstep(BLI_mempool_iter *iter)
void BLI_mempool_destroy(BLI_mempool *pool)
{
- BLI_mempool_chunk *mpchunk=NULL;
+ BLI_mempool_chunk *mpchunk = NULL;
- if (pool->use_sysmalloc) {
+ if (pool->flag & BLI_MEMPOOL_SYSMALLOC) {
for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
free(mpchunk->data);
}
diff --git a/source/blender/blenlib/intern/DLRB_tree.c b/source/blender/blenlib/intern/DLRB_tree.c
index b7df06bbf24..0e90042a35f 100644
--- a/source/blender/blenlib/intern/DLRB_tree.c
+++ b/source/blender/blenlib/intern/DLRB_tree.c
@@ -36,7 +36,7 @@
/* *********************************************** */
/* Tree API */
-/* Create a new tree, and initialise as necessary */
+/* Create a new tree, and initialize as necessary */
DLRBT_Tree *BLI_dlrbTree_new (void)
{
/* just allocate for now */
diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c
index cf18fbd57cd..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 spacialy divided
+ * this is really slow, some spatially divided
* data-structure would be better */
- for (box_test=boxarray; box_test != box; box_test++) {
- if BOXINTERSECT(box, box_test) {
+ 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 fdda9166c94..0504ac5be60 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -30,10 +30,10 @@
*/
/* TODO,
- * currently there are some cases we dont support.
+ * currently there are some cases we don't support.
* - passing output paths to the visitor?, like render out.
* - passing sequence strips with many images.
- * - passing directory paths - visitors dont know which path is a dir or a file.
+ * - passing directory paths - visitors don't know which path is a dir or a file.
* */
#include <sys/stat.h>
@@ -41,13 +41,13 @@
#include <string.h>
#include <assert.h>
-/* path/file handeling stuff */
+/* path/file handling stuff */
#ifndef WIN32
- #include <dirent.h>
- #include <unistd.h>
+# include <dirent.h>
+# include <unistd.h>
#else
- #include <io.h>
- #include "BLI_winstuff.h"
+# include <io.h>
+# include "BLI_winstuff.h"
#endif
#include "MEM_guardedalloc.h"
@@ -82,7 +82,7 @@
static int checkMissingFiles_visit_cb(void *userdata, char *UNUSED(path_dst), const char *path_src)
{
- ReportList *reports= (ReportList *)userdata;
+ ReportList *reports = (ReportList *)userdata;
if (!BLI_exists(path_src)) {
BKE_reportf(reports, RPT_WARNING, "Path Not Found \"%s\"", path_src);
@@ -97,8 +97,7 @@ void checkMissingFiles(Main *bmain, ReportList *reports)
bpath_traverse_main(bmain, checkMissingFiles_visit_cb, BPATH_TRAVERSE_ABS, reports);
}
-typedef struct BPathRemap_Data
-{
+typedef struct BPathRemap_Data {
const char *basedir;
ReportList *reports;
@@ -109,17 +108,17 @@ typedef struct BPathRemap_Data
static int makeFilesRelative_visit_cb(void *userdata, char *path_dst, const char *path_src)
{
- BPathRemap_Data *data= (BPathRemap_Data *)userdata;
+ BPathRemap_Data *data = (BPathRemap_Data *)userdata;
data->count_tot++;
- if(strncmp(path_src, "//", 2)==0) {
+ if (strncmp(path_src, "//", 2) == 0) {
return FALSE; /* already relative */
}
else {
strcpy(path_dst, path_src);
BLI_path_rel(path_dst, data->basedir);
- if (strncmp(path_dst, "//", 2)==0) {
+ if (strncmp(path_dst, "//", 2) == 0) {
data->count_changed++;
}
else {
@@ -132,15 +131,15 @@ static int makeFilesRelative_visit_cb(void *userdata, char *path_dst, const char
void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports)
{
- BPathRemap_Data data= {NULL};
+ BPathRemap_Data data = {NULL};
- if(basedir[0] == '\0') {
+ if (basedir[0] == '\0') {
printf("%s: basedir='', this is a bug\n", __func__);
return;
}
- data.basedir= basedir;
- data.reports= reports;
+ data.basedir = basedir;
+ data.reports = reports;
bpath_traverse_main(bmain, makeFilesRelative_visit_cb, 0, (void *)&data);
@@ -151,17 +150,17 @@ void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports)
static int makeFilesAbsolute_visit_cb(void *userdata, char *path_dst, const char *path_src)
{
- BPathRemap_Data *data= (BPathRemap_Data *)userdata;
+ BPathRemap_Data *data = (BPathRemap_Data *)userdata;
data->count_tot++;
- if(strncmp(path_src, "//", 2)!=0) {
+ if (strncmp(path_src, "//", 2) != 0) {
return FALSE; /* already absolute */
}
else {
strcpy(path_dst, path_src);
BLI_path_abs(path_dst, data->basedir);
- if (strncmp(path_dst, "//", 2)!=0) {
+ if (strncmp(path_dst, "//", 2) != 0) {
data->count_changed++;
}
else {
@@ -175,15 +174,15 @@ static int makeFilesAbsolute_visit_cb(void *userdata, char *path_dst, const char
/* similar to makeFilesRelative - keep in sync! */
void makeFilesAbsolute(Main *bmain, const char *basedir, ReportList *reports)
{
- BPathRemap_Data data= {NULL};
+ BPathRemap_Data data = {NULL};
- if(basedir[0] == '\0') {
+ if (basedir[0] == '\0') {
printf("%s: basedir='', this is a bug\n", __func__);
return;
}
- data.basedir= basedir;
- data.reports= reports;
+ data.basedir = basedir;
+ data.reports = reports;
bpath_traverse_main(bmain, makeFilesAbsolute_visit_cb, 0, (void *)&data);
@@ -192,8 +191,7 @@ void makeFilesAbsolute(Main *bmain, const char *basedir, ReportList *reports)
data.count_tot, data.count_changed, data.count_failed);
}
-
-/* find this file recursively, use the biggest file so thumbnails dont get used by mistake
+/* find this file recursively, use the biggest file so thumbnails don't get used by mistake
* - dir: subdir to search
* - filename: set this filename
* - filesize: filesize for the file
@@ -217,30 +215,30 @@ static int findFileRecursive(char *filename_new,
filename_new[0] = '\0';
- dir= opendir(dirname);
+ dir = opendir(dirname);
- if (dir==NULL)
+ if (dir == NULL)
return found;
if (*filesize == -1)
- *filesize= 0; /* dir opened fine */
+ *filesize = 0; /* dir opened fine */
- while ((de= readdir(dir)) != NULL) {
+ while ((de = readdir(dir)) != NULL) {
- if (strcmp(".", de->d_name)==0 || strcmp("..", de->d_name)==0)
+ if (strcmp(".", de->d_name) == 0 || strcmp("..", de->d_name) == 0)
continue;
BLI_join_dirfile(path, sizeof(path), dirname, de->d_name);
if (stat(path, &status) != 0)
- continue; /* cant stat, dont bother with this file, could print debug info here */
+ continue; /* cant stat, don't bother with this file, could print debug info here */
if (S_ISREG(status.st_mode)) { /* is file */
- if (strncmp(filename, de->d_name, FILE_MAX)==0) { /* name matches */
+ if (strncmp(filename, de->d_name, FILE_MAX) == 0) { /* name matches */
/* open the file to read its size */
- size= status.st_size;
+ size = status.st_size;
if ((size > 0) && (size > *filesize)) { /* find the biggest file */
- *filesize= size;
+ *filesize = size;
BLI_strncpy(filename_new, path, FILE_MAX);
found = TRUE;
}
@@ -258,8 +256,7 @@ static int findFileRecursive(char *filename_new,
return found;
}
-typedef struct BPathFind_Data
-{
+typedef struct BPathFind_Data {
const char *basedir;
char searchdir[FILE_MAX];
ReportList *reports;
@@ -267,11 +264,11 @@ typedef struct BPathFind_Data
static int findMissingFiles_visit_cb(void *userdata, char *path_dst, const char *path_src)
{
- BPathFind_Data *data= (BPathFind_Data *)userdata;
+ BPathFind_Data *data = (BPathFind_Data *)userdata;
char filename_new[FILE_MAX];
- int filesize= -1;
- int recur_depth= 0;
+ int filesize = -1;
+ int recur_depth = 0;
int found;
found = findFileRecursive(filename_new,
@@ -298,9 +295,9 @@ static int findMissingFiles_visit_cb(void *userdata, char *path_dst, const char
void findMissingFiles(Main *bmain, const char *searchpath, ReportList *reports)
{
- struct BPathFind_Data data= {NULL};
+ struct BPathFind_Data data = {NULL};
- data.reports= reports;
+ data.reports = reports;
BLI_split_dir_part(searchpath, data.searchdir, sizeof(data.searchdir));
bpath_traverse_main(bmain, findMissingFiles_visit_cb, 0, (void *)&data);
@@ -316,10 +313,10 @@ static int rewrite_path_fixed(char *path, BPathVisitor visit_cb, const char *abs
if (absbase) {
BLI_strncpy(path_src_buf, path, sizeof(path_src_buf));
BLI_path_abs(path_src_buf, absbase);
- path_src= path_src_buf;
+ path_src = path_src_buf;
}
else {
- path_src= path;
+ path_src = path;
}
if (visit_cb(userdata, path_dst, path_src)) {
@@ -364,15 +361,15 @@ static int rewrite_path_alloc(char **path, BPathVisitor visit_cb, const char *ab
if (absbase) {
BLI_strncpy(path_src_buf, *path, sizeof(path_src_buf));
BLI_path_abs(path_src_buf, absbase);
- path_src= path_src_buf;
+ path_src = path_src_buf;
}
else {
- path_src= *path;
+ path_src = *path;
}
if (visit_cb(userdata, path_dst, path_src)) {
MEM_freeN((*path));
- (*path)= BLI_strdup(path_dst);
+ (*path) = BLI_strdup(path_dst);
return TRUE;
}
else {
@@ -384,7 +381,7 @@ static int rewrite_path_alloc(char **path, BPathVisitor visit_cb, const char *ab
void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int flag, void *bpath_user_data)
{
Image *ima;
- const char *absbase= (flag & BPATH_TRAVERSE_ABS) ? ID_BLEND_PATH(bmain, id) : NULL;
+ const char *absbase = (flag & BPATH_TRAVERSE_ABS) ? ID_BLEND_PATH(bmain, id) : NULL;
if ((flag & BPATH_TRAVERSE_SKIP_LIBRARY) && id->lib) {
return;
@@ -412,8 +409,8 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla
#define BPATH_TRAVERSE_POINTCACHE(ptcaches) \
{ \
PointCache *cache; \
- for(cache= (ptcaches).first; cache; cache= cache->next) { \
- if(cache->flag & PTCACHE_DISK_CACHE) { \
+ for (cache= (ptcaches).first; cache; cache= cache->next) { \
+ if (cache->flag & PTCACHE_DISK_CACHE) { \
rewrite_path_fixed(cache->path, \
visit_cb, \
absbase, \
@@ -428,7 +425,6 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla
ModifierData *md;
ParticleSystem *psys;
-
/* do via modifiers instead */
#if 0
if (ob->fluidsimSettings) {
@@ -445,7 +441,7 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla
}
else if (md->type == eModifierType_Smoke) {
SmokeModifierData *smd= (SmokeModifierData *)md;
- if(smd->type & MOD_SMOKE_TYPE_DOMAIN) {
+ if (smd->type & MOD_SMOKE_TYPE_DOMAIN) {
BPATH_TRAVERSE_POINTCACHE(smd->domain->ptcaches[0]);
}
}
@@ -499,7 +495,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)) {
@@ -531,7 +527,7 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla
len= MIN2(1, len);
}
- for(i= 0; i < len; i++, se++) {
+ for (i= 0; i < len; i++, se++) {
rewrite_path_fixed_dirfile(seq->strip->dir, se->name,
visit_cb, absbase, bpath_user_data);
}
@@ -561,7 +557,7 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla
case ID_LI:
{
Library *lib= (Library *)id;
- if(rewrite_path_fixed(lib->name, visit_cb, absbase, bpath_user_data)) {
+ if (rewrite_path_fixed(lib->name, visit_cb, absbase, bpath_user_data)) {
BKE_library_filepath_set(lib, lib->name);
}
}
@@ -581,7 +577,7 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla
void bpath_traverse_id_list(Main *bmain, ListBase *lb, BPathVisitor visit_cb, const int flag, void *bpath_user_data)
{
ID *id;
- for(id= lb->first; id; id= id->next) {
+ for (id = lb->first; id; id = id->next) {
bpath_traverse_id(bmain, id, visit_cb, flag, bpath_user_data);
}
}
@@ -589,18 +585,20 @@ void bpath_traverse_id_list(Main *bmain, ListBase *lb, BPathVisitor visit_cb, co
void bpath_traverse_main(Main *bmain, BPathVisitor visit_cb, const int flag, void *bpath_user_data)
{
ListBase *lbarray[MAX_LIBARRAY];
- int a= set_listbasepointers(bmain, lbarray);
- while(a--) bpath_traverse_id_list(bmain, lbarray[a], visit_cb, flag, bpath_user_data);
+ int a = set_listbasepointers(bmain, lbarray);
+ while (a--) {
+ bpath_traverse_id_list(bmain, lbarray[a], visit_cb, flag, bpath_user_data);
+ }
}
/* 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 */
char filepath[(FILE_MAXDIR * 2) + FILE_MAXFILE];
- const char *base_new= ((char **)pathbase_v)[0];
- const char *base_old= ((char **)pathbase_v)[1];
+ const char *base_new = ((char **)pathbase_v)[0];
+ const char *base_old = ((char **)pathbase_v)[1];
if (strncmp(base_old, "//", 2) == 0) {
printf("%s: error, old base path '%s' is not absolute.\n",
@@ -609,7 +607,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/callbacks.c b/source/blender/blenlib/intern/callbacks.c
index 7e063bc1a18..0cb986d9090 100644
--- a/source/blender/blenlib/intern/callbacks.c
+++ b/source/blender/blenlib/intern/callbacks.c
@@ -33,7 +33,7 @@ void BLI_exec_cb(struct Main *main, struct ID *self, eCbEvent evt)
ListBase *lb= &callback_slots[evt];
bCallbackFuncStore *funcstore;
- for(funcstore= (bCallbackFuncStore *)lb->first; funcstore; funcstore= (bCallbackFuncStore *)funcstore->next) {
+ for (funcstore= (bCallbackFuncStore *)lb->first; funcstore; funcstore= (bCallbackFuncStore *)funcstore->next) {
funcstore->func(main, self, funcstore->arg);
}
}
@@ -53,14 +53,14 @@ void BLI_cb_init(void)
void BLI_cb_finalize(void)
{
eCbEvent evt;
- for(evt= 0; evt < BLI_CB_EVT_TOT; evt++) {
+ for (evt= 0; evt < BLI_CB_EVT_TOT; evt++) {
ListBase *lb= &callback_slots[evt];
bCallbackFuncStore *funcstore;
bCallbackFuncStore *funcstore_next;
- for(funcstore= (bCallbackFuncStore *)lb->first; funcstore; funcstore= funcstore_next) {
+ for (funcstore= (bCallbackFuncStore *)lb->first; funcstore; funcstore= funcstore_next) {
funcstore_next= (bCallbackFuncStore *)funcstore->next;
BLI_remlink(lb, funcstore);
- if(funcstore->alloc) {
+ if (funcstore->alloc) {
MEM_freeN(funcstore);
}
}
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/dynlib.c b/source/blender/blenlib/intern/dynlib.c
index 0bfa5e79eb8..e300d09ffbc 100644
--- a/source/blender/blenlib/intern/dynlib.c
+++ b/source/blender/blenlib/intern/dynlib.c
@@ -44,13 +44,19 @@ struct DynamicLibrary {
#ifdef WIN32
#include <windows.h>
+#include "utf_winfunc.h"
+#include "utfconv.h"
DynamicLibrary *BLI_dynlib_open(char *name)
{
DynamicLibrary *lib;
- void *handle= LoadLibrary(name);
+ void *handle;
+
+ UTF16_ENCODE(name);
+ handle= LoadLibraryW(name_16);
+ UTF16_UN_ENCODE(name);
- if(!handle)
+ if (!handle)
return NULL;
lib= MEM_callocN(sizeof(*lib), "Dynamic Library");
@@ -70,13 +76,13 @@ char *BLI_dynlib_get_error_as_string(DynamicLibrary *lib)
/* if lib is NULL reset the last error code */
err= GetLastError();
- if(!lib)
+ if (!lib)
SetLastError(ERROR_SUCCESS);
- if(err) {
+ if (err) {
static char buf[1024];
- if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
+ if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
buf, sizeof(buf), NULL))
return buf;
@@ -100,7 +106,7 @@ DynamicLibrary *BLI_dynlib_open(char *name)
DynamicLibrary *lib;
void *handle= dlopen(name, RTLD_LAZY);
- if(!handle)
+ if (!handle)
return NULL;
lib= MEM_callocN(sizeof(*lib), "Dynamic Library");
diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c
index df23f792aa3..531a4de361e 100644
--- a/source/blender/blenlib/intern/edgehash.c
+++ b/source/blender/blenlib/intern/edgehash.c
@@ -83,7 +83,7 @@ EdgeHash *BLI_edgehash_new(void)
eh->nbuckets = _ehash_hashsizes[eh->cursize];
eh->buckets = MEM_callocN(eh->nbuckets * sizeof(*eh->buckets), "eh buckets 2");
- eh->epool = BLI_mempool_create(sizeof(EdgeEntry), 512, 512, TRUE, FALSE);
+ eh->epool = BLI_mempool_create(sizeof(EdgeEntry), 512, 512, BLI_MEMPOOL_SYSMALLOC);
return eh;
}
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index ad0478060f2..edb2daf2d62 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -45,14 +45,20 @@
#include <io.h>
#include "BLI_winstuff.h"
#include "BLI_callbacks.h"
+#include "utf_winfunc.h"
+#include "utfconv.h"
#else
#include <unistd.h> // for read close
#include <sys/param.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <sys/stat.h>
#endif
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
+#include "BLI_utildefines.h"
#include "BKE_utildefines.h"
@@ -60,9 +66,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];
@@ -73,26 +79,25 @@ int BLI_file_gzip(const char *from, const char *to)
/* level 1 is very close to 3 (the default) in terms of file size,
* but about twice as fast, best use for speedy saving - campbell */
- gzfile = gzopen(to, "wb1");
- if(gzfile == NULL)
+ gzfile = BLI_gzopen(to, "wb1");
+ if (gzfile == NULL)
return -1;
-
- file = open(from, O_BINARY|O_RDONLY);
- if(file < 0)
+ file = BLI_open(from, O_BINARY|O_RDONLY,0);
+ if (file < 0)
return -2;
- while(1) {
+ while (1) {
readsize = read(file, buffer, sizeof(buffer));
- if(readsize < 0) {
+ if (readsize < 0) {
rval= -2; /* error happened in reading */
fprintf(stderr, "Error reading file %s: %s.\n", from, strerror(errno));
break;
}
- else if(readsize == 0)
+ else if (readsize == 0)
break; /* done reading */
- if(gzwrite(gzfile, buffer, readsize) <= 0) {
+ if (gzwrite(gzfile, buffer, readsize) <= 0) {
rval= -1; /* error happened in writing */
fprintf(stderr, "Error writing gz file %s: %s.\n", to, gzerror(gzfile, &err));
break;
@@ -106,8 +111,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;
@@ -117,29 +122,29 @@ char *BLI_file_ungzip_to_mem(const char *from_file, int *size_r)
size= 0;
- gzfile = gzopen( from_file, "rb" );
-
- for(;;) {
- if(mem==NULL) {
+ gzfile = BLI_gzopen( from_file, "rb" );
+ for (;;) {
+ if (mem==NULL) {
mem= MEM_callocN(chunk_size, "BLI_ungzip_to_mem");
alloc_size= chunk_size;
- } else {
+ }
+ else {
mem= MEM_reallocN(mem, size+chunk_size);
alloc_size+= chunk_size;
}
readsize= gzread(gzfile, mem+size, chunk_size);
- if(readsize>0) {
+ if (readsize>0) {
size+= readsize;
}
else break;
}
- if(size==0) {
+ if (size==0) {
MEM_freeN(mem);
mem= NULL;
}
- else if(alloc_size!=size)
+ else if (alloc_size!=size)
mem= MEM_reallocN(mem, size);
*size_r= size;
@@ -154,14 +159,14 @@ int BLI_file_is_writable(const char *filename)
int file;
/* first try to open without creating */
- file = open(filename, O_BINARY | O_RDWR, 0666);
+ file = BLI_open(filename, O_BINARY | O_RDWR, 0666);
if (file < 0) {
/* now try to open and create. a test without actually
* creating a file would be nice, but how? */
- file = open(filename, O_BINARY | O_RDWR | O_CREAT, 0666);
+ file = BLI_open(filename, O_BINARY | O_RDWR | O_CREAT, 0666);
- if(file < 0) {
+ if (file < 0) {
return 0;
}
else {
@@ -179,13 +184,14 @@ int BLI_file_is_writable(const char *filename)
int BLI_file_touch(const char *file)
{
- FILE *f = fopen(file,"r+b");
+ FILE *f = BLI_fopen(file,"r+b");
if (f != NULL) {
char c = getc(f);
rewind(f);
putc(c,f);
- } else {
- f = fopen(file,"wb");
+ }
+ else {
+ f = BLI_fopen(file,"wb");
}
if (f) {
fclose(f);
@@ -198,21 +204,65 @@ int BLI_file_touch(const char *file)
static char str[MAXPATHLEN+12];
+FILE *BLI_fopen(const char *filename, const char *mode)
+{
+ return ufopen(filename, mode);
+}
+
+gzFile BLI_gzopen(const char *filename, const char *mode)
+{
+ gzFile gzfile;
+ int fi;
+
+ if (!filename || !mode) {return 0;}
+ else
+
+ {
+
+ wchar_t short_name_16 [256];
+ char short_name [256];
+ int i=0;
+ UTF16_ENCODE(filename);
+
+ GetShortPathNameW(filename_16,short_name_16,256);
+
+ for (i=0;i<256;i++) {short_name[i]=short_name_16[i];};
+
+
+ gzfile = gzopen(short_name,mode);
+
+ UTF16_UN_ENCODE(filename);
+
+ }
+ return gzfile;
+}
+
+int BLI_open(const char *filename, int oflag, int pmode)
+{
+ return uopen(filename, oflag, pmode);
+}
+
int BLI_delete(const char *file, int dir, int recursive)
{
int err;
+
+ UTF16_ENCODE(file)
if (recursive) {
callLocalErrorCallBack("Recursive delete is unsupported on Windows");
err= 1;
- } else if (dir) {
- err= !RemoveDirectory(file);
+ }
+ else if (dir) {
+ err= !RemoveDirectoryW(file_16);
if (err) printf ("Unable to remove directory");
- } else {
- err= !DeleteFile(file);
+ }
+ else {
+ err= !DeleteFileW(file_16);
if (err) callLocalErrorCallBack("Unable to delete file");
}
+ UTF16_UN_ENCODE(file)
+
return err;
}
@@ -231,8 +281,13 @@ int BLI_move(const char *file, const char *to)
strcat(str, BLI_last_slash(file) + 1);
}
}
+
+ UTF16_ENCODE(file)
+ UTF16_ENCODE(str)
+ err= !MoveFileW(file_16, str_16);
+ UTF16_UN_ENCODE(str)
+ UTF16_UN_ENCODE(file)
- err= !MoveFile(file, str);
if (err) {
callLocalErrorCallBack("Unable to move file");
printf(" Move from '%s' to '%s' failed\n", file, str);
@@ -258,8 +313,12 @@ int BLI_copy(const char *file, const char *to)
}
}
- err= !CopyFile(file,str,FALSE);
-
+ UTF16_ENCODE(file)
+ UTF16_ENCODE(str)
+ err= !CopyFileW(file_16,str_16,FALSE);
+ UTF16_UN_ENCODE(str)
+ UTF16_UN_ENCODE(file)
+
if (err) {
callLocalErrorCallBack("Unable to copy file!");
printf(" Copy from '%s' to '%s' failed\n", file, str);
@@ -288,7 +347,7 @@ void BLI_dir_create_recursive(const char *dirname)
BLI_strncpy(tmp, dirname, sizeof(tmp));
lslash= BLI_last_slash(tmp);
-
+
if (lslash == tmp + strlen(tmp) - 1) {
*lslash = 0;
}
@@ -302,9 +361,9 @@ void BLI_dir_create_recursive(const char *dirname)
BLI_dir_create_recursive(tmp);
}
- if(dirname[0]) /* patch, this recursive loop tries to create a nameless directory */
- if (!CreateDirectory(dirname, NULL))
- callLocalErrorCallBack("Unable to create directory\n");
+ if (dirname[0]) /* patch, this recursive loop tries to create a nameless directory */
+ if (umkdir(dirname)==-1)
+ printf("Unable to create directory %s\n",dirname);
}
int BLI_rename(const char *from, const char *to)
@@ -313,33 +372,214 @@ int BLI_rename(const char *from, const char *to)
/* make sure the filenames are different (case insensitive) before removing */
if (BLI_exists(to) && BLI_strcasecmp(from, to))
- if(BLI_delete(to, 0, 0)) return 1;
-
- return rename(from, to);
+ if (BLI_delete(to, 0, 0)) return 1;
+
+ return urename(from, to);
}
#else /* The UNIX world */
-/*
- * but the UNIX world is tied to the interface, and the system
- * timer, and... We implement a callback mechanism. The system will
- * have to initialise the callback before the functions will work!
- * */
-static char str[12 + (MAXPATHLEN * 2)];
+enum {
+ /* operation succeeded succeeded */
+ recursiveOp_Callback_OK = 0,
+
+ /* operation requested not to perform recursive digging for current path */
+ recursiveOp_Callback_StopRecurs = 1,
+
+ /* error occured in callback and recursive walking should stop immediately */
+ recursiveOp_Callback_Error = 2
+} recuresiveOp_Callback_Result;
+
+typedef int (*recursiveOp_Callback) (const char *from, const char *to);
+
+/* appending of filename to dir (ensures for buffer size before appending) */
+static void join_dirfile_alloc(char **dst, size_t *alloc_len, const char *dir, const char *file)
+{
+ size_t len = strlen(dir) + strlen(file) + 1;
+
+ if (!*dst)
+ *dst = MEM_callocN(len + 1, "join_dirfile_alloc path");
+ else if (*alloc_len < len)
+ *dst = MEM_reallocN(*dst, len + 1);
+
+ *alloc_len = len;
+
+ BLI_join_dirfile(*dst, len + 1, dir, file);
+}
+
+static char *strip_last_slash(const char *dir)
+{
+ char *result = BLI_strdup(dir);
+ BLI_del_slash(result);
+
+ return result;
+}
+
+static int recursive_operation(const char *startfrom, const char *startto, recursiveOp_Callback callback_dir_pre,
+ recursiveOp_Callback callback_file, recursiveOp_Callback callback_dir_post)
+{
+ struct dirent **dirlist;
+ struct stat st;
+ char *from = NULL, *to = NULL;
+ char *from_path = NULL, *to_path = NULL;
+ size_t from_alloc_len = -1, to_alloc_len = -1;
+ int i, n, ret = 0;
+
+ /* ensure there's no trailing slash in file path */
+ from = strip_last_slash(startfrom);
+ if (startto)
+ to = strip_last_slash(startto);
+
+ ret = lstat(from, &st);
+ if (ret < 0) {
+ /* source wasn't found, nothing to operate with */
+ return ret;
+ }
+
+ if (!S_ISDIR(st.st_mode)) {
+ /* source isn't a directory, can't do recursive walking for it,
+ * so just call file callback and leave */
+ if (callback_file) {
+ ret = callback_file(from, to);
+
+ if (ret != recursiveOp_Callback_OK)
+ ret = -1;
+ }
+
+ MEM_freeN(from);
+ if (to) MEM_freeN(to);
+
+ return ret;
+ }
+
+
+ n = scandir(startfrom, &dirlist, 0, alphasort);
+ if (n < 0) {
+ /* error opening directory for listing */
+ perror("scandir");
+
+ MEM_freeN(from);
+ if (to) MEM_freeN(to);
+
+ return -1;
+ }
+
+ if (callback_dir_pre) {
+ /* call pre-recursive walking directory callback */
+ ret = callback_dir_pre(from, to);
+
+ if (ret != recursiveOp_Callback_OK) {
+ MEM_freeN(from);
+ if (to) free(to);
+
+ if (ret == recursiveOp_Callback_StopRecurs) {
+ /* callback requested not to perform recursive walking, not an error */
+ return 0;
+ }
+
+ return -1;
+ }
+ }
+
+ for (i = 0; i < n; i++) {
+ struct dirent *dirent = dirlist[i];
+
+ if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, "..")) {
+ free(dirent);
+ continue;
+ }
+
+ join_dirfile_alloc(&from_path, &from_alloc_len, from, dirent->d_name);
+
+ if (to)
+ join_dirfile_alloc(&to_path, &to_alloc_len, to, dirent->d_name);
+
+ if (dirent->d_type == DT_DIR) {
+ /* recursively dig into a folder */
+ ret = recursive_operation(from_path, to_path, callback_dir_pre, callback_file, callback_dir_post);
+ }
+ else if (callback_file) {
+ /* call file callback for current path */
+ ret = callback_file(from_path, to_path);
+ if (ret != recursiveOp_Callback_OK)
+ ret = -1;
+ }
+
+ if (ret != 0) {
+ while (i < n)
+ free(dirlist[i]);
+ break;
+ }
+ }
+
+ free(dirlist);
+
+ if (ret == 0) {
+ if (callback_dir_post) {
+ /* call post-recursive directory callback */
+ ret = callback_dir_post(from, to);
+ if (ret != recursiveOp_Callback_OK)
+ ret = -1;
+ }
+ }
+
+ if (from_path) MEM_freeN(from_path);
+ if (to_path) MEM_freeN(to_path);
+
+ MEM_freeN(from);
+ if (to) MEM_freeN(to);
+
+ return ret;
+}
+
+static int delete_callback_post(const char *from, const char *UNUSED(to))
+{
+ if (rmdir(from)) {
+ perror("rmdir");
+
+ return recursiveOp_Callback_Error;
+ }
+
+ return recursiveOp_Callback_OK;
+}
+
+static int delete_single_file(const char *from, const char *UNUSED(to))
+{
+ if (unlink(from)) {
+ perror("unlink");
+
+ return recursiveOp_Callback_Error;
+ }
+
+ return recursiveOp_Callback_OK;
+}
+
+FILE *BLI_fopen(const char *filename, const char *mode)
+{
+ return fopen(filename, mode);
+}
+
+void *BLI_gzopen(const char *filename, const char *mode)
+{
+ return gzopen(filename, mode);
+}
+
+int BLI_open(const char *filename, int oflag, int pmode)
+{
+ return open(filename, oflag, pmode);
+}
int BLI_delete(const char *file, int dir, int recursive)
{
- if(strchr(file, '"')) {
+ if (strchr(file, '"')) {
printf("Error: not deleted file %s because of quote!\n", file);
}
else {
if (recursive) {
- BLI_snprintf(str, sizeof(str), "/bin/rm -rf \"%s\"", file);
- return system(str);
+ return recursive_operation(file, NULL, NULL, delete_single_file, delete_callback_post);
}
else if (dir) {
- BLI_snprintf(str, sizeof(str), "/bin/rmdir \"%s\"", file);
- return system(str);
+ return rmdir(file);
}
else {
return remove(file); //BLI_snprintf(str, sizeof(str), "/bin/rm -f \"%s\"", file);
@@ -348,35 +588,272 @@ int BLI_delete(const char *file, int dir, int recursive)
return -1;
}
+static int check_the_same(const char *path_a, const char *path_b)
+{
+ struct stat st_a, st_b;
+
+ if (lstat(path_a, &st_a))
+ return 0;
+
+ if (lstat(path_b, &st_b))
+ return 0;
+
+ return st_a.st_dev == st_b.st_dev && st_a.st_ino == st_b.st_ino;
+}
+
+static int set_permissions(const char *file, struct stat *st)
+{
+ if (chown(file, st->st_uid, st->st_gid)) {
+ perror("chown");
+ return -1;
+ }
+
+ if (chmod(file, st->st_mode)) {
+ perror("chmod");
+ return -1;
+ }
+
+ return 0;
+}
+
+/* pre-recursive callback for copying operation
+ * creates a destination directory where all source content fill be copied to */
+static int copy_callback_pre(const char *from, const char *to)
+{
+ struct stat st;
+
+ if (check_the_same(from, to)) {
+ fprintf(stderr, "%s: '%s' is the same as '%s'\n", __func__, from, to);
+ return recursiveOp_Callback_Error;
+ }
+
+ if (lstat(from, &st)) {
+ perror("stat");
+ return recursiveOp_Callback_Error;
+ }
+
+ /* create a directory */
+ if (mkdir(to, st.st_mode)) {
+ perror("mkdir");
+ return recursiveOp_Callback_Error;
+ }
+
+ /* set proper owner and group on new directory */
+ if (chown(to, st.st_uid, st.st_gid)) {
+ perror("chown");
+ return recursiveOp_Callback_Error;
+ }
+
+ return recursiveOp_Callback_OK;
+}
+
+static int copy_single_file(const char *from, const char *to)
+{
+ FILE *from_stream, *to_stream;
+ struct stat st;
+ char buf[4096];
+ size_t len;
+
+ if (check_the_same(from, to)) {
+ fprintf(stderr, "%s: '%s' is the same as '%s'\n", __func__, from, to);
+ return recursiveOp_Callback_Error;
+ }
+
+ if (lstat(from, &st)) {
+ perror("lstat");
+ return recursiveOp_Callback_Error;
+ }
+
+ if (S_ISLNK(st.st_mode)) {
+ /* symbolic links should be copied in special way */
+ char *link_buffer;
+ int need_free;
+ ssize_t link_len;
+
+ /* get large enough buffer to read link content */
+ if (st.st_size < sizeof(buf)) {
+ link_buffer = buf;
+ need_free = 0;
+ }
+ else {
+ link_buffer = MEM_callocN(st.st_size+2, "copy_single_file link_buffer");
+ need_free = 1;
+ }
+
+ link_len = readlink(from, link_buffer, st.st_size+1);
+ if (link_len < 0) {
+ perror("readlink");
+
+ if (need_free) MEM_freeN(link_buffer);
+
+ return recursiveOp_Callback_Error;
+ }
+
+ link_buffer[link_len] = 0;
+
+ if (symlink(link_buffer, to)) {
+ perror("symlink");
+ if (need_free) MEM_freeN(link_buffer);
+ return recursiveOp_Callback_Error;
+ }
+
+ if (need_free)
+ MEM_freeN(link_buffer);
+
+ return recursiveOp_Callback_OK;
+ }
+ else if (S_ISCHR (st.st_mode) ||
+ S_ISBLK (st.st_mode) ||
+ S_ISFIFO (st.st_mode) ||
+ S_ISSOCK (st.st_mode))
+ {
+ /* copy special type of file */
+ if (mknod(to, st.st_mode, st.st_rdev)) {
+ perror("mknod");
+ return recursiveOp_Callback_Error;
+ }
+
+ if (set_permissions(to, &st))
+ return recursiveOp_Callback_Error;
+
+ return recursiveOp_Callback_OK;
+ }
+ else if (!S_ISREG(st.st_mode)) {
+ fprintf(stderr, "Copying of this kind of files isn't supported yet\n");
+ return recursiveOp_Callback_Error;
+ }
+
+ from_stream = fopen(from, "rb");
+ if (!from_stream) {
+ perror("fopen");
+ return recursiveOp_Callback_Error;
+ }
+
+ to_stream = fopen(to, "wb");
+ if (!to_stream) {
+ perror("fopen");
+ fclose(from_stream);
+ return recursiveOp_Callback_Error;
+ }
+
+ while ((len = fread(buf, 1, sizeof(buf), from_stream)) > 0) {
+ fwrite(buf, 1, len, to_stream);
+ }
+
+ fclose(to_stream);
+ fclose(from_stream);
+
+ if (set_permissions(to, &st))
+ return recursiveOp_Callback_Error;
+
+ return recursiveOp_Callback_OK;
+}
+
+static int move_callback_pre(const char *from, const char *to)
+{
+ int ret = rename(from, to);
+
+ if (ret)
+ return copy_callback_pre(from, to);
+
+ return recursiveOp_Callback_StopRecurs;
+}
+
+static int move_single_file(const char *from, const char *to)
+{
+ int ret = rename(from, to);
+
+ if (ret)
+ return copy_single_file(from, to);
+
+ return recursiveOp_Callback_OK;
+}
+
int BLI_move(const char *file, const char *to)
{
- BLI_snprintf(str, sizeof(str), "/bin/mv -f \"%s\" \"%s\"", file, to);
+ int ret = recursive_operation(file, to, move_callback_pre, move_single_file, NULL);
- return system(str);
+ if (ret) {
+ return recursive_operation(file, NULL, NULL, delete_single_file, delete_callback_post);
+ }
+
+ return ret;
+}
+
+static char *check_destination(const char *file, const char *to)
+{
+ struct stat st;
+
+ if (!stat(to, &st)) {
+ if (S_ISDIR(st.st_mode)) {
+ char *str, *filename, *path;
+ size_t len = 0;
+
+ str = strip_last_slash(file);
+ filename = BLI_last_slash(str);
+
+ if (!filename) {
+ MEM_freeN(str);
+ return (char*)to;
+ }
+
+ /* skip slash */
+ filename += 1;
+
+ len = strlen(to) + strlen(filename) + 1;
+ path = MEM_callocN(len + 1, "check_destination path");
+ BLI_join_dirfile(path, len + 1, to, filename);
+
+ MEM_freeN(str);
+
+ return path;
+ }
+ }
+
+ return (char*)to;
}
int BLI_copy(const char *file, const char *to)
{
- BLI_snprintf(str, sizeof(str), "/bin/cp -rf \"%s\" \"%s\"", file, to);
+ char *actual_to = check_destination(file, to);
+ int ret;
+
+ ret = recursive_operation(file, actual_to, copy_callback_pre, copy_single_file, NULL);
- return system(str);
+ if (actual_to!=to)
+ MEM_freeN(actual_to);
+
+ return ret;
}
int BLI_create_symlink(const char *file, const char *to)
{
- BLI_snprintf(str, sizeof(str), "/bin/ln -f \"%s\" \"%s\"", file, to);
-
- return system(str);
+ return symlink(to, file);
}
void BLI_dir_create_recursive(const char *dirname)
{
char *lslash;
- char tmp[MAXPATHLEN];
-
+ size_t size;
+#ifdef MAXPATHLEN
+ char static_buf[MAXPATHLEN];
+#endif
+ char *tmp;
+ int needs_free;
+
if (BLI_exists(dirname)) return;
- BLI_strncpy(tmp, dirname, sizeof(tmp));
+#ifdef MAXPATHLEN
+ size = MAXPATHLEN;
+ tmp = static_buf;
+ needs_free = 0;
+#else
+ size = strlen(dirname)+1;
+ tmp = MEM_callocN(size, "BLI_dir_create_recursive tmp");
+ needs_free = 1;
+#endif
+
+ BLI_strncpy(tmp, dirname, size);
lslash= BLI_last_slash(tmp);
if (lslash) {
@@ -385,6 +862,9 @@ void BLI_dir_create_recursive(const char *dirname)
BLI_dir_create_recursive(tmp);
}
+ if (needs_free)
+ MEM_freeN(tmp);
+
mkdir(dirname, 0777);
}
@@ -392,7 +872,8 @@ int BLI_rename(const char *from, const char *to)
{
if (!BLI_exists(from)) return 0;
- if (BLI_exists(to)) if(BLI_delete(to, 0, 0)) return 1;
+ if (BLI_exists(to))
+ if (BLI_delete(to, 0, 0)) return 1;
return rename(from, to);
}
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index 3a0d44db12e..a9a1f2bc57e 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -86,7 +86,7 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
// adjust font size
height= ((double) face->bbox.yMax - (double) face->bbox.yMin);
- if(height != 0.0f)
+ if (height != 0.0f)
scale = 1.0f / height;
else
scale = 1.0f / 1000.0f;
@@ -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;
@@ -121,29 +120,29 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
onpoints = (int *)MEM_callocN((ftoutline.n_contours) * sizeof(int),"onpoints");
// calculate total points of each contour
- for(j = 0; j < ftoutline.n_contours; j++) {
- if(j == 0)
+ for (j = 0; j < ftoutline.n_contours; j++) {
+ if (j == 0)
npoints[j] = ftoutline.contours[j] + 1;
else
npoints[j] = ftoutline.contours[j] - ftoutline.contours[j - 1];
}
// get number of on-curve points for beziertriples (including conic virtual on-points)
- for(j = 0; j < ftoutline.n_contours; j++) {
- for(k = 0; k < npoints[j]; k++) {
- if(j > 0) l = k + ftoutline.contours[j - 1] + 1; else l = k;
- if(ftoutline.tags[l] == FT_Curve_Tag_On)
+ for (j = 0; j < ftoutline.n_contours; j++) {
+ for (k = 0; k < npoints[j]; k++) {
+ if (j > 0) l = k + ftoutline.contours[j - 1] + 1; else l = k;
+ if (ftoutline.tags[l] == FT_Curve_Tag_On)
onpoints[j]++;
- if(k < npoints[j] - 1 )
- if( ftoutline.tags[l] == 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)
onpoints[j]++;
}
}
//contour loop, bezier & conic styles merged
- for(j = 0; j < ftoutline.n_contours; j++) {
+ for (j = 0; j < ftoutline.n_contours; j++) {
// add new curve
nu = (Nurb *)MEM_callocN(sizeof(struct Nurb), "objfnt_nurb");
bezt = (BezTriple *)MEM_callocN((onpoints[j]) * sizeof(BezTriple), "objfnt_bezt");
@@ -157,14 +156,13 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
nu->bezt = bezt;
//individual curve loop, start-end
- for(k = 0; k < npoints[j]; k++) {
- if(j > 0) l = k + ftoutline.contours[j - 1] + 1; else l = k;
- if(k == 0) m = l;
+ for (k = 0; k < npoints[j]; k++) {
+ if (j > 0) l = k + ftoutline.contours[j - 1] + 1; else l = k;
+ 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;
@@ -187,32 +185,37 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
}
//on-curve points
- if(ftoutline.tags[l] == FT_Curve_Tag_On) {
+ if (ftoutline.tags[l] == FT_Curve_Tag_On) {
//left handle
- if(k > 0) {
- if(ftoutline.tags[l - 1] == FT_Curve_Tag_Cubic) {
+ if (k > 0) {
+ if (ftoutline.tags[l - 1] == FT_Curve_Tag_Cubic) {
bezt->vec[0][0] = ftoutline.points[l-1].x* scale;
bezt->vec[0][1] = ftoutline.points[l-1].y* scale;
bezt->h1= HD_FREE;
- } else if(ftoutline.tags[l - 1] == FT_Curve_Tag_Conic) {
+ }
+ else if (ftoutline.tags[l - 1] == FT_Curve_Tag_Conic) {
bezt->vec[0][0] = (ftoutline.points[l].x + (2 * ftoutline.points[l - 1].x))* scale / 3.0f;
bezt->vec[0][1] = (ftoutline.points[l].y + (2 * ftoutline.points[l - 1].y))* scale / 3.0f;
bezt->h1= HD_FREE;
- } else {
+ }
+ else {
bezt->vec[0][0] = ftoutline.points[l].x* scale - (ftoutline.points[l].x - ftoutline.points[l-1].x)* scale / 3.0f;
bezt->vec[0][1] = ftoutline.points[l].y* scale - (ftoutline.points[l].y - ftoutline.points[l-1].y)* scale / 3.0f;
bezt->h1= HD_VECT;
}
- } else { //first point on curve
- if(ftoutline.tags[ftoutline.contours[j]] == FT_Curve_Tag_Cubic) {
+ }
+ else { //first point on curve
+ if (ftoutline.tags[ftoutline.contours[j]] == FT_Curve_Tag_Cubic) {
bezt->vec[0][0] = ftoutline.points[ftoutline.contours[j]].x * scale;
bezt->vec[0][1] = ftoutline.points[ftoutline.contours[j]].y * scale;
bezt->h1= HD_FREE;
- } else if(ftoutline.tags[ftoutline.contours[j]] == FT_Curve_Tag_Conic) {
+ }
+ else if (ftoutline.tags[ftoutline.contours[j]] == FT_Curve_Tag_Conic) {
bezt->vec[0][0] = (ftoutline.points[l].x + (2 * ftoutline.points[ftoutline.contours[j]].x))* scale / 3.0f;
bezt->vec[0][1] = (ftoutline.points[l].y + (2 * ftoutline.points[ftoutline.contours[j]].y))* scale / 3.0f;
bezt->h1= HD_FREE;
- } else {
+ }
+ else {
bezt->vec[0][0] = ftoutline.points[l].x* scale - (ftoutline.points[l].x - ftoutline.points[ftoutline.contours[j]].x)* scale / 3.0f;
bezt->vec[0][1] = ftoutline.points[l].y* scale - (ftoutline.points[l].y - ftoutline.points[ftoutline.contours[j]].y)* scale / 3.0f;
bezt->h1= HD_VECT;
@@ -224,30 +227,35 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
bezt->vec[1][1] = ftoutline.points[l].y* scale;
//right handle
- if(k < (npoints[j] - 1)) {
- if(ftoutline.tags[l+1] == FT_Curve_Tag_Cubic) {
+ if (k < (npoints[j] - 1)) {
+ if (ftoutline.tags[l+1] == FT_Curve_Tag_Cubic) {
bezt->vec[2][0] = ftoutline.points[l+1].x* scale;
bezt->vec[2][1] = ftoutline.points[l+1].y* scale;
bezt->h2= HD_FREE;
- } else if(ftoutline.tags[l+1] == FT_Curve_Tag_Conic) {
+ }
+ else if (ftoutline.tags[l+1] == FT_Curve_Tag_Conic) {
bezt->vec[2][0] = (ftoutline.points[l].x + (2 * ftoutline.points[l+1].x))* scale / 3.0f;
bezt->vec[2][1] = (ftoutline.points[l].y + (2 * ftoutline.points[l+1].y))* scale / 3.0f;
bezt->h2= HD_FREE;
- } else {
+ }
+ else {
bezt->vec[2][0] = ftoutline.points[l].x* scale - (ftoutline.points[l].x - ftoutline.points[l+1].x)* scale / 3.0f;
bezt->vec[2][1] = ftoutline.points[l].y* scale - (ftoutline.points[l].y - ftoutline.points[l+1].y)* scale / 3.0f;
bezt->h2= HD_VECT;
}
- } else { //last point on curve
- if(ftoutline.tags[m] == FT_Curve_Tag_Cubic) {
+ }
+ else { //last point on curve
+ if (ftoutline.tags[m] == FT_Curve_Tag_Cubic) {
bezt->vec[2][0] = ftoutline.points[m].x* scale;
bezt->vec[2][1] = ftoutline.points[m].y* scale;
bezt->h2= HD_FREE;
- } else if(ftoutline.tags[m] == FT_Curve_Tag_Conic) {
+ }
+ else if (ftoutline.tags[m] == FT_Curve_Tag_Conic) {
bezt->vec[2][0] = (ftoutline.points[l].x + (2 * ftoutline.points[m].x))* scale / 3.0f;
bezt->vec[2][1] = (ftoutline.points[l].y + (2 * ftoutline.points[m].y))* scale / 3.0f;
bezt->h2= HD_FREE;
- } else {
+ }
+ else {
bezt->vec[2][0] = ftoutline.points[l].x* scale - (ftoutline.points[l].x - ftoutline.points[m].x)* scale / 3.0f;
bezt->vec[2][1] = ftoutline.points[l].y* scale - (ftoutline.points[l].y - ftoutline.points[m].y)* scale / 3.0f;
bezt->h2= HD_VECT;
@@ -259,7 +267,7 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
// len_squared_v2v2, see if there's a distance between the three points
// len_squared_v2v2 again, to check the angle between the handles
// finally, check if one of them is a vector handle
- if((dist_to_line_v2(bezt->vec[0],bezt->vec[1],bezt->vec[2]) < 0.001f) &&
+ if ((dist_to_line_v2(bezt->vec[0],bezt->vec[1],bezt->vec[2]) < 0.001f) &&
(len_squared_v2v2(bezt->vec[0], bezt->vec[1]) > 0.0001f*0.0001f) &&
(len_squared_v2v2(bezt->vec[1], bezt->vec[2]) > 0.0001f*0.0001f) &&
(len_squared_v2v2(bezt->vec[0], bezt->vec[2]) > 0.0002f*0.0001f) &&
@@ -273,8 +281,8 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
}
}
}
- if(npoints) MEM_freeN(npoints);
- if(onpoints) MEM_freeN(onpoints);
+ if (npoints) MEM_freeN(npoints);
+ if (onpoints) MEM_freeN(onpoints);
}
}
@@ -288,11 +296,10 @@ static int objchr_to_ftvfontdata(VFont *vfont, FT_ULong charcode)
tf= vfont_find_tmpfont(vfont);
// What, no font found. Something strange here
- if(!tf) return FALSE;
+ 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 +329,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,
@@ -337,8 +344,9 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
0,
&face );
- if(err) return NULL;
-/*
+ if (err) return NULL;
+
+#if 0
for ( n = 0; n < face->num_charmaps; n++ )
{
charmap = face->charmaps[n];
@@ -355,7 +363,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 +376,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;
}
@@ -386,14 +391,14 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
err = FT_Set_Charmap( face, found );
- if( err )
+ if ( err )
return NULL;
lcode= charcode= FT_Get_First_Char(face, &glyph_index);
}
// Load characters
- while(charcode < 256)
+ while (charcode < 256)
{
// Generate the font data
freetypechar_to_vchar(face, charcode, vfd);
@@ -402,7 +407,7 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
charcode = FT_Get_Next_Char(face, charcode, &glyph_index);
// Check that we won't start infinite loop
- if(charcode <= lcode)
+ if (charcode <= lcode)
break;
lcode = charcode;
}
@@ -416,13 +421,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,
@@ -430,37 +435,37 @@ static int check_freetypefont(PackedFile * pf)
pf->size,
0,
&face );
- if(err) {
+ if (err) {
success = 0;
//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;
+ if (err) success = 0;
else {
glyph = face->glyph;
if (glyph->format == ft_glyph_format_outline ) {
success = 1;
- } else {
+ }
+ else {
//XXX error("Selected Font has no outline data");
success = 0;
}
@@ -478,7 +483,7 @@ VFontData *BLI_vfontdata_from_freetypefont(PackedFile *pf)
//init Freetype
err = FT_Init_FreeType( &library);
- if(err) {
+ if (err) {
//XXX error("Failed to load the Freetype font library");
return NULL;
}
@@ -499,18 +504,18 @@ int BLI_vfontchar_from_freetypefont(VFont *vfont, unsigned long character)
{
int success = FALSE;
- if(!vfont) return FALSE;
+ if (!vfont) return FALSE;
// Init Freetype
err = FT_Init_FreeType(&library);
- if(err) {
+ if (err) {
//XXX error("Failed to load the Freetype font library");
return 0;
}
// Load the character
success = objchr_to_ftvfontdata(vfont, character);
- if(success == FALSE) return FALSE;
+ if (success == FALSE) return FALSE;
// Free Freetype
FT_Done_FreeType(library);
@@ -533,8 +538,7 @@ typedef struct FT_Outline_
short* contours; /* the contour end points */
int flags; /* outline masks */
-
- } FT_Outline;
+} FT_Outline;
#endif
diff --git a/source/blender/blenlib/intern/graph.c b/source/blender/blenlib/intern/graph.c
index d0d3d0e137e..75131f81ade 100644
--- a/source/blender/blenlib/intern/graph.c
+++ b/source/blender/blenlib/intern/graph.c
@@ -82,7 +82,7 @@ void BLI_flagNodes(BGraph *graph, int flag)
{
BNode *node;
- for(node = graph->nodes.first; node; node = node->next)
+ for (node = graph->nodes.first; node; node = node->next)
{
node->flag = flag;
}
@@ -92,7 +92,7 @@ void BLI_flagArcs(BGraph *graph, int flag)
{
BArc *arc;
- for(arc = graph->arcs.first; arc; arc = arc->next)
+ for (arc = graph->arcs.first; arc; arc = arc->next)
{
arc->flag = flag;
}
@@ -109,7 +109,7 @@ void BLI_buildAdjacencyList(BGraph *graph)
BNode *node;
BArc *arc;
- for(node = graph->nodes.first; node; node = node->next)
+ for (node = graph->nodes.first; node; node = node->next)
{
if (node->arcs != NULL)
{
@@ -122,13 +122,13 @@ void BLI_buildAdjacencyList(BGraph *graph)
node->flag = 0;
}
- for(arc = graph->arcs.first; arc; arc= arc->next)
+ for (arc = graph->arcs.first; arc; arc= arc->next)
{
addArcToNodeAdjacencyList(arc->head, arc);
addArcToNodeAdjacencyList(arc->tail, arc);
}
- for(node = graph->nodes.first; node; node = node->next)
+ for (node = graph->nodes.first; node; node = node->next)
{
if (node->degree != node->flag)
{
@@ -151,7 +151,7 @@ void BLI_rebuildAdjacencyListForNode(BGraph* graph, BNode *node)
/* temporary use to indicate the first index available in the lists */
node->flag = 0;
- for(arc = graph->arcs.first; arc; arc= arc->next)
+ for (arc = graph->arcs.first; arc; arc= arc->next)
{
if (arc->head == node)
{
@@ -173,7 +173,7 @@ void BLI_freeAdjacencyList(BGraph *graph)
{
BNode *node;
- for(node = graph->nodes.first; node; node = node->next)
+ for (node = graph->nodes.first; node; node = node->next)
{
if (node->arcs != NULL)
{
@@ -187,7 +187,7 @@ int BLI_hasAdjacencyList(BGraph *graph)
{
BNode *node;
- for(node = graph->nodes.first; node; node = node->next)
+ for (node = graph->nodes.first; node; node = node->next)
{
if (node->arcs == NULL)
{
@@ -267,9 +267,9 @@ void BLI_removeDoubleNodes(BGraph *graph, float limit)
{
BNode *node_src, *node_replaced;
- for(node_src = graph->nodes.first; node_src; node_src = node_src->next)
+ for (node_src = graph->nodes.first; node_src; node_src = node_src->next)
{
- for(node_replaced = graph->nodes.first; node_replaced; node_replaced = node_replaced->next)
+ for (node_replaced = graph->nodes.first; node_replaced; node_replaced = node_replaced->next)
{
if (node_replaced != node_src && len_v3v3(node_replaced->p, node_src->p) <= limit)
{
@@ -285,7 +285,7 @@ BNode * BLI_FindNodeByPosition(BGraph *graph, float *p, float limit)
BNode *closest_node = NULL, *node;
float min_distance = 0.0f;
- for(node = graph->nodes.first; node; node = node->next)
+ for (node = graph->nodes.first; node; node = node->next)
{
float distance = len_v3v3(p, node->p);
if (distance <= limit && (closest_node == NULL || distance < min_distance))
@@ -308,7 +308,7 @@ static void flagSubgraph(BNode *node, int subgraph)
node->subgraph_index = subgraph;
- for(i = 0; i < node->degree; i++)
+ for (i = 0; i < node->degree; i++)
{
arc = node->arcs[i];
flagSubgraph(BLI_otherNode(arc, node), subgraph);
@@ -326,7 +326,7 @@ int BLI_FlagSubgraphs(BGraph *graph)
BLI_buildAdjacencyList(graph);
}
- for(node = graph->nodes.first; node; node = node->next)
+ for (node = graph->nodes.first; node; node = node->next)
{
node->subgraph_index = 0;
}
@@ -369,7 +369,7 @@ static int detectCycle(BNode *node, BArc *src_arc)
/* mark node as visited */
node->flag = 1;
- for(i = 0; i < node->degree && value == 0; i++)
+ for (i = 0; i < node->degree && value == 0; i++)
{
BArc *arc = node->arcs[i];
@@ -399,7 +399,7 @@ int BLI_isGraphCyclic(BGraph *graph)
BLI_flagNodes(graph, 0);
/* detectCycles in subgraphs */
- for(node = graph->nodes.first; node && value == 0; node = node->next)
+ for (node = graph->nodes.first; node && value == 0; node = node->next)
{
/* only for nodes in subgraphs that haven't been visited yet */
if (node->flag == 0)
@@ -415,7 +415,7 @@ BArc * BLI_findConnectedArc(BGraph *graph, BArc *arc, BNode *v)
{
BArc *nextArc;
- for(nextArc = graph->arcs.first; nextArc; nextArc = nextArc->next)
+ for (nextArc = graph->arcs.first; nextArc; nextArc = nextArc->next)
{
if (arc != nextArc && (nextArc->head == v || nextArc->tail == v))
{
@@ -450,7 +450,7 @@ static int subtreeShape(BNode *node, BArc *rootArc, int include_root)
{
int i;
- for(i = 0; i < node->degree; i++)
+ for (i = 0; i < node->degree; i++)
{
BArc *arc = node->arcs[i];
BNode *newNode = BLI_otherNode(arc, node);
@@ -480,7 +480,7 @@ float BLI_subtreeLength(BNode *node)
node->flag = 0; /* flag node as visited */
- for(i = 0; i < node->degree; i++)
+ for (i = 0; i < node->degree; i++)
{
BArc *arc = node->arcs[i];
BNode *other_node = BLI_otherNode(arc, node);
@@ -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/gsqueue.c b/source/blender/blenlib/intern/gsqueue.c
index c0fa81475c0..2aa51387c48 100644
--- a/source/blender/blenlib/intern/gsqueue.c
+++ b/source/blender/blenlib/intern/gsqueue.c
@@ -64,7 +64,7 @@ int BLI_gsqueue_size(GSQueue *gq)
GSQueueElem *elem;
int size= 0;
- for(elem=gq->head; elem; elem=elem->next)
+ for (elem=gq->head; elem; elem=elem->next)
size++;
return size;
@@ -79,7 +79,8 @@ void BLI_gsqueue_pop(GSQueue *gq, void *item_r)
GSQueueElem *elem= gq->head;
if (elem==gq->tail) {
gq->head= gq->tail= NULL;
- } else {
+ }
+ else {
gq->head= gq->head->next;
}
@@ -92,7 +93,7 @@ void BLI_gsqueue_push(GSQueue *gq, void *item)
/* compare: prevent events added double in row */
if (!BLI_gsqueue_is_empty(gq)) {
- if(0==memcmp(item, &gq->head[1], gq->elem_size))
+ if (0==memcmp(item, &gq->head[1], gq->elem_size))
return;
}
elem= MEM_mallocN(sizeof(*elem)+gq->elem_size, "gqueue_push");
@@ -101,7 +102,8 @@ void BLI_gsqueue_push(GSQueue *gq, void *item)
if (BLI_gsqueue_is_empty(gq)) {
gq->tail= gq->head= elem;
- } else {
+ }
+ else {
gq->tail= gq->tail->next= elem;
}
}
@@ -113,7 +115,8 @@ void BLI_gsqueue_pushback(GSQueue *gq, void *item)
if (BLI_gsqueue_is_empty(gq)) {
gq->head= gq->tail= elem;
- } else {
+ }
+ else {
gq->head= elem;
}
}
diff --git a/source/blender/blenlib/intern/jitter.c b/source/blender/blenlib/intern/jitter.c
index 52733b092d3..fbdf698cc87 100644
--- a/source/blender/blenlib/intern/jitter.c
+++ b/source/blender/blenlib/intern/jitter.c
@@ -55,9 +55,9 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1)
vecx = jit1[j] - x - 1.0f;
vecy = jit1[j+1] - y - 1.0f;
for (k = 3; k>0 ; k--) {
- if( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
+ if ( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
len= sqrt(vecx*vecx + vecy*vecy);
- if(len>0 && len<rad1) {
+ if (len>0 && len<rad1) {
len= len/rad1;
dvecx += vecx/len;
dvecy += vecy/len;
@@ -65,9 +65,9 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1)
}
vecx += 1.0f;
- if( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
+ if ( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
len= sqrt(vecx*vecx + vecy*vecy);
- if(len>0 && len<rad1) {
+ if (len>0 && len<rad1) {
len= len/rad1;
dvecx += vecx/len;
dvecy += vecy/len;
@@ -75,9 +75,9 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1)
}
vecx += 1.0f;
- if( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
+ if ( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
len= sqrt(vecx*vecx + vecy*vecy);
- if(len>0 && len<rad1) {
+ if (len>0 && len<rad1) {
len= len/rad1;
dvecx += vecx/len;
dvecy += vecy/len;
@@ -113,17 +113,17 @@ void BLI_jitterate2(float *jit1, float *jit2, int num, float rad2)
vecx = jit1[j] - x - 1.0f;
vecy = jit1[j+1] - y - 1.0f;
- if( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
+ if ( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
vecx += 1.0f;
- if( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
+ if ( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
vecx += 1.0f;
- if( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
+ if ( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
- if( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
+ if ( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
vecy += 1.0f;
- if( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
+ if ( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
vecy += 1.0f;
- if( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
+ if ( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
}
}
@@ -144,7 +144,7 @@ void BLI_initjit(float *jitarr, int num)
float *jit2, x, rad1, rad2, rad3;
int i;
- if(num==0) return;
+ if (num==0) return;
jit2= MEM_mallocN(12 + 2*sizeof(float)*num, "initjit");
rad1= 1.0f/sqrtf((float)num);
@@ -153,7 +153,7 @@ void BLI_initjit(float *jitarr, int num)
BLI_srand(31415926 + num);
x= 0;
- for(i=0; i<2*num; i+=2) {
+ for (i=0; i<2*num; i+=2) {
jitarr[i]= x+ rad1*(float)(0.5-BLI_drand());
jitarr[i+1]= ((float)i/2)/num +rad1*(float)(0.5-BLI_drand());
x+= rad3;
@@ -169,7 +169,7 @@ void BLI_initjit(float *jitarr, int num)
MEM_freeN(jit2);
/* finally, move jittertab to be centered around (0,0) */
- for(i=0; i<2*num; i+=2) {
+ for (i=0; i<2*num; i+=2) {
jitarr[i] -= 0.5f;
jitarr[i+1] -= 0.5f;
}
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c
index 52fd857d6e4..fecaa507b5c 100644
--- a/source/blender/blenlib/intern/listbase.c
+++ b/source/blender/blenlib/intern/listbase.c
@@ -114,7 +114,7 @@ void BLI_remlink(ListBase *listbase, void *vlink)
int BLI_remlink_safe(ListBase *listbase, void *vlink)
{
- if(BLI_findindex(listbase, vlink) != -1) {
+ if (BLI_findindex(listbase, vlink) != -1) {
BLI_remlink(listbase, vlink);
return 1;
}
@@ -182,16 +182,14 @@ 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;
BLI_remlink(listbase, current);
- while(previous && cmp(previous, current) == 1)
+ while (previous && cmp(previous, current) == 1)
{
previous = previous->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;
@@ -444,7 +457,7 @@ int BLI_findstringindex(const ListBase *listbase, const char *id, const int offs
while (link) {
id_iter= ((const char *)link) + offset;
- if(id[0] == id_iter[0] && strcmp(id, id_iter)==0)
+ if (id[0] == id_iter[0] && strcmp(id, id_iter)==0)
return i;
i++;
link= link->next;
@@ -461,7 +474,7 @@ void BLI_duplicatelist(ListBase *dst, const ListBase *src)
src_link= src->first;
dst->first= dst->last= NULL;
- while(src_link) {
+ while (src_link) {
dst_link= MEM_dupallocN(src_link);
BLI_addtail(dst, dst_link);
diff --git a/source/blender/blenlib/intern/math_base.c b/source/blender/blenlib/intern/math_base.c
index 67c2a989582..9efcb3dbcae 100644
--- a/source/blender/blenlib/intern/math_base.c
+++ b/source/blender/blenlib/intern/math_base.c
@@ -40,7 +40,8 @@ double copysign(double x, double y)
/* use atan2 to distinguish -0. from 0. */
if (y > 0. || (y == 0. && atan2(y, -1.) > 0.)) {
return fabs(x);
- } else {
+ }
+ else {
return -fabs(x);
}
}
@@ -59,7 +60,6 @@ double round(double x)
double round(double x);
#endif
-
/* from python 3.1 floatobject.c
* ndigits must be between 0 and 21 */
double double_round(double x, int ndigits)
@@ -68,7 +68,7 @@ double double_round(double x, int ndigits)
if (ndigits >= 0) {
pow1 = pow(10.0, (double)ndigits);
pow2 = 1.0;
- y = (x*pow1)*pow2;
+ y = (x * pow1) * pow2;
/* if y overflows, then rounded value is exactly x */
if (!finite(y))
return x;
@@ -80,9 +80,9 @@ double double_round(double x, int ndigits)
}
z = round(y);
- if (fabs(y-z) == 0.5)
+ if (fabs(y - z) == 0.5)
/* halfway between two integers; use round-half-even */
- z = 2.0*round(y/2.0);
+ z = 2.0 * round(y / 2.0);
if (ndigits >= 0)
z = (z / pow2) / pow1;
@@ -92,4 +92,3 @@ double double_round(double x, int ndigits)
/* if computation resulted in overflow, raise OverflowError */
return z;
}
-
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c
index 2fd1a506004..58c882e894e 100644
--- a/source/blender/blenlib/intern/math_base_inline.c
+++ b/source/blender/blenlib/intern/math_base_inline.c
@@ -39,70 +39,70 @@
#define __MATH_BASE_INLINE_C__
/* A few small defines. Keep'em local! */
-#define SMALL_NUMBER 1.e-8f
+#define SMALL_NUMBER 1.e-8f
MINLINE float sqrt3f(float f)
{
- if(f==0.0f) return 0.0f;
- if(f<0) return (float)(-exp(log(-f)/3));
- else return (float)(exp(log(f)/3));
+ if (f == 0.0f) return 0.0f;
+ if (f < 0) return (float)(-exp(log(-f) / 3));
+ else return (float)(exp(log(f) / 3));
}
MINLINE double sqrt3d(double d)
{
- if(d==0.0) return 0;
- if(d<0) return -exp(log(-d)/3);
- else return exp(log(d)/3);
+ if (d == 0.0) return 0;
+ if (d < 0) return -exp(log(-d) / 3);
+ else return exp(log(d) / 3);
}
MINLINE float saacos(float fac)
{
- if(fac<= -1.0f) return (float)M_PI;
- else if(fac>=1.0f) return 0.0;
+ if (fac <= -1.0f) return (float)M_PI;
+ else if (fac >= 1.0f) return 0.0;
else return (float)acos(fac);
}
MINLINE float saasin(float fac)
{
- if(fac<= -1.0f) return (float)-M_PI/2.0f;
- else if(fac>=1.0f) return (float)M_PI/2.0f;
+ if (fac <= -1.0f) return (float)-M_PI / 2.0f;
+ else if (fac >= 1.0f) return (float)M_PI / 2.0f;
else return (float)asin(fac);
}
MINLINE float sasqrt(float fac)
{
- if(fac<=0.0f) return 0.0f;
+ if (fac <= 0.0f) return 0.0f;
return (float)sqrt(fac);
}
MINLINE float saacosf(float fac)
{
- if(fac<= -1.0f) return (float)M_PI;
- else if(fac>=1.0f) return 0.0f;
+ if (fac <= -1.0f) return (float)M_PI;
+ else if (fac >= 1.0f) return 0.0f;
else return (float)acosf(fac);
}
MINLINE float saasinf(float fac)
{
- if(fac<= -1.0f) return (float)-M_PI/2.0f;
- else if(fac>=1.0f) return (float)M_PI/2.0f;
+ if (fac <= -1.0f) return (float)-M_PI / 2.0f;
+ else if (fac >= 1.0f) return (float)M_PI / 2.0f;
else return (float)asinf(fac);
}
MINLINE float sasqrtf(float fac)
{
- if(fac<=0.0f) return 0.0f;
+ if (fac <= 0.0f) return 0.0f;
return (float)sqrtf(fac);
}
MINLINE float interpf(float target, float origin, float fac)
{
- return (fac*target) + (1.0f-fac)*origin;
+ return (fac * target) + (1.0f - fac) * origin;
}
/* 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)
{
@@ -125,7 +125,7 @@ MINLINE int power_of_2_max_i(int n)
if (is_power_of_2_i(n))
return n;
- while(!is_power_of_2_i(n))
+ while (!is_power_of_2_i(n))
n = n & (n - 1);
return n * 2;
@@ -139,20 +139,19 @@ MINLINE int power_of_2_min_i(int n)
return n;
}
-
MINLINE float minf(float a, float b)
{
- return (a < b)? a: b;
+ return (a < b) ? a : b;
}
MINLINE float maxf(float a, float b)
{
- return (a > b)? a: b;
+ return (a > b) ? a : b;
}
MINLINE float signf(float f)
{
- return (f < 0.f)? -1.f: 1.f;
+ return (f < 0.f) ? -1.f : 1.f;
}
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index b9772b1f3b4..abd9c1ea5b8 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -17,7 +17,7 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
-
+ *
* The Original Code is: some of this file.
*
* ***** END GPL LICENSE BLOCK *****
@@ -41,51 +41,51 @@ void hsv_to_rgb(float h, float s, float v, float *r, float *g, float *b)
int i;
float f, p, q, t;
- if(s==0.0f) {
+ if (s == 0.0f) {
*r = v;
*g = v;
*b = v;
}
else {
- h= (h - floorf(h))*6.0f;
+ h = (h - floorf(h)) * 6.0f;
i = (int)floorf(h);
f = h - i;
- p = v*(1.0f-s);
- q = v*(1.0f-(s*f));
- t = v*(1.0f-(s*(1.0f-f)));
-
+ p = v * (1.0f - s);
+ q = v * (1.0f - (s * f));
+ t = v * (1.0f - (s * (1.0f - f)));
+
switch (i) {
- case 0 :
- *r = v;
- *g = t;
- *b = p;
- break;
- case 1 :
- *r = q;
- *g = v;
- *b = p;
- break;
- case 2 :
- *r = p;
- *g = v;
- *b = t;
- break;
- case 3 :
- *r = p;
- *g = q;
- *b = v;
- break;
- case 4 :
- *r = t;
- *g = p;
- *b = v;
- break;
- case 5 :
- *r = v;
- *g = p;
- *b = q;
- break;
+ case 0:
+ *r = v;
+ *g = t;
+ *b = p;
+ break;
+ case 1:
+ *r = q;
+ *g = v;
+ *b = p;
+ break;
+ case 2:
+ *r = p;
+ *g = v;
+ *b = t;
+ break;
+ case 3:
+ *r = p;
+ *g = q;
+ *b = v;
+ break;
+ case 4:
+ *r = t;
+ *g = p;
+ *b = v;
+ break;
+ case 5:
+ *r = v;
+ *g = p;
+ *b = q;
+ break;
}
}
}
@@ -93,93 +93,95 @@ void hsv_to_rgb(float h, float s, float v, float *r, float *g, float *b)
void rgb_to_yuv(float r, float g, float b, float *ly, float *lu, float *lv)
{
float y, u, v;
- y= 0.299f*r + 0.587f*g + 0.114f*b;
- u=-0.147f*r - 0.289f*g + 0.436f*b;
- v= 0.615f*r - 0.515f*g - 0.100f*b;
-
- *ly=y;
- *lu=u;
- *lv=v;
+ y = 0.299f * r + 0.587f * g + 0.114f * b;
+ u = -0.147f * r - 0.289f * g + 0.436f * b;
+ v = 0.615f * r - 0.515f * g - 0.100f * b;
+
+ *ly = y;
+ *lu = u;
+ *lv = v;
}
void yuv_to_rgb(float y, float u, float v, float *lr, float *lg, float *lb)
{
float r, g, b;
- r=y+1.140f*v;
- g=y-0.394f*u - 0.581f*v;
- b=y+2.032f*u;
-
- *lr=r;
- *lg=g;
- *lb=b;
+ r = y + 1.140f * v;
+ g = y - 0.394f * u - 0.581f * v;
+ b = y + 2.032f * u;
+
+ *lr = r;
+ *lg = g;
+ *lb = b;
}
-/* The RGB inputs are supposed gamma corrected and in the range 0 - 1.0f */
-/* Output YCC have a range of 16-235 and 16-240 except with JFIF_0_255 where the range is 0-255 */
+/* The RGB inputs are supposed gamma corrected and in the range 0 - 1.0f
+ *
+ * Output YCC have a range of 16-235 and 16-240 except with JFIF_0_255 where the range is 0-255 */
void rgb_to_ycc(float r, float g, float b, float *ly, float *lcb, float *lcr, int colorspace)
{
- float sr,sg, sb;
+ float sr, sg, sb;
float y = 128.f, cr = 128.f, cb = 128.f;
-
- sr=255.0f*r;
- sg=255.0f*g;
- sb=255.0f*b;
-
+
+ sr = 255.0f * r;
+ sg = 255.0f * g;
+ sb = 255.0f * b;
+
switch (colorspace) {
- case BLI_YCC_ITU_BT601 :
- y=(0.257f*sr)+(0.504f*sg)+(0.098f*sb)+16.0f;
- cb=(-0.148f*sr)-(0.291f*sg)+(0.439f*sb)+128.0f;
- cr=(0.439f*sr)-(0.368f*sg)-(0.071f*sb)+128.0f;
- break;
- case BLI_YCC_ITU_BT709 :
- y=(0.183f*sr)+(0.614f*sg)+(0.062f*sb)+16.0f;
- cb=(-0.101f*sr)-(0.338f*sg)+(0.439f*sb)+128.0f;
- cr=(0.439f*sr)-(0.399f*sg)-(0.040f*sb)+128.0f;
- break;
- case BLI_YCC_JFIF_0_255 :
- y=(0.299f*sr)+(0.587f*sg)+(0.114f*sb);
- cb=(-0.16874f*sr)-(0.33126f*sg)+(0.5f*sb)+128.0f;
- cr=(0.5f*sr)-(0.41869f*sg)-(0.08131f*sb)+128.0f;
- break;
- default:
- assert(!"invalid colorspace");
+ case BLI_YCC_ITU_BT601:
+ y = (0.257f * sr) + (0.504f * sg) + (0.098f * sb) + 16.0f;
+ cb = (-0.148f * sr) - (0.291f * sg) + (0.439f * sb) + 128.0f;
+ cr = (0.439f * sr) - (0.368f * sg) - (0.071f * sb) + 128.0f;
+ break;
+ case BLI_YCC_ITU_BT709:
+ y = (0.183f * sr) + (0.614f * sg) + (0.062f * sb) + 16.0f;
+ cb = (-0.101f * sr) - (0.338f * sg) + (0.439f * sb) + 128.0f;
+ cr = (0.439f * sr) - (0.399f * sg) - (0.040f * sb) + 128.0f;
+ break;
+ case BLI_YCC_JFIF_0_255:
+ y = (0.299f * sr) + (0.587f * sg) + (0.114f * sb);
+ cb = (-0.16874f * sr) - (0.33126f * sg) + (0.5f * sb) + 128.0f;
+ cr = (0.5f * sr) - (0.41869f * sg) - (0.08131f * sb) + 128.0f;
+ break;
+ default:
+ assert(!"invalid colorspace");
}
-
- *ly=y;
- *lcb=cb;
- *lcr=cr;
+
+ *ly = y;
+ *lcb = cb;
+ *lcr = cr;
}
/* YCC input have a range of 16-235 and 16-240 except with JFIF_0_255 where the range is 0-255 */
/* RGB outputs are in the range 0 - 1.0f */
+
/* FIXME comment above must be wrong because BLI_YCC_ITU_BT601 y 16.0 cr 16.0 -> r -0.7009 */
void ycc_to_rgb(float y, float cb, float cr, float *lr, float *lg, float *lb, int colorspace)
{
float r = 128.f, g = 128.f, b = 128.f;
-
+
switch (colorspace) {
- case BLI_YCC_ITU_BT601 :
- r=1.164f*(y-16.0f)+1.596f*(cr-128.0f);
- g=1.164f*(y-16.0f)-0.813f*(cr-128.0f)-0.392f*(cb-128.0f);
- b=1.164f*(y-16.0f)+2.017f*(cb-128.0f);
- break;
- case BLI_YCC_ITU_BT709 :
- r=1.164f*(y-16.0f)+1.793f*(cr-128.0f);
- g=1.164f*(y-16.0f)-0.534f*(cr-128.0f)-0.213f*(cb-128.0f);
- b=1.164f*(y-16.0f)+2.115f*(cb-128.0f);
- break;
- case BLI_YCC_JFIF_0_255 :
- r=y+1.402f*cr - 179.456f;
- g=y-0.34414f*cb - 0.71414f*cr + 135.45984f;
- b=y+1.772f*cb - 226.816f;
- break;
- default:
- assert(!"invalid colorspace");
+ case BLI_YCC_ITU_BT601:
+ r = 1.164f * (y - 16.0f) + 1.596f * (cr - 128.0f);
+ g = 1.164f * (y - 16.0f) - 0.813f * (cr - 128.0f) - 0.392f * (cb - 128.0f);
+ b = 1.164f * (y - 16.0f) + 2.017f * (cb - 128.0f);
+ break;
+ case BLI_YCC_ITU_BT709:
+ r = 1.164f * (y - 16.0f) + 1.793f * (cr - 128.0f);
+ g = 1.164f * (y - 16.0f) - 0.534f * (cr - 128.0f) - 0.213f * (cb - 128.0f);
+ b = 1.164f * (y - 16.0f) + 2.115f * (cb - 128.0f);
+ break;
+ case BLI_YCC_JFIF_0_255:
+ r = y + 1.402f * cr - 179.456f;
+ g = y - 0.34414f * cb - 0.71414f * cr + 135.45984f;
+ b = y + 1.772f * cb - 226.816f;
+ break;
+ default:
+ assert(!"invalid colorspace");
}
- *lr=r/255.0f;
- *lg=g/255.0f;
- *lb=b/255.0f;
+ *lr = r / 255.0f;
+ *lg = g / 255.0f;
+ *lb = b / 255.0f;
}
void hex_to_rgb(char *hexcol, float *r, float *g, float *b)
@@ -188,7 +190,7 @@ void hex_to_rgb(char *hexcol, float *r, float *g, float *b)
if (hexcol[0] == '#') hexcol++;
- if (sscanf(hexcol, "%02x%02x%02x", &ri, &gi, &bi)==3) {
+ if (sscanf(hexcol, "%02x%02x%02x", &ri, &gi, &bi) == 3) {
*r = ri / 255.0f;
*g = gi / 255.0f;
*b = bi / 255.0f;
@@ -198,7 +200,7 @@ void hex_to_rgb(char *hexcol, float *r, float *g, float *b)
}
else {
/* avoid using un-initialized vars */
- *r= *g= *b= 0.0f;
+ *r = *g = *b = 0.0f;
}
}
@@ -210,59 +212,63 @@ void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv)
cmax = r;
cmin = r;
- cmax = (g>cmax ? g:cmax);
- cmin = (g<cmin ? g:cmin);
- cmax = (b>cmax ? b:cmax);
- cmin = (b<cmin ? b:cmin);
+ cmax = (g > cmax ? g : cmax);
+ cmin = (g < cmin ? g : cmin);
+ cmax = (b > cmax ? b : cmax);
+ cmin = (b < cmin ? b : cmin);
- v = cmax; /* value */
+ v = cmax; /* value */
if (cmax != 0.0f)
- s = (cmax - cmin)/cmax;
+ s = (cmax - cmin) / cmax;
else {
s = 0.0f;
}
if (s == 0.0f)
h = -1.0f;
else {
- cdelta = cmax-cmin;
- rc = (cmax-r)/cdelta;
- gc = (cmax-g)/cdelta;
- bc = (cmax-b)/cdelta;
- if (r==cmax)
- h = bc-gc;
- else
- if (g==cmax)
- h = 2.0f+rc-bc;
- else
- h = 4.0f+gc-rc;
- h = h*60.0f;
+ cdelta = cmax - cmin;
+ rc = (cmax - r) / cdelta;
+ gc = (cmax - g) / cdelta;
+ bc = (cmax - b) / cdelta;
+
+ if (r == cmax) {
+ h = bc - gc;
+ }
+ else if (g == cmax) {
+ h = 2.0f + rc - bc;
+ }
+ else {
+ h = 4.0f + gc - rc;
+ }
+
+ h = h * 60.0f;
if (h < 0.0f)
h += 360.0f;
}
-
+
*ls = s;
*lh = h / 360.0f;
- if(*lh < 0.0f) *lh= 0.0f;
+ if (*lh < 0.0f) *lh = 0.0f;
*lv = v;
}
void rgb_to_hsv_compat(float r, float g, float b, float *lh, float *ls, float *lv)
{
- float orig_h= *lh;
- float orig_s= *ls;
+ float orig_h = *lh;
+ float orig_s = *ls;
rgb_to_hsv(r, g, b, lh, ls, lv);
- if(*lv <= 0.0f) {
- *lh= orig_h;
- *ls= orig_s;
+ if (*lv <= 0.0f) {
+ *lh = orig_h;
+ *ls = orig_s;
}
else if (*ls <= 0.0f) {
- *lh= orig_h;
+ *lh = orig_h;
}
- if(*lh==0.0f && orig_h >= 1.0f) {
- *lh= 1.0f;
+ if (*lh == 0.0f && orig_h >= 1.0f) {
+ *lh = 1.0f;
}
}
@@ -270,86 +276,88 @@ void rgb_to_hsv_compat(float r, float g, float b, float *lh, float *ls, float *l
void xyz_to_rgb(float xc, float yc, float zc, float *r, float *g, float *b, int colorspace)
{
- switch (colorspace) {
- case BLI_XYZ_SMPTE:
- *r = (3.50570f * xc) + (-1.73964f * yc) + (-0.544011f * zc);
- *g = (-1.06906f * xc) + (1.97781f * yc) + (0.0351720f * zc);
- *b = (0.0563117f * xc) + (-0.196994f * yc) + (1.05005f * zc);
- break;
- case BLI_XYZ_REC709_SRGB:
- *r = (3.240476f * xc) + (-1.537150f * yc) + (-0.498535f * zc);
- *g = (-0.969256f * xc) + (1.875992f * yc) + (0.041556f * zc);
- *b = (0.055648f * xc) + (-0.204043f * yc) + (1.057311f * zc);
- break;
- case BLI_XYZ_CIE:
- *r = (2.28783848734076f * xc) + (-0.833367677835217f * yc) + (-0.454470795871421f * zc);
- *g = (-0.511651380743862f * xc) + (1.42275837632178f * yc) + (0.0888930017552939f * zc);
- *b = (0.00572040983140966f * xc) + (-0.0159068485104036f * yc) + (1.0101864083734f * zc);
- break;
+ switch (colorspace) {
+ case BLI_XYZ_SMPTE:
+ *r = (3.50570f * xc) + (-1.73964f * yc) + (-0.544011f * zc);
+ *g = (-1.06906f * xc) + (1.97781f * yc) + (0.0351720f * zc);
+ *b = (0.0563117f * xc) + (-0.196994f * yc) + (1.05005f * zc);
+ break;
+ case BLI_XYZ_REC709_SRGB:
+ *r = (3.240476f * xc) + (-1.537150f * yc) + (-0.498535f * zc);
+ *g = (-0.969256f * xc) + (1.875992f * yc) + (0.041556f * zc);
+ *b = (0.055648f * xc) + (-0.204043f * yc) + (1.057311f * zc);
+ break;
+ case BLI_XYZ_CIE:
+ *r = (2.28783848734076f * xc) + (-0.833367677835217f * yc) + (-0.454470795871421f * zc);
+ *g = (-0.511651380743862f * xc) + (1.42275837632178f * yc) + (0.0888930017552939f * zc);
+ *b = (0.00572040983140966f * xc) + (-0.0159068485104036f * yc) + (1.0101864083734f * zc);
+ break;
}
}
/* 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)
{
short r, g, b;
float rf, gf, bf;
unsigned int col;
-
+
hsv_to_rgb(h, s, v, &rf, &gf, &bf);
-
- r= (short)(rf*255.0f);
- g= (short)(gf*255.0f);
- b= (short)(bf*255.0f);
-
- col= ( r + (g*256) + (b*256*256) );
+
+ r = (short) (rf * 255.0f);
+ g = (short) (gf * 255.0f);
+ b = (short) (bf * 255.0f);
+
+ col = (r + (g * 256) + (b * 256 * 256));
return col;
}
-
unsigned int rgb_to_cpack(float r, float g, float b)
{
int ir, ig, ib;
-
- ir= (int)floor(255.0f*r);
- if(ir<0) ir= 0; else if(ir>255) ir= 255;
- ig= (int)floor(255.0f*g);
- if(ig<0) ig= 0; else if(ig>255) ig= 255;
- ib= (int)floor(255.0f*b);
- if(ib<0) ib= 0; else if(ib>255) ib= 255;
-
- return (ir+ (ig*256) + (ib*256*256));
+
+ ir = (int)floor(255.0f * r);
+ if (ir < 0) ir = 0;
+ else if (ir > 255) ir = 255;
+ ig = (int)floor(255.0f * g);
+ if (ig < 0) ig = 0;
+ else if (ig > 255) ig = 255;
+ ib = (int)floor(255.0f * b);
+ if (ib < 0) ib = 0;
+ else if (ib > 255) ib = 255;
+
+ return (ir + (ig * 256) + (ib * 256 * 256));
}
void cpack_to_rgb(unsigned int col, float *r, float *g, float *b)
{
-
- *r= (float)((col)&0xFF);
+
+ *r = (float)((col) & 0xFF);
*r /= 255.0f;
- *g= (float)(((col)>>8)&0xFF);
+ *g = (float)(((col) >> 8) & 0xFF);
*g /= 255.0f;
- *b= (float)(((col)>>16)&0xFF);
+ *b = (float)(((col) >> 16) & 0xFF);
*b /= 255.0f;
}
void rgb_uchar_to_float(float col_r[3], const unsigned char col_ub[3])
{
- col_r[0]= ((float)col_ub[0]) / 255.0f;
- col_r[1]= ((float)col_ub[1]) / 255.0f;
- col_r[2]= ((float)col_ub[2]) / 255.0f;
+ col_r[0] = ((float)col_ub[0]) / 255.0f;
+ col_r[1] = ((float)col_ub[1]) / 255.0f;
+ col_r[2] = ((float)col_ub[2]) / 255.0f;
}
void rgba_uchar_to_float(float col_r[4], const unsigned char col_ub[4])
{
- col_r[0]= ((float)col_ub[0]) / 255.0f;
- col_r[1]= ((float)col_ub[1]) / 255.0f;
- col_r[2]= ((float)col_ub[2]) / 255.0f;
- col_r[3]= ((float)col_ub[3]) / 255.0f;
+ col_r[0] = ((float)col_ub[0]) / 255.0f;
+ col_r[1] = ((float)col_ub[1]) / 255.0f;
+ col_r[2] = ((float)col_ub[2]) / 255.0f;
+ col_r[3] = ((float)col_ub[3]) / 255.0f;
}
void rgb_float_to_uchar(unsigned char col_r[3], const float col_f[3])
@@ -373,15 +381,15 @@ void gamma_correct(float *c, float gamma)
float rec709_to_linearrgb(float c)
{
if (c < 0.081f)
- return (c < 0.0f)? 0.0f: c * (1.0f/4.5f);
+ return (c < 0.0f) ? 0.0f : c * (1.0f / 4.5f);
else
- return powf((c + 0.099f)*(1.0f/1.099f), (1.0f/0.45f));
+ return powf((c + 0.099f) * (1.0f / 1.099f), (1.0f / 0.45f));
}
float linearrgb_to_rec709(float c)
{
if (c < 0.018f)
- return (c < 0.0f)? 0.0f: c * 4.5f;
+ return (c < 0.0f) ? 0.0f : c * 4.5f;
else
return 1.099f * powf(c, 0.45f) - 0.099f;
}
@@ -389,35 +397,35 @@ float linearrgb_to_rec709(float c)
float srgb_to_linearrgb(float c)
{
if (c < 0.04045f)
- return (c < 0.0f)? 0.0f: c * (1.0f/12.92f);
+ return (c < 0.0f) ? 0.0f : c * (1.0f / 12.92f);
else
- return powf((c + 0.055f)*(1.0f/1.055f), 2.4f);
+ return powf((c + 0.055f) * (1.0f / 1.055f), 2.4f);
}
float linearrgb_to_srgb(float c)
{
if (c < 0.0031308f)
- return (c < 0.0f)? 0.0f: c * 12.92f;
+ return (c < 0.0f) ? 0.0f : c * 12.92f;
else
- return 1.055f * powf(c, 1.0f/2.4f) - 0.055f;
+ return 1.055f * powf(c, 1.0f / 2.4f) - 0.055f;
}
void minmax_rgb(short c[])
{
- if(c[0]>255) c[0]=255;
- else if(c[0]<0) c[0]=0;
- if(c[1]>255) c[1]=255;
- else if(c[1]<0) c[1]=0;
- if(c[2]>255) c[2]=255;
- else if(c[2]<0) c[2]=0;
+ if (c[0] > 255) c[0] = 255;
+ else if (c[0] < 0) c[0] = 0;
+ if (c[1] > 255) c[1] = 255;
+ else if (c[1] < 0) c[1] = 0;
+ if (c[2] > 255) c[2] = 255;
+ else if (c[2] < 0) c[2] = 0;
}
/*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;
@@ -432,31 +440,33 @@ int constrain_rgb(float *r, float *g, float *b)
/* Add just enough white to make r, g, b all positive. */
if (w > 0) {
- *r += w; *g += w; *b += w;
- return 1; /* Color modified to fit RGB gamut */
+ *r += w;
+ *g += w;
+ *b += w;
+ return 1; /* Color modified to fit RGB gamut */
}
- return 0; /* Color within RGB gamut */
+ return 0; /* Color within RGB gamut */
}
float rgb_to_grayscale(const float rgb[3])
{
- return 0.3f*rgb[0] + 0.58f*rgb[1] + 0.12f*rgb[2];
+ return 0.3f * rgb[0] + 0.58f * rgb[1] + 0.12f * rgb[2];
}
unsigned char rgb_to_grayscale_byte(const unsigned char rgb[3])
{
- return (76*(unsigned short)rgb[0] + 148*(unsigned short)rgb[1] + 31*(unsigned short)rgb[2]) / 255;
+ return (76 * (unsigned short) rgb[0] + 148 * (unsigned short) rgb[1] + 31 * (unsigned short) rgb[2]) / 255;
}
float rgb_to_luma(const float rgb[3])
{
- return 0.299f*rgb[0] + 0.587f*rgb[1] + 0.114f*rgb[2];
+ return 0.299f * rgb[0] + 0.587f * rgb[1] + 0.114f * rgb[2];
}
unsigned char rgb_to_luma_byte(const unsigned char rgb[3])
{
- return (76*(unsigned short)rgb[0] + 150*(unsigned short)rgb[1] + 29*(unsigned short)rgb[2]) / 255;
+ return (76 * (unsigned short) rgb[0] + 150 * (unsigned short) rgb[1] + 29 * (unsigned short) rgb[2]) / 255;
}
/* ********************************* lift/gamma/gain / ASC-CDL conversion ********************************* */
@@ -464,13 +474,13 @@ unsigned char rgb_to_luma_byte(const unsigned char rgb[3])
void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *offset, float *slope, float *power)
{
int c;
- for(c=0; c<3; c++) {
- offset[c]= lift[c]*gain[c];
- slope[c]= gain[c]*(1.0f-lift[c]);
- if(gamma[c] == 0)
- power[c]= FLT_MAX;
+ for (c = 0; c < 3; c++) {
+ offset[c] = lift[c] * gain[c];
+ slope[c] = gain[c] * (1.0f - lift[c]);
+ if (gamma[c] == 0)
+ power[c] = FLT_MAX;
else
- power[c]= 1.0f/gamma[c];
+ power[c] = 1.0f / gamma[c];
}
}
@@ -480,21 +490,21 @@ void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *o
void rgb_float_set_hue_float_offset(float rgb[3], float hue_offset)
{
float hsv[3];
-
- rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
-
- hsv[0]+= hue_offset;
- if(hsv[0] > 1.0f) hsv[0] -= 1.0f;
- else if(hsv[0] < 0.0f) hsv[0] += 1.0f;
-
- hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2);
+
+ rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2);
+
+ hsv[0] += hue_offset;
+ if (hsv[0] > 1.0f) hsv[0] -= 1.0f;
+ else if (hsv[0] < 0.0f) hsv[0] += 1.0f;
+
+ hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb + 1, rgb + 2);
}
/* Applies an hue offset to a byte rgb color */
void rgb_byte_set_hue_float_offset(unsigned char rgb[3], float hue_offset)
{
float rgb_float[3];
-
+
rgb_uchar_to_float(rgb_float, rgb);
rgb_float_set_hue_float_offset(rgb_float, hue_offset);
rgb_float_to_uchar(rgb, rgb_float);
@@ -527,16 +537,17 @@ static unsigned short hipart(const float f)
static float index_to_float(const unsigned short i)
{
+
union {
float f;
unsigned short us[2];
} tmp;
/* positive and negative zeros, and all gradual underflow, turn into zero: */
- if (i<0x80 || (i >= 0x8000 && i < 0x8080)) return 0;
+ if (i < 0x80 || (i >= 0x8000 && i < 0x8080)) return 0;
/* All NaN's and infinity turn into the largest possible legal float: */
- if (i>=0x7f80 && i<0x8000) return FLT_MAX;
- if (i>=0xff80) return -FLT_MAX;
+ if (i >= 0x7f80 && i < 0x8000) return FLT_MAX;
+ if (i >= 0xff80) return -FLT_MAX;
#ifdef __BIG_ENDIAN__
tmp.us[0] = i;
@@ -551,7 +562,7 @@ static float index_to_float(const unsigned short i)
void BLI_init_srgb_conversion(void)
{
- static int initialized= 0;
+ static int initialized = 0;
int i, b;
if (initialized) return;
@@ -559,19 +570,18 @@ void BLI_init_srgb_conversion(void)
/* Fill in the lookup table to convert floats to bytes: */
for (i = 0; i < 0x10000; i++) {
- float f = linearrgb_to_srgb(index_to_float(i))*255.0f;
+ float f = linearrgb_to_srgb(index_to_float(i)) * 255.0f;
if (f <= 0) BLI_color_to_srgb_table[i] = 0;
- else if (f < 255) BLI_color_to_srgb_table[i] = (unsigned short)(f*0x100+0.5f);
+ else if (f < 255) BLI_color_to_srgb_table[i] = (unsigned short) (f * 0x100 + 0.5f);
else BLI_color_to_srgb_table[i] = 0xff00;
}
/* Fill in the lookup table to convert bytes to float: */
for (b = 0; b <= 255; b++) {
- float f = srgb_to_linearrgb(((float)b)*(1.0f/255.0f));
+ float f = srgb_to_linearrgb(((float)b) * (1.0f / 255.0f));
BLI_color_from_srgb_table[b] = f;
i = hipart(f);
/* replace entries so byte->float->byte does not change the data: */
- BLI_color_to_srgb_table[i] = b*0x100;
+ BLI_color_to_srgb_table[i] = b * 0x100;
}
}
-
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c
index f497470fa4c..1aebd8bda11 100644
--- a/source/blender/blenlib/intern/math_color_inline.c
+++ b/source/blender/blenlib/intern/math_color_inline.c
@@ -79,21 +79,21 @@ 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])
{
float alpha, inv_alpha;
- if(srgb[3] == 1.0f || srgb[3] == 0.0f) {
+ if (srgb[3] == 1.0f || srgb[3] == 0.0f) {
alpha = 1.0f;
inv_alpha = 1.0f;
}
else {
alpha = srgb[3];
- inv_alpha = 1.0f/alpha;
+ inv_alpha = 1.0f / alpha;
}
linear[0] = srgb_to_linearrgb(srgb[0] * inv_alpha) * alpha;
@@ -106,13 +106,13 @@ MINLINE void linearrgb_to_srgb_predivide_v4(float srgb[4], const float linear[4]
{
float alpha, inv_alpha;
- if(linear[3] == 1.0f || linear[3] == 0.0f) {
+ if (linear[3] == 1.0f || linear[3] == 0.0f) {
alpha = 1.0f;
inv_alpha = 1.0f;
}
else {
alpha = linear[3];
- inv_alpha = 1.0f/alpha;
+ inv_alpha = 1.0f / alpha;
}
srgb[0] = linearrgb_to_srgb(linear[0] * inv_alpha) * alpha;
@@ -128,6 +128,7 @@ extern unsigned short BLI_color_to_srgb_table[0x10000];
MINLINE unsigned short to_srgb_table_lookup(const float f)
{
+
union {
float f;
unsigned short us[2];
@@ -153,17 +154,17 @@ MINLINE void linearrgb_to_srgb_ushort4_predivide(unsigned short srgb[4], const f
float alpha, inv_alpha, t;
int i;
- if(linear[3] == 1.0f || linear[3] == 0.0f) {
+ if (linear[3] == 1.0f || linear[3] == 0.0f) {
linearrgb_to_srgb_ushort4(srgb, linear);
return;
}
alpha = linear[3];
- inv_alpha = 1.0f/alpha;
+ inv_alpha = 1.0f / alpha;
- for(i=0; i<3; ++i) {
+ for (i = 0; i < 3; ++i) {
t = linear[i] * inv_alpha;
- srgb[i] = (t < 1.0f)? (unsigned short)(to_srgb_table_lookup(t) * alpha) : FTOUSHORT(linearrgb_to_srgb(t) * alpha);
+ srgb[i] = (t < 1.0f) ? (unsigned short) (to_srgb_table_lookup(t) * alpha) : FTOUSHORT(linearrgb_to_srgb(t) * alpha);
}
srgb[3] = FTOUSHORT(linear[3]);
@@ -174,7 +175,7 @@ MINLINE void srgb_to_linearrgb_uchar4(float linear[4], const unsigned char srgb[
linear[0] = BLI_color_from_srgb_table[srgb[0]];
linear[1] = BLI_color_from_srgb_table[srgb[1]];
linear[2] = BLI_color_from_srgb_table[srgb[2]];
- linear[3] = srgb[3] * (1.0f/255.0f);
+ linear[3] = srgb[3] * (1.0f / 255.0f);
}
MINLINE void srgb_to_linearrgb_uchar4_predivide(float linear[4], const unsigned char srgb[4])
@@ -182,15 +183,36 @@ MINLINE void srgb_to_linearrgb_uchar4_predivide(float linear[4], const unsigned
float fsrgb[4];
int i;
- if(srgb[3] == 255 || srgb[3] == 0) {
+ if (srgb[3] == 255 || srgb[3] == 0) {
srgb_to_linearrgb_uchar4(linear, srgb);
return;
}
- for (i=0; i<4; i++)
- fsrgb[i] = srgb[i] * (1.0f/255.0f);
+ for (i = 0; i < 4; i++)
+ fsrgb[i] = srgb[i] * (1.0f / 255.0f);
srgb_to_linearrgb_predivide_v4(linear, fsrgb);
}
+/* color macros for themes */
+#define rgba_char_args_set_fl(col, r, g, b, a) rgba_char_args_set(col, r * 255, g * 255, b * 255, a * 255)
+
+MINLINE void rgba_char_args_set(char col[4], const char r, const char g, const char b, const char a)
+{
+ col[0] = r;
+ col[1] = g;
+ col[2] = b;
+ col[3] = a;
+}
+
+MINLINE void rgba_char_args_test_set(char col[4], const char r, const char g, const char b, const char a)
+{
+ if (col[3] == 0) {
+ col[0] = r;
+ col[1] = g;
+ col[2] = b;
+ col[3] = a;
+ }
+}
+
#endif /* __MATH_COLOR_INLINE_C__ */
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index f903072afb9..e76431e981e 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -17,7 +17,7 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
-
+ *
* The Original Code is: some of this file.
*
* ***** END GPL LICENSE BLOCK *****
@@ -39,31 +39,31 @@
void cent_tri_v3(float cent[3], const float v1[3], const float v2[3], const float v3[3])
{
- cent[0]= 0.33333f*(v1[0]+v2[0]+v3[0]);
- cent[1]= 0.33333f*(v1[1]+v2[1]+v3[1]);
- cent[2]= 0.33333f*(v1[2]+v2[2]+v3[2]);
+ cent[0] = 0.33333f * (v1[0] + v2[0] + v3[0]);
+ cent[1] = 0.33333f * (v1[1] + v2[1] + v3[1]);
+ cent[2] = 0.33333f * (v1[2] + v2[2] + v3[2]);
}
void cent_quad_v3(float cent[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
{
- cent[0]= 0.25f*(v1[0]+v2[0]+v3[0]+v4[0]);
- cent[1]= 0.25f*(v1[1]+v2[1]+v3[1]+v4[1]);
- cent[2]= 0.25f*(v1[2]+v2[2]+v3[2]+v4[2]);
+ cent[0] = 0.25f * (v1[0] + v2[0] + v3[0] + v4[0]);
+ cent[1] = 0.25f * (v1[1] + v2[1] + v3[1] + v4[1]);
+ cent[2] = 0.25f * (v1[2] + v2[2] + v3[2] + v4[2]);
}
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
{
- float n1[3],n2[3];
+ float n1[3], n2[3];
- n1[0]= v1[0]-v2[0];
- n2[0]= v2[0]-v3[0];
- n1[1]= v1[1]-v2[1];
- n2[1]= v2[1]-v3[1];
- n1[2]= v1[2]-v2[2];
- n2[2]= v2[2]-v3[2];
- n[0]= n1[1]*n2[2]-n1[2]*n2[1];
- n[1]= n1[2]*n2[0]-n1[0]*n2[2];
- n[2]= n1[0]*n2[1]-n1[1]*n2[0];
+ n1[0] = v1[0] - v2[0];
+ n2[0] = v2[0] - v3[0];
+ n1[1] = v1[1] - v2[1];
+ n2[1] = v2[1] - v3[1];
+ n1[2] = v1[2] - v2[2];
+ n2[2] = v2[2] - v3[2];
+ n[0] = n1[1] * n2[2] - n1[2] * n2[1];
+ n[1] = n1[2] * n2[0] - n1[0] * n2[2];
+ n[2] = n1[0] * n2[1] - n1[1] * n2[0];
return normalize_v3(n);
}
@@ -71,88 +71,90 @@ float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const floa
float normal_quad_v3(float n[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
{
/* real cross! */
- float n1[3],n2[3];
+ float n1[3], n2[3];
- n1[0]= v1[0]-v3[0];
- n1[1]= v1[1]-v3[1];
- n1[2]= v1[2]-v3[2];
+ n1[0] = v1[0] - v3[0];
+ n1[1] = v1[1] - v3[1];
+ n1[2] = v1[2] - v3[2];
- n2[0]= v2[0]-v4[0];
- n2[1]= v2[1]-v4[1];
- n2[2]= v2[2]-v4[2];
+ n2[0] = v2[0] - v4[0];
+ n2[1] = v2[1] - v4[1];
+ n2[2] = v2[2] - v4[2];
- n[0]= n1[1]*n2[2]-n1[2]*n2[1];
- n[1]= n1[2]*n2[0]-n1[0]*n2[2];
- n[2]= n1[0]*n2[1]-n1[1]*n2[0];
+ n[0] = n1[1] * n2[2] - n1[2] * n2[1];
+ n[1] = n1[2] * n2[0] - n1[0] * n2[2];
+ n[2] = n1[0] * n2[1] - n1[1] * n2[0];
return normalize_v3(n);
}
float area_tri_v2(const float v1[2], const float v2[2], const float v3[2])
{
- return 0.5f * fabsf((v1[0]-v2[0])*(v2[1]-v3[1]) + (v1[1]-v2[1])*(v3[0]-v2[0]));
+ return 0.5f * fabsf((v1[0] - v2[0]) * (v2[1] - v3[1]) + (v1[1] - v2[1]) * (v3[0] - v2[0]));
}
float area_tri_signed_v2(const float v1[2], const float v2[2], const float v3[2])
{
- return 0.5f * ((v1[0]-v2[0])*(v2[1]-v3[1]) + (v1[1]-v2[1])*(v3[0]-v2[0]));
+ return 0.5f * ((v1[0] - v2[0]) * (v2[1] - v3[1]) + (v1[1] - v2[1]) * (v3[0] - v2[0]));
}
-float area_quad_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3]) /* only convex Quadrilaterals */
+/* only convex Quadrilaterals */
+float area_quad_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3])
{
float len, vec1[3], vec2[3], n[3];
sub_v3_v3v3(vec1, v2, v1);
sub_v3_v3v3(vec2, v4, v1);
cross_v3_v3v3(n, vec1, vec2);
- len= normalize_v3(n);
+ len = normalize_v3(n);
sub_v3_v3v3(vec1, v4, v3);
sub_v3_v3v3(vec2, v2, v3);
cross_v3_v3v3(n, vec1, vec2);
- len+= normalize_v3(n);
+ len += normalize_v3(n);
- return (len/2.0f);
+ return (len / 2.0f);
}
-float area_tri_v3(const float v1[3], const float v2[3], const float v3[3]) /* Triangles */
+/* Triangles */
+float area_tri_v3(const float v1[3], const float v2[3], const float v3[3])
{
float len, vec1[3], vec2[3], n[3];
sub_v3_v3v3(vec1, v3, v2);
sub_v3_v3v3(vec2, v1, v2);
cross_v3_v3v3(n, vec1, vec2);
- len= normalize_v3(n);
+ len = normalize_v3(n);
- return (len/2.0f);
+ return (len / 2.0f);
}
float area_poly_v3(int nr, float verts[][3], const float normal[3])
{
float x, y, z, area, max;
float *cur, *prev;
- int a, px=0, py=1;
+ int a, px = 0, py = 1;
/* first: find dominant axis: 0==X, 1==Y, 2==Z
* don't use 'axis_dominant_v3()' because we need max axis too */
- x= fabsf(normal[0]);
- y= fabsf(normal[1]);
- z= fabsf(normal[2]);
+ x = fabsf(normal[0]);
+ y = fabsf(normal[1]);
+ z = fabsf(normal[2]);
max = MAX3(x, y, z);
- if(max==y) py=2;
- else if(max==x) {
- px=1;
- py= 2;
+ if (max == y) py = 2;
+ else if (max == x) {
+ px = 1;
+ py = 2;
}
/* The Trapezium Area Rule */
- prev= verts[nr-1];
- cur= verts[0];
- area= 0;
- for(a=0; a<nr; a++) {
- area+= (cur[px]-prev[px])*(cur[py]+prev[py]);
- prev= verts[a];
- cur= verts[a+1];
+ prev = verts[nr - 1];
+ cur = verts[0];
+ area = 0;
+ for (a = 0; a < nr; a++) {
+ area += (cur[px] - prev[px]) * (cur[py] + prev[py]);
+ prev = verts[a];
+ cur = verts[a + 1];
}
return fabsf(0.5f * area / max);
@@ -160,18 +162,18 @@ float area_poly_v3(int nr, float verts[][3], const float normal[3])
/********************************* Distance **********************************/
-/* distance v1 to line v2-v3 */
-/* using Hesse formula, NO LINE PIECE! */
+/* distance v1 to line v2-v3
+ * using Hesse formula, NO LINE PIECE! */
float dist_to_line_v2(const float v1[2], const float v2[2], const float v3[2])
{
- float a[2],deler;
+ float a[2], deler;
- a[0]= v2[1]-v3[1];
- a[1]= v3[0]-v2[0];
- deler= (float)sqrt(a[0]*a[0]+a[1]*a[1]);
- if(deler== 0.0f) return 0;
+ a[0] = v2[1] - v3[1];
+ a[1] = v3[0] - v2[0];
+ deler = (float)sqrt(a[0] * a[0] + a[1] * a[1]);
+ if (deler == 0.0f) return 0;
- return fabsf((v1[0]-v2[0])*a[0]+(v1[1]-v2[1])*a[1])/deler;
+ return fabsf((v1[0] - v2[0]) * a[0] + (v1[1] - v2[1]) * a[1]) / deler;
}
@@ -179,33 +181,33 @@ float dist_to_line_v2(const float v1[2], const float v2[2], const float v3[2])
float dist_to_line_segment_v2(const float v1[2], const float v2[2], const float v3[2])
{
float labda, rc[2], pt[2], len;
-
- rc[0]= v3[0]-v2[0];
- rc[1]= v3[1]-v2[1];
- len= rc[0]*rc[0]+ rc[1]*rc[1];
- if(len==0.0f) {
- rc[0]= v1[0]-v2[0];
- rc[1]= v1[1]-v2[1];
- return (float)(sqrt(rc[0]*rc[0]+ rc[1]*rc[1]));
- }
-
- labda= (rc[0]*(v1[0]-v2[0]) + rc[1]*(v1[1]-v2[1]))/len;
- if(labda <= 0.0f) {
- pt[0]= v2[0];
- pt[1]= v2[1];
- }
- else if(labda >= 1.0f) {
- pt[0]= v3[0];
- pt[1]= v3[1];
+
+ rc[0] = v3[0] - v2[0];
+ rc[1] = v3[1] - v2[1];
+ len = rc[0] * rc[0] + rc[1] * rc[1];
+ if (len == 0.0f) {
+ rc[0] = v1[0] - v2[0];
+ rc[1] = v1[1] - v2[1];
+ return (float)(sqrt(rc[0] * rc[0] + rc[1] * rc[1]));
+ }
+
+ labda = (rc[0] * (v1[0] - v2[0]) + rc[1] * (v1[1] - v2[1])) / len;
+ if (labda <= 0.0f) {
+ pt[0] = v2[0];
+ pt[1] = v2[1];
+ }
+ else if (labda >= 1.0f) {
+ pt[0] = v3[0];
+ pt[1] = v3[1];
}
else {
- pt[0]= labda*rc[0]+v2[0];
- pt[1]= labda*rc[1]+v2[1];
+ pt[0] = labda * rc[0] + v2[0];
+ pt[1] = labda * rc[1] + v2[1];
}
- rc[0]= pt[0]-v1[0];
- rc[1]= pt[1]-v1[1];
- return sqrtf(rc[0]*rc[0]+ rc[1]*rc[1]);
+ rc[0] = pt[0] - v1[0];
+ rc[1] = pt[1] - v1[1];
+ return sqrtf(rc[0] * rc[0] + rc[1] * rc[1]);
}
/* point closest to v1 on line v2-v3 in 2D */
@@ -213,11 +215,11 @@ void closest_to_line_segment_v2(float close_r[2], const float p[2], const float
{
float lambda, cp[2];
- lambda= closest_to_line_v2(cp,p, l1, l2);
+ lambda = closest_to_line_v2(cp, p, l1, l2);
- if(lambda <= 0.0f)
+ if (lambda <= 0.0f)
copy_v2_v2(close_r, l1);
- else if(lambda >= 1.0f)
+ else if (lambda >= 1.0f)
copy_v2_v2(close_r, l2);
else
copy_v2_v2(close_r, cp);
@@ -228,11 +230,11 @@ void closest_to_line_segment_v3(float close_r[3], const float v1[3], const float
{
float lambda, cp[3];
- lambda= closest_to_line_v3(cp,v1, v2, v3);
+ lambda = closest_to_line_v3(cp, v1, v2, v3);
- if(lambda <= 0.0f)
+ if (lambda <= 0.0f)
copy_v3_v3(close_r, v2);
- else if(lambda >= 1.0f)
+ else if (lambda >= 1.0f)
copy_v3_v3(close_r, v3);
else
copy_v3_v3(close_r, cp);
@@ -245,14 +247,13 @@ void closest_to_line_segment_v3(float close_r[3], const float v1[3], const float
* pt: the point that you want the nearest of
*/
-// const float norm[3], const float coord[3], const float point[3], float dst_r[3]
void closest_to_plane_v3(float close_r[3], const float plane_co[3], const float plane_no_unit[3], const float pt[3])
{
float temp[3];
float dotprod;
sub_v3_v3v3(temp, pt, plane_co);
- dotprod= dot_v3v3(temp, plane_no_unit);
+ dotprod = dot_v3v3(temp, plane_no_unit);
close_r[0] = pt[0] - (plane_no_unit[0] * dotprod);
close_r[1] = pt[1] - (plane_no_unit[1] * dotprod);
@@ -296,16 +297,16 @@ float dist_to_line_segment_v3(const float v1[3], const float v2[3], const float
int isect_line_line_v2_int(const int v1[2], const int v2[2], const int v3[2], const int v4[2])
{
float div, labda, mu;
-
- div= (float)((v2[0]-v1[0])*(v4[1]-v3[1])-(v2[1]-v1[1])*(v4[0]-v3[0]));
- if(div==0.0f) return ISECT_LINE_LINE_COLINEAR;
-
- labda= ((float)(v1[1]-v3[1])*(v4[0]-v3[0])-(v1[0]-v3[0])*(v4[1]-v3[1]))/div;
-
- mu= ((float)(v1[1]-v3[1])*(v2[0]-v1[0])-(v1[0]-v3[0])*(v2[1]-v1[1]))/div;
-
- if(labda>=0.0f && labda<=1.0f && mu>=0.0f && mu<=1.0f) {
- if(labda==0.0f || labda==1.0f || mu==0.0f || mu==1.0f) return ISECT_LINE_LINE_EXACT;
+
+ div = (float)((v2[0] - v1[0]) * (v4[1] - v3[1]) - (v2[1] - v1[1]) * (v4[0] - v3[0]));
+ if (div == 0.0f) return ISECT_LINE_LINE_COLINEAR;
+
+ labda = ((float)(v1[1] - v3[1]) * (v4[0] - v3[0]) - (v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
+
+ mu = ((float)(v1[1] - v3[1]) * (v2[0] - v1[0]) - (v1[0] - v3[0]) * (v2[1] - v1[1])) / div;
+
+ if (labda >= 0.0f && labda <= 1.0f && mu >= 0.0f && mu <= 1.0f) {
+ if (labda == 0.0f || labda == 1.0f || mu == 0.0f || mu == 1.0f) return ISECT_LINE_LINE_EXACT;
return ISECT_LINE_LINE_CROSS;
}
return ISECT_LINE_LINE_NONE;
@@ -315,52 +316,54 @@ int isect_line_line_v2_int(const int v1[2], const int v2[2], const int v3[2], co
int isect_line_line_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
{
float div, labda, mu;
-
- div= (v2[0]-v1[0])*(v4[1]-v3[1])-(v2[1]-v1[1])*(v4[0]-v3[0]);
- if(div==0.0f) return ISECT_LINE_LINE_COLINEAR;
-
- labda= ((float)(v1[1]-v3[1])*(v4[0]-v3[0])-(v1[0]-v3[0])*(v4[1]-v3[1]))/div;
-
- mu= ((float)(v1[1]-v3[1])*(v2[0]-v1[0])-(v1[0]-v3[0])*(v2[1]-v1[1]))/div;
-
- if(labda>=0.0f && labda<=1.0f && mu>=0.0f && mu<=1.0f) {
- if(labda==0.0f || labda==1.0f || mu==0.0f || mu==1.0f) return ISECT_LINE_LINE_EXACT;
+
+ div = (v2[0] - v1[0]) * (v4[1] - v3[1]) - (v2[1] - v1[1]) * (v4[0] - v3[0]);
+ if (div == 0.0f) return ISECT_LINE_LINE_COLINEAR;
+
+ labda = ((float)(v1[1] - v3[1]) * (v4[0] - v3[0]) - (v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
+
+ mu = ((float)(v1[1] - v3[1]) * (v2[0] - v1[0]) - (v1[0] - v3[0]) * (v2[1] - v1[1])) / div;
+
+ if (labda >= 0.0f && labda <= 1.0f && mu >= 0.0f && mu <= 1.0f) {
+ if (labda == 0.0f || labda == 1.0f || mu == 0.0f || mu == 1.0f) return ISECT_LINE_LINE_EXACT;
return ISECT_LINE_LINE_CROSS;
}
return ISECT_LINE_LINE_NONE;
}
/* 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;
float u, v;
- const float eps= 0.000001f;
+ const float eps = 0.000001f;
- a1= v2[0]-v1[0];
- b1= v4[0]-v3[0];
- c1= v1[0]-v4[0];
+ a1 = v2[0] - v1[0];
+ b1 = v4[0] - v3[0];
+ c1 = v1[0] - v4[0];
- a2= v2[1]-v1[1];
- b2= v4[1]-v3[1];
- c2= v1[1]-v4[1];
+ a2 = v2[1] - v1[1];
+ b2 = v4[1] - v3[1];
+ c2 = v1[1] - v4[1];
- d= a1*b2-a2*b1;
+ d = a1 * b2 - a2 * b1;
- if(d==0) {
- if(a1*c2-a2*c1==0.0f && b1*c2-b2*c1==0.0f) { /* equal lines */
+ if (d == 0) {
+ if (a1 * c2 - a2 * c1 == 0.0f && b1 * c2 - b2 * c1 == 0.0f) { /* equal lines */
float a[2], b[2], c[2];
float u2;
- if(len_v2v2(v1, v2)==0.0f) {
- if(len_v2v2(v3, v4)>eps) {
+ if (len_v2v2(v1, v2) == 0.0f) {
+ if (len_v2v2(v3, v4) > eps) {
/* use non-point segment as basis */
SWAP(const float *, v1, v3);
SWAP(const float *, v2, v4);
- } else { /* both of segments are points */
- if(equals_v2v2(v1, v3)) { /* points are equal */
+ }
+ else { /* both of segments are points */
+ if (equals_v2v2(v1, v3)) { /* points are equal */
copy_v2_v2(vi, v1);
return 1;
}
@@ -373,15 +376,15 @@ int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[
sub_v2_v2v2(a, v3, v1);
sub_v2_v2v2(b, v2, v1);
sub_v2_v2v2(c, v2, v1);
- u= dot_v2v2(a, b) / dot_v2v2(c, c);
+ u = dot_v2v2(a, b) / dot_v2v2(c, c);
sub_v2_v2v2(a, v4, v1);
- u2= dot_v2v2(a, b) / dot_v2v2(c, c);
+ u2 = dot_v2v2(a, b) / dot_v2v2(c, c);
- if(u>u2) SWAP(float, u, u2);
+ if (u > u2) SWAP(float, u, u2);
- if(u>1.0f+eps || u2<-eps) return -1; /* non-ovlerlapping segments */
- else if(maxf(0.0f, u) == minf(1.0f, u2)) { /* one common point: can return result */
+ if (u > 1.0f + eps || u2 < -eps) return -1; /* non-ovlerlapping segments */
+ else if (maxf(0.0f, u) == minf(1.0f, u2)) { /* one common point: can return result */
interp_v2_v2v2(vi, v1, v2, maxf(0, u));
return 1;
}
@@ -391,10 +394,10 @@ int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[
return -1;
}
- u= (c2*b1-b2*c1)/d;
- v= (c1*a2-a1*c2)/d;
+ u = (c2 * b1 - b2 * c1) / d;
+ v = (c1 * a2 - a1 * c2) / d;
- if(u>=-eps && u<=1.0f+eps && v>=-eps && v<=1.0f+eps) { /* intersection */
+ if (u >= -eps && u <= 1.0f + eps && v >= -eps && v <= 1.0f + eps) { /* intersection */
interp_v2_v2v2(vi, v1, v2, u);
return 1;
}
@@ -425,20 +428,20 @@ int isect_line_sphere_v3(const float l1[3], const float l2[3],
* Paul Bourke pbourke@swin.edu.au
*/
- const float ldir[3]= {
+ const float ldir[3] = {
l2[0] - l1[0],
l2[1] - l1[1],
l2[2] - l1[2]
};
- const float a= dot_v3v3(ldir, ldir);
+ const float a = dot_v3v3(ldir, ldir);
- const float b= 2.0f *
+ const float b = 2.0f *
(ldir[0] * (l1[0] - sp[0]) +
ldir[1] * (l1[1] - sp[1]) +
ldir[2] * (l1[2] - sp[2]));
- const float c=
+ const float c =
dot_v3v3(sp, sp) +
dot_v3v3(l1, l1) -
(2.0f * dot_v3v3(sp, l1)) -
@@ -459,7 +462,7 @@ int isect_line_sphere_v3(const float l1[3], const float l2[3],
return 1;
}
else if (i > 0.0f) {
- const float i_sqrt= sqrt(i); /* avoid calc twice */
+ const float i_sqrt = sqrt(i); /* avoid calc twice */
/* first intersection */
mu = (-b + i_sqrt) / (2.0f * a);
@@ -481,18 +484,16 @@ int isect_line_sphere_v2(const float l1[2], const float l2[2],
const float sp[2], const float r,
float r_p1[2], float r_p2[2])
{
- const float ldir[2]= {
- l2[0] - l1[0],
- l2[1] - l1[1]
- };
+ const float ldir[2] = {l2[0] - l1[0],
+ l2[1] - l1[1]};
- const float a= dot_v2v2(ldir, ldir);
+ const float a = dot_v2v2(ldir, ldir);
- const float b= 2.0f *
+ const float b = 2.0f *
(ldir[0] * (l1[0] - sp[0]) +
ldir[1] * (l1[1] - sp[1]));
- const float c=
+ const float c =
dot_v2v2(sp, sp) +
dot_v2v2(l1, l1) -
(2.0f * dot_v2v2(sp, l1)) -
@@ -513,7 +514,7 @@ int isect_line_sphere_v2(const float l1[2], const float l2[2],
return 1;
}
else if (i > 0.0f) {
- const float i_sqrt= sqrt(i); /* avoid calc twice */
+ const float i_sqrt = sqrt(i); /* avoid calc twice */
/* first intersection */
mu = (-b + i_sqrt) / (2.0f * a);
@@ -531,107 +532,109 @@ 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)
+ 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
- */
- float c1,c2, // constants of linear equations
- det_inv, // the inverse of the determinant of the coefficient
- m1,m2; // the slopes of each line
+ * 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 */
+ float det_inv; /* the inverse of the determinant of the coefficient */
+ float m1, m2; /* the slopes of each line */
/*
- compute slopes, note the cludge for infinity, however, this will
- be close enough
- */
- if (fabs(x1-x0) > 0.000001)
- m1 = (y1-y0) / (x1-x0);
+ * 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
- return -1; /*m1 = (float) 1e+10;*/ // close enough to infinity
+ return -1; /*m1 = (float)1e+10;*/ // close enough to infinity
- if (fabs(x3-x2) > 0.000001)
- m2 = (y3-y2) / (x3-x2);
+ if (fabs(x3 - x2) > 0.000001)
+ m2 = (y3 - y2) / (x3 - x2);
else
- return -1; /*m2 = (float) 1e+10;*/ // close enough to infinity
+ return -1; /*m2 = (float)1e+10;*/ // close enough to infinity
- if (fabs(m1-m2) < 0.000001)
- return -1; /* parallel lines */
-
-// compute constants
+ if (fabs(m1 - m2) < 0.000001)
+ return -1; /* parallel lines */
- c1 = (y0-m1*x0);
- c2 = (y2-m2*x2);
+ // compute constants
-// compute the inverse of the determinate
+ c1 = (y0 - m1 * x0);
+ c2 = (y2 - m2 * x2);
+
+ // compute the inverse of the determinate
det_inv = 1.0f / (-m1 + m2);
-// use Kramers rule to compute xi and yi
+ // use Kramers rule to compute xi and yi
+
+ *xi = ((-c2 + c1) * det_inv);
+ *yi = ((m2 * c1 - m1 * c2) * det_inv);
- *xi= ((-c2 + c1) *det_inv);
- *yi= ((m2*c1 - m1*c2) *det_inv);
-
- return 1;
-} // end Intersect_Lines
+ return 1;
+}
/* point in tri */
int isect_point_tri_v2(const float pt[2], const float v1[2], const float v2[2], const float v3[2])
{
- if (line_point_side_v2(v1,v2,pt)>=0.0f) {
- if (line_point_side_v2(v2,v3,pt)>=0.0f) {
- if (line_point_side_v2(v3,v1,pt)>=0.0f) {
+ if (line_point_side_v2(v1, v2, pt) >= 0.0f) {
+ if (line_point_side_v2(v2, v3, pt) >= 0.0f) {
+ if (line_point_side_v2(v3, v1, pt) >= 0.0f) {
return 1;
}
}
- } else {
- if (! (line_point_side_v2(v2,v3,pt)>=0.0f)) {
- if (! (line_point_side_v2(v3,v1,pt)>=0.0f)) {
+ }
+ else {
+ if (!(line_point_side_v2(v2, v3, pt) >= 0.0f)) {
+ if (!(line_point_side_v2(v3, v1, pt) >= 0.0f)) {
return -1;
}
}
}
-
+
return 0;
}
+
/* point in quad - only convex quads */
int isect_point_quad_v2(const float pt[2], const float v1[2], const float v2[2], const float v3[2], const float v4[2])
{
- if (line_point_side_v2(v1,v2,pt)>=0.0f) {
- if (line_point_side_v2(v2,v3,pt)>=0.0f) {
- if (line_point_side_v2(v3,v4,pt)>=0.0f) {
- if (line_point_side_v2(v4,v1,pt)>=0.0f) {
+ if (line_point_side_v2(v1, v2, pt) >= 0.0f) {
+ if (line_point_side_v2(v2, v3, pt) >= 0.0f) {
+ if (line_point_side_v2(v3, v4, pt) >= 0.0f) {
+ if (line_point_side_v2(v4, v1, pt) >= 0.0f) {
return 1;
}
}
}
- } else {
- if (! (line_point_side_v2(v2,v3,pt)>=0.0f)) {
- if (! (line_point_side_v2(v3,v4,pt)>=0.0f)) {
- if (! (line_point_side_v2(v4,v1,pt)>=0.0f)) {
+ }
+ else {
+ if (!(line_point_side_v2(v2, v3, pt) >= 0.0f)) {
+ if (!(line_point_side_v2(v3, v4, pt) >= 0.0f)) {
+ if (!(line_point_side_v2(v4, v1, pt) >= 0.0f)) {
return -1;
}
}
}
}
-
+
return 0;
}
/* 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])
@@ -639,75 +642,76 @@ int isect_line_tri_v3(const float p1[3], const float p2[3],
float p[3], s[3], d[3], e1[3], e2[3], q[3];
float a, f, u, v;
-
+
sub_v3_v3v3(e1, v1, v0);
sub_v3_v3v3(e2, v2, v0);
sub_v3_v3v3(d, p2, p1);
-
+
cross_v3_v3v3(p, d, e2);
a = dot_v3v3(e1, p);
if ((a > -0.000001f) && (a < 0.000001f)) return 0;
- f = 1.0f/a;
-
+ f = 1.0f / a;
+
sub_v3_v3v3(s, p1, v0);
-
+
u = f * dot_v3v3(s, p);
- if ((u < 0.0f)||(u > 1.0f)) return 0;
-
+ if ((u < 0.0f) || (u > 1.0f)) return 0;
+
cross_v3_v3v3(q, s, e1);
-
+
v = f * dot_v3v3(d, q);
- if ((v < 0.0f)||((u + v) > 1.0f)) return 0;
+ if ((v < 0.0f) || ((u + v) > 1.0f)) return 0;
*r_lambda = f * dot_v3v3(e2, q);
- if ((*r_lambda < 0.0f)||(*r_lambda > 1.0f)) return 0;
+ if ((*r_lambda < 0.0f) || (*r_lambda > 1.0f)) return 0;
- if(r_uv) {
- r_uv[0]= u;
- r_uv[1]= v;
+ if (r_uv) {
+ r_uv[0] = u;
+ r_uv[1] = v;
}
-
+
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])
{
float p[3], s[3], e1[3], e2[3], q[3];
float a, f, u, v;
-
+
sub_v3_v3v3(e1, v1, v0);
sub_v3_v3v3(e2, v2, v0);
-
+
cross_v3_v3v3(p, d, e2);
a = dot_v3v3(e1, p);
/* note: these values were 0.000001 in 2.4x but for projection snapping on
* a human head (1BU==1m), subsurf level 2, this gave many errors - campbell */
if ((a > -0.00000001f) && (a < 0.00000001f)) return 0;
- f = 1.0f/a;
-
+ f = 1.0f / a;
+
sub_v3_v3v3(s, p1, v0);
-
+
u = f * dot_v3v3(s, p);
- if ((u < 0.0f)||(u > 1.0f)) return 0;
+ if ((u < 0.0f) || (u > 1.0f)) return 0;
cross_v3_v3v3(q, s, e1);
-
+
v = f * dot_v3v3(d, q);
- if ((v < 0.0f)||((u + v) > 1.0f)) return 0;
+ if ((v < 0.0f) || ((u + v) > 1.0f)) return 0;
*r_lambda = f * dot_v3v3(e2, q);
if ((*r_lambda < 0.0f)) return 0;
- if(r_uv) {
- r_uv[0]= u;
- r_uv[1]= v;
+ if (r_uv) {
+ r_uv[0] = u;
+ r_uv[1] = v;
}
-
+
return 1;
}
@@ -721,20 +725,20 @@ int isect_ray_plane_v3(const float p1[3], const float d[3],
sub_v3_v3v3(e1, v1, v0);
sub_v3_v3v3(e2, v2, v0);
-
+
cross_v3_v3v3(p, d, e2);
a = dot_v3v3(e1, p);
/* note: these values were 0.000001 in 2.4x but for projection snapping on
* a human head (1BU==1m), subsurf level 2, this gave many errors - campbell */
if ((a > -0.00000001f) && (a < 0.00000001f)) return 0;
- f = 1.0f/a;
-
+ f = 1.0f / a;
+
sub_v3_v3v3(s, p1, v0);
-
+
/* u = f * dot_v3v3(s, p); */ /*UNUSED*/
cross_v3_v3v3(q, s, e1);
-
+
/* v = f * dot_v3v3(d, q); */ /*UNUSED*/
*r_lambda = f * dot_v3v3(e2, q);
@@ -756,24 +760,24 @@ int isect_ray_tri_epsilon_v3(const float p1[3], const float d[3],
cross_v3_v3v3(p, d, e2);
a = dot_v3v3(e1, p);
if (a == 0.0f) return 0;
- f = 1.0f/a;
+ f = 1.0f / a;
sub_v3_v3v3(s, p1, v0);
u = f * dot_v3v3(s, p);
- if ((u < -epsilon)||(u > 1.0f+epsilon)) return 0;
+ if ((u < -epsilon) || (u > 1.0f + epsilon)) return 0;
cross_v3_v3v3(q, s, e1);
v = f * dot_v3v3(d, q);
- if ((v < -epsilon)||((u + v) > 1.0f+epsilon)) return 0;
+ if ((v < -epsilon) || ((u + v) > 1.0f + epsilon)) return 0;
*r_lambda = f * dot_v3v3(e2, q);
if ((*r_lambda < 0.0f)) return 0;
- if(uv) {
- uv[0]= u;
- uv[1]= v;
+ if (uv) {
+ uv[0] = u;
+ uv[1] = v;
}
return 1;
@@ -786,52 +790,52 @@ int isect_ray_tri_threshold_v3(const float p1[3], const float d[3],
float p[3], s[3], e1[3], e2[3], q[3];
float a, f, u, v;
float du = 0, dv = 0;
-
+
sub_v3_v3v3(e1, v1, v0);
sub_v3_v3v3(e2, v2, v0);
-
+
cross_v3_v3v3(p, d, e2);
a = dot_v3v3(e1, p);
if ((a > -0.000001f) && (a < 0.000001f)) return 0;
- f = 1.0f/a;
-
+ f = 1.0f / a;
+
sub_v3_v3v3(s, p1, v0);
-
+
cross_v3_v3v3(q, s, e1);
*r_lambda = f * dot_v3v3(e2, q);
if ((*r_lambda < 0.0f)) return 0;
-
+
u = f * dot_v3v3(s, p);
v = f * dot_v3v3(d, q);
-
+
if (u < 0) du = u;
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;
+ du = u - t / 2;
+ dv = v - t / 2;
}
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;
}
- if(r_uv) {
- r_uv[0]= u;
- r_uv[1]= v;
+ if (r_uv) {
+ r_uv[0] = u;
+ r_uv[1] = v;
}
-
+
return 1;
}
-int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3], const float plane_co[3], const float plane_no[3], const short no_flip)
+int isect_line_plane_v3(float out[3],
+ const float l1[3], const float l2[3],
+ const float plane_co[3], const float plane_no[3], const short no_flip)
{
float l_vec[3]; /* l1 -> l2 normalized vector */
float p_no[3]; /* 'plane_no' normalized */
@@ -842,18 +846,18 @@ int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3], cons
normalize_v3(l_vec);
normalize_v3_v3(p_no, plane_no);
- dot= dot_v3v3(l_vec, p_no);
- if(dot == 0.0f) {
+ dot = dot_v3v3(l_vec, p_no);
+ if (dot == 0.0f) {
return 0;
}
else {
float l1_plane[3]; /* line point aligned with the plane */
float dist; /* 'plane_no' aligned distance to the 'plane_co' */
- /* for pradictable flipping since the plane is only used to
+ /* for predictable flipping since the plane is only used to
* define a direction, ignore its flipping and aligned with 'l_vec' */
- if(dot < 0.0f) {
- dot= -dot;
+ if (dot < 0.0f) {
+ dot = -dot;
negate_v3(p_no);
}
@@ -862,8 +866,8 @@ int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3], cons
dist = line_point_factor_v3(plane_co, l1, l1_plane);
/* treat line like a ray, when 'no_flip' is set */
- if(no_flip && dist < 0.0f) {
- dist= -dist;
+ if (no_flip && dist < 0.0f) {
+ dist = -dist;
}
mul_v3_fl(l_vec, dist / dot);
@@ -874,7 +878,7 @@ int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3], cons
}
}
-/* note: return normal isnt unit length */
+/* note: return normal isn't unit length */
void isect_plane_plane_v3(float r_isect_co[3], float r_isect_no[3],
const float plane_a_co[3], const float plane_a_no[3],
const float plane_b_co[3], const float plane_b_no[3])
@@ -888,36 +892,34 @@ void isect_plane_plane_v3(float r_isect_co[3], float r_isect_no[3],
/* Adapted from the paper by Kasper Fauerby */
+
/* "Improved Collision detection and Response" */
static int getLowestRoot(const float a, const float b, const float c, const float maxR, float *root)
{
// Check if a solution exists
- float determinant = b*b - 4.0f*a*c;
+ 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);
- float r1 = (-b - sqrtD) / (2.0f*a);
- float r2 = (-b + sqrtD) / (2.0f*a);
-
+ float r1 = (-b - sqrtD) / (2.0f * a);
+ float r2 = (-b + sqrtD) / (2.0f * a);
+
// Sort so x1 <= x2
if (r1 > r2)
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;
}
@@ -926,46 +928,43 @@ static int getLowestRoot(const float a, const float b, const float c, const floa
return 0;
}
-int isect_sweeping_sphere_tri_v3(
- const float p1[3], const float p2[3], const float radius,
- const float v0[3], const float v1[3], const float v2[3],
- float *r_lambda, float ipoint[3])
+int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const float radius,
+ const float v0[3], const float v1[3], const float v2[3],
+ float *r_lambda, float ipoint[3])
{
float e1[3], e2[3], e3[3], point[3], vel[3], /*dist[3],*/ nor[3], temp[3], bv[3];
- float a, b, c, d, e, x, y, z, radius2=radius*radius;
- float elen2,edotv,edotbv,nordotv;
+ float a, b, c, d, e, x, y, z, radius2 = radius * radius;
+ float elen2, edotv, edotbv, nordotv;
float newLambda;
- int found_by_sweep=0;
+ int found_by_sweep = 0;
- sub_v3_v3v3(e1,v1,v0);
- sub_v3_v3v3(e2,v2,v0);
- sub_v3_v3v3(vel,p2,p1);
+ sub_v3_v3v3(e1, v1, v0);
+ sub_v3_v3v3(e2, v2, v0);
+ sub_v3_v3v3(vel, p2, p1);
-/*---test plane of tri---*/
- cross_v3_v3v3(nor,e1,e2);
+ /*---test plane of tri---*/
+ cross_v3_v3v3(nor, e1, e2);
normalize_v3(nor);
/* flip normal */
- if(dot_v3v3(nor,vel)>0.0f) negate_v3(nor);
-
- a=dot_v3v3(p1,nor)-dot_v3v3(v0,nor);
- nordotv=dot_v3v3(nor,vel);
+ if (dot_v3v3(nor, vel) > 0.0f) negate_v3(nor);
- if (fabsf(nordotv) < 0.000001f)
- {
- if(fabsf(a) >= radius) {
+ a = dot_v3v3(p1, nor) - dot_v3v3(v0, nor);
+ nordotv = dot_v3v3(nor, vel);
+
+ if (fabsf(nordotv) < 0.000001f) {
+ if (fabsf(a) >= radius) {
return 0;
}
}
- else
- {
- float t0=(-a+radius)/nordotv;
- float t1=(-a-radius)/nordotv;
+ else {
+ float t0 = (-a + radius) / nordotv;
+ float t1 = (-a - radius) / nordotv;
- if(t0>t1)
+ if (t0 > t1)
SWAP(float, t0, t1);
- if(t0>1.0f || t1<0.0f) return 0;
+ if (t0 > 1.0f || t1 < 0.0f) return 0;
/* clamp to [0,1] */
CLAMP(t0, 0.0f, 1.0f);
@@ -974,123 +973,115 @@ int isect_sweeping_sphere_tri_v3(
/*---test inside of tri---*/
/* plane intersection point */
- point[0] = p1[0] + vel[0]*t0 - nor[0]*radius;
- point[1] = p1[1] + vel[1]*t0 - nor[1]*radius;
- point[2] = p1[2] + vel[2]*t0 - nor[2]*radius;
+ point[0] = p1[0] + vel[0] * t0 - nor[0] * radius;
+ point[1] = p1[1] + vel[1] * t0 - nor[1] * radius;
+ point[2] = p1[2] + vel[2] * t0 - nor[2] * radius;
/* is the point in the tri? */
- a=dot_v3v3(e1,e1);
- b=dot_v3v3(e1,e2);
- c=dot_v3v3(e2,e2);
+ a = dot_v3v3(e1, e1);
+ b = dot_v3v3(e1, e2);
+ c = dot_v3v3(e2, e2);
- sub_v3_v3v3(temp,point,v0);
- d=dot_v3v3(temp,e1);
- e=dot_v3v3(temp,e2);
-
- x=d*c-e*b;
- y=e*a-d*b;
- z=x+y-(a*c-b*b);
+ sub_v3_v3v3(temp, point, v0);
+ d = dot_v3v3(temp, e1);
+ e = dot_v3v3(temp, e2);
+ x = d * c - e * b;
+ y = e * a - d * b;
+ z = x + y - (a * c - b * b);
- 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);
+
+ 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);
return 1;
}
}
- *r_lambda=1.0f;
+ *r_lambda = 1.0f;
-/*---test points---*/
- a=dot_v3v3(vel,vel);
+ /*---test points---*/
+ a = dot_v3v3(vel, vel);
/*v0*/
- sub_v3_v3v3(temp,p1,v0);
- b=2.0f*dot_v3v3(vel,temp);
- c=dot_v3v3(temp,temp)-radius2;
+ sub_v3_v3v3(temp, p1, v0);
+ b = 2.0f * dot_v3v3(vel, temp);
+ c = dot_v3v3(temp, temp) - radius2;
- if(getLowestRoot(a, b, c, *r_lambda, r_lambda))
- {
- copy_v3_v3(ipoint,v0);
- found_by_sweep=1;
+ if (getLowestRoot(a, b, c, *r_lambda, r_lambda)) {
+ copy_v3_v3(ipoint, v0);
+ found_by_sweep = 1;
}
/*v1*/
- sub_v3_v3v3(temp,p1,v1);
- b=2.0f*dot_v3v3(vel,temp);
- c=dot_v3v3(temp,temp)-radius2;
+ sub_v3_v3v3(temp, p1, v1);
+ b = 2.0f * dot_v3v3(vel, temp);
+ c = dot_v3v3(temp, temp) - radius2;
- if(getLowestRoot(a, b, c, *r_lambda, r_lambda))
- {
- copy_v3_v3(ipoint,v1);
- found_by_sweep=1;
+ if (getLowestRoot(a, b, c, *r_lambda, r_lambda)) {
+ copy_v3_v3(ipoint, v1);
+ found_by_sweep = 1;
}
-
+
/*v2*/
- sub_v3_v3v3(temp,p1,v2);
- b=2.0f*dot_v3v3(vel,temp);
- c=dot_v3v3(temp,temp)-radius2;
+ sub_v3_v3v3(temp, p1, v2);
+ b = 2.0f * dot_v3v3(vel, temp);
+ c = dot_v3v3(temp, temp) - radius2;
- if(getLowestRoot(a, b, c, *r_lambda, r_lambda))
- {
- copy_v3_v3(ipoint,v2);
- found_by_sweep=1;
+ if (getLowestRoot(a, b, c, *r_lambda, r_lambda)) {
+ copy_v3_v3(ipoint, v2);
+ found_by_sweep = 1;
}
-/*---test edges---*/
- sub_v3_v3v3(e3,v2,v1); //wasnt yet calculated
+ /*---test edges---*/
+ sub_v3_v3v3(e3, v2, v1); //wasnt yet calculated
/*e1*/
- sub_v3_v3v3(bv,v0,p1);
+ sub_v3_v3v3(bv, v0, p1);
- elen2 = dot_v3v3(e1,e1);
- edotv = dot_v3v3(e1,vel);
- edotbv = dot_v3v3(e1,bv);
+ elen2 = dot_v3v3(e1, e1);
+ edotv = dot_v3v3(e1, vel);
+ edotbv = dot_v3v3(e1, bv);
- a=elen2*(-dot_v3v3(vel,vel))+edotv*edotv;
- b=2.0f*(elen2*dot_v3v3(vel,bv)-edotv*edotbv);
- c=elen2*(radius2-dot_v3v3(bv,bv))+edotbv*edotbv;
+ a = elen2 * (-dot_v3v3(vel, vel)) + edotv * edotv;
+ 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))
- {
- e=(edotv*newLambda-edotbv)/elen2;
+ 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);
+ copy_v3_v3(ipoint, e1);
+ mul_v3_fl(ipoint, e);
add_v3_v3(ipoint, v0);
- found_by_sweep=1;
+ found_by_sweep = 1;
}
}
/*e2*/
/*bv is same*/
- elen2 = dot_v3v3(e2,e2);
- edotv = dot_v3v3(e2,vel);
- edotbv = dot_v3v3(e2,bv);
+ elen2 = dot_v3v3(e2, e2);
+ edotv = dot_v3v3(e2, vel);
+ edotbv = dot_v3v3(e2, bv);
- a=elen2*(-dot_v3v3(vel,vel))+edotv*edotv;
- b=2.0f*(elen2*dot_v3v3(vel,bv)-edotv*edotbv);
- c=elen2*(radius2-dot_v3v3(bv,bv))+edotbv*edotbv;
+ a = elen2 * (-dot_v3v3(vel, vel)) + edotv * edotv;
+ 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))
- {
- e=(edotv*newLambda-edotbv)/elen2;
+ 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);
+ copy_v3_v3(ipoint, e2);
+ mul_v3_fl(ipoint, e);
add_v3_v3(ipoint, v0);
- found_by_sweep=1;
+ found_by_sweep = 1;
}
}
@@ -1100,38 +1091,37 @@ int isect_sweeping_sphere_tri_v3(
/* edotv = dot_v3v3(e1,vel); */ /* UNUSED */
/* edotbv = dot_v3v3(e1,bv); */ /* UNUSED */
- sub_v3_v3v3(bv,v1,p1);
- elen2 = dot_v3v3(e3,e3);
- edotv = dot_v3v3(e3,vel);
- edotbv = dot_v3v3(e3,bv);
+ sub_v3_v3v3(bv, v1, p1);
+ elen2 = dot_v3v3(e3, e3);
+ edotv = dot_v3v3(e3, vel);
+ edotbv = dot_v3v3(e3, bv);
- a=elen2*(-dot_v3v3(vel,vel))+edotv*edotv;
- b=2.0f*(elen2*dot_v3v3(vel,bv)-edotv*edotbv);
- c=elen2*(radius2-dot_v3v3(bv,bv))+edotbv*edotbv;
+ a = elen2 * (-dot_v3v3(vel, vel)) + edotv * edotv;
+ 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))
- {
- e=(edotv*newLambda-edotbv)/elen2;
+ 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);
+ copy_v3_v3(ipoint, e3);
+ mul_v3_fl(ipoint, e);
add_v3_v3(ipoint, v1);
- found_by_sweep=1;
+ found_by_sweep = 1;
}
}
return found_by_sweep;
}
+
int isect_axial_line_tri_v3(const int axis, const float p1[3], const float p2[3],
const float v0[3], const float v1[3], const float v2[3], float *r_lambda)
{
float p[3], e1[3], e2[3];
float u, v, f;
- int a0=axis, a1=(axis+1)%3, a2=(axis+2)%3;
+ int a0 = axis, a1 = (axis + 1) % 3, a2 = (axis + 2) % 3;
//return isect_line_tri_v3(p1,p2,v0,v1,v2,lambda);
@@ -1142,29 +1132,29 @@ int isect_axial_line_tri_v3(const int axis, const float p1[3], const float p2[3]
//if(MAX3(v0[a2],v1[a2],v2[a2]) < p1[a2]) return 0;
///* then a full intersection test */
-
- sub_v3_v3v3(e1,v1,v0);
- sub_v3_v3v3(e2,v2,v0);
- sub_v3_v3v3(p,v0,p1);
- f= (e2[a1]*e1[a2]-e2[a2]*e1[a1]);
+ sub_v3_v3v3(e1, v1, v0);
+ sub_v3_v3v3(e2, v2, v0);
+ sub_v3_v3v3(p, v0, p1);
+
+ f = (e2[a1] * e1[a2] - e2[a2] * e1[a1]);
if ((f > -0.000001f) && (f < 0.000001f)) return 0;
- v= (p[a2]*e1[a1]-p[a1]*e1[a2])/f;
- if ((v < 0.0f)||(v > 1.0f)) return 0;
-
- f= e1[a1];
- if((f > -0.000001f) && (f < 0.000001f)) {
- f= e1[a2];
- if((f > -0.000001f) && (f < 0.000001f)) return 0;
- u= (-p[a2]-v*e2[a2])/f;
+ v = (p[a2] * e1[a1] - p[a1] * e1[a2]) / f;
+ if ((v < 0.0f) || (v > 1.0f)) return 0;
+
+ f = e1[a1];
+ if ((f > -0.000001f) && (f < 0.000001f)) {
+ f = e1[a2];
+ if ((f > -0.000001f) && (f < 0.000001f)) return 0;
+ u = (-p[a2] - v * e2[a2]) / f;
}
else
- u= (-p[a1]-v*e2[a1])/f;
+ u = (-p[a1] - v * e2[a1]) / f;
if ((u < 0.0f) || ((u + v) > 1.0f)) return 0;
- *r_lambda = (p[a0]+u*e1[a0]+v*e2[a0])/(p2[a0]-p1[a0]);
+ *r_lambda = (p[a0] + u * e1[a0] + v * e2[a0]) / (p2[a0] - p1[a0]);
if ((*r_lambda < 0.0f) || (*r_lambda > 1.0f)) return 0;
@@ -1174,13 +1164,13 @@ int isect_axial_line_tri_v3(const int axis, const float p1[3], const float p2[3]
/* Returns the number of point of interests
* 0 - lines are colinear
* 1 - lines are coplanar, i1 is set to intersection
- * 2 - i1 and i2 are the nearest points on line 1 (v1, v2) and line 2 (v3, v4) respectively
+ * 2 - i1 and i2 are the nearest points on line 1 (v1, v2) and line 2 (v3, v4) respectively
* */
int isect_line_line_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float i1[3], float i2[3])
{
float a[3], b[3], c[3], ab[3], cb[3], dir1[3], dir2[3];
float d;
-
+
sub_v3_v3v3(c, v3, v1);
sub_v3_v3v3(a, v2, v1);
sub_v3_v3v3(b, v4, v3);
@@ -1203,7 +1193,7 @@ int isect_line_line_v3(const float v1[3], const float v2[3], const float v3[3],
mul_v3_fl(a, dot_v3v3(cb, ab) / dot_v3v3(ab, ab));
add_v3_v3v3(i1, v1, a);
copy_v3_v3(i2, i1);
-
+
return 1; /* one intersection only */
}
/* if not */
@@ -1219,7 +1209,7 @@ int isect_line_line_v3(const float v1[3], const float v2[3], const float v3[3],
/* for the first line, offset the second line until it is coplanar */
add_v3_v3v3(v3t, v3, t);
add_v3_v3v3(v4t, v4, t);
-
+
sub_v3_v3v3(c, v3t, v1);
sub_v3_v3v3(a, v2, v1);
sub_v3_v3v3(b, v4t, v3t);
@@ -1232,19 +1222,19 @@ int isect_line_line_v3(const float v1[3], const float v2[3], const float v3[3],
/* for the second line, just substract the offset from the first intersection point */
sub_v3_v3v3(i2, i1, t);
-
+
return 2; /* two nearest points */
}
-}
+}
/* Intersection point strictly between the two lines
- * 0 when no intersection is found
+ * 0 when no intersection is found
* */
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)
{
float a[3], b[3], c[3], ab[3], cb[3], ca[3], dir1[3], dir2[3];
float d;
-
+
sub_v3_v3v3(c, v3, v1);
sub_v3_v3v3(a, v2, v1);
sub_v3_v3v3(b, v4, v3);
@@ -1268,9 +1258,9 @@ int isect_line_line_strict_v3(const float v1[3], const float v2[3], const float
f1 = dot_v3v3(cb, ab) / dot_v3v3(ab, ab);
f2 = dot_v3v3(ca, ab) / dot_v3v3(ab, ab);
-
+
if (f1 >= 0 && f1 <= 1 &&
- f2 >= 0 && f2 <= 1)
+ f2 >= 0 && f2 <= 1)
{
mul_v3_fl(a, f1);
add_v3_v3v3(vi, v1, a);
@@ -1279,21 +1269,19 @@ 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;
}
-}
+}
int isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3])
{
- return (min1[0]<max2[0] && min1[1]<max2[1] && min1[2]<max2[2] &&
- min2[0]<max1[0] && min2[1]<max1[1] && min2[2]<max1[2]);
+ return (min1[0] < max2[0] && min1[1] < max2[1] && min1[2] < max2[2] &&
+ min2[0] < max1[0] && min2[1] < max1[1] && min2[2] < max1[2]);
}
/* find closest point to p on line through l1,l2 and return lambda,
@@ -1301,22 +1289,22 @@ int isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min
*/
float closest_to_line_v3(float cp[3], const float p[3], const float l1[3], const float l2[3])
{
- float h[3],u[3],lambda;
+ float h[3], u[3], lambda;
sub_v3_v3v3(u, l2, l1);
sub_v3_v3v3(h, p, l1);
- lambda = dot_v3v3(u,h)/dot_v3v3(u,u);
+ lambda = dot_v3v3(u, h) / dot_v3v3(u, u);
cp[0] = l1[0] + u[0] * lambda;
cp[1] = l1[1] + u[1] * lambda;
cp[2] = l1[2] + u[2] * lambda;
return lambda;
}
-float closest_to_line_v2(float cp[2],const float p[2], const float l1[2], const float l2[2])
+float closest_to_line_v2(float cp[2], const float p[2], const float l1[2], const float l2[2])
{
- float h[2],u[2],lambda;
+ float h[2], u[2], lambda;
sub_v2_v2v2(u, l2, l1);
sub_v2_v2v2(h, p, l1);
- lambda = dot_v2v2(u,h)/dot_v2v2(u,u);
+ lambda = dot_v2v2(u, h) / dot_v2v2(u, u);
cp[0] = l1[0] + u[0] * lambda;
cp[1] = l1[1] + u[1] * lambda;
return lambda;
@@ -1325,10 +1313,10 @@ float closest_to_line_v2(float cp[2],const float p[2], const float l1[2], const
/* little sister we only need to know lambda */
float line_point_factor_v3(const float p[3], const float l1[3], const float l2[3])
{
- float h[3],u[3];
+ float h[3], u[3];
sub_v3_v3v3(u, l2, l1);
sub_v3_v3v3(h, p, l1);
- return(dot_v3v3(u,h)/dot_v3v3(u,u));
+ return (dot_v3v3(u, h) / dot_v3v3(u, u));
}
float line_point_factor_v2(const float p[2], const float l1[2], const float l2[2])
@@ -1336,105 +1324,137 @@ float line_point_factor_v2(const float p[2], const float l1[2], const float l2[2
float h[2], u[2];
sub_v2_v2v2(u, l2, l1);
sub_v2_v2v2(h, p, l1);
- return(dot_v2v2(u, h)/dot_v2v2(u, u));
+ return (dot_v2v2(u, h) / dot_v2v2(u, u));
+}
+
+/* ensyre the distance between these points is no greater then 'dist'
+ * if it is, scale then both into the center */
+void limit_dist_v3(float v1[3], float v2[3], const float dist)
+{
+ const float dist_old = len_v3v3(v1, v2);
+
+ if (dist_old > dist) {
+ float v1_old[3];
+ float v2_old[3];
+ float fac = (dist / dist_old) * 0.5f;
+
+ copy_v3_v3(v1_old, v1);
+ copy_v3_v3(v2_old, v2);
+
+ interp_v3_v3v3(v1, v1_old, v2_old, 0.5f - fac);
+ interp_v3_v3v3(v2, v1_old, v2_old, 0.5f + fac);
+ }
}
/* Similar to LineIntersectsTriangleUV, except it operates on a quad and in 2d, assumes point is in quad */
-void isect_point_quad_uv_v2(const float v0[2], const float v1[2], const float v2[2], const float v3[2], const float pt[2], float r_uv[2])
+void isect_point_quad_uv_v2(const float v0[2], const float v1[2], const float v2[2], const float v3[2],
+ const float pt[2], float r_uv[2])
{
- float x0,y0, x1,y1, wtot, v2d[2], w1, w2;
-
+ float x0, y0, x1, y1, wtot, v2d[2], w1, w2;
+
/* used for parallel lines */
float pt3d[3], l1[3], l2[3], pt_on_line[3];
-
+
/* compute 2 edges of the quad intersection point */
- if (IsectLLPt2Df(v0[0],v0[1],v1[0],v1[1], v2[0],v2[1],v3[0],v3[1], &x0,&y0) == 1) {
+ if (IsectLLPt2Df(v0[0], v0[1], v1[0], v1[1], v2[0], v2[1], v3[0], v3[1], &x0, &y0) == 1) {
/* the intersection point between the quad-edge intersection and the point in the quad we want the uv's for */
/* should never be paralle !! */
/*printf("\tnot parallel 1\n");*/
- IsectLLPt2Df(pt[0],pt[1],x0,y0, v0[0],v0[1],v3[0],v3[1], &x1,&y1);
-
+ IsectLLPt2Df(pt[0], pt[1], x0, y0, v0[0], v0[1], v3[0], v3[1], &x1, &y1);
+
/* Get the weights from the new intersection point, to each edge */
- v2d[0] = x1-v0[0];
- v2d[1] = y1-v0[1];
+ v2d[0] = x1 - v0[0];
+ v2d[1] = y1 - v0[1];
w1 = len_v2(v2d);
-
- v2d[0] = x1-v3[0]; /* some but for the other vert */
- v2d[1] = y1-v3[1];
+
+ v2d[0] = x1 - v3[0]; /* some but for the other vert */
+ v2d[1] = y1 - v3[1];
w2 = len_v2(v2d);
- wtot = w1+w2;
+ wtot = w1 + w2;
/*w1 = w1/wtot;*/
/*w2 = w2/wtot;*/
- r_uv[0] = w1/wtot;
- } else {
+ r_uv[0] = w1 / wtot;
+ }
+ else {
/* lines are parallel, lambda_cp_line_ex is 3d grrr */
/*printf("\tparallel1\n");*/
pt3d[0] = pt[0];
pt3d[1] = pt[1];
pt3d[2] = l1[2] = l2[2] = 0.0f;
-
- l1[0] = v0[0]; l1[1] = v0[1];
- l2[0] = v1[0]; l2[1] = v1[1];
- closest_to_line_v3(pt_on_line,pt3d, l1, l2);
- v2d[0] = pt[0]-pt_on_line[0]; /* same, for the other vert */
- v2d[1] = pt[1]-pt_on_line[1];
+
+ l1[0] = v0[0];
+ l1[1] = v0[1];
+ l2[0] = v1[0];
+ l2[1] = v1[1];
+ closest_to_line_v3(pt_on_line, pt3d, l1, l2);
+ v2d[0] = pt[0] - pt_on_line[0]; /* same, for the other vert */
+ v2d[1] = pt[1] - pt_on_line[1];
w1 = len_v2(v2d);
-
- l1[0] = v2[0]; l1[1] = v2[1];
- l2[0] = v3[0]; l2[1] = v3[1];
- closest_to_line_v3(pt_on_line,pt3d, l1, l2);
- v2d[0] = pt[0]-pt_on_line[0]; /* same, for the other vert */
- v2d[1] = pt[1]-pt_on_line[1];
+
+ l1[0] = v2[0];
+ l1[1] = v2[1];
+ l2[0] = v3[0];
+ l2[1] = v3[1];
+ closest_to_line_v3(pt_on_line, pt3d, l1, l2);
+ v2d[0] = pt[0] - pt_on_line[0]; /* same, for the other vert */
+ v2d[1] = pt[1] - pt_on_line[1];
w2 = len_v2(v2d);
- wtot = w1+w2;
- r_uv[0] = w1/wtot;
+ wtot = w1 + w2;
+ r_uv[0] = w1 / wtot;
}
-
+
/* Same as above to calc the uv[1] value, alternate calculation */
-
- if (IsectLLPt2Df(v0[0],v0[1],v3[0],v3[1], v1[0],v1[1],v2[0],v2[1], &x0,&y0) == 1) { /* was v0,v1 v2,v3 now v0,v3 v1,v2*/
+
+ if (IsectLLPt2Df(v0[0], v0[1], v3[0], v3[1], v1[0], v1[1], v2[0], v2[1], &x0, &y0) == 1) { /* was v0,v1 v2,v3 now v0,v3 v1,v2*/
/* never paralle if above was not */
/*printf("\tnot parallel2\n");*/
- IsectLLPt2Df(pt[0],pt[1],x0,y0, v0[0],v0[1],v1[0],v1[1], &x1,&y1);/* was v0,v3 now v0,v1*/
-
- v2d[0] = x1-v0[0];
- v2d[1] = y1-v0[1];
+ IsectLLPt2Df(pt[0], pt[1], x0, y0, v0[0], v0[1], v1[0], v1[1], &x1, &y1); /* was v0,v3 now v0,v1*/
+
+ v2d[0] = x1 - v0[0];
+ v2d[1] = y1 - v0[1];
w1 = len_v2(v2d);
-
- v2d[0] = x1-v1[0];
- v2d[1] = y1-v1[1];
+
+ v2d[0] = x1 - v1[0];
+ v2d[1] = y1 - v1[1];
w2 = len_v2(v2d);
- wtot = w1+w2;
- r_uv[1] = w1/wtot;
- } else {
+ wtot = w1 + w2;
+ r_uv[1] = w1 / wtot;
+ }
+ else {
/* lines are parallel, lambda_cp_line_ex is 3d grrr */
/*printf("\tparallel2\n");*/
pt3d[0] = pt[0];
pt3d[1] = pt[1];
pt3d[2] = l1[2] = l2[2] = 0.0f;
-
-
- l1[0] = v0[0]; l1[1] = v0[1];
- l2[0] = v3[0]; l2[1] = v3[1];
- closest_to_line_v3(pt_on_line,pt3d, l1, l2);
- v2d[0] = pt[0]-pt_on_line[0]; /* some but for the other vert */
- v2d[1] = pt[1]-pt_on_line[1];
+
+
+ l1[0] = v0[0];
+ l1[1] = v0[1];
+ l2[0] = v3[0];
+ l2[1] = v3[1];
+ closest_to_line_v3(pt_on_line, pt3d, l1, l2);
+ v2d[0] = pt[0] - pt_on_line[0]; /* some but for the other vert */
+ v2d[1] = pt[1] - pt_on_line[1];
w1 = len_v2(v2d);
-
- l1[0] = v1[0]; l1[1] = v1[1];
- l2[0] = v2[0]; l2[1] = v2[1];
- closest_to_line_v3(pt_on_line,pt3d, l1, l2);
- v2d[0] = pt[0]-pt_on_line[0]; /* some but for the other vert */
- v2d[1] = pt[1]-pt_on_line[1];
+
+ l1[0] = v1[0];
+ l1[1] = v1[1];
+ l2[0] = v2[0];
+ l2[1] = v2[1];
+ closest_to_line_v3(pt_on_line, pt3d, l1, l2);
+ v2d[0] = pt[0] - pt_on_line[0]; /* some but for the other vert */
+ v2d[1] = pt[1] - pt_on_line[1];
w2 = len_v2(v2d);
- wtot = w1+w2;
- r_uv[1] = w1/wtot;
+ wtot = w1 + w2;
+ r_uv[1] = w1 / wtot;
}
/* may need to flip UV's here */
}
/* same as above but does tri's and quads, tri's are a bit of a hack */
-void isect_point_face_uv_v2(const int isquad, const float v0[2], const float v1[2], const float v2[2], const float v3[2], const float pt[2], float r_uv[2])
+void isect_point_face_uv_v2(const int isquad,
+ const float v0[2], const float v1[2], const float v2[2], const float v3[2],
+ const float pt[2], float r_uv[2])
{
if (isquad) {
isect_point_quad_uv_v2(v0, v1, v2, v3, pt, r_uv);
@@ -1442,146 +1462,147 @@ void isect_point_face_uv_v2(const int isquad, const float v0[2], const float v1[
else {
/* not for quads, use for our abuse of LineIntersectsTriangleUV */
float p1_3d[3], p2_3d[3], v0_3d[3], v1_3d[3], v2_3d[3], lambda;
-
+
p1_3d[0] = p2_3d[0] = r_uv[0];
p1_3d[1] = p2_3d[1] = r_uv[1];
p1_3d[2] = 1.0f;
p2_3d[2] = -1.0f;
v0_3d[2] = v1_3d[2] = v2_3d[2] = 0.0;
-
+
/* generate a new fuv, (this is possibly a non optimal solution,
* since we only need 2d calculation but use 3d func's)
- *
+ *
* this method makes an imaginary triangle in 2d space using the UV's from the derived mesh face
* Then find new uv coords using the fuv and this face with LineIntersectsTriangleUV.
- * This means the new values will be correct in relation to the derived meshes face.
+ * This means the new values will be correct in relation to the derived meshes face.
*/
copy_v2_v2(v0_3d, v0);
copy_v2_v2(v1_3d, v1);
copy_v2_v2(v2_3d, v2);
-
+
/* Doing this in 3D is not nice */
isect_line_tri_v3(p1_3d, p2_3d, v0_3d, v1_3d, v2_3d, &lambda, r_uv);
}
}
#if 0 // XXX this version used to be used in isect_point_tri_v2_int() and was called IsPointInTri2D
+
int isect_point_tri_v2(float pt[2], float v1[2], float v2[2], float v3[2])
{
float inp1, inp2, inp3;
-
- inp1= (v2[0]-v1[0])*(v1[1]-pt[1]) + (v1[1]-v2[1])*(v1[0]-pt[0]);
- inp2= (v3[0]-v2[0])*(v2[1]-pt[1]) + (v2[1]-v3[1])*(v2[0]-pt[0]);
- inp3= (v1[0]-v3[0])*(v3[1]-pt[1]) + (v3[1]-v1[1])*(v3[0]-pt[0]);
-
- if(inp1<=0.0f && inp2<=0.0f && inp3<=0.0f) return 1;
- if(inp1>=0.0f && inp2>=0.0f && inp3>=0.0f) return 1;
-
+
+ inp1 = (v2[0] - v1[0]) * (v1[1] - pt[1]) + (v1[1] - v2[1]) * (v1[0] - pt[0]);
+ inp2 = (v3[0] - v2[0]) * (v2[1] - pt[1]) + (v2[1] - v3[1]) * (v2[0] - pt[0]);
+ inp3 = (v1[0] - v3[0]) * (v3[1] - pt[1]) + (v3[1] - v1[1]) * (v3[0] - pt[0]);
+
+ if (inp1 <= 0.0f && inp2 <= 0.0f && inp3 <= 0.0f) return 1;
+ if (inp1 >= 0.0f && inp2 >= 0.0f && inp3 >= 0.0f) return 1;
+
return 0;
}
#endif
#if 0
+
int isect_point_tri_v2(float v0[2], float v1[2], float v2[2], float pt[2])
{
- /* not for quads, use for our abuse of LineIntersectsTriangleUV */
- float p1_3d[3], p2_3d[3], v0_3d[3], v1_3d[3], v2_3d[3];
- /* not used */
- float lambda, uv[3];
-
- p1_3d[0] = p2_3d[0] = uv[0]= pt[0];
- p1_3d[1] = p2_3d[1] = uv[1]= uv[2]= pt[1];
- p1_3d[2] = 1.0f;
- p2_3d[2] = -1.0f;
- v0_3d[2] = v1_3d[2] = v2_3d[2] = 0.0;
-
- /* generate a new fuv, (this is possibly a non optimal solution,
- * since we only need 2d calculation but use 3d func's)
- *
- * this method makes an imaginary triangle in 2d space using the UV's from the derived mesh face
- * Then find new uv coords using the fuv and this face with LineIntersectsTriangleUV.
- * This means the new values will be correct in relation to the derived meshes face.
- */
- copy_v2_v2(v0_3d, v0);
- copy_v2_v2(v1_3d, v1);
- copy_v2_v2(v2_3d, v2);
-
- /* Doing this in 3D is not nice */
- return isect_line_tri_v3(p1_3d, p2_3d, v0_3d, v1_3d, v2_3d, &lambda, uv);
+ /* not for quads, use for our abuse of LineIntersectsTriangleUV */
+ float p1_3d[3], p2_3d[3], v0_3d[3], v1_3d[3], v2_3d[3];
+ /* not used */
+ float lambda, uv[3];
+
+ p1_3d[0] = p2_3d[0] = uv[0] = pt[0];
+ p1_3d[1] = p2_3d[1] = uv[1] = uv[2] = pt[1];
+ p1_3d[2] = 1.0f;
+ p2_3d[2] = -1.0f;
+ v0_3d[2] = v1_3d[2] = v2_3d[2] = 0.0;
+
+ /* generate a new fuv, (this is possibly a non optimal solution,
+ * since we only need 2d calculation but use 3d func's)
+ *
+ * this method makes an imaginary triangle in 2d space using the UV's from the derived mesh face
+ * Then find new uv coords using the fuv and this face with LineIntersectsTriangleUV.
+ * This means the new values will be correct in relation to the derived meshes face.
+ */
+ copy_v2_v2(v0_3d, v0);
+ copy_v2_v2(v1_3d, v1);
+ copy_v2_v2(v2_3d, v2);
+
+ /* Doing this in 3D is not nice */
+ return isect_line_tri_v3(p1_3d, p2_3d, v0_3d, v1_3d, v2_3d, &lambda, uv);
}
#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];
-
- v1[0]= (float)x1;
- v1[1]= (float)y1;
-
- v2[0]= (float)x1;
- v2[1]= (float)y2;
-
- v3[0]= (float)x2;
- v3[1]= (float)y1;
-
- p[0]= (float)a;
- p[1]= (float)b;
-
+
+ v1[0] = (float)x1;
+ v1[1] = (float)y1;
+
+ v2[0] = (float)x1;
+ v2[1] = (float)y2;
+
+ v3[0] = (float)x2;
+ v3[1] = (float)y1;
+
+ p[0] = (float)a;
+ p[1] = (float)b;
+
return isect_point_tri_v2(p, v1, v2, v3);
}
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
-*/
- float h,rp[3],cp[3],q[3];
-
- closest_to_line_v3(cp,v1,l1,l2);
- sub_v3_v3v3(q,cp,v1);
-
- sub_v3_v3v3(rp,p,v1);
- h=dot_v3v3(q,rp)/dot_v3v3(q,q);
+ /*
+ * 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);
+ sub_v3_v3v3(q, cp, v1);
+
+ sub_v3_v3v3(rp, p, v1);
+ h = dot_v3v3(q, rp) / dot_v3v3(q, q);
if (h < 0.0f || h > 1.0f) return 0;
return 1;
}
#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*/
-static int point_in_slice_as(float p[3],float origin[3],float normal[3])
+
+/* 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];
- sub_v3_v3v3(rp,p,origin);
- h=dot_v3v3(normal,rp)/dot_v3v3(normal,normal);
+ float h, rp[3];
+ sub_v3_v3v3(rp, p, origin);
+ h = dot_v3v3(normal, rp) / dot_v3v3(normal, normal);
if (h < 0.0f || h > 1.0f) return 0;
return 1;
}
/*mama (knowing the squared length of the normal)*/
-static int point_in_slice_m(float p[3],float origin[3],float normal[3],float lns)
+static int point_in_slice_m(float p[3], float origin[3], float normal[3], float lns)
{
- float h,rp[3];
- sub_v3_v3v3(rp,p,origin);
- h=dot_v3v3(normal,rp)/lns;
+ float h, rp[3];
+ sub_v3_v3v3(rp, p, origin);
+ h = dot_v3v3(normal, rp) / lns;
if (h < 0.0f || h > 1.0f) return 0;
return 1;
}
@@ -1589,9 +1610,9 @@ static int point_in_slice_m(float p[3],float origin[3],float normal[3],float lns
int isect_point_tri_prism_v3(const float p[3], const float v1[3], const float v2[3], const float v3[3])
{
- if(!point_in_slice(p,v1,v2,v3)) return 0;
- if(!point_in_slice(p,v2,v3,v1)) return 0;
- if(!point_in_slice(p,v3,v1,v2)) return 0;
+ if (!point_in_slice(p, v1, v2, v3)) return 0;
+ if (!point_in_slice(p, v2, v3, v1)) return 0;
+ if (!point_in_slice(p, v3, v1, v2)) return 0;
return 1;
}
@@ -1601,23 +1622,23 @@ int clip_line_plane(float p1[3], float p2[3], const float plane[4])
copy_v3_v3(n, plane);
sub_v3_v3v3(dp, p2, p1);
- div= dot_v3v3(dp, n);
+ div = dot_v3v3(dp, n);
- if(div == 0.0f) /* parallel */
+ if (div == 0.0f) /* parallel */
return 1;
- t= -(dot_v3v3(p1, n) + plane[3])/div;
+ t = -(dot_v3v3(p1, n) + plane[3]) / div;
- if(div > 0.0f) {
+ if (div > 0.0f) {
/* behind plane, completely clipped */
- if(t >= 1.0f) {
+ if (t >= 1.0f) {
zero_v3(p1);
zero_v3(p2);
return 0;
}
/* intersect plane */
- if(t > 0.0f) {
+ if (t > 0.0f) {
madd_v3_v3v3fl(pc, p1, dp, t);
copy_v3_v3(p1, pc);
return 1;
@@ -1627,14 +1648,14 @@ int clip_line_plane(float p1[3], float p2[3], const float plane[4])
}
else {
/* behind plane, completely clipped */
- if(t <= 0.0f) {
+ if (t <= 0.0f) {
zero_v3(p1);
zero_v3(p2);
return 0;
}
/* intersect plane */
- if(t < 1.0f) {
+ if (t < 1.0f) {
madd_v3_v3v3fl(pc, p1, dp, t);
copy_v3_v3(p2, pc);
return 1;
@@ -1644,22 +1665,21 @@ int clip_line_plane(float p1[3], float p2[3], const float plane[4])
}
}
-
void plot_line_v2v2i(const int p1[2], const int p2[2], int (*callback)(int, int, void *), void *userData)
{
- int x1= p1[0];
- int y1= p1[1];
- int x2= p2[0];
- int y2= p2[1];
+ int x1 = p1[0];
+ int y1 = p1[1];
+ int x2 = p2[0];
+ int y2 = p2[1];
signed char ix;
signed char iy;
// if x1 == x2 or y1 == y2, then it does not matter what we set here
- int delta_x = (x2 > x1?(ix = 1, x2 - x1):(ix = -1, x1 - x2)) << 1;
- int delta_y = (y2 > y1?(iy = 1, y2 - y1):(iy = -1, y1 - y2)) << 1;
+ int delta_x = (x2 > x1 ? (ix = 1, x2 - x1) : (ix = -1, x1 - x2)) << 1;
+ int delta_y = (y2 > y1 ? (iy = 1, y2 - y1) : (iy = -1, y1 - y2)) << 1;
- if(callback(x1, y1, userData) == 0) {
+ if (callback(x1, y1, userData) == 0) {
return;
}
@@ -1702,7 +1722,7 @@ void plot_line_v2v2i(const int p1[2], const int p2[2], int (*callback)(int, int,
y1 += iy;
error += delta_x;
- if(callback(x1, y1, userData) == 0) {
+ if (callback(x1, y1, userData) == 0) {
return;
}
}
@@ -1714,62 +1734,60 @@ void plot_line_v2v2i(const int p1[2], const int p2[2], int (*callback)(int, int,
/* get the 2 dominant axis values, 0==X, 1==Y, 2==Z */
void axis_dominant_v3(int *axis_a, int *axis_b, const float axis[3])
{
- const float xn= fabsf(axis[0]);
- const float yn= fabsf(axis[1]);
- const float zn= fabsf(axis[2]);
+ const float xn = fabsf(axis[0]);
+ const float yn = fabsf(axis[1]);
+ const float zn = fabsf(axis[2]);
- if (zn >= xn && zn >= yn) { *axis_a= 0; *axis_b= 1; }
- else if (yn >= xn && yn >= zn) { *axis_a= 0; *axis_b= 2; }
- else { *axis_a= 1; *axis_b= 2; }
+ if (zn >= xn && zn >= yn) { *axis_a= 0; *axis_b = 1; }
+ else if (yn >= xn && yn >= zn) { *axis_a= 0; *axis_b = 2; }
+ else { *axis_a= 1; *axis_b = 2; }
}
static float tri_signed_area(const float v1[3], const float v2[3], const float v3[3], const int i, const int j)
{
- return 0.5f*((v1[i]-v2[i])*(v2[j]-v3[j]) + (v1[j]-v2[j])*(v3[i]-v2[i]));
+ return 0.5f * ((v1[i] - v2[i]) * (v2[j] - v3[j]) + (v1[j] - v2[j]) * (v3[i] - v2[i]));
}
+/* return 1 when degenerate */
static int barycentric_weights(const float v1[3], const float v2[3], const float v3[3], const float co[3], const float n[3], float w[3])
{
- float a1, a2, a3, asum;
+ float wtot;
int i, j;
axis_dominant_v3(&i, &j, n);
- a1= tri_signed_area(v2, v3, co, i, j);
- a2= tri_signed_area(v3, v1, co, i, j);
- a3= tri_signed_area(v1, v2, co, i, j);
+ w[0] = tri_signed_area(v2, v3, co, i, j);
+ w[1] = tri_signed_area(v3, v1, co, i, j);
+ w[2] = tri_signed_area(v1, v2, co, i, j);
- asum= a1 + a2 + a3;
+ wtot = w[0] + w[1] + w[2];
- if (fabsf(asum) < FLT_EPSILON) {
+ if (fabsf(wtot) > FLT_EPSILON) {
+ mul_v3_fl(w, 1.0f / wtot);
+ return 0;
+ }
+ else {
/* zero area triangle */
- w[0]= w[1]= w[2]= 1.0f/3.0f;
+ copy_v3_fl(w, 1.0f / 3.0f);
return 1;
}
-
- asum= 1.0f/asum;
- w[0]= a1*asum;
- w[1]= a2*asum;
- w[2]= a3*asum;
-
- return 0;
}
void interp_weights_face_v3(float w[4], const float v1[3], const float v2[3], const float v3[3], const float v4[3], const float co[3])
{
float w2[3];
- w[0]= w[1]= w[2]= w[3]= 0.0f;
+ w[0] = w[1] = w[2] = w[3] = 0.0f;
/* first check for exact match */
- if(equals_v3v3(co, v1))
- w[0]= 1.0f;
- else if(equals_v3v3(co, v2))
- w[1]= 1.0f;
- else if(equals_v3v3(co, v3))
- w[2]= 1.0f;
- else if(v4 && equals_v3v3(co, v4))
- w[3]= 1.0f;
+ if (equals_v3v3(co, v1))
+ w[0] = 1.0f;
+ else if (equals_v3v3(co, v2))
+ w[1] = 1.0f;
+ else if (equals_v3v3(co, v3))
+ w[2] = 1.0f;
+ else if (v4 && equals_v3v3(co, v4))
+ w[3] = 1.0f;
else {
/* otherwise compute barycentric interpolation weights */
float n1[3], n2[3], n[3];
@@ -1786,19 +1804,19 @@ void interp_weights_face_v3(float w[4], const float v1[3], const float v2[3], co
/* OpenGL seems to split this way, so we do too */
if (v4) {
- degenerate= barycentric_weights(v1, v2, v4, co, n, w);
+ degenerate = barycentric_weights(v1, v2, v4, co, n, w);
SWAP(float, w[2], w[3]);
- if(degenerate || (w[0] < 0.0f)) {
+ 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 */
- degenerate= barycentric_weights(v2, v3, v4, co, n, w2);
-
- if(!degenerate) {
- w[0]= 0.0f;
- w[1]= w2[0];
- w[2]= w2[1];
- w[3]= w2[2];
+ * so we interpolate using the other triangle */
+ degenerate = barycentric_weights(v2, v3, v4, co, n, w2);
+
+ if (!degenerate) {
+ w[0] = 0.0f;
+ w[1] = w2[0];
+ w[2] = w2[1];
+ w[3] = w2[2];
}
}
}
@@ -1811,30 +1829,27 @@ void interp_weights_face_v3(float w[4], const float v1[3], const float v2[3], co
* note: using area_tri_signed_v2 means locations outside the triangle are correctly weighted */
void barycentric_weights_v2(const float v1[2], const float v2[2], const float v3[2], const float co[2], float w[3])
{
- float wtot_inv, wtot;
+ float wtot;
w[0] = area_tri_signed_v2(v2, v3, co);
w[1] = area_tri_signed_v2(v3, v1, co);
w[2] = area_tri_signed_v2(v1, v2, co);
- wtot = w[0]+w[1]+w[2];
+ wtot = w[0] + w[1] + w[2];
if (wtot != 0.0f) {
- wtot_inv = 1.0f/wtot;
-
- w[0] = w[0]*wtot_inv;
- w[1] = w[1]*wtot_inv;
- w[2] = w[2]*wtot_inv;
+ mul_v3_fl(w, 1.0f / wtot);
+ }
+ else { /* dummy values for zero area face */
+ copy_v3_fl(w, 1.0f / 3.0f);
}
- else /* dummy values for zero area face */
- w[0] = w[1] = w[2] = 1.0f/3.0f;
}
/* given 2 triangles in 3D space, and a point in relation to the first triangle.
* calculate the location of a point in relation to the second triangle.
* Useful for finding relative positions with geometry */
void barycentric_transform(float pt_tar[3], float const pt_src[3],
- const float tri_tar_p1[3], const float tri_tar_p2[3], const float tri_tar_p3[3],
- const float tri_src_p1[3], const float tri_src_p2[3], const float tri_src_p3[3])
+ const float tri_tar_p1[3], const float tri_tar_p2[3], const float tri_tar_p3[3],
+ const float tri_src_p1[3], const float tri_src_p2[3], const float tri_src_p3[3])
{
/* this works by moving the source triangle so its normal is pointing on the Z
* axis where its barycentric wights can be calculated in 2D and its Z offset can
@@ -1845,7 +1860,7 @@ void barycentric_transform(float pt_tar[3], float const pt_src[3],
float no_tar[3], no_src[3];
float quat_src[4];
float pt_src_xy[3];
- float tri_xy_src[3][3];
+ float tri_xy_src[3][3];
float w_src[3];
float area_tar, area_src;
float z_ofs_src;
@@ -1870,10 +1885,10 @@ void barycentric_transform(float pt_tar[3], float const pt_src[3],
barycentric_weights_v2(tri_xy_src[0], tri_xy_src[1], tri_xy_src[2], pt_src_xy, w_src);
interp_v3_v3v3v3(pt_tar, tri_tar_p1, tri_tar_p2, tri_tar_p3, w_src);
- area_tar= sqrtf(area_tri_v3(tri_tar_p1, tri_tar_p2, tri_tar_p3));
- area_src= sqrtf(area_tri_v2(tri_xy_src[0], tri_xy_src[1], tri_xy_src[2]));
+ area_tar = sqrtf(area_tri_v3(tri_tar_p1, tri_tar_p2, tri_tar_p3));
+ area_src = sqrtf(area_tri_v2(tri_xy_src[0], tri_xy_src[1], tri_xy_src[2]));
- z_ofs_src= pt_src_xy[2] - tri_xy_src[0][2];
+ z_ofs_src = pt_src_xy[2] - tri_xy_src[0][2];
madd_v3_v3v3fl(pt_tar, pt_tar, no_tar, (z_ofs_src / area_src) * area_tar);
}
@@ -1885,64 +1900,66 @@ int interp_sparse_array(float *array, int const list_size, const float skipval)
int found_valid = 0;
int i;
- for (i=0; i < list_size; i++) {
- if(array[i] == skipval)
- found_invalid= 1;
+ for (i = 0; i < list_size; i++) {
+ if (array[i] == skipval)
+ found_invalid = 1;
else
- found_valid= 1;
+ found_valid = 1;
}
- if(found_valid==0) {
+ if (found_valid == 0) {
return -1;
}
- else if (found_invalid==0) {
+ else if (found_invalid == 0) {
return 0;
}
else {
/* found invalid depths, interpolate */
- float valid_last= skipval;
- int valid_ofs= 0;
+ float valid_last = skipval;
+ int valid_ofs = 0;
- float *array_up= MEM_callocN(sizeof(float) * list_size, "interp_sparse_array up");
- float *array_down= MEM_callocN(sizeof(float) * list_size, "interp_sparse_array up");
+ float *array_up = MEM_callocN(sizeof(float) * list_size, "interp_sparse_array up");
+ float *array_down = MEM_callocN(sizeof(float) * list_size, "interp_sparse_array up");
- int *ofs_tot_up= MEM_callocN(sizeof(int) * list_size, "interp_sparse_array tup");
- int *ofs_tot_down= MEM_callocN(sizeof(int) * list_size, "interp_sparse_array tdown");
+ int *ofs_tot_up = MEM_callocN(sizeof(int) * list_size, "interp_sparse_array tup");
+ int *ofs_tot_down = MEM_callocN(sizeof(int) * list_size, "interp_sparse_array tdown");
- for (i=0; i < list_size; i++) {
- if(array[i] == skipval) {
- array_up[i]= valid_last;
- ofs_tot_up[i]= ++valid_ofs;
+ for (i = 0; i < list_size; i++) {
+ if (array[i] == skipval) {
+ array_up[i] = valid_last;
+ ofs_tot_up[i] = ++valid_ofs;
}
else {
- valid_last= array[i];
- valid_ofs= 0;
+ valid_last = array[i];
+ valid_ofs = 0;
}
}
- valid_last= skipval;
- valid_ofs= 0;
+ valid_last = skipval;
+ valid_ofs = 0;
- for (i=list_size-1; i >= 0; i--) {
- if(array[i] == skipval) {
- array_down[i]= valid_last;
- ofs_tot_down[i]= ++valid_ofs;
+ for (i = list_size - 1; i >= 0; i--) {
+ if (array[i] == skipval) {
+ array_down[i] = valid_last;
+ ofs_tot_down[i] = ++valid_ofs;
}
else {
- valid_last= array[i];
- valid_ofs= 0;
+ valid_last = array[i];
+ valid_ofs = 0;
}
}
/* now blend */
- for (i=0; i < list_size; i++) {
- if(array[i] == skipval) {
- if(array_up[i] != skipval && array_down[i] != skipval) {
- array[i]= ((array_up[i] * ofs_tot_down[i]) + (array_down[i] * ofs_tot_up[i])) / (float)(ofs_tot_down[i] + ofs_tot_up[i]);
- } else if (array_up[i] != skipval) {
- array[i]= array_up[i];
- } else if (array_down[i] != skipval) {
- array[i]= array_down[i];
+ for (i = 0; i < list_size; i++) {
+ if (array[i] == skipval) {
+ if (array_up[i] != skipval && array_down[i] != skipval) {
+ array[i] = ((array_up[i] * ofs_tot_down[i]) + (array_down[i] * ofs_tot_up[i])) / (float)(ofs_tot_down[i] + ofs_tot_up[i]);
+ }
+ else if (array_up[i] != skipval) {
+ array[i] = array_up[i];
+ }
+ else if (array_down[i] != skipval) {
+ array[i] = array_down[i];
}
}
}
@@ -1967,14 +1984,14 @@ static float mean_value_half_tan(const float v1[3], const float v2[3], const flo
sub_v3_v3v3(d3, v3, v1);
cross_v3_v3v3(cross, d2, d3);
- area= len_v3(cross);
- dot= dot_v3v3(d2, d3);
- len= len_v3(d2)*len_v3(d3);
+ area = len_v3(cross);
+ dot = dot_v3v3(d2, d3);
+ len = len_v3(d2) * len_v3(d3);
- if(area == 0.0f)
+ if (area == 0.0f)
return 0.0f;
else
- return (len - dot)/area;
+ return (len - dot) / area;
}
void interp_weights_poly_v3(float *w, float v[][3], const int n, const float co[3])
@@ -1982,120 +1999,123 @@ void interp_weights_poly_v3(float *w, float v[][3], const int n, const float co[
float totweight, t1, t2, len, *vmid, *vprev, *vnext;
int i;
- totweight= 0.0f;
+ totweight = 0.0f;
- for(i=0; i<n; i++) {
- vmid= v[i];
- vprev= (i == 0)? v[n-1]: v[i-1];
- vnext= (i == n-1)? v[0]: v[i+1];
+ for (i = 0; i < n; i++) {
+ vmid = v[i];
+ vprev = (i == 0) ? v[n - 1] : v[i - 1];
+ vnext = (i == n - 1) ? v[0] : v[i + 1];
- t1= mean_value_half_tan(co, vprev, vmid);
- t2= mean_value_half_tan(co, vmid, vnext);
+ t1 = mean_value_half_tan(co, vprev, vmid);
+ t2 = mean_value_half_tan(co, vmid, vnext);
- len= len_v3v3(co, vmid);
- w[i]= (t1+t2)/len;
+ len = len_v3v3(co, vmid);
+ w[i] = (t1 + t2) / len;
totweight += w[i];
}
- if(totweight != 0.0f)
- for(i=0; i<n; i++)
+ if (totweight != 0.0f)
+ for (i = 0; i < n; i++)
w[i] /= totweight;
}
/* (x1,v1)(t1=0)------(x2,v2)(t2=1), 0<t<1 --> (x,v)(t) */
void interp_cubic_v3(float x[3], float v[3], const float x1[3], const float v1[3], const float x2[3], const float v2[3], const float t)
{
- float a[3],b[3];
- float t2= t*t;
- float t3= t2*t;
+ float a[3], b[3];
+ float t2 = t * t;
+ float t3 = t2 * t;
/* cubic interpolation */
- a[0]= v1[0] + v2[0] + 2*(x1[0] - x2[0]);
- a[1]= v1[1] + v2[1] + 2*(x1[1] - x2[1]);
- a[2]= v1[2] + v2[2] + 2*(x1[2] - x2[2]);
+ a[0] = v1[0] + v2[0] + 2 * (x1[0] - x2[0]);
+ a[1] = v1[1] + v2[1] + 2 * (x1[1] - x2[1]);
+ a[2] = v1[2] + v2[2] + 2 * (x1[2] - x2[2]);
- b[0]= -2*v1[0] - v2[0] - 3*(x1[0] - x2[0]);
- b[1]= -2*v1[1] - v2[1] - 3*(x1[1] - x2[1]);
- b[2]= -2*v1[2] - v2[2] - 3*(x1[2] - x2[2]);
+ b[0] = -2 * v1[0] - v2[0] - 3 * (x1[0] - x2[0]);
+ b[1] = -2 * v1[1] - v2[1] - 3 * (x1[1] - x2[1]);
+ b[2] = -2 * v1[2] - v2[2] - 3 * (x1[2] - x2[2]);
- x[0]= a[0]*t3 + b[0]*t2 + v1[0]*t + x1[0];
- x[1]= a[1]*t3 + b[1]*t2 + v1[1]*t + x1[1];
- x[2]= a[2]*t3 + b[2]*t2 + v1[2]*t + x1[2];
+ x[0] = a[0] * t3 + b[0] * t2 + v1[0] * t + x1[0];
+ x[1] = a[1] * t3 + b[1] * t2 + v1[1] * t + x1[1];
+ x[2] = a[2] * t3 + b[2] * t2 + v1[2] * t + x1[2];
- v[0]= 3*a[0]*t2 + 2*b[0]*t + v1[0];
- v[1]= 3*a[1]*t2 + 2*b[1]*t + v1[1];
- v[2]= 3*a[2]*t2 + 2*b[2]*t + v1[2];
+ v[0] = 3 * a[0] * t2 + 2 * b[0] * t + v1[0];
+ v[1] = 3 * a[1] * t2 + 2 * b[1] * t + v1[1];
+ v[2] = 3 * a[2] * t2 + 2 * b[2] * t + v1[2];
}
/* unfortunately internal calculations have to be done at double precision to achieve correct/stable results. */
-#define IS_ZERO(x) ((x>(-DBL_EPSILON) && x<DBL_EPSILON) ? 1 : 0)
+#define IS_ZERO(x) ((x > (-DBL_EPSILON) && x < DBL_EPSILON) ? 1 : 0)
/* Barycentric reverse */
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 */
- 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;
+ * 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;
- if(IS_ZERO(det)==0) { /* det should never be zero since the determinant is the signed ST area of the triangle. */
- const double x[]= {st[0]-st2[0], st[1]-st2[1]};
+ if (IS_ZERO(det) == 0) { /* det should never be zero since the determinant is the signed ST area of the triangle. */
+ const double x[] = {st[0] - st2[0], st[1] - st2[1]};
- r_uv[0]= (float)((d*x[0] - b*x[1])/det);
- r_uv[1]= (float)(((-c)*x[0] + a*x[1])/det);
- } else zero_v2(r_uv);
+ r_uv[0] = (float)((d * x[0] - b * x[1]) / det);
+ r_uv[1] = (float)(((-c) * x[0] + a * x[1]) / det);
+ }
+ else zero_v2(r_uv);
}
/* bilinear reverse */
void resolve_quad_uv(float r_uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2], const float st3[2])
{
- const double signed_area= (st0[0]*st1[1] - st0[1]*st1[0]) + (st1[0]*st2[1] - st1[1]*st2[0]) +
- (st2[0]*st3[1] - st2[1]*st3[0]) + (st3[0]*st0[1] - st3[1]*st0[0]);
+ const double signed_area = (st0[0] * st1[1] - st0[1] * st1[0]) + (st1[0] * st2[1] - st1[1] * st2[0]) +
+ (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)*/
- const double a= (st0[0]-st[0])*(st0[1]-st3[1]) - (st0[1]-st[1])*(st0[0]-st3[0]);
+ * 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 */
- const double b= 0.5 * ( ((st0[0]-st[0])*(st1[1]-st2[1]) - (st0[1]-st[1])*(st1[0]-st2[0])) +
- ((st1[0]-st[0])*(st0[1]-st3[1]) - (st1[1]-st[1])*(st0[0]-st3[0])) );
+ const double b = 0.5 * (((st0[0] - st[0]) * (st1[1] - st2[1]) - (st0[1] - st[1]) * (st1[0] - st2[0])) +
+ ((st1[0] - st[0]) * (st0[1] - st3[1]) - (st1[1] - st[1]) * (st0[0] - st3[0])));
/* C = (p1-p) X (p1-p2) */
- const double fC= (st1[0]-st[0])*(st1[1]-st2[1]) - (st1[1]-st[1])*(st1[0]-st2[0]);
- const double denom= a - 2*b + fC;
+ const double fC = (st1[0] - st[0]) * (st1[1] - st2[1]) - (st1[1] - st[1]) * (st1[0] - st2[0]);
+ const double denom = a - 2 * b + fC;
// clear outputs
zero_v2(r_uv);
- if(IS_ZERO(denom)!=0) {
- const double fDen= a-fC;
- if(IS_ZERO(fDen)==0)
- r_uv[0]= (float)(a / fDen);
- } else {
- const double desc_sq= b*b - a*fC;
- const double desc= sqrt(desc_sq<0.0?0.0:desc_sq);
- const double s= signed_area>0 ? (-1.0) : 1.0;
+ if (IS_ZERO(denom) != 0) {
+ const double fDen = a - fC;
+ if (IS_ZERO(fDen) == 0)
+ r_uv[0] = (float)(a / fDen);
+ }
+ else {
+ const double desc_sq = b * b - a * fC;
+ const double desc = sqrt(desc_sq < 0.0 ? 0.0 : desc_sq);
+ const double s = signed_area > 0 ? (-1.0) : 1.0;
- r_uv[0]= (float)(( (a-b) + s * desc ) / denom);
+ r_uv[0] = (float)(((a - b) + s * desc) / denom);
}
/* 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]);
- int i= 0; double denom= denom_s;
-
- if(fabs(denom_s)<fabs(denom_t)) {
- i= 1;
- denom=denom_t;
+ 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]);
+ int i = 0;
+ double denom = denom_s;
+
+ if (fabs(denom_s) < fabs(denom_t)) {
+ i = 1;
+ denom = denom_t;
}
- if(IS_ZERO(denom)==0)
- r_uv[1]= (float) (( (1.0f-r_uv[0])*(st0[i]-st[i]) + r_uv[0]*(st1[i]-st[i]) ) / denom);
+ if (IS_ZERO(denom) == 0)
+ r_uv[1] = (float)(((1.0f - r_uv[0]) * (st0[i] - st[i]) + r_uv[0] * (st1[i] - st[i])) / denom);
}
}
@@ -2106,7 +2126,7 @@ void resolve_quad_uv(float r_uv[2], const float st[2], const float st0[2], const
void orthographic_m4(float matrix[][4], const float left, const float right, const float bottom, const float top, const float nearClip, const float farClip)
{
float Xdelta, Ydelta, Zdelta;
-
+
Xdelta = right - left;
Ydelta = top - bottom;
Zdelta = farClip - nearClip;
@@ -2114,12 +2134,12 @@ void orthographic_m4(float matrix[][4], const float left, const float right, con
return;
}
unit_m4(matrix);
- matrix[0][0] = 2.0f/Xdelta;
- matrix[3][0] = -(right + left)/Xdelta;
- matrix[1][1] = 2.0f/Ydelta;
- matrix[3][1] = -(top + bottom)/Ydelta;
- matrix[2][2] = -2.0f/Zdelta; /* note: negate Z */
- matrix[3][2] = -(farClip + nearClip)/Zdelta;
+ matrix[0][0] = 2.0f / Xdelta;
+ matrix[3][0] = -(right + left) / Xdelta;
+ matrix[1][1] = 2.0f / Ydelta;
+ matrix[3][1] = -(top + bottom) / Ydelta;
+ matrix[2][2] = -2.0f / Zdelta; /* note: negate Z */
+ matrix[3][2] = -(farClip + nearClip) / Zdelta;
}
void perspective_m4(float mat[4][4], const float left, const float right, const float bottom, const float top, const float nearClip, const float farClip)
@@ -2133,38 +2153,38 @@ void perspective_m4(float mat[4][4], const float left, const float right, const
if (Xdelta == 0.0f || Ydelta == 0.0f || Zdelta == 0.0f) {
return;
}
- mat[0][0] = nearClip * 2.0f/Xdelta;
- mat[1][1] = nearClip * 2.0f/Ydelta;
- mat[2][0] = (right + left)/Xdelta; /* note: negate Z */
- mat[2][1] = (top + bottom)/Ydelta;
- mat[2][2] = -(farClip + nearClip)/Zdelta;
+ mat[0][0] = nearClip * 2.0f / Xdelta;
+ mat[1][1] = nearClip * 2.0f / Ydelta;
+ mat[2][0] = (right + left) / Xdelta; /* note: negate Z */
+ mat[2][1] = (top + bottom) / Ydelta;
+ mat[2][2] = -(farClip + nearClip) / Zdelta;
mat[2][3] = -1.0f;
- mat[3][2] = (-2.0f * nearClip * farClip)/Zdelta;
+ mat[3][2] = (-2.0f * nearClip * farClip) / Zdelta;
mat[0][1] = mat[0][2] = mat[0][3] =
- mat[1][0] = mat[1][2] = mat[1][3] =
- mat[3][0] = mat[3][1] = mat[3][3] = 0.0;
+ mat[1][0] = mat[1][2] = mat[1][3] =
+ mat[3][0] = mat[3][1] = mat[3][3] = 0.0;
}
/* translate a matrix created by orthographic_m4 or perspective_m4 in XY coords (used to jitter the view) */
void window_translate_m4(float winmat[][4], float perspmat[][4], const float x, const float y)
{
- if(winmat[2][3] == -1.0f) {
+ if (winmat[2][3] == -1.0f) {
/* in the case of a win-matrix, this means perspective always */
float v1[3];
float v2[3];
float len1, len2;
- v1[0]= perspmat[0][0];
- v1[1]= perspmat[1][0];
- v1[2]= perspmat[2][0];
+ v1[0] = perspmat[0][0];
+ v1[1] = perspmat[1][0];
+ v1[2] = perspmat[2][0];
- v2[0]= perspmat[0][1];
- v2[1]= perspmat[1][1];
- v2[2]= perspmat[2][1];
+ v2[0] = perspmat[0][1];
+ v2[1] = perspmat[1][1];
+ v2[2] = perspmat[2][1];
- len1= (1.0f / len_v3(v1));
- len2= (1.0f / len_v3(v2));
+ len1 = (1.0f / len_v3(v1));
+ len2 = (1.0f / len_v3(v2));
winmat[2][0] += len1 * winmat[0][0] * x;
winmat[2][1] += len2 * winmat[1][1] * y;
@@ -2180,32 +2200,31 @@ static void i_multmatrix(float icand[][4], float Vm[][4])
int row, col;
float temp[4][4];
- for(row=0 ; row<4 ; row++)
- for(col=0 ; col<4 ; col++)
- temp[row][col] = icand[row][0] * Vm[0][col]
- + icand[row][1] * Vm[1][col]
- + icand[row][2] * Vm[2][col]
- + icand[row][3] * Vm[3][col];
+ for (row = 0; row < 4; row++)
+ for (col = 0; col < 4; col++)
+ temp[row][col] = (icand[row][0] * Vm[0][col] +
+ icand[row][1] * Vm[1][col] +
+ icand[row][2] * Vm[2][col] +
+ icand[row][3] * Vm[3][col]);
copy_m4_m4(Vm, temp);
}
-
-void polarview_m4(float Vm[][4],float dist, float azimuth, float incidence, float twist)
+void polarview_m4(float Vm[][4], float dist, float azimuth, float incidence, float twist)
{
unit_m4(Vm);
- translate_m4(Vm,0.0, 0.0, -dist);
- rotate_m4(Vm,'Z',-twist);
- rotate_m4(Vm,'X',-incidence);
- rotate_m4(Vm,'Z',-azimuth);
+ translate_m4(Vm, 0.0, 0.0, -dist);
+ rotate_m4(Vm, 'Z', -twist);
+ rotate_m4(Vm, 'X', -incidence);
+ rotate_m4(Vm, 'Z', -azimuth);
}
-void lookat_m4(float mat[][4],float vx, float vy, float vz, float px, float py, float pz, float twist)
+void lookat_m4(float mat[][4], float vx, float vy, float vz, float px, float py, float pz, float twist)
{
float sine, cosine, hyp, hyp1, dx, dy, dz;
- float mat1[4][4]= MAT4_UNITY;
-
+ float mat1[4][4] = MAT4_UNITY;
+
unit_m4(mat);
rotate_m4(mat, 'Z', -twist);
@@ -2213,14 +2232,15 @@ void lookat_m4(float mat[][4],float vx, float vy, float vz, float px, float py,
dx = px - vx;
dy = py - vy;
dz = pz - vz;
- hyp = dx * dx + dz * dz; /* hyp squared */
- hyp1 = (float)sqrt(dy*dy + hyp);
- hyp = (float)sqrt(hyp); /* the real hyp */
-
- if (hyp1 != 0.0f) { /* rotate X */
+ hyp = dx * dx + dz * dz; /* hyp squared */
+ hyp1 = (float)sqrt(dy * dy + hyp);
+ hyp = (float)sqrt(hyp); /* the real hyp */
+
+ if (hyp1 != 0.0f) { /* rotate X */
sine = -dy / hyp1;
- cosine = hyp /hyp1;
- } else {
+ cosine = hyp / hyp1;
+ }
+ else {
sine = 0;
cosine = 1.0f;
}
@@ -2228,17 +2248,18 @@ void lookat_m4(float mat[][4],float vx, float vy, float vz, float px, float py,
mat1[1][2] = sine;
mat1[2][1] = -sine;
mat1[2][2] = cosine;
-
+
i_multmatrix(mat1, mat);
- mat1[1][1] = mat1[2][2] = 1.0f; /* be careful here to reinit */
- mat1[1][2] = mat1[2][1] = 0.0; /* those modified by the last */
-
+ mat1[1][1] = mat1[2][2] = 1.0f; /* be careful here to reinit */
+ mat1[1][2] = mat1[2][1] = 0.0; /* those modified by the last */
+
/* paragraph */
- if (hyp != 0.0f) { /* rotate Y */
+ if (hyp != 0.0f) { /* rotate Y */
sine = dx / hyp;
cosine = -dz / hyp;
- } else {
+ }
+ else {
sine = 0;
cosine = 1.0f;
}
@@ -2246,43 +2267,43 @@ void lookat_m4(float mat[][4],float vx, float vy, float vz, float px, float py,
mat1[0][2] = -sine;
mat1[2][0] = sine;
mat1[2][2] = cosine;
-
+
i_multmatrix(mat1, mat);
- translate_m4(mat,-vx,-vy,-vz); /* translate viewpoint to origin */
+ translate_m4(mat, -vx, -vy, -vz); /* translate viewpoint to origin */
}
int box_clip_bounds_m4(float boundbox[2][3], const float bounds[4], float winmat[4][4])
{
float mat[4][4], vec[4];
- int a, fl, flag= -1;
+ int a, fl, flag = -1;
copy_m4_m4(mat, winmat);
- for(a=0; a<8; a++) {
- vec[0]= (a & 1)? boundbox[0][0]: boundbox[1][0];
- vec[1]= (a & 2)? boundbox[0][1]: boundbox[1][1];
- vec[2]= (a & 4)? boundbox[0][2]: boundbox[1][2];
- vec[3]= 1.0;
+ for (a = 0; a < 8; a++) {
+ vec[0] = (a & 1) ? boundbox[0][0] : boundbox[1][0];
+ vec[1] = (a & 2) ? boundbox[0][1] : boundbox[1][1];
+ vec[2] = (a & 4) ? boundbox[0][2] : boundbox[1][2];
+ vec[3] = 1.0;
mul_m4_v4(mat, vec);
- fl= 0;
- if(bounds) {
- if(vec[0] > bounds[1]*vec[3]) fl |= 1;
- if(vec[0]< bounds[0]*vec[3]) fl |= 2;
- if(vec[1] > bounds[3]*vec[3]) fl |= 4;
- if(vec[1]< bounds[2]*vec[3]) fl |= 8;
+ fl = 0;
+ if (bounds) {
+ if (vec[0] > bounds[1] * vec[3]) fl |= 1;
+ if (vec[0] < bounds[0] * vec[3]) fl |= 2;
+ if (vec[1] > bounds[3] * vec[3]) fl |= 4;
+ if (vec[1] < bounds[2] * vec[3]) fl |= 8;
}
else {
- if(vec[0] < -vec[3]) fl |= 1;
- if(vec[0] > vec[3]) fl |= 2;
- if(vec[1] < -vec[3]) fl |= 4;
- if(vec[1] > vec[3]) fl |= 8;
+ if (vec[0] < -vec[3]) fl |= 1;
+ if (vec[0] > vec[3]) fl |= 2;
+ if (vec[1] < -vec[3]) fl |= 4;
+ if (vec[1] > vec[3]) fl |= 8;
}
- if(vec[2] < -vec[3]) fl |= 16;
- if(vec[2] > vec[3]) fl |= 32;
+ if (vec[2] < -vec[3]) fl |= 16;
+ if (vec[2] > vec[3]) fl |= 32;
flag &= fl;
- if(flag==0) return 0;
+ if (flag == 0) return 0;
}
return flag;
@@ -2296,10 +2317,10 @@ void box_minmax_bounds_m4(float min[3], float max[3], float boundbox[2][3], floa
copy_v3_v3(mn, min);
copy_v3_v3(mx, max);
- for(a=0; a<8; a++) {
- vec[0]= (a & 1)? boundbox[0][0]: boundbox[1][0];
- vec[1]= (a & 2)? boundbox[0][1]: boundbox[1][1];
- vec[2]= (a & 4)? boundbox[0][2]: boundbox[1][2];
+ for (a = 0; a < 8; a++) {
+ vec[0] = (a & 1) ? boundbox[0][0] : boundbox[1][0];
+ vec[1] = (a & 2) ? boundbox[0][1] : boundbox[1][1];
+ vec[2] = (a & 4) ? boundbox[0][2] : boundbox[1][2];
mul_m4_v3(mat, vec);
DO_MINMAX(vec, mn, mx);
@@ -2314,12 +2335,12 @@ void box_minmax_bounds_m4(float min[3], float max[3], float boundbox[2][3], floa
void map_to_tube(float *r_u, float *r_v, const float x, const float y, const float z)
{
float len;
-
+
*r_v = (z + 1.0f) / 2.0f;
-
+
len = sqrtf(x * x + y * y);
- if(len > 0.0f) {
- *r_u = (float)((1.0 - (atan2(x/len,y/len) / M_PI)) / 2.0);
+ if (len > 0.0f) {
+ *r_u = (float)((1.0 - (atan2(x / len, y / len) / M_PI)) / 2.0);
}
else {
*r_v = *r_u = 0.0f; /* to avoid un-initialized variables */
@@ -2329,13 +2350,13 @@ void map_to_tube(float *r_u, float *r_v, const float x, const float y, const flo
void map_to_sphere(float *r_u, float *r_v, const float x, const float y, const float z)
{
float len;
-
+
len = sqrtf(x * x + y * y + z * z);
- if(len > 0.0f) {
- if(x==0.0f && y==0.0f) *r_u= 0.0f; /* othwise domain error */
- else *r_u = (1.0f - atan2f(x,y) / (float)M_PI) / 2.0f;
+ if (len > 0.0f) {
+ if (x == 0.0f && y == 0.0f) *r_u = 0.0f; /* othwise domain error */
+ else *r_u = (1.0f - atan2f(x, y) / (float)M_PI) / 2.0f;
- *r_v = 1.0f - (float)saacos(z/len)/(float)M_PI;
+ *r_v = 1.0f - (float)saacos(z / len) / (float)M_PI;
}
else {
*r_v = *r_u = 0.0f; /* to avoid un-initialized variables */
@@ -2345,17 +2366,17 @@ void map_to_sphere(float *r_u, float *r_v, const float x, const float y, const f
/********************************* Normals **********************************/
void accumulate_vertex_normals(float n1[3], float n2[3], float n3[3],
- float n4[3], const float f_no[3], const float co1[3], const float co2[3],
- const float co3[3], const float co4[3])
+ float n4[3], const float f_no[3], const float co1[3], const float co2[3],
+ const float co3[3], const float co4[3])
{
float vdiffs[4][3];
- const int nverts= (n4!=NULL && co4!=NULL)? 4: 3;
+ const int nverts = (n4 != NULL && co4 != NULL) ? 4 : 3;
/* compute normalized edge vectors */
sub_v3_v3v3(vdiffs[0], co2, co1);
sub_v3_v3v3(vdiffs[1], co3, co2);
- if(nverts==3) {
+ if (nverts == 3) {
sub_v3_v3v3(vdiffs[2], co1, co3);
}
else {
@@ -2370,13 +2391,13 @@ void accumulate_vertex_normals(float n1[3], float n2[3], float n3[3],
/* accumulate angle weighted face normal */
{
- float *vn[]= {n1, n2, n3, n4};
- const float *prev_edge = vdiffs[nverts-1];
+ float *vn[] = {n1, n2, n3, n4};
+ const float *prev_edge = vdiffs[nverts - 1];
int i;
- for(i=0; i<nverts; i++) {
- const float *cur_edge= vdiffs[i];
- const float fac= saacos(-dot_v3v3(cur_edge, prev_edge));
+ for (i = 0; i < nverts; i++) {
+ const float *cur_edge = vdiffs[i];
+ const float fac = saacos(-dot_v3v3(cur_edge, prev_edge));
// accumulate
madd_v3_v3fl(vn[i], f_no, fac);
@@ -2386,29 +2407,29 @@ 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)
+ float **vertcos, float vdiffs[][3], int nverts)
{
int i;
/* calculate normalized edge directions for each edge in the poly */
for (i = 0; i < nverts; i++) {
- sub_v3_v3v3(vdiffs[i], vertcos[(i+1) % nverts], vertcos[i]);
+ sub_v3_v3v3(vdiffs[i], vertcos[(i + 1) % nverts], vertcos[i]);
normalize_v3(vdiffs[i]);
}
/* accumulate angle weighted face normal */
{
- const float *prev_edge = vdiffs[nverts-1];
+ const float *prev_edge = vdiffs[nverts - 1];
int i;
- for(i=0; i<nverts; i++) {
+ for (i = 0; i < nverts; i++) {
const float *cur_edge = vdiffs[i];
-
+
/* calculate angle between the two poly edges incident on
- this vertex */
- const float fac= saacos(-dot_v3v3(cur_edge, prev_edge));
+ * this vertex */
+ const float fac = saacos(-dot_v3v3(cur_edge, prev_edge));
/* accumulate */
madd_v3_v3fl(vertnos[i], polyno, fac);
@@ -2420,35 +2441,35 @@ void accumulate_vertex_normals_poly(float **vertnos, float polyno[3],
/********************************* Tangents **********************************/
/* For normal map tangents we need to detect uv boundaries, and only average
- * tangents in case the uvs are connected. Alternative would be to store 1
+ * tangents in case the uvs are connected. Alternative would be to store 1
* tangent per face rather than 4 per face vertex, but that's not compatible
* with games */
/* from BKE_mesh.h */
-#define STD_UV_CONNECT_LIMIT 0.0001f
+#define STD_UV_CONNECT_LIMIT 0.0001f
void sum_or_add_vertex_tangent(void *arena, VertexTangent **vtang, const float tang[3], const float uv[2])
{
VertexTangent *vt;
/* find a tangent with connected uvs */
- for(vt= *vtang; vt; vt=vt->next) {
- if(fabsf(uv[0]-vt->uv[0]) < STD_UV_CONNECT_LIMIT && fabsf(uv[1]-vt->uv[1]) < STD_UV_CONNECT_LIMIT) {
+ for (vt = *vtang; vt; vt = vt->next) {
+ if (fabsf(uv[0] - vt->uv[0]) < STD_UV_CONNECT_LIMIT && fabsf(uv[1] - vt->uv[1]) < STD_UV_CONNECT_LIMIT) {
add_v3_v3(vt->tang, tang);
return;
}
}
/* if not found, append a new one */
- vt= BLI_memarena_alloc((MemArena *)arena, sizeof(VertexTangent));
+ vt = BLI_memarena_alloc((MemArena *) arena, sizeof(VertexTangent));
copy_v3_v3(vt->tang, tang);
- vt->uv[0]= uv[0];
- vt->uv[1]= uv[1];
+ vt->uv[0] = uv[0];
+ vt->uv[1] = uv[1];
- if(*vtang)
- vt->next= *vtang;
- *vtang= vt;
+ if (*vtang)
+ vt->next = *vtang;
+ *vtang = vt;
}
float *find_vertex_tangent(VertexTangent *vtang, const float uv[2])
@@ -2456,44 +2477,44 @@ float *find_vertex_tangent(VertexTangent *vtang, const float uv[2])
VertexTangent *vt;
static float nulltang[3] = {0.0f, 0.0f, 0.0f};
- for(vt= vtang; vt; vt=vt->next)
- if(fabsf(uv[0]-vt->uv[0]) < STD_UV_CONNECT_LIMIT && fabsf(uv[1]-vt->uv[1]) < STD_UV_CONNECT_LIMIT)
+ for (vt = vtang; vt; vt = vt->next)
+ if (fabsf(uv[0] - vt->uv[0]) < STD_UV_CONNECT_LIMIT && fabsf(uv[1] - vt->uv[1]) < STD_UV_CONNECT_LIMIT)
return vt->tang;
- return nulltang; /* shouldn't happen, except for nan or so */
+ return nulltang; /* shouldn't happen, except for nan or so */
}
void tangent_from_uv(float uv1[2], float uv2[2], float uv3[3], float co1[3], float co2[3], float co3[3], float n[3], float tang[3])
{
- float s1= uv2[0] - uv1[0];
- float s2= uv3[0] - uv1[0];
- float t1= uv2[1] - uv1[1];
- float t2= uv3[1] - uv1[1];
- float det= (s1 * t2 - s2 * t1);
+ float s1 = uv2[0] - uv1[0];
+ float s2 = uv3[0] - uv1[0];
+ float t1 = uv2[1] - uv1[1];
+ float t2 = uv3[1] - uv1[1];
+ float det = (s1 * t2 - s2 * t1);
- if(det != 0.0f) { /* otherwise 'tang' becomes nan */
+ if (det != 0.0f) { /* otherwise 'tang' becomes nan */
float tangv[3], ct[3], e1[3], e2[3];
- det= 1.0f/det;
+ det = 1.0f / det;
/* normals in render are inversed... */
sub_v3_v3v3(e1, co1, co2);
sub_v3_v3v3(e2, co1, co3);
- tang[0] = (t2*e1[0] - t1*e2[0])*det;
- tang[1] = (t2*e1[1] - t1*e2[1])*det;
- tang[2] = (t2*e1[2] - t1*e2[2])*det;
- tangv[0] = (s1*e2[0] - s2*e1[0])*det;
- tangv[1] = (s1*e2[1] - s2*e1[1])*det;
- tangv[2] = (s1*e2[2] - s2*e1[2])*det;
+ tang[0] = (t2 * e1[0] - t1 * e2[0]) * det;
+ tang[1] = (t2 * e1[1] - t1 * e2[1]) * det;
+ tang[2] = (t2 * e1[2] - t1 * e2[2]) * det;
+ tangv[0] = (s1 * e2[0] - s2 * e1[0]) * det;
+ tangv[1] = (s1 * e2[1] - s2 * e1[1]) * det;
+ tangv[2] = (s1 * e2[2] - s2 * e1[2]) * det;
cross_v3_v3v3(ct, tang, tangv);
-
+
/* check flip */
if (dot_v3v3(ct, n) < 0.0f) {
negate_v3(tang);
}
}
else {
- tang[0]= tang[1]= tang[2]= 0.0;
+ tang[0] = tang[1] = tang[2] = 0.0;
}
}
@@ -2501,45 +2522,44 @@ 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])
{
float det = 0.f;
if (m2) {
- det= m2[0][0]* (m2[1][1]*m2[2][2] - m2[1][2]*m2[2][1])
- -m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1])
- +m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]);
+ det = (m2[0][0] * (m2[1][1] * m2[2][2] - m2[1][2] * m2[2][1]) -
+ m2[1][0] * (m2[0][1] * m2[2][2] - m2[0][2] * m2[2][1]) +
+ m2[2][0] * (m2[0][1] * m2[1][2] - m2[0][2] * m2[1][1]));
}
return det;
}
-
-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])
+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])
{
- float accu_com[3]= {0.0f,0.0f,0.0f}, accu_rcom[3]= {0.0f,0.0f,0.0f};
- float accu_weight = 0.0f,accu_rweight = 0.0f,eps = 0.000001f;
+ float accu_com[3] = {0.0f, 0.0f, 0.0f}, accu_rcom[3] = {0.0f, 0.0f, 0.0f};
+ float accu_weight = 0.0f, accu_rweight = 0.0f, eps = 0.000001f;
int a;
/* first set up a nice default response */
@@ -2548,25 +2568,24 @@ 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++) {
+ for (a = 0; a < list_size; a++) {
if (weight) {
float v[3];
- copy_v3_v3(v,pos[a]);
- mul_v3_fl(v,weight[a]);
+ copy_v3_v3(v, pos[a]);
+ mul_v3_fl(v, weight[a]);
add_v3_v3(accu_com, v);
- accu_weight +=weight[a];
+ accu_weight += weight[a];
}
else add_v3_v3(accu_com, pos[a]);
if (rweight) {
float v[3];
- copy_v3_v3(v,rpos[a]);
- mul_v3_fl(v,rweight[a]);
+ copy_v3_v3(v, rpos[a]);
+ mul_v3_fl(v, rweight[a]);
add_v3_v3(accu_rcom, v);
- accu_rweight +=rweight[a];
+ accu_rweight += rweight[a];
}
else add_v3_v3(accu_rcom, rpos[a]);
@@ -2575,25 +2594,25 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
accu_weight = accu_rweight = list_size;
}
- mul_v3_fl(accu_com,1.0f/accu_weight);
- mul_v3_fl(accu_rcom,1.0f/accu_rweight);
- if (lloc) copy_v3_v3(lloc,accu_com);
- if (rloc) copy_v3_v3(rloc,accu_rcom);
+ mul_v3_fl(accu_com, 1.0f / accu_weight);
+ mul_v3_fl(accu_rcom, 1.0f / accu_rweight);
+ if (lloc) copy_v3_v3(lloc, accu_com);
+ if (rloc) copy_v3_v3(rloc, accu_rcom);
if (lrot || lscale) { /* caller does not want rot nor scale, strange but legal */
/*so now do some reverse engeneering and see if we can split rotation from scale ->Polardecompose*/
/* build 'projection' matrix */
- float m[3][3],mr[3][3],q[3][3],qi[3][3];
- float va[3],vb[3],stunt[3];
- float odet,ndet;
- int i=0,imax=15;
+ float m[3][3], mr[3][3], q[3][3], qi[3][3];
+ float va[3], vb[3], stunt[3];
+ float odet, ndet;
+ int i = 0, imax = 15;
zero_m3(m);
zero_m3(mr);
/* build 'projection' matrix */
- for(a=0; a<list_size; a++) {
- sub_v3_v3v3(va,rpos[a],accu_rcom);
+ for (a = 0; a < list_size; a++) {
+ sub_v3_v3v3(va, rpos[a], accu_rcom);
/* mul_v3_fl(va,bp->mass); mass needs renormalzation here ?? */
- sub_v3_v3v3(vb,pos[a],accu_com);
+ sub_v3_v3v3(vb, pos[a], accu_com);
/* mul_v3_fl(va,rp->mass); */
m[0][0] += va[0] * vb[0];
m[0][1] += va[0] * vb[1];
@@ -2607,8 +2626,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];
@@ -2622,20 +2641,22 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
mr[2][1] += va[2] * va[1];
mr[2][2] += va[2] * va[2];
}
- copy_m3_m3(q,m);
- stunt[0] = q[0][0]; stunt[1] = q[1][1]; stunt[2] = q[2][2];
+ copy_m3_m3(q, m);
+ stunt[0] = q[0][0];
+ stunt[1] = q[1][1];
+ stunt[2] = q[2][2];
/* renormalizing for numeric stability */
- mul_m3_fl(q,1.f/len_v3(stunt));
+ mul_m3_fl(q, 1.f / len_v3(stunt));
/* this is pretty much Polardecompose 'inline' the algo based on Higham's thesis */
/* without the far case ... but seems to work here pretty neat */
odet = 0.f;
ndet = _det_m3(q);
- while((odet-ndet)*(odet-ndet) > eps && i<imax) {
- invert_m3_m3(qi,q);
+ while ((odet - ndet) * (odet - ndet) > eps && i < imax) {
+ invert_m3_m3(qi, q);
transpose_m3(qi);
- add_m3_m3m3(q,q,qi);
- mul_m3_fl(q,0.5f);
+ add_m3_m3m3(q, q, qi);
+ mul_m3_fl(q, 0.5f);
odet = ndet;
ndet = _det_m3(q);
i++;
@@ -2644,12 +2665,12 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
if (i) {
float scale[3][3];
float irot[3][3];
- if(lrot) copy_m3_m3(lrot,q);
- invert_m3_m3(irot,q);
- invert_m3_m3(qi,mr);
- mul_m3_m3m3(q,m,qi);
- mul_m3_m3m3(scale,irot,q);
- if(lscale) copy_m3_m3(lscale,scale);
+ if (lrot) copy_m3_m3(lrot, q);
+ invert_m3_m3(irot, q);
+ invert_m3_m3(qi, mr);
+ mul_m3_m3m3(q, m, qi);
+ mul_m3_m3m3(scale, irot, q);
+ if (lscale) copy_m3_m3(lscale, scale);
}
}
@@ -2660,42 +2681,44 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
static void vec_add_dir(float r[3], const float v1[3], const float v2[3], const float fac)
{
- r[0]= v1[0] + fac*(v2[0] - v1[0]);
- r[1]= v1[1] + fac*(v2[1] - v1[1]);
- r[2]= v1[2] + fac*(v2[2] - v1[2]);
+ r[0] = v1[0] + fac * (v2[0] - v1[0]);
+ r[1] = v1[1] + fac * (v2[1] - v1[1]);
+ r[2] = v1[2] + fac * (v2[2] - v1[2]);
}
-static int ff_visible_quad(const float p[3], const float n[3], const float v0[3], const float v1[3], const float v2[3], float q0[3], float q1[3], float q2[3], float q3[3])
+static int ff_visible_quad(const float p[3], const float n[3],
+ const float v0[3], const float v1[3], const float v2[3],
+ float q0[3], float q1[3], float q2[3], float q3[3])
{
static const float epsilon = 1e-6f;
float c, sd[3];
-
- c= dot_v3v3(n, p);
+
+ c = dot_v3v3(n, p);
/* signed distances from the vertices to the plane. */
- sd[0]= dot_v3v3(n, v0) - c;
- sd[1]= dot_v3v3(n, v1) - c;
- sd[2]= dot_v3v3(n, v2) - c;
+ sd[0] = dot_v3v3(n, v0) - c;
+ sd[1] = dot_v3v3(n, v1) - c;
+ sd[2] = dot_v3v3(n, v2) - c;
- if(fabsf(sd[0]) < epsilon) sd[0] = 0.0f;
- if(fabsf(sd[1]) < epsilon) sd[1] = 0.0f;
- if(fabsf(sd[2]) < epsilon) sd[2] = 0.0f;
+ if (fabsf(sd[0]) < epsilon) sd[0] = 0.0f;
+ if (fabsf(sd[1]) < epsilon) sd[1] = 0.0f;
+ if (fabsf(sd[2]) < epsilon) sd[2] = 0.0f;
- if(sd[0] > 0) {
- if(sd[1] > 0) {
- if(sd[2] > 0) {
+ if (sd[0] > 0) {
+ if (sd[1] > 0) {
+ if (sd[2] > 0) {
// +++
copy_v3_v3(q0, v0);
copy_v3_v3(q1, v1);
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// ++-
copy_v3_v3(q0, v0);
copy_v3_v3(q1, v1);
- vec_add_dir(q2, v1, v2, (sd[1]/(sd[1]-sd[2])));
- vec_add_dir(q3, v0, v2, (sd[0]/(sd[0]-sd[2])));
+ vec_add_dir(q2, v1, v2, (sd[1] / (sd[1] - sd[2])));
+ vec_add_dir(q3, v0, v2, (sd[0] / (sd[0] - sd[2])));
}
else {
// ++0
@@ -2705,42 +2728,42 @@ static int ff_visible_quad(const float p[3], const float n[3], const float v0[3]
copy_v3_v3(q3, q2);
}
}
- else if(sd[1] < 0) {
- if(sd[2] > 0) {
+ else if (sd[1] < 0) {
+ if (sd[2] > 0) {
// +-+
copy_v3_v3(q0, v0);
- vec_add_dir(q1, v0, v1, (sd[0]/(sd[0]-sd[1])));
- vec_add_dir(q2, v1, v2, (sd[1]/(sd[1]-sd[2])));
+ vec_add_dir(q1, v0, v1, (sd[0] / (sd[0] - sd[1])));
+ vec_add_dir(q2, v1, v2, (sd[1] / (sd[1] - sd[2])));
copy_v3_v3(q3, v2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// +--
copy_v3_v3(q0, v0);
- vec_add_dir(q1, v0, v1, (sd[0]/(sd[0]-sd[1])));
- vec_add_dir(q2, v0, v2, (sd[0]/(sd[0]-sd[2])));
+ vec_add_dir(q1, v0, v1, (sd[0] / (sd[0] - sd[1])));
+ vec_add_dir(q2, v0, v2, (sd[0] / (sd[0] - sd[2])));
copy_v3_v3(q3, q2);
}
else {
// +-0
copy_v3_v3(q0, v0);
- vec_add_dir(q1, v0, v1, (sd[0]/(sd[0]-sd[1])));
+ vec_add_dir(q1, v0, v1, (sd[0] / (sd[0] - sd[1])));
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
}
else {
- if(sd[2] > 0) {
+ if (sd[2] > 0) {
// +0+
copy_v3_v3(q0, v0);
copy_v3_v3(q1, v1);
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// +0-
copy_v3_v3(q0, v0);
copy_v3_v3(q1, v1);
- vec_add_dir(q2, v0, v2, (sd[0]/(sd[0]-sd[2])));
+ vec_add_dir(q2, v0, v2, (sd[0] / (sd[0] - sd[2])));
copy_v3_v3(q3, q2);
}
else {
@@ -2752,39 +2775,39 @@ static int ff_visible_quad(const float p[3], const float n[3], const float v0[3]
}
}
}
- else if(sd[0] < 0) {
- if(sd[1] > 0) {
- if(sd[2] > 0) {
+ else if (sd[0] < 0) {
+ if (sd[1] > 0) {
+ if (sd[2] > 0) {
// -++
- vec_add_dir(q0, v0, v1, (sd[0]/(sd[0]-sd[1])));
+ vec_add_dir(q0, v0, v1, (sd[0] / (sd[0] - sd[1])));
copy_v3_v3(q1, v1);
copy_v3_v3(q2, v2);
- vec_add_dir(q3, v0, v2, (sd[0]/(sd[0]-sd[2])));
+ vec_add_dir(q3, v0, v2, (sd[0] / (sd[0] - sd[2])));
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// -+-
- vec_add_dir(q0, v0, v1, (sd[0]/(sd[0]-sd[1])));
+ vec_add_dir(q0, v0, v1, (sd[0] / (sd[0] - sd[1])));
copy_v3_v3(q1, v1);
- vec_add_dir(q2, v1, v2, (sd[1]/(sd[1]-sd[2])));
+ vec_add_dir(q2, v1, v2, (sd[1] / (sd[1] - sd[2])));
copy_v3_v3(q3, q2);
}
else {
// -+0
- vec_add_dir(q0, v0, v1, (sd[0]/(sd[0]-sd[1])));
+ vec_add_dir(q0, v0, v1, (sd[0] / (sd[0] - sd[1])));
copy_v3_v3(q1, v1);
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
}
- else if(sd[1] < 0) {
- if(sd[2] > 0) {
+ else if (sd[1] < 0) {
+ if (sd[2] > 0) {
// --+
- vec_add_dir(q0, v0, v2, (sd[0]/(sd[0]-sd[2])));
- vec_add_dir(q1, v1, v2, (sd[1]/(sd[1]-sd[2])));
+ vec_add_dir(q0, v0, v2, (sd[0] / (sd[0] - sd[2])));
+ vec_add_dir(q1, v1, v2, (sd[1] / (sd[1] - sd[2])));
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// ---
return 0;
}
@@ -2794,14 +2817,14 @@ static int ff_visible_quad(const float p[3], const float n[3], const float v0[3]
}
}
else {
- if(sd[2] > 0) {
+ if (sd[2] > 0) {
// -0+
- vec_add_dir(q0, v0, v2, (sd[0]/(sd[0]-sd[2])));
+ vec_add_dir(q0, v0, v2, (sd[0] / (sd[0] - sd[2])));
copy_v3_v3(q1, v1);
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// -0-
return 0;
}
@@ -2812,19 +2835,19 @@ static int ff_visible_quad(const float p[3], const float n[3], const float v0[3]
}
}
else {
- if(sd[1] > 0) {
- if(sd[2] > 0) {
+ if (sd[1] > 0) {
+ if (sd[2] > 0) {
// 0++
copy_v3_v3(q0, v0);
copy_v3_v3(q1, v1);
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// 0+-
copy_v3_v3(q0, v0);
copy_v3_v3(q1, v1);
- vec_add_dir(q2, v1, v2, (sd[1]/(sd[1]-sd[2])));
+ vec_add_dir(q2, v1, v2, (sd[1] / (sd[1] - sd[2])));
copy_v3_v3(q3, q2);
}
else {
@@ -2835,15 +2858,15 @@ static int ff_visible_quad(const float p[3], const float n[3], const float v0[3]
copy_v3_v3(q3, q2);
}
}
- else if(sd[1] < 0) {
- if(sd[2] > 0) {
+ else if (sd[1] < 0) {
+ if (sd[2] > 0) {
// 0-+
copy_v3_v3(q0, v0);
- vec_add_dir(q1, v1, v2, (sd[1]/(sd[1]-sd[2])));
+ vec_add_dir(q1, v1, v2, (sd[1] / (sd[1] - sd[2])));
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// 0--
return 0;
}
@@ -2853,14 +2876,14 @@ static int ff_visible_quad(const float p[3], const float n[3], const float v0[3]
}
}
else {
- if(sd[2] > 0) {
+ if (sd[2] > 0) {
// 00+
copy_v3_v3(q0, v0);
copy_v3_v3(q1, v1);
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// 00-
return 0;
}
@@ -2892,49 +2915,49 @@ static vFloat vec_splat_float(float val)
static float ff_quad_form_factor(float *p, float *n, float *q0, float *q1, float *q2, float *q3)
{
vFloat vcos, rlen, vrx, vry, vrz, vsrx, vsry, vsrz, gx, gy, gz, vangle;
- vUInt8 rotate = (vUInt8) {4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3};
+ vUInt8 rotate = (vUInt8) {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3};
vFloatResult vresult;
float result;
/* compute r* */
- vrx = (vFloat) {q0[0], q1[0], q2[0], q3[0]} - vec_splat_float(p[0]);
- vry = (vFloat) {q0[1], q1[1], q2[1], q3[1]} - vec_splat_float(p[1]);
- vrz = (vFloat) {q0[2], q1[2], q2[2], q3[2]} - vec_splat_float(p[2]);
+ vrx = (vFloat) {q0[0], q1[0], q2[0], q3[0]} -vec_splat_float(p[0]);
+ vry = (vFloat) {q0[1], q1[1], q2[1], q3[1]} -vec_splat_float(p[1]);
+ vrz = (vFloat) {q0[2], q1[2], q2[2], q3[2]} -vec_splat_float(p[2]);
/* normalize r* */
- rlen = vec_rsqrte(vrx*vrx + vry*vry + vrz*vrz + vec_splat_float(1e-16f));
- vrx = vrx*rlen;
- vry = vry*rlen;
- vrz = vrz*rlen;
+ rlen = vec_rsqrte(vrx * vrx + vry * vry + vrz * vrz + vec_splat_float(1e-16f));
+ vrx = vrx * rlen;
+ vry = vry * rlen;
+ vrz = vrz * rlen;
/* rotate r* for cross and dot */
- vsrx= vec_perm(vrx, vrx, rotate);
- vsry= vec_perm(vry, vry, rotate);
- vsrz= vec_perm(vrz, vrz, rotate);
+ vsrx = vec_perm(vrx, vrx, rotate);
+ vsry = vec_perm(vry, vry, rotate);
+ vsrz = vec_perm(vrz, vrz, rotate);
/* cross product */
- gx = vsry*vrz - vsrz*vry;
- gy = vsrz*vrx - vsrx*vrz;
- gz = vsrx*vry - vsry*vrx;
+ gx = vsry * vrz - vsrz * vry;
+ gy = vsrz * vrx - vsrx * vrz;
+ gz = vsrx * vry - vsry * vrx;
/* normalize */
- rlen = vec_rsqrte(gx*gx + gy*gy + gz*gz + vec_splat_float(1e-16f));
- gx = gx*rlen;
- gy = gy*rlen;
- gz = gz*rlen;
+ rlen = vec_rsqrte(gx * gx + gy * gy + gz * gz + vec_splat_float(1e-16f));
+ gx = gx * rlen;
+ gy = gy * rlen;
+ gz = gz * rlen;
/* angle */
- vcos = vrx*vsrx + vry*vsry + vrz*vsrz;
- vcos= vec_max(vec_min(vcos, vec_splat_float(1.0f)), vec_splat_float(-1.0f));
- vangle= vacosf(vcos);
+ vcos = vrx * vsrx + vry * vsry + vrz * vsrz;
+ vcos = vec_max(vec_min(vcos, vec_splat_float(1.0f)), vec_splat_float(-1.0f));
+ vangle = vacosf(vcos);
/* dot */
- vresult.v = (vec_splat_float(n[0])*gx +
- vec_splat_float(n[1])*gy +
- vec_splat_float(n[2])*gz)*vangle;
+ vresult.v = (vec_splat_float(n[0]) * gx +
+ vec_splat_float(n[1]) * gy +
+ vec_splat_float(n[2]) * gz) * vangle;
- result= (vresult.f[0] + vresult.f[1] + vresult.f[2] + vresult.f[3])*(0.5f/(float)M_PI);
- result= MAX2(result, 0.0f);
+ result = (vresult.f[0] + vresult.f[1] + vresult.f[2] + vresult.f[3]) * (0.5f / (float)M_PI);
+ result = MAX2(result, 0.0f);
return result;
}
@@ -2950,8 +2973,8 @@ static float ff_quad_form_factor(float *p, float *n, float *q0, float *q1, float
static __m128 sse_approx_acos(__m128 x)
{
/* needs a better approximation than taylor expansion of acos, since that
- * gives big erros for near 1.0 values, sqrt(2*x)*acos(1-x) should work
- * better, see http://www.tom.womack.net/projects/sse-fast-arctrig.html */
+ * gives big erros for near 1.0 values, sqrt(2 * x) * acos(1 - x) should work
+ * better, see http://www.tom.womack.net/projects/sse-fast-arctrig.html */
return _mm_set_ps1(1.0f);
}
@@ -2973,36 +2996,36 @@ static float ff_quad_form_factor(float *p, float *n, float *q0, float *q1, float
rz = qz - _mm_set_ps1(p[2]);
/* normalize r */
- rlen = _mm_rsqrt_ps(rx*rx + ry*ry + rz*rz + _mm_set_ps1(1e-16f));
- rx = rx*rlen;
- ry = ry*rlen;
- rz = rz*rlen;
+ rlen = _mm_rsqrt_ps(rx * rx + ry * ry + rz * rz + _mm_set_ps1(1e-16f));
+ rx = rx * rlen;
+ ry = ry * rlen;
+ rz = rz * rlen;
/* cross product */
- srx = _mm_shuffle_ps(rx, rx, _MM_SHUFFLE(0,3,2,1));
- sry = _mm_shuffle_ps(ry, ry, _MM_SHUFFLE(0,3,2,1));
- srz = _mm_shuffle_ps(rz, rz, _MM_SHUFFLE(0,3,2,1));
+ srx = _mm_shuffle_ps(rx, rx, _MM_SHUFFLE(0, 3, 2, 1));
+ sry = _mm_shuffle_ps(ry, ry, _MM_SHUFFLE(0, 3, 2, 1));
+ srz = _mm_shuffle_ps(rz, rz, _MM_SHUFFLE(0, 3, 2, 1));
- gx = sry*rz - srz*ry;
- gy = srz*rx - srx*rz;
- gz = srx*ry - sry*rx;
+ gx = sry * rz - srz * ry;
+ gy = srz * rx - srx * rz;
+ gz = srx * ry - sry * rx;
/* normalize g */
- glen = _mm_rsqrt_ps(gx*gx + gy*gy + gz*gz + _mm_set_ps1(1e-16f));
- gx = gx*glen;
- gy = gy*glen;
- gz = gz*glen;
+ glen = _mm_rsqrt_ps(gx * gx + gy * gy + gz * gz + _mm_set_ps1(1e-16f));
+ gx = gx * glen;
+ gy = gy * glen;
+ gz = gz * glen;
/* compute angle */
- rcos = rx*srx + ry*sry + rz*srz;
- rcos= _mm_max_ps(_mm_min_ps(rcos, _mm_set_ps1(1.0f)), _mm_set_ps1(-1.0f));
+ rcos = rx * srx + ry * sry + rz * srz;
+ rcos = _mm_max_ps(_mm_min_ps(rcos, _mm_set_ps1(1.0f)), _mm_set_ps1(-1.0f));
angle = sse_approx_cos(rcos);
- aresult = (_mm_set_ps1(n[0])*gx + _mm_set_ps1(n[1])*gy + _mm_set_ps1(n[2])*gz)*angle;
+ aresult = (_mm_set_ps1(n[0]) * gx + _mm_set_ps1(n[1]) * gy + _mm_set_ps1(n[2]) * gz) * angle;
/* sum together */
- result= (fresult[0] + fresult[1] + fresult[2] + fresult[3])*(0.5f/(float)M_PI);
- result= MAX2(result, 0.0f);
+ result = (fresult[0] + fresult[1] + fresult[2] + fresult[3]) * (0.5f / (float)M_PI);
+ result = MAX2(result, 0.0f);
return result;
}
@@ -3012,19 +3035,20 @@ static float ff_quad_form_factor(float *p, float *n, float *q0, float *q1, float
static void ff_normalize(float n[3])
{
float d;
-
- d= dot_v3v3(n, n);
- if(d > 1.0e-35F) {
- d= 1.0f/sqrtf(d);
+ d = dot_v3v3(n, n);
+
+ if (d > 1.0e-35F) {
+ d = 1.0f / sqrtf(d);
- n[0] *= d;
- n[1] *= d;
+ n[0] *= d;
+ n[1] *= d;
n[2] *= d;
- }
+ }
}
-static float ff_quad_form_factor(const float p[3], const float n[3], const float q0[3], const float q1[3], const float q2[3], const float q3[3])
+static float ff_quad_form_factor(const float p[3], const float n[3],
+ const float q0[3], const float q1[3], const float q2[3], const float q3[3])
{
float r0[3], r1[3], r2[3], r3[3], g0[3], g1[3], g2[3], g3[3];
float a1, a2, a3, a4, dot1, dot2, dot3, dot4, result;
@@ -3039,23 +3063,27 @@ static float ff_quad_form_factor(const float p[3], const float n[3], const float
ff_normalize(r2);
ff_normalize(r3);
- cross_v3_v3v3(g0, r1, r0); ff_normalize(g0);
- cross_v3_v3v3(g1, r2, r1); ff_normalize(g1);
- cross_v3_v3v3(g2, r3, r2); ff_normalize(g2);
- cross_v3_v3v3(g3, r0, r3); ff_normalize(g3);
+ cross_v3_v3v3(g0, r1, r0);
+ ff_normalize(g0);
+ cross_v3_v3v3(g1, r2, r1);
+ ff_normalize(g1);
+ cross_v3_v3v3(g2, r3, r2);
+ ff_normalize(g2);
+ cross_v3_v3v3(g3, r0, r3);
+ ff_normalize(g3);
- a1= saacosf(dot_v3v3(r0, r1));
- a2= saacosf(dot_v3v3(r1, r2));
- a3= saacosf(dot_v3v3(r2, r3));
- a4= saacosf(dot_v3v3(r3, r0));
+ a1 = saacosf(dot_v3v3(r0, r1));
+ a2 = saacosf(dot_v3v3(r1, r2));
+ a3 = saacosf(dot_v3v3(r2, r3));
+ a4 = saacosf(dot_v3v3(r3, r0));
- dot1= dot_v3v3(n, g0);
- dot2= dot_v3v3(n, g1);
- dot3= dot_v3v3(n, g2);
- dot4= dot_v3v3(n, g3);
+ dot1 = dot_v3v3(n, g0);
+ dot2 = dot_v3v3(n, g1);
+ dot3 = dot_v3v3(n, g2);
+ dot4 = dot_v3v3(n, g3);
- result= (a1*dot1 + a2*dot2 + a3*dot3 + a4*dot4)*0.5f/(float)M_PI;
- result= MAX2(result, 0.0f);
+ result = (a1 * dot1 + a2 * dot2 + a3 * dot3 + a4 * dot4) * 0.5f / (float)M_PI;
+ result = MAX2(result, 0.0f);
return result;
}
@@ -3063,37 +3091,52 @@ 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 */
- float q0[3], q1[3], q2[3], q3[3], contrib= 0.0f;
+ * 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))
+ if (ff_visible_quad(p, n, v1, v2, v3, q0, q1, q2, q3))
contrib += ff_quad_form_factor(p, n, q0, q1, q2, q3);
-
- if(v4 && ff_visible_quad(p, n, v1, v3, v4, q0, q1, q2, q3))
+
+ if (v4 && ff_visible_quad(p, n, v1, v3, v4, q0, q1, q2, q3))
contrib += ff_quad_form_factor(p, n, q0, q1, q2, q3);
return contrib;
}
/* evaluate if entire quad is a proper convex quad */
- int is_quad_convex_v3(const float *v1, const float *v2, const float *v3, const float *v4)
- {
+int is_quad_convex_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3])
+{
float nor[3], nor1[3], nor2[3], vec[4][2];
int axis_a, axis_b;
-
+
/* define projection, do both trias apart, quad is undefined! */
+
normal_tri_v3(nor1, v1, v2, v3);
normal_tri_v3(nor2, v1, v3, v4);
+
+ /* when the face is folded over as 2 tris we probably don't want to create
+ * a quad from it, but go ahead with the intersection test since this
+ * isn't a function for degenerate faces */
+ if (UNLIKELY(dot_v3v3(nor1, nor2) < 0.0f)) {
+ /* flip so adding normals in the opposite direction
+ * doesnt give a zero length vector */
+ negate_v3(nor2);
+ }
+
add_v3_v3v3(nor, nor1, nor2);
axis_dominant_v3(&axis_a, &axis_b, nor);
- vec[0][0]= v1[axis_a]; vec[0][1]= v1[axis_b];
- vec[1][0]= v2[axis_a]; vec[1][1]= v2[axis_b];
+ vec[0][0] = v1[axis_a];
+ vec[0][1] = v1[axis_b];
+ vec[1][0] = v2[axis_a];
+ vec[1][1] = v2[axis_b];
+
+ vec[2][0] = v3[axis_a];
+ vec[2][1] = v3[axis_b];
+ vec[3][0] = v4[axis_a];
+ vec[3][1] = v4[axis_b];
- vec[2][0]= v3[axis_a]; vec[2][1]= v3[axis_b];
- vec[3][0]= v4[axis_a]; vec[3][1]= v4[axis_b];
-
/* linetests, the 2 diagonals have to instersect to be convex */
- return (isect_line_line_v2(vec[0], vec[2], vec[1], vec[3]) > 0) ? 1 : 0;
+ return (isect_line_line_v2(vec[0], vec[2], vec[1], vec[3]) > 0) ? TRUE : FALSE;
}
diff --git a/source/blender/blenlib/intern/math_geom_inline.c b/source/blender/blenlib/intern/math_geom_inline.c
index 9031d52cf4c..0d4c797cefb 100644
--- a/source/blender/blenlib/intern/math_geom_inline.c
+++ b/source/blender/blenlib/intern/math_geom_inline.c
@@ -37,19 +37,19 @@
MINLINE void zero_sh(float r[9])
{
- memset(r, 0, sizeof(float)*9);
+ memset(r, 0, sizeof(float) * 9);
}
MINLINE void copy_sh_sh(float r[9], const float a[9])
{
- memcpy(r, a, sizeof(float)*9);
+ memcpy(r, a, sizeof(float) * 9);
}
MINLINE void mul_sh_fl(float r[9], const float f)
{
int i;
- for(i=0; i<9; i++)
+ for (i = 0; i < 9; i++)
r[i] *= f;
}
@@ -57,18 +57,18 @@ MINLINE void add_sh_shsh(float r[9], const float a[9], const float b[9])
{
int i;
- for(i=0; i<9; i++)
- r[i]= a[i] + b[i];
+ for (i = 0; i < 9; i++)
+ r[i] = a[i] + b[i];
}
MINLINE float dot_shsh(float a[9], float b[9])
{
- float r= 0.0f;
+ float r = 0.0f;
int i;
- for(i=0; i<9; i++)
- r += a[i]*b[i];
-
+ for (i = 0; i < 9; i++)
+ r += a[i] * b[i];
+
return r;
}
@@ -80,16 +80,16 @@ MINLINE float diffuse_shv3(float sh[9], const float v[3])
static const float c4 = 0.886227f, c5 = 0.247708f;
float x, y, z, sum;
- x= v[0];
- y= v[1];
- z= v[2];
+ x = v[0];
+ y = v[1];
+ z = v[2];
- sum= c1*sh[8]*(x*x - y*y);
- sum += c3*sh[6]*z*z;
- sum += c4*sh[0];
- sum += -c5*sh[6];
- sum += 2.0f*c1*(sh[4]*x*y + sh[7]*x*z + sh[5]*y*z);
- sum += 2.0f*c2*(sh[3]*x + sh[1]*y + sh[2]*z);
+ sum = c1 * sh[8] * (x * x - y * y);
+ sum += c3 * sh[6] * z * z;
+ sum += c4 * sh[0];
+ sum += -c5 * sh[6];
+ sum += 2.0f * c1 * (sh[4] * x * y + sh[7] * x * z + sh[5] * y * z);
+ sum += 2.0f * c2 * (sh[3] * x + sh[1] * y + sh[2] * z);
return sum;
}
@@ -100,21 +100,21 @@ MINLINE void vec_fac_to_sh(float r[9], const float v[3], const float f)
* "An Efficient Representation for Irradiance Environment Maps" */
float sh[9], x, y, z;
- x= v[0];
- y= v[1];
- z= v[2];
-
- sh[0]= 0.282095f;
-
- sh[1]= 0.488603f*y;
- sh[2]= 0.488603f*z;
- sh[3]= 0.488603f*x;
-
- sh[4]= 1.092548f*x*y;
- sh[5]= 1.092548f*y*z;
- sh[6]= 0.315392f*(3.0f*z*z - 1.0f);
- sh[7]= 1.092548f*x*z;
- sh[8]= 0.546274f*(x*x - y*y);
+ x = v[0];
+ y = v[1];
+ z = v[2];
+
+ sh[0] = 0.282095f;
+
+ sh[1] = 0.488603f * y;
+ sh[2] = 0.488603f * z;
+ sh[3] = 0.488603f * x;
+
+ sh[4] = 1.092548f * x * y;
+ sh[5] = 1.092548f * y * z;
+ sh[6] = 0.315392f * (3.0f * z * z - 1.0f);
+ sh[7] = 1.092548f * x * z;
+ sh[8] = 0.546274f * (x * x - y * y);
mul_sh_fl(sh, f);
copy_sh_sh(r, sh);
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index f1dc65bd066..76b986d7346 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -35,80 +35,80 @@
void zero_m3(float m[3][3])
{
- memset(m, 0, 3*3*sizeof(float));
+ memset(m, 0, 3 * 3 * sizeof(float));
}
void zero_m4(float m[4][4])
{
- memset(m, 0, 4*4*sizeof(float));
+ memset(m, 0, 4 * 4 * sizeof(float));
}
void unit_m3(float m[][3])
{
- m[0][0]= m[1][1]= m[2][2]= 1.0;
- m[0][1]= m[0][2]= 0.0;
- m[1][0]= m[1][2]= 0.0;
- m[2][0]= m[2][1]= 0.0;
+ m[0][0] = m[1][1] = m[2][2] = 1.0;
+ m[0][1] = m[0][2] = 0.0;
+ m[1][0] = m[1][2] = 0.0;
+ m[2][0] = m[2][1] = 0.0;
}
void unit_m4(float m[][4])
{
- m[0][0]= m[1][1]= m[2][2]= m[3][3]= 1.0;
- m[0][1]= m[0][2]= m[0][3]= 0.0;
- m[1][0]= m[1][2]= m[1][3]= 0.0;
- m[2][0]= m[2][1]= m[2][3]= 0.0;
- m[3][0]= m[3][1]= m[3][2]= 0.0;
+ m[0][0] = m[1][1] = m[2][2] = m[3][3] = 1.0;
+ m[0][1] = m[0][2] = m[0][3] = 0.0;
+ m[1][0] = m[1][2] = m[1][3] = 0.0;
+ m[2][0] = m[2][1] = m[2][3] = 0.0;
+ m[3][0] = m[3][1] = m[3][2] = 0.0;
}
-void copy_m3_m3(float m1[][3], float m2[][3])
-{
+void copy_m3_m3(float m1[][3], float m2[][3])
+{
/* destination comes first: */
- memcpy(&m1[0], &m2[0], 9*sizeof(float));
+ memcpy(&m1[0], &m2[0], 9 * sizeof(float));
}
-void copy_m4_m4(float m1[][4], float m2[][4])
+void copy_m4_m4(float m1[][4], float m2[][4])
{
- memcpy(m1, m2, 4*4*sizeof(float));
+ memcpy(m1, m2, 4 * 4 * sizeof(float));
}
void copy_m3_m4(float m1[][3], float m2[][4])
{
- m1[0][0]= m2[0][0];
- m1[0][1]= m2[0][1];
- m1[0][2]= m2[0][2];
+ m1[0][0] = m2[0][0];
+ m1[0][1] = m2[0][1];
+ m1[0][2] = m2[0][2];
- m1[1][0]= m2[1][0];
- m1[1][1]= m2[1][1];
- m1[1][2]= m2[1][2];
+ m1[1][0] = m2[1][0];
+ m1[1][1] = m2[1][1];
+ m1[1][2] = m2[1][2];
- m1[2][0]= m2[2][0];
- m1[2][1]= m2[2][1];
- m1[2][2]= m2[2][2];
+ m1[2][0] = m2[2][0];
+ m1[2][1] = m2[2][1];
+ m1[2][2] = m2[2][2];
}
-void copy_m4_m3(float m1[][4], float m2[][3]) /* no clear */
+void copy_m4_m3(float m1[][4], float m2[][3]) /* no clear */
{
- m1[0][0]= m2[0][0];
- m1[0][1]= m2[0][1];
- m1[0][2]= m2[0][2];
+ m1[0][0] = m2[0][0];
+ m1[0][1] = m2[0][1];
+ m1[0][2] = m2[0][2];
- m1[1][0]= m2[1][0];
- m1[1][1]= m2[1][1];
- m1[1][2]= m2[1][2];
+ m1[1][0] = m2[1][0];
+ m1[1][1] = m2[1][1];
+ m1[1][2] = m2[1][2];
- m1[2][0]= m2[2][0];
- m1[2][1]= m2[2][1];
- m1[2][2]= m2[2][2];
+ m1[2][0] = m2[2][0];
+ m1[2][1] = m2[2][1];
+ m1[2][2] = m2[2][2];
/* Reevan's Bugfix */
- m1[0][3]=0.0F;
- m1[1][3]=0.0F;
- m1[2][3]=0.0F;
+ m1[0][3] = 0.0F;
+ m1[1][3] = 0.0F;
+ m1[2][3] = 0.0F;
- m1[3][0]=0.0F;
- m1[3][1]=0.0F;
- m1[3][2]=0.0F;
- m1[3][3]=1.0F;
+ m1[3][0] = 0.0F;
+ m1[3][1] = 0.0F;
+ m1[3][2] = 0.0F;
+ m1[3][3] = 1.0F;
}
@@ -117,9 +117,9 @@ void swap_m3m3(float m1[][3], float m2[][3])
float t;
int i, j;
- for(i = 0; i < 3; i++) {
+ for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
- t = m1[i][j];
+ t = m1[i][j];
m1[i][j] = m2[i][j];
m2[i][j] = t;
}
@@ -131,9 +131,9 @@ void swap_m4m4(float m1[][4], float m2[][4])
float t;
int i, j;
- for(i = 0; i < 4; i++) {
+ for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
- t = m1[i][j];
+ t = m1[i][j];
m1[i][j] = m2[i][j];
m2[i][j] = t;
}
@@ -151,25 +151,25 @@ void mult_m4_m4m4(float m1[][4], float m3_[][4], float m2_[][4])
copy_m4_m4(m3, m3_);
/* matrix product: m1[j][k] = m2[j][i].m3[i][k] */
- m1[0][0] = m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0] + m2[0][3]*m3[3][0];
- m1[0][1] = m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1] + m2[0][3]*m3[3][1];
- m1[0][2] = m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2] + m2[0][3]*m3[3][2];
- m1[0][3] = m2[0][0]*m3[0][3] + m2[0][1]*m3[1][3] + m2[0][2]*m3[2][3] + m2[0][3]*m3[3][3];
+ m1[0][0] = m2[0][0] * m3[0][0] + m2[0][1] * m3[1][0] + m2[0][2] * m3[2][0] + m2[0][3] * m3[3][0];
+ m1[0][1] = m2[0][0] * m3[0][1] + m2[0][1] * m3[1][1] + m2[0][2] * m3[2][1] + m2[0][3] * m3[3][1];
+ m1[0][2] = m2[0][0] * m3[0][2] + m2[0][1] * m3[1][2] + m2[0][2] * m3[2][2] + m2[0][3] * m3[3][2];
+ m1[0][3] = m2[0][0] * m3[0][3] + m2[0][1] * m3[1][3] + m2[0][2] * m3[2][3] + m2[0][3] * m3[3][3];
- m1[1][0] = m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0] + m2[1][3]*m3[3][0];
- m1[1][1] = m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1] + m2[1][3]*m3[3][1];
- m1[1][2] = m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2] + m2[1][3]*m3[3][2];
- m1[1][3] = m2[1][0]*m3[0][3] + m2[1][1]*m3[1][3] + m2[1][2]*m3[2][3] + m2[1][3]*m3[3][3];
+ m1[1][0] = m2[1][0] * m3[0][0] + m2[1][1] * m3[1][0] + m2[1][2] * m3[2][0] + m2[1][3] * m3[3][0];
+ m1[1][1] = m2[1][0] * m3[0][1] + m2[1][1] * m3[1][1] + m2[1][2] * m3[2][1] + m2[1][3] * m3[3][1];
+ m1[1][2] = m2[1][0] * m3[0][2] + m2[1][1] * m3[1][2] + m2[1][2] * m3[2][2] + m2[1][3] * m3[3][2];
+ m1[1][3] = m2[1][0] * m3[0][3] + m2[1][1] * m3[1][3] + m2[1][2] * m3[2][3] + m2[1][3] * m3[3][3];
- m1[2][0] = m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0] + m2[2][3]*m3[3][0];
- m1[2][1] = m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1] + m2[2][3]*m3[3][1];
- m1[2][2] = m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2] + m2[2][3]*m3[3][2];
- m1[2][3] = m2[2][0]*m3[0][3] + m2[2][1]*m3[1][3] + m2[2][2]*m3[2][3] + m2[2][3]*m3[3][3];
+ m1[2][0] = m2[2][0] * m3[0][0] + m2[2][1] * m3[1][0] + m2[2][2] * m3[2][0] + m2[2][3] * m3[3][0];
+ m1[2][1] = m2[2][0] * m3[0][1] + m2[2][1] * m3[1][1] + m2[2][2] * m3[2][1] + m2[2][3] * m3[3][1];
+ m1[2][2] = m2[2][0] * m3[0][2] + m2[2][1] * m3[1][2] + m2[2][2] * m3[2][2] + m2[2][3] * m3[3][2];
+ m1[2][3] = m2[2][0] * m3[0][3] + m2[2][1] * m3[1][3] + m2[2][2] * m3[2][3] + m2[2][3] * m3[3][3];
- m1[3][0] = m2[3][0]*m3[0][0] + m2[3][1]*m3[1][0] + m2[3][2]*m3[2][0] + m2[3][3]*m3[3][0];
- m1[3][1] = m2[3][0]*m3[0][1] + m2[3][1]*m3[1][1] + m2[3][2]*m3[2][1] + m2[3][3]*m3[3][1];
- m1[3][2] = m2[3][0]*m3[0][2] + m2[3][1]*m3[1][2] + m2[3][2]*m3[2][2] + m2[3][3]*m3[3][2];
- m1[3][3] = m2[3][0]*m3[0][3] + m2[3][1]*m3[1][3] + m2[3][2]*m3[2][3] + m2[3][3]*m3[3][3];
+ m1[3][0] = m2[3][0] * m3[0][0] + m2[3][1] * m3[1][0] + m2[3][2] * m3[2][0] + m2[3][3] * m3[3][0];
+ m1[3][1] = m2[3][0] * m3[0][1] + m2[3][1] * m3[1][1] + m2[3][2] * m3[2][1] + m2[3][3] * m3[3][1];
+ m1[3][2] = m2[3][0] * m3[0][2] + m2[3][1] * m3[1][2] + m2[3][2] * m3[2][2] + m2[3][3] * m3[3][2];
+ m1[3][3] = m2[3][0] * m3[0][3] + m2[3][1] * m3[1][3] + m2[3][2] * m3[2][3] + m2[3][3] * m3[3][3];
}
@@ -181,18 +181,18 @@ void mul_m3_m3m3(float m1[][3], float m3_[][3], float m2_[][3])
copy_m3_m3(m2, m2_);
copy_m3_m3(m3, m3_);
- /* m1[i][j] = m2[i][k]*m3[k][j], args are flipped! */
- m1[0][0]= m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0];
- m1[0][1]= m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1];
- m1[0][2]= m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2];
+ /* m1[i][j] = m2[i][k] * m3[k][j], args are flipped! */
+ m1[0][0] = m2[0][0] * m3[0][0] + m2[0][1] * m3[1][0] + m2[0][2] * m3[2][0];
+ m1[0][1] = m2[0][0] * m3[0][1] + m2[0][1] * m3[1][1] + m2[0][2] * m3[2][1];
+ m1[0][2] = m2[0][0] * m3[0][2] + m2[0][1] * m3[1][2] + m2[0][2] * m3[2][2];
- m1[1][0]= m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0];
- m1[1][1]= m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1];
- m1[1][2]= m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2];
+ m1[1][0] = m2[1][0] * m3[0][0] + m2[1][1] * m3[1][0] + m2[1][2] * m3[2][0];
+ m1[1][1] = m2[1][0] * m3[0][1] + m2[1][1] * m3[1][1] + m2[1][2] * m3[2][1];
+ m1[1][2] = m2[1][0] * m3[0][2] + m2[1][1] * m3[1][2] + m2[1][2] * m3[2][2];
- m1[2][0]= m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0];
- m1[2][1]= m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1];
- m1[2][2]= m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2];
+ m1[2][0] = m2[2][0] * m3[0][0] + m2[2][1] * m3[1][0] + m2[2][2] * m3[2][0];
+ m1[2][1] = m2[2][0] * m3[0][1] + m2[2][1] * m3[1][1] + m2[2][2] * m3[2][1];
+ m1[2][2] = m2[2][0] * m3[0][2] + m2[2][1] * m3[1][2] + m2[2][2] * m3[2][2];
}
void mul_m4_m4m3(float (*m1)[4], float (*m3_)[4], float (*m2_)[3])
@@ -203,68 +203,68 @@ void mul_m4_m4m3(float (*m1)[4], float (*m3_)[4], float (*m2_)[3])
copy_m3_m3(m2, m2_);
copy_m4_m4(m3, m3_);
- m1[0][0]= m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0];
- m1[0][1]= m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1];
- m1[0][2]= m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2];
- m1[1][0]= m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0];
- m1[1][1]= m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1];
- m1[1][2]= m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2];
- m1[2][0]= m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0];
- m1[2][1]= m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1];
- m1[2][2]= m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2];
+ m1[0][0] = m2[0][0] * m3[0][0] + m2[0][1] * m3[1][0] + m2[0][2] * m3[2][0];
+ m1[0][1] = m2[0][0] * m3[0][1] + m2[0][1] * m3[1][1] + m2[0][2] * m3[2][1];
+ m1[0][2] = m2[0][0] * m3[0][2] + m2[0][1] * m3[1][2] + m2[0][2] * m3[2][2];
+ m1[1][0] = m2[1][0] * m3[0][0] + m2[1][1] * m3[1][0] + m2[1][2] * m3[2][0];
+ m1[1][1] = m2[1][0] * m3[0][1] + m2[1][1] * m3[1][1] + m2[1][2] * m3[2][1];
+ m1[1][2] = m2[1][0] * m3[0][2] + m2[1][1] * m3[1][2] + m2[1][2] * m3[2][2];
+ m1[2][0] = m2[2][0] * m3[0][0] + m2[2][1] * m3[1][0] + m2[2][2] * m3[2][0];
+ m1[2][1] = m2[2][0] * m3[0][1] + m2[2][1] * m3[1][1] + m2[2][2] * m3[2][1];
+ m1[2][2] = m2[2][0] * m3[0][2] + m2[2][1] * m3[1][2] + m2[2][2] * m3[2][2];
}
-/* m1 = m2 * m3, ignore the elements on the 4th row/column of m3*/
+/* m1 = m2 * m3, ignore the elements on the 4th row/column of m3 */
void mult_m3_m3m4(float m1[][3], float m3[][4], float m2[][3])
{
/* m1[i][j] = m2[i][k] * m3[k][j] */
- m1[0][0] = m2[0][0] * m3[0][0] + m2[0][1] * m3[1][0] +m2[0][2] * m3[2][0];
- m1[0][1] = m2[0][0] * m3[0][1] + m2[0][1] * m3[1][1] +m2[0][2] * m3[2][1];
- m1[0][2] = m2[0][0] * m3[0][2] + m2[0][1] * m3[1][2] +m2[0][2] * m3[2][2];
+ m1[0][0] = m2[0][0] * m3[0][0] + m2[0][1] * m3[1][0] + m2[0][2] * m3[2][0];
+ m1[0][1] = m2[0][0] * m3[0][1] + m2[0][1] * m3[1][1] + m2[0][2] * m3[2][1];
+ m1[0][2] = m2[0][0] * m3[0][2] + m2[0][1] * m3[1][2] + m2[0][2] * m3[2][2];
- m1[1][0] = m2[1][0] * m3[0][0] + m2[1][1] * m3[1][0] +m2[1][2] * m3[2][0];
- m1[1][1] = m2[1][0] * m3[0][1] + m2[1][1] * m3[1][1] +m2[1][2] * m3[2][1];
- m1[1][2] = m2[1][0] * m3[0][2] + m2[1][1] * m3[1][2] +m2[1][2] * m3[2][2];
+ m1[1][0] = m2[1][0] * m3[0][0] + m2[1][1] * m3[1][0] + m2[1][2] * m3[2][0];
+ m1[1][1] = m2[1][0] * m3[0][1] + m2[1][1] * m3[1][1] + m2[1][2] * m3[2][1];
+ m1[1][2] = m2[1][0] * m3[0][2] + m2[1][1] * m3[1][2] + m2[1][2] * m3[2][2];
- m1[2][0] = m2[2][0] * m3[0][0] + m2[2][1] * m3[1][0] +m2[2][2] * m3[2][0];
- m1[2][1] = m2[2][0] * m3[0][1] + m2[2][1] * m3[1][1] +m2[2][2] * m3[2][1];
- m1[2][2] = m2[2][0] * m3[0][2] + m2[2][1] * m3[1][2] +m2[2][2] * m3[2][2];
+ m1[2][0] = m2[2][0] * m3[0][0] + m2[2][1] * m3[1][0] + m2[2][2] * m3[2][0];
+ m1[2][1] = m2[2][0] * m3[0][1] + m2[2][1] * m3[1][1] + m2[2][2] * m3[2][1];
+ m1[2][2] = m2[2][0] * m3[0][2] + m2[2][1] * m3[1][2] + m2[2][2] * m3[2][2];
}
void mul_m4_m3m4(float (*m1)[4], float (*m3)[3], float (*m2)[4])
{
- m1[0][0]= m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0];
- m1[0][1]= m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1];
- m1[0][2]= m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2];
- m1[1][0]= m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0];
- m1[1][1]= m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1];
- m1[1][2]= m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2];
- m1[2][0]= m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0];
- m1[2][1]= m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1];
- m1[2][2]= m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2];
+ m1[0][0] = m2[0][0] * m3[0][0] + m2[0][1] * m3[1][0] + m2[0][2] * m3[2][0];
+ m1[0][1] = m2[0][0] * m3[0][1] + m2[0][1] * m3[1][1] + m2[0][2] * m3[2][1];
+ m1[0][2] = m2[0][0] * m3[0][2] + m2[0][1] * m3[1][2] + m2[0][2] * m3[2][2];
+ m1[1][0] = m2[1][0] * m3[0][0] + m2[1][1] * m3[1][0] + m2[1][2] * m3[2][0];
+ m1[1][1] = m2[1][0] * m3[0][1] + m2[1][1] * m3[1][1] + m2[1][2] * m3[2][1];
+ m1[1][2] = m2[1][0] * m3[0][2] + m2[1][1] * m3[1][2] + m2[1][2] * m3[2][2];
+ m1[2][0] = m2[2][0] * m3[0][0] + m2[2][1] * m3[1][0] + m2[2][2] * m3[2][0];
+ m1[2][1] = m2[2][0] * m3[0][1] + m2[2][1] * m3[1][1] + m2[2][2] * m3[2][1];
+ m1[2][2] = m2[2][0] * m3[0][2] + m2[2][1] * m3[1][2] + m2[2][2] * m3[2][2];
}
void mul_serie_m3(float answ[][3],
- float m1[][3], float m2[][3], float m3[][3],
- float m4[][3], float m5[][3], float m6[][3],
- float m7[][3], float m8[][3])
+ float m1[][3], float m2[][3], float m3[][3],
+ float m4[][3], float m5[][3], float m6[][3],
+ float m7[][3], float m8[][3])
{
float temp[3][3];
-
- if(m1==NULL || m2==NULL) return;
-
+
+ if (m1 == NULL || m2 == NULL) return;
+
mul_m3_m3m3(answ, m2, m1);
- if(m3) {
+ if (m3) {
mul_m3_m3m3(temp, m3, answ);
- if(m4) {
+ if (m4) {
mul_m3_m3m3(answ, m4, temp);
- if(m5) {
+ if (m5) {
mul_m3_m3m3(temp, m5, answ);
- if(m6) {
+ if (m6) {
mul_m3_m3m3(answ, m6, temp);
- if(m7) {
+ if (m7) {
mul_m3_m3m3(temp, m7, answ);
- if(m8) {
+ if (m8) {
mul_m3_m3m3(answ, m8, temp);
}
else copy_m3_m3(answ, temp);
@@ -278,26 +278,26 @@ void mul_serie_m3(float answ[][3],
}
void mul_serie_m4(float answ[][4], float m1[][4],
- float m2[][4], float m3[][4], float m4[][4],
- float m5[][4], float m6[][4], float m7[][4],
- float m8[][4])
+ float m2[][4], float m3[][4], float m4[][4],
+ float m5[][4], float m6[][4], float m7[][4],
+ float m8[][4])
{
float temp[4][4];
-
- if(m1==NULL || m2==NULL) return;
-
+
+ if (m1 == NULL || m2 == NULL) return;
+
mult_m4_m4m4(answ, m1, m2);
- if(m3) {
+ if (m3) {
mult_m4_m4m4(temp, answ, m3);
- if(m4) {
+ if (m4) {
mult_m4_m4m4(answ, temp, m4);
- if(m5) {
+ if (m5) {
mult_m4_m4m4(temp, answ, m5);
- if(m6) {
+ if (m6) {
mult_m4_m4m4(answ, temp, m6);
- if(m7) {
+ if (m7) {
mult_m4_m4m4(temp, answ, m7);
- if(m8) {
+ if (m8) {
mult_m4_m4m4(answ, temp, m8);
}
else copy_m4_m4(answ, temp);
@@ -312,41 +312,41 @@ void mul_serie_m4(float answ[][4], float m1[][4],
void mul_m4_v3(float mat[][4], float vec[3])
{
- float x,y;
+ float x, y;
- x=vec[0];
- y=vec[1];
- vec[0]=x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2] + mat[3][0];
- vec[1]=x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2] + mat[3][1];
- vec[2]=x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2] + mat[3][2];
+ x = vec[0];
+ y = vec[1];
+ vec[0] = x * mat[0][0] + y * mat[1][0] + mat[2][0] * vec[2] + mat[3][0];
+ vec[1] = x * mat[0][1] + y * mat[1][1] + mat[2][1] * vec[2] + mat[3][1];
+ vec[2] = x * mat[0][2] + y * mat[1][2] + mat[2][2] * vec[2] + mat[3][2];
}
void mul_v3_m4v3(float in[3], float mat[][4], const float vec[3])
{
- float x,y;
+ float x, y;
- x=vec[0];
- y=vec[1];
- in[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2] + mat[3][0];
- in[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2] + mat[3][1];
- in[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2] + mat[3][2];
+ x = vec[0];
+ y = vec[1];
+ in[0] = x * mat[0][0] + y * mat[1][0] + mat[2][0] * vec[2] + mat[3][0];
+ in[1] = x * mat[0][1] + y * mat[1][1] + mat[2][1] * vec[2] + mat[3][1];
+ in[2] = x * mat[0][2] + y * mat[1][2] + mat[2][2] * vec[2] + mat[3][2];
}
/* same as mul_m4_v3() but doesnt apply translation component */
void mul_mat3_m4_v3(float mat[][4], float vec[3])
{
- float x,y;
+ float x, y;
- x= vec[0];
- y= vec[1];
- vec[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2];
- vec[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2];
- vec[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2];
+ x = vec[0];
+ y = vec[1];
+ vec[0] = x * mat[0][0] + y * mat[1][0] + mat[2][0] * vec[2];
+ vec[1] = x * mat[0][1] + y * mat[1][1] + mat[2][1] * vec[2];
+ vec[2] = x * mat[0][2] + y * mat[1][2] + mat[2][2] * vec[2];
}
void mul_project_m4_v3(float mat[][4], float vec[3])
{
- const float w= vec[0]*mat[0][3] + vec[1]*mat[1][3] + vec[2]*mat[2][3] + mat[3][3];
+ const float w = vec[0] * mat[0][3] + vec[1] * mat[1][3] + vec[2] * mat[2][3] + mat[3][3];
mul_m4_v3(mat, vec);
vec[0] /= w;
@@ -358,14 +358,14 @@ void mul_v4_m4v4(float r[4], float mat[4][4], float v[4])
{
float x, y, z;
- x= v[0];
- y= v[1];
- z= v[2];
+ x = v[0];
+ y = v[1];
+ z = v[2];
- r[0]= x*mat[0][0] + y*mat[1][0] + z*mat[2][0] + mat[3][0]*v[3];
- r[1]= x*mat[0][1] + y*mat[1][1] + z*mat[2][1] + mat[3][1]*v[3];
- r[2]= x*mat[0][2] + y*mat[1][2] + z*mat[2][2] + mat[3][2]*v[3];
- r[3]= x*mat[0][3] + y*mat[1][3] + z*mat[2][3] + mat[3][3]*v[3];
+ r[0] = x * mat[0][0] + y * mat[1][0] + z * mat[2][0] + mat[3][0] * v[3];
+ r[1] = x * mat[0][1] + y * mat[1][1] + z * mat[2][1] + mat[3][1] * v[3];
+ r[2] = x * mat[0][2] + y * mat[1][2] + z * mat[2][2] + mat[3][2] * v[3];
+ r[3] = x * mat[0][3] + y * mat[1][3] + z * mat[2][3] + mat[3][3] * v[3];
}
void mul_m4_v4(float mat[4][4], float r[4])
@@ -373,11 +373,30 @@ 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];
- r[1]= M[0][1]*a[0] + M[1][1]*a[1] + M[2][1]*a[2];
- r[2]= M[0][2]*a[0] + M[1][2]*a[1] + M[2][2]*a[2];
+ r[0] = M[0][0] * a[0] + M[1][0] * a[1] + M[2][0] * a[2];
+ r[1] = M[0][1] * a[0] + M[1][1] * a[1] + M[2][1] * a[2];
+ r[2] = M[0][2] * a[0] + M[1][2] * a[1] + M[2][2] * a[2];
}
void mul_m3_v3(float M[3][3], float r[3])
@@ -390,21 +409,21 @@ void mul_m3_v3(float M[3][3], float r[3])
void mul_transposed_m3_v3(float mat[][3], float vec[3])
{
- float x,y;
+ float x, y;
- x=vec[0];
- y=vec[1];
- vec[0]= x*mat[0][0] + y*mat[0][1] + mat[0][2]*vec[2];
- vec[1]= x*mat[1][0] + y*mat[1][1] + mat[1][2]*vec[2];
- vec[2]= x*mat[2][0] + y*mat[2][1] + mat[2][2]*vec[2];
+ x = vec[0];
+ y = vec[1];
+ vec[0] = x * mat[0][0] + y * mat[0][1] + mat[0][2] * vec[2];
+ vec[1] = x * mat[1][0] + y * mat[1][1] + mat[1][2] * vec[2];
+ vec[2] = x * mat[2][0] + y * mat[2][1] + mat[2][2] * vec[2];
}
void mul_m3_fl(float m[3][3], float f)
{
int i, j;
- for(i=0;i<3;i++)
- for(j=0;j<3;j++)
+ for (i = 0; i < 3; i++)
+ for (j = 0; j < 3; j++)
m[i][j] *= f;
}
@@ -412,8 +431,8 @@ void mul_m4_fl(float m[4][4], float f)
{
int i, j;
- for(i=0;i<4;i++)
- for(j=0;j<4;j++)
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 4; j++)
m[i][j] *= f;
}
@@ -421,56 +440,56 @@ void mul_mat3_m4_fl(float m[4][4], float f)
{
int i, j;
- for(i=0; i<3; i++)
- for(j=0; j<3; j++)
+ for (i = 0; i < 3; i++)
+ for (j = 0; j < 3; j++)
m[i][j] *= f;
}
void mul_m3_v3_double(float mat[][3], double vec[3])
{
- double x,y;
+ double x, y;
- x=vec[0];
- y=vec[1];
- vec[0]= x*(double)mat[0][0] + y*(double)mat[1][0] + (double)mat[2][0]*vec[2];
- vec[1]= x*(double)mat[0][1] + y*(double)mat[1][1] + (double)mat[2][1]*vec[2];
- vec[2]= x*(double)mat[0][2] + y*(double)mat[1][2] + (double)mat[2][2]*vec[2];
+ x = vec[0];
+ y = vec[1];
+ vec[0] = x * (double)mat[0][0] + y * (double)mat[1][0] + (double)mat[2][0] * vec[2];
+ vec[1] = x * (double)mat[0][1] + y * (double)mat[1][1] + (double)mat[2][1] * vec[2];
+ vec[2] = x * (double)mat[0][2] + y * (double)mat[1][2] + (double)mat[2][2] * vec[2];
}
void add_m3_m3m3(float m1[][3], float m2[][3], float m3[][3])
{
int i, j;
- for(i=0;i<3;i++)
- for(j=0;j<3;j++)
- m1[i][j]= m2[i][j] + m3[i][j];
+ for (i = 0; i < 3; i++)
+ for (j = 0; j < 3; j++)
+ m1[i][j] = m2[i][j] + m3[i][j];
}
void add_m4_m4m4(float m1[][4], float m2[][4], float m3[][4])
{
int i, j;
- for(i=0;i<4;i++)
- for(j=0;j<4;j++)
- m1[i][j]= m2[i][j] + m3[i][j];
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 4; j++)
+ m1[i][j] = m2[i][j] + m3[i][j];
}
void sub_m3_m3m3(float m1[][3], float m2[][3], float m3[][3])
{
int i, j;
- for(i=0;i<3;i++)
- for(j=0;j<3;j++)
- m1[i][j]= m2[i][j] - m3[i][j];
+ for (i = 0; i < 3; i++)
+ for (j = 0; j < 3; j++)
+ m1[i][j] = m2[i][j] - m3[i][j];
}
void sub_m4_m4m4(float m1[][4], float m2[][4], float m3[][4])
{
int i, j;
- for(i=0;i<4;i++)
- for(j=0;j<4;j++)
- m1[i][j]= m2[i][j] - m3[i][j];
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 4; j++)
+ m1[i][j] = m2[i][j] - m3[i][j];
}
int invert_m3(float m[3][3])
@@ -478,7 +497,7 @@ int invert_m3(float m[3][3])
float tmp[3][3];
int success;
- success= invert_m3_m3(tmp, m);
+ success = invert_m3_m3(tmp, m);
copy_m3_m3(m, tmp);
return success;
@@ -490,20 +509,20 @@ int invert_m3_m3(float m1[3][3], float m2[3][3])
int a, b, success;
/* calc adjoint */
- adjoint_m3_m3(m1,m2);
+ adjoint_m3_m3(m1, m2);
/* then determinant old matrix! */
- det= m2[0][0]* (m2[1][1]*m2[2][2] - m2[1][2]*m2[2][1])
- -m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1])
- +m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]);
+ det = (m2[0][0] * (m2[1][1] * m2[2][2] - m2[1][2] * m2[2][1]) -
+ m2[1][0] * (m2[0][1] * m2[2][2] - m2[0][2] * m2[2][1]) +
+ m2[2][0] * (m2[0][1] * m2[1][2] - m2[0][2] * m2[1][1]));
- success= (det != 0);
+ success = (det != 0);
- if(det==0) det=1;
- det= 1/det;
- for(a=0;a<3;a++) {
- for(b=0;b<3;b++) {
- m1[a][b]*=det;
+ if (det == 0) det = 1;
+ det = 1 / det;
+ for (a = 0; a < 3; a++) {
+ for (b = 0; b < 3; b++) {
+ m1[a][b] *= det;
}
}
@@ -515,17 +534,17 @@ int invert_m4(float m[4][4])
float tmp[4][4];
int success;
- success= invert_m4_m4(tmp, m);
+ success = invert_m4_m4(tmp, m);
copy_m4_m4(m, tmp);
return success;
}
/*
- * invertmat -
- * computes the inverse of mat and puts it in inverse. Returns
- * TRUE on success (i.e. can always find a pivot) and FALSE on failure.
- * Uses Gaussian Elimination with partial (maximal column) pivoting.
+ * invertmat -
+ * computes the inverse of mat and puts it in inverse. Returns
+ * TRUE on success (i.e. can always find a pivot) and FALSE on failure.
+ * Uses Gaussian Elimination with partial (maximal column) pivoting.
*
* Mark Segal - 1992
*/
@@ -539,30 +558,30 @@ int invert_m4_m4(float inverse[4][4], float mat[4][4])
int maxj;
/* Set inverse to identity */
- for (i=0; i<4; i++)
- for (j=0; j<4; j++)
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 4; j++)
inverse[i][j] = 0;
- for (i=0; i<4; i++)
+ for (i = 0; i < 4; i++)
inverse[i][i] = 1;
/* Copy original matrix so we don't mess it up */
- for(i = 0; i < 4; i++)
- for(j = 0; j <4; j++)
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 4; j++)
tempmat[i][j] = mat[i][j];
- for(i = 0; i < 4; i++) {
+ for (i = 0; i < 4; i++) {
/* Look for row with max pivot */
max = fabs(tempmat[i][i]);
maxj = i;
- for(j = i + 1; j < 4; j++) {
- if(fabsf(tempmat[j][i]) > max) {
+ for (j = i + 1; j < 4; j++) {
+ if (fabsf(tempmat[j][i]) > max) {
max = fabs(tempmat[j][i]);
maxj = j;
}
}
/* Swap rows if necessary */
if (maxj != i) {
- for(k = 0; k < 4; k++) {
+ for (k = 0; k < 4; k++) {
SWAP(float, tempmat[i][k], tempmat[maxj][k]);
SWAP(float, inverse[i][k], inverse[maxj][k]);
}
@@ -571,16 +590,16 @@ int invert_m4_m4(float inverse[4][4], float mat[4][4])
temp = tempmat[i][i];
if (temp == 0)
return 0; /* No non-zero pivot */
- for(k = 0; k < 4; k++) {
- tempmat[i][k] = (float)(tempmat[i][k]/temp);
- inverse[i][k] = (float)(inverse[i][k]/temp);
+ for (k = 0; k < 4; k++) {
+ tempmat[i][k] = (float)(tempmat[i][k] / temp);
+ inverse[i][k] = (float)(inverse[i][k] / temp);
}
- for(j = 0; j < 4; j++) {
- if(j != i) {
+ for (j = 0; j < 4; j++) {
+ if (j != i) {
temp = tempmat[j][i];
- for(k = 0; k < 4; k++) {
- tempmat[j][k] -= (float)(tempmat[i][k]*temp);
- inverse[j][k] -= (float)(inverse[i][k]*temp);
+ for (k = 0; k < 4; k++) {
+ tempmat[j][k] -= (float)(tempmat[i][k] * temp);
+ inverse[j][k] -= (float)(inverse[i][k] * temp);
}
}
}
@@ -636,23 +655,24 @@ void orthogonalize_m3(float mat[][3], int axis)
float size[3];
mat3_to_size(size, mat);
normalize_v3(mat[axis]);
- switch(axis)
- {
+ switch (axis) {
case 0:
if (dot_v3v3(mat[0], mat[1]) < 1) {
cross_v3_v3v3(mat[2], mat[0], mat[1]);
normalize_v3(mat[2]);
cross_v3_v3v3(mat[1], mat[2], mat[0]);
- } else if (dot_v3v3(mat[0], mat[2]) < 1) {
+ }
+ else if (dot_v3v3(mat[0], mat[2]) < 1) {
cross_v3_v3v3(mat[1], mat[2], mat[0]);
normalize_v3(mat[1]);
cross_v3_v3v3(mat[2], mat[0], mat[1]);
- } else {
+ }
+ else {
float vec[3];
- vec[0]= mat[0][1];
- vec[1]= mat[0][2];
- vec[2]= mat[0][0];
+ vec[0] = mat[0][1];
+ vec[1] = mat[0][2];
+ vec[2] = mat[0][0];
cross_v3_v3v3(mat[2], mat[0], vec);
normalize_v3(mat[2]);
@@ -663,16 +683,18 @@ void orthogonalize_m3(float mat[][3], int axis)
cross_v3_v3v3(mat[2], mat[0], mat[1]);
normalize_v3(mat[2]);
cross_v3_v3v3(mat[0], mat[1], mat[2]);
- } else if (dot_v3v3(mat[0], mat[2]) < 1) {
+ }
+ else if (dot_v3v3(mat[0], mat[2]) < 1) {
cross_v3_v3v3(mat[0], mat[1], mat[2]);
normalize_v3(mat[0]);
cross_v3_v3v3(mat[2], mat[0], mat[1]);
- } else {
+ }
+ else {
float vec[3];
- vec[0]= mat[1][1];
- vec[1]= mat[1][2];
- vec[2]= mat[1][0];
+ vec[0] = mat[1][1];
+ vec[1] = mat[1][2];
+ vec[2] = mat[1][0];
cross_v3_v3v3(mat[0], mat[1], vec);
normalize_v3(mat[0]);
@@ -683,16 +705,18 @@ void orthogonalize_m3(float mat[][3], int axis)
cross_v3_v3v3(mat[1], mat[2], mat[0]);
normalize_v3(mat[1]);
cross_v3_v3v3(mat[0], mat[1], mat[2]);
- } else if (dot_v3v3(mat[2], mat[1]) < 1) {
+ }
+ else if (dot_v3v3(mat[2], mat[1]) < 1) {
cross_v3_v3v3(mat[0], mat[1], mat[2]);
normalize_v3(mat[0]);
cross_v3_v3v3(mat[1], mat[2], mat[0]);
- } else {
+ }
+ else {
float vec[3];
- vec[0]= mat[2][1];
- vec[1]= mat[2][2];
- vec[2]= mat[2][0];
+ vec[0] = mat[2][1];
+ vec[1] = mat[2][2];
+ vec[2] = mat[2][0];
cross_v3_v3v3(mat[0], vec, mat[2]);
normalize_v3(mat[0]);
@@ -709,23 +733,24 @@ void orthogonalize_m4(float mat[][4], int axis)
float size[3];
mat4_to_size(size, mat);
normalize_v3(mat[axis]);
- switch(axis)
- {
+ switch (axis) {
case 0:
if (dot_v3v3(mat[0], mat[1]) < 1) {
cross_v3_v3v3(mat[2], mat[0], mat[1]);
normalize_v3(mat[2]);
cross_v3_v3v3(mat[1], mat[2], mat[0]);
- } else if (dot_v3v3(mat[0], mat[2]) < 1) {
+ }
+ else if (dot_v3v3(mat[0], mat[2]) < 1) {
cross_v3_v3v3(mat[1], mat[2], mat[0]);
normalize_v3(mat[1]);
cross_v3_v3v3(mat[2], mat[0], mat[1]);
- } else {
+ }
+ else {
float vec[3];
- vec[0]= mat[0][1];
- vec[1]= mat[0][2];
- vec[2]= mat[0][0];
+ vec[0] = mat[0][1];
+ vec[1] = mat[0][2];
+ vec[2] = mat[0][0];
cross_v3_v3v3(mat[2], mat[0], vec);
normalize_v3(mat[2]);
@@ -737,16 +762,18 @@ void orthogonalize_m4(float mat[][4], int axis)
cross_v3_v3v3(mat[2], mat[0], mat[1]);
normalize_v3(mat[2]);
cross_v3_v3v3(mat[0], mat[1], mat[2]);
- } else if (dot_v3v3(mat[0], mat[2]) < 1) {
+ }
+ else if (dot_v3v3(mat[0], mat[2]) < 1) {
cross_v3_v3v3(mat[0], mat[1], mat[2]);
normalize_v3(mat[0]);
cross_v3_v3v3(mat[2], mat[0], mat[1]);
- } else {
+ }
+ else {
float vec[3];
- vec[0]= mat[1][1];
- vec[1]= mat[1][2];
- vec[2]= mat[1][0];
+ vec[0] = mat[1][1];
+ vec[1] = mat[1][2];
+ vec[2] = mat[1][0];
cross_v3_v3v3(mat[0], mat[1], vec);
normalize_v3(mat[0]);
@@ -757,16 +784,18 @@ void orthogonalize_m4(float mat[][4], int axis)
cross_v3_v3v3(mat[1], mat[2], mat[0]);
normalize_v3(mat[1]);
cross_v3_v3v3(mat[0], mat[1], mat[2]);
- } else if (dot_v3v3(mat[2], mat[1]) < 1) {
+ }
+ else if (dot_v3v3(mat[2], mat[1]) < 1) {
cross_v3_v3v3(mat[0], mat[1], mat[2]);
normalize_v3(mat[0]);
cross_v3_v3v3(mat[1], mat[2], mat[0]);
- } else {
+ }
+ else {
float vec[3];
- vec[0]= mat[2][1];
- vec[1]= mat[2][2];
- vec[2]= mat[2][0];
+ vec[0] = mat[2][1];
+ vec[1] = mat[2][2];
+ vec[2] = mat[2][0];
cross_v3_v3v3(mat[0], vec, mat[2]);
normalize_v3(mat[0]);
@@ -780,154 +809,178 @@ void orthogonalize_m4(float mat[][4], int axis)
int is_orthogonal_m3(float m[][3])
{
- int i, j;
-
- for (i = 0; i < 3; i++) {
- for (j = 0; j < i; j++) {
- if (fabsf(dot_v3v3(m[i], m[j])) > 1.5f * FLT_EPSILON)
- return 0;
- }
+ int i, j;
- if (fabsf(dot_v3v3(m[i], m[i]) - 1) > 1.5f * FLT_EPSILON)
- return 0;
- }
+ for (i = 0; i < 3; i++) {
+ for (j = 0; j < i; j++) {
+ if (fabsf(dot_v3v3(m[i], m[j])) > 1.5f * FLT_EPSILON)
+ return 0;
+ }
+ }
- return 1;
+ return 1;
}
int is_orthogonal_m4(float m[][4])
{
- int i, j;
+ int i, j;
+
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < i; j++) {
+ if (fabsf(dot_vn_vn(m[i], m[j], 4)) > 1.5f * FLT_EPSILON)
+ return 0;
+ }
- for (i = 0; i < 4; i++) {
- for (j = 0; j < i; j++) {
- if (fabsf(dot_vn_vn(m[i], m[j], 4)) > 1.5f * FLT_EPSILON)
- return 0;
- }
+ }
- if (fabsf(dot_vn_vn(m[i], m[i], 4) - 1) > 1.5f * FLT_EPSILON)
- return 0;
- }
+ return 1;
+}
+
+int is_orthonormal_m3(float m[][3])
+{
+ if (is_orthogonal_m3(m)) {
+ int i;
+
+ for (i = 0; i < 3; i++)
+ if (fabsf(dot_v3v3(m[i], m[i]) - 1) > 1.5f * FLT_EPSILON)
+ return 0;
+
+ return 1;
+ }
+
+ return 0;
+}
+
+int is_orthonormal_m4(float m[][4])
+{
+ if (is_orthogonal_m4(m)) {
+ int i;
+
+ for (i = 0; i < 4; i++)
+ if (fabsf(dot_vn_vn(m[i], m[i], 4) - 1) > 1.5f * FLT_EPSILON)
+ return 0;
+
+ return 1;
+ }
- return 1;
+ return 0;
}
void normalize_m3(float mat[][3])
-{
+{
normalize_v3(mat[0]);
normalize_v3(mat[1]);
normalize_v3(mat[2]);
}
void normalize_m3_m3(float rmat[][3], float mat[][3])
-{
+{
normalize_v3_v3(rmat[0], mat[0]);
normalize_v3_v3(rmat[1], mat[1]);
normalize_v3_v3(rmat[2], mat[2]);
}
-
void normalize_m4(float mat[][4])
{
float len;
-
- len= normalize_v3(mat[0]);
- if(len!=0.0f) mat[0][3]/= len;
- len= normalize_v3(mat[1]);
- if(len!=0.0f) mat[1][3]/= len;
- len= normalize_v3(mat[2]);
- if(len!=0.0f) mat[2][3]/= len;
+
+ len = normalize_v3(mat[0]);
+ if (len != 0.0f) mat[0][3] /= len;
+ len = normalize_v3(mat[1]);
+ if (len != 0.0f) mat[1][3] /= len;
+ len = normalize_v3(mat[2]);
+ if (len != 0.0f) mat[2][3] /= len;
}
void normalize_m4_m4(float rmat[][4], float mat[][4])
{
float len;
-
- len= normalize_v3_v3(rmat[0], mat[0]);
- if(len!=0.0f) rmat[0][3]= mat[0][3] / len;
- len= normalize_v3_v3(rmat[1], mat[1]);
- if(len!=0.0f) rmat[1][3]= mat[1][3] / len;
- len= normalize_v3_v3(rmat[2], mat[2]);
- if(len!=0.0f) rmat[2][3]= mat[2][3] / len;
+
+ len = normalize_v3_v3(rmat[0], mat[0]);
+ if (len != 0.0f) rmat[0][3] = mat[0][3] / len;
+ len = normalize_v3_v3(rmat[1], mat[1]);
+ if (len != 0.0f) rmat[1][3] = mat[1][3] / len;
+ len = normalize_v3_v3(rmat[2], mat[2]);
+ if (len != 0.0f) rmat[2][3] = mat[2][3] / len;
}
void adjoint_m3_m3(float m1[][3], float m[][3])
{
- m1[0][0]=m[1][1]*m[2][2]-m[1][2]*m[2][1];
- m1[0][1]= -m[0][1]*m[2][2]+m[0][2]*m[2][1];
- m1[0][2]=m[0][1]*m[1][2]-m[0][2]*m[1][1];
+ m1[0][0] = m[1][1] * m[2][2] - m[1][2] * m[2][1];
+ m1[0][1] = -m[0][1] * m[2][2] + m[0][2] * m[2][1];
+ m1[0][2] = m[0][1] * m[1][2] - m[0][2] * m[1][1];
- m1[1][0]= -m[1][0]*m[2][2]+m[1][2]*m[2][0];
- m1[1][1]=m[0][0]*m[2][2]-m[0][2]*m[2][0];
- m1[1][2]= -m[0][0]*m[1][2]+m[0][2]*m[1][0];
+ m1[1][0] = -m[1][0] * m[2][2] + m[1][2] * m[2][0];
+ m1[1][1] = m[0][0] * m[2][2] - m[0][2] * m[2][0];
+ m1[1][2] = -m[0][0] * m[1][2] + m[0][2] * m[1][0];
- m1[2][0]=m[1][0]*m[2][1]-m[1][1]*m[2][0];
- m1[2][1]= -m[0][0]*m[2][1]+m[0][1]*m[2][0];
- m1[2][2]=m[0][0]*m[1][1]-m[0][1]*m[1][0];
+ m1[2][0] = m[1][0] * m[2][1] - m[1][1] * m[2][0];
+ m1[2][1] = -m[0][0] * m[2][1] + m[0][1] * m[2][0];
+ m1[2][2] = m[0][0] * m[1][1] - m[0][1] * m[1][0];
}
-void adjoint_m4_m4(float out[][4], float in[][4]) /* out = ADJ(in) */
+void adjoint_m4_m4(float out[][4], float in[][4]) /* out = ADJ(in) */
{
float a1, a2, a3, a4, b1, b2, b3, b4;
float c1, c2, c3, c4, d1, d2, d3, d4;
- a1= in[0][0];
- b1= in[0][1];
- c1= in[0][2];
- d1= in[0][3];
+ a1 = in[0][0];
+ b1 = in[0][1];
+ c1 = in[0][2];
+ d1 = in[0][3];
- a2= in[1][0];
- b2= in[1][1];
- c2= in[1][2];
- d2= in[1][3];
+ a2 = in[1][0];
+ b2 = in[1][1];
+ c2 = in[1][2];
+ d2 = in[1][3];
- a3= in[2][0];
- b3= in[2][1];
- c3= in[2][2];
- d3= in[2][3];
+ a3 = in[2][0];
+ b3 = in[2][1];
+ c3 = in[2][2];
+ d3 = in[2][3];
- a4= in[3][0];
- b4= in[3][1];
- c4= in[3][2];
- d4= in[3][3];
+ a4 = in[3][0];
+ b4 = in[3][1];
+ c4 = in[3][2];
+ d4 = in[3][3];
- out[0][0] = determinant_m3(b2, b3, b4, c2, c3, c4, d2, d3, d4);
- out[1][0] = - determinant_m3(a2, a3, a4, c2, c3, c4, d2, d3, d4);
- out[2][0] = determinant_m3(a2, a3, a4, b2, b3, b4, d2, d3, d4);
- out[3][0] = - determinant_m3(a2, a3, a4, b2, b3, b4, c2, c3, c4);
+ out[0][0] = determinant_m3(b2, b3, b4, c2, c3, c4, d2, d3, d4);
+ out[1][0] = -determinant_m3(a2, a3, a4, c2, c3, c4, d2, d3, d4);
+ out[2][0] = determinant_m3(a2, a3, a4, b2, b3, b4, d2, d3, d4);
+ out[3][0] = -determinant_m3(a2, a3, a4, b2, b3, b4, c2, c3, c4);
- out[0][1] = - determinant_m3(b1, b3, b4, c1, c3, c4, d1, d3, d4);
- out[1][1] = determinant_m3(a1, a3, a4, c1, c3, c4, d1, d3, d4);
- out[2][1] = - determinant_m3(a1, a3, a4, b1, b3, b4, d1, d3, d4);
- out[3][1] = determinant_m3(a1, a3, a4, b1, b3, b4, c1, c3, c4);
+ out[0][1] = -determinant_m3(b1, b3, b4, c1, c3, c4, d1, d3, d4);
+ out[1][1] = determinant_m3(a1, a3, a4, c1, c3, c4, d1, d3, d4);
+ out[2][1] = -determinant_m3(a1, a3, a4, b1, b3, b4, d1, d3, d4);
+ out[3][1] = determinant_m3(a1, a3, a4, b1, b3, b4, c1, c3, c4);
- out[0][2] = determinant_m3(b1, b2, b4, c1, c2, c4, d1, d2, d4);
- out[1][2] = - determinant_m3(a1, a2, a4, c1, c2, c4, d1, d2, d4);
- out[2][2] = determinant_m3(a1, a2, a4, b1, b2, b4, d1, d2, d4);
- out[3][2] = - determinant_m3(a1, a2, a4, b1, b2, b4, c1, c2, c4);
+ out[0][2] = determinant_m3(b1, b2, b4, c1, c2, c4, d1, d2, d4);
+ out[1][2] = -determinant_m3(a1, a2, a4, c1, c2, c4, d1, d2, d4);
+ out[2][2] = determinant_m3(a1, a2, a4, b1, b2, b4, d1, d2, d4);
+ out[3][2] = -determinant_m3(a1, a2, a4, b1, b2, b4, c1, c2, c4);
- out[0][3] = - determinant_m3(b1, b2, b3, c1, c2, c3, d1, d2, d3);
- out[1][3] = determinant_m3(a1, a2, a3, c1, c2, c3, d1, d2, d3);
- out[2][3] = - determinant_m3(a1, a2, a3, b1, b2, b3, d1, d2, d3);
- out[3][3] = determinant_m3(a1, a2, a3, b1, b2, b3, c1, c2, c3);
+ out[0][3] = -determinant_m3(b1, b2, b3, c1, c2, c3, d1, d2, d3);
+ out[1][3] = determinant_m3(a1, a2, a3, c1, c2, c3, d1, d2, d3);
+ out[2][3] = -determinant_m3(a1, a2, a3, b1, b2, b3, d1, d2, d3);
+ out[3][3] = determinant_m3(a1, a2, a3, b1, b2, b3, c1, c2, c3);
}
-float determinant_m2(float a,float b,float c,float d)
+float determinant_m2(float a, float b, float c, float d)
{
- return a*d - b*c;
+ return a * d - b * c;
}
float determinant_m3(float a1, float a2, float a3,
- float b1, float b2, float b3,
- float c1, float c2, float c3)
+ float b1, float b2, float b3,
+ float c1, float c2, float c3)
{
float ans;
- ans = a1 * determinant_m2(b2, b3, c2, c3)
- - b1 * determinant_m2(a2, a3, c2, c3)
- + c1 * determinant_m2(a2, a3, b2, b3);
+ ans = (a1 * determinant_m2(b2, b3, c2, c3) -
+ b1 * determinant_m2(a2, a3, c2, c3) +
+ c1 * determinant_m2(a2, a3, b2, b3));
return ans;
}
@@ -935,32 +988,32 @@ float determinant_m3(float a1, float a2, float a3,
float determinant_m4(float m[][4])
{
float ans;
- float a1,a2,a3,a4,b1,b2,b3,b4,c1,c2,c3,c4,d1,d2,d3,d4;
+ float a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4, d1, d2, d3, d4;
- a1= m[0][0];
- b1= m[0][1];
- c1= m[0][2];
- d1= m[0][3];
+ a1 = m[0][0];
+ b1 = m[0][1];
+ c1 = m[0][2];
+ d1 = m[0][3];
- a2= m[1][0];
- b2= m[1][1];
- c2= m[1][2];
- d2= m[1][3];
+ a2 = m[1][0];
+ b2 = m[1][1];
+ c2 = m[1][2];
+ d2 = m[1][3];
- a3= m[2][0];
- b3= m[2][1];
- c3= m[2][2];
- d3= m[2][3];
+ a3 = m[2][0];
+ b3 = m[2][1];
+ c3 = m[2][2];
+ d3 = m[2][3];
- a4= m[3][0];
- b4= m[3][1];
- c4= m[3][2];
- d4= m[3][3];
+ a4 = m[3][0];
+ b4 = m[3][1];
+ c4 = m[3][2];
+ d4 = m[3][3];
- ans = a1 * determinant_m3(b2, b3, b4, c2, c3, c4, d2, d3, d4)
- - b1 * determinant_m3(a2, a3, a4, c2, c3, c4, d2, d3, d4)
- + c1 * determinant_m3(a2, a3, a4, b2, b3, b4, d2, d3, d4)
- - d1 * determinant_m3(a2, a3, a4, b2, b3, b4, c2, c3, c4);
+ ans = (a1 * determinant_m3(b2, b3, b4, c2, c3, c4, d2, d3, d4) -
+ b1 * determinant_m3(a2, a3, a4, c2, c3, c4, d2, d3, d4) +
+ c1 * determinant_m3(a2, a3, a4, b2, b3, b4, d2, d3, d4) -
+ d1 * determinant_m3(a2, a3, a4, b2, b3, b4, c2, c3, c4));
return ans;
}
@@ -969,38 +1022,38 @@ float determinant_m4(float m[][4])
void size_to_mat3(float mat[][3], const float size[3])
{
- mat[0][0]= size[0];
- mat[0][1]= 0.0f;
- mat[0][2]= 0.0f;
- mat[1][1]= size[1];
- mat[1][0]= 0.0f;
- mat[1][2]= 0.0f;
- mat[2][2]= size[2];
- mat[2][1]= 0.0f;
- mat[2][0]= 0.0f;
+ mat[0][0] = size[0];
+ mat[0][1] = 0.0f;
+ mat[0][2] = 0.0f;
+ mat[1][1] = size[1];
+ mat[1][0] = 0.0f;
+ mat[1][2] = 0.0f;
+ mat[2][2] = size[2];
+ mat[2][1] = 0.0f;
+ mat[2][0] = 0.0f;
}
void size_to_mat4(float mat[][4], const float size[3])
{
float tmat[3][3];
-
- size_to_mat3(tmat,size);
+
+ size_to_mat3(tmat, size);
unit_m4(mat);
copy_m4_m3(mat, tmat);
}
void mat3_to_size(float size[3], float mat[][3])
{
- size[0]= len_v3(mat[0]);
- size[1]= len_v3(mat[1]);
- size[2]= len_v3(mat[2]);
+ size[0] = len_v3(mat[0]);
+ size[1] = len_v3(mat[1]);
+ size[2] = len_v3(mat[2]);
}
void mat4_to_size(float size[3], float mat[][4])
{
- size[0]= len_v3(mat[0]);
- size[1]= len_v3(mat[1]);
- size[2]= len_v3(mat[2]);
+ size[0] = len_v3(mat[0]);
+ size[1] = len_v3(mat[1]);
+ size[2] = len_v3(mat[2]);
}
/* this gets the average scale of a matrix, only use when your scaling
@@ -1021,10 +1074,9 @@ float mat4_to_scale(float mat[][4])
return mat3_to_scale(tmat);
}
-
void mat3_to_rot_size(float rot[3][3], float size[3], float mat3[3][3])
{
- float mat3_n[3][3]; /* mat3 -> normalized, 3x3 */
+ float mat3_n[3][3]; /* mat3 -> normalized, 3x3 */
float imat3_n[3][3]; /* mat3 -> normalized & inverted, 3x3 */
/* rotation & scale are linked, we need to create the mat's
@@ -1033,7 +1085,7 @@ void mat3_to_rot_size(float rot[3][3], float size[3], float mat3[3][3])
/* so scale doesnt interfear with rotation [#24291] */
/* note: this is a workaround for negative matrix not working for rotation conversion, FIXME */
normalize_m3_m3(mat3_n, mat3);
- if(is_negative_m3(mat3)) {
+ if (is_negative_m3(mat3)) {
negate_v3(mat3_n[0]);
negate_v3(mat3_n[1]);
negate_v3(mat3_n[2]);
@@ -1048,14 +1100,14 @@ void mat3_to_rot_size(float rot[3][3], float size[3], float mat3[3][3])
invert_m3_m3(imat3_n, mat3_n);
mul_m3_m3m3(mat3, imat3_n, mat3);
- size[0]= mat3[0][0];
- size[1]= mat3[1][1];
- size[2]= mat3[2][2];
+ size[0] = mat3[0][0];
+ size[1] = mat3[1][1];
+ size[2] = mat3[2][2];
}
void mat4_to_loc_rot_size(float loc[3], float rot[3][3], float size[3], float wmat[][4])
{
- float mat3[3][3]; /* wmat -> 3x3 */
+ float mat3[3][3]; /* wmat -> 3x3 */
copy_m3_m4(mat3, wmat);
mat3_to_rot_size(rot, size, mat3);
@@ -1066,33 +1118,33 @@ void mat4_to_loc_rot_size(float loc[3], float rot[3][3], float size[3], float wm
void scale_m3_fl(float m[][3], float scale)
{
- m[0][0]= m[1][1]= m[2][2]= scale;
- m[0][1]= m[0][2]= 0.0;
- m[1][0]= m[1][2]= 0.0;
- m[2][0]= m[2][1]= 0.0;
+ m[0][0] = m[1][1] = m[2][2] = scale;
+ m[0][1] = m[0][2] = 0.0;
+ m[1][0] = m[1][2] = 0.0;
+ m[2][0] = m[2][1] = 0.0;
}
void scale_m4_fl(float m[][4], float scale)
{
- m[0][0]= m[1][1]= m[2][2]= scale;
- m[3][3]= 1.0;
- m[0][1]= m[0][2]= m[0][3]= 0.0;
- m[1][0]= m[1][2]= m[1][3]= 0.0;
- m[2][0]= m[2][1]= m[2][3]= 0.0;
- m[3][0]= m[3][1]= m[3][2]= 0.0;
+ m[0][0] = m[1][1] = m[2][2] = scale;
+ m[3][3] = 1.0;
+ m[0][1] = m[0][2] = m[0][3] = 0.0;
+ m[1][0] = m[1][2] = m[1][3] = 0.0;
+ m[2][0] = m[2][1] = m[2][3] = 0.0;
+ m[3][0] = m[3][1] = m[3][2] = 0.0;
}
-void translate_m4(float mat[][4],float Tx, float Ty, float Tz)
+void translate_m4(float mat[][4], float Tx, float Ty, float Tz)
{
- mat[3][0] += (Tx*mat[0][0] + Ty*mat[1][0] + Tz*mat[2][0]);
- mat[3][1] += (Tx*mat[0][1] + Ty*mat[1][1] + Tz*mat[2][1]);
- mat[3][2] += (Tx*mat[0][2] + Ty*mat[1][2] + Tz*mat[2][2]);
+ mat[3][0] += (Tx * mat[0][0] + Ty * mat[1][0] + Tz * mat[2][0]);
+ mat[3][1] += (Tx * mat[0][1] + Ty * mat[1][1] + Tz * mat[2][1]);
+ mat[3][2] += (Tx * mat[0][2] + Ty * mat[1][2] + Tz * mat[2][2]);
}
void rotate_m4(float mat[][4], const char axis, const float angle)
{
int col;
- float temp[4]= {0.0f, 0.0f, 0.0f, 0.0f};
+ float temp[4] = {0.0f, 0.0f, 0.0f, 0.0f};
float cosine, sine;
assert(axis >= 'X' && axis <= 'Z');
@@ -1100,32 +1152,32 @@ void rotate_m4(float mat[][4], const char axis, const float angle)
cosine = (float)cos(angle);
sine = (float)sin(angle);
switch (axis) {
- case 'X':
- for(col=0 ; col<4 ; col++)
- temp[col] = cosine*mat[1][col] + sine*mat[2][col];
- for(col=0 ; col<4 ; col++) {
- mat[2][col] = - sine*mat[1][col] + cosine*mat[2][col];
- mat[1][col] = temp[col];
- }
- break;
-
- case 'Y':
- for(col=0 ; col<4 ; col++)
- temp[col] = cosine*mat[0][col] - sine*mat[2][col];
- for(col=0 ; col<4 ; col++) {
- mat[2][col] = sine*mat[0][col] + cosine*mat[2][col];
- mat[0][col] = temp[col];
- }
- break;
-
- case 'Z':
- for(col=0 ; col<4 ; col++)
- temp[col] = cosine*mat[0][col] + sine*mat[1][col];
- for(col=0 ; col<4 ; col++) {
- mat[1][col] = - sine*mat[0][col] + cosine*mat[1][col];
- mat[0][col] = temp[col];
- }
- break;
+ case 'X':
+ for (col = 0; col < 4; col++)
+ temp[col] = cosine * mat[1][col] + sine * mat[2][col];
+ for (col = 0; col < 4; col++) {
+ mat[2][col] = -sine * mat[1][col] + cosine * mat[2][col];
+ mat[1][col] = temp[col];
+ }
+ break;
+
+ case 'Y':
+ for (col = 0; col < 4; col++)
+ temp[col] = cosine * mat[0][col] - sine * mat[2][col];
+ for (col = 0; col < 4; col++) {
+ mat[2][col] = sine * mat[0][col] + cosine * mat[2][col];
+ mat[0][col] = temp[col];
+ }
+ break;
+
+ case 'Z':
+ for (col = 0; col < 4; col++)
+ temp[col] = cosine * mat[0][col] + sine * mat[1][col];
+ for (col = 0; col < 4; col++) {
+ mat[1][col] = -sine * mat[0][col] + cosine * mat[1][col];
+ mat[0][col] = temp[col];
+ }
+ break;
}
}
@@ -1135,7 +1187,7 @@ void blend_m3_m3m3(float out[][3], float dst[][3], float src[][3], const float s
float squat[4], dquat[4], fquat[4];
float sscale[3], dscale[3], fsize[3];
float rmat[3][3], smat[3][3];
-
+
mat3_to_rot_size(drot, dscale, dst);
mat3_to_rot_size(srot, sscale, src);
@@ -1147,8 +1199,8 @@ void blend_m3_m3m3(float out[][3], float dst[][3], float src[][3], const float s
interp_v3_v3v3(fsize, dscale, sscale, srcweight);
/* compose new matrix */
- quat_to_mat3(rmat,fquat);
- size_to_mat3(smat,fsize);
+ quat_to_mat3(rmat, fquat);
+ size_to_mat3(smat, fsize);
mul_m3_m3m3(out, rmat, smat);
}
@@ -1174,7 +1226,6 @@ void blend_m4_m4m4(float out[][4], float dst[][4], float src[][4], const float s
loc_quat_size_to_mat4(out, floc, fquat, fsize);
}
-
int is_negative_m3(float mat[][3])
{
float vec[3];
@@ -1192,21 +1243,22 @@ int is_negative_m4(float mat[][4])
/* make a 4x4 matrix out of 3 transform components */
/* matrices are made in the order: scale * rot * loc */
// TODO: need to have a version that allows for rotation order...
+
void loc_eul_size_to_mat4(float mat[4][4], const float loc[3], const float eul[3], const float size[3])
{
float rmat[3][3], smat[3][3], tmat[3][3];
-
- /* initialise new matrix */
+
+ /* initialize new matrix */
unit_m4(mat);
-
+
/* make rotation + scaling part */
- eul_to_mat3(rmat,eul);
- size_to_mat3(smat,size);
+ eul_to_mat3(rmat, eul);
+ size_to_mat3(smat, size);
mul_m3_m3m3(tmat, rmat, smat);
-
+
/* copy rot/scale part to output matrix*/
copy_m4_m3(mat, tmat);
-
+
/* copy location to matrix */
mat[3][0] = loc[0];
mat[3][1] = loc[1];
@@ -1214,22 +1266,23 @@ void loc_eul_size_to_mat4(float mat[4][4], const float loc[3], const float eul[3
}
/* make a 4x4 matrix out of 3 transform components */
+
/* matrices are made in the order: scale * rot * loc */
void loc_eulO_size_to_mat4(float mat[4][4], const float loc[3], const float eul[3], const float size[3], const short rotOrder)
{
float rmat[3][3], smat[3][3], tmat[3][3];
-
- /* initialise new matrix */
+
+ /* initialize new matrix */
unit_m4(mat);
-
+
/* make rotation + scaling part */
- eulO_to_mat3(rmat,eul, rotOrder);
- size_to_mat3(smat,size);
+ eulO_to_mat3(rmat, eul, rotOrder);
+ size_to_mat3(smat, size);
mul_m3_m3m3(tmat, rmat, smat);
-
+
/* copy rot/scale part to output matrix*/
copy_m4_m3(mat, tmat);
-
+
/* copy location to matrix */
mat[3][0] = loc[0];
mat[3][1] = loc[1];
@@ -1238,22 +1291,23 @@ void loc_eulO_size_to_mat4(float mat[4][4], const float loc[3], const float eul[
/* make a 4x4 matrix out of 3 transform components */
+
/* matrices are made in the order: scale * rot * loc */
void loc_quat_size_to_mat4(float mat[4][4], const float loc[3], const float quat[4], const float size[3])
{
float rmat[3][3], smat[3][3], tmat[3][3];
-
- /* initialise new matrix */
+
+ /* initialize new matrix */
unit_m4(mat);
-
+
/* make rotation + scaling part */
- quat_to_mat3(rmat,quat);
- size_to_mat3(smat,size);
+ quat_to_mat3(rmat, quat);
+ size_to_mat3(smat, size);
mul_m3_m3m3(tmat, rmat, smat);
-
+
/* copy rot/scale part to output matrix*/
copy_m4_m3(mat, tmat);
-
+
/* copy location to matrix */
mat[3][0] = loc[0];
mat[3][1] = loc[1];
@@ -1272,29 +1326,29 @@ void loc_axisangle_size_to_mat4(float mat[4][4], const float loc[3], const float
void print_m3(const char *str, float m[][3])
{
printf("%s\n", str);
- printf("%f %f %f\n",m[0][0],m[1][0],m[2][0]);
- printf("%f %f %f\n",m[0][1],m[1][1],m[2][1]);
- printf("%f %f %f\n",m[0][2],m[1][2],m[2][2]);
+ printf("%f %f %f\n", m[0][0], m[1][0], m[2][0]);
+ printf("%f %f %f\n", m[0][1], m[1][1], m[2][1]);
+ printf("%f %f %f\n", m[0][2], m[1][2], m[2][2]);
printf("\n");
}
void print_m4(const char *str, float m[][4])
{
printf("%s\n", str);
- printf("%f %f %f %f\n",m[0][0],m[1][0],m[2][0],m[3][0]);
- printf("%f %f %f %f\n",m[0][1],m[1][1],m[2][1],m[3][1]);
- printf("%f %f %f %f\n",m[0][2],m[1][2],m[2][2],m[3][2]);
- printf("%f %f %f %f\n",m[0][3],m[1][3],m[2][3],m[3][3]);
+ printf("%f %f %f %f\n", m[0][0], m[1][0], m[2][0], m[3][0]);
+ printf("%f %f %f %f\n", m[0][1], m[1][1], m[2][1], m[3][1]);
+ printf("%f %f %f %f\n", m[0][2], m[1][2], m[2][2], m[3][2]);
+ printf("%f %f %f %f\n", m[0][3], m[1][3], m[2][3], m[3][3]);
printf("\n");
}
/*********************************** 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.
- * A = U.W.Vt. From this decomposition it is trivial to compute the
+ * 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.
+ * A = U.W.Vt. From this decomposition it is trivial to compute the
* (pseudo-inverse) of A as Ainv = V.Winv.tranpose(U).
*/
@@ -1305,25 +1359,25 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
int m = 4;
int n = 4;
int maxiter = 200;
- int nu = minf(m,n);
+ int nu = minf(m, n);
float *work = work1;
float *e = work2;
float eps;
- int i=0, j=0, k=0, p, pp, iter;
+ int i = 0, j = 0, k = 0, p, pp, iter;
// Reduce A to bidiagonal form, storing the diagonal elements
// in s and the super-diagonal elements in e.
- int nct = minf(m-1,n);
- int nrt = maxf(0,minf(n-2,m));
+ int nct = minf(m - 1, n);
+ int nrt = maxf(0, minf(n - 2, m));
copy_m4_m4(A, A_);
zero_m4(U);
zero_v4(s);
- for (k = 0; k < maxf(nct,nrt); k++) {
+ for (k = 0; k < maxf(nct, nrt); k++) {
if (k < nct) {
// Compute the transformation for the k-th column and
@@ -1331,14 +1385,14 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
// Compute 2-norm of k-th column without under/overflow.
s[k] = 0;
for (i = k; i < m; i++) {
- s[k] = hypotf(s[k],A[i][k]);
+ s[k] = hypotf(s[k], A[i][k]);
}
if (s[k] != 0.0f) {
float invsk;
if (A[k][k] < 0.0f) {
s[k] = -s[k];
}
- invsk = 1.0f/s[k];
+ invsk = 1.0f / s[k];
for (i = k; i < m; i++) {
A[i][k] *= invsk;
}
@@ -1346,18 +1400,18 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
}
s[k] = -s[k];
}
- for (j = k+1; j < n; j++) {
+ for (j = k + 1; j < n; j++) {
if ((k < nct) && (s[k] != 0.0f)) {
- // Apply the transformation.
+ // Apply the transformation.
float t = 0;
for (i = k; i < m; i++) {
- t += A[i][k]*A[i][j];
+ t += A[i][k] * A[i][j];
}
- t = -t/A[k][k];
+ t = -t / A[k][k];
for (i = k; i < m; i++) {
- A[i][j] += t*A[i][k];
+ A[i][j] += t * A[i][k];
}
}
@@ -1380,39 +1434,39 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
// k-th super-diagonal in e[k].
// Compute 2-norm without under/overflow.
e[k] = 0;
- for (i = k+1; i < n; i++) {
- e[k] = hypotf(e[k],e[i]);
+ for (i = k + 1; i < n; i++) {
+ e[k] = hypotf(e[k], e[i]);
}
if (e[k] != 0.0f) {
float invek;
- if (e[k+1] < 0.0f) {
+ if (e[k + 1] < 0.0f) {
e[k] = -e[k];
}
- invek = 1.0f/e[k];
- for (i = k+1; i < n; i++) {
+ invek = 1.0f / e[k];
+ for (i = k + 1; i < n; i++) {
e[i] *= invek;
}
- e[k+1] += 1.0f;
+ e[k + 1] += 1.0f;
}
e[k] = -e[k];
- if ((k+1 < m) & (e[k] != 0.0f)) {
+ if ((k + 1 < m) & (e[k] != 0.0f)) {
float invek1;
- // Apply the transformation.
+ // Apply the transformation.
- for (i = k+1; i < m; i++) {
+ for (i = k + 1; i < m; i++) {
work[i] = 0.0f;
}
- for (j = k+1; j < n; j++) {
- for (i = k+1; i < m; i++) {
- work[i] += e[j]*A[i][j];
+ for (j = k + 1; j < n; j++) {
+ for (i = k + 1; i < m; i++) {
+ work[i] += e[j] * A[i][j];
}
}
- invek1 = 1.0f/e[k+1];
- for (j = k+1; j < n; j++) {
- float t = -e[j]*invek1;
- for (i = k+1; i < m; i++) {
- A[i][j] += t*work[i];
+ invek1 = 1.0f / e[k + 1];
+ for (j = k + 1; j < n; j++) {
+ float t = -e[j] * invek1;
+ for (i = k + 1; i < m; i++) {
+ A[i][j] += t * work[i];
}
}
}
@@ -1420,24 +1474,24 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
// Place the transformation in V for subsequent
// back multiplication.
- for (i = k+1; i < n; i++)
+ for (i = k + 1; i < n; i++)
V[i][k] = e[i];
}
}
// Set up the final bidiagonal matrix or order p.
- p = minf(n,m+1);
+ p = minf(n, m + 1);
if (nct < n) {
s[nct] = A[nct][nct];
}
if (m < p) {
- s[p-1] = 0.0f;
+ s[p - 1] = 0.0f;
}
- if (nrt+1 < p) {
- e[nrt] = A[nrt][p-1];
+ if (nrt + 1 < p) {
+ e[nrt] = A[nrt][p - 1];
}
- e[p-1] = 0.0f;
+ e[p - 1] = 0.0f;
// If required, generate U.
@@ -1447,26 +1501,27 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
}
U[j][j] = 1.0f;
}
- for (k = nct-1; k >= 0; k--) {
+ for (k = nct - 1; k >= 0; k--) {
if (s[k] != 0.0f) {
- for (j = k+1; j < nu; j++) {
+ for (j = k + 1; j < nu; j++) {
float t = 0;
for (i = k; i < m; i++) {
- t += U[i][k]*U[i][j];
+ t += U[i][k] * U[i][j];
}
- t = -t/U[k][k];
+ t = -t / U[k][k];
for (i = k; i < m; i++) {
- U[i][j] += t*U[i][k];
+ U[i][j] += t * U[i][k];
}
}
- for (i = k; i < m; i++ ) {
+ for (i = k; i < m; i++) {
U[i][k] = -U[i][k];
}
U[k][k] = 1.0f + U[k][k];
- for (i = 0; i < k-1; i++) {
+ for (i = 0; i < k - 1; i++) {
U[i][k] = 0.0f;
}
- } else {
+ }
+ else {
for (i = 0; i < m; i++) {
U[i][k] = 0.0f;
}
@@ -1476,16 +1531,16 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
// If required, generate V.
- for (k = n-1; k >= 0; k--) {
+ for (k = n - 1; k >= 0; k--) {
if ((k < nrt) & (e[k] != 0.0f)) {
- for (j = k+1; j < nu; j++) {
+ for (j = k + 1; j < nu; j++) {
float t = 0;
- for (i = k+1; i < n; i++) {
- t += V[i][k]*V[i][j];
+ for (i = k + 1; i < n; i++) {
+ t += V[i][k] * V[i][j];
}
- t = -t/V[k+1][k];
- for (i = k+1; i < n; i++) {
- V[i][j] += t*V[i][k];
+ t = -t / V[k + 1][k];
+ for (i = k + 1; i < n; i++) {
+ V[i][j] += t * V[i][k];
}
}
}
@@ -1497,14 +1552,14 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
// Main iteration loop for the singular values.
- pp = p-1;
+ pp = p - 1;
iter = 0;
- eps = powf(2.0f,-52.0f);
+ eps = powf(2.0f, -52.0f);
while (p > 0) {
- int kase=0;
+ int kase = 0;
// Test for maximum iterations to avoid infinite loop
- if(maxiter == 0)
+ if (maxiter == 0)
break;
maxiter--;
@@ -1512,42 +1567,45 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
// negligible elements in the s and e arrays. On
// completion the variables kase and k are set as follows.
- // kase = 1 if s(p) and e[k-1] are negligible and k<p
+ // kase = 1 if s(p) and e[k - 1] are negligible and k<p
// kase = 2 if s(k) is negligible and k<p
- // kase = 3 if e[k-1] is negligible, k<p, and
- // s(k), ..., s(p) are not negligible (qr step).
- // kase = 4 if e(p-1) is negligible (convergence).
+ // kase = 3 if e[k - 1] is negligible, k<p, and
+ // s(k), ..., s(p) are not negligible (qr step).
+ // kase = 4 if e(p - 1) is negligible (convergence).
- for (k = p-2; k >= -1; k--) {
+ for (k = p - 2; k >= -1; k--) {
if (k == -1) {
break;
}
- if (fabsf(e[k]) <= eps*(fabsf(s[k]) + fabsf(s[k+1]))) {
+ if (fabsf(e[k]) <= eps * (fabsf(s[k]) + fabsf(s[k + 1]))) {
e[k] = 0.0f;
break;
}
}
- if (k == p-2) {
+ if (k == p - 2) {
kase = 4;
- } else {
+ }
+ else {
int ks;
- for (ks = p-1; ks >= k; ks--) {
+ for (ks = p - 1; ks >= k; ks--) {
float t;
if (ks == k) {
break;
}
- t = (ks != p ? fabsf(e[ks]) : 0.f) +
- (ks != k+1 ? fabsf(e[ks-1]) : 0.0f);
- if (fabsf(s[ks]) <= eps*t) {
+ t = (ks != p ? fabsf(e[ks]) : 0.f) +
+ (ks != k + 1 ? fabsf(e[ks - 1]) : 0.0f);
+ if (fabsf(s[ks]) <= eps * t) {
s[ks] = 0.0f;
break;
}
}
if (ks == k) {
kase = 3;
- } else if (ks == p-1) {
+ }
+ else if (ks == p - 1) {
kase = 1;
- } else {
+ }
+ else {
kase = 2;
k = ks;
}
@@ -1560,127 +1618,130 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
// Deflate negligible s(p).
- case 1: {
- float f = e[p-2];
- e[p-2] = 0.0f;
- for (j = p-2; j >= k; j--) {
- float t = hypotf(s[j],f);
- float invt = 1.0f/t;
- float cs = s[j]*invt;
- float sn = f*invt;
+ case 1:
+ {
+ float f = e[p - 2];
+ e[p - 2] = 0.0f;
+ for (j = p - 2; j >= k; j--) {
+ float t = hypotf(s[j], f);
+ float invt = 1.0f / t;
+ float cs = s[j] * invt;
+ float sn = f * invt;
s[j] = t;
if (j != k) {
- f = -sn*e[j-1];
- e[j-1] = cs*e[j-1];
+ f = -sn * e[j - 1];
+ e[j - 1] = cs * e[j - 1];
}
for (i = 0; i < n; i++) {
- t = cs*V[i][j] + sn*V[i][p-1];
- V[i][p-1] = -sn*V[i][j] + cs*V[i][p-1];
+ t = cs * V[i][j] + sn * V[i][p - 1];
+ V[i][p - 1] = -sn * V[i][j] + cs * V[i][p - 1];
V[i][j] = t;
}
}
+ break;
}
- break;
// Split at negligible s(k).
- case 2: {
- float f = e[k-1];
- e[k-1] = 0.0f;
+ case 2:
+ {
+ float f = e[k - 1];
+ e[k - 1] = 0.0f;
for (j = k; j < p; j++) {
- float t = hypotf(s[j],f);
- float invt = 1.0f/t;
- float cs = s[j]*invt;
- float sn = f*invt;
+ float t = hypotf(s[j], f);
+ float invt = 1.0f / t;
+ float cs = s[j] * invt;
+ float sn = f * invt;
s[j] = t;
- f = -sn*e[j];
- e[j] = cs*e[j];
+ f = -sn * e[j];
+ e[j] = cs * e[j];
for (i = 0; i < m; i++) {
- t = cs*U[i][j] + sn*U[i][k-1];
- U[i][k-1] = -sn*U[i][j] + cs*U[i][k-1];
+ t = cs * U[i][j] + sn * U[i][k - 1];
+ U[i][k - 1] = -sn * U[i][j] + cs * U[i][k - 1];
U[i][j] = t;
}
}
+ break;
}
- break;
// Perform one qr step.
- case 3: {
+ case 3:
+ {
// Calculate the shift.
float scale = maxf(maxf(maxf(maxf(
- fabsf(s[p-1]),fabsf(s[p-2])),fabsf(e[p-2])),
- fabsf(s[k])),fabsf(e[k]));
- float invscale = 1.0f/scale;
- float sp = s[p-1]*invscale;
- float spm1 = s[p-2]*invscale;
- float epm1 = e[p-2]*invscale;
- float sk = s[k]*invscale;
- float ek = e[k]*invscale;
- float b = ((spm1 + sp)*(spm1 - sp) + epm1*epm1)*0.5f;
- float c = (sp*epm1)*(sp*epm1);
+ fabsf(s[p - 1]),fabsf(s[p - 2])),fabsf(e[p - 2])),
+ fabsf(s[k])),fabsf(e[k]));
+ float invscale = 1.0f / scale;
+ float sp = s[p - 1] * invscale;
+ float spm1 = s[p - 2] * invscale;
+ float epm1 = e[p - 2] * invscale;
+ float sk = s[k] * invscale;
+ float ek = e[k] * invscale;
+ float b = ((spm1 + sp) * (spm1 - sp) + epm1 * epm1) * 0.5f;
+ float c = (sp * epm1) * (sp * epm1);
float shift = 0.0f;
float f, g;
if ((b != 0.0f) || (c != 0.0f)) {
- shift = sqrtf(b*b + c);
+ shift = sqrtf(b * b + c);
if (b < 0.0f) {
shift = -shift;
}
- shift = c/(b + shift);
+ shift = c / (b + shift);
}
- f = (sk + sp)*(sk - sp) + shift;
- g = sk*ek;
+ f = (sk + sp) * (sk - sp) + shift;
+ g = sk * ek;
// Chase zeros.
- for (j = k; j < p-1; j++) {
- float t = hypotf(f,g);
+ for (j = k; j < p - 1; j++) {
+ float t = hypotf(f, g);
/* division by zero checks added to avoid NaN (brecht) */
- float cs = (t == 0.0f)? 0.0f: f/t;
- float sn = (t == 0.0f)? 0.0f: g/t;
+ float cs = (t == 0.0f) ? 0.0f : f / t;
+ float sn = (t == 0.0f) ? 0.0f : g / t;
if (j != k) {
- e[j-1] = t;
+ e[j - 1] = t;
}
- f = cs*s[j] + sn*e[j];
- e[j] = cs*e[j] - sn*s[j];
- g = sn*s[j+1];
- s[j+1] = cs*s[j+1];
+ f = cs * s[j] + sn * e[j];
+ e[j] = cs * e[j] - sn * s[j];
+ g = sn * s[j + 1];
+ s[j + 1] = cs * s[j + 1];
for (i = 0; i < n; i++) {
- t = cs*V[i][j] + sn*V[i][j+1];
- V[i][j+1] = -sn*V[i][j] + cs*V[i][j+1];
+ t = cs * V[i][j] + sn * V[i][j + 1];
+ V[i][j + 1] = -sn * V[i][j] + cs * V[i][j + 1];
V[i][j] = t;
}
- t = hypotf(f,g);
+ t = hypotf(f, g);
/* division by zero checks added to avoid NaN (brecht) */
- cs = (t == 0.0f)? 0.0f: f/t;
- sn = (t == 0.0f)? 0.0f: g/t;
+ cs = (t == 0.0f) ? 0.0f : f / t;
+ sn = (t == 0.0f) ? 0.0f : g / t;
s[j] = t;
- f = cs*e[j] + sn*s[j+1];
- s[j+1] = -sn*e[j] + cs*s[j+1];
- g = sn*e[j+1];
- e[j+1] = cs*e[j+1];
- if (j < m-1) {
+ f = cs * e[j] + sn * s[j + 1];
+ s[j + 1] = -sn * e[j] + cs * s[j + 1];
+ g = sn * e[j + 1];
+ e[j + 1] = cs * e[j + 1];
+ if (j < m - 1) {
for (i = 0; i < m; i++) {
- t = cs*U[i][j] + sn*U[i][j+1];
- U[i][j+1] = -sn*U[i][j] + cs*U[i][j+1];
+ t = cs * U[i][j] + sn * U[i][j + 1];
+ U[i][j + 1] = -sn * U[i][j] + cs * U[i][j + 1];
U[i][j] = t;
}
}
}
- e[p-2] = f;
+ e[p - 2] = f;
iter = iter + 1;
+ break;
}
- break;
-
// Convergence.
- case 4: {
+ case 4:
+ {
// Make the singular values positive.
@@ -1695,28 +1756,32 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
while (k < pp) {
float t;
- if (s[k] >= s[k+1]) {
+ if (s[k] >= s[k + 1]) {
break;
}
t = s[k];
- s[k] = s[k+1];
- s[k+1] = t;
- if (k < n-1) {
+ s[k] = s[k + 1];
+ s[k + 1] = t;
+ if (k < n - 1) {
for (i = 0; i < n; i++) {
- t = V[i][k+1]; V[i][k+1] = V[i][k]; V[i][k] = t;
+ t = V[i][k + 1];
+ V[i][k + 1] = V[i][k];
+ V[i][k] = t;
}
}
- if (k < m-1) {
+ if (k < m - 1) {
for (i = 0; i < m; i++) {
- t = U[i][k+1]; U[i][k+1] = U[i][k]; U[i][k] = t;
+ t = U[i][k + 1];
+ U[i][k + 1] = U[i][k];
+ U[i][k] = t;
}
}
k++;
}
iter = 0;
p--;
+ break;
}
- break;
}
}
}
@@ -1724,7 +1789,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;
@@ -1734,8 +1799,8 @@ void pseudoinverse_m4_m4(float Ainv[4][4], float A[4][4], float epsilon)
transpose_m4(V);
zero_m4(Wm);
- for(i=0; i<4; i++)
- Wm[i][i]= (W[i] < epsilon)? 0.0f: 1.0f/W[i];
+ for (i = 0; i < 4; i++)
+ Wm[i][i] = (W[i] < epsilon) ? 0.0f : 1.0f / W[i];
transpose_m4(V);
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index 38bc4794135..ec5fd39cd87 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -17,7 +17,7 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
-
+
* The Original Code is: some of this file.
*
* ***** END GPL LICENSE BLOCK *****
@@ -40,25 +40,24 @@
/* convenience, avoids setting Y axis everywhere */
void unit_axis_angle(float axis[3], float *angle)
{
- axis[0]= 0.0f;
- axis[1]= 1.0f;
- axis[2]= 0.0f;
- *angle= 0.0f;
+ axis[0] = 0.0f;
+ axis[1] = 1.0f;
+ axis[2] = 0.0f;
+ *angle = 0.0f;
}
-
void unit_qt(float q[4])
{
- q[0]= 1.0f;
- q[1]= q[2]= q[3]= 0.0f;
+ q[0] = 1.0f;
+ q[1] = q[2] = q[3] = 0.0f;
}
void copy_qt_qt(float q1[4], const float q2[4])
{
- q1[0]= q2[0];
- q1[1]= q2[1];
- q1[2]= q2[2];
- q1[3]= q2[3];
+ q1[0] = q2[0];
+ q1[1] = q2[1];
+ q1[2] = q2[2];
+ q1[3] = q2[3];
}
int is_zero_qt(float *q)
@@ -66,17 +65,17 @@ int is_zero_qt(float *q)
return (q[0] == 0 && q[1] == 0 && q[2] == 0 && q[3] == 0);
}
-void mul_qt_qtqt(float *q, const float *q1, const float *q2)
+void mul_qt_qtqt(float q[4], const float q1[4], const float q2[4])
{
- float t0,t1,t2;
+ float t0, t1, t2;
- t0= q1[0]*q2[0]-q1[1]*q2[1]-q1[2]*q2[2]-q1[3]*q2[3];
- t1= q1[0]*q2[1]+q1[1]*q2[0]+q1[2]*q2[3]-q1[3]*q2[2];
- t2= q1[0]*q2[2]+q1[2]*q2[0]+q1[3]*q2[1]-q1[1]*q2[3];
- q[3]= q1[0]*q2[3]+q1[3]*q2[0]+q1[1]*q2[2]-q1[2]*q2[1];
- q[0]=t0;
- q[1]=t1;
- q[2]=t2;
+ t0 = q1[0] * q2[0] - q1[1] * q2[1] - q1[2] * q2[2] - q1[3] * q2[3];
+ t1 = q1[0] * q2[1] + q1[1] * q2[0] + q1[2] * q2[3] - q1[3] * q2[2];
+ t2 = q1[0] * q2[2] + q1[2] * q2[0] + q1[3] * q2[1] - q1[1] * q2[3];
+ q[3] = q1[0] * q2[3] + q1[3] * q2[0] + q1[1] * q2[2] - q1[2] * q2[1];
+ q[0] = t0;
+ q[1] = t1;
+ q[2] = t2;
}
/* Assumes a unit quaternion */
@@ -84,18 +83,18 @@ void mul_qt_v3(const float q[4], float v[3])
{
float t0, t1, t2;
- t0= -q[1]*v[0]-q[2]*v[1]-q[3]*v[2];
- t1= q[0]*v[0]+q[2]*v[2]-q[3]*v[1];
- t2= q[0]*v[1]+q[3]*v[0]-q[1]*v[2];
- v[2]= q[0]*v[2]+q[1]*v[1]-q[2]*v[0];
- v[0]=t1;
- v[1]=t2;
+ t0 = -q[1] * v[0] - q[2] * v[1] - q[3] * v[2];
+ t1 = q[0] * v[0] + q[2] * v[2] - q[3] * v[1];
+ t2 = q[0] * v[1] + q[3] * v[0] - q[1] * v[2];
+ v[2] = q[0] * v[2] + q[1] * v[1] - q[2] * v[0];
+ v[0] = t1;
+ v[1] = t2;
- t1= t0*-q[1]+v[0]*q[0]-v[1]*q[3]+v[2]*q[2];
- t2= t0*-q[2]+v[1]*q[0]-v[2]*q[1]+v[0]*q[3];
- v[2]= t0*-q[3]+v[2]*q[0]-v[0]*q[2]+v[1]*q[1];
- v[0]=t1;
- v[1]=t2;
+ t1 = t0 * -q[1] + v[0] * q[0] - v[1] * q[3] + v[2] * q[2];
+ t2 = t0 * -q[2] + v[1] * q[0] - v[2] * q[1] + v[0] * q[3];
+ v[2] = t0 * -q[3] + v[2] * q[0] - v[0] * q[2] + v[1] * q[1];
+ v[0] = t1;
+ v[1] = t2;
}
void conjugate_qt(float q[4])
@@ -107,10 +106,10 @@ void conjugate_qt(float q[4])
float dot_qtqt(const float q1[4], const float q2[4])
{
- return q1[0]*q2[0] + q1[1]*q2[1] + q1[2]*q2[2] + q1[3]*q2[3];
+ return q1[0] * q2[0] + q1[1] * q2[1] + q1[2] * q2[2] + q1[3] * q2[3];
}
-void invert_qt(float *q)
+void invert_qt(float q[4])
{
float f = dot_qtqt(q, q);
@@ -118,17 +117,17 @@ void invert_qt(float *q)
return;
conjugate_qt(q);
- mul_qt_fl(q, 1.0f/f);
+ mul_qt_fl(q, 1.0f / f);
}
-void invert_qt_qt(float *q1, const float *q2)
+void invert_qt_qt(float q1[4], const float q2[4])
{
copy_qt_qt(q1, q2);
invert_qt(q1);
}
/* simple mult */
-void mul_qt_fl(float *q, const float f)
+void mul_qt_fl(float q[4], const float f)
{
q[0] *= f;
q[1] *= f;
@@ -140,65 +139,64 @@ void sub_qt_qtqt(float q[4], const float q1[4], const float q2[4])
{
float nq2[4];
- nq2[0]= -q2[0];
- nq2[1]= q2[1];
- nq2[2]= q2[2];
- nq2[3]= q2[3];
+ nq2[0] = -q2[0];
+ nq2[1] = q2[1];
+ nq2[2] = q2[2];
+ nq2[3] = q2[3];
mul_qt_qtqt(q, q1, nq2);
}
/* angular mult factor */
-void mul_fac_qt_fl(float *q, const float fac)
+void mul_fac_qt_fl(float q[4], const float fac)
{
- float angle= fac*saacos(q[0]); /* quat[0]= cos(0.5*angle), but now the 0.5 and 2.0 rule out */
-
- float co= (float)cos(angle);
- float si= (float)sin(angle);
- q[0]= co;
- normalize_v3(q+1);
- mul_v3_fl(q+1, si);
+ float angle = fac * saacos(q[0]); /* quat[0] = cos(0.5 * angle), but now the 0.5 and 2.0 rule out */
+
+ float co = (float)cos(angle);
+ float si = (float)sin(angle);
+ q[0] = co;
+ normalize_v3(q + 1);
+ mul_v3_fl(q + 1, si);
}
/* skip error check, currently only needed by mat3_to_quat_is_ok */
static void quat_to_mat3_no_error(float m[][3], const float q[4])
{
- double q0, q1, q2, q3, qda,qdb,qdc,qaa,qab,qac,qbb,qbc,qcc;
+ double q0, q1, q2, q3, qda, qdb, qdc, qaa, qab, qac, qbb, qbc, qcc;
- q0= M_SQRT2 * (double)q[0];
- q1= M_SQRT2 * (double)q[1];
- q2= M_SQRT2 * (double)q[2];
- q3= M_SQRT2 * (double)q[3];
+ q0 = M_SQRT2 * (double)q[0];
+ q1 = M_SQRT2 * (double)q[1];
+ q2 = M_SQRT2 * (double)q[2];
+ q3 = M_SQRT2 * (double)q[3];
- qda= q0*q1;
- qdb= q0*q2;
- qdc= q0*q3;
- qaa= q1*q1;
- qab= q1*q2;
- qac= q1*q3;
- qbb= q2*q2;
- qbc= q2*q3;
- qcc= q3*q3;
+ qda = q0 * q1;
+ qdb = q0 * q2;
+ qdc = q0 * q3;
+ qaa = q1 * q1;
+ qab = q1 * q2;
+ qac = q1 * q3;
+ qbb = q2 * q2;
+ qbc = q2 * q3;
+ qcc = q3 * q3;
- m[0][0]= (float)(1.0-qbb-qcc);
- m[0][1]= (float)(qdc+qab);
- m[0][2]= (float)(-qdb+qac);
+ m[0][0] = (float)(1.0 - qbb - qcc);
+ m[0][1] = (float)(qdc + qab);
+ m[0][2] = (float)(-qdb + qac);
- m[1][0]= (float)(-qdc+qab);
- m[1][1]= (float)(1.0-qaa-qcc);
- m[1][2]= (float)(qda+qbc);
+ m[1][0] = (float)(-qdc + qab);
+ m[1][1] = (float)(1.0 - qaa - qcc);
+ m[1][2] = (float)(qda + qbc);
- m[2][0]= (float)(qdb+qac);
- m[2][1]= (float)(-qda+qbc);
- m[2][2]= (float)(1.0-qaa-qbb);
+ m[2][0] = (float)(qdb + qac);
+ m[2][1] = (float)(-qda + qbc);
+ m[2][2] = (float)(1.0 - qaa - qbb);
}
-
void quat_to_mat3(float m[][3], const float q[4])
{
#ifdef DEBUG
float f;
- if(!((f=dot_qtqt(q, q))==0.0f || (fabsf(f-1.0f) < (float)QUAT_EPSILON))) {
+ if (!((f = dot_qtqt(q, q)) == 0.0f || (fabsf(f - 1.0f) < (float)QUAT_EPSILON))) {
fprintf(stderr, "Warning! quat_to_mat3() called with non-normalized: size %.8f *** report a bug ***\n", f);
}
#endif
@@ -208,106 +206,106 @@ void quat_to_mat3(float m[][3], const float q[4])
void quat_to_mat4(float m[][4], const float q[4])
{
- double q0, q1, q2, q3, qda,qdb,qdc,qaa,qab,qac,qbb,qbc,qcc;
+ double q0, q1, q2, q3, qda, qdb, qdc, qaa, qab, qac, qbb, qbc, qcc;
#ifdef DEBUG
- if(!((q0=dot_qtqt(q, q))==0.0f || (fabsf(q0-1.0) < QUAT_EPSILON))) {
+ if (!((q0 = dot_qtqt(q, q)) == 0.0f || (fabsf(q0 - 1.0) < QUAT_EPSILON))) {
fprintf(stderr, "Warning! quat_to_mat4() called with non-normalized: size %.8f *** report a bug ***\n", (float)q0);
}
#endif
- q0= M_SQRT2 * (double)q[0];
- q1= M_SQRT2 * (double)q[1];
- q2= M_SQRT2 * (double)q[2];
- q3= M_SQRT2 * (double)q[3];
-
- qda= q0*q1;
- qdb= q0*q2;
- qdc= q0*q3;
- qaa= q1*q1;
- qab= q1*q2;
- qac= q1*q3;
- qbb= q2*q2;
- qbc= q2*q3;
- qcc= q3*q3;
-
- m[0][0]= (float)(1.0-qbb-qcc);
- m[0][1]= (float)(qdc+qab);
- m[0][2]= (float)(-qdb+qac);
- m[0][3]= 0.0f;
-
- m[1][0]= (float)(-qdc+qab);
- m[1][1]= (float)(1.0-qaa-qcc);
- m[1][2]= (float)(qda+qbc);
- m[1][3]= 0.0f;
-
- m[2][0]= (float)(qdb+qac);
- m[2][1]= (float)(-qda+qbc);
- m[2][2]= (float)(1.0-qaa-qbb);
- m[2][3]= 0.0f;
-
- m[3][0]= m[3][1]= m[3][2]= 0.0f;
- m[3][3]= 1.0f;
-}
-
-void mat3_to_quat(float *q, float wmat[][3])
+ q0 = M_SQRT2 * (double)q[0];
+ q1 = M_SQRT2 * (double)q[1];
+ q2 = M_SQRT2 * (double)q[2];
+ q3 = M_SQRT2 * (double)q[3];
+
+ qda = q0 * q1;
+ qdb = q0 * q2;
+ qdc = q0 * q3;
+ qaa = q1 * q1;
+ qab = q1 * q2;
+ qac = q1 * q3;
+ qbb = q2 * q2;
+ qbc = q2 * q3;
+ qcc = q3 * q3;
+
+ m[0][0] = (float)(1.0 - qbb - qcc);
+ m[0][1] = (float)(qdc + qab);
+ m[0][2] = (float)(-qdb + qac);
+ m[0][3] = 0.0f;
+
+ m[1][0] = (float)(-qdc + qab);
+ m[1][1] = (float)(1.0 - qaa - qcc);
+ m[1][2] = (float)(qda + qbc);
+ m[1][3] = 0.0f;
+
+ m[2][0] = (float)(qdb + qac);
+ m[2][1] = (float)(-qda + qbc);
+ m[2][2] = (float)(1.0 - qaa - qbb);
+ m[2][3] = 0.0f;
+
+ m[3][0] = m[3][1] = m[3][2] = 0.0f;
+ m[3][3] = 1.0f;
+}
+
+void mat3_to_quat(float q[4], float wmat[][3])
{
double tr, s;
float mat[3][3];
/* work on a copy */
copy_m3_m3(mat, wmat);
- normalize_m3(mat); /* this is needed AND a 'normalize_qt' in the end */
-
- tr= 0.25* (double)(1.0f+mat[0][0]+mat[1][1]+mat[2][2]);
-
- if(tr>(double)FLT_EPSILON) {
- s= sqrt(tr);
- q[0]= (float)s;
- s= 1.0/(4.0*s);
- q[1]= (float)((mat[1][2]-mat[2][1])*s);
- q[2]= (float)((mat[2][0]-mat[0][2])*s);
- q[3]= (float)((mat[0][1]-mat[1][0])*s);
+ normalize_m3(mat); /* this is needed AND a 'normalize_qt' in the end */
+
+ tr = 0.25 * (double)(1.0f + mat[0][0] + mat[1][1] + mat[2][2]);
+
+ if (tr > (double)FLT_EPSILON) {
+ s = sqrt(tr);
+ q[0] = (float)s;
+ s = 1.0 / (4.0 * s);
+ q[1] = (float)((mat[1][2] - mat[2][1]) * s);
+ q[2] = (float)((mat[2][0] - mat[0][2]) * s);
+ q[3] = (float)((mat[0][1] - mat[1][0]) * s);
}
else {
- if(mat[0][0] > mat[1][1] && mat[0][0] > mat[2][2]) {
- s= 2.0f*sqrtf(1.0f + mat[0][0] - mat[1][1] - mat[2][2]);
- q[1]= (float)(0.25*s);
-
- s= 1.0/s;
- q[0]= (float)((double)(mat[2][1] - mat[1][2])*s);
- q[2]= (float)((double)(mat[1][0] + mat[0][1])*s);
- q[3]= (float)((double)(mat[2][0] + mat[0][2])*s);
+ if (mat[0][0] > mat[1][1] && mat[0][0] > mat[2][2]) {
+ s = 2.0f * sqrtf(1.0f + mat[0][0] - mat[1][1] - mat[2][2]);
+ q[1] = (float)(0.25 * s);
+
+ s = 1.0 / s;
+ q[0] = (float)((double)(mat[2][1] - mat[1][2]) * s);
+ q[2] = (float)((double)(mat[1][0] + mat[0][1]) * s);
+ q[3] = (float)((double)(mat[2][0] + mat[0][2]) * s);
}
- else if(mat[1][1] > mat[2][2]) {
- s= 2.0f*sqrtf(1.0f + mat[1][1] - mat[0][0] - mat[2][2]);
- q[2]= (float)(0.25*s);
-
- s= 1.0/s;
- q[0]= (float)((double)(mat[2][0] - mat[0][2])*s);
- q[1]= (float)((double)(mat[1][0] + mat[0][1])*s);
- q[3]= (float)((double)(mat[2][1] + mat[1][2])*s);
+ else if (mat[1][1] > mat[2][2]) {
+ s = 2.0f * sqrtf(1.0f + mat[1][1] - mat[0][0] - mat[2][2]);
+ q[2] = (float)(0.25 * s);
+
+ s = 1.0 / s;
+ q[0] = (float)((double)(mat[2][0] - mat[0][2]) * s);
+ q[1] = (float)((double)(mat[1][0] + mat[0][1]) * s);
+ q[3] = (float)((double)(mat[2][1] + mat[1][2]) * s);
}
else {
- s= 2.0f*sqrtf(1.0f + mat[2][2] - mat[0][0] - mat[1][1]);
- q[3]= (float)(0.25*s);
+ s = 2.0f * sqrtf(1.0f + mat[2][2] - mat[0][0] - mat[1][1]);
+ q[3] = (float)(0.25 * s);
- s= 1.0/s;
- q[0]= (float)((double)(mat[1][0] - mat[0][1])*s);
- q[1]= (float)((double)(mat[2][0] + mat[0][2])*s);
- q[2]= (float)((double)(mat[2][1] + mat[1][2])*s);
+ s = 1.0 / s;
+ q[0] = (float)((double)(mat[1][0] - mat[0][1]) * s);
+ q[1] = (float)((double)(mat[2][0] + mat[0][2]) * s);
+ q[2] = (float)((double)(mat[2][1] + mat[1][2]) * s);
}
}
normalize_qt(q);
}
-void mat4_to_quat(float *q, float m[][4])
+void mat4_to_quat(float q[4], float m[][4])
{
float mat[3][3];
-
+
copy_m3_m4(mat, m);
- mat3_to_quat(q,mat);
+ mat3_to_quat(q, mat);
}
void mat3_to_quat_is_ok(float q[4], float wmat[3][3])
@@ -317,54 +315,53 @@ void mat3_to_quat_is_ok(float q[4], float wmat[3][3])
/* work on a copy */
copy_m3_m3(mat, wmat);
normalize_m3(mat);
-
+
/* rotate z-axis of matrix to z-axis */
- nor[0] = mat[2][1]; /* cross product with (0,0,1) */
- nor[1] = -mat[2][0];
+ nor[0] = mat[2][1]; /* cross product with (0,0,1) */
+ nor[1] = -mat[2][0];
nor[2] = 0.0;
normalize_v3(nor);
-
- co= mat[2][2];
- angle= 0.5f*saacos(co);
-
- co= (float)cos(angle);
- si= (float)sin(angle);
- q1[0]= co;
- q1[1]= -nor[0]*si; /* negative here, but why? */
- q1[2]= -nor[1]*si;
- q1[3]= -nor[2]*si;
+
+ co = mat[2][2];
+ angle = 0.5f * saacos(co);
+
+ co = (float)cos(angle);
+ si = (float)sin(angle);
+ q1[0] = co;
+ q1[1] = -nor[0] * si; /* negative here, but why? */
+ q1[2] = -nor[1] * si;
+ q1[3] = -nor[2] * si;
/* rotate back x-axis from mat, using inverse q1 */
- quat_to_mat3_no_error( matr,q1);
+ quat_to_mat3_no_error(matr, q1);
invert_m3_m3(matn, matr);
mul_m3_v3(matn, mat[0]);
-
+
/* and align x-axes */
- angle= (float)(0.5*atan2(mat[0][1], mat[0][0]));
-
- co= (float)cos(angle);
- si= (float)sin(angle);
- q2[0]= co;
- q2[1]= 0.0f;
- q2[2]= 0.0f;
- q2[3]= si;
-
+ angle = (float)(0.5 * atan2(mat[0][1], mat[0][0]));
+
+ co = (float)cos(angle);
+ si = (float)sin(angle);
+ q2[0] = co;
+ q2[1] = 0.0f;
+ q2[2] = 0.0f;
+ q2[3] = si;
+
mul_qt_qtqt(q, q1, q2);
}
-
-float normalize_qt(float *q)
+float normalize_qt(float q[4])
{
float len;
-
- len= (float)sqrt(dot_qtqt(q, q));
- if(len!=0.0f) {
- mul_qt_fl(q, 1.0f/len);
+
+ len = (float)sqrt(dot_qtqt(q, q));
+ if (len != 0.0f) {
+ mul_qt_fl(q, 1.0f / len);
}
else {
- q[1]= 1.0f;
- q[0]= q[2]= q[3]= 0.0f;
+ q[1] = 1.0f;
+ q[0] = q[2] = q[3] = 0.0f;
}
return len;
@@ -377,19 +374,19 @@ float normalize_qt_qt(float r[4], const float q[4])
}
/* note: expects vectors to be normalized */
-void rotation_between_vecs_to_quat(float *q, const float v1[3], const float v2[3])
+void rotation_between_vecs_to_quat(float q[4], const float v1[3], const float v2[3])
{
float axis[3];
float angle;
-
+
cross_v3_v3v3(axis, v1, v2);
-
+
angle = angle_normalized_v3v3(v1, v2);
-
+
axis_angle_to_quat(q, axis, angle);
}
-void rotation_between_quats_to_quat(float *q, const float q1[4], const float q2[4])
+void rotation_between_quats_to_quat(float q[4], const float q1[4], const float q2[4])
{
float tquat[4];
double dot = 0.0f;
@@ -399,147 +396,151 @@ void rotation_between_quats_to_quat(float *q, const float q1[4], const float q2[
conjugate_qt(tquat);
dot = 1.0f / dot_qtqt(tquat, tquat);
- for(x = 0; x < 4; x++)
+ for (x = 0; x < 4; x++)
tquat[x] *= dot;
mul_qt_qtqt(q, tquat, q2);
}
-
void vec_to_quat(float q[4], const float vec[3], short axis, const short upflag)
{
float q2[4], nor[3], *fp, mat[3][3], angle, si, co, x2, y2, z2, len1;
-
+
assert(axis >= 0 && axis <= 5);
assert(upflag >= 0 && upflag <= 2);
-
+
/* first rotate to axis */
- if(axis>2) {
- x2= vec[0] ; y2= vec[1] ; z2= vec[2];
- axis-= 3;
+ if (axis > 2) {
+ x2 = vec[0];
+ y2 = vec[1];
+ z2 = vec[2];
+ axis -= 3;
}
else {
- x2= -vec[0] ; y2= -vec[1] ; z2= -vec[2];
+ x2 = -vec[0];
+ y2 = -vec[1];
+ z2 = -vec[2];
}
-
- q[0]=1.0;
- q[1]=q[2]=q[3]= 0.0;
- len1= (float)sqrt(x2*x2+y2*y2+z2*z2);
- if(len1 == 0.0f) return;
+ q[0] = 1.0;
+ q[1] = q[2] = q[3] = 0.0;
+
+ len1 = (float)sqrt(x2 * x2 + y2 * y2 + z2 * z2);
+ if (len1 == 0.0f) return;
/* nasty! I need a good routine for this...
* problem is a rotation of an Y axis to the negative Y-axis for example.
*/
- if(axis==0) { /* x-axis */
- nor[0]= 0.0;
- nor[1]= -z2;
- nor[2]= y2;
+ if (axis == 0) { /* x-axis */
+ nor[0] = 0.0;
+ nor[1] = -z2;
+ nor[2] = y2;
- if(fabs(y2)+fabs(z2)<0.0001)
- nor[1]= 1.0;
+ if (fabs(y2) + fabs(z2) < 0.0001)
+ nor[1] = 1.0;
- co= x2;
+ co = x2;
}
- else if(axis==1) { /* y-axis */
- nor[0]= z2;
- nor[1]= 0.0;
- nor[2]= -x2;
-
- if(fabs(x2)+fabs(z2)<0.0001)
- nor[2]= 1.0;
-
- co= y2;
+ else if (axis == 1) { /* y-axis */
+ nor[0] = z2;
+ nor[1] = 0.0;
+ nor[2] = -x2;
+
+ if (fabs(x2) + fabs(z2) < 0.0001)
+ nor[2] = 1.0;
+
+ co = y2;
}
- else { /* z-axis */
- nor[0]= -y2;
- nor[1]= x2;
- nor[2]= 0.0;
+ else { /* z-axis */
+ nor[0] = -y2;
+ nor[1] = x2;
+ nor[2] = 0.0;
- if(fabs(x2)+fabs(y2)<0.0001)
- nor[0]= 1.0;
+ if (fabs(x2) + fabs(y2) < 0.0001)
+ nor[0] = 1.0;
- co= z2;
+ co = z2;
}
- co/= len1;
+ co /= len1;
normalize_v3(nor);
-
- angle= 0.5f*saacos(co);
- si= (float)sin(angle);
- q[0]= (float)cos(angle);
- q[1]= nor[0]*si;
- q[2]= nor[1]*si;
- q[3]= nor[2]*si;
-
- if(axis!=upflag) {
- quat_to_mat3(mat,q);
-
- fp= mat[2];
- if(axis==0) {
- if(upflag==1) angle= (float)(0.5*atan2(fp[2], fp[1]));
- else angle= (float)(-0.5*atan2(fp[1], fp[2]));
+
+ angle = 0.5f * saacos(co);
+ si = (float)sin(angle);
+ q[0] = (float)cos(angle);
+ q[1] = nor[0] * si;
+ q[2] = nor[1] * si;
+ q[3] = nor[2] * si;
+
+ if (axis != upflag) {
+ quat_to_mat3(mat, q);
+
+ fp = mat[2];
+ if (axis == 0) {
+ if (upflag == 1) angle = (float)(0.5 * atan2(fp[2], fp[1]));
+ else angle = (float)(-0.5 * atan2(fp[1], fp[2]));
}
- else if(axis==1) {
- if(upflag==0) angle= (float)(-0.5*atan2(fp[2], fp[0]));
- else angle= (float)(0.5*atan2(fp[0], fp[2]));
+ else if (axis == 1) {
+ if (upflag == 0) angle = (float)(-0.5 * atan2(fp[2], fp[0]));
+ else angle = (float)(0.5 * atan2(fp[0], fp[2]));
}
else {
- if(upflag==0) angle= (float)(0.5*atan2(-fp[1], -fp[0]));
- else angle= (float)(-0.5*atan2(-fp[0], -fp[1]));
+ if (upflag == 0) angle = (float)(0.5 * atan2(-fp[1], -fp[0]));
+ else angle = (float)(-0.5 * atan2(-fp[0], -fp[1]));
}
-
- co= cosf(angle);
- si= sinf(angle)/len1;
- q2[0]= co;
- q2[1]= x2*si;
- q2[2]= y2*si;
- q2[3]= z2*si;
-
- mul_qt_qtqt(q,q2,q);
+
+ co = cosf(angle);
+ si = sinf(angle) / len1;
+ q2[0] = co;
+ q2[1] = x2 * si;
+ q2[2] = y2 * si;
+ q2[3] = z2 * si;
+
+ mul_qt_qtqt(q, q2, q);
}
}
#if 0
+
/* A & M Watt, Advanced animation and rendering techniques, 1992 ACM press */
-void QuatInterpolW(float *result, float *quat1, float *quat2, float t)
+void QuatInterpolW(float *result, float quat1[4], float quat2[4], float t)
{
float omega, cosom, sinom, sc1, sc2;
cosom = quat1[0] * quat2[0] + quat1[1] * quat2[1] + quat1[2] * quat2[2] + quat1[3] * quat2[3];
-
+
/* rotate around shortest angle */
if ((1.0f + cosom) > 0.0001f) {
-
+
if ((1.0f - cosom) > 0.0001f) {
omega = (float)acos(cosom);
sinom = (float)sin(omega);
sc1 = (float)sin((1.0 - t) * omega) / sinom;
sc2 = (float)sin(t * omega) / sinom;
- }
+ }
else {
sc1 = 1.0f - t;
sc2 = t;
}
- result[0] = sc1*quat1[0] + sc2*quat2[0];
- result[1] = sc1*quat1[1] + sc2*quat2[1];
- result[2] = sc1*quat1[2] + sc2*quat2[2];
- result[3] = sc1*quat1[3] + sc2*quat2[3];
- }
+ result[0] = sc1 * quat1[0] + sc2 * quat2[0];
+ result[1] = sc1 * quat1[1] + sc2 * quat2[1];
+ result[2] = sc1 * quat1[2] + sc2 * quat2[2];
+ result[3] = sc1 * quat1[3] + sc2 * quat2[3];
+ }
else {
result[0] = quat2[3];
result[1] = -quat2[2];
result[2] = quat2[1];
result[3] = -quat2[0];
-
- sc1 = (float)sin((1.0 - t)*M_PI_2);
- sc2 = (float)sin(t*M_PI_2);
-
- result[0] = sc1*quat1[0] + sc2*result[0];
- result[1] = sc1*quat1[1] + sc2*result[1];
- result[2] = sc1*quat1[2] + sc2*result[2];
- result[3] = sc1*quat1[3] + sc2*result[3];
+
+ sc1 = (float)sin((1.0 - t) * M_PI_2);
+ sc2 = (float)sin(t * M_PI_2);
+
+ result[0] = sc1 * quat1[0] + sc2 * result[0];
+ result[1] = sc1 * quat1[1] + sc2 * result[1];
+ result[2] = sc1 * quat1[2] + sc2 * result[2];
+ result[3] = sc1 * quat1[3] + sc2 * result[3];
}
}
#endif
@@ -553,28 +554,29 @@ void interp_qt_qtqt(float result[4], const float quat1[4], const float quat2[4],
/* rotate around shortest angle */
if (cosom < 0.0f) {
cosom = -cosom;
- quat[0]= -quat1[0];
- quat[1]= -quat1[1];
- quat[2]= -quat1[2];
- quat[3]= -quat1[3];
- }
+ quat[0] = -quat1[0];
+ quat[1] = -quat1[1];
+ quat[2] = -quat1[2];
+ quat[3] = -quat1[3];
+ }
else {
- quat[0]= quat1[0];
- quat[1]= quat1[1];
- quat[2]= quat1[2];
- quat[3]= quat1[3];
+ quat[0] = quat1[0];
+ quat[1] = quat1[1];
+ quat[2] = quat1[2];
+ quat[3] = quat1[3];
}
-
+
if ((1.0f - cosom) > 0.0001f) {
omega = (float)acos(cosom);
sinom = (float)sin(omega);
sc1 = (float)sin((1 - t) * omega) / sinom;
sc2 = (float)sin(t * omega) / sinom;
- } else {
- sc1= 1.0f - t;
- sc2= t;
}
-
+ else {
+ sc1 = 1.0f - t;
+ sc2 = t;
+ }
+
result[0] = sc1 * quat[0] + sc2 * quat2[0];
result[1] = sc1 * quat[1] + sc2 * quat2[1];
result[2] = sc1 * quat[2] + sc2 * quat2[2];
@@ -583,57 +585,57 @@ void interp_qt_qtqt(float result[4], const float quat1[4], const float quat2[4],
void add_qt_qtqt(float result[4], const float quat1[4], const float quat2[4], const float t)
{
- result[0]= quat1[0] + t*quat2[0];
- result[1]= quat1[1] + t*quat2[1];
- result[2]= quat1[2] + t*quat2[2];
- result[3]= quat1[3] + t*quat2[3];
+ result[0] = quat1[0] + t * quat2[0];
+ result[1] = quat1[1] + t * quat2[1];
+ result[2] = quat1[2] + t * quat2[2];
+ result[3] = quat1[3] + t * quat2[3];
}
void tri_to_quat(float quat[4], const float v1[3], const float v2[3], const float v3[3])
{
/* imaginary x-axis, y-axis triangle is being rotated */
float vec[3], q1[4], q2[4], n[3], si, co, angle, mat[3][3], imat[3][3];
-
+
/* move z-axis to face-normal */
- normal_tri_v3(vec,v1, v2, v3);
+ normal_tri_v3(vec, v1, v2, v3);
- n[0]= vec[1];
- n[1]= -vec[0];
- n[2]= 0.0f;
+ n[0] = vec[1];
+ n[1] = -vec[0];
+ n[2] = 0.0f;
normalize_v3(n);
-
- if(n[0]==0.0f && n[1]==0.0f) n[0]= 1.0f;
-
- angle= -0.5f*(float)saacos(vec[2]);
- co= (float)cos(angle);
- si= (float)sin(angle);
- q1[0]= co;
- q1[1]= n[0]*si;
- q1[2]= n[1]*si;
- q1[3]= 0.0f;
-
+
+ if (n[0] == 0.0f && n[1] == 0.0f) n[0] = 1.0f;
+
+ angle = -0.5f * (float)saacos(vec[2]);
+ co = (float)cos(angle);
+ si = (float)sin(angle);
+ q1[0] = co;
+ q1[1] = n[0] * si;
+ q1[2] = n[1] * si;
+ q1[3] = 0.0f;
+
/* rotate back line v1-v2 */
- quat_to_mat3(mat,q1);
+ quat_to_mat3(mat, q1);
invert_m3_m3(imat, mat);
sub_v3_v3v3(vec, v2, v1);
mul_m3_v3(imat, vec);
/* what angle has this line with x-axis? */
- vec[2]= 0.0f;
+ vec[2] = 0.0f;
normalize_v3(vec);
- angle= (float)(0.5*atan2(vec[1], vec[0]));
- co= (float)cos(angle);
- si= (float)sin(angle);
- q2[0]= co;
- q2[1]= 0.0f;
- q2[2]= 0.0f;
- q2[3]= si;
+ angle = (float)(0.5 * atan2(vec[1], vec[0]));
+ co = (float)cos(angle);
+ si = (float)sin(angle);
+ q2[0] = co;
+ q2[1] = 0.0f;
+ q2[2] = 0.0f;
+ q2[3] = si;
mul_qt_qtqt(quat, q1, q2);
}
-void print_qt(const char *str, const float q[4])
+void print_qt(const char *str, const float q[4])
{
printf("%s: %.3f %.3f %.3f %.3f\n", str, q[0], q[1], q[2], q[3]);
}
@@ -646,7 +648,7 @@ void axis_angle_to_quat(float q[4], const float axis[3], float angle)
float nor[3];
float si;
- if(normalize_v3_v3(nor, axis) == 0.0f) {
+ if (normalize_v3_v3(nor, axis) == 0.0f) {
unit_qt(q);
return;
}
@@ -656,7 +658,7 @@ void axis_angle_to_quat(float q[4], const float axis[3], float angle)
q[0] = (float)cos(angle);
q[1] = nor[0] * si;
q[2] = nor[1] * si;
- q[3] = nor[2] * si;
+ q[3] = nor[2] * si;
}
/* Quaternions to Axis Angle */
@@ -665,67 +667,70 @@ void quat_to_axis_angle(float axis[3], float *angle, const float q[4])
float ha, si;
#ifdef DEBUG
- if(!((ha=dot_qtqt(q, q))==0.0f || (fabsf(ha-1.0f) < (float)QUAT_EPSILON))) {
+ if (!((ha = dot_qtqt(q, q)) == 0.0f || (fabsf(ha - 1.0f) < (float)QUAT_EPSILON))) {
fprintf(stderr, "Warning! quat_to_axis_angle() called with non-normalized: size %.8f *** report a bug ***\n", ha);
}
#endif
/* calculate angle/2, and sin(angle/2) */
- ha= (float)acos(q[0]);
- si= (float)sin(ha);
-
+ ha = (float)acos(q[0]);
+ si = (float)sin(ha);
+
/* from half-angle to angle */
- *angle= ha * 2;
-
+ *angle = ha * 2;
+
/* prevent division by zero for axis conversion */
if (fabs(si) < 0.0005)
- si= 1.0f;
-
- axis[0]= q[1] / si;
- axis[1]= q[2] / si;
- axis[2]= q[3] / si;
+ si = 1.0f;
+
+ axis[0] = q[1] / si;
+ axis[1] = q[2] / si;
+ axis[2] = q[3] / si;
}
/* Axis Angle to Euler Rotation */
void axis_angle_to_eulO(float eul[3], const short order, const float axis[3], const float angle)
{
float q[4];
-
+
/* use quaternions as intermediate representation for now... */
axis_angle_to_quat(q, axis, angle);
- quat_to_eulO(eul, order,q);
+ quat_to_eulO(eul, order, q);
}
/* Euler Rotation to Axis Angle */
void eulO_to_axis_angle(float axis[3], float *angle, const float eul[3], const short order)
{
float q[4];
-
+
/* use quaternions as intermediate representation for now... */
- eulO_to_quat(q,eul, order);
- quat_to_axis_angle(axis, angle,q);
+ eulO_to_quat(q, eul, order);
+ 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)
+ *
+ * note: we may want a normalized and non normalized version of this function.
+ */
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) */
- if(normalize_v3_v3(nor, axis) == 0.0f) {
+
+ /* normalize the axis first (to remove unwanted scaling) */
+ if (normalize_v3_v3(nor, axis) == 0.0f) {
unit_m3(mat);
return;
}
-
+
/* now convert this to a 3x3 matrix */
- co= (float)cos(angle);
- si= (float)sin(angle);
-
- ico= (1.0f - co);
- nsi[0]= nor[0]*si;
- nsi[1]= nor[1]*si;
- nsi[2]= nor[2]*si;
-
+ co = (float)cos(angle);
+ si = (float)sin(angle);
+
+ ico = (1.0f - co);
+ nsi[0] = nor[0] * si;
+ nsi[1] = nor[1] * si;
+ nsi[2] = nor[2] * si;
+
mat[0][0] = ((nor[0] * nor[0]) * ico) + co;
mat[0][1] = ((nor[0] * nor[1]) * ico) + nsi[2];
mat[0][2] = ((nor[0] * nor[2]) * ico) - nsi[1];
@@ -737,119 +742,117 @@ 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];
-
- axis_angle_to_mat3(tmat,axis, angle);
+
+ axis_angle_to_mat3(tmat, axis, angle);
unit_m4(mat);
copy_m4_m3(mat, tmat);
}
/* 3x3 matrix to axis angle (see Mat4ToVecRot too) */
-void mat3_to_axis_angle(float axis[3], float *angle,float mat[3][3])
+void mat3_to_axis_angle(float axis[3], float *angle, float mat[3][3])
{
float q[4];
-
+
/* use quaternions as intermediate representation */
// TODO: it would be nicer to go straight there...
- mat3_to_quat(q,mat);
- quat_to_axis_angle(axis, angle,q);
+ mat3_to_quat(q, mat);
+ quat_to_axis_angle(axis, angle, q);
}
/* 4x4 matrix to axis angle (see Mat4ToVecRot too) */
-void mat4_to_axis_angle(float axis[3], float *angle,float mat[4][4])
+void mat4_to_axis_angle(float axis[3], float *angle, float mat[4][4])
{
float q[4];
-
+
/* use quaternions as intermediate representation */
// TODO: it would be nicer to go straight there...
- mat4_to_quat(q,mat);
- quat_to_axis_angle(axis, angle,q);
+ mat4_to_quat(q, mat);
+ quat_to_axis_angle(axis, angle, q);
}
-
-
void single_axis_angle_to_mat3(float mat[3][3], const char axis, const float angle)
{
- const float angle_cos= cosf(angle);
- const float angle_sin= sinf(angle);
-
- switch(axis) {
- case 'X': /* rotation around X */
- mat[0][0] = 1.0f;
- mat[0][1] = 0.0f;
- mat[0][2] = 0.0f;
- mat[1][0] = 0.0f;
- mat[1][1] = angle_cos;
- mat[1][2] = angle_sin;
- mat[2][0] = 0.0f;
- mat[2][1] = -angle_sin;
- mat[2][2] = angle_cos;
- break;
- case 'Y': /* rotation around Y */
- mat[0][0] = angle_cos;
- mat[0][1] = 0.0f;
- mat[0][2] = -angle_sin;
- mat[1][0] = 0.0f;
- mat[1][1] = 1.0f;
- mat[1][2] = 0.0f;
- mat[2][0] = angle_sin;
- mat[2][1] = 0.0f;
- mat[2][2] = angle_cos;
- break;
- case 'Z': /* rotation around Z */
- mat[0][0] = angle_cos;
- mat[0][1] = angle_sin;
- mat[0][2] = 0.0f;
- mat[1][0] = -angle_sin;
- mat[1][1] = angle_cos;
- mat[1][2] = 0.0f;
- mat[2][0] = 0.0f;
- mat[2][1] = 0.0f;
- mat[2][2] = 1.0f;
- break;
- default:
- assert(0);
+ const float angle_cos = cosf(angle);
+ const float angle_sin = sinf(angle);
+
+ switch (axis) {
+ case 'X': /* rotation around X */
+ mat[0][0] = 1.0f;
+ mat[0][1] = 0.0f;
+ mat[0][2] = 0.0f;
+ mat[1][0] = 0.0f;
+ mat[1][1] = angle_cos;
+ mat[1][2] = angle_sin;
+ mat[2][0] = 0.0f;
+ mat[2][1] = -angle_sin;
+ mat[2][2] = angle_cos;
+ break;
+ case 'Y': /* rotation around Y */
+ mat[0][0] = angle_cos;
+ mat[0][1] = 0.0f;
+ mat[0][2] = -angle_sin;
+ mat[1][0] = 0.0f;
+ mat[1][1] = 1.0f;
+ mat[1][2] = 0.0f;
+ mat[2][0] = angle_sin;
+ mat[2][1] = 0.0f;
+ mat[2][2] = angle_cos;
+ break;
+ case 'Z': /* rotation around Z */
+ mat[0][0] = angle_cos;
+ mat[0][1] = angle_sin;
+ mat[0][2] = 0.0f;
+ mat[1][0] = -angle_sin;
+ mat[1][1] = angle_cos;
+ mat[1][2] = 0.0f;
+ mat[2][0] = 0.0f;
+ mat[2][1] = 0.0f;
+ mat[2][2] = 1.0f;
+ break;
+ default:
+ assert(0);
}
}
/****************************** Vector/Rotation ******************************/
/* TODO: the following calls should probably be depreceated sometime */
-/* axis angle to 3x3 matrix */
+/* ODO, replace use of this function with axis_angle_to_mat3() */
void vec_rot_to_mat3(float mat[][3], const float vec[3], const float phi)
{
/* rotation of phi radials around vec */
float vx, vx2, vy, vy2, vz, vz2, co, si;
-
- vx= vec[0];
- vy= vec[1];
- vz= vec[2];
- vx2= vx*vx;
- vy2= vy*vy;
- vz2= vz*vz;
- co= (float)cos(phi);
- si= (float)sin(phi);
-
- mat[0][0]= vx2+co*(1.0f-vx2);
- mat[0][1]= vx*vy*(1.0f-co)+vz*si;
- mat[0][2]= vz*vx*(1.0f-co)-vy*si;
- mat[1][0]= vx*vy*(1.0f-co)-vz*si;
- mat[1][1]= vy2+co*(1.0f-vy2);
- mat[1][2]= vy*vz*(1.0f-co)+vx*si;
- mat[2][0]= vz*vx*(1.0f-co)+vy*si;
- mat[2][1]= vy*vz*(1.0f-co)-vx*si;
- mat[2][2]= vz2+co*(1.0f-vz2);
+
+ vx = vec[0];
+ vy = vec[1];
+ vz = vec[2];
+ vx2 = vx * vx;
+ vy2 = vy * vy;
+ vz2 = vz * vz;
+ co = (float)cos(phi);
+ si = (float)sin(phi);
+
+ mat[0][0] = vx2 + co * (1.0f - vx2);
+ mat[0][1] = vx * vy * (1.0f - co) + vz * si;
+ mat[0][2] = vz * vx * (1.0f - co) - vy * si;
+ mat[1][0] = vx * vy * (1.0f - co) - vz * si;
+ mat[1][1] = vy2 + co * (1.0f - vy2);
+ mat[1][2] = vy * vz * (1.0f - co) + vx * si;
+ mat[2][0] = vz * vx * (1.0f - co) + vy * si;
+ mat[2][1] = vy * vz * (1.0f - co) - vx * si;
+ mat[2][2] = vz2 + co * (1.0f - vz2);
}
/* axis angle to 4x4 matrix */
void vec_rot_to_mat4(float mat[][4], const float vec[3], const float phi)
{
float tmat[3][3];
-
- vec_rot_to_mat3(tmat,vec, phi);
+
+ vec_rot_to_mat3(tmat, vec, phi);
unit_m4(mat);
copy_m4_m3(mat, tmat);
}
@@ -860,16 +863,16 @@ void vec_rot_to_quat(float *quat, const float vec[3], const float phi)
/* rotation of phi radials around vec */
float si;
- quat[1]= vec[0];
- quat[2]= vec[1];
- quat[3]= vec[2];
-
- if(normalize_v3(quat+1) == 0.0f) {
+ quat[1] = vec[0];
+ quat[2] = vec[1];
+ quat[3] = vec[2];
+
+ if (normalize_v3(quat + 1) == 0.0f) {
unit_qt(quat);
}
else {
- quat[0]= (float)cos((double)phi/2.0);
- si= (float)sin((double)phi/2.0);
+ quat[0] = (float)cos((double)phi / 2.0);
+ si = (float)sin((double)phi / 2.0);
quat[1] *= si;
quat[2] *= si;
quat[3] *= si;
@@ -882,27 +885,27 @@ void vec_rot_to_quat(float *quat, const float vec[3], const float phi)
void eul_to_mat3(float mat[][3], const float eul[3])
{
double ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
-
- ci = cos(eul[0]);
- cj = cos(eul[1]);
+
+ ci = cos(eul[0]);
+ cj = cos(eul[1]);
ch = cos(eul[2]);
- si = sin(eul[0]);
- sj = sin(eul[1]);
+ si = sin(eul[0]);
+ sj = sin(eul[1]);
sh = sin(eul[2]);
- cc = ci*ch;
- cs = ci*sh;
- sc = si*ch;
- ss = si*sh;
+ cc = ci * ch;
+ cs = ci * sh;
+ sc = si * ch;
+ ss = si * sh;
- mat[0][0] = (float)(cj*ch);
- mat[1][0] = (float)(sj*sc-cs);
- mat[2][0] = (float)(sj*cc+ss);
- mat[0][1] = (float)(cj*sh);
- mat[1][1] = (float)(sj*ss+cc);
- mat[2][1] = (float)(sj*cs-sc);
- mat[0][2] = (float)-sj;
- mat[1][2] = (float)(cj*si);
- mat[2][2] = (float)(cj*ci);
+ mat[0][0] = (float)(cj * ch);
+ mat[1][0] = (float)(sj * sc - cs);
+ mat[2][0] = (float)(sj * cc + ss);
+ mat[0][1] = (float)(cj * sh);
+ mat[1][1] = (float)(sj * ss + cc);
+ mat[2][1] = (float)(sj * cs - sc);
+ mat[0][2] = (float)-sj;
+ mat[1][2] = (float)(cj * si);
+ mat[2][2] = (float)(cj * ci);
}
@@ -910,74 +913,76 @@ void eul_to_mat3(float mat[][3], const float eul[3])
void eul_to_mat4(float mat[][4], const float eul[3])
{
double ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
-
- ci = cos(eul[0]);
- cj = cos(eul[1]);
+
+ ci = cos(eul[0]);
+ cj = cos(eul[1]);
ch = cos(eul[2]);
- si = sin(eul[0]);
- sj = sin(eul[1]);
+ si = sin(eul[0]);
+ sj = sin(eul[1]);
sh = sin(eul[2]);
- cc = ci*ch;
- cs = ci*sh;
- sc = si*ch;
- ss = si*sh;
+ cc = ci * ch;
+ cs = ci * sh;
+ sc = si * ch;
+ ss = si * sh;
- mat[0][0] = (float)(cj*ch);
- mat[1][0] = (float)(sj*sc-cs);
- mat[2][0] = (float)(sj*cc+ss);
- mat[0][1] = (float)(cj*sh);
- mat[1][1] = (float)(sj*ss+cc);
- mat[2][1] = (float)(sj*cs-sc);
- mat[0][2] = (float)-sj;
- mat[1][2] = (float)(cj*si);
- mat[2][2] = (float)(cj*ci);
+ mat[0][0] = (float)(cj * ch);
+ mat[1][0] = (float)(sj * sc - cs);
+ mat[2][0] = (float)(sj * cc + ss);
+ mat[0][1] = (float)(cj * sh);
+ mat[1][1] = (float)(sj * ss + cc);
+ mat[2][1] = (float)(sj * cs - sc);
+ mat[0][2] = (float)-sj;
+ mat[1][2] = (float)(cj * si);
+ mat[2][2] = (float)(cj * ci);
- mat[3][0]= mat[3][1]= mat[3][2]= mat[0][3]= mat[1][3]= mat[2][3]= 0.0f;
- mat[3][3]= 1.0f;
+ mat[3][0] = mat[3][1] = mat[3][2] = mat[0][3] = mat[1][3] = mat[2][3] = 0.0f;
+ mat[3][3] = 1.0f;
}
/* returns two euler calculation methods, so we can pick the best */
+
/* XYZ order */
static void mat3_to_eul2(float tmat[][3], float eul1[3], float eul2[3])
{
float cy, quat[4], mat[3][3];
-
- mat3_to_quat(quat,tmat);
- quat_to_mat3(mat,quat);
+
+ mat3_to_quat(quat, tmat);
+ quat_to_mat3(mat, quat);
copy_m3_m3(mat, tmat);
normalize_m3(mat);
-
- cy = (float)sqrt(mat[0][0]*mat[0][0] + mat[0][1]*mat[0][1]);
-
- if (cy > 16.0f*FLT_EPSILON) {
-
+
+ cy = (float)sqrt(mat[0][0] * mat[0][0] + mat[0][1] * mat[0][1]);
+
+ if (cy > 16.0f * FLT_EPSILON) {
+
eul1[0] = (float)atan2(mat[1][2], mat[2][2]);
eul1[1] = (float)atan2(-mat[0][2], cy);
eul1[2] = (float)atan2(mat[0][1], mat[0][0]);
-
+
eul2[0] = (float)atan2(-mat[1][2], -mat[2][2]);
eul2[1] = (float)atan2(-mat[0][2], -cy);
eul2[2] = (float)atan2(-mat[0][1], -mat[0][0]);
-
- } else {
+
+ }
+ else {
eul1[0] = (float)atan2(-mat[2][1], mat[1][1]);
eul1[1] = (float)atan2(-mat[0][2], cy);
eul1[2] = 0.0f;
-
+
copy_v3_v3(eul2, eul1);
}
}
/* XYZ order */
-void mat3_to_eul(float *eul,float tmat[][3])
+void mat3_to_eul(float *eul, float tmat[][3])
{
float eul1[3], eul2[3];
-
+
mat3_to_eul2(tmat, eul1, eul2);
-
+
/* return best, which is just the one with lowest values it in */
- if(fabs(eul1[0])+fabs(eul1[1])+fabs(eul1[2]) > fabs(eul2[0])+fabs(eul2[1])+fabs(eul2[2])) {
+ if (fabs(eul1[0]) + fabs(eul1[1]) + fabs(eul1[2]) > fabs(eul2[0]) + fabs(eul2[1]) + fabs(eul2[2])) {
copy_v3_v3(eul, eul2);
}
else {
@@ -986,13 +991,13 @@ void mat3_to_eul(float *eul,float tmat[][3])
}
/* XYZ order */
-void mat4_to_eul(float *eul,float tmat[][4])
+void mat4_to_eul(float *eul, float tmat[][4])
{
float tempMat[3][3];
copy_m3_m4(tempMat, tmat);
normalize_m3(tempMat);
- mat3_to_eul(eul,tempMat);
+ mat3_to_eul(eul, tempMat);
}
/* XYZ order */
@@ -1000,24 +1005,33 @@ void quat_to_eul(float *eul, const float quat[4])
{
float mat[3][3];
- quat_to_mat3(mat,quat);
- mat3_to_eul(eul,mat);
+ quat_to_mat3(mat, quat);
+ mat3_to_eul(eul, mat);
}
/* XYZ order */
void eul_to_quat(float *quat, const float eul[3])
{
float ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
-
- ti = eul[0]*0.5f; tj = eul[1]*0.5f; th = eul[2]*0.5f;
- ci = (float)cos(ti); cj = (float)cos(tj); ch = (float)cos(th);
- si = (float)sin(ti); sj = (float)sin(tj); sh = (float)sin(th);
- cc = ci*ch; cs = ci*sh; sc = si*ch; ss = si*sh;
-
- quat[0] = cj*cc + sj*ss;
- quat[1] = cj*sc - sj*cs;
- quat[2] = cj*ss + sj*cc;
- quat[3] = cj*cs - sj*sc;
+
+ ti = eul[0] * 0.5f;
+ tj = eul[1] * 0.5f;
+ th = eul[2] * 0.5f;
+ ci = cosf(ti);
+ cj = cosf(tj);
+ ch = cosf(th);
+ si = sinf(ti);
+ sj = sinf(tj);
+ sh = sinf(th);
+ cc = ci * ch;
+ cs = ci * sh;
+ sc = si * ch;
+ ss = si * sh;
+
+ quat[0] = cj * cc + sj * ss;
+ quat[1] = cj * sc - sj * cs;
+ quat[2] = cj * ss + sj * cc;
+ quat[3] = cj * cs - sj * sc;
}
/* XYZ order */
@@ -1027,130 +1041,147 @@ void rotate_eul(float *beul, const char axis, const float ang)
assert(axis >= 'X' && axis <= 'Z');
- eul[0]= eul[1]= eul[2]= 0.0f;
- if(axis=='X') eul[0]= ang;
- else if(axis=='Y') eul[1]= ang;
- else eul[2]= ang;
-
- eul_to_mat3(mat1,eul);
- eul_to_mat3(mat2,beul);
-
+ eul[0] = eul[1] = eul[2] = 0.0f;
+ if (axis == 'X') eul[0] = ang;
+ else if (axis == 'Y') eul[1] = ang;
+ else eul[2] = ang;
+
+ eul_to_mat3(mat1, eul);
+ eul_to_mat3(mat2, beul);
+
mul_m3_m3m3(totmat, mat2, mat1);
-
- mat3_to_eul(beul,totmat);
-
+
+ mat3_to_eul(beul, totmat);
+
}
/* exported to transform.c */
+
/* order independent! */
void compatible_eul(float eul[3], const float oldrot[3])
{
float dx, dy, dz;
-
+
/* correct differences of about 360 degrees first */
- dx= eul[0] - oldrot[0];
- dy= eul[1] - oldrot[1];
- dz= eul[2] - oldrot[2];
-
- while(fabs(dx) > 5.1) {
- if(dx > 0.0f) eul[0] -= 2.0f*(float)M_PI; else eul[0]+= 2.0f*(float)M_PI;
- dx= eul[0] - oldrot[0];
+ dx = eul[0] - oldrot[0];
+ dy = eul[1] - oldrot[1];
+ dz = eul[2] - oldrot[2];
+
+ while (fabs(dx) > 5.1) {
+ if (dx > 0.0f) eul[0] -= 2.0f * (float)M_PI;
+ else eul[0] += 2.0f * (float)M_PI;
+ dx = eul[0] - oldrot[0];
}
- while(fabs(dy) > 5.1) {
- if(dy > 0.0f) eul[1] -= 2.0f*(float)M_PI; else eul[1]+= 2.0f*(float)M_PI;
- dy= eul[1] - oldrot[1];
+ while (fabs(dy) > 5.1) {
+ if (dy > 0.0f) eul[1] -= 2.0f * (float)M_PI;
+ else eul[1] += 2.0f * (float)M_PI;
+ dy = eul[1] - oldrot[1];
}
- while(fabs(dz) > 5.1) {
- if(dz > 0.0f) eul[2] -= 2.0f*(float)M_PI; else eul[2]+= 2.0f*(float)M_PI;
- dz= eul[2] - oldrot[2];
+ while (fabs(dz) > 5.1) {
+ if (dz > 0.0f) eul[2] -= 2.0f * (float)M_PI;
+ else eul[2] += 2.0f * (float)M_PI;
+ dz = eul[2] - oldrot[2];
}
-
- /* is 1 of the axis rotations larger than 180 degrees and the other small? NO ELSE IF!! */
- if(fabs(dx) > 3.2 && fabs(dy)<1.6 && fabs(dz)<1.6) {
- if(dx > 0.0f) eul[0] -= 2.0f*(float)M_PI; else eul[0]+= 2.0f*(float)M_PI;
+
+ /* is 1 of the axis rotations larger than 180 degrees and the other small? NO ELSE IF!! */
+ if (fabs(dx) > 3.2 && fabs(dy) < 1.6 && fabs(dz) < 1.6) {
+ if (dx > 0.0f) eul[0] -= 2.0f * (float)M_PI;
+ else eul[0] += 2.0f * (float)M_PI;
}
- if(fabs(dy) > 3.2 && fabs(dz)<1.6 && fabs(dx)<1.6) {
- if(dy > 0.0f) eul[1] -= 2.0f*(float)M_PI; else eul[1]+= 2.0f*(float)M_PI;
+ if (fabs(dy) > 3.2 && fabs(dz) < 1.6 && fabs(dx) < 1.6) {
+ if (dy > 0.0f) eul[1] -= 2.0f * (float)M_PI;
+ else eul[1] += 2.0f * (float)M_PI;
}
- if(fabs(dz) > 3.2 && fabs(dx)<1.6 && fabs(dy)<1.6) {
- if(dz > 0.0f) eul[2] -= 2.0f*(float)M_PI; else eul[2]+= 2.0f*(float)M_PI;
+ if (fabs(dz) > 3.2 && fabs(dx) < 1.6 && fabs(dy) < 1.6) {
+ if (dz > 0.0f) eul[2] -= 2.0f * (float)M_PI;
+ else eul[2] += 2.0f * (float)M_PI;
}
-
+
/* the method below was there from ancient days... but why! probably because the code sucks :)
- */
-#if 0
+ */
+#if 0
/* calc again */
- dx= eul[0] - oldrot[0];
- dy= eul[1] - oldrot[1];
- dz= eul[2] - oldrot[2];
-
+ dx = eul[0] - oldrot[0];
+ dy = eul[1] - oldrot[1];
+ dz = eul[2] - oldrot[2];
+
/* special case, tested for x-z */
-
- if((fabs(dx) > 3.1 && fabs(dz) > 1.5) || (fabs(dx) > 1.5 && fabs(dz) > 3.1)) {
- if(dx > 0.0) eul[0] -= M_PI; else eul[0]+= M_PI;
- if(eul[1] > 0.0) eul[1]= M_PI - eul[1]; else eul[1]= -M_PI - eul[1];
- if(dz > 0.0) eul[2] -= M_PI; else eul[2]+= M_PI;
-
+
+ if ((fabs(dx) > 3.1 && fabs(dz) > 1.5) || (fabs(dx) > 1.5 && fabs(dz) > 3.1)) {
+ if (dx > 0.0) eul[0] -= M_PI;
+ else eul[0] += M_PI;
+ if (eul[1] > 0.0) eul[1] = M_PI - eul[1];
+ else eul[1] = -M_PI - eul[1];
+ if (dz > 0.0) eul[2] -= M_PI;
+ else eul[2] += M_PI;
+
}
- else if((fabs(dx) > 3.1 && fabs(dy) > 1.5) || (fabs(dx) > 1.5 && fabs(dy) > 3.1)) {
- if(dx > 0.0) eul[0] -= M_PI; else eul[0]+= M_PI;
- if(dy > 0.0) eul[1] -= M_PI; else eul[1]+= M_PI;
- if(eul[2] > 0.0) eul[2]= M_PI - eul[2]; else eul[2]= -M_PI - eul[2];
+ else if ((fabs(dx) > 3.1 && fabs(dy) > 1.5) || (fabs(dx) > 1.5 && fabs(dy) > 3.1)) {
+ if (dx > 0.0) eul[0] -= M_PI;
+ else eul[0] += M_PI;
+ if (dy > 0.0) eul[1] -= M_PI;
+ else eul[1] += M_PI;
+ if (eul[2] > 0.0) eul[2] = M_PI - eul[2];
+ else eul[2] = -M_PI - eul[2];
}
- else if((fabs(dy) > 3.1 && fabs(dz) > 1.5) || (fabs(dy) > 1.5 && fabs(dz) > 3.1)) {
- if(eul[0] > 0.0) eul[0]= M_PI - eul[0]; else eul[0]= -M_PI - eul[0];
- if(dy > 0.0) eul[1] -= M_PI; else eul[1]+= M_PI;
- if(dz > 0.0) eul[2] -= M_PI; else eul[2]+= M_PI;
+ else if ((fabs(dy) > 3.1 && fabs(dz) > 1.5) || (fabs(dy) > 1.5 && fabs(dz) > 3.1)) {
+ if (eul[0] > 0.0) eul[0] = M_PI - eul[0];
+ else eul[0] = -M_PI - eul[0];
+ if (dy > 0.0) eul[1] -= M_PI;
+ else eul[1] += M_PI;
+ if (dz > 0.0) eul[2] -= M_PI;
+ else eul[2] += M_PI;
}
-#endif
+#endif
}
/* uses 2 methods to retrieve eulers, and picks the closest */
+
/* XYZ order */
void mat3_to_compatible_eul(float eul[3], const float oldrot[3], float mat[][3])
{
float eul1[3], eul2[3];
float d1, d2;
-
+
mat3_to_eul2(mat, eul1, eul2);
-
+
compatible_eul(eul1, oldrot);
compatible_eul(eul2, oldrot);
-
- d1= (float)fabs(eul1[0]-oldrot[0]) + (float)fabs(eul1[1]-oldrot[1]) + (float)fabs(eul1[2]-oldrot[2]);
- d2= (float)fabs(eul2[0]-oldrot[0]) + (float)fabs(eul2[1]-oldrot[1]) + (float)fabs(eul2[2]-oldrot[2]);
-
+
+ d1 = (float)fabs(eul1[0] - oldrot[0]) + (float)fabs(eul1[1] - oldrot[1]) + (float)fabs(eul1[2] - oldrot[2]);
+ d2 = (float)fabs(eul2[0] - oldrot[0]) + (float)fabs(eul2[1] - oldrot[1]) + (float)fabs(eul2[2] - oldrot[2]);
+
/* return best, which is just the one with lowest difference */
- if(d1 > d2) {
+ if (d1 > d2) {
copy_v3_v3(eul, eul2);
}
else {
copy_v3_v3(eul, eul1);
}
-
+
}
/************************** Arbitrary Order Eulers ***************************/
/* 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
+ * 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
* for use in Blender
*/
/* Type for rotation order info - see wiki for derivation details */
typedef struct RotOrderInfo {
short axis[3];
- short parity; /* parity of axis permutation (even=0, odd=1) - 'n' in original code */
+ short parity; /* parity of axis permutation (even=0, odd=1) - 'n' in original code */
} RotOrderInfo;
-/* Array of info for Rotation Order calculations
+/* Array of info for Rotation Order calculations
* WARNING: must be kept in same order as eEulerRotationOrders
*/
-static RotOrderInfo rotOrders[]= {
+static RotOrderInfo rotOrders[] = {
/* i, j, k, n */
{{0, 1, 2}, 0}, // XYZ
{{0, 2, 1}, 1}, // XZY
@@ -1160,114 +1191,136 @@ static RotOrderInfo rotOrders[]= {
{{2, 1, 0}, 1} // ZYX
};
-/* Get relevant pointer to rotation order set from the array
- * NOTE: since we start at 1 for the values, but arrays index from 0,
+/* Get relevant pointer to rotation order set from the array
+ * NOTE: since we start at 1 for the values, but arrays index from 0,
* there is -1 factor involved in this process...
*/
-#define GET_ROTATIONORDER_INFO(order) (assert(order>=0 && order<=6), (order < 1) ? &rotOrders[0] : &rotOrders[(order)-1])
+#define GET_ROTATIONORDER_INFO(order) (assert(order >= 0 && order <= 6), (order < 1) ? &rotOrders[0] : &rotOrders[(order) - 1])
/* Construct quaternion from Euler angles (in radians). */
void eulO_to_quat(float q[4], const float e[3], const short order)
{
- RotOrderInfo *R= GET_ROTATIONORDER_INFO(order);
- short i=R->axis[0], j=R->axis[1], k=R->axis[2];
+ RotOrderInfo *R = GET_ROTATIONORDER_INFO(order);
+ short i = R->axis[0], j = R->axis[1], k = R->axis[2];
double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
double a[3];
-
+
ti = e[i] * 0.5f;
tj = e[j] * (R->parity ? -0.5f : 0.5f);
th = e[k] * 0.5f;
- ci = cos(ti); cj = cos(tj); ch = cos(th);
- si = sin(ti); sj = sin(tj); sh = sin(th);
-
- cc = ci*ch; cs = ci*sh;
- sc = si*ch; ss = si*sh;
-
- a[i] = cj*sc - sj*cs;
- a[j] = cj*ss + sj*cc;
- a[k] = cj*cs - sj*sc;
-
- q[0] = cj*cc + sj*ss;
+ ci = cos(ti);
+ cj = cos(tj);
+ ch = cos(th);
+ si = sin(ti);
+ sj = sin(tj);
+ sh = sin(th);
+
+ cc = ci * ch;
+ cs = ci * sh;
+ sc = si * ch;
+ ss = si * sh;
+
+ a[i] = cj * sc - sj * cs;
+ a[j] = cj * ss + sj * cc;
+ a[k] = cj * cs - sj * sc;
+
+ q[0] = cj * cc + sj * ss;
q[1] = a[0];
q[2] = a[1];
q[3] = a[2];
-
- if (R->parity) q[j+1] = -q[j+1];
+
+ if (R->parity) q[j + 1] = -q[j + 1];
}
/* Convert quaternion to Euler angles (in radians). */
void quat_to_eulO(float e[3], short const order, const float q[4])
{
float M[3][3];
-
- quat_to_mat3(M,q);
- mat3_to_eulO(e, order,M);
+
+ quat_to_mat3(M, q);
+ mat3_to_eulO(e, order, M);
}
/* Construct 3x3 matrix from Euler angles (in radians). */
void eulO_to_mat3(float M[3][3], const float e[3], const short order)
{
- RotOrderInfo *R= GET_ROTATIONORDER_INFO(order);
- short i=R->axis[0], j=R->axis[1], k=R->axis[2];
+ RotOrderInfo *R = GET_ROTATIONORDER_INFO(order);
+ short i = R->axis[0], j = R->axis[1], k = R->axis[2];
double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
-
+
if (R->parity) {
- ti = -e[i]; tj = -e[j]; th = -e[k];
+ ti = -e[i];
+ tj = -e[j];
+ th = -e[k];
}
else {
- ti = e[i]; tj = e[j]; th = e[k];
+ ti = e[i];
+ tj = e[j];
+ th = e[k];
}
-
- ci = cos(ti); cj = cos(tj); ch = cos(th);
- si = sin(ti); sj = sin(tj); sh = sin(th);
-
- cc = ci*ch; cs = ci*sh;
- sc = si*ch; ss = si*sh;
-
- M[i][i] = cj*ch; M[j][i] = sj*sc-cs; M[k][i] = sj*cc+ss;
- M[i][j] = cj*sh; M[j][j] = sj*ss+cc; M[k][j] = sj*cs-sc;
- M[i][k] = -sj; M[j][k] = cj*si; M[k][k] = cj*ci;
+
+ ci = cos(ti);
+ cj = cos(tj);
+ ch = cos(th);
+ si = sin(ti);
+ sj = sin(tj);
+ sh = sin(th);
+
+ cc = ci * ch;
+ cs = ci * sh;
+ sc = si * ch;
+ ss = si * sh;
+
+ M[i][i] = cj * ch;
+ M[j][i] = sj * sc - cs;
+ M[k][i] = sj * cc + ss;
+ M[i][j] = cj * sh;
+ M[j][j] = sj * ss + cc;
+ M[k][j] = sj * cs - sc;
+ M[i][k] = -sj;
+ M[j][k] = cj * si;
+ M[k][k] = cj * ci;
}
/* returns two euler calculation methods, so we can pick the best */
static void mat3_to_eulo2(float M[3][3], float *e1, float *e2, short order)
{
- RotOrderInfo *R= GET_ROTATIONORDER_INFO(order);
- short i=R->axis[0], j=R->axis[1], k=R->axis[2];
+ RotOrderInfo *R = GET_ROTATIONORDER_INFO(order);
+ short i = R->axis[0], j = R->axis[1], k = R->axis[2];
float m[3][3];
double cy;
-
+
/* process the matrix first */
copy_m3_m3(m, M);
normalize_m3(m);
-
- cy= sqrt(m[i][i]*m[i][i] + m[i][j]*m[i][j]);
-
- if (cy > 16.0*(double)FLT_EPSILON) {
+
+ cy = sqrt(m[i][i] * m[i][i] + m[i][j] * m[i][j]);
+
+ if (cy > 16.0 * (double)FLT_EPSILON) {
e1[i] = atan2(m[j][k], m[k][k]);
e1[j] = atan2(-m[i][k], cy);
e1[k] = atan2(m[i][j], m[i][i]);
-
+
e2[i] = atan2(-m[j][k], -m[k][k]);
e2[j] = atan2(-m[i][k], -cy);
e2[k] = atan2(-m[i][j], -m[i][i]);
- }
+ }
else {
e1[i] = atan2(-m[k][j], m[j][j]);
e1[j] = atan2(-m[i][k], cy);
e1[k] = 0;
-
+
copy_v3_v3(e2, e1);
}
-
+
if (R->parity) {
- e1[0] = -e1[0];
- e1[1] = -e1[1];
+ e1[0] = -e1[0];
+ e1[1] = -e1[1];
e1[2] = -e1[2];
-
- e2[0] = -e2[0];
- e2[1] = -e2[1];
+
+ e2[0] = -e2[0];
+ e2[1] = -e2[1];
e2[2] = -e2[2];
}
}
@@ -1276,23 +1329,22 @@ static void mat3_to_eulo2(float M[3][3], float *e1, float *e2, short order)
void eulO_to_mat4(float M[4][4], const float e[3], const short order)
{
float m[3][3];
-
+
/* for now, we'll just do this the slow way (i.e. copying matrices) */
normalize_m3(m);
- eulO_to_mat3(m,e, order);
+ eulO_to_mat3(m, e, order);
copy_m4_m3(M, m);
}
-
/* Convert 3x3 matrix to Euler angles (in radians). */
-void mat3_to_eulO(float eul[3], const short order,float M[3][3])
+void mat3_to_eulO(float eul[3], const short order, float M[3][3])
{
float eul1[3], eul2[3];
-
+
mat3_to_eulo2(M, eul1, eul2, order);
-
+
/* return best, which is just the one with lowest values it in */
- if(fabs(eul1[0])+fabs(eul1[1])+fabs(eul1[2]) > fabs(eul2[0])+fabs(eul2[1])+fabs(eul2[2])) {
+ if (fabs(eul1[0]) + fabs(eul1[1]) + fabs(eul1[2]) > fabs(eul2[0]) + fabs(eul2[1]) + fabs(eul2[2])) {
copy_v3_v3(eul, eul2);
}
else {
@@ -1301,30 +1353,30 @@ void mat3_to_eulO(float eul[3], const short order,float M[3][3])
}
/* Convert 4x4 matrix to Euler angles (in radians). */
-void mat4_to_eulO(float e[3], const short order,float M[4][4])
+void mat4_to_eulO(float e[3], const short order, float M[4][4])
{
float m[3][3];
-
+
/* for now, we'll just do this the slow way (i.e. copying matrices) */
copy_m3_m4(m, M);
normalize_m3(m);
- mat3_to_eulO(e, order,m);
+ mat3_to_eulO(e, order, m);
}
/* uses 2 methods to retrieve eulers, and picks the closest */
-void mat3_to_compatible_eulO(float eul[3], float oldrot[3], short order,float mat[3][3])
+void mat3_to_compatible_eulO(float eul[3], float oldrot[3], short order, float mat[3][3])
{
float eul1[3], eul2[3];
float d1, d2;
-
+
mat3_to_eulo2(mat, eul1, eul2, order);
-
+
compatible_eul(eul1, oldrot);
compatible_eul(eul2, oldrot);
-
- d1= fabsf(eul1[0]-oldrot[0]) + fabsf(eul1[1]-oldrot[1]) + fabsf(eul1[2]-oldrot[2]);
- d2= fabsf(eul2[0]-oldrot[0]) + fabsf(eul2[1]-oldrot[1]) + fabsf(eul2[2]-oldrot[2]);
-
+
+ d1 = fabsf(eul1[0] - oldrot[0]) + fabsf(eul1[1] - oldrot[1]) + fabsf(eul1[2] - oldrot[2]);
+ d2 = fabsf(eul2[0] - oldrot[0]) + fabsf(eul2[1] - oldrot[1]) + fabsf(eul2[2] - oldrot[2]);
+
/* return best, which is just the one with lowest difference */
if (d1 > d2)
copy_v3_v3(eul, eul2);
@@ -1332,10 +1384,10 @@ void mat3_to_compatible_eulO(float eul[3], float oldrot[3], short order,float ma
copy_v3_v3(eul, eul1);
}
-void mat4_to_compatible_eulO(float eul[3], float oldrot[3], short order,float M[4][4])
+void mat4_to_compatible_eulO(float eul[3], float oldrot[3], short order, float M[4][4])
{
float m[3][3];
-
+
/* for now, we'll just do this the slow way (i.e. copying matrices) */
copy_m3_m4(m, M);
normalize_m3(m);
@@ -1343,47 +1395,48 @@ void mat4_to_compatible_eulO(float eul[3], float oldrot[3], short order,float M[
}
/* rotate the given euler by the given angle on the specified axis */
// NOTE: is this safe to do with different axis orders?
+
void rotate_eulO(float beul[3], short order, char axis, float ang)
{
float eul[3], mat1[3][3], mat2[3][3], totmat[3][3];
assert(axis >= 'X' && axis <= 'Z');
- eul[0]= eul[1]= eul[2]= 0.0f;
- if (axis=='X')
- eul[0]= ang;
- else if (axis=='Y')
- eul[1]= ang;
- else
- eul[2]= ang;
-
- eulO_to_mat3(mat1,eul, order);
- eulO_to_mat3(mat2,beul, order);
-
+ eul[0] = eul[1] = eul[2] = 0.0f;
+ if (axis == 'X')
+ eul[0] = ang;
+ else if (axis == 'Y')
+ eul[1] = ang;
+ else
+ eul[2] = ang;
+
+ eulO_to_mat3(mat1, eul, order);
+ eulO_to_mat3(mat2, beul, order);
+
mul_m3_m3m3(totmat, mat2, mat1);
-
- mat3_to_eulO(beul, order,totmat);
+
+ mat3_to_eulO(beul, order, totmat);
}
/* the matrix is written to as 3 axis vectors */
void eulO_to_gimbal_axis(float gmat[][3], const float eul[3], const short order)
{
- RotOrderInfo *R= GET_ROTATIONORDER_INFO(order);
+ RotOrderInfo *R = GET_ROTATIONORDER_INFO(order);
float mat[3][3];
float teul[3];
/* first axis is local */
- eulO_to_mat3(mat,eul, order);
+ eulO_to_mat3(mat, eul, order);
copy_v3_v3(gmat[R->axis[0]], mat[R->axis[0]]);
-
+
/* second axis is local minus first rotation */
copy_v3_v3(teul, eul);
teul[R->axis[0]] = 0;
- eulO_to_mat3(mat,teul, order);
+ eulO_to_mat3(mat, teul, order);
copy_v3_v3(gmat[R->axis[1]], mat[R->axis[1]]);
-
-
+
+
/* Last axis is global */
gmat[R->axis[2]][0] = 0;
gmat[R->axis[2]][1] = 0;
@@ -1393,57 +1446,59 @@ 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])
+void mat4_to_dquat(DualQuat *dq, float basemat[][4], float mat[][4])
{
float *t, *q, dscale[3], scale[3], basequat[4];
float baseRS[4][4], baseinv[4][4], baseR[4][4], baseRinv[4][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);
+ mat4_to_size(scale, baseRS);
copy_v3_v3(dscale, scale);
- dscale[0] -= 1.0f; dscale[1] -= 1.0f; dscale[2] -= 1.0f;
+ dscale[0] -= 1.0f;
+ dscale[1] -= 1.0f;
+ dscale[2] -= 1.0f;
- if((determinant_m4(mat) < 0.0f) || len_v3(dscale) > 1e-4f) {
+ if ((determinant_m4(mat) < 0.0f) || len_v3(dscale) > 1e-4f) {
/* extract R and S */
float tmp[4][4];
- /* extra orthogonalize, to avoid flipping with stretched bones */
+ /* extra orthogonalize, to avoid flipping with stretched bones */
copy_m4_m4(tmp, baseRS);
orthogonalize_m4(tmp, 1);
mat4_to_quat(basequat, tmp);
@@ -1459,78 +1514,78 @@ void mat4_to_dquat(DualQuat *dq,float basemat[][4], float mat[][4])
/* set scaling part */
mul_serie_m4(dq->scale, basemat, S, baseinv, NULL, NULL, NULL, NULL, NULL);
- dq->scale_weight= 1.0f;
+ dq->scale_weight = 1.0f;
}
else {
/* matrix does not contain scaling */
copy_m4_m4(R, mat);
- dq->scale_weight= 0.0f;
+ dq->scale_weight = 0.0f;
}
/* non-dual part */
- mat4_to_quat(dq->quat,R);
+ mat4_to_quat(dq->quat, R);
/* dual part */
- t= R[3];
- q= dq->quat;
- dq->trans[0]= -0.5f*(t[0]*q[1] + t[1]*q[2] + t[2]*q[3]);
- dq->trans[1]= 0.5f*(t[0]*q[0] + t[1]*q[3] - t[2]*q[2]);
- dq->trans[2]= 0.5f*(-t[0]*q[3] + t[1]*q[0] + t[2]*q[1]);
- dq->trans[3]= 0.5f*(t[0]*q[2] - t[1]*q[1] + t[2]*q[0]);
+ t = R[3];
+ q = dq->quat;
+ dq->trans[0] = -0.5f * (t[0] * q[1] + t[1] * q[2] + t[2] * q[3]);
+ dq->trans[1] = 0.5f * (t[0] * q[0] + t[1] * q[3] - t[2] * q[2]);
+ dq->trans[2] = 0.5f * (-t[0] * q[3] + t[1] * q[0] + t[2] * q[1]);
+ dq->trans[3] = 0.5f * (t[0] * q[2] - t[1] * q[1] + t[2] * q[0]);
}
void dquat_to_mat4(float mat[][4], DualQuat *dq)
{
float len, *t, q0[4];
-
+
/* regular quaternion */
copy_qt_qt(q0, dq->quat);
/* normalize */
- len= (float)sqrt(dot_qtqt(q0, q0));
- if(len != 0.0f)
- mul_qt_fl(q0, 1.0f/len);
-
+ len = (float)sqrt(dot_qtqt(q0, q0));
+ if (len != 0.0f)
+ mul_qt_fl(q0, 1.0f / len);
+
/* rotation */
- quat_to_mat4(mat,q0);
+ quat_to_mat4(mat, q0);
/* translation */
- t= dq->trans;
- mat[3][0]= 2.0f*(-t[0]*q0[1] + t[1]*q0[0] - t[2]*q0[3] + t[3]*q0[2]);
- mat[3][1]= 2.0f*(-t[0]*q0[2] + t[1]*q0[3] + t[2]*q0[0] - t[3]*q0[1]);
- mat[3][2]= 2.0f*(-t[0]*q0[3] - t[1]*q0[2] + t[2]*q0[1] + t[3]*q0[0]);
+ t = dq->trans;
+ mat[3][0] = 2.0f * (-t[0] * q0[1] + t[1] * q0[0] - t[2] * q0[3] + t[3] * q0[2]);
+ mat[3][1] = 2.0f * (-t[0] * q0[2] + t[1] * q0[3] + t[2] * q0[0] - t[3] * q0[1]);
+ mat[3][2] = 2.0f * (-t[0] * q0[3] - t[1] * q0[2] + t[2] * q0[1] + t[3] * q0[0]);
/* note: this does not handle scaling */
-}
+}
void add_weighted_dq_dq(DualQuat *dqsum, DualQuat *dq, float weight)
{
- int flipped= 0;
+ int flipped = 0;
/* make sure we interpolate quats in the right direction */
if (dot_qtqt(dq->quat, dqsum->quat) < 0) {
- flipped= 1;
- weight= -weight;
+ flipped = 1;
+ weight = -weight;
}
/* interpolate rotation and translation */
- dqsum->quat[0] += weight*dq->quat[0];
- dqsum->quat[1] += weight*dq->quat[1];
- dqsum->quat[2] += weight*dq->quat[2];
- dqsum->quat[3] += weight*dq->quat[3];
+ dqsum->quat[0] += weight * dq->quat[0];
+ dqsum->quat[1] += weight * dq->quat[1];
+ dqsum->quat[2] += weight * dq->quat[2];
+ dqsum->quat[3] += weight * dq->quat[3];
- dqsum->trans[0] += weight*dq->trans[0];
- dqsum->trans[1] += weight*dq->trans[1];
- dqsum->trans[2] += weight*dq->trans[2];
- dqsum->trans[3] += weight*dq->trans[3];
+ dqsum->trans[0] += weight * dq->trans[0];
+ dqsum->trans[1] += weight * dq->trans[1];
+ dqsum->trans[2] += weight * dq->trans[2];
+ dqsum->trans[3] += weight * dq->trans[3];
/* interpolate scale - but only if needed */
if (dq->scale_weight) {
float wmat[4][4];
-
- if(flipped) /* we don't want negative weights for scaling */
- weight= -weight;
-
+
+ if (flipped) /* we don't want negative weights for scaling */
+ weight = -weight;
+
copy_m4_m4(wmat, dq->scale);
mul_m4_fl(wmat, weight);
add_m4_m4m4(dqsum->scale, dqsum->scale, wmat);
@@ -1540,15 +1595,15 @@ void add_weighted_dq_dq(DualQuat *dqsum, DualQuat *dq, float weight)
void normalize_dq(DualQuat *dq, float totweight)
{
- float scale= 1.0f/totweight;
+ float scale = 1.0f / totweight;
mul_qt_fl(dq->quat, scale);
mul_qt_fl(dq->trans, scale);
-
- if(dq->scale_weight) {
- float addweight= totweight - dq->scale_weight;
-
- if(addweight) {
+
+ if (dq->scale_weight) {
+ float addweight = totweight - dq->scale_weight;
+
+ if (addweight) {
dq->scale[0][0] += addweight;
dq->scale[1][1] += addweight;
dq->scale[2][2] += addweight;
@@ -1556,51 +1611,51 @@ void normalize_dq(DualQuat *dq, float totweight)
}
mul_m4_fl(dq->scale, scale);
- dq->scale_weight= 1.0f;
+ dq->scale_weight = 1.0f;
}
}
-void mul_v3m3_dq(float *co, float mat[][3],DualQuat *dq)
-{
+void mul_v3m3_dq(float *co, float mat[][3], DualQuat *dq)
+{
float M[3][3], t[3], scalemat[3][3], len2;
- float w= dq->quat[0], x= dq->quat[1], y= dq->quat[2], z= dq->quat[3];
- float t0= dq->trans[0], t1= dq->trans[1], t2= dq->trans[2], t3= dq->trans[3];
-
+ float w = dq->quat[0], x = dq->quat[1], y = dq->quat[2], z = dq->quat[3];
+ float t0 = dq->trans[0], t1 = dq->trans[1], t2 = dq->trans[2], t3 = dq->trans[3];
+
/* rotation matrix */
- M[0][0]= w*w + x*x - y*y - z*z;
- M[1][0]= 2*(x*y - w*z);
- M[2][0]= 2*(x*z + w*y);
-
- M[0][1]= 2*(x*y + w*z);
- M[1][1]= w*w + y*y - x*x - z*z;
- M[2][1]= 2*(y*z - w*x);
-
- M[0][2]= 2*(x*z - w*y);
- M[1][2]= 2*(y*z + w*x);
- M[2][2]= w*w + z*z - x*x - y*y;
-
- len2= dot_qtqt(dq->quat, dq->quat);
- if(len2 > 0.0f)
- len2= 1.0f/len2;
-
+ M[0][0] = w * w + x * x - y * y - z * z;
+ M[1][0] = 2 * (x * y - w * z);
+ M[2][0] = 2 * (x * z + w * y);
+
+ M[0][1] = 2 * (x * y + w * z);
+ M[1][1] = w * w + y * y - x * x - z * z;
+ M[2][1] = 2 * (y * z - w * x);
+
+ M[0][2] = 2 * (x * z - w * y);
+ M[1][2] = 2 * (y * z + w * x);
+ M[2][2] = w * w + z * z - x * x - y * y;
+
+ len2 = dot_qtqt(dq->quat, dq->quat);
+ if (len2 > 0.0f)
+ len2 = 1.0f / len2;
+
/* translation */
- t[0]= 2*(-t0*x + w*t1 - t2*z + y*t3);
- t[1]= 2*(-t0*y + t1*z - x*t3 + w*t2);
- t[2]= 2*(-t0*z + x*t2 + w*t3 - t1*y);
+ t[0] = 2 * (-t0 * x + w * t1 - t2 * z + y * t3);
+ t[1] = 2 * (-t0 * y + t1 * z - x * t3 + w * t2);
+ t[2] = 2 * (-t0 * z + x * t2 + w * t3 - t1 * y);
/* apply scaling */
- if(dq->scale_weight)
+ if (dq->scale_weight)
mul_m4_v3(dq->scale, co);
-
+
/* apply rotation and translation */
mul_m3_v3(M, co);
- co[0]= (co[0] + t[0])*len2;
- co[1]= (co[1] + t[1])*len2;
- co[2]= (co[2] + t[2])*len2;
+ co[0] = (co[0] + t[0]) * len2;
+ co[1] = (co[1] + t[1]) * len2;
+ co[2] = (co[2] + t[2]) * len2;
/* compute crazyspace correction mat */
- if(mat) {
- if(dq->scale_weight) {
+ if (mat) {
+ if (dq->scale_weight) {
copy_m3_m4(scalemat, dq->scale);
mul_m3_m3m3(mat, M, scalemat);
}
@@ -1617,85 +1672,85 @@ void copy_dq_dq(DualQuat *dq1, DualQuat *dq2)
/* axis matches eTrackToAxis_Modes */
void quat_apply_track(float quat[4], short axis, short upflag)
-{
+{
/* rotations are hard coded to match vec_to_quat */
- const float quat_track[][4]= {{0.70710676908493, 0.0, -0.70710676908493, 0.0}, /* pos-y90 */
- {0.5, 0.5, 0.5, 0.5}, /* Quaternion((1,0,0), radians(90)) * Quaternion((0,1,0), radians(90)) */
- {0.70710676908493, 0.0, 0.0, 0.70710676908493}, /* pos-z90 */
- {0.70710676908493, 0.0, 0.70710676908493, 0.0}, /* neg-y90 */
- {0.5, -0.5, -0.5, 0.5}, /* Quaternion((1,0,0), radians(-90)) * Quaternion((0,1,0), radians(-90)) */
- {-3.0908619663705394e-08, 0.70710676908493, 0.70710676908493, 3.0908619663705394e-08}}; /* no rotation */
+ const float quat_track[][4] = {
+ {0.70710676908493, 0.0, -0.70710676908493, 0.0}, /* pos-y90 */
+ {0.5, 0.5, 0.5, 0.5}, /* Quaternion((1,0,0), radians(90)) * Quaternion((0,1,0), radians(90)) */
+ {0.70710676908493, 0.0, 0.0, 0.70710676908493}, /* pos-z90 */
+ {0.70710676908493, 0.0, 0.70710676908493, 0.0}, /* neg-y90 */
+ {0.5, -0.5, -0.5, 0.5}, /* Quaternion((1,0,0), radians(-90)) * Quaternion((0,1,0), radians(-90)) */
+ {-3.0908619663705394e-08, 0.70710676908493, 0.70710676908493, 3.0908619663705394e-08}}; /* no rotation */
assert(axis >= 0 && axis <= 5);
assert(upflag >= 0 && upflag <= 2);
-
+
mul_qt_qtqt(quat, quat, quat_track[axis]);
- if(axis>2)
- axis= axis-3;
+ if (axis > 2)
+ axis = axis - 3;
/* there are 2 possible up-axis for each axis used, the 'quat_track' applies so the first
* up axis is used X->Y, Y->X, Z->X, if this first up axis isn used then rotate 90d
* the strange bit shift below just find the low axis {X:Y, Y:X, Z:X} */
- if(upflag != (2-axis)>>1) {
- float q[4]= {0.70710676908493, 0.0, 0.0, 0.0}; /* assign 90d rotation axis */
- q[axis+1] = ((axis==1)) ? 0.70710676908493 : -0.70710676908493; /* flip non Y axis */
+ if (upflag != (2 - axis) >> 1) {
+ float q[4] = {0.70710676908493, 0.0, 0.0, 0.0}; /* assign 90d rotation axis */
+ q[axis + 1] = ((axis == 1)) ? 0.70710676908493 : -0.70710676908493; /* flip non Y axis */
mul_qt_qtqt(quat, quat, q);
}
}
-
void vec_apply_track(float vec[3], short axis)
{
float tvec[3];
assert(axis >= 0 && axis <= 5);
-
+
copy_v3_v3(tvec, vec);
- switch(axis) {
- case 0: /* pos-x */
- /* vec[0]= 0.0; */
- vec[1]= tvec[2];
- vec[2]= -tvec[1];
- break;
- case 1: /* pos-y */
- /* vec[0]= tvec[0]; */
- /* vec[1]= 0.0; */
- /* vec[2]= tvec[2]; */
- break;
- case 2: /* pos-z */
- /* vec[0]= tvec[0]; */
- /* vec[1]= tvec[1]; */
- // vec[2]= 0.0; */
- break;
- case 3: /* neg-x */
- /* vec[0]= 0.0; */
- vec[1]= tvec[2];
- vec[2]= -tvec[1];
- break;
- case 4: /* neg-y */
- vec[0]= -tvec[2];
- /* vec[1]= 0.0; */
- vec[2]= tvec[0];
- break;
- case 5: /* neg-z */
- vec[0]= -tvec[0];
- vec[1]= -tvec[1];
- /* vec[2]= 0.0; */
- break;
+ switch (axis) {
+ case 0: /* pos-x */
+ /* vec[0]= 0.0; */
+ vec[1] = tvec[2];
+ vec[2] = -tvec[1];
+ break;
+ case 1: /* pos-y */
+ /* vec[0]= tvec[0]; */
+ /* vec[1]= 0.0; */
+ /* vec[2]= tvec[2]; */
+ break;
+ case 2: /* pos-z */
+ /* vec[0]= tvec[0]; */
+ /* vec[1]= tvec[1]; */
+ // vec[2]= 0.0; */
+ break;
+ case 3: /* neg-x */
+ /* vec[0]= 0.0; */
+ vec[1] = tvec[2];
+ vec[2] = -tvec[1];
+ break;
+ case 4: /* neg-y */
+ vec[0] = -tvec[2];
+ /* vec[1]= 0.0; */
+ vec[2] = tvec[0];
+ break;
+ case 5: /* neg-z */
+ vec[0] = -tvec[0];
+ vec[1] = -tvec[1];
+ /* vec[2]= 0.0; */
+ break;
}
}
/* lens/angle conversion (radians) */
float focallength_to_fov(float focal_length, float sensor)
{
- return 2.0f * atanf((sensor/2.0f) / focal_length);
+ return 2.0f * atanf((sensor / 2.0f) / focal_length);
}
float fov_to_focallength(float hfov, float sensor)
{
- return (sensor/2.0f) / tanf(hfov * 0.5f);
+ return (sensor / 2.0f) / tanf(hfov * 0.5f);
}
/* 'mod_inline(-3,4)= 1', 'fmod(-3,4)= -3' */
@@ -1706,7 +1761,7 @@ static float mod_inline(float a, float b)
float angle_wrap_rad(float angle)
{
- return mod_inline(angle + (float)M_PI, (float)M_PI*2.0f) - (float)M_PI;
+ return mod_inline(angle + (float)M_PI, (float)M_PI * 2.0f) - (float)M_PI;
}
float angle_wrap_deg(float angle)
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index ce9896b99cc..65600a31042 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -17,7 +17,7 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
-
+ *
* The Original Code is: some of this file.
*
* ***** END GPL LICENSE BLOCK *****
@@ -35,78 +35,78 @@
void interp_v2_v2v2(float target[2], const float a[2], const float b[2], const float t)
{
- float s = 1.0f-t;
+ float s = 1.0f - t;
- target[0]= s*a[0] + t*b[0];
- target[1]= s*a[1] + t*b[1];
+ target[0] = s * a[0] + t * b[0];
+ target[1] = s * a[1] + t * b[1];
}
/* weight 3 2D vectors,
* 'w' must be unit length but is not a vector, just 3 weights */
void interp_v2_v2v2v2(float p[2], const float v1[2], const float v2[2], const float v3[2], const float w[3])
{
- p[0] = v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2];
- p[1] = v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2];
+ p[0] = v1[0] * w[0] + v2[0] * w[1] + v3[0] * w[2];
+ p[1] = v1[1] * w[0] + v2[1] * w[1] + v3[1] * w[2];
}
void interp_v3_v3v3(float target[3], const float a[3], const float b[3], const float t)
{
- float s = 1.0f-t;
+ float s = 1.0f - t;
- target[0]= s*a[0] + t*b[0];
- target[1]= s*a[1] + t*b[1];
- target[2]= s*a[2] + t*b[2];
+ target[0] = s * a[0] + t * b[0];
+ target[1] = s * a[1] + t * b[1];
+ target[2] = s * a[2] + t * b[2];
}
void interp_v4_v4v4(float target[4], const float a[4], const float b[4], const float t)
{
- float s = 1.0f-t;
+ float s = 1.0f - t;
- target[0]= s*a[0] + t*b[0];
- target[1]= s*a[1] + t*b[1];
- target[2]= s*a[2] + t*b[2];
- target[3]= s*a[3] + t*b[3];
+ target[0] = s * a[0] + t * b[0];
+ target[1] = s * a[1] + t * b[1];
+ target[2] = s * a[2] + t * b[2];
+ target[3] = s * a[3] + t * b[3];
}
/* weight 3 vectors,
* 'w' must be unit length but is not a vector, just 3 weights */
void interp_v3_v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3])
{
- p[0] = v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2];
- p[1] = v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2];
- p[2] = v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2];
+ p[0] = v1[0] * w[0] + v2[0] * w[1] + v3[0] * w[2];
+ p[1] = v1[1] * w[0] + v2[1] * w[1] + v3[1] * w[2];
+ p[2] = v1[2] * w[0] + v2[2] * w[1] + v3[2] * w[2];
}
/* weight 3 vectors,
* 'w' must be unit length but is not a vector, just 4 weights */
void interp_v3_v3v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3], const float w[4])
{
- p[0] = v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2] + v4[0]*w[3];
- p[1] = v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2] + v4[1]*w[3];
- p[2] = v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2] + v4[2]*w[3];
+ p[0] = v1[0] * w[0] + v2[0] * w[1] + v3[0] * w[2] + v4[0] * w[3];
+ p[1] = v1[1] * w[0] + v2[1] * w[1] + v3[1] * w[2] + v4[1] * w[3];
+ p[2] = v1[2] * w[0] + v2[2] * w[1] + v3[2] * w[2] + v4[2] * w[3];
}
void interp_v4_v4v4v4(float p[4], const float v1[4], const float v2[4], const float v3[4], const float w[3])
{
- p[0] = v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2];
- p[1] = v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2];
- p[2] = v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2];
- p[3] = v1[3]*w[0] + v2[3]*w[1] + v3[3]*w[2];
+ p[0] = v1[0] * w[0] + v2[0] * w[1] + v3[0] * w[2];
+ p[1] = v1[1] * w[0] + v2[1] * w[1] + v3[1] * w[2];
+ p[2] = v1[2] * w[0] + v2[2] * w[1] + v3[2] * w[2];
+ p[3] = v1[3] * w[0] + v2[3] * w[1] + v3[3] * w[2];
}
void interp_v4_v4v4v4v4(float p[4], const float v1[4], const float v2[4], const float v3[4], const float v4[4], const float w[4])
{
- p[0] = v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2] + v4[0]*w[3];
- p[1] = v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2] + v4[1]*w[3];
- p[2] = v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2] + v4[2]*w[3];
- p[3] = v1[3]*w[0] + v2[3]*w[1] + v3[3]*w[2] + v4[3]*w[3];
+ p[0] = v1[0] * w[0] + v2[0] * w[1] + v3[0] * w[2] + v4[0] * w[3];
+ p[1] = v1[1] * w[0] + v2[1] * w[1] + v3[1] * w[2] + v4[1] * w[3];
+ p[2] = v1[2] * w[0] + v2[2] * w[1] + v3[2] * w[2] + v4[2] * w[3];
+ p[3] = v1[3] * w[0] + v2[3] * w[1] + v3[3] * w[2] + v4[3] * w[3];
}
void mid_v3_v3v3(float v[3], const float v1[3], const float v2[3])
{
- v[0]= 0.5f*(v1[0] + v2[0]);
- v[1]= 0.5f*(v1[1] + v2[1]);
- v[2]= 0.5f*(v1[2] + v2[2]);
+ v[0] = 0.5f * (v1[0] + v2[0]);
+ v[1] = 0.5f * (v1[1] + v2[1]);
+ v[2] = 0.5f * (v1[2] + v2[2]);
}
/********************************** Angles ***********************************/
@@ -145,12 +145,12 @@ float angle_v2v2v2(const float v1[2], const float v2[2], const float v3[2])
{
float vec1[2], vec2[2];
- vec1[0] = v2[0]-v1[0];
- vec1[1] = v2[1]-v1[1];
-
- vec2[0] = v2[0]-v3[0];
- vec2[1] = v2[1]-v3[1];
-
+ vec1[0] = v2[0] - v1[0];
+ vec1[1] = v2[1] - v1[1];
+
+ vec2[0] = v2[0] - v3[0];
+ vec2[1] = v2[1] - v3[1];
+
normalize_v2(vec1);
normalize_v2(vec2);
@@ -174,20 +174,26 @@ float angle_v2v2(const float v1[2], const float v2[2])
return angle_normalized_v2v2(vec1, vec2);
}
+float angle_signed_v2v2(const float v1[2], const float v2[2])
+{
+ const float perp_dot = (v1[1] * v2[0]) - (v1[0] * v2[1]);
+ return atan2f(perp_dot, dot_v2v2(v1, v2));
+}
+
float angle_normalized_v3v3(const float v1[3], const float v2[3])
{
/* this is the same as acos(dot_v3v3(v1, v2)), but more accurate */
if (dot_v3v3(v1, v2) < 0.0f) {
float vec[3];
-
- vec[0]= -v2[0];
- vec[1]= -v2[1];
- vec[2]= -v2[2];
-
- return (float)M_PI - 2.0f*(float)saasin(len_v3v3(vec, v1)/2.0f);
+
+ vec[0] = -v2[0];
+ vec[1] = -v2[1];
+ vec[2] = -v2[2];
+
+ return (float)M_PI - 2.0f * (float)saasin(len_v3v3(vec, v1) / 2.0f);
}
else
- return 2.0f*(float)saasin(len_v3v3(v2, v1)/2.0f);
+ return 2.0f * (float)saasin(len_v3v3(v2, v1) / 2.0f);
}
float angle_normalized_v2v2(const float v1[2], const float v2[2])
@@ -195,14 +201,14 @@ float angle_normalized_v2v2(const float v1[2], const float v2[2])
/* this is the same as acos(dot_v3v3(v1, v2)), but more accurate */
if (dot_v2v2(v1, v2) < 0.0f) {
float vec[2];
-
- vec[0]= -v2[0];
- vec[1]= -v2[1];
-
- return (float)M_PI - 2.0f*saasin(len_v2v2(vec, v1)/2.0f);
+
+ vec[0] = -v2[0];
+ vec[1] = -v2[1];
+
+ return (float)M_PI - 2.0f * saasin(len_v2v2(vec, v1) / 2.0f);
}
else
- return 2.0f*(float)saasin(len_v2v2(v2, v1)/2.0f);
+ return 2.0f * (float)saasin(len_v2v2(v2, v1) / 2.0f);
}
void angle_tri_v3(float angles[3], const float v1[3], const float v2[3], const float v3[3])
@@ -217,10 +223,10 @@ void angle_tri_v3(float angles[3], const float v1[3], const float v2[3], const f
normalize_v3(ed2);
normalize_v3(ed3);
- angles[0]= (float)M_PI - angle_normalized_v3v3(ed1, ed2);
- angles[1]= (float)M_PI - angle_normalized_v3v3(ed2, ed3);
+ angles[0] = (float)M_PI - angle_normalized_v3v3(ed1, ed2);
+ angles[1] = (float)M_PI - angle_normalized_v3v3(ed2, ed3);
// face_angles[2] = M_PI - angle_normalized_v3v3(ed3, ed1);
- angles[2]= (float)M_PI - (angles[0] + angles[1]);
+ angles[2] = (float)M_PI - (angles[0] + angles[1]);
}
void angle_quad_v3(float angles[4], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
@@ -237,10 +243,10 @@ void angle_quad_v3(float angles[4], const float v1[3], const float v2[3], const
normalize_v3(ed3);
normalize_v3(ed4);
- angles[0]= (float)M_PI - angle_normalized_v3v3(ed1, ed2);
- angles[1]= (float)M_PI - angle_normalized_v3v3(ed2, ed3);
- angles[2]= (float)M_PI - angle_normalized_v3v3(ed3, ed4);
- angles[3]= (float)M_PI - angle_normalized_v3v3(ed4, ed1);
+ angles[0] = (float)M_PI - angle_normalized_v3v3(ed1, ed2);
+ angles[1] = (float)M_PI - angle_normalized_v3v3(ed2, ed3);
+ angles[2] = (float)M_PI - angle_normalized_v3v3(ed3, ed4);
+ angles[3] = (float)M_PI - angle_normalized_v3v3(ed4, ed1);
}
void angle_poly_v3(float *angles, const float *verts[3], int len)
@@ -248,12 +254,12 @@ void angle_poly_v3(float *angles, const float *verts[3], int len)
int i;
float vec[3][3];
- sub_v3_v3v3(vec[2], verts[len-1], verts[0]);
+ sub_v3_v3v3(vec[2], verts[len - 1], verts[0]);
normalize_v3(vec[2]);
for (i = 0; i < len; i++) {
- sub_v3_v3v3(vec[i%3], verts[i%len], verts[(i+1)%len]);
- normalize_v3(vec[i%3]);
- angles[i] = (float)M_PI - angle_normalized_v3v3(vec[(i+2)%3], vec[i%3]);
+ sub_v3_v3v3(vec[i % 3], verts[i % len], verts[(i + 1) % len]);
+ normalize_v3(vec[i % 3]);
+ angles[i] = (float)M_PI - angle_normalized_v3v3(vec[(i + 2) % 3], vec[i % 3]);
}
}
@@ -274,12 +280,26 @@ void project_v3_v3v3(float c[3], const float v1[3], const float v2[3])
{
float mul;
mul = dot_v3v3(v1, v2) / dot_v3v3(v2, v2);
-
+
c[0] = mul * v2[0];
c[1] = mul * v2[1];
c[2] = mul * v2[2];
}
+/* project a vector on a plane defined by normal and a plane point p */
+void project_v3_plane(float v[3], const float n[3], const float p[3])
+{
+ float vector[3];
+ float mul;
+
+ sub_v3_v3v3(vector, v, p);
+ mul = dot_v3v3(vector, n) / len_squared_v3(n);
+
+ mul_v3_v3fl(vector, n, mul);
+
+ sub_v3_v3(v, vector);
+}
+
/* Returns a vector bisecting the angle at v2 formed by v1, v2 and v3 */
void bisect_v3_v3v3v3(float out[3], const float v1[3], const float v2[3], const float v3[3])
{
@@ -293,8 +313,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];
@@ -315,7 +335,7 @@ void reflect_v3_v3v3(float out[3], const float v1[3], const float v2[3])
void ortho_basis_v3v3_v3(float v1[3], float v2[3], const float v[3])
{
- const float f = (float)sqrt(v[0]*v[0] + v[1]*v[1]);
+ const float f = (float)sqrt(v[0] * v[0] + v[1] * v[1]);
if (f < 1e-35f) {
// degenerate case
@@ -323,37 +343,37 @@ void ortho_basis_v3v3_v3(float v1[3], float v2[3], const float v[3])
v1[1] = v1[2] = v2[0] = v2[2] = 0.0f;
v2[1] = 1.0f;
}
- else {
- const float d= 1.0f/f;
+ else {
+ const float d = 1.0f / f;
- v1[0] = v[1]*d;
- v1[1] = -v[0]*d;
+ v1[0] = v[1] * d;
+ v1[1] = -v[0] * d;
v1[2] = 0.0f;
- v2[0] = -v[2]*v1[1];
- v2[1] = v[2]*v1[0];
- v2[2] = v[0]*v1[1] - v[1]*v1[0];
+ v2[0] = -v[2] * v1[1];
+ v2[1] = v[2] * v1[0];
+ v2[2] = v[0] * v1[1] - v[1] * v1[0];
}
}
/* 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);
- const float sintheta= sin(angle);
+ const float costheta = cos(angle);
+ const float sintheta = sin(angle);
- r[0]= ((costheta + (1 - costheta) * axis[0] * axis[0]) * p[0]) +
- (((1 - costheta) * axis[0] * axis[1] - axis[2] * sintheta) * p[1]) +
- (((1 - costheta) * axis[0] * axis[2] + axis[1] * sintheta) * p[2]);
+ r[0] = ((costheta + (1 - costheta) * axis[0] * axis[0]) * p[0]) +
+ (((1 - costheta) * axis[0] * axis[1] - axis[2] * sintheta) * p[1]) +
+ (((1 - costheta) * axis[0] * axis[2] + axis[1] * sintheta) * p[2]);
- r[1]= (((1 - costheta) * axis[0] * axis[1] + axis[2] * sintheta) * p[0]) +
- ((costheta + (1 - costheta) * axis[1] * axis[1]) * p[1]) +
- (((1 - costheta) * axis[1] * axis[2] - axis[0] * sintheta) * p[2]);
+ r[1] = (((1 - costheta) * axis[0] * axis[1] + axis[2] * sintheta) * p[0]) +
+ ((costheta + (1 - costheta) * axis[1] * axis[1]) * p[1]) +
+ (((1 - costheta) * axis[1] * axis[2] - axis[0] * sintheta) * p[2]);
- r[2]= (((1 - costheta) * axis[0] * axis[2] - axis[1] * sintheta) * p[0]) +
- (((1 - costheta) * axis[1] * axis[2] + axis[0] * sintheta) * p[1]) +
- ((costheta + (1 - costheta) * axis[2] * axis[2]) * p[2]);
+ r[2] = (((1 - costheta) * axis[0] * axis[2] - axis[1] * sintheta) * p[0]) +
+ (((1 - costheta) * axis[1] * axis[2] + axis[0] * sintheta) * p[1]) +
+ ((costheta + (1 - costheta) * axis[2] * axis[2]) * p[2]);
}
void rotate_v3_v3v3fl(float r[3], const float p[3], const float axis[3], const float angle)
@@ -384,39 +404,40 @@ void print_v4(const char *str, const float v[4])
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
{
- if(min[0]>vec[0]) min[0]= vec[0];
- if(min[1]>vec[1]) min[1]= vec[1];
- if(min[2]>vec[2]) min[2]= vec[2];
+ if (min[0] > vec[0]) min[0] = vec[0];
+ if (min[1] > vec[1]) min[1] = vec[1];
+ if (min[2] > vec[2]) min[2] = vec[2];
- if(max[0]<vec[0]) max[0]= vec[0];
- if(max[1]<vec[1]) max[1]= vec[1];
- if(max[2]<vec[2]) max[2]= vec[2];
+ if (max[0] < vec[0]) max[0] = vec[0];
+ if (max[1] < vec[1]) max[1] = vec[1];
+ if (max[2] < vec[2]) max[2] = vec[2];
}
-
/***************************** Array Functions *******************************/
double dot_vn_vn(const float *array_src_a, const float *array_src_b, const int size)
{
- double d= 0.0f;
- const float *array_pt_a= array_src_a + (size-1);
- const float *array_pt_b= array_src_b + (size-1);
- int i= size;
- while(i--) { d += *(array_pt_a--) * *(array_pt_b--); }
+ double d = 0.0f;
+ const float *array_pt_a = array_src_a + (size - 1);
+ const float *array_pt_b = array_src_b + (size - 1);
+ int i = size;
+ while (i--) {
+ d += *(array_pt_a--) * *(array_pt_b--);
+ }
return d;
}
float normalize_vn_vn(float *array_tar, const float *array_src, const int size)
{
- double d= dot_vn_vn(array_tar, array_src, size);
+ double d = dot_vn_vn(array_tar, array_src, size);
float d_sqrt;
if (d > 1.0e-35) {
- d_sqrt= (float)sqrt(d);
- mul_vn_vn_fl(array_tar, array_src, size, 1.0f/d_sqrt);
+ d_sqrt = (float)sqrt(d);
+ mul_vn_vn_fl(array_tar, array_src, size, 1.0f / d_sqrt);
}
else {
fill_vn_fl(array_tar, size, 0.0f);
- d_sqrt= 0.0f;
+ d_sqrt = 0.0f;
}
return d_sqrt;
}
@@ -428,95 +449,117 @@ float normalize_vn(float *array_tar, const int size)
void range_vn_i(int *array_tar, const int size, const int start)
{
- int *array_pt= array_tar + (size-1);
- int j= start + (size-1);
- int i= size;
- while(i--) { *(array_pt--) = j--; }
+ int *array_pt = array_tar + (size - 1);
+ int j = start + (size - 1);
+ int i = size;
+ while (i--) {
+ *(array_pt--) = j--;
+ }
}
void range_vn_fl(float *array_tar, const int size, const float start, const float step)
{
- float *array_pt= array_tar + (size-1);
- int i= size;
- while(i--) {
+ float *array_pt = array_tar + (size - 1);
+ int i = size;
+ while (i--) {
*(array_pt--) = start + step * (float)(i);
}
}
void negate_vn(float *array_tar, const int size)
{
- float *array_pt= array_tar + (size-1);
- int i= size;
- while(i--) { *(array_pt--) *= -1.0f; }
+ float *array_pt = array_tar + (size - 1);
+ int i = size;
+ while (i--) {
+ *(array_pt--) *= -1.0f;
+ }
}
void negate_vn_vn(float *array_tar, const float *array_src, const int size)
{
- float *tar= array_tar + (size-1);
- const float *src= array_src + (size-1);
- int i= size;
- while(i--) { *(tar--) = - *(src--); }
+ float *tar = array_tar + (size - 1);
+ const float *src = array_src + (size - 1);
+ int i = size;
+ while (i--) {
+ *(tar--) = -*(src--);
+ }
}
void mul_vn_fl(float *array_tar, const int size, const float f)
{
- float *array_pt= array_tar + (size-1);
- int i= size;
- while(i--) { *(array_pt--) *= f; }
+ float *array_pt = array_tar + (size - 1);
+ int i = size;
+ while (i--) {
+ *(array_pt--) *= f;
+ }
}
void mul_vn_vn_fl(float *array_tar, const float *array_src, const int size, const float f)
{
- float *tar= array_tar + (size-1);
- const float *src= array_src + (size-1);
- int i= size;
- while(i--) { *(tar--) = *(src--) * f; }
+ float *tar = array_tar + (size - 1);
+ const float *src = array_src + (size - 1);
+ int i = size;
+ while (i--) {
+ *(tar--) = *(src--) * f;
+ }
}
void add_vn_vn(float *array_tar, const float *array_src, const int size)
{
- float *tar= array_tar + (size-1);
- const float *src= array_src + (size-1);
- int i= size;
- while(i--) { *(tar--) += *(src--); }
+ float *tar = array_tar + (size - 1);
+ const float *src = array_src + (size - 1);
+ int i = size;
+ while (i--) {
+ *(tar--) += *(src--);
+ }
}
void add_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const int size)
{
- float *tar= array_tar + (size-1);
- const float *src_a= array_src_a + (size-1);
- const float *src_b= array_src_b + (size-1);
- int i= size;
- while(i--) { *(tar--) = *(src_a--) + *(src_b--); }
+ float *tar = array_tar + (size - 1);
+ const float *src_a = array_src_a + (size - 1);
+ const float *src_b = array_src_b + (size - 1);
+ int i = size;
+ while (i--) {
+ *(tar--) = *(src_a--) + *(src_b--);
+ }
}
void sub_vn_vn(float *array_tar, const float *array_src, const int size)
{
- float *tar= array_tar + (size-1);
- const float *src= array_src + (size-1);
- int i= size;
- while(i--) { *(tar--) -= *(src--); }
+ float *tar = array_tar + (size - 1);
+ const float *src = array_src + (size - 1);
+ int i = size;
+ while (i--) {
+ *(tar--) -= *(src--);
+ }
}
void sub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const int size)
{
- float *tar= array_tar + (size-1);
- const float *src_a= array_src_a + (size-1);
- const float *src_b= array_src_b + (size-1);
- int i= size;
- while(i--) { *(tar--) = *(src_a--) - *(src_b--); }
+ float *tar = array_tar + (size - 1);
+ const float *src_a = array_src_a + (size - 1);
+ const float *src_b = array_src_b + (size - 1);
+ int i = size;
+ while (i--) {
+ *(tar--) = *(src_a--) - *(src_b--);
+ }
}
void fill_vn_i(int *array_tar, const int size, const int val)
{
- int *tar= array_tar + (size-1);
- int i= size;
- while(i--) { *(tar--) = val; }
+ int *tar = array_tar + (size - 1);
+ int i = size;
+ while (i--) {
+ *(tar--) = val;
+ }
}
void fill_vn_fl(float *array_tar, const int size, const float val)
{
- float *tar= array_tar + (size-1);
- int i= size;
- while(i--) { *(tar--) = val; }
+ float *tar = array_tar + (size - 1);
+ int i = size;
+ while (i--) {
+ *(tar--) = val;
+ }
}
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 12e11714a13..62e582c89c4 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -17,7 +17,7 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
-
+ *
* The Original Code is: some of this file.
*
* ***** END GPL LICENSE BLOCK *****
@@ -37,131 +37,175 @@
MINLINE void zero_v2(float r[2])
{
- r[0]= 0.0f;
- r[1]= 0.0f;
+ r[0] = 0.0f;
+ r[1] = 0.0f;
}
MINLINE void zero_v3(float r[3])
{
- r[0]= 0.0f;
- r[1]= 0.0f;
- r[2]= 0.0f;
+ r[0] = 0.0f;
+ r[1] = 0.0f;
+ r[2] = 0.0f;
}
MINLINE void zero_v4(float r[4])
{
- r[0]= 0.0f;
- r[1]= 0.0f;
- r[2]= 0.0f;
- r[3]= 0.0f;
+ r[0] = 0.0f;
+ r[1] = 0.0f;
+ r[2] = 0.0f;
+ r[3] = 0.0f;
}
MINLINE void copy_v2_v2(float r[2], const float a[2])
{
- r[0]= a[0];
- r[1]= a[1];
+ r[0] = a[0];
+ r[1] = a[1];
}
MINLINE void copy_v3_v3(float r[3], const float a[3])
{
- r[0]= a[0];
- r[1]= a[1];
- r[2]= a[2];
+ r[0] = a[0];
+ r[1] = a[1];
+ r[2] = a[2];
}
MINLINE void copy_v4_v4(float r[4], const float a[4])
{
- r[0]= a[0];
- r[1]= a[1];
- r[2]= a[2];
- r[3]= a[3];
+ r[0] = a[0];
+ r[1] = a[1];
+ r[2] = a[2];
+ r[3] = a[3];
}
MINLINE void copy_v2_fl(float r[2], float f)
{
- r[0]= f;
- r[1]= f;
+ r[0] = f;
+ r[1] = f;
}
MINLINE void copy_v3_fl(float r[3], float f)
{
- r[0]= f;
- r[1]= f;
- r[2]= f;
+ r[0] = f;
+ r[1] = f;
+ r[2] = f;
}
MINLINE void copy_v4_fl(float r[4], float f)
{
- r[0]= f;
- r[1]= f;
- r[2]= f;
- r[3]= f;
+ r[0] = f;
+ r[1] = f;
+ r[2] = f;
+ r[3] = f;
}
/* short */
MINLINE void copy_v2_v2_char(char r[2], const char a[2])
{
- r[0]= a[0];
- r[1]= a[1];
+ r[0] = a[0];
+ r[1] = a[1];
}
MINLINE void copy_v3_v3_char(char r[3], const char a[3])
{
- r[0]= a[0];
- r[1]= a[1];
- r[2]= a[2];
+ r[0] = a[0];
+ r[1] = a[1];
+ r[2] = a[2];
}
MINLINE void copy_v4_v4_char(char r[4], const char a[4])
{
- r[0]= a[0];
- r[1]= a[1];
- r[2]= a[2];
- r[3]= a[3];
+ r[0] = a[0];
+ r[1] = a[1];
+ r[2] = a[2];
+ r[3] = a[3];
}
/* short */
MINLINE void copy_v2_v2_short(short r[2], const short a[2])
{
- r[0]= a[0];
- r[1]= a[1];
+ r[0] = a[0];
+ r[1] = a[1];
}
MINLINE void copy_v3_v3_short(short r[3], const short a[3])
{
- r[0]= a[0];
- r[1]= a[1];
- r[2]= a[2];
+ r[0] = a[0];
+ r[1] = a[1];
+ r[2] = a[2];
}
MINLINE void copy_v4_v4_short(short r[4], const short a[4])
{
- r[0]= a[0];
- r[1]= a[1];
- r[2]= a[2];
- r[3]= a[3];
+ r[0] = a[0];
+ r[1] = a[1];
+ r[2] = a[2];
+ r[3] = a[3];
}
/* int */
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
{
- r[0]= a[0];
- r[1]= a[1];
+ r[0] = a[0];
+ r[1] = a[1];
}
MINLINE void copy_v3_v3_int(int r[3], const int a[3])
{
- r[0]= a[0];
- r[1]= a[1];
- r[2]= a[2];
+ r[0] = a[0];
+ r[1] = a[1];
+ r[2] = a[2];
}
MINLINE void copy_v4_v4_int(int r[4], const int a[4])
{
- r[0]= a[0];
- r[1]= a[1];
- r[2]= a[2];
- r[3]= a[3];
+ r[0] = a[0];
+ r[1] = a[1];
+ r[2] = a[2];
+ 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])
@@ -210,8 +254,8 @@ MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
{
- r[0]= a[0] + b[0];
- r[1]= a[1] + b[1];
+ r[0] = a[0] + b[0];
+ r[1] = a[1] + b[1];
}
MINLINE void add_v3_v3(float r[3], const float a[3])
@@ -223,9 +267,9 @@ MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
{
- r[0]= a[0] + b[0];
- r[1]= a[1] + b[1];
- r[2]= a[2] + b[2];
+ r[0] = a[0] + b[0];
+ r[1] = a[1] + b[1];
+ r[2] = a[2] + b[2];
}
MINLINE void sub_v2_v2(float r[2], const float a[2])
@@ -236,8 +280,8 @@ MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
{
- r[0]= a[0] - b[0];
- r[1]= a[1] - b[1];
+ r[0] = a[0] - b[0];
+ r[1] = a[1] - b[1];
}
MINLINE void sub_v3_v3(float r[3], const float a[3])
@@ -249,9 +293,9 @@ MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
{
- r[0]= a[0] - b[0];
- r[1]= a[1] - b[1];
- r[2]= a[2] - b[2];
+ r[0] = a[0] - b[0];
+ r[1] = a[1] - b[1];
+ r[2] = a[2] - b[2];
}
MINLINE void sub_v4_v4(float r[4], const float a[4])
@@ -264,23 +308,22 @@ MINLINE void sub_v4_v4(float r[4], const float a[4])
MINLINE void sub_v4_v4v4(float r[4], const float a[4], const float b[4])
{
- r[0]= a[0] - b[0];
- r[1]= a[1] - b[1];
- r[2]= a[2] - b[2];
- r[3]= a[3] - b[3];
+ r[0] = a[0] - b[0];
+ r[1] = a[1] - b[1];
+ r[2] = a[2] - b[2];
+ r[3] = a[3] - b[3];
}
-
MINLINE void mul_v2_fl(float r[2], float f)
{
- r[0]*= f;
- r[1]*= f;
+ r[0] *= f;
+ r[1] *= f;
}
MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f)
{
- r[0]= a[0]*f;
- r[1]= a[1]*f;
+ r[0] = a[0] * f;
+ r[1] = a[1] * f;
}
MINLINE void mul_v3_fl(float r[3], float f)
@@ -292,9 +335,9 @@ MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
{
- r[0]= a[0]*f;
- r[1]= a[1]*f;
- r[2]= a[2]*f;
+ r[0] = a[0] * f;
+ r[1] = a[1] * f;
+ r[2] = a[2] * f;
}
MINLINE void mul_v2_v2(float r[2], const float a[2])
@@ -312,58 +355,58 @@ MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE void mul_v4_fl(float r[4], float f)
{
- r[0]*= f;
- r[1]*= f;
- r[2]*= f;
- r[3]*= f;
+ r[0] *= f;
+ r[1] *= f;
+ r[2] *= f;
+ r[3] *= f;
}
MINLINE void madd_v2_v2fl(float r[2], const float a[2], float f)
{
- r[0] += a[0]*f;
- r[1] += a[1]*f;
+ r[0] += a[0] * f;
+ r[1] += a[1] * f;
}
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
{
- r[0] += a[0]*f;
- r[1] += a[1]*f;
- r[2] += a[2]*f;
+ r[0] += a[0] * f;
+ r[1] += a[1] * f;
+ r[2] += a[2] * f;
}
MINLINE void madd_v3_v3v3(float r[3], const float a[3], const float b[3])
{
- r[0] += a[0]*b[0];
- r[1] += a[1]*b[1];
- r[2] += a[2]*b[2];
+ r[0] += a[0] * b[0];
+ r[1] += a[1] * b[1];
+ r[2] += a[2] * b[2];
}
MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f)
{
- r[0] = a[0] + b[0]*f;
- r[1] = a[1] + b[1]*f;
+ r[0] = a[0] + b[0] * f;
+ r[1] = a[1] + b[1] * f;
}
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
{
- r[0] = a[0] + b[0]*f;
- r[1] = a[1] + b[1]*f;
- r[2] = a[2] + b[2]*f;
+ r[0] = a[0] + b[0] * f;
+ r[1] = a[1] + b[1] * f;
+ r[2] = a[2] + b[2] * f;
}
MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3])
{
- r[0] = a[0] + b[0]*c[0];
- r[1] = a[1] + b[1]*c[1];
- r[2] = a[2] + b[2]*c[2];
+ r[0] = a[0] + b[0] * c[0];
+ r[1] = a[1] + b[1] * c[1];
+ r[2] = a[2] + b[2] * c[2];
}
MINLINE void madd_v4_v4fl(float r[4], const float a[4], float f)
{
- r[0] += a[0]*f;
- r[1] += a[1]*f;
- r[2] += a[2]*f;
- r[3] += a[3]*f;
+ r[0] += a[0] * f;
+ r[1] += a[1] * f;
+ r[2] += a[2] * f;
+ r[3] += a[3] * f;
}
MINLINE void mul_v3_v3v3(float r[3], const float v1[3], const float v2[3])
@@ -375,98 +418,103 @@ MINLINE void mul_v3_v3v3(float r[3], const float v1[3], const float v2[3])
MINLINE void negate_v2(float r[3])
{
- r[0]= -r[0];
- r[1]= -r[1];
+ r[0] = -r[0];
+ r[1] = -r[1];
}
MINLINE void negate_v2_v2(float r[2], const float a[2])
{
- r[0]= -a[0];
- r[1]= -a[1];
+ r[0] = -a[0];
+ r[1] = -a[1];
}
MINLINE void negate_v3(float r[3])
{
- r[0]= -r[0];
- r[1]= -r[1];
- r[2]= -r[2];
+ r[0] = -r[0];
+ r[1] = -r[1];
+ r[2] = -r[2];
}
MINLINE void negate_v3_v3(float r[3], const float a[3])
{
- r[0]= -a[0];
- r[1]= -a[1];
- r[2]= -a[2];
+ r[0] = -a[0];
+ r[1] = -a[1];
+ r[2] = -a[2];
}
MINLINE void negate_v4(float r[4])
{
- r[0]= -r[0];
- r[1]= -r[1];
- r[2]= -r[2];
- r[3]= -r[3];
+ r[0] = -r[0];
+ r[1] = -r[1];
+ r[2] = -r[2];
+ r[3] = -r[3];
}
MINLINE void negate_v4_v4(float r[4], const float a[4])
{
- r[0]= -a[0];
- r[1]= -a[1];
- r[2]= -a[2];
- r[3]= -a[3];
+ r[0] = -a[0];
+ r[1] = -a[1];
+ r[2] = -a[2];
+ r[3] = -a[3];
}
MINLINE float dot_v2v2(const float a[2], const float b[2])
{
- return a[0]*b[0] + a[1]*b[1];
+ return a[0] * b[0] + a[1] * b[1];
}
MINLINE float dot_v3v3(const float a[3], const float b[3])
{
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
+ return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}
MINLINE float cross_v2v2(const float a[2], const float b[2])
{
- return a[0]*b[1] - a[1]*b[0];
+ return a[0] * b[1] - a[1] * b[0];
}
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
{
- r[0]= a[1]*b[2] - a[2]*b[1];
- r[1]= a[2]*b[0] - a[0]*b[2];
- r[2]= a[0]*b[1] - a[1]*b[0];
+ r[0] = a[1] * b[2] - a[2] * b[1];
+ r[1] = a[2] * b[0] - a[0] * b[2];
+ r[2] = a[0] * b[1] - a[1] * b[0];
}
MINLINE void star_m3_v3(float rmat[][3], float a[3])
{
- rmat[0][0]= rmat[1][1]= rmat[2][2]= 0.0;
- rmat[0][1]= -a[2];
- rmat[0][2]= a[1];
- rmat[1][0]= a[2];
- rmat[1][2]= -a[0];
- rmat[2][0]= -a[1];
- rmat[2][1]= a[0];
+ rmat[0][0] = rmat[1][1] = rmat[2][2] = 0.0;
+ rmat[0][1] = -a[2];
+ rmat[0][2] = a[1];
+ rmat[1][0] = a[2];
+ rmat[1][2] = -a[0];
+ rmat[2][0] = -a[1];
+ rmat[2][1] = a[0];
}
/*********************************** Length **********************************/
MINLINE float len_squared_v2(const float v[2])
{
- return v[0]*v[0] + v[1]*v[1];
+ return v[0] * v[0] + v[1] * v[1];
+}
+
+MINLINE float len_squared_v3(const float v[3])
+{
+ return v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
}
MINLINE float len_v2(const float v[2])
{
- return (float)sqrtf(v[0]*v[0] + v[1]*v[1]);
+ return (float)sqrtf(v[0] * v[0] + v[1] * v[1]);
}
MINLINE float len_v2v2(const float v1[2], const float v2[2])
{
float x, y;
- x = v1[0]-v2[0];
- y = v1[1]-v2[1];
- return (float)sqrtf(x*x+y*y);
+ x = v1[0] - v2[0];
+ y = v1[1] - v2[1];
+ return (float)sqrtf(x * x + y * y);
}
MINLINE float len_v3(const float a[3])
@@ -500,14 +548,15 @@ MINLINE float len_squared_v3v3(const float a[3], const float b[3])
MINLINE float normalize_v2_v2(float r[2], const float a[2])
{
- float d= dot_v2v2(a, a);
+ float d = dot_v2v2(a, a);
- if(d > 1.0e-35f) {
- d= sqrtf(d);
- mul_v2_v2fl(r, a, 1.0f/d);
- } else {
+ if (d > 1.0e-35f) {
+ d = sqrtf(d);
+ mul_v2_v2fl(r, a, 1.0f / d);
+ }
+ else {
zero_v2(r);
- d= 0.0f;
+ d = 0.0f;
}
return d;
@@ -520,17 +569,17 @@ MINLINE float normalize_v2(float n[2])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
{
- float d= dot_v3v3(a, a);
+ float d = dot_v3v3(a, a);
/* a larger value causes normalize errors in a
- scaled down models with camera xtreme close */
- if(d > 1.0e-35f) {
- d= sqrtf(d);
- mul_v3_v3fl(r, a, 1.0f/d);
+ * scaled down models with camera xtreme close */
+ if (d > 1.0e-35f) {
+ d = sqrtf(d);
+ mul_v3_v3fl(r, a, 1.0f / d);
}
else {
zero_v3(r);
- d= 0.0f;
+ d = 0.0f;
}
return d;
@@ -538,22 +587,23 @@ MINLINE float normalize_v3_v3(float r[3], const float a[3])
MINLINE double normalize_v3_d(double n[3])
{
- double d= n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
+ 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 */
- if(d > 1.0e-35) {
+ * scaled down models with camera xtreme close */
+ if (d > 1.0e-35) {
double mul;
- d= sqrt(d);
+ d = sqrt(d);
mul = 1.0 / d;
n[0] *= mul;
n[1] *= mul;
n[2] *= mul;
- } else {
+ }
+ else {
n[0] = n[1] = n[2] = 0;
- d= 0.0;
+ d = 0.0;
}
return d;
@@ -566,20 +616,26 @@ MINLINE float normalize_v3(float n[3])
MINLINE void normal_short_to_float_v3(float out[3], const short in[3])
{
- out[0] = in[0]*(1.0f/32767.0f);
- out[1] = in[1]*(1.0f/32767.0f);
- out[2] = in[2]*(1.0f/32767.0f);
+ out[0] = in[0] * (1.0f / 32767.0f);
+ out[1] = in[1] * (1.0f / 32767.0f);
+ out[2] = in[2] * (1.0f / 32767.0f);
}
MINLINE void normal_float_to_short_v3(short out[3], const float in[3])
{
- out[0] = (short)(in[0]*32767.0f);
- out[1] = (short)(in[1]*32767.0f);
- out[2] = (short)(in[2]*32767.0f);
+ out[0] = (short) (in[0] * 32767.0f);
+ out[1] = (short) (in[1] * 32767.0f);
+ out[2] = (short) (in[2] * 32767.0f);
}
/********************************* Comparison ********************************/
+
+MINLINE int is_zero_v2(const float v[3])
+{
+ return (v[0] == 0 && v[1] == 0);
+}
+
MINLINE int is_zero_v3(const float v[3])
{
return (v[0] == 0 && v[1] == 0 && v[2] == 0);
@@ -597,24 +653,24 @@ MINLINE int is_one_v3(const float v[3])
MINLINE int equals_v2v2(const float v1[2], const float v2[2])
{
- return ((v1[0]==v2[0]) && (v1[1]==v2[1]));
+ return ((v1[0] == v2[0]) && (v1[1] == v2[1]));
}
MINLINE int equals_v3v3(const float v1[3], const float v2[3])
{
- return ((v1[0]==v2[0]) && (v1[1]==v2[1]) && (v1[2]==v2[2]));
+ return ((v1[0] == v2[0]) && (v1[1] == v2[1]) && (v1[2] == v2[2]));
}
MINLINE int equals_v4v4(const float v1[4], const float v2[4])
{
- return ((v1[0]==v2[0]) && (v1[1]==v2[1]) && (v1[2]==v2[2]) && (v1[3]==v2[3]));
+ return ((v1[0] == v2[0]) && (v1[1] == v2[1]) && (v1[2] == v2[2]) && (v1[3] == v2[3]));
}
MINLINE int compare_v3v3(const float v1[3], const float v2[3], const float limit)
{
- if(fabsf(v1[0]-v2[0])<limit)
- if(fabsf(v1[1]-v2[1])<limit)
- if(fabsf(v1[2]-v2[2])<limit)
+ if (fabsf(v1[0] - v2[0]) < limit)
+ if (fabsf(v1[1] - v2[1]) < limit)
+ if (fabsf(v1[2] - v2[2]) < limit)
return 1;
return 0;
@@ -622,21 +678,21 @@ MINLINE int compare_v3v3(const float v1[3], const float v2[3], const float limit
MINLINE int compare_len_v3v3(const float v1[3], const float v2[3], const float limit)
{
- float x,y,z;
+ float x, y, z;
- x=v1[0]-v2[0];
- y=v1[1]-v2[1];
- z=v1[2]-v2[2];
+ x = v1[0] - v2[0];
+ y = v1[1] - v2[1];
+ z = v1[2] - v2[2];
- return ((x*x + y*y + z*z) < (limit*limit));
+ return ((x * x + y * y + z * z) < (limit * limit));
}
MINLINE int compare_v4v4(const float v1[4], const float v2[4], const float limit)
{
- if(fabsf(v1[0]-v2[0])<limit)
- if(fabsf(v1[1]-v2[1])<limit)
- if(fabsf(v1[2]-v2[2])<limit)
- if(fabsf(v1[3]-v2[3])<limit)
+ if (fabsf(v1[0] - v2[0]) < limit)
+ if (fabsf(v1[1] - v2[1]) < limit)
+ if (fabsf(v1[2] - v2[2]) < limit)
+ if (fabsf(v1[3] - v2[3]) < limit)
return 1;
return 0;
@@ -644,8 +700,8 @@ MINLINE int compare_v4v4(const float v1[4], const float v2[4], const float limit
MINLINE float line_point_side_v2(const float l1[2], const float l2[2], const float pt[2])
{
- return ((l1[0]-pt[0]) * (l2[1]-pt[1])) -
- ((l2[0]-pt[0]) * (l1[1]-pt[1]));
+ return (((l1[0] - pt[0]) * (l2[1] - pt[1])) -
+ ((l2[0] - pt[0]) * (l1[1] - pt[1])));
}
#endif /* __MATH_VECTOR_INLINE_C__ */
diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c
index f77ea3895c3..f1749d0b7cd 100644
--- a/source/blender/blenlib/intern/noise.c
+++ b/source/blender/blenlib/intern/noise.c
@@ -332,7 +332,7 @@ static float orgBlenderNoise(float x, float y, float z)
h=hashvectf+ 3*hash[b21+b11];
n+= i*(h[0]*jx+h[1]*jy+h[2]*jz);
- if(n<0.0f) n=0.0f; else if(n>1.0f) n=1.0f;
+ if (n<0.0f) n=0.0f; else if (n>1.0f) n=1.0f;
return n;
}
@@ -345,7 +345,7 @@ static float orgBlenderNoiseS(float x, float y, float z)
/* separated from orgBlenderNoise above, with scaling */
float BLI_hnoise(float noisesize, float x, float y, float z)
{
- if(noisesize==0.0f) return 0.0f;
+ if (noisesize==0.0f) return 0.0f;
x= (1.0f+x)/noisesize;
y= (1.0f+y)/noisesize;
z= (1.0f+z)/noisesize;
@@ -360,7 +360,7 @@ float BLI_turbulence(float noisesize, float x, float y, float z, int nr)
s= BLI_hnoise(noisesize, x, y, z);
- while(nr>0) {
+ while (nr>0) {
s+= d*BLI_hnoise(noisesize*d, x, y, z);
div+= d;
@@ -377,7 +377,7 @@ float BLI_turbulence1(float noisesize, float x, float y, float z, int nr)
s= fabsf( (-1.0f+2.0f*BLI_hnoise(noisesize, x, y, z)));
- while(nr>0) {
+ while (nr>0) {
s+= fabsf(d* (-1.0f+2.0f*BLI_hnoise(noisesize*d, x, y, z)));
div+= d;
@@ -919,12 +919,14 @@ static float g[512+2][3]= {
{-0.944031, -0.326599, -0.045624},
};
-#define setup(i,b0,b1,r0,r1) \
- t = vec[i] + 10000.0f; \
- b0 = ((int)t) & 255; \
- b1 = (b0+1) & 255; \
- r0 = t - floorf(t); \
- r1 = r0 - 1.0f;
+#define SETUP(val, b0, b1, r0, r1) \
+ { \
+ t = val + 10000.0f; \
+ b0 = ((int)t) & 255; \
+ b1 = (b0 + 1) & 255; \
+ r0 = t - floorf(t); \
+ r1 = r0 - 1.0f; \
+ }
static float noise3_perlin(float vec[3])
@@ -934,9 +936,9 @@ static float noise3_perlin(float vec[3])
register int i, j;
- setup(0, bx0,bx1, rx0,rx1);
- setup(1, by0,by1, ry0,ry1);
- setup(2, bz0,bz1, rz0,rz1);
+ SETUP(vec[0], bx0, bx1, rx0, rx1);
+ SETUP(vec[1], by0, by1, ry0, ry1);
+ SETUP(vec[2], bz0, bz1, rz0, rz1);
i = p[ bx0 ];
j = p[ bx1 ];
@@ -946,46 +948,48 @@ static float noise3_perlin(float vec[3])
b01 = p[ i + by1 ];
b11 = p[ j + by1 ];
-#define at(rx,ry,rz) ( rx * q[0] + ry * q[1] + rz * q[2] )
-
-#define surve(t) ( t * t * (3.0f - 2.0f * t) )
+#define VALUE_AT(rx,ry,rz) (rx * q[0] + ry * q[1] + rz * q[2])
+#define SURVE(t) (t * t * (3.0f - 2.0f * t))
/* lerp moved to improved perlin above */
- sx = surve(rx0);
- sy = surve(ry0);
- sz = surve(rz0);
+ sx = SURVE(rx0);
+ sy = SURVE(ry0);
+ sz = SURVE(rz0);
q = g[ b00 + bz0 ];
- u = at(rx0,ry0,rz0);
+ u = VALUE_AT(rx0,ry0,rz0);
q = g[ b10 + bz0 ];
- v = at(rx1,ry0,rz0);
+ v = VALUE_AT(rx1,ry0,rz0);
a = lerp(sx, u, v);
q = g[ b01 + bz0 ];
- u = at(rx0,ry1,rz0);
+ u = VALUE_AT(rx0,ry1,rz0);
q = g[ b11 + bz0 ];
- v = at(rx1,ry1,rz0);
+ v = VALUE_AT(rx1,ry1,rz0);
b = lerp(sx, u, v);
c = lerp(sy, a, b); /* interpolate in y at lo x */
q = g[ b00 + bz1 ];
- u = at(rx0,ry0,rz1);
+ u = VALUE_AT(rx0,ry0,rz1);
q = g[ b10 + bz1 ];
- v = at(rx1,ry0,rz1);
+ v = VALUE_AT(rx1,ry0,rz1);
a = lerp(sx, u, v);
q = g[ b01 + bz1 ];
- u = at(rx0,ry1,rz1);
+ u = VALUE_AT(rx0,ry1,rz1);
q = g[ b11 + bz1 ];
- v = at(rx1,ry1,rz1);
+ v = VALUE_AT(rx1,ry1,rz1);
b = lerp(sx, u, v);
d = lerp(sy, a, b); /* interpolate in y at hi x */
return 1.5f * lerp(sz, c, d); /* interpolate in z */
+
+#undef VALUE_AT
+#undef SURVE
}
#if 0
@@ -1043,7 +1047,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 +1057,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 +1112,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 +1228,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 +1512,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);
@@ -1768,7 +1775,7 @@ float mg_RidgedMultiFractal(float x, float y, float z, float H, float lacunarity
result = signal;
- for( i=1; i<(int)octaves; i++ ) {
+ for ( i=1; i<(int)octaves; i++ ) {
x *= lacunarity;
y *= lacunarity;
z *= lacunarity;
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 18f7767c303..df711150b97 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -62,6 +62,7 @@
#endif
#ifdef WIN32
+#include "utf_winfunc.h"
# include <io.h>
# ifdef _WIN32_IE
# undef _WIN32_IE
@@ -110,18 +111,18 @@ int BLI_stringdec(const char *string, char *head, char *tail, unsigned short *nu
short i, found = 0;
char *lslash = BLI_last_slash(string);
len2 = len = strlen(string);
- if(lslash)
+ if (lslash)
lenlslash= (int)(lslash - string);
- while(len > lenlslash && string[--len] != '.') {};
- if(len == lenlslash && string[len] != '.') len = len2;
+ while (len > lenlslash && string[--len] != '.') {};
+ if (len == lenlslash && string[len] != '.') len = len2;
for (i = len - 1; i >= lenlslash; i--) {
if (isdigit(string[i])) {
if (found) {
nums = i;
}
- else{
+ else {
nume = i;
nums = i;
found = 1;
@@ -153,7 +154,7 @@ int BLI_stringdec(const char *string, char *head, char *tail, unsigned short *nu
void BLI_stringenc(char *string, const char *head, const char *tail, unsigned short numlen, int pic)
{
char fmtstr[16]="";
- if(pic < 0) pic= 0;
+ if (pic < 0) pic= 0;
sprintf(fmtstr, "%%s%%.%dd%%s", numlen);
sprintf(string, fmtstr, head, pic, tail);
}
@@ -168,23 +169,23 @@ int BLI_split_name_num(char *left, int *nr, const char *name, const char delim)
a= strlen(name);
memcpy(left, name, (a + 1) * sizeof(char));
- if(a>1 && name[a-1]==delim) return a;
+ if (a>1 && name[a-1]==delim) return a;
- while(a--) {
- if( name[a]==delim ) {
+ while (a--) {
+ if ( name[a]==delim ) {
left[a]= 0;
*nr= atol(name+a+1);
/* casting down to an int, can overflow for large numbers */
- if(*nr < 0)
+ if (*nr < 0)
*nr= 0;
return a;
}
- if( isdigit(name[a])==0 ) break;
+ if ( isdigit(name[a])==0 ) break;
left[a]= 0;
}
- for(a= 0; name[a]; a++)
+ for (a= 0; name[a]; a++)
left[a]= name[a];
return a;
@@ -216,11 +217,11 @@ void BLI_newname(char *name, int add)
int BLI_uniquename_cb(int (*unique_check)(void *, const char *), void *arg, const char defname[], char delim, char *name, short name_len)
{
- if(name[0] == '\0') {
+ if (name[0] == '\0') {
BLI_strncpy(name, defname, name_len);
}
- if(unique_check(arg, name)) {
+ if (unique_check(arg, name)) {
char numstr[16];
char tempname[UNIQUE_NAME_MAX];
char left[UNIQUE_NAME_MAX];
@@ -241,7 +242,7 @@ int BLI_uniquename_cb(int (*unique_check)(void *, const char *), void *arg, cons
tempname_buf = BLI_strncat_utf8(tempname, left, name_len - numlen);
memcpy(tempname_buf, numstr, numlen + 1);
}
- } while(unique_check(arg, tempname));
+ } while (unique_check(arg, tempname));
BLI_strncpy(name, tempname, name_len);
@@ -264,7 +265,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)
{
@@ -321,7 +322,8 @@ void BLI_cleanup_path(const char *relabase, char *dir)
char *start, *eind;
if (relabase) {
BLI_path_abs(dir, relabase);
- } else {
+ }
+ else {
if (dir[0]=='/' && dir[1]=='/') {
if (dir[2]== '\0') {
return; /* path is "//" - cant clean it */
@@ -331,18 +333,18 @@ void BLI_cleanup_path(const char *relabase, char *dir)
}
/* Note
- * memmove( start, eind, strlen(eind)+1 );
+ * memmove(start, eind, strlen(eind) + 1);
* 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
/* Note, this should really be moved to the file selector,
* since this function is used in many areas */
- if(strcmp(dir, ".")==0) { /* happens for example in FILE_MAIN */
+ if (strcmp(dir, ".")==0) { /* happens for example in FILE_MAIN */
get_default_root(dir);
return;
}
@@ -356,32 +358,33 @@ void BLI_cleanup_path(const char *relabase, char *dir)
}
if (a<0) {
break;
- } else {
- memmove( dir+a, eind, strlen(eind)+1 );
+ }
+ else {
+ memmove(dir + a, eind, strlen(eind) + 1);
}
}
while ( (start = strstr(dir,"\\.\\")) ) {
eind = start + strlen("\\.\\") - 1;
- memmove( start, eind, strlen(eind)+1 );
+ memmove(start, eind, strlen(eind) + 1);
}
while ( (start = strstr(dir,"\\\\" )) ) {
eind = start + strlen("\\\\") - 1;
- memmove( start, eind, strlen(eind)+1 );
+ memmove(start, eind, strlen(eind) + 1);
}
#else
- if(dir[0]=='.') { /* happens, for example in FILE_MAIN */
+ if (dir[0]=='.') { /* happens, for example in FILE_MAIN */
dir[0]= '/';
dir[1]= 0;
return;
}
/* support for odd paths: eg /../home/me --> /home/me
- * this is a valid path in blender but we cant handle this the useual way below
- * simply strip this prefix then evaluate the path as useual. pythons os.path.normpath() does this */
- while((strncmp(dir, "/../", 4)==0)) {
- memmove( dir, dir + 4, strlen(dir + 4) + 1 );
+ * this is a valid path in blender but we cant handle this the usual way below
+ * simply strip this prefix then evaluate the path as usual. pythons os.path.normpath() does this */
+ while ((strncmp(dir, "/../", 4)==0)) {
+ memmove(dir, dir + 4, strlen(dir + 4) + 1);
}
while ( (start = strstr(dir, "/../")) ) {
@@ -393,19 +396,20 @@ void BLI_cleanup_path(const char *relabase, char *dir)
}
if (a<0) {
break;
- } else {
- memmove( dir+a, eind, strlen(eind)+1 );
+ }
+ else {
+ memmove(dir+a, eind, strlen(eind) + 1);
}
}
while ( (start = strstr(dir,"/./")) ) {
eind = start + (3 - 1) /* strlen("/./") - 1 */;
- memmove( start, eind, strlen(eind)+1 );
+ memmove(start, eind, strlen(eind) + 1);
}
while ( (start = strstr(dir,"//" )) ) {
eind = start + (2 - 1) /* strlen("//") - 1 */;
- memmove( start, eind, strlen(eind)+1 );
+ memmove(start, eind, strlen(eind) + 1);
}
#endif
}
@@ -430,7 +434,7 @@ void BLI_path_rel(char *file, const char *relfile)
char res[FILE_MAX];
/* if file is already relative, bail out */
- if(file[0]=='/' && file[1]=='/') return;
+ if (file[0]=='/' && file[1]=='/') return;
/* also bail out if relative path is not set */
if (relfile[0] == 0) return;
@@ -439,14 +443,15 @@ 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] != '/') {
ptemp++;
}
BLI_strncpy(ptemp, relfile, FILE_MAX-3);
- } else {
+ }
+ else {
BLI_strncpy(temp, relfile, FILE_MAX);
}
@@ -468,10 +473,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;
@@ -482,7 +486,7 @@ void BLI_path_rel(char *file, const char *relfile)
#endif
{
++p; ++q;
- /* dont search beyond the end of the string
+ /* don't search beyond the end of the string
* in the rare case they match */
if ((*p=='\0') || (*q=='\0')) {
break;
@@ -490,8 +494,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 +506,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, "../");
@@ -548,7 +552,8 @@ int BLI_parent_dir(char *path)
if (!BLI_testextensie(tmp, parent_dir)) {
BLI_strncpy(path, tmp, sizeof(tmp));
return 1;
- } else {
+ }
+ else {
return 0;
}
}
@@ -560,8 +565,9 @@ static int stringframe_chars(char *path, int *char_start, int *char_end)
ch_sta = ch_end = 0;
for (i = 0; path[i] != '\0'; i++) {
if (path[i] == '\\' || path[i] == '/') {
- ch_end = 0; /* this is a directory name, dont use any hashes we found */
- } else if (path[i] == '#') {
+ ch_end = 0; /* this is a directory name, don't use any hashes we found */
+ }
+ else if (path[i] == '#') {
ch_sta = i;
ch_end = ch_sta+1;
while (path[ch_end] == '#') {
@@ -569,11 +575,11 @@ static int stringframe_chars(char *path, int *char_start, int *char_end)
}
i = ch_end-1; /* keep searching */
- /* dont break, there may be a slash after this that invalidates the previous #'s */
+ /* don't break, there may be a slash after this that invalidates the previous #'s */
}
}
- if(ch_end) {
+ if (ch_end) {
*char_start= ch_sta;
*char_end= ch_end;
return 1;
@@ -589,13 +595,13 @@ static void ensure_digits(char *path, int digits)
{
char *file= BLI_last_slash(path);
- if(file==NULL)
+ if (file==NULL)
file= path;
- if(strrchr(file, '#') == NULL) {
+ if (strrchr(file, '#') == NULL) {
int len= strlen(file);
- while(digits--) {
+ while (digits--) {
file[len++]= '#';
}
file[len]= '\0';
@@ -606,7 +612,7 @@ int BLI_path_frame(char *path, int frame, int digits)
{
int ch_sta, ch_end;
- if(digits)
+ if (digits)
ensure_digits(path, digits);
if (stringframe_chars(path, &ch_sta, &ch_end)) { /* warning, ch_end is the last # +1 */
@@ -622,7 +628,7 @@ int BLI_path_frame_range(char *path, int sta, int end, int digits)
{
int ch_sta, ch_end;
- if(digits)
+ if (digits)
ensure_digits(path, digits);
if (stringframe_chars(path, &ch_sta, &ch_end)) { /* warning, ch_end is the last # +1 */
@@ -646,9 +652,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);
@@ -681,20 +687,20 @@ int BLI_path_abs(char *path, const char *basepath)
BLI_strncpy(base, basepath, sizeof(base));
- /* file component is ignored, so dont bother with the trailing slash */
+ /* file component is ignored, so don't bother with the trailing slash */
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, '\\', '/');
/* Paths starting with // will get the blend file as their base,
- * this isnt standard in any os but is uesed in blender all over the place */
+ * this isn't standard in any os but is used in blender all over the place */
if (wasrelative) {
char *lslash= BLI_last_slash(base);
if (lslash) {
@@ -705,10 +711,12 @@ int BLI_path_abs(char *path, const char *basepath)
memcpy(tmp, base, baselen);
BLI_strncpy(tmp+baselen, path, sizeof(tmp)-baselen);
BLI_strncpy(path, tmp, FILE_MAX);
- } else {
+ }
+ else {
BLI_strncpy(path, tmp+2, FILE_MAX);
}
- } else {
+ }
+ else {
BLI_strncpy(path, tmp, FILE_MAX);
}
@@ -716,11 +724,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 +738,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 +755,19 @@ 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 isn't used */
if (cwd[0] == '\0') {
printf( "Could not get the current working directory - $PWD for an unknown reason.");
- } else {
+ }
+ 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 isn't 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);
@@ -778,7 +787,8 @@ void BLI_splitdirstring(char *di, char *fi)
if (lslash) {
BLI_strncpy(fi, lslash+1, FILE_MAXFILE);
*(lslash+1)=0;
- } else {
+ }
+ else {
BLI_strncpy(fi, di, FILE_MAXFILE);
di[0]= 0;
}
@@ -798,14 +808,15 @@ void BLI_getlastdir(const char* dir, char *last, const size_t maxlen)
}
if (prevslash) {
BLI_strncpy(last, prevslash+1, maxlen);
- } else {
+ }
+ else {
BLI_strncpy(last, dir, 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
@@ -825,10 +836,8 @@ const char *BLI_getDefaultDocumentFolder(void)
HRESULT hResult;
/* Check for %HOME% env var */
-
- ret = getenv("HOME");
- if(ret) {
- if (BLI_is_dir(ret)) return ret;
+ if (uput_getenv("HOME",documentfolder,MAXPATHLEN)) {
+ if (BLI_is_dir(documentfolder)) return documentfolder;
}
/* add user profile support for WIN 2K / NT.
@@ -838,8 +847,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;
}
@@ -864,11 +872,11 @@ static int test_path(char *targetpath, const char *path_base, const char *path_s
{
char tmppath[FILE_MAX];
- if(path_sep) BLI_join_dirfile(tmppath, sizeof(tmppath), path_base, path_sep);
+ if (path_sep) BLI_join_dirfile(tmppath, sizeof(tmppath), path_base, path_sep);
else BLI_strncpy(tmppath, path_base, sizeof(tmppath));
/* rare cases folder_name is omitted (when looking for ~/.blender/2.xx dir only) */
- if(folder_name)
+ if (folder_name)
BLI_make_file_string("/", targetpath, tmppath, folder_name);
else
BLI_strncpy(targetpath, tmppath, sizeof(tmppath));
@@ -896,7 +904,8 @@ static int test_env_path(char *path, const char *envvar)
if (BLI_is_dir(env)) {
BLI_strncpy(path, env, FILE_MAX);
return 1;
- } else {
+ }
+ else {
path[0] = '\0';
return 0;
}
@@ -910,10 +919,11 @@ static int get_path_local(char *targetpath, const char *folder_name, const char
printf("get_path_local...\n");
#endif
- if(folder_name) {
+ if (folder_name) {
if (subfolder_name) {
BLI_join_dirfile(relfolder, sizeof(relfolder), folder_name, subfolder_name);
- } else {
+ }
+ else {
BLI_strncpy(relfolder, folder_name, sizeof(relfolder));
}
}
@@ -922,7 +932,7 @@ static int get_path_local(char *targetpath, const char *folder_name, const char
}
/* try EXECUTABLE_DIR/2.5x/folder_name - new default directory for local blender installed files */
- if(test_path(targetpath, bprogdir, blender_version_decimal(ver), relfolder))
+ if (test_path(targetpath, bprogdir, blender_version_decimal(ver), relfolder))
return 1;
return 0;
@@ -951,7 +961,8 @@ static int get_path_user(char *targetpath, const char *folder_name, const char *
if (test_env_path(user_path, envvar)) {
if (subfolder_name) {
return test_path(targetpath, user_path, NULL, subfolder_name);
- } else {
+ }
+ else {
BLI_strncpy(targetpath, user_path, FILE_MAX);
return 1;
}
@@ -962,7 +973,7 @@ static int get_path_user(char *targetpath, const char *folder_name, const char *
BLI_snprintf(user_path, FILE_MAX, BLENDER_USER_FORMAT, user_base_path, blender_version_decimal(ver));
}
- if(!user_path[0])
+ if (!user_path[0])
return 0;
#ifdef PATH_DEBUG2
@@ -972,7 +983,8 @@ static int get_path_user(char *targetpath, const char *folder_name, const char *
if (subfolder_name) {
/* try $HOME/folder_name/subfolder_name */
return test_path(targetpath, user_path, folder_name, subfolder_name);
- } else {
+ }
+ else {
/* try $HOME/folder_name */
return test_path(targetpath, user_path, NULL, folder_name);
}
@@ -989,10 +1001,11 @@ static int get_path_system(char *targetpath, const char *folder_name, const char
char cwd[FILE_MAX];
char relfolder[FILE_MAX];
- if(folder_name) {
+ if (folder_name) {
if (subfolder_name) {
BLI_join_dirfile(relfolder, sizeof(relfolder), folder_name, subfolder_name);
- } else {
+ }
+ else {
BLI_strncpy(relfolder, folder_name, sizeof(relfolder));
}
}
@@ -1001,14 +1014,14 @@ static int get_path_system(char *targetpath, const char *folder_name, const char
}
/* try CWD/release/folder_name */
- if(BLI_current_working_dir(cwd, sizeof(cwd))) {
- if(test_path(targetpath, cwd, "release", relfolder)) {
+ if (BLI_current_working_dir(cwd, sizeof(cwd))) {
+ if (test_path(targetpath, cwd, "release", relfolder)) {
return 1;
}
}
/* try EXECUTABLE_DIR/release/folder_name */
- if(test_path(targetpath, bprogdir, "release", relfolder))
+ if (test_path(targetpath, bprogdir, "release", relfolder))
return 1;
/* end developer overrides */
@@ -1019,7 +1032,8 @@ static int get_path_system(char *targetpath, const char *folder_name, const char
if (test_env_path(system_path, envvar)) {
if (subfolder_name) {
return test_path(targetpath, system_path, NULL, subfolder_name);
- } else {
+ }
+ else {
BLI_strncpy(targetpath, system_path, FILE_MAX);
return 1;
}
@@ -1030,7 +1044,7 @@ static int get_path_system(char *targetpath, const char *folder_name, const char
BLI_snprintf(system_path, FILE_MAX, BLENDER_SYSTEM_FORMAT, system_base_path, blender_version_decimal(ver));
}
- if(!system_path[0])
+ if (!system_path[0])
return 0;
#ifdef PATH_DEBUG2
@@ -1040,7 +1054,8 @@ static int get_path_system(char *targetpath, const char *folder_name, const char
if (subfolder_name) {
/* try $BLENDERPATH/folder_name/subfolder_name */
return test_path(targetpath, system_path, folder_name, subfolder_name);
- } else {
+ }
+ else {
/* try $BLENDERPATH/folder_name */
return test_path(targetpath, system_path, NULL, folder_name);
}
@@ -1153,12 +1168,12 @@ 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");
}
- if((ok == FALSE) && do_check) {
+ if ((ok == FALSE) && do_check) {
return NULL;
}
@@ -1187,7 +1202,9 @@ void BLI_setenv(const char *env, const char*val)
/* non-free windows */
#elif (defined(WIN32) || defined(WIN64)) /* not free windows */
- _putenv_s(env, val);
+ uputenv(env, val);
+
+
#else
/* linux/osx/bsd */
setenv(env, val, 1);
@@ -1196,22 +1213,22 @@ 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)
{
- if(getenv(env) == NULL)
+ if (getenv(env) == NULL)
BLI_setenv(env, val);
}
void BLI_clean(char *path)
{
- if(path==NULL) return;
+ if (path==NULL) return;
#ifdef WIN32
- if(path && BLI_strnlen(path, 3) > 2) {
+ if (path && BLI_strnlen(path, 3) > 2) {
BLI_char_switch(path+2, '/', '\\');
}
#else
@@ -1221,7 +1238,7 @@ void BLI_clean(char *path)
void BLI_char_switch(char *string, char from, char to)
{
- if(string==NULL) return;
+ if (string==NULL) return;
while (*string != 0) {
if (*string == from) *string = to;
string++;
@@ -1288,13 +1305,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] == '/') {
@@ -1304,7 +1321,7 @@ void BLI_make_file_string(const char *relabase, char *string, const char *dir,
strcpy(string, relabase);
lslash= BLI_last_slash(string);
- if(lslash) *(lslash+1)= 0;
+ if (lslash) *(lslash+1)= 0;
dir+=2; /* Skip over the relative reference */
}
@@ -1360,11 +1377,13 @@ int BLI_testextensie(const char *str, const char *ext)
a= strlen(str);
b= strlen(ext);
- if(a==0 || b==0 || b>=a) {
+ if (a==0 || b==0 || b>=a) {
retval = 0;
- } else if (BLI_strcasecmp(ext, str + a - b)) {
+ }
+ else if (BLI_strcasecmp(ext, str + a - b)) {
retval = 0;
- } else {
+ }
+ else {
retval = 1;
}
@@ -1374,8 +1393,8 @@ int BLI_testextensie(const char *str, const char *ext)
int BLI_testextensie_array(const char *str, const char **ext_array)
{
int i=0;
- while(ext_array[i]) {
- if(BLI_testextensie(str, ext_array[i])) {
+ while (ext_array[i]) {
+ if (BLI_testextensie(str, ext_array[i])) {
return 1;
}
@@ -1391,11 +1410,11 @@ int BLI_testextensie_glob(const char *str, const char *ext_fnmatch)
const char *ext_step= ext_fnmatch;
char pattern[16];
- while(ext_step[0]) {
+ while (ext_step[0]) {
char *ext_next;
int len_ext;
- if((ext_next=strchr(ext_step, ';'))) {
+ if ((ext_next=strchr(ext_step, ';'))) {
len_ext= (int)(ext_next - ext_step) + 1;
}
else {
@@ -1404,7 +1423,7 @@ int BLI_testextensie_glob(const char *str, const char *ext_fnmatch)
BLI_strncpy(pattern, ext_step, len_ext);
- if(fnmatch(pattern, str, FNM_CASEFOLD)==0) {
+ if (fnmatch(pattern, str, FNM_CASEFOLD)==0) {
return 1;
}
ext_step += len_ext;
@@ -1420,7 +1439,7 @@ int BLI_replace_extension(char *path, size_t maxlen, const char *ext)
size_t ext_len= strlen(ext);
ssize_t a;
- for(a= path_len - 1; a >= 0; a--) {
+ for (a= path_len - 1; a >= 0; a--) {
if (ELEM3(path[a], '.', '/', '\\')) {
break;
}
@@ -1430,7 +1449,7 @@ int BLI_replace_extension(char *path, size_t maxlen, const char *ext)
a= path_len;
}
- if(a + ext_len >= maxlen)
+ if (a + ext_len >= maxlen)
return 0;
memcpy(path+a, ext, ext_len + 1);
@@ -1451,7 +1470,7 @@ int BLI_ensure_extension(char *path, size_t maxlen, const char *ext)
return 1;
}
- for(a= path_len - 1; a >= 0; a--) {
+ for (a= path_len - 1; a >= 0; a--) {
if (path[a] == '.') {
path[a]= '\0';
}
@@ -1461,7 +1480,7 @@ int BLI_ensure_extension(char *path, size_t maxlen, const char *ext)
}
a++;
- if(a + ext_len >= maxlen)
+ if (a + ext_len >= maxlen)
return 0;
memcpy(path+a, ext, ext_len + 1);
@@ -1481,7 +1500,7 @@ void BLI_split_dirfile(const char *string, char *dir, char *file, const size_t d
if (dir) {
if (lslash) {
- BLI_strncpy( dir, string, MIN2(dirlen, lslash + 1)); /* +1 to include the slash and the last char */
+ BLI_strncpy(dir, string, MIN2(dirlen, lslash + 1)); /* +1 to include the slash and the last char */
}
else {
dir[0] = '\0';
@@ -1509,7 +1528,7 @@ void BLI_join_dirfile(char *dst, const size_t maxlen, const char *dir, const cha
size_t dirlen= BLI_strnlen(dir, maxlen);
if (dst != dir) {
- if(dirlen == maxlen) {
+ if (dirlen == maxlen) {
memcpy(dst, dir, dirlen);
dst[dirlen - 1]= '\0';
return; /* dir fills the path */
@@ -1524,9 +1543,9 @@ void BLI_join_dirfile(char *dst, const size_t maxlen, const char *dir, const cha
}
/* inline BLI_add_slash */
- if (dst[dirlen - 1] != SEP) {
- dst[dirlen++]= SEP;
- dst[dirlen ]= '\0';
+ if ((dirlen > 0) && (dst[dirlen - 1] != SEP)) {
+ dst[dirlen++] = SEP;
+ dst[dirlen ] = '\0';
}
if (dirlen >= maxlen) {
@@ -1547,31 +1566,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 behaviour 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)
{
@@ -1638,7 +1657,7 @@ int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const
/* return 2 if src=dest */
if (BLI_path_cmp(path, dest_path) == 0) {
- // if (G.f & G_DEBUG) printf("%s and %s are the same file\n", path, dest_path);
+ // if (G.debug & G_DEBUG) printf("%s and %s are the same file\n", path, dest_path);
return 2;
}
@@ -1673,7 +1692,7 @@ char *BLI_last_slash(const char *string)
else return lfslash;
}
-/* adds a slash if there isnt one there already */
+/* adds a slash if there isn't one there already */
int BLI_add_slash(char *string)
{
int len = strlen(string);
@@ -1693,7 +1712,8 @@ void BLI_del_slash(char *string)
if (string[len-1] == SEP) {
string[len-1] = '\0';
len--;
- } else {
+ }
+ else {
break;
}
}
@@ -1720,7 +1740,8 @@ static int add_win32_extension(char *name)
ext[temp - extensions] = 0;
extensions = temp + 1;
strcat(filename, ext);
- } else {
+ }
+ else {
strcat(filename, extensions);
}
@@ -1733,25 +1754,26 @@ static int add_win32_extension(char *name)
} while (temp);
}
#endif
- } else {
+ }
+ else {
retval = 1;
}
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];
@@ -1775,24 +1797,30 @@ static void bli_where_am_i(char *fullname, const size_t maxlen, const char *name
#endif
#ifdef _WIN32
- if(GetModuleFileName(0, fullname, maxlen)) {
- if(!BLI_exists(fullname)) {
+ wchar_t * fullname_16 = MEM_mallocN(maxlen*sizeof(wchar_t), "ProgramPath");
+ if (GetModuleFileNameW(0, fullname_16, maxlen)) {
+ conv_utf_16_to_8(fullname_16,fullname, maxlen);
+ if (!BLI_exists(fullname)) {
printf("path can't be found: \"%.*s\"\n", maxlen, fullname);
MessageBox(NULL, "path contains invalid characters or is too long (see console)", "Error", MB_OK);
}
+ MEM_freeN(fullname_16);
return;
}
+
+ MEM_freeN(fullname_16);
#endif
/* unix and non linux */
if (name && name[0]) {
+
BLI_strncpy(fullname, name, maxlen);
if (name[0] == '.') {
char wdir[FILE_MAX]= "";
BLI_current_working_dir(wdir, sizeof(wdir)); /* backup cwd to restore after */
// not needed but avoids annoying /./ in name
- if(name[1]==SEP)
+ if (name[1]==SEP)
BLI_join_dirfile(fullname, maxlen, wdir, name+2);
else
BLI_join_dirfile(fullname, maxlen, wdir, name);
@@ -1803,7 +1831,8 @@ static void bli_where_am_i(char *fullname, const size_t maxlen, const char *name
// full path
BLI_strncpy(fullname, name, maxlen);
add_win32_extension(fullname);
- } else {
+ }
+ else {
// search for binary in $PATH
path = getenv("PATH");
if (path) {
@@ -1813,7 +1842,8 @@ static void bli_where_am_i(char *fullname, const size_t maxlen, const char *name
strncpy(filename, path, temp - path);
filename[temp - path] = 0;
path = temp + 1;
- } else {
+ }
+ else {
strncpy(filename, path, sizeof(filename));
}
BLI_join_dirfile(fullname, maxlen, fullname, name);
@@ -1849,15 +1879,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';
@@ -1893,11 +1923,12 @@ static void BLI_where_is_temp(char *fullname, const size_t maxlen, char *userdir
if (fullname[0] == '\0') {
BLI_strncpy(fullname, "/tmp/", maxlen);
- } else {
+ }
+ else {
/* add a trailing slash if needed */
BLI_add_slash(fullname);
#ifdef WIN32
- if(userdir && userdir != fullname) {
+ if (userdir && userdir != fullname) {
BLI_strncpy(userdir, fullname, maxlen); /* also set user pref to show %TEMP%. /tmp/ is just plain confusing for Windows users. */
}
#endif
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index 318cd15d2e9..e1b7ff120f9 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -37,6 +37,8 @@
#include "BKE_DerivedMesh.h"
#include "BKE_mesh.h" /* for mesh_calc_normals */
#include "BKE_global.h" /* for mesh_calc_normals */
+#include "BKE_paint.h"
+#include "BKE_subsurf.h"
#include "GPU_buffers.h"
@@ -63,52 +65,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. */
@@ -119,6 +121,8 @@ struct PBVHNode {
};
struct PBVH {
+ PBVHType type;
+
PBVHNode *nodes;
int node_mem_count, totnode;
@@ -136,11 +140,13 @@ struct PBVH {
DMGridData **grids;
DMGridAdjacency *gridadj;
void **gridfaces;
+ const DMFlagMat *grid_flag_mats;
int totgrid;
int gridsize;
+ BLI_bitmap *grid_hidden;
/* 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
@@ -180,7 +186,7 @@ static void BB_reset(BB *bb)
static void BB_expand(BB *bb, float co[3])
{
int i;
- for(i = 0; i < 3; ++i) {
+ for (i = 0; i < 3; ++i) {
bb->bmin[i] = MIN2(bb->bmin[i], co[i]);
bb->bmax[i] = MAX2(bb->bmax[i], co[i]);
}
@@ -190,7 +196,7 @@ static void BB_expand(BB *bb, float co[3])
static void BB_expand_with_bb(BB *bb, BB *bb2)
{
int i;
- for(i = 0; i < 3; ++i) {
+ for (i = 0; i < 3; ++i) {
bb->bmin[i] = MIN2(bb->bmin[i], bb2->bmin[i]);
bb->bmax[i] = MAX2(bb->bmax[i], bb2->bmax[i]);
}
@@ -202,17 +208,17 @@ static int BB_widest_axis(BB *bb)
float dim[3];
int i;
- for(i = 0; i < 3; ++i)
+ for (i = 0; i < 3; ++i)
dim[i] = bb->bmax[i] - bb->bmin[i];
- if(dim[0] > dim[1]) {
- if(dim[0] > dim[2])
+ if (dim[0] > dim[1]) {
+ if (dim[0] > dim[2])
return 0;
else
return 2;
}
else {
- if(dim[1] > dim[2])
+ if (dim[1] > dim[2])
return 1;
else
return 2;
@@ -222,7 +228,7 @@ static int BB_widest_axis(BB *bb)
static void BBC_update_centroid(BBC *bbc)
{
int i;
- for(i = 0; i < 3; ++i)
+ for (i = 0; i < 3; ++i)
bbc->bcentroid[i] = (bbc->bmin[i] + bbc->bmax[i]) * 0.5f;
}
@@ -233,7 +239,7 @@ static void update_node_vb(PBVH *bvh, PBVHNode *node)
BB_reset(&vb);
- if(node->flag & PBVH_Leaf) {
+ if (node->flag & PBVH_Leaf) {
PBVHVertexIter vd;
BLI_pbvh_vertex_iter_begin(bvh, node, vd, PBVH_ITER_ALL) {
@@ -261,6 +267,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 */
@@ -268,11 +285,11 @@ static int partition_indices(int *prim_indices, int lo, int hi, int axis,
float mid, BBC *prim_bbc)
{
int i=lo, j=hi;
- for(;;) {
- for(; prim_bbc[prim_indices[i]].bcentroid[axis] < mid; i++);
- for(; mid < prim_bbc[prim_indices[j]].bcentroid[axis]; j--);
+ for (;;) {
+ for (; prim_bbc[prim_indices[i]].bcentroid[axis] < mid; i++);
+ for (; mid < prim_bbc[prim_indices[j]].bcentroid[axis]; j--);
- if(!(i < j))
+ if (!(i < j))
return i;
SWAP(int, prim_indices[i], prim_indices[j]);
@@ -280,26 +297,44 @@ 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 (bvh->faces)
+ first = &faces[bvh->prim_indices[lo]];
+ else
+ first = &flagmats[bvh->prim_indices[lo]];
- if((i < index_of_2nd_partition && c > mid) ||
- (i > index_of_2nd_partition && c < mid)) {
- printf("fail\n");
+ 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++;
}
}
static void grow_nodes(PBVH *bvh, int totnode)
{
- if(totnode > bvh->node_mem_count) {
+ if (totnode > bvh->node_mem_count) {
PBVHNode *prev = bvh->nodes;
bvh->node_mem_count *= 1.33;
- if(bvh->node_mem_count < totnode)
+ if (bvh->node_mem_count < totnode)
bvh->node_mem_count = totnode;
bvh->nodes = MEM_callocN(sizeof(PBVHNode) * bvh->node_mem_count,
"bvh nodes");
@@ -311,15 +346,15 @@ 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)
{
void *value, *key = SET_INT_IN_POINTER(vertex);
- if(!BLI_ghash_haskey(map, key)) {
- if(BLI_BITMAP_GET(bvh->vert_bitmap, vertex)) {
+ if (!BLI_ghash_haskey(map, key)) {
+ if (BLI_BITMAP_GET(bvh->vert_bitmap, vertex)) {
value = SET_INT_IN_POINTER(~(*face_verts));
++(*face_verts);
}
@@ -351,11 +386,11 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
node->face_vert_indices = MEM_callocN(sizeof(int) * 4*totface,
"bvh node face vert indices");
- for(i = 0; i < totface; ++i) {
+ for (i = 0; i < totface; ++i) {
MFace *f = bvh->faces + node->prim_indices[i];
int sides = f->v4 ? 4 : 3;
- for(j = 0; j < sides; ++j) {
+ for (j = 0; j < sides; ++j) {
node->face_vert_indices[i][j]=
map_insert_vert(bvh, map, &node->face_verts,
&node->uniq_verts, (&f->v1)[j]);
@@ -367,13 +402,13 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
"bvh node vert indices");
/* Build the vertex list, unique verts first */
- for(iter = BLI_ghashIterator_new(map), i = 0;
+ for (iter = BLI_ghashIterator_new(map), i = 0;
!BLI_ghashIterator_isDone(iter);
BLI_ghashIterator_step(iter), ++i) {
void *value = BLI_ghashIterator_getValue(iter);
int ndx = GET_INT_FROM_POINTER(value);
- if(ndx < 0)
+ if (ndx < 0)
ndx = -ndx + node->uniq_verts - 1;
node->vert_indices[ndx] =
@@ -382,22 +417,22 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
BLI_ghashIterator_free(iter);
- for(i = 0; i < totface; ++i) {
+ for (i = 0; i < totface; ++i) {
MFace *f = bvh->faces + node->prim_indices[i];
int sides = f->v4 ? 4 : 3;
- for(j = 0; j < sides; ++j) {
- if(node->face_vert_indices[i][j] < 0)
+ for (j = 0; j < sides; ++j) {
+ if (node->face_vert_indices[i][j] < 0)
node->face_vert_indices[i][j]=
-node->face_vert_indices[i][j] +
node->uniq_verts - 1;
}
}
- if(!G.background) {
+ if (!G.background) {
node->draw_buffers =
GPU_build_mesh_buffers(node->face_vert_indices,
- bvh->faces,
+ bvh->faces, bvh->verts,
node->prim_indices,
node->totprim);
}
@@ -409,106 +444,151 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
static void build_grids_leaf_node(PBVH *bvh, PBVHNode *node)
{
- if(!G.background) {
+ if (!G.background) {
node->draw_buffers =
- GPU_build_grid_buffers(node->totprim, bvh->gridsize);
+ GPU_build_grid_buffers(node->prim_indices,
+ node->totprim, bvh->grid_hidden, bvh->gridsize);
}
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;
+}
- vb is the voxel box around all of the primitives contained in
- this node.
+static void build_leaf(PBVH *bvh, int node_index, BBC *prim_bbc,
+ int offset, int count)
+{
+ bvh->nodes[node_index].flag |= PBVH_Leaf;
- cb is the bounding box around all the centroids of the primitives
- contained in this node
+ bvh->nodes[node_index].prim_indices = bvh->prim_indices + offset;
+ bvh->nodes[node_index].totprim = count;
- offset and start indicate a range in the array of primitive indices
-*/
+ /* 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);
+}
+
+/* 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;
+
+ if (count <= 1)
+ return 0;
+
+ 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);
- if(!cb) {
+ /* 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)
+ 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)
{
int i;
- if(totprim != bvh->totprim) {
+ if (totprim != bvh->totprim) {
bvh->totprim = totprim;
- if(bvh->nodes) MEM_freeN(bvh->nodes);
- if(bvh->prim_indices) MEM_freeN(bvh->prim_indices);
+ if (bvh->nodes) MEM_freeN(bvh->nodes);
+ if (bvh->prim_indices) MEM_freeN(bvh->prim_indices);
bvh->prim_indices = MEM_callocN(sizeof(int) * totprim,
"bvh prim indices");
- for(i = 0; i < totprim; ++i)
+ for (i = 0; i < totprim; ++i)
bvh->prim_indices[i] = i;
bvh->totnode = 0;
- if(bvh->node_mem_count < 100) {
+ if (bvh->node_mem_count < 100) {
bvh->node_mem_count = 100;
bvh->nodes = MEM_callocN(sizeof(PBVHNode) *
bvh->node_mem_count,
@@ -527,6 +607,7 @@ void BLI_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int
BB cb;
int i, j;
+ bvh->type = PBVH_FACES;
bvh->faces = faces;
bvh->verts = verts;
bvh->vert_bitmap = BLI_BITMAP_NEW(totvert, "bvh->vert_bitmap");
@@ -538,14 +619,14 @@ void BLI_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int
/* For each face, store the AABB and the AABB centroid */
prim_bbc = MEM_mallocN(sizeof(BBC) * totface, "prim_bbc");
- for(i = 0; i < totface; ++i) {
+ for (i = 0; i < totface; ++i) {
MFace *f = faces + i;
const int sides = f->v4 ? 4 : 3;
BBC *bbc = prim_bbc + i;
BB_reset((BB*)bbc);
- for(j = 0; j < sides; ++j)
+ for (j = 0; j < sides; ++j)
BB_expand((BB*)bbc, verts[(&f->v1)[j]].co);
BBC_update_centroid(bbc);
@@ -553,7 +634,7 @@ void BLI_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int
BB_expand(&cb, bbc->bcentroid);
}
- if(totface)
+ if (totface)
pbvh_build(bvh, &cb, prim_bbc, totface);
MEM_freeN(prim_bbc);
@@ -562,17 +643,20 @@ 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, BLI_bitmap *grid_hidden)
{
BBC *prim_bbc = NULL;
BB cb;
int i, j;
+ bvh->type = PBVH_GRIDS;
bvh->grids= grids;
bvh->gridadj= gridadj;
bvh->gridfaces= gridfaces;
+ bvh->grid_flag_mats= flagmats;
bvh->totgrid= totgrid;
bvh->gridsize= gridsize;
+ bvh->grid_hidden= grid_hidden;
bvh->leaf_limit = MAX2(LEAF_LIMIT/((gridsize-1)*(gridsize-1)), 1);
BB_reset(&cb);
@@ -580,13 +664,13 @@ void BLI_pbvh_build_grids(PBVH *bvh, DMGridData **grids, DMGridAdjacency *gridad
/* For each grid, store the AABB and the AABB centroid */
prim_bbc = MEM_mallocN(sizeof(BBC) * totgrid, "prim_bbc");
- for(i = 0; i < totgrid; ++i) {
+ for (i = 0; i < totgrid; ++i) {
DMGridData *grid= grids[i];
BBC *bbc = prim_bbc + i;
BB_reset((BB*)bbc);
- for(j = 0; j < gridsize*gridsize; ++j)
+ for (j = 0; j < gridsize*gridsize; ++j)
BB_expand((BB*)bbc, grid[j].co);
BBC_update_centroid(bbc);
@@ -594,7 +678,7 @@ void BLI_pbvh_build_grids(PBVH *bvh, DMGridData **grids, DMGridAdjacency *gridad
BB_expand(&cb, bbc->bcentroid);
}
- if(totgrid)
+ if (totgrid)
pbvh_build(bvh, &cb, prim_bbc, totgrid);
MEM_freeN(prim_bbc);
@@ -612,15 +696,15 @@ void BLI_pbvh_free(PBVH *bvh)
PBVHNode *node;
int i;
- for(i = 0; i < bvh->totnode; ++i) {
+ for (i = 0; i < bvh->totnode; ++i) {
node= &bvh->nodes[i];
- if(node->flag & PBVH_Leaf) {
- if(node->draw_buffers)
+ if (node->flag & PBVH_Leaf) {
+ if (node->draw_buffers)
GPU_free_buffers(node->draw_buffers);
- if(node->vert_indices)
+ if (node->vert_indices)
MEM_freeN(node->vert_indices);
- if(node->face_vert_indices)
+ if (node->face_vert_indices)
MEM_freeN(node->face_vert_indices);
}
}
@@ -630,15 +714,15 @@ void BLI_pbvh_free(PBVH *bvh)
/* if pbvh was deformed, new memory was allocated for verts/faces -- free it */
MEM_freeN(bvh->verts);
- if(bvh->faces)
+ if (bvh->faces)
MEM_freeN(bvh->faces);
}
}
- if(bvh->nodes)
+ if (bvh->nodes)
MEM_freeN(bvh->nodes);
- if(bvh->prim_indices)
+ if (bvh->prim_indices)
MEM_freeN(bvh->prim_indices);
MEM_freeN(bvh);
@@ -660,20 +744,20 @@ static void pbvh_iter_begin(PBVHIter *iter, PBVH *bvh, BLI_pbvh_SearchCallback s
static void pbvh_iter_end(PBVHIter *iter)
{
- if(iter->stackspace > STACK_FIXED_DEPTH)
+ if (iter->stackspace > STACK_FIXED_DEPTH)
MEM_freeN(iter->stack);
}
static void pbvh_stack_push(PBVHIter *iter, PBVHNode *node, int revisiting)
{
- if(iter->stacksize == iter->stackspace) {
+ if (iter->stacksize == iter->stackspace) {
PBVHStack *newstack;
iter->stackspace *= 2;
newstack= MEM_callocN(sizeof(PBVHStack)*iter->stackspace, "PBVHStack");
memcpy(newstack, iter->stack, sizeof(PBVHStack)*iter->stacksize);
- if(iter->stackspace > STACK_FIXED_DEPTH)
+ if (iter->stackspace > STACK_FIXED_DEPTH)
MEM_freeN(iter->stack);
iter->stack= newstack;
}
@@ -689,28 +773,28 @@ 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) {
+ while (iter->stacksize) {
/* pop node */
iter->stacksize--;
node= iter->stack[iter->stacksize].node;
/* on a mesh with no faces this can happen
* can remove this check if we know meshes have at least 1 face */
- if(node==NULL)
+ if (node==NULL)
return NULL;
revisiting= iter->stack[iter->stacksize].revisiting;
/* revisiting node already checked */
- if(revisiting)
+ if (revisiting)
return node;
- if(iter->scb && !iter->scb(node, iter->search_data))
+ if (iter->scb && !iter->scb(node, iter->search_data))
continue; /* don't traverse, outside of search zone */
- if(node->flag & PBVH_Leaf) {
+ if (node->flag & PBVH_Leaf) {
/* immediately hit leaf node */
return node;
}
@@ -731,18 +815,18 @@ static PBVHNode *pbvh_iter_next_occluded(PBVHIter *iter)
{
PBVHNode *node;
- while(iter->stacksize) {
+ while (iter->stacksize) {
/* pop node */
iter->stacksize--;
node= iter->stack[iter->stacksize].node;
/* on a mesh with no faces this can happen
* can remove this check if we know meshes have at least 1 face */
- if(node==NULL) return NULL;
+ if (node==NULL) return NULL;
- if(iter->scb && !iter->scb(node, iter->search_data)) continue; /* don't traverse, outside of search zone */
+ if (iter->scb && !iter->scb(node, iter->search_data)) continue; /* don't traverse, outside of search zone */
- if(node->flag & PBVH_Leaf) {
+ if (node->flag & PBVH_Leaf) {
/* immediately hit leaf node */
return node;
}
@@ -765,14 +849,14 @@ void BLI_pbvh_search_gather(PBVH *bvh,
pbvh_iter_begin(&iter, bvh, scb, search_data);
- while((node=pbvh_iter_next(&iter))) {
- if(node->flag & PBVH_Leaf) {
- if(tot == space) {
+ while ((node=pbvh_iter_next(&iter))) {
+ if (node->flag & PBVH_Leaf) {
+ if (tot == space) {
/* resize array if needed */
space= (tot == 0)? 32: space*2;
newarray= MEM_callocN(sizeof(PBVHNode)*space, "PBVHNodeSearch");
- if(array) {
+ if (array) {
memcpy(newarray, array, sizeof(PBVHNode)*tot);
MEM_freeN(array);
}
@@ -787,7 +871,7 @@ void BLI_pbvh_search_gather(PBVH *bvh,
pbvh_iter_end(&iter);
- if(tot == 0 && array) {
+ if (tot == 0 && array) {
MEM_freeN(array);
array= NULL;
}
@@ -805,7 +889,7 @@ void BLI_pbvh_search_callback(PBVH *bvh,
pbvh_iter_begin(&iter, bvh, scb, search_data);
- while((node=pbvh_iter_next(&iter)))
+ while ((node=pbvh_iter_next(&iter)))
if (node->flag & PBVH_Leaf)
hcb(node, hit_data);
@@ -878,8 +962,8 @@ static void BLI_pbvh_search_callback_occluded(PBVH *bvh,
pbvh_iter_begin(&iter, bvh, scb, search_data);
- while((node=pbvh_iter_next_occluded(&iter))) {
- if(node->flag & PBVH_Leaf) {
+ while ((node=pbvh_iter_next_occluded(&iter))) {
+ if (node->flag & PBVH_Leaf) {
node_tree* new_node = malloc(sizeof(node_tree));
new_node->data = node;
@@ -909,7 +993,7 @@ static int update_search_cb(PBVHNode *node, void *data_v)
{
int flag= GET_INT_FROM_POINTER(data_v);
- if(node->flag & PBVH_Leaf)
+ if (node->flag & PBVH_Leaf)
return (node->flag & flag);
return 1;
@@ -921,52 +1005,52 @@ static void pbvh_update_normals(PBVH *bvh, PBVHNode **nodes,
float (*vnor)[3];
int n;
- if(bvh->grids)
+ if (bvh->type != PBVH_FACES)
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++) {
+ for (n = 0; n < totnode; n++) {
PBVHNode *node= nodes[n];
- if((node->flag & PBVH_UpdateNormals)) {
+ if ((node->flag & PBVH_UpdateNormals)) {
int i, j, totface, *faces;
faces= node->prim_indices;
totface= node->totprim;
- for(i = 0; i < totface; ++i) {
+ for (i = 0; i < totface; ++i) {
MFace *f= bvh->faces + faces[i];
float fn[3];
unsigned int *fv = &f->v1;
int sides= (f->v4)? 4: 3;
- if(f->v4)
+ if (f->v4)
normal_quad_v3(fn, bvh->verts[f->v1].co, bvh->verts[f->v2].co,
bvh->verts[f->v3].co, bvh->verts[f->v4].co);
else
normal_tri_v3(fn, bvh->verts[f->v1].co, bvh->verts[f->v2].co,
bvh->verts[f->v3].co);
- for(j = 0; j < sides; ++j) {
+ for (j = 0; j < sides; ++j) {
int v= fv[j];
- if(bvh->verts[v].flag & ME_VERT_PBVH_UPDATE) {
+ 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
@@ -976,27 +1060,27 @@ static void pbvh_update_normals(PBVH *bvh, PBVHNode **nodes,
}
}
- if(face_nors)
+ if (face_nors)
copy_v3_v3(face_nors[faces[i]], fn);
}
}
}
#pragma omp parallel for private(n) schedule(static)
- for(n = 0; n < totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHNode *node= nodes[n];
- if(node->flag & PBVH_UpdateNormals) {
+ if (node->flag & PBVH_UpdateNormals) {
int i, *verts, totvert;
verts= node->vert_indices;
totvert= node->uniq_verts;
- for(i = 0; i < totvert; ++i) {
+ for (i = 0; i < totvert; ++i) {
const int v = verts[i];
MVert *mvert= &bvh->verts[v];
- if(mvert->flag & ME_VERT_PBVH_UPDATE) {
+ if (mvert->flag & ME_VERT_PBVH_UPDATE) {
float no[3];
copy_v3_v3(no, vnor[v]);
@@ -1024,46 +1108,65 @@ static void pbvh_update_BB_redraw(PBVH *bvh, PBVHNode **nodes,
/* update BB, redraw flag */
#pragma omp parallel for private(n) schedule(static)
- for(n = 0; n < totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHNode *node= nodes[n];
- if((flag & PBVH_UpdateBB) && (node->flag & PBVH_UpdateBB))
+ if ((flag & PBVH_UpdateBB) && (node->flag & PBVH_UpdateBB))
/* don't clear flag yet, leave it for flushing later */
update_node_vb(bvh, node);
- if((flag & PBVH_UpdateOriginalBB) && (node->flag & PBVH_UpdateOriginalBB))
+ if ((flag & PBVH_UpdateOriginalBB) && (node->flag & PBVH_UpdateOriginalBB))
node->orig_vb= node->vb;
- if((flag & PBVH_UpdateRedraw) && (node->flag & PBVH_UpdateRedraw))
+ if ((flag & PBVH_UpdateRedraw) && (node->flag & PBVH_UpdateRedraw))
node->flag &= ~PBVH_UpdateRedraw;
}
}
-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;
/* can't be done in parallel with OpenGL */
- for(n = 0; n < totnode; n++) {
+ for (n = 0; n < totnode; n++) {
node= nodes[n];
- if(node->flag & PBVH_UpdateDrawBuffers) {
- if(bvh->grids) {
+ if (node->flag & PBVH_RebuildDrawBuffers) {
+ GPU_free_buffers(node->draw_buffers);
+ if (bvh->grids) {
+ node->draw_buffers =
+ GPU_build_grid_buffers(node->prim_indices,
+ node->totprim, bvh->grid_hidden, bvh->gridsize);
+ }
+ else {
+ node->draw_buffers =
+ GPU_build_mesh_buffers(node->face_vert_indices,
+ bvh->faces, bvh->verts,
+ node->prim_indices,
+ node->totprim);
+ }
+
+ node->flag &= ~PBVH_RebuildDrawBuffers;
+ }
+
+ if (node->flag & PBVH_UpdateDrawBuffers) {
+ switch(bvh->type) {
+ case PBVH_GRIDS:
GPU_update_grid_buffers(node->draw_buffers,
bvh->grids,
+ bvh->grid_flag_mats,
node->prim_indices,
node->totprim,
- bvh->gridsize,
- smooth);
- }
- else {
+ bvh->gridsize);
+ break;
+ case PBVH_FACES:
GPU_update_mesh_buffers(node->draw_buffers,
bvh->verts,
node->vert_indices,
node->uniq_verts +
- node->face_verts,
- smooth);
+ node->face_verts);
+ break;
}
node->flag &= ~PBVH_UpdateDrawBuffers;
@@ -1076,13 +1179,13 @@ static int pbvh_flush_bb(PBVH *bvh, PBVHNode *node, int flag)
int update= 0;
/* difficult to multithread well, we just do single threaded recursive */
- if(node->flag & PBVH_Leaf) {
- if(flag & PBVH_UpdateBB) {
+ if (node->flag & PBVH_Leaf) {
+ if (flag & PBVH_UpdateBB) {
update |= (node->flag & PBVH_UpdateBB);
node->flag &= ~PBVH_UpdateBB;
}
- if(flag & PBVH_UpdateOriginalBB) {
+ if (flag & PBVH_UpdateOriginalBB) {
update |= (node->flag & PBVH_UpdateOriginalBB);
node->flag &= ~PBVH_UpdateOriginalBB;
}
@@ -1093,9 +1196,9 @@ static int pbvh_flush_bb(PBVH *bvh, PBVHNode *node, int flag)
update |= pbvh_flush_bb(bvh, bvh->nodes + node->children_offset, flag);
update |= pbvh_flush_bb(bvh, bvh->nodes + node->children_offset + 1, flag);
- if(update & PBVH_UpdateBB)
+ if (update & PBVH_UpdateBB)
update_node_vb(bvh, node);
- if(update & PBVH_UpdateOriginalBB)
+ if (update & PBVH_UpdateOriginalBB)
node->orig_vb= node->vb;
}
@@ -1107,22 +1210,22 @@ void BLI_pbvh_update(PBVH *bvh, int flag, float (*face_nors)[3])
PBVHNode **nodes;
int totnode;
- if(!bvh->nodes)
+ if (!bvh->nodes)
return;
BLI_pbvh_search_gather(bvh, update_search_cb, SET_INT_IN_POINTER(flag),
&nodes, &totnode);
- if(flag & PBVH_UpdateNormals)
+ if (flag & PBVH_UpdateNormals)
pbvh_update_normals(bvh, nodes, totnode, face_nors);
- if(flag & (PBVH_UpdateBB|PBVH_UpdateOriginalBB|PBVH_UpdateRedraw))
+ if (flag & (PBVH_UpdateBB|PBVH_UpdateOriginalBB|PBVH_UpdateRedraw))
pbvh_update_BB_redraw(bvh, nodes, totnode, flag);
- if(flag & (PBVH_UpdateBB|PBVH_UpdateOriginalBB))
+ if (flag & (PBVH_UpdateBB|PBVH_UpdateOriginalBB))
pbvh_flush_bb(bvh, bvh->nodes, flag);
- if(nodes) MEM_freeN(nodes);
+ if (nodes) MEM_freeN(nodes);
}
void BLI_pbvh_redraw_BB(PBVH *bvh, float bb_min[3], float bb_max[3])
@@ -1135,8 +1238,8 @@ void BLI_pbvh_redraw_BB(PBVH *bvh, float bb_min[3], float bb_max[3])
pbvh_iter_begin(&iter, bvh, NULL, NULL);
- while((node=pbvh_iter_next(&iter)))
- if(node->flag & PBVH_UpdateRedraw)
+ while ((node=pbvh_iter_next(&iter)))
+ if (node->flag & PBVH_UpdateRedraw)
BB_expand_with_bb(&bb, &node->vb);
pbvh_iter_end(&iter);
@@ -1159,15 +1262,15 @@ void BLI_pbvh_get_grid_updates(PBVH *bvh, int clear, void ***gridfaces, int *tot
pbvh_iter_begin(&iter, bvh, NULL, NULL);
- while((node=pbvh_iter_next(&iter))) {
- if(node->flag & PBVH_UpdateNormals) {
- for(i = 0; i < node->totprim; ++i) {
+ while ((node=pbvh_iter_next(&iter))) {
+ if (node->flag & PBVH_UpdateNormals) {
+ for (i = 0; i < node->totprim; ++i) {
face= bvh->gridfaces[node->prim_indices[i]];
- if(!BLI_ghash_lookup(map, face))
+ if (!BLI_ghash_lookup(map, face))
BLI_ghash_insert(map, face, face);
}
- if(clear)
+ if (clear)
node->flag &= ~PBVH_UpdateNormals;
}
}
@@ -1175,7 +1278,7 @@ void BLI_pbvh_get_grid_updates(PBVH *bvh, int clear, void ***gridfaces, int *tot
pbvh_iter_end(&iter);
tot= BLI_ghash_size(map);
- if(tot == 0) {
+ if (tot == 0) {
*totface= 0;
*gridfaces= NULL;
BLI_ghash_free(map, NULL, NULL);
@@ -1184,7 +1287,7 @@ void BLI_pbvh_get_grid_updates(PBVH *bvh, int clear, void ***gridfaces, int *tot
faces= MEM_callocN(sizeof(void*)*tot, "PBVH Grid Faces");
- for(hiter = BLI_ghashIterator_new(map), i = 0;
+ for (hiter = BLI_ghashIterator_new(map), i = 0;
!BLI_ghashIterator_isDone(hiter);
BLI_ghashIterator_step(hiter), ++i)
faces[i]= BLI_ghashIterator_getKey(hiter);
@@ -1197,6 +1300,19 @@ void BLI_pbvh_get_grid_updates(PBVH *bvh, int clear, void ***gridfaces, int *tot
*gridfaces= faces;
}
+/***************************** PBVH Access ***********************************/
+
+PBVHType BLI_pbvh_type(const PBVH *bvh)
+{
+ return bvh->type;
+}
+
+BLI_bitmap *BLI_pbvh_grid_hidden(const PBVH *bvh)
+{
+ BLI_assert(bvh->type == PBVH_GRIDS);
+ return bvh->grid_hidden;
+}
+
/***************************** Node Access ***********************************/
void BLI_pbvh_node_mark_update(PBVHNode *node)
@@ -1204,42 +1320,63 @@ void BLI_pbvh_node_mark_update(PBVHNode *node)
node->flag |= PBVH_UpdateNormals|PBVH_UpdateBB|PBVH_UpdateOriginalBB|PBVH_UpdateDrawBuffers|PBVH_UpdateRedraw;
}
+void BLI_pbvh_node_mark_rebuild_draw(PBVHNode *node)
+{
+ node->flag |= PBVH_RebuildDrawBuffers|PBVH_UpdateDrawBuffers|PBVH_UpdateRedraw;
+}
+
+void BLI_pbvh_node_fully_hidden_set(PBVHNode *node, int fully_hidden)
+{
+ BLI_assert(node->flag & PBVH_Leaf);
+
+ if (fully_hidden)
+ node->flag |= PBVH_FullyHidden;
+ else
+ node->flag &= ~PBVH_FullyHidden;
+}
+
void BLI_pbvh_node_get_verts(PBVH *bvh, PBVHNode *node, int **vert_indices, MVert **verts)
{
- if(vert_indices) *vert_indices= node->vert_indices;
- if(verts) *verts= bvh->verts;
+ if (vert_indices) *vert_indices= node->vert_indices;
+ if (verts) *verts= bvh->verts;
}
void BLI_pbvh_node_num_verts(PBVH *bvh, PBVHNode *node, int *uniquevert, int *totvert)
{
- if(bvh->grids) {
- const int tot= node->totprim*bvh->gridsize*bvh->gridsize;
- if(totvert) *totvert= tot;
- if(uniquevert) *uniquevert= tot;
- }
- else {
- if(totvert) *totvert= node->uniq_verts + node->face_verts;
- if(uniquevert) *uniquevert= node->uniq_verts;
+ int tot;
+
+ switch(bvh->type) {
+ case PBVH_GRIDS:
+ tot= node->totprim*bvh->gridsize*bvh->gridsize;
+ if (totvert) *totvert= tot;
+ if (uniquevert) *uniquevert= tot;
+ break;
+ case PBVH_FACES:
+ if (totvert) *totvert= node->uniq_verts + node->face_verts;
+ if (uniquevert) *uniquevert= node->uniq_verts;
+ break;
}
}
void BLI_pbvh_node_get_grids(PBVH *bvh, PBVHNode *node, int **grid_indices, int *totgrid, int *maxgrid, int *gridsize, DMGridData ***griddata, DMGridAdjacency **gridadj)
{
- if(bvh->grids) {
- if(grid_indices) *grid_indices= node->prim_indices;
- if(totgrid) *totgrid= node->totprim;
- if(maxgrid) *maxgrid= bvh->totgrid;
- if(gridsize) *gridsize= bvh->gridsize;
- if(griddata) *griddata= bvh->grids;
- if(gridadj) *gridadj= bvh->gridadj;
- }
- else {
- if(grid_indices) *grid_indices= NULL;
- if(totgrid) *totgrid= 0;
- if(maxgrid) *maxgrid= 0;
- if(gridsize) *gridsize= 0;
- if(griddata) *griddata= NULL;
- if(gridadj) *gridadj= NULL;
+ switch(bvh->type) {
+ case PBVH_GRIDS:
+ if (grid_indices) *grid_indices= node->prim_indices;
+ if (totgrid) *totgrid= node->totprim;
+ if (maxgrid) *maxgrid= bvh->totgrid;
+ if (gridsize) *gridsize= bvh->gridsize;
+ if (griddata) *griddata= bvh->grids;
+ if (gridadj) *gridadj= bvh->gridadj;
+ break;
+ case PBVH_FACES:
+ if (grid_indices) *grid_indices= NULL;
+ if (totgrid) *totgrid= 0;
+ if (maxgrid) *maxgrid= 0;
+ if (gridsize) *gridsize= 0;
+ if (griddata) *griddata= NULL;
+ if (gridadj) *gridadj= NULL;
+ break;
}
}
@@ -1284,7 +1421,7 @@ static int ray_aabb_intersect(PBVHNode *node, void *data_v)
float bbox[2][3];
float tmin, tmax, tymin, tymax, tzmin, tzmax;
- if(ray->original)
+ if (ray->original)
BLI_pbvh_node_get_original_BB(node, bbox[0], bbox[1]);
else
BLI_pbvh_node_get_BB(node, bbox[0], bbox[1]);
@@ -1295,22 +1432,22 @@ static int ray_aabb_intersect(PBVHNode *node, void *data_v)
tymin = (bbox[ray->sign[1]][1] - ray->start[1]) * ray->inv_dir[1];
tymax = (bbox[1-ray->sign[1]][1] - ray->start[1]) * ray->inv_dir[1];
- if((tmin > tymax) || (tymin > tmax))
+ if ((tmin > tymax) || (tymin > tmax))
return 0;
- if(tymin > tmin)
+ if (tymin > tmin)
tmin = tymin;
- if(tymax < tmax)
+ if (tymax < tmax)
tmax = tymax;
tzmin = (bbox[ray->sign[2]][2] - ray->start[2]) * ray->inv_dir[2];
tzmax = (bbox[1-ray->sign[2]][2] - ray->start[2]) * ray->inv_dir[2];
- if((tmin > tzmax) || (tzmin > tmax))
+ if ((tmin > tzmax) || (tzmin > tmax))
return 0;
- if(tzmin > tmin)
+ if (tzmin > tmin)
tmin = tzmin;
// XXX jwilkins: tmax does not need to be updated since we don't use it
@@ -1359,19 +1496,28 @@ static int ray_face_intersection(float ray_start[3], float ray_normal[3],
int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
float ray_start[3], float ray_normal[3], float *dist)
{
- int hit= 0;
+ MVert *vert;
+ BLI_bitmap gh;
+ int *faces, totface, gridsize, totgrid;
+ int i, x, y, hit= 0;
- if(bvh->faces) {
- MVert *vert = bvh->verts;
- int *faces= node->prim_indices;
- int totface= node->totprim;
- int i;
+ if (node->flag & PBVH_FullyHidden)
+ return 0;
- for(i = 0; i < totface; ++i) {
- MFace *f = bvh->faces + faces[i];
+ switch(bvh->type) {
+ case PBVH_FACES:
+ vert = bvh->verts;
+ faces= node->prim_indices;
+ totface= node->totprim;
+
+ for (i = 0; i < totface; ++i) {
+ const MFace *f = bvh->faces + faces[i];
int *face_verts = node->face_vert_indices[i];
- if(origco) {
+ if (paint_is_face_hidden(f, vert))
+ continue;
+
+ if (origco) {
/* intersect with backuped original coordinates */
hit |= ray_face_intersection(ray_start, ray_normal,
origco[face_verts[0]],
@@ -1390,20 +1536,27 @@ int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
dist);
}
}
- }
- else {
- int totgrid= node->totprim;
- int gridsize= bvh->gridsize;
- int i, x, y;
+ break;
+ case PBVH_GRIDS:
+ totgrid= node->totprim;
+ gridsize= bvh->gridsize;
- for(i = 0; i < totgrid; ++i) {
+ for (i = 0; i < totgrid; ++i) {
DMGridData *grid= bvh->grids[node->prim_indices[i]];
if (!grid)
continue;
- for(y = 0; y < gridsize-1; ++y) {
- for(x = 0; x < gridsize-1; ++x) {
- if(origco) {
+ gh= bvh->grid_hidden[node->prim_indices[i]];
+
+ for (y = 0; y < gridsize-1; ++y) {
+ for (x = 0; x < gridsize-1; ++x) {
+ /* check if grid face is hidden */
+ if (gh) {
+ if (paint_is_grid_face_hidden(gh, gridsize, x, y))
+ continue;
+ }
+
+ if (origco) {
hit |= ray_face_intersection(ray_start, ray_normal,
origco[y*gridsize + x],
origco[y*gridsize + x+1],
@@ -1422,9 +1575,10 @@ int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
}
}
- if(origco)
+ if (origco)
origco += gridsize*gridsize;
}
+ break;
}
return hit;
@@ -1432,60 +1586,87 @@ 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 */
float col[3]; int i;
- if(0) { //is_partial) {
+ if (0) { //is_partial) {
col[0] = (rand() / (float)RAND_MAX); col[1] = col[2] = 0.6;
}
else {
srand((long long)node);
- for(i = 0; i < 3; ++i)
+ for (i = 0; i < 3; ++i)
col[i] = (rand() / (float)RAND_MAX) * 0.3 + 0.7;
}
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, col);
glColor3f(1, 0, 0);
#endif
- GPU_draw_buffers(node->draw_buffers);
+
+ if (!(node->flag & PBVH_FullyHidden))
+ GPU_draw_buffers(node->draw_buffers, setMaterial);
}
+typedef enum {
+ ISECT_INSIDE,
+ ISECT_OUTSIDE,
+ ISECT_INTERSECT
+} PlaneAABBIsect;
+
/* 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.
-*/
-int BLI_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data)
+ * 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.
+ */
+static PlaneAABBIsect test_planes_aabb(const float bb_min[3],
+ const float bb_max[3],
+ const float (*planes)[4])
{
- float (*planes)[4] = data;
+ float vmin[3], vmax[3];
+ PlaneAABBIsect ret = ISECT_INSIDE;
int i, axis;
- float vmin[3] /*, vmax[3]*/, bb_min[3], bb_max[3];
-
- BLI_pbvh_node_get_BB(node, bb_min, bb_max);
-
- for(i = 0; i < 4; ++i) {
- for(axis = 0; axis < 3; ++axis) {
- if(planes[i][axis] > 0) {
+
+ for (i = 0; i < 4; ++i) {
+ for (axis = 0; axis < 3; ++axis) {
+ if (planes[i][axis] > 0) {
vmin[axis] = bb_min[axis];
- /*vmax[axis] = bb_max[axis];*/ /*UNUSED*/
+ vmax[axis] = bb_max[axis];
}
else {
vmin[axis] = bb_max[axis];
- /*vmax[axis] = bb_min[axis];*/ /*UNUSED*/
+ vmax[axis] = bb_min[axis];
}
}
- if(dot_v3v3(planes[i], vmin) + planes[i][3] > 0)
- return 0;
+ if (dot_v3v3(planes[i], vmin) + planes[i][3] > 0)
+ return ISECT_OUTSIDE;
+ else if (dot_v3v3(planes[i], vmax) + planes[i][3] >= 0)
+ ret = ISECT_INTERSECT;
}
- return 1;
+ return ret;
}
-void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3], int smooth)
+int BLI_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data)
+{
+ float bb_min[3], bb_max[3];
+
+ BLI_pbvh_node_get_BB(node, bb_min, bb_max);
+ return test_planes_aabb(bb_min, bb_max, data) != ISECT_OUTSIDE;
+}
+
+int BLI_pbvh_node_planes_exclude_AABB(PBVHNode *node, void *data)
+{
+ float bb_min[3], bb_max[3];
+
+ BLI_pbvh_node_get_BB(node, bb_min, bb_max);
+ return test_planes_aabb(bb_min, bb_max, data) != ISECT_INSIDE;
+}
+
+void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3],
+ DMSetMaterial setMaterial)
{
PBVHNode **nodes;
int totnode;
@@ -1494,16 +1675,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 (nodes) MEM_freeN(nodes);
- if(planes) {
+ 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);
}
}
@@ -1631,8 +1812,8 @@ void BLI_pbvh_gather_proxies(PBVH* pbvh, PBVHNode*** r_array, int* r_tot)
for (n= 0; n < pbvh->totnode; n++) {
node = pbvh->nodes + n;
- if(node->proxy_count > 0) {
- if(tot == space) {
+ if (node->proxy_count > 0) {
+ if (tot == space) {
/* resize array if needed */
space= (tot == 0)? 32: space*2;
newarray= MEM_callocN(sizeof(PBVHNode)*space, "BLI_pbvh_gather_proxies");
@@ -1650,7 +1831,7 @@ void BLI_pbvh_gather_proxies(PBVH* pbvh, PBVHNode*** r_array, int* r_tot)
}
}
- if(tot == 0 && array) {
+ if (tot == 0 && array) {
MEM_freeN(array);
array= NULL;
}
@@ -1681,10 +1862,14 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node,
vi->totgrid= (grids)? totgrid: 1;
vi->gridsize= gridsize;
- if(mode == PBVH_ITER_ALL)
+ if (mode == PBVH_ITER_ALL)
vi->totvert = totvert;
else
vi->totvert= uniq_verts;
vi->vert_indices= vert_indices;
vi->mverts= verts;
+
+ vi->gh= NULL;
+ if (vi->grids && mode == PBVH_ITER_UNIQUE)
+ vi->grid_hidden= bvh->grid_hidden;
}
diff --git a/source/blender/blenlib/intern/rand.c b/source/blender/blenlib/intern/rand.c
index 28dc5a696d5..20f0a11f75f 100644
--- a/source/blender/blenlib/intern/rand.c
+++ b/source/blender/blenlib/intern/rand.c
@@ -111,11 +111,17 @@ float rng_getFloat(RNG *rng)
void rng_shuffleArray(RNG *rng, void *data, int elemSize, int numElems)
{
int i = numElems;
- void *temp = malloc(elemSize);
+ void *temp;
+
+ if (numElems <= 0) {
+ return;
+ }
+
+ temp = malloc(elemSize);
while (--i) {
int j = rng_getInt(rng)%numElems;
- if(i!=j) {
+ if (i!=j) {
void *iElem = (unsigned char*)data + i*elemSize;
void *jElem = (unsigned char*)data + j*elemSize;
memcpy(temp, iElem, elemSize);
@@ -131,7 +137,7 @@ void rng_skip(RNG *rng, int n)
{
int i;
- for(i=0; i<n; i++)
+ for (i=0; i<n; i++)
rng_getInt(rng);
}
@@ -189,7 +195,7 @@ static RNG rng_tab[BLENDER_MAX_THREADS];
void BLI_thread_srandom(int thread, unsigned int seed)
{
- if(thread >= BLENDER_MAX_THREADS)
+ if (thread >= BLENDER_MAX_THREADS)
thread= 0;
rng_seed(&rng_tab[thread], seed + hash[seed & 255]);
diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c
index 3b9fd2e07f6..d3bb5a1b17f 100644
--- a/source/blender/blenlib/intern/rct.c
+++ b/source/blender/blenlib/intern/rct.c
@@ -1,12 +1,4 @@
/*
- *
- * rct.c
- *
- * april 95
- *
- *
- * A minimalist lib for functions doing stuff with rectangle structs.
- *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -36,6 +28,8 @@
/** \file blender/blenlib/intern/rct.c
* \ingroup bli
+ *
+ * A minimalist lib for functions doing stuff with rectangle structs.
*/
#include <stdio.h>
@@ -46,91 +40,85 @@
int BLI_rcti_is_empty(rcti * rect)
{
- return ((rect->xmax<=rect->xmin) ||
- (rect->ymax<=rect->ymin));
+ return ((rect->xmax <= rect->xmin) || (rect->ymax <= rect->ymin));
}
int BLI_rctf_is_empty(rctf * rect)
{
- return ((rect->xmax<=rect->xmin) ||
- (rect->ymax<=rect->ymin));
+ return ((rect->xmax <= rect->xmin) || (rect->ymax <= rect->ymin));
}
int BLI_in_rcti(rcti * rect, int x, int y)
{
-
- if(x<rect->xmin) return 0;
- if(x>rect->xmax) return 0;
- if(y<rect->ymin) return 0;
- if(y>rect->ymax) return 0;
+ if (x < rect->xmin) return 0;
+ if (x > rect->xmax) return 0;
+ if (y < rect->ymin) return 0;
+ if (y > rect->ymax) return 0;
return 1;
}
int BLI_in_rctf(rctf *rect, float x, float y)
{
-
- if(x<rect->xmin) return 0;
- if(x>rect->xmax) return 0;
- if(y<rect->ymin) return 0;
- if(y>rect->ymax) return 0;
+ if (x < rect->xmin) return 0;
+ if (x > rect->xmax) return 0;
+ if (y < rect->ymin) return 0;
+ if (y > rect->ymax) return 0;
return 1;
}
void BLI_union_rctf(rctf *rct1, rctf *rct2)
{
-
- if(rct1->xmin>rct2->xmin) rct1->xmin= rct2->xmin;
- if(rct1->xmax<rct2->xmax) rct1->xmax= rct2->xmax;
- if(rct1->ymin>rct2->ymin) rct1->ymin= rct2->ymin;
- if(rct1->ymax<rct2->ymax) rct1->ymax= rct2->ymax;
+ if (rct1->xmin > rct2->xmin) rct1->xmin = rct2->xmin;
+ if (rct1->xmax < rct2->xmax) rct1->xmax = rct2->xmax;
+ if (rct1->ymin > rct2->ymin) rct1->ymin = rct2->ymin;
+ if (rct1->ymax < rct2->ymax) rct1->ymax = rct2->ymax;
}
void BLI_union_rcti(rcti *rct1, rcti *rct2)
{
-
- if(rct1->xmin>rct2->xmin) rct1->xmin= rct2->xmin;
- if(rct1->xmax<rct2->xmax) rct1->xmax= rct2->xmax;
- if(rct1->ymin>rct2->ymin) rct1->ymin= rct2->ymin;
- if(rct1->ymax<rct2->ymax) rct1->ymax= rct2->ymax;
+ if (rct1->xmin > rct2->xmin) rct1->xmin = rct2->xmin;
+ if (rct1->xmax < rct2->xmax) rct1->xmax = rct2->xmax;
+ if (rct1->ymin > rct2->ymin) rct1->ymin = rct2->ymin;
+ if (rct1->ymax < rct2->ymax) rct1->ymax = rct2->ymax;
}
void BLI_init_rctf(rctf *rect, float xmin, float xmax, float ymin, float ymax)
{
- if(xmin <= xmax) {
- rect->xmin= xmin;
- rect->xmax= xmax;
+ if (xmin <= xmax) {
+ rect->xmin = xmin;
+ rect->xmax = xmax;
}
else {
- rect->xmax= xmin;
- rect->xmin= xmax;
+ rect->xmax = xmin;
+ rect->xmin = xmax;
}
- if(ymin <= ymax) {
- rect->ymin= ymin;
- rect->ymax= ymax;
+ if (ymin <= ymax) {
+ rect->ymin = ymin;
+ rect->ymax = ymax;
}
else {
- rect->ymax= ymin;
- rect->ymin= ymax;
+ rect->ymax = ymin;
+ rect->ymin = ymax;
}
}
void BLI_init_rcti(rcti *rect, int xmin, int xmax, int ymin, int ymax)
{
- if(xmin <= xmax) {
- rect->xmin= xmin;
- rect->xmax= xmax;
+ if (xmin <= xmax) {
+ rect->xmin = xmin;
+ rect->xmax = xmax;
}
else {
- rect->xmax= xmin;
- rect->xmin= xmax;
+ rect->xmax = xmin;
+ rect->xmin = xmax;
}
- if(ymin <= ymax) {
- rect->ymin= ymin;
- rect->ymax= ymax;
+ if (ymin <= ymax) {
+ rect->ymin = ymin;
+ rect->ymax = ymax;
}
else {
- rect->ymax= ymin;
- rect->ymin= ymax;
+ rect->ymax = ymin;
+ rect->ymin = ymax;
}
}
@@ -152,22 +140,22 @@ void BLI_translate_rctf(rctf *rect, float x, float y)
/* change width & height around the central location */
void BLI_resize_rcti(rcti *rect, int x, int y)
{
- rect->xmin= rect->xmax= (rect->xmax + rect->xmin) / 2;
- rect->ymin= rect->ymax= (rect->ymax + rect->ymin) / 2;
+ rect->xmin = rect->xmax = (rect->xmax + rect->xmin) / 2;
+ rect->ymin = rect->ymax = (rect->ymax + rect->ymin) / 2;
rect->xmin -= x / 2;
rect->ymin -= y / 2;
- rect->xmax= rect->xmin + x;
- rect->ymax= rect->ymin + y;
+ rect->xmax = rect->xmin + x;
+ rect->ymax = rect->ymin + y;
}
void BLI_resize_rctf(rctf *rect, float x, float y)
{
- rect->xmin= rect->xmax= (rect->xmax + rect->xmin) * 0.5f;
- rect->ymin= rect->ymax= (rect->ymax + rect->ymin) * 0.5f;
+ rect->xmin = rect->xmax = (rect->xmax + rect->xmin) * 0.5f;
+ rect->ymin = rect->ymax = (rect->ymax + rect->ymin) * 0.5f;
rect->xmin -= x * 0.5f;
rect->ymin -= y * 0.5f;
- rect->xmax= rect->xmin + x;
- rect->ymax= rect->ymin + y;
+ rect->xmax = rect->xmin + x;
+ rect->ymax = rect->ymin + y;
}
int BLI_isect_rctf(rctf *src1, rctf *src2, rctf *dest)
@@ -179,9 +167,9 @@ int BLI_isect_rctf(rctf *src1, rctf *src2, rctf *dest)
xmax = (src1->xmax) < (src2->xmax) ? (src1->xmax) : (src2->xmax);
ymin = (src1->ymin) > (src2->ymin) ? (src1->ymin) : (src2->ymin);
ymax = (src1->ymax) < (src2->ymax) ? (src1->ymax) : (src2->ymax);
-
- if(xmax>=xmin && ymax>=ymin) {
- if(dest) {
+
+ if (xmax >= xmin && ymax >= ymin) {
+ if (dest) {
dest->xmin = xmin;
dest->xmax = xmax;
dest->ymin = ymin;
@@ -190,7 +178,7 @@ int BLI_isect_rctf(rctf *src1, rctf *src2, rctf *dest)
return 1;
}
else {
- if(dest) {
+ if (dest) {
dest->xmin = 0;
dest->xmax = 0;
dest->ymin = 0;
@@ -204,14 +192,14 @@ int BLI_isect_rcti(rcti *src1, rcti *src2, rcti *dest)
{
int xmin, xmax;
int ymin, ymax;
-
+
xmin = (src1->xmin) > (src2->xmin) ? (src1->xmin) : (src2->xmin);
xmax = (src1->xmax) < (src2->xmax) ? (src1->xmax) : (src2->xmax);
ymin = (src1->ymin) > (src2->ymin) ? (src1->ymin) : (src2->ymin);
ymax = (src1->ymax) < (src2->ymax) ? (src1->ymax) : (src2->ymax);
-
- if(xmax>=xmin && ymax>=ymin) {
- if(dest) {
+
+ if (xmax >= xmin && ymax >= ymin) {
+ if (dest) {
dest->xmin = xmin;
dest->xmax = xmax;
dest->ymin = ymin;
@@ -220,7 +208,7 @@ int BLI_isect_rcti(rcti *src1, rcti *src2, rcti *dest)
return 1;
}
else {
- if(dest) {
+ if (dest) {
dest->xmin = 0;
dest->xmax = 0;
dest->ymin = 0;
@@ -232,18 +220,20 @@ int BLI_isect_rcti(rcti *src1, rcti *src2, rcti *dest)
void BLI_copy_rcti_rctf(rcti *tar, const rctf *src)
{
- tar->xmin= floor(src->xmin + 0.5f);
- tar->xmax= floor((src->xmax - src->xmin) + 0.5f);
- tar->ymin= floor(src->ymin + 0.5f);
- tar->ymax= floor((src->ymax - src->ymin) + 0.5f);
+ tar->xmin = floor(src->xmin + 0.5f);
+ tar->xmax = floor((src->xmax - src->xmin) + 0.5f);
+ tar->ymin = floor(src->ymin + 0.5f);
+ tar->ymax = floor((src->ymax - src->ymin) + 0.5f);
}
void print_rctf(const char *str, rctf *rect)
{
- printf("%s: xmin %.3f, xmax %.3f, ymin %.3f, ymax %.3f (%.3fx%.3f)\n", str, rect->xmin, rect->xmax, rect->ymin, rect->ymax, rect->xmax - rect->xmin, rect->ymax - rect->ymin);
+ printf("%s: xmin %.3f, xmax %.3f, ymin %.3f, ymax %.3f (%.3fx%.3f)\n", str,
+ rect->xmin, rect->xmax, rect->ymin, rect->ymax, rect->xmax - rect->xmin, rect->ymax - rect->ymin);
}
void print_rcti(const char *str, rcti *rect)
{
- printf("%s: xmin %d, xmax %d, ymin %d, ymax %d (%dx%d)\n", str, rect->xmin, rect->xmax, rect->ymin, rect->ymax, rect->xmax - rect->xmin, rect->ymax - rect->ymin);
+ printf("%s: xmin %d, xmax %d, ymin %d, ymax %d (%dx%d)\n", str,
+ rect->xmin, rect->xmax, rect->ymin, rect->ymax, rect->xmax - rect->xmin, rect->ymax - rect->ymin);
}
diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c
index b828ae052f8..641d0373a64 100644
--- a/source/blender/blenlib/intern/scanfill.c
+++ b/source/blender/blenlib/intern/scanfill.c
@@ -72,7 +72,8 @@ static int callLocalInterruptCallBack(void)
{
if (BLI_localInterruptCallBack) {
return BLI_localInterruptCallBack();
- } else {
+ }
+ else {
return 0;
}
}
@@ -110,10 +111,10 @@ static int vergscdata(const void *a1, const void *a2)
{
const ScanFillVertLink *x1=a1,*x2=a2;
- if( x1->v1->co[coy] < x2->v1->co[coy] ) return 1;
- else if( x1->v1->co[coy] > x2->v1->co[coy]) return -1;
- else if( x1->v1->co[cox] > x2->v1->co[cox] ) return 1;
- else if( x1->v1->co[cox] < x2->v1->co[cox]) return -1;
+ if ( x1->v1->co[coy] < x2->v1->co[coy] ) return 1;
+ else if ( x1->v1->co[coy] > x2->v1->co[coy]) return -1;
+ else if ( x1->v1->co[cox] > x2->v1->co[cox] ) return 1;
+ else if ( x1->v1->co[cox] < x2->v1->co[cox]) return -1;
return 0;
}
@@ -122,10 +123,10 @@ static int vergpoly(const void *a1, const void *a2)
{
const PolyFill *x1=a1, *x2=a2;
- if( x1->min[cox] > x2->min[cox] ) return 1;
- else if( x1->min[cox] < x2->min[cox] ) return -1;
- else if( x1->min[coy] > x2->min[coy] ) return 1;
- else if( x1->min[coy] < x2->min[coy] ) return -1;
+ if ( x1->min[cox] > x2->min[cox] ) return 1;
+ else if ( x1->min[cox] < x2->min[cox] ) return -1;
+ else if ( x1->min[coy] > x2->min[coy] ) return 1;
+ else if ( x1->min[coy] < x2->min[coy] ) return -1;
return 0;
}
@@ -139,9 +140,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 */
@@ -153,7 +154,7 @@ static void *mem_element_new(int size)
size = (size + 3 ) & ~3; /* allocate in units of 4 */
- if(melem__cur && (size + melem__offs < MEM_ELEM_BLOCKSIZE)) {
+ if (melem__cur && (size + melem__offs < MEM_ELEM_BLOCKSIZE)) {
void *adr= (void *) (melem__cur->data+melem__offs);
melem__offs+= size;
return adr;
@@ -171,13 +172,13 @@ static void mem_element_reset(int keep_first)
{
struct mem_elements *first;
- if((first= melem__lb.first)) { /* can be false if first fill fails */
+ if ((first= melem__lb.first)) { /* can be false if first fill fails */
if (keep_first) {
BLI_remlink(&melem__lb, first);
}
melem__cur= melem__lb.first;
- while(melem__cur) {
+ while (melem__cur) {
MEM_freeN(melem__cur->data);
melem__cur= melem__cur->next;
}
@@ -261,20 +262,20 @@ static int boundisect(PolyFill *pf2, PolyFill *pf1)
/* has pf2 been touched (intersected) by pf1 ? with bounding box */
/* test first if polys exist */
- if(pf1->edges==0 || pf2->edges==0) return 0;
+ if (pf1->edges==0 || pf2->edges==0) return 0;
- if(pf2->max[cox] < pf1->min[cox] ) return 0;
- if(pf2->max[coy] < pf1->min[coy] ) return 0;
+ if (pf2->max[cox] < pf1->min[cox] ) return 0;
+ if (pf2->max[coy] < pf1->min[coy] ) return 0;
- if(pf2->min[cox] > pf1->max[cox] ) return 0;
- if(pf2->min[coy] > pf1->max[coy] ) return 0;
+ if (pf2->min[cox] > pf1->max[cox] ) return 0;
+ if (pf2->min[coy] > pf1->max[coy] ) return 0;
/* join */
- if(pf2->max[cox]<pf1->max[cox]) pf2->max[cox]= pf1->max[cox];
- if(pf2->max[coy]<pf1->max[coy]) pf2->max[coy]= pf1->max[coy];
+ if (pf2->max[cox]<pf1->max[cox]) pf2->max[cox]= pf1->max[cox];
+ if (pf2->max[coy]<pf1->max[coy]) pf2->max[coy]= pf1->max[coy];
- if(pf2->min[cox]>pf1->min[cox]) pf2->min[cox]= pf1->min[cox];
- if(pf2->min[coy]>pf1->min[coy]) pf2->min[coy]= pf1->min[coy];
+ if (pf2->min[cox]>pf1->min[cox]) pf2->min[cox]= pf1->min[cox];
+ if (pf2->min[coy]>pf1->min[coy]) pf2->min[coy]= pf1->min[coy];
return 1;
}
@@ -287,12 +288,12 @@ static void mergepolysSimp(PolyFill *pf1, PolyFill *pf2) /* add pf2 to pf1 */
/* replace old poly numbers */
eve= fillvertbase.first;
- while(eve) {
- if(eve->poly_nr == pf2->nr) eve->poly_nr = pf1->nr;
+ while (eve) {
+ if (eve->poly_nr == pf2->nr) eve->poly_nr = pf1->nr;
eve= eve->next;
}
eed= filledgebase.first;
- while(eed) {
+ while (eed) {
if (eed->poly_nr == pf2->nr) eed->poly_nr = pf1->nr;
eed= eed->next;
}
@@ -311,10 +312,10 @@ static short testedgeside(const float v1[3], const float v2[3], const float v3[3
inp= (v2[cox]-v1[cox])*(v1[coy]-v3[coy])
+(v1[coy]-v2[coy])*(v1[cox]-v3[cox]);
- if(inp < 0.0f) return 0;
- else if(inp==0) {
- if(v1[cox]==v3[cox] && v1[coy]==v3[coy]) return 0;
- if(v2[cox]==v3[cox] && v2[coy]==v3[coy]) return 0;
+ if (inp < 0.0f) return 0;
+ else if (inp==0) {
+ if (v1[cox]==v3[cox] && v1[coy]==v3[coy]) return 0;
+ if (v2[cox]==v3[cox] && v2[coy]==v3[coy]) return 0;
}
return 1;
}
@@ -325,7 +326,7 @@ static short addedgetoscanvert(ScanFillVertLink *sc, ScanFillEdge *eed)
ScanFillEdge *ed;
float fac,fac1,x,y;
- if(sc->first==0) {
+ if (sc->first==0) {
sc->first= sc->last= eed;
eed->prev= eed->next=0;
return 1;
@@ -335,28 +336,28 @@ static short addedgetoscanvert(ScanFillVertLink *sc, ScanFillEdge *eed)
y= eed->v1->co[coy];
fac1= eed->v2->co[coy]-y;
- if(fac1==0.0f) {
+ if (fac1==0.0f) {
fac1= 1.0e10f*(eed->v2->co[cox]-x);
}
else fac1= (x-eed->v2->co[cox])/fac1;
ed= sc->first;
- while(ed) {
+ while (ed) {
- if(ed->v2==eed->v2) return 0;
+ if (ed->v2==eed->v2) return 0;
fac= ed->v2->co[coy]-y;
- if(fac==0.0f) {
+ if (fac==0.0f) {
fac= 1.0e10f*(ed->v2->co[cox]-x);
}
else fac= (x-ed->v2->co[cox])/fac;
- if(fac>fac1) break;
+ if (fac>fac1) break;
ed= ed->next;
}
- if(ed) BLI_insertlinkbefore((ListBase *)&(sc->first), ed, eed);
+ if (ed) BLI_insertlinkbefore((ListBase *)&(sc->first), ed, eed);
else BLI_addtail((ListBase *)&(sc->first),eed);
return 1;
@@ -371,14 +372,14 @@ static ScanFillVertLink *addedgetoscanlist(ScanFillEdge *eed, int len)
ScanFillVert *eve;
/* which vert is left-top? */
- if(eed->v1->co[coy] == eed->v2->co[coy]) {
- if(eed->v1->co[cox] > eed->v2->co[cox]) {
+ if (eed->v1->co[coy] == eed->v2->co[coy]) {
+ if (eed->v1->co[cox] > eed->v2->co[cox]) {
eve= eed->v1;
eed->v1= eed->v2;
eed->v2= eve;
}
}
- else if(eed->v1->co[coy] < eed->v2->co[coy]) {
+ else if (eed->v1->co[coy] < eed->v2->co[coy]) {
eve= eed->v1;
eed->v1= eed->v2;
eed->v2= eve;
@@ -388,8 +389,8 @@ static ScanFillVertLink *addedgetoscanlist(ScanFillEdge *eed, int len)
sc= (ScanFillVertLink *)bsearch(&scsearch,scdata,len,
sizeof(ScanFillVertLink), vergscdata);
- if(sc==0) printf("Error in search edge: %p\n", (void *)eed);
- else if(addedgetoscanvert(sc,eed)==0) return sc;
+ if (sc==0) printf("Error in search edge: %p\n", (void *)eed);
+ else if (addedgetoscanvert(sc,eed)==0) return sc;
return 0;
}
@@ -399,22 +400,24 @@ static short boundinsideEV(ScanFillEdge *eed, ScanFillVert *eve)
{
float minx,maxx,miny,maxy;
- if(eed->v1->co[cox]<eed->v2->co[cox]) {
+ if (eed->v1->co[cox]<eed->v2->co[cox]) {
minx= eed->v1->co[cox];
maxx= eed->v2->co[cox];
- } else {
+ }
+ else {
minx= eed->v2->co[cox];
maxx= eed->v1->co[cox];
}
- if(eve->co[cox]>=minx && eve->co[cox]<=maxx) {
- if(eed->v1->co[coy]<eed->v2->co[coy]) {
+ if (eve->co[cox]>=minx && eve->co[cox]<=maxx) {
+ if (eed->v1->co[coy]<eed->v2->co[coy]) {
miny= eed->v1->co[coy];
maxy= eed->v2->co[coy];
- } else {
+ }
+ else {
miny= eed->v2->co[coy];
maxy= eed->v1->co[coy];
}
- if(eve->co[coy]>=miny && eve->co[coy]<=maxy) return 1;
+ if (eve->co[coy]>=miny && eve->co[coy]<=maxy) return 1;
}
return 0;
}
@@ -423,37 +426,37 @@ 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;
float dist,vec1[2],vec2[2],vec3[2];
eve= fillvertbase.first;
- while(eve) {
- if(eve->h==1) {
+ while (eve) {
+ if (eve->h==1) {
vec3[0]= eve->co[cox];
vec3[1]= eve->co[coy];
/* find the edge which has vertex eve */
ed1= filledgebase.first;
- while(ed1) {
- if(ed1->v1==eve || ed1->v2==eve) break;
+ while (ed1) {
+ if (ed1->v1==eve || ed1->v2==eve) break;
ed1= ed1->next;
}
- if(ed1->v1==eve) {
+ if (ed1->v1==eve) {
ed1->v1= ed1->v2;
ed1->v2= eve;
}
eed= filledgebase.first;
- while(eed) {
+ while (eed) {
if (eve != eed->v1 && eve != eed->v2 && eve->poly_nr == eed->poly_nr) {
- if(compare_v3v3(eve->co,eed->v1->co, COMPLIMIT)) {
+ if (compare_v3v3(eve->co,eed->v1->co, COMPLIMIT)) {
ed1->v2= eed->v1;
eed->v1->h++;
eve->h= 0;
break;
}
- else if(compare_v3v3(eve->co,eed->v2->co, COMPLIMIT)) {
+ else if (compare_v3v3(eve->co,eed->v2->co, COMPLIMIT)) {
ed1->v2= eed->v2;
eed->v2->h++;
eve->h= 0;
@@ -464,9 +467,9 @@ static void testvertexnearedge(void)
vec1[1]= eed->v1->co[coy];
vec2[0]= eed->v2->co[cox];
vec2[1]= eed->v2->co[coy];
- if(boundinsideEV(eed,eve)) {
+ if (boundinsideEV(eed,eve)) {
dist= dist_to_line_v2(vec1,vec2,vec3);
- if(dist<(float)COMPLIMIT) {
+ if (dist<(float)COMPLIMIT) {
/* new edge */
ed1= BLI_addfilledge(eed->v1, eve);
@@ -497,7 +500,7 @@ static void splitlist(ListBase *tempve, ListBase *temped, short nr)
BLI_movelisttolist(temped,&filledgebase);
eve= tempve->first;
- while(eve) {
+ while (eve) {
nextve= eve->next;
if (eve->poly_nr == nr) {
BLI_remlink(tempve,eve);
@@ -506,9 +509,9 @@ static void splitlist(ListBase *tempve, ListBase *temped, short nr)
eve= nextve;
}
eed= temped->first;
- while(eed) {
+ while (eed) {
nexted= eed->next;
- if(eed->poly_nr==nr) {
+ if (eed->poly_nr==nr) {
BLI_remlink(temped,eed);
BLI_addtail(&filledgebase,eed);
}
@@ -528,33 +531,35 @@ static int scanfill(PolyFill *pf)
nr= pf->nr;
- /* PRINTS
+ /* PRINTS */
+#if 0
verts= pf->verts;
eve= fillvertbase.first;
- while(eve) {
+ while (eve) {
printf("vert: %x co: %f %f\n",eve,eve->co[cox],eve->co[coy]);
eve= eve->next;
}
eed= filledgebase.first;
- while(eed) {
+ 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;
- while(eed) {
- if(eed->v1->co[cox]==eed->v2->co[cox]) {
- if(eed->v1->co[coy]==eed->v2->co[coy]) {
- if(eed->v1->f==255 && eed->v2->f!=255) {
+ while (eed) {
+ if (eed->v1->co[cox]==eed->v2->co[cox]) {
+ if (eed->v1->co[coy]==eed->v2->co[coy]) {
+ if (eed->v1->f==255 && eed->v2->f!=255) {
eed->v2->f= 255;
eed->v2->tmp.v= eed->v1->tmp.v;
}
- else if(eed->v2->f==255 && eed->v1->f!=255) {
+ else if (eed->v2->f==255 && eed->v1->f!=255) {
eed->v1->f= 255;
eed->v1->tmp.v= eed->v2->tmp.v;
}
- else if(eed->v2->f==255 && eed->v1->f==255) {
+ else if (eed->v2->f==255 && eed->v1->f==255) {
eed->v1->tmp.v= eed->v2->tmp.v;
}
else {
@@ -567,12 +572,12 @@ 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;
- while(eve) {
+ while (eve) {
if (eve->poly_nr == nr) {
if (eve->f != 255) {
verts++;
@@ -587,103 +592,105 @@ static int scanfill(PolyFill *pf)
qsort(scdata, verts, sizeof(ScanFillVertLink), vergscdata);
eed= filledgebase.first;
- while(eed) {
+ while (eed) {
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. */
- if(eed->v1->f==255) {
+ * 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))
+ while ((eed->v1->f == 255) && (eed->v1->tmp.v != v1))
eed->v1 = eed->v1->tmp.v;
}
- if(eed->v2->f==255) {
+ if (eed->v2->f==255) {
v2= eed->v2;
- while((eed->v2->f == 255) && (eed->v2->tmp.v != v2))
+ while ((eed->v2->f == 255) && (eed->v2->tmp.v != v2))
eed->v2 = eed->v2->tmp.v;
}
- if(eed->v1!=eed->v2) addedgetoscanlist(eed,verts);
+ if (eed->v1!=eed->v2) addedgetoscanlist(eed,verts);
eed= nexted;
}
- /*
+#if 0
sc= scdata;
- for(a=0;a<verts;a++) {
+ for (a=0;a<verts;a++) {
printf("\nscvert: %x\n",sc->v1);
eed= sc->first;
- while(eed) {
+ while (eed) {
printf(" ed %x %x %x\n",eed,eed->v1,eed->v2);
eed= eed->next;
}
sc++;
- }*/
+ }
+#endif
/* STEP 2: FILL LOOP */
- if(pf->f==0) twoconnected= 1;
+ if (pf->f==0) twoconnected= 1;
/* (temporal) security: never much more faces than vertices */
totface= 0;
maxface= 2*verts; /* 2*verts: based at a filled circle within a triangle */
sc= scdata;
- for(a=0;a<verts;a++) {
+ for (a=0;a<verts;a++) {
/* printf("VERTEX %d %x\n",a,sc->v1); */
ed1= sc->first;
- while(ed1) { /* set connectflags */
+ while (ed1) { /* set connectflags */
nexted= ed1->next;
- if(ed1->v1->h==1 || ed1->v2->h==1) {
+ if (ed1->v1->h==1 || ed1->v2->h==1) {
BLI_remlink((ListBase *)&(sc->first),ed1);
BLI_addtail(&filledgebase,ed1);
- if(ed1->v1->h>1) ed1->v1->h--;
- if(ed1->v2->h>1) ed1->v2->h--;
+ if (ed1->v1->h>1) ed1->v1->h--;
+ if (ed1->v2->h>1) ed1->v2->h--;
}
else ed1->v2->f= 1;
ed1= nexted;
}
- while(sc->first) { /* for as long there are edges */
+ while (sc->first) { /* for as long there are edges */
ed1= sc->first;
ed2= ed1->next;
/* commented out... the ESC here delivers corrupted memory (and doesnt work during grab) */
- /* if(callLocalInterruptCallBack()) break; */
- if(totface>maxface) {
+ /* if (callLocalInterruptCallBack()) break; */
+ if (totface>maxface) {
/* printf("Fill error: endless loop. Escaped at vert %d, tot: %d.\n", a, verts); */
a= verts;
break;
}
- if(ed2==0) {
+ if (ed2==0) {
sc->first=sc->last= 0;
/* printf("just 1 edge to vert\n"); */
BLI_addtail(&filledgebase,ed1);
ed1->v2->f= 0;
ed1->v1->h--;
ed1->v2->h--;
- } else {
+ }
+ else {
/* test rest of vertices */
v1= ed1->v2;
v2= ed1->v1;
v3= ed2->v2;
/* this happens with a serial of overlapping edges */
- if(v1==v2 || v2==v3) break;
+ if (v1==v2 || v2==v3) break;
/* printf("test verts %x %x %x\n",v1,v2,v3); */
miny = ( (v1->co[coy])<(v3->co[coy]) ? (v1->co[coy]) : (v3->co[coy]) );
/* miny= MIN2(v1->co[coy],v3->co[coy]); */
sc1= sc+1;
test= 0;
- for(b=a+1;b<verts;b++) {
- if(sc1->v1->f==0) {
- if(sc1->v1->co[coy] <= miny) break;
+ for (b=a+1;b<verts;b++) {
+ if (sc1->v1->f==0) {
+ if (sc1->v1->co[coy] <= miny) break;
- if(testedgeside(v1->co,v2->co,sc1->v1->co))
- if(testedgeside(v2->co,v3->co,sc1->v1->co))
- if(testedgeside(v3->co,v1->co,sc1->v1->co)) {
+ if (testedgeside(v1->co,v2->co,sc1->v1->co))
+ if (testedgeside(v2->co,v3->co,sc1->v1->co))
+ if (testedgeside(v3->co,v1->co,sc1->v1->co)) {
/* point in triangle */
test= 1;
@@ -692,7 +699,7 @@ static int scanfill(PolyFill *pf)
}
sc1++;
}
- if(test) {
+ if (test) {
/* make new edge, and start over */
/* printf("add new edge %x %x and start again\n",v2,sc1->v1); */
@@ -715,7 +722,7 @@ static int scanfill(PolyFill *pf)
ed1->v1->h--;
ed1->v2->h--;
/* ed2 can be removed when it's a boundary edge */
- if((ed2->f == 0 && twoconnected) || (ed2->f == FILLBOUNDARY)) {
+ if ((ed2->f == 0 && twoconnected) || (ed2->f == FILLBOUNDARY)) {
BLI_remlink((ListBase *)&(sc->first),ed2);
BLI_addtail(&filledgebase,ed2);
ed2->v2->f= 0;
@@ -733,14 +740,14 @@ static int scanfill(PolyFill *pf)
/* printf("add new edge %x %x\n",v1,v3); */
sc1= addedgetoscanlist(ed3, verts);
- if(sc1) { /* ed3 already exists: remove if a boundary */
+ if (sc1) { /* ed3 already exists: remove if a boundary */
/* printf("Edge exists\n"); */
ed3->v1->h--;
ed3->v2->h--;
ed3= sc1->first;
- while(ed3) {
- if( (ed3->v1==v1 && ed3->v2==v3) || (ed3->v1==v3 && ed3->v2==v1) ) {
+ while (ed3) {
+ if ( (ed3->v1==v1 && ed3->v2==v3) || (ed3->v1==v3 && ed3->v2==v1) ) {
if (twoconnected || ed3->f==FILLBOUNDARY) {
BLI_remlink((ListBase *)&(sc1->first),ed3);
BLI_addtail(&filledgebase,ed3);
@@ -757,13 +764,13 @@ static int scanfill(PolyFill *pf)
}
/* test for loose edges */
ed1= sc->first;
- while(ed1) {
+ while (ed1) {
nexted= ed1->next;
- if(ed1->v1->h<2 || ed1->v2->h<2) {
+ if (ed1->v1->h<2 || ed1->v2->h<2) {
BLI_remlink((ListBase *)&(sc->first),ed1);
BLI_addtail(&filledgebase,ed1);
- if(ed1->v1->h>1) ed1->v1->h--;
- if(ed1->v2->h>1) ed1->v2->h--;
+ if (ed1->v1->h>1) ed1->v1->h--;
+ if (ed1->v2->h>1) ed1->v2->h--;
}
ed1= nexted;
@@ -788,13 +795,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;
@@ -806,7 +813,7 @@ int BLI_edgefill(short mat_nr)
/* reset variables */
eve= fillvertbase.first;
a = 0;
- while(eve) {
+ while (eve) {
eve->f= 0;
eve->poly_nr= 0;
eve->h= 0;
@@ -819,7 +826,8 @@ int BLI_edgefill(short mat_nr)
addfillface(eve, eve->next, eve->next->next);
return 1;
- } else if (a == 4 && (mat_nr & 2)) {
+ }
+ else if (a == 4 && (mat_nr & 2)) {
float vec1[3], vec2[3];
eve = fillvertbase.first;
@@ -829,14 +837,16 @@ 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{
+ }
+ else {
addfillface(eve->next, eve->next->next, eve->next->next->next);
addfillface(eve->next->next->next, eve, eve->next);
}
- } else {
+ }
+ else {
addfillface(eve, eve->next, eve->next->next);
addfillface(eve->next->next, eve->next->next->next, eve);
}
@@ -846,7 +856,7 @@ int BLI_edgefill(short mat_nr)
/* first test vertices if they are in edges */
/* including resetting of flags */
eed= filledgebase.first;
- while(eed) {
+ while (eed) {
eed->poly_nr= 0;
eed->v1->f= 1;
eed->v2->f= 1;
@@ -855,54 +865,53 @@ int BLI_edgefill(short mat_nr)
}
eve= fillvertbase.first;
- while(eve) {
- if(eve->f & 1) {
+ while (eve) {
+ if (eve->f & 1) {
ok=1;
break;
}
eve= eve->next;
}
- if(ok==0) return 0;
+ if (ok==0) return 0;
/* NEW NEW! define projection: with 'best' normal */
/* just use the first three different vertices */
/* THIS PART STILL IS PRETTY WEAK! (ton) */
-
+
eve= fillvertbase.last;
len= 0.0;
v1= eve->co;
v2= 0;
eve= fillvertbase.first;
- limit = a < 5 ? FLT_EPSILON*200 : M_PI/24.0;
- while(eve) {
- if(v2) {
- if( compare_v3v3(v2, eve->co, COMPLIMIT)==0) {
+ limit = 1e-8f;
+
+ while (eve) {
+ if (v2) {
+ if (!compare_v3v3(v2, eve->co, COMPLIMIT)) {
float inner = angle_v3v3v3(v1, v2, eve->co);
-
- if (fabsf(inner-M_PI) < limit || fabsf(inner) < limit) {
- eve = eve->next;
- continue;
- }
+ inner = MIN2(fabsf(inner), fabsf(M_PI - inner));
- len= normal_tri_v3( norm,v1, v2, eve->co);
- if(len != 0.0f) break;
+ if (inner > limit) {
+ limit = inner;
+ len= normal_tri_v3(norm, v1, v2, eve->co);
+ }
}
}
- else if(compare_v3v3(v1, eve->co, COMPLIMIT)==0) {
+ else if (!compare_v3v3(v1, eve->co, COMPLIMIT))
v2= eve->co;
- }
+
eve= eve->next;
}
- if(len==0.0f) return 0; /* no fill possible */
+ if (len==0.0f) return 0; /* no fill possible */
axis_dominant_v3(&cox, &coy, norm);
/* STEP 1: COUNT POLYS */
eve= fillvertbase.first;
- while(eve) {
+ while (eve) {
/* get first vertex with no poly number */
if (eve->poly_nr==0) {
poly++;
@@ -910,14 +919,14 @@ int BLI_edgefill(short mat_nr)
ok= 1;
eve->poly_nr = poly;
- while(ok) {
+ while (ok) {
ok= 0;
toggle++;
- if(toggle & 1) eed= filledgebase.first;
+ if (toggle & 1) eed= filledgebase.first;
else eed= filledgebase.last;
- while(eed) {
+ while (eed) {
if (eed->v1->poly_nr == 0 && eed->v2->poly_nr == poly) {
eed->v1->poly_nr = poly;
eed->poly_nr= poly;
@@ -934,7 +943,7 @@ int BLI_edgefill(short mat_nr)
ok= 1;
}
}
- if(toggle & 1) eed= eed->next;
+ if (toggle & 1) eed= eed->next;
else eed= eed->prev;
}
}
@@ -945,12 +954,12 @@ int BLI_edgefill(short mat_nr)
/* STEP 2: remove loose edges and strings of edges */
eed= filledgebase.first;
- while(eed) {
- if(eed->v1->h++ >250) break;
- if(eed->v2->h++ >250) break;
+ while (eed) {
+ if (eed->v1->h++ >250) break;
+ if (eed->v2->h++ >250) break;
eed= eed->next;
}
- if(eed) {
+ if (eed) {
/* otherwise it's impossible to be sure you can clear vertices */
callLocalErrorCallBack("No vertices with 250 edges allowed!");
return 0;
@@ -960,21 +969,21 @@ int BLI_edgefill(short mat_nr)
testvertexnearedge();
ok= 1;
- while(ok) {
+ while (ok) {
ok= 0;
toggle++;
- if(toggle & 1) eed= filledgebase.first;
+ if (toggle & 1) eed= filledgebase.first;
else eed= filledgebase.last;
- while(eed) {
- if(toggle & 1) nexted= eed->next;
+ while (eed) {
+ if (toggle & 1) nexted= eed->next;
else nexted= eed->prev;
- if(eed->v1->h==1) {
+ if (eed->v1->h==1) {
eed->v2->h--;
BLI_remlink(&fillvertbase,eed->v1);
BLI_remlink(&filledgebase,eed);
ok= 1;
}
- else if(eed->v2->h==1) {
+ else if (eed->v2->h==1) {
eed->v1->h--;
BLI_remlink(&fillvertbase,eed->v2);
BLI_remlink(&filledgebase,eed);
@@ -983,40 +992,40 @@ int BLI_edgefill(short mat_nr)
eed= nexted;
}
}
- if(filledgebase.first==0) {
+ if (filledgebase.first==0) {
/* printf("All edges removed\n"); */
return 0;
}
/* 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 */
pflist= (PolyFill *)MEM_callocN(poly*sizeof(PolyFill),"edgefill");
pf= pflist;
- for(a=1;a<=poly;a++) {
+ for (a=1;a<=poly;a++) {
pf->nr= a;
pf->min[0]=pf->min[1]=pf->min[2]= 1.0e20;
pf->max[0]=pf->max[1]=pf->max[2]= -1.0e20;
pf++;
}
eed= filledgebase.first;
- while(eed) {
+ while (eed) {
pflist[eed->poly_nr-1].edges++;
eed= eed->next;
}
eve= fillvertbase.first;
- while(eve) {
+ while (eve) {
pflist[eve->poly_nr-1].verts++;
minp= pflist[eve->poly_nr-1].min;
maxp= pflist[eve->poly_nr-1].max;
@@ -1025,7 +1034,7 @@ int BLI_edgefill(short mat_nr)
minp[coy]= (minp[coy])<(eve->co[coy]) ? (minp[coy]) : (eve->co[coy]);
maxp[cox]= (maxp[cox])>(eve->co[cox]) ? (maxp[cox]) : (eve->co[cox]);
maxp[coy]= (maxp[coy])>(eve->co[coy]) ? (maxp[coy]) : (eve->co[coy]);
- if(eve->h > 2) pflist[eve->poly_nr-1].f = 1;
+ if (eve->h > 2) pflist[eve->poly_nr-1].f = 1;
eve= eve->next;
}
@@ -1035,49 +1044,53 @@ int BLI_edgefill(short mat_nr)
* the edgefill itself has good auto-hole detection)
* WATCH IT: ONLY WORKS WITH SORTED POLYS!!! */
- if(poly>1) {
+ if (poly>1) {
short *polycache, *pc;
/* so, sort first */
qsort(pflist, poly, sizeof(PolyFill), vergpoly);
-
- /*pf= pflist;
- for(a=1;a<=poly;a++) {
+
+#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;
- for(a=0; a<poly; a++, pf++) {
- for(c=a+1;c<poly;c++) {
+ for (a=0; a<poly; a++, pf++) {
+ for (c=a+1;c<poly;c++) {
/* if 'a' inside 'c': join (bbox too)
* Careful: 'a' can also be inside another poly.
*/
- if(boundisect(pf, pflist+c)) {
+ if (boundisect(pf, pflist+c)) {
*pc= c;
pc++;
}
/* only for optimize! */
- /* else if(pf->max[cox] < (pflist+c)->min[cox]) break; */
+ /* else if (pf->max[cox] < (pflist+c)->min[cox]) break; */
}
- while(pc!=polycache) {
+ while (pc!=polycache) {
pc--;
mergepolysSimp(pf, pflist+ *pc);
}
}
MEM_freeN(polycache);
}
-
- /* printf("after merge\n");
+
+#if 0
+ printf("after merge\n");
pf= pflist;
- for(a=1;a<=poly;a++) {
+ 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 */
@@ -1089,8 +1102,8 @@ int BLI_edgefill(short mat_nr)
filledgebase.first=filledgebase.last= 0;
pf= pflist;
- for(a=0;a<poly;a++) {
- if(pf->edges>1) {
+ for (a=0;a<poly;a++) {
+ if (pf->edges>1) {
splitlist(&tempve,&temped,pf->nr);
totfaces += scanfill(pf);
}
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 7c48d000d39..01ebd1dce57 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -78,6 +78,7 @@
#include <io.h>
#include <direct.h>
#include "BLI_winstuff.h"
+#include "utfconv.h"
#endif
@@ -86,10 +87,13 @@
#include "DNA_listBase.h"
-#include "BLI_fileops.h"
#include "BLI_listbase.h"
#include "BLI_linklist.h"
+#include "BLI_fileops.h"
+
+#include "BLI_fileops_types.h"
#include "BLI_string.h"
+#include "BLI_fileops.h"
#include "BKE_utildefines.h"
@@ -119,22 +123,24 @@ static int bli_compare(struct direntry *entry1, struct direntry *entry2)
if (S_ISDIR(entry1->type)) {
if (S_ISDIR(entry2->type)==0) return (-1);
- } else{
+ }
+ else {
if (S_ISDIR(entry2->type)) return (1);
}
if (S_ISREG(entry1->type)) {
if (S_ISREG(entry2->type)==0) return (-1);
- } else{
+ }
+ else {
if (S_ISREG(entry2->type)) return (1);
}
if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1);
if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1);
/* make sure "." and ".." are always first */
- if( strcmp(entry1->relname, ".")==0 ) return (-1);
- if( strcmp(entry2->relname, ".")==0 ) return (1);
- if( strcmp(entry1->relname, "..")==0 ) return (-1);
- if( strcmp(entry2->relname, "..")==0 ) return (1);
+ if ( strcmp(entry1->relname, ".")==0 ) return (-1);
+ if ( strcmp(entry2->relname, ".")==0 ) return (1);
+ if ( strcmp(entry1->relname, "..")==0 ) return (-1);
+ if ( strcmp(entry2->relname, "..")==0 ) return (1);
return (BLI_natstrcmp(entry1->relname,entry2->relname));
}
@@ -150,7 +156,8 @@ double BLI_dir_free_space(const char *dir)
if (dir[0]=='/' || dir[0]=='\\') {
tmp[0]='\\';
tmp[1]=0;
- } else if (dir[1]==':') {
+ }
+ else if (dir[1]==':') {
tmp[0]=dir[0];
tmp[1]=':';
tmp[2]='\\';
@@ -175,10 +182,11 @@ double BLI_dir_free_space(const char *dir)
strcpy(name,dir);
- if(len) {
+ if (len) {
slash = strrchr(name,'/');
if (slash) slash[1] = 0;
- } else strcpy(name,"/");
+ }
+ else strcpy(name,"/");
#if defined (__FreeBSD__) || defined (linux) || defined (__OpenBSD__) || defined (__APPLE__) || defined(__GNU__) || defined(__GLIBC__)
if (statfs(name, &disk)) return(-1);
@@ -210,12 +218,21 @@ static void bli_builddir(const char *dirname, const char *relname)
buf[rellen]='/';
rellen++;
}
-
+#ifndef WIN32
if (chdir(dirname) == -1) {
perror(dirname);
return;
}
+#else
+ UTF16_ENCODE(dirname)
+ if (!SetCurrentDirectoryW(dirname_16)) {
+ perror(dirname);
+ free(dirname_16);
+ return;
+ }
+ UTF16_UN_ENCODE(dirname)
+#endif
if ( (dir = (DIR *)opendir(".")) ) {
while ((fname = (struct dirent*) readdir(dir)) != NULL) {
dlink = (struct dirlink *)malloc(sizeof(struct dirlink));
@@ -229,9 +246,9 @@ static void bli_builddir(const char *dirname, const char *relname)
if (newnum) {
- if(files) {
+ if (files) {
void *tmp= realloc(files, (totnum+newnum) * sizeof(struct direntry));
- if(tmp) {
+ if (tmp) {
files= (struct direntry *)tmp;
}
else { /* realloc fail */
@@ -240,21 +257,26 @@ static void bli_builddir(const char *dirname, const char *relname)
}
}
- if(files==NULL)
+ if (files==NULL)
files=(struct direntry *)malloc(newnum * sizeof(struct direntry));
if (files) {
dlink = (struct dirlink *) dirbase->first;
- while(dlink) {
+ while (dlink) {
memset(&files[actnum], 0 , sizeof(struct direntry));
files[actnum].relname = dlink->name;
files[actnum].path = BLI_strdupcat(dirname, dlink->name);
// use 64 bit file size, only needed for WIN32 and WIN64.
-// Excluding other than current MSVC compiler until able to test.
+// Excluding other than current MSVC compiler until able to test
+#ifdef WIN32
+ {wchar_t * name_16 = alloc_utf16_from_8(dlink->name,0);
#if (defined(WIN32) || defined(WIN64)) && (_MSC_VER>=1500)
- _stat64(dlink->name,&files[actnum].s);
+ _wstat64(name_16,&files[actnum].s);
#elif defined(__MINGW32__)
_stati64(dlink->name,&files[actnum].s);
+#endif
+ free(name_16);};
+
#else
stat(dlink->name,&files[actnum].s);
#endif
@@ -264,19 +286,22 @@ static void bli_builddir(const char *dirname, const char *relname)
actnum++;
dlink = dlink->next;
}
- } else{
+ }
+ else {
printf("Couldn't get memory for dir\n");
exit(1);
}
BLI_freelist(dirbase);
if (files) qsort(files, actnum, sizeof(struct direntry), (int (*)(const void *,const void*))bli_compare);
- } else {
+ }
+ else {
printf("%s empty directory\n",dirname);
}
closedir(dir);
- } else {
+ }
+ else {
printf("%s non-existant directory\n",dirname);
}
}
@@ -298,7 +323,7 @@ static void bli_adddirstrings(void)
struct tm *tm;
time_t zero= 0;
- for(num=0, file= files; num<actnum; num++, file++) {
+ for (num=0, file= files; num<actnum; num++, file++) {
#ifdef WIN32
mode = 0;
BLI_strncpy(file->mode1, types[0], sizeof(file->mode1));
@@ -334,7 +359,8 @@ static void bli_adddirstrings(void)
pwuser = getpwuid(file->s.st_uid);
if ( pwuser ) {
BLI_strncpy(file->owner, pwuser->pw_name, sizeof(file->owner));
- } else {
+ }
+ else {
BLI_snprintf(file->owner, sizeof(file->owner), "%d", file->s.st_uid);
}
}
@@ -342,7 +368,7 @@ static void bli_adddirstrings(void)
tm= localtime(&file->s.st_mtime);
// prevent impossible dates in windows
- if(tm==NULL) tm= localtime(&zero);
+ if (tm==NULL) tm= localtime(&zero);
strftime(file->time, sizeof(file->time), "%H:%M", tm);
strftime(file->date, sizeof(file->date), "%d-%b-%y", tm);
@@ -408,7 +434,8 @@ unsigned int BLI_dir_contents(const char *dirname, struct direntry **filelist)
if (files) {
*(filelist) = files;
- } else {
+ }
+ else {
// keep blender happy. Blender stores this in a variable
// where 0 has special meaning.....
*(filelist) = files = malloc(sizeof(struct direntry));
@@ -423,13 +450,13 @@ size_t BLI_file_descriptor_size(int file)
struct stat buf;
if (file <= 0) return (-1);
- fstat(file, &buf);
+ fstat(file, &buf);//CHANGE
return (buf.st_size);
}
size_t BLI_file_size(const char *path)
{
- int size, file = open(path, O_BINARY|O_RDONLY);
+ int size, file = BLI_open(path, O_BINARY|O_RDONLY, 0);
if (file == -1)
return -1;
@@ -442,27 +469,26 @@ size_t BLI_file_size(const char *path)
int BLI_exists(const char *name)
{
-#if defined(WIN32) && !defined(__MINGW32__)
+#if defined(WIN32)
+#ifndef __MINGW32__
struct _stat64i32 st;
+#else
+ struct _stati64 st;
+#endif
/* 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];
+ wchar_t * tmp_16 = alloc_utf16_from_8(name, 0);
int len, res;
- BLI_strncpy(tmp, name, FILE_MAX);
- len = strlen(tmp);
- if (len > 3 && ( tmp[len-1]=='\\' || tmp[len-1]=='/') ) tmp[len-1] = '\0';
- res = _stat(tmp, &st);
+ len = wcslen(tmp_16);
+ if (len > 3 && ( tmp_16[len-1]==L'\\' || tmp_16[len-1]==L'/') ) tmp_16[len-1] = '\0';
+#ifndef __MINGW32__
+ res = _wstat(tmp_16, &st);
+#else
+ res = _wstati64(tmp_16, &st);
+#endif
+ free(tmp_16);
if (res == -1) return(0);
-#elif defined(__MINGW32__)
- struct _stati64 st;
- char tmp[FILE_MAX];
- int len, res;
- BLI_strncpy(tmp, name, FILE_MAX);
- len = strlen(tmp);
- if (len > 3 && ( tmp[len-1]=='\\' || tmp[len-1]=='/') ) tmp[len-1] = '\0';
- res = _stati64(tmp, &st);
- if (res) return(0);
#else
struct stat st;
if (stat(name,&st)) return(0);
@@ -484,7 +510,7 @@ int BLI_is_file(const char *path)
LinkNode *BLI_file_read_as_lines(const char *name)
{
- FILE *fp= fopen(name, "r");
+ FILE *fp= BLI_fopen(name, "r");
LinkNode *lines= NULL;
char *buf;
size_t size;
@@ -530,11 +556,23 @@ void BLI_file_free_lines(LinkNode *lines)
int BLI_file_older(const char *file1, const char *file2)
{
- struct stat st1, st2;
+#if WIN32
+ struct _stat st1, st2;
- if(stat(file1, &st1)) return 0;
- if(stat(file2, &st2)) return 0;
+ UTF16_ENCODE(file1)
+ UTF16_ENCODE(file2)
+
+ if (_wstat(file1_16, &st1)) return 0;
+ if (_wstat(file2_16, &st2)) return 0;
+ UTF16_UN_ENCODE(file2)
+ UTF16_UN_ENCODE(file1)
+#else
+ struct stat st1, st2;
+
+ if (stat(file1, &st1)) return 0;
+ if (stat(file2, &st2)) return 0;
+#endif
return (st1.st_mtime < st2.st_mtime);
}
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index 3a66425a5de..4c92a872ed7 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -124,7 +124,7 @@ char *BLI_sprintfN(const char *format, ...)
size_t BLI_strescape(char *dst, const char *src, const size_t maxlen)
{
size_t len= 0;
- while(len < maxlen) {
+ while (len < maxlen) {
switch(*src) {
case '\0':
goto escape_finish;
@@ -135,7 +135,7 @@ size_t BLI_strescape(char *dst, const char *src, const size_t maxlen)
case '\t':
case '\n':
case '\r':
- if(len + 1 < maxlen) {
+ if (len + 1 < maxlen) {
*dst++ = '\\';
len++;
}
@@ -184,8 +184,8 @@ char *BLI_getQuotedStr (const char *str, const char *prefix)
return BLI_strdupn(startMatch, (size_t)(endMatch-startMatch));
}
-/* Replaces all occurances of oldText with newText in str, returning a new string that doesn't
- * contain the 'replaced' occurances.
+/* Replaces all occurrences of oldText with newText in str, returning a new string that doesn't
+ * contain the 'replaced' occurrences.
*/
// A rather wasteful string-replacement utility, though this shall do for now...
// Feel free to replace this with an even safe + nicer alternative
@@ -231,7 +231,7 @@ char *BLI_replacestr(char *str, const char *oldText, const char *newText)
str += lenOld;
}
- /* finish off and return a new string that has had all occurances of */
+ /* finish off and return a new string that has had all occurrences of */
if (ds) {
char *newStr;
@@ -292,9 +292,11 @@ int BLI_strcasecmp(const char *s1, const char *s2)
if (c1<c2) {
return -1;
- } else if (c1>c2) {
+ }
+ else if (c1>c2) {
return 1;
- } else if (c1==0) {
+ }
+ else if (c1==0) {
break;
}
}
@@ -312,9 +314,11 @@ int BLI_strncasecmp(const char *s1, const char *s2, size_t len)
if (c1<c2) {
return -1;
- } else if (c1>c2) {
+ }
+ else if (c1>c2) {
return 1;
- } else if (c1==0) {
+ }
+ else if (c1==0) {
break;
}
}
@@ -326,16 +330,16 @@ 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 */
-
- while(1) {
+ * 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]);
- if( isdigit(c1) && isdigit(c2) ) {
+ if ( isdigit(c1) && isdigit(c2) ) {
int val1, val2;
val1= (int)strtol(s1+d1, (char **)NULL, 10);
@@ -343,14 +347,15 @@ int BLI_natstrcmp(const char *s1, const char *s2)
if (val1<val2) {
return -1;
- } else if (val1>val2) {
+ }
+ else if (val1>val2) {
return 1;
}
d1++;
- while( isdigit(s1[d1]) )
+ while ( isdigit(s1[d1]) )
d1++;
d2++;
- while( isdigit(s2[d2]) )
+ while ( isdigit(s2[d2]) )
d2++;
c1 = tolower(s1[d1]);
@@ -358,15 +363,17 @@ int BLI_natstrcmp(const char *s1, const char *s2)
}
/* first check for '.' so "foo.bar" comes before "foo 1.bar" */
- if(c1=='.' && c2!='.')
+ if (c1=='.' && c2!='.')
return -1;
- if(c1!='.' && c2=='.')
+ if (c1!='.' && c2=='.')
return 1;
else if (c1<c2) {
return -1;
- } else if (c1>c2) {
+ }
+ else if (c1>c2) {
return 1;
- } else if (c1==0) {
+ }
+ else if (c1==0) {
break;
}
d1++;
@@ -385,7 +392,8 @@ void BLI_timestr(double _time, char *str)
if (hr) {
sprintf(str, "%.2d:%.2d:%.2d.%.2d",hr,min,sec,hun);
- } else {
+ }
+ else {
sprintf(str, "%.2d:%.2d.%.2d",min,sec,hun);
}
@@ -403,8 +411,8 @@ void BLI_ascii_strtolower(char *str, int len)
{
int i;
- for(i=0; i<len; i++)
- if(str[i] >= 'A' && str[i] <= 'Z')
+ for (i=0; i<len; i++)
+ if (str[i] >= 'A' && str[i] <= 'Z')
str[i] += 'a' - 'A';
}
@@ -412,8 +420,8 @@ void BLI_ascii_strtoupper(char *str, int len)
{
int i;
- for(i=0; i<len; i++)
- if(str[i] >= 'a' && str[i] <= 'z')
+ for (i=0; i<len; i++)
+ if (str[i] >= 'a' && str[i] <= 'z')
str[i] -= 'a' - 'A';
}
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..97559d6ba10
--- /dev/null
+++ b/source/blender/blenlib/intern/string_cursor_utf8.c
@@ -0,0 +1,197 @@
+/*
+ * ***** 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_utf8)
+{
+ /* for full unicode support we really need to have large lookup tables to figure
+ * out whats what in every possible char set - and python, glib both have these. */
+ unsigned int uch = BLI_str_utf8_as_unicode(ch_utf8);
+
+ if ((uch >= 'a' && uch <= 'z') ||
+ (uch >= 'A' && uch <= 'Z') ||
+ (uch == '_') /* not quite correct but allow for python, could become configurable */
+ )
+ {
+ return STRCUR_DELIM_ALPHA;
+ }
+
+ switch (uch) {
+ 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 cf865b5686d..aede08be7f9 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;
@@ -126,11 +126,11 @@ int BLI_utf8_invalid_strip(char *str, int length)
{
int bad_char, tot= 0;
- while((bad_char= BLI_utf8_invalid_byte(str, length)) != -1) {
+ while ((bad_char= BLI_utf8_invalid_byte(str, length)) != -1) {
str += bad_char;
length -= bad_char;
- if(length == 0) {
+ if (length == 0) {
/* last character bad, strip it */
*str= '\0';
tot++;
@@ -166,7 +166,7 @@ static const size_t utf8_skip_data[256] = {
#define BLI_STR_UTF8_CPY(dst, src, maxncpy) \
{ \
size_t utf8_size; \
- while(*src != '\0' && (utf8_size= utf8_skip_data[*src]) < maxncpy) { \
+ while (*src != '\0' && (utf8_size= utf8_skip_data[*src]) < maxncpy) { \
maxncpy -= utf8_size; \
switch(utf8_size) { \
case 6: *dst ++ = *src ++; \
@@ -184,7 +184,7 @@ char *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy)
{
char *dst_r= dst;
- /* note: currently we dont attempt to deal with invalid utf8 chars */
+ /* note: currently we don't attempt to deal with invalid utf8 chars */
BLI_STR_UTF8_CPY(dst, src, maxncpy)
return dst_r;
@@ -210,7 +210,7 @@ char *BLI_strncat_utf8(char *dst, const char *src, size_t maxncpy)
size_t BLI_strncpy_wchar_as_utf8(char *dst, const wchar_t *src, const size_t maxcpy)
{
size_t len = 0;
- while(*src && len < maxcpy) { /* XXX can still run over the buffer because utf8 size isnt known :| */
+ while (*src && len < maxcpy) { /* XXX can still run over the buffer because utf8 size isn't known :| */
len += BLI_str_utf8_from_unicode(*src++, dst+len);
}
@@ -224,7 +224,7 @@ size_t BLI_wstrlen_utf8(const wchar_t *src)
{
size_t len = 0;
- while(*src) {
+ while (*src) {
len += BLI_str_utf8_from_unicode(*src++, NULL);
}
@@ -236,15 +236,17 @@ size_t BLI_strlen_utf8(const char *strc)
{
int len=0;
- while(*strc) {
+ while (*strc) {
if ((*strc & 0xe0) == 0xc0) {
- if((strc[1] & 0x80) && (strc[1] & 0x40) == 0x00)
+ if ((strc[1] & 0x80) && (strc[1] & 0x40) == 0x00)
strc++;
- } else if ((*strc & 0xf0) == 0xe0) {
- if((strc[1] & strc[2] & 0x80) && ((strc[1] | strc[2]) & 0x40) == 0x00)
+ }
+ else if ((*strc & 0xf0) == 0xe0) {
+ if ((strc[1] & strc[2] & 0x80) && ((strc[1] | strc[2]) & 0x40) == 0x00)
strc += 2;
- } else if ((*strc & 0xf8) == 0xf0) {
- if((strc[1] & strc[2] & strc[3] & 0x80) && ((strc[1] | strc[2] | strc[3]) & 0x40) == 0x00)
+ }
+ else if ((*strc & 0xf8) == 0xf0) {
+ if ((strc[1] & strc[2] & strc[3] & 0x80) && ((strc[1] | strc[2] | strc[3]) & 0x40) == 0x00)
strc += 3;
}
@@ -259,9 +261,9 @@ size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size
{
int len=0;
- if(dst_w==NULL || src_c==NULL) return(0);
+ if (dst_w==NULL || src_c==NULL) return(0);
- while(*src_c && len < maxcpy) {
+ while (*src_c && len < maxcpy) {
size_t step= 0;
unsigned int unicode= BLI_str_utf8_as_unicode_and_size(src_c, &step);
if (unicode != BLI_UTF8_ERR) {
@@ -284,7 +286,7 @@ size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size
/* copied from glib's gutf8.c */
/* note, glib uses unsigned int for unicode, best we do the same,
- * though we dont typedef it - campbell */
+ * though we don't typedef it - campbell */
#define UTF8_COMPUTE(Char, Mask, Len) \
if (Char < 128) { \
@@ -357,19 +359,19 @@ int BLI_str_utf8_size(const char *p)
**/
unsigned int BLI_str_utf8_as_unicode(const char *p)
{
- int i, mask = 0, len;
- unsigned int result;
- unsigned char c = (unsigned char) *p;
+ int i, mask = 0, len;
+ unsigned int result;
+ unsigned char c = (unsigned char) *p;
- UTF8_COMPUTE (c, mask, len);
- if (len == -1)
- return BLI_UTF8_ERR;
- UTF8_GET (result, p, i, mask, len, BLI_UTF8_ERR);
+ UTF8_COMPUTE (c, mask, len);
+ if (len == -1)
+ return BLI_UTF8_ERR;
+ UTF8_GET (result, p, i, mask, len, BLI_UTF8_ERR);
- return result;
+ return result;
}
-/* varient that increments the length */
+/* variant that increments the length */
unsigned int BLI_str_utf8_as_unicode_and_size(const char *p, size_t *index)
{
int i, mask = 0, len;
@@ -384,7 +386,7 @@ unsigned int BLI_str_utf8_as_unicode_and_size(const char *p, size_t *index)
return result;
}
-/* another varient that steps over the index,
+/* another variant that steps over the index,
* note, currently this also falls back to latin1 for text drawing. */
unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index)
{
@@ -415,7 +417,7 @@ unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index)
* this is added for text drawing because some filepaths can have latin1
* characters */
UTF8_GET (result, p, i, mask, len, BLI_UTF8_ERR);
- if(result == BLI_UTF8_ERR) {
+ if (result == BLI_UTF8_ERR) {
len= 1;
result= *p;
}
@@ -433,7 +435,7 @@ unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index)
/**
* BLI_str_utf8_from_unicode:
* @c a Unicode character code
- * @param outbuf output buffer, must have at least 6 bytes of space.
+ * \param outbuf output buffer, must have at least 6 bytes of space.
* If %NULL, the length will be computed and returned
* and nothing will be written to outbuf.
*
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c
index e92b445c27f..19d9c2a9c65 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,20 +146,20 @@ 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)
{
int a;
- if(threadbase != NULL && tot > 0) {
+ if (threadbase != NULL && tot > 0) {
threadbase->first= threadbase->last= NULL;
- if(tot>RE_MAX_THREAD) tot= RE_MAX_THREAD;
- else if(tot<1) tot= 1;
+ if (tot>RE_MAX_THREAD) tot= RE_MAX_THREAD;
+ else if (tot<1) tot= 1;
- for(a=0; a<tot; a++) {
+ for (a=0; a<tot; a++) {
ThreadSlot *tslot= MEM_callocN(sizeof(ThreadSlot), "threadslot");
BLI_addtail(threadbase, tslot);
tslot->do_thread= do_thread;
@@ -167,13 +167,13 @@ void BLI_init_threads(ListBase *threadbase, void *(*do_thread)(void *), int tot)
}
}
- if(thread_levels == 0) {
+ if (thread_levels == 0) {
MEM_set_lock_callback(BLI_lock_malloc_thread, BLI_unlock_malloc_thread);
#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
}
@@ -187,8 +187,8 @@ int BLI_available_threads(ListBase *threadbase)
ThreadSlot *tslot;
int counter=0;
- for(tslot= threadbase->first; tslot; tslot= tslot->next) {
- if(tslot->avail)
+ for (tslot= threadbase->first; tslot; tslot= tslot->next) {
+ if (tslot->avail)
counter++;
}
return counter;
@@ -200,8 +200,8 @@ int BLI_available_thread_index(ListBase *threadbase)
ThreadSlot *tslot;
int counter=0;
- for(tslot= threadbase->first; tslot; tslot= tslot->next, counter++) {
- if(tslot->avail)
+ for (tslot= threadbase->first; tslot; tslot= tslot->next, counter++) {
+ if (tslot->avail)
return counter;
}
return 0;
@@ -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
@@ -229,8 +229,8 @@ void BLI_insert_thread(ListBase *threadbase, void *callerdata)
{
ThreadSlot *tslot;
- for(tslot= threadbase->first; tslot; tslot= tslot->next) {
- if(tslot->avail) {
+ for (tslot= threadbase->first; tslot; tslot= tslot->next) {
+ if (tslot->avail) {
tslot->avail= 0;
tslot->callerdata= callerdata;
pthread_create(&tslot->pthread, NULL, tslot_thread_start, tslot);
@@ -244,8 +244,8 @@ void BLI_remove_thread(ListBase *threadbase, void *callerdata)
{
ThreadSlot *tslot;
- for(tslot= threadbase->first; tslot; tslot= tslot->next) {
- if(tslot->callerdata==callerdata) {
+ for (tslot= threadbase->first; tslot; tslot= tslot->next) {
+ if (tslot->callerdata==callerdata) {
pthread_join(tslot->pthread, NULL);
tslot->callerdata= NULL;
tslot->avail= 1;
@@ -258,7 +258,7 @@ void BLI_remove_thread_index(ListBase *threadbase, int index)
ThreadSlot *tslot;
int counter=0;
- for(tslot = threadbase->first; tslot; tslot = tslot->next, counter++) {
+ for (tslot = threadbase->first; tslot; tslot = tslot->next, counter++) {
if (counter == index && tslot->avail == 0) {
pthread_join(tslot->pthread, NULL);
tslot->callerdata = NULL;
@@ -272,7 +272,7 @@ void BLI_remove_threads(ListBase *threadbase)
{
ThreadSlot *tslot;
- for(tslot = threadbase->first; tslot; tslot = tslot->next) {
+ for (tslot = threadbase->first; tslot; tslot = tslot->next) {
if (tslot->avail == 0) {
pthread_join(tslot->pthread, NULL);
tslot->callerdata = NULL;
@@ -289,8 +289,8 @@ void BLI_end_threads(ListBase *threadbase)
* this way we don't end up decrementing thread_levels on an empty threadbase
* */
if (threadbase && threadbase->first != NULL) {
- for(tslot= threadbase->first; tslot; tslot= tslot->next) {
- if(tslot->avail==0) {
+ for (tslot= threadbase->first; tslot; tslot= tslot->next) {
+ if (tslot->avail==0) {
pthread_join(tslot->pthread, NULL);
}
}
@@ -298,7 +298,7 @@ void BLI_end_threads(ListBase *threadbase)
}
thread_levels--;
- if(thread_levels==0)
+ if (thread_levels==0)
MEM_set_lock_callback(NULL, NULL);
}
@@ -366,17 +366,17 @@ void BLI_unlock_thread(int type)
pthread_mutex_unlock(&_preview_lock);
else if (type==LOCK_VIEWER)
pthread_mutex_unlock(&_viewer_lock);
- else if(type==LOCK_CUSTOM1)
+ else if (type==LOCK_CUSTOM1)
pthread_mutex_unlock(&_custom1_lock);
- else if(type==LOCK_RCACHE)
+ else if (type==LOCK_RCACHE)
pthread_mutex_unlock(&_rcache_lock);
- else if(type==LOCK_OPENGL)
+ else if (type==LOCK_OPENGL)
pthread_mutex_unlock(&_opengl_lock);
- else if(type==LOCK_NODES)
+ else if (type==LOCK_NODES)
pthread_mutex_unlock(&_nodes_lock);
- else if(type==LOCK_MOVIECLIP)
+ else if (type==LOCK_MOVIECLIP)
pthread_mutex_unlock(&_movieclip_lock);
- else if(type == LOCK_SCANFILL)
+ else if (type == LOCK_SCANFILL)
pthread_mutex_unlock(&_scanfill_lock);
}
@@ -411,7 +411,7 @@ void BLI_rw_mutex_init(ThreadRWMutex *mutex)
void BLI_rw_mutex_lock(ThreadRWMutex *mutex, int mode)
{
- if(mode == THREAD_LOCK_READ)
+ if (mode == THREAD_LOCK_READ)
pthread_rwlock_rdlock(mutex);
else
pthread_rwlock_wrlock(mutex);
@@ -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);
}
@@ -578,11 +571,11 @@ void *BLI_thread_queue_pop(ThreadQueue *queue)
/* wait until there is work */
pthread_mutex_lock(&queue->mutex);
- while(BLI_gsqueue_is_empty(queue->queue) && !queue->nowait)
+ while (BLI_gsqueue_is_empty(queue->queue) && !queue->nowait)
pthread_cond_wait(&queue->cond, &queue->mutex);
/* if we have something, pop it */
- if(!BLI_gsqueue_is_empty(queue->queue))
+ if (!BLI_gsqueue_is_empty(queue->queue))
BLI_gsqueue_pop(queue->queue, &work);
pthread_mutex_unlock(&queue->mutex);
@@ -636,15 +629,15 @@ void *BLI_thread_queue_pop_timeout(ThreadQueue *queue, int ms)
/* wait until there is work */
pthread_mutex_lock(&queue->mutex);
- while(BLI_gsqueue_is_empty(queue->queue) && !queue->nowait) {
- if(pthread_cond_timedwait(&queue->cond, &queue->mutex, &timeout) == ETIMEDOUT)
+ while (BLI_gsqueue_is_empty(queue->queue) && !queue->nowait) {
+ if (pthread_cond_timedwait(&queue->cond, &queue->mutex, &timeout) == ETIMEDOUT)
break;
- else if(PIL_check_seconds_timer() - t >= ms*0.001)
+ else if (PIL_check_seconds_timer() - t >= ms*0.001)
break;
}
/* if we have something, pop it */
- if(!BLI_gsqueue_is_empty(queue->queue))
+ if (!BLI_gsqueue_is_empty(queue->queue))
BLI_gsqueue_pop(queue->queue, &work);
pthread_mutex_unlock(&queue->mutex);
@@ -676,7 +669,7 @@ void BLI_thread_queue_nowait(ThreadQueue *queue)
void BLI_begin_threaded_malloc(void)
{
- if(thread_levels == 0) {
+ if (thread_levels == 0) {
MEM_set_lock_callback(BLI_lock_malloc_thread, BLI_unlock_malloc_thread);
}
thread_levels++;
@@ -685,6 +678,6 @@ void BLI_begin_threaded_malloc(void)
void BLI_end_threaded_malloc(void)
{
thread_levels--;
- if(thread_levels==0)
+ if (thread_levels==0)
MEM_set_lock_callback(NULL, NULL);
}
diff --git a/source/blender/blenlib/intern/time.c b/source/blender/blenlib/intern/time.c
index d86d68f6195..2f53aa38e77 100644
--- a/source/blender/blenlib/intern/time.c
+++ b/source/blender/blenlib/intern/time.c
@@ -52,14 +52,16 @@ double PIL_check_seconds_timer(void)
QueryPerformanceCounter((LARGE_INTEGER*) &count);
return count/perffreq;
- } else {
+ }
+ else {
static double accum= 0.0;
static int ltick= 0;
int ntick= GetTickCount();
if (ntick<ltick) {
accum+= (0xFFFFFFFF-ltick+ntick)/1000.0;
- } else {
+ }
+ else {
accum+= (ntick-ltick)/1000.0;
}
diff --git a/source/blender/blenlib/intern/uvproject.c b/source/blender/blenlib/intern/uvproject.c
index 8b00d8e48a6..89621cdf48d 100644
--- a/source/blender/blenlib/intern/uvproject.c
+++ b/source/blender/blenlib/intern/uvproject.c
@@ -22,7 +22,6 @@
* \ingroup bli
*/
-
#include <math.h>
#include "MEM_guardedalloc.h"
@@ -48,45 +47,46 @@ void project_from_camera(float target[2], float source[3], UvCameraInfo *uci)
float pv4[4];
copy_v3_v3(pv4, source);
- pv4[3]= 1.0;
+ pv4[3] = 1.0;
/* rotmat is the object matrix in this case */
- if(uci->do_rotmat)
+ if (uci->do_rotmat)
mul_m4_v4(uci->rotmat, pv4);
/* caminv is the inverse camera matrix */
mul_m4_v4(uci->caminv, pv4);
- if(uci->do_pano) {
- float angle= atan2f(pv4[0], -pv4[2]) / ((float)M_PI * 2.0f); /* angle around the camera */
- if (uci->do_persp==0) {
- target[0]= angle; /* no correct method here, just map to 0-1 */
- target[1]= pv4[1] / uci->camsize;
+ if (uci->do_pano) {
+ float angle = atan2f(pv4[0], -pv4[2]) / ((float)M_PI * 2.0f); /* angle around the camera */
+ if (uci->do_persp == 0) {
+ target[0] = angle; /* no correct method here, just map to 0-1 */
+ target[1] = pv4[1] / uci->camsize;
}
else {
float vec2d[2]; /* 2D position from the camera */
- vec2d[0]= pv4[0];
- vec2d[1]= pv4[2];
- target[0]= angle * ((float)M_PI / uci->camangle);
- target[1]= pv4[1] / (len_v2(vec2d) * (uci->camsize * 2.0f));
+ vec2d[0] = pv4[0];
+ vec2d[1] = pv4[2];
+ target[0] = angle * ((float)M_PI / uci->camangle);
+ target[1] = pv4[1] / (len_v2(vec2d) * (uci->camsize * 2.0f));
}
}
else {
- if (pv4[2]==0.0f) pv4[2]= 0.00001f; /* don't allow div by 0 */
+ if (pv4[2] == 0.0f)
+ pv4[2] = 0.00001f; /* don't allow div by 0 */
- if (uci->do_persp==0) {
- target[0]= (pv4[0]/uci->camsize);
- target[1]= (pv4[1]/uci->camsize);
+ if (uci->do_persp == 0) {
+ target[0] = (pv4[0] / uci->camsize);
+ target[1] = (pv4[1] / uci->camsize);
}
else {
- target[0]= (-pv4[0]*((1.0f/uci->camsize)/pv4[2])) / 2.0f;
- target[1]= (-pv4[1]*((1.0f/uci->camsize)/pv4[2])) / 2.0f;
+ target[0] = (-pv4[0] * ((1.0f / uci->camsize) / pv4[2])) / 2.0f;
+ target[1] = (-pv4[1] * ((1.0f / uci->camsize) / pv4[2])) / 2.0f;
}
}
target[0] *= uci->xasp;
target[1] *= uci->yasp;
-
+
/* adds camera shift + 0.5 */
target[0] += uci->shiftx;
target[1] += uci->shifty;
@@ -95,54 +95,54 @@ void project_from_camera(float target[2], float source[3], UvCameraInfo *uci)
/* could rv3d->persmat */
void project_from_view(float target[2], float source[3], float persmat[4][4], float rotmat[4][4], float winx, float winy)
{
- float pv[3], pv4[4], x= 0.0, y= 0.0;
+ float pv[3], pv4[4], x = 0.0, y = 0.0;
mul_v3_m4v3(pv, rotmat, source);
copy_v3_v3(pv4, source);
- pv4[3]= 1.0;
+ pv4[3] = 1.0;
/* rotmat is the object matrix in this case */
- mul_m4_v4(rotmat, pv4);
+ mul_m4_v4(rotmat, pv4);
/* almost project_short */
mul_m4_v4(persmat, pv4);
- if(fabsf(pv4[3]) > 0.00001f) { /* avoid division by zero */
- target[0] = winx/2.0f + (winx/2.0f) * pv4[0] / pv4[3];
- target[1] = winy/2.0f + (winy/2.0f) * pv4[1] / pv4[3];
+ if (fabsf(pv4[3]) > 0.00001f) { /* avoid division by zero */
+ target[0] = winx / 2.0f + (winx / 2.0f) * pv4[0] / pv4[3];
+ target[1] = winy / 2.0f + (winy / 2.0f) * pv4[1] / pv4[3];
}
else {
/* scaling is lost but give a valid result */
- target[0] = winx/2.0f + (winx/2.0f) * pv4[0];
- target[1] = winy/2.0f + (winy/2.0f) * pv4[1];
+ target[0] = winx / 2.0f + (winx / 2.0f) * pv4[0];
+ target[1] = winy / 2.0f + (winy / 2.0f) * pv4[1];
}
- /* v3d->persmat seems to do this funky scaling */
- if(winx > winy) {
- y= (winx - winy)/2.0f;
+ /* v3d->persmat seems to do this funky scaling */
+ if (winx > winy) {
+ y = (winx - winy) / 2.0f;
winy = winx;
}
else {
- x= (winy - winx)/2.0f;
+ x = (winy - winx) / 2.0f;
winx = winy;
}
- target[0]= (x + target[0]) / winx;
- target[1]= (y + target[1]) / winy;
+ target[0] = (x + target[0]) / winx;
+ target[1] = (y + target[1]) / winy;
}
/* 'rotmat' can be obedit->obmat when uv project is used.
- * 'winx' and 'winy' can be from scene->r.xsch/ysch */
-UvCameraInfo *project_camera_info(Object *ob, float (*rotmat)[4], float winx, float winy)
+ * 'winx' and 'winy' can be from scene->r.xsch/ysch */
+UvCameraInfo *project_camera_info(Object *ob, float(*rotmat)[4], float winx, float winy)
{
UvCameraInfo uci;
- Camera *camera= ob->data;
+ Camera *camera = ob->data;
uci.do_pano = (camera->flag & CAM_PANORAMA);
- uci.do_persp = (camera->type==CAM_PERSP);
+ uci.do_persp = (camera->type == CAM_PERSP);
- uci.camangle= focallength_to_fov(camera->lens, camera->sensor_x) / 2.0f;
- uci.camsize= uci.do_persp ? tanf(uci.camangle) : camera->ortho_scale;
+ uci.camangle = focallength_to_fov(camera->lens, camera->sensor_x) / 2.0f;
+ uci.camsize = uci.do_persp ? tanf(uci.camangle) : camera->ortho_scale;
/* account for scaled cameras */
copy_m4_m4(uci.caminv, ob->obmat);
@@ -152,30 +152,30 @@ UvCameraInfo *project_camera_info(Object *ob, float (*rotmat)[4], float winx, fl
UvCameraInfo *uci_pt;
/* normal projection */
- if(rotmat) {
+ if (rotmat) {
copy_m4_m4(uci.rotmat, rotmat);
- uci.do_rotmat= 1;
+ uci.do_rotmat = 1;
}
else {
- uci.do_rotmat= 0;
+ uci.do_rotmat = 0;
}
/* also make aspect ratio adjustment factors */
if (winx > winy) {
- uci.xasp= 1.0f;
- uci.yasp= winx / winy;
+ uci.xasp = 1.0f;
+ uci.yasp = winx / winy;
}
else {
- uci.xasp= winy / winx;
- uci.yasp= 1.0f;
+ uci.xasp = winy / winx;
+ uci.yasp = 1.0f;
}
-
+
/* include 0.5f here to move the UVs into the center */
uci.shiftx = 0.5f - (camera->shiftx * uci.xasp);
uci.shifty = 0.5f - (camera->shifty * uci.yasp);
-
- uci_pt= MEM_mallocN(sizeof(UvCameraInfo), "UvCameraInfo");
- *uci_pt= uci;
+
+ uci_pt = MEM_mallocN(sizeof(UvCameraInfo), "UvCameraInfo");
+ *uci_pt = uci;
return uci_pt;
}
@@ -193,7 +193,6 @@ void project_from_view_ortho(float target[2], float source[3], float rotmat[4][4
target[1] = pv[2];
}
-
void project_camera_info_scale(UvCameraInfo *uci, float scale_x, float scale_y)
{
uci->xasp *= scale_x;
diff --git a/source/blender/blenlib/intern/voxel.c b/source/blender/blenlib/intern/voxel.c
index f6c8c634c8d..34862c724e1 100644
--- a/source/blender/blenlib/intern/voxel.c
+++ b/source/blender/blenlib/intern/voxel.c
@@ -35,7 +35,7 @@
-BM_INLINE float D(float *data, const int res[3], int x, int y, int z)
+BLI_INLINE float D(float *data, const int res[3], int x, int y, int z)
{
CLAMP(x, 0, res[0]-1);
CLAMP(y, 0, res[1]-1);
@@ -43,7 +43,7 @@ BM_INLINE float D(float *data, const int res[3], int x, int y, int z)
return data[ V_I(x, y, z, res) ];
}
-/* *** nearest neighbour *** */
+/* *** nearest neighbor *** */
/* input coordinates must be in bounding box 0.0 - 1.0 */
float voxel_sample_nearest(float *data, const int res[3], const float co[3])
{
@@ -57,7 +57,7 @@ float voxel_sample_nearest(float *data, const int res[3], const float co[3])
}
// returns highest integer <= x as integer (slightly faster than floor())
-BM_INLINE int FLOORI(float x)
+BLI_INLINE int FLOORI(float x)
{
const int r = (int)x;
return ((x >= 0.f) || (float)r == x) ? r : (r - 1);
@@ -65,7 +65,7 @@ BM_INLINE int FLOORI(float x)
// clamp function, cannot use the CLAMPIS macro, it sometimes returns unwanted results apparently related to gcc optimization flag -fstrict-overflow which is enabled at -O2
// this causes the test (x + 2) < 0 with int x == 2147483647 to return false (x being an integer, x + 2 should wrap around to -2147483647 so the test < 0 should return true, which it doesn't)
-BM_INLINE int _clamp(int a, int b, int c)
+BLI_INLINE int _clamp(int a, int b, int c)
{
return (a < b) ? b : ((a > c) ? c : a);
}
diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c
index b2002b63a22..d2c98b7aaf3 100644
--- a/source/blender/blenlib/intern/winstuff.c
+++ b/source/blender/blenlib/intern/winstuff.c
@@ -47,17 +47,20 @@
#define WIN32_SKIP_HKEY_PROTECTION // need to use HKEY
#include "BLI_winstuff.h"
- /* FILE_MAX */
+#include "utf_winfunc.h"
+#include "utfconv.h"
+
+ /* FILE_MAXDIR + FILE_MAXFILE */
int BLI_getInstallationDir( char * str )
{
char dir[FILE_MAXDIR];
int a;
-
+ /*change to utf support*/
GetModuleFileName(NULL,str,FILE_MAX);
BLI_split_dir_part(str, dir, sizeof(dir)); /* shouldn't be relative */
a = strlen(dir);
- if(dir[a-1] == '\\') dir[a-1]=0;
+ if (dir[a-1] == '\\') dir[a-1]=0;
strcpy(str,dir);
@@ -96,8 +99,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 +163,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);
}
@@ -171,7 +172,9 @@ void RegisterBlendExtension(void)
DIR *opendir (const char *path)
{
- if (GetFileAttributes(path) & FILE_ATTRIBUTE_DIRECTORY) {
+ wchar_t * path_16 = alloc_utf16_from_8(path, 0);
+
+ if (GetFileAttributesW(path_16) & FILE_ATTRIBUTE_DIRECTORY) {
DIR *newd= MEM_mallocN(sizeof(DIR), "opendir");
newd->handle = INVALID_HANDLE_VALUE;
@@ -182,32 +185,62 @@ DIR *opendir (const char *path)
newd->direntry.d_reclen= 0;
newd->direntry.d_name= NULL;
+ free(path_16);
return newd;
- } else {
+ }
+ else {
+ free(path_16);
return NULL;
}
}
-struct dirent *readdir(DIR *dp)
+static char * BLI_alloc_utf_8_from_16(wchar_t * in16, size_t add)
{
+ size_t bsize = count_utf_8_from_16(in16);
+ char * out8 = NULL;
+ if (!bsize) return NULL;
+ out8 = (char*)MEM_mallocN(sizeof(char) * (bsize + add),"UTF-8 String");
+ conv_utf_16_to_8(in16,out8, bsize);
+ return out8;
+}
+
+static wchar_t * BLI_alloc_utf16_from_8(char * in8, size_t add)
+{
+ size_t bsize = count_utf_16_from_8(in8);
+ wchar_t * out16 = NULL;
+ if (!bsize) return NULL;
+ out16 =(wchar_t*) MEM_mallocN(sizeof(wchar_t) * (bsize + add), "UTF-16 String");
+ conv_utf_8_to_16(in8,out16, bsize);
+ return out16;
+}
+
+
+
+struct dirent *readdir(DIR *dp) {
+ char * FileName;
+ size_t size;
if (dp->direntry.d_name) {
MEM_freeN(dp->direntry.d_name);
dp->direntry.d_name= NULL;
}
if (dp->handle==INVALID_HANDLE_VALUE) {
- dp->handle= FindFirstFile(dp->path, &(dp->data));
+ wchar_t * path_16 = alloc_utf16_from_8(dp->path, 0);
+ dp->handle= FindFirstFileW(path_16, &(dp->data));
+ free(path_16);
if (dp->handle==INVALID_HANDLE_VALUE)
return NULL;
- dp->direntry.d_name= BLI_strdup(dp->data.cFileName);
-
+ dp->direntry.d_name= BLI_alloc_utf_8_from_16(dp->data.cFileName, 0);
+
return &dp->direntry;
- } else if (FindNextFile (dp->handle, &(dp->data))) {
- dp->direntry.d_name= BLI_strdup(dp->data.cFileName);
+ }
+ else if (FindNextFileW (dp->handle, &(dp->data))) {
+ dp->direntry.d_name= BLI_alloc_utf_8_from_16(dp->data.cFileName,0);
return &dp->direntry;
- } else {
+ }
+ else {
return NULL;
}
}
@@ -227,23 +260,25 @@ 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] = ':';
root[2] = '\\';
root[3] = '\0';
- } else {
+ }
+ 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];
root[1] = ':';
root[2] = '\\';
root[3] = '\0';
- } else {
+ }
+ else {
DWORD tmp;
int i;
int rc = 0;
@@ -303,15 +338,15 @@ int check_file_chars(char *filename)
char* dirname(char *path)
{
char *p;
- if( path == NULL || *path == '\0' )
+ if ( path == NULL || *path == '\0' )
return ".";
p = path + strlen(path) - 1;
- while( *p == '/' ) {
- if( p == path )
+ while ( *p == '/' ) {
+ if ( p == path )
return path;
*p-- = '\0';
}
- while( p >= path && *p != '/' )
+ while ( p >= path && *p != '/' )
p--;
return
p < path ? "." :
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h
index 52d06c36bdf..bddaa5f67d6 100644
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@ -78,10 +78,10 @@ typedef struct BlendFileData {
* returns NULL and sets a report in the list if
* it cannot open the file.
*
- * @param filepath The path of the file to open.
- * @param reports If the return value is NULL, errors
+ * \param filepath The path of the file to open.
+ * \param reports If the return value is NULL, errors
* indicating the cause of the failure.
- * @return The data of the file.
+ * \return The data of the file.
*/
BlendFileData* BLO_read_from_file(const char *filepath, struct ReportList *reports);
@@ -90,11 +90,11 @@ BlendFileData* BLO_read_from_file(const char *filepath, struct ReportList *repor
* returns NULL and sets a report in the list if
* it cannot open the file.
*
- * @param mem The file data.
- * @param memsize The length of @a mem.
- * @param reports If the return value is NULL, errors
+ * \param mem The file data.
+ * \param memsize The length of \a mem.
+ * \param reports If the return value is NULL, errors
* indicating the cause of the failure.
- * @return The data of the file.
+ * \return The data of the file.
*/
BlendFileData* BLO_read_from_memory(void *mem, int memsize, struct ReportList *reports);
@@ -109,7 +109,7 @@ BlendFileData *BLO_read_from_memfile(struct Main *oldmain, const char *filename,
* data associated with it (the userdef data, and
* the main libblock data).
*
- * @param bfd The structure to free.
+ * \param bfd The structure to free.
*/
void
BLO_blendfiledata_free(
@@ -118,9 +118,9 @@ BLO_blendfiledata_free(
/**
* Open a blendhandle from a file path.
*
- * @param file The file path to open.
- * @param reports Report errors in opening the file (can be NULL).
- * @return A handle on success, or NULL on failure.
+ * \param file The file path to open.
+ * \param reports Report errors in opening the file (can be NULL).
+ * \return A handle on success, or NULL on failure.
*/
BlendHandle*
BLO_blendhandle_from_file(
@@ -130,9 +130,9 @@ BLO_blendhandle_from_file(
/**
* Open a blendhandle from memory.
*
- * @param mem The data to load from.
- * @param memsize The size of the data.
- * @return A handle on success, or NULL on failure.
+ * \param mem The data to load from.
+ * \param memsize The size of the data.
+ * \return A handle on success, or NULL on failure.
*/
BlendHandle*
@@ -145,10 +145,10 @@ BLO_blendhandle_from_memory(
* of a certain type (ie. All the scene names in
* a file).
*
- * @param bh The blendhandle to access.
- * @param ofblocktype The type of names to get.
- * @param tot_names The length of the returned list.
- * @return A BLI_linklist of strings. The string links
+ * \param bh The blendhandle to access.
+ * \param ofblocktype The type of names to get.
+ * \param tot_names The length of the returned list.
+ * \return A BLI_linklist of strings. The string links
* should be freed with malloc.
*/
struct LinkNode*
@@ -162,10 +162,10 @@ BLO_blendhandle_get_datablock_names(
* of a certain type (ie. All the scene names in
* a file).
*
- * @param bh The blendhandle to access.
- * @param ofblocktype The type of names to get.
- * @param tot_prev The length of the returned list.
- * @return A BLI_linklist of PreviewImage. The PreviewImage links
+ * \param bh The blendhandle to access.
+ * \param ofblocktype The type of names to get.
+ * \param tot_prev The length of the returned list.
+ * \return A BLI_linklist of PreviewImage. The PreviewImage links
* should be freed with malloc.
*/
struct LinkNode*
@@ -179,8 +179,8 @@ BLO_blendhandle_get_previews(
* file. (ie. file contains Scene, Mesh, and Lamp
* datablocks).
*
- * @param bh The blendhandle to access.
- * @return A BLI_linklist of strings. The string links
+ * \param bh The blendhandle to access.
+ * \return A BLI_linklist of strings. The string links
* should be freed with malloc.
*/
struct LinkNode*
@@ -191,7 +191,7 @@ BLO_blendhandle_get_linkable_groups(
* Close and free a blendhandle. The handle
* becomes invalid after this call.
*
- * @param bh The handle to close.
+ * \param bh The handle to close.
*/
void
BLO_blendhandle_close(
@@ -212,10 +212,10 @@ int BLO_is_a_library(const char *path, char *dir, char *group);
/**
* Initialize the BlendHandle for appending or linking library data.
*
- * @param mainvar The current main database eg G.main or CTX_data_main(C).
- * @param bh A blender file handle as returned by BLO_blendhandle_from_file or BLO_blendhandle_from_memory.
- * @param filepath Used for relative linking, copied to the lib->name
- * @return the library Main, to be passed to BLO_library_append_named_part as mainl.
+ * \param mainvar The current main database eg G.main or CTX_data_main(C).
+ * \param bh A blender file handle as returned by BLO_blendhandle_from_file or BLO_blendhandle_from_memory.
+ * \param filepath Used for relative linking, copied to the lib->name
+ * \return the library Main, to be passed to BLO_library_append_named_part as mainl.
*/
struct Main* BLO_library_append_begin(struct Main *mainvar, BlendHandle** bh, const char *filepath);
@@ -223,11 +223,11 @@ struct Main* BLO_library_append_begin(struct Main *mainvar, BlendHandle** bh, co
/**
* Link/Append a named datablock from an external blend file.
*
- * @param mainl The main database to link from (not the active one).
- * @param bh The blender file handle.
- * @param idname The name of the datablock (without the 2 char ID prefix)
- * @param idcode The kind of datablock to link.
- * @return the appended ID when found.
+ * \param mainl The main database to link from (not the active one).
+ * \param bh The blender file handle.
+ * \param idname The name of the datablock (without the 2 char ID prefix)
+ * \param idcode The kind of datablock to link.
+ * \return the appended ID when found.
*/
struct ID *BLO_library_append_named_part(struct Main *mainl, BlendHandle** bh, const char *idname, const int idcode);
@@ -235,13 +235,13 @@ struct ID *BLO_library_append_named_part(struct Main *mainl, BlendHandle** bh, c
* Link/Append a named datablock from an external blend file.
* optionally instance the object in the scene when the flags are set.
*
- * @param C The context, when NULL instancing object in the scene isnt done.
- * @param mainl The main database to link from (not the active one).
- * @param bh The blender file handle.
- * @param idname The name of the datablock (without the 2 char ID prefix)
- * @param idcode The kind of datablock to link.
- * @param flag Options for linking, used for instancing.
- * @return the appended ID when found.
+ * \param C The context, when NULL instancing object in the scene isn't done.
+ * \param mainl The main database to link from (not the active one).
+ * \param bh The blender file handle.
+ * \param idname The name of the datablock (without the 2 char ID prefix)
+ * \param idcode The kind of datablock to link.
+ * \param flag Options for linking, used for instancing.
+ * \return the appended ID when found.
*/
struct ID *BLO_library_append_named_part_ex(const struct bContext *C, struct Main *mainl, BlendHandle** bh, const char *idname, const int idcode, const short flag);
diff --git a/source/blender/blenloader/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/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 6e4dcb66bfb..ccf0c226570 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -115,7 +115,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
buf[2]= buf[2]?buf[2]:' ';
buf[3]= buf[3]?buf[3]:' ';
- fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (long int)(bhead->len+sizeof(BHead)));
+ fprintf(fp, "['%.4s', '%s', %d, %ld ],\n", buf, name, bhead->nr, (long int)(bhead->len+sizeof(BHead)));
}
}
fprintf(fp, "]\n");
@@ -134,7 +134,8 @@ LinkNode *BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype,
BLI_linklist_prepend(&names, strdup(idname+2));
tot++;
- } else if (bhead->code==ENDB)
+ }
+ else if (bhead->code==ENDB)
break;
}
@@ -170,7 +171,8 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
default:
break;
}
- } else if (bhead->code==DATA) {
+ }
+ else if (bhead->code==DATA) {
if (looking) {
if (bhead->SDNAnr == DNA_struct_find_nr(fd->filesdna, "PreviewImage") ) {
prv = BLO_library_read_struct(fd, bhead, "PreviewImage");
@@ -182,7 +184,8 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
bhead= blo_nextbhead(fd, bhead);
rect = (unsigned int*)(bhead+1);
memcpy(new_prv->rect[0], rect, bhead->len);
- } else {
+ }
+ else {
new_prv->rect[0] = NULL;
}
@@ -192,16 +195,19 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
bhead= blo_nextbhead(fd, bhead);
rect = (unsigned int*)(bhead+1);
memcpy(new_prv->rect[1], rect, bhead->len);
- } else {
+ }
+ else {
new_prv->rect[1] = NULL;
}
MEM_freeN(prv);
}
}
}
- } else if (bhead->code==ENDB) {
+ }
+ else if (bhead->code==ENDB) {
break;
- } else {
+ }
+ else {
looking = 0;
new_prv = NULL;
prv = NULL;
@@ -223,7 +229,8 @@ LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh)
for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) {
if (bhead->code==ENDB) {
break;
- } else if (BKE_idcode_is_valid(bhead->code)) {
+ }
+ else if (BKE_idcode_is_valid(bhead->code)) {
if (BKE_idcode_is_linkable(bhead->code)) {
const char *str= BKE_idcode_to_name(bhead->code);
@@ -313,7 +320,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil
blo_end_movieclip_pointer_map(fd, oldmain);
/* move libraries from old main to new main */
- if(bfd && mainlist.first!=mainlist.last) {
+ if (bfd && mainlist.first!=mainlist.last) {
/* Library structs themselves */
bfd->main->library= oldmain->library;
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 180ccaddb0a..798c48dfaac 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -272,7 +272,7 @@ static void BKE_reportf_wrap(ReportList *reports, ReportType type, const char *f
BKE_report(reports, type, fixed_buf);
- if(G.background==0) {
+ if (G.background==0) {
printf("%s\n", fixed_buf);
}
}
@@ -291,8 +291,8 @@ static int verg_oldnewmap(const void *v1, const void *v2)
{
const struct OldNew *x1=v1, *x2=v2;
- if( x1->old > x2->old) return 1;
- else if( x1->old < x2->old) return -1;
+ if ( x1->old > x2->old) return 1;
+ else if ( x1->old < x2->old) return -1;
return 0;
}
@@ -308,7 +308,7 @@ static void oldnewmap_insert(OldNewMap *onm, void *oldaddr, void *newaddr, int n
{
OldNew *entry;
- if(oldaddr==NULL || newaddr==NULL) return;
+ if (oldaddr==NULL || newaddr==NULL) return;
if (onm->nentries==onm->entriessize) {
int osize= onm->entriessize;
@@ -331,7 +331,7 @@ static void *oldnewmap_lookup_and_inc(OldNewMap *onm, void *addr)
{
int i;
- if(addr==NULL) return NULL;
+ if (addr==NULL) return NULL;
if (onm->lasthit<onm->nentries-1) {
OldNew *entry= &onm->entries[++onm->lasthit];
@@ -361,16 +361,16 @@ static void *oldnewmap_liblookup(OldNewMap *onm, void *addr, void *lib)
{
int i;
- if(addr==NULL) return NULL;
+ if (addr==NULL) return NULL;
/* lasthit works fine for non-libdata, linking there is done in same sequence as writing */
- if(onm->sorted) {
+ if (onm->sorted) {
OldNew entry_s, *entry;
entry_s.old= addr;
entry= bsearch(&entry_s, onm->entries, onm->nentries, sizeof(OldNew), verg_oldnewmap);
- if(entry) {
+ if (entry) {
ID *id= entry->newp;
if (id && (!lib || id->lib)) {
@@ -432,7 +432,7 @@ static void add_main_to_main(Main *mainvar, Main *from)
set_listbasepointers(mainvar, lbarray);
a= set_listbasepointers(from, fromarray);
- while(a--) {
+ while (a--) {
BLI_movelisttolist(lbarray[a], fromarray[a]);
}
}
@@ -457,12 +457,12 @@ static void split_libdata(ListBase *lb, Main *first)
Main *mainvar;
id= lb->first;
- while(id) {
+ while (id) {
idnext= id->next;
- if(id->lib) {
+ if (id->lib) {
mainvar= first;
- while(mainvar) {
- if(mainvar->curlib==id->lib) {
+ while (mainvar) {
+ if (mainvar->curlib==id->lib) {
lbn= which_libbase(mainvar, GS(id->name));
BLI_remlink(lb, id);
BLI_addtail(lbn, id);
@@ -470,7 +470,7 @@ static void split_libdata(ListBase *lb, Main *first)
}
mainvar= mainvar->next;
}
- if(mainvar==NULL) printf("error split_libdata\n");
+ if (mainvar==NULL) printf("error split_libdata\n");
}
id= idnext;
}
@@ -485,7 +485,7 @@ void blo_split_main(ListBase *mainlist, Main *main)
mainlist->first= mainlist->last= main;
main->next= NULL;
- if(main->library.first==NULL)
+ if (main->library.first==NULL)
return;
for (lib= main->library.first; lib; lib= lib->id.next) {
@@ -495,7 +495,7 @@ void blo_split_main(ListBase *mainlist, Main *main)
}
i= set_listbasepointers(main, lbarray);
- while(i--)
+ while (i--)
split_libdata(lbarray[i], main->next);
}
@@ -516,7 +516,7 @@ static void read_file_version(FileData *fd, Main *main)
for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) {
if (bhead->code==GLOB) {
FileGlobal *fg= read_struct(fd, bhead, "Global");
- if(fg) {
+ if (fg) {
main->subversionfile= fg->subversion;
main->minversionfile= fg->minversion;
main->minsubversionfile= fg->minsubversion;
@@ -544,7 +544,7 @@ static Main *blo_find_main(FileData *fd, ListBase *mainlist, const char *filepat
char *libname= (m->curlib)?m->curlib->filepath:m->name;
if (BLI_path_cmp(name1, libname) == 0) {
- if(G.f & G_DEBUG) printf("blo_find_main: found library %s\n", libname);
+ if (G.debug & G_DEBUG) printf("blo_find_main: found library %s\n", libname);
return m;
}
}
@@ -560,7 +560,7 @@ static Main *blo_find_main(FileData *fd, ListBase *mainlist, const char *filepat
read_file_version(fd, m);
- if(G.f & G_DEBUG) printf("blo_find_main: added new lib %s\n", filepath);
+ if (G.debug & G_DEBUG) printf("blo_find_main: added new lib %s\n", filepath);
return m;
}
@@ -570,7 +570,7 @@ static Main *blo_find_main(FileData *fd, ListBase *mainlist, const char *filepat
static void switch_endian_bh4(BHead4 *bhead)
{
/* the ID_.. codes */
- if((bhead->code & 0xFFFF)==0) bhead->code >>=16;
+ if ((bhead->code & 0xFFFF)==0) bhead->code >>=16;
if (bhead->code != ENDB) {
SWITCH_INT(bhead->len);
@@ -582,7 +582,7 @@ static void switch_endian_bh4(BHead4 *bhead)
static void switch_endian_bh8(BHead8 *bhead)
{
/* the ID_.. codes */
- if((bhead->code & 0xFFFF)==0) bhead->code >>=16;
+ if ((bhead->code & 0xFFFF)==0) bhead->code >>=16;
if (bhead->code != ENDB) {
SWITCH_INT(bhead->len);
@@ -666,14 +666,17 @@ static BHeadN *get_bhead(FileData *fd)
if (fd->flags & FD_FLAGS_POINTSIZE_DIFFERS) {
bh8_from_bh4(&bhead, &bhead4);
- } else {
+ }
+ else {
memcpy(&bhead, &bhead4, sizeof(bhead));
}
- } else {
+ }
+ else {
fd->eof = 1;
bhead.len= 0;
}
- } else {
+ }
+ else {
bhead8.code = DATA;
readsize = fd->read(fd, &bhead8, sizeof(bhead8));
@@ -684,10 +687,12 @@ static BHeadN *get_bhead(FileData *fd)
if (fd->flags & FD_FLAGS_POINTSIZE_DIFFERS) {
bh4_from_bh8(&bhead, &bhead8, (fd->flags & FD_FLAGS_SWITCH_ENDIAN));
- } else {
+ }
+ else {
memcpy(&bhead, &bhead8, sizeof(bhead));
}
- } else {
+ }
+ else {
fd->eof = 1;
bhead.len= 0;
}
@@ -712,7 +717,8 @@ static BHeadN *get_bhead(FileData *fd)
MEM_freeN(new_bhead);
new_bhead = NULL;
}
- } else {
+ }
+ else {
fd->eof = 1;
}
}
@@ -792,18 +798,19 @@ static void decode_blender_header(FileData *fd)
readsize = fd->read(fd, header, sizeof(header));
if (readsize == sizeof(header)) {
- if(strncmp(header, "BLENDER", 7) == 0) {
+ if (strncmp(header, "BLENDER", 7) == 0) {
int remove_this_endian_test= 1;
fd->flags |= FD_FLAGS_FILE_OK;
// what size are pointers in the file ?
- if(header[7]=='_') {
+ if (header[7]=='_') {
fd->flags |= FD_FLAGS_FILE_POINTSIZE_IS_4;
if (sizeof(void *) != 4) {
fd->flags |= FD_FLAGS_POINTSIZE_DIFFERS;
}
- } else {
+ }
+ else {
if (sizeof(void *) != 8) {
fd->flags |= FD_FLAGS_POINTSIZE_DIFFERS;
}
@@ -841,7 +848,8 @@ static int read_file_dna(FileData *fd)
}
return 1;
- } else if (bhead->code==ENDB)
+ }
+ else if (bhead->code==ENDB)
break;
}
@@ -854,7 +862,8 @@ static int fd_read_from_file(FileData *filedata, void *buffer, unsigned int size
if (readsize < 0) {
readsize = EOF;
- } else {
+ }
+ else {
filedata->seek += readsize;
}
@@ -867,7 +876,8 @@ static int fd_read_gzip_from_file(FileData *filedata, void *buffer, unsigned int
if (readsize < 0) {
readsize = EOF;
- } else {
+ }
+ else {
filedata->seek += readsize;
}
@@ -892,14 +902,14 @@ static int fd_read_from_memfile(FileData *filedata, void *buffer, unsigned int s
static MemFileChunk *chunk=NULL;
unsigned int chunkoffset, readsize, totread;
- if(size==0) return 0;
+ if (size==0) return 0;
- if(seek != (unsigned int)filedata->seek) {
+ if (seek != (unsigned int)filedata->seek) {
chunk= filedata->memfile->chunks.first;
seek= 0;
- while(chunk) {
- if(seek + chunk->size > (unsigned) filedata->seek) break;
+ while (chunk) {
+ if (seek + chunk->size > (unsigned) filedata->seek) break;
seek+= chunk->size;
chunk= chunk->next;
}
@@ -907,18 +917,18 @@ static int fd_read_from_memfile(FileData *filedata, void *buffer, unsigned int s
seek= filedata->seek;
}
- if(chunk) {
+ if (chunk) {
totread= 0;
do {
/* first check if it's on the end if current chunk */
- if(seek-offset == chunk->size) {
+ if (seek-offset == chunk->size) {
offset+= chunk->size;
chunk= chunk->next;
}
/* debug, should never happen */
- if(chunk==NULL) {
+ if (chunk==NULL) {
printf("illegal read, chunk zero\n");
return 0;
}
@@ -929,14 +939,14 @@ static int fd_read_from_memfile(FileData *filedata, void *buffer, unsigned int s
/* data can be spread over multiple chunks, so clamp size
* to within this chunk, and then it will read further in
* the next chunk */
- if(chunkoffset+readsize > chunk->size)
+ if (chunkoffset+readsize > chunk->size)
readsize= chunk->size-chunkoffset;
memcpy((char*)buffer+totread, chunk->buf+chunkoffset, readsize);
totread += readsize;
filedata->seek += readsize;
seek += readsize;
- } while(totread < size);
+ } while (totread < size);
return totread;
}
@@ -952,7 +962,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);
@@ -990,12 +1000,13 @@ FileData *blo_openblenderfile(const char *filepath, ReportList *reports)
{
gzFile gzfile;
errno= 0;
- gzfile= gzopen(filepath, "rb");
+ gzfile= BLI_gzopen(filepath, "rb");
if (gzfile == (gzFile)Z_NULL) {
BKE_reportf(reports, RPT_ERROR, "Unable to open \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error reading file");
return NULL;
- } else {
+ }
+ else {
FileData *fd = filedata_new();
fd->gzfiledes = gzfile;
fd->read = fd_read_gzip_from_file;
@@ -1012,7 +1023,8 @@ FileData *blo_openblendermemory(void *mem, int memsize, ReportList *reports)
if (!mem || memsize<SIZEOFBLENDERHEADER) {
BKE_report(reports, RPT_ERROR, (mem)? "Unable to read": "Unable to open");
return NULL;
- } else {
+ }
+ else {
FileData *fd= filedata_new();
fd->buffer= mem;
fd->buffersize= memsize;
@@ -1028,7 +1040,8 @@ FileData *blo_openblendermemfile(MemFile *memfile, ReportList *reports)
if (!memfile) {
BKE_report(reports, RPT_ERROR, "Unable to open blend <memory>");
return NULL;
- } else {
+ }
+ else {
FileData *fd= filedata_new();
fd->memfile= memfile;
@@ -1102,8 +1115,8 @@ int BLO_is_a_library(const char *path, char *dir, char *group)
strcpy(dir, path);
len= strlen(dir);
- if(len<7) return 0;
- if( dir[len-1] != '/' && dir[len-1] != '\\') return 0;
+ if (len<7) return 0;
+ if ( dir[len-1] != '/' && dir[len-1] != '\\') return 0;
group[0]= 0;
dir[len-1]= 0;
@@ -1111,9 +1124,9 @@ int BLO_is_a_library(const char *path, char *dir, char *group)
/* Find the last slash */
fd= BLI_last_slash(dir);
- if(fd==NULL) return 0;
+ if (fd==NULL) return 0;
*fd= 0;
- if(BLO_has_bfile_extension(fd+1)) {
+ if (BLO_has_bfile_extension(fd+1)) {
/* the last part of the dir is a .blend file, no group follows */
*fd= '/'; /* put back the removed slash separating the dir and the .blend file name */
}
@@ -1146,14 +1159,14 @@ static void *newglobadr(FileData *fd, void *adr) /* direct datablocks with glob
static void *newimaadr(FileData *fd, void *adr) /* used to restore image data after undo */
{
- if(fd->imamap && adr)
+ if (fd->imamap && adr)
return oldnewmap_lookup_and_inc(fd->imamap, adr);
return NULL;
}
static void *newmclipadr(FileData *fd, void *adr) /* used to restore movie clip data after undo */
{
- if(fd->movieclipmap && adr)
+ if (fd->movieclipmap && adr)
return oldnewmap_lookup_and_inc(fd->movieclipmap, adr);
return NULL;
}
@@ -1168,7 +1181,7 @@ static void *newlibadr_us(FileData *fd, void *lib, void *adr) /* increases user
{
ID *id= newlibadr(fd, lib, adr);
- if(id)
+ if (id)
id->us++;
return id;
@@ -1183,7 +1196,7 @@ static void change_idid_adr_fd(FileData *fd, void *old, void *new)
if (old==entry->newp && entry->nr==ID_ID) {
entry->newp= new;
- if(new) entry->nr= GS( ((ID *)new)->name );
+ if (new) entry->nr= GS( ((ID *)new)->name );
break;
}
}
@@ -1193,13 +1206,13 @@ static void change_idid_adr(ListBase *mainlist, FileData *basefd, void *old, voi
{
Main *mainptr;
- for(mainptr= mainlist->first; mainptr; mainptr= mainptr->next) {
+ for (mainptr= mainlist->first; mainptr; mainptr= mainptr->next) {
FileData *fd;
- if(mainptr->curlib) fd= mainptr->curlib->filedata;
+ if (mainptr->curlib) fd= mainptr->curlib->filedata;
else fd= basefd;
- if(fd) {
+ if (fd) {
change_idid_adr_fd(fd, old, new);
}
}
@@ -1213,8 +1226,8 @@ void blo_clear_proxy_pointers_from_lib(Main *oldmain)
{
Object *ob= oldmain->object.first;
- for(;ob; ob= ob->id.next)
- if(ob->id.lib)
+ for (;ob; ob= ob->id.next)
+ if (ob->id.lib)
ob->proxy_from= NULL;
}
@@ -1226,20 +1239,20 @@ void blo_make_image_pointer_map(FileData *fd, Main *oldmain)
fd->imamap= oldnewmap_new();
- for(;ima; ima= ima->id.next) {
+ for (;ima; ima= ima->id.next) {
Link *ibuf= ima->ibufs.first;
- for(; ibuf; ibuf= ibuf->next)
+ for (; ibuf; ibuf= ibuf->next)
oldnewmap_insert(fd->imamap, ibuf, ibuf, 0);
- if(ima->gputexture)
+ if (ima->gputexture)
oldnewmap_insert(fd->imamap, ima->gputexture, ima->gputexture, 0);
- for(a=0; a<IMA_MAX_RENDER_SLOT; a++)
- if(ima->renders[a])
+ for (a=0; a<IMA_MAX_RENDER_SLOT; a++)
+ if (ima->renders[a])
oldnewmap_insert(fd->imamap, ima->renders[a], ima->renders[a], 0);
}
- for(; sce; sce= sce->id.next) {
- if(sce->nodetree) {
+ for (; sce; sce= sce->id.next) {
+ if (sce->nodetree) {
bNode *node;
- for(node= sce->nodetree->nodes.first; node; node= node->next)
+ for (node= sce->nodetree->nodes.first; node; node= node->next)
oldnewmap_insert(fd->imamap, node->preview, node->preview, 0);
}
}
@@ -1260,27 +1273,27 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain)
entry->newp= NULL;
}
- for(;ima; ima= ima->id.next) {
+ for (;ima; ima= ima->id.next) {
Link *ibuf, *next;
/* this mirrors direct_link_image */
- for(ibuf= ima->ibufs.first; ibuf; ibuf= next) {
+ for (ibuf= ima->ibufs.first; ibuf; ibuf= next) {
next= ibuf->next;
- if(NULL==newimaadr(fd, ibuf)) { /* so was restored */
+ if (NULL==newimaadr(fd, ibuf)) { /* so was restored */
BLI_remlink(&ima->ibufs, ibuf);
ima->bindcode= 0;
ima->gputexture= NULL;
}
}
- for(i=0; i<IMA_MAX_RENDER_SLOT; i++)
+ for (i=0; i<IMA_MAX_RENDER_SLOT; i++)
ima->renders[i]= newimaadr(fd, ima->renders[i]);
ima->gputexture= newimaadr(fd, ima->gputexture);
}
- for(; sce; sce= sce->id.next) {
- if(sce->nodetree) {
+ for (; sce; sce= sce->id.next) {
+ if (sce->nodetree) {
bNode *node;
- for(node= sce->nodetree->nodes.first; node; node= node->next)
+ for (node= sce->nodetree->nodes.first; node; node= node->next)
node->preview= newimaadr(fd, node->preview);
}
}
@@ -1293,19 +1306,19 @@ void blo_make_movieclip_pointer_map(FileData *fd, Main *oldmain)
fd->movieclipmap= oldnewmap_new();
- for(;clip; clip= clip->id.next) {
- if(clip->cache)
+ for (;clip; clip= clip->id.next) {
+ if (clip->cache)
oldnewmap_insert(fd->movieclipmap, clip->cache, clip->cache, 0);
- if(clip->tracking.camera.intrinsics)
+ if (clip->tracking.camera.intrinsics)
oldnewmap_insert(fd->movieclipmap, clip->tracking.camera.intrinsics, clip->tracking.camera.intrinsics, 0);
}
- for(; sce; sce= sce->id.next) {
- if(sce->nodetree) {
+ for (; sce; sce= sce->id.next) {
+ if (sce->nodetree) {
bNode *node;
- for(node= sce->nodetree->nodes.first; node; node= node->next)
- if(node->type==CMP_NODE_MOVIEDISTORTION)
+ for (node= sce->nodetree->nodes.first; node; node= node->next)
+ if (node->type==CMP_NODE_MOVIEDISTORTION)
oldnewmap_insert(fd->movieclipmap, node->storage, node->storage, 0);
}
}
@@ -1326,16 +1339,16 @@ void blo_end_movieclip_pointer_map(FileData *fd, Main *oldmain)
entry->newp= NULL;
}
- for(;clip; clip= clip->id.next) {
+ for (;clip; clip= clip->id.next) {
clip->cache= newmclipadr(fd, clip->cache);
clip->tracking.camera.intrinsics= newmclipadr(fd, clip->tracking.camera.intrinsics);
}
- for(; sce; sce= sce->id.next) {
- if(sce->nodetree) {
+ for (; sce; sce= sce->id.next) {
+ if (sce->nodetree) {
bNode *node;
- for(node= sce->nodetree->nodes.first; node; node= node->next)
- if(node->type==CMP_NODE_MOVIEDISTORTION)
+ for (node= sce->nodetree->nodes.first; node; node= node->next)
+ if (node->type==CMP_NODE_MOVIEDISTORTION)
node->storage= newmclipadr(fd, node->storage);
}
}
@@ -1348,11 +1361,11 @@ void blo_add_library_pointer_map(ListBase *mainlist, FileData *fd)
Main *ptr= mainlist->first;
ListBase *lbarray[MAX_LIBARRAY];
- for(ptr= ptr->next; ptr; ptr= ptr->next) {
+ for (ptr= ptr->next; ptr; ptr= ptr->next) {
int i= set_listbasepointers(ptr, lbarray);
- while(i--) {
+ while (i--) {
ID *id;
- for(id= lbarray[i]->first; id; id= id->next)
+ for (id= lbarray[i]->first; id; id= id->next)
oldnewmap_insert(fd->libmap, id, id, GS(id->name));
}
}
@@ -1371,7 +1384,7 @@ static void switch_endian_structs(struct SDNA *filesdna, BHead *bhead)
blocksize= filesdna->typelens[ filesdna->structs[bhead->SDNAnr][0] ];
nblocks= bhead->nr;
- while(nblocks--) {
+ while (nblocks--) {
DNA_struct_switch_endian(filesdna, bhead->SDNAnr, data);
data+= blocksize;
@@ -1388,9 +1401,10 @@ static void *read_struct(FileData *fd, BHead *bh, const char *blockname)
switch_endian_structs(fd->filesdna, bh);
if (fd->compflags[bh->SDNAnr]) { /* flag==0: doesn't exist anymore */
- if(fd->compflags[bh->SDNAnr]==2) {
+ if (fd->compflags[bh->SDNAnr]==2) {
temp= DNA_struct_reconstruct(fd->memsdna, fd->filesdna, fd->compflags, bh->SDNAnr, bh->nr, (bh+1));
- } else {
+ }
+ else {
temp= MEM_mallocN(bh->len, blockname);
memcpy(temp, (bh+1), bh->len);
}
@@ -1404,12 +1418,12 @@ static void link_list(FileData *fd, ListBase *lb) /* only direct data */
{
Link *ln, *prev;
- if(lb->first==NULL) return;
+ if (lb->first==NULL) return;
lb->first= newdataadr(fd, lb->first);
ln= lb->first;
prev= NULL;
- while(ln) {
+ while (ln) {
ln->next= newdataadr(fd, ln->next);
ln->prev= prev;
prev= ln;
@@ -1423,18 +1437,18 @@ static void link_glob_list(FileData *fd, ListBase *lb) /* for glob data */
Link *ln, *prev;
void *poin;
- if(lb->first==NULL) return;
+ if (lb->first==NULL) return;
poin= newdataadr(fd, lb->first);
- if(lb->first) {
+ if (lb->first) {
oldnewmap_insert(fd->globmap, lb->first, poin, 0);
}
lb->first= poin;
ln= lb->first;
prev= NULL;
- while(ln) {
+ while (ln) {
poin= newdataadr(fd, ln->next);
- if(ln->next) {
+ if (ln->next) {
oldnewmap_insert(fd->globmap, ln->next, poin, 0);
}
ln->next= poin;
@@ -1459,15 +1473,15 @@ static void test_pointer_array(FileData *fd, void **mat)
* the old dna format to a pointer array in
* the new dna format.
*/
- if(*mat) {
+ if (*mat) {
len= MEM_allocN_len(*mat)/fd->filesdna->pointerlen;
- if(fd->filesdna->pointerlen==8 && fd->memsdna->pointerlen==4) {
+ if (fd->filesdna->pointerlen==8 && fd->memsdna->pointerlen==4) {
ipoin=imat= MEM_mallocN( len*4, "newmatar");
lpoin= *mat;
- while(len-- > 0) {
- if((fd->flags & FD_FLAGS_SWITCH_ENDIAN))
+ while (len-- > 0) {
+ if ((fd->flags & FD_FLAGS_SWITCH_ENDIAN))
SWITCH_LONGINT(*lpoin);
*ipoin= (int) ((*lpoin) >> 3);
ipoin++;
@@ -1477,11 +1491,11 @@ static void test_pointer_array(FileData *fd, void **mat)
*mat= imat;
}
- if(fd->filesdna->pointerlen==4 && fd->memsdna->pointerlen==8) {
+ if (fd->filesdna->pointerlen==4 && fd->memsdna->pointerlen==8) {
lpoin=lmat= MEM_mallocN( len*8, "newmatar");
ipoin= *mat;
- while(len-- > 0) {
+ while (len-- > 0) {
*lpoin= *ipoin;
ipoin++;
lpoin++;
@@ -1509,14 +1523,14 @@ static void IDP_DirectLinkIDPArray(IDProperty *prop, int switch_endian, FileData
array= (IDProperty*) prop->data.pointer;
/* note!, idp-arrays didn't exist in 2.4x, so the pointer will be cleared
- * theres not really anything we can do to correct this, at least dont crash */
- if(array==NULL) {
+ * theres not really anything we can do to correct this, at least don't crash */
+ if (array==NULL) {
prop->len= 0;
prop->totallen= 0;
}
- for(i=0; i<prop->len; i++)
+ for (i=0; i<prop->len; i++)
IDP_DirectLinkProperty(&array[i], switch_endian, fd);
}
@@ -1529,14 +1543,14 @@ static void IDP_DirectLinkArray(IDProperty *prop, int switch_endian, FileData *f
prop->totallen = prop->len;
prop->data.pointer = newdataadr(fd, prop->data.pointer);
- if(prop->subtype == IDP_GROUP) {
+ if (prop->subtype == IDP_GROUP) {
test_pointer_array(fd, prop->data.pointer);
array= prop->data.pointer;
- for(i=0; i<prop->len; i++)
+ for (i=0; i<prop->len; i++)
IDP_DirectLinkProperty(array[i], switch_endian, fd);
}
- else if(prop->subtype == IDP_DOUBLE) {
+ else if (prop->subtype == IDP_DOUBLE) {
if (switch_endian) {
for (i=0; i<prop->len; i++) {
SWITCH_LONGINT(((double*)prop->data.pointer)[i]);
@@ -1623,7 +1637,7 @@ static void direct_link_curvemapping(FileData *fd, CurveMapping *cumap)
/* flag seems to be able to hang? Maybe old files... not bad to clear anyway */
cumap->flag &= ~CUMA_PREMULLED;
- for(a=0; a<CM_TOT; a++) {
+ for (a=0; a<CM_TOT; a++) {
cumap->cm[a].curve= newdataadr(fd, cumap->cm[a].curve);
cumap->cm[a].table= NULL;
cumap->cm[a].premultable= NULL;
@@ -1637,8 +1651,8 @@ static void lib_link_brush(FileData *fd, Main *main)
Brush *brush;
/* only link ID pointers */
- for(brush= main->brush.first; brush; brush= brush->id.next) {
- if(brush->id.flag & LIB_NEEDLINK) {
+ for (brush= main->brush.first; brush; brush= brush->id.next) {
+ if (brush->id.flag & LIB_NEEDLINK) {
brush->id.flag -= LIB_NEEDLINK;
brush->mtex.tex= newlibadr_us(fd, brush->id.lib, brush->mtex.tex);
@@ -1653,7 +1667,7 @@ static void direct_link_brush(FileData *fd, Brush *brush)
/* fallof curve */
brush->curve= newdataadr(fd, brush->curve);
- if(brush->curve)
+ if (brush->curve)
direct_link_curvemapping(fd, brush->curve);
else
brush_curve_preset(brush, CURVE_PRESET_SHARP);
@@ -1665,7 +1679,7 @@ static void direct_link_brush(FileData *fd, Brush *brush)
static void direct_link_script(FileData *UNUSED(fd), Script *script)
{
script->id.us = 1;
- SCRIPT_SET_NULL(script)
+ SCRIPT_SET_NULL(script);
}
@@ -1710,11 +1724,11 @@ static void lib_link_ipo(FileData *fd, Main *main)
Ipo *ipo;
ipo= main->ipo.first;
- while(ipo) {
- if(ipo->id.flag & LIB_NEEDLINK) {
+ while (ipo) {
+ if (ipo->id.flag & LIB_NEEDLINK) {
IpoCurve *icu;
- for(icu= ipo->curve.first; icu; icu= icu->next) {
- if(icu->driver)
+ for (icu= ipo->curve.first; icu; icu= icu->next) {
+ if (icu->driver)
icu->driver->ob= newlibadr(fd, ipo->id.lib, icu->driver->ob);
}
ipo->id.flag -= LIB_NEEDLINK;
@@ -1730,7 +1744,7 @@ static void direct_link_ipo(FileData *fd, Ipo *ipo)
link_list(fd, &(ipo->curve));
icu= ipo->curve.first;
- while(icu) {
+ while (icu) {
icu->bezt= newdataadr(fd, icu->bezt);
icu->bp= newdataadr(fd, icu->bp);
icu->driver= newdataadr(fd, icu->driver);
@@ -1744,11 +1758,11 @@ static void lib_link_nlastrips(FileData *fd, ID *id, ListBase *striplist)
bActionStrip *strip;
bActionModifier *amod;
- for (strip=striplist->first; strip; strip=strip->next){
+ for (strip=striplist->first; strip; strip=strip->next) {
strip->object = newlibadr(fd, id->lib, strip->object);
strip->act = newlibadr_us(fd, id->lib, strip->act);
strip->ipo = newlibadr(fd, id->lib, strip->ipo);
- for(amod= strip->modifiers.first; amod; amod= amod->next)
+ for (amod= strip->modifiers.first; amod; amod= amod->next)
amod->ob= newlibadr(fd, id->lib, amod->ob);
}
}
@@ -1760,7 +1774,7 @@ static void direct_link_nlastrips(FileData *fd, ListBase *strips)
link_list(fd, strips);
- for(strip= strips->first; strip; strip= strip->next)
+ for (strip= strips->first; strip; strip= strip->next)
link_list(fd, &strip->modifiers);
}
@@ -1769,7 +1783,7 @@ static void lib_link_constraint_channels(FileData *fd, ID *id, ListBase *chanbas
{
bConstraintChannel *chan;
- for (chan=chanbase->first; chan; chan=chan->next){
+ for (chan=chanbase->first; chan; chan=chan->next) {
chan->ipo = newlibadr_us(fd, id->lib, chan->ipo);
}
}
@@ -1844,9 +1858,9 @@ static void direct_link_fmodifiers(FileData *fd, ListBase *list)
data->coefficients= newdataadr(fd, data->coefficients);
- if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
+ if (fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
unsigned int a;
- for(a = 0; a < data->arraysize; a++)
+ for (a = 0; a < data->arraysize; a++)
SWITCH_INT(data->coefficients[a]);
}
}
@@ -2135,11 +2149,11 @@ static void lib_link_ntree(FileData *fd, ID *id, bNodeTree *ntree)
{
bNode *node;
- if(ntree->adt) lib_link_animdata(fd, &ntree->id, ntree->adt);
+ if (ntree->adt) lib_link_animdata(fd, &ntree->id, ntree->adt);
ntree->gpd= newlibadr_us(fd, id->lib, ntree->gpd);
- for(node= ntree->nodes.first; node; node= node->next)
+ for (node= ntree->nodes.first; node; node= node->next)
node->id= newlibadr_us(fd, id->lib, node->id);
}
@@ -2149,8 +2163,8 @@ static void lib_link_nodetree(FileData *fd, Main *main)
bNodeTree *ntree;
/* only link ID pointers */
- for(ntree= main->nodetree.first; ntree; ntree= ntree->id.next) {
- if(ntree->id.flag & LIB_NEEDLINK) {
+ for (ntree= main->nodetree.first; ntree; ntree= ntree->id.next) {
+ if (ntree->id.flag & LIB_NEEDLINK) {
ntree->id.flag -= LIB_NEEDLINK;
lib_link_ntree(fd, &ntree->id, ntree);
}
@@ -2284,7 +2298,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
bNodeTreeType *ntreetype;
/* this crashes blender on undo/redo
- if(open==1) {
+ if (open==1) {
reinit_nodesystem();
}*/
@@ -2294,7 +2308,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
if (ntreetype && ntreetype->foreach_nodetree)
ntreetype->foreach_nodetree(main, NULL, lib_nodetree_init_types_cb);
}
- for(ntree= main->nodetree.first; ntree; ntree= ntree->id.next)
+ for (ntree= main->nodetree.first; ntree; ntree= ntree->id.next)
lib_nodetree_init_types_cb(NULL, NULL, ntree);
{
@@ -2304,7 +2318,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
* we have set the NTREE_DO_VERSIONS flag, so at this point we can do the
* actual group node updates.
*/
- for(ntree= main->nodetree.first; ntree; ntree= ntree->id.next) {
+ for (ntree= main->nodetree.first; ntree; ntree= ntree->id.next) {
if (ntree->flag & NTREE_DO_VERSIONS_GROUP_EXPOSE) {
/* this adds copies and links from all unlinked internal sockets to group inputs/outputs. */
node_group_expose_all_sockets(ntree);
@@ -2320,18 +2334,18 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
}
}
- for(ntree= main->nodetree.first; ntree; ntree= ntree->id.next)
+ for (ntree= main->nodetree.first; ntree; ntree= ntree->id.next)
ntree->flag &= ~NTREE_DO_VERSIONS_GROUP_EXPOSE;
}
/* verify all group user nodes */
- for(ntree= main->nodetree.first; ntree; ntree= ntree->id.next) {
+ for (ntree= main->nodetree.first; ntree; ntree= ntree->id.next) {
ntreeVerifyNodes(main, &ntree->id);
}
/* make update calls where necessary */
{
- for(ntree= main->nodetree.first; ntree; ntree= ntree->id.next)
+ for (ntree= main->nodetree.first; ntree; ntree= ntree->id.next)
if (ntree->update)
ntreeUpdateTree(ntree);
@@ -2367,8 +2381,8 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
direct_link_animdata(fd, ntree->adt);
link_list(fd, &ntree->nodes);
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type == NODE_DYNAMIC) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->type == NODE_DYNAMIC) {
node->custom1= 0;
node->custom1= BSET(node->custom1, NODE_DYNAMIC_LOADED);
}
@@ -2378,25 +2392,26 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
link_list(fd, &node->inputs);
link_list(fd, &node->outputs);
- if(node->type == CMP_NODE_MOVIEDISTORTION) {
+ if (node->type == CMP_NODE_MOVIEDISTORTION) {
node->storage= newmclipadr(fd, node->storage);
- } else
+ }
+ else
node->storage= newdataadr(fd, node->storage);
- if(node->storage) {
+ if (node->storage) {
/* could be handlerized at some point */
- if(ntree->type==NTREE_SHADER && (node->type==SH_NODE_CURVE_VEC || node->type==SH_NODE_CURVE_RGB))
+ if (ntree->type==NTREE_SHADER && (node->type==SH_NODE_CURVE_VEC || node->type==SH_NODE_CURVE_RGB))
direct_link_curvemapping(fd, node->storage);
- else if(ntree->type==NTREE_COMPOSIT) {
- if( ELEM4(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT))
+ else if (ntree->type==NTREE_COMPOSIT) {
+ if ( ELEM4(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT))
direct_link_curvemapping(fd, node->storage);
- else if(ELEM3(node->type, CMP_NODE_IMAGE, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
+ else if (ELEM3(node->type, CMP_NODE_IMAGE, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
((ImageUser *)node->storage)->ok= 1;
}
- else if( ntree->type==NTREE_TEXTURE) {
- if(node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME)
+ else if ( ntree->type==NTREE_TEXTURE) {
+ if (node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME)
direct_link_curvemapping(fd, node->storage);
- else if(node->type==TEX_NODE_IMAGE)
+ else if (node->type==TEX_NODE_IMAGE)
((ImageUser *)node->storage)->ok= 1;
}
}
@@ -2408,22 +2423,22 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
link_list(fd, &ntree->outputs);
/* and we connect the rest */
- for(node= ntree->nodes.first; node; node= node->next) {
+ for (node= ntree->nodes.first; node; node= node->next) {
node->parent = newdataadr(fd, node->parent);
node->preview= newimaadr(fd, node->preview);
node->lasty= 0;
- for(sock= node->inputs.first; sock; sock= sock->next)
+ for (sock= node->inputs.first; sock; sock= sock->next)
direct_link_node_socket(fd, sock);
- for(sock= node->outputs.first; sock; sock= sock->next)
+ for (sock= node->outputs.first; sock; sock= sock->next)
direct_link_node_socket(fd, sock);
}
- for(sock= ntree->inputs.first; sock; sock= sock->next)
+ for (sock= ntree->inputs.first; sock; sock= sock->next)
direct_link_node_socket(fd, sock);
- for(sock= ntree->outputs.first; sock; sock= sock->next)
+ for (sock= ntree->outputs.first; sock; sock= sock->next)
direct_link_node_socket(fd, sock);
- for(link= ntree->links.first; link; link= link->next) {
+ for (link= ntree->links.first; link; link= link->next) {
link->fromnode= newdataadr(fd, link->fromnode);
link->tonode= newdataadr(fd, link->tonode);
link->fromsock= newdataadr(fd, link->fromsock);
@@ -2456,7 +2471,7 @@ static void lib_link_constraints(FileData *fd, ID *id, ListBase *conlist)
for (con = conlist->first; con; con=con->next) {
/* patch for error introduced by changing constraints (dunno how) */
/* if con->data type changes, dna cannot resolve the pointer! (ton) */
- if(con->data==NULL) {
+ if (con->data==NULL) {
con->type= CONSTRAINT_TYPE_NULL;
}
/* own ipo, all constraints have it */
@@ -2505,7 +2520,7 @@ static void direct_link_constraints(FileData *fd, ListBase *lb)
case CONSTRAINT_TYPE_CHILDOF:
{
/* XXX version patch, in older code this flag wasn't always set, and is inherent to type */
- if(con->ownspace == CONSTRAINT_SPACE_POSE)
+ if (con->ownspace == CONSTRAINT_SPACE_POSE)
con->flag |= CONSTRAINT_SPACEONCE;
}
break;
@@ -2526,13 +2541,13 @@ static void lib_link_pose(FileData *fd, Object *ob, bPose *pose)
/* always rebuild to match proxy or lib changes */
rebuild= ob->proxy || (ob->id.lib==NULL && arm->id.lib);
- if(ob->proxy) {
+ if (ob->proxy) {
/* sync proxy layer */
- if(pose->proxy_layer)
+ if (pose->proxy_layer)
arm->layer = pose->proxy_layer;
/* sync proxy active bone */
- if(pose->proxy_act_bone[0]) {
+ if (pose->proxy_act_bone[0]) {
Bone *bone = get_named_bone(arm, pose->proxy_act_bone);
if (bone)
arm->act_bone = bone;
@@ -2546,16 +2561,16 @@ static void lib_link_pose(FileData *fd, Object *ob, bPose *pose)
pchan->bone= get_named_bone(arm, pchan->name);
pchan->custom= newlibadr_us(fd, arm->id.lib, pchan->custom);
- if(pchan->bone==NULL)
+ if (pchan->bone==NULL)
rebuild= 1;
- else if(ob->id.lib==NULL && arm->id.lib) {
+ else if (ob->id.lib==NULL && arm->id.lib) {
/* local pose selection copied to armature, bit hackish */
pchan->bone->flag &= ~BONE_SELECTED;
pchan->bone->flag |= pchan->selectflag;
}
}
- if(rebuild) {
+ if (rebuild) {
ob->recalc= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
pose->flag |= POSE_RECALC;
}
@@ -2567,8 +2582,8 @@ static void lib_link_armature(FileData *fd, Main *main)
arm= main->armature.first;
- while(arm) {
- if(arm->id.flag & LIB_NEEDLINK) {
+ while (arm) {
+ if (arm->id.flag & LIB_NEEDLINK) {
if (arm->adt) lib_link_animdata(fd, &arm->id, arm->adt);
arm->id.flag -= LIB_NEEDLINK;
}
@@ -2582,14 +2597,14 @@ static void direct_link_bones(FileData *fd, Bone* bone)
bone->parent= newdataadr(fd, bone->parent);
bone->prop= newdataadr(fd, bone->prop);
- if(bone->prop)
+ if (bone->prop)
IDP_DirectLinkProperty(bone->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
bone->flag &= ~BONE_DRAW_ACTIVE;
link_list(fd, &bone->childbase);
- for(child=bone->childbase.first; child; child=child->next)
+ for (child=bone->childbase.first; child; child=child->next)
direct_link_bones(fd, child);
}
@@ -2621,8 +2636,8 @@ static void lib_link_camera(FileData *fd, Main *main)
Camera *ca;
ca= main->camera.first;
- while(ca) {
- if(ca->id.flag & LIB_NEEDLINK) {
+ while (ca) {
+ if (ca->id.flag & LIB_NEEDLINK) {
if (ca->adt) lib_link_animdata(fd, &ca->id, ca->adt);
ca->ipo= newlibadr_us(fd, ca->id.lib, ca->ipo); // XXX depreceated - old animation system
@@ -2651,13 +2666,13 @@ static void lib_link_lamp(FileData *fd, Main *main)
int a;
la= main->lamp.first;
- while(la) {
- if(la->id.flag & LIB_NEEDLINK) {
+ while (la) {
+ if (la->id.flag & LIB_NEEDLINK) {
if (la->adt) lib_link_animdata(fd, &la->id, la->adt);
- for(a=0; a<MAX_MTEX; a++) {
+ for (a=0; a<MAX_MTEX; a++) {
mtex= la->mtex[a];
- if(mtex) {
+ if (mtex) {
mtex->tex= newlibadr_us(fd, la->id.lib, mtex->tex);
mtex->object= newlibadr(fd, la->id.lib, mtex->object);
}
@@ -2665,7 +2680,7 @@ static void lib_link_lamp(FileData *fd, Main *main)
la->ipo= newlibadr_us(fd, la->id.lib, la->ipo); // XXX depreceated - old animation system
- if(la->nodetree)
+ if (la->nodetree)
lib_link_ntree(fd, &la->id, la->nodetree);
la->id.flag -= LIB_NEEDLINK;
@@ -2681,16 +2696,16 @@ static void direct_link_lamp(FileData *fd, Lamp *la)
la->adt= newdataadr(fd, la->adt);
direct_link_animdata(fd, la->adt);
- for(a=0; a<MAX_MTEX; a++) {
+ for (a=0; a<MAX_MTEX; a++) {
la->mtex[a]= newdataadr(fd, la->mtex[a]);
}
la->curfalloff= newdataadr(fd, la->curfalloff);
- if(la->curfalloff)
+ if (la->curfalloff)
direct_link_curvemapping(fd, la->curfalloff);
la->nodetree= newdataadr(fd, la->nodetree);
- if(la->nodetree)
+ if (la->nodetree)
direct_link_nodetree(fd, la->nodetree);
la->preview = direct_link_preview_image(fd, la->preview);
@@ -2703,7 +2718,7 @@ static void lib_link_key(FileData *fd, Main *main)
Key *key;
key= main->key.first;
- while(key) {
+ while (key) {
/*check if we need to generate unique ids for the shapekeys*/
if (!key->uidgen) {
KeyBlock *block;
@@ -2714,8 +2729,8 @@ static void lib_link_key(FileData *fd, Main *main)
}
}
- if(key->id.flag & LIB_NEEDLINK) {
- if(key->adt) lib_link_animdata(fd, &key->id, key->adt);
+ if (key->id.flag & LIB_NEEDLINK) {
+ if (key->adt) lib_link_animdata(fd, &key->id, key->adt);
key->ipo= newlibadr_us(fd, key->id.lib, key->ipo); // XXX depreceated - old animation system
key->from= newlibadr(fd, key->id.lib, key->from);
@@ -2734,19 +2749,19 @@ static void switch_endian_keyblock(Key *key, KeyBlock *kb)
elemsize= key->elemsize;
data= kb->data;
- for(a=0; a<kb->totelem; a++) {
+ for (a=0; a<kb->totelem; a++) {
cp= key->elemstr;
poin= data;
- while( cp[0] ) { /* cp[0]==amount */
+ while ( cp[0] ) { /* cp[0]==amount */
switch(cp[1]) { /* cp[1]= type */
case IPO_FLOAT:
case IPO_BPOINT:
case IPO_BEZTRIPLE:
b= cp[0];
- while(b--) {
+ while (b--) {
SWITCH_INT((*poin));
poin+= 4;
}
@@ -2772,11 +2787,11 @@ static void direct_link_key(FileData *fd, Key *key)
key->refkey= newdataadr(fd, key->refkey);
kb= key->block.first;
- while(kb) {
+ while (kb) {
kb->data= newdataadr(fd, kb->data);
- if(fd->flags & FD_FLAGS_SWITCH_ENDIAN)
+ if (fd->flags & FD_FLAGS_SWITCH_ENDIAN)
switch_endian_keyblock(key, kb);
kb= kb->next;
@@ -2791,11 +2806,11 @@ static void lib_link_mball(FileData *fd, Main *main)
int a;
mb= main->mball.first;
- while(mb) {
- if(mb->id.flag & LIB_NEEDLINK) {
+ while (mb) {
+ if (mb->id.flag & LIB_NEEDLINK) {
if (mb->adt) lib_link_animdata(fd, &mb->id, mb->adt);
- for(a=0; a<mb->totcol; a++) mb->mat[a]= newlibadr_us(fd, mb->id.lib, mb->mat[a]);
+ for (a=0; a<mb->totcol; a++) mb->mat[a]= newlibadr_us(fd, mb->id.lib, mb->mat[a]);
mb->ipo= newlibadr_us(fd, mb->id.lib, mb->ipo); // XXX depreceated - old animation system
@@ -2831,21 +2846,21 @@ static void lib_link_world(FileData *fd, Main *main)
int a;
wrld= main->world.first;
- while(wrld) {
- if(wrld->id.flag & LIB_NEEDLINK) {
+ while (wrld) {
+ if (wrld->id.flag & LIB_NEEDLINK) {
if (wrld->adt) lib_link_animdata(fd, &wrld->id, wrld->adt);
wrld->ipo= newlibadr_us(fd, wrld->id.lib, wrld->ipo); // XXX depreceated - old animation system
- for(a=0; a<MAX_MTEX; a++) {
+ for (a=0; a<MAX_MTEX; a++) {
mtex= wrld->mtex[a];
- if(mtex) {
+ if (mtex) {
mtex->tex= newlibadr_us(fd, wrld->id.lib, mtex->tex);
mtex->object= newlibadr(fd, wrld->id.lib, mtex->object);
}
}
- if(wrld->nodetree)
+ if (wrld->nodetree)
lib_link_ntree(fd, &wrld->id, wrld->nodetree);
wrld->id.flag -= LIB_NEEDLINK;
@@ -2861,12 +2876,12 @@ static void direct_link_world(FileData *fd, World *wrld)
wrld->adt= newdataadr(fd, wrld->adt);
direct_link_animdata(fd, wrld->adt);
- for(a=0; a<MAX_MTEX; a++) {
+ for (a=0; a<MAX_MTEX; a++) {
wrld->mtex[a]= newdataadr(fd, wrld->mtex[a]);
}
wrld->nodetree= newdataadr(fd, wrld->nodetree);
- if(wrld->nodetree)
+ if (wrld->nodetree)
direct_link_nodetree(fd, wrld->nodetree);
wrld->preview = direct_link_preview_image(fd, wrld->preview);
@@ -2880,8 +2895,8 @@ static void lib_link_vfont(FileData *UNUSED(fd), Main *main)
VFont *vf;
vf= main->vfont.first;
- while(vf) {
- if(vf->id.flag & LIB_NEEDLINK) {
+ while (vf) {
+ if (vf->id.flag & LIB_NEEDLINK) {
vf->id.flag -= LIB_NEEDLINK;
}
vf= vf->id.next;
@@ -2901,8 +2916,8 @@ static void lib_link_text(FileData *UNUSED(fd), Main *main)
Text *text;
text= main->text.first;
- while(text) {
- if(text->id.flag & LIB_NEEDLINK) {
+ while (text) {
+ if (text->id.flag & LIB_NEEDLINK) {
text->id.flag -= LIB_NEEDLINK;
}
text= text->id.next;
@@ -2922,9 +2937,10 @@ static void direct_link_text(FileData *fd, Text *text)
text->compiled= NULL;
/*
- if(text->flags & TXT_ISEXT) {
+ if (text->flags & TXT_ISEXT) {
reopen_text(text);
- } else {
+ }
+ else {
*/
link_list(fd, &text->lines);
@@ -2934,7 +2950,7 @@ static void direct_link_text(FileData *fd, Text *text)
text->sell= newdataadr(fd, text->sell);
ln= text->lines.first;
- while(ln) {
+ while (ln) {
ln->line= newdataadr(fd, ln->line);
ln->format= NULL;
@@ -2959,7 +2975,7 @@ static void lib_link_image(FileData *fd, Main *main)
ima= main->image.first;
while (ima) {
- if(ima->id.flag & LIB_NEEDLINK) {
+ if (ima->id.flag & LIB_NEEDLINK) {
if (ima->id.properties) IDP_LibLinkProperty(ima->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
ima->id.flag -= LIB_NEEDLINK;
@@ -2972,12 +2988,12 @@ static void link_ibuf_list(FileData *fd, ListBase *lb)
{
Link *ln, *prev;
- if(lb->first==NULL) return;
+ if (lb->first==NULL) return;
lb->first= newimaadr(fd, lb->first);
ln= lb->first;
prev= NULL;
- while(ln) {
+ while (ln) {
ln->next= newimaadr(fd, ln->next);
ln->prev= prev;
prev= ln;
@@ -2989,13 +3005,13 @@ static void link_ibuf_list(FileData *fd, ListBase *lb)
static void direct_link_image(FileData *fd, Image *ima)
{
/* for undo system, pointers could be restored */
- if(fd->imamap)
+ if (fd->imamap)
link_ibuf_list(fd, &ima->ibufs);
else
ima->ibufs.first= ima->ibufs.last= NULL;
/* if not restored, we keep the binded opengl index */
- if(ima->ibufs.first==NULL) {
+ if (ima->ibufs.first==NULL) {
ima->bindcode= 0;
ima->gputexture= NULL;
}
@@ -3005,10 +3021,10 @@ static void direct_link_image(FileData *fd, Image *ima)
ima->repbind= NULL;
/* undo system, try to restore render buffers */
- if(fd->imamap) {
+ if (fd->imamap) {
int a;
- for(a=0; a<IMA_MAX_RENDER_SLOT; a++)
+ for (a=0; a<IMA_MAX_RENDER_SLOT; a++)
ima->renders[a]= newimaadr(fd, ima->renders[a]);
}
else {
@@ -3030,11 +3046,11 @@ static void lib_link_curve(FileData *fd, Main *main)
int a;
cu= main->curve.first;
- while(cu) {
- if(cu->id.flag & LIB_NEEDLINK) {
- if(cu->adt) lib_link_animdata(fd, &cu->id, cu->adt);
+ while (cu) {
+ if (cu->id.flag & LIB_NEEDLINK) {
+ if (cu->adt) lib_link_animdata(fd, &cu->id, cu->adt);
- for(a=0; a<cu->totcol; a++) cu->mat[a]= newlibadr_us(fd, cu->id.lib, cu->mat[a]);
+ for (a=0; a<cu->totcol; a++) cu->mat[a]= newlibadr_us(fd, cu->id.lib, cu->mat[a]);
cu->bevobj= newlibadr(fd, cu->id.lib, cu->bevobj);
cu->taperobj= newlibadr(fd, cu->id.lib, cu->taperobj);
@@ -3058,15 +3074,15 @@ static void switch_endian_knots(Nurb *nu)
{
int len;
- if(nu->knotsu) {
+ if (nu->knotsu) {
len= KNOTSU(nu);
- while(len--) {
+ while (len--) {
SWITCH_INT(nu->knotsu[len]);
}
}
- if(nu->knotsv) {
+ if (nu->knotsv) {
len= KNOTSV(nu);
- while(len--) {
+ while (len--) {
SWITCH_INT(nu->knotsv[len]);
}
}
@@ -3086,7 +3102,7 @@ static void direct_link_curve(FileData *fd, Curve *cu)
cu->strinfo= newdataadr(fd, cu->strinfo);
cu->tb= newdataadr(fd, cu->tb);
- if(cu->vfont == NULL) link_list(fd, &(cu->nurb));
+ if (cu->vfont == NULL) link_list(fd, &(cu->nurb));
else {
cu->nurb.first=cu->nurb.last= NULL;
@@ -3095,7 +3111,8 @@ static void direct_link_curve(FileData *fd, Curve *cu)
memcpy(tb, cu->tb, cu->totbox*sizeof(TextBox));
MEM_freeN(cu->tb);
cu->tb= tb;
- } else {
+ }
+ else {
cu->totbox = 1;
cu->actbox = 1;
cu->tb = tb;
@@ -3112,14 +3129,14 @@ static void direct_link_curve(FileData *fd, Curve *cu)
cu->editfont= NULL;
nu= cu->nurb.first;
- while(nu) {
+ while (nu) {
nu->bezt= newdataadr(fd, nu->bezt);
nu->bp= newdataadr(fd, nu->bp);
nu->knotsu= newdataadr(fd, nu->knotsu);
nu->knotsv= newdataadr(fd, nu->knotsv);
if (cu->vfont == NULL) nu->charidx= nu->mat_nr;
- if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
+ if (fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
switch_endian_knots(nu);
}
@@ -3135,20 +3152,20 @@ static void lib_link_texture(FileData *fd, Main *main)
Tex *tex;
tex= main->tex.first;
- while(tex) {
- if(tex->id.flag & LIB_NEEDLINK) {
- if(tex->adt) lib_link_animdata(fd, &tex->id, tex->adt);
+ while (tex) {
+ if (tex->id.flag & LIB_NEEDLINK) {
+ if (tex->adt) lib_link_animdata(fd, &tex->id, tex->adt);
tex->ima= newlibadr_us(fd, tex->id.lib, tex->ima);
tex->ipo= newlibadr_us(fd, tex->id.lib, tex->ipo);
- if(tex->env) tex->env->object= newlibadr(fd, tex->id.lib, tex->env->object);
- if(tex->pd)
+ if (tex->env) tex->env->object= newlibadr(fd, tex->id.lib, tex->env->object);
+ if (tex->pd)
tex->pd->object= newlibadr(fd, tex->id.lib, tex->pd->object);
- if(tex->vd) tex->vd->object= newlibadr(fd, tex->id.lib, tex->vd->object);
- if(tex->ot) tex->ot->object= newlibadr(fd, tex->id.lib, tex->ot->object);
+ if (tex->vd) tex->vd->object= newlibadr(fd, tex->id.lib, tex->vd->object);
+ if (tex->ot) tex->ot->object= newlibadr(fd, tex->id.lib, tex->ot->object);
- if(tex->nodetree)
+ if (tex->nodetree)
lib_link_ntree(fd, &tex->id, tex->nodetree);
tex->id.flag -= LIB_NEEDLINK;
@@ -3163,7 +3180,7 @@ static void direct_link_texture(FileData *fd, Tex *tex)
direct_link_animdata(fd, tex->adt);
tex->plugin= newdataadr(fd, tex->plugin);
- if(tex->plugin) {
+ if (tex->plugin) {
tex->plugin->handle= NULL;
open_plugin_tex(tex->plugin);
/* initialize data for this instance, if an initialization
@@ -3174,34 +3191,35 @@ static void direct_link_texture(FileData *fd, Tex *tex)
}
tex->coba= newdataadr(fd, tex->coba);
tex->env= newdataadr(fd, tex->env);
- if(tex->env) {
+ if (tex->env) {
tex->env->ima= NULL;
memset(tex->env->cube, 0, 6*sizeof(void *));
tex->env->ok= 0;
}
tex->pd= newdataadr(fd, tex->pd);
- if(tex->pd) {
+ if (tex->pd) {
tex->pd->point_tree = NULL;
tex->pd->coba= newdataadr(fd, tex->pd->coba);
tex->pd->falloff_curve= newdataadr(fd, tex->pd->falloff_curve);
- if(tex->pd->falloff_curve) {
+ if (tex->pd->falloff_curve) {
direct_link_curvemapping(fd, tex->pd->falloff_curve);
}
}
tex->vd= newdataadr(fd, tex->vd);
- if(tex->vd) {
+ if (tex->vd) {
tex->vd->dataset = NULL;
tex->vd->ok = 0;
- } else {
- if(tex->type == TEX_VOXELDATA)
+ }
+ else {
+ if (tex->type == TEX_VOXELDATA)
tex->vd= MEM_callocN(sizeof(VoxelData), "direct_link_texture VoxelData");
}
tex->ot= newdataadr(fd, tex->ot);
tex->nodetree= newdataadr(fd, tex->nodetree);
- if(tex->nodetree)
+ if (tex->nodetree)
direct_link_nodetree(fd, tex->nodetree);
tex->preview = direct_link_preview_image(fd, tex->preview);
@@ -3220,9 +3238,9 @@ static void lib_link_material(FileData *fd, Main *main)
int a;
ma= main->mat.first;
- while(ma) {
- if(ma->id.flag & LIB_NEEDLINK) {
- if(ma->adt) lib_link_animdata(fd, &ma->id, ma->adt);
+ while (ma) {
+ if (ma->id.flag & LIB_NEEDLINK) {
+ if (ma->adt) lib_link_animdata(fd, &ma->id, ma->adt);
/*Link ID Properties -- and copy this comment EXACTLY for easy finding
of library blocks that implement this.*/
@@ -3231,15 +3249,15 @@ static void lib_link_material(FileData *fd, Main *main)
ma->ipo= newlibadr_us(fd, ma->id.lib, ma->ipo);
ma->group= newlibadr_us(fd, ma->id.lib, ma->group);
- for(a=0; a<MAX_MTEX; a++) {
+ for (a=0; a<MAX_MTEX; a++) {
mtex= ma->mtex[a];
- if(mtex) {
+ if (mtex) {
mtex->tex= newlibadr_us(fd, ma->id.lib, mtex->tex);
mtex->object= newlibadr(fd, ma->id.lib, mtex->object);
}
}
- if(ma->nodetree)
+ if (ma->nodetree)
lib_link_ntree(fd, &ma->id, ma->nodetree);
ma->id.flag -= LIB_NEEDLINK;
@@ -3255,7 +3273,7 @@ static void direct_link_material(FileData *fd, Material *ma)
ma->adt= newdataadr(fd, ma->adt);
direct_link_animdata(fd, ma->adt);
- for(a=0; a<MAX_MTEX; a++) {
+ for (a=0; a<MAX_MTEX; a++) {
ma->mtex[a]= newdataadr(fd, ma->mtex[a]);
}
@@ -3263,7 +3281,7 @@ static void direct_link_material(FileData *fd, Material *ma)
ma->ramp_spec= newdataadr(fd, ma->ramp_spec);
ma->nodetree= newdataadr(fd, ma->nodetree);
- if(ma->nodetree)
+ if (ma->nodetree)
direct_link_nodetree(fd, ma->nodetree);
ma->preview = direct_link_preview_image(fd, ma->preview);
@@ -3284,7 +3302,7 @@ static const char *ptcache_data_struct[] = {
};
static void direct_link_pointcache(FileData *fd, PointCache *cache)
{
- if((cache->flag & PTCACHE_DISK_CACHE)==0) {
+ if ((cache->flag & PTCACHE_DISK_CACHE)==0) {
PTCacheMem *pm;
PTCacheExtra *extra;
int i;
@@ -3293,23 +3311,23 @@ static void direct_link_pointcache(FileData *fd, PointCache *cache)
pm = cache->mem_cache.first;
- for(; pm; pm=pm->next) {
- for(i=0; i<BPHYS_TOT_DATA; i++) {
+ for (; pm; pm=pm->next) {
+ for (i=0; i<BPHYS_TOT_DATA; i++) {
pm->data[i] = newdataadr(fd, pm->data[i]);
/* the cache saves non-struct data without DNA */
- if(pm->data[i] && ptcache_data_struct[i][0]=='\0' && (fd->flags & FD_FLAGS_SWITCH_ENDIAN)) {
+ if (pm->data[i] && ptcache_data_struct[i][0]=='\0' && (fd->flags & FD_FLAGS_SWITCH_ENDIAN)) {
int j, tot= (BKE_ptcache_data_size (i) * pm->totpoint)/4; /* data_size returns bytes */
int *poin= pm->data[i];
- for(j= 0; j<tot; j++)
+ for (j= 0; j<tot; j++)
SWITCH_INT(poin[j]);
}
}
link_list(fd, &pm->extradata);
- for(extra=pm->extradata.first; extra; extra=extra->next)
+ for (extra=pm->extradata.first; extra; extra=extra->next)
extra->data = newdataadr(fd, extra->data);
}
}
@@ -3325,12 +3343,12 @@ static void direct_link_pointcache(FileData *fd, PointCache *cache)
static void direct_link_pointcache_list(FileData *fd, ListBase *ptcaches, PointCache **ocache, int force_disk)
{
- if(ptcaches->first) {
+ if (ptcaches->first) {
PointCache *cache= NULL;
link_list(fd, ptcaches);
- for(cache=ptcaches->first; cache; cache=cache->next) {
+ for (cache=ptcaches->first; cache; cache=cache->next) {
direct_link_pointcache(fd, cache);
- if(force_disk) {
+ if (force_disk) {
cache->flag |= PTCACHE_DISK_CACHE;
cache->step = 1;
}
@@ -3338,11 +3356,11 @@ static void direct_link_pointcache_list(FileData *fd, ListBase *ptcaches, PointC
*ocache = newdataadr(fd, *ocache);
}
- else if(*ocache) {
+ else if (*ocache) {
/* old "single" caches need to be linked too */
*ocache = newdataadr(fd, *ocache);
direct_link_pointcache(fd, *ocache);
- if(force_disk) {
+ if (force_disk) {
(*ocache)->flag |= PTCACHE_DISK_CACHE;
(*ocache)->step = 1;
}
@@ -3353,7 +3371,7 @@ static void direct_link_pointcache_list(FileData *fd, ListBase *ptcaches, PointC
static void lib_link_partdeflect(FileData *fd, ID *id, PartDeflect *pd)
{
- if(pd && pd->tex)
+ if (pd && pd->tex)
pd->tex=newlibadr_us(fd, id->lib, pd->tex);
}
@@ -3365,8 +3383,8 @@ static void lib_link_particlesettings(FileData *fd, Main *main)
int a;
part= main->particle.first;
- while(part) {
- if(part->id.flag & LIB_NEEDLINK) {
+ while (part) {
+ if (part->id.flag & LIB_NEEDLINK) {
if (part->adt) lib_link_animdata(fd, &part->id, part->adt);
part->ipo= newlibadr_us(fd, part->id.lib, part->ipo); // XXX depreceated - old animation system
@@ -3378,37 +3396,37 @@ static void lib_link_particlesettings(FileData *fd, Main *main)
lib_link_partdeflect(fd, &part->id, part->pd);
lib_link_partdeflect(fd, &part->id, part->pd2);
- if(part->effector_weights)
+ if (part->effector_weights)
part->effector_weights->group = newlibadr(fd, part->id.lib, part->effector_weights->group);
- if(part->dupliweights.first && part->dup_group) {
+ if (part->dupliweights.first && part->dup_group) {
int index_ok = 0;
/* check for old files without indices (all indexes 0) */
dw = part->dupliweights.first;
- if(part->dupliweights.first == part->dupliweights.last) {
+ if (part->dupliweights.first == part->dupliweights.last) {
/* special case for only one object in the group */
index_ok = 1;
}
else {
- for(; dw; dw=dw->next) {
- if(dw->index > 0) {
+ for (; dw; dw=dw->next) {
+ if (dw->index > 0) {
index_ok = 1;
break;
}
}
}
- if(index_ok) {
+ if (index_ok) {
/* if we have indexes, let's use them */
dw = part->dupliweights.first;
- for(; dw; dw=dw->next) {
+ for (; dw; dw=dw->next) {
GroupObject *go = (GroupObject *)BLI_findlink(&part->dup_group->gobject, dw->index);
dw->ob = go ? go->ob : NULL;
}
}
else {
/* otherwise try to get objects from own library (won't work on library linked groups) */
- for(; dw; dw=dw->next)
+ for (; dw; dw=dw->next)
dw->ob = newlibadr(fd, part->id.lib, dw->ob);
}
}
@@ -3416,12 +3434,12 @@ static void lib_link_particlesettings(FileData *fd, Main *main)
part->dupliweights.first = part->dupliweights.last = NULL;
}
- if(part->boids) {
+ if (part->boids) {
BoidState *state = part->boids->states.first;
BoidRule *rule;
- for(; state; state=state->next) {
+ for (; state; state=state->next) {
rule = state->rules.first;
- for(; rule; rule=rule->next)
+ for (; rule; rule=rule->next)
switch(rule->type) {
case eBoidRuleType_Goal:
case eBoidRuleType_Avoid:
@@ -3440,9 +3458,9 @@ static void lib_link_particlesettings(FileData *fd, Main *main)
}
}
- for(a=0; a<MAX_MTEX; a++) {
+ for (a=0; a<MAX_MTEX; a++) {
mtex= part->mtex[a];
- if(mtex) {
+ if (mtex) {
mtex->tex = newlibadr_us(fd, part->id.lib, mtex->tex);
mtex->object = newlibadr(fd, part->id.lib, mtex->object);
}
@@ -3456,7 +3474,7 @@ static void lib_link_particlesettings(FileData *fd, Main *main)
static void direct_link_partdeflect(PartDeflect *pd)
{
- if(pd) pd->rng=NULL;
+ if (pd) pd->rng=NULL;
}
static void direct_link_particlesettings(FileData *fd, ParticleSettings *part)
@@ -3471,7 +3489,7 @@ static void direct_link_particlesettings(FileData *fd, ParticleSettings *part)
direct_link_partdeflect(part->pd2);
part->effector_weights = newdataadr(fd, part->effector_weights);
- if(!part->effector_weights)
+ if (!part->effector_weights)
part->effector_weights = BKE_add_effector_weights(part->eff_group);
link_list(fd, &part->dupliweights);
@@ -3479,17 +3497,17 @@ static void direct_link_particlesettings(FileData *fd, ParticleSettings *part)
part->boids= newdataadr(fd, part->boids);
part->fluid= newdataadr(fd, part->fluid);
- if(part->boids) {
+ if (part->boids) {
BoidState *state;
link_list(fd, &part->boids->states);
- for(state=part->boids->states.first; state; state=state->next) {
+ for (state=part->boids->states.first; state; state=state->next) {
link_list(fd, &state->rules);
link_list(fd, &state->conditions);
link_list(fd, &state->actions);
}
}
- for(a=0; a<MAX_MTEX; a++) {
+ for (a=0; a<MAX_MTEX; a++) {
part->mtex[a]= newdataadr(fd, part->mtex[a]);
}
}
@@ -3498,20 +3516,20 @@ static void lib_link_particlesystems(FileData *fd, Object *ob, ID *id, ListBase
{
ParticleSystem *psys, *psysnext;
- for(psys=particles->first; psys; psys=psysnext){
+ for (psys=particles->first; psys; psys=psysnext) {
psysnext= psys->next;
psys->part = newlibadr_us(fd, id->lib, psys->part);
- if(psys->part) {
+ if (psys->part) {
ParticleTarget *pt = psys->targets.first;
- for(; pt; pt=pt->next)
+ for (; pt; pt=pt->next)
pt->ob=newlibadr(fd, id->lib, pt->ob);
psys->parent= newlibadr_us(fd, id->lib, psys->parent);
psys->target_ob = newlibadr(fd, id->lib, psys->target_ob);
- if(psys->clmd) {
+ if (psys->clmd) {
/* XXX - from reading existing code this seems correct but intended usage of
* pointcache should /w cloth should be added in 'ParticleSystem' - campbell */
psys->clmd->point_cache= psys->pointcache;
@@ -3536,16 +3554,16 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles)
ParticleData *pa;
int a;
- for(psys=particles->first; psys; psys=psys->next) {
+ for (psys=particles->first; psys; psys=psys->next) {
psys->particles=newdataadr(fd,psys->particles);
- if(psys->particles && psys->particles->hair){
- for(a=0,pa=psys->particles; a<psys->totpart; a++, pa++)
+ if (psys->particles && psys->particles->hair) {
+ for (a=0,pa=psys->particles; a<psys->totpart; a++, pa++)
pa->hair=newdataadr(fd,pa->hair);
}
- if(psys->particles && psys->particles->keys){
- for(a=0,pa=psys->particles; a<psys->totpart; a++, pa++) {
+ if (psys->particles && psys->particles->keys) {
+ for (a=0,pa=psys->particles; a<psys->totpart; a++, pa++) {
pa->keys= NULL;
pa->totkey= 0;
}
@@ -3553,14 +3571,14 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles)
psys->flag &= ~PSYS_KEYED;
}
- if(psys->particles && psys->particles->boid) {
+ if (psys->particles && psys->particles->boid) {
pa = psys->particles;
pa->boid = newdataadr(fd, pa->boid);
- for(a=1,pa++; a<psys->totpart; a++, pa++)
+ for (a=1,pa++; a<psys->totpart; a++, pa++)
pa->boid = (pa-1)->boid + 1;
}
- else if(psys->particles) {
- for(a=0,pa=psys->particles; a<psys->totpart; a++, pa++)
+ else if (psys->particles) {
+ for (a=0,pa=psys->particles; a<psys->totpart; a++, pa++)
pa->boid = NULL;
}
@@ -3583,7 +3601,7 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles)
direct_link_pointcache_list(fd, &psys->ptcaches, &psys->pointcache, 0);
- if(psys->clmd) {
+ if (psys->clmd) {
psys->clmd = newdataadr(fd, psys->clmd);
psys->clmd->clothObject = NULL;
@@ -3591,8 +3609,8 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles)
psys->clmd->sim_parms->effector_weights = NULL;
psys->clmd->coll_parms= newdataadr(fd, psys->clmd->coll_parms);
- if(psys->clmd->sim_parms) {
- if(psys->clmd->sim_parms->presets > 10)
+ if (psys->clmd->sim_parms) {
+ if (psys->clmd->sim_parms->presets > 10)
psys->clmd->sim_parms->presets = 0;
}
@@ -3619,7 +3637,7 @@ static void lib_link_mtface(FileData *fd, Mesh *me, MTFace *mtface, int totface)
* to each image it used. - z0r */
for (i=0; i<totface; i++, tf++) {
tf->tpage= newlibadr(fd, me->id.lib, tf->tpage);
- if(tf->tpage && tf->tpage->id.us==0)
+ if (tf->tpage && tf->tpage->id.us==0)
tf->tpage->id.us= 1;
}
}
@@ -3627,10 +3645,10 @@ static void lib_link_mtface(FileData *fd, Mesh *me, MTFace *mtface, int totface)
static void lib_link_customdata_mtface(FileData *fd, Mesh *me, CustomData *fdata, int totface)
{
int i;
- for(i=0; i<fdata->totlayer; i++) {
+ for (i=0; i<fdata->totlayer; i++) {
CustomDataLayer *layer = &fdata->layers[i];
- if(layer->type == CD_MTFACE)
+ if (layer->type == CD_MTFACE)
lib_link_mtface(fd, me, layer->data, totface);
}
@@ -3640,16 +3658,16 @@ static void lib_link_customdata_mtpoly(FileData *fd, Mesh *me, CustomData *pdata
{
int i;
- for(i=0; i<pdata->totlayer; i++) {
+ for (i=0; i<pdata->totlayer; i++) {
CustomDataLayer *layer = &pdata->layers[i];
- if(layer->type == CD_MTEXPOLY) {
+ if (layer->type == CD_MTEXPOLY) {
MTexPoly *tf= layer->data;
int i;
for (i=0; i<totface; i++, tf++) {
tf->tpage= newlibadr(fd, me->id.lib, tf->tpage);
- if(tf->tpage && tf->tpage->id.us==0)
+ if (tf->tpage && tf->tpage->id.us==0)
tf->tpage->id.us= 1;
}
}
@@ -3661,8 +3679,8 @@ static void lib_link_mesh(FileData *fd, Main *main)
Mesh *me;
me= main->mesh.first;
- while(me) {
- if(me->id.flag & LIB_NEEDLINK) {
+ while (me) {
+ if (me->id.flag & LIB_NEEDLINK) {
int i;
/*Link ID Properties -- and copy this comment EXACTLY for easy finding
@@ -3671,8 +3689,8 @@ static void lib_link_mesh(FileData *fd, Main *main)
if (me->adt) lib_link_animdata(fd, &me->id, me->adt);
/* this check added for python created meshes */
- if(me->mat) {
- for(i=0; i<me->totcol; i++) {
+ if (me->mat) {
+ for (i=0; i<me->totcol; i++) {
me->mat[i]= newlibadr_us(fd, me->id.lib, me->mat[i]);
}
}
@@ -3684,17 +3702,17 @@ static void lib_link_mesh(FileData *fd, Main *main)
lib_link_customdata_mtface(fd, me, &me->fdata, me->totface);
lib_link_customdata_mtpoly(fd, me, &me->pdata, me->totpoly);
- if(me->mr && me->mr->levels.first)
+ if (me->mr && me->mr->levels.first)
lib_link_customdata_mtface(fd, me, &me->mr->fdata,
((MultiresLevel*)me->mr->levels.first)->totface);
/*check if we need to convert mfaces to mpolys*/
if (me->totface && !me->totpoly) {
- convert_mfaces_to_mpolys(me);
+ BKE_mesh_convert_mfaces_to_mpolys(me);
}
/*
- * Re-tesselate, even if the polys were just created from tessfaces, this
+ * Re-tessellate, even if the polys were just created from tessfaces, this
* is important because it:
* - fill the CD_POLYINDEX layer
* - gives consistency of tessface between loading from a file and
@@ -3729,7 +3747,7 @@ static void direct_link_dverts(FileData *fd, int count, MDeformVert *mdverts)
for (i= count; i > 0; i--, mdverts++) {
/*convert to vgroup allocation system*/
MDeformWeight *dw;
- if(mdverts->dw && (dw= newdataadr(fd, mdverts->dw))) {
+ if (mdverts->dw && (dw= newdataadr(fd, mdverts->dw))) {
const ssize_t dw_len= mdverts->totweight * sizeof(MDeformWeight);
void *dw_tmp= MEM_mallocN(dw_len, "direct_link_dverts");
memcpy(dw_tmp, dw, dw_len);
@@ -3745,34 +3763,33 @@ static void direct_link_dverts(FileData *fd, int count, MDeformVert *mdverts)
static void direct_link_mdisps(FileData *fd, int count, MDisps *mdisps, int external)
{
- if(mdisps) {
+ if (mdisps) {
int i;
- for(i = 0; i < count; ++i) {
+ 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;
+ mdisps[i].hidden = newdataadr(fd, mdisps[i].hidden);
+
+ if (mdisps[i].totdisp && !mdisps[i].level) {
+ /* this calculation is only correct for loop mdisps;
+ if loading pre-BMesh face mdisps this will be
+ overwritten with the correct value in
+ bm_corners_to_loops() */
+ float gridsize = sqrtf(mdisps[i].totdisp);
+ mdisps[i].level = (int)(logf(gridsize - 1.0f) / M_LN2) + 1;
}
-
- if( (fd->flags & FD_FLAGS_SWITCH_ENDIAN) && (mdisps[i].disps) ) {
+
+ 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 */
int x;
float *tmpdisps= *mdisps[i].disps;
- for(x=0;x<mdisps[i].totdisp*3;x++) {
+ for (x=0;x<mdisps[i].totdisp*3;x++) {
SWITCH_INT(*tmpdisps);
tmpdisps++;
}
}
- if(!external && !mdisps[i].disps)
+ if (!external && !mdisps[i].disps)
mdisps[i].totdisp = 0;
}
}
@@ -3789,12 +3806,12 @@ static void direct_link_customdata(FileData *fd, CustomData *data, int count)
while (i < data->totlayer) {
CustomDataLayer *layer = &data->layers[i];
- if(layer->flag & CD_FLAG_EXTERNAL)
+ if (layer->flag & CD_FLAG_EXTERNAL)
layer->flag &= ~CD_FLAG_IN_MEMORY;
if (CustomData_verify_versions(data, i)) {
layer->data = newdataadr(fd, layer->data);
- if(layer->type == CD_MDISPS)
+ if (layer->type == CD_MDISPS)
direct_link_mdisps(fd, count, layer->data, layer->flag & CD_FLAG_EXTERNAL);
i++;
}
@@ -3872,7 +3889,7 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
/* Multires data */
mesh->mr= newdataadr(fd, mesh->mr);
- if(mesh->mr) {
+ if (mesh->mr) {
MultiresLevel *lvl;
link_list(fd, &mesh->mr->levels);
@@ -3893,13 +3910,13 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
because some saved files either do not have a verts
array, or the verts array contains out-of-date
data. */
- if(mesh->totvert == ((MultiresLevel*)mesh->mr->levels.last)->totvert) {
- if(mesh->mr->verts)
+ if (mesh->totvert == ((MultiresLevel*)mesh->mr->levels.last)->totvert) {
+ if (mesh->mr->verts)
MEM_freeN(mesh->mr->verts);
mesh->mr->verts = MEM_dupallocN(mesh->mvert);
}
- for(; lvl; lvl= lvl->next) {
+ for (; lvl; lvl= lvl->next) {
lvl->verts= newdataadr(fd, lvl->verts);
lvl->faces= newdataadr(fd, lvl->faces);
lvl->edges= newdataadr(fd, lvl->edges);
@@ -3909,12 +3926,12 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
/* if multires is present but has no valid vertex data,
* there's no way to recover it; silently remove multires */
- if(mesh->mr && !mesh->mr->verts) {
+ if (mesh->mr && !mesh->mr->verts) {
multires_free(mesh->mr);
mesh->mr = NULL;
}
- if((fd->flags & FD_FLAGS_SWITCH_ENDIAN) && mesh->tface) {
+ if ((fd->flags & FD_FLAGS_SWITCH_ENDIAN) && mesh->tface) {
TFace *tf= mesh->tface;
int i;
@@ -3934,9 +3951,9 @@ static void lib_link_latt(FileData *fd, Main *main)
Lattice *lt;
lt= main->latt.first;
- while(lt) {
- if(lt->id.flag & LIB_NEEDLINK) {
- if(lt->adt) lib_link_animdata(fd, &lt->id, lt->adt);
+ while (lt) {
+ if (lt->id.flag & LIB_NEEDLINK) {
+ if (lt->adt) lib_link_animdata(fd, &lt->id, lt->adt);
lt->ipo= newlibadr_us(fd, lt->id.lib, lt->ipo); // XXX depreceated - old animation system
lt->key= newlibadr_us(fd, lt->id.lib, lt->key);
@@ -3970,7 +3987,7 @@ static void lib_link_modifiers__linkModifiers(void *userData, Object *ob,
*idpoin = newlibadr(fd, ob->id.lib, *idpoin);
/* hardcoded bad exception; non-object modifier data gets user count (texture, displace) */
- if(*idpoin && GS((*idpoin)->name)!=ID_OB)
+ if (*idpoin && GS((*idpoin)->name)!=ID_OB)
(*idpoin)->us++;
}
static void lib_link_modifiers(FileData *fd, Object *ob)
@@ -3989,8 +4006,8 @@ static void lib_link_object(FileData *fd, Main *main)
int warn=0, a;
ob= main->object.first;
- while(ob) {
- if(ob->id.flag & LIB_NEEDLINK) {
+ while (ob) {
+ if (ob->id.flag & LIB_NEEDLINK) {
if (ob->id.properties) IDP_LibLinkProperty(ob->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
if (ob->adt) lib_link_animdata(fd, &ob->id, ob->adt);
@@ -4005,9 +4022,9 @@ static void lib_link_object(FileData *fd, Main *main)
ob->dup_group= newlibadr_us(fd, ob->id.lib, ob->dup_group);
ob->proxy= newlibadr_us(fd, ob->id.lib, ob->proxy);
- if(ob->proxy) {
+ if (ob->proxy) {
/* paranoia check, actually a proxy_from pointer should never be written... */
- if(ob->proxy->id.lib==NULL) {
+ if (ob->proxy->id.lib==NULL) {
ob->proxy->proxy_from= NULL;
ob->proxy= NULL;
@@ -4028,8 +4045,8 @@ static void lib_link_object(FileData *fd, Main *main)
poin= ob->data;
ob->data= newlibadr_us(fd, ob->id.lib, ob->data);
- if(ob->data==NULL && poin!=NULL) {
- if(ob->id.lib)
+ if (ob->data==NULL && poin!=NULL) {
+ if (ob->id.lib)
printf("Can't find obdata of %s lib %s\n", ob->id.name+2, ob->id.lib->name);
else
printf("Object %s lost data.\n", ob->id.name+2);
@@ -4037,20 +4054,20 @@ static void lib_link_object(FileData *fd, Main *main)
ob->type= OB_EMPTY;
warn= 1;
- if(ob->pose) {
+ if (ob->pose) {
free_pose(ob->pose);
ob->pose= NULL;
ob->mode &= ~OB_MODE_POSE;
}
}
- for(a=0; a<ob->totcol; a++) ob->mat[a]= newlibadr_us(fd, ob->id.lib, ob->mat[a]);
+ for (a=0; a<ob->totcol; a++) ob->mat[a]= newlibadr_us(fd, ob->id.lib, ob->mat[a]);
/* When the object is local and the data is library its possible
* the material list size gets out of sync. [#22663] */
- if(ob->data && ob->id.lib != ((ID *)ob->data)->lib) {
+ if (ob->data && ob->id.lib != ((ID *)ob->data)->lib) {
short *totcol_data= give_totcolp(ob);
/* Only expand so as not to loose any object materials that might be set. */
- if(totcol_data && *totcol_data > ob->totcol) {
+ if (totcol_data && *totcol_data > ob->totcol) {
/* printf("'%s' %d -> %d\n", ob->id.name, ob->totcol, *totcol_data); */
resize_object_material(ob, *totcol_data);
}
@@ -4071,22 +4088,22 @@ static void lib_link_object(FileData *fd, Main *main)
lib_link_nlastrips(fd, &ob->id, &ob->nlastrips);
// >>> XXX depreceated - old animation system
- for(paf= ob->effect.first; paf; paf= paf->next) {
- if(paf->type==EFF_PARTICLE) {
+ for (paf= ob->effect.first; paf; paf= paf->next) {
+ if (paf->type==EFF_PARTICLE) {
paf->group= newlibadr_us(fd, ob->id.lib, paf->group);
}
}
sens= ob->sensors.first;
- while(sens) {
- for(a=0; a<sens->totlinks; a++)
+ while (sens) {
+ for (a=0; a<sens->totlinks; a++)
sens->links[a]= newglobadr(fd, sens->links[a]);
- if(sens->type==SENS_TOUCH) {
+ if (sens->type==SENS_TOUCH) {
bTouchSensor *ts= sens->data;
ts->ma= newlibadr(fd, ob->id.lib, ts->ma);
}
- else if(sens->type==SENS_MESSAGE) {
+ else if (sens->type==SENS_MESSAGE) {
bMessageSensor *ms= sens->data;
ms->fromObject=
newlibadr(fd, ob->id.lib, ms->fromObject);
@@ -4095,11 +4112,11 @@ static void lib_link_object(FileData *fd, Main *main)
}
cont= ob->controllers.first;
- while(cont) {
- for(a=0; a<cont->totlinks; a++)
+ while (cont) {
+ for (a=0; a<cont->totlinks; a++)
cont->links[a]= newglobadr(fd, cont->links[a]);
- if(cont->type==CONT_PYTHON) {
+ if (cont->type==CONT_PYTHON) {
bPythonCont *pc= cont->data;
pc->text= newlibadr(fd, ob->id.lib, pc->text);
}
@@ -4110,35 +4127,35 @@ static void lib_link_object(FileData *fd, Main *main)
}
act= ob->actuators.first;
- while(act) {
- if(act->type==ACT_SOUND) {
+ while (act) {
+ if (act->type==ACT_SOUND) {
bSoundActuator *sa= act->data;
sa->sound= newlibadr_us(fd, ob->id.lib, sa->sound);
}
- else if(act->type==ACT_GAME) {
+ else if (act->type==ACT_GAME) {
/* bGameActuator *ga= act->data; */
}
- else if(act->type==ACT_CAMERA) {
+ else if (act->type==ACT_CAMERA) {
bCameraActuator *ca= act->data;
ca->ob= newlibadr(fd, ob->id.lib, ca->ob);
}
/* leave this one, it's obsolete but necessary to read for conversion */
- else if(act->type==ACT_ADD_OBJECT) {
+ else if (act->type==ACT_ADD_OBJECT) {
bAddObjectActuator *eoa= act->data;
- if(eoa) eoa->ob= newlibadr(fd, ob->id.lib, eoa->ob);
+ if (eoa) eoa->ob= newlibadr(fd, ob->id.lib, eoa->ob);
}
- else if(act->type==ACT_OBJECT) {
+ else if (act->type==ACT_OBJECT) {
bObjectActuator *oa= act->data;
- if(oa==NULL) {
+ if (oa==NULL) {
init_actuator(act);
}
else {
oa->reference= newlibadr(fd, ob->id.lib, oa->reference);
}
}
- else if(act->type==ACT_EDIT_OBJECT) {
+ else if (act->type==ACT_EDIT_OBJECT) {
bEditObjectActuator *eoa= act->data;
- if(eoa==NULL) {
+ if (eoa==NULL) {
init_actuator(act);
}
else {
@@ -4146,44 +4163,44 @@ static void lib_link_object(FileData *fd, Main *main)
eoa->me= newlibadr(fd, ob->id.lib, eoa->me);
}
}
- else if(act->type==ACT_SCENE) {
+ else if (act->type==ACT_SCENE) {
bSceneActuator *sa= act->data;
sa->camera= newlibadr(fd, ob->id.lib, sa->camera);
sa->scene= newlibadr(fd, ob->id.lib, sa->scene);
}
- else if(act->type==ACT_ACTION) {
+ else if (act->type==ACT_ACTION) {
bActionActuator *aa= act->data;
aa->act= newlibadr(fd, ob->id.lib, aa->act);
}
- else if(act->type==ACT_SHAPEACTION) {
+ else if (act->type==ACT_SHAPEACTION) {
bActionActuator *aa= act->data;
aa->act= newlibadr(fd, ob->id.lib, aa->act);
}
- else if(act->type==ACT_PROPERTY) {
+ else if (act->type==ACT_PROPERTY) {
bPropertyActuator *pa= act->data;
pa->ob= newlibadr(fd, ob->id.lib, pa->ob);
}
- else if(act->type==ACT_MESSAGE) {
+ else if (act->type==ACT_MESSAGE) {
bMessageActuator *ma= act->data;
ma->toObject= newlibadr(fd, ob->id.lib, ma->toObject);
}
- else if(act->type==ACT_2DFILTER){
+ else if (act->type==ACT_2DFILTER) {
bTwoDFilterActuator *_2dfa = act->data;
_2dfa->text= newlibadr(fd, ob->id.lib, _2dfa->text);
}
- else if(act->type==ACT_PARENT) {
+ else if (act->type==ACT_PARENT) {
bParentActuator *parenta = act->data;
parenta->ob = newlibadr(fd, ob->id.lib, parenta->ob);
}
- else if(act->type==ACT_STATE) {
+ else if (act->type==ACT_STATE) {
/* bStateActuator *statea = act->data; */
}
- else if(act->type==ACT_ARMATURE) {
+ else if (act->type==ACT_ARMATURE) {
bArmatureActuator *arma= act->data;
arma->target= newlibadr(fd, ob->id.lib, arma->target);
arma->subtarget= newlibadr(fd, ob->id.lib, arma->subtarget);
}
- else if(act->type==ACT_STEERING) {
+ else if (act->type==ACT_STEERING) {
bSteeringActuator *steeringa = act->data;
steeringa->target = newlibadr(fd, ob->id.lib, steeringa->target);
steeringa->navmesh = newlibadr(fd, ob->id.lib, steeringa->navmesh);
@@ -4194,24 +4211,24 @@ static void lib_link_object(FileData *fd, Main *main)
{
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
- if(fluidmd && fluidmd->fss)
+ if (fluidmd && fluidmd->fss)
fluidmd->fss->ipo = newlibadr_us(fd, ob->id.lib, fluidmd->fss->ipo);
}
{
SmokeModifierData *smd = (SmokeModifierData *)modifiers_findByType(ob, eModifierType_Smoke);
- if(smd && smd->type == MOD_SMOKE_TYPE_DOMAIN && smd->domain)
+ if (smd && smd->type == MOD_SMOKE_TYPE_DOMAIN && smd->domain)
{
smd->domain->flags |= MOD_SMOKE_FILE_LOAD; /* flag for refreshing the simulation after loading */
}
}
/* texture field */
- if(ob->pd)
+ if (ob->pd)
lib_link_partdeflect(fd, &ob->id, ob->pd);
- if(ob->soft)
+ if (ob->soft)
ob->soft->effector_weights->group = newlibadr(fd, ob->id.lib, ob->soft->effector_weights->group);
lib_link_particlesystems(fd, ob, &ob->id, &ob->particlesystem);
@@ -4220,7 +4237,7 @@ static void lib_link_object(FileData *fd, Main *main)
ob= ob->id.next;
}
- if(warn) {
+ if (warn) {
BKE_report(fd->reports, RPT_WARNING, "Warning in console");
}
}
@@ -4257,7 +4274,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;
@@ -4277,7 +4294,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
md->scene = NULL;
/* if modifiers disappear, or for upward compatibility */
- if(NULL==modifierType_getInfo(md->type))
+ if (NULL==modifierType_getInfo(md->type))
md->type= eModifierType_None;
if (md->type==eModifierType_Subsurf) {
@@ -4300,15 +4317,15 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
direct_link_pointcache_list(fd, &clmd->ptcaches, &clmd->point_cache, 0);
- if(clmd->sim_parms) {
- if(clmd->sim_parms->presets > 10)
+ if (clmd->sim_parms) {
+ if (clmd->sim_parms->presets > 10)
clmd->sim_parms->presets = 0;
clmd->sim_parms->reset = 0;
clmd->sim_parms->effector_weights = newdataadr(fd, clmd->sim_parms->effector_weights);
- if(!clmd->sim_parms->effector_weights) {
+ if (!clmd->sim_parms->effector_weights) {
clmd->sim_parms->effector_weights = BKE_add_effector_weights(NULL);
}
}
@@ -4317,7 +4334,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
FluidsimModifierData *fluidmd = (FluidsimModifierData*) md;
fluidmd->fss= newdataadr(fd, fluidmd->fss);
- if(fluidmd->fss) {
+ if (fluidmd->fss) {
fluidmd->fss->fmd= fluidmd;
fluidmd->fss->meshVelocities = NULL;
}
@@ -4325,7 +4342,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
else if (md->type==eModifierType_Smoke) {
SmokeModifierData *smd = (SmokeModifierData*) md;
- if(smd->type==MOD_SMOKE_TYPE_DOMAIN)
+ if (smd->type==MOD_SMOKE_TYPE_DOMAIN)
{
smd->flow = NULL;
smd->coll = NULL;
@@ -4340,16 +4357,16 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
smd->domain->tex_wt = NULL;
smd->domain->effector_weights = newdataadr(fd, smd->domain->effector_weights);
- if(!smd->domain->effector_weights)
+ if (!smd->domain->effector_weights)
smd->domain->effector_weights = BKE_add_effector_weights(NULL);
direct_link_pointcache_list(fd, &(smd->domain->ptcaches[0]), &(smd->domain->point_cache[0]), 1);
/* Smoke uses only one cache from now on, so store pointer convert */
- if(smd->domain->ptcaches[1].first || smd->domain->point_cache[1]) {
- if(smd->domain->point_cache[1]) {
+ if (smd->domain->ptcaches[1].first || smd->domain->point_cache[1]) {
+ if (smd->domain->point_cache[1]) {
PointCache *cache = newdataadr(fd, smd->domain->point_cache[1]);
- if(cache->flag & PTCACHE_FAKE_SMOKE)
+ if (cache->flag & PTCACHE_FAKE_SMOKE)
; /* Smoke was already saved in "new format" and this cache is a fake one. */
else
printf("High resolution smoke cache not available due to pointcache update. Please reset the simulation.\n");
@@ -4360,20 +4377,18 @@ 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);
- if(smd->coll)
+ if (smd->coll)
{
smd->coll->points = NULL;
smd->coll->numpoints = 0;
@@ -4386,7 +4401,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
else if (md->type==eModifierType_DynamicPaint) {
DynamicPaintModifierData *pmd = (DynamicPaintModifierData*) md;
- if(pmd->canvas)
+ if (pmd->canvas)
{
pmd->canvas = newdataadr(fd, pmd->canvas);
pmd->canvas->pmd = pmd;
@@ -4402,12 +4417,12 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
surface->data = NULL;
direct_link_pointcache_list(fd, &(surface->ptcaches), &(surface->pointcache), 1);
- if(!(surface->effector_weights = newdataadr(fd, surface->effector_weights)))
+ if (!(surface->effector_weights = newdataadr(fd, surface->effector_weights)))
surface->effector_weights = BKE_add_effector_weights(NULL);
}
}
}
- if(pmd->brush)
+ if (pmd->brush)
{
pmd->brush = newdataadr(fd, pmd->brush);
pmd->brush->pmd = pmd;
@@ -4456,20 +4471,22 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
HookModifierData *hmd = (HookModifierData*) md;
hmd->indexar= newdataadr(fd, hmd->indexar);
- if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
+ if (fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
int a;
- for(a=0; a<hmd->totindex; a++) {
+ for (a=0; a<hmd->totindex; a++) {
SWITCH_INT(hmd->indexar[a]);
}
}
- } else if (md->type==eModifierType_ParticleSystem) {
+ }
+ else if (md->type==eModifierType_ParticleSystem) {
ParticleSystemModifierData *psmd = (ParticleSystemModifierData*) md;
psmd->dm= NULL;
psmd->psys= newdataadr(fd, psmd->psys);
psmd->flag &= ~eParticleSystemFlag_psys_updated;
psmd->flag |= eParticleSystemFlag_file_loaded;
- } else if (md->type==eModifierType_Explode) {
+ }
+ else if (md->type==eModifierType_Explode) {
ExplodeModifierData *psmd = (ExplodeModifierData*) md;
psmd->facepa=NULL;
@@ -4487,25 +4504,25 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
mmd->bindweights= newdataadr(fd, mmd->bindweights);
mmd->bindcos= newdataadr(fd, mmd->bindcos);
- if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
+ if (fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
int a;
- if(mmd->bindoffsets)
- for(a=0; a<mmd->totvert+1; a++)
- SWITCH_INT(mmd->bindoffsets[a])
- if(mmd->bindcagecos)
- for(a=0; a<mmd->totcagevert*3; a++)
- SWITCH_INT(mmd->bindcagecos[a])
- if(mmd->dynverts)
- for(a=0; a<mmd->totvert; a++)
- SWITCH_INT(mmd->dynverts[a])
+ if (mmd->bindoffsets)
+ for (a=0; a<mmd->totvert+1; a++)
+ SWITCH_INT(mmd->bindoffsets[a]);
+ if (mmd->bindcagecos)
+ for (a=0; a<mmd->totcagevert*3; a++)
+ SWITCH_INT(mmd->bindcagecos[a]);
+ if (mmd->dynverts)
+ for (a=0; a<mmd->totvert; a++)
+ SWITCH_INT(mmd->dynverts[a]);
- if(mmd->bindweights)
- for(a=0; a<mmd->totcagevert*mmd->totvert; a++)
- SWITCH_INT(mmd->bindweights[a])
- if(mmd->bindcos)
- for(a=0; a<mmd->totcagevert*3; a++)
- SWITCH_INT(mmd->bindcos[a])
+ if (mmd->bindweights)
+ for (a=0; a<mmd->totcagevert*mmd->totvert; a++)
+ SWITCH_INT(mmd->bindweights[a]);
+ if (mmd->bindcos)
+ for (a=0; a<mmd->totcagevert*3; a++)
+ SWITCH_INT(mmd->bindcos[a]);
}
}
else if (md->type==eModifierType_Ocean) {
@@ -4518,14 +4535,14 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
WarpModifierData *tmd = (WarpModifierData *) md;
tmd->curfalloff= newdataadr(fd, tmd->curfalloff);
- if(tmd->curfalloff)
+ if (tmd->curfalloff)
direct_link_curvemapping(fd, tmd->curfalloff);
}
else if (md->type==eModifierType_WeightVGEdit) {
WeightVGEditModifierData *wmd = (WeightVGEditModifierData*) md;
wmd->cmap_curve = newdataadr(fd, wmd->cmap_curve);
- if(wmd->cmap_curve)
+ if (wmd->cmap_curve)
direct_link_curvemapping(fd, wmd->cmap_curve);
}
}
@@ -4544,7 +4561,7 @@ static void direct_link_object(FileData *fd, Object *ob)
/* loading saved files with editmode enabled works, but for undo we like
to stay in object mode during undo presses so keep editmode disabled */
- if(fd->memfile)
+ if (fd->memfile)
ob->mode &= ~(OB_MODE_EDIT|OB_MODE_PARTICLE_EDIT);
ob->disp.first=ob->disp.last= NULL;
@@ -4574,11 +4591,11 @@ static void direct_link_object(FileData *fd, Object *ob)
link_list(fd, &ob->effect);
paf= ob->effect.first;
- while(paf) {
- if(paf->type==EFF_PARTICLE) {
+ while (paf) {
+ if (paf->type==EFF_PARTICLE) {
paf->keys= NULL;
}
- if(paf->type==EFF_WAVE) {
+ if (paf->type==EFF_WAVE) {
WaveEff *wav = (WaveEff*) paf;
PartEff *next = paf->next;
WaveModifierData *wmd = (WaveModifierData*) modifier_new(eModifierType_Wave);
@@ -4602,7 +4619,7 @@ static void direct_link_object(FileData *fd, Object *ob)
paf = next;
continue;
}
- if(paf->type==EFF_BUILD) {
+ if (paf->type==EFF_BUILD) {
BuildEff *baf = (BuildEff*) paf;
PartEff *next = paf->next;
BuildModifierData *bmd = (BuildModifierData*) modifier_new(eModifierType_Build);
@@ -4626,7 +4643,7 @@ static void direct_link_object(FileData *fd, Object *ob)
ob->pd= newdataadr(fd, ob->pd);
direct_link_partdeflect(ob->pd);
ob->soft= newdataadr(fd, ob->soft);
- if(ob->soft) {
+ if (ob->soft) {
SoftBody *sb= ob->soft;
sb->bpoint= NULL; // init pointers so it gets rebuilt nicely
@@ -4636,15 +4653,15 @@ static void direct_link_object(FileData *fd, Object *ob)
/* still have to be loaded to be compatible with old files */
sb->keys= newdataadr(fd, sb->keys);
test_pointer_array(fd, (void **)&sb->keys);
- if(sb->keys) {
+ if (sb->keys) {
int a;
- for(a=0; a<sb->totkey; a++) {
+ for (a=0; a<sb->totkey; a++) {
sb->keys[a]= newdataadr(fd, sb->keys[a]);
}
}
sb->effector_weights = newdataadr(fd, sb->effector_weights);
- if(!sb->effector_weights)
+ if (!sb->effector_weights)
sb->effector_weights = BKE_add_effector_weights(NULL);
direct_link_pointcache_list(fd, &sb->ptcaches, &sb->pointcache, 0);
@@ -4657,15 +4674,15 @@ static void direct_link_object(FileData *fd, Object *ob)
link_list(fd, &ob->prop);
prop= ob->prop.first;
- while(prop) {
+ while (prop) {
prop->poin= newdataadr(fd, prop->poin);
- if(prop->poin==NULL) prop->poin= &prop->data;
+ if (prop->poin==NULL) prop->poin= &prop->data;
prop= prop->next;
}
link_list(fd, &ob->sensors);
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
sens->data= newdataadr(fd, sens->data);
sens->links= newdataadr(fd, sens->links);
test_pointer_array(fd, (void **)&sens->links);
@@ -4678,11 +4695,12 @@ static void direct_link_object(FileData *fd, Object *ob)
if (ob->init_state) {
/* if a known first state is specified, set it so that the game will start ok */
ob->state = ob->init_state;
- } else if (!ob->state) {
+ }
+ else if (!ob->state) {
ob->state = 1;
}
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
cont->data= newdataadr(fd, cont->data);
cont->links= newdataadr(fd, cont->links);
test_pointer_array(fd, (void **)&cont->links);
@@ -4693,7 +4711,7 @@ static void direct_link_object(FileData *fd, Object *ob)
link_glob_list(fd, &ob->actuators);
act= ob->actuators.first;
- while(act) {
+ while (act) {
act->data= newdataadr(fd, act->data);
act= act->next;
}
@@ -4704,16 +4722,16 @@ static void direct_link_object(FileData *fd, Object *ob)
HookModifierData *hmd = (HookModifierData*) modifier_new(eModifierType_Hook);
hook->indexar= newdataadr(fd, hook->indexar);
- if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
+ if (fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
int a;
- for(a=0; a<hook->totindex; a++) {
+ for (a=0; a<hook->totindex; a++) {
SWITCH_INT(hook->indexar[a]);
}
}
/* 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;
@@ -4738,10 +4756,10 @@ 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) {
+ if (ob->sculpt) {
ob->sculpt= MEM_callocN(sizeof(SculptSession), "reload sculpt session");
}
}
@@ -4753,14 +4771,14 @@ static void composite_patch(bNodeTree *ntree, Scene *scene)
{
bNode *node;
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->id==NULL && ELEM4(node->type, CMP_NODE_R_LAYERS, CMP_NODE_COMPOSITE, CMP_NODE_DEFOCUS, CMP_NODE_OUTPUT_FILE))
+ for (node= ntree->nodes.first; node; node= node->next)
+ if (node->id==NULL && ELEM4(node->type, CMP_NODE_R_LAYERS, CMP_NODE_COMPOSITE, CMP_NODE_DEFOCUS, CMP_NODE_OUTPUT_FILE))
node->id= &scene->id;
}
static void link_paint(FileData *fd, Scene *sce, Paint *p)
{
- if(p) {
+ if (p) {
p->brush= newlibadr_us(fd, sce->id.lib, p->brush);
p->paint_cursor= NULL;
}
@@ -4775,8 +4793,8 @@ static void lib_link_scene(FileData *fd, Main *main)
TimeMarker *marker;
sce= main->scene.first;
- while(sce) {
- if(sce->id.flag & LIB_NEEDLINK) {
+ while (sce) {
+ if (sce->id.flag & LIB_NEEDLINK) {
/*Link ID Properties -- and copy this comment EXACTLY for easy finding
of library blocks that implement this.*/
if (sce->id.properties) IDP_LibLinkProperty(sce->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
@@ -4796,35 +4814,38 @@ static void lib_link_scene(FileData *fd, Main *main)
link_paint(fd, sce, &sce->toolsettings->uvsculpt->paint);
sce->toolsettings->skgen_template = newlibadr(fd, sce->id.lib, sce->toolsettings->skgen_template);
- for(base= sce->base.first; base; base= next) {
+ for (base= sce->base.first; base; base= next) {
next= base->next;
/* base->object= newlibadr_us(fd, sce->id.lib, base->object); */
base->object= newlibadr_us(fd, sce->id.lib, base->object);
- if(base->object==NULL) {
+ if (base->object==NULL) {
BKE_reportf_wrap(fd->reports, RPT_ERROR,
"LIB ERROR: Object lost from scene:'%s\'\n",
sce->id.name+2);
BLI_remlink(&sce->base, base);
- if(base==sce->basact) sce->basact= NULL;
+ if (base==sce->basact) sce->basact= NULL;
MEM_freeN(base);
}
}
SEQ_BEGIN(sce->ed, seq) {
- if(seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo);
+ if (seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo);
seq->scene_sound = NULL;
- if(seq->scene) {
+ if (seq->scene) {
seq->scene= newlibadr(fd, sce->id.lib, seq->scene);
- if(seq->scene) {
+ if (seq->scene) {
seq->scene_sound = sound_scene_add_scene_sound_defaults(sce, seq);
}
}
- if(seq->scene_camera) seq->scene_camera= newlibadr(fd, sce->id.lib, seq->scene_camera);
- if(seq->sound) {
+ if (seq->clip) {
+ seq->clip = newlibadr(fd, sce->id.lib, seq->clip);
+ }
+ if (seq->scene_camera) seq->scene_camera= newlibadr(fd, sce->id.lib, seq->scene_camera);
+ if (seq->sound) {
seq->scene_sound = NULL;
- if(seq->type == SEQ_HD_SOUND)
+ if (seq->type == SEQ_HD_SOUND)
seq->type = SEQ_SOUND;
else
seq->sound= newlibadr(fd, sce->id.lib, seq->sound);
@@ -4838,8 +4859,8 @@ static void lib_link_scene(FileData *fd, Main *main)
SEQ_END
#ifdef DURIAN_CAMERA_SWITCH
- for(marker= sce->markers.first; marker; marker= marker->next) {
- if(marker->camera) {
+ for (marker= sce->markers.first; marker; marker= marker->next) {
+ if (marker->camera) {
marker->camera= newlibadr(fd, sce->id.lib, marker->camera);
}
}
@@ -4850,12 +4871,12 @@ static void lib_link_scene(FileData *fd, Main *main)
seq_update_muting(sce->ed);
seq_update_sound_bounds_all(sce);
- if(sce->nodetree) {
+ if (sce->nodetree) {
lib_link_ntree(fd, &sce->id, sce->nodetree);
composite_patch(sce->nodetree, sce);
}
- for(srl= sce->r.layers.first; srl; srl= srl->next) {
+ for (srl= sce->r.layers.first; srl; srl= srl->next) {
srl->mat_override= newlibadr_us(fd, sce->id.lib, srl->mat_override);
srl->light_override= newlibadr_us(fd, sce->id.lib, srl->light_override);
}
@@ -4878,8 +4899,8 @@ static void link_recurs_seq(FileData *fd, ListBase *lb)
link_list(fd, lb);
- for(seq=lb->first; seq; seq=seq->next)
- if(seq->seqbase.first)
+ for (seq=lb->first; seq; seq=seq->next)
+ if (seq->seqbase.first)
link_recurs_seq(fd, &seq->seqbase);
}
@@ -4919,7 +4940,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
sce->basact= newdataadr(fd, sce->basact);
sce->toolsettings= newdataadr(fd, sce->toolsettings);
- if(sce->toolsettings) {
+ if (sce->toolsettings) {
direct_link_paint(fd, (Paint**)&sce->toolsettings->sculpt);
direct_link_paint(fd, (Paint**)&sce->toolsettings->vpaint);
direct_link_paint(fd, (Paint**)&sce->toolsettings->wpaint);
@@ -4929,7 +4950,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
sce->toolsettings->particle.paintcursor= NULL;
}
- if(sce->ed) {
+ if (sce->ed) {
ListBase *old_seqbasep= &((Editing *)sce->ed)->seqbase;
ed= sce->ed= newdataadr(fd, sce->ed);
@@ -4944,55 +4965,60 @@ static void direct_link_scene(FileData *fd, Scene *sce)
seq->seq2= newdataadr(fd, seq->seq2);
seq->seq3= newdataadr(fd, seq->seq3);
/* a patch: after introduction of effects with 3 input strips */
- if(seq->seq3==NULL) seq->seq3= seq->seq2;
+ if (seq->seq3==NULL) seq->seq3= seq->seq2;
seq->plugin= newdataadr(fd, seq->plugin);
seq->effectdata= newdataadr(fd, seq->effectdata);
- if(seq->type & SEQ_EFFECT)
+ if (seq->type & SEQ_EFFECT)
seq->flag |= SEQ_EFFECT_NOT_LOADED;
- if(seq->type == SEQ_SPEED) {
+ if (seq->type == SEQ_SPEED) {
SpeedControlVars *s= seq->effectdata;
s->frameMap= NULL;
}
seq->strip= newdataadr(fd, seq->strip);
- if(seq->strip && seq->strip->done==0) {
+ if (seq->strip && seq->strip->done==0) {
seq->strip->done= 1;
- if(seq->type == SEQ_IMAGE ||
+ if (seq->type == SEQ_IMAGE ||
seq->type == SEQ_MOVIE ||
seq->type == SEQ_RAM_SOUND ||
seq->type == SEQ_HD_SOUND) {
seq->strip->stripdata = newdataadr(
fd, seq->strip->stripdata);
- } else {
+ }
+ else {
seq->strip->stripdata = NULL;
}
if (seq->flag & SEQ_USE_CROP) {
seq->strip->crop = newdataadr(
fd, seq->strip->crop);
- } else {
+ }
+ else {
seq->strip->crop = NULL;
}
if (seq->flag & SEQ_USE_TRANSFORM) {
seq->strip->transform = newdataadr(
fd, seq->strip->transform);
- } else {
+ }
+ else {
seq->strip->transform = NULL;
}
if (seq->flag & SEQ_USE_PROXY) {
seq->strip->proxy = newdataadr(
fd, seq->strip->proxy);
seq->strip->proxy->anim = NULL;
- } else {
+ }
+ else {
seq->strip->proxy = NULL;
}
if (seq->flag & SEQ_USE_COLOR_BALANCE) {
seq->strip->color_balance = newdataadr(
fd, seq->strip->color_balance);
- } else {
+ }
+ else {
seq->strip->color_balance = NULL;
}
if (seq->strip->color_balance) {
@@ -5011,7 +5037,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
offset= ((intptr_t)&(temp.seqbase)) - ((intptr_t)&temp);
/* root pointer */
- if(ed->seqbasep == old_seqbasep) {
+ if (ed->seqbasep == old_seqbasep) {
ed->seqbasep= &ed->seqbase;
}
else {
@@ -5020,22 +5046,22 @@ static void direct_link_scene(FileData *fd, Scene *sce)
poin -= offset;
poin= newdataadr(fd, poin);
- if(poin) ed->seqbasep= (ListBase *)(poin+offset);
+ if (poin) ed->seqbasep= (ListBase *)(poin+offset);
else ed->seqbasep= &ed->seqbase;
}
/* stack */
link_list(fd, &(ed->metastack));
- for(ms= ed->metastack.first; ms; ms= ms->next) {
+ for (ms= ed->metastack.first; ms; ms= ms->next) {
ms->parseq= newdataadr(fd, ms->parseq);
- if(ms->oldbasep == old_seqbasep)
+ if (ms->oldbasep == old_seqbasep)
ms->oldbasep= &ed->seqbase;
else {
poin= (char *)ms->oldbasep;
poin -= offset;
poin= newdataadr(fd, poin);
- if(poin) ms->oldbasep= (ListBase *)(poin+offset);
+ if (poin) ms->oldbasep= (ListBase *)(poin+offset);
else ms->oldbasep= &ed->seqbase;
}
}
@@ -5067,7 +5093,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
link_list(fd, &(sce->r.layers));
sce->nodetree= newdataadr(fd, sce->nodetree);
- if(sce->nodetree)
+ if (sce->nodetree)
direct_link_nodetree(fd, sce->nodetree);
}
@@ -5080,7 +5106,7 @@ static void direct_link_windowmanager(FileData *fd, wmWindowManager *wm)
wm->id.us= 1;
link_list(fd, &(wm->windows));
- for(win= wm->windows.first; win; win= win->next) {
+ for (win= wm->windows.first; win; win= win->next) {
win->ghostwin= NULL;
win->eventstate= NULL;
win->curswin= NULL;
@@ -5122,9 +5148,9 @@ static void lib_link_windowmanager(FileData *fd, Main *main)
wmWindowManager *wm;
wmWindow *win;
- for(wm= main->wm.first; wm; wm= wm->id.next) {
- if(wm->id.flag & LIB_NEEDLINK) {
- for(win= wm->windows.first; win; win= win->next)
+ for (wm= main->wm.first; wm; wm= wm->id.next) {
+ if (wm->id.flag & LIB_NEEDLINK) {
+ for (win= wm->windows.first; win; win= win->next)
win->screen= newlibadr(fd, NULL, win->screen);
wm->id.flag -= LIB_NEEDLINK;
@@ -5168,10 +5194,10 @@ static void direct_link_gpencil(FileData *fd, bGPdata *gpd)
static void butspace_version_132(SpaceButs *buts)
{
- buts->v2d.tot.xmin= 0.0f;
- buts->v2d.tot.ymin= 0.0f;
- buts->v2d.tot.xmax= 1279.0f;
- buts->v2d.tot.ymax= 228.0f;
+ buts->v2d.tot.xmin = 0.0f;
+ buts->v2d.tot.ymin = 0.0f;
+ buts->v2d.tot.xmax = 1279.0f;
+ buts->v2d.tot.ymax = 228.0f;
buts->v2d.min[0]= 256.0f;
buts->v2d.min[1]= 42.0f;
@@ -5194,20 +5220,20 @@ static void lib_link_screen(FileData *fd, Main *main)
bScreen *sc;
ScrArea *sa;
- for(sc= main->screen.first; sc; sc= sc->id.next) {
- if(sc->id.flag & LIB_NEEDLINK) {
+ for (sc= main->screen.first; sc; sc= sc->id.next) {
+ if (sc->id.flag & LIB_NEEDLINK) {
sc->id.us= 1;
sc->scene= newlibadr(fd, sc->id.lib, sc->scene);
sc->animtimer= NULL; /* saved in rare cases */
sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl;
sa->full= newlibadr(fd, sc->id.lib, sa->full);
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_VIEW3D) {
+ if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D*) sl;
BGpic *bgpic = NULL;
@@ -5215,21 +5241,21 @@ static void lib_link_screen(FileData *fd, Main *main)
v3d->ob_centre= newlibadr(fd, sc->id.lib, v3d->ob_centre);
/* should be do_versions but not easy adding into the listbase */
- if(v3d->bgpic) {
+ if (v3d->bgpic) {
v3d->bgpic= newlibadr(fd, sc->id.lib, v3d->bgpic);
BLI_addtail(&v3d->bgpicbase, bgpic);
v3d->bgpic= NULL;
}
- for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) {
+ for (bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) {
bgpic->ima= newlibadr_us(fd, sc->id.lib, bgpic->ima);
bgpic->clip= newlibadr_us(fd, sc->id.lib, bgpic->clip);
}
- if(v3d->localvd) {
+ if (v3d->localvd) {
v3d->localvd->camera= newlibadr(fd, sc->id.lib, v3d->localvd->camera);
}
}
- else if(sl->spacetype==SPACE_IPO) {
+ else if (sl->spacetype==SPACE_IPO) {
SpaceIpo *sipo= (SpaceIpo *)sl;
bDopeSheet *ads= sipo->ads;
@@ -5238,15 +5264,15 @@ static void lib_link_screen(FileData *fd, Main *main)
ads->filter_grp= newlibadr(fd, sc->id.lib, ads->filter_grp);
}
}
- else if(sl->spacetype==SPACE_BUTS) {
+ else if (sl->spacetype==SPACE_BUTS) {
SpaceButs *sbuts= (SpaceButs *)sl;
sbuts->pinid= newlibadr(fd, sc->id.lib, sbuts->pinid);
sbuts->mainbo= sbuts->mainb;
sbuts->mainbuser= sbuts->mainb;
- if(main->versionfile<132)
+ if (main->versionfile<132)
butspace_version_132(sbuts);
}
- else if(sl->spacetype==SPACE_FILE) {
+ else if (sl->spacetype==SPACE_FILE) {
SpaceFile *sfile= (SpaceFile *)sl;
sfile->files= NULL;
sfile->op= NULL;
@@ -5254,7 +5280,7 @@ static void lib_link_screen(FileData *fd, Main *main)
sfile->folders_prev= NULL;
sfile->folders_next= NULL;
}
- else if(sl->spacetype==SPACE_ACTION) {
+ else if (sl->spacetype==SPACE_ACTION) {
SpaceAction *saction= (SpaceAction *)sl;
bDopeSheet *ads= &saction->ads;
@@ -5265,7 +5291,7 @@ static void lib_link_screen(FileData *fd, Main *main)
saction->action = newlibadr(fd, sc->id.lib, saction->action);
}
- else if(sl->spacetype==SPACE_IMAGE) {
+ else if (sl->spacetype==SPACE_IMAGE) {
SpaceImage *sima= (SpaceImage *)sl;
sima->image= newlibadr_us(fd, sc->id.lib, sima->image);
@@ -5275,7 +5301,7 @@ static void lib_link_screen(FileData *fd, Main *main)
*/
sima->gpd= newlibadr_us(fd, sc->id.lib, sima->gpd);
}
- else if(sl->spacetype==SPACE_NLA){
+ else if (sl->spacetype==SPACE_NLA) {
SpaceNla *snla= (SpaceNla *)sl;
bDopeSheet *ads= snla->ads;
@@ -5284,25 +5310,25 @@ static void lib_link_screen(FileData *fd, Main *main)
ads->filter_grp= newlibadr(fd, sc->id.lib, ads->filter_grp);
}
}
- else if(sl->spacetype==SPACE_TEXT) {
+ else if (sl->spacetype==SPACE_TEXT) {
SpaceText *st= (SpaceText *)sl;
st->text= newlibadr(fd, sc->id.lib, st->text);
st->drawcache= NULL;
}
- else if(sl->spacetype==SPACE_SCRIPT) {
+ else if (sl->spacetype==SPACE_SCRIPT) {
SpaceScript *scpt= (SpaceScript *)sl;
/*scpt->script = NULL; - 2.45 set to null, better re-run the script */
if (scpt->script) {
scpt->script= newlibadr(fd, sc->id.lib, scpt->script);
if (scpt->script) {
- SCRIPT_SET_NULL(scpt->script)
+ SCRIPT_SET_NULL(scpt->script);
}
}
}
- else if(sl->spacetype==SPACE_OUTLINER) {
+ else if (sl->spacetype==SPACE_OUTLINER) {
SpaceOops *so= (SpaceOops *)sl;
TreeStoreElem *tselem;
int a;
@@ -5310,14 +5336,14 @@ static void lib_link_screen(FileData *fd, Main *main)
so->tree.first= so->tree.last= NULL;
so->search_tse.id= newlibadr(fd, NULL, so->search_tse.id);
- if(so->treestore) {
+ if (so->treestore) {
tselem= so->treestore->data;
- for(a=0; a<so->treestore->usedelem; a++, tselem++) {
+ for (a=0; a<so->treestore->usedelem; a++, tselem++) {
tselem->id= newlibadr(fd, NULL, tselem->id);
}
}
}
- else if(sl->spacetype==SPACE_NODE) {
+ else if (sl->spacetype==SPACE_NODE) {
SpaceNode *snode= (SpaceNode *)sl;
snode->id= newlibadr(fd, sc->id.lib, snode->id);
@@ -5326,16 +5352,16 @@ static void lib_link_screen(FileData *fd, Main *main)
if (ELEM3(snode->treetype, NTREE_COMPOSIT, NTREE_SHADER, NTREE_TEXTURE)) {
/* internal data, a bit patchy */
snode->nodetree= NULL;
- if(snode->id) {
- if(GS(snode->id->name)==ID_MA)
+ if (snode->id) {
+ if (GS(snode->id->name)==ID_MA)
snode->nodetree= ((Material *)snode->id)->nodetree;
- else if(GS(snode->id->name)==ID_WO)
+ else if (GS(snode->id->name)==ID_WO)
snode->nodetree= ((World *)snode->id)->nodetree;
- else if(GS(snode->id->name)==ID_LA)
+ else if (GS(snode->id->name)==ID_LA)
snode->nodetree= ((Lamp *)snode->id)->nodetree;
- else if(GS(snode->id->name)==ID_SCE)
+ else if (GS(snode->id->name)==ID_SCE)
snode->nodetree= ((Scene *)snode->id)->nodetree;
- else if(GS(snode->id->name)==ID_TE)
+ else if (GS(snode->id->name)==ID_TE)
snode->nodetree= ((Tex *)snode->id)->nodetree;
}
}
@@ -5345,7 +5371,7 @@ static void lib_link_screen(FileData *fd, Main *main)
snode->linkdrag.first = snode->linkdrag.last = NULL;
}
- else if(sl->spacetype==SPACE_CLIP) {
+ else if (sl->spacetype==SPACE_CLIP) {
SpaceClip *sclip= (SpaceClip *)sl;
sclip->clip= newlibadr_us(fd, sc->id.lib, sclip->clip);
@@ -5365,17 +5391,17 @@ static void lib_link_screen(FileData *fd, Main *main)
static void *restore_pointer_by_name(Main *mainp, ID *id, int user)
{
- if(id) {
+ if (id) {
ListBase *lb= which_libbase(mainp, GS(id->name));
- if(lb) { // there's still risk of checking corrupt mem (freed Ids in oops)
+ if (lb) { // there's still risk of checking corrupt mem (freed Ids in oops)
ID *idn= lb->first;
char *name= id->name+2;
- while(idn) {
- if(idn->name[2]==name[0] && strcmp(idn->name+2, name)==0) {
- if(idn->lib==id->lib) {
- if(user && idn->us==0) idn->us++;
+ while (idn) {
+ if (idn->name[2]==name[0] && strcmp(idn->name+2, name)==0) {
+ if (idn->lib==id->lib) {
+ if (user && idn->us==0) idn->us++;
break;
}
}
@@ -5391,15 +5417,15 @@ static int lib_link_seq_clipboard_cb(Sequence *seq, void *arg_pt)
{
Main *newmain = (Main *)arg_pt;
- if(seq->sound) {
+ if (seq->sound) {
seq->sound = restore_pointer_by_name(newmain, (ID *)seq->sound, 0);
seq->sound->id.us++;
}
- if(seq->scene)
+ if (seq->scene)
seq->scene = restore_pointer_by_name(newmain, (ID *)seq->scene, 1);
- if(seq->scene_camera)
+ if (seq->scene_camera)
seq->scene_camera = restore_pointer_by_name(newmain, (ID *)seq->scene_camera, 1);
return 1;
@@ -5422,11 +5448,11 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
ScrArea *sa;
/* first windowmanager */
- for(wm= newmain->wm.first; wm; wm= wm->id.next) {
- for(win= wm->windows.first; win; win= win->next) {
+ for (wm= newmain->wm.first; wm; wm= wm->id.next) {
+ for (win= wm->windows.first; win; win= win->next) {
win->screen= restore_pointer_by_name(newmain, (ID *)win->screen, 1);
- if(win->screen==NULL)
+ if (win->screen==NULL)
win->screen= curscreen;
win->screen->winid= win->winid;
@@ -5434,49 +5460,49 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
}
- for(sc= newmain->screen.first; sc; sc= sc->id.next) {
+ for (sc= newmain->screen.first; sc; sc= sc->id.next) {
Scene *oldscene= sc->scene;
sc->scene= restore_pointer_by_name(newmain, (ID *)sc->scene, 1);
- if(sc->scene==NULL)
+ if (sc->scene==NULL)
sc->scene= curscene;
/* keep cursor location through undo */
copy_v3_v3(sc->scene->cursor, oldscene->cursor);
sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_VIEW3D) {
+ if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D*) sl;
BGpic *bgpic;
ARegion *ar;
- if(v3d->scenelock)
+ if (v3d->scenelock)
v3d->camera= NULL; /* always get from scene */
else
v3d->camera= restore_pointer_by_name(newmain, (ID *)v3d->camera, 1);
- if(v3d->camera==NULL)
+ if (v3d->camera==NULL)
v3d->camera= sc->scene->camera;
v3d->ob_centre= restore_pointer_by_name(newmain, (ID *)v3d->ob_centre, 1);
- for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) {
+ for (bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) {
bgpic->ima= restore_pointer_by_name(newmain, (ID *)bgpic->ima, 1);
bgpic->clip= restore_pointer_by_name(newmain, (ID *)bgpic->clip, 1);
}
- if(v3d->localvd) {
+ if (v3d->localvd) {
/*Base *base;*/
v3d->localvd->camera= sc->scene->camera;
/* localview can become invalid during undo/redo steps, so we exit it when no could be found */
/* XXX regionlocalview ?
- for(base= sc->scene->base.first; base; base= base->next) {
- if(base->lay & v3d->lay) break;
+ for (base= sc->scene->base.first; base; base= base->next) {
+ if (base->lay & v3d->lay) break;
}
- if(base==NULL) {
+ if (base==NULL) {
v3d->lay= v3d->localvd->lay;
v3d->layact= v3d->localvd->layact;
MEM_freeN(v3d->localvd);
@@ -5484,22 +5510,22 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
}
*/
}
- else if(v3d->scenelock) v3d->lay= sc->scene->lay;
+ else if (v3d->scenelock) v3d->lay= sc->scene->lay;
/* not very nice, but could help */
- if((v3d->layact & v3d->lay)==0) v3d->layact= v3d->lay;
+ if ((v3d->layact & v3d->lay)==0) v3d->layact= v3d->lay;
/* free render engines for now */
- 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;
}
}
}
- else if(sl->spacetype==SPACE_IPO) {
+ else if (sl->spacetype==SPACE_IPO) {
SpaceIpo *sipo= (SpaceIpo *)sl;
bDopeSheet *ads= sipo->ads;
@@ -5510,17 +5536,17 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
ads->filter_grp= restore_pointer_by_name(newmain, (ID *)ads->filter_grp, 0);
}
}
- else if(sl->spacetype==SPACE_BUTS) {
+ else if (sl->spacetype==SPACE_BUTS) {
SpaceButs *sbuts= (SpaceButs *)sl;
sbuts->pinid = restore_pointer_by_name(newmain, sbuts->pinid, 0);
//XXX if (sbuts->ri) sbuts->ri->curtile = 0;
}
- else if(sl->spacetype==SPACE_FILE) {
+ else if (sl->spacetype==SPACE_FILE) {
SpaceFile *sfile= (SpaceFile *)sl;
sfile->op= NULL;
}
- else if(sl->spacetype==SPACE_ACTION) {
+ else if (sl->spacetype==SPACE_ACTION) {
SpaceAction *saction= (SpaceAction *)sl;
saction->action = restore_pointer_by_name(newmain, (ID *)saction->action, 1);
@@ -5529,11 +5555,15 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
if (saction->ads.filter_grp)
saction->ads.filter_grp= restore_pointer_by_name(newmain, (ID *)saction->ads.filter_grp, 0);
}
- else if(sl->spacetype==SPACE_IMAGE) {
+ else if (sl->spacetype==SPACE_IMAGE) {
SpaceImage *sima= (SpaceImage *)sl;
sima->image= restore_pointer_by_name(newmain, (ID *)sima->image, 1);
+ /* this will be freed, not worth attempting to find same scene,
+ * since it gets initialized later */
+ sima->iuser.scene = NULL;
+
sima->scopes.waveform_1 = NULL;
sima->scopes.waveform_2 = NULL;
sima->scopes.waveform_3 = NULL;
@@ -5545,7 +5575,7 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
*/
sima->gpd= restore_pointer_by_name(newmain, (ID *)sima->gpd, 1);
}
- else if(sl->spacetype==SPACE_NLA){
+ else if (sl->spacetype==SPACE_NLA) {
SpaceNla *snla= (SpaceNla *)sl;
bDopeSheet *ads= snla->ads;
@@ -5556,37 +5586,37 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
ads->filter_grp= restore_pointer_by_name(newmain, (ID *)ads->filter_grp, 0);
}
}
- else if(sl->spacetype==SPACE_TEXT) {
+ else if (sl->spacetype==SPACE_TEXT) {
SpaceText *st= (SpaceText *)sl;
st->text= restore_pointer_by_name(newmain, (ID *)st->text, 1);
- if(st->text==NULL) st->text= newmain->text.first;
+ if (st->text==NULL) st->text= newmain->text.first;
}
- else if(sl->spacetype==SPACE_SCRIPT) {
+ else if (sl->spacetype==SPACE_SCRIPT) {
SpaceScript *scpt= (SpaceScript *)sl;
scpt->script= restore_pointer_by_name(newmain, (ID *)scpt->script, 1);
/*sc->script = NULL; - 2.45 set to null, better re-run the script */
if (scpt->script) {
- SCRIPT_SET_NULL(scpt->script)
+ SCRIPT_SET_NULL(scpt->script);
}
}
- else if(sl->spacetype==SPACE_OUTLINER) {
+ else if (sl->spacetype==SPACE_OUTLINER) {
SpaceOops *so= (SpaceOops *)sl;
int a;
so->search_tse.id= restore_pointer_by_name(newmain, so->search_tse.id, 0);
- if(so->treestore) {
+ if (so->treestore) {
TreeStore *ts= so->treestore;
TreeStoreElem *tselem=ts->data;
- for(a=0; a<ts->usedelem; a++, tselem++) {
+ for (a=0; a<ts->usedelem; a++, tselem++) {
tselem->id= restore_pointer_by_name(newmain, tselem->id, 0);
}
}
}
- else if(sl->spacetype==SPACE_NODE) {
+ else if (sl->spacetype==SPACE_NODE) {
SpaceNode *snode= (SpaceNode *)sl;
snode->id= restore_pointer_by_name(newmain, snode->id, 1);
@@ -5594,12 +5624,12 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
if (ELEM3(snode->treetype, NTREE_COMPOSIT, NTREE_SHADER, NTREE_TEXTURE)) {
snode->nodetree= NULL;
- if(snode->id) {
- if(GS(snode->id->name)==ID_MA)
+ if (snode->id) {
+ if (GS(snode->id->name)==ID_MA)
snode->nodetree= ((Material *)snode->id)->nodetree;
- else if(GS(snode->id->name)==ID_SCE)
+ else if (GS(snode->id->name)==ID_SCE)
snode->nodetree= ((Scene *)snode->id)->nodetree;
- else if(GS(snode->id->name)==ID_TE)
+ else if (GS(snode->id->name)==ID_TE)
snode->nodetree= ((Tex *)snode->id)->nodetree;
}
}
@@ -5607,7 +5637,7 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
snode->nodetree= restore_pointer_by_name(newmain, &snode->nodetree->id, 1);
}
}
- else if(sl->spacetype==SPACE_CLIP) {
+ else if (sl->spacetype==SPACE_CLIP) {
SpaceClip *sclip= (SpaceClip *)sl;
sclip->clip= restore_pointer_by_name(newmain, (ID *)sclip->clip, 1);
@@ -5629,7 +5659,7 @@ static void direct_link_region(FileData *fd, ARegion *ar, int spacetype)
link_list(fd, &(ar->panels));
- for(pa= ar->panels.first; pa; pa=pa->next) {
+ for (pa= ar->panels.first; pa; pa=pa->next) {
pa->paneltab= newdataadr(fd, pa->paneltab);
pa->runtime_flag= 0;
pa->activedata= NULL;
@@ -5637,8 +5667,8 @@ static void direct_link_region(FileData *fd, ARegion *ar, int spacetype)
}
ar->regiondata= newdataadr(fd, ar->regiondata);
- if(ar->regiondata) {
- if(spacetype==SPACE_VIEW3D) {
+ if (ar->regiondata) {
+ if (spacetype==SPACE_VIEW3D) {
RegionView3D *rv3d= ar->regiondata;
rv3d->localvd= newdataadr(fd, rv3d->localvd);
@@ -5671,8 +5701,8 @@ static void view3d_split_250(View3D *v3d, ListBase *regions)
{
ARegion *ar;
- for(ar= regions->first; ar; ar= ar->next) {
- if(ar->regiontype==RGN_TYPE_WINDOW && ar->regiondata==NULL) {
+ for (ar= regions->first; ar; ar= ar->next) {
+ if (ar->regiontype==RGN_TYPE_WINDOW && ar->regiondata==NULL) {
RegionView3D *rv3d;
rv3d= ar->regiondata= MEM_callocN(sizeof(RegionView3D), "region v3d patch");
@@ -5685,7 +5715,7 @@ static void view3d_split_250(View3D *v3d, ListBase *regions)
}
/* this was not initialized correct always */
- if(v3d->twtype == 0)
+ if (v3d->twtype == 0)
v3d->twtype= V3D_MANIP_TRANSLATE;
}
@@ -5707,31 +5737,31 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
/* hacky patch... but people have been saving files with the verse-blender,
causing the handler to keep running for ever, with no means to disable it */
- for(a=0; a<SCREEN_MAXHANDLER; a+=2) {
- if( sc->handler[a]==SCREEN_HANDLER_VERSE) {
+ for (a=0; a<SCREEN_MAXHANDLER; a+=2) {
+ if ( sc->handler[a]==SCREEN_HANDLER_VERSE) {
sc->handler[a]= 0;
break;
}
}
/* edges */
- for(se= sc->edgebase.first; se; se= se->next) {
+ for (se= sc->edgebase.first; se; se= se->next) {
se->v1= newdataadr(fd, se->v1);
se->v2= newdataadr(fd, se->v2);
- if( (intptr_t)se->v1 > (intptr_t)se->v2) {
+ if ( (intptr_t)se->v1 > (intptr_t)se->v2) {
sv= se->v1;
se->v1= se->v2;
se->v2= sv;
}
- if(se->v1==NULL) {
+ if (se->v1==NULL) {
printf("error reading screen... file corrupt\n");
se->v1= se->v2;
}
}
/* areas */
- for(sa= sc->areabase.first; sa; sa= sa->next) {
+ for (sa= sc->areabase.first; sa; sa= sa->next) {
SpaceLink *sl;
ARegion *ar;
@@ -5741,24 +5771,24 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
sa->handlers.first= sa->handlers.last= NULL;
sa->type= NULL; /* spacetype callbacks */
- for(ar= sa->regionbase.first; ar; ar= ar->next)
+ for (ar= sa->regionbase.first; ar; ar= ar->next)
direct_link_region(fd, ar, sa->spacetype);
/* accident can happen when read/save new file with older version */
/* 2.50: we now always add spacedata for info */
- if(sa->spacedata.first==NULL) {
+ if (sa->spacedata.first==NULL) {
SpaceInfo *sinfo= MEM_callocN(sizeof(SpaceInfo), "spaceinfo");
sa->spacetype= sinfo->spacetype= SPACE_INFO;
BLI_addtail(&sa->spacedata, sinfo);
}
/* add local view3d too */
- else if(sa->spacetype==SPACE_VIEW3D)
+ else if (sa->spacetype==SPACE_VIEW3D)
view3d_split_250(sa->spacedata.first, &sa->regionbase);
for (sl= sa->spacedata.first; sl; sl= sl->next) {
link_list(fd, &(sl->regionbase));
- for(ar= sl->regionbase.first; ar; ar= ar->next)
+ for (ar= sl->regionbase.first; ar; ar= ar->next)
direct_link_region(fd, ar, sl->spacetype);
if (sl->spacetype==SPACE_VIEW3D) {
@@ -5770,16 +5800,16 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
link_list(fd, &(v3d->bgpicbase));
/* should be do_versions except this doesnt fit well there */
- if(v3d->bgpic) {
+ if (v3d->bgpic) {
bgpic= newdataadr(fd, v3d->bgpic);
BLI_addtail(&v3d->bgpicbase, bgpic);
v3d->bgpic= NULL;
}
- for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next)
+ for (bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next)
bgpic->iuser.ok= 1;
- if(v3d->gpd) {
+ if (v3d->gpd) {
v3d->gpd= newdataadr(fd, v3d->gpd);
direct_link_gpencil(fd, v3d->gpd);
}
@@ -5790,7 +5820,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
v3d->properties_storage= NULL;
/* render can be quite heavy, set to wire on load */
- if(v3d->drawtype == OB_RENDER)
+ if (v3d->drawtype == OB_RENDER)
v3d->drawtype = OB_WIRE;
view3d_split_250(v3d, &sl->regionbase);
@@ -5810,18 +5840,18 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
SpaceOops *soops= (SpaceOops*) sl;
soops->treestore= newdataadr(fd, soops->treestore);
- if(soops->treestore) {
+ if (soops->treestore) {
soops->treestore->data= newdataadr(fd, soops->treestore->data);
/* we only saved what was used */
soops->treestore->totelem= soops->treestore->usedelem;
soops->storeflag |= SO_TREESTORE_CLEANUP; // at first draw
}
}
- else if(sl->spacetype==SPACE_IMAGE) {
+ else if (sl->spacetype==SPACE_IMAGE) {
SpaceImage *sima= (SpaceImage *)sl;
sima->cumap= newdataadr(fd, sima->cumap);
- if(sima->cumap)
+ if (sima->cumap)
direct_link_curvemapping(fd, sima->cumap);
sima->iuser.scene= NULL;
@@ -5841,52 +5871,52 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
direct_link_gpencil(fd, sima->gpd);
#endif
}
- else if(sl->spacetype==SPACE_NODE) {
+ else if (sl->spacetype==SPACE_NODE) {
SpaceNode *snode= (SpaceNode *)sl;
- if(snode->gpd) {
+ if (snode->gpd) {
snode->gpd= newdataadr(fd, snode->gpd);
direct_link_gpencil(fd, snode->gpd);
}
}
- else if(sl->spacetype==SPACE_TIME) {
+ else if (sl->spacetype==SPACE_TIME) {
SpaceTime *stime= (SpaceTime *)sl;
stime->caches.first= stime->caches.last= NULL;
}
- else if(sl->spacetype==SPACE_LOGIC) {
+ else if (sl->spacetype==SPACE_LOGIC) {
SpaceLogic *slogic= (SpaceLogic *)sl;
- if(slogic->gpd) {
+ if (slogic->gpd) {
slogic->gpd= newdataadr(fd, slogic->gpd);
direct_link_gpencil(fd, slogic->gpd);
}
}
- else if(sl->spacetype==SPACE_SEQ) {
+ else if (sl->spacetype==SPACE_SEQ) {
SpaceSeq *sseq= (SpaceSeq *)sl;
- if(sseq->gpd) {
+ if (sseq->gpd) {
sseq->gpd= newdataadr(fd, sseq->gpd);
direct_link_gpencil(fd, sseq->gpd);
}
}
- else if(sl->spacetype==SPACE_BUTS) {
+ else if (sl->spacetype==SPACE_BUTS) {
SpaceButs *sbuts= (SpaceButs *)sl;
sbuts->path= NULL;
sbuts->texuser= NULL;
}
- else if(sl->spacetype==SPACE_CONSOLE) {
+ else if (sl->spacetype==SPACE_CONSOLE) {
SpaceConsole *sconsole= (SpaceConsole *)sl;
ConsoleLine *cl, *cl_next;
link_list(fd, &sconsole->scrollback);
link_list(fd, &sconsole->history);
- //for(cl= sconsole->scrollback.first; cl; cl= cl->next)
+ //for (cl= sconsole->scrollback.first; cl; cl= cl->next)
// cl->line= newdataadr(fd, cl->line);
/*comma expressions, (e.g. expr1, expr2, expr3) evalutate each expression,
from left to right. the right-most expression sets the result of the comma
expression as a whole*/
- for(cl= sconsole->history.first; cl; cl= cl_next) {
+ for (cl= sconsole->history.first; cl; cl= cl_next) {
cl_next= cl->next;
cl->line= newdataadr(fd, cl->line);
if (cl->line) {
@@ -5899,7 +5929,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
}
}
}
- else if(sl->spacetype==SPACE_FILE) {
+ else if (sl->spacetype==SPACE_FILE) {
SpaceFile *sfile= (SpaceFile *)sl;
/* this sort of info is probably irrelevant for reloading...
@@ -5929,9 +5959,9 @@ static void direct_link_library(FileData *fd, Library *lib, Main *main)
{
Main *newmain;
- for(newmain= fd->mainlist.first; newmain; newmain= newmain->next) {
- if(newmain->curlib) {
- if(BLI_path_cmp(newmain->curlib->filepath, lib->filepath) == 0) {
+ for (newmain= fd->mainlist.first; newmain; newmain= newmain->next) {
+ if (newmain->curlib) {
+ if (BLI_path_cmp(newmain->curlib->filepath, lib->filepath) == 0) {
BKE_reportf_wrap(fd->reports, RPT_WARNING,
"Library '%s', '%s' had multiple instances, save and reload!",
lib->name, lib->filepath);
@@ -5965,7 +5995,7 @@ static void direct_link_library(FileData *fd, Library *lib, Main *main)
static void lib_link_library(FileData *UNUSED(fd), Main *main)
{
Library *lib;
- for(lib= main->library.first; lib; lib= lib->id.next) {
+ for (lib= main->library.first; lib; lib= lib->id.next) {
lib->id.us= 1;
}
}
@@ -5976,7 +6006,7 @@ static void fix_relpaths_library(const char *basepath, Main *main)
Library *lib;
/* BLO_read_from_memory uses a blank filename */
if (basepath==NULL || basepath[0] == '\0') {
- for(lib= main->library.first; lib; lib= lib->id.next) {
+ for (lib= main->library.first; lib; lib= lib->id.next) {
/* when loading a linked lib into a file which has not been saved,
* there is nothing we can be relative to, so instead we need to make
* it absolute. This can happen when appending an object with a relative
@@ -5988,7 +6018,7 @@ static void fix_relpaths_library(const char *basepath, Main *main)
}
}
else {
- for(lib= main->library.first; lib; lib= lib->id.next) {
+ for (lib= main->library.first; lib; lib= lib->id.next) {
/* Libraries store both relative and abs paths, recreate relative paths,
* relative to the blend file since indirectly linked libs will be relative to their direct linked library */
if (strncmp(lib->name, "//", 2)==0) { /* if this is relative to begin with? */
@@ -6006,8 +6036,8 @@ static void lib_link_speaker(FileData *fd, Main *main)
Speaker *spk;
spk= main->speaker.first;
- while(spk) {
- if(spk->id.flag & LIB_NEEDLINK) {
+ while (spk) {
+ if (spk->id.flag & LIB_NEEDLINK) {
if (spk->adt) lib_link_animdata(fd, &spk->id, spk->adt);
spk->sound= newlibadr(fd, spk->id.lib, spk->sound);
@@ -6039,7 +6069,7 @@ static void direct_link_sound(FileData *fd, bSound *sound)
sound->waveform = NULL;
// versioning stuff, if there was a cache, then we enable caching:
- if(sound->cache)
+ if (sound->cache)
{
sound->flags |= SOUND_FLAGS_CACHING;
sound->cache = NULL;
@@ -6054,8 +6084,8 @@ static void lib_link_sound(FileData *fd, Main *main)
bSound *sound;
sound= main->sound.first;
- while(sound) {
- if(sound->id.flag & LIB_NEEDLINK) {
+ while (sound) {
+ if (sound->id.flag & LIB_NEEDLINK) {
sound->id.flag -= LIB_NEEDLINK;
sound->ipo= newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX depreceated - old animation system
@@ -6077,25 +6107,25 @@ static void lib_link_group(FileData *fd, Main *main)
GroupObject *go;
int add_us;
- while(group) {
- if(group->id.flag & LIB_NEEDLINK) {
+ while (group) {
+ if (group->id.flag & LIB_NEEDLINK) {
group->id.flag -= LIB_NEEDLINK;
add_us= 0;
go= group->gobject.first;
- while(go) {
+ while (go) {
go->ob= newlibadr(fd, group->id.lib, go->ob);
- if(go->ob) {
+ if (go->ob) {
go->ob->flag |= OB_FROMGROUP;
/* if group has an object, it increments user... */
add_us= 1;
- if(go->ob->id.us==0)
+ if (go->ob->id.us==0)
go->ob->id.us= 1;
}
go= go->next;
}
- if(add_us) group->id.us++;
+ if (add_us) group->id.us++;
rem_from_group(group, NULL, NULL, NULL); /* removes NULL entries */
}
group= group->id.next;
@@ -6116,7 +6146,7 @@ static void direct_link_movieTracks(FileData *fd, ListBase *tracksbase)
link_list(fd, tracksbase);
track= tracksbase->first;
- while(track) {
+ while (track) {
track->markers= newdataadr(fd, track->markers);
track= track->next;
@@ -6130,10 +6160,10 @@ static void direct_link_movieclip(FileData *fd, MovieClip *clip)
clip->adt= newdataadr(fd, clip->adt);
- if(fd->movieclipmap) clip->cache= newmclipadr(fd, clip->cache);
+ if (fd->movieclipmap) clip->cache= newmclipadr(fd, clip->cache);
else clip->cache= NULL;
- if(fd->movieclipmap) clip->tracking.camera.intrinsics= newmclipadr(fd, clip->tracking.camera.intrinsics);
+ if (fd->movieclipmap) clip->tracking.camera.intrinsics= newmclipadr(fd, clip->tracking.camera.intrinsics);
else clip->tracking.camera.intrinsics= NULL;
direct_link_movieTracks(fd, &tracking->tracks);
@@ -6152,7 +6182,7 @@ static void direct_link_movieclip(FileData *fd, MovieClip *clip)
link_list(fd, &tracking->objects);
object= tracking->objects.first;
- while(object) {
+ while (object) {
direct_link_movieTracks(fd, &object->tracks);
direct_link_movieReconstruction(fd, &object->reconstruction);
@@ -6165,8 +6195,8 @@ static void lib_link_movieclip(FileData *fd, Main *main)
MovieClip *clip;
clip= main->movieclip.first;
- while(clip) {
- if(clip->id.flag & LIB_NEEDLINK) {
+ while (clip) {
+ if (clip->id.flag & LIB_NEEDLINK) {
if (clip->adt)
lib_link_animdata(fd, &clip->id, clip->adt);
@@ -6222,7 +6252,7 @@ static BHead *read_data_into_oldnewmap(FileData *fd, BHead *bhead, const char *a
{
bhead = blo_nextbhead(fd, bhead);
- while(bhead && bhead->code==DATA) {
+ while (bhead && bhead->code==DATA) {
void *data;
#if 0
/* XXX DUMB DEBUGGING OPTION TO GIVE NAMES for guarded malloc errors */
@@ -6265,7 +6295,7 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID
oldnewmap_insert(fd->libmap, bhead->old, id, bhead->code); /* for ID_ID check */
/* do after read_struct, for dna reconstruct */
- if(bhead->code==ID_ID) {
+ if (bhead->code==ID_ID) {
lb= which_libbase(main, GS(id->name));
}
else {
@@ -6277,13 +6307,13 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID
/* clear first 8 bits */
id->flag= (id->flag & 0xFF00) | flag | LIB_NEEDLINK;
id->lib= main->curlib;
- if(id->flag & LIB_FAKEUSER) id->us= 1;
+ if (id->flag & LIB_FAKEUSER) id->us= 1;
else id->us= 0;
id->icon_id = 0;
id->flag &= ~(LIB_ID_RECALC|LIB_ID_RECALC_DATA);
/* this case cannot be direct_linked: it's just the ID part */
- if(bhead->code==ID_ID) {
+ if (bhead->code==ID_ID) {
return blo_nextbhead(fd, bhead);
}
@@ -6419,7 +6449,7 @@ static BHead *read_global(BlendFileData *bfd, FileData *fd, BHead *bhead)
bfd->globalf= fg->globalf;
BLI_strncpy(bfd->filename, fg->filename, sizeof(bfd->filename));
- if(G.fileflags & G_FILE_RECOVER)
+ if (G.fileflags & G_FILE_RECOVER)
BLI_strncpy(fd->relabase, fg->filename, sizeof(fd->relabase));
bfd->curscreen= fg->curscreen;
@@ -6440,8 +6470,8 @@ static void link_global(FileData *fd, BlendFileData *bfd)
bfd->curscreen= newlibadr(fd, NULL, bfd->curscreen);
bfd->curscene= newlibadr(fd, NULL, bfd->curscene);
// this happens in files older than 2.35
- if(bfd->curscene==NULL) {
- if(bfd->curscreen) bfd->curscene= bfd->curscreen->scene;
+ if (bfd->curscene==NULL) {
+ if (bfd->curscreen) bfd->curscene= bfd->curscreen->scene;
}
}
@@ -6451,12 +6481,12 @@ static void vcol_to_fcol(Mesh *me)
unsigned int *mcol, *mcoln, *mcolmain;
int a;
- if(me->totface==0 || me->mcol==NULL) return;
+ if (me->totface==0 || me->mcol==NULL) return;
mcoln= mcolmain= MEM_mallocN(4*sizeof(int)*me->totface, "mcoln");
mcol = (unsigned int *)me->mcol;
mface= me->mface;
- for(a=me->totface; a>0; a--, mface++) {
+ for (a=me->totface; a>0; a--, mface++) {
mcoln[0]= mcol[mface->v1];
mcoln[1]= mcol[mface->v2];
mcoln[2]= mcol[mface->v3];
@@ -6500,7 +6530,7 @@ static void do_version_bone_head_tail_237(Bone *bone)
mul_v3_fl(vec, bone->length);
add_v3_v3v3(bone->arm_tail, bone->arm_head, vec);
- for(child= bone->childbase.first; child; child= child->next)
+ for (child= bone->childbase.first; child; child= child->next)
do_version_bone_head_tail_237(child);
}
@@ -6508,13 +6538,13 @@ static void bone_version_238(ListBase *lb)
{
Bone *bone;
- for(bone= lb->first; bone; bone= bone->next) {
- if(bone->rad_tail==0.0f && bone->rad_head==0.0f) {
+ for (bone= lb->first; bone; bone= bone->next) {
+ if (bone->rad_tail==0.0f && bone->rad_head==0.0f) {
bone->rad_head= 0.25f*bone->length;
bone->rad_tail= 0.1f*bone->length;
bone->dist-= bone->rad_head;
- if(bone->dist<=0.0f) bone->dist= 0.0f;
+ if (bone->dist<=0.0f) bone->dist= 0.0f;
}
bone_version_238(&bone->childbase);
}
@@ -6524,8 +6554,8 @@ static void bone_version_239(ListBase *lb)
{
Bone *bone;
- for(bone= lb->first; bone; bone= bone->next) {
- if(bone->layer==0)
+ for (bone= lb->first; bone; bone= bone->next) {
+ if (bone->layer==0)
bone->layer= 1;
bone_version_239(&bone->childbase);
}
@@ -6535,10 +6565,10 @@ static void ntree_version_241(bNodeTree *ntree)
{
bNode *node;
- if(ntree->type==NTREE_COMPOSIT) {
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_BLUR) {
- if(node->storage==NULL) {
+ if (ntree->type==NTREE_COMPOSIT) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->type==CMP_NODE_BLUR) {
+ if (node->storage==NULL) {
NodeBlurData *nbd= MEM_callocN(sizeof(NodeBlurData), "node blur patch");
nbd->sizex= node->custom1;
nbd->sizey= node->custom2;
@@ -6546,8 +6576,8 @@ static void ntree_version_241(bNodeTree *ntree)
node->storage= nbd;
}
}
- else if(node->type==CMP_NODE_VECBLUR) {
- if(node->storage==NULL) {
+ else if (node->type==CMP_NODE_VECBLUR) {
+ if (node->storage==NULL) {
NodeBlurData *nbd= MEM_callocN(sizeof(NodeBlurData), "node blur patch");
nbd->samples= node->custom1;
nbd->maxspeed= node->custom2;
@@ -6563,19 +6593,19 @@ static void ntree_version_242(bNodeTree *ntree)
{
bNode *node;
- if(ntree->type==NTREE_COMPOSIT) {
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_HUE_SAT) {
- if(node->storage) {
+ if (ntree->type==NTREE_COMPOSIT) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->type==CMP_NODE_HUE_SAT) {
+ if (node->storage) {
NodeHueSat *nhs= node->storage;
- if(nhs->val==0.0f) nhs->val= 1.0f;
+ if (nhs->val==0.0f) nhs->val= 1.0f;
}
}
}
}
- else if(ntree->type==NTREE_SHADER) {
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->type == SH_NODE_GEOMETRY && node->storage == NULL)
+ else if (ntree->type==NTREE_SHADER) {
+ for (node= ntree->nodes.first; node; node= node->next)
+ if (node->type == SH_NODE_GEOMETRY && node->storage == NULL)
node->storage= MEM_callocN(sizeof(NodeGeometry), "NodeGeometry");
}
@@ -6589,11 +6619,11 @@ static void sort_shape_fix(Main *main)
KeyBlock *kb;
int sorted= 0;
- while(sorted==0) {
+ while (sorted==0) {
sorted= 1;
- for(key= main->key.first; key; key= key->id.next) {
- for(kb= key->block.first; kb; kb= kb->next) {
- if(kb->next && kb->adrcode>kb->next->adrcode) {
+ for (key= main->key.first; key; key= key->id.next) {
+ for (kb= key->block.first; kb; kb= kb->next) {
+ if (kb->next && kb->adrcode>kb->next->adrcode) {
KeyBlock *next= kb->next;
BLI_remlink(&key->block, kb);
BLI_insertlink(&key->block, next, kb);
@@ -6602,7 +6632,7 @@ static void sort_shape_fix(Main *main)
}
}
}
- if(sorted==0) printf("warning, shape keys were sorted incorrect, fixed it!\n");
+ if (sorted==0) printf("warning, shape keys were sorted incorrect, fixed it!\n");
}
}
@@ -6704,11 +6734,11 @@ static void do_version_ntree_242_2(bNodeTree *ntree)
{
bNode *node;
- if(ntree->type==NTREE_COMPOSIT) {
- for(node= ntree->nodes.first; node; node= node->next) {
- if(ELEM3(node->type, CMP_NODE_IMAGE, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
+ if (ntree->type==NTREE_COMPOSIT) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (ELEM3(node->type, CMP_NODE_IMAGE, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
/* only image had storage */
- if(node->storage) {
+ if (node->storage) {
NodeImageAnim *nia= node->storage;
ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "ima user node");
@@ -6741,27 +6771,27 @@ static void ntree_version_245(FileData *fd, Library *lib, bNodeTree *ntree)
Image *image;
ImageUser *iuser;
- if(ntree->type==NTREE_COMPOSIT) {
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type == CMP_NODE_ALPHAOVER) {
- if(!node->storage) {
+ if (ntree->type==NTREE_COMPOSIT) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->type == CMP_NODE_ALPHAOVER) {
+ if (!node->storage) {
ntf= MEM_callocN(sizeof(NodeTwoFloats), "NodeTwoFloats");
node->storage= ntf;
- if(node->custom1)
+ if (node->custom1)
ntf->x= 1.0f;
}
}
/* fix for temporary flag changes during 245 cycle */
nodeid= newlibadr(fd, lib, node->id);
- if(node->storage && nodeid && GS(nodeid->name) == ID_IM) {
+ if (node->storage && nodeid && GS(nodeid->name) == ID_IM) {
image= (Image*)nodeid;
iuser= node->storage;
- if(iuser->flag & IMA_OLD_PREMUL) {
+ if (iuser->flag & IMA_OLD_PREMUL) {
iuser->flag &= ~IMA_OLD_PREMUL;
iuser->flag |= IMA_DO_PREMUL;
}
- if(iuser->flag & IMA_DO_PREMUL) {
+ if (iuser->flag & IMA_DO_PREMUL) {
image->flag &= ~IMA_OLD_PREMUL;
image->flag |= IMA_DO_PREMUL;
}
@@ -6804,27 +6834,27 @@ static void alphasort_version_246(FileData *fd, Library *lib, Mesh *me)
int a, b, texalpha;
/* verify we have a tface layer */
- for(b=0; b<me->fdata.totlayer; b++)
- if(me->fdata.layers[b].type == CD_MTFACE)
+ for (b=0; b<me->fdata.totlayer; b++)
+ if (me->fdata.layers[b].type == CD_MTFACE)
break;
- if(b == me->fdata.totlayer)
+ if (b == me->fdata.totlayer)
return;
/* if we do, set alpha sort if the game engine did it before */
- for(a=0, mf=me->mface; a<me->totface; a++, mf++) {
- if(mf->mat_nr < me->totcol) {
+ for (a=0, mf=me->mface; a<me->totface; a++, mf++) {
+ if (mf->mat_nr < me->totcol) {
ma= newlibadr(fd, lib, me->mat[mf->mat_nr]);
texalpha = 0;
/* we can't read from this if it comes from a library,
* because direct_link might not have happened on it,
* so ma->mtex is not pointing to valid memory yet */
- if(ma && ma->id.lib)
+ if (ma && ma->id.lib)
ma= NULL;
- for(b=0; ma && b<MAX_MTEX; b++)
- if(ma->mtex && ma->mtex[b] && ma->mtex[b]->mapto & MAP_ALPHA)
+ for (b=0; ma && b<MAX_MTEX; b++)
+ if (ma->mtex && ma->mtex[b] && ma->mtex[b]->mapto & MAP_ALPHA)
texalpha = 1;
}
else {
@@ -6832,13 +6862,13 @@ static void alphasort_version_246(FileData *fd, Library *lib, Mesh *me)
texalpha = 0;
}
- for(b=0; b<me->fdata.totlayer; b++) {
- if(me->fdata.layers[b].type == CD_MTFACE) {
+ for (b=0; b<me->fdata.totlayer; b++) {
+ if (me->fdata.layers[b].type == CD_MTFACE) {
tf = ((MTFace*)me->fdata.layers[b].data) + a;
tf->mode &= ~TF_ALPHASORT;
- if(ma && (ma->mode & MA_ZTRANSP))
- if(ELEM(tf->transp, TF_ALPHA, TF_ADD) || (texalpha && (tf->transp != TF_CLIP)))
+ if (ma && (ma->mode & MA_ZTRANSP))
+ if (ELEM(tf->transp, TF_ALPHA, TF_ADD) || (texalpha && (tf->transp != TF_CLIP)))
tf->mode |= TF_ALPHASORT;
}
}
@@ -6852,12 +6882,12 @@ static void area_add_header_region(ScrArea *sa, ListBase *lb)
BLI_addtail(lb, ar);
ar->regiontype= RGN_TYPE_HEADER;
- if(sa->headertype==HEADERDOWN)
+ if (sa->headertype==HEADERDOWN)
ar->alignment= RGN_ALIGN_BOTTOM;
else
ar->alignment= RGN_ALIGN_TOP;
- /* initialise view2d data for header region, to allow panning */
+ /* initialize view2d data for header region, to allow panning */
/* is copy from ui_view2d.c */
ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT);
ar->v2d.keepofs = V2D_LOCKOFS_Y;
@@ -6876,10 +6906,10 @@ static void sequencer_init_preview_region(ARegion* ar)
ar->v2d.keepzoom= V2D_KEEPASPECT | V2D_KEEPZOOM;
ar->v2d.minzoom= 0.00001f;
ar->v2d.maxzoom= 100000.0f;
- ar->v2d.tot.xmin= -960.0f; /* 1920 width centered */
- ar->v2d.tot.ymin= -540.0f; /* 1080 height centered */
- ar->v2d.tot.xmax= 960.0f;
- ar->v2d.tot.ymax= 540.0f;
+ ar->v2d.tot.xmin = -960.0f; /* 1920 width centered */
+ ar->v2d.tot.ymin = -540.0f; /* 1080 height centered */
+ ar->v2d.tot.xmax = 960.0f;
+ ar->v2d.tot.ymax = 540.0f;
ar->v2d.min[0]= 0.0f;
ar->v2d.min[1]= 0.0f;
ar->v2d.max[0]= 12000.0f;
@@ -6895,7 +6925,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
ARegion *ar;
ARegion *ar_main;
- if(sl) {
+ if (sl) {
/* first channels for ipo action nla... */
switch(sl->spacetype) {
case SPACE_IPO:
@@ -7016,7 +7046,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
ar->regiontype= RGN_TYPE_WINDOW;
- if(sl) {
+ if (sl) {
/* if active spacetype has view2d data, copy that over to main region */
/* and we split view3d */
switch(sl->spacetype) {
@@ -7048,7 +7078,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
ar->v2d.align |= V2D_ALIGN_NO_NEG_Y;
ar->v2d.keepofs |= V2D_LOCKOFS_Y;
ar->v2d.keepzoom |= V2D_LOCKZOOM_Y;
- ar->v2d.tot.ymin= ar->v2d.cur.ymin= -10.0;
+ ar->v2d.tot.ymin = ar->v2d.cur.ymin = -10.0;
ar->v2d.min[1]= ar->v2d.max[1]= 20.0;
}
break;
@@ -7075,8 +7105,8 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
SpaceNla *snla= (SpaceNla *)sl;
memcpy(&ar->v2d, &snla->v2d, sizeof(View2D));
- ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f;
- ar->v2d.tot.ymax= 0.0f;
+ ar->v2d.tot.ymin = (float)(-sa->winy)/3.0f;
+ ar->v2d.tot.ymax = 0.0f;
ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
@@ -7089,10 +7119,10 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
SpaceAction *saction= (SpaceAction *)sl;
/* we totally reinit the view for the Action Editor, as some old instances had some weird cruft set */
- ar->v2d.tot.xmin= -20.0f;
- ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f;
- ar->v2d.tot.xmax= (float)((sa->winx > 120)? (sa->winx) : 120);
- ar->v2d.tot.ymax= 0.0f;
+ ar->v2d.tot.xmin = -20.0f;
+ ar->v2d.tot.ymin = (float)(-sa->winy)/3.0f;
+ ar->v2d.tot.xmax = (float)((sa->winx > 120)? (sa->winx) : 120);
+ ar->v2d.tot.ymax = 0.0f;
ar->v2d.cur= ar->v2d.tot;
@@ -7177,23 +7207,23 @@ static void do_versions_windowmanager_2_50(bScreen *screen)
SpaceLink *sl;
/* add regions */
- for(sa= screen->areabase.first; sa; sa= sa->next) {
+ for (sa= screen->areabase.first; sa; sa= sa->next) {
/* we keep headertype variable to convert old files only */
- if(sa->headertype)
+ if (sa->headertype)
area_add_header_region(sa, &sa->regionbase);
area_add_window_regions(sa, sa->spacedata.first, &sa->regionbase);
/* space imageselect is deprecated */
- for(sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_IMASEL)
+ for (sl= sa->spacedata.first; sl; sl= sl->next) {
+ if (sl->spacetype==SPACE_IMASEL)
sl->spacetype= SPACE_EMPTY; /* spacedata then matches */
}
/* space sound is deprecated */
- for(sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_SOUND)
+ for (sl= sa->spacedata.first; sl; sl= sl->next) {
+ if (sl->spacetype==SPACE_SOUND)
sl->spacetype= SPACE_EMPTY; /* spacedata then matches */
}
@@ -7201,10 +7231,10 @@ static void do_versions_windowmanager_2_50(bScreen *screen)
sa->butspacetype= sa->spacetype;
/* pushed back spaces also need regions! */
- if(sa->spacedata.first) {
+ if (sa->spacedata.first) {
sl= sa->spacedata.first;
- for(sl= sl->next; sl; sl= sl->next) {
- if(sa->headertype)
+ for (sl= sl->next; sl; sl= sl->next) {
+ if (sa->headertype)
area_add_header_region(sa, &sl->regionbase);
area_add_window_regions(sa, sl, &sl->regionbase);
}
@@ -7223,7 +7253,7 @@ static void versions_gpencil_add_main(ListBase *lb, ID *id, const char *name)
new_id(lb, id, name);
/* alphabetic insterion: is in new_id */
- if(G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("Converted GPencil to ID: %s\n", id->name+2);
}
@@ -7233,25 +7263,25 @@ static void do_versions_gpencil_2_50(Main *main, bScreen *screen)
SpaceLink *sl;
/* add regions */
- for(sa= screen->areabase.first; sa; sa= sa->next) {
- for(sl= sa->spacedata.first; sl; sl= sl->next) {
+ for (sa= screen->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(v3d->gpd) {
+ if (v3d->gpd) {
versions_gpencil_add_main(&main->gpencil, (ID *)v3d->gpd, "GPencil View3D");
v3d->gpd= NULL;
}
}
else if (sl->spacetype==SPACE_NODE) {
SpaceNode *snode= (SpaceNode *)sl;
- if(snode->gpd) {
+ if (snode->gpd) {
versions_gpencil_add_main(&main->gpencil, (ID *)snode->gpd, "GPencil Node");
snode->gpd= NULL;
}
}
else if (sl->spacetype==SPACE_SEQ) {
SpaceSeq *sseq= (SpaceSeq *)sl;
- if(sseq->gpd) {
+ if (sseq->gpd) {
versions_gpencil_add_main(&main->gpencil, (ID *)sseq->gpd, "GPencil Node");
sseq->gpd= NULL;
}
@@ -7259,7 +7289,7 @@ static void do_versions_gpencil_2_50(Main *main, bScreen *screen)
else if (sl->spacetype==SPACE_IMAGE) {
SpaceImage *sima= (SpaceImage *)sl;
#if 0 /* see comment on r28002 */
- if(sima->gpd) {
+ if (sima->gpd) {
versions_gpencil_add_main(&main->gpencil, (ID *)sima->gpd, "GPencil Image");
sima->gpd= NULL;
}
@@ -7277,8 +7307,8 @@ static PartEff *do_version_give_parteff_245(Object *ob)
PartEff *paf;
paf= ob->effect.first;
- while(paf) {
- if(paf->type==EFF_PARTICLE) return paf;
+ while (paf) {
+ if (paf->type==EFF_PARTICLE) return paf;
paf= paf->next;
}
return NULL;
@@ -7287,9 +7317,9 @@ static void do_version_free_effect_245(Effect *eff)
{
PartEff *paf;
- if(eff->type==EFF_PARTICLE) {
+ if (eff->type==EFF_PARTICLE) {
paf= (PartEff *)eff;
- if(paf->keys) MEM_freeN(paf->keys);
+ if (paf->keys) MEM_freeN(paf->keys);
}
MEM_freeN(eff);
}
@@ -7298,7 +7328,7 @@ static void do_version_free_effects_245(ListBase *lb)
Effect *eff;
eff= lb->first;
- while(eff) {
+ while (eff) {
BLI_remlink(lb, eff);
do_version_free_effect_245(eff);
eff= lb->first;
@@ -7311,20 +7341,20 @@ static void do_version_mtex_factor_2_50(MTex **mtex_array, short idtype)
float varfac, colfac;
int a, neg;
- if(!mtex_array)
+ if (!mtex_array)
return;
- for(a=0; a<MAX_MTEX; a++) {
- if(mtex_array[a]) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (mtex_array[a]) {
mtex= mtex_array[a];
neg= mtex->maptoneg;
varfac= mtex->varfac;
colfac= mtex->colfac;
- if(neg & MAP_DISP) mtex->dispfac= -mtex->dispfac;
- if(neg & MAP_NORM) mtex->norfac= -mtex->norfac;
- if(neg & MAP_WARP) mtex->warpfac= -mtex->warpfac;
+ if (neg & MAP_DISP) mtex->dispfac= -mtex->dispfac;
+ if (neg & MAP_NORM) mtex->norfac= -mtex->norfac;
+ if (neg & MAP_WARP) mtex->warpfac= -mtex->warpfac;
mtex->colspecfac= (neg & MAP_COLSPEC)? -colfac: colfac;
mtex->mirrfac= (neg & MAP_COLMIR)? -colfac: colfac;
@@ -7359,11 +7389,11 @@ static void do_version_mtex_factor_2_50(MTex **mtex_array, short idtype)
mtex->zendownfac= (neg & WOMAP_ZENDOWN)? -colfac: colfac;
mtex->blendfac= (neg & WOMAP_BLEND)? -varfac: varfac;
- if(idtype == ID_MA)
+ if (idtype == ID_MA)
mtex->colfac= (neg & MAP_COL)? -colfac: colfac;
- else if(idtype == ID_LA)
+ else if (idtype == ID_LA)
mtex->colfac= (neg & LAMAP_COL)? -colfac: colfac;
- else if(idtype == ID_WO)
+ else if (idtype == ID_WO)
mtex->colfac= (neg & WOMAP_HORIZ)? -colfac: colfac;
}
}
@@ -7375,12 +7405,12 @@ static void do_version_mdef_250(Main *main)
ModifierData *md;
MeshDeformModifierData *mmd;
- for(ob= main->object.first; ob; ob=ob->id.next) {
- for(md=ob->modifiers.first; md; md=md->next) {
- if(md->type == eModifierType_MeshDeform) {
+ for (ob= main->object.first; ob; ob=ob->id.next) {
+ for (md=ob->modifiers.first; md; md=md->next) {
+ if (md->type == eModifierType_MeshDeform) {
mmd= (MeshDeformModifierData*)md;
- if(mmd->bindcos) {
+ if (mmd->bindcos) {
/* make bindcos NULL in order to trick older versions
into thinking that the mesh was not bound yet */
mmd->bindcagecos= mmd->bindcos;
@@ -7398,17 +7428,17 @@ static void do_version_constraints_radians_degrees_250(ListBase *lb)
bConstraint *con;
for (con=lb->first; con; con=con->next) {
- if(con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) {
+ if (con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) {
bRigidBodyJointConstraint *data = con->data;
data->axX *= (float)(M_PI/180.0);
data->axY *= (float)(M_PI/180.0);
data->axZ *= (float)(M_PI/180.0);
}
- else if(con->type==CONSTRAINT_TYPE_KINEMATIC) {
+ else if (con->type==CONSTRAINT_TYPE_KINEMATIC) {
bKinematicConstraint *data = con->data;
data->poleangle *= (float)(M_PI/180.0);
}
- else if(con->type==CONSTRAINT_TYPE_ROTLIMIT) {
+ else if (con->type==CONSTRAINT_TYPE_ROTLIMIT) {
bRotLimitConstraint *data = con->data;
data->xmin *= (float)(M_PI/180.0);
@@ -7445,7 +7475,7 @@ static void do_versions_seq_unique_name_all_strips(
{
Sequence * seq = seqbasep->first;
- while(seq) {
+ while (seq) {
seqbase_unique_name_recursive(&sce->ed->seqbase, seq);
if (seq->seqbase.first) {
do_versions_seq_unique_name_all_strips(
@@ -7464,7 +7494,7 @@ static void do_version_bone_roll_256(Bone *bone)
copy_m3_m4(submat, bone->arm_mat);
mat3_to_vec_roll(submat, NULL, &bone->arm_roll);
- for(child = bone->childbase.first; child; child = child->next)
+ for (child = bone->childbase.first; child; child = child->next)
do_version_bone_roll_256(child);
}
@@ -7489,7 +7519,7 @@ void convert_tface_mt(FileData *fd, Main *main)
gmain = G.main;
G.main = main;
- if(!(do_version_tface(main, 1))) {
+ if (!(do_version_tface(main, 1))) {
BKE_report(fd->reports, RPT_WARNING, "Texface conversion problem. Error in console");
}
@@ -7515,8 +7545,8 @@ static void do_version_ntree_tex_mapping_260(void *UNUSED(data), ID *UNUSED(id),
{
bNode *node;
- for(node=ntree->nodes.first; node; node=node->next) {
- if(node->type == SH_NODE_MAPPING) {
+ for (node=ntree->nodes.first; node; node=node->next) {
+ if (node->type == SH_NODE_MAPPING) {
TexMapping *tex_mapping;
tex_mapping= node->storage;
@@ -7671,35 +7701,126 @@ static void do_versions_nodetree_socket_auto_hidden_flags_2_62(bNodeTree *ntree)
if (sock->link==NULL)
sock->flag |= SOCK_AUTO_HIDDEN;
}
- for(sock=node->outputs.first; sock; sock= sock->next) {
- if(nodeCountSocketLinks(ntree, sock)==0)
+ for (sock=node->outputs.first; sock; sock= sock->next) {
+ if (nodeCountSocketLinks(ntree, sock)==0)
sock->flag |= SOCK_AUTO_HIDDEN;
}
}
else {
- for(sock=node->inputs.first; sock; sock= sock->next)
+ for (sock=node->inputs.first; sock; sock= sock->next)
sock->flag &= ~SOCK_AUTO_HIDDEN;
- for(sock=node->outputs.first; sock; sock= sock->next)
+ for (sock=node->outputs.first; sock; sock= sock->next)
sock->flag &= ~SOCK_AUTO_HIDDEN;
}
}
}
+static void do_versions_nodetree_multi_file_output_format_2_62_1(Scene *sce, bNodeTree *ntree)
+{
+ bNode *node;
+ bNodeSocket *sock;
+
+ for (node=ntree->nodes.first; node; node=node->next) {
+ if (node->type==CMP_NODE_OUTPUT_FILE) {
+ /* previous CMP_NODE_OUTPUT_FILE nodes get converted to multi-file outputs */
+ NodeImageFile *old_data = node->storage;
+ NodeImageMultiFile *nimf= MEM_callocN(sizeof(NodeImageMultiFile), "node image multi file");
+ bNodeSocket *old_image = BLI_findlink(&node->inputs, 0);
+ bNodeSocket *old_z = BLI_findlink(&node->inputs, 1);
+ bNodeSocket *sock;
+
+ node->storage= nimf;
+
+ BLI_strncpy(nimf->base_path, old_data->name, sizeof(nimf->base_path));
+ nimf->format = old_data->im_format;
+
+ /* if z buffer is saved, change the image type to multilayer exr.
+ * XXX this is slightly messy, Z buffer was ignored before for anything but EXR and IRIS ...
+ * i'm just assuming here that IRIZ means IRIS with z buffer ...
+ */
+ if (ELEM(old_data->im_format.imtype, R_IMF_IMTYPE_IRIZ, R_IMF_IMTYPE_OPENEXR)) {
+ nimf->format.imtype = R_IMF_IMTYPE_MULTILAYER;
+ sock = ntreeCompositOutputFileAddSocket(ntree, node, old_image->name, &nimf->format);
+ if (old_image->link) {
+ old_image->link->tosock = sock;
+ sock->link = old_image->link;
+ }
+ sock = ntreeCompositOutputFileAddSocket(ntree, node, old_z->name, &nimf->format);
+ if (old_z->link) {
+ old_z->link->tosock = sock;
+ sock->link = old_z->link;
+ }
+ }
+ else {
+ /* saves directly to base path, which is the old image output path */
+ sock = ntreeCompositOutputFileAddSocket(ntree, node, "", &nimf->format);
+ if (old_image->link) {
+ old_image->link->tosock = sock;
+ sock->link = old_image->link;
+ }
+ }
+
+ nodeRemoveSocket(ntree, node, old_image);
+ nodeRemoveSocket(ntree, node, old_z);
+ MEM_freeN(old_data);
+ }
+ else if (node->type==CMP_NODE_OUTPUT_MULTI_FILE__DEPRECATED) {
+ NodeImageMultiFile *nimf = node->storage;
+
+ /* CMP_NODE_OUTPUT_MULTI_FILE has been redeclared as CMP_NODE_OUTPUT_FILE */
+ node->type = CMP_NODE_OUTPUT_FILE;
+
+ /* initialize the node-wide image format from render data, if available */
+ if (sce)
+ nimf->format = sce->r.im_format;
+
+ /* transfer render format toggle to node format toggle */
+ for (sock=node->inputs.first; sock; sock=sock->next) {
+ NodeImageMultiFileSocket *simf = sock->storage;
+ simf->use_node_format = simf->use_render_format;
+ }
+
+ /* we do have preview now */
+ node->flag |= NODE_PREVIEW;
+ }
+ }
+}
+
+/* blue and red are swapped pre 2.62.1, be sane (red == red) now! */
+static void do_versions_mesh_mloopcol_swap_2_62_1(Mesh *me)
+{
+ CustomDataLayer *layer;
+ MLoopCol *mloopcol;
+ int a;
+ int i;
+
+ for (a = 0; a < me->ldata.totlayer; a++) {
+ layer = &me->ldata.layers[a];
+
+ if (layer->type == CD_MLOOPCOL) {
+ mloopcol = (MLoopCol *)layer->data;
+ for (i = 0; i < me->totloop; i++, mloopcol++) {
+ SWAP(char, mloopcol->r, mloopcol->b);
+ }
+ }
+ }
+}
+
static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* WATCH IT!!!: pointers from libdata have not been converted */
- if(G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("read file %s\n Version %d sub %d svn r%d\n", fd->relabase, main->versionfile, main->subversionfile, main->revision);
- if(main->versionfile == 100) {
+ if (main->versionfile == 100) {
/* tex->extend and tex->imageflag have changed: */
Tex *tex = main->tex.first;
- while(tex) {
- if(tex->id.flag & LIB_NEEDLINK) {
+ while (tex) {
+ if (tex->id.flag & LIB_NEEDLINK) {
- if(tex->extend==0) {
- if(tex->xrepeat || tex->yrepeat) tex->extend= TEX_REPEAT;
+ if (tex->extend==0) {
+ if (tex->xrepeat || tex->yrepeat) tex->extend= TEX_REPEAT;
else {
tex->extend= TEX_EXTEND;
tex->xrepeat= tex->yrepeat= 1;
@@ -7710,87 +7831,87 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
tex= tex->id.next;
}
}
- if(main->versionfile <= 101) {
+ if (main->versionfile <= 101) {
/* frame mapping */
Scene *sce = main->scene.first;
- while(sce) {
+ while (sce) {
sce->r.framapto= 100;
sce->r.images= 100;
sce->r.framelen= 1.0;
sce= sce->id.next;
}
}
- if(main->versionfile <= 102) {
+ if (main->versionfile <= 102) {
/* init halo's at 1.0 */
Material *ma = main->mat.first;
- while(ma) {
+ while (ma) {
ma->add= 1.0;
ma= ma->id.next;
}
}
- if(main->versionfile <= 103) {
+ if (main->versionfile <= 103) {
/* new variable in object: colbits */
Object *ob = main->object.first;
int a;
- while(ob) {
+ while (ob) {
ob->colbits= 0;
- if(ob->totcol) {
- for(a=0; a<ob->totcol; a++) {
- if(ob->mat[a]) ob->colbits |= (1<<a);
+ if (ob->totcol) {
+ for (a=0; a<ob->totcol; a++) {
+ if (ob->mat[a]) ob->colbits |= (1<<a);
}
}
ob= ob->id.next;
}
}
- if(main->versionfile <= 104) {
+ if (main->versionfile <= 104) {
/* timeoffs moved */
Object *ob = main->object.first;
- while(ob) {
- if(ob->transflag & 1) {
+ while (ob) {
+ if (ob->transflag & 1) {
ob->transflag -= 1;
//ob->ipoflag |= OB_OFFS_OB;
}
ob= ob->id.next;
}
}
- if(main->versionfile <= 105) {
+ if (main->versionfile <= 105) {
Object *ob = main->object.first;
- while(ob) {
+ while (ob) {
ob->dupon= 1; ob->dupoff= 0;
ob->dupsta= 1; ob->dupend= 100;
ob= ob->id.next;
}
}
- if(main->versionfile <= 106) {
+ if (main->versionfile <= 106) {
/* mcol changed */
Mesh *me = main->mesh.first;
- while(me) {
- if(me->mcol) vcol_to_fcol(me);
+ while (me) {
+ if (me->mcol) vcol_to_fcol(me);
me= me->id.next;
}
}
- if(main->versionfile <= 107) {
+ if (main->versionfile <= 107) {
Object *ob;
Scene *sce = main->scene.first;
- while(sce) {
+ while (sce) {
sce->r.mode |= R_GAMMA;
sce= sce->id.next;
}
ob= main->object.first;
- while(ob) {
+ while (ob) {
//ob->ipoflag |= OB_OFFS_PARENT;
- if(ob->dt==0) ob->dt= OB_SOLID;
+ if (ob->dt==0) ob->dt= OB_SOLID;
ob= ob->id.next;
}
}
- if(main->versionfile <= 109) {
+ if (main->versionfile <= 109) {
/* new variable: gridlines */
bScreen *sc = main->screen.first;
- while(sc) {
+ while (sc) {
ScrArea *sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl= sa->spacedata.first;
while (sl) {
if (sl->spacetype==SPACE_VIEW3D) {
@@ -7805,17 +7926,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sc= sc->id.next;
}
}
- if(main->versionfile <= 113) {
+ if (main->versionfile <= 113) {
Material *ma = main->mat.first;
- while(ma) {
- if(ma->flaresize==0.0f) ma->flaresize= 1.0f;
+ while (ma) {
+ if (ma->flaresize==0.0f) ma->flaresize= 1.0f;
ma->subsize= 1.0f;
ma->flareboost= 1.0f;
ma= ma->id.next;
}
}
- if(main->versionfile <= 134) {
+ if (main->versionfile <= 134) {
Tex *tex = main->tex.first;
while (tex) {
if ((tex->rfac == 0.0f) &&
@@ -7829,7 +7950,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
tex = tex->id.next;
}
}
- if(main->versionfile <= 140) {
+ if (main->versionfile <= 140) {
/* r-g-b-fac in texture */
Tex *tex = main->tex.first;
while (tex) {
@@ -7844,54 +7965,54 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
tex = tex->id.next;
}
}
- if(main->versionfile <= 153) {
+ if (main->versionfile <= 153) {
Scene *sce = main->scene.first;
- while(sce) {
- if(sce->r.blurfac==0.0f) sce->r.blurfac= 1.0f;
+ while (sce) {
+ if (sce->r.blurfac==0.0f) sce->r.blurfac= 1.0f;
sce= sce->id.next;
}
}
- if(main->versionfile <= 163) {
+ if (main->versionfile <= 163) {
Scene *sce = main->scene.first;
- while(sce) {
- if(sce->r.frs_sec==0) sce->r.frs_sec= 25;
+ while (sce) {
+ if (sce->r.frs_sec==0) sce->r.frs_sec= 25;
sce= sce->id.next;
}
}
- if(main->versionfile <= 164) {
+ if (main->versionfile <= 164) {
Mesh *me= main->mesh.first;
- while(me) {
+ while (me) {
me->smoothresh= 30;
me= me->id.next;
}
}
- if(main->versionfile <= 165) {
+ if (main->versionfile <= 165) {
Mesh *me= main->mesh.first;
TFace *tface;
int nr;
char *cp;
- while(me) {
- if(me->tface) {
+ while (me) {
+ if (me->tface) {
nr= me->totface;
tface= me->tface;
- while(nr--) {
+ while (nr--) {
cp= (char *)&tface->col[0];
- if(cp[1]>126) cp[1]= 255; else cp[1]*=2;
- if(cp[2]>126) cp[2]= 255; else cp[2]*=2;
- if(cp[3]>126) cp[3]= 255; else cp[3]*=2;
+ if (cp[1]>126) cp[1]= 255; else cp[1]*=2;
+ if (cp[2]>126) cp[2]= 255; else cp[2]*=2;
+ if (cp[3]>126) cp[3]= 255; else cp[3]*=2;
cp= (char *)&tface->col[1];
- if(cp[1]>126) cp[1]= 255; else cp[1]*=2;
- if(cp[2]>126) cp[2]= 255; else cp[2]*=2;
- if(cp[3]>126) cp[3]= 255; else cp[3]*=2;
+ if (cp[1]>126) cp[1]= 255; else cp[1]*=2;
+ if (cp[2]>126) cp[2]= 255; else cp[2]*=2;
+ if (cp[3]>126) cp[3]= 255; else cp[3]*=2;
cp= (char *)&tface->col[2];
- if(cp[1]>126) cp[1]= 255; else cp[1]*=2;
- if(cp[2]>126) cp[2]= 255; else cp[2]*=2;
- if(cp[3]>126) cp[3]= 255; else cp[3]*=2;
+ if (cp[1]>126) cp[1]= 255; else cp[1]*=2;
+ if (cp[2]>126) cp[2]= 255; else cp[2]*=2;
+ if (cp[3]>126) cp[3]= 255; else cp[3]*=2;
cp= (char *)&tface->col[3];
- if(cp[1]>126) cp[1]= 255; else cp[1]*=2;
- if(cp[2]>126) cp[2]= 255; else cp[2]*=2;
- if(cp[3]>126) cp[3]= 255; else cp[3]*=2;
+ if (cp[1]>126) cp[1]= 255; else cp[1]*=2;
+ if (cp[2]>126) cp[2]= 255; else cp[2]*=2;
+ if (cp[3]>126) cp[3]= 255; else cp[3]*=2;
tface++;
}
@@ -7900,22 +8021,22 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 169) {
+ if (main->versionfile <= 169) {
Mesh *me= main->mesh.first;
- while(me) {
- if(me->subdiv==0) me->subdiv= 1;
+ while (me) {
+ if (me->subdiv==0) me->subdiv= 1;
me= me->id.next;
}
}
- if(main->versionfile <= 169) {
+ if (main->versionfile <= 169) {
bScreen *sc= main->screen.first;
- while(sc) {
+ while (sc) {
ScrArea *sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl= sa->spacedata.first;
- while(sl) {
- if(sl->spacetype==SPACE_IPO) {
+ while (sl) {
+ if (sl->spacetype==SPACE_IPO) {
SpaceIpo *sipo= (SpaceIpo*) sl;
sipo->v2d.max[0]= 15000.0;
}
@@ -7927,7 +8048,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 170) {
+ if (main->versionfile <= 170) {
Object *ob = main->object.first;
PartEff *paf;
while (ob) {
@@ -7941,14 +8062,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 171) {
+ if (main->versionfile <= 171) {
bScreen *sc= main->screen.first;
- while(sc) {
+ while (sc) {
ScrArea *sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl= sa->spacedata.first;
- while(sl) {
- if(sl->spacetype==SPACE_TEXT) {
+ while (sl) {
+ if (sl->spacetype==SPACE_TEXT) {
SpaceText *st= (SpaceText*) sl;
st->lheight= 12;
}
@@ -7960,14 +8081,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 173) {
+ if (main->versionfile <= 173) {
int a, b;
Mesh *me= main->mesh.first;
- while(me) {
- if(me->tface) {
+ while (me) {
+ if (me->tface) {
TFace *tface= me->tface;
- for(a=0; a<me->totface; a++, tface++) {
- for(b=0; b<4; b++) {
+ for (a=0; a<me->totface; a++, tface++) {
+ for (b=0; b<4; b++) {
tface->uv[b][0]/= 32767.0f;
tface->uv[b][1]/= 32767.0f;
}
@@ -7977,17 +8098,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 191) {
+ if (main->versionfile <= 191) {
Object *ob= main->object.first;
Material *ma = main->mat.first;
/* let faces have default add factor of 0.0 */
- while(ma) {
+ while (ma) {
if (!(ma->mode & MA_HALO)) ma->add = 0.0;
ma = ma->id.next;
}
- while(ob) {
+ while (ob) {
ob->mass= 1.0f;
ob->damping= 0.1f;
/*ob->quat[1]= 1.0f;*/ /* quats arnt used yet */
@@ -7995,23 +8116,23 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 193) {
+ if (main->versionfile <= 193) {
Object *ob= main->object.first;
- while(ob) {
+ while (ob) {
ob->inertia= 1.0f;
ob->rdamping= 0.1f;
ob= ob->id.next;
}
}
- if(main->versionfile <= 196) {
+ if (main->versionfile <= 196) {
Mesh *me= main->mesh.first;
int a, b;
- while(me) {
- if(me->tface) {
+ while (me) {
+ if (me->tface) {
TFace *tface= me->tface;
- for(a=0; a<me->totface; a++, tface++) {
- for(b=0; b<4; b++) {
+ for (a=0; a<me->totface; a++, tface++) {
+ for (b=0; b<4; b++) {
tface->mode |= TF_DYNAMIC;
tface->mode &= ~TF_INVISIBLE;
}
@@ -8021,9 +8142,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 200) {
+ if (main->versionfile <= 200) {
Object *ob= main->object.first;
- while(ob) {
+ while (ob) {
ob->scaflag = ob->gameflag & (OB_DO_FH|OB_ROT_FH|OB_ANISOTROPIC_FRICTION|OB_GHOST|OB_RIGID_BODY|OB_BOUNDS);
/* 64 is do_fh */
ob->gameflag &= ~(OB_ROT_FH|OB_ANISOTROPIC_FRICTION|OB_GHOST|OB_RIGID_BODY|OB_BOUNDS);
@@ -8031,7 +8152,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 201) {
+ if (main->versionfile <= 201) {
/* add-object + end-object are joined to edit-object actuator */
Object *ob = main->object.first;
bProperty *prop;
@@ -8042,14 +8163,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
while (ob) {
act = ob->actuators.first;
while (act) {
- if(act->type==ACT_IPO) {
+ if (act->type==ACT_IPO) {
ia= act->data;
prop= get_ob_property(ob, ia->name);
- if(prop) {
+ if (prop) {
ia->type= ACT_IPO_FROM_PROP;
}
}
- else if(act->type==ACT_ADD_OBJECT) {
+ else if (act->type==ACT_ADD_OBJECT) {
aoa= act->data;
eoa= MEM_callocN(sizeof(bEditObjectActuator), "edit ob act");
eoa->type= ACT_EDOB_ADD_OBJECT;
@@ -8059,7 +8180,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
act->data= eoa;
act->type= act->otype= ACT_EDIT_OBJECT;
}
- else if(act->type==ACT_END_OBJECT) {
+ else if (act->type==ACT_END_OBJECT) {
eoa= MEM_callocN(sizeof(bEditObjectActuator), "edit ob act");
eoa->type= ACT_EDOB_END_OBJECT;
act->data= eoa;
@@ -8071,16 +8192,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 202) {
+ if (main->versionfile <= 202) {
/* add-object and end-object are joined to edit-object
* actuator */
Object *ob= main->object.first;
bActuator *act;
bObjectActuator *oa;
- while(ob) {
+ while (ob) {
act= ob->actuators.first;
- while(act) {
- if(act->type==ACT_OBJECT) {
+ while (act) {
+ if (act->type==ACT_OBJECT) {
oa= act->data;
oa->flag &= ~(ACT_TORQUE_LOCAL|ACT_DROT_LOCAL); /* this actuator didn't do local/glob rot before */
}
@@ -8090,20 +8211,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 204) {
+ if (main->versionfile <= 204) {
/* patches for new physics */
Object *ob= main->object.first;
bActuator *act;
bObjectActuator *oa;
bSound *sound;
- while(ob) {
+ while (ob) {
/* please check this for demo20 files like
* original Egypt levels etc. converted
* rotation factor of 50 is not workable */
act= ob->actuators.first;
- while(act) {
- if(act->type==ACT_OBJECT) {
+ while (act) {
+ if (act->type==ACT_OBJECT) {
oa= act->data;
oa->forceloc[0]*= 25.0f;
@@ -8128,7 +8249,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 205) {
+ if (main->versionfile <= 205) {
/* patches for new physics */
Object *ob= main->object.first;
bActuator *act;
@@ -8136,7 +8257,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
bEditObjectActuator *oa;
bRaySensor *rs;
bCollisionSensor *cs;
- while(ob) {
+ while (ob) {
/* Set anisotropic friction off for old objects,
* values to 1.0. */
ob->gameflag &= ~OB_ANISOTROPIC_FRICTION;
@@ -8145,8 +8266,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ob->anisotropicFriction[2] = 1.0;
act= ob->actuators.first;
- while(act) {
- if(act->type==ACT_EDIT_OBJECT) {
+ while (act) {
+ if (act->type==ACT_EDIT_OBJECT) {
/* Zero initial velocity for newly
* added objects */
oa= act->data;
@@ -8161,16 +8282,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sens= ob->sensors.first;
while (sens) {
/* Extra fields for radar sensors. */
- if(sens->type == SENS_RADAR) {
+ if (sens->type == SENS_RADAR) {
bRadarSensor *s = sens->data;
s->range = 10000.0;
}
/* Pulsing: defaults for new sensors. */
- if(sens->type != SENS_ALWAYS) {
+ if (sens->type != SENS_ALWAYS) {
sens->pulse = 0;
sens->freq = 0;
- } else {
+ }
+ else {
sens->pulse = 1;
}
@@ -8180,11 +8302,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* Collision and ray: default = trigger
* on property. The material field can
* remain empty. */
- if(sens->type == SENS_COLLISION) {
+ if (sens->type == SENS_COLLISION) {
cs = (bCollisionSensor*) sens->data;
cs->mode = 0;
}
- if(sens->type == SENS_RAY) {
+ if (sens->type == SENS_RAY) {
rs = (bRaySensor*) sens->data;
rs->mode = 0;
}
@@ -8195,7 +8317,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* have to check the exact multiplier */
}
- if(main->versionfile <= 211) {
+ if (main->versionfile <= 211) {
/* Render setting: per scene, the applicable gamma value
* can be set. Default is 1.0, which means no
* correction. */
@@ -8205,16 +8327,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* added alpha in obcolor */
ob= main->object.first;
- while(ob) {
+ while (ob) {
ob->col[3]= 1.0;
ob= ob->id.next;
}
/* added alpha in obcolor */
ob= main->object.first;
- while(ob) {
+ while (ob) {
act= ob->actuators.first;
- while(act) {
+ while (act) {
if (act->type==ACT_OBJECT) {
/* multiply velocity with 50 in old files */
oa= act->data;
@@ -8237,7 +8359,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 212) {
+ if (main->versionfile <= 212) {
bSound* sound;
bProperty *prop;
@@ -8263,7 +8385,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
while (ob) {
prop= ob->prop.first;
- while(prop) {
+ while (prop) {
if (prop->type == GPROP_TIME) {
// convert old GPROP_TIME values from int to float
*((float *)&prop->data) = (float) prop->data;
@@ -8285,7 +8407,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
me->flag|= ME_SUBSURF;
me->subdiv= 1;
- } else {
+ }
+ else {
if (me->subdiv<2)
me->subdiv= 1;
else
@@ -8294,14 +8417,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 220) {
+ if (main->versionfile <= 220) {
Object *ob;
Mesh *me;
ob = main->object.first;
/* adapt form factor in order to get the 'old' physics
- * behaviour back...*/
+ * behavior back...*/
while (ob) {
/* in future, distinguish between different
@@ -8343,11 +8466,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
- if(main->versionfile <= 221) {
+ if (main->versionfile <= 221) {
Scene *sce= main->scene.first;
// new variables for std-alone player and runtime
- while(sce) {
+ while (sce) {
sce->r.xplay= 640;
sce->r.yplay= 480;
@@ -8357,11 +8480,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 222) {
+ if (main->versionfile <= 222) {
Scene *sce= main->scene.first;
// new variables for std-alone player and runtime
- while(sce) {
+ while (sce) {
sce->r.depth= 32;
@@ -8370,7 +8493,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
- if(main->versionfile <= 223) {
+ if (main->versionfile <= 223) {
VFont *vf;
Image *ima;
Object *ob;
@@ -8382,7 +8505,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* Old textures animate at 25 FPS */
- for (ima = main->image.first; ima; ima=ima->id.next){
+ for (ima = main->image.first; ima; ima=ima->id.next) {
ima->animspeed = 25;
}
@@ -8401,7 +8524,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
- if(main->versionfile <= 224) {
+ if (main->versionfile <= 224) {
bSound* sound;
Scene *sce;
Mesh *me;
@@ -8416,7 +8539,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
/* Make sure that old subsurf meshes don't have zero subdivision level for rendering */
- for (me=main->mesh.first; me; me=me->id.next){
+ for (me=main->mesh.first; me; me=me->id.next) {
if ((me->flag & ME_SUBSURF) && (me->subdivr==0))
me->subdivr=me->subdiv;
}
@@ -8444,7 +8567,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
- if(main->versionfile <= 225) {
+ if (main->versionfile <= 225) {
World *wo;
/* Use Sumo for old games */
for (wo = main->world.first; wo; wo= wo->id.next) {
@@ -8452,7 +8575,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->versionfile <= 227) {
+ if (main->versionfile <= 227) {
Scene *sce;
Material *ma;
bScreen *sc;
@@ -8470,10 +8593,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* check for already existing TrackTo constraint
set their track and up flag correctly */
- if (list){
+ if (list) {
bConstraint *curcon;
- for (curcon = list->first; curcon; curcon=curcon->next){
- if (curcon->type == CONSTRAINT_TYPE_TRACKTO){
+ for (curcon = list->first; curcon; curcon=curcon->next) {
+ if (curcon->type == CONSTRAINT_TYPE_TRACKTO) {
bTrackToConstraint *data = curcon->data;
data->reserved1 = ob->trackflag;
data->reserved2 = ob->upflag;
@@ -8482,14 +8605,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
if (ob->type == OB_ARMATURE) {
- if (ob->pose){
+ if (ob->pose) {
bConstraint *curcon;
bPoseChannel *pchan;
for (pchan = ob->pose->chanbase.first;
- pchan; pchan=pchan->next){
+ pchan; pchan=pchan->next) {
for (curcon = pchan->constraints.first;
- curcon; curcon=curcon->next){
- if (curcon->type == CONSTRAINT_TYPE_TRACKTO){
+ curcon; curcon=curcon->next) {
+ if (curcon->type == CONSTRAINT_TYPE_TRACKTO) {
bTrackToConstraint *data = curcon->data;
data->reserved1 = ob->trackflag;
data->reserved2 = ob->upflag;
@@ -8540,7 +8663,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
- if(main->versionfile <= 228) {
+ if (main->versionfile <= 228) {
Scene *sce;
bScreen *sc;
Object *ob;
@@ -8557,10 +8680,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* check for already existing TrackTo constraint
set their track and up flag correctly */
- if (list){
+ if (list) {
bConstraint *curcon;
- for (curcon = list->first; curcon; curcon=curcon->next){
- if (curcon->type == CONSTRAINT_TYPE_TRACKTO){
+ for (curcon = list->first; curcon; curcon=curcon->next) {
+ if (curcon->type == CONSTRAINT_TYPE_TRACKTO) {
bTrackToConstraint *data = curcon->data;
data->reserved1 = ob->trackflag;
data->reserved2 = ob->upflag;
@@ -8569,14 +8692,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
if (ob->type == OB_ARMATURE) {
- if (ob->pose){
+ if (ob->pose) {
bConstraint *curcon;
bPoseChannel *pchan;
for (pchan = ob->pose->chanbase.first;
- pchan; pchan=pchan->next){
+ pchan; pchan=pchan->next) {
for (curcon = pchan->constraints.first;
- curcon; curcon=curcon->next){
- if (curcon->type == CONSTRAINT_TYPE_TRACKTO){
+ curcon; curcon=curcon->next) {
+ if (curcon->type == CONSTRAINT_TYPE_TRACKTO) {
bTrackToConstraint *data = curcon->data;
data->reserved1 = ob->trackflag;
data->reserved2 = ob->upflag;
@@ -8607,46 +8730,46 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sbuts->v2d.maxzoom= 1.2f;
sbuts->align= 1; /* horizontal default */
- if(sbuts->mainb==BUTS_LAMP) {
+ if (sbuts->mainb==BUTS_LAMP) {
sbuts->mainb= CONTEXT_SHADING;
//sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_LAMP;
}
- else if(sbuts->mainb==BUTS_MAT) {
+ else if (sbuts->mainb==BUTS_MAT) {
sbuts->mainb= CONTEXT_SHADING;
//sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT;
}
- else if(sbuts->mainb==BUTS_TEX) {
+ else if (sbuts->mainb==BUTS_TEX) {
sbuts->mainb= CONTEXT_SHADING;
//sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_TEX;
}
- else if(sbuts->mainb==BUTS_ANIM) {
+ else if (sbuts->mainb==BUTS_ANIM) {
sbuts->mainb= CONTEXT_OBJECT;
}
- else if(sbuts->mainb==BUTS_WORLD) {
+ else if (sbuts->mainb==BUTS_WORLD) {
sbuts->mainb= CONTEXT_SCENE;
//sbuts->tab[CONTEXT_SCENE]= TAB_SCENE_WORLD;
}
- else if(sbuts->mainb==BUTS_RENDER) {
+ else if (sbuts->mainb==BUTS_RENDER) {
sbuts->mainb= CONTEXT_SCENE;
//sbuts->tab[CONTEXT_SCENE]= TAB_SCENE_RENDER;
}
- else if(sbuts->mainb==BUTS_GAME) {
+ else if (sbuts->mainb==BUTS_GAME) {
sbuts->mainb= CONTEXT_LOGIC;
}
- else if(sbuts->mainb==BUTS_FPAINT) {
+ else if (sbuts->mainb==BUTS_FPAINT) {
sbuts->mainb= CONTEXT_EDITING;
}
- else if(sbuts->mainb==BUTS_RADIO) {
+ else if (sbuts->mainb==BUTS_RADIO) {
sbuts->mainb= CONTEXT_SHADING;
//sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_RAD;
}
- else if(sbuts->mainb==BUTS_CONSTRAINT) {
+ else if (sbuts->mainb==BUTS_CONSTRAINT) {
sbuts->mainb= CONTEXT_OBJECT;
}
- else if(sbuts->mainb==BUTS_SCRIPT) {
+ else if (sbuts->mainb==BUTS_SCRIPT) {
sbuts->mainb= CONTEXT_OBJECT;
}
- else if(sbuts->mainb==BUTS_EDIT) {
+ else if (sbuts->mainb==BUTS_EDIT) {
sbuts->mainb= CONTEXT_EDITING;
}
else sbuts->mainb= CONTEXT_SCENE;
@@ -8660,7 +8783,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
nevertheless, we might need to think over a fitness (initialize)
check apart from the do_versions() */
- if(main->versionfile <= 230) {
+ if (main->versionfile <= 230) {
bScreen *sc;
// new variable blockscale, for panels in any area
@@ -8671,9 +8794,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->blockscale==0.0f) sl->blockscale= 0.7f;
+ if (sl->blockscale==0.0f) sl->blockscale= 0.7f;
/* added: 5x better zoom in for action */
- if(sl->spacetype==SPACE_ACTION) {
+ if (sl->spacetype==SPACE_ACTION) {
SpaceAction *sac= (SpaceAction *)sl;
sac->v2d.maxzoom= 50;
}
@@ -8681,12 +8804,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
- if(main->versionfile <= 231) {
+ if (main->versionfile <= 231) {
/* new bit flags for showing/hiding grid floor and axes */
bScreen *sc = main->screen.first;
- while(sc) {
+ while (sc) {
ScrArea *sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl= sa->spacedata.first;
while (sl) {
if (sl->spacetype==SPACE_VIEW3D) {
@@ -8706,7 +8829,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sc= sc->id.next;
}
}
- if(main->versionfile <= 231) {
+ if (main->versionfile <= 231) {
Material *ma= main->mat.first;
bScreen *sc = main->screen.first;
Scene *sce;
@@ -8714,9 +8837,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
World *wrld;
/* introduction of raytrace */
- while(ma) {
- if(ma->fresnel_tra_i==0.0f) ma->fresnel_tra_i= 1.25f;
- if(ma->fresnel_mir_i==0.0f) ma->fresnel_mir_i= 1.25f;
+ while (ma) {
+ if (ma->fresnel_tra_i==0.0f) ma->fresnel_tra_i= 1.25f;
+ if (ma->fresnel_mir_i==0.0f) ma->fresnel_mir_i= 1.25f;
ma->ang= 1.0;
ma->ray_depth= 2;
@@ -8727,24 +8850,24 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ma= ma->id.next;
}
sce= main->scene.first;
- while(sce) {
- if(sce->r.gauss==0.0f) sce->r.gauss= 1.0f;
+ while (sce) {
+ if (sce->r.gauss==0.0f) sce->r.gauss= 1.0f;
sce= sce->id.next;
}
la= main->lamp.first;
- while(la) {
- if(la->k==0.0f) la->k= 1.0;
- if(la->ray_samp==0) la->ray_samp= 1;
- if(la->ray_sampy==0) la->ray_sampy= 1;
- if(la->ray_sampz==0) la->ray_sampz= 1;
- if(la->area_size==0.0f) la->area_size= 1.0f;
- if(la->area_sizey==0.0f) la->area_sizey= 1.0f;
- if(la->area_sizez==0.0f) la->area_sizez= 1.0f;
+ while (la) {
+ if (la->k==0.0f) la->k= 1.0;
+ if (la->ray_samp==0) la->ray_samp= 1;
+ if (la->ray_sampy==0) la->ray_sampy= 1;
+ if (la->ray_sampz==0) la->ray_sampz= 1;
+ if (la->area_size==0.0f) la->area_size= 1.0f;
+ if (la->area_sizey==0.0f) la->area_sizey= 1.0f;
+ if (la->area_sizez==0.0f) la->area_sizez= 1.0f;
la= la->id.next;
}
wrld= main->world.first;
- while(wrld) {
- if(wrld->range==0.0f) {
+ while (wrld) {
+ if (wrld->range==0.0f) {
wrld->range= 1.0f/wrld->exposure;
}
wrld= wrld->id.next;
@@ -8752,9 +8875,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* new bit flags for showing/hiding grid floor and axes */
- while(sc) {
+ while (sc) {
ScrArea *sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl= sa->spacedata.first;
while (sl) {
if (sl->spacetype==SPACE_VIEW3D) {
@@ -8774,18 +8897,18 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sc= sc->id.next;
}
}
- if(main->versionfile <= 232) {
+ if (main->versionfile <= 232) {
Tex *tex= main->tex.first;
World *wrld= main->world.first;
bScreen *sc;
Scene *sce;
- while(tex) {
- if((tex->flag & (TEX_CHECKER_ODD+TEX_CHECKER_EVEN))==0) {
+ while (tex) {
+ if ((tex->flag & (TEX_CHECKER_ODD+TEX_CHECKER_EVEN))==0) {
tex->flag |= TEX_CHECKER_ODD;
}
/* copied from kernel texture.c */
- if(tex->ns_outscale==0.0f) {
+ if (tex->ns_outscale==0.0f) {
/* musgrave */
tex->mg_H = 1.0f;
tex->mg_lacunarity = 2.0f;
@@ -8802,13 +8925,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
tex= tex->id.next;
}
- while(wrld) {
- if(wrld->aodist==0.0f) {
+ while (wrld) {
+ if (wrld->aodist==0.0f) {
wrld->aodist= 10.0f;
wrld->aobias= 0.05f;
}
- if(wrld->aosamp==0) wrld->aosamp= 5;
- if(wrld->aoenergy==0.0f) wrld->aoenergy= 1.0f;
+ if (wrld->aosamp==0) wrld->aosamp= 5;
+ if (wrld->aoenergy==0.0f) wrld->aoenergy= 1.0f;
wrld= wrld->id.next;
}
@@ -8820,10 +8943,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
for (sa= sc->areabase.first; sa; sa= sa->next) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->blockscale==0.0f) sl->blockscale= 0.7f;
+ if (sl->blockscale==0.0f) sl->blockscale= 0.7f;
/* added: 5x better zoom in for nla */
- if(sl->spacetype==SPACE_NLA) {
+ if (sl->spacetype==SPACE_NLA) {
SpaceNla *snla= (SpaceNla *)sl;
snla->v2d.maxzoom= 50;
}
@@ -8831,28 +8954,28 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
sce= main->scene.first;
- while(sce) {
- if(sce->r.ocres==0) sce->r.ocres= 64;
+ while (sce) {
+ if (sce->r.ocres==0) sce->r.ocres= 64;
sce= sce->id.next;
}
}
- if(main->versionfile <= 233) {
+ if (main->versionfile <= 233) {
bScreen *sc;
Material *ma= main->mat.first;
/* Object *ob= main->object.first; */
- while(ma) {
- if(ma->rampfac_col==0.0f) ma->rampfac_col= 1.0;
- if(ma->rampfac_spec==0.0f) ma->rampfac_spec= 1.0;
- if(ma->pr_lamp==0) ma->pr_lamp= 3;
+ while (ma) {
+ if (ma->rampfac_col==0.0f) ma->rampfac_col= 1.0;
+ if (ma->rampfac_spec==0.0f) ma->rampfac_spec= 1.0;
+ if (ma->pr_lamp==0) ma->pr_lamp= 3;
ma= ma->id.next;
}
/* this should have been done loooong before! */
#if 0 /* deprecated in 2.5+ */
- while(ob) {
- if(ob->ipowin==0) ob->ipowin= ID_OB;
+ while (ob) {
+ if (ob->ipowin==0) ob->ipowin= ID_OB;
ob= ob->id.next;
}
#endif
@@ -8861,7 +8984,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
for (sa= sc->areabase.first; sa; sa= sa->next) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_VIEW3D) {
+ if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D *)sl;
v3d->flag |= V3D_SELECT_OUTLINE;
}
@@ -8873,13 +8996,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
- if(main->versionfile <= 234) {
+ if (main->versionfile <= 234) {
World *wo;
bScreen *sc;
// force sumo engine to be active
for (wo = main->world.first; wo; wo= wo->id.next) {
- if(wo->physicsEngine==0) wo->physicsEngine = 2;
+ if (wo->physicsEngine==0) wo->physicsEngine = 2;
}
for (sc= main->screen.first; sc; sc= sc->id.next) {
@@ -8887,33 +9010,33 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
for (sa= sc->areabase.first; sa; sa= sa->next) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_VIEW3D) {
+ if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D *)sl;
v3d->flag |= V3D_ZBUF_SELECT;
}
- else if(sl->spacetype==SPACE_TEXT) {
+ else if (sl->spacetype==SPACE_TEXT) {
SpaceText *st= (SpaceText *)sl;
- if(st->tabnumber==0) st->tabnumber= 2;
+ if (st->tabnumber==0) st->tabnumber= 2;
}
}
}
}
}
- if(main->versionfile <= 235) {
+ if (main->versionfile <= 235) {
Tex *tex= main->tex.first;
Scene *sce= main->scene.first;
Sequence *seq;
Editing *ed;
- while(tex) {
- if(tex->nabla==0.0f) tex->nabla= 0.025f;
+ while (tex) {
+ if (tex->nabla==0.0f) tex->nabla= 0.025f;
tex= tex->id.next;
}
- while(sce) {
+ while (sce) {
ed= sce->ed;
- if(ed) {
+ if (ed) {
SEQ_BEGIN(sce->ed, seq) {
- if(seq->type==SEQ_IMAGE || seq->type==SEQ_MOVIE)
+ if (seq->type==SEQ_IMAGE || seq->type==SEQ_MOVIE)
seq->flag |= SEQ_MAKE_PREMUL;
}
SEQ_END
@@ -8922,16 +9045,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sce= sce->id.next;
}
}
- if(main->versionfile <= 236) {
+ if (main->versionfile <= 236) {
Object *ob;
Camera *cam= main->camera.first;
Material *ma;
bScreen *sc;
- while(cam) {
- if(cam->ortho_scale==0.0f) {
+ while (cam) {
+ if (cam->ortho_scale==0.0f) {
cam->ortho_scale= 256.0f/cam->lens;
- if(cam->type==CAM_ORTHO) printf("NOTE: ortho render has changed, tweak new Camera 'scale' value.\n");
+ if (cam->type==CAM_ORTHO) printf("NOTE: ortho render has changed, tweak new Camera 'scale' value.\n");
}
cam= cam->id.next;
}
@@ -8943,34 +9066,34 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
for (sa= sc->areabase.first; sa; sa= sa->next) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_VIEW3D) {
+ if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D *)sl;
- if(v3d->twtype==0) v3d->twtype= V3D_MANIP_TRANSLATE;
+ if (v3d->twtype==0) v3d->twtype= V3D_MANIP_TRANSLATE;
}
}
}
}
// init new shader vars
for (ma= main->mat.first; ma; ma= ma->id.next) {
- if(ma->darkness==0.0f) {
+ if (ma->darkness==0.0f) {
ma->rms=0.1f;
ma->darkness=1.0f;
}
}
/* softbody init new vars */
- for(ob= main->object.first; ob; ob= ob->id.next) {
- if(ob->soft) {
- if(ob->soft->defgoal==0.0f) ob->soft->defgoal= 0.7f;
- if(ob->soft->physics_speed==0.0f) ob->soft->physics_speed= 1.0f;
+ for (ob= main->object.first; ob; ob= ob->id.next) {
+ if (ob->soft) {
+ if (ob->soft->defgoal==0.0f) ob->soft->defgoal= 0.7f;
+ if (ob->soft->physics_speed==0.0f) ob->soft->physics_speed= 1.0f;
- if(ob->soft->interval==0) {
+ if (ob->soft->interval==0) {
ob->soft->interval= 2;
ob->soft->sfra= 1;
ob->soft->efra= 100;
}
}
- if(ob->soft && ob->soft->vertgroup==0) {
+ if (ob->soft && ob->soft->vertgroup==0) {
bDeformGroup *locGroup = defgroup_find_name(ob, "SOFTGOAL");
if (locGroup) {
/* retrieve index for that group */
@@ -8979,38 +9102,39 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
- if(main->versionfile <= 237) {
+ if (main->versionfile <= 237) {
bArmature *arm;
bConstraint *con;
Object *ob;
Bone *bone;
// armature recode checks
- for(arm= main->armature.first; arm; arm= arm->id.next) {
+ for (arm= main->armature.first; arm; arm= arm->id.next) {
where_is_armature(arm);
- for(bone= arm->bonebase.first; bone; bone= bone->next)
+ for (bone= arm->bonebase.first; bone; bone= bone->next)
do_version_bone_head_tail_237(bone);
}
- for(ob= main->object.first; ob; ob= ob->id.next) {
- if(ob->parent) {
+ for (ob= main->object.first; ob; ob= ob->id.next) {
+ if (ob->parent) {
Object *parent= newlibadr(fd, lib, ob->parent);
if (parent && parent->type==OB_LATTICE)
ob->partype = PARSKEL;
}
// btw. armature_rebuild_pose is further only called on leave editmode
- if(ob->type==OB_ARMATURE) {
- if(ob->pose)
+ if (ob->type==OB_ARMATURE) {
+ if (ob->pose)
ob->pose->flag |= POSE_RECALC;
ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; // cannot call stuff now (pointers!), done in setup_app_data
/* new generic xray option */
arm= newlibadr(fd, lib, ob->data);
- if(arm->flag & ARM_DRAWXRAY) {
+ if (arm->flag & ARM_DRAWXRAY) {
ob->dtx |= OB_DRAWXRAY;
}
- } else if (ob->type==OB_MESH) {
+ }
+ else if (ob->type==OB_MESH) {
Mesh *me = newlibadr(fd, lib, ob->data);
if ((me->flag&ME_SUBSURF)) {
@@ -9035,20 +9159,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
// follow path constraint needs to set the 'path' option in curves...
- for(con=ob->constraints.first; con; con= con->next) {
- if(con->type==CONSTRAINT_TYPE_FOLLOWPATH) {
+ for (con=ob->constraints.first; con; con= con->next) {
+ if (con->type==CONSTRAINT_TYPE_FOLLOWPATH) {
bFollowPathConstraint *data = con->data;
Object *obc= newlibadr(fd, lib, data->tar);
- if(obc && obc->type==OB_CURVE) {
+ if (obc && obc->type==OB_CURVE) {
Curve *cu= newlibadr(fd, lib, obc->data);
- if(cu) cu->flag |= CU_PATH;
+ if (cu) cu->flag |= CU_PATH;
}
}
}
}
}
- if(main->versionfile <= 238) {
+ if (main->versionfile <= 238) {
Lattice *lt;
Object *ob;
bArmature *arm;
@@ -9056,8 +9180,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Key *key;
Scene *sce= main->scene.first;
- while(sce){
- if(sce->toolsettings == NULL){
+ while (sce) {
+ if (sce->toolsettings == NULL) {
sce->toolsettings = MEM_callocN(sizeof(struct ToolSettings),"Tool Settings Struct");
sce->toolsettings->cornertype=0;
sce->toolsettings->degr = 90;
@@ -9081,7 +9205,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- for(ob=main->object.first; ob; ob= ob->id.next) {
+ for (ob=main->object.first; ob; ob= ob->id.next) {
ModifierData *md;
PartEff *paf;
@@ -9102,23 +9226,24 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(eModifierType_Softbody));
- } else {
+ }
+ else {
BLI_addhead(&ob->modifiers, modifier_new(eModifierType_Softbody));
}
ob->softflag &= ~OB_SB_ENABLE;
}
- if(ob->pose) {
+ if (ob->pose) {
bPoseChannel *pchan;
bConstraint *con;
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
// note, pchan->bone is also lib-link stuff
if (pchan->limitmin[0] == 0.0f && pchan->limitmax[0] == 0.0f) {
pchan->limitmin[0]= pchan->limitmin[1]= pchan->limitmin[2]= -180.0f;
pchan->limitmax[0]= pchan->limitmax[1]= pchan->limitmax[2]= 180.0f;
- for(con= pchan->constraints.first; con; con= con->next) {
- if(con->type == CONSTRAINT_TYPE_KINEMATIC) {
+ for (con= pchan->constraints.first; con; con= con->next) {
+ if (con->type == CONSTRAINT_TYPE_KINEMATIC) {
bKinematicConstraint *data = (bKinematicConstraint*)con->data;
data->weight = 1.0f;
data->orientweight = 1.0f;
@@ -9137,40 +9262,41 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
paf = do_version_give_parteff_245(ob);
if (paf) {
- if(paf->disp == 0)
+ if (paf->disp == 0)
paf->disp = 100;
- if(paf->speedtex == 0)
+ if (paf->speedtex == 0)
paf->speedtex = 8;
- if(paf->omat == 0)
+ if (paf->omat == 0)
paf->omat = 1;
}
}
- for(arm=main->armature.first; arm; arm= arm->id.next) {
+ for (arm=main->armature.first; arm; arm= arm->id.next) {
bone_version_238(&arm->bonebase);
arm->deformflag |= ARM_DEF_VGROUP;
}
- for(me=main->mesh.first; me; me= me->id.next) {
+ for (me=main->mesh.first; me; me= me->id.next) {
if (!me->medge) {
make_edges(me, 1); /* 1 = use mface->edcode */
- } else {
+ }
+ else {
mesh_strip_loose_faces(me);
}
}
- for(key= main->key.first; key; key= key->id.next) {
+ for (key= main->key.first; key; key= key->id.next) {
KeyBlock *kb;
int index= 1;
/* trick to find out if we already introduced adrcode */
- for(kb= key->block.first; kb; kb= kb->next)
- if(kb->adrcode) break;
+ for (kb= key->block.first; kb; kb= kb->next)
+ if (kb->adrcode) break;
- if(kb==NULL) {
- for(kb= key->block.first; kb; kb= kb->next) {
- if(kb==key->refkey) {
- if(kb->name[0]==0)
+ if (kb==NULL) {
+ for (kb= key->block.first; kb; kb= kb->next) {
+ if (kb==key->refkey) {
+ if (kb->name[0]==0)
strcpy(kb->name, "Basis");
}
else {
@@ -9183,7 +9309,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
- if(main->versionfile <= 239) {
+ if (main->versionfile <= 239) {
bArmature *arm;
Object *ob;
Scene *sce= main->scene.first;
@@ -9192,13 +9318,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
int set_passepartout= 0;
/* deformflag is local in modifier now */
- for(ob=main->object.first; ob; ob= ob->id.next) {
+ for (ob=main->object.first; ob; ob= ob->id.next) {
ModifierData *md;
for (md=ob->modifiers.first; md; md=md->next) {
if (md->type==eModifierType_Armature) {
ArmatureModifierData *amd = (ArmatureModifierData*) md;
- if(amd->object && amd->deformflag==0) {
+ if (amd->object && amd->deformflag==0) {
Object *oba= newlibadr(fd, lib, amd->object);
arm= newlibadr(fd, lib, oba->data);
amd->deformflag= arm->deformflag;
@@ -9208,29 +9334,29 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* updating stepsize for ghost drawing */
- for(arm= main->armature.first; arm; arm= arm->id.next) {
+ for (arm= main->armature.first; arm; arm= arm->id.next) {
if (arm->ghostsize==0) arm->ghostsize=1;
bone_version_239(&arm->bonebase);
- if(arm->layer==0) arm->layer= 1;
+ if (arm->layer==0) arm->layer= 1;
}
- for(;sce;sce= sce->id.next) {
+ for (;sce;sce= sce->id.next) {
/* make 'innervert' the default subdivide type, for backwards compat */
sce->toolsettings->cornertype=1;
- if(sce->r.scemode & R_PASSEPARTOUT) {
+ if (sce->r.scemode & R_PASSEPARTOUT) {
set_passepartout= 1;
sce->r.scemode &= ~R_PASSEPARTOUT;
}
/* gauss is filter variable now */
- if(sce->r.mode & R_GAUSS) {
+ if (sce->r.mode & R_GAUSS) {
sce->r.filtertype= R_FILTER_GAUSS;
sce->r.mode &= ~R_GAUSS;
}
}
- for(;cam; cam= cam->id.next) {
- if(set_passepartout)
+ for (;cam; cam= cam->id.next) {
+ if (set_passepartout)
cam->flag |= CAM_SHOWPASSEPARTOUT;
/* make sure old cameras have title safe on */
@@ -9241,16 +9367,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if (!(cam->passepartalpha)) cam->passepartalpha = 0.2f;
}
- for(; ma; ma= ma->id.next) {
- if(ma->strand_sta==0.0f) {
+ for (; ma; ma= ma->id.next) {
+ if (ma->strand_sta==0.0f) {
ma->strand_sta= ma->strand_end= 1.0f;
ma->mode |= MA_TANGENT_STR;
}
- if(ma->mode & MA_TRACEBLE) ma->mode |= MA_SHADBUF;
+ if (ma->mode & MA_TRACEBLE) ma->mode |= MA_SHADBUF;
}
}
- if(main->versionfile <= 241) {
+ if (main->versionfile <= 241) {
Object *ob;
Tex *tex;
Scene *sce;
@@ -9263,37 +9389,37 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
for (wo = main->world.first; wo; wo= wo->id.next) {
/* Migrate to Bullet for games, except for the NaN versions */
/* People can still explicitly choose for Sumo (after 2.42 is out) */
- if(main->versionfile > 225)
+ if (main->versionfile > 225)
wo->physicsEngine = WOPHY_BULLET;
- if(WO_AODIST == wo->aomode)
+ if (WO_AODIST == wo->aomode)
wo->aocolor= WO_AOPLAIN;
}
/* updating layers still */
- for(arm= main->armature.first; arm; arm= arm->id.next) {
+ for (arm= main->armature.first; arm; arm= arm->id.next) {
bone_version_239(&arm->bonebase);
- if(arm->layer==0) arm->layer= 1;
+ if (arm->layer==0) arm->layer= 1;
}
- for(sce= main->scene.first; sce; sce= sce->id.next) {
- if(sce->audio.mixrate==0) sce->audio.mixrate= 44100;
+ for (sce= main->scene.first; sce; sce= sce->id.next) {
+ if (sce->audio.mixrate==0) sce->audio.mixrate= 44100;
- if(sce->r.xparts<2) sce->r.xparts= 4;
- if(sce->r.yparts<2) sce->r.yparts= 4;
+ if (sce->r.xparts<2) sce->r.xparts= 4;
+ if (sce->r.yparts<2) sce->r.yparts= 4;
/* adds default layer */
- if(sce->r.layers.first==NULL)
+ if (sce->r.layers.first==NULL)
scene_add_render_layer(sce, NULL);
else {
SceneRenderLayer *srl;
/* new layer flag for sky, was default for solid */
- for(srl= sce->r.layers.first; srl; srl= srl->next) {
- if(srl->layflag & SCE_LAY_SOLID)
+ for (srl= sce->r.layers.first; srl; srl= srl->next) {
+ if (srl->layflag & SCE_LAY_SOLID)
srl->layflag |= SCE_LAY_SKY;
srl->passflag &= (SCE_PASS_COMBINED|SCE_PASS_Z|SCE_PASS_NORMAL|SCE_PASS_VECTOR);
}
}
/* node version changes */
- if(sce->nodetree)
+ if (sce->nodetree)
ntree_version_241(sce->nodetree);
/* uv calculation options moved to toolsettings */
@@ -9306,13 +9432,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sce->toolsettings->unwrapper = 1;
}
- if(sce->r.mode & R_PANORAMA) {
+ if (sce->r.mode & R_PANORAMA) {
/* all these checks to ensure saved files with svn version keep working... */
- if(sce->r.xsch < sce->r.ysch) {
+ if (sce->r.xsch < sce->r.ysch) {
Object *obc= newlibadr(fd, lib, sce->camera);
- if(obc && obc->type==OB_CAMERA) {
+ if (obc && obc->type==OB_CAMERA) {
Camera *cam= newlibadr(fd, lib, obc->data);
- if(cam->lens>=10.0f) {
+ if (cam->lens>=10.0f) {
sce->r.xsch*= sce->r.xparts;
cam->lens*= (float)sce->r.ysch/(float)sce->r.xsch;
}
@@ -9321,53 +9447,53 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- for(ntree= main->nodetree.first; ntree; ntree= ntree->id.next)
+ for (ntree= main->nodetree.first; ntree; ntree= ntree->id.next)
ntree_version_241(ntree);
- for(la= main->lamp.first; la; la= la->id.next)
- if(la->buffers==0)
+ for (la= main->lamp.first; la; la= la->id.next)
+ if (la->buffers==0)
la->buffers= 1;
- for(tex= main->tex.first; tex; tex= tex->id.next) {
- if(tex->env && tex->env->viewscale==0.0f)
+ for (tex= main->tex.first; tex; tex= tex->id.next) {
+ if (tex->env && tex->env->viewscale==0.0f)
tex->env->viewscale= 1.0f;
// tex->imaflag |= TEX_GAUSS_MIP;
}
/* for empty drawsize and drawtype */
- for(ob=main->object.first; ob; ob= ob->id.next) {
- if(ob->empty_drawsize==0.0f) {
+ for (ob=main->object.first; ob; ob= ob->id.next) {
+ if (ob->empty_drawsize==0.0f) {
ob->empty_drawtype = OB_ARROWS;
ob->empty_drawsize = 1.0;
}
}
- for(ma= main->mat.first; ma; ma= ma->id.next) {
+ for (ma= main->mat.first; ma; ma= ma->id.next) {
/* stucci returns intensity from now on */
int a;
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a] && ma->mtex[a]->tex) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (ma->mtex[a] && ma->mtex[a]->tex) {
tex= newlibadr(fd, lib, ma->mtex[a]->tex);
- if(tex && tex->type==TEX_STUCCI)
+ if (tex && tex->type==TEX_STUCCI)
ma->mtex[a]->mapto &= ~(MAP_COL|MAP_SPEC|MAP_REF);
}
}
/* transmissivity defaults */
- if(ma->tx_falloff==0.0f) ma->tx_falloff= 1.0f;
+ if (ma->tx_falloff==0.0f) ma->tx_falloff= 1.0f;
}
/* during 2.41 images with this name were used for viewer node output, lets fix that */
- if(main->versionfile == 241) {
+ if (main->versionfile == 241) {
Image *ima;
- for(ima= main->image.first; ima; ima= ima->id.next)
- if(strcmp(ima->name, "Compositor")==0) {
+ for (ima= main->image.first; ima; ima= ima->id.next)
+ if (strcmp(ima->name, "Compositor")==0) {
strcpy(ima->id.name+2, "Viewer Node");
strcpy(ima->name, "Viewer Node");
}
}
}
- if(main->versionfile <= 242) {
+ if (main->versionfile <= 242) {
Scene *sce;
bScreen *sc;
Object *ob;
@@ -9381,14 +9507,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
bNodeTree *ntree;
int a;
- for(sc= main->screen.first; sc; sc= sc->id.next) {
+ for (sc= main->screen.first; sc; sc= sc->id.next) {
ScrArea *sa;
sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_VIEW3D) {
+ if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D*) sl;
if (v3d->gridsubdiv == 0)
v3d->gridsubdiv = 10;
@@ -9398,7 +9524,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- for(sce= main->scene.first; sce; sce= sce->id.next) {
+ for (sce= main->scene.first; sce; sce= sce->id.next) {
if (sce->toolsettings->select_thresh == 0.0f)
sce->toolsettings->select_thresh= 0.01f;
if (sce->toolsettings->clean_thresh == 0.0f)
@@ -9410,32 +9536,32 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
else
sce->r.threads= 1;
}
- if(sce->nodetree)
+ if (sce->nodetree)
ntree_version_242(sce->nodetree);
}
- for(ntree= main->nodetree.first; ntree; ntree= ntree->id.next)
+ for (ntree= main->nodetree.first; ntree; ntree= ntree->id.next)
ntree_version_242(ntree);
/* add default radius values to old curve points */
- for(cu= main->curve.first; cu; cu= cu->id.next) {
- for(nu= cu->nurb.first; nu; nu= nu->next) {
+ for (cu= main->curve.first; cu; cu= cu->id.next) {
+ for (nu= cu->nurb.first; nu; nu= nu->next) {
if (nu) {
- if(nu->bezt) {
- for(bezt=nu->bezt, a=0; a<nu->pntsu; a++, bezt++) {
+ if (nu->bezt) {
+ for (bezt=nu->bezt, a=0; a<nu->pntsu; a++, bezt++) {
if (!bezt->radius) bezt->radius= 1.0;
}
}
- else if(nu->bp) {
- for(bp=nu->bp, a=0; a<nu->pntsu*nu->pntsv; a++, bp++) {
- if(!bp->radius) bp->radius= 1.0;
+ else if (nu->bp) {
+ for (bp=nu->bp, a=0; a<nu->pntsu*nu->pntsv; a++, bp++) {
+ if (!bp->radius) bp->radius= 1.0;
}
}
}
}
}
- for(ob = main->object.first; ob; ob= ob->id.next) {
+ for (ob = main->object.first; ob; ob= ob->id.next) {
ModifierData *md;
ListBase *list;
list = &ob->constraints;
@@ -9443,9 +9569,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* check for already existing MinMax (floor) constraint
and update the sticky flagging */
- if (list){
+ if (list) {
bConstraint *curcon;
- for (curcon = list->first; curcon; curcon=curcon->next){
+ for (curcon = list->first; curcon; curcon=curcon->next) {
switch (curcon->type) {
case CONSTRAINT_TYPE_MINMAX:
{
@@ -9461,7 +9587,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
bRotateLikeConstraint *data = curcon->data;
/* version patch from buttons_object.c */
- if(data->flag==0)
+ if (data->flag==0)
data->flag = ROTLIKE_X|ROTLIKE_Y|ROTLIKE_Z;
}
break;
@@ -9470,11 +9596,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
if (ob->type == OB_ARMATURE) {
- if (ob->pose){
+ if (ob->pose) {
bConstraint *curcon;
bPoseChannel *pchan;
- for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next){
- for (curcon = pchan->constraints.first; curcon; curcon=curcon->next){
+ for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) {
+ for (curcon = pchan->constraints.first; curcon; curcon=curcon->next) {
switch (curcon->type) {
case CONSTRAINT_TYPE_MINMAX:
{
@@ -9499,7 +9625,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
bRotateLikeConstraint *data = curcon->data;
/* version patch from buttons_object.c */
- if(data->flag==0)
+ if (data->flag==0)
data->flag = ROTLIKE_X|ROTLIKE_Y|ROTLIKE_Z;
}
break;
@@ -9520,54 +9646,54 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
- for(ma = main->mat.first; ma; ma= ma->id.next) {
- if(ma->shad_alpha==0.0f)
+ for (ma = main->mat.first; ma; ma= ma->id.next) {
+ if (ma->shad_alpha==0.0f)
ma->shad_alpha= 1.0f;
- if(ma->nodetree)
+ if (ma->nodetree)
ntree_version_242(ma->nodetree);
}
- for(me=main->mesh.first; me; me=me->id.next)
+ for (me=main->mesh.first; me; me=me->id.next)
customdata_version_242(me);
- for(group= main->group.first; group; group= group->id.next)
- if(group->layer==0)
+ for (group= main->group.first; group; group= group->id.next)
+ if (group->layer==0)
group->layer= (1<<20)-1;
/* History fix (python?), shape key adrcode numbers have to be sorted */
sort_shape_fix(main);
/* now, subversion control! */
- if(main->subversionfile < 3) {
+ if (main->subversionfile < 3) {
Image *ima;
Tex *tex;
/* Image refactor initialize */
- for(ima= main->image.first; ima; ima= ima->id.next) {
+ for (ima= main->image.first; ima; ima= ima->id.next) {
ima->source= IMA_SRC_FILE;
ima->type= IMA_TYPE_IMAGE;
ima->gen_x= 256; ima->gen_y= 256;
ima->gen_type= 1;
- if(0==strncmp(ima->id.name+2, "Viewer Node", sizeof(ima->id.name)-2)) {
+ if (0==strncmp(ima->id.name+2, "Viewer Node", sizeof(ima->id.name)-2)) {
ima->source= IMA_SRC_VIEWER;
ima->type= IMA_TYPE_COMPOSITE;
}
- if(0==strncmp(ima->id.name+2, "Render Result", sizeof(ima->id.name)-2)) {
+ if (0==strncmp(ima->id.name+2, "Render Result", sizeof(ima->id.name)-2)) {
ima->source= IMA_SRC_VIEWER;
ima->type= IMA_TYPE_R_RESULT;
}
}
- for(tex= main->tex.first; tex; tex= tex->id.next) {
- if(tex->type==TEX_IMAGE && tex->ima) {
+ for (tex= main->tex.first; tex; tex= tex->id.next) {
+ if (tex->type==TEX_IMAGE && tex->ima) {
ima= newlibadr(fd, lib, tex->ima);
- if(tex->imaflag & TEX_ANIM5_)
+ if (tex->imaflag & TEX_ANIM5_)
ima->source= IMA_SRC_MOVIE;
- if(tex->imaflag & TEX_FIELDS_)
+ if (tex->imaflag & TEX_FIELDS_)
ima->flag |= IMA_FIELDS;
- if(tex->imaflag & TEX_STD_FIELD_)
+ if (tex->imaflag & TEX_STD_FIELD_)
ima->flag |= IMA_STD_FIELD;
}
tex->iuser.frames= tex->frames;
@@ -9576,27 +9702,27 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
tex->iuser.sfra= tex->sfra;
tex->iuser.cycl= (tex->imaflag & TEX_ANIMCYCLIC_)!=0;
}
- for(sce= main->scene.first; sce; sce= sce->id.next) {
- if(sce->nodetree)
+ for (sce= main->scene.first; sce; sce= sce->id.next) {
+ if (sce->nodetree)
do_version_ntree_242_2(sce->nodetree);
}
- for(ntree= main->nodetree.first; ntree; ntree= ntree->id.next)
+ for (ntree= main->nodetree.first; ntree; ntree= ntree->id.next)
do_version_ntree_242_2(ntree);
- for(ma = main->mat.first; ma; ma= ma->id.next)
- if(ma->nodetree)
+ for (ma = main->mat.first; ma; ma= ma->id.next)
+ if (ma->nodetree)
do_version_ntree_242_2(ma->nodetree);
- for(sc= main->screen.first; sc; sc= sc->id.next) {
+ for (sc= main->screen.first; sc; sc= sc->id.next) {
ScrArea *sa;
- for(sa= sc->areabase.first; sa; sa= sa->next) {
+ for (sa= sc->areabase.first; sa; sa= sa->next) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_IMAGE)
+ if (sl->spacetype==SPACE_IMAGE)
((SpaceImage *)sl)->iuser.fie_ima= 2;
- else if(sl->spacetype==SPACE_VIEW3D) {
+ else if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D *)sl;
BGpic *bgpic;
- for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next)
+ for (bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next)
bgpic->iuser.fie_ima= 2;
}
}
@@ -9604,8 +9730,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->subversionfile < 4) {
- for(sce= main->scene.first; sce; sce= sce->id.next) {
+ if (main->subversionfile < 4) {
+ for (sce= main->scene.first; sce; sce= sce->id.next) {
sce->r.bake_mode= 1; /* prevent to include render stuff here */
sce->r.bake_filter= 2;
sce->r.bake_osa= 5;
@@ -9613,20 +9739,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(main->subversionfile < 5) {
- for(sce= main->scene.first; sce; sce= sce->id.next) {
+ if (main->subversionfile < 5) {
+ for (sce= main->scene.first; sce; sce= sce->id.next) {
/* improved triangle to quad conversion settings */
- if(sce->toolsettings->jointrilimit==0.0f)
+ if (sce->toolsettings->jointrilimit==0.0f)
sce->toolsettings->jointrilimit= 0.8f;
}
}
}
- if(main->versionfile <= 243) {
+ if (main->versionfile <= 243) {
Object *ob= main->object.first;
Material *ma;
- for(ma=main->mat.first; ma; ma= ma->id.next) {
- if(ma->sss_scale==0.0f) {
+ for (ma=main->mat.first; ma; ma= ma->id.next) {
+ if (ma->sss_scale==0.0f) {
ma->sss_radius[0]= 1.0f;
ma->sss_radius[1]= 1.0f;
ma->sss_radius[2]= 1.0f;
@@ -9639,28 +9765,28 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ma->sss_colfac= 1.0f;
ma->sss_texfac= 0.0f;
}
- if(ma->sss_front==0 && ma->sss_back==0) {
+ if (ma->sss_front==0 && ma->sss_back==0) {
ma->sss_front= 1.0f;
ma->sss_back= 1.0f;
}
- if(ma->sss_col[0]==0 && ma->sss_col[1]==0 && ma->sss_col[2]==0) {
+ if (ma->sss_col[0]==0 && ma->sss_col[1]==0 && ma->sss_col[2]==0) {
ma->sss_col[0]= ma->r;
ma->sss_col[1]= ma->g;
ma->sss_col[2]= ma->b;
}
}
- for(; ob; ob= ob->id.next) {
+ for (; ob; ob= ob->id.next) {
bDeformGroup *curdef;
- for(curdef= ob->defbase.first; curdef; curdef=curdef->next) {
+ for (curdef= ob->defbase.first; curdef; curdef=curdef->next) {
/* replace an empty-string name with unique name */
if (curdef->name[0] == '\0') {
defgroup_unique_name(curdef, ob);
}
}
- if(main->versionfile < 243 || main->subversionfile < 1) {
+ if (main->versionfile < 243 || main->subversionfile < 1) {
ModifierData *md;
/* translate old mirror modifier axis values to new flags */
@@ -9688,40 +9814,40 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* render layer added, this is not the active layer */
- if(main->versionfile <= 243 || main->subversionfile < 2) {
+ if (main->versionfile <= 243 || main->subversionfile < 2) {
Mesh *me;
- for(me=main->mesh.first; me; me=me->id.next)
+ for (me=main->mesh.first; me; me=me->id.next)
customdata_version_243(me);
}
}
- if(main->versionfile <= 244) {
+ if (main->versionfile <= 244) {
Scene *sce;
bScreen *sc;
Lamp *la;
World *wrld;
- if(main->versionfile != 244 || main->subversionfile < 2) {
- for(sce= main->scene.first; sce; sce= sce->id.next)
+ if (main->versionfile != 244 || main->subversionfile < 2) {
+ for (sce= main->scene.first; sce; sce= sce->id.next)
sce->r.mode |= R_SSS;
/* correct older action editors - incorrect scrolling */
- for(sc= main->screen.first; sc; sc= sc->id.next) {
+ for (sc= main->screen.first; sc; sc= sc->id.next) {
ScrArea *sa;
sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_ACTION) {
+ if (sl->spacetype==SPACE_ACTION) {
SpaceAction *saction= (SpaceAction*) sl;
- saction->v2d.tot.ymin= -1000.0;
- saction->v2d.tot.ymax= 0.0;
+ saction->v2d.tot.ymin = -1000.0;
+ saction->v2d.tot.ymax = 0.0;
- saction->v2d.cur.ymin= -75.0;
- saction->v2d.cur.ymax= 5.0;
+ saction->v2d.cur.ymin = -75.0;
+ saction->v2d.cur.ymax = 5.0;
}
}
sa = sa->next;
@@ -9732,7 +9858,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* constraints recode version patch used to be here. Moved to 245 now... */
- for(wrld=main->world.first; wrld; wrld= wrld->id.next) {
+ for (wrld=main->world.first; wrld; wrld= wrld->id.next) {
if (wrld->mode & WO_AMB_OCC)
wrld->ao_samp_method = WO_AOSAMP_CONSTANT;
else
@@ -9741,7 +9867,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
wrld->ao_adapt_thresh = 0.005f;
}
- for(la=main->lamp.first; la; la= la->id.next) {
+ for (la=main->lamp.first; la; la= la->id.next) {
if (la->type == LA_AREA)
la->ray_samp_method = LA_SAMP_CONSTANT;
else
@@ -9751,7 +9877,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
- if(main->versionfile <= 245) {
+ if (main->versionfile <= 245) {
Scene *sce;
Object *ob;
Image *ima;
@@ -9797,7 +9923,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- /* correctly initialise constinv matrix */
+ /* correctly initialize constinv matrix */
unit_m4(ob->constinv);
if (ob->type == OB_ARMATURE) {
@@ -9827,7 +9953,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- /* correctly initialise constinv matrix */
+ /* correctly initialize constinv matrix */
unit_m4(pchan->constinv);
}
}
@@ -9839,19 +9965,19 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if (main->versionfile != 245) {
/* repair preview from 242 - 244*/
- for(ima= main->image.first; ima; ima= ima->id.next) {
+ for (ima= main->image.first; ima; ima= ima->id.next) {
ima->preview = NULL;
}
}
/* add point caches */
- for(ob=main->object.first; ob; ob=ob->id.next) {
- if(ob->soft && !ob->soft->pointcache)
+ for (ob=main->object.first; ob; ob=ob->id.next) {
+ if (ob->soft && !ob->soft->pointcache)
ob->soft->pointcache= BKE_ptcache_add(&ob->soft->ptcaches);
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- if(psys->pointcache) {
- if(psys->pointcache->flag & PTCACHE_BAKED && (psys->pointcache->flag & PTCACHE_DISK_CACHE)==0) {
+ for (psys=ob->particlesystem.first; psys; psys=psys->next) {
+ if (psys->pointcache) {
+ if (psys->pointcache->flag & PTCACHE_BAKED && (psys->pointcache->flag & PTCACHE_DISK_CACHE)==0) {
printf("Old memory cache isn't supported for particles, so re-bake the simulation!\n");
psys->pointcache->flag &= ~PTCACHE_BAKED;
}
@@ -9860,10 +9986,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
psys->pointcache= BKE_ptcache_add(&psys->ptcaches);
}
- for(md=ob->modifiers.first; md; md=md->next) {
- if(md->type==eModifierType_Cloth) {
+ for (md=ob->modifiers.first; md; md=md->next) {
+ if (md->type==eModifierType_Cloth) {
ClothModifierData *clmd = (ClothModifierData*) md;
- if(!clmd->point_cache)
+ if (!clmd->point_cache)
clmd->point_cache= BKE_ptcache_add(&clmd->ptcaches);
}
}
@@ -9871,14 +9997,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* Copy over old per-level multires vertex data
into a single vertex array in struct Multires */
- for(me = main->mesh.first; me; me=me->id.next) {
- if(me->mr && !me->mr->verts) {
+ for (me = main->mesh.first; me; me=me->id.next) {
+ if (me->mr && !me->mr->verts) {
MultiresLevel *lvl = me->mr->levels.last;
- if(lvl) {
+ if (lvl) {
me->mr->verts = lvl->verts;
lvl->verts = NULL;
/* Don't need the other vert arrays */
- for(lvl = lvl->prev; lvl; lvl = lvl->prev) {
+ for (lvl = lvl->prev; lvl; lvl = lvl->prev) {
MEM_freeN(lvl->verts);
lvl->verts = NULL;
}
@@ -9887,7 +10013,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
if (main->versionfile != 245 || main->subversionfile < 1) {
- for(la=main->lamp.first; la; la= la->id.next) {
+ for (la=main->lamp.first; la; la= la->id.next) {
if (la->mode & LA_QUAD) la->falloff_type = LA_FALLOFF_SLIDERS;
else la->falloff_type = LA_FALLOFF_INVLINEAR;
@@ -9898,8 +10024,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- for(ma=main->mat.first; ma; ma= ma->id.next) {
- if(ma->samp_gloss_mir == 0) {
+ for (ma=main->mat.first; ma; ma= ma->id.next) {
+ if (ma->samp_gloss_mir == 0) {
ma->gloss_mir = ma->gloss_tra= 1.0f;
ma->aniso_gloss_mir = 1.0f;
ma->samp_gloss_mir = ma->samp_gloss_tra= 18;
@@ -9908,15 +10034,15 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ma->fadeto_mir = MA_RAYMIR_FADETOSKY;
}
- if(ma->strand_min == 0.0f)
+ if (ma->strand_min == 0.0f)
ma->strand_min= 1.0f;
}
- for(part=main->particle.first; part; part=part->id.next) {
- if(part->ren_child_nbr==0)
+ for (part=main->particle.first; part; part=part->id.next) {
+ if (part->ren_child_nbr==0)
part->ren_child_nbr= part->child_nbr;
- if(part->simplify_refsize==0) {
+ if (part->simplify_refsize==0) {
part->simplify_refsize= 1920;
part->simplify_rate= 1.0f;
part->simplify_transition= 0.1f;
@@ -9924,49 +10050,49 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- for(wrld=main->world.first; wrld; wrld= wrld->id.next) {
- if(wrld->ao_approx_error == 0.0f)
+ for (wrld=main->world.first; wrld; wrld= wrld->id.next) {
+ if (wrld->ao_approx_error == 0.0f)
wrld->ao_approx_error= 0.25f;
}
- for(sce= main->scene.first; sce; sce= sce->id.next) {
- if(sce->nodetree)
+ for (sce= main->scene.first; sce; sce= sce->id.next) {
+ if (sce->nodetree)
ntree_version_245(fd, lib, sce->nodetree);
- if(sce->r.simplify_shadowsamples == 0) {
+ if (sce->r.simplify_shadowsamples == 0) {
sce->r.simplify_subsurf= 6;
sce->r.simplify_particles= 1.0f;
sce->r.simplify_shadowsamples= 16;
sce->r.simplify_aosss= 1.0f;
}
- if(sce->r.cineongamma == 0) {
+ if (sce->r.cineongamma == 0) {
sce->r.cineonblack= 95;
sce->r.cineonwhite= 685;
sce->r.cineongamma= 1.7f;
}
}
- for(ntree=main->nodetree.first; ntree; ntree= ntree->id.next)
+ for (ntree=main->nodetree.first; ntree; ntree= ntree->id.next)
ntree_version_245(fd, lib, ntree);
/* fix for temporary flag changes during 245 cycle */
- for(ima= main->image.first; ima; ima= ima->id.next) {
- if(ima->flag & IMA_OLD_PREMUL) {
+ for (ima= main->image.first; ima; ima= ima->id.next) {
+ if (ima->flag & IMA_OLD_PREMUL) {
ima->flag &= ~IMA_OLD_PREMUL;
ima->flag |= IMA_DO_PREMUL;
}
}
- for(tex=main->tex.first; tex; tex=tex->id.next) {
- if(tex->iuser.flag & IMA_OLD_PREMUL) {
+ for (tex=main->tex.first; tex; tex=tex->id.next) {
+ if (tex->iuser.flag & IMA_OLD_PREMUL) {
tex->iuser.flag &= ~IMA_OLD_PREMUL;
tex->iuser.flag |= IMA_DO_PREMUL;
}
ima= newlibadr(fd, lib, tex->ima);
- if(ima && (tex->iuser.flag & IMA_DO_PREMUL)) {
+ if (ima && (tex->iuser.flag & IMA_DO_PREMUL)) {
ima->flag &= ~IMA_OLD_PREMUL;
ima->flag |= IMA_DO_PREMUL;
}
@@ -9977,7 +10103,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
* */
{
Scene *sce;
- for(sce=main->scene.first; sce; sce = sce->id.next)
+ for (sce=main->scene.first; sce; sce = sce->id.next)
{
if (sce->toolsettings->skgen_subdivisions[0] == sce->toolsettings->skgen_subdivisions[1] ||
sce->toolsettings->skgen_subdivisions[0] == sce->toolsettings->skgen_subdivisions[2] ||
@@ -9995,7 +10121,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Image *ima;
/* initialize 1:1 Aspect */
- for(ima= main->image.first; ima; ima= ima->id.next) {
+ for (ima= main->image.first; ima; ima= ima->id.next) {
ima->aspx = ima->aspy = 1.0f;
}
@@ -10006,23 +10132,23 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ModifierData *md;
Object *ob;
- for(arm= main->armature.first; arm; arm= arm->id.next)
+ for (arm= main->armature.first; arm; arm= arm->id.next)
arm->deformflag |= ARM_DEF_B_BONE_REST;
- for(ob = main->object.first; ob; ob= ob->id.next) {
- for(md=ob->modifiers.first; md; md=md->next) {
- if(md->type==eModifierType_Armature)
+ for (ob = main->object.first; ob; ob= ob->id.next) {
+ for (md=ob->modifiers.first; md; md=md->next) {
+ if (md->type==eModifierType_Armature)
((ArmatureModifierData*)md)->deformflag |= ARM_DEF_B_BONE_REST;
}
}
}
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) {
+ 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;
- sce->r.fg_stamp[3] = 1.0f; /* dont use text alpha yet */
+ sce->r.fg_stamp[3] = 1.0f; /* don't use text alpha yet */
sce->r.bg_stamp[3] = 0.25f; /* make sure the background has full alpha */
}
}
@@ -10031,7 +10157,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 6)) {
Scene *sce;
/* fix frs_sec_base */
- for(sce= main->scene.first; sce; sce= sce->id.next) {
+ for (sce= main->scene.first; sce; sce= sce->id.next) {
if (sce->r.frs_sec_base == 0) {
sce->r.frs_sec_base = 1;
}
@@ -10105,12 +10231,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(ob->soft && ob->soft->keys) {
+ if (ob->soft && ob->soft->keys) {
SoftBody *sb = ob->soft;
int k;
- for(k=0; k<sb->totkey; k++) {
- if(sb->keys[k])
+ for (k=0; k<sb->totkey; k++) {
+ if (sb->keys[k])
MEM_freeN(sb->keys[k]);
}
@@ -10127,13 +10253,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Object *ob;
PartEff *paf=NULL;
- for(ob = main->object.first; ob; ob= ob->id.next) {
- if(ob->soft && ob->soft->keys) {
+ for (ob = main->object.first; ob; ob= ob->id.next) {
+ if (ob->soft && ob->soft->keys) {
SoftBody *sb = ob->soft;
int k;
- for(k=0; k<sb->totkey; k++) {
- if(sb->keys[k])
+ for (k=0; k<sb->totkey; k++) {
+ if (sb->keys[k])
MEM_freeN(sb->keys[k]);
}
@@ -10144,7 +10270,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* convert old particles to new system */
- if((paf = do_version_give_parteff_245(ob))) {
+ if ((paf = do_version_give_parteff_245(ob))) {
ParticleSystem *psys;
ModifierData *md;
ParticleSystemModifierData *psmd;
@@ -10199,8 +10325,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
copy_v3_v3(part->acc, paf->force);
/* flags */
- if(paf->stype & PAF_VECT) {
- if(paf->flag & PAF_STATIC) {
+ if (paf->stype & PAF_VECT) {
+ if (paf->flag & PAF_STATIC) {
/* new hair lifetime is always 100.0f */
float fac = paf->lifetime / 100.0f;
@@ -10233,11 +10359,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
psys->vgroup[PSYS_VG_LENGTH] = paf->vertgroup_v;
/* dupliobjects */
- if(ob->transflag & OB_DUPLIVERTS) {
+ if (ob->transflag & OB_DUPLIVERTS) {
Object *dup = main->object.first;
- for(; dup; dup= dup->id.next) {
- if(ob == newlibadr(fd, lib, dup->parent)) {
+ for (; dup; dup= dup->id.next) {
+ if (ob == newlibadr(fd, lib, dup->parent)) {
part->dup_ob = dup;
ob->transflag |= OB_DUPLIPARTS;
ob->transflag &= ~OB_DUPLIVERTS;
@@ -10253,7 +10379,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
{
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
- if(fluidmd && fluidmd->fss && fluidmd->fss->type == OB_FLUIDSIM_PARTICLE)
+ if (fluidmd && fluidmd->fss && fluidmd->fss->type == OB_FLUIDSIM_PARTICLE)
part->type = PART_FLUID;
}
@@ -10263,18 +10389,18 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- for(sce= main->scene.first; sce; sce=sce->id.next) {
+ for (sce= main->scene.first; sce; sce=sce->id.next) {
ParticleEditSettings *pset= &sce->toolsettings->particle;
int a;
- if(pset->brush[0].size == 0) {
+ if (pset->brush[0].size == 0) {
pset->flag= PE_KEEP_LENGTHS|PE_LOCK_FIRST|PE_DEFLECT_EMITTER;
pset->emitterdist= 0.25f;
pset->totrekey= 5;
pset->totaddkey= 5;
pset->brushtype= PE_BRUSH_NONE;
- for(a=0; a<PE_TOT_BRUSH; a++) {
+ for (a=0; a<PE_TOT_BRUSH; a++) {
pset->brush[a].strength= 50;
pset->brush[a].size= 50;
pset->brush[a].step= 10;
@@ -10288,10 +10414,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Material *ma;
int a;
- for(ma=main->mat.first; ma; ma= ma->id.next)
- if(ma->mode & MA_NORMAP_TANG)
- for(a=0; a<MAX_MTEX; a++)
- if(ma->mtex[a] && ma->mtex[a]->tex)
+ for (ma=main->mat.first; ma; ma= ma->id.next)
+ if (ma->mode & MA_NORMAP_TANG)
+ for (a=0; a<MAX_MTEX; a++)
+ if (ma->mtex[a] && ma->mtex[a]->tex)
ma->mtex[a]->normapspace = MTEX_NSPACE_TANGENT;
}
@@ -10299,7 +10425,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Object *ob;
/* dupliface scale */
- for(ob= main->object.first; ob; ob= ob->id.next)
+ for (ob= main->object.first; ob; ob= ob->id.next)
ob->dupfacesca = 1.0f;
}
@@ -10324,7 +10450,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
strip->scale = length / (repeat * actlength);
if (strip->scale == 0.0f) strip->scale= 1.0f;
}
- if(ob->soft){
+ if (ob->soft) {
ob->soft->inpush = ob->soft->inspring;
ob->soft->shearstiff = 1.0f;
}
@@ -10335,7 +10461,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Scene *sce;
Sequence *seq;
- for(sce=main->scene.first; sce; sce=sce->id.next) {
+ for (sce=main->scene.first; sce; sce=sce->id.next) {
SEQ_BEGIN(sce->ed, seq) {
if (seq->blend_mode == 0)
seq->blend_opacity = 100.0f;
@@ -10375,13 +10501,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* sun/sky */
- if(main->versionfile < 246) {
+ if (main->versionfile < 246) {
Object *ob;
bActuator *act;
/* dRot actuator change direction in 2.46 */
- for(ob = main->object.first; ob; ob= ob->id.next) {
- for(act= ob->actuators.first; act; act= act->next) {
+ for (ob = main->object.first; ob; ob= ob->id.next) {
+ for (act= ob->actuators.first; act; act= act->next) {
if (act->type == ACT_OBJECT) {
bObjectActuator *ba= act->data;
@@ -10394,12 +10520,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
// convert fluids to modifier
- if(main->versionfile < 246 || (main->versionfile == 246 && main->subversionfile < 1))
+ if (main->versionfile < 246 || (main->versionfile == 246 && main->subversionfile < 1))
{
Object *ob;
- for(ob = main->object.first; ob; ob= ob->id.next) {
- if(ob->fluidsimSettings)
+ for (ob = main->object.first; ob; ob= ob->id.next) {
+ if (ob->fluidsimSettings)
{
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifier_new(eModifierType_Fluidsim);
BLI_addhead(&ob->modifiers, (ModifierData *)fluidmd);
@@ -10417,32 +10543,32 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
- if(main->versionfile < 246 || (main->versionfile == 246 && main->subversionfile < 1)) {
+ if (main->versionfile < 246 || (main->versionfile == 246 && main->subversionfile < 1)) {
Mesh *me;
- for(me=main->mesh.first; me; me= me->id.next)
+ for (me=main->mesh.first; me; me= me->id.next)
alphasort_version_246(fd, lib, me);
}
- if(main->versionfile < 246 || (main->versionfile == 246 && main->subversionfile < 1)){
+ if (main->versionfile < 246 || (main->versionfile == 246 && main->subversionfile < 1)) {
Object *ob;
- for(ob = main->object.first; ob; ob= ob->id.next) {
- if(ob->pd && (ob->pd->forcefield == PFIELD_WIND))
+ for (ob = main->object.first; ob; ob= ob->id.next) {
+ if (ob->pd && (ob->pd->forcefield == PFIELD_WIND))
ob->pd->f_noise = 0.0f;
}
}
- if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 2)){
+ if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 2)) {
Object *ob;
- for(ob = main->object.first; ob; ob= ob->id.next) {
+ for (ob = main->object.first; ob; ob= ob->id.next) {
ob->gameflag |= OB_COLLISION;
ob->margin = 0.06f;
}
}
- if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 3)){
+ if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 3)) {
Object *ob;
- for(ob = main->object.first; ob; ob= ob->id.next) {
+ for (ob = main->object.first; ob; ob= ob->id.next) {
// Starting from subversion 3, ACTOR is a separate feature.
// Before it was conditioning all the other dynamic flags
if (!(ob->gameflag & OB_ACTOR))
@@ -10453,7 +10579,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 5)) {
Lamp *la= main->lamp.first;
- for(; la; la= la->id.next) {
+ for (; la; la= la->id.next) {
la->skyblendtype= MA_RAMP_ADD;
la->skyblendfac= 1.0f;
}
@@ -10464,8 +10590,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Curve *cu;
Nurb *nu;
- for(cu= main->curve.first; cu; cu= cu->id.next) {
- for(nu= cu->nurb.first; nu; nu= nu->next) {
+ for (cu= main->curve.first; cu; cu= cu->id.next) {
+ for (nu= cu->nurb.first; nu; nu= nu->next) {
if (nu) {
nu->radius_interp = 3;
@@ -10486,8 +10612,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
bActuator *act;
Object *ob;
- for(ob = main->object.first; ob; ob= ob->id.next) {
- for(act= ob->actuators.first; act; act= act->next) {
+ for (ob = main->object.first; ob; ob= ob->id.next) {
+ for (act= ob->actuators.first; act; act= act->next) {
if (act->type == ACT_CONSTRAINT) {
bConstraintActuator *coa = act->data;
if (coa->type == ACT_CONST_TYPE_DIST) {
@@ -10500,7 +10626,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 9)) {
Lamp *la= main->lamp.first;
- for(; la; la= la->id.next) {
+ for (; la; la= la->id.next) {
la->sky_exposure= 1.0f;
}
}
@@ -10510,14 +10636,15 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
bActuator *act;
Object *ob;
- for(ob = main->object.first; ob; ob= ob->id.next) {
- for(act= ob->actuators.first; act; act= act->next) {
+ for (ob = main->object.first; ob; ob= ob->id.next) {
+ for (act= ob->actuators.first; act; act= act->next) {
if (act->type == ACT_MESSAGE) {
bMessageActuator *msgAct = (bMessageActuator *) act->data;
if (BLI_strnlen(msgAct->toPropName, 3) > 2) {
/* strip first 2 chars, would have only worked if these were OB anyway */
- memmove( msgAct->toPropName, msgAct->toPropName+2, sizeof(msgAct->toPropName)-2 );
- } else {
+ memmove(msgAct->toPropName, msgAct->toPropName + 2, sizeof(msgAct->toPropName) - 2);
+ }
+ else {
msgAct->toPropName[0] = '\0';
}
}
@@ -10528,8 +10655,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if (main->versionfile < 248) {
Lamp *la;
- for(la=main->lamp.first; la; la= la->id.next) {
- if(la->atm_turbidity == 0.0f) {
+ for (la=main->lamp.first; la; la= la->id.next) {
+ if (la->atm_turbidity == 0.0f) {
la->sun_effect_type = 0;
la->horizon_brightness = 1.0f;
la->spread = 1.0f;
@@ -10621,7 +10748,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Object *ob;
/* Adjustments needed after Bullets update */
- for(ob = main->object.first; ob; ob= ob->id.next) {
+ for (ob = main->object.first; ob; ob= ob->id.next) {
ob->damping *= 0.635f;
ob->rdamping = 0.1f + (0.8f * ob->rdamping);
}
@@ -10640,7 +10767,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sce->r.dometilt = 0;
}
/* DBVT culling by default */
- for(wrld=main->world.first; wrld; wrld= wrld->id.next) {
+ for (wrld=main->world.first; wrld; wrld= wrld->id.next) {
wrld->mode |= WO_DBVT_CULLING;
wrld->occlusionRes = 128;
}
@@ -10649,22 +10776,22 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 5)) {
Object *ob;
World *wrld;
- for(ob = main->object.first; ob; ob= ob->id.next) {
+ for (ob = main->object.first; ob; ob= ob->id.next) {
ob->m_contactProcessingThreshold = 1.; //pad3 is used for m_contactProcessingThreshold
- if(ob->parent) {
+ if (ob->parent) {
/* check if top parent has compound shape set and if yes, set this object
- to compound shaper as well (was the behaviour before, now it's optional) */
+ to compound shaper as well (was the behavior before, now it's optional) */
Object *parent= newlibadr(fd, lib, ob->parent);
while (parent && parent != ob && parent->parent != NULL) {
parent = newlibadr(fd, lib, parent->parent);
}
- if(parent) {
+ if (parent) {
if (parent->gameflag & OB_CHILD)
ob->gameflag |= OB_CHILD;
}
}
}
- for(wrld=main->world.first; wrld; wrld= wrld->id.next) {
+ for (wrld=main->world.first; wrld; wrld= wrld->id.next) {
wrld->ticrate = 60;
wrld->maxlogicstep = 5;
wrld->physubstep = 1;
@@ -10675,8 +10802,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
// correct introduce of seed for wind force
if (main->versionfile < 249 && main->subversionfile < 1) {
Object *ob;
- for(ob = main->object.first; ob; ob= ob->id.next) {
- if(ob->pd)
+ for (ob = main->object.first; ob; ob= ob->id.next) {
+ if (ob->pd)
ob->pd->seed = ((unsigned int)(ceil(PIL_check_seconds_timer()))+1) % 128;
}
@@ -10687,11 +10814,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Sequence *seq;
Editing *ed;
- while(sce) {
+ while (sce) {
ed= sce->ed;
- if(ed) {
+ if (ed) {
SEQP_BEGIN(ed, seq) {
- if (seq->strip && seq->strip->proxy){
+ if (seq->strip && seq->strip->proxy) {
seq->strip->proxy->quality =90;
}
}
@@ -10723,20 +10850,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
bActuator *act;
int a;
- for(sound = main->sound.first; sound; sound = sound->id.next)
+ for (sound = main->sound.first; sound; sound = sound->id.next)
{
- if(sound->newpackedfile)
+ if (sound->newpackedfile)
{
sound->packedfile = sound->newpackedfile;
sound->newpackedfile = NULL;
}
}
- for(ob = main->object.first; ob; ob= ob->id.next) {
- for(act= ob->actuators.first; act; act= act->next) {
+ for (ob = main->object.first; ob; ob= ob->id.next) {
+ for (act= ob->actuators.first; act; act= act->next) {
if (act->type == ACT_SOUND) {
bSoundActuator *sAct = (bSoundActuator*) act->data;
- if(sAct->sound)
+ if (sAct->sound)
{
sound = newlibadr(fd, lib, sAct->sound);
sAct->flag = sound->flags & SOUND_FLAGS_3D ? ACT_SND_3D_SOUND : 0;
@@ -10747,8 +10874,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;
@@ -10761,12 +10887,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- for(scene = main->scene.first; scene; scene = scene->id.next)
+ for (scene = main->scene.first; scene; scene = scene->id.next)
{
- if(scene->ed && scene->ed->seqbasep)
+ if (scene->ed && scene->ed->seqbasep)
{
SEQ_BEGIN(scene->ed, seq) {
- if(seq->type == SEQ_HD_SOUND)
+ if (seq->type == SEQ_HD_SOUND)
{
char str[FILE_MAX];
BLI_join_dirfile(str, sizeof(str), seq->strip->dir, seq->strip->stripdata->name);
@@ -10776,7 +10902,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* don't know, if anybody used that
this way, but just in case, upgrade
to new way... */
- if((seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) &&
+ if ((seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) &&
!(seq->flag & SEQ_USE_PROXY_CUSTOM_DIR))
{
@@ -10789,38 +10915,38 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- for(screen= main->screen.first; screen; screen= screen->id.next) {
+ for (screen= main->screen.first; screen; screen= screen->id.next) {
do_versions_windowmanager_2_50(screen);
do_versions_gpencil_2_50(main, screen);
}
- /* shader, composit and texture node trees have id.name empty, put something in
+ /* shader, composite and texture node trees have id.name empty, put something in
* to have them show in RNA viewer and accessible otherwise.
*/
- for(ma= main->mat.first; ma; ma= ma->id.next) {
- if(ma->nodetree && ma->nodetree->id.name[0] == '\0')
+ for (ma= main->mat.first; ma; ma= ma->id.next) {
+ if (ma->nodetree && ma->nodetree->id.name[0] == '\0')
strcpy(ma->nodetree->id.name, "NTShader Nodetree");
/* which_output 0 is now "not specified" */
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a]) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (ma->mtex[a]) {
tx= newlibadr(fd, lib, ma->mtex[a]->tex);
- if(tx && tx->use_nodes)
+ if (tx && tx->use_nodes)
ma->mtex[a]->which_output++;
}
}
}
- /* and composit trees */
- for(sce= main->scene.first; sce; sce= sce->id.next) {
- if(sce->nodetree && sce->nodetree->id.name[0] == '\0')
+ /* and composite trees */
+ for (sce= main->scene.first; sce; sce= sce->id.next) {
+ if (sce->nodetree && sce->nodetree->id.name[0] == '\0')
strcpy(sce->nodetree->id.name, "NTCompositing Nodetree");
/* move to cameras */
- if(sce->r.mode & R_PANORAMA) {
- for(base=sce->base.first; base; base=base->next) {
+ if (sce->r.mode & R_PANORAMA) {
+ for (base=sce->base.first; base; base=base->next) {
ob= newlibadr(fd, lib, base->object);
- if(ob->type == OB_CAMERA && !ob->id.lib) {
+ if (ob->type == OB_CAMERA && !ob->id.lib) {
cam= newlibadr(fd, lib, ob->data);
cam->flag |= CAM_PANORAMA;
}
@@ -10830,33 +10956,33 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
/* and texture trees */
- for(tx= main->tex.first; tx; tx= tx->id.next) {
+ for (tx= main->tex.first; tx; tx= tx->id.next) {
bNode *node;
- if(tx->nodetree) {
- if(tx->nodetree->id.name[0] == '\0')
+ if (tx->nodetree) {
+ if (tx->nodetree->id.name[0] == '\0')
strcpy(tx->nodetree->id.name, "NTTexture Nodetree");
/* which_output 0 is now "not specified" */
- for(node=tx->nodetree->nodes.first; node; node=node->next)
- if(node->type == TEX_NODE_OUTPUT)
+ for (node=tx->nodetree->nodes.first; node; node=node->next)
+ if (node->type == TEX_NODE_OUTPUT)
node->custom1++;
}
}
/* copy standard draw flag to meshes(used to be global, is not available here) */
- for(me= main->mesh.first; me; me= me->id.next) {
+ for (me= main->mesh.first; me; me= me->id.next) {
me->drawflag= ME_DRAWEDGES|ME_DRAWFACES|ME_DRAWCREASES;
}
/* particle draw and render types */
- for(part= main->particle.first; part; part= part->id.next) {
- if(part->draw_as) {
- if(part->draw_as == PART_DRAW_DOT) {
+ for (part= main->particle.first; part; part= part->id.next) {
+ if (part->draw_as) {
+ if (part->draw_as == PART_DRAW_DOT) {
part->ren_as = PART_DRAW_HALO;
part->draw_as = PART_DRAW_REND;
}
- else if(part->draw_as <= PART_DRAW_AXIS) {
+ else if (part->draw_as <= PART_DRAW_AXIS) {
part->ren_as = PART_DRAW_HALO;
}
else {
@@ -10868,21 +10994,21 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
part->clength = 1.0f;
}
/* set old pointcaches to have disk cache flag */
- for(ob = main->object.first; ob; ob= ob->id.next) {
+ for (ob = main->object.first; ob; ob= ob->id.next) {
//BKE_ptcache_ids_from_object(&pidlist, ob);
- //for(pid=pidlist.first; pid; pid=pid->next)
+ //for (pid=pidlist.first; pid; pid=pid->next)
// pid->cache->flag |= PTCACHE_DISK_CACHE;
//BLI_freelistN(&pidlist);
}
/* type was a mixed flag & enum. move the 2d flag elsewhere */
- for(cu = main->curve.first; cu; cu= cu->id.next) {
+ for (cu = main->curve.first; cu; cu= cu->id.next) {
Nurb *nu;
- for(nu= cu->nurb.first; nu; nu= nu->next) {
+ for (nu= cu->nurb.first; nu; nu= nu->next) {
nu->flag |= (nu->type & CU_2D);
nu->type &= CU_TYPE;
}
@@ -10898,57 +11024,57 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
//PTCacheID *pid;
//ListBase pidlist;
- for(ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = main->object.first; ob; ob = ob->id.next) {
//BKE_ptcache_ids_from_object(&pidlist, ob);
- //for(pid=pidlist.first; pid; pid=pid->next) {
- // if(pid->ptcaches->first == NULL)
+ //for (pid=pidlist.first; pid; pid=pid->next) {
+ // if (pid->ptcaches->first == NULL)
// pid->ptcaches->first = pid->ptcaches->last = pid->cache;
//}
//BLI_freelistN(&pidlist);
- if(ob->type == OB_MESH) {
+ if (ob->type == OB_MESH) {
Mesh *me = newlibadr(fd, lib, ob->data);
void *olddata = ob->data;
ob->data = me;
/* XXX - library meshes crash on loading most yoFrankie levels,
* the multires pointer gets invalid - Campbell */
- if(me && me->id.lib==NULL && me->mr && me->mr->level_count > 1) {
+ if (me && me->id.lib==NULL && me->mr && me->mr->level_count > 1) {
multires_load_old(ob, me);
}
ob->data = olddata;
}
- if(ob->totcol && ob->matbits == NULL) {
+ if (ob->totcol && ob->matbits == NULL) {
int a;
ob->matbits= MEM_callocN(sizeof(char)*ob->totcol, "ob->matbits");
- for(a=0; a<ob->totcol; a++)
+ for (a=0; a<ob->totcol; a++)
ob->matbits[a]= ob->colbits & (1<<a);
}
}
/* texture filter */
- for(tex = main->tex.first; tex; tex = tex->id.next) {
- if(tex->afmax == 0)
+ for (tex = main->tex.first; tex; tex = tex->id.next) {
+ if (tex->afmax == 0)
tex->afmax= 8;
}
- for(ma = main->mat.first; ma; ma = ma->id.next) {
+ for (ma = main->mat.first; ma; ma = ma->id.next) {
int a;
- if(ma->mode & MA_WIRE) {
+ if (ma->mode & MA_WIRE) {
ma->material_type= MA_TYPE_WIRE;
ma->mode &= ~MA_WIRE;
}
- if(ma->mode & MA_HALO) {
+ if (ma->mode & MA_HALO) {
ma->material_type= MA_TYPE_HALO;
ma->mode &= ~MA_HALO;
}
- if(ma->mode & (MA_ZTRANSP|MA_RAYTRANSP)) {
+ if (ma->mode & (MA_ZTRANSP|MA_RAYTRANSP)) {
ma->mode |= MA_TRANSP;
}
else {
@@ -10957,15 +11083,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* set new bump for unused slots */
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a]) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (ma->mtex[a]) {
tex= ma->mtex[a]->tex;
- if(!tex) {
+ if (!tex) {
ma->mtex[a]->texflag |= MTEX_3TAP_BUMP;
ma->mtex[a]->texflag |= MTEX_BUMP_OBJECTSPACE;
- } else {
+ }
+ else {
tex= (Tex*)newlibadr(fd, ma->id.lib, tex);
- if(tex && tex->type == 0) { /* invalid type */
+ if (tex && tex->type == 0) { /* invalid type */
ma->mtex[a]->texflag |= MTEX_3TAP_BUMP;
ma->mtex[a]->texflag |= MTEX_BUMP_OBJECTSPACE;
}
@@ -10989,9 +11116,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- for(sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = main->scene.first; sce; sce = sce->id.next) {
ts= sce->toolsettings;
- if(ts->normalsize == 0.0f || !ts->uv_selectmode || ts->vgroup_weight == 0.0f) {
+ if (ts->normalsize == 0.0f || !ts->uv_selectmode || ts->vgroup_weight == 0.0f) {
ts->normalsize= 0.1f;
ts->selectmode= SCE_SELECT_VERTEX;
@@ -11026,11 +11153,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
//Stereo
sce->gm.stereomode = sce->r.stereomode;
/* reassigning stereomode NO_STEREO and DOME to a separeted flag*/
- if (sce->gm.stereomode == 1){ //1 = STEREO_NOSTEREO
+ if (sce->gm.stereomode == 1) { //1 = STEREO_NOSTEREO
sce->gm.stereoflag = STEREO_NOSTEREO;
sce->gm.stereomode = STEREO_ANAGLYPH;
}
- else if(sce->gm.stereomode == 8){ //8 = STEREO_DOME
+ else if (sce->gm.stereomode == 8) { //8 = STEREO_DOME
sce->gm.stereoflag = STEREO_DOME;
sce->gm.stereomode = STEREO_ANAGLYPH;
}
@@ -11060,31 +11187,31 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Scene *sce;
Object *ob;
- for(sce = main->scene.first; sce; sce = sce->id.next) {
- if(fd->fileflags & G_FILE_ENABLE_ALL_FRAMES)
+ for (sce = main->scene.first; sce; sce = sce->id.next) {
+ if (fd->fileflags & G_FILE_ENABLE_ALL_FRAMES)
sce->gm.flag |= GAME_ENABLE_ALL_FRAMES;
- if(fd->fileflags & G_FILE_SHOW_DEBUG_PROPS)
+ if (fd->fileflags & G_FILE_SHOW_DEBUG_PROPS)
sce->gm.flag |= GAME_SHOW_DEBUG_PROPS;
- if(fd->fileflags & G_FILE_SHOW_FRAMERATE)
+ if (fd->fileflags & G_FILE_SHOW_FRAMERATE)
sce->gm.flag |= GAME_SHOW_FRAMERATE;
- if(fd->fileflags & G_FILE_SHOW_PHYSICS)
+ if (fd->fileflags & G_FILE_SHOW_PHYSICS)
sce->gm.flag |= GAME_SHOW_PHYSICS;
- if(fd->fileflags & G_FILE_GLSL_NO_SHADOWS)
+ if (fd->fileflags & G_FILE_GLSL_NO_SHADOWS)
sce->gm.flag |= GAME_GLSL_NO_SHADOWS;
- if(fd->fileflags & G_FILE_GLSL_NO_SHADERS)
+ if (fd->fileflags & G_FILE_GLSL_NO_SHADERS)
sce->gm.flag |= GAME_GLSL_NO_SHADERS;
- if(fd->fileflags & G_FILE_GLSL_NO_RAMPS)
+ if (fd->fileflags & G_FILE_GLSL_NO_RAMPS)
sce->gm.flag |= GAME_GLSL_NO_RAMPS;
- if(fd->fileflags & G_FILE_GLSL_NO_NODES)
+ if (fd->fileflags & G_FILE_GLSL_NO_NODES)
sce->gm.flag |= GAME_GLSL_NO_NODES;
- if(fd->fileflags & G_FILE_GLSL_NO_EXTRA_TEX)
+ if (fd->fileflags & G_FILE_GLSL_NO_EXTRA_TEX)
sce->gm.flag |= GAME_GLSL_NO_EXTRA_TEX;
- if(fd->fileflags & G_FILE_IGNORE_DEPRECATION_WARNINGS)
+ if (fd->fileflags & G_FILE_IGNORE_DEPRECATION_WARNINGS)
sce->gm.flag |= GAME_IGNORE_DEPRECATION_WARNINGS;
- if(fd->fileflags & G_FILE_GAME_MAT_GLSL)
+ if (fd->fileflags & G_FILE_GAME_MAT_GLSL)
sce->gm.matmode= GAME_MAT_GLSL;
- else if(fd->fileflags & G_FILE_GAME_MAT)
+ else if (fd->fileflags & G_FILE_GAME_MAT)
sce->gm.matmode= GAME_MAT_MULTITEX;
else
sce->gm.matmode= GAME_MAT_TEXFACE;
@@ -11092,8 +11219,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sce->gm.flag |= GAME_DISPLAY_LISTS;
}
- for(ob = main->object.first; ob; ob = ob->id.next) {
- if(ob->flag & 8192) // OB_POSEMODE = 8192
+ for (ob = main->object.first; ob; ob = ob->id.next) {
+ if (ob->flag & 8192) // OB_POSEMODE = 8192
ob->mode |= OB_MODE_POSE;
}
}
@@ -11108,11 +11235,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ParticleSettings *part;
int do_gravity = 0;
- for(sce = main->scene.first; sce; sce = sce->id.next)
- if(sce->unit.scale_length == 0.0f)
+ for (sce = main->scene.first; sce; sce = sce->id.next)
+ if (sce->unit.scale_length == 0.0f)
sce->unit.scale_length= 1.0f;
- for(ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = main->object.first; ob; ob = ob->id.next) {
/* fluid-sim stuff */
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
if (fluidmd) fluidmd->fss->fmd = fluidmd;
@@ -11121,8 +11248,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ob->rotmode= ROT_MODE_EUL;
}
- for(ma = main->mat.first; ma; ma=ma->id.next) {
- if(ma->vol.reflection == 0.f) {
+ for (ma = main->mat.first; ma; ma=ma->id.next) {
+ if (ma->vol.reflection == 0.f) {
ma->vol.reflection = 1.f;
ma->vol.transmission_col[0] = ma->vol.transmission_col[1] = ma->vol.transmission_col[2] = 1.0f;
ma->vol.reflection_col[0] = ma->vol.reflection_col[1] = ma->vol.reflection_col[2] = 1.0f;
@@ -11131,20 +11258,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
do_version_mtex_factor_2_50(ma->mtex, ID_MA);
}
- for(la = main->lamp.first; la; la=la->id.next)
+ for (la = main->lamp.first; la; la=la->id.next)
do_version_mtex_factor_2_50(la->mtex, ID_LA);
- for(wo = main->world.first; wo; wo=wo->id.next)
+ for (wo = main->world.first; wo; wo=wo->id.next)
do_version_mtex_factor_2_50(wo->mtex, ID_WO);
- for(tex = main->tex.first; tex; tex=tex->id.next)
- if(tex->vd)
- if(tex->vd->extend == 0)
+ for (tex = main->tex.first; tex; tex=tex->id.next)
+ if (tex->vd)
+ if (tex->vd->extend == 0)
tex->vd->extend = TEX_CLIP;
- for(sce= main->scene.first; sce; sce= sce->id.next)
+ for (sce= main->scene.first; sce; sce= sce->id.next)
{
- if(sce->audio.main == 0.0f)
+ if (sce->audio.main == 0.0f)
sce->audio.main = 1.0f;
sce->r.ffcodecdata.audio_mixrate = sce->audio.mixrate;
@@ -11155,8 +11282,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* Add default gravity to scenes */
- for(sce= main->scene.first; sce; sce= sce->id.next) {
- if((sce->physics_settings.flag & PHYS_GLOBAL_GRAVITY) == 0
+ for (sce= main->scene.first; sce; sce= sce->id.next) {
+ if ((sce->physics_settings.flag & PHYS_GLOBAL_GRAVITY) == 0
&& len_v3(sce->physics_settings.gravity) == 0.0f) {
sce->physics_settings.gravity[0] = sce->physics_settings.gravity[1] = 0.0f;
@@ -11167,31 +11294,31 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* Assign proper global gravity weights for dynamics (only z-coordinate is taken into account) */
- if(do_gravity) for(part= main->particle.first; part; part= part->id.next)
+ if (do_gravity) for (part= main->particle.first; part; part= part->id.next)
part->effector_weights->global_gravity = part->acc[2]/-9.81f;
- for(ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = main->object.first; ob; ob = ob->id.next) {
ModifierData *md;
- if(do_gravity) {
- for(md= ob->modifiers.first; md; md= md->next) {
+ if (do_gravity) {
+ for (md= ob->modifiers.first; md; md= md->next) {
ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
- if(clmd)
+ if (clmd)
clmd->sim_parms->effector_weights->global_gravity = clmd->sim_parms->gravity[2]/-9.81f;
}
- if(ob->soft)
+ if (ob->soft)
ob->soft->effector_weights->global_gravity = ob->soft->grav/9.81f;
}
/* Normal wind shape is plane */
- if(ob->pd) {
- if(ob->pd->forcefield == PFIELD_WIND)
+ if (ob->pd) {
+ if (ob->pd->forcefield == PFIELD_WIND)
ob->pd->shape = PFIELD_SHAPE_PLANE;
- if(ob->pd->flag & PFIELD_PLANAR)
+ if (ob->pd->flag & PFIELD_PLANAR)
ob->pd->shape = PFIELD_SHAPE_PLANE;
- else if(ob->pd->flag & PFIELD_SURFACE)
+ else if (ob->pd->flag & PFIELD_SURFACE)
ob->pd->shape = PFIELD_SHAPE_SURFACE;
ob->pd->flag |= PFIELD_DO_LOCATION;
@@ -11203,7 +11330,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Object *ob;
Lamp *la;
- /* New variables for axis-angle rotations and/or quaternion rotations were added, and need proper initialisation */
+ /* New variables for axis-angle rotations and/or quaternion rotations were added, and need proper initialization */
for (ob= main->object.first; ob; ob= ob->id.next) {
/* new variables for all objects */
ob->quat[0]= 1.0f;
@@ -11220,7 +11347,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- for(la = main->lamp.first; la; la=la->id.next)
+ for (la = main->lamp.first; la; la=la->id.next)
la->compressthresh= 0.05f;
}
@@ -11237,45 +11364,45 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
to the derivedmesh/displist, so here we ensure that the basis
shape key is always set in the mesh coordinates. */
- for(me= main->mesh.first; me; me= me->id.next) {
- if((key = newlibadr(fd, lib, me->key)) && key->refkey) {
+ for (me= main->mesh.first; me; me= me->id.next) {
+ if ((key = newlibadr(fd, lib, me->key)) && key->refkey) {
data= key->refkey->data;
tot= MIN2(me->totvert, key->refkey->totelem);
- for(a=0; a<tot; a++, data+=3)
+ for (a=0; a<tot; a++, data+=3)
copy_v3_v3(me->mvert[a].co, data);
}
}
- for(lt= main->latt.first; lt; lt= lt->id.next) {
- if((key = newlibadr(fd, lib, lt->key)) && key->refkey) {
+ for (lt= main->latt.first; lt; lt= lt->id.next) {
+ if ((key = newlibadr(fd, lib, lt->key)) && key->refkey) {
data= key->refkey->data;
tot= MIN2(lt->pntsu*lt->pntsv*lt->pntsw, key->refkey->totelem);
- for(a=0; a<tot; a++, data+=3)
+ for (a=0; a<tot; a++, data+=3)
copy_v3_v3(lt->def[a].vec, data);
}
}
- for(cu= main->curve.first; cu; cu= cu->id.next) {
- if((key = newlibadr(fd, lib, cu->key)) && key->refkey) {
+ for (cu= main->curve.first; cu; cu= cu->id.next) {
+ if ((key = newlibadr(fd, lib, cu->key)) && key->refkey) {
data= key->refkey->data;
- for(nu=cu->nurb.first; nu; nu=nu->next) {
- if(nu->bezt) {
+ for (nu=cu->nurb.first; nu; nu=nu->next) {
+ if (nu->bezt) {
BezTriple *bezt = nu->bezt;
- for(a=0; a<nu->pntsu; a++, bezt++) {
+ for (a=0; a<nu->pntsu; a++, bezt++) {
copy_v3_v3(bezt->vec[0], data); data+=3;
copy_v3_v3(bezt->vec[1], data); data+=3;
copy_v3_v3(bezt->vec[2], data); data+=3;
bezt->alfa= *data; data++;
}
}
- else if(nu->bp) {
+ else if (nu->bp) {
BPoint *bp = nu->bp;
- for(a=0; a<nu->pntsu*nu->pntsv; a++, bp++) {
+ for (a=0; a<nu->pntsu*nu->pntsv; a++, bp++) {
copy_v3_v3(bp->vec, data); data+=3;
bp->alfa= *data; data++;
}
@@ -11289,8 +11416,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
{
{
Scene *sce= main->scene.first;
- while(sce) {
- if(sce->r.frame_step==0)
+ while (sce) {
+ if (sce->r.frame_step==0)
sce->r.frame_step= 1;
if (sce->r.mblur_samples==0)
sce->r.mblur_samples = sce->r.osa;
@@ -11306,10 +11433,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* ensure all nodes have unique names */
bNodeTree *ntree= main->nodetree.first;
- while(ntree) {
+ while (ntree) {
bNode *node=ntree->nodes.first;
- while(node) {
+ while (node) {
nodeUniqueName(ntree, node);
node= node->next;
}
@@ -11331,10 +11458,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ScrArea *sa;
SpaceLink *sl;
- for(screen= main->screen.first; screen; screen= screen->id.next) {
- for(sa= screen->areabase.first; sa; sa= sa->next) {
- for(sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_VIEW3D) {
+ for (screen= main->screen.first; screen; screen= screen->id.next) {
+ for (sa= screen->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 (v3d->drawtype == OB_MATERIAL) v3d->drawtype = OB_SOLID;
}
@@ -11358,13 +11485,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* don't know what scene is active, so we'll convert if any scene has it enabled... */
while (sce) {
- if(sce->r.color_mgt_flag & R_COLOR_MANAGEMENT)
+ if (sce->r.color_mgt_flag & R_COLOR_MANAGEMENT)
convert=1;
sce=sce->id.next;
}
if (convert) {
- while(ma) {
+ while (ma) {
if (ma->ramp_col) {
ColorBand *band = (ColorBand *)ma->ramp_col;
for (i=0; i<band->tot; i++) {
@@ -11387,7 +11514,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ma=ma->id.next;
}
- while(tex) {
+ while (tex) {
if (tex->coba) {
ColorBand *band = (ColorBand *)tex->coba;
for (i=0; i<band->tot; i++) {
@@ -11398,7 +11525,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
tex=tex->id.next;
}
- while(wo) {
+ while (wo) {
srgb_to_linearrgb_v3_v3(&wo->ambr, &wo->ambr);
srgb_to_linearrgb_v3_v3(&wo->horr, &wo->horr);
srgb_to_linearrgb_v3_v3(&wo->zenr, &wo->zenr);
@@ -11414,18 +11541,18 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Mesh *me;
Object *ob;
- for(sce=main->scene.first; sce; sce=sce->id.next)
- if(!sce->toolsettings->particle.selectmode)
+ for (sce=main->scene.first; sce; sce=sce->id.next)
+ if (!sce->toolsettings->particle.selectmode)
sce->toolsettings->particle.selectmode= SCE_SELECT_PATH;
if (main->versionfile == 250 && main->subversionfile > 1) {
- for(me=main->mesh.first; me; me=me->id.next)
+ for (me=main->mesh.first; me; me=me->id.next)
multires_load_old_250(me);
- for(ob=main->object.first; ob; ob=ob->id.next) {
+ for (ob=main->object.first; ob; ob=ob->id.next) {
MultiresModifierData *mmd = (MultiresModifierData *)modifiers_findByType(ob, eModifierType_Multires);
- if(mmd) {
+ if (mmd) {
mmd->totlvl--;
mmd->lvl--;
mmd->sculptlvl= mmd->lvl;
@@ -11439,10 +11566,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
{
Object *ob;
- /* properly initialise hair clothsim data on old files */
- for(ob = main->object.first; ob; ob = ob->id.next) {
+ /* properly initialize hair clothsim data on old files */
+ for (ob = main->object.first; ob; ob = ob->id.next) {
ModifierData *md;
- for(md= ob->modifiers.first; md; md= md->next) {
+ for (md= ob->modifiers.first; md; md= md->next) {
if (md->type == eModifierType_Cloth) {
ClothModifierData *clmd = (ClothModifierData *)md;
if (clmd->sim_parms->velocity_smooth < 0.01f)
@@ -11462,21 +11589,22 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* remove all preview window in wrong spaces */
- for(screen= main->screen.first; screen; screen= screen->id.next) {
- for(sa= screen->areabase.first; sa; sa= sa->next) {
- for(sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype!=SPACE_SEQ) {
+ for (screen= main->screen.first; screen; screen= screen->id.next) {
+ for (sa= screen->areabase.first; sa; sa= sa->next) {
+ for (sl= sa->spacedata.first; sl; sl= sl->next) {
+ if (sl->spacetype!=SPACE_SEQ) {
ARegion *ar;
ListBase *regionbase;
if (sl == sa->spacedata.first) {
regionbase = &sa->regionbase;
- } else {
+ }
+ else {
regionbase = &sl->regionbase;
}
- for( ar = regionbase->first; ar; ar = ar->next) {
+ for ( ar = regionbase->first; ar; ar = ar->next) {
if (ar->regiontype == RGN_TYPE_PREVIEW)
break;
}
@@ -11501,10 +11629,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
SpaceLink *sl;
- for(screen= main->screen.first; screen; screen= screen->id.next) {
- for(sa= screen->areabase.first; sa; sa= sa->next) {
- for(sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_SEQ) {
+ for (screen= main->screen.first; screen; screen= screen->id.next) {
+ for (sa= screen->areabase.first; sa; sa= sa->next) {
+ for (sl= sa->spacedata.first; sl; sl= sl->next) {
+ if (sl->spacetype==SPACE_SEQ) {
ARegion *ar;
ARegion *ar_main;
ListBase *regionbase;
@@ -11512,7 +11640,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if (sl == sa->spacedata.first) {
regionbase = &sa->regionbase;
- } else {
+ }
+ else {
regionbase = &sl->regionbase;
}
@@ -11542,21 +11671,21 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Material *ma;
/* game engine changes */
- for(sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = main->scene.first; sce; sce = sce->id.next) {
sce->gm.eyeseparation = 0.10f;
}
/* anim viz changes */
for (ob= main->object.first; ob; ob= ob->id.next) {
- /* initialise object defaults */
+ /* initialize object defaults */
animviz_settings_init(&ob->avs);
/* if armature, copy settings for pose from armature data
- * performing initialisation where appropriate
+ * performing initialization where appropriate
*/
if (ob->pose && ob->data) {
bArmature *arm= newlibadr(fd, lib, ob->data);
- if(arm) { /* XXX - why does this fail in some cases? */
+ if (arm) { /* XXX - why does this fail in some cases? */
bAnimVizSettings *avs= &ob->pose->avs;
/* ghosting settings ---------------- */
@@ -11681,8 +11810,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if (ELEM(sl->spacetype, SPACE_ACTION, SPACE_NLA)) {
for (ar = (ARegion*)regionbase->first; ar; ar = ar->next) {
if (ar->regiontype == RGN_TYPE_WINDOW) {
- ar->v2d.cur.ymax= ar->v2d.tot.ymax= 0.0f;
- ar->v2d.cur.ymin= ar->v2d.tot.ymin= (float)(-sa->winy) / 3.0f;
+ ar->v2d.cur.ymax = ar->v2d.tot.ymax = 0.0f;
+ ar->v2d.cur.ymin = ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f;
}
}
}
@@ -11696,22 +11825,22 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Material *ma;
/* ambient default from 0.5f to 1.0f */
- for(ma= main->mat.first; ma; ma=ma->id.next)
+ for (ma= main->mat.first; ma; ma=ma->id.next)
ma->amb *= 2.0f;
- for(wo= main->world.first; wo; wo=wo->id.next) {
+ for (wo= main->world.first; wo; wo=wo->id.next) {
/* ao splitting into ao/env/indirect */
wo->ao_env_energy= wo->aoenergy;
wo->aoenergy= 1.0f;
- if(wo->ao_indirect_bounces == 0)
+ if (wo->ao_indirect_bounces == 0)
wo->ao_indirect_bounces= 1;
else
wo->mode |= WO_INDIRECT_LIGHT;
- if(wo->aomix == WO_AOSUB)
+ if (wo->aomix == WO_AOSUB)
wo->ao_env_energy= -wo->ao_env_energy;
- else if(wo->aomix == WO_AOADDSUB)
+ else if (wo->aomix == WO_AOADDSUB)
wo->mode |= WO_AMB_OCC;
wo->aomix= WO_AOMUL;
@@ -11728,16 +11857,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Material *ma;
/* initialize to sane default so toggling on border shows something */
- for(sce = main->scene.first; sce; sce = sce->id.next) {
- if(sce->r.border.xmin == 0.0f && sce->r.border.ymin == 0.0f &&
+ for (sce = main->scene.first; sce; sce = sce->id.next) {
+ if (sce->r.border.xmin == 0.0f && sce->r.border.ymin == 0.0f &&
sce->r.border.xmax == 0.0f && sce->r.border.ymax == 0.0f) {
- sce->r.border.xmin= 0.0f;
- sce->r.border.ymin= 0.0f;
- sce->r.border.xmax= 1.0f;
- sce->r.border.ymax= 1.0f;
+ sce->r.border.xmin = 0.0f;
+ sce->r.border.ymin = 0.0f;
+ sce->r.border.xmax = 1.0f;
+ sce->r.border.ymax = 1.0f;
}
- if((sce->r.ffcodecdata.flags & FFMPEG_MULTIPLEX_AUDIO) == 0)
+ if ((sce->r.ffcodecdata.flags & FFMPEG_MULTIPLEX_AUDIO) == 0)
sce->r.ffcodecdata.audio_codec = 0x0; // CODEC_ID_NONE
SEQ_BEGIN(sce->ed, seq) {
@@ -11747,16 +11876,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* particle brush strength factor was changed from int to float */
- for(sce= main->scene.first; sce; sce=sce->id.next) {
+ for (sce= main->scene.first; sce; sce=sce->id.next) {
ParticleEditSettings *pset= &sce->toolsettings->particle;
int a;
- for(a=0; a<PE_TOT_BRUSH; a++)
+ for (a=0; a<PE_TOT_BRUSH; a++)
pset->brush[a].strength /= 100.0f;
}
- for(ma = main->mat.first; ma; ma=ma->id.next)
- if(ma->mode & MA_TRACEBLE)
+ for (ma = main->mat.first; ma; ma=ma->id.next)
+ if (ma->mode & MA_TRACEBLE)
ma->shade_flag |= MA_APPROX_OCCLUSION;
/* sequencer changes */
@@ -11765,16 +11894,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ScrArea *sa;
SpaceLink *sl;
- for(screen= main->screen.first; screen; screen= screen->id.next) {
- for(sa= screen->areabase.first; sa; sa= sa->next) {
- for(sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_SEQ) {
+ for (screen= main->screen.first; screen; screen= screen->id.next) {
+ for (sa= screen->areabase.first; sa; sa= sa->next) {
+ for (sl= sa->spacedata.first; sl; sl= sl->next) {
+ if (sl->spacetype==SPACE_SEQ) {
ARegion *ar_preview;
ListBase *regionbase;
if (sl == sa->spacedata.first) {
regionbase = &sa->regionbase;
- } else {
+ }
+ else {
regionbase = &sl->regionbase;
}
@@ -11800,12 +11930,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
* This bit was used in the past for V3D_TRANSFORM_SNAP, which is now deprecated.
* Here we clear it for old files so they don't come in with V3D_RENDER_OVERRIDE set,
* which would cause cameras, lamps, etc to become invisible */
- for(sc= main->screen.first; sc; sc= sc->id.next) {
+ for (sc= main->screen.first; sc; sc= sc->id.next) {
ScrArea *sa;
- for(sa= sc->areabase.first; sa; sa= sa->next) {
+ for (sa= sc->areabase.first; sa; sa= sa->next) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_VIEW3D) {
+ if (sl->spacetype==SPACE_VIEW3D) {
View3D* v3d = (View3D *)sl;
v3d->flag2 &= ~V3D_RENDER_OVERRIDE;
}
@@ -11824,10 +11954,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if (brush->curve) brush->curve->preset = CURVE_PRESET_SMOOTH;
}
- /* properly initialise active flag for fluidsim modifiers */
- for(ob = main->object.first; ob; ob = ob->id.next) {
+ /* properly initialize active flag for fluidsim modifiers */
+ for (ob = main->object.first; ob; ob = ob->id.next) {
ModifierData *md;
- for(md= ob->modifiers.first; md; md= md->next) {
+ for (md= ob->modifiers.first; md; md= md->next) {
if (md->type == eModifierType_Fluidsim) {
FluidsimModifierData *fmd = (FluidsimModifierData *)md;
fmd->fss->flag |= OB_FLUIDSIM_ACTIVE;
@@ -11837,11 +11967,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* adjustment to color balance node values */
- for(scene= main->scene.first; scene; scene= scene->id.next) {
- if(scene->nodetree) {
+ for (scene= main->scene.first; scene; scene= scene->id.next) {
+ if (scene->nodetree) {
bNode *node=scene->nodetree->nodes.first;
- while(node) {
+ while (node) {
if (node->type == CMP_NODE_COLORBALANCE) {
NodeColorBalance *n= (NodeColorBalance *)node->storage;
n->lift[0] += 1.f;
@@ -11856,7 +11986,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
for (ntree= main->nodetree.first; ntree; ntree=ntree->id.next) {
bNode *node=ntree->nodes.first;
- while(node) {
+ while (node) {
if (node->type == CMP_NODE_COLORBALANCE) {
NodeColorBalance *n= (NodeColorBalance *)node->storage;
n->lift[0] += 1.f;
@@ -11880,12 +12010,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
bScreen *sc;
/* Image editor scopes */
- for(sc= main->screen.first; sc; sc= sc->id.next) {
+ for (sc= main->screen.first; sc; sc= sc->id.next) {
ScrArea *sa;
- for(sa= sc->areabase.first; sa; sa= sa->next) {
+ for (sa= sc->areabase.first; sa; sa= sa->next) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_IMAGE) {
+ if (sl->spacetype==SPACE_IMAGE) {
SpaceImage *sima = (SpaceImage *)sl;
scopes_new(&sima->scopes);
}
@@ -11947,11 +12077,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
do_version_mdef_250(main);
/* parent type to modifier */
- for(ob = main->object.first; ob; ob = ob->id.next) {
- if(ob->parent) {
+ for (ob = main->object.first; ob; ob = ob->id.next) {
+ if (ob->parent) {
Object *parent= (Object *)newlibadr(fd, lib, ob->parent);
- if(parent) { /* parent may not be in group */
- if(parent->type==OB_ARMATURE && ob->partype==PARSKEL) {
+ if (parent) { /* parent may not be in group */
+ if (parent->type==OB_ARMATURE && ob->partype==PARSKEL) {
ArmatureModifierData *amd;
bArmature *arm= (bArmature *)newlibadr(fd, lib, parent->data);
@@ -11961,7 +12091,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
amd->deformflag= arm->deformflag;
ob->partype = PAROBJECT;
}
- else if(parent->type==OB_LATTICE && ob->partype==PARSKEL) {
+ else if (parent->type==OB_LATTICE && ob->partype==PARSKEL) {
LatticeModifierData *lmd;
lmd = (LatticeModifierData*) modifier_new(eModifierType_Lattice);
@@ -11969,7 +12099,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
BLI_addtail((ListBase*)&ob->modifiers, lmd);
ob->partype = PAROBJECT;
}
- else if(parent->type==OB_CURVE && ob->partype==PARCURVE) {
+ else if (parent->type==OB_CURVE && ob->partype==PARCURVE) {
CurveModifierData *cmd;
cmd = (CurveModifierData*) modifier_new(eModifierType_Curve);
@@ -11981,36 +12111,36 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- /* initialise scene active layer */
+ /* initialize scene active layer */
for (scene= main->scene.first; scene; scene=scene->id.next) {
int i;
- for(i=0; i<20; i++) {
- if(scene->lay & (1<<i)) {
+ for (i=0; i<20; i++) {
+ if (scene->lay & (1<<i)) {
scene->layact= 1<<i;
break;
}
}
}
- for(tex= main->tex.first; tex; tex= tex->id.next) {
+ for (tex= main->tex.first; tex; tex= tex->id.next) {
/* if youre picky, this isn't correct until we do a version bump
* since you could set saturation to be 0.0*/
- if(tex->saturation==0.0f)
+ if (tex->saturation==0.0f)
tex->saturation= 1.0f;
}
{
Curve *cu;
- for(cu= main->curve.first; cu; cu= cu->id.next) {
+ for (cu= main->curve.first; cu; cu= cu->id.next) {
cu->smallcaps_scale= 0.75f;
}
}
for (scene= main->scene.first; scene; scene=scene->id.next) {
- if(scene) {
+ if (scene) {
Sequence *seq;
SEQ_BEGIN(scene->ed, seq) {
- if(seq->sat==0.0f) {
+ if (seq->sat==0.0f) {
seq->sat= 1.0f;
}
}
@@ -12111,18 +12241,18 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
{
Object *ob;
- for(ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = main->object.first; ob; ob = ob->id.next) {
ModifierData *md;
- for(md= ob->modifiers.first; md; md= md->next) {
+ for (md= ob->modifiers.first; md; md= md->next) {
if (md->type == eModifierType_Smoke) {
SmokeModifierData *smd = (SmokeModifierData *)md;
- if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
+ if ((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
{
smd->domain->vorticity = 2.0f;
smd->domain->time_scale = 1.0f;
- if(!(smd->domain->flags & (1<<4)))
+ if (!(smd->domain->flags & (1<<4)))
continue;
/* delete old MOD_SMOKE_INITVELOCITY flag */
@@ -12131,13 +12261,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* for now just add it to all flow objects in the scene */
{
Object *ob2;
- for(ob2 = main->object.first; ob2; ob2 = ob2->id.next) {
+ for (ob2 = main->object.first; ob2; ob2 = ob2->id.next) {
ModifierData *md2;
- for(md2= ob2->modifiers.first; md2; md2= md2->next) {
+ for (md2= ob2->modifiers.first; md2; md2= md2->next) {
if (md2->type == eModifierType_Smoke) {
SmokeModifierData *smd2 = (SmokeModifierData *)md2;
- if((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow)
+ if ((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow)
{
smd2->flow->flags |= MOD_SMOKE_FLOW_INITVELOCITY;
}
@@ -12147,8 +12277,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;
}
@@ -12163,13 +12292,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
bScreen *sc;
Object *ob;
- for(br= main->brush.first; br; br= br->id.next) {
- if(br->ob_mode==0)
+ for (br= main->brush.first; br; br= br->id.next) {
+ if (br->ob_mode==0)
br->ob_mode= OB_MODE_ALL_PAINT;
}
- for(part = main->particle.first; part; part = part->id.next) {
- if(part->boids)
+ for (part = main->particle.first; part; part = part->id.next) {
+ if (part->boids)
part->boids->pitch = 1.0f;
part->flag &= ~PART_HAIR_REGROW; /* this was a deprecated flag before */
@@ -12204,9 +12333,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* fix rotation actuators for objects so they use real angles (radians)
* since before blender went opensource this strange scalar was used: (1 / 0.02) * 2 * math.pi/360 */
- for(ob= main->object.first; ob; ob= ob->id.next) {
+ for (ob= main->object.first; ob; ob= ob->id.next) {
bActuator *act= ob->actuators.first;
- while(act) {
+ while (act) {
if (act->type==ACT_OBJECT) {
/* multiply velocity with 50 in old files */
bObjectActuator *oa= act->data;
@@ -12220,10 +12349,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
// init facing axis property of steering actuators
{
Object *ob;
- for(ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = main->object.first; ob; ob = ob->id.next) {
bActuator *act;
- for(act= ob->actuators.first; act; act= act->next) {
- if(act->type==ACT_STEERING) {
+ for (act= ob->actuators.first; act; act= act->next) {
+ if (act->type==ACT_STEERING) {
bSteeringActuator* stact = act->data;
if (stact->facingaxis==0)
{
@@ -12238,9 +12367,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Object *ob;
/* ocean res is now squared, reset old ones - will be massive */
- for(ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = main->object.first; ob; ob = ob->id.next) {
ModifierData *md;
- for(md= ob->modifiers.first; md; md= md->next) {
+ for (md= ob->modifiers.first; md; md= md->next) {
if (md->type == eModifierType_Ocean) {
OceanModifierData *omd = (OceanModifierData *)md;
omd->resolution = 7;
@@ -12256,12 +12385,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Key *key;
/* Fix for sample line scope initializing with no height */
- for(sc= main->screen.first; sc; sc= sc->id.next) {
+ for (sc= main->screen.first; sc; sc= sc->id.next) {
sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_IMAGE) {
+ if (sl->spacetype==SPACE_IMAGE) {
SpaceImage *sima= (SpaceImage *)sl;
if (sima->sample_line_hist.height == 0 )
sima->sample_line_hist.height = 100;
@@ -12297,11 +12426,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* fix for objects which have zero dquat's
* since this is multiplied with the quat rather than added */
- for(ob= main->object.first; ob; ob= ob->id.next) {
- if(is_zero_v4(ob->dquat)) {
+ for (ob= main->object.first; ob; ob= ob->id.next) {
+ if (is_zero_v4(ob->dquat)) {
unit_qt(ob->dquat);
}
- if(is_zero_v3(ob->drotAxis) && ob->drotAngle == 0.0f) {
+ if (is_zero_v3(ob->drotAxis) && ob->drotAngle == 0.0f) {
unit_axis_angle(ob->drotAxis, &ob->drotAngle);
}
}
@@ -12311,7 +12440,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
bNodeTree *ntree;
/* node sockets are not exposed automatically any more,
- * this mimics the old behaviour by adding all unlinked sockets to groups.
+ * this mimics the old behavior by adding all unlinked sockets to groups.
*/
for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next) {
/* XXX Only setting a flag here. Actual adding of group sockets
@@ -12322,7 +12451,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile <3)){
+ if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile <3)) {
bScreen *sc;
Brush *brush;
Object *ob;
@@ -12330,18 +12459,18 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Material *mat;
int tex_nr, transp_tex;
- for(mat = main->mat.first; mat; mat = mat->id.next){
- if(!(mat->mode & MA_TRANSP) && !(mat->material_type & MA_TYPE_VOLUME)){
+ for (mat = main->mat.first; mat; mat = mat->id.next) {
+ if (!(mat->mode & MA_TRANSP) && !(mat->material_type & MA_TYPE_VOLUME)) {
transp_tex= 0;
- for(tex_nr=0; tex_nr<MAX_MTEX; tex_nr++){
- if(!mat->mtex[tex_nr]) continue;
- if(mat->mtex[tex_nr]->mapto & MAP_ALPHA) transp_tex= 1;
+ for (tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
+ if (!mat->mtex[tex_nr]) continue;
+ if (mat->mtex[tex_nr]->mapto & MAP_ALPHA) transp_tex= 1;
}
/* weak! material alpha could be animated */
- if(mat->alpha < 1.0f || mat->fresnel_tra > 0.0f || transp_tex){
+ if (mat->alpha < 1.0f || mat->fresnel_tra > 0.0f || transp_tex) {
mat->mode |= MA_TRANSP;
mat->mode &= ~(MA_ZTRANSP|MA_RAYTRANSP);
}
@@ -12351,24 +12480,24 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* redraws flag in SpaceTime has been moved to Screen level */
for (sc = main->screen.first; sc; sc= sc->id.next) {
if (sc->redraws_flag == 0) {
- /* just initialise to default? */
+ /* just initialize to default? */
// XXX: we could also have iterated through areas, and taken them from the first timeline available...
sc->redraws_flag = TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN;
}
}
for (brush= main->brush.first; brush; brush= brush->id.next) {
- if(brush->height == 0)
+ if (brush->height == 0)
brush->height= 0.4f;
}
/* replace 'rim material' option for in offset*/
- for(ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = main->object.first; ob; ob = ob->id.next) {
ModifierData *md;
- for(md= ob->modifiers.first; md; md= md->next) {
+ for (md= ob->modifiers.first; md; md= md->next) {
if (md->type == eModifierType_Solidify) {
SolidifyModifierData *smd = (SolidifyModifierData *)md;
- if(smd->flag & MOD_SOLIDIFY_RIM_MATERIAL) {
+ if (smd->flag & MOD_SOLIDIFY_RIM_MATERIAL) {
smd->mat_ofs_rim= 1;
smd->flag &= ~MOD_SOLIDIFY_RIM_MATERIAL;
}
@@ -12377,20 +12506,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* particle draw color from material */
- for(part = main->particle.first; part; part = part->id.next) {
- if(part->draw & PART_DRAW_MAT_COL)
+ for (part = main->particle.first; part; part = part->id.next) {
+ if (part->draw & PART_DRAW_MAT_COL)
part->draw_col = PART_DRAW_COL_MAT;
}
}
- if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile < 6)){
+ if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile < 6)) {
Mesh *me;
- for(me= main->mesh.first; me; me= me->id.next)
+ for (me= main->mesh.first; me; me= me->id.next)
mesh_calc_normals_tessface(me->mvert, me->totvert, me->mface, me->totface, NULL);
}
- if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile < 2)){
+ if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile < 2)) {
/* update blur area sizes from 0..1 range to 0..100 percentage */
Scene *scene;
bNode *node;
@@ -12404,30 +12533,30 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile < 258 || (main->versionfile == 258 && main->subversionfile < 1)){
+ if (main->versionfile < 258 || (main->versionfile == 258 && main->subversionfile < 1)) {
/* screen view2d settings were not properly initialized [#27164]
* v2d->scroll caused the bug but best reset other values too which are in old blend files only.
* need to make less ugly - possibly an iterator? */
bScreen *screen;
- for(screen= main->screen.first; screen; screen= screen->id.next) {
+ for (screen= main->screen.first; screen; screen= screen->id.next) {
ScrArea *sa;
/* add regions */
- for(sa= screen->areabase.first; sa; sa= sa->next) {
+ for (sa= screen->areabase.first; sa; sa= sa->next) {
SpaceLink *sl= sa->spacedata.first;
- if(sl->spacetype==SPACE_IMAGE) {
+ if (sl->spacetype==SPACE_IMAGE) {
ARegion *ar;
for (ar=sa->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype == RGN_TYPE_WINDOW) {
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
View2D *v2d= &ar->v2d;
v2d->minzoom= v2d->maxzoom= v2d->scroll= v2d->keeptot= v2d->keepzoom= v2d->keepofs= v2d->align= 0;
}
}
}
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_IMAGE) {
+ if (sl->spacetype==SPACE_IMAGE) {
ARegion *ar;
for (ar=sl->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype == RGN_TYPE_WINDOW) {
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
View2D *v2d= &ar->v2d;
v2d->minzoom= v2d->maxzoom= v2d->scroll= v2d->keeptot= v2d->keepzoom= v2d->keepofs= v2d->align= 0;
}
@@ -12440,8 +12569,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* Initialize texture point density curve falloff */
Tex *tex;
- for(tex= main->tex.first; tex; tex= tex->id.next) {
- if(tex->pd) {
+ for (tex= main->tex.first; tex; tex= tex->id.next) {
+ if (tex->pd) {
if (tex->pd->falloff_speed_scale == 0.0f)
tex->pd->falloff_speed_scale = 100.0f;
@@ -12461,8 +12590,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* add default value for behind strength of camera actuator */
Object *ob;
bActuator *act;
- for(ob = main->object.first; ob; ob= ob->id.next) {
- for(act= ob->actuators.first; act; act= act->next) {
+ for (ob = main->object.first; ob; ob= ob->id.next) {
+ for (act= ob->actuators.first; act; act= act->next) {
if (act->type == ACT_CAMERA) {
bCameraActuator *ba= act->data;
@@ -12474,14 +12603,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
{
ParticleSettings *part;
- for(part = main->particle.first; part; part = part->id.next) {
+ for (part = main->particle.first; part; part = part->id.next) {
/* Initialize particle billboard scale */
part->bb_size[0] = part->bb_size[1] = 1.0f;
}
}
}
- if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 1)){
+ if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 1)) {
{
Scene *scene;
Sequence *seq;
@@ -12498,26 +12627,26 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
{
bScreen *screen;
- for(screen= main->screen.first; screen; screen= screen->id.next) {
+ for (screen= main->screen.first; screen; screen= screen->id.next) {
ScrArea *sa;
/* add regions */
- for(sa= screen->areabase.first; sa; sa= sa->next) {
+ for (sa= screen->areabase.first; sa; sa= sa->next) {
SpaceLink *sl= sa->spacedata.first;
- if(sl->spacetype==SPACE_SEQ) {
+ if (sl->spacetype==SPACE_SEQ) {
ARegion *ar;
for (ar=sa->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype == RGN_TYPE_WINDOW) {
- if(ar->v2d.min[1] == 4.0f)
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
+ if (ar->v2d.min[1] == 4.0f)
ar->v2d.min[1]= 0.5f;
}
}
}
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_SEQ) {
+ if (sl->spacetype==SPACE_SEQ) {
ARegion *ar;
for (ar=sl->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype == RGN_TYPE_WINDOW) {
- if(ar->v2d.min[1] == 4.0f)
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
+ if (ar->v2d.min[1] == 4.0f)
ar->v2d.min[1]= 0.5f;
}
}
@@ -12598,7 +12727,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 2)){
+ if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 2)) {
{
/* Convert default socket values from bNodeStack */
Scene *sce;
@@ -12648,7 +12777,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 4)){
+ if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 4)) {
{
/* Adaptive time step for particle systems */
ParticleSettings *part;
@@ -12661,42 +12790,42 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* set defaults for obstacle avoidance, recast data */
Scene *sce;
- for(sce = main->scene.first; sce; sce = sce->id.next)
+ for (sce = main->scene.first; sce; sce = sce->id.next)
{
if (sce->gm.levelHeight == 0.f)
sce->gm.levelHeight = 2.f;
- if(sce->gm.recastData.cellsize == 0.0f)
+ if (sce->gm.recastData.cellsize == 0.0f)
sce->gm.recastData.cellsize = 0.3f;
- if(sce->gm.recastData.cellheight == 0.0f)
+ if (sce->gm.recastData.cellheight == 0.0f)
sce->gm.recastData.cellheight = 0.2f;
- if(sce->gm.recastData.agentmaxslope == 0.0f)
+ if (sce->gm.recastData.agentmaxslope == 0.0f)
sce->gm.recastData.agentmaxslope = (float)M_PI/4;
- if(sce->gm.recastData.agentmaxclimb == 0.0f)
+ if (sce->gm.recastData.agentmaxclimb == 0.0f)
sce->gm.recastData.agentmaxclimb = 0.9f;
- if(sce->gm.recastData.agentheight == 0.0f)
+ if (sce->gm.recastData.agentheight == 0.0f)
sce->gm.recastData.agentheight = 2.0f;
- if(sce->gm.recastData.agentradius == 0.0f)
+ if (sce->gm.recastData.agentradius == 0.0f)
sce->gm.recastData.agentradius = 0.6f;
- if(sce->gm.recastData.edgemaxlen == 0.0f)
+ if (sce->gm.recastData.edgemaxlen == 0.0f)
sce->gm.recastData.edgemaxlen = 12.0f;
- if(sce->gm.recastData.edgemaxerror == 0.0f)
+ if (sce->gm.recastData.edgemaxerror == 0.0f)
sce->gm.recastData.edgemaxerror = 1.3f;
- if(sce->gm.recastData.regionminsize == 0.0f)
+ if (sce->gm.recastData.regionminsize == 0.0f)
sce->gm.recastData.regionminsize = 8.f;
- if(sce->gm.recastData.regionmergesize == 0.0f)
+ if (sce->gm.recastData.regionmergesize == 0.0f)
sce->gm.recastData.regionmergesize = 20.f;
- if(sce->gm.recastData.vertsperpoly<3)
+ if (sce->gm.recastData.vertsperpoly<3)
sce->gm.recastData.vertsperpoly = 6;
- if(sce->gm.recastData.detailsampledist == 0.0f)
+ if (sce->gm.recastData.detailsampledist == 0.0f)
sce->gm.recastData.detailsampledist = 6.0f;
- if(sce->gm.recastData.detailsamplemaxerror == 0.0f)
+ if (sce->gm.recastData.detailsamplemaxerror == 0.0f)
sce->gm.recastData.detailsamplemaxerror = 1.0f;
}
}
}
- if (main->versionfile < 260){
+ if (main->versionfile < 260) {
{
/* set default alpha value of Image outputs in image and render layer nodes to 0 */
Scene *sce;
@@ -12705,7 +12834,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
for (sce=main->scene.first; sce; sce=sce->id.next) {
/* there are files with invalid audio_channels value, the real cause
is unknown, but we fix it here anyway to avoid crashes */
- if(sce->r.ffcodecdata.audio_channels == 0)
+ if (sce->r.ffcodecdata.audio_channels == 0)
sce->r.ffcodecdata.audio_channels = 2;
if (sce->nodetree)
@@ -12721,17 +12850,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ParticleSettings *part;
for (part=main->particle.first; part; part=part->id.next) {
- if(ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
+ if (ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
part->draw |= PART_DRAW_ROTATE_OB;
- if(part->rotmode == 0)
+ if (part->rotmode == 0)
part->rotmode = PART_ROT_VEL;
}
}
}
}
- if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 1)){
+ if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 1)) {
Object *ob;
for (ob= main->object.first; ob; ob= ob->id.next) {
@@ -12740,7 +12869,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
{
Camera *cam;
- for(cam= main->camera.first; cam; cam= cam->id.next) {
+ for (cam= main->camera.first; cam; cam= cam->id.next) {
if (cam->sensor_x < 0.01f)
cam->sensor_x = DEFAULT_SENSOR_WIDTH;
@@ -12753,11 +12882,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 2)) {
bNodeTreeType *ntreetype= ntreeGetType(NTREE_SHADER);
- if(ntreetype && ntreetype->foreach_nodetree)
+ if (ntreetype && ntreetype->foreach_nodetree)
ntreetype->foreach_nodetree(main, NULL, do_version_ntree_tex_mapping_260);
}
- if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 4)){
+ if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 4)) {
{
/* Convert node angles to radians! */
Scene *sce;
@@ -12788,19 +12917,19 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
for (sa= sc->areabase.first; sa; sa= sa->next) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_VIEW3D) {
+ if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D *)sl;
- if(v3d->bundle_size==0.0f) {
+ if (v3d->bundle_size==0.0f) {
v3d->bundle_size= 0.2f;
v3d->flag2 |= V3D_SHOW_RECONSTRUCTION;
}
- else if(sl->spacetype==SPACE_CLIP) {
+ else if (sl->spacetype==SPACE_CLIP) {
SpaceClip *sc= (SpaceClip *)sl;
- if(sc->scopes.track_preview_height==0)
+ if (sc->scopes.track_preview_height==0)
sc->scopes.track_preview_height= 120;
}
- if(v3d->bundle_drawtype==0)
+ if (v3d->bundle_drawtype==0)
v3d->bundle_drawtype= OB_PLAINAXES;
}
}
@@ -12810,7 +12939,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
for (clip= main->movieclip.first; clip; clip= clip->id.next) {
MovieTrackingTrack *track;
- if(clip->aspx<1.0f) {
+ if (clip->aspx<1.0f) {
clip->aspx= 1.0f;
clip->aspy= 1.0f;
}
@@ -12819,21 +12948,21 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
IMB_TC_FREE_RUN |
IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN;
- if(clip->proxy.build_size_flag==0)
+ if (clip->proxy.build_size_flag==0)
clip->proxy.build_size_flag= IMB_PROXY_25;
- if(clip->proxy.quality==0)
+ if (clip->proxy.quality==0)
clip->proxy.quality= 90;
- if(clip->tracking.camera.pixel_aspect<0.01f)
+ if (clip->tracking.camera.pixel_aspect<0.01f)
clip->tracking.camera.pixel_aspect= 1.f;
track= clip->tracking.tracks.first;
- while(track) {
- if(track->pyramid_levels==0)
+ while (track) {
+ if (track->pyramid_levels==0)
track->pyramid_levels= 2;
- if(track->minimum_correlation==0.0f)
+ if (track->minimum_correlation==0.0f)
track->minimum_correlation= 0.75f;
track= track->next;
@@ -12848,14 +12977,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
MovieClip *clip;
bScreen *sc;
- for(sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = main->scene.first; sce; sce = sce->id.next) {
do_versions_image_settings_2_60(sce);
}
for (clip= main->movieclip.first; clip; clip= clip->id.next) {
MovieTrackingSettings *settings= &clip->tracking.settings;
- if(settings->default_pyramid_levels==0) {
+ if (settings->default_pyramid_levels==0) {
settings->default_tracker= TRACKER_KLT;
settings->default_pyramid_levels= 2;
settings->default_minimum_correlation= 0.75;
@@ -12869,7 +12998,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
for (sa= sc->areabase.first; sa; sa= sa->next) {
SpaceLink *sl;
for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_VIEW3D) {
+ if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D *)sl;
v3d->flag2&= ~V3D_RENDER_SHADOW;
}
@@ -12898,10 +13027,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);
}
@@ -12955,7 +13083,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* Initialize BGE exit key to esc key */
Scene *scene;
- for(scene= main->scene.first; scene; scene= scene->id.next) {
+ for (scene= main->scene.first; scene; scene= scene->id.next) {
if (!scene->gm.exitkey)
scene->gm.exitkey = 218; // Blender key code for ESC
}
@@ -12970,14 +13098,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
clip->proxy.build_tc_flag|= IMB_TC_RECORD_RUN_NO_GAPS;
- if(!tracking->settings.object_distance)
+ if (!tracking->settings.object_distance)
tracking->settings.object_distance= 1.0f;
- if(tracking->objects.first == NULL)
+ if (tracking->objects.first == NULL)
BKE_tracking_new_object(tracking, "Camera");
- while(tracking_object) {
- if(!tracking_object->scale)
+ while (tracking_object) {
+ if (!tracking_object->scale)
tracking_object->scale= 1.0f;
tracking_object= tracking_object->next;
@@ -12989,13 +13117,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
for (con= ob->constraints.first; con; con=con->next) {
bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
- if(!cti)
+ if (!cti)
continue;
- if(cti->type==CONSTRAINT_TYPE_OBJECTSOLVER) {
+ if (cti->type==CONSTRAINT_TYPE_OBJECTSOLVER) {
bObjectSolverConstraint *data= (bObjectSolverConstraint *)con->data;
- if(data->invmat[3][3]==0.0f)
+ if (data->invmat[3][3]==0.0f)
unit_m4(data->invmat);
}
}
@@ -13058,12 +13186,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* convert Camera Actuator values to defines */
Object *ob;
bActuator *act;
- for(ob = main->object.first; ob; ob= ob->id.next) {
- for(act= ob->actuators.first; act; act= act->next) {
+ for (ob = main->object.first; ob; ob= ob->id.next) {
+ for (act= ob->actuators.first; act; act= act->next) {
if (act->type == ACT_CAMERA) {
bCameraActuator *ba= act->data;
- if(ba->axis==(float) 'x') ba->axis=OB_POSX;
+ if (ba->axis==(float) 'x') ba->axis=OB_POSX;
else if (ba->axis==(float)'y') ba->axis=OB_POSY;
/* don't do an if/else to avoid imediate subversion bump*/
// ba->axis=((ba->axis == (float) 'x')?OB_POSX_X:OB_POSY);
@@ -13076,7 +13204,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* convert deprecated sculpt_paint_unified_* fields to
UnifiedPaintSettings */
Scene *scene;
- for(scene= main->scene.first; scene; scene= scene->id.next) {
+ for (scene= main->scene.first; scene; scene= scene->id.next) {
ToolSettings *ts= scene->toolsettings;
UnifiedPaintSettings *ups= &ts->unified_paint_settings;
ups->size= ts->sculpt_paint_unified_size;
@@ -13093,7 +13221,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* convert extended ascii to utf-8 for text editor */
Text *text;
for (text= main->text.first; text; text= text->id.next)
- if(!(text->flags & TXT_ISEXT)) {
+ if (!(text->flags & TXT_ISEXT)) {
TextLine *tl;
for (tl= text->lines.first; tl; tl= tl->next) {
@@ -13109,12 +13237,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* set new dynamic paint values */
Object *ob;
- for(ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = main->object.first; ob; ob = ob->id.next) {
ModifierData *md;
- for(md= ob->modifiers.first; md; md= md->next) {
+ for (md= ob->modifiers.first; md; md= md->next) {
if (md->type == eModifierType_DynamicPaint) {
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
- if(pmd->canvas)
+ if (pmd->canvas)
{
DynamicPaintSurface *surface = pmd->canvas->surfaces.first;
for (; surface; surface=surface->next) {
@@ -13133,13 +13261,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if (main->versionfile < 262)
{
Object *ob;
- for(ob=main->object.first; ob; ob= ob->id.next) {
+ for (ob=main->object.first; ob; ob= ob->id.next) {
ModifierData *md;
for (md=ob->modifiers.first; md; md=md->next) {
if (md->type==eModifierType_Cloth) {
ClothModifierData *clmd = (ClothModifierData*) md;
- if(clmd->sim_parms)
+ if (clmd->sim_parms)
clmd->sim_parms->vel_damping = 1.0f;
}
}
@@ -13157,13 +13285,82 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Fluidsim) {
FluidsimModifierData *fmd = (FluidsimModifierData *)md;
- if(fmd->fss->animRate == 0.0f)
+ if (fmd->fss->animRate == 0.0f)
fmd->fss->animRate = 1.0f;
}
}
}
}
+ if (main->versionfile < 262 || (main->versionfile == 262 && main->subversionfile < 1))
+ {
+ /* update use flags for node sockets (was only temporary before) */
+ Scene *sce;
+ bNodeTree *ntree;
+
+ for (sce=main->scene.first; sce; sce=sce->id.next)
+ if (sce->nodetree)
+ do_versions_nodetree_multi_file_output_format_2_62_1(sce, sce->nodetree);
+
+ /* XXX can't associate with scene for group nodes, image format will stay uninitialized */
+ for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
+ do_versions_nodetree_multi_file_output_format_2_62_1(NULL, ntree);
+ }
+
+ /* only swap for pre-release bmesh merge which had MLoopCol red/blue swap */
+ if (main->versionfile == 262 && main->subversionfile == 1)
+ {
+ {
+ Mesh *me;
+ for (me = main->mesh.first; me; me = me->id.next) {
+ do_versions_mesh_mloopcol_swap_2_62_1(me);
+ }
+ }
+
+ }
+
+ if (main->versionfile < 262 || (main->versionfile == 262 && main->subversionfile < 2))
+ {
+ {
+ /* 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));
+ }
+ }
+ }
+ }
+
+ if (main->versionfile < 262 || (main->versionfile == 262 && main->subversionfile < 3))
+ {
+ Object *ob;
+ ModifierData *md;
+
+ for(ob = main->object.first; ob; ob = ob->id.next) {
+ for(md=ob->modifiers.first; md; md=md->next) {
+ if(md->type == eModifierType_Lattice) {
+ LatticeModifierData *lmd = (LatticeModifierData *)md;
+ lmd->strength = 1.0f;
+ }
+ }
+ }
+ }
+
+
+ {
+ /* Default for old files is to save particle rotations to pointcache */
+ ParticleSettings *part;
+ for (part = main->particle.first; part; part = part->id.next)
+ part->flag |= PART_ROTATIONS;
+ }
+
+ /* put compatibility code here until next subversion bump */
+ {
+
+ }
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
@@ -13175,7 +13372,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
static void do_versions_after_linking(FileData *fd, Library *lib, Main *main)
{
/* old Animation System (using IPO's) needs to be converted to the new Animato system */
- if(main->versionfile < 250)
+ if (main->versionfile < 250)
do_versions_ipos_to_animato(main);
}
#endif
@@ -13219,7 +13416,7 @@ static void lib_link_all(FileData *fd, Main *main)
static void direct_link_keymapitem(FileData *fd, wmKeyMapItem *kmi)
{
kmi->properties= newdataadr(fd, kmi->properties);
- if(kmi->properties)
+ if (kmi->properties)
IDP_DirectLinkProperty(kmi->properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
kmi->ptr= NULL;
kmi->flag &= ~KMI_UPDATE;
@@ -13237,7 +13434,7 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead)
/* read all data into fd->datamap */
bhead= read_data_into_oldnewmap(fd, bhead, "user def");
- if(user->keymaps.first) {
+ if (user->keymaps.first) {
/* backwards compatibility */
user->user_keymaps= user->keymaps;
user->keymaps.first= user->keymaps.last= NULL;
@@ -13247,25 +13444,25 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead)
link_list(fd, &user->user_keymaps);
link_list(fd, &user->addons);
- for(keymap=user->user_keymaps.first; keymap; keymap=keymap->next) {
+ for (keymap=user->user_keymaps.first; keymap; keymap=keymap->next) {
keymap->modal_items= NULL;
- keymap->poll= NULL;
+ keymap->poll = NULL;
keymap->flag &= ~KEYMAP_UPDATE;
link_list(fd, &keymap->diff_items);
link_list(fd, &keymap->items);
- for(kmdi=keymap->diff_items.first; kmdi; kmdi=kmdi->next) {
+ for (kmdi=keymap->diff_items.first; kmdi; kmdi=kmdi->next) {
kmdi->remove_item= newdataadr(fd, kmdi->remove_item);
kmdi->add_item= newdataadr(fd, kmdi->add_item);
- if(kmdi->remove_item)
+ if (kmdi->remove_item)
direct_link_keymapitem(fd, kmdi->remove_item);
- if(kmdi->add_item)
+ if (kmdi->add_item)
direct_link_keymapitem(fd, kmdi->add_item);
}
- for(kmi=keymap->items.first; kmi; kmi=kmi->next)
+ for (kmi=keymap->items.first; kmi; kmi=kmi->next)
direct_link_keymapitem(fd, kmi);
}
@@ -13295,7 +13492,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
bfd->type= BLENFILETYPE_BLEND;
BLI_strncpy(bfd->main->name, filepath, sizeof(bfd->main->name));
- while(bhead) {
+ while (bhead) {
switch(bhead->code) {
case DATA:
case DNA1:
@@ -13319,14 +13516,14 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
overwriting the libraries from the memory file. previously
it did not save ID_LI/ID_ID blocks in this case, but they are
needed to make quit.blend recover them correctly. */
- if(fd->memfile)
+ if (fd->memfile)
bhead= blo_nextbhead(fd, bhead);
else
bhead= read_libblock(fd, bfd->main, bhead, LIB_LOCAL, NULL);
break;
case ID_ID:
/* same as above */
- if(fd->memfile)
+ if (fd->memfile)
bhead= blo_nextbhead(fd, bhead);
else
/* always adds to the most recently loaded
@@ -13345,7 +13542,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
}
/* do before read_libraries, but skip undo case */
-// if(fd->memfile==NULL) (the mesh shuffle hacks don't work yet? ton)
+// if (fd->memfile==NULL) (the mesh shuffle hacks don't work yet? ton)
do_versions(fd, NULL, bfd->main);
read_libraries(fd, &fd->mainlist);
@@ -13373,8 +13570,8 @@ static int verg_bheadsort(const void *v1, const void *v2)
{
const struct bheadsort *x1=v1, *x2=v2;
- if( x1->old > x2->old) return 1;
- else if( x1->old < x2->old) return -1;
+ if ( x1->old > x2->old) return 1;
+ else if ( x1->old < x2->old) return -1;
return 0;
}
@@ -13388,7 +13585,7 @@ static void sort_bhead_old_map(FileData *fd)
tot++;
fd->tot_bheadmap= tot;
- if(tot==0) return;
+ if (tot==0) return;
bhs= fd->bheadmap= MEM_mallocN(tot*sizeof(struct bheadsort), "bheadsort");
@@ -13404,7 +13601,7 @@ static void sort_bhead_old_map(FileData *fd)
static BHead *find_previous_lib(FileData *fd, BHead *bhead)
{
/* skip library datablocks in undo, see comment in read_libblock */
- if(fd->memfile)
+ if (fd->memfile)
return NULL;
for (; bhead; bhead= blo_prevbhead(fd, bhead))
@@ -13430,7 +13627,7 @@ static BHead *find_bhead(FileData *fd, void *old)
bhs_s.old= old;
bhs= bsearch(&bhs_s, fd->bheadmap, fd->tot_bheadmap, sizeof(struct bheadsort), verg_bheadsort);
- if(bhs)
+ if (bhs)
return bhs->bhead;
#if 0
@@ -13460,21 +13657,21 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old)
ID *id;
bhead= find_bhead(fd, old);
- if(bhead) {
+ if (bhead) {
/* from another library? */
- if(bhead->code==ID_ID) {
+ if (bhead->code==ID_ID) {
BHead *bheadlib= find_previous_lib(fd, bhead);
- if(bheadlib) {
+ if (bheadlib) {
Library *lib= read_struct(fd, bheadlib, "Library");
Main *ptr= blo_find_main(fd, &fd->mainlist, lib->name, fd->relabase);
id= is_yet_read(fd, ptr, bhead);
- if(id==NULL) {
+ if (id==NULL) {
read_libblock(fd, ptr, bhead, LIB_READ+LIB_INDIRECT, NULL);
// commented because this can print way too much
- // if(G.f & G_DEBUG) printf("expand_doit: other lib %s\n", lib->name);
+ // if (G.debug & G_DEBUG) printf("expand_doit: other lib %s\n", lib->name);
/* for outliner dependency only */
ptr->curlib->parent= mainvar->curlib;
@@ -13489,12 +13686,12 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old)
/* Update: the issue is that in file reading, the oldnewmap is OK, but for existing data, it has to be
inserted in the map to be found! */
- if(id->flag & LIB_PRE_EXISTING)
+ if (id->flag & LIB_PRE_EXISTING)
oldnewmap_insert(fd->libmap, bhead->old, id, 1);
change_idid_adr_fd(fd, bhead->old, id);
// commented because this can print way too much
- // if(G.f & G_DEBUG) printf("expand_doit: already linked: %s lib: %s\n", id->name, lib->name);
+ // if (G.debug & G_DEBUG) printf("expand_doit: already linked: %s lib: %s\n", id->name, lib->name);
}
MEM_freeN(lib);
@@ -13502,7 +13699,7 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old)
}
else {
id= is_yet_read(fd, mainvar, bhead);
- if(id==NULL) {
+ if (id==NULL) {
read_libblock(fd, mainvar, bhead, LIB_TESTIND, NULL);
}
else {
@@ -13510,7 +13707,7 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old)
happens which invokes same ID... in that case the lookup table needs this entry */
oldnewmap_insert(fd->libmap, bhead->old, id, 1);
// commented because this can print way too much
- // if(G.f & G_DEBUG) printf("expand: already read %s\n", id->name);
+ // if (G.debug & G_DEBUG) printf("expand: already read %s\n", id->name);
}
}
}
@@ -13522,8 +13719,8 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old)
static void expand_ipo(FileData *fd, Main *mainvar, Ipo *ipo)
{
IpoCurve *icu;
- for(icu= ipo->curve.first; icu; icu= icu->next) {
- if(icu->driver)
+ for (icu= ipo->curve.first; icu; icu= icu->next) {
+ if (icu->driver)
expand_doit(fd, mainvar, icu->driver->ob);
}
}
@@ -13652,11 +13849,11 @@ static void expand_particlesettings(FileData *fd, Main *mainvar, ParticleSetting
expand_doit(fd, mainvar, part->eff_group);
expand_doit(fd, mainvar, part->bb_ob);
- if(part->adt)
+ if (part->adt)
expand_animdata(fd, mainvar, part->adt);
- for(a=0; a<MAX_MTEX; a++) {
- if(part->mtex[a]) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (part->mtex[a]) {
expand_doit(fd, mainvar, part->mtex[a]->tex);
expand_doit(fd, mainvar, part->mtex[a]->object);
}
@@ -13667,7 +13864,7 @@ static void expand_group(FileData *fd, Main *mainvar, Group *group)
{
GroupObject *go;
- for(go= group->gobject.first; go; go= go->next) {
+ for (go= group->gobject.first; go; go= go->next) {
expand_doit(fd, mainvar, go->ob);
}
}
@@ -13676,7 +13873,7 @@ static void expand_key(FileData *fd, Main *mainvar, Key *key)
{
expand_doit(fd, mainvar, key->ipo); // XXX depreceated - old animation system
- if(key->adt)
+ if (key->adt)
expand_animdata(fd, mainvar, key->adt);
}
@@ -13684,14 +13881,14 @@ static void expand_nodetree(FileData *fd, Main *mainvar, bNodeTree *ntree)
{
bNode *node;
- if(ntree->adt)
+ if (ntree->adt)
expand_animdata(fd, mainvar, ntree->adt);
- if(ntree->gpd)
+ if (ntree->gpd)
expand_doit(fd, mainvar, ntree->gpd);
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->id && node->type!=CMP_NODE_R_LAYERS)
+ for (node= ntree->nodes.first; node; node= node->next)
+ if (node->id && node->type!=CMP_NODE_R_LAYERS)
expand_doit(fd, mainvar, node->id);
}
@@ -13701,10 +13898,10 @@ static void expand_texture(FileData *fd, Main *mainvar, Tex *tex)
expand_doit(fd, mainvar, tex->ima);
expand_doit(fd, mainvar, tex->ipo); // XXX depreceated - old animation system
- if(tex->adt)
+ if (tex->adt)
expand_animdata(fd, mainvar, tex->adt);
- if(tex->nodetree)
+ if (tex->nodetree)
expand_nodetree(fd, mainvar, tex->nodetree);
}
@@ -13718,8 +13915,8 @@ static void expand_material(FileData *fd, Main *mainvar, Material *ma)
{
int a;
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a]) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (ma->mtex[a]) {
expand_doit(fd, mainvar, ma->mtex[a]->tex);
expand_doit(fd, mainvar, ma->mtex[a]->object);
}
@@ -13727,13 +13924,13 @@ static void expand_material(FileData *fd, Main *mainvar, Material *ma)
expand_doit(fd, mainvar, ma->ipo); // XXX depreceated - old animation system
- if(ma->adt)
+ if (ma->adt)
expand_animdata(fd, mainvar, ma->adt);
- if(ma->nodetree)
+ if (ma->nodetree)
expand_nodetree(fd, mainvar, ma->nodetree);
- if(ma->group)
+ if (ma->group)
expand_doit(fd, mainvar, ma->group);
}
@@ -13741,8 +13938,8 @@ static void expand_lamp(FileData *fd, Main *mainvar, Lamp *la)
{
int a;
- for(a=0; a<MAX_MTEX; a++) {
- if(la->mtex[a]) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (la->mtex[a]) {
expand_doit(fd, mainvar, la->mtex[a]->tex);
expand_doit(fd, mainvar, la->mtex[a]->object);
}
@@ -13753,7 +13950,7 @@ static void expand_lamp(FileData *fd, Main *mainvar, Lamp *la)
if (la->adt)
expand_animdata(fd, mainvar, la->adt);
- if(la->nodetree)
+ if (la->nodetree)
expand_nodetree(fd, mainvar, la->nodetree);
}
@@ -13771,8 +13968,8 @@ static void expand_world(FileData *fd, Main *mainvar, World *wrld)
{
int a;
- for(a=0; a<MAX_MTEX; a++) {
- if(wrld->mtex[a]) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (wrld->mtex[a]) {
expand_doit(fd, mainvar, wrld->mtex[a]->tex);
expand_doit(fd, mainvar, wrld->mtex[a]->object);
}
@@ -13783,7 +13980,7 @@ static void expand_world(FileData *fd, Main *mainvar, World *wrld)
if (wrld->adt)
expand_animdata(fd, mainvar, wrld->adt);
- if(wrld->nodetree)
+ if (wrld->nodetree)
expand_nodetree(fd, mainvar, wrld->nodetree);
}
@@ -13792,11 +13989,11 @@ static void expand_mball(FileData *fd, Main *mainvar, MetaBall *mb)
{
int a;
- for(a=0; a<mb->totcol; a++) {
+ for (a=0; a<mb->totcol; a++) {
expand_doit(fd, mainvar, mb->mat[a]);
}
- if(mb->adt)
+ if (mb->adt)
expand_animdata(fd, mainvar, mb->adt);
}
@@ -13804,7 +14001,7 @@ static void expand_curve(FileData *fd, Main *mainvar, Curve *cu)
{
int a;
- for(a=0; a<cu->totcol; a++) {
+ for (a=0; a<cu->totcol; a++) {
expand_doit(fd, mainvar, cu->mat[a]);
}
@@ -13818,7 +14015,7 @@ static void expand_curve(FileData *fd, Main *mainvar, Curve *cu)
expand_doit(fd, mainvar, cu->taperobj);
expand_doit(fd, mainvar, cu->textoncurve);
- if(cu->adt)
+ if (cu->adt)
expand_animdata(fd, mainvar, cu->adt);
}
@@ -13829,30 +14026,30 @@ static void expand_mesh(FileData *fd, Main *mainvar, Mesh *me)
TFace *tf;
int a, i;
- if(me->adt)
+ if (me->adt)
expand_animdata(fd, mainvar, me->adt);
- for(a=0; a<me->totcol; a++) {
+ for (a=0; a<me->totcol; a++) {
expand_doit(fd, mainvar, me->mat[a]);
}
expand_doit(fd, mainvar, me->key);
expand_doit(fd, mainvar, me->texcomesh);
- if(me->tface) {
+ if (me->tface) {
tf= me->tface;
- for(i=0; i<me->totface; i++, tf++)
- if(tf->tpage)
+ for (i=0; i<me->totface; i++, tf++)
+ if (tf->tpage)
expand_doit(fd, mainvar, tf->tpage);
}
- for(a=0; a<me->fdata.totlayer; a++) {
+ for (a=0; a<me->fdata.totlayer; a++) {
layer= &me->fdata.layers[a];
- if(layer->type == CD_MTFACE) {
+ if (layer->type == CD_MTFACE) {
mtf= (MTFace*)layer->data;
- for(i=0; i<me->totface; i++, mtf++)
- if(mtf->tpage)
+ for (i=0; i<me->totface; i++, mtf++)
+ if (mtf->tpage)
expand_doit(fd, mainvar, mtf->tpage);
}
}
@@ -13915,7 +14112,7 @@ static void expand_armature(FileData *fd, Main *mainvar, bArmature *arm)
{
Bone *curBone;
- if(arm->adt)
+ if (arm->adt)
expand_animdata(fd, mainvar, arm->adt);
for (curBone = arm->bonebase.first; curBone; curBone=curBone->next) {
@@ -13947,7 +14144,7 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
expand_doit(fd, mainvar, ob->data);
/* expand_object_expandModifier() */
- if(ob->modifiers.first) {
+ if (ob->modifiers.first) {
struct { FileData *fd; Main *mainvar; } data;
data.fd= fd;
data.mainvar= mainvar;
@@ -13967,17 +14164,17 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
expand_constraint_channels(fd, mainvar, &ob->constraintChannels);
- for (strip=ob->nlastrips.first; strip; strip=strip->next){
+ for (strip=ob->nlastrips.first; strip; strip=strip->next) {
expand_doit(fd, mainvar, strip->object);
expand_doit(fd, mainvar, strip->act);
expand_doit(fd, mainvar, strip->ipo);
}
// XXX depreceated - old animation system (for version patching only)
- if(ob->adt)
+ if (ob->adt)
expand_animdata(fd, mainvar, ob->adt);
- for(a=0; a<ob->totcol; a++) {
+ for (a=0; a<ob->totcol; a++) {
expand_doit(fd, mainvar, ob->mat[a]);
}
@@ -13985,24 +14182,24 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
if (paf && paf->group)
expand_doit(fd, mainvar, paf->group);
- if(ob->dup_group)
+ if (ob->dup_group)
expand_doit(fd, mainvar, ob->dup_group);
- if(ob->proxy)
+ if (ob->proxy)
expand_doit(fd, mainvar, ob->proxy);
- if(ob->proxy_group)
+ if (ob->proxy_group)
expand_doit(fd, mainvar, ob->proxy_group);
- for(psys=ob->particlesystem.first; psys; psys=psys->next)
+ for (psys=ob->particlesystem.first; psys; psys=psys->next)
expand_doit(fd, mainvar, psys->part);
sens= ob->sensors.first;
- while(sens) {
- if(sens->type==SENS_TOUCH) {
+ while (sens) {
+ if (sens->type==SENS_TOUCH) {
bTouchSensor *ts= sens->data;
expand_doit(fd, mainvar, ts->ma);
}
- else if(sens->type==SENS_MESSAGE) {
+ else if (sens->type==SENS_MESSAGE) {
bMessageSensor *ms= sens->data;
expand_doit(fd, mainvar, ms->fromObject);
}
@@ -14010,8 +14207,8 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
}
cont= ob->controllers.first;
- while(cont) {
- if(cont->type==CONT_PYTHON) {
+ while (cont) {
+ if (cont->type==CONT_PYTHON) {
bPythonCont *pc= cont->data;
expand_doit(fd, mainvar, pc->text);
}
@@ -14019,64 +14216,64 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
}
act= ob->actuators.first;
- while(act) {
- if(act->type==ACT_SOUND) {
+ while (act) {
+ if (act->type==ACT_SOUND) {
bSoundActuator *sa= act->data;
expand_doit(fd, mainvar, sa->sound);
}
- else if(act->type==ACT_CAMERA) {
+ else if (act->type==ACT_CAMERA) {
bCameraActuator *ca= act->data;
expand_doit(fd, mainvar, ca->ob);
}
- else if(act->type==ACT_EDIT_OBJECT) {
+ else if (act->type==ACT_EDIT_OBJECT) {
bEditObjectActuator *eoa= act->data;
- if(eoa) {
+ if (eoa) {
expand_doit(fd, mainvar, eoa->ob);
expand_doit(fd, mainvar, eoa->me);
}
}
- else if(act->type==ACT_OBJECT) {
+ else if (act->type==ACT_OBJECT) {
bObjectActuator *oa= act->data;
expand_doit(fd, mainvar, oa->reference);
}
- else if(act->type==ACT_ADD_OBJECT) {
+ else if (act->type==ACT_ADD_OBJECT) {
bAddObjectActuator *aoa= act->data;
expand_doit(fd, mainvar, aoa->ob);
}
- else if(act->type==ACT_SCENE) {
+ else if (act->type==ACT_SCENE) {
bSceneActuator *sa= act->data;
expand_doit(fd, mainvar, sa->camera);
expand_doit(fd, mainvar, sa->scene);
}
- else if(act->type==ACT_2DFILTER) {
+ else if (act->type==ACT_2DFILTER) {
bTwoDFilterActuator *tdfa= act->data;
expand_doit(fd, mainvar, tdfa->text);
}
- else if(act->type==ACT_ACTION) {
+ else if (act->type==ACT_ACTION) {
bActionActuator *aa= act->data;
expand_doit(fd, mainvar, aa->act);
}
- else if(act->type==ACT_SHAPEACTION) {
+ else if (act->type==ACT_SHAPEACTION) {
bActionActuator *aa= act->data;
expand_doit(fd, mainvar, aa->act);
}
- else if(act->type==ACT_PROPERTY) {
+ else if (act->type==ACT_PROPERTY) {
bPropertyActuator *pa= act->data;
expand_doit(fd, mainvar, pa->ob);
}
- else if(act->type==ACT_MESSAGE) {
+ else if (act->type==ACT_MESSAGE) {
bMessageActuator *ma= act->data;
expand_doit(fd, mainvar, ma->toObject);
}
- else if(act->type==ACT_PARENT) {
+ else if (act->type==ACT_PARENT) {
bParentActuator *pa= act->data;
expand_doit(fd, mainvar, pa->ob);
}
- else if(act->type==ACT_ARMATURE) {
+ else if (act->type==ACT_ARMATURE) {
bArmatureActuator *arma= act->data;
expand_doit(fd, mainvar, arma->target);
}
- else if(act->type==ACT_STEERING) {
+ else if (act->type==ACT_STEERING) {
bSteeringActuator *sta= act->data;
expand_doit(fd, mainvar, sta->target);
expand_doit(fd, mainvar, sta->navmesh);
@@ -14084,7 +14281,7 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
act= act->next;
}
- if(ob->pd && ob->pd->tex)
+ if (ob->pd && ob->pd->tex)
expand_doit(fd, mainvar, ob->pd->tex);
}
@@ -14094,40 +14291,40 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)
Base *base;
SceneRenderLayer *srl;
- for(base= sce->base.first; base; base= base->next) {
+ for (base= sce->base.first; base; base= base->next) {
expand_doit(fd, mainvar, base->object);
}
expand_doit(fd, mainvar, sce->camera);
expand_doit(fd, mainvar, sce->world);
- if(sce->adt)
+ if (sce->adt)
expand_animdata(fd, mainvar, sce->adt);
expand_keyingsets(fd, mainvar, &sce->keyingsets);
- if(sce->set)
+ if (sce->set)
expand_doit(fd, mainvar, sce->set);
- if(sce->nodetree)
+ if (sce->nodetree)
expand_nodetree(fd, mainvar, sce->nodetree);
- for(srl= sce->r.layers.first; srl; srl= srl->next) {
+ for (srl= sce->r.layers.first; srl; srl= srl->next) {
expand_doit(fd, mainvar, srl->mat_override);
expand_doit(fd, mainvar, srl->light_override);
}
- if(sce->r.dometext)
+ if (sce->r.dometext)
expand_doit(fd, mainvar, sce->gm.dome.warptext);
- if(sce->gpd)
+ if (sce->gpd)
expand_doit(fd, mainvar, sce->gpd);
- if(sce->ed) {
+ if (sce->ed) {
Sequence *seq;
SEQ_BEGIN(sce->ed, seq) {
- if(seq->scene) expand_doit(fd, mainvar, seq->scene);
- if(seq->scene_camera) expand_doit(fd, mainvar, seq->scene_camera);
- if(seq->sound) expand_doit(fd, mainvar, seq->sound);
+ if (seq->scene) expand_doit(fd, mainvar, seq->scene);
+ if (seq->scene_camera) expand_doit(fd, mainvar, seq->scene_camera);
+ if (seq->sound) expand_doit(fd, mainvar, seq->sound);
}
SEQ_END
}
@@ -14136,20 +14333,22 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)
{
TimeMarker *marker;
- for(marker= sce->markers.first; marker; marker= marker->next) {
- if(marker->camera) {
+ for (marker= sce->markers.first; marker; marker= marker->next) {
+ if (marker->camera) {
expand_doit(fd, mainvar, marker->camera);
}
}
}
#endif
+
+ expand_doit(fd, mainvar, sce->clip);
}
static void expand_camera(FileData *fd, Main *mainvar, Camera *ca)
{
expand_doit(fd, mainvar, ca->ipo); // XXX depreceated - old animation system
- if(ca->adt)
+ if (ca->adt)
expand_animdata(fd, mainvar, ca->adt);
}
@@ -14178,17 +14377,17 @@ static void expand_main(FileData *fd, Main *mainvar)
ID *id;
int a, doit= 1;
- if(fd==NULL) return;
+ if (fd==NULL) return;
- while(doit) {
+ while (doit) {
doit= 0;
a= set_listbasepointers(mainvar, lbarray);
- while(a--) {
+ while (a--) {
id= lbarray[a]->first;
- while(id) {
- if(id->flag & LIB_TEST) {
+ while (id) {
+ if (id->flag & LIB_TEST) {
switch(GS(id->name)) {
@@ -14274,8 +14473,8 @@ static int object_in_any_scene(Main *mainvar, Object *ob)
{
Scene *sce;
- for(sce= mainvar->scene.first; sce; sce= sce->id.next)
- if(object_in_scene(ob, sce))
+ for (sce= mainvar->scene.first; sce; sce= sce->id.next)
+ if (object_in_scene(ob, sce))
return 1;
return 0;
}
@@ -14287,9 +14486,9 @@ static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const
const short is_group_append= (is_link==FALSE && idcode==ID_GR);
/* give all objects which are LIB_INDIRECT a base, or for a group when *lib has been set */
- for(ob= mainvar->object.first; ob; ob= ob->id.next) {
+ for (ob= mainvar->object.first; ob; ob= ob->id.next) {
- if( ob->id.flag & LIB_INDIRECT ) {
+ if ( ob->id.flag & LIB_INDIRECT ) {
/* IF below is quite confusing!
if we are appending, but this object wasnt just added along with a group,
@@ -14300,12 +14499,12 @@ static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const
int do_it= 0;
- if(ob->id.us==0) {
+ if (ob->id.us==0) {
do_it= 1;
}
- else if(idcode==ID_GR) {
- if(ob->id.us==1 && is_link==FALSE && ob->id.lib==lib) {
- if((ob->flag & OB_FROMGROUP) && object_in_any_scene(mainvar, ob)==0) {
+ else if (idcode==ID_GR) {
+ if (ob->id.us==1 && is_link==FALSE && ob->id.lib==lib) {
+ if ((ob->flag & OB_FROMGROUP) && object_in_any_scene(mainvar, ob)==0) {
do_it= 1;
}
}
@@ -14313,20 +14512,20 @@ static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const
else {
/* when appending, make sure any indirectly loaded objects
* get a base else they cant be accessed at all [#27437] */
- if(ob->id.us==1 && is_link==FALSE && ob->id.lib==lib) {
+ if (ob->id.us==1 && is_link==FALSE && ob->id.lib==lib) {
/* we may be appending from a scene where we already
* have a linked object which is not in any scene [#27616] */
- if((ob->id.flag & LIB_PRE_EXISTING)==0) {
+ if ((ob->id.flag & LIB_PRE_EXISTING)==0) {
- if(object_in_any_scene(mainvar, ob)==0) {
+ if (object_in_any_scene(mainvar, ob)==0) {
do_it= 1;
}
}
}
}
- if(do_it) {
+ if (do_it) {
base= MEM_callocN( sizeof(Base), "add_ext_base");
BLI_addtail(&(sce->base), base);
base->lay= ob->lay;
@@ -14347,8 +14546,8 @@ static void give_base_to_groups(Main *mainvar, Scene *scene)
Group *group;
/* give all objects which are LIB_INDIRECT a base, or for a group when *lib has been set */
- for(group= mainvar->group.first; group; group= group->id.next) {
- if(((group->id.flag & LIB_INDIRECT)==0 && (group->id.flag & LIB_PRE_EXISTING)==0)) {
+ for (group= mainvar->group.first; group; group= group->id.next) {
+ if (((group->id.flag & LIB_INDIRECT)==0 && (group->id.flag & LIB_PRE_EXISTING)==0)) {
Base *base;
/* add_object(...) messes with the selection */
@@ -14380,20 +14579,20 @@ static ID *append_named_part(Main *mainl, FileData *fd, const char *idname, cons
ID *id= NULL;
int found=0;
- for(bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) {
- if(bhead->code==idcode) {
+ for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) {
+ if (bhead->code==idcode) {
const char *idname_test= bhead_id_name(fd, bhead);
- if(strcmp(idname_test + 2, idname)==0) {
+ if (strcmp(idname_test + 2, idname)==0) {
found= 1;
id= is_yet_read(fd, mainl, bhead);
- if(id==NULL) {
+ if (id==NULL) {
read_libblock(fd, mainl, bhead, LIB_TESTEXT, &id);
}
else {
printf("append: already linked\n");
oldnewmap_insert(fd->libmap, bhead->old, id, 1);
- if(id->flag & LIB_INDIRECT) {
+ if (id->flag & LIB_INDIRECT) {
id->flag -= LIB_INDIRECT;
id->flag |= LIB_EXTERN;
}
@@ -14402,7 +14601,7 @@ static ID *append_named_part(Main *mainl, FileData *fd, const char *idname, cons
break;
}
}
- else if(bhead->code==ENDB) {
+ else if (bhead->code==ENDB) {
break;
}
}
@@ -14417,9 +14616,9 @@ static ID *append_named_part_ex(const bContext *C, Main *mainl, FileData *fd, co
{
ID *id= append_named_part(mainl, fd, idname, idcode);
- if(id && (GS(id->name) == ID_OB)) { /* loose object: give a base */
+ if (id && (GS(id->name) == ID_OB)) { /* loose object: give a base */
Scene *scene= CTX_data_scene(C); /* can be NULL */
- if(scene) {
+ if (scene) {
Base *base;
Object *ob;
@@ -14429,7 +14628,7 @@ static ID *append_named_part_ex(const bContext *C, Main *mainl, FileData *fd, co
ob= (Object *)id;
/* link at active layer (view3d->lay if in context, else scene->lay */
- if((flag & FILE_ACTIVELAY)) {
+ if ((flag & FILE_ACTIVELAY)) {
View3D *v3d = CTX_wm_view3d(C);
ob->lay = v3d ? v3d->layact : scene->lay;
}
@@ -14439,7 +14638,7 @@ static ID *append_named_part_ex(const bContext *C, Main *mainl, FileData *fd, co
base->object= ob;
ob->id.us++;
- if(flag & FILE_AUTOSELECT) {
+ if (flag & FILE_AUTOSELECT) {
base->flag |= SELECT;
base->object->flag = base->flag;
/* do NOT make base active here! screws up GUI stuff, if you want it do it on src/ level */
@@ -14477,7 +14676,8 @@ static void append_id_part(FileData *fd, Main *mainvar, ID *id, ID **id_r)
break;
}
- } else if (bhead->code==ENDB)
+ }
+ else if (bhead->code==ENDB)
break;
}
}
@@ -14523,7 +14723,7 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in
curlib= mainl->curlib;
/* make the lib path relative if required */
- if(flag & FILE_RELPATH) {
+ if (flag & FILE_RELPATH) {
/* use the full path, this could have been read by other library even */
BLI_strncpy(curlib->name, curlib->filepath, sizeof(curlib->name));
@@ -14540,14 +14740,14 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in
lib_verify_nodetree(mainvar, FALSE);
fix_relpaths_library(G.main->name, mainvar); /* make all relative paths, relative to the open blend file */
- if(C) {
+ if (C) {
Scene *scene= CTX_data_scene(C);
/* give a base to loose objects. If group append, do it for objects too */
- if(scene) {
+ if (scene) {
const short is_link= (flag & FILE_LINK) != 0;
- if(idcode==ID_SCE) {
- /* dont instance anything when linking in scenes, assume the scene its self instances the data */
+ if (idcode==ID_SCE) {
+ /* don't instance anything when linking in scenes, assume the scene its self instances the data */
}
else {
give_base_to_objects(mainvar, scene, curlib, idcode, is_link);
@@ -14566,7 +14766,7 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in
/* 20041208: put back. It only linked direct, not indirect objects (ton) */
/* patch to prevent switch_endian happens twice */
- if((*fd)->flags & FD_FLAGS_SWITCH_ENDIAN) {
+ if ((*fd)->flags & FD_FLAGS_SWITCH_ENDIAN) {
blo_freefiledata( *fd );
*fd = NULL;
}
@@ -14592,7 +14792,7 @@ static int mainvar_count_libread_blocks(Main *mainvar)
int a, tot= 0;
a= set_listbasepointers(mainvar, lbarray);
- while(a--) {
+ while (a--) {
ID *id;
for (id= lbarray[a]->first; id; id= id->next)
@@ -14609,19 +14809,19 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
ListBase *lbarray[MAX_LIBARRAY];
int a, doit= 1;
- while(doit) {
+ while (doit) {
doit= 0;
/* test 1: read libdata */
mainptr= mainl->next;
- while(mainptr) {
+ while (mainptr) {
int tot= mainvar_count_libread_blocks(mainptr);
// printf("found LIB_READ %s\n", mainptr->curlib->name);
- if(tot) {
+ if (tot) {
FileData *fd= mainptr->curlib->filedata;
- if(fd==NULL) {
+ if (fd==NULL) {
/* printf and reports for now... its important users know this */
BKE_reportf_wrap(basefd->reports, RPT_INFO,
@@ -14631,8 +14831,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
fd= blo_openblenderfile(mainptr->curlib->filepath, basefd->reports);
/* allow typing in a new lib path */
- if(G.rt==-666) {
- while(fd==NULL) {
+ if (G.rt==-666) {
+ while (fd==NULL) {
char newlib_path[FILE_MAX] = { 0 };
printf("Missing library...'\n");
printf(" current file: %s\n", G.main->name);
@@ -14640,14 +14840,14 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
printf(" relative lib: %s\n", mainptr->curlib->name);
printf(" enter a new path:\n");
- if(scanf("%s", newlib_path) > 0) {
+ if (scanf("%s", newlib_path) > 0) {
BLI_strncpy(mainptr->curlib->name, newlib_path, sizeof(mainptr->curlib->name));
BLI_strncpy(mainptr->curlib->filepath, newlib_path, sizeof(mainptr->curlib->filepath));
cleanup_path(G.main->name, mainptr->curlib->filepath);
fd= blo_openblenderfile(mainptr->curlib->filepath, basefd->reports);
- if(fd) {
+ if (fd) {
printf("found: '%s', party on macuno!\n", mainptr->curlib->filepath);
}
}
@@ -14676,15 +14876,15 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
mainptr->curlib->filepath);
}
}
- if(fd) {
+ if (fd) {
doit= 1;
a= set_listbasepointers(mainptr, lbarray);
- while(a--) {
+ while (a--) {
ID *id= lbarray[a]->first;
- while(id) {
+ while (id) {
ID *idn= id->next;
- if(id->flag & LIB_READ) {
+ if (id->flag & LIB_READ) {
ID *realid= NULL;
BLI_remlink(lbarray[a], id);
@@ -14708,7 +14908,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
/* dang FileData... now new libraries need to be appended to original filedata,
* it is not a good replacement for the old global (ton) */
- while( fd->mainlist.first ) {
+ while ( fd->mainlist.first ) {
Main *mp= fd->mainlist.first;
BLI_remlink(&fd->mainlist, mp);
BLI_addtail(&basefd->mainlist, mp);
@@ -14721,13 +14921,13 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
}
/* test if there are unread libblocks */
- for(mainptr= mainl->next; mainptr; mainptr= mainptr->next) {
+ for (mainptr= mainl->next; mainptr; mainptr= mainptr->next) {
a= set_listbasepointers(mainptr, lbarray);
- while(a--) {
+ while (a--) {
ID *id= lbarray[a]->first;
- while(id) {
+ while (id) {
ID *idn= id->next;
- if(id->flag & LIB_READ) {
+ if (id->flag & LIB_READ) {
BLI_remlink(lbarray[a], id);
BKE_reportf_wrap(basefd->reports, RPT_ERROR,
"LIB ERROR: %s:'%s' unread libblock missing from '%s'\n",
@@ -14742,20 +14942,20 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
}
/* do versions, link, and free */
- for(mainptr= mainl->next; mainptr; mainptr= mainptr->next) {
+ for (mainptr= mainl->next; mainptr; mainptr= mainptr->next) {
/* some mains still have to be read, then
* versionfile is still zero! */
- if(mainptr->versionfile) {
- if(mainptr->curlib->filedata) // can be zero... with shift+f1 append
+ if (mainptr->versionfile) {
+ if (mainptr->curlib->filedata) // can be zero... with shift+f1 append
do_versions(mainptr->curlib->filedata, mainptr->curlib, mainptr);
else
do_versions(basefd, NULL, mainptr);
}
- if(mainptr->curlib->filedata)
+ if (mainptr->curlib->filedata)
lib_link_all(mainptr->curlib->filedata, mainptr);
- if(mainptr->curlib->filedata) blo_freefiledata(mainptr->curlib->filedata);
+ if (mainptr->curlib->filedata) blo_freefiledata(mainptr->curlib->filedata);
mainptr->curlib->filedata= NULL;
}
}
diff --git a/source/blender/blenloader/intern/runtime.c b/source/blender/blenloader/intern/runtime.c
index 3f8a9807f18..814061b7318 100644
--- a/source/blender/blenloader/intern/runtime.c
+++ b/source/blender/blenloader/intern/runtime.c
@@ -60,7 +60,7 @@ static int handle_read_msb_int(int handle)
{
unsigned char buf[4];
- if(read(handle, buf, 4) != 4)
+ if (read(handle, buf, 4) != 4)
return -1;
return (buf[0]<<24) + (buf[1]<<16) + (buf[2]<<8) + (buf[3]<<0);
@@ -68,28 +68,28 @@ static int handle_read_msb_int(int handle)
int BLO_is_a_runtime(const char *path)
{
- int res= 0, fd= open(path, O_BINARY|O_RDONLY, 0);
+ int res= 0, fd= BLI_open(path, O_BINARY|O_RDONLY, 0);
int datastart;
char buf[8];
- if(fd==-1)
+ if (fd==-1)
goto cleanup;
lseek(fd, -12, SEEK_END);
datastart= handle_read_msb_int(fd);
- if(datastart==-1)
+ if (datastart==-1)
goto cleanup;
- else if(read(fd, buf, 8)!=8)
+ else if (read(fd, buf, 8)!=8)
goto cleanup;
- else if(memcmp(buf, "BRUNTIME", 8)!=0)
+ else if (memcmp(buf, "BRUNTIME", 8)!=0)
goto cleanup;
else
res= 1;
cleanup:
- if(fd!=-1)
+ if (fd!=-1)
close(fd);
return res;
@@ -102,9 +102,9 @@ BlendFileData *BLO_read_runtime(const char *path, ReportList *reports)
int fd, datastart;
char buf[8];
- fd= open(path, O_BINARY|O_RDONLY, 0);
+ fd= BLI_open(path, O_BINARY|O_RDONLY, 0);
- if(fd==-1) {
+ if (fd==-1) {
BKE_reportf(reports, RPT_ERROR, "Unable to open \"%s\": %s.", path, strerror(errno));
goto cleanup;
}
@@ -115,15 +115,15 @@ BlendFileData *BLO_read_runtime(const char *path, ReportList *reports)
datastart= handle_read_msb_int(fd);
- if(datastart==-1) {
+ if (datastart==-1) {
BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (problem seeking)", path);
goto cleanup;
}
- else if(read(fd, buf, 8)!=8) {
+ else if (read(fd, buf, 8)!=8) {
BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (truncated header)", path);
goto cleanup;
}
- else if(memcmp(buf, "BRUNTIME", 8)!=0) {
+ else if (memcmp(buf, "BRUNTIME", 8)!=0) {
BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (not a blend file)", path);
goto cleanup;
}
@@ -135,7 +135,7 @@ BlendFileData *BLO_read_runtime(const char *path, ReportList *reports)
}
cleanup:
- if(fd!=-1)
+ if (fd!=-1)
close(fd);
return bfd;
diff --git a/source/blender/blenloader/intern/undofile.c b/source/blender/blenloader/intern/undofile.c
index 03c5070c8f3..eeeaae937b1 100644
--- a/source/blender/blenloader/intern/undofile.c
+++ b/source/blender/blenloader/intern/undofile.c
@@ -55,8 +55,8 @@ void BLO_free_memfile(MemFile *memfile)
{
MemFileChunk *chunk;
- while( (chunk = (memfile->chunks.first) ) ) {
- if(chunk->ident==0) MEM_freeN(chunk->buf);
+ while ( (chunk = (memfile->chunks.first) ) ) {
+ if (chunk->ident==0) MEM_freeN(chunk->buf);
BLI_remlink(&memfile->chunks, chunk);
MEM_freeN(chunk);
}
@@ -72,14 +72,14 @@ void BLO_merge_memfile(MemFile *first, MemFile *second)
fc= first->chunks.first;
sc= second->chunks.first;
while (fc || sc) {
- if(fc && sc) {
- if(sc->ident) {
+ if (fc && sc) {
+ if (sc->ident) {
sc->ident= 0;
fc->ident= 1;
}
}
- if(fc) fc= fc->next;
- if(sc) sc= sc->next;
+ if (fc) fc= fc->next;
+ if (sc) sc= sc->next;
}
BLO_free_memfile(first);
@@ -89,8 +89,8 @@ static int my_memcmp(int *mem1, int *mem2, int len)
{
register int a= len, *mema= mem1, *memb= mem2;
- while(a--) {
- if( *mema != *memb) return 1;
+ while (a--) {
+ if ( *mema != *memb) return 1;
mema++;
memb++;
}
@@ -103,11 +103,11 @@ void add_memfilechunk(MemFile *compare, MemFile *current, char *buf, unsigned in
MemFileChunk *curchunk;
/* this function inits when compare != NULL or when current==NULL */
- if(compare) {
+ if (compare) {
compchunk= compare->chunks.first;
return;
}
- if(current==NULL) {
+ if (current==NULL) {
compchunk= NULL;
return;
}
@@ -119,9 +119,9 @@ void add_memfilechunk(MemFile *compare, MemFile *current, char *buf, unsigned in
BLI_addtail(&current->chunks, curchunk);
/* we compare compchunk with buf */
- if(compchunk) {
- if(compchunk->size == curchunk->size) {
- if( my_memcmp((int *)compchunk->buf, (int *)buf, size/4)==0) {
+ if (compchunk) {
+ if (compchunk->size == curchunk->size) {
+ if ( my_memcmp((int *)compchunk->buf, (int *)buf, size/4)==0) {
curchunk->buf= compchunk->buf;
curchunk->ident= 1;
}
@@ -130,7 +130,7 @@ void add_memfilechunk(MemFile *compare, MemFile *current, char *buf, unsigned in
}
/* not equal... */
- if(curchunk->buf==NULL) {
+ if (curchunk->buf==NULL) {
curchunk->buf= MEM_mallocN(size, "Chunk buffer");
memcpy(curchunk->buf, buf, size);
current->size += size;
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index d5ed3096c79..c3f77f786c1 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -135,6 +135,7 @@ Any case: direct data is ALWAYS after the lib block
#include "DNA_movieclip_types.h"
#include "MEM_guardedalloc.h" // MEM_freeN
+#include "BLI_bitmap.h"
#include "BLI_blenlib.h"
#include "BLI_linklist.h"
#include "BLI_bpath.h"
@@ -209,7 +210,7 @@ static void writedata_do_write(WriteData *wd, void *mem, int memlen)
if (wd->error) return;
/* memory based save */
- if(wd->current) {
+ if (wd->current) {
add_memfilechunk(NULL, wd->current, mem, memlen);
}
else {
@@ -231,9 +232,9 @@ static void writedata_free(WriteData *wd)
/**
* Low level WRITE(2) wrapper that buffers data
- * @param adr Pointer to new chunk of data
- * @param len Length of new chunk of data
- * @warning Talks to other functions with global parameters
+ * \param adr Pointer to new chunk of data
+ * \param len Length of new chunk of data
+ * \warning Talks to other functions with global parameters
*/
#define MYWRITE_FLUSH NULL
@@ -243,8 +244,8 @@ static void mywrite( WriteData *wd, void *adr, int len)
if (wd->error) return;
/* flush helps compression for undo-save */
- if(adr==MYWRITE_FLUSH) {
- if(wd->count) {
+ if (adr==MYWRITE_FLUSH) {
+ if (wd->count) {
writedata_do_write(wd, wd->buf, wd->count);
wd->count= 0;
}
@@ -255,8 +256,8 @@ static void mywrite( WriteData *wd, void *adr, int len)
/* if we have a single big chunk, write existing data in
* buffer and write out big chunk in smaller pieces */
- if(len>MYWRITE_MAX_CHUNK) {
- if(wd->count) {
+ if (len>MYWRITE_MAX_CHUNK) {
+ if (wd->count) {
writedata_do_write(wd, wd->buf, wd->count);
wd->count= 0;
}
@@ -266,13 +267,13 @@ static void mywrite( WriteData *wd, void *adr, int len)
writedata_do_write(wd, adr, writelen);
adr = (char*)adr + writelen;
len -= writelen;
- } while(len > 0);
+ } while (len > 0);
return;
}
/* if data would overflow buffer, write out the buffer */
- if(len+wd->count>MYWRITE_BUFFER_SIZE-1) {
+ if (len+wd->count>MYWRITE_BUFFER_SIZE-1) {
writedata_do_write(wd, wd->buf, wd->count);
wd->count= 0;
}
@@ -284,10 +285,10 @@ static void mywrite( WriteData *wd, void *adr, int len)
/**
* BeGiN initializer for mywrite
- * @param file File descriptor
- * @param compare Previous memory file (can be NULL).
- * @param current The current memory file (can be NULL).
- * @warning Talks to other functions with global parameters
+ * \param file File descriptor
+ * \param compare Previous memory file (can be NULL).
+ * \param current The current memory file (can be NULL).
+ * \warning Talks to other functions with global parameters
*/
static WriteData *bgnwrite(int file, MemFile *compare, MemFile *current)
{
@@ -305,9 +306,9 @@ static WriteData *bgnwrite(int file, MemFile *compare, MemFile *current)
/**
* END the mywrite wrapper
- * @return 1 if write failed
- * @return unknown global variable otherwise
- * @warning Talks to other functions with global parameters
+ * \return 1 if write failed
+ * \return unknown global variable otherwise
+ * \warning Talks to other functions with global parameters
*/
static int endwrite(WriteData *wd)
{
@@ -331,7 +332,7 @@ static void writestruct(WriteData *wd, int filecode, const char *structname, int
BHead bh;
short *sp;
- if(adr==NULL || nr==0) return;
+ if (adr==NULL || nr==0) return;
/* init BHead */
bh.code= filecode;
@@ -339,7 +340,7 @@ static void writestruct(WriteData *wd, int filecode, const char *structname, int
bh.nr= nr;
bh.SDNAnr= DNA_struct_find_nr(wd->sdna, structname);
- if(bh.SDNAnr== -1) {
+ if (bh.SDNAnr== -1) {
printf("error: can't find SDNA code <%s>\n", structname);
return;
}
@@ -347,7 +348,7 @@ static void writestruct(WriteData *wd, int filecode, const char *structname, int
bh.len= nr*wd->sdna->typelens[sp[0]];
- if(bh.len==0) return;
+ if (bh.len==0) return;
mywrite(wd, &bh, sizeof(BHead));
mywrite(wd, adr, bh.len);
@@ -357,8 +358,8 @@ static void writedata(WriteData *wd, int filecode, int len, void *adr) /* do not
{
BHead bh;
- if(adr==NULL) return;
- if(len==0) return;
+ if (adr==NULL) return;
+ if (len==0) return;
len+= 3;
len-= ( len % 4);
@@ -371,7 +372,7 @@ static void writedata(WriteData *wd, int filecode, int len, void *adr) /* do not
bh.len= len;
mywrite(wd, &bh, sizeof(BHead));
- if(len) mywrite(wd, adr, len);
+ if (len) mywrite(wd, adr, len);
}
/* *************** writing some direct data structs used in more code parts **************** */
@@ -385,11 +386,11 @@ static void IDP_WriteArray(IDProperty *prop, void *wd)
if (prop->data.pointer) {
writedata(wd, DATA, MEM_allocN_len(prop->data.pointer), prop->data.pointer);
- if(prop->subtype == IDP_GROUP) {
+ if (prop->subtype == IDP_GROUP) {
IDProperty **array= prop->data.pointer;
int a;
- for(a=0; a<prop->len; a++)
+ for (a=0; a<prop->len; a++)
IDP_WriteProperty(array[a], wd);
}
}
@@ -404,7 +405,7 @@ static void IDP_WriteIDPArray(IDProperty *prop, void *wd)
writestruct(wd, DATA, "IDProperty", prop->len, array);
- for(a=0; a<prop->len; a++)
+ for (a=0; a<prop->len; a++)
IDP_WriteProperty_OnlyData(&array[a], wd);
}
}
@@ -547,7 +548,7 @@ static void write_actions(WriteData *wd, ListBase *idbase)
bActionGroup *grp;
TimeMarker *marker;
- for(act=idbase->first; act; act= act->id.next) {
+ for (act=idbase->first; act; act= act->id.next) {
if (act->id.us>0 || wd->current) {
writestruct(wd, ID_AC, "bAction", 1, act);
if (act->id.properties) IDP_WriteProperty(act->id.properties, wd);
@@ -648,7 +649,7 @@ static void write_curvemapping(WriteData *wd, CurveMapping *cumap)
int a;
writestruct(wd, DATA, "CurveMapping", 1, cumap);
- for(a=0; a<CM_TOT; a++)
+ for (a=0; a<CM_TOT; a++)
writestruct(wd, DATA, "CurveMapPoint", cumap->cm[a].totpoint, cumap->cm[a].curve);
}
@@ -659,7 +660,7 @@ static void write_node_socket(WriteData *wd, bNodeSocket *sock)
/* forward compatibility code, so older blenders still open */
sock->stack_type = 1;
- if(sock->default_value) {
+ if (sock->default_value) {
bNodeSocketValueFloat *valfloat;
bNodeSocketValueVector *valvector;
bNodeSocketValueRGBA *valrgba;
@@ -701,46 +702,46 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree)
/* for link_list() speed, we write per list */
- if(ntree->adt) write_animdata(wd, ntree->adt);
+ if (ntree->adt) write_animdata(wd, ntree->adt);
- for(node= ntree->nodes.first; node; node= node->next)
+ for (node= ntree->nodes.first; node; node= node->next)
writestruct(wd, DATA, "bNode", 1, node);
- for(node= ntree->nodes.first; node; node= node->next) {
- for(sock= node->inputs.first; sock; sock= sock->next)
+ for (node= ntree->nodes.first; node; node= node->next) {
+ for (sock= node->inputs.first; sock; sock= sock->next)
write_node_socket(wd, sock);
- for(sock= node->outputs.first; sock; sock= sock->next)
+ for (sock= node->outputs.first; sock; sock= sock->next)
write_node_socket(wd, sock);
- if(node->storage && node->type!=NODE_DYNAMIC) {
+ if (node->storage && node->type!=NODE_DYNAMIC) {
/* could be handlerized at some point, now only 1 exception still */
- if(ntree->type==NTREE_SHADER && (node->type==SH_NODE_CURVE_VEC || node->type==SH_NODE_CURVE_RGB))
+ if (ntree->type==NTREE_SHADER && (node->type==SH_NODE_CURVE_VEC || node->type==SH_NODE_CURVE_RGB))
write_curvemapping(wd, node->storage);
- else if(ntree->type==NTREE_COMPOSIT && ELEM4(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT))
+ else if (ntree->type==NTREE_COMPOSIT && ELEM4(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT))
write_curvemapping(wd, node->storage);
- else if(ntree->type==NTREE_TEXTURE && (node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME) )
+ else if (ntree->type==NTREE_TEXTURE && (node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME) )
write_curvemapping(wd, node->storage);
- else if(ntree->type==NTREE_COMPOSIT && node->type==CMP_NODE_MOVIEDISTORTION)
+ else if (ntree->type==NTREE_COMPOSIT && node->type==CMP_NODE_MOVIEDISTORTION)
/* pass */;
else
writestruct(wd, DATA, node->typeinfo->storagename, 1, node->storage);
}
- if (node->type==CMP_NODE_OUTPUT_MULTI_FILE) {
+ if (node->type==CMP_NODE_OUTPUT_FILE) {
/* inputs have own storage data */
for (sock=node->inputs.first; sock; sock=sock->next)
writestruct(wd, DATA, "NodeImageMultiFileSocket", 1, sock->storage);
}
}
- for(link= ntree->links.first; link; link= link->next)
+ for (link= ntree->links.first; link; link= link->next)
writestruct(wd, DATA, "bNodeLink", 1, link);
/* external sockets */
- for(sock= ntree->inputs.first; sock; sock= sock->next)
+ for (sock= ntree->inputs.first; sock; sock= sock->next)
write_node_socket(wd, sock);
- for(sock= ntree->outputs.first; sock; sock= sock->next)
+ for (sock= ntree->outputs.first; sock; sock= sock->next)
write_node_socket(wd, sock);
}
@@ -765,8 +766,8 @@ static void write_renderinfo(WriteData *wd, Main *mainvar) /* for renderdeamon
/* XXX in future, handle multiple windows with multiple screnes? */
current_screen_compat(mainvar, &curscreen);
- for(sce= mainvar->scene.first; sce; sce= sce->id.next) {
- if(sce->id.lib==NULL && ( sce==curscreen->scene || (sce->r.scemode & R_BG_RENDER)) ) {
+ for (sce= mainvar->scene.first; sce; sce= sce->id.next) {
+ if (sce->id.lib==NULL && ( sce==curscreen->scene || (sce->r.scemode & R_BG_RENDER)) ) {
data[0]= sce->r.sfra;
data[1]= sce->r.efra;
@@ -781,7 +782,7 @@ static void write_renderinfo(WriteData *wd, Main *mainvar) /* for renderdeamon
static void write_keymapitem(WriteData *wd, wmKeyMapItem *kmi)
{
writestruct(wd, DATA, "wmKeyMapItem", 1, kmi);
- if(kmi->properties)
+ if (kmi->properties)
IDP_WriteProperty(kmi->properties, wd);
}
@@ -796,28 +797,28 @@ static void write_userdef(WriteData *wd)
writestruct(wd, USER, "UserDef", 1, &U);
- for(btheme= U.themes.first; btheme; btheme=btheme->next)
+ for (btheme= U.themes.first; btheme; btheme=btheme->next)
writestruct(wd, DATA, "bTheme", 1, btheme);
- for(keymap= U.user_keymaps.first; keymap; keymap=keymap->next) {
+ for (keymap= U.user_keymaps.first; keymap; keymap=keymap->next) {
writestruct(wd, DATA, "wmKeyMap", 1, keymap);
- for(kmdi=keymap->diff_items.first; kmdi; kmdi=kmdi->next) {
+ for (kmdi=keymap->diff_items.first; kmdi; kmdi=kmdi->next) {
writestruct(wd, DATA, "wmKeyMapDiffItem", 1, kmdi);
- if(kmdi->remove_item)
+ if (kmdi->remove_item)
write_keymapitem(wd, kmdi->remove_item);
- if(kmdi->add_item)
+ if (kmdi->add_item)
write_keymapitem(wd, kmdi->add_item);
}
- for(kmi=keymap->items.first; kmi; kmi=kmi->next)
+ for (kmi=keymap->items.first; kmi; kmi=kmi->next)
write_keymapitem(wd, kmi);
}
- for(bext= U.addons.first; bext; bext=bext->next)
+ for (bext= U.addons.first; bext; bext=bext->next)
writestruct(wd, DATA, "bAddon", 1, bext);
- for(style= U.uistyles.first; style; style= style->next) {
+ for (style= U.uistyles.first; style; style= style->next) {
writestruct(wd, DATA, "uiStyle", 1, style);
}
}
@@ -829,7 +830,7 @@ static void write_boid_state(WriteData *wd, BoidState *state)
writestruct(wd, DATA, "BoidState", 1, state);
- for(; rule; rule=rule->next) {
+ for (; rule; rule=rule->next) {
switch(rule->type) {
case eBoidRuleType_Goal:
case eBoidRuleType_Avoid:
@@ -852,7 +853,7 @@ static void write_boid_state(WriteData *wd, BoidState *state)
break;
}
}
- //for(; cond; cond=cond->next)
+ //for (; cond; cond=cond->next)
// writestruct(wd, DATA, "BoidCondition", 1, cond);
}
@@ -876,28 +877,28 @@ static void write_pointcaches(WriteData *wd, ListBase *ptcaches)
PointCache *cache = ptcaches->first;
int i;
- for(; cache; cache=cache->next) {
+ for (; cache; cache=cache->next) {
writestruct(wd, DATA, "PointCache", 1, cache);
- if((cache->flag & PTCACHE_DISK_CACHE)==0) {
+ if ((cache->flag & PTCACHE_DISK_CACHE)==0) {
PTCacheMem *pm = cache->mem_cache.first;
- for(; pm; pm=pm->next) {
+ for (; pm; pm=pm->next) {
PTCacheExtra *extra = pm->extradata.first;
writestruct(wd, DATA, "PTCacheMem", 1, pm);
- for(i=0; i<BPHYS_TOT_DATA; i++) {
- if(pm->data[i] && pm->data_types & (1<<i)) {
- if(ptcache_data_struct[i][0]=='\0')
+ for (i=0; i<BPHYS_TOT_DATA; i++) {
+ if (pm->data[i] && pm->data_types & (1<<i)) {
+ if (ptcache_data_struct[i][0]=='\0')
writedata(wd, DATA, MEM_allocN_len(pm->data[i]), pm->data[i]);
else
writestruct(wd, DATA, ptcache_data_struct[i], pm->totpoint, pm->data[i]);
}
}
- for(; extra; extra=extra->next) {
- if(ptcache_extra_struct[extra->type][0]=='\0')
+ for (; extra; extra=extra->next) {
+ if (ptcache_extra_struct[extra->type][0]=='\0')
continue;
writestruct(wd, DATA, "PTCacheExtra", 1, extra);
writestruct(wd, DATA, ptcache_extra_struct[extra->type], extra->totdata, extra->data);
@@ -914,8 +915,8 @@ static void write_particlesettings(WriteData *wd, ListBase *idbase)
int a;
part= idbase->first;
- while(part) {
- if(part->id.us>0 || wd->current) {
+ while (part) {
+ if (part->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_PA, "ParticleSettings", 1, part);
if (part->id.properties) IDP_WriteProperty(part->id.properties, wd);
@@ -925,12 +926,12 @@ static void write_particlesettings(WriteData *wd, ListBase *idbase)
writestruct(wd, DATA, "EffectorWeights", 1, part->effector_weights);
dw = part->dupliweights.first;
- for(; dw; dw=dw->next) {
+ for (; dw; dw=dw->next) {
/* update indices */
dw->index = 0;
- if(part->dup_group) { /* can be NULL if lining fails or set to None */
+ if (part->dup_group) { /* can be NULL if lining fails or set to None */
go = part->dup_group->gobject.first;
- while(go && go->ob != dw->ob) {
+ while (go && go->ob != dw->ob) {
go=go->next;
dw->index++;
}
@@ -938,20 +939,20 @@ static void write_particlesettings(WriteData *wd, ListBase *idbase)
writestruct(wd, DATA, "ParticleDupliWeight", 1, dw);
}
- if(part->boids && part->phystype == PART_PHYS_BOIDS) {
+ if (part->boids && part->phystype == PART_PHYS_BOIDS) {
BoidState *state = part->boids->states.first;
writestruct(wd, DATA, "BoidSettings", 1, part->boids);
- for(; state; state=state->next)
+ for (; state; state=state->next)
write_boid_state(wd, state);
}
- if(part->fluid && part->phystype == PART_PHYS_FLUID){
+ if (part->fluid && part->phystype == PART_PHYS_FLUID) {
writestruct(wd, DATA, "SPHFluidSettings", 1, part->fluid);
}
- for(a=0; a<MAX_MTEX; a++) {
- if(part->mtex[a]) writestruct(wd, DATA, "MTex", 1, part->mtex[a]);
+ for (a=0; a<MAX_MTEX; a++) {
+ if (part->mtex[a]) writestruct(wd, DATA, "MTex", 1, part->mtex[a]);
}
}
part= part->id.next;
@@ -963,32 +964,32 @@ static void write_particlesystems(WriteData *wd, ListBase *particles)
ParticleTarget *pt;
int a;
- for(; psys; psys=psys->next) {
+ for (; psys; psys=psys->next) {
writestruct(wd, DATA, "ParticleSystem", 1, psys);
- if(psys->particles) {
+ if (psys->particles) {
writestruct(wd, DATA, "ParticleData", psys->totpart ,psys->particles);
- if(psys->particles->hair) {
+ if (psys->particles->hair) {
ParticleData *pa = psys->particles;
- for(a=0; a<psys->totpart; a++, pa++)
+ for (a=0; a<psys->totpart; a++, pa++)
writestruct(wd, DATA, "HairKey", pa->totkey, pa->hair);
}
- if(psys->particles->boid && psys->part->phystype == PART_PHYS_BOIDS)
+ if (psys->particles->boid && psys->part->phystype == PART_PHYS_BOIDS)
writestruct(wd, DATA, "BoidParticle", psys->totpart, psys->particles->boid);
- if(psys->part->fluid && psys->part->phystype == PART_PHYS_FLUID && (psys->part->fluid->flag & SPH_VISCOELASTIC_SPRINGS))
+ if (psys->part->fluid && psys->part->phystype == PART_PHYS_FLUID && (psys->part->fluid->flag & SPH_VISCOELASTIC_SPRINGS))
writestruct(wd, DATA, "ParticleSpring", psys->tot_fluidsprings, psys->fluid_springs);
}
pt = psys->targets.first;
- for(; pt; pt=pt->next)
+ for (; pt; pt=pt->next)
writestruct(wd, DATA, "ParticleTarget", 1, pt);
- if(psys->child) writestruct(wd, DATA, "ChildParticle", psys->totchild ,psys->child);
+ if (psys->child) writestruct(wd, DATA, "ChildParticle", psys->totchild ,psys->child);
- if(psys->clmd) {
+ if (psys->clmd) {
writestruct(wd, DATA, "ClothModifierData", 1, psys->clmd);
writestruct(wd, DATA, "ClothSimSettings", 1, psys->clmd->sim_parms);
writestruct(wd, DATA, "ClothCollSettings", 1, psys->clmd->coll_parms);
@@ -1003,10 +1004,10 @@ static void write_properties(WriteData *wd, ListBase *lb)
bProperty *prop;
prop= lb->first;
- while(prop) {
+ while (prop) {
writestruct(wd, DATA, "bProperty", 1, prop);
- if(prop->poin && prop->poin != &prop->data)
+ if (prop->poin && prop->poin != &prop->data)
writedata(wd, DATA, MEM_allocN_len(prop->poin), prop->poin);
prop= prop->next;
@@ -1018,7 +1019,7 @@ static void write_sensors(WriteData *wd, ListBase *lb)
bSensor *sens;
sens= lb->first;
- while(sens) {
+ while (sens) {
writestruct(wd, DATA, "bSensor", 1, sens);
writedata(wd, DATA, sizeof(void *)*sens->totlinks, sens->links);
@@ -1079,7 +1080,7 @@ static void write_controllers(WriteData *wd, ListBase *lb)
bController *cont;
cont= lb->first;
- while(cont) {
+ while (cont) {
writestruct(wd, DATA, "bController", 1, cont);
writedata(wd, DATA, sizeof(void *)*cont->totlinks, cont->links);
@@ -1104,7 +1105,7 @@ static void write_actuators(WriteData *wd, ListBase *lb)
bActuator *act;
act= lb->first;
- while(act) {
+ while (act) {
writestruct(wd, DATA, "bActuator", 1, act);
switch(act->type) {
@@ -1298,7 +1299,7 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
writedata(wd, DATA, sizeof(int)*hmd->totindex, hmd->indexar);
}
- else if(md->type==eModifierType_Cloth) {
+ else if (md->type==eModifierType_Cloth) {
ClothModifierData *clmd = (ClothModifierData*) md;
writestruct(wd, DATA, "ClothSimSettings", 1, clmd->sim_parms);
@@ -1306,12 +1307,12 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
writestruct(wd, DATA, "EffectorWeights", 1, clmd->sim_parms->effector_weights);
write_pointcaches(wd, &clmd->ptcaches);
}
- else if(md->type==eModifierType_Smoke) {
+ else if (md->type==eModifierType_Smoke) {
SmokeModifierData *smd = (SmokeModifierData*) md;
- if(smd->type & MOD_SMOKE_TYPE_DOMAIN)
+ if (smd->type & MOD_SMOKE_TYPE_DOMAIN)
{
- if(smd->domain)
+ if (smd->domain)
{
write_pointcaches(wd, &(smd->domain->ptcaches[0]));
@@ -1325,7 +1326,7 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
writestruct(wd, DATA, "SmokeDomainSettings", 1, smd->domain);
- if(smd->domain) {
+ if (smd->domain) {
/* cleanup the fake pointcache */
BKE_ptcache_free_list(&smd->domain->ptcaches[1]);
smd->domain->point_cache[1] = NULL;
@@ -1333,20 +1334,20 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
writestruct(wd, DATA, "EffectorWeights", 1, smd->domain->effector_weights);
}
}
- else if(smd->type & MOD_SMOKE_TYPE_FLOW)
+ else if (smd->type & MOD_SMOKE_TYPE_FLOW)
writestruct(wd, DATA, "SmokeFlowSettings", 1, smd->flow);
- else if(smd->type & MOD_SMOKE_TYPE_COLL)
+ else if (smd->type & MOD_SMOKE_TYPE_COLL)
writestruct(wd, DATA, "SmokeCollSettings", 1, smd->coll);
}
- else if(md->type==eModifierType_Fluidsim) {
+ else if (md->type==eModifierType_Fluidsim) {
FluidsimModifierData *fluidmd = (FluidsimModifierData*) md;
writestruct(wd, DATA, "FluidsimSettings", 1, fluidmd->fss);
}
- else if(md->type==eModifierType_DynamicPaint) {
+ else if (md->type==eModifierType_DynamicPaint) {
DynamicPaintModifierData *pmd = (DynamicPaintModifierData*) md;
- if(pmd->canvas)
+ if (pmd->canvas)
{
DynamicPaintSurface *surface;
writestruct(wd, DATA, "DynamicPaintCanvasSettings", 1, pmd->canvas);
@@ -1361,7 +1362,7 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
writestruct(wd, DATA, "EffectorWeights", 1, surface->effector_weights);
}
}
- if(pmd->brush)
+ if (pmd->brush)
{
writestruct(wd, DATA, "DynamicPaintBrushSettings", 1, pmd->brush);
writestruct(wd, DATA, "ColorBand", 1, pmd->brush->paint_ramp);
@@ -1393,7 +1394,7 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
}
else if (md->type==eModifierType_Warp) {
WarpModifierData *tmd = (WarpModifierData*) md;
- if(tmd->curfalloff) {
+ if (tmd->curfalloff) {
write_curvemapping(wd, tmd->curfalloff);
}
}
@@ -1411,8 +1412,8 @@ static void write_objects(WriteData *wd, ListBase *idbase)
Object *ob;
ob= idbase->first;
- while(ob) {
- if(ob->id.us>0 || wd->current) {
+ while (ob) {
+ if (ob->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_OB, "Object", 1, ob);
@@ -1445,7 +1446,7 @@ static void write_objects(WriteData *wd, ListBase *idbase)
writestruct(wd, DATA, "PartDeflect", 1, ob->pd);
writestruct(wd, DATA, "SoftBody", 1, ob->soft);
- if(ob->soft) {
+ if (ob->soft) {
write_pointcaches(wd, &ob->soft->ptcaches);
writestruct(wd, DATA, "EffectorWeights", 1, ob->soft->effector_weights);
}
@@ -1468,8 +1469,8 @@ static void write_vfonts(WriteData *wd, ListBase *idbase)
PackedFile * pf;
vf= idbase->first;
- while(vf) {
- if(vf->id.us>0 || wd->current) {
+ while (vf) {
+ if (vf->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_VF, "VFont", 1, vf);
if (vf->id.properties) IDP_WriteProperty(vf->id.properties, wd);
@@ -1494,8 +1495,8 @@ static void write_keys(WriteData *wd, ListBase *idbase)
KeyBlock *kb;
key= idbase->first;
- while(key) {
- if(key->id.us>0 || wd->current) {
+ while (key) {
+ if (key->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_KE, "Key", 1, key);
if (key->id.properties) IDP_WriteProperty(key->id.properties, wd);
@@ -1504,9 +1505,9 @@ static void write_keys(WriteData *wd, ListBase *idbase)
/* direct data */
kb= key->block.first;
- while(kb) {
+ while (kb) {
writestruct(wd, DATA, "KeyBlock", 1, kb);
- if(kb->data) writedata(wd, DATA, kb->totelem*key->elemsize, kb->data);
+ if (kb->data) writedata(wd, DATA, kb->totelem*key->elemsize, kb->data);
kb= kb->next;
}
}
@@ -1522,8 +1523,8 @@ static void write_cameras(WriteData *wd, ListBase *idbase)
Camera *cam;
cam= idbase->first;
- while(cam) {
- if(cam->id.us>0 || wd->current) {
+ while (cam) {
+ if (cam->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_CA, "Camera", 1, cam);
if (cam->id.properties) IDP_WriteProperty(cam->id.properties, wd);
@@ -1541,8 +1542,8 @@ static void write_mballs(WriteData *wd, ListBase *idbase)
MetaElem *ml;
mb= idbase->first;
- while(mb) {
- if(mb->id.us>0 || wd->current) {
+ while (mb) {
+ if (mb->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_MB, "MetaBall", 1, mb);
if (mb->id.properties) IDP_WriteProperty(mb->id.properties, wd);
@@ -1552,7 +1553,7 @@ static void write_mballs(WriteData *wd, ListBase *idbase)
if (mb->adt) write_animdata(wd, mb->adt);
ml= mb->elems.first;
- while(ml) {
+ while (ml) {
writestruct(wd, DATA, "MetaElem", 1, ml);
ml= ml->next;
}
@@ -1574,8 +1575,8 @@ static void write_curves(WriteData *wd, ListBase *idbase)
Nurb *nu;
cu= idbase->first;
- while(cu) {
- if(cu->id.us>0 || wd->current) {
+ while (cu) {
+ if (cu->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_CU, "Curve", 1, cu);
@@ -1584,7 +1585,7 @@ static void write_curves(WriteData *wd, ListBase *idbase)
if (cu->id.properties) IDP_WriteProperty(cu->id.properties, wd);
if (cu->adt) write_animdata(wd, cu->adt);
- if(cu->vfont) {
+ if (cu->vfont) {
writedata(wd, DATA, amount_of_chars(cu->str)+1, cu->str);
writestruct(wd, DATA, "CharInfo", cu->len+1, cu->strinfo);
writestruct(wd, DATA, "TextBox", cu->totbox, cu->tb);
@@ -1592,18 +1593,18 @@ static void write_curves(WriteData *wd, ListBase *idbase)
else {
/* is also the order of reading */
nu= cu->nurb.first;
- while(nu) {
+ while (nu) {
writestruct(wd, DATA, "Nurb", 1, nu);
nu= nu->next;
}
nu= cu->nurb.first;
- while(nu) {
- if(nu->type == CU_BEZIER)
+ while (nu) {
+ if (nu->type == CU_BEZIER)
writestruct(wd, DATA, "BezTriple", nu->pntsu, nu->bezt);
else {
writestruct(wd, DATA, "BPoint", nu->pntsu*nu->pntsv, nu->bp);
- if(nu->knotsu) writedata(wd, DATA, KNOTSU(nu)*sizeof(float), nu->knotsu);
- if(nu->knotsv) writedata(wd, DATA, KNOTSV(nu)*sizeof(float), nu->knotsv);
+ if (nu->knotsu) writedata(wd, DATA, KNOTSU(nu)*sizeof(float), nu->knotsu);
+ if (nu->knotsv) writedata(wd, DATA, KNOTSV(nu)*sizeof(float), nu->knotsv);
}
nu= nu->next;
}
@@ -1634,15 +1635,19 @@ static void write_dverts(WriteData *wd, int count, MDeformVert *dvlist)
static void write_mdisps(WriteData *wd, int count, MDisps *mdlist, int external)
{
- if(mdlist) {
+ if (mdlist) {
int i;
writestruct(wd, DATA, "MDisps", count, mdlist);
- if(!external) {
- for(i = 0; i < count; ++i) {
- if(mdlist[i].disps)
- writedata(wd, DATA, sizeof(float)*3*mdlist[i].totdisp, mdlist[i].disps);
+ for (i = 0; i < count; ++i) {
+ MDisps *md = &mdlist[i];
+ if (md->disps) {
+ if (!external)
+ writedata(wd, DATA, sizeof(float)*3*md->totdisp, md->disps);
}
+
+ if (md->hidden)
+ writedata(wd, DATA, BLI_BITMAP_SIZE(md->totdisp), md->hidden);
}
}
}
@@ -1652,7 +1657,7 @@ static void write_customdata(WriteData *wd, ID *id, int count, CustomData *data,
int i;
/* write external customdata (not for undo) */
- if(data->external && !wd->current)
+ if (data->external && !wd->current)
CustomData_external_write(data, id, CD_MASK_MESH, count, 0);
writestruct(wd, DATA, "CustomDataLayer", data->maxlayer, data->layers);
@@ -1686,7 +1691,7 @@ static void write_customdata(WriteData *wd, ID *id, int count, CustomData *data,
}
}
- if(data->external)
+ if (data->external)
writestruct(wd, DATA, "CustomDataExternal", 1, data->external);
}
@@ -1700,14 +1705,14 @@ static void write_meshs(WriteData *wd, ListBase *idbase)
#endif
mesh= idbase->first;
- while(mesh) {
- if(mesh->id.us>0 || wd->current) {
+ while (mesh) {
+ if (mesh->id.us>0 || wd->current) {
/* write LibData */
if (!save_for_old_blender) {
#ifdef USE_BMESH_SAVE_WITHOUT_MFACE
Mesh backup_mesh = {{0}};
- /* cache only - dont write */
+ /* cache only - don't write */
backup_mesh.mface = mesh->mface;
mesh->mface = NULL;
/* -- */
@@ -1732,7 +1737,7 @@ static void write_meshs(WriteData *wd, ListBase *idbase)
write_customdata(wd, &mesh->id, mesh->totpoly, &mesh->pdata, -1, 0);
#ifdef USE_BMESH_SAVE_WITHOUT_MFACE
- /* cache only - dont write */
+ /* cache only - don't write */
mesh->mface = backup_mesh.mface;
/* -- */
mesh->totface = backup_mesh.totface;
@@ -1832,8 +1837,8 @@ static void write_lattices(WriteData *wd, ListBase *idbase)
Lattice *lt;
lt= idbase->first;
- while(lt) {
- if(lt->id.us>0 || wd->current) {
+ while (lt) {
+ if (lt->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_LT, "Lattice", 1, lt);
if (lt->id.properties) IDP_WriteProperty(lt->id.properties, wd);
@@ -1858,7 +1863,7 @@ static void write_previews(WriteData *wd, PreviewImage *prv)
short h = prv->h[1];
unsigned int *rect = prv->rect[1];
/* don't write out large previews if not requested */
- if (!(U.flag & USER_SAVE_PREVIEWS) ) {
+ if (!(U.flag & USER_SAVE_PREVIEWS)) {
prv->w[1] = 0;
prv->h[1] = 0;
prv->rect[1] = NULL;
@@ -1883,8 +1888,8 @@ static void write_images(WriteData *wd, ListBase *idbase)
ima= idbase->first;
- while(ima) {
- if(ima->id.us>0 || wd->current) {
+ while (ima) {
+ if (ima->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_IM, "Image", 1, ima);
if (ima->id.properties) IDP_WriteProperty(ima->id.properties, wd);
@@ -1908,8 +1913,8 @@ static void write_textures(WriteData *wd, ListBase *idbase)
Tex *tex;
tex= idbase->first;
- while(tex) {
- if(tex->id.us>0 || wd->current) {
+ while (tex) {
+ if (tex->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_TE, "Tex", 1, tex);
if (tex->id.properties) IDP_WriteProperty(tex->id.properties, wd);
@@ -1917,19 +1922,19 @@ static void write_textures(WriteData *wd, ListBase *idbase)
if (tex->adt) write_animdata(wd, tex->adt);
/* direct data */
- if(tex->type == TEX_PLUGIN && tex->plugin) writestruct(wd, DATA, "PluginTex", 1, tex->plugin);
- if(tex->coba) writestruct(wd, DATA, "ColorBand", 1, tex->coba);
- if(tex->type == TEX_ENVMAP && tex->env) writestruct(wd, DATA, "EnvMap", 1, tex->env);
- if(tex->type == TEX_POINTDENSITY && tex->pd) {
+ if (tex->type == TEX_PLUGIN && tex->plugin) writestruct(wd, DATA, "PluginTex", 1, tex->plugin);
+ if (tex->coba) writestruct(wd, DATA, "ColorBand", 1, tex->coba);
+ if (tex->type == TEX_ENVMAP && tex->env) writestruct(wd, DATA, "EnvMap", 1, tex->env);
+ if (tex->type == TEX_POINTDENSITY && tex->pd) {
writestruct(wd, DATA, "PointDensity", 1, tex->pd);
- if(tex->pd->coba) writestruct(wd, DATA, "ColorBand", 1, tex->pd->coba);
- if(tex->pd->falloff_curve) write_curvemapping(wd, tex->pd->falloff_curve);
+ if (tex->pd->coba) writestruct(wd, DATA, "ColorBand", 1, tex->pd->coba);
+ if (tex->pd->falloff_curve) write_curvemapping(wd, tex->pd->falloff_curve);
}
- if(tex->type == TEX_VOXELDATA) writestruct(wd, DATA, "VoxelData", 1, tex->vd);
- if(tex->type == TEX_OCEAN && tex->ot) writestruct(wd, DATA, "OceanTex", 1, tex->ot);
+ if (tex->type == TEX_VOXELDATA) writestruct(wd, DATA, "VoxelData", 1, tex->vd);
+ if (tex->type == TEX_OCEAN && tex->ot) writestruct(wd, DATA, "OceanTex", 1, tex->ot);
/* nodetree is integral part of texture, no libdata */
- if(tex->nodetree) {
+ if (tex->nodetree) {
writestruct(wd, DATA, "bNodeTree", 1, tex->nodetree);
write_nodetree(wd, tex->nodetree);
}
@@ -1949,8 +1954,8 @@ static void write_materials(WriteData *wd, ListBase *idbase)
int a;
ma= idbase->first;
- while(ma) {
- if(ma->id.us>0 || wd->current) {
+ while (ma) {
+ if (ma->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_MA, "Material", 1, ma);
@@ -1962,15 +1967,15 @@ static void write_materials(WriteData *wd, ListBase *idbase)
if (ma->adt) write_animdata(wd, ma->adt);
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a]) writestruct(wd, DATA, "MTex", 1, ma->mtex[a]);
+ for (a=0; a<MAX_MTEX; a++) {
+ if (ma->mtex[a]) writestruct(wd, DATA, "MTex", 1, ma->mtex[a]);
}
- if(ma->ramp_col) writestruct(wd, DATA, "ColorBand", 1, ma->ramp_col);
- if(ma->ramp_spec) writestruct(wd, DATA, "ColorBand", 1, ma->ramp_spec);
+ if (ma->ramp_col) writestruct(wd, DATA, "ColorBand", 1, ma->ramp_col);
+ if (ma->ramp_spec) writestruct(wd, DATA, "ColorBand", 1, ma->ramp_spec);
/* nodetree is integral part of material, no libdata */
- if(ma->nodetree) {
+ if (ma->nodetree) {
writestruct(wd, DATA, "bNodeTree", 1, ma->nodetree);
write_nodetree(wd, ma->nodetree);
}
@@ -1987,20 +1992,20 @@ static void write_worlds(WriteData *wd, ListBase *idbase)
int a;
wrld= idbase->first;
- while(wrld) {
- if(wrld->id.us>0 || wd->current) {
+ while (wrld) {
+ if (wrld->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_WO, "World", 1, wrld);
if (wrld->id.properties) IDP_WriteProperty(wrld->id.properties, wd);
if (wrld->adt) write_animdata(wd, wrld->adt);
- for(a=0; a<MAX_MTEX; a++) {
- if(wrld->mtex[a]) writestruct(wd, DATA, "MTex", 1, wrld->mtex[a]);
+ for (a=0; a<MAX_MTEX; a++) {
+ if (wrld->mtex[a]) writestruct(wd, DATA, "MTex", 1, wrld->mtex[a]);
}
/* nodetree is integral part of lamps, no libdata */
- if(wrld->nodetree) {
+ if (wrld->nodetree) {
writestruct(wd, DATA, "bNodeTree", 1, wrld->nodetree);
write_nodetree(wd, wrld->nodetree);
}
@@ -2017,8 +2022,8 @@ static void write_lamps(WriteData *wd, ListBase *idbase)
int a;
la= idbase->first;
- while(la) {
- if(la->id.us>0 || wd->current) {
+ while (la) {
+ if (la->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_LA, "Lamp", 1, la);
if (la->id.properties) IDP_WriteProperty(la->id.properties, wd);
@@ -2026,15 +2031,15 @@ static void write_lamps(WriteData *wd, ListBase *idbase)
if (la->adt) write_animdata(wd, la->adt);
/* direct data */
- for(a=0; a<MAX_MTEX; a++) {
- if(la->mtex[a]) writestruct(wd, DATA, "MTex", 1, la->mtex[a]);
+ for (a=0; a<MAX_MTEX; a++) {
+ if (la->mtex[a]) writestruct(wd, DATA, "MTex", 1, la->mtex[a]);
}
- if(la->curfalloff)
+ if (la->curfalloff)
write_curvemapping(wd, la->curfalloff);
/* nodetree is integral part of lamps, no libdata */
- if(la->nodetree) {
+ if (la->nodetree) {
writestruct(wd, DATA, "bNodeTree", 1, la->nodetree);
write_nodetree(wd, la->nodetree);
}
@@ -2061,7 +2066,7 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
ToolSettings *tos;
sce= scebase->first;
- while(sce) {
+ while (sce) {
/* write LibData */
writestruct(wd, ID_SCE, "Scene", 1, sce);
if (sce->id.properties) IDP_WriteProperty(sce->id.properties, wd);
@@ -2071,47 +2076,47 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
/* direct data */
base= sce->base.first;
- while(base) {
+ while (base) {
writestruct(wd, DATA, "Base", 1, base);
base= base->next;
}
tos = sce->toolsettings;
writestruct(wd, DATA, "ToolSettings", 1, tos);
- if(tos->vpaint) {
+ if (tos->vpaint) {
writestruct(wd, DATA, "VPaint", 1, tos->vpaint);
}
- if(tos->wpaint) {
+ if (tos->wpaint) {
writestruct(wd, DATA, "VPaint", 1, tos->wpaint);
}
- if(tos->sculpt) {
+ if (tos->sculpt) {
writestruct(wd, DATA, "Sculpt", 1, tos->sculpt);
}
- if(tos->uvsculpt) {
+ if (tos->uvsculpt) {
writestruct(wd, DATA, "UvSculpt", 1, tos->uvsculpt);
}
// write_paint(wd, &tos->imapaint.paint);
ed= sce->ed;
- if(ed) {
+ if (ed) {
writestruct(wd, DATA, "Editing", 1, ed);
/* reset write flags too */
SEQ_BEGIN(ed, seq) {
- if(seq->strip) seq->strip->done= 0;
+ if (seq->strip) seq->strip->done= 0;
writestruct(wd, DATA, "Sequence", 1, seq);
}
SEQ_END
SEQ_BEGIN(ed, seq) {
- if(seq->strip && seq->strip->done==0) {
+ if (seq->strip && seq->strip->done==0) {
/* write strip with 'done' at 0 because readfile */
- if(seq->plugin) writestruct(wd, DATA, "PluginSeq", 1, seq->plugin);
- if(seq->effectdata) {
- switch(seq->type){
+ if (seq->plugin) writestruct(wd, DATA, "PluginSeq", 1, seq->plugin);
+ if (seq->effectdata) {
+ switch(seq->type) {
case SEQ_COLOR:
writestruct(wd, DATA, "SolidColorVars", 1, seq->effectdata);
break;
@@ -2132,21 +2137,21 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
strip= seq->strip;
writestruct(wd, DATA, "Strip", 1, strip);
- if(seq->flag & SEQ_USE_CROP && strip->crop) {
+ if (seq->flag & SEQ_USE_CROP && strip->crop) {
writestruct(wd, DATA, "StripCrop", 1, strip->crop);
}
- if(seq->flag & SEQ_USE_TRANSFORM && strip->transform) {
+ if (seq->flag & SEQ_USE_TRANSFORM && strip->transform) {
writestruct(wd, DATA, "StripTransform", 1, strip->transform);
}
- if(seq->flag & SEQ_USE_PROXY && strip->proxy) {
+ if (seq->flag & SEQ_USE_PROXY && strip->proxy) {
writestruct(wd, DATA, "StripProxy", 1, strip->proxy);
}
- if(seq->flag & SEQ_USE_COLOR_BALANCE && strip->color_balance) {
+ if (seq->flag & SEQ_USE_COLOR_BALANCE && strip->color_balance) {
writestruct(wd, DATA, "StripColorBalance", 1, strip->color_balance);
}
- if(seq->type==SEQ_IMAGE)
+ if (seq->type==SEQ_IMAGE)
writestruct(wd, DATA, "StripElem", MEM_allocN_len(strip->stripdata) / sizeof(struct StripElem), strip->stripdata);
- else if(seq->type==SEQ_MOVIE || seq->type==SEQ_RAM_SOUND || seq->type == SEQ_HD_SOUND)
+ else if (seq->type==SEQ_MOVIE || seq->type==SEQ_RAM_SOUND || seq->type == SEQ_HD_SOUND)
writestruct(wd, DATA, "StripElem", 1, strip->stripdata);
strip->done= 1;
@@ -2155,7 +2160,7 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
SEQ_END
/* new; meta stack too, even when its nasty restore code */
- for(ms= ed->metastack.first; ms; ms= ms->next) {
+ for (ms= ed->metastack.first; ms; ms= ms->next) {
writestruct(wd, DATA, "MetaStack", 1, ms);
}
}
@@ -2175,17 +2180,17 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
}
/* writing dynamic list of TimeMarkers to the blend file */
- for(marker= sce->markers.first; marker; marker= marker->next)
+ for (marker= sce->markers.first; marker; marker= marker->next)
writestruct(wd, DATA, "TimeMarker", 1, marker);
/* writing dynamic list of TransformOrientations to the blend file */
- for(ts = sce->transform_spaces.first; ts; ts = ts->next)
+ for (ts = sce->transform_spaces.first; ts; ts = ts->next)
writestruct(wd, DATA, "TransformOrientation", 1, ts);
- for(srl= sce->r.layers.first; srl; srl= srl->next)
+ for (srl= sce->r.layers.first; srl; srl= srl->next)
writestruct(wd, DATA, "SceneRenderLayer", 1, srl);
- if(sce->nodetree) {
+ if (sce->nodetree) {
writestruct(wd, DATA, "bNodeTree", 1, sce->nodetree);
write_nodetree(wd, sce->nodetree);
}
@@ -2232,10 +2237,10 @@ static void write_windowmanagers(WriteData *wd, ListBase *lb)
wmWindowManager *wm;
wmWindow *win;
- for(wm= lb->first; wm; wm= wm->id.next) {
+ for (wm= lb->first; wm; wm= wm->id.next) {
writestruct(wd, ID_WM, "wmWindowManager", 1, wm);
- for(win= wm->windows.first; win; win= win->next)
+ for (win= wm->windows.first; win; win= win->next)
writestruct(wd, DATA, "wmWindow", 1, win);
}
}
@@ -2244,16 +2249,16 @@ static void write_region(WriteData *wd, ARegion *ar, int spacetype)
{
writestruct(wd, DATA, "ARegion", 1, ar);
- if(ar->regiondata) {
+ if (ar->regiondata) {
switch(spacetype) {
case SPACE_VIEW3D:
- if(ar->regiontype==RGN_TYPE_WINDOW) {
+ if (ar->regiontype==RGN_TYPE_WINDOW) {
RegionView3D *rv3d= ar->regiondata;
writestruct(wd, DATA, "RegionView3D", 1, rv3d);
- if(rv3d->localvd)
+ if (rv3d->localvd)
writestruct(wd, DATA, "RegionView3D", 1, rv3d->localvd);
- if(rv3d->clipbb)
+ if (rv3d->clipbb)
writestruct(wd, DATA, "BoundBox", 1, rv3d->clipbb);
}
@@ -2274,7 +2279,7 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
ScrEdge *se;
sc= scrbase->first;
- while(sc) {
+ while (sc) {
/* write LibData */
/* in 2.50+ files, the file identifier for screens is patched, forward compatibility */
@@ -2283,40 +2288,40 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
IDP_WriteProperty(sc->id.properties, wd);
/* direct data */
- for(sv= sc->vertbase.first; sv; sv= sv->next)
+ for (sv= sc->vertbase.first; sv; sv= sv->next)
writestruct(wd, DATA, "ScrVert", 1, sv);
- for(se= sc->edgebase.first; se; se= se->next)
+ for (se= sc->edgebase.first; se; se= se->next)
writestruct(wd, DATA, "ScrEdge", 1, se);
- for(sa= sc->areabase.first; sa; sa= sa->next) {
+ for (sa= sc->areabase.first; sa; sa= sa->next) {
SpaceLink *sl;
Panel *pa;
ARegion *ar;
writestruct(wd, DATA, "ScrArea", 1, sa);
- for(ar= sa->regionbase.first; ar; ar= ar->next) {
+ for (ar= sa->regionbase.first; ar; ar= ar->next) {
write_region(wd, ar, sa->spacetype);
- for(pa= ar->panels.first; pa; pa= pa->next)
+ for (pa= ar->panels.first; pa; pa= pa->next)
writestruct(wd, DATA, "Panel", 1, pa);
}
sl= sa->spacedata.first;
- while(sl) {
- for(ar= sl->regionbase.first; ar; ar= ar->next)
+ while (sl) {
+ for (ar= sl->regionbase.first; ar; ar= ar->next)
write_region(wd, ar, sl->spacetype);
- if(sl->spacetype==SPACE_VIEW3D) {
+ if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D *) sl;
BGpic *bgpic;
writestruct(wd, DATA, "View3D", 1, v3d);
for (bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next)
writestruct(wd, DATA, "BGpic", 1, bgpic);
- if(v3d->localvd) writestruct(wd, DATA, "View3D", 1, v3d->localvd);
+ if (v3d->localvd) writestruct(wd, DATA, "View3D", 1, v3d->localvd);
}
- else if(sl->spacetype==SPACE_IPO) {
+ else if (sl->spacetype==SPACE_IPO) {
SpaceIpo *sipo= (SpaceIpo *)sl;
ListBase tmpGhosts = sipo->ghostCurves;
@@ -2324,70 +2329,70 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
sipo->ghostCurves.first= sipo->ghostCurves.last= NULL;
writestruct(wd, DATA, "SpaceIpo", 1, sl);
- if(sipo->ads) writestruct(wd, DATA, "bDopeSheet", 1, sipo->ads);
+ if (sipo->ads) writestruct(wd, DATA, "bDopeSheet", 1, sipo->ads);
/* reenable ghost curves */
sipo->ghostCurves= tmpGhosts;
}
- else if(sl->spacetype==SPACE_BUTS) {
+ else if (sl->spacetype==SPACE_BUTS) {
writestruct(wd, DATA, "SpaceButs", 1, sl);
}
- else if(sl->spacetype==SPACE_FILE) {
+ else if (sl->spacetype==SPACE_FILE) {
SpaceFile *sfile= (SpaceFile *)sl;
writestruct(wd, DATA, "SpaceFile", 1, sl);
- if(sfile->params)
+ if (sfile->params)
writestruct(wd, DATA, "FileSelectParams", 1, sfile->params);
}
- else if(sl->spacetype==SPACE_SEQ) {
+ else if (sl->spacetype==SPACE_SEQ) {
writestruct(wd, DATA, "SpaceSeq", 1, sl);
}
- else if(sl->spacetype==SPACE_OUTLINER) {
+ else if (sl->spacetype==SPACE_OUTLINER) {
SpaceOops *so= (SpaceOops *)sl;
writestruct(wd, DATA, "SpaceOops", 1, so);
/* outliner */
- if(so->treestore) {
+ if (so->treestore) {
writestruct(wd, DATA, "TreeStore", 1, so->treestore);
- if(so->treestore->data)
+ if (so->treestore->data)
writestruct(wd, DATA, "TreeStoreElem", so->treestore->usedelem, so->treestore->data);
}
}
- else if(sl->spacetype==SPACE_IMAGE) {
+ else if (sl->spacetype==SPACE_IMAGE) {
SpaceImage *sima= (SpaceImage *)sl;
writestruct(wd, DATA, "SpaceImage", 1, sl);
- if(sima->cumap)
+ if (sima->cumap)
write_curvemapping(wd, sima->cumap);
}
- else if(sl->spacetype==SPACE_TEXT) {
+ else if (sl->spacetype==SPACE_TEXT) {
writestruct(wd, DATA, "SpaceText", 1, sl);
}
- else if(sl->spacetype==SPACE_SCRIPT) {
+ else if (sl->spacetype==SPACE_SCRIPT) {
SpaceScript *scr = (SpaceScript*)sl;
scr->but_refs = NULL;
writestruct(wd, DATA, "SpaceScript", 1, sl);
}
- else if(sl->spacetype==SPACE_ACTION) {
+ else if (sl->spacetype==SPACE_ACTION) {
writestruct(wd, DATA, "SpaceAction", 1, sl);
}
- else if(sl->spacetype==SPACE_NLA){
+ else if (sl->spacetype==SPACE_NLA) {
SpaceNla *snla= (SpaceNla *)sl;
writestruct(wd, DATA, "SpaceNla", 1, snla);
- if(snla->ads) writestruct(wd, DATA, "bDopeSheet", 1, snla->ads);
+ if (snla->ads) writestruct(wd, DATA, "bDopeSheet", 1, snla->ads);
}
- else if(sl->spacetype==SPACE_TIME){
+ else if (sl->spacetype==SPACE_TIME) {
writestruct(wd, DATA, "SpaceTime", 1, sl);
}
- else if(sl->spacetype==SPACE_NODE){
+ else if (sl->spacetype==SPACE_NODE) {
writestruct(wd, DATA, "SpaceNode", 1, sl);
}
- else if(sl->spacetype==SPACE_LOGIC){
+ else if (sl->spacetype==SPACE_LOGIC) {
writestruct(wd, DATA, "SpaceLogic", 1, sl);
}
- else if(sl->spacetype==SPACE_CONSOLE) {
+ else if (sl->spacetype==SPACE_CONSOLE) {
SpaceConsole *con = (SpaceConsole*)sl;
ConsoleLine *cl;
@@ -2399,10 +2404,10 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
writestruct(wd, DATA, "SpaceConsole", 1, sl);
}
- else if(sl->spacetype==SPACE_USERPREF) {
+ else if (sl->spacetype==SPACE_USERPREF) {
writestruct(wd, DATA, "SpaceUserPref", 1, sl);
}
- else if(sl->spacetype==SPACE_CLIP) {
+ else if (sl->spacetype==SPACE_CLIP) {
writestruct(wd, DATA, "SpaceClip", 1, sl);
}
@@ -2420,28 +2425,28 @@ static void write_libraries(WriteData *wd, Main *main)
ID *id;
int a, tot, foundone;
- for(; main; main= main->next) {
+ for (; main; main= main->next) {
a=tot= set_listbasepointers(main, lbarray);
/* test: is lib being used */
foundone= 0;
- while(tot--) {
- for(id= lbarray[tot]->first; id; id= id->next) {
- if(id->us>0 && (id->flag & LIB_EXTERN)) {
+ while (tot--) {
+ for (id= lbarray[tot]->first; id; id= id->next) {
+ if (id->us>0 && (id->flag & LIB_EXTERN)) {
foundone= 1;
break;
}
}
- if(foundone) break;
+ if (foundone) break;
}
- if(foundone) {
+ if (foundone) {
writestruct(wd, ID_LI, "Library", 1, main->curlib);
- while(a--) {
- for(id= lbarray[a]->first; id; id= id->next) {
- if(id->us>0 && (id->flag & LIB_EXTERN)) {
+ while (a--) {
+ for (id= lbarray[a]->first; id; id= id->next) {
+ if (id->us>0 && (id->flag & LIB_EXTERN)) {
writestruct(wd, ID_ID, "ID", 1, id);
}
}
@@ -2467,7 +2472,7 @@ static void write_bone(WriteData *wd, Bone* bone)
// Write Children
cbone= bone->childbase.first;
- while(cbone) {
+ while (cbone) {
write_bone(wd, cbone);
cbone= cbone->next;
}
@@ -2488,7 +2493,7 @@ static void write_armatures(WriteData *wd, ListBase *idbase)
/* Direct data */
bone= arm->bonebase.first;
- while(bone) {
+ while (bone) {
write_bone(wd, bone);
bone=bone->next;
}
@@ -2507,15 +2512,15 @@ static void write_texts(WriteData *wd, ListBase *idbase)
TextMarker *mrk;
text= idbase->first;
- while(text) {
+ while (text) {
if ( (text->flags & TXT_ISMEM) && (text->flags & TXT_ISEXT)) text->flags &= ~TXT_ISEXT;
/* write LibData */
writestruct(wd, ID_TXT, "Text", 1, text);
- if(text->name) writedata(wd, DATA, strlen(text->name)+1, text->name);
+ if (text->name) writedata(wd, DATA, strlen(text->name)+1, text->name);
if (text->id.properties) IDP_WriteProperty(text->id.properties, wd);
- if(!(text->flags & TXT_ISEXT)) {
+ if (!(text->flags & TXT_ISEXT)) {
/* now write the text data, in two steps for optimization in the readfunction */
tmp= text->lines.first;
while (tmp) {
@@ -2550,8 +2555,8 @@ static void write_speakers(WriteData *wd, ListBase *idbase)
Speaker *spk;
spk= idbase->first;
- while(spk) {
- if(spk->id.us>0 || wd->current) {
+ while (spk) {
+ if (spk->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_SPK, "Speaker", 1, spk);
if (spk->id.properties) IDP_WriteProperty(spk->id.properties, wd);
@@ -2569,8 +2574,8 @@ static void write_sounds(WriteData *wd, ListBase *idbase)
PackedFile * pf;
sound= idbase->first;
- while(sound) {
- if(sound->id.us>0 || wd->current) {
+ while (sound) {
+ if (sound->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_SO, "bSound", 1, sound);
if (sound->id.properties) IDP_WriteProperty(sound->id.properties, wd);
@@ -2593,14 +2598,14 @@ static void write_groups(WriteData *wd, ListBase *idbase)
Group *group;
GroupObject *go;
- for(group= idbase->first; group; group= group->id.next) {
- if(group->id.us>0 || wd->current) {
+ for (group= idbase->first; group; group= group->id.next) {
+ if (group->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_GR, "Group", 1, group);
if (group->id.properties) IDP_WriteProperty(group->id.properties, wd);
go= group->gobject.first;
- while(go) {
+ while (go) {
writestruct(wd, DATA, "GroupObject", 1, go);
go= go->next;
}
@@ -2612,7 +2617,7 @@ static void write_nodetrees(WriteData *wd, ListBase *idbase)
{
bNodeTree *ntree;
- for(ntree=idbase->first; ntree; ntree= ntree->id.next) {
+ for (ntree=idbase->first; ntree; ntree= ntree->id.next) {
if (ntree->id.us>0 || wd->current) {
writestruct(wd, ID_NT, "bNodeTree", 1, ntree);
write_nodetree(wd, ntree);
@@ -2628,14 +2633,14 @@ static void write_brushes(WriteData *wd, ListBase *idbase)
{
Brush *brush;
- for(brush=idbase->first; brush; brush= brush->id.next) {
- if(brush->id.us>0 || wd->current) {
+ for (brush=idbase->first; brush; brush= brush->id.next) {
+ if (brush->id.us>0 || wd->current) {
writestruct(wd, ID_BR, "Brush", 1, brush);
if (brush->id.properties) IDP_WriteProperty(brush->id.properties, wd);
writestruct(wd, DATA, "MTex", 1, &brush->mtex);
- if(brush->curve)
+ if (brush->curve)
write_curvemapping(wd, brush->curve);
}
}
@@ -2645,8 +2650,8 @@ static void write_scripts(WriteData *wd, ListBase *idbase)
{
Script *script;
- for(script=idbase->first; script; script= script->id.next) {
- if(script->id.us>0 || wd->current) {
+ for (script=idbase->first; script; script= script->id.next) {
+ if (script->id.us>0 || wd->current) {
writestruct(wd, ID_SCRIPT, "Script", 1, script);
if (script->id.properties) IDP_WriteProperty(script->id.properties, wd);
}
@@ -2658,10 +2663,10 @@ static void write_movieTracks(WriteData *wd, ListBase *tracks)
MovieTrackingTrack *track;
track= tracks->first;
- while(track) {
+ while (track) {
writestruct(wd, DATA, "MovieTrackingTrack", 1, track);
- if(track->markers)
+ if (track->markers)
writestruct(wd, DATA, "MovieTrackingMarker", track->markersnr, track->markers);
track= track->next;
@@ -2670,7 +2675,7 @@ static void write_movieTracks(WriteData *wd, ListBase *tracks)
static void write_movieReconstruction(WriteData *wd, MovieTrackingReconstruction *reconstruction)
{
- if(reconstruction->camnr)
+ if (reconstruction->camnr)
writestruct(wd, DATA, "MovieReconstructedCamera", reconstruction->camnr, reconstruction->cameras);
}
@@ -2679,20 +2684,20 @@ static void write_movieclips(WriteData *wd, ListBase *idbase)
MovieClip *clip;
clip= idbase->first;
- while(clip) {
- if(clip->id.us>0 || wd->current) {
+ while (clip) {
+ if (clip->id.us>0 || wd->current) {
MovieTracking *tracking= &clip->tracking;
MovieTrackingObject *object;
writestruct(wd, ID_MC, "MovieClip", 1, clip);
- if(clip->adt)
+ if (clip->adt)
write_animdata(wd, clip->adt);
write_movieTracks(wd, &tracking->tracks);
write_movieReconstruction(wd, &tracking->reconstruction);
object= tracking->objects.first;
- while(object) {
+ while (object) {
writestruct(wd, DATA, "MovieTrackingObject", 1, object);
write_movieTracks(wd, &object->tracks);
@@ -2759,7 +2764,7 @@ static void write_global(WriteData *wd, int fileflags, Main *mainvar)
*/
static void write_thumb(WriteData *wd, int *img)
{
- if(img)
+ if (img)
writedata(wd, TEST, (2 + img[0] * img[1]) * sizeof(int), img);
}
@@ -2788,7 +2793,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil
write_global(wd, write_flags, mainvar);
/* no UI save in undo */
- if(current==NULL) {
+ if (current==NULL) {
write_windowmanagers(wd, &mainvar->wm);
write_screens (wd, &mainvar->screen);
}
@@ -2844,17 +2849,17 @@ static int do_history(const char *name, ReportList *reports)
char tempname1[FILE_MAX], tempname2[FILE_MAX];
int hisnr= U.versions;
- if(U.versions==0) return 0;
- if(strlen(name)<2) {
+ if (U.versions==0) return 0;
+ if (strlen(name)<2) {
BKE_report(reports, RPT_ERROR, "Unable to make version backup: filename too short");
return 1;
}
- while(hisnr > 1) {
+ while (hisnr > 1) {
BLI_snprintf(tempname1, sizeof(tempname1), "%s%d", name, hisnr-1);
BLI_snprintf(tempname2, sizeof(tempname2), "%s%d", name, hisnr);
- if(BLI_rename(tempname1, tempname2)) {
+ if (BLI_rename(tempname1, tempname2)) {
BKE_report(reports, RPT_ERROR, "Unable to make version backup");
return 1;
}
@@ -2864,7 +2869,7 @@ static int do_history(const char *name, ReportList *reports)
/* is needed when hisnr==1 */
BLI_snprintf(tempname1, sizeof(tempname1), "%s%d", name, hisnr);
- if(BLI_rename(name, tempname1)) {
+ if (BLI_rename(name, tempname1)) {
BKE_report(reports, RPT_ERROR, "Unable to make version backup");
return 1;
}
@@ -2882,32 +2887,32 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
/* open temporary file, so we preserve the original in case we crash */
BLI_snprintf(tempname, sizeof(tempname), "%s@", filepath);
- file = open(tempname,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
- if(file == -1) {
+ file = BLI_open(tempname,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
+ if (file == -1) {
BKE_reportf(reports, RPT_ERROR, "Can't open file %s for writing: %s.", tempname, strerror(errno));
return 0;
}
/* remapping of relative paths to new file location */
- if(write_flags & G_FILE_RELATIVE_REMAP) {
+ if (write_flags & G_FILE_RELATIVE_REMAP) {
char dir1[FILE_MAX];
char dir2[FILE_MAX];
BLI_split_dir_part(filepath, dir1, sizeof(dir1));
BLI_split_dir_part(mainvar->name, dir2, sizeof(dir2));
- /* 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);
- if(BLI_path_cmp(dir1, dir2)==0) {
+ if (BLI_path_cmp(dir1, dir2)==0) {
write_flags &= ~G_FILE_RELATIVE_REMAP;
}
else {
- if(G.relbase_valid) {
+ if (G.relbase_valid) {
/* blend may not have been saved before. Tn this case
* we should not have any relative paths, but if there
* is somehow, an invalid or empty G.main->name it will
- * print an error, dont try make the absolute in this case. */
+ * print an error, don't try make the absolute in this case. */
makeFilesAbsolute(mainvar, G.main->name, NULL);
}
}
@@ -2916,7 +2921,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
BLI_make_file_string(G.main->name, userfilename, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_STARTUP_FILE);
write_user_block= (BLI_path_cmp(filepath, userfilename) == 0);
- if(write_flags & G_FILE_RELATIVE_REMAP)
+ if (write_flags & G_FILE_RELATIVE_REMAP)
makeFilesRelative(mainvar, filepath, NULL); /* note, making relative to something OTHER then G.main->name */
/* actual file writing */
@@ -2940,7 +2945,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
}
}
- if(write_flags & G_FILE_COMPRESS) {
+ if (write_flags & G_FILE_COMPRESS) {
/* compressed files have the same ending as regular files... only from 2.4!!! */
char gzname[FILE_MAX+4];
int ret;
@@ -2949,25 +2954,25 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
BLI_snprintf(gzname, sizeof(gzname), "%s@.gz", filepath);
ret = BLI_file_gzip(tempname, gzname);
- if(0==ret) {
+ if (0==ret) {
/* now rename to real file name, and delete temp @ file too */
- if(BLI_rename(gzname, filepath) != 0) {
+ if (BLI_rename(gzname, filepath) != 0) {
BKE_report(reports, RPT_ERROR, "Can't change old file. File saved with @.");
return 0;
}
BLI_delete(tempname, 0, 0);
}
- else if(-1==ret) {
+ else if (-1==ret) {
BKE_report(reports, RPT_ERROR, "Failed opening .gz file.");
return 0;
}
- else if(-2==ret) {
+ else if (-2==ret) {
BKE_report(reports, RPT_ERROR, "Failed opening .blend file for compression.");
return 0;
}
}
- else if(BLI_rename(tempname, filepath) != 0) {
+ else if (BLI_rename(tempname, filepath) != 0) {
BKE_report(reports, RPT_ERROR, "Can't change old file. File saved with @");
return 0;
}
@@ -2982,6 +2987,6 @@ int BLO_write_file_mem(Main *mainvar, MemFile *compare, MemFile *current, int wr
err= write_file_handle(mainvar, 0, compare, current, 0, write_flags, NULL);
- if(err==0) return 1;
+ if (err==0) return 1;
return 0;
}
diff --git a/source/blender/blenpluginapi/documentation.h b/source/blender/blenpluginapi/documentation.h
index 45e9ec7f2e4..3e4aa3cd2ed 100644
--- a/source/blender/blenpluginapi/documentation.h
+++ b/source/blender/blenpluginapi/documentation.h
@@ -27,13 +27,13 @@
* @mainpage plugin API - the access point for texture and sequence
* plugins
*
- * @section about About the plugin API
+ * \section about About the plugin API
*
* This API wraps functions that are used by texture and sequence
* plugins. They are explicitly wrapped in order to make the
* dependencies to the rest of the system clear.
*
- * @section issues Known issues with the plugin API
+ * \section issues Known issues with the plugin API
*
* - It can be difficult at times to get access to the API functions
* linked into the final executable. On gcc, the -fpic and -shared
@@ -59,7 +59,7 @@
* code. It will be removed as soon as the replacing system is in
* place.
*
- * @section dependencies Dependencies
+ * \section dependencies Dependencies
*
* The plugins wraps functions from IMB and BLI. In addition, they
* define some useful variables.
diff --git a/source/blender/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..02166c466fa 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"
@@ -186,7 +186,7 @@ LIBEXPORT int ispic(char * name)
}
/* still the same name */
-/* void (*ditherfunc)(struct ImBuf *, short, short){} */
+/* void (*ditherfunc)(struct ImBuf *, short, short) {} */
LIBEXPORT struct ImBuf *scaleImBuf(struct ImBuf *ib,
short nx,
@@ -220,7 +220,7 @@ LIBEXPORT void de_interlace(struct ImBuf *ib)
/* stuff from plugin.h */
/* -------------------------------------------------------------------------- */
-/* These three need to be defined in the plugion itself. The plugin
+/* These three need to be defined in the plugin itself. The plugin
* loader looks for these functions to check whether it can use the
* plugin. For sequences, something similar exists. */
/* int plugin_tex_getversion(void); */
diff --git a/source/blender/bmesh/CMakeLists.txt b/source/blender/bmesh/CMakeLists.txt
index 0d39a99117c..3dc10c5f97f 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
@@ -70,6 +41,7 @@ set(SRC
operators/bmo_dupe.c
operators/bmo_edgesplit.c
operators/bmo_extrude.c
+ operators/bmo_inset.c
operators/bmo_join_triangles.c
operators/bmo_mesh_conv.c
operators/bmo_mirror.c
@@ -84,20 +56,24 @@ set(SRC
intern/bmesh_construct.h
intern/bmesh_core.c
intern/bmesh_core.h
- intern/bmesh_inline.c
+ intern/bmesh_inline.h
intern/bmesh_interp.c
intern/bmesh_interp.h
intern/bmesh_iterators.c
intern/bmesh_iterators.h
- intern/bmesh_iterators_inline.c
+ intern/bmesh_iterators_inline.h
intern/bmesh_marking.c
intern/bmesh_marking.h
intern/bmesh_mesh.c
intern/bmesh_mesh.h
+ intern/bmesh_mesh_conv.c
+ intern/bmesh_mesh_conv.h
+ intern/bmesh_mesh_validate.c
+ intern/bmesh_mesh_validate.h
intern/bmesh_mods.c
intern/bmesh_mods.h
intern/bmesh_opdefines.c
- intern/bmesh_operator_api_inline.c
+ intern/bmesh_operator_api_inline.h
intern/bmesh_operators.c
intern/bmesh_operators.h
intern/bmesh_operators_private.h
@@ -113,30 +89,15 @@ set(SRC
intern/bmesh_walkers_impl.c
intern/bmesh_walkers_private.h
+ intern/bmesh_operator_api.h
+ intern/bmesh_error.h
+
tools/BME_bevel.c
bmesh.h
bmesh_class.h
- bmesh_error.h
- 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..e06f43bd85d 100644
--- a/source/blender/bmesh/SConscript
+++ b/source/blender/bmesh/SConscript
@@ -2,39 +2,20 @@
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')
-#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 91e45d640ef..81bd164fbdf 100644
--- a/source/blender/bmesh/bmesh.h
+++ b/source/blender/bmesh/bmesh.h
@@ -198,137 +198,17 @@
extern "C" {
#endif
-#include "DNA_listBase.h"
-#include "DNA_customdata_types.h"
+#include "DNA_listBase.h" /* selection history uses */
+#include "DNA_customdata_types.h" /* BMesh struct in bmesh_class.h uses */
-#include "BLI_utildefines.h"
+#include <stdlib.h>
+// #include "BLI_utildefines.h"
#include "bmesh_class.h"
-/*forward declarations*/
-
-/*
- * BMHeader
- *
- * All mesh elements begin with a BMHeader. This structure
- * hold several types of data
- *
- * 1: The type of the element (vert, edge, loop or face)
- * 2: Persistant "header" flags/markings (sharp, seam, select, hidden, ect)
- note that this is different from the "tool" flags.
- * 3: Unique ID in the bmesh.
- * 4: some elements for internal record keeping.
- *
-*/
-
-/* BMHeader->htype (char) */
-enum {
- BM_VERT = 1,
- BM_EDGE = 2,
- BM_LOOP = 4,
- BM_FACE = 8
-};
-
-#define BM_ALL (BM_VERT | BM_EDGE | BM_LOOP | BM_FACE)
-
-/* BMHeader->hflag (char) */
-enum {
- BM_ELEM_SELECT = (1 << 0),
- BM_ELEM_HIDDEN = (1 << 1),
- BM_ELEM_SEAM = (1 << 2),
- BM_ELEM_SMOOTH = (1 << 3), /* used for faces and edges, note from the user POV,
- * this is a sharp edge when disabled */
-
- BM_ELEM_TAG = (1 << 4), /* internal flag, used for ensuring correct normals
- * during multires interpolation, and any other time
- * when temp tagging is handy.
- * always assume dirty & clear before use. */
-
- /* we have 2 spare flags which is awesome but since we're limited to 8
- * only add new flags with care! - campbell */
- /* BM_ELEM_SPARE = (1 << 5), */
- /* BM_ELEM_SPARE = (1 << 6), */
-
- BM_ELEM_INTERNAL_TAG = (1 << 7) /* for low level internal API tagging,
- * since tools may want to tag verts and
- * not have functions clobber them */
-};
-
-/* Mesh Level Ops */
-extern int bm_mesh_allocsize_default[4];
-
-
-/* ------------------------------------------------------------------------- */
-/* bmesh_inline.c */
-
-/* stuff for dealing with header flags */
-#define BM_elem_flag_test( ele, hflag) _bm_elem_flag_test (&(ele)->head, hflag)
-#define BM_elem_flag_enable( ele, hflag) _bm_elem_flag_enable (&(ele)->head, hflag)
-#define BM_elem_flag_disable(ele, hflag) _bm_elem_flag_disable (&(ele)->head, hflag)
-#define BM_elem_flag_set( ele, hflag, val) _bm_elem_flag_set (&(ele)->head, hflag, val)
-#define BM_elem_flag_toggle( ele, hflag) _bm_elem_flag_toggle (&(ele)->head, hflag)
-#define BM_elem_flag_merge( ele_a, ele_b) _bm_elem_flag_merge (&(ele_a)->head, &(ele_b)->head)
-
-BM_INLINE char _bm_elem_flag_test(const BMHeader *head, const char hflag);
-BM_INLINE void _bm_elem_flag_enable(BMHeader *head, const char hflag);
-BM_INLINE void _bm_elem_flag_disable(BMHeader *head, const char hflag);
-BM_INLINE void _bm_elem_flag_set(BMHeader *head, const char hflag, const int val);
-BM_INLINE void _bm_elem_flag_toggle(BMHeader *head, const char hflag);
-BM_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b);
-
-/* notes on BM_elem_index_set(...) usage,
- * Set index is sometimes abused as temp storage, other times we cant be
- * sure if the index values are valid because certain operations have modified
- * the mesh structure.
- *
- * To set the elements to valid indicies 'BM_mesh_elem_index_ensure' should be used
- * rather then adding inline loops, however there are cases where we still
- * set the index directly
- *
- * In an attempt to manage this, here are 3 tags Im adding to uses of
- * 'BM_elem_index_set'
- *
- * - 'set_inline' -- since the data is already being looped over set to a
- * valid value inline.
- *
- * - 'set_dirty!' -- intentionally sets the index to an invalid value,
- * flagging 'bm->elem_index_dirty' so we dont use it.
- *
- * - 'set_ok' -- this is valid use since the part of the code is low level.
- *
- * - 'set_ok_invalid' -- set to -1 on purpose since this should not be
- * used without a full array re-index, do this on
- * adding new vert/edge/faces since they may be added at
- * the end of the array.
- *
- * - 'set_loop' -- currently loop index values are not used used much so
- * assume each case they are dirty.
- * - campbell */
-
-#define BM_elem_index_get(ele) _bm_elem_index_get(&(ele)->head)
-#define BM_elem_index_set(ele, index) _bm_elem_index_set(&(ele)->head, index)
-BM_INLINE int _bm_elem_index_get(const BMHeader *ele);
-BM_INLINE void _bm_elem_index_set(BMHeader *ele, const int index);
-
-#ifdef USE_BMESH_HOLES
-# define BM_FACE_FIRST_LOOP(p) (((BMLoopList *)((p)->loops.first))->first)
-#else
-# define BM_FACE_FIRST_LOOP(p) ((p)->l_first)
-#endif
-
-/* size to use for static arrays when dealing with NGons,
- * alloc after this limit is reached.
- * this value is rather arbitrary */
-#define BM_NGON_STACK_SIZE 32
-
-/* avoid inf loop, this value is arbtrary
- * but should not error on valid cases */
-#define BM_LOOP_RADIAL_MAX 10000
-#define BM_NGON_MAX 100000
-
/* include the rest of the API */
-#include "bmesh_operator_api.h"
-#include "bmesh_error.h"
+#include "intern/bmesh_operator_api.h"
+#include "intern/bmesh_error.h"
#include "intern/bmesh_construct.h"
#include "intern/bmesh_core.h"
@@ -336,15 +216,15 @@ 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_mesh_validate.h"
#include "intern/bmesh_mods.h"
#include "intern/bmesh_operators.h"
#include "intern/bmesh_polygon.h"
#include "intern/bmesh_queries.h"
#include "intern/bmesh_walkers.h"
-#include "intern/bmesh_walkers.h"
-#include "intern/bmesh_inline.c"
-#include "intern/bmesh_operator_api_inline.c"
+#include "intern/bmesh_inline.h"
#ifdef __cplusplus
}
diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h
index f071e00211c..8c8272736e9 100644
--- a/source/blender/bmesh/bmesh_class.h
+++ b/source/blender/bmesh/bmesh_class.h
@@ -47,6 +47,19 @@ struct Object;
*
* hrm. it doesnt but stull works ok, remove the comment above? - campbell.
*/
+
+/**
+ * BMHeader
+ *
+ * All mesh elements begin with a BMHeader. This structure
+ * hold several types of data
+ *
+ * 1: The type of the element (vert, edge, loop or face)
+ * 2: Persistent "header" flags/markings (smooth, seam, select, hidden, ect)
+ * note that this is different from the "tool" flags.
+ * 3: Unique ID in the bmesh.
+ * 4: some elements for internal record keeping.
+ */
typedef struct BMHeader {
void *data; /* customdata layers */
int index; /* notes:
@@ -54,7 +67,7 @@ typedef struct BMHeader {
* - Unitialized to -1 so we can easily tell its not set.
* - Used for edge/vert/face, check BMesh.elem_index_dirty for valid index values,
* this is abused by various tools which set it dirty.
- * - For loops this is used for sorting during tesselation. */
+ * - For loops this is used for sorting during tessellation. */
char htype; /* element geometric type (verts/edges/loops/faces) */
char hflag; /* this would be a CD layer, see below */
@@ -97,6 +110,8 @@ typedef struct BMLoop {
struct BMEdge *e; /* edge, using verts (v, next->v) */
struct BMFace *f;
+ /* circular linked list of loops which all use the same edge as this one '->e',
+ * but not necessarily the same vertex (can be either v1 or v2 of our own '->e') */
struct BMLoop *radial_next, *radial_prev;
/* these were originally commented as private but are used all over the code */
@@ -104,7 +119,7 @@ typedef struct BMLoop {
struct BMLoop *next, *prev; /* next/prev verts around the face */
} BMLoop;
-/* can cast BMFace/BMEdge/BMVert, but NOT BMLoop, since these dont have a flag layer */
+/* can cast BMFace/BMEdge/BMVert, but NOT BMLoop, since these don't have a flag layer */
typedef struct BMElemF {
BMHeader head;
struct BMFlagLayer *oflags; /* keep after header, an array of flags, mostly used by the operator stack */
@@ -149,7 +164,7 @@ typedef struct BMesh {
/* flag index arrays as being dirty so we can check if they are clean and
* avoid looping over the entire vert/edge/face array in those cases.
* valid flags are - BM_VERT | BM_EDGE | BM_FACE.
- * BM_LOOP isnt handled so far. */
+ * BM_LOOP isn't handled so far. */
char elem_index_dirty;
/*element pools*/
@@ -168,7 +183,7 @@ typedef struct BMesh {
/* should be copy of scene select mode */
/* stored in BMEditMesh too, this is a bit confusing,
- * make sure the're in sync!
+ * make sure they're in sync!
* Only use when the edit mesh cant be accessed - campbell */
short selectmode;
@@ -181,11 +196,63 @@ typedef struct BMesh {
BMFace *act_face;
ListBase errorstack;
- struct Object *ob; /* owner object */
-
+
void *py_handle;
int opflag; /* current operator flag */
} BMesh;
+/* BMHeader->htype (char) */
+enum {
+ BM_VERT = 1,
+ BM_EDGE = 2,
+ BM_LOOP = 4,
+ BM_FACE = 8
+};
+
+#define BM_ALL (BM_VERT | BM_EDGE | BM_LOOP | BM_FACE)
+
+/* BMHeader->hflag (char) */
+enum {
+ BM_ELEM_SELECT = (1 << 0),
+ BM_ELEM_HIDDEN = (1 << 1),
+ BM_ELEM_SEAM = (1 << 2),
+ BM_ELEM_SMOOTH = (1 << 3), /* used for faces and edges, note from the user POV,
+ * this is a sharp edge when disabled */
+
+ BM_ELEM_TAG = (1 << 4), /* internal flag, used for ensuring correct normals
+ * during multires interpolation, and any other time
+ * when temp tagging is handy.
+ * always assume dirty & clear before use. */
+
+ /* we have 2 spare flags which is awesome but since we're limited to 8
+ * only add new flags with care! - campbell */
+ /* BM_ELEM_SPARE = (1 << 5), */
+ /* BM_ELEM_SPARE = (1 << 6), */
+
+ BM_ELEM_INTERNAL_TAG = (1 << 7) /* for low level internal API tagging,
+ * since tools may want to tag verts and
+ * not have functions clobber them */
+};
+
+/* defines */
+
+/*forward declarations*/
+
+#ifdef USE_BMESH_HOLES
+# define BM_FACE_FIRST_LOOP(p) (((BMLoopList *)((p)->loops.first))->first)
+#else
+# define BM_FACE_FIRST_LOOP(p) ((p)->l_first)
+#endif
+
+/* size to use for static arrays when dealing with NGons,
+ * alloc after this limit is reached.
+ * this value is rather arbitrary */
+#define BM_NGON_STACK_SIZE 32
+
+/* avoid inf loop, this value is arbitrary
+ * but should not error on valid cases */
+#define BM_LOOP_RADIAL_MAX 10000
+#define BM_NGON_MAX 100000
+
#endif /* __BMESH_CLASS_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c
index 7ff8fd0b7f4..974bc814d9b 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
@@ -76,6 +76,27 @@ BMFace *BM_face_create_quad_tri_v(BMesh *bm, BMVert **verts, int len, const BMFa
BMFace *f = NULL;
int is_overlap = FALSE;
+ /* sanity check - debug mode only */
+ if (len == 3) {
+ BLI_assert(verts[0] != verts[1]);
+ BLI_assert(verts[0] != verts[2]);
+ BLI_assert(verts[1] != verts[2]);
+ }
+ else if (len == 4) {
+ BLI_assert(verts[0] != verts[1]);
+ BLI_assert(verts[0] != verts[2]);
+ BLI_assert(verts[0] != verts[3]);
+
+ BLI_assert(verts[1] != verts[2]);
+ BLI_assert(verts[1] != verts[3]);
+
+ BLI_assert(verts[2] != verts[3]);
+ }
+ else {
+ BLI_assert(0);
+ }
+
+
if (nodouble) {
/* check if face exists or overlaps */
is_overlap = BM_face_exists(bm, verts, len, &f);
@@ -263,9 +284,197 @@ err:
return NULL;
}
+typedef struct AngleIndexPair {
+ float angle;
+ int index;
+} AngleIndexPair;
+
+static int angle_index_pair_cmp(const void *e1, const void *e2)
+{
+ const AngleIndexPair *p1 = e1, *p2 = e2;
+ if (p1->angle > p2->angle) return 1;
+ else if (p1->angle < p2->angle) return -1;
+ else return 0;
+}
+
+/**
+ * Makes an NGon from an un-ordered set of verts
+ *
+ * assumes...
+ * - that verts are only once in the list.
+ * - that the verts have roughly planer bounds
+ * - that the verts are roughly circular
+ * there can be concave areas but overlapping folds from the center point will fail.
+ *
+ * a brief explanation of the method used
+ * - find the center point
+ * - find the normal of the vcloud
+ * - order the verts around the face based on their angle to the normal vector at the center point.
+ *
+ * \note Since this is a vcloud there is no direction.
+ */
+BMFace *BM_face_create_ngon_vcloud(BMesh *bm, BMVert **vert_arr, int totv, int nodouble)
+{
+ BMFace *f;
+
+ float totv_inv = 1.0f / (float)totv;
+ int i = 0;
+
+ float cent[3], nor[3];
+
+ float *far = NULL, *far_cross = NULL;
+
+ float far_vec[3];
+ float far_cross_vec[3];
+ float sign_vec[3]; /* work out if we are pos/neg angle */
-/* bmesh_make_face_from_face(BMesh *bm, BMFace *source, BMFace *target) */
+ float far_dist, far_best;
+ float far_cross_dist, far_cross_best = 0.0f;
+
+ AngleIndexPair *vang;
+
+ BMVert **vert_arr_map;
+ BMEdge **edge_arr;
+ int i_prev;
+
+ unsigned int winding[2] = {0, 0};
+
+ /* get the center point and collect vector array since we loop over these a lot */
+ zero_v3(cent);
+ for (i = 0; i < totv; i++) {
+ madd_v3_v3fl(cent, vert_arr[i]->co, totv_inv);
+ }
+
+
+ /* find the far point from cent */
+ far_best = 0.0f;
+ for (i = 0; i < totv; i++) {
+ far_dist = len_squared_v3v3(vert_arr[i]->co, cent);
+ if (far_dist > far_best || far == NULL) {
+ far = vert_arr[i]->co;
+ far_best = far_dist;
+ }
+ }
+
+ sub_v3_v3v3(far_vec, far, cent);
+ far_dist = len_v3(far_vec); /* real dist */
+
+ /* --- */
+
+ /* find a point 90deg about to compare with */
+ far_cross_best = 0.0f;
+ for (i = 0; i < totv; i++) {
+
+ if (far == vert_arr[i]->co) {
+ continue;
+ }
+
+ sub_v3_v3v3(far_cross_vec, vert_arr[i]->co, cent);
+ far_cross_dist = normalize_v3(far_cross_vec);
+
+ /* more of a weight then a distance */
+ far_cross_dist = (/* first we want to have a value close to zero mapped to 1 */
+ 1.0 - fabsf(dot_v3v3(far_vec, far_cross_vec)) *
+
+ /* second we multiply by the distance
+ * so points close to the center are not preferred */
+ far_cross_dist);
+
+ if (far_cross_dist > far_cross_best || far_cross == NULL) {
+ far_cross = vert_arr[i]->co;
+ far_cross_best = far_cross_dist;
+ }
+ }
+ sub_v3_v3v3(far_cross_vec, far_cross, cent);
+
+ /* --- */
+
+ /* now we have 2 vectors we can have a cross product */
+ cross_v3_v3v3(nor, far_vec, far_cross_vec);
+ normalize_v3(nor);
+ cross_v3_v3v3(sign_vec, far_vec, nor); /* this vector should match 'far_cross_vec' closely */
+
+ /* --- */
+
+ /* now calcualte every points angle around the normal (signed) */
+ vang = MEM_mallocN(sizeof(AngleIndexPair) * totv, __func__);
+
+ for (i = 0; i < totv; i++) {
+ float co[3];
+ float proj_vec[3];
+ float angle;
+
+ /* center relative vec */
+ sub_v3_v3v3(co, vert_arr[i]->co, cent);
+
+ /* align to plane */
+ project_v3_v3v3(proj_vec, co, nor);
+ sub_v3_v3(co, proj_vec);
+
+ /* now 'co' is valid - we can compare its angle against the far vec */
+ angle = angle_v3v3(far_vec, co);
+
+ if (dot_v3v3(co, sign_vec) < 0.0f) {
+ angle = -angle;
+ }
+
+ vang[i].angle = angle;
+ vang[i].index = i;
+ }
+
+ /* sort by angle and magic! - we have our ngon */
+ qsort(vang, totv, sizeof(AngleIndexPair), angle_index_pair_cmp);
+
+ /* --- */
+
+ /* create edges and find the winding (if faces are attached to any existing edges) */
+ vert_arr_map = MEM_mallocN(sizeof(BMVert **) * totv, __func__);
+ edge_arr = MEM_mallocN(sizeof(BMEdge **) * totv, __func__);
+
+ for (i = 0; i < totv; i++) {
+ vert_arr_map[i] = vert_arr[vang[i].index];
+ }
+ MEM_freeN(vang);
+
+ i_prev = totv - 1;
+ for (i = 0; i < totv; i++) {
+ edge_arr[i] = BM_edge_create(bm, vert_arr_map[i_prev], vert_arr_map[i], NULL, TRUE);
+
+ /* the edge may exist already and be attached to a face
+ * in this case we can find the best winding to use for the new face */
+ if (edge_arr[i]->l) {
+ BMVert *test_v1, *test_v2;
+ /* we want to use the reverse winding to the existing order */
+ BM_edge_ordered_verts(edge_arr[i], &test_v2, &test_v1);
+ winding[(vert_arr_map[i_prev] == test_v2)]++;
+
+ }
+
+ i_prev = i;
+ }
+
+ /* --- */
+
+ if (winding[0] < winding[1]) {
+ winding[0] = 1;
+ winding[1] = 0;
+ }
+ else {
+ winding[0] = 0;
+ winding[1] = 1;
+ }
+
+ /* --- */
+
+ /* create the face */
+ f = BM_face_create_ngon(bm, vert_arr_map[winding[0]], vert_arr_map[winding[1]], edge_arr, totv, nodouble);
+
+ MEM_freeN(edge_arr);
+ MEM_freeN(vert_arr_map);
+
+ return f;
+}
/**
* Called by operators to remove elements that they have marked for
@@ -312,7 +521,7 @@ void BMO_remove_tagged_verts(BMesh *bm, const short oflag)
* api functions that take a filter callback.....
* and this new filter type will be for opstack flags.
* This is because the BM_remove_taggedXXX functions bypass iterator API.
- * - Ops dont care about 'UI' considerations like selection state, hide state, ect.
+ * - Ops don't care about 'UI' considerations like selection state, hide state, ect.
* If you want to work on unhidden selections for instance,
* copy output from a 'select context' operator to another operator....
*/
@@ -323,18 +532,19 @@ static void bmo_remove_tagged_context_verts(BMesh *bm, const short oflag)
BMEdge *e;
BMFace *f;
- BMIter verts;
- BMIter edges;
- BMIter faces;
+ BMIter iter;
+ BMIter itersub;
- for (v = BM_iter_new(&verts, bm, BM_VERTS_OF_MESH, bm); v; v = BM_iter_step(&verts)) {
+ BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
if (BMO_elem_flag_test(bm, v, oflag)) {
/* Visit edge */
- for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_VERT, v); e; e = BM_iter_step(&edges))
+ BM_ITER(e, &itersub, bm, BM_EDGES_OF_VERT, v) {
BMO_elem_flag_enable(bm, e, oflag);
+ }
/* Visit face */
- for (f = BM_iter_new(&faces, bm, BM_FACES_OF_VERT, v); f; f = BM_iter_step(&faces))
+ BM_ITER(f, &itersub, bm, BM_FACES_OF_VERT, v) {
BMO_elem_flag_enable(bm, f, oflag);
+ }
}
}
@@ -348,12 +558,12 @@ static void bmo_remove_tagged_context_edges(BMesh *bm, const short oflag)
BMEdge *e;
BMFace *f;
- BMIter edges;
- BMIter faces;
+ BMIter iter;
+ BMIter itersub;
- for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) {
+ BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
if (BMO_elem_flag_test(bm, e, oflag)) {
- for (f = BM_iter_new(&faces, bm, BM_FACES_OF_EDGE, e); f; f = BM_iter_step(&faces)) {
+ BM_ITER(f, &itersub, bm, BM_FACES_OF_EDGE, e) {
BMO_elem_flag_enable(bm, f, oflag);
}
}
@@ -376,9 +586,9 @@ void BMO_remove_tagged_context(BMesh *bm, const short oflag, const int type)
BMEdge *e;
BMFace *f;
- BMIter verts;
- BMIter edges;
- BMIter faces;
+ BMIter viter;
+ BMIter eiter;
+ BMIter fiter;
switch (type) {
case DEL_VERTS:
@@ -390,7 +600,7 @@ void BMO_remove_tagged_context(BMesh *bm, const short oflag, const int type)
case DEL_EDGES:
{
/* flush down to vert */
- for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) {
+ BM_ITER(e, &eiter, bm, BM_EDGES_OF_MESH, NULL) {
if (BMO_elem_flag_test(bm, e, oflag)) {
BMO_elem_flag_enable(bm, e->v1, oflag);
BMO_elem_flag_enable(bm, e->v2, oflag);
@@ -398,7 +608,7 @@ void BMO_remove_tagged_context(BMesh *bm, const short oflag, const int type)
}
bmo_remove_tagged_context_edges(bm, oflag);
/* remove loose vertice */
- for (v = BM_iter_new(&verts, bm, BM_VERTS_OF_MESH, bm); v; v = BM_iter_step(&verts)) {
+ BM_ITER(v, &viter, bm, BM_VERTS_OF_MESH, NULL) {
if (BMO_elem_flag_test(bm, v, oflag) && (!(v->e)))
BMO_elem_flag_enable(bm, v, DEL_WIREVERT);
}
@@ -429,27 +639,27 @@ void BMO_remove_tagged_context(BMesh *bm, const short oflag, const int type)
case DEL_FACES:
{
/* go through and mark all edges and all verts of all faces for delet */
- for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) {
+ BM_ITER(f, &fiter, bm, BM_FACES_OF_MESH, NULL) {
if (BMO_elem_flag_test(bm, f, oflag)) {
- for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_FACE, f); e; e = BM_iter_step(&edges))
+ for (e = BM_iter_new(&eiter, bm, BM_EDGES_OF_FACE, f); e; e = BM_iter_step(&eiter))
BMO_elem_flag_enable(bm, e, oflag);
- for (v = BM_iter_new(&verts, bm, BM_VERTS_OF_FACE, f); v; v = BM_iter_step(&verts))
+ for (v = BM_iter_new(&viter, bm, BM_VERTS_OF_FACE, f); v; v = BM_iter_step(&viter))
BMO_elem_flag_enable(bm, v, oflag);
}
}
/* now go through and mark all remaining faces all edges for keeping */
- for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) {
+ BM_ITER(f, &fiter, bm, BM_FACES_OF_MESH, NULL) {
if (!BMO_elem_flag_test(bm, f, oflag)) {
- for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_FACE, f); e; e = BM_iter_step(&edges)) {
+ for (e = BM_iter_new(&eiter, bm, BM_EDGES_OF_FACE, f); e; e = BM_iter_step(&eiter)) {
BMO_elem_flag_disable(bm, e, oflag);
}
- for (v = BM_iter_new(&verts, bm, BM_VERTS_OF_FACE, f); v; v = BM_iter_step(&verts)) {
+ for (v = BM_iter_new(&viter, bm, BM_VERTS_OF_FACE, f); v; v = BM_iter_step(&viter)) {
BMO_elem_flag_disable(bm, v, oflag);
}
}
}
/* also mark all the vertices of remaining edges for keeping */
- for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) {
+ BM_ITER(e, &eiter, bm, BM_EDGES_OF_MESH, NULL) {
if (!BMO_elem_flag_test(bm, e, oflag)) {
BMO_elem_flag_disable(bm, e->v1, oflag);
BMO_elem_flag_disable(bm, e->v2, oflag);
@@ -467,12 +677,15 @@ void BMO_remove_tagged_context(BMesh *bm, const short oflag, const int type)
case DEL_ALL:
{
/* does this option even belong in here? */
- for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces))
+ BM_ITER(f, &fiter, bm, BM_FACES_OF_MESH, NULL) {
BMO_elem_flag_enable(bm, f, oflag);
- for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges))
+ }
+ BM_ITER(e, &eiter, bm, BM_EDGES_OF_MESH, NULL) {
BMO_elem_flag_enable(bm, e, oflag);
- for (v = BM_iter_new(&verts, bm, BM_VERTS_OF_MESH, bm); v; v = BM_iter_step(&verts))
+ }
+ BM_ITER(v, &viter, bm, BM_VERTS_OF_MESH, NULL) {
BMO_elem_flag_enable(bm, v, oflag);
+ }
BMO_remove_tagged_faces(bm, oflag);
BMO_remove_tagged_edges(bm, oflag);
@@ -575,9 +788,9 @@ void BM_elem_attrs_copy(BMesh *source_mesh, BMesh *target_mesh, const void *sour
}
}
-BMesh *BM_mesh_copy(BMesh *bmold)
+BMesh *BM_mesh_copy(BMesh *bm_old)
{
- BMesh *bm;
+ BMesh *bm_new;
BMVert *v, *v2, **vtable = NULL;
BMEdge *e, *e2, **edges = NULL, **etable = NULL;
BLI_array_declare(edges);
@@ -587,57 +800,61 @@ BMesh *BM_mesh_copy(BMesh *bmold)
BMEditSelection *ese;
BMIter iter, liter;
int i, j;
+ BMAllocTemplate allocsize = {bm_old->totvert,
+ bm_old->totedge,
+ bm_old->totloop,
+ bm_old->totface};
/* allocate a bmesh */
- bm = BM_mesh_create(bmold->ob, bm_mesh_allocsize_default);
+ bm_new = BM_mesh_create(&allocsize);
- CustomData_copy(&bmold->vdata, &bm->vdata, CD_MASK_BMESH, CD_CALLOC, 0);
- CustomData_copy(&bmold->edata, &bm->edata, CD_MASK_BMESH, CD_CALLOC, 0);
- CustomData_copy(&bmold->ldata, &bm->ldata, CD_MASK_BMESH, CD_CALLOC, 0);
- CustomData_copy(&bmold->pdata, &bm->pdata, CD_MASK_BMESH, CD_CALLOC, 0);
+ CustomData_copy(&bm_old->vdata, &bm_new->vdata, CD_MASK_BMESH, CD_CALLOC, 0);
+ CustomData_copy(&bm_old->edata, &bm_new->edata, CD_MASK_BMESH, CD_CALLOC, 0);
+ CustomData_copy(&bm_old->ldata, &bm_new->ldata, CD_MASK_BMESH, CD_CALLOC, 0);
+ CustomData_copy(&bm_old->pdata, &bm_new->pdata, CD_MASK_BMESH, CD_CALLOC, 0);
- CustomData_bmesh_init_pool(&bm->vdata, bm_mesh_allocsize_default[0]);
- CustomData_bmesh_init_pool(&bm->edata, bm_mesh_allocsize_default[1]);
- CustomData_bmesh_init_pool(&bm->ldata, bm_mesh_allocsize_default[2]);
- CustomData_bmesh_init_pool(&bm->pdata, bm_mesh_allocsize_default[3]);
+ CustomData_bmesh_init_pool(&bm_new->vdata, allocsize.totvert, BM_VERT);
+ CustomData_bmesh_init_pool(&bm_new->edata, allocsize.totedge, BM_EDGE);
+ CustomData_bmesh_init_pool(&bm_new->ldata, allocsize.totloop, BM_LOOP);
+ CustomData_bmesh_init_pool(&bm_new->pdata, allocsize.totface, BM_FACE);
- vtable = MEM_mallocN(sizeof(BMVert *) * bmold->totvert, "BM_mesh_copy vtable");
- etable = MEM_mallocN(sizeof(BMEdge *) * bmold->totedge, "BM_mesh_copy etable");
- ftable = MEM_mallocN(sizeof(BMFace *) * bmold->totface, "BM_mesh_copy ftable");
+ vtable = MEM_mallocN(sizeof(BMVert *) * bm_old->totvert, "BM_mesh_copy vtable");
+ etable = MEM_mallocN(sizeof(BMEdge *) * bm_old->totedge, "BM_mesh_copy etable");
+ ftable = MEM_mallocN(sizeof(BMFace *) * bm_old->totface, "BM_mesh_copy ftable");
- v = BM_iter_new(&iter, bmold, BM_VERTS_OF_MESH, NULL);
+ v = BM_iter_new(&iter, bm_old, BM_VERTS_OF_MESH, NULL);
for (i = 0; v; v = BM_iter_step(&iter), i++) {
- v2 = BM_vert_create(bm, v->co, NULL); /* copy between meshes so cant use 'example' argument */
- BM_elem_attrs_copy(bmold, bm, v, v2);
+ v2 = BM_vert_create(bm_new, v->co, NULL); /* copy between meshes so cant use 'example' argument */
+ BM_elem_attrs_copy(bm_old, bm_new, v, v2);
vtable[i] = v2;
BM_elem_index_set(v, i); /* set_inline */
BM_elem_index_set(v2, i); /* set_inline */
}
- bmold->elem_index_dirty &= ~BM_VERT;
- bm->elem_index_dirty &= ~BM_VERT;
+ bm_old->elem_index_dirty &= ~BM_VERT;
+ bm_new->elem_index_dirty &= ~BM_VERT;
/* safety check */
- BLI_assert(i == bmold->totvert);
+ BLI_assert(i == bm_old->totvert);
- e = BM_iter_new(&iter, bmold, BM_EDGES_OF_MESH, NULL);
+ e = BM_iter_new(&iter, bm_old, BM_EDGES_OF_MESH, NULL);
for (i = 0; e; e = BM_iter_step(&iter), i++) {
- e2 = BM_edge_create(bm,
+ e2 = BM_edge_create(bm_new,
vtable[BM_elem_index_get(e->v1)],
vtable[BM_elem_index_get(e->v2)],
e, FALSE);
- BM_elem_attrs_copy(bmold, bm, e, e2);
+ BM_elem_attrs_copy(bm_old, bm_new, e, e2);
etable[i] = e2;
BM_elem_index_set(e, i); /* set_inline */
BM_elem_index_set(e2, i); /* set_inline */
}
- bmold->elem_index_dirty &= ~BM_EDGE;
- bm->elem_index_dirty &= ~BM_EDGE;
+ bm_old->elem_index_dirty &= ~BM_EDGE;
+ bm_new->elem_index_dirty &= ~BM_EDGE;
/* safety check */
- BLI_assert(i == bmold->totedge);
+ BLI_assert(i == bm_old->totedge);
- f = BM_iter_new(&iter, bmold, BM_FACES_OF_MESH, NULL);
+ f = BM_iter_new(&iter, bm_old, BM_FACES_OF_MESH, NULL);
for (i = 0; f; f = BM_iter_step(&iter), i++) {
BM_elem_index_set(f, i); /* set_inline */
@@ -646,7 +863,7 @@ BMesh *BM_mesh_copy(BMesh *bmold)
BLI_array_growitems(loops, f->len);
BLI_array_growitems(edges, f->len);
- l = BM_iter_new(&liter, bmold, BM_LOOPS_OF_FACE, f);
+ l = BM_iter_new(&liter, bm_old, BM_LOOPS_OF_FACE, f);
for (j = 0; j < f->len; j++, l = BM_iter_step(&liter)) {
loops[j] = l;
edges[j] = etable[BM_elem_index_get(l->e)];
@@ -660,32 +877,32 @@ BMesh *BM_mesh_copy(BMesh *bmold)
v2 = vtable[BM_elem_index_get(loops[0]->v)];
}
- f2 = BM_face_create_ngon(bm, v, v2, edges, f->len, FALSE);
+ f2 = BM_face_create_ngon(bm_new, v, v2, edges, f->len, FALSE);
if (!f2)
continue;
- /* use totface incase adding some faces fails */
- BM_elem_index_set(f2, (bm->totface - 1)); /* set_inline */
+ /* use totface in case adding some faces fails */
+ BM_elem_index_set(f2, (bm_new->totface - 1)); /* set_inline */
ftable[i] = f2;
- BM_elem_attrs_copy(bmold, bm, f, f2);
+ BM_elem_attrs_copy(bm_old, bm_new, f, f2);
copy_v3_v3(f2->no, f->no);
- l = BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, f2);
+ l = BM_iter_new(&liter, bm_new, BM_LOOPS_OF_FACE, f2);
for (j = 0; j < f->len; j++, l = BM_iter_step(&liter)) {
- BM_elem_attrs_copy(bmold, bm, loops[j], l);
+ BM_elem_attrs_copy(bm_old, bm_new, loops[j], l);
}
- if (f == bmold->act_face) bm->act_face = f2;
+ if (f == bm_old->act_face) bm_new->act_face = f2;
}
- bmold->elem_index_dirty &= ~BM_FACE;
- bm->elem_index_dirty &= ~BM_FACE;
+ bm_old->elem_index_dirty &= ~BM_FACE;
+ bm_new->elem_index_dirty &= ~BM_FACE;
/* safety check */
- BLI_assert(i == bmold->totface);
+ BLI_assert(i == bm_old->totface);
/* copy over edit selection history */
- for (ese = bmold->selected.first; ese; ese = ese->next) {
+ for (ese = bm_old->selected.first; ese; ese = ese->next) {
void *ele = NULL;
if (ese->htype == BM_VERT)
@@ -700,7 +917,7 @@ BMesh *BM_mesh_copy(BMesh *bmold)
}
if (ele)
- BM_select_history_store(bm, ele);
+ BM_select_history_store(bm_new, ele);
}
MEM_freeN(etable);
@@ -710,7 +927,7 @@ BMesh *BM_mesh_copy(BMesh *bmold)
BLI_array_free(loops);
BLI_array_free(edges);
- return bm;
+ return bm_new;
}
/* ME -> BM */
@@ -753,7 +970,7 @@ short BM_edge_flag_to_mflag(BMEdge *eed)
((hflag & BM_ELEM_SEAM) ? ME_SEAM : 0) |
((hflag & BM_ELEM_SMOOTH) == 0 ? ME_SHARP : 0) |
((hflag & BM_ELEM_HIDDEN) ? ME_HIDE : 0) |
- ((BM_edge_is_wire(NULL, eed)) ? ME_LOOSEEDGE : 0) | /* not typical */
+ ((BM_edge_is_wire(eed)) ? ME_LOOSEEDGE : 0) | /* not typical */
(ME_EDGEDRAW | ME_EDGERENDER)
);
}
diff --git a/source/blender/bmesh/intern/bmesh_construct.h b/source/blender/bmesh/intern/bmesh_construct.h
index 8d624592ae7..29b84046884 100644
--- a/source/blender/bmesh/intern/bmesh_construct.h
+++ b/source/blender/bmesh/intern/bmesh_construct.h
@@ -38,6 +38,8 @@ void BM_face_copy_shared(BMesh *bm, BMFace *f);
BMFace *BM_face_create_ngon(BMesh *bm, BMVert *v1, BMVert *v2, BMEdge **edges, int len, int nodouble);
+BMFace *BM_face_create_ngon_vcloud(BMesh *bm, BMVert **vert_arr, int len, int nodouble);
+
void BMO_remove_tagged_faces(BMesh *bm, const short oflag);
void BMO_remove_tagged_edges(BMesh *bm, const short oflag);
void BMO_remove_tagged_verts(BMesh *bm, const short oflag);
@@ -46,7 +48,7 @@ void BMO_remove_tagged_context(BMesh *bm, const short oflag, const int type);
void BM_elem_attrs_copy(BMesh *source_mesh, BMesh *target_mesh, const void *source, void *target);
-BMesh *BM_mesh_copy(BMesh *bmold);
+BMesh *BM_mesh_copy(BMesh *bm_old);
char BM_face_flag_from_mflag(const char mflag);
char BM_edge_flag_from_mflag(const short mflag);
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c
index 2e5b95dc4db..d9973550440 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;
}
@@ -240,7 +240,7 @@ BMFace *BM_face_copy(BMesh *bm, BMFace *f, const short copyverts, const short co
* only create the face, since this calloc's the length is initialized to 0,
* leave adding loops to the caller.
*/
-BM_INLINE BMFace *bm_face_create__internal(BMesh *bm)
+BLI_INLINE BMFace *bm_face_create__internal(BMesh *bm)
{
BMFace *f;
@@ -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.
@@ -789,7 +789,7 @@ static int count_flagged_radial(BMesh *bm, BMLoop *l, int flag)
}
i += BM_ELEM_API_FLAG_TEST(l2->f, flag) ? 1 : 0;
- l2 = bmesh_radial_loop_next(l2);
+ l2 = l2->radial_next;
if (UNLIKELY(c >= BM_LOOP_RADIAL_MAX)) {
BMESH_ASSERT(0);
goto error;
@@ -944,8 +944,10 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface)
#ifdef USE_BMESH_HOLES
for (lst = f->loops.first; lst; lst = lst->next) {
- if (lst == f->loops.first) continue;
-
+ if (lst == f->loops.first) {
+ continue;
+ }
+
BLI_remlink(&f->loops, lst);
BLI_addtail(&holes, lst);
}
@@ -953,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))
@@ -1032,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);
@@ -1094,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
@@ -1104,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
@@ -1129,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);
@@ -1157,7 +1161,7 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2,
#endif
/* validate both loop */
- /* I dont know how many loops are supposed to be in each face at this point! FIXME */
+ /* I don't know how many loops are supposed to be in each face at this point! FIXME */
/* go through all of f2's loops and make sure they point to it properly */
l_iter = l_first = BM_FACE_FIRST_LOOP(f2);
@@ -1208,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.
*/
@@ -1223,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);
@@ -1240,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 */
@@ -1450,7 +1456,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou
radlen = bmesh_radial_length(ke->l);
if (ke->l) {
/* first step, fix the neighboring loops of all loops in ke's radial cycl */
- for (i = 0, killoop = ke->l; i < radlen; i++, killoop = bmesh_radial_loop_next(killoop)) {
+ for (i = 0, killoop = ke->l; i < radlen; i++, killoop = killoop->radial_next) {
/* relink loops and fix vertex pointer */
if (killoop->next->v == kv) {
killoop->next->v = tv;
@@ -1479,7 +1485,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou
/* this should be wrapped into a bme_free_radial function to be used by bmesh_KF as well.. */
for (i = 0; i < radlen; i++) {
loops[i] = killoop;
- killoop = bmesh_radial_loop_next(killoop);
+ killoop = killoop->radial_next;
}
for (i = 0; i < radlen; i++) {
bm->totloop--;
@@ -1506,7 +1512,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou
BMESH_ASSERT(edok != FALSE);
/* Validate loop cycle of all faces attached to o */
- for (i = 0, l = oe->l; i < radlen; i++, l = bmesh_radial_loop_next(l)) {
+ for (i = 0, l = oe->l; i < radlen; i++, l = l->radial_next) {
BMESH_ASSERT(l->e == oe);
edok = bmesh_verts_in_edge(l->v, l->next->v, oe);
BMESH_ASSERT(edok != FALSE);
@@ -1522,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);
}
}
@@ -1698,7 +1704,7 @@ BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
*
* \return Success
*/
-static int bm_vert_splice(BMesh *bm, BMVert *v, BMVert *vtarget)
+int BM_vert_splice(BMesh *bm, BMVert *v, BMVert *vtarget)
{
BMEdge *e;
BMLoop *l;
@@ -1731,14 +1737,17 @@ 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
+ * or, the faces sharing verts must not be sharing edges for them to split at least.
+ *
* \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);
@@ -1750,7 +1759,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) {
@@ -1778,29 +1787,52 @@ 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);
}
/* Replace v with the new verts in each group */
+#if 0
BM_ITER(l, &liter, bm, BM_LOOPS_OF_VERT, v) {
+ /* call first since its faster then a hash lookup */
+ if (l->v != v) {
+ continue;
+ }
i = GET_INT_FROM_POINTER(BLI_ghash_lookup(visithash, l->e));
if (i == 0) {
continue;
}
- /* Loops here should alway refer to an edge that has v as an
+ /* Loops here should always refer to an edge that has v as an
* endpoint. For each appearance of this vert in a face, there
* will actually be two iterations: one for the loop heading
* towards vertex v, and another for the loop heading out from
* vertex v. Only need to swap the vertex on one of those times,
* on the outgoing loop. */
- if (l->v == v) {
- l->v = verts[i];
+
+ /* XXX - because this clobbers the iterator, this *whole* block is commented, see below */
+ l->v = verts[i];
+ }
+#else
+ /* note: this is the same as the commented code above *except* that it doesnt break iterator
+ * by modifying data it loops over [#30632], this re-uses the 'stack' variable which is a bit
+ * bad practice but save alloc'ing a new array - note, the comment above is useful, keep it
+ * if you are tidying up code - campbell */
+ BLI_array_empty(stack);
+ BM_ITER(l, &liter, bm, BM_LOOPS_OF_VERT, v) {
+ if ((l->v == v) && (i = GET_INT_FROM_POINTER(BLI_ghash_lookup(visithash, l->e)))) {
+ BM_elem_index_set(l, i); /* would be nice to assign vert here but cant, so assign the vert index */
+ BLI_array_append(stack, (BMEdge *)l);
}
}
+ while ((l = (BMLoop *)(BLI_array_pop(stack)))) {
+ l->v = verts[BM_elem_index_get(l)];
+ }
+#endif
+
+ BLI_array_free(stack);
BM_ITER(e, &eiter, bm, BM_EDGES_OF_VERT, v) {
i = GET_INT_FROM_POINTER(BLI_ghash_lookup(visithash, e));
@@ -1815,18 +1847,17 @@ static int bm_vert_cut(BMesh *bm, BMVert *v, BMVert ***vout, int *len)
}
BLI_ghash_free(visithash, NULL, NULL);
- BLI_array_free(stack);
for (i = 0; i < maxindex; i++) {
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);
@@ -1836,6 +1867,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.
@@ -1844,7 +1893,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;
@@ -1873,22 +1922,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);
@@ -1897,14 +1946,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);
@@ -1922,7 +1971,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;
@@ -1931,8 +1980,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
@@ -1941,7 +1990,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) {
@@ -1950,7 +1999,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. */
@@ -1980,7 +2029,7 @@ static BMVert *bm_urmv_loop(BMesh *bm, BMLoop *sl)
/* And then glue the rest back together */
for (i = 1; i < len - 1; i++) {
- bm_vert_splice(bm, vtar[i], vtar[0]);
+ BM_vert_splice(bm, vtar[i], vtar[0]);
}
}
}
@@ -1999,20 +2048,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..34947923572 100644
--- a/source/blender/bmesh/intern/bmesh_core.h
+++ b/source/blender/bmesh/intern/bmesh_core.h
@@ -33,16 +33,24 @@ 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 bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep);
+int BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *etarget);
+int BM_vert_splice(BMesh *bm, BMVert *v, BMVert *vtarget);
+
+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 +58,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/bmesh_error.h b/source/blender/bmesh/intern/bmesh_error.h
index 7afddf65a97..84065fe88f6 100644
--- a/source/blender/bmesh/bmesh_error.h
+++ b/source/blender/bmesh/intern/bmesh_error.h
@@ -49,7 +49,7 @@ void BMO_error_clear(BMesh *bm);
* errorcode is either the errorcode, or BMERR_ALL for any
* error.*/
-/* not yet implimented.
+/* not yet implemented.
* int BMO_error_catch_op(BMesh *bm, BMOperator *catchop, int errorcode, char **msg);
*/
@@ -65,7 +65,7 @@ void BMO_error_clear(BMesh *bm);
#define BMERR_WALKER_FAILED 4
#define BMERR_DISSOLVEFACES_FAILED 5
#define BMERR_DISSOLVEVERTS_FAILED 6
-#define BMERR_TESSELATION 7
+#define BMERR_TESSELLATION 7
#define BMERR_NONMANIFOLD 8
#define BMERR_INVALID_SELECTION 9
#define BMERR_MESH_ERROR 10
diff --git a/source/blender/bmesh/intern/bmesh_inline.c b/source/blender/bmesh/intern/bmesh_inline.c
deleted file mode 100644
index f7a0fb5c45c..00000000000
--- a/source/blender/bmesh/intern/bmesh_inline.c
+++ /dev/null
@@ -1,76 +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): Joseph Eagar, Geoffrey Bantle, Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/bmesh/intern/bmesh_inline.c
- * \ingroup bmesh
- *
- * BM Inline functions.
- */
-
-#ifndef __BMESH_INLINE_C__
-#define __BMESH_INLINE_C__
-
-#include "bmesh.h"
-
-BM_INLINE char _bm_elem_flag_test(const BMHeader *head, const char hflag)
-{
- return head->hflag & hflag;
-}
-
-BM_INLINE void _bm_elem_flag_enable(BMHeader *head, const char hflag)
-{
- head->hflag |= hflag;
-}
-
-BM_INLINE void _bm_elem_flag_disable(BMHeader *head, const char hflag)
-{
- head->hflag &= ~hflag;
-}
-
-BM_INLINE void _bm_elem_flag_set(BMHeader *head, const char hflag, const int val)
-{
- if (val) _bm_elem_flag_enable(head, hflag);
- else _bm_elem_flag_disable(head, hflag);
-}
-
-BM_INLINE void _bm_elem_flag_toggle(BMHeader *head, const char hflag)
-{
- head->hflag ^= hflag;
-}
-
-BM_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b)
-{
- head_a->hflag = head_b->hflag = head_a->hflag | head_b->hflag;
-}
-
-
-BM_INLINE void _bm_elem_index_set(BMHeader *head, const int index)
-{
- head->index = index;
-}
-
-BM_INLINE int _bm_elem_index_get(const BMHeader *head)
-{
- return head->index;
-}
-
-#endif /* __BMESH_INLINE_C__ */
diff --git a/source/blender/bmesh/intern/bmesh_inline.h b/source/blender/bmesh/intern/bmesh_inline.h
new file mode 100644
index 00000000000..400f4a55b0e
--- /dev/null
+++ b/source/blender/bmesh/intern/bmesh_inline.h
@@ -0,0 +1,121 @@
+/*
+ * ***** 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): Joseph Eagar, Geoffrey Bantle, Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/bmesh/intern/bmesh_inline.h
+ * \ingroup bmesh
+ *
+ * BM Inline functions.
+ */
+
+#ifndef __BMESH_INLINE_H__
+#define __BMESH_INLINE_H__
+
+/* stuff for dealing with header flags */
+#define BM_elem_flag_test( ele, hflag) _bm_elem_flag_test (&(ele)->head, hflag)
+#define BM_elem_flag_test_bool(ele, hflag) _bm_elem_flag_test_bool(&(ele)->head, hflag)
+#define BM_elem_flag_enable( ele, hflag) _bm_elem_flag_enable (&(ele)->head, hflag)
+#define BM_elem_flag_disable( ele, hflag) _bm_elem_flag_disable (&(ele)->head, hflag)
+#define BM_elem_flag_set( ele, hflag, val) _bm_elem_flag_set (&(ele)->head, hflag, val)
+#define BM_elem_flag_toggle( ele, hflag) _bm_elem_flag_toggle (&(ele)->head, hflag)
+#define BM_elem_flag_merge( ele_a, ele_b) _bm_elem_flag_merge (&(ele_a)->head, &(ele_b)->head)
+
+BLI_INLINE char _bm_elem_flag_test(const BMHeader *head, const char hflag)
+{
+ return head->hflag & hflag;
+}
+
+BLI_INLINE short _bm_elem_flag_test_bool(const BMHeader *head, const char hflag)
+{
+ return (head->hflag & hflag) != 0;
+}
+
+BLI_INLINE void _bm_elem_flag_enable(BMHeader *head, const char hflag)
+{
+ head->hflag |= hflag;
+}
+
+BLI_INLINE void _bm_elem_flag_disable(BMHeader *head, const char hflag)
+{
+ head->hflag &= ~hflag;
+}
+
+BLI_INLINE void _bm_elem_flag_set(BMHeader *head, const char hflag, const int val)
+{
+ if (val) _bm_elem_flag_enable(head, hflag);
+ else _bm_elem_flag_disable(head, hflag);
+}
+
+BLI_INLINE void _bm_elem_flag_toggle(BMHeader *head, const char hflag)
+{
+ head->hflag ^= hflag;
+}
+
+BLI_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b)
+{
+ head_a->hflag = head_b->hflag = head_a->hflag | head_b->hflag;
+}
+
+/**
+ * notes on #BM_elem_index_set(...) usage,
+ * Set index is sometimes abused as temp storage, other times we cant be
+ * sure if the index values are valid because certain operations have modified
+ * the mesh structure.
+ *
+ * To set the elements to valid indices 'BM_mesh_elem_index_ensure' should be used
+ * rather then adding inline loops, however there are cases where we still
+ * set the index directly
+ *
+ * In an attempt to manage this,
+ * here are 5 tags I'm adding to uses of #BM_elem_index_set
+ *
+ * - 'set_inline' -- since the data is already being looped over set to a
+ * valid value inline.
+ *
+ * - 'set_dirty!' -- intentionally sets the index to an invalid value,
+ * flagging 'bm->elem_index_dirty' so we don't use it.
+ *
+ * - 'set_ok' -- this is valid use since the part of the code is low level.
+ *
+ * - 'set_ok_invalid' -- set to -1 on purpose since this should not be
+ * used without a full array re-index, do this on
+ * adding new vert/edge/faces since they may be added at
+ * the end of the array.
+ *
+ * - 'set_loop' -- currently loop index values are not used used much so
+ * assume each case they are dirty.
+ *
+ * - campbell */
+
+#define BM_elem_index_get(ele) _bm_elem_index_get(&(ele)->head)
+#define BM_elem_index_set(ele, index) _bm_elem_index_set(&(ele)->head, index)
+
+BLI_INLINE void _bm_elem_index_set(BMHeader *head, const int index)
+{
+ head->index = index;
+}
+
+BLI_INLINE int _bm_elem_index_get(const BMHeader *head)
+{
+ return head->index;
+}
+
+#endif /* __BMESH_INLINE_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c
index 669426b73a6..2a3242d87c1 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;
}
@@ -426,6 +426,7 @@ static void bm_loop_interp_mdisps(BMesh *bm, BMLoop *target, BMFace *source)
MDisps *md2 = CustomData_bmesh_get(&bm->ldata, BM_FACE_FIRST_LOOP(source)->head.data, CD_MDISPS);
mdisps->totdisp = md2->totdisp;
+ mdisps->level = md2->level;
if (mdisps->totdisp) {
mdisps->disps = MEM_callocN(sizeof(float) * 3 * mdisps->totdisp,
"mdisp->disps in bmesh_loop_intern_mdisps");
@@ -632,7 +633,7 @@ void BM_loop_interp_from_face(BMesh *bm, BMLoop *target, BMFace *source,
axis_dominant_v3(&ax, &ay, source->no);
- /* scale source face coordinates a bit, so points sitting directonly on an
+ /* scale source face coordinates a bit, so points sitting directly on an
* edge will work. */
mul_v3_fl(cent, 1.0f / (float)source->len);
for (i = 0; i < source->len; i++) {
@@ -695,7 +696,7 @@ void BM_vert_interp_from_face(BMesh *bm, BMVert *v, BMFace *source)
i++;
} while ((l_iter = l_iter->next) != l_first);
- /* scale source face coordinates a bit, so points sitting directonly on an
+ /* scale source face coordinates a bit, so points sitting directly on an
* edge will work. */
mul_v3_fl(cent, 1.0f / (float)source->len);
for (i = 0; i < source->len; i++) {
@@ -720,11 +721,11 @@ static void update_data_blocks(BMesh *bm, CustomData *olddata, CustomData *data)
BLI_mempool *oldpool = olddata->pool;
void *block;
- CustomData_bmesh_init_pool(data, data == &bm->ldata ? 2048 : 512);
-
if (data == &bm->vdata) {
BMVert *eve;
-
+
+ CustomData_bmesh_init_pool(data, bm->totvert, BM_VERT);
+
BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
block = NULL;
CustomData_bmesh_set_default(data, &block);
@@ -736,6 +737,8 @@ static void update_data_blocks(BMesh *bm, CustomData *olddata, CustomData *data)
else if (data == &bm->edata) {
BMEdge *eed;
+ CustomData_bmesh_init_pool(data, bm->totedge, BM_EDGE);
+
BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
block = NULL;
CustomData_bmesh_set_default(data, &block);
@@ -744,31 +747,39 @@ static void update_data_blocks(BMesh *bm, CustomData *olddata, CustomData *data)
eed->head.data = block;
}
}
- else if (data == &bm->pdata || data == &bm->ldata) {
+ else if (data == &bm->ldata) {
BMIter liter;
BMFace *efa;
BMLoop *l;
+ CustomData_bmesh_init_pool(data, bm->totloop, BM_LOOP);
BM_ITER(efa, &iter, bm, BM_FACES_OF_MESH, NULL) {
- if (data == &bm->pdata) {
+ BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, efa) {
block = NULL;
CustomData_bmesh_set_default(data, &block);
- CustomData_bmesh_copy_data(olddata, data, efa->head.data, &block);
- CustomData_bmesh_free_block(olddata, &efa->head.data);
- efa->head.data = block;
+ CustomData_bmesh_copy_data(olddata, data, l->head.data, &block);
+ CustomData_bmesh_free_block(olddata, &l->head.data);
+ l->head.data = block;
}
+ }
+ }
+ else if (data == &bm->pdata) {
+ BMFace *efa;
- if (data == &bm->ldata) {
- BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, efa) {
- block = NULL;
- CustomData_bmesh_set_default(data, &block);
- CustomData_bmesh_copy_data(olddata, data, l->head.data, &block);
- CustomData_bmesh_free_block(olddata, &l->head.data);
- l->head.data = block;
- }
- }
+ CustomData_bmesh_init_pool(data, bm->totface, BM_FACE);
+
+ BM_ITER(efa, &iter, bm, BM_FACES_OF_MESH, NULL) {
+ block = NULL;
+ CustomData_bmesh_set_default(data, &block);
+ CustomData_bmesh_copy_data(olddata, data, efa->head.data, &block);
+ CustomData_bmesh_free_block(olddata, &efa->head.data);
+ efa->head.data = block;
}
}
+ else {
+ /* should never reach this! */
+ BLI_assert(0);
+ }
if (oldpool) {
/* this should never happen but can when dissolve fails - [#28960] */
diff --git a/source/blender/bmesh/intern/bmesh_iterators.c b/source/blender/bmesh/intern/bmesh_iterators.c
index 6ce0c92a239..b53896ae722 100644
--- a/source/blender/bmesh/intern/bmesh_iterators.c
+++ b/source/blender/bmesh/intern/bmesh_iterators.c
@@ -28,9 +28,10 @@
* See: bmesh_iterators_inlin.c too, some functions are here for speed reasons.
*/
+#include "BLI_utildefines.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
const char bm_iter_itype_htype_map[BM_ITYPE_MAX] = {
'\0',
@@ -291,11 +292,13 @@ void *bmiter__loops_of_edge_step(BMIter *iter)
{
BMLoop *current = iter->nextloop;
- if (iter->nextloop)
- iter->nextloop = bmesh_radial_loop_next(iter->nextloop);
+ if (iter->nextloop) {
+ iter->nextloop = iter->nextloop->radial_next;
+ }
- if (iter->nextloop == iter->firstloop)
+ if (iter->nextloop == iter->firstloop) {
iter->nextloop = NULL;
+ }
if (current) {
return current;
@@ -314,7 +317,7 @@ void bmiter__loops_of_loop_begin(BMIter *iter)
init_iterator(iter);
iter->firstloop = l;
- iter->nextloop = bmesh_radial_loop_next(iter->firstloop);
+ iter->nextloop = iter->firstloop->radial_next;
if (iter->nextloop == iter->firstloop)
iter->nextloop = NULL;
@@ -324,9 +327,13 @@ void *bmiter__loops_of_loop_step(BMIter *iter)
{
BMLoop *current = iter->nextloop;
- if (iter->nextloop) iter->nextloop = bmesh_radial_loop_next(iter->nextloop);
+ if (iter->nextloop) {
+ iter->nextloop = iter->nextloop->radial_next;
+ }
- if (iter->nextloop == iter->firstloop) iter->nextloop = NULL;
+ if (iter->nextloop == iter->firstloop) {
+ iter->nextloop = NULL;
+ }
if (current) {
return current;
@@ -353,7 +360,9 @@ void *bmiter__face_of_edge_step(BMIter *iter)
{
BMLoop *current = iter->nextloop;
- if (iter->nextloop) iter->nextloop = bmesh_radial_loop_next(iter->nextloop);
+ if (iter->nextloop) {
+ iter->nextloop = iter->nextloop->radial_next;
+ }
if (iter->nextloop == iter->firstloop) iter->nextloop = NULL;
diff --git a/source/blender/bmesh/intern/bmesh_iterators.h b/source/blender/bmesh/intern/bmesh_iterators.h
index 24653fc0b73..d3566d8aead 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"
@@ -143,6 +143,6 @@ void *bmiter__edge_of_face_step(struct BMIter *iter);
void bmiter__loop_of_face_begin(struct BMIter *iter);
void *bmiter__loop_of_face_step(struct BMIter *iter);
-#include "intern/bmesh_iterators_inline.c"
+#include "intern/bmesh_iterators_inline.h"
#endif /* __BMESH_ITERATORS_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_iterators_inline.c b/source/blender/bmesh/intern/bmesh_iterators_inline.h
index ed65b0e7fac..57f0da4081b 100644
--- a/source/blender/bmesh/intern/bmesh_iterators_inline.c
+++ b/source/blender/bmesh/intern/bmesh_iterators_inline.h
@@ -20,16 +20,14 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/bmesh/intern/bmesh_iterators_inline.c
+/** \file blender/bmesh/intern/bmesh_iterators_inline.h
* \ingroup bmesh
*
* BMesh inline iterator functions.
*/
-#ifndef __BMESH_ITERATORS_INLINE_C__
-#define __BMESH_ITERATORS_INLINE_C__
-
-#include "bmesh.h"
+#ifndef __BMESH_ITERATORS_INLINE_H__
+#define __BMESH_ITERATORS_INLINE_H__
/* inline here optimizes out the switch statement when called with
* constant values (which is very common), nicer for loop-in-loop situations */
@@ -39,7 +37,7 @@
*
* Calls an iterators step fucntion to return the next element.
*/
-BM_INLINE void *BM_iter_step(BMIter *iter)
+BLI_INLINE void *BM_iter_step(BMIter *iter)
{
return iter->step(iter);
}
@@ -52,7 +50,7 @@ BM_INLINE void *BM_iter_step(BMIter *iter)
* it with the appropriate function pointers based
* upon its type.
*/
-BM_INLINE int BM_iter_init(BMIter *iter, BMesh *bm, const char itype, void *data)
+BLI_INLINE int BM_iter_init(BMIter *iter, BMesh *bm, const char itype, void *data)
{
/* int argtype; */
iter->itype = itype;
@@ -179,7 +177,7 @@ BM_INLINE int BM_iter_init(BMIter *iter, BMesh *bm, const char itype, void *data
* to return the first element of the iterator.
*
*/
-BM_INLINE void *BM_iter_new(BMIter *iter, BMesh *bm, const char itype, void *data)
+BLI_INLINE void *BM_iter_new(BMIter *iter, BMesh *bm, const char itype, void *data)
{
if (LIKELY(BM_iter_init(iter, bm, itype, data))) {
return BM_iter_step(iter);
@@ -189,4 +187,4 @@ BM_INLINE void *BM_iter_new(BMIter *iter, BMesh *bm, const char itype, void *dat
}
}
-#endif /* __BMESH_ITERATORS_INLINE_C__ */
+#endif /* __BMESH_ITERATORS_INLINE_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c
index 7d64d00e26e..03c4d3c9cbb 100644
--- a/source/blender/bmesh/intern/bmesh_marking.c
+++ b/source/blender/bmesh/intern/bmesh_marking.c
@@ -78,13 +78,13 @@ void BM_mesh_select_mode_flush(BMesh *bm)
BMLoop *l_first;
BMFace *f;
- BMIter edges;
- BMIter faces;
+ BMIter eiter;
+ BMIter fiter;
int ok;
if (bm->selectmode & SCE_SELECT_VERTEX) {
- for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) {
+ BM_ITER(e, &eiter, bm, BM_EDGES_OF_MESH, NULL) {
if (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) &&
BM_elem_flag_test(e->v2, BM_ELEM_SELECT) &&
!BM_elem_flag_test(e, BM_ELEM_HIDDEN))
@@ -95,7 +95,7 @@ void BM_mesh_select_mode_flush(BMesh *bm)
BM_elem_flag_disable(e, BM_ELEM_SELECT);
}
}
- for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) {
+ BM_ITER(f, &fiter, bm, BM_FACES_OF_MESH, NULL) {
ok = TRUE;
if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
l_iter = l_first = BM_FACE_FIRST_LOOP(f);
@@ -114,7 +114,7 @@ void BM_mesh_select_mode_flush(BMesh *bm)
}
}
else if (bm->selectmode & SCE_SELECT_EDGE) {
- for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) {
+ BM_ITER(f, &fiter, bm, BM_FACES_OF_MESH, NULL) {
ok = TRUE;
if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
l_iter = l_first = BM_FACE_FIRST_LOOP(f);
@@ -149,12 +149,12 @@ void BM_mesh_deselect_flush(BMesh *bm)
BMLoop *l_first;
BMFace *f;
- BMIter edges;
- BMIter faces;
+ BMIter eiter;
+ BMIter fiter;
int ok;
- for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) {
+ BM_ITER(e, &eiter, bm, BM_EDGES_OF_MESH, NULL) {
if (!(BM_elem_flag_test(e->v1, BM_ELEM_SELECT) &&
BM_elem_flag_test(e->v2, BM_ELEM_SELECT) &&
!BM_elem_flag_test(e, BM_ELEM_HIDDEN)))
@@ -163,7 +163,7 @@ void BM_mesh_deselect_flush(BMesh *bm)
}
}
- for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) {
+ BM_ITER(f, &fiter, bm, BM_FACES_OF_MESH, NULL) {
ok = TRUE;
if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
l_iter = l_first = BM_FACE_FIRST_LOOP(f);
@@ -200,12 +200,12 @@ void BM_mesh_select_flush(BMesh *bm)
BMLoop *l_first;
BMFace *f;
- BMIter edges;
- BMIter faces;
+ BMIter eiter;
+ BMIter fiter;
int ok;
- for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) {
+ BM_ITER(e, &eiter, bm, BM_EDGES_OF_MESH, NULL) {
if (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) &&
BM_elem_flag_test(e->v2, BM_ELEM_SELECT) &&
!BM_elem_flag_test(e, BM_ELEM_HIDDEN))
@@ -214,7 +214,7 @@ void BM_mesh_select_flush(BMesh *bm)
}
}
- for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) {
+ BM_ITER(f, &fiter, bm, BM_FACES_OF_MESH, NULL) {
ok = TRUE;
if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
l_iter = l_first = BM_FACE_FIRST_LOOP(f);
@@ -288,9 +288,9 @@ void BM_edge_select_set(BMesh *bm, BMEdge *e, int select)
if (BM_elem_flag_test(e, BM_ELEM_SELECT)) bm->totedgesel -= 1;
BM_elem_flag_disable(e, BM_ELEM_SELECT);
- if ( bm->selectmode == SCE_SELECT_EDGE ||
- bm->selectmode == SCE_SELECT_FACE ||
- bm->selectmode == (SCE_SELECT_EDGE | SCE_SELECT_FACE))
+ if (bm->selectmode == SCE_SELECT_EDGE ||
+ bm->selectmode == SCE_SELECT_FACE ||
+ bm->selectmode == (SCE_SELECT_EDGE | SCE_SELECT_FACE))
{
BMIter iter;
@@ -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);
}
}
@@ -396,39 +397,48 @@ void BM_face_select_set(BMesh *bm, BMFace *f, int select)
*/
void BM_select_mode_set(BMesh *bm, int selectmode)
{
- BMVert *v;
- BMEdge *e;
- BMFace *f;
-
- BMIter verts;
- BMIter edges;
- BMIter faces;
+ BMIter iter;
+ BMElem *ele;
bm->selectmode = selectmode;
if (bm->selectmode & SCE_SELECT_VERTEX) {
- for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges))
- BM_elem_flag_disable(e, 0);
- for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces))
- BM_elem_flag_disable(f, 0);
+ /* disabled because selection flushing handles these */
+#if 0
+ BM_ITER(ele, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ BM_elem_flag_disable(ele, BM_ELEM_SELECT);
+ }
+ BM_ITER(ele, &iter, bm, BM_FACES_OF_MESH, NULL) {
+ BM_elem_flag_disable(ele, BM_ELEM_SELECT);
+ }
+#endif
BM_mesh_select_mode_flush(bm);
}
else if (bm->selectmode & SCE_SELECT_EDGE) {
- for (v = BM_iter_new(&verts, bm, BM_VERTS_OF_MESH, bm); v; v = BM_iter_step(&verts))
- BM_elem_flag_disable(v, 0);
- for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) {
- if (BM_elem_flag_test(e, BM_ELEM_SELECT)) {
- BM_edge_select_set(bm, e, TRUE);
+ /* disabled because selection flushing handles these */
+#if 0
+ BM_ITER(ele, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ BM_elem_flag_disable(ele, BM_ELEM_SELECT);
+ }
+#endif
+
+ BM_ITER(ele, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ if (BM_elem_flag_test(ele, BM_ELEM_SELECT)) {
+ BM_edge_select_set(bm, (BMEdge *)ele, TRUE);
}
}
BM_mesh_select_mode_flush(bm);
}
else if (bm->selectmode & SCE_SELECT_FACE) {
- for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges))
- BM_elem_flag_disable(e, 0);
- for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) {
- if (BM_elem_flag_test(f, BM_ELEM_SELECT)) {
- BM_face_select_set(bm, f, TRUE);
+ /* disabled because selection flushing handles these */
+#if 0
+ BM_ITER(ele, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ BM_elem_flag_disable(ele, BM_ELEM_SELECT);
+ }
+#endif
+ BM_ITER(ele, &iter, bm, BM_FACES_OF_MESH, NULL) {
+ if (BM_elem_flag_test(ele, BM_ELEM_SELECT)) {
+ BM_face_select_set(bm, (BMFace *)ele, TRUE);
}
}
BM_mesh_select_mode_flush(bm);
@@ -436,36 +446,49 @@ void BM_select_mode_set(BMesh *bm, int selectmode)
}
/**
- * counts number of elements with flag set
+ * counts number of elements with flag enabled/disabled
*/
-int BM_mesh_count_flag(BMesh *bm, const char htype, const char hflag, int respecthide)
+static int bm_mesh_flag_count(BMesh *bm, const char htype, const char hflag,
+ const short respecthide, const short test_for_enabled)
{
BMElem *ele;
BMIter iter;
int tot = 0;
+ BLI_assert(ELEM(TRUE, FALSE, test_for_enabled));
+
if (htype & BM_VERT) {
for (ele = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); ele; ele = BM_iter_step(&iter)) {
if (respecthide && BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) continue;
- if (BM_elem_flag_test(ele, hflag)) tot++;
+ if (BM_elem_flag_test_bool(ele, hflag) == test_for_enabled) tot++;
}
}
if (htype & BM_EDGE) {
for (ele = BM_iter_new(&iter, bm, BM_EDGES_OF_MESH, NULL); ele; ele = BM_iter_step(&iter)) {
if (respecthide && BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) continue;
- if (BM_elem_flag_test(ele, hflag)) tot++;
+ if (BM_elem_flag_test_bool(ele, hflag) == test_for_enabled) tot++;
}
}
if (htype & BM_FACE) {
for (ele = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, NULL); ele; ele = BM_iter_step(&iter)) {
if (respecthide && BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) continue;
- if (BM_elem_flag_test(ele, hflag)) tot++;
+ if (BM_elem_flag_test_bool(ele, hflag) == test_for_enabled) tot++;
}
}
return tot;
}
+int BM_mesh_enabled_flag_count(BMesh *bm, const char htype, const char hflag, int respecthide)
+{
+ return bm_mesh_flag_count(bm, htype, hflag, respecthide, TRUE);
+}
+
+int BM_mesh_disabled_flag_count(BMesh *bm, const char htype, const char hflag, int respecthide)
+{
+ return bm_mesh_flag_count(bm, htype, hflag, respecthide, FALSE);
+}
+
/**
* \note use BM_elem_flag_test(ele, BM_ELEM_SELECT) to test selection
* \note by design, this will not touch the editselection history stuff
@@ -605,10 +628,10 @@ void BM_editselection_plane(BMesh *bm, float r_plane[3], BMEditSelection *ese)
/* make a fake plane thats at rightangles to the normal
* we cant make a crossvec from a vec thats the same as the vec
* unlikely but possible, so make sure if the normal is (0, 0, 1)
- * that vec isnt the same or in the same direction even. */
- if (eve->no[0] < 0.5f) vec[0] = 1.0f;
- else if (eve->no[1] < 0.5f) vec[1] = 1.0f;
- else vec[2] = 1.0f;
+ * that vec isn't the same or in the same direction even. */
+ if (eve->no[0] < 0.5f) vec[0] = 1.0f;
+ else if (eve->no[1] < 0.5f) vec[1] = 1.0f;
+ else vec[2] = 1.0f;
cross_v3_v3v3(r_plane, eve->no, vec);
}
}
@@ -619,7 +642,7 @@ void BM_editselection_plane(BMesh *bm, float r_plane[3], BMEditSelection *ese)
* however selecting different edges can swap the direction of the y axis.
* this makes it less likely for the y axis of the manipulator
* (running along the edge).. to flip less often.
- * at least its more pradictable */
+ * at least its more predictable */
if (eed->v2->co[1] > eed->v1->co[1]) { /* check which to do first */
sub_v3_v3v3(r_plane, eed->v2->co, eed->v1->co);
}
@@ -637,7 +660,7 @@ void BM_editselection_plane(BMesh *bm, float r_plane[3], BMEditSelection *ese)
/* make a fake plane thats at rightangles to the normal
* we cant make a crossvec from a vec thats the same as the vec
* unlikely but possible, so make sure if the normal is (0, 0, 1)
- * that vec isnt the same or in the same direction even. */
+ * that vec isn't the same or in the same direction even. */
if (efa->len < 3) {
/* crappy fallback method */
if (efa->no[0] < 0.5f) vec[0] = 1.0f;
@@ -700,15 +723,17 @@ int BM_select_history_check(BMesh *bm, const BMElem *ele)
return FALSE;
}
-void BM_select_history_remove(BMesh *bm, BMElem *ele)
+int BM_select_history_remove(BMesh *bm, BMElem *ele)
{
BMEditSelection *ese;
for (ese = bm->selected.first; ese; ese = ese->next) {
if (ese->ele == ele) {
BLI_freelinkN(&(bm->selected), ese);
- break;
+ return TRUE;
}
}
+
+ return FALSE;
}
void BM_select_history_clear(BMesh *bm)
@@ -717,14 +742,18 @@ void BM_select_history_clear(BMesh *bm)
bm->selected.first = bm->selected.last = NULL;
}
+void BM_select_history_store_notest(BMesh *bm, BMElem *ele)
+{
+ BMEditSelection *ese = (BMEditSelection *) MEM_callocN(sizeof(BMEditSelection), "BMEdit Selection");
+ ese->htype = ((BMHeader *)ele)->htype;
+ ese->ele = ele;
+ BLI_addtail(&(bm->selected), ese);
+}
+
void BM_select_history_store(BMesh *bm, BMElem *ele)
{
- BMEditSelection *ese;
if (!BM_select_history_check(bm, ele)) {
- ese = (BMEditSelection *) MEM_callocN(sizeof(BMEditSelection), "BMEdit Selection");
- ese->htype = ((BMHeader *)ele)->htype;
- ese->ele = ele;
- BLI_addtail(&(bm->selected), ese);
+ BM_select_history_store_notest(bm, ele);
}
}
@@ -743,11 +772,14 @@ void BM_select_history_validate(BMesh *bm)
}
}
-void BM_mesh_elem_flag_disable_all(BMesh *bm, const char htype, const char hflag)
+void BM_mesh_elem_flag_disable_all(BMesh *bm, const char htype, const char hflag, int respecthide)
{
const char iter_types[3] = {BM_VERTS_OF_MESH,
BM_EDGES_OF_MESH,
BM_FACES_OF_MESH};
+
+ const char flag_types[3] = {BM_VERT, BM_EDGE, BM_FACE};
+
BMIter iter;
BMElem *ele;
int i;
@@ -756,24 +788,53 @@ 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) &&
+ (respecthide == FALSE))
+ {
+ /* 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 & flag_types[i]) {
+ ele = BM_iter_new(&iter, bm, iter_types[i], NULL);
+ for ( ; ele; ele = BM_iter_step(&iter)) {
+
+ if (respecthide && BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) {
+ continue;
+ }
+
+ if (hflag & BM_ELEM_SELECT) {
+ BM_elem_select_set(bm, ele, FALSE);
+ }
+ BM_elem_flag_disable(ele, hflag);
}
- BM_elem_flag_disable(ele, hflag);
}
}
}
}
-void BM_mesh_elem_flag_enable_all(BMesh *bm, const char htype, const char hflag)
+void BM_mesh_elem_flag_enable_all(BMesh *bm, const char htype, const char hflag, int respecthide)
{
const char iter_types[3] = {BM_VERTS_OF_MESH,
BM_EDGES_OF_MESH,
BM_FACES_OF_MESH};
+
+ const char flag_types[3] = {BM_VERT, BM_EDGE, BM_FACE};
+
+ /* use the nosel version when setting so under no
+ * condition may a hidden face become selected.
+ * Applying other flags to hidden faces is OK. */
+ const char hflag_nosel = hflag & ~BM_ELEM_SELECT;
+
BMIter iter;
BMElem *ele;
int i;
@@ -782,14 +843,23 @@ 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]) {
+ if (htype & flag_types[i]) {
ele = BM_iter_new(&iter, bm, iter_types[i], NULL);
for ( ; ele; ele = BM_iter_step(&iter)) {
+
+ if (respecthide && BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) {
+ continue;
+ }
+
if (hflag & BM_ELEM_SELECT) {
BM_elem_select_set(bm, ele, TRUE);
}
- BM_elem_flag_enable(ele, hflag);
+ BM_elem_flag_enable(ele, hflag_nosel);
}
}
}
@@ -854,7 +924,7 @@ void BM_edge_hide_set(BMesh *bm, BMEdge *e, int hide)
BM_elem_flag_set(e, BM_ELEM_HIDDEN, hide);
- /* hide vertices if necassary */
+ /* hide vertices if necessary */
vert_flush_hide_set(bm, e->v1);
vert_flush_hide_set(bm, e->v2);
}
diff --git a/source/blender/bmesh/intern/bmesh_marking.h b/source/blender/bmesh/intern/bmesh_marking.h
index 598cc02126a..fa078c74b2e 100644
--- a/source/blender/bmesh/intern/bmesh_marking.h
+++ b/source/blender/bmesh/intern/bmesh_marking.h
@@ -45,8 +45,8 @@ void BM_face_hide_set(BMesh *bm, BMFace *f, int hide);
#define BM_elem_select_set(bm, ele, hide) _bm_elem_select_set(bm, &(ele)->head, hide)
void _bm_elem_select_set(BMesh *bm, BMHeader *ele, int select);
-void BM_mesh_elem_flag_enable_all(BMesh *bm, const char htype, const char hflag);
-void BM_mesh_elem_flag_disable_all(BMesh *bm, const char htype, const char hflag);
+void BM_mesh_elem_flag_enable_all(BMesh *bm, const char htype, const char hflag, int respecthide);
+void BM_mesh_elem_flag_disable_all(BMesh *bm, const char htype, const char hflag, int respecthide);
/* individual element select functions, BM_elem_select_set is a shortcut for these
* that automatically detects which one to use*/
@@ -60,7 +60,8 @@ void BM_mesh_select_mode_flush(BMesh *bm);
void BM_mesh_deselect_flush(BMesh *bm);
void BM_mesh_select_flush(BMesh *bm);
-int BM_mesh_count_flag(BMesh *bm, const char htype, const char hflag, int respecthide);
+int BM_mesh_enabled_flag_count(BMesh *bm, const char htype, const char hflag, int respecthide);
+int BM_mesh_disabled_flag_count(BMesh *bm, const char htype, const char hflag, int respecthide);
/* edit selection stuff */
void BM_active_face_set(BMesh *em, BMFace *f);
@@ -70,7 +71,8 @@ void BM_editselection_normal(float r_normal[3], BMEditSelection *ese);
void BM_editselection_plane(BMesh *bm, float r_plane[3], BMEditSelection *ese);
int BM_select_history_check(BMesh *bm, const BMElem *ele);
-void BM_select_history_remove(BMesh *bm, BMElem *ele);
+int BM_select_history_remove(BMesh *bm, BMElem *ele);
+void BM_select_history_store_notest(BMesh *bm, BMElem *ele);
void BM_select_history_store(BMesh *bm, BMElem *ele);
void BM_select_history_validate(BMesh *bm);
void BM_select_history_clear(BMesh *em);
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index c791b392a82..c15937abf1d 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -41,24 +41,25 @@
#include "ED_mesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
/* used as an extern, defined in bmesh.h */
-int bm_mesh_allocsize_default[4] = {512, 512, 2048, 512};
+BMAllocTemplate bm_mesh_allocsize_default = {512, 1024, 2048, 512};
+BMAllocTemplate bm_mesh_chunksize_default = {512, 1024, 2048, 512};
-static void bm_mempool_init(BMesh *bm, const int allocsize[4])
+static void bm_mempool_init(BMesh *bm, const BMAllocTemplate *allocsize)
{
- bm->vpool = BLI_mempool_create(sizeof(BMVert), allocsize[0], allocsize[0], FALSE, TRUE);
- bm->epool = BLI_mempool_create(sizeof(BMEdge), allocsize[1], allocsize[1], FALSE, TRUE);
- bm->lpool = BLI_mempool_create(sizeof(BMLoop), allocsize[2], allocsize[2], FALSE, FALSE);
- bm->fpool = BLI_mempool_create(sizeof(BMFace), allocsize[3], allocsize[3], FALSE, TRUE);
+ bm->vpool = BLI_mempool_create(sizeof(BMVert), allocsize->totvert, bm_mesh_chunksize_default.totvert, BLI_MEMPOOL_ALLOW_ITER);
+ bm->epool = BLI_mempool_create(sizeof(BMEdge), allocsize->totedge, bm_mesh_chunksize_default.totedge, BLI_MEMPOOL_ALLOW_ITER);
+ bm->lpool = BLI_mempool_create(sizeof(BMLoop), allocsize->totloop, bm_mesh_chunksize_default.totloop, 0);
+ bm->fpool = BLI_mempool_create(sizeof(BMFace), allocsize->totface, bm_mesh_chunksize_default.totface, BLI_MEMPOOL_ALLOW_ITER);
#ifdef USE_BMESH_HOLES
bm->looplistpool = BLI_mempool_create(sizeof(BMLoopList), allocsize[3], allocsize[3], FALSE, FALSE);
#endif
- /* allocate one flag pool that we dont get rid of. */
- bm->toolflagpool = BLI_mempool_create(sizeof(BMFlagLayer), 512, 512, FALSE, FALSE);
+ /* allocate one flag pool that we don't get rid of. */
+ bm->toolflagpool = BLI_mempool_create(sizeof(BMFlagLayer), 512, 512, 0);
}
/**
@@ -70,17 +71,15 @@ static void bm_mempool_init(BMesh *bm, const int allocsize[4])
*
* \note ob is needed by multires
*/
-BMesh *BM_mesh_create(struct Object *ob, const int allocsize[4])
+BMesh *BM_mesh_create(BMAllocTemplate *allocsize)
{
/* allocate the structure */
BMesh *bm = MEM_callocN(sizeof(BMesh), __func__);
-
- bm->ob = ob;
/* allocate the memory pools for the mesh elements */
bm_mempool_init(bm, allocsize);
- /* allocate one flag pool that we dont get rid of. */
+ /* allocate one flag pool that we don't get rid of. */
bm->stackdepth = 1;
bm->totflags = 1;
@@ -102,20 +101,18 @@ void BM_mesh_data_free(BMesh *bm)
BMFace *f;
- BMIter verts;
- BMIter edges;
- BMIter faces;
- BMIter loops;
+ BMIter iter;
+ BMIter itersub;
- for (v = BM_iter_new(&verts, bm, BM_VERTS_OF_MESH, bm); v; v = BM_iter_step(&verts)) {
+ BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
CustomData_bmesh_free_block(&(bm->vdata), &(v->head.data));
}
- for (e = BM_iter_new(&edges, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&edges)) {
+ BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
CustomData_bmesh_free_block(&(bm->edata), &(e->head.data));
}
- for (f = BM_iter_new(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BM_iter_step(&faces)) {
+ BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
CustomData_bmesh_free_block(&(bm->pdata), &(f->head.data));
- for (l = BM_iter_new(&loops, bm, BM_LOOPS_OF_FACE, f); l; l = BM_iter_step(&loops)) {
+ BM_ITER(l, &itersub, bm, BM_LOOPS_OF_FACE, f) {
CustomData_bmesh_free_block(&(bm->ldata), &(l->head.data));
}
}
@@ -145,7 +142,7 @@ void BM_mesh_data_free(BMesh *bm)
BLI_mempool_destroy(bm->looplistpool);
#endif
- /* These tables aren't used yet, so it's not stricly necessary
+ /* These tables aren't used yet, so it's not strictly necessary
* to 'end' them (with 'e' param) but if someone tries to start
* using them, having these in place will save a lot of pain */
mesh_octree_table(NULL, NULL, NULL, 'e');
@@ -163,17 +160,12 @@ void BM_mesh_data_free(BMesh *bm)
*/
void BM_mesh_clear(BMesh *bm)
{
- Object *ob = bm->ob;
-
/* free old mesh */
BM_mesh_data_free(bm);
memset(bm, 0, sizeof(BMesh));
-
- /* re-initialize mesh */
- bm->ob = ob;
-
+
/* allocate the memory pools for the mesh elements */
- bm_mempool_init(bm, bm_mesh_allocsize_default);
+ bm_mempool_init(bm, &bm_mesh_allocsize_default);
bm->stackdepth = 1;
bm->totflags = 1;
@@ -187,6 +179,16 @@ void BM_mesh_clear(BMesh *bm)
void BM_mesh_free(BMesh *bm)
{
BM_mesh_data_free(bm);
+
+ if (bm->py_handle) {
+ /* keep this out of 'BM_mesh_data_free' because we wan't python
+ * to be able to clear the mesh and maintain access. */
+ extern void bpy_bm_generic_invalidate(void *self);
+
+ bpy_bm_generic_invalidate(bm->py_handle);
+ bm->py_handle = NULL;
+ }
+
MEM_freeN(bm);
}
@@ -205,24 +207,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) {
@@ -233,7 +219,7 @@ void BM_mesh_normals_update(BMesh *bm, const short skip_hidden)
continue;
#endif
- bmesh_face_normal_update(bm, f, f->no, projectverts);
+ BM_face_normal_update(bm, f);
}
/* Zero out vertex normals */
@@ -306,7 +292,6 @@ void BM_mesh_normals_update(BMesh *bm, const short skip_hidden)
}
MEM_freeN(edgevec);
- MEM_freeN(projectverts);
}
/*
@@ -350,11 +335,10 @@ 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)(Object *ob, BMesh *bm, int from, int to)
{
/* switch multires data out of tangent space */
if (CustomData_has_layer(&bm->ldata, CD_MDISPS)) {
- Object *ob = bm->ob;
BMEditMesh *em = BMEdit_Create(bm, FALSE);
DerivedMesh *dm = CDDM_from_BMEditMesh(em, NULL, TRUE, FALSE);
MDisps *mdisps;
@@ -385,6 +369,7 @@ static void bm_mdisps_space_set(BMesh *bm, int from, int to)
lmd->disps = MEM_dupallocN(mdisps->disps);
lmd->totdisp = mdisps->totdisp;
+ lmd->level = mdisps->level;
}
mdisps++;
diff --git a/source/blender/bmesh/intern/bmesh_mesh.h b/source/blender/bmesh/intern/bmesh_mesh.h
index 373b530894a..f48cc09af3b 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.h
+++ b/source/blender/bmesh/intern/bmesh_mesh.h
@@ -27,7 +27,9 @@
* \ingroup bmesh
*/
-BMesh *BM_mesh_create(struct Object *ob, const int allocsize[4]);
+struct BMAllocTemplate;
+
+BMesh *BM_mesh_create(struct BMAllocTemplate *allocsize);
void BM_mesh_free(BMesh *bm);
void BM_mesh_data_free(BMesh *bm);
@@ -46,4 +48,11 @@ BMVert *BM_vert_at_index(BMesh *bm, const int index);
BMEdge *BM_edge_at_index(BMesh *bm, const int index);
BMFace *BM_face_at_index(BMesh *bm, const int index);
+typedef struct BMAllocTemplate {
+ int totvert, totedge, totloop, totface;
+} BMAllocTemplate;
+
+extern BMAllocTemplate bm_mesh_allocsize_default;
+extern BMAllocTemplate bm_mesh_chunksize_default;
+
#endif /* __BMESH_MESH_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_mesh_conv.c b/source/blender/bmesh/intern/bmesh_mesh_conv.c
new file mode 100644
index 00000000000..8af31efda81
--- /dev/null
+++ b/source/blender/bmesh/intern/bmesh_mesh_conv.c
@@ -0,0 +1,898 @@
+/*
+ * ***** 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 "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 "MEM_guardedalloc.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 "bmesh.h"
+#include "intern/bmesh_private.h" /* for element checking */
+
+/* Mesh -> BMesh */
+void BM_mesh_bm_from_me(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 & ~SELECT);
+
+ /* this is necessary for selection counts to work properly */
+ if (mvert->flag & 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 & ~SELECT);
+
+ /* this is necessary for selection counts to work properly */
+ if (medge->flag & 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;
+ }
+
+ /* don't 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 & ~ME_FACE_SEL);
+
+ /* this is necessary for selection counts to work properly */
+ if (mpoly->flag & ME_FACE_SEL) {
+ 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;
+}
+
+BLI_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_bm_to_me(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;
+
+ 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");
+
+ /* new ngon face block */
+ if (bm->totface == 0) mpoly = NULL;
+ else mpoly = MEM_callocN(bm->totface * sizeof(MPoly), "loadeditbMesh poly");
+
+ /* new loop block */
+ if (bm->totloop == 0) mloop = NULL;
+ else mloop = MEM_callocN(bm->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 = bm->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) && (ob->parent->data == me) && 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..f9c51584081
--- /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_bm_from_me(BMesh *bm, struct Mesh *me, int set_key, int act_key_nr);
+void BM_mesh_bm_to_me(BMesh *bm, struct Mesh *me, int dotess);
+
+#endif /* __BMESH_MESH_CONV_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_mesh_validate.c b/source/blender/bmesh/intern/bmesh_mesh_validate.c
new file mode 100644
index 00000000000..f91e9d82879
--- /dev/null
+++ b/source/blender/bmesh/intern/bmesh_mesh_validate.c
@@ -0,0 +1,186 @@
+/*
+ * ***** 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) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/bmesh/intern/bmesh_mesh_validate.c
+ * \ingroup bmesh
+ *
+ * BM mesh validation function.
+ */
+
+/* debug builds only */
+#ifdef DEBUG
+
+#include "BLI_utildefines.h"
+
+#include "bmesh.h"
+
+#include "bmesh_mesh_validate.h"
+
+
+/* macro which inserts the function name */
+#if defined __GNUC__ || defined __sun
+# define ERRMSG(format, args...) { fprintf(stderr, "%s: " format ", " AT "\n", __func__, ##args); errtot++; } (void)0
+#else
+# define ERRMSG(format, ...) { fprintf(stderr, "%s: " format ", " AT "\n", __func__, __VA_ARGS__); errtot++; } (void)0
+#endif
+
+/**
+ * Check of this BMesh is valid, this function can be slow since its intended to help with debugging.
+ *
+ * \return TRUE when the mesh is valid.
+ */
+int BM_mesh_validate(BMesh *bm)
+{
+ int errtot;
+
+ BMIter iter;
+ BMVert *v;
+ BMEdge *e;
+ BMFace *f;
+
+ int i, j;
+
+ errtot = -1;
+ fprintf(stderr, "\n");
+ ERRMSG("This is a debugging function and not intended for general use, running slow test!");
+
+ /* force recalc, even if tagged as valid, since this mesh is suspect! */
+ bm->elem_index_dirty |= BM_ALL;
+ BM_mesh_elem_index_ensure(bm, BM_ALL);
+
+ BM_ITER_INDEX(v, &iter, bm, BM_VERTS_OF_MESH, NULL, i) {
+ if (BM_elem_flag_test(v, BM_ELEM_SELECT | BM_ELEM_HIDDEN) == (BM_ELEM_SELECT | BM_ELEM_HIDDEN)) {
+ ERRMSG("vert %d: is hidden and selected", i);
+ }
+
+ if (v->e) {
+ if (!BM_vert_in_edge(v->e, v)) {
+ ERRMSG("vert %d: is not in its referenced edge: %d", i, BM_elem_index_get(v->e));
+ }
+ }
+ }
+
+ /* check edges */
+ BM_ITER_INDEX(e, &iter, bm, BM_EDGES_OF_MESH, NULL, i) {
+ if (e->v1 == e->v2)
+ ERRMSG("edge %d: duplicate index: %d", i, BM_elem_index_get(e->v1));
+ }
+
+ /* edge radial structure */
+ BM_ITER_INDEX(e, &iter, bm, BM_EDGES_OF_MESH, NULL, i) {
+ if (BM_elem_flag_test(e, BM_ELEM_SELECT | BM_ELEM_HIDDEN) == (BM_ELEM_SELECT | BM_ELEM_HIDDEN)) {
+ ERRMSG("edge %d: is hidden and selected", i);
+ }
+
+ if (e->l) {
+ BMLoop *l_iter;
+ BMLoop *l_first;
+
+ j = 0;
+
+ l_iter = l_first = e->l;
+ /* we could do more checks here, but save for face checks */
+ do {
+ if (l_iter->e != e) {
+ ERRMSG("edge %d: has invalid loop, loop is of face %d", i, BM_elem_index_get(l_iter->f));
+ }
+ else if (BM_vert_in_edge(e, l_iter->v) == FALSE) {
+ ERRMSG("edge %d: has invalid loop with vert not in edge, loop is of face %d", i, BM_elem_index_get(l_iter->f));
+ }
+ else if (BM_vert_in_edge(e, l_iter->next->v) == FALSE) {
+ ERRMSG("edge %d: has invalid loop with next vert not in edge, loop is of face %d", i, BM_elem_index_get(l_iter->f));
+ }
+ } while ((l_iter = l_iter->radial_next) != l_first);
+ }
+ }
+
+ /* face structure */
+ BM_ITER_INDEX(f, &iter, bm, BM_FACES_OF_MESH, NULL, i) {
+ BMLoop *l_iter;
+ BMLoop *l_first;
+
+ if (BM_elem_flag_test(f, BM_ELEM_SELECT | BM_ELEM_HIDDEN) == (BM_ELEM_SELECT | BM_ELEM_HIDDEN)) {
+ ERRMSG("face %d: is hidden and selected", i);
+ }
+
+ l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+
+ do {
+ BM_elem_flag_disable(l_iter, BM_ELEM_INTERNAL_TAG);
+ BM_elem_flag_disable(l_iter->v, BM_ELEM_INTERNAL_TAG);
+ BM_elem_flag_disable(l_iter->e, BM_ELEM_INTERNAL_TAG);
+ } while ((l_iter = l_iter->next) != l_first);
+
+ j = 0;
+
+ l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+ do {
+ if (BM_elem_flag_test(l_iter, BM_ELEM_INTERNAL_TAG)) {
+ ERRMSG("face %d: has duplicate loop at corner: %d", i, j);
+ }
+ if (BM_elem_flag_test(l_iter->v, BM_ELEM_INTERNAL_TAG)) {
+ ERRMSG("face %d: has duplicate vert: %d, at corner: %d", i, BM_elem_index_get(l_iter->v), j);
+ }
+ if (BM_elem_flag_test(l_iter->e, BM_ELEM_INTERNAL_TAG)) {
+ ERRMSG("face %d: has duplicate edge: %d, at corner: %d", i, BM_elem_index_get(l_iter->e), j);
+ }
+
+ /* adjacent data checks */
+ if (l_iter->f != f) {
+ ERRMSG("face %d: has loop that points to face: %d at corner: %d", i, BM_elem_index_get(l_iter->f), j);
+ }
+ if (l_iter != l_iter->prev->next) {
+ ERRMSG("face %d: has invalid 'prev/next' at corner: %d", i, j);
+ }
+ if (l_iter != l_iter->next->prev) {
+ ERRMSG("face %d: has invalid 'next/prev' at corner: %d", i, j);
+ }
+ if (l_iter != l_iter->radial_prev->radial_next) {
+ ERRMSG("face %d: has invalid 'radial_prev/radial_next' at corner: %d", i, j);
+ }
+ if (l_iter != l_iter->radial_next->radial_prev) {
+ ERRMSG("face %d: has invalid 'radial_next/radial_prev' at corner: %d", i, j);
+ }
+
+ BM_elem_flag_enable(l_iter, BM_ELEM_INTERNAL_TAG);
+ BM_elem_flag_enable(l_iter->v, BM_ELEM_INTERNAL_TAG);
+ BM_elem_flag_enable(l_iter->e, BM_ELEM_INTERNAL_TAG);
+ j++;
+ } while ((l_iter = l_iter->next) != l_first);
+
+ if (j != f->len) {
+ ERRMSG("face %d: has length if %d but should be %d", i, f->len, j);
+ }
+ }
+
+
+
+ ERRMSG("Finished - errors %d", errtot);
+
+ return TRUE;
+}
+
+
+#endif
diff --git a/source/blender/bmesh/intern/bmesh_mesh_validate.h b/source/blender/bmesh/intern/bmesh_mesh_validate.h
new file mode 100644
index 00000000000..6839dc74d25
--- /dev/null
+++ b/source/blender/bmesh/intern/bmesh_mesh_validate.h
@@ -0,0 +1,35 @@
+/*
+ * ***** 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) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __BMESH_MESH_VALIDATE_H__
+#define __BMESH_MESH_VALIDATE_H__
+
+/** \file blender/bmesh/intern/bmesh_mesh_validate.h
+ * \ingroup bmesh
+ */
+
+int BM_mesh_validate(BMesh *bm);
+
+#endif /* __BMESH_MESH_VALIDATE_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c
index 59c12e2d9f2..da936079dc8 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).
@@ -65,7 +71,7 @@ int BM_vert_dissolve(BMesh *bm, BMVert *v)
BM_vert_kill(bm, v); /* will kill edges too */
return TRUE;
}
- else if (!BM_vert_is_manifold(bm, v)) {
+ else if (!BM_vert_is_manifold(v)) {
if (!v->e) {
BM_vert_kill(bm, v);
return TRUE;
@@ -85,7 +91,7 @@ int BM_vert_dissolve(BMesh *bm, BMVert *v)
}
}
else if (len == 2 && BM_vert_face_count(v) == 1) {
- /* boundry vertex on a face */
+ /* boundary vertex on a face */
return (BM_vert_collapse_edge(bm, v->e, v, TRUE) != NULL);
}
else {
@@ -102,7 +108,7 @@ int BM_disk_dissolve(BMesh *bm, BMVert *v)
BMEdge *e, *keepedge = NULL, *baseedge = NULL;
int len = 0;
- if (!BM_vert_is_manifold(bm, v)) {
+ if (!BM_vert_is_manifold(v)) {
return FALSE;
}
@@ -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)) {
@@ -206,7 +212,7 @@ int BM_disk_dissolve(BMesh *bm, BMVert *v)
/**
* \brief Faces Join Pair
*
- * Joins two adjacenct faces togather.
+ * Joins two adjacent faces togather.
*
* Because this method calls to #BM_faces_join to do its work, if a pair
* of faces share multiple edges, the pair of faces will be joined at
@@ -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;
}
}
@@ -462,7 +540,7 @@ BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
else {
/* single face or no faces */
/* same as BM_vert_collapse_edge() however we already
- * have vars to perform this operation so dont call. */
+ * have vars to perform this operation so don't call. */
ne = bmesh_jekv(bm, ke, kv, TRUE);
/* ne = BM_edge_exists(tv, tv2); */ /* same as return above */
@@ -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 / concave / 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 predictable results since that way the next vert
+ * just stitches 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 isn't 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 isn't 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 cause 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 isn't 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,106 @@ 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;
+ char f_hflag_prev_1;
+ char f_hflag_prev_2;
- 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;
+ /* --------------------------------------- */
+ /* Checking Code - make sure we can rotate */
- BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
- if (l->v == v1)
- l1 = l;
- else if (l->v == v2)
- l2 = l;
+ 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 */
+ /* ------------- */
+
- if (!BM_face_split(bm, f, l1->v, l2->v, &nl, NULL))
+
+ /* --------------- */
+ /* 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);
+
+ f_hflag_prev_1 = l1->f->head.hflag;
+ f_hflag_prev_2 = l2->f->head.hflag;
+
+ /* 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;
+ }
+
+ /* 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;
+ }
+ else {
+ /* we should really be able to know the faces some other way,
+ * rather then fetching them back from the edge, but this is predictable
+ * where using the return values from face split isn't. - campbell */
+ BMFace *fa, *fb;
+ if (BM_edge_face_pair(e_new, &fa, &fb)) {
+ fa->head.hflag = f_hflag_prev_1;
+ fb->head.hflag = f_hflag_prev_2;
+ }
+ }
- 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 f6b066ca763..34a1a3e7511 100644
--- a/source/blender/bmesh/intern/bmesh_opdefines.c
+++ b/source/blender/bmesh/intern/bmesh_opdefines.c
@@ -54,8 +54,10 @@
*
*/
+#include "BLI_utildefines.h"
+
#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 +77,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.
@@ -93,7 +95,7 @@
/*
* Vertex Smooth
*
- * Smoothes vertices by using a basic vertex averaging scheme.
+ * Smooths vertices by using a basic vertex averaging scheme.
*/
static BMOpDefine bmo_vertexsmooth_def = {
"vertexsmooth",
@@ -102,7 +104,7 @@ static BMOpDefine bmo_vertexsmooth_def = {
{BMO_OP_SLOT_BOOL, "mirror_clip_y"}, //set vertices close to the y axis before the operation to 0
{BMO_OP_SLOT_BOOL, "mirror_clip_z"}, //set vertices close to the z axis before the operation to 0
{BMO_OP_SLOT_FLT, "clipdist"}, //clipping threshod for the above three slots
- {0} /* null-terminating sentine */,
+ {0} /* null-terminating sentinel */,
},
bmo_vertexsmooth_exec,
0
@@ -118,7 +120,7 @@ static BMOpDefine bmo_righthandfaces_def = {
"righthandfaces",
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"},
{BMO_OP_SLOT_BOOL, "do_flip"}, //internal flag, used by bmesh_rationalize_normals
- {0} /* null-terminating sentine */,
+ {0} /* null-terminating sentinel */,
},
bmo_righthandfaces_exec,
BMO_OP_FLAG_UNTAN_MULTIRES,
@@ -140,7 +142,7 @@ static BMOpDefine bmo_regionextend_def = {
{BMO_OP_SLOT_ELEMENT_BUF, "geomout"}, //output slot, computed boundary geometry.
{BMO_OP_SLOT_BOOL, "constrict"}, //find boundary inside the regions, not outside.
{BMO_OP_SLOT_BOOL, "use_faces"}, //extend from faces instead of edges
- {0} /* null-terminating sentine */,
+ {0} /* null-terminating sentinel */,
},
bmo_regionextend_exec,
0
@@ -157,7 +159,7 @@ static BMOpDefine bmo_edgerotate_def = {
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, //input edges
{BMO_OP_SLOT_ELEMENT_BUF, "edgeout"}, //newly spun edges
{BMO_OP_SLOT_BOOL, "ccw"}, //rotate edge counter-clockwise if true, othewise clockwise
- {0} /* null-terminating sentine */,
+ {0} /* null-terminating sentinel */,
},
bmo_edgerotate_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
@@ -172,7 +174,7 @@ static BMOpDefine bmo_edgerotate_def = {
static BMOpDefine bmo_reversefaces_def = {
"reversefaces",
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"}, //input faces
- {0} /* null-terminating sentine */,
+ {0} /* null-terminating sentinel */,
},
bmo_reversefaces_exec,
BMO_OP_FLAG_UNTAN_MULTIRES,
@@ -189,7 +191,7 @@ static BMOpDefine bmo_edgebisect_def = {
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, //input edges
{BMO_OP_SLOT_INT, "numcuts"}, //number of cuts
{BMO_OP_SLOT_ELEMENT_BUF, "outsplit"}, //newly created vertices and edges
- {0} /* null-terminating sentine */,
+ {0} /* null-terminating sentinel */,
},
bmo_edgebisect_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
@@ -212,7 +214,7 @@ static BMOpDefine bmo_mirror_def = {
{BMO_OP_SLOT_INT, "axis"}, //the axis to use, 0, 1, or 2 for x, y, z
{BMO_OP_SLOT_BOOL, "mirror_u"}, //mirror UVs across the u axis
{BMO_OP_SLOT_BOOL, "mirror_v"}, //mirror UVs across the v axis
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_mirror_exec,
0,
};
@@ -222,6 +224,9 @@ static BMOpDefine bmo_mirror_def = {
*
* Takes input verts and find vertices they should weld to. Outputs a
* mapping slot suitable for use with the weld verts bmop.
+ *
+ * If keepverts is used, vertices outside that set can only be merged
+ * with vertices in that set.
*/
static BMOpDefine bmo_finddoubles_def = {
"finddoubles",
@@ -229,7 +234,7 @@ static BMOpDefine bmo_finddoubles_def = {
{BMO_OP_SLOT_ELEMENT_BUF, "keepverts"}, //list of verts to keep
{BMO_OP_SLOT_FLT, "dist"}, //minimum distance
{BMO_OP_SLOT_MAPPING, "targetmapout"},
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_finddoubles_exec,
0,
};
@@ -244,7 +249,7 @@ static BMOpDefine bmo_removedoubles_def = {
"removedoubles",
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input verts
{BMO_OP_SLOT_FLT, "dist"}, //minimum distance
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_removedoubles_exec,
BMO_OP_FLAG_UNTAN_MULTIRES,
};
@@ -260,7 +265,7 @@ static BMOpDefine bmo_automerge_def = {
"automerge",
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input verts
{BMO_OP_SLOT_FLT, "dist"}, //minimum distance
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_automerge_exec,
BMO_OP_FLAG_UNTAN_MULTIRES,
};
@@ -273,7 +278,7 @@ static BMOpDefine bmo_automerge_def = {
static BMOpDefine bmo_collapse_def = {
"collapse",
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, /* input edge */
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_collapse_exec,
BMO_OP_FLAG_UNTAN_MULTIRES,
};
@@ -288,7 +293,7 @@ static BMOpDefine bmo_pointmerge_facedata_def = {
"pointmerge_facedata",
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, /* input vertice */
{BMO_OP_SLOT_ELEMENT_BUF, "snapv"}, /* snap verte */
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_pointmerge_facedata_exec,
0,
};
@@ -303,7 +308,7 @@ static BMOpDefine bmo_pointmerge_facedata_def = {
static BMOpDefine bmo_vert_average_facedata_def = {
"vert_average_facedata",
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, /* input vertice */
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_vert_average_facedata_exec,
0,
};
@@ -317,7 +322,7 @@ static BMOpDefine bmo_pointmerge_def = {
"pointmerge",
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, /* input vertice */
{BMO_OP_SLOT_VEC, "mergeco"},
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_pointmerge_exec,
BMO_OP_FLAG_UNTAN_MULTIRES,
};
@@ -330,7 +335,7 @@ static BMOpDefine bmo_pointmerge_def = {
static BMOpDefine bmo_collapse_uvs_def = {
"collapse_uvs",
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, /* input edge */
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_collapse_uvs_exec,
0,
};
@@ -345,7 +350,7 @@ static BMOpDefine bmo_collapse_uvs_def = {
static BMOpDefine bmo_weldverts_def = {
"weldverts",
{{BMO_OP_SLOT_MAPPING, "targetmap"}, /* maps welded vertices to verts they should weld to */
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_weldverts_exec,
BMO_OP_FLAG_UNTAN_MULTIRES,
};
@@ -353,14 +358,14 @@ static BMOpDefine bmo_weldverts_def = {
/*
* Make Vertex
*
- * Creates a single vertex; this bmop was necassary
+ * Creates a single vertex; this bmop was necessary
* for click-create-vertex.
*/
static BMOpDefine bmo_makevert_def = {
"makevert",
{{BMO_OP_SLOT_VEC, "co"}, //the coordinate of the new vert
{BMO_OP_SLOT_ELEMENT_BUF, "newvertout"}, //the new vert
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_makevert_exec,
0,
};
@@ -380,7 +385,7 @@ static BMOpDefine bmo_join_triangles_def = {
{BMO_OP_SLOT_BOOL, "cmp_vcols"},
{BMO_OP_SLOT_BOOL, "cmp_materials"},
{BMO_OP_SLOT_FLT, "limit"},
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_join_triangles_exec,
BMO_OP_FLAG_UNTAN_MULTIRES,
};
@@ -400,7 +405,7 @@ static BMOpDefine bmo_contextual_create_def = {
"contextual_create",
{{BMO_OP_SLOT_ELEMENT_BUF, "geom"}, //input geometry.
{BMO_OP_SLOT_ELEMENT_BUF, "faceout"}, //newly-made face(s)
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_contextual_create_exec,
BMO_OP_FLAG_UNTAN_MULTIRES,
};
@@ -412,7 +417,7 @@ static BMOpDefine bmo_bridge_loops_def = {
"bridge_loops",
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, /* input edge */
{BMO_OP_SLOT_ELEMENT_BUF, "faceout"}, /* new face */
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_bridge_loops_exec,
0,
};
@@ -426,7 +431,7 @@ static BMOpDefine bmo_edgenet_fill_def = {
{BMO_OP_SLOT_ELEMENT_BUF, "excludefaces"}, /* list of faces to ignore for manifold check */
{BMO_OP_SLOT_MAPPING, "faceout_groupmap"}, /* maps new faces to the group numbers they came fro */
{BMO_OP_SLOT_ELEMENT_BUF, "faceout"}, /* new face */
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_edgenet_fill_exec,
0,
};
@@ -445,7 +450,7 @@ static BMOpDefine bmo_edgenet_prepare_def = {
"edgenet_prepare",
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, //input edges
{BMO_OP_SLOT_ELEMENT_BUF, "edgeout"}, //new edges
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_edgenet_prepare,
0,
};
@@ -454,14 +459,14 @@ static BMOpDefine bmo_edgenet_prepare_def = {
* Rotate
*
* Rotate vertices around a center, using a 3x3 rotation
- * matrix. Equivilent of the old rotateflag function.
+ * matrix. Equivalent of the old rotateflag function.
*/
static BMOpDefine bmo_rotate_def = {
"rotate",
{{BMO_OP_SLOT_VEC, "cent"}, //center of rotation
{BMO_OP_SLOT_MAT, "mat"}, //matrix defining rotation
{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input vertices
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_rotate_exec,
0,
};
@@ -469,14 +474,14 @@ static BMOpDefine bmo_rotate_def = {
/*
* Translate
*
- * Translate vertices by an offset. Equivelent of the
+ * Translate vertices by an offset. Equivalent of the
* old translateflag function.
*/
static BMOpDefine bmo_translate_def = {
"translate",
{{BMO_OP_SLOT_VEC, "vec"}, //translation offset
{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input vertices
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_translate_exec,
0,
};
@@ -490,7 +495,7 @@ static BMOpDefine bmo_scale_def = {
"scale",
{{BMO_OP_SLOT_VEC, "vec"}, //scale factor
{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input vertices
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_scale_exec,
0,
};
@@ -506,7 +511,7 @@ static BMOpDefine bmo_transform_def = {
"transform",
{{BMO_OP_SLOT_MAT, "mat"}, //transform matrix
{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input vertices
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_transform_exec,
0,
};
@@ -521,7 +526,7 @@ static BMOpDefine bmo_object_load_bmesh_def = {
"object_load_bmesh",
{{BMO_OP_SLOT_PNT, "scene"},
{BMO_OP_SLOT_PNT, "object"},
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_object_load_bmesh_exec,
0,
};
@@ -536,8 +541,8 @@ static BMOpDefine bmo_bmesh_to_mesh_def = {
"bmesh_to_mesh",
{{BMO_OP_SLOT_PNT, "mesh"}, //pointer to a mesh structure to fill in
{BMO_OP_SLOT_PNT, "object"}, //pointer to an object structure
- {BMO_OP_SLOT_BOOL, "notesselation"}, //don't calculate mfaces
- {0, /* null-terminating sentine */}},
+ {BMO_OP_SLOT_BOOL, "notessellation"}, //don't calculate mfaces
+ {0, /* null-terminating sentinel */}},
bmo_bmesh_to_mesh_exec,
0,
};
@@ -553,7 +558,7 @@ static BMOpDefine bmo_mesh_to_bmesh_def = {
{{BMO_OP_SLOT_PNT, "mesh"}, //pointer to a Mesh structure
{BMO_OP_SLOT_PNT, "object"}, //pointer to an Object structure
{BMO_OP_SLOT_BOOL, "set_shapekey"}, //load active shapekey coordinates into verts
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_mesh_to_bmesh_exec,
0
};
@@ -568,7 +573,7 @@ static BMOpDefine bmo_extrude_indivface_def = {
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"}, //input faces
{BMO_OP_SLOT_ELEMENT_BUF, "faceout"}, //output faces
{BMO_OP_SLOT_ELEMENT_BUF, "skirtout"}, //output skirt geometry, faces and edges
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_extrude_face_indiv_exec,
0
};
@@ -583,7 +588,7 @@ static BMOpDefine bmo_extrude_edge_only_def = {
"extrude_edge_only",
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, //input vertices
{BMO_OP_SLOT_ELEMENT_BUF, "geomout"}, //output geometry
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_extrude_edge_only_exec,
0
};
@@ -598,7 +603,7 @@ static BMOpDefine bmo_extrude_vert_indiv_def = {
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input vertices
{BMO_OP_SLOT_ELEMENT_BUF, "edgeout"}, //output wire edges
{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, //output vertices
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_extrude_vert_indiv_exec,
0
};
@@ -607,7 +612,7 @@ static BMOpDefine bmo_connectverts_def = {
"connectverts",
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"},
{BMO_OP_SLOT_ELEMENT_BUF, "edgeout"},
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_connectverts_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
};
@@ -618,7 +623,7 @@ static BMOpDefine bmo_extrude_face_region_def = {
{BMO_OP_SLOT_MAPPING, "exclude"},
{BMO_OP_SLOT_BOOL, "alwayskeeporig"},
{BMO_OP_SLOT_ELEMENT_BUF, "geomout"},
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_extrude_face_region_exec,
0
};
@@ -626,7 +631,7 @@ static BMOpDefine bmo_extrude_face_region_def = {
static BMOpDefine bmo_dissolve_verts_def = {
"dissolve_verts",
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"},
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_dissolve_verts_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
};
@@ -636,7 +641,7 @@ static BMOpDefine bmo_dissolve_edges_def = {
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"},
{BMO_OP_SLOT_ELEMENT_BUF, "regionout"},
{BMO_OP_SLOT_BOOL, "use_verts"}, // dissolve verts left between only 2 edges.
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_dissolve_edges_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
};
@@ -645,7 +650,7 @@ static BMOpDefine bmo_dissolve_edge_loop_def = {
"dissolve_edge_loop",
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"},
{BMO_OP_SLOT_ELEMENT_BUF, "regionout"},
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_dissolve_edgeloop_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
};
@@ -655,7 +660,7 @@ static BMOpDefine bmo_dissolve_faces_def = {
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"},
{BMO_OP_SLOT_ELEMENT_BUF, "regionout"},
{BMO_OP_SLOT_BOOL, "use_verts"}, // dissolve verts left between only 2 edges.
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_dissolve_faces_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
};
@@ -665,7 +670,7 @@ static BMOpDefine bmo_dissolve_limit_def = {
{{BMO_OP_SLOT_FLT, "angle_limit"}, /* total rotation angle (degrees) */
{BMO_OP_SLOT_ELEMENT_BUF, "verts"},
{BMO_OP_SLOT_ELEMENT_BUF, "edges"},
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_dissolve_limit_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
};
@@ -676,7 +681,8 @@ static BMOpDefine bmo_triangulate_def = {
{BMO_OP_SLOT_ELEMENT_BUF, "edgeout"},
{BMO_OP_SLOT_ELEMENT_BUF, "faceout"},
{BMO_OP_SLOT_MAPPING, "facemap"},
- {0} /* null-terminating sentine */},
+ {BMO_OP_SLOT_BOOL, "use_beauty"},
+ {0} /* null-terminating sentinel */},
bmo_triangulate_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
};
@@ -699,9 +705,9 @@ static BMOpDefine bmo_esubd_def = {
{BMO_OP_SLOT_INT, "quadcornertype"}, //quad corner type, see bmesh_operators.h
{BMO_OP_SLOT_BOOL, "gridfill"}, //fill in fully-selected faces with a grid
- {BMO_OP_SLOT_BOOL, "singleedge"}, //tesselate the case of one edge selected in a quad or triangle
+ {BMO_OP_SLOT_BOOL, "singleedge"}, //tessellate the case of one edge selected in a quad or triangle
- {0} /* null-terminating sentine */,
+ {0} /* null-terminating sentinel */,
},
bmo_esubd_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
@@ -711,7 +717,7 @@ static BMOpDefine bmo_del_def = {
"del",
{{BMO_OP_SLOT_ELEMENT_BUF, "geom"},
{BMO_OP_SLOT_INT, "context"},
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_del_exec,
0
};
@@ -727,7 +733,7 @@ static BMOpDefine bmo_dupe_def = {
{BMO_OP_SLOT_MAPPING, "boundarymap"},
{BMO_OP_SLOT_MAPPING, "isovertmap"},
{BMO_OP_SLOT_PNT, "dest"}, /* destination bmesh, if NULL will use current on */
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_dupe_exec,
0
};
@@ -739,8 +745,8 @@ static BMOpDefine bmo_split_def = {
{BMO_OP_SLOT_MAPPING, "boundarymap"},
{BMO_OP_SLOT_MAPPING, "isovertmap"},
{BMO_OP_SLOT_PNT, "dest"}, /* destination bmesh, if NULL will use current on */
- {BMO_OP_SLOT_BOOL, "use_only_faces"}, /* when enabled. dont duplicate loose verts/edges */
- {0} /* null-terminating sentine */},
+ {BMO_OP_SLOT_BOOL, "use_only_faces"}, /* when enabled. don't duplicate loose verts/edges */
+ {0} /* null-terminating sentinel */},
bmo_split_exec,
0
};
@@ -761,7 +767,7 @@ static BMOpDefine bmo_spin_def = {
{BMO_OP_SLOT_FLT, "ang"}, /* total rotation angle (degrees) */
{BMO_OP_SLOT_INT, "steps"}, /* number of steps */
{BMO_OP_SLOT_BOOL, "do_dupli"}, /* duplicate or extrude? */
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_spin_exec,
0
};
@@ -778,7 +784,7 @@ static BMOpDefine bmo_similarfaces_def = {
{BMO_OP_SLOT_ELEMENT_BUF, "faceout"}, /* output faces */
{BMO_OP_SLOT_INT, "type"}, /* type of selection */
{BMO_OP_SLOT_FLT, "thresh"}, /* threshold of selection */
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_similarfaces_exec,
0
};
@@ -794,7 +800,7 @@ static BMOpDefine bmo_similaredges_def = {
{BMO_OP_SLOT_ELEMENT_BUF, "edgeout"}, /* output edges */
{BMO_OP_SLOT_INT, "type"}, /* type of selection */
{BMO_OP_SLOT_FLT, "thresh"}, /* threshold of selection */
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_similaredges_exec,
0
};
@@ -810,7 +816,7 @@ static BMOpDefine bmo_similarverts_def = {
{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, /* output vertices */
{BMO_OP_SLOT_INT, "type"}, /* type of selection */
{BMO_OP_SLOT_FLT, "thresh"}, /* threshold of selection */
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_similarverts_exec,
0
};
@@ -823,7 +829,7 @@ static BMOpDefine bmo_face_rotateuvs_def = {
"face_rotateuvs",
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"}, /* input faces */
{BMO_OP_SLOT_INT, "dir"}, /* direction */
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_face_rotateuvs_exec,
0
};
@@ -835,7 +841,7 @@ static BMOpDefine bmo_face_rotateuvs_def = {
static BMOpDefine bmo_face_reverseuvs_def = {
"face_reverseuvs",
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"}, /* input faces */
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_face_reverseuvs_exec,
0
};
@@ -848,7 +854,7 @@ static BMOpDefine bmo_face_rotatecolors_def = {
"face_rotatecolors",
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"}, /* input faces */
{BMO_OP_SLOT_INT, "dir"}, /* direction */
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_rotatecolors_exec,
0
};
@@ -860,7 +866,7 @@ static BMOpDefine bmo_face_rotatecolors_def = {
static BMOpDefine bmo_face_reversecolors_def = {
"face_reversecolors",
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"}, /* input faces */
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_face_reversecolors_exec,
0
};
@@ -876,7 +882,7 @@ static BMOpDefine bmo_vertexshortestpath_def = {
{BMO_OP_SLOT_ELEMENT_BUF, "endv"}, /* end vertex */
{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, /* output vertices */
{BMO_OP_SLOT_INT, "type"}, /* type of selection */
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_vertexshortestpath_exec,
0
};
@@ -889,9 +895,11 @@ 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 */
- {0} /* null-terminating sentine */},
+ {BMO_OP_SLOT_ELEMENT_BUF, "edgeout"}, /* old output disconnected edges */
+ /* needed for vertex rip so we can rip only half an edge at a boundary wich would otherwise split off */
+ {BMO_OP_SLOT_ELEMENT_BUF, "verts"}, /* optional tag verts, use to have greater control of splits */
+ {BMO_OP_SLOT_BOOL, "use_verts"}, /* use 'verts' for splitting, else just find verts to split from edges */
+ {0} /* null-terminating sentinel */},
bmo_edgesplit_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
};
@@ -908,7 +916,7 @@ static BMOpDefine bmo_create_grid_def = {
{BMO_OP_SLOT_INT, "ysegments"}, //number of y segments
{BMO_OP_SLOT_FLT, "size"}, //size of the grid
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_create_grid_exec,
0,
};
@@ -925,7 +933,7 @@ static BMOpDefine bmo_create_uvsphere_def = {
{BMO_OP_SLOT_INT, "revolutions"}, //number of v segment
{BMO_OP_SLOT_FLT, "diameter"}, //diameter
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with--
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_create_uvsphere_exec,
0,
};
@@ -941,7 +949,7 @@ static BMOpDefine bmo_create_icosphere_def = {
{BMO_OP_SLOT_INT, "subdivisions"}, //how many times to recursively subdivide the sphere
{BMO_OP_SLOT_FLT, "diameter"}, //diameter
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_create_icosphere_exec,
0,
};
@@ -955,7 +963,7 @@ static BMOpDefine bmo_create_monkey_def = {
"create_monkey",
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, //output verts
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with--
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_create_monkey_exec,
0,
};
@@ -975,7 +983,7 @@ static BMOpDefine bmo_create_cone_def = {
{BMO_OP_SLOT_FLT, "diameter2"}, //diameter of the opposite
{BMO_OP_SLOT_FLT, "depth"}, //distance between ends
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with--
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_create_cone_exec,
0,
};
@@ -991,7 +999,7 @@ static BMOpDefine bmo_create_circle_def = {
{BMO_OP_SLOT_INT, "segments"},
{BMO_OP_SLOT_FLT, "diameter"}, //diameter of one end
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with--
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_create_circle_exec,
0,
};
@@ -1006,7 +1014,7 @@ static BMOpDefine bmo_create_cube_def = {
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, //output verts
{BMO_OP_SLOT_FLT, "size"}, //size of the cube
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with--
- {0, /* null-terminating sentine */}},
+ {0, /* null-terminating sentinel */}},
bmo_create_cube_exec,
0,
};
@@ -1027,7 +1035,7 @@ static BMOpDefine bmo_bevel_def = {
* modifier uses this. We could do this as another float setting */
{BMO_OP_SLOT_INT, "lengthlayer"}, /* which PROP_FLT layer to us */
{BMO_OP_SLOT_FLT, "percent"}, /* percentage to expand bevelled edge */
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_bevel_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
};
@@ -1042,7 +1050,7 @@ static BMOpDefine bmo_beautify_fill_def = {
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"}, /* input faces */
{BMO_OP_SLOT_ELEMENT_BUF, "constrain_edges"}, /* edges that can't be flipped */
{BMO_OP_SLOT_ELEMENT_BUF, "geomout"}, /* new flipped faces and edges */
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_beautify_fill_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
};
@@ -1056,7 +1064,7 @@ static BMOpDefine bmo_triangle_fill_def = {
"triangle_fill",
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, /* input edges */
{BMO_OP_SLOT_ELEMENT_BUF, "geomout"}, /* new faces and edges */
- {0} /* null-terminating sentine */},
+ {0} /* null-terminating sentinel */},
bmo_triangle_fill_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
};
@@ -1076,6 +1084,25 @@ static BMOpDefine bmo_solidify_def = {
0
};
+/*
+ * Face Inset
+ *
+ * Extrudes faces individually.
+ */
+static BMOpDefine bmo_inset_def = {
+ "inset",
+ {{BMO_OP_SLOT_ELEMENT_BUF, "faces"}, /* input faces */
+ {BMO_OP_SLOT_ELEMENT_BUF, "faceout"}, /* output faces */
+ {BMO_OP_SLOT_BOOL, "use_boundary"},
+ {BMO_OP_SLOT_BOOL, "use_even_offset"},
+ {BMO_OP_SLOT_BOOL, "use_relative_offset"},
+ {BMO_OP_SLOT_FLT, "thickness"},
+ {BMO_OP_SLOT_BOOL, "use_outset"},
+ {0} /* null-terminating sentinel */},
+ bmo_inset_exec,
+ 0
+};
+
BMOpDefine *opdefines[] = {
&bmo_split_def,
&bmo_spin_def,
@@ -1142,6 +1169,7 @@ BMOpDefine *opdefines[] = {
&bmo_triangle_fill_def,
&bmo_bridge_loops_def,
&bmo_solidify_def,
+ &bmo_inset_def,
};
int bmesh_total_ops = (sizeof(opdefines) / sizeof(void *));
diff --git a/source/blender/bmesh/bmesh_operator_api.h b/source/blender/bmesh/intern/bmesh_operator_api.h
index b5535b5bf58..7cba66995c9 100644
--- a/source/blender/bmesh/bmesh_operator_api.h
+++ b/source/blender/bmesh/intern/bmesh_operator_api.h
@@ -31,15 +31,11 @@
extern "C" {
#endif
-#include "BLI_memarena.h"
#include "BLI_ghash.h"
-#include "BKE_utildefines.h"
-
#include <stdarg.h>
-#include <string.h> /* for memcpy */
-/*
+/**
* operators represent logical, executable mesh modules. all topological
* operations involving a bmesh has to go through them.
*
@@ -47,7 +43,7 @@ extern "C" {
* when it's executed. tool flags are allocated in layers, one per operator
* execution, and are used for all internal flagging a tool needs to do.
*
- * each operator has a series of "slots," which can be of the following types:
+ * each operator has a series of "slots" which can be of the following types:
* - simple numerical types
* - arrays of elements (e.g. arrays of faces).
* - hash mappings.
@@ -59,33 +55,39 @@ 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;
-#define BMO_elem_flag_test( bm, ele, oflag) _bmo_elem_flag_test (bm, (ele)->oflags, oflag)
-#define BMO_elem_flag_enable( bm, ele, oflag) _bmo_elem_flag_enable (bm, (ele)->oflags, oflag)
-#define BMO_elem_flag_disable(bm, ele, oflag) _bmo_elem_flag_disable (bm, (ele)->oflags, oflag)
-#define BMO_elem_flag_set( bm, ele, oflag, val) _bmo_elem_flag_set (bm, (ele)->oflags, oflag, val)
-#define BMO_elem_flag_toggle( bm, ele, oflag) _bmo_elem_flag_toggle (bm, (ele)->oflags, oflag)
+#define BMO_elem_flag_test( bm, ele, oflag) _bmo_elem_flag_test (bm, (ele)->oflags, oflag)
+#define BMO_elem_flag_test_bool(bm, ele, oflag) _bmo_elem_flag_test_bool(bm, (ele)->oflags, oflag)
+#define BMO_elem_flag_enable( bm, ele, oflag) _bmo_elem_flag_enable (bm, (ele)->oflags, oflag)
+#define BMO_elem_flag_disable( bm, ele, oflag) _bmo_elem_flag_disable (bm, (ele)->oflags, oflag)
+#define BMO_elem_flag_set( bm, ele, oflag, val) _bmo_elem_flag_set (bm, (ele)->oflags, oflag, val)
+#define BMO_elem_flag_toggle( bm, ele, oflag) _bmo_elem_flag_toggle (bm, (ele)->oflags, oflag)
-BM_INLINE short _bmo_elem_flag_test(BMesh *bm, BMFlagLayer *oflags, const short oflag);
-BM_INLINE void _bmo_elem_flag_enable(BMesh *bm, BMFlagLayer *oflags, const short oflag);
-BM_INLINE void _bmo_elem_flag_disable(BMesh *bm, BMFlagLayer *oflags, const short oflag);
-BM_INLINE void _bmo_elem_flag_set(BMesh *bm, BMFlagLayer *oflags, const short oflag, int val);
-BM_INLINE void _bmo_elem_flag_toggle(BMesh *bm, BMFlagLayer *oflags, const short oflag);
+BLI_INLINE short _bmo_elem_flag_test( BMesh *bm, BMFlagLayer *oflags, const short oflag);
+BLI_INLINE short _bmo_elem_flag_test_bool(BMesh *bm, BMFlagLayer *oflags, const short oflag);
+BLI_INLINE void _bmo_elem_flag_enable( BMesh *bm, BMFlagLayer *oflags, const short oflag);
+BLI_INLINE void _bmo_elem_flag_disable( BMesh *bm, BMFlagLayer *oflags, const short oflag);
+BLI_INLINE void _bmo_elem_flag_set( BMesh *bm, BMFlagLayer *oflags, const short oflag, int val);
+BLI_INLINE void _bmo_elem_flag_toggle( BMesh *bm, BMFlagLayer *oflags, const short oflag);
/* slot type arrays are terminated by the last member
* having a slot type of 0.*/
@@ -140,7 +142,7 @@ typedef struct BMOperator {
int needflag;
int flag;
struct BMOpSlot slots[BMO_OP_MAX_SLOTS]; void (*exec)(BMesh *bm, struct BMOperator *op);
- MemArena *arena;
+ struct MemArena *arena;
} BMOperator;
#define MAX_SLOTNAME 32
@@ -182,9 +184,13 @@ void BMO_op_exec(BMesh *bm, BMOperator *op);
* after it finishes executing in BMO_op_exec).*/
void BMO_op_finish(BMesh *bm, BMOperator *op);
-/* count the number of elements with a specific flag.
+/* count the number of elements with the specified flag enabled.
* type can be a bitmask of BM_FACE, BM_EDGE, or BM_FACE. */
-int BMO_mesh_flag_count(BMesh *bm, const short oflag, const char htype);
+int BMO_mesh_enabled_flag_count(BMesh *bm, const char htype, const short oflag);
+
+/* count the number of elements with the specified flag disabled.
+ * type can be a bitmask of BM_FACE, BM_EDGE, or BM_FACE. */
+int BMO_mesh_disabled_flag_count(BMesh *bm, const char htype, const short oflag);
/*---------formatted operator initialization/execution-----------*/
/*
@@ -209,8 +215,10 @@ int BMO_mesh_flag_count(BMesh *bm, const short oflag, const char htype);
* so e.g. %hf will do faces, %hfe will do faces and edges,
* %hv will do verts, etc. must pass in at least one
* element type letter.
+ * %H[f/e/v] - same as %h, but tests if the flag is disabled
* %f[f/e/v] - same as %h, except it deals with tool flags instead of
* header flags.
+ * %F[f/e/v] - same as %f, but tests if the flag is disabled
* %a[f/e/v] - pass all elements (of types specified by f/e/v) to the
* slot.
* %e - pass in a single element.
@@ -234,7 +242,7 @@ int BMO_op_callf(BMesh *bm, const char *fmt, ...);
int BMO_op_initf(BMesh *bm, BMOperator *op, const char *fmt, ...);
/* va_list version, used to implement the above two functions,
- * plus EDBM_CallOpf in bmeshutils.c. */
+ * plus EDBM_op_callf in bmeshutils.c. */
int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *fmt, va_list vlist);
/* test whether a named slot exists */
@@ -289,33 +297,50 @@ void BMO_slot_mat3_set(BMOperator *op, const char *slotname, float r_mat[3][3]);
void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *op, const char htype, const short oflag);
-/* puts every element of type type (which is a bitmask) with tool flag flag,
- * into a slot. */
-void BMO_slot_from_flag(BMesh *bm, BMOperator *op, const char *slotname,
- const short oflag, const char htype);
+/* copies the values from another slot to the end of the output slot */
+void BMO_slot_buffer_append(BMOperator *output_op, const char *output_op_slot,
+ BMOperator *other_op, const char *other_op_slot);
+
+/* puts every element of type 'type' (which is a bitmask) with tool
+ * flag 'flag', into a slot. */
+void BMO_slot_buffer_from_enabled_flag(BMesh *bm, BMOperator *op, const char *slotname,
+ const char htype, const short oflag);
+
+/* puts every element of type 'type' (which is a bitmask) without tool
+ * flag 'flag', into a slot. */
+void BMO_slot_buffer_from_disabled_flag(BMesh *bm, BMOperator *op, const char *slotname,
+ const char htype, const short oflag);
/* tool-flags all elements inside an element slot array with flag flag. */
void BMO_slot_buffer_flag_enable(BMesh *bm, BMOperator *op, const char *slotname,
- const short oflag, const char htype);
+ const char htype, const short oflag);
/* clears tool-flag flag from all elements inside a slot array. */
void BMO_slot_buffer_flag_disable(BMesh *bm, BMOperator *op, const char *slotname,
- const short oflag, const char htype);
+ const char htype, const short oflag);
/* tool-flags all elements inside an element slot array with flag flag. */
void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOperator *op, const char *slotname,
- const char hflag, const char htype, char do_flush_select);
+ const char htype, const char hflag, const char do_flush);
/* clears tool-flag flag from all elements inside a slot array. */
void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOperator *op, const char *slotname,
- const char hflag, const char htype, char do_flush_select);
-
-/* puts every element of type type (which is a bitmask) with header flag
- * flag, into a slot. note: ignores hidden elements (e.g. elements with
- * header flag BM_ELEM_HIDDEN set).*/
-void BMO_slot_from_hflag(BMesh *bm, BMOperator *op, const char *slotname,
- const char hflag, const char htype);
+ const char htype, const char hflag, const char do_flush);
+
+/* puts every element of type 'type' (which is a bitmask) with header
+ * flag 'flag', into a slot. note: ignores hidden elements
+ * (e.g. elements with header flag BM_ELEM_HIDDEN set).*/
+void BMO_slot_buffer_from_enabled_hflag(BMesh *bm, BMOperator *op,
+ const char *slotname,
+ const char htype, const char hflag);
+
+/* puts every element of type 'type' (which is a bitmask) without
+ * header flag 'flag', into a slot. note: ignores hidden elements
+ * (e.g. elements with header flag BM_ELEM_HIDDEN set).*/
+void BMO_slot_buffer_from_disabled_hflag(BMesh *bm, BMOperator *op,
+ const char *slotname,
+ const char htype, const char hflag);
/* counts number of elements inside a slot array. */
-int BMO_slot_buf_count(BMesh *bm, BMOperator *op, const char *slotname);
+int BMO_slot_buffer_count(BMesh *bm, BMOperator *op, const char *slotname);
int BMO_slot_map_count(BMesh *bm, BMOperator *op, const char *slotname);
void BMO_slot_map_insert(BMesh *UNUSED(bm), BMOperator *op, const char *slotname,
@@ -327,8 +352,8 @@ int BMO_vert_edge_flags_count(BMesh *bm, BMVert *v, const short oflag);
/* flags all elements in a mapping. note that the mapping must only have
* bmesh elements in it.*/
-void BMO_slot_map_to_flag(BMesh *bm, BMOperator *op,
- const char *slotname, const short oflag);
+void BMO_slot_map_to_flag(BMesh *bm, BMOperator *op, const char *slotname,
+ const char hflag, const short oflag);
/* this part of the API is used to iterate over element buffer or
* mapping slots.
@@ -339,7 +364,7 @@ void BMO_slot_map_to_flag(BMesh *bm, BMOperator *op,
* BMFace *f;
*
* f = BMO_iter_new(&oiter, bm, some_operator, "slotname", BM_FACE);
- * for (; f; f=BMO_iter_step(&oiter)) {
+ * for (; f; f = BMO_iter_step(&oiter)) {
* /do something with the face
* }
*
@@ -349,7 +374,7 @@ void BMO_slot_map_to_flag(BMesh *bm, BMOperator *op,
* void *val;
*
* key = BMO_iter_new(&oiter, bm, some_operator, "slotname", 0);
- * for (; key; key=BMO_iter_step(&oiter)) {
+ * for (; key; key = BMO_iter_step(&oiter)) {
* val = BMO_iter_map_value(&oiter);
* //do something with the key/val pair
* //note that val is a pointer to the val data,
@@ -371,11 +396,8 @@ typedef struct BMOIter {
char restrictmask; /* bitwise '&' with BMHeader.htype */
} BMOIter;
-void *BMO_slot_elem_first(BMOperator *op, const char *slotname);
+void *BMO_slot_buffer_elem_first(BMOperator *op, const char *slotname);
-/* restrictmask restricts the iteration to certain element types
- * (e.g. combination of BM_VERT, BM_EDGE, BM_FACE), if iterating
- * 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);
@@ -392,7 +414,7 @@ float BMO_iter_map_value_f(BMOIter *iter);
#define BMO_ITER(ele, iter, bm, op, slotname, restrict) \
ele = BMO_iter_new(iter, bm, op, slotname, restrict); \
- for ( ; ele; ele=BMO_iter_step(iter))
+ for ( ; ele; ele = BMO_iter_step(iter))
/******************* Inlined Functions********************/
typedef void (*opexec)(BMesh *bm, BMOperator *op);
diff --git a/source/blender/bmesh/intern/bmesh_operator_api_inline.c b/source/blender/bmesh/intern/bmesh_operator_api_inline.h
index 88789fc24b0..e04079f42c9 100644
--- a/source/blender/bmesh/intern/bmesh_operator_api_inline.c
+++ b/source/blender/bmesh/intern/bmesh_operator_api_inline.h
@@ -20,17 +20,14 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/bmesh/intern/bmesh_operator_api_inline.c
+/** \file blender/bmesh/intern/bmesh_operator_api_inline.h
* \ingroup bmesh
*
* BMesh inline operator functions.
*/
-#ifndef __BMESH_OPERATOR_API_INLINE_C__
-#define __BMESH_OPERATOR_API_INLINE_C__
-
-#include "bmesh.h"
-
+#ifndef __BMESH_OPERATOR_API_INLINE_H__
+#define __BMESH_OPERATOR_API_INLINE_H__
/* tool flag API. never, ever ever should tool code put junk in
* header flags (element->head.flag), nor should they use
@@ -41,75 +38,80 @@
* ghash or a mapping slot to do it. */
/* flags 15 and 16 (1 << 14 and 1 << 15) are reserved for bmesh api use */
-BM_INLINE short _bmo_elem_flag_test(BMesh *bm, BMFlagLayer *oflags, const short oflag)
+BLI_INLINE short _bmo_elem_flag_test(BMesh *bm, BMFlagLayer *oflags, const short oflag)
+{
+ return oflags[bm->stackdepth - 1].f & oflag;
+}
+
+BLI_INLINE short _bmo_elem_flag_test_bool(BMesh *bm, BMFlagLayer *oflags, const short oflag)
{
- return oflags[bm->stackdepth - 1].f & oflag;
+ return (oflags[bm->stackdepth - 1].f & oflag) != 0;
}
-BM_INLINE void _bmo_elem_flag_enable(BMesh *bm, BMFlagLayer *oflags, const short oflag)
+BLI_INLINE void _bmo_elem_flag_enable(BMesh *bm, BMFlagLayer *oflags, const short oflag)
{
oflags[bm->stackdepth - 1].f |= oflag;
}
-BM_INLINE void _bmo_elem_flag_disable(BMesh *bm, BMFlagLayer *oflags, const short oflag)
+BLI_INLINE void _bmo_elem_flag_disable(BMesh *bm, BMFlagLayer *oflags, const short oflag)
{
oflags[bm->stackdepth - 1].f &= ~oflag;
}
-BM_INLINE void _bmo_elem_flag_set(BMesh *bm, BMFlagLayer *oflags, const short oflag, int val)
+BLI_INLINE void _bmo_elem_flag_set(BMesh *bm, BMFlagLayer *oflags, const short oflag, int val)
{
if (val) oflags[bm->stackdepth - 1].f |= oflag;
else oflags[bm->stackdepth - 1].f &= ~oflag;
}
-BM_INLINE void _bmo_elem_flag_toggle(BMesh *bm, BMFlagLayer *oflags, const short oflag)
+BLI_INLINE void _bmo_elem_flag_toggle(BMesh *bm, BMFlagLayer *oflags, const short oflag)
{
oflags[bm->stackdepth - 1].f ^= oflag;
}
-BM_INLINE void BMO_slot_map_int_insert(BMesh *bm, BMOperator *op, const char *slotname,
- void *element, int val)
+BLI_INLINE void BMO_slot_map_int_insert(BMesh *bm, BMOperator *op, const char *slotname,
+ void *element, int val)
{
BMO_slot_map_insert(bm, op, slotname, element, &val, sizeof(int));
}
-BM_INLINE void BMO_slot_map_float_insert(BMesh *bm, BMOperator *op, const char *slotname,
- void *element, float val)
+BLI_INLINE void BMO_slot_map_float_insert(BMesh *bm, BMOperator *op, const char *slotname,
+ void *element, float val)
{
BMO_slot_map_insert(bm, op, slotname, element, &val, sizeof(float));
}
-/* pointer versoins of BMO_slot_map_float_get and BMO_slot_map_float_insert.
+/* pointer versions of BMO_slot_map_float_get and BMO_slot_map_float_insert.
*
* do NOT use these for non-operator-api-allocated memory! instead
* use BMO_slot_map_data_get and BMO_slot_map_insert, which copies the data. */
-BM_INLINE void BMO_slot_map_ptr_insert(BMesh *bm, BMOperator *op, const char *slotname,
- void *element, void *val)
+BLI_INLINE void BMO_slot_map_ptr_insert(BMesh *bm, BMOperator *op, const char *slotname,
+ void *element, void *val)
{
- BMO_slot_map_insert(bm, op, slotname, element, &val, sizeof(void*));
+ BMO_slot_map_insert(bm, op, slotname, element, &val, sizeof(void *));
}
-BM_INLINE int BMO_slot_map_contains(BMesh *UNUSED(bm), BMOperator *op, const char *slotname, void *element)
+BLI_INLINE int BMO_slot_map_contains(BMesh *UNUSED(bm), BMOperator *op, const char *slotname, void *element)
{
BMOpSlot *slot = BMO_slot_get(op, slotname);
+ BLI_assert(slot->slottype == BMO_OP_SLOT_MAPPING);
- /*sanity check*/
- if (slot->slottype != BMO_OP_SLOT_MAPPING) return 0;
+ /* sanity check */
if (!slot->data.ghash) return 0;
return BLI_ghash_haskey(slot->data.ghash, element);
}
-BM_INLINE void *BMO_slot_map_data_get(BMesh *UNUSED(bm), BMOperator *op, const char *slotname,
- void *element)
+BLI_INLINE void *BMO_slot_map_data_get(BMesh *UNUSED(bm), BMOperator *op, const char *slotname,
+ void *element)
{
BMOElemMapping *mapping;
BMOpSlot *slot = BMO_slot_get(op, slotname);
+ BLI_assert(slot->slottype == BMO_OP_SLOT_MAPPING);
- /*sanity check*/
- if (slot->slottype != BMO_OP_SLOT_MAPPING) return NULL;
+ /* sanity check */
if (!slot->data.ghash) return NULL;
mapping = (BMOElemMapping *)BLI_ghash_lookup(slot->data.ghash, element);
@@ -119,31 +121,31 @@ BM_INLINE void *BMO_slot_map_data_get(BMesh *UNUSED(bm), BMOperator *op, const c
return mapping + 1;
}
-BM_INLINE float BMO_slot_map_float_get(BMesh *bm, BMOperator *op, const char *slotname,
- void *element)
+BLI_INLINE float BMO_slot_map_float_get(BMesh *bm, BMOperator *op, const char *slotname,
+ void *element)
{
- float *val = (float*) BMO_slot_map_data_get(bm, op, slotname, element);
+ float *val = (float *) BMO_slot_map_data_get(bm, op, slotname, element);
if (val) return *val;
return 0.0f;
}
-BM_INLINE int BMO_slot_map_int_get(BMesh *bm, BMOperator *op, const char *slotname,
- void *element)
+BLI_INLINE int BMO_slot_map_int_get(BMesh *bm, BMOperator *op, const char *slotname,
+ void *element)
{
- int *val = (int*) BMO_slot_map_data_get(bm, op, slotname, element);
+ int *val = (int *) BMO_slot_map_data_get(bm, op, slotname, element);
if (val) return *val;
return 0;
}
-BM_INLINE void *BMO_slot_map_ptr_get(BMesh *bm, BMOperator *op, const char *slotname,
- void *element)
+BLI_INLINE void *BMO_slot_map_ptr_get(BMesh *bm, BMOperator *op, const char *slotname,
+ void *element)
{
- void **val = (void**) BMO_slot_map_data_get(bm, op, slotname, element);
+ void **val = (void **) BMO_slot_map_data_get(bm, op, slotname, element);
if (val) return *val;
return NULL;
}
-#endif /* __BMESH_OPERATOR_API_INLINE_C__ */
+#endif /* __BMESH_OPERATOR_API_INLINE_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c
index 9d6d7fce15a..00292e481b2 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);
@@ -55,7 +55,7 @@ static const char *bmo_error_messages[] = {
"Could not traverse mesh",
"Could not dissolve faces",
"Could not dissolve vertices",
- "Tesselation error",
+ "Tessellation error",
"Can not deal with non-manifold geometry",
"Invalid selection",
"Internal mesh error",
@@ -64,16 +64,17 @@ static const char *bmo_error_messages[] = {
/* operator slot type information - size of one element of the type given. */
const int BMO_OPSLOT_TYPEINFO[BMO_OP_SLOT_TOTAL_TYPES] = {
- 0,
- sizeof(int),
- sizeof(int),
- sizeof(float),
- sizeof(void *),
- 0, /* unused */
- 0, /* unused */
- 0, /* unused */
- sizeof(void *), /* pointer buffer */
- sizeof(BMOElemMapping)
+ 0, /* 0: BMO_OP_SLOT_SENTINEL */
+ sizeof(int), /* 1: BMO_OP_SLOT_BOOL */
+ sizeof(int), /* 2: BMO_OP_SLOT_INT */
+ sizeof(float), /* 3: BMO_OP_SLOT_FLT */
+ sizeof(void *), /* 4: BMO_OP_SLOT_PNT */
+ sizeof(void *), /* 5: BMO_OP_SLOT_PNT */
+ 0, /* 6: unused */
+ 0, /* 7: unused */
+ sizeof(float) * 3, /* 8: BMO_OP_SLOT_VEC */
+ sizeof(void *), /* 9: BMO_OP_SLOT_ELEMENT_BUF */
+ sizeof(BMOElemMapping) /* 10: BMO_OP_SLOT_MAPPING */
};
/* Dummy slot so there is something to return when slot name lookup fails */
@@ -153,8 +154,8 @@ void BMO_op_init(BMesh *bm, BMOperator *op, const char *opname)
op->exec = opdefines[opcode]->exec;
/* memarena, used for operator's slot buffers */
- op->arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "bmesh operator");
- BLI_memarena_use_calloc (op->arena);
+ op->arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__);
+ BLI_memarena_use_calloc(op->arena);
}
/**
@@ -248,44 +249,45 @@ void BMO_slot_copy(BMOperator *source_op, BMOperator *dest_op, const char *src,
if (source_slot == dest_slot)
return;
- if (source_slot->slottype != dest_slot->slottype)
+ if (source_slot->slottype != dest_slot->slottype) {
+ /* possibly assert here? */
return;
-
- if (dest_slot->slottype > BMO_OP_SLOT_VEC) {
- if (dest_slot->slottype != BMO_OP_SLOT_MAPPING) {
- /* do buffer copy */
- dest_slot->data.buf = NULL;
- dest_slot->len = source_slot->len;
- if (dest_slot->len) {
- const int slot_alloc_size = BMO_OPSLOT_TYPEINFO[dest_slot->slottype] * dest_slot->len;
- dest_slot->data.buf = BLI_memarena_alloc(dest_op->arena, slot_alloc_size);
- memcpy(dest_slot->data.buf, source_slot->data.buf, slot_alloc_size);
- }
+ }
+
+ if (dest_slot->slottype == BMO_OP_SLOT_ELEMENT_BUF) {
+ /* do buffer copy */
+ dest_slot->data.buf = NULL;
+ dest_slot->len = source_slot->len;
+ if (dest_slot->len) {
+ const int slot_alloc_size = BMO_OPSLOT_TYPEINFO[dest_slot->slottype] * dest_slot->len;
+ dest_slot->data.buf = BLI_memarena_alloc(dest_op->arena, slot_alloc_size);
+ memcpy(dest_slot->data.buf, source_slot->data.buf, slot_alloc_size);
}
- else {
- GHashIterator it;
- BMOElemMapping *srcmap, *dstmap;
+ }
+ else if (dest_slot->slottype == BMO_OP_SLOT_MAPPING) {
+ GHashIterator it;
+ BMOElemMapping *srcmap, *dstmap;
- /* sanity check */
- if (!source_slot->data.ghash) return;
-
- if (!dest_slot->data.ghash) {
- dest_slot->data.ghash = BLI_ghash_new(BLI_ghashutil_ptrhash,
- BLI_ghashutil_ptrcmp, "bmesh operator 2");
- }
+ /* sanity check */
+ if (!source_slot->data.ghash) {
+ return;
+ }
+
+ if (!dest_slot->data.ghash) {
+ dest_slot->data.ghash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh operator 2");
+ }
- BLI_ghashIterator_init(&it, source_slot->data.ghash);
- for ( ; (srcmap = BLI_ghashIterator_getValue(&it));
- BLI_ghashIterator_step(&it))
- {
- dstmap = BLI_memarena_alloc(dest_op->arena, sizeof(*dstmap) + srcmap->len);
+ BLI_ghashIterator_init(&it, source_slot->data.ghash);
+ for ( ; (srcmap = BLI_ghashIterator_getValue(&it));
+ BLI_ghashIterator_step(&it))
+ {
+ dstmap = BLI_memarena_alloc(dest_op->arena, sizeof(*dstmap) + srcmap->len);
- dstmap->element = srcmap->element;
- dstmap->len = srcmap->len;
- memcpy(dstmap + 1, srcmap + 1, srcmap->len);
+ dstmap->element = srcmap->element;
+ dstmap->len = srcmap->len;
+ memcpy(dstmap + 1, srcmap + 1, srcmap->len);
- BLI_ghash_insert(dest_slot->data.ghash, dstmap->element, dstmap);
- }
+ BLI_ghash_insert(dest_slot->data.ghash, dstmap->element, dstmap);
}
}
else {
@@ -448,39 +450,50 @@ void BMO_slot_vec_get(BMOperator *op, const char *slotname, float r_vec[3])
/*
* BMO_COUNTFLAG
*
- * Counts the number of elements of a certain type that
- * have a specific flag set.
+ * Counts the number of elements of a certain type that have a
+ * specific flag enabled (or disabled if test_for_enabled is false).
*
*/
-int BMO_mesh_flag_count(BMesh *bm, const short oflag, const char htype)
+static int bmo_mesh_flag_count(BMesh *bm, const char htype, const short oflag,
+ const short test_for_enabled)
{
- BMIter elements;
+ const char iter_types[3] = {BM_VERTS_OF_MESH,
+ BM_EDGES_OF_MESH,
+ BM_FACES_OF_MESH};
+
+ const char flag_types[3] = {BM_VERT, BM_EDGE, BM_FACE};
+
+ BMIter iter;
int count = 0;
BMElemF *ele_f;
+ int i;
- if (htype & BM_VERT) {
- for (ele_f = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); ele_f; ele_f = BM_iter_step(&elements)) {
- if (BMO_elem_flag_test(bm, ele_f, oflag))
- count++;
- }
- }
- if (htype & BM_EDGE) {
- for (ele_f = BM_iter_new(&elements, bm, BM_EDGES_OF_MESH, bm); ele_f; ele_f = BM_iter_step(&elements)) {
- if (BMO_elem_flag_test(bm, ele_f, oflag))
- count++;
- }
- }
- if (htype & BM_FACE) {
- for (ele_f = BM_iter_new(&elements, bm, BM_FACES_OF_MESH, bm); ele_f; ele_f = BM_iter_step(&elements)) {
- if (BMO_elem_flag_test(bm, ele_f, oflag))
- count++;
+ BLI_assert(ELEM(TRUE, FALSE, test_for_enabled));
+
+ for (i = 0; i < 3; i++) {
+ if (htype & flag_types[i]) {
+ BM_ITER(ele_f, &iter, bm, iter_types[i], NULL) {
+ if (BMO_elem_flag_test_bool(bm, ele_f, oflag) == test_for_enabled)
+ count++;
+ }
}
}
return count;
}
+
+int BMO_mesh_enabled_flag_count(BMesh *bm, const char htype, const short oflag)
+{
+ return bmo_mesh_flag_count(bm, htype, oflag, TRUE);
+}
+
+int BMO_mesh_disabled_flag_count(BMesh *bm, const char htype, const short oflag)
+{
+ return bmo_mesh_flag_count(bm, htype, oflag, FALSE);
+}
+
void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *UNUSED(op), const char htype, const short oflag)
{
const char iter_types[3] = {BM_VERTS_OF_MESH,
@@ -502,13 +515,13 @@ void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *UNUSED(op), const char hty
}
}
-int BMO_slot_buf_count(BMesh *UNUSED(bm), BMOperator *op, const char *slotname)
+int BMO_slot_buffer_count(BMesh *UNUSED(bm), BMOperator *op, const char *slotname)
{
BMOpSlot *slot = BMO_slot_get(op, slotname);
- BLI_assert(slot->slottype > BMO_OP_SLOT_VEC);
+ BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF);
/* check if its actually a buffer */
- if (!(slot->slottype > BMO_OP_SLOT_VEC))
+ if (slot->slottype != BMO_OP_SLOT_ELEMENT_BUF)
return 0;
return slot->len;
@@ -534,11 +547,7 @@ void BMO_slot_map_insert(BMesh *UNUSED(bm), BMOperator *op, const char *slotname
{
BMOElemMapping *mapping;
BMOpSlot *slot = BMO_slot_get(op, slotname);
-
- /*sanity check*/
- if (slot->slottype != BMO_OP_SLOT_MAPPING) {
- return;
- }
+ BLI_assert(slot->slottype == BMO_OP_SLOT_MAPPING);
mapping = (BMOElemMapping *) BLI_memarena_alloc(op->arena, sizeof(*mapping) + len);
@@ -547,22 +556,23 @@ void BMO_slot_map_insert(BMesh *UNUSED(bm), BMOperator *op, const char *slotname
memcpy(mapping + 1, data, len);
if (!slot->data.ghash) {
- slot->data.ghash = BLI_ghash_new(BLI_ghashutil_ptrhash,
- BLI_ghashutil_ptrcmp, "bmesh op");
+ slot->data.ghash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh slot map hash");
}
BLI_ghash_insert(slot->data.ghash, element, mapping);
}
#if 0
-void *BMO_Grow_Array(BMesh *bm, BMOperator *op, int slotcode, int totadd)
+void *bmo_slot_buffer_grow(BMesh *bm, BMOperator *op, int slotcode, int totadd)
{
BMOpSlot *slot = &op->slots[slotcode];
void *tmp;
ssize_t allocsize;
+ BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF);
+
/* check if its actually a buffer */
- if (!(slot->slottype > BMO_OP_SLOT_VEC))
+ if (slot->slottype != BMO_OP_SLOT_ELEMENT_BUF)
return NULL;
if (slot->flag & BMOS_DYNAMIC_ARRAY) {
@@ -595,8 +605,8 @@ void *BMO_Grow_Array(BMesh *bm, BMOperator *op, int slotcode, int totadd)
}
#endif
-void BMO_slot_map_to_flag(BMesh *bm, BMOperator *op,
- const char *slotname, const short oflag)
+void BMO_slot_map_to_flag(BMesh *bm, BMOperator *op, const char *slotname,
+ const char htype, const short oflag)
{
GHashIterator it;
BMOpSlot *slot = BMO_slot_get(op, slotname);
@@ -605,23 +615,23 @@ void BMO_slot_map_to_flag(BMesh *bm, BMOperator *op,
BLI_assert(slot->slottype == BMO_OP_SLOT_MAPPING);
/* sanity check */
- if (slot->slottype != BMO_OP_SLOT_MAPPING) return;
if (!slot->data.ghash) return;
BLI_ghashIterator_init(&it, slot->data.ghash);
for ( ; (ele_f = BLI_ghashIterator_getKey(&it)); BLI_ghashIterator_step(&it)) {
- BMO_elem_flag_enable(bm, ele_f, oflag);
+ if (ele_f->head.htype & htype) {
+ BMO_elem_flag_enable(bm, ele_f, oflag);
+ }
}
}
static void *bmo_slot_buffer_alloc(BMOperator *op, const char *slotname, int len)
{
BMOpSlot *slot = BMO_slot_get(op, slotname);
-
- BLI_assert(slot->slottype > BMO_OP_SLOT_VEC);
+ BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF);
/* check if its actually a buffer */
- if (!(slot->slottype > BMO_OP_SLOT_VEC))
+ if (slot->slottype != BMO_OP_SLOT_ELEMENT_BUF)
return NULL;
slot->len = len;
@@ -635,10 +645,8 @@ static void *bmo_slot_buffer_alloc(BMOperator *op, const char *slotname, int len
*
* Copies all elements of a certain type into an operator slot.
*/
-static void BMO_slot_from_all(BMesh *bm, BMOperator *op, const char *slotname, const char htype)
+static void BMO_slot_buffer_from_all(BMesh *bm, BMOperator *op, const char *slotname, const char htype)
{
- BMIter elements;
- BMHeader *e;
BMOpSlot *output = BMO_slot_get(op, slotname);
int totelement = 0, i = 0;
@@ -647,25 +655,30 @@ static void BMO_slot_from_all(BMesh *bm, BMOperator *op, const char *slotname, c
if (htype & BM_FACE) totelement += bm->totface;
if (totelement) {
+ BMIter iter;
+ BMHeader *ele;
+
bmo_slot_buffer_alloc(op, slotname, totelement);
+ /* TODO - collapse these loops into one */
+
if (htype & BM_VERT) {
- for (e = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); e; e = BM_iter_step(&elements)) {
- ((BMHeader **)output->data.p)[i] = e;
+ BM_ITER(ele, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ ((BMHeader **)output->data.p)[i] = ele;
i++;
}
}
if (htype & BM_EDGE) {
- for (e = BM_iter_new(&elements, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&elements)) {
- ((BMHeader **)output->data.p)[i] = e;
+ BM_ITER(ele, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ ((BMHeader **)output->data.p)[i] = ele;
i++;
}
}
if (htype & BM_FACE) {
- for (e = BM_iter_new(&elements, bm, BM_FACES_OF_MESH, bm); e; e = BM_iter_step(&elements)) {
- ((BMHeader **)output->data.p)[i] = e;
+ BM_ITER(ele, &iter, bm, BM_FACES_OF_MESH, NULL) {
+ ((BMHeader **)output->data.p)[i] = ele;
i++;
}
}
@@ -675,25 +688,36 @@ static void BMO_slot_from_all(BMesh *bm, BMOperator *op, const char *slotname, c
/**
* \brief BMO_HEADERFLAG_TO_SLOT
*
- * Copies elements of a certain type, which have a certain header flag set
- * into a slot for an operator.
+ * Copies elements of a certain type, which have a certain header flag
+ * enabled/disabled into a slot for an operator.
*/
-void BMO_slot_from_hflag(BMesh *bm, BMOperator *op, const char *slotname,
- const char hflag, const char htype)
+static void bmo_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, const char *slotname,
+ const char htype, const char hflag,
+ const short test_for_enabled)
{
- BMIter elements;
- BMElem *ele;
BMOpSlot *output = BMO_slot_get(op, slotname);
int totelement = 0, i = 0;
-
- totelement = BM_mesh_count_flag(bm, htype, hflag, 1);
+
+ BLI_assert(ELEM(TRUE, FALSE, test_for_enabled));
+
+ if (test_for_enabled)
+ totelement = BM_mesh_enabled_flag_count(bm, htype, hflag, TRUE);
+ else
+ totelement = BM_mesh_disabled_flag_count(bm, htype, hflag, TRUE);
if (totelement) {
+ BMIter iter;
+ BMElem *ele;
+
bmo_slot_buffer_alloc(op, slotname, totelement);
+ /* TODO - collapse these loops into one */
+
if (htype & BM_VERT) {
- for (ele = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) {
- if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && BM_elem_flag_test(ele, hflag)) {
+ BM_ITER(ele, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) &&
+ BM_elem_flag_test_bool(ele, hflag) == test_for_enabled)
+ {
((BMElem **)output->data.p)[i] = ele;
i++;
}
@@ -701,8 +725,10 @@ void BMO_slot_from_hflag(BMesh *bm, BMOperator *op, const char *slotname,
}
if (htype & BM_EDGE) {
- for (ele = BM_iter_new(&elements, bm, BM_EDGES_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) {
- if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && BM_elem_flag_test(ele, hflag)) {
+ BM_ITER(ele, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) &&
+ BM_elem_flag_test_bool(ele, hflag) == test_for_enabled)
+ {
((BMElem **)output->data.p)[i] = ele;
i++;
}
@@ -710,8 +736,10 @@ void BMO_slot_from_hflag(BMesh *bm, BMOperator *op, const char *slotname,
}
if (htype & BM_FACE) {
- for (ele = BM_iter_new(&elements, bm, BM_FACES_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) {
- if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && BM_elem_flag_test(ele, hflag)) {
+ BM_ITER(ele, &iter, bm, BM_FACES_OF_MESH, NULL) {
+ if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) &&
+ BM_elem_flag_test_bool(ele, hflag) == test_for_enabled)
+ {
((BMElem **)output->data.p)[i] = ele;
i++;
}
@@ -723,57 +751,126 @@ void BMO_slot_from_hflag(BMesh *bm, BMOperator *op, const char *slotname,
}
}
+void BMO_slot_buffer_from_enabled_hflag(BMesh *bm, BMOperator *op, const char *slotname,
+ const char htype, const char hflag)
+{
+ bmo_slot_buffer_from_hflag(bm, op, slotname, htype, hflag, TRUE);
+}
+
+void BMO_slot_buffer_from_disabled_hflag(BMesh *bm, BMOperator *op, const char *slotname,
+ const char htype, const char hflag)
+{
+ bmo_slot_buffer_from_hflag(bm, op, slotname, htype, hflag, FALSE);
+}
+
+/**
+ * Copies the values from another slot to the end of the output slot.
+ */
+void BMO_slot_buffer_append(BMOperator *output_op, const char *output_slot_name,
+ BMOperator *other_op, const char *other_slot_name)
+{
+ BMOpSlot *output_slot = BMO_slot_get(output_op, output_slot_name);
+ BMOpSlot *other_slot = BMO_slot_get(other_op, other_slot_name);
+
+ BLI_assert(output_slot->slottype == BMO_OP_SLOT_ELEMENT_BUF &&
+ other_slot->slottype == BMO_OP_SLOT_ELEMENT_BUF);
+
+ if (output_slot->len == 0) {
+ /* output slot is empty, copy rather than append */
+ BMO_slot_copy(other_op, output_op, other_slot_name, output_slot_name);
+ }
+ else if (other_slot->len != 0) {
+ int elem_size = BMO_OPSLOT_TYPEINFO[output_slot->slottype];
+ int alloc_size = elem_size * (output_slot->len + other_slot->len);
+ /* allocate new buffer */
+ void *buf = BLI_memarena_alloc(output_op->arena, alloc_size);
+
+ /* copy slot data */
+ memcpy(buf, output_slot->data.buf, elem_size * output_slot->len);
+ memcpy(((char *)buf) + elem_size * output_slot->len, other_slot->data.buf, elem_size * other_slot->len);
+
+ output_slot->data.buf = buf;
+ output_slot->len += other_slot->len;
+ }
+}
+
/**
* \brief BMO_FLAG_TO_SLOT
*
* Copies elements of a certain type, which have a certain flag set
* into an output slot for an operator.
*/
-void BMO_slot_from_flag(BMesh *bm, BMOperator *op, const char *slotname,
- const short oflag, const char htype)
+static void bmo_slot_buffer_from_flag(BMesh *bm, BMOperator *op, const char *slotname,
+ const char htype, const short oflag,
+ const short test_for_enabled)
{
- BMIter elements;
- BMHeader *ele;
- BMOpSlot *output = BMO_slot_get(op, slotname);
- int totelement = BMO_mesh_flag_count(bm, oflag, htype), i = 0;
+ BMOpSlot *slot = BMO_slot_get(op, slotname);
+ int totelement, i = 0;
- BLI_assert(output->slottype > BMO_OP_SLOT_VEC);
+ BLI_assert(ELEM(TRUE, FALSE, test_for_enabled));
+
+ if (test_for_enabled)
+ totelement = BMO_mesh_enabled_flag_count(bm, htype, oflag);
+ else
+ totelement = BMO_mesh_disabled_flag_count(bm, htype, oflag);
+
+ BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF);
if (totelement) {
+ BMIter iter;
+ BMHeader *ele;
+ BMHeader **ele_array;
+
bmo_slot_buffer_alloc(op, slotname, totelement);
+ ele_array = (BMHeader **)slot->data.p;
+
+ /* TODO - collapse these loops into one */
+
if (htype & BM_VERT) {
- for (ele = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) {
- if (BMO_elem_flag_test(bm, (BMElemF *)ele, oflag)) {
- ((BMHeader **)output->data.p)[i] = ele;
+ BM_ITER(ele, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ if (BMO_elem_flag_test_bool(bm, (BMElemF *)ele, oflag) == test_for_enabled) {
+ ele_array[i] = ele;
i++;
}
}
}
if (htype & BM_EDGE) {
- for (ele = BM_iter_new(&elements, bm, BM_EDGES_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) {
- if (BMO_elem_flag_test(bm, (BMElemF *)ele, oflag)) {
- ((BMHeader **)output->data.p)[i] = ele;
+ BM_ITER(ele, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ if (BMO_elem_flag_test_bool(bm, (BMElemF *)ele, oflag) == test_for_enabled) {
+ ele_array[i] = ele;
i++;
}
}
}
if (htype & BM_FACE) {
- for (ele = BM_iter_new(&elements, bm, BM_FACES_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) {
- if (BMO_elem_flag_test(bm, (BMElemF *)ele, oflag)) {
- ((BMHeader **)output->data.p)[i] = ele;
+ BM_ITER(ele, &iter, bm, BM_FACES_OF_MESH, NULL) {
+ if (BMO_elem_flag_test_bool(bm, (BMElemF *)ele, oflag) == test_for_enabled) {
+ ele_array[i] = ele;
i++;
}
}
}
}
else {
- output->len = 0;
+ slot->len = 0;
}
}
+void BMO_slot_buffer_from_enabled_flag(BMesh *bm, BMOperator *op, const char *slotname,
+ const char htype, const short oflag)
+{
+ bmo_slot_buffer_from_flag(bm, op, slotname, htype, oflag, TRUE);
+}
+
+void BMO_slot_buffer_from_disabled_flag(BMesh *bm, BMOperator *op, const char *slotname,
+ const char htype, const short oflag)
+{
+ bmo_slot_buffer_from_flag(bm, op, slotname, htype, oflag, FALSE);
+}
+
/**
* \brief BMO_FLAG_BUFFER
*
@@ -781,26 +878,29 @@ void BMO_slot_from_flag(BMesh *bm, BMOperator *op, const char *slotname,
* using the selection API where appropriate.
*/
void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOperator *op, const char *slotname,
- const char hflag, const char htype, char do_flush_select)
+ const char htype, const char hflag, const char do_flush)
{
BMOpSlot *slot = BMO_slot_get(op, slotname);
BMElem **data = slot->data.p;
int i;
+ const char do_flush_select = (do_flush && (hflag & BM_ELEM_SELECT));
+ const char do_flush_hide = (do_flush && (hflag & BM_ELEM_HIDDEN));
- BLI_assert(slot->slottype > BMO_OP_SLOT_VEC);
+ BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF);
- if (!(hflag & BM_ELEM_SELECT)) {
- do_flush_select = FALSE;
- }
-
- for (i = 0; i < slot->len; i++) {
- if (!(htype & data[i]->head.htype))
+ for (i = 0; i < slot->len; i++, data++) {
+ if (!(htype & (*data)->head.htype))
continue;
if (do_flush_select) {
- BM_elem_select_set(bm, data[i], TRUE);
+ BM_elem_select_set(bm, *data, TRUE);
+ }
+
+ if (do_flush_hide) {
+ BM_elem_hide_set(bm, *data, FALSE);
}
- BM_elem_flag_enable(data[i], hflag);
+
+ BM_elem_flag_enable(*data, hflag);
}
}
@@ -811,29 +911,32 @@ void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOperator *op, const char *slotnam
* using the selection API where appropriate.
*/
void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOperator *op, const char *slotname,
- const char hflag, const char htype, char do_flush_select)
+ const char htype, const char hflag, const char do_flush)
{
BMOpSlot *slot = BMO_slot_get(op, slotname);
BMElem **data = slot->data.p;
int i;
+ const char do_flush_select = (do_flush && (hflag & BM_ELEM_SELECT));
+ const char do_flush_hide = (do_flush && (hflag & BM_ELEM_HIDDEN));
- BLI_assert(slot->slottype > BMO_OP_SLOT_VEC);
-
- if (!(hflag & BM_ELEM_SELECT)) {
- do_flush_select = FALSE;
- }
+ BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF);
- for (i = 0; i < slot->len; i++) {
- if (!(htype & data[i]->head.htype))
+ for (i = 0; i < slot->len; i++, data++) {
+ if (!(htype & (*data)->head.htype))
continue;
if (do_flush_select) {
- BM_elem_select_set(bm, data[i], FALSE);
+ BM_elem_select_set(bm, *data, FALSE);
+ }
+
+ if (do_flush_hide) {
+ BM_elem_hide_set(bm, *data, FALSE);
}
- BM_elem_flag_disable(data[i], hflag);
+ BM_elem_flag_disable(*data, hflag);
}
}
+
int BMO_vert_edge_flags_count(BMesh *bm, BMVert *v, const short oflag)
{
int count = 0;
@@ -859,13 +962,13 @@ int BMO_vert_edge_flags_count(BMesh *bm, BMVert *v, const short oflag)
* Flags elements in a slots buffer
*/
void BMO_slot_buffer_flag_enable(BMesh *bm, BMOperator *op, const char *slotname,
- const short oflag, const char htype)
+ const char htype, const short oflag)
{
BMOpSlot *slot = BMO_slot_get(op, slotname);
BMHeader **data = slot->data.p;
int i;
- BLI_assert(slot->slottype > BMO_OP_SLOT_VEC);
+ BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF);
for (i = 0; i < slot->len; i++) {
if (!(htype & data[i]->htype))
@@ -881,12 +984,14 @@ void BMO_slot_buffer_flag_enable(BMesh *bm, BMOperator *op, const char *slotname
* Removes flags from elements in a slots buffer
*/
void BMO_slot_buffer_flag_disable(BMesh *bm, BMOperator *op, const char *slotname,
- const short oflag, const char htype)
+ const char htype, const short oflag)
{
BMOpSlot *slot = BMO_slot_get(op, slotname);
BMHeader **data = slot->data.p;
int i;
-
+
+ BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF);
+
for (i = 0; i < slot->len; i++) {
if (!(htype & data[i]->htype))
continue;
@@ -927,22 +1032,22 @@ static void bmo_flag_layer_alloc(BMesh *bm)
bm->totflags++;
/* allocate new flag poo */
- bm->toolflagpool = newpool = BLI_mempool_create(sizeof(BMFlagLayer) * bm->totflags, 512, 512, FALSE, FALSE);
+ bm->toolflagpool = newpool = BLI_mempool_create(sizeof(BMFlagLayer) * bm->totflags, 512, 512, 0);
/* now go through and memcpy all the flags. Loops don't get a flag layer at this time.. */
- for (ele = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, bm), i = 0; ele; ele = BM_iter_step(&iter), i++) {
+ BM_ITER_INDEX(ele, &iter, bm, BM_VERTS_OF_MESH, NULL, i) {
oldflags = ele->oflags;
ele->oflags = BLI_mempool_calloc(newpool);
memcpy(ele->oflags, oldflags, old_totflags_size);
BM_elem_index_set(ele, i); /* set_inline */
}
- for (ele = BM_iter_new(&iter, bm, BM_EDGES_OF_MESH, bm), i = 0; ele; ele = BM_iter_step(&iter), i++) {
+ BM_ITER_INDEX(ele, &iter, bm, BM_EDGES_OF_MESH, NULL, i) {
oldflags = ele->oflags;
ele->oflags = BLI_mempool_calloc(newpool);
memcpy(ele->oflags, oldflags, old_totflags_size);
BM_elem_index_set(ele, i); /* set_inline */
}
- for (ele = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, bm), i = 0; ele; ele = BM_iter_step(&iter), i++) {
+ BM_ITER_INDEX(ele, &iter, bm, BM_FACES_OF_MESH, NULL, i) {
oldflags = ele->oflags;
ele->oflags = BLI_mempool_calloc(newpool);
memcpy(ele->oflags, oldflags, old_totflags_size);
@@ -972,22 +1077,22 @@ static void bmo_flag_layer_free(BMesh *bm)
/* de-increment the totflags first.. */
bm->totflags--;
/* allocate new flag poo */
- bm->toolflagpool = newpool = BLI_mempool_create(new_totflags_size, 512, 512, TRUE, FALSE);
+ bm->toolflagpool = newpool = BLI_mempool_create(new_totflags_size, 512, 512, BLI_MEMPOOL_SYSMALLOC);
/* now go through and memcpy all the flag */
- for (ele = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, bm), i = 0; ele; ele = BM_iter_step(&iter), i++) {
+ BM_ITER_INDEX(ele, &iter, bm, BM_VERTS_OF_MESH, NULL, i) {
oldflags = ele->oflags;
ele->oflags = BLI_mempool_calloc(newpool);
memcpy(ele->oflags, oldflags, new_totflags_size);
BM_elem_index_set(ele, i); /* set_inline */
}
- for (ele = BM_iter_new(&iter, bm, BM_EDGES_OF_MESH, bm), i = 0; ele; ele = BM_iter_step(&iter), i++) {
+ BM_ITER_INDEX(ele, &iter, bm, BM_EDGES_OF_MESH, NULL, i) {
oldflags = ele->oflags;
ele->oflags = BLI_mempool_calloc(newpool);
memcpy(ele->oflags, oldflags, new_totflags_size);
BM_elem_index_set(ele, i); /* set_inline */
}
- for (ele = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, bm), i = 0; ele; ele = BM_iter_step(&iter), i++) {
+ BM_ITER_INDEX(ele, &iter, bm, BM_FACES_OF_MESH, NULL, i) {
oldflags = ele->oflags;
ele->oflags = BLI_mempool_calloc(newpool);
memcpy(ele->oflags, oldflags, new_totflags_size);
@@ -1010,15 +1115,15 @@ static void bmo_flag_layer_clear(BMesh *bm)
const int totflags_offset = bm->totflags - 1;
/* now go through and memcpy all the flag */
- for (ele = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, bm), i = 0; ele; ele = BM_iter_step(&iter), i++) {
+ BM_ITER_INDEX(ele, &iter, bm, BM_VERTS_OF_MESH, NULL, i) {
memset(ele->oflags + totflags_offset, 0, sizeof(BMFlagLayer));
BM_elem_index_set(ele, i); /* set_inline */
}
- for (ele = BM_iter_new(&iter, bm, BM_EDGES_OF_MESH, bm), i = 0; ele; ele = BM_iter_step(&iter), i++) {
+ BM_ITER_INDEX(ele, &iter, bm, BM_EDGES_OF_MESH, NULL, i) {
memset(ele->oflags + totflags_offset, 0, sizeof(BMFlagLayer));
BM_elem_index_set(ele, i); /* set_inline */
}
- for (ele = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, bm), i = 0; ele; ele = BM_iter_step(&iter), i++) {
+ BM_ITER_INDEX(ele, &iter, bm, BM_FACES_OF_MESH, NULL, i) {
memset(ele->oflags + totflags_offset, 0, sizeof(BMFlagLayer));
BM_elem_index_set(ele, i); /* set_inline */
}
@@ -1026,7 +1131,7 @@ static void bmo_flag_layer_clear(BMesh *bm)
bm->elem_index_dirty &= ~(BM_VERT|BM_EDGE|BM_FACE);
}
-void *BMO_slot_elem_first(BMOperator *op, const char *slotname)
+void *BMO_slot_buffer_elem_first(BMOperator *op, const char *slotname)
{
BMOpSlot *slot = BMO_slot_get(op, slotname);
@@ -1036,6 +1141,12 @@ void *BMO_slot_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)
{
@@ -1227,20 +1338,27 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
BMOpDefine *def;
char *opname, *ofmt, *fmt;
char slotname[64] = {0};
- int i /*, n = strlen(fmt) */, stop /*, slotcode = -1 */, ret, type, state;
+ int i /*, n = strlen(fmt) */, stop /*, slotcode = -1 */, type, state;
+ char htype;
int noslot = 0;
/* basic useful info to help find where bmop formatting strings fail */
+ const char *err_reason = "Unknown";
int lineno = -1;
-# define GOTO_ERROR { lineno = __LINE__; goto error; }
+#define GOTO_ERROR(reason) \
+ { \
+ err_reason = reason; \
+ lineno = __LINE__; \
+ goto error; \
+ } (void)0
/* we muck around in here, so dup i */
fmt = ofmt = BLI_strdup(_fmt);
- /* find operator nam */
- i = strcspn(fmt, " \t");
+ /* find operator name */
+ i = strcspn(fmt, " ");
opname = fmt;
if (!opname[i]) noslot = 1;
@@ -1264,22 +1382,24 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
while (*fmt) {
if (state) {
/* jump past leading whitespac */
- i = strspn(fmt, " \t");
+ i = strspn(fmt, " ");
fmt += i;
/* ignore trailing whitespac */
if (!fmt[i])
break;
- /* find end of slot name. currently this is
- * a little flexible, allowing "slot=%f",
- * "slot %f", "slot%f", and "slot\t%f". */
- i = strcspn(fmt, "= \t%");
- if (!fmt[i]) GOTO_ERROR;
+ /* find end of slot name, only "slot=%f", can be used */
+ i = strcspn(fmt, "=");
+ if (!fmt[i]) {
+ GOTO_ERROR("could not match end of slot name");
+ }
fmt[i] = 0;
- if (bmo_name_to_slotcode_check(def, fmt) < 0) GOTO_ERROR;
+ if (bmo_name_to_slotcode_check(def, fmt) < 0) {
+ GOTO_ERROR("name to slot code check failed");
+ }
BLI_strncpy(slotname, fmt, sizeof(slotname));
@@ -1289,7 +1409,6 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
else {
switch (*fmt) {
case ' ':
- case '\t':
case '=':
case '%':
break;
@@ -1299,9 +1418,9 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
c = NEXT_CHAR(fmt);
fmt++;
- if (c == '3') size = 3;
+ if (c == '3') size = 3;
else if (c == '4') size = 4;
- else GOTO_ERROR;
+ else GOTO_ERROR("matrix size was not 3 or 4");
BMO_slot_mat_set(op, slotname, va_arg(vlist, void *), size);
state = 1;
@@ -1344,21 +1463,23 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
state = 1;
break;
case 'f':
+ case 'F':
case 'h':
+ case 'H':
case 'a':
type = *fmt;
- if (NEXT_CHAR(fmt) == ' ' || NEXT_CHAR(fmt) == '\t' || NEXT_CHAR(fmt) == '\0') {
+ if (NEXT_CHAR(fmt) == ' ' || NEXT_CHAR(fmt) == '\0') {
BMO_slot_float_set(op, slotname, va_arg(vlist, double));
}
else {
- ret = 0;
+ htype = 0;
stop = 0;
while (1) {
switch (NEXT_CHAR(fmt)) {
- case 'f': ret |= BM_FACE; break;
- case 'e': ret |= BM_EDGE; break;
- case 'v': ret |= BM_VERT; break;
+ case 'f': htype |= BM_FACE; break;
+ case 'e': htype |= BM_EDGE; break;
+ case 'v': htype |= BM_VERT; break;
default:
stop = 1;
break;
@@ -1371,13 +1492,19 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
}
if (type == 'h') {
- BMO_slot_from_hflag(bm, op, slotname, va_arg(vlist, int), ret);
+ BMO_slot_buffer_from_enabled_hflag(bm, op, slotname, htype, va_arg(vlist, int));
+ }
+ else if (type == 'H') {
+ BMO_slot_buffer_from_disabled_hflag(bm, op, slotname, htype, va_arg(vlist, int));
}
else if (type == 'a') {
- BMO_slot_from_all(bm, op, slotname, ret);
+ BMO_slot_buffer_from_all(bm, op, slotname, htype);
+ }
+ else if (type == 'f') {
+ BMO_slot_buffer_from_enabled_flag(bm, op, slotname, htype, va_arg(vlist, int));
}
- else {
- BMO_slot_from_flag(bm, op, slotname, va_arg(vlist, int), ret);
+ else if (type == 'F') {
+ BMO_slot_buffer_from_disabled_flag(bm, op, slotname, htype, va_arg(vlist, int));
}
}
@@ -1398,9 +1525,24 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
error:
/* non urgent todo - explain exactly what is failing */
- fprintf(stderr,
- "%s: error parsing formatting string, %d in '%s'\n see - %s:%d\n",
- __func__, (int)(fmt - ofmt), _fmt, __FILE__, lineno);
+ fprintf(stderr, "%s: error parsing formatting string\n", __func__);
+
+ fprintf(stderr, "string: '%s', position %d\n", _fmt, (int)(fmt - ofmt));
+ fprintf(stderr, " ");
+ {
+ int pos = (int)(fmt - ofmt);
+ int i;
+ for (i = 0; i < pos; i++) {
+ fprintf(stderr, " ");
+ }
+ fprintf(stderr, "^\n");
+ }
+
+ fprintf(stderr, "source code: %s:%d\n", __FILE__, lineno);
+
+ fprintf(stderr, "reason: %s\n", err_reason);
+
+
MEM_freeN(ofmt);
BMO_op_finish(bm, op);
diff --git a/source/blender/bmesh/intern/bmesh_operators.h b/source/blender/bmesh/intern/bmesh_operators.h
index 52525dab51b..af62e4d2b29 100644
--- a/source/blender/bmesh/intern/bmesh_operators.h
+++ b/source/blender/bmesh/intern/bmesh_operators.h
@@ -94,4 +94,6 @@ void BM_mesh_esubdivideflag(struct Object *obedit, BMesh *bm, int flag, float sm
float fractal, int beauty, int numcuts, int seltype,
int cornertype, int singleedge, int gridfill, int seed);
+#include "intern/bmesh_operator_api_inline.h"
+
#endif /* __BMESH_OPERATORS_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_operators_private.h b/source/blender/bmesh/intern/bmesh_operators_private.h
index 53df0902d59..0e228148918 100644
--- a/source/blender/bmesh/intern/bmesh_operators_private.h
+++ b/source/blender/bmesh/intern/bmesh_operators_private.h
@@ -98,5 +98,6 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op);
void bmo_create_circle_exec(BMesh *bm, BMOperator *op);
void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op);
void bmo_solidify_face_region_exec(BMesh *bm, BMOperator *op);
+void bmo_inset_exec(BMesh *bm, BMOperator *op);
#endif /* __BMESH_OPERATORS_PRIVATE_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c
index 9515089a4a6..df4c3fd5d33 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.c
+++ b/source/blender/bmesh/intern/bmesh_polygon.c
@@ -25,10 +25,10 @@
*
* This file contains code for dealing
* with polygons (normal/area calculation,
- * tesselation, etc)
+ * 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])
@@ -75,119 +75,85 @@ static short testedgesidef(const float v1[2], const float v2[2], const float v3[
* polygon See Graphics Gems for
* computing newell normal.
*/
-static void compute_poly_normal(float normal[3], float (*verts)[3], int nverts)
+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 */;
-
- /* this fixes some weird numerical erro */
- add_v3_fl(verts[0], 0.0001f);
-
- 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);
-
- l = dot_v3v3(v1, v2);
- if (fabsf(l - 1.0) < 0.1f) {
- continue;
- }
-#endif
- /* 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])
- */
-
- 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]);
+ /* 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]);
}
- if (normalize_v3_v3(normal, n) == 0.0f) {
+ if (UNLIKELY(normalize_v3_v3(normal, n) == 0.0f)) {
normal[2] = 1.0f; /* other axis set to 0.0 */
}
+}
-#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;
- */
+/**
+ * \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};
- if (l == 0.0) {
- normal[0] = 0.0f;
- normal[1] = 0.0f;
- normal[2] = 1.0f;
+ /* 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]);
- return;
- }
- else {
- l = 1.0f / l;
- }
+ l_iter = l_iter->next;
+ v_prev = v_curr;
+ v_curr = l_iter->v->co;
- mul_v3_fl(n, l);
+ } while (l_iter != l_first);
- copy_v3_v3(normal, n);
-#endif
+ if (UNLIKELY(normalize_v3_v3(f->no, n) == 0.0f)) {
+ f->no[2] = 1.0f; /* other axis set to 0.0 */
+ }
}
/**
- * \brief COMPUTE POLY CENTER
+ * \brief COMPUTE POLY NORMAL (BMFace)
*
- * Computes the centroid and
- * area of a polygon in the X/Y
- * plane.
+ * Same as #compute_poly_normal and #bm_face_compute_poly_normal
+ * but takes an array of vertex locations.
*/
-static int compute_poly_center(float center[3], float *r_area, float (*verts)[3], int nverts)
+static void bm_face_compute_poly_normal_vertex_cos(BMFace *f, float n[3],
+ float const (*vertexCos)[3])
{
- int i, j;
- float atmp = 0.0f, xtmp = 0.0f, ytmp = 0.0f, ai;
+ 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)];
- zero_v3(center);
+ zero_v3(n);
- if (nverts < 3)
- return FALSE;
+ /* 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]);
- i = nverts - 1;
- j = 0;
-
- while (j < nverts) {
- ai = verts[i][0] * verts[j][1] - verts[j][0] * verts[i][1];
- atmp += ai;
- xtmp += (verts[j][0] + verts[i][0]) * ai;
- ytmp += (verts[j][1] + verts[i][1]) * ai;
- i = j;
- j += 1;
- }
+ l_iter = l_iter->next;
+ v_prev = v_curr;
+ v_curr = vertexCos[BM_elem_index_get(l_iter->v)];
+ } while (l_iter != l_first);
- if (r_area)
- *r_area = atmp / 2.0f;
-
- if (atmp != 0) {
- center[0] = xtmp / (3.0f * atmp);
- center[1] = xtmp / (3.0f * atmp);
- return TRUE;
+ if (UNLIKELY(normalize_v3(n) == 0.0f)) {
+ n[2] = 1.0f; /* other axis set to 0.0 */
}
- return FALSE;
}
/**
@@ -198,19 +164,26 @@ float BM_face_area_calc(BMesh *bm, BMFace *f)
BMLoop *l;
BMIter iter;
float (*verts)[3];
- float center[3];
- float area = 0.0f;
+ float normal[3];
+ float area;
int i;
BLI_array_fixedstack_declare(verts, BM_NGON_STACK_SIZE, f->len, __func__);
- i = 0;
- BM_ITER(l, &iter, bm, BM_LOOPS_OF_FACE, f) {
+ BM_ITER_INDEX(l, &iter, bm, BM_LOOPS_OF_FACE, f, i) {
copy_v3_v3(verts[i], l->v->co);
- i++;
}
- compute_poly_center(center, &area, verts, f->len);
+ if (f->len == 3) {
+ area = area_tri_v3(verts[0], verts[1], verts[2]);
+ }
+ else if (f->len == 4) {
+ area = area_quad_v3(verts[0], verts[1], verts[2], verts[3]);
+ }
+ else {
+ compute_poly_normal(normal, verts, f->len);
+ area = area_poly_v3(f->len, verts, normal);
+ }
BLI_array_fixedstack_free(verts);
@@ -220,39 +193,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 +264,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);
}
@@ -353,46 +321,11 @@ void poly_rotate_plane(const float normal[3], float (*verts)[3], const int nvert
axis_angle_to_quat(q, axis, (float)angle);
quat_to_mat3(mat, q);
- for (i = 0; i < nverts; i++)
+ for (i = 0; i < nverts; i++)
mul_m3_v3(mat, verts[i]);
}
/**
- * \brief BMESH UPDATE FACE NORMAL
- *
- * Updates the stored normal for the
- * given face. Requires that a buffer
- * of sufficient length to store projected
- * coordinates for all of the face's vertices
- * is passed in as well.
- */
-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);
- }
-}
-/* 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);
- }
-}
-
-/**
* updates face and vertex normals incident on an edge
*/
void BM_edge_normals_update(BMesh *bm, BMEdge *e)
@@ -401,7 +334,7 @@ void BM_edge_normals_update(BMesh *bm, BMEdge *e)
BMFace *f;
f = BM_iter_new(&iter, bm, BM_FACES_OF_EDGE, e);
- for ( ; f; f = BM_iter_step(&iter)) {
+ for (; f; f = BM_iter_step(&iter)) {
BM_face_normal_update(bm, f);
}
@@ -454,8 +387,17 @@ 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])
+/**
+ * \brief BMESH UPDATE FACE NORMAL
+ *
+ * Updates the stored normal for the
+ * given face. Requires that a buffer
+ * of sufficient length to store projected
+ * coordinates for all of the face's vertices
+ * is passed in as well.
+ */
+
+void BM_face_normal_update(BMesh *UNUSED(bm), BMFace *f)
{
BMLoop *l;
@@ -463,42 +405,38 @@ 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(f->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(f->no, co1, co2, co3);
break;
}
case 0:
{
- zero_v3(no);
+ zero_v3(f->no);
break;
}
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])
+void BM_face_normal_update_vcos(BMesh *bm, BMFace *f, float no[3],
+ float const (*vertexCos)[3])
{
BMLoop *l;
@@ -509,26 +447,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 +471,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_vertex_cos(f, no, vertexCos);
break;
}
}
@@ -566,6 +493,21 @@ void BM_face_normal_flip(BMesh *bm, BMFace *f)
* note, there could be more winding cases then there needs to be. */
static int linecrossesf(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
{
+
+#define GETMIN2_AXIS(a, b, ma, mb, axis) \
+ { \
+ ma[axis] = MIN2(a[axis], b[axis]); \
+ mb[axis] = MAX2(a[axis], b[axis]); \
+ } (void)0
+
+#define GETMIN2(a, b, ma, mb) \
+ { \
+ GETMIN2_AXIS(a, b, ma, mb, 0); \
+ GETMIN2_AXIS(a, b, ma, mb, 1); \
+ } (void)0
+
+#define EPS (FLT_EPSILON * 15)
+
int w1, w2, w3, w4, w5 /*, re */;
float mv1[2], mv2[2], mv3[2], mv4[2];
@@ -580,31 +522,32 @@ static int linecrossesf(const float v1[2], const float v2[2], const float v3[2],
return TRUE;
}
-#define GETMIN2_AXIS(a, b, ma, mb, axis) ma[axis] = MIN2(a[axis], b[axis]), mb[axis] = MAX2(a[axis], b[axis])
-#define GETMIN2(a, b, ma, mb) GETMIN2_AXIS(a, b, ma, mb, 0); GETMIN2_AXIS(a, b, ma, mb, 1);
-
GETMIN2(v1, v2, mv1, mv2);
GETMIN2(v3, v4, mv3, mv4);
/* do an interval test on the x and y axe */
/* first do x axi */
-#define T FLT_EPSILON * 15
- if ( ABS(v1[1] - v2[1]) < T &&
- ABS(v3[1] - v4[1]) < T &&
- ABS(v1[1] - v3[1]) < T)
+ if (ABS(v1[1] - v2[1]) < EPS &&
+ ABS(v3[1] - v4[1]) < EPS &&
+ ABS(v1[1] - v3[1]) < EPS)
{
return (mv4[0] >= mv1[0] && mv3[0] <= mv2[0]);
}
/* now do y axi */
- if ( ABS(v1[0] - v2[0]) < T &&
- ABS(v3[0] - v4[0]) < T &&
- ABS(v1[0] - v3[0]) < T)
+ if (ABS(v1[0] - v2[0]) < EPS &&
+ ABS(v3[0] - v4[0]) < EPS &&
+ ABS(v1[0] - v3[0]) < EPS)
{
return (mv4[1] >= mv1[1] && mv3[1] <= mv2[1]);
}
return FALSE;
+
+#undef GETMIN2_AXIS
+#undef GETMIN2
+#undef EPS
+
}
/**
@@ -664,7 +607,7 @@ int BM_face_point_inside_test(BMesh *bm, BMFace *f, const float co[3])
return crosses % 2 != 0;
}
-static int goodline(float (*projectverts)[3], BMFace *f, int v1i,
+static int goodline(float const (*projectverts)[3], BMFace *f, int v1i,
int v2i, int v3i, int UNUSED(nvert))
{
BMLoop *l_iter;
@@ -703,55 +646,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((float const (*)[3])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 +736,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 +771,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 +790,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 +809,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 +826,7 @@ void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3],
}
}
- /* NULL-terminat */
+ /* NULL-terminate */
if (newfaces) newfaces[nf_i] = NULL;
}
@@ -874,7 +842,7 @@ void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
{
BMIter iter;
BMLoop *l;
- float v1[3], v2[3], v3[3]/*, v4[3 */, no[3], mid[3], *p1, *p2, *p3, *p4;
+ float v1[3], v2[3], v3[3] /*, v4[3 */, no[3], mid[3], *p1, *p2, *p3, *p4;
float out[3] = {-234324.0f, -234324.0f, 0.0f};
float (*projverts)[3];
float (*edgeverts)[3];
@@ -959,7 +927,9 @@ void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
shrink_edgef(v1, v2, fac1);
for (j = 0; j < len; j++) {
- if (!loops[j][0]) continue;
+ if (!loops[j][0]) {
+ continue;
+ }
p3 = edgeverts[j * 2];
p4 = edgeverts[j * 2 + 1];
@@ -972,22 +942,20 @@ void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
for (i = 0; i < len; i++) {
for (j = 0; j < len; j++) {
- if (j == i) continue;
- if (!loops[i][0]) continue;
- if (!loops[j][0]) continue;
+ if (j != i && loops[i][0] && loops[j][0]) {
+ p1 = edgeverts[i * 2];
+ p2 = edgeverts[i * 2 + 1];
+ p3 = edgeverts[j * 2];
+ p4 = edgeverts[j * 2 + 1];
- p1 = edgeverts[i * 2];
- p2 = edgeverts[i * 2 + 1];
- p3 = edgeverts[j * 2];
- p4 = edgeverts[j * 2 + 1];
+ copy_v3_v3(v1, p1);
+ copy_v3_v3(v2, p2);
- copy_v3_v3(v1, p1);
- copy_v3_v3(v2, p2);
+ shrink_edgef(v1, v2, fac1);
- shrink_edgef(v1, v2, fac1);
-
- if (linecrossesf(v1, v2, p3, p4)) {
- loops[i][0] = NULL;
+ if (linecrossesf(v1, v2, p3, p4)) {
+ loops[i][0] = NULL;
+ }
}
}
}
diff --git a/source/blender/bmesh/intern/bmesh_polygon.h b/source/blender/bmesh/intern/bmesh_polygon.h
index 9ee1714d125..3c8f3dc3339 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.h
+++ b/source/blender/bmesh/intern/bmesh_polygon.h
@@ -32,7 +32,8 @@ void BM_face_center_bounds_calc(BMesh *bm, BMFace *f, float center[3]);
void BM_face_center_mean_calc(BMesh *bm, BMFace *f, float center[3]);
void BM_face_normal_update(BMesh *bm, BMFace *f);
-void BM_face_normal_update_vcos(BMesh *bm, BMFace *f, float no[3], float (*vertexCos)[3]);
+void BM_face_normal_update_vcos(BMesh *bm, BMFace *f, float no[3],
+ float const (*vertexCos)[3]);
void BM_edge_normals_update(BMesh *bm, BMEdge *e);
@@ -43,7 +44,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..3f67deb7997 100644
--- a/source/blender/bmesh/intern/bmesh_private.h
+++ b/source/blender/bmesh/intern/bmesh_private.h
@@ -65,11 +65,6 @@ 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_vertex_cos(BMesh *bm, BMFace *f, float no[3],
- float (*projectverts)[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 28c370f51eb..24c60e22a90 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,145 @@ 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;
+ }
+}
+
+/**
+ * \brief Other Loop in Face Sharing a Vert
+ *
+ * Finds the other loop that shares \a v with \a e loop in \a f.
+ *
+ * +----------+ <-- return the face loop of this vertex.
+ * | |
+ * | |
+ * | |
+ * +----------+ <-- This vertex defines the direction.
+ * l v
+ * ^ <------- This loop defines both the face to search
+ * and the edge, in combination with 'v'
+ * The faces loop direction is ignored.
+ */
+
+BMLoop *BM_loop_other_vert_loop(BMLoop *l, BMVert *v)
+{
+#if 0 /* works but slow */
+ return BM_face_other_vert_loop(l->f, BM_edge_other_vert(l->e, v), v);
+#else
+ BMEdge *e = l->e;
+ BMVert *v_prev = BM_edge_other_vert(e, v);
+ if (l->v == v) {
+ if (l->prev->v == v_prev) {
+ return l->next;
+ }
+ else {
+ BLI_assert(l->next->v == v_prev);
+
+ return l->prev;
+ }
+ }
+ else {
+ BLI_assert(l->v == v_prev);
+
+ if (l->prev->v == v) {
+ return l->prev->prev;
+ }
+ else {
+ BLI_assert(l->next->v == v);
+ return l->next->next;
+ }
+ }
+
+
+
+#endif
+}
+
+/**
* Returns TRUE if the vertex is used in a given face.
*/
@@ -191,6 +309,64 @@ BMVert *BM_edge_other_vert(BMEdge *e, BMVert *v)
}
/**
+ * Returms edge length
+ */
+float BM_edge_length_calc(BMEdge *e)
+{
+ return len_v3v3(e->v1->co, e->v2->co);
+}
+
+/**
+ * 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;
+ }
+}
+
+/**
+ * Utility function, since enough times we have an edge
+ * and want to access 2 connected loops.
+ *
+ * \return TRUE when only 2 faces are found.
+ */
+int BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
+{
+ BMLoop *la, *lb;
+
+ if ((la = e->l) &&
+ (lb = la->radial_next) &&
+ (lb->radial_next == la))
+ {
+ *r_la = la;
+ *r_lb = lb;
+ return TRUE;
+ }
+ else {
+ *r_la = NULL;
+ *r_lb = NULL;
+ return FALSE;
+ }
+}
+
+/**
* Returns the number of edges around this vertex.
*/
int BM_vert_edge_count(BMVert *v)
@@ -198,19 +374,34 @@ int BM_vert_edge_count(BMVert *v)
return bmesh_disk_count(v);
}
+int BM_vert_edge_count_nonwire(BMVert *v)
+{
+ int count = 0;
+ BMIter eiter;
+ BMEdge *edge;
+ BM_ITER(edge, &eiter, NULL, BM_EDGES_OF_VERT, v) {
+ if (edge->l) {
+ count++;
+ }
+ }
+ return count;
+}
/**
* Returns the number of faces around this edge
*/
int BM_edge_face_count(BMEdge *e)
{
int count = 0;
- BMLoop *l_iter = NULL;
if (e->l) {
- l_iter = e->l;
+ BMLoop *l_iter;
+ BMLoop *l_first;
+
+ l_iter = l_first = e->l;
+
do {
count++;
- } while ((l_iter = bmesh_radial_loop_next(l_iter)) != e->l);
+ } while ((l_iter = l_iter->radial_next) != l_first);
}
return count;
@@ -248,7 +439,7 @@ int BM_vert_face_count(BMVert *v)
* Tests whether or not the vertex is part of a wire edge.
* (ie: has no faces attached to it)
*/
-int BM_vert_is_wire(BMesh *UNUSED(bm), BMVert *v)
+int BM_vert_is_wire(BMVert *v)
{
BMEdge *curedge;
@@ -272,7 +463,7 @@ int BM_vert_is_wire(BMesh *UNUSED(bm), BMVert *v)
* Tests whether or not the edge is part of a wire.
* (ie: has no faces attached to it)
*/
-int BM_edge_is_wire(BMesh *UNUSED(bm), BMEdge *e)
+int BM_edge_is_wire(BMEdge *e)
{
return (e->l) ? FALSE : TRUE;
}
@@ -284,7 +475,7 @@ int BM_edge_is_wire(BMesh *UNUSED(bm), BMEdge *e)
* 3: Is part of a non-manifold edge (edge with more than 2 faces)
* 4: Is part of a wire edge
*/
-int BM_vert_is_manifold(BMesh *UNUSED(bm), BMVert *v)
+int BM_vert_is_manifold(BMVert *v)
{
BMEdge *e, *oe;
BMLoop *l;
@@ -348,27 +539,50 @@ int BM_vert_is_manifold(BMesh *UNUSED(bm), BMVert *v)
* Tests whether or not this edge is manifold.
* A manifold edge either has 1 or 2 faces attached to it.
*/
-int BM_edge_is_manifold(BMesh *UNUSED(bm), BMEdge *e)
+
+#if 1 /* fast path for checking manifold */
+int BM_edge_is_manifold(BMEdge *e)
+{
+ const BMLoop *l = e->l;
+ return (l && ((l->radial_next == l) || /* 1 face user */
+ (l->radial_next->radial_next == l))); /* 2 face users */
+}
+#else
+int BM_edge_is_manifold(BMEdge *e)
{
int count = BM_edge_face_count(e);
- if (count != 2 && count != 1) {
+ if (count == 2 || count == 1) {
+ return TRUE;
+ }
+ else {
return FALSE;
}
- return TRUE;
}
+#endif
/**
* Tests whether or not an edge is on the boundary
* of a shell (has one face associated with it)
*/
+
+#if 1 /* fast path for checking boundary */
+int BM_edge_is_boundary(BMEdge *e)
+{
+ const BMLoop *l = e->l;
+ return (l && (l->radial_next == l));
+}
+#else
int BM_edge_is_boundary(BMEdge *e)
{
int count = BM_edge_face_count(e);
if (count == 1) {
return TRUE;
}
- return FALSE;
+ else {
+ return FALSE;
+ }
}
+#endif
/**
* Counts the number of edges two faces share (if any)
@@ -438,18 +652,44 @@ 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.
*
- * Useful to get a determanistic winding order when calling
+ * Useful to get a deterministic winding order when calling
* BM_face_create_ngon() on an arbitrary array of verts,
* though be sure to pick an edge which has a face.
*/
-void BM_edge_ordered_verts(BMEdge *edge, BMVert **r_v1, BMVert **r_v2)
+void BM_edge_ordered_verts_ex(BMEdge *edge, BMVert **r_v1, BMVert **r_v2,
+ BMLoop *edge_loop)
{
- if ((edge->l == NULL) ||
- (((edge->l->prev->v == edge->v1) && (edge->l->v == edge->v2)) ||
- ((edge->l->v == edge->v1) && (edge->l->next->v == edge->v2)))
+ BLI_assert(edge_loop->e == edge);
+
+ if ((edge_loop == NULL) ||
+ (((edge_loop->prev->v == edge->v1) && (edge_loop->v == edge->v2)) ||
+ ((edge_loop->v == edge->v1) && (edge_loop->next->v == edge->v2)))
)
{
*r_v1 = edge->v1;
@@ -461,13 +701,18 @@ void BM_edge_ordered_verts(BMEdge *edge, BMVert **r_v1, BMVert **r_v2)
}
}
+void BM_edge_ordered_verts(BMEdge *edge, BMVert **r_v1, BMVert **r_v2)
+{
+ BM_edge_ordered_verts_ex(edge, r_v1, r_v2, edge->l);
+}
+
/**
* Calculates the angle between the previous and next loops
* (angle at this loops face corner).
*
* \return angle in radians
*/
-float BM_loop_face_angle(BMesh *UNUSED(bm), BMLoop *l)
+float BM_loop_face_angle(BMLoop *l)
{
return angle_v3v3v3(l->prev->v->co,
l->v->co,
@@ -475,6 +720,65 @@ float BM_loop_face_angle(BMesh *UNUSED(bm), BMLoop *l)
}
/**
+ * \brief BM_loop_face_normal
+ *
+ * Calculate the normal at this loop corner or fallback to the face normal on straignt lines.
+ *
+ * \param bm The BMesh
+ * \param l The loop to calculate the normal at
+ * \param r_normal Resulting normal
+ */
+void BM_loop_face_normal(BMLoop *l, float r_normal[3])
+{
+ if (normal_tri_v3(r_normal,
+ l->prev->v->co,
+ l->v->co,
+ l->next->v->co) != 0.0f)
+ {
+ return;
+ }
+ else {
+ copy_v3_v3(r_normal, l->f->no);
+ }
+}
+
+/**
+ * \brief BM_loop_face_tangent
+ *
+ * Calculate the tangent at this loop corner or fallback to the face normal on straignt lines.
+ * This vector always points inward into the face.
+ *
+ * \param bm The BMesh
+ * \param l The loop to calculate the tangent at
+ * \param r_tangent Resulting tangent
+ */
+void BM_loop_face_tangent(BMLoop *l, float r_tangent[3])
+{
+ float v_prev[3];
+ float v_next[3];
+
+ sub_v3_v3v3(v_prev, l->prev->v->co, l->v->co);
+ sub_v3_v3v3(v_next, l->v->co, l->next->v->co);
+
+ normalize_v3(v_prev);
+ normalize_v3(v_next);
+
+ if (compare_v3v3(v_prev, v_next, FLT_EPSILON) == FALSE) {
+ float dir[3];
+ float nor[3]; /* for this purpose doesnt need to be normalized */
+ add_v3_v3v3(dir, v_prev, v_next);
+ cross_v3_v3v3(nor, v_prev, v_next);
+ cross_v3_v3v3(r_tangent, dir, nor);
+ }
+ else {
+ /* prev/next are the same - compare with face normal since we don't have one */
+ cross_v3_v3v3(r_tangent, v_next, l->f->no);
+ }
+
+ normalize_v3(r_tangent);
+}
+
+/**
* \brief BMESH EDGE/FACE ANGLE
*
* Calculates the angle between two faces.
@@ -482,7 +786,7 @@ float BM_loop_face_angle(BMesh *UNUSED(bm), BMLoop *l)
*
* \return angle in radians
*/
-float BM_edge_face_angle(BMesh *UNUSED(bm), BMEdge *e)
+float BM_edge_face_angle(BMEdge *e)
{
if (BM_edge_face_count(e) == 2) {
BMLoop *l1 = e->l;
@@ -501,7 +805,7 @@ float BM_edge_face_angle(BMesh *UNUSED(bm), BMEdge *e)
*
* \returns the angle in radians
*/
-float BM_vert_edge_angle(BMesh *UNUSED(bm), BMVert *v)
+float BM_vert_edge_angle(BMVert *v)
{
BMEdge *e1, *e2;
@@ -648,7 +952,7 @@ int BM_face_exists_multi(BMesh *bm, BMVert **varr, BMEdge **earr, int len)
}
}
- /* now tag all verts and edges in the boundry array as true so
+ /* now tag all verts and edges in the boundary array as true so
* we can know if a face-vert is from our array */
for (i = 0; i < len; i++) {
BM_elem_flag_enable(varr[i], BM_ELEM_INTERNAL_TAG);
@@ -656,10 +960,10 @@ int BM_face_exists_multi(BMesh *bm, BMVert **varr, BMEdge **earr, int len)
}
- /* so! boundry is tagged, everything else cleared */
+ /* so! boundary is tagged, everything else cleared */
- /* 1) tag all faces connected to edges - if all their verts are boundry */
+ /* 1) tag all faces connected to edges - if all their verts are boundary */
tot_tag = 0;
for (i = 0; i < len; i++) {
BM_ITER(f, &fiter, bm, BM_FACES_OF_EDGE, earr[i]) {
@@ -673,7 +977,7 @@ int BM_face_exists_multi(BMesh *bm, BMVert **varr, BMEdge **earr, int len)
}
if (ok) {
- /* we only use boundry verts */
+ /* we only use boundary verts */
BM_elem_flag_enable(f, BM_ELEM_INTERNAL_TAG);
tot_tag++;
}
@@ -685,19 +989,19 @@ int BM_face_exists_multi(BMesh *bm, BMVert **varr, BMEdge **earr, int len)
}
if (tot_tag == 0) {
- /* no faces use only boundry verts, quit early */
+ /* no faces use only boundary verts, quit early */
return FALSE;
}
- /* 2) loop over non-boundry edges that use boundry verts,
+ /* 2) loop over non-boundary edges that use boundary verts,
* check each have 2 tagges faces connected (faces that only use 'varr' verts) */
ok = TRUE;
for (i = 0; i < len; i++) {
BM_ITER(e, &fiter, bm, BM_EDGES_OF_VERT, varr[i]) {
- if (/* non-boundry edge */
+ if (/* non-boundary edge */
BM_elem_flag_test(e, BM_ELEM_INTERNAL_TAG) == FALSE &&
- /* ...using boundry verts */
+ /* ...using boundary verts */
BM_elem_flag_test(e->v1, BM_ELEM_INTERNAL_TAG) == TRUE &&
BM_elem_flag_test(e->v2, BM_ELEM_INTERNAL_TAG) == TRUE)
{
diff --git a/source/blender/bmesh/intern/bmesh_queries.h b/source/blender/bmesh/intern/bmesh_queries.h
index 1fb0df7e2af..f3dfa754f00 100644
--- a/source/blender/bmesh/intern/bmesh_queries.h
+++ b/source/blender/bmesh/intern/bmesh_queries.h
@@ -37,24 +37,32 @@ 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);
+float BM_edge_length_calc(BMEdge *e);
+int BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb);
+int BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb);
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);
+BMLoop *BM_loop_other_vert_loop(BMLoop *l, BMVert *v);
+int BM_vert_edge_count_nonwire(BMVert *v);
int BM_vert_edge_count(BMVert *v);
int BM_edge_face_count(BMEdge *e);
int BM_vert_face_count(BMVert *v);
-int BM_vert_is_wire(BMesh *bm, BMVert *v);
-int BM_edge_is_wire(BMesh *bm, BMEdge *e);
+int BM_vert_is_wire(BMVert *v);
+int BM_edge_is_wire(BMEdge *e);
-int BM_vert_is_manifold(BMesh *bm, BMVert *v);
-int BM_edge_is_manifold(BMesh *bm, BMEdge *e);
+int BM_vert_is_manifold(BMVert *v);
+int BM_edge_is_manifold(BMEdge *e);
int BM_edge_is_boundary(BMEdge *e);
-float BM_loop_face_angle(BMesh *bm, BMLoop *l);
+float BM_loop_face_angle(BMLoop *l);
+void BM_loop_face_normal(BMLoop *l, float r_normal[3]);
+void BM_loop_face_tangent(BMLoop *l, float r_tangent[3]);
-float BM_edge_face_angle(BMesh *bm, BMEdge *e);
-float BM_vert_edge_angle(BMesh *bm, BMVert *v);
+float BM_edge_face_angle(BMEdge *e);
+float BM_vert_edge_angle(BMVert *v);
BMEdge *BM_edge_exists(BMVert *v1, BMVert *v2);
@@ -70,7 +78,10 @@ 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);
+void BM_edge_ordered_verts_ex(BMEdge *edge, BMVert **r_v1, BMVert **r_v2,
+ BMLoop *edge_loop);
#endif /* __BMESH_QUERIES_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_structure.c b/source/blender/bmesh/intern/bmesh_structure.c
index 191b9c29f01..27815551a87 100644
--- a/source/blender/bmesh/intern/bmesh_structure.c
+++ b/source/blender/bmesh/intern/bmesh_structure.c
@@ -31,14 +31,13 @@
* Low level routines for manipulating the BM structure.
*/
-#include "bmesh.h"
-#include "bmesh_private.h"
+#include "BLI_utildefines.h"
-#include <stdlib.h>
+#include "bmesh.h"
+#include "intern/bmesh_private.h"
/**
* MISC utility functions.
- *
*/
int bmesh_vert_in_edge(BMEdge *e, BMVert *v)
@@ -107,7 +106,7 @@ int bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv)
* some nice utilities for navigating disk cycles in a way that hides this detail from the
* tool writer.
*
- * Note that the disk cycle is completley independent from face data. One advantage of this
+ * Note that the disk cycle is completely independent from face data. One advantage of this
* is that wire edges are fully integrated into the topology database. Another is that the
* the disk cycle has no problems dealing with non-manifold conditions involving faces.
*
@@ -131,7 +130,6 @@ int bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv)
* Functions relating to this cycle:
* - #bmesh_radial_append
* - #bmesh_radial_loop_remove
- * - #bmesh_radial_loop_next
* - #bmesh_radial_face_find
* - #bmesh_radial_facevert_count
* - #bmesh_radial_faceloop_find_first
@@ -152,7 +150,7 @@ int bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv)
*
* \note the order of elements in all cycles except the loop cycle is undefined. This
* leads to slightly increased seek time for deriving some adjacency relations, however the
- * advantage is that no intrinsic properties of the data structures are dependant upon the
+ * advantage is that no intrinsic properties of the data structures are dependent upon the
* cycle order and all non-manifold conditions are represented trivially.
*/
int bmesh_disk_edge_append(BMEdge *e, BMVert *v)
@@ -202,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)
@@ -234,7 +230,7 @@ BMEdge *bmesh_disk_edge_exists(BMVert *v1, BMVert *v2)
BMEdge *e_iter, *e_first;
if (v1->e) {
- e_first = e_iter= v1->e;
+ e_first = e_iter = v1->e;
do {
if (bmesh_verts_in_edge(v1, v2, e_iter)) {
@@ -379,7 +375,7 @@ int bmesh_radial_validate(int radlen, BMLoop *l)
}
i++;
- } while ((l_iter = bmesh_radial_loop_next(l_iter)) != l);
+ } while ((l_iter = l_iter->radial_next) != l);
return TRUE;
}
@@ -438,27 +434,22 @@ BMLoop *bmesh_radial_faceloop_find_first(BMLoop *l, BMVert *v)
if (l_iter->v == v) {
return l_iter;
}
- } while ((l_iter = bmesh_radial_loop_next(l_iter)) != l);
+ } while ((l_iter = l_iter->radial_next) != l);
return NULL;
}
BMLoop *bmesh_radial_faceloop_find_next(BMLoop *l, BMVert *v)
{
BMLoop *l_iter;
- l_iter = bmesh_radial_loop_next(l);
+ l_iter = l->radial_next;
do {
if (l_iter->v == v) {
return l_iter;
}
- } while ((l_iter = bmesh_radial_loop_next(l_iter)) != l);
+ } while ((l_iter = l_iter->radial_next) != l);
return l;
}
-BMLoop *bmesh_radial_loop_next(BMLoop *l)
-{
- return l->radial_next;
-}
-
int bmesh_radial_length(BMLoop *l)
{
BMLoop *l_iter = l;
@@ -536,7 +527,7 @@ int bmesh_radial_facevert_count(BMLoop *l, BMVert *v)
if (l_iter->v == v) {
count++;
}
- } while ((l_iter = bmesh_radial_loop_next(l_iter)) != l);
+ } while ((l_iter = l_iter->radial_next) != l);
return count;
}
diff --git a/source/blender/bmesh/intern/bmesh_structure.h b/source/blender/bmesh/intern/bmesh_structure.h
index 8e82f3cd2d7..8b43f72c725 100644
--- a/source/blender/bmesh/intern/bmesh_structure.h
+++ b/source/blender/bmesh/intern/bmesh_structure.h
@@ -35,7 +35,7 @@
* None of these functions should ever be exported to the rest of Blender.
*
* in the vast majority of cases thes should not be used directly.
- * if absolutely necassary, see function defitions in code for
+ * if absolutely necessary, see function definitions in code for
* descriptive comments. but seriously, don't use this stuff.
*/
@@ -56,11 +56,15 @@ BMEdge *bmesh_disk_faceedge_find_next(BMEdge *e, BMVert *v);
/* RADIAL CYCLE MANAGMENT */
void bmesh_radial_append(BMEdge *e, BMLoop *l);
void bmesh_radial_loop_remove(BMLoop *l, BMEdge *e);
-BMLoop *bmesh_radial_loop_next(BMLoop *l);
+/* note:
+ * bmesh_radial_loop_next(BMLoop *l) / prev.
+ * just use member access l->radial_next, l->radial_prev now */
+
int bmesh_radial_face_find(BMEdge *e, BMFace *f);
int bmesh_radial_facevert_count(BMLoop *l, BMVert *v);
BMLoop *bmesh_radial_faceloop_find_first(BMLoop *l, BMVert *v);
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.c b/source/blender/bmesh/intern/bmesh_walkers.c
index 2e2c0406b9c..a3b5d94ba8e 100644
--- a/source/blender/bmesh/intern/bmesh_walkers.c
+++ b/source/blender/bmesh/intern/bmesh_walkers.c
@@ -27,9 +27,9 @@
*/
#include <stdlib.h>
+#include <string.h> /* for memcpy */
-
-
+#include "BLI_utildefines.h"
#include "BLI_listbase.h"
#include "bmesh.h"
@@ -42,7 +42,7 @@
*
* original desing: walkers directly emulation recursive functions.
* functions save their state onto a worklist, and also add new states
- * to implement recursive or looping behaviour. generally only one
+ * to implement recursive or looping behavior. generally only one
* state push per call with a specific state is desired.
*
* basic design pattern: the walker step function goes through it's
@@ -53,8 +53,8 @@
* - Walkers use tool flags, not header flags.
* - Walkers now use ghash for storing visited elements,
* rather then stealing flags. ghash can be rewritten
- * to be faster if necassary, in the far future :) .
- * - tools should ALWAYS have necassary error handling
+ * to be faster if necessary, in the far future :) .
+ * - tools should ALWAYS have necessary error handling
* for if walkers fail.
*/
@@ -73,26 +73,28 @@ void *BMW_begin(BMWalker *walker, void *start)
* by the bitmask 'searchmask'.
*/
void BMW_init(BMWalker *walker, BMesh *bm, int type,
- short mask_vert, short mask_edge, short mask_loop, short mask_face,
+ short mask_vert, short mask_edge, short mask_face,
+ BMWFlag flag,
int layer)
{
memset(walker, 0, sizeof(BMWalker));
walker->layer = layer;
+ walker->flag = flag;
walker->bm = bm;
walker->mask_vert = mask_vert;
walker->mask_edge = mask_edge;
- walker->mask_loop = mask_loop;
walker->mask_face = mask_face;
walker->visithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh walkers 1");
-
+ walker->secvisithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh walkers sec 1");
+
if (UNLIKELY(type >= BMW_MAXWALKERS || type < 0)) {
fprintf(stderr,
"Invalid walker type in BMW_init; type: %d, "
- "searchmask: (v:%d, e:%d, l:%d, f:%d), flag: %d\n",
- type, mask_vert, mask_edge, mask_loop, mask_face, layer);
+ "searchmask: (v:%d, e:%d, f:%d), flag: %d, layer: %d\n",
+ type, mask_vert, mask_edge, mask_face, flag, layer);
BMESH_ASSERT(0);
}
@@ -109,11 +111,10 @@ void BMW_init(BMWalker *walker, BMesh *bm, int type,
* 'bm_walker_types' needs updating */
BLI_assert(mask_vert == 0 || (walker->valid_mask & BM_VERT));
BLI_assert(mask_edge == 0 || (walker->valid_mask & BM_EDGE));
- BLI_assert(mask_loop == 0 || (walker->valid_mask & BM_LOOP));
BLI_assert(mask_face == 0 || (walker->valid_mask & BM_FACE));
}
- walker->worklist = BLI_mempool_create(walker->structsize, 100, 100, TRUE, FALSE);
+ walker->worklist = BLI_mempool_create(walker->structsize, 100, 100, BLI_MEMPOOL_SYSMALLOC);
walker->states.first = walker->states.last = NULL;
}
@@ -126,6 +127,7 @@ void BMW_end(BMWalker *walker)
{
BLI_mempool_destroy(walker->worklist);
BLI_ghash_free(walker->visithash, NULL, NULL);
+ BLI_ghash_free(walker->secvisithash, NULL, NULL);
}
@@ -179,7 +181,7 @@ void *BMW_walk(BMWalker *walker)
*/
void *BMW_current_state(BMWalker *walker)
{
- bmesh_walkerGeneric *currentstate = walker->states.first;
+ BMwGenericWalker *currentstate = walker->states.first;
if (currentstate) {
/* Automatic update of depth. For most walkers that
* follow the standard "Step" pattern of:
@@ -221,7 +223,7 @@ void BMW_state_remove(BMWalker *walker)
*/
void *BMW_state_add(BMWalker *walker)
{
- bmesh_walkerGeneric *newstate;
+ BMwGenericWalker *newstate;
newstate = BLI_mempool_alloc(walker->worklist);
newstate->depth = walker->depth;
switch (walker->order)
@@ -252,5 +254,7 @@ void BMW_reset(BMWalker *walker)
}
walker->depth = 0;
BLI_ghash_free(walker->visithash, NULL, NULL);
+ BLI_ghash_free(walker->secvisithash, NULL, NULL);
walker->visithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh walkers 1");
+ walker->secvisithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh walkers sec 1");
}
diff --git a/source/blender/bmesh/intern/bmesh_walkers.h b/source/blender/bmesh/intern/bmesh_walkers.h
index 765576c9ab7..4f81f38aeb3 100644
--- a/source/blender/bmesh/intern/bmesh_walkers.h
+++ b/source/blender/bmesh/intern/bmesh_walkers.h
@@ -30,14 +30,19 @@
#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,
BMW_BREADTH_FIRST
} BMWOrder;
+typedef enum {
+ BMW_FLAG_NOP = 0,
+ BMW_FLAG_TEST_HIDDEN = (1 << 0)
+} BMWFlag;
+
/*Walkers*/
typedef struct BMWalker {
void (*begin) (struct BMWalker *walker, void *start);
@@ -54,13 +59,16 @@ typedef struct BMWalker {
BLI_mempool *worklist;
ListBase states;
- /* these masks are to be tested against elements BMO_elem_flag_test() */
+ /* these masks are to be tested against elements BMO_elem_flag_test(),
+ * should never be accessed directly only through BMW_init() and bmw_mask_check_*() functions */
short mask_vert;
short mask_edge;
- short mask_loop;
short mask_face;
+ BMWFlag flag;
+
GHash *visithash;
+ GHash *secvisithash;
int depth;
} BMWalker;
@@ -70,7 +78,8 @@ typedef struct BMWalker {
/* initialize a walker. searchmask restricts some (not all) walkers to
* elements with a specific tool flag set. flags is specific to each walker.*/
void BMW_init(struct BMWalker *walker, BMesh *bm, int type,
- short mask_vert, short mask_edge, short mask_loop, short mask_face,
+ short mask_vert, short mask_edge, short mask_face,
+ BMWFlag flag,
int layer);
void *BMW_begin(BMWalker *walker, void *start);
void *BMW_step(struct BMWalker *walker);
@@ -85,25 +94,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.*/
@@ -121,7 +130,7 @@ enum {
/* walk over an island of flagged faces. note, that this doesn't work on
* non-manifold geometry. it might be better to rewrite this to extract
* boundary info from the island walker, rather then directly walking
- * over the boundary. raises an error if it encouters nonmanifold
+ * over the boundary. raises an error if it encounters nonmanifold
* geometry. */
BMW_ISLANDBOUND,
/* walk over all faces in an island of tool flagged faces. */
diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c
index 73aa42dbbdc..818a7fb3cfa 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_impl.c
+++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c
@@ -26,11 +26,52 @@
* BMesh Walker Code.
*/
+#include "BLI_utildefines.h"
+
#include "BKE_customdata.h"
#include "bmesh.h"
-#include "bmesh_private.h"
-#include "bmesh_walkers_private.h"
+#include "intern/bmesh_private.h"
+#include "intern/bmesh_walkers_private.h"
+
+static int bmw_mask_check_vert(BMWalker *walker, BMVert *v)
+{
+ if ((walker->flag & BMW_FLAG_TEST_HIDDEN) && BM_elem_flag_test(v, BM_ELEM_HIDDEN)) {
+ return FALSE;
+ }
+ else if (walker->mask_vert && !BMO_elem_flag_test(walker->bm, v, walker->mask_vert)) {
+ return FALSE;
+ }
+ else {
+ return TRUE;
+ }
+}
+
+static int bmw_mask_check_edge(BMWalker *walker, BMEdge *e)
+{
+ if ((walker->flag & BMW_FLAG_TEST_HIDDEN) && BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
+ return FALSE;
+ }
+ else if (walker->mask_edge && !BMO_elem_flag_test(walker->bm, e, walker->mask_edge)) {
+ return FALSE;
+ }
+ else {
+ return TRUE;
+ }
+}
+
+static int bmw_mask_check_face(BMWalker *walker, BMFace *f)
+{
+ if ((walker->flag & BMW_FLAG_TEST_HIDDEN) && BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
+ return FALSE;
+ }
+ else if (walker->mask_face && !BMO_elem_flag_test(walker->bm, f, walker->mask_face)) {
+ return FALSE;
+ }
+ else {
+ return TRUE;
+ }
+}
/**
* Shell Walker:
@@ -40,15 +81,15 @@
*
* \todo Add restriction flag/callback for wire edges.
*/
-static void shellWalker_visitEdge(BMWalker *walker, BMEdge *e)
+static void bmw_ShellWalker_visitEdge(BMWalker *walker, BMEdge *e)
{
- shellWalker *shellWalk = NULL;
+ BMwShellWalker *shellWalk = NULL;
if (BLI_ghash_haskey(walker->visithash, e)) {
return;
}
- if (walker->mask_edge && !BMO_elem_flag_test(walker->bm, e, walker->mask_edge)) {
+ if (!bmw_mask_check_edge(walker, e)) {
return;
}
@@ -57,7 +98,7 @@ static void shellWalker_visitEdge(BMWalker *walker, BMEdge *e)
BLI_ghash_insert(walker->visithash, e, NULL);
}
-static void shellWalker_begin(BMWalker *walker, void *data)
+static void bmw_ShellWalker_begin(BMWalker *walker, void *data)
{
BMIter eiter;
BMHeader *h = data;
@@ -75,7 +116,7 @@ static void shellWalker_begin(BMWalker *walker, void *data)
* to the worklist */
v = (BMVert *)h;
BM_ITER(e, &eiter, walker->bm, BM_EDGES_OF_VERT, v) {
- shellWalker_visitEdge(walker, e);
+ bmw_ShellWalker_visitEdge(walker, e);
}
break;
}
@@ -85,21 +126,21 @@ static void shellWalker_begin(BMWalker *walker, void *data)
/* starting the walk at an edge, add the single edge
* to the worklist */
e = (BMEdge *)h;
- shellWalker_visitEdge(walker, e);
+ bmw_ShellWalker_visitEdge(walker, e);
break;
}
}
}
-static void *shellWalker_yield(BMWalker *walker)
+static void *bmw_ShellWalker_yield(BMWalker *walker)
{
- shellWalker *shellWalk = BMW_current_state(walker);
+ BMwShellWalker *shellWalk = BMW_current_state(walker);
return shellWalk->curedge;
}
-static void *shellWalker_step(BMWalker *walker)
+static void *bmw_ShellWalker_step(BMWalker *walker)
{
- shellWalker *swalk = BMW_current_state(walker);
+ BMwShellWalker *swalk = BMW_current_state(walker);
BMEdge *e, *e2;
BMVert *v;
BMIter iter;
@@ -111,7 +152,7 @@ static void *shellWalker_step(BMWalker *walker)
for (i = 0; i < 2; i++) {
v = i ? e->v2 : e->v1;
BM_ITER(e2, &iter, walker->bm, BM_EDGES_OF_VERT, v) {
- shellWalker_visitEdge(walker, e2);
+ bmw_ShellWalker_visitEdge(walker, e2);
}
}
@@ -119,12 +160,12 @@ static void *shellWalker_step(BMWalker *walker)
}
#if 0
-static void *shellWalker_step(BMWalker *walker)
+static void *bmw_ShellWalker_step(BMWalker *walker)
{
BMEdge *curedge, *next = NULL;
BMVert *ov = NULL;
int restrictpass = 1;
- shellWalker shellWalk = *((shellWalker *)BMW_current_state(walker));
+ BMwShellWalker shellWalk = *((BMwShellWalker *)BMW_current_state(walker));
if (!BLI_ghash_haskey(walker->visithash, shellWalk.base)) {
BLI_ghash_insert(walker->visithash, shellWalk.base, NULL);
@@ -140,7 +181,7 @@ static void *shellWalker_step(BMWalker *walker)
if (!walker->restrictflag ||
(walker->restrictflag && BMO_elem_flag_test(walker->bm, curedge, walker->restrictflag)))
{
- shellWalker *newstate;
+ BMwShellWalker *newstate;
ov = BM_edge_other_vert(curedge, shellWalk.base);
@@ -166,15 +207,16 @@ static void *shellWalker_step(BMWalker *walker)
*
* Similar to shell walker, but visits vertices instead of edges.
*/
-static void connectedVertexWalker_visitVertex(BMWalker *walker, BMVert *v)
+static void bmw_ConnectedVertexWalker_visitVertex(BMWalker *walker, BMVert *v)
{
- connectedVertexWalker *vwalk;
+ BMwConnectedVertexWalker *vwalk;
if (BLI_ghash_haskey(walker->visithash, v)) {
/* already visited */
return;
}
- if (walker->mask_vert && !BMO_elem_flag_test(walker->bm, v, walker->mask_vert)) {
+
+ if (!bmw_mask_check_vert(walker, v)) {
/* not flagged for walk */
return;
}
@@ -184,21 +226,21 @@ static void connectedVertexWalker_visitVertex(BMWalker *walker, BMVert *v)
BLI_ghash_insert(walker->visithash, v, NULL);
}
-static void connectedVertexWalker_begin(BMWalker *walker, void *data)
+static void bmw_ConnectedVertexWalker_begin(BMWalker *walker, void *data)
{
BMVert *v = data;
- connectedVertexWalker_visitVertex(walker, v);
+ bmw_ConnectedVertexWalker_visitVertex(walker, v);
}
-static void *connectedVertexWalker_yield(BMWalker *walker)
+static void *bmw_ConnectedVertexWalker_yield(BMWalker *walker)
{
- connectedVertexWalker *vwalk = BMW_current_state(walker);
+ BMwConnectedVertexWalker *vwalk = BMW_current_state(walker);
return vwalk->curvert;
}
-static void *connectedVertexWalker_step(BMWalker *walker)
+static void *bmw_ConnectedVertexWalker_step(BMWalker *walker)
{
- connectedVertexWalker *vwalk = BMW_current_state(walker);
+ BMwConnectedVertexWalker *vwalk = BMW_current_state(walker);
BMVert *v, *v2;
BMEdge *e;
BMIter iter;
@@ -210,7 +252,7 @@ static void *connectedVertexWalker_step(BMWalker *walker)
BM_ITER(e, &iter, walker->bm, BM_EDGES_OF_VERT, v) {
v2 = BM_edge_other_vert(e, v);
if (!BLI_ghash_haskey(walker->visithash, v2)) {
- connectedVertexWalker_visitVertex(walker, v2);
+ bmw_ConnectedVertexWalker_visitVertex(walker, v2);
}
}
@@ -224,10 +266,10 @@ static void *connectedVertexWalker_step(BMWalker *walker)
*
* \todo Add restriction flag/callback for wire edges.
*/
-static void islandboundWalker_begin(BMWalker *walker, void *data)
+static void bmw_IslandboundWalker_begin(BMWalker *walker, void *data)
{
BMLoop *l = data;
- islandboundWalker *iwalk = NULL;
+ BMwIslandboundWalker *iwalk = NULL;
iwalk = BMW_state_add(walker);
@@ -238,16 +280,16 @@ static void islandboundWalker_begin(BMWalker *walker, void *data)
}
-static void *islandboundWalker_yield(BMWalker *walker)
+static void *bmw_IslandboundWalker_yield(BMWalker *walker)
{
- islandboundWalker *iwalk = BMW_current_state(walker);
+ BMwIslandboundWalker *iwalk = BMW_current_state(walker);
return iwalk->curloop;
}
-static void *islandboundWalker_step(BMWalker *walker)
+static void *bmw_IslandboundWalker_step(BMWalker *walker)
{
- islandboundWalker *iwalk = BMW_current_state(walker), owalk;
+ BMwIslandboundWalker *iwalk = BMW_current_state(walker), owalk;
BMVert *v;
BMEdge *e = iwalk->curloop->e;
BMFace *f;
@@ -256,10 +298,9 @@ static void *islandboundWalker_step(BMWalker *walker)
owalk = *iwalk;
- if (iwalk->lastv == e->v1) v = e->v2;
- else v = e->v1;
+ v = BM_edge_other_vert(e, iwalk->lastv);
- if (!BM_vert_is_manifold(walker->bm, v)) {
+ if (!BM_vert_is_manifold(v)) {
BMW_reset(walker);
BMO_error_raise(walker->bm, NULL, BMERR_WALKER_FAILED,
"Non-manifold vert "
@@ -273,12 +314,13 @@ static void *islandboundWalker_step(BMWalker *walker)
f = l->f;
while (1) {
- l = BM_face_other_loop(e, f, v);
- if (bmesh_radial_loop_next(l) != l) {
- l = bmesh_radial_loop_next(l);
+ l = BM_face_other_edge_loop(f, e, v);
+ if (l != l->radial_next) {
+ l = l->radial_next;
f = l->f;
e = l->e;
- if (walker->mask_face && !BMO_elem_flag_test(walker->bm, f, walker->mask_face)) {
+
+ if (!bmw_mask_check_face(walker, f)) {
l = l->radial_next;
break;
}
@@ -317,11 +359,11 @@ static void *islandboundWalker_step(BMWalker *walker)
*
* \todo Add restriction flag/callback for wire edges.
*/
-static void islandWalker_begin(BMWalker *walker, void *data)
+static void bmw_IslandWalker_begin(BMWalker *walker, void *data)
{
- islandWalker *iwalk = NULL;
+ BMwIslandWalker *iwalk = NULL;
- if (walker->mask_face && !BMO_elem_flag_test(walker->bm, (BMElemF *)data, walker->mask_face)) {
+ if (!bmw_mask_check_face(walker, data)) {
return;
}
@@ -331,17 +373,17 @@ static void islandWalker_begin(BMWalker *walker, void *data)
iwalk->cur = data;
}
-static void *islandWalker_yield(BMWalker *walker)
+static void *bmw_IslandWalker_yield(BMWalker *walker)
{
- islandWalker *iwalk = BMW_current_state(walker);
+ BMwIslandWalker *iwalk = BMW_current_state(walker);
return iwalk->cur;
}
-static void *islandWalker_step(BMWalker *walker)
+static void *bmw_IslandWalker_step(BMWalker *walker)
{
- islandWalker *iwalk = BMW_current_state(walker);
- /* islandWalker *owalk = iwalk; */ /* UNUSED */
+ BMwIslandWalker *iwalk = BMW_current_state(walker);
+ /* BMwIslandWalker *owalk = iwalk; */ /* UNUSED */
BMIter iter, liter;
BMFace *f, *curf = iwalk->cur;
BMLoop *l;
@@ -350,17 +392,21 @@ static void *islandWalker_step(BMWalker *walker)
l = BM_iter_new(&liter, walker->bm, BM_LOOPS_OF_FACE, iwalk->cur);
for ( ; l; l = BM_iter_step(&liter)) {
- /* could skip loop here too, but dont add unless we need it */
- if (walker->mask_edge && !BMO_elem_flag_test(walker->bm, l->e, walker->mask_edge)) {
+ /* could skip loop here too, but don't add unless we need it */
+ if (!bmw_mask_check_edge(walker, l->e)) {
continue;
}
f = BM_iter_new(&iter, walker->bm, BM_FACES_OF_EDGE, l->e);
for ( ; f; f = BM_iter_step(&iter)) {
- if (walker->mask_face && !BMO_elem_flag_test(walker->bm, f, walker->mask_face)) {
+
+ if (!bmw_mask_check_face(walker, f)) {
+ continue;
+ }
+
+ if (BLI_ghash_haskey(walker->visithash, f)) {
continue;
}
- if (BLI_ghash_haskey(walker->visithash, f)) continue;
iwalk = BMW_state_add(walker);
iwalk->cur = f;
@@ -378,126 +424,204 @@ static void *islandWalker_step(BMWalker *walker)
*
* Starts at a tool-flagged edge and walks over the edge loop
*/
-static void loopWalker_begin(BMWalker *walker, void *data)
+static void bmw_LoopWalker_begin(BMWalker *walker, void *data)
{
- loopWalker *lwalk = NULL, owalk;
+ BMwLoopWalker *lwalk = NULL, owalk;
BMEdge *e = data;
BMVert *v;
- /* int found = 1, val; */ /* UNUSED */
+ int vert_edge_count[2] = {BM_vert_edge_count_nonwire(e->v1),
+ BM_vert_edge_count_nonwire(e->v2)};
v = e->v1;
- /* val = BM_vert_edge_count(v); */ /* UNUSED */
-
lwalk = BMW_state_add(walker);
BLI_ghash_insert(walker->visithash, e, NULL);
lwalk->cur = lwalk->start = e;
lwalk->lastv = lwalk->startv = v;
- lwalk->stage2 = 0;
- lwalk->startrad = BM_edge_face_count(e);
+ lwalk->is_boundary = BM_edge_is_boundary(e);
+ lwalk->is_single = (vert_edge_count[0] == 2 && vert_edge_count[1] == 2);
+
+ /* could also check that vertex*/
+ if ((lwalk->is_boundary == FALSE) &&
+ (vert_edge_count[0] == 3 || vert_edge_count[1] == 3))
+ {
+ BMIter iter;
+ BMFace *f_iter;
+ BMFace *f_best = NULL;
+
+ BM_ITER(f_iter, &iter, walker->bm, BM_FACES_OF_EDGE, e) {
+ if (f_best == NULL || f_best->len < f_iter->len) {
+ f_best = f_iter;
+ }
+ }
- /* rewin */
+ if (f_best) {
+ /* only use hub selection for 5+ sides else this could
+ * conflict with normal edge loop selection. */
+ lwalk->f_hub = f_best->len > 4 ? f_best : NULL;
+ }
+ else {
+ /* edge doesn't have any faces connected to it */
+ lwalk->f_hub = NULL;
+ }
+ }
+ else {
+ lwalk->f_hub = NULL;
+ }
+
+ /* rewind */
while (BMW_current_state(walker)) {
- owalk = *((loopWalker *)BMW_current_state(walker));
+ owalk = *((BMwLoopWalker *)BMW_current_state(walker));
BMW_walk(walker);
}
lwalk = BMW_state_add(walker);
*lwalk = owalk;
- if (lwalk->lastv == owalk.cur->v1) lwalk->lastv = owalk.cur->v2;
- else lwalk->lastv = owalk.cur->v1;
-
- lwalk->startv = lwalk->lastv;
+ lwalk->lastv = lwalk->startv = BM_edge_other_vert(owalk.cur, lwalk->lastv);
BLI_ghash_free(walker->visithash, NULL, NULL);
walker->visithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh walkers 2");
BLI_ghash_insert(walker->visithash, owalk.cur, NULL);
}
-static void *loopWalker_yield(BMWalker *walker)
+static void *bmw_LoopWalker_yield(BMWalker *walker)
{
- loopWalker *lwalk = BMW_current_state(walker);
+ BMwLoopWalker *lwalk = BMW_current_state(walker);
return lwalk->cur;
}
-static void *loopWalker_step(BMWalker *walker)
+static void *bmw_LoopWalker_step(BMWalker *walker)
{
- loopWalker *lwalk = BMW_current_state(walker), owalk;
- BMIter eiter;
+ BMwLoopWalker *lwalk = BMW_current_state(walker), owalk;
BMEdge *e = lwalk->cur, *nexte = NULL;
- BMLoop *l, *l2;
+ BMLoop *l;
BMVert *v;
- int val, rlen /* , found = 0 */, i = 0, stopi;
+ int i;
owalk = *lwalk;
BMW_state_remove(walker);
l = e->l;
- /* handle wire edge case */
- if (!l) {
+ if (owalk.f_hub) { /* NGON EDGE */
+ int vert_edge_tot;
- /* match trunk: mark all connected wire edges */
- for (i = 0; i < 2; i++) {
- v = i ? e->v2 : e->v1;
+ v = BM_edge_other_vert(e, lwalk->lastv);
- BM_ITER(nexte, &eiter, walker->bm, BM_EDGES_OF_VERT, v) {
- if ((nexte->l == NULL) && !BLI_ghash_haskey(walker->visithash, nexte)) {
- lwalk = BMW_state_add(walker);
- lwalk->cur = nexte;
- lwalk->lastv = v;
- lwalk->startrad = owalk.startrad;
+ vert_edge_tot = BM_vert_edge_count_nonwire(v);
- BLI_ghash_insert(walker->visithash, nexte, NULL);
- }
+ if (vert_edge_tot == 3) {
+ l = BM_face_other_vert_loop(owalk.f_hub, lwalk->lastv, v);
+ nexte = BM_edge_exists(v, l->v);
+
+ if (bmw_mask_check_edge(walker, nexte) &&
+ !BLI_ghash_haskey(walker->visithash, nexte))
+ {
+ lwalk = BMW_state_add(walker);
+ lwalk->cur = nexte;
+ lwalk->lastv = v;
+
+ lwalk->is_boundary = owalk.is_boundary;
+ lwalk->is_single = owalk.is_single;
+ lwalk->f_hub = owalk.f_hub;
+
+ BLI_ghash_insert(walker->visithash, nexte, NULL);
}
}
-
- return owalk.cur;
}
+ else if (l) { /* NORMAL EDGE WITH FACES */
+ int vert_edge_tot;
+ int stopi;
- v = (e->v1 == lwalk->lastv) ? e->v2 : e->v1;
+ v = BM_edge_other_vert(e, lwalk->lastv);
- val = BM_vert_edge_count(v);
+ vert_edge_tot = BM_vert_edge_count_nonwire(v);
- rlen = owalk.startrad;
+ if (/* check if we should step, this is fairly involved */
- if (val == 4 || val == 2 || rlen == 1) {
- i = 0;
- stopi = val / 2;
- while (1) {
- if (rlen != 1 && i == stopi) break;
+ /* typical loopiong over edges in the middle of a mesh */
+ /* however, why use 2 here at all? I guess for internal ngon loops it can be useful. Antony R. */
+ ((vert_edge_tot == 4 || vert_edge_tot == 2) && owalk.is_boundary == FALSE) ||
- l = BM_face_other_loop(l->e, l->f, v);
+ /* walk over boundary of faces but stop at corners */
+ (owalk.is_boundary == TRUE && owalk.is_single == FALSE && vert_edge_tot > 2) ||
- if (!l)
- break;
+ /* initial edge was a boundary, so is this edge and vertex is only apart of this face
+ * this lets us walk over the the boundary of an ngon which is handy */
+ (owalk.is_boundary == TRUE && owalk.is_single == TRUE && vert_edge_tot == 2 && BM_edge_is_boundary(e)))
+ {
+ i = 0;
+ stopi = vert_edge_tot / 2;
+ while (1) {
+ if ((owalk.is_boundary == FALSE) && (i == stopi)) {
+ break;
+ }
- l2 = bmesh_radial_loop_next(l);
+ l = BM_face_other_edge_loop(l->f, l->e, v);
- if (l2 == l) {
- break;
+ if (l == NULL) {
+ break;
+ }
+ else {
+ BMLoop *l_next;
+
+ l_next = l->radial_next;
+
+ if ((l_next == l) || (l_next == NULL)) {
+ break;
+ }
+
+ l = l_next;
+ i++;
+ }
}
+ }
- l = l2;
- i += 1;
+ if (l != NULL) {
+ if (l != e->l &&
+ bmw_mask_check_edge(walker, l->e) &&
+ !BLI_ghash_haskey(walker->visithash, l->e))
+ {
+ if (!(owalk.is_boundary == FALSE && i != stopi)) {
+ lwalk = BMW_state_add(walker);
+ lwalk->cur = l->e;
+ lwalk->lastv = v;
+
+ lwalk->is_boundary = owalk.is_boundary;
+ lwalk->is_single = owalk.is_single;
+ lwalk->f_hub = owalk.f_hub;
+
+ BLI_ghash_insert(walker->visithash, l->e, NULL);
+ }
+ }
}
}
+ else { /* WIRE EDGE */
+ BMIter eiter;
- if (!l) {
- return owalk.cur;
- }
+ /* match trunk: mark all connected wire edges */
+ for (i = 0; i < 2; i++) {
+ v = i ? e->v2 : e->v1;
- if (l != e->l && !BLI_ghash_haskey(walker->visithash, l->e)) {
- if (!(rlen != 1 && i != stopi)) {
- lwalk = BMW_state_add(walker);
- lwalk->cur = l->e;
- lwalk->lastv = v;
- lwalk->startrad = owalk.startrad;
- BLI_ghash_insert(walker->visithash, l->e, NULL);
+ BM_ITER(nexte, &eiter, walker->bm, BM_EDGES_OF_VERT, v) {
+ if ((nexte->l == NULL) &&
+ bmw_mask_check_edge(walker, nexte) &&
+ !BLI_ghash_haskey(walker->visithash, nexte))
+ {
+ lwalk = BMW_state_add(walker);
+ lwalk->cur = nexte;
+ lwalk->lastv = v;
+
+ lwalk->is_boundary = owalk.is_boundary;
+ lwalk->is_single = owalk.is_single;
+ lwalk->f_hub = owalk.f_hub;
+
+ BLI_ghash_insert(walker->visithash, nexte, NULL);
+ }
+ }
}
}
@@ -514,15 +638,19 @@ static void *loopWalker_step(BMWalker *walker)
/* Check whether the face loop should includes the face specified
* by the given BMLoop */
-static int faceloopWalker_include_face(BMWalker *walker, BMLoop *l)
+static int bmw_FaceLoopWalker_include_face(BMWalker *walker, BMLoop *l)
{
/* face must have degree 4 */
if (l->f->len != 4) {
return FALSE;
}
+ if (!bmw_mask_check_face(walker, l->f)) {
+ return FALSE;
+ }
+
/* the face must not have been already visite */
- if (BLI_ghash_haskey(walker->visithash, l->f)) {
+ if (BLI_ghash_haskey(walker->visithash, l->f) && BLI_ghash_haskey(walker->secvisithash, l->e)) {
return FALSE;
}
@@ -530,39 +658,37 @@ static int faceloopWalker_include_face(BMWalker *walker, BMLoop *l)
}
/* Check whether the face loop can start from the given edge */
-static int faceloopWalker_edge_begins_loop(BMWalker *walker, BMEdge *e)
+static int bmw_FaceLoopWalker_edge_begins_loop(BMWalker *walker, BMEdge *e)
{
- BMesh *bm = walker->bm;
-
/* There is no face loop starting from a wire edge */
- if (BM_edge_is_wire(bm, e)) {
+ if (BM_edge_is_wire(e)) {
return FALSE;
}
/* Don't start a loop from a boundary edge if it cannot
* be extended to cover any faces */
if (BM_edge_face_count(e) == 1) {
- if (!faceloopWalker_include_face(walker, e->l)) {
+ if (!bmw_FaceLoopWalker_include_face(walker, e->l)) {
return FALSE;
}
}
/* Don't start a face loop from non-manifold edges */
- if (!BM_edge_is_manifold(bm, e)) {
+ if (!BM_edge_is_manifold(e)) {
return FALSE;
}
return TRUE;
}
-static void faceloopWalker_begin(BMWalker *walker, void *data)
+static void bmw_FaceLoopWalker_begin(BMWalker *walker, void *data)
{
- faceloopWalker *lwalk, owalk;
+ BMwFaceLoopWalker *lwalk, owalk;
BMEdge *e = data;
/* BMesh *bm = walker->bm; */ /* UNUSED */
/* int fcount = BM_edge_face_count(e); */ /* UNUSED */
- if (!faceloopWalker_edge_begins_loop(walker, e))
+ if (!bmw_FaceLoopWalker_edge_begins_loop(walker, e))
return;
lwalk = BMW_state_add(walker);
@@ -572,7 +698,7 @@ static void faceloopWalker_begin(BMWalker *walker, void *data)
/* rewin */
while (BMW_current_state(walker)) {
- owalk = *((faceloopWalker *)BMW_current_state(walker));
+ owalk = *((BMwFaceLoopWalker *)BMW_current_state(walker));
BMW_walk(walker);
}
@@ -580,14 +706,18 @@ static void faceloopWalker_begin(BMWalker *walker, void *data)
*lwalk = owalk;
lwalk->nocalc = 0;
+ BLI_ghash_free(walker->secvisithash, NULL, NULL);
+ walker->secvisithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh walkers 3");
+ BLI_ghash_insert(walker->visithash, lwalk->l->e, NULL);
+
BLI_ghash_free(walker->visithash, NULL, NULL);
walker->visithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh walkers 3");
BLI_ghash_insert(walker->visithash, lwalk->l->f, NULL);
}
-static void *faceloopWalker_yield(BMWalker *walker)
+static void *bmw_FaceLoopWalker_yield(BMWalker *walker)
{
- faceloopWalker *lwalk = BMW_current_state(walker);
+ BMwFaceLoopWalker *lwalk = BMW_current_state(walker);
if (!lwalk) {
return NULL;
@@ -596,9 +726,9 @@ static void *faceloopWalker_yield(BMWalker *walker)
return lwalk->l->f;
}
-static void *faceloopWalker_step(BMWalker *walker)
+static void *bmw_FaceLoopWalker_step(BMWalker *walker)
{
- faceloopWalker *lwalk = BMW_current_state(walker);
+ BMwFaceLoopWalker *lwalk = BMW_current_state(walker);
BMFace *f = lwalk->l->f;
BMLoop *l = lwalk->l, *origl = lwalk->l;
@@ -606,10 +736,11 @@ static void *faceloopWalker_step(BMWalker *walker)
l = l->radial_next;
- if (lwalk->nocalc)
+ if (lwalk->nocalc) {
return f;
+ }
- if (!faceloopWalker_include_face(walker, l)) {
+ if (!bmw_FaceLoopWalker_include_face(walker, l)) {
l = lwalk->l;
l = l->next->next;
if (BM_edge_face_count(l->e) != 2) {
@@ -618,7 +749,7 @@ static void *faceloopWalker_step(BMWalker *walker)
l = l->radial_next;
}
- if (faceloopWalker_include_face(walker, l)) {
+ if (bmw_FaceLoopWalker_include_face(walker, l)) {
lwalk = BMW_state_add(walker);
lwalk->l = l;
@@ -630,12 +761,15 @@ static void *faceloopWalker_step(BMWalker *walker)
lwalk->nocalc = 0;
}
+ BLI_ghash_insert(walker->secvisithash, l->e, NULL);
BLI_ghash_insert(walker->visithash, l->f, NULL);
}
return f;
}
+// #define BMW_EDGERING_NGON
+
/**
* Edge Ring Walker:
*
@@ -643,9 +777,9 @@ static void *faceloopWalker_step(BMWalker *walker)
* Conditions for starting and stepping the edge ring have been
* tuned in an attempt to match the edge rings built by EditMesh
*/
-static void edgeringWalker_begin(BMWalker *walker, void *data)
+static void bmw_EdgeringWalker_begin(BMWalker *walker, void *data)
{
- edgeringWalker *lwalk, owalk;
+ BMwEdgeringWalker *lwalk, owalk;
BMEdge *e = data;
lwalk = BMW_state_add(walker);
@@ -663,42 +797,53 @@ static void edgeringWalker_begin(BMWalker *walker, void *data)
/* rewin */
while (BMW_current_state(walker)) {
- owalk = *((edgeringWalker *)BMW_current_state(walker));
+ owalk = *((BMwEdgeringWalker *)BMW_current_state(walker));
BMW_walk(walker);
}
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");
BLI_ghash_insert(walker->visithash, lwalk->l->e, NULL);
}
-static void *edgeringWalker_yield(BMWalker *walker)
+static void *bmw_EdgeringWalker_yield(BMWalker *walker)
{
- edgeringWalker *lwalk = BMW_current_state(walker);
+ BMwEdgeringWalker *lwalk = BMW_current_state(walker);
if (!lwalk) {
return NULL;
}
- if (lwalk->l)
+ if (lwalk->l) {
return lwalk->l->e;
- else
+ }
+ else {
return lwalk->wireedge;
+ }
}
-static void *edgeringWalker_step(BMWalker *walker)
+static void *bmw_EdgeringWalker_step(BMWalker *walker)
{
- edgeringWalker *lwalk = BMW_current_state(walker);
+ BMwEdgeringWalker *lwalk = BMW_current_state(walker);
BMEdge *e;
BMLoop *l = lwalk->l /* , *origl = lwalk->l */;
- BMesh *bm = walker->bm;
+#ifdef BMW_EDGERING_NGON
int i, len;
+#endif
+
+#define EDGE_CHECK(e) (bmw_mask_check_edge(walker, e) && BM_edge_is_manifold(e))
BMW_state_remove(walker);
@@ -706,7 +851,7 @@ static void *edgeringWalker_step(BMWalker *walker)
return lwalk->wireedge;
e = l->e;
- if (!BM_edge_is_manifold(bm, e)) {
+ if (!EDGE_CHECK(e)) {
/* walker won't traverse to a non-manifold edge, but may
* be started on one, and should not traverse *away* from
* a non-manfold edge (non-manifold edges are never in an
@@ -714,6 +859,7 @@ static void *edgeringWalker_step(BMWalker *walker)
return e;
}
+#ifdef BMW_EDGERING_NGON
l = l->radial_next;
i = len = l->f->len;
@@ -722,7 +868,7 @@ static void *edgeringWalker_step(BMWalker *walker)
i -= 2;
}
- if ((len <= 0) || (len % 2 != 0) || !BM_edge_is_manifold(bm, l->e)) {
+ if ((len <= 0) || (len % 2 != 0) || !EDGE_CHECK(l->e)) {
l = lwalk->l;
i = len;
while (i > 0) {
@@ -730,11 +876,23 @@ static void *edgeringWalker_step(BMWalker *walker)
i -= 2;
}
}
+ /* only walk to manifold edge */
+ if ((l->f->len % 2 == 0) && EDGE_CHECK(l->e) &&
+ !BLI_ghash_haskey(walker->visithash, l->e))
+#else
+ l = l->radial_next;
+ l = l->next->next;
+
+ if ((l->f->len != 4) || !EDGE_CHECK(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) && EDGE_CHECK(l->e) &&
+ !BLI_ghash_haskey(walker->visithash, l->e))
+#endif
+ {
lwalk = BMW_state_add(walker);
lwalk->l = l;
lwalk->wireedge = NULL;
@@ -743,11 +901,13 @@ static void *edgeringWalker_step(BMWalker *walker)
}
return e;
+
+#undef EDGE_CHECK
}
-static void uvedgeWalker_begin(BMWalker *walker, void *data)
+static void bmw_UVEdgeWalker_begin(BMWalker *walker, void *data)
{
- uvedgeWalker *lwalk;
+ BMwUVEdgeWalker *lwalk;
BMLoop *l = data;
if (BLI_ghash_haskey(walker->visithash, l))
@@ -758,9 +918,9 @@ static void uvedgeWalker_begin(BMWalker *walker, void *data)
BLI_ghash_insert(walker->visithash, l, NULL);
}
-static void *uvedgeWalker_yield(BMWalker *walker)
+static void *bmw_UVEdgeWalker_yield(BMWalker *walker)
{
- uvedgeWalker *lwalk = BMW_current_state(walker);
+ BMwUVEdgeWalker *lwalk = BMW_current_state(walker);
if (!lwalk) {
return NULL;
@@ -769,9 +929,9 @@ static void *uvedgeWalker_yield(BMWalker *walker)
return lwalk->l;
}
-static void *uvedgeWalker_step(BMWalker *walker)
+static void *bmw_UVEdgeWalker_step(BMWalker *walker)
{
- uvedgeWalker *lwalk = BMW_current_state(walker);
+ BMwUVEdgeWalker *lwalk = BMW_current_state(walker);
BMLoop *l, *l2, *l3, *nl, *cl;
BMIter liter;
void *d1, *d2;
@@ -782,12 +942,13 @@ static void *uvedgeWalker_step(BMWalker *walker)
type = walker->bm->ldata.layers[walker->layer].type;
BMW_state_remove(walker);
-
- if (walker->mask_edge && !BMO_elem_flag_test(walker->bm, l->e, walker->mask_edge))
+
+ if (!bmw_mask_check_edge(walker, l->e)) {
return l;
+ }
/* go over loops around l->v and nl->v and see which ones share l and nl's
- * mloopuv's coordinates. in addition, push on l->next if necassary */
+ * mloopuv's coordinates. in addition, push on l->next if necessary */
for (i = 0; i < 2; i++) {
cl = i ? nl : l;
BM_ITER(l2, &liter, walker->bm, BM_LOOPS_OF_VERT, cl->v) {
@@ -796,13 +957,16 @@ static void *uvedgeWalker_step(BMWalker *walker)
rlen = BM_edge_face_count(l2->e);
for (j = 0; j < rlen; j++) {
- if (BLI_ghash_haskey(walker->visithash, l2))
+ if (BLI_ghash_haskey(walker->visithash, l2)) {
continue;
- if (walker->mask_edge && !(BMO_elem_flag_test(walker->bm, l2->e, walker->mask_edge))) {
- if (l2->v != cl->v)
+ }
+
+ if (!bmw_mask_check_edge(walker, l2->e)) {
+ if (l2->v != cl->v) {
continue;
+ }
}
-
+
l3 = l2->v != cl->v ? l2->next : l2;
d2 = CustomData_bmesh_get_layer_n(&walker->bm->ldata,
l3->head.data, walker->layer);
@@ -823,87 +987,87 @@ static void *uvedgeWalker_step(BMWalker *walker)
return l;
}
-static BMWalker shell_walker_type = {
- shellWalker_begin,
- shellWalker_step,
- shellWalker_yield,
- sizeof(shellWalker),
+static BMWalker bmw_ShellWalker_Type = {
+ bmw_ShellWalker_begin,
+ bmw_ShellWalker_step,
+ bmw_ShellWalker_yield,
+ sizeof(BMwShellWalker),
BMW_BREADTH_FIRST,
BM_EDGE, /* valid restrict masks */
};
-static BMWalker islandbound_walker_type = {
- islandboundWalker_begin,
- islandboundWalker_step,
- islandboundWalker_yield,
- sizeof(islandboundWalker),
+static BMWalker bmw_IslandboundWalker_Type = {
+ bmw_IslandboundWalker_begin,
+ bmw_IslandboundWalker_step,
+ bmw_IslandboundWalker_yield,
+ sizeof(BMwIslandboundWalker),
BMW_DEPTH_FIRST,
BM_FACE, /* valid restrict masks */
};
-static BMWalker island_walker_type = {
- islandWalker_begin,
- islandWalker_step,
- islandWalker_yield,
- sizeof(islandWalker),
+static BMWalker bmw_IslandWalker_Type = {
+ bmw_IslandWalker_begin,
+ bmw_IslandWalker_step,
+ bmw_IslandWalker_yield,
+ sizeof(BMwIslandWalker),
BMW_BREADTH_FIRST,
BM_EDGE | BM_FACE, /* valid restrict masks */
};
-static BMWalker loop_walker_type = {
- loopWalker_begin,
- loopWalker_step,
- loopWalker_yield,
- sizeof(loopWalker),
+static BMWalker bmw_LoopWalker_Type = {
+ bmw_LoopWalker_begin,
+ bmw_LoopWalker_step,
+ bmw_LoopWalker_yield,
+ sizeof(BMwLoopWalker),
BMW_DEPTH_FIRST,
0, /* valid restrict masks */ /* could add flags here but so far none are used */
};
-static BMWalker faceloop_walker_type = {
- faceloopWalker_begin,
- faceloopWalker_step,
- faceloopWalker_yield,
- sizeof(faceloopWalker),
+static BMWalker bmw_FaceLoopWalker_Type = {
+ bmw_FaceLoopWalker_begin,
+ bmw_FaceLoopWalker_step,
+ bmw_FaceLoopWalker_yield,
+ sizeof(BMwFaceLoopWalker),
BMW_DEPTH_FIRST,
0, /* valid restrict masks */ /* could add flags here but so far none are used */
};
-static BMWalker edgering_walker_type = {
- edgeringWalker_begin,
- edgeringWalker_step,
- edgeringWalker_yield,
- sizeof(edgeringWalker),
+static BMWalker bmw_EdgeringWalker_Type = {
+ bmw_EdgeringWalker_begin,
+ bmw_EdgeringWalker_step,
+ bmw_EdgeringWalker_yield,
+ sizeof(BMwEdgeringWalker),
BMW_DEPTH_FIRST,
0, /* valid restrict masks */ /* could add flags here but so far none are used */
};
-static BMWalker loopdata_region_walker_type = {
- uvedgeWalker_begin,
- uvedgeWalker_step,
- uvedgeWalker_yield,
- sizeof(uvedgeWalker),
+static BMWalker bmw_UVEdgeWalker_Type = {
+ bmw_UVEdgeWalker_begin,
+ bmw_UVEdgeWalker_step,
+ bmw_UVEdgeWalker_yield,
+ sizeof(BMwUVEdgeWalker),
BMW_DEPTH_FIRST,
BM_EDGE, /* valid restrict masks */
};
-static BMWalker connected_vertex_walker_type = {
- connectedVertexWalker_begin,
- connectedVertexWalker_step,
- connectedVertexWalker_yield,
- sizeof(connectedVertexWalker),
+static BMWalker bmw_ConnectedVertexWalker_Type = {
+ bmw_ConnectedVertexWalker_begin,
+ bmw_ConnectedVertexWalker_step,
+ bmw_ConnectedVertexWalker_yield,
+ sizeof(BMwConnectedVertexWalker),
BMW_BREADTH_FIRST,
BM_VERT, /* valid restrict masks */
};
BMWalker *bm_walker_types[] = {
- &shell_walker_type, /* BMW_SHELL */
- &loop_walker_type, /* BMW_LOOP */
- &faceloop_walker_type, /* BMW_FACELOOP */
- &edgering_walker_type, /* BMW_EDGERING */
- &loopdata_region_walker_type, /* BMW_LOOPDATA_ISLAND */
- &islandbound_walker_type, /* BMW_ISLANDBOUND */
- &island_walker_type, /* BMW_ISLAND */
- &connected_vertex_walker_type, /* BMW_CONNECTED_VERTEX */
+ &bmw_ShellWalker_Type, /* BMW_SHELL */
+ &bmw_LoopWalker_Type, /* BMW_LOOP */
+ &bmw_FaceLoopWalker_Type, /* BMW_FACELOOP */
+ &bmw_EdgeringWalker_Type, /* BMW_EDGERING */
+ &bmw_UVEdgeWalker_Type, /* BMW_LOOPDATA_ISLAND */
+ &bmw_IslandboundWalker_Type, /* BMW_ISLANDBOUND */
+ &bmw_IslandWalker_Type, /* BMW_ISLAND */
+ &bmw_ConnectedVertexWalker_Type, /* BMW_CONNECTED_VERTEX */
};
-int bm_totwalkers = sizeof(bm_walker_types) / sizeof(*bm_walker_types);
+const int bm_totwalkers = sizeof(bm_walker_types) / sizeof(*bm_walker_types);
diff --git a/source/blender/bmesh/intern/bmesh_walkers_private.h b/source/blender/bmesh/intern/bmesh_walkers_private.h
index 963018856ad..fc563932c3c 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_private.h
+++ b/source/blender/bmesh/intern/bmesh_walkers_private.h
@@ -30,60 +30,62 @@
*/
extern BMWalker *bm_walker_types[];
-extern int bm_totwalkers;
+extern const int bm_totwalkers;
-/* Pointer hiding*/
-typedef struct bmesh_walkerGeneric {
+/* Pointer hiding */
+typedef struct BMwGenericWalker {
Link link;
int depth;
-} bmesh_walkerGeneric;
+} BMwGenericWalker;
-typedef struct shellWalker {
- bmesh_walkerGeneric header;
+typedef struct BMwShellWalker {
+ BMwGenericWalker header;
BMEdge *curedge;
-} shellWalker;
+} BMwShellWalker;
-typedef struct islandboundWalker {
- bmesh_walkerGeneric header;
+typedef struct BMwIslandboundWalker {
+ BMwGenericWalker header;
BMLoop *base;
BMVert *lastv;
BMLoop *curloop;
-} islandboundWalker;
+} BMwIslandboundWalker;
-typedef struct islandWalker {
- bmesh_walkerGeneric header;
+typedef struct BMwIslandWalker {
+ BMwGenericWalker header;
BMFace *cur;
-} islandWalker;
+} BMwIslandWalker;
-typedef struct loopWalker {
- bmesh_walkerGeneric header;
+typedef struct BMwLoopWalker {
+ BMwGenericWalker header;
BMEdge *cur, *start;
BMVert *lastv, *startv;
- int startrad, stage2;
-} loopWalker;
+ BMFace *f_hub;
+ short is_boundary; /* boundary looping changes behavior */
+ short is_single; /* single means the edge verts are only connected to 1 face */
+} BMwLoopWalker;
-typedef struct faceloopWalker {
- bmesh_walkerGeneric header;
+typedef struct BMwFaceLoopWalker {
+ BMwGenericWalker header;
BMLoop *l;
int nocalc;
-} faceloopWalker;
+} BMwFaceLoopWalker;
-typedef struct edgeringWalker {
- bmesh_walkerGeneric header;
+typedef struct BMwEdgeringWalker {
+ BMwGenericWalker header;
BMLoop *l;
BMEdge *wireedge;
-} edgeringWalker;
+} BMwEdgeringWalker;
-typedef struct uvedgeWalker {
- bmesh_walkerGeneric header;
+typedef struct BMwUVEdgeWalker {
+ BMwGenericWalker header;
BMLoop *l;
-} uvedgeWalker;
+} BMwUVEdgeWalker;
-typedef struct connectedVertexWalker {
- bmesh_walkerGeneric header;
+typedef struct BMwConnectedVertexWalker {
+ BMwGenericWalker header;
BMVert *curvert;
-} connectedVertexWalker;
+} BMwConnectedVertexWalker;
#endif /* __BMESH_WALKERS_PRIVATE_H__ */
diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c
index 6cdea3657f6..ab57c80ff1a 100644
--- a/source/blender/bmesh/operators/bmo_bevel.c
+++ b/source/blender/bmesh/operators/bmo_bevel.c
@@ -59,7 +59,7 @@ static void calc_corner_co(BMesh *bm, BMLoop *l, const float fac, float r_co[3],
copy_v3_v3(l_co, l->v->co);
copy_v3_v3(l_co_next, l->next->v->co);
- /* calculate norma */
+ /* calculate normal */
sub_v3_v3v3(l_vec_prev, l_co_prev, l_co);
sub_v3_v3v3(l_vec_next, l_co_next, l_co);
@@ -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;
}
}
@@ -550,8 +551,8 @@ 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 */
+ /* angle happens not to be used. why? - not sure it just isn't - campbell.
+ * leave this in in case we need to use it later */
#if 0
float ang;
#endif
@@ -876,6 +877,6 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op)
BLI_array_free(edges);
BLI_array_free(faces);
- BMO_slot_from_flag(bm, op, "face_spans", FACE_SPAN, BM_FACE);
- BMO_slot_from_flag(bm, op, "face_holes", FACE_HOLE, BM_FACE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "face_spans", BM_FACE, FACE_SPAN);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "face_holes", BM_FACE, FACE_HOLE);
}
diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c
index d2d4eaf8129..5c60704d0ee 100644
--- a/source/blender/bmesh/operators/bmo_connect.c
+++ b/source/blender/bmesh/operators/bmo_connect.c
@@ -22,11 +22,11 @@
#include "MEM_guardedalloc.h"
-
-#include "bmesh.h"
-
#include "BLI_math.h"
#include "BLI_array.h"
+#include "BLI_utildefines.h"
+
+#include "bmesh.h"
#define VERT_INPUT 1
#define EDGE_OUT 1
@@ -45,13 +45,15 @@ void bmo_connectverts_exec(BMesh *bm, BMOperator *op)
BLI_array_declare(verts);
int i;
- BMO_slot_buffer_flag_enable(bm, op, "verts", VERT_INPUT, BM_VERT);
+ BMO_slot_buffer_flag_enable(bm, op, "verts", BM_VERT, VERT_INPUT);
for (f = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, NULL); f; f = BM_iter_step(&iter)) {
BLI_array_empty(loops);
BLI_array_empty(verts);
- if (BMO_elem_flag_test(bm, f, FACE_NEW)) continue;
+ if (BMO_elem_flag_test(bm, f, FACE_NEW)) {
+ continue;
+ }
l = BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, f);
lastl = NULL;
@@ -74,7 +76,9 @@ void bmo_connectverts_exec(BMesh *bm, BMOperator *op)
}
}
- if (BLI_array_count(loops) == 0) continue;
+ if (BLI_array_count(loops) == 0) {
+ continue;
+ }
if (BLI_array_count(loops) > 2) {
BLI_array_growone(loops);
@@ -87,7 +91,9 @@ void bmo_connectverts_exec(BMesh *bm, BMOperator *op)
BM_face_legal_splits(bm, f, (BMLoop *(*)[2])loops, BLI_array_count(loops) / 2);
for (i = 0; i < BLI_array_count(loops) / 2; i++) {
- if (loops[i * 2] == NULL) continue;
+ if (loops[i * 2] == NULL) {
+ continue;
+ }
BLI_array_growone(verts);
verts[BLI_array_count(verts) - 1] = loops[i * 2]->v;
@@ -97,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) {
@@ -110,7 +116,7 @@ void bmo_connectverts_exec(BMesh *bm, BMOperator *op)
}
}
- BMO_slot_from_flag(bm, op, "edgeout", EDGE_OUT, BM_EDGE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "edgeout", BM_EDGE, EDGE_OUT);
BLI_array_free(loops);
BLI_array_free(verts);
@@ -135,7 +141,15 @@ static BMVert *get_outer_vert(BMesh *bm, BMEdge *e)
/* Clamp x to the interval {0..len-1}, with wrap-around */
static int clamp_index(const int x, const int len)
{
- return (x < 0) ? (len - (-x % len)) : (x % len);
+ if (x >= 0)
+ return x % len;
+ else {
+ int r = len - (-x % len);
+ if(r == len)
+ return len - 1;
+ else
+ return r;
+ }
}
/* There probably is a better way to swap BLI_arrays, or if there
@@ -202,7 +216,7 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
BMEdge *e, *nexte;
int c = 0, cl1 = 0, cl2 = 0;
- BMO_slot_buffer_flag_enable(bm, op, "edges", EDGE_MARK, BM_EDGE);
+ BMO_slot_buffer_flag_enable(bm, op, "edges", BM_EDGE, EDGE_MARK);
BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) {
if (!BMO_elem_flag_test(bm, e, EDGE_DONE)) {
diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c
index 8798155845e..876d440a0fa 100644
--- a/source/blender/bmesh/operators/bmo_create.c
+++ b/source/blender/bmesh/operators/bmo_create.c
@@ -68,7 +68,7 @@ typedef struct EdgeData {
typedef struct VertData {
BMEdge *e;
- float no[3], offco[3], sco[3]; /* offco is vertex coordinate slightly offset randoml */
+ float no[3], offco[3], sco[3]; /* offco is vertex coordinate slightly offset randomly */
int tag;
} VertData;
@@ -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) \
- )
-
+BLI_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,12 +227,14 @@ 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 */
+ }
+
+ /* do two passes, going forward then backward */
for (i = 0; i < 2; i++) {
BLI_smallhash_init(hash);
@@ -400,7 +401,7 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
normalize_v3(no);
}
- /* generate plane-flattened coordinate */
+ /* generate plane-flattened coordinates */
for (i = 0; i < totedge; i++) {
BMEdge *e1;
BMVert *v2;
@@ -465,7 +466,7 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
copy_v3_v3(cent, v->co);
for (j = 0; j < 3; j++) {
- float fac = (BLI_frand() - 0.5f)*size;
+ float fac = (BLI_frand() - 0.5f) * size;
cent[j] += fac;
}
@@ -494,7 +495,6 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
BMVert *v1, *v2, *v3;
VertData *vd1, *vd2, *vd3;
float vec1[3], vec2[3], vec3[3], n1[3], n2[3], n3[3];
- int s1, s2, s3;
e1 = edges[(i + totedge - 1) % totedge];
e2 = edges[i];
@@ -516,17 +516,26 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
cross_v3_v3v3(n2, vec2, vec3);
cross_v3_v3v3(n3, vec1, vec3);
+ /* this case happens often enough and probably not worth bothering users with,
+ * maybe enable for debugging code but not for everyday use - campbell */
+#if 0
/* Other way to determine if two vectors approach are (nearly) parallel: the
* cross product of the two vectors will approach zero */
- s1 = (dot_v3v3(n1, n1) < (0.0f + FLT_EPSILON * 10));
- s2 = (dot_v3v3(n2, n2) < (0.0f + FLT_EPSILON * 10));
- s3 = (totedge < 3) ? 0 : (dot_v3v3(n3, n3) < (0.0f + FLT_EPSILON * 10));
+ {
+ int s1, s2, s3;
+ s1 = (dot_v3v3(n1, n1) < (0.0f + FLT_EPSILON * 10));
+ s2 = (dot_v3v3(n2, n2) < (0.0f + FLT_EPSILON * 10));
+ s3 = (totedge < 3) ? 0 : (dot_v3v3(n3, n3) < (0.0f + FLT_EPSILON * 10));
- normalize_v3(n1); normalize_v3(n2); normalize_v3(n3);
-
- if (s1 || s2 || s3) {
- fprintf(stderr, "%s: s1: %d, s2: %d, s3: %dx (bmesh internal error)\n", __func__, s1, s2, s3);
+ if (s1 || s2 || s3) {
+ fprintf(stderr, "%s: s1: %d, s2: %d, s3: %dx (bmesh internal error)\n", __func__, s1, s2, s3);
+ }
}
+#endif
+
+ normalize_v3(n1); normalize_v3(n2); normalize_v3(n3);
+
+
if (dot_v3v3(n1, n2) < 0.0f) {
if (dot_v3v3(n1, n3) >= 0.0f + FLT_EPSILON * 10) {
SWAP(BMEdge *, edges[i], edges[(i + 1) % totedge]);
@@ -621,8 +630,8 @@ static PathBase *edge_pathbase_new(void)
{
PathBase *pb = MEM_callocN(sizeof(PathBase), "PathBase");
- pb->nodepool = BLI_mempool_create(sizeof(EPathNode), 1, 512, TRUE, FALSE);
- pb->pathpool = BLI_mempool_create(sizeof(EPath), 1, 512, TRUE, FALSE);
+ pb->nodepool = BLI_mempool_create(sizeof(EPathNode), 1, 512, BLI_MEMPOOL_SYSMALLOC);
+ pb->pathpool = BLI_mempool_create(sizeof(EPath), 1, 512, BLI_MEMPOOL_SYSMALLOC);
return pb;
}
@@ -748,7 +757,7 @@ static EPath *edge_find_shortest_path(BMesh *bm, BMOperator *op, BMEdge *edge, E
v1 = last->v;
if (v1 == endv) {
- /* make sure this path loop doesn't already exist */
+ /* make sure this path loop doesn't already exists */
i = 0;
BLI_array_empty(verts);
for (i = 0, node = path->nodes.first; node; node = node->next, i++) {
@@ -813,7 +822,7 @@ static EPath *edge_find_shortest_path(BMesh *bm, BMOperator *op, BMEdge *edge, E
continue;
}
- /* add path back into hea */
+ /* add path back into heap */
BLI_heap_insert(heap, path->weight, path);
/* put v2 in gh ma */
@@ -857,6 +866,16 @@ static int count_edge_faces(BMesh *bm, BMEdge *e)
return i;
}
+BLI_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;
@@ -885,8 +904,8 @@ void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op)
edata = MEM_callocN(sizeof(EdgeData) * bm->totedge, "EdgeData");
vdata = MEM_callocN(sizeof(VertData) * bm->totvert, "VertData");
- BMO_slot_buffer_flag_enable(bm, op, "edges", EDGE_MARK, BM_EDGE);
- BMO_slot_buffer_flag_enable(bm, op, "excludefaces", FACE_IGNORE, BM_FACE);
+ BMO_slot_buffer_flag_enable(bm, op, "edges", BM_EDGE, EDGE_MARK);
+ BMO_slot_buffer_flag_enable(bm, op, "excludefaces", BM_FACE, FACE_IGNORE);
BM_mesh_elem_index_ensure(bm, BM_VERT);
@@ -969,12 +988,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 +998,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 +1026,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];
}
@@ -1035,7 +1053,7 @@ void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op)
edge_free_path(pathbase, path);
}
- BMO_slot_from_flag(bm, op, "faceout", FACE_NEW, BM_FACE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "faceout", BM_FACE, FACE_NEW);
BLI_array_free(edges);
BLI_array_free(verts);
@@ -1075,7 +1093,7 @@ void bmo_edgenet_prepare(BMesh *bm, BMOperator *op)
int ok = 1;
int i, count;
- BMO_slot_buffer_flag_enable(bm, op, "edges", EDGE_MARK, BM_EDGE);
+ BMO_slot_buffer_flag_enable(bm, op, "edges", BM_EDGE, EDGE_MARK);
/* validate that each edge has at most one other tagged edge in the
* disk cycle around each of it's vertices */
@@ -1232,13 +1250,16 @@ void bmo_edgenet_prepare(BMesh *bm, BMOperator *op)
}
}
- BMO_slot_from_flag(bm, op, "edgeout", ELE_NEW, BM_EDGE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "edgeout", BM_EDGE, ELE_NEW);
BLI_array_free(edges1);
BLI_array_free(edges2);
}
-/* this is essentially new fke */
+/* This is what runs when pressing the F key
+ * doing the best thing here isn't 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;
@@ -1330,17 +1351,17 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
/* --- end special case support, continue as normal --- */
/* call edgenet create */
- /* call edgenet prepare op so additional face creation cases wor */
+ /* call edgenet prepare op so additional face creation cases wore */
BMO_op_initf(bm, &op2, "edgenet_prepare edges=%fe", ELE_NEW);
BMO_op_exec(bm, &op2);
- BMO_slot_buffer_flag_enable(bm, &op2, "edgeout", ELE_NEW, BM_EDGE);
+ BMO_slot_buffer_flag_enable(bm, &op2, "edgeout", BM_EDGE, ELE_NEW);
BMO_op_finish(bm, &op2);
BMO_op_initf(bm, &op2, "edgenet_fill edges=%fe use_fill_check=%b", ELE_NEW, TRUE);
BMO_op_exec(bm, &op2);
- /* return if edge net create did somethin */
- if (BMO_slot_buf_count(bm, &op2, "faceout")) {
+ /* return if edge net create did something */
+ if (BMO_slot_buffer_count(bm, &op2, "faceout")) {
BMO_slot_copy(&op2, op, "faceout", "faceout");
BMO_op_finish(bm, &op2);
return;
@@ -1353,7 +1374,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
BMO_op_exec(bm, &op2);
/* if we dissolved anything, then return */
- if (BMO_slot_buf_count(bm, &op2, "regionout")) {
+ if (BMO_slot_buffer_count(bm, &op2, "regionout")) {
BMO_slot_copy(&op2, op, "regionout", "faceout");
BMO_op_finish(bm, &op2);
return;
@@ -1361,7 +1382,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
BMO_op_finish(bm, &op2);
- /* now, count how many verts we hav */
+ /* now, count how many verts we have */
amount = 0;
BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
if (BMO_elem_flag_test(bm, v, ELE_NEW)) {
@@ -1373,46 +1394,74 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
}
if (amount == 2) {
- /* create edg */
+ /* create edge */
e = BM_edge_create(bm, verts[0], verts[1], NULL, TRUE);
BMO_elem_flag_enable(bm, e, ELE_OUT);
}
- else if (amount == 3) {
- /* create triangl */
- f = BM_face_create_quad_tri(bm, verts[0], verts[1], verts[2], NULL, NULL, TRUE);
+ else if (0) { /* nice feature but perhaps it should be a different tool? */
+
+ /* tricky feature for making a line/edge from selection history...
+ *
+ * Rather then do nothing, when 5+ verts are selected, check if they are in our history,
+ * when this is so, we can make edges from them, but _not_ a face,
+ * if it is the intention to make a face the user can just hit F again since there will be edges next
+ * time around.
+ *
+ * if all history verts have ELE_NEW flagged and the total number of history verts == totv,
+ * then we know the history contains all verts here and we can continue...
+ */
+
+ BMEditSelection *ese;
+ int tot_ese_v = 0;
+
+ for (ese = bm->selected.first; ese; ese = ese->next) {
+ if (ese->htype == BM_VERT) {
+ if (BMO_elem_flag_test(bm, (BMElemF *)ese->ele, ELE_NEW)) {
+ tot_ese_v++;
+ }
+ else {
+ /* unflagged vert means we are not in sync */
+ tot_ese_v = -1;
+ break;
+ }
+ }
+ }
- if (f) {
- BMO_elem_flag_enable(bm, f, ELE_OUT);
+ if (tot_ese_v == totv) {
+ BMVert *v_prev = NULL;
+ /* yes, all select-history verts are accounted for, now make edges */
+
+ for (ese = bm->selected.first; ese; ese = ese->next) {
+ if (ese->htype == BM_VERT) {
+ v = (BMVert *)ese->ele;
+ if (v_prev) {
+ e = BM_edge_create(bm, v, v_prev, NULL, TRUE);
+ BMO_elem_flag_enable(bm, e, ELE_OUT);
+ }
+ v_prev = v;
+ }
+ }
}
+ /* done creating edges */
}
- else if (amount == 4) {
- f = NULL;
+ else if (amount > 2) {
+ /* TODO, all these verts may be connected by edges.
+ * we should check on this before assuming they are a random set of verts */
- /* the order of vertices can be anything, 6 cases to check */
- if (is_quad_convex_v3(verts[0]->co, verts[1]->co, verts[2]->co, verts[3]->co)) {
- f = BM_face_create_quad_tri(bm, verts[0], verts[1], verts[2], verts[3], NULL, TRUE);
- }
- else if (is_quad_convex_v3(verts[0]->co, verts[2]->co, verts[3]->co, verts[1]->co)) {
- f = BM_face_create_quad_tri(bm, verts[0], verts[2], verts[3], verts[1], NULL, TRUE);
- }
- else if (is_quad_convex_v3(verts[0]->co, verts[2]->co, verts[1]->co, verts[3]->co)) {
- f = BM_face_create_quad_tri(bm, verts[0], verts[2], verts[1], verts[3], NULL, TRUE);
- }
- else if (is_quad_convex_v3(verts[0]->co, verts[1]->co, verts[3]->co, verts[2]->co)) {
- f = BM_face_create_quad_tri(bm, verts[0], verts[1], verts[3], verts[2], NULL, TRUE);
- }
- else if (is_quad_convex_v3(verts[0]->co, verts[3]->co, verts[2]->co, verts[1]->co)) {
- f = BM_face_create_quad_tri(bm, verts[0], verts[3], verts[2], verts[1], NULL, TRUE);
- }
- else if (is_quad_convex_v3(verts[0]->co, verts[3]->co, verts[1]->co, verts[2]->co)) {
- f = BM_face_create_quad_tri(bm, verts[0], verts[3], verts[1], verts[2], NULL, TRUE);
- }
- else {
- printf("cannot find nice quad from concave set of vertices\n");
+ BMVert **vert_arr = MEM_mallocN(sizeof(BMVert **) * totv, __func__);
+ int i = 0;
+
+ BMO_ITER(v, &oiter, bm, op, "geom", BM_VERT) {
+ vert_arr[i] = v;
+ i++;
}
+ f = BM_face_create_ngon_vcloud(bm, vert_arr, totv, TRUE);
+
if (f) {
BMO_elem_flag_enable(bm, f, ELE_OUT);
}
+
+ MEM_freeN(vert_arr);
}
}
diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c
index 4542b3fd917..40650f45fed 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
@@ -47,13 +47,15 @@ static int UNUSED_FUNCTION(check_hole_in_region)(BMesh *bm, BMFace *f)
/* checks if there are any unmarked boundary edges in the face regio */
BMW_init(&regwalker, bm, BMW_ISLAND,
- BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP, FACE_MARK,
+ BMW_MASK_NOP, BMW_MASK_NOP, FACE_MARK,
+ BMW_FLAG_NOP, /* BMESH_TODO - should be BMW_FLAG_TEST_HIDDEN ? */
BMW_NIL_LAY);
+
f2 = BMW_begin(&regwalker, f);
for ( ; f2; f2 = BMW_step(&regwalker)) {
l2 = BM_iter_new(&liter2, bm, BM_LOOPS_OF_FACE, f2);
for ( ; l2; l2 = BM_iter_step(&liter2)) {
- l3 = bmesh_radial_loop_next(l2);
+ l3 = l2->radial_next;
if ( BMO_elem_flag_test(bm, l3->f, FACE_MARK) !=
BMO_elem_flag_test(bm, l2->f, FACE_MARK))
{
@@ -92,18 +94,22 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
}
}
- BMO_slot_buffer_flag_enable(bm, op, "faces", FACE_MARK, BM_FACE);
+ BMO_slot_buffer_flag_enable(bm, op, "faces", BM_FACE, FACE_MARK);
/* collect region */
BMO_ITER(f, &oiter, bm, op, "faces", BM_FACE) {
- if (!BMO_elem_flag_test(bm, f, FACE_MARK)) continue;
+
+ if (!BMO_elem_flag_test(bm, f, FACE_MARK)) {
+ continue;
+ }
BLI_array_empty(faces);
faces = NULL; /* forces different allocatio */
/* yay, walk */
BMW_init(&regwalker, bm, BMW_ISLAND,
- BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP, FACE_MARK,
+ BMW_MASK_NOP, BMW_MASK_NOP, FACE_MARK,
+ BMW_FLAG_NOP, /* BMESH_TODO - should be BMW_FLAG_TEST_HIDDEN ? */
BMW_NIL_LAY);
f2 = BMW_begin(&regwalker, f);
@@ -171,12 +177,14 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
}
}
- if (BMO_error_occurred(bm)) goto cleanup;
+ if (BMO_error_occurred(bm)) {
+ goto cleanup;
+ }
- BMO_slot_from_flag(bm, op, "regionout", FACE_NEW, BM_FACE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "regionout", BM_FACE, FACE_NEW);
cleanup:
- /* free/cleanu */
+ /* free/cleanup */
for (i = 0; i < BLI_array_count(regions); i++) {
if (regions[i]) MEM_freeN(regions[i]);
}
@@ -193,17 +201,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);
}
}
@@ -251,13 +258,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);
}
}
@@ -319,14 +325,12 @@ static int test_extra_verts(BMesh *bm, BMVert *v)
}
void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op)
{
- BMOpSlot *vinput;
BMIter iter, fiter;
BMVert *v;
BMFace *f;
/* int i; */
-
- vinput = BMO_slot_get(op, "verts");
- BMO_slot_buffer_flag_enable(bm, op, "verts", VERT_MARK, BM_VERT);
+
+ BMO_slot_buffer_flag_enable(bm, op, "verts", BM_VERT, VERT_MARK);
for (v = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); v; v = BM_iter_step(&iter)) {
if (BMO_elem_flag_test(bm, v, VERT_MARK)) {
@@ -436,7 +440,8 @@ void dummy_exec(BMesh *bm, BMOperator *op)
BM_face_kill(bm, f);
BM_edge_kill(bm, fe);
}
- } /* else if (f->len == 3) {
+ }
+ /* else if (f->len == 3) {
BMEdge *ed[3];
BMVert *vt[3];
BMLoop *lp[3];
@@ -463,14 +468,14 @@ void dummy_exec(BMesh *bm, BMOperator *op)
#endif
/**/
-typedef struct DissolveElemWeight_t {
+typedef struct DissolveElemWeight {
BMHeader *ele;
float weight;
-} DissolveElemWeight_t;
+} DissolveElemWeight;
static int dissolve_elem_cmp(const void *a1, const void *a2)
{
- const struct DissolveElemWeight_t *d1 = a1, *d2 = a2;
+ const struct DissolveElemWeight *d1 = a1, *d2 = a2;
if (d1->weight > d2->weight) return 1;
else if (d1->weight < d2->weight) return -1;
@@ -483,8 +488,8 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op)
BMOpSlot *vinput = BMO_slot_get(op, "verts");
const float angle_max = (float)M_PI / 2.0f;
const float angle_limit = minf(angle_max, BMO_slot_float_get(op, "angle_limit"));
- DissolveElemWeight_t *weight_elems = MEM_mallocN(MAX2(einput->len, vinput->len) *
- sizeof(DissolveElemWeight_t), __func__);
+ DissolveElemWeight *weight_elems = MEM_mallocN(MAX2(einput->len, vinput->len) *
+ sizeof(DissolveElemWeight), __func__);
int i, tot_found;
/* --- first edges --- */
@@ -492,7 +497,7 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op)
/* go through and split edge */
for (i = 0, tot_found = 0; i < einput->len; i++) {
BMEdge *e = ((BMEdge **)einput->data.p)[i];
- const float angle = BM_edge_face_angle(bm, e);
+ const float angle = BM_edge_face_angle(e);
if (angle < angle_limit) {
weight_elems[i].ele = (BMHeader *)e;
@@ -506,17 +511,17 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op)
}
if (tot_found != 0) {
- qsort(weight_elems, einput->len, sizeof(DissolveElemWeight_t), dissolve_elem_cmp);
+ qsort(weight_elems, einput->len, sizeof(DissolveElemWeight), dissolve_elem_cmp);
for (i = 0; i < tot_found; i++) {
BMEdge *e = (BMEdge *)weight_elems[i].ele;
- /* check twice because cumulative effect could disolve over angle limit */
- if (BM_edge_face_angle(bm, e) < angle_limit) {
+ /* check twice because cumulative effect could dissolve over angle limit */
+ if (BM_edge_face_angle(e) < angle_limit) {
BMFace *nf = BM_faces_join_pair(bm, e->l->f,
e->l->radial_next->f,
e); /* join faces */
- /* there may be some errors, we dont mind, just move on */
+ /* there may be some errors, we don't mind, just move on */
if (nf == NULL) {
BMO_error_clear(bm);
}
@@ -527,7 +532,7 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op)
/* --- second verts --- */
for (i = 0, tot_found = 0; i < vinput->len; i++) {
BMVert *v = ((BMVert **)vinput->data.p)[i];
- const float angle = BM_vert_edge_angle(bm, v);
+ const float angle = BM_vert_edge_angle(v);
if (angle < angle_limit) {
weight_elems[i].ele = (BMHeader *)v;
@@ -541,12 +546,12 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op)
}
if (tot_found != 0) {
- qsort(weight_elems, vinput->len, sizeof(DissolveElemWeight_t), dissolve_elem_cmp);
+ qsort(weight_elems, vinput->len, sizeof(DissolveElemWeight), dissolve_elem_cmp);
for (i = 0; i < tot_found; i++) {
BMVert *v = (BMVert *)weight_elems[i].ele;
- /* check twice because cumulative effect could disolve over angle limit */
- if (BM_vert_edge_angle(bm, v) < angle_limit) {
+ /* check twice because cumulative effect could dissolve over angle limit */
+ if (BM_vert_edge_angle(v) < angle_limit) {
BM_vert_collapse_edge(bm, v->e, v, TRUE); /* join edges */
}
}
diff --git a/source/blender/bmesh/operators/bmo_dupe.c b/source/blender/bmesh/operators/bmo_dupe.c
index 20f1920c07f..18ad784dc94 100644
--- a/source/blender/bmesh/operators/bmo_dupe.c
+++ b/source/blender/bmesh/operators/bmo_dupe.c
@@ -29,41 +29,39 @@
#include "bmesh.h"
/* local flag define */
-#define DUPE_INPUT 1 /* input from operato */
-#define DUPE_NEW 2
-#define DUPE_DONE 4
-#define DUPE_MAPPED 8
+#define DUPE_INPUT 1 /* input from operator */
+#define DUPE_NEW 2
+#define DUPE_DONE 4
+#define DUPE_MAPPED 8
-/*
- * COPY VERTEX
- *
- * Copy an existing vertex from one bmesh to another.
+/**
+ * COPY VERTEX
*
+ * Copy an existing vertex from one bmesh to another.
*/
static BMVert *copy_vertex(BMesh *source_mesh, BMVert *source_vertex, BMesh *target_mesh, GHash *vhash)
{
BMVert *target_vertex = NULL;
- /* Create a new verte */
- target_vertex = BM_vert_create(target_mesh, source_vertex->co, NULL);
+ /* Create a new vertex */
+ target_vertex = BM_vert_create(target_mesh, source_vertex->co, NULL);
- /* Insert new vertex into the vert has */
+ /* Insert new vertex into the vert hash */
BLI_ghash_insert(vhash, source_vertex, target_vertex);
- /* Copy attribute */
+ /* Copy attributes */
BM_elem_attrs_copy(source_mesh, target_mesh, source_vertex, target_vertex);
- /* Set internal op flag */
+ /* Set internal op flags */
BMO_elem_flag_enable(target_mesh, target_vertex, DUPE_NEW);
return target_vertex;
}
-/*
+/**
* COPY EDGE
*
* Copy an existing edge from one bmesh to another.
- *
*/
static BMEdge *copy_edge(BMOperator *op, BMesh *source_mesh,
BMEdge *source_edge, BMesh *target_mesh,
@@ -92,10 +90,10 @@ static BMEdge *copy_edge(BMOperator *op, BMesh *source_mesh,
target_vert1 = BLI_ghash_lookup(vhash, source_edge->v1);
target_vert2 = BLI_ghash_lookup(vhash, source_edge->v2);
- /* Create a new edg */
+ /* Create a new edge */
target_edge = BM_edge_create(target_mesh, target_vert1, target_vert2, NULL, FALSE);
- /* add to new/old edge map if necassar */
+ /* add to new/old edge map if necassary */
if (rlen < 2) {
/* not sure what non-manifold cases of greater then three
* radial should do. */
@@ -115,10 +113,10 @@ static BMEdge *copy_edge(BMOperator *op, BMesh *source_mesh,
return target_edge;
}
-/*
+/**
* COPY FACE
*
- * Copy an existing face from one bmesh to another.
+ * Copy an existing face from one bmesh to another.
*/
static BMFace *copy_face(BMOperator *op, BMesh *source_mesh,
@@ -149,19 +147,17 @@ static BMFace *copy_face(BMOperator *op, BMesh *source_mesh,
edar[i] = BLI_ghash_lookup(ehash, source_loop->e);
}
- /* create new fac */
+ /* create new face */
target_face = BM_face_create(target_mesh, vtar, edar, source_face->len, FALSE);
- BMO_slot_map_ptr_insert(source_mesh, op,
- "facemap", source_face, target_face);
- BMO_slot_map_ptr_insert(source_mesh, op,
- "facemap", target_face, source_face);
+ BMO_slot_map_ptr_insert(source_mesh, op, "facemap", source_face, target_face);
+ BMO_slot_map_ptr_insert(source_mesh, op, "facemap", target_face, source_face);
BM_elem_attrs_copy(source_mesh, target_mesh, source_face, target_face);
- /* mark the face for outpu */
+ /* mark the face for output */
BMO_elem_flag_enable(target_mesh, target_face, DUPE_NEW);
- /* copy per-loop custom dat */
+ /* copy per-loop custom data */
BM_ITER(source_loop, &iter, source_mesh, BM_LOOPS_OF_FACE, source_face) {
BM_ITER(target_loop, &iter2, target_mesh, BM_LOOPS_OF_FACE, target_face) {
if (BLI_ghash_lookup(vhash, source_loop->v) == target_loop->v) {
@@ -174,11 +170,12 @@ static BMFace *copy_face(BMOperator *op, BMesh *source_mesh,
return target_face;
}
-/*
+/**
* COPY MESH
*
* Internal Copy function.
*/
+
static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target)
{
@@ -191,43 +188,40 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target)
BMVert **vtar = NULL;
BMEdge **edar = NULL;
- BMIter verts;
- BMIter edges;
- BMIter faces;
-
- GHash *vhash;
- GHash *ehash;
+ BMIter viter, eiter, fiter;
+ GHash *vhash, *ehash;
- /* initialize pointer hashe */
+ /* initialize pointer hashes */
vhash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh dupeops v");
ehash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh dupeops e");
-
- for (v = BM_iter_new(&verts, source, BM_VERTS_OF_MESH, source); v; v = BM_iter_step(&verts)) {
- if ( BMO_elem_flag_test(source, v, DUPE_INPUT) &&
+
+ /* duplicate flagged vertices */
+ BM_ITER(v, &viter, source, BM_VERTS_OF_MESH, source) {
+ if (BMO_elem_flag_test(source, v, DUPE_INPUT) &&
!BMO_elem_flag_test(source, v, DUPE_DONE))
{
BMIter iter;
- int iso = 1;
+ int isolated = 1;
v2 = copy_vertex(source, v, target, vhash);
BM_ITER(f, &iter, source, BM_FACES_OF_VERT, v) {
if (BMO_elem_flag_test(source, f, DUPE_INPUT)) {
- iso = 0;
+ isolated = 0;
break;
}
}
- if (iso) {
+ if (isolated) {
BM_ITER(e, &iter, source, BM_EDGES_OF_VERT, v) {
if (BMO_elem_flag_test(source, e, DUPE_INPUT)) {
- iso = 0;
+ isolated = 0;
break;
}
}
}
- if (iso) {
+ if (isolated) {
BMO_slot_map_ptr_insert(source, op, "isovertmap", v, v2);
}
@@ -235,12 +229,12 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target)
}
}
- /* now we dupe all the edge */
- for (e = BM_iter_new(&edges, source, BM_EDGES_OF_MESH, source); e; e = BM_iter_step(&edges)) {
- if ( BMO_elem_flag_test(source, e, DUPE_INPUT) &&
+ /* now we dupe all the edges */
+ BM_ITER(e, &eiter, source, BM_EDGES_OF_MESH, source) {
+ if (BMO_elem_flag_test(source, e, DUPE_INPUT) &&
!BMO_elem_flag_test(source, e, DUPE_DONE))
{
- /* make sure that verts are copie */
+ /* make sure that verts are copied */
if (!BMO_elem_flag_test(source, e->v1, DUPE_DONE)) {
copy_vertex(source, e->v1, target, vhash);
BMO_elem_flag_enable(source, e->v1, DUPE_DONE);
@@ -249,27 +243,27 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target)
copy_vertex(source, e->v2, target, vhash);
BMO_elem_flag_enable(source, e->v2, DUPE_DONE);
}
- /* now copy the actual edg */
- copy_edge(op, source, e, target, vhash, ehash);
+ /* now copy the actual edge */
+ copy_edge(op, source, e, target, vhash, ehash);
BMO_elem_flag_enable(source, e, DUPE_DONE);
}
}
- /* first we dupe all flagged faces and their elements from sourc */
- for (f = BM_iter_new(&faces, source, BM_FACES_OF_MESH, source); f; f = BM_iter_step(&faces)) {
+ /* first we dupe all flagged faces and their elements from source */
+ BM_ITER(f, &fiter, source, BM_FACES_OF_MESH, source) {
if (BMO_elem_flag_test(source, f, DUPE_INPUT)) {
- /* vertex pas */
- for (v = BM_iter_new(&verts, source, BM_VERTS_OF_FACE, f); v; v = BM_iter_step(&verts)) {
+ /* vertex pass */
+ BM_ITER(v, &viter, source, BM_VERTS_OF_FACE, f) {
if (!BMO_elem_flag_test(source, v, DUPE_DONE)) {
copy_vertex(source, v, target, vhash);
BMO_elem_flag_enable(source, v, DUPE_DONE);
}
}
- /* edge pas */
- for (e = BM_iter_new(&edges, source, BM_EDGES_OF_FACE, f); e; e = BM_iter_step(&edges)) {
+ /* edge pass */
+ BM_ITER(e, &eiter, source, BM_EDGES_OF_FACE, f) {
if (!BMO_elem_flag_test(source, e, DUPE_DONE)) {
- copy_edge(op, source, e, target, vhash, ehash);
+ copy_edge(op, source, e, target, vhash, ehash);
BMO_elem_flag_enable(source, e, DUPE_DONE);
}
}
@@ -286,7 +280,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target)
}
}
- /* free pointer hashe */
+ /* free pointer hashes */
BLI_ghash_free(vhash, NULL, NULL);
BLI_ghash_free(ehash, NULL, NULL);
@@ -294,7 +288,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target)
BLI_array_free(edar); /* free edge pointer array */
}
-/*
+/**
* Duplicate Operator
*
* Duplicates verts, edges and faces of a mesh.
@@ -313,7 +307,6 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target)
* BMOP_DUPE_VNEW: Buffer containing pointers to the new mesh vertices
* BMOP_DUPE_ENEW: Buffer containing pointers to the new mesh edges
* BMOP_DUPE_FNEW: Buffer containing pointers to the new mesh faces
- *
*/
void bmo_dupe_exec(BMesh *bm, BMOperator *op)
@@ -324,18 +317,18 @@ void bmo_dupe_exec(BMesh *bm, BMOperator *op)
if (!bm2)
bm2 = bm;
- /* flag inpu */
- BMO_slot_buffer_flag_enable(bm, dupeop, "geom", DUPE_INPUT, BM_ALL);
+ /* flag input */
+ BMO_slot_buffer_flag_enable(bm, dupeop, "geom", BM_ALL, DUPE_INPUT);
- /* use the internal copy functio */
+ /* use the internal copy function */
copy_mesh(dupeop, bm, bm2);
- /* Outpu */
- /* First copy the input buffers to output buffers - original dat */
+ /* Output */
+ /* First copy the input buffers to output buffers - original data */
BMO_slot_copy(dupeop, dupeop, "geom", "origout");
- /* Now alloc the new output buffer */
- BMO_slot_from_flag(bm, dupeop, "newout", DUPE_NEW, BM_ALL);
+ /* Now alloc the new output buffers */
+ BMO_slot_buffer_from_enabled_flag(bm, dupeop, "newout", BM_ALL, DUPE_NEW);
}
#if 0 /* UNUSED */
@@ -343,19 +336,19 @@ void bmo_dupe_exec(BMesh *bm, BMOperator *op)
* type flag etypeflag and header flag flag to it. note,
* to get more useful information (such as the mapping from
* original to new elements) you should run the dupe op manually */
-void BMO_dupe_from_flag(BMesh *bm, int etypeflag, const char hflag)
+void BMO_dupe_from_flag(BMesh *bm, int htype, const char hflag)
{
BMOperator dupeop;
BMO_op_init(bm, &dupeop, "dupe");
- BMO_slot_from_hflag(bm, &dupeop, "geom", hflag, etypeflag);
+ BMO_slot_buffer_from_enabled_hflag(bm, &dupeop, "geom", htype, hflag);
BMO_op_exec(bm, &dupeop);
BMO_op_finish(bm, &dupeop);
}
#endif
-/*
+/**
* Split Operator
*
* Duplicates verts, edges and faces of a mesh but also deletes the originals.
@@ -373,7 +366,8 @@ void BMO_dupe_from_flag(BMesh *bm, int etypeflag, const char hflag)
* BMOP_DUPE_FOUTPUT: Buffer containing pointers to the split mesh faces
*/
-#define SPLIT_INPUT 1
+#define SPLIT_INPUT 1
+
void bmo_split_exec(BMesh *bm, BMOperator *op)
{
BMOperator *splitop = op;
@@ -388,7 +382,7 @@ void bmo_split_exec(BMesh *bm, BMOperator *op)
BMO_slot_copy(splitop, &dupeop, "geom", "geom");
BMO_op_exec(bm, &dupeop);
- BMO_slot_buffer_flag_enable(bm, splitop, "geom", SPLIT_INPUT, BM_ALL);
+ BMO_slot_buffer_flag_enable(bm, splitop, "geom", BM_ALL, SPLIT_INPUT);
if (use_only_faces) {
BMVert *v;
@@ -427,20 +421,18 @@ void bmo_split_exec(BMesh *bm, BMOperator *op)
}
}
- /* connect outputs of dupe to delete, exluding keep geometr */
+ /* connect outputs of dupe to delete, exluding keep geometry */
BMO_slot_int_set(&delop, "context", DEL_FACES);
- BMO_slot_from_flag(bm, &delop, "geom", SPLIT_INPUT, BM_ALL);
+ BMO_slot_buffer_from_enabled_flag(bm, &delop, "geom", BM_ALL, SPLIT_INPUT);
BMO_op_exec(bm, &delop);
/* now we make our outputs by copying the dupe output */
BMO_slot_copy(&dupeop, splitop, "newout", "geomout");
- BMO_slot_copy(&dupeop, splitop, "boundarymap",
- "boundarymap");
- BMO_slot_copy(&dupeop, splitop, "isovertmap",
- "isovertmap");
+ BMO_slot_copy(&dupeop, splitop, "boundarymap", "boundarymap");
+ BMO_slot_copy(&dupeop, splitop, "isovertmap", "isovertmap");
- /* cleanu */
+ /* cleanup */
BMO_op_finish(bm, &delop);
BMO_op_finish(bm, &dupeop);
}
@@ -453,14 +445,14 @@ void bmo_del_exec(BMesh *bm, BMOperator *op)
BMOperator *delop = op;
/* Mark Buffer */
- BMO_slot_buffer_flag_enable(bm, delop, "geom", DEL_INPUT, BM_ALL);
+ BMO_slot_buffer_flag_enable(bm, delop, "geom", BM_ALL, DEL_INPUT);
BMO_remove_tagged_context(bm, DEL_INPUT, BMO_slot_int_get(op, "context"));
#undef DEL_INPUT
}
-/*
+/**
* Spin Operator
*
* Extrude or duplicate geometry a number of times,
@@ -472,9 +464,8 @@ void bmo_spin_exec(BMesh *bm, BMOperator *op)
BMOperator dupop, extop;
float cent[3], dvec[3];
float axis[3] = {0.0f, 0.0f, 1.0f};
- float q[4];
float rmat[3][3];
- float phi, si;
+ float phi;
int steps, do_dupli, a, usedvec;
BMO_slot_vec_get(op, "cent", cent);
@@ -483,15 +474,10 @@ void bmo_spin_exec(BMesh *bm, BMOperator *op)
BMO_slot_vec_get(op, "dvec", dvec);
usedvec = !is_zero_v3(dvec);
steps = BMO_slot_int_get(op, "steps");
- phi = BMO_slot_float_get(op, "ang") * (float)M_PI / (360.0f * steps);
+ phi = BMO_slot_float_get(op, "ang") * DEG2RADF(1.0f) / steps;
do_dupli = BMO_slot_bool_get(op, "do_dupli");
- si = (float)sin(phi);
- q[0] = (float)cos(phi);
- q[1] = axis[0]*si;
- q[2] = axis[1]*si;
- q[3] = axis[2]*si;
- quat_to_mat3(rmat, q);
+ axis_angle_to_mat3(rmat, axis, phi);
BMO_slot_copy(op, op, "geom", "lastout");
for (a = 0; a < steps; a++) {
diff --git a/source/blender/bmesh/operators/bmo_edgesplit.c b/source/blender/bmesh/operators/bmo_edgesplit.c
index 59d0c1f1e1b..6601fb1cd48 100644
--- a/source/blender/bmesh/operators/bmo_edgesplit.c
+++ b/source/blender/bmesh/operators/bmo_edgesplit.c
@@ -15,412 +15,151 @@
* 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 "MEM_guardedalloc.h"
-#include "BLI_array.h"
+#include "BLI_utildefines.h"
#include "bmesh.h"
-#include "bmesh_operators_private.h" /* own include */
+#include "intern/bmesh_operators_private.h" /* own include */
-typedef struct EdgeTag {
- BMVert *newv1, *newv2;
- BMEdge *newe1, *newe2;
- int tag;
-} EdgeTag;
+enum {
+ EDGE_SEAM = 1
+};
-/* (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
+enum {
+ VERT_SEAM = 2
+};
-#define FACE_DEL 1
-#define FACE_NEW 2
-
-static BMFace *remake_face(BMesh *bm, EdgeTag *etags, BMFace *f, BMVert **verts, BMEdge **edges_tmp)
+/**
+ * Remove the EDGE_SEAM flag for edges we cant split
+ *
+ * un-tag edges not connected to other tagged edges,
+ * unless they are on a boundary
+ */
+static void bm_edgesplit_validate_seams(BMesh *bm, BMOperator *op)
{
- BMIter liter1, liter2;
- EdgeTag *et;
- BMFace *f2;
- BMLoop *l, *l2;
+ BMOIter siter;
+ BMIter iter;
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);
+ unsigned char *vtouch;
+ unsigned char *vt;
- f2 = BM_face_create(bm, verts, edges_tmp, f->len, FALSE);
- if (!f2) {
- return NULL;
- }
+ BM_mesh_elem_index_ensure(bm, BM_VERT);
- BM_elem_attrs_copy(bm, bm, f, f2);
+ vtouch = MEM_callocN(sizeof(char) * bm->totvert, __func__);
- 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;
- }
+ /* tag all boundary verts so as not to untag an edge which is inbetween only 2 faces [] */
+ BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
- if (BMO_elem_flag_test(bm, l->e, EDGE_SEAM)) {
- BMO_elem_flag_enable(bm, l2->e, EDGE_SEAM);
- }
+ /* 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);
- BM_elem_attrs_copy(bm, bm, l->e, l2->e);
+ if (e->l == NULL) {
+ BMO_elem_flag_disable(bm, e, EDGE_SEAM);
}
+ else 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)++;
- BMO_elem_flag_enable(bm, l->e, EDGE_MARK);
- BMO_elem_flag_enable(bm, l2->e, EDGE_MARK);
- }
-
- return f2;
-}
-
-static void tag_out_edges(BMesh *bm, EdgeTag *etags, BMOperator *UNUSED(op))
-{
- EdgeTag *et;
- 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;
+ /* while the boundary verts need to be tagged,
+ * the edge its self can't be split */
+ BMO_elem_flag_disable(bm, e, EDGE_SEAM);
}
+ }
- /* 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;
-
- 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);
- }
- }
-
- /* 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);
-
- 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;
- }
-
- v = (l->v == v) ? l->next->v : l->v;
- }
+ /* 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) {
+ /* lame, but we don't 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);
}
}
+
+ MEM_freeN(vtouch);
}
+/* keep this operator fast, its used in a modifier */
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;
+ BMEdge *e;
+ const int use_verts = BMO_slot_bool_get(op, "use_verts");
+
+ BMO_slot_buffer_flag_enable(bm, op, "edges", BM_EDGE, EDGE_SEAM);
+
+ if (use_verts) {
+ /* this slows down the operation but its ok because the modifier doesn't use */
+ BMO_slot_buffer_flag_enable(bm, op, "verts", BM_VERT, VERT_SEAM);
+
+ /* prevent one edge having both verts unflagged
+ * we could alternately disable these edges, either way its a corner case.
+ *
+ * This is needed so we don't split off the edge but then none of its verts which
+ * would leave a duplicate edge.
+ */
+ BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) {
+ if (UNLIKELY((BMO_elem_flag_test(bm, e->v1, VERT_SEAM) == FALSE &&
+ (BMO_elem_flag_test(bm, e->v2, VERT_SEAM) == FALSE))))
+ {
+ BMO_elem_flag_enable(bm, e->v1, VERT_SEAM);
+ BMO_elem_flag_enable(bm, e->v2, VERT_SEAM);
}
}
-
- if (!e2) {
- BMO_elem_flag_disable(bm, e, EDGE_SEAM);
- }
}
- etags = MEM_callocN(sizeof(EdgeTag) * bm->totedge, "EdgeTag");
-
- BM_mesh_elem_index_ensure(bm, BM_EDGE);
+ bm_edgesplit_validate_seams(bm, op);
-#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) {
+ 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);
- if (BMO_elem_flag_test(bm, f, FACE_NEW)) {
- 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);
}
+ }
- 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 necassary */
-
- /* 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);
- }
-
- verts[fv_index] = v2;
- }
- else {
- verts[fv_index] = v;
- }
- }
+ if (use_verts) {
+ BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) {
+ if (BMO_elem_flag_test(bm, e->v1, VERT_SEAM) == FALSE) {
+ BM_elem_flag_disable(e->v1, BM_ELEM_TAG);
}
-
- i++;
- }
-
- /* 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);
-
+ if (BMO_elem_flag_test(bm, e->v2, VERT_SEAM) == FALSE) {
+ BM_elem_flag_disable(e->v2, BM_ELEM_TAG);
}
}
- else {
- printf(" ** fount %d len face\n", f->len);
- }
-#endif
-
- f2 = remake_face(bm, etags, f, verts, edges_tmp);
- if (!f2) {
- continue;
- }
-
- 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_from_flag(bm, op, "edgeout1", EDGE_RET1, BM_EDGE);
- BMO_slot_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_enabled_hflag(bm, op, "edgeout", BM_EDGE, BM_ELEM_INTERNAL_TAG);
}
-
-#undef ETV
-#undef SETETV
diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c
index 7425d20bd88..981232b4d66 100644
--- a/source/blender/bmesh/operators/bmo_extrude.c
+++ b/source/blender/bmesh/operators/bmo_extrude.c
@@ -27,11 +27,13 @@
#include "bmesh.h"
-#include "bmesh_operators_private.h" /* own include */
+#include "intern/bmesh_operators_private.h" /* own include */
-#define EXT_INPUT 1
-#define EXT_KEEP 2
-#define EXT_DEL 4
+enum {
+ EXT_INPUT = 1,
+ EXT_KEEP = 2,
+ EXT_DEL = 4
+};
#define VERT_MARK 1
#define EDGE_MARK 1
@@ -108,7 +110,55 @@ void bmo_extrude_face_indiv_exec(BMesh *bm, BMOperator *op)
BLI_array_free(edges);
BMO_op_callf(bm, "del geom=%ff context=%i", EXT_DEL, DEL_ONLYFACES);
- BMO_slot_from_flag(bm, op, "faceout", EXT_KEEP, BM_FACE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "faceout", BM_FACE, EXT_KEEP);
+}
+
+static void bm_extrude_copy_face_loop_attributes(BMesh *bm, BMFace *f, BMEdge *e, BMEdge *newedge)
+{
+ BMIter iter;
+ BMLoop *l, *l_other;
+
+ /* copy attributes */
+ BM_ITER(l, &iter, bm, BM_LOOPS_OF_FACE, f) {
+ if (l->e != e && l->e != newedge) {
+ continue;
+ }
+
+ l_other = l->radial_next;
+
+ if (l_other == l) {
+ l_other = newedge->l;
+
+ if (l_other != l) {
+ BM_elem_attrs_copy(bm, bm, l_other->f, f);
+ BM_elem_flag_disable(f, BM_ELEM_HIDDEN); /* possibly we copy from a hidden face */
+
+ BM_elem_attrs_copy(bm, bm, l_other, l);
+ l_other = l_other->next;
+ l = l->next;
+ BM_elem_attrs_copy(bm, bm, l_other, l);
+ }
+ }
+ else {
+ BM_elem_attrs_copy(bm, bm, l_other->f, f);
+ BM_elem_flag_disable(f, BM_ELEM_HIDDEN); /* possibly we copy from a hidden face */
+
+ /* copy data */
+ if (l_other->v == l->v) {
+ BM_elem_attrs_copy(bm, bm, l_other, l);
+ l_other = l_other->next;
+ l = l->next;
+ BM_elem_attrs_copy(bm, bm, l_other, l);
+ }
+ else {
+ l_other = l_other->next;
+ BM_elem_attrs_copy(bm, bm, l_other, l);
+ l_other = l_other->prev;
+ l = l->next;
+ BM_elem_attrs_copy(bm, bm, l_other, l);
+ }
+ }
+ }
}
void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op)
@@ -145,8 +195,9 @@ void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op)
v3 = e->v2;
v4 = e->v1;
}
- /* not sure what to do about example face, pass NULL for now */
+ /* not sure what to do about example face, pass NULL for now */
f = BM_face_create_quad_tri(bm, v1, v2, v3, v4, NULL, FALSE);
+ bm_extrude_copy_face_loop_attributes(bm, f, e, e2);
if (BMO_elem_flag_test(bm, e, EXT_INPUT))
e = e2;
@@ -160,7 +211,7 @@ void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op)
BMO_op_finish(bm, &dupeop);
- BMO_slot_from_flag(bm, op, "geomout", EXT_KEEP, BM_ALL);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "geomout", BM_ALL, EXT_KEEP);
}
void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op)
@@ -179,8 +230,8 @@ void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op)
BMO_elem_flag_enable(bm, dupev, EXT_KEEP);
}
- BMO_slot_from_flag(bm, op, "vertout", EXT_KEEP, BM_VERT);
- BMO_slot_from_flag(bm, op, "edgeout", EXT_KEEP, BM_EDGE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, EXT_KEEP);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "edgeout", BM_EDGE, EXT_KEEP);
}
void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
@@ -189,57 +240,68 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
BMOIter siter;
BMIter iter, fiter, viter;
BMEdge *e, *newedge;
- BMLoop *l, *l2;
BMVert *verts[4], *v, *v2;
BMFace *f;
- int rlen, found, fwd, delorig = 0;
+ int found, fwd, delorig = FALSE;
/* initialize our sub-operators */
BMO_op_init(bm, &dupeop, "dupe");
- BMO_slot_buffer_flag_enable(bm, op, "edgefacein", EXT_INPUT, BM_EDGE|BM_FACE);
+ BMO_slot_buffer_flag_enable(bm, op, "edgefacein", BM_EDGE|BM_FACE, EXT_INPUT);
- /* if one flagged face is bordered by an unflagged face, then we delete
+ /* if one flagged face is bordered by an un-flagged face, then we delete
* original geometry unless caller explicitly asked to keep it. */
if (!BMO_slot_bool_get(op, "alwayskeeporig")) {
BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
- if (!BMO_elem_flag_test(bm, e, EXT_INPUT)) continue;
- found = 0;
- f = BM_iter_new(&fiter, bm, BM_FACES_OF_EDGE, e);
- for (rlen = 0; f; f = BM_iter_step(&fiter), rlen++) {
+ int edge_face_tot;
+
+ if (!BMO_elem_flag_test(bm, e, EXT_INPUT)) {
+ continue;
+ }
+
+ found = FALSE; /* found a face that isn't input? */
+ edge_face_tot = 0; /* edge/face count */
+
+ BM_ITER(f, &fiter, bm, BM_FACES_OF_EDGE, e) {
if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) {
- found = 1;
- delorig = 1;
+ found = TRUE;
+ delorig = TRUE;
break;
}
+
+ edge_face_tot++;
}
- if (!found && (rlen > 1)) {
+ if ((edge_face_tot > 1) && (found == FALSE)) {
+ /* edge has a face user, that face isn't extrude input */
BMO_elem_flag_enable(bm, e, EXT_DEL);
}
}
}
- /* calculate verts to delet */
+ /* calculate verts to delete */
BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
- found = 0;
+ found = FALSE;
BM_ITER(e, &viter, bm, BM_EDGES_OF_VERT, v) {
if (!BMO_elem_flag_test(bm, e, EXT_INPUT) || !BMO_elem_flag_test(bm, e, EXT_DEL)) {
- found = 1;
+ found = TRUE;
break;
}
}
-
- BM_ITER(f, &viter, bm, BM_FACES_OF_VERT, v) {
- if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) {
- found = 1;
- break;
+
+ /* avoid an extra loop */
+ if (found == TRUE) {
+ BM_ITER(f, &viter, bm, BM_FACES_OF_VERT, v) {
+ if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) {
+ found = TRUE;
+ break;
+ }
}
}
- if (!found) {
+ if (found == FALSE) {
BMO_elem_flag_enable(bm, v, EXT_DEL);
}
}
@@ -250,7 +312,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
}
}
- if (delorig) {
+ if (delorig == TRUE) {
BMO_op_initf(bm, &delop, "del geom=%fvef context=%i",
EXT_DEL, DEL_ONLYTAGGED);
}
@@ -261,11 +323,13 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
if (bm->act_face && BMO_elem_flag_test(bm, bm->act_face, EXT_INPUT))
bm->act_face = BMO_slot_map_ptr_get(bm, &dupeop, "facemap", bm->act_face);
- if (delorig) BMO_op_exec(bm, &delop);
+ if (delorig) {
+ BMO_op_exec(bm, &delop);
+ }
/* if not delorig, reverse loops of original face */
if (!delorig) {
- for (f = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, NULL); f; f = BM_iter_step(&iter)) {
+ BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
if (BMO_elem_flag_test(bm, f, EXT_INPUT)) {
BM_face_normal_flip(bm, f);
}
@@ -275,11 +339,21 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
BMO_slot_copy(&dupeop, op, "newout", "geomout");
e = BMO_iter_new(&siter, bm, &dupeop, "boundarymap", 0);
for ( ; e; e = BMO_iter_step(&siter)) {
- if (BMO_slot_map_contains(bm, op, "exclude", e)) continue;
- newedge = BMO_iter_map_value(&siter);
- newedge = *(BMEdge **)newedge;
- if (!newedge) continue;
+ /* this should always be wire, so this is mainly a speedup to avoid map lookup */
+ if (BM_edge_is_wire(e) && BMO_slot_map_contains(bm, op, "exclude", e)) {
+ /* The original edge was excluded,
+ * this would result in a standalone wire edge - see [#30399] */
+ BM_edge_kill(bm, e);
+
+ continue;
+ }
+
+ newedge = *(BMEdge **)BMO_iter_map_value(&siter);
+
+ if (!newedge) {
+ continue;
+ }
/* orient loop to give same normal as a loop of newedge
* if it exists (will be an extruded face),
@@ -305,41 +379,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
/* not sure what to do about example face, pass NULL for now */
f = BM_face_create_quad_tri_v(bm, verts, 4, NULL, FALSE);
-
- /* copy attribute */
- l = BM_iter_new(&iter, bm, BM_LOOPS_OF_FACE, f);
- for ( ; l; l = BM_iter_step(&iter)) {
- if (l->e != e && l->e != newedge) continue;
- l2 = l->radial_next;
-
- if (l2 == l) {
- l2 = newedge->l;
- BM_elem_attrs_copy(bm, bm, l2->f, l->f);
-
- BM_elem_attrs_copy(bm, bm, l2, l);
- l2 = l2->next;
- l = l->next;
- BM_elem_attrs_copy(bm, bm, l2, l);
- }
- else {
- BM_elem_attrs_copy(bm, bm, l2->f, l->f);
-
- /* copy dat */
- if (l2->v == l->v) {
- BM_elem_attrs_copy(bm, bm, l2, l);
- l2 = l2->next;
- l = l->next;
- BM_elem_attrs_copy(bm, bm, l2, l);
- }
- else {
- l2 = l2->next;
- BM_elem_attrs_copy(bm, bm, l2, l);
- l2 = l2->prev;
- l = l->next;
- BM_elem_attrs_copy(bm, bm, l2, l);
- }
- }
- }
+ bm_extrude_copy_face_loop_attributes(bm, f, e, newedge);
}
/* link isolated vert */
@@ -349,7 +389,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
BM_edge_create(bm, v, v2, v->e, TRUE);
}
- /* cleanu */
+ /* cleanup */
if (delorig) BMO_op_finish(bm, &delop);
BMO_op_finish(bm, &dupeop);
}
@@ -410,10 +450,10 @@ static void calc_solidify_normals(BMesh *bm)
}
}
MEM_freeN(edge_face_count);
- edge_face_count = NULL; /* dont re-use */
+ edge_face_count = NULL; /* don't re-use */
BM_ITER(v, &viter, bm, BM_VERTS_OF_MESH, NULL) {
- if (!BM_vert_is_manifold(bm, v)) {
+ if (!BM_vert_is_manifold(v)) {
BMO_elem_flag_enable(bm, v, VERT_NONMAN);
continue;
}
@@ -465,7 +505,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;
@@ -506,7 +546,7 @@ static void calc_solidify_normals(BMesh *bm)
}
}
-static void solidify_add_thickness(BMesh *bm, float dist)
+static void solidify_add_thickness(BMesh *bm, const float dist)
{
BMFace *f;
BMVert *v;
@@ -514,16 +554,14 @@ static void solidify_add_thickness(BMesh *bm, float dist)
BMIter iter, loopIter;
float *vert_angles = MEM_callocN(sizeof(float) * bm->totvert * 2, "solidify"); /* 2 in 1 */
float *vert_accum = vert_angles + bm->totvert;
- float angle;
int i, index;
- float maxdist = dist * sqrtf(3.0f);
/* array for passing verts to angle_poly_v3 */
float **verts = NULL;
BLI_array_staticdeclare(verts, BM_NGON_STACK_SIZE);
/* array for receiving angles from angle_poly_v3 */
- float *angles = NULL;
- BLI_array_staticdeclare(angles, BM_NGON_STACK_SIZE);
+ float *face_angles = NULL;
+ BLI_array_staticdeclare(face_angles, BM_NGON_STACK_SIZE);
BM_mesh_elem_index_ensure(bm, BM_VERT);
@@ -532,36 +570,38 @@ static void solidify_add_thickness(BMesh *bm, float dist)
continue;
}
- BM_ITER(l, &loopIter, bm, BM_LOOPS_OF_FACE, f) {
- BLI_array_append(verts, l->v->co);
- BLI_array_growone(angles);
+ BLI_array_growitems(verts, f->len);
+ BM_ITER_INDEX(l, &loopIter, bm, BM_LOOPS_OF_FACE, f, i) {
+ verts[i] = l->v->co;
}
- angle_poly_v3(angles, (const float **)verts, f->len);
+ BLI_array_growitems(face_angles, f->len);
+ angle_poly_v3(face_angles, (const float **)verts, f->len);
i = 0;
BM_ITER(l, &loopIter, bm, BM_LOOPS_OF_FACE, f) {
v = l->v;
index = BM_elem_index_get(v);
- angle = angles[i];
- vert_accum[index] += angle;
- vert_angles[index] += shell_angle_to_dist(angle_normalized_v3v3(v->no, f->no)) * angle;
+ vert_accum[index] += face_angles[i];
+ vert_angles[index] += shell_angle_to_dist(angle_normalized_v3v3(v->no, f->no)) * face_angles[i];
i++;
}
BLI_array_empty(verts);
- BLI_array_empty(angles);
+ BLI_array_empty(face_angles);
}
BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
index = BM_elem_index_get(v);
if (vert_accum[index]) { /* zero if unselected */
- float vdist = MIN2(maxdist, dist * vert_angles[index] / vert_accum[index]);
- madd_v3_v3fl(v->co, v->no, vdist);
+ madd_v3_v3fl(v->co, v->no, dist * (vert_angles[index] / vert_accum[index]));
}
}
MEM_freeN(vert_angles);
+
+ BLI_array_free(verts);
+ BLI_array_free(face_angles);
}
void bmo_solidify_face_region_exec(BMesh *bm, BMOperator *op)
@@ -584,7 +624,7 @@ void bmo_solidify_face_region_exec(BMesh *bm, BMOperator *op)
BMO_op_exec(bm, &extrudeop);
/* Push the verts of the extruded faces inward to create thickness */
- BMO_slot_buffer_flag_enable(bm, &extrudeop, "geomout", FACE_MARK, BM_FACE);
+ BMO_slot_buffer_flag_enable(bm, &extrudeop, "geomout", BM_FACE, FACE_MARK);
calc_solidify_normals(bm);
solidify_add_thickness(bm, thickness);
diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c
new file mode 100644
index 00000000000..7aeeca99d58
--- /dev/null
+++ b/source/blender/bmesh/operators/bmo_inset.c
@@ -0,0 +1,487 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_math.h"
+
+#include "bmesh.h"
+
+#include "intern/bmesh_operators_private.h" /* own include */
+
+#define ELE_NEW 1
+
+typedef struct SplitEdgeInfo {
+ float no[3];
+ float length;
+ BMEdge *e_old;
+ BMEdge *e_new;
+ BMLoop *l;
+} SplitEdgeInfo;
+
+static void edge_loop_tangent(BMEdge *e, BMLoop *e_loop, float r_no[3])
+{
+ float tvec[3];
+ BMVert *v1, *v2;
+ BM_edge_ordered_verts_ex(e, &v1, &v2, e_loop);
+
+ sub_v3_v3v3(tvec, v1->co, v2->co); /* use for temp storage */
+ cross_v3_v3v3(r_no, tvec, e_loop->f->no);
+ normalize_v3(r_no);
+}
+
+/**
+ * return the tag loop where there is...
+ * - only 1 tagged face attached to this edge.
+ * - 1 or more untagged faces.
+ *
+ * \note this function looks to be expensive
+ * but in most cases it will only do 2 iterations.
+ */
+static BMLoop *bm_edge_is_mixed_face_tag(BMLoop *l)
+{
+ if (LIKELY(l != NULL)) {
+ int tot_tag = 0;
+ int tot_untag = 0;
+ BMLoop *l_iter;
+ BMLoop *l_tag = NULL;
+ l_iter = l;
+ do {
+ if (BM_elem_flag_test(l_iter->f, BM_ELEM_TAG)) {
+ /* more then one tagged face - bail out early! */
+ if (tot_tag == 1) {
+ return NULL;
+ }
+ l_tag = l_iter;
+ tot_tag++;
+ }
+ else {
+ tot_untag++;
+ }
+
+ } while ((l_iter = l_iter->radial_next) != l);
+
+ return ((tot_tag == 1) && (tot_untag >= 1)) ? l_tag : NULL;
+ }
+ else {
+ return NULL;
+ }
+}
+
+
+/**
+ * implementation is as follows...
+ *
+ * - set all faces as tagged/untagged based on selection.
+ * - find all edges that have 1 tagged, 1 untagged face.
+ * - separate these edges and tag vertices, set their index to point to the original edge.
+ * - build faces between old/new edges.
+ * - inset the new edges into their faces.
+ */
+
+void bmo_inset_exec(BMesh *bm, BMOperator *op)
+{
+ const int use_outset = BMO_slot_bool_get(op, "use_outset");
+ const int use_boundary = BMO_slot_bool_get(op, "use_boundary") && (use_outset == FALSE);
+ const int use_even_offset = BMO_slot_bool_get(op, "use_even_offset");
+ const int use_even_boundry = use_even_offset; /* could make own option */
+ const int use_relative_offset = BMO_slot_bool_get(op, "use_relative_offset");
+ const float thickness = BMO_slot_float_get(op, "thickness");
+
+ int edge_info_len = 0;
+
+ BMIter iter;
+ SplitEdgeInfo *edge_info;
+ SplitEdgeInfo *es;
+
+ BMVert *v;
+ BMEdge *e;
+ BMFace *f;
+ int i, j, k;
+
+ if (use_outset == FALSE) {
+ BM_mesh_elem_flag_disable_all(bm, BM_FACE, BM_ELEM_TAG, FALSE);
+ BMO_slot_buffer_hflag_enable(bm, op, "faces", BM_FACE, BM_ELEM_TAG, FALSE);
+ }
+ else {
+ BM_mesh_elem_flag_enable_all(bm, BM_FACE, BM_ELEM_TAG, FALSE);
+ BMO_slot_buffer_hflag_disable(bm, op, "faces", BM_FACE, BM_ELEM_TAG, FALSE);
+ }
+
+ /* first count all inset edges we will split */
+ /* fill in array and initialize tagging */
+ BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ if (
+ /* tag if boundary is enabled */
+ (use_boundary && BM_edge_is_boundary(e) && BM_elem_flag_test(e->l->f, BM_ELEM_TAG)) ||
+
+ /* tag if edge is an interior edge inbetween a tagged and untagged face */
+ (bm_edge_is_mixed_face_tag(e->l)))
+ {
+ /* tag */
+ BM_elem_flag_enable(e->v1, BM_ELEM_TAG);
+ BM_elem_flag_enable(e->v2, BM_ELEM_TAG);
+ BM_elem_flag_enable(e, BM_ELEM_TAG);
+
+ BM_elem_index_set(e, edge_info_len); /* set_dirty! */
+ edge_info_len++;
+ }
+ else {
+ BM_elem_flag_disable(e->v1, BM_ELEM_TAG);
+ BM_elem_flag_disable(e->v2, BM_ELEM_TAG);
+ BM_elem_flag_disable(e, BM_ELEM_TAG);
+
+ BM_elem_index_set(e, -1); /* set_dirty! */
+ }
+ }
+ bm->elem_index_dirty |= BM_EDGE;
+
+ edge_info = MEM_mallocN(edge_info_len * sizeof(SplitEdgeInfo), __func__);
+
+ /* fill in array and initialize tagging */
+ es = edge_info;
+ BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ i = BM_elem_index_get(e);
+ if (i != -1) {
+ /* calc edge-split info */
+ es->length = BM_edge_length_calc(e);
+ es->e_old = e;
+ es++;
+ /* initialize no and e_new after */
+ }
+ }
+
+ for (i = 0, es = edge_info; i < edge_info_len; i++, es++) {
+ if ((es->l = bm_edge_is_mixed_face_tag(es->e_old->l))) {
+ /* do nothing */
+ }
+ else {
+ es->l = es->e_old->l; /* must be a boundary */
+ }
+
+
+ /* run the separate arg */
+ bmesh_edge_separate(bm, es->e_old, es->l);
+
+ /* calc edge-split info */
+ es->e_new = es->l->e;
+ edge_loop_tangent(es->e_new, es->l, es->no);
+
+ if (es->e_new == es->e_old) { /* happens on boundary edges */
+ /* take care here, we're creating this double edge which _must_ have its verts replaced later on */
+ es->e_old = BM_edge_create(bm, es->e_new->v1, es->e_new->v2, es->e_new, FALSE);
+ }
+
+ /* store index back to original in 'edge_info' */
+ BM_elem_index_set(es->e_new, i);
+ BM_elem_flag_enable(es->e_new, BM_ELEM_TAG);
+
+ /* important to tag again here */
+ BM_elem_flag_enable(es->e_new->v1, BM_ELEM_TAG);
+ BM_elem_flag_enable(es->e_new->v2, BM_ELEM_TAG);
+ }
+
+
+ /* show edge normals for debugging */
+#if 0
+ for (i = 0, es = edge_info; i < edge_info_len; i++, es++) {
+ float tvec[3];
+ BMVert *v1, *v2;
+
+ mid_v3_v3v3(tvec, es->e_new->v1->co, es->e_new->v2->co);
+
+ v1 = BM_vert_create(bm, tvec, NULL);
+ v2 = BM_vert_create(bm, tvec, NULL);
+ madd_v3_v3fl(v2->co, es->no, 0.1f);
+ BM_edge_create(bm, v1, v2, NULL, FALSE);
+ }
+#endif
+
+ /* execute the split and position verts, it would be most obvious to loop over verts
+ * here but don't do this since we will be splitting them off (iterating stuff you modify is bad juju)
+ * instead loop over edges then their verts */
+ for (i = 0, es = edge_info; i < edge_info_len; i++, es++) {
+ for (j = 0; j < 2; j++) {
+ v = (j == 0) ? es->e_new->v1 : es->e_new->v2;
+
+ /* end confusing part - just pretend this is a typical loop on verts */
+
+ /* only split of tagged verts - used by separated edges */
+
+ /* comment the first part because we know this verts in a tagged face */
+ if (/* v->e && */BM_elem_flag_test(v, BM_ELEM_TAG)) {
+ BMVert **vout;
+ int r_vout_len;
+ BMVert *v_glue = NULL;
+
+ /* disable touching twice, this _will_ happen if the flags not disabled */
+ BM_elem_flag_disable(v, BM_ELEM_TAG);
+
+ bmesh_vert_separate(bm, v, &vout, &r_vout_len);
+ v = NULL; /* don't use again */
+
+ /* in some cases the edge doesnt split off */
+ if (r_vout_len == 1) {
+ MEM_freeN(vout);
+ continue;
+ }
+
+ for (k = 0; k < r_vout_len; k++) {
+ BMVert *v_split = vout[k]; /* only to avoid vout[k] all over */
+
+ /* need to check if this vertex is from a */
+ int vert_edge_tag_tot = 0;
+ int vecpair[2];
+
+ /* find adjacent */
+ BM_ITER(e, &iter, bm, BM_EDGES_OF_VERT, v_split) {
+ if (BM_elem_flag_test(e, BM_ELEM_TAG) &&
+ e->l && BM_elem_flag_test(e->l->f, BM_ELEM_TAG))
+ {
+ if (vert_edge_tag_tot < 2) {
+ vecpair[vert_edge_tag_tot] = BM_elem_index_get(e);
+ BLI_assert(vecpair[vert_edge_tag_tot] != -1);
+ }
+
+ vert_edge_tag_tot++;
+ }
+ }
+
+ if (vert_edge_tag_tot != 0) {
+ float tvec[3];
+
+ if (vert_edge_tag_tot >= 2) { /* 2 edge users - common case */
+ /* now there are 2 cases to check for,
+ *
+ * if both edges use the same face OR both faces have the same normal,
+ * ...then we can calculate an edge that fits nicely between the 2 edge normals.
+ *
+ * Otherwise use the shared edge OR the corner defined by these 2 face normals,
+ * when both edges faces are adjacent this works best but even when this vertex
+ * fans out faces it should work ok.
+ */
+
+ SplitEdgeInfo *e_info_a = &edge_info[vecpair[0]];
+ SplitEdgeInfo *e_info_b = &edge_info[vecpair[1]];
+
+ BMFace *f_a = e_info_a->l->f;
+ BMFace *f_b = e_info_b->l->f;
+
+ /* we use this as either the normal OR to find the right direction for the
+ * crpss product between both face normals */
+ add_v3_v3v3(tvec, e_info_a->no, e_info_b->no);
+
+ if ((f_a == f_b) || compare_v3v3(f_a->no, f_b->no, 0.00001f)) {
+ normalize_v3(tvec);
+ }
+ else {
+ /* these lookups are very quick */
+ BMLoop *l_other_a = BM_loop_other_vert_loop(e_info_a->l, v_split);
+ BMLoop *l_other_b = BM_loop_other_vert_loop(e_info_b->l, v_split);
+
+ if (l_other_a->v == l_other_b->v) {
+ /* both edges faces are adjacent, but we don't need to know the shared edge
+ * having both verts is enough. */
+ sub_v3_v3v3(tvec, l_other_a->v->co, v_split->co);
+ }
+ else {
+ /* faces don't touch,
+ * just get cross product of their normals, its *good enough*
+ */
+ float tno[3];
+ cross_v3_v3v3(tno, f_a->no, f_b->no);
+ if (dot_v3v3(tvec, tno) < 0.0f) {
+ negate_v3(tno);
+ }
+ copy_v3_v3(tvec, tno);
+ }
+
+ normalize_v3(tvec);
+ }
+
+ /* scale by edge angle */
+ if (use_even_offset) {
+ mul_v3_fl(tvec, shell_angle_to_dist(angle_normalized_v3v3(e_info_a->no, e_info_b->no) / 2.0f));
+ }
+
+ /* scale relative to edge lengths */
+ if (use_relative_offset) {
+ mul_v3_fl(tvec, (edge_info[vecpair[0]].length + edge_info[vecpair[1]].length) / 2.0f);
+ }
+ }
+ else if (vert_edge_tag_tot == 1) { /* 1 edge user - boundary vert, not so common */
+ const float *e_no_a = edge_info[vecpair[0]].no;
+
+ if (use_even_boundry) {
+
+ /* This case where only one edge attached to v_split
+ * is used - ei - the face to inset is on a boundary.
+ *
+ * We want the inset to align flush with the
+ * boundary edge, not the normal of the interior
+ * <--- edge which would give an unsightly bump.
+ * --+-------------------------+---------------+--
+ * |^v_other ^e_other /^v_split |
+ * | / |
+ * | / |
+ * | / <- tag split edge |
+ * | / |
+ * | / |
+ * | / |
+ * --+-----------------+-----------------------+--
+ * | |
+ * | |
+ *
+ * note, the fact we are doing location comparisons on verts that are moved about
+ * doesn’t matter because the direction will remain the same in this case.
+ */
+
+ BMEdge *e_other;
+ BMVert *v_other;
+ /* loop will always be either next of prev */
+ BMLoop *l = v_split->e->l;
+ if (l->prev->v == v_split) {
+ l = l->prev;
+ }
+ else if (l->next->v == v_split) {
+ l = l->next;
+ }
+ else if (l->v == v_split) {
+ /* pass */
+ }
+ else {
+ /* should never happen */
+ BLI_assert(0);
+ }
+
+ /* find the edge which is _not_ being split here */
+ if (!BM_elem_flag_test(l->e, BM_ELEM_TAG)) {
+ e_other = l->e;
+ }
+ else if (!BM_elem_flag_test(l->prev->e, BM_ELEM_TAG)) {
+ e_other = l->prev->e;
+ }
+ else {
+ BLI_assert(0);
+ e_other = NULL;
+ }
+
+ v_other = BM_edge_other_vert(e_other, v_split);
+ sub_v3_v3v3(tvec, v_other->co, v_split->co);
+ normalize_v3(tvec);
+
+ if (use_even_offset) {
+ mul_v3_fl(tvec, shell_angle_to_dist(angle_normalized_v3v3(e_no_a, tvec)));
+ }
+ }
+ else {
+ copy_v3_v3(tvec, e_no_a);
+ }
+
+ /* use_even_offset - doesn't apply here */
+
+ /* scale relative to edge length */
+ if (use_relative_offset) {
+ mul_v3_fl(tvec, edge_info[vecpair[0]].length);
+ }
+ }
+ else {
+ /* should never happen */
+ BLI_assert(0);
+ zero_v3(tvec);
+ }
+
+ /* apply the offset */
+ madd_v3_v3fl(v_split->co, tvec, thickness);
+ }
+
+ /* this saves expensive/slow glue check for common cases */
+ if (r_vout_len > 2) {
+ int ok = TRUE;
+ /* last step, NULL this vertex if has a tagged face */
+ BM_ITER(f, &iter, bm, BM_FACES_OF_VERT, v_split) {
+ if (BM_elem_flag_test(f, BM_ELEM_TAG)) {
+ ok = FALSE;
+ break;
+ }
+ }
+
+ if (ok) {
+ if (v_glue == NULL) {
+ v_glue = v_split;
+ }
+ else {
+ BM_vert_splice(bm, v_split, v_glue);
+ }
+ }
+ }
+ /* end glue */
+
+ }
+ MEM_freeN(vout);
+ }
+ }
+ }
+
+ /* create faces */
+ for (i = 0, es = edge_info; i < edge_info_len; i++, es++) {
+ BMVert *varr[4] = {NULL};
+ /* get the verts in the correct order */
+ BM_edge_ordered_verts_ex(es->e_new, &varr[1], &varr[0], es->l);
+#if 0
+ if (varr[0] == es->e_new->v1) {
+ varr[2] = es->e_old->v2;
+ varr[3] = es->e_old->v1;
+ }
+ else {
+ varr[2] = es->e_old->v1;
+ varr[3] = es->e_old->v2;
+ }
+ j = 4;
+#else
+ /* slightly trickier check - since we can't assume the verts are split */
+ j = 2; /* 2 edges are set */
+ if (varr[0] == es->e_new->v1) {
+ if (es->e_old->v2 != es->e_new->v2) { varr[j++] = es->e_old->v2; }
+ if (es->e_old->v1 != es->e_new->v1) { varr[j++] = es->e_old->v1; }
+ }
+ else {
+ if (es->e_old->v1 != es->e_new->v1) { varr[j++] = es->e_old->v1; }
+ if (es->e_old->v2 != es->e_new->v2) { varr[j++] = es->e_old->v2; }
+ }
+
+ if (j == 2) {
+ /* can't make face! */
+ continue;
+ }
+#endif
+ /* no need to check doubles, we KNOW there won't be any */
+ /* yes - reverse face is correct in this case */
+ f = BM_face_create_quad_tri_v(bm, varr, j, es->l->f, FALSE);
+ BMO_elem_flag_enable(bm, f, ELE_NEW);
+ }
+
+ MEM_freeN(edge_info);
+
+ /* we could flag new edges/verts too, is it useful? */
+ BMO_slot_buffer_from_enabled_flag(bm, op, "faceout", BM_FACE, ELE_NEW);
+}
diff --git a/source/blender/bmesh/operators/bmo_join_triangles.c b/source/blender/bmesh/operators/bmo_join_triangles.c
index 76e64aee821..dda3e144220 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
@@ -50,13 +50,13 @@
static float measure_facepair(BMesh *UNUSED(bm), BMVert *v1, BMVert *v2,
BMVert *v3, BMVert *v4, float limit)
{
- /* gives a 'weight' to a pair of triangles that join an edge to decide how good a join they would mak */
+ /* gives a 'weight' to a pair of triangles that join an edge to decide how good a join they would make */
/* Note: this is more complicated than it needs to be and should be cleaned up.. */
float n1[3], n2[3], measure = 0.0f, angle1, angle2, diff;
float edgeVec1[3], edgeVec2[3], edgeVec3[3], edgeVec4[3];
float minarea, maxarea, areaA, areaB;
- /* First Test: Normal differenc */
+ /* First Test: Normal difference */
normal_tri_v3(n1, v1->co, v2->co, v3->co);
normal_tri_v3(n2, v1->co, v3->co, v4->co);
@@ -74,7 +74,7 @@ static float measure_facepair(BMesh *UNUSED(bm), BMVert *v1, BMVert *v2,
return measure;
}
- /* Second test: Colinearit */
+ /* Second test: Colinearity */
sub_v3_v3v3(edgeVec1, v1->co, v2->co);
sub_v3_v3v3(edgeVec2, v2->co, v3->co);
sub_v3_v3v3(edgeVec3, v3->co, v4->co);
@@ -95,7 +95,7 @@ static float measure_facepair(BMesh *UNUSED(bm), BMVert *v1, BMVert *v2,
return measure;
}
- /* Third test: Concavit */
+ /* Third test: Concavity */
areaA = area_tri_v3(v1->co, v2->co, v3->co) + area_tri_v3(v1->co, v3->co, v4->co);
areaB = area_tri_v3(v2->co, v3->co, v4->co) + area_tri_v3(v4->co, v1->co, v2->co);
@@ -176,7 +176,9 @@ static int compareFaceAttribs(BMesh *bm, BMEdge *e, int douvs, int dovcols)
/* do UV */
if (luv1 && douvs) {
- if (tp1->tpage != tp2->tpage); /* do nothin */
+ if (tp1->tpage != tp2->tpage) {
+ /* do nothing */
+ }
else {
int i;
@@ -251,14 +253,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 +331,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 0a5c3d0752e..4578270d571 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_bm_from_me(bm, me, set_key, ob->shapenr);
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, bm_mesh_allocsize_default[0]);
- CustomData_bmesh_init_pool(&bm->edata, bm_mesh_allocsize_default[1]);
- CustomData_bmesh_init_pool(&bm->ldata, bm_mesh_allocsize_default[2]);
- CustomData_bmesh_init_pool(&bm->pdata, bm_mesh_allocsize_default[3]);
-
- 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 necassary 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 necassary 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 necassary 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)
@@ -370,547 +70,14 @@ void bmo_object_load_bmesh_exec(BMesh *bm, BMOperator *op)
/* Scene *scene = BMO_slot_ptr_get(op, "scene"); */
Mesh *me = ob->data;
- BMO_op_callf(bm, "bmesh_to_mesh mesh=%p object=%p notesselation=%b", me, ob, TRUE);
-}
-
-
-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;
+ BMO_op_callf(bm, "bmesh_to_mesh mesh=%p object=%p notessellation=%b", me, ob, TRUE);
}
-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, "notesselation");
-
- 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
- * necassary */
- 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);
- }
+ int dotess = !BMO_slot_bool_get(op, "notessellation");
- if (oldverts) MEM_freeN(oldverts);
+ BM_mesh_bm_to_me(bm, me, dotess);
}
diff --git a/source/blender/bmesh/operators/bmo_mirror.c b/source/blender/bmesh/operators/bmo_mirror.c
index 7990e991431..c516b8a7605 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);
@@ -60,7 +61,7 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op)
BMO_op_initf(bm, &dupeop, "dupe geom=%s", op, "geom");
BMO_op_exec(bm, &dupeop);
- BMO_slot_buffer_flag_enable(bm, &dupeop, "newout", ELE_NEW, BM_ALL);
+ BMO_slot_buffer_flag_enable(bm, &dupeop, "newout", BM_ALL, ELE_NEW);
/* create old -> new mappin */
i = 0;
@@ -119,7 +120,7 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op)
BMO_op_finish(bm, &weldop);
BMO_op_finish(bm, &dupeop);
- BMO_slot_from_flag(bm, op, "newout", ELE_NEW, BM_ALL);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "newout", BM_ALL, ELE_NEW);
BLI_array_free(vmap);
BLI_array_free(emap);
diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c
index 09f815f50d5..3d3cbf09f9a 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"
@@ -268,12 +268,12 @@ void bmo_create_grid_exec(BMesh *bm, BMOperator *op)
BMO_op_exec(bm, &bmop);
BMO_op_finish(bm, &prevop);
- BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", VERT_MARK, BM_VERT);
+ BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", BM_VERT, VERT_MARK);
}
else {
BMO_op_initf(bm, &bmop, "extrude_edge_only edges=%fe", EDGE_ORIG);
BMO_op_exec(bm, &bmop);
- BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", VERT_MARK, BM_VERT);
+ BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", BM_VERT, VERT_MARK);
}
BMO_op_callf(bm, "translate vec=%v verts=%s", vec, &bmop, "geomout");
@@ -283,7 +283,7 @@ void bmo_create_grid_exec(BMesh *bm, BMOperator *op)
if (a)
BMO_op_finish(bm, &bmop);
- BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK);
}
void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op)
@@ -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;
@@ -339,7 +339,7 @@ void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op)
BMO_op_exec(bm, &bmop);
}
- BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", VERT_MARK, BM_VERT);
+ BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", BM_VERT, VERT_MARK);
BMO_op_callf(bm, "rotate cent=%v mat=%m3 verts=%s", vec, cmat, &bmop, "geomout");
prevop = bmop;
@@ -372,7 +372,7 @@ void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op)
}
}
- BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK);
}
void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op)
@@ -427,25 +427,25 @@ void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op)
"esubd edges=%fe smooth=%f numcuts=%i gridfill=%b beauty=%i",
EDGE_MARK, dia, 1, TRUE, B_SPHERE);
BMO_op_exec(bm, &bmop);
- BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", VERT_MARK, BM_VERT);
- BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", EDGE_MARK, BM_EDGE);
+ BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", BM_VERT, VERT_MARK);
+ BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", BM_EDGE, EDGE_MARK);
BMO_op_finish(bm, &bmop);
}
- /* must transform after becayse of sphere subdivision */
+ /* must transform after because of sphere subdivision */
BM_ITER(v, &viter, bm, BM_VERTS_OF_MESH, NULL) {
if (BMO_elem_flag_test(bm, v, VERT_MARK)) {
mul_m4_v3(mat, v->co);
}
}
- BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK);
}
void bmo_create_monkey_exec(BMesh *bm, BMOperator *op)
{
BMVert *eve;
- BMVert **tv = MEM_mallocN(sizeof(*tv)*monkeynv * 2, "tv");
+ BMVert **tv = MEM_mallocN(sizeof(*tv) * monkeynv * 2, "tv");
float mat[4][4];
int i;
@@ -486,7 +486,7 @@ void bmo_create_monkey_exec(BMesh *bm, BMOperator *op)
MEM_freeN(tv);
- BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK);
}
@@ -506,7 +506,7 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
BMO_slot_mat4_get(op, "mat", mat);
phid = 2.0f * (float)M_PI / segs;
- phi = .25f * (float)M_PI;
+ phi = 0;
if (cap_ends) {
vec[0] = vec[1] = 0.0f;
@@ -558,7 +558,7 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
BMO_op_callf(bm, "dissolve_faces faces=%ff", FACE_NEW);
}
- BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK);
}
void bmo_create_cone_exec(BMesh *bm, BMOperator *op)
@@ -579,7 +579,7 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op)
BMO_slot_mat4_get(op, "mat", mat);
phid = 2.0f * (float)M_PI / segs;
- phi = 0.25f * (float)M_PI;
+ phi = 0;
depth *= 0.5f;
if (cap_ends) {
@@ -654,7 +654,7 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op)
BM_face_create_quad_tri(bm, v1, v2, firstv2, firstv1, NULL, FALSE);
BMO_op_callf(bm, "removedoubles verts=%fv dist=%f", VERT_MARK, 0.000001);
- BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK);
}
void bmo_create_cube_exec(BMesh *bm, BMOperator *op)
@@ -732,5 +732,5 @@ void bmo_create_cube_exec(BMesh *bm, BMOperator *op)
BM_face_create_quad_tri(bm, v1, v2, v3, v4, NULL, FALSE);
BM_face_create_quad_tri(bm, v8, v7, v6, v5, NULL, FALSE);
- BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK);
}
diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c
index dce060d326f..79b2e0773d4 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)
{
@@ -42,7 +42,7 @@ static void remdoubles_splitface(BMFace *f, BMesh *bm, BMOperator *op)
BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
v2 = BMO_slot_map_ptr_get(bm, op, "targetmap", l->v);
/* ok: if v2 is NULL (e.g. not in the map) then it's
- * a target vert, otherwise it's a doubl */
+ * a target vert, otherwise it's a double */
if ((v2 && BM_vert_in_face(f, v2)) &&
(v2 != l->prev->v) &&
(v2 != l->next->v))
@@ -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);
@@ -103,6 +103,7 @@ void bmo_weldverts_exec(BMesh *bm, BMOperator *op)
BMFace *f, *f2;
int a, b;
+ /* mark merge verts for deletion */
BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
if ((v2 = BMO_slot_map_ptr_get(bm, op, "targetmap", v))) {
BMO_elem_flag_enable(bm, v, ELE_DEL);
@@ -112,10 +113,12 @@ void bmo_weldverts_exec(BMesh *bm, BMOperator *op)
}
}
+ /* check if any faces are getting their own corners merged
+ together, split face if so */
BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
remdoubles_splitface(f, bm, op);
}
-
+
BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
if (BMO_elem_flag_test(bm, e->v1, ELE_DEL) || BMO_elem_flag_test(bm, e->v2, ELE_DEL)) {
v = BMO_slot_map_ptr_get(bm, op, "targetmap", e->v1);
@@ -149,6 +152,8 @@ void bmo_weldverts_exec(BMesh *bm, BMOperator *op)
}
bm->elem_index_dirty |= BM_FACE;
+ /* faces get "modified" by creating new faces here, then at the
+ end the old faces are deleted */
BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
if (!BMO_elem_flag_test(bm, f, FACE_MARK))
continue;
@@ -368,10 +373,11 @@ void bmo_collapse_exec(BMesh *bm, BMOperator *op)
BMO_op_callf(bm, "collapse_uvs edges=%s", op, "edges");
BMO_op_init(bm, &weldop, "weldverts");
- BMO_slot_buffer_flag_enable(bm, op, "edges", EDGE_MARK, BM_EDGE);
+ BMO_slot_buffer_flag_enable(bm, op, "edges", BM_EDGE, EDGE_MARK);
BMW_init(&walker, bm, BMW_SHELL,
- BMW_MASK_NOP, EDGE_MARK, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_MASK_NOP, EDGE_MARK, BMW_MASK_NOP,
+ BMW_FLAG_NOP, /* BMESH_TODO - should be BMW_FLAG_TEST_HIDDEN ? */
BMW_NIL_LAY);
BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
@@ -412,7 +418,7 @@ void bmo_collapse_exec(BMesh *bm, BMOperator *op)
BLI_array_free(edges);
}
-/* uv collapse functio */
+/* uv collapse function */
static void bmo_collapsecon_do_layer(BMesh *bm, BMOperator *op, int layer)
{
BMIter iter, liter;
@@ -427,16 +433,17 @@ static void bmo_collapsecon_do_layer(BMesh *bm, BMOperator *op, int layer)
/* clear all short flags */
BMO_mesh_flag_disable_all(bm, op, BM_ALL, (1 << 16) - 1);
- BMO_slot_buffer_flag_enable(bm, op, "edges", EDGE_MARK, BM_EDGE);
+ BMO_slot_buffer_flag_enable(bm, op, "edges", BM_EDGE, EDGE_MARK);
BMW_init(&walker, bm, BMW_LOOPDATA_ISLAND,
- BMW_MASK_NOP, EDGE_MARK, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_MASK_NOP, EDGE_MARK, BMW_MASK_NOP,
+ BMW_FLAG_NOP, /* BMESH_TODO - should be BMW_FLAG_TEST_HIDDEN ? */
layer);
BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
if (BMO_elem_flag_test(bm, l->e, EDGE_MARK)) {
- /* wal */
+ /* walk */
BLI_array_empty(blocks);
tot = 0;
l2 = BMW_begin(&walker, l);
@@ -453,7 +460,7 @@ static void bmo_collapsecon_do_layer(BMesh *bm, BMOperator *op, int layer)
CustomData_data_multiply(type, &max, 0.5f);
CustomData_data_add(type, &min, &max);
- /* snap CD (uv, vcol) points to their centroi */
+ /* snap CD (uv, vcol) points to their centroid */
for (i = 0; i < tot; i++) {
CustomData_data_copy_value(type, &min, blocks[i]);
}
@@ -499,19 +506,21 @@ void bmesh_finddoubles_common(BMesh *bm, BMOperator *op, BMOperator *optarget, c
keepvert = BMO_iter_new(&oiter, bm, op, "keepverts", BM_VERT) != NULL;
}
- /* sort by vertex coordinates added togethe */
+ /* sort by vertex coordinates added together */
qsort(verts, BLI_array_count(verts), sizeof(void *), vergaverco);
/* Flag keepverts */
if (keepvert) {
- BMO_slot_buffer_flag_enable(bm, op, "keepverts", VERT_KEEP, BM_VERT);
+ BMO_slot_buffer_flag_enable(bm, op, "keepverts", BM_VERT, VERT_KEEP);
}
len = BLI_array_count(verts);
for (i = 0; i < len; i++) {
v = verts[i];
- if (BMO_elem_flag_test(bm, v, VERT_DOUBLE)) continue;
-
+ if (BMO_elem_flag_test(bm, v, VERT_DOUBLE)) {
+ continue;
+ }
+
for (j = i + 1; j < len; j++) {
v2 = verts[j];
@@ -569,7 +578,7 @@ void bmo_automerge_exec(BMesh *bm, BMOperator *op)
/* The "verts" input sent to this op is the set of verts that
* can be merged away into any other verts. Mark all other verts
* as VERT_KEEP. */
- BMO_slot_buffer_flag_enable(bm, op, "verts", VERT_IN, BM_VERT);
+ BMO_slot_buffer_flag_enable(bm, op, "verts", BM_VERT, VERT_IN);
BM_ITER(v, &viter, bm, BM_VERTS_OF_MESH, NULL) {
if (!BMO_elem_flag_test(bm, v, VERT_IN)) {
BMO_elem_flag_enable(bm, v, VERT_KEEP);
diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c
index c5d370b390a..f9758e3bf7f 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 */
@@ -75,7 +75,7 @@ static BMEdge *connect_smallest_face(BMesh *bm, BMVert *v1, BMVert *v2, BMFace *
/* this isn't the best thing in the world. it doesn't handle cases where there's
* multiple faces yet. that might require a convexity test to figure out which
- * face is "best," and who knows what for non-manifold conditions. */
+ * face is "best" and who knows what for non-manifold conditions. */
for (face = BM_iter_new(&iter, bm, BM_FACES_OF_VERT, v1); face; face = BM_iter_step(&iter)) {
for (v = BM_iter_new(&iter2, bm, BM_VERTS_OF_FACE, face); v; v = BM_iter_step(&iter2)) {
if (v == v2) {
@@ -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;
@@ -94,7 +94,7 @@ static BMEdge *connect_smallest_face(BMesh *bm, BMVert *v1, BMVert *v2, BMFace *
return NULL;
}
/* calculates offset for co, based on fractal, sphere or smooth settings */
-static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const subdparams *params, float perc,
+static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const SubDParams *params, float perc,
BMVert *vsta, BMVert *vend)
{
float tvec[3], prev_co[3], fac;
@@ -104,6 +104,7 @@ static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const subdpar
BM_vert_normal_update_all(bm, v);
co = CustomData_bmesh_get_n(&bm->vdata, v->head.data, CD_SHAPEKEY, params->origkey);
+ copy_v3_v3(co, v->co);
copy_v3_v3(prev_co, co);
if (params->beauty & B_SMOOTH) {
@@ -153,7 +154,7 @@ static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const subdpar
mul_v3_v3(vec2, tvec);
- /* add displacemen */
+ /* add displacement */
add_v3_v3v3(co, co, vec2);
}
@@ -177,7 +178,7 @@ static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const subdpar
/* percent defines the interpolation, rad and flag are for special options */
/* results in new vertex with correct coordinate, vertex normal and weight group info */
static BMVert *bm_subdivide_edge_addvert(BMesh *bm, BMEdge *edge, BMEdge *oedge,
- const subdparams *params, float percent,
+ const SubDParams *params, float percent,
float percent2,
BMEdge **out, BMVert *vsta, BMVert *vend)
{
@@ -205,11 +206,14 @@ static BMVert *bm_subdivide_edge_addvert(BMesh *bm, BMEdge *edge, BMEdge *oedge,
}
#endif
+ interp_v3_v3v3(ev->no, vsta->no, vend->no, percent2);
+ normalize_v3(ev->no);
+
return ev;
}
static BMVert *subdivideedgenum(BMesh *bm, BMEdge *edge, BMEdge *oedge,
- int curpoint, int totpoint, const subdparams *params,
+ int curpoint, int totpoint, const SubDParams *params,
BMEdge **newe, BMVert *vsta, BMVert *vend)
{
BMVert *ev;
@@ -228,7 +232,7 @@ static BMVert *subdivideedgenum(BMesh *bm, BMEdge *edge, BMEdge *oedge,
return ev;
}
-static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const subdparams *params,
+static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const SubDParams *params,
BMVert *vsta, BMVert *vend)
{
BMEdge *eed = edge, *newe, temp = *edge;
@@ -258,7 +262,7 @@ static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const subdparams *par
alter_co(bm, v2, &temp, params, 1.0, &ov1, &ov2);
}
-/* note: the patterns are rotated as necassary to
+/* note: the patterns are rotated as necessary to
* match the input geometry. they're based on the
* pre-split state of the face */
@@ -271,12 +275,12 @@ static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const subdparams *par
* v4---v0---v1
*/
static void quad_1edge_split(BMesh *bm, BMFace *UNUSED(face),
- BMVert **verts, const subdparams *params)
+ BMVert **verts, const SubDParams *params)
{
BMFace *nf;
int i, add, numcuts = params->numcuts;
- /* if it's odd, the middle face is a quad, otherwise it's a triangl */
+ /* if it's odd, the middle face is a quad, otherwise it's a triangle */
if ((numcuts % 2) == 0) {
add = 2;
for (i = 0; i < numcuts; i++) {
@@ -290,7 +294,7 @@ static void quad_1edge_split(BMesh *bm, BMFace *UNUSED(face),
add = 2;
for (i = 0; i < numcuts; i++) {
connect_smallest_face(bm, verts[i], verts[numcuts + add], &nf);
- if (i == numcuts/2) {
+ if (i == numcuts / 2) {
add -= 1;
connect_smallest_face(bm, verts[i], verts[numcuts + add], &nf);
}
@@ -315,7 +319,7 @@ static SubDPattern quad_1edge = {
* v7-v0--v1-v2
*/
static void quad_2edge_split_path(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
- const subdparams *params)
+ const SubDParams *params)
{
BMFace *nf;
int i, numcuts = params->numcuts;
@@ -341,7 +345,7 @@ static SubDPattern quad_2edge_path = {
* v7-v0--v1-v2
*/
static void quad_2edge_split_innervert(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
- const subdparams *params)
+ const SubDParams *params)
{
BMFace *nf;
BMVert *v, *lastv;
@@ -382,7 +386,7 @@ static SubDPattern quad_2edge_innervert = {
*
*/
static void quad_2edge_split_fan(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
- const subdparams *params)
+ const SubDParams *params)
{
BMFace *nf;
/* BMVert *v; */ /* UNUSED */
@@ -413,7 +417,7 @@ static SubDPattern quad_2edge_fan = {
* v9-v0--v1-v2
*/
static void quad_3edge_split(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
- const subdparams *params)
+ const SubDParams *params)
{
BMFace *nf;
int i, add = 0, numcuts = params->numcuts;
@@ -450,7 +454,7 @@ static SubDPattern quad_3edge = {
* it goes from bottom up
*/
static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
- const subdparams *params)
+ const SubDParams *params)
{
BMFace *nf;
BMVert *v, *v1, *v2;
@@ -487,8 +491,8 @@ static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts
BMO_elem_flag_enable(bm, nf, ELE_INNER);
- v1 = lines[(i + 1)*s] = verts[a];
- v2 = lines[(i + 1)*s + s - 1] = verts[b];
+ v1 = lines[(i + 1) * s] = verts[a];
+ v2 = lines[(i + 1) * s + s - 1] = verts[b];
temp = *e;
for (a = 0; a < numcuts; a++) {
@@ -529,7 +533,7 @@ static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts
* s s
*/
static void tri_1edge_split(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
- const subdparams *params)
+ const SubDParams *params)
{
BMFace *nf;
int i, numcuts = params->numcuts;
@@ -555,7 +559,7 @@ static SubDPattern tri_1edge = {
* s s
*/
static void tri_3edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
- const subdparams *params)
+ const SubDParams *params)
{
BMFace *nf;
BMEdge *e, *ne, temp;
@@ -657,20 +661,20 @@ static SubDPattern *patterns[] = {
NULL,
};
-#define PLEN (sizeof(patterns) / sizeof(void *))
+#define PLEN (sizeof(patterns) / sizeof(void *))
-typedef struct subd_facedata {
+typedef struct SubDFaceData {
BMVert *start; SubDPattern *pat;
int totedgesel; //only used if pat was NULL, e.g. no pattern was found
BMFace *face;
-} subd_facedata;
+} SubDFaceData;
void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
{
BMOpSlot *einput;
SubDPattern *pat;
- subdparams params;
- subd_facedata *facedata = NULL;
+ SubDParams params;
+ SubDFaceData *facedata = NULL;
BMIter viter, fiter, liter;
BMVert *v, **verts = NULL;
BMEdge *edge, **edges = NULL;
@@ -685,7 +689,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
int beauty, cornertype, singleedge, gridfill;
int skey, seed, i, j, matched, a, b, numcuts, totesel;
- BMO_slot_buffer_flag_enable(bmesh, op, "edges", SUBD_SPLIT, BM_EDGE);
+ BMO_slot_buffer_flag_enable(bmesh, op, "edges", BM_EDGE, SUBD_SPLIT);
numcuts = BMO_slot_int_get(op, "numcuts");
seed = BMO_slot_int_get(op, "seed");
@@ -730,7 +734,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
patterns[5] = NULL;
}
- /* add a temporary shapekey layer to store displacements on current geometr */
+ /* add a temporary shapekey layer to store displacements on current geometry */
BM_data_layer_add(bmesh, &bmesh->vdata, CD_SHAPEKEY);
skey = CustomData_number_of_layers(&bmesh->vdata, CD_SHAPEKEY) - 1;
@@ -739,9 +743,8 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
copy_v3_v3(co, v->co);
}
- /* first go through and tag edge */
- BMO_slot_from_flag(bmesh, op, "edges",
- SUBD_SPLIT, BM_EDGE);
+ /* first go through and tag edges */
+ BMO_slot_buffer_from_enabled_flag(bmesh, op, "edges", BM_EDGE, SUBD_SPLIT);
params.numcuts = numcuts;
params.op = op;
@@ -755,10 +758,10 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
params.off[2] = (float)BLI_drand() * 200.0f;
BMO_slot_map_to_flag(bmesh, op, "custompatterns",
- FACE_CUSTOMFILL);
+ BM_FACE, FACE_CUSTOMFILL);
BMO_slot_map_to_flag(bmesh, op, "edgepercents",
- EDGE_PERCENT);
+ BM_EDGE, EDGE_PERCENT);
for (face = BM_iter_new(&fiter, bmesh, BM_FACES_OF_MESH, NULL);
face;
@@ -767,7 +770,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
BMEdge *e1 = NULL, *e2 = NULL;
float vec1[3], vec2[3];
- /* figure out which pattern to us */
+ /* figure out which pattern to use */
BLI_array_empty(edges);
BLI_array_empty(verts);
@@ -791,7 +794,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
i++;
}
- /* make sure the two edges have a valid angle to each othe */
+ /* make sure the two edges have a valid angle to each other */
if (totesel == 2 && BM_edge_share_vert_count(e1, e2)) {
float angle;
@@ -831,13 +834,15 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
}
}
- /* obvously don't test for other patterns matchin */
+ /* obvously don't test for other patterns matching */
continue;
}
for (i = 0; i < PLEN; i++) {
pat = patterns[i];
- if (!pat) continue;
+ if (!pat) {
+ continue;
+ }
if (pat->len == face->len) {
for (a = 0; a < pat->len; a++) {
@@ -881,17 +886,23 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
einput = BMO_slot_get(op, "edges");
- /* go through and split edge */
+ /* go through and split edges */
for (i = 0; i < einput->len; i++) {
edge = ((BMEdge **)einput->data.p)[i];
bm_subdivide_multicut(bmesh, edge, &params, edge->v1, edge->v2);
}
+ /* copy original-geometry displacements to current coordinates */
+ BM_ITER(v, &viter, bmesh, BM_VERTS_OF_MESH, NULL) {
+ float *co = CustomData_bmesh_get_n(&bmesh->vdata, v->head.data, CD_SHAPEKEY, skey);
+ copy_v3_v3(v->co, co);
+ }
+
i = 0;
for (i = 0; i < BLI_array_count(facedata); i++) {
face = facedata[i].face;
- /* figure out which pattern to us */
+ /* figure out which pattern to use */
BLI_array_empty(verts);
pat = facedata[i].pat;
@@ -903,7 +914,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
BLI_array_empty(loops);
BLI_array_empty(splits);
- /* for case of two edges, connecting them shouldn't be too har */
+ /* for case of two edges, connecting them shouldn't be too hard */
BM_ITER(l, &liter, bmesh, BM_LOOPS_OF_FACE, face) {
BLI_array_growone(loops);
loops[BLI_array_count(loops) - 1] = l;
@@ -911,7 +922,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
vlen = BLI_array_count(loops);
- /* find the boundary of one of the split edge */
+ /* find the boundary of one of the split edges */
for (a = 1; a < vlen; a++) {
if (!BMO_elem_flag_test(bmesh, loops[a - 1]->v, ELE_INNER) &&
BMO_elem_flag_test(bmesh, loops[a]->v, ELE_INNER))
@@ -948,12 +959,12 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
a = (a + 1) % vlen;
}
- //BM_face_legal_splits(bmesh, face, splits, BLI_array_count(splits)/2);
+ //BM_face_legal_splits(bmesh, face, splits, BLI_array_count(splits) / 2);
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);
}
}
@@ -990,7 +1001,7 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
pat->connectexec(bmesh, face, verts, &params);
}
- /* copy original-geometry displacements to current coordinate */
+ /* copy original-geometry displacements to current coordinates */
BM_ITER(v, &viter, bmesh, BM_VERTS_OF_MESH, NULL) {
float *co = CustomData_bmesh_get_n(&bmesh->vdata, v->head.data, CD_SHAPEKEY, skey);
copy_v3_v3(v->co, co);
@@ -1004,20 +1015,17 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
BLI_array_free(splits);
BLI_array_free(loops);
- BMO_slot_from_flag(bmesh, op, "outinner",
- ELE_INNER, BM_ALL);
- BMO_slot_from_flag(bmesh, op, "outsplit",
- ELE_SPLIT, BM_ALL);
+ BMO_slot_buffer_from_enabled_flag(bmesh, op, "outinner", BM_ALL, ELE_INNER);
+ BMO_slot_buffer_from_enabled_flag(bmesh, op, "outsplit", BM_ALL, ELE_SPLIT);
- BMO_slot_from_flag(bmesh, op, "geomout",
- ELE_INNER|ELE_SPLIT|SUBD_SPLIT, BM_ALL);
+ BMO_slot_buffer_from_enabled_flag(bmesh, op, "geomout", BM_ALL, ELE_INNER|ELE_SPLIT|SUBD_SPLIT);
}
-/* editmesh-emulating functio */
+/* editmesh-emulating function */
void BM_mesh_esubdivideflag(Object *UNUSED(obedit), BMesh *bm, int flag, float smooth,
- float fractal, int beauty, int numcuts,
- int seltype, int cornertype, int singleedge,
- int gridfill, int seed)
+ float fractal, int beauty, int numcuts,
+ int seltype, int cornertype, int singleedge,
+ int gridfill, int seed)
{
BMOperator op;
@@ -1045,7 +1053,7 @@ void BM_mesh_esubdivideflag(Object *UNUSED(obedit), BMesh *bm, int flag, float s
// int i;
/* deselect input */
- BM_mesh_elem_flag_disable_all(bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT);
+ BM_mesh_elem_flag_disable_all(bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE);
ele = BMO_iter_new(&iter, bm, &op, "outinner", BM_EDGE|BM_VERT);
for ( ; ele; ele = BMO_iter_step(&iter)) {
@@ -1061,14 +1069,12 @@ void BM_mesh_esubdivideflag(Object *UNUSED(obedit), BMesh *bm, int flag, float s
BM_elem_flag_test(e->v2, BM_ELEM_SELECT))
{
BM_elem_select_set(bm, e, TRUE);
- bm->totedgesel += 1;
}
else if (BM_elem_flag_test(e, BM_ELEM_SELECT) &&
(!BM_elem_flag_test(e->v1, BM_ELEM_SELECT) ||
!BM_elem_flag_test(e->v2, BM_ELEM_SELECT)))
{
BM_elem_select_set(bm, e, FALSE);
- bm->totedgesel -= 1;
}
}
}
@@ -1082,10 +1088,10 @@ void bmo_edgebisect_exec(BMesh *bm, BMOperator *op)
{
BMOIter siter;
BMEdge *e;
- subdparams params;
+ SubDParams params = {0};
int skey;
- params.numcuts = BMO_slot_get(op, "numcuts")->data.i;
+ params.numcuts = BMO_slot_int_get(op, "numcuts");
params.op = op;
BM_data_layer_add(bm, &bm->vdata, CD_SHAPEKEY);
@@ -1093,12 +1099,12 @@ void bmo_edgebisect_exec(BMesh *bm, BMOperator *op)
params.origkey = skey;
- /* go through and split edge */
+ /* go through and split edges */
BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) {
bm_subdivide_multicut(bm, e, &params, e->v1, e->v2);
}
- BMO_slot_from_flag(bm, op, "outsplit", ELE_SPLIT, BM_ALL);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "outsplit", BM_ALL, ELE_SPLIT);
BM_data_layer_free_n(bm, &bm->vdata, CD_SHAPEKEY, skey);
}
diff --git a/source/blender/bmesh/operators/bmo_subdivide.h b/source/blender/bmesh/operators/bmo_subdivide.h
index dd5198bdc30..24d621aed8e 100644
--- a/source/blender/bmesh/operators/bmo_subdivide.h
+++ b/source/blender/bmesh/operators/bmo_subdivide.h
@@ -27,7 +27,7 @@
* \ingroup bmesh
*/
-typedef struct subdparams {
+typedef struct SubDParams {
int numcuts;
float smooth;
float fractal;
@@ -36,10 +36,10 @@ typedef struct subdparams {
int origkey; /* shapekey holding displaced vertex coordinates for current geometry */
BMOperator *op;
float off[3];
-} subdparams;
+} SubDParams;
typedef void (*subd_pattern_fill_fp)(BMesh *bm, BMFace *face, BMVert **verts,
- const subdparams *params);
+ const SubDParams *params);
/*
* note: this is a pattern-based edge subdivider.
diff --git a/source/blender/bmesh/operators/bmo_triangulate.c b/source/blender/bmesh/operators/bmo_triangulate.c
index b3f4fefa36e..47d17717567 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++) {
@@ -71,8 +72,8 @@ void bmo_triangulate_exec(BMesh *bm, BMOperator *op)
}
}
- BMO_slot_from_flag(bm, op, "edgeout", EDGE_NEW, BM_EDGE);
- BMO_slot_from_flag(bm, op, "faceout", FACE_NEW, BM_FACE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "edgeout", BM_EDGE, EDGE_NEW);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "faceout", BM_FACE, FACE_NEW);
BLI_array_free(projectverts);
BLI_array_free(newfaces);
@@ -86,7 +87,7 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op)
BMEdge *e;
int stop = 0;
- BMO_slot_buffer_flag_enable(bm, op, "constrain_edges", EDGE_MARK, BM_EDGE);
+ BMO_slot_buffer_flag_enable(bm, op, "constrain_edges", BM_EDGE, EDGE_MARK);
BMO_ITER(f, &siter, bm, op, "faces", BM_FACE) {
if (f->len == 3) {
@@ -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);
@@ -151,7 +152,7 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op)
}
}
- BMO_slot_from_flag(bm, op, "geomout", ELE_NEW, BM_EDGE|BM_FACE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "geomout", BM_EDGE|BM_FACE, ELE_NEW);
}
void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
@@ -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 */
}
@@ -212,8 +213,8 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
/* clean up fill */
BMO_op_initf(bm, &bmop, "beautify_fill faces=%ff constrain_edges=%fe", ELE_NEW, EDGE_MARK);
BMO_op_exec(bm, &bmop);
- BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", ELE_NEW, BM_FACE|BM_EDGE);
+ BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", BM_FACE|BM_EDGE, ELE_NEW);
BMO_op_finish(bm, &bmop);
- BMO_slot_from_flag(bm, op, "geomout", ELE_NEW, BM_EDGE|BM_FACE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "geomout", BM_EDGE|BM_FACE, ELE_NEW);
}
diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c
index 278512a29c3..6a994524e5f 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
@@ -49,7 +49,7 @@ void bmo_makevert_exec(BMesh *bm, BMOperator *op)
BMO_slot_vec_get(op, "co", vec);
BMO_elem_flag_enable(bm, BM_vert_create(bm, vec, NULL), 1);
- BMO_slot_from_flag(bm, op, "newvertout", 1, BM_VERT);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "newvertout", BM_VERT, 1);
}
void bmo_transform_exec(BMesh *bm, BMOperator *op)
@@ -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);
+
+ /* don't touch again */
+ BMO_elem_flag_enable(bm, fa, FACE_TAINT);
+ BMO_elem_flag_enable(bm, fb, FACE_TAINT);
+ }
+ }
+ }
}
- BMO_slot_from_flag(bm, op, "edgeout", 1, BM_EDGE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "edgeout", BM_EDGE, EDGE_OUT);
+
+#undef EDGE_OUT
+#undef FACE_TAINT
+
}
#define SEL_FLAG 1
@@ -226,14 +259,14 @@ void bmo_regionextend_exec(BMesh *bm, BMOperator *op)
int use_faces = BMO_slot_bool_get(op, "use_faces");
int constrict = BMO_slot_bool_get(op, "constrict");
- BMO_slot_buffer_flag_enable(bm, op, "geom", SEL_ORIG, BM_ALL);
+ BMO_slot_buffer_flag_enable(bm, op, "geom", BM_ALL, SEL_ORIG);
if (constrict)
bmo_regionextend_constrict(bm, op, use_faces);
else
bmo_regionextend_extend(bm, op, use_faces);
- BMO_slot_from_flag(bm, op, "geomout", SEL_FLAG, BM_ALL);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "geomout", BM_ALL, SEL_FLAG);
}
/********* righthand faces implementation ****** */
@@ -277,7 +310,7 @@ void bmo_righthandfaces_exec(BMesh *bm, BMOperator *op)
startf = NULL;
maxx = -1.0e10;
- BMO_slot_buffer_flag_enable(bm, op, "faces", FACE_FLAG, BM_FACE);
+ BMO_slot_buffer_flag_enable(bm, op, "faces", BM_FACE, FACE_FLAG);
/* find a starting face */
BMO_ITER(f, &siter, bm, op, "faces", BM_FACE) {
@@ -433,11 +466,11 @@ void bmo_vertexsmooth_exec(BMesh *bm, BMOperator *op)
*/
static float ngon_perimeter(BMesh *bm, BMFace *f)
{
- BMIter liter;
- BMLoop *l;
- int num_verts = 0;
- float v[3], sv[3];
- float perimeter = 0.0f;
+ BMIter liter;
+ BMLoop *l;
+ int num_verts = 0;
+ float v[3], sv[3];
+ float perimeter = 0.0f;
BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
if (num_verts == 0) {
@@ -465,11 +498,11 @@ static float ngon_perimeter(BMesh *bm, BMFace *f)
*/
static float ngon_fake_area(BMesh *bm, BMFace *f)
{
- BMIter liter;
- BMLoop *l;
- int num_verts = 0;
- float v[3], sv[3], c[3];
- float area = 0.0f;
+ BMIter liter;
+ BMLoop *l;
+ int num_verts = 0;
+ float v[3], sv[3], c[3];
+ float area = 0.0f;
BM_face_center_mean_calc(bm, f, c);
@@ -494,16 +527,16 @@ static float ngon_fake_area(BMesh *bm, BMFace *f)
/*
* extra face data (computed data)
*/
-typedef struct tmp_face_ext {
- BMFace *f; /* the face */
- float c[3]; /* center */
+typedef struct SimSel_FaceExt {
+ BMFace *f; /* the face */
+ float c[3]; /* center */
union {
- float area; /* area */
- float perim; /* perimeter */
- float d; /* 4th component of plane (the first three being the normal) */
- struct Image *t; /* image pointer */
+ float area; /* area */
+ float perim; /* perimeter */
+ float d; /* 4th component of plane (the first three being the normal) */
+ struct Image *t; /* image pointer */
};
-} tmp_face_ext;
+} SimSel_FaceExt;
/*
* Select similar faces, the choices are in the enum in source/blender/bmesh/bmesh_operators.h
@@ -516,7 +549,7 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op)
BMOIter fs_iter;
int num_sels = 0, num_total = 0, i = 0, idx = 0;
float angle = 0.0f;
- tmp_face_ext *f_ext = NULL;
+ SimSel_FaceExt *f_ext = NULL;
int *indices = NULL;
float t_no[3]; /* temporary normal */
int type = BMO_slot_int_get(op, "type");
@@ -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);
@@ -539,8 +572,8 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op)
}
/* allocate memory for the selected faces indices and for all temporary faces */
- indices = (int *)MEM_callocN(sizeof(int) * num_sels, "face indices util.c");
- f_ext = (tmp_face_ext *)MEM_callocN(sizeof(tmp_face_ext) * num_total, "f_ext util.c");
+ indices = (int *)MEM_callocN(sizeof(int) * num_sels, "face indices util.c");
+ f_ext = (SimSel_FaceExt *)MEM_callocN(sizeof(SimSel_FaceExt) * num_total, "f_ext util.c");
/* loop through all the faces and fill the faces/indices structure */
BM_ITER(fm, &fm_iter, bm, BM_FACES_OF_MESH, NULL) {
@@ -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) {
@@ -653,23 +686,23 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op)
MEM_freeN(indices);
/* transfer all marked faces to the output slot */
- BMO_slot_from_flag(bm, op, "faceout", FACE_MARK, BM_FACE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "faceout", BM_FACE, FACE_MARK);
}
-/******************************************************************************
-** Similar Edges
-**************************************************************************** */
-#define EDGE_MARK 1
+/**************************************************************************** *
+ * Similar Edges
+ **************************************************************************** */
+#define EDGE_MARK 1
/*
* compute the angle of an edge (i.e. the angle between two faces)
*/
static float edge_angle(BMesh *bm, BMEdge *e)
{
- BMIter fiter;
- BMFace *f, *f_prev = NULL;
+ BMIter fiter;
+ BMFace *f, *f_prev = NULL;
- /* first edge faces, dont account for 3+ */
+ /* first edge faces, don't account for 3+ */
BM_ITER(f, &fiter, bm, BM_FACES_OF_EDGE, e) {
if (f_prev == NULL) {
@@ -685,18 +718,18 @@ static float edge_angle(BMesh *bm, BMEdge *e)
/*
* extra edge information
*/
-typedef struct tmp_edge_ext {
- BMEdge *e;
+typedef struct SimSel_EdgeExt {
+ BMEdge *e;
union {
- float dir[3];
- float angle; /* angle between the face */
+ float dir[3];
+ float angle; /* angle between the face */
};
union {
- float length; /* edge length */
- int faces; /* faces count */
+ float length; /* edge length */
+ int faces; /* faces count */
};
-} tmp_edge_ext;
+} SimSel_EdgeExt;
/*
* select similar edges: the choices are in the enum in source/blender/bmesh/bmesh_operators.h
@@ -705,12 +738,12 @@ typedef struct tmp_edge_ext {
void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
{
BMOIter es_iter; /* selected edges iterator */
- BMIter e_iter; /* mesh edges iterator */
- BMEdge *es; /* selected edge */
- BMEdge *e; /* mesh edge */
+ BMIter e_iter; /* mesh edges iterator */
+ BMEdge *es; /* selected edge */
+ BMEdge *e; /* mesh edge */
int idx = 0, i = 0 /* , f = 0 */;
int *indices = NULL;
- tmp_edge_ext *e_ext = NULL;
+ SimSel_EdgeExt *e_ext = NULL;
// float *angles = NULL;
float angle;
@@ -727,8 +760,8 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
}
/* allocate memory for the selected edges indices and for all temporary edges */
- indices = (int *)MEM_callocN(sizeof(int) * num_sels, "indices util.c");
- e_ext = (tmp_edge_ext *)MEM_callocN(sizeof(tmp_edge_ext) * num_total, "e_ext util.c");
+ indices = (int *)MEM_callocN(sizeof(int) * num_sels, "indices util.c");
+ e_ext = (SimSel_EdgeExt *)MEM_callocN(sizeof(SimSel_EdgeExt) * num_total, "e_ext util.c");
/* loop through all the edges and fill the edges/indices structure */
BM_ITER(e, &e_iter, bm, BM_EDGES_OF_MESH, NULL) {
@@ -745,7 +778,7 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
for (i = 0; i < num_total; i++) {
switch (type) {
case SIMEDGE_LENGTH: /* compute the length of the edge */
- e_ext[i].length = len_v3v3(e_ext[i].e->v1->co, e_ext[i].e->v2->co);
+ e_ext[i].length = len_v3v3(e_ext[i].e->v1->co, e_ext[i].e->v2->co);
break;
case SIMEDGE_DIR: /* compute the direction */
@@ -753,11 +786,11 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
break;
case SIMEDGE_FACE: /* count the faces around the edge */
- e_ext[i].faces = BM_edge_face_count(e_ext[i].e);
+ e_ext[i].faces = BM_edge_face_count(e_ext[i].e);
break;
case SIMEDGE_FACE_ANGLE:
- e_ext[i].faces = BM_edge_face_count(e_ext[i].e);
+ e_ext[i].faces = BM_edge_face_count(e_ext[i].e);
if (e_ext[i].faces == 2)
e_ext[i].angle = edge_angle(bm, e_ext[i].e);
break;
@@ -850,21 +883,21 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
MEM_freeN(indices);
/* transfer all marked edges to the output slot */
- BMO_slot_from_flag(bm, op, "edgeout", EDGE_MARK, BM_EDGE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "edgeout", BM_EDGE, EDGE_MARK);
}
-/******************************************************************************
-** Similar Vertices
-**************************************************************************** */
+/**************************************************************************** *
+ * Similar Vertices
+ **************************************************************************** */
#define VERT_MARK 1
-typedef struct tmp_vert_ext {
+typedef struct SimSel_VertExt {
BMVert *v;
union {
int num_faces; /* adjacent faces */
MDeformVert *dvert; /* deform vertex */
};
-} tmp_vert_ext;
+} SimSel_VertExt;
/*
* select similar vertices: the choices are in the enum in source/blender/bmesh/bmesh_operators.h
@@ -876,7 +909,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op)
BMIter v_iter; /* mesh verts iterator */
BMVert *vs; /* selected vertex */
BMVert *v; /* mesh vertex */
- tmp_vert_ext *v_ext = NULL;
+ SimSel_VertExt *v_ext = NULL;
int *indices = NULL;
int num_total = 0, num_sels = 0, i = 0, idx = 0;
int type = BMO_slot_int_get(op, "type");
@@ -891,8 +924,8 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op)
}
/* allocate memory for the selected vertices indices and for all temporary vertices */
- indices = (int *)MEM_mallocN(sizeof(int) * num_sels, "vertex indices");
- v_ext = (tmp_vert_ext *)MEM_mallocN(sizeof(tmp_vert_ext) * num_total, "vertex extra");
+ indices = (int *)MEM_mallocN(sizeof(int) * num_sels, "vertex indices");
+ v_ext = (SimSel_VertExt *)MEM_mallocN(sizeof(SimSel_VertExt) * num_total, "vertex extra");
/* loop through all the vertices and fill the vertices/indices structure */
BM_ITER(v, &v_iter, bm, BM_VERTS_OF_MESH, NULL) {
@@ -905,7 +938,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op)
switch (type) {
case SIMVERT_FACE:
/* calling BM_vert_face_count every time is time consumming, so call it only once per vertex */
- v_ext[i].num_faces = BM_vert_face_count(v);
+ v_ext[i].num_faces = BM_vert_face_count(v);
break;
case SIMVERT_VGROUP:
@@ -966,12 +999,12 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op)
MEM_freeN(indices);
MEM_freeN(v_ext);
- BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK);
}
-/******************************************************************************
-** Cycle UVs for a face
-**************************************************************************** */
+/**************************************************************************** *
+ * Cycle UVs for a face
+ **************************************************************************** */
void bmo_face_rotateuvs_exec(BMesh *bm, BMOperator *op)
{
@@ -1036,9 +1069,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)
{
@@ -1079,9 +1112,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)
{
@@ -1145,9 +1178,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)
{
@@ -1187,16 +1220,16 @@ void bmo_face_reversecolors_exec(BMesh *bm, BMOperator *op)
}
-/******************************************************************************
-** shortest vertex path select
-**************************************************************************** */
+/*************************************************************************** *
+ * shortest vertex path select
+ *************************************************************************** */
-typedef struct element_node {
+typedef struct ElemNode {
BMVert *v; /* vertex */
BMVert *parent; /* node parent id */
float weight; /* node weight */
HeapNode *hn; /* heap node */
-} element_node;
+} ElemNode;
void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
{
@@ -1206,7 +1239,7 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
BMVert *v; /* mesh vertex */
Heap *h = NULL;
- element_node *vert_list = NULL;
+ ElemNode *vert_list = NULL;
int num_total = 0 /*, num_sels = 0 */, i = 0;
int type = BMO_slot_int_get(op, "type");
@@ -1221,7 +1254,7 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
num_total = BM_mesh_elem_count(bm, BM_VERT);
/* allocate memory for the nodes */
- vert_list = (element_node *)MEM_mallocN(sizeof(element_node) * num_total, "vertex nodes");
+ vert_list = (ElemNode *)MEM_mallocN(sizeof(ElemNode) * num_total, "vertex nodes");
/* iterate through all the mesh vertices */
/* loop through all the vertices and fill the vertices/indices structure */
@@ -1236,8 +1269,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;
@@ -1294,5 +1327,5 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
BLI_heap_free(h, NULL);
MEM_freeN(vert_list);
- BMO_slot_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT);
+ BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK);
}
diff --git a/source/blender/bmesh/tools/BME_bevel.c b/source/blender/bmesh/tools/BME_bevel.c
index 11153215f26..3b8337f46ae 100644
--- a/source/blender/bmesh/tools/BME_bevel.c
+++ b/source/blender/bmesh/tools/BME_bevel.c
@@ -33,15 +33,17 @@
#include "DNA_meshdata_types.h"
#include "DNA_mesh_types.h"
-#include "BKE_utildefines.h"
-#include "BKE_tessmesh.h"
-#include "BKE_bmesh.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
+#include "BLI_memarena.h"
+
+#include "BKE_utildefines.h"
+#include "BKE_tessmesh.h"
+#include "BKE_bmesh.h"
#include "bmesh.h"
-#include "bmesh_private.h"
+#include "intern/bmesh_private.h"
/* BMESH_TODO
*
@@ -150,7 +152,7 @@ static int BME_Bevel_Dissolve_Disk(BMesh *bm, BMVert *v)
BMEdge *e, *elast;
BMLoop *l1, *l2;
- if (!BM_vert_is_manifold(bm, v)) {
+ if (!BM_vert_is_manifold(v)) {
return 0;
}
@@ -165,7 +167,18 @@ static int BME_Bevel_Dissolve_Disk(BMesh *bm, BMVert *v)
e = v->e;
l1 = e->l;
l2 = l1->radial_next;
- bmesh_jfke(bm, l1->f, l2->f, e);
+ if (l1->v == l2->v) {
+ /* faces have incompatible directions; need to reverse one */
+ if (!bmesh_loop_reverse(bm, l2->f)) {
+ BLI_assert(!"bevel dissolve disk cannot reverse loop");
+ return 0;
+ }
+ l2 = l1->radial_next;
+ }
+ if (!bmesh_jfke(bm, l1->f, l2->f, e)) {
+ BLI_assert(!"bevel dissolve disk cannot join faces");
+ return 0;
+ }
}
e = v->e;
@@ -177,6 +190,14 @@ static int BME_Bevel_Dissolve_Disk(BMesh *bm, BMVert *v)
l1 = elast->l;
l2 = l1->radial_next;
+ if (l1->v == l2->v) {
+ /* faces have incompatible directions */
+ if (!bmesh_loop_reverse(bm, l2->f)) {
+ BLI_assert(!"bevel dissolve disk cannot reverse loop");
+ return 0;
+ }
+ l2 = l1->radial_next;
+ }
bmesh_jfke(bm, l1->f, l2->f, elast);
}
@@ -280,6 +301,9 @@ static BMVert *BME_bevel_split_edge(BMesh *bm, BMVert *v, BMVert *v1, BMLoop *l,
float maxfactor, scale, len, dis, vec1[3], vec2[3], t_up_vec[3];
int is_edge, forward, is_split_vert;
+ /* ov, vtd2, and is_split_vert are set but UNUSED */
+ (void)ov, (void)vtd2, (void)is_split_vert;
+
if (l == NULL) {
/* what you call operator overloading in C :)
* I wanted to use the same function for both wire edges and poly loops
@@ -543,14 +567,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);
@@ -559,7 +583,7 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti
/* find saved loop pointer */
l = se->l;
while (l->f != jf) {
- l = bmesh_radial_loop_next(l);
+ l = l->radial_next;
BLI_assert(l != se->l);
}
l = l->prev;
@@ -589,14 +613,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);
@@ -605,13 +629,13 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti
/* find saved loop pointer */
l = se->l;
while (l->f != jf) {
- l = bmesh_radial_loop_next(l);
+ l = l->radial_next;
BLI_assert(l != se->l);
}
}
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;
}
@@ -626,7 +650,7 @@ static BMLoop *BME_bevel_edge(BMesh *bm, BMLoop *l, float value, int UNUSED(opti
static BMLoop *BME_bevel_vert(BMesh *bm, BMLoop *l, float value, int UNUSED(options), float *up_vec, BME_TransData_Head *td)
{
BMVert *v1, *v2;
- BMFace *f;
+ /* BMFace *f; */ /* UNUSED */
/* get/make the first vert to be used in SFME */
/* may need to split the previous edge */
@@ -639,7 +663,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;
}
@@ -823,17 +847,17 @@ static void bevel_init_edges(BMesh *bm, int options, BME_TransData_Head *td)
BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
weight = 0.0;
if (!BMO_elem_flag_test(bm, e, BME_BEVEL_NONMAN)) {
- if(options & BME_BEVEL_SELECT) {
- if(BM_elem_flag_test(e, BM_ELEM_SELECT)) weight = 1.0;
+ if (options & BME_BEVEL_SELECT) {
+ if (BM_elem_flag_test(e, BM_ELEM_SELECT)) weight = 1.0;
}
- else if(options & BME_BEVEL_WEIGHT) {
+ else if (options & BME_BEVEL_WEIGHT) {
weight = BM_elem_float_data_get(&bm->edata, e, CD_BWEIGHT);
}
else {
weight = 1.0;
}
- if(weight > 0.0) {
+ if (weight > 0.0) {
BMO_elem_flag_enable(bm, e, BME_BEVEL_BEVEL);
BMO_elem_flag_enable(bm, e->v1, BME_BEVEL_BEVEL);
BMO_elem_flag_enable(bm, e->v2, BME_BEVEL_BEVEL);
@@ -845,9 +869,9 @@ static void bevel_init_edges(BMesh *bm, int options, BME_TransData_Head *td)
/* clean up edges with 2 faces that share more than one edg */
BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
- if(BMO_elem_flag_test(bm, e, BME_BEVEL_BEVEL)) {
+ if (BMO_elem_flag_test(bm, e, BME_BEVEL_BEVEL)) {
count = BM_face_share_edge_count(e->l->f, e->l->radial_next->f);
- if(count > 1) BMO_elem_flag_disable(bm, e, BME_BEVEL_BEVEL);
+ if (count > 1) BMO_elem_flag_disable(bm, e, BME_BEVEL_BEVEL);
}
}
}
@@ -863,15 +887,15 @@ static BMesh *BME_bevel_initialize(BMesh *bm, int options, int UNUSED(defgrp_ind
/* tag non-manifold geometr */
BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
BMO_elem_flag_enable(bm, v, BME_BEVEL_ORIG);
- if(v->e) {
+ if (v->e) {
BME_assign_transdata(td, bm, v, v->co, v->co, NULL, NULL, 0, -1, -1, NULL);
- if (!BM_vert_is_manifold(bm, v)) {
+ if (!BM_vert_is_manifold(v)) {
BMO_elem_flag_enable(bm, v, BME_BEVEL_NONMAN);
}
/* test wire ver */
len = BM_vert_edge_count(v);
- if (len == 2 && BM_vert_is_wire(bm, v))
+ if (len == 2 && BM_vert_is_wire(v))
BMO_elem_flag_disable(bm, v, BME_BEVEL_NONMAN);
}
else {
@@ -881,12 +905,12 @@ static BMesh *BME_bevel_initialize(BMesh *bm, int options, int UNUSED(defgrp_ind
BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
BMO_elem_flag_enable(bm, e, BME_BEVEL_ORIG);
- if (!BM_edge_is_manifold(bm, e)) {
+ if (!BM_edge_is_manifold(e)) {
BMO_elem_flag_enable(bm, e->v1, BME_BEVEL_NONMAN);
BMO_elem_flag_enable(bm, e->v2, BME_BEVEL_NONMAN);
BMO_elem_flag_enable(bm, e, BME_BEVEL_NONMAN);
}
- if(BMO_elem_flag_test(bm, e->v1, BME_BEVEL_NONMAN) || BMO_elem_flag_test(bm, e->v2, BME_BEVEL_NONMAN)) {
+ if (BMO_elem_flag_test(bm, e->v1, BME_BEVEL_NONMAN) || BMO_elem_flag_test(bm, e->v2, BME_BEVEL_NONMAN)) {
BMO_elem_flag_enable(bm, e, BME_BEVEL_NONMAN);
}
}
@@ -895,7 +919,7 @@ static BMesh *BME_bevel_initialize(BMesh *bm, int options, int UNUSED(defgrp_ind
BMO_elem_flag_enable(bm, f, BME_BEVEL_ORIG);
}
- if(options & BME_BEVEL_VERT) {
+ if (options & BME_BEVEL_VERT) {
bevel_init_verts(bm, options, td);
}
else {
@@ -956,40 +980,40 @@ static BMesh *BME_bevel_mesh(BMesh *bm, float value, int UNUSED(res), int option
/* bevel poly */
BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
- if(BMO_elem_flag_test(bm, f, BME_BEVEL_ORIG)) {
+ if (BMO_elem_flag_test(bm, f, BME_BEVEL_ORIG)) {
BME_bevel_poly(bm, f, value, options, td);
}
}
/* get rid of beveled edge */
BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
- if(BMO_elem_flag_test(bm, e, BME_BEVEL_BEVEL) && BMO_elem_flag_test(bm, e, BME_BEVEL_ORIG)) {
+ if (BMO_elem_flag_test(bm, e, BME_BEVEL_BEVEL) && BMO_elem_flag_test(bm, e, BME_BEVEL_ORIG)) {
BM_faces_join_pair(bm, e->l->f, e->l->radial_next->f, e);
}
}
/* link up corners and cli */
BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
- if(BMO_elem_flag_test(bm, v, BME_BEVEL_ORIG) && BMO_elem_flag_test(bm, v, BME_BEVEL_BEVEL)) {
+ if (BMO_elem_flag_test(bm, v, BME_BEVEL_ORIG) && BMO_elem_flag_test(bm, v, BME_BEVEL_BEVEL)) {
curedge = v->e;
- do{
+ do {
l = curedge->l;
l2 = l->radial_next;
- 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 */
- if(l2->f->len > 3)
- BM_face_split(bm, l2->f, l2->next->v, l2->prev->v, &l, l2->e); /* clip this corner off */
+ 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, 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, FALSE); /* clip this corner off */
curedge = bmesh_disk_edge_next(curedge, v);
- } while(curedge != v->e);
+ } while (curedge != v->e);
BME_Bevel_Dissolve_Disk(bm, v);
}
}
/* Debug print, remov */
BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
- if(f->len == 2) {
+ if (f->len == 2) {
printf("warning");
}
}
@@ -997,7 +1021,8 @@ static BMesh *BME_bevel_mesh(BMesh *bm, float value, int UNUSED(res), int option
return bm;
}
-BMesh *BME_bevel(BMEditMesh *em, float value, int res, int options, int defgrp_index, float angle, BME_TransData_Head **rtd)
+BMesh *BME_bevel(BMEditMesh *em, float value, int res, int options, int defgrp_index, float angle,
+ BME_TransData_Head **rtd, int do_tessface)
{
BMesh *bm = em->bm;
BMVert *v;
@@ -1026,7 +1051,11 @@ BMesh *BME_bevel(BMEditMesh *em, float value, int res, int options, int defgrp_i
BMO_pop(bm);
}
- BMEdit_RecalcTesselation(em);
+ /* possibly needed when running as a tool (which is no longer functional)
+ * but keep as an optioin for now */
+ if (do_tessface) {
+ BMEdit_RecalcTessellation(em);
+ }
/* interactive preview? */
if (rtd) {
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp
index b8bd3ab9fd6..778e3029266 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -40,7 +40,7 @@ void forEachObjectInScene(Scene *sce, Functor &f)
void AnimationExporter::exportAnimations(Scene *sce)
{
- if(hasAnimations(sce)) {
+ if (hasAnimations(sce)) {
this->scene = sce;
openLibrary();
@@ -59,7 +59,7 @@ void AnimationExporter::operator() (Object *ob)
/* bool isMatAnim = false; */ /* UNUSED */
//Export transform animations
- if(ob->adt && ob->adt->action)
+ if (ob->adt && ob->adt->action)
{
fcu = (FCurve*)ob->adt->action->curves.first;
@@ -88,7 +88,7 @@ void AnimationExporter::operator() (Object *ob)
}
//Export Lamp parameter animations
- if( (ob->type == OB_LAMP ) && ((Lamp*)ob ->data)->adt && ((Lamp*)ob ->data)->adt->action )
+ if ( (ob->type == OB_LAMP ) && ((Lamp*)ob ->data)->adt && ((Lamp*)ob ->data)->adt->action )
{
fcu = (FCurve*)(((Lamp*)ob ->data)->adt->action->curves.first);
while (fcu) {
@@ -102,7 +102,7 @@ void AnimationExporter::operator() (Object *ob)
}
//Export Camera parameter animations
- if( (ob->type == OB_CAMERA ) && ((Camera*)ob ->data)->adt && ((Camera*)ob ->data)->adt->action )
+ if ( (ob->type == OB_CAMERA ) && ((Camera*)ob ->data)->adt && ((Camera*)ob ->data)->adt->action )
{
fcu = (FCurve*)(((Camera*)ob ->data)->adt->action->curves.first);
while (fcu) {
@@ -117,11 +117,11 @@ void AnimationExporter::operator() (Object *ob)
}
//Export Material parameter animations.
- for(int a = 0; a < ob->totcol; a++)
+ for (int a = 0; a < ob->totcol; a++)
{
Material *ma = give_current_material(ob, a+1);
if (!ma) continue;
- if(ma->adt && ma->adt->action)
+ if (ma->adt && ma->adt->action)
{
/* isMatAnim = true; */
fcu = (FCurve*)ma->adt->action->curves.first;
@@ -152,15 +152,15 @@ float * AnimationExporter::get_eul_source_for_quat(Object *ob )
{
char * transformName = extract_transform_name( fcu->rna_path );
- if( !strcmp(transformName, "rotation_quaternion") ) {
- for ( int i = 0 ; i < fcu->totvert ; i++){
+ if ( !strcmp(transformName, "rotation_quaternion") ) {
+ for ( int i = 0 ; i < fcu->totvert ; i++) {
*(quat + ( i * 4 ) + fcu->array_index) = fcu->bezt[i].vec[1][1];
}
}
fcu = fcu->next;
}
- for ( int i = 0 ; i < keys ; i++){
+ for ( int i = 0 ; i < keys ; i++) {
for ( int j = 0;j<4;j++)
temp_quat[j] = quat[(i*4)+j];
@@ -184,7 +184,7 @@ std::string AnimationExporter::getObjectBoneName( Object* ob,const FCurve* fcu )
char* boneName = strtok((char *)rna_path.c_str(), "\"");
boneName = strtok(NULL,"\"");
- if( boneName != NULL )
+ if ( boneName != NULL )
return /*id_name(ob) + "_" +*/ std::string(boneName);
else
return id_name(ob);
@@ -257,7 +257,7 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa
std::string output_id;
//quat rotations are skipped for now, because of complications with determining axis.
- if(quatRotation)
+ if (quatRotation)
{
float * eul = get_eul_source_for_quat(ob);
float * eul_axis = (float*)MEM_callocN(sizeof(float) * fcu->totvert, "quat output source values");
@@ -317,7 +317,7 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa
target = get_camera_id(ob)
+ "/" + get_camera_param_sid(fcu->rna_path, -1, axis_name, true);
- if( ma )
+ if ( ma )
target = translate_id(id_name(ma)) + "-effect"
+"/common/" /*profile common is only supported */ + get_transform_sid(fcu->rna_path, -1, axis_name, true);
}
@@ -335,8 +335,7 @@ void AnimationExporter::write_bone_animation_matrix(Object *ob_arm, Bone *bone)
return;
//This will only export animations of bones in deform group.
- /*if(!is_bone_deform_group(bone))
- return;*/
+ /* if (!is_bone_deform_group(bone)) return; */
sample_and_write_bone_animation_matrix(ob_arm, bone);
@@ -348,11 +347,11 @@ bool AnimationExporter::is_bone_deform_group(Bone * bone)
{
bool is_def;
//Check if current bone is deform
- if((bone->flag & BONE_NO_DEFORM) == 0 ) return true;
+ if ((bone->flag & BONE_NO_DEFORM) == 0 ) return true;
//Check child bones
else
{
- for (Bone *child = (Bone*)bone->childbase.first; child; child = child->next){
+ for (Bone *child = (Bone*)bone->childbase.first; child; child = child->next) {
//loop through all the children until deform bone is found, and then return
is_def = is_bone_deform_group(child);
if (is_def) return true;
@@ -374,11 +373,11 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B
{
std::string bone_name = getObjectBoneName(ob_arm,fcu);
int val = BLI_strcasecmp((char*)bone_name.c_str(),bone->name);
- if(val==0) break;
+ if (val==0) break;
fcu = fcu->next;
}
- if(!(fcu)) return;
+ if (!(fcu)) return;
bPoseChannel *pchan = get_pose_channel(ob_arm->pose, bone->name);
if (!pchan)
return;
@@ -548,7 +547,8 @@ void AnimationExporter::add_source_parameters(COLLADASW::SourceBase::ParameterNa
if ( transform )
{
param.push_back("TRANSFORM");
- }else{ //assumes if axis isn't specified all axises are added
+ }
+ else { //assumes if axis isn't specified all axises are added
param.push_back("X");
param.push_back("Y");
param.push_back("Z");
@@ -592,7 +592,8 @@ void AnimationExporter::get_source_values(BezTriple *bezt, COLLADASW::InputSeman
}
else if (rotation) {
values[1] = RAD2DEGF(bezt->vec[0][1]);
- } else {
+ }
+ else {
values[1] = bezt->vec[0][1];
}
break;
@@ -607,7 +608,8 @@ void AnimationExporter::get_source_values(BezTriple *bezt, COLLADASW::InputSeman
}
else if (rotation) {
values[1] = RAD2DEGF(bezt->vec[2][1]);
- } else {
+ }
+ else {
values[1] = bezt->vec[2][1];
}
break;
@@ -776,7 +778,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames , Ob
// SECOND_LIFE_COMPATIBILITY
// AFAIK animation to second life is via BVH, but no
// reason to not have the collada-animation be correct
- if(export_settings->second_life)
+ if (export_settings->second_life)
{
float temp[4][4];
copy_m4_m4(temp, bone->arm_mat);
@@ -785,7 +787,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames , Ob
mult_m4_m4m4(mat, mat, temp);
- if(bone->parent)
+ if (bone->parent)
{
copy_m4_m4(temp, bone->parent->arm_mat);
temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
@@ -858,9 +860,11 @@ std::string AnimationExporter::create_interpolation_source(FCurve *fcu, const st
if (fcu->bezt[i].ipo==BEZT_IPO_BEZ) {
source.appendValues(BEZIER_NAME);
*has_tangents = true;
- } else if (fcu->bezt[i].ipo==BEZT_IPO_CONST) {
+ }
+ else if (fcu->bezt[i].ipo==BEZT_IPO_CONST) {
source.appendValues(STEP_NAME);
- } else { // BEZT_IPO_LIN
+ }
+ else { // BEZT_IPO_LIN
source.appendValues(LINEAR_NAME);
}
}
@@ -1129,21 +1133,21 @@ bool AnimationExporter::hasAnimations(Scene *sce)
FCurve *fcu = 0;
//Check for object transform animations
- if(ob->adt && ob->adt->action)
+ if (ob->adt && ob->adt->action)
fcu = (FCurve*)ob->adt->action->curves.first;
//Check for Lamp parameter animations
- else if( (ob->type == OB_LAMP ) && ((Lamp*)ob ->data)->adt && ((Lamp*)ob ->data)->adt->action )
+ else if ( (ob->type == OB_LAMP ) && ((Lamp*)ob ->data)->adt && ((Lamp*)ob ->data)->adt->action )
fcu = (FCurve*)(((Lamp*)ob ->data)->adt->action->curves.first);
//Check for Camera parameter animations
- else if( (ob->type == OB_CAMERA ) && ((Camera*)ob ->data)->adt && ((Camera*)ob ->data)->adt->action )
+ else if ( (ob->type == OB_CAMERA ) && ((Camera*)ob ->data)->adt && ((Camera*)ob ->data)->adt->action )
fcu = (FCurve*)(((Camera*)ob ->data)->adt->action->curves.first);
//Check Material Effect parameter animations.
- for(int a = 0; a < ob->totcol; a++)
+ for (int a = 0; a < ob->totcol; a++)
{
Material *ma = give_current_material(ob, a+1);
if (!ma) continue;
- if(ma->adt && ma->adt->action)
+ if (ma->adt && ma->adt->action)
{
fcu = (FCurve*)ma->adt->action->curves.first;
}
@@ -1217,7 +1221,7 @@ void AnimationExporter::sample_and_write_bone_animation(Object *ob_arm, Bone *bo
bPoseChannel *pchan = get_pose_channel(ob_arm->pose, bone->name);
if (!pchan)
return;
- //Fill frame array with key frame values framed at @param:transform_type
+ //Fill frame array with key frame values framed at \param:transform_type
switch (transform_type) {
case 0:
find_rotation_frames(ob_arm, fra, prefix, pchan->rotmode);
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index 097e9902de5..e0079fbb8a0 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -119,7 +119,7 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
bez.vec[1][1] = bc_get_float_value(output, j * dim + i);
- if( curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_BEZIER ||
+ if ( curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_BEZIER ||
curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_STEP)
{
COLLADAFW::FloatOrDoubleArray& intan = curve->getInTangentValues();
@@ -132,7 +132,7 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
// outtangent
bez.vec[2][0] = bc_get_float_value(outtan, (j * 2 * dim ) + (2 * i)) * fps;
bez.vec[2][1] = bc_get_float_value(outtan, (j * 2 * dim )+ (2 * i) + 1);
- if(curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_BEZIER)
+ if (curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_BEZIER)
bez.ipo = BEZT_IPO_BEZ;
else
bez.ipo = BEZT_IPO_CONST;
@@ -261,7 +261,7 @@ bool AnimationImporter::write_animation(const COLLADAFW::Animation* anim)
// XXX Don't know if it's necessary
// Should we check outPhysicalDimension?
if (curve->getInPhysicalDimension() != COLLADAFW::PHYSICAL_DIMENSION_TIME) {
- fprintf(stderr, "Inputs physical dimension is not time. \n");
+ fprintf(stderr, "Inputs physical dimension is not time.\n");
return true;
}
@@ -948,7 +948,7 @@ void AnimationImporter::translate_Animations ( COLLADAFW::Node * node ,
}
}
- if ( animType->material != 0){
+ if ( animType->material != 0) {
Material *ma = give_current_material(ob, 1);
if (!ma->adt || !ma->adt->action) act = verify_adt_action((ID*)&ma->id, 1);
else act = ma->adt->action;
@@ -964,25 +964,25 @@ void AnimationImporter::translate_Animations ( COLLADAFW::Node * node ,
if (ef != NULL) { /* can be NULL [#28909] */
const COLLADAFW::CommonEffectPointerArray& commonEffects = ef->getCommonEffects();
COLLADAFW::EffectCommon *efc = commonEffects[0];
- if((animType->material & MATERIAL_SHININESS) != 0){
+ if ((animType->material & MATERIAL_SHININESS) != 0) {
const COLLADAFW::FloatOrParam *shin = &(efc->getShininess());
const COLLADAFW::UniqueId& listid = shin->getAnimationList();
Assign_float_animations( listid, AnimCurves , "specular_hardness" );
}
- if((animType->material & MATERIAL_IOR) != 0){
+ if ((animType->material & MATERIAL_IOR) != 0) {
const COLLADAFW::FloatOrParam *ior = &(efc->getIndexOfRefraction());
const COLLADAFW::UniqueId& listid = ior->getAnimationList();
Assign_float_animations( listid, AnimCurves , "raytrace_transparency.ior" );
}
- if((animType->material & MATERIAL_SPEC_COLOR) != 0){
+ if ((animType->material & MATERIAL_SPEC_COLOR) != 0) {
const COLLADAFW::ColorOrTexture *cot = &(efc->getSpecular());
const COLLADAFW::UniqueId& listid = cot->getColor().getAnimationList();
Assign_color_animations( listid, AnimCurves , "specular_color" );
}
- if((animType->material & MATERIAL_DIFF_COLOR) != 0){
+ if ((animType->material & MATERIAL_DIFF_COLOR) != 0) {
const COLLADAFW::ColorOrTexture *cot = &(efc->getDiffuse());
const COLLADAFW::UniqueId& listid = cot->getColor().getAnimationList();
Assign_color_animations( listid, AnimCurves , "diffuse_color" );
@@ -1185,7 +1185,7 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD
const COLLADAFW::Effect *ef = (COLLADAFW::Effect *) (FW_object_map[matuid]);
if (ef != NULL) { /* can be NULL [#28909] */
const COLLADAFW::CommonEffectPointerArray& commonEffects = ef->getCommonEffects();
- if(!commonEffects.empty()) {
+ if (!commonEffects.empty()) {
COLLADAFW::EffectCommon *efc = commonEffects[0];
types->material = setAnimType(&(efc->getShininess()),(types->material), MATERIAL_SHININESS);
types->material = setAnimType(&(efc->getSpecular().getColor()),(types->material), MATERIAL_SPEC_COLOR);
diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp
index 47d41a9680f..743d3c2a158 100644
--- a/source/blender/collada/ArmatureExporter.cpp
+++ b/source/blender/collada/ArmatureExporter.cpp
@@ -193,7 +193,7 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene* sce,
while( i != child_objects.end() )
{
- if((*i)->partype == PARBONE && (0 == strcmp((*i)->parsubstr, bone->name)))
+ if ((*i)->partype == PARBONE && (0 == strcmp((*i)->parsubstr, bone->name)))
{
float backup_parinv[4][4];
copy_m4_m4(backup_parinv, (*i)->parentinv);
@@ -210,7 +210,7 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene* sce,
// TODO: when such objects are animated as
// single matrix the tweak must be applied
// to the result.
- if(export_settings->second_life)
+ if (export_settings->second_life)
{
// tweak objects parentinverse to match compatibility
float temp[4][4];
@@ -274,7 +274,7 @@ void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW:
}
// SECOND_LIFE_COMPATIBILITY
- if(export_settings->second_life)
+ if (export_settings->second_life)
{
// Remove rotations vs armature from transform
// parent_rest_rot * mat * irest_rot
@@ -285,7 +285,7 @@ void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW:
mult_m4_m4m4(mat, mat, temp);
- if(bone->parent)
+ if (bone->parent)
{
copy_m4_m4(temp, bone->parent->arm_mat);
temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
@@ -370,18 +370,18 @@ void ArmatureExporter::export_controller(Object* ob, Object *ob_arm)
for (j = 0; j < vert->totweight; j++) {
int joint_index = joint_index_by_def_index[vert->dw[j].def_nr];
- if(joint_index != -1 && vert->dw[j].weight > 0.0f)
+ if (joint_index != -1 && vert->dw[j].weight > 0.0f)
{
jw[joint_index] += vert->dw[j].weight;
sumw += vert->dw[j].weight;
}
}
- if(sumw > 0.0f)
+ if (sumw > 0.0f)
{
float invsumw = 1.0f/sumw;
vcounts.push_back(jw.size());
- for(std::map<int, float>::iterator m = jw.begin(); m != jw.end(); ++m)
+ for (std::map<int, float>::iterator m = jw.begin(); m != jw.end(); ++m)
{
joints.push_back((*m).first);
weights.push_back(invsumw*(*m).second);
@@ -502,7 +502,7 @@ std::string ArmatureExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase
float inv_bind_mat[4][4];
// SECOND_LIFE_COMPATIBILITY
- if(export_settings->second_life)
+ if (export_settings->second_life)
{
// Only translations, no rotation vs armature
float temp[4][4];
@@ -560,7 +560,7 @@ std::string ArmatureExporter::add_weights_source(Mesh *me, const std::string& co
source.prepareToAppendValues();
- for(std::list<float>::const_iterator i = weights.begin(); i != weights.end(); ++i) {
+ for (std::list<float>::const_iterator i = weights.begin(); i != weights.end(); ++i) {
source.appendValues(*i);
}
@@ -597,7 +597,7 @@ void ArmatureExporter::add_vertex_weights_element(const std::string& weights_sou
// write deformer index - weight index pairs
int weight_index = 0;
- for(std::list<int>::const_iterator i = joints.begin(); i != joints.end(); ++i)
+ for (std::list<int>::const_iterator i = joints.begin(); i != joints.end(); ++i)
{
weightselem.appendValues(*i, weight_index++);
}
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index 4bc0c18551a..a978a4757a7 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -98,7 +98,7 @@ void ArmatureImporter::create_unskinned_bone( COLLADAFW::Node *node, EditBone *p
float angle = 0;
// get world-space
- if (parent){
+ if (parent) {
mult_m4_m4m4(mat, parent_mat, obmat);
}
@@ -278,7 +278,7 @@ void ArmatureImporter::add_leaf_bone(float mat[][4], EditBone *bone, COLLADAFW:
TagsMap::iterator etit;
ExtraTags *et = 0;
etit = uid_tags_map.find(node->getUniqueId().toAscii());
- if(etit != uid_tags_map.end())
+ if (etit != uid_tags_map.end())
{
et = etit->second;
//else return;
@@ -306,7 +306,7 @@ void ArmatureImporter::fix_leaf_bones( )
float vec[3] = {0.0f, 0.0f, 0.1f};
// if parent: take parent length and direction
- if(leaf.bone->parent) sub_v3_v3v3(vec, leaf.bone->parent->tail, leaf.bone->parent->head);
+ if (leaf.bone->parent) sub_v3_v3v3(vec, leaf.bone->parent->tail, leaf.bone->parent->head);
copy_v3_v3(leaf.bone->tail, leaf.bone->head);
add_v3_v3v3(leaf.bone->tail, leaf.bone->head, vec);
@@ -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);
}
@@ -570,7 +574,7 @@ void ArmatureImporter::set_pose ( Object * ob_arm , COLLADAFW::Node * root_node
{
char * bone_name = (char *) bc_get_joint_name ( root_node);
float mat[4][4];
- float obmat[4][4];
+ float obmat[4][4];
float ax[3];
float angle = 0.0f;
@@ -578,12 +582,12 @@ void ArmatureImporter::set_pose ( Object * ob_arm , COLLADAFW::Node * root_node
// object-space
get_node_mat(obmat, root_node, NULL, NULL);
- //if(*edbone)
+ //if (*edbone)
bPoseChannel * pchan = get_pose_channel(ob_arm -> pose , bone_name);
//else fprintf ( "",
// get world-space
- if (parentname){
+ if (parentname) {
mult_m4_m4m4(mat, parent_mat, obmat);
bPoseChannel *parchan = get_pose_channel(ob_arm->pose, parentname);
@@ -763,7 +767,7 @@ Object *ArmatureImporter::get_armature_for_joint(COLLADAFW::Node *node)
std::map<COLLADAFW::UniqueId, Object*>::iterator arm;
for (arm = unskinned_armature_map.begin(); arm != unskinned_armature_map.end(); arm++) {
- if(arm->first == node->getUniqueId() )
+ if (arm->first == node->getUniqueId() )
return arm->second;
}
return NULL;
diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp
index 6e04a1773bb..647a871e5b1 100644
--- a/source/blender/collada/DocumentExporter.cpp
+++ b/source/blender/collada/DocumentExporter.cpp
@@ -130,7 +130,7 @@ extern char build_rev[];
char *bc_CustomData_get_layer_name(const struct CustomData *data, int type, int n)
{
int layer_index = CustomData_get_layer_index(data, type);
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
return data->layers[layer_index+n].name;
}
@@ -139,7 +139,7 @@ char *bc_CustomData_get_active_layer_name(const CustomData *data, int type)
{
/* get the layer index of the active layer of type */
int layer_index = CustomData_get_active_layer_index(data, type);
- if(layer_index < 0) return NULL;
+ if (layer_index < 0) return NULL;
return data->layers[layer_index].name;
}
@@ -178,30 +178,30 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
switch(RNA_property_enum_get(&unit_settings, system)) {
case USER_UNIT_NONE:
case USER_UNIT_METRIC:
- if(linearmeasure == 0.001f) {
+ if (linearmeasure == 0.001f) {
unitname = "millimeter";
}
- else if(linearmeasure == 0.01f) {
+ else if (linearmeasure == 0.01f) {
unitname = "centimeter";
}
- else if(linearmeasure == 0.1f) {
+ else if (linearmeasure == 0.1f) {
unitname = "decimeter";
}
- else if(linearmeasure == 1.0f) {
+ else if (linearmeasure == 1.0f) {
unitname = "meter";
}
- else if(linearmeasure == 1000.0f) {
+ else if (linearmeasure == 1000.0f) {
unitname = "kilometer";
}
break;
case USER_UNIT_IMPERIAL:
- if(linearmeasure == 0.0254f) {
+ if (linearmeasure == 0.0254f) {
unitname = "inch";
}
- else if(linearmeasure == 0.3048f) {
+ else if (linearmeasure == 0.3048f) {
unitname = "foot";
}
- else if(linearmeasure == 0.9144f) {
+ else if (linearmeasure == 0.9144f) {
unitname = "yard";
}
break;
@@ -211,7 +211,7 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
asset.setUnit(unitname, linearmeasure);
asset.setUpAxisType(COLLADASW::Asset::Z_UP);
- if(U.author[0] != '\0') {
+ if (U.author[0] != '\0') {
asset.getContributor().mAuthor = U.author;
}
else {
@@ -227,13 +227,13 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
asset.add();
// <library_cameras>
- if(has_object_type(sce, OB_CAMERA)) {
+ if (has_object_type(sce, OB_CAMERA)) {
CamerasExporter ce(&sw, this->export_settings);
ce.exportCameras(sce);
}
// <library_lights>
- if(has_object_type(sce, OB_LAMP)) {
+ if (has_object_type(sce, OB_LAMP)) {
LightsExporter le(&sw, this->export_settings);
le.exportLights(sce);
}
@@ -251,7 +251,7 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
me.exportMaterials(sce);
// <library_geometries>
- if(has_object_type(sce, OB_MESH)) {
+ if (has_object_type(sce, OB_MESH)) {
GeometryExporter ge(&sw, this->export_settings);
ge.exportGeom(sce);
}
@@ -262,7 +262,7 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
// <library_controllers>
ArmatureExporter arm_exporter(&sw, this->export_settings);
- if(has_object_type(sce, OB_ARMATURE)) {
+ if (has_object_type(sce, OB_ARMATURE)) {
arm_exporter.export_controllers(sce);
}
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index 05b2b3b738d..bc0606107ab 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -121,10 +121,12 @@ bool DocumentImporter::import()
loader.registerExtraDataCallbackHandler(ehandler);
- if (!root.loadDocument(mFilename))
+ if (!root.loadDocument(mFilename)) {
+ fprintf(stderr, "COLLADAFW::Root::loadDocument() returned false on 1st pass\n");
return false;
+ }
- if(errorHandler.hasError())
+ if (errorHandler.hasError())
return false;
/** TODO set up scene graph and such here */
@@ -134,8 +136,10 @@ bool DocumentImporter::import()
COLLADASaxFWL::Loader loader2;
COLLADAFW::Root root2(&loader2, this);
- if (!root2.loadDocument(mFilename))
+ if (!root2.loadDocument(mFilename)) {
+ fprintf(stderr, "COLLADAFW::Root::loadDocument() returned false on 2nd pass\n");
return false;
+ }
delete ehandler;
@@ -153,11 +157,11 @@ void DocumentImporter::cancel(const COLLADAFW::String& errorMessage)
// The latter sounds better.
}
-void DocumentImporter::start(){}
+void DocumentImporter::start() {}
void DocumentImporter::finish()
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return;
/** TODO Break up and put into 2-pass parsing of DAE */
@@ -235,7 +239,15 @@ void DocumentImporter::finish()
void DocumentImporter::translate_anim_recursive(COLLADAFW::Node *node, COLLADAFW::Node *par = NULL, Object *parob = NULL)
{
- if (par && par->getType() == COLLADAFW::Node::JOINT) {
+
+ // The split in #29246, rootmap must point at actual root when
+ // calculating bones in apply_curves_as_matrix.
+ // This has to do with inverse bind poses being world space
+ // (the sources for skinned bones' restposes) and the way
+ // non-skinning nodes have their "restpose" recursively calculated.
+ // XXX TODO: design issue, how to support unrelated joints taking
+ // part in skinning.
+ if (par) { // && par->getType() == COLLADAFW::Node::JOINT) {
// par is root if there's no corresp. key in root_map
if (root_map.find(par->getUniqueId()) == root_map.end())
root_map[node->getUniqueId()] = par;
@@ -264,7 +276,7 @@ void DocumentImporter::translate_anim_recursive(COLLADAFW::Node *node, COLLADAFW
}
/** When this method is called, the writer must write the global document asset.
- @return The writer should return true, if writing succeeded, false otherwise.*/
+ \return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeGlobalAsset ( const COLLADAFW::FileInfo* asset )
{
unit_converter.read_asset(asset);
@@ -273,7 +285,7 @@ bool DocumentImporter::writeGlobalAsset ( const COLLADAFW::FileInfo* asset )
}
/** When this method is called, the writer must write the scene.
- @return The writer should return true, if writing succeeded, false otherwise.*/
+ \return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeScene ( const COLLADAFW::Scene* scene )
{
// XXX could store the scene id, but do nothing for now
@@ -300,7 +312,7 @@ Object* DocumentImporter::create_lamp_object(COLLADAFW::InstanceLight *lamp, Sce
{
const COLLADAFW::UniqueId& lamp_uid = lamp->getInstanciatedObjectId();
if (uid_lamp_map.find(lamp_uid) == uid_lamp_map.end()) {
- fprintf(stderr, "Couldn't find lamp by UID. \n");
+ fprintf(stderr, "Couldn't find lamp by UID.\n");
return NULL;
}
Object *ob = add_object(sce, OB_LAMP);
@@ -313,8 +325,10 @@ Object* DocumentImporter::create_lamp_object(COLLADAFW::InstanceLight *lamp, Sce
return ob;
}
-Object* DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Node *source_node, COLLADAFW::Node *instance_node, Scene *sce, Object *par_ob, bool is_library_node)
+Object* DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Node *source_node, COLLADAFW::Node *instance_node, Scene *sce, bool is_library_node)
{
+ fprintf(stderr, "create <instance_node> under node id=%s from node id=%s\n", instance_node ? instance_node->getOriginalId().c_str() : NULL, source_node ? source_node->getOriginalId().c_str() : NULL);
+
Object *obn = copy_object(source_ob);
obn->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
scene_add_base(sce, obn);
@@ -325,7 +339,7 @@ Object* DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Nod
// transformation matrix and apply it to the newly instantiated
// object to account for node hierarchy transforms in
// .dae
- if(source_node) {
+ if (source_node) {
COLLADABU::Math::Matrix4 mat4 = source_node->getTransformationMatrix();
COLLADABU::Math::Matrix4 bmat4 = mat4.transpose(); // transpose to get blender row-major order
float mat[4][4];
@@ -357,10 +371,10 @@ Object* DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Nod
Object *new_child = NULL;
if (inodes.getCount()) { // \todo loop through instance nodes
const COLLADAFW::UniqueId& id = inodes[0]->getInstanciatedObjectId();
- new_child = create_instance_node(object_map[id], node_map[id], child_node, sce, NULL, is_library_node);
+ new_child = create_instance_node(object_map[id], node_map[id], child_node, sce, is_library_node);
}
else {
- new_child = create_instance_node(object_map[child_id], child_node, NULL, sce, NULL, is_library_node);
+ new_child = create_instance_node(object_map[child_id], child_node, NULL, sce, is_library_node);
}
bc_set_parent(new_child, obn, mContext, true);
@@ -369,21 +383,14 @@ Object* DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Nod
}
}
- // when we have an instance_node, don't return the object, because otherwise
- // its correct location gets overwritten in write_node(). Fixes bug #26012.
- if(instance_node) {
- if (par_ob && obn)
- bc_set_parent(obn, par_ob, mContext);
- return NULL;
- }
-
- else return obn;
+ return obn;
}
void DocumentImporter::write_node (COLLADAFW::Node *node, COLLADAFW::Node *parent_node, Scene *sce, Object *par, bool is_library_node)
{
Object *ob = NULL;
bool is_joint = node->getType() == COLLADAFW::Node::JOINT;
+ bool read_transform = true;
if (is_joint) {
if ( par ) {
@@ -432,16 +439,18 @@ void DocumentImporter::write_node (COLLADAFW::Node *node, COLLADAFW::Node *paren
while (inst_done < inst_node.getCount()) {
const COLLADAFW::UniqueId& node_id = inst_node[inst_done]->getInstanciatedObjectId();
if (object_map.find(node_id) == object_map.end()) {
- fprintf(stderr, "Cannot find node to instanciate.\n");
+ fprintf(stderr, "Cannot find object for node referenced by <instance_node name=\"%s\">.\n", inst_node[inst_done]->getName().c_str());
ob = NULL;
}
else {
Object *source_ob = object_map[node_id];
COLLADAFW::Node *source_node = node_map[node_id];
- ob = create_instance_node(source_ob, source_node, node, sce, par, is_library_node);
+ ob = create_instance_node(source_ob, source_node, node, sce, is_library_node);
}
++inst_done;
+
+ read_transform = false;
}
// if node is empty - create empty object
// XXX empty node may not mean it is empty object, not sure about this
@@ -449,7 +458,8 @@ void DocumentImporter::write_node (COLLADAFW::Node *node, COLLADAFW::Node *paren
ob = add_object(sce, OB_EMPTY);
}
- // check if object is not NULL
+ // XXX: if there're multiple instances, only one is stored
+
if (!ob) return;
std::string nodename = node->getName().size() ? node->getName() : node->getOriginalId();
@@ -462,7 +472,8 @@ void DocumentImporter::write_node (COLLADAFW::Node *node, COLLADAFW::Node *paren
libnode_ob.push_back(ob);
}
- anim_importer.read_node_transform(node, ob); // overwrites location set earlier
+ if (read_transform)
+ anim_importer.read_node_transform(node, ob); // overwrites location set earlier
if (!is_joint) {
// if par was given make this object child of the previous
@@ -478,10 +489,10 @@ void DocumentImporter::write_node (COLLADAFW::Node *node, COLLADAFW::Node *paren
}
/** When this method is called, the writer must write the entire visual scene.
- @return The writer should return true, if writing succeeded, false otherwise.*/
+ \return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeVisualScene ( const COLLADAFW::VisualScene* visualScene )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
// this method called on post process after writeGeometry, writeMaterial, etc.
@@ -501,10 +512,10 @@ bool DocumentImporter::writeVisualScene ( const COLLADAFW::VisualScene* visualSc
/** When this method is called, the writer must handle all nodes contained in the
library nodes.
- @return The writer should return true, if writing succeeded, false otherwise.*/
+ \return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeLibraryNodes ( const COLLADAFW::LibraryNodes* libraryNodes )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
Scene *sce = CTX_data_scene(mContext);
@@ -519,20 +530,20 @@ bool DocumentImporter::writeLibraryNodes ( const COLLADAFW::LibraryNodes* librar
}
/** When this method is called, the writer must write the geometry.
- @return The writer should return true, if writing succeeded, false otherwise.*/
+ \return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeGeometry ( const COLLADAFW::Geometry* geom )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
return mesh_importer.write_geometry(geom);
}
/** When this method is called, the writer must write the material.
- @return The writer should return true, if writing succeeded, false otherwise.*/
+ \return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeMaterial( const COLLADAFW::Material* cmat )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
const std::string& str_mat_id = cmat->getName().size() ? cmat->getName() : cmat->getOriginalId();
@@ -688,10 +699,10 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
}
}
- if(ef->getOpacity().isTexture()) {
+ if (ef->getOpacity().isTexture()) {
COLLADAFW::Texture ctex = ef->getOpacity().getTexture();
mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map);
- if(mtex != NULL) {
+ if (mtex != NULL) {
mtex->mapto = MAP_ALPHA;
mtex->tex->imaflag |= TEX_USEALPHA;
i++;
@@ -717,11 +728,11 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
}
/** When this method is called, the writer must write the effect.
- @return The writer should return true, if writing succeeded, false otherwise.*/
+ \return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeEffect( const COLLADAFW::Effect* effect )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
const COLLADAFW::UniqueId& uid = effect->getUniqueId();
@@ -733,7 +744,7 @@ bool DocumentImporter::writeEffect( const COLLADAFW::Effect* effect )
Material *ma = uid_effect_map[uid];
std::map<COLLADAFW::UniqueId, Material*>::iterator iter;
- for(iter = uid_material_map.begin(); iter != uid_material_map.end() ; iter++ )
+ for (iter = uid_material_map.begin(); iter != uid_material_map.end() ; iter++ )
{
if ( iter->second == ma ) {
this->FW_object_map[iter->first] = effect;
@@ -756,10 +767,10 @@ bool DocumentImporter::writeEffect( const COLLADAFW::Effect* effect )
/** When this method is called, the writer must write the camera.
- @return The writer should return true, if writing succeeded, false otherwise.*/
+ \return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
Camera *cam = NULL;
@@ -771,7 +782,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera )
else cam = (Camera*)add_camera((char*)cam_id.c_str());
if (!cam) {
- fprintf(stderr, "Cannot create camera. \n");
+ fprintf(stderr, "Cannot create camera.\n");
return true;
}
cam->clipsta = camera->getNearClippingPlane().getValue();
@@ -791,7 +802,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera )
break;
case COLLADAFW::Camera::UNDEFINED_CAMERATYPE:
{
- fprintf(stderr, "Current camera type is not supported. \n");
+ fprintf(stderr, "Current camera type is not supported.\n");
cam->type = CAM_PERSP;
}
break;
@@ -872,10 +883,10 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera )
}
/** When this method is called, the writer must write the image.
- @return The writer should return true, if writing succeeded, false otherwise.*/
+ \return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeImage( const COLLADAFW::Image* image )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
// XXX maybe it is necessary to check if the path is absolute or relative
@@ -888,7 +899,7 @@ bool DocumentImporter::writeImage( const COLLADAFW::Image* image )
BLI_join_dirfile(full_path, sizeof(full_path), dir, filepath.c_str());
Image *ima = BKE_add_image_file(full_path);
if (!ima) {
- fprintf(stderr, "Cannot create image. \n");
+ fprintf(stderr, "Cannot create image.\n");
return true;
}
this->uid_image_map[image->getUniqueId()] = ima;
@@ -897,10 +908,10 @@ bool DocumentImporter::writeImage( const COLLADAFW::Image* image )
}
/** When this method is called, the writer must write the light.
- @return The writer should return true, if writing succeeded, false otherwise.*/
+ \return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
Lamp *lamp = NULL;
@@ -909,7 +920,7 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
TagsMap::iterator etit;
ExtraTags *et = 0;
etit = uid_tags_map.find(light->getUniqueId().toAscii());
- if(etit != uid_tags_map.end())
+ if (etit != uid_tags_map.end())
et = etit->second;
la_id = light->getOriginalId();
@@ -918,12 +929,12 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
else lamp = (Lamp*)add_lamp((char*)la_id.c_str());
if (!lamp) {
- fprintf(stderr, "Cannot create lamp. \n");
+ fprintf(stderr, "Cannot create lamp.\n");
return true;
}
// if we find an ExtraTags for this, use that instead.
- if(et && et->isProfile("blender")) {
+ if (et && et->isProfile("blender")) {
et->setData("type", &(lamp->type));
et->setData("flag", &(lamp->flag));
et->setData("mode", &(lamp->mode));
@@ -996,17 +1007,19 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
lamp->b = col.getBlue();
}
- if(IS_EQ(linatt, 0.0f) && quadatt > 0.0f) {
+ if (IS_EQ(linatt, 0.0f) && quadatt > 0.0f) {
att2 = quadatt;
d = sqrt(1.0f/quadatt);
}
// linear light
- else if(IS_EQ(quadatt, 0.0f) && linatt > 0.0f) {
+ else if (IS_EQ(quadatt, 0.0f) && linatt > 0.0f) {
att1 = linatt;
d = (1.0f/linatt);
- } else if (IS_EQ(constatt, 1.0f)) {
+ }
+ else if (IS_EQ(constatt, 1.0f)) {
att1 = 1.0f;
- } else {
+ }
+ else {
// assuming point light (const att = 1.0);
att1 = 1.0f;
}
@@ -1028,9 +1041,9 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
lamp->type = LA_SPOT;
lamp->att1 = att1;
lamp->att2 = att2;
- if(IS_EQ(att1, 0.0f) && att2 > 0)
+ if (IS_EQ(att1, 0.0f) && att2 > 0)
lamp->falloff_type = LA_FALLOFF_INVSQUARE;
- if(IS_EQ(att2, 0.0f) && att1 > 0)
+ if (IS_EQ(att2, 0.0f) && att1 > 0)
lamp->falloff_type = LA_FALLOFF_INVLINEAR;
lamp->spotsize = light->getFallOffAngle().getValue();
lamp->spotblend = light->getFallOffExponent().getValue();
@@ -1048,15 +1061,15 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
lamp->type = LA_LOCAL;
lamp->att1 = att1;
lamp->att2 = att2;
- if(IS_EQ(att1, 0.0f) && att2 > 0)
+ if (IS_EQ(att1, 0.0f) && att2 > 0)
lamp->falloff_type = LA_FALLOFF_INVSQUARE;
- if(IS_EQ(att2, 0.0f) && att1 > 0)
+ if (IS_EQ(att2, 0.0f) && att1 > 0)
lamp->falloff_type = LA_FALLOFF_INVLINEAR;
}
break;
case COLLADAFW::Light::UNDEFINED:
{
- fprintf(stderr, "Current lamp type is not supported. \n");
+ fprintf(stderr, "Current lamp type is not supported.\n");
lamp->type = LA_LOCAL;
}
break;
@@ -1071,7 +1084,7 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
// this function is called only for animations that pass COLLADAFW::validate
bool DocumentImporter::writeAnimation( const COLLADAFW::Animation* anim )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
// return true;
@@ -1081,7 +1094,7 @@ bool DocumentImporter::writeAnimation( const COLLADAFW::Animation* anim )
// called on post-process stage after writeVisualScenes
bool DocumentImporter::writeAnimationList( const COLLADAFW::AnimationList* animationList )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
// return true;
@@ -1089,7 +1102,7 @@ bool DocumentImporter::writeAnimationList( const COLLADAFW::AnimationList* anima
}
/** When this method is called, the writer must write the skin controller data.
- @return The writer should return true, if writing succeeded, false otherwise.*/
+ \return The writer should return true, if writing succeeded, false otherwise.*/
bool DocumentImporter::writeSkinControllerData( const COLLADAFW::SkinControllerData* skin )
{
return armature_importer.write_skin_controller_data(skin);
@@ -1098,7 +1111,7 @@ bool DocumentImporter::writeSkinControllerData( const COLLADAFW::SkinControllerD
// this is called on postprocess, before writeVisualScenes
bool DocumentImporter::writeController( const COLLADAFW::Controller* controller )
{
- if(mImportStage!=General)
+ if (mImportStage!=General)
return true;
return armature_importer.write_controller(controller);
@@ -1116,7 +1129,7 @@ bool DocumentImporter::writeKinematicsScene( const COLLADAFW::KinematicsScene* k
ExtraTags* DocumentImporter::getExtraTags(const COLLADAFW::UniqueId &uid)
{
- if(uid_tags_map.find(uid.toAscii())==uid_tags_map.end()) {
+ if (uid_tags_map.find(uid.toAscii())==uid_tags_map.end()) {
return NULL;
}
return uid_tags_map[uid.toAscii()];
diff --git a/source/blender/collada/DocumentImporter.h b/source/blender/collada/DocumentImporter.h
index 96c587edc44..606218b644d 100644
--- a/source/blender/collada/DocumentImporter.h
+++ b/source/blender/collada/DocumentImporter.h
@@ -72,7 +72,7 @@ public:
/** these should not be here */
Object* create_camera_object(COLLADAFW::InstanceCamera*, Scene*);
Object* create_lamp_object(COLLADAFW::InstanceLight*, Scene*);
- Object* create_instance_node(Object*, COLLADAFW::Node*, COLLADAFW::Node*, Scene*, Object*, bool);
+ Object* create_instance_node(Object*, COLLADAFW::Node*, COLLADAFW::Node*, Scene*, bool);
void write_node(COLLADAFW::Node*, COLLADAFW::Node*, Scene*, Object*, bool);
MTex* create_texture(COLLADAFW::EffectCommon*, COLLADAFW::Texture&, Material*, int, TexIndexTextureArrayMap&);
void write_profile_COMMON(COLLADAFW::EffectCommon*, Material*);
@@ -80,7 +80,7 @@ public:
/** This method will be called if an error in the loading process occurred and the loader cannot
continue to load. The writer should undo all operations that have been performed.
- @param errorMessage A message containing informations about the error that occurred.
+ \param errorMessage A message containing informations about the error that occurred.
*/
void cancel(const COLLADAFW::String& errorMessage);
diff --git a/source/blender/collada/EffectExporter.cpp b/source/blender/collada/EffectExporter.cpp
index 7ada149cde9..9720b92ffae 100644
--- a/source/blender/collada/EffectExporter.cpp
+++ b/source/blender/collada/EffectExporter.cpp
@@ -63,7 +63,7 @@ bool EffectsExporter::hasEffects(Scene *sce)
while(base) {
Object *ob= base->object;
int a;
- for(a = 0; a < ob->totcol; a++)
+ for (a = 0; a < ob->totcol; a++)
{
Material *ma = give_current_material(ob, a+1);
@@ -79,7 +79,7 @@ bool EffectsExporter::hasEffects(Scene *sce)
void EffectsExporter::exportEffects(Scene *sce)
{
- if(hasEffects(sce)) {
+ if (hasEffects(sce)) {
this->scene = sce;
openLibrary();
MaterialFunctor mf;
@@ -129,7 +129,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
ep.setProfileType(COLLADASW::EffectProfile::COMMON);
ep.openProfile();
// set shader type - one of three blinn, phong or lambert
- if(ma->spec>0.0f) {
+ if (ma->spec>0.0f) {
if (ma->spec_shader == MA_SPEC_BLINN) {
writeBlinn(ep, ma);
}
@@ -138,8 +138,9 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
// for now set phong in case spec shader is not blinn
writePhong(ep, ma);
}
- } else {
- if(ma->diff_shader == MA_DIFF_LAMBERT) {
+ }
+ else {
+ if (ma->diff_shader == MA_DIFF_LAMBERT) {
writeLambert(ep, ma);
}
else {
@@ -176,7 +177,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
// ambient
/* ma->ambX is calculated only on render, so lets do it here manually and not rely on ma->ambX. */
- if(this->scene->world)
+ if (this->scene->world)
cot = getcol(this->scene->world->ambr*ma->amb, this->scene->world->ambg*ma->amb, this->scene->world->ambb*ma->amb, 1.0f);
else
cot = getcol(ma->amb, ma->amb, ma->amb, 1.0f);
@@ -219,7 +220,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
Image *ima = t->tex->ima;
// Image not set for texture
- if(!ima) continue;
+ if (!ima) continue;
std::string key(id_name(ima));
key = translate_id(key);
@@ -265,7 +266,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
Image *ima = t->tex->ima;
// Image not set for texture
- if(!ima) continue;
+ if (!ima) continue;
// we assume map input is always TEXCO_UV
@@ -363,9 +364,10 @@ void EffectsExporter::createTextureIndices(Material *ma, std::vector<int> &indic
for (int a = 0; a < MAX_MTEX; a++) {
if (ma->mtex[a] &&
- ma->mtex[a]->tex &&
- ma->mtex[a]->tex->type == TEX_IMAGE &&
- ma->mtex[a]->texco == TEXCO_UV){
+ ma->mtex[a]->tex &&
+ ma->mtex[a]->tex->type == TEX_IMAGE &&
+ ma->mtex[a]->texco == TEXCO_UV)
+ {
indices.push_back(a);
}
}
diff --git a/source/blender/collada/ErrorHandler.cpp b/source/blender/collada/ErrorHandler.cpp
index 9ed8034a9a0..1c0f40d2185 100644
--- a/source/blender/collada/ErrorHandler.cpp
+++ b/source/blender/collada/ErrorHandler.cpp
@@ -83,5 +83,9 @@ bool ErrorHandler::handleError( const COLLADASaxFWL::IError* error )
COLLADASaxFWL::SaxFWLError* saxFWLError = (COLLADASaxFWL::SaxFWLError*) error;
std::cout << "Sax FWL Error: " << saxFWLError->getErrorMessage() << std::endl;
}
+ else {
+ std::cout << "opencollada error: " << error->getFullErrorMessage() << std::endl;
+ }
+
return false;
}
diff --git a/source/blender/collada/ExtraHandler.cpp b/source/blender/collada/ExtraHandler.cpp
index d6d3aa87cfd..6606fe1a27b 100644
--- a/source/blender/collada/ExtraHandler.cpp
+++ b/source/blender/collada/ExtraHandler.cpp
@@ -54,7 +54,7 @@ bool ExtraHandler::textData(const char* text, size_t textLength)
{
char buf[1024];
- if(currentElement.length() == 0 || currentExtraTags == 0) return false;
+ if (currentElement.length() == 0 || currentExtraTags == 0) return false;
BLI_snprintf(buf, textLength+1, "%s", text);
currentExtraTags->addTag(currentElement, std::string(buf));
@@ -65,11 +65,11 @@ bool ExtraHandler::parseElement (
const char* profileName,
const unsigned long& elementHash,
const COLLADAFW::UniqueId& uniqueId ) {
- if(BLI_strcaseeq(profileName, "blender")) {
+ if (BLI_strcaseeq(profileName, "blender")) {
//printf("In parseElement for supported profile %s for id %s\n", profileName, uniqueId.toAscii().c_str());
currentUid = uniqueId;
ExtraTags *et = dimp->getExtraTags(uniqueId);
- if(!et) {
+ if (!et) {
et = new ExtraTags(std::string(profileName));
dimp->addExtraTags(uniqueId, et);
}
diff --git a/source/blender/collada/ExtraTags.cpp b/source/blender/collada/ExtraTags.cpp
index b1b1936e254..c5a126894cb 100644
--- a/source/blender/collada/ExtraTags.cpp
+++ b/source/blender/collada/ExtraTags.cpp
@@ -56,7 +56,7 @@ bool ExtraTags::addTag( std::string tag, std::string data)
int ExtraTags::asInt( std::string tag, bool *ok)
{
- if(tags.find(tag) == tags.end()) {
+ if (tags.find(tag) == tags.end()) {
*ok = false;
return -1;
}
@@ -66,7 +66,7 @@ int ExtraTags::asInt( std::string tag, bool *ok)
float ExtraTags::asFloat( std::string tag, bool *ok)
{
- if(tags.find(tag) == tags.end()) {
+ if (tags.find(tag) == tags.end()) {
*ok = false;
return -1.0f;
}
@@ -76,7 +76,7 @@ float ExtraTags::asFloat( std::string tag, bool *ok)
std::string ExtraTags::asString( std::string tag, bool *ok)
{
- if(tags.find(tag) == tags.end()) {
+ if (tags.find(tag) == tags.end()) {
*ok = false;
return "";
}
@@ -89,28 +89,28 @@ void ExtraTags::setData(std::string tag, short *data)
{
bool ok = false;
int tmp = asInt(tag, &ok);
- if(ok)
+ if (ok)
*data = (short)tmp;
}
void ExtraTags::setData(std::string tag, int *data)
{
bool ok = false;
int tmp = asInt(tag, &ok);
- if(ok)
+ if (ok)
*data = tmp;
}
void ExtraTags::setData(std::string tag, float *data)
{
bool ok = false;
float tmp = asFloat(tag, &ok);
- if(ok)
+ if (ok)
*data = tmp;
}
void ExtraTags::setData(std::string tag, char *data)
{
bool ok = false;
int tmp = asInt(tag, &ok);
- if(ok)
+ if (ok)
*data = (char)tmp;
}
diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp
index 2af1df90f51..ca112abc0af 100644
--- a/source/blender/collada/GeometryExporter.cpp
+++ b/source/blender/collada/GeometryExporter.cpp
@@ -109,7 +109,7 @@ void GeometryExporter::operator()(Object *ob)
// XXX slow
if (ob->totcol) {
- for(int a = 0; a < ob->totcol; a++) {
+ for (int a = 0; a < ob->totcol; a++) {
createPolylist(a, has_uvs, has_color, ob, geom_id, norind);
}
}
diff --git a/source/blender/collada/ImageExporter.cpp b/source/blender/collada/ImageExporter.cpp
index 3926cb48253..946effda832 100644
--- a/source/blender/collada/ImageExporter.cpp
+++ b/source/blender/collada/ImageExporter.cpp
@@ -51,7 +51,7 @@ bool ImagesExporter::hasImages(Scene *sce)
while(base) {
Object *ob= base->object;
int a;
- for(a = 0; a < ob->totcol; a++)
+ for (a = 0; a < ob->totcol; a++)
{
Material *ma = give_current_material(ob, a+1);
@@ -71,7 +71,7 @@ bool ImagesExporter::hasImages(Scene *sce)
void ImagesExporter::exportImages(Scene *sce)
{
- if(hasImages(sce)) {
+ if (hasImages(sce)) {
openLibrary();
MaterialFunctor mf;
mf.forEachMaterialInScene<ImagesExporter>(sce, *this, this->export_settings->selected);
@@ -109,7 +109,7 @@ void ImagesExporter::operator()(Material *ma, Object *ob)
BLI_make_existing_file(abs);
if (BLI_copy(src, abs) != 0) {
- fprintf(stderr, "Cannot copy image to file's directory. \n");
+ fprintf(stderr, "Cannot copy image to file's directory.\n");
}
}
diff --git a/source/blender/collada/InstanceWriter.cpp b/source/blender/collada/InstanceWriter.cpp
index 40ca1bc3b0e..a605bdeefcc 100644
--- a/source/blender/collada/InstanceWriter.cpp
+++ b/source/blender/collada/InstanceWriter.cpp
@@ -43,7 +43,7 @@
void InstanceWriter::add_material_bindings(COLLADASW::BindMaterial& bind_material, Object *ob)
{
- for(int a = 0; a < ob->totcol; a++) {
+ for (int a = 0; a < ob->totcol; a++) {
Material *ma = give_current_material(ob, a+1);
COLLADASW::InstanceMaterialList& iml = bind_material.getInstanceMaterialList();
diff --git a/source/blender/collada/LightExporter.cpp b/source/blender/collada/LightExporter.cpp
index d74a1d1033d..51242b36b64 100644
--- a/source/blender/collada/LightExporter.cpp
+++ b/source/blender/collada/LightExporter.cpp
@@ -73,7 +73,7 @@ void LightsExporter::operator()(Object *ob)
constatt = 1.0f;
- if(la->falloff_type==LA_FALLOFF_INVLINEAR) {
+ if (la->falloff_type==LA_FALLOFF_INVLINEAR) {
linatt = 1.0f / d;
quadatt = 0.0f;
}
diff --git a/source/blender/collada/MaterialExporter.cpp b/source/blender/collada/MaterialExporter.cpp
index b66779953ef..1e3358c9216 100644
--- a/source/blender/collada/MaterialExporter.cpp
+++ b/source/blender/collada/MaterialExporter.cpp
@@ -35,7 +35,7 @@ MaterialsExporter::MaterialsExporter(COLLADASW::StreamWriter *sw, const ExportSe
void MaterialsExporter::exportMaterials(Scene *sce)
{
- if(hasMaterials(sce)) {
+ if (hasMaterials(sce)) {
openLibrary();
MaterialFunctor mf;
@@ -53,7 +53,7 @@ bool MaterialsExporter::hasMaterials(Scene *sce)
while(base) {
Object *ob= base->object;
int a;
- for(a = 0; a < ob->totcol; a++)
+ for (a = 0; a < ob->totcol; a++)
{
Material *ma = give_current_material(ob, a+1);
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index ebfeb0c6301..5c01c31bd0d 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -145,7 +145,7 @@ void WVDataWrapper::print()
void UVDataWrapper::getUV(int uv_index, float *uv)
{
int stride = mVData->getStride(0);
- if(stride==0) stride = 2;
+ if (stride==0) stride = 2;
switch(mVData->getType()) {
case COLLADAFW::MeshVertexData::DATA_TYPE_FLOAT:
@@ -180,7 +180,7 @@ void MeshImporter::set_face_indices(MFace *mface, unsigned int *indices, bool qu
if (quad) mface->v4 = indices[3];
else mface->v4 = 0;
#ifdef COLLADA_DEBUG
- // fprintf(stderr, "%u, %u, %u \n", indices[0], indices[1], indices[2]);
+ // fprintf(stderr, "%u, %u, %u\n", indices[0], indices[1], indices[2]);
#endif
}
@@ -281,7 +281,7 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh) // checks if mesh has sup
COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons*)mp;
COLLADAFW::Polygons::VertexCountArray& vca = mpvc->getGroupedVerticesVertexCountArray();
- for(unsigned int j = 0; j < vca.getCount(); j++){
+ for (unsigned int j = 0; j < vca.getCount(); j++) {
int count = vca[j];
if (count < 3) {
fprintf(stderr, "Primitive %s in %s has at least one face with vertex count < 3\n",
@@ -291,7 +291,7 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh) // checks if mesh has sup
}
}
- else if(type != COLLADAFW::MeshPrimitive::TRIANGLES && type!= COLLADAFW::MeshPrimitive::TRIANGLE_FANS) {
+ else if (type != COLLADAFW::MeshPrimitive::TRIANGLES && type!= COLLADAFW::MeshPrimitive::TRIANGLE_FANS) {
fprintf(stderr, "Primitive type %s is not supported.\n", type_str);
return false;
}
@@ -310,7 +310,7 @@ void MeshImporter::read_vertices(COLLADAFW::Mesh *mesh, Mesh *me)
// vertices
COLLADAFW::MeshVertexData& pos = mesh->getPositions();
int stride = pos.getStride(0);
- if(stride==0) stride = 3;
+ if (stride==0) stride = 3;
me->totvert = mesh->getPositions().getFloatValues()->getCount() / stride;
me->mvert = (MVert*)CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, me->totvert);
@@ -486,7 +486,7 @@ void MeshImporter::read_faces(COLLADAFW::Mesh *mesh, Mesh *me, int new_tris) //T
#endif
if (type == COLLADAFW::MeshPrimitive::TRIANGLES) {
- for (j = 0; j < prim_totface; j++){
+ for (j = 0; j < prim_totface; j++) {
set_face_indices(mface, indices, false);
indices += 3;
@@ -527,12 +527,12 @@ void MeshImporter::read_faces(COLLADAFW::Mesh *mesh, Mesh *me, int new_tris) //T
// The first trifan vertex will be the first vertex in every triangle
if (type == COLLADAFW::MeshPrimitive::TRIANGLE_FANS) {
unsigned grouped_vertex_count = mp->getGroupedVertexElementsCount();
- for (unsigned int group_index = 0; group_index < grouped_vertex_count; group_index++){
+ for (unsigned int group_index = 0; group_index < grouped_vertex_count; group_index++) {
unsigned int first_vertex = indices[0]; // Store first trifan vertex
unsigned int first_normal = nind[0]; // Store first trifan vertex normal
unsigned int vertex_count = mp->getGroupedVerticesVertexCount(group_index);
- for (unsigned int vertex_index = 0; vertex_index < vertex_count - 2; vertex_index++){
+ for (unsigned int vertex_index = 0; vertex_index < vertex_count - 2; vertex_index++) {
// For each triangle store indeces of its 3 vertices
unsigned int triangle_vertex_indices[3]={first_vertex, indices[1], indices[2]};
set_face_indices(mface, triangle_vertex_indices, false);
@@ -742,12 +742,12 @@ MTex *MeshImporter::assign_textures_to_uvlayer(COLLADAFW::TextureCoordinateBindi
size_t setindex = ctexture.getSetIndex();
std::string uvname = ctexture.getSemantic();
- if(setindex==-1) return NULL;
+ if (setindex==-1) return NULL;
const CustomData *data = &me->fdata;
int layer_index = CustomData_get_layer_index(data, CD_MTFACE);
- if(layer_index == -1) return NULL;
+ if (layer_index == -1) return NULL;
CustomDataLayer *cdl = &data->layers[layer_index+setindex];
@@ -798,7 +798,7 @@ MTFace *MeshImporter::assign_material_to_geom(COLLADAFW::MaterialBinding cmateri
std::multimap<COLLADAFW::UniqueId, COLLADAFW::UniqueId>::iterator it;
it=materials_mapped_to_geom.find(*geom_uid);
while(it!=materials_mapped_to_geom.end()) {
- if(it->second == ma_uid && it->first == *geom_uid) return NULL; // do nothing if already found
+ if (it->second == ma_uid && it->first == *geom_uid) return NULL; // do nothing if already found
it++;
}
// first time we get geom_uid, ma_uid pair. Save for later check.
@@ -913,11 +913,12 @@ Object *MeshImporter::create_mesh_object(COLLADAFW::Node *node, COLLADAFW::Insta
// loop through geom's materials
for (unsigned int i = 0; i < mat_array.getCount(); i++) {
- if(mat_array[i].getReferencedMaterial().isValid()) {
+ if (mat_array[i].getReferencedMaterial().isValid()) {
texture_face = assign_material_to_geom(mat_array[i], uid_material_map, ob, geom_uid,
&color_texture, layername, texture_face,
material_texture_mapping_map, i);
- } else {
+ }
+ else {
fprintf(stderr, "invalid referenced material for %s\n", mat_array[i].getName().c_str());
}
}
@@ -964,5 +965,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);
+ BKE_mesh_convert_mfaces_to_mpolys(me);
return true;
}
diff --git a/source/blender/collada/SceneExporter.cpp b/source/blender/collada/SceneExporter.cpp
index b6be8a57f7a..9010fd5062a 100644
--- a/source/blender/collada/SceneExporter.cpp
+++ b/source/blender/collada/SceneExporter.cpp
@@ -47,7 +47,7 @@ void SceneExporter::exportHierarchy(Scene *sce)
Object *ob = base->object;
if (!ob->parent) {
- if(sce->lay & ob->lay) {
+ if (sce->lay & ob->lay) {
switch(ob->type) {
case OB_MESH:
case OB_CAMERA:
@@ -144,17 +144,17 @@ void SceneExporter::writeNodes(Object *ob, Scene *sce)
// empty object
else if (ob->type == OB_EMPTY) { // TODO: handle groups (OB_DUPLIGROUP
- if((ob->transflag & OB_DUPLIGROUP) == OB_DUPLIGROUP && ob->dup_group) {
+ if ((ob->transflag & OB_DUPLIGROUP) == OB_DUPLIGROUP && ob->dup_group) {
GroupObject *go = NULL;
Group *gr = ob->dup_group;
/* printf("group detected '%s'\n", gr->id.name+2); */
- for(go = (GroupObject*)(gr->gobject.first); go; go=go->next) {
+ for (go = (GroupObject*)(gr->gobject.first); go; go=go->next) {
printf("\t%s\n", go->ob->id.name);
}
}
}
- for(std::list<Object*>::iterator i= child_objects.begin(); i != child_objects.end(); ++i)
+ for (std::list<Object*>::iterator i= child_objects.begin(); i != child_objects.end(); ++i)
{
writeNodes(*i, sce);
}
diff --git a/source/blender/collada/TransformWriter.cpp b/source/blender/collada/TransformWriter.cpp
index 10a965308b1..f441833233c 100644
--- a/source/blender/collada/TransformWriter.cpp
+++ b/source/blender/collada/TransformWriter.cpp
@@ -95,18 +95,18 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob)
*/
/* Using parentinv should allow use of existing curves */
- if(ob->parent)
+ if (ob->parent)
{
// If parentinv is identity don't add it.
bool add_parinv = false;
- for(int i = 0; i < 16; ++i)
+ for (int i = 0; i < 16; ++i)
{
float f = (i % 4 == i / 4) ? 1.0f : 0.0f;
add_parinv |= (ob->parentinv[i % 4][i / 4] != f);
}
- if(add_parinv)
+ if (add_parinv)
{
double dmat[4][4];
UnitConverter converter;
diff --git a/source/blender/collada/collada.cpp b/source/blender/collada/collada.cpp
index 39114f6543b..70bf0556b5b 100644
--- a/source/blender/collada/collada.cpp
+++ b/source/blender/collada/collada.cpp
@@ -44,7 +44,7 @@ extern "C"
int collada_import(bContext *C, const char *filepath)
{
DocumentImporter imp (C, filepath);
- if(imp.import()) return 1;
+ if (imp.import()) return 1;
return 0;
}
@@ -58,9 +58,9 @@ extern "C"
export_settings.filepath = (char *)filepath;
/* annoying, collada crashes if file cant be created! [#27162] */
- if(!BLI_exists(filepath)) {
+ if (!BLI_exists(filepath)) {
BLI_make_existing_file(filepath); /* makes the dir if its not there */
- if(BLI_file_touch(filepath) == 0) {
+ if (BLI_file_touch(filepath) == 0) {
return 0;
}
}
diff --git a/source/blender/collada/collada_internal.cpp b/source/blender/collada/collada_internal.cpp
index 5d0e8d957b3..fc4093bd795 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,
@@ -206,7 +206,7 @@ std::string translate_id(const std::string &id)
{
id_translated[i] = translate_name_map[(unsigned int)id_translated[i]];
}
- // It's so much workload now, the if() should speed up things.
+ // It's so much workload now, the if () should speed up things.
if (id_translated != id)
{
// Search duplicates
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp
index c3aa73510d1..4aed29defbc 100644
--- a/source/blender/collada/collada_utils.cpp
+++ b/source/blender/collada/collada_utils.cpp
@@ -61,8 +61,8 @@ int bc_test_parent_loop(Object *par, Object *ob)
{
/* test if 'ob' is a parent somewhere in par's parents */
- if(par == NULL) return 0;
- if(ob == par) return 1;
+ if (par == NULL) return 0;
+ if (ob == par) return 1;
return bc_test_parent_loop(par->parent, ob);
}
diff --git a/source/blender/editors/animation/CMakeLists.txt b/source/blender/editors/animation/CMakeLists.txt
index 0386af9776c..9e1e44e411d 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
@@ -53,4 +54,8 @@ set(SRC
anim_intern.h
)
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_editor_animation "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/animation/SConscript b/source/blender/editors/animation/SConscript
index 3e5133c1174..658ad2794a1 100644
--- a/source/blender/editors/animation/SConscript
+++ b/source/blender/editors/animation/SConscript
@@ -3,7 +3,12 @@ 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] )
+defs = []
+
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
+env.BlenderLib ( 'bf_editors_animation', sources, Split(incs), defs, 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 a0082b3258f..01ab36133fd 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -87,12 +87,9 @@
#define ANIM_CHAN_NAME_SIZE 256
/* macros used for type defines */
- /* get the pointer used for some flag */
-#define GET_ACF_FLAG_PTR(ptr) \
- { \
- *type= sizeof((ptr)); \
- return &(ptr); \
- }
+
+/* get the pointer used for some flag and return */
+#define GET_ACF_FLAG_PTR(ptr, type) ((*(type) = sizeof((ptr))), &(ptr))
/* *********************************************** */
@@ -453,7 +450,7 @@ static void *acf_summary_setting_ptr(bAnimListElem *ale, int setting, short *typ
bDopeSheet *ads= &saction->ads;
/* return pointer to DopeSheet's flag */
- GET_ACF_FLAG_PTR(ads->flag);
+ return GET_ACF_FLAG_PTR(ads->flag, type);
}
else {
/* can't return anything useful - unsupported */
@@ -547,15 +544,15 @@ static void *acf_scene_setting_ptr(bAnimListElem *ale, int setting, short *type)
switch (setting) {
case ACHANNEL_SETTING_SELECT: /* selected */
- GET_ACF_FLAG_PTR(scene->flag);
+ return GET_ACF_FLAG_PTR(scene->flag, type);
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(scene->flag);
+ return GET_ACF_FLAG_PTR(scene->flag, type);
case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (scene->adt)
- GET_ACF_FLAG_PTR(scene->adt->flag)
+ return GET_ACF_FLAG_PTR(scene->adt->flag, type);
else
return NULL;
@@ -694,15 +691,15 @@ static void *acf_object_setting_ptr(bAnimListElem *ale, int setting, short *type
switch (setting) {
case ACHANNEL_SETTING_SELECT: /* selected */
- GET_ACF_FLAG_PTR(ob->flag);
+ return GET_ACF_FLAG_PTR(ob->flag, type);
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(ob->nlaflag); // xxx
+ return GET_ACF_FLAG_PTR(ob->nlaflag, type); // xxx
case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (ob->adt)
- GET_ACF_FLAG_PTR(ob->adt->flag)
+ return GET_ACF_FLAG_PTR(ob->adt->flag, type);
else
return NULL;
@@ -817,7 +814,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 */
@@ -835,7 +832,7 @@ static void *acf_group_setting_ptr(bAnimListElem *ale, int UNUSED(setting), shor
bActionGroup *agrp= (bActionGroup *)ale->data;
/* all flags are just in agrp->flag for now... */
- GET_ACF_FLAG_PTR(agrp->flag);
+ return GET_ACF_FLAG_PTR(agrp->flag, type);
}
/* group type define */
@@ -905,7 +902,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 */
@@ -922,7 +919,7 @@ static void *acf_fcurve_setting_ptr(bAnimListElem *ale, int UNUSED(setting), sho
FCurve *fcu= (FCurve *)ale->data;
/* all flags are just in agrp->flag for now... */
- GET_ACF_FLAG_PTR(fcu->flag);
+ return GET_ACF_FLAG_PTR(fcu->flag, type);
}
/* fcurve type define */
@@ -997,13 +994,13 @@ static void *acf_fillactd_setting_ptr(bAnimListElem *ale, int setting, short *ty
switch (setting) {
case ACHANNEL_SETTING_SELECT: /* selected */
if (adt) {
- GET_ACF_FLAG_PTR(adt->flag);
+ return GET_ACF_FLAG_PTR(adt->flag, type);
}
else
return NULL;
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(act->flag);
+ return GET_ACF_FLAG_PTR(act->flag, type);
default: /* unsupported */
return NULL;
@@ -1082,7 +1079,7 @@ static void *acf_filldrivers_setting_ptr(bAnimListElem *ale, int setting, short
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(adt->flag);
+ return GET_ACF_FLAG_PTR(adt->flag, type);
default: /* unsupported */
return NULL;
@@ -1152,13 +1149,13 @@ static void *acf_dsmat_setting_ptr(bAnimListElem *ale, int setting, short *type)
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(ma->flag);
+ return GET_ACF_FLAG_PTR(ma->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (ma->adt)
- GET_ACF_FLAG_PTR(ma->adt->flag)
+ return GET_ACF_FLAG_PTR(ma->adt->flag, type);
else
return NULL;
@@ -1229,13 +1226,13 @@ static void *acf_dslam_setting_ptr(bAnimListElem *ale, int setting, short *type)
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(la->flag);
+ return GET_ACF_FLAG_PTR(la->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (la->adt)
- GET_ACF_FLAG_PTR(la->adt->flag)
+ return GET_ACF_FLAG_PTR(la->adt->flag, type);
else
return NULL;
@@ -1313,13 +1310,13 @@ static void *acf_dstex_setting_ptr(bAnimListElem *ale, int setting, short *type)
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(tex->flag);
+ return GET_ACF_FLAG_PTR(tex->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (tex->adt)
- GET_ACF_FLAG_PTR(tex->adt->flag)
+ return GET_ACF_FLAG_PTR(tex->adt->flag, type);
else
return NULL;
@@ -1390,13 +1387,13 @@ static void *acf_dscam_setting_ptr(bAnimListElem *ale, int setting, short *type)
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(ca->flag);
+ return GET_ACF_FLAG_PTR(ca->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (ca->adt)
- GET_ACF_FLAG_PTR(ca->adt->flag)
+ return GET_ACF_FLAG_PTR(ca->adt->flag, type);
else
return NULL;
@@ -1477,13 +1474,13 @@ static void *acf_dscur_setting_ptr(bAnimListElem *ale, int setting, short *type)
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(cu->flag);
+ return GET_ACF_FLAG_PTR(cu->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (cu->adt)
- GET_ACF_FLAG_PTR(cu->adt->flag)
+ return GET_ACF_FLAG_PTR(cu->adt->flag, type);
else
return NULL;
@@ -1554,13 +1551,13 @@ static void *acf_dsskey_setting_ptr(bAnimListElem *ale, int setting, short *type
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(key->flag);
+ return GET_ACF_FLAG_PTR(key->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (key->adt)
- GET_ACF_FLAG_PTR(key->adt->flag)
+ return GET_ACF_FLAG_PTR(key->adt->flag, type);
else
return NULL;
@@ -1631,13 +1628,13 @@ static void *acf_dswor_setting_ptr(bAnimListElem *ale, int setting, short *type)
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(wo->flag);
+ return GET_ACF_FLAG_PTR(wo->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (wo->adt)
- GET_ACF_FLAG_PTR(wo->adt->flag)
+ return GET_ACF_FLAG_PTR(wo->adt->flag, type);
else
return NULL;
@@ -1708,13 +1705,13 @@ static void *acf_dspart_setting_ptr(bAnimListElem *ale, int setting, short *type
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(part->flag);
+ return GET_ACF_FLAG_PTR(part->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (part->adt)
- GET_ACF_FLAG_PTR(part->adt->flag)
+ return GET_ACF_FLAG_PTR(part->adt->flag, type);
else
return NULL;
@@ -1785,13 +1782,13 @@ static void *acf_dsmball_setting_ptr(bAnimListElem *ale, int setting, short *typ
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(mb->flag);
+ return GET_ACF_FLAG_PTR(mb->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (mb->adt)
- GET_ACF_FLAG_PTR(mb->adt->flag)
+ return GET_ACF_FLAG_PTR(mb->adt->flag, type);
else
return NULL;
@@ -1862,13 +1859,13 @@ static void *acf_dsarm_setting_ptr(bAnimListElem *ale, int setting, short *type)
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(arm->flag);
+ return GET_ACF_FLAG_PTR(arm->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (arm->adt)
- GET_ACF_FLAG_PTR(arm->adt->flag)
+ return GET_ACF_FLAG_PTR(arm->adt->flag, type);
else
return NULL;
@@ -1950,13 +1947,13 @@ static void *acf_dsntree_setting_ptr(bAnimListElem *ale, int setting, short *typ
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(ntree->flag);
+ return GET_ACF_FLAG_PTR(ntree->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (ntree->adt)
- GET_ACF_FLAG_PTR(ntree->adt->flag)
+ return GET_ACF_FLAG_PTR(ntree->adt->flag, type);
else
return NULL;
@@ -2027,13 +2024,13 @@ static void *acf_dsmesh_setting_ptr(bAnimListElem *ale, int setting, short *type
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(me->flag);
+ return GET_ACF_FLAG_PTR(me->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (me->adt)
- GET_ACF_FLAG_PTR(me->adt->flag)
+ return GET_ACF_FLAG_PTR(me->adt->flag, type);
else
return NULL;
@@ -2104,13 +2101,13 @@ static void *acf_dslat_setting_ptr(bAnimListElem *ale, int setting, short *type)
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(lt->flag);
+ return GET_ACF_FLAG_PTR(lt->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (lt->adt)
- GET_ACF_FLAG_PTR(lt->adt->flag)
+ return GET_ACF_FLAG_PTR(lt->adt->flag, type);
else
return NULL;
@@ -2181,13 +2178,13 @@ static void *acf_dsspk_setting_ptr(bAnimListElem *ale, int setting, short *type)
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- GET_ACF_FLAG_PTR(spk->flag);
+ return GET_ACF_FLAG_PTR(spk->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
if (spk->adt)
- GET_ACF_FLAG_PTR(spk->adt->flag)
+ return GET_ACF_FLAG_PTR(spk->adt->flag, type);
else
return NULL;
@@ -2296,7 +2293,7 @@ static void *acf_shapekey_setting_ptr(bAnimListElem *ale, int setting, short *ty
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted */
case ACHANNEL_SETTING_PROTECT: /* protected */
- GET_ACF_FLAG_PTR(kb->flag)
+ return GET_ACF_FLAG_PTR(kb->flag, type);
default: /* unsupported */
return NULL;
@@ -2375,7 +2372,7 @@ static void *acf_gpd_setting_ptr(bAnimListElem *ale, int UNUSED(setting), short
bGPdata *gpd= (bGPdata *)ale->data;
/* all flags are just in gpd->flag for now... */
- GET_ACF_FLAG_PTR(gpd->flag);
+ return GET_ACF_FLAG_PTR(gpd->flag, type);
}
/* gpencil datablock type define */
@@ -2399,7 +2396,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;
@@ -2450,7 +2447,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 */
@@ -2464,7 +2461,7 @@ static void *acf_gpl_setting_ptr(bAnimListElem *ale, int UNUSED(setting), short
bGPDlayer *gpl= (bGPDlayer *)ale->data;
/* all flags are just in agrp->flag for now... */
- GET_ACF_FLAG_PTR(gpl->flag);
+ return GET_ACF_FLAG_PTR(gpl->flag, type);
}
/* grease pencil layer type define */
@@ -2493,12 +2490,12 @@ static bAnimChannelType ACF_GPL =
static bAnimChannelType *animchannelTypeInfo[ANIMTYPE_NUM_TYPES];
static short ACF_INIT= 1; /* when non-zero, the list needs to be updated */
-/* Initialise type info definitions */
+/* Initialize type info definitions */
static void ANIM_init_channel_typeinfo_data (void)
{
int type= 0;
- /* start initialising if necessary... */
+ /* start initializing if necessary... */
if (ACF_INIT) {
ACF_INIT= 0;
@@ -2600,8 +2597,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;
@@ -2678,8 +2674,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;
@@ -2735,7 +2730,7 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float
float y, ymid, ytext;
/* sanity checks - don't draw anything */
- if ELEM(NULL, acf, ale)
+ if (ELEM(NULL, acf, ale))
return;
/* get initial offset */
@@ -2831,8 +2826,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);
@@ -3121,17 +3115,17 @@ static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChan
if (ptr && flag) {
switch (ptrsize) {
case sizeof(int): /* integer pointer for setting */
- but= uiDefIconButBitI(block, butType, flag, 0, icon,
+ but = uiDefIconButBitI(block, butType, flag, 0, icon,
xpos, ypos, ICON_WIDTH, ICON_WIDTH, ptr, 0, 0, 0, 0, tooltip);
break;
case sizeof(short): /* short pointer for setting */
- but= uiDefIconButBitS(block, butType, flag, 0, icon,
+ but = uiDefIconButBitS(block, butType, flag, 0, icon,
xpos, ypos, ICON_WIDTH, ICON_WIDTH, ptr, 0, 0, 0, 0, tooltip);
break;
case sizeof(char): /* char pointer for setting */
- but= uiDefIconButBitC(block, butType, flag, 0, icon,
+ but = uiDefIconButBitC(block, butType, flag, 0, icon,
xpos, ypos, ICON_WIDTH, ICON_WIDTH, ptr, 0, 0, 0, 0, tooltip);
break;
}
@@ -3164,7 +3158,7 @@ void ANIM_channel_draw_widgets (bContext *C, bAnimContext *ac, bAnimListElem *al
short offset;
/* sanity checks - don't draw anything */
- if ELEM3(NULL, acf, ale, block)
+ if (ELEM3(NULL, acf, ale, block))
return;
/* get initial offset */
@@ -3282,7 +3276,7 @@ void ANIM_channel_draw_widgets (bContext *C, bAnimContext *ac, bAnimListElem *al
* - even if we can draw sliders for this view, we must also check that the channel-type supports them
* (only only F-Curves really can support them for now)
* - to make things easier, we use RNA-autobuts for this so that changes are reflected immediately,
- * whereever they occurred. BUT, we don't use the layout engine, otherwise we'd get wrong alignment,
+ * wherever they occurred. BUT, we don't use the layout engine, otherwise we'd get wrong alignment,
* and wouldn't be able to auto-keyframe...
* - slider should start before the toggles (if they're visible) to keep a clean line down the side
*/
@@ -3326,7 +3320,7 @@ void ANIM_channel_draw_widgets (bContext *C, bAnimContext *ac, bAnimListElem *al
uiBut *but;
/* create the slider button, and assign relevant callback to ensure keyframes are inserted... */
- but= uiDefAutoButR(block, &ptr, prop, array_index, "", ICON_NONE, (int)v2d->cur.xmax-offset, ymid, SLIDER_WIDTH, (int)ymaxc-yminc);
+ but = uiDefAutoButR(block, &ptr, prop, array_index, "", ICON_NONE, (int)v2d->cur.xmax-offset, ymid, SLIDER_WIDTH, (int)ymaxc-yminc);
/* assign keyframing function according to slider type */
if (ale->type == ANIMTYPE_SHAPEKEY)
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index 8ac7406462d..fb6a65a585f 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -367,7 +367,7 @@ void ANIM_deselect_anim_channels (bAnimContext *ac, void *data, short datatype,
* - anim_data: list of the all the anim channels that can be chosen
* -> filtered using ANIMFILTER_CHANNELS only, since if we took VISIBLE too,
* then the channels under closed expanders get ignored...
- * - ale_setting: the anim channel (not in the anim_data list directly, though occuring there)
+ * - ale_setting: the anim channel (not in the anim_data list directly, though occurring there)
* with the new state of the setting that we want flushed up/down the hierarchy
* - setting: type of setting to set
* - on: whether the visibility setting has been enabled or disabled
@@ -394,14 +394,14 @@ void ANIM_flush_setting_anim_channels (bAnimContext *ac, ListBase *anim_data, bA
}
}
if (match == NULL) {
- printf("ERROR: no channel matching the one changed was found \n");
+ printf("ERROR: no channel matching the one changed was found\n");
return;
}
else {
bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale_setting);
if (acf == NULL) {
- printf("ERROR: no channel info for the changed channel \n");
+ printf("ERROR: no channel info for the changed channel\n");
return;
}
@@ -541,8 +541,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;
}
@@ -951,7 +950,7 @@ static void split_groups_action_temp (bAction *act, bActionGroup *tgrp)
}
}
- /* Initialise memory for temp-group */
+ /* Initialize memory for temp-group */
memset(tgrp, 0, sizeof(bActionGroup));
tgrp->flag |= (AGRP_EXPANDED|AGRP_TEMP);
BLI_strncpy(tgrp->name, "#TempGroup", sizeof(tgrp->name));
@@ -1086,7 +1085,7 @@ static int animchannels_rearrange_exec(bContext *C, wmOperator *op)
default: /* some collection of actions */
if (adt->action)
rearrange_action_channels(&ac, adt->action, mode);
- else if (G.f & G_DEBUG)
+ else if (G.debug & G_DEBUG)
printf("Animdata has no action\n");
break;
}
@@ -1105,19 +1104,19 @@ static int animchannels_rearrange_exec(bContext *C, wmOperator *op)
static void ANIM_OT_channels_move (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move Channels";
- ot->idname= "ANIM_OT_channels_move";
+ ot->name = "Move Channels";
+ ot->idname = "ANIM_OT_channels_move";
ot->description = "Rearrange selected animation channels";
/* api callbacks */
- ot->exec= animchannels_rearrange_exec;
- ot->poll= animedit_poll_channels_nla_tweakmode_off;
+ ot->exec = animchannels_rearrange_exec;
+ ot->poll = animedit_poll_channels_nla_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- ot->prop= RNA_def_enum(ot->srna, "direction", prop_animchannel_rearrange_types, REARRANGE_ANIMCHAN_DOWN, "Direction", "");
+ ot->prop = RNA_def_enum(ot->srna, "direction", prop_animchannel_rearrange_types, REARRANGE_ANIMCHAN_DOWN, "Direction", "");
}
/* ******************** Delete Channel Operator *********************** */
@@ -1221,16 +1220,16 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
static void ANIM_OT_channels_delete (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Channels";
- ot->idname= "ANIM_OT_channels_delete";
- ot->description= "Delete all selected animation channels";
+ ot->name = "Delete Channels";
+ ot->idname = "ANIM_OT_channels_delete";
+ ot->description = "Delete all selected animation channels";
/* api callbacks */
- ot->exec= animchannels_delete_exec;
- ot->poll= animedit_poll_channels_active;
+ ot->exec = animchannels_delete_exec;
+ ot->poll = animedit_poll_channels_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Set Channel Visibility Operator *********************** */
@@ -1313,16 +1312,16 @@ static int animchannels_visibility_set_exec(bContext *C, wmOperator *UNUSED(op))
static void ANIM_OT_channels_visibility_set (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Visibility";
- ot->idname= "ANIM_OT_channels_visibility_set";
- ot->description= "Make only the selected animation channels visible in the Graph Editor";
+ ot->name = "Set Visibility";
+ ot->idname = "ANIM_OT_channels_visibility_set";
+ ot->description = "Make only the selected animation channels visible in the Graph Editor";
/* api callbacks */
- ot->exec= animchannels_visibility_set_exec;
- ot->poll= ED_operator_graphedit_active;
+ ot->exec = animchannels_visibility_set_exec;
+ ot->poll = ED_operator_graphedit_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -1390,16 +1389,16 @@ static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *UNUSED(o
static void ANIM_OT_channels_visibility_toggle (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Visibility";
- ot->idname= "ANIM_OT_channels_visibility_toggle";
- ot->description= "Toggle visibility in Graph Editor of all selected animation channels";
+ ot->name = "Toggle Visibility";
+ ot->idname = "ANIM_OT_channels_visibility_toggle";
+ ot->description = "Toggle visibility in Graph Editor of all selected animation channels";
/* api callbacks */
- ot->exec= animchannels_visibility_toggle_exec;
- ot->poll= ED_operator_graphedit_active;
+ ot->exec = animchannels_visibility_toggle_exec;
+ ot->poll = ED_operator_graphedit_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ********************** Set Flags Operator *********************** */
@@ -1533,82 +1532,82 @@ static int animchannels_setflag_exec(bContext *C, wmOperator *op)
static void ANIM_OT_channels_setting_enable (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Enable Channel Setting";
- ot->idname= "ANIM_OT_channels_setting_enable";
- ot->description= "Enable specified setting on all selected animation channels";
+ ot->name = "Enable Channel Setting";
+ ot->idname = "ANIM_OT_channels_setting_enable";
+ ot->description = "Enable specified setting on all selected animation channels";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= animchannels_setflag_exec;
- ot->poll= animedit_poll_channels_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = animchannels_setflag_exec;
+ ot->poll = animedit_poll_channels_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
/* flag-setting mode */
RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_ADD, "Mode", "");
/* setting to set */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
}
/* duplicate of 'ANIM_OT_channels_setting_toggle' for menu title only, weak! */
static void ANIM_OT_channels_setting_disable (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Disable Channel Setting";
- ot->idname= "ANIM_OT_channels_setting_disable";
- ot->description= "Disable specified setting on all selected animation channels";
+ ot->name = "Disable Channel Setting";
+ ot->idname = "ANIM_OT_channels_setting_disable";
+ ot->description = "Disable specified setting on all selected animation channels";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= animchannels_setflag_exec;
- ot->poll= animedit_poll_channels_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = animchannels_setflag_exec;
+ ot->poll = animedit_poll_channels_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
/* flag-setting mode */
RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_CLEAR, "Mode", "");
/* setting to set */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
}
static void ANIM_OT_channels_setting_toggle (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Channel Setting";
- ot->idname= "ANIM_OT_channels_setting_toggle";
- ot->description= "Toggle specified setting on all selected animation channels";
+ ot->name = "Toggle Channel Setting";
+ ot->idname = "ANIM_OT_channels_setting_toggle";
+ ot->description = "Toggle specified setting on all selected animation channels";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= animchannels_setflag_exec;
- ot->poll= animedit_poll_channels_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = animchannels_setflag_exec;
+ ot->poll = animedit_poll_channels_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
/* flag-setting mode */
RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_TOGGLE, "Mode", "");
/* setting to set */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
}
static void ANIM_OT_channels_editable_toggle (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Channel Editability";
- ot->idname= "ANIM_OT_channels_editable_toggle";
- ot->description= "Toggle editability of selected channels";
+ ot->name = "Toggle Channel Editability";
+ ot->idname = "ANIM_OT_channels_editable_toggle";
+ ot->description = "Toggle editability of selected channels";
/* api callbacks */
- ot->exec= animchannels_setflag_exec;
- ot->poll= animedit_poll_channels_active;
+ ot->exec = animchannels_setflag_exec;
+ ot->poll = animedit_poll_channels_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
/* flag-setting mode */
@@ -1644,19 +1643,19 @@ static int animchannels_expand_exec (bContext *C, wmOperator *op)
static void ANIM_OT_channels_expand (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Expand Channels";
- ot->idname= "ANIM_OT_channels_expand";
- ot->description= "Expand (i.e. open) all selected expandable animation channels";
+ ot->name = "Expand Channels";
+ ot->idname = "ANIM_OT_channels_expand";
+ ot->description = "Expand (i.e. open) all selected expandable animation channels";
/* api callbacks */
- ot->exec= animchannels_expand_exec;
- ot->poll= animedit_poll_channels_active;
+ ot->exec = animchannels_expand_exec;
+ ot->poll = animedit_poll_channels_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- ot->prop= RNA_def_boolean(ot->srna, "all", 1, "All", "Expand all channels (not just selected ones)");
+ ot->prop = RNA_def_boolean(ot->srna, "all", 1, "All", "Expand all channels (not just selected ones)");
}
/* ********************** Collapse Channels Operator *********************** */
@@ -1686,19 +1685,19 @@ static int animchannels_collapse_exec (bContext *C, wmOperator *op)
static void ANIM_OT_channels_collapse (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Collapse Channels";
- ot->idname= "ANIM_OT_channels_collapse";
- ot->description= "Collapse (i.e. close) all selected expandable animation channels";
+ ot->name = "Collapse Channels";
+ ot->idname = "ANIM_OT_channels_collapse";
+ ot->description = "Collapse (i.e. close) all selected expandable animation channels";
/* api callbacks */
- ot->exec= animchannels_collapse_exec;
- ot->poll= animedit_poll_channels_active;
+ ot->exec = animchannels_collapse_exec;
+ ot->poll = animedit_poll_channels_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- ot->prop= RNA_def_boolean(ot->srna, "all", 1, "All", "Collapse all channels (not just selected ones)");
+ ot->prop = RNA_def_boolean(ot->srna, "all", 1, "All", "Collapse all channels (not just selected ones)");
}
/* ******************* Reenable Disabled Operator ******************* */
@@ -1762,16 +1761,16 @@ static int animchannels_enable_exec (bContext *C, wmOperator *UNUSED(op))
static void ANIM_OT_channels_fcurves_enable (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Revive Disabled F-Curves";
- ot->idname= "ANIM_OT_channels_fcurves_enable";
- ot->description= "Clears 'disabled' tag from all F-Curves to get broken F-Curves working again";
+ ot->name = "Revive Disabled F-Curves";
+ ot->idname = "ANIM_OT_channels_fcurves_enable";
+ ot->description = "Clears 'disabled' tag from all F-Curves to get broken F-Curves working again";
/* api callbacks */
- ot->exec= animchannels_enable_exec;
- ot->poll= animchannels_enable_poll;
+ ot->exec = animchannels_enable_exec;
+ ot->poll = animchannels_enable_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ********************** Select All Operator *********************** */
@@ -1784,7 +1783,7 @@ static int animchannels_deselectall_exec (bContext *C, wmOperator *op)
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
- /* 'standard' behaviour - check if selected, then apply relevant selection */
+ /* 'standard' behavior - check if selected, then apply relevant selection */
if (RNA_boolean_get(op->ptr, "invert"))
ANIM_deselect_anim_channels(&ac, ac.data, ac.datatype, 0, ACHANNEL_SETFLAG_TOGGLE);
else
@@ -1799,19 +1798,19 @@ static int animchannels_deselectall_exec (bContext *C, wmOperator *op)
static void ANIM_OT_channels_select_all_toggle (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select All";
- ot->idname= "ANIM_OT_channels_select_all_toggle";
- ot->description= "Toggle selection of all animation channels";
+ ot->name = "Select All";
+ ot->idname = "ANIM_OT_channels_select_all_toggle";
+ ot->description = "Toggle selection of all animation channels";
/* api callbacks */
- ot->exec= animchannels_deselectall_exec;
- ot->poll= animedit_poll_channels_nla_tweakmode_off;
+ ot->exec = animchannels_deselectall_exec;
+ ot->poll = animedit_poll_channels_nla_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- ot->prop= RNA_def_boolean(ot->srna, "invert", 0, "Invert", "");
+ ot->prop = RNA_def_boolean(ot->srna, "invert", 0, "Invert", "");
}
/* ******************** Borderselect Operator *********************** */
@@ -1902,15 +1901,15 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
/* get settings 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");
+ 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");
gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
extend= RNA_boolean_get(op->ptr, "extend");
- if(!extend)
+ if (!extend)
ANIM_deselect_anim_channels(&ac, ac.data, ac.datatype, 1, ACHANNEL_SETFLAG_CLEAR);
if (gesture_mode == GESTURE_MODAL_SELECT)
@@ -1930,20 +1929,20 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
static void ANIM_OT_channels_select_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Border Select";
- ot->idname= "ANIM_OT_channels_select_border";
- ot->description= "Select all animation channels within the specified region";
+ ot->name = "Border Select";
+ ot->idname = "ANIM_OT_channels_select_border";
+ ot->description = "Select all animation channels within the specified region";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= animchannels_borderselect_exec;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = animchannels_borderselect_exec;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= animedit_poll_channels_nla_tweakmode_off;
+ ot->poll = animedit_poll_channels_nla_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
WM_operator_properties_gesture_border(ot, TRUE);
@@ -1968,8 +1967,8 @@ static void rename_anim_channels (bAnimContext *ac, int channel_index)
ale= BLI_findlink(&anim_data, channel_index);
if (ale == NULL) {
/* channel not found */
- if (G.f & G_DEBUG)
- printf("Error: animation channel (index = %d) not found in rename_anim_channels() \n", channel_index);
+ if (G.debug & G_DEBUG)
+ printf("Error: animation channel (index = %d) not found in rename_anim_channels()\n", channel_index);
BLI_freelistN(&anim_data);
return;
@@ -1985,7 +1984,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
@@ -2041,13 +2040,13 @@ static int animchannels_rename_invoke (bContext *C, wmOperator *UNUSED(op), wmEv
static void ANIM_OT_channels_rename (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Rename Channels";
- ot->idname= "ANIM_OT_channels_rename";
- ot->description= "Rename animation channel under mouse";
+ ot->name = "Rename Channels";
+ ot->idname = "ANIM_OT_channels_rename";
+ ot->description = "Rename animation channel under mouse";
/* api callbacks */
- ot->invoke= animchannels_rename_invoke;
- ot->poll= animedit_poll_channels_active;
+ ot->invoke = animchannels_rename_invoke;
+ ot->poll = animedit_poll_channels_active;
}
/* ******************** Mouse-Click Operator *********************** */
@@ -2069,8 +2068,8 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
ale= BLI_findlink(&anim_data, channel_index);
if (ale == NULL) {
/* channel not found */
- if (G.f & G_DEBUG)
- printf("Error: animation channel (index = %d) not found in mouse_anim_channels() \n", channel_index);
+ if (G.debug & G_DEBUG)
+ printf("Error: animation channel (index = %d) not found in mouse_anim_channels()\n", channel_index);
BLI_freelistN(&anim_data);
return 0;
@@ -2289,8 +2288,8 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
}
break;
default:
- if (G.f & G_DEBUG)
- printf("Error: Invalid channel type in mouse_anim_channels() \n");
+ if (G.debug & G_DEBUG)
+ printf("Error: Invalid channel type in mouse_anim_channels()\n");
}
/* free channels */
@@ -2350,16 +2349,16 @@ static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *
static void ANIM_OT_channels_click (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mouse Click on Channels";
- ot->idname= "ANIM_OT_channels_click";
- ot->description= "Handle mouse-clicks over animation channels";
+ ot->name = "Mouse Click on Channels";
+ ot->idname = "ANIM_OT_channels_click";
+ ot->description = "Handle mouse-clicks over animation channels";
/* api callbacks */
- ot->invoke= animchannels_mouseclick_invoke;
- ot->poll= animedit_poll_channels_active;
+ ot->invoke = animchannels_mouseclick_invoke;
+ ot->poll = animedit_poll_channels_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", ""); // SHIFTKEY
diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c
index 3f851938a83..3f0e1b1be14 100644
--- a/source/blender/editors/animation/anim_deps.c
+++ b/source/blender/editors/animation/anim_deps.c
@@ -81,19 +81,19 @@ 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;
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))
RNA_property_update_main(G.main, scene, &ptr, prop);
}
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?
}
}
@@ -115,7 +115,7 @@ void ANIM_id_update(Scene *UNUSED(scene), ID *id)
}
/* **************************** animation data <-> data syncing ******************************** */
-/* This code here is used to synchronise the
+/* This code here is used to synchronize the
* - selection (to find selected data easier)
* - ... (insert other relevant items here later)
* status in relevant Blender data with the status stored in animation channels.
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index 32e5fe82ed4..bab341ae70b 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -51,9 +51,6 @@
#include "UI_resources.h"
#include "UI_view2d.h"
-/* XXX */
-extern void ui_rasterpos_safe(float x, float y, float aspect);
-
/* *************************************************** */
/* TIME CODE FORMATTING */
@@ -189,7 +186,7 @@ static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time)
/* get timecode string
* - padding on str-buf passed so that it doesn't sit on the frame indicator
- * - power = 0, gives 'standard' behaviour for time
+ * - power = 0, gives 'standard' behavior for time
* but power = 1 is required for frames (to get integer frames)
*/
if (time)
@@ -367,18 +364,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 62d4ea25c3d..e5822c76fa1 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -362,7 +362,10 @@ short ANIM_animdata_get_context (const bContext *C, bAnimContext *ac)
else {\
filter_mode |= ANIMFILTER_TMP_PEEK; \
} \
- (void) _doSubChannels;
+ \
+ { \
+ (void) _doSubChannels; \
+ }
/* ... standard sub-channel filtering can go on here now ... */
#define END_ANIMFILTER_SUBCHANNELS \
filter_mode = _filter; \
@@ -954,7 +957,7 @@ static FCurve *animfilter_fcurve_next (bDopeSheet *ads, FCurve *first, bActionGr
/* only work with this channel and its subchannels if it is editable */
if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_FCU(fcu)) {
/* only include this curve if selected in a way consistent with the filtering requirements */
- if ( ANIMCHANNEL_SELOK(SEL_FCU(fcu)) && ANIMCHANNEL_SELEDITOK(SEL_FCU(fcu)) ) {
+ if (ANIMCHANNEL_SELOK(SEL_FCU(fcu)) && ANIMCHANNEL_SELEDITOK(SEL_FCU(fcu))) {
/* only include if this curve is active */
if (!(filter_mode & ANIMFILTER_ACTIVE) || (fcu->flag & FCURVE_ACTIVE)) {
/* name based filtering... */
@@ -1038,8 +1041,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 */
@@ -1169,7 +1171,7 @@ static size_t animfilter_nla (bAnimContext *UNUSED(ac), ListBase *anim_data, bDo
/* only work with this channel and its subchannels if it is editable */
if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_NLT(nlt)) {
/* only include this track if selected in a way consistent with the filtering requirements */
- if ( ANIMCHANNEL_SELOK(SEL_NLT(nlt)) ) {
+ if (ANIMCHANNEL_SELOK(SEL_NLT(nlt))) {
/* only include if this track is active */
if (!(filter_mode & ANIMFILTER_ACTIVE) || (nlt->flag & NLATRACK_ACTIVE)) {
ANIMCHANNEL_NEW_CHANNEL(nlt, ANIMTYPE_NLATRACK, owner_id);
@@ -1189,7 +1191,7 @@ static size_t animfilter_block_data (bAnimContext *ac, ListBase *anim_data, bDop
size_t items = 0;
/* image object datablocks have no anim-data so check for NULL */
- if(adt) {
+ if (adt) {
IdAdtTemplate *iat = (IdAdtTemplate*)id;
/* NOTE: this macro is used instead of inlining the logic here, since this sort of filtering is still needed
@@ -1229,7 +1231,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;
@@ -1285,7 +1287,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)
{
@@ -1349,7 +1351,7 @@ static size_t animdata_filter_ds_nodetree (bAnimContext *ac, ListBase *anim_data
/* include data-expand widget first */
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
/* check if filtering by active status */
- if ANIMCHANNEL_ACTIVEOK(ntree) {
+ if (ANIMCHANNEL_ACTIVEOK(ntree)) {
ANIMCHANNEL_NEW_CHANNEL(ntree, ANIMTYPE_DSNTREE, owner_id);
}
}
@@ -1397,8 +1399,8 @@ static size_t animdata_filter_ds_textures (bAnimContext *ac, ListBase *anim_data
default:
{
/* invalid/unsupported option */
- if (G.f & G_DEBUG)
- printf("ERROR: unsupported owner_id (i.e. texture stack) for filter textures - %s \n", owner_id->name);
+ if (G.debug & G_DEBUG)
+ printf("ERROR: unsupported owner_id (i.e. texture stack) for filter textures - %s\n", owner_id->name);
return 0;
}
}
@@ -1434,7 +1436,7 @@ static size_t animdata_filter_ds_textures (bAnimContext *ac, ListBase *anim_data
/* include texture-expand widget? */
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
/* check if filtering by active status */
- if ANIMCHANNEL_ACTIVEOK(tex) {
+ if (ANIMCHANNEL_ACTIVEOK(tex)) {
ANIMCHANNEL_NEW_CHANNEL(tex, ANIMTYPE_DSTEX, owner_id);
}
}
@@ -1486,7 +1488,7 @@ static size_t animdata_filter_ds_materials (bAnimContext *ac, ListBase *anim_dat
// hmm... do we need to store the index of this material in the array anywhere?
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
/* check if filtering by active status */
- if ANIMCHANNEL_ACTIVEOK(ma) {
+ if (ANIMCHANNEL_ACTIVEOK(ma)) {
ANIMCHANNEL_NEW_CHANNEL(ma, ANIMTYPE_DSMAT, ma);
}
}
@@ -1528,7 +1530,7 @@ static size_t animdata_filter_ds_particles (bAnimContext *ac, ListBase *anim_dat
/* include particle-expand widget first */
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
/* check if filtering by active status */
- if ANIMCHANNEL_ACTIVEOK(psys->part) {
+ if (ANIMCHANNEL_ACTIVEOK(psys->part)) {
ANIMCHANNEL_NEW_CHANNEL(psys->part, ANIMTYPE_DSPART, psys->part);
}
}
@@ -1668,7 +1670,7 @@ static size_t animdata_filter_ds_obdata (bAnimContext *ac, ListBase *anim_data,
/* include data-expand widget first */
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
/* check if filtering by active status */
- if ANIMCHANNEL_ACTIVEOK(iat) {
+ if (ANIMCHANNEL_ACTIVEOK(iat)) {
ANIMCHANNEL_NEW_CHANNEL(iat, type, iat);
}
}
@@ -1702,7 +1704,7 @@ static size_t animdata_filter_ds_keyanim (bAnimContext *ac, ListBase *anim_data,
if (tmp_items) {
/* include key-expand widget first */
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
- if ANIMCHANNEL_ACTIVEOK(key) {
+ if (ANIMCHANNEL_ACTIVEOK(key)) {
ANIMCHANNEL_NEW_CHANNEL(key, ANIMTYPE_DSSKEY, ob);
}
}
@@ -1819,7 +1821,7 @@ static size_t animdata_filter_dopesheet_ob (bAnimContext *ac, ListBase *anim_dat
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
/* check if filtering by selection */
// XXX: double-check on this - most of the time, a lot of tools need to filter out these channels!
- if ANIMCHANNEL_SELOK((base->flag & SELECT)) {
+ if (ANIMCHANNEL_SELOK((base->flag & SELECT))) {
/* check if filtering by active status */
if (ANIMCHANNEL_ACTIVEOK(ob)) {
ANIMCHANNEL_NEW_CHANNEL(base, ANIMTYPE_OBJECT, ob);
@@ -1864,7 +1866,7 @@ static size_t animdata_filter_ds_world (bAnimContext *ac, ListBase *anim_data, b
/* include data-expand widget first */
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
/* check if filtering by active status */
- if ANIMCHANNEL_ACTIVEOK(wo) {
+ if (ANIMCHANNEL_ACTIVEOK(wo)) {
ANIMCHANNEL_NEW_CHANNEL(wo, ANIMTYPE_DSWOR, sce);
}
}
@@ -1969,7 +1971,7 @@ static size_t animdata_filter_dopesheet_scene (bAnimContext *ac, ListBase *anim_
/* firstly add object expander if required */
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
/* check if filtering by selection */
- if ANIMCHANNEL_SELOK((sce->flag & SCE_DS_SELECTED)) {
+ if (ANIMCHANNEL_SELOK((sce->flag & SCE_DS_SELECTED))) {
/* NOTE: active-status doesn't matter for this! */
ANIMCHANNEL_NEW_CHANNEL(sce, ANIMTYPE_SCENE, sce);
}
@@ -1995,8 +1997,8 @@ static size_t animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data,
/* check that we do indeed have a scene */
if ((ads->source == NULL) || (GS(ads->source->name)!=ID_SCE)) {
printf("DopeSheet Error: Not scene!\n");
- if (G.f & G_DEBUG)
- printf("\tPointer = %p, Name = '%s' \n", (void *)ads->source, (ads->source)?ads->source->name:NULL);
+ if (G.debug & G_DEBUG)
+ printf("\tPointer = %p, Name = '%s'\n", (void *)ads->source, (ads->source)?ads->source->name:NULL);
return 0;
}
diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c
index 169d6b94413..6f4d4c4a431 100644
--- a/source/blender/editors/animation/anim_ipo_utils.c
+++ b/source/blender/editors/animation/anim_ipo_utils.c
@@ -61,7 +61,7 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
/* sanity checks */
if (name == NULL)
return icon;
- else if ELEM3(NULL, id, fcu, fcu->rna_path) {
+ else if (ELEM3(NULL, id, fcu, fcu->rna_path)) {
if (fcu == NULL)
strcpy(name, "<invalid>");
else if (fcu->rna_path == NULL)
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 00c849ed02d..73dba91207f 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;
+ }
}
}
}
@@ -201,7 +201,7 @@ void ED_markers_get_minmax (ListBase *markers, short sel, float *first, float *l
int selcount = 0;
/* sanity check */
- //printf("markers = %p - %p, %p \n", markers, markers->first, markers->last);
+ //printf("markers = %p - %p, %p\n", markers, markers->first, markers->last);
if (markers == NULL) {
*first = 0.0f;
*last = 0.0f;
@@ -232,7 +232,7 @@ void ED_markers_get_minmax (ListBase *markers, short sel, float *first, float *l
selcount= BLI_countlist(markers);
/* if only selected are to be considered, only consider the selected ones
- * (optimisation for not searching list)
+ * (optimization for not searching list)
*/
if (selcount > 1) {
for (marker= markers->first; marker; marker= marker->next) {
@@ -323,7 +323,7 @@ TimeMarker *ED_markers_get_first_selected(ListBase *markers)
/* --------------------------------- */
/* Print debugging prints of list of markers
- * BSI's: do NOT make static or put in if-defs as "unused code". That's too much trouble when we need to use for quick debuggging!
+ * BSI's: do NOT make static or put in if-defs as "unused code". That's too much trouble when we need to use for quick debugging!
*/
void debug_markers_print_list(ListBase *markers)
{
@@ -410,7 +410,7 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
}
else {
UI_ThemeColor(TH_TEXT);
- if((marker->frame <= cfra) && (marker->frame+5 > cfra)) {
+ if ((marker->frame <= cfra) && (marker->frame+5 > cfra)) {
x= xpos*xscale + 4.0f;
y= (ypixels <= 39.0f)? (ypixels - 10.0f) : 29.0f;
}
@@ -421,7 +421,7 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
}
#ifdef DURIAN_CAMERA_SWITCH
- if(marker->camera && (marker->camera->restrictflag & OB_RESTRICT_RENDER)) {
+ if (marker->camera && (marker->camera->restrictflag & OB_RESTRICT_RENDER)) {
float col[4];
glGetFloatv(GL_CURRENT_COLOR, col);
col[3]= 0.4;
@@ -582,44 +582,43 @@ static int ed_marker_add(bContext *C, wmOperator *UNUSED(op))
static void MARKER_OT_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Time Marker";
- ot->description= "Add a new time marker";
- ot->idname= "MARKER_OT_add";
+ ot->name = "Add Time Marker";
+ ot->description = "Add a new time marker";
+ ot->idname = "MARKER_OT_add";
/* api callbacks */
- ot->exec= ed_marker_add;
+ ot->exec = ed_marker_add;
ot->invoke = ed_markers_opwrap_invoke;
- ot->poll= ED_operator_animview_active;
+ ot->poll = ED_operator_animview_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ************************** 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;
@@ -639,7 +638,7 @@ static int ed_marker_move_init(bContext *C, wmOperator *op)
int totmark=0;
int a;
- if(markers == NULL) return 0;
+ if (markers == NULL) return 0;
for (marker= markers->first; marker; marker= marker->next)
if (marker->flag & SELECT) totmark++;
@@ -682,7 +681,7 @@ static void ed_marker_move_exit(bContext *C, wmOperator *op)
static int ed_marker_move_invoke(bContext *C, wmOperator *op, wmEvent *evt)
{
- if(ed_marker_move_init(C, op)) {
+ if (ed_marker_move_init(C, op)) {
MarkerMove *mm= op->customdata;
mm->evtx= evt->x;
@@ -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);
@@ -874,7 +872,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
static int ed_marker_move_exec(bContext *C, wmOperator *op)
{
- if(ed_marker_move_init(C, op)) {
+ if (ed_marker_move_init(C, op)) {
ed_marker_move_apply(op);
ed_marker_move_exit(C, op);
return OPERATOR_FINISHED;
@@ -885,19 +883,19 @@ static int ed_marker_move_exec(bContext *C, wmOperator *op)
static void MARKER_OT_move(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move Time Marker";
- ot->description= "Move selected time marker(s)";
- ot->idname= "MARKER_OT_move";
+ ot->name = "Move Time Marker";
+ ot->description = "Move selected time marker(s)";
+ ot->idname = "MARKER_OT_move";
/* api callbacks */
- ot->exec= ed_marker_move_exec;
- ot->invoke= ed_marker_move_invoke_wrapper;
- ot->modal= ed_marker_move_modal;
- ot->poll= ed_markers_poll_selected_markers;
- ot->cancel= ed_marker_move_cancel;
+ ot->exec = ed_marker_move_exec;
+ ot->invoke = ed_marker_move_invoke_wrapper;
+ ot->modal = ed_marker_move_modal;
+ ot->poll = ed_markers_poll_selected_markers;
+ ot->cancel = ed_marker_move_cancel;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
/* rna storage */
RNA_def_int(ot->srna, "frames", 0, INT_MIN, INT_MAX, "Frames", "", INT_MIN, INT_MAX);
@@ -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)
@@ -933,7 +929,7 @@ static void ed_marker_duplicate_apply(bContext *C)
return;
/* go through the list of markers, duplicate selected markers and add duplicated copies
- * to the begining of the list (unselect original markers)
+ * to the beginning of the list (unselect original markers)
*/
for (marker= markers->first; marker; marker= marker->next) {
if (marker->flag & SELECT) {
@@ -950,7 +946,7 @@ static void ed_marker_duplicate_apply(bContext *C)
newmarker->camera= marker->camera;
#endif
- /* new marker is added to the begining of list */
+ /* new marker is added to the beginning of list */
// FIXME: bad ordering!
BLI_addhead(markers, newmarker);
}
@@ -980,19 +976,19 @@ static int ed_marker_duplicate_invoke_wrapper(bContext *C, wmOperator *op, wmEve
static void MARKER_OT_duplicate(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Duplicate Time Marker";
- ot->description= "Duplicate selected time marker(s)";
- ot->idname= "MARKER_OT_duplicate";
+ ot->name = "Duplicate Time Marker";
+ ot->description = "Duplicate selected time marker(s)";
+ ot->idname = "MARKER_OT_duplicate";
/* api callbacks */
- ot->exec= ed_marker_duplicate_exec;
- ot->invoke= ed_marker_duplicate_invoke_wrapper;
- ot->modal= ed_marker_move_modal;
- ot->poll= ed_markers_poll_selected_markers;
- ot->cancel= ed_marker_move_cancel;
+ ot->exec = ed_marker_duplicate_exec;
+ ot->invoke = ed_marker_duplicate_invoke_wrapper;
+ ot->modal = ed_marker_move_modal;
+ ot->poll = ed_markers_poll_selected_markers;
+ ot->cancel = ed_marker_move_cancel;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna storage */
RNA_def_int(ot->srna, "frames", 0, INT_MIN, INT_MAX, "Frames", "", INT_MIN, INT_MAX);
@@ -1055,7 +1051,7 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera)
scene_deselect_all(scene);
for (marker= markers->first; marker; marker= marker->next) {
- if(marker->frame==cfra) {
+ if (marker->frame==cfra) {
sel= (marker->flag & SELECT);
break;
}
@@ -1067,7 +1063,7 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera)
base= object_in_scene(marker->camera, scene);
if (base) {
ED_base_object_select(base, sel);
- if(sel)
+ if (sel)
ED_base_object_activate(C, base);
}
}
@@ -1105,16 +1101,16 @@ static int ed_marker_select_invoke_wrapper(bContext *C, wmOperator *op, wmEvent
static void MARKER_OT_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Time Marker";
- ot->description= "Select time marker(s)";
- ot->idname= "MARKER_OT_select";
+ ot->name = "Select Time Marker";
+ ot->description = "Select time marker(s)";
+ ot->idname = "MARKER_OT_select";
/* api callbacks */
- ot->invoke= ed_marker_select_invoke_wrapper;
- ot->poll= ed_markers_poll_markers_exist;
+ ot->invoke = ed_marker_select_invoke_wrapper;
+ ot->poll = ed_markers_poll_markers_exist;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection");
#ifdef DURIAN_CAMERA_SWITCH
@@ -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)
{
@@ -1193,20 +1189,20 @@ static int ed_marker_select_border_invoke_wrapper(bContext *C, wmOperator *op, w
static void MARKER_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Marker Border select";
- ot->description= "Select all time markers using border selection";
- ot->idname= "MARKER_OT_select_border";
+ ot->name = "Marker Border select";
+ ot->description = "Select all time markers using border selection";
+ ot->idname = "MARKER_OT_select_border";
/* api callbacks */
- ot->exec= ed_marker_border_select_exec;
- ot->invoke= ed_marker_select_border_invoke_wrapper;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->exec = ed_marker_border_select_exec;
+ ot->invoke = ed_marker_select_border_invoke_wrapper;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= ed_markers_poll_markers_exist;
+ ot->poll = ed_markers_poll_markers_exist;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
WM_operator_properties_gesture_border(ot, TRUE);
@@ -1227,7 +1223,7 @@ static int ed_marker_select_all_exec(bContext *C, wmOperator *op)
action = (ED_markers_get_first_selected(markers) != NULL) ? SEL_DESELECT : SEL_SELECT;
}
- for(marker= markers->first; marker; marker= marker->next) {
+ for (marker= markers->first; marker; marker= marker->next) {
switch (action) {
case SEL_SELECT:
marker->flag |= SELECT;
@@ -1250,17 +1246,17 @@ static int ed_marker_select_all_exec(bContext *C, wmOperator *op)
static void MARKER_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "(De)select all markers";
- ot->description= "Change selection of all time markers";
- ot->idname= "MARKER_OT_select_all";
+ ot->name = "(De)select all markers";
+ ot->description = "Change selection of all time markers";
+ ot->idname = "MARKER_OT_select_all";
/* api callbacks */
- ot->exec= ed_marker_select_all_exec;
+ ot->exec = ed_marker_select_all_exec;
ot->invoke = ed_markers_opwrap_invoke;
- ot->poll= ed_markers_poll_markers_exist;
+ ot->poll = ed_markers_poll_markers_exist;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
WM_operator_properties_select_all(ot);
@@ -1303,17 +1299,17 @@ static int ed_marker_delete_invoke_wrapper(bContext *C, wmOperator *op, wmEvent
static void MARKER_OT_delete(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Markers";
- ot->description= "Delete selected time marker(s)";
- ot->idname= "MARKER_OT_delete";
+ ot->name = "Delete Markers";
+ ot->description = "Delete selected time marker(s)";
+ ot->idname = "MARKER_OT_delete";
/* api callbacks */
- ot->invoke= ed_marker_delete_invoke_wrapper;
- ot->exec= ed_marker_delete_exec;
- ot->poll= ed_markers_poll_selected_markers;
+ ot->invoke = ed_marker_delete_invoke_wrapper;
+ ot->exec = ed_marker_delete_exec;
+ ot->poll = ed_markers_poll_selected_markers;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -1339,7 +1335,7 @@ static int ed_marker_rename_exec(bContext *C, wmOperator *op)
static int ed_marker_rename_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt)
{
- /* must initialise the marker name first if there is a marker selected */
+ /* must initialize the marker name first if there is a marker selected */
TimeMarker *marker = ED_markers_get_first_selected(ED_context_get_markers(C));
if (marker)
RNA_string_set(op->ptr, "name", marker->name);
@@ -1351,17 +1347,17 @@ static int ed_marker_rename_invoke_wrapper(bContext *C, wmOperator *op, wmEvent
static void MARKER_OT_rename(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Rename Marker";
- ot->description= "Rename first selected time marker";
- ot->idname= "MARKER_OT_rename";
+ ot->name = "Rename Marker";
+ ot->description = "Rename first selected time marker";
+ ot->idname = "MARKER_OT_rename";
/* api callbacks */
- ot->invoke= ed_marker_rename_invoke_wrapper;
- ot->exec= ed_marker_rename_exec;
- ot->poll= ed_markers_poll_selected_markers;
+ ot->invoke = ed_marker_rename_invoke_wrapper;
+ ot->exec = ed_marker_rename_exec;
+ ot->poll = ed_markers_poll_selected_markers;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
ot->prop = RNA_def_string(ot->srna, "name", "RenamedMarker", sizeof(((TimeMarker *)NULL)->name), "Name", "New name for marker");
@@ -1404,22 +1400,22 @@ static void MARKER_OT_make_links_scene(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Make Links to Scene";
- ot->description= "Copy selected markers to another scene";
- ot->idname= "MARKER_OT_make_links_scene";
+ ot->name = "Make Links to Scene";
+ ot->description = "Copy selected markers to another scene";
+ ot->idname = "MARKER_OT_make_links_scene";
/* api callbacks */
- ot->exec= ed_marker_make_links_scene_exec;
+ ot->exec = ed_marker_make_links_scene_exec;
ot->invoke = ed_markers_opwrap_invoke;
- ot->poll= ed_markers_poll_selected_markers;
+ ot->poll = ed_markers_poll_selected_markers;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
prop= RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", "");
RNA_def_enum_funcs(prop, RNA_scene_itemf);
- ot->prop= prop;
+ ot->prop = prop;
}
@@ -1435,7 +1431,7 @@ static int ed_marker_camera_bind_exec(bContext *C, wmOperator *UNUSED(op))
TimeMarker *marker;
marker= ED_markers_get_first_selected(markers);
- if(marker == NULL)
+ if (marker == NULL)
return OPERATOR_CANCELLED;
marker->camera= ob;
@@ -1454,17 +1450,17 @@ static int ed_marker_camera_bind_exec(bContext *C, wmOperator *UNUSED(op))
static void MARKER_OT_camera_bind(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Bind Camera to Markers";
- ot->description= "Bind the active camera to selected markers(s)";
- ot->idname= "MARKER_OT_camera_bind";
+ ot->name = "Bind Camera to Markers";
+ ot->description = "Bind the active camera to selected markers(s)";
+ ot->idname = "MARKER_OT_camera_bind";
/* api callbacks */
- ot->exec= ed_marker_camera_bind_exec;
+ ot->exec = ed_marker_camera_bind_exec;
ot->invoke = ed_markers_opwrap_invoke;
- ot->poll= ed_markers_poll_selected_markers;
+ ot->poll = ed_markers_poll_selected_markers;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
#endif
@@ -1490,7 +1486,7 @@ void ED_operatortypes_marker(void)
/* called in screen_ops.c:ED_keymap_screen() */
void ED_marker_keymap(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "Markers", 0, 0);
+ wmKeyMap *keymap = WM_keymap_find(keyconf, "Markers", 0, 0);
wmKeyMapItem *kmi;
WM_keymap_verify_item(keymap, "MARKER_OT_add", MKEY, KM_PRESS, 0, 0);
@@ -1501,11 +1497,11 @@ void ED_marker_keymap(wmKeyConfig *keyconf)
RNA_boolean_set(kmi->ptr, "extend", TRUE);
#ifdef DURIAN_CAMERA_SWITCH
- kmi= WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_boolean_set(kmi->ptr, "camera", TRUE);
- kmi= WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_boolean_set(kmi->ptr, "camera", TRUE);
#else
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index 5b246e63a20..8286e81b792 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -65,7 +65,7 @@ static int change_frame_poll(bContext *C)
ScrArea *curarea= CTX_wm_area(C);
/* XXX temp? prevent changes during render */
- if(G.rendering) return 0;
+ if (G.rendering) return 0;
/* as long as there is an active area, and it isn't a Graph Editor
* (since the Graph Editor has its own version which does extra stuff),
@@ -161,18 +161,18 @@ static int change_frame_modal(bContext *C, wmOperator *op, wmEvent *event)
static void ANIM_OT_change_frame(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Change frame";
- ot->idname= "ANIM_OT_change_frame";
- ot->description= "Interactively change the current frame number";
+ ot->name = "Change frame";
+ ot->idname = "ANIM_OT_change_frame";
+ ot->description = "Interactively change the current frame number";
/* api callbacks */
- ot->exec= change_frame_exec;
- ot->invoke= change_frame_invoke;
- ot->modal= change_frame_modal;
- ot->poll= change_frame_poll;
+ ot->exec = change_frame_exec;
+ ot->invoke = change_frame_invoke;
+ ot->modal = change_frame_modal;
+ ot->poll = change_frame_poll;
/* flags */
- ot->flag= OPTYPE_BLOCKING|OPTYPE_UNDO;
+ ot->flag = OPTYPE_BLOCKING|OPTYPE_UNDO;
/* rna */
RNA_def_int(ot->srna, "frame", 0, MINAFRAME, MAXFRAME, "Frame", "", MINAFRAME, MAXFRAME);
@@ -216,20 +216,20 @@ static int previewrange_define_exec(bContext *C, wmOperator *op)
static void ANIM_OT_previewrange_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Preview Range";
- ot->idname= "ANIM_OT_previewrange_set";
- ot->description= "Interactively define frame range used for playback";
+ ot->name = "Set Preview Range";
+ ot->idname = "ANIM_OT_previewrange_set";
+ ot->description = "Interactively define frame range used for playback";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= previewrange_define_exec;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = previewrange_define_exec;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= ED_operator_animview_active;
+ ot->poll = ED_operator_animview_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
/* used to define frame range */
@@ -264,17 +264,17 @@ static int previewrange_clear_exec(bContext *C, wmOperator *UNUSED(op))
static void ANIM_OT_previewrange_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Preview Range";
- ot->idname= "ANIM_OT_previewrange_clear";
- ot->description= "Clear Preview Range";
+ ot->name = "Clear Preview Range";
+ ot->idname = "ANIM_OT_previewrange_clear";
+ ot->description = "Clear Preview Range";
/* api callbacks */
- ot->exec= previewrange_clear_exec;
+ ot->exec = previewrange_clear_exec;
- ot->poll= ED_operator_animview_active;
+ ot->poll = ED_operator_animview_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ************************** registration **********************************/
@@ -315,7 +315,7 @@ void ED_operatortypes_anim(void)
void ED_keymap_anim(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "Animation", 0, 0);
+ wmKeyMap *keymap = WM_keymap_find(keyconf, "Animation", 0, 0);
wmKeyMapItem *kmi;
/* frame management */
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index e8f3fc28d74..9c4f96ebe6d 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -84,7 +84,7 @@ FCurve *verify_driver_fcurve (ID *id, const char rna_path[], const int array_ind
FCurve *fcu;
/* sanity checks */
- if ELEM(NULL, id, rna_path)
+ if (ELEM(NULL, id, rna_path))
return NULL;
/* init animdata if none available yet */
@@ -515,16 +515,16 @@ static int add_driver_button_exec (bContext *C, wmOperator *op)
void ANIM_OT_driver_button_add (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Driver";
- ot->idname= "ANIM_OT_driver_button_add";
- ot->description= "Add driver(s) for the property(s) connected represented by the highlighted button";
+ ot->name = "Add Driver";
+ ot->idname = "ANIM_OT_driver_button_add";
+ ot->description = "Add driver(s) for the property(s) connected represented by the highlighted button";
/* callbacks */
- ot->exec= add_driver_button_exec;
- //op->poll= ??? // TODO: need to have some animateable property to do this
+ ot->exec = add_driver_button_exec;
+ //op->poll= ??? // TODO: need to have some animatable property to do this
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "all", 1, "All", "Create drivers for all elements of the array");
@@ -567,16 +567,16 @@ static int remove_driver_button_exec (bContext *C, wmOperator *op)
void ANIM_OT_driver_button_remove (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Driver";
- ot->idname= "ANIM_OT_driver_button_remove";
- ot->description= "Remove the driver(s) for the property(s) connected represented by the highlighted button";
+ ot->name = "Remove Driver";
+ ot->idname = "ANIM_OT_driver_button_remove";
+ ot->description = "Remove the driver(s) for the property(s) connected represented by the highlighted button";
/* callbacks */
- ot->exec= remove_driver_button_exec;
+ ot->exec = remove_driver_button_exec;
//op->poll= ??? // TODO: need to have some driver to be able to do this...
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "all", 1, "All", "Delete drivers for all elements of the array");
@@ -614,16 +614,16 @@ static int copy_driver_button_exec (bContext *C, wmOperator *op)
void ANIM_OT_copy_driver_button (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Driver";
- ot->idname= "ANIM_OT_copy_driver_button";
- ot->description= "Copy the driver for the highlighted button";
+ ot->name = "Copy Driver";
+ ot->idname = "ANIM_OT_copy_driver_button";
+ ot->description = "Copy the driver for the highlighted button";
/* callbacks */
- ot->exec= copy_driver_button_exec;
+ ot->exec = copy_driver_button_exec;
//op->poll= ??? // TODO: need to have some driver to be able to do this...
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* Paste Driver Button Operator ------------------------ */
@@ -658,16 +658,16 @@ static int paste_driver_button_exec (bContext *C, wmOperator *op)
void ANIM_OT_paste_driver_button (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Paste Driver";
- ot->idname= "ANIM_OT_paste_driver_button";
- ot->description= "Paste the driver in the copy/paste buffer for the highlighted button";
+ ot->name = "Paste Driver";
+ ot->idname = "ANIM_OT_paste_driver_button";
+ ot->description = "Paste the driver in the copy/paste buffer for the highlighted button";
/* callbacks */
- ot->exec= paste_driver_button_exec;
+ ot->exec = paste_driver_button_exec;
//op->poll= ??? // TODO: need to have some driver to be able to do this...
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ 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 05f9248e0a6..d5ec98da588 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"
@@ -124,7 +126,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
/* col= uiLayoutColumn(layout, 1); */ /* UNUSED */
block= uiLayoutGetBlock(layout);
uiBlockBeginAlign(block);
- but= uiDefButR(block, MENU, B_FMODIFIER_REDRAW, NULL, 0, 0, width-30, UI_UNIT_Y, &ptr, "mode", -1, 0, 0, -1, -1, NULL);
+ but = uiDefButR(block, MENU, B_FMODIFIER_REDRAW, NULL, 0, 0, width-30, UI_UNIT_Y, &ptr, "mode", -1, 0, 0, -1, -1, NULL);
uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL);
uiDefButR(block, TOG, B_FMODIFIER_REDRAW, NULL, 0, 0, width-30, UI_UNIT_Y, &ptr, "use_additive", -1, 0, 0, -1, -1, NULL);
@@ -141,41 +143,52 @@ 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: /* factorised polynomial expression */
+ case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* Factorized polynomial expression */
{
float *cp = NULL;
unsigned int i;
@@ -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);
}
@@ -312,7 +333,7 @@ static int binarysearch_fcm_envelopedata_index (FCM_EnvelopeData array[], float
int start=0, end=arraylen;
int loopbreaker= 0, maxloop= arraylen * 2;
- /* initialise exists-flag first */
+ /* initialize exists-flag first */
*exists= 0;
/* sneaky optimisations (don't go through searching process if...):
@@ -320,7 +341,7 @@ static int binarysearch_fcm_envelopedata_index (FCM_EnvelopeData array[], float
* - keyframe to be added would replace one of the existing ones on bounds
*/
if ((arraylen <= 0) || (array == NULL)) {
- printf("Warning: binarysearch_fcm_envelopedata_index() encountered invalid array \n");
+ printf("Warning: binarysearch_fcm_envelopedata_index() encountered invalid array\n");
return 0;
}
else {
@@ -370,10 +391,10 @@ static int binarysearch_fcm_envelopedata_index (FCM_EnvelopeData array[], float
/* print error if loop-limit exceeded */
if (loopbreaker == (maxloop-1)) {
- printf("Error: binarysearch_fcm_envelopedata_index() was taking too long \n");
+ printf("Error: binarysearch_fcm_envelopedata_index() was taking too long\n");
// include debug info
- printf("\tround = %d: start = %d, end = %d, arraylen = %d \n", loopbreaker, start, end, arraylen);
+ printf("\tround = %d: start = %d, end = %d, arraylen = %d\n", loopbreaker, start, end, arraylen);
}
/* not found, so return where to place it */
@@ -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 -------------------------------------------------------------- */
@@ -757,7 +784,7 @@ short ANIM_fmodifiers_copy_to_buf (ListBase *modifiers, short active)
short ok = 1;
/* sanity checks */
- if ELEM(NULL, modifiers, modifiers->first)
+ if (ELEM(NULL, modifiers, modifiers->first))
return 0;
/* copy the whole list, or just the active one? */
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index c1e81cd0901..0e0ff0defbb 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -189,7 +189,7 @@ static void nupdate_ak_gpframe (void *node, void *data)
/* Add the given BezTriple to the given 'list' of Keyframes */
static void add_bezt_to_keycolumns_list(DLRBT_Tree *keys, BezTriple *bezt)
{
- if ELEM(NULL, keys, bezt)
+ if (ELEM(NULL, keys, bezt))
return;
else
BLI_dlrbTree_add(keys, compare_ak_bezt, nalloc_ak_bezt, nupdate_ak_bezt, bezt);
@@ -198,7 +198,7 @@ static void add_bezt_to_keycolumns_list(DLRBT_Tree *keys, BezTriple *bezt)
/* Add the given GPencil Frame to the given 'list' of Keyframes */
static void add_gpframe_to_keycolumns_list(DLRBT_Tree *keys, bGPDframe *gpf)
{
- if ELEM(NULL, keys, gpf)
+ if (ELEM(NULL, keys, gpf))
return;
else
BLI_dlrbTree_add(keys, compare_ak_gpframe, nalloc_ak_gpframe, nupdate_ak_gpframe, gpf);
@@ -269,8 +269,8 @@ static void nupdate_abk_bezt (void *node, void *data)
if (abk->numBezts >= MAX_ABK_BUFSIZE) {
// TODO: need to allocate new array to cater...
//bezts_extra= MEM_callocN(...);
- if(G.f & G_DEBUG)
- printf("FIXME: nupdate_abk_bezt() missing case for too many overlapping BezTriples \n");
+ if (G.debug & G_DEBUG)
+ printf("FIXME: nupdate_abk_bezt() missing case for too many overlapping BezTriples\n");
}
else {
/* just store an extra one */
@@ -374,7 +374,7 @@ static void add_bezt_to_keyblocks_list(DLRBT_Tree *blocks, DLRBT_Tree *beztTree,
ActKeyBlock *ab, *abn=NULL;
/* try to find a keyblock that starts on the previous beztriple, and add a new one if none start there
- * Note: we can't search from end to try to optimise this as it causes errors there's
+ * Note: we can't search from end to try to optimize this as it causes errors there's
* an A ___ B |---| B situation
*/
// FIXME: here there is a bug where we are trying to get the summary for the following channels
@@ -499,7 +499,7 @@ void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel
static GLuint displist1=0;
static GLuint displist2=0;
- /* initialise 2 display lists for diamond shape - one empty, one filled */
+ /* initialize 2 display lists for diamond shape - one empty, one filled */
if (displist1 == 0) {
displist1= glGenLists(1);
glNewList(displist1, GL_COMPILE);
@@ -538,7 +538,7 @@ void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel
glEnable(GL_LINE_SMOOTH);
/* draw! */
- if ELEM(mode, KEYFRAME_SHAPE_INSIDE, KEYFRAME_SHAPE_BOTH) {
+ if (ELEM(mode, KEYFRAME_SHAPE_INSIDE, KEYFRAME_SHAPE_BOTH)) {
/* interior - hardcoded colors (for selected and unselected only) */
switch (key_type) {
case BEZT_KEYTYPE_BREAKDOWN: /* bluish frames for now */
@@ -574,7 +574,7 @@ void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel
glCallList(displist2);
}
- if ELEM(mode, KEYFRAME_SHAPE_FRAME, KEYFRAME_SHAPE_BOTH) {
+ if (ELEM(mode, KEYFRAME_SHAPE_FRAME, KEYFRAME_SHAPE_BOTH)) {
/* exterior - black frame */
glColor4f(0.0f, 0.0f, 0.0f, alpha);
@@ -621,7 +621,7 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa
float kalpha = (channelLocked)? 0.35f : 1.0f;
for (ak= keys->first; ak; ak= ak->next) {
- /* optimisation: if keyframe doesn't appear within 5 units (screenspace) in visible area, don't draw
+ /* optimization: if keyframe doesn't appear within 5 units (screenspace) in visible area, don't draw
* - this might give some improvements, since we current have to flip between view/region matrices
*/
if (IN_RANGE_INCL(ak->cfra, v2d->cur.xmin, v2d->cur.xmax) == 0)
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index af78fe739cc..4e59216a39c 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;
}
}
@@ -751,7 +751,6 @@ KeyframeEditFunc ANIM_editkeyframes_mirror(short type)
return mirror_bezier_value;
default: /* just in case */
return mirror_bezier_yaxis;
- break;
}
}
@@ -761,11 +760,13 @@ KeyframeEditFunc ANIM_editkeyframes_mirror(short type)
/* standard validation step for a few of these (implemented as macro for inlining without fn-call overhead):
* "if the handles are not of the same type, set them to type free"
*/
-#define ENSURE_HANDLES_MATCH(bezt) \
- if (bezt->h1 != bezt->h2) { \
- if ELEM3(bezt->h1, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM) bezt->h1= HD_FREE; \
- if ELEM3(bezt->h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM) bezt->h2= HD_FREE; \
- }
+#define ENSURE_HANDLES_MATCH(bezt) \
+ if (bezt->h1 != bezt->h2) { \
+ if (ELEM3(bezt->h1, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) \
+ bezt->h1= HD_FREE; \
+ if (ELEM3(bezt->h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) \
+ bezt->h2= HD_FREE; \
+ }
/* Sets the selected bezier handles to type 'auto' */
static short set_bezier_auto(KeyframeEditData *UNUSED(ked), BezTriple *bezt)
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index 732f84bb33d..831b8d21b01 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -145,7 +145,7 @@ void duplicate_fcurve_keys(FCurve *fcu)
int i;
/* this can only work when there is an F-Curve, and also when there are some BezTriples */
- if ELEM(NULL, fcu, fcu->bezt)
+ if (ELEM(NULL, fcu, fcu->bezt))
return;
for (i=0; i < fcu->totvert; i++) {
@@ -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 */
@@ -853,7 +853,7 @@ short paste_animedit_keys (bAnimContext *ac, ListBase *anim_data,
}
}
- /* dont continue if some fcurves were pasted */
+ /* don't continue if some fcurves were pasted */
if (totmatch)
break;
}
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 5557923c3d6..47972ca2c6f 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;
@@ -131,7 +131,7 @@ bAction *verify_adt_action (ID *id, short add)
adt= BKE_id_add_animdata(id);
if (adt == NULL) {
/* if still none (as not allowed to add, or ID doesn't have animdata for some reason) */
- printf("ERROR: Couldn't add AnimData (ID = %s) \n", (id) ? (id->name) : "<None>");
+ printf("ERROR: Couldn't add AnimData (ID = %s)\n", (id) ? (id->name) : "<None>");
return NULL;
}
@@ -156,7 +156,7 @@ FCurve *verify_fcurve (bAction *act, const char group[], const char rna_path[],
FCurve *fcu;
/* sanity checks */
- if ELEM(NULL, act, rna_path)
+ if (ELEM(NULL, act, rna_path))
return NULL;
/* try to find f-curve matching for this setting
@@ -317,9 +317,9 @@ int insert_vert_fcurve (FCurve *fcu, float x, float y, short flag)
/* use default interpolation mode, with exceptions for int/discrete values */
beztr.ipo= U.ipo_new;
- if(fcu->flag & FCURVE_DISCRETE_VALUES)
+ if (fcu->flag & FCURVE_DISCRETE_VALUES)
beztr.ipo = BEZT_IPO_CONST;
- else if(beztr.ipo == BEZT_IPO_BEZ && (fcu->flag & FCURVE_INT_VALUES))
+ else if (beztr.ipo == BEZT_IPO_BEZ && (fcu->flag & FCURVE_INT_VALUES))
beztr.ipo = BEZT_IPO_LIN;
/* add temp beztriple to keyframes */
@@ -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
*/
@@ -446,7 +446,7 @@ static short new_key_needed (FCurve *fcu, float cFrame, float nValue)
}
else {
/* just add a keyframe if there's only one keyframe
- * and the new one occurs before the exisiting one does.
+ * and the new one occurs before the existing one does.
*/
if ((cFrame < beztPosi) && (totCount==1))
return KEYNEEDED_JUSTADD;
@@ -573,7 +573,7 @@ static short visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
return 0;
/* location or rotation identifiers only... */
- if(identifier == NULL) {
+ if (identifier == NULL) {
printf("%s failed: NULL identifier\n", __func__);
return 0;
}
@@ -584,7 +584,7 @@ static short visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
searchtype= VISUALKEY_ROT;
}
else {
- printf("%s failed: identifier - '%s' \n", __func__, identifier);
+ printf("%s failed: identifier - '%s'\n", __func__, identifier);
return 0;
}
@@ -755,7 +755,7 @@ static float visualkey_get_value (PointerRNA *ptr, PropertyRNA *prop, int array_
* Use this when validation of necessary animation data is not necessary, since an RNA-pointer to the necessary
* data being keyframed, and a pointer to the F-Curve to use have both been provided.
*
- * The flag argument is used for special settings that alter the behaviour of
+ * The flag argument is used for special settings that alter the behavior of
* the keyframe insertion. These include the 'visual' keyframing modes, quick refresh,
* and extra keyframe filtering.
*/
@@ -874,7 +874,7 @@ short insert_keyframe_direct (ReportList *reports, PointerRNA ptr, PropertyRNA *
/* Main Keyframing API call:
* Use this when validation of necessary animation data is necessary, since it may not exist yet.
*
- * The flag argument is used for special settings that alter the behaviour of
+ * The flag argument is used for special settings that alter the behavior of
* the keyframe insertion. These include the 'visual' keyframing modes, quick refresh,
* and extra keyframe filtering.
*
@@ -968,7 +968,7 @@ short insert_keyframe (ReportList *reports, ID *id, bAction *act, const char gro
* Use this when validation of necessary animation data isn't necessary as it
* already exists. It will delete a keyframe at the current frame.
*
- * The flag argument is used for special settings that alter the behaviour of
+ * The flag argument is used for special settings that alter the behavior of
* the keyframe deletion. These include the quick refresh options.
*/
short delete_keyframe (ReportList *reports, ID *id, bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short UNUSED(flag))
@@ -980,7 +980,7 @@ short delete_keyframe (ReportList *reports, ID *id, bAction *act, const char gro
int ret= 0;
/* sanity checks */
- if ELEM(NULL, id, adt) {
+ if (ELEM(NULL, id, adt)) {
BKE_report(reports, RPT_ERROR, "No ID-Block and/Or AnimData to delete keyframe from");
return 0;
}
@@ -1007,7 +1007,7 @@ short delete_keyframe (ReportList *reports, ID *id, bAction *act, const char gro
cfra= BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP);
}
else {
- BKE_reportf(reports, RPT_ERROR, "No Action to delete keyframes from for ID = %s \n", id->name);
+ BKE_reportf(reports, RPT_ERROR, "No Action to delete keyframes from for ID = %s\n", id->name);
return 0;
}
}
@@ -1036,8 +1036,8 @@ short delete_keyframe (ReportList *reports, ID *id, bAction *act, const char gro
continue;
if ( (fcu->flag & FCURVE_PROTECTED) || ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ) {
- if (G.f & G_DEBUG)
- printf("WARNING: not deleting keyframe for locked F-Curve \n");
+ if (G.debug & G_DEBUG)
+ printf("WARNING: not deleting keyframe for locked F-Curve\n");
continue;
}
@@ -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);
@@ -1128,8 +1128,8 @@ static int insert_key_exec (bContext *C, wmOperator *op)
/* try to insert keyframes for the channels specified by KeyingSet */
success= ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_INSERT, cfra);
- if (G.f & G_DEBUG)
- BKE_reportf(op->reports, RPT_INFO, "KeyingSet '%s' - Successfully added %d Keyframes \n", ks->name, success);
+ if (G.debug & G_DEBUG)
+ BKE_reportf(op->reports, RPT_INFO, "KeyingSet '%s' - Successfully added %d Keyframes\n", ks->name, success);
/* report failure or do updates? */
if (success == MODIFYKEY_INVALID_CONTEXT) {
@@ -1158,22 +1158,22 @@ void ANIM_OT_keyframe_insert (wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Insert Keyframe";
- ot->idname= "ANIM_OT_keyframe_insert";
- ot->description= "Insert keyframes on the current frame for all properties in the specified Keying Set";
+ ot->name = "Insert Keyframe";
+ ot->idname = "ANIM_OT_keyframe_insert";
+ ot->description = "Insert keyframes on the current frame for all properties in the specified Keying Set";
/* callbacks */
- ot->exec= insert_key_exec;
- ot->poll= modify_key_op_poll;
+ ot->exec = insert_key_exec;
+ ot->poll = modify_key_op_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* 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);
- ot->prop= prop;
+ ot->prop = prop;
/* confirm whether a keyframe was added by showing a popup
* - by default, this is enabled, since this operator is assumed to be called independently
@@ -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 {
@@ -1212,23 +1219,23 @@ void ANIM_OT_keyframe_insert_menu (wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Insert Keyframe Menu";
- ot->idname= "ANIM_OT_keyframe_insert_menu";
- ot->description= "Insert Keyframes for specified Keying Set, with menu of available Keying Sets if undefined";
+ ot->name = "Insert Keyframe Menu";
+ ot->idname = "ANIM_OT_keyframe_insert_menu";
+ ot->description = "Insert Keyframes for specified Keying Set, with menu of available Keying Sets if undefined";
/* callbacks */
- ot->invoke= insert_key_menu_invoke;
- ot->exec= insert_key_exec;
- ot->poll= ED_operator_areaactive;
+ ot->invoke = insert_key_menu_invoke;
+ ot->exec = insert_key_exec;
+ ot->poll = ED_operator_areaactive;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* 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);
- ot->prop= prop;
+ ot->prop = prop;
/* confirm whether a keyframe was added by showing a popup
* - by default, this is disabled so that if a menu is shown, this doesn't come up too
@@ -1239,8 +1246,8 @@ void ANIM_OT_keyframe_insert_menu (wmOperatorType *ot)
RNA_def_property_flag(prop, PROP_HIDDEN);
/* whether the menu should always be shown
- * - by default, the menu should only be shown when there is no active Keying Set (2.5 behaviour),
- * although in some cases it might be useful to always shown (pre 2.5 behaviour)
+ * - by default, the menu should only be shown when there is no active Keying Set (2.5 behavior),
+ * although in some cases it might be useful to always shown (pre 2.5 behavior)
*/
prop= RNA_def_boolean(ot->srna, "always_prompt", 0, "Always Show Menu", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
@@ -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);
@@ -1277,8 +1284,8 @@ static int delete_key_exec (bContext *C, wmOperator *op)
/* try to delete keyframes for the channels specified by KeyingSet */
success= ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_DELETE, cfra);
- if (G.f & G_DEBUG)
- printf("KeyingSet '%s' - Successfully removed %d Keyframes \n", ks->name, success);
+ if (G.debug & G_DEBUG)
+ printf("KeyingSet '%s' - Successfully removed %d Keyframes\n", ks->name, success);
/* report failure or do updates? */
if (success == MODIFYKEY_INVALID_CONTEXT) {
@@ -1307,22 +1314,22 @@ void ANIM_OT_keyframe_delete (wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Delete Keying-Set Keyframe";
- ot->idname= "ANIM_OT_keyframe_delete";
- ot->description= "Delete keyframes on the current frame for all properties in the specified Keying Set";
+ ot->name = "Delete Keying-Set Keyframe";
+ ot->idname = "ANIM_OT_keyframe_delete";
+ ot->description = "Delete keyframes on the current frame for all properties in the specified Keying Set";
/* callbacks */
- ot->exec= delete_key_exec;
- ot->poll= modify_key_op_poll;
+ ot->exec = delete_key_exec;
+ ot->poll = modify_key_op_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* 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);
- ot->prop= prop;
+ ot->prop = prop;
/* confirm whether a keyframe was added by showing a popup
* - by default, this is enabled, since this operator is assumed to be called independently
@@ -1380,18 +1387,18 @@ static int delete_key_v3d_exec (bContext *C, wmOperator *op)
void ANIM_OT_keyframe_delete_v3d (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Keyframe";
- ot->description= "Remove keyframes on current frame for selected object";
- ot->idname= "ANIM_OT_keyframe_delete_v3d";
+ ot->name = "Delete Keyframe";
+ ot->description = "Remove keyframes on current frame for selected object";
+ ot->idname = "ANIM_OT_keyframe_delete_v3d";
/* callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= delete_key_v3d_exec;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = delete_key_v3d_exec;
- ot->poll= ED_operator_areaactive;
+ ot->poll = ED_operator_areaactive;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -1422,7 +1429,7 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
if (all) {
length= RNA_property_array_length(&ptr, prop);
- if(length) index= 0;
+ if (length) index= 0;
else length= 1;
}
else
@@ -1441,17 +1448,17 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
success+= insert_keyframe_direct(op->reports, ptr, prop, fcu, cfra, 0);
}
else {
- if (G.f & G_DEBUG)
- printf("Button Insert-Key: no path to property \n");
+ if (G.debug & G_DEBUG)
+ printf("Button Insert-Key: no path to property\n");
BKE_report(op->reports, RPT_WARNING, "Failed to resolve path to property. Try using a Keying Set instead");
}
}
- else if (G.f & G_DEBUG) {
+ else if (G.debug & 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) {
@@ -1470,15 +1477,15 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
void ANIM_OT_keyframe_insert_button (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Insert Keyframe (Buttons)";
- ot->idname= "ANIM_OT_keyframe_insert_button";
+ ot->name = "Insert Keyframe (Buttons)";
+ ot->idname = "ANIM_OT_keyframe_insert_button";
/* callbacks */
- ot->exec= insert_key_button_exec;
- ot->poll= modify_key_op_poll;
+ ot->exec = insert_key_button_exec;
+ ot->poll = modify_key_op_poll;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "all", 1, "All", "Insert a keyframe for all element of the array");
@@ -1518,11 +1525,11 @@ static int delete_key_button_exec (bContext *C, wmOperator *op)
MEM_freeN(path);
}
- else if (G.f & G_DEBUG)
- printf("Button Delete-Key: no path to property \n");
+ else if (G.debug & G_DEBUG)
+ printf("Button Delete-Key: no path to property\n");
}
- else if (G.f & G_DEBUG) {
- printf("ptr.data = %p, prop = %p \n", (void *)ptr.data, (void *)prop);
+ else if (G.debug & G_DEBUG) {
+ printf("ptr.data = %p, prop = %p\n", (void *)ptr.data, (void *)prop);
}
@@ -1542,15 +1549,15 @@ static int delete_key_button_exec (bContext *C, wmOperator *op)
void ANIM_OT_keyframe_delete_button (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Keyframe (Buttons)";
- ot->idname= "ANIM_OT_keyframe_delete_button";
+ ot->name = "Delete Keyframe (Buttons)";
+ ot->idname = "ANIM_OT_keyframe_delete_button";
/* callbacks */
- ot->exec= delete_key_button_exec;
- ot->poll= modify_key_op_poll;
+ ot->exec = delete_key_button_exec;
+ ot->poll = modify_key_op_poll;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "all", 1, "All", "Delete keyfames from all elements of the array");
@@ -1711,7 +1718,7 @@ short id_frame_has_keyframe (ID *id, float frame, short filter)
break;
case ID_SCE: /* scene */
- // XXX TODO... for now, just use 'normal' behaviour
+ // XXX TODO... for now, just use 'normal' behavior
// break;
default: /* 'normal type' */
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index 25432260387..f66aa31f3f4 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);
@@ -140,13 +140,13 @@ static int add_default_keyingset_exec (bContext *C, wmOperator *UNUSED(op))
void ANIM_OT_keying_set_add (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Empty Keying Set";
- ot->idname= "ANIM_OT_keying_set_add";
- ot->description= "Add a new (empty) Keying Set to the active Scene";
+ ot->name = "Add Empty Keying Set";
+ ot->idname = "ANIM_OT_keying_set_add";
+ ot->description = "Add a new (empty) Keying Set to the active Scene";
/* callbacks */
- ot->exec= add_default_keyingset_exec;
- ot->poll= keyingset_poll_default_add;
+ ot->exec = add_default_keyingset_exec;
+ ot->poll = keyingset_poll_default_add;
}
/* Remove 'Active' Keying Set ------------------------- */
@@ -187,13 +187,13 @@ static int remove_active_keyingset_exec (bContext *C, wmOperator *op)
void ANIM_OT_keying_set_remove (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Removed Active Keying Set";
- ot->idname= "ANIM_OT_keying_set_remove";
- ot->description= "Remove the active Keying Set";
+ ot->name = "Remove Active Keying Set";
+ ot->idname = "ANIM_OT_keying_set_remove";
+ ot->description = "Remove the active Keying Set";
/* callbacks */
- ot->exec= remove_active_keyingset_exec;
- ot->poll= keyingset_poll_active_edit;
+ ot->exec = remove_active_keyingset_exec;
+ ot->poll = keyingset_poll_active_edit;
}
/* Add Empty Keying Set Path ------------------------- */
@@ -230,13 +230,13 @@ static int add_empty_ks_path_exec (bContext *C, wmOperator *op)
void ANIM_OT_keying_set_path_add (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Empty Keying Set Path";
- ot->idname= "ANIM_OT_keying_set_path_add";
- ot->description= "Add empty path to active Keying Set";
+ ot->name = "Add Empty Keying Set Path";
+ ot->idname = "ANIM_OT_keying_set_path_add";
+ ot->description = "Add empty path to active Keying Set";
/* callbacks */
- ot->exec= add_empty_ks_path_exec;
- ot->poll= keyingset_poll_active_edit;
+ ot->exec = add_empty_ks_path_exec;
+ ot->poll = keyingset_poll_active_edit;
}
/* Remove Active Keying Set Path ------------------------- */
@@ -273,13 +273,13 @@ static int remove_active_ks_path_exec (bContext *C, wmOperator *op)
void ANIM_OT_keying_set_path_remove (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Active Keying Set Path";
- ot->idname= "ANIM_OT_keying_set_path_remove";
- ot->description= "Remove active Path from active Keying Set";
+ ot->name = "Remove Active Keying Set Path";
+ ot->idname = "ANIM_OT_keying_set_path_remove";
+ ot->description = "Remove active Path from active Keying Set";
/* callbacks */
- ot->exec= remove_active_ks_path_exec;
- ot->poll= keyingset_poll_activePath_edit;
+ ot->exec = remove_active_ks_path_exec;
+ ot->poll = keyingset_poll_activePath_edit;
}
/* ************************************************** */
@@ -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);
}
@@ -371,15 +371,15 @@ static int add_keyingset_button_exec (bContext *C, wmOperator *op)
void ANIM_OT_keyingset_button_add (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add to Keying Set";
- ot->idname= "ANIM_OT_keyingset_button_add";
+ ot->name = "Add to Keying Set";
+ ot->idname = "ANIM_OT_keyingset_button_add";
/* callbacks */
- ot->exec= add_keyingset_button_exec;
+ ot->exec = add_keyingset_button_exec;
//op->poll= ???
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "all", 1, "All", "Add all elements of the array to a Keying Set");
@@ -450,15 +450,15 @@ static int remove_keyingset_button_exec (bContext *C, wmOperator *op)
void ANIM_OT_keyingset_button_remove (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove from Keying Set";
- ot->idname= "ANIM_OT_keyingset_button_remove";
+ ot->name = "Remove from Keying Set";
+ ot->idname = "ANIM_OT_keyingset_button_remove";
/* callbacks */
- ot->exec= remove_keyingset_button_exec;
+ ot->exec = remove_keyingset_button_exec;
//op->poll= ???
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************************************* */
@@ -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,22 +496,24 @@ 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";
+ ot->name = "Set Active Keying Set";
+ ot->idname = "ANIM_OT_keying_set_active_set";
/* callbacks */
- ot->invoke= keyingset_active_menu_invoke;
- ot->exec= keyingset_active_menu_exec;
- ot->poll= ED_operator_areaactive;
+ ot->invoke = keyingset_active_menu_invoke;
+ ot->exec = keyingset_active_menu_exec;
+ ot->poll = ED_operator_areaactive;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ 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);
}
@@ -598,7 +607,7 @@ void ANIM_keyingset_info_unregister (Main *bmain, KeyingSetInfo *ksi)
BKE_keyingset_free(ks);
BLI_remlink(&builtin_keyingsets, ks);
- for(scene= bmain->scene.first; scene; scene= scene->id.next)
+ for (scene= bmain->scene.first; scene; scene= scene->id.next)
BLI_remlink_safe(&scene->keyingsets, ks);
MEM_freeN(ks);
@@ -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 */
@@ -839,7 +809,7 @@ typedef struct tRKS_DSource {
} tRKS_DSource;
-/* Iterator used for overriding the behaviour of iterators defined for
+/* Iterator used for overriding the behavior of iterators defined for
* relative Keying Sets, with the main usage of this being operators
* requiring Auto Keyframing. Internal Use Only!
*/
diff --git a/source/blender/editors/armature/CMakeLists.txt b/source/blender/editors/armature/CMakeLists.txt
index 8c1243ee300..2bd9956ef5a 100644
--- a/source/blender/editors/armature/CMakeLists.txt
+++ b/source/blender/editors/armature/CMakeLists.txt
@@ -55,4 +55,8 @@ set(SRC
reeb.h
)
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_editor_armature "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/armature/SConscript b/source/blender/editors/armature/SConscript
index b85a13ced85..e5c96d3530f 100644
--- a/source/blender/editors/armature/SConscript
+++ b/source/blender/editors/armature/SConscript
@@ -8,6 +8,8 @@ incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../render/extern/include ../../bmesh'
incs += ' ../../gpu ../../makesrna #/intern/opennl/extern'
+defs = []
+
if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
@@ -15,4 +17,7 @@ if env['OURPLATFORM'] == 'linux':
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
-env.BlenderLib ( 'bf_editors_armature', sources, Split(incs), [], libtype=['core'], priority=[44] )
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
+env.BlenderLib ( 'bf_editors_armature', sources, Split(incs), defs, libtype=['core'], priority=[44] )
diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c
index 7379a278d01..21b97188522 100644
--- a/source/blender/editors/armature/armature_ops.c
+++ b/source/blender/editors/armature/armature_ops.c
@@ -170,31 +170,31 @@ void ED_operatormacros_armature(void)
wmOperatorType *ot;
wmOperatorTypeMacro *otmacro;
- ot= WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
- if(ot) {
- ot->description= "Make copies of the selected bones within the same armature and move them";
+ ot = WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
+ if (ot) {
+ ot->description = "Make copies of the selected bones within the same armature and move them";
WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_enum_set(otmacro->ptr, "proportional", 0);
}
- ot= WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER);
- if(ot) {
- ot->description= "Create new bones from the selected joints and move them";
+ ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER);
+ if (ot) {
+ ot->description = "Create new bones from the selected joints and move them";
otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
RNA_boolean_set(otmacro->ptr, "forked", FALSE);
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_enum_set(otmacro->ptr, "proportional", 0);
}
// XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate?
// that would require fixing a properties bug 19733
- ot= WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", OPTYPE_UNDO|OPTYPE_REGISTER);
- if(ot) {
- ot->description= "Create new bones from the selected joints and move them";
+ ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", OPTYPE_UNDO|OPTYPE_REGISTER);
+ if (ot) {
+ ot->description = "Create new bones from the selected joints and move them";
otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
RNA_boolean_set(otmacro->ptr, "forked", TRUE);
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_enum_set(otmacro->ptr, "proportional", 0);
}
}
@@ -205,8 +205,8 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
/* Armature ------------------------ */
- keymap= WM_keymap_find(keyconf, "Armature", 0, 0);
- keymap->poll= ED_operator_editarmature;
+ keymap = WM_keymap_find(keyconf, "Armature", 0, 0);
+ keymap->poll = ED_operator_editarmature;
/* Armature -> Etch-A-Ton ------------------------ */
WM_keymap_add_item(keymap, "SKETCH_OT_delete", XKEY, KM_PRESS, 0, 0);
@@ -228,7 +228,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
/* only set in editmode armature, by space_view3d listener */
kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "unselected", FALSE);
- kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "unselected", TRUE);
WM_keymap_add_item(keymap, "ARMATURE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
@@ -247,17 +247,17 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
- kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
- kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
- kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
- kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
@@ -286,10 +286,10 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
/* special transforms: */
/* 1) envelope/b-bone size */
- kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
RNA_enum_set(kmi->ptr, "mode", TFM_BONESIZE);
/* 2) set roll */
- kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", RKEY, KM_PRESS, KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", RKEY, KM_PRESS, KM_CTRL, 0);
RNA_enum_set(kmi->ptr, "mode", TFM_BONE_ROLL);
/* menus */
@@ -297,11 +297,11 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
/* Pose ------------------------ */
/* only set in posemode, by space_view3d listener */
- keymap= WM_keymap_find(keyconf, "Pose", 0, 0);
- keymap->poll= ED_operator_posemode;
+ keymap = WM_keymap_find(keyconf, "Pose", 0, 0);
+ 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);
@@ -327,7 +327,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "flipped", FALSE);
- kmi= WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "flipped", TRUE);
kmi = WM_keymap_add_item(keymap, "POSE_OT_select_all", AKEY, KM_PRESS, 0, 0);
@@ -337,17 +337,17 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "POSE_OT_select_parent", PKEY, KM_PRESS, KM_SHIFT, 0);
- kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
- kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
- kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
- kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
@@ -374,7 +374,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
/* special transforms: */
/* 1) envelope/b-bone size */
- kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
RNA_enum_set(kmi->ptr, "mode", TFM_BONESIZE);
/* keyframes management */
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 59645f10677..a09722f78b6 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -123,18 +123,18 @@ void ED_armature_validate_active(struct bArmature *arm)
{
EditBone *ebone= arm->act_edbone;
- if(ebone) {
- if(ebone->flag & BONE_HIDDEN_A)
+ if (ebone) {
+ if (ebone->flag & BONE_HIDDEN_A)
arm->act_edbone= NULL;
}
}
static void bone_free(bArmature *arm, EditBone *bone)
{
- if(arm->act_edbone==bone)
+ if (arm->act_edbone==bone)
arm->act_edbone= NULL;
- if(bone->prop) {
+ if (bone->prop) {
IDP_FreeProperty(bone->prop);
MEM_freeN(bone->prop);
}
@@ -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 */
@@ -275,16 +275,16 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, EditBone *parent, Bone
else {
/* if the bone is not selected, but connected to its parent
* copy the parents tip selection state */
- if(eBone->parent && (eBone->flag & BONE_CONNECTED)) {
+ if (eBone->parent && (eBone->flag & BONE_CONNECTED)) {
/* selecting with the mouse gives this behavior */
- if(eBone->parent->flag & BONE_TIPSEL) {
+ if (eBone->parent->flag & BONE_TIPSEL) {
eBone->flag |= BONE_ROOTSEL;
}
else {
eBone->flag &= ~BONE_ROOTSEL;
}
- /* probably not selected but just incase */
+ /* probably not selected but just in case */
eBone->flag &= ~BONE_TIPSEL;
}
}
@@ -306,7 +306,7 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, EditBone *parent, Bone
eBone->segments = curBone->segments;
eBone->layer = curBone->layer;
- if(curBone->prop)
+ if (curBone->prop)
eBone->prop= IDP_CopyProperty(curBone->prop);
BLI_addtail(edbo, eBone);
@@ -314,11 +314,11 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, EditBone *parent, Bone
/* Add children if necessary */
if (curBone->childbase.first) {
eBoneTest= make_boneList(edbo, &curBone->childbase, eBone, actBone);
- if(eBoneTest)
+ if (eBoneTest)
eBoneAct= eBoneTest;
}
- if(curBone==actBone)
+ if (curBone==actBone)
eBoneAct= eBone;
}
@@ -395,7 +395,7 @@ void ED_armature_from_edit(Object *obedit)
if (fBone->parent==eBone)
fBone->parent= eBone->parent;
}
- if (G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("Warning: removed zero sized bone: %s\n", eBone->name);
bone_free(arm, eBone);
}
@@ -434,12 +434,12 @@ void ED_armature_from_edit(Object *obedit)
newBone->segments= eBone->segments;
newBone->layer = eBone->layer;
- if(eBone->prop)
+ if (eBone->prop)
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) {
@@ -542,7 +542,7 @@ void docenter_armature (Scene *scene, Object *ob, float cursor[3], int centermod
float cent[3];
/* Put the armature into editmode */
- if(ob != obedit) {
+ if (ob != obedit) {
ED_armature_to_edit(ob);
obedit= NULL; /* we cant use this so behave as if there is no obedit */
}
@@ -554,7 +554,7 @@ void docenter_armature (Scene *scene, Object *ob, float cursor[3], int centermod
mul_m4_v3(ob->imat, cent);
}
else {
- if(around==V3D_CENTROID) {
+ if (around==V3D_CENTROID) {
int total= 0;
zero_v3(cent);
for (ebone= arm->edbo->first; ebone; ebone=ebone->next) {
@@ -582,13 +582,13 @@ void docenter_armature (Scene *scene, Object *ob, float cursor[3], int centermod
}
/* Turn the list into an armature */
- if(obedit==NULL) {
+ if (obedit==NULL) {
ED_armature_from_edit(ob);
ED_armature_edit_free(ob);
}
/* Adjust object location for new centerpoint */
- if(centermode && obedit==NULL) {
+ if (centermode && obedit==NULL) {
mul_mat3_m4_v3(ob->obmat, cent); /* ommit translation part */
add_v3_v3(ob->loc, cent);
}
@@ -729,16 +729,16 @@ static int apply_armature_pose2bones_exec (bContext *C, wmOperator *op)
void POSE_OT_armature_apply (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Apply Pose as Rest Pose";
- ot->idname= "POSE_OT_armature_apply";
- ot->description= "Apply the current pose as the new rest pose";
+ ot->name = "Apply Pose as Rest Pose";
+ ot->idname = "POSE_OT_armature_apply";
+ ot->description = "Apply the current pose as the new rest pose";
/* callbacks */
- ot->exec= apply_armature_pose2bones_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = apply_armature_pose2bones_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -780,16 +780,16 @@ static int pose_visual_transform_apply_exec (bContext *C, wmOperator *UNUSED(op)
void POSE_OT_visual_transform_apply (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Apply Visual Transform to Pose";
- ot->idname= "POSE_OT_visual_transform_apply";
- ot->description= "Apply final constrained position of pose bones to their transform";
+ ot->name = "Apply Visual Transform to Pose";
+ ot->idname = "POSE_OT_visual_transform_apply";
+ ot->description = "Apply final constrained position of pose bones to their transform";
/* callbacks */
- ot->exec= pose_visual_transform_apply_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_visual_transform_apply_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ---------------------- */
@@ -1043,12 +1043,12 @@ static void separated_armature_fix_links(Object *origArm, Object *newArm)
*/
if (ct->subtarget[0] != 0) {
if (ct->tar == origArm) {
- if(BLI_findstring(npchans, ct->subtarget, offsetof(bPoseChannel, name))) {
+ if (BLI_findstring(npchans, ct->subtarget, offsetof(bPoseChannel, name))) {
ct->tar= newArm;
}
}
else if (ct->tar == newArm) {
- if(BLI_findstring(opchans, ct->subtarget, offsetof(bPoseChannel, name))) {
+ if (BLI_findstring(opchans, ct->subtarget, offsetof(bPoseChannel, name))) {
ct->tar= origArm;
}
}
@@ -1079,14 +1079,14 @@ static void separated_armature_fix_links(Object *origArm, Object *newArm)
* - the target isn't origArm/newArm itself
* - the target is one that can be found in newArm/origArm
*/
- if(ct->subtarget[0] != '\0') {
+ if (ct->subtarget[0] != '\0') {
if (ct->tar == origArm) {
- if(BLI_findstring(npchans, ct->subtarget, offsetof(bPoseChannel, name))) {
+ if (BLI_findstring(npchans, ct->subtarget, offsetof(bPoseChannel, name))) {
ct->tar= newArm;
}
}
else if (ct->tar == newArm) {
- if(BLI_findstring(opchans, ct->subtarget, offsetof(bPoseChannel, name))) {
+ if (BLI_findstring(opchans, ct->subtarget, offsetof(bPoseChannel, name))) {
ct->tar= origArm;
}
}
@@ -1104,7 +1104,7 @@ static void separated_armature_fix_links(Object *origArm, Object *newArm)
if (ob->parent && (ob->parent == origArm)) {
/* Is object parented to a bone of this src armature? */
if ((ob->partype == PARBONE) && (ob->parsubstr[0] != '\0')) {
- if(BLI_findstring(npchans, ob->parsubstr, offsetof(bPoseChannel, name))) {
+ if (BLI_findstring(npchans, ob->parsubstr, offsetof(bPoseChannel, name))) {
ob->parent= newArm;
}
}
@@ -1243,17 +1243,17 @@ static int separate_armature_exec (bContext *C, wmOperator *UNUSED(op))
void ARMATURE_OT_separate (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Separate Bones";
- ot->idname= "ARMATURE_OT_separate";
- ot->description= "Isolate selected bones into a separate armature";
+ ot->name = "Separate Bones";
+ ot->idname = "ARMATURE_OT_separate";
+ ot->description = "Isolate selected bones into a separate armature";
/* callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= separate_armature_exec;
- ot->poll= ED_operator_editarmature;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = separate_armature_exec;
+ ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* **************** END tools on Editmode Armature **************** */
@@ -1263,7 +1263,7 @@ void ARMATURE_OT_separate (wmOperatorType *ot)
Bone *get_indexed_bone (Object *ob, int index)
{
bPoseChannel *pchan;
- if(ob->pose==NULL) return NULL;
+ if (ob->pose==NULL) return NULL;
index>>=16; // bone selection codes use left 2 bytes
pchan= BLI_findlink(&ob->pose->chanbase, index);
@@ -1281,17 +1281,17 @@ static void *get_bone_from_selectbuffer(Scene *scene, Base *base, unsigned int *
unsigned int hitresult;
short i, takeNext=0, sel;
- for (i=0; i< hits; i++){
+ for (i=0; i< hits; i++) {
hitresult = buffer[3+(i*4)];
if (!(hitresult & BONESEL_NOSEL)) { // -1
- if(hitresult & BONESEL_ANY) { // to avoid including objects in selection
+ if (hitresult & BONESEL_ANY) { // to avoid including objects in selection
hitresult &= ~(BONESEL_ANY);
/* Determine what the current bone is */
if (obedit==NULL || base->object!=obedit) {
/* no singular posemode, so check for correct object */
- if(base->selcol == (hitresult & 0xFFFF)) {
+ if (base->selcol == (hitresult & 0xFFFF)) {
bone = get_indexed_bone(base->object, hitresult);
if (findunsel)
@@ -1306,7 +1306,7 @@ static void *get_bone_from_selectbuffer(Scene *scene, Base *base, unsigned int *
sel= 0;
}
}
- else{
+ else {
bArmature *arm= obedit->data;
ebone = BLI_findlink(arm->edbo, hitresult);
@@ -1318,9 +1318,9 @@ static void *get_bone_from_selectbuffer(Scene *scene, Base *base, unsigned int *
data = ebone;
}
- if(data) {
+ if (data) {
if (sel) {
- if(!firstSel) firstSel= data;
+ if (!firstSel) firstSel= data;
takeNext=1;
}
else {
@@ -1354,9 +1354,9 @@ static void *get_nearest_bone (bContext *C, short findunsel, int x, int y)
view3d_set_viewcontext(C, &vc);
- // rect.xmin= ... mouseco!
- rect.xmin= rect.xmax= x;
- rect.ymin= rect.ymax= y;
+ // rect.xmin = ... mouseco!
+ rect.xmin = rect.xmax = x;
+ rect.ymin = rect.ymax = y;
glInitNames();
hits= view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect);
@@ -1430,7 +1430,7 @@ static int pose_select_connected_invoke(bContext *C, wmOperator *op, wmEvent *ev
return OPERATOR_CANCELLED;
/* Select parents */
- for (curBone=bone; curBone; curBone=next){
+ for (curBone=bone; curBone; curBone=next) {
/* ignore bone if cannot be selected */
if ((curBone->flag & BONE_UNSELECTABLE) == 0) {
// XXX old cruft! use notifiers instead
@@ -1467,17 +1467,17 @@ static int pose_select_linked_poll(bContext *C)
void POSE_OT_select_linked(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Connected";
- ot->idname= "POSE_OT_select_linked";
- ot->description= "Select bones related to selected ones by parent/child relationships";
+ ot->name = "Select Connected";
+ ot->idname = "POSE_OT_select_linked";
+ ot->description = "Select bones related to selected ones by parent/child relationships";
/* api callbacks */
- ot->exec= NULL;
- ot->invoke= pose_select_connected_invoke;
- ot->poll= pose_select_linked_poll;
+ ot->exec = NULL;
+ ot->invoke = pose_select_connected_invoke;
+ ot->poll = pose_select_linked_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
@@ -1512,7 +1512,7 @@ static int armature_select_linked_invoke(bContext *C, wmOperator *op, wmEvent *e
if (extend) {
curBone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
}
- else{
+ else {
curBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
}
}
@@ -1561,17 +1561,17 @@ static int armature_select_linked_poll(bContext *C)
void ARMATURE_OT_select_linked(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Connected";
- ot->idname= "ARMATURE_OT_select_linked";
- ot->description= "Select bones related to selected ones by parent/child relationships";
+ ot->name = "Select Connected";
+ ot->idname = "ARMATURE_OT_select_linked";
+ ot->description = "Select bones related to selected ones by parent/child relationships";
/* api callbacks */
- ot->exec= NULL;
- ot->invoke= armature_select_linked_invoke;
- ot->poll= armature_select_linked_poll;
+ ot->exec = NULL;
+ ot->invoke = armature_select_linked_invoke;
+ ot->poll = armature_select_linked_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties s*/
RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
@@ -1590,23 +1590,23 @@ static EditBone *get_nearest_editbonepoint (ViewContext *vc, const int mval[2],
glInitNames();
- rect.xmin= mval[0]-5;
- rect.xmax= mval[0]+5;
- rect.ymin= mval[1]-5;
- rect.ymax= mval[1]+5;
+ rect.xmin = mval[0]-5;
+ rect.xmax = mval[0]+5;
+ rect.ymin = mval[1]-5;
+ rect.ymax = mval[1]+5;
hits= view3d_opengl_select(vc, buffer, MAXPICKBUF, &rect);
- if(hits==0) {
- rect.xmin= mval[0]-12;
- rect.xmax= mval[0]+12;
- rect.ymin= mval[1]-12;
- rect.ymax= mval[1]+12;
+ if (hits==0) {
+ rect.xmin = mval[0]-12;
+ rect.xmax = mval[0]+12;
+ rect.ymin = mval[1]-12;
+ rect.ymax = mval[1]+12;
hits= view3d_opengl_select(vc, buffer, MAXPICKBUF, &rect);
}
/* See if there are any selected bones in this group */
if (hits>0) {
- if(hits==1) {
+ if (hits==1) {
if (!(buffer[3] & BONESEL_NOSEL))
besthitresult= buffer[3];
}
@@ -1619,12 +1619,12 @@ static EditBone *get_nearest_editbonepoint (ViewContext *vc, const int mval[2],
ebone = BLI_findlink(edbo, hitresult & ~BONESEL_ANY);
/* clicks on bone points get advantage */
- if( hitresult & (BONESEL_ROOT|BONESEL_TIP)) {
+ if ( hitresult & (BONESEL_ROOT|BONESEL_TIP)) {
/* but also the unselected one */
- if(findunsel) {
- if( (hitresult & BONESEL_ROOT) && (ebone->flag & BONE_ROOTSEL)==0)
+ if (findunsel) {
+ if ( (hitresult & BONESEL_ROOT) && (ebone->flag & BONE_ROOTSEL)==0)
dep= 1;
- else if( (hitresult & BONESEL_TIP) && (ebone->flag & BONE_TIPSEL)==0)
+ else if ( (hitresult & BONESEL_TIP) && (ebone->flag & BONE_TIPSEL)==0)
dep= 1;
else
dep= 2;
@@ -1633,15 +1633,15 @@ static EditBone *get_nearest_editbonepoint (ViewContext *vc, const int mval[2],
}
else {
/* bone found */
- if(findunsel) {
- if((ebone->flag & BONE_SELECTED)==0)
+ if (findunsel) {
+ if ((ebone->flag & BONE_SELECTED)==0)
dep= 2;
else
dep= 3;
}
else dep= 3;
}
- if(dep < mindep) {
+ if (dep < mindep) {
mindep= dep;
besthitresult= hitresult;
}
@@ -1729,7 +1729,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *UNUSED(op))
ebone_next= curBone->next;
if (arm->layer & curBone->layer) {
if (curBone->flag & BONE_SELECTED) {
- if(curBone==arm->act_edbone) arm->act_edbone= NULL;
+ if (curBone==arm->act_edbone) arm->act_edbone= NULL;
ED_armature_edit_bone_remove(arm, curBone);
}
}
@@ -1746,9 +1746,9 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *UNUSED(op))
void ARMATURE_OT_delete(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Selected Bone(s)";
- ot->idname= "ARMATURE_OT_delete";
- ot->description= "Remove selected bones from the armature";
+ ot->name = "Delete Selected Bone(s)";
+ ot->idname = "ARMATURE_OT_delete";
+ ot->description = "Remove selected bones from the armature";
/* api callbacks */
ot->invoke = WM_operator_confirm;
@@ -1756,7 +1756,7 @@ void ARMATURE_OT_delete(wmOperatorType *ot)
ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* toggle==0: deselect
@@ -1769,12 +1769,12 @@ void ED_armature_deselect_all(Object *obedit, int toggle)
EditBone *eBone;
int sel=1;
- if(toggle==1) {
- /* 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)){
+ if (toggle==1) {
+ /* 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)) {
sel=0;
break;
}
@@ -1787,24 +1787,24 @@ void ED_armature_deselect_all(Object *obedit, int toggle)
for (eBone=arm->edbo->first;eBone;eBone=eBone->next) {
if (sel==2) {
/* invert selection of bone */
- if(EBONE_VISIBLE(arm, eBone)) {
+ if (EBONE_VISIBLE(arm, eBone)) {
eBone->flag ^= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
- if(arm->act_edbone==eBone)
+ if (arm->act_edbone==eBone)
arm->act_edbone= NULL;
}
}
else if (sel==1) {
/* select bone */
- if(EBONE_VISIBLE(arm, eBone)) {
+ if (EBONE_VISIBLE(arm, eBone)) {
eBone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
- if(eBone->parent)
+ if (eBone->parent)
eBone->parent->flag |= (BONE_TIPSEL);
}
}
else {
/* deselect bone */
eBone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
- if(arm->act_edbone==eBone)
+ if (arm->act_edbone==eBone)
arm->act_edbone= NULL;
}
}
@@ -1830,7 +1830,7 @@ void ED_armature_deselect_all_visible(Object *obedit)
/* accounts for connected parents */
static int ebone_select_flag(EditBone *ebone)
{
- if(ebone->parent && (ebone->flag & BONE_CONNECTED)) {
+ if (ebone->parent && (ebone->flag & BONE_CONNECTED)) {
return ((ebone->parent->flag & BONE_TIPSEL) ? BONE_ROOTSEL : 0) | (ebone->flag & (BONE_SELECTED|BONE_TIPSEL));
}
else {
@@ -1858,18 +1858,18 @@ 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)) {
+ if (selmask & BONE_SELECTED) {
+ if (nearBone->parent && (nearBone->flag & BONE_CONNECTED)) {
/* click in a chain */
- if(extend) {
+ if (extend) {
/* hold shift inverts this bone's selection */
- if(nearBone->flag & BONE_SELECTED) {
+ if (nearBone->flag & BONE_SELECTED) {
/* deselect this bone */
nearBone->flag &= ~(BONE_TIPSEL|BONE_SELECTED);
/* only deselect parent tip if it is not selected */
- if(!(nearBone->parent->flag & BONE_SELECTED))
+ if (!(nearBone->parent->flag & BONE_SELECTED))
nearBone->parent->flag &= ~BONE_TIPSEL;
}
else {
@@ -1885,9 +1885,9 @@ int mouse_armature(bContext *C, const int mval[2], int extend)
}
}
else {
- if(extend) {
+ if (extend) {
/* hold shift inverts this bone's selection */
- if(nearBone->flag & BONE_SELECTED)
+ if (nearBone->flag & BONE_SELECTED)
nearBone->flag &= ~(BONE_TIPSEL|BONE_ROOTSEL);
else
nearBone->flag |= (BONE_TIPSEL|BONE_ROOTSEL);
@@ -1904,9 +1904,9 @@ int mouse_armature(bContext *C, const int mval[2], int extend)
ED_armature_sync_selection(arm->edbo);
- if(nearBone) {
+ if (nearBone) {
/* then now check for active status */
- if(ebone_select_flag(nearBone)) {
+ if (ebone_select_flag(nearBone)) {
arm->act_edbone= nearBone;
}
}
@@ -1965,16 +1965,16 @@ float ED_rollBoneToVector(EditBone *bone, const float align_axis[3], const short
sub_v3_v3v3(nor, bone->tail, bone->head);
vec_roll_to_mat3(nor, 0.0f, mat);
- /* check the bone isnt aligned with the axis */
- if(!is_zero_v3(align_axis) && angle_v3v3(align_axis, mat[2]) > FLT_EPSILON) {
+ /* check the bone isn't aligned with the axis */
+ if (!is_zero_v3(align_axis) && angle_v3v3(align_axis, mat[2]) > FLT_EPSILON) {
float vec[3], align_axis_proj[3], roll;
/* project the new_up_axis along the normal */
project_v3_v3v3(vec, align_axis, nor);
sub_v3_v3v3(align_axis_proj, align_axis, vec);
- if(axis_only) {
- if(angle_v3v3(align_axis_proj, mat[2]) > (float)(M_PI/2.0)) {
+ if (axis_only) {
+ if (angle_v3v3(align_axis_proj, mat[2]) > (float)(M_PI/2.0)) {
negate_v3(align_axis_proj);
}
}
@@ -2020,7 +2020,7 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
copy_m3_m4(imat, ob->obmat);
invert_m3(imat);
- if(type==7) { /* Cursor */
+ if (type==7) { /* Cursor */
Scene *scene= CTX_data_scene(C);
View3D *v3d= CTX_wm_view3d(C); /* can be NULL */
float cursor_local[3];
@@ -2031,20 +2031,20 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
mul_m3_v3(imat, cursor_local);
/* cursor */
- for(ebone= arm->edbo->first; ebone; ebone= ebone->next) {
- if(EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) {
+ for (ebone= arm->edbo->first; ebone; ebone= ebone->next) {
+ if (EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) {
float cursor_rel[3];
sub_v3_v3v3(cursor_rel, cursor_local, ebone->head);
- if(axis_flip) negate_v3(cursor_rel);
+ if (axis_flip) negate_v3(cursor_rel);
ebone->roll= ED_rollBoneToVector(ebone, cursor_rel, axis_only);
}
}
}
else {
float vec[3]= {0.0f, 0.0f, 0.0f};
- if(type==6) { /* View */
+ if (type==6) { /* View */
RegionView3D *rv3d= CTX_wm_region_view3d(C);
- if(rv3d==NULL) {
+ if (rv3d==NULL) {
BKE_report(op->reports, RPT_ERROR, "No region view3d available");
return OPERATOR_CANCELLED;
}
@@ -2055,7 +2055,7 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
else if (type==5) {
float mat[3][3], nor[3];
ebone= (EditBone *)arm->act_edbone;
- if(ebone==NULL) {
+ if (ebone==NULL) {
BKE_report(op->reports, RPT_ERROR, "No active bone set");
return OPERATOR_CANCELLED;
}
@@ -2066,15 +2066,15 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
}
else { /* Axis */
assert(type >= 0 && type <= 5);
- if(type<3) vec[type]= 1.0f;
+ if (type<3) vec[type]= 1.0f;
else vec[type-2]= -1.0f;
mul_m3_v3(imat, vec);
}
- if(axis_flip) negate_v3(vec);
+ if (axis_flip) negate_v3(vec);
- for(ebone= arm->edbo->first; ebone; ebone= ebone->next) {
- if(EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) {
+ for (ebone= arm->edbo->first; ebone; ebone= ebone->next) {
+ if (EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) {
/* roll func is a callback which assumes that all is well */
ebone->roll= ED_rollBoneToVector(ebone, vec, axis_only);
}
@@ -2082,8 +2082,8 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
}
if (arm->flag & ARM_MIRROR_EDIT) {
- for(ebone= arm->edbo->first; ebone; ebone= ebone->next) {
- if((EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) == 0) {
+ for (ebone= arm->edbo->first; ebone; ebone= ebone->next) {
+ if ((EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) == 0) {
EditBone *ebone_mirr= ED_armature_bone_get_mirrored(arm->edbo, ebone);
if (ebone_mirr && (EBONE_VISIBLE(arm, ebone_mirr) && EBONE_EDITABLE(ebone_mirr))) {
ebone->roll= -ebone_mirr->roll;
@@ -2101,9 +2101,9 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
void ARMATURE_OT_calculate_roll(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Recalculate Roll";
- ot->idname= "ARMATURE_OT_calculate_roll";
- ot->description= "Automatically fix alignment of select bones' axes";
+ ot->name = "Recalculate Roll";
+ ot->idname = "ARMATURE_OT_calculate_roll";
+ ot->description = "Automatically fix alignment of select bones' axes";
/* api callbacks */
ot->invoke = WM_menu_invoke;
@@ -2111,10 +2111,10 @@ void ARMATURE_OT_calculate_roll(wmOperatorType *ot)
ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_calc_roll_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_calc_roll_types, 0, "Type", "");
RNA_def_boolean(ot->srna, "axis_flip", 0, "Flip Axis", "Negate the alignment axis");
RNA_def_boolean(ot->srna, "axis_only", 0, "Shortest Rotation", "Ignore the axis direction, use the shortest rotation to align");
}
@@ -2135,14 +2135,14 @@ static void undoBones_to_editBones(void *uarmv, void *armv, void *UNUSED(data))
BLI_freelistN(arm->edbo);
/* copy */
- for(ebo= uarm->lb.first; ebo; ebo= ebo->next) {
+ for (ebo= uarm->lb.first; ebo; ebo= ebo->next) {
newebo= MEM_dupallocN(ebo);
ebo->temp= newebo;
BLI_addtail(arm->edbo, newebo);
}
/* active bone */
- if(uarm->act_edbone) {
+ if (uarm->act_edbone) {
ebo= uarm->act_edbone;
arm->act_edbone= ebo->temp;
}
@@ -2150,11 +2150,11 @@ static void undoBones_to_editBones(void *uarmv, void *armv, void *UNUSED(data))
arm->act_edbone= NULL;
/* set pointers */
- for(newebo= arm->edbo->first; newebo; newebo= newebo->next) {
- if(newebo->parent) newebo->parent= newebo->parent->temp;
+ for (newebo= arm->edbo->first; newebo; newebo= newebo->next) {
+ if (newebo->parent) newebo->parent= newebo->parent->temp;
}
- /* be sure they dont hang ever */
- for(newebo= arm->edbo->first; newebo; newebo= newebo->next) {
+ /* be sure they don't hang ever */
+ for (newebo= arm->edbo->first; newebo; newebo= newebo->next) {
newebo->temp= NULL;
}
}
@@ -2168,21 +2168,21 @@ static void *editBones_to_undoBones(void *armv, void *UNUSED(obdata))
uarm= MEM_callocN(sizeof(UndoArmature), "listbase undo");
/* copy */
- for(ebo= arm->edbo->first; ebo; ebo= ebo->next) {
+ for (ebo= arm->edbo->first; ebo; ebo= ebo->next) {
newebo= MEM_dupallocN(ebo);
ebo->temp= newebo;
BLI_addtail(&uarm->lb, newebo);
}
/* active bone */
- if(arm->act_edbone) {
+ if (arm->act_edbone) {
ebo= arm->act_edbone;
uarm->act_edbone= ebo->temp;
}
/* set pointers */
- for(newebo= uarm->lb.first; newebo; newebo= newebo->next) {
- if(newebo->parent) newebo->parent= newebo->parent->temp;
+ for (newebo= uarm->lb.first; newebo; newebo= newebo->next) {
+ if (newebo->parent) newebo->parent= newebo->parent->temp;
}
return uarm;
@@ -2199,7 +2199,7 @@ static void free_undoBones(void *uarmv)
static void *get_armature_edit(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
- if(obedit && obedit->type==OB_ARMATURE) {
+ if (obedit && obedit->type==OB_ARMATURE) {
return obedit->data;
}
return NULL;
@@ -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;
@@ -2408,9 +2408,9 @@ static int armature_click_extrude_invoke(bContext *C, wmOperator *op, wmEvent *e
void ARMATURE_OT_click_extrude(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Click-Extrude";
- ot->idname= "ARMATURE_OT_click_extrude";
- ot->description= "Create a new bone going from the last selected joint to the mouse position";
+ ot->name = "Click-Extrude";
+ ot->idname = "ARMATURE_OT_click_extrude";
+ ot->description = "Create a new bone going from the last selected joint to the mouse position";
/* api callbacks */
ot->invoke = armature_click_extrude_invoke;
@@ -2418,7 +2418,7 @@ void ARMATURE_OT_click_extrude(wmOperatorType *ot)
ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
}
@@ -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));
}
@@ -2542,7 +2541,7 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase
BLI_addtail(editbones, eBone);
/* copy the ID property */
- if(curBone->prop)
+ if (curBone->prop)
eBone->prop= IDP_CopyProperty(curBone->prop);
/* Lets duplicate the list of constraints that the
@@ -2558,7 +2557,7 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase
*/
channew= verify_pose_channel(dst_ob->pose, eBone->name);
- if(channew) {
+ if (channew) {
duplicate_pose_channel_data(channew, chanold);
}
}
@@ -2654,9 +2653,9 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *UNUSED(op))
}
/* correct the active bone */
- if(arm->act_edbone) {
+ if (arm->act_edbone) {
eBone= arm->act_edbone;
- if(eBone->temp)
+ if (eBone->temp)
arm->act_edbone= eBone->temp;
}
@@ -2677,16 +2676,16 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *UNUSED(op))
void ARMATURE_OT_duplicate(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Duplicate Selected Bone(s)";
- ot->idname= "ARMATURE_OT_duplicate";
- ot->description= "Make copies of the selected bones within the same armature";
+ ot->name = "Duplicate Selected Bone(s)";
+ ot->idname = "ARMATURE_OT_duplicate";
+ ot->description = "Make copies of the selected bones within the same armature";
/* api callbacks */
ot->exec = armature_duplicate_selected_exec;
ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -2934,7 +2933,7 @@ static int armature_fill_bones_exec (bContext *C, wmOperator *op)
}
else {
// FIXME.. figure out a method for multiple bones
- BKE_reportf(op->reports, RPT_ERROR, "Too many points selected: %d \n", count);
+ BKE_reportf(op->reports, RPT_ERROR, "Too many points selected: %d\n", count);
BLI_freelistN(&points);
return OPERATOR_CANCELLED;
}
@@ -2951,16 +2950,16 @@ static int armature_fill_bones_exec (bContext *C, wmOperator *op)
void ARMATURE_OT_fill (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Fill Between Joints";
- ot->idname= "ARMATURE_OT_fill";
- ot->description= "Add bone between selected joint(s) and/or 3D-Cursor";
+ ot->name = "Fill Between Joints";
+ ot->idname = "ARMATURE_OT_fill";
+ ot->description = "Add bone between selected joint(s) and/or 3D-Cursor";
/* callbacks */
- ot->exec= armature_fill_bones_exec;
- ot->poll= ED_operator_editarmature;
+ ot->exec = armature_fill_bones_exec;
+ ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* --------------------- */
@@ -2977,9 +2976,9 @@ static void bones_merge(Object *obedit, EditBone *start, EditBone *end, EditBone
/* check if same bone */
if (start == end) {
- if (G.f & G_DEBUG) {
- printf("Error: same bone! \n");
- printf("\tstart = %s, end = %s \n", start->name, end->name);
+ if (G.debug & G_DEBUG) {
+ printf("Error: same bone!\n");
+ printf("\tstart = %s, end = %s\n", start->name, end->name);
}
}
@@ -3056,7 +3055,7 @@ static int armature_merge_exec (bContext *C, wmOperator *op)
short type= RNA_enum_get(op->ptr, "type");
/* sanity checks */
- if ELEM(NULL, obedit, arm)
+ if (ELEM(NULL, obedit, arm))
return OPERATOR_CANCELLED;
/* for now, there's only really one type of merging that's performed... */
@@ -3135,20 +3134,20 @@ void ARMATURE_OT_merge (wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Merge Bones";
- ot->idname= "ARMATURE_OT_merge";
- ot->description= "Merge continuous chains of selected bones";
+ ot->name = "Merge Bones";
+ ot->idname = "ARMATURE_OT_merge";
+ ot->description = "Merge continuous chains of selected bones";
/* callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= armature_merge_exec;
- ot->poll= ED_operator_editarmature;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = armature_merge_exec;
+ ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", merge_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", merge_types, 0, "Type", "");
}
/* ************** END Add/Remove stuff in editmode ************ */
@@ -3184,16 +3183,16 @@ static int armature_hide_exec(bContext *C, wmOperator *op)
void ARMATURE_OT_hide(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Hide Selected Bones";
- ot->idname= "ARMATURE_OT_hide";
- ot->description= "Tag selected bones to not be visible in Edit Mode";
+ ot->name = "Hide Selected Bones";
+ ot->idname = "ARMATURE_OT_hide";
+ ot->description = "Tag selected bones to not be visible in Edit Mode";
/* api callbacks */
- ot->exec= armature_hide_exec;
- ot->poll= ED_operator_editarmature;
+ ot->exec = armature_hide_exec;
+ ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected");
@@ -3206,7 +3205,7 @@ static int armature_reveal_exec(bContext *C, wmOperator *UNUSED(op))
EditBone *ebone;
for (ebone = arm->edbo->first; ebone; ebone=ebone->next) {
- if(arm->layer & ebone->layer) {
+ if (arm->layer & ebone->layer) {
if (ebone->flag & BONE_HIDDEN_A) {
ebone->flag |= (BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL);
ebone->flag &= ~BONE_HIDDEN_A;
@@ -3224,16 +3223,16 @@ static int armature_reveal_exec(bContext *C, wmOperator *UNUSED(op))
void ARMATURE_OT_reveal(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reveal Bones";
- ot->idname= "ARMATURE_OT_reveal";
- ot->description= "Unhide all bones that have been tagged to be hidden in Edit Mode";
+ ot->name = "Reveal Bones";
+ ot->idname = "ARMATURE_OT_reveal";
+ ot->description = "Unhide all bones that have been tagged to be hidden in Edit Mode";
/* api callbacks */
- ot->exec= armature_reveal_exec;
- ot->poll= ED_operator_editarmature;
+ ot->exec = armature_reveal_exec;
+ ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
#if 0 // remove this?
@@ -3282,7 +3281,7 @@ void show_all_armature_bones(Scene *scene)
EditBone *ebone;
for (ebone = arm->edbo->first; ebone; ebone=ebone->next) {
- if(arm->layer & ebone->layer) {
+ if (arm->layer & ebone->layer) {
if (ebone->flag & BONE_HIDDEN_A) {
ebone->flag |= (BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL);
ebone->flag &= ~BONE_HIDDEN_A;
@@ -3387,7 +3386,7 @@ static int armature_extrude_exec(bContext *C, wmOperator *op)
newbone->zwidth= ebone->zwidth;
newbone->ease1= ebone->ease1;
newbone->ease2= ebone->ease2;
- newbone->rad_head= ebone->rad_tail; // dont copy entire bone...
+ newbone->rad_head= ebone->rad_tail; // don't copy entire bone...
newbone->rad_tail= ebone->rad_tail;
newbone->segments= 1;
newbone->layer= ebone->layer;
@@ -3433,16 +3432,16 @@ static int armature_extrude_exec(bContext *C, wmOperator *op)
void ARMATURE_OT_extrude(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Extrude";
- ot->idname= "ARMATURE_OT_extrude";
- ot->description= "Create new bones from the selected joints";
+ ot->name = "Extrude";
+ ot->idname = "ARMATURE_OT_extrude";
+ ot->description = "Create new bones from the selected joints";
/* api callbacks */
- ot->exec= armature_extrude_exec;
- ot->poll= ED_operator_editarmature;
+ ot->exec = armature_extrude_exec;
+ ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
RNA_def_boolean(ot->srna, "forked", 0, "Forked", "");
@@ -3482,7 +3481,7 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op)
copy_v3_v3(bone->head, curs);
- if(rv3d && (U.flag & USER_ADD_VIEWALIGNED))
+ if (rv3d && (U.flag & USER_ADD_VIEWALIGNED))
add_v3_v3v3(bone->tail, bone->head, imat[1]); // bone with unit length 1
else
add_v3_v3v3(bone->tail, bone->head, imat[2]); // bone with unit length 1, pointing up Z
@@ -3496,16 +3495,16 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op)
void ARMATURE_OT_bone_primitive_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Bone";
- ot->idname= "ARMATURE_OT_bone_primitive_add";
- ot->description= "Add a new bone located at the 3D-Cursor";
+ ot->name = "Add Bone";
+ ot->idname = "ARMATURE_OT_bone_primitive_add";
+ ot->description = "Add a new bone located at the 3D-Cursor";
/* api callbacks */
ot->exec = armature_bone_primitive_add_exec;
ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_string(ot->srna, "name", "Bone", MAXBONENAME, "Name", "Name of the newly created bone");
@@ -3585,27 +3584,31 @@ static int armature_subdivide_exec(bContext *C, wmOperator *op)
void ARMATURE_OT_subdivide(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
- ot->name= "Subdivide Multi";
- ot->idname= "ARMATURE_OT_subdivide";
- ot->description= "Break selected bones into chains of smaller bones";
+ ot->name = "Subdivide Multi";
+ ot->idname = "ARMATURE_OT_subdivide";
+ ot->description = "Break selected bones into chains of smaller bones";
/* api callbacks */
ot->exec = armature_subdivide_exec;
ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* Properties */
- RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of Cuts", "", 1, 10);
+ prop = RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of Cuts", "", 1, 10);
+ /* avoid re-using last var because it can cause _very_ high poly meshes and annoy users (or worse crash) */
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
/* ----------- */
/* 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.
*/
@@ -3688,16 +3691,16 @@ static int armature_switch_direction_exec(bContext *C, wmOperator *UNUSED(op))
void ARMATURE_OT_switch_direction(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Switch Direction";
- ot->idname= "ARMATURE_OT_switch_direction";
- ot->description= "Change the direction that a chain of bones points in (head <-> tail swap)";
+ ot->name = "Switch Direction";
+ ot->idname = "ARMATURE_OT_switch_direction";
+ ot->description = "Change the direction that a chain of bones points in (head <-> tail swap)";
/* api callbacks */
ot->exec = armature_switch_direction_exec;
ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ***************** Parenting *********************** */
@@ -3783,10 +3786,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 +3815,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
*/
@@ -3863,9 +3866,9 @@ static int armature_parent_set_invoke(bContext *C, wmOperator *UNUSED(op), wmEve
void ARMATURE_OT_parent_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Make Parent";
- ot->idname= "ARMATURE_OT_parent_set";
- ot->description= "Set the active bone as the parent of the selected bones";
+ ot->name = "Make Parent";
+ ot->idname = "ARMATURE_OT_parent_set";
+ ot->description = "Set the active bone as the parent of the selected bones";
/* api callbacks */
ot->invoke = armature_parent_set_invoke;
@@ -3873,7 +3876,7 @@ void ARMATURE_OT_parent_set(wmOperatorType *ot)
ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "type", prop_editarm_make_parent_types, 0, "ParentType", "Type of parenting");
}
@@ -3917,9 +3920,9 @@ static int armature_parent_clear_exec(bContext *C, wmOperator *op)
void ARMATURE_OT_parent_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Parent";
- ot->idname= "ARMATURE_OT_parent_clear";
- ot->description= "Remove the parent-child relationship between selected bones and their parents";
+ ot->name = "Clear Parent";
+ ot->idname = "ARMATURE_OT_parent_clear";
+ ot->description = "Remove the parent-child relationship between selected bones and their parents";
/* api callbacks */
ot->invoke = WM_menu_invoke;
@@ -3927,9 +3930,9 @@ void ARMATURE_OT_parent_clear(wmOperatorType *ot)
ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
- ot->prop= RNA_def_enum(ot->srna, "type", prop_editarm_clear_parent_types, 0, "ClearType", "What way to clear parenting");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_editarm_clear_parent_types, 0, "ClearType", "What way to clear parenting");
}
/* **************** Selections ******************/
@@ -3954,16 +3957,16 @@ static int armature_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
void ARMATURE_OT_select_inverse(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Inverse";
- ot->idname= "ARMATURE_OT_select_inverse";
- ot->description= "Flip the selection status of bones (selected -> unselected, unselected -> selected)";
+ ot->name = "Select Inverse";
+ ot->idname = "ARMATURE_OT_select_inverse";
+ ot->description = "Flip the selection status of bones (selected -> unselected, unselected -> selected)";
/* api callbacks */
- ot->exec= armature_select_inverse_exec;
- ot->poll= ED_operator_editarmature;
+ ot->exec = armature_select_inverse_exec;
+ ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int armature_de_select_all_exec(bContext *C, wmOperator *op)
@@ -3972,8 +3975,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;
}
@@ -3985,7 +3988,7 @@ static int armature_de_select_all_exec(bContext *C, wmOperator *op)
switch (action) {
case SEL_SELECT:
ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
- if(ebone->parent)
+ if (ebone->parent)
ebone->parent->flag |= (BONE_TIPSEL);
break;
case SEL_DESELECT:
@@ -3997,7 +4000,7 @@ static int armature_de_select_all_exec(bContext *C, wmOperator *op)
}
else {
ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
- if(ebone->parent)
+ if (ebone->parent)
ebone->parent->flag |= (BONE_TIPSEL);
}
break;
@@ -4014,16 +4017,16 @@ static int armature_de_select_all_exec(bContext *C, wmOperator *op)
void ARMATURE_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select or Deselect All";
- ot->idname= "ARMATURE_OT_select_all";
- ot->description= "Toggle selection status of all bones";
+ ot->name = "(De)select All";
+ ot->idname = "ARMATURE_OT_select_all";
+ ot->description = "Toggle selection status of all bones";
/* api callbacks */
- ot->exec= armature_de_select_all_exec;
- ot->poll= ED_operator_editarmature;
+ ot->exec = armature_de_select_all_exec;
+ ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
WM_operator_properties_select_all(ot);
}
@@ -4095,16 +4098,16 @@ void ARMATURE_OT_select_hierarchy(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Select Hierarchy";
- ot->idname= "ARMATURE_OT_select_hierarchy";
- ot->description= "Select immediate parent/children of selected bones";
+ ot->name = "Select Hierarchy";
+ ot->idname = "ARMATURE_OT_select_hierarchy";
+ ot->description = "Select immediate parent/children of selected bones";
/* api callbacks */
- ot->exec= armature_select_hierarchy_exec;
- ot->poll= ED_operator_editarmature;
+ ot->exec = armature_select_hierarchy_exec;
+ ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
RNA_def_enum(ot->srna, "direction", direction_items,
@@ -4158,8 +4161,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 +4182,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 +4211,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 */
@@ -4234,9 +4237,9 @@ static int armature_align_bones_exec(bContext *C, wmOperator *op)
void ARMATURE_OT_align(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Align Bones";
- ot->idname= "ARMATURE_OT_align";
- ot->description= "Align selected bones to the active bone (or to their parent)";
+ ot->name = "Align Bones";
+ ot->idname = "ARMATURE_OT_align";
+ ot->description = "Align selected bones to the active bone (or to their parent)";
/* api callbacks */
ot->invoke = WM_operator_confirm;
@@ -4244,7 +4247,7 @@ void ARMATURE_OT_align(wmOperatorType *ot)
ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ***************** Pose tools ********************* */
@@ -4254,11 +4257,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 +4272,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);
}
@@ -4297,7 +4300,7 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor
* armature object was not active yet.
* note, special exception for armature mode so we can do multi-select
* we could check for multi-select explicitly but think its fine to
- * always give pradictable behavior in weight paint mode - campbell */
+ * always give predictable behavior in weight paint mode - campbell */
if (!extend || ((ob_act && (ob_act != ob) && (ob_act->mode & OB_MODE_WEIGHT_PAINT)==0))) {
ED_pose_deselectall(ob, 0);
nearBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
@@ -4309,7 +4312,7 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor
else {
if (nearBone->flag & BONE_SELECTED) {
/* if not active, we make it active */
- if(nearBone != arm->act_bone) {
+ if (nearBone != arm->act_bone) {
arm->act_bone= nearBone;
}
else {
@@ -4342,10 +4345,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;
@@ -4413,7 +4416,7 @@ static int bone_skinnable_cb(Object *ob, Bone *bone, void *datap)
int a, segments;
struct { Object *armob; void *list; int heat; } *data = datap;
- if(!(ob->mode & OB_MODE_WEIGHT_PAINT) || !(bone->flag & BONE_HIDDEN_P)) {
+ if (!(ob->mode & OB_MODE_WEIGHT_PAINT) || !(bone->flag & BONE_HIDDEN_P)) {
if (!(bone->flag & BONE_NO_DEFORM)) {
if (data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name))
segments = bone->segments;
@@ -4437,9 +4440,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);
@@ -4487,7 +4490,7 @@ static int dgroup_skinnable_cb(Object *ob, Bone *bone, void *datap)
else
segments = 1;
- if(!wpmode || ((arm->layer & bone->layer) && (bone->flag & BONE_SELECTED)))
+ if (!wpmode || ((arm->layer & bone->layer) && (bone->flag & BONE_SELECTED)))
if (!(defgroup = defgroup_find_name(ob, bone->name)))
defgroup = ED_vgroup_add_name(ob, bone->name);
@@ -4688,7 +4691,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;
@@ -4707,7 +4710,7 @@ static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob,
heat_bone_weighting(ob, mesh, verts, numbones, dgrouplist, dgroupflip,
root, tip, selected, &error);
- if(error) {
+ if (error) {
BKE_report(reports, RPT_WARNING, error);
}
}
@@ -4736,16 +4739,16 @@ void create_vgroups_from_armature(ReportList *reports, Scene *scene, Object *ob,
*/
bArmature *arm= par->data;
- if(mode == ARM_GROUPS_NAME) {
+ 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);
if (ob->type == OB_MESH)
ED_vgroup_data_create(ob->data);
}
- else if(mode == ARM_GROUPS_ENVELOPE || mode == ARM_GROUPS_AUTO) {
+ else if (mode == ARM_GROUPS_ENVELOPE || mode == ARM_GROUPS_AUTO) {
/* Traverse the bone list, trying to create vertex groups
* that are populated with the vertices for which the
* bone is closest.
@@ -4895,7 +4898,7 @@ static int pose_clear_transform_generic_exec(bContext *C, wmOperator *op,
short autokey = 0;
/* sanity checks */
- if ELEM(NULL, clear_func, default_ksName) {
+ if (ELEM(NULL, clear_func, default_ksName)) {
BKE_report(op->reports, RPT_ERROR, "Programming error: missing clear transform func or Keying Set Name");
return OPERATOR_CANCELLED;
}
@@ -4954,8 +4957,8 @@ static int pose_clear_scale_exec(bContext *C, wmOperator *op)
void POSE_OT_scale_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Pose Scale";
- ot->idname= "POSE_OT_scale_clear";
+ ot->name = "Clear Pose Scale";
+ ot->idname = "POSE_OT_scale_clear";
ot->description = "Reset scaling of selected bones to their default values";
/* api callbacks */
@@ -4963,7 +4966,7 @@ void POSE_OT_scale_clear(wmOperatorType *ot)
ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -4975,8 +4978,8 @@ static int pose_clear_rot_exec(bContext *C, wmOperator *op)
void POSE_OT_rot_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Pose Rotation";
- ot->idname= "POSE_OT_rot_clear";
+ ot->name = "Clear Pose Rotation";
+ ot->idname = "POSE_OT_rot_clear";
ot->description = "Reset rotations of selected bones to their default values";
/* api callbacks */
@@ -4984,7 +4987,7 @@ void POSE_OT_rot_clear(wmOperatorType *ot)
ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -4996,8 +4999,8 @@ static int pose_clear_loc_exec(bContext *C, wmOperator *op)
void POSE_OT_loc_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Pose Location";
- ot->idname= "POSE_OT_loc_clear";
+ ot->name = "Clear Pose Location";
+ ot->idname = "POSE_OT_loc_clear";
ot->description = "Reset locations of selected bones to their default values";
/* api callbacks */
@@ -5005,7 +5008,7 @@ void POSE_OT_loc_clear(wmOperatorType *ot)
ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -5017,8 +5020,8 @@ static int pose_clear_transforms_exec(bContext *C, wmOperator *op)
void POSE_OT_transforms_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Pose Transforms";
- ot->idname= "POSE_OT_transforms_clear";
+ ot->name = "Clear Pose Transforms";
+ ot->idname = "POSE_OT_transforms_clear";
ot->description = "Reset location, rotation, and scaling of selected bones to their default values";
/* api callbacks */
@@ -5026,7 +5029,7 @@ void POSE_OT_transforms_clear(wmOperatorType *ot)
ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ***************** selections ********************** */
@@ -5078,16 +5081,16 @@ static int pose_de_select_all_exec(bContext *C, wmOperator *op)
void POSE_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select or Deselect All";
- ot->idname= "POSE_OT_select_all";
- ot->description= "Toggle selection status of all bones";
+ ot->name = "(De)select All";
+ ot->idname = "POSE_OT_select_all";
+ ot->description = "Toggle selection status of all bones";
/* api callbacks */
- ot->exec= pose_de_select_all_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_de_select_all_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
WM_operator_properties_select_all(ot);
}
@@ -5122,16 +5125,16 @@ static int pose_select_parent_exec(bContext *C, wmOperator *UNUSED(op))
void POSE_OT_select_parent(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Parent Bone";
- ot->idname= "POSE_OT_select_parent";
- ot->description= "Select bones that are parents of the currently selected bones";
+ ot->name = "Select Parent Bone";
+ ot->idname = "POSE_OT_select_parent";
+ ot->description = "Select bones that are parents of the currently selected bones";
/* api callbacks */
- ot->exec= pose_select_parent_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_select_parent_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -5145,7 +5148,7 @@ static int hide_selected_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr))
if (bone->flag & BONE_SELECTED) {
bone->flag |= BONE_HIDDEN_P;
bone->flag &= ~BONE_SELECTED;
- if(arm->act_bone==bone)
+ if (arm->act_bone==bone)
arm->act_bone= NULL;
}
}
@@ -5160,7 +5163,7 @@ static int hide_unselected_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr
// hrm... typo here?
if ((bone->flag & BONE_SELECTED)==0) {
bone->flag |= BONE_HIDDEN_P;
- if(arm->act_bone==bone)
+ if (arm->act_bone==bone)
arm->act_bone= NULL;
}
}
@@ -5173,7 +5176,7 @@ static int pose_hide_exec(bContext *C, wmOperator *op)
Object *ob= object_pose_armature_get(CTX_data_active_object(C));
bArmature *arm= ob->data;
- if(RNA_boolean_get(op->ptr, "unselected"))
+ if (RNA_boolean_get(op->ptr, "unselected"))
bone_looper(ob, arm->bonebase.first, NULL, hide_unselected_pose_bone_cb);
else
bone_looper(ob, arm->bonebase.first, NULL, hide_selected_pose_bone_cb);
@@ -5187,16 +5190,16 @@ static int pose_hide_exec(bContext *C, wmOperator *op)
void POSE_OT_hide(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Hide Selected";
- ot->idname= "POSE_OT_hide";
- ot->description= "Tag selected bones to not be visible in Pose Mode";
+ ot->name = "Hide Selected";
+ ot->idname = "POSE_OT_hide";
+ ot->description = "Tag selected bones to not be visible in Pose Mode";
/* api callbacks */
- ot->exec= pose_hide_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_hide_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "");
@@ -5233,16 +5236,16 @@ static int pose_reveal_exec(bContext *C, wmOperator *UNUSED(op))
void POSE_OT_reveal(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reveal Selected";
- ot->idname= "POSE_OT_reveal";
- ot->description= "Unhide all bones that have been tagged to be hidden in Pose Mode";
+ ot->name = "Reveal Selected";
+ ot->idname = "POSE_OT_reveal";
+ ot->description = "Unhide all bones that have been tagged to be hidden in Pose Mode";
/* api callbacks */
- ot->exec= pose_reveal_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_reveal_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ************* RENAMING DISASTERS ************ */
@@ -5293,7 +5296,7 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
char oldname[MAXBONENAME];
/* names better differ! */
- if(strncmp(oldnamep, newnamep, MAXBONENAME)) {
+ if (strncmp(oldnamep, newnamep, MAXBONENAME)) {
/* we alter newname string... so make copy */
BLI_strncpy(newname, newnamep, MAXBONENAME);
@@ -5368,7 +5371,7 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
if (modifiers_usesArmature(ob, arm)) {
bDeformGroup *dg= defgroup_find_name(ob, oldname);
- if(dg) {
+ if (dg) {
BLI_strncpy(dg->name, newname, MAXBONENAME);
}
}
@@ -5390,20 +5393,23 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
/* Fix all animdata that may refer to this bone - we can't just do the ones attached to objects, since
* other ID-blocks may have drivers referring to this bone [#29822]
*/
- BKE_all_animdata_fix_paths_rename("pose.bones", oldname, newname);
+ {
+
+ BKE_all_animdata_fix_paths_rename(&arm->id, "pose.bones", oldname, newname);
+ }
/* correct view locking */
{
bScreen *screen;
- for(screen= G.main->screen.first; screen; screen= screen->id.next) {
+ for (screen= G.main->screen.first; screen; screen= screen->id.next) {
ScrArea *sa;
/* add regions */
- 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) {
+ if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D *)sl;
- if(v3d->ob_centre && v3d->ob_centre->data == arm) {
+ if (v3d->ob_centre && v3d->ob_centre->data == arm) {
if (!strcmp(v3d->ob_centre_bone, oldname)) {
BLI_strncpy(v3d->ob_centre_bone, newname, MAXBONENAME);
}
@@ -5448,16 +5454,16 @@ static int armature_flip_names_exec (bContext *C, wmOperator *UNUSED(op))
void ARMATURE_OT_flip_names (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Flip Names";
- ot->idname= "ARMATURE_OT_flip_names";
- ot->description= "Flips (and corrects) the axis suffixes of the names of selected bones";
+ ot->name = "Flip Names";
+ ot->idname = "ARMATURE_OT_flip_names";
+ ot->description = "Flips (and corrects) the axis suffixes of the names of selected bones";
/* api callbacks */
- ot->exec= armature_flip_names_exec;
- ot->poll= ED_operator_editarmature;
+ ot->exec = armature_flip_names_exec;
+ ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -5477,7 +5483,7 @@ static int armature_autoside_names_exec (bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, EditBone *, ebone, selected_editable_bones)
{
BLI_strncpy(newname, ebone->name, sizeof(newname));
- if(bone_autoside_name(newname, 1, axis, ebone->head[axis], ebone->tail[axis]))
+ if (bone_autoside_name(newname, 1, axis, ebone->head[axis], ebone->tail[axis]))
ED_armature_bone_rename(arm, ebone->name, newname);
}
CTX_DATA_END;
@@ -5500,20 +5506,20 @@ void ARMATURE_OT_autoside_names (wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "AutoName by Axis";
- ot->idname= "ARMATURE_OT_autoside_names";
- ot->description= "Automatically renames the selected bones according to which side of the target axis they fall on";
+ ot->name = "AutoName by Axis";
+ ot->idname = "ARMATURE_OT_autoside_names";
+ ot->description = "Automatically renames the selected bones according to which side of the target axis they fall on";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= armature_autoside_names_exec;
- ot->poll= ED_operator_editarmature;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = armature_autoside_names_exec;
+ ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* settings */
- ot->prop= RNA_def_enum(ot->srna, "type", axis_items, 0, "Axis", "Axis tag names with");
+ ot->prop = RNA_def_enum(ot->srna, "type", axis_items, 0, "Axis", "Axis tag names with");
}
@@ -5557,8 +5563,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 +5594,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 +5628,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,9 +5644,8 @@ 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==arm->act_edbone) arm->act_edbone= NULL;
+ if (parent == root) {
+ if (parent==arm->act_edbone) arm->act_edbone= NULL;
ED_armature_edit_bone_remove(arm, parent);
parent = NULL;
}
@@ -5658,8 +5660,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 +5683,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 +5732,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 +5769,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 +5798,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 +5812,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 +5833,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 +5852,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,12 +5861,11 @@ 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 */
- while(childBone->parent != NULL)
+ while (childBone->parent != NULL)
{
childBone = childBone->parent;
}
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..f554b7b1c50 100644
--- a/source/blender/editors/armature/editarmature_retarget.c
+++ b/source/blender/editors/armature/editarmature_retarget.c
@@ -323,7 +323,7 @@ static RigGraph *newRigGraph(void)
rg->free_node = NULL;
#ifdef USE_THREADS
-// if(G.scene->r.mode & R_FIXED_THREADS)
+// if (G.scene->r.mode & R_FIXED_THREADS)
// {
// totthread = G.scene->r.threads;
// }
@@ -1008,7 +1008,7 @@ static void RIG_reconnectControlBones(RigGraph *rg)
/* look on deform bones first */
BLI_ghashIterator_init(&ghi, rg->bones_map);
- for( ; !BLI_ghashIterator_isDone(&ghi); BLI_ghashIterator_step(&ghi))
+ for ( ; !BLI_ghashIterator_isDone(&ghi); BLI_ghashIterator_step(&ghi))
{
EditBone *bone = (EditBone*)BLI_ghashIterator_getValue(&ghi);
@@ -1298,7 +1298,7 @@ static void RIG_arcFromBoneChain(RigGraph *rg, ListBase *list, EditBone *root_bo
RigArc *arc = NULL;
int contain_head = 0;
- for(bone = root_bone; bone; bone = nextEditBoneChild(list, bone, 0))
+ for (bone = root_bone; bone; bone = nextEditBoneChild(list, bone, 0))
{
int nb_children;
@@ -1550,7 +1550,7 @@ RigGraph *RIG_graphFromArmature(const bContext *C, Object *ob, bArmature *arm)
rg->ob = ob;
/* Do the rotations */
- for (ebone = rg->editbones->first; ebone; ebone=ebone->next){
+ for (ebone = rg->editbones->first; ebone; ebone=ebone->next) {
if (ebone->parent == NULL)
{
RIG_arcFromBoneChain(rg, rg->editbones, ebone, NULL, 0);
@@ -1602,7 +1602,7 @@ static RigGraph *armatureSelectedToGraph(bContext *C, Object *ob, bArmature *arm
rg->ob = ob;
/* Do the rotations */
- for (ebone = rg->editbones->first; ebone; ebone=ebone->next){
+ for (ebone = rg->editbones->first; ebone; ebone=ebone->next) {
if (ebone->parent == NULL)
{
RIG_arcFromBoneChain(rg, rg->editbones, ebone, NULL, 1);
@@ -2488,7 +2488,7 @@ static void markMultiResolutionChildArc(ReebNode *end_enode, ReebNode *enode)
{
int i;
- for(i = 0; i < enode->degree; i++)
+ for (i = 0; i < enode->degree; i++)
{
ReebArc *earc = (ReebArc*)enode->arcs[i];
@@ -2593,7 +2593,7 @@ static void findCorrespondingArc(RigGraph *rigg, RigArc *start_arc, RigNode *sta
// RIG_printArcBones(next_iarc);
// }
- for(i = 0; i < enode->degree; i++)
+ for (i = 0; i < enode->degree; i++)
{
next_earc = (ReebArc*)enode->arcs[i];
@@ -2644,20 +2644,20 @@ static void findCorrespondingArc(RigGraph *rigg, RigArc *start_arc, RigNode *sta
// printf("flag %i -- level %i -- flag %i -- group %i\n", ARC_FREE, symmetry_level, symmetry_flag, symmetry_group);
//
// printf("CANDIDATES\n");
-// for(i = 0; i < enode->degree; i++)
+// for (i = 0; i < enode->degree; i++)
// {
// next_earc = (ReebArc*)enode->arcs[i];
// printf("flag %i -- level %i -- flag %i -- group %i\n", next_earc->flag, next_earc->symmetry_level, next_earc->symmetry_flag, next_earc->symmetry_group);
// }
/* Emergency matching */
- for(i = 0; i < enode->degree; i++)
+ for (i = 0; i < enode->degree; i++)
{
next_earc = (ReebArc*)enode->arcs[i];
if (next_earc->flag == ARC_FREE && next_earc->symmetry_level == symmetry_level)
{
-// printf("USING: \n");
+// printf("USING:\n");
// printf("flag %i -- level %i -- flag %i -- group %i\n", next_earc->flag, next_earc->symmetry_level, next_earc->symmetry_flag, next_earc->symmetry_group);
matchMultiResolutionArc(rigg, start_node, next_iarc, next_earc);
break;
@@ -2687,7 +2687,7 @@ static void retargetSubgraph(bContext *C, RigGraph *rigg, RigArc *start_arc, Rig
matchMultiResolutionNode(rigg, inode, enode);
}
- for(i = 0; i < inode->degree; i++)
+ for (i = 0; i < inode->degree; i++)
{
RigArc *next_iarc = (RigArc*)inode->arcs[i];
@@ -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/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c
index 41a7b20de3d..81b020a4cf9 100644
--- a/source/blender/editors/armature/editarmature_sketch.c
+++ b/source/blender/editors/armature/editarmature_sketch.c
@@ -1079,7 +1079,7 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S
mvalf[0]= dd->mval[0];
mvalf[1]= dd->mval[1];
- peelObjectsContext(C, &sketch->depth_peels, mvalf);
+ peelObjectsContext(C, &sketch->depth_peels, mvalf, SNAP_ALL);
if (stk->nb_points > 0 && stk->points[stk->nb_points - 1].type == PT_CONTINUOUS)
{
@@ -1799,7 +1799,7 @@ void sk_applyCutGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSED
SK_Point pt;
pt.type = PT_EXACT;
- pt.mode = PT_PROJECT; /* take mode from neighbouring points */
+ pt.mode = PT_PROJECT; /* take mode from neighboring points */
copy_v3_v3(pt.p, isect->p);
copy_v3_v3(pt.no, isect->stroke->points[isect->before].no);
@@ -1841,7 +1841,7 @@ void sk_applyTrimGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSE
float stroke_dir[3];
pt.type = PT_EXACT;
- pt.mode = PT_PROJECT; /* take mode from neighbouring points */
+ pt.mode = PT_PROJECT; /* take mode from neighboring points */
copy_v3_v3(pt.p, isect->p);
copy_v3_v3(pt.no, isect->stroke->points[isect->before].no);
@@ -1870,7 +1870,7 @@ int sk_detectCommandGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UN
SK_Intersection *isect, *self_isect;
/* get the the last intersection of the first pair */
- for( isect = gest->intersections.first; isect; isect = isect->next )
+ for ( isect = gest->intersections.first; isect; isect = isect->next )
{
if (isect->stroke == isect->next->stroke)
{
@@ -1897,7 +1897,7 @@ void sk_applyCommandGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UN
// XXX
// command = pupmenu("Action %t|Flatten %x1|Straighten %x2|Polygonize %x3");
- if(command < 1) return;
+ if (command < 1) return;
for (isect = gest->intersections.first; isect; isect = isect->next)
{
@@ -2166,10 +2166,10 @@ static int sk_selectStroke(bContext *C, SK_Sketch *sketch, const int mval[2], in
view3d_set_viewcontext(C, &vc);
- rect.xmin= mval[0]-5;
- rect.xmax= mval[0]+5;
- rect.ymin= mval[1]-5;
- rect.ymax= mval[1]+5;
+ rect.xmin = mval[0]-5;
+ rect.xmax = mval[0]+5;
+ rect.ymin = mval[1]-5;
+ rect.ymax = mval[1]+5;
hits = view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect);
@@ -2177,7 +2177,7 @@ static int sk_selectStroke(bContext *C, SK_Sketch *sketch, const int mval[2], in
{
int besthitresult = -1;
- if(hits == 1) {
+ if (hits == 1) {
besthitresult = buffer[3];
}
else {
@@ -2839,130 +2839,130 @@ int ED_operator_sketch_mode(const bContext *C)
void SKETCH_OT_delete(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete";
- ot->idname= "SKETCH_OT_delete";
+ ot->name = "Delete";
+ ot->idname = "SKETCH_OT_delete";
/* api callbacks */
- ot->invoke= sketch_delete;
+ ot->invoke = sketch_delete;
- ot->poll= ED_operator_sketch_full_mode;
+ ot->poll = ED_operator_sketch_full_mode;
/* flags */
-// ot->flag= OPTYPE_UNDO;
+// ot->flag = OPTYPE_UNDO;
}
void SKETCH_OT_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select";
- ot->idname= "SKETCH_OT_select";
+ ot->name = "Select";
+ ot->idname = "SKETCH_OT_select";
/* api callbacks */
- ot->invoke= sketch_select;
+ ot->invoke = sketch_select;
- ot->poll= ED_operator_sketch_full_mode;
+ ot->poll = ED_operator_sketch_full_mode;
/* flags */
-// ot->flag= OPTYPE_UNDO;
+// ot->flag = OPTYPE_UNDO;
}
void SKETCH_OT_cancel_stroke(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Cancel Stroke";
- ot->idname= "SKETCH_OT_cancel_stroke";
+ ot->name = "Cancel Stroke";
+ ot->idname = "SKETCH_OT_cancel_stroke";
/* api callbacks */
- ot->invoke= sketch_cancel;
+ ot->invoke = sketch_cancel;
- ot->poll= ED_operator_sketch_mode_active_stroke;
+ ot->poll = ED_operator_sketch_mode_active_stroke;
/* flags */
-// ot->flag= OPTYPE_UNDO;
+// ot->flag = OPTYPE_UNDO;
}
void SKETCH_OT_convert(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Convert";
- ot->idname= "SKETCH_OT_convert";
+ ot->name = "Convert";
+ ot->idname = "SKETCH_OT_convert";
/* api callbacks */
- ot->invoke= sketch_convert;
+ ot->invoke = sketch_convert;
- ot->poll= ED_operator_sketch_full_mode;
+ ot->poll = ED_operator_sketch_full_mode;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
}
void SKETCH_OT_finish_stroke(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "End Stroke";
- ot->idname= "SKETCH_OT_finish_stroke";
+ ot->name = "End Stroke";
+ ot->idname = "SKETCH_OT_finish_stroke";
/* api callbacks */
- ot->invoke= sketch_finish;
+ ot->invoke = sketch_finish;
- ot->poll= ED_operator_sketch_mode_active_stroke;
+ ot->poll = ED_operator_sketch_mode_active_stroke;
/* flags */
-// ot->flag= OPTYPE_UNDO;
+// ot->flag = OPTYPE_UNDO;
}
void SKETCH_OT_draw_preview(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Draw Preview";
- ot->idname= "SKETCH_OT_draw_preview";
+ ot->name = "Draw Preview";
+ ot->idname = "SKETCH_OT_draw_preview";
/* api callbacks */
- ot->invoke= sketch_draw_preview;
+ ot->invoke = sketch_draw_preview;
- ot->poll= ED_operator_sketch_mode_active_stroke;
+ ot->poll = ED_operator_sketch_mode_active_stroke;
RNA_def_boolean(ot->srna, "snap", 0, "Snap", "");
/* flags */
-// ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+// ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
void SKETCH_OT_draw_stroke(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Draw Stroke";
- ot->idname= "SKETCH_OT_draw_stroke";
+ ot->name = "Draw Stroke";
+ ot->idname = "SKETCH_OT_draw_stroke";
/* api callbacks */
ot->invoke = sketch_draw_stroke;
ot->modal = sketch_draw_stroke_modal;
ot->cancel = sketch_draw_stroke_cancel;
- ot->poll= (int (*)(bContext *))ED_operator_sketch_mode;
+ ot->poll = (int (*)(bContext *))ED_operator_sketch_mode;
RNA_def_boolean(ot->srna, "snap", 0, "Snap", "");
/* flags */
- ot->flag= OPTYPE_BLOCKING; // OPTYPE_REGISTER|OPTYPE_UNDO
+ ot->flag = OPTYPE_BLOCKING; // OPTYPE_REGISTER|OPTYPE_UNDO
}
void SKETCH_OT_gesture(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Gesture";
- ot->idname= "SKETCH_OT_gesture";
+ ot->name = "Gesture";
+ ot->idname = "SKETCH_OT_gesture";
/* api callbacks */
ot->invoke = sketch_draw_gesture;
ot->modal = sketch_draw_gesture_modal;
ot->cancel = sketch_draw_gesture_cancel;
- ot->poll= ED_operator_sketch_mode_gesture;
+ ot->poll = ED_operator_sketch_mode_gesture;
RNA_def_boolean(ot->srna, "snap", 0, "Snap", "");
/* flags */
- ot->flag= OPTYPE_BLOCKING; // OPTYPE_UNDO
+ ot->flag = OPTYPE_BLOCKING; // OPTYPE_UNDO
}
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index e2b89ba90e1..4c1315e847e 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -47,6 +47,8 @@
#include "BLI_memarena.h"
#include "BLI_string.h"
+#include "BLF_translation.h"
+
#include "BKE_DerivedMesh.h"
#include "BKE_modifier.h"
#include "BKE_mesh.h"
@@ -129,18 +131,18 @@ 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)
{
void **p = BLI_edgehash_lookup_p(edgehash, v1, v2);
- if(p)
+ if (p)
*p = (void*)((intptr_t)*p + (intptr_t)1);
else
BLI_edgehash_insert(edgehash, v1, v2, (void*)(intptr_t)1);
@@ -182,8 +184,8 @@ static void laplacian_triangle_area(LaplacianSystem *sys, int i1, int i2, int i3
t3= cotan_weight(v3, v1, v2);
if (angle_v3v3v3(v2, v1, v3) > DEG2RADF(90.0f)) obtuse= 1;
- else if(angle_v3v3v3(v1, v2, v3) > DEG2RADF(90.0f)) obtuse= 2;
- else if(angle_v3v3v3(v1, v3, v2) > DEG2RADF(90.0f)) obtuse= 3;
+ else if (angle_v3v3v3(v1, v2, v3) > DEG2RADF(90.0f)) obtuse= 2;
+ else if (angle_v3v3v3(v1, v3, v2) > DEG2RADF(90.0f)) obtuse= 3;
if (obtuse > 0) {
area= area_tri_v3(v1, v2, v3);
@@ -217,7 +219,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);
@@ -235,7 +237,7 @@ static void laplacian_triangle_weights(LaplacianSystem *sys, int f, int i1, int
nlMatrixAdd(i3, i1, -t2*varea[i3]);
nlMatrixAdd(i1, i3, -t2*varea[i1]);
- if(sys->storeweights) {
+ if (sys->storeweights) {
sys->fweights[f][0]= t1*varea[i1];
sys->fweights[f][1]= t2*varea[i2];
sys->fweights[f][2]= t3*varea[i3];
@@ -261,7 +263,7 @@ static LaplacianSystem *laplacian_system_construct_begin(int totvert, int totfac
/* create opennl context */
nlNewContext();
nlSolverParameteri(NL_NB_VARIABLES, totvert);
- if(lsq)
+ if (lsq)
nlSolverParameteri(NL_LEAST_SQUARES, NL_TRUE);
sys->context= nlGetCurrent();
@@ -294,39 +296,39 @@ static void laplacian_system_construct_end(LaplacianSystem *sys)
sys->varea= MEM_callocN(sizeof(float)*totvert, "LaplacianSystemVarea");
sys->edgehash= BLI_edgehash_new();
- for(a=0, face=sys->faces; a<sys->totface; a++, face++) {
+ for (a=0, face=sys->faces; a<sys->totface; a++, face++) {
laplacian_increase_edge_count(sys->edgehash, (*face)[0], (*face)[1]);
laplacian_increase_edge_count(sys->edgehash, (*face)[1], (*face)[2]);
laplacian_increase_edge_count(sys->edgehash, (*face)[2], (*face)[0]);
}
- if(sys->areaweights)
- for(a=0, face=sys->faces; a<sys->totface; a++, face++)
+ if (sys->areaweights)
+ for (a=0, face=sys->faces; a<sys->totface; a++, face++)
laplacian_triangle_area(sys, (*face)[0], (*face)[1], (*face)[2]);
- for(a=0; a<totvert; a++) {
- if(sys->areaweights) {
- if(sys->varea[a] != 0.0f)
+ for (a=0; a<totvert; a++) {
+ if (sys->areaweights) {
+ if (sys->varea[a] != 0.0f)
sys->varea[a]= 0.5f/sys->varea[a];
}
else
sys->varea[a]= 1.0f;
/* for heat weighting */
- if(sys->heat.H)
+ if (sys->heat.H)
nlMatrixAdd(a, a, sys->heat.H[a]);
}
- if(sys->storeweights)
+ if (sys->storeweights)
sys->fweights= MEM_callocN(sizeof(float)*3*totface, "LaplacianFWeight");
- for(a=0, face=sys->faces; a<totface; a++, face++)
+ for (a=0, face=sys->faces; a<totface; a++, face++)
laplacian_triangle_weights(sys, a, (*face)[0], (*face)[1], (*face)[2]);
MEM_freeN(sys->faces);
sys->faces= NULL;
- if(sys->varea) {
+ if (sys->varea) {
MEM_freeN(sys->varea);
sys->varea= NULL;
}
@@ -337,11 +339,11 @@ static void laplacian_system_construct_end(LaplacianSystem *sys)
static void laplacian_system_delete(LaplacianSystem *sys)
{
- if(sys->verts) MEM_freeN(sys->verts);
- if(sys->varea) MEM_freeN(sys->varea);
- if(sys->vpinned) MEM_freeN(sys->vpinned);
- if(sys->faces) MEM_freeN(sys->faces);
- if(sys->fweights) MEM_freeN(sys->fweights);
+ if (sys->verts) MEM_freeN(sys->verts);
+ if (sys->varea) MEM_freeN(sys->varea);
+ if (sys->vpinned) MEM_freeN(sys->vpinned);
+ if (sys->faces) MEM_freeN(sys->faces);
+ if (sys->fweights) MEM_freeN(sys->fweights);
nlDeleteContext(sys->context);
MEM_freeN(sys);
@@ -354,9 +356,9 @@ void laplacian_begin_solve(LaplacianSystem *sys, int index)
if (!sys->nlbegun) {
nlBegin(NL_SYSTEM);
- if(index >= 0) {
- for(a=0; a<sys->totvert; a++) {
- if(sys->vpinned[a]) {
+ if (index >= 0) {
+ for (a=0; a<sys->totvert; a++) {
+ if (sys->vpinned[a]) {
nlSetVariable(0, a, sys->verts[a][index]);
nlLockVariable(a);
}
@@ -391,7 +393,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
@@ -413,9 +415,9 @@ static void bvh_callback(void *userdata, int index, const BVHTreeRay *UNUSED(ray
mul_v3_v3fl(dir, data->vec, hit->dist);
- if(isect_ray_tri_v3(data->start, dir, verts[mf->v1], verts[mf->v2], verts[mf->v3], &lambda, uv)) {
+ if (isect_ray_tri_v3(data->start, dir, verts[mf->v1], verts[mf->v2], verts[mf->v3], &lambda, uv)) {
normal_tri_v3(n, verts[mf->v1], verts[mf->v2], verts[mf->v3]);
- if(lambda < 1.0f && dot_v3v3(n, data->vec) < -1e-5f) {
+ if (lambda < 1.0f && dot_v3v3(n, data->vec) < -1e-5f) {
hit->index = index;
hit->dist *= lambda;
}
@@ -423,9 +425,9 @@ static void bvh_callback(void *userdata, int index, const BVHTreeRay *UNUSED(ray
mul_v3_v3fl(dir, data->vec, hit->dist);
- if(isect_ray_tri_v3(data->start, dir, verts[mf->v1], verts[mf->v3], verts[mf->v4], &lambda, uv)) {
+ if (isect_ray_tri_v3(data->start, dir, verts[mf->v1], verts[mf->v3], verts[mf->v4], &lambda, uv)) {
normal_tri_v3(n, verts[mf->v1], verts[mf->v3], verts[mf->v4]);
- if(lambda < 1.0f && dot_v3v3(n, data->vec) < -1e-5f) {
+ if (lambda < 1.0f && dot_v3v3(n, data->vec) < -1e-5f) {
hit->index = index;
hit->dist *= lambda;
}
@@ -444,7 +446,7 @@ static void heat_ray_tree_create(LaplacianSystem *sys)
sys->heat.bvhtree = BLI_bvhtree_new(totface, 0.0f, 4, 6);
sys->heat.vface = MEM_callocN(sizeof(MFace*)*totvert, "HeatVFaces");
- for(a=0; a<totface; a++) {
+ for (a=0; a<totface; a++) {
MFace *mf = mface+a;
float bb[6];
@@ -452,7 +454,7 @@ static void heat_ray_tree_create(LaplacianSystem *sys)
DO_MINMAX(verts[mf->v1], bb, bb+3);
DO_MINMAX(verts[mf->v2], bb, bb+3);
DO_MINMAX(verts[mf->v3], bb, bb+3);
- if(mf->v4) {
+ if (mf->v4) {
DO_MINMAX(verts[mf->v4], bb, bb+3);
}
@@ -462,7 +464,7 @@ static void heat_ray_tree_create(LaplacianSystem *sys)
sys->heat.vface[mf->v1]= mf;
sys->heat.vface[mf->v2]= mf;
sys->heat.vface[mf->v3]= mf;
- if(mf->v4) sys->heat.vface[mf->v4]= mf;
+ if (mf->v4) sys->heat.vface[mf->v4]= mf;
}
BLI_bvhtree_balance(sys->heat.bvhtree);
@@ -477,13 +479,13 @@ static int heat_ray_source_visible(LaplacianSystem *sys, int vertex, int source)
int visible;
mface= sys->heat.vface[vertex];
- if(!mface)
+ if (!mface)
return 1;
data.sys= sys;
copy_v3_v3(data.start, sys->heat.verts[vertex]);
- if(sys->heat.root) /* bone */
+ if (sys->heat.root) /* bone */
closest_to_line_segment_v3(end, data.start,
sys->heat.root[source], sys->heat.tip[source]);
else /* vertex */
@@ -507,7 +509,7 @@ static float heat_source_distance(LaplacianSystem *sys, int vertex, int source)
float closest[3], d[3], dist, cosine;
/* compute euclidian distance */
- if(sys->heat.root) /* bone */
+ if (sys->heat.root) /* bone */
closest_to_line_segment_v3(closest, sys->heat.verts[vertex],
sys->heat.root[source], sys->heat.tip[source]);
else /* vertex */
@@ -528,8 +530,8 @@ static int heat_source_closest(LaplacianSystem *sys, int vertex, int source)
dist= heat_source_distance(sys, vertex, source);
- if(dist <= sys->heat.mindist[vertex]*(1.0f + DISTANCE_EPSILON))
- if(heat_ray_source_visible(sys, vertex, source))
+ if (dist <= sys->heat.mindist[vertex]*(1.0f + DISTANCE_EPSILON))
+ if (heat_ray_source_visible(sys, vertex, source))
return 1;
return 0;
@@ -543,24 +545,24 @@ static void heat_set_H(LaplacianSystem *sys, int vertex)
mindist= 1e10;
/* compute minimum distance */
- for(j=0; j<sys->heat.numsource; j++) {
+ for (j=0; j<sys->heat.numsource; j++) {
dist= heat_source_distance(sys, vertex, j);
- if(dist < mindist)
+ if (dist < mindist)
mindist= dist;
}
sys->heat.mindist[vertex]= mindist;
/* count number of sources with approximately this minimum distance */
- for(j=0; j<sys->heat.numsource; j++)
- if(heat_source_closest(sys, vertex, j))
+ for (j=0; j<sys->heat.numsource; j++)
+ if (heat_source_closest(sys, vertex, j))
numclosest++;
sys->heat.p[vertex]= (numclosest > 0)? 1.0f/numclosest: 0.0f;
/* compute H entry */
- if(numclosest > 0) {
+ if (numclosest > 0) {
mindist= maxf(mindist, 1e-4f);
h= numclosest*C_WEIGHT/(mindist*mindist);
}
@@ -577,7 +579,7 @@ static void heat_calc_vnormals(LaplacianSystem *sys)
sys->heat.vnors= MEM_callocN(sizeof(float)*3*sys->totvert, "HeatVNors");
- for(a=0, face=sys->faces; a<sys->totface; a++, face++) {
+ for (a=0, face=sys->faces; a<sys->totface; a++, face++) {
v1= (*face)[0];
v2= (*face)[1];
v3= (*face)[2];
@@ -589,7 +591,7 @@ static void heat_calc_vnormals(LaplacianSystem *sys)
add_v3_v3(sys->heat.vnors[v3], fnor);
}
- for(a=0; a<sys->totvert; a++)
+ for (a=0; a<sys->totvert; a++)
normalize_v3(sys->heat.vnors[a]);
}
@@ -606,19 +608,19 @@ static void heat_laplacian_create(LaplacianSystem *sys)
sys->heat.p= MEM_callocN(sizeof(float)*totvert, "HeatP");
/* add verts and faces to laplacian */
- for(a=0; a<totvert; a++)
+ for (a=0; a<totvert; a++)
laplacian_add_vertex(sys, sys->heat.verts[a], 0);
- for(a=0, mf=mface; a<totface; a++, mf++) {
+ for (a=0, mf=mface; a<totface; a++, mf++) {
laplacian_add_triangle(sys, mf->v1, mf->v2, mf->v3);
- if(mf->v4)
+ if (mf->v4)
laplacian_add_triangle(sys, mf->v1, mf->v3, mf->v4);
}
/* for distance computation in set_H */
heat_calc_vnormals(sys);
- for(a=0; a<totvert; a++)
+ for (a=0; a<totvert; a++)
heat_set_H(sys, a);
}
@@ -637,10 +639,10 @@ static float heat_limit_weight(float weight)
{
float t;
- if(weight < WEIGHT_LIMIT_END) {
+ if (weight < WEIGHT_LIMIT_END) {
return 0.0f;
}
- else if(weight < WEIGHT_LIMIT_START) {
+ else if (weight < WEIGHT_LIMIT_START) {
t= (weight - WEIGHT_LIMIT_END)/(WEIGHT_LIMIT_START - WEIGHT_LIMIT_END);
return t*WEIGHT_LIMIT_START;
}
@@ -665,15 +667,15 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
*err_str= NULL;
/* count triangles and create mask */
- if( (use_face_sel= (me->editflag & ME_EDIT_PAINT_MASK) != 0) ||
+ if ( (use_face_sel= (me->editflag & ME_EDIT_PAINT_MASK) != 0) ||
(use_vert_sel= ((me->editflag & ME_EDIT_VERT_SEL) != 0)))
{
mask= MEM_callocN(sizeof(int)*me->totvert, "heat_bone_weighting mask");
}
- for(a = 0, mp=me->mpoly; a < me->totpoly; mp++, a++) {
+ for (a = 0, mp=me->mpoly; a < me->totpoly; mp++, a++) {
/* (added selectedVerts content for vertex mask, they used to just equal 1) */
- if(use_vert_sel) {
+ if (use_vert_sel) {
for (j = 0, ml = me->mloop + mp->loopstart; j < mp->totloop; j++, ml++) {
if (use_vert_sel) {
mask[ml->v] = (mvert[ml->v].flag & SELECT) != 0;
@@ -692,9 +694,9 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
/* bone heat needs triangulated faces */
BKE_mesh_tessface_ensure(me);
- for(tottri = 0, a = 0, mf = me->mface; a < me->totface; mf++, a++) {
+ for (tottri = 0, a = 0, mf = me->mface; a < me->totface; mf++, a++) {
tottri++;
- if(mf->v4) tottri++;
+ if (mf->v4) tottri++;
}
/* create laplacian */
@@ -713,15 +715,15 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
laplacian_system_construct_end(sys);
- if(dgroupflip) {
+ if (dgroupflip) {
vertsflipped = MEM_callocN(sizeof(int)*me->totvert, "vertsflipped");
- for(a=0; a<me->totvert; a++)
+ for (a=0; a<me->totvert; a++)
vertsflipped[a] = mesh_get_x_mirror_vert(ob, a);
}
/* compute weights per bone */
- for(j=0; j<numsource; j++) {
- if(!selected[j])
+ for (j=0; j<numsource; j++) {
+ if (!selected[j])
continue;
firstsegment= (j == 0 || dgrouplist[j-1] != dgrouplist[j]);
@@ -729,13 +731,13 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
bbone= !(firstsegment && lastsegment);
/* clear weights */
- if(bbone && firstsegment) {
- for(a=0; a<me->totvert; a++) {
- if(mask && !mask[a])
+ if (bbone && firstsegment) {
+ for (a=0; a<me->totvert; a++) {
+ if (mask && !mask[a])
continue;
ED_vgroup_vert_remove(ob, dgrouplist[j], a);
- if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0)
+ if (vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0)
ED_vgroup_vert_remove(ob, dgroupflip[j], vertsflipped[a]);
}
}
@@ -743,28 +745,28 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
/* fill right hand side */
laplacian_begin_solve(sys, -1);
- for(a=0; a<me->totvert; a++)
- if(heat_source_closest(sys, a, j))
+ for (a=0; a<me->totvert; a++)
+ if (heat_source_closest(sys, a, j))
laplacian_add_right_hand_side(sys, a,
sys->heat.H[a]*sys->heat.p[a]);
/* solve */
- if(laplacian_system_solve(sys)) {
+ if (laplacian_system_solve(sys)) {
/* load solution into vertex groups */
- for(a=0; a<me->totvert; a++) {
- if(mask && !mask[a])
+ for (a=0; a<me->totvert; a++) {
+ if (mask && !mask[a])
continue;
solution= laplacian_system_get_solution(a);
- if(bbone) {
- if(solution > 0.0f)
+ if (bbone) {
+ if (solution > 0.0f)
ED_vgroup_vert_add(ob, dgrouplist[j], a, solution,
WEIGHT_ADD);
}
else {
weight= heat_limit_weight(solution);
- if(weight > 0.0f)
+ if (weight > 0.0f)
ED_vgroup_vert_add(ob, dgrouplist[j], a, weight,
WEIGHT_REPLACE);
else
@@ -772,15 +774,15 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
}
/* do same for mirror */
- if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) {
- if(bbone) {
- if(solution > 0.0f)
+ if (vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) {
+ if (bbone) {
+ if (solution > 0.0f)
ED_vgroup_vert_add(ob, dgroupflip[j], vertsflipped[a],
solution, WEIGHT_ADD);
}
else {
weight= heat_limit_weight(solution);
- if(weight > 0.0f)
+ if (weight > 0.0f)
ED_vgroup_vert_add(ob, dgroupflip[j], vertsflipped[a],
weight, WEIGHT_REPLACE);
else
@@ -789,26 +791,26 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
}
}
}
- else if(*err_str == NULL) {
+ else if (*err_str == NULL) {
*err_str= "Bone Heat Weighting: failed to find solution for one or more bones";
break;
}
/* remove too small vertex weights */
- if(bbone && lastsegment) {
- for(a=0; a<me->totvert; a++) {
- if(mask && !mask[a])
+ if (bbone && lastsegment) {
+ for (a=0; a<me->totvert; a++) {
+ if (mask && !mask[a])
continue;
weight= ED_vgroup_vert_weight(ob, dgrouplist[j], a);
weight= heat_limit_weight(weight);
- if(weight <= 0.0f)
+ if (weight <= 0.0f)
ED_vgroup_vert_remove(ob, dgrouplist[j], a);
- if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) {
+ if (vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) {
weight= ED_vgroup_vert_weight(ob, dgroupflip[j], vertsflipped[a]);
weight= heat_limit_weight(weight);
- if(weight <= 0.0f)
+ if (weight <= 0.0f)
ED_vgroup_vert_remove(ob, dgroupflip[j], vertsflipped[a]);
}
}
@@ -816,8 +818,8 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
}
/* free */
- if(vertsflipped) MEM_freeN(vertsflipped);
- if(mask) MEM_freeN(mask);
+ if (vertsflipped) MEM_freeN(vertsflipped);
+ if (mask) MEM_freeN(mask);
heat_system_free(sys);
@@ -827,13 +829,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;
@@ -901,7 +903,7 @@ void rigid_deform_iteration()
EditFace *efa;
int a, i;
- if(!sys)
+ if (!sys)
return;
nlMakeCurrent(sys->context);
@@ -911,12 +913,12 @@ void rigid_deform_iteration()
memset(sys->rigid.R, 0, sizeof(float)*3*3*sys->totvert);
memset(sys->rigid.rhs, 0, sizeof(float)*3*sys->totvert);
- for(a=0, efa=em->faces.first; efa; efa=efa->next, a++) {
+ for (a=0, efa=em->faces.first; efa; efa=efa->next, a++) {
rigid_add_edge_to_R(sys, efa->v1, efa->v2, sys->fweights[a][2]);
rigid_add_edge_to_R(sys, efa->v2, efa->v3, sys->fweights[a][0]);
rigid_add_edge_to_R(sys, efa->v3, efa->v1, sys->fweights[a][1]);
- if(efa->v4) {
+ if (efa->v4) {
a++;
rigid_add_edge_to_R(sys, efa->v1, efa->v3, sys->fweights[a][2]);
rigid_add_edge_to_R(sys, efa->v3, efa->v4, sys->fweights[a][0]);
@@ -924,18 +926,18 @@ void rigid_deform_iteration()
}
}
- for(a=0, eve=em->verts.first; eve; eve=eve->next, a++) {
+ for (a=0, eve=em->verts.first; eve; eve=eve->next, a++) {
rigid_orthogonalize_R(sys->rigid.R[a]);
eve->tmp.l= a;
}
/* compute right hand sides for solving */
- for(a=0, efa=em->faces.first; efa; efa=efa->next, a++) {
+ for (a=0, efa=em->faces.first; efa; efa=efa->next, a++) {
rigid_add_edge_to_rhs(sys, efa->v1, efa->v2, sys->fweights[a][2]);
rigid_add_edge_to_rhs(sys, efa->v2, efa->v3, sys->fweights[a][0]);
rigid_add_edge_to_rhs(sys, efa->v3, efa->v1, sys->fweights[a][1]);
- if(efa->v4) {
+ if (efa->v4) {
a++;
rigid_add_edge_to_rhs(sys, efa->v1, efa->v3, sys->fweights[a][2]);
rigid_add_edge_to_rhs(sys, efa->v3, efa->v4, sys->fweights[a][0]);
@@ -944,19 +946,19 @@ void rigid_deform_iteration()
}
/* solve for positions, for X,Y and Z separately */
- for(i=0; i<3; i++) {
+ for (i=0; i<3; i++) {
laplacian_begin_solve(sys, i);
- for(a=0; a<sys->totvert; a++)
- if(!sys->vpinned[a])
+ for (a=0; a<sys->totvert; a++)
+ if (!sys->vpinned[a])
laplacian_add_right_hand_side(sys, a, sys->rigid.rhs[a][i]);
- if(laplacian_system_solve(sys)) {
- for(a=0, eve=em->verts.first; eve; eve=eve->next, a++)
+ if (laplacian_system_solve(sys)) {
+ for (a=0, eve=em->verts.first; eve; eve=eve->next, a++)
eve->co[i]= laplacian_system_get_solution(a);
}
else {
- if(!sys->rigid.thrownerror) {
+ if (!sys->rigid.thrownerror) {
error("RigidDeform: failed to find solution");
sys->rigid.thrownerror= 1;
}
@@ -973,15 +975,15 @@ static void rigid_laplacian_create(LaplacianSystem *sys)
int a;
/* add verts and faces to laplacian */
- for(a=0, eve=em->verts.first; eve; eve=eve->next, a++) {
+ for (a=0, eve=em->verts.first; eve; eve=eve->next, a++) {
laplacian_add_vertex(sys, eve->co, eve->pinned);
eve->tmp.l= a;
}
- for(efa=em->faces.first; efa; efa=efa->next) {
+ for (efa=em->faces.first; efa; efa=efa->next) {
laplacian_add_triangle(sys,
efa->v1->tmp.l, efa->v2->tmp.l, efa->v3->tmp.l);
- if(efa->v4)
+ if (efa->v4)
laplacian_add_triangle(sys,
efa->v1->tmp.l, efa->v3->tmp.l, efa->v4->tmp.l);
}
@@ -995,12 +997,12 @@ void rigid_deform_begin(EditMesh *em)
int a, totvert, totface;
/* count vertices, triangles */
- for(totvert=0, eve=em->verts.first; eve; eve=eve->next)
+ for (totvert=0, eve=em->verts.first; eve; eve=eve->next)
totvert++;
- for(totface=0, efa=em->faces.first; efa; efa=efa->next) {
+ for (totface=0, efa=em->faces.first; efa; efa=efa->next) {
totface++;
- if(efa->v4) totface++;
+ if (efa->v4) totface++;
}
/* create laplacian */
@@ -1011,7 +1013,7 @@ void rigid_deform_begin(EditMesh *em)
sys->rigid.rhs = MEM_callocN(sizeof(float)*3*totvert, "RigidDeformRHS");
sys->rigid.origco = MEM_callocN(sizeof(float)*3*totvert, "RigidDeformCo");
- for(a=0, eve=em->verts.first; eve; eve=eve->next, a++)
+ for (a=0, eve=em->verts.first; eve; eve=eve->next, a++)
copy_v3_v3(sys->rigid.origco[a], eve->co);
sys->areaweights= 0;
@@ -1028,19 +1030,19 @@ void rigid_deform_end(int cancel)
{
LaplacianSystem *sys = RigidDeformSystem;
- if(sys) {
+ if (sys) {
EditMesh *em = sys->rigid.mesh;
EditVert *eve;
int a;
- if(cancel)
- for(a=0, eve=em->verts.first; eve; eve=eve->next, a++)
- if(!eve->pinned)
+ if (cancel)
+ for (a=0, eve=em->verts.first; eve; eve=eve->next, a++)
+ if (!eve->pinned)
copy_v3_v3(eve->co, sys->rigid.origco[a]);
- if(sys->rigid.R) MEM_freeN(sys->rigid.R);
- if(sys->rigid.rhs) MEM_freeN(sys->rigid.rhs);
- if(sys->rigid.origco) MEM_freeN(sys->rigid.origco);
+ if (sys->rigid.R) MEM_freeN(sys->rigid.R);
+ if (sys->rigid.rhs) MEM_freeN(sys->rigid.rhs);
+ if (sys->rigid.origco) MEM_freeN(sys->rigid.origco);
/* free */
laplacian_system_delete(sys);
@@ -1052,8 +1054,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
@@ -1174,10 +1176,10 @@ static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3],
/* check if it is within the length of the line segment */
sub_v3_v3v3(isectdir, isectco, orig);
- if(dot_v3v3(dir, isectdir) < -EPSILON)
+ if (dot_v3v3(dir, isectdir) < -EPSILON)
return 0;
- if(dot_v3v3(dir, dir) + EPSILON < dot_v3v3(isectdir, isectdir))
+ if (dot_v3v3(dir, dir) + EPSILON < dot_v3v3(isectdir, isectdir))
return 0;
return 1;
@@ -1196,16 +1198,16 @@ static int meshdeform_intersect(MeshDeformBind *mdb, MeshDeformIsect *isec)
add_v3_v3v3(end, isec->start, isec->vec);
- for(f=0; f<totface; f++, mface++) {
+ for (f=0; f<totface; f++, mface++) {
copy_v3_v3(face[0], mdb->cagecos[mface->v1]);
copy_v3_v3(face[1], mdb->cagecos[mface->v2]);
copy_v3_v3(face[2], mdb->cagecos[mface->v3]);
- if(mface->v4) {
+ if (mface->v4) {
copy_v3_v3(face[3], mdb->cagecos[mface->v4]);
hit = meshdeform_tri_intersect(isec->start, end, face[0], face[1], face[2], co, uvw);
- if(hit) {
+ if (hit) {
normal_tri_v3( nor,face[0], face[1], face[2]);
}
else {
@@ -1218,9 +1220,9 @@ static int meshdeform_intersect(MeshDeformBind *mdb, MeshDeformIsect *isec)
normal_tri_v3( nor,face[0], face[1], face[2]);
}
- if(hit) {
+ if (hit) {
len= len_v3v3(isec->start, co)/len_v3v3(isec->start, end);
- if(len < isec->labda) {
+ if (len < isec->labda) {
isec->labda= len;
isec->face = mface;
isec->isect= (dot_v3v3(isec->vec, nor) <= 0.0f);
@@ -1249,7 +1251,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float
add_v3_v3v3(end, co2, epsilon);
sub_v3_v3v3(isec.vec, end, isec.start);
- if(meshdeform_intersect(mdb, &isec)) {
+ if (meshdeform_intersect(mdb, &isec)) {
len= isec.labda;
mface=(MFace*)isec.face;
@@ -1262,7 +1264,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float
isect->co[2]= co1[2] + isec.vec[2]*len;
isect->len= len_v3v3(co1, isect->co);
- if(isect->len < MESHDEFORM_LEN_THRESHOLD)
+ if (isect->len < MESHDEFORM_LEN_THRESHOLD)
isect->len= MESHDEFORM_LEN_THRESHOLD;
isect->v[0]= mface->v1;
@@ -1278,7 +1280,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float
copy_v3_v3(vert[0], cagecos[mface->v1]);
copy_v3_v3(vert[1], cagecos[mface->v2]);
copy_v3_v3(vert[2], cagecos[mface->v3]);
- if(mface->v4) copy_v3_v3(vert[3], cagecos[mface->v4]);
+ if (mface->v4) copy_v3_v3(vert[3], cagecos[mface->v4]);
interp_weights_poly_v3( isect->uvw,vert, isect->nvert, isect->co);
return isect;
@@ -1293,7 +1295,7 @@ static int meshdeform_inside_cage(MeshDeformBind *mdb, float *co)
float outside[3], start[3], dir[3];
int i;
- for(i=1; i<=6; i++) {
+ for (i=1; i<=6; i++) {
outside[0] = co[0] + (mdb->max[0] - mdb->min[0] + 1.0f)*MESHDEFORM_OFFSET[i][0];
outside[1] = co[1] + (mdb->max[1] - mdb->min[1] + 1.0f)*MESHDEFORM_OFFSET[i][1];
outside[2] = co[2] + (mdb->max[2] - mdb->min[2] + 1.0f)*MESHDEFORM_OFFSET[i][2];
@@ -1303,7 +1305,7 @@ static int meshdeform_inside_cage(MeshDeformBind *mdb, float *co)
normalize_v3(dir);
isect = meshdeform_ray_tree_intersect(mdb, start, outside);
- if(isect && !isect->facing)
+ if (isect && !isect->facing)
return 1;
}
@@ -1320,11 +1322,11 @@ static int meshdeform_index(MeshDeformBind *mdb, int x, int y, int z, int n)
y += MESHDEFORM_OFFSET[n][1];
z += MESHDEFORM_OFFSET[n][2];
- if(x < 0 || x >= mdb->size)
+ if (x < 0 || x >= mdb->size)
return -1;
- if(y < 0 || y >= mdb->size)
+ if (y < 0 || y >= mdb->size)
return -1;
- if(z < 0 || z >= mdb->size)
+ if (z < 0 || z >= mdb->size)
return -1;
return x + y*size + z*size*size;
@@ -1351,14 +1353,14 @@ static void meshdeform_add_intersections(MeshDeformBind *mdb, int x, int y, int
meshdeform_cell_center(mdb, x, y, z, 0, center);
/* check each outgoing edge for intersection */
- for(i=1; i<=6; i++) {
- if(meshdeform_index(mdb, x, y, z, i) == -1)
+ for (i=1; i<=6; i++) {
+ if (meshdeform_index(mdb, x, y, z, i) == -1)
continue;
meshdeform_cell_center(mdb, x, y, z, i, ncenter);
isect= meshdeform_ray_tree_intersect(mdb, center, ncenter);
- if(isect) {
+ if (isect) {
mdb->boundisect[a][i-1]= isect;
mdb->tag[a]= MESHDEFORM_TAG_BOUNDARY;
}
@@ -1378,18 +1380,18 @@ static void meshdeform_bind_floodfill(MeshDeformBind *mdb)
stacksize= 1;
/* floodfill exterior tag */
- while(stacksize > 0) {
+ while (stacksize > 0) {
a= stack[--stacksize];
xyz[2]= a/(size*size);
xyz[1]= (a - xyz[2]*size*size)/size;
xyz[0]= a - xyz[1]*size - xyz[2]*size*size;
- for(i=1; i<=6; i++) {
+ for (i=1; i<=6; i++) {
b= meshdeform_index(mdb, xyz[0], xyz[1], xyz[2], i);
- if(b != -1) {
- if(tag[b] == MESHDEFORM_TAG_UNTYPED ||
+ if (b != -1) {
+ if (tag[b] == MESHDEFORM_TAG_UNTYPED ||
(tag[b] == MESHDEFORM_TAG_BOUNDARY && !mdb->boundisect[a][i-1])) {
tag[b]= MESHDEFORM_TAG_EXTERIOR;
stack[stacksize++]= b;
@@ -1399,23 +1401,23 @@ static void meshdeform_bind_floodfill(MeshDeformBind *mdb)
}
/* other cells are interior */
- for(a=0; a<size*size*size; a++)
- if(tag[a]==MESHDEFORM_TAG_UNTYPED)
+ for (a=0; a<size*size*size; a++)
+ if (tag[a]==MESHDEFORM_TAG_UNTYPED)
tag[a]= MESHDEFORM_TAG_INTERIOR;
#if 0
{
int tb, ti, te, ts;
tb= ti= te= ts= 0;
- for(a=0; a<size*size*size; a++)
- if(tag[a]==MESHDEFORM_TAG_BOUNDARY)
+ for (a=0; a<size*size*size; a++)
+ if (tag[a]==MESHDEFORM_TAG_BOUNDARY)
tb++;
- else if(tag[a]==MESHDEFORM_TAG_INTERIOR)
+ else if (tag[a]==MESHDEFORM_TAG_INTERIOR)
ti++;
- else if(tag[a]==MESHDEFORM_TAG_EXTERIOR) {
+ else if (tag[a]==MESHDEFORM_TAG_EXTERIOR) {
te++;
- if(mdb->semibound[a])
+ if (mdb->semibound[a])
ts++;
}
@@ -1430,8 +1432,8 @@ static float meshdeform_boundary_phi(MeshDeformBind *UNUSED(mdb), MDefBoundIsect
{
int a;
- for(a=0; a<isect->nvert; a++)
- if(isect->v[a] == cagevert)
+ for (a=0; a<isect->nvert; a++)
+ if (isect->v[a] == cagevert)
return isect->uvw[a];
return 0.0f;
@@ -1443,19 +1445,19 @@ static float meshdeform_interp_w(MeshDeformBind *mdb, float *gridvec, float *UNU
float weight, totweight= 0.0f;
int i, a, x, y, z;
- for(i=0; i<3; i++) {
+ for (i=0; i<3; i++) {
ivec[i]= (int)gridvec[i];
dvec[i]= gridvec[i] - ivec[i];
}
- for(i=0; i<8; i++) {
- if(i & 1) { x= ivec[0]+1; wx= dvec[0]; }
+ for (i=0; i<8; i++) {
+ if (i & 1) { x= ivec[0]+1; wx= dvec[0]; }
else { x= ivec[0]; wx= 1.0f-dvec[0]; }
- if(i & 2) { y= ivec[1]+1; wy= dvec[1]; }
+ if (i & 2) { y= ivec[1]+1; wy= dvec[1]; }
else { y= ivec[1]; wy= 1.0f-dvec[1]; }
- if(i & 4) { z= ivec[2]+1; wz= dvec[2]; }
+ if (i & 4) { z= ivec[2]+1; wz= dvec[2]; }
else { z= ivec[2]; wz= 1.0f-dvec[2]; }
CLAMP(x, 0, mdb->size-1);
@@ -1468,7 +1470,7 @@ static float meshdeform_interp_w(MeshDeformBind *mdb, float *gridvec, float *UNU
totweight += weight;
}
- if(totweight > 0.0f)
+ if (totweight > 0.0f)
result /= totweight;
return result;
@@ -1479,11 +1481,11 @@ static void meshdeform_check_semibound(MeshDeformBind *mdb, int x, int y, int z)
int i, a;
a= meshdeform_index(mdb, x, y, z, 0);
- if(mdb->tag[a] != MESHDEFORM_TAG_EXTERIOR)
+ if (mdb->tag[a] != MESHDEFORM_TAG_EXTERIOR)
return;
- for(i=1; i<=6; i++)
- if(mdb->boundisect[a][i-1])
+ for (i=1; i<=6; i++)
+ if (mdb->boundisect[a][i-1])
mdb->semibound[a]= 1;
}
@@ -1494,14 +1496,14 @@ static float meshdeform_boundary_total_weight(MeshDeformBind *mdb, int x, int y,
a= meshdeform_index(mdb, x, y, z, 0);
- /* count weight for neighbour cells */
- for(i=1; i<=6; i++) {
- if(meshdeform_index(mdb, x, y, z, i) == -1)
+ /* count weight for neighbor cells */
+ for (i=1; i<=6; i++) {
+ if (meshdeform_index(mdb, x, y, z, i) == -1)
continue;
- if(mdb->boundisect[a][i-1])
+ if (mdb->boundisect[a][i-1])
weight= 1.0f/mdb->boundisect[a][i-1]->len;
- else if(!mdb->semibound[a])
+ else if (!mdb->semibound[a])
weight= 1.0f/mdb->width[0];
else
weight= 0.0f;
@@ -1519,15 +1521,15 @@ static void meshdeform_matrix_add_cell(MeshDeformBind *mdb, int x, int y, int z)
int i, a, acenter;
acenter= meshdeform_index(mdb, x, y, z, 0);
- if(mdb->tag[acenter] == MESHDEFORM_TAG_EXTERIOR)
+ if (mdb->tag[acenter] == MESHDEFORM_TAG_EXTERIOR)
return;
nlMatrixAdd(mdb->varidx[acenter], mdb->varidx[acenter], 1.0f);
totweight= meshdeform_boundary_total_weight(mdb, x, y, z);
- for(i=1; i<=6; i++) {
+ for (i=1; i<=6; i++) {
a= meshdeform_index(mdb, x, y, z, i);
- if(a == -1 || mdb->tag[a] == MESHDEFORM_TAG_EXTERIOR)
+ if (a == -1 || mdb->tag[a] == MESHDEFORM_TAG_EXTERIOR)
continue;
isect= mdb->boundisect[acenter][i-1];
@@ -1545,13 +1547,13 @@ static void meshdeform_matrix_add_rhs(MeshDeformBind *mdb, int x, int y, int z,
int i, a, acenter;
acenter= meshdeform_index(mdb, x, y, z, 0);
- if(mdb->tag[acenter] == MESHDEFORM_TAG_EXTERIOR)
+ if (mdb->tag[acenter] == MESHDEFORM_TAG_EXTERIOR)
return;
totweight= meshdeform_boundary_total_weight(mdb, x, y, z);
- for(i=1; i<=6; i++) {
+ for (i=1; i<=6; i++) {
a= meshdeform_index(mdb, x, y, z, i);
- if(a == -1)
+ if (a == -1)
continue;
isect= mdb->boundisect[acenter][i-1];
@@ -1571,13 +1573,13 @@ static void meshdeform_matrix_add_semibound_phi(MeshDeformBind *mdb, int x, int
int i, a;
a= meshdeform_index(mdb, x, y, z, 0);
- if(!mdb->semibound[a])
+ if (!mdb->semibound[a])
return;
mdb->phi[a]= 0.0f;
totweight= meshdeform_boundary_total_weight(mdb, x, y, z);
- for(i=1; i<=6; i++) {
+ for (i=1; i<=6; i++) {
isect= mdb->boundisect[a][i-1];
if (isect) {
@@ -1594,21 +1596,21 @@ static void meshdeform_matrix_add_exterior_phi(MeshDeformBind *mdb, int x, int y
int i, a, acenter;
acenter= meshdeform_index(mdb, x, y, z, 0);
- if(mdb->tag[acenter] != MESHDEFORM_TAG_EXTERIOR || mdb->semibound[acenter])
+ if (mdb->tag[acenter] != MESHDEFORM_TAG_EXTERIOR || mdb->semibound[acenter])
return;
phi= 0.0f;
totweight= 0.0f;
- for(i=1; i<=6; i++) {
+ for (i=1; i<=6; i++) {
a= meshdeform_index(mdb, x, y, z, i);
- if(a != -1 && mdb->semibound[a]) {
+ if (a != -1 && mdb->semibound[a]) {
phi += mdb->phi[a];
totweight += 1.0f;
}
}
- if(totweight != 0.0f)
+ if (totweight != 0.0f)
mdb->phi[acenter]= phi/totweight;
}
@@ -1621,10 +1623,10 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
/* setup variable indices */
mdb->varidx= MEM_callocN(sizeof(int)*mdb->size3, "MeshDeformDSvaridx");
- for(a=0, totvar=0; a<mdb->size3; a++)
+ for (a=0, totvar=0; a<mdb->size3; a++)
mdb->varidx[a]= (mdb->tag[a] == MESHDEFORM_TAG_EXTERIOR)? -1: totvar++;
- if(totvar == 0) {
+ if (totvar == 0) {
MEM_freeN(mdb->varidx);
return;
}
@@ -1643,22 +1645,22 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
nlBegin(NL_MATRIX);
/* build matrix */
- for(z=0; z<mdb->size; z++)
- for(y=0; y<mdb->size; y++)
- for(x=0; x<mdb->size; x++)
+ for (z=0; z<mdb->size; z++)
+ for (y=0; y<mdb->size; y++)
+ for (x=0; x<mdb->size; x++)
meshdeform_matrix_add_cell(mdb, x, y, z);
/* solve for each cage vert */
- for(a=0; a<mdb->totcagevert; a++) {
- if(a != 0) {
+ for (a=0; a<mdb->totcagevert; a++) {
+ if (a != 0) {
nlBegin(NL_SYSTEM);
nlBegin(NL_MATRIX);
}
/* fill in right hand side and solve */
- for(z=0; z<mdb->size; z++)
- for(y=0; y<mdb->size; y++)
- for(x=0; x<mdb->size; x++)
+ for (z=0; z<mdb->size; z++)
+ for (y=0; y<mdb->size; y++)
+ for (x=0; x<mdb->size; x++)
meshdeform_matrix_add_rhs(mdb, x, y, z, a);
nlEnd(NL_MATRIX);
@@ -1668,27 +1670,27 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
nlPrintMatrix();
#endif
- if(nlSolveAdvanced(NULL, NL_TRUE)) {
- for(z=0; z<mdb->size; z++)
- for(y=0; y<mdb->size; y++)
- for(x=0; x<mdb->size; x++)
+ if (nlSolveAdvanced(NULL, NL_TRUE)) {
+ for (z=0; z<mdb->size; z++)
+ for (y=0; y<mdb->size; y++)
+ for (x=0; x<mdb->size; x++)
meshdeform_matrix_add_semibound_phi(mdb, x, y, z, a);
- for(z=0; z<mdb->size; z++)
- for(y=0; y<mdb->size; y++)
- for(x=0; x<mdb->size; x++)
+ for (z=0; z<mdb->size; z++)
+ for (y=0; y<mdb->size; y++)
+ for (x=0; x<mdb->size; x++)
meshdeform_matrix_add_exterior_phi(mdb, x, y, z, a);
- for(b=0; b<mdb->size3; b++) {
- if(mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR)
+ for (b=0; b<mdb->size3; b++) {
+ if (mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR)
mdb->phi[b]= nlGetVariable(0, mdb->varidx[b]);
mdb->totalphi[b] += mdb->phi[b];
}
- if(mdb->weights) {
+ if (mdb->weights) {
/* static bind : compute weights for each vertex */
- for(b=0; b<mdb->totvert; b++) {
- if(mdb->inside[b]) {
+ for (b=0; b<mdb->totvert; b++) {
+ if (mdb->inside[b]) {
copy_v3_v3(vec, mdb->vertexcos[b]);
gridvec[0]= (vec[0] - mdb->min[0] - mdb->halfwidth[0])/mdb->width[0];
gridvec[1]= (vec[1] - mdb->min[1] - mdb->halfwidth[1])/mdb->width[1];
@@ -1702,8 +1704,8 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
MDefBindInfluence *inf;
/* dynamic bind */
- for(b=0; b<mdb->size3; b++) {
- if(mdb->phi[b] >= MESHDEFORM_MIN_INFLUENCE) {
+ for (b=0; b<mdb->size3; b++) {
+ if (mdb->phi[b] >= MESHDEFORM_MIN_INFLUENCE) {
inf= BLI_memarena_alloc(mdb->memarena, sizeof(*inf));
inf->vertex= a;
inf->weight= mdb->phi[b];
@@ -1714,7 +1716,7 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
}
}
else {
- modifier_setError(&mmd->modifier, "Failed to find bind solution (increase precision?).");
+ modifier_setError(&mmd->modifier, "%s", TIP_("Failed to find bind solution (increase precision?)."));
error("Mesh Deform: failed to find bind solution.");
break;
}
@@ -1725,9 +1727,9 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
#if 0
/* sanity check */
- for(b=0; b<mdb->size3; b++)
- if(mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR)
- if(fabs(mdb->totalphi[b] - 1.0f) > 1e-4)
+ for (b=0; b<mdb->size3; b++)
+ if (mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR)
+ if (fabs(mdb->totalphi[b] - 1.0f) > 1e-4)
printf("totalphi deficiency [%s|%d] %d: %.10f\n",
(mdb->tag[b] == MESHDEFORM_TAG_INTERIOR)? "interior": "boundary", mdb->semibound[b], mdb->varidx[b], mdb->totalphi[b]);
#endif
@@ -1749,7 +1751,7 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa
/* compute bounding box of the cage mesh */
INIT_MINMAX(mdb->min, mdb->max);
- for(a=0; a<mdb->totcagevert; a++)
+ for (a=0; a<mdb->totcagevert; a++)
DO_MINMAX(mdb->cagecos[a], mdb->min, mdb->max);
/* allocate memory */
@@ -1763,7 +1765,7 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa
mdb->inside= MEM_callocN(sizeof(int)*mdb->totvert, "MDefInside");
- if(mmd->flag & MOD_MDEF_DYNAMIC_BIND)
+ if (mmd->flag & MOD_MDEF_DYNAMIC_BIND)
mdb->dyngrid= MEM_callocN(sizeof(MDefBindInfluence*)*mdb->size3, "MDefDynGrid");
else
mdb->weights= MEM_callocN(sizeof(float)*mdb->totvert*mdb->totcagevert, "MDefWeights");
@@ -1774,11 +1776,11 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa
/* make bounding box equal size in all directions, add padding, and compute
* width of the cells */
maxwidth = -1.0f;
- for(a=0; a<3; a++)
- if(mdb->max[a]-mdb->min[a] > maxwidth)
+ for (a=0; a<3; a++)
+ if (mdb->max[a]-mdb->min[a] > maxwidth)
maxwidth= mdb->max[a]-mdb->min[a];
- for(a=0; a<3; a++) {
+ for (a=0; a<3; a++) {
center[a]= (mdb->min[a]+mdb->max[a])*0.5f;
mdb->min[a]= center[a] - maxwidth*0.5f;
mdb->max[a]= center[a] + maxwidth*0.5f;
@@ -1794,10 +1796,10 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa
progress_bar(0, "Setting up mesh deform system");
totinside= 0;
- for(a=0; a<mdb->totvert; a++) {
+ for (a=0; a<mdb->totvert; a++) {
copy_v3_v3(vec, mdb->vertexcos[a]);
mdb->inside[a]= meshdeform_inside_cage(mdb, vec);
- if(mdb->inside[a])
+ if (mdb->inside[a])
totinside++;
}
@@ -1806,53 +1808,53 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa
mdb->memarena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "harmonic coords arena");
/* start with all cells untyped */
- for(a=0; a<mdb->size3; a++)
+ for (a=0; a<mdb->size3; a++)
mdb->tag[a]= MESHDEFORM_TAG_UNTYPED;
/* detect intersections and tag boundary cells */
- for(z=0; z<mdb->size; z++)
- for(y=0; y<mdb->size; y++)
- for(x=0; x<mdb->size; x++)
+ for (z=0; z<mdb->size; z++)
+ for (y=0; y<mdb->size; y++)
+ for (x=0; x<mdb->size; x++)
meshdeform_add_intersections(mdb, x, y, z);
/* compute exterior and interior tags */
meshdeform_bind_floodfill(mdb);
- for(z=0; z<mdb->size; z++)
- for(y=0; y<mdb->size; y++)
- for(x=0; x<mdb->size; x++)
+ for (z=0; z<mdb->size; z++)
+ for (y=0; y<mdb->size; y++)
+ for (x=0; x<mdb->size; x++)
meshdeform_check_semibound(mdb, x, y, z);
/* solve */
meshdeform_matrix_solve(mmd, mdb);
/* assign results */
- if(mmd->flag & MOD_MDEF_DYNAMIC_BIND) {
+ if (mmd->flag & MOD_MDEF_DYNAMIC_BIND) {
mmd->totinfluence= 0;
- for(a=0; a<mdb->size3; a++)
- for(inf=mdb->dyngrid[a]; inf; inf=inf->next)
+ for (a=0; a<mdb->size3; a++)
+ for (inf=mdb->dyngrid[a]; inf; inf=inf->next)
mmd->totinfluence++;
/* convert MDefBindInfluences to smaller MDefInfluences */
mmd->dyngrid= MEM_callocN(sizeof(MDefCell)*mdb->size3, "MDefDynGrid");
mmd->dyninfluences= MEM_callocN(sizeof(MDefInfluence)*mmd->totinfluence, "MDefInfluence");
offset= 0;
- for(a=0; a<mdb->size3; a++) {
+ for (a=0; a<mdb->size3; a++) {
cell= &mmd->dyngrid[a];
cell->offset= offset;
totweight= 0.0f;
mdinf= mmd->dyninfluences + cell->offset;
- for(inf=mdb->dyngrid[a]; inf; inf=inf->next, mdinf++) {
+ for (inf=mdb->dyngrid[a]; inf; inf=inf->next, mdinf++) {
mdinf->weight= inf->weight;
mdinf->vertex= inf->vertex;
totweight += mdinf->weight;
cell->totinfluence++;
}
- if(totweight > 0.0f) {
+ if (totweight > 0.0f) {
mdinf= mmd->dyninfluences + cell->offset;
- for(b=0; b<cell->totinfluence; b++, mdinf++)
+ for (b=0; b<cell->totinfluence; b++, mdinf++)
mdinf->weight /= totweight;
}
@@ -1891,9 +1893,9 @@ static void heat_weighting_bind(Scene *scene, DerivedMesh *dm, MeshDeformModifie
mdb->weights= MEM_callocN(sizeof(float)*mdb->totvert*mdb->totcagevert, "MDefWeights");
/* count triangles */
- for(tottri=0, a=0, mf=mface; a<totface; a++, mf++) {
+ for (tottri=0, a=0, mf=mface; a<totface; a++, mf++) {
tottri++;
- if(mf->v4) tottri++;
+ if (mf->v4) tottri++;
}
/* create laplacian */
@@ -1912,27 +1914,27 @@ static void heat_weighting_bind(Scene *scene, DerivedMesh *dm, MeshDeformModifie
laplacian_system_construct_end(sys);
/* compute weights per bone */
- for(j=0; j<mdb->totcagevert; j++) {
+ for (j=0; j<mdb->totcagevert; j++) {
/* fill right hand side */
laplacian_begin_solve(sys, -1);
- for(a=0; a<totvert; a++)
- if(heat_source_closest(sys, a, j))
+ for (a=0; a<totvert; a++)
+ if (heat_source_closest(sys, a, j))
laplacian_add_right_hand_side(sys, a,
sys->heat.H[a]*sys->heat.p[a]);
/* solve */
- if(laplacian_system_solve(sys)) {
+ if (laplacian_system_solve(sys)) {
/* load solution into vertex groups */
- for(a=0; a<totvert; a++) {
+ for (a=0; a<totvert; a++) {
solution= laplacian_system_get_solution(a);
weight= heat_limit_weight(solution);
- if(weight > 0.0f)
+ if (weight > 0.0f)
mdb->weights[a*mdb->totcagevert + j] = weight;
}
}
- else if(!thrownerror) {
+ else if (!thrownerror) {
error("Mesh Deform Heat Weighting:"
" failed to find solution for one or more vertices");
thrownerror= 1;
@@ -1969,14 +1971,14 @@ void mesh_deform_bind(Scene *scene, MeshDeformModifierData *mmd, float *vertexco
copy_m4_m4(mdb.cagemat, cagemat);
mvert= mdb.cagedm->getVertArray(mdb.cagedm);
- for(a=0; a<mdb.totcagevert; a++)
+ for (a=0; a<mdb.totcagevert; a++)
copy_v3_v3(mdb.cagecos[a], mvert[a].co);
- for(a=0; a<mdb.totvert; a++)
+ for (a=0; a<mdb.totvert; a++)
mul_v3_m4v3(mdb.vertexcos[a], mdb.cagemat, vertexcos + a*3);
/* solve */
#if 0
- if(mmd->mode == MOD_MDEF_VOLUME)
+ if (mmd->mode == MOD_MDEF_VOLUME)
harmonic_coordinates_bind(scene, mmd, &mdb);
else
heat_weighting_bind(scene, dm, mmd, &mdb);
@@ -1991,7 +1993,7 @@ void mesh_deform_bind(Scene *scene, MeshDeformModifierData *mmd, float *vertexco
copy_m4_m4(mmd->bindmat, mmd->object->obmat);
/* transform bindcagecos to world space */
- for(a=0; a<mdb.totcagevert; a++)
+ for (a=0; a<mdb.totcagevert; a++)
mul_m4_v3(mmd->object->obmat, mmd->bindcagecos+a*3);
/* free */
diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c
index c28b688e377..be520d1e8a0 100644
--- a/source/blender/editors/armature/poseSlide.c
+++ b/source/blender/editors/armature/poseSlide.c
@@ -159,7 +159,7 @@ static int pose_slide_init (bContext *C, wmOperator *op, short mode)
pso->ob->pose->flag |= POSE_LOCKED;
pso->ob->pose->flag &= ~POSE_DO_UNLOCK;
- /* do basic initialise of RB-BST used for finding keyframes, but leave the filling of it up
+ /* do basic initialize of RB-BST used for finding keyframes, but leave the filling of it up
* to the caller of this (usually only invoke() will do it, to make things more efficient).
*/
BLI_dlrbTree_init(&pso->keys);
@@ -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);
@@ -730,7 +730,7 @@ static int pose_slide_push_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(
{
tPoseSlideOp *pso;
- /* initialise data */
+ /* initialize data */
if (pose_slide_init(C, op, POSESLIDE_PUSH) == 0) {
pose_slide_exit(op);
return OPERATOR_CANCELLED;
@@ -747,7 +747,7 @@ static int pose_slide_push_exec (bContext *C, wmOperator *op)
{
tPoseSlideOp *pso;
- /* initialise data (from RNA-props) */
+ /* initialize data (from RNA-props) */
if (pose_slide_init(C, op, POSESLIDE_PUSH) == 0) {
pose_slide_exit(op);
return OPERATOR_CANCELLED;
@@ -762,19 +762,19 @@ static int pose_slide_push_exec (bContext *C, wmOperator *op)
void POSE_OT_push (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Push Pose";
- ot->idname= "POSE_OT_push";
- ot->description= "Exaggerate the current pose";
+ ot->name = "Push Pose";
+ ot->idname = "POSE_OT_push";
+ ot->description = "Exaggerate the current pose";
/* callbacks */
- ot->exec= pose_slide_push_exec;
- ot->invoke= pose_slide_push_invoke;
- ot->modal= pose_slide_modal;
- ot->cancel= pose_slide_cancel;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_slide_push_exec;
+ ot->invoke = pose_slide_push_invoke;
+ ot->modal = pose_slide_modal;
+ ot->cancel = pose_slide_cancel;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
/* Properties */
pose_slide_opdef_properties(ot);
@@ -787,7 +787,7 @@ static int pose_slide_relax_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED
{
tPoseSlideOp *pso;
- /* initialise data */
+ /* initialize data */
if (pose_slide_init(C, op, POSESLIDE_RELAX) == 0) {
pose_slide_exit(op);
return OPERATOR_CANCELLED;
@@ -804,7 +804,7 @@ static int pose_slide_relax_exec (bContext *C, wmOperator *op)
{
tPoseSlideOp *pso;
- /* initialise data (from RNA-props) */
+ /* initialize data (from RNA-props) */
if (pose_slide_init(C, op, POSESLIDE_RELAX) == 0) {
pose_slide_exit(op);
return OPERATOR_CANCELLED;
@@ -819,19 +819,19 @@ static int pose_slide_relax_exec (bContext *C, wmOperator *op)
void POSE_OT_relax (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Relax Pose";
- ot->idname= "POSE_OT_relax";
- ot->description= "Make the current pose more similar to its surrounding ones";
+ ot->name = "Relax Pose";
+ ot->idname = "POSE_OT_relax";
+ ot->description = "Make the current pose more similar to its surrounding ones";
/* callbacks */
- ot->exec= pose_slide_relax_exec;
- ot->invoke= pose_slide_relax_invoke;
- ot->modal= pose_slide_modal;
- ot->cancel= pose_slide_cancel;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_slide_relax_exec;
+ ot->invoke = pose_slide_relax_invoke;
+ ot->modal = pose_slide_modal;
+ ot->cancel = pose_slide_cancel;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
/* Properties */
pose_slide_opdef_properties(ot);
@@ -844,7 +844,7 @@ static int pose_slide_breakdown_invoke (bContext *C, wmOperator *op, wmEvent *UN
{
tPoseSlideOp *pso;
- /* initialise data */
+ /* initialize data */
if (pose_slide_init(C, op, POSESLIDE_BREAKDOWN) == 0) {
pose_slide_exit(op);
return OPERATOR_CANCELLED;
@@ -861,7 +861,7 @@ static int pose_slide_breakdown_exec (bContext *C, wmOperator *op)
{
tPoseSlideOp *pso;
- /* initialise data (from RNA-props) */
+ /* initialize data (from RNA-props) */
if (pose_slide_init(C, op, POSESLIDE_BREAKDOWN) == 0) {
pose_slide_exit(op);
return OPERATOR_CANCELLED;
@@ -876,19 +876,19 @@ static int pose_slide_breakdown_exec (bContext *C, wmOperator *op)
void POSE_OT_breakdown (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Pose Breakdowner";
- ot->idname= "POSE_OT_breakdown";
- ot->description= "Create a suitable breakdown pose on the current frame";
+ ot->name = "Pose Breakdowner";
+ ot->idname = "POSE_OT_breakdown";
+ ot->description = "Create a suitable breakdown pose on the current frame";
/* callbacks */
- ot->exec= pose_slide_breakdown_exec;
- ot->invoke= pose_slide_breakdown_invoke;
- ot->modal= pose_slide_modal;
- ot->cancel= pose_slide_cancel;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_slide_breakdown_exec;
+ ot->invoke = pose_slide_breakdown_invoke;
+ ot->modal = pose_slide_modal;
+ ot->cancel = pose_slide_cancel;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
/* Properties */
pose_slide_opdef_properties(ot);
@@ -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);
@@ -1102,7 +1102,7 @@ static void pose_propagate_fcurve (wmOperator *op, Object *ob, FCurve *fcu,
* doesn't need to firstly keyframe the pose (though this doesn't mean that
* they can't either)
*/
- if( !pose_propagate_get_refVal(ob, fcu, &refVal))
+ if ( !pose_propagate_get_refVal(ob, fcu, &refVal))
return;
/* find the first keyframe to start propagating from
@@ -1231,7 +1231,7 @@ static int pose_propagate_exec (bContext *C, wmOperator *op)
void POSE_OT_propagate (wmOperatorType *ot)
{
static EnumPropertyItem terminate_items[]= {
- {POSE_PROPAGATE_SMART_HOLDS, "WHILE_HELD", 0, "While Held", "Propagate pose to all keyframes after current frame that don't change (Default behaviour)"},
+ {POSE_PROPAGATE_SMART_HOLDS, "WHILE_HELD", 0, "While Held", "Propagate pose to all keyframes after current frame that don't change (Default behavior)"},
{POSE_PROPAGATE_NEXT_KEY, "NEXT_KEY", 0, "To Next Keyframe", "Propagate pose to first keyframe following the current frame only"},
{POSE_PROPAGATE_LAST_KEY, "LAST_KEY", 0, "To Last Keyframe", "Propagate pose to the last keyframe only (i.e. making action cyclic)"},
{POSE_PROPAGATE_BEFORE_FRAME, "BEFORE_FRAME", 0, "Before Frame", "Propagate pose to all keyframes between current frame and 'Frame' property"},
@@ -1240,20 +1240,20 @@ void POSE_OT_propagate (wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Propagate Pose";
- ot->idname= "POSE_OT_propagate";
- ot->description= "Copy selected aspects of the current pose to subsequent poses already keyframed";
+ ot->name = "Propagate Pose";
+ ot->idname = "POSE_OT_propagate";
+ ot->description = "Copy selected aspects of the current pose to subsequent poses already keyframed";
/* callbacks */
- ot->exec= pose_propagate_exec;
- ot->poll= ED_operator_posemode; // XXX: needs selected bones!
+ ot->exec = pose_propagate_exec;
+ ot->poll = ED_operator_posemode; // XXX: needs selected bones!
/* flag */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
// TODO: add "fade out" control for tapering off amount of propagation as time goes by?
- ot->prop= RNA_def_enum(ot->srna, "mode", terminate_items, POSE_PROPAGATE_SMART_HOLDS, "Terminate Mode", "Method used to determine when to stop propagating pose to keyframes");
+ ot->prop = RNA_def_enum(ot->srna, "mode", terminate_items, POSE_PROPAGATE_SMART_HOLDS, "Terminate Mode", "Method used to determine when to stop propagating pose to keyframes");
RNA_def_float(ot->srna, "end_frame", 250.0, FLT_MIN, FLT_MAX, "End Frame", "Frame to stop propagating frames to (for 'Before Frame' mode)", 1.0, 250.0);
}
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index 5ce44cb7a58..fbe05d7ef49 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -186,7 +186,7 @@ static int has_poselib_pose_data_poll (bContext *C)
/* ----------------------------------- */
-/* Initialise a new poselib (whether it is needed or not) */
+/* Initialize a new poselib (whether it is needed or not) */
static bAction *poselib_init_new (Object *ob)
{
/* sanity checks - only for armatures */
@@ -201,7 +201,7 @@ static bAction *poselib_init_new (Object *ob)
return ob->poselib;
}
-/* Initialise a new poselib (checks if that needs to happen) */
+/* Initialize a new poselib (checks if that needs to happen) */
static bAction *poselib_validate (Object *ob)
{
if (ELEM(NULL, ob, ob->pose))
@@ -241,10 +241,10 @@ void POSELIB_OT_new (wmOperatorType *ot)
/* callbacks */
ot->exec = poselib_new_exec;
- ot->poll= ED_operator_posemode;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ------------------------------------------------ */
@@ -276,10 +276,10 @@ void POSELIB_OT_unlink (wmOperatorType *ot)
/* callbacks */
ot->exec = poselib_unlink_exec;
- ot->poll= has_poselib_pose_data_poll;
+ ot->poll = has_poselib_pose_data_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ************************************************************* */
@@ -365,7 +365,7 @@ void POSELIB_OT_action_sanitise (wmOperatorType *ot)
ot->poll = has_poselib_pose_data_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ------------------------------------------ */
@@ -486,17 +486,17 @@ static int poselib_add_exec (bContext *C, wmOperator *op)
void POSELIB_OT_pose_add (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "PoseLib Add Pose";
- ot->idname= "POSELIB_OT_pose_add";
- ot->description= "Add the current Pose to the active Pose Library";
+ ot->name = "PoseLib Add Pose";
+ ot->idname = "POSELIB_OT_pose_add";
+ ot->description = "Add the current Pose to the active Pose Library";
/* api callbacks */
- ot->invoke= poselib_add_menu_invoke;
- ot->exec= poselib_add_exec;
- ot->poll= ED_operator_posemode;
+ ot->invoke = poselib_add_menu_invoke;
+ ot->exec = poselib_add_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_int(ot->srna, "frame", 1, 0, INT_MAX, "Frame", "Frame to store pose on", 0, INT_MAX);
@@ -592,22 +592,22 @@ void POSELIB_OT_pose_remove (wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "PoseLib Remove Pose";
- ot->idname= "POSELIB_OT_pose_remove";
- ot->description= "Remove nth pose from the active Pose Library";
+ ot->name = "PoseLib Remove Pose";
+ ot->idname = "POSELIB_OT_pose_remove";
+ ot->description = "Remove nth pose from the active Pose Library";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= poselib_remove_exec;
- ot->poll= has_poselib_pose_data_poll;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = poselib_remove_exec;
+ ot->poll = has_poselib_pose_data_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
prop= RNA_def_enum(ot->srna, "pose", DummyRNA_DEFAULT_items, 0, "Pose", "The pose to remove");
RNA_def_enum_funcs(prop, poselib_stored_pose_itemf);
- ot->prop= prop;
+ ot->prop = prop;
}
static int poselib_rename_invoke (bContext *C, wmOperator *op, wmEvent *evt)
@@ -682,21 +682,21 @@ void POSELIB_OT_pose_rename (wmOperatorType *ot)
};
/* identifiers */
- ot->name= "PoseLib Rename Pose";
- ot->idname= "POSELIB_OT_pose_rename";
- ot->description= "Rename specified pose from the active Pose Library";
+ ot->name = "PoseLib Rename Pose";
+ ot->idname = "POSELIB_OT_pose_rename";
+ ot->description = "Rename specified pose from the active Pose Library";
/* api callbacks */
- ot->invoke= poselib_rename_invoke;
- ot->exec= poselib_rename_exec;
- ot->poll= has_poselib_pose_data_poll;
+ ot->invoke = poselib_rename_invoke;
+ ot->exec = poselib_rename_exec;
+ ot->poll = has_poselib_pose_data_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
/* NOTE: name not pose is the operator's "main" property, so that it will get activated in the popup for easy renaming */
- ot->prop= RNA_def_string(ot->srna, "name", "RenamedPose", 64, "New Pose Name", "New name for pose");
+ ot->prop = RNA_def_string(ot->srna, "name", "RenamedPose", 64, "New Pose Name", "New name for pose");
prop= RNA_def_enum(ot->srna, "pose", prop_poses_dummy_types, 0, "Pose", "The pose to rename");
RNA_def_enum_funcs(prop, poselib_stored_pose_itemf);
}
@@ -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);
@@ -1613,23 +1613,23 @@ static int poselib_preview_exec (bContext *C, wmOperator *op)
void POSELIB_OT_browse_interactive (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "PoseLib Browse Poses";
- ot->idname= "POSELIB_OT_browse_interactive";
- ot->description= "Interactively browse poses in 3D-View";
+ ot->name = "PoseLib Browse Poses";
+ ot->idname = "POSELIB_OT_browse_interactive";
+ ot->description = "Interactively browse poses in 3D-View";
/* callbacks */
- ot->invoke= poselib_preview_invoke;
- ot->modal= poselib_preview_modal;
- ot->cancel= poselib_preview_cancel;
- ot->exec= poselib_preview_exec;
- ot->poll= has_poselib_pose_data_poll;
+ ot->invoke = poselib_preview_invoke;
+ ot->modal = poselib_preview_modal;
+ ot->cancel = poselib_preview_cancel;
+ ot->exec = poselib_preview_exec;
+ ot->poll = has_poselib_pose_data_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
/* properties */
// TODO: make the pose_index into a proper enum instead of a cryptic int...
- ot->prop= RNA_def_int(ot->srna, "pose_index", -1, -2, INT_MAX, "Pose", "Index of the pose to apply (-2 for no change to pose, -1 for poselib active pose)", 0, INT_MAX);
+ ot->prop = RNA_def_int(ot->srna, "pose_index", -1, -2, INT_MAX, "Pose", "Index of the pose to apply (-2 for no change to pose, -1 for poselib active pose)", 0, INT_MAX);
// XXX: percentage vs factor?
/* not used yet */
@@ -1644,13 +1644,13 @@ void POSELIB_OT_apply_pose (wmOperatorType *ot)
ot->description = "Apply specified Pose Library pose to the rig";
/* callbacks */
- ot->exec= poselib_preview_exec;
- ot->poll= has_poselib_pose_data_poll;
+ ot->exec = poselib_preview_exec;
+ ot->poll = has_poselib_pose_data_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
// TODO: make the pose_index into a proper enum instead of a cryptic int...
- ot->prop= RNA_def_int(ot->srna, "pose_index", -1, -2, INT_MAX, "Pose", "Index of the pose to apply (-2 for no change to pose, -1 for poselib active pose)", 0, INT_MAX);
+ ot->prop = RNA_def_int(ot->srna, "pose_index", -1, -2, INT_MAX, "Pose", "Index of the pose to apply (-2 for no change to pose, -1 for poselib active pose)", 0, INT_MAX);
}
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index dc4af18be11..6768c884868 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -109,7 +109,7 @@ void ED_armature_enter_posemode(bContext *C, Base *base)
void ED_armature_exit_posemode(bContext *C, Base *base)
{
- if(base) {
+ if (base) {
Object *ob= base->object;
ob->restore_mode = ob->mode;
@@ -154,18 +154,18 @@ static int pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan, int level)
/* No need to check if constraint is active (has influence),
* since all constraints with CONSTRAINT_IK_AUTO are active */
- for(con= pchan->constraints.first; con; con= con->next) {
- if(con->type==CONSTRAINT_TYPE_KINEMATIC) {
+ for (con= pchan->constraints.first; con; con= con->next) {
+ if (con->type==CONSTRAINT_TYPE_KINEMATIC) {
bKinematicConstraint *data= con->data;
- if(data->rootbone == 0 || data->rootbone > level) {
- if((data->flag & CONSTRAINT_IK_AUTO)==0)
+ if (data->rootbone == 0 || data->rootbone > level) {
+ if ((data->flag & CONSTRAINT_IK_AUTO)==0)
return 1;
}
}
}
- for(bone= pchan->bone->childbase.first; bone; bone= bone->next) {
+ for (bone= pchan->bone->childbase.first; bone; bone= bone->next) {
pchan= get_pose_channel(ob->pose, bone->name);
- if(pchan && pose_channel_in_IK_chain(ob, pchan, level + 1))
+ if (pchan && pose_channel_in_IK_chain(ob, pchan, level + 1))
return 1;
}
return 0;
@@ -236,16 +236,16 @@ static int pose_calculate_paths_exec (bContext *C, wmOperator *op)
void POSE_OT_paths_calculate (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Calculate Bone Paths";
- ot->idname= "POSE_OT_paths_calculate";
- ot->description= "Calculate paths for the selected bones";
+ ot->name = "Calculate Bone Paths";
+ ot->idname = "POSE_OT_paths_calculate";
+ ot->description = "Calculate paths for the selected bones";
/* api callbacks */
- ot->exec= pose_calculate_paths_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_calculate_paths_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* --------- */
@@ -256,7 +256,7 @@ static void ED_pose_clear_paths(Object *ob)
bPoseChannel *pchan;
short skipped = 0;
- if ELEM(NULL, ob, ob->pose)
+ if (ELEM(NULL, ob, ob->pose))
return;
/* free the motionpath blocks, but also take note of whether we skipped some... */
@@ -289,7 +289,7 @@ static int pose_clear_paths_exec (bContext *C, wmOperator *UNUSED(op))
ob= object_pose_armature_get(CTX_data_active_object(C));
/* only continue if there's an object */
- if ELEM(NULL, ob, ob->pose)
+ if (ELEM(NULL, ob, ob->pose))
return OPERATOR_CANCELLED;
/* use the backend function for this */
@@ -304,13 +304,13 @@ static int pose_clear_paths_exec (bContext *C, wmOperator *UNUSED(op))
void POSE_OT_paths_clear (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Bone Paths";
- ot->idname= "POSE_OT_paths_clear";
- ot->description= "Clear path caches for selected bones";
+ ot->name = "Clear Bone Paths";
+ ot->idname = "POSE_OT_paths_clear";
+ ot->description = "Clear path caches for selected bones";
/* api callbacks */
- ot->exec= pose_clear_paths_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_clear_paths_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -338,7 +338,7 @@ static int pose_select_constraint_target_exec(bContext *C, wmOperator *UNUSED(op
for (ct= targets.first; ct; ct= ct->next) {
if ((ct->tar == ob) && (ct->subtarget[0])) {
bPoseChannel *pchanc= get_pose_channel(ob->pose, ct->subtarget);
- if((pchanc) && !(pchanc->bone->flag & BONE_UNSELECTABLE)) {
+ if ((pchanc) && !(pchanc->bone->flag & BONE_UNSELECTABLE)) {
pchanc->bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
found= 1;
}
@@ -364,16 +364,16 @@ static int pose_select_constraint_target_exec(bContext *C, wmOperator *UNUSED(op
void POSE_OT_select_constraint_target(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Constraint Target";
- ot->idname= "POSE_OT_select_constraint_target";
- ot->description= "Select bones used as targets for the currently selected bones";
+ ot->name = "Select Constraint Target";
+ ot->idname = "POSE_OT_select_constraint_target";
+ ot->description = "Select bones used as targets for the currently selected bones";
/* api callbacks */
- ot->exec= pose_select_constraint_target_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_select_constraint_target_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************* select hierarchy operator ************* */
@@ -441,19 +441,19 @@ void POSE_OT_select_hierarchy(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Select Hierarchy";
- ot->idname= "POSE_OT_select_hierarchy";
- ot->description= "Select immediate parent/children of selected bones";
+ ot->name = "Select Hierarchy";
+ ot->idname = "POSE_OT_select_hierarchy";
+ ot->description = "Select immediate parent/children of selected bones";
/* api callbacks */
- ot->exec= pose_select_hierarchy_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_select_hierarchy_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- ot->prop= RNA_def_enum(ot->srna, "direction", direction_items, BONE_SELECT_PARENT, "Direction", "");
+ ot->prop = RNA_def_enum(ot->srna, "direction", direction_items, BONE_SELECT_PARENT, "Direction", "");
RNA_def_boolean(ot->srna, "extend", 0, "Add to Selection", "");
}
@@ -497,7 +497,7 @@ static short pose_select_same_group (bContext *C, Object *ob, short extend)
}
CTX_DATA_END;
- /* small optimisation: only loop through bones a second time if there are any groups tagged */
+ /* small optimization: only loop through bones a second time if there are any groups tagged */
if (tagged) {
/* only if group matches (and is not selected or current bone) */
CTX_DATA_BEGIN(C, bPoseChannel *, pchan, visible_pose_bones)
@@ -661,21 +661,21 @@ void POSE_OT_select_grouped (wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Select Grouped";
+ ot->name = "Select Grouped";
ot->description = "Select all visible bones grouped by similar properties";
- ot->idname= "POSE_OT_select_grouped";
+ ot->idname = "POSE_OT_select_grouped";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= pose_select_grouped_exec;
- ot->poll= ED_operator_posemode;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = pose_select_grouped_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
- ot->prop= RNA_def_enum(ot->srna, "type", prop_select_grouped_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_select_grouped_types, 0, "Type", "");
}
@@ -687,23 +687,23 @@ static int pose_bone_flip_active_exec (bContext *C, wmOperator *UNUSED(op))
Object *ob_act= CTX_data_active_object(C);
Object *ob= object_pose_armature_get(ob_act);
- if(ob && (ob->mode & OB_MODE_POSE)) {
+ if (ob && (ob->mode & OB_MODE_POSE)) {
bArmature *arm= ob->data;
- if(arm->act_bone) {
+ if (arm->act_bone) {
bPoseChannel *pchanf;
char name[MAXBONENAME];
flip_side_name(name, arm->act_bone->name, TRUE);
pchanf= get_pose_channel(ob->pose, name);
- if(pchanf && pchanf->bone != arm->act_bone) {
+ if (pchanf && pchanf->bone != arm->act_bone) {
arm->act_bone->flag &= ~BONE_SELECTED;
pchanf->bone->flag |= BONE_SELECTED;
arm->act_bone= pchanf->bone;
/* in weightpaint we select the associated vertex group too */
- if(ob_act->mode & OB_MODE_WEIGHT_PAINT) {
+ if (ob_act->mode & OB_MODE_WEIGHT_PAINT) {
ED_vgroup_select_by_name(ob_act, name);
DAG_id_tag_update(&ob_act->id, OB_RECALC_DATA);
}
@@ -721,13 +721,13 @@ static int pose_bone_flip_active_exec (bContext *C, wmOperator *UNUSED(op))
void POSE_OT_select_flip_active(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Flip Selected Active Bone";
- ot->idname= "POSE_OT_select_flip_active";
- ot->description= "Activate the bone with a flipped name";
+ ot->name = "Flip Selected Active Bone";
+ ot->idname = "POSE_OT_select_flip_active";
+ ot->description = "Activate the bone with a flipped name";
/* api callbacks */
- ot->exec= pose_bone_flip_active_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_bone_flip_active_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -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)) {
@@ -876,7 +876,7 @@ static void pose_copy_menu(Scene *scene)
BLI_duplicatelist(&const_copy, &(pchanact->constraints));
/* build the puplist of constraints */
- for (con = pchanact->constraints.first, i=0; con; con=con->next, i++){
+ for (con = pchanact->constraints.first, i=0; con; con=con->next, i++) {
const_toggle[i]= 1;
// add_numbut(i, TOG|INT, con->name, 0, 0, &(const_toggle[i]), "");
}
@@ -946,7 +946,7 @@ void free_posebuf(void)
bPoseChannel *pchan;
for (pchan= g_posebuf->chanbase.first; pchan; pchan= pchan->next) {
- if(pchan->prop) {
+ if (pchan->prop) {
IDP_FreeProperty(pchan->prop);
MEM_freeN(pchan->prop);
}
@@ -968,8 +968,8 @@ static void set_pose_keys (Object *ob)
bArmature *arm= ob->data;
bPoseChannel *chan;
- if (ob->pose){
- for (chan=ob->pose->chanbase.first; chan; chan=chan->next){
+ if (ob->pose) {
+ for (chan=ob->pose->chanbase.first; chan; chan=chan->next) {
Bone *bone= chan->bone;
if ((bone) && (bone->flag & BONE_SELECTED) && (arm->layer & bone->layer))
chan->flag |= POSE_KEY;
@@ -1110,7 +1110,7 @@ static int pose_copy_exec (bContext *C, wmOperator *op)
Object *ob= object_pose_armature_get(CTX_data_active_object(C));
/* sanity checking */
- if ELEM(NULL, ob, ob->pose) {
+ if (ELEM(NULL, ob, ob->pose)) {
BKE_report(op->reports, RPT_ERROR, "No Pose to Copy");
return OPERATOR_CANCELLED;
}
@@ -1129,16 +1129,16 @@ static int pose_copy_exec (bContext *C, wmOperator *op)
void POSE_OT_copy (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Pose";
- ot->idname= "POSE_OT_copy";
- ot->description= "Copies the current pose of the selected bones to copy/paste buffer";
+ ot->name = "Copy Pose";
+ ot->idname = "POSE_OT_copy";
+ ot->description = "Copies the current pose of the selected bones to copy/paste buffer";
/* api callbacks */
- ot->exec= pose_copy_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_copy_exec;
+ ot->poll = ED_operator_posemode;
/* flag */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
}
/* ---- */
@@ -1155,7 +1155,7 @@ static int pose_paste_exec (bContext *C, wmOperator *op)
KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_LOC_ROT_SCALE_ID);
/* sanity checks */
- if ELEM(NULL, ob, ob->pose)
+ if (ELEM(NULL, ob, ob->pose))
return OPERATOR_CANCELLED;
if (g_posebuf == NULL) {
@@ -1164,7 +1164,7 @@ static int pose_paste_exec (bContext *C, wmOperator *op)
}
/* if selOnly option is enabled, if user hasn't selected any bones,
- * just go back to default behaviour to be more in line with other pose tools
+ * just go back to default behavior to be more in line with other pose tools
*/
if (selOnly) {
if (CTX_DATA_COUNT(C, selected_pose_bones) == 0)
@@ -1196,16 +1196,16 @@ static int pose_paste_exec (bContext *C, wmOperator *op)
void POSE_OT_paste (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Paste Pose";
- ot->idname= "POSE_OT_paste";
- ot->description= "Paste the stored pose on to the current pose";
+ ot->name = "Paste Pose";
+ ot->idname = "POSE_OT_paste";
+ ot->description = "Paste the stored pose on to the current pose";
/* api callbacks */
- ot->exec= pose_paste_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_paste_exec;
+ ot->poll = ED_operator_posemode;
/* flag */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "flipped", FALSE, "Flipped on X-Axis", "Paste the stored pose flipped on to current pose");
@@ -1242,13 +1242,13 @@ static int pose_group_add_exec (bContext *C, wmOperator *UNUSED(op))
void POSE_OT_group_add (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Bone Group";
- ot->idname= "POSE_OT_group_add";
- ot->description= "Add a new bone group";
+ ot->name = "Add Bone Group";
+ ot->idname = "POSE_OT_group_add";
+ ot->description = "Add a new bone group";
/* api callbacks */
- ot->exec= pose_group_add_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_group_add_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1282,13 +1282,13 @@ static int pose_group_remove_exec (bContext *C, wmOperator *UNUSED(op))
void POSE_OT_group_remove (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Bone Group";
- ot->idname= "POSE_OT_group_remove";
- ot->description= "Removes the active bone group";
+ ot->name = "Remove Bone Group";
+ ot->idname = "POSE_OT_group_remove";
+ ot->description = "Removes the active bone group";
/* api callbacks */
- ot->exec= pose_group_remove_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_group_remove_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1397,14 +1397,14 @@ static int pose_group_assign_exec (bContext *C, wmOperator *op)
void POSE_OT_group_assign (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Selected to Bone Group";
- ot->idname= "POSE_OT_group_assign";
- ot->description= "Add selected bones to the chosen bone group";
+ ot->name = "Add Selected to Bone Group";
+ ot->idname = "POSE_OT_group_assign";
+ ot->description = "Add selected bones to the chosen bone group";
/* api callbacks */
- ot->invoke= pose_groups_menu_invoke;
- ot->exec= pose_group_assign_exec;
- ot->poll= ED_operator_posemode;
+ ot->invoke = pose_groups_menu_invoke;
+ ot->exec = pose_group_assign_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1453,13 +1453,13 @@ static int pose_group_unassign_exec (bContext *C, wmOperator *UNUSED(op))
void POSE_OT_group_unassign (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Selected from Bone Groups";
- ot->idname= "POSE_OT_group_unassign";
- ot->description= "Remove selected bones from all bone groups";
+ ot->name = "Remove Selected from Bone Groups";
+ ot->idname = "POSE_OT_group_unassign";
+ ot->description = "Remove selected bones from all bone groups";
/* api callbacks */
- ot->exec= pose_group_unassign_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_group_unassign_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1534,16 +1534,16 @@ void POSE_OT_group_move(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Move Bone Group";
- ot->idname= "POSE_OT_group_move";
- ot->description= "Change position of active Bone Group in list of Bone Groups";
+ ot->name = "Move Bone Group";
+ ot->idname = "POSE_OT_group_move";
+ ot->description = "Change position of active Bone Group in list of Bone Groups";
/* api callbacks */
- ot->exec= group_move_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = group_move_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "direction", group_slot_move, 0, "Direction", "Direction to move, UP or DOWN");
}
@@ -1618,16 +1618,16 @@ static int group_sort_exec(bContext *C, wmOperator *UNUSED(op))
void POSE_OT_group_sort(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Sort Bone Groups";
- ot->idname= "POSE_OT_group_sort";
- ot->description= "Sort Bone Groups by their names in ascending order";
+ ot->name = "Sort Bone Groups";
+ ot->idname = "POSE_OT_group_sort";
+ ot->description = "Sort Bone Groups by their names in ascending order";
/* api callbacks */
- ot->exec= group_sort_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = group_sort_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static void pose_group_select(bContext *C, Object *ob, int select)
@@ -1676,13 +1676,13 @@ static int pose_group_select_exec (bContext *C, wmOperator *UNUSED(op))
void POSE_OT_group_select (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Bones of Bone Group";
- ot->idname= "POSE_OT_group_select";
- ot->description= "Select bones in active Bone Group";
+ ot->name = "Select Bones of Bone Group";
+ ot->idname = "POSE_OT_group_select";
+ ot->description = "Select bones in active Bone Group";
/* api callbacks */
- ot->exec= pose_group_select_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_group_select_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1714,13 +1714,13 @@ static int pose_group_deselect_exec (bContext *C, wmOperator *UNUSED(op))
void POSE_OT_group_deselect (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Deselect Bone Group";
- ot->idname= "POSE_OT_group_deselect";
- ot->description= "Deselect bones of active Bone Group";
+ ot->name = "Deselect Bone Group";
+ ot->idname = "POSE_OT_group_deselect";
+ ot->description = "Deselect bones of active Bone Group";
/* api callbacks */
- ot->exec= pose_group_deselect_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_group_deselect_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1759,16 +1759,16 @@ static int pose_flip_names_exec (bContext *C, wmOperator *UNUSED(op))
void POSE_OT_flip_names (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Flip Names";
- ot->idname= "POSE_OT_flip_names";
- ot->description= "Flips (and corrects) the axis suffixes of the the names of selected bones";
+ ot->name = "Flip Names";
+ ot->idname = "POSE_OT_flip_names";
+ ot->description = "Flips (and corrects) the axis suffixes of the the names of selected bones";
/* api callbacks */
- ot->exec= pose_flip_names_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_flip_names_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ------------------ */
@@ -1789,7 +1789,7 @@ static int pose_autoside_names_exec (bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones)
{
BLI_strncpy(newname, pchan->name, sizeof(newname));
- if(bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis]))
+ if (bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis]))
ED_armature_bone_rename(arm, pchan->name, newname);
}
CTX_DATA_END;
@@ -1812,20 +1812,20 @@ void POSE_OT_autoside_names (wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "AutoName by Axis";
- ot->idname= "POSE_OT_autoside_names";
- ot->description= "Automatically renames the selected bones according to which side of the target axis they fall on";
+ ot->name = "AutoName by Axis";
+ ot->idname = "POSE_OT_autoside_names";
+ ot->description = "Automatically renames the selected bones according to which side of the target axis they fall on";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= pose_autoside_names_exec;
- ot->poll= ED_operator_posemode;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = pose_autoside_names_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* settings */
- ot->prop= RNA_def_enum(ot->srna, "axis", axis_items, 0, "Axis", "Axis tag names with");
+ ot->prop = RNA_def_enum(ot->srna, "axis", axis_items, 0, "Axis", "Axis tag names with");
}
/* ********************************************** */
@@ -1852,20 +1852,20 @@ static int pose_bone_rotmode_exec (bContext *C, wmOperator *op)
void POSE_OT_rotation_mode_set (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Rotation Mode";
- ot->idname= "POSE_OT_rotation_mode_set";
- ot->description= "Set the rotation representation used by selected bones";
+ ot->name = "Set Rotation Mode";
+ ot->idname = "POSE_OT_rotation_mode_set";
+ ot->description = "Set the rotation representation used by selected bones";
/* callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= pose_bone_rotmode_exec;
- ot->poll= ED_operator_posemode;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = pose_bone_rotmode_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", posebone_rotmode_items, 0, "Rotation Mode", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", posebone_rotmode_items, 0, "Rotation Mode", "");
}
/* ********************************************** */
@@ -1911,16 +1911,16 @@ static int pose_armature_layers_showall_exec (bContext *C, wmOperator *op)
void ARMATURE_OT_layers_show_all (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Show All Layers";
- ot->idname= "ARMATURE_OT_layers_show_all";
- ot->description= "Make all armature layers visible";
+ ot->name = "Show All Layers";
+ ot->idname = "ARMATURE_OT_layers_show_all";
+ ot->description = "Make all armature layers visible";
/* callbacks */
- ot->exec= pose_armature_layers_showall_exec;
- ot->poll= pose_armature_layers_showall_poll;
+ ot->exec = pose_armature_layers_showall_exec;
+ ot->poll = pose_armature_layers_showall_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
ot->prop = RNA_def_boolean(ot->srna, "all", 1, "All Layers", "Enable all layers or just the first 16 (top row)");
@@ -1977,17 +1977,17 @@ static int pose_armature_layers_exec (bContext *C, wmOperator *op)
void POSE_OT_armature_layers (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Change Armature Layers";
- ot->idname= "POSE_OT_armature_layers";
- ot->description= "Change the visible armature layers";
+ ot->name = "Change Armature Layers";
+ ot->idname = "POSE_OT_armature_layers";
+ ot->description = "Change the visible armature layers";
/* callbacks */
- ot->invoke= pose_armature_layers_invoke;
- ot->exec= pose_armature_layers_exec;
- ot->poll= ED_operator_posemode;
+ ot->invoke = pose_armature_layers_invoke;
+ ot->exec = pose_armature_layers_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean_layer_member(ot->srna, "layers", 32, NULL, "Layer", "Armature layers to make visible");
@@ -1996,17 +1996,17 @@ void POSE_OT_armature_layers (wmOperatorType *ot)
void ARMATURE_OT_armature_layers (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Change Armature Layers";
- ot->idname= "ARMATURE_OT_armature_layers";
- ot->description= "Change the visible armature layers";
+ ot->name = "Change Armature Layers";
+ ot->idname = "ARMATURE_OT_armature_layers";
+ ot->description = "Change the visible armature layers";
/* callbacks */
- ot->invoke= pose_armature_layers_invoke;
- ot->exec= pose_armature_layers_exec;
- ot->poll= ED_operator_editarmature;
+ ot->invoke = pose_armature_layers_invoke;
+ ot->exec = pose_armature_layers_exec;
+ ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean_layer_member(ot->srna, "layers", 32, NULL, "Layer", "Armature layers to make visible");
@@ -2046,7 +2046,7 @@ static int pose_bone_layers_exec (bContext *C, wmOperator *op)
PointerRNA ptr;
int layers[32]; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */
- if(ob==NULL || ob->data==NULL) {
+ if (ob==NULL || ob->data==NULL) {
return OPERATOR_CANCELLED;
}
@@ -2071,17 +2071,17 @@ static int pose_bone_layers_exec (bContext *C, wmOperator *op)
void POSE_OT_bone_layers (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Change Bone Layers";
- ot->idname= "POSE_OT_bone_layers";
- ot->description= "Change the layers that the selected bones belong to";
+ ot->name = "Change Bone Layers";
+ ot->idname = "POSE_OT_bone_layers";
+ ot->description = "Change the layers that the selected bones belong to";
/* callbacks */
- ot->invoke= pose_bone_layers_invoke;
- ot->exec= pose_bone_layers_exec;
- ot->poll= ED_operator_posemode;
+ ot->invoke = pose_bone_layers_invoke;
+ ot->exec = pose_bone_layers_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean_layer_member(ot->srna, "layers", 32, NULL, "Layer", "Armature layers that bone belongs to");
@@ -2143,17 +2143,17 @@ static int armature_bone_layers_exec (bContext *C, wmOperator *op)
void ARMATURE_OT_bone_layers (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Change Bone Layers";
- ot->idname= "ARMATURE_OT_bone_layers";
- ot->description= "Change the layers that the selected bones belong to";
+ ot->name = "Change Bone Layers";
+ ot->idname = "ARMATURE_OT_bone_layers";
+ ot->description = "Change the layers that the selected bones belong to";
/* callbacks */
- ot->invoke= armature_bone_layers_invoke;
- ot->exec= armature_bone_layers_exec;
- ot->poll= ED_operator_editarmature;
+ ot->invoke = armature_bone_layers_invoke;
+ ot->exec = armature_bone_layers_exec;
+ ot->poll = ED_operator_editarmature;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean_layer_member(ot->srna, "layers", 32, NULL, "Layer", "Armature layers that bone belongs to");
@@ -2192,15 +2192,15 @@ void POSE_OT_quaternions_flip (wmOperatorType *ot)
{
/* identifiers */
ot->name = "Flip Quats";
- ot->idname= "POSE_OT_quaternions_flip";
- ot->description= "Flip quaternion values to achieve desired rotations, while maintaining the same orientations";
+ ot->idname = "POSE_OT_quaternions_flip";
+ ot->description = "Flip quaternion values to achieve desired rotations, while maintaining the same orientations";
/* callbacks */
- ot->exec= pose_flip_quats_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_flip_quats_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ********************************************** */
@@ -2268,14 +2268,14 @@ void POSE_OT_user_transforms_clear (wmOperatorType *ot)
{
/* identifiers */
ot->name = "Clear User Transforms";
- ot->idname= "POSE_OT_user_transforms_clear";
- ot->description= "Reset pose on selected bones to keyframed state";
+ ot->idname = "POSE_OT_user_transforms_clear";
+ ot->description = "Reset pose on selected bones to keyframed state";
/* callbacks */
- ot->exec= pose_clear_user_transforms_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_clear_user_transforms_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c
index 3c84ee65ac7..546bcb1f40f 100644
--- a/source/blender/editors/armature/reeb.c
+++ b/source/blender/editors/armature/reeb.c
@@ -115,6 +115,7 @@ void flipArcBuckets(ReebArc *arc);
/***************************************** UTILS **********************************************/
+#if 0 /* UNUSED */
static VertexData *allocVertexData(EditMesh *em)
{
VertexData *data;
@@ -125,7 +126,7 @@ static VertexData *allocVertexData(EditMesh *em)
data = MEM_callocN(sizeof(VertexData) * totvert, "VertexData");
- for(index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
+ for (index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
{
data[index].i = index;
data[index].w = 0;
@@ -160,6 +161,8 @@ static void nodeSetData(EditVert *eve, ReebNode *n)
((VertexData*)eve->tmp.p)->n = n;
}
+#endif
+
void REEB_freeArc(BArc *barc)
{
ReebArc *arc = (ReebArc*)barc;
@@ -180,7 +183,7 @@ void REEB_freeGraph(ReebGraph *rg)
ReebNode *node;
// free nodes
- for( node = rg->nodes.first; node; node = node->next )
+ for ( node = rg->nodes.first; node; node = node->next )
{
BLI_freeNode((BGraph*)rg, (BNode*)node);
}
@@ -188,7 +191,7 @@ void REEB_freeGraph(ReebGraph *rg)
// free arcs
arc = rg->arcs.first;
- while( arc )
+ while ( arc )
{
ReebArc *next = arc->next;
REEB_freeArc((BArc*)arc);
@@ -232,6 +235,7 @@ void BIF_flagMultiArcs(ReebGraph *rg, int flag)
}
}
+#if 0 /* UNUSED */
static ReebNode * addNode(ReebGraph *rg, EditVert *eve)
{
float weight;
@@ -247,7 +251,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++;
@@ -300,6 +304,7 @@ static void relinkNodes(ReebGraph *low_rg, ReebGraph *high_rg)
}
}
}
+#endif
ReebNode *BIF_otherNodeFromIndex(ReebArc *arc, ReebNode *node)
{
@@ -321,6 +326,7 @@ ReebNode *BIF_lowestLevelNode(ReebNode *node)
return node;
}
+#if 0 /* UNUSED */
static ReebArc * copyArc(ReebGraph *rg, ReebArc *arc)
{
ReebArc *cp_arc;
@@ -395,12 +401,13 @@ static ReebGraph * copyReebGraph(ReebGraph *rg, int level)
return cp_rg;
}
+#endif
ReebGraph *BIF_graphForMultiNode(ReebGraph *rg, ReebNode *node)
{
ReebGraph *multi_rg = rg;
- while(multi_rg && multi_rg->multi_level != node->multi_level)
+ while (multi_rg && multi_rg->multi_level != node->multi_level)
{
multi_rg = multi_rg->link_up;
}
@@ -408,6 +415,7 @@ ReebGraph *BIF_graphForMultiNode(ReebGraph *rg, ReebNode *node)
return multi_rg;
}
+#if 0 /* UNUSED */
static ReebEdge * copyEdge(ReebEdge *edge)
{
ReebEdge *newEdge = NULL;
@@ -428,7 +436,7 @@ static void printArc(ReebArc *arc)
ReebNode *tail = (ReebNode*)arc->tail;
printf("arc: (%i) %f -> (%i) %f\n", head->index, head->weight, tail->index, tail->weight);
- for(edge = arc->edges.first; edge ; edge = edge->next)
+ for (edge = arc->edges.first; edge ; edge = edge->next)
{
printf("\tedge (%i, %i)\n", edge->v1->index, edge->v2->index);
}
@@ -476,22 +484,22 @@ void repositionNodes(ReebGraph *rg)
BNode *node = NULL;
// Reset node positions
- for(node = rg->nodes.first; node; node = node->next)
+ for (node = rg->nodes.first; node; node = node->next)
{
node->p[0] = node->p[1] = node->p[2] = 0;
}
- for(arc = rg->arcs.first; arc; arc = arc->next)
+ for (arc = rg->arcs.first; arc; arc = arc->next)
{
if (((ReebArc*)arc)->bcount > 0)
{
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);
}
@@ -504,10 +512,10 @@ void verifyNodeDegree(ReebGraph *rg)
ReebNode *node = NULL;
ReebArc *arc = NULL;
- for(node = rg->nodes.first; node; node = node->next)
+ for (node = rg->nodes.first; node; node = node->next)
{
int count = 0;
- for(arc = rg->arcs.first; arc; arc = arc->next)
+ for (arc = rg->arcs.first; arc; arc = arc->next)
{
if (arc->head == node || arc->tail == node)
{
@@ -534,7 +542,7 @@ static void verifyBucketsArc(ReebGraph *UNUSED(rg), ReebArc *arc)
if (arc->bcount > 0)
{
int i;
- for(i = 0; i < arc->bcount; i++)
+ for (i = 0; i < arc->bcount; i++)
{
if (arc->buckets[i].nv == 0)
{
@@ -546,12 +554,12 @@ static void verifyBucketsArc(ReebGraph *UNUSED(rg), ReebArc *arc)
if (ceilf(head->weight) != arc->buckets[0].val)
{
printArc(arc);
- printf("alloc error in first bucket: %f should be %f \n", arc->buckets[0].val, ceil(head->weight));
+ printf("alloc error in first bucket: %f should be %f\n", arc->buckets[0].val, ceil(head->weight));
}
if (floorf(tail->weight) != arc->buckets[arc->bcount - 1].val)
{
printArc(arc);
- printf("alloc error in last bucket: %f should be %f \n", arc->buckets[arc->bcount - 1].val, floor(tail->weight));
+ printf("alloc error in last bucket: %f should be %f\n", arc->buckets[arc->bcount - 1].val, floor(tail->weight));
}
}
}
@@ -560,7 +568,7 @@ void verifyBuckets(ReebGraph *rg)
{
#ifdef DEBUG_REEB
ReebArc *arc = NULL;
- for(arc = rg->arcs.first; arc; arc = arc->next)
+ for (arc = rg->arcs.first; arc; arc = arc->next)
{
verifyBucketsArc(rg, arc);
}
@@ -572,7 +580,7 @@ void verifyFaces(ReebGraph *rg)
#ifdef DEBUG_REEB
int total = 0;
ReebArc *arc = NULL;
- for(arc = rg->arcs.first; arc; arc = arc->next)
+ for (arc = rg->arcs.first; arc; arc = arc->next)
{
total += BLI_ghash_size(arc->faces);
}
@@ -647,7 +655,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);
}
}
@@ -659,17 +667,17 @@ static void mergeArcBuckets(ReebArc *aDst, ReebArc *aSrc, float start, float end
start = MAX3(start, aDst->buckets[0].val, aSrc->buckets[0].val);
- while(indexDst < aDst->bcount && aDst->buckets[indexDst].val < start)
+ while (indexDst < aDst->bcount && aDst->buckets[indexDst].val < start)
{
indexDst++;
}
- while(indexSrc < aSrc->bcount && aSrc->buckets[indexSrc].val < start)
+ while (indexSrc < aSrc->bcount && aSrc->buckets[indexSrc].val < start)
{
indexSrc++;
}
- for( ; indexDst < aDst->bcount &&
+ for ( ; indexDst < aDst->bcount &&
indexSrc < aSrc->bcount &&
aDst->buckets[indexDst].val <= end &&
aSrc->buckets[indexSrc].val <= end
@@ -710,7 +718,7 @@ static void allocArcBuckets(ReebArc *arc)
{
arc->buckets = MEM_callocN(sizeof(EmbedBucket) * arc->bcount, "embed bucket");
- for(i = 0; i < arc->bcount; i++)
+ for (i = 0; i < arc->bcount; i++)
{
arc->buckets[i].val = start + i;
}
@@ -771,7 +779,7 @@ static void reweightBuckets(ReebArc *arc)
if (arc->bcount > 0)
{
- for(i = 0; i < arc->bcount; i++)
+ for (i = 0; i < arc->bcount; i++)
{
arc->buckets[i].val = start + i;
}
@@ -802,7 +810,7 @@ static void fillArcEmptyBuckets(ReebArc *arc)
start_p = arc->head->p;
- for(i = 0; i < arc->bcount; i++)
+ for (i = 0; i < arc->bcount; i++)
{
EmbedBucket *bucket = arc->buckets + i;
@@ -954,6 +962,7 @@ static void calculateGraphLength(ReebGraph *rg)
calculateArcLength(arc);
}
}
+#endif
/**************************************** SYMMETRY HANDLING ******************************************/
@@ -963,7 +972,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++)
@@ -1004,12 +1013,12 @@ void REEB_RadialSymmetry(BNode* root_node, RadialArc* ring, int count)
bucket2 = IT_next(iter2);
/* Make sure they both start at the same value */
- while(bucket1 && bucket2 && bucket1->val < bucket2->val)
+ while (bucket1 && bucket2 && bucket1->val < bucket2->val)
{
bucket1 = IT_next(iter1);
}
- while(bucket1 && bucket2 && bucket2->val < bucket1->val)
+ while (bucket1 && bucket2 && bucket2->val < bucket1->val)
{
bucket2 = IT_next(iter2);
}
@@ -1046,7 +1055,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
@@ -1066,12 +1075,12 @@ void REEB_RadialSymmetry(BNode* root_node, RadialArc* ring, int count)
bucket2 = IT_next(iter2);
/* Make sure they both start at the same value */
- while(bucket1 && bucket1->val < bucket2->val)
+ while (bucket1 && bucket1->val < bucket2->val)
{
bucket1 = IT_next(iter1);
}
- while(bucket2 && bucket2->val < bucket1->val)
+ while (bucket2 && bucket2->val < bucket1->val)
{
bucket2 = IT_next(iter2);
}
@@ -1081,7 +1090,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 +1105,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 +1116,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
@@ -1127,12 +1136,12 @@ void REEB_AxialSymmetry(BNode* root_node, BNode* node1, BNode* node2, struct BAr
bucket2 = IT_next(iter2);
/* Make sure they both start at the same value */
- while(bucket1 && bucket1->val < bucket2->val)
+ while (bucket1 && bucket1->val < bucket2->val)
{
bucket1 = IT_next(iter1);
}
- while(bucket2 && bucket2->val < bucket1->val)
+ while (bucket2 && bucket2->val < bucket1->val)
{
bucket2 = IT_next(iter2);
}
@@ -1149,7 +1158,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);
}
}
@@ -1160,6 +1169,7 @@ void REEB_AxialSymmetry(BNode* root_node, BNode* node1, BNode* node2, struct BAr
/****************************************** SMOOTHING **************************************************/
+#if 0 /* UNUSED */
void postprocessGraph(ReebGraph *rg, char mode)
{
ReebArc *arc;
@@ -1184,13 +1194,13 @@ void postprocessGraph(ReebGraph *rg, char mode)
return;
}
- for(arc = rg->arcs.first; arc; arc = arc->next)
+ for (arc = rg->arcs.first; arc; arc = arc->next)
{
EmbedBucket *buckets = arc->buckets;
int bcount = arc->bcount;
int index;
- for(index = 1; index < bcount - 1; index++)
+ for (index = 1; index < bcount - 1; index++)
{
interp_v3_v3v3(buckets[index].p, buckets[index].p, buckets[index - 1].p, fac1 / (fac1 + fac2));
interp_v3_v3v3(buckets[index].p, buckets[index].p, buckets[index + 1].p, fac3 / (fac1 + fac2 + fac3));
@@ -1501,7 +1511,7 @@ static void filterArc(ReebGraph *rg, ReebNode *newNode, ReebNode *removedNode, R
if (merging)
{
/* first pass, merge buckets for arcs that spawned the two nodes into the source arc*/
- for(arc = rg->arcs.first; arc; arc = arc->next)
+ for (arc = rg->arcs.first; arc; arc = arc->next)
{
if (arc->head == srcArc->head && arc->tail == srcArc->tail && arc != srcArc)
{
@@ -1514,7 +1524,7 @@ static void filterArc(ReebGraph *rg, ReebNode *newNode, ReebNode *removedNode, R
/* second pass, replace removedNode by newNode, remove arcs that are collapsed in a loop */
arc = rg->arcs.first;
- while(arc)
+ while (arc)
{
nextArc = arc->next;
@@ -1577,7 +1587,7 @@ void filterNullReebGraph(ReebGraph *rg)
ReebArc *arc = NULL, *nextArc = NULL;
arc = rg->arcs.first;
- while(arc)
+ while (arc)
{
nextArc = arc->next;
// Only collapse arcs too short to have any embed bucket
@@ -1739,14 +1749,14 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold))
#ifdef DEBUG_REEB
{
EditFace *efa;
- for(efa=G.editMesh->faces.first; efa; efa=efa->next) {
+ for (efa=G.editMesh->faces.first; efa; efa=efa->next) {
efa->tmp.fp = -1;
}
}
#endif
arc = rg->arcs.first;
- while(arc)
+ while (arc)
{
nextArc = arc->next;
@@ -1762,7 +1772,7 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold))
float avg_angle = 0;
float avg_vec[3] = {0,0,0};
- for(BLI_ghashIterator_init(&ghi, arc->faces);
+ for (BLI_ghashIterator_init(&ghi, arc->faces);
!BLI_ghashIterator_isDone(&ghi);
BLI_ghashIterator_step(&ghi))
{
@@ -1798,7 +1808,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);
@@ -1953,7 +1963,7 @@ static void finalizeGraph(ReebGraph *rg, char passes, char method)
sortArcs(rg);
- for(i = 0; i < passes; i++)
+ for (i = 0; i < passes; i++)
{
postprocessGraph(rg, method);
}
@@ -1991,17 +2001,17 @@ static void spreadWeight(EditMesh *em)
verts = MEM_callocN(sizeof(EditVert*) * totvert, "verts array");
- for(eve = em->verts.first, i = 0; eve; eve = eve->next, i++)
+ for (eve = em->verts.first, i = 0; eve; eve = eve->next, i++)
{
verts[i] = eve;
}
- while(work_needed == 1)
+ while (work_needed == 1)
{
work_needed = 0;
qsort(verts, totvert, sizeof(EditVert*), compareVerts);
- for(i = 0; i < totvert; i++)
+ for (i = 0; i < totvert; i++)
{
eve = verts[i];
@@ -2041,16 +2051,16 @@ void REEB_exportGraph(ReebGraph *rg, int count)
else {
sprintf(filename, "test%05i.txt", count);
}
- f = fopen(filename, "w");
+ f = BLI_fopen(filename, "w");
- for(arc = rg->arcs.first; arc; arc = arc->next)
+ for (arc = rg->arcs.first; arc; arc = arc->next)
{
int i;
float p[3];
exportNode(f, "v1", arc->head);
- for(i = 0; i < arc->bcount; i++)
+ for (i = 0; i < arc->bcount; i++)
{
fprintf(f, "b nv:%i %f %f %f\n", arc->buckets[i].nv, arc->buckets[i].p[0], arc->buckets[i].p[1], arc->buckets[i].p[2]);
}
@@ -2088,7 +2098,7 @@ void removeNormalNodes(ReebGraph *rg)
ReebArc *arc, *nextArc;
// Merge degree 2 nodes
- for(arc = rg->arcs.first; arc; arc = nextArc)
+ for (arc = rg->arcs.first; arc; arc = nextArc)
{
nextArc = arc->next;
@@ -2166,7 +2176,7 @@ static ReebArc *nextArcMappedToEdge(ReebArc *arc, ReebEdge *e)
ReebArc *result = NULL;
/* Find the ReebEdge in the edge list */
- for(edge = arc->edges.first; edge && !edgeEquals(edge, e); edge = edge->next)
+ for (edge = arc->edges.first; edge && !edgeEquals(edge, e); edge = edge->next)
{ }
nextEdge = edge->nextEdge;
@@ -2188,7 +2198,7 @@ void mergeArcFaces(ReebGraph *UNUSED(rg), ReebArc *aDst, ReebArc *aSrc)
{
GHashIterator ghi;
- for(BLI_ghashIterator_init(&ghi, aSrc->faces);
+ for (BLI_ghashIterator_init(&ghi, aSrc->faces);
!BLI_ghashIterator_isDone(&ghi);
BLI_ghashIterator_step(&ghi))
{
@@ -2203,7 +2213,7 @@ void mergeArcEdges(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc, MergeDirection d
if (direction == MERGE_APPEND)
{
- for(e = aSrc->edges.first; e; e = e->next)
+ for (e = aSrc->edges.first; e; e = e->next)
{
e->arc = aDst; // Edge is stolen by new arc
}
@@ -2212,7 +2222,7 @@ void mergeArcEdges(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc, MergeDirection d
}
else
{
- for(e = aSrc->edges.first; e; e = e->next)
+ for (e = aSrc->edges.first; e; e = e->next)
{
ReebEdge *newEdge = copyEdge(e);
@@ -2236,7 +2246,7 @@ void mergeArcEdges(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc, MergeDirection d
{
ReebEdge *previous = (ReebEdge*)*p;
- while(previous->nextEdge != e)
+ while (previous->nextEdge != e)
{
previous = previous->nextEdge;
}
@@ -2487,7 +2497,7 @@ static ReebEdge * createArc(ReebGraph *rg, ReebNode *node1, ReebNode *node2)
addVertToBucket(&(arc->buckets[arc->bcount - 1]), arc->tail->co);
}
#else
- for(i = 0; i < arc->bcount; i++)
+ for (i = 0; i < arc->bcount; i++)
{
float co[3];
float f = (arc->buckets[i].val - offset) / len;
@@ -2585,7 +2595,7 @@ ReebGraph * generateReebGraph(EditMesh *em, int subdivisions)
renormalizeWeight(em, (float)rg->resolution);
/* Adding vertice */
- for(index = 0, eve = em->verts.first; eve; eve = eve->next)
+ for (index = 0, eve = em->verts.first; eve; eve = eve->next)
{
if (eve->h == 0)
{
@@ -2596,7 +2606,7 @@ ReebGraph * generateReebGraph(EditMesh *em, int subdivisions)
}
/* Adding face, edge per edge */
- for(efa = em->faces.first; efa; efa = efa->next)
+ for (efa = em->faces.first; efa; efa = efa->next)
{
if (efa->h == 0)
{
@@ -2646,7 +2656,7 @@ void renormalizeWeight(EditMesh *em, float newmax)
eve = em->verts.first;
minimum = weightData(eve);
maximum = minimum;
- for(; eve; eve = eve->next)
+ for (; eve; eve = eve->next)
{
maximum = MAX2(maximum, weightData(eve));
minimum = MIN2(minimum, weightData(eve));
@@ -2655,7 +2665,7 @@ void renormalizeWeight(EditMesh *em, float newmax)
range = maximum - minimum;
/* Normalize weights */
- for(eve = em->verts.first; eve; eve = eve->next)
+ for (eve = em->verts.first; eve; eve = eve->next)
{
float weight = (weightData(eve) - minimum) / range * newmax;
weightSetData(eve, weight);
@@ -2671,7 +2681,7 @@ int weightFromLoc(EditMesh *em, int axis)
return 0;
/* Copy coordinate in weight */
- for(eve = em->verts.first; eve; eve = eve->next)
+ for (eve = em->verts.first; eve; eve = eve->next)
{
weightSetData(eve, eve->co[axis]);
}
@@ -2735,7 +2745,7 @@ int weightToHarmonic(EditMesh *em, EdgeIndex *indexed_edges)
int rval;
/* Find local extrema */
- for(eve = em->verts.first; eve; eve = eve->next)
+ for (eve = em->verts.first; eve; eve = eve->next)
{
totvert++;
}
@@ -2749,7 +2759,7 @@ int weightToHarmonic(EditMesh *em, EdgeIndex *indexed_edges)
nlBegin(NL_SYSTEM);
/* Find local extrema */
- for(index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
+ for (index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
{
if (eve->h == 0)
{
@@ -2758,7 +2768,7 @@ int weightToHarmonic(EditMesh *em, EdgeIndex *indexed_edges)
int minimum = 1;
NextEdgeForVert(indexed_edges, -1); /* Reset next edge */
- for(eed = NextEdgeForVert(indexed_edges, index); eed && (maximum || minimum); eed = NextEdgeForVert(indexed_edges, index))
+ for (eed = NextEdgeForVert(indexed_edges, index); eed && (maximum || minimum); eed = NextEdgeForVert(indexed_edges, index))
{
EditVert *eve2;
@@ -2803,13 +2813,13 @@ int weightToHarmonic(EditMesh *em, EdgeIndex *indexed_edges)
nlBegin(NL_MATRIX);
/* Zero edge weight */
- for(eed = em->edges.first; eed; eed = eed->next)
+ for (eed = em->edges.first; eed; eed = eed->next)
{
eed->tmp.l = 0;
}
/* Add faces count to the edge weight */
- for(efa = em->faces.first; efa; efa = efa->next)
+ for (efa = em->faces.first; efa; efa = efa->next)
{
if (efa->h == 0)
{
@@ -2825,7 +2835,7 @@ int weightToHarmonic(EditMesh *em, EdgeIndex *indexed_edges)
}
/* Add faces angle to the edge weight */
- for(efa = em->faces.first; efa; efa = efa->next)
+ for (efa = em->faces.first; efa; efa = efa->next)
{
if (efa->h == 0)
{
@@ -2850,7 +2860,7 @@ int weightToHarmonic(EditMesh *em, EdgeIndex *indexed_edges)
if (success)
{
rval = 1;
- for(index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
+ for (index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
{
weightSetData(eve, nlGetVariable(0, index));
}
@@ -2906,7 +2916,7 @@ static void shortestPathsFromVert(EditMesh *em, EditVert *starting_vert, EdgeInd
BLI_heap_insert(edge_heap, FLT_MAX, NULL);
/* Initialize edge flag */
- for(eed= em->edges.first; eed; eed= eed->next)
+ for (eed= em->edges.first; eed; eed= eed->next)
{
eed->f1 = 0;
}
@@ -2919,7 +2929,7 @@ static void shortestPathsFromVert(EditMesh *em, EditVert *starting_vert, EdgeInd
/* Add all new edges connected to current_eve to the list */
NextEdgeForVert(indexed_edges, -1); // Reset next edge
- for(eed = NextEdgeForVert(indexed_edges, indexData(current_eve)); eed; eed = NextEdgeForVert(indexed_edges, indexData(current_eve)))
+ for (eed = NextEdgeForVert(indexed_edges, indexData(current_eve)); eed; eed = NextEdgeForVert(indexed_edges, indexData(current_eve)))
{
if (eed->f1 == 0)
{
@@ -2973,7 +2983,7 @@ static void buildIndexedEdges(EditMesh *em, EdgeIndex *indexed_edges)
indexed_edges->offset = MEM_callocN(totvert * sizeof(int), "EdgeIndex offset");
- for(eed = em->edges.first; eed; eed = eed->next)
+ for (eed = em->edges.first; eed; eed = eed->next)
{
if (eed->v1->h == 0 && eed->v2->h == 0)
{
@@ -2988,7 +2998,7 @@ static void buildIndexedEdges(EditMesh *em, EdgeIndex *indexed_edges)
indexed_edges->edges = MEM_callocN(tot_indexed * sizeof(EditEdge*), "EdgeIndex edges");
/* setting vert offsets */
- for(eve = em->verts.first; eve; eve = eve->next)
+ for (eve = em->verts.first; eve; eve = eve->next)
{
if (eve->h == 0)
{
@@ -2999,7 +3009,7 @@ static void buildIndexedEdges(EditMesh *em, EdgeIndex *indexed_edges)
}
/* adding edges in array */
- for(eed = em->edges.first; eed; eed= eed->next)
+ for (eed = em->edges.first; eed; eed= eed->next)
{
if (eed->v1->h == 0 && eed->v2->h == 0)
{
@@ -3047,7 +3057,7 @@ int weightFromDistance(EditMesh *em, EdgeIndex *indexed_edges)
}
/* Initialize vertice flag and find at least one selected vertex */
- for(eve = em->verts.first; eve; eve = eve->next)
+ for (eve = em->verts.first; eve; eve = eve->next)
{
eve->f1 = 0;
if (eve->f & SELECT)
@@ -3066,7 +3076,7 @@ int weightFromDistance(EditMesh *em, EdgeIndex *indexed_edges)
int allDone = 0;
/* Calculate edge weight */
- for(eed = em->edges.first; eed; eed= eed->next)
+ for (eed = em->edges.first; eed; eed= eed->next)
{
if (eed->v1->h == 0 && eed->v2->h == 0)
{
@@ -3075,7 +3085,7 @@ int weightFromDistance(EditMesh *em, EdgeIndex *indexed_edges)
}
/* Apply dijkstra spf for each selected vert */
- for(eve = em->verts.first; eve; eve = eve->next)
+ for (eve = em->verts.first; eve; eve = eve->next)
{
if (eve->f & SELECT)
{
@@ -3127,7 +3137,7 @@ int weightFromDistance(EditMesh *em, EdgeIndex *indexed_edges)
}
}
- for(eve = em->verts.first; eve && vCount == 0; eve = eve->next)
+ for (eve = em->verts.first; eve && vCount == 0; eve = eve->next)
{
if (eve->f1 == 0)
{
@@ -3138,6 +3148,7 @@ int weightFromDistance(EditMesh *em, EdgeIndex *indexed_edges)
return 1;
}
+#endif
/****************************************** BUCKET ITERATOR **************************************************/
@@ -3479,9 +3490,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/curve_ops.c b/source/blender/editors/curve/curve_ops.c
index b213f797d47..94ec7c7ce93 100644
--- a/source/blender/editors/curve/curve_ops.c
+++ b/source/blender/editors/curve/curve_ops.c
@@ -140,17 +140,17 @@ void ED_operatormacros_curve(void)
wmOperatorType *ot;
wmOperatorTypeMacro *otmacro;
- ot= WM_operatortype_append_macro("CURVE_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("CURVE_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
ot->description = "Duplicate curve and move";
WM_operatortype_macro_define(ot, "CURVE_OT_duplicate");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_enum_set(otmacro->ptr, "proportional", 0);
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
- ot= WM_operatortype_append_macro("CURVE_OT_extrude_move", "Extrude Curve and Move", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("CURVE_OT_extrude_move", "Extrude Curve and Move", OPTYPE_UNDO|OPTYPE_REGISTER);
ot->description = "Extrude curve and move result";
WM_operatortype_macro_define(ot, "CURVE_OT_extrude");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_enum_set(otmacro->ptr, "proportional", 0);
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
}
@@ -160,8 +160,8 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
wmKeyMap *keymap;
wmKeyMapItem *kmi;
- keymap= WM_keymap_find(keyconf, "Font", 0, 0);
- keymap->poll= ED_operator_editfont;
+ keymap = WM_keymap_find(keyconf, "Font", 0, 0);
+ keymap->poll = ED_operator_editfont;
/* only set in editmode font, by space_view3d listener */
RNA_enum_set(WM_keymap_add_item(keymap, "FONT_OT_style_toggle", BKEY, KM_PRESS, KM_CTRL, 0)->ptr, "style", CU_CHINFO_BOLD);
@@ -214,8 +214,8 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
RNA_boolean_set(kmi->ptr, "accent", TRUE); /* accented characters */
/* only set in editmode curve, by space_view3d listener */
- keymap= WM_keymap_find(keyconf, "Curve", 0, 0);
- keymap->poll= ED_operator_editsurfcurve;
+ keymap = WM_keymap_find(keyconf, "Curve", 0, 0);
+ keymap->poll = ED_operator_editsurfcurve;
WM_keymap_add_menu(keymap, "INFO_MT_edit_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0);
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index e05f61de9dd..9190cd940d6 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -117,7 +117,7 @@ static float nurbcircle[8][2]= {
ListBase *object_editcurve_get(Object *ob)
{
- if(ob && ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ if (ob && ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu= ob->data;
return &cu->editnurb->nurbs;
}
@@ -129,7 +129,7 @@ static void set_actNurb(Object *obedit, Nurb *nu)
{
Curve *cu= obedit->data;
- if(nu==NULL)
+ if (nu==NULL)
cu->actnu = -1;
else {
ListBase *nurbs= curve_editnurbs(cu);
@@ -157,9 +157,9 @@ static Nurb *get_actNurb(Object *obedit)
/* returns 1 in case (de)selection was successful */
static short select_beztriple(BezTriple *bezt, short selstatus, short flag, short hidden)
{
- if(bezt) {
- if((bezt->hide==0) || (hidden==1)) {
- if(selstatus==1) { /* selects */
+ if (bezt) {
+ if ((bezt->hide==0) || (hidden==1)) {
+ if (selstatus==1) { /* selects */
bezt->f1 |= flag;
bezt->f2 |= flag;
bezt->f3 |= flag;
@@ -180,9 +180,9 @@ static short select_beztriple(BezTriple *bezt, short selstatus, short flag, shor
/* returns 1 in case (de)selection was successful */
static short select_bpoint(BPoint *bp, short selstatus, short flag, short hidden)
{
- if(bp) {
- if((bp->hide==0) || (hidden==1)) {
- if(selstatus==1) {
+ if (bp) {
+ if ((bp->hide==0) || (hidden==1)) {
+ if (selstatus==1) {
bp->f1 |= flag;
return 1;
}
@@ -198,7 +198,7 @@ static short select_bpoint(BPoint *bp, short selstatus, short flag, short hidden
static short swap_selection_beztriple(BezTriple *bezt)
{
- if(bezt->f2 & SELECT)
+ if (bezt->f2 & SELECT)
return select_beztriple(bezt, DESELECT, 1, VISIBLE);
else
return select_beztriple(bezt, SELECT, 1, VISIBLE);
@@ -206,7 +206,7 @@ static short swap_selection_beztriple(BezTriple *bezt)
static short swap_selection_bpoint(BPoint *bp)
{
- if(bp->f1 & SELECT)
+ if (bp->f1 & SELECT)
return select_bpoint(bp, DESELECT, 1, VISIBLE);
else
return select_bpoint(bp, SELECT, 1, VISIBLE);
@@ -218,19 +218,19 @@ int isNurbsel(Nurb *nu)
BPoint *bp;
int a;
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
- if( (bezt->f1 & SELECT) || (bezt->f2 & SELECT) || (bezt->f3 & SELECT) ) return 1;
+ while (a--) {
+ if ( (bezt->f1 & SELECT) || (bezt->f2 & SELECT) || (bezt->f3 & SELECT) ) return 1;
bezt++;
}
}
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
- if( (bp->f1 & SELECT) ) return 1;
+ while (a--) {
+ if ( (bp->f1 & SELECT) ) return 1;
bp++;
}
}
@@ -243,10 +243,10 @@ static int isNurbsel_count(Curve *cu, Nurb *nu)
BPoint *bp;
int a, sel=0;
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
+ while (a--) {
if (BEZSELECTED_HIDDENHANDLES(cu, bezt)) sel++;
bezt++;
}
@@ -254,8 +254,8 @@ static int isNurbsel_count(Curve *cu, Nurb *nu)
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
- if( (bp->f1 & SELECT) ) sel++;
+ while (a--) {
+ if ( (bp->f1 & SELECT) ) sel++;
bp++;
}
}
@@ -270,15 +270,15 @@ void printknots(Object *obedit)
Nurb *nu;
int a, num;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(isNurbsel(nu) && nu->type == CU_NURBS) {
- if(nu->knotsu) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (isNurbsel(nu) && nu->type == CU_NURBS) {
+ if (nu->knotsu) {
num= KNOTSU(nu);
- for(a=0;a<num;a++) printf("knotu %d: %f\n", a, nu->knotsu[a]);
+ for (a=0;a<num;a++) printf("knotu %d: %f\n", a, nu->knotsu[a]);
}
- if(nu->knotsv) {
+ if (nu->knotsv) {
num= KNOTSV(nu);
- for(a=0;a<num;a++) printf("knotv %d: %f\n", a, nu->knotsv[a]);
+ for (a=0;a<num;a++) printf("knotv %d: %f\n", a, nu->knotsv[a]);
}
}
}
@@ -310,7 +310,7 @@ static void init_editNurb_keyIndex(EditNurb *editnurb, ListBase *origBase)
CVKeyIndex *keyIndex;
int a, key_index= 0, nu_index= 0, pt_index= 0;
- if(editnurb->keyindex) return;
+ if (editnurb->keyindex) return;
gh= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "editNurb keyIndex");
@@ -328,7 +328,8 @@ static void init_editNurb_keyIndex(EditNurb *editnurb, ListBase *origBase)
origbezt++;
pt_index++;
}
- } else {
+ }
+ else {
a= orignu->pntsu * orignu->pntsv;
bp= nu->bp;
origbp= orignu->bp;
@@ -424,7 +425,8 @@ static void keyIndex_delNurb(EditNurb *editnurb, Nurb *nu)
BLI_ghash_remove(editnurb->keyindex, bezt, NULL, (GHashValFreeFP)MEM_freeN);
++bezt;
}
- } else {
+ }
+ else {
BPoint *bp= nu->bp;
a= nu->pntsu * nu->pntsv;
@@ -487,7 +489,8 @@ static void keyIndex_updateNurb(EditNurb *editnurb, Nurb *nu, Nurb *newnu)
{
if (nu->bezt) {
keyIndex_updateBezt(editnurb, nu->bezt, newnu->bezt, newnu->pntsu);
- } else {
+ }
+ else {
keyIndex_updateBP(editnurb, nu->bp, newnu->bp, newnu->pntsu * newnu->pntsv);
}
}
@@ -500,8 +503,8 @@ static void keyIndex_swap(EditNurb *editnurb, void *a, void *b)
BLI_ghash_remove(editnurb->keyindex, a, NULL, NULL);
BLI_ghash_remove(editnurb->keyindex, b, NULL, NULL);
- if(index2) BLI_ghash_insert(editnurb->keyindex, a, index2);
- if(index1) BLI_ghash_insert(editnurb->keyindex, b, index1);
+ if (index2) BLI_ghash_insert(editnurb->keyindex, a, index2);
+ if (index1) BLI_ghash_insert(editnurb->keyindex, b, index1);
}
static void keyIndex_switchDirection(EditNurb *editnurb, Nurb *nu)
@@ -525,18 +528,19 @@ static void keyIndex_switchDirection(EditNurb *editnurb, Nurb *nu)
index1= getCVKeyIndex(editnurb, bezt1);
index2= getCVKeyIndex(editnurb, bezt2);
- if(index1) index1->switched= !index1->switched;
+ if (index1) index1->switched= !index1->switched;
if (bezt1 != bezt2) {
keyIndex_swap(editnurb, bezt1, bezt2);
- if(index2) index2->switched= !index2->switched;
+ if (index2) index2->switched= !index2->switched;
}
bezt1++;
bezt2--;
}
- } else {
+ }
+ else {
BPoint *bp1, *bp2;
if (nu->pntsv == 1) {
@@ -544,14 +548,14 @@ static void keyIndex_switchDirection(EditNurb *editnurb, Nurb *nu)
bp1= nu->bp;
bp2= bp1+(a-1);
a/= 2;
- while(bp1!=bp2 && a>0) {
+ while (bp1!=bp2 && a>0) {
index1= getCVKeyIndex(editnurb, bp1);
index2= getCVKeyIndex(editnurb, bp2);
- if(index1) index1->switched= !index1->switched;
+ if (index1) index1->switched= !index1->switched;
if (bp1 != bp2) {
- if(index2) index2->switched= !index2->switched;
+ if (index2) index2->switched= !index2->switched;
keyIndex_swap(editnurb, bp1, bp2);
}
@@ -560,24 +564,25 @@ static void keyIndex_switchDirection(EditNurb *editnurb, Nurb *nu)
bp1++;
bp2--;
}
- } else {
+ }
+ else {
int b;
- for(b=0; b<nu->pntsv; b++) {
+ for (b=0; b<nu->pntsv; b++) {
bp1= nu->bp+b*nu->pntsu;
a= nu->pntsu;
bp2= bp1+(a-1);
a/= 2;
- while(bp1!=bp2 && a>0) {
+ while (bp1!=bp2 && a>0) {
index1= getCVKeyIndex(editnurb, bp1);
index2= getCVKeyIndex(editnurb, bp2);
- if(index1) index1->switched= !index1->switched;
+ if (index1) index1->switched= !index1->switched;
if (bp1 != bp2) {
- if(index2) index2->switched= !index2->switched;
+ if (index2) index2->switched= !index2->switched;
keyIndex_swap(editnurb, bp1, bp2);
}
@@ -602,7 +607,7 @@ static void switch_keys_direction(Curve *cu, Nurb *actnu)
int a;
currkey = cu->key->block.first;
- while(currkey) {
+ while (currkey) {
fp= currkey->data;
nu= nubase->first;
@@ -612,26 +617,29 @@ static void switch_keys_direction(Curve *cu, Nurb *actnu)
a= nu->pntsu;
if (nu == actnu) {
while (a--) {
- if(getKeyIndexOrig_bezt(editnurb, bezt)) {
+ if (getKeyIndexOrig_bezt(editnurb, bezt)) {
swap_v3_v3(fp, fp + 6);
*(fp+9) = -*(fp+9);
fp += 12;
}
bezt++;
}
- } else fp += a * 12;
- } else {
+ }
+ else fp += a * 12;
+ }
+ else {
BPoint *bp= nu->bp;
a= nu->pntsu * nu->pntsv;
if (nu == actnu) {
while (a--) {
- if(getKeyIndexOrig_bp(editnurb, bp)) {
+ if (getKeyIndexOrig_bp(editnurb, bp)) {
*(fp+3) = -*(fp+3);
fp += 4;
}
bp++;
}
- } else fp += a * 4;
+ }
+ else fp += a * 4;
}
nu= nu->next;
@@ -651,7 +659,7 @@ static void keyData_switchDirectionNurb(Curve *cu, Nurb *nu)
}
keyIndex_switchDirection(editnurb, nu);
- if(cu->key)
+ if (cu->key)
switch_keys_direction(cu, nu);
}
@@ -662,7 +670,7 @@ static GHash *dupli_keyIndexHash(GHash *keyindex)
gh= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "dupli_keyIndex gh");
- for(hashIter = BLI_ghashIterator_new(keyindex);
+ for (hashIter = BLI_ghashIterator_new(keyindex);
!BLI_ghashIterator_isDone(hashIter);
BLI_ghashIterator_step(hashIter)) {
void *cv = BLI_ghashIterator_getKey(hashIter);
@@ -710,10 +718,11 @@ static void calc_keyHandles(ListBase *nurb, float *key)
a= nu->pntsu;
startfp= fp;
- if(nu->flagu & CU_NURB_CYCLIC) {
+ if (nu->flagu & CU_NURB_CYCLIC) {
prevp= bezt+(a-1);
prevfp= fp+(12 * (a-1));
- } else {
+ }
+ else {
prevp= NULL;
prevfp= NULL;
}
@@ -732,11 +741,12 @@ static void calc_keyHandles(ListBase *nurb, float *key)
prevp= bezt;
prevfp= fp;
- if(a==1) {
- if(nu->flagu & CU_NURB_CYCLIC) {
+ if (a==1) {
+ if (nu->flagu & CU_NURB_CYCLIC) {
nextp= nu->bezt;
nextfp= startfp;
- } else {
+ }
+ else {
nextp= NULL;
nextfp= NULL;
}
@@ -749,7 +759,8 @@ static void calc_keyHandles(ListBase *nurb, float *key)
++bezt;
fp += 12;
}
- } else {
+ }
+ else {
a= nu->pntsu * nu->pntsv;
fp += a * 4;
}
@@ -763,7 +774,7 @@ static void calc_shapeKeys(Object *obedit)
Curve *cu= (Curve*)obedit->data;
/* are there keys? */
- if(cu->key) {
+ if (cu->key) {
int a, i;
EditNurb *editnurb= cu->editnurb;
KeyBlock *currkey;
@@ -777,26 +788,27 @@ static void calc_shapeKeys(Object *obedit)
float *oldkey, *newkey, *ofp;
/* editing the base key should update others */
- if(cu->key->type==KEY_RELATIVE) {
+ if (cu->key->type==KEY_RELATIVE) {
int act_is_basis = 0;
/* find if this key is a basis for any others */
- for(currkey = cu->key->block.first; currkey; currkey= currkey->next) {
- if(editnurb->shapenr-1 == currkey->relative) {
+ for (currkey = cu->key->block.first; currkey; currkey= currkey->next) {
+ if (editnurb->shapenr-1 == currkey->relative) {
act_is_basis = 1;
break;
}
}
- if(act_is_basis) { /* active key is a base */
+ if (act_is_basis) { /* active key is a base */
int totvec= 0;
/* Calculate needed memory to store offset */
nu= editnurb->nurbs.first;
- while(nu) {
+ while (nu) {
if (nu->bezt) {
/* Three vects to store handles and one for alfa */
totvec+= nu->pntsu * 4;
- } else {
+ }
+ else {
totvec+= 2 * nu->pntsu * nu->pntsv;
}
@@ -806,11 +818,11 @@ static void calc_shapeKeys(Object *obedit)
ofs= MEM_callocN(sizeof(float) * 3 * totvec, "currkey->data");
nu= editnurb->nurbs.first;
i= 0;
- while(nu) {
- if(nu->bezt) {
+ while (nu) {
+ if (nu->bezt) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
+ while (a--) {
oldbezt= getKeyIndexOrig_bezt(editnurb, bezt);
if (oldbezt) {
@@ -820,7 +832,8 @@ static void calc_shapeKeys(Object *obedit)
i++;
}
ofs[i++][0]= bezt->alfa - oldbezt->alfa;
- } else {
+ }
+ else {
i += 4;
}
bezt++;
@@ -829,7 +842,7 @@ static void calc_shapeKeys(Object *obedit)
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
+ while (a--) {
oldbp= getKeyIndexOrig_bp(editnurb, bp);
if (oldbp) {
sub_v3_v3v3(ofs[i], bp->vec, oldbp->vec);
@@ -846,7 +859,7 @@ static void calc_shapeKeys(Object *obedit)
}
currkey = cu->key->block.first;
- while(currkey) {
+ while (currkey) {
int apply_offset = (ofs && (currkey != actkey) && (editnurb->shapenr-1 == currkey->relative));
float *fp= newkey= MEM_callocN(cu->key->elemsize * totvert, "currkey->data");
@@ -854,14 +867,14 @@ static void calc_shapeKeys(Object *obedit)
nu= editnurb->nurbs.first;
i = 0;
- while(nu) {
- if(currkey == actkey) {
+ while (nu) {
+ if (currkey == actkey) {
int restore= actkey != cu->key->refkey;
- if(nu->bezt) {
+ if (nu->bezt) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
+ while (a--) {
int j;
oldbezt= getKeyIndexOrig_bezt(editnurb, bezt);
@@ -876,7 +889,7 @@ static void calc_shapeKeys(Object *obedit)
}
fp[0]= bezt->alfa;
- if(restore && oldbezt) {
+ if (restore && oldbezt) {
bezt->alfa= oldbezt->alfa;
}
@@ -887,14 +900,14 @@ static void calc_shapeKeys(Object *obedit)
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
+ while (a--) {
oldbp= getKeyIndexOrig_bp(editnurb, bp);
copy_v3_v3(fp, bp->vec);
fp[3]= bp->alfa;
- if(restore && oldbp) {
+ if (restore && oldbp) {
copy_v3_v3(bp->vec, oldbp->vec);
bp->alfa= oldbp->alfa;
}
@@ -909,12 +922,12 @@ static void calc_shapeKeys(Object *obedit)
int index;
float *curofp;
- if(oldkey) {
- if(nu->bezt) {
+ if (oldkey) {
+ if (nu->bezt) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
+ while (a--) {
index= getKeyIndexOrig_keyIndex(editnurb, bezt);
if (index >= 0) {
int j;
@@ -923,7 +936,7 @@ static void calc_shapeKeys(Object *obedit)
for (j= 0; j < 3; ++j, ++i) {
copy_v3_v3(fp, curofp);
- if(apply_offset) {
+ if (apply_offset) {
add_v3_v3(fp, ofs[i]);
}
@@ -931,14 +944,15 @@ static void calc_shapeKeys(Object *obedit)
}
fp[0]= curofp[0];
- if(apply_offset) {
+ if (apply_offset) {
/* apply alfa offsets */
add_v3_v3(fp, ofs[i]);
++i;
}
fp+= 3; /* alphas */
- } else {
+ }
+ else {
int j;
for (j= 0; j < 3; ++j, ++i) {
copy_v3_v3(fp, bezt->vec[j]);
@@ -954,7 +968,7 @@ static void calc_shapeKeys(Object *obedit)
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
+ while (a--) {
index= getKeyIndexOrig_keyIndex(editnurb, bp);
if (index >= 0) {
@@ -962,11 +976,12 @@ static void calc_shapeKeys(Object *obedit)
copy_v3_v3(fp, curofp);
fp[3]= curofp[3];
- if(apply_offset) {
+ if (apply_offset) {
add_v3_v3(fp, ofs[i]);
fp[3]+=ofs[i+1][0];
}
- } else {
+ }
+ else {
copy_v3_v3(fp, bp->vec);
fp[3]= bp->alfa;
}
@@ -988,13 +1003,13 @@ static void calc_shapeKeys(Object *obedit)
}
currkey->totelem= totvert;
- if(currkey->data) MEM_freeN(currkey->data);
+ if (currkey->data) MEM_freeN(currkey->data);
currkey->data = newkey;
currkey= currkey->next;
}
- if(ofs) MEM_freeN(ofs);
+ if (ofs) MEM_freeN(ofs);
}
}
@@ -1016,7 +1031,7 @@ static void fcurve_path_rename(AnimData *ad, char *orig_rna_path, char *rna_path
fcu= orig_curves->first;
while (fcu) {
nextfcu= fcu->next;
- if(!strncmp(fcu->rna_path, orig_rna_path, len)) {
+ if (!strncmp(fcu->rna_path, orig_rna_path, len)) {
char *spath, *suffix= fcu->rna_path + len;
nfcu= copy_fcurve(fcu);
spath= nfcu->rna_path;
@@ -1042,7 +1057,7 @@ static void fcurve_path_rename(AnimData *ad, char *orig_rna_path, char *rna_path
static void fcurve_remove(AnimData *ad, ListBase *orig_curves, FCurve *fcu)
{
- if(orig_curves==&ad->drivers) BLI_remlink(&ad->drivers, fcu);
+ if (orig_curves==&ad->drivers) BLI_remlink(&ad->drivers, fcu);
else action_groups_remove_channel(ad->action, fcu);
free_fcurve(fcu);
@@ -1060,19 +1075,19 @@ static void curve_rename_fcurves(Object *obedit, ListBase *orig_curves)
ListBase curves= {NULL, NULL};
FCurve *fcu, *next;
- while(nu) {
- if(nu->bezt) {
+ while (nu) {
+ if (nu->bezt) {
BezTriple *bezt= nu->bezt;
a= nu->pntsu;
pt_index= 0;
while (a--) {
keyIndex= getCVKeyIndex(editnurb, bezt);
- if(keyIndex) {
+ if (keyIndex) {
BLI_snprintf(rna_path, sizeof(rna_path), "splines[%d].bezier_points[%d]", nu_index, pt_index);
BLI_snprintf(orig_rna_path, sizeof(orig_rna_path), "splines[%d].bezier_points[%d]", keyIndex->nu_index, keyIndex->pt_index);
- if(keyIndex->switched) {
+ if (keyIndex->switched) {
char handle_path[64], orig_handle_path[64];
BLI_snprintf(orig_handle_path, sizeof(orig_rna_path), "%s.handle_left", orig_rna_path);
BLI_snprintf(handle_path, sizeof(rna_path), "%s.handle_right", rna_path);
@@ -1092,14 +1107,15 @@ static void curve_rename_fcurves(Object *obedit, ListBase *orig_curves)
bezt++;
pt_index++;
}
- } else {
+ }
+ else {
BPoint *bp= nu->bp;
a= nu->pntsu * nu->pntsv;
pt_index= 0;
while (a--) {
keyIndex= getCVKeyIndex(editnurb, bp);
- if(keyIndex) {
+ if (keyIndex) {
BLI_snprintf(rna_path, sizeof(rna_path), "splines[%d].points[%d]", nu_index, pt_index);
BLI_snprintf(orig_rna_path, sizeof(orig_rna_path), "splines[%d].points[%d]", keyIndex->nu_index, keyIndex->pt_index);
fcurve_path_rename(ad, orig_rna_path, rna_path, orig_curves, &curves);
@@ -1116,13 +1132,13 @@ 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 */
- for(fcu= orig_curves->first; fcu; fcu= next) {
+ /* 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;
- if(!strncmp(fcu->rna_path, "splines", 7)) {
+ if (!strncmp(fcu->rna_path, "splines", 7)) {
char *ch= strchr(fcu->rna_path, '.');
if (ch && (!strncmp(ch, ".bezier_points", 14) || !strncmp(ch, ".points", 7)))
@@ -1132,14 +1148,14 @@ static void curve_rename_fcurves(Object *obedit, ListBase *orig_curves)
nu_index= 0;
nu= editnurb->nurbs.first;
- while(nu) {
+ while (nu) {
keyIndex= NULL;
- if(nu->pntsu) {
- if(nu->bezt) keyIndex= getCVKeyIndex(editnurb, &nu->bezt[0]);
+ if (nu->pntsu) {
+ if (nu->bezt) keyIndex= getCVKeyIndex(editnurb, &nu->bezt[0]);
else keyIndex= getCVKeyIndex(editnurb, &nu->bp[0]);
}
- if(keyIndex) {
+ if (keyIndex) {
BLI_snprintf(rna_path, sizeof(rna_path), "splines[%d]", nu_index);
BLI_snprintf(orig_rna_path, sizeof(orig_rna_path), "splines[%d]", keyIndex->nu_index);
fcurve_path_rename(ad, orig_rna_path, rna_path, orig_curves, &curves);
@@ -1151,10 +1167,10 @@ static void curve_rename_fcurves(Object *obedit, ListBase *orig_curves)
/* the remainders in orig_curves can be copied back (like follow path) */
/* (if it's not path to spline) */
- for(fcu= orig_curves->first; fcu; fcu= next) {
+ for (fcu= orig_curves->first; fcu; fcu= next) {
next= fcu->next;
- if(!strncmp(fcu->rna_path, "splines", 7)) fcurve_remove(ad, orig_curves, fcu);
+ if (!strncmp(fcu->rna_path, "splines", 7)) fcurve_remove(ad, orig_curves, fcu);
else BLI_addtail(&curves, fcu);
}
@@ -1167,9 +1183,9 @@ int ED_curve_updateAnimPaths(Object *obedit)
Curve *cu= (Curve*)obedit->data;
AnimData *ad= BKE_animdata_from_id(&cu->id);
- if(!curve_is_animated(obedit)) return 0;
+ if (!curve_is_animated(obedit)) return 0;
- if(ad->action)
+ if (ad->action)
curve_rename_fcurves(obedit, &ad->action->curves);
curve_rename_fcurves(obedit, &ad->drivers);
@@ -1184,7 +1200,7 @@ void load_editNurb(Object *obedit)
{
ListBase *editnurb= object_editcurve_get(obedit);
- if(obedit==NULL) return;
+ if (obedit==NULL) return;
set_actNurb(obedit, NULL);
@@ -1193,11 +1209,11 @@ void load_editNurb(Object *obedit)
Nurb *nu, *newnu;
ListBase newnurb= {NULL, NULL}, oldnurb= cu->nurb;
- for(nu= editnurb->first; nu; nu= nu->next) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
newnu= duplicateNurb(nu);
BLI_addtail(&newnurb, newnu);
- if(nu->type == CU_NURBS) {
+ if (nu->type == CU_NURBS) {
clamp_nurb_order_u(nu);
}
}
@@ -1227,17 +1243,18 @@ void make_editNurb(Object *obedit)
if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
actkey= ob_get_keyblock(obedit);
- if(actkey) {
+ if (actkey) {
// XXX strcpy(G.editModeTitleExtra, "(Key) ");
undo_editmode_clear();
key_to_curve(actkey, cu, &cu->nurb);
}
- if(editnurb) {
+ if (editnurb) {
freeNurblist(&editnurb->nurbs);
free_curve_editNurb_keyIndex(editnurb);
editnurb->keyindex= NULL;
- } else {
+ }
+ else {
editnurb= MEM_callocN(sizeof(EditNurb), "editnurb");
cu->editnurb= editnurb;
}
@@ -1245,7 +1262,7 @@ void make_editNurb(Object *obedit)
nu= cu->nurb.first;
cu->lastsel= NULL; /* for select row */
- while(nu) {
+ while (nu) {
newnu= duplicateNurb(nu);
test2DNurb(newnu); // after join, or any other creation of curve
BLI_addtail(&editnurb->nurbs, newnu);
@@ -1258,11 +1275,11 @@ void make_editNurb(Object *obedit)
nu= nu->next;
}
- if(actkey)
+ 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);
}
}
@@ -1307,14 +1324,14 @@ void CU_select_swap(Object *obedit)
cu->lastsel= NULL;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
- if(bezt->hide==0) {
+ while (a--) {
+ if (bezt->hide==0) {
bezt->f2 ^= SELECT; /* always do the center point */
- if((cu->drawflag & CU_HIDE_HANDLES)==0) {
+ if ((cu->drawflag & CU_HIDE_HANDLES)==0) {
bezt->f1 ^= SELECT;
bezt->f3 ^= SELECT;
}
@@ -1325,7 +1342,7 @@ void CU_select_swap(Object *obedit)
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
+ while (a--) {
swap_selection_bpoint(bp);
bp++;
}
@@ -1351,7 +1368,7 @@ static int separate_exec(bContext *C, wmOperator *op)
oldcu= oldob->data;
oldedit= oldcu->editnurb;
- if(oldcu->key) {
+ if (oldcu->key) {
BKE_report(op->reports, RPT_ERROR, "Can't separate a curve with vertex keys");
return OPERATOR_CANCELLED;
}
@@ -1374,10 +1391,10 @@ static int separate_exec(bContext *C, wmOperator *op)
free_curve_editNurb_keyIndex(newedit);
/* 3. move over parts from old object */
- for(nu= oldedit->nurbs.first; nu; nu=nu1) {
+ for (nu= oldedit->nurbs.first; nu; nu=nu1) {
nu1= nu->next;
- if(isNurbsel(nu)) {
+ if (isNurbsel(nu)) {
BLI_remlink(&oldedit->nurbs, nu);
BLI_addtail(&newedit->nurbs, nu);
}
@@ -1400,15 +1417,15 @@ static int separate_exec(bContext *C, wmOperator *op)
void CURVE_OT_separate(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Separate";
- ot->idname= "CURVE_OT_separate";
+ ot->name = "Separate";
+ ot->idname = "CURVE_OT_separate";
/* api callbacks */
- ot->exec= separate_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = separate_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************* FLAGS ********************* */
@@ -1416,7 +1433,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;
@@ -1424,33 +1441,33 @@ static short isNurbselUV(Nurb *nu, int *u, int *v, int flag)
*u= *v= -1;
bp= nu->bp;
- for(b=0; b<nu->pntsv; b++) {
+ for (b=0; b<nu->pntsv; b++) {
sel= 0;
- for(a=0; a<nu->pntsu; a++, bp++) {
- if(bp->f1 & flag) sel++;
+ for (a=0; a<nu->pntsu; a++, bp++) {
+ if (bp->f1 & flag) sel++;
}
- if(sel==nu->pntsu) {
- if(*u== -1) *u= b;
+ if (sel==nu->pntsu) {
+ if (*u== -1) *u= b;
else return 0;
}
- else if(sel>1) return 0; /* because sel==1 is still ok */
+ else if (sel>1) return 0; /* because sel==1 is still ok */
}
- for(a=0; a<nu->pntsu; a++) {
+ for (a=0; a<nu->pntsu; a++) {
sel= 0;
bp= nu->bp+a;
- for(b=0; b<nu->pntsv; b++, bp+=nu->pntsu) {
- if(bp->f1 & flag) sel++;
+ for (b=0; b<nu->pntsv; b++, bp+=nu->pntsu) {
+ if (bp->f1 & flag) sel++;
}
- if(sel==nu->pntsv) {
- if(*v== -1) *v= a;
+ if (sel==nu->pntsv) {
+ if (*v== -1) *v= a;
else return 0;
}
- else if(sel>1) return 0;
+ else if (sel>1) return 0;
}
- if(*u==-1 && *v>-1) return 1;
- if(*v==-1 && *u>-1) return 1;
+ if (*u==-1 && *v>-1) return 1;
+ if (*v==-1 && *u>-1) return 1;
return 0;
}
@@ -1461,11 +1478,11 @@ static void setflagsNurb(ListBase *editnurb, short flag)
BPoint *bp;
int a;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->type == CU_BEZIER) {
a= nu->pntsu;
bezt= nu->bezt;
- while(a--) {
+ while (a--) {
bezt->f1= bezt->f2= bezt->f3= flag;
bezt++;
}
@@ -1473,7 +1490,7 @@ static void setflagsNurb(ListBase *editnurb, short flag)
else {
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- while(a--) {
+ while (a--) {
bp->f1= flag;
bp++;
}
@@ -1488,13 +1505,13 @@ static void rotateflagNurb(ListBase *editnurb, short flag, float *cent, float ro
BPoint *bp;
int a;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->type == CU_NURBS) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->type == CU_NURBS) {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->f1 & flag) {
+ while (a--) {
+ if (bp->f1 & flag) {
sub_v3_v3(bp->vec, cent);
mul_m3_v3(rotmat, bp->vec);
add_v3_v3(bp->vec, cent);
@@ -1513,22 +1530,22 @@ static void translateflagNurb(ListBase *editnurb, short flag, const float vec[3]
BPoint *bp;
int a;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->type == CU_BEZIER) {
a= nu->pntsu;
bezt= nu->bezt;
- while(a--) {
- if(bezt->f1 & flag) add_v3_v3(bezt->vec[0], vec);
- if(bezt->f2 & flag) add_v3_v3(bezt->vec[1], vec);
- if(bezt->f3 & flag) add_v3_v3(bezt->vec[2], vec);
+ while (a--) {
+ if (bezt->f1 & flag) add_v3_v3(bezt->vec[0], vec);
+ if (bezt->f2 & flag) add_v3_v3(bezt->vec[1], vec);
+ if (bezt->f3 & flag) add_v3_v3(bezt->vec[2], vec);
bezt++;
}
}
else {
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- while(a--) {
- if(bp->f1 & flag) add_v3_v3(bp->vec, vec);
+ while (a--) {
+ if (bp->f1 & flag) add_v3_v3(bp->vec, vec);
bp++;
}
}
@@ -1543,12 +1560,12 @@ static void weightflagNurb(ListBase *editnurb, short flag, float w)
BPoint *bp;
int a;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->type == CU_NURBS) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->type == CU_NURBS) {
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- while(a--) {
- if(bp->f1 & flag) {
+ while (a--) {
+ if (bp->f1 & flag) {
/* a mode used to exist for replace/multiple but is was unused */
bp->vec[3]*= w;
}
@@ -1567,25 +1584,25 @@ static int deleteflagNurb(bContext *C, wmOperator *UNUSED(op), int flag)
BPoint *bp, *bpn, *newbp;
int a, b, newu, newv, sel;
- if(obedit->type==OB_SURF);
+ if (obedit->type==OB_SURF);
else return OPERATOR_CANCELLED;
cu->lastsel= NULL;
nu= editnurb->first;
- while(nu) {
+ while (nu) {
next= nu->next;
/* is entire nurb selected */
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a) {
+ while (a) {
a--;
- if(bp->f1 & flag);
+ if (bp->f1 & flag);
else break;
bp++;
}
- if(a==0) {
+ if (a==0) {
BLI_remlink(editnurb, nu);
keyIndex_delNurb(cu->editnurb, nu);
freeNurb(nu); nu=NULL;
@@ -1594,30 +1611,31 @@ static int deleteflagNurb(bContext *C, wmOperator *UNUSED(op), int flag)
/* is nurb in U direction selected */
newv= nu->pntsv;
bp= nu->bp;
- for(b=0; b<nu->pntsv; b++) {
+ for (b=0; b<nu->pntsv; b++) {
sel= 0;
- for(a=0; a<nu->pntsu; a++, bp++) {
- if(bp->f1 & flag) sel++;
+ for (a=0; a<nu->pntsu; a++, bp++) {
+ if (bp->f1 & flag) sel++;
}
- if(sel==nu->pntsu) {
+ if (sel==nu->pntsu) {
newv--;
}
- else if(sel>=1) {
+ else if (sel>=1) {
/* don't delete */
break;
}
}
- if(newv!=nu->pntsv && b==nu->pntsv) {
+ if (newv!=nu->pntsv && b==nu->pntsv) {
/* delete */
bp= nu->bp;
bpn = newbp =
(BPoint*) MEM_mallocN(newv * nu->pntsu * sizeof(BPoint), "deleteNurb");
- for(b=0; b<nu->pntsv; b++) {
- if((bp->f1 & flag)==0) {
+ for (b=0; b<nu->pntsv; b++) {
+ if ((bp->f1 & flag)==0) {
memcpy(bpn, bp, nu->pntsu*sizeof(BPoint));
keyIndex_updateBP(cu->editnurb, bp, bpn, nu->pntsu);
bpn+= nu->pntsu;
- } else {
+ }
+ else {
keyIndex_delBP(cu->editnurb, bp);
}
bp+= nu->pntsu;
@@ -1632,44 +1650,45 @@ static int deleteflagNurb(bContext *C, wmOperator *UNUSED(op), int flag)
else {
/* is the nurb in V direction selected */
newu= nu->pntsu;
- for(a=0; a<nu->pntsu; a++) {
+ for (a=0; a<nu->pntsu; a++) {
bp= nu->bp+a;
sel= 0;
- for(b=0; b<nu->pntsv; b++, bp+=nu->pntsu) {
- if(bp->f1 & flag) sel++;
+ for (b=0; b<nu->pntsv; b++, bp+=nu->pntsu) {
+ if (bp->f1 & flag) sel++;
}
- if(sel==nu->pntsv) {
+ if (sel==nu->pntsv) {
newu--;
}
- else if(sel>=1) {
+ else if (sel>=1) {
/* don't delete */
break;
}
}
- if(newu!=nu->pntsu && a==nu->pntsu) {
+ if (newu!=nu->pntsu && a==nu->pntsu) {
/* delete */
bp= nu->bp;
bpn = newbp =
(BPoint*) MEM_mallocN(newu * nu->pntsv * sizeof(BPoint), "deleteNurb");
- for(b=0; b<nu->pntsv; b++) {
- for(a=0; a<nu->pntsu; a++, bp++) {
- if((bp->f1 & flag)==0) {
+ for (b=0; b<nu->pntsv; b++) {
+ for (a=0; a<nu->pntsu; a++, bp++) {
+ if ((bp->f1 & flag)==0) {
*bpn= *bp;
keyIndex_updateBP(cu->editnurb, bp, bpn, 1);
bpn++;
- } else {
+ }
+ else {
keyIndex_delBP(cu->editnurb, bp);
}
}
}
MEM_freeN(nu->bp);
nu->bp= newbp;
- if(newu==1 && nu->pntsv>1) { /* make a U spline */
+ if (newu==1 && nu->pntsv>1) { /* make a U spline */
nu->pntsu= nu->pntsv;
nu->pntsv= 1;
SWAP(short, nu->orderu, nu->orderv);
clamp_nurb_order_u(nu);
- if(nu->knotsv) MEM_freeN(nu->knotsv);
+ if (nu->knotsv) MEM_freeN(nu->knotsv);
nu->knotsv= NULL;
}
else {
@@ -1683,7 +1702,7 @@ static int deleteflagNurb(bContext *C, wmOperator *UNUSED(op), int flag)
nu= next;
}
- if(ED_curve_updateAnimPaths(obedit))
+ if (ED_curve_updateAnimPaths(obedit))
WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, obedit);
return OPERATOR_FINISHED;
@@ -1697,18 +1716,18 @@ static short extrudeflagNurb(EditNurb *editnurb, int flag)
int ok= 0, a, u, v, len;
nu= editnurb->nurbs.first;
- while(nu) {
+ while (nu) {
- if(nu->pntsv==1) {
+ if (nu->pntsv==1) {
bp= nu->bp;
a= nu->pntsu;
- while(a) {
- if(bp->f1 & flag);
+ while (a) {
+ if (bp->f1 & flag);
else break;
bp++;
a--;
}
- if(a==0) {
+ if (a==0) {
ok= 1;
newbp =
(BPoint*)MEM_mallocN(2 * nu->pntsu * sizeof(BPoint), "extrudeNurb1");
@@ -1718,7 +1737,7 @@ static short extrudeflagNurb(EditNurb *editnurb, int flag)
MEM_freeN(nu->bp);
nu->bp= newbp;
a= nu->pntsu;
- while(a--) {
+ while (a--) {
select_bpoint(bp, SELECT, flag, HIDDEN);
select_bpoint(newbp, DESELECT, flag, HIDDEN);
bp++;
@@ -1733,22 +1752,22 @@ static short extrudeflagNurb(EditNurb *editnurb, int flag)
else {
/* which row or column is selected */
- if( isNurbselUV(nu, &u, &v, flag) ) {
+ if ( isNurbselUV(nu, &u, &v, flag) ) {
/* deselect all */
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
+ while (a--) {
select_bpoint(bp, DESELECT, flag, HIDDEN);
bp++;
}
- if(u==0 || u== nu->pntsv-1) { /* row in u-direction selected */
+ if (u==0 || u== nu->pntsv-1) { /* row in u-direction selected */
ok= 1;
newbp =
(BPoint*) MEM_mallocN(nu->pntsu*(nu->pntsv + 1)
* sizeof(BPoint), "extrudeNurb1");
- if(u==0) {
+ if (u==0) {
len= nu->pntsv*nu->pntsu;
ED_curve_bpcpy(editnurb, newbp+nu->pntsu, nu->bp, len);
ED_curve_bpcpy(editnurb, newbp, nu->bp, nu->pntsu);
@@ -1762,7 +1781,7 @@ static short extrudeflagNurb(EditNurb *editnurb, int flag)
}
a= nu->pntsu;
- while(a--) {
+ while (a--) {
select_bpoint(bp, SELECT, flag, HIDDEN);
bp++;
}
@@ -1772,14 +1791,14 @@ 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");
bp= nu->bp;
- for(a=0; a<nu->pntsv; a++) {
- if(v==0) {
+ for (a=0; a<nu->pntsv; a++) {
+ if (v==0) {
*bpn= *bp;
bpn->f1 |= flag;
bpn++;
@@ -1787,7 +1806,7 @@ static short extrudeflagNurb(EditNurb *editnurb, int flag)
ED_curve_bpcpy(editnurb, bpn, bp, nu->pntsu);
bp+= nu->pntsu;
bpn+= nu->pntsu;
- if(v== nu->pntsu-1) {
+ if (v== nu->pntsu-1) {
*bpn= *(bp-1);
bpn->f1 |= flag;
bpn++;
@@ -1820,20 +1839,20 @@ static void adduplicateflagNurb(Object *obedit, short flag)
cu->lastsel= NULL;
nu= editnurb->last;
- while(nu) {
- if(nu->type == CU_BEZIER) {
+ while (nu) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
- for(a=0; a<nu->pntsu; a++) {
+ for (a=0; a<nu->pntsu; a++) {
enda= -1;
starta= a;
- while( (bezt->f1 & flag) || (bezt->f2 & flag) || (bezt->f3 & flag) ) {
+ while ( (bezt->f1 & flag) || (bezt->f2 & flag) || (bezt->f3 & flag) ) {
select_beztriple(bezt, DESELECT, flag, HIDDEN);
enda=a;
- if(a>=nu->pntsu-1) break;
+ if (a>=nu->pntsu-1) break;
a++;
bezt++;
}
- if(enda>=starta) {
+ if (enda>=starta) {
newnu = (Nurb*)MEM_mallocN(sizeof(Nurb), "adduplicateN");
memcpy(newnu, nu, sizeof(Nurb));
BLI_addtail(editnurb, newnu);
@@ -1845,13 +1864,13 @@ static void adduplicateflagNurb(Object *obedit, short flag)
b= newnu->pntsu;
bezt1= newnu->bezt;
- while(b--) {
+ while (b--) {
select_beztriple(bezt1, SELECT, flag, HIDDEN);
bezt1++;
}
- if(nu->flagu & CU_NURB_CYCLIC) {
- if(starta!=0 || enda!=nu->pntsu-1) {
+ if (nu->flagu & CU_NURB_CYCLIC) {
+ if (starta!=0 || enda!=nu->pntsu-1) {
newnu->flagu &= ~CU_NURB_CYCLIC;
}
}
@@ -1859,19 +1878,19 @@ static void adduplicateflagNurb(Object *obedit, short flag)
bezt++;
}
}
- else if(nu->pntsv==1) { /* because UV Nurb has a different method for dupli */
+ else if (nu->pntsv==1) { /* because UV Nurb has a different method for dupli */
bp= nu->bp;
- for(a=0; a<nu->pntsu; a++) {
+ for (a=0; a<nu->pntsu; a++) {
enda= -1;
starta= a;
- while(bp->f1 & flag) {
+ while (bp->f1 & flag) {
select_bpoint(bp, DESELECT, flag, HIDDEN);
enda= a;
- if(a>=nu->pntsu-1) break;
+ if (a>=nu->pntsu-1) break;
a++;
bp++;
}
- if(enda>=starta) {
+ if (enda>=starta) {
newnu = (Nurb*)MEM_mallocN(sizeof(Nurb), "adduplicateN3");
memcpy(newnu, nu, sizeof(Nurb));
set_actNurb(obedit, newnu);
@@ -1882,13 +1901,13 @@ static void adduplicateflagNurb(Object *obedit, short flag)
b= newnu->pntsu;
bp1= newnu->bp;
- while(b--) {
+ while (b--) {
select_bpoint(bp1, SELECT, flag, HIDDEN);
bp1++;
}
- if(nu->flagu & CU_NURB_CYCLIC) {
- if(starta!=0 || enda!=nu->pntsu-1) {
+ if (nu->flagu & CU_NURB_CYCLIC) {
+ if (starta!=0 || enda!=nu->pntsu-1) {
newnu->flagu &= ~CU_NURB_CYCLIC;
}
}
@@ -1902,19 +1921,19 @@ static void adduplicateflagNurb(Object *obedit, short flag)
}
else {
/* a rectangular area in nurb has to be selected */
- if(isNurbsel(nu)) {
+ if (isNurbsel(nu)) {
usel= MEM_callocN(nu->pntsu, "adduplicateN4");
bp= nu->bp;
- for(a=0; a<nu->pntsv; a++) {
- for(b=0; b<nu->pntsu; b++, bp++) {
- if(bp->f1 & flag) usel[b]++;
+ for (a=0; a<nu->pntsv; a++) {
+ for (b=0; b<nu->pntsu; b++, bp++) {
+ if (bp->f1 & flag) usel[b]++;
}
}
newu= 0;
newv= 0;
- for(a=0; a<nu->pntsu; a++) {
- if(usel[a]) {
- if(newv==0 || usel[a]==newv) {
+ for (a=0; a<nu->pntsu; a++) {
+ if (usel[a]) {
+ if (newv==0 || usel[a]==newv) {
newv= usel[a];
newu++;
}
@@ -1924,13 +1943,13 @@ static void adduplicateflagNurb(Object *obedit, short flag)
}
}
}
- if(newu==0 || newv==0) {
- if (G.f & G_DEBUG)
+ if (newu==0 || newv==0) {
+ if (G.debug & G_DEBUG)
printf("Can't duplicate Nurb\n");
}
else {
- if(newu==1) SWAP(short, newu, newv);
+ if (newu==1) SWAP(short, newu, newv);
newnu = (Nurb*)MEM_mallocN(sizeof(Nurb), "adduplicateN5");
memcpy(newnu, nu, sizeof(Nurb));
@@ -1947,9 +1966,9 @@ static void adduplicateflagNurb(Object *obedit, short flag)
bp= newnu->bp;
bp1= nu->bp;
- for(a=0; a<nu->pntsv; a++) {
- for(b=0; b<nu->pntsu; b++, bp1++) {
- if(bp1->f1 & flag) {
+ for (a=0; a<nu->pntsv; a++) {
+ for (b=0; b<nu->pntsu; b++, bp1++) {
+ if (bp1->f1 & flag) {
memcpy(bp, bp1, sizeof(BPoint));
select_bpoint(bp1, DESELECT, flag, HIDDEN);
bp++;
@@ -1957,16 +1976,18 @@ static void adduplicateflagNurb(Object *obedit, short flag)
}
}
if (check_valid_nurb_u(newnu)) {
- if(nu->pntsu==newnu->pntsu && nu->knotsu) {
+ if (nu->pntsu==newnu->pntsu && nu->knotsu) {
newnu->knotsu= MEM_dupallocN( nu->knotsu );
- } else {
+ }
+ else {
nurbs_knot_calc_u(newnu);
}
}
if (check_valid_nurb_v(newnu)) {
- if(nu->pntsv==newnu->pntsv && nu->knotsv) {
+ if (nu->pntsv==newnu->pntsv && nu->knotsv) {
newnu->knotsv= MEM_dupallocN( nu->knotsv );
- } else {
+ }
+ else {
nurbs_knot_calc_v(newnu);
}
}
@@ -1990,13 +2011,13 @@ static int switch_direction_exec(bContext *C, wmOperator *UNUSED(op))
EditNurb *editnurb= cu->editnurb;
Nurb *nu;
- for(nu= editnurb->nurbs.first; nu; nu= nu->next)
- if(isNurbsel(nu)) {
+ for (nu= editnurb->nurbs.first; nu; nu= nu->next)
+ if (isNurbsel(nu)) {
switchdirectionNurb(nu);
keyData_switchDirectionNurb(cu, nu);
}
- if(ED_curve_updateAnimPaths(obedit))
+ if (ED_curve_updateAnimPaths(obedit))
WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, obedit);
DAG_id_tag_update(obedit->data, 0);
@@ -2008,16 +2029,16 @@ static int switch_direction_exec(bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_switch_direction(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Switch Direction";
- ot->description= "Switch direction of selected splines";
- ot->idname= "CURVE_OT_switch_direction";
+ ot->name = "Switch Direction";
+ ot->description = "Switch direction of selected splines";
+ ot->idname = "CURVE_OT_switch_direction";
/* api callbacks */
- ot->exec= switch_direction_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = switch_direction_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/****************** set weight operator *******************/
@@ -2032,16 +2053,16 @@ static int set_goal_weight_exec(bContext *C, wmOperator *op)
float weight= RNA_float_get(op->ptr, "weight");
int a;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->bezt) {
- for(bezt=nu->bezt, a=0; a<nu->pntsu; a++, bezt++) {
- if(bezt->f2 & SELECT)
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->bezt) {
+ for (bezt=nu->bezt, a=0; a<nu->pntsu; a++, bezt++) {
+ if (bezt->f2 & SELECT)
bezt->weight= weight;
}
}
- else if(nu->bp) {
- for(bp=nu->bp, a=0; a<nu->pntsu*nu->pntsv; a++, bp++) {
- if(bp->f1 & SELECT)
+ else if (nu->bp) {
+ for (bp=nu->bp, a=0; a<nu->pntsu*nu->pntsv; a++, bp++) {
+ if (bp->f1 & SELECT)
bp->weight= weight;
}
}
@@ -2056,17 +2077,17 @@ static int set_goal_weight_exec(bContext *C, wmOperator *op)
void CURVE_OT_spline_weight_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Goal Weight";
- ot->description= "Set softbody goal weight for selected points";
- ot->idname= "CURVE_OT_spline_weight_set";
+ ot->name = "Set Goal Weight";
+ ot->description = "Set softbody goal weight for selected points";
+ ot->idname = "CURVE_OT_spline_weight_set";
/* api callbacks */
- ot->exec= set_goal_weight_exec;
- ot->invoke= WM_operator_props_popup;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = set_goal_weight_exec;
+ ot->invoke = WM_operator_props_popup;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_float_factor(ot->srna, "weight", 1.0f, 0.0f, 1.0f, "Weight", "", 0.0f, 1.0f);
@@ -2084,16 +2105,16 @@ static int set_radius_exec(bContext *C, wmOperator *op)
float radius= RNA_float_get(op->ptr, "radius");
int a;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->bezt) {
- for(bezt=nu->bezt, a=0; a<nu->pntsu; a++, bezt++) {
- if(bezt->f2 & SELECT)
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->bezt) {
+ for (bezt=nu->bezt, a=0; a<nu->pntsu; a++, bezt++) {
+ if (bezt->f2 & SELECT)
bezt->radius= radius;
}
}
- else if(nu->bp) {
- for(bp=nu->bp, a=0; a<nu->pntsu*nu->pntsv; a++, bp++) {
- if(bp->f1 & SELECT)
+ else if (nu->bp) {
+ for (bp=nu->bp, a=0; a<nu->pntsu*nu->pntsv; a++, bp++) {
+ if (bp->f1 & SELECT)
bp->radius= radius;
}
}
@@ -2108,17 +2129,17 @@ static int set_radius_exec(bContext *C, wmOperator *op)
void CURVE_OT_radius_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Curve Radius";
- ot->description= "Set per-point radius which is used for bevel tapering";
- ot->idname= "CURVE_OT_radius_set";
+ ot->name = "Set Curve Radius";
+ ot->description = "Set per-point radius which is used for bevel tapering";
+ ot->idname = "CURVE_OT_radius_set";
/* api callbacks */
- ot->exec= set_radius_exec;
- ot->invoke= WM_operator_props_popup;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = set_radius_exec;
+ ot->invoke = WM_operator_props_popup;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_float(ot->srna, "radius", 1.0f, 0.0f, FLT_MAX, "Radius", "", 0.0001f, 10.0f);
@@ -2136,13 +2157,13 @@ static int smooth_exec(bContext *C, wmOperator *UNUSED(op))
float val, newval, offset;
int a, i, change = 0;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->bezt) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->bezt) {
change = 0;
beztOrig = MEM_dupallocN( nu->bezt );
- for(bezt=nu->bezt+1, a=1; a<nu->pntsu-1; a++, bezt++) {
- if(bezt->f2 & SELECT) {
- for(i=0; i<3; i++) {
+ for (bezt=nu->bezt+1, a=1; a<nu->pntsu-1; a++, bezt++) {
+ if (bezt->f2 & SELECT) {
+ for (i=0; i<3; i++) {
val = bezt->vec[1][i];
newval = ((beztOrig+(a-1))->vec[1][i] * 0.5f) + ((beztOrig+(a+1))->vec[1][i] * 0.5f);
offset = (val*((1.0f/6.0f)*5.0f)) + (newval*(1.0f/6.0f)) - val;
@@ -2157,12 +2178,13 @@ static int smooth_exec(bContext *C, wmOperator *UNUSED(op))
MEM_freeN(beztOrig);
if (change)
calchandlesNurb(nu);
- } else if (nu->bp) {
+ }
+ else if (nu->bp) {
bpOrig = MEM_dupallocN( nu->bp );
/* Same as above, keep these the same! */
- for(bp=nu->bp+1, a=1; a<nu->pntsu-1; a++, bp++) {
- if(bp->f1 & SELECT) {
- for(i=0; i<3; i++) {
+ for (bp=nu->bp+1, a=1; a<nu->pntsu-1; a++, bp++) {
+ if (bp->f1 & SELECT) {
+ for (i=0; i<3; i++) {
val = bp->vec[i];
newval = ((bpOrig+(a-1))->vec[i] * 0.5f) + ((bpOrig+(a+1))->vec[i] * 0.5f);
offset = (val*((1.0f/6.0f)*5.0f)) + (newval*(1.0f/6.0f)) - val;
@@ -2184,16 +2206,16 @@ static int smooth_exec(bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_smooth(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Smooth";
- ot->description= "Flatten angles of selected points";
- ot->idname= "CURVE_OT_smooth";
+ ot->name = "Smooth";
+ ot->description = "Flatten angles of selected points";
+ ot->idname = "CURVE_OT_smooth";
/* api callbacks */
- ot->exec= smooth_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = smooth_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/**************** smooth curve radius operator *************/
@@ -2213,24 +2235,24 @@ static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op))
int start_sel, end_sel; /* selection indices, inclusive */
float start_rad, end_rad, fac, range;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->bezt) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->bezt) {
for (last_sel=0; last_sel < nu->pntsu; last_sel++) {
/* loop over selection segments of a curve, smooth each */
/* Start BezTriple code, this is duplicated below for points, make sure these functions stay in sync */
start_sel = -1;
- for(bezt=nu->bezt+last_sel, a=last_sel; a<nu->pntsu; a++, bezt++) {
- if(bezt->f2 & SELECT) {
+ for (bezt=nu->bezt+last_sel, a=last_sel; a<nu->pntsu; a++, bezt++) {
+ if (bezt->f2 & SELECT) {
start_sel = a;
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) {
+ for (bezt=nu->bezt+(start_sel+1), a=start_sel+1; a<nu->pntsu; a++, bezt++) {
+ if ((bezt->f2 & SELECT)==0) {
break;
}
end_sel = a;
@@ -2238,7 +2260,8 @@ static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op))
if (start_sel == -1) {
last_sel = nu->pntsu; /* next... */
- } else {
+ }
+ else {
last_sel = end_sel; /* before we modify it */
/* now blend between start and end sel */
@@ -2252,47 +2275,51 @@ static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op))
if (start_rad >= 0.0f && end_rad >= 0.0f) (nu->bezt+start_sel)->radius = (start_rad + end_rad)/2;
else if (start_rad >= 0.0f) (nu->bezt+start_sel)->radius = start_rad;
else if (end_rad >= 0.0f) (nu->bezt+start_sel)->radius = end_rad;
- } else {
+ }
+ else {
/* if endpoints selected, then use them */
if (start_sel==0) {
start_rad = (nu->bezt+start_sel)->radius;
- start_sel++; /* we dont want to edit the selected endpoint */
- } else {
+ start_sel++; /* we don't want to edit the selected endpoint */
+ }
+ else {
start_rad = (nu->bezt+start_sel-1)->radius;
}
if (end_sel==nu->pntsu-1) {
end_rad = (nu->bezt+end_sel)->radius;
- end_sel--; /* we dont want to edit the selected endpoint */
- } else {
+ end_sel--; /* we don't want to edit the selected endpoint */
+ }
+ else {
end_rad = (nu->bezt+end_sel+1)->radius;
}
/* Now Blend between the points */
range = (float)(end_sel - start_sel) + 2.0f;
- for(bezt=nu->bezt+start_sel, a=start_sel; a<=end_sel; a++, bezt++) {
+ for (bezt=nu->bezt+start_sel, a=start_sel; a<=end_sel; a++, bezt++) {
fac = (float)(1+a-start_sel) / range;
bezt->radius = start_rad*(1.0f-fac) + end_rad*fac;
}
}
}
}
- } else if (nu->bp) {
+ }
+ else if (nu->bp) {
/* Same as above, keep these the same! */
for (last_sel=0; last_sel < nu->pntsu; last_sel++) {
/* loop over selection segments of a curve, smooth each */
/* Start BezTriple code, this is duplicated below for points, make sure these functions stay in sync */
start_sel = -1;
- for(bp=nu->bp+last_sel, a=last_sel; a<nu->pntsu; a++, bp++) {
- if(bp->f1 & SELECT) {
+ for (bp=nu->bp+last_sel, a=last_sel; a<nu->pntsu; a++, bp++) {
+ if (bp->f1 & SELECT) {
start_sel = a;
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) {
+ for (bp=nu->bp+(start_sel+1), a=start_sel+1; a<nu->pntsu; a++, bp++) {
+ if ((bp->f1 & SELECT)==0) {
break;
}
end_sel = a;
@@ -2300,7 +2327,8 @@ static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op))
if (start_sel == -1) {
last_sel = nu->pntsu; /* next... */
- } else {
+ }
+ else {
last_sel = end_sel; /* before we modify it */
/* now blend between start and end sel */
@@ -2314,24 +2342,27 @@ static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op))
if (start_rad >= 0.0f && end_rad >= 0.0f) (nu->bp+start_sel)->radius = (start_rad + end_rad)/2;
else if (start_rad >= 0.0f) (nu->bp+start_sel)->radius = start_rad;
else if (end_rad >= 0.0f) (nu->bp+start_sel)->radius = end_rad;
- } else {
+ }
+ else {
/* if endpoints selected, then use them */
if (start_sel==0) {
start_rad = (nu->bp+start_sel)->radius;
- start_sel++; /* we dont want to edit the selected endpoint */
- } else {
+ start_sel++; /* we don't want to edit the selected endpoint */
+ }
+ else {
start_rad = (nu->bp+start_sel-1)->radius;
}
if (end_sel==nu->pntsu-1) {
end_rad = (nu->bp+end_sel)->radius;
- end_sel--; /* we dont want to edit the selected endpoint */
- } else {
+ end_sel--; /* we don't want to edit the selected endpoint */
+ }
+ else {
end_rad = (nu->bp+end_sel+1)->radius;
}
/* Now Blend between the points */
range = (float)(end_sel - start_sel) + 2.0f;
- for(bp=nu->bp+start_sel, a=start_sel; a<=end_sel; a++, bp++) {
+ for (bp=nu->bp+start_sel, a=start_sel; a<=end_sel; a++, bp++) {
fac = (float)(1+a-start_sel) / range;
bp->radius = start_rad*(1.0f-fac) + end_rad*fac;
}
@@ -2350,16 +2381,16 @@ static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_smooth_radius(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Smooth Curve Radius";
- ot->description= "Flatten radiuses of selected points";
- ot->idname= "CURVE_OT_smooth_radius";
+ ot->name = "Smooth Curve Radius";
+ ot->description = "Flatten radiuses of selected points";
+ ot->idname = "CURVE_OT_smooth_radius";
/* api clastbacks */
- ot->exec= smooth_radius_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = smooth_radius_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/***************** selection utility *************************/
@@ -2367,7 +2398,7 @@ void CURVE_OT_smooth_radius(wmOperatorType *ot)
/* next == 1 -> select next */
/* next == -1 -> select previous */
/* cont == 1 -> select continuously */
-/* selstatus, inverts behaviour */
+/* selstatus, inverts behavior */
static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short selstatus)
{
Nurb *nu;
@@ -2376,21 +2407,21 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short
int a;
short lastsel= 0;
- if(next==0) return;
+ if (next==0) return;
- for(nu= editnurb->first; nu; nu= nu->next) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
lastsel=0;
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
a= nu->pntsu;
bezt= nu->bezt;
- if(next < 0) bezt= (nu->bezt + (a-1));
- while(a--) {
- if(a-abs(next) < 0) break;
- if((lastsel==0) && (bezt->hide==0) && ((bezt->f2 & SELECT) || (selstatus==0))) {
+ if (next < 0) bezt= (nu->bezt + (a-1));
+ while (a--) {
+ if (a-abs(next) < 0) break;
+ if ((lastsel==0) && (bezt->hide==0) && ((bezt->f2 & SELECT) || (selstatus==0))) {
bezt+=next;
- if(!(bezt->f2 & SELECT) || (selstatus==0)) {
+ if (!(bezt->f2 & SELECT) || (selstatus==0)) {
short sel= select_beztriple(bezt, selstatus, 1, VISIBLE);
- if((sel==1) && (cont==0)) lastsel= 1;
+ if ((sel==1) && (cont==0)) lastsel= 1;
}
}
else {
@@ -2404,14 +2435,14 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short
else {
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- if(next < 0) bp= (nu->bp + (a-1));
- while(a--) {
- if(a-abs(next) < 0) break;
- if((lastsel==0) && (bp->hide==0) && ((bp->f1 & SELECT) || (selstatus==0))) {
+ if (next < 0) bp= (nu->bp + (a-1));
+ while (a--) {
+ if (a-abs(next) < 0) break;
+ if ((lastsel==0) && (bp->hide==0) && ((bp->f1 & SELECT) || (selstatus==0))) {
bp+=next;
- if(!(bp->f1 & SELECT) || (selstatus==0)) {
+ if (!(bp->f1 & SELECT) || (selstatus==0)) {
short sel= select_bpoint(bp, selstatus, 1, VISIBLE);
- if((sel==1) && (cont==0)) lastsel= 1;
+ if ((sel==1) && (cont==0)) lastsel= 1;
}
}
else {
@@ -2440,49 +2471,49 @@ void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatu
Curve *cu;
int a;
- if(obedit==NULL) return;
+ if (obedit==NULL) return;
cu= (Curve*)obedit->data;
cu->lastsel= NULL;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->type == CU_BEZIER) {
a= nu->pntsu;
/* which point? */
- if(selfirst==0) { /* select last */
+ if (selfirst==0) { /* select last */
bezt= (nu->bezt + (a-1));
}
else { /* select first */
bezt= nu->bezt;
}
- while(a--) {
+ while (a--) {
short sel;
- if(doswap) sel= swap_selection_beztriple(bezt);
+ if (doswap) sel= swap_selection_beztriple(bezt);
else sel= select_beztriple(bezt, selstatus, 1, VISIBLE);
- if(sel==1) break;
+ if (sel==1) break;
}
}
else {
a= nu->pntsu*nu->pntsv;
/* which point? */
- if(selfirst==0) { /* select last */
+ if (selfirst==0) { /* select last */
bp= (nu->bp + (a-1));
}
- else{ /* select first */
+ else { /* select first */
bp= nu->bp;
}
- while(a--) {
+ while (a--) {
if (bp->hide == 0) {
short sel;
- if(doswap) sel= swap_selection_bpoint(bp);
+ if (doswap) sel= swap_selection_bpoint(bp);
else sel= select_bpoint(bp, selstatus, 1, VISIBLE);
- if(sel==1) break;
+ if (sel==1) break;
}
}
}
@@ -2502,15 +2533,15 @@ static int de_select_first_exec(bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_de_select_first(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select or Deselect First";
- ot->idname= "CURVE_OT_de_select_first";
+ ot->name = "(De)select First";
+ ot->idname = "CURVE_OT_de_select_first";
/* api cfirstbacks */
- ot->exec= de_select_first_exec;
- ot->poll= ED_operator_editcurve;
+ ot->exec = de_select_first_exec;
+ ot->poll = ED_operator_editcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int de_select_last_exec(bContext *C, wmOperator *UNUSED(op))
@@ -2526,15 +2557,15 @@ static int de_select_last_exec(bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_de_select_last(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select or Deselect Last";
- ot->idname= "CURVE_OT_de_select_last";
+ ot->name = "(De)select Last";
+ ot->idname = "CURVE_OT_de_select_last";
/* api clastbacks */
- ot->exec= de_select_last_exec;
- ot->poll= ED_operator_editcurve;
+ ot->exec = de_select_last_exec;
+ ot->poll = ED_operator_editcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/******************* de select all operator ***************/
@@ -2546,13 +2577,13 @@ static short nurb_has_selected_cps(ListBase *editnurb)
BPoint *bp;
int a;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->type == CU_BEZIER) {
a= nu->pntsu;
bezt= nu->bezt;
- while(a--) {
- if(bezt->hide==0) {
- if((bezt->f1 & SELECT)
+ while (a--) {
+ if (bezt->hide==0) {
+ if ((bezt->f1 & SELECT)
|| (bezt->f2 & SELECT)
|| (bezt->f3 & SELECT)) return 1;
}
@@ -2562,8 +2593,8 @@ static short nurb_has_selected_cps(ListBase *editnurb)
else {
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- while(a--) {
- if((bp->hide==0) && (bp->f1 & SELECT)) return 1;
+ while (a--) {
+ if ((bp->hide==0) && (bp->f1 & SELECT)) return 1;
bp++;
}
}
@@ -2580,7 +2611,7 @@ static int de_select_all_exec(bContext *C, wmOperator *op)
if (action == SEL_TOGGLE) {
action = SEL_SELECT;
- if(nurb_has_selected_cps(editnurb))
+ if (nurb_has_selected_cps(editnurb))
action = SEL_DESELECT;
}
@@ -2604,15 +2635,15 @@ static int de_select_all_exec(bContext *C, wmOperator *op)
void CURVE_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select or Deselect All";
- ot->idname= "CURVE_OT_select_all";
+ ot->name = "(De)select All";
+ ot->idname = "CURVE_OT_select_all";
/* api callbacks */
- ot->exec= de_select_all_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = de_select_all_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
WM_operator_properties_select_all(ot);
@@ -2630,42 +2661,42 @@ static int hide_exec(bContext *C, wmOperator *op)
BezTriple *bezt;
int a, sel, invert= RNA_boolean_get(op->ptr, "unselected");
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
sel= 0;
- while(a--) {
- if(invert == 0 && BEZSELECTED_HIDDENHANDLES(cu, bezt)) {
+ while (a--) {
+ if (invert == 0 && BEZSELECTED_HIDDENHANDLES(cu, bezt)) {
select_beztriple(bezt, DESELECT, 1, HIDDEN);
bezt->hide= 1;
}
- else if(invert && !BEZSELECTED_HIDDENHANDLES(cu, bezt)) {
+ else if (invert && !BEZSELECTED_HIDDENHANDLES(cu, bezt)) {
select_beztriple(bezt, DESELECT, 1, HIDDEN);
bezt->hide= 1;
}
- if(bezt->hide) sel++;
+ if (bezt->hide) sel++;
bezt++;
}
- if(sel==nu->pntsu) nu->hide= 1;
+ if (sel==nu->pntsu) nu->hide= 1;
}
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
sel= 0;
- while(a--) {
- if(invert==0 && (bp->f1 & SELECT)) {
+ while (a--) {
+ if (invert==0 && (bp->f1 & SELECT)) {
select_bpoint(bp, DESELECT, 1, HIDDEN);
bp->hide= 1;
}
- else if(invert && (bp->f1 & SELECT)==0) {
+ else if (invert && (bp->f1 & SELECT)==0) {
select_bpoint(bp, DESELECT, 1, HIDDEN);
bp->hide= 1;
}
- if(bp->hide) sel++;
+ if (bp->hide) sel++;
bp++;
}
- if(sel==nu->pntsu*nu->pntsv) nu->hide= 1;
+ if (sel==nu->pntsu*nu->pntsv) nu->hide= 1;
}
}
@@ -2678,15 +2709,15 @@ static int hide_exec(bContext *C, wmOperator *op)
void CURVE_OT_hide(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Hide Selected";
- ot->idname= "CURVE_OT_hide";
+ ot->name = "Hide Selected";
+ ot->idname = "CURVE_OT_hide";
/* api callbacks */
- ot->exec= hide_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = hide_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected");
@@ -2703,13 +2734,13 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
BezTriple *bezt;
int a;
- for(nu= editnurb->first; nu; nu= nu->next) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
nu->hide= 0;
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
- if(bezt->hide) {
+ while (a--) {
+ if (bezt->hide) {
select_beztriple(bezt, SELECT, 1, HIDDEN);
bezt->hide= 0;
}
@@ -2719,8 +2750,8 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->hide) {
+ while (a--) {
+ if (bp->hide) {
select_bpoint(bp, SELECT, 1, HIDDEN);
bp->hide= 0;
}
@@ -2738,15 +2769,15 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_reveal(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reveal Hidden";
- ot->idname= "CURVE_OT_reveal";
+ ot->name = "Reveal Hidden";
+ ot->idname = "CURVE_OT_reveal";
/* api callbacks */
- ot->exec= reveal_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = reveal_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** subdivide operator *********************/
@@ -2768,16 +2799,16 @@ static void subdividenurb(Object *obedit, int number_cuts)
// printf("*** subdivideNurb: entering subdivide\n");
- for(nu= editnurb->nurbs.first; nu; nu= nu->next) {
+ for (nu= editnurb->nurbs.first; nu; nu= nu->next) {
amount= 0;
- if(nu->type == CU_BEZIER) {
+ 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) {
+ if (nu->flagu & CU_NURB_CYCLIC) {
a= nu->pntsu;
bezt= nu->bezt;
prevbezt= bezt+(a-1);
@@ -2787,18 +2818,18 @@ static void subdividenurb(Object *obedit, int number_cuts)
prevbezt= nu->bezt;
bezt= prevbezt+1;
}
- while(a--) {
- if( BEZSELECTED_HIDDENHANDLES(cu, prevbezt) && BEZSELECTED_HIDDENHANDLES(cu, bezt) ) amount+=number_cuts;
+ while (a--) {
+ if ( BEZSELECTED_HIDDENHANDLES(cu, prevbezt) && BEZSELECTED_HIDDENHANDLES(cu, bezt) ) amount+=number_cuts;
prevbezt= bezt;
bezt++;
}
- if(amount) {
+ if (amount) {
/* insert */
beztnew =
(BezTriple*)MEM_mallocN((amount + nu->pntsu) * sizeof(BezTriple), "subdivNurb");
beztn= beztnew;
- if(nu->flagu & CU_NURB_CYCLIC) {
+ if (nu->flagu & CU_NURB_CYCLIC) {
a= nu->pntsu;
bezt= nu->bezt;
prevbezt= bezt+(a-1);
@@ -2808,12 +2839,12 @@ static void subdividenurb(Object *obedit, int number_cuts)
prevbezt= nu->bezt;
bezt= prevbezt+1;
}
- while(a--) {
+ while (a--) {
memcpy(beztn, prevbezt, sizeof(BezTriple));
keyIndex_updateBezt(editnurb, prevbezt, beztn, 1);
beztn++;
- if( BEZSELECTED_HIDDENHANDLES(cu, prevbezt) && BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
+ if ( BEZSELECTED_HIDDENHANDLES(cu, prevbezt) && BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
float prevvec[3][3];
memcpy(prevvec, prevbezt->vec, sizeof(float) * 9);
@@ -2838,7 +2869,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
interp_v3_v3v3(beztn->vec[1], vec+9, vec+12, factor);
copy_v3_v3(beztn->vec[2], vec+12);
/* handle of next bezt */
- if(a==0 && i == number_cuts - 1 && (nu->flagu & CU_NURB_CYCLIC)) {copy_v3_v3(beztnew->vec[0], vec+6);}
+ if (a==0 && i == number_cuts - 1 && (nu->flagu & CU_NURB_CYCLIC)) {copy_v3_v3(beztnew->vec[0], vec+6);}
else {copy_v3_v3(bezt->vec[0], vec+6);}
beztn->radius = (prevbezt->radius + bezt->radius)/2;
@@ -2853,7 +2884,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
bezt++;
}
/* last point */
- if((nu->flagu & CU_NURB_CYCLIC)==0) {
+ if ((nu->flagu & CU_NURB_CYCLIC)==0) {
memcpy(beztn, prevbezt, sizeof(BezTriple));
keyIndex_updateBezt(editnurb, prevbezt, beztn, 1);
}
@@ -2867,13 +2898,13 @@ 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) {
+ if (nu->flagu & CU_NURB_CYCLIC) {
a= nu->pntsu;
bp= nu->bp;
prevbp= bp+(a-1);
@@ -2883,19 +2914,19 @@ static void subdividenurb(Object *obedit, int number_cuts)
prevbp= nu->bp;
bp= prevbp+1;
}
- while(a--) {
- if( (bp->f1 & SELECT) && (prevbp->f1 & SELECT) ) amount+=number_cuts;
+ while (a--) {
+ if ( (bp->f1 & SELECT) && (prevbp->f1 & SELECT) ) amount+=number_cuts;
prevbp= bp;
bp++;
}
- if(amount) {
+ if (amount) {
/* insert */
bpnew =
(BPoint*)MEM_mallocN((amount + nu->pntsu) * sizeof(BPoint), "subdivNurb2");
bpn= bpnew;
- if(nu->flagu & CU_NURB_CYCLIC) {
+ if (nu->flagu & CU_NURB_CYCLIC) {
a= nu->pntsu;
bp= nu->bp;
prevbp= bp+(a-1);
@@ -2905,12 +2936,12 @@ static void subdividenurb(Object *obedit, int number_cuts)
prevbp= nu->bp;
bp= prevbp+1;
}
- while(a--) {
+ while (a--) {
memcpy(bpn, prevbp, sizeof(BPoint));
keyIndex_updateBP(editnurb, prevbp, bpn, 1);
bpn++;
- if( (bp->f1 & SELECT) && (prevbp->f1 & SELECT) ) {
+ if ( (bp->f1 & SELECT) && (prevbp->f1 & SELECT) ) {
// printf("*** subdivideNurb: insert 'linear' point\n");
for (i = 0; i < number_cuts; i++) {
factor = (float)(i + 1) / (number_cuts + 1);
@@ -2924,7 +2955,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
prevbp= bp;
bp++;
}
- if((nu->flagu & CU_NURB_CYCLIC)==0) { /* last point */
+ if ((nu->flagu & CU_NURB_CYCLIC)==0) { /* last point */
memcpy(bpn, prevbp, sizeof(BPoint));
keyIndex_updateBP(editnurb, prevbp, bpn, 1);
}
@@ -2933,54 +2964,54 @@ static void subdividenurb(Object *obedit, int number_cuts)
nu->bp= bpnew;
nu->pntsu+= amount;
- if(nu->type & CU_NURBS) {
+ if (nu->type & CU_NURBS) {
nurbs_knot_calc_u(nu);
}
}
- } /* End of 'else if(nu->pntsv==1)' */
- else if(nu->type == CU_NURBS) {
+ } /* End of 'else if (nu->pntsv==1)' */
+ 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");
@@ -2988,9 +3019,9 @@ static void subdividenurb(Object *obedit, int number_cuts)
/* Count the number of selected points. */
bp= nu->bp;
- for(a=0; a<nu->pntsv; a++) {
- for(b=0; b<nu->pntsu; b++) {
- if(bp->f1 & SELECT) {
+ for (a=0; a<nu->pntsv; a++) {
+ for (b=0; b<nu->pntsu; b++) {
+ if (bp->f1 & SELECT) {
usel[b]++;
vsel[a]++;
sel++;
@@ -2998,9 +3029,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;
@@ -3011,13 +3042,13 @@ static void subdividenurb(Object *obedit, int number_cuts)
bpn=bpnew= MEM_mallocN( tot*sizeof(BPoint), "subdivideNurb4");
bp= nu->bp;
/* first subdivide rows */
- for(a=0; a<nu->pntsv; a++) {
- for(b=0; b<nu->pntsu; b++) {
+ for (a=0; a<nu->pntsv; a++) {
+ for (b=0; b<nu->pntsu; b++) {
*bpn= *bp;
keyIndex_updateBP(editnurb, bp, bpn, 1);
bpn++;
bp++;
- if(b<nu->pntsu-1) {
+ if (b<nu->pntsu-1) {
prevbp= bp-1;
for (i = 0; i < number_cuts; i++) {
factor = (float)(i + 1) / (number_cuts + 1);
@@ -3033,9 +3064,9 @@ static void subdividenurb(Object *obedit, int number_cuts)
bpn= bpnew+((number_cuts+1)*nu->pntsu - number_cuts);
bp= bpnew+(number_cuts+1)*((number_cuts+1)*nu->pntsu-number_cuts);
prevbp= bpnew;
- for(a=1; a<nu->pntsv; a++) {
+ for (a=1; a<nu->pntsv; a++) {
- for(b=0; b<(number_cuts+1)*nu->pntsu-number_cuts; b++) {
+ for (b=0; b<(number_cuts+1)*nu->pntsu-number_cuts; b++) {
BPoint *tmp= bpn;
for (i = 0; i < number_cuts; i++) {
factor = (float)(i + 1) / (number_cuts + 1);
@@ -3061,32 +3092,32 @@ static void subdividenurb(Object *obedit, int number_cuts)
else {
/* subdivide in v direction? */
sel= 0;
- for(a=0; a<nu->pntsv-1; a++) {
- if(vsel[a]==nu->pntsu && vsel[a+1]==nu->pntsu) sel+=number_cuts;
+ for (a=0; a<nu->pntsv-1; a++) {
+ if (vsel[a]==nu->pntsu && vsel[a+1]==nu->pntsu) sel+=number_cuts;
}
- if(sel) { /* V ! */
+ if (sel) { /* V ! */
bpn=bpnew= MEM_mallocN( (sel+nu->pntsv)*nu->pntsu*sizeof(BPoint), "subdivideNurb4");
bp= nu->bp;
- for(a=0; a<nu->pntsv; a++) {
- for(b=0; b<nu->pntsu; b++) {
+ for (a=0; a<nu->pntsv; a++) {
+ for (b=0; b<nu->pntsu; b++) {
*bpn= *bp;
keyIndex_updateBP(editnurb, bp, bpn, 1);
bpn++;
bp++;
}
- if( (a<nu->pntsv-1) && vsel[a]==nu->pntsu && vsel[a+1]==nu->pntsu ) {
+ if ( (a<nu->pntsv-1) && vsel[a]==nu->pntsu && vsel[a+1]==nu->pntsu ) {
for (i = 0; i < number_cuts; i++) {
factor = (float)(i + 1) / (number_cuts + 1);
prevbp= bp- nu->pntsu;
- for(b=0; b<nu->pntsu; b++) {
+ 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++;
@@ -3106,29 +3137,29 @@ static void subdividenurb(Object *obedit, int number_cuts)
else {
/* or in u direction? */
sel= 0;
- for(a=0; a<nu->pntsu-1; a++) {
- if(usel[a]==nu->pntsv && usel[a+1]==nu->pntsv) sel+=number_cuts;
+ for (a=0; a<nu->pntsu-1; a++) {
+ if (usel[a]==nu->pntsv && usel[a+1]==nu->pntsv) sel+=number_cuts;
}
- if(sel) { /* U ! */
+ if (sel) { /* U ! */
/* Inserting U points is sort of 'default' Flat curves only get */
/* U points inserted in them. */
bpn=bpnew= MEM_mallocN( (sel+nu->pntsu)*nu->pntsv*sizeof(BPoint), "subdivideNurb4");
bp= nu->bp;
- for(a=0; a<nu->pntsv; a++) {
- for(b=0; b<nu->pntsu; b++) {
+ for (a=0; a<nu->pntsv; a++) {
+ for (b=0; b<nu->pntsu; b++) {
*bpn= *bp;
keyIndex_updateBP(editnurb, bp, bpn, 1);
bpn++;
bp++;
- if( (b<nu->pntsu-1) && usel[b]==nu->pntsv && usel[b+1]==nu->pntsv ) {
+ 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;
@@ -3160,7 +3191,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
subdividenurb(obedit, number_cuts);
- if(ED_curve_updateAnimPaths(obedit))
+ if (ED_curve_updateAnimPaths(obedit))
WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, obedit);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
@@ -3171,19 +3202,23 @@ static int subdivide_exec(bContext *C, wmOperator *op)
void CURVE_OT_subdivide(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
- ot->name= "Subdivide";
- ot->description= "Subdivide selected segments";
- ot->idname= "CURVE_OT_subdivide";
+ ot->name = "Subdivide";
+ ot->description = "Subdivide selected segments";
+ ot->idname = "CURVE_OT_subdivide";
/* api callbacks */
- ot->exec= subdivide_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = subdivide_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of cuts", "", 1, 10);
+ prop = RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of cuts", "", 1, 10);
+ /* avoid re-using last var because it can cause _very_ high poly meshes and annoy users (or worse crash) */
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
/******************** find nearest ************************/
@@ -3197,12 +3232,15 @@ static void findnearestNurbvert__doClosest(void *userData, Nurb *nu, BPoint *bp,
if (bp) {
flag = bp->f1;
- } else {
+ }
+ else {
if (beztindex==0) {
flag = bezt->f1;
- } else if (beztindex==1) {
+ }
+ else if (beztindex==1) {
flag = bezt->f2;
- } else {
+ }
+ else {
flag = bezt->f3;
}
}
@@ -3256,19 +3294,19 @@ static void findselectedNurbvert(ListBase *editnurb, Nurb **nu, BezTriple **bezt
*nu= NULL;
*bezt= NULL;
*bp= NULL;
- for(nu1= editnurb->first; nu1; nu1= nu1->next) {
- if(nu1->type == CU_BEZIER) {
+ for (nu1= editnurb->first; nu1; nu1= nu1->next) {
+ if (nu1->type == CU_BEZIER) {
bezt1= nu1->bezt;
a= nu1->pntsu;
- while(a--) {
- if( (bezt1->f1 & SELECT) || (bezt1->f2 & SELECT) || (bezt1->f3 & SELECT) ) {
- if(*nu != NULL && *nu != nu1) {
+ while (a--) {
+ if ( (bezt1->f1 & SELECT) || (bezt1->f2 & SELECT) || (bezt1->f3 & SELECT) ) {
+ if (*nu != NULL && *nu != nu1) {
*nu= NULL;
*bp= NULL;
*bezt= NULL;
return;
}
- else if(*bezt || *bp) {
+ else if (*bezt || *bp) {
*bp= NULL;
*bezt= NULL;
}
@@ -3283,15 +3321,15 @@ static void findselectedNurbvert(ListBase *editnurb, Nurb **nu, BezTriple **bezt
else {
bp1= nu1->bp;
a= nu1->pntsu*nu1->pntsv;
- while(a--) {
- if( bp1->f1 & 1 ) {
- if(*nu != NULL && *nu != nu1) {
+ while (a--) {
+ if ( bp1->f1 & 1 ) {
+ if (*nu != NULL && *nu != nu1) {
*bp= NULL;
*bezt= NULL;
*nu= NULL;
return;
}
- else if(*bezt || *bp) {
+ else if (*bezt || *bp) {
*bp= NULL;
*bezt= NULL;
}
@@ -3314,15 +3352,15 @@ static int convertspline(short type, Nurb *nu)
BPoint *bp;
int a, c, nr;
- if(nu->type == CU_POLY) {
- if(type==CU_BEZIER) { /* to Bezier with vecthandles */
+ if (nu->type == CU_POLY) {
+ if (type==CU_BEZIER) { /* to Bezier with vecthandles */
nr= nu->pntsu;
bezt =
(BezTriple*)MEM_callocN(nr * sizeof(BezTriple), "setsplinetype2");
nu->bezt= bezt;
a= nr;
bp= nu->bp;
- while(a--) {
+ while (a--) {
copy_v3_v3(bezt->vec[1], bp->vec);
bezt->f1=bezt->f2=bezt->f3= bp->f1;
bezt->h1= bezt->h2= HD_VECT;
@@ -3337,28 +3375,28 @@ static int convertspline(short type, Nurb *nu)
nu->type = CU_BEZIER;
calchandlesNurb(nu);
}
- else if(type==CU_NURBS) {
+ else if (type==CU_NURBS) {
nu->type = CU_NURBS;
nu->orderu= 4;
nu->flagu &= CU_NURB_CYCLIC; /* disable all flags except for cyclic */
nurbs_knot_calc_u(nu);
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- while(a--) {
+ while (a--) {
bp->vec[3]= 1.0;
bp++;
}
}
}
- else if(nu->type == CU_BEZIER) { /* Bezier */
- if(type==CU_POLY || type==CU_NURBS) {
+ else if (nu->type == CU_BEZIER) { /* Bezier */
+ if (type==CU_POLY || type==CU_NURBS) {
nr= 3*nu->pntsu;
nu->bp = MEM_callocN(nr * sizeof(BPoint), "setsplinetype");
a= nu->pntsu;
bezt= nu->bezt;
bp= nu->bp;
- while(a--) {
- if(type==CU_POLY && bezt->h1==HD_VECT && bezt->h2==HD_VECT) {
+ while (a--) {
+ if (type==CU_POLY && bezt->h1==HD_VECT && bezt->h2==HD_VECT) {
/* vector handle becomes 1 poly vertice */
copy_v3_v3(bp->vec, bezt->vec[1]);
bp->vec[3]= 1.0;
@@ -3369,11 +3407,11 @@ static int convertspline(short type, Nurb *nu)
bp++;
}
else {
- for(c=0;c<3;c++) {
+ for (c=0;c<3;c++) {
copy_v3_v3(bp->vec, bezt->vec[c]);
bp->vec[3]= 1.0;
- if(c==0) bp->f1= bezt->f1;
- else if(c==1) bp->f1= bezt->f2;
+ if (c==0) bp->f1= bezt->f1;
+ else if (c==1) bp->f1= bezt->f2;
else bp->f1= bezt->f3;
bp->radius= bezt->radius;
bp->weight= bezt->weight;
@@ -3391,36 +3429,36 @@ static int convertspline(short type, Nurb *nu)
nu->type = type;
#if 0 /* UNUSED */
- if(nu->flagu & CU_NURB_CYCLIC) c= nu->orderu-1;
+ if (nu->flagu & CU_NURB_CYCLIC) c= nu->orderu-1;
else c= 0;
#endif
- if(type== CU_NURBS) {
+ if (type== CU_NURBS) {
nu->flagu &= CU_NURB_CYCLIC; /* disable all flags except for cyclic */
nu->flagu |= CU_NURB_BEZIER;
nurbs_knot_calc_u(nu);
}
}
}
- else if(nu->type == CU_NURBS) {
- if(type==CU_POLY) {
+ else if (nu->type == CU_NURBS) {
+ if (type==CU_POLY) {
nu->type = CU_POLY;
- if(nu->knotsu) MEM_freeN(nu->knotsu); /* python created nurbs have a knotsu of zero */
+ if (nu->knotsu) MEM_freeN(nu->knotsu); /* python created nurbs have a knotsu of zero */
nu->knotsu= NULL;
- if(nu->knotsv) MEM_freeN(nu->knotsv);
+ if (nu->knotsv) MEM_freeN(nu->knotsv);
nu->knotsv= NULL;
}
- else if(type==CU_BEZIER) { /* to Bezier */
+ else if (type==CU_BEZIER) { /* to Bezier */
nr= nu->pntsu/3;
- if(nr<2)
+ if (nr<2)
return 1; /* conversion impossible */
else {
bezt = MEM_callocN(nr * sizeof(BezTriple), "setsplinetype2");
nu->bezt= bezt;
a= nr;
bp= nu->bp;
- while(a--) {
+ while (a--) {
copy_v3_v3(bezt->vec[0], bp->vec);
bezt->f1= bp->f1;
bp++;
@@ -3459,22 +3497,22 @@ static int set_spline_type_exec(bContext *C, wmOperator *op)
Nurb *nu;
int changed=0, type= RNA_enum_get(op->ptr, "type");
- if(type==CU_CARDINAL || type==CU_BSPLINE) {
+ if (type==CU_CARDINAL || type==CU_BSPLINE) {
BKE_report(op->reports, RPT_ERROR, "Not implemented yet");
return OPERATOR_CANCELLED;
}
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(isNurbsel(nu)) {
- if(convertspline(type, nu))
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (isNurbsel(nu)) {
+ if (convertspline(type, nu))
BKE_report(op->reports, RPT_ERROR, "No conversion possible");
else
changed= 1;
}
}
- if(changed) {
- if(ED_curve_updateAnimPaths(obedit))
+ if (changed) {
+ if (ED_curve_updateAnimPaths(obedit))
WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, obedit);
DAG_id_tag_update(obedit->data, 0);
@@ -3498,20 +3536,20 @@ void CURVE_OT_spline_type_set(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Set Spline Type";
+ ot->name = "Set Spline Type";
ot->description = "Set type of active spline";
- ot->idname= "CURVE_OT_spline_type_set";
+ ot->idname = "CURVE_OT_spline_type_set";
/* api callbacks */
- ot->exec= set_spline_type_exec;
- ot->invoke= WM_menu_invoke;
- ot->poll= ED_operator_editcurve;
+ ot->exec = set_spline_type_exec;
+ ot->invoke = WM_menu_invoke;
+ ot->poll = ED_operator_editcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", type_items, CU_POLY, "Type", "Spline type");
+ ot->prop = RNA_def_enum(ot->srna, "type", type_items, CU_POLY, "Type", "Spline type");
}
/***************** set handle type operator *******************/
@@ -3541,20 +3579,20 @@ void CURVE_OT_handle_type_set(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Set Handle Type";
+ ot->name = "Set Handle Type";
ot->description = "Set type of handles for selected control points";
- ot->idname= "CURVE_OT_handle_type_set";
+ ot->idname = "CURVE_OT_handle_type_set";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= set_handle_type_exec;
- ot->poll= ED_operator_editcurve;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = set_handle_type_exec;
+ ot->poll = ED_operator_editcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", editcurve_handle_type_items, 1, "Type", "Spline type");
+ ot->prop = RNA_def_enum(ot->srna, "type", editcurve_handle_type_items, 1, "Type", "Spline type");
}
/***************** make segment operator **********************/
@@ -3566,14 +3604,14 @@ static void switchdirection_knots(float *base, int tot)
float *fp1, *fp2, *tempf;
int a;
- if(base==NULL || tot==0) return;
+ if (base==NULL || tot==0) return;
/* reverse knots */
a= tot;
fp1= base;
fp2= fp1+(a-1);
a/= 2;
- while(fp1!=fp2 && a>0) {
+ while (fp1!=fp2 && a>0) {
SWAP(float, *fp1, *fp2);
a--;
fp1++;
@@ -3583,7 +3621,7 @@ static void switchdirection_knots(float *base, int tot)
a= tot;
fp1= base;
fp2=tempf= MEM_mallocN(sizeof(float)*a, "switchdirect");
- while(a--) {
+ while (a--) {
fp2[0]= fabs(fp1[1]-fp1[0]);
fp1++;
fp2++;
@@ -3594,7 +3632,7 @@ static void switchdirection_knots(float *base, int tot)
fp2= tempf;
fp1[0]= 0.0;
fp1++;
- while(a--) {
+ while (a--) {
fp1[0]= fp1[-1]+fp2[0];
fp1++;
fp2++;
@@ -3617,8 +3655,8 @@ static void rotate_direction_nurb(Nurb *nu)
temp= MEM_dupallocN(nu->bp);
bp1= nu->bp;
- for(v=0; v<nu->pntsv; v++) {
- for(u=0; u<nu->pntsu; u++, bp1++) {
+ for (v=0; v<nu->pntsv; v++) {
+ for (u=0; u<nu->pntsu; u++, bp1++) {
bp2= temp + (nu->pntsu-u-1)*(nu->pntsv) + v;
*bp1= *bp2;
}
@@ -3634,8 +3672,8 @@ static int is_u_selected(Nurb *nu, int u)
/* what about resolu == 2? */
bp= nu->bp+u;
- for(v=0; v<nu->pntsv-1; v++, bp+=nu->pntsu) {
- if(v) if(bp->f1 & SELECT) return 1;
+ for (v=0; v<nu->pntsv-1; v++, bp+=nu->pntsu) {
+ if (v) if (bp->f1 & SELECT) return 1;
}
return 0;
@@ -3659,8 +3697,8 @@ static void make_selection_list_nurb(ListBase *editnurb)
float dist, headdist, taildist;
int a;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if( isNurbsel(nu) ) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if ( isNurbsel(nu) ) {
nus = (NurbSort*)MEM_callocN(sizeof(NurbSort), "sort");
BLI_addhead(&nbase, nus);
@@ -3668,7 +3706,7 @@ static void make_selection_list_nurb(ListBase *editnurb)
bp= nu->bp;
a= nu->pntsu;
- while(a--) {
+ while (a--) {
add_v3_v3(nus->vec, bp->vec);
bp++;
}
@@ -3684,29 +3722,29 @@ static void make_selection_list_nurb(ListBase *editnurb)
BLI_addtail( &nsortbase, nus);
/* now add, either at head or tail, the closest one */
- while(nbase.first) {
+ while (nbase.first) {
headdist= taildist= 1.0e30;
headdo= taildo= NULL;
nustest= nbase.first;
- while(nustest) {
+ while (nustest) {
dist= len_v3v3(nustest->vec, ((NurbSort *)nsortbase.first)->vec);
- if(dist<headdist) {
+ if (dist<headdist) {
headdist= dist;
headdo= nustest;
}
dist= len_v3v3(nustest->vec, ((NurbSort *)nsortbase.last)->vec);
- if(dist<taildist) {
+ if (dist<taildist) {
taildist= dist;
taildo= nustest;
}
nustest= nustest->next;
}
- if(headdist<taildist) {
+ if (headdist<taildist) {
BLI_remlink(&nbase, headdo);
BLI_addhead(&nsortbase, headdo);
}
@@ -3728,23 +3766,23 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
/* first nurbs: u = resolu-1 selected */
- if( is_u_selected(nu1, nu1->pntsu-1) );
+ if ( is_u_selected(nu1, nu1->pntsu-1) );
else {
/* For 2D curves blender uses orderv=0. It doesn't make any sense mathematically. */
/* but after rotating orderu=0 will be confusing. */
if (nu1->orderv == 0) nu1->orderv= 1;
rotate_direction_nurb(nu1);
- if( is_u_selected(nu1, nu1->pntsu-1) );
+ if ( is_u_selected(nu1, nu1->pntsu-1) );
else {
rotate_direction_nurb(nu1);
- if( is_u_selected(nu1, nu1->pntsu-1) );
+ if ( is_u_selected(nu1, nu1->pntsu-1) );
else {
rotate_direction_nurb(nu1);
- if( is_u_selected(nu1, nu1->pntsu-1) );
+ if ( is_u_selected(nu1, nu1->pntsu-1) );
else {
/* rotate again, now its OK! */
- if(nu1->pntsv!=1) rotate_direction_nurb(nu1);
+ if (nu1->pntsv!=1) rotate_direction_nurb(nu1);
return;
}
}
@@ -3752,40 +3790,40 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
}
/* 2nd nurbs: u = 0 selected */
- if( is_u_selected(nu2, 0) );
+ if ( is_u_selected(nu2, 0) );
else {
if (nu2->orderv == 0) nu2->orderv= 1;
rotate_direction_nurb(nu2);
- if( is_u_selected(nu2, 0) );
+ if ( is_u_selected(nu2, 0) );
else {
rotate_direction_nurb(nu2);
- if( is_u_selected(nu2, 0) );
+ if ( is_u_selected(nu2, 0) );
else {
rotate_direction_nurb(nu2);
- if( is_u_selected(nu2, 0) );
+ if ( is_u_selected(nu2, 0) );
else {
/* rotate again, now its OK! */
- if(nu1->pntsu==1) rotate_direction_nurb(nu1);
- if(nu2->pntsv!=1) rotate_direction_nurb(nu2);
+ if (nu1->pntsu==1) rotate_direction_nurb(nu1);
+ if (nu2->pntsv!=1) rotate_direction_nurb(nu2);
return;
}
}
}
}
- if( nu1->pntsv != nu2->pntsv ) {
+ if ( nu1->pntsv != nu2->pntsv ) {
BKE_report(op->reports, RPT_ERROR, "Resolution doesn't match");
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;
bp2= nu2->bp;
len1= 0.0;
- for(v=0; v<nu1->pntsv; v++, bp1+=nu1->pntsu, bp2+=nu2->pntsu) {
+ for (v=0; v<nu1->pntsv; v++, bp1+=nu1->pntsu, bp2+=nu2->pntsu) {
len1+= len_v3v3(bp1->vec, bp2->vec);
}
@@ -3793,29 +3831,29 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
bp2= nu2->bp + nu2->pntsu*(nu2->pntsv-1);
len2= 0.0;
- for(v=0; v<nu1->pntsv; v++, bp1+=nu1->pntsu, bp2-=nu2->pntsu) {
+ for (v=0; v<nu1->pntsv; v++, bp1+=nu1->pntsu, bp2-=nu2->pntsu) {
len2+= len_v3v3(bp1->vec, bp2->vec);
}
/* merge */
origu= nu1->pntsu;
nu1->pntsu+= nu2->pntsu;
- if(nu1->orderu<3 && nu1->orderu<nu1->pntsu) nu1->orderu++;
- if(nu1->orderv<3 && nu1->orderv<nu1->pntsv) nu1->orderv++;
+ if (nu1->orderu<3 && nu1->orderu<nu1->pntsu) nu1->orderu++;
+ if (nu1->orderv<3 && nu1->orderv<nu1->pntsv) nu1->orderv++;
temp= nu1->bp;
nu1->bp= MEM_mallocN(nu1->pntsu*nu1->pntsv*sizeof(BPoint), "mergeBP");
bp= nu1->bp;
bp1= temp;
- for(v=0; v<nu1->pntsv; v++) {
+ for (v=0; v<nu1->pntsv; v++) {
/* switch direction? */
- if(len1<len2) bp2= nu2->bp + v*nu2->pntsu;
+ if (len1<len2) bp2= nu2->bp + v*nu2->pntsu;
else bp2= nu2->bp + (nu1->pntsv-v-1)*nu2->pntsu;
- for(u=0; u<nu1->pntsu; u++, bp++) {
- if(u<origu) {
+ for (u=0; u<nu1->pntsu; u++, bp++) {
+ if (u<origu) {
*bp= *bp1; bp1++;
select_bpoint(bp, SELECT, 1, HIDDEN);
}
@@ -3825,7 +3863,7 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
}
}
- if(nu1->type == CU_NURBS) {
+ if (nu1->type == CU_NURBS) {
/* merge knots */
nurbs_knot_calc_u(nu1);
@@ -3847,7 +3885,7 @@ static int merge_nurb(bContext *C, wmOperator *op)
make_selection_list_nurb(editnurb);
- if(nsortbase.first == nsortbase.last) {
+ if (nsortbase.first == nsortbase.last) {
BLI_freelistN(&nsortbase);
BKE_report(op->reports, RPT_ERROR, "Too few selections to merge");
return OPERATOR_CANCELLED;
@@ -3857,27 +3895,27 @@ static int merge_nurb(bContext *C, wmOperator *op)
nus2= nus1->next;
/* resolution match, to avoid uv rotations */
- if(nus1->nu->pntsv==1) {
- if(nus1->nu->pntsu==nus2->nu->pntsu || nus1->nu->pntsu==nus2->nu->pntsv);
+ if (nus1->nu->pntsv==1) {
+ if (nus1->nu->pntsu==nus2->nu->pntsu || nus1->nu->pntsu==nus2->nu->pntsv);
else ok= 0;
}
- else if(nus2->nu->pntsv==1) {
- if(nus2->nu->pntsu==nus1->nu->pntsu || nus2->nu->pntsu==nus1->nu->pntsv);
+ else if (nus2->nu->pntsv==1) {
+ if (nus2->nu->pntsu==nus1->nu->pntsu || nus2->nu->pntsu==nus1->nu->pntsv);
else ok= 0;
}
- else if( nus1->nu->pntsu==nus2->nu->pntsu || nus1->nu->pntsv==nus2->nu->pntsv);
- else if( nus1->nu->pntsu==nus2->nu->pntsv || nus1->nu->pntsv==nus2->nu->pntsu);
+ else if ( nus1->nu->pntsu==nus2->nu->pntsu || nus1->nu->pntsv==nus2->nu->pntsv);
+ else if ( nus1->nu->pntsu==nus2->nu->pntsv || nus1->nu->pntsv==nus2->nu->pntsu);
else {
ok= 0;
}
- if(ok==0) {
+ if (ok==0) {
BKE_report(op->reports, RPT_ERROR, "Resolution doesn't match");
BLI_freelistN(&nsortbase);
return OPERATOR_CANCELLED;
}
- while(nus2) {
+ while (nus2) {
merge_2_nurb(op, editnurb, nus1->nu, nus2->nu);
nus2= nus2->next;
}
@@ -3904,18 +3942,18 @@ static int make_segment_exec(bContext *C, wmOperator *op)
int a, ok= 0;
/* first decide if this is a surface merge! */
- if(obedit->type==OB_SURF) nu= nubase->first;
+ if (obedit->type==OB_SURF) nu= nubase->first;
else nu= NULL;
- while(nu) {
- if( isNurbsel(nu) ) {
+ while (nu) {
+ if ( isNurbsel(nu) ) {
- if(nu->pntsu>1 && nu->pntsv>1) break;
- if(isNurbsel_count(cu, nu)>1) break;
- if(isNurbsel_count(cu, nu)==1) {
+ if (nu->pntsu>1 && nu->pntsv>1) break;
+ if (isNurbsel_count(cu, nu)>1) break;
+ if (isNurbsel_count(cu, nu)==1) {
/* only 1 selected, not first or last, a little complex, but intuitive */
- if(nu->pntsv==1) {
- if( (nu->bp->f1 & SELECT) || ((nu->bp+nu->pntsu-1)->f1 & SELECT));
+ if (nu->pntsv==1) {
+ if ( (nu->bp->f1 & SELECT) || ((nu->bp+nu->pntsu-1)->f1 & SELECT));
else break;
}
}
@@ -3923,62 +3961,62 @@ static int make_segment_exec(bContext *C, wmOperator *op)
nu= nu->next;
}
- if(nu)
+ if (nu)
return merge_nurb(C, op);
/* find both nurbs and points, nu1 will be put behind nu2 */
- for(nu= nubase->first; nu; nu= nu->next) {
- if(nu->pntsu == 1)
+ for (nu= nubase->first; nu; nu= nu->next) {
+ if (nu->pntsu == 1)
nu->flagu&= ~CU_NURB_CYCLIC;
- if((nu->flagu & CU_NURB_CYCLIC)==0) { /* not cyclic */
- if(nu->type == CU_BEZIER) {
- if(nu1==NULL) {
- if( BEZSELECTED_HIDDENHANDLES(cu, nu->bezt) ) nu1= nu;
+ if ((nu->flagu & CU_NURB_CYCLIC)==0) { /* not cyclic */
+ if (nu->type == CU_BEZIER) {
+ if (nu1==NULL) {
+ if ( BEZSELECTED_HIDDENHANDLES(cu, nu->bezt) ) nu1= nu;
else {
- if( BEZSELECTED_HIDDENHANDLES(cu, &(nu->bezt[nu->pntsu-1])) ) {
+ if ( BEZSELECTED_HIDDENHANDLES(cu, &(nu->bezt[nu->pntsu-1])) ) {
nu1= nu;
switchdirectionNurb(nu);
keyData_switchDirectionNurb(cu, nu);
}
}
}
- else if(nu2==NULL) {
- if( BEZSELECTED_HIDDENHANDLES(cu, nu->bezt) ) {
+ else if (nu2==NULL) {
+ if ( BEZSELECTED_HIDDENHANDLES(cu, nu->bezt) ) {
nu2= nu;
switchdirectionNurb(nu);
keyData_switchDirectionNurb(cu, nu);
}
else {
- if( BEZSELECTED_HIDDENHANDLES(cu, &(nu->bezt[nu->pntsu-1])) ) {
+ if ( BEZSELECTED_HIDDENHANDLES(cu, &(nu->bezt[nu->pntsu-1])) ) {
nu2= nu;
}
}
}
else break;
}
- else if(nu->pntsv==1) {
+ else if (nu->pntsv==1) {
bp= nu->bp;
- if(nu1==NULL) {
- if( bp->f1 & SELECT) nu1= nu;
+ if (nu1==NULL) {
+ if ( bp->f1 & SELECT) nu1= nu;
else {
bp= bp+(nu->pntsu-1);
- if( bp->f1 & SELECT ) {
+ if ( bp->f1 & SELECT ) {
nu1= nu;
switchdirectionNurb(nu);
keyData_switchDirectionNurb(cu, nu);
}
}
}
- else if(nu2==NULL) {
- if( bp->f1 & SELECT ) {
+ else if (nu2==NULL) {
+ if ( bp->f1 & SELECT ) {
nu2= nu;
switchdirectionNurb(nu);
keyData_switchDirectionNurb(cu, nu);
}
else {
bp= bp+(nu->pntsu-1);
- if( bp->f1 & SELECT ) {
+ if ( bp->f1 & SELECT ) {
nu2= nu;
}
}
@@ -3988,9 +4026,9 @@ static int make_segment_exec(bContext *C, wmOperator *op)
}
}
- if((nu1 && nu2) && (nu1!=nu2)) {
- if( nu1->type==nu2->type) {
- if(nu1->type == CU_BEZIER) {
+ if ((nu1 && nu2) && (nu1!=nu2)) {
+ if ( nu1->type==nu2->type) {
+ if (nu1->type == CU_BEZIER) {
BezTriple *bezt =
(BezTriple*)MEM_mallocN((nu1->pntsu+nu2->pntsu) * sizeof(BezTriple), "addsegmentN");
ED_curve_beztcpy(cu->editnurb, bezt, nu2->bezt, nu2->pntsu);
@@ -4017,8 +4055,8 @@ static int make_segment_exec(bContext *C, wmOperator *op)
BLI_remlink(nubase, nu2);
/* now join the knots */
- if(nu1->type == CU_NURBS) {
- if(nu1->knotsu==NULL) {
+ if (nu1->type == CU_NURBS) {
+ if (nu1->knotsu==NULL) {
nurbs_knot_calc_u(nu1);
}
else {
@@ -4030,8 +4068,8 @@ static int make_segment_exec(bContext *C, wmOperator *op)
offset= nu1->knotsu[a-1] + 1.0f;
fp= nu1->knotsu+a;
- for(a=0; a<nu2->pntsu; a++, fp++) {
- if(nu2->knotsu)
+ for (a=0; a<nu2->pntsu; a++, fp++) {
+ if (nu2->knotsu)
*fp= offset+nu2->knotsu[a+1];
else
*fp = offset;
@@ -4044,14 +4082,16 @@ static int make_segment_exec(bContext *C, wmOperator *op)
set_actNurb(obedit, nu1); /* for selected */
ok= 1;
}
- } else if(nu1 && !nu2) {
- if(!(nu1->flagu & CU_NURB_CYCLIC) && nu1->pntsu>1) {
+ }
+ else if (nu1 && !nu2) {
+ if (!(nu1->flagu & CU_NURB_CYCLIC) && nu1->pntsu>1) {
if (nu1->type == CU_BEZIER && BEZSELECTED_HIDDENHANDLES(cu, nu1->bezt) &&
BEZSELECTED_HIDDENHANDLES(cu, nu1->bezt+(nu1->pntsu-1))) {
nu1->flagu|= CU_NURB_CYCLIC;
calchandlesNurb(nu1);
ok= 1;
- } else if (nu1->type == CU_NURBS && nu1->bp->f1&SELECT && (nu1->bp+(nu1->pntsu-1))->f1&SELECT) {
+ }
+ else if (nu1->type == CU_NURBS && nu1->bp->f1&SELECT && (nu1->bp+(nu1->pntsu-1))->f1&SELECT) {
nu1->flagu|= CU_NURB_CYCLIC;
nurbs_knot_calc_u(nu1);
ok= 1;
@@ -4059,12 +4099,12 @@ static int make_segment_exec(bContext *C, wmOperator *op)
}
}
- if(!ok) {
+ if (!ok) {
BKE_report(op->reports, RPT_ERROR, "Can't make segment");
return OPERATOR_CANCELLED;
}
- if(ED_curve_updateAnimPaths(obedit))
+ if (ED_curve_updateAnimPaths(obedit))
WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, obedit);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
@@ -4076,15 +4116,15 @@ static int make_segment_exec(bContext *C, wmOperator *op)
void CURVE_OT_make_segment(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Make Segment";
- ot->idname= "CURVE_OT_make_segment";
+ ot->name = "Make Segment";
+ ot->idname = "CURVE_OT_make_segment";
/* api callbacks */
- ot->exec= make_segment_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = make_segment_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/***************** pick select from 3d view **********************/
@@ -4108,18 +4148,19 @@ int mouse_nurb(bContext *C, const int mval[2], int extend)
location[1]= mval[1];
hand= findnearestNurbvert(&vc, 1, location, &nu, &bezt, &bp);
- if(bezt || bp) {
- if(extend==0) {
+ if (bezt || bp) {
+ if (extend==0) {
setflagsNurb(editnurb, 0);
- if(bezt) {
+ if (bezt) {
- if(hand==1) {
+ if (hand==1) {
select_beztriple(bezt, SELECT, 1, HIDDEN);
cu->lastsel= bezt;
- } else {
- if(hand==0) bezt->f1|= SELECT;
+ }
+ else {
+ if (hand==0) bezt->f1|= SELECT;
else bezt->f3|= SELECT;
cu->lastsel= NULL;
@@ -4132,26 +4173,30 @@ int mouse_nurb(bContext *C, const int mval[2], int extend)
}
else {
- if(bezt) {
- if(hand==1) {
- if(bezt->f2 & SELECT) {
+ if (bezt) {
+ if (hand==1) {
+ if (bezt->f2 & SELECT) {
select_beztriple(bezt, DESELECT, 1, HIDDEN);
if (bezt == cu->lastsel) cu->lastsel = NULL;
- } else {
+ }
+ else {
select_beztriple(bezt, SELECT, 1, HIDDEN);
cu->lastsel= bezt;
}
- } else if(hand==0) {
+ }
+ else if (hand==0) {
bezt->f1 ^= SELECT;
- } else {
+ }
+ else {
bezt->f3 ^= SELECT;
}
}
else {
- if(bp->f1 & SELECT) {
+ if (bp->f1 & SELECT) {
select_bpoint(bp, DESELECT, 1, HIDDEN);
if (cu->lastsel == bp) cu->lastsel = NULL;
- } else {
+ }
+ else {
select_bpoint(bp, SELECT, 1, HIDDEN);
cu->lastsel= bp;
}
@@ -4159,7 +4204,7 @@ int mouse_nurb(bContext *C, const int mval[2], int extend)
}
- if(nu!=get_actNurb(obedit))
+ if (nu!=get_actNurb(obedit))
set_actNurb(obedit, nu);
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
@@ -4223,17 +4268,17 @@ static int spin_nurb(float viewmat[][4], Object *obedit, float *axis, float *cen
ok= 1;
- for(a=0;a<7;a++) {
+ for (a=0;a<7;a++) {
ok= extrudeflagNurb(cu->editnurb, 1);
- if(ok==0)
+ if (ok==0)
return changed;
changed= 1;
rotateflagNurb(editnurb, SELECT, cent, rotmat);
- if( (a & SELECT)==0 ) {
+ if ( (a & SELECT)==0 ) {
rotateflagNurb(editnurb, SELECT, cent, scalemat1);
weightflagNurb(editnurb, SELECT, 0.25*M_SQRT2);
}
@@ -4243,9 +4288,9 @@ static int spin_nurb(float viewmat[][4], Object *obedit, float *axis, float *cen
}
}
- if(ok) {
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(isNurbsel(nu)) {
+ if (ok) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (isNurbsel(nu)) {
nu->orderv= 4;
nu->flagv |= CU_NURB_CYCLIC;
nurbs_knot_calc_v(nu);
@@ -4268,17 +4313,17 @@ static int spin_exec(bContext *C, wmOperator *op)
invert_m4_m4(obedit->imat, obedit->obmat);
mul_m4_v3(obedit->imat, cent);
- if(rv3d)
+ if (rv3d)
copy_m4_m4(viewmat, rv3d->viewmat);
else
unit_m4(viewmat);
- if(!spin_nurb(viewmat, obedit, axis, cent)) {
+ if (!spin_nurb(viewmat, obedit, axis, cent)) {
BKE_report(op->reports, RPT_ERROR, "Can't spin");
return OPERATOR_CANCELLED;
}
- if(ED_curve_updateAnimPaths(obedit))
+ if (ED_curve_updateAnimPaths(obedit))
WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, obedit);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
@@ -4294,7 +4339,7 @@ static int spin_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
RegionView3D *rv3d= ED_view3d_context_rv3d(C);
float axis[3]= {0.0f, 0.0f, 1.0f};
- if(rv3d)
+ if (rv3d)
copy_v3_v3(axis, rv3d->viewinv[2]);
RNA_float_set_array(op->ptr, "center", give_cursor(scene, v3d));
@@ -4306,16 +4351,16 @@ static int spin_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CURVE_OT_spin(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Spin";
- ot->idname= "CURVE_OT_spin";
+ ot->name = "Spin";
+ ot->idname = "CURVE_OT_spin";
/* api callbacks */
- ot->exec= spin_exec;
+ ot->exec = spin_exec;
ot->invoke = spin_invoke;
- ot->poll= ED_operator_editsurf;
+ ot->poll = ED_operator_editsurf;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_float_vector_xyz(ot->srna, "center", 3, NULL, -FLT_MAX, FLT_MAX, "Center", "Center in global view space", -FLT_MAX, FLT_MAX);
RNA_def_float_vector(ot->srna, "axis", 3, NULL, -1.0f, 1.0f, "Axis", "Axis in global view space", -FLT_MAX, FLT_MAX);
@@ -4333,17 +4378,18 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
BPoint *bp, *newbp = NULL;
float imat[4][4], temp[3];
int ok= 0;
+ BezTriple *bezt_recalc[3] = {NULL};
invert_m4_m4(imat, obedit->obmat);
findselectedNurbvert(&editnurb->nurbs, &nu, &bezt, &bp);
if ((nu == NULL) || (nu->type==CU_BEZIER && bezt==NULL) || (nu->type!=CU_BEZIER && bp==NULL)) {
- if(mode!='e') {
- if(cu->actnu >= 0)
+ if (mode!='e') {
+ if (cu->actnu >= 0)
nu= BLI_findlink(&editnurb->nurbs, cu->actnu);
- if(!nu || nu->type==CU_BEZIER) {
+ if (!nu || nu->type==CU_BEZIER) {
newbezt= (BezTriple*)MEM_callocN(sizeof(BezTriple), "addvert_Nurb");
newbezt->radius= 1;
newbezt->alfa= 0;
@@ -4351,14 +4397,15 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
newbezt->h2= newbezt->h1= HD_AUTO;
newnu= (Nurb*)MEM_callocN(sizeof(Nurb), "addvert_Nurb newnu");
- if(!nu) {
+ 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;
- } else memcpy(newnu, nu, sizeof(Nurb));
+ }
+ else memcpy(newnu, nu, sizeof(Nurb));
BLI_addtail(&editnurb->nurbs, newnu);
set_actNurb(obedit, newnu);
@@ -4379,7 +4426,8 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
ok= 1;
nu= newnu;
- } else if(nu->pntsv == 1) {
+ }
+ else if (nu->pntsv == 1) {
newbp= (BPoint*)MEM_callocN(sizeof(BPoint), "addvert_Nurb5");
newbp->radius= 1;
newbp->alfa= 0;
@@ -4406,13 +4454,13 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
}
- if(!ok)
+ if (!ok)
return OPERATOR_CANCELLED;
}
- if(!ok && nu->type == CU_BEZIER) {
+ if (!ok && nu->type == CU_BEZIER) {
/* which bezpoint? */
- if(bezt== (nu->bezt+nu->pntsu-1)) { /* last */
+ if (bezt== (nu->bezt+nu->pntsu-1)) { /* last */
BEZ_DESEL(bezt);
newbezt =
(BezTriple*)MEM_callocN((nu->pntsu+1) * sizeof(BezTriple), "addvert_Nurb");
@@ -4424,11 +4472,16 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
newbezt+= nu->pntsu;
BEZ_SEL(newbezt);
cu->lastsel= newbezt;
- newbezt->h2= newbezt->h1;
+ newbezt->h1 = newbezt->h2;
bezt= nu->bezt+nu->pntsu-1;
ok= 1;
+
+ if (nu->pntsu > 1) {
+ bezt_recalc[1] = newbezt;
+ bezt_recalc[0] = newbezt - 1;
+ }
}
- else if(bezt== nu->bezt) { /* first */
+ else if (bezt== nu->bezt) { /* first */
BEZ_DESEL(bezt);
newbezt =
(BezTriple*)MEM_callocN((nu->pntsu+1) * sizeof(BezTriple), "addvert_Nurb");
@@ -4442,8 +4495,13 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
nu->bezt= newbezt;
bezt= newbezt+1;
ok= 1;
+
+ if (nu->pntsu > 1) {
+ bezt_recalc[1] = newbezt;
+ bezt_recalc[2] = newbezt + 1;
+ }
}
- else if(mode!='e') {
+ else if (mode!='e') {
BEZ_DESEL(bezt);
newbezt= (BezTriple*)MEM_callocN(sizeof(BezTriple), "addvert_Nurb");
*newbezt= *bezt;
@@ -4465,10 +4523,10 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
}
else bezt= NULL;
- if(bezt) {
- if(!newnu) nu->pntsu++;
+ if (bezt) {
+ if (!newnu) nu->pntsu++;
- if(mode=='e') {
+ if (mode=='e') {
copy_v3_v3(newbezt->vec[0], bezt->vec[0]);
copy_v3_v3(newbezt->vec[1], bezt->vec[1]);
copy_v3_v3(newbezt->vec[2], bezt->vec[2]);
@@ -4476,17 +4534,28 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
else {
mul_v3_m4v3(newbezt->vec[1], imat, location);
sub_v3_v3v3(temp, newbezt->vec[1],temp);
- add_v3_v3v3(newbezt->vec[0], bezt->vec[0],temp);
- add_v3_v3v3(newbezt->vec[2], bezt->vec[2],temp);
- if(newnu) calchandlesNurb(newnu);
+ if (bezt_recalc[1]) {
+ const char h1 = bezt_recalc[1]->h1, h2 = bezt_recalc[1]->h2;
+ bezt_recalc[1]->h1 = bezt_recalc[1]->h2 = HD_AUTO;
+ calchandleNurb(bezt_recalc[1], bezt_recalc[0], bezt_recalc[2], 0);
+ bezt_recalc[1]->h1 = h1;
+ bezt_recalc[1]->h2 = h2;
+ }
+ else {
+ add_v3_v3v3(newbezt->vec[0], bezt->vec[0],temp);
+ add_v3_v3v3(newbezt->vec[2], bezt->vec[2],temp);
+ }
+
+
+ if (newnu) calchandlesNurb(newnu);
else calchandlesNurb(nu);
}
}
}
- else if(!ok && nu->pntsv==1) {
+ else if (!ok && nu->pntsv==1) {
/* which b-point? */
- if(bp== (nu->bp+nu->pntsu-1)) { /* last */
+ if (bp== (nu->bp+nu->pntsu-1)) { /* last */
bp->f1= 0;
newbp =
(BPoint*)MEM_callocN((nu->pntsu+1) * sizeof(BPoint), "addvert_Nurb4");
@@ -4500,7 +4569,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
bp= newbp - 1;
ok= 1;
}
- else if(bp== nu->bp) { /* first */
+ else if (bp== nu->bp) { /* first */
bp->f1= 0;
newbp =
(BPoint*)MEM_callocN((nu->pntsu+1) * sizeof(BPoint), "addvert_Nurb3");
@@ -4513,7 +4582,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
bp= newbp + 1;
ok= 1;
}
- else if(mode!='e') {
+ else if (mode!='e') {
bp->f1= 0;
newbp= (BPoint*)MEM_callocN(sizeof(BPoint), "addvert_Nurb5");
*newbp= *bp;
@@ -4534,29 +4603,30 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
}
else bp= NULL;
- if(bp) {
- if(mode=='e') {
+ if (bp) {
+ if (mode=='e') {
copy_v3_v3(newbp->vec, bp->vec);
}
else {
mul_v3_m4v3(newbp->vec, imat, location);
newbp->vec[3]= 1.0;
- if(!newnu && nu->orderu<4 && nu->orderu<=nu->pntsu)
+ if (!newnu && nu->orderu<4 && nu->orderu<=nu->pntsu)
nu->orderu++;
}
- if(!newnu) {
+ if (!newnu) {
nu->pntsu++;
nurbs_knot_calc_u(nu);
- } else nurbs_knot_calc_u(newnu);
+ }
+ else nurbs_knot_calc_u(newnu);
}
}
- if(ok) {
+ if (ok) {
test2DNurb(nu);
- if(ED_curve_updateAnimPaths(obedit))
+ if (ED_curve_updateAnimPaths(obedit))
WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, obedit);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
@@ -4580,7 +4650,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
RegionView3D *rv3d= CTX_wm_region_view3d(C);
- if(rv3d && !RNA_struct_property_is_set(op->ptr, "location")) {
+ if (rv3d && !RNA_struct_property_is_set(op->ptr, "location")) {
Curve *cu;
ViewContext vc;
float location[3];
@@ -4595,7 +4665,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event)
findselectedNurbvert(&cu->editnurb->nurbs, &nu, &bezt, &bp);
- if(bezt) {
+ if (bezt) {
mul_v3_m4v3(location, vc.obedit->obmat, bezt->vec[1]);
}
else if (bp) {
@@ -4615,16 +4685,16 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event)
void CURVE_OT_vertex_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Vertex";
- ot->idname= "CURVE_OT_vertex_add";
+ ot->name = "Add Vertex";
+ ot->idname = "CURVE_OT_vertex_add";
/* api callbacks */
- ot->exec= add_vertex_exec;
- ot->invoke= add_vertex_invoke;
- ot->poll= ED_operator_editcurve;
+ ot->exec = add_vertex_exec;
+ ot->invoke = add_vertex_invoke;
+ ot->poll = ED_operator_editcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location to add new vertex at", -1e4, 1e4);
@@ -4640,16 +4710,16 @@ static int extrude_exec(bContext *C, wmOperator *UNUSED(op))
Nurb *nu;
/* first test: curve? */
- for(nu= editnurb->nurbs.first; nu; nu= nu->next)
- if(nu->pntsv==1 && isNurbsel_count(cu, nu)==1)
+ for (nu= editnurb->nurbs.first; nu; nu= nu->next)
+ if (nu->pntsv==1 && isNurbsel_count(cu, nu)==1)
break;
- if(obedit->type==OB_CURVE || nu) {
+ if (obedit->type==OB_CURVE || nu) {
addvert_Nurb(C, 'e', NULL);
}
else {
- if(extrudeflagNurb(editnurb, 1)) { /* '1'= flag */
- if(ED_curve_updateAnimPaths(obedit))
+ if (extrudeflagNurb(editnurb, 1)) { /* '1'= flag */
+ if (ED_curve_updateAnimPaths(obedit))
WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, obedit);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
@@ -4663,16 +4733,16 @@ static int extrude_exec(bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_extrude(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Extrude";
+ ot->name = "Extrude";
ot->description = "Extrude selected control point(s) and move";
- ot->idname= "CURVE_OT_extrude";
+ ot->idname = "CURVE_OT_extrude";
/* api callbacks */
- ot->exec= extrude_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = extrude_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* to give to transform */
RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", "");
@@ -4690,24 +4760,24 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op)
BPoint *bp;
int a, direction= RNA_enum_get(op->ptr, "direction");
- for(nu= editnurb->first; nu; nu= nu->next) {
- if( nu->pntsu>1 || nu->pntsv>1) {
- if(nu->type == CU_POLY) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if ( nu->pntsu>1 || nu->pntsv>1) {
+ if (nu->type == CU_POLY) {
a= nu->pntsu;
bp= nu->bp;
- while(a--) {
- if( bp->f1 & SELECT ) {
+ while (a--) {
+ if ( bp->f1 & SELECT ) {
nu->flagu ^= CU_NURB_CYCLIC;
break;
}
bp++;
}
}
- else if(nu->type == CU_BEZIER) {
+ else if (nu->type == CU_BEZIER) {
a= nu->pntsu;
bezt= nu->bezt;
- while(a--) {
- if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
+ while (a--) {
+ if ( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
nu->flagu ^= CU_NURB_CYCLIC;
break;
}
@@ -4715,12 +4785,12 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op)
}
calchandlesNurb(nu);
}
- else if(nu->pntsv==1 && nu->type == CU_NURBS) {
+ else if (nu->pntsv==1 && nu->type == CU_NURBS) {
if (nu->knotsu) { /* if check_valid_nurb_u fails the knotsu can be NULL */
a= nu->pntsu;
bp= nu->bp;
- while(a--) {
- if( bp->f1 & SELECT ) {
+ while (a--) {
+ if ( bp->f1 & SELECT ) {
nu->flagu ^= CU_NURB_CYCLIC;
nurbs_knot_calc_u(nu); /* 1==u type is ignored for cyclic curves */
break;
@@ -4729,17 +4799,17 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op)
}
}
}
- else if(nu->type==CU_NURBS) {
+ else if (nu->type==CU_NURBS) {
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- while(a--) {
+ while (a--) {
- if( bp->f1 & SELECT) {
- if(direction==0 && nu->pntsu>1) {
+ if ( bp->f1 & SELECT) {
+ if (direction==0 && nu->pntsu>1) {
nu->flagu ^= CU_NURB_CYCLIC;
nurbs_knot_calc_u(nu); /* 1==u type is ignored for cyclic curves */
}
- if(direction==1 && nu->pntsv>1) {
+ if (direction==1 && nu->pntsv>1) {
nu->flagv ^= CU_NURB_CYCLIC;
nurbs_knot_calc_v(nu); /* 2==v type is ignored for cyclic curves */
}
@@ -4766,10 +4836,10 @@ static int toggle_cyclic_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
uiLayout *layout;
Nurb *nu;
- if(obedit->type == OB_SURF) {
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->pntsu>1 || nu->pntsv>1) {
- if(nu->type==CU_NURBS) {
+ if (obedit->type == OB_SURF) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->pntsu>1 || nu->pntsv>1) {
+ if (nu->type==CU_NURBS) {
pup= uiPupMenuBegin(C, "Direction", ICON_NONE);
layout= uiPupMenuLayout(pup);
uiItemsEnumO(layout, op->type->idname, "direction");
@@ -4791,17 +4861,17 @@ void CURVE_OT_cyclic_toggle(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Toggle Cyclic";
+ ot->name = "Toggle Cyclic";
ot->description = "Make active spline closed/opened loop";
- ot->idname= "CURVE_OT_cyclic_toggle";
+ ot->idname = "CURVE_OT_cyclic_toggle";
/* api callbacks */
- ot->exec= toggle_cyclic_exec;
- ot->invoke= toggle_cyclic_invoke;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = toggle_cyclic_exec;
+ ot->invoke = toggle_cyclic_invoke;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "direction", direction_items, 0, "Direction", "Direction to make surface cyclic in");
@@ -4820,15 +4890,15 @@ static int select_linked_exec(bContext *C, wmOperator *UNUSED(op))
BPoint *bp;
int a;
- for(nu= nurbs->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu= nurbs->first; nu; nu= nu->next) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
- if( (bezt->f1 & SELECT) || (bezt->f2 & SELECT) || (bezt->f3 & SELECT) ) {
+ while (a--) {
+ if ( (bezt->f1 & SELECT) || (bezt->f2 & SELECT) || (bezt->f3 & SELECT) ) {
a= nu->pntsu;
bezt= nu->bezt;
- while(a--) {
+ while (a--) {
select_beztriple(bezt, SELECT, 1, VISIBLE);
bezt++;
}
@@ -4840,11 +4910,11 @@ static int select_linked_exec(bContext *C, wmOperator *UNUSED(op))
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
- if( bp->f1 & 1 ) {
+ while (a--) {
+ if ( bp->f1 & 1 ) {
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- while(a--) {
+ while (a--) {
select_bpoint(bp, SELECT, 1, VISIBLE);
bp++;
}
@@ -4868,16 +4938,16 @@ static int select_linked_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
void CURVE_OT_select_linked(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Linked All";
- ot->idname= "CURVE_OT_select_linked";
+ ot->name = "Select Linked All";
+ ot->idname = "CURVE_OT_select_linked";
/* api callbacks */
- ot->exec= select_linked_exec;
- ot->invoke= select_linked_invoke;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = select_linked_exec;
+ ot->invoke = select_linked_invoke;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
}
@@ -4901,20 +4971,20 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
findnearestNurbvert(&vc, 1, event->mval, &nu, &bezt, &bp);
- if(bezt) {
+ if (bezt) {
a= nu->pntsu;
bezt= nu->bezt;
- while(a--) {
- if(deselect) select_beztriple(bezt, DESELECT, 1, VISIBLE);
+ while (a--) {
+ if (deselect) select_beztriple(bezt, DESELECT, 1, VISIBLE);
else select_beztriple(bezt, SELECT, 1, VISIBLE);
bezt++;
}
}
- else if(bp) {
+ else if (bp) {
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- while(a--) {
- if(deselect) select_bpoint(bp, DESELECT, 1, VISIBLE);
+ while (a--) {
+ if (deselect) select_bpoint(bp, DESELECT, 1, VISIBLE);
else select_bpoint(bp, SELECT, 1, VISIBLE);
bp++;
}
@@ -4928,15 +4998,15 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
void CURVE_OT_select_linked_pick(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Linked";
- ot->idname= "CURVE_OT_select_linked_pick";
+ ot->name = "Select Linked";
+ ot->idname = "CURVE_OT_select_linked_pick";
/* api callbacks */
- ot->invoke= select_linked_pick_invoke;
- ot->poll= ED_operator_editsurfcurve_region_view3d;
+ ot->invoke = select_linked_pick_invoke;
+ ot->poll = ED_operator_editsurfcurve_region_view3d;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect linked control points rather than selecting them");
@@ -4955,41 +5025,41 @@ static int select_row_exec(bContext *C, wmOperator *UNUSED(op))
BPoint *bp;
int u = 0, v = 0, a, b, ok=0;
- if(editnurb->first == NULL)
+ if (editnurb->first == NULL)
return OPERATOR_CANCELLED;
- if(cu->lastsel==NULL)
+ if (cu->lastsel==NULL)
return OPERATOR_CANCELLED;
/* find the correct nurb and toggle with u of v */
- for(nu= editnurb->first; nu; nu= nu->next) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
bp= nu->bp;
- for(v=0; v<nu->pntsv; v++) {
- for(u=0; u<nu->pntsu; u++, bp++) {
- if(bp==cu->lastsel) {
- if(bp->f1 & SELECT) {
+ for (v=0; v<nu->pntsv; v++) {
+ for (u=0; u<nu->pntsu; u++, bp++) {
+ if (bp==cu->lastsel) {
+ if (bp->f1 & SELECT) {
ok= 1;
break;
}
}
}
- if(ok) break;
+ if (ok) break;
}
- if(ok) {
- if(last==cu->lastsel) {
+ if (ok) {
+ if (last==cu->lastsel) {
direction= 1-direction;
setflagsNurb(editnurb, 0);
}
last= cu->lastsel;
bp= nu->bp;
- for(a=0; a<nu->pntsv; a++) {
- for(b=0; b<nu->pntsu; b++, bp++) {
- if(direction) {
- if(a==v) select_bpoint(bp, SELECT, 1, VISIBLE);
+ for (a=0; a<nu->pntsv; a++) {
+ for (b=0; b<nu->pntsu; b++, bp++) {
+ if (direction) {
+ if (a==v) select_bpoint(bp, SELECT, 1, VISIBLE);
}
else {
- if(b==u) select_bpoint(bp, SELECT, 1, VISIBLE);
+ if (b==u) select_bpoint(bp, SELECT, 1, VISIBLE);
}
}
}
@@ -5006,15 +5076,15 @@ static int select_row_exec(bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_select_row(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Control Point Row";
- ot->idname= "CURVE_OT_select_row";
+ ot->name = "Select Control Point Row";
+ ot->idname = "CURVE_OT_select_row";
/* api callbacks */
- ot->exec= select_row_exec;
- ot->poll= ED_operator_editsurf;
+ ot->exec = select_row_exec;
+ ot->poll = ED_operator_editsurf;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/***************** select next operator **********************/
@@ -5033,15 +5103,15 @@ static int select_next_exec(bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_select_next(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Next";
- ot->idname= "CURVE_OT_select_next";
+ ot->name = "Select Next";
+ ot->idname = "CURVE_OT_select_next";
/* api callbacks */
- ot->exec= select_next_exec;
- ot->poll= ED_operator_editcurve;
+ ot->exec = select_next_exec;
+ ot->poll = ED_operator_editcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/***************** select previous operator **********************/
@@ -5060,15 +5130,15 @@ static int select_previous_exec(bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_select_previous(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Previous";
- ot->idname= "CURVE_OT_select_previous";
+ ot->name = "Select Previous";
+ ot->idname = "CURVE_OT_select_previous";
/* api callbacks */
- ot->exec= select_previous_exec;
- ot->poll= ED_operator_editcurve;
+ ot->exec = select_previous_exec;
+ ot->poll = ED_operator_editcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/***************** select more operator **********************/
@@ -5084,43 +5154,43 @@ static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
short *selbpoints;
/* note that NURBS surface is a special case because we mimic */
- /* the behaviour of "select more" of mesh tools. */
+ /* the behavior of "select more" of mesh tools. */
/* The algorithm is designed to work in planar cases so it */
/* may not be optimal always (example: end of NURBS sphere) */
- if(obedit->type==OB_SURF) {
- for(nu= editnurb->first; nu; nu= nu->next) {
+ if (obedit->type==OB_SURF) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
selbpoints= MEM_callocN(sizeof(short)*a-nu->pntsu, "selectlist");
- while(a > 0) {
- if((selbpoints[a]!=1) && (bp->hide==0) && (bp->f1 & SELECT)) {
+ while (a > 0) {
+ if ((selbpoints[a]!=1) && (bp->hide==0) && (bp->f1 & SELECT)) {
/* upper control point */
- if(a%nu->pntsu != 0) {
+ if (a%nu->pntsu != 0) {
tempbp= bp-1;
- if(!(tempbp->f1 & SELECT)) select_bpoint(tempbp, SELECT, 1, VISIBLE);
+ if (!(tempbp->f1 & SELECT)) select_bpoint(tempbp, SELECT, 1, VISIBLE);
}
/* left control point. select only if it is not selected already */
- if(a-nu->pntsu > 0) {
+ if (a-nu->pntsu > 0) {
sel= 0;
tempbp= bp+nu->pntsu;
- if(!(tempbp->f1 & SELECT)) sel= select_bpoint(tempbp, SELECT, 1, VISIBLE);
+ if (!(tempbp->f1 & SELECT)) sel= select_bpoint(tempbp, SELECT, 1, VISIBLE);
/* make sure selected bpoint is discarded */
- if(sel == 1) selbpoints[a-nu->pntsu]= 1;
+ if (sel == 1) selbpoints[a-nu->pntsu]= 1;
}
/* right control point */
- if(a+nu->pntsu < nu->pntsu*nu->pntsv) {
+ if (a+nu->pntsu < nu->pntsu*nu->pntsv) {
tempbp= bp-nu->pntsu;
- if(!(tempbp->f1 & SELECT)) select_bpoint(tempbp, SELECT, 1, VISIBLE);
+ if (!(tempbp->f1 & SELECT)) select_bpoint(tempbp, SELECT, 1, VISIBLE);
}
/* lower control point. skip next bp in case selection was made */
- if(a%nu->pntsu != 1) {
+ if (a%nu->pntsu != 1) {
sel= 0;
tempbp= bp+1;
- if(!(tempbp->f1 & 1)) sel= select_bpoint(tempbp, SELECT, 1, VISIBLE);
- if(sel) {
+ if (!(tempbp->f1 & 1)) sel= select_bpoint(tempbp, SELECT, 1, VISIBLE);
+ if (sel) {
bp++;
a--;
}
@@ -5147,20 +5217,20 @@ static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_select_more(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select More";
- ot->idname= "CURVE_OT_select_more";
+ ot->name = "Select More";
+ ot->idname = "CURVE_OT_select_more";
/* api callbacks */
- ot->exec= select_more_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = select_more_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/******************** 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);
@@ -5172,46 +5242,46 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
short sel= 0, lastsel= 0;
short *selbpoints;
- if(obedit->type==OB_SURF) {
- for(nu= editnurb->first; nu; nu= nu->next) {
+ if (obedit->type==OB_SURF) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
selbpoints= MEM_callocN(sizeof(short)*a, "selectlist");
- while(a--) {
- if((bp->hide==0) && (bp->f1 & SELECT)) {
+ while (a--) {
+ 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++;
+ if ((a+1)%nu->pntsu==0) sel++;
else {
bp--;
- if((selbpoints[a+1]==1) || ((bp->hide==0) && (bp->f1 & SELECT))) sel++;
+ if ((selbpoints[a+1]==1) || ((bp->hide==0) && (bp->f1 & SELECT))) sel++;
bp++;
}
- if((a+1)%nu->pntsu==1) sel++;
+ if ((a+1)%nu->pntsu==1) sel++;
else {
bp++;
- if((bp->hide==0) && (bp->f1 & SELECT)) sel++;
+ if ((bp->hide==0) && (bp->f1 & SELECT)) sel++;
bp--;
}
- if(a+1 > nu->pntsu*nu->pntsv-nu->pntsu) sel++;
+ if (a+1 > nu->pntsu*nu->pntsv-nu->pntsu) sel++;
else {
bp-=nu->pntsu;
- if((selbpoints[a+nu->pntsu]==1) || ((bp->hide==0) && (bp->f1 & SELECT))) sel++;
+ if ((selbpoints[a+nu->pntsu]==1) || ((bp->hide==0) && (bp->f1 & SELECT))) sel++;
bp+=nu->pntsu;
}
- if(a < nu->pntsu) sel++;
+ if (a < nu->pntsu) sel++;
else {
bp+=nu->pntsu;
- if((bp->hide==0) && (bp->f1 & SELECT)) sel++;
+ if ((bp->hide==0) && (bp->f1 & SELECT)) sel++;
bp-=nu->pntsu;
}
- if(sel!=4) {
+ if (sel!=4) {
select_bpoint(bp, DESELECT, 1, VISIBLE);
selbpoints[a]= 1;
}
@@ -5225,34 +5295,34 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
}
}
else {
- for(nu= editnurb->first; nu; nu= nu->next) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
lastsel=0;
/* check what type of curve/nurb it is */
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
a= nu->pntsu;
bezt= nu->bezt;
- while(a--) {
- if((bezt->hide==0) && (bezt->f2 & SELECT)) {
- if(lastsel==1) sel= 1;
+ while (a--) {
+ if ((bezt->hide==0) && (bezt->f2 & SELECT)) {
+ 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++;
+ if (a==nu->pntsu-1) sel++;
else {
bezt--;
- if((bezt->hide==0) && (bezt->f2 & SELECT)) sel++;
+ if ((bezt->hide==0) && (bezt->f2 & SELECT)) sel++;
bezt++;
}
- if(a==0) sel++;
+ if (a==0) sel++;
else {
bezt++;
- if((bezt->hide==0) && (bezt->f2 & SELECT)) sel++;
+ if ((bezt->hide==0) && (bezt->f2 & SELECT)) sel++;
bezt--;
}
- if(sel!=2) {
+ if (sel!=2) {
select_beztriple(bezt, DESELECT, 1, VISIBLE);
lastsel= 1;
}
@@ -5266,27 +5336,27 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
else {
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- while(a--) {
- if((lastsel==0) && (bp->hide==0) && (bp->f1 & SELECT)) {
- if(lastsel!=0) sel= 1;
+ while (a--) {
+ if ((lastsel==0) && (bp->hide==0) && (bp->f1 & SELECT)) {
+ if (lastsel!=0) sel= 1;
else sel= 0;
/* first and last are exceptions */
- if(a==nu->pntsu*nu->pntsv-1) sel++;
+ if (a==nu->pntsu*nu->pntsv-1) sel++;
else {
bp--;
- if((bp->hide==0) && (bp->f1 & SELECT)) sel++;
+ if ((bp->hide==0) && (bp->f1 & SELECT)) sel++;
bp++;
}
- if(a==0) sel++;
+ if (a==0) sel++;
else {
bp++;
- if((bp->hide==0) && (bp->f1 & SELECT)) sel++;
+ if ((bp->hide==0) && (bp->f1 & SELECT)) sel++;
bp--;
}
- if(sel!=2) {
+ if (sel!=2) {
select_bpoint(bp, DESELECT, 1, VISIBLE);
lastsel= 1;
}
@@ -5308,15 +5378,15 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_select_less(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Less";
- ot->idname= "CURVE_OT_select_less";
+ ot->name = "Select Less";
+ ot->idname = "CURVE_OT_select_less";
/* api callbacks */
- ot->exec= select_less_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = select_less_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** select random *********************/
@@ -5330,11 +5400,11 @@ static void selectrandom_curve(ListBase *editnurb, float randfac)
BLI_srand( BLI_rand() ); /* random seed */
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
+ while (a--) {
if (BLI_frand() < randfac)
select_beztriple(bezt, SELECT, 1, VISIBLE);
bezt++;
@@ -5344,7 +5414,7 @@ static void selectrandom_curve(ListBase *editnurb, float randfac)
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
+ while (a--) {
if (BLI_frand() < randfac)
select_bpoint(bp, SELECT, 1, VISIBLE);
bp++;
@@ -5358,7 +5428,7 @@ static int select_random_exec(bContext *C, wmOperator *op)
Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= object_editcurve_get(obedit);
- if(!RNA_boolean_get(op->ptr, "extend"))
+ if (!RNA_boolean_get(op->ptr, "extend"))
CU_deselect_all(obedit);
selectrandom_curve(editnurb, RNA_float_get(op->ptr, "percent")/100.0f);
@@ -5371,15 +5441,15 @@ static int select_random_exec(bContext *C, wmOperator *op)
void CURVE_OT_select_random(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Random";
- ot->idname= "CURVE_OT_select_random";
+ ot->name = "Select Random";
+ ot->idname = "CURVE_OT_select_random";
/* api callbacks */
- ot->exec= select_random_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = select_random_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of elements to select randomly", 0.f, 100.0f);
@@ -5393,7 +5463,8 @@ static int point_on_nurb(Nurb *nu, void *point)
if (nu->bezt) {
BezTriple *bezt= (BezTriple*)point;
return bezt >= nu->bezt && bezt < nu->bezt + nu->pntsu;
- } else {
+ }
+ else {
BPoint *bp= (BPoint*)point;
return bp >= nu->bp && bp < nu->bp + nu->pntsu * nu->pntsv;
}
@@ -5404,7 +5475,7 @@ static Nurb *get_lastsel_nurb(Curve *cu)
ListBase *nubase= curve_editnurbs(cu);
Nurb *nu= nubase->first;
- if(!cu->lastsel)
+ if (!cu->lastsel)
return NULL;
while (nu) {
@@ -5474,7 +5545,8 @@ int CU_select_nth(Object *obedit, int nth)
if (nu->bezt) {
select_nth_bezt(nu, cu->lastsel, nth);
- } else {
+ }
+ else {
select_nth_bp(nu, cu->lastsel, nth);
}
@@ -5489,7 +5561,8 @@ static int select_nth_exec(bContext *C, wmOperator *op)
if (!CU_select_nth(obedit, nth)) {
if (obedit->type == OB_SURF) {
BKE_report(op->reports, RPT_ERROR, "Surface hasn't got active point");
- } else {
+ }
+ else {
BKE_report(op->reports, RPT_ERROR, "Curve hasn't got active point");
}
@@ -5504,16 +5577,16 @@ static int select_nth_exec(bContext *C, wmOperator *op)
void CURVE_OT_select_nth(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Nth";
- ot->description= "";
- ot->idname= "CURVE_OT_select_nth";
+ ot->name = "Select Nth";
+ ot->description = "";
+ ot->idname = "CURVE_OT_select_nth";
/* api callbacks */
- ot->exec= select_nth_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = select_nth_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_int(ot->srna, "nth", 2, 2, 100, "Nth Selection", "", 1, INT_MAX);
}
@@ -5533,16 +5606,16 @@ static int duplicate_exec(bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_duplicate(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Duplicate Curve";
+ ot->name = "Duplicate Curve";
ot->description = "Duplicate selected control points and segments between them";
- ot->idname= "CURVE_OT_duplicate";
+ ot->idname = "CURVE_OT_duplicate";
/* api callbacks */
- ot->exec= duplicate_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = duplicate_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** delete operator *********************/
@@ -5559,14 +5632,15 @@ static int delete_exec(bContext *C, wmOperator *op)
int a, cut= 0, type= RNA_enum_get(op->ptr, "type");
int nuindex= 0;
- if(obedit->type==OB_SURF) {
- if(type==0) {
+ if (obedit->type==OB_SURF) {
+ if (type==0) {
deleteflagNurb(C, op, 1);
- } else {
+ }
+ else {
keyIndex_delNurbList(editnurb, nubase);
freeNurblist(nubase);
- if(ED_curve_updateAnimPaths(obedit))
+ if (ED_curve_updateAnimPaths(obedit))
WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, obedit);
}
@@ -5576,24 +5650,24 @@ static int delete_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
- if(type==0) {
+ if (type==0) {
/* first loop, can we remove entire pieces? */
Nurb *next;
nu= nubase->first;
- while(nu) {
+ while (nu) {
next= nu->next;
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- if(a) {
- while(a) {
- if( BEZSELECTED_HIDDENHANDLES(cu, bezt) );
+ if (a) {
+ while (a) {
+ if ( BEZSELECTED_HIDDENHANDLES(cu, bezt) );
else break;
a--;
bezt++;
}
- if(a==0) {
- if(cu->actnu == nuindex)
+ if (a==0) {
+ if (cu->actnu == nuindex)
cu->actnu= -1;
BLI_remlink(nubase, nu);
@@ -5605,15 +5679,15 @@ static int delete_exec(bContext *C, wmOperator *op)
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- if(a) {
- while(a) {
- if(bp->f1 & SELECT);
+ if (a) {
+ while (a) {
+ if (bp->f1 & SELECT);
else break;
a--;
bp++;
}
- if(a==0) {
- if(cu->actnu == nuindex)
+ if (a==0) {
+ if (cu->actnu == nuindex)
cu->actnu= -1;
BLI_remlink(nubase, nu);
@@ -5624,25 +5698,25 @@ 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++;
}
/* 2nd loop, delete small pieces: just for curves */
nu= nubase->first;
- while(nu) {
+ while (nu) {
next= nu->next;
type= 0;
- if(nu->type == CU_BEZIER) {
+ if (nu->type == CU_BEZIER) {
int delta= 0;
bezt= nu->bezt;
- for(a=0;a<nu->pntsu;a++) {
- if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
+ for (a=0;a<nu->pntsu;a++) {
+ if ( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
memmove(bezt, bezt+1, (nu->pntsu-a-1)*sizeof(BezTriple));
keyIndex_delBezt(editnurb, bezt + delta);
keyIndex_updateBezt(editnurb, bezt + 1, bezt, nu->pntsu-a-1);
@@ -5653,7 +5727,7 @@ static int delete_exec(bContext *C, wmOperator *op)
}
else bezt++;
}
- if(type) {
+ if (type) {
bezt1 =
(BezTriple*)MEM_mallocN((nu->pntsu) * sizeof(BezTriple), "delNurb");
memcpy(bezt1, nu->bezt, (nu->pntsu)*sizeof(BezTriple) );
@@ -5663,12 +5737,12 @@ static int delete_exec(bContext *C, wmOperator *op)
calchandlesNurb(nu);
}
}
- else if(nu->pntsv==1) {
+ else if (nu->pntsv==1) {
int delta= 0;
bp= nu->bp;
- for(a=0;a<nu->pntsu;a++) {
- if( bp->f1 & SELECT ) {
+ for (a=0;a<nu->pntsu;a++) {
+ if ( bp->f1 & SELECT ) {
memmove(bp, bp+1, (nu->pntsu-a-1)*sizeof(BPoint));
keyIndex_delBP(editnurb, bp + delta);
keyIndex_updateBP(editnurb, bp+1, bp, nu->pntsu-a-1);
@@ -5681,19 +5755,20 @@ static int delete_exec(bContext *C, wmOperator *op)
bp++;
}
}
- if(type) {
+ if (type) {
bp1 = (BPoint*)MEM_mallocN(nu->pntsu * sizeof(BPoint), "delNurb2");
memcpy(bp1, nu->bp, (nu->pntsu)*sizeof(BPoint) );
keyIndex_updateBP(editnurb, nu->bp, bp1, nu->pntsu);
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);
@@ -5701,26 +5776,26 @@ static int delete_exec(bContext *C, wmOperator *op)
nu= next;
}
}
- else if(type==1) { /* erase segment */
+ else if (type==1) { /* erase segment */
/* find the 2 selected points */
bezt1= bezt2= NULL;
bp1= bp2= NULL;
nu1= NULL;
nuindex= 0;
- for(nu= nubase->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu= nubase->first; nu; nu= nu->next) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
- for(a=0; a<nu->pntsu-1; a++) {
- if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
+ for (a=0; a<nu->pntsu-1; a++) {
+ if ( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
bezt1= bezt;
bezt2= bezt+1;
if ((bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT)) {
/* pass */
}
else { /* maybe do not make cyclic */
- if(a==0 && (nu->flagu & CU_NURB_CYCLIC) ) {
+ if (a==0 && (nu->flagu & CU_NURB_CYCLIC) ) {
bezt2= bezt+(nu->pntsu-1);
- if( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) {
+ if ( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) {
nu->flagu &= ~CU_NURB_CYCLIC;
calchandlesNurb(nu);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
@@ -5737,19 +5812,19 @@ static int delete_exec(bContext *C, wmOperator *op)
bezt++;
}
}
- else if(nu->pntsv==1) {
+ else if (nu->pntsv==1) {
bp= nu->bp;
- for(a=0; a<nu->pntsu-1; a++) {
- if( bp->f1 & SELECT ) {
+ for (a=0; a<nu->pntsu-1; a++) {
+ if ( bp->f1 & SELECT ) {
bp1= bp;
bp2= bp+1;
if (bp2->f1 & 1) {
/* pass */
}
else { /* maybe do not make cyclic */
- if(a==0 && (nu->flagu & CU_NURB_CYCLIC) ) {
+ if (a==0 && (nu->flagu & CU_NURB_CYCLIC) ) {
bp2= bp+(nu->pntsu-1);
- if( bp2->f1 & SELECT ) {
+ if ( bp2->f1 & SELECT ) {
nu->flagu &= ~CU_NURB_CYCLIC;
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
DAG_id_tag_update(obedit->data, 0);
@@ -5765,19 +5840,19 @@ static int delete_exec(bContext *C, wmOperator *op)
bp++;
}
}
- if(nu1) break;
+ if (nu1) break;
nuindex++;
}
- if(nu1) {
- if(bezt1) {
- if(nu1->pntsu==2) { /* remove completely */
- if(cu->actnu == nuindex)
+ if (nu1) {
+ if (bezt1) {
+ if (nu1->pntsu==2) { /* remove completely */
+ if (cu->actnu == nuindex)
cu->actnu= -1;
BLI_remlink(nubase, nu);
freeNurb(nu); nu = NULL;
}
- else if(nu1->flagu & CU_NURB_CYCLIC) { /* cyclic */
+ else if (nu1->flagu & CU_NURB_CYCLIC) { /* cyclic */
bezt =
(BezTriple*)MEM_mallocN((cut+1) * sizeof(BezTriple), "delNurb1");
ED_curve_beztcpy(editnurb, bezt, nu1->bezt, cut+1);
@@ -5815,15 +5890,15 @@ static int delete_exec(bContext *C, wmOperator *op)
calchandlesNurb(nu1);
}
}
- else if(bp1) {
- if(nu1->pntsu==2) { /* remove completely */
- if(cu->actnu == nuindex)
+ else if (bp1) {
+ if (nu1->pntsu==2) { /* remove completely */
+ if (cu->actnu == nuindex)
cu->actnu= -1;
BLI_remlink(nubase, nu);
freeNurb(nu); nu= NULL;
}
- else if(nu1->flagu & CU_NURB_CYCLIC) { /* cyclic */
+ else if (nu1->flagu & CU_NURB_CYCLIC) { /* cyclic */
bp =
(BPoint*)MEM_mallocN((cut+1) * sizeof(BPoint), "delNurb5");
ED_curve_bpcpy(editnurb, bp, nu1->bp, cut+1);
@@ -5860,13 +5935,13 @@ static int delete_exec(bContext *C, wmOperator *op)
}
}
}
- else if(type==2) {
+ else if (type==2) {
cu->actnu= -1;
keyIndex_delNurbList(editnurb, nubase);
freeNurblist(nubase);
}
- if(ED_curve_updateAnimPaths(obedit))
+ if (ED_curve_updateAnimPaths(obedit))
WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, obedit);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
@@ -5881,7 +5956,7 @@ static int delete_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
uiPopupMenu *pup;
uiLayout *layout;
- if(obedit->type==OB_SURF) {
+ if (obedit->type==OB_SURF) {
pup= uiPupMenuBegin(C, "Delete", ICON_NONE);
layout= uiPupMenuLayout(pup);
uiItemEnumO_ptr(layout, op->type, NULL, 0, "type", 0);
@@ -5907,17 +5982,17 @@ void CURVE_OT_delete(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Delete";
+ ot->name = "Delete";
ot->description = "Delete selected control points or segments";
- ot->idname= "CURVE_OT_delete";
+ ot->idname = "CURVE_OT_delete";
/* api callbacks */
- ot->exec= delete_exec;
- ot->invoke= delete_invoke;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = delete_exec;
+ ot->invoke = delete_invoke;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "Which elements to delete");
@@ -5932,12 +6007,12 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
Nurb *nu;
int clear= (strcmp(op->idname, "CURVE_OT_shade_flat") == 0);
- if(obedit->type != OB_CURVE)
+ if (obedit->type != OB_CURVE)
return OPERATOR_CANCELLED;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(isNurbsel(nu)) {
- if(!clear) nu->flag |= CU_SMOOTH;
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (isNurbsel(nu)) {
+ if (!clear) nu->flag |= CU_SMOOTH;
else nu->flag &= ~CU_SMOOTH;
}
}
@@ -5951,29 +6026,29 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
void CURVE_OT_shade_smooth(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Shade Smooth";
- ot->idname= "CURVE_OT_shade_smooth";
+ ot->name = "Shade Smooth";
+ ot->idname = "CURVE_OT_shade_smooth";
/* api callbacks */
- ot->exec= shade_smooth_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = shade_smooth_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
void CURVE_OT_shade_flat(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Shade Flat";
- ot->idname= "CURVE_OT_shade_flat";
+ ot->name = "Shade Flat";
+ ot->idname = "CURVE_OT_shade_flat";
/* api callbacks */
- ot->exec= shade_smooth_exec;
- ot->poll= ED_operator_editsurfcurve;
+ ot->exec = shade_smooth_exec;
+ ot->poll = ED_operator_editsurfcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************** join operator, to be used externally? ****************/
@@ -5997,26 +6072,27 @@ int join_curve_exec(bContext *C, wmOperator *UNUSED(op))
invert_m4_m4(imat, ob->obmat);
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
- if(base->object->type==ob->type) {
- if(base->object != ob) {
+ if (base->object->type==ob->type) {
+ if (base->object != ob) {
cu= base->object->data;
- if(cu->nurb.first) {
+ if (cu->nurb.first) {
/* watch it: switch order here really goes wrong */
mult_m4_m4m4(cmat, imat, base->object->obmat);
nu= cu->nurb.first;
- while(nu) {
+ while (nu) {
newnu= duplicateNurb(nu);
- if(ob->totcol) { /* TODO, merge material lists */
+ if (ob->totcol) { /* TODO, merge material lists */
CLAMP(newnu->mat_nr, 0, ob->totcol-1);
- } else newnu->mat_nr= 0;
+ }
+ else newnu->mat_nr= 0;
BLI_addtail(&tempbase, newnu);
- if( (bezt= newnu->bezt) ) {
+ if ( (bezt= newnu->bezt) ) {
a= newnu->pntsu;
- while(a--) {
+ while (a--) {
mul_m4_v3(cmat, bezt->vec[0]);
mul_m4_v3(cmat, bezt->vec[1]);
mul_m4_v3(cmat, bezt->vec[2]);
@@ -6024,9 +6100,9 @@ int join_curve_exec(bContext *C, wmOperator *UNUSED(op))
}
calchandlesNurb(newnu);
}
- if( (bp= newnu->bp) ) {
+ if ( (bp= newnu->bp) ) {
a= newnu->pntsu*nu->pntsv;
- while(a--) {
+ while (a--) {
mul_m4_v3(cmat, bp->vec);
bp++;
}
@@ -6060,7 +6136,7 @@ static const char *get_curve_defname(int type)
{
int stype= type & CU_PRIMITIVE;
- if((type & CU_TYPE)==CU_BEZIER) {
+ if ((type & CU_TYPE)==CU_BEZIER) {
switch (stype) {
case CU_PRIM_CURVE: return "BezierCurve";
case CU_PRIM_CIRCLE: return "BezierCircle";
@@ -6116,7 +6192,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
const int stype= (type & CU_PRIMITIVE);
const int force_3d = ((Curve *)obedit->data)->flag & CU_3D; /* could be adding to an existing 3D curve */
- if(rv3d) {
+ if (rv3d) {
copy_m4_m4(viewmat, rv3d->viewmat);
copy_v3_v3(zvec, rv3d->viewinv[2]);
}
@@ -6134,7 +6210,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
switch(stype) {
case CU_PRIM_CURVE: /* curve */
nu->resolu= cu->resolu;
- if(cutype==CU_BEZIER) {
+ if (cutype==CU_BEZIER) {
if (!force_3d) nu->flag |= CU_2D;
nu->pntsu= 2;
nu->bezt =
@@ -6149,7 +6225,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
bezt->vec[0][1]+= -0.5f*grid;
bezt->vec[2][0]+= -0.5f*grid;
bezt->vec[2][1]+= 0.5f*grid;
- for(a=0;a<3;a++) mul_m4_v3(mat, bezt->vec[a]);
+ for (a=0;a<3;a++) mul_m4_v3(mat, bezt->vec[a]);
bezt++;
bezt->h1= bezt->h2= HD_ALIGN;
@@ -6162,7 +6238,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
bezt->vec[1][1] = 0;
bezt->vec[2][0] = grid*2;
bezt->vec[2][1] = 0;
- for(a=0;a<3;a++) mul_m4_v3(mat, bezt->vec[a]);
+ for (a=0;a<3;a++) mul_m4_v3(mat, bezt->vec[a]);
calchandlesNurb(nu);
}
@@ -6174,7 +6250,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
nu->bp= callocstructN(BPoint, 4, "addNurbprim3");
bp= nu->bp;
- for(a=0;a<4;a++, bp++) {
+ for (a=0;a<4;a++, bp++) {
bp->vec[3]= 1.0;
bp->f1= SELECT;
bp->radius = bp->weight = 1.0;
@@ -6192,9 +6268,9 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
bp->vec[0]+= 1.5f*grid;
bp= nu->bp;
- for(a=0;a<4;a++, bp++) mul_m4_v3(mat,bp->vec);
+ for (a=0;a<4;a++, bp++) mul_m4_v3(mat,bp->vec);
- if(cutype==CU_NURBS) {
+ if (cutype==CU_NURBS) {
nu->knotsu= NULL; /* nurbs_knot_calc_u allocates */
nurbs_knot_calc_u(nu);
}
@@ -6210,7 +6286,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
nu->bp= callocstructN(BPoint, 5, "addNurbprim3");
bp= nu->bp;
- for(a=0;a<5;a++, bp++) {
+ for (a=0;a<5;a++, bp++) {
bp->vec[3]= 1.0;
bp->f1= SELECT;
bp->radius = bp->weight = 1.0;
@@ -6226,9 +6302,9 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
bp->vec[0]+= 2.0f*grid;
bp= nu->bp;
- for(a=0;a<5;a++, bp++) mul_m4_v3(mat,bp->vec);
+ for (a=0;a<5;a++, bp++) mul_m4_v3(mat,bp->vec);
- if(cutype==CU_NURBS) {
+ if (cutype==CU_NURBS) {
nu->knotsu= NULL; /* nurbs_knot_calc_u allocates */
nurbs_knot_calc_u(nu);
}
@@ -6237,7 +6313,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
case CU_PRIM_CIRCLE: /* circle */
nu->resolu= cu->resolu;
- if(cutype==CU_BEZIER) {
+ if (cutype==CU_BEZIER) {
if (!force_3d) nu->flag |= CU_2D;
nu->pntsu= 4;
nu->bezt= callocstructN(BezTriple, 4, "addNurbprim1");
@@ -6247,33 +6323,33 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
bezt->h1= bezt->h2= HD_AUTO;
bezt->f1= bezt->f2= bezt->f3= SELECT;
bezt->vec[1][0]+= -grid;
- for(a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]);
+ for (a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]);
bezt->radius = bezt->weight = 1.0;
bezt++;
bezt->h1= bezt->h2= HD_AUTO;
bezt->f1= bezt->f2= bezt->f3= SELECT;
bezt->vec[1][1]+= grid;
- for(a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]);
+ for (a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]);
bezt->radius = bezt->weight = 1.0;
bezt++;
bezt->h1= bezt->h2= HD_AUTO;
bezt->f1= bezt->f2= bezt->f3= SELECT;
bezt->vec[1][0]+= grid;
- for(a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]);
+ for (a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]);
bezt->radius = bezt->weight = 1.0;
bezt++;
bezt->h1= bezt->h2= HD_AUTO;
bezt->f1= bezt->f2= bezt->f3= SELECT;
bezt->vec[1][1]+= -grid;
- for(a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]);
+ for (a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]);
bezt->radius = bezt->weight = 1.0;
calchandlesNurb(nu);
}
- else if( cutype==CU_NURBS ) { /* nurb */
+ else if ( cutype==CU_NURBS ) { /* nurb */
nu->pntsu= 8;
nu->pntsv= 1;
nu->orderu= 4;
@@ -6281,9 +6357,9 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
nu->flagu= CU_NURB_CYCLIC;
bp= nu->bp;
- for(a=0; a<8; a++) {
+ for (a=0; a<8; a++) {
bp->f1= SELECT;
- if(xzproj==0) {
+ if (xzproj==0) {
bp->vec[0]+= nurbcircle[a][0]*grid;
bp->vec[1]+= nurbcircle[a][1]*grid;
}
@@ -6291,7 +6367,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
bp->vec[0]+= 0.25f*nurbcircle[a][0]*grid-0.75f*grid;
bp->vec[2]+= 0.25f*nurbcircle[a][1]*grid;
}
- if(a & 1) bp->vec[3]= 0.25*M_SQRT2;
+ if (a & 1) bp->vec[3]= 0.25*M_SQRT2;
else bp->vec[3]= 1.0;
mul_m4_v3(mat,bp->vec);
bp->radius = bp->weight = 1.0;
@@ -6303,7 +6379,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
}
break;
case CU_PRIM_PATCH: /* 4x4 patch */
- if( cutype==CU_NURBS ) { /* nurb */
+ if ( cutype==CU_NURBS ) { /* nurb */
nu->pntsu= 4;
nu->pntsv= 4;
@@ -6315,14 +6391,14 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
nu->flagv= 0;
bp= nu->bp;
- for(a=0; a<4; a++) {
- for(b=0; b<4; b++) {
+ for (a=0; a<4; a++) {
+ for (b=0; b<4; b++) {
bp->f1= SELECT;
fac= (float)a -1.5f;
bp->vec[0]+= fac*grid;
fac= (float)b -1.5f;
bp->vec[1]+= fac*grid;
- if(a==1 || a==2) if(b==1 || b==2) {
+ if (a==1 || a==2) if (b==1 || b==2) {
bp->vec[2]+= grid;
}
mul_m4_v3(mat,bp->vec);
@@ -6336,7 +6412,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
}
break;
case CU_PRIM_TUBE: /* Cylinder */
- if( cutype==CU_NURBS ) {
+ if ( cutype==CU_NURBS ) {
nu= add_nurbs_primitive(C, mat, CU_NURBS|CU_PRIM_CIRCLE, 0); /* circle */
nu->resolu= cu->resolu;
nu->flag= CU_SMOOTH;
@@ -6344,7 +6420,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
vec[0]=vec[1]= 0.0;
vec[2]= -grid;
- if(newob && (U.flag & USER_ADD_VIEWALIGNED) == 0) {
+ if (newob && (U.flag & USER_ADD_VIEWALIGNED) == 0) {
/* pass */
}
else {
@@ -6362,14 +6438,14 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- while(a-- >0) {
+ while (a-- >0) {
bp->f1 |= SELECT;
bp++;
}
}
break;
case CU_PRIM_SPHERE: /* sphere */
- if( cutype==CU_NURBS ) {
+ if ( cutype==CU_NURBS ) {
float tmp_cent[3] = {0.f, 0.f, 0.f};
float tmp_vec[3] = {0.f, 0.f, 1.f};
@@ -6383,11 +6459,11 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
nu->flagu= 0;
bp= nu->bp;
- for(a=0; a<5; a++) {
+ for (a=0; a<5; a++) {
bp->f1= SELECT;
bp->vec[0]+= nurbcircle[a][0]*grid;
bp->vec[2]+= nurbcircle[a][1]*grid;
- if(a & 1) bp->vec[3]= 0.5*M_SQRT2;
+ if (a & 1) bp->vec[3]= 0.5*M_SQRT2;
else bp->vec[3]= 1.0;
mul_m4_v3(mat,bp->vec);
bp++;
@@ -6397,7 +6473,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
BLI_addtail(editnurb, nu); /* temporal for spin */
- if(newob && (U.flag & USER_ADD_VIEWALIGNED) == 0) spin_nurb(umat, obedit, tmp_vec, tmp_cent);
+ if (newob && (U.flag & USER_ADD_VIEWALIGNED) == 0) spin_nurb(umat, obedit, tmp_vec, tmp_cent);
else if ((U.flag & USER_ADD_VIEWALIGNED)) spin_nurb(viewmat, obedit, zvec, mat[3]);
else spin_nurb(umat, obedit, tmp_vec, mat[3]);
@@ -6405,7 +6481,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- while(a-- >0) {
+ while (a-- >0) {
bp->f1 |= SELECT;
bp++;
}
@@ -6413,7 +6489,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
}
break;
case CU_PRIM_DONUT: /* torus */
- if( cutype==CU_NURBS ) {
+ if ( cutype==CU_NURBS ) {
float tmp_cent[3] = {0.f, 0.f, 0.f};
float tmp_vec[3] = {0.f, 0.f, 1.f};
@@ -6426,7 +6502,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
BLI_addtail(editnurb, nu); /* temporal for spin */
/* same as above */
- if(newob && (U.flag & USER_ADD_VIEWALIGNED) == 0) spin_nurb(umat, obedit, tmp_vec, tmp_cent);
+ if (newob && (U.flag & USER_ADD_VIEWALIGNED) == 0) spin_nurb(umat, obedit, tmp_vec, tmp_cent);
else if ((U.flag & USER_ADD_VIEWALIGNED)) spin_nurb(viewmat, obedit, zvec, mat[3]);
else spin_nurb(umat, obedit, tmp_vec, mat[3]);
@@ -6435,7 +6511,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
- while(a-- >0) {
+ while (a-- >0) {
bp->f1 |= SELECT;
bp++;
}
@@ -6450,7 +6526,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
BLI_assert(nu != NULL);
- if(nu) { /* should always be set */
+ if (nu) { /* should always be set */
nu->flag |= CU_SMOOTH;
test2DNurb(nu);
@@ -6470,11 +6546,11 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
float loc[3], rot[3];
float mat[4][4];
- if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, &is_aligned))
+ if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, &is_aligned))
return OPERATOR_CANCELLED;
if (!isSurf) { /* adding curve */
- if(obedit==NULL || obedit->type!=OB_CURVE) {
+ if (obedit==NULL || obedit->type!=OB_CURVE) {
Curve *cu;
obedit= ED_object_add_type(C, OB_CURVE, loc, rot, TRUE, layer);
@@ -6483,13 +6559,13 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
cu= (Curve*)obedit->data;
cu->flag |= CU_DEFORM_FILL;
- if(type & CU_PRIM_PATH)
+ if (type & CU_PRIM_PATH)
cu->flag |= CU_PATH|CU_3D;
}
else DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
}
else { /* adding surface */
- if(obedit==NULL || obedit->type!=OB_SURF) {
+ if (obedit==NULL || obedit->type!=OB_SURF) {
obedit= ED_object_add_type(C, OB_SURF, loc, rot, TRUE, layer);
newob = 1;
}
@@ -6497,9 +6573,9 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
}
/* rename here, the undo stack checks name for valid undo pushes */
- if(newob) {
+ if (newob) {
- if(obedit->type==OB_CURVE) {
+ if (obedit->type==OB_CURVE) {
rename_id((ID *)obedit, get_curve_defname(type));
rename_id((ID *)obedit->data, get_curve_defname(type));
}
@@ -6510,7 +6586,7 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
}
/* ED_object_add_type doesnt do an undo, is needed for redo operator on primitive */
- if(newob && enter_editmode)
+ if (newob && enter_editmode)
ED_undo_push(C, "Enter Editmode");
ED_object_new_primitive_matrix(C, obedit, loc, rot, mat);
@@ -6549,17 +6625,17 @@ static int add_primitive_bezier_exec(bContext *C, wmOperator *op)
void CURVE_OT_primitive_bezier_curve_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Bezier";
- ot->description= "Construct a Bezier Curve";
- ot->idname= "CURVE_OT_primitive_bezier_curve_add";
+ ot->name = "Add Bezier";
+ ot->description = "Construct a Bezier Curve";
+ ot->idname = "CURVE_OT_primitive_bezier_curve_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_bezier_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_bezier_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -6572,17 +6648,17 @@ static int add_primitive_bezier_circle_exec(bContext *C, wmOperator *op)
void CURVE_OT_primitive_bezier_circle_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Bezier Circle";
- ot->description= "Construct a Bezier Circle";
- ot->idname= "CURVE_OT_primitive_bezier_circle_add";
+ ot->name = "Add Bezier Circle";
+ ot->description = "Construct a Bezier Circle";
+ ot->idname = "CURVE_OT_primitive_bezier_circle_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_bezier_circle_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_bezier_circle_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -6595,17 +6671,17 @@ static int add_primitive_nurbs_curve_exec(bContext *C, wmOperator *op)
void CURVE_OT_primitive_nurbs_curve_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Nurbs Curve";
- ot->description= "Construct a Nurbs Curve";
- ot->idname= "CURVE_OT_primitive_nurbs_curve_add";
+ ot->name = "Add Nurbs Curve";
+ ot->description = "Construct a Nurbs Curve";
+ ot->idname = "CURVE_OT_primitive_nurbs_curve_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_nurbs_curve_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_nurbs_curve_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -6618,17 +6694,17 @@ static int add_primitive_nurbs_circle_exec(bContext *C, wmOperator *op)
void CURVE_OT_primitive_nurbs_circle_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Nurbs Circle";
- ot->description= "Construct a Nurbs Circle";
- ot->idname= "CURVE_OT_primitive_nurbs_circle_add";
+ ot->name = "Add Nurbs Circle";
+ ot->description = "Construct a Nurbs Circle";
+ ot->idname = "CURVE_OT_primitive_nurbs_circle_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_nurbs_circle_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_nurbs_circle_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -6641,17 +6717,17 @@ static int add_primitive_curve_path_exec(bContext *C, wmOperator *op)
void CURVE_OT_primitive_nurbs_path_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Path";
- ot->description= "Construct a Path";
- ot->idname= "CURVE_OT_primitive_nurbs_path_add";
+ ot->name = "Add Path";
+ ot->description = "Construct a Path";
+ ot->idname = "CURVE_OT_primitive_nurbs_path_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_curve_path_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_curve_path_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -6665,17 +6741,17 @@ static int add_primitive_nurbs_surface_curve_exec(bContext *C, wmOperator *op)
void SURFACE_OT_primitive_nurbs_surface_curve_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Surface Curve";
- ot->description= "Construct a Nurbs surface Curve";
- ot->idname= "SURFACE_OT_primitive_nurbs_surface_curve_add";
+ ot->name = "Add Surface Curve";
+ ot->description = "Construct a Nurbs surface Curve";
+ ot->idname = "SURFACE_OT_primitive_nurbs_surface_curve_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_nurbs_surface_curve_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_nurbs_surface_curve_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -6688,17 +6764,17 @@ static int add_primitive_nurbs_surface_circle_exec(bContext *C, wmOperator *op)
void SURFACE_OT_primitive_nurbs_surface_circle_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Surface Circle";
- ot->description= "Construct a Nurbs surface Circle";
- ot->idname= "SURFACE_OT_primitive_nurbs_surface_circle_add";
+ ot->name = "Add Surface Circle";
+ ot->description = "Construct a Nurbs surface Circle";
+ ot->idname = "SURFACE_OT_primitive_nurbs_surface_circle_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_nurbs_surface_circle_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_nurbs_surface_circle_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -6711,17 +6787,17 @@ static int add_primitive_nurbs_surface_surface_exec(bContext *C, wmOperator *op)
void SURFACE_OT_primitive_nurbs_surface_surface_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Surface Patch";
- ot->description= "Construct a Nurbs surface Patch";
- ot->idname= "SURFACE_OT_primitive_nurbs_surface_surface_add";
+ ot->name = "Add Surface Patch";
+ ot->description = "Construct a Nurbs surface Patch";
+ ot->idname = "SURFACE_OT_primitive_nurbs_surface_surface_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_nurbs_surface_surface_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_nurbs_surface_surface_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -6734,17 +6810,17 @@ static int add_primitive_nurbs_surface_cylinder_exec(bContext *C, wmOperator *op
void SURFACE_OT_primitive_nurbs_surface_cylinder_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Surface Cylinder";
- ot->description= "Construct a Nurbs surface Cylinder";
- ot->idname= "SURFACE_OT_primitive_nurbs_surface_cylinder_add";
+ ot->name = "Add Surface Cylinder";
+ ot->description = "Construct a Nurbs surface Cylinder";
+ ot->idname = "SURFACE_OT_primitive_nurbs_surface_cylinder_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_nurbs_surface_cylinder_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_nurbs_surface_cylinder_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -6757,17 +6833,17 @@ static int add_primitive_nurbs_surface_sphere_exec(bContext *C, wmOperator *op)
void SURFACE_OT_primitive_nurbs_surface_sphere_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Surface Sphere";
- ot->description= "Construct a Nurbs surface Sphere";
- ot->idname= "SURFACE_OT_primitive_nurbs_surface_sphere_add";
+ ot->name = "Add Surface Sphere";
+ ot->description = "Construct a Nurbs surface Sphere";
+ ot->idname = "SURFACE_OT_primitive_nurbs_surface_sphere_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_nurbs_surface_sphere_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_nurbs_surface_sphere_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -6780,17 +6856,17 @@ static int add_primitive_nurbs_surface_torus_exec(bContext *C, wmOperator *op)
void SURFACE_OT_primitive_nurbs_surface_torus_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Surface Torus";
- ot->description= "Construct a Nurbs surface Torus";
- ot->idname= "SURFACE_OT_primitive_nurbs_surface_torus_add";
+ ot->name = "Add Surface Torus";
+ ot->description = "Construct a Nurbs surface Torus";
+ ot->idname = "SURFACE_OT_primitive_nurbs_surface_torus_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_nurbs_surface_torus_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_nurbs_surface_torus_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -6807,20 +6883,20 @@ static int clear_tilt_exec(bContext *C, wmOperator *UNUSED(op))
BPoint *bp;
int a;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if( nu->bezt ) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if ( nu->bezt ) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
- if(BEZSELECTED_HIDDENHANDLES(cu, bezt)) bezt->alfa= 0.0;
+ while (a--) {
+ if (BEZSELECTED_HIDDENHANDLES(cu, bezt)) bezt->alfa= 0.0;
bezt++;
}
}
- else if(nu->bp) {
+ else if (nu->bp) {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->f1 & SELECT) bp->alfa= 0.0;
+ while (a--) {
+ if (bp->f1 & SELECT) bp->alfa= 0.0;
bp++;
}
}
@@ -6835,15 +6911,15 @@ static int clear_tilt_exec(bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_tilt_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Tilt";
- ot->idname= "CURVE_OT_tilt_clear";
+ ot->name = "Clear Tilt";
+ ot->idname = "CURVE_OT_tilt_clear";
/* api callbacks */
- ot->exec= clear_tilt_exec;
- ot->poll= ED_operator_editcurve;
+ ot->exec = clear_tilt_exec;
+ ot->poll = ED_operator_editcurve;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/****************** undo for curves ****************/
@@ -6855,7 +6931,8 @@ static void *undo_check_lastsel(void *lastsel, Nurb *nu, Nurb *newnu)
if (lastbezt >= nu->bezt && lastbezt < nu->bezt + nu->pntsu) {
return newnu->bezt + (lastbezt - nu->bezt);
}
- } else {
+ }
+ else {
BPoint *lastbp= (BPoint*)lastsel;
if (lastbp >= nu->bp && lastbp < nu->bp + nu->pntsu*nu->pntsv) {
return newnu->bp + (lastbp - nu->bp);
@@ -6883,8 +6960,8 @@ static void undoCurve_to_editCurve(void *ucu, void *UNUSED(edata), void *cu_v)
editnurb->keyindex= dupli_keyIndexHash(undoCurve->undoIndex);
}
- if(ad) {
- if(ad->action) {
+ if (ad) {
+ if (ad->action) {
free_fcurves(&ad->action->curves);
copy_fcurves(&ad->action->curves, &undoCurve->fcurves);
}
@@ -6894,7 +6971,7 @@ static void undoCurve_to_editCurve(void *ucu, void *UNUSED(edata), void *cu_v)
}
/* copy */
- for(nu= undobase->first; nu; nu= nu->next) {
+ for (nu= undobase->first; nu; nu= nu->next) {
newnu= duplicateNurb(nu);
if (lastsel == NULL) {
@@ -6933,15 +7010,15 @@ static void *editCurve_to_undoCurve(void *UNUSED(edata), void *cu_v)
tmpEditnurb.keyindex= undoCurve->undoIndex;
}
- if(ad) {
- if(ad->action)
+ if (ad) {
+ if (ad->action)
copy_fcurves(&undoCurve->fcurves, &ad->action->curves);
copy_fcurves(&undoCurve->drivers, &ad->drivers);
}
/* copy */
- for(nu= nubase->first; nu; nu= nu->next) {
+ for (nu= nubase->first; nu; nu= nu->next) {
newnu= duplicateNurb(nu);
if (lastsel == NULL) {
@@ -6967,7 +7044,7 @@ static void free_undoCurve(void *ucv)
freeNurblist(&undoCurve->nubase);
- if(undoCurve->undoIndex)
+ if (undoCurve->undoIndex)
BLI_ghash_free(undoCurve->undoIndex, NULL, (GHashValFreeFP)MEM_freeN);
free_fcurves(&undoCurve->fcurves);
@@ -7004,10 +7081,10 @@ int ED_curve_actSelection(Curve *cu, float center[3])
{
Nurb *nu= get_lastsel_nurb(cu);
- if(!nu)
+ if (!nu)
return 0;
- if(nu->bezt) {
+ if (nu->bezt) {
BezTriple *bezt= cu->lastsel;
copy_v3_v3(center, bezt->vec[1]);
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index efde93b4ad7..1f1d1495276 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -82,130 +82,130 @@ static char findaccent(char char1, unsigned int code)
{
char new= 0;
- if(char1=='a') {
- if(code=='`') new= 224;
- else if(code==39) new= 225;
- else if(code=='^') new= 226;
- else if(code=='~') new= 227;
- else if(code=='"') new= 228;
- else if(code=='o') new= 229;
- else if(code=='e') new= 230;
- else if(code=='-') new= 170;
+ if (char1=='a') {
+ if (code=='`') new= 224;
+ else if (code==39) new= 225;
+ else if (code=='^') new= 226;
+ else if (code=='~') new= 227;
+ else if (code=='"') new= 228;
+ else if (code=='o') new= 229;
+ else if (code=='e') new= 230;
+ else if (code=='-') new= 170;
}
- else if(char1=='c') {
- if(code==',') new= 231;
- if(code=='|') new= 162;
+ else if (char1=='c') {
+ if (code==',') new= 231;
+ if (code=='|') new= 162;
}
- else if(char1=='e') {
- if(code=='`') new= 232;
- else if(code==39) new= 233;
- else if(code=='^') new= 234;
- else if(code=='"') new= 235;
+ else if (char1=='e') {
+ if (code=='`') new= 232;
+ else if (code==39) new= 233;
+ else if (code=='^') new= 234;
+ else if (code=='"') new= 235;
}
- else if(char1=='i') {
- if(code=='`') new= 236;
- else if(code==39) new= 237;
- else if(code=='^') new= 238;
- else if(code=='"') new= 239;
+ else if (char1=='i') {
+ if (code=='`') new= 236;
+ else if (code==39) new= 237;
+ else if (code=='^') new= 238;
+ else if (code=='"') new= 239;
}
- else if(char1=='n') {
- if(code=='~') new= 241;
+ else if (char1=='n') {
+ if (code=='~') new= 241;
}
- else if(char1=='o') {
- if(code=='`') new= 242;
- else if(code==39) new= 243;
- else if(code=='^') new= 244;
- else if(code=='~') new= 245;
- else if(code=='"') new= 246;
- else if(code=='/') new= 248;
- else if(code=='-') new= 186;
- else if(code=='e') new= 143;
+ else if (char1=='o') {
+ if (code=='`') new= 242;
+ else if (code==39) new= 243;
+ else if (code=='^') new= 244;
+ else if (code=='~') new= 245;
+ else if (code=='"') new= 246;
+ else if (code=='/') new= 248;
+ else if (code=='-') new= 186;
+ else if (code=='e') new= 143;
}
- else if(char1=='s') {
- if(code=='s') new= 167;
+ else if (char1=='s') {
+ if (code=='s') new= 167;
}
- else if(char1=='u') {
- if(code=='`') new= 249;
- else if(code==39) new= 250;
- else if(code=='^') new= 251;
- else if(code=='"') new= 252;
+ else if (char1=='u') {
+ if (code=='`') new= 249;
+ else if (code==39) new= 250;
+ else if (code=='^') new= 251;
+ else if (code=='"') new= 252;
}
- else if(char1=='y') {
- if(code==39) new= 253;
- else if(code=='"') new= 255;
+ else if (char1=='y') {
+ if (code==39) new= 253;
+ else if (code=='"') new= 255;
}
- else if(char1=='A') {
- if(code=='`') new= 192;
- else if(code==39) new= 193;
- else if(code=='^') new= 194;
- else if(code=='~') new= 195;
- else if(code=='"') new= 196;
- else if(code=='o') new= 197;
- else if(code=='e') new= 198;
+ else if (char1=='A') {
+ if (code=='`') new= 192;
+ else if (code==39) new= 193;
+ else if (code=='^') new= 194;
+ else if (code=='~') new= 195;
+ else if (code=='"') new= 196;
+ else if (code=='o') new= 197;
+ else if (code=='e') new= 198;
}
- else if(char1=='C') {
- if(code==',') new= 199;
+ else if (char1=='C') {
+ if (code==',') new= 199;
}
- else if(char1=='E') {
- if(code=='`') new= 200;
- else if(code==39) new= 201;
- else if(code=='^') new= 202;
- else if(code=='"') new= 203;
+ else if (char1=='E') {
+ if (code=='`') new= 200;
+ else if (code==39) new= 201;
+ else if (code=='^') new= 202;
+ else if (code=='"') new= 203;
}
- else if(char1=='I') {
- if(code=='`') new= 204;
- else if(code==39) new= 205;
- else if(code=='^') new= 206;
- else if(code=='"') new= 207;
+ else if (char1=='I') {
+ if (code=='`') new= 204;
+ else if (code==39) new= 205;
+ else if (code=='^') new= 206;
+ else if (code=='"') new= 207;
}
- else if(char1=='N') {
- if(code=='~') new= 209;
+ else if (char1=='N') {
+ if (code=='~') new= 209;
}
- else if(char1=='O') {
- if(code=='`') new= 210;
- else if(code==39) new= 211;
- else if(code=='^') new= 212;
- else if(code=='~') new= 213;
- else if(code=='"') new= 214;
- else if(code=='/') new= 216;
- else if(code=='e') new= 141;
+ else if (char1=='O') {
+ if (code=='`') new= 210;
+ else if (code==39) new= 211;
+ else if (code=='^') new= 212;
+ else if (code=='~') new= 213;
+ else if (code=='"') new= 214;
+ else if (code=='/') new= 216;
+ else if (code=='e') new= 141;
}
- else if(char1=='U') {
- if(code=='`') new= 217;
- else if(code==39) new= 218;
- else if(code=='^') new= 219;
- else if(code=='"') new= 220;
+ else if (char1=='U') {
+ if (code=='`') new= 217;
+ else if (code==39) new= 218;
+ else if (code=='^') new= 219;
+ else if (code=='"') new= 220;
}
- else if(char1=='Y') {
- if(code==39) new= 221;
+ else if (char1=='Y') {
+ if (code==39) new= 221;
}
- else if(char1=='1') {
- if(code=='4') new= 188;
- if(code=='2') new= 189;
+ else if (char1=='1') {
+ if (code=='4') new= 188;
+ if (code=='2') new= 189;
}
- else if(char1=='3') {
- if(code=='4') new= 190;
+ else if (char1=='3') {
+ if (code=='4') new= 190;
}
- else if(char1==':') {
- if(code=='-') new= 247;
+ else if (char1==':') {
+ if (code=='-') new= 247;
}
- else if(char1=='-') {
- if(code==':') new= 247;
- if(code=='|') new= 135;
- if(code=='+') new= 177;
+ else if (char1=='-') {
+ if (code==':') new= 247;
+ if (code=='|') new= 135;
+ if (code=='+') new= 177;
}
- else if(char1=='|') {
- if(code=='-') new= 135;
- if(code=='=') new= 136;
+ else if (char1=='|') {
+ if (code=='-') new= 135;
+ if (code=='=') new= 136;
}
- else if(char1=='=') {
- if(code=='|') new= 136;
+ else if (char1=='=') {
+ if (code=='|') new= 136;
}
- else if(char1=='+') {
- if(code=='-') new= 177;
+ else if (char1=='+') {
+ if (code=='-') new= 177;
}
- if(new) return new;
+ if (new) return new;
else return char1;
}
@@ -232,12 +232,12 @@ static int insert_into_textbuf(Object *obedit, uintptr_t c)
{
Curve *cu= obedit->data;
- if(cu->len<MAXTEXT-1) {
+ if (cu->len<MAXTEXT-1) {
EditFont *ef= cu->editfont;
int x;
- for(x= cu->len; x>cu->pos; x--) ef->textbuf[x]= ef->textbuf[x-1];
- for(x= cu->len; x>cu->pos; x--) ef->textbufinfo[x]= ef->textbufinfo[x-1];
+ for (x= cu->len; x>cu->pos; x--) ef->textbuf[x]= ef->textbuf[x-1];
+ for (x= cu->len; x>cu->pos; x--) ef->textbufinfo[x]= ef->textbufinfo[x-1];
ef->textbuf[cu->pos]= c;
ef->textbufinfo[cu->pos] = cu->curinfo;
ef->textbufinfo[cu->pos].kern = 0;
@@ -262,7 +262,7 @@ static void text_update_edited(bContext *C, Scene *scene, Object *obedit, int re
EditFont *ef= cu->editfont;
cu->curinfo = ef->textbufinfo[cu->pos?cu->pos-1:0];
- if(obedit->totcol > 0) {
+ if (obedit->totcol > 0) {
obedit->actcol= ef->textbufinfo[cu->pos?cu->pos-1:0].mat_nr;
/* since this array is calloc'd, it can be 0 even though we try ensure
@@ -272,12 +272,12 @@ static void text_update_edited(bContext *C, Scene *scene, Object *obedit, int re
}
}
- if(mode == FO_EDIT)
+ if (mode == FO_EDIT)
update_string(cu);
BKE_text_to_curve(bmain, scene, obedit, mode);
- if(recalc)
+ if (recalc)
DAG_id_tag_update(obedit->data, 0);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
}
@@ -291,22 +291,22 @@ static int insert_lorem_exec(bContext *C, wmOperator *UNUSED(op))
int i;
static const char *lastlorem;
- if(lastlorem)
+ if (lastlorem)
p= lastlorem;
else
p= ED_lorem;
i= rand()/(RAND_MAX/6)+4;
- for(p2=p; *p2 && i; p2++) {
+ for (p2=p; *p2 && i; p2++) {
insert_into_textbuf(obedit, *p2);
- if(*p2=='.')
+ if (*p2=='.')
i--;
}
lastlorem = p2+1;
- if(strlen(lastlorem)<5)
+ if (strlen(lastlorem)<5)
lastlorem = ED_lorem;
insert_into_textbuf(obedit, '\n');
@@ -321,16 +321,16 @@ static int insert_lorem_exec(bContext *C, wmOperator *UNUSED(op))
void FONT_OT_insert_lorem(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Insert Lorem";
- ot->description= "Insert placeholder text";
- ot->idname= "FONT_OT_insert_lorem";
+ ot->name = "Insert Lorem";
+ ot->description = "Insert placeholder text";
+ ot->idname = "FONT_OT_insert_lorem";
/* api callbacks */
- ot->exec= insert_lorem_exec;
- ot->poll= ED_operator_editfont;
+ ot->exec = insert_lorem_exec;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/******************* paste file operator ********************/
@@ -348,10 +348,10 @@ static int paste_file(bContext *C, ReportList *reports, const char *filename)
int filelen;
char *strp;
- fp= fopen(filename, "r");
+ fp= BLI_fopen(filename, "r");
- if(!fp) {
- if(reports)
+ if (!fp) {
+ if (reports)
BKE_reportf(reports, RPT_ERROR, "Failed to open file %s", filename);
return OPERATOR_CANCELLED;
}
@@ -368,7 +368,7 @@ static int paste_file(bContext *C, ReportList *reports, const char *filename)
fclose(fp);
strp[filelen]= 0;
- if(cu->len+filelen<MAXTEXT) {
+ if (cu->len+filelen<MAXTEXT) {
int tmplen;
wchar_t *mem = MEM_callocN((sizeof(wchar_t)*filelen)+(4*sizeof(wchar_t)), "temporary");
tmplen = BLI_strncpy_wchar_from_utf8(mem, strp, filelen + 1);
@@ -398,7 +398,7 @@ static int paste_file_exec(bContext *C, wmOperator *op)
static int paste_file_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- if(RNA_struct_property_is_set(op->ptr, "filepath"))
+ if (RNA_struct_property_is_set(op->ptr, "filepath"))
return paste_file_exec(C, op);
WM_event_add_fileselect(C, op);
@@ -409,17 +409,17 @@ static int paste_file_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
void FONT_OT_file_paste(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Paste File";
- ot->description= "Paste contents from file";
- ot->idname= "FONT_OT_file_paste";
+ ot->name = "Paste File";
+ ot->description = "Paste contents from file";
+ ot->idname = "FONT_OT_file_paste";
/* api callbacks */
- ot->exec= paste_file_exec;
- ot->invoke= paste_file_invoke;
- ot->poll= ED_operator_editfont;
+ ot->exec = paste_file_exec;
+ ot->invoke = paste_file_invoke;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
@@ -452,11 +452,11 @@ static void txt_add_object(bContext *C, TextLine *firstline, int totline, float
cu->vfont= get_builtin_font();
cu->vfont->id.us++;
- for(tmp=firstline, a=0; cu->len<MAXTEXT && a<totline; tmp=tmp->next, a++)
+ for (tmp=firstline, a=0; cu->len<MAXTEXT && a<totline; tmp=tmp->next, a++)
nchars += strlen(tmp->line) + 1;
- 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(nchars+4, "str");
cu->strinfo= MEM_callocN((nchars+4)*sizeof(CharInfo), "strinfo");
@@ -465,11 +465,11 @@ static void txt_add_object(bContext *C, TextLine *firstline, int totline, float
cu->len= 0;
cu->pos= 0;
- for(tmp=firstline, a=0; cu->len<MAXTEXT && a<totline; tmp=tmp->next, a++) {
+ for (tmp=firstline, a=0; cu->len<MAXTEXT && a<totline; tmp=tmp->next, a++) {
strcat(cu->str, tmp->line);
cu->len+= strlen(tmp->line);
- if(tmp->next) {
+ if (tmp->next) {
strcat(cu->str, "\n");
cu->len++;
}
@@ -487,12 +487,12 @@ void ED_text_to_object(bContext *C, Text *text, int split_lines)
float offset[3];
int linenum= 0;
- if(!text || !text->lines.first) return;
+ if (!text || !text->lines.first) return;
- if(split_lines) {
- for(line=text->lines.first; line; line=line->next) {
+ if (split_lines) {
+ for (line=text->lines.first; line; line=line->next) {
/* skip lines with no text, but still make space for them */
- if(line->line[0] == '\0') {
+ if (line->line[0] == '\0') {
linenum++;
continue;
}
@@ -502,7 +502,7 @@ void ED_text_to_object(bContext *C, Text *text, int split_lines)
offset[1] = -linenum;
offset[2] = 0;
- if(rv3d)
+ if (rv3d)
mul_mat3_m4_v3(rv3d->viewinv, offset);
txt_add_object(C, line, 1, offset);
@@ -524,19 +524,19 @@ void ED_text_to_object(bContext *C, Text *text, int split_lines)
static short next_word(Curve *cu)
{
short s;
- for(s=cu->pos; (cu->str[s]) && (cu->str[s]!=' ') && (cu->str[s]!='\n') &&
+ for (s=cu->pos; (cu->str[s]) && (cu->str[s]!=' ') && (cu->str[s]!='\n') &&
(cu->str[s]!=1) && (cu->str[s]!='\r'); s++);
- if(cu->str[s]) return(s+1); else return(s);
+ if (cu->str[s]) return(s+1); else return(s);
}
static short prev_word(Curve *cu)
{
short s;
- if(cu->pos==0) return(0);
- for(s=cu->pos-2; (cu->str[s]) && (cu->str[s]!=' ') && (cu->str[s]!='\n') &&
+ if (cu->pos==0) return(0);
+ for (s=cu->pos-2; (cu->str[s]) && (cu->str[s]!=' ') && (cu->str[s]!='\n') &&
(cu->str[s]!=1) && (cu->str[s]!='\r'); s--);
- if(cu->str[s]) return(s+1); else return(s);
+ if (cu->str[s]) return(s+1); else return(s);
}
static int kill_selection(Object *obedit, int ins) /* 1 == new character */
@@ -548,16 +548,16 @@ static int kill_selection(Object *obedit, int ins) /* 1 == new character */
int getfrom;
direction = BKE_font_getselection(obedit, &selstart, &selend);
- if(direction) {
+ if (direction) {
int size;
- if(ins) offset = 1;
- if(cu->pos >= selstart) cu->pos = selstart+offset;
- if((direction == -1) && ins) {
+ if (ins) offset = 1;
+ if (cu->pos >= selstart) cu->pos = selstart+offset;
+ if ((direction == -1) && ins) {
selstart++;
selend++;
}
getfrom = selend+offset;
- if(ins==0) getfrom++;
+ if (ins==0) getfrom++;
size = (cu->len * sizeof(wchar_t)) - (selstart * sizeof(wchar_t)) + (offset*sizeof(wchar_t));
memmove(ef->textbuf+selstart, ef->textbuf+getfrom, size);
memmove(ef->textbufinfo+selstart, ef->textbufinfo+getfrom, ((cu->len-selstart)+offset)*sizeof(CharInfo));
@@ -584,11 +584,11 @@ static int set_style(bContext *C, const int style, const int clear)
EditFont *ef= cu->editfont;
int i, selstart, selend;
- if(!BKE_font_getselection(obedit, &selstart, &selend))
+ if (!BKE_font_getselection(obedit, &selstart, &selend))
return OPERATOR_CANCELLED;
- for(i=selstart; i<=selend; i++) {
- if(clear)
+ for (i=selstart; i<=selend; i++) {
+ if (clear)
ef->textbufinfo[i].flag &= ~style;
else
ef->textbufinfo[i].flag |= style;
@@ -611,16 +611,16 @@ static int set_style_exec(bContext *C, wmOperator *op)
void FONT_OT_style_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Style";
- ot->description= "Set font style";
- ot->idname= "FONT_OT_style_set";
+ ot->name = "Set Style";
+ ot->description = "Set font style";
+ ot->idname = "FONT_OT_style_set";
/* api callbacks */
- ot->exec= set_style_exec;
- ot->poll= ED_operator_editfont;
+ ot->exec = set_style_exec;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "style", style_items, CU_CHINFO_BOLD, "Style", "Style to set selection to");
@@ -635,7 +635,7 @@ static int toggle_style_exec(bContext *C, wmOperator *op)
Curve *cu= obedit->data;
int style, clear, selstart, selend;
- if(!BKE_font_getselection(obedit, &selstart, &selend))
+ if (!BKE_font_getselection(obedit, &selstart, &selend))
return OPERATOR_CANCELLED;
style= RNA_enum_get(op->ptr, "style");
@@ -649,16 +649,16 @@ static int toggle_style_exec(bContext *C, wmOperator *op)
void FONT_OT_style_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Style";
- ot->description= "Toggle font style";
- ot->idname= "FONT_OT_style_toggle";
+ ot->name = "Toggle Style";
+ ot->description = "Toggle font style";
+ ot->idname = "FONT_OT_style_toggle";
/* api callbacks */
- ot->exec= toggle_style_exec;
- ot->poll= ED_operator_editfont;
+ ot->exec = toggle_style_exec;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "style", style_items, CU_CHINFO_BOLD, "Style", "Style to set selection to");
@@ -670,7 +670,7 @@ static void copy_selection(Object *obedit)
{
int selstart, selend;
- if(BKE_font_getselection(obedit, &selstart, &selend)) {
+ if (BKE_font_getselection(obedit, &selstart, &selend)) {
Curve *cu= obedit->data;
EditFont *ef= cu->editfont;
@@ -692,13 +692,13 @@ static int copy_text_exec(bContext *C, wmOperator *UNUSED(op))
void FONT_OT_text_copy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Text";
- ot->description= "Copy selected text to clipboard";
- ot->idname= "FONT_OT_text_copy";
+ ot->name = "Copy Text";
+ ot->description = "Copy selected text to clipboard";
+ ot->idname = "FONT_OT_text_copy";
/* api callbacks */
- ot->exec= copy_text_exec;
- ot->poll= ED_operator_editfont;
+ ot->exec = copy_text_exec;
+ ot->poll = ED_operator_editfont;
}
/******************* cut text operator ********************/
@@ -709,7 +709,7 @@ static int cut_text_exec(bContext *C, wmOperator *UNUSED(op))
Object *obedit= CTX_data_edit_object(C);
int selstart, selend;
- if(!BKE_font_getselection(obedit, &selstart, &selend))
+ if (!BKE_font_getselection(obedit, &selstart, &selend))
return OPERATOR_CANCELLED;
copy_selection(obedit);
@@ -723,16 +723,16 @@ static int cut_text_exec(bContext *C, wmOperator *UNUSED(op))
void FONT_OT_text_cut(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Cut Text";
- ot->description= "Cut selected text to clipboard";
- ot->idname= "FONT_OT_text_cut";
+ ot->name = "Cut Text";
+ ot->description = "Cut selected text to clipboard";
+ ot->idname = "FONT_OT_text_cut";
/* api callbacks */
- ot->exec= cut_text_exec;
- ot->poll= ED_operator_editfont;
+ ot->exec = cut_text_exec;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/******************* paste text operator ********************/
@@ -744,8 +744,8 @@ static int paste_selection(Object *obedit, ReportList *reports)
int len= wcslen(ef->copybuf);
// Verify that the copy buffer => [copy buffer len] + cu->len < MAXTEXT
- if(cu->len + len <= MAXTEXT) {
- if(len) {
+ if (cu->len + len <= MAXTEXT) {
+ if (len) {
int size = (cu->len * sizeof(wchar_t)) - (cu->pos*sizeof(wchar_t)) + sizeof(wchar_t);
memmove(ef->textbuf+cu->pos+len, ef->textbuf+cu->pos, size);
memcpy(ef->textbuf+cu->pos, ef->copybuf, len * sizeof(wchar_t));
@@ -770,7 +770,7 @@ static int paste_text_exec(bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C);
Object *obedit= CTX_data_edit_object(C);
- if(!paste_selection(obedit, op->reports))
+ if (!paste_selection(obedit, op->reports))
return OPERATOR_CANCELLED;
text_update_edited(C, scene, obedit, 1, FO_EDIT);
@@ -781,16 +781,16 @@ static int paste_text_exec(bContext *C, wmOperator *op)
void FONT_OT_text_paste(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Paste Text";
- ot->description= "Paste text from clipboard";
- ot->idname= "FONT_OT_text_paste";
+ ot->name = "Paste Text";
+ ot->description = "Paste text from clipboard";
+ ot->idname = "FONT_OT_text_paste";
/* api callbacks */
- ot->exec= paste_text_exec;
- ot->poll= ED_operator_editfont;
+ ot->exec = paste_text_exec;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ move operator ************************/
@@ -818,77 +818,77 @@ static int move_cursor(bContext *C, int type, int select)
switch(type) {
case LINE_BEGIN:
- if((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
- while(cu->pos>0) {
- if(ef->textbuf[cu->pos-1]=='\n') break;
- if(ef->textbufinfo[cu->pos-1].flag & CU_CHINFO_WRAP) break;
+ if ((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
+ while (cu->pos>0) {
+ if (ef->textbuf[cu->pos-1]=='\n') break;
+ if (ef->textbufinfo[cu->pos-1].flag & CU_CHINFO_WRAP) break;
cu->pos--;
}
cursmove=FO_CURS;
break;
case LINE_END:
- if((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
- while(cu->pos<cu->len) {
- if(ef->textbuf[cu->pos]==0) break;
- if(ef->textbuf[cu->pos]=='\n') break;
- if(ef->textbufinfo[cu->pos].flag & CU_CHINFO_WRAP ) break;
+ if ((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
+ while (cu->pos<cu->len) {
+ if (ef->textbuf[cu->pos]==0) break;
+ if (ef->textbuf[cu->pos]=='\n') break;
+ if (ef->textbufinfo[cu->pos].flag & CU_CHINFO_WRAP ) break;
cu->pos++;
}
cursmove=FO_CURS;
break;
case PREV_WORD:
- if((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
+ if ((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
cu->pos= prev_word(cu);
cursmove= FO_CURS;
break;
case NEXT_WORD:
- if((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
+ if ((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
cu->pos= next_word(cu);
cursmove= FO_CURS;
break;
case PREV_CHAR:
- if((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
+ if ((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
cu->pos--;
cursmove=FO_CURS;
break;
case NEXT_CHAR:
- if((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
+ if ((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
cu->pos++;
cursmove= FO_CURS;
break;
case PREV_LINE:
- if((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
+ if ((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
cursmove=FO_CURSUP;
break;
case NEXT_LINE:
- if((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
+ if ((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
cursmove= FO_CURSDOWN;
break;
case PREV_PAGE:
- if((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
+ if ((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
cursmove=FO_PAGEUP;
break;
case NEXT_PAGE:
- if((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
+ if ((select) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
cursmove=FO_PAGEDOWN;
break;
}
- if(cursmove == -1)
+ if (cursmove == -1)
return OPERATOR_CANCELLED;
- if(select == 0) {
- if(cu->selstart) {
+ if (select == 0) {
+ if (cu->selstart) {
struct Main *bmain= CTX_data_main(C);
cu->selstart = cu->selend = 0;
update_string(cu);
@@ -896,13 +896,13 @@ static int move_cursor(bContext *C, int type, int select)
}
}
- if(cu->pos>cu->len) cu->pos= cu->len;
- else if(cu->pos>=MAXTEXT) cu->pos= MAXTEXT;
- else if(cu->pos<0) cu->pos= 0;
+ if (cu->pos>cu->len) cu->pos= cu->len;
+ else if (cu->pos>=MAXTEXT) cu->pos= MAXTEXT;
+ else if (cu->pos<0) cu->pos= 0;
text_update_edited(C, scene, obedit, select, cursmove);
- if(select)
+ if (select)
cu->selend = cu->pos;
return OPERATOR_FINISHED;
@@ -918,16 +918,16 @@ static int move_exec(bContext *C, wmOperator *op)
void FONT_OT_move(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move Cursor";
- ot->description= "Move cursor to position type";
- ot->idname= "FONT_OT_move";
+ ot->name = "Move Cursor";
+ ot->description = "Move cursor to position type";
+ ot->idname = "FONT_OT_move";
/* api callbacks */
- ot->exec= move_exec;
- ot->poll= ED_operator_editfont;
+ ot->exec = move_exec;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to");
@@ -945,16 +945,16 @@ static int move_select_exec(bContext *C, wmOperator *op)
void FONT_OT_move_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move Select";
- ot->description= "Make selection from current cursor position to new cursor position type";
- ot->idname= "FONT_OT_move_select";
+ ot->name = "Move Select";
+ ot->description = "Make selection from current cursor position to new cursor position type";
+ ot->idname = "FONT_OT_move_select";
/* api callbacks */
- ot->exec= move_select_exec;
- ot->poll= ED_operator_editfont;
+ ot->exec = move_select_exec;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to, to make a selection");
@@ -974,7 +974,7 @@ static int change_spacing_exec(bContext *C, wmOperator *op)
kern += delta;
CLAMP(kern, -20, 20);
- if(ef->textbufinfo[cu->pos-1].kern == kern)
+ if (ef->textbufinfo[cu->pos-1].kern == kern)
return OPERATOR_CANCELLED;
ef->textbufinfo[cu->pos-1].kern = kern;
@@ -987,16 +987,16 @@ static int change_spacing_exec(bContext *C, wmOperator *op)
void FONT_OT_change_spacing(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Change Spacing";
- ot->description= "Change font spacing";
- ot->idname= "FONT_OT_change_spacing";
+ ot->name = "Change Spacing";
+ ot->description = "Change font spacing";
+ ot->idname = "FONT_OT_change_spacing";
/* api callbacks */
- ot->exec= change_spacing_exec;
- ot->poll= ED_operator_editfont;
+ ot->exec = change_spacing_exec;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_int(ot->srna, "delta", 1, -20, 20, "Delta", "Amount to decrease or increase character spacing with", -20, 20);
@@ -1012,14 +1012,14 @@ static int change_character_exec(bContext *C, wmOperator *op)
EditFont *ef= cu->editfont;
int character, delta= RNA_int_get(op->ptr, "delta");
- if(cu->pos <= 0)
+ if (cu->pos <= 0)
return OPERATOR_CANCELLED;
character= ef->textbuf[cu->pos - 1];
character += delta;
CLAMP(character, 0, 255);
- if(character == ef->textbuf[cu->pos - 1])
+ if (character == ef->textbuf[cu->pos - 1])
return OPERATOR_CANCELLED;
ef->textbuf[cu->pos - 1]= character;
@@ -1032,16 +1032,16 @@ static int change_character_exec(bContext *C, wmOperator *op)
void FONT_OT_change_character(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Change Character";
- ot->description= "Change font character code";
- ot->idname= "FONT_OT_change_character";
+ ot->name = "Change Character";
+ ot->description = "Change font character code";
+ ot->idname = "FONT_OT_change_character";
/* api callbacks */
- ot->exec= change_character_exec;
- ot->poll= ED_operator_editfont;
+ ot->exec = change_character_exec;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_int(ot->srna, "delta", 1, -255, 255, "Delta", "Number to increase or decrease character code with", -255, 255);
@@ -1057,9 +1057,9 @@ static int line_break_exec(bContext *C, wmOperator *op)
EditFont *ef= cu->editfont;
const int ctrl= RNA_boolean_get(op->ptr, "ctrl");
- if(ctrl) {
+ if (ctrl) {
insert_into_textbuf(obedit, 1);
- if(ef->textbuf[cu->pos]!='\n')
+ if (ef->textbuf[cu->pos]!='\n')
insert_into_textbuf(obedit, '\n');
}
else
@@ -1075,16 +1075,16 @@ static int line_break_exec(bContext *C, wmOperator *op)
void FONT_OT_line_break(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Line Break";
- ot->description= "Insert line break at cursor position";
- ot->idname= "FONT_OT_line_break";
+ ot->name = "Line Break";
+ ot->description = "Insert line break at cursor position";
+ ot->idname = "FONT_OT_line_break";
/* api callbacks */
- ot->exec= line_break_exec;
- ot->poll= ED_operator_editfont;
+ ot->exec = line_break_exec;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "ctrl", 0, "Ctrl", ""); // XXX what is this?
@@ -1109,16 +1109,16 @@ static int delete_exec(bContext *C, wmOperator *op)
EditFont *ef= cu->editfont;
int x, selstart, selend, type= RNA_enum_get(op->ptr, "type");
- if(cu->len == 0)
+ if (cu->len == 0)
return OPERATOR_CANCELLED;
- if(BKE_font_getselection(obedit, &selstart, &selend)) {
- if(type == DEL_NEXT_SEL) type= DEL_SELECTION;
- else if(type == DEL_PREV_SEL) type= DEL_SELECTION;
+ if (BKE_font_getselection(obedit, &selstart, &selend)) {
+ if (type == DEL_NEXT_SEL) type= DEL_SELECTION;
+ else if (type == DEL_PREV_SEL) type= DEL_SELECTION;
}
else {
- if(type == DEL_NEXT_SEL) type= DEL_NEXT_CHAR;
- else if(type == DEL_PREV_SEL) type= DEL_PREV_CHAR;
+ if (type == DEL_NEXT_SEL) type= DEL_NEXT_CHAR;
+ else if (type == DEL_PREV_SEL) type= DEL_PREV_CHAR;
}
switch(type) {
@@ -1127,28 +1127,28 @@ static int delete_exec(bContext *C, wmOperator *op)
ef->textbuf[0]= 0;
break;
case DEL_SELECTION:
- if(!kill_selection(obedit, 0))
+ if (!kill_selection(obedit, 0))
return OPERATOR_CANCELLED;
break;
case DEL_PREV_CHAR:
- if(cu->pos<=0)
+ if (cu->pos<=0)
return OPERATOR_CANCELLED;
- for(x=cu->pos;x<=cu->len;x++)
+ for (x=cu->pos;x<=cu->len;x++)
ef->textbuf[x-1]= ef->textbuf[x];
- for(x=cu->pos;x<=cu->len;x++)
+ for (x=cu->pos;x<=cu->len;x++)
ef->textbufinfo[x-1]= ef->textbufinfo[x];
cu->pos--;
ef->textbuf[--cu->len]='\0';
break;
case DEL_NEXT_CHAR:
- if(cu->pos>=cu->len)
+ if (cu->pos>=cu->len)
return OPERATOR_CANCELLED;
- for(x=cu->pos;x<cu->len;x++)
+ for (x=cu->pos;x<cu->len;x++)
ef->textbuf[x]= ef->textbuf[x+1];
- for(x=cu->pos;x<cu->len;x++)
+ for (x=cu->pos;x<cu->len;x++)
ef->textbufinfo[x]= ef->textbufinfo[x+1];
ef->textbuf[--cu->len]='\0';
@@ -1165,16 +1165,16 @@ static int delete_exec(bContext *C, wmOperator *op)
void FONT_OT_delete(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete";
- ot->description= "Delete text by cursor position";
- ot->idname= "FONT_OT_delete";
+ ot->name = "Delete";
+ ot->description = "Delete text by cursor position";
+ ot->idname = "FONT_OT_delete";
/* api callbacks */
- ot->exec= delete_exec;
- ot->poll= ED_operator_editfont;
+ ot->exec = delete_exec;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "type", delete_type_items, DEL_ALL, "Type", "Which part of the text to delete");
@@ -1190,7 +1190,7 @@ static int insert_text_exec(bContext *C, wmOperator *op)
wchar_t *inserted_text;
int a, len;
- if(!RNA_struct_property_is_set(op->ptr, "text"))
+ if (!RNA_struct_property_is_set(op->ptr, "text"))
return OPERATOR_CANCELLED;
inserted_utf8= RNA_string_get_alloc(op->ptr, "text", NULL, 0);
@@ -1199,7 +1199,7 @@ static int insert_text_exec(bContext *C, wmOperator *op)
inserted_text= MEM_callocN(sizeof(wchar_t)*(len+1), "FONT_insert_text");
BLI_strncpy_wchar_from_utf8(inserted_text, inserted_utf8, len+1);
- for(a=0; a<len; a++)
+ for (a=0; a<len; a++)
insert_into_textbuf(obedit, inserted_text[a]);
MEM_freeN(inserted_text);
@@ -1223,28 +1223,28 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt)
int event= evt->type, val= evt->val;
wchar_t inserted_text[2]= {0};
- if(RNA_struct_property_is_set(op->ptr, "text"))
+ if (RNA_struct_property_is_set(op->ptr, "text"))
return insert_text_exec(C, op);
- if(RNA_struct_property_is_set(op->ptr, "accent")) {
- if(cu->len!=0 && cu->pos>0)
+ if (RNA_struct_property_is_set(op->ptr, "accent")) {
+ if (cu->len!=0 && cu->pos>0)
accentcode= 1;
return OPERATOR_FINISHED;
}
/* tab should exit editmode, but we allow it to be typed using modifier keys */
- if(event==TABKEY) {
- if((alt||ctrl||shift) == 0)
+ if (event==TABKEY) {
+ if ((alt||ctrl||shift) == 0)
return OPERATOR_PASS_THROUGH;
else
ascii= 9;
}
- else if(event==BACKSPACEKEY)
+ else if (event==BACKSPACEKEY)
ascii= 0;
- if(val && (ascii || evt->utf8_buf[0])) {
+ if (val && (ascii || evt->utf8_buf[0])) {
/* handle case like TAB (== 9) */
- if( (ascii > 31 && ascii < 254 && ascii != 127) ||
+ if ( (ascii > 31 && ascii < 254 && ascii != 127) ||
(ascii==13) ||
(ascii==10) ||
(ascii==8) ||
@@ -1257,34 +1257,34 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt)
insert_into_textbuf(obedit, ascii);
accentcode= 0;
}
- else if(accentcode) {
- if(cu->pos>0) {
+ else if (accentcode) {
+ if (cu->pos>0) {
inserted_text[0]= findaccent(ef->textbuf[cu->pos-1], ascii);
ef->textbuf[cu->pos-1]= inserted_text[0];
}
accentcode= 0;
}
- else if(cu->len<MAXTEXT-1) {
- if(alt) {
+ else if (cu->len<MAXTEXT-1) {
+ if (alt) {
/* might become obsolete, apple has default values for this, other OS's too? */
- if(ascii=='t') ascii= 137;
- else if(ascii=='c') ascii= 169;
- else if(ascii=='f') ascii= 164;
- else if(ascii=='g') ascii= 176;
- else if(ascii=='l') ascii= 163;
- else if(ascii=='r') ascii= 174;
- else if(ascii=='s') ascii= 223;
- else if(ascii=='y') ascii= 165;
- else if(ascii=='.') ascii= 138;
- else if(ascii=='1') ascii= 185;
- else if(ascii=='2') ascii= 178;
- else if(ascii=='3') ascii= 179;
- else if(ascii=='%') ascii= 139;
- else if(ascii=='?') ascii= 191;
- else if(ascii=='!') ascii= 161;
- else if(ascii=='x') ascii= 215;
- else if(ascii=='>') ascii= 187;
- else if(ascii=='<') ascii= 171;
+ if (ascii=='t') ascii= 137;
+ else if (ascii=='c') ascii= 169;
+ else if (ascii=='f') ascii= 164;
+ else if (ascii=='g') ascii= 176;
+ else if (ascii=='l') ascii= 163;
+ else if (ascii=='r') ascii= 174;
+ else if (ascii=='s') ascii= 223;
+ else if (ascii=='y') ascii= 165;
+ else if (ascii=='.') ascii= 138;
+ else if (ascii=='1') ascii= 185;
+ else if (ascii=='2') ascii= 178;
+ else if (ascii=='3') ascii= 179;
+ else if (ascii=='%') ascii= 139;
+ else if (ascii=='?') ascii= 191;
+ else if (ascii=='!') ascii= 161;
+ else if (ascii=='x') ascii= 215;
+ else if (ascii=='>') ascii= 187;
+ else if (ascii=='<') ascii= 171;
}
inserted_text[0]= ascii;
@@ -1300,8 +1300,8 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt)
text_update_edited(C, scene, obedit, 1, FO_EDIT);
}
}
- else if(val && event == BACKSPACEKEY) {
- if(alt && cu->len!=0 && cu->pos>0)
+ else if (val && event == BACKSPACEKEY) {
+ if (alt && cu->len!=0 && cu->pos>0)
accentcode= 1;
return OPERATOR_PASS_THROUGH;
@@ -1309,7 +1309,7 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt)
else
return OPERATOR_PASS_THROUGH;
- if(inserted_text[0]) {
+ if (inserted_text[0]) {
/* store as utf8 in RNA string */
char inserted_utf8[8] = {0};
@@ -1326,17 +1326,17 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt)
void FONT_OT_text_insert(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Insert Text";
- ot->description= "Insert text at cursor position";
- ot->idname= "FONT_OT_text_insert";
+ ot->name = "Insert Text";
+ ot->description = "Insert text at cursor position";
+ ot->idname = "FONT_OT_text_insert";
/* api callbacks */
- ot->exec= insert_text_exec;
- ot->invoke= insert_text_invoke;
- ot->poll= ED_operator_editfont;
+ ot->exec = insert_text_exec;
+ ot->invoke = insert_text_invoke;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position");
@@ -1365,16 +1365,16 @@ static int textbox_add_exec(bContext *C, wmOperator *UNUSED(op))
void FONT_OT_textbox_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Textbox";
- ot->description= "Add a new text box";
- ot->idname= "FONT_OT_textbox_add";
+ ot->name = "Add Textbox";
+ ot->description = "Add a new text box";
+ ot->idname = "FONT_OT_textbox_add";
/* api callbacks */
- ot->exec= textbox_add_exec;
- ot->poll= ED_operator_object_active_editable_font;
+ ot->exec = textbox_add_exec;
+ ot->poll = ED_operator_object_active_editable_font;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -1408,16 +1408,16 @@ static int textbox_remove_exec(bContext *C, wmOperator *op)
void FONT_OT_textbox_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Textbox";
- ot->description= "Remove the textbox";
- ot->idname= "FONT_OT_textbox_remove";
+ ot->name = "Remove Textbox";
+ ot->description = "Remove the textbox";
+ ot->idname = "FONT_OT_textbox_remove";
/* api callbacks */
- ot->exec= textbox_remove_exec;
- ot->poll= ED_operator_object_active_editable_font;
+ ot->exec = textbox_remove_exec;
+ ot->poll = ED_operator_object_active_editable_font;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "The current text box", 0, INT_MAX);
}
@@ -1431,7 +1431,7 @@ void make_editText(Object *obedit)
Curve *cu= obedit->data;
EditFont *ef= cu->editfont;
- if(ef==NULL) {
+ if (ef==NULL) {
ef= cu->editfont= MEM_callocN(sizeof(EditFont), "editfont");
ef->textbuf= MEM_callocN((MAXTEXT+4)*sizeof(wchar_t), "texteditbuf");
@@ -1451,9 +1451,9 @@ void make_editText(Object *obedit)
memcpy(ef->textbufinfo, cu->strinfo, (cu->len)*sizeof(CharInfo));
memcpy(ef->oldstrinfo, cu->strinfo, (cu->len)*sizeof(CharInfo));
- if(cu->pos>cu->len) cu->pos= cu->len;
+ if (cu->pos>cu->len) cu->pos= cu->len;
- if(cu->pos)
+ if (cu->pos)
cu->curinfo = ef->textbufinfo[cu->pos-1];
else
cu->curinfo = ef->textbufinfo[0];
@@ -1474,7 +1474,7 @@ void load_editText(Object *obedit)
update_string(cu);
- if(cu->strinfo)
+ if (cu->strinfo)
MEM_freeN(cu->strinfo);
cu->strinfo= MEM_callocN((cu->len+4)*sizeof(CharInfo), "texteditinfo");
memcpy(cu->strinfo, ef->textbufinfo, (cu->len)*sizeof(CharInfo));
@@ -1483,7 +1483,7 @@ void load_editText(Object *obedit)
/* this memory system is weak... */
- if(cu->selboxes) {
+ if (cu->selboxes) {
MEM_freeN(cu->selboxes);
cu->selboxes= NULL;
}
@@ -1512,18 +1512,18 @@ static int set_case(bContext *C, int ccase)
len= wcslen(ef->textbuf);
str= ef->textbuf;
- while(len) {
- if(*str>='a' && *str<='z')
+ while (len) {
+ if (*str>='a' && *str<='z')
*str-= 32;
len--;
str++;
}
- if(ccase == CASE_LOWER) {
+ if (ccase == CASE_LOWER) {
len= wcslen(ef->textbuf);
str= ef->textbuf;
- while(len) {
- if(*str>='A' && *str<='Z') {
+ while (len) {
+ if (*str>='A' && *str<='Z') {
*str+= 32;
}
len--;
@@ -1544,16 +1544,16 @@ static int set_case_exec(bContext *C, wmOperator *op)
void FONT_OT_case_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Case";
- ot->description= "Set font case";
- ot->idname= "FONT_OT_case_set";
+ ot->name = "Set Case";
+ ot->description = "Set font case";
+ ot->idname = "FONT_OT_case_set";
/* api callbacks */
- ot->exec= set_case_exec;
- ot->poll= ED_operator_editfont;
+ ot->exec = set_case_exec;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "case", case_items, CASE_LOWER, "Case", "Lower or upper case");
@@ -1571,8 +1571,8 @@ static int toggle_case_exec(bContext *C, wmOperator *UNUSED(op))
len= wcslen(ef->textbuf);
str= ef->textbuf;
- while(len) {
- if(*str>='a' && *str<='z') {
+ while (len) {
+ if (*str>='a' && *str<='z') {
ccase= CASE_LOWER;
break;
}
@@ -1587,16 +1587,16 @@ static int toggle_case_exec(bContext *C, wmOperator *UNUSED(op))
void FONT_OT_case_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Case";
- ot->description= "Toggle font case";
- ot->idname= "FONT_OT_case_toggle";
+ ot->name = "Toggle Case";
+ ot->description = "Toggle font case";
+ ot->idname = "FONT_OT_case_toggle";
/* api callbacks */
- ot->exec= toggle_case_exec;
- ot->poll= ED_operator_editfont;
+ ot->exec = toggle_case_exec;
+ ot->poll = ED_operator_editfont;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* **************** Open Font ************** */
@@ -1627,18 +1627,18 @@ static int font_open_exec(bContext *C, wmOperator *op)
font= load_vfont(bmain, filepath);
- if(!font) {
- if(op->customdata) MEM_freeN(op->customdata);
+ if (!font) {
+ if (op->customdata) MEM_freeN(op->customdata);
return OPERATOR_CANCELLED;
}
- if(!op->customdata)
+ if (!op->customdata)
font_ui_template_init(C, op);
/* hook into UI */
pprop= op->customdata;
- if(pprop->prop) {
+ if (pprop->prop) {
/* when creating new ID blocks, use is already 1, but RNA
* pointer se also increases user, so this compensates it */
font->id.us--;
@@ -1666,14 +1666,14 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
/* hook into UI */
pprop= op->customdata;
- if(pprop->prop) {
+ if (pprop->prop) {
idptr= RNA_property_pointer_get((PointerRNA *)pprop, pprop->prop);
font= idptr.id.data;
}
path = (font && strcmp(font->name, FO_BUILTIN_NAME) != 0)? font->name: U.fontdir;
- if(RNA_struct_property_is_set(op->ptr, "filepath"))
+ if (RNA_struct_property_is_set(op->ptr, "filepath"))
return font_open_exec(C, op);
RNA_string_set(op->ptr, "filepath", path);
@@ -1685,16 +1685,16 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void FONT_OT_open(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Open Font";
- ot->idname= "FONT_OT_open";
+ ot->name = "Open Font";
+ ot->idname = "FONT_OT_open";
/* api callbacks */
- ot->exec= font_open_exec;
- ot->invoke= open_invoke;
- ot->cancel= font_open_cancel;
+ ot->exec = font_open_exec;
+ ot->invoke = open_invoke;
+ ot->cancel = font_open_cancel;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
WM_operator_properties_filesel(ot, FOLDERFILE|FTFONTFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
@@ -1711,7 +1711,7 @@ static int font_unlink_exec(bContext *C, wmOperator *op)
uiIDContextProperty(C, &pprop.ptr, &pprop.prop);
- if(pprop.prop==NULL) {
+ if (pprop.prop==NULL) {
BKE_report(op->reports, RPT_ERROR, "Incorrect context for running font unlink");
return OPERATOR_CANCELLED;
}
@@ -1728,12 +1728,12 @@ static int font_unlink_exec(bContext *C, wmOperator *op)
void FONT_OT_unlink(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Unlink";
- ot->idname= "FONT_OT_unlink";
- ot->description= "Unlink active font data block";
+ ot->name = "Unlink";
+ ot->idname = "FONT_OT_unlink";
+ ot->description = "Unlink active font data block";
/* api callbacks */
- ot->exec= font_unlink_exec;
+ ot->exec = font_unlink_exec;
}
@@ -1783,7 +1783,7 @@ static void free_undoFont(void *strv)
static void *get_undoFont(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
- if(obedit && obedit->type==OB_FONT) {
+ if (obedit && obedit->type==OB_FONT) {
return obedit->data;
}
return NULL;
diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt
index 946e1c66ad7..b27901c2667 100644
--- a/source/blender/editors/datafiles/CMakeLists.txt
+++ b/source/blender/editors/datafiles/CMakeLists.txt
@@ -74,6 +74,7 @@ if(WITH_BLENDER)
smooth.png.c
snake_hook.png.c
soften.png.c
+ claystrips.png.c
subtract.png.c
texdraw.png.c
thumb.png.c
diff --git a/source/blender/editors/datafiles/blender_icons.png.c b/source/blender/editors/datafiles/blender_icons.png.c
index d7582a118ca..85e469717de 100644
--- a/source/blender/editors/datafiles/blender_icons.png.c
+++ b/source/blender/editors/datafiles/blender_icons.png.c
@@ -1,6865 +1,7089 @@
/* DataToC output of file <blender_icons_png> */
-int datatoc_blender_icons_png_size= 219467;
+int datatoc_blender_icons_png_size= 226647;
char datatoc_blender_icons_png[]= {
-137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0,
- 13, 73, 72, 68, 82, 0, 0, 2, 90, 0, 0, 2,128, 8, 6, 0, 0, 0, 68,254,214,163, 0, 0, 10, 79,105, 67, 67, 80, 80,104,
-111,116,111,115,104,111,112, 32, 73, 67, 67, 32,112,114,111,102,105,108,101, 0, 0,120,218,157, 83,103, 84, 83,233, 22, 61,247,
-222,244, 66, 75,136,128,148, 75,111, 82, 21, 8, 32, 82, 66,139,128, 20,145, 38, 42, 33, 9, 16, 74,136, 33,161,217, 21, 81,193,
- 17, 69, 69, 4, 27,200,160,136, 3,142,142,128,140, 21, 81, 44, 12,138, 10,216, 7,228, 33,162,142,131,163,136,138,202,251,225,
-123,163,107,214,188,247,230,205,254,181,215, 62,231,172,243,157,179,207, 7,192, 8, 12,150, 72, 51, 81, 53,128, 12,169, 66, 30,
- 17,224,131,199,196,198,225,228, 46, 64,129, 10, 36,112, 0, 16, 8,179,100, 33,115,253, 35, 1, 0,248,126, 60, 60, 43, 34,192,
- 7,190, 0, 1,120,211, 11, 8, 0,192, 77,155,192, 48, 28,135,255, 15,234, 66,153, 92, 1,128,132, 1,192,116,145, 56, 75, 8,
-128, 20, 0, 64,122,142, 66,166, 0, 64, 70, 1,128,157,152, 38, 83, 0,160, 4, 0, 96,203, 99, 98,227, 0, 80, 45, 0, 96, 39,
-127,230,211, 0,128,157,248,153,123, 1, 0, 91,148, 33, 21, 1,160,145, 0, 32, 19,101,136, 68, 0,104, 59, 0,172,207, 86,138,
- 69, 0, 88, 48, 0, 20,102, 75,196, 57, 0,216, 45, 0, 48, 73, 87,102, 72, 0,176,183, 0,192,206, 16, 11,178, 0, 8, 12, 0,
- 48, 81,136,133, 41, 0, 4,123, 0, 96,200, 35, 35,120, 0,132,153, 0, 20, 70,242, 87, 60,241, 43,174, 16,231, 42, 0, 0,120,
-153,178, 60,185, 36, 57, 69,129, 91, 8, 45,113, 7, 87, 87, 46, 30, 40,206, 73, 23, 43, 20, 54, 97, 2, 97,154, 64, 46,194,121,
-153, 25, 50,129, 52, 15,224,243,204, 0, 0,160,145, 21, 17,224,131,243,253,120,206, 14,174,206,206, 54,142,182, 14, 95, 45,234,
-191, 6,255, 34, 98, 98,227,254,229,207,171,112, 64, 0, 0,225,116,126,209,254, 44, 47,179, 26,128, 59, 6,128,109,254,162, 37,
-238, 4,104, 94, 11,160,117,247,139,102,178, 15, 64,181, 0,160,233,218, 87,243,112,248,126, 60, 60, 69,161,144,185,217,217,229,
-228,228,216, 74,196, 66, 91, 97,202, 87,125,254,103,194, 95,192, 87,253,108,249,126, 60,252,247,245,224,190,226, 36,129, 50, 93,
-129, 71, 4,248,224,194,204,244, 76,165, 28,207,146, 9,132, 98,220,230,143, 71,252,183, 11,255,252, 29,211, 34,196, 73, 98,185,
- 88, 42, 20,227, 81, 18,113,142, 68,154,140,243, 50,165, 34,137, 66,146, 41,197, 37,210,255,100,226,223, 44,251, 3, 62,223, 53,
- 0,176,106, 62, 1,123,145, 45,168, 93, 99, 3,246, 75, 39, 16, 88,116,192,226,247, 0, 0,242,187,111,193,212, 40, 8, 3,128,
-104,131,225,207,119,255,239, 63,253, 71,160, 37, 0,128,102, 73,146,113, 0, 0, 94, 68, 36, 46, 84,202,179, 63,199, 8, 0, 0,
- 68,160,129, 42,176, 65, 27,244,193, 24, 44,192, 6, 28,193, 5,220,193, 11,252, 96, 54,132, 66, 36,196,194, 66, 16, 66, 10,100,
-128, 28,114, 96, 41,172,130, 66, 40,134,205,176, 29, 42, 96, 47,212, 64, 29, 52,192, 81,104,134,147,112, 14, 46,194, 85,184, 14,
- 61,112, 15,250, 97, 8,158,193, 40,188,129, 9, 4, 65,200, 8, 19, 97, 33,218,136, 1, 98,138, 88, 35,142, 8, 23,153,133,248,
- 33,193, 72, 4, 18,139, 36, 32,201,136, 20, 81, 34, 75,145, 53, 72, 49, 82,138, 84, 32, 85, 72, 29,242, 61,114, 2, 57,135, 92,
- 70,186,145, 59,200, 0, 50,130,252,134,188, 71, 49,148,129,178, 81, 61,212, 12,181, 67,185,168, 55, 26,132, 70,162, 11,208,100,
-116, 49,154,143, 22,160,155,208,114,180, 26, 61,140, 54,161,231,208,171,104, 15,218,143, 62, 67,199, 48,192,232, 24, 7, 51,196,
-108, 48, 46,198,195, 66,177, 56, 44, 9,147, 99,203,177, 34,172, 12,171,198, 26,176, 86,172, 3,187,137,245, 99,207,177,119, 4,
- 18,129, 69,192, 9, 54, 4,119, 66, 32, 97, 30, 65, 72, 88, 76, 88, 78,216, 72,168, 32, 28, 36, 52, 17,218, 9, 55, 9, 3,132,
- 81,194, 39, 34,147,168, 75,180, 38,186, 17,249,196, 24, 98, 50, 49,135, 88, 72, 44, 35,214, 18,143, 19, 47, 16,123,136, 67,196,
- 55, 36, 18,137, 67, 50, 39,185,144, 2, 73,177,164, 84,210, 18,210, 70,210,110, 82, 35,233, 44,169,155, 52, 72, 26, 35,147,201,
-218,100,107,178, 7, 57,148, 44, 32, 43,200,133,228,157,228,195,228, 51,228, 27,228, 33,242, 91, 10,157, 98, 64,113,164,248, 83,
-226, 40, 82,202,106, 74, 25,229, 16,229, 52,229, 6,101,152, 50, 65, 85,163,154, 82,221,168,161, 84, 17, 53,143, 90, 66,173,161,
-182, 82,175, 81,135,168, 19, 52,117,154, 57,205,131, 22, 73, 75,165,173,162,149,211, 26,104, 23,104,247,105,175,232,116,186, 17,
-221,149, 30, 78,151,208, 87,210,203,233, 71,232,151,232, 3,244,119, 12, 13,134, 21,131,199,136,103, 40, 25,155, 24, 7, 24,103,
- 25,119, 24,175,152, 76,166, 25,211,139, 25,199, 84, 48, 55, 49,235,152,231,153, 15,153,111, 85, 88, 42,182, 42,124, 21,145,202,
- 10,149, 74,149, 38,149, 27, 42, 47, 84,169,170,166,170,222,170, 11, 85,243, 85,203, 84,143,169, 94, 83,125,174, 70, 85, 51, 83,
-227,169, 9,212,150,171, 85,170,157, 80,235, 83, 27, 83,103,169, 59,168,135,170,103,168,111, 84, 63,164,126, 89,253,137, 6, 89,
-195, 76,195, 79, 67,164, 81,160,177, 95,227,188,198, 32, 11, 99, 25,179,120, 44, 33,107, 13,171,134,117,129, 53,196, 38,177,205,
-217,124,118, 42,187,152,253, 29,187,139, 61,170,169,161, 57, 67, 51, 74, 51, 87,179, 82,243,148,102, 63, 7,227,152,113,248,156,
-116, 78, 9,231, 40,167,151,243,126,138,222, 20,239, 41,226, 41, 27,166, 52, 76,185, 49,101, 92,107,170,150,151,150, 88,171, 72,
-171, 81,171, 71,235,189, 54,174,237,167,157,166,189, 69,187, 89,251,129, 14, 65,199, 74, 39, 92, 39, 71,103,143,206, 5,157,231,
- 83,217, 83,221,167, 10,167, 22, 77, 61, 58,245,174, 46,170,107,165, 27,161,187, 68,119,191,110,167,238,152,158,190, 94,128,158,
- 76,111,167,222,121,189,231,250, 28,125, 47,253, 84,253,109,250,167,245, 71, 12, 88, 6,179, 12, 36, 6,219, 12,206, 24, 60,197,
- 53,113,111, 60, 29, 47,199,219,241, 81, 67, 93,195, 64, 67,165, 97,149, 97,151,225,132,145,185,209, 60,163,213, 70,141, 70, 15,
-140,105,198, 92,227, 36,227,109,198,109,198,163, 38, 6, 38, 33, 38, 75, 77,234, 77,238,154, 82, 77,185,166, 41,166, 59, 76, 59,
- 76,199,205,204,205,162,205,214,153, 53,155, 61, 49,215, 50,231,155,231,155,215,155,223,183, 96, 90,120, 90, 44,182,168,182,184,
-101, 73,178,228, 90,166, 89,238,182,188,110,133, 90, 57, 89,165, 88, 85, 90, 93,179, 70,173,157,173, 37,214,187,173,187,167, 17,
-167,185, 78,147, 78,171,158,214,103,195,176,241,182,201,182,169,183, 25,176,229,216, 6,219,174,182,109,182,125, 97,103, 98, 23,
-103,183,197,174,195,238,147,189,147,125,186,125,141,253, 61, 7, 13,135,217, 14,171, 29, 90, 29,126,115,180,114, 20, 58, 86, 58,
-222,154,206,156,238, 63,125,197,244,150,233, 47,103, 88,207, 16,207,216, 51,227,182, 19,203, 41,196,105,157, 83,155,211, 71,103,
- 23,103,185,115,131,243,136,139,137, 75,130,203, 46,151, 62, 46,155, 27,198,221,200,189,228, 74,116,245,113, 93,225,122,210,245,
-157,155,179,155,194,237,168,219,175,238, 54,238,105,238,135,220,159,204, 52,159, 41,158, 89, 51,115,208,195,200, 67,224, 81,229,
-209, 63, 11,159,149, 48,107,223,172,126, 79, 67, 79,129,103,181,231, 35, 47, 99, 47,145, 87,173,215,176,183,165,119,170,247, 97,
-239, 23, 62,246, 62,114,159,227, 62,227, 60, 55,222, 50,222, 89, 95,204, 55,192,183,200,183,203, 79,195,111,158, 95,133,223, 67,
-127, 35,255,100,255,122,255,209, 0,167,128, 37, 1,103, 3,137,129, 65,129, 91, 2,251,248,122,124, 33,191,142, 63, 58,219,101,
-246,178,217,237, 65,140,160,185, 65, 21, 65,143,130,173,130,229,193,173, 33,104,200,236,144,173, 33,247,231,152,206,145,206,105,
- 14,133, 80,126,232,214,208, 7, 97,230, 97,139,195,126, 12, 39,133,135,133, 87,134, 63,142,112,136, 88, 26,209, 49,151, 53,119,
-209,220, 67,115,223, 68,250, 68,150, 68,222,155,103, 49, 79, 57,175, 45, 74, 53, 42, 62,170, 46,106, 60,218, 55,186, 52,186, 63,
-198, 46,102, 89,204,213, 88,157, 88, 73,108, 75, 28, 57, 46, 42,174, 54,110,108,190,223,252,237,243,135,226,157,226, 11,227,123,
- 23,152, 47,200, 93,112,121,161,206,194,244,133,167, 22,169, 46, 18, 44, 58,150, 64, 76,136, 78, 56,148,240, 65, 16, 42,168, 22,
-140, 37,242, 19,119, 37,142, 10,121,194, 29,194,103, 34, 47,209, 54,209,136,216, 67, 92, 42, 30, 78,242, 72, 42, 77,122,146,236,
-145,188, 53,121, 36,197, 51,165, 44,229,185,132, 39,169,144,188, 76, 13, 76,221,155, 58,158, 22,154,118, 32,109, 50, 61, 58,189,
- 49,131,146,145,144,113, 66,170, 33, 77,147,182,103,234,103,230,102,118,203,172,101,133,178,254,197,110,139,183, 47, 30,149, 7,
-201,107,179,144,172, 5, 89, 45, 10,182, 66,166,232, 84, 90, 40,215, 42, 7,178,103,101, 87,102,191,205,137,202, 57,150,171,158,
- 43,205,237,204,179,202,219,144, 55,156,239,159,255,237, 18,194, 18,225,146,182,165,134, 75, 87, 45, 29, 88,230,189,172,106, 57,
-178, 60,113,121,219, 10,227, 21, 5, 43,134, 86, 6,172, 60,184,138,182, 42,109,213, 79,171,237, 87,151,174,126,189, 38,122, 77,
-107,129, 94,193,202,130,193,181, 1,107,235, 11, 85, 10,229,133,125,235,220,215,237, 93, 79, 88, 47, 89,223,181, 97,250,134,157,
- 27, 62, 21,137,138,174, 20,219, 23,151, 21,127,216, 40,220,120,229, 27,135,111,202,191,153,220,148,180,169,171,196,185,100,207,
-102,210,102,233,230,222, 45,158, 91, 14,150,170,151,230,151, 14,110, 13,217,218,180, 13,223, 86,180,237,245,246, 69,219, 47,151,
-205, 40,219,187,131,182, 67,185,163,191, 60,184,188,101,167,201,206,205, 59, 63, 84,164, 84,244, 84,250, 84, 54,238,210,221,181,
- 97,215,248,110,209,238, 27,123,188,246, 52,236,213,219, 91,188,247,253, 62,201,190,219, 85, 1, 85, 77,213,102,213,101,251, 73,
-251,179,247, 63,174,137,170,233,248,150,251,109, 93,173, 78,109,113,237,199, 3,210, 3,253, 7, 35, 14,182,215,185,212,213, 29,
-210, 61, 84, 82,143,214, 43,235, 71, 14,199, 31,190,254,157,239,119, 45, 13, 54, 13, 85,141,156,198,226, 35,112, 68,121,228,233,
-247, 9,223,247, 30, 13, 58,218,118,140,123,172,225, 7,211, 31,118, 29,103, 29, 47,106, 66,154,242,154, 70,155, 83,154,251, 91,
- 98, 91,186, 79,204, 62,209,214,234,222,122,252, 71,219, 31, 15,156, 52, 60, 89,121, 74,243, 84,201,105,218,233,130,211,147,103,
-242,207,140,157,149,157,125,126, 46,249,220, 96,219,162,182,123,231, 99,206,223,106, 15,111,239,186, 16,116,225,210, 69,255,139,
-231, 59,188, 59,206, 92,242,184,116,242,178,219,229, 19, 87,184, 87,154,175, 58, 95,109,234,116,234, 60,254,147,211, 79,199,187,
-156,187,154,174,185, 92,107,185,238,122,189,181,123,102,247,233, 27,158, 55,206,221,244,189,121,241, 22,255,214,213,158, 57, 61,
-221,189,243,122,111,247,197,247,245,223, 22,221,126,114, 39,253,206,203,187,217,119, 39,238,173,188, 79,188, 95,244, 64,237, 65,
-217, 67,221,135,213, 63, 91,254,220,216,239,220,127,106,192,119,160,243,209,220, 71,247, 6,133,131,207,254,145,245,143, 15, 67,
- 5,143,153,143,203,134, 13,134,235,158, 56, 62, 57, 57,226, 63,114,253,233,252,167, 67,207,100,207, 38,158, 23,254,162,254,203,
-174, 23, 22, 47,126,248,213,235,215,206,209,152,209,161,151,242,151,147,191,109,124,165,253,234,192,235, 25,175,219,198,194,198,
- 30,190,201,120, 51, 49, 94,244, 86,251,237,193,119,220,119, 29,239,163,223, 15, 79,228,124, 32,127, 40,255,104,249,177,245, 83,
-208,167,251,147, 25,147,147,255, 4, 3,152,243,252, 99, 51, 45,219, 0, 0, 0, 6, 98, 75, 71, 68, 0,255, 0,255, 0,255,160,
-189,167,147, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 13,213, 0, 0, 13,213, 1, 61,214, 88,241, 0, 0, 0, 7,116, 73, 77, 69,
- 7,220, 2, 12, 19, 45, 40,146,193,117, 16, 0, 0, 32, 0, 73, 68, 65, 84,120,218,236, 93,119,120, 20,213,226, 61, 51, 59,179,
-187,217,146, 77, 35, 61,144, 66, 9, 96, 0, 67, 81,130, 84, 65, 80,140,138, 10, 86,132,167,207,103,197,134, 5, 84, 68, 68, 32,
- 54, 64,240, 39,242,208,167,128,160,128, 5, 4,164, 68, 74,232, 29,233, 9,144, 4, 18, 66, 58,201, 38,219,203,220,223, 31,217,
- 89, 55,203,182, 64, 98,129,123,190,111,190,221,157,157, 57,115,239,157,123,239,156, 57,183, 1, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,215, 52, 86,175, 94, 77,154,112,248,144, 64, 57, 29,219,128,191, 59,103, 11,198,157, 52,
- 35,231, 0, 7,231,187,255,144,112, 14,248,187,114,138,241,109, 2,239,144,166,228,163,230, 74, 79,151,112,146,230, 14,103, 75,
-113, 54, 87, 57,242, 16, 78,210, 2,247,253,221,127, 72, 56, 7,252,221, 56,221,243, 79,128,188, 77,226, 12, 48, 79, 53, 53,156,
-164,185,195,217, 82,156, 87, 91,142,124,132,147, 92,109, 94,242,114,239,223,197,117, 4,174, 5, 69, 86,192,200,204,204,100, 92,
-248,153,191, 43,167,107, 58,136,252,205, 25,214,102,196,150,230,230,116, 75,207,230,194,187,153,153,153,204,234,213,171,183, 2,
- 24,208,156,113,111,142,251,238, 22,215,102,225,189, 2,145,213, 36,206,230,202,247, 45,205,217, 92,101,201,157,179, 57,242,189,
-167,251,222,130,247,168,185,194,217, 44,101,169, 37,242,188,135,252,115,213,188,238,156,205, 81,150,220, 57,155, 35,223,255, 25,
-156,205, 81,150, 60,113, 54, 71,190,247,118,239,175, 55,131,138,253,139, 5,129,123, 1, 31,248,119, 22, 68, 45, 37, 54,155,224,
-192,252,229,156,205,124,143,222,117,112, 54,231,219,205,192,230,186, 71, 45,145,223, 93, 57,155,139,223,157,167, 57,238,147, 39,
-206,171, 13,175,151,112, 54,123,220,175, 54,223,255, 89,156,205,124,143,154,165, 44,185,113, 14,108,230,151,129,129, 46,191,223,
-109, 78,206,230, 42, 75, 30,194,121,213,247,201, 19,231,213,134,215, 75, 56,155, 61,238,205,241, 12,105, 41,222,107, 26, 45,213,
-124,214,220,156, 77,228,190,166, 56,155,216, 60, 51,164, 5,238,253, 95, 26,206,230,228,116, 15, 99,115, 54,247,180,100, 56,155,
-147,179, 9, 97,189,230, 56,255,105,247,253,239,152,158,222,248,174,166, 89,202,155, 59,218, 18,225,108, 78,206, 0,185,175, 9,
-206,171,184,247,215, 28,184,191, 75, 64,196,132,111,230, 55, 19, 52,179, 3,211,146,194,181, 57,195, 57,176, 37, 28,194, 22, 64,
-179,135,211,241,166, 60,185, 5,226,254, 79, 73, 83, 90,150,104, 89,250,219,149, 37,183, 60, 57,176, 25,157,162,102,117,158,221,
- 57,155,227, 26,174, 28,205,149, 71, 91, 58,238,205, 89,150, 90,226,222, 83, 92,133, 11, 65, 57, 41, 39,229,164,156,148,147,114,
- 82,206,235,150,243,154, 4, 75,147,128,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,226, 31, 5,175,237,187,
-113,113,113,171,149, 74,101, 59,111,255,235,116,186,139, 23, 47, 94, 28, 68,147,240,175, 3,189, 71, 20,255, 32,176,248,195, 65,
- 23, 0, 16,199, 70, 65, 65, 65,113, 77,195,107,103,120,185, 92,158,114,242,228,201, 14,130, 32,192,110,183,195,102,179, 57, 63,
-205,102, 51,250,247,239,223,228,142,244,209,209,209, 57, 18,137, 36,169, 41,231,216,237,246,243,101,101,101,125,125, 28,178, 19,
- 64, 10,195,252,161, 25,197,239,222, 62, 1,148, 88,173,214,238,190, 56, 25,134, 73,113,231,243,194, 37,126,247,201, 25, 18, 18,
-178,159,227,184, 4, 79, 92,222,190, 11,130,144, 95, 81, 81,209,231,207,188, 71,215, 51,162,163,163,115, 56,142,107,114,254, 44,
- 45, 45,245,154, 63, 99, 99, 99, 15,177, 44, 27,215, 4, 74,137, 32, 8,185, 23, 47, 94,236,235, 67,136,236, 4,144,226,243, 13,
-202, 45, 63, 49, 12, 83,108,183,219,123,250, 43, 71,190,184, 60,228, 81,127,156, 78,145,197,113, 92, 86, 84, 84,212, 51,122,189,
-222, 8,128, 72, 36, 18,226, 18, 54, 0,128,205,102,171,168,169,169,233, 66,115, 34, 5, 5,197,117, 33,180, 4, 65, 96, 77, 38,
- 19,242,242,242, 64,136,199,250,222,126, 5,215,235,112,224,183,141, 81,193, 81,209,176, 89, 44, 80,181,138,116,114,151,157, 56,
- 6,155,213, 2,155,217,140, 54,189,122,139, 97, 64,231,206,157, 37,126, 56, 19, 62,248,224,131,168,224,224, 96, 24,141, 70, 24,
-141, 70,152, 76, 38, 24,141, 70,152,205,102,152,205,102, 88, 44, 22, 88, 44, 22,216,108, 54,152, 76, 38,100,103,103,219,173, 86,
-171, 79,206,105,211,166, 69,105, 52, 26, 39,159,184,137,156, 34,175,213,106,133,209,104,196,166, 77,155,124,114,114, 28,151, 80,
- 82, 82, 18, 37,149, 74, 65, 8,129, 32, 8, 32,132, 52,218,220,209,182,109, 91,139,175, 64,182,208, 61,186,158,209, 97,218,210,
- 53, 81, 33, 10, 57,108,130,128,204,110,109,157,127,228,127,185, 28,196,102,135, 96,179,161,253,243,163,157,251, 59,117,234,228,
- 51,127, 18, 66, 18,167, 45, 93, 19, 26, 40,103, 85, 85,149,161, 99,199,142, 37,104,112,155,189, 9,173, 4,131,193, 16,229,224,
-191, 76, 16,177, 44,219,104, 91,191,126, 61, 50, 51, 51,253,197, 61,225,229,151, 95,142,178, 90,173, 48,155,205, 48,153, 76,176,
- 90,173,176,217,108,206,205,110,183, 59, 55,179,217,140, 61,123,246, 4,234,100,125,112,219,109,183, 61,190,102,205, 26,213,207,
- 63,255,172, 74, 74, 74,130, 84, 42,133, 68, 34,129, 68, 34, 1,203,178,224, 56, 14, 55,223,124, 51, 67,179, 32, 5, 5,197,117,
- 35,180, 76, 38, 83, 65,122,122, 58,113,124,143,151,203,229, 82,183,183,220,184,246,237,219,231,186,159,231,175,185, 42, 56, 42,
- 26, 19, 91,135, 3, 0,222, 57, 87,229,124, 64,124,216,231, 70,231, 49,239, 93,168, 5, 0, 40, 20, 10, 48,174,175,209, 94,160,
- 82,169,112,219,109,183, 65, 38,147,161,103,207,158,224,121,222,227, 38,149, 74,193,243,188,223, 68, 97, 24, 6,106,181, 26, 83,
-166, 76, 17, 69, 18, 84, 65,114,140,235,211, 19, 65, 32,248,239,177,211, 48, 11, 4, 28,199, 57,183, 64, 56,165, 82, 41,142, 30,
- 61, 10,142,227, 32,145, 72,156,159,226,247, 85,171, 86, 97,228,200,145,224, 56, 14, 10,133, 2,240, 51,115,176,235, 61, 50,155,
-205,177, 50,153,204, 2, 64, 20,103, 82,134, 97, 98,174,228, 30, 93,207, 8, 81,200, 49,102,222, 79, 0,128,162, 89,207, 59,239,
-221,158,103,223,113, 30,147,248,159, 7,192, 48, 12,120,158, 7,203,178,205,198, 89, 93, 93,109,120,232,161,135,182, 7, 7, 7,
-175,215,106,181,240, 35,224, 80, 84, 84, 4,142,227,188,230,119,150,101, 49,115,230, 76,156, 57,115, 38,160,184, 27,141, 70, 44,
- 88,176, 0,118,187,189, 17,175,248,221,125, 95,128, 34,235,253,161, 67,135,142, 94,179,102, 77, 24,195, 48,248,236,179,207, 32,
-149, 74, 49,124,248,112, 68, 68, 68, 96,195,134, 13,144, 74,165,120,253,245,215,105,230,163,160,160,240, 85,231,241, 0,110, 4,
- 16,233, 48, 17,234, 0,132,186, 28, 82,225,248,140, 20,127, 51, 12,179,207, 3, 79, 47,199, 49, 21, 12,195,236,115,249,109, 6,
- 32,243,176,191, 10,128,194,177,153,208,224,254,167,185, 92, 71, 60, 15,222,174,203, 1, 13,235, 15, 1,216, 2, 96, 96,102,102,
-230, 86, 0, 40, 45, 45,189,163,180,180, 20, 0,144,146,146,114, 50, 55, 55,183,163,168,121, 28,205, 83, 82,155,205,214, 65,108,
-170, 18,221,162, 33, 67,134,248,124,195,183, 89, 44,151, 9, 16, 79, 90,202, 83,115,133, 55, 1, 99,177, 88,240,192, 3, 15, 0,
-128,215,135,142,235, 22,128,118,131,217,108, 6,199,113, 72,109, 29,137, 73,195,210,113, 19,177, 66, 87,207,192, 86,171,195, 61,
-106, 43, 78,118,238,142,249,231, 43,112, 78, 91, 15,142,227, 2,226, 20, 4,193,171,200,146, 72, 36,152, 55,111, 30, 30,122,232,
- 33, 72, 36,146,128,248, 92,239, 81,114,114,242,154,220,220,220, 8,134, 97, 76,142,123, 36,183,217,108, 26,155,205, 22, 97,183,
-219, 35,154,114,143,174,103,216, 4,193, 99, 62,244,150,103, 3,185, 79,129,112, 86, 87, 87, 27, 50, 51, 51,119,203,229,242,133,
-209,209,209, 37,197,197,197,126,133,150,187,248,113,127,169,248,228,147, 79, 48,103,206, 28, 12, 26, 52, 40,160,112,154, 76, 38,
- 48, 12,131,249,243,231, 95,246,223,212,169, 83, 47,187,158, 31, 78, 6, 0, 27, 23, 23,247,236,186,117,235, 52,226,177,173, 90,
-181, 2,207,243,232,210,165, 11,130,131,131,177,125,251,118,216,237,246,128,203, 37, 5, 5,197,181, 11, 79, 90,196, 5,253, 39,
- 78,156,216, 51, 43, 43,107,122, 70, 70,198,119, 59,119,238, 92,202, 48,204,106,151, 58, 49,211, 81,191,174, 22,127, 19, 66,122,
-185,138, 30,135, 88,139,100, 24,102,181,120,188,235,111,241,147, 16, 50, 4,128, 76,252, 61,113,226,196,180,172,172,172,233, 19,
- 38, 76,120,115,198,140, 25,210,137, 19, 39,118,205,202,202,154, 46, 94,199, 83, 56, 60, 57, 90, 62,215,158, 18,155,168, 78,157,
- 58,229,173,137,202,245, 1,224,179,182, 84,181,138,116, 58, 89,239, 37, 70, 56,247, 79, 41,174,113, 62,192,230,246,104, 7,149,
- 74,133, 97,239,125, 20,144, 83,100, 54,155, 81, 94, 94,238,116, 25,252,109,129,114, 42, 21, 65,200,126,185, 11,138,170,100,120,
-119, 87, 53,214, 28, 62, 3,158,231,113,123,231, 46,184, 67, 26,140,183, 19,101,120,249,116, 33,172, 36,176, 62,189,132, 16,143,
- 2, 75,252, 46, 54,161, 4, 42,180,220,238, 81,145,209,104,172,202,203,203, 51, 8, 13, 15,118, 5, 33, 36,140, 97,152, 58,135,
-203, 21, 27,232, 61,186,158,145,217,173,173,211,117,218, 19, 60,216,185,127,164,238,168,243,158,140,159,247, 33, 0, 96, 80,247,
-155,253,150,135, 64, 56,171,170,170, 12,125, 7, 15,220,106, 55,152,191, 25, 61,122,116,193,230,205,155, 21,129,132,213,147,208,
- 18, 93, 91, 81,100,113, 28, 7,179,217, 28, 80,220,205,102,179,215,242, 33,149, 74,175,196,209,130, 78,167, 51,175, 92,185, 18,
-115,231,206, 69, 68, 68, 4,134, 14, 29,138,216,216, 88, 44, 95,190, 28,132, 16, 60,255,252,243, 80, 40, 20,162,123, 77, 51, 32,
- 5,197,245, 13, 95, 90, 68,158,149,149, 53,221, 93,200,184,254,118, 21, 80,110, 98,202, 85,172,165,249,121,254,175,118, 23, 79,
-226,117, 25,134, 89, 61, 99,198,140, 76, 63,225,168,240, 38,180,124, 78,137,111, 50,153, 10,186,117,235, 22,144,154,208,235,245,
-165,254,196,134,167,183,122, 87,151, 64,173, 86, 67,165, 81,131, 13,176,222,181, 90,173, 78,161,178,113,227, 70, 40, 20, 10, 12,
- 31, 62,252,170, 28, 45,139,197, 2,153,148, 7,219, 42, 26, 99,102,109, 70, 85,157,193,249,128,217,146, 95,128,131,101,229,120,
- 57, 99, 48, 84,138,114,212,155,205, 1, 57,111,130, 32, 92, 38,178, 56,142,195, 3, 15, 60,224,116, 19, 92,251,173,192, 71,211,
- 97, 68, 68,196,126,142,227, 18, 92,238, 81, 80, 74, 74, 10,240, 71,191, 30, 70, 16,132,250,208,208,208, 31, 1,196, 17, 66, 18,
- 0, 4, 7,114,143, 40, 60,231, 79,247,253,130,155, 83,117, 37,156, 85, 85, 85,134,204,204,204,221,118,131,249,155, 11, 23, 46,
-236, 6, 16,116,211, 77, 55, 53, 89,104,137, 2,139,231,121,204,156, 57, 19,115,230,204,113,254, 31,168,208,178,217,108,141, 4,
-212,233,211,167, 27, 93,203, 93,216,249,105, 54, 37,104, 24, 93, 40,164,164,164, 56,207,137,137,137, 65,104,104, 40, 4, 65,128,
- 32, 8, 8, 10, 10,130, 66,161,128, 84, 42,165,153,142,130,130,194,151, 22, 49, 76,152, 48,225, 77,134, 97, 86, 59,156,165, 99,
- 62, 4,149, 39,237,209,203, 77,172, 85,120, 57, 46,211,147,216,114,253, 46, 98,226,196,137,105,238,225,240,212, 92,233,172, 85,
-221,166,221,111, 4,215, 38,170,230,122,136,249,122,144,169, 67, 53, 80,168, 84,144, 72, 88, 48, 12, 67,252,113, 89, 44, 22,103,
-197,255,204, 51,207,248,236,183, 18,104,127, 42,139,197, 2,150,147,224, 98, 76, 50,236,236, 54,231,185,226,198,114, 60,206,197,
-116,132,228,212, 33,240, 1, 62,112,221, 29,173,231,159,127, 30, 11, 22, 44, 0,203,178,206, 52,225, 56, 14,237,219,183, 71, 65,
- 65,129, 79, 46,142,227, 18,206,157, 59, 23,229,154,142,162,136, 37,132,192,110,183,163,109,219,182,198,188,188,188, 23,105,209,
-189, 58,145,229,109,191,221, 46, 4,236,194,120, 58,174,170,170,202, 48,106,212,168,173,181,181,181,223,220,112,195, 13,167,209,
-120, 10, 4,191,124, 28,199, 53, 18, 88,162,200,250,244,211, 79, 27,137, 34,171,213, 26,208,139,128,213,106,189, 76,240,124,252,
-241,199,141, 62, 1,160, 79,159, 62, 1, 57,195, 0, 8,203,178, 68, 42,149,226,182,219,110, 67,215,174, 93,241,243,207, 63, 67,
- 16, 4, 60,247,220,115, 80, 40, 20,152, 61,123, 54,108, 54, 27, 62,248,224, 3,234,104, 81, 80, 80,248,210, 34,166, 25, 51,102,
- 28,155, 49, 99,134,211, 89,114,119,180,188, 60,119,239,116,136,170, 72, 81,164, 1, 48,121, 18, 68,158, 92, 50,119, 1,230,186,
- 47, 43, 43,107,186,123, 56,220,155, 43, 27, 9,173, 63, 11,165,199,143,226,163, 91,210, 1, 52,110, 46,156,119,115, 71,168,212,
- 42,168,130,213, 24,181,106, 27, 0, 56, 42,253, 9, 1, 57, 90,162,208,170,170,170,242, 41,178,154,226,104,177, 50, 14, 43, 18,
- 46,129,200,120,112,102,107, 35,161, 37,225,120, 20, 69, 36,131,229,165,224,236,182,128, 56, 9, 33,151, 53, 21,142, 29, 59, 22,
- 12,195, 56, 71,136,117,235,214,205,149,139,241,247,112,124, 45,188,161, 15,158,123,115,236, 7,149, 70, 90, 98,175, 36,127,238,
-255, 18, 39,127,120, 22, 0,208, 87,167,115,222,139,105,221,254, 24, 59, 48,235,232, 86,167,251,248, 30, 94,189, 34,206,170,170,
- 42,195, 77,157,210,118, 75,195, 67,190, 57,127,254,252,110, 0,236,131, 15, 62, 24,218,173, 91,183,128,202,164, 56,184,194, 93,
-100,185, 58, 89,226,167,159, 17,182, 46,194,209, 30,144,128, 18,155, 17, 3,200,243, 68,204,219, 26,141, 6,106,181,218, 57,226,
- 54, 40, 40, 8, 74,165,210,217,191, 51, 64,225, 70, 65, 65,113,253, 34, 76, 20, 58, 14,177,212,200,105,114,244,173,202,116,253,
-237,201,241,114, 56, 80, 57,126,234,215, 53, 14,129,230, 17,162,179,230,118,206,106,111, 34,141, 19, 21,164,235,103, 76, 76,204,
-175,106,181, 58, 57,208,216, 55,101, 20,155,221,106,185,204,217, 98, 24, 6,234, 96, 53, 20,106, 21, 20,193,106,175,174,151, 47,
-161, 37, 58, 69,226, 67,103,225,194,133, 80,171,213,248,215,191,254,213,228, 62, 90, 78,161, 37,101,177, 65,190, 9, 18, 25,215,
- 72,100,113, 28, 7, 9,207,163, 84, 29, 11,150,231,193,217, 2,115,201,106,107,107,193,113, 28, 38, 77,154,228,124,131,119, 21,
- 89, 77,137,179, 47,176, 12, 35,186, 91,242,118,237,218,189,202, 48, 76, 34,128, 36,157, 78, 39,191,120,241,226,173,180,188,250,
- 80, 6,118,235,101, 46,148, 55,247,245, 74, 57, 69, 39, 75, 26, 30,242, 77,199,142, 29,157, 78,150, 82,169, 20, 71,155,250,191,
-199, 44,235, 81,100,185,143, 16,228, 56,174, 33, 47,251, 25, 29,233,234,104,205,152, 49,195,201,235,234,100,137,104, 74, 57, 18,
-195,186,117,235, 86, 28, 60,120, 16,207, 60,243, 12, 20, 10, 5,230,204,153, 3,155,205,134,169, 83,167, 66,161, 80, 64, 38,147,
-209,204, 71, 65, 65,221,172, 70, 90,196, 13, 21,110,253,160, 24, 55, 81, 83,225, 73, 96,185, 54, 19,138,223, 25,134,177,122,224,
- 53,187, 53, 41,186,239, 23, 63,171,102,204,152,177, 89,116,178, 92,246, 55, 10,135, 95, 71, 75, 46,151, 39,231,229,229, 57, 39,
-194,244,245,105, 54,155, 49,104,208,160,128,157, 49,113,212, 33,199, 73, 26, 9, 11,101,176, 26, 74, 77, 48, 20,106,181,187,224,
- 96,252, 85,226,226, 27,177,171,208,154, 60,121, 50, 56,142,195,130, 5, 11, 0, 0,175,190,250,106,192,125,180, 68, 78,216, 25,
- 20,147,179, 72,159, 53, 18,230,111,173, 40,219,241, 59, 56,142, 67, 84,239, 59, 32,220, 52, 18,122,133, 26,156,221, 22,240,168,
-195,234,234,106, 20, 20, 20, 64, 34,145,224,149, 87, 94,105, 52,215,145,251, 72,182,141, 27, 55,250,141,187, 39, 39,107,242,249,
-106, 39,143, 66,161, 96,127,255,253,247,100, 65, 16, 82, 12, 6, 67,187, 62,125,250, 8,180, 40,251, 17, 69,130, 45, 32, 81, 21,
-104,254,116,231, 20,251,100,213,214,214,126,115,254,252,249, 61, 0,216,209,163, 71,135, 42,149, 74,124,245,213, 87,122, 0,178,
-229,203,151, 43,252,137, 34, 49,223,248, 19, 89, 60,207, 55,228,229, 64,226, 78, 26, 79, 89,226,175, 99,124, 32,121, 94, 12, 43,
-195, 48,176,219,237, 80, 40, 20,141,156,172,160,160, 32,200,229,114,154,241, 40, 40, 40,252,213, 37,251, 2,174,199, 9,233,229,
- 34,170,246, 93, 9,111, 83,174,231, 15,156, 55,161, 97, 50,153,112,226,196,137, 64,121, 2,158, 24,179,117,207,155,241,222,133,
- 90, 48, 12,131,255,246,185, 1, 42,141, 26, 74,149, 10,247,255,188,213, 89,113, 31,157,254, 42,228, 42, 53,226,250, 13, 13,168,
- 34, 23,155, 14, 93,133, 86, 77, 77, 13,120,158,199,251,239,191, 15,150,101,241,193, 7, 31, 32, 62, 62, 30, 23, 47, 94,196,242,
-229,203, 3,114,180, 36,118, 9, 98, 31,235, 4,229,216, 16,104, 30,235,143,176,219, 38,227,130,153,195, 78,163, 18,253,141,199,
- 33,219,240, 41,204,130, 61,224, 17, 88, 54,155, 13, 91,183,110,117,239,240,238,236, 83,101,179,217, 96,181, 90, 97,177, 88,240,
-193, 7, 31, 4, 50,194,243,178,251, 38,166,161, 99, 18, 84, 73,110,110,110, 36, 33, 36, 28, 64, 8,128, 74, 90, 92,125, 35,182,
-247,243,136,236,249, 52, 0, 96,213,140, 39,156,251, 39, 29,253, 35,127,206,252,182, 97, 1,128,142, 73, 67,155,196, 89, 85, 85,
-101,184,125, 80,159, 28,163,192,127,221,165, 75,151, 70, 78, 86, 80, 80, 16,227,248, 29,144, 93,198,178, 44, 36, 18,201,101,205,
-133,222,196, 86, 32,125,180,108, 54,155,115, 34, 81, 95,253, 25,175,196,209,122,226,137, 39, 16, 27, 27,235,116,178,222,123,239,
- 61, 40, 20, 10, 76,156, 56, 17, 86,171, 21,159,126,250, 41,205,124, 20, 20, 20,127,186, 40,251, 51,224,177, 38, 53, 26,141,133,
- 93,187,118,133,151,255,226,131,130,130,120,183, 72,197,181,111,223, 62,215, 67, 19,226, 16, 0,217,158, 42,117,134, 97, 16,172,
- 9, 70,144, 90, 5,165,155,139, 21, 20,172,129, 92,173, 6, 43,245, 88,153, 95,198, 41,246, 45,113, 21, 90,226, 86, 91, 91, 11,
-158,231, 49,119,238, 92,104, 52, 26,152, 76, 38,191,156,226, 67, 71, 34,145, 64, 95, 84,135,147,211,179, 33, 11,218,137,118, 67,
- 31, 66, 44,175,128,116,251,143, 48,216,173,254, 38, 44,189,140,179, 67,135, 14,120,231,157,119, 46,155,214,193, 27,226,227,227,
-253,198,221,221,201,154,121, 67, 27, 72,101, 82,140, 63, 94, 4,147,201,196, 60,244,208, 67, 2, 0, 3,128, 10,131,193,112, 62,
-144,244,108, 6,252,227, 57,125,141,138, 21, 33, 16,187, 39, 1,227,145, 83,116,178,140, 2,255,117, 65, 65,129,232,100,133, 40,
-149, 74,124,241,197, 23,122, 0,236,212,169, 83,149,137,137,137,146, 64,242,146, 68, 34,193,172, 89,179, 60,246,201,242, 36,186,
-154, 82,142, 92,207, 29, 48, 96,128,199, 9, 75,189,136,183,203, 56,197,176, 70, 68, 68, 56,157, 44,187,221,238, 28,109, 40,206,
- 62,239,227,165,130,230, 79,202, 73, 57,175, 31,206,107, 18, 30,107,224,139, 23, 47,222,238,237,132,182,109,219,230,229,229,229,
-181, 23,151,226,112, 84,156, 82,163,209,216,161, 79,159, 62,126,173, 29, 65, 16, 32,151,203, 65, 8,193,173,239,100,129, 97, 1,
- 22,141, 31, 98, 81,183, 12,134, 68,194, 65,104, 88,234,195,239,168, 67,131,193,208,232,225,224,105,171,175,175,135,201,100, 10,
-120, 54,111,163,209,216,104, 10, 6,134, 8, 56,247,219,178,203, 70, 31,138, 91,160,253,118,130,130,130, 26, 53,253,248,113,172,
-152, 64, 28, 45,215,166, 71,169, 76, 10, 78,202,139,142, 86,221,233,211,167, 71,209,108, 30, 56,196, 1, 11, 0,144,218,103, 56,
- 4,193, 14, 98,183, 55, 90, 38,169, 83,242,237, 16,136, 29, 22,171, 30, 38,147,201,223,180, 39, 76,101,101,165, 97,212,168, 81,
- 91, 1,252,239,158,123,238,201, 69,195,236,194, 68,173, 86,203,121,158, 23, 0, 84, 3, 32,151, 46, 93, 10,185,112,225,130, 96,
- 52, 26,219,248, 11,231,154, 53,107,112,226,196, 9,244,235,215,175,209,114, 80,162, 43,234, 58,187,123, 32,249, 83,108, 46,247,
- 52, 35,188, 55, 33, 23, 40, 36, 18, 9, 66, 66, 66, 32,149, 74,241,254,251,239, 67, 42,149, 66,169, 84, 2, 0, 62,253,244, 83,
-231,228,171, 20, 20, 20, 20,215,141,208,242, 87,111,250,104, 86,244,217,132,104,179,217,138, 19, 19, 19,155,116, 49,187,221, 94,
-230, 71,184, 21, 47, 95,190, 92,234,234, 66,248,251, 36,132,148,249,121,216, 22,175, 90,181, 74,234,201,221,240,182,192,180, 63,
- 78,187,221, 94,156,148,148,228,213, 49,241, 4,171,213,122,193,159,104,205,170, 48, 52, 18, 9,227,143, 23,121, 93, 59,145,194,
-111, 94,243,145, 63,223,186,210,252,121, 58, 53, 53,245, 66,104,104,232,218,232,232,232,170, 29, 59,118, 68,244,234,213, 43,194,
-245,152, 94,189,122,197,186,157,102,134,247,117, 14,193, 48, 76,241, 61,247,220,227, 49,207,139,162,201, 67,254, 44,246,151,231,
-247,238,221, 43,117, 61,223, 27,191, 75, 57, 42, 14, 64,184,158, 75, 79, 79,103, 93,121,188,229,125,171,213, 90, 65,115, 33, 5,
- 5,197,117, 47,180, 12, 6, 67, 81,215,174, 93,109, 94,254, 59,239,235,220,170,170,170,158,205, 29, 1,171,213,218,231,159,192,
- 89, 89, 89,217,172,113,183,217,108,197,142, 9, 74,125, 30, 67,179,248, 95,119,143, 0,160,188,188,252, 38, 0,208,233,116,240,
-183,172, 78, 19, 4, 97,179,231, 79,155,205,214,167, 37,210,180,186,186, 58,131,230, 44, 10, 10, 10, 42,180,154, 0,186, 24,241,
-223, 3, 45, 33, 90, 41, 40, 40, 40, 40, 40, 40,154, 23, 44, 77, 2, 10, 10, 10, 10, 10, 10, 10,138,150, 1,131,134,145, 3,158,
-208,148,209, 4, 67,174,224,218,217,148,147,114, 82, 78,202, 73, 57, 41, 39,229,188,238, 56,253,113,211,209,140, 45, 44,192, 40,
- 39,229,164,156,148,147,114, 82, 78,202,121,253,113, 94,147,160, 77,135, 20, 20, 20, 20, 20, 20, 20, 20, 45, 4,142, 38,193, 95,
- 6, 9,154, 48,163,190, 63, 16, 66,194, 0,120, 91, 48,206,204, 48,204,165, 43,224,100, 0, 72, 29,155, 56,209,145, 21,128, 5,
-128,133, 97, 24,226,159,227, 93,182,164, 36, 44,141,216,249, 94,132, 97,120, 65,192,225, 54,109, 90, 31, 98,152, 59,204, 0,160,
-138,238,212, 89,173, 82, 12, 49, 89,204,201,114, 94,118,162, 70, 87,191,209, 84,158, 87, 72,179, 7, 5,197, 95,130,187, 0, 76,
- 65, 67,183,146, 25, 0,150,209, 36,161,160,104, 33,161,165, 86,171,247,179, 44,155,224,111,126, 30, 17,142,181,204,138, 47, 93,
-186,212,179, 9,215, 30,165, 86,171, 7,241, 60,127, 11, 0, 88,173,214, 29,245,245,245,155, 1, 44, 7, 96,187,194, 56,105, 0,
- 60, 0,224, 17,199,239, 37,142,202, 66,123,133,124, 93, 67, 66, 66,126,224,121,158, 84, 86, 86,246, 6,128,136,136,136,221, 86,
-171,149,209,106,181,247, 3, 56,210, 68, 62,150,231,249,153,189,123,247,238,191,109,219,182,255, 1,152,219, 76,247, 82,206,178,
-172, 71,129, 34, 8, 66,210, 21,136, 44, 41,128,144,185,115,231, 70, 44, 94,188, 56,189,184,184,184, 11, 0, 36, 36, 36, 28, 29,
- 61,122,244,161,113,227,198, 85, 17, 66,106, 25,134,177,248,226, 41, 41, 9, 75, 43, 47,205,127,166,172,252,196, 3, 0, 16, 19,
-219,101,153, 68,194, 74, 9, 57,176, 75,217,234,145, 86,237,219, 37, 61,253,221, 87,115,165, 73,201,173,177,105,231,193, 27,199,
-189,248,102,218, 5,224, 19, 42,182,254, 60, 4, 7, 7,239,103, 89, 54,193, 87, 25,247, 84,230,237,118,123,113,117,117,117, 79,
-111,156, 28,199, 37,248,170, 47, 60,237, 19, 4, 33,191,178,178,210,227, 84, 19, 26,141,102, 23,199,113,201,129,114,137,159, 54,
-155,173,216,219, 40, 93,141, 70,179, 95, 34,145, 36,248,138,167,167,255, 4, 65,200,175,168,168,240, 22,206,203,226,222, 28,225,
-188, 18, 78, 95,225, 20,235, 35, 0,159, 70, 68, 68,220, 92, 85, 85,245, 40,128, 55,181, 90,109, 55,137, 68,130,240,240,240, 55,
-205,102,243,153,144,144,144, 47,107,107,107,119, 2,120, 17, 0, 93, 47,149,130,162,185,160,209,104,202,234,235,235,137, 8, 65,
- 16,136,213,106, 37, 38,147,137, 24, 12, 6,162,211,233, 72,125,125, 61,209,106,181,164,182,182,150, 84, 85, 85,145,200,200, 72,
-247,201, 27,189,181,225,118,209,104, 52,121, 89, 89, 89,166,130,130, 2, 98,177, 88,136,197, 98, 33,133,133,133,228,163,143, 62,
- 50,105, 52,154, 60, 0, 93,188,156, 59,196, 75,101,113, 27,128,165,233,233,233,230, 53,107,214, 16,163,209, 72,116, 58, 29, 89,
-182,108, 25,185,225,134, 27,204, 0,150, 58,142, 97, 3,228, 4,128,190, 49, 49, 49,197,103,207,158,181,111,220,184,209, 18, 18,
- 18,146, 29, 18, 18,146, 93, 88, 88,104, 63,123,246,172,208,170, 85,171, 98, 0,125,155, 16, 78, 0, 24, 57,126,252,248,178,194,
-194, 66, 50, 96,192,128,195, 46,251, 25,248, 95,231,110,136, 39, 39,139, 16, 18, 67, 8,137, 69,195, 36,151,151,109,132,144, 88,
-199, 49, 97, 1,114,170,242,243,243, 91, 71, 71, 71,103, 49, 12, 99,118,231, 99, 24,198, 28, 29, 29,157,149,159,159,223,154, 16,
-162,242,197, 89,124,126,222,147,107,215, 12,174,209, 93, 58, 69,116,151, 78,145,255,125, 61, 80,251,212,184, 71,151,198,182,237,
-190, 32, 52, 33,109,238,137, 83,167,231, 19, 66,230,111,222,151, 55,127,242,231,191,206,191,119,220,236, 47, 34, 18,211,159,106,
- 66,122, 94, 13, 40, 39,128,208,208,208, 82,157, 78, 71, 8, 33,196,110,183, 19,139,197, 66, 76, 38, 19,209,235,245,164,190,190,
-158,212,213,213, 57,203,121,109,109,173,243,123, 84, 84,148,215,242, 30, 22, 22, 86,102, 48, 24, 26,213, 29,102,179,217, 89,127,
-232,245,122,162,215,235,137, 78,167,115,110,245,245,245, 36, 46, 46,174,200, 71, 56, 47,138,225, 20, 4,129,216,108, 54, 98,177,
- 88,156,188, 70,163,177,209,102, 50,153,136,201,100, 34,137,137,137, 1,135, 51, 16, 78,163,209, 72, 18, 18, 18, 74,188,113,134,
-135,135,151, 25,141,198, 70,156,174,241,119,231, 21,127,199,196,196,148, 54,133, 51,144,112,250, 74, 79, 7,230,230,230,230, 18,
-131,193, 64,226,227,227,171,238,191,255,126,171,221,110, 39,107,214,172, 33,233,233,233,194,192,129, 3, 45,149,149,149,228, 95,
-255,250, 23,241,241, 82, 72,203, 17,229,164,184, 18, 71,139, 97, 24,168, 84, 42,124,255,253,247, 94,151,227,112,253,222,166, 77,
-155, 64,175,217, 51, 57, 57,121,235,246,237,219, 21,177,177,127, 76,136,109, 54,155, 17, 22, 22,134,231,158,123, 78,118,215, 93,
-119,181, 31, 58,116,232,238,115,231,206, 13, 0,176,223, 15,223,125,145,145,145,159, 77,154, 52, 41,250,193, 7, 31, 68, 68, 68,
-163, 73,183, 49,106,212, 40,220,127,255,253,210,220,220,220,135, 22, 46, 92,248,208,188,121,243, 74,235,235,235,199, 1,248,209,
- 23,169, 66,161,184, 39, 46, 46,238,139,237,219,183, 71, 69, 69, 69, 33, 37, 37,133,125,253,245,215,219,119,232,208, 65,145,144,
-144,192, 94,188,120, 17, 63,255,252,115,252,195, 15, 63,188,162,172,172,236,105,139,197,178, 50,128,184,203, 34, 34, 34,222,124,
-250,233,167, 91,105,181, 90,219,129, 3, 7,242,196,253, 50,153,108,106, 70, 70, 70,175, 45, 91,182,124, 11,224,203, 43,113,178,
- 8, 33, 90,252,209,196, 39,194, 42,254, 31,136,179, 69, 8,145, 29, 62,124, 56, 60, 35, 35,227, 71,147,201,212,253,153,103,158,
- 57, 63,125,250,116,133, 70,163,209, 0, 96,180, 90,237,165, 41, 83,166,152,103,207,158,253, 70,231,206,157, 7,239,218,181,235,
- 62, 66,136,213, 33,200, 46,231, 99, 24,103,120,138, 46, 84, 96,235, 78, 65,246,206,196, 87, 19, 62,156,150,124,110,223,241, 34,
-129, 83,104,240, 75,206, 49,148, 85,213,227,215, 93,199, 17, 19, 17,204, 72,229,124, 90, 72,252, 13, 3,106, 47, 28,207,129,143,
- 25,210, 41,154, 7, 12,195, 64,169, 84,226,151, 95,126,185,108,233, 42, 79,203, 90,113, 28,135,208,208, 80,191,171, 27, 4, 5,
- 5, 97,227,198,141, 30,215, 94,244,180,164, 79, 72, 72, 8,124,189,108, 48, 12,131,160,160, 32,236,216,177, 3, 44,203,122, 92,
- 26,200,125,159, 74,165, 2,235, 99,173, 43,145, 51, 39, 39,199, 47,151,248,169, 86,171,129,134,166,127,239,133, 82, 46,199,246,
-237,219,189,198,217,253,187,218,177,222,171, 63,206, 29, 59,118, 52, 90,250,203,125, 73, 48,215,223, 42,149, 10,140, 31,210,176,
-176,176,222, 9, 9, 9,216,187,119, 47,150, 47, 95, 30,158,150,150,134,211,167, 79,131, 97, 24, 76,159, 62,157,185,225,134, 27,
-248,210,210, 82,244,235,215, 15, 63,253,244, 83, 31,173, 86, 75, 11, 12,197, 95, 2, 66, 8, 15,224, 70, 0,145,104,232,118, 83,
- 7, 32, 20, 13, 43,105,200, 0, 84, 1, 80, 56, 54, 19,128,122, 0,173, 28,167, 87, 58,234, 22, 87,129, 80,225,186,248, 52, 33,
-164,151,131, 91, 92,161, 34,210,229, 88,241, 26,238,191,221, 63, 61,114,115, 0,176,122,245,106,241, 97, 54, 48, 51, 51,115,171,
-107,228, 2, 17, 89,226, 58,101, 30,202,180,251, 16, 77,185, 74,165,250, 97,247,238,221,138,200,200, 63,226, 96, 50,153, 80, 87,
- 87,135,250,250,122,212,213,213, 33, 56, 56, 24,203,151, 47, 87, 12, 30, 60,248,135,186,186,186, 14,142, 68,243,198, 57,235,226,
-197,139,209, 54,155, 13, 50,153,231, 46, 74, 44,203,162, 83,167, 78,120,243,205, 55, 49,108,216,176,152, 65,131, 6,205,114, 19,
- 90,151, 13, 37, 85, 42,149, 95, 28, 56,112, 32, 74,169, 84, 34, 47, 47, 15,197,197,197, 24, 63,126,124,107, 65, 16, 80, 84, 84,
-132,211,167, 79,227,194,133, 11, 88,184,112, 97,212,136, 17, 35,190,240, 32,180, 60, 13, 79,125,230,229,151, 95,238, 24, 22, 22,
-198,126,244,209, 71, 53, 58,157,238,255, 28,251,223,153, 51,103,206, 99,253,251,247,143,250,247,191,255, 77,118,236,216,177,216,
-113,227,188,166,167,107,159, 44, 71, 51, 31, 28,153,239,164,219, 57,157, 92,254, 7, 33, 36, 6,128,137, 97,152, 26, 15,156, 12,
-128,144,161, 67,135,190, 98, 50,153,186,111,223,190,253,204, 45,183,220,146, 8,224,162,152,249, 66, 66, 66, 84,179,102,205,138,
-206,204,204,204,189,245,214, 91,187, 15, 29, 58,244,149,138,138,138,233,132,144, 10,151, 62, 91, 78, 78, 65,192,225,152,216, 46,
-203,114,118,141,123, 96,203, 14,179,244,213, 23, 39,159,111,211, 58,169,246,112, 94,181,253,120,126, 5,234, 12, 54,220,123,107,
-195, 2,230,189,187,180,193,103,223,111,199,115, 47,189,197,255,184,108,209,253,103, 8, 84,245, 37,199,215,248, 72,207,171, 5,
-229,132,179,137, 9, 60,207,227,142, 59,238, 0,195, 48,151,173,229,201,243, 60,118,237,218,133, 91,111,189, 21, 60,207,227,137,
- 39,158, 8,136,147,227, 56, 12, 29, 58,212,185,142,162, 43,159,187,104,240,162, 9,178,221, 42, 91,112, 28, 7,150,101,189, 46,
-164,237,206,233,175, 94, 18,195,233,139,203,245, 63,127,225,116, 44,121, 20,176,200, 10,148, 83, 12, 39,199,113,232,211,167, 15,
- 14, 29, 58,228, 83,116,121,209,151,141,226,126,233,210,165, 49, 29, 58,116,200,153, 59,119,110, 56, 0, 84, 85, 85, 57, 23,188,
-151, 72, 36, 56,117,234, 20,204,102, 51,222,125,247, 93,139, 86,171,253, 55, 45, 71,148,179, 37, 57,125,105, 17, 0,253, 39, 78,
-156,216, 51, 43, 43,107,122, 70, 70,198,119, 59,119,238, 92,202, 48,204,106, 66, 72,166,248, 57,113,226,196,180,172,172,172,233,
- 19, 38, 76,120,115,198,140, 25,199, 24,134, 89, 13, 0,238,191, 29,117, 73,166,155,136,139, 20,121, 28,101,174,209,177,158,126,
-187,127,122,226,110,228,104,101,102,102, 50,142, 72, 50,174,149, 90,160, 66, 43,144,181,251, 56,142,123,126,250,244,233,209,190,
- 68, 86,125,125, 61, 74, 74, 74,144,152,152,136, 39,158,120, 34,122,238,220,185,207,219,108,182,143,125,208, 74, 37, 18, 9,246,
-238,221,139,242,242,114,116,237,218, 21,201,201,201,141, 14, 56,123,246, 44,214,174, 93,139,154,154, 26,244,232,209, 3,104,232,
-220,237, 17,221,186,117,123,183, 83,167, 78, 67, 89,150,181, 41, 20, 10, 28, 62,124, 24,221,187,119,199,247,223,127,143, 54,109,
-218, 64,169, 84, 34, 55, 55, 23, 93,187,118,197,214,173, 91, 17, 25, 25,137,244,244,116,155, 86,171,221, 86, 93, 93,189,249,220,
-185,115,239,122, 11,103,124,124,252,228,167,158,122, 74, 86, 82, 82, 34,124,243,205, 55,219, 1,108, 7,240,252, 91,111,189,245,
-248,176, 97,195,162, 14, 30, 60, 88,187,111,223,190, 61, 94, 68, 86, 32, 78,150,205,253,161,100,183,219, 77, 6,131,193,108, 50,
-153,172, 44,203, 22, 50, 12, 99,182,219,237, 29,188,153, 16, 99,199,142,109, 91, 89, 89,249,220, 75, 47,189, 84,224, 16, 89,167,
-208,208, 1, 30, 0, 96,179,217, 76,245,245,245,218,140,140,140,196,135, 31,126,248,204,210,165, 75,159, 27, 59,118,236,242,111,
-190,249,166, 30,128,193,157,176, 77,155,214,135, 36, 18, 86,170,171, 11,207, 95,177,252,203,151,215,174,122,190,117, 81,209,133,
-246, 17,173, 34,117, 82,117,100,201,242, 37, 95,239, 7, 96, 46,169,208,226,200,217, 82,240,188, 4, 39,138,106,209,255,246, 81,
-252,153,188,105,125, 1,172,161,239,114, 45,255,178, 40, 46, 66,189,101,203, 22,159,142,214,174, 93,187,192,243, 60, 20, 10, 5,
-102,207,158,237,147, 84, 20, 6,162, 91,228, 79,204,136,139,163,251,114,159, 4, 65,112, 46,244,238,190,253,223,255,253, 31, 94,
-122,233,165, 70,215,112,136, 13,198, 31,167,183,240, 37, 38, 37,161,188,172,172,209,190, 64, 22,165,183,219,237,224,121, 30, 11,
- 22, 44, 64,102,102, 38, 86,175, 94,237,243,243,142, 59,238, 0,203,178, 36,144,244,236,211,167, 15, 44, 22,139, 51,204,167, 78,
-157,242,200, 59,111,222, 60,127,193,188, 11,192,148,238,221,187,107, 6, 13, 26,132,156,156, 28,220,127,255,253, 38,139,197,146,
- 7, 0,119,222,121,103,234,220,185,115,101, 7, 14, 28, 64, 68, 68, 4,127,254,252,249,255,129,118,144,167,104, 97,120,210, 34,
-226, 51, 47, 43, 43,107,186,187,136,113,133,248, 63,195, 48,171,103,204,152,145,233, 42,138, 92,127,139,174,147,155,136, 75,115,
-117,164, 92, 69,148, 55, 1,229,246,188,117, 61,190,194,163,208,114, 68,108,160,171, 11, 36, 86,190,254, 68,150,143, 55,199, 70,
- 8, 9, 9, 25,126,239,189,247, 58, 69,142,209,104,116, 10, 44, 81,100,137,191,115,115,115,209,179,103, 79,105, 72, 72,200,240,
-170,170,170,143, 3, 16,113,136,139,139, 67,101,101, 37,142, 30, 61,138,196,196, 68, 88,173, 86,172, 95,191, 30,181,181,181,224,
-121, 30, 82,169, 20, 22,139,207,190,219,232,212,169,211, 29,139, 23, 47,238,185,104,209,162, 75,226, 27,221,146, 37, 75, 64, 8,
- 65,100,100, 36,244,122, 61,202,202,202,176,121,243,102,216,108, 54,168,213,106,164,164,164,200,238,185,231,158,190, 83,166, 76,
-225,125, 8,173, 62,247,223,127,127,136, 70,163,193,139, 47,190, 72, 44, 22,203, 12,199,190,201,227,198,141,139, 40, 44, 44, 52,
- 63,249,228,147,123, 45, 22,203, 71,162,153,232, 42,112,188,220, 88,175, 78,150,213,106, 21,211,180,160,190,190, 30,173, 90,181,
- 74,116,117,182,188,137,193, 29, 59,118,244, 1, 32,153, 58,117,106, 16,128, 50,215, 48,152,205,102,212,215,215, 67,167,211, 89,
-107,107,107,203, 95,123,237, 53,219,210,165, 75, 37,142,115, 78,120, 18, 90, 12,115,135, 89,163, 81,202, 8,145,188, 53,127,254,
-124,245,176, 97,195, 88,181, 90,141,186,186, 58,205,175,235,214,169, 7, 15,234,155, 50, 61,235,195, 13,154,132,174,101, 59, 14,
-231,227, 66,105, 45,204, 86, 43, 82, 98, 67, 26,252, 48,138, 22,135, 99, 32,139,211,209,114, 21, 21, 57, 57, 57,184,253,246,219,
-157,101, 93, 42,149, 54,114,190,252,113,114, 28,135,219,111,191,253, 50,135,103,203,150, 45, 30,221, 39,127,112, 21, 69,238,226,
-200,147, 0, 99, 89,214,239, 2,235,162,155,231, 73,108,185,186,250,110,226,205, 95, 51, 7, 56,142,195,184,113,227,192,243, 60,
- 94,127,253,117,112, 28,135,244,244,116,112, 28,135,140,140, 12,240, 60,143, 91,111,189,181,201,113,223,189,123, 55,186,119,239,
-238, 12, 83,122,122, 58,122,245,234, 5,142,227,208,175, 95, 63,240, 60,143,161, 67,135, 6,194,249,102, 93, 93, 93, 55,181, 90,
-141,220,220, 92, 72, 36, 18, 48, 12,115, 26, 64, 55, 0,136,141,141, 61,163, 6,111,130,189, 0, 0, 32, 0, 73, 68, 65, 84,215,
-235,219, 26,141, 70, 60,245,212, 83,140,217,108,238,250,250,235,175,191,101, 52, 26,169,208,162,104, 49,184,107, 17, 23, 24, 38,
- 76,152,240, 38,195, 48,171, 69,135,202,221,121,242,244,219, 67,221, 36, 58, 80,251, 28,101,181,151,155,136,171, 96, 24,102, 31,
- 33,228, 78,111,231, 2, 48,187, 9,171, 70, 77,135,174,205,134,126, 29, 45,177,242, 13, 84,104,249,131,209,104,188, 49, 42, 42,
-202,171,200,114,253, 52,155,205, 72, 78, 78,134,209,104,188,177,169, 15,141,216,216, 88, 88, 44, 22,124,249,229,151,144, 74,165,
-144, 74,255,208, 23,102,179,111,179,232,248,241,227, 5,187,119,239,238,222,163, 71,143,176,159,126,250,169, 98,192,128, 1,145,
-195,134, 13,131, 66,161,128,193, 96,128,213,106, 69,239,222,189,209,169, 83, 39, 20, 23, 23,227,215, 95,127,173,236,208,161, 67,
-171, 61,123,246, 8,165,165,165,231,124, 80,223, 54,120,240, 96, 48, 12,131,117,235,214, 85, 2,216, 39,151,203,215, 78,155, 54,
- 45,204,108, 54, 11,163, 71,143, 62, 95, 93, 93,253, 18, 0,139, 76, 38,155, 51, 96,192,128,140,236,236,236,111, 5, 65,152,221,
-212,140,234,158,182, 58,157, 14, 65, 65, 65,129, 76, 37,193, 87, 87, 87,119, 1, 0,149, 74, 21, 14,224,140, 51,135, 27, 12,141,
-196,176,217,108, 54,134,135,135,171, 0,192,113, 14,239,133, 51,210,102,195,138,115,231,242,131, 93,251,207,133,134,134,226,145,
-135, 31,102,111,233,211, 71,214,237,198, 27,135,190,253,201,162,239,227, 34, 52,230,148,184, 8, 88,237, 86,100,111, 88, 47, 16,
-193,186,129, 86, 59,127,142,208, 18,197,134,187,163,197,243, 60,182,110,221,122,217, 62,169, 84,138,255,254,247,191, 1, 9, 3,
- 81, 84,121,107, 58,115,107,234, 98,252, 9, 24,158,231, 33,145, 72,176, 96,193, 2, 8,130,128,151, 95,126,185, 81,115,162, 43,
-127, 64,118,158,139, 8,236, 52, 89, 0, 96, 70,241, 76,185,243,124,247,240, 58,206, 9,200, 37,155, 59,119,110, 64,142,214,157,
-119,222,233, 87,184,186,182, 48,184,134,235,208,161, 67, 30,121,231,207,159,239, 55, 61,237,118, 59,214,172, 89,227, 20,169, 34,
-222,126,251,237,167,100, 50, 89,244,182,109,219, 80, 90, 90, 10,157, 78,135,250,250,122,244,238,221, 59,133,101,217,195,165,165,
-165,133, 39, 78,156,184,151,150, 30,138, 63,209,209, 50,205,152, 49,227,216,140, 25, 51, 60, 58, 86,238,206,146, 47,231, 73, 20,
- 88, 14, 65, 20, 41,138, 55, 52,116,171,217,231,239, 92, 0, 50,247,166, 67,159, 70,144,155,138,156,226,169,242, 13,164,249, 48,
- 64, 59,157, 99, 24, 6, 70,163,209,163,192,114, 21, 7, 22,139, 5,213,213,213,176,219,237, 87, 60,215,151,167, 55, 89,127, 66,
-235,232,209,163,255,122,252,241,199, 75, 66, 66, 66,186, 85, 84, 84,148, 11,130,112,235,174, 93,187, 34, 57,142,131, 70,163,129,
- 70,163,193,218,181,107,161, 84, 42, 49,110,220,184,114,187,221,158, 19, 28, 28, 28, 97, 48, 24,126, 47, 45, 45,125,219,171,130,
-225,249,161,253,250,245,195,129, 3, 7,112,233,210,165,141, 0,210, 31,125,244,209,219, 91,183,110,205, 76,155, 54,205,120,246,
-236,217,217, 0,202, 85, 42,213,226,197,139, 23, 15,234,209,163, 71,240,232,209,163,177,117,235,214,249, 0,140,129,198, 89,167,
-211, 53, 18, 88, 90,173, 22,117,117,117, 80,169, 84,182, 0,211,140,199, 31, 35, 12, 65, 8,113,222, 27,135,155, 37,222, 31,194,
-113,156, 56,170,209,155,200,130, 74,165,154,186,104,209, 34,133,251, 32, 5,187,221,142,178,178, 50,104, 52, 26, 76,122,251,109,
-233,123,227,255,221, 93,162,142,222,197,178, 12,204, 22, 82, 67, 4,243,122, 93,217,131,219,128,119,105,205,243, 39, 64, 20, 6,
-119,223,125,247,101,205,133, 82,169, 20, 27, 55,110,196,136, 17, 35,156, 47, 46, 61,122,244,240,251,114, 37, 10,131,187,238,186,
-203,233, 12,173, 95,191,222, 99,179,159,232, 72, 5, 34, 8,197, 99, 95,120,225, 5,112, 28,135,207, 62,251, 12,175,188,242, 10,
- 88,150,197,204,153, 51,193,178, 44,222,121,231,157,128, 69,166,171,128, 41,252,176,225, 51,225, 21, 45,170,230, 69, 3, 0,130,
- 53, 26, 49, 66, 77,170,123, 56,142,115, 58, 89, 55,222,120, 35,120,158, 71, 70, 70, 6, 56,142,115, 58, 89,195,135, 15,119, 77,
- 71, 18, 8, 39,199,113,200,203,203,115,134, 57, 35, 35,163,145,147,197,113, 28,238,188,243,206, 64,130, 57, 61, 52, 52,116, 74,
-167, 78,157, 58,207,154, 53,139,151, 72, 36, 24, 60,120,112,106, 76, 76,204, 57,155,205, 22, 49,117,234, 84,165,135,115, 20, 0,
-186,117,238,220, 89, 69, 75, 13, 69, 11, 58, 90, 83, 60,252, 21,230,218,231,170, 9, 47,146,171, 93,143, 23, 57,220,197,145,195,
- 33,203,241,199,229,233, 92,127,224, 68, 5,233,203, 82, 15, 68,104, 57,108,103,159, 23, 83, 42,149, 71,202,203,203, 51, 20, 10,
- 69, 35,145,229, 73,112, 73, 36, 18,148,150,150, 66,169, 84, 30, 49,153, 76,205,118, 19,253, 53, 29, 2, 48,158, 62,125,122,188,
-203,239, 33,195,135, 15,255,102,227,198,141,177,217,217,217,216,179,103, 15, 34, 35, 35, 49,119,238,220,139,101,101,101,255, 2,
-176,177,178,178,210,239,117,219,182,109,219, 69,173, 86, 99,199,142, 29, 0,176, 21,192,191,159,123,238, 57,198,106,181, 98,222,
-188,121, 58, 0,235, 66, 67, 67,215, 44, 95,190,188,123,183,110,221,100,217,217,217,218, 61,123,246,252, 22,160,200,178, 11,130,
-112,153,192,114, 77,211,224,224,224, 64, 28, 45,107, 72, 72,200, 81,173, 86, 59,202, 96, 48,104,229,114,121,176, 86,171, 53,185,
- 10, 44,145,159,227, 56, 62, 47, 47,175, 4, 64, 74, 72, 72,200, 81,120,105,230,228, 56,110,240,224,193,131, 57,247,123, 80, 86,
- 86,134,210,210, 82, 88, 44, 22,244,232,209,131,145, 48, 86,201,165,162, 35,110,211, 58, 80,145,245, 39, 57, 90, 68, 44,235,226,
- 40, 65, 79, 35, 13,215,175, 95,239,252,205,178, 44,190,254,250,235,128, 68,209,198,141, 27,125,118, 88,119,107, 58,244,107,141,
-139,199,127,254,249,231, 32,132, 56,157, 44,150,101, 49, 97,194, 4,200,229,114, 76,155, 54, 13, 19, 38, 76, 0,199,113,126,155,
- 14, 93, 5, 76,210,235,122,215,151,163,134, 66,225,232, 15,197, 48,140,171,216, 98, 2, 21,111,190,220,188, 64, 90, 2, 92, 57,
-197,243,130,130,130,188,118,132,119,227,244,117,129, 95, 0,228,199,198,198,238,200,200,200, 8,217,191,127, 63,102,206,156, 41,
- 53,153, 76,109,178,179,179,157,215,245,148, 94, 58,157, 78, 65, 75, 14, 69, 75,184, 89, 62,254,174,112,235, 95,197,184, 54,227,
-249,248,116, 63, 30, 46,251, 92,121, 43, 24,134,177,122,184, 94,133, 7,113,229,126, 13,215, 99, 42,188, 58, 90,254, 42, 11,127,
-130, 43, 16, 71, 75,175,215,255,182,110,221,186, 94, 15, 63,252, 48,231,171,217, 80,167,211, 33, 58, 58, 26,199,142, 29,179,233,
-245,250,223, 2,112,202,154, 83,104,185, 35,187,188,188, 92, 98,181, 90,209,190,125,123,196,199,199,195,104, 52,162,166,166, 70,
- 2, 96, 99,128, 28, 82,149, 74, 37, 1,128,154,154, 26,160, 97,168,105,106,135, 14, 29,112,224,192, 1, 84, 87, 87,255, 8, 96,
-216,148, 41, 83,122,244,238,221, 91,250,253,247,223,235,159,121,230,153, 31,173, 86,107, 64, 74, 67, 16, 4,179,205,102, 75,102,
- 89,214, 82, 83, 83,115,193, 53, 61,163,163,163,195, 85, 42, 21, 83, 86, 86,102, 13, 68,104,117,235,214,109,239,249,243,231, 49,
-117,234,212,138,233,211,167,119,168,171,171,187, 84, 91, 91,107,115, 21, 91, 70,163,145,109,213,170,149,124,222,188,121, 10, 0,
-232,214,173,219, 94,111, 66, 75,167,211,181, 86, 42,255,120, 49, 54,153, 76, 40, 45, 45, 69,105,105, 41,202,202,202, 80, 87, 87,
-135,148,148, 20,232,245,250, 68, 90,205,252,101, 66,171, 81,243,153,107,249,118,125,144, 55,165,172,187, 10,152,187,239,190,219,
-217,183, 75,116,200,196,109,197,138, 21,238, 29,204, 3, 18, 90,159,127,254, 57, 94,120,225, 5, 4, 5, 5, 97,214,172, 89,141,
-154, 14,221,197,129, 32, 8, 76, 32,113, 79,126,195,128,210, 57,225,224,121, 30, 17,207,148, 53,106,162,243, 32, 56, 2, 10,231,
-244,233,211,155,165,233,208,149, 51, 49,177,161,168, 44, 88,176, 0,163, 70,141,194,182,109,219,174,184,233, 48, 45, 45,109,201,
-234,213,171, 67,142, 31, 63, 14,173, 86,139,138,138, 10,152, 76, 38, 20, 23, 23,123,109, 21,112,212,229, 65,180,228, 80,252,201,
-245,212,190, 63,147,183, 57,175,199,249,121,128, 7, 44,180, 2,113,180, 76, 38,211,172, 23, 95,124,241,185, 33, 67,134,132, 7,
- 7, 7,163,164,164,228, 50,145, 85, 95, 95, 15,181, 90, 13,131,193,128, 85,171, 86,105, 77, 38,211, 44,127,226,192,106,181, 34,
- 42, 42, 10,149,149,149, 16,188,244,159,102, 89, 22, 10,133, 2,245,245,245,128,159, 78,230,158, 30, 24, 22,139, 5, 86,171, 21,
- 86,171, 21, 22,139,197,239, 91,178,187,153,167, 82,169, 68,225, 1, 0,186,184,184,184,246, 65, 65, 65, 40, 40, 40, 0, 26, 70,
-246, 13,185,253,246,219,249,170,170, 42,242,228,147, 79,110, 39,132, 60, 5,223,179,227,155,115,114,114,146, 1, 64,161, 80,228,
- 2, 64,113,113,177,181,166,166,166,145, 83,168, 84, 42,201,136, 17, 35, 98, 9, 33,200,201,201, 73,150, 74,165, 4,222, 71, 53,
- 26, 87,174, 92,121, 60, 36, 36,100,105, 86, 86,214,195,153,153,153,199,186,116,233,146,172,211,233,202, 13, 6,131,193,104, 52,
- 18,137, 68, 34, 13, 11, 11, 11,218,176, 97,195,153, 93,187,118, 13,209,104, 52, 75, 87,174, 92,121,220,155,243,166, 82,169,138,
-245,122,125,146,120, 79, 93, 69, 86,105,105, 41, 8, 33,200,207,207,135, 82,169, 60,239,175, 89,151,162,229, 32,190, 84,185, 59,
- 47,238,251, 2, 21, 89,174,194, 96,195,134, 13, 62,231,208, 10,148,211, 85, 20,189,242,202, 43,152, 51,103,206,101,142,214,180,
-105,211, 0, 0,111,191,253,118,192,125,180, 68,247,170,116, 78, 56, 98, 94,168,110, 20,118, 0, 96,196,240, 53,173,204,131,227,
- 56, 76,157, 58,245,178, 78,234,174, 77,123, 1, 54,241, 53, 10,103,121,121, 57, 56,142, 67,120,120, 56, 30,121,228, 17, 12, 29,
- 58,212,217, 4,217, 84,222,147, 39, 79,238,120,227,141, 55,186,166,165,165,225,253,247,223,175, 14, 13, 13, 13,254,207,127,254,
-195,213,212,212, 48,190, 28, 45, 42,180, 40, 40,154, 65,104,137, 5, 44,208, 81,135, 94, 42,203, 33,104, 60,215, 70,173, 94,175,
-127,228,182,219,110,251,105,217,178,101,138,182,109,219,226,228,201,147,168,174,174,134,217,108,134, 84, 42, 69,108,108, 44,106,
-106,106,240,245,215, 95, 27,244,122,253, 35, 0,106,253,112,190,213,179,103,207, 47, 62,254,248,227,160,244,244,116, 84, 87, 87,
-163,190,190,222, 41,132, 24,134,129, 70,163,129, 66,161,192,222,189,123,177,126,253,122, 3,128,183,252,112,122, 82,115,176, 88,
- 44, 78,193, 21,128,208,114,229, 84,137,174,142, 94,175, 7, 0,107,235,214,173, 99, 0, 32, 63, 63, 31, 0, 10, 83, 82, 82,166,
-180,109,219,150, 89,188,120, 49, 33,132,172,247, 34,178,156,156, 12,195, 84, 19, 66, 46, 1,136, 49,155,205, 82, 0,168,173,173,
-181,180,106,213, 42, 74, 46,151, 11, 10,133, 66, 8, 10, 10, 18, 74, 74, 74,108, 54,155, 77, 10, 0,253,250,245, 51, 3, 40,117,
- 91,163,208,149, 83, 32,132,104,231,207,159, 63,101,244,232,209, 25,125,250,244, 73,123,246,217,103,143, 62,249,228,147,108,124,
-124,124, 88, 93, 93,157,241,244,233,211,151, 62,249,228,147,186,221,187,119, 15,225,121,254,220,252,249,243,167, 0,208, 50, 12,
- 35,120,226,180,217,108,191,101,103,103,255, 43, 51, 51,147,187,112,225, 2,202,202,202,156, 34,171,172,172, 12,157, 58,117,194,
-174, 93,187,236, 22,139, 37,187, 9,233,217, 92,160,156, 13, 47, 33, 68, 44,235,222, 4,150,248, 50, 21, 40,167,171, 40, 26, 53,
-106, 84, 35, 23, 75, 42,149,226,135, 31,126,240, 88,111,120, 40, 87,141,226,238, 58,199,215, 27,111,188,209, 72,180, 77,154, 52,
-201,107,117,230, 47, 61, 69,158,218, 5,241,141, 71, 29,122, 41,231,190,194, 41,214,157, 60,207, 99,210,164, 73, 1, 59, 90,184,
-188,143,214,101,156, 98,220, 7, 12, 24, 0,189, 94,239, 20,178,222, 28, 45,127,233,105,183,219, 95,152, 51,103, 14,209,104, 52,
- 55,107,181,218, 71,207,159, 63,191, 80,175,215,223, 84, 91, 91,235,211,209, 50,153, 76,114, 90,142, 40, 39, 90,102,126,174,235,
- 71,104, 57, 30,146,104,221,186,117,163,181,179, 88,150,109,180, 53,165,159,129, 3, 27,242,242,242,238,187,229,150, 91,190,125,
-225,133, 23,130,211,211,211,249,164,164, 36,232,116, 58, 20, 20, 20,224,216,177, 99,182,149, 43, 87,106,245,122,253,163, 0, 2,
- 25,117,182,232,248,241,227,235,135, 13, 27,246, 78,239,222,189,159,158, 60,121,178, 36, 53, 53, 21,181,181,181, 8, 11, 11, 67,
- 84, 84, 20, 78,157, 58,133, 85,171, 86,217, 43, 43, 43,191, 0,240, 30, 60,180,161,250,123,225,183, 88, 44,120,232,161,135, 32,
- 8, 2,102,207,158,141, 64, 22, 84,118,129,197, 98,177, 16, 0,140,163, 63,151,222, 49,187, 52, 78,159, 62, 13, 0,231,146,147,
-147,131, 1, 32, 59, 59,155, 65,195,252, 90,129,188,225, 19, 66,136,211,217,234,212,169, 83,129,123,229, 40, 58, 89,162, 11,230,
- 47,220, 12,195, 24, 9, 33,229,122,189,126,216, 43,175,188,242,206,231,159,127,254,240,231,159,127,126,217,113, 26,141,102,233,
-204,153, 51,223,123,224,129, 7,202, 25,134,241,218,143, 76,167,211,189, 61,102,204,152, 7,142, 28, 57, 18, 28, 20, 20, 4,157,
- 78,135,170,170, 42, 88, 44, 22,164,164,164,160,188,188, 28,139, 22, 45,170, 51, 24, 12,239,210,226,248,215,192, 85, 24,120,115,
-181, 2, 16, 89, 94, 93,157, 95,126,249,197,227, 28, 85, 77,229,116, 23, 27,129,206,109,229,235,165, 72,156,150,198,211,148, 17,
- 77,172,215, 46,227,229, 56, 14, 31,125,244,145,115,210, 86, 79, 78, 86, 83, 28, 45,145, 51, 60, 60,188,193, 38, 87, 42, 33, 8,
- 2,238,188,243,206,171,225, 21, 0,140,115,153,241,125,250,107,175,189, 54,165, 83,167, 78,169, 0,228,174,105,208, 68, 23,159,
-130,130,194,159,208,178,219,237,197, 29, 59,118,108, 84,193,249, 91,204,212,106,181, 22, 7,120,221,245, 58,157, 46,101,230,204,
-153, 47,170, 84,170, 33,122,189,190,171,163,226, 56,162,211,233,178, 77, 38,211,167,104,218, 34,208, 21, 0,158,223,189,123,247,
-236, 97,195,134, 77,187,245,214, 91, 71,142, 31, 63,158, 33,132, 96,222,188,121,228,236,217,179, 43, 28, 46,214,217, 43, 73,164,
-240,240,240,227, 95,127,253,117,244, 79, 63,253, 4,171,213,138, 79, 63,253, 20,193,193,193,199,171,171,171, 3,165, 40,223,180,
-105,211, 55,125,250,244,121,108,215,174, 93,139, 0,252,190,117,235,214,133,125,251,246, 29,179,107,215,174, 37, 0,142,109,222,
-188,121, 97,239,222,189,199,236,219,183,111, 57,128, 67, 77,168,124,157,206,150,205,230,185,165,209,139,147,229,139, 83, 75, 8,
-177, 60,254,248,227,227, 31,120,224,129, 47,247,237,219,119, 83, 77, 77, 77, 87, 0, 8, 13, 13, 61,210,171, 87,175,189,203,150,
- 45, 59,229,112,178,252,117,214,175,208,233,116, 35,186,118,237,250,227,251,239,191,175, 74, 75, 75,227,218,183,111,143,194,194,
- 66, 28, 61,122,212,246,191,255,253,175,222, 96, 48,220, 13,224, 18, 45,142,127,157,208, 34,132, 32, 52, 52,180,209, 75,148, 56,
-228,191,169,205,133,174, 15,102,113,169, 30,119, 94,111,156,190,166, 77, 16,161, 86,171,157,147,155, 6,210,101, 65, 16,124,207,
-199, 70, 8,113,114,138, 91, 0, 34,203,239, 8, 65,199, 18, 56, 1,115, 6, 50,189,131, 74,165,130,213,106,117,242, 6, 48,242,
-179,169,106,241, 23, 0,191, 88,173,214,211, 0,218, 81,113, 69, 65,209,130, 66,235,210,165, 75, 61, 91,248,218, 90,147,201,244,
-158,201,100,122, 79,220, 97, 52, 26,175,150,243, 44,128, 7, 54,109,218,244,241,166, 77,155,196,118,132,169,240,191, 94,162, 79,
-156, 60,121, 50,147,231,249,255, 46, 93,186,180, 55, 33, 4, 33, 33, 33,187, 11, 11, 11,255,211, 20, 14,187,221,254,248,174, 93,
-187,158,131,163, 47,147,197, 98,121,124,199,142, 29, 47,162, 97, 61, 38,216,237,246,199,247,236,217,227,252,221,196, 7, 37, 33,
-132,152, 8, 33,113, 94, 14, 49, 53,209,129, 19,157, 45,243,178,101,203,234, 1, 28,198, 31,243,100, 89, 29,155,209,173,185,208,
- 23, 54,235,116,186,246,147, 38, 77,154, 46,145, 72, 6,235,116,186,120,149, 74, 85,100,179,217,126,211,235,245,111,161, 97,141,
- 42,138,191, 8,102,179,249, 66,199,142, 29, 57, 79, 47, 80,190, 30,228,190, 94,172,236,118,123,113,135, 14, 29,252,190,156,121,
-224,188,224, 67, 52,156, 75, 73, 73, 97, 3,229, 18, 97,177, 88,202,125,133, 51, 37, 37, 5, 77,229,244, 23,247,228,228,100,143,
-113,247, 35, 8,189,198,221,102,179, 93, 17,167,175,244,244, 5,131,193,112, 41, 50, 50,178,222,104, 52,242, 38,147,137,183,217,
-108,141,236, 71,133, 66, 81, 97, 48, 24,104,225,161,160,184, 26,161,245, 15,199,126, 52, 44, 47,209, 92, 48, 29, 57,114,228, 49,
-167, 61, 85, 94,126,165, 60,238, 74,178,222,207,239,166, 8,163,102,119,132, 28, 66, 74,223, 76,116,149,245,245,245, 79,138, 63,
-196, 62, 32, 20,127, 61,170,170,170,110,110,110,206,234,234,234,102,127, 81,171,172,172,204,104,129,184,247,188, 94, 57,125,161,
-164,164,228,102, 63, 66,140, 22, 28, 10,138, 0,193,210, 36,160,160,160,160,160,160,160,160,104, 25, 48,104, 24, 57,224, 9, 77,
- 25, 77, 48,228, 10,174,157, 77, 57, 41, 39,229,164,156,148,147,114, 82,206,235,142,211, 31, 55, 29,205,216,194, 2,140,114, 82,
- 78,202, 73, 57, 41, 39,229,164,156,215, 31,231, 53, 9,218,116, 72, 65, 65, 65, 65, 65, 65, 65, 65,133, 22, 5, 5, 5, 5, 5,
- 5, 5, 5, 21, 90, 20, 20, 20, 20,174, 72,109,221,186,245,137,212,212,212, 11, 0,198,182,240,181, 30,233,221,187,119,149, 92,
- 46,223, 0, 32,149, 38, 61, 5, 5, 5, 21, 90, 20, 20, 20,215,180,200,234,218,181,235,246,147, 39, 79,118,202,206,206,142,139,
-143,143,255,176, 37, 47,214,179,103,207, 15,182,109,219, 22,190,110,221,186,219, 98, 98, 98,114,174, 80,108,165,182,105,211,230,
- 68,106,106,106, 49,128, 71,154, 57,136, 99, 51, 50, 50,170,101, 50,217,122, 42, 4, 41,174, 3,116, 1,208,149, 10, 45, 10, 10,
- 10,138, 22, 20, 89, 59,119,238,140, 48, 26,141, 56,121,242, 36, 42, 42, 42, 14,181,228, 5,115,115,115, 47,237,220,185, 19, 9,
- 9, 9, 88,178,100, 73,100,114,114,242,182, 38, 10,154,212,174, 93,187,110, 63,113,226, 68,167,236,236,236,248,168,168,168, 79,
-154, 51,124, 55,221,116,211,180,109,219,182,133,109,216,176, 97,104,100,100,228,149, 10, 65, 10,138,191, 51,228, 0, 30, 99, 24,
-102,111,151, 46, 93,142,164,165,165,253,206, 48,204, 46, 0,163,112,237,206,221, 25, 24, 86,175, 94,189,117,245,234,213, 91,105,
- 30,161,160,160,104, 6,164,165,165,165,233,116, 58, 29,169,168,168, 32,159,125,246, 25, 9, 15, 15,183, 0,248, 13,192, 74, 15,
-219,155, 0, 52, 1,114,107, 28,199,123,226,249, 45, 60, 60,220,242,217,103,159,145,252,252,124,114,252,248,113,146,154,154,106,
- 8, 80,208,164,118,237,218,181, 82, 12,243,218,181,107, 9,199,113,235,155, 51, 81, 52, 26,205,177,156,156, 28,114,246,236, 89,
-178, 97,195, 6, 18, 29, 29, 93, 78,197, 22,197, 53,130, 36, 0, 31,168,213,234,234,187,238,186,139,124,245,213, 87,100,213,170,
- 85,228,199, 31,127, 36,179,102,205, 34,131, 6, 13, 34, 50,153,236, 2,128,215, 1,132, 94, 79, 90,132,113, 68,140, 0, 24, 8,
- 0,153,153,153, 84,108, 81, 80, 80, 92, 45,118,234,245,250, 12,189, 94,143,186,186, 58,180,110,221, 26, 60,207,123, 60,176,188,
-188, 28, 59,118,236,192,184,113,227,142,151,150,150,246,135,239,117, 47,195,186,119,239,190,115,243,230,205,169,193,193,193,206,
-157,130, 32,192, 98,177,192,106,181,194, 98,177,192,100, 50,193,100, 50, 65, 38,147, 65,161, 80, 32, 60, 60,252, 40,124, 55, 97,
- 56,221, 55,131,193,128,131, 7, 15, 98,244,232,209, 21, 85, 85, 85,253, 1,228, 54, 99,186,164, 70, 69, 69,229, 44, 90,180, 40,
- 50, 37, 37, 5,231,207,159,199, 19, 79, 60, 81,121,238,220,185,126,205,124, 29, 10,138, 63, 19, 19,238,187,239,190,105,209,209,
-209,108,151, 46, 93, 16, 27, 27, 11,147,201, 4,131,193, 0, 66, 8, 56,142, 3, 33, 4,181,181,181,200,201,201,193,230,205,155,
- 77,151, 46, 93,250, 26,192,167, 0,242, 92, 68,214, 53,169, 69,156, 66, 43, 51, 51,147,161,121,133,130,130,162,153,112,164,182,
-182,182,139,201,100,130, 78,167, 11,232,132,252,252,124,140, 29, 59,246,120,105,105,233, 45,240,188,168,188,166,123,247,238,123,
-114,114,114, 82,141, 70, 35,180, 90,255,235,206,203,100, 50, 4, 5, 5, 33, 34, 34, 98, 23,128, 62,222,222,196,187,116,233,178,
-127,215,174, 93,225, 6,131, 1,135, 14, 29,194, 35,143, 60, 98,169,174,174,222, 14,192, 91,224,171,209,176,142,234, 57, 15,255,
- 37, 2,120,209,241,134,239, 9,170,200,200,200,190,139, 23, 47,150,182,109,219, 22,122,189, 30,163, 70,141,170,206,205,205,237,
- 5,160,128,102, 29,138,127, 32,114, 79,158, 60,217,193,110,183,163,178,178, 18, 38,147, 9,122,189,222, 41,180, 36, 18, 9, 8,
- 33,176,217,108,206, 23,163, 3, 7, 14, 32, 59, 59,155,228,231,231, 79,118,148,165,107, 86,139, 80,161, 69, 65, 65,209, 18, 72,
-237,208,161,195,161, 95,127,253, 53, 72, 42,149, 98,213,170, 85,152, 60,121,178,181,186,186,122,155,187,120,137,142,142, 78, 91,
-184,112, 97,114, 74, 74, 10,126,255,253,119,220,127,255,253,111, 1,152,238,129,243, 77,173, 86, 59,205, 98,177,224,208,161, 67,
- 24, 51,102, 76, 65, 89, 89,217, 49,119, 17,147,156,156,220,239,147, 79, 62,225,123,244,232, 1,173, 86,139,145, 35, 71,234, 79,
-157, 58,213, 27,192, 49, 47, 97,253,164,186,186,250, 21,187,221,142,186,186, 58, 36, 36, 36, 64, 42,149,250,140,156,193, 96, 64,
- 82, 82,210,174,138,138,138,203,196, 91, 68, 68,196,166,243,231,207, 15, 82, 40, 20, 62, 57, 44, 22, 11,138,139,139, 33,147,201,
- 96, 50,153,208,174, 93,187,175, 1, 60, 78,179, 14,197, 63, 81,104, 29, 62,124,184,195,119,223,125,135,238,221,187,163,115,231,
-206,168,175,175,119,138, 46,179,217, 12,171,213,122,217, 73, 90,173, 22, 47,191,252,114, 30, 28,205,231,215,170, 22, 17, 59,166,
- 77, 17,219, 68, 51, 51, 51, 7,208, 60, 67, 65, 65,113,181, 21,111, 94, 94, 94,250,144, 33, 67,182,173, 88,177,162,213,240,225,
-195,209,174, 93, 59,254,222,123,239,141,212,235,245,131, 93, 15, 44, 43, 43, 11, 27, 51,102,204,254,162,162,162,100,199,174, 94,
- 94, 56,123, 5, 7, 7, 35, 63, 63, 95, 20, 89, 61,225,214,204, 40,147,201,214, 31, 62,124,152,151,201,100,216,183,111, 31,198,
-142, 29, 91, 89, 80, 80,224,175, 89, 46,212,108, 54, 67, 34,145, 0, 0,138,139,139,253, 70,238,252,249,243, 16, 4,193,228,233,
- 63,150,101,229, 7, 14, 28, 64, 92, 92,156, 79, 14,150,101,221, 5, 93, 13,205, 54, 20,255, 80, 88,205,102, 51,122,246,236,137,
-130,130, 2, 28, 56,112,192, 41,184, 42, 43, 43, 81, 82, 82,210,232,224,189,123,247,226,224,193,131,232,223,191,191, 59,207, 53,
-169, 69,156,202,113,245,234,213, 3, 28,145,219, 74,243, 12, 5, 5, 69, 51, 33, 53, 46, 46, 46,103,209,162, 69,145,177,177,177,
- 24, 52,104, 80, 81,105,105,105, 27, 15,199,173, 36,132,220,157,159,159,143,182,109,219,174, 2,112,207,149, 28,147,152,152, 88,
-177,111,223,190, 86,199,143, 31,199, 35,143, 60, 82,225,232,243,229,175,239, 83,114,167, 78,157,246,109,216,176, 33,156,101, 89,
- 28, 59,118, 44,144,166,195, 66, 52,244, 47, 57,231,225,191, 68, 0,147, 0,132,123, 57, 87,213,161, 67,135,190,251,247,239,151,
- 50, 12,131,194,194, 66,177,233,176,167,131,151,130,226,159,134, 17,113,113,113,255,123,238,185,231, 66,122,247,238,141,226,226,
- 98, 92,184,112, 1,151, 46, 93, 66,122,122, 58,210,210,210,112,246,236, 89,172, 95,191, 30, 7, 15, 30,132, 92, 46, 71, 66, 66,
- 2,212, 75,191,195,127, 25, 28, 7,144, 70,181, 8, 5, 5, 5,197, 85,136, 45,169, 84,186, 62, 62, 62,190, 28,158,231,165, 10,
- 27, 57,114,100,137,221,110, 39,103,207,158, 37,104, 24, 61, 8, 47, 66,139,156, 61,123,150, 68, 71, 71,231, 3, 8,243,112,204,
-216,152,152,152, 34,165, 82,121, 20, 77,156,214,161,125,251,246, 21,167, 78,157, 34, 69, 69, 69,100,221,186,117, 36, 34, 34,162,
- 37, 70, 4,166,118,236,216,177,178,174,174,142, 24,141, 70,146,147,147, 67, 18, 19, 19, 43, 64, 71, 30, 82,252,243, 17, 12, 96,
-106, 74, 74,138,241,227,143, 63, 38,235,215,175, 39, 11, 22, 44, 32,211,166, 77, 35,227,199,143, 39, 25, 25, 25, 36, 35, 35,131,
-140, 26, 53,138,188,242,202, 43,228,246,219,111, 39,106,181,186, 22,192,189, 52,233, 40, 40, 40, 40,154, 23,137, 0,102, 57, 4,
-213,202,145, 35, 71,150,152, 76, 38,114,225,194, 5,242,195, 15, 63, 16, 52, 76,221,224, 9,111,150,150,150,146,210,210, 82,113,
-106,132,124,252, 49,173,195, 87, 14,222,171, 18, 65, 73, 73, 73, 21,251,247,239, 39,133,133,133,100,237,218,181,196, 33,216,154,
- 13, 10,133, 98,131, 86,171, 37, 70,163,145,108,218,180,137, 78,239, 64,113, 45, 34, 10,192,220, 27,110,184,193, 58,123,246,108,
-178,114,229, 74,242,217,103,159,145, 17, 35, 70,144,215, 95,127,157, 60,248,224,131, 36, 50, 50,210, 4, 32, 11, 64, 8, 77,174,
-171, 7, 93,217,156,114, 82, 78,202,233,142,245,199,143, 31, 39, 34,236,118, 59,185,112,225, 2,217,176, 97, 3,137,137,137, 57,
-134,198,243,105,185,114,106, 58,119,238,124,242,212,169, 83,228,252,249,243,196, 98,177, 56, 57, 78,158, 60, 73, 0,108,109,134,
-112,166,198,199,199,151,111,217,178,133,156, 58,117,138,196,196,196, 20, 53,103,220,147,146,146,202, 43, 42, 42,200,166, 77,155,
- 72,100,100,164, 63,145, 69,243, 18,229,252, 39,115, 38, 1, 88,220,163, 71, 15,251,156, 57,115,200,211, 79, 63, 77, 18, 19, 19,
-237,142,151,162,248,235, 73, 8, 93,223,179,180, 82, 80, 80,252, 21,144,239,222,189, 27,114,185,220,185,227,247,223,127,119,157,
- 71,203,219,188, 13,218, 19, 39, 78,220, 50,124,248,240,109,115,230,204,233,236, 58,138,105,203,150, 45, 0, 96,106,134,176,229,
- 94,184,112,161,255,176, 97,195, 62,141,136,136,184,177,180,180,244,157,230,140,120, 97, 97,225, 43, 93,187,118,157, 94, 87, 87,
-167,213,235,245,163, 64,231,206,162,184,118, 81, 8, 96,244,129, 3, 7, 62, 60,112,224,192, 91, 0, 8,128,247, 1,156,184,222,
- 18,130, 10, 45, 10, 10,138, 63, 27, 99,159,124,242, 73,247,206,226,251, 0,252,159, 15,145, 37,226, 82, 65, 65, 65,159, 59,239,
-188,243, 57, 52, 30,157, 40,118, 78,111, 14,228,154,205,230,161,238, 35,165,154, 9, 75, 74, 75, 75,151,208, 44, 64,113, 29,225,
- 24,128, 7,175,231, 4,160, 66,139,130,130,226,207,198, 57, 0, 79, 92,197,249, 90,120,158,103,139,130,130,130,226,111, 7,186,
-168, 52, 5, 5, 5, 5, 5, 5, 5, 5, 21, 90, 20, 20, 20, 20, 20, 20, 20, 20,255, 44, 48,240, 62,114, 32,187, 9, 60, 87, 50,
-162, 33,155,114, 82, 78,202, 73, 57, 41, 39,229,164,156,215, 29,167, 63,238,108, 80,180,168, 0,163,156,148,147,114, 82, 78,202,
-249,207,230,100, 28, 27,235,216,196,223,127,231,184, 51,127,227,184, 95, 47,156,215, 36,254,170,206,240,226,141, 16,208, 48,228,
-147,226,239, 7,215, 2, 66,232,125,162,160,160,104, 98,221, 33,113,121,216,218, 29, 27,254,134,117,137,171, 40, 16,174,242,185,
-212, 18,113,191,158, 57,175,121,161,117,163, 74,165,154, 44,147,201, 82, 24,134,177,235,116,186, 35, 38,147,105, 62,128, 93, 87,
-121,205,175,162,163,163,199, 86, 85, 85, 9, 44,203,130,101, 89, 48, 12, 3,150,101,193,243,188,161,182,182, 86,115, 37,164,145,
- 93, 70,188,202, 49,204, 11,118, 98,159, 95,126,116,213, 52,127,251, 41,124, 23, 24,169, 84,122, 95,120,120,120,104, 69, 69, 5,
- 97,217,134,174,124, 18,137, 68, 92, 8,215, 86, 91, 91,251, 77,160,100, 97, 97, 97,123,195,195,195, 67,197,243, 25,134, 65, 85,
- 85, 85, 77,121,121,249, 77, 0, 16, 20, 20,180, 67,165, 82, 69,112, 28, 7,137, 68, 2,137, 68, 2,189, 94, 95, 85, 85, 85,117,
- 11,189, 21,255, 76, 44, 95,190, 92, 50, 44,254,137,118, 28, 49,116, 99, 89, 18, 34, 8, 76,173,141, 81,252,190,254,194, 87,103,
- 2, 57,127,212,168, 81,118,154,138,127, 30,100, 50,217,236,232,232,232,127,215,215,215,235, 25,134, 33, 12,195,128, 97, 26,222,
-179,220, 63,237,118,123,113, 85, 85, 85, 79, 63, 15, 91, 94, 38,147,205,140,137,137, 25,163,215,235,245, 14, 62,143,188, 0, 96,
-181, 90,139, 43, 43, 43,123, 6, 84,215, 71, 70,206, 87, 40, 20,143,234,245,122, 29,195, 48,130,235,127,132, 16,215,135,249,217,
-202,202,202,126,254,132,129, 76, 38,251, 52, 58, 58,250, 95,142,184, 59,195,121,181,113,143,142,142, 30,163,211,233, 2,226,244,
- 17,247,203, 56, 91, 34,156,127, 83,206,107, 95,104,165,167,167,127,183,103,207,158, 14, 60,207, 3, 0,140, 70, 99,215,185,115,
-231, 62,246,198, 27,111,100, 1,152,120,133,215, 91,216,175, 95,191,135,114,114,114,216,149, 43, 87,178,189,122,245, 2,195, 48,
-176,219,237,176,219,237,232,210,165,139,226, 74, 35, 18,162, 82, 78, 56,184,241,191, 65, 55, 14,121,242,133,114, 96,154,191,253,
-190, 4, 38,128,183, 1,164, 52, 49, 8, 21,142,116, 57,232, 69,108,236,100, 89,182, 73,156,130, 32,228, 95,186,116,169,143, 15,
- 1,211,236,156, 14,145,117,127,191,126,253, 66,178,179,179,153,162,162, 34, 70,161, 80, 64, 16, 4,216,237,118, 88,173, 86,220,
-112,195, 13, 77,114, 66, 67, 67, 67, 53, 19, 38, 76,104,119,199, 29,119,224,135, 31,126,192, 99,143, 61,134,190,125,251,230,149,
-151,151, 3, 0, 84, 42, 85,196,241,227,199, 59,132,135,135, 67,175,215,163,182,182, 22,183,221,118, 27,170,170,170,254,209,133,
-235,230,244,132,247, 25,150,113,206, 21, 69,108,246,234, 61,191,151,188,125,181,188,225,225,225, 7,229,114,121,180, 95,181,236,
-242, 32, 51, 26,141,101,213,213,213,221,253,156,146, 4,224, 46,137, 68,210,158,227,184,142, 0,146,108, 54, 91, 52, 0, 72,165,
-210, 50,137, 68, 82,104,181, 90, 79,153,205,230,211, 0,126,129,143, 5,144,135,197, 63,209,142,177,233, 71,214,153,132,225,202,
-182, 89,169,250,179, 19,114,149,114,253,218, 97,241, 79,172, 8, 84,108,253,133, 72, 5,176, 12, 13, 11, 74, 63,141,134,121,128,
-174, 6,241, 0,238, 70,195,154,143,201, 22,139,165, 18,192, 1, 52,244, 67,201, 3,144, 24, 25, 25,185, 68, 16, 4, 83, 85, 85,
-213, 19,240,176, 80,117,239, 30,173,247,179, 44,155, 32,122, 2, 2,177, 23,239, 62, 80,220, 44, 15, 40,150,101, 63,205,204,204,
-252,215,138, 21, 43,148, 7, 14, 28, 80,118,238,220,217,249, 66, 36, 8, 2, 26,107, 23, 32, 57, 57,217,159,171,193,177, 44, 59,
-123,228,200,145, 15, 47, 94,188, 88,121,238,220, 57,101, 92, 92,156,147,211, 85,108,137,136,139,139, 11, 52,239,127, 53,116,232,
-208,209,139, 22, 45,226, 87,173, 90,165,104,213,170, 21, 34, 34, 34, 32,149, 74, 47, 59,246,150, 91,110, 17,252, 71,157,253,244,
-158,123,238, 25,253,253,247,223, 43,247,236,217,163,236,210,165, 11, 36, 18,201, 85,199,125,196,136, 17, 15,127,247,221,119,202,
- 35, 71,142, 40,219,183,111, 15,209, 84,112,231, 99, 89, 22,173, 91,183, 14,136,243,238,187,239,126,120,217,178,101,202,131, 7,
- 15, 42, 59,118,236,232, 76, 79, 66,200, 21,135,243,111,206,121, 93, 56, 90, 50,139,197,130,173, 91,183,130,101, 89,132,135,135,
- 99,236,216,177,216,184,113,227,132, 77,155, 54,173,190, 2,103,235, 43,135,200,226, 1,224,199, 71, 71, 32,159, 7,198,149,155,
- 33,149, 74,113,246,236, 89, 72, 36,146, 38, 91,139,114,185,124, 12, 33,100,146,254,194, 62,185,193, 96,133,177,100,191, 82,161,
- 80, 56, 31, 0,250, 18,199,254,139,251,149, 10,133,226,172, 68, 34,153, 90, 95, 95,191,208, 27, 95,251,246,237,191, 61,118,236,
- 88, 39, 79, 5,215, 23,244,122, 61,218,180,105,147, 88, 93, 93,221,222,211,255, 60,207, 39,156, 59,119, 46, 74, 38,147,129, 16,
-226, 44,196,238,159,226,119,139,197,130, 27,110,184,193,226,235,154,190, 56,109, 54, 27,130,130,130, 32,186, 81,102,179, 25,245,
-245,245,254, 56, 25,169, 84,122,159, 40,178, 0, 96,233,210,165,136,137,137, 65, 84, 84, 20, 84, 42, 21, 20, 10,133,147, 51, 80,
- 72, 36, 18, 12, 27, 54, 12,239,190,251, 46,178,178,178,240,218,107,175, 53,170,104,121,158, 71,120,120, 56,214,173, 91, 7,141,
- 70,131,196,196, 68,136, 2,255, 31,109, 11,178, 76,248,174,253,231,157, 14,237,237,183,118,226,110,238,206,125,238,120, 84,130,
-101, 1, 65,104,120,116, 50, 12,136,205, 42, 92,218,127,164,228,157, 0,210, 51,174,176,176, 48, 42,208, 52,178,217,108,136,139,
-139,147,248, 57,108,120, 90, 90,218,143,207, 62,251,172,180,125,251,246,140, 84, 42, 5,199,113,224, 56, 78, 20,232,137,132,144,
- 68, 65, 16, 6,150,149,149,145,185,115,231,126,184,101,203,150,123, 1,172,245, 88,177, 16, 67,183, 58,147, 48,124,219, 33,220,
- 52,114,200, 27, 88,183,124,194, 77,253,210, 5, 4, 43, 13,103, 0,252,157,133, 86,106, 90, 90,218,161, 61,123,246, 4, 89, 44,
- 22,244,238,221,123,119,110,110,110, 15, 92,217, 12,238, 97, 0, 62,153, 56,113,226,232,103,159,125, 86, 18, 26, 26, 10,153, 76,
-134,186,186, 58,156, 57,115,102,204, 55,223,124, 67,190,248,226,139,255, 3, 16, 92, 88, 88,152,177,119,239, 94, 12, 26, 52,232,
- 69, 0, 47, 95,174, 8, 36, 9, 59,246, 22, 68,137,191,239, 30,214, 85,154,209,147, 45,107,112,113,220,143, 38, 16,236, 66,241,
-222,195, 23, 2, 17, 98, 31,142, 24, 49,226,145, 21, 43, 86,168, 1, 96,222,188,121,184,239,190,251, 16, 30, 30, 14,165, 82, 9,
-169, 84, 10,158,231, 27,125,250,121,216, 74, 0,124,248,224,131, 15,142, 92,188,120,113, 48, 0, 44, 94,188, 24, 35, 70,140, 64,
- 68, 68, 4,130,131,131, 33,147,201, 32,145, 72,154,156,152,225,225,225, 95,245,189,233,166,199, 23, 45, 90, 4, 0,120,235,165,
-151,112,199,205, 55, 67,173, 84, 64,169,144, 65, 76, 11,153,132,199,237,227, 94,240,171, 47, 1,124,124,223,125,247, 61,240,253,
-247,223, 7, 3,192,129, 3, 7, 80, 94, 94,142,232,232,104, 40, 20, 10,200,100, 50,103,156, 25,134,129, 66,161, 8, 40,238,247,
-221,119,223,200,239,190,251, 46, 24, 0, 22, 46, 92,136, 97,195,134, 57,227, 46,151,203, 33,149, 74, 27,109,238,162,211, 19,231,
-189,247,222, 59,114,217,178,101,193, 0,240,205, 55,223, 96,200,144, 33, 8, 11, 11,115,166,167,200,213,148,123,244, 55,231,188,
- 62,132,214,161, 67,135,238, 87,169, 84, 51, 0, 68,202,100,178,208,135, 31,126,184,245,227,143, 63,142, 7, 31,124, 16,155, 54,
-109,122,170,137, 66,139,137,142,142, 30,155,147,147,227,124, 66,155,201,101,130,169,201, 15,112, 7, 38,237,127,234,169,152,172,
- 51,245,216,189,247, 20,130,192, 50,123, 63,254, 56,210,120,250, 52,236,102, 51,222, 59, 91,215,176,223, 70,152,173,175,140,139,
-185,113,246,255, 77, 2,176,208,135, 11, 32, 55,153, 76,200,203,203,107, 82, 32,138,138,138, 32, 8,130,201,151,187, 32,149, 74,
-113,244,232,209,203, 84,189, 39, 36, 38, 38,250, 42,128,126, 57,215,175, 95,143,241,227,199,227,212,169, 83, 16,151, 42, 9,128,
-147, 9, 15, 15, 15, 21, 69,150, 40,130, 20, 10, 5,120,158,103, 56,142, 99,196,166, 61, 71,225, 10, 72, 24,179, 44,139,111,191,
-253, 22, 31,124,240, 1, 94,127,253,117,204,159, 63, 31,221,186,117,251, 35, 19,114, 28,180, 90, 45,194,194,194, 16, 22, 22,214,
- 72, 32,254,147,225,126,155,103,206,154,163,132, 64, 26, 58,129, 16, 1, 16, 0, 2, 2,129, 8, 40,187,112, 6,147,223,253, 40,
-224,167, 15,207,243, 56,125,250,180, 51, 31,136,206,176, 40,140, 92, 93,131,164,164, 36,191,121, 73, 42,149, 78,249,249,231,159,
-101,223,126,251, 45,190,255,254,123, 48, 12, 3,185, 92, 14,149, 74,133,208,208, 80, 68, 68, 68, 56,183,132,132, 4,230,127, 61,
-184,254,121, 0, 0, 32, 0, 73, 68, 65, 84,255,251,159,180, 91,183,110, 83,180, 90,237, 90,207,247,156,132, 40,219,102,165,142,
- 28,242, 6, 0, 96,228, 27, 4,151,242,166,221,200,214,188,243,119, 94, 68, 54,181,107,215,174,219,119,238,220, 25,164,215,235,
- 33, 8, 2,214,174, 93,171, 28, 50,100,200,182,130,130,130,126, 77, 21, 91, 73, 73, 73,171,118,238,220,121, 75,100,100, 36,106,
-107,107,161,213,106, 97,181, 90, 33,145, 72,144,152,152,136, 15, 63,252,144,185,231,158,123,158, 31, 51,102,140, 81,161, 80,136,
-206, 70,146,231,188,212, 56, 51,205,253,236,243, 80, 66, 26,242, 15, 17, 72,163,207,234,242, 66,188,244,202,228,128,194,216,186,
-117,235,167,127,248,225, 7,181,171,179,228, 42, 2, 92, 69,150,184,249, 17, 6,108,155, 54,109, 30, 95,178,100,137,147,179, 85,
-171, 86,224, 56, 14, 60,207,131,227, 56,176, 44,139,109,219,182, 97,198,148,137, 8,139,140,195,156,207,230,249, 13,103,100,100,
-228,252, 97,195,134, 61,186,112,225, 31, 85,119,215,182,109,113,231, 45, 55, 35,170,149, 6,173,194,130, 27,210, 73, 96,240,251,
-169, 2,191,207, 35, 0,108,235,214,173,159, 88,190,124,185,218,245,133, 80,140,171,248,242, 44,186,248,102,179, 25, 61,123,246,
- 12, 40,238,174,156,162,219, 38,138, 54, 49, 61,197,235,136,229,213, 79, 56, 31, 23,133,176, 67,112, 54,226,224,121, 30,203,215,
- 45,242,234,102, 95, 41,103, 83,239,187, 59,103, 97, 97, 33,166, 79,159, 14,241,165,205,181,171, 80,124,124, 60,230,204,153,227,
-183, 94,114, 43, 3,189, 0, 68,186,236, 50, 3,144,185,124, 86, 48, 12,179,207,195,113,226,126,222,209, 98, 21,137,134,126, 99,
-117, 0, 66, 61,240,121,227,169,116, 60,243, 34,221,142,111,116, 29,175, 66,107,245,234,213, 98, 41, 30,152,153,153,185,213,241,
-189, 70, 46,151, 23, 41,149,202, 24, 0,117,107,215,174,197,127,254,243, 31, 56,172,213,187, 67, 66, 66,142,121,112,117, 14,153,
- 76,166, 55, 0,148, 57,118,137, 67, 52,217,234,234,106, 97,227,198,141,236,226,123,135,194, 76,128,244, 73, 51, 48, 44, 51, 19,
-235,227,101,144, 0,184,233,100, 37,148, 74, 37,167,213,106,173,174,253,182, 60,244,221,202,118,203, 80,146, 32,142, 67,239,237,
-107, 48,126,251, 26,220,164,146,161,106,197, 50,212,237,200, 1,203, 50,232,175,106,133,215, 30,217,136, 62, 26, 57,100, 38, 29,
- 88,150,245,148,179,157,156,121,121,121,163, 52, 26,205, 12,183, 4, 14, 4,249,104, 88,199, 9, 94,194, 9, 66, 8,186,117,235,
- 6,134, 97,156,110,129,184,137,133, 78,220, 14, 30,244,216, 2,233,149,211,209, 4, 7,149, 74,133,223,126,251,205,121,204,224,
-193,131, 97, 52, 26, 17, 30, 30, 30, 16,103, 69, 69, 5, 41, 41, 41, 97, 22, 47, 94, 12,158,231, 17, 17, 17, 1,165, 82,201, 44,
- 90,180,104,162, 84, 42, 77, 48, 26,141,130,217,108,134, 76, 38,155, 35,222, 31,142,227,116, 90,173, 54,194, 27,167, 68, 34,193,
-179,207, 62,139, 87, 95,125, 21,243,231,207,199, 83, 79, 61,117,153,227,101, 52, 26,209,170, 85, 43,167,216,242, 80, 0, 91, 98,
-184,111,203,114, 10, 4,199, 14,174,199,241, 35,217, 16,236, 2,236, 2, 1, 33,118, 8, 54,224,192,198,221, 29, 46,230,151,196,
- 19,144,134,174,183, 0,228,181,245,182, 1, 17,178,142, 0, 86,110,173, 50,207,246, 23, 78,142,227, 96, 52, 26,241,243,207, 63,
-227,228,201,147, 88,187,118, 45, 12, 6, 3, 90,181,106,133,208,208, 80,220,124,243,205, 24, 51,102, 12,146,146,146,252,198,157,
- 16,178,176,168,168, 40,189,111,223,190, 76, 77, 77, 13,106,106,106, 96, 48, 24, 96,183,219, 97,179,217,192,113, 28,130,130,130,
-160, 80, 40, 16, 29, 29, 13,163,209, 72, 76, 38,211, 66,111,156,130,192,212,234,207, 78,200, 93,183,124,194, 77, 35,223, 32, 88,
-241, 1,131,118,109,228,250,223,246, 7, 63,190,114,251,107,183, 1, 32, 2,113, 90, 11,196,106, 23, 42, 95,157,248,201,243,127,
-250, 61,186, 92,100, 69, 24, 12, 6,212,213,213, 53,216,250, 50, 25, 86,172, 88,209,234,174,187,238,202, 41, 41, 41,233,239, 67,
-108, 93,198, 25, 28, 28,156, 40,145, 72,112,244,232, 81,124,241,197, 23,248,237,183,223, 80, 86, 86,118, 41, 46, 46, 46,100,224,
-192,129,236, 75, 47,189,132,244,244,116,124,253,245,215, 65,254, 56, 9, 33, 40,204,219,134,194,211,219, 33, 8, 13,174,117,195,
-230,249, 59, 9, 48,238, 58,157,206,120,232,208, 33,245,151, 95,126,137,168,168, 40, 36, 39, 39, 67,169, 84, 34, 40, 40,168,209,
- 67,214,245,193,235,175,108, 26, 12, 6, 99, 97, 97,161,250,187,239,190, 67, 68, 68, 4,146,146,146,160, 84, 42, 33,147,201,192,
-113, 28, 24,134,193,226,197,139,177,244,221, 71, 80,120,234, 8, 70,220,121,155,223,112, 42,149,202, 71, 23, 46, 92,216,200, 2,
-137, 14, 11, 3,199,179,144,240, 12,194, 6,223, 11, 0,184,180,233, 39, 95,179, 67,186,114, 50,117,117,117,198, 61,123,246,168,
-247,239,223, 15, 65, 16,144,148,148, 4,189, 94, 15,141, 70,227,140,255,198,141, 27,113,207, 61,247,224,219,111,191, 69, 70, 70,
-134,223,184,215,215,215, 27,143, 28, 57,162, 94,178,100, 9,194,195,195,209,186,117,107,103,220,197,141,231,121, 72, 36, 18,164,
-164,164,160,182,182, 22,106,181,218,239, 61, 58,112,224,128,122,201,146, 37, 8, 11, 11, 67, 66, 66,130,211,113, 19,197,209, 7,
-159,191,219,136, 32,136,137,189,106,206,166,222,119,119,206, 17, 35, 70,160, 93,187,118,208,104, 52, 80,169, 84, 78,110, 95,156,
- 94,180,136, 83,111, 51, 12,179,218,165, 76,100, 50, 12,179,218,245,211,219,113,142,175,253, 39, 78,156,216, 51, 43, 43,107,122,
- 70, 70,198,119, 59,119,238, 92,234,141,207, 27,207,196,137, 19,211,178,178,178,166,187, 30,239,225, 58,222, 29,173,204,204, 76,
-198, 17, 73, 6, 64,114,143, 30, 61,246,109,218,180, 41, 60, 56, 56,216,121,240,249,243,231, 81, 83, 83,131,224,224, 96,205,204,
-153, 51, 53, 3, 7, 14, 68,116,116,180,243, 13, 32, 47, 47,239,134,212,212, 84, 45, 0,119,223, 86, 96, 89, 22,125,250,244,193,
- 49, 71,107,199,176,204, 76, 36, 36, 36, 56, 59,121, 4, 5, 5,225,249,231,159,103,198,143, 31,207,137,110, 6, 33, 4, 6,131,
- 1,177,177,177, 10, 95,174, 14, 0,164, 25, 42,241,211,192,254, 96, 25, 64,127,112, 47,164, 50, 6,172,132, 65,119, 82,133, 95,
- 7,245, 7, 3,192,124,120, 23, 2,112, 97, 14, 2,184,173,101, 28, 14,130, 51,103,206, 4,228,104, 57,226,197, 92, 41,167,232,
-104,236,220,185, 19,118,187, 61, 80, 78,194,178, 44, 84, 42, 21, 98, 98, 98,160, 80, 40,160, 84, 42,153,239,190,251,238,237,228,
-228,228,216,241,227,199,179, 90,173,150,237,211,167, 15,238,187,239, 62, 78,108,226, 76, 75, 75,243, 27,151,173, 91,183,226,139,
- 47,190,192, 83, 79, 61,229,209,209, 98, 24, 6,145,145,145,208,104, 52,184, 86, 32, 0,176,216,172,208,215, 27,156, 77,186,118,
-187, 29, 71,182, 28,238,144,127, 56, 47,109,245,119,223,242, 0, 96,220,242,147,235,105,177,247,125,190, 44,117, 64, 24,191,103,
-235, 37,235, 30, 95,121,158,227, 56,140, 29, 59, 22, 89, 89, 89,120,244,209, 71,177,118,237, 90,188,243,206, 59,248,247,191,255,
-125,153,171,229,239,205,209,106,181,254,247,177,199, 30,123,106,197,138, 21, 29,223,120,227, 13, 86,116,180,148, 74, 37, 24,134,
-129,209,104,132,201,100,130,193, 96,192,169, 83,167,132, 39,159,124, 50,215,108, 54,255,215,107,115, 37,163,248, 93, 41,215,175,
-109,155,192,182,211, 21,124, 20,220,247,230, 36, 3,163,232, 81,123,111,234, 16, 50,124,108, 82, 24, 8, 1, 17, 0,129, 0, 38,
-147, 14,207, 63,255,162,228, 47,188, 85, 78,145,101, 52, 26,113,232,208, 33, 12, 26, 52, 8, 69, 69, 69, 56,113,226, 4, 58,116,
-232,128, 69,139, 22, 69, 62,252,240,195, 57,229,229,229,253, 3,117,182,142, 28, 57, 50,241,198, 27,111,252,180,190,190,190,186,
-190,190,254, 83, 0, 75, 1,212,156, 57,115,166,243,153, 51,103,230,174, 95,191,190,223,228,201,147, 37,110,125,116, 36,222,236,
- 81,171,213, 6,131,193,228, 83, 96,137,191, 9, 17, 2,138, 56,195, 48,164, 99,199,142,184,235,174,187,192,243, 60,148, 74, 37,
-212,106,117,163,102, 51,119,193,229,171,254, 0, 32, 48, 12,131,184,184, 56, 12, 31, 62, 28, 82,169,180, 17,167,152, 15,135, 15,
- 31,142, 23,222,155,132,255,190,112, 43,190,120,172, 3,134,188, 95,230, 51,156,122,189,190,126,243,230,205,138, 87,159,122, 10,
- 55,182,111,143, 86, 26, 13,218, 68, 71, 66, 33,151, 65,234, 26, 38, 38, 32,147,157, 0, 16, 36, 18, 9,186,116,233,130,178,178,
- 50, 20, 20, 20,160,160,160, 0, 44,203,162,111,223,190, 78, 23,230,244,233,211,120,239,189,247, 96, 50,153, 2,142,123,251,246,
-237,113,235,173,183, 66, 38,147, 65,169, 84, 54,106, 50, 20,211,180,174,174, 14,237,218,181,195,202,149, 43,145,154,154,234,151,
-179, 83,167, 78, 24, 48, 96, 64,163,244, 84, 40, 20, 78, 81, 4, 0, 69,123,234,157,215,136,143,143,111, 18,231,134,189,231,241,
-229,198,205, 48,153, 5,104,245,214, 70, 39,196,182,210, 96,251,146, 55, 2,138,187,200,185, 96,193, 2,212,212,212, 56,141, 3,
-241,165, 92, 52, 81, 90,183,110,141,121,243, 60, 59,153,110, 90,196,211, 51, 47, 51,192,231,173,120,156,152,185,228, 89, 89, 89,
-211,221,207,247,199,231,250,191,219,249,102, 55,113, 86,214,164,166, 67,185, 92,254,230,230,205,155,195,107,107,107,113,250,244,
-105,176, 44,235,108, 83,231, 56, 14, 22,139, 5,103,207,158, 69,120,120, 56,202,203,203, 33,151,203, 33,145, 72, 96, 54,155, 1,
-160,187,183, 7, 56, 33, 4, 47, 84, 52,116, 17, 90, 23, 39, 69, 33,128, 59, 43, 26, 10,134,216, 33,254,135, 31,126,128, 90,173,
- 70,112,112,176,243,211, 95, 51,210,145,130, 51, 40,227, 25,176,187,182,129, 97, 1,150, 1, 24, 9,192,178, 4, 44,195,128,221,
-149, 3,134, 1, 84, 17, 97, 77,173,128,253,117,140,247,217, 1,222,155,251,228,201,197,114,255,190,101,203, 22, 4,202,217,174,
- 93, 59,168,213,106,231,182,126,253,250, 70,142,150,221,110, 71, 68, 68, 68, 32,156,164,193,141, 16, 16, 21, 21, 5,158,231,153,
- 69,139, 22, 77, 76,249,127,246,174, 59, 60,138,106,125,191, 51,219,119,147,108, 54, 61, 33, 33,148, 0, 82, 34, 77,225,194,165,
-151, 0, 66,104, 34, 69, 46, 4, 17, 81,138,168, 40, 17,129, 31, 42, 32,161, 73,147, 42,200, 37, 32, 72,151, 46, 69,164,131, 5,
- 20, 36,129, 64, 8, 9,164,111,234,246, 50,237,247, 71,118,227,102,179, 73, 54, 33,194, 5,231,125,158,121,118,167,189,115,206,
-156, 51,103,222,243,157,239,124,211,176, 97,200,244,233,211, 73,129, 64,128,235,215,175, 35, 33, 33, 1,245,235,215,119,219,103,
-171,168,168, 40,235,147, 79, 62, 97, 62,249,164,100, 14, 69,100,100, 36,138,138,138,114,237,251, 53, 26, 77,126,159, 62,125,202,
-248,109,228,229,229, 61,219,158,240,182,251, 72, 91,105, 24, 76, 38,232,180,134, 82,235, 80,110,102,142,234,227, 15, 63, 16, 45,
-155,250, 6, 0,224,195,149,107,160,221,248, 87, 67,118,224,195, 81,129, 67,191,220, 53, 19,192,224,202,248,117, 58, 29, 76, 38,
- 19, 34, 34, 34,112,249,242,101,104,181, 90,244,235,215, 15, 4, 65,148,206, 16,173, 6, 44, 25, 25, 25,157,162,163,163,127, 93,
-177, 98, 69, 68,243,230,205, 9,189, 94, 15,131,193, 0,199,223,155, 55,111,114, 59,119,238, 76, 49, 24, 12,255,182,153,206, 93,
-226, 68,198, 55,201,125, 67,223,220,251,227,117, 65,116, 96,163, 36,101, 70, 97, 4,157,159, 33,213,107,140,119, 76, 12,151, 0,
-142, 1, 24,176,224,104, 22,140,109,216,235,105, 65, 46,151,127,117,241,226, 69, 63,147,201,132,107,215,174, 97,204,152, 49,150,
-188,188, 60, 9, 0,252,231, 63,255,177,108,223,190, 93,210,168, 81, 35,108,219,182, 45,224,213, 87, 95,221,163,215,235, 95,116,
-147,250,219,172,172,172,111,157, 55,250,249,249,173,126,248,240, 97,119, 71,159, 31,154,166, 75,147,227,242,193,100, 1,138,162,
- 96, 52,154, 81, 92,172,133,197, 74,217,218, 76, 22, 12, 67,219,126, 89,208,182,118, 84, 34, 22,122,181,125, 49, 88,199,113, 28,
- 72,130, 40,186,246,103,118,221,202, 68,187,171, 33, 46, 55,173, 89,206, 96,236,179,204,252,252,252, 32, 18,137,240,237,183,223,
-226,198,165, 19,144, 8, 56, 48, 52, 5,154,178,130,161, 44, 16, 9, 4,248,241,250, 3, 68, 53,243,114, 75, 16,250,251,251, 99,
- 64,199,142,136,238,216,177,100,122,155, 80, 8, 79,169, 20, 10,177,172,196,146, 5,128, 99, 72,119,131, 8,176,246,116, 6, 5,
- 5,225,183,223,126,195,180,105,211,176,120,241, 98,200,229,242,210,217,207,183,111,223,198,238,221,187, 17, 21, 21, 85,237,188,
-219, 45,120, 51,103,206, 68,102,102, 38, 86,174, 92,137,151, 94,122, 9, 34,145, 8, 69, 69, 69,248,247,191,255,141,156,156, 28,
-183, 56, 29,135,247, 36, 18, 73, 25,235,147, 93, 0, 86,183,140, 28, 57,223, 24, 18,130, 67,151,118,130, 0,129,171, 59, 62, 40,
- 35, 10,215,239,186, 80,109,206,185,115,231,150, 73,167, 59,214, 44,119,225,100,117,170,242, 56,130, 32,174,217,141,173, 51,103,
-206,156, 69, 16,196,145,153, 51,103,206,138,139,139,187,229, 14,159,171,253, 4, 65, 28,181,137,176, 1, 14,219,174, 85, 75,104,
- 41, 20,138,246,158,158,158,184,119,239, 30,250,245,235,103,201,207,207, 79, 18,137, 68, 77,242,242,242,164,185,185,185, 48, 24,
- 12,186,249,243,231, 63, 0, 32,239,208,161, 67,163, 31,127,252, 17,143, 30, 61,194,246,237,219, 1,224,128,107,159, 13, 18, 44,
-203,150, 86, 10,231,110,155, 64, 32,192,149, 43, 87,112,229, 74, 89,215,175,205,155, 55, 87,249,194,120,245,251,195,184,126,253,
- 58, 28,195, 3,216,255, 59,110,147,201,100, 64,229, 51, 60,202,160, 42,199,248,170, 28,224, 93,193, 93,223, 47, 87, 51,115, 42,
- 66, 70, 70, 70,133,231, 95,185,114,165,140, 69,171, 42, 78,129, 64, 0,134, 97, 32,151,203, 9,177, 88, 76,136,197,226, 48,187,
-200, 18, 8, 4,165, 15,140, 84, 42,133, 84, 42, 45,211, 75,173, 8,153,153,153, 61, 50, 51, 51, 43,220,175, 86,171, 59,169,213,
-106, 60,143,176, 82, 20,140, 6, 11,180, 58, 35, 62,143,251,111,201,198,207,241, 51,128,159, 59,189, 51, 13,147,251, 70,245,172,
-238, 48,181,253,126, 7, 6, 6,226,220,185,115, 32, 8, 2,123,246,236,129,183,183, 55,250,246,237, 11,165, 82,137,153, 51,103,
- 98,248,240,225,213,109,204,138,243,243,243, 59,189,255,254,251,191, 46, 93,186, 52,188,110,221,186,176, 88, 44,176, 90,173,176,
- 88, 44, 72, 78, 78,198,206,157, 59, 31, 25, 12,134, 78, 0,138,171, 34, 59,145,241, 77,242,254,243, 31,102,246, 30,249,170,241,
-118,206, 15,200,206,206, 7, 77,103,128,101,104, 88,105,166,196,194, 71,211,160,105, 6, 98,177, 64,185,244,139, 15, 78,177,224,
- 64,146,132, 5,192, 43, 79,170,140, 84, 42, 85,164, 90,173,198,221,187,119, 17, 19, 19,147,157,159,159,159, 8,160, 23, 0,228,
-231,231, 95, 28, 51,102, 76,243,248,248,248,224, 6, 13, 26,192,211,211, 83,169,215,235,171,162,244, 4, 48, 25, 64, 31,148,248,
-129,216, 81, 0, 96, 62, 73,146,210,107,215,174,149,155,105,119,254,252,121, 0,248,217,117, 15,200,102,209, 50,153,160,206, 47,
-196,132,119,230,252,213, 51, 2, 87, 70, 92,112,224, 48,233, 93,200, 0, 32, 47, 39, 25,111, 76,152, 38,173,170, 67,224,234, 69,
- 88, 13, 31,157, 50, 29, 53,123, 29,245,244,244, 44, 25,126, 59,184, 19, 71,191,124, 7, 96,172,224, 40, 35, 96, 53, 0, 86, 29,
- 88,139, 1,132, 88, 14, 80, 70,183,132,150,167,167, 39, 60,229,114, 4,170, 84,224, 56, 14, 66,129, 0, 34,145, 16, 44, 5, 16,
- 12, 81, 42, 72, 89,247, 2,131,148,118, 42,229,114, 57, 82, 83, 83, 49,121,242,100, 88,173, 86, 12, 25, 50, 4, 22,139, 5, 38,
-147, 9, 70,163, 17, 13, 27, 54,132,193, 96,112,139,207, 62, 91,209,211,211, 19, 98,177, 24, 31,124,240, 1, 94,126,249,101,204,
-155, 55, 15,177,177,177,104,216,176, 33, 38, 77,154,132,157, 59,119, 34, 50, 50,178, 42, 94,206,177,140,236,247,211, 46,182, 28,
-135,248, 0, 84,187,140,156, 57, 9,130, 44, 35,216,236,203,123, 99,123, 85,155,115,209,162, 69, 80,171,213,229, 44, 89,246,255,
-161,161,161, 88,183,110, 93, 77, 71,134,236,214,163, 32, 23,251, 6, 56, 91,162, 56,142,107,103,243,157, 50,199,197,197,221,138,
-139,139,139, 38, 8,226, 72, 92, 92, 92,116, 69, 22, 45, 87, 60, 46,246,187,253,210, 18, 58,141,141,118,119,220,105,191,209,190,
-190,190,130,240,240,112, 82,169, 84,162,168,168, 8, 1, 1, 1,156, 90,173, 30,169, 80, 40, 62,251,238,187,239, 26,233,116, 58,
-220,190,125, 27,171, 87,175,254, 25,192,170,202,132,214,177, 0,155,233,216,102,201,114, 92, 31, 56,112, 32, 26, 52,104, 80,198,
-154, 37,151,203, 43,173, 60,246,125,118,139,144, 64, 32,192, 11, 47,188, 32, 79, 73, 73, 49,138,197, 98,132,133,133,201,179,179,
-179,141, 98,177,184,218, 51, 93,170,114,140,175,202, 1,222,149,240,105,215,174, 93, 25, 11,150,227,175,227,255, 67,135, 14, 85,
- 57,116,104,231,108,222,188,121,233,253,242,242,242,178,159, 11, 0,232,215,175, 31, 88,150,133,191,191,191, 91,156,118, 81,107,
-115,128,135,201,100, 98,181, 90, 45,121,237,218, 53, 72, 36, 18,120,121,121,149,250,234,200,100,178, 82,107, 38, 15, 87, 13, 2,
- 11, 11, 69,193,104, 52, 66,167,211, 1, 0,146,255,220, 87, 86,136,153, 53, 53,230,183, 55,176, 5, 5, 5, 56,113,226, 4,126,
-248,225, 7,188,252,242,203, 46, 69,117, 53, 4,151,186,160,160,160,243,140, 25, 51,174, 46, 88,176,160,142,175,175, 47,172, 86,
- 43, 30, 62,124,136, 45, 91,182,100, 26, 12,134,206,213,105, 96,192, 1, 20, 69,195,100, 48,163, 88,163,197,103, 95,108,173,176,
-234, 1, 64, 65,238, 29, 12, 28, 52, 92,242, 36,203, 41, 51, 51,115,122,231,206,157,191,208,106,181, 69, 6,131, 97, 56,128,101,
-142,253,169,252,252,252, 46,131, 6, 13, 90,225,235,235,251, 82,110,110,238, 44, 55, 40,103,166,166,166,206,170, 87,175, 94,153,
-141,102,179, 25,245,234,213,123, 33, 55, 55,119,116,215,174, 93,255, 15,128,175,195,110, 47, 0, 39, 1,172,171,168, 46,217,135,
- 14,117, 58, 35,148,170, 16,100, 60, 56, 87,101, 66,196, 2, 19, 56,150,173,180, 13,177,119,128, 43, 90,170,152, 25, 87, 46,169,
-246, 99,237, 47,236, 87,134,141,197, 43,147, 23, 65, 33, 2, 22,190,209, 9, 13, 85, 0,228,190, 16,119,253, 24,132,202,118,143,
- 38, 31,118,139, 60,118,195, 6, 92,183,181,199, 97, 1, 1,152, 49,114, 36, 56, 10,184,156,144,128, 93, 63,253,132,145, 61,122,
- 64, 33,147,185,221, 97, 97, 89, 22, 98,177, 24,201,201,201,184,124,249, 50,154, 53,107,134,123,247,238,149, 9, 67,193,113,156,
-187,249, 47,205,187, 84, 42,133, 72, 36, 66,118,118, 54,162,163,163, 33, 22,139,177,117,235, 86,156, 59,119, 14, 51,102,204,192,
-248,241,227,209,189,123,119, 36, 38, 38,186,197,201,113, 92,185,217,138,206,195,185,213, 45, 35,103, 78,231,247,126, 77,202,221,
-206,185, 96,193, 2,151, 19, 42,220,225,116,165, 69, 92,148,221, 53, 71, 49,100,183, 60, 57, 10, 35,231,117, 0, 62,246,109, 51,
-103,206,156,229,238,121,142,235,118,139, 88,117,134, 48, 75,133, 86,116,116,116,153,156, 23, 20, 20, 92,189,122,245,106, 11, 15,
- 15, 15,220,185,115, 71,162, 84, 42, 91,216, 27,116,146, 36,177,103,207, 30,175,254,253,251,159, 90,182,108, 89, 24,203,178,200,
-201,201,193, 71, 31,125,164,163,105,122, 20, 0,186,162, 23,120, 85,150,169,195,135,203, 63,108, 7, 15, 30,116,107, 8,196, 46,
-164,132, 66, 33,124,124,124,140, 70,163, 17, 10,133, 2, 62, 62, 62, 70,131,193, 0, 15, 15, 15,251, 88, 49,137,191,102, 42, 84,
-101,125,170,202, 49,222,217, 1,190, 74, 36, 36, 36,184,117,156,109,168,213,173, 90,158,154,154, 90, 97, 67,114,238,220, 57,176,
-182,134,214, 93, 78, 91, 47,143,179, 11, 63,133, 66, 1, 95, 95, 95, 72,165, 82,200,229,242, 50, 34, 75, 42,149, 86,249,224, 84,
- 21,144, 84, 38,147,253,226,225,225,161,178,239, 23,137, 68,208,106,181, 69, 5, 5, 5,237,159,233,161, 67,112,160,173, 52,140,
- 70, 19,116, 90, 99,173,243, 91, 44, 22, 72,165, 82,236,220,185, 19,157, 58,117, 66,135, 14, 29,202,137,172, 26,154,231,211, 11,
- 10, 10,186,175, 90,181,234,231,229,203,151,251,232,116, 58,252,247,191,255, 45,214,233,116,221, 1,164, 87, 75,108,178, 28, 40,
-171, 21, 6,147, 25,122, 93,201, 61,184,127,107,223,255, 90, 81,237,204,206,206,222, 89,201,254,251, 52, 77, 71,219,227,190,185,
-129,127,213,171, 87, 15,217,217,217,101, 54,166,165,165,129, 97, 24, 51, 74,226,100,189,233,104, 72,198, 95,209,179, 43,234,197,
-151, 88, 71,141,102,232,116, 37, 86, 16,147, 62,175,118,234,169, 77,108, 84,228,147, 85,147, 58, 68, 16, 68,169,211,247,212,169,
- 83,113,243,198, 13,244,170,163, 65,195, 96, 47,112,154, 12,136,123,126,138, 63,212,114, 44, 91,113,172,218,220,187, 29, 92, 32,
-150,237,222,237,114,223,253,193,131,171,149,247,164,164, 36,200,229,114, 48, 12, 83,238,125, 83,221,252, 59, 10,152, 21, 43, 86,
- 96,198,140, 25,216,186,117, 43,110,222,188,137,214,173, 91,163,119,239,222,200,205,205,197,141, 27, 55, 96, 54,155,221, 78,167,
-163,223, 92, 82, 74, 2, 78, 95, 62,142,180,244, 7,200,204,126, 84,227,114,119,228,116, 22, 90,251, 79,255,142, 97, 81,109,107,
-196,249,217,103,159, 33, 55, 55,183,140, 37,203,177, 93,170,200,162,229,172, 69,156,144,231,228, 11,101, 95,183, 56,137, 30,231,
-117,231,227, 1, 32, 23,128,160,138,243,156,215,243,226,226,226,206,218, 45, 97, 54, 94, 65, 85,254, 89,101, 44, 90, 78, 88, 52,
-120,240,224, 65,171, 87,175, 14,144,201,100,165, 51,144,102,206,156,137, 25, 51,102, 32, 34, 34, 2,254,254,254,161, 42,149, 10,
-249,249,249, 88,188,120, 49, 82, 83, 83, 39,194, 69,160, 61,103,161,213, 37, 69, 11,137,228,175, 14,171,221,178, 5, 0,227,199,
-143, 47,103,209,178, 23, 80,101,160, 40, 10,126,126,126, 48, 24, 12, 16, 8, 4, 24, 50,100,136,224,207, 63,255,100,250,246,237,
-139,161, 67,135, 10,110,220,184,193, 12, 24, 48, 0, 2,129, 0, 61,123,246,212,236,223,191,255, 67, 0, 95,186, 33,182,106,205,
- 49,222, 94,201,220,141,125,228,142,184,172,140,147, 32, 8, 24, 12, 6, 8,133,194, 82, 71,121,119, 56,237, 67,135,142, 15, 32,
- 73,146, 80,169, 84,165,141,135,221,162,101, 23, 90, 85,241, 86, 21,144, 84,161, 80, 40,239,220,185,211,200, 62,241, 34, 47, 47,
- 15, 61,123,246,188, 91, 80, 80,240,108,155,180, 88,192, 74, 51,208, 25, 77,208, 25, 13,181, 70,107,127, 30, 54,110,220,136,196,
-196, 68,152, 76, 38,124,245,213, 87,165,147, 10, 28, 69,214, 99, 8,174,100,185, 92,206,246,235,215, 15, 87,175, 94,133, 84, 42,
-165, 80,131,248, 87, 44,199,194, 74,211, 48, 25,141,208, 85, 61,228,246,188,160, 84, 85, 39, 38, 38,194, 98,177, 96,222,188,121,
-204,175,191,254,122, 22, 37, 1, 80,237, 22,188,209,221,186,117,155,239,225,225,161, 58,122,244,232,123, 0,182, 86,246,242,166,
-104,155,104,175,197,251,232, 56, 34,224,202, 39,171, 38, 97, 86, 28, 95,172, 44,203, 98,226, 91,111,161,119, 29, 13,134,190, 20,
- 0,125,214, 93, 40,188, 3, 64,168,234, 99,217,138, 99,184,149,226,182, 43, 38, 7, 0,253,186, 13, 70,171,102,229,195,131,117,
-238, 85,210, 39,187,248,227, 47,200,201,203,172,118,222,245,122,125,133,150,171,106, 88,180, 74,159, 57,251,253,107,211,166, 13,
-154, 52,105,130,179,103,207,162,109,219,182,184,119,239, 30,238,221,187,135,212,212, 84,220,188,121, 19,133,133,133,213, 46,163,
-239, 79,238, 66,161,182, 0, 18,177, 4, 5, 69,121, 72,203,120,128, 32,191,224,199, 46,119, 59,154, 14,248, 12, 0, 80, 39,192,
-187, 90, 66,203,145,115,201,146, 37,229,196,251,227,134,236, 33, 8,226,151,202,214,171,123,254,147, 68, 69, 66,235,129, 90,173,
-238, 48,114,228,200,153, 0,218,217,182, 21, 3,216,125,234,212,169,193,129,129,129, 61, 58,118,236, 40,148, 72, 36,184,124,249,
- 50,246,239,223,191, 21,192,174,202, 46, 36,145, 72,140,245,235,215,151,219, 43,162,253, 65, 84, 42,149,130,197,139, 23, 19,155,
- 55,111,174,208,202, 85, 85, 1, 21, 23, 23, 67,175,215,195,219,219, 27, 86,171, 21,253,250,245, 99, 18, 19, 19, 33, 22,139, 49,
-104,208, 32, 38, 33, 33,161,180,160, 55,109,218, 20,102, 52, 26,255,253,195, 15, 63,244, 1,208,181, 26,247,202,238, 24,239, 9,
- 55, 29,224, 43,234,229,185, 3,119,135,227, 42,226,156, 54,109, 90,141, 56,197, 98, 49,109,143,252, 78,146, 36,172, 86, 43,218,
-182,109,139,220,220,220,210,135,198,195,195,163, 84,100,185, 35,180,170, 10, 72, 42, 20, 10, 97,177, 88,208,181,107, 87, 16, 4,
-129, 53,107,214, 60, 31,195,145, 44, 75,120,122,250,161, 78,157, 23, 16, 16,104, 2,203,214,238, 87,101, 98, 99, 99,203,136, 41,
- 87,145,151,237,247,191, 38,176,115,185, 51, 75,182,178,183,163,125,200, 75,175, 55, 61,115, 69, 24, 24, 24,216, 33, 55, 55,247,
-160,211,230, 2, 0,243, 43,233, 88,150, 22,244,163, 71,143,208,183,111, 95, 28, 63,126, 92,112,224,192,129, 94,135, 14, 29, 74,
-184,123,247,238,163,182,109,219,214,125,251,237,183,165, 93,187,118, 69, 94, 94, 30, 94,122,233,165,207, 51, 50, 50, 42, 17, 90,
-182,251,104, 50, 67,175,175,125,235,168, 43,107,214,227,188, 24,237,117,114,238,220,255, 67,239,144, 34, 12,105,237,141,248, 35,
-151, 48,186,141, 28,176, 72,171,205,103, 79,139,111,157, 6,168, 31,217,161,220,126,169,178, 36,150,107,253,200, 14, 32, 31,221,
-171,118,222, 29,211,236, 44,170,106, 98,209,115,188,159, 19, 38, 76,192,199, 31,127,140, 62,125,250,224,222,189,123, 56,127,254,
- 60,238,221,187,135,105,211,166, 33, 50, 50, 18,173, 91,183,174, 22,231,161,211,123,161,209, 21,131, 36, 72, 20, 20,231,195,100,
- 54, 34,118,210,220,199, 46,247,210,151,255,233, 56, 0,192,190, 83,215,107,204, 57,123,246,108,100,103,103,151,177,100, 61,142,
- 95,214,179,142,202,162,165, 61, 0, 48,209,121,163,197, 98,241,154, 55,111, 94,148,191,191, 63, 8,130,192,138, 21, 43,224,235,
-235,219, 9,192, 45,139,197,146,167,215,235,103, 56,136,144,222,176,197,218,200,201,201,113, 57,111, 95,175,215, 91,163,162,162,
- 68, 33, 33, 33,101,102, 27,122,120,120, 84,100,221, 41,229,180,239,163,105, 26,177,177,177, 88,184,112, 33,194,195,195, 49, 96,
-192, 0, 68, 71, 71,131, 32, 8,244,235,215, 15, 3, 6,252, 53,148,171, 82,169,196,199,143, 31,239, 70,146,100,130,195, 11,164,
- 12,167, 43,216, 29,227, 41,138,114,215, 1,190, 12,167,189,178, 77,155, 54, 13, 11, 23, 46,196,172, 89,149,187,122,108,216,176,
- 1, 40,239, 79,245,183,115, 22, 20, 20,148,105,236, 21, 10,197,154,161, 67,135, 10, 31, 61,122, 84, 70, 92, 57, 46, 46, 26,162,
- 50,156, 85, 5, 36, 21, 8, 4, 8, 10, 10,194,130, 5, 11,224,231,231,135,224,224, 96, 87,129,252,170, 44,163, 26,224,111,229,
-100, 56,246,218,210, 69,255,215,249,191,219, 15,137,164, 18,224,202,249,125,208, 20,150, 29, 78, 50, 91,255,154, 74, 45,105,219,
- 11,150,235, 63,186, 85,151,236, 98,250,179,207, 62,195,103,159,125, 86,105,130, 54,110,220,248,216,121,119, 83,108,149,231,100,
- 57, 66,225,225, 3,153, 71, 29,180,136,244, 1,203,209,255, 83,101, 84, 1,126,253,229,151, 95, 6,249,249,249, 33, 61, 61, 61,
- 64, 36, 18, 13, 42, 99,174, 50, 26, 81,191,126,253, 23,212,106,245,191,171,226,156, 54,109,154,121,206,156, 57,210, 81,163, 70,
- 97,232,208,161, 24, 53,106,148, 84, 44, 22, 55,230, 56, 14, 86,171, 21,233,233,233,248,241,199, 31,161, 86,171,111, 87,150, 78,
-150,227, 8,185, 66, 5,153, 71, 8, 90,188,168, 2,203,210,181,146,119, 71,171,184,163, 53,171,154, 34,203,101,253, 4,128, 95,
-127, 60,136,185, 31,188,136,173, 71,127,198,234, 95,128, 86,170, 92,180, 8, 80,131, 85,223,198, 71,163, 95,198,178, 29,191, 1,
- 0,206,159,171,178,140,184,202,234,160,201,104,125,172,188, 59, 90,174, 28,175,227,134,143, 86, 57, 78,123, 39, 81,171,213,162,
-168,168, 8,241,241,241,120,227,141, 55,144,155,155,139,212,212, 84,220,189,123, 23,223,125,247, 29, 20, 10, 69,141,202,232,195,
-183,102, 99,206,178,233,224,192,161,105,163, 22,152, 57,249, 51,180,107,213,241,177,203,221, 25,110, 88,179, 42,228, 92,185,114,
-101, 77,235,210, 63, 78,104,185,132,191,191,255,168,110,221,186,193,100, 50, 33, 32, 32, 0,169,169,169, 32, 73, 50, 2, 40, 25,
-194, 11, 13, 13,221,173, 86,171, 35,220,229, 19, 8, 4,160,105,186,212,247,199,190, 0,192,192,129, 3,113,248,240,225, 42,123,
- 20,193,193,193,168, 91,183, 46,222,127,255,253,114,179, 28, 28,103, 58,200,229,114, 28, 61,122, 52,187,160,160,160,128,227,184,
-106, 77,115,179, 59,198, 95,188,120,209,109, 7,120, 71, 88,173,214, 71,119,239,222, 13,217,184,113,163,160,146,151, 95, 41,206,
-159, 63, 79,163,138,161,154,191,131,211, 85,207,148,227,184, 10, 69,150, 59, 97, 4,170, 10, 72, 42, 20, 10,145,148,148,132,185,
-115,231,130, 32, 8,236,219,183,239,185,120,184,254,188,147,191,153, 36, 73,159,129,175,116,110, 9,130,128,213, 82,126,164,218,
-179, 80, 87, 42,178,134,126,185, 11, 7, 62, 28,233,142,232, 73,190,112,225,130,239,198,141, 27,133,238,148,251,133, 11, 23,104,
-142,227,170, 61,236,103,127,225, 88,173, 86, 24,141, 53,179,162,112, 28,119, 57,238,139, 57, 81,219,190, 61, 38, 34, 8, 11,174,
-156,219,135,226, 34,215,238, 12, 18,145, 16,155,227,247,211, 98,145,224,209, 83, 46,186,181, 67,134, 12, 25,245,213, 87, 95,181,
-112,181,211,141, 73, 48,169, 38,147, 9, 25, 25, 25, 48, 24, 12,123, 63,249,228, 19,235,177, 99,199,222,124,245,213, 87,209,186,
-117,107,132,132,132, 32, 43, 43, 11,201,201,201,136,143,143,231, 46, 93,186,180, 23,192,148, 42,238,227,193, 69, 95,204,137,137,
-223,113, 76, 66, 18, 86, 92, 57,191, 15,197, 78,162,189,188,117, 90,132,111,182,238,183,138,197,162, 59, 85, 89,139, 28,173, 89,
-181,249, 98, 28, 52,102, 50,134,174, 90,141,136,118,125,177,104,113,111,124,243,197,112, 44,239, 39,134,117,207,104,180,122,109,
- 27,118,206,235, 15, 0,168,243,141,155,214, 18,161, 24, 15, 93, 88,172,138,138,101, 54,113, 83, 61,171,169, 61,239,149, 89,174,
-170,107,209, 34, 73, 18, 13, 26, 52, 64, 68, 68, 4, 58,117,234,132,182,109,219,162, 71,143, 30,184,113,227, 6,110,220,184,129,
-105,211,166, 85, 38,178,170, 44,163,238,255,142,194,207, 93,238, 60,118,217, 56,151,123,109,192,157,186, 52,121,242,100, 0,248,
- 71, 89,183,170, 45,180, 52, 26,205, 13,150,101, 91,122,123,123,219, 45, 82,165,251,210,210,210,192,178,172,161,186, 5, 99,177,
- 88,236,193, 49,203,196,101,178, 59,199, 87,246,224,115, 28,199, 20, 20, 20,160, 91,183,110,232,210,165, 75,233,240,137,227,226,
- 32, 76,112,224,192, 1,112, 28, 87,109, 39,107, 7,199,120, 29,170,233, 0, 15, 0,185,185,185,125,187,118,237,122, 74, 40, 20,
-186,245, 21, 77,150,101, 83,115,114,114, 94,121,210,156,174,202,135,101,217, 10, 69,150, 59, 13, 81, 85, 1, 73,133, 66, 33, 60,
- 60, 60,240,253,247,223,195,223,223,255,185,122,192,110, 36,170,151, 84,182,191,155,159,228, 28,128,128,161, 95,238,122,120, 46,
-223, 90,111,232,151,187,210, 14,124, 56, 50,188,178,115,178,179,179,251,140, 28, 57,242,184,187,229, 78,211,244,131,236,236,236,
-106,135, 75,224, 56, 14,119,238,220, 97, 39, 76,152,144,167, 86,171,135,215, 36,255, 51,231,174, 94,190,240,243,169,126,253,162,
- 58,180, 3, 9, 88, 42,118,254,229, 8,128, 19,138, 4,143,102,204, 90,249,214,240,225,195,159,102,177,105,178,179,179, 59, 13,
- 27, 54,108, 10,254,114,157, 40, 35,164, 80,193,236,106, 27, 86,213,173, 91,247, 69,129, 64, 32, 5, 48, 23, 64,218,165, 75,151,
-214, 94,186,116,169, 15,128,127, 9, 4,130, 16,134, 97, 50,108,157,158, 93, 0,254,168,186, 30,229,190, 13,142, 13,235,215,251,
- 95,125, 65, 16,156,197, 98,174,162,131, 4, 14, 28,199,137,197,162, 59,191,222,200,106, 85, 89, 71,202,225, 11, 28,181, 62,100,
- 63,101,202, 20, 76,153, 50,165,180, 62,173, 89,211, 5,123,255,188,136,215, 90,165,195,252,117,103, 16,202,112,183, 59,124, 0,
- 48,251,255, 38,212, 90,218, 28,243,238,104,209,114,245, 28, 84,199, 71, 75, 32, 16, 32, 47, 47, 15, 73, 73, 73,200,201,201,129,
-193, 96, 64, 98, 98, 34,172, 86, 43, 10, 11, 11,241,226,139, 47,214, 56,157,181, 85, 70, 79,147,243,159, 56,124, 88,109,161,101,
-181, 90, 63,109,208,160,129, 72, 38,147,181, 96, 24, 6, 28,199,129, 97, 24,206, 38,106,170, 61, 11, 79, 36, 18,153,154, 52,105,
- 66,184,154,157, 96,255,239,225,225, 97,172,196, 90, 18, 87,191,126,253, 79, 8,130, 16, 84,212, 11,177,255,103, 89,150, 17, 10,
-133,113, 53,188, 87,143,235, 24,175, 87,171,213, 29,107,185,252,254, 14, 78,231,242,209, 55,107,214,172,244,139,246,206, 49, 81,
-108, 31, 91,213, 87, 33,206, 43, 13, 72,170,215,235,179,250,246,237,203, 56,238,119, 12,104,250, 92,131,224,210,250,143,122,179,
-222,185,124,107, 61, 0,176,139, 45,112, 92, 90, 37,103, 25,179,179,179,187,253,221, 73, 75, 73, 73,177,252,235, 95,255,250, 86,
-171,213, 78, 6, 80, 99,111,254, 89,159,174,153,245, 12,150,140, 6,192,194, 26,158,155,150,159,159,223,211,105,219, 31,118, 65,
-101,143,107, 87,109,209,126, 59,175,214, 99,139,209, 52,157, 30, 17, 17, 81, 45,203, 13, 69, 81,233, 85,237,119,142, 17,230,136,
- 91,240,198,172,171, 64,201,228,239,124,183, 56, 77, 38, 83, 65,199,142, 29, 69,213,204, 91,174,187,121, 15, 9, 9, 65,157, 58,
-117, 74,127,237,112,222, 94, 85, 58,105,154, 78, 15, 11, 11,131,191,191,127,133, 17,223,157,125,178,220,225,172,237, 50,170,140,
-179, 78,157,109,181,206, 89,211,116,242,112, 15,189,121, 78,158,147,231,124,102, 57, 5,252,253,228, 57,121, 78,158,243, 9,114,
- 62,151,224,189,212,120,240,224, 81, 17, 24,254, 22,240,224,193,131,199,227,129,168, 68,149, 86,103,166, 79, 77,148,237,105,158,
-147,231,228, 57,121, 78,158,147,231,228, 57,255,113,156, 85,113,215,246, 76,227,231, 26,188, 89,149,231,228, 57,121, 78,158,147,
-231,228, 57,121,206,127, 44,248,161, 67, 30, 60,120,240,224,193,131, 7, 15, 94,104,241,224,193,131, 7, 15, 30, 60,120,240, 66,
-139, 7, 15, 30, 60,120,240,224,193,131, 7, 47,180,120,240,224,193,131, 7, 15, 30, 60,120,161,197,131, 7, 15, 30, 60,120,240,
-224,193,131, 7, 15, 30, 60,120,240,224,193,131, 71, 9, 8, 0, 56,114,228, 72,233, 7, 1,163,163,163, 9,254,182,240,224,193,
-131, 7, 15, 30, 60,158, 36,158,107, 45,226,152, 57, 30, 60,120,240,224,193,131, 7, 15, 94,139,212, 14, 72, 94,108,241,224,193,
-131, 7, 15, 30, 60,120,177,197,103,140, 7, 15, 30, 60,120,240,224,193,139,172,103, 10,101, 44, 90,188,224,226,193,131, 7, 15,
- 30, 60,120, 60, 77,177,245,140,106, 17,206,182, 56,174,243,224,193,131, 7, 15, 30, 60,120,240,120, 76,129, 85,217, 47, 15, 30,
- 60,120,240,224,193,131, 7,143, 90, 18, 92,246,255, 79, 76,104,241, 95, 54,231, 57,121, 78,158,147,231,228, 57,121, 78,158,243,
- 31, 11, 33,127, 11,120,240,224,193,131, 7, 15, 30, 60, 30, 27,142, 86, 44,130, 23, 90, 60,120,240,224,193,131, 7, 15, 30,181,
- 39,178, 8, 87,235,252,183, 14,121,240,224,193,131, 7, 15, 30, 60,254, 38,240, 22, 45, 30, 60,120,240,224,193,131, 7,143,199,
- 3, 1,126,232,144, 7, 15, 30, 60,120,240,224,193,227,111, 21, 91, 46, 55, 86, 52,115,224,116, 53,200,107, 50,251,224, 52,207,
-201,115,242,156, 60, 39,207,201,115,242,156,255, 56,206,170,184, 79,227,217, 67, 55, 0,103, 1,116,183,253, 86, 40,188,106, 27,
-252,212, 87,158,147,231,228, 57,121, 78,158,147,231,228, 57,159,119, 84, 24,168,148,119,134,231, 81, 21,132,168,124,136,185,170,
-253, 60,120,240,224,193,131,199, 63, 77,108, 17,225, 72,218, 0, 0, 32, 0, 73, 68, 65, 84,113,142, 47, 73, 87,104, 12, 96, 22,
- 0,111,135,109,191, 0,136,115, 58,110, 7, 0,133,195,186, 30,192, 60, 0,247,170, 76, 13,199,137,109,252, 82,219,194, 2, 48,
- 1, 48, 3,208, 18, 4, 65,241,101,246,212,209, 17, 64,180,237,255, 17, 0, 87,170,185,255,185, 66, 72, 72,136,220,199,199,167,
-207,245,235,215, 37,137,137,137,184,112,225, 2,183,121,243,102,107, 97, 97,225,201,172,172, 44, 35, 95, 93,158, 11,244, 5, 48,
-211,246,127, 17,128, 19,143,201, 71, 40, 20,138,105, 30, 30, 30,253,165, 82,105, 29,154,166, 9,131,193,144,169,215,235, 79,209,
- 52,253,165,173,221,171, 46, 6,251,250,250,190,217,180,105,211,198,169,169,169, 25,153,153,153, 59, 0,236, 1, 48,188, 78,157,
- 58,163,235,215,175, 31,122,231,206,157,123, 5, 5, 5,223, 0, 56,248, 20,211,201,131,199, 63, 9, 68,101,214, 8, 87,152,203,
-113,220,232, 50, 12, 68,121,142,158, 61,123, 14, 58,121,242,164,130,101, 89,216, 23,185, 92, 78, 3, 24, 87,133,200,242,187,124,
-249,114,189,201,147, 39, 15,205,204,204,124, 89,171,213,182, 7, 0,133, 66,241,115, 96, 96,224,175,171, 86,173,250,142,227,184,
-116,130, 32,180,213,204,168, 80, 36, 18,189,225,227,227,211,159,166,233,182, 28,199, 65, 36, 18, 93, 47, 44, 44, 60, 65, 81,212,
- 55, 0,106, 34,222, 36, 66,161,112,138, 84, 42,237, 75,211,116, 75, 0, 16, 10,133, 55,205,102,243, 9,154,166,215, 2,176,212,
-128, 83, 38,145, 72,166, 40,149,202, 40,139,197,210, 18, 0, 36, 18,201, 77,141, 70,115,202, 98,177,172,181, 9,206,167, 13, 33,
-128,104,142,227, 68, 0, 32, 16, 8, 6,183,111,223,190, 30, 65, 16, 44, 65, 16, 28,199,113,196,207, 63,255,220,134, 97, 24,210,
- 86, 63,162, 1,252, 10,128,126, 22,159, 16,127,127,255,133, 44,203,214,169,180,208,100,178,151,175, 95,191,222,116,247,238,221,
-204,215, 95,127, 93, 52,126,252,120,207,201,147, 39, 11,215,172, 89,179, 54, 43, 43,235, 61,231,227,253,252,252,150,147, 36,233,
-239,206,245, 89,150,205,203,207,207,159,254,180,242, 31, 19, 99, 42, 99,238,142,143,151, 53, 2,144, 94,195,250,253,247,113,154,
- 98, 56, 0,136,151,197, 55,138, 49,197, 36,219,255, 63, 46,175, 3,102,174, 59,173,237,202,113,192,148, 40, 47,242,113,133, 86,
-104,104,104,124, 76, 76,204,168,150, 45, 91, 10, 57,142, 3, 69, 81, 48,155,205, 77,175, 92,185,210,125,223,190,125, 47,107,181,
-218,225,213,164,124,235,227,143, 63, 94, 48,127,254,124,127,145, 72, 68, 80, 20,213,104,247,238,221,109,223,126,251,237,247, 55,
-110,220, 88,119,196,136, 17, 94,246,237,115,231,206,109,183,104,209,162,134, 0,190,124, 10,233,228,193,227,159,134,110, 40,235,
-163,245, 57,128,207, 42, 19, 90, 30,182,151,103,142,205,146, 5,135,223, 82,156, 57,115,230,144, 80, 40,180, 91,180,218,235,245,
-250, 32, 39, 43,152, 43,145, 85,127,204,152, 49, 29,247,238,221,187,112,196,136, 17,217, 10,133,162,201,171,175,190,170, 37, 8,
- 66,176,123,247,238, 54, 17, 17, 17,242,129, 3, 7,142,233,217,179,231,135, 28,199, 93, 32, 8, 66,237,102, 38, 91,248,250,250,
-238, 95,178,100, 73,189,190,125,251,138,253,253,253,193,113, 28, 50, 51, 51, 67,143, 30, 61,218,239,243,207, 63,255,176,160,160,
- 96, 8,128,132,106,220,184,118,114,185,124,239,231,159,127, 30,210,175, 95, 63, 97,112,112, 48, 76, 38, 19, 18, 19, 19,123,159,
- 56,113,162,235,198,141, 27,223, 51, 26,141,175,217, 4,134,187,104,239,237,237,189,239,191, 31,127, 28,212,225,141, 55,132,190,
-190,190,224, 56, 14,106,181,186,247,197,109,219,186, 79, 90,178,228,189,226,226,226, 97,174,238,247,211,132, 68, 34, 33,183,111,
-223,222, 90, 34,145, 0, 0, 44, 22, 11, 34, 35, 35,137,231,229, 9, 33, 8, 34, 44, 51, 51,211, 91, 44, 22,187,220,207, 48, 12,
-186,118,237,218, 64, 44, 22,227,203, 47,191,164,242,242,242,218,124,245,213, 87,215,119,238,220,233,191,118,237,218,215, 0,148,
- 19, 90, 36, 73,250,167,167,167,187,228,100, 24, 6, 86,171, 21, 52, 77,195, 98,177,160,121,243,230, 79, 53,255,241,241,178, 48,
- 0,211, 99, 98, 76, 31,216, 54,125, 9,224, 67, 0, 41,168,225, 55,187,254, 6, 78,199,250,182,220,225,255, 99,167,213, 1,245,
- 0,224,216, 13, 19, 0,248, 62,238,125,245,240,240,104,246,250,235,175, 11,213,106, 53, 68, 34, 17,172, 86, 43,178,179,179, 17,
- 25, 25, 41,248,246,219,111, 95,168, 46, 95,163, 70,141,198, 47, 90,180, 40,224,216,177, 99,214,237,219,183, 91,162,162,162, 68,
-227,199,143, 87,118,237,218,181,121, 88, 88, 24,185,101,203, 22,243,169, 83,167,168, 49, 99,198, 72,226,226,226, 2,142, 30, 61,
- 58, 48, 33, 33,225,203, 39,157, 78, 30, 60,254,129, 56,139,191, 66, 60,216,127, 43, 21, 90,112, 16, 87,131, 1, 64, 36, 18,181,
- 9, 10, 10,138,167,105, 58,216,102,213,201,206,201,201,249,146,162,168,223,109,199, 30,100, 89,118, 80, 85,150,172, 49, 99,198,
-116, 60,126,252,248,178, 43, 87,174, 20,231,231,231, 7, 31, 58,116,200,244,225,135, 31,166, 2, 64, 74, 74, 74,195,129, 3, 7,
-134, 78,157, 58, 53,189, 79,159, 62,171,122,244,232,241, 46,199,113,167, 8,130,208, 87, 37,178, 34, 35, 35, 47,159, 63,127,222,
- 75,165, 82,149,217, 81,191,126,125,188,251,238,187,226, 65,131, 6, 69,244,234,213,235, 82,114,114,114, 23, 0,127,186, 35,136,
- 26, 55,110,124,250,204,153, 51,158, 62, 62, 62, 40, 42, 42, 66,118,118, 54, 12, 6, 3,148, 74, 37, 70,140, 24, 33,238,214,185,
- 83,221,169,211,222, 59,157,158,145,209,219, 77,177,213,190, 83,139, 22,167,119,198,197,121, 82, 15, 31, 66, 46,151, 67,167,211,
- 1, 0,188,188,188,240,114,131, 6,194,223,182,109, 11, 29, 29, 27,123,250,215,164,164,222, 79, 73,108, 73,109,191,102, 0, 71,
- 4, 2,193, 96,137, 68, 66, 14, 30, 60, 24,167, 79,159, 38, 76, 38,147,208,102,221,161, 7, 15, 30, 12,185, 92, 14,139,197,194,
-162,100,232,144,126,150,159, 18,137, 68,130,228,228,228, 50,219,180, 90, 45,212,106, 53,242,243,243, 97, 54,155, 81, 84, 84, 4,
-150,101, 9,185, 92,174,102, 89, 22, 36, 73, 58, 11,128, 50, 16,139,197, 72, 74, 74, 42,179,141,166,105,232,245,122,152,205,102,
- 88,173, 86,104,181, 90,185,151,151, 87, 99,127,127,255,116, 0, 7, 11, 10, 10,190,204,201,201, 73,123,194,217,207,179, 11,162,
-248,120,217,125, 0,146,255, 69, 78, 7, 75, 86,168,109,253,143, 90, 74,171, 29, 15,143,252,110, 10,183, 89,199, 30,212, 2, 31,
- 11, 0, 23, 46, 92, 64, 78, 78, 14,242,242,242,160, 86,171, 17, 22, 22, 6,142,227,170, 61, 28,151,156,156,188,238,197, 23, 95,
- 36,110,221,186,117, 2,192,154,221,187,119,143, 43, 40, 40,152, 57, 99,198, 12,223,165, 75,151, 22,196,198,198, 46, 2,176,117,
-247,238,221,239, 52,107,214,172,255,237,219,183, 55, 62,141,116,242,224, 81,219,224, 56,174, 29,128, 0,123,219, 98,107,119,253,
- 28,214,111, 16, 4, 97,113, 56,206, 98,107, 27,156,127,237,176,175,171, 9,130,248,213,225, 60, 53, 65, 16,191,214, 52,153, 78,
-191, 37,157,110, 0, 56,114,228, 8,103, 95, 92,157, 25, 24, 24, 56,173,103,207,158,203,174, 93,187,214, 60, 43, 43,203, 39, 43,
- 43,203,231,218,181,107,205,123,246,236,185, 44, 48, 48,112,154,195,141,112, 62,245,180,195, 62,241,229,203,151,235,237,223,191,
-127,209,233,211,167,139,219,180,105, 99, 57,115,230, 12,221,167, 79,159, 92,219, 11,154,238,211,167, 79,238, 79, 63,253,196,116,
-232,208, 65,126,252,248,241, 71,151, 46, 93, 90,190,119,239,222, 32,142,227, 4,174, 56,109, 16,169, 84,170,239,207,157, 59, 87,
- 78,100, 57,162,110,221,186, 56,114,228,136, 82,165, 82, 29, 4, 32,174, 40,157, 54,200,100, 50,217,190,159,126,250,201,211,203,
-203, 11,185,185,185, 16,137, 68, 8, 12, 12, 68,113,113, 49,178,179,178,144,118,247, 46, 72,139, 5, 43,190,152,239, 37,151,203,
-247,186,104,236,203,113,122,123,123,239,219,185,112,161,103,254,233,211,248, 99,193, 2, 88,173,214,210, 33, 87,171,213,138, 75,
-147, 39, 67,253,227,143,216, 50,119,174,167,183,183,247, 62, 0,178, 42, 56,107, 3,142,156,147, 1, 20,216,150,201, 0,174, 68,
- 70, 70, 94, 75, 76, 76, 68,151, 46, 93,176,103,207,158, 86, 51,102,204,152, 60, 99,198,140,201,123,246,236,105,213,165, 75, 23,
- 36, 38, 38, 34, 50, 50,242, 26,202,250,103,253,221,233,252,219, 56, 25,134, 41,179,176,236, 95,239,152, 58,117,234,228,238,223,
-191, 31, 35, 70,140, 32, 37, 18, 73,214,200,145, 35,165, 23, 47, 94,228,108, 34,211,237,116,154, 76, 38, 24,141, 70,232,245,122,
-164,164,164,200,151, 44, 89,210,249,179,207, 62,107,116,250,244,233,208, 89,179,102, 77, 10, 8, 8,184, 30, 20, 20, 84,239, 9,
-231,221,234,244,127, 5,128,140,106, 90,136,254,110, 78,206,118, 62, 98, 76, 49,173, 29, 26,216,234,242, 86,118, 63,179,109,105,
-213, 3, 72,123,156,186,212,179,103,207, 23, 27, 53,106, 20,180,251,150, 15, 10,197, 77,193,138, 85, 96,197, 42, 48,126,237,144,
- 44,121, 5,225,225,225, 65,158,158,158, 29,171,153,206,237,183,110,221,250,151,173,167,156, 15, 96, 89,108,108,236,231, 4, 65,
- 92,136,141,141,157, 15, 96,153,109,251,130,219,183,111,119, 0,176,243, 41,165,243,153,120,222,121,206,255, 45,206, 42,180, 72,
- 0, 65, 16, 71, 8,130, 56,242,201, 39,159,244, 0,224,231,180,254,111,199,227, 0, 72, 92,253,218, 23,135,237, 1, 28,199, 13,
-112, 56, 47,160,134,201, 39, 92, 44,127, 9, 45, 0,136,142,142, 38,162,163,163,237, 59,126, 33, 8,226, 16,128, 95, 68, 34, 81,
-155,214,173, 91, 15,254,225,135, 31,188, 2, 2,254,186,126, 64, 64, 0,246,238,221,235,213,162, 69,139,193, 34,145,168, 13,128,
- 95,148, 74,229,161, 74,172, 48,170,201,147, 39, 15, 29, 59,118,172,166, 77,155, 54, 0, 80,148,144,144,160,232,208,161,131,158,
-166,105,130,166,105,162, 67,135, 14,250,132,132, 4, 5, 69, 81,218,118,237,218,121,244,234,213, 43,117,250,244,233, 99, 92, 8,
- 14, 71,188,190,120,241,226, 48, 31, 31,159,202,148, 48,180, 90, 45,130,130,130, 48,121,242,228, 96,145, 72,244,102,101,119, 75,
- 40, 20, 78, 89,188,120,113,160, 74,165, 66, 97, 97, 33,194,194,194, 96,177, 88,144,148,148, 4,147, 94, 7, 74,171, 1,165, 41,
-130,250,254, 61,168, 68, 66,140, 25, 20, 29, 36, 20, 10,167, 84, 97, 45,153,242, 77,108,108,144, 37, 53, 21, 41,123,246,128,161,
-203, 27,127,104,171, 21, 55, 55,109,130, 41, 61, 29,139, 38, 76, 8,146, 72, 36, 83,158,176, 37,107, 41,199,113,114,142,227,228,
- 4, 65,172,234,216,177,227,183,114,185,124,114, 92, 92, 92,223,147, 39, 79,246, 59,127,254,124,119,154,166, 69, 52, 77,139, 46,
- 92,184,208,197,100, 50, 9,165, 82, 41,132, 66, 33,135,231, 20, 34,145, 8, 98,177, 24,114,185, 28,157, 59,119,190,191,121,243,
-102, 42, 44, 44, 76,180,111,223, 62,159, 58,117,234,120,172, 89,179,166, 72,171,213, 46,118,151,207,106,181,194,108, 54,195,104,
- 52,194,100, 50,225,204,153, 51, 13,166, 78,157, 42, 52,153, 76,204,192,129, 3, 11, 40,138, 50,199,198,198, 42,125,125,125, 63,
-124,146,249,140,137, 49,177, 54,203,211,109,155,104,121,128,199,244,121,250, 59, 56, 1, 88,108, 62, 89,118,248,219,184, 45,181,
-116, 43,104, 0, 58,155,208, 50, 59, 61, 31, 45, 29, 44,190, 85,162,168,168,104,227, 55,223,124, 19, 70, 74, 85,184,104,233,143,
-239,216,207,113,210,123, 13,114,235,125,132,192,176, 70, 24, 53,106, 84, 32,199,113,107,106, 33,205, 95, 1,232, 10, 96, 85, 77,
- 78,126, 2,233,172,231,225,225,177,199,203,203,235,162,135,135,199, 30,216,134,103, 31, 7, 81,141,208,123, 80, 51, 50, 61, 42,
- 2,220,160,102,100,122, 84, 35, 62,212,192,243, 2, 39, 45,226, 8, 53,199,113,209, 28,199, 69, 47, 90,180,104,161,195,251,221,
-190, 46,119,211, 50, 22,205,113, 92,116, 25,133, 84, 34,176, 30,219,232,230, 98, 41,209, 20,142, 74,210, 33,115,165,179, 11,131,
-130,130,226,227,227,227,189,156, 25,179,178,178,160,209,104, 48,103,206, 28,175,177, 99,199,190,151,158,158, 30, 83, 69, 34, 36,
-217,217,217,109, 71,143, 30, 45,179, 90,173,133, 44,203,146, 26,141, 70,232,237,237,205,216, 15,240,246,246,102,138,139,139, 69,
-122,189, 94,192, 48,140,121,236,216,177,146, 9, 19, 38,188, 12, 64, 80, 17,105, 64, 64, 64, 84,255,254,253, 43, 28, 58,160, 40,
- 10,122,189, 30,122,189, 30, 86,171, 21,157, 59,119,150,110,222,188,185, 79,110,110,238,250, 10, 21,135, 84, 26, 21, 21, 21, 37,
- 42, 40, 40,128,183,183, 55,210,210,210,240,224,193, 3,152,117, 58, 88,117, 26, 88,117, 90,208, 90, 13, 56, 77, 49,242,239,221,
- 65,135,102, 77,197, 59,164,210,190,122,189,126,121, 69,156, 74,165, 50,170,195,184,113, 66, 15, 15, 15,116, 31, 93, 50,207,224,
-120,179,102,224, 24, 6, 44,195,128,161,105,244, 77, 74, 2, 69, 81, 32, 73, 18,237, 10, 10,132,202,109,219,162,212,106,245,178,
-167, 81,217,165, 82,169,112,251,246,237,175, 75, 36, 18,112, 28, 71, 88, 44, 22,156, 60,121,242, 31,247,208, 75, 36, 18,200,100,
- 50, 88,173, 86,212,175, 95,223, 56,122,244,232,203, 95,124,241, 69, 56, 73,146, 30, 98,177,248,135,252,252,252,133, 89, 89, 89,
- 41,238,242, 81, 20, 5,139,197, 2,139,197, 2,163,209,136,251,247,239, 7, 55,104,208,128,152, 60,121, 50, 99, 48, 24, 26,174,
- 94,189, 58,249,228,201,147,138,197,139, 23,191, 10,224,221, 39,157,223,152, 24, 83, 51, 0,205,226,227,101, 98,155,229,215,242,
- 63,198,201,161,196,241, 29,241,178,248, 68, 0,234, 90, 20, 89, 18, 0,222,225,126, 66,189, 72, 0, 29, 0, 47,155, 40,120,149,
- 32,136, 14,205,155, 55,247, 73, 76, 76, 44,228, 56,238, 42,128,239, 0,100, 85, 70,198,178, 44,193,178, 44,222,110, 95,132,201,
- 29, 5,160,168, 98, 20, 23, 23, 35, 45, 45, 13, 9, 9, 9,248,249,231,132,154, 62,155,111,122,122,122,246,145,201,100,245,105,
-154, 38,117, 58, 93,154,193, 96, 56,205,178,236, 70,212,192, 71,237,239, 74,167, 29, 30, 30, 30, 75,102,205,154,213,201,219,219,
- 27,191,255,254,123,195, 93,187,118, 45,209,235,245,143,229, 92, 47, 19,145, 91,150,175, 92, 19, 26, 26,168,194,141,243,135, 67,
- 23,110,216,189, 5, 96,195,120,153,242,236,195, 73,139, 56,138,161, 95, 57,142, 27, 64, 16,196, 17,103,161, 84, 45,179,211, 99,
-158, 95,133, 69,203,249,195,210,101,133, 86, 5, 10, 18, 52, 77, 7, 59, 90,178, 56,142, 67, 86, 86, 22, 50, 50, 50,160, 86,171,
-225,227,227, 3,171,213, 26,236, 78,251,160,213,106,219,251,249,249, 25, 68, 34,145,217,104, 52, 66,161, 80,176, 34,145,136,179,
- 93,135,176,205, 90,100,204,102, 51, 33, 20, 10, 41, 47, 47, 47, 79,179,217,220, 20,149,248,146,113, 28,215,222,207,207,207,229,
- 62,179,217, 12,157, 78, 7,189, 94, 15,157, 78, 7,179,217,140,160,160, 32,208, 52,221,182,210, 46, 45, 77,183, 12, 8, 8, 64,
-102,102, 38,228,114, 57,210,211,211, 97,209,105, 97,213,106, 65,235, 53, 96,138,139,193,106, 52, 96,245, 26, 80, 22, 3, 66,155,
- 52,131,125, 70, 98,133,221,112,139,165,165,159,159, 31,244,250,191,220,205, 56,155,192,162,105, 26,180,205, 57,218, 62,156,232,
-239,239, 15,251,140,196, 39, 4, 51,128, 25, 36, 73,174,146, 74,165,194, 73,147, 38, 33, 43, 43,171, 76,157,152, 52,105, 82,169,
- 79, 86,215,174, 93, 47,200,100, 50, 90,173, 86,195,108, 54,139,158,215,135,158, 32, 8, 16, 4, 81, 82, 70, 52, 13,127,127,127,
-125, 94, 94,222,207, 69, 69, 69,175,215,132,143,162, 40,251,140, 46, 24,141, 70,112, 28,135,223,127,255, 29, 50,153, 76,196, 48,
-204, 45,154,166, 21, 34,145, 8,164,205,249,235, 73,193, 54, 35,240, 75, 0, 97, 54, 11,209,155, 40,113, 56,207,112,209,144,184,
-117,235,220,228,172,190,112, 51,197,216, 45, 77, 25,168,217,112,164, 43,116,111,170,146, 44,143,235, 16,168,106, 61,208, 67,175,
-144, 8,244,108, 90,235,250,255, 93,154,176,107,236,152, 55,189,230,205,155, 87,207,223,223, 95,150,156,156,108,154, 63,127,126,
-131,237,219,183, 19, 40, 25,166,171, 16, 15, 31, 62, 60, 48,107,214, 44,223,254,253,251, 55,148, 74,165, 68,113,113, 49,212,106,
- 53,114,114,114,240,224,193, 3,238,198,141, 27,247,205,102,243,158,234, 36, 50, 36, 36,100,243,235,175,191, 62,246,165,151, 94,
- 18,217, 45,164,122,189,190,205,185,115,231, 6, 29, 63,126,188,139, 94,175,175,118,189,124,244,232,209,158,217,179,103,123,188,
-242,202, 43, 77,165, 82, 41, 89, 27,233,116, 4, 73,146, 65,158,158,158, 56,125,250, 52, 84, 42, 21, 72,146, 12,122,220,250,106,
-178,178,161,117,130,253, 96,186,180, 28, 77, 3,234,193,100,101, 67,121,137,242,252, 88,180, 42,120,215,183,179, 91,164,170, 16,
- 75,198,153, 51,103,206, 34, 8,226,200,204,153, 51,103,185,178,104,217,254, 50,142,199, 57, 28,111,174,109,177, 85,173, 64,147,
- 44,203, 34, 35, 35, 3,153,153,153,200,200,200, 64,126,126, 62, 72,146, 4,199,113,238,204, 62,227, 8,130, 96, 79,157, 58,229,
-115,249,242,101,125,187,118,237,138,236,254, 47, 52, 77, 19, 20, 69, 17, 54,191, 24, 34, 45, 45, 77,124,241,226, 69,213,237,219,
-183,131,108,189, 85,182, 10, 83, 96,185,109,118,129,229,184,152, 76, 38,200,100, 50,247, 84,135,237, 69,248,251,181,107, 37, 34,
- 75,167,181, 13, 25, 22,131,209, 20,131,211,107, 33, 97, 40, 72,192,129, 48, 25,220,190,127,142,176,139, 44,171, 77,104, 89, 44,
- 22, 80, 20, 5,150,101, 65,211, 79,197,175,124, 93,171, 86,173,218, 30, 56,112, 96,124, 70, 70,249,119,225,144, 33, 67,240,238,
-187,239, 98,234,212,169,183, 7, 12, 24,112,227,240,225,195,152, 50,101, 10, 88,150,109, 13,160, 24,192,241,231,237,161, 55,155,
-205,165, 22, 40,147,201, 4,171,213, 10, 84,227,179, 10,206,117,211, 94,182, 52, 77,219,185,137, 3, 7,246,227,194,133, 11,100,
- 66,194,173,176, 73,147, 38,219, 29,238,159,116, 86,211, 81, 50,115, 79, 98,107, 40, 44, 40,241,127,170, 40,164, 66, 4, 42, 31,
-178,227, 42,227,124, 28,180,218,208,106,196, 7, 31,124, 16,133,146, 25,206, 41,143,105,209,122, 69, 66, 18, 95, 79,107,233, 43,
-251,176,149,159, 94, 34, 36,116, 73, 95,207,210, 61, 8, 87,234,131,234, 42, 44, 97, 13, 84,117, 22, 46,252, 34,228,246,237, 59,
-230, 57,115,230, 36,142, 28, 57, 50,240,195, 15, 63,108,190,111,223,190, 46, 38,147,233, 27, 0, 69, 21, 25, 93, 6, 13, 26,116,
- 53, 48, 48,176,193,134, 13, 27,114, 31, 61,122,228, 67, 81,148,135,213,106,101,245,122,253, 3,163,209,120,218,106,181,158, 6,
-112,173, 58,137,245,242,242,106, 53,110,220, 56, 81, 81, 81, 17,132, 66, 33,172, 86, 43,114,115,115,209,169, 83, 39,193,161, 67,
-135, 90,212,228, 6, 20, 22, 22, 46,255,230,155,111,206,238,220,185,179,143, 82,169,124, 73, 42,149, 6, 3, 96,180, 90,109,142,
- 94,175,255,163, 38,233, 44,211,206, 49, 76,206,181,107,215, 34,148, 74, 37, 30, 62,124, 8,134, 97,114, 30,183, 14,200,196,228,
-163,155,231, 15,213,109,230,223, 0, 23, 47, 95,133, 76, 76, 62,226, 67,125, 61,247,176,251, 80,193, 81, 64,185, 16, 72,151,227,
-226,226,228,139, 22, 45, 66, 92, 92,220, 45, 87, 22, 45,187,224,138,139,139,187,101, 63,206,225,248,243,143,145,198,138, 45, 90,
- 21, 41, 72,160,100,118,161, 90,173,246, 81,169, 84,165, 2, 43, 51, 51, 19,153,153,153,144, 72, 36, 72, 75, 75,131, 68, 34,201,
-114,167, 19, 34,151,203,127,107,211,166,205, 11, 41, 41, 41,226,249,243,231,215,189,118,237,154,178, 83,167, 78, 47,202,229,114,
-134,227, 56,152, 76, 38, 50, 49, 49,209,115,217,178,101,161,237,219,183,183,180,111,223,254,250,238,221,187,141,168, 36,254, 21,
- 65, 16,191,100,101,101, 53,172, 95,191,190, 93,180,149, 17, 87,142,130, 11, 40, 25,242, 20, 10,133,215, 43, 75,168, 80, 40,188,
-153,148,148,212, 91, 33,147,194,162,213,192,170,211,128,214,106,193,104,139,193, 20, 23, 3,122, 13, 36, 52, 13, 17, 67, 65, 46,
-147, 33, 35, 61, 29, 66,161,240,102,101,156, 18,137,228,102, 78, 78, 78,111,149, 74, 85,250, 18,165,104,186,100, 97, 24, 88,104,
-186,212,162, 37, 18,137,240,232,209, 35, 72, 36,146,155, 79,186, 38,147, 36,201,216, 67, 56, 84,144, 15, 4, 5, 5,177, 29, 58,
-116,192,148, 41, 83,192, 48,140,173, 24,136,238, 0, 46,162,196,191,229,153,132, 43,113,107,119, 90, 55, 26,141,208,233,116, 40,
- 44, 44, 20,202,229,242, 23, 66, 67, 67,175, 90, 44,150, 61, 52, 77,111,121,240,224,129,166, 34, 78,155, 48, 43, 21, 93, 44,203,
-130,227, 56, 48, 12, 3,138,162, 32, 22,139,217,115,231,206, 99,217,138, 37,136,223,178,157, 27, 52,104, 16,113,232,208, 33,176,
- 44,155,254,132,179,111,177,137,150,202, 26, 13,231,144, 10, 31,161,242,144, 10, 21,113, 58,246,254, 28,183, 17, 46,142, 41,135,
- 15, 62,248,224, 4, 74,134, 12,243,108, 98,238,113, 56,191, 44,250,238, 11, 25,104, 70,111, 62,183, 83,247,237, 93,141,126,222,
-183, 43,127,179, 72, 4,154,151,187, 5,181,108,216,224, 5,129, 74,229, 67,174,223,184, 42,127,199,246,189,201, 15, 31, 62,212,
-172, 93,187,182,227, 11, 47,188,224,253,199, 31,127,132, 86, 36,180, 20, 10, 69,227, 55,223,124,115, 92, 97, 97,161, 56, 62, 62,
-126,119, 86, 86,214,111, 40, 9, 45,227, 56,131,122, 0,128,173, 54, 33, 26,100,107,231, 46, 2,152, 95, 89,127,141, 32, 8,252,
-244,211, 79,229,102, 7,178,143,167,206, 85,141, 26, 53, 26,145,146,146,114, 33, 39, 39,103,152,243, 78,177, 88, 60,175, 73,147,
- 38,125,111,221,186,245, 57,128, 99,213, 33, 54, 24, 12,177,123,247,238, 93, 42, 16, 8,234, 48, 12,147,105, 52, 26, 99, 31,219,
-162, 69,177, 19,226,214,239,218,100,180, 48,225,114,137,224,161,137, 98,223,226,117,200,243,107,205,178, 65,237, 96,141, 82, 3,
- 32,156,214,255,176,189,140, 44, 28,199,217,143, 85, 59, 88,177, 44, 78, 86, 48, 87,251,212,143, 17, 44,157,171,168,141,171,200,
-162,245, 9,128,246, 0,126,201,201,201, 89, 53,118,236,216,101, 59,118,236,240,210,104, 52,200,201,201, 65,110,110, 46,132, 66,
- 33,148, 74, 37,214,173, 91,103,204,201,201, 89,229,120, 14,202, 71,144, 7, 0,147,191,191,255,111,219,183,111, 15,254,250,235,
-175,133, 49, 49, 49,105, 3, 6, 12,104,186,110,221,186, 20,177, 88,204, 49, 12, 67,152,205,102,226,237,183,223,142, 88,177, 98,
- 69,170, 64, 32, 80,140, 24, 49,130,240,240,240,248, 5,149,132, 13, 80,171,213,167,190,255,254,251,161,211,167, 79,151, 90, 44,
- 22,151,150, 44,251, 54,149, 74,133, 75,151, 46, 89, 10, 11, 11, 79, 86, 97,197, 56,245,195,177,163, 93,255, 51,114,164,152,210,
-106, 64,105, 53,160, 53, 26, 48,218, 34, 16, 58, 13, 68, 12, 13,185,152, 69,112,152, 12,180,209, 19, 71,127,253,131, 50,155,205,
-149, 6, 54,212,104, 52,167, 46,198,199,119,111, 95,175,158,240,210,180,105,176, 82, 20, 94, 73, 74, 42, 21, 87, 86,171, 21, 7,
- 91,182, 4, 67, 16,104, 61,113, 34,238,209, 52,173,209,104, 78,253, 47, 62, 12, 55,110,220,200, 29, 61,122,244, 53,150,101,219,
-226, 9,125, 52,243, 73,128,162,168,114,214, 40,134, 97, 74,172,142, 37,150, 3,201,209,163, 71,187, 38, 38, 38,138,255,252,243,
- 79, 92,184,112,161,245,142, 29, 59, 62, 9, 15, 15,111,249,240,225,195,236,170,196,155,171,160,191,176,249, 31,238,222,185, 7,
-239,188,243, 14,145,157,157,141,239,190,251, 14, 85, 5, 79,253, 59, 16, 19, 99, 98,227,227,101,117,225,228,247,228, 34,164,194,
-239,112, 51,164, 66, 69,156,166,152, 18, 43,153, 44,190, 36,216,168, 41,166,100, 56, 80, 22, 95,165,165, 12, 49,166, 24,141,205,
- 33, 62,171, 22, 56,245,160, 25,185,229,220, 78,221,128, 99, 15,181, 87,178,140,243, 1,156,128,137,225,238, 93,231,110,188,244,
-146,143, 63, 0,152, 77, 76,112,227,198,141,187, 9,133, 66, 9, 0,120,122,122,190,228,231,231,183, 46, 63, 63,191,179,171, 50,
-141,142,142,238, 16, 24, 24,216,230,248,241,227,127,100,101,101,221, 2,240,179,243, 65, 17, 17, 17,115,110,223,190,221, 78, 36,
- 18, 17, 85,212, 17, 0, 64,183,110,221, 94,144, 74,165,126,199,238,122, 67, 35,110, 4, 78, 80, 12, 8,101, 96, 84,173,144, 38,
-110,142,176,176,171,126,133,133,133,173,139,139,139,255,168,102,209,247, 24, 58,116,232,150,248,248,248,176,110,221,186,113,215,
-175, 95, 39,157, 71, 17, 34, 34, 34,250, 92,185,114,165,237, 91,111,189,181, 97,215,174, 93,147, 81,118,166,109, 85, 72,179,197,
- 27,172, 53,156, 74,198,105,128,169,103,179,153,241, 10,229, 31,128,234,132, 92,120,140,240, 12,143,149,196, 10, 13, 24, 21,108,
-111,111,139,137,213,158,162,168,223,111,220,184,113,112,196,136, 17,186,252,252,124,248,249,249,161,126,253,250, 32, 8, 2,235,
-214,173, 51, 62,120,240, 96,159, 45,150, 86,251,204,204,204, 65, 54,177,229, 10,218,213,171, 87,239,218,182,109,155,234,218,181,
-107, 2,154,166,149, 77,155, 54, 53, 92,190,124,217, 83, 36, 18,113, 98,177,152,189,118,237,154, 34, 34, 34,194, 68, 16,132,244,
-199, 31,127,204,191,122,245,106,248,140, 25, 51,190, 65,217,105,226,206,216,185, 96,193,130,140,148,148, 20,152,205,102,104, 52,
- 26, 20, 23, 23,151, 46, 69, 69, 69, 40, 46, 46,134, 72, 36, 66,118,118, 54,246,239,223,159,101,139, 18, 95,153,101, 99,237,154,
-117,235,213, 89, 15,211,160, 84,200, 65,107,138,192, 20,231, 3,218, 98, 72, 40, 43, 60, 68, 12,234, 54,146, 67,166, 80, 34, 71,
-163, 67,252,229, 95,179,109, 81,226, 43, 54, 23, 88, 44,107,223, 93,177, 34,135, 22,139, 81,111,248,112, 88,109, 67,133,142, 66,
-139, 33, 8,132,247,234, 5,210,219, 27, 11,247,237,203,177, 69,137,127,162, 96, 89, 86, 96,177, 88, 42,203, 7, 88,150, 77, 79,
- 76, 76,220, 5,224, 44, 65, 16, 28, 65, 16, 28, 74,130,181,233,158,229, 7,153,162, 40,204,157, 59, 23, 98,177, 24,115,231,206,
-197,167,159,126,138,101,203,150, 97,253,250,245,248,246,219,111,113,244,232,209, 6, 23, 47, 94, 20,159, 63,127,158,139,139,139,
-203,139,136,136, 16, 76,156, 56, 81, 37,151,203, 63,168,140, 51, 54, 54, 22, 94, 94, 94,136,141,141,197,146, 37, 75,176,121,243,
-102, 28, 60,120, 16,151, 46, 93,130, 64, 32, 96,211,211, 31,193,100, 50,113,171, 87,175,206, 56,120,240,160,113,213,170, 85, 16,
- 10,133,196, 83,106, 36, 62,176, 9, 42, 71, 75,144,115, 72,133,124, 0, 43, 81,181,111, 84, 69,156,144,197,199,215,181,137,163,
-100, 7, 65,116, 24,192,116, 84, 62,189,218,206, 49, 25, 64,112, 45,112,206,150,143,254,191, 68,213,166, 59,247,175,100, 25,103,
- 3,248,193,158, 39,165, 82, 41, 63,112,224,123, 33, 0,236,219,187, 95,148,148,148,228,253,253,247,223,203, 2, 3, 3,241,237,
-183,223,202,228,114,121, 96, 5,156,204,193,131, 7,205, 18,137,196,111,194,132, 9,253,218,181,107,247,190,173, 35,218, 11, 64,
- 11,148,204, 94,140,186,127,255,126,130,191,191,255,221,147, 39, 79,234,221, 41, 32,173, 86,251,205,214,173, 91,235, 23, 48,190,
- 56,166, 31,138,120,118, 41,142,170,182, 32,173,222,167, 80,212,121, 25,175,191,254,122, 29,134, 97, 54, 85,179,220, 95, 31, 50,
-100,200,214,248,248,248,176, 9, 19, 38,100, 95,191,126, 61, 7, 64, 60,128,237,142,203,237,219,183,243,198,142, 29,155,181,105,
-211,166,144, 17, 35, 70,172, 7, 48,140,127,245,243,224, 81,182, 47,132,170,102, 29,186,120,225,150,254,207,205,205, 93, 93, 88,
- 88,120,233,222,189,123,239, 89, 44,150, 16,130, 32, 56,177, 88,156,157,147,147,179,202, 33, 96,169, 43,191,146,222,176,197,218,
- 32, 8,130,226, 56, 46,189, 71,143, 30, 31,244,234,213,235,171, 35, 71,142,152,186,119,239,142,189,123,247,250,247,232,209,195,
-192,178, 44,119,236,216, 49,255,190,125,251, 26,206,158, 61,171,127,251,237,183,155, 54,105,210,100, 98,108,108,172,154, 32, 8,
-214, 21,167,253, 93, 86, 84, 84, 52,164, 95,191,126,151,246,237,219,167, 84,169, 84,160,105, 26, 6,131, 1, 6,131, 1, 28,199,
-193,219,219, 27,106,181, 26,243,231,207,215, 20, 23, 23, 15,118, 33,220,156, 57, 77, 38,147,105,216,228,247,167,159, 90,245,249,
- 92,175,240, 6, 13,144,127,199, 4,218,100,128,136, 35, 81,247, 5,111,136, 37,114,220, 75,210,226,163, 93, 7,180, 70,147,233,
- 53, 23,189,229,114,156,197,197,197,195, 98, 62,253,244,244,134, 25, 51, 60,219, 4, 5, 65, 32, 16,192,108, 54,131, 97, 24,136,
- 68, 34, 68,198,196, 64, 28, 16,128, 57,187,118,233, 53, 26,205, 48,148,255, 20,143, 51,103,109,192,145,115,242,141, 27, 55,198,
- 54,107,214, 12,147, 38, 77,194,144, 33, 67,202, 28,248,253,247,223, 99,253,250,245, 48,155,205, 99, 1, 92, 7,176, 14, 37, 67,
- 29,112, 18, 89,127,119, 58,107,157,147, 97,152,194,164,164, 36,229,210,165, 75, 9,171,213,138,207, 63,255, 28,118,193,105,175,
-215, 83,166, 76,169,227,229,229,133,207, 62,251,204,146,151,151,215,115,201,146, 37,103,182,111,223,238,255,205, 55,223,188, 14,
- 32,214,153,147,101,217,220,155, 55,111,122,109,216,176,129,164,105, 26,203,151, 47, 47, 55, 60, 57,126,252,120, 88,173, 20, 4,
- 2,161,197,100, 50,183,144,203,229,201,126,126,126,114,174,172,115,215,147,188,159,161, 40, 9, 97,224,232,248,110,113,244,207,
- 66,197, 33, 21,170,195,169,150,197,199,119, 55,197,196,156,181, 9,162, 68,219, 49,123,237, 38,253,106,112,218, 5, 97, 77, 56,
- 79,217,150, 42, 97, 50,153,160, 86,171,145,151,151, 7,149, 74, 5,129, 64, 64, 84,148, 78,179,217,252,231, 71, 31,125,116, 99,
-211,166, 77,189,175, 92,185, 50,240,252,249,243, 61, 78,159, 62,109, 74, 75, 75,163, 41,138,226, 66, 66, 66,132,157, 59,119,150,
-245,239,223,223, 67, 42,149,146,179,103,207,206,251,226,139, 47,252, 81,214,135,205, 57,239, 2,130, 32,240, 97, 87, 45, 98,123,
- 8, 96,177, 88, 81, 84, 84,132,140,140,116, 36, 36, 36,224,202,149, 59,224, 56,142,172, 70,185,251, 1,152,253,221,119,223,133,
- 74, 36, 18, 98,215,174, 93,117,118,237,218, 85,165, 37,117,199,142, 29,117,118,239,222, 61,207, 54,122,145,254, 44, 62,239, 60,
-231,255, 44,231,179, 12,231,200,240,168, 82,104,217,218,249,246,176,125,148,148,162,168, 95, 92,132,112,248, 4,192, 92, 7, 43,
- 88, 85,230, 60, 13,199,113, 23,122,247,238, 61,165, 87,175, 94, 43,250,244,233,147,149,149,149,213,112,249,242,229, 97, 52, 77,
- 91, 19, 18, 18,200,228,228,228,180,223,126,251,173, 81,147, 38, 77, 38,222,190,125,251, 28, 65, 16, 86, 55, 50,152,144,156,156,
-220,169, 71,143, 30,251, 39, 78,156, 24,222,161, 67, 7,137, 74,165,130, 80, 40, 68, 74, 74, 10,254,248,227, 15,203,238,221,187,
-211,139,138,138,170,243, 9,158, 95, 82, 51, 50,162, 70, 76,125,111,223,196, 33, 3,253,255,213,244, 5, 73, 72, 72, 8, 96, 52,
-226,206,195,108, 92,189,243,135,117,243,133,171,106,179,217, 60, 12,238,127,130,231,151,223,238,221,235,221,115,198,140,125,243,
-254,243,159, 32,100,101, 9, 67, 66, 66, 32,145, 72,240,224,193, 3, 36,179, 44,189,120,227,198, 28,155,200,122,210, 81,225,165,
- 0,150,178, 44, 43, 4, 0,185, 92,142,119,223,125, 23,142,159,220, 89,191,126, 61,140, 70, 35, 0, 8, 9,130, 88, 10, 96,203,
-179,110,197,178,163,160,160, 96,206, 43,175,188, 18, 39, 20, 10, 43,140,122,235,227,227, 3,173, 86, 11,154,166,153,140,140,140,
- 59, 62, 62, 62, 16,137, 68,224, 56,206,229,115,148,159,159, 63,103,216,176, 97, 11, 72,146,172,200,242, 1,165, 82,153,118,230,
-204,153,198,111,189,245, 22,249,223,255,254, 55,101,194,132, 9,210, 51,103,206, 48, 28,199,237,127,210,247,160, 75,151,157,192,
-134,152,215, 0,188, 6,148,115,120,207,176,109,171, 86, 72,133, 46, 93,118, 98, 3,254,226,116, 28,198,179, 11, 34,155, 21,170,
-185, 44, 62,126, 5, 74,252, 44, 42,229,238,178,179, 11, 54,196,160, 86, 57,221,129,163,246,213,235,245, 96, 24,166, 50,107,222,
-239,123,247,238, 93,241,219,111,191, 5, 76,153, 50,165,225,127,254,243, 31,101,143, 30, 61, 60, 29, 15, 48, 26,141,236,225,195,
-135,245,235,215,175, 47,190,112,225, 66,234,248,241,227, 59, 84,150,206,135, 15, 31, 30, 93,184,112,161,119,255,254,253,155, 0,
- 40,245,207, 82,171,213, 72, 75, 75,195,159,127,254,153,102,181, 90, 15, 85, 35, 75,249, 0,230,141, 26, 53,106,233,182,109,219,
-234, 76,152, 48, 33,123,247,238,221,127,162, 36, 96,177, 51, 84, 67,134, 12,105,185,109,219,182,144, 9, 19, 38,100,163,196,143,
- 44, 29, 60,120,240,176,163, 59,202,251,105, 85, 58, 50,177,213, 98,177,112, 38,147,137, 51, 24, 12,156, 78,167,227,224,250, 43,
-240, 7, 51, 51, 51,185,244,244,116,238,225,195,135, 92,106,106, 42, 7,224, 91, 39,197,235,170,193,242,216,177, 99, 71,163,208,
-208,208,207, 21, 10,197, 9,129, 64,160, 17, 8, 4, 26,169, 84,250,131,159,159,223,167,139, 23, 47, 14,229, 56, 78, 92,137,138,
-174, 8, 66,145, 72,244, 86, 96, 96,224, 65, 95, 95,223,116, 31, 31,159,244,192,192,192,131, 34,145,232, 29, 0,162, 42,148,121,
- 69,144, 9,133,194,143, 60, 60, 60, 78, 73,165,210, 92,169, 84,154,235,225,225,113, 74, 40, 20,126,132,202, 3,169, 86,202, 41,
-145, 72, 62, 10, 8, 8, 56,165, 84, 42,115,149, 74,101,110, 64, 64,192, 41,137, 68,242, 56,156,143,211, 43,177, 11, 45, 3,103,
- 3, 65, 16, 84,235,214,173, 55,180,109,219,118, 93,219,182,109,215,181,106,213,234,107,155, 85,146,179, 89, 91, 12,168, 56,120,
-227,223,153,206,167,198, 25, 25, 25,185,125,219,182,109,236,156, 57,115, 52, 77,154, 52, 41,152, 51,103,142,102,219,182,109,108,
-100,100,228,246,154,114, 6, 5, 5,213,139,140,140, 44,216,180,105, 19,157,148,148,196,109,218,180,137,142,140,140, 44,112,138,
- 12,255, 36,242, 78, 0,136,176, 89,127, 14, 1,216,131, 18,231,247, 80, 0, 68,140, 41,134,179,205, 62, 60, 1,160, 79, 5,101,
-239, 46,103,152, 41, 38,134,179,249, 84,157, 4,144,232,176,222, 13,101,253,191,158, 4,167, 75,180,104,209,226, 30,231, 0,139,
-197,194,169,213,106, 46, 41, 41,137,187,112,225, 2, 23, 22, 22,118,207, 13, 78, 63, 0,111, 3, 56, 28, 28, 28,124,187, 99,199,
-142, 15, 59,117,234,244,176, 94,189,122, 41, 34,145,232, 10, 74, 34,188, 71,218,150,165, 0,154, 84,193,217, 81,165, 82, 45, 12,
- 11, 11, 59,212,184,113,227, 75,245,235,215,191,226,235,235,123, 68, 38,147, 45,194, 95,145,177,171, 91,231,123, 12, 29, 58, 52,
- 77,167,211, 49, 47,189,244,210,109, 87, 39, 53,107,214,236,162, 78,167, 99, 70,142, 28,153, 14, 32,250,159,240,188,243,156, 79,
-133,243, 31,133,198, 54,193,116,208, 97,249,196,197,113,159, 56, 29,179,213,118,110,149, 5,193,113,156,128,227, 56, 15,142,227,
-188, 57,142,243,229, 56, 78,197,113,156, 39,199,113,210, 42,204,223,124,197,254,251, 56, 39,219, 4,148,193,246,223, 25, 85,237,
-127,174,239,103,104,104,168, 79,187,118,237,166, 30, 56,112,224,163,251,247,239,127,116,224,192,129,143,218,181,107, 55, 53, 52,
- 52,212,231,113,210, 25, 20, 20, 84,175,121,243,230, 95, 53,107,214, 44,189,121,243,230, 95, 57,137,172, 39,153,119,137, 77,196,
- 52,179, 45, 13,109,219, 8,148,196,194, 90,107, 19, 54, 17, 21,244,212,170,195,105,231, 59, 4,160,175,109, 57,100,219, 22,246,
- 20, 56,203,161, 65,131, 6,199, 91,182,108,121,175, 85,171, 86,201,173, 90,181,186,215,162, 69,139,123, 77,155, 54,189, 23, 17,
- 17,113,175,110,221,186,247,252,253,253,143,215,160,140,124, 1,132,160,252,103,192,158,118,157,239, 30, 25, 25,121, 85, 38,147,
-185,140, 13, 38, 20, 10,231,181,106,213,234, 38, 74,102, 74,242,237, 39,207,201, 11,173,255, 33,240,149,240,217,227,148,162,242,
-207,140, 84,181,159,191,159,207, 54,167,203,111,117,217,132, 76, 67,155,192,145,212, 2,167, 35,159,189, 78, 69, 56,136,166,167,
-193,201,215, 37,158,147,231,228,133, 86,173, 67,200,223, 2, 30, 78, 48, 63,230,126, 30,207,197,104, 60,126, 0, 0, 32, 0, 73,
- 68, 65, 84, 54,170, 19, 19,235,113, 56, 93,241,221,127,202,156, 60,120,240,224, 81, 91,109,103,119, 0,231,236,189,194,138, 84,
-105,117,102, 19,212, 68,217,158,230, 57,121, 78,158,147,231,228, 57,121, 78,158,243, 31,199,105,199,138, 10,182,223,113, 90,255,
-250, 25, 21, 94, 79, 36, 76, 15,111, 86,229, 57,121, 78,158,147,231,228, 57,121, 78,158,179,166,152,248,140,138,172,110,246, 21,
-126,232,144, 7, 15, 30, 60,120,240,224,193,163,246, 80,117, 28,173, 61,123,246, 8,236,255, 71,141, 26, 53,158, 97,152,169,246,
-117,129, 64,176,230,187,239,190,219, 82,217, 21,134, 15, 31,206, 84,198,233, 10, 85, 93,199, 21,103,139, 38,202, 73,126,222,138,
-247,138,138, 13, 43, 83, 50,153, 11, 38,147,169,185,125,159, 76, 38, 75,220,178,101,203,221,218, 78,231,248,241,227,155, 56, 95,
-167,126,152,168,187,175,151,236,221,130, 34,221,242, 91,247,116, 95,243,117,236,169,192, 31, 64,180,151, 76, 60,168,133, 74,220,
-241,207,124,211,101,189,149, 57,140,146,217,176,133,207, 99,134,131,131,131,155, 42,149,202, 49, 0, 90, 24, 12,134, 64,133, 66,
-145, 11, 32, 65,163,209,108,207,206,206,190,227, 46, 79,183,250, 72, 3, 16,110, 91,125,120, 46, 21,245,220,217, 87, 21,250, 68,
-192,196, 1, 82,130,128,245,100,242, 95,206,232,125, 27,193,196,114,229,183,247,105, 4, 11,199, 65, 76, 0,230,147,247, 33,123,
-142,138, 74, 9, 32, 10, 37, 33, 28,110,160, 36,252,132,129,127,100,121,240,120,174,224, 60, 84, 88,186, 46,172, 64, 76,116, 21,
- 11,137,175, 56,112, 42,128,243, 51,155,205, 34,137, 68, 2,139,197, 2,133, 66,190,246,237, 9,227, 63, 7,137, 34,138,198,187,
- 91,182,108,169,241,151,174,171,115, 29, 0, 63, 57,159,239,163,148, 47, 56,123,248, 99,159,174, 3, 22, 47,178, 60,200,139,213,
-106,181,164, 84, 42,133,217,108,134,183,183,119,167, 73, 19, 39,190, 68,138, 56,139, 88,236,113,121,197,138, 21,217, 53, 77,231,
- 7, 31,124, 16,108,181,154,254,205,178,172,196, 98,177, 72,157,175,227,173,240, 88,124,246,240,199,138,110,209,139, 62, 7,120,
-161,245, 20, 32,169,231,227,113,110,229,168,238,205, 58,182,104, 12, 54,225, 60, 76, 22,235,160,179,233,186, 65,159, 94,201,156,
-158,174,179,182, 69, 45, 4,172,252, 31,130,160, 97,195,134, 83, 2, 2, 2, 70,110,220,184, 81,220,176, 97, 67,200,100, 50, 24,
-141,198,144,251,247,239,135, 76,154, 52,169,155, 92, 46,223,149,146,146,178, 22,238,125, 8, 46,252,236,214,255, 3, 0,116, 26,
- 51, 63, 28, 37, 31,139, 54, 56,239,235, 62,110,126, 56,128, 25, 40,251, 97,228, 44,148,132, 80,112,213,234, 72,142,108, 91,134,
- 65, 99, 63, 18, 2,152, 84,154,120, 18,248,225,219, 85,232, 55,234,189, 50,219, 9, 14,194,195,219,150, 33,122,236, 71, 21,126,
- 71,177,111, 99,130, 98, 89,174, 66, 75, 60, 73, 18,244,137,123,156,171, 15, 12,231,160, 36, 6, 88, 57, 74,148,124,208,217,229,
-241, 3,154, 10,114,172, 20,227, 50,224,172, 88, 36,200, 61,122,135, 41,119,110, 76, 27, 80, 20, 83,210,182,138,133, 96, 14,166,
-120,159,157, 61,123,182, 48, 58, 58, 26,155, 55,111,238,252,245,215, 95, 79,212,106,181, 63,218,238, 91, 50,255,248,242,224,241,
- 92, 11, 46,215, 66, 75, 40,192,134, 67,251,182, 52,202,201,205, 67,204, 91, 31, 98,231,206,157, 40, 44, 44,132,143,143, 15, 36,
- 98,177,104,229,210,255, 11, 86, 42, 61,130, 99, 38,198,110, 0,208,180,166,169,169,230,117, 26, 59,159, 79,216, 62,165, 35, 20,
-144, 34,137, 68, 66,238,218,181, 11, 69, 69, 69, 80,169, 84,144, 72, 68,228,138, 69,159,200,149, 74, 79,249,155,147,103,118, 70,
- 73,252,159, 26,193, 98,209,117, 62,176,115,139, 82,173, 86, 99,220, 59,177,112,190,142, 88, 44,102,236, 47, 22,190,142, 61, 21,
-204,222,248,238,216,102, 47,122, 1,214, 91,151, 32, 18, 8,160,240,246, 65,148, 80, 0, 1,129,230, 49, 39, 82,103, 1,248,244,
-121,201,108,195,134, 13,167, 12, 31, 62,124,228,130, 5, 11,196, 36, 89, 18,114, 78,175,215,195,104, 52, 34, 52, 52, 20,103,207,
-158, 21,207,153, 51,103,228,247,223,127,143,148,148,148,213,213,229,191,117,235, 86,253,240,240,112, 19, 0, 12,108,233,229,188,
-175,158,125, 31, 0,120,121,121, 85,201,231,167,242, 48,223,186,117,181,133,253,188, 41,189, 66,153, 10,182,155, 0, 40, 42,227,
- 98, 89, 78,120,242,171, 73, 21,238,127,107,193, 14,250,198,158, 11, 77, 27, 54,108,104,116,220,238,233,233, 89,209, 41, 65, 58,
-157, 46,220,121,163,253,120, 43,197, 4, 86,116,189, 62,239,174,119, 41,192, 40, 6,194, 29, 59,118, 0, 0,190,252,104,180, 96,
-211,207,121, 66,161,176,164,169, 93,186,116, 41,230,205,155, 39, 57,113,226, 68,255,109,219,182,245, 63,120,240,224,202,138,132,
- 42, 15, 30, 60,158, 73,145,229,248, 91,177,208, 34, 9,194, 75,233,229,137,215, 94,127, 27,199,143,255,128,174, 93,187,150,238,
-107,208,160, 1,134, 15, 27,140,239,182,174, 0, 0,175,199, 73,209,227, 94,167,176, 88,255,105,191,145, 95,205,127,152,173,187,
-114,228,200, 17,116,233,210,165,204,249,175,143,120, 13,223,126,179, 20,149, 68,153,119, 11, 4, 71,138,189,148, 30, 24, 21,243,
- 14, 92, 93,103,226,184, 33, 71,250, 14, 95,213, 59, 39, 95,191,130,175,103, 79, 30,141,130,253,250,180,108,214, 20,133,251,215,
-226,143, 34, 19,142,103,154,240,102,212,191, 16,233, 43, 71, 23,154, 65,176,135,168,103,182,158,122, 46,132, 86,112,112,112,211,
-128,128,128, 50, 34, 75,171,213, 66,167,211, 65,163,209, 64,171,213,130, 36, 73,196,198,198,138,207,157, 59, 55, 50, 56, 56,248,
-180, 27,195,136, 15,109,150, 44, 64, 32,210,205,157, 59,215, 28, 24, 24,104, 86, 40, 20,156, 80, 44,213,118, 31, 55,223, 11, 0,
- 72,161, 88,187,114,229, 74, 75,104,104,168, 73, 40, 20, 74,222,123,239, 61,210,157, 52,155,205,102,206,145,211, 98, 49,151,110,
- 95,188,120,177, 37, 40, 40,200,172, 80, 40, 56,171,213,125,163,227,205, 7, 5,144,138, 5,144,138, 5,144, 73, 68,240,170,223,
- 14,210,194, 63, 65,211, 52,150, 44, 89, 98, 13, 14, 14,182, 40, 20, 10, 78, 34,145,136,167, 77,155, 86,101, 58,199,143, 31,207,
-169, 84, 42,171, 66,161, 16,207,155, 55,175,220, 76,161, 51, 55, 50, 32,151,136,160,144, 10,209,184, 65, 24,164,156,209,237,180,
- 10, 4,101,189, 17,164, 82, 41, 58,119,238,140, 22, 45, 90,224,224,193,131,221,121,161,197,131,199,115,129, 10,103, 24, 10, 1,
-224,200,145, 35,221, 80,242, 65, 68, 68, 71, 71, 19, 37,103,112,152, 49,101, 24,222, 28, 55, 10, 12,195,150,126,231,139, 32, 9,
- 76,126,163, 63, 88,214,157, 17,137,170,167,120,214,224, 58,165,156, 28, 65, 10, 0,160, 81,189, 16,110,226,155,255, 1,195,178,
-127, 13,148, 8,128,183,199,245, 43,217, 86, 11,233, 20,128,193,135,147, 94,133,171,235, 52,109, 84,135,164,173, 38, 16,101, 63,
-246,248,119,124,108,147,231,116,129, 22,117, 67, 34, 40,163, 17, 38, 19,133,248, 59, 5,198, 83, 25,250, 64, 82,149,170, 94,245,
- 90, 7,153, 64,157,137,122, 94,146,198,217,122,234,185,200,187, 82,169, 28,179,113,227,198,114, 34, 43, 39, 39,135,212,233,116,
-176, 90,173,172, 86,171, 5,195, 48,152, 57,115,166,104,206,156, 57, 99,178,179,179,231,217, 53,143, 43, 78,155,223,213,140, 91,
-183,110,213,155, 61,123,182,181,103,207,158, 15, 27, 52,104,160, 23, 8, 4, 8, 9, 9, 89, 21, 21, 21,229,187, 96,193, 2,107,
-255,254,253, 83, 5, 2, 1, 26, 55,110,172,255,243,207, 63,235, 1,144,187,155,119, 71,206, 45,103,214,112, 0, 64, 16, 4,162,
-162,162,210, 26, 55,110,172, 23, 8, 4,184,123,120, 49,231,238,253, 20, 9, 73, 52, 9,245,182, 53, 34, 4, 32,247, 44,245,196,
-139,138,138, 74,111,218,180,169,142, 36, 73,220,188,121, 51, 12,229, 63,107, 85,142, 83, 46,151, 83,175,191,254,250,195, 59,119,
-238,184, 58, 30, 66, 1,137, 14, 77,109, 6,172,208,182, 64,250,197, 10,211, 41, 18,128,158, 51,101,180, 80, 37, 3,164, 94,254,
-102,141, 70, 3,165, 82, 89, 98, 33,179, 90,241,251,239,191,163, 99,199,142,221,246,236,217,115,142,127,222,121, 78,158,243, 47,
-184,210, 34,207,160, 53,203,241, 67,247,101,124,180,206, 58,103,138, 97,104, 52, 8, 15,194,226,255, 27, 15,134, 97,193, 48, 12,
-104,219, 47,195, 48,160,172,214, 90, 73,217,227, 92,199, 71, 41, 95,240,195,174,119,125,122, 14, 89,218, 43,110,246,184, 83, 12,
- 3,176, 44, 5,138, 2, 24,150, 2,203, 48,160,168,218,113,205,161, 88, 22,245,194,130, 17, 55,123, 28,156,175,179,253,187, 61,
- 3,207, 28,138, 85,116,141, 94,244,225,221, 52,195, 18, 94,216, 63, 89,200,196, 82, 33, 39,148,193, 98,161,161,181,176, 22, 0,
-122, 19,197, 90, 57, 15,127, 25, 0, 8, 73,226,121,154, 93,219,162, 97,195,134,101, 68,214,178,101,203,252,215,173, 91, 23, 10,
- 0,195,134, 13,203,232,213,171, 87, 94, 82, 82, 18, 66, 66, 66,136,188,188,188, 1, 0,222,179,157, 59, 3,192,186, 10,120,245,
-225,225,225,166,128,128, 0,179, 93, 16,145, 36, 9,161, 80,136,240,240,112, 83, 96, 96,160,185,113,227,198,122,177, 88, 12,146,
- 36, 97, 23,122,110,117,243, 8, 2, 2,129, 0,118, 78,103,107,143,157,179, 58, 16, 9,201,242,205,155, 3, 39, 73,146, 46,175,
- 87, 97, 29,146,201, 56, 0, 21, 30, 47, 32, 29,154, 71, 97,229, 30, 2,241,191, 67, 4,224, 44,199,113,184,126,253, 58, 82, 82,
- 82, 32, 22,139, 17, 28, 28,140,121,243,230,193,108, 46,209,187,195,135, 15,239, 6,224, 38,255, 4,243,224, 81,138,179,207,160,
-192,114,182,106, 85,238,163,117,228,200,145,110,209,209,209,231,236, 2,168, 68,236,184, 16, 63, 20, 13,138,178, 2, 28, 87, 43,
- 66,171,162,235, 48, 12, 91,233,117,236, 62, 90, 44,203, 9, 93,138, 44,150, 5, 77, 81,181,114,247, 88,134, 2,203, 82,112,117,
- 29,130, 32, 25, 91,131, 47,230,159,147, 39,143,224,240,122, 36, 21,222, 0, 23,104, 19, 66,253,164, 18,228, 25,209,240,133,102,
-130,223, 13, 20, 46,221, 72,132,191,167,242,185, 41, 23,131,193, 16, 40,147,201,160,215,235, 75, 45, 89,235,214,173, 11,181, 88,
- 44, 36, 0, 8,133,162, 48, 53, 27, 42, 99, 88,192, 91,153,133,194,194, 98, 63,142,227, 8,155,224, 89, 10, 96, 11, 42,137,238,
- 47, 22,139, 75, 5,138,163, 0,146, 74,165, 53, 18, 48,118,216,197,153, 88, 44,118,185,221,121,120,173, 42,136, 29,133, 22,184,
- 18,171,150,147,216, 18, 8, 4,176,251, 70, 85, 5,137, 68, 82,154,119, 87, 16, 10, 28,174, 39,168,190, 43,166,213,106,133, 78,
-167, 67, 81, 81, 17,100,178, 18,131, 25,199,113, 32, 8,226, 61, 0,239,243, 79, 49, 15, 30,174,181,200, 51, 44,182, 92, 11, 45,
-148,152,236, 8, 0,160, 41,171, 75,241,179,231,240, 37, 60,204,214, 35,216,255, 23,112,213,140,122, 58,114,228,200,173, 33, 33,
- 33, 29,236,235, 82,185,167,223,196,119, 63, 3, 77, 91,225, 37, 39,241,214,152,126,101, 68, 86,137, 69,203, 82,225, 55, 65, 10,
-139,245,159,246, 27,190,122,190,183,210,239,138,179,248,137,139,191,246, 90,161,198, 28, 70,146,191,162,144, 8, 97,134,191,253,
-217,120,135,198,253,198,174,245,115,167,187,109, 15, 36, 72,209,107,147, 86, 77,228,132,158,205, 21,164,246,252,199,227,254,117,
-192, 81,204,249,250,250, 30,233,243,218,202,222, 57, 5,188,143,214,211,128,151,183,138, 12,123,185, 59, 94,126,239, 43,156,249,
-228, 99, 14, 40,132, 95, 72, 40,217, 99,202, 23,240,124,121, 32,174,190, 53,134, 5, 10,158,139,188, 42, 20,138, 92,131,193, 16,
- 98, 52, 26,161,209,104,160,209,104,202, 10, 2,145,136,152,248,206, 84,127,145, 88, 2,202,106,193,241,237, 95, 84,201,105, 15,
-225, 48,176,165, 23, 4, 34,137, 54,161, 97,195, 85, 66,161, 16, 36, 73,226,240,218,143,223,219,191,252, 93, 47, 0,184,113,100,
-173,102, 84,236,154,213, 36, 73,194,108, 54, 75,171,147,238, 71,143, 30,133,153,205,102,147, 77,160,217,133, 31, 30, 60,120, 80,
-215,108, 54, 27, 29,183,187, 3,185,194, 11, 80, 53, 0, 20,129,229,172,103,169,169,169,117, 40,138, 50, 8,133, 66, 88, 44, 22,
-183, 84, 17, 73,146,226,155, 55,111,134,177, 44,235,242,248, 22, 17,117,128,224,150,128,196,219,237, 60,115,110,116, 68,109, 98,
-235,137, 69,144,230,193,227, 89,177,108, 61,131,207, 4, 81,193,255, 82,161,213,253,200,145, 35,156, 99, 15,145,166, 40,155,200,
-250, 75,244, 48, 12,139, 76,181, 9, 73, 73,119,177,114,229, 74, 92,186,250,145,247,130, 5, 11,164,115,230,204, 49,143, 28, 57,
-114, 57,203,178,173, 72,146,188,129,191,134, 42,202, 90,133, 88,182,238,181,107,215, 26,218,215, 41,138,130,151,151, 23,188,188,
-188,208,180,113, 88, 57,145,197, 48, 12,172,149, 12, 29,218,125,180, 8,142,229, 40,138, 1,195,178,165,226,167, 80, 99, 14, 59,
-116,250,122, 35,135,195, 95,176,255,233,220,174,121,197, 98,112,210,188,210,124,236, 90, 63,119,250,130,205,155,165,133, 76,192,
-180, 81,175,189, 25, 57,124,212, 24,188,254,234, 43,221,204, 22,203, 65, 1,201,177, 84,233,245, 64,130,131,179,143, 22,143, 39,
-132,228, 34, 61, 37,146,202,225, 25, 92, 31,119,117,140, 88, 32, 16,252,114,191,200, 32, 38, 5, 66,144, 66, 49, 18, 10, 77,212,
-115,148,221,132,228,228,228,144,186,117,235, 66,163,209,128,166,105,118,216,176, 97, 25, 66,161, 40, 76, 40, 18, 17,209,163,166,
-178,217,217,153, 20, 73, 10,192,113, 12, 94, 25, 62,137,144,202,228, 98,171,197, 66,163,100,232,208,149, 53,203, 49,132,131, 87,
- 84, 84,148,175,125, 38,224,254,229,239,122, 57,236, 83,190,244,210, 75,190,142,179, 14,221,180, 22, 17, 35, 71,142,148,135,135,
-135, 19, 0,240,235,246,217,118,235, 25, 49,112,224, 64, 89,120,120,137, 31,254,143,107,223,117,155,211, 95,193, 1,197, 15,128,
-226,212,114,150,172,129, 3, 7, 74, 27, 54,108, 88,173,103,209,230, 0, 95, 97,236, 46, 15, 33, 13,100, 95,119,139, 43,166, 13,
-168, 80, 79, 8,151,191, 66, 66,226,233,103,238,240,241,137,159,121,177,197,131,135, 91,112,210, 34,207, 20,186,217, 4, 98,119,
-219,111,169,224, 18, 2,128,205, 68, 71, 56,232, 44, 80,180,181,156,200, 98, 24, 6, 34,194,140,149, 43, 87,226,253,247,223, 7,
- 0,241,244,233,211, 15, 44, 88,176, 96, 40,203,178,173, 56,142,235, 66, 16, 68,101,189,198,179, 33, 33, 33, 57, 28,199,137, 72,
-146,236,178,118,237, 90,223,254,253,251,195,203,203, 11, 28,203,149, 19, 89, 12,195,194,106,181, 84,248,153, 91, 31,165,124,193,
- 15,123,166,249,244, 28,188,180, 23,195,178,167,236, 34,139,101, 24,128, 45, 57, 41, 63, 55, 3, 39,143, 31,196,134,245, 27, 10,
- 65,112,183,193,129,181,137, 65, 84, 32, 6, 91, 93,252, 53,177, 75,231,118,205,177, 96,243,102,233,173,107, 89, 7,166,126, 48,
- 43,114,248,168, 49,216,243,221,118,144,116,209,117, 71,145,197, 80, 44,138, 11,243, 6,254,196,251,104, 61, 45,248,158, 60,117,
-138, 24, 51,102, 12,171,213,106, 33,150, 72, 88,138,162, 4,255,254,247,191,153,247,223,127,159,204,206,206,134, 70,171, 19, 2,
-240,197,115, 96,214,210,104, 52,219, 39, 77,154,212,237,252,249,243, 98,146, 36,161,209,104,208,163, 71,143, 60, 53, 27, 42,155,
-248,206, 84,255,204,204, 12, 90, 41, 23,154,197, 98, 17,114,115,115,217,110,253, 71, 27, 71,141,127,191,206,251,179,227, 54,102,
- 93, 94,191,206,157,107, 56,206, 4,116,222,183,105,211, 38, 75,104,104,168, 73, 42,149, 74,198,141, 27,231,214,248,161,197, 98,
-225, 22, 47, 94,108,118,158, 93,104,177, 88,184,149, 43, 87, 90,194,194,194,204,114,185,156,163,168,170,253, 62, 73,146,160,223,
- 90,176,131,166,105,186,140, 21,203, 46,178, 40,150,208,125,245,213, 87,214,176,176, 48,139, 66,161,224,164, 82,169,216,157,116,
- 78,157, 58,149,243,241,241,177,122,120,120,136, 99, 99, 99, 31,107,214, 33,197, 64,184, 96,109,105,120, 7,169,151,151, 23,180,
- 90,109,105, 90, 67, 66, 66,120,177,197,131,135, 11,148,211, 34,207,166, 21,206,189, 56, 90, 44,160,203,201,205, 11,244, 15,170,
- 15,154,166,109, 11, 5,154,162, 48,237,237, 81, 88,190,254, 43, 0,176,139,173,168,233,211,167, 31, 0, 80,101, 99,182,107,215,
-174,249,211,167, 79, 87,230,228,228,156,216,186,117,171,239,232,209,163, 49, 99,198, 12, 44, 93,186, 20, 34,137, 12,190, 1,117,
- 75,175, 99,191,110,158,186, 0, 28, 56, 93, 5,118, 58,107, 73, 35, 5,161, 95, 64, 61, 80, 12, 5,150,162, 64, 81, 20, 8, 65,
- 73,214, 78, 30, 63,136,209,111, 76,133, 72,170,244, 89,179,114,137, 49,242,229,144,161,115, 38, 76, 48,187, 97, 4, 36,111, 93,
-203, 58, 48,245,253,216, 40,187,200,218,183,125,253,237, 47,103, 14,222, 41,149, 8, 75,175, 67,177, 44, 72, 82,192,251,104, 61,
- 37,145, 37,149, 74,247, 30, 59,118,236, 94,219,182,109, 9,189, 94, 15,138,162,144,151,151,135, 3, 7, 14, 36,112, 28, 7, 31,
- 31, 31, 28, 59,118,140, 29, 61,122,244, 94,179,217,252,218,179, 46,182,178,179,179,239,200,229,242, 93,179,102,205, 26, 53,115,
-230, 76, 17,203,178, 72, 74, 74, 2, 8,130, 19,137, 37, 32, 73, 18, 34,145, 16,197,197, 26, 86,225,169,202,178,114, 2,133, 72,
- 44, 1, 41, 16, 87, 54, 77,248,161, 45, 24, 41, 72,161, 88,107,159, 9, 40, 22,139,113,117,207, 50, 77,247,113,243,149, 0, 32,
-150,202, 11,251,244,233,147,214,188,121,115,253,111,191,253, 86, 15,229,103, 29, 58, 63,159,244,144,113,177, 2,133, 92,166,143,
-138,138,122,104,231, 76, 61,181, 70, 51,102,242,108,130, 16, 72,244,209,209,209,105,145,145,145,122,129, 64,128,196,131, 75, 52,
- 67,198,197,202,136, 74,130,172,158,184,199,189,117, 99,207,133,166, 95,124,241, 5,213,191,127,255, 71,118,127,177,212,212,212,
- 58, 3, 6, 12,144,174, 88,177,130, 26, 48, 96, 64,250,139,255,207,222,117,199, 53,113,254,225,231, 46,155,189, 71, 16, 68, 69,
- 81, 20,112,139, 11,197, 58,107, 29,173,226,194,189, 71,157,173,179, 14,220, 74,221,168,117,214, 90,220, 84,171,162,214, 81, 23,
- 42, 46, 16, 7, 67, 69, 1, 25, 97, 67,128,144,157,187,223, 31, 36, 52, 32, 35, 65, 91,107,127,121, 62,159,124,146,220,189,247,
-220,123,251,185,239,251, 29, 94, 94,197, 36, 73, 34, 50, 50,210,185, 58, 75,149, 6, 70, 70, 70,138, 9, 19, 38,188,123,254,252,
-121,109,163, 14,171,133,139,139, 11, 40,138, 66,183,110,221, 32,145, 72, 12,150, 45, 3, 12,248,111,162, 98, 30,173,170, 51,195,
- 43,148,138,111,167,204, 94,185, 19, 32, 76,181,238, 2,127, 25,150,104, 16,223,127,255,157, 9, 0, 35,141,216,154, 59,119,110,
-141,101, 78,180, 68, 86,155,128,128, 0, 44, 94,188, 24,155, 55,111, 86,253,248,227,143,140,248, 87,137,242,177,211, 87, 20, 84,
- 88, 15,104,208,197,148,130,250,182, 50,190,124,161,104,133,239, 87, 27, 86,166,101,150,220, 25, 59,109,105,217,221, 75, 5,160,
-144,224,171, 0, 96,207, 79, 63,137, 88, 92,115,147, 33,195, 71, 1, 64,207,157,219,130,206,172,193,129,154,197, 22, 77,120,124,
- 59,119,129,149, 70,100,237,218,186,246,185, 5,145, 25, 60,243,187, 24,133,246,122, 0,192,218, 12,103,124,191,218,208, 59, 43,
- 79,180,221,112,158,253,115,224,112, 56,171,175, 95,191,110,226,237,237, 77,228,230,230, 66,165, 42, 61, 34,114,185, 28, 66,161,
- 16, 69, 69, 69,144, 74,165,104,221,186, 53,185, 99,199, 14,147,153, 51,103,174,150,201,100,211, 63,247,237,126,251,246,237,174,
-115,231,206,225,214,173, 91,195, 22, 45, 90,196,114,116,116, 36, 44, 44, 50, 9,133, 92, 6,128,166,179,179,179, 41, 99, 83, 75,
-129,173,131,243,187,244,140, 44, 15,133, 92, 6, 74, 37,175,210,219, 92,157,222,225,251, 23, 47, 94,212,219,180,105,147, 76, 59,
- 18,112,248,130,157, 59, 90,183,110,109, 29, 28, 28, 44,235,215,175, 95,178,198,121, 93, 23,103,248, 43,111, 48,251,197,139,103,
-205, 42,114,250, 77,222,116, 80,195,169, 29,141,216,255,187,189, 7, 27, 53,106,100,237,233,233,153, 92, 29,111,131, 6, 13,196,
-124, 62, 95,214,164, 73,147, 98, 22,139, 85,106,201, 82, 40, 74, 26, 52,104, 64, 57, 56, 56,200,154, 54,109, 90,172,175,211,190,
-145,145, 17,173,177,138, 85, 6,125,162, 14, 89, 12, 40, 3, 2, 2,202, 50,195,127,223,168,145, 96,212,168, 81,252,121,243,230,
-225,224,193,131,184,123,247,238,123, 98,191,107,215,174,184,125,251,246, 74,252,135, 18,235, 26, 96,192,255, 25,170,207,163, 85,
- 17,135, 14,133,252, 9, 45,159,166,202,176,102,205, 26,174,218,146,213,115,206,156, 57, 16,139,197, 86,149, 52,235, 1,117,174,
-141,202, 68, 86, 80, 80,208, 49,154,166,157, 1,116, 86,169,168, 7,251, 15, 28,234, 86,213,250,134, 12, 25,242, 30, 39, 77,144,
- 12,146, 36,138, 57, 44,250,201, 79,251, 14, 30, 41,215,190,212,249,189, 49, 8, 60,221,185, 45, 72, 12,160,103, 69,177,133,191,
-202,140,148,113,106, 48,117,218,212, 50,145,181,115, 91,208, 85,207, 54,117,191, 89, 58,113,117,165,226,108,245,138, 41, 38, 36,
- 73,116,172,224,163,245, 30,231, 71,128,129,243, 47,116, 11, 8, 8,104,238,227,227, 67,106,139, 44,153, 76, 86,150,184, 83,227,
- 44,158,150,150,134,174, 93,187,146,205,155, 55,247,122,248,240, 97, 55,252, 85,206,233,115,221,118,213,219,183,111,119, 56, 58,
- 58, 94, 91,190,124,249,168,156,156,156,175,242,243, 11,108,194, 14,173, 70,159, 33,211,136,174,125, 71,136,100, 52,147,151, 42,
-200,108,114,243,226, 81,235, 75, 39,118, 65, 46,147, 77, 1, 16,135,191,210, 59, 84,228, 44,209,164,113,104,210,164,137, 72, 91,
-168,212,173, 91, 87,226,228,228, 36,245,244,244, 44,155, 94, 69, 52,223,123,219,174, 47,167,218,255, 75, 84,211,254,212,136,182,
-138,105, 35,140,141,141,161, 17, 95,250,244, 83, 59,218,178,210, 27,101,205, 81,135,101,156,234,244, 14,229,116, 90, 72, 72, 72,
-143,144,144,144, 54, 0,158,160,180,214,161, 2, 40, 29, 74,212,114,154, 15, 84,127, 12,215,187,129,243,255,149,243,115, 70, 87,
-252,229,155, 5,148,250,106,221,170, 82,104,213, 4,141,227, 59, 0,114,238,220,185,249, 98,177,216,106,212,168, 81,213, 46,147,
-145,145,113,240,240,225,195,229, 68,214,160, 65,131,198,133,134,134, 94,203,202,202,170,213, 86, 89,153, 27,173,185,117,126,161,
- 85,215,126, 27,230, 0,248,177, 10, 67, 30,229,217,134,255,205,206,109, 65,103, 42,136,173, 95, 1, 12,170, 74,149,246,250,114,
- 32,142, 30,218,169,241,237, 50,122,254, 56,237,210,176,168, 85,149, 70, 43, 90,154,114, 87,169,251, 49,207,224,163,245,207,128,
-205,102,251, 45, 90,180,136, 45, 18,137,222, 19, 89, 21,133, 86, 97, 97, 33,158, 62,125,138,177, 99,199,114,163,163,163,253,228,
-114,249,141,255,194, 62,200,200,200,136, 87, 39, 35,157,173, 73,225,192,229, 25,177, 71,140,159,227, 92, 22,117,120, 98, 23,164,
- 18, 49, 0, 48,117, 73,239,192,100, 50,217,209,209,209,174, 26,171,149, 92, 46,231,106,166, 63,126,252,216, 85,147, 91, 75, 34,
-145,232, 28,117,248,119,113, 62,123,246,204, 89, 19, 29,169,137, 46,100, 50,153,236,200,200, 72,103, 13,167, 84, 42,213, 41,234,
-144,195,225,176,163,163,163,157, 85, 42,213, 71,139, 58,212, 22,198, 40,173,179, 88,174,214,162,218,183,140, 32, 8,130, 54, 12,
- 27, 26, 96,192,103,143,138,145,146,213, 23,149,174, 9, 26,199,119, 61, 22, 97,186,184,184,244, 26, 62,124,120, 57,145,229,239,
-239,175, 58,125,250,244, 77, 62,159,159, 73,146,100,188,190,253, 40,243,209,194,123,111,144, 32, 73,242,105,231,182, 77, 65,146,
-228,211,165, 19, 39, 74,215,224, 64, 57,177,117,246,204,201,222,169,249, 49,149, 75, 51, 0, 54,246,117, 16, 48,238, 91, 4,140,
-251,214, 10, 64, 39,160,234,104,197,234,250, 97,192,223, 3,130, 32, 56, 78, 78, 78,207, 37, 18, 9, 8,130,128, 84, 42, 45, 19,
- 88, 69, 69, 69, 16, 10,133,101,255,229,114, 57,178,179,179, 81,183,110, 93, 16, 4,241,159,246,163,147,203,229,202, 69, 43, 55,
- 29,102, 48,217, 74,138,146, 19,114,185,124,188, 62,215,249,162, 69,139, 72, 84,226,123, 53,115,230,204, 74,167,127, 42,206, 37,
- 75,150, 84, 26, 37, 56,115,230,204,106,163, 7,171,194,119,223,125,247,209,162, 14,117,191,125, 25, 96,128, 1,255, 49, 84, 26,
-186, 87, 43,161, 69,146,228,211, 74,162, 11, 9, 0, 52, 73,146, 79, 43,201,114,160,124,247,238,221, 74, 75, 75,203, 41, 34,145,
-232,143, 65,131, 6,205,245,247,247, 87, 1,165, 14,242,181,221,162,124,161,104,133, 95,255,141,243, 10,138,165,193, 21,231, 85,
-180, 60,105,196,214,174,237, 65,187,207,132, 30,247,207, 72, 79,221, 93,213,182, 85, 37,168,170,138, 86, 20, 22,138, 87,250,245,
-223, 56, 39,191, 80,108,240,209,250,135,160, 82,169,174, 24, 25, 25, 17,154, 98,202,218,214,171,194,194, 66,148,148,148, 64, 93,
-146, 6, 0, 80, 92, 92, 12, 11, 11, 11,168, 84, 42,250, 63,182, 43,164, 0,230,171,173, 85, 0, 48, 63,241,230, 14,237,115,251,
-153,246,188,106,172, 89, 2, 93, 10, 68, 87,182, 92,117,243,254, 6,206,204,106, 10, 68, 87,135, 76, 61,249, 50, 1,128,205, 98,
-100, 85, 85, 60,154,205, 98,100, 85,227,183,175,231,123, 3, 65, 3, 88,105,184,178, 13, 48,224,243,125,255,255, 84, 43,238, 97,
-224, 52,112, 26, 56,255, 17, 78,174,250,163,235, 60,195,254, 52,112, 26, 56, 13,156,255, 54,206,202, 48,249, 51, 17, 90,116, 37,
- 31, 0,181,180,104, 25, 96,128, 1,255, 58, 72,107, 57,207, 0, 3, 12, 48,192,128, 15,199,123,197,164,181,103, 84,165, 74,245,
-137, 38,168,141,178,189,102,224, 52,112, 26, 56, 13,156, 6, 78, 3,167,129,243,255,142,179, 38,110,237,229, 39, 3,216,247,153,
-136,173, 79, 18,208, 98, 48,171, 26, 56, 13,156, 6, 78, 3,167,129,211,192,105,224,172, 45, 12, 67,135, 6, 24, 96,128, 1, 6,
- 24, 96,128, 1,255,231,208, 47, 97,169, 1,149,160,238,192,165,160,176, 68,189, 59,131,144,114, 54,240,191,182,137,254,254,254,
- 12,125,218, 39, 38, 90,146, 81,224,111, 54, 55, 97,247, 47, 22, 41, 54, 83, 81, 43,130,107, 58, 17,109, 27,180, 26,109,204, 51,
-158, 46,147,201,234,155,154,153,101,229,229,102,239,201,123,247,108,151, 86, 27,243, 7, 15, 30,240,125,124,124,210, 1, 20,105,
-189, 41, 24, 96,128, 1, 31, 19,150, 77, 93, 64, 16,227, 1,250,175,176, 75,138,142,129, 48,238, 80,185,118, 22, 30,227, 64, 18,
-205,180,166,136, 65, 99, 63, 10, 98, 83,106,120,224, 88, 38, 36, 36,184, 54,108,216, 48, 25, 64, 65,197,181, 87, 50,207,112,157,
- 27,240, 57,163, 43,202, 39, 44, 45,187, 22, 62, 92,104, 53, 26, 84, 31, 74,114, 12,104,140, 4,129,104, 36,134, 14,174, 21,143,
-219, 55,117, 64, 49,219, 1,104, 5,208,173, 76,140,120, 45,197, 50,121, 22, 69,211,163,241,230,228, 19,189,249,234,251, 79, 67,
-213,229, 44, 86, 34, 49,244, 39,189,248, 40,250,135, 71,183, 79,115, 45,141, 9, 52,108, 61,104, 1,202,103,112,174, 45, 56, 0,
-124, 73,146,108,102,108,108,204, 47, 41, 41,201,166, 40, 42, 5,165,227,211,249,181,228, 36, 1, 76, 48, 53, 49,233,227,106,198,
-105,245, 46, 71,152, 86,164, 80,133,163, 52,161,107,254,199, 58,163, 74, 69,150,227,190, 57, 35,124,198, 6,205,234, 1, 75,191,
-141, 11, 74,128,234,132, 22,225,220,184,227,217, 97,195,135,248,205,152, 60,214,180,142,157, 41, 4, 57, 34,155,159, 14,134,108,
- 10, 9, 57,218,111,226,176,158,125, 0, 96,245,234,213, 95,187,184,184,212, 99, 48, 24,137,203,150, 45,251,117,197,138, 21, 52,
- 81,117,165,114,190,250, 28,214,220,240, 77, 0,120, 2,104, 0,224, 45,128, 23, 40,159,101,188, 54,248, 44, 56,235,212,169,227,
- 68, 81,212, 68, 7, 7,135,175, 50, 51, 51, 47,144, 36,121, 32, 45, 45, 45,253, 83,222,117,104,154,222, 75, 16,196,100,154,166,
-247,233,241, 61, 69,159,117,240,120,188, 76,137, 68, 98,175,254,157, 37,145, 72, 28,254,174,237,249, 39,215,245, 15,189,127, 79,
-186,114,231, 69, 31,237, 73,189, 58, 55,171,228,142, 66, 52,187,114, 39,166, 75,249,118,158,170, 42,238,129, 4, 77,211, 88,185,
-114, 37,177,106,213,170,113,110,110,110,141, 72,146,124,185,124,249,242,114,169,111, 42,206,211,186,206, 13, 98,203,128,207, 21,
-250, 21,149,174, 17, 77,253, 77, 32,161,253, 1, 98,108,215,182, 45, 59, 79, 25,221,159,160, 25, 60,140,152,180, 80,169, 55,151,
-235, 88, 46, 24,226, 53,222,205, 26,207, 29,210,191, 7,217,198,179, 30,248,118, 22, 0,201,194,222,139, 73, 54,193, 65,203,118,
- 3,240,169, 69, 47, 87,188,137, 56,102, 47, 40, 80,129, 32, 0,130, 0, 72, 2, 40,150, 80,232,245,245,152, 21, 0,126,210,243,
-174, 68, 90, 26, 19,152,123, 76, 2, 0,140,143,112, 80,234,217,217,217,141,155, 61,123,182,137,167,167,167, 37,143,199,227, 72,
- 36, 18,135,132,132, 4,187,101,203,150,121,138,197,226,243, 0, 30,233,201, 89,183,161,179,211,201,224,185, 19,218, 53,111,224,
- 10,150,172, 24,148, 84,228,242, 42,225,117,135,169,187, 79, 77,138,201,147, 12, 71, 45, 74, 38,228,228,228, 16, 0, 96,107,107,
- 75,151, 23, 89,237,199,110,157,215, 11,115,183, 92, 65,137, 68,118,164, 58, 14,235,122, 45, 70,125,243,205, 64,191,181, 63,204,
- 52, 77,203,149, 35, 58, 81, 12,107, 83, 54, 86,204,159,198,145, 74, 21, 29,118,255, 26, 50,121,231,134,133,251, 85, 42,213, 23,
- 0,218,168, 84,170,199, 0,126, 93,185,114,101, 85, 55,223, 85, 0,150,168, 79,232,163, 12, 6,227,106,183,110,221,234, 79,156,
- 56,145,104,221,186, 53, 34, 35, 35, 27, 28, 59,118,172,199,133, 11, 23, 18, 85, 42,213, 51, 0, 47,161, 46,123,162, 3, 88, 0,
- 26, 51, 24, 12,239,127, 51, 39,159,207, 55,146,201,100, 99,156,157,157, 39,119,236,216,209,187,127,255,254, 68,227,198,141, 17,
- 31, 31,223,250,210,165, 75, 43,194,195,195,159,165,166,166,238,227,112, 56,135, 5, 2,129,248, 31,127,142, 19,196,100, 0, 78,
-106,157,188, 82,135,239,116,148,230,146, 18,232,186, 14,137, 68, 98,175, 41, 97, 67, 16,132,253,223,185, 61,122,174, 43,150, 32,
- 8,107,117, 91, 84,247, 77,146, 36,148, 74,165, 72,165, 82,185,213,192,217, 88,253, 34,165,179,214, 5, 80, 93, 34,104, 35, 0,
-232,213,169, 89, 30, 8,196,148, 89,180,222,127,201,140, 41, 19, 96, 52,154, 93,185, 27, 99, 93,206, 10, 86,241, 45,118,229, 74,
- 98,197,138, 21, 8, 12, 12,236, 15,192,151,162,168,112, 15, 15,143, 29,229, 40, 41,170,108,222,138, 21, 43,182, 87,115,157, 27,
- 96,192,231, 2, 63,232, 83, 84,186,202,247, 31,183,193, 93,160,194, 88, 87, 27,123,255, 89, 19,135, 26,121,122, 52,132, 4,166,
- 72,202, 81,225, 98,216, 37, 0, 56,161,159,213,105,104, 27, 38, 83,114, 56, 40,112,126, 19,223,118,158,120,158,166,192,227, 52,
- 21, 74, 18, 21, 96,144, 10,168, 40, 26,160, 33,169,237, 86,167,230, 43,113,231,165, 12, 36, 1, 48, 72,128, 36, 9, 48,200, 90,
-146, 81,178, 87,171, 15, 69,121,230,100, 82, 0, 37,123,245,129, 7,164,153,187,187,251,168, 85,171, 86, 89,102,100,100,152, 68,
- 70, 70,130,203,229,194,202,202,138,193,231,243,157,182,108,217, 34,158, 53,107,214, 87,114,185, 60, 9, 64,142,142,156, 30,125,
-219,120,223,219, 23,180,218, 66,241,224, 18, 10,142,255, 6, 6, 73,131,109, 98,138,250, 70, 70,184,244, 77, 67,107,255,176,196,
-211, 15, 51, 69, 30, 0,210,106, 34,139,139,139, 99, 72,165,210,225,230,230,230,237, 89, 44,150, 3,207,170, 30,149,206,108,147,
-155, 77, 52,120,155,101, 95,210,101, 94, 15,135, 62,155,231,116,195,220, 45, 87,176,237,216,253, 95, 90, 33, 99,121,117,121,179,
-141,141, 77,167,204,154, 62,209, 52, 53, 71,142, 53,167,115,112,232,118, 33,198,248,154, 97,238,151, 22, 8, 24, 49,204,228,212,
-111,161, 83, 0,236,215, 90, 36,222,195,195,131,136,139,139,171,236,230,107, 5, 96,161, 76, 38, 35,217,108, 54,193,227,241, 70,
-173, 93,187, 86, 62, 98,196,136, 84, 77, 3, 95, 95, 95,248,250,250, 18, 69, 69, 69, 13,110,220,184,209, 32, 36, 36, 68, 25, 17,
- 17, 17, 11,224,108,213, 22, 11,163,119, 18,137,216,133,103,100, 84,242,211,238,221,155,187,116,233, 66,113,185,127,165,159,170,
- 13, 39, 0, 88, 88, 88,236,183,183,183, 39, 22, 47, 94,156,254,177, 56,235,213,171,119,165, 93,187,118,221,122,245,234,197,236,
-212,169, 19,156,156,156,202,230,217,218,218,194,215,215,151, 72, 73, 73,105, 30, 30, 30,190,251,202,149, 43, 59,158, 60,121,114,
- 35, 41, 41,169,215, 63,108,209,218,167, 22, 19, 2, 61,219,127,246, 32, 8,194,116,239,222,189,246,154,154,140, 10,133, 2, 42,
-149,170,236, 91,243,161, 40, 10, 42,149, 10,107,215,174, 85,137, 68, 34, 93,246,145, 72,235,173, 89,243,161, 42,251,230,112, 56,
-182,154,132,189, 53,220,217, 99,248,220,130,166, 38, 38, 38,174, 0,250,194,174,209,194,242, 13, 74,223,159, 69, 34, 81,178, 64,
-106, 25, 3,160, 75, 53,108,150,171, 86,173, 26, 19, 24, 24, 56, 80,203, 74,235, 61,100,200,144,138,101,175,188,213,223, 34,130,
- 32,110,146, 36,121, 30,192, 33,124, 68,171,187, 1,255, 45,208, 52,221, 22,128,157,214, 36, 25, 74, 71,133,160,126, 78, 18, 0,
-108, 42, 76,215,110,167,249,206, 86, 79,183, 83, 47, 71,107,241,102, 19, 4,241,168,150, 93,188,133, 42,252,180,152, 0, 16, 22,
- 22, 70,247,235,215,143,208,124, 87, 46,138,252, 47, 78, 24, 49,160,207, 87,221, 59,130,228, 89,225, 85, 22, 16,241,142, 6,147,
- 84,128, 4,141, 7,119,111,208, 96, 82,135, 43, 44, 85,181,245,164,222,224,239,188, 61, 61, 54, 30, 8,154,205,136,205, 98,226,
- 80,120, 9,228,146, 98,100,103,188, 67, 86,122, 50, 4,169,111,145,246,238,237, 51,128, 88,161, 51,231,123, 7, 6, 80, 81,234,
-119, 64, 10,168, 38,242,178,102, 78,185, 40,174, 65, 99, 79,207,124,142, 10,144,139,226,116, 88,125, 85,156, 94,141, 26, 53, 26,
-241,195, 15, 63, 88,191,120,241,194,168,164,164, 68,122,233,210,165,248,164,164, 36,115, 62,159,159, 55,109,218,180, 70, 78, 78,
- 78,230,131, 6, 13,226, 28, 63,126,252,107,148, 15,107,173,138,211,115, 64,251,150, 17, 7,119,108, 53,201, 61, 21, 12, 89,194,
- 83, 92, 20,136,112, 55,179,132,110, 96,193, 37,190,109,110, 7, 83, 46, 19,171, 59, 57,153,246, 61,147,176, 81, 65, 81, 1,213,
-113,222,187,119,143,111,108,108,188,101,228,200,145,252,153, 51,103,114, 85, 76, 75,102,104, 68,174,197,194,221, 17, 78, 37, 82,
- 57, 99, 68,183,122,152, 55,210, 27,243,182, 93,215,136,172,201,245,235, 23, 80, 81, 81, 85,115, 42,228,242,250,206,246,230,136,
- 78, 18,227,208,237, 66,252,249,131, 19,186,175, 77,199,160, 86, 76,120,212, 53,133, 82,174,104, 60,100,200,144,195,234,183,246,
- 71, 0,190, 30, 50,100, 72, 19, 6,131,113, 29,192,239, 53, 29, 35, 30,175,242,234, 41, 86, 86, 86,232,218,181, 43, 60, 60, 60,
-152, 93,186,116,241,174, 32, 96,202,113,202,229, 50, 62, 69,209, 48, 51, 51, 51,178,177,177,177, 50, 51, 51,203,173,236, 65,165,
- 15, 39, 0, 88, 91, 91, 15,238,218,181, 43,243,216,177, 99, 57,137,137,137, 15, 70,140, 24,241,214,220,220,188,156,245,215,196,
-196, 4,141, 26, 53,194,178,101,203,152,125,250,244,169,145,211,193,193,161,103, 72, 72, 8, 8,130, 40,123,104,191,103, 44,118,
-117,133,163,163, 35,250,246,237,203, 28, 60,120,112,207,164,164,164, 90, 93, 71,122,224, 90, 37, 22,173,149, 21,142, 83,149,195,
-111,149,181,215,225,184,103,105,172, 75,106, 62,124,192,181, 89,237,112, 39,143,199, 43,179, 66, 85,178,174,247, 56, 73,146,196,
-210,165, 75, 65, 16, 4, 88, 44, 22,216,108,118,165,223,126,126,126,250,246, 51,133, 32, 8,146,205,102, 47,100, 50,153, 19,165,
- 82,169, 51,143,199, 75, 87,169, 84,191, 72,165,210,181, 0, 20, 52, 77, 91, 86, 33,178, 42,229, 52, 49, 49,113,125,245,234,149,
-123, 85, 29,145, 74,165,240,246,246, 6,164,136,173,142, 51, 33, 33,193,213,205,205,173, 49, 0, 77,137,182,219, 52, 77,119,209,
-250,175,141,219, 52, 77,127,169,254,253,242,205,155, 55,174, 13, 27, 54,204,255,167,206, 79, 3,231,191,143,179, 6, 45, 98, 71,
- 16, 68,152,113, 48, 25,151, 0, 0, 32, 0, 73, 68, 65, 84,214,181,218, 79,243,127,209,162, 69, 75,214,175, 95,255,130, 32,136,
- 48,237,233,218,237,180,191,213,247,155, 48,154,166,251, 45, 94,188,216,115,195,134, 13,235, 52,109,255, 14,145,168,143, 69,203,
- 60, 91, 98,130,240,119,230, 96, 50, 84, 96,146, 4,152, 12, 0, 52,129,228,164, 4, 20, 21, 22,220, 65,226,233, 68,221, 44, 89,
-254,157, 90,180,240, 10, 58,186,109, 1,249,115,120, 9, 10, 68, 18,196, 61,185,137, 71, 55,127,207, 80, 41, 85,191,131,160, 31,
- 3,100, 36,222, 82,241, 64,104,237,106, 92, 16, 52,179, 84,104,169,197, 85, 57,177,245,201,208,188, 73,147, 38,195,150, 45, 91,
-102, 27, 21, 21,197, 19, 10,133, 69, 71,143, 30, 77,151, 74,165, 73, 0, 46, 39, 39, 39, 55,217,190,125, 59, 39, 40, 40,200,203,
-203,203,139,127,242,228, 73, 89, 37,229,140,222,227,156, 63, 54, 32, 98,226,172, 57,188,216,147,187,192,137,141,196,210,167, 57,
-170, 63, 5, 37, 63, 0,216,134,148,226, 78,217, 18,229,213,173, 93, 93,200,122,102,108, 52,180,228,248,197,229, 73,170,181,100,
- 25, 27, 27,111, 9, 9, 9,113,109,219,182, 45, 9, 0,225, 47,149,220,133,187, 35,156, 46,175,239, 68,116,106,102,131,172, 2,
- 41,102,239,138,198,165,136,172, 63, 52, 34,171,166, 78,154,153,153,101,167,102, 21, 58,216,152,242, 48,186,179, 41,186,175, 77,
-135,127, 27, 46,184,108, 2,241,137, 25,104,232, 86,143,136,190,115,182,141, 90,100,181, 21, 8, 4, 0,208, 6, 64, 98, 74, 74,
- 10,223,199,199, 71,168, 69,151, 15, 96, 35,135,195, 89, 74, 16, 4,221,182,109,219,104, 47, 47,175, 98, 43, 43, 43,136,197, 98,
- 72,165, 82,176,217,108,136,197, 98, 36, 39, 39,227,193,131, 7,176,178,178,210,235, 64, 21, 23, 23,195,204,204, 12, 20, 69,125,
- 48,167, 74,165, 34,246,236,217, 99,242,226,197, 11,147,208,208, 80,135,185,115,231,230, 54,109,218,244,241,176, 97,195, 94,219,
-219,219, 75,159, 62,125,138,123,247,238, 33, 63, 63, 31,237,219,183,215,137, 83, 38,147,129,201,100, 66, 44, 22,131,203,229,130,
-201,100, 66,169, 84,130,162,168, 50,241, 85, 92, 92,140,188,188, 60,176,217,108,200,100,178, 79,241, 6,250,158,133,170,186,225,
-183,218, 88,180,180,133,154,142, 34,171, 38, 75, 84,149,195,157, 5, 5, 5, 70,150,150,150, 11, 1, 8,106, 90, 23, 65, 16, 96,
- 48, 24, 96,179,217, 32, 8, 2, 93,186,116,193,132, 9, 19,208,170, 85, 43, 36, 36, 36,224,248,241,227,120,244,232, 17, 88, 44,
- 86, 89,123,157,199, 39,252,252, 24, 60, 30,239,222,128, 1, 3, 60,127,248,225, 7, 94,189,122,245, 16, 27, 27, 91,119,195,134,
- 13, 11,175, 93,187, 54, 80, 36, 18,181,209,220,237,170,183,210,171,135, 4, 75,135, 11,251, 74,165, 82,196,198,198,234,179,204,
-123,104,216,176, 97, 50, 73,146,175, 41,138, 10, 7,224, 77,211,116, 23,130, 32, 46,161,212, 47, 81, 27, 34,154,166,191, 36, 8,
-162, 16,192, 51,146, 36, 95, 82, 20,149,108,176,219, 24,160,195,125,165, 95,197,255, 4, 65,132,173, 95,191,190, 95,101,226,170,
-146,107,179,220,244, 13, 27, 54,172,211,250,255, 33, 22,213,174, 40,239, 12,239,167,182,114,253, 37,180,194,194,194,170, 87, 32,
- 20, 6,133,157, 62,118,191,187, 28,174,158,173,125,181,172, 67, 52, 34, 31,220, 3, 64,255,162, 83, 87,248,253,140, 72, 6,243,
-151, 61,235,102,146,123,111,150, 32, 37, 61, 11,247, 46,254,130,108, 65,210, 33,128,158,139,196,208,194, 15, 62, 18,245, 6,121,
-217,219,216, 90, 74,228, 52, 40, 26,192,123, 98,235,147,160, 85,227,198,141, 7, 71, 68, 68,216, 74, 36, 18,222,157, 59,119, 74,
- 66, 66, 66, 50,228,114,249, 77, 0,119,213,109,162,178,179,179,135,168,133, 9,131,201,100,114,228,114,121,117,190, 11,173,230,
- 79, 28,115,103,227,158,131,188,215,207,163,177, 61,244, 34, 10, 74, 74, 84, 55,179,196, 95, 3,208, 40,250,235, 81, 57,226, 52,
- 26,180, 11,139, 36,192, 55, 97, 57,198,229, 73,120, 64,229, 67,178, 82,169,116,196,200,145, 35,249, 26,145, 5, 0, 57, 69, 10,
-102,137, 84,193,232,212,204, 6,173,187, 13, 65,228,141, 83, 56,121, 59, 13,110,118,198,183,235,155, 20,232,180, 71,179,179, 4,
-123,182, 6,239,221,186,113,229,124,206,188,190, 22,240,111,195, 2,143, 77,192,220,152,133,181, 59,246, 43,162, 30,220,126,202,
-231,243,195, 0,124, 45, 16, 8,192,231,243,139, 1,188,100, 48, 24,137, 42,149,170, 50,167,238,229, 0, 28, 14, 31, 62, 76, 42,
- 20,138,226,132,132, 4, 56, 58, 58,194,193,193, 1, 22, 22, 22,136,139,139,195,159,127,254,137,248,248,120, 80, 20,133, 22, 45,
- 90,232,117,176,114,115,115,241,244,233, 83,244,237,251,213,220,236,236, 44,115, 43,107, 27,209,157,240,219,155,106,195, 73, 81,
- 20, 1, 0,158,158,158,240,244,244,228,165,165,165, 57,135,133,133,217,175, 89,179,230,157,171,171,235, 81,177, 88, 92,206,114,
-160,171,208,210,136, 11,141, 8,228,241,120, 96,179,217, 40, 44, 44, 68,102,102, 38,138,138, 74,131, 54, 45, 45, 45, 63,137,208,
-170,194, 66,245,209,218,255,205,226,240,189,225, 78, 75, 75,203,145, 0, 22,234,184, 45, 80, 42,149, 96,179,217,240,241,241, 65,
-112,112, 48, 30, 61,122,132,223,127,255, 29,117,235,214,197,216,177, 99, 65,146, 36, 94,188,120,161,111, 23,169,136,136,136,133,
- 95,127,253,181,231,225,195,135,121,201,201,201,136,143,143,135,165,165, 37,130,131,131,185,147, 39, 79,110,120,227,198,141,229,
- 40, 13,126,169, 30, 90,209,133, 34, 35,254, 80,111,111,239,247,154, 56, 58, 58, 90, 92,190,124,217,190, 76,128, 85,140, 72,124,
- 31, 5,203,151, 47,223,234,225,225,177, 77, 61, 92,232, 11,192,132,166,105,191,208,208, 80, 2, 0,252,253,253,105,130, 32, 52,
- 15,164,103,167, 78,157,234, 22, 23, 23, 71, 7, 6, 6, 26,124,180, 12,168, 74,139, 76,214, 92,147, 85, 9, 40,125,132,154,182,
-197, 75,131,197,139, 23,123,174, 95,191,254,225, 7,138, 44,237, 55, 38, 90, 35,182,202, 30,166, 85, 14, 25,150,217,190, 72,190,
-163,189,141,245,162,177,157, 64, 81,128, 82, 5, 40, 85, 52, 68, 37, 98,196, 62,127, 84, 2, 30, 17,170, 83,119,184,156,160, 53,
- 63,204,105, 16,157, 74, 34, 61, 95,142, 91,103,247,210,217,130,164,193, 72, 60, 53,254,227,136,172,161,222,142, 14,246,183,142,
-237, 93, 77, 62,122, 43,131,138, 42,213, 89, 20, 69,151,253,254, 4,112,180,179,179, 11,184,127,255,190, 29,151,203,229,189,122,
-245,138, 58,117,234, 84,190, 92, 46,191,166, 37,178, 0,160, 83,155, 54,109,148,166,166,166, 16,137, 68,114,185, 92, 46,169, 70,
-100, 57,251,181,106,126,123,227,158,131, 60,137, 76, 6,161, 88, 10,134,141,125, 69,145, 5, 0, 29,187,185,215,169, 67,240,204,
- 64, 3, 72, 42,148,167, 87, 37,178, 0,128,203,229,246,152, 57,115,102,185,186,120,182,102, 44,165, 49,151,165,186, 27,147, 67,
- 69,222, 56,133,240, 23, 57, 20,143,205, 80,217,209,111, 27,232,186, 3, 10, 82, 99,246,252,126, 46,236,234,119,203,130,138, 75,
- 68, 69,112,115, 50, 66,113,145, 16,107,215,111, 84, 68, 68,132,223, 92, 56,119,106,135, 83,167, 78,109, 64,169, 51, 56, 0,188,
- 60,117,234,212,152,101,203,150,253,138,191,210, 60, 84, 68,122, 64, 64, 64,106,179,102,205,132, 30, 30, 30,194,220,220, 92,196,
-196,196, 32, 63, 63, 31,219,183,111, 71,108,108, 44, 52, 22, 65,157,124, 85,222, 23, 72,200,207,207, 51,165,105, 26,249,121,185,
- 38, 63,252,240,131, 69,109, 56, 85, 42, 85,185,107,171, 78,157, 58,152, 54,109, 26,187,164,164,196,242,221,187,119,230,218,243,
-116,229,148,201,100,208, 88,134,104,154,134, 76, 38,131, 80, 40,132, 76, 38,195,235,215,175,203, 68,150,122,253,159,204,162,165,
-249,205,227,241, 50, 53,231,178,102, 8,142,199,227,101, 85,213,254, 67,160,181, 46, 90,253, 91, 95,113, 88,227,246,232,120,220,
-193,102,179, 49, 97,194, 4, 60,124,248, 16, 9, 9, 9, 96, 48, 24, 16,137, 68, 40, 41, 41, 65,207,158, 61,193,225,112,244,181,
-104,209,108, 54,123,228,146, 37, 75,120,137,137,137,200,201,201,209, 56,211, 67,165, 82, 97,238,220,185, 70, 92, 46,119,164,190,
-166,123,129, 64,208,251,245,235,215,141, 43,126, 50, 50, 50,132,218, 62,133,181, 69,104,104, 40,225,239,239, 79,251,251,251,211,
- 26,193,101,128, 1,149,161, 10, 45,178,175, 42,139,214,199,176,138,105, 44, 91, 80, 7,136,212, 2, 26,145,213, 85, 75,120, 17,
- 26, 11,151,110, 67,135,110, 67, 91, 58,216, 88,223, 56,188,107,149,105,216,115, 2,169, 41, 73,200, 22, 36,163, 77, 7, 63,196,
- 62,143, 6,165, 80,157,198,235,208,154, 61, 57,235,249,187,123,120, 52,157,222,181,131, 23,130,194,138,241, 42,242, 50, 10,178,
- 5, 59,145,116,234,244, 71, 57, 66,174,254,205, 29,236,173,111,252,186,107,149,229,165, 24, 18, 41, 41, 73, 56,251,235, 86, 90,
- 33,151, 22,160,124, 36,151,222,111,205, 70,148,140, 83, 92,144, 9, 89,145, 10, 60,178,132,167,231, 32, 69, 6,128,240,173, 91,
-183,118,111,223,190, 61, 39, 32, 32, 32, 35, 63, 63,255, 44,128,251, 90,109,154,185,187,187,247, 13, 14, 14,118, 72, 73, 73,193,
-181,107,215, 50, 80, 26,250, 95, 21, 82,111, 71, 63,223,253,231,175,251,231, 27, 53,104,130,237, 75,190, 83,134, 62,138, 25, 0,
-224,146, 86, 27,143, 30,222,238, 97,107,190,159, 65, 82, 81,127,224,105,114, 38,222, 10,165,127, 86, 69,152,147,147, 67,148,148,
-148,184, 90, 90, 90,106,159,144,224,155,136,164, 11,134,186,167,247, 92,120,199, 73, 34, 87,129,203, 34,233,217, 3, 93,211, 31,
-158, 13,181,201,145,228, 16,154,104,196,154, 48,105, 88,143,129,187, 66,206,140, 14, 11,187, 48, 93, 46,149,120, 53,105,210,152,
-126, 28,113,227,233,194,185, 83,251,212,242,136,155, 62,124,248,144,100, 48, 24,229, 4,186,182,133, 72, 95, 75,145, 62,208,149,
-179,162,208,210, 64,169, 84, 18,181,229,148, 74,165,101, 66,171,226,195,189, 50,193,248,119,108,191, 62, 22, 42,237, 33, 67,141,
- 63,157, 68, 34,177, 87,251,108, 57,124, 76,139,214,135, 68, 34, 86, 55,124,169, 79,255, 72,146, 4, 69, 81, 96,179,217,104,209,
-162, 5,194,194,194, 96,109,109, 13,115,115,115,152,155,155,195,200,200, 8, 54, 54, 54,101, 66,139, 36,117,142,210,161,165, 82,
-105,221,186,117,235,226,245,235,215,224,241,120,101, 31, 46,151, 11, 79, 79, 79,136, 68,162, 58,248,148,182,123, 3, 12,248,123,
-239, 43, 97,218, 98,137, 32,136,176, 69,139, 22, 45,169, 45,223,162, 69,139,150, 84,102,225,250, 64,193, 85,206,186,197,212, 86,
-144,149, 42, 73,181,200, 58,180,115,165,249,153, 39, 64,106,106, 34,174,158,220, 81,164,144,203,242, 41, 74,225,250, 54, 62, 26,
- 32,241,139, 78, 93, 32,233,118, 3,251,118, 35,174,190,144,161,176, 32, 27, 47, 31, 95, 78,130,152,179,248,163,137, 44, 7,219,
- 27,135,119,173,180, 60,255,156, 64, 74, 74, 18, 46, 29,219, 94,168,144,203,123, 32, 49,244,241,135, 80,143,100,179, 7,178, 93,
-222,245,155,232,155, 14, 21,161,194,200,216,184, 47,179, 50, 48, 80,112,167,250,200, 48,109,100,103,103,159,221,186,117, 43,241,
-227,143, 63,118,149, 72, 36,191, 1,208, 54, 81,122,185,185,185, 13,223,183,111,159,117, 74, 74, 10,235,206,157, 59,162, 27, 55,
-110,208, 0,206,215, 96,113, 89,208,115,252, 52, 70,171,122,117,102, 70, 37,165, 13, 0,240,135,214,108,207,126,173,155,221, 61,
-184,126,185,153,226,110, 40,138, 5, 41, 88,124, 55,181, 16,128,206,251, 91,161, 80, 64, 40, 20, 66, 81,156,171,108,195, 23, 9,
- 3,135,216, 75, 51,243, 37, 76, 22, 85,162,244, 48,207,146,222,200,125,203, 48, 54, 54,214,107, 95,238, 90, 63, 63, 4, 64,200,
-144, 33, 67, 14, 63,139,184,208,134,207,231, 95,240,240,240, 32, 0,160,138, 8,195,170,176, 10,192,220,142, 29, 59, 18, 62, 62,
- 62, 15,182,109,219,118,165, 58,177, 82, 27,139, 86, 77,208,149,147,162, 40,178,138,253, 75,212,150, 83,219,162, 85,147,208,250,
-148, 22,173,202, 68,139,182, 72,212, 22, 66,255,134,168,195,234,196,148, 62,253,211,248,201,177,217,108, 68, 71, 71,195,197,197,
- 5,114,185, 28,102,102,102, 48, 51, 51,131,169,169, 41,138,138,138,192, 98,177,160,231, 54, 83, 60, 30,239, 93, 76, 76, 76, 99,
- 59, 59, 59,168, 84,170,114, 98,235,213,171, 87, 48, 49, 49, 73,211,215,162,197,231,243, 47,171,163, 14,203,193,209,209,209,226,
- 99,236, 87,109, 75,150,191,191,191, 97,136,208,128,106,173, 89, 85, 88,181,178, 43, 88,162,100, 90,255,179, 81,154,195,173,159,
-250, 55, 42,249, 45,171,100, 90,238,250,245,235,111,104,249,119,101,127,224, 38,104, 82, 60,148,139,112, 97,214,100,201,178,183,
-182,186,113, 96,123,160,249,201, 72, 32, 45, 37, 17,183, 78, 7, 11,149, 42,249, 23,160,104, 65,196,181,211,161, 32, 80,130,183,
-161,183,116,187, 69,160, 85,171,166,174,248,253,133, 2,217,169,175, 64,211,212, 33,100,133,148,124,240,209,113, 27,212,194,222,
-218,246,198,161,224, 64,139, 51,209, 4, 82, 83, 18,113,245,100,112,161, 82, 81,210, 29,137,167, 35,107, 75, 59, 1,176, 98,152,
-240,118, 15,246,107, 53,212,213,205, 25, 20,173, 0,197,166, 49,104,129, 45,243,101, 84,201,239,225, 60,225, 73,170,152,154,158,
-118, 95, 55, 7,186,226,226,226,223, 1, 60, 70,249,244, 10,205, 27, 53,106, 52,116,247,238,221,118,169,169,169,188,168,168, 40,
-241,222,189,123,179, 40,138, 58, 3, 64,151,161,212,239,162,146,210, 14,160,124,190,156,230,243,199, 7, 68, 4,140,155,200, 75,
-188, 22, 2,171,196, 88,124,127, 55, 93,245, 50, 95, 54, 66,109, 93,171, 20,182,182,182,116, 78, 78, 78,114, 65, 65, 65, 99, 19,
- 19, 19,228,230,230, 34, 47, 47, 15, 66,161, 16,210,194, 60,165,141,170, 64, 68, 40,243,192, 98,177,144,149,162,128, 74,165,202,
-208,213,154, 5,192,106,213,170, 85,147, 40,138,210,100, 68, 44, 23, 93,168,213, 78,115, 62, 52, 30, 50,100,200, 97,173,168, 67,
-109,103,120, 77,122, 7, 66,157,222,161,253, 31,127,252, 17,215,167, 79,159,212,202,196, 10,151,203,213,219, 81,186,170, 40,198,
-218,112, 86,101,209,170, 56, 93, 31, 78,205,240,165,198, 9,190,226,116, 13, 24, 12, 6, 40,138,130, 14, 65, 21,127,171,104,209,
-142, 14,172,141,200,169,112,108,170, 77, 28, 90,203, 72,196,143,106,209,210, 28, 11, 54,155,141,115,231,206, 97,220,184,113, 80,
-169, 84, 48, 54, 54,134,169,169, 41, 76, 76, 76,112,250,244,105,104,210, 63,232,163, 95, 21, 10,197,145,245,235,215, 47,217,179,
-103,143, 17, 77,211,224,112, 56,101, 66, 43, 48, 48, 80, 44,151,203,143,232, 36,180, 52, 25,223, 41, 58,198,196, 68, 89,109,212,
- 97,101,203, 84,225,175,101,185,106,213,170, 49, 20, 69, 13, 68,133, 20, 14, 21,218,149, 75,253, 96, 72,239, 96,128, 14,247,147,
- 71,255,226,238,105, 4, 22,161,101,201, 42, 19, 92,100,117,226,197,206,202,242,198,254,237,129,230, 71, 31, 17, 72,124,251, 22,
- 55,127,219, 81, 42,178,222,156,124,130,228,208, 76, 36,134,118,198,219,208,222, 58,191, 61, 17, 68, 43, 39,123, 75,228,137, 40,
- 20,230,188, 3,104, 68,125, 12,145,101,103,101,119,227,231,224, 64,139, 83, 79, 72, 36, 38, 38,226,234,201, 29, 66,165, 82,242,
-197,135,136,172,145,108,246,192, 70,238,206, 9, 75, 39, 13, 28,234,211,208, 17, 54,239,226,112,126,236, 80,172, 62,254, 13,204,
-236, 24,104,215,215, 12, 19,214, 58, 14,229,123,114, 95,243, 59, 99,160, 30,212,218, 34,171, 85,253,250,245,135,222,191,127,223,
-214,219,219,155, 23, 31, 31, 47,217,187,119,111,150, 88, 44,190, 2, 32, 90, 15, 78,109,145,213,106,209,228,177, 17, 27,247, 31,
-230,145,108, 14,130,142,156,199,172,219,169,170, 11,201,133, 67, 80,126, 88,177, 82, 72,165,210,107,193,193,193, 82,146, 36,145,
-151,151,135,156,156, 28,100,101,101,149,125, 23, 20, 20,128,193, 96,224,250,245,235,178,194,194,194,251,186,118,240,222,189,123,
-245,211,210,210, 60, 4, 2, 65, 27,245, 39, 30,165,209,133,166, 90,211,218, 8, 4,130,174, 0, 30,105,166,167,166,166,214,123,
-240,224, 1,191, 38,126, 51, 51, 51,176,217,236,114, 22, 45, 46,151, 11, 7, 7, 7, 40,149, 74,156, 56,113, 2, 0,242,170,227,
- 96,179, 57, 2,146, 36, 64,209,148,148,199,227, 81,124, 62,191, 82,129,165, 15,167, 26,169, 95,126,249,165, 36, 50, 50,178, 82,
-139, 86,109, 56,105,154, 46,233,213,171, 23,210,211,211,193,227,241,202, 30,214, 26, 65, 69,146, 36,184, 92, 46, 50, 50, 50, 48,
-101,202, 20,208, 52, 93,242, 79,223,121,180,125,154,212, 98,136, 0, 64,168,133,208,123,126, 90,186,250, 64,105,134, 6,105,154,
-134, 70,112, 85,152, 95,182, 46, 93,178,183, 87,240,233,154, 92, 80, 80,176,177,180, 59,244,222, 10,223,251,244,120, 40,148, 9,
-173,216,216, 88, 28, 62,124, 24, 5, 5, 5,224,112, 56,200,207,207,199,193,131, 7, 17, 19, 19, 3, 14,135, 3,205,190,208, 85,
-191,249,248,248,108, 12, 15, 15,143, 25, 49, 98,132, 56, 58, 58, 26, 98,177, 24,209,209,209,232,221,187,183,228,238,221,187, 9,
- 98,177,120, 21,116, 25, 58,212,100,124, 87,151,215,145, 74,165,136,138,138,170,244, 83,213, 50, 21,145,144,144,224,170, 82,169,
- 26,211, 52,237, 75,211,180, 57,212, 41, 28,212,255,181, 63, 95,170,231,153,211, 52,237,171, 82,169, 26, 37, 36, 36,184, 26,228,
-132, 1,159, 41,110,105,137, 45, 90, 75,100,221,170,222,162, 69,145,193, 7,118,172, 52, 63,242,144, 68, 74,114, 2, 30, 95,220,
- 45, 84, 81,138, 47,244, 44,135,211, 3, 90,185, 54,120, 70, 38, 94, 20, 81, 26,206, 92,152,147, 2,208,140,218, 8,173,114,156,
-160,200,224,131, 59, 2, 45,142, 61, 38,144,158,242, 6,119,207,238, 18, 42,149,210,238,120, 27, 26, 85, 27,206,145,108,246, 50,
- 22,131, 88,218,171, 83, 75,118,231,150,238, 48,201, 74, 66, 70,106, 58, 78,196,102,231, 37,228, 75, 39,222, 37,228, 72,126, 35,
- 61,208,119,146,181,181,149, 35, 11,253,166,218, 88,223, 63, 95,248, 59,193, 18,201,105, 57,189, 94,112,183,172, 44, 69,249,126,
-190, 15, 71, 51, 51,179, 17,143, 31, 63, 54,231,241,120, 70,143, 31, 63,166,246,238,221,155, 43, 22,139, 47, 2,136,208,105,219,
-223,135,115, 91,119,183, 91,235,118,237,231, 21,139, 74, 32,146,201,193,117,224,171,206, 68, 60, 31,140,170, 19, 96,150,227,228,
-114,185,199,142, 29, 59,214,183, 75,151, 46,174, 94, 94, 94,100, 94, 94, 30,138,139,139,203,156,171,237,236,236, 16, 27, 27, 75,
- 37, 38, 38,166,115,185,220,227,186,246,179, 99,199,142,137, 36, 73,198,171,135,209,226, 81, 33,186, 80,171,105, 99,129, 64,208,
-150,207,231,223, 2, 96,172, 21,117,168,205,169, 73,239,176, 4, 0, 73, 16,196,163,232,232,232,226, 62,125,250,192,200,200, 8,
- 34,145, 8,117,235,214,133, 82,169,196,197,139, 23, 17, 25, 25, 41,162, 40,234, 86, 37,226,181, 92, 63, 37, 18,113, 93, 0,164,
-184,164,164,197,152, 49, 99,186,206,155, 55,175, 92, 72,186,189,189, 61,172,173,173,245,226, 4,128,188,188,188,166,127,252,241,
-199,156,232,232,232,239,250,246,237,107,177,100,201, 18,110,253,250,245,161, 82,169,200,218,114,230,231,231, 91, 68, 69, 69,109,
-234,220,185,243,140, 62,125,250, 48,215,173, 91, 7, 11, 11, 11,168, 84, 42, 24, 25, 25,161,176,176, 16,171, 86,173,194,157, 59,
-119,148, 52, 77,239, 18, 10,133,223,235,121, 46,225, 67,175,205,170, 44, 64, 85,165,100,168,162,253,223,222,207, 10, 62, 93, 80,
-167,112, 88, 88, 69, 6,123,232,122,206,107,132, 22,131,193, 64, 82, 82, 18,246,238,221,251, 94, 30, 45, 77,250,135, 42,184, 43,
-219,118,250,230,205,155, 42,130, 32, 58, 60,126,252,120,225,232,209,163, 39,138, 68, 34,103, 19, 19,147,116,133, 66,241,139, 88,
- 44, 94,139, 82,127, 84,182, 62,247, 16,145, 72,148, 92, 89,212, 97,197, 54,128,101,181,156, 21,210, 59,148, 75,225, 80, 97,153,
-114,169, 31, 42, 73,239,240,183, 31,119, 3,231,191,146,243,115, 23, 91, 85, 39, 44,125, 15,173, 38,179, 88, 98,133,119,120, 2,
-241, 33, 34,235,125,107,137,164, 36, 97,249,177,119, 45,101, 82, 9, 68,194,204,151, 72, 58,145,245, 65,155,165,238,231,237, 4,
- 2, 73,137,111,240, 48,108, 87,105, 63,223,134,214,186,159, 4,176,248,167, 75,161,108,194,194, 26, 79,231,140, 67,122,129, 8,
-151,222,230,159,164, 75,164,211,143, 0,249,184, 3,144, 74,105,248,193, 31, 50,118,251, 14,178, 24,106, 91,135,133, 45,243,127,
- 1,111,145, 13,187, 93,247, 46,250,212, 64,204,224,241,120,225,219,183,111,239,225,235,235,203, 29, 50,100, 72,101, 14,242,250,
- 34,245,209,171, 55, 63, 93,216,179,121,190,141,119,123,236, 92,182, 64,117, 44,226,121,197, 40,196,106,225,225,225,161,186,119,
-239,222,188, 41, 83,166,108,233,209,163,135,211,128, 1, 3, 56,117,235,214, 5,151,203,197,155, 55,111, 16, 30, 30, 46,123,251,
-246,109,122, 73, 73,201,188,230,205,155,235,147,227, 44,127,249,242,229, 27,213,235, 32,212,195,133,109,160,142, 46,212, 52, 82,
- 39, 45,109, 3,192, 56, 48, 48,112, 52, 0, 84, 17,246,189, 28,192, 30, 0, 76,154,166, 51, 66, 66, 66, 58,156, 61,123,182,195,
-220,185,115,217,125,251,246,197,253,251,247,113,245,234, 85,185, 92, 46,143, 80, 11, 87, 93, 75,229, 80, 0,162,148, 74,229,243,
-160,160,160, 14, 12, 6, 99,185,102, 70, 76, 76, 12, 14, 29, 58, 84, 27, 78, 37,128, 77,153,153,153, 63,133,132,132, 44,191,118,
-237,218,248, 49, 99,198,152, 43, 20, 10,196,198,198,226,231,159,127,174, 21,167, 80, 40,156, 99,107,107,187,244,226,197,139,191,
- 92,185,114,229,235, 81,163, 70,145,179,102,205, 66,112,112, 48,126,251,237, 55, 74,165, 82,157,101,177, 88, 99,114,114,114, 68,
-159,226,174,163, 30,134, 75,215,179,214, 97,141,188, 31, 50, 52,168, 35, 4, 31, 74,160,217, 14, 63, 63,191, 50, 43,163,198, 10,
-167,221,134, 32, 8,189,135, 14, 1, 88,210, 52, 77, 1,216,133,210,250,162,218, 89,225, 25,248, 43,115,188,174,140,205, 4, 82,
-203, 24, 72, 17, 91,125, 81,105, 75,128, 70,179, 26,216, 10,150, 47, 95,190,117,197,138, 21, 91, 43,166,112,208,110, 84, 49,245,
-195,202,149, 43, 97, 72,239, 96,192,127, 21,149, 11,173,168,125, 10, 69,131,193, 75,182,175, 91,176, 66,169,144, 9,105,200,253,
-241,230,116,244,135,174,140,166,232, 69,215,143, 6, 6,131, 70, 62,173, 82, 46,252,224,222,255, 77,253, 36, 44,172, 81,180,106,
- 26,126,123,145, 78,103,136, 20,223, 28,145,203,203, 89,131, 74,125,178,168, 97, 55, 36,249, 39,172,156, 88,103,230,124, 97, 67,
- 92,200, 27,173,247,122,178,178,178,206,109,221,186,149,220,188,121,115,215,146,146,146,138, 14,242,181,197,130,254, 51, 23, 49,
-218, 53,114,157,249,240,117,242, 64,232, 48, 92, 88, 17, 29, 59,118, 20,196,197,197, 5, 92,185,114,101,196,237,219,183,123,136,
- 68, 34, 87,130, 32, 96,108,108,156, 44,149, 74,175,113,185,220, 99,122,138, 44, 0,192,138, 21, 43,232,149, 43, 87, 18,113,113,
-113, 52,131,193,248, 19, 64, 34,131,193, 72,210,118,130,215,158,174, 89, 38, 48, 48, 80,151, 7,226,237,226,226,226,200, 85,171,
- 86,117, 89,181,106, 85, 11,181, 85,232, 54,254,242,249,210, 23, 10, 0,183,217,108, 78, 58, 65, 16,206,108, 14, 87,116,239,222,
-189,107, 31,200, 89, 34,151,203, 23,166,164,164,108,217,178,101,203, 90, 19, 19,147,182, 49, 49, 49,127,126, 8,167, 90, 68, 13,
-182,182,182,118, 58,124,248,240,169,131, 7, 15,182,103, 50,153,247, 9,130, 24, 34, 20, 10, 63,105, 81,105,117,129,232,149,122,
-212, 58,212,137,247, 99, 39, 41,253, 59,132,155, 74,165, 42, 94,186,116,105, 86, 69,225, 85,209,122,165,249,175, 78,229,162,203,
- 62,213, 39,138,178, 6,225, 66, 20, 3, 64,105,237,194,210,178, 58,186, 22,149, 6, 32,174,233, 58, 39, 73,242, 44,128,151, 36,
- 73,190,174, 24,232,162, 61,111,229,202,149, 53, 93,231, 6, 24,240, 89, 67,135, 59, 91, 32, 9, 4,214,214,147,246, 31, 52, 87,
-126,156,126, 6,176,217, 43, 73, 96, 62, 0,130, 6,182, 28,145,203,127,168,110, 65,199,142, 88, 75, 19,152,171,222,153,235, 50,
-238, 98, 77, 45,182,189, 14,116,168, 63,168, 39,103, 19, 84, 95, 80,246, 61, 78,127,127,127, 70, 21, 15,243,114, 69,165,171, 66,
-104,104, 89, 22,255,170,250,169,125,190,153, 61,120,240,192,201,199,199, 71,128,242, 78,255,149, 77,167,245,220,118, 6, 0,213,
- 71,222,159,159, 5,167,155,155, 27,231,205,155, 55,178,127,215,181,105,224,252, 87,114, 90, 54,117, 1,129, 73,208,206, 29, 84,
-173, 69, 75, 75,160,209,244,207, 40,136, 77,169,162,159,154,235,220, 50, 33, 33,193,181, 97,195,134,201, 0, 10, 42,244,163,178,
-121,180,225, 24,253,223,115, 86,134,201, 40, 95,138,206,128, 74, 14,132,129,211,192,105,224, 52,112, 26, 56, 13,156, 6, 78, 3,
-103,109,133,214,103, 13, 18, 6, 24, 96,128, 1, 6, 24, 96,128, 1, 6,252, 45, 32,170, 81,165,250,152, 4,107,163,108,175, 25,
- 56, 13,156, 6, 78, 3,167,129,211,192,105,224,252,191,227,172,137, 91,123,249,207,117,232,240, 31,235,183,193,172,106,224, 52,
-112, 26, 56, 13,156, 6, 78, 3,167,129,243, 67, 4,203,103, 13, 38, 12, 48,192, 0, 3, 12, 48,192,128,207, 6, 61,220,193,103,
-170, 64,254,241, 70,167, 32,170, 26,209,199, 13,117, 0,224, 99,241,253,159,130, 15,224, 43,173,255, 23,160,142,140, 55, 8,173,
-207, 23,141, 0, 44, 1,160, 93,139,236, 33,128,245, 21,218, 29, 5,160, 93,144, 80,132,210, 58,129,175,245, 89, 25, 73,146,235,
-187,116,233, 50,253,206,157, 59,155,149, 74,229,170, 90,244,215,149,207,231,111, 36, 8,162, 53, 0, 22, 65, 16,111, 50, 51, 51,
-215, 43,149,202, 15,137, 90,105,224,232,232,184, 1, 64, 75,146, 36, 89, 4, 65, 36,100,102,102,174, 81, 42,149, 55, 63,128,211,
-204,193,193,161, 19, 77,211,142, 0, 24, 44, 22, 43, 55, 45, 45,237, 1,106,153, 91,201, 63, 48,150, 93, 40, 82,178, 0,192,220,
-132,169, 8, 13,108, 42,215,117,154,225, 20, 55,192,128,255,111,208,165,145,201,229,208,219, 13,107,105, 37,190, 87, 1, 68,175,
-250,216,113, 57, 17,223, 87,181, 60, 81, 73, 84,115, 69,206,222,110, 88,171,162, 75, 57,122,185, 97,211,229, 55,168, 54,210, 94,
- 23, 78, 13,246, 1,228,100, 29,170, 20, 16,186, 69, 95,255,219,241, 21,202, 15, 21,150, 13, 29, 86, 43,180,134,185,131,175, 98,
-130, 25, 26, 11, 77, 24,175, 25,128, 22,234,135,252,107,148,230, 42, 42,250,192,206,125, 46,156,255, 54, 44,167,105, 58,160,220,
-201, 90, 73, 30,162, 47,190,248, 98,192,149, 43, 87,140, 53,245,238, 40,138,130,145,145,145, 18,192, 88, 61,214,101, 63,108,216,
-176, 69, 7, 14, 28,192,208,161, 67,151,134,133,133,109, 5, 80,172,235,194, 86, 86, 86,254,150,150,150,193,251,247,239,183,107,
-223,190, 3,193,225,112,240,230, 77,130,243,148, 41, 83,188,226,226,226,206,102,101,101, 77,212,119,227,173,173,173, 71, 90, 90,
- 90,110,217,187,119,175,109,231,206,157, 65, 16, 4, 34, 35, 35,157,231,204,153,211,226,221,187,119,199, 51, 51, 51,103,232,203,
-105, 99, 99,227,110, 97, 97,209,109,231,206,157, 70,157, 58,117, 2,143,199, 67,116,116,180,233,212,169, 83, 29,211,210,210, 98,
- 51, 51, 51,111,233, 43,178,158, 69,158,255, 90, 41,151, 6, 1, 0,147,205, 93,208,126, 75,196,249,103, 55,206,247,175,105,154,
-127, 96,236,239, 6,177,101,128, 1, 6,104, 99,164, 19, 28,105, 26,243,175,252,188,140, 4,128, 94,227, 87,207, 26,233,132,205,
- 71,210,171,174, 97,171, 39,223,247, 99,234, 32,248,112, 26, 50, 63,164,159,251, 0,114, 14,147, 57,171,157,143,143,237,183,119,
-239, 38,200,129, 95,254, 79, 14, 81,165,195,156, 85, 10,173,193, 77,177, 74, 89,106, 49, 33,250, 52,196,241,171,137,140,240, 47,
-190,248,162,225,132, 9, 19,136, 86,173, 90, 33, 50, 50,210,253,248,241,227, 95, 93,184,112, 33, 65,165, 82, 69, 2,120, 1,221,
-179, 90,179, 0,120, 50, 24,140,214,255,114,206,127, 51, 76,212,226, 42, 19,127, 37, 58,125, 47,225,233,245,235,215,207, 49,153,
- 76,141, 69,171,157, 72, 36,114,168, 96, 5,211, 5,245, 20, 10, 5,226,227,227, 65,146, 36, 11, 64,125,188, 95, 82,163, 42, 56,
- 27, 27, 27,239,142,120, 24,105, 67, 48,141,144, 47, 1, 32,145,131, 99,234,128, 3,135, 66,172,231,205,158, 49,248,230,205,155,
-225, 69, 69, 69,191,234,209,159,250, 38, 38, 38, 91,159, 62,125,106, 99,108,108, 12,138,162, 80, 84, 84, 4, 71, 71, 71,236,223,
-191,223,114,222,188,121, 1,133,133,133, 55, 37, 18,201,111,250,136,115, 11, 11,139,110,207,159, 63, 55,210, 20,148,150,201,100,
-112,118,118,198,209,163, 71,185,179,102,205,106, 90, 80, 80,144, 42,147,201,222,234, 74, 88, 40, 82,178,148,114,105,208,225, 93,
-129, 46, 0, 48,102, 70, 96, 16,167,200,252,162, 46,211, 10, 69,202, 11, 0, 12, 66,203,128,127, 26,173,109,109,109, 67,115,114,
-114,110, 1,152,136,143, 99,105,112,231,241,120,205, 41,138,114, 36, 73, 18, 12, 6, 35, 67, 36, 18, 61, 5,240,170,182,132, 54,
-110,126,253,193, 53, 30, 7,154,106, 65, 2, 32, 72, 50, 90, 37, 47, 57,148,251,234,230,249, 15,226,228, 24,141, 7,232, 22, 36,
- 64, 17, 36,249,148, 82,150,236,207,137,191,121,233,223,114,112,238, 11,209,216,205, 81,247,194,152, 31,131,111,120, 3,240, 73,
- 10,228,209, 36,221,135, 21,103, 2,125,103,207,158,237, 56, 99,250,116, 98,220,216,177,141,110,221,185, 67,116,213,167, 90,193,
-231,137, 42, 29,223, 43, 21, 90,254, 77, 97, 69, 3, 11,143, 7, 47, 33,153, 12, 6, 49, 98,246,250,128,131,187, 54,145, 61,251,
- 15, 41, 27, 62,241,245,245,133,175,175, 47, 17, 20, 20,212,232,207, 63,255,108,116,244,232, 81,101, 68, 68,196, 83, 0, 39,170,
- 90, 89,111, 55,136, 41,128,199,102, 49, 69, 35,150,253,186,215,199,199, 7, 92, 46, 23, 31,194, 9, 0, 61, 27,146,111, 89,214,
- 13,158,142,152,185, 60,185,125,251,142,244,199,224,252,140,240, 16, 40, 43,106,109,229,226,226,210, 73,169, 84,242, 0,128,201,
-100, 74, 82, 82, 82,102,162,180, 54, 32, 0,156,165, 40,106,128, 30,220, 36,128, 21, 3, 6, 12, 88,250,237,183,223,162,110,221,
-186,152, 53,107, 22, 20, 10, 69,228,165, 75,151,150, 3,216,128, 26, 46, 30,123,123,251,229,187,119,239,182,102,114, 76,208,106,
- 97, 34, 4, 5, 74, 0,128, 41, 23, 56, 55,141,198,172, 89,179,204, 31, 63,126,188, 70, 31,161,101,111,111,191,106,255,254,253,
-214,198,198,198,160,105,186,172, 22, 99,113,113, 49,138,139,139, 49, 99,198, 12,243,216,216,216,141,250, 8, 45, 7, 7,135, 78,
- 59,119,238, 52,226,241,120, 40, 46, 46,102,203,229,114,162,168,168, 8, 37, 37, 37,180, 76, 38,147,207,156, 57,147,251,226,197,
- 11, 63,129, 64,240, 22, 6,252, 91,192, 0,240, 13,139,197, 26,212,176, 97,195, 54,175, 95,191,126,162, 84, 42, 79, 3, 56,253,
- 17, 94,166,186, 59, 57, 57,173, 77, 79, 79,223, 9, 32,228,255,101,135, 58, 56, 56,156,190,119,239,158,203,238,221,187,199,110,
-222,188,249, 34,128,223, 62,128,142,205,102,179, 7,119,237,218,213,101,204,152, 49, 28, 7, 7, 7, 72,165, 82, 36, 38, 38,154,
-159, 60,121,210, 53, 58, 58, 58, 85, 93, 17, 67,231, 23, 10, 27,247,142,166, 96,154, 31,239,208,177, 83,231,161,131,191, 49,115,
-176,177,128, 88,166,194,235,100, 65,221, 63, 46,158,235, 26,199, 54,186, 39,151, 11,135,231,190,186, 87,172, 47,103,183,110,221,
- 59,247,232,222,221,204,194,210, 2, 66,145, 28,111,146,210, 92,111, 92, 61,239,203,100, 26,221,166, 8,197,168,172,231, 87, 75,
- 62,229,177,153, 5, 48, 69, 60,155,230, 45, 58,182,122,220,107,194,154, 54, 52, 77,131,164,177,163,162, 53,107, 22,192,220, 81,
- 90,246, 75, 47, 62,208, 52, 77, 16,216,164,109,205,234,237,134,181, 52,141,239, 65,130,232, 93,195, 48,165, 6,189, 0,174,165,
-181,181,207,212,201,147,137,162,194, 66, 68, 71, 71,151, 84, 20, 89, 91,235,128,125,155, 68,189,179, 41,181, 23,219,255, 82,107,
- 86,165, 67,135, 58,231,209, 50, 54, 54,174,116,186,133,133, 5,186,117,235,134,245,235,215, 51, 1,180,174, 48,187,124,145, 85,
-128, 27,182,103, 49, 44, 76,184,100,221,186,117,205,204,205,205, 63,152, 19, 0, 64, 83,245, 59,214,165,191,124,244,235,146,177,
-215,142,110,241, 20, 21, 21,176, 42, 54, 49, 53, 53, 69,227,198,141,177,116,233, 82,221, 56, 63, 28,255, 40,167,163,163, 99, 19,
- 95, 95,223,214,215,111,221,178, 76, 79, 79,231,166,167,167,115,175, 92,191,110,217,161, 67,135,214,142,142,142, 77,202,118, 21,
- 77,235,211,207,213,187,118,237, 90,126,246,236, 89,210,215,215, 23, 86, 86, 86,232,214,173, 27, 46, 94,188,200,220,188,121,243,
- 58, 0, 75,107,234, 39, 73,146,157,125,125,125, 9,208, 52, 50,132, 74, 60, 88,223, 4,209,155, 60, 80, 36,161,145, 39, 44,132,
- 88, 44,129,177,177, 49, 15,165,195,189,186,110,123,199, 14, 29, 58, 16, 0,202,196, 85, 81, 81,233,167,184, 88, 4,153, 76, 14,
- 46,151,107, 6,128,167, 43, 39, 77,211,142,157, 58,117, 2, 0,200,229,242,178, 55,188,130,130, 2, 66, 40, 20, 66, 38,147,129,
-197, 98,177, 81,179, 95, 99, 25,167,185, 9, 83,193,100,115, 23,140,153, 17,152, 50,102, 70, 96, 10,147,205, 93, 32, 51, 43, 84,
-233, 50,205,220,132,169,248,196,231,167, 29, 73,146, 63,187,185,185,197,146, 36,121, 24,128,227, 7,114,182, 5,176,206,200,200,
-232,154,135,135, 71,138,177,177,241,117,181, 80,239, 80, 75, 78,142,177,177,241,245,117,235,214,157,122,242,228,201,208, 63,255,
-252,179,254,179,103,207, 6, 7, 5, 5, 29, 55, 53, 53, 13, 71,121,191, 68,189,175,205,250,245,235, 31,124,240,224, 65,219,142,
- 29, 59, 30, 0,192,253, 72,215, 59, 3, 64, 75,232, 84,145,227,147, 28,119,167, 86,173, 90,185,240,120, 60,244,232,209, 3, 0,
-252, 62,132,147,205,102, 15, 94,186,116,169,219,178,101,203, 56, 2,129, 0,215,175, 95,199,195,135, 15,161, 84, 42, 49,109,218,
- 52,238,152, 49, 99, 26,152,153,153, 13,214,171,159, 76,243,227,179,231,204,237, 51,127,214, 36,179,167,239,228, 56,116,237, 29,
-126,143, 16, 32,171,132,131,254,131,199, 88,244, 30, 56,172, 55,135,107,113, 92, 95,206, 69, 11, 23,246,153, 60, 62,192, 44, 70,
- 64,225,220,253, 12,220,143, 23, 66,201,178, 68,223,193, 19,173, 90,116,234,243, 21, 19,172, 95, 62,245, 49,218, 15,180,159, 61,
-123,182,221,130, 77, 71,238, 58,181,253,102, 71,118, 62,124,181,133,143, 59, 96,105,109, 98,242, 77,124,215,174,147,140, 74,235,
-197, 86,203, 89,142,175,245,192,224,172,124,116,209,246,207,234, 98,141, 70,234, 97, 69,198,149,159,151,145, 52,129, 89, 35,157,
-202,221, 7, 42,237,231, 77, 96,232,236,185,115, 89, 22, 86, 86,216,181,107, 23,164, 34, 81, 57,159,217,238, 46,232,115,205,152,
-153,218,192,195, 57,182,155, 43, 17,254, 31,124, 95,153, 92,165, 69, 43, 44, 44,140,238,215,175, 31, 1, 0,161,177,200, 31,220,
- 20, 27,135,125,187,110, 41, 65, 18,116, 61,207,142, 49,117,220,154,137,108,108,108, 80, 82, 82, 2,169, 84, 10, 54,155, 13,137,
- 68,130,119,239,222,225,254,253,251,176,178,178,210,171, 39,133,133,133, 48, 53, 53,133,169,169,233, 71,225, 92, 60,182, 7,247,
- 77, 74, 54,247,242,253,155, 93,183, 79,255,173,189, 91, 75,191,103,221,135,205,122,110,110,231, 36,121,246,236, 25,238,221,187,
-135,252,252,124,248,248,248,252, 87, 14,230, 67,181, 79,214, 67, 0, 86, 13, 27, 54,116,190,124,237,182, 85,177,132, 50, 79,202,
- 84,176, 40,138,130,177, 49, 95,121, 34,244,156,112,232,224,254, 68, 70, 70, 70, 22,128,135,106,113, 91, 83, 77, 69, 30,128, 38,
-254,254,254,139,166, 79,159,142,132,132, 4, 76,154, 52, 73,252,240,225,195,220,142, 29, 59,218,236,223,191,223,104,222,188,121,
-184,117,235,214,138,176,176,176, 51, 0, 18, 1, 84, 90,171,141,166,105, 54,155,205,134, 82, 45, 27,228, 42,170, 76,223, 23, 22,
- 22,130, 22,231,131,205,102, 51, 0,216, 65, 71, 63, 58,138,162,216, 44, 22,171, 76,100,189,203, 44,196,187,172, 18, 20, 22,203,
- 32, 22, 43, 33, 19,211, 96, 24,219, 48,129, 36, 7, 0, 73, 80,170, 87, 0, 0, 0, 32, 0, 73, 68, 65, 84,186, 90, 71,120, 60,
- 30,148, 74, 37,138,138, 74,187,161,177,148,201,100, 50, 8,133, 66, 48, 24, 12, 83, 0,230, 0,242,116, 33, 84, 59,185,255,174,
- 30, 6,196,163, 35, 3,108, 95, 95, 88, 92,110,154,185, 9, 83, 17, 58,175, 41,195,198,185,197,157,150, 67,127,241, 40,155,246,
-105,253,179,184,118,118,118, 55, 78,157, 58,213,180, 81,163, 70, 72, 76, 76,244, 24, 50,100,136,143, 64, 32,104, 9,253,107, 50,
- 26,147, 36,185,113,204,152, 49,211, 71,140, 24, 65,184,187,187,131,201,100, 66,169, 84, 58, 39, 36, 36,116, 59,121,242,228,194,
-131, 7, 15,238, 87,169, 84,223, 65,119,191, 63,146,195,225,156,216,187,119,111, 23, 31, 31, 31, 28, 62,124, 24, 15, 31, 62,164,
-218,182,109, 75,142, 30, 61, 26,174,174,174, 62,163, 71,143,254, 93, 42,149,246,173,165,101,203,181, 67,135, 14, 46, 12, 6, 3,
- 29, 59,118,100,223,187,119,175, 21,128,123, 31,184, 79, 77,157,157,157,111,249,249,249,181,188,118,237, 90, 84, 70, 70,134,159,
- 30,219, 11, 0, 3,157,156,156,130, 44, 44, 44,172,244,184,199,150,164,165,165,125, 15, 32, 84,199, 69,218,183,110,221, 26,201,
-201,201,104,210,164, 9,216,108,118, 7,185, 92, 62, 5, 64, 31, 0, 63, 0,136,213,163,191,238,221,187,119,119,241,243,243, 35,
- 66, 67, 67,203,252, 67, 73,146,132, 82,169, 4,155,205, 70,251,246,237,201,200,200,200, 58,143, 30, 61,114,135, 14,195,136, 54,
-110,126,253, 59,118,238,218,185,139, 79,115,114,115,232,107,168, 40, 21, 24,132, 18, 76,130, 2,165,224,130,203,102,192,221,179,
- 13, 35,254,197, 83, 31,153, 84,222, 63,247,213,181,243,186,112,246,233,213,211,183,105, 19,119,114,251,239,111, 80,144, 22,171,
- 74,139,187,157, 67, 50, 72, 52,109,253,133,173,123,179,150,140,150, 62,126,172,244,196, 23,221, 36,146, 46, 61,242, 19,110, 95,
-251, 20, 23,228, 74,128,225, 92,199,246,155,126, 61,253,216,130,244,116,209,201,208,243,207, 75, 20,184, 15, 0,183, 0,162, 47,
-208,220,187, 93,187,174,251, 55,108,176,225,243,249,172, 81, 35, 70, 40,247, 69, 69, 69,161,138,161,223,149, 0,195,214,209,177,
-199,212,169, 83, 25,130,244,116,250,228,233, 11,207, 52,124, 40,125, 75,241,110,238,236,209, 15,162,120,189,134, 41,251, 3, 28,
- 7, 71,199,166, 83,166, 76, 65, 70,122, 58, 14,135,132, 20, 75,128, 8,141, 21,235, 28, 3, 59,155,185, 57,142, 91, 48,113, 0,
-225,194,183,197,212, 21,251, 58,116,147,103,185, 65,240,215,241,215,214, 34,159,177,200,154, 92,169,208,170,136,223, 98,177,220,
-140,141,250, 39, 79, 30, 35,179,139,228,162,132,132, 4,216,218,218,130,207,231,195,194,194, 2, 49, 49, 49,184,126,253, 58, 94,
-190,124, 9,138,162,208,162, 69, 11,189,122,147,147,147,131,167, 79,159,194,202,202,234,163,113,186,185,216,225, 91, 23, 59,118,
-102,110, 33,251,218,195,151, 62,251, 22, 15,110, 70,122, 12, 62,168, 93, 36, 86, 38,147,225, 63,130,178,232, 66, 23, 23,151, 78,
-135, 14, 29, 98, 75,149, 48,115,159, 18,241,163, 72,162, 50, 1, 0, 19, 30, 67, 20, 25,212,248,187,213,171, 87,139,198,143, 31,
-239,145,146,146,178, 94, 7, 91,255,218,238,221,187,207,167,105,154, 53,123,246,108, 0,192,152, 49, 99, 10,239,223,191,239, 14,
- 32,235,250,245,235, 78, 19, 38, 76,120,117,227,198, 13,227,185,115,231, 50,148, 74,101, 12,147,201,164,195,194,194, 86, 1, 8,
-124,239,137, 72,146,143,163,162,162,234, 57,185, 54,134,171, 13, 9,223,165, 47, 75,111,112,198, 20, 82,147,222, 32,238,217, 67,
- 56, 58, 58, 90,240,249,252,216,212,212, 84,121, 90, 90,218, 66,145, 72,180,187,134, 62, 70, 71, 70, 70,242, 93, 93, 93, 81, 92,
- 92,140,212,236, 18,204, 58,109,140, 66,113,169, 17,131, 5, 49, 90,186, 52, 54, 51, 34,101, 15,179,178,178,228, 50,153,108,153,
- 80, 40, 60, 84, 29, 39,139,197,202,125,246,236,153,105,221,186,117, 33,145, 72,232,188,188, 60, 66, 36, 18,161,168,168,136,184,
-112,225,194,215, 2,129,160,109,253,250,245, 9,103,103,231, 85, 2,129, 64,156,150,150, 54, 73,151,161, 73,181, 96, 82, 49,153,
-204,205,147, 39, 79, 30,122,230,204,153,199,161,129, 77, 7,106, 13,151, 88,120,122,122, 94,110,222,188,153, 83,200, 38,239, 29,
- 0,126,252, 23,156, 91,227,150, 44, 89,210,212,218,218, 26, 83,167, 78,197,202,149, 43,177,124,249,242, 70, 83,167, 78,157, 12,
- 96,171, 30, 60, 70,142,142,142,143,182,111,223,238,209,169, 83, 39, 92,188,120, 17,199,142, 29,195,219,183,111,149,245,235,215,
-103,250,248,248, 96,197,138, 21,232,221,187,247,164,153, 51,103,118, 77, 79, 79,111,165,163,248, 24,191, 98,197,138,129,157, 59,
-119,198,216,177, 99,165, 55,111,222, 28, 10,224,202,213,171, 87,191,184,117,235, 86,232,145, 35, 71,140,214,173, 91,215, 99,222,
-188,121, 83, 1, 4,215, 98,251,191,238,210,165,180,134,114,231,206,157, 17, 20, 20,212,251, 3,133, 22,199,198,198,230,194,225,
-195,135, 91, 54,110,220, 24,163, 70,141,106, 53,116,232,208, 11,249,249,249, 61, 1,232,116, 67,170, 83,167,206,198,179,103,207,
- 54,172,106,100,161, 50, 72,165, 82,235,111,190,249,102, 67, 82, 82,146, 94, 66,235,232,209,163,248,254,251,239,209,162, 69,139,
-230,237,219,183,223, 51,101,202, 20,248,251,251,119,143,137,137,113, 64,105,212,114,141,224,241,120,205,135, 15, 31,206,121,240,
-224, 1, 0,192,211,211, 19, 45, 91,182, 68,114,114, 50, 30, 63,126, 12,169, 84, 10, 7, 7, 7, 12, 26, 52,136,151,148,148,212,
- 60, 39, 39,167, 70,161, 69,114,141,199, 13,236,215,215,236,220,125, 1, 84,148, 18,109, 26,154,195,199,195, 30,241,169,133,136,
-140, 77,133, 74,198,134,185,181, 13, 58,116,237,101,157,145,246,118, 92, 46, 80,179,191, 22,215,120,220,160,129, 95,153,158,139,
- 72, 71, 65,122, 28,253,250,225,153,235, 10,137,104, 18, 0, 60,254,243,248, 30, 71, 27,163,158,238,173,219, 48,252,122, 14,176,
- 58,125, 44, 99, 92,254, 63, 83,219,239, 61,220,114,193, 94, 87, 86,206,152, 5, 1,190, 52,203,202,249,161,153, 66,177, 83, 51,
-175, 55,208,107,225,146, 37,237, 39, 78,158,204,163, 40, 10, 71,126,253,181,240,105, 84, 84,252,100,128,154, 82, 5,223, 78,192,
-117,232,192,129, 92, 51,115,115,204,153, 53, 11,102, 10,197,141,178, 93, 2,116,159, 51,127,126,167, 25, 51,102, 24,237, 89, 53,
-253,113,239, 9,107, 90, 83, 52, 77,104,134, 41,143, 86,111,138,107, 59, 97,224, 64,152,153,155, 99,246,236,217, 32,228,242,203,
-101, 2,138,137, 27,227,191,246,245, 9,232,223, 25, 4, 8, 28, 11,187,131,215,201,217,207,110, 8,240,230,115, 85, 85, 21, 80,
-165,143, 86,181, 67,135, 69,114,100,118,255,106,176,192,221,221,189,168, 81,163, 70, 69,185,185,185,120,254,252, 57,242,243,243,
- 17, 28, 28,140,184,184, 56, 80, 20, 85,107, 1, 67, 81, 20, 62, 54, 39, 0, 56,216,152, 99, 84,223,118, 76,169, 68,196,203,206,
-206, 46, 55,124,244, 31, 18, 90,101, 80, 42,149,188,250,245,235,131, 4, 8, 97,137,194, 52,227,104, 23, 34,227,104, 23, 66, 88,
-162, 48,149,201,100,164,169,169, 41,164, 82, 41, 79, 7, 42,214,151, 95,126, 57,255,204,153, 51,172,181,107,215,194,203,203, 11,
-114,185, 28,247,239,223, 79, 5,144,165,110,147,126,251,246,237,116,141, 16, 94,191,126, 61, 78,159, 62, 77,244,232,209, 99, 97,
-101,231,147, 64, 32,216, 56,101,202,148,188,146,162, 60,236, 29, 38, 70,232,168,108,252, 60,240, 45, 70,216,156, 66, 94,230, 59,
-236,219,183, 15, 87,175, 94, 35,174, 92,185,202,190,121,243,166,201, 87, 95,125,181,163, 78,157, 58, 97,213,117, 50, 61, 61,125,
-237,140, 25, 51, 10,138,138,138, 80, 84, 84, 4,177, 88,130, 60, 17,240,108, 75, 83, 60,219,210, 20, 18,202, 8,187,118,238, 38,
-159, 61,123,102,251,246,237, 91,167,254,253,251,111,225,243,249, 7,171,227, 76, 75, 75,123,240,237,183,223, 74, 10, 11, 11, 33,
-147,201,228, 42,149, 74, 38, 22,139, 21,199,143, 31,159,107, 99, 99,211,225,226,197,139,172,171, 87,175, 49,111,222,188,197,190,
-126,253,186, 69,183,110,221, 78, 56, 56, 56,252,162,139,165,140,193, 96,108, 11, 9, 9, 25,183,107,215, 46, 7, 31, 31,159,102,
- 21,134,162,248, 61,123,246,172,247,235,175,191,214, 9, 10, 10, 90,136,210, 0,148, 79, 10, 91, 91,219,153, 3, 7, 14,196,174,
- 93,187,112,254,252,249,121, 59,118,236,192,151, 95,126, 9, 39, 39,167,111,161,251,176, 23, 0,252,184,117,235, 86, 15, 15, 15,
- 15,140, 25, 51, 70, 54,105,210,164,239, 14, 29, 58, 84, 63, 60, 60,156,253,203, 47,191,212,155, 58,117,234,236,128,128, 0, 73,
-131, 6, 13, 16, 28, 28,220,144, 36,201,109, 58, 93,223, 14, 14,115, 71,140, 24,129, 77,155, 54,225,230,205,155,131, 81,250, 64,
-149, 1,184,116,247,238,221,254,235,214,173,195,224,193,131,225,236,236, 60,187, 54,150,167,166, 77,155, 46,235,211,167, 15,194,
-195,195,209,170, 85, 43,116,232,208, 97, 30, 0,219, 90,238, 78,210,212,212,244,196,161, 67,135,124,235,213,171,135, 53,107,214,
-192,205,205, 13, 7, 15, 30,244, 53, 49, 49, 57, 1, 29,221, 55, 44, 44, 44, 76,141,141,141,177,112,225, 66,122,240,224,193,121,
- 53,125,230,205,155, 71,115,185, 92, 88, 89, 89,233, 26,248, 98,196,227,241, 58,122,121,121,225,254,253,251,184,122,245, 42,150,
- 46, 93,138,185,115,231, 34, 59, 59, 27,195,135, 15, 55, 6,224,175,199,118,219,219,217,217,161,176,176,180, 46,188,151,151, 23,
-158, 60,121,130,236,236,108, 56, 59, 59, 35, 35, 35, 3, 54, 54, 54,104,220,184, 49, 40,138,178,215,141,146,246,178,181,182, 64,
- 86,190, 20, 76, 40,209,218,221, 22, 55,158,231,226, 93,182, 12,246, 54,150,200,200,202, 70, 29, 27, 30, 92, 92,234,130,166, 41,
- 47,157, 20, 48,131,108,205,229, 25, 33,175, 72,142,180,216,155,185,114,149,116, 74, 65,226,221,148,130,196,187, 41,114,169,100,
-202,227, 59, 87,115,235, 57, 24,193,197,197, 5, 4, 77,181,251, 20,215,227,144,186,112, 49, 49, 98,142,185,250,243, 50, 34,108,
-255, 98, 66,154,251,174,109, 31,135, 82,203,178, 29, 80,127,200,240,225, 29,191,251,238, 59, 94,102,102, 38, 21, 48,108, 88,222,
-218,192,192,107,127,212,240, 98, 80, 12, 52,234,217,179, 39, 72, 0,127, 92,185, 34,202, 0, 82, 1,192, 1,112, 25,240,205, 55,
- 93,150, 44, 90,100,148,147,155, 75,221, 79, 40, 62, 23,151, 69, 15,178, 86,161,190, 46,254, 89, 42,192, 91,195,123,249,242,101,
- 90, 12, 60, 6, 0, 63, 23,124,219,171,147,167,207,232,129, 93, 32,200,202,199,236,181, 63, 99,207,201, 91,151, 45, 20,244, 23,
-255,161, 71,241,228, 90, 9, 45,245,208,207,123,211, 74, 74,222, 31, 61,248, 80, 1,243,119,112, 86,134,255,162,208,210, 64,161,
- 40, 29, 37,145, 41, 40,200, 20,148,230,173, 22, 98,177, 88,103,138,203,151, 47, 31,158, 53,107, 22,182,108,217,130, 87,175, 94,
-129,205,102,195,203,203,139, 15,192, 84,115,207,111,221,186,181, 61, 73,146,136,143,143,199,230,205,155, 49,126,252,120,250,222,
-189,123, 7, 81,121,190,148, 39,121,121,121, 59,167, 76, 26, 95,144,159,249, 14, 10,113, 62,178,210,222, 64, 42, 42,192,154,245,
- 27, 81,162, 96, 34, 67, 40, 71,134, 80, 14,146,107,141, 61,251, 15, 49,154, 54,109,218,135,193, 96,244,171,166,159,247, 51, 51,
- 51,247, 79,155, 54,173, 32, 35, 35,163,108,251,100, 10, 26, 50, 69,249,243,213,216,216, 24,219,182,109,179,112,119,119, 31,200,
-100, 50,187, 85,195, 41, 72, 73, 73,137,155, 54,109,154, 44, 51, 51, 19, 66,161, 16,231,206,157,235, 95,175, 94, 61,171, 13, 63,
-110, 33, 68,114, 38, 50, 10,228,200, 40,144,131, 99,106,143, 19,161,103, 24,141, 27, 55, 14, 96, 50,153, 29,106, 18, 89, 71,142,
- 28, 25, 61,108,216, 48,179, 31,127,252, 49,239,236,217,179,187, 0,104, 31,144,248,109,219,182,157, 60,113,226, 68,209,252,249,
-243,173,131,130,130,230,125, 98,177,213,109,216,176, 97, 77, 40,138,194,169, 83,167,158, 1,216,122,230,204,153, 71, 82,169, 20,
-195,135, 15,175,175, 30, 70,210, 5,109, 3, 2, 2,166,251,250,250, 98,206,156, 57,242,107,215,174,181, 6,176, 5,165, 67,185,
- 52,128,100, 0, 59,110,221,186,213, 98,230,204,153,210,118,237,218, 97,236,216,177,227, 1,248,214,192,219,113,196,136, 17, 30,
- 20, 69,225,248,241,227, 79, 1, 92,172, 48,255,122,104,104,232,125,153, 76,134,145, 35, 71, 54, 0,160,207,141,156,205,229,114,
- 79,173, 94,189,218, 50, 45, 45, 13,163, 71,143,150,198,199,199, 35, 48, 48,208,200,194,194,226,162,214, 53,160, 51,184, 92,238,
-190,159,126,250,105,160,183,183, 55,166, 77,155, 38,219,189,123,247,172,233,211,167,203, 90,183,110,141, 93,187,118, 13,228,112,
- 56,122,149,232, 72, 79, 79, 47,136,141,141,181,169,233,147,154,154,170,107,120,190,177,169,169,105,132,167,167,103,161,151,151,
- 87, 27,165, 82,137,152,152,152, 55,135, 15, 31,166,188,188,188,176,115,231, 78, 4, 5, 5,161, 95,191,126, 96, 48, 24, 58, 11,
- 45, 6,131, 1,185, 92, 14, 99, 99, 99, 48,153, 76,188,121,243, 70,147, 90, 6,108, 54, 27, 0, 96, 98, 98, 2, 35, 35, 35,144,
- 36,169, 83, 52, 26, 65,128, 46, 44, 81,128,197, 34,193, 36, 41,196, 37, 11, 33, 87, 80,224,177, 25, 96, 49, 9,128,166, 96,105,
-194, 2,143,195, 0, 73, 16,148,142,156, 16,138,228,224,176, 73,176,216, 28,130, 84,170,140,202, 30,142, 76,149,145,145, 17,135,
-176, 53,231,130,199,254, 23,149, 5, 38, 74, 29,203,199, 1, 44,147,186,117,135,110,218,188,153, 83, 88, 92,140,193,131, 7,231,
- 37, 61,122, 20, 34, 6, 30,117,173, 33, 72,137,100, 50,221,253,186,118, 69,100, 84, 20,138,242,243, 95, 3,165,206,241, 28, 39,
-167, 97,219,182,109,227,136, 37, 18, 12, 30, 52,168,224,213,157, 59, 71, 82,138, 17,118, 60,185, 84,136,213,120,220,217,108, 71,
- 13,175, 48, 63, 63, 31, 40, 77, 33,225, 96,103,186, 97, 70, 64,111, 20,149, 72,176, 96, 99, 8, 21, 21, 39,248, 54, 60, 21, 95,
-157, 73,135,240, 63,246, 24,158, 92,225, 3, 64,135,132,165, 26,235, 82, 77, 98, 69, 42,149,126,116, 1,244,161,156,149,137,196,
- 15,229,252, 55,130,201,100, 74, 94,190,124,201, 49,183,113,162,108,204, 88,249,245,198,223,177, 0, 0,107, 83,166, 80,174, 82,
- 80,233,233,233,224,114,185, 18, 29,135, 27, 38,237,219,183,111, 13,128,102, 76, 38, 51,236,208,161, 67, 68, 72, 72,136,213,136,
- 17, 35, 18, 98, 99, 99,211, 60, 61, 61, 93, 15, 29, 58,100, 14, 0, 59,118,236,160, 79,156, 56,209, 27,165, 41, 51,170,204,227,
-146,153,153, 25,152,155,155,123,111,198,140, 25,193, 28, 14,199,202,196,196,196, 38, 60, 60,156,144,200,105,180, 93,146, 92, 22,
-137,104,110, 68,226,246, 98,115, 76,158, 60,153, 17, 27, 27,187, 62, 45, 45, 45,172, 26,206,133, 5, 5, 5,225,175, 94,189,218,
- 98,225,220,210,206,196,117,137,133,207,226,120, 0,128,171, 45, 11,164,250,190, 88, 80, 80,128,236,236,108, 76,159, 62,221, 42,
- 33, 33, 97, 97, 90, 90,218,141,106,172, 90,183,114,114,114, 82, 95,188,120,225,199, 98,177, 56, 38, 38, 38,109, 35, 34, 34, 8,
-137,140, 66,243,133,201,200, 43, 46,237,167,181, 41, 19,143, 87, 59,224,219,111,191,101,190,126,253,122,163, 64, 32,232, 92,233,
-205,140, 36,131,180, 69,214,130, 5, 11,162, 1, 52, 0, 80,110,104, 84,165, 82, 17, 35, 71,142,124, 14,192,107,254,252,249,214,
- 52, 77,207, 91,184,112, 97, 30,128,189,255,244,185,100,110,110,190, 97,202,148, 41, 56,113,226, 4,242,243,243,183, 1, 64, 97,
- 97,225,214,163, 71,143, 30,159, 52,105, 18,126,253,245,215, 13,217,217,217,127,160,230, 80,237, 47,135, 15, 31,142, 75,151, 46,
-225,207, 63,255, 92, 6, 32,166,138,118,175,194,195,195, 23,158, 61,123,118,251,136, 17, 35,240,243,207, 63,247, 1, 80,157,131,
-108,207,222,189,123,227,226,197,139,200,205,205,221, 85, 89,131,130,130,130,221,231,206,157,107,223,187,119,111,172, 95,191,190,
- 39,128,235, 58,108,186,135,133,133,197,161,237,219,183,183,245,246,246, 70, 64, 64,128, 68, 46,151,247,153, 63,127,254,249, 99,
-199,142,153, 29, 62,124,184,205,228,201,147, 31,168,115,190,221,215,201,148, 69,146,235, 54,111,222, 60,193,207,207, 15,243,230,
-205, 83, 94,190,124,121, 0,128, 43,127,252,241, 71,194,130, 5, 11, 46,108,222,188,153,177,105,211,166, 9,179,103,207,206,166,
- 40,234, 83,137,235,213, 59,118,236,104,223,171, 87, 47,188,121,243, 6,247,239,223,135, 92, 46,255, 53, 34, 34,226,118,163, 70,
-141, 86,203,100,178,243, 38, 38, 38, 99,204,204,204, 60, 91,182,108,249,197,227,199,143,141,161,155,159, 94,102, 98, 98,162,165,
-133,133, 5,148, 74, 37,158, 61,123,134,186,117,235, 66, 46,151,227,237,219,183,240,246,246, 6,155,205, 70,102,102, 38,180,172,
-229, 53,136, 34,242, 89, 66, 82,122, 3,107, 51, 19, 64,197,195,147,248, 84,216,217, 90, 65, 69,144,200,200, 16,160,101, 19,103,
- 16, 4,129,130,220, 12, 16, 4,241, 92, 23, 78, 21, 77, 69,190, 75,207,170, 99, 99,198,133,119,251, 94, 54, 17,127,100,135,152,
- 55,232, 52,153,201, 32, 24, 28,174,233,222, 9, 99,199,218, 82, 20,141,130,220, 76, 48, 73,242,225,167, 56, 64,167,222, 33,165,
-171, 27,239, 73,175, 9,107, 90, 18, 52,104,177, 28,135,127,206, 68,190, 49,208,114,199, 15, 63, 88,218,216,218, 34, 32, 32,128,
-202, 77, 75,187, 86,162, 99, 98,229, 6,141, 26, 57,152,154,153,225,238,221,187, 96,148,250,216,226, 32,224, 17,180, 96,129,141,
-189,163, 35,198, 79,152, 64,101,190,123,119, 93, 12,164,235,211,215, 6,110,110, 44, 13, 47,169,230, 21, 48, 48,107,254, 0, 95,
-174,137, 17, 23,235,246,156, 65, 74,142,232,120,132, 0,123,254,163,246,142,125,213, 90,180,170,114, 62, 43,117,170, 54,174, 86,
-172,240,120,188, 50,107,138, 30,111,122, 31,157,179, 38,252, 29,156,159, 16,139, 1,156, 5,176, 56, 37, 37, 37,110,194,132, 9,
-114,165, 92, 90,116,111, 77,131, 69, 81,235,235, 77,139, 8,228, 79,251,125,150,197,162, 18, 97, 94,209,142, 29, 59, 20, 41, 41,
- 41,113,218,203,212,192,253, 14,192,197, 95,126,249,101,247,169, 83,167,224,229,229,133,152,152, 24,123,145, 72,212,234,249,243,
-231,214, 30, 30, 30, 8, 9, 9,193,137, 19, 39,182, 0,184, 90,157,200,210, 64,169, 84, 94,203,200,200,104,156,156,156,220,208,
-210,210, 82, 97,105,105,137,138,145,136,133, 98, 10,185, 5, 66, 88, 91,219,192,220,220,188,190, 14,226,252, 98, 70, 70,134, 59,
-101,213,164,139,123,206, 54, 97,228, 58, 23, 68,174,115,193,197,133, 78,224, 91,114,144,159,159,143,236,236,108,100,103,103,131,
- 32, 8, 40, 20,138,166, 58,112,190, 21, 8, 4, 7,222,189,123,119,214,193,193, 1,102,102,102,160, 1,100, 20, 40, 16,189,201,
- 3,209,155, 60,144, 81,160, 64, 97, 81, 17,234,213,171, 7, 51, 51,179,170,134, 40,200, 58,117,234,244, 29, 54,108,152, 25, 0,
-168, 5, 84,119,154,166,167, 85,242,153,170, 84, 42, 59,105,218,126,255,253,247,214, 0,122,255,195,231, 19, 3,192,140, 73,147,
- 38,181,225,241,120,216,185,115,231, 91, 0, 71, 52,247,250,221,187,119,199, 3,192,172, 89,179, 60, 1,204, 67, 21,153,160,203,
- 76, 67,108,118,235,166, 77,155, 34, 34, 34, 2, 0,206,212,176,238,208,123,247,238,161, 81,163, 70,224,241,120,109,107,104, 91,
-223,197,197, 5,241,241,241, 0,240,164,138, 54, 79,226,227,227, 75,135,123, 8,162,190, 14,219, 62,176, 87,175, 94,207,110,220,
-184,209,182, 99,199,142,152, 48, 97,130,236,193,131, 7,125, 1,220,126,242,228, 73,183,145, 35, 71,138,220,221,221,113,235,214,
- 45,143,145, 35, 71,222, 35, 73,114,141, 14,156,227, 87,173, 90,181,248,235,175,191,198,170, 85,171,232,147, 39, 79, 6, 0,184,
-162,158,119,249,248,241,227,163,215,174, 93, 75, 15, 26, 52, 8, 43, 87,174, 92, 12, 96, 90,117,100, 34,145, 72,168, 82,169, 32,
- 18,137,116, 50,201,235,218,222,214,214,246,203, 94,189,122, 97,233,210,165,168, 83,167, 14,206,159, 63, 79, 3, 8, 3, 16, 46,
-147,201,186, 0,216, 44, 18,137,126,143,136,136, 64,207,158, 61,217, 40, 95, 98,164,186,245, 63, 59,122,244,168,212,194,194, 2,
-174,174,174,104,208,160, 1, 50, 50, 50,144,148,148, 4,111,111,111,180,110,221, 26, 74,165, 18, 7, 14, 28,144, 20, 21, 21,233,
-148,147, 79, 41, 19, 29,190,122,225,180,208,198,140, 11,103,123, 11,212,171, 99,141,226,130, 28,100,103,164,163,117,211,186,232,
-218,186, 30,114,132, 50, 92, 14, 59,157, 95, 84, 84,114, 88, 39, 19,190,180,228,208,181, 63,206, 11,173,204,216,104,220,196, 19,
- 35, 39,204,106,217,178,149,207,213,118,237, 58, 93,254,113,195,186,230,221, 59, 52, 37, 82,115, 36,184, 20,118, 38, 95, 88, 88,
-120,232, 83,220,232, 87, 2, 12,137,133,251,237, 93,103, 35, 15, 52,235, 51,233, 64, 92, 42,182, 1,128,130,193,240,232,251,229,
-151, 72, 77, 77,197,233, 83,167, 4, 37,192, 83, 93,249,140,140,140, 72, 0, 16, 10,133,224,170,253,238,148, 64,147,175,190,250,
- 10,217, 57, 57, 56,122,228, 72,246, 37, 32, 74,159,126,246, 7, 56,198, 70,165, 6, 65,161, 80, 8, 2, 40, 4, 0,130,137,190,
-237,188, 26, 33, 59,175, 16, 55, 30,198, 21,215, 19, 99,122,117, 60,159,177, 35,124,237,124,180, 0,228,204,155, 55, 15, 92, 46,
- 23,124, 62,191, 76, 28,105,196, 10,135,195, 1,159,207,135, 82,169,196,241,227,199, 1, 32,167,218, 55, 60, 64, 58, 96,218,122,
- 74,170,160, 75, 88, 44,214, 71,225, 84,191, 57, 74, 7, 47,248,153,250,227, 94,229, 65, 49,181,225,252, 12,208, 78,157, 19,171,
- 29,128,252,164,164,164,212,161,131, 7, 8,147, 19, 94,100,136, 10,210, 5,133,185, 41,130,148,183,207, 51,150, 44,156, 39, 76,
- 77, 77, 77, 65,105, 46,173,118,233,233,233,154,101,116,193,188,161, 67,135,254, 52,105,210, 36, 58, 58, 58, 26, 0, 16, 25, 25,
-137,177, 99,199,210,163, 71,143,222, 6, 96, 81, 45,250, 45, 18,139,197,229,172, 33,114, 21, 85, 54,228, 87, 88, 88,136,244,244,
-116,200,100, 50,157, 21,241,171,203,155, 94,230, 37, 61, 86,120,186,154,192,211,213, 4, 30, 46,198, 32,148,197,101, 34, 43, 59,
- 59, 91,243,230, 44,209,163,159,133, 82,169,180, 92, 63,181,135, 38, 11, 11, 11,145,145,145, 1,149, 74, 85,213,131,140, 74, 75,
- 75,187,124,226,196,137, 34, 0,248,241,199, 31,243, 8,130,248,147, 32,136,159, 42,249,236, 97, 50,153,119, 53,109, 55,109,218,
-148,135,247,135,196,254, 78,124,237,237,237,157,191,120,241,226,157,179,103,207,198,158, 61,123, 32, 16, 8, 22,225,175, 92, 60,
- 84, 78, 78,206,130, 93,187,118, 97,220,184,113, 88,190,124,249,166, 86,173, 90, 21, 2, 24, 89, 21,161,157,157,157, 51,147,201,
- 68, 84, 84, 84, 33,128, 55, 53,172, 63, 35, 42, 42, 42,147, 32, 8,240,249,124,183,234, 26, 90, 91, 91, 55, 52, 51, 51, 67, 90,
- 90, 26,160,126, 99,174, 4, 73,233,233,233, 52,135,195,129,147,147, 83,163,154, 54,222,202,202,106,193,129, 3, 7,152, 47, 94,
-188, 64,247,238,221, 83,111,221,186,213, 19,128, 38, 36, 61, 42, 50, 50,210,183, 91,183,110, 47,175, 94,189,138,141, 27, 55, 18,
- 45, 90,180,152, 86, 19,167,171,171,235,212,241,227,199, 35, 56, 56, 24,123,247,238,157, 6,224, 84,133, 38,199,118,237,218, 53,
-107,239,222,189,152, 48, 97, 2,234,215,175, 63,178, 58,190,228,228,228,133,126,126,126,145,175, 94,189,210,169,226,129,142,237,
-187,249,248,248, 52, 20,139,197, 56,116,232,208,155,134, 13, 27, 62, 58,117,234,212, 60,188,255,192,254,253,244,233,211, 24, 53,
-106, 20, 90,180,104,113, 8,192, 8, 93, 46,203,216,216,216,148,235,215,175, 83,108, 54, 27,174,174,174,232,215,175, 31, 2, 2,
- 2,208,188,121,115,200,229,114,156, 62,125,154,122,254,252,121,170, 76, 38,211, 41,151, 82,238,171,155,231, 19, 19,255,199,222,
-121,135, 55, 85,253,127,252,125,179,119,210,180,105,210, 69, 75,129,210, 77,161, 64,217,163, 80,138, 64,153,162,136, 40, 34, 10,
-200, 16, 21, 21, 84,134, 32, 75,217, 32,171,130,130, 8, 10,136,128,148,165,226, 23,100,211, 2,165,133,178,186,103,210,189,146,
-102,159,223, 31,180,252, 74,237, 72, 90,220,247,245, 60,247, 73,114,110,238, 59,231,174,115,223,249,156,117,239,194,245, 43,231,
- 76, 44, 38, 3,158,174,142, 24, 29,209, 9,175,141,237,133,206,254,238, 72,215,232,112,230,204, 79,166,212,212,228, 75,182,244,
- 56,172,209, 76,186, 29,127, 49,241,250,121, 51,155, 69,193,223,175, 61,230,127,248,190,124,217,162,185, 14,237,219,122, 34, 62,
-165, 20, 63,157, 62, 97,202,201,202,252,245,175,234,113,120, 22,224,136,121,148,136,201, 96,192,194,224, 85, 50,171, 59,210, 4,
- 7, 6,250,170, 92, 92, 16, 19, 19, 3,134, 29, 61, 66,207, 2, 28,177,248, 81, 45,120, 69, 69, 5,106,244,218,249,249,249,121,
-122,121,225,120, 76, 12,152, 86,235,157,126,118, 14, 48,122,247, 81, 53,244, 99, 93, 10,168,154,222, 10,146,118,173,148,126,114,
-153, 8, 87,226, 31, 64,111, 34, 87,191, 41,198, 95, 58, 30,217, 31,200, 20, 52,179,234,112,213,182,109,219,194,118,236,216, 49,
-232,157,119,222, 17, 79,156, 56, 17,124, 62, 31, 90,173, 22, 30, 30, 30,176, 88, 44, 56,121,242, 36, 98, 99, 99, 43,172, 86,235,
- 79,248,253,176, 1, 17,168,213, 75,227, 84, 50, 4,143,252,150, 54,236,200,115,207, 61, 21, 77, 0, 16, 63,176, 74, 11, 91, 27,
-246,108, 60,112,126,204,222, 83,215,169,183,198,247, 99,116,246,107, 5, 0, 80,169, 84,144, 74,165,118,107, 62, 5,254,112,205,
-218,213,186,121,121,121,119,243,242,242, 52,175,191,254,186,127, 77,195,119, 30,143, 87, 85, 29,201, 42,174,111, 27, 27,242,105,
- 4, 48,125,199,142, 29, 71, 75, 75, 75, 79,189,247,222,123, 88,182,108, 25,126,252,241,199, 62, 0, 46, 52,115,223, 45,197,197,
-197, 37, 87,175, 94, 85,249, 4,132,162,141,146,141,190, 11,238,131, 16, 2, 39, 33, 65,121, 73, 17,110,220,184,142,242,242,242,
- 43,246,228,211,104, 52,150,104, 52, 26,133, 82,169, 68, 81, 81, 17, 10, 10, 10, 30,155,172,226,226, 98, 20, 21, 21, 17,138,250,
-221,152, 45,141,105, 86,106, 52, 26,109, 82, 82, 18, 87,213,202, 7,109,149, 28,116,251,240, 46, 64, 8, 60, 29, 25, 40, 47, 43,
-193,165, 75,151, 80, 90, 90,250,191,134, 52,173, 86,235,156, 9, 19, 38, 48, 1,188,252,222,123,239, 57, 2,232,248,254,251,239,
-255,132, 58, 61, 11, 89, 44,214,186, 61,123,246, 4,215, 84, 49,206,157, 59,119, 45,128, 29,127,214,181,228,228,228, 52, 39, 38,
- 38, 70, 98, 52, 26,177,113,227, 70,172, 93,187,118, 39,126, 63, 80,101,204,231,159,127,190,153,193, 96,204,152, 57,115, 38,166,
- 78,157, 42,236,210,165,203, 59,185,185,185,223,212,167,153,157,157, 61,191,115,231,206, 11, 53, 26,205,114,155,204,242,253,251,
- 83, 58,119,238, 60, 95,163,209,124,214,216, 57, 18,137, 68, 34,139,197,130,212,212,212, 98,160,193,246, 29, 85,169,169,169,217,
- 22,139,197, 67, 40, 20, 58, 54,117,125, 22, 23, 23, 47,239,210,165,203,199,106,181,250, 52,128,165,245, 24,242,155,185,185,185,
- 65,179,103,207,158,181,114,229,202, 49,121,121,121,223, 54,165,153,158,158,190, 60, 60, 60,124,193,189,123,247,118,161,225, 42,
-224,207, 23, 47, 94,108,220,179,103,207, 27,169,169,169, 43,154,208, 60, 86, 80, 80,112,204,142,243,219,208,247, 31,107, 50,153,
-204,247, 87,174, 92,201,216,182,109, 27, 8, 33,171, 45, 22, 75, 67,249,140, 63,124,248,240,238, 94,189,122, 77, 60,112,224, 0,
- 63, 40, 40,104,170, 94,175,223,215,212,245,169,213,106, 15, 29, 56,112, 96, 76,124,124,188,199,196,137, 19,249,190,190,190, 48,
- 26,141,200,205,205,197,182,109,219,170, 18, 18, 18,178, 74, 74, 74, 14,217, 83,134,152, 13,101,227, 47,158, 57,178, 47,237,126,
- 66,143,254,207,140,148, 27,140, 30,224, 21, 50, 81, 82,152,135,147,199, 14, 21,167,166, 38, 95,210,106, 75,198,219,163,105,212,
-151,190,112,233,215,163,223,102,165, 38,117,239, 27, 62, 84, 94,101,240, 2,143,195, 64,161, 58, 27, 39, 99,142, 20,165,166,166,
-252, 86,101,210,191,242, 87,149,243, 76,111, 44,101,230,197,190, 62,109,120, 39, 8,228, 30, 55,216,192,198, 94,128, 64,161, 82,
-113,170,239, 29,136, 31,181,121,180, 73, 83, 13,112,125,170,107,169,180, 90, 45,216,128, 97, 18,192,118,118,118, 22, 0,192,189,
-123,247, 32,124, 84,171, 97, 87, 62, 43, 0,145,176,150, 46, 3,208, 22,178,224,222, 78, 42,162, 0, 32, 43,175, 16, 6, 83,163,
-207,141,127, 58,209,181, 12, 87,116,115, 4, 56, 0, 34,196, 98,241,178,133, 11, 23,174,190,114,229,202,234,168,168,168,213, 60,
- 30,111, 89,245,193,230, 52,114, 34,254, 52,205,174,110,112, 12,111, 75,157,139,108, 71, 89,167,245,145, 91, 94,233, 38, 50, 12,
- 24, 48, 96,115, 11,243,217,146,155,229,143,212, 60, 98, 50,153, 8, 30, 85,219, 29, 65,195, 85,130, 31,212, 90,159,151,145,145,
- 65,170,223,219,147, 79,197,184,113,227,172,229,229,229,228,249,231,159, 39,104,122, 10,159, 70, 53,121, 60, 94,120,223,190,125,
- 77,234,252, 34,114, 55, 37,155, 92,142,187, 77, 78,157,185, 72,190, 61, 20, 67, 54,109,222, 78, 66, 66, 66, 12, 0,188,236,209,
-100,177, 88, 3,194,195,195, 11,213,106, 53, 73, 74, 74, 34,231,206,157, 35, 7, 15, 30, 36,219,183,111, 39, 91,183,110, 37,173,
- 90,181, 82, 3, 80,217,163, 41, 16, 8, 70, 14, 25, 50,196, 84, 82,166, 37,169,217,133,228, 86, 82, 42,185,112,245, 22, 57,121,
-230, 2,249,102,223, 1, 18, 24, 24, 88,101,131, 38,147,201,100,110,250,246,219,111,203, 8, 33,100,228,200,145, 89,120,114, 32,
-213, 54,115,230,204,209, 16, 66,200,103,159,125, 86,136,250, 27,194,255,209,215,210, 51,238,238,238,119, 57, 28, 78, 12,128,151,
-155,216,238, 5, 22,139,245,163,139,139,203, 53, 0,163,255,130,251, 40, 74,169, 84, 94, 6,208,212, 12, 7, 53,223, 27,245, 47,
-185,223,255, 8,205, 1, 44, 22,235, 28,208,248, 36,194,181,202,235, 79,152, 76,230,113, 0, 3,237,204,103,123,133, 66,241,188,
- 92, 46,127, 75, 46,151,191,165, 84, 42,159,231,114,185,237, 91,178,239, 78,237, 35,134,123,134,142, 56,220,170,227,176,116,207,
- 78, 81,233,222,157, 71, 30,118,106, 31, 49,188,165,154, 94,157, 71, 30,241,236, 20,149,225,217,105,120, 90,155,174, 35, 15, 43,
-252, 34,134,252,149,231,232,101,119,184, 13,106, 3, 51, 57,183,128,144,115, 11, 72, 68, 27, 88,123, 56, 32, 48, 12,144, 12,142,
-136, 88, 67, 44,150, 53, 99, 70,141, 90,227, 3, 56, 17,128, 89,119,169, 79, 51, 20,144, 62,222,118,228,200, 53,109, 1,197, 32,
- 64,216,175, 79,159,213,196, 98, 89, 51,225,133, 23,214,120, 2, 46,245,233, 53,164, 73, 0,166, 59,224, 86, 91, 87, 1,180, 27,
-235,141,160, 15,134,123, 19,114,110, 1, 89,252,156, 47,233,172,194,203, 77,104, 54, 20, 41,250, 71, 71,180,236, 69, 84, 93,184,
-174,168,126, 21, 61,133,139,240,169,107,118,119,133,111, 68, 59, 42,105,168, 31,171, 8,143,186, 36,139,254,133,133,228, 46,131,
-193, 64,170,170,170,136, 86,171, 37, 21, 21, 21,117, 13,212, 99, 67,150,147,147, 67,178,178,178, 72, 70, 70, 6, 73, 75, 75, 35,
-248,255,182, 55, 54,231, 83, 42,149,238,120,238,185,231, 44,108, 54,123,211,211,216,119, 71, 71,199, 21,221,186,117, 51,110,216,
-176,129, 28, 62,124,152,124,241,197, 23,100,230,204,153, 36, 56, 56, 88,239,224,224, 48,190, 57,154, 46, 46, 46,243,253,252,252,
- 10,119,238,220, 73,190,249,230, 27,178,126,253,122,242,209, 71, 31, 89, 60, 60, 60,242, 36, 18,201,224,230,104, 42,149,202,232,
-222,189,123, 27,163,163,163,201, 79, 63,253, 68,246,238,221, 75,230,204,153, 67,252,253,253,245, 34,145,232, 89, 27, 53,153, 44,
- 22,107,205,180,105,211,242,220,220,220, 98,234,172, 19, 6, 6, 6, 94,155, 48, 97, 66, 14,128,185,255,162,235,147,214,164, 53,
-105,205, 63,192,104,189,232, 6,119, 2, 48,133, 28,206, 11,253,250,244, 89,205, 1, 94,176,215, 20,241,153,204,177,189,186,117,
- 91,205, 1,198,215,124,151,207,100,142,237,215,167,207,106, 54,147,249, 82, 67,122,141,105, 18,128,201, 97,177,230,246,234,209,
- 99, 13, 11,248,176, 38,109, 64, 27,234,206,156,103, 90,145, 62, 94,212,131,151,148, 16,254,139,141,214, 83,135,245, 7, 92,132,
-255, 20,205,191,203, 77,237, 83,109,152,142,216, 17,209, 58,130, 71,179,168,251, 52, 51,159,130,167,188,239, 29, 20, 10,197, 9,
- 31, 31,159,252,214,173, 91,231,200,229,242,125, 0, 60, 90,168, 25,228,226,226,242,181, 74,165,186,239,234,234, 26,175, 80, 40,
-214,225,209,168,243,205,214,100,179,217,221, 84, 42,213,255,188,189,189, 75,188,188,188,212, 10,133,226,219,122, 34, 89,182,104,
-186,162,254, 66,133, 83,189,142,126,232,208,154,180, 38,173,249,132,129,137,108,139,149,131,218,192, 60,168, 13, 44,145,222, 88,
- 87,219,160, 68, 1,130,230,154,162, 87, 0, 94,221,239, 55,165,215,148, 38, 1,152, 61, 1,113,221,109,134,122, 32,208, 70,205,
-127,122, 68,171,166,156,183,111,120,135, 6, 48,255, 1,153,252,167,104,254, 93,120,128, 70, 26, 35,215, 98,197, 83,252, 77,221,
- 83,222,135, 91, 5, 5, 5, 67, 10, 10,158,106,223,132,196,188,188,188,151,159,166,160,201,100,186,162, 86,171,251, 63, 5,169,
-134,186, 94, 27, 97, 99,183,108, 26, 26,154,255, 14, 20, 96, 65, 50,230, 69,180,199, 70,150, 5,140,147, 41,200,174,211, 37, 79,
- 71, 53, 71,243, 17,150, 93,245,148,241, 84,115,243,249,255, 84,252, 78, 35, 11,183,169,255,206,105,203,197,163, 54, 90, 45, 54,
- 90, 52, 52, 52, 52, 52, 52, 52,127, 2, 63,223,167,255,136,253, 3,136,193,147,209,183,152, 90, 70,180,193,208,167, 61, 61, 41,
-154, 19, 62,253,153,214,164, 53,105, 77, 90,147,214,164, 53,105,205,255,156,102, 13, 13,205,157,122,183,206,231,102,245,226,251,
-175, 64,215,179,211,154,180, 38,173, 73,107,210,154,180, 38,173,249,111,167,217,227,104,209,208,208,208,208,208,208,208,208, 52,
- 78,131, 81, 55,218,104,209,208,208,208,208,208,208,208,180, 12, 87, 60,154,162, 42, 6,255, 63, 85, 85, 52,208,244, 20, 60, 79,
-176,114,229, 74,134,143,143,143,152,203,229, 6, 39, 39, 39, 51,166, 79,159,222,226,142, 4,171,215,109, 98,120,121,121,137, 1,
- 4, 23, 22,151, 51, 94,125,237, 61,138, 62, 95, 52, 52, 52, 52, 52, 52, 52,255, 32,134, 85, 27,171,154,215,199, 17, 46,187,140,
-214,210,165, 75,145,145,145, 33, 2, 48, 46, 40, 40,136,187,101,203, 22,178,127,255,254, 22, 25,163, 15,231,206, 65,122,122,186,
- 8,192, 56,165,194,129,251,229,142, 85,228,192,143,231,159,186,217, 82, 40, 20, 78,127,230,118, 52, 52, 52, 52, 52, 52, 52,255,
- 41,166,212,122,157,210, 44,163,197, 98,177,152, 92, 46,183, 45,131,193, 24,194,231,243,187, 2, 64,245,148, 44,205,134,197, 98,
- 49,185, 60, 94, 91, 38,147, 57,132,199,123,164,249,220,240,222, 45,213, 28, 40, 18,137, 50,133, 66, 97, 44, 0,129, 68, 34,185,
-110, 52, 26,111, 75, 36,146,139,246,232, 72, 36,146,139,213,219, 93, 7, 32, 16, 10,133,177, 34,145, 40,147,197, 98, 13,164,175,
- 39, 26, 26, 26, 26, 26, 26,154,106,162,235, 89,126,207,177, 99,199, 26, 52, 56, 92, 46,151, 17, 20, 20,212,219,203,203,235, 66,
- 64, 64,128,193,195,195,227,160, 80, 40, 20,181, 48, 99, 12, 31, 95,255,222,110,174,170, 11,157,218,186, 26,148, 74,229, 65, 54,
-155,221, 18, 77,166, 68, 34, 89, 31, 25, 25, 89,122,225,194, 5, 34,149, 74,213, 0, 28,156,157,157,115, 8, 33,196,197,197,197,
-106,143,152,139,139,139,149, 16, 66,156,157,157,115, 0, 56, 72,165, 82,245,133, 11, 23, 72,100,100,100,169, 68, 34, 89,143,166,
- 71,180,165,161,161,161,161,161,161,177,131,198,188,200,223,152,154, 40,150,107,179,119,142,203,229,134, 42, 20,138,132,183,223,
-126,219, 18, 29, 29, 77,188,188,188,174, 42,149,202, 30, 10,133,226,137, 6,245,147, 38, 77,178,167,218, 47, 84, 34,149, 37,236,
-154,253,140, 69,247,229, 72,226,238,170,188,234,224,224,208, 67, 42,149, 62,161, 57,225,213,169,182,104,186,156, 17,217,210, 0,
- 0, 32, 0, 73, 68, 65, 84,201,100,178,248,149, 43, 87, 86,149,148,148, 16, 66, 8,145,201,100,106, 0,114,149, 74,149,147,146,
-146, 66, 20, 10, 5,129,237, 81, 60,134, 66,161, 32, 41, 41, 41, 68,165, 82,229, 0,144,203,100, 50, 53, 33,132,148,148,148,144,
-149, 43, 87, 86,201,100,178,120, 0,110,244,109, 65, 67, 67, 67, 67, 67,243,159, 54, 90,117, 13,151,109, 85,135, 93,187,118,229,
-169, 84,170, 30, 18,137,100,148, 88, 44,222, 60, 98,196,136,160, 49, 99,198, 48,244,122,189, 37, 40, 40,200,205,219,219,123,150,
- 92, 46,127,153,207,231,135,112,185,220,151,164, 82,169,235,190,125,251,124, 26,211,236,208,177, 11,207,193, 65,222,131,203,229,
-141, 18,139, 37,155,167,141, 29, 16,244,242, 59,207, 50, 56,134, 52,203,128, 16, 79,183,224,182,174,179, 92,228,162,151, 89, 76,
- 70, 8, 69, 81, 47,241,249,124,215,111,190,220,238,211,196,142,181,117,115,115,187,190,111,223,190,224,113,227,198,241,146,146,
-146, 0, 0, 22,139,133, 11,192,196,100, 50,193,227,241, 96, 52, 26,139, 1,216,122, 2,137,209,104, 44,230,241,120, 96, 50,153,
- 0, 96,170,214, 67, 82, 82, 18,198,141, 27,199,219,183,111, 95,176,155,155,219,117, 0,109,233, 91,131,134,134,134,134,134,230,
- 63, 75,141,185,138, 65,157,170, 67, 86,141,123,140,138,138,122, 34,106,196,229,114,183,220,187,119,175,151,163,163, 99, 91, 54,
-155,109,121,225,133, 23,120, 19, 38, 76, 64,126,126,190,181,162,162,130, 25, 26, 26,170,186,118,237,218, 16,179,217,220,199,193,
-193, 65, 91, 82, 82,162,208,235,245, 15, 0,204,106, 36, 35, 91,238,223, 77,232,229, 36,119,108,203,101, 51, 45, 51, 39, 79,224,
-125, 56,247, 25, 80,250, 56,171, 69, 83,200,252,164,179,131,106,221,197,202, 33,247,140,150, 62,149, 50,190, 54,175, 84,223,164,
-166, 66,161,232,204,225,112, 98, 79,156, 56, 1,161, 80,136,210,210, 82,112,185, 92, 0, 64, 69, 69,133, 12, 0,139,162, 40,112,
-185, 92,148,149,149,201,237, 57,106,101,101,101,114, 46,151, 11,138,162, 0,128, 85,173, 7, 46,151,139,210,210, 82,248,248,248,
- 80, 39, 78,156, 80, 14, 25, 50,228,161,209,104,236, 82, 80, 80, 16, 71, 95,107, 52, 52, 52, 52, 52, 52,246, 83,159, 23,249, 7,
-209,228, 56, 90,253,171, 67,117,181, 39,206,221,237,236,236,236, 34, 22,139, 3,166, 76,153,194, 80, 40, 20,136,141,141,181, 86,
- 86, 86, 50,216,108, 54,216,108, 54,115,192,128, 1, 98,179,217, 44, 60,126,252, 56,245,240,225,195,124,147,201,244, 73, 97, 97,
-225,181, 70, 50,178,187,157, 3,207, 69,224,192, 13,248,241,189,190, 12,103,159, 66,224,212, 98, 43,169,208, 48, 88, 86, 2,133,
-200,202, 92,211,135, 18,231,201,188,133, 51,191,205,167,126,123, 88,146,111, 50,153, 62, 41, 47, 47,111, 76, 51, 27, 0,170,243,
- 4,169, 84, 10,139,165,246,252,150, 32, 12, 6, 3, 60, 30,175, 89, 71,142,199,227,129,193, 96, 0,181, 34, 97, 50,153, 12, 76,
- 38, 19, 12, 6, 3,108, 54,251,137,124,208,208,208,208,208,208,208, 52,139,250,188,200, 63,133,218,227,104,217, 54, 55,165, 74,
-165,162,164, 82,169,107,199,142, 29, 63,142,140,140, 76, 25, 61,122,180,118,195,134, 13,100,237,218,181,100,205,154, 53,100,231,
-206,157,150, 95,127,253,213,244,218,107,175, 85,181,111,223,254,193,230,205,155, 3, 0, 96,232,208,161, 13, 86, 71, 58,200, 29,
- 41, 49,151,229, 26, 24,208,225,227, 23,251, 7,167, 44, 24,229,171, 53,238, 10, 37,214,133,173,136,101,147, 55,177, 28, 24,104,
- 33,247, 86,153,150,191, 62,176,170,181, 87,235, 7, 91,119,126, 23, 0, 0, 17,145, 67, 27,173,226, 84, 40, 20, 93, 61, 60, 60,
-212,167, 79,159,182, 22, 23, 23,147,194,194,194,154, 54, 90, 37, 0,100, 94, 94, 94, 57,102,179,153,200,229,242, 34,123,142,154,
- 92, 46, 47, 50,155,205,196,203,203, 43,231,145,191,146,149, 16, 66, 72, 97, 97, 33, 41, 46, 46, 38,167, 79,159,182,122,120,120,
-168, 21, 10, 69, 87,250,254,160,161,161,161,161,161,249,207, 50,165,206,107,211,244,234,213,139,146, 74,165,140, 14, 29, 58,136,
-221,220,220,186,187,185,185, 93, 89,183,110, 29, 89,187,118,173,121,219,182,109,228,235,175,191, 54,191,242,202, 43,101, 34,145,
- 40,134,203,229,202, 1,192,219,219,187,209,144, 95,215,238, 61, 40, 1,159,199,240,243, 11, 20, 43,156,156,186, 59, 59, 57, 94,
- 49,174, 13, 38,100,177,187,153,236,232, 68,200,129,103,204,171,158, 15, 43, 99,179, 57, 49, 0,228, 0,224,225,230,106,107, 24,
-209, 77,169, 84,198, 47, 94,188,184,210,104, 52,146,234, 94,134,106, 0, 14, 94, 94, 94, 57,132, 16,226,225,225,145, 9, 64, 97,
-163,158,194,195,195, 35,147, 16, 82, 99,180, 28, 92, 92, 92,212,132, 16, 98, 52, 26,201,226,197,139, 43,149, 74, 37,221, 24,158,
-134,134,134,134,134,134,166,193,185, 14, 27,140, 20, 93,184,112,129,148,149,149, 89,179,179,179, 45, 21, 21, 21,210,208,208, 80,
- 57,147,201,132, 74,165, 98, 50,153, 76,107,101,101, 37, 83,161, 80,228,176,217,236,111, 12, 6, 67,241,168, 81,163,168,212,212,
-212, 70, 27,154, 95,187,124,137,232,170,244,214,172,172, 76,139,182,162, 76,250,114,136,163,156,101, 54,194, 26,218,139, 89, 38,
-104,111,181,234,138,153,254,174,188, 28, 14,135,253, 13,128,226,209, 81,195,168,172,156, 92, 91, 27,175,231,104, 52,154,208, 45,
- 91,182,236,232,219,183,111,177, 86,171,173,105, 91, 85,119, 8, 6, 7, 27,245,234,126,143, 73, 81, 20,180, 90, 45,250,246,237,
- 91,188,101,203,150, 29, 26,141, 38, 20, 64, 14,125,125,209,208,208,208,208,208,252,167,105,112, 28,173, 38,135, 58,208,106,181,
-114, 14,135, 19, 17, 22, 22,214,186,178,178,210,186,116,233,210,204, 13, 27, 54,236,121,240,224,129,201,193,193,161,173, 64, 32,
-120,107,220,184,113,138,195,135, 15,147, 62,125,250,212,141, 62,213, 59,187,183, 78, 87, 33,231,113,216, 17,111,117,147,180,206,
- 52,202,173, 1,111, 93,205,236,183,240,226,158, 31, 18, 89,166, 14,142,186,182,142, 92,234,173,113,227,158, 87,252,112, 44,134,
-244,232,209,221, 38,205,106, 44, 26,141,230,173,216,216,216,231,219,180,105,147,101, 50,153,178, 0, 20,234,116, 58,181,155,155,
-155,198,104, 52,102, 1, 48,214,179, 93,125,154, 70,163,209,152,229,230,230,166,209,233,116,106, 0,133, 38,147, 41,171, 77,155,
- 54, 89,177,177,177,207,107, 52,154,183, 0, 88, 26,201, 11, 61,171, 59,173, 73,107,210,154,180, 38,173, 73,107,254,119,248, 93,
- 52, 11,176, 97, 82,105, 30,143,215,215,211,211,179,119, 98, 98,162,229,210,165, 75,165, 12, 6, 99,235,208,161, 67, 15, 30, 58,
-116,168,155,163,163,163,178, 85,171, 86,170, 95,126,249, 37, 28,192,254,223,126,251,205,166,232,147,128,199,233,219,201, 67,214,
- 59,250, 38,177,124, 25,123,191,212,194,228,109, 29,240,236,179, 7,223,220,179,183,155,155, 66,162,236,228, 42, 85, 29, 63,126,
- 50, 28,192,254, 75,151, 46,219, 61,158,134,217,108,254, 69,163,209,180,170,249,156,159,159, 31,170, 80, 40, 2,240, 40,250, 84,
-106,163, 76,186,213,106, 29,106,181, 90,221, 10, 10, 10,238, 0, 64, 65, 65, 65, 23,250, 58,162,161,161,161,161,161,161,169,199,
-100, 69,215,247,185,209,136, 22,151,203,117,103, 50,153,129, 89, 89, 89,233,199,143, 31, 79,236,218,181,235,144,244,244,244,149,
-132,144, 52,161, 80, 56, 37, 51, 51,243,126,102,102,166, 65,167,211, 77,179, 35, 51,238, 96,112, 2, 99,115,116,233,159,254,114,
- 59,177, 67,143,193, 67,242,242,114, 86, 90, 8, 73,227, 10,165, 83,238,101,228,223,191,172,209, 27,170,170,236,210,108,146,130,
-130,130, 59, 5, 5, 5,165,118,110, 83, 90, 99,178,104,104,104,104,104,104,104,104,236,165,169,136,150,209, 98,177,172,210,235,
-245,242, 31,126,248, 33, 59, 50, 50, 82, 15, 0, 91,182,108,177, 78,158, 60,249,124,114,114,242,192, 59,119,238, 12,113,113,113,
- 57, 3,128, 74, 73, 73,177, 37,250,100,180, 90, 45,171, 12, 6,189,252,151, 95,227,178,251,246,238,160, 7,128,109,159,111,180,
-190, 48,101,246,249,228,164,196,129,247, 18,174, 15,113,113,113, 57, 99, 49,179,168,220,188, 52, 66,159, 38, 26, 26, 26, 26, 26,
- 26,154,191, 49,209,120,178,202, 48,218, 38,163,101, 48, 24,242, 13, 6, 3, 0, 20, 71, 70, 70, 62,177,110,231,206,157, 4, 64,
- 37,128, 3,133,133,133,246,100, 38, 95,167,211, 1, 64,113,223,222, 29,158, 88,241,109,244,134,199,154, 21,229,101,244,105,163,
-161,161,161,161,161,161,249, 39,153,173,223,193,160,143, 11, 13, 13, 13, 13, 13, 13, 13, 77,139,152,210,208,103, 10, 13,247, 28,
-248,217,142, 31,104, 78,239,131,159,105, 77, 90,147,214,164, 53,105, 77, 90,147,214,252,207,105, 54,165,253, 51,254,121, 52,216,
- 24,254,143,134,238,250, 74,107,210,154,180, 38,173, 73,107,210,154,180,230,191, 29, 87, 60, 57,188,131,107,205, 10, 22,125,108,
-104,104,254,217,144, 3, 96,162,216,207, 27,132,184,129,201,205, 69,238,173,100,234, 99, 88, 91,172,169, 14,244,130,192,164,130,
-153,159, 15,117,124, 74, 75, 53,105,104,104,254,125,184,244,156, 62,154, 98, 48,183, 82,196, 10,157, 58,137,199,209,165, 9, 53,
-185,233,255, 69,111,145,139, 6, 34, 88,180,209,162,161,249,167,147,239,239, 11, 22, 86,128, 1, 87, 16,227, 67, 56, 7,174, 0,
-110, 39,180, 88,147, 99, 93, 10, 11,195, 3,196,120, 15, 74,191,149,192,221,219,244,193,254,247, 49,107,230, 27,228, 78,194, 21,
-100,100,228,160,109, 59, 87,248,250,247,196,134,141,155, 41,250,200,208,216,246,175,140,138,142, 24, 62,193, 81, 32,148, 0, 0,
-172,102, 19,118,190,211,233, 39,179,217,188, 27,192, 97, 0,186,255,250, 33,250,211, 27,195,179,217,108, 53, 0, 43,159,207, 63,
-132, 90,161, 53, 26,154, 63, 0,215,234,235,204, 90,125,221,217,131,152,197, 98, 45, 20, 10,133,191,242,120, 60, 13,143,199,211,
-136, 68,162, 95, 89, 44,214, 66, 0,226,191, 77, 25,247,117,176, 16, 12,203, 16,131,201,234,126,242, 86,137, 82,171,183,248,130,
- 97, 30, 74,118,182, 23,183, 72,147, 69, 69, 86, 25,173,158,223, 92,213,170, 42, 13,230, 0, 16,180, 72,179, 22, 14, 28, 14,231,
- 36,108,159,115,148,230, 15, 38, 61, 37, 1,199,143,173,193,210, 37, 19,241, 85,244, 52,220,189,115,185, 69,122, 1, 64,151, 46,
- 44,214,187,254,192, 0, 60,106, 7, 76,243,111,134, 34, 83,126,254,241,155,252, 31,247,125,158,255,221,154,105,228,200,138, 40,
-108,220,184, 49, 98,226,196,137,223,120,122,122,230, 3,120,142, 54, 90,127, 50, 38,147, 73, 89, 80, 80, 64,237,222,189,123,132,
- 76, 38,123,200, 98,177, 62, 0,192,249,175, 28,112,177, 88,124, 81, 42,149,170,101, 50,153, 90, 42,149, 94,111, 42,253, 95,138,
-175,179,179,115,186,163,163,227,189,218,137,206, 33,163,123,250,244,122,121,145, 83,224,200,126, 45,212,231,176, 88,172, 15,100,
- 50,217,195,221,187,119,143,200,206,206,166, 76, 38,147,210,142,237,251,202,229,242, 59, 87,174, 92, 89, 80, 80, 80,208, 47,243,
-242, 78,231,188, 43,219,157,211,255,183,166,127,236,241, 77, 11, 28, 28,100,183, 1,244,253, 91, 28,201, 42,171, 10, 12,102,120,
- 98,174, 86,152, 91,102, 82,197,165,105, 37, 0,179, 63, 12, 45,248, 19, 83,106, 85, 1,100,192,205, 44,157,232, 98,145,179,234,
-183,100,189, 20, 12, 70, 56,170, 40,151, 22, 23, 56, 12,198, 27, 86,171,117, 16,135,195,121,139,126, 66,253, 61,224,241, 56, 0,
- 33, 16,139,248, 0, 8, 24, 45,180, 70, 92, 6,163,215,197, 17, 35,150,206, 13, 9,153,229, 15, 12,111,192,108, 81, 0,222,244,
-247,247, 63, 1,224,133,167,184, 59,159,250,249,249,101, 3,152,253,180,202,165,206,157, 59,247, 12, 15, 15, 95,212,169, 83,167,
-126, 79, 75,243,223, 68,222,197, 45, 63,228,158,223,164,204,185,176, 89, 89,146,114,238, 77, 87,149,220,154,146,146,130, 97,195,
-134,225,243,207, 63, 23, 6, 5, 5,237, 1,224,246, 31,184,149, 66,107,254,224,163, 78, 27, 45,155,141,214, 88,111,244, 26,223,
- 6,103,159,247, 70,249,184, 54,168,120,169, 13,206, 63,235,141, 1,205,201,141,147,147, 19,250,246,237,203,204,206,206, 22,204,
-153, 51,103, 17,159,207, 79, 5, 48,184, 57, 90, 2,129, 32, 86, 40, 20,102,178, 88,172, 39,242, 34, 20, 10, 99, 69, 34, 81, 38,
-139,197, 26, 88, 59, 93, 34,145, 92,148, 74,165,106,137, 68,114,189, 1, 35, 20, 43,149, 74,213, 98,177, 56,182,118, 58,139,197,
- 26, 40, 22,139,179, 36, 18, 73,221,244, 1, 18,137, 36,179,110,122, 67,176,217,108,143,204,204, 76,101, 86, 86,150,146,203,229,
-170,106,167,103,100,100, 40, 51, 51, 51,159, 72,183, 7, 22,139, 53, 64, 36, 18,101, 10,133,194,216,250,210,235,238, 83, 67,212,
- 58,118, 3,108, 73,183,183,224,137,140,140, 60,159,155,155,235,233,224,224,240,196,196,221,142, 50,135,193, 95,239,220,252,206,
-200,161,145,111, 56, 7,140,234,208, 76,253,193,124, 62, 63,117,206,156, 57,139,178,179,179, 5, 61,122,244, 96, 50, 24,118,253,
-159,136, 24, 57,114,228, 17,181, 90,237,222,177, 99, 71,166,217,108, 70,226,209,133, 16,198,191, 5,126,234, 54,180, 18,228,179,
- 30,254,180,210, 35,178,127,151, 35,248,139, 27,131,146, 3, 1, 28, 80,214,190, 86, 66,156,239,100, 87, 57, 15, 27,241, 28,235,
- 70,166,206,217,100,177, 56, 2,204,254,228, 43, 47, 94,179, 52, 89,166, 62, 86, 66, 84,191,164,177,157,195,159,159,197, 60,147,
-198,114, 54, 89, 44, 78, 96,160, 95,115, 52,107, 95,254, 76, 38,243,157, 53,107,214, 48, 0,204, 4,192,253, 47, 25,154, 48, 55,
-184, 15,104,199,188, 26,234,138, 94, 79, 81, 54,168,250,126,247,109,169,208,142,175, 78, 96,242,212,104,180,247,239,222, 34, 29,
-131,213,122,247,219,148,148, 83, 47,181,107, 23, 53, 55, 36,100, 82, 61,102,139, 2, 48,119,229,202,149, 47, 39, 38, 38, 58,183,
-105,211,102,234, 83,250,211,191,126,229,202,149,239, 39, 38, 38,186,121,123,123, 47,182, 83,179,193,114, 73, 46,151, 15,222,177,
- 99,199, 59,195,134, 13,123,163,115,231,206, 29,158,134,230,191,152,207,111,222,188,233,185,102,205,154,121,147, 39, 79, 46, 3,
-128,129, 3, 7,114, 0,244,104,113,121, 71, 8,151, 16, 18, 78, 8, 25, 70, 8, 25, 72, 8, 9,171,126,223,181,122, 25, 70, 8,
-137,168,243,218,181,122,219,154,245,221, 26,208, 24, 86,119,187, 90,219,212,253,252,196,251,122,140,214, 48, 60,106,171, 53,236,
-137, 29, 56,118,236, 24,169,253, 90,151,113,222,248,120, 86, 79,119,237,157, 31,247,146,138,204, 20, 82,156,116,131,220,136, 94,
- 78,102,117,117,214,190,216, 6,159,218,127,188, 8,185,112,225, 2, 73, 76, 76, 36, 21, 21, 21,228,254,253,251,164, 91,183,110,
- 58,161, 80,248, 11, 0,111,123,196, 36, 18,137,250,151, 95,126, 33,145,145,145,165, 98,177,120,117,205,205, 37,149, 74,213, 23,
- 46, 92, 32,145,145,145,165, 18,137,100, 61, 0, 38, 0, 60,251,236,179, 26, 66, 8,113,118,118,206,169, 79,111,228,200,145,197,
-132, 16, 34,147,201,106,170,154,152, 18,137,100,253,140, 25, 51, 42,174, 93,187, 70,228,114,121, 77, 58, 67, 42,149,174,158, 57,
-115,102, 69, 92, 92, 92,237,244, 70,113,116,116,204,180, 88, 44,228,199, 31,127, 36, 74,165, 50,167,214,205,156,105,177, 88,200,
-145, 35, 71, 26,204, 91, 99,129, 2,177, 88,188,234,165,151, 94, 42, 79, 75, 75, 35, 78, 78, 78,234, 90,233,171, 39, 78,156, 88,
-158,145,145, 65, 20, 10,133, 77,121,116,114,114, 82, 95,188,120,145,140, 25, 51,166,172,246, 49,117,114,114, 82, 95,186,116,169,
- 38,125,149, 45, 5,153,155,155,219, 84,165, 82,153,163, 84, 42,115, 28, 28, 28,150,185,186,186,230,229,231,231, 19, 66, 8,105,
-219,182,173,166,118, 36, 75, 25, 52,226,237,109, 7, 46, 93, 57,151, 80,152, 31, 50,232,141, 85,178,144,145, 50, 59,142,129,183,
- 80, 40,252,165, 95,191,126,186,204,204, 76, 82, 89, 89, 73,226,227,227,201,133, 11, 23,200,131, 7, 15, 8, 0, 91,102, 24,144,
-136,197,226,108,189, 94,111,213,235,245,214,252,252,124,139, 70,163,177, 36,173,118, 37,228, 75,246,227,165,228,200,112,146,119,
-110,133, 85, 42, 22,102, 1,144,252,101, 70,107,115,160, 7,217,238,247,237,237,133,158, 73,231, 86, 62, 99, 34,105,103,200,222,
- 73,206,166,179,111,187, 63, 36, 91,253,191, 39,219, 3, 90, 53, 75,115,107,192,222,248,143, 60,239,110, 90,252,166, 41, 61, 61,
-157,188, 59,241, 25,243,233, 89,238,201,100,155,255,129,230,104,214, 98,252,232,209,163, 43, 50, 50, 50, 72, 96, 96, 96, 37,147,
-201,156,252, 95, 50, 89, 17,190,220,236,248,111,222,181, 14, 15, 18, 22, 62, 37,179, 21,164, 84, 42, 11,118,237,218, 69, 36, 18,
-137,166,185,102,107,236,168,254, 68, 87,250, 11, 25, 21, 21,214,232, 61,242,252,243,207,147,240,240,112, 50,107,214,172,166,238,
- 37,202, 31, 24,177, 59, 36,228,136,117,236, 88,203,238,144,144, 35,254,192,136,106,131, 69, 1,152,247,217,103,159,197,153, 76,
-166,184,175,190,250, 42,110,196,136, 17,113, 0,222,109,225,177,216,240,233,167,159, 18,147,201, 68,190,250,234, 43, 50, 98,196,
- 8, 2, 96, 99, 75,202,165,154, 72, 86,104,104,232,219,135, 15, 31,190,114,247,238,221,252,168,168,168, 85, 33, 33, 33,178,230,
-106,254, 29, 17,139,197, 62, 29, 58,116,216, 19, 24, 24,152,209,177, 99, 71, 67, 64, 64, 64,149,175,175,111, 90, 80, 80,208, 46,
- 30,143,231,221, 76,217,238,189,122,245,178,156, 61,123,150,140, 30, 61,154,212, 50, 33,141,210,152, 23, 33,132,132,205,155, 55,
-239, 3, 0,100,222,188,121, 31, 16, 66,134, 85,251,137, 97,181,223,215,125,173, 49, 79, 53,159,235,211,168, 89,234,211,172,239,
- 55,234,252, 14, 26,136,100, 77,249,221,206, 29, 59,118,172,223,177, 99,199,206,214,221,185,231,218,160,231,172,158,238, 58, 93,
-126, 46, 73, 88,254, 22,249, 53,220,131, 92,232,239, 66,238,189, 51,154,228,126,179,158, 76,239, 36,215,142,109,131,112,123,141,
- 86, 92, 92, 28,137,139,139, 35,215,175, 95, 39,169,169,169,164,180,180,148,124,247,221,119, 22, 39, 39, 39, 29,143,199, 91, 9,
- 64, 96,139,152, 84, 42, 85, 19, 66,136, 94,175, 39,203,150, 45,171,170,142, 84,169,100, 50,153,154, 16, 66, 74, 74, 74,200,202,
-149, 43,171,100, 50, 89, 60, 0, 55,133, 66,145,153,146,146, 66, 84, 42, 85,189,102, 70, 46,151,171,239,222,189, 91, 99,156,220,
-229,114,121,194,209,163, 71,141,132, 16,146,149,149, 69, 28, 29, 29,213, 0, 84, 78, 78, 78, 55,142, 29, 59,102, 36,132,144,156,
-156,156,154,116,155,140,150, 78,167, 35,167, 79,159,126, 34, 15, 53,233, 39, 78,156,120,194,128,217,128, 74, 38,147,197,125,247,
-221,119, 6,139,197, 66, 18, 18, 18,106, 76,162,202,193,193,225,250,129, 3, 7, 12, 22,139,133, 36, 37, 37,217,108, 6, 91,183,
-110,173, 33,132, 16,179,217, 76,182,109,219,166,175, 57,166, 53,233, 6,131,129,108,217,178, 69, 47,149, 74,227, 0, 52, 26,125,
- 83, 40, 20, 57, 6,131,129,148,148,148,144,110,221,186, 85, 92,184,112,129,148,149,149, 17, 66, 8,105,221,186,181, 6, 0,252,
-250, 77,254,228,202,253,138,178, 87,223,223,188,223, 59,236,197,229,167,174,102,103,237, 56, 28, 27,167, 8, 26,249,140, 45, 65,
- 77, 30,143,183,210,213,213,181,234,183,223,126,179, 24,141, 70,146,145,145, 65,174, 95,191,254,248, 26,187,117,235,150, 77, 70,
-139,197, 98, 45,188,114,229,138,209, 98,177, 88, 11, 10, 10, 44, 26,141,198,162,209,104,204,117,141, 22,249,146, 77, 10, 78,188,
- 78, 98,162,103, 27, 56, 28,206,194,191, 38,154, 5, 38,217,238, 55,146,108,247,139,219,245,146,162,160,252,250, 62, 66,126,154,
- 77,146, 63,105, 67, 22, 62, 35, 41,183,110,247,139, 35,219,253,199,146,143,251,177,236,210,140, 14, 24, 78,182,251,197,125,250,
-156, 87,225,141,184,107,228,236,217,179,100,203,250,207,200,172, 8,247, 74,235,118,191, 56,178, 53, 96,140, 61,154,181,225,241,
-120,247,207,159, 63, 79,206,157, 59, 71, 22, 47, 94, 76,132, 66, 97,198,211,136,234,145,173,190, 94,228, 11,223,126,100,103,123,
- 87,242,191,126,127,187, 14, 62, 97,110,112, 31,228,203,205, 42,184,113,152,144,162, 7, 36,111,117, 32,121,198,143,221, 82,179,
- 21,164, 84, 42,243,211,210,210, 72, 94, 94, 30, 89,187,118, 45,145, 74,165,205, 50, 91, 99, 71,245, 39,186,146,159, 27, 53, 90,
- 35, 71,142, 36,235,214,173, 35, 38,147,137,116,239,222,221,150, 63, 45,191, 51, 91,126,192, 72, 0, 31,172, 90,181,234,177,201,
-218,188,121,115,220,173, 91,183,226, 60, 61, 61,143,183,224, 88,108, 92,181,106,213, 99,147,181,121,243,102,114,235,214, 45,226,
-229,229,149,217,146,114,105,208,160, 65,159,164,166,166,150,205,159, 63,127,127,223,190,125,151,223,184,113, 35, 43, 38, 38, 38,
- 46, 52, 52,244,153,230,106, 62,133,168, 14,171, 58,178,195, 37,132,176, 9, 33, 53,230,149, 5,128, 93, 19, 80,176,133,151, 94,
-122, 73,216,179,103,207,184, 9, 19, 38,104,119,237,218, 69,210,210,210, 72,124,124, 60, 89,181,106, 21, 89,180,104, 17,249,242,
-203, 47,201,152, 49, 99, 42,187,117,235,118,101,236,216,177,124, 59,178, 25,232,237,237, 93,122,228,200, 17,178,119,239, 94,194,
-225,112, 98,108,221,176, 49, 47,210,144,153,106,200, 96,213, 93,215,136, 17,107,212,176,217,240,123,191, 55, 85,117, 35, 33,181,
-222,255, 47, 42, 42,170,223,239, 30, 62, 4, 75,166,204,249,132,159,186,107, 45,212,223,125, 14,102,137, 26,236,242, 66,232,207,
-199,192,116,254, 40, 94,238,209, 67, 32,160,168,165,246, 94, 48, 92, 46, 23, 92, 46, 23, 28, 14, 7, 90,173, 22, 57, 57, 57,232,
-221,187, 55,227,250,245,235,252,169, 83,167,206, 22, 8, 4, 25, 0, 70, 53,121, 55, 83,143, 34,210, 23, 47, 94,196,235,175,191,
-206,219,179,103, 79, 71,103,103,231,155, 22,139,133, 11, 0, 73, 73, 73, 24, 55,110, 28,111,223,190,125,193,110,110,110,215,141,
- 70,163,144,199,227,129,201,100, 54,168,199,229,114, 97, 50,153,120,237,219,183,143,191,121,243,102, 80, 84, 84, 20, 59, 61, 61,
- 29, 41, 41, 41, 48,153, 76, 92, 95, 95,223, 91,215,175, 95,239, 56,108,216, 48,118,102,102, 38,210,211,211, 31,231,195,150,252,
- 26, 12, 6,240,120, 60,212,174,210,162, 40, 10,122,189, 30, 92, 46,215,102, 45, 22,139, 53,192,223,223,255,214,205,155, 55, 67,
- 71,142, 28,201,185,118,237, 26,178,178,178, 96,177, 88,184, 1, 1, 1,183,110,222,188,217,105,196,136, 17,156,248,248,120,168,
-213,106,216, 90,133, 86,243,189,155, 55,111, 98,194,132, 9,220,147, 39, 79,118,114,117,117,141, 55,155,205, 92, 0,184,117,235,
- 22,198,141, 27,199, 61,117,234, 84,104,171, 86,173,226,155,168, 74,100, 2,128,201,100,194,212,169, 83, 69, 82,169, 20,153,153,
-153,176, 90,173,176, 88, 44, 0,128,194,226,194, 91, 55,111, 37, 36,189, 60,254,185,126, 58,163, 94,127,233,106,236,157,182,173,
-189, 60, 40,138,180,110, 34,171,163, 68, 34, 81,198,234,213,171,223, 78, 75, 75,227,249,251,251, 51,146,147,147, 81, 94, 94, 14,
- 14,135,243,248, 26,179,117,191,185, 92,110,255,192,192, 64, 86, 85, 85, 21,172, 86, 43, 0, 16, 6,163,254, 22, 43,252,146,243,
- 8, 80,153,217, 2,129,160,255, 95,242,244, 46, 11,116,130, 21,131,210,243, 13, 60,158,131,135, 68,236,234, 11,100,156, 67, 27,
-103, 30,152, 12, 38,255, 90,138, 86, 4,144, 65,240, 44,112,178, 79,211, 58, 40, 69, 99,224,153, 28,131,197,110, 30,158, 40, 44,
- 44, 68,171,182,254,168,226, 58,115, 47, 62,168, 20,131,178, 83,243,255,233,211,190,125,123, 23, 31, 31, 31, 20, 20, 20, 32, 52,
- 52, 20,114,185, 92, 14, 96, 80,179, 31, 58, 95,121,241, 80,134, 94, 0, 99, 53, 44,212, 98,152, 88, 43,240, 32, 63,148,108, 15,
-101,255,157, 76,150, 84,204,189,188,239,219,239,220,157, 60, 3,128,152, 87,161,114,224, 97,231, 27,161,142,206, 50,222,145,102,
-154,173, 32,149, 74,117,230,202,149, 43, 10, 62,159,143,235,215,175, 35, 48, 48, 16,107,215,174,117,150,203,229,231,154, 23,217,
- 34, 32, 84,195, 38,171,111,223,190,152, 57,115, 38,246,236,217, 3, 71, 71, 71, 76,152, 48,161, 41,179, 69,146,128, 31, 63,141,
-143,255,106,207,195,135,199, 94,106,215, 46,106,130,175,239,178,105, 47,188, 48,249,205, 55,223,196,103,159,125,134, 35, 71,142,
-160, 87,175, 94,152, 50,101,138, 41, 35, 35, 99,119,115,171,170, 86,175, 94, 61,107,246,236,217,117, 53,141,233,233,233,159,182,
-168, 92, 42, 44,188, 21, 31, 31,159, 52,126,252,248,126, 85, 85, 85,250,171, 87,175,222,241,246,246,246, 0,208,186,185,154, 45,
- 48, 88, 20, 33,132, 15, 64, 88,189,136, 0, 8,247,237,219, 39, 27, 57,114,164,180, 58, 77, 80,189, 52, 89,189, 31, 24, 24,232,
-113,255,254,253,236,119,222,121, 39,116,207,158, 61, 2,161, 80,136,146,146, 18,124,241,197, 23,248,224,131, 15, 64, 81, 20, 8,
- 33,248,242,203, 47,133,147, 38, 77, 10,123,248,240, 97,182,151,151,151, 45, 77, 90,120, 98,177,248,192,178,101,203,164, 86,171,
- 21,115,231,206, 45, 48, 26,141, 51,171,215,205,119,112,112,184,140, 71,134,187, 49,234,245, 34,181,158,149,199,234, 28,155,168,
-186,105,117,215, 17, 66,162, 26,211,176,243, 92,212,247,123, 49,141,153,173,218, 79,160,254,245,186, 72, 32,196,197,219, 15,165,
- 63, 29,128,128, 69, 65,192,172, 94, 88, 20, 24,201,183,208,138,207,134,137,144,160,230, 26,173,154,133,205,102, 67,171,213,194,
- 98,177,224,131, 15, 62,224,157, 62,125,218,137,193, 96,124,223,148, 78,109,195,116,239,222, 61, 4, 4, 4, 80, 63,254,248,163,
-106,230,204,153,130,154,223, 41, 45, 45,133,143,143, 15,117,226,196, 9,229, 71, 31,125, 36,110,204,204, 80, 20, 5, 14,135,131,
-217,179,103, 11,174, 94,189,234,232,230,230,134,228,228,100, 20, 21, 21, 65, 44, 22, 99,246,236,217,130, 43, 87,174, 56,187,185,
-185, 33, 45, 45, 13,165,165,165, 16,139,197,118, 27, 45, 14,135,243,196, 54, 20, 69,193,104, 52,218,101, 12,100, 50,217,222,184,
-184, 56,103,153, 76,134,248,248,120,152,205,102,200,100, 50,204,154, 53, 75, 16, 23, 23,231,236,224,224,128,164,164, 36, 16, 66,
- 32,149, 74,237,202, 35, 0, 88,173, 86, 36, 37, 37,161,117,235,214, 56,119,238,156,114,218,180,105,252,154,244, 7, 15, 30,192,
-195,195, 3,231,206,157, 83,138, 68,162,189, 13,105, 89,173, 86,228,230,230, 34, 49, 49, 17,201,201,201,200,207,207, 71, 65, 65,
- 1,202,203,203, 97, 54,155, 1, 0,194,242,178,152,125,251,127,188, 41, 16, 8,132,129,190,237, 61,111, 37,220,214, 8, 4, 2,
-161,151,167,167, 47,240, 49,163, 17, 67,248,125,122,122,186,211,164, 73,147, 56,121,121,121, 40, 46, 46, 6,139,197,250,221,181,
-197,229,218,214, 20,200,108, 54, 7,240,249,124,202,104, 52, 62,142,128,113,185, 92,188,189, 87,139,192,133,120, 98,121, 97,189,
- 6,196, 98,130,193, 96, 8,248,211,163, 89, 0, 5,202,208, 30, 20, 21,122, 57,185,210,177, 79,212,120, 14, 82, 78, 2, 86, 19,
-192, 96,161,127,136, 7,235,200,173, 74, 21, 8, 66,160,135, 63, 33, 77,247,252, 34, 0, 5, 24,125, 0,170,203,233,251,102,167,
- 94,163,223,224,100,103,103,131,195,225,128,199,227, 33,116,192,179,172,125, 55, 77, 46,160,208, 17, 70,248,217,162,249, 68,216,
- 81, 32, 88,176,104,209, 34, 81,109,205,201,147, 39,139,100, 50,217,162,102,155,172, 74, 97, 15,152,201,236,196,108,109,235,101,
- 49,121, 1, 15, 53, 58, 63, 16,242, 14, 96,234,244, 20,204, 86,127, 30,143,151, 2,160,119,139, 76,150,132,123,233,219,111,191,
-115,119,108,245,200,100,193, 92, 5,176, 5,112,113,118,192,206,183,195, 29,157, 29, 4,246,154,173, 32,149, 74,245,203,229,203,
-151, 21,124, 62, 31,113,113,113,224,112, 56,224,243,249,232,208,161, 3,182,111,223,238,236,232,232,104,183,217, 34, 32,245,198,
-124, 71,141, 26, 69,250,246,237,139, 25, 51,102, 96,247,238,221, 48, 24, 12, 88,182,108, 25,210,211,211,109,146, 77, 2,126, 92,
- 25, 31,191,107, 69, 98,226,189,121, 65, 65,254,163, 68, 34,199, 25, 19, 38,200, 62,250,232,163, 99, 71,143, 30,253,106,216,176,
- 97, 5, 87,175, 94, 93, 7,224,128,157,135,151, 2,176,121,205,154, 53, 51,106,140,219, 71, 31,125,244,229,209,163, 71, 87, 12,
- 27, 54, 44,247,234,213,171,239, 0,216,220,146,114,201,106,181,198,124,255,253,247, 55, 5, 2,129,208,207,207,207, 51, 33, 33,
- 65, 35, 16, 8,132,158,158,158,190,253,250,245, 99, 52, 71,179, 57, 40,149,202,129,151, 47, 95, 14,196,163, 78, 99,188, 26,163,
-149,144,144,224, 80, 86, 86,230, 32, 22,139, 29, 92, 93, 93, 37, 53,102,107,244,232,209, 14, 44, 22,171,209,235,182,162,162,226,
-232,252,249,243,101,163, 71,143,174,249,140,243,231,207, 99,247,238,221, 16,137, 68, 79,124,119,196,136, 17,120,253,245,215,229,
- 6,131,225,123, 27,178, 59,113,234,212,169,126, 42,149, 10, 11, 22, 44,208,103,103,103, 15, 4,144, 14, 64, 22, 17, 17,241, 73,
- 66, 66, 66,183,176,176,176,253, 0, 58, 55,118,239,213,231, 69,106, 27, 29, 91,210,154,251,125, 91,205, 86,157,164, 6,199,208,
-122,194,104, 69, 69, 69,157, 69, 3, 61,169,140, 69,106,240, 96,129,128, 73, 65,200,172,101,182, 96, 5,171, 84, 3,170, 25,189,
- 84,234,123, 24,114,185, 92, 48,153, 76, 24, 12, 6,216, 58, 81,117,141, 41,144, 74,165, 16,139,197,208,233,116, 48,155,205,224,
-243,249, 53,102, 4, 82,169, 20,108, 54, 27,108, 54, 27,124, 62,255,119,209,164,186,209, 28, 14,135, 3,145, 72,132,220,220, 92,
-164,167,167,195,106,181, 66, 44, 22, 67, 36, 18,129,203,229, 34, 39, 39, 7, 57, 57, 57, 32,132, 64, 36, 18, 65, 36, 18,193,158,
- 6,215, 22,139,165,222,135,191,201,100,178, 43,162,101, 54,155,113,231,206, 29,100,100,100,128,207,231, 63,222, 87, 30,143,135,
- 7, 15, 30, 32, 47, 47, 15, 66,161, 16, 82,169, 20, 50,153,204,102,221,154,125,145, 72, 36, 16, 8, 4, 40, 46, 46,134, 86,171,
-125,124, 76,165, 82, 41, 68, 34, 17, 74, 75, 75,161,209,104, 26,221,119,139,197,130,156,156, 28,228,231,231, 35, 51, 51, 19, 5,
- 5, 5,143, 11,160,234,168, 81,203, 2, 59,101,101, 40, 44, 44,124, 28,137,108,104,177, 5,171,213,138,242,242,114, 92,190,124,
-153,178, 90,173, 40, 41, 41,177,230,231,229, 89,166,231,112,113,228,227,173,228,187,147, 55,170,246, 29,143,211, 29,250, 37, 81,
-183,249,208, 45, 29,191,219, 98, 51,254, 10,182, 4,201, 96, 98, 71, 22, 84,152,120,249, 70,142, 76, 21, 20, 1,164,156, 0, 24,
- 44,128, 47, 71,247,224, 54, 72, 47,182,136,238,170, 13,124, 80, 24,140,205,190,114,155, 52, 45,236, 65,249,229, 38, 94,154,209,
- 89, 26, 16,210, 25,106,181, 26, 60, 30, 15, 60, 30, 15, 93,122, 69, 32,165,208, 34,188,157,173, 19,130, 32,210, 38,205,255,167,
-173, 88, 44,238,209,187,119,111,170,182,230,208,161, 67, 65, 81, 84, 7, 0,254,118, 21,114, 27,219,114, 97, 20,118, 7,139,204,
-190,157,171,117, 59,146, 80,229, 59,124,212,179,142, 27,126,214, 4,220,201,211,123,131,152,230,128, 24, 59,183,192,108,245,147,
- 72, 36,199, 54,109,218,228,205,231,243, 79, 0,232,211, 28, 17,177,128,185,109,193,140,241,238,242, 26,147,101,210, 2, 44, 1,
-192, 22, 0, 44, 1, 92,148, 10, 44,125,125,144,163,144,207, 62,100,135, 97,221,183,121,243,102,231,186, 38,171,102, 9, 13, 13,
-197,194,133, 11,157, 29, 29, 29,247,218,162,183,122,213,103,164,164,180, 20, 32, 64, 89, 89, 5, 86,175,250,172,184,102,221,232,
-209,163, 73,159, 62,125, 48, 99,198, 12,172, 88,177, 2,199,143, 31, 71,247,238,221, 49,101,202, 20,132,133,133, 53, 37, 29, 41,
-147,201,246, 68, 68, 68, 92,206,145, 72, 94,207,237,220,153,251,139, 76, 86, 58,176,180, 84,230,149,144, 96,244, 3,110, 1,216,
-146,149,149,245,140, 29, 38,235, 5,169, 84, 26, 55,112,224, 64,163, 68, 34,201, 88,187,118,237,244,153, 51,103,226,179,207, 62,
-195,252,249,243,191, 0,240, 26,128, 15,179,178,178,220, 26, 51, 89,127, 84,185,244, 71,149,117, 22,139, 37,243,192,129, 3, 97,
- 70,163,209,163,186,122,144, 87, 82, 82, 34, 45, 42, 42,146, 24,141, 70,145,213,106, 21, 57, 56, 56,136, 1, 8, 95,126,249,101,
-214,237,219,183, 3,204,102,115,118, 99,154,121,121,121, 47,206,157, 59,183,160,160,160, 0, 0,208,161, 67, 7,148,148,148,224,
-221,119,223,197, 91,111, 61,234, 16,220,169, 83, 39, 16, 66,160, 86,171,177,122,245,106,117, 94, 94,222, 43, 54,100,183, 93,251,
-246,237,145,144,144,128, 59,119,238,252, 12,192,138, 71,237, 88, 75,111,220,184,113, 51, 63, 63, 31,123,247,238,229,184,187,187,
- 31, 69, 3, 67,188, 52,230, 69,154, 3, 69, 81, 49,205,217,174, 38,114, 85, 95, 68,172, 1, 26,143,104, 69, 69, 69, 81,181, 95,
-159,136, 24, 81,136,207,136, 61, 7,199,160,206, 79, 68,179,132, 76, 10, 2,169, 12, 41,153,233,224,128, 74,124, 90, 70,171,184,
-184, 24,211,167, 79,215,189,248,226,139,133, 86,171,245, 89, 91, 77,129, 76, 38,131, 76, 38,195,237,219,183,201,152, 49, 99,212,
-107,215,174,213,213, 54, 90,247,238,221, 35,145,145,145,154, 69,139, 22, 85, 52,102,180,106, 34, 90, 43, 87,174,212,245,239,223,
- 63, 63, 49, 49,145,212,152, 41,177, 88,140,213,171, 87,235,194,195,195,213,215,174, 93, 35, 53,105,246, 68,180, 24, 12,198, 99,
-163, 85,123, 27, 6,131, 1,171,213,106,151,209,170,172,172,124,113,216,176, 97,234,164,164, 36, 82,179,159, 50,153, 12,107,215,
-174,213, 13, 26, 52, 72,157,152,152, 72,106,210,164, 82,169,205,102,176,230,247, 37, 18, 9,164, 82, 41,110,223,190, 77, 34, 35,
- 35,213, 27, 55,110,172,170,157,126,231,206, 29, 50, 98,196, 8,117,121,121,249,139,141,153,151,154,234, 60,179,217,140,170,170,
- 42, 20, 20, 20, 32, 51, 51,243,113, 56, 93, 39,146, 62, 51,254,249,225, 29,117, 58,157,246,246,189,251, 25, 29,130, 3,149, 58,
-157, 78,155,158,145,113, 15,248,216,218,136,246,179, 65, 65, 65,133,211,167, 79,215, 21, 23, 23,183,216,104,113,185,220, 36, 22,
-139, 69,250,244,233, 67, 12, 6, 3,201,204,204, 52, 21, 20, 23,155,253,151, 47, 39,137,111,191, 77, 9, 98, 99,121, 98,177,152,
-170,214,100, 36, 39, 39, 91, 5, 2, 65,210,159,110,180, 24, 86, 23, 80,164,247,111,247, 43, 28, 6, 13, 31,199,165,242,174, 2,
-198, 10,128, 39, 7,120,114,176, 68, 78, 24,210,167, 19,115,215,229, 50, 23, 16,107, 79,112,120, 30, 77,106,178,137, 10,176,246,
-249,233, 94,149,188,247,216, 89,220,162,162, 34, 48,153,204,199,166, 72, 40, 18, 97,224,168,151, 25, 95, 94,213,187, 0,164, 23,
- 40,166,135, 29,247,250,251, 11, 22, 44,224, 20, 23, 23,131,193, 96,252,191,166, 80,136,105,211,166,241,164, 82,233,124,155, 11,
-191, 3, 1, 28,176,121,221, 1,242,214,221,188, 42,183,163,183,116,126,115, 86,238, 20, 4,117, 10,195,212,254, 74,193,202, 24,
- 77,208,205, 76, 93, 27,192,242, 54,204,134, 46,205, 48, 91,125, 36, 18, 73, 76,108,108,172,112,232,208,161, 88,189,122,181, 72,
- 32, 16,156,104, 78,193, 95, 89, 97,153,185,100,227,215,234,248,117,131, 1, 99,229, 35,131, 85,107,209, 84, 88,177,112,231,153,
- 82,147,137,140,183, 85, 83,167,211, 77,124,237,181,215, 10, 15, 29, 58,244, 59,147,197,231,243,145,154,154,138,101,203,150, 21,
- 21, 21, 21, 53,249, 80, 92,187,102,117, 92,194,205, 95,241,229, 23, 75, 0, 16,108, 90,251, 6, 46,253,246,173, 67,255,126,125,
- 73,235,214,173, 73, 88, 88, 24,166, 79,159,142,165, 75,151,226,238,221,187, 80, 40, 20,120,227,141, 55,208,175, 95, 63,172, 89,
-179,166,177, 66, 42,114,230,204,153,203,178,178,178,252,126,250,233, 39, 86,126,126,190,114,205,142, 29,165, 7, 75, 75,139, 86,
- 36, 36,220,253, 48, 56,184,253,188,144,144, 87, 26, 25,250,161, 94,147, 53, 99,198,140,125, 89, 89, 89,161, 63,255,252, 51, 59,
- 63, 63,223, 99,198,140, 25, 88,181,106, 21,230,207,159,191, 29,192, 84,216,214,225,197,230,114,137,201,100, 62,243,236,179,207,
-118,212,233,116,218,187,119,239,102, 4, 7, 7, 43,117, 58,157, 54, 35, 35,227,222,217,179,103,173,205,209,108, 14,133,133,133,
- 15,247,238,221,123,111,214,106, 89,229, 44, 0, 0, 32, 0, 73, 68, 65, 84,172, 89,161, 89, 89, 89, 1, 0,156,202,203,203, 69,
-229,229,229, 60,131,193, 32,144,203,229,242, 78,157, 58, 41,166, 76,153, 34,190,113,227, 70, 64, 86, 86, 86, 69,117, 20,169, 65,
-140, 70,227,221,226,226,226,168,193,131, 7,151, 20, 23, 23, 35, 36, 36, 4,195,135, 15,135,139,139, 11,220,220,220, 48,114,228,
- 72,248,250,250,162,176,176, 16,227,199,143, 47,202,207,207, 31, 12, 32,217,134,236, 62,204,203,203, 67,207,158, 61,177,100,201,
-146,168,231,158,123, 46,177, 79,159, 62,101,193,193,193, 90, 15, 15, 15,255, 13, 27, 54,192,221,221, 29, 7, 14, 28,112,229,241,
-120,123,235, 49, 89, 13,122, 17, 0,249,213,134,199, 80,231, 53,191,137,117,182,110, 91,239,123, 27,190, 87,215,108,213, 94,126,
- 87,117, 88,255, 9, 1, 22,238, 62,176,171,138,235,233, 3,153, 95, 71, 8,249,124, 8,184, 92, 8,228, 78,208, 91,173,216,145,
-154,167,173, 36,100,190,189, 23, 79,221, 7, 33, 69, 81,248,252,243,207,205, 61,122,244,168, 58,115,230,204, 38,157, 78,231,137,
- 71,163,202,218,108, 10, 54,110,220,168,157, 61,123,246, 77,141, 70,211,145,207,231, 27,106,210, 55,109,218,164,125,249,229,151,
- 19,178,178,178, 66,133, 66,161,182,161,246, 89,181,141, 22,143,199,211,107, 52,154,176,201,147, 39, 39,109,217,178,165, 82, 40,
- 20, 66, 36, 18,129,199,227, 25, 52, 26, 77,199,233,211,167,223, 92,181,106,149, 86, 32, 16, 64, 36, 18,217, 85, 45, 71, 8,249,
-157,161,170,157,110, 43,102,179,249,140, 70,163,233, 56,123,246,236, 27, 27, 54,108,168,172, 49, 64,181,243,184,102,205, 26,173,
- 88, 44,182, 43,162, 85,243, 61,145, 72,132,245,235,215,107,103,205,154,117, 83,163,209,116,228,241,120,134, 90,233,149, 51,103,
-206,188,161,209,104, 58,154,205,230, 51,141,252, 27,179,148,149,149,129,197, 98, 33, 33, 33, 65,207,225,112,192, 96, 48,240,224,
-193,131,199,133,143,163,163, 99, 96,199, 14,193,254, 95,239, 59,112, 86,192,225,241,122,132,117, 9, 72, 78, 75,207, 34,132, 74,
-107, 34,171,135,117, 58,157,231,153, 51,103, 54,245,232,209,163,234,243,207, 63, 55, 55, 20,217,178, 5,189, 94,127,246,250,245,
-235, 38, 62,159, 79,229,230,230,154,153, 76, 38, 44, 22, 11,209,135,133,233, 59,108,216, 64,110,207,155, 71, 73, 69, 34, 22,135,
-195,129, 80, 40,164, 78,158, 60,105,208,106,181,103,255,124,163, 5, 33, 40, 8,238,107,244, 18, 62,195, 76,225,222,225, 71, 38,
-139,239, 0,240,229, 0, 95, 14,119,119, 15, 92, 77,213, 74,192, 0, 23, 22, 27,198, 16, 35, 68, 4, 10,194, 4, 53, 36,108,174,
-128,202,203,203,123,108,136,106, 22,111,159, 0, 92, 79,175, 16,131, 34, 60, 48, 97,207, 16, 36, 81, 78, 78, 78,172,220,220,220,
-223,105, 6, 6, 6, 50, 77, 38,147,237, 67,187,228, 88, 92, 1,235,140,123,121, 85,174, 63,220,172,244,123,123,197,151, 2,129,
-165, 4,136,221,136,160,182,110,120,123,108, 39,238, 71, 71,243,131,174,165,105,219,130, 73,166,194, 90,225,108, 71, 62,123, 75,
- 36,146, 19,215,174, 93, 19, 74, 36, 18, 36, 39, 39, 35, 44, 44, 12,209,209,209, 66,161, 80,120, 28,128, 93,237,241,174,168,145,
- 94, 81,110,233,241,254,129,140,188,248, 92,243, 19, 38, 43,191,146,224,181, 79,143,150, 20,151, 85, 61,123, 57,179,225,251,167,
- 30,110,148,148,148, 68,206,159, 63,191, 48, 63, 63,255, 9,147,149,158,158, 94,243, 80,236, 15,160,201, 63,191,255,251,245, 84,
-232,242,165,179,113, 45, 54, 17, 67,162,222,194,245,248,135,248,112,238, 40, 56, 72, 5, 56,115,230, 12, 70,143, 30,141, 37, 75,
-150,224,193,131, 7,248,238,187,239,168,232,232,104,234,242,229,203,212,167,159,126, 74, 53,209,164, 97,194,138, 21, 43,112,237,
-218, 53, 12, 29, 58, 20,231,206,157, 67, 81, 81, 17,190, 61,113,226,254,222,251,247, 63,172,105,179,213,192,208, 15,245, 34,149,
- 74,231,172, 88,177, 2,177,177,177,143, 53, 11, 11, 11,177, 98,197,138, 44, 0,111,216, 99,178,236, 41,151, 66, 66, 66,252,247,
-237,219,119,150,207,231,243,194,194,194, 2, 82, 83, 83,179, 0,164, 53, 67,179,172, 37, 53, 85, 5, 5, 5, 23,163,163,163, 47,
- 15, 24, 48, 64, 56,113,226, 68,231, 35, 71,142, 56,105,181, 90, 55, 30,143,167, 52, 24, 12,220, 59,119,238, 48, 15, 30, 60,232,
-114,251,246,237,212,170,170,170,171,182, 28, 15,141, 70,115,245,238,221,187,131, 67, 66, 66,238,108,218,180, 41,203,213,213,213,
- 58,101,202, 20,188,246,218,107,112,118,118,182,172, 95,191, 62,163, 79,159, 62, 9, 15, 31, 62,140,208,106,181,183,108,204,235,
- 87,203,151, 47,191,176,111,223, 62, 12, 31, 62, 28,159,126,250, 41,190,253,246, 91,252,250,235,175,130,223,126,251,141, 27, 29,
- 29, 13, 14,135,131,238,221,187, 35, 50, 50,114, 96,117,117,167,173,207,165,107, 20, 69,197, 80, 20,245,115,157,215,107,141,173,
-179, 99,219,134,222, 55,250,189, 58,217,140,174,179,216,206,132,182,248,120, 90,176, 68,123,241,165,238, 36,111, 74,111,162, 30,
- 23, 64,206,247,115, 36,147,219, 81,149, 19,155, 57,188,131, 78,167,123,188, 28, 58,116,136,184,184,184, 84, 74, 36, 18,187,135,
-119,112,113,113, 81,151,149,149,145,174, 93,187, 22, 57, 59, 59, 63, 30,138,192,213,213, 85, 93, 89, 89, 73,186,119,239, 94,164,
- 84, 42, 31, 15,239,224,225,225,145, 73, 8, 33, 94, 94, 94, 57, 13,233,153,205,102,226,226,226, 82,211, 67,143,237,232,232,184,
-181, 91,183,110, 69,106,181,154,184,186,186, 62, 30, 58,193,217,217,121,117, 88, 88, 88,221,244,166,242,155,153,149,149, 69,178,
-178,178, 72,171, 86,173,114,106,167,167,167,167,147,244,244,116,226,225,225, 97,247,240, 14,206,206,206,171,234,201, 75,179,242,
-232,233,233,169,214,233,116,164,103,207,158, 79, 28, 83, 79, 79, 79,117, 85, 85, 85, 77,186, 77,195, 59, 8, 4,130,169,124, 62,
- 63,135,207,231,231,240,120,188,101,173, 91,183,214,236,223,191,159,172, 95,191,190,166, 75, 58,156, 3, 71,244,240,233,249,202,
-135,206,129, 35,231,180,100,120, 7,137, 68,242,139,139,139, 75,229,161, 67,135,158,184,190,116, 58,157,205,195, 59, 8, 4,130,
-172,138,138, 10,171, 90,173, 54, 93,184,112, 65, 27, 27, 27,171, 77, 72, 72,208,166,166,166,234, 10, 53, 26,163, 90,173,214,149,
-150,150,234,111,222,188,169, 23, 10,255,154,225, 29, 72,180,175, 15,217,234,127,244,225, 18,239,219,179,251, 10,171,110, 45,237,
- 72,200,247,163, 9, 57,254, 26, 33,103,222, 39, 87,183, 79, 33, 61,189,121,150, 11,239,182,186, 71,182,249,253, 96,203,144, 12,
- 36,186,131, 15,217,234,127,252,254, 98,239,219, 19,251,184, 85,237,216,178,158, 92,185,114,133, 36, 36, 36,144,228,228,100,114,
-252,240,126,210,179,173,240,145,230, 86,255,163,118, 14,243,208,139,199,227, 85,172, 93,187,150, 92,190,124,249,177,230,209,163,
- 71,137, 80, 40,212, 2,182,245, 90, 38, 0, 69,182, 6,142, 50,111,241,251,237,163, 65,226,242,194, 99,239, 19,114,107, 23, 33,
-209, 65,132,124,213,141,144,253,195, 8,249,241, 21,114,121,253, 88,210,203,155, 99, 34,219,252,206,145,237,129, 54, 55,182,103,
-179,217,101,135, 14, 29, 34, 57, 57, 57,228,220,185,115, 36, 54, 54,150, 36, 37, 37,145,140,140, 12, 18, 19, 19, 67,216,108,118,
- 21,154, 49,109, 89, 55, 21,188, 34,218,115,114,111,174,236, 69,200,145,241, 36,127,239, 4, 18, 21, 44, 41,234,222,170, 69,227,
-209,117,114,114,114, 42,136,137,137, 33,169,169,169,228,236,217,179, 68,169, 84, 22, 0,176,185,189,108,212,144, 62,132, 24,110,
-146,240,190,193, 36, 36, 36,152,244,235,213,158,100, 63,220, 72,194, 58,183, 38, 91,183,110, 37,106,181,154,180,110,221,154,216,
-155,177,136,136,136, 43,132,144,184,161, 67,135,198, 1, 56, 25, 17, 17, 17,151,146,146, 18, 23, 22, 22,118, 25,141, 15,253,208,
- 32, 3, 7, 14, 52, 18, 66,200,208,161, 67, 9,128,156,136,136, 8,146,146,146, 66,194,194,194, 12,205, 57,120,182,148, 75,161,
-161,161, 61, 6, 12, 24,240, 97,104,104,232, 28, 91,134,119,104, 66,243,105, 13, 66,205,196,163,193, 63, 3, 1,116,169, 94, 2,
-170,211,152, 45,208,124,133,205,102,239,112,116,116,252, 85, 46,151,159, 97, 50,153,209, 0, 94, 66,243,198, 55, 99, 84, 71, 24,
- 79, 59, 59, 59, 63, 8, 9, 9,209, 13, 30, 60,152, 12, 25, 50,132,204,152, 49,131, 88,173, 86,178,127,255,126,178,100,201, 18,
-210,206,201,201,188, 30, 40,216, 6, 76, 2,205,163, 1, 75, 39,181,165,206,190,216, 6,229,227,219,160,226,213,118,148, 45, 3,
-150, 70, 52,100,180,172, 86, 43,185,119,239, 30, 9, 15, 15,175, 20,137, 68,217,176,125,192,210, 39, 52, 21, 10, 69,172, 82,169,
-252,221, 32,154,181,210,159, 24,176, 84,169, 84, 94,116,117,117, 85, 59, 59, 59, 95,175, 79, 83,161, 80,196,186,186,186,170, 21,
- 10,197, 19,131,123, 50,153,204,161, 10,133, 34,187,110, 58,139,197, 26,160, 84, 42, 51,235,166, 55,176,239,112,113,113,201,204,
-201,201, 33,249,249,249,196,211,211, 51,167,174, 1,203,203,203,123,194,128,217,162,217, 84, 94, 26,201, 99,189,154, 54, 28,211,
-230,156,247, 26,124,221,221,221, 53,107,214,172, 33, 98,177,248,137, 46,207,126,125, 95, 93,112,229,126, 69,217,107,115,183,238,
-175,103,192, 82, 91, 7, 7, 29, 44, 18,137,178,195,195,195, 43,239,221,187, 71,172, 86, 43,177, 90,173, 13, 25,173,250, 52,159,
-233,210,165, 75, 97, 65, 65,129,165,188,188,220,156,153,153,169, 79, 73, 73,209, 45, 93,186,212,152,159,159, 95, 85, 81, 81, 97,
-136,143,143,215,187,186,186,230, 3,120,198,222,115,212, 76, 34,234, 86,159,145,237, 1,189,200,182,128,152,164, 69, 94,119, 94,
-233, 38,210,199,173, 25, 74,200,153,247,201,229,173,175,145, 30,222,220, 71,134,104,187,255, 9,242,165,111, 95,178,177, 45,215,
- 38,205, 29,237,250,144,237,254, 39,110, 47,244,186, 51,186,179,179, 97,223,174,237,228,193,131, 7,228,232,193,189,164,123,155,
-106,147,181, 45,224, 52,217, 26, 16,110,139,102,125,102,107,231,206,157,228,193,131, 7,228,135, 31,126,176,213,100, 69,212,103,
-180, 62,136, 16,151,188,214,141,175, 31,223,137,107, 24, 25,196, 49, 70,250,112,204, 61,189, 88,150,142,174, 12,107,128, 51, 72,
-164,159, 64, 79,182,249,157, 35,219, 2, 6,219,154, 79, 46,151,155,129, 90, 99,234,212, 93,120, 60, 94,126, 35, 70, 43,162, 73,
-179,229,203,203,253,101,201, 0, 50, 60, 68, 82,104,163,201,106,234, 90,234,164, 80, 40, 10,190,250,234, 43,162, 82,169,242,109,
- 52, 89,143, 53, 71, 68, 69,146,244,135,199,201, 15,251, 87,144,240,190, 1,100,207,206,217,228,202,185, 69,100,216,144,112, 18,
- 17, 17, 65, 10, 10, 10,200,128, 1, 3,136,189,249,148,201,100,123, 42, 42, 42,226, 78,157, 58, 21, 23, 17, 17, 17,183,103,207,
-158,184,243,231,207,199, 9,133,194, 61, 53,193,137,186,102, 43,224,247,229,127, 68,157,136, 86, 92,121,121, 57, 57,117,234, 20,
-137,136,136, 32,123,246,236, 33,231,207,159, 39, 66,161, 48,174,185,247,145,173,229,210,160, 65,131, 22,164,166,166,150, 45, 92,
-184,112,127, 61, 3,150,218,170,249,224, 41,229,243,169,148, 33,127,129,166, 68, 32, 16,196,221,188,121,147, 20, 23, 23,147, 96,
-149,138, 44,103, 50, 73, 22,135, 67,114, 56, 28,178, 21, 40,250, 23,216,164, 41, 13, 85, 29,254,209,212,107,180,170,170,170,200,
-187,239,190,107,224,243,249, 90, 14,135, 99,239, 20, 60,255,232,139, 80,161, 80, 92, 84,169, 84,106,149, 74,245,132,217,171,157,
-174, 80, 40,174,255,203,111, 64, 95, 14,135,147,206,102,179,159,156,130, 39,112, 68,143,118,189, 38,206, 87, 5,141, 24,210,194,
-124,114, 56, 28,206, 7,124, 62, 95,251,238,187,239, 26, 42, 42, 42,236, 49, 90, 0, 48, 72, 40, 20,102,239,222,189, 91,119,255,
-254,125, 83, 81, 81,145,249,202,149, 43,166,216,216, 88,195,199, 31,127, 92, 46, 20, 10,179,209,240,176, 4,127,202,241, 36, 27,
-219,114,107,204,214,173,249, 94, 73,195,131,133,198,232,119, 34, 73,143,214,117, 76, 86,195, 35,185,215,175, 89,109,182,110,124,
-228,153, 20,238, 43, 54,175,152,255, 54,233,222, 70,240,164,201,178, 67,179,174,217, 18, 10,133,229,139, 22, 45,178, 39,146,245,
-164, 33,220,225,231, 73,182,251,239,121,100,162,154, 88,182,250,125, 65, 62,247,243,252,187,220, 71,221, 84,240, 26,232,203, 75,
-180, 35,146,101, 75, 62, 59,201,229,242, 59,118, 68,178, 30,107,126,254,249, 38, 50, 97,220, 32,242,240,206, 33, 82, 81,120,156,
- 92,191,180,150,140, 25, 17, 74,186,119, 15, 35,219,183,111, 39,119,239,222, 37, 93,187,118, 37,205,200,103,228,180,105,211,226,
- 82, 82, 82,226,146,147,147,227,206,159, 63, 31, 55,106,212,168, 56, 0,145,181,107,130,106,204,150,113,204, 24,125, 39, 6,227,
-237, 38, 52, 95,152, 54,109, 26, 73, 73, 73, 33,201,201,201,228,252,249,243,100,212,168, 81, 4,246, 77,223,211,172,114, 41, 52,
- 52,180, 71,120,120,248,252,206,157, 59, 15,121, 90,154,255, 65,163, 37, 26, 61,122,180,213, 98,177,144, 33, 67,134, 88, 54, 0,
- 37,209, 20,165,142,166, 40,245,118, 32,255,223, 30,209,250,163, 39,252,140, 0,240,115,237, 4, 62,159,175,174,170,170,114, 22,
-139,197,135, 43, 42, 42,102,225, 81,183,200, 22,105,254, 17,249,164, 53,255, 21,154,174, 98,177,120, 83, 69, 69,197, 40, 62,159,
-159, 95, 85, 85,165,178, 67,211,129,199,227,189,205,231,243,195,181, 90,173, 47, 0,136, 68,162,123,122,189,254, 87,157, 78,183,
- 14, 64,201, 95,189,239,100, 99, 91, 46,184,220, 46, 32,152, 23,151, 81,217,102,197,169, 34,175,119, 6,200, 51,122,182, 19,165,
-130,109,253, 20,148,254, 42, 53, 41, 93,111,183,166,128, 10,131,133, 61,239,106,154,182,245,167, 63,149,123,205, 9, 23,103,244,
-108, 43,206, 0,193,167,224,105, 47,217,171, 89,215,108,137, 68,162,221,149,149,149,175, 3,248,213,222,125, 39, 7, 2, 56,168,
- 52,185,195,196, 12, 6,105,100, 10, 31, 66,180, 96, 48, 19,144, 7, 53,245,241, 29, 35,125, 31,213,175,185,101,203,102,242,243,
- 79,199,161,215, 22, 33, 87, 83,134, 9, 47,189,138, 78,157, 66,161, 80, 40,176,124,249,114,248,248,248, 96,201,146, 37, 84, 51,
-242, 25, 41, 22,139, 39,248,251,251,183,189,125,251,118,178, 86,171,253, 6,192,233,186,207, 31,127, 32, 92,200, 98,117,212,153,
-205,231,238, 0,177, 77,104,190, 32, 22,139,231,248,251,251, 7,221,190,125, 59, 81,171,213,174, 1,240, 45, 93,214,253, 51, 52,
- 25, 12,198, 58, 47, 47,175, 49,169,169,169,243, 0,236,195,127,136, 63,221,104,209,154,180,230, 63, 80,179,230, 62, 33,127,183,
-124,254,191,217,178,206, 2,133, 54, 32, 84, 22, 56,214,245, 77,152,172,166, 53, 5, 84, 24,204,172,183, 64,161, 21, 8,242, 64,
- 24,235,154, 48, 89,127,174,201, 4, 40,124,220, 72,249,245, 49, 8,213,240,249,162,175,249,122, 88,176, 96, 1, 57,121,242, 36,
-132, 66, 33,116, 58, 29, 6, 15, 30,140, 79, 62,249,132,162,203, 16, 90,243, 79,212,252, 87,194,162, 15, 1, 13, 77,147,144,191,
-107,198,168, 55,147, 13,228, 64,192, 53, 20, 48,223, 5, 3,109, 0,115, 58, 42,205,121,212,155,233,134, 22,106, 94, 65, 1, 53,
- 27, 76,248,130,107,126,136, 10, 67, 30,245, 70,243, 53,255,128,127,136, 4, 31,255,125,207,203, 63,145,186,166, 42, 54, 54,150,
- 62, 40, 52, 52,182, 51, 5, 79,246, 52,124,252,153, 54, 90, 52, 52,255,112,168,231,238, 24, 1,100, 85, 47,127, 91, 77, 26, 26,
- 26,154,255,160,225, 2,133,134, 27,180,217, 19, 18,108, 78, 67,187,159,105,205,102,105, 50, 1,200, 0, 56,224,209, 24, 36, 53,
- 93,122,155, 26,102, 99, 8, 0, 19,125, 60,105, 77, 90,147,214,164, 53,105,205,191, 88,179, 41,237,127, 98,149,100,125,189, 12,
-163,255,140, 31,142,160, 53,159, 42,131,255, 53,251, 78,208, 17, 4,235,171,151,142,244,121,167, 53,105, 77, 90,147,214,252,207,
-107,254, 43,161,171, 14,255, 89,240,255,177, 57, 39,196, 21, 64,205, 32,151, 9,168,162,252,193,199,108, 0, 64, 57,174, 19,130,
-251, 0,130,171,215,103, 82,148,221,189, 81,105,104,104,104,104,104,254, 42, 66, 1, 92, 7,224, 10, 96, 24,128, 24, 84,143,170,
-240,151, 26, 45,129, 83,123, 87,176, 24, 33,148,149,248, 3, 0, 97, 80, 73, 48, 91,227,117,133,247, 91,252,144, 21,187,249, 58,
- 18,112, 15, 80, 48, 60, 87,145,115,175,197,131,161, 5,251, 74,199,168, 20,146, 9,121,133,165,187, 19,239, 86, 28,177,103, 91,
-153,204, 75,198,119,148,143,213, 27, 77,193, 92, 14, 39,195, 88, 82, 22, 93, 92,156, 92,222,140,108, 56, 54,182,242,227,143, 9,
-117, 44,247, 58,197, 17, 26, 25, 78, 82, 14, 85,129, 10, 82,145, 43,182,122,151,164,146,131, 7,159, 35,246,158, 27,138,129,254,
- 34,137,164, 51,143, 47, 12, 19, 74,228,237,173, 4, 40, 82,103,167, 25, 76,230,243, 22,131, 54,142, 88,241, 63, 59,206,213,203,
- 0, 86, 0, 0, 6, 12,248, 25,193,144, 98, 93, 77,198,241,198,128, 91,120,249,204, 25,212, 12, 46,251, 1,128,149,118,100,215,
- 1,128, 23,128,210,224,224, 96,109, 66, 66, 66,254,211,186, 70, 91,114,222, 27,131,199,227, 11, 76, 38,163,209, 98,177,180,120,
- 98,106,158, 80,186,232,119,211, 43, 81, 12, 84, 85, 20, 47,166,203, 62, 26, 26, 26,154, 63,213,104, 13,195,163, 42,195,166, 27,
-195,123, 5,246,190,198,231, 11,188, 1,192, 74, 8,172, 4,168, 44, 43,137,203, 75,142, 29, 12, 0,138,214,161,167,216,124,105,
-103, 43,121,180,222, 98, 5,204,198,170,212,178,244, 43, 93,109,201,145,200,217,119,244,128,136,129, 99,162,162,134,249,117, 8,
-238,208, 14, 0,110, 37,220,122,120,236, 88,204,221, 51, 63, 83,135, 42,243,239,253,208,162, 0, 10,248,159,116,233,210,169,119,
-108,236,245, 37, 0,102,180,244, 8, 58, 57,137,103,157,254,254,221,190, 3,199,172, 22, 1,246, 61,112,249,142,242,177, 35,135,
- 63,211,233,189, 55,167, 49, 94,123,119,185,247,181, 11,255,251, 76,236, 26, 84, 66,172,166,211,149,234,113,191, 53, 54,113,114,
- 93,255,216,144,193,250,166,232, 36, 99,253, 87, 61,228,186,162,135,227,136,213, 50,142,162, 40, 48,185,194,131,206,109,123,239,
-119,232,255, 78, 49, 0,155,123,140, 73, 93, 3, 35,148,174, 30,135,198,189,250, 54, 95, 40, 83,177,192,228, 0,160,144,147,118,
- 7,103,190, 93, 33,127,107,241,206,208, 11,241,233,230, 95,190,223, 92, 69,113,216, 99,180,185,183,155,174, 79, 79, 79,119,128,
-151,215,163,247, 95,124,177, 0,222,109,110,225, 81, 91, 51, 96, 45, 74,191,206, 65, 48,240,200,104,165,165, 65,110,107, 94, 7,
- 15,125,126, 80, 70,250,253, 37, 57,217, 25, 71, 24, 44,150,181,184,180,242, 29, 39, 39,101, 69, 97,161, 38, 28,213, 13,185, 21,
- 10,133,168,160,160,192, 8,192,248,103,158,247,177,147, 62,249,226,224, 87, 11, 94,175,111,221,244,183, 62, 89,231,229,225, 32,
-122,115,198,228,122, 39,228,238,247,204,228,247,206,158,220,185,170, 73, 67, 44,146, 44,122,246,245,249, 31,247, 31, 16,249, 68,
-250,149, 75,231,177,247,243, 5,168, 44,167,205, 22, 13, 13, 13,205,159, 64, 76,181,185,138,169,187,162, 65,163,197,231, 11,188,
- 47,255,239,152,227, 15,231, 51, 1, 0, 17,161, 46,248,112,233,166,200, 61, 27, 99,239, 2, 64,143, 1, 81,190, 75, 62,120, 19,
- 23, 19, 53, 32,132,160,147,143, 19,134,140,124,206, 54,227,161, 10,232, 58,118,236,179, 47,190,251,238,156, 17, 15, 30, 60, 72,
-219,183,111,223,111, 0,208,167,111, 95,159,229,203,151, 63,191, 90,238,200,251,238,224,247,217, 85,234, 59,215,154,179,183,124,
-183,182,238,126,237,219, 76,248,238,203, 77,140,254,131,159, 29,159,134,202, 21, 85, 57,201,217,182,108,171, 80, 40,102,179,217,
-108, 25,240,104, 54,246, 26,140, 70,226, 2, 0,102,139, 85, 34,119,243, 43,103,114,248, 22, 30,143,115,187,188,162, 98,119, 89,
-246,157, 29,141,105,234, 77,166,160,183,222,152,196,184,145, 92, 8,239,160, 62,204,245, 43, 62,130,213, 98,146,191,253,193,210,
-177,177, 87,190, 67,165, 26,103,109,220, 53,118,221, 4,119,247,238,204, 79, 86,136, 7, 81, 20, 94,241,234,241,234,168, 37,187,
- 14,178,187,248, 72,161, 55, 89,113, 34,174,176,199,214,117,159,172,186,176,117,216,143, 0,182, 3,248, 5, 64,147,166,206,209,
-201,241,155,217,243,215,137, 43, 13,255, 31, 37,169, 54, 89,248, 98,247, 1,220,204,180,194,223,207,159,229, 50,251, 51,241,246,
-165, 83,118,105, 31,205,179, 85,159,221,109, 11,160, 23,144,228,136,169,139, 7,226,235,149,203,160, 84, 86, 66, 34,201, 0, 5,
- 21,128,246,213, 95,188,207, 45, 64, 38,128, 15, 52, 26,136,150, 76,195,224, 27,192,220,142,128, 6,192, 5,170,177, 89,227,137,
-121,197, 91,243, 86, 5, 59,183, 9, 14, 75,184,155,141,203, 49,155,145,159,151,238, 80, 92, 92,176,187,149, 79, 71, 34,146, 57,
-135,150,228,165, 64,234,128, 20,138, 88, 70,150,150, 22,231, 1,176, 41,138,228,226,226,178,200,221,179, 91,223,154,243,238,232,
-213,169,184,102, 29,131,201,250,166, 32,229,218,155,141,109,239,229, 63,124,242,138,205,125,194,147,110,158, 58,144,145, 28,119,
-222,108, 50,234,219,251,133,116,153,244,202,248,231,147,178, 21, 29,243, 75,244,184,121, 43,177,211,202,149,159,174, 76, 76,184,
-117, 75, 34,113,144,183,241,237,216,205, 63,100,232,248, 34,131, 99, 91, 91,140,150,217,108,129,147, 75, 91,176,249, 18,120,168,
-100, 40, 41,215,163, 82,111,134,194,165, 13,204,102, 51, 93,244,209,208,208,208,252, 57,228,226,201,198,239,209, 77, 26, 45, 0,
- 16, 11, 88,184,155,146, 7, 0,112, 16, 0,179,166, 78, 68, 97, 65,190,175,193,108,197,171, 19, 95,194,245,164, 92,220, 77,205,
- 7, 33, 4,190, 30, 54, 79,194, 13, 38,172, 93, 94,157,252,106,191, 83,167, 79, 95, 93, 48,127,193,215, 20,133, 75, 0,176, 61,
-250,139, 30, 11, 23, 45,124,253,165,137, 47, 13, 58,120,240, 96, 34,128,102, 25, 45, 22, 37,217,180,106,229, 50,110, 86, 65, 85,
-213,236,119,231, 89,231,188, 51,123, 61,128,103,109,114, 50,108,182, 44, 43, 43, 75,204, 96, 60, 57,151,230,167,203,230,157, 27,
- 52,102,245,253,180,140,146, 27,167,142, 30,237, 26, 24, 24,136,172,236,188, 94,159,109,216,214,241,196, 41,193,164,242, 50,221,
- 24,109,193,157,122, 39,109,230,177,217,137,139, 63,219,218,201,234,224,195,248,240,245,161, 8,106,231,134,108, 77, 9,250, 14,
- 30,193,138,187,118, 45, 18,176,217,104,213, 29, 60,112,172,193,170,233,184,124,247,149,129,163,122,186,117, 97, 48,152,168,208,
-153,144, 95,170,135,197, 10,244, 9,144,225,153, 61, 27, 88, 69,149,166,209, 75,191,207, 28,125,105, 99,148,186,170, 52,103, 38,
-128, 67, 77,196, 3, 29, 61,148, 82,220,205, 44,175,215,100, 85, 86, 61,122,128,115,152, 22, 80, 32, 78,141, 8,245, 2,240, 21,
-224, 15,252, 52,243, 69,168, 84,251, 84, 42,213, 88,165,202, 37,206,247,197, 73,148,187,119,128,164, 66,103,196,237,196, 91,229,
-129,157, 19, 72,121,145,230,237,170,202,226,131,119,128, 4,127, 96,127,181,198, 36, 52, 98,180,238,223,191, 83, 50,233,133,112,
-214,141,135,229, 72, 22,137, 16,212,115, 20, 74,243,179,216,207, 76, 90,220, 77, 87, 94,202,119, 82,121,225,206,197, 3,200,207,
-120,208,169,202,160,255,193,209,179, 71,248,143, 95,205, 53, 52, 21,221,114,113,113, 89, 52,117,234,212,143,243,115,147, 62, 25,
- 52,102,117, 72, 90, 70,201,141, 23, 23,255,218,117,250,104, 31,156,136, 47,195,178,201,225, 19, 0, 52,106,180,152, 44, 98,225,
-139, 93,188,199,188, 48,115,158,155, 51,127,158, 80,192,128,131,136,139,211, 87, 52,248,238,116, 38, 76,102,130,238, 33,237,125,
-103,189,183,110,151,171, 19, 23,185, 5, 6,100,231, 87, 65, 93, 80,133,138, 66,173,222,166, 11,130,162,160,201, 47, 68,204,143,
- 49,160,216,124, 80, 12, 10, 38,163, 17, 44, 6, 3, 20,131,162,139, 62, 26, 26, 26,154, 63,135, 6,123, 29,178, 0,224,216,177,
- 99, 36, 42, 42,234,119,165,178,197, 66,112, 55,245, 81, 19, 28, 38,147,137, 97,189,125,176,254,179,197,208, 25,204,184,153, 82,
-138, 31, 46,102,194, 80, 89, 2, 66, 8, 10,130,148,245,253,240, 19, 85, 74,171, 87, 8, 66,153, 60,246,184, 11, 87, 68,173, 29,
-229,114,249,253,196,175, 43, 23,190,163, 14, 96, 17, 99,220,210, 79,125, 82, 56,142,172,158, 7, 14,236, 15, 28, 30, 21,197, 21,
-139, 37,239, 19, 86, 71, 15,118, 37,153, 83, 90, 26, 95,218,144,102, 93, 4, 74,255, 17, 35,134, 61, 51,192,197, 69,101,125,113,
-249,149,164, 77, 51, 67, 61,219,251,180,239,117,215,164, 27,161,211,220, 63,218,192,102,143, 53,173, 86, 43, 24, 12, 6,212,106,
- 53, 44, 22, 11,244,122, 61, 76, 38, 19, 50, 51,211,212, 86, 66, 60, 44,176, 50, 92, 93, 61,192, 98,113,225,221,218, 11, 91,215,
-175, 16,238,249,238,104,216,220, 5,159, 28,209, 22,160, 59,254,127,112,203,199,154, 85, 69,197, 7,143,159, 60,237, 76,112,198,
-237,195,215,135, 50, 53,197, 21, 56,115,237, 1,174,223,206,180,247, 68,214, 29,194,161,117,118,250,131,178,213,171, 87, 51,151,
-156,120,144, 57, 96,200,179, 22,175,118, 33,173,245, 22, 2,128, 2,143,195, 2,135,197,128,151, 51, 31,135,231, 5,227,202,200,
-120, 85,100,168,243, 58, 66,200,161,198,142,167, 94,111,178,244,246, 23, 49, 59,182,149, 33,254, 97, 49,174,158,184,132,217,243,
-215, 33, 54, 69,143,242, 10, 45, 40,139, 30, 76,162, 71, 65,122, 50,204, 22, 11,105,234,188, 63, 34,180, 24, 0,120, 60,222, 7,
- 63,252,120,210, 77,111,229, 35,175, 68, 15,117,177, 30, 62,221,199,136,210,179,243,241,213,226,231, 63, 0,112,208, 31, 40,183,
- 65,147, 7, 32, 60, 45,229,158,201, 96,176, 88,171,140, 22, 70,144,167, 12, 59,126,186,134,224,240, 23,170,184, 76,166, 64, 34,
- 83, 0, 4, 8,234,251, 2,174, 30,249, 28, 98, 6,179,179, 64,202,235, 8,224,106, 99,215, 82,141,201, 90,180,104, 17,102, 76,
-125, 30, 86, 66,216, 22, 88, 25, 0,176,229,135, 7,240,242, 86, 54,118,142,254,127,186, 24, 11,131, 50, 26, 9,202, 43, 76,200,
- 47, 49, 64,194,103,225, 94, 70, 37, 30,164, 87,224,249,193,238, 24, 51,208, 21, 22, 43,193, 75,239, 95,199,179,145,174,120, 49,
-202, 3,160, 40, 20, 20, 27,160, 55, 88, 26,220,119, 6,131,209,134,201,100,134, 90, 44,150,235,143, 62, 51, 97, 1, 80, 86, 92,
- 0,189, 94, 15, 38,147, 9,185,163, 51, 0,234,137,239, 90,173,214, 20, 91,239,163,102, 66,107,210,154,180, 38,173,217,108, 26,
-242, 34,255, 16, 26, 28,202,129,209,216, 86, 15, 51,139,112, 55, 37, 15,157,253,221,209,174,181, 43,174,222, 43,198, 55,103, 50,
-177,243, 84, 58,206,220,204,135,149, 37, 65, 94, 25,112, 63, 77,141,251,233, 5, 77,142,159,205,228,177,199,189,245, 86,233,187,
- 29, 2,203,186,255,239,196, 44,184, 59,223, 15,156, 59,183,100, 22,147,199, 30, 39,111, 37,217, 55,239,221,183, 39, 72,132, 66,
-174, 65,111, 64,219, 54, 94,252, 55,103,206,154, 68,201,121, 54,207,137, 36,113, 15,144,243, 4,130, 29, 75, 63,126,159,183,238,
-135,251, 25,149, 6, 84, 30,186,164, 78,158, 51,111, 97, 17,139,205,223, 42,113, 15,176,185,237,143,201,100,130, 94,175,135,193,
- 96,128,209,104, 68,118,230,157, 17,191,252,240,222,224, 54,173, 28, 7,243,248,124, 16, 0,101, 58, 51, 82,114,181, 8, 31, 56,
-136,217, 57, 52, 52, 72,236, 26, 48,185, 62,173,210,210,244, 82, 43, 97, 74,142, 29,222,203,220,255,211, 13,124,125,236, 26,142,
-252,122, 3, 87,207,158, 48, 19,171,233,241,252, 95, 98, 87, 31, 95,177,107,135,116,177, 91,136,250,241,226, 30,220,232,240,204,
- 76, 38,131,132, 15,140,248,121,234,140, 55,255,167, 45, 47,212,236,216,180, 56, 59, 63, 39,237, 14,143, 67,153,133, 60, 38, 42,
-170,204,216,245, 75, 14,198,174,184,137,219, 25, 21, 32,132, 52, 57,129,183, 21,120,103,220,228,247, 44, 38,163, 17,126,158, 98,
-236,141, 94,137, 17,225, 29, 49,160,131, 28, 93,219,137, 32,100,233,145,152,116, 23,223,238,221,101,182, 90, 25,115,154,184, 17,
-159,169, 94,226, 0,160,162,162,226,189,185,239,207,201, 55,152,173, 48,154,172, 48, 86,191,254,242,237,167,249,150, 42,237,123,
-213,219,197,213,218,174,161,155,121,227,107,211,231,134,239,248,230,231,255, 99,239,187,195,163,170,214,238,215, 41,211, 75,122,
- 38, 9, 33, 9, 36, 64, 66,239, 16, 80, 64,122, 64,186, 32, 69, 64, 65,154, 10,138,162,130,162,130,212, 75,175, 42, 40,136,244,
-222, 59,132,170, 32, 29, 18, 32,129,144,222, 39,109,122, 59,237,247,199, 36, 16, 32,101, 2,222,251,221,223,247,101, 61,207, 60,
-147, 57,156,243,178,219,217,123,237,245,190,123,239,238,251, 46,102,145, 57,249, 14, 68,159,216,131,128,160, 48,136, 41, 82, 14,
- 2, 0, 65, 0, 4, 1, 65, 16,224, 27,210, 0, 86,158,199,222, 95,190, 13, 68, 5,241,106, 37, 36,107,252,248,241,120,240,224,
-193,115,245,158,240, 56, 9, 9,143,147,112,230,228, 85, 0,128, 87, 72,243, 66,175,144,230,133, 62,161,173,215,149,101,203,206,
- 49,188,133,229,144, 93,100,133, 66, 70, 34, 56, 80,129,129, 93, 2,176,250,155,166, 24,209, 59, 16,233, 57,102,140,159,115, 7,
-126,126, 34, 28,184,152,133, 85,219, 19, 80, 47, 68,137, 1, 93,106,224,253,190, 53,203, 86,107,105,186,151, 72, 36, 26, 62, 96,
-192,192,217, 82,153,114,193, 39,115,182,206,146, 75,233, 18, 53, 22, 20, 69,129, 97, 24,144, 36,129,161,159,174,158, 37, 85,168,
- 23, 12, 24, 48,112,182, 72, 36, 26, 78,211,116,175,234, 73,103, 53,170, 81,141,106,252,219, 20,173,146, 79,192,115,253,118,121,
- 79, 88,173,150,164,119,134,142, 68,128,198, 95,213,255,173,247,197, 55, 19,138,160,205, 74,193,227,248, 24,152,173, 12,196,158,
-161,128,204, 31,181,106,135,224,110,220, 65,199,170,197, 71,141, 60,107, 75, 42,207, 94,191,126, 1, 53, 31, 63, 36,200,197,139,
-130,175,198,199, 21,182,220, 54,243,119,140, 24,161,242, 89,188, 40,248,106,242, 19, 37,169,144, 9,237, 63, 24, 61,156, 32, 9,
- 1, 95,127, 61, 13,253,251, 68, 97,204, 7,163,136, 63,254,216, 20, 89,228, 98, 46,121,136,214,204,248,118,182, 36,167,136,181,
- 95,139, 55,218, 20, 74,185,252,207, 71, 70, 83,163,218,193,242,222,131,222,207, 60,186,251,183,229, 0, 70,187, 98,171,132, 96,
- 49, 12, 3,135,195, 1, 0,156, 83, 61,112,126,231, 27,236,200, 45,178, 33,167,200, 6,150,227, 49,104,232,104,249,245, 27,119,
- 70, 3, 40, 39, 94,139,231, 25,150,193,190,211,183,144,113,125, 15, 79,144,148,174, 84, 48, 60, 84, 1,117,195,253,253,131, 47,
-246, 25, 52,202, 87, 34,115,186, 97, 13, 38, 27,254,248,101, 81,133,233, 36, 9, 66,224, 57,182,136,101, 24, 83, 88,104, 88, 70,
-253,134,205,100,151,207,159,236,247,231,153,125, 70, 54,108,148, 71, 66,114, 22, 40,145, 20,148, 88, 6,155,195,181,133,135, 57,
-143,175,174, 5, 64,140,253,104,218,138,169, 95,126, 67,125,190,234, 18,236, 86, 51,108, 22, 19,244,186, 66,200,105, 6,177,127,
- 29, 98, 5,142,153,106,202,186,189,182,124, 75, 68, 38,128,204,210, 87, 10, 10, 10,162,255,186,116,241,240,223,127, 93, 26,227,
- 31,214,146,180, 51, 60, 30,199,252,205,103, 60,186,113,216,102,211, 71, 3, 0, 1,228, 3, 56, 89,145,112,169,118,243,112, 31,
-243,241,151, 99, 61,228, 74, 50, 38,189, 8, 41, 89,122,112,242, 64,248,215,172,243,204,191,202, 59,243,219, 38,194, 23, 61,154,
-189,139,203,247, 82,185,147,187,214,118, 7,112, 8,128,185, 34,146,117,243,230, 77,136,197,226,231,234,189, 78,221,218, 40,113,
- 29, 22, 21, 76,246,216,180,248,125, 0, 64,151, 55, 59,142, 7, 48,225,165,137, 74,182, 30,222,118, 22,109, 27,120, 33, 34, 84,
-133,140,124, 59, 4,130,198,238,179,121,120,148,110,194,233,107, 90, 4,120, 73,192,219, 73, 80, 82, 96,223,229, 12, 92,142,205,
-195,200, 94, 65,120,152, 88, 80, 14,177,166, 90,124,254,197,180, 31, 87,174, 92,117,238,157,143, 22, 15,238,208, 34, 12,122,131,
- 17, 25, 5, 12,140, 38, 3, 76, 70, 19,228, 10, 5,164, 18, 9, 40,154, 70,175, 15,230, 13, 62,246,251,183,231, 63,255, 98,218,
-143,203,150, 46,249,158,101,217,227,213,253, 97, 53,170, 81,141,106,252, 91, 21,173,241,165,175,149, 75,180, 82,238, 95,110, 13,
- 0,225,173,122,228,171,100,180, 23, 77, 18,200, 73, 79,192, 31, 75, 62, 5,207, 11,232, 61,110, 49,212,181,253, 33, 23, 83,176,
- 25,243,141, 5, 9, 23, 42,138,213, 1, 65, 48,221,215,174,203,168,253,209,164, 48,183,109,219,140, 34, 0,216,182,205, 40,154,
- 52, 49,200,237,167,117, 73,181,219,190,217, 18, 2,199,161, 79,255,119, 48,116,216, 80, 36,103,155,177,247, 98, 42, 76, 22,187,
- 75,171,229,228, 62,245,155,249,120,251, 70,125,246,126,148,146,166, 8,162, 94,136, 59,149,166,101, 88,138, 18,113,135,175,235,
- 50, 7, 13, 26,230, 19,125,108, 87, 23,206,167,126, 51, 75,222,195, 59,149,217,179,217,108,207,185, 14,189,124, 66,143,117,127,
-103, 73,122, 86,182,225,104,118,161,181,173,137, 97,145, 83,100, 67,110,145, 13, 69, 38, 7,252,213,158, 96, 25,123,147,242,236,
- 9,130,176,121,192, 59, 35, 71, 1, 32, 9,146,253,221,152,245, 48,222,249, 47,207, 72, 86, 84,255, 17,190, 23,111, 38,224,241,
-141,227,133, 2,207, 58,119,113, 39,248,244,138,203, 21, 2, 69,128, 23,211, 4, 67,145, 36,239,112, 24, 25,141,198, 55,250, 66,
-244,137,190, 86,246, 9, 40,177,244,233,189,150,231,221, 81,149,145,173, 53, 0,176,114,213,138,165,237,187,143, 16, 95,184,149,
- 4, 11, 3,180,107, 17,142, 3, 59,127,181, 9, 2,243,165, 41,235,246,154, 42, 52, 66,143,160,160,160, 79, 69, 18, 73, 23,185,
- 66, 29,228, 27, 16, 76, 58, 88, 14, 14,134,131,210, 59,144,148,170,188,186,243,164,248, 50,235,176, 71, 59, 76,218,149, 0,202,
-229,215,167,175,222,239,242,203,202,165,131, 3,188,149, 8,242, 17,227,240,133, 66,142,161,121, 82, 19, 18, 65, 0, 64,176,198,
- 13,247,111,157,199,221,187,247,208,164, 93, 20,188,213, 53,161, 18,115, 66,222,227, 63, 11,252,252, 3,155,231,100,103,136, 95,
- 36, 90,254,254,254, 63,140, 28, 57,114, 86, 64, 64, 0, 86,172, 88,241,244,122,233,122,111, 12,180, 45,237, 58,252,105,255,227,
- 10, 51,252, 65,159, 90,120,179,153, 6, 60, 15, 76, 89,126, 23, 49, 9,122,172,159,209, 2,131, 58, 7, 98,221,193, 36, 52,173,
-167,132,209,194,195, 97,231, 32,150,144,104, 16,170,130, 84, 76,225,220,173, 60, 24, 76,166, 10,109, 19,148, 20,221, 59,183, 67,
- 94,145, 25,190,238, 18,132, 6,249, 66,165, 8,133,193,194, 34, 37, 91, 7,157,137, 65, 94,161, 9,111,180,107,131, 83, 91, 36,
-213, 93, 96, 53,170, 81,141,106,252,103, 84, 45,160,212, 30, 90,207, 17,173, 35, 71,142, 8, 0, 80,150,127, 52, 35,167, 0,222,
- 42, 26,190, 53,106,227,189, 79,151, 98,243,242,207,193,113, 12, 4, 1, 96, 57,215,118, 38, 16, 4,209,233,143, 39,213,174, 95,
-171, 54,229,251,222, 8,133,101,235, 54,179,252,189, 17, 10, 75,227, 38,222,186,143, 39,213, 78, 50, 88,131,223, 96, 57, 14,127,
-198,230, 34, 38, 73,135,152,100, 61, 84,114,215,183,249,162, 36,226, 73,139, 22, 46, 16,211, 20, 65,196,166, 24,141,233,249,172,
-145, 18,137, 28, 10,185, 68,176, 11,180, 45, 57, 79,200,239, 58,224, 3,203,225, 45, 43,199, 2,248,164, 92, 85,172,120,165, 97,
-137,146, 85,242, 45, 8,130, 64, 0, 60, 79,112, 92,122,158, 21, 70, 7,131,156,194,103, 68,139, 96,203,247,156,170, 2,234,134,
-187,169, 85, 39, 40,138,146, 10, 2,192, 56,216,119, 17, 80,183,167, 49,235,113,124,105,146,117, 53, 54, 19, 9,183,207,228,112,
- 14,243, 72,115,110,220, 89, 87,243, 78, 16, 16, 40, 10, 60, 69, 18, 60, 65,128, 23,145,130, 29,130,192,191,152, 34,115, 21,136,
- 86, 9,217,146,136,168,153,167,118, 44,215,140,121,187, 1,118, 94,116,114, 62,171, 65,171, 55,101, 84,137,100,193,219,219,123,
-244, 87, 95,125,245, 67,191,119, 70, 64,103, 37,144, 83,232, 84, 3,237, 12, 15,177,210, 7,221, 63,222, 24,148,165,213, 7, 61,
-190,118,248,141,188,219,219,116,140, 85,183,162,220,116, 37,100, 94,179,152,139,252,161,230, 0, 0, 32, 0, 73, 68, 65, 84, 77,
-208, 91,156,249,153, 54, 58,130,250,110,237,105,176, 2, 13, 47,223, 64,248,186,137,241,254,187,189,112, 49,164, 22, 30, 60,124,
-136,153,179,143,194,207,195, 45,230,202,249, 67,117, 90, 68,118, 88,118,108,255,246,151, 72, 92,118,118,246,236, 45, 91,182,160,
- 89,179,102,179, 90,182,108,137,236,236,236, 18,130,252,180,222, 19, 30, 59, 5,219, 18,162,117,235,214, 93,180,104,209,180,220,
- 60, 55,169,227,134, 61,231, 50,177,241, 72, 50,228, 82, 10,181, 3,101,152,180,232, 54, 58, 55,247,193,228, 33,161, 80,201, 67,
- 80,100, 96, 96,103,120, 88,108, 44,242,245, 14,100,228, 91,145,150, 99,129,131,169, 56, 22, 94,128,128,152,248,116,216,108, 86,
-120,122,122, 66,165,176, 66,230, 17, 12,128, 66, 97,142,206,185,250,208,108,133, 66, 46,173,238,250,170, 81,141,106,252,127,131,
-138,184,200,255, 71,170,214,203,138, 86, 69, 25, 18, 4,224, 81, 74, 30,106,213,244, 69,205, 90,117, 16,255,224,110,169,206, 30,
- 96, 57,215,220, 81,135, 14,101,165, 47, 93,234,198,127,254,185,174,221,162, 69,193, 87, 38, 77, 12,114,111,220,196, 91,247,213,
- 87,169,237,150, 45,115,191,114,250,170,136, 19,138,247,235, 42,217,155, 75, 16,170,178,199, 38,217,166, 89,195, 80,106,246,182,
- 71,169,103,239, 25,114,197, 98, 49,227,239, 41, 35,212, 42, 9, 69,145, 34,137,141, 33,109,225,141, 90, 80,135, 73,162, 69, 69,
- 86, 74,136,214,139,174,195,124,109, 66,191, 83,123,167, 53,126,107,192, 98,175, 12,173, 5, 58, 59,245,212,117, 72,145, 4,238,
- 61, 72, 1, 40,113, 76, 89, 54,221,212, 94, 39,183,111,221, 28,188,108,209, 60, 56, 88, 14, 31,127,254, 29, 62, 24, 61,242, 36,
- 2,234,246, 12,174, 29,113,243,210,225,223, 21, 61, 39,254,140,148,184, 27,217,172, 77,191,163, 42, 36,235, 41,217, 2, 4, 78,
-224,201,130, 66,189,202,198, 66,134, 50,120,159,205,193,191, 82,203, 49, 90, 88, 28,254, 59, 27, 71,246,239,128,187, 90,249, 74,
- 54,220,221,221, 27,116,236,216, 9, 4, 45,129,157,177,193,206,242,176,151,138,209,114, 48, 60, 24, 65, 4, 69, 64, 83, 20,220,
- 63,208, 0, 86, 93,185,182, 70,141,234, 81,208,176, 73,203,221,223,126, 62,110,200,144,247,198,160,109,228,155,136,187,251, 23,
-252,130,234, 67,229,225, 35, 92, 73, 42,100,219,213, 15,166, 71,247,111, 77, 68,215, 12, 67,237, 6,237,241,232,254,245, 38, 98,
-177,248, 94,234,227,135,229,186, 36,179,179,179, 75,246,156,154,213,178,101, 75,164,166,166,162,160, 84,189,215,169, 91, 27, 0,
- 16,255,208,185,136,161,132,100,241,124,217,237,116,252,130,219,208, 91, 56,248,120, 74, 64, 17, 36, 32, 8,168, 21, 32,199,141,
- 71, 5, 24, 57,187, 16,145, 13,189, 16, 28,160, 0, 4, 1, 70, 43, 3,187,157,135,131, 7,236, 86, 22, 20, 89,238,146, 65,142,
-227, 56,142, 20, 24,234, 86, 76, 60, 36, 98, 17,220,139, 76,144,203,229, 16,139,243, 64,144, 36, 88,150,135,131, 97, 96, 49, 91,
-176,251,198, 85, 8,156,131,226, 56,142, 67,177, 27,180, 26,213,168, 70, 53,254, 27,241,255,113, 32,124,105,114, 85,190,162, 85,
- 17, 66,106,250,225,239,152, 36, 52,169, 31, 10,119, 55, 53, 30, 38,164,131, 34, 69, 32, 9,128, 97, 93, 39, 67,130,131,217,185,
-108,153, 59, 82,146,148,228, 79, 63, 39,213,254,120, 82,237,164,101,203,220,175, 8, 14,102, 39,128,145,130, 0, 56,201,150,147,
-112,113, 85,224, 5, 2,207, 4,249,121, 41,168, 27, 79, 76,249, 36, 73,217,188,221,101,188,183,187,148,244, 86, 75, 68, 98, 17,
-197,179, 2,233,168,169,169,109, 21,120,222,149,115,245,158,115, 29,114, 28, 7,130, 32,185, 98, 34,166, 76,203,183, 64,103,165,
-144, 83,100, 67,161,193,129,122,129, 74,156,137,222, 99,230, 24,203,182, 50,213, 54,145,216,189, 78,237,154,248,102,206, 50, 88,
-108, 28, 30,101, 24, 33,150, 74,253,253,252, 27,221, 25,249,209,116,233,148,245, 9, 24,219,197, 27,159, 95, 74,200, 48,231,200,
-166, 87,165,102, 57,142,131,197,106, 23,231,228, 21,122,234, 13, 38, 55,185, 76,106,241,245,114,207, 43,235, 94,171,253,213,198,
- 89,133,140, 70,223, 72,127, 88, 29,195, 97,177,177,248,235,236,190, 87, 49, 19,234, 87,163, 38,140,246, 82,228,170,152,108,149,
- 38, 93, 34,149, 47, 0, 34,180,178,108,223,191,119,243,221,251,247,110,254,120,253,202,133,237,139,126, 59,219,120,203,154,239,
-177,250, 96, 2, 40,138, 34, 4,134, 21,173, 60,152,132,154, 30,148, 96,100, 68,132,149, 35, 96, 42,208, 34,162, 77,175, 70,219,
-215,126, 59, 29,206, 45, 35,108,174,144,173,194,156, 27, 79,235,253,196,241,167,235, 22, 80,120,103, 83, 81,194,185,213, 78,138,
- 79,209,123,202,102,237, 14,187,198, 93, 34,112,172,131, 47,189,163,149,187,156,128,192, 3,215, 99,115,112, 43,158,132,183,155,
- 24, 42,185, 8, 12,203,195,108,103, 97,177,114, 36,207, 58,108,229,212,247,173,149, 43,150,127, 63,124,248,240, 73, 59,118,205,
- 58,212, 44,234,179,126,250,162,124,136, 36,114,136,105, 49, 72,138, 4,203,113,176, 91, 77, 40, 44, 42, 64,210,159,127, 28, 26,
- 58,100, 96,139,149, 43,150,127, 95,178, 74,177, 26,213,168, 70, 53,170,241,111, 83,179, 94,130, 75, 68, 75,165,144, 65,160,100,
-184,116, 51, 1, 17, 13,155, 98,211,161,107,168,219, 36, 18, 89, 6, 22, 2,200, 74, 87, 27,150, 96,218, 12,203, 45, 0,183,250,
-245, 83,212, 28, 56, 48,176,187, 32,136, 78,255,188, 78,159, 14, 0,161,141,157,102,120, 94,128, 32, 0, 2,239, 36, 92,174, 75,
- 58,116, 74, 82,150,190, 86,109,127, 37,238,167, 59,108, 74,169,152,244, 84, 74, 40, 95,119,137, 88, 76,211,224, 4,194,150,149,
-149, 96, 35,128,100, 87,204,189,232, 58, 84,168, 2,142,117, 29,176, 88,155,156,170,187, 81,175,192,220, 76,231,144, 64, 16,128,
-122,129, 74,196, 92, 61,202,229,100, 60,126,100,201,137,251,165,108,149, 12,148,131,229,113,231,137, 14, 69, 38, 6, 69, 70, 7,
-222,232,220, 87,252, 70,183,126,184, 20,147, 7,158,101,176,232,215,163, 6, 78, 96,134, 2, 15,152, 42,100,154,252,251, 86,108,
- 77,109,161, 73, 42,162,233,162,250,117, 67, 18, 37, 98, 17,171,215,235, 37,207,223, 69, 65, 41,151,160,192,200, 0, 0, 83,213,
-214,163, 51, 49, 56,116, 53, 27,135,247,109,135, 92, 46,135,240, 10, 45, 80, 44, 22,123,136,196, 50, 56, 76, 78,119, 97,201,199,
-241,194,135,164,165, 0, 73,123,184,104,246,129,221,110,249, 43, 41,238,106, 3,174,115, 93,106,116,183,218, 24, 53,126, 42, 2,
-235, 52, 65,223,190, 3,209,180,182,154,216,119, 37, 21, 12,195, 26,252,195, 26,169, 5,231, 42,219, 71, 0,154, 1,184,234,138,
-178,165, 46, 85,239, 13,222, 8,107,246,140,104, 1, 5, 41,183, 43, 92,197,202,217,243, 51,204,118,146, 20, 4,190,204, 41,131,
- 8,128, 96, 7,114,178, 4,100, 3,160, 73,128,166, 72,128, 32, 40,142,227,202,172, 39,150,101, 79,241, 60,159,179,117,235,214,
- 28,142,227,110,221, 60,186,244, 78,157,183, 38,206, 2, 91, 0,134,113,134, 51, 74,164, 10,240, 4,137,132,139, 27,103,113, 14,
-203,193,173, 91,183,150,108,239,112,175,186, 47,172, 70, 53,170, 81,141,127, 11, 74,159,113,248,118,105,242,229, 18,209,226,120,
- 1, 62,222, 94, 96, 4, 26, 73, 57, 58,152, 8, 13,172,102, 1, 28, 71,128, 19,132,138,182, 26,239,134, 50,150,231, 31, 58,148,
-149, 14, 96,195, 11,154,212, 83, 37,235,233,119,217, 46,153, 50,109, 18, 2,119,230,208,241,243, 67,250,117,232,226,249, 48, 43,
- 59, 93, 44, 34,105, 90, 76,137,196, 52, 73,136,105,210,238, 38,167,169, 61,235,118, 72, 4, 2,231, 43,179,105,181, 90,209,173,
-219,243, 7,147,199,197, 94,209, 20,228, 62,178, 11, 4,207,251, 74, 12,240,113,247, 69, 98,114, 42,206, 30,223,103,206,201,120,
- 28,199,217,172,253,241, 60,229,124,102, 83, 16,248, 2,157, 13, 86, 7,135, 66,163, 3, 69, 38, 7, 88,223,118, 56,240, 87, 38,
-100, 98, 10, 57,119,246, 88,180,217,233,159,218,114, 31, 39, 85, 82, 21, 95,227,185,189,180,132,244, 15,199,140, 22, 45, 95,178,
-200,214,162, 69, 75,161,160,160, 0, 70,163,241, 89,153, 16, 4,100,110, 26,168,229, 52, 30, 95, 63,134,199,103,151, 89, 0,124,
-235, 74,121,150,134,155,130, 70,191,182,254,176, 57,134, 35, 79,103,195,245,243, 7, 42,107, 50, 47,217, 84, 40, 20,242, 18,245,
-170,244,182, 14,246, 82,170, 22, 87, 92,223, 36, 45,149,151, 97,179, 59,128,211, 47, 94,212,235,116, 71,111, 93, 57, 51,201, 58,
-126, 20,114,138,108,176,228, 39,224,143, 3,191,156,117, 24, 30,117,238,177,124, 9, 57,181,127, 29,156,189, 85,160,190, 71, 83,
- 0, 15, 68, 13,159, 54,248,196,246, 37, 91, 42,203,123, 9,217,234,212,161,245, 44,146, 34, 14, 11,196, 51,178,148,153,153,233,
- 82,222,117, 57,143,139, 21,164, 42,249,192, 65, 16, 36, 37,240,207,157,129,248, 92, 58,121,158,191, 87, 66,154,104,130,232,175,
- 86, 40,144,167,213,161,100,147, 93,171,197, 0, 47,159, 26, 32, 9, 2, 76,169,123,171, 90,239,175,128,106,155,213, 54,171,109,
- 86,219,252,191,138,151,206, 56,172,130,162, 37, 32, 44, 64,137,186,129, 74, 88, 29, 26, 88,237, 28, 76, 86, 14,122,179, 3,122,
- 51,131,164,108, 51, 98, 14,189,126, 10,157, 42,150,115,235,115,193,185,223, 38, 56, 94,112, 89, 61,145, 56,236,115,150, 46,154,
-255,238,142, 22,205,237, 83,222, 14, 8,186,155,100,207, 36, 8,210, 66, 82, 52,227,165,166, 69, 15, 31,222,213, 94,185,120,172,
-163,140,229, 70,153, 43,176,195,178,172, 46, 48, 48,176,100, 64,123,122,189, 65, 29,121,255, 63,143,126, 29,218,169,223, 34,223,
-229,243,166,153, 73, 74,204, 19,180, 56,134, 99, 44,219, 45, 57,113, 63,163, 2, 93,143, 20,203, 30,252,125,251,126,164,135, 87,
- 16, 30,103,152, 96,178,178,112,176, 60, 60, 85, 98,164,223, 59,233, 72,122,120, 99,151, 49,243,238,166, 87, 40,182,109,241, 15,
- 98,106, 70, 69,245,124, 39, 50,178, 29,245,253,247,223, 33, 34, 34, 2, 22,139, 5, 36, 73, 34,168, 86, 29, 36,197,223,198,213,
-163,115, 56,115,126,242, 47, 0,126, 4, 80,229, 3,151,243,244,118, 28,191,145,139,163,251,119,130, 18,189,210, 10, 54, 82, 46,
-151,203,202, 34, 87,165, 73,215,211,155, 69, 18, 25,156,234, 19,255, 92, 67, 44, 27, 39, 18,226,239, 63,120,255,189, 97, 13,212,
-238, 30,232, 61,112,104,238,149, 75,103,251,236,255, 99,221,138,252,228,180,119,191, 91,176,202,173,123,171, 0,194, 75, 37, 65,
-145,137,199,182,148, 7, 97,112, 81,131,205,206,206,158,157,150,116, 99,228,159, 71,191,238,219,169,223, 34,223, 27,123,103, 62,
- 13,162, 39, 41,122,107,101,207, 23,164,221, 60, 91, 85,146, 85, 66,181, 4, 65,112,201,113, 46, 0, 16,137, 37,208,104, 2, 64,
- 16, 0,195,242,176, 51, 44,104, 81,245, 74,195,106, 84,163, 26,213,248, 15, 99,252, 11,223,174, 41, 90, 86,171, 53,233,205,110,
-125,193,243, 2, 56, 1,224,185, 98,229,137,127,166, 62,113,140, 53,233,117, 83,199,243,220,181, 53,235, 55,244,110,209,166, 19,
-213, 48, 88, 5,125,126, 54,174,254,121,142, 5, 47, 92,113,229,249,252,252, 71, 70,185, 95,221,119,222, 29, 60,112,247,232, 49,
- 19,139, 58,118,238,172,212,104,252,109,233, 25,233,230,141, 91,182, 50, 39,143, 29,236,200,131, 29,150,159,255,216, 88,145, 29,
-157, 78,183,178,172,235, 82,137,234, 13, 0,161, 20, 77,216, 45,218, 71, 85,138, 8,207,203, 72, 27, 52,127,206,172,228, 17,227,
-166, 74,194, 2,235, 32, 87, 71, 33, 41, 61, 27, 15, 47, 30,180,101,196, 95,223,175, 79,191, 53,214, 69, 83, 89,101, 92, 75, 7,
-176,252,234,213, 43,141,162,162,162,122,118,233,210, 69, 24, 63,126, 60, 4, 1, 56,187,126,146, 80,144,116,117, 79,177,138,245,
-228, 21,235, 37,229,226,149,219, 94, 67, 58,182,162,189,213, 99,177, 97,231, 49, 6, 2,159, 82, 69, 51,126, 53,131,107,209, 78,
-119,161,115, 75,135, 23, 63,118,230, 89,252,152, 88,229, 71,155, 17,227, 87, 78,126, 95,226, 26,143,227,239, 55,121, 28,127,127,
- 12,128,220,221, 91,127, 61, 12, 0, 54,139,101, 98,244,217, 67, 41,247, 99,111,140,234,247,222, 23,117, 26, 53,107, 77,239,217,
-180, 28, 14,171,105, 31, 0,151,219,171, 84, 66, 37,151,212,123,101,174,194,151,234, 61,249,234, 49,130,164,104, 87, 73, 83, 41,
- 37,146, 20,120,222,165,128, 58,129,231,144,241,228, 30,188,252,131,161, 86,187,131, 23, 28,128,221, 6,109, 90, 28, 56,174,250,
-172,195,106, 84,163, 26,213,248, 15,225,213, 99,180,210, 30, 56,247,211,250,119,195,144,157, 59,114,211,166,205,115, 55,111,217,
-241,134,213,110, 15, 20, 32, 78,227, 88,251, 5, 35,135,239, 93,181, 97,201,121,124,195,219,187, 94,227,141,191,174,249,118,227,
-134,159, 58,129,231,234, 19, 64,178, 64,224,188,140,225, 70, 87, 70,178, 42, 28, 52,243, 12,235,186,191,179,196,146,159,111,220,
- 92,213,103, 45,249,113,217, 36,229, 8, 90,183, 98,206, 98,146,164,122,112, 28, 47,226, 57,230, 49,231,176,254,203,162,141, 59,
- 4,151,163,220, 80, 80,193,191,197, 2,136,141,142,142,238, 16, 29, 29,221, 6,192, 74, 56,207, 80,188,241, 58,245, 98,203, 55,
-116,253,114,218,151,103,191, 0, 17,194,243, 2, 88,142, 79, 17, 91,204, 93,171,104, 38, 40, 44,172,142,194,193,112, 47, 5,192,
-151, 14,132,127, 74,180,220,107, 42, 0, 4,185, 72,180, 0,231,106,186, 95, 95,186,200,178, 11,179, 50,211,118,254,252,175, 79,
- 39, 0,168, 13,224, 50,128, 53,255,169,122,119, 88,245,121,255,238,247,134,117,216,102,167,223, 61,132,204, 88,113, 0, 65, 59,
-183,114, 16, 56, 59,120,214,158,197, 50,142,217,213,125, 95, 53,170, 81,141,106,252,199,212,172,245,101,253,166,255, 91, 82, 88,
- 88,248,196,128,194,138, 15,233,117, 5,249,249,143,140, 0, 94, 90,185,103,126, 77,187, 49,143,244,123,241, 72,191,247, 85,159,
- 55,229, 38,106,129,196,209,175,153, 12, 87, 2,217, 47, 21,127,254, 17,228,229, 61, 48, 33, 15,109, 95,183, 90,182,109,221,242,
-112,199,142,157, 34,129,164, 68,188, 64,137, 89,129, 16,177, 60, 33, 98, 24, 30, 54, 7,195, 56, 88,150, 1,199, 58,192,115,140,
-192, 59, 24, 56,119,135,255, 39,144, 2, 96,198,255, 84,189,255, 39,192, 50,142,217, 96, 28, 0, 76,213, 93, 93, 53,170, 81,141,
-106,252,119, 17,174,255, 30,162, 85,141,255,213,120,146,240, 56, 62,178,186, 24,170, 81,141,106, 84,163, 26,255,203, 73, 86,233,
-111, 0,206,216,243,110,229, 60, 80,149,213, 4,221, 94, 33, 65,103,170,109,190,182, 77, 17, 0, 9, 0, 21,128,202, 92, 91, 61,
- 81,245, 13, 43,255, 39,242,254, 53,128,219,213,245, 94,109,179,218,102,181,205,106,155,255,107,109, 86,102,187,122, 53,227,191,
-153,128, 85,219,172,182, 89,109,179,218,102,181,205,106,155,213, 54,255,239,217,252,255, 25,227,203,248, 0,168,118, 29, 86,163,
- 26,213,168, 70, 53,254, 15,194,219,187,158, 10,120, 26,215, 91, 41, 20, 62, 13,252, 0,192,156,247, 32,167,186,244,170, 81, 6,
- 74,159,115,248, 92,140, 22,249,138, 6, 69, 36, 45,249, 82,161,246,126,160,116,247,206,248, 63, 94,184, 68,120, 45,229,228,238,
- 29,107, 31,136, 8,149,247,175,202,131, 10,223,240,223,253,235,180, 77, 85,106,194, 39, 35,160,133,252,117, 18,161,212,132,250,
-170,130, 90,253,169, 14,108,212,235,223,144, 71,105,195,134, 13,219, 53,108,216,176, 29,128,127,228,148, 98,133, 38,124,120,205,
-186,145, 23, 53, 97,205,207, 41,253,234, 13,254,167, 19,172, 10,168,235,173, 10,106,185, 87, 85,163,105,161, 42,160,169, 94, 85,
-179,229, 5,181, 79,131,176,202,158, 11,234, 55,191,254,236,237, 49,219,131,250,205,175, 95,214,191,123, 70,173, 82,255,176,227,
-209, 60,239,190,255, 82, 85,247, 43,175,134,160, 55,134,123, 4,116,250,194,187,170,207, 5,134, 71,198,214,106,212, 33,183, 70,
-189,182, 49,174, 62, 83, 51,162,221,173,144,134,111,228,212, 12,111,119,163,186,228, 93,131,204, 55,180,157,204, 51,248,168,212,
- 51,248,152,212, 43,180,243,235,218, 11, 8, 8,144,215,175, 95, 63, 42, 50, 50,114, 66,215,174, 93, 63,107,222,188,249,248,144,
-144,144, 30,255,147, 19,125,133, 38,124,134, 77, 68,228,217, 68, 68,158, 66, 19, 94,233, 98, 25,165, 38, 98, 46, 65,114,153, 4,
-201,101, 42, 53, 17,115,255, 91,234, 74,234, 23, 30,162,208,132, 47, 83,251, 55,188, 38,215,212,235, 91,213,231, 61, 61, 61,123,
-248,250,250, 14, 40,249,120,122,122,246,168,126, 3, 94, 25,165, 85,172,215, 86,180, 40,145, 84,113,121,196,152,143, 27, 47,156,
- 53, 93,182, 98,195, 1,172,152, 55,237,190,205, 84,212,240,191, 49,231, 62,161,109,110, 80, 36, 85,179,244, 53,142,231,210,243,
- 18,175,181,250, 39,236, 71,212,146,143,253,246,171,145,159, 15,127,183, 91, 72,183, 62,159, 18,113,137,150,131,174, 83, 52, 52,
-219,181,119,127,208,197,243,231, 86,109,216,176,254, 71, 45, 27,177, 76, 36,165,215,232,211, 98,139,170,146, 6, 55,223,176, 80,
- 90,233,115,241,205,254, 31,251,223, 60,179,117, 19,103,231,187,155,243, 74,157,254,253,234,240,173, 83,167, 78,107,138,162,188,
- 39, 79,158, 44, 6,128,229,203,151,215,229, 56, 46, 63, 33, 33,225, 58, 94, 97,243, 83, 39,193,140, 24,185,114,241,236,205,189,
-122,245, 70,102,158, 9,139,150,173,125,235,196,145, 93, 67, 76, 57,143,246,252, 19,117,226,225, 81,219, 13, 98,245,189, 79,191,
-250, 81, 19,245, 86,107,202,104,101,113,226,226,237, 14, 91,215,254,120, 13,104,208,198,144,247,160,220, 61,197,120,179,110,166,
-159, 74,136,226,205, 58, 0, 24,254,210, 96,175, 98,186,249,202,185,168, 0, 41,125, 59, 31,168,244,208, 71,143, 90,111,156, 20,
- 73,165, 33, 36, 73,130, 36, 0,146, 36, 64, 17,132,243,156, 80,135, 37, 37,227,225,165,158,255, 13,239,137, 58,184, 77, 54, 40,
-218,155, 36,158,165,143, 32,139,191, 5, 65,159,253,232,178,247, 63,240,223,184, 55,174,235,209,232,141,186,166,141, 23, 18, 11,
-148,116,199,207,142, 18, 2,249, 83,234,165,101,119, 92, 34, 0, 50,153,231,225,195,135,125,163,162,162,220, 53,141,250, 95,112,
-229, 25, 9,101,108,120,228,200, 33,113, 84, 84,207, 42,180,207,240,238, 32,201, 45, 4, 32,226,121, 97, 57,197, 11,187,140,249,
-241, 9, 64,213, 78,159,146,107, 34,198,146, 16, 92,238,103,120, 16, 55, 44,185,113, 27, 94,181,112,105,169, 91, 87,145, 88,252,
- 89,104,120,147, 22, 25,201,143,111,152,140,134,101,172, 77,119,161,202,134, 24,246,203, 51,151,110,246,162, 69, 34, 34,170,107,
- 91,202, 6,156,123,157, 74,247,243,243, 27,176,122,245,234,176,118,237,218, 1, 0, 88,150,117,219,189,123,183,255,156, 57,115,
-148,241,241,241,251, 94,209,108,160,175,175,111,176, 68, 34, 9, 4, 0,187,221,158,161,213,106, 83, 1, 84, 58,241, 87,250,133,
-249, 64,192,143,151, 46, 94,164, 1,160, 67,135,142,115,131,223,252,196,147, 18,171, 44,101, 22,135,221,160, 44, 74, 56, 55,245,
-234,223, 87, 8, 0,136,108,219,110,186,194,167,193,154,255, 73,101, 75,166,137,104, 75, 2,159, 71,118,232, 54,104,232,176,145,
-100,163,122,193,232,209,189,203,215, 22,224,112,149,218, 12, 77,203,175, 93,187, 86,135, 36, 73,138,101, 89,107,100,100,100,234,
-235,164,171, 70,120,187,191, 8,144, 65, 14,214,254,171,246,201,141,185,192, 75, 7,199, 80,238, 65, 45,190, 5, 69,143,227,121,
- 62,205,144,122,163,253,255, 66, 69,235,229,114,174,170, 37,146,150,124, 54,252,131,143, 26, 79,253,226, 27,217,167, 43,162,113,
-116,237,244,188,255, 86,146, 5, 0, 20, 73,213, 60,121,234,164, 70, 33,161, 0, 0, 70, 43,139, 94, 81, 81,149,143, 8,181,218,
-156, 39, 9, 34,162,228, 40,113,142,117,200,104,145,196, 74, 56, 9, 18, 8, 0, 62, 53,106, 69,251,177,151, 21,195,223,237, 22,
-178,101,199,233,244,212,244,252, 42,119,106, 4, 37, 70,100,199, 30,232,214,189,167,251,181,191,255,250,113,253, 47, 63,207, 96,
- 29,204,207, 60,195, 47,179, 22, 60,206,172,180, 51,247,175,215, 82,162,242, 57, 49,104,194, 28,111, 43,233,133,239,231,173,244,
-185,120,124,219,133,140,180,102,124, 74, 74,154, 85, 32,136,251,133, 5, 89,159,153,178, 19,226, 92, 45, 50,149, 74, 21,166, 82,
-169,154, 53,109,218, 84, 54,109,218, 52,209, 91,111,189,245,140,178,143, 31, 47, 62,127,254,124,192,146, 37, 75,122,223,189,123,
-215,106, 52, 26,239, 24,141,198, 39,168, 66,160,189,191,191,239, 39,239, 12,236,139, 46,131, 62, 6,199, 19, 24,255,209, 84,156,
- 60,190,111, 34,128,127,132,104, 49, 10,183, 57,227, 38, 76,243,141,108,221,156,250,113, 91, 28,228, 18, 26, 61, 91, 69, 16, 31,
- 76,158,233,177, 97,213,143,191, 33, 15,157,202, 82,178,120,179,110,102, 99, 31,251,176,126,237, 66,113,104,187,125, 24,186,126,
- 5, 82,225, 62, 55,237,208, 55, 15, 1, 32, 44,106,178, 90,202,105, 87,215,240,160, 52, 82, 78,187, 58, 44,106,242,153, 39, 39,
- 86, 27, 42, 74,139, 72, 42, 13,217,190,109, 91, 61, 79,181, 24, 52, 73,128,162, 8,208, 20, 9,171,157,195,144,119,135,253, 99,
-205, 92,174,169,215,155,116, 30,150, 13, 30,248,221,146,251,232, 88, 85,234,132,160,196,222, 71, 14,237,167, 53,238, 82, 80, 20,
- 1,138, 4, 40,146, 64,114,142, 5, 99,199,126,224,254,186,132,189,215, 27,154,214, 95, 14,141,232, 25,217,216,171,233,206, 43,
-132,123,100,175,161,222,121, 86,197,251, 59, 14,158, 27, 38,116,152,250,183, 32,240,139,211, 47,175, 60, 85,145, 17,155,205,150,
-211, 51,170,151, 27, 65, 43, 21,103, 14,108,234, 72,147, 4, 24, 78, 0,203, 9,224,138,207, 70, 37,138,103, 48, 36, 73, 64,224,
- 5,140, 27, 55, 22, 61,163,122,153,121,150, 79,119,189,147, 35,183,156, 56,243,167,175,141,225,177,100,245,134, 31, 77, 58,237,
-143,137, 15,189,147,141,186,188,169,150,220, 71, 46,159,131, 65, 66,104,149,246, 36,102,194,182, 35, 87,209,184, 97, 3,112,188,
- 51,157, 17, 53,149,216,118,244, 42,234, 71,212,119,166,155, 23, 16, 30,164, 66,235, 86,173,129,151,142, 38,115,149,100,169,191,
-239,244,246,200,217,125,134,140,129,198,215, 23,164,192,244, 57,115,116, 91,159,223,127, 90,252, 37,107,213, 47,169,146, 49,129,
-123, 58, 46, 8, 60,255,218,170, 83,141, 26, 53,124, 91,183,126,182, 29, 35,203,178,168, 93,187, 54, 50, 50, 50, 34, 94,101,158,
- 22, 16, 16,240,246, 15, 63,252,160,233,221,187,183,200,223,223, 31, 0,144,157,157, 29,120,226,196,137, 22, 63,252,240, 67,110,
- 86, 86,214, 81, 84,176,163, 15,199,144, 98,146, 6, 37,147, 41,156,121, 4, 65, 78,251,100, 84, 83,191,128, 26,101, 30,228,174,
-213,102, 75,190,250,248, 28, 65,211,226,226,251, 65, 10, 2, 79, 84,160, 18,117, 19,137, 68,101,122, 40, 28,148, 91,164, 32,114,
-255,144,164, 72,103, 99,101, 25,109, 97,234,173, 6, 85, 80,226, 26,137, 36,226,159,223, 25, 58,166,253,224, 65,253, 17,224,235,
-142, 51,151,239, 98,226, 39,159, 51,172,131, 89,246, 74,157, 7, 69,209,185,185,185,201,158,158,158,254,175, 63,222, 18,161,167,
- 79, 30,215,156, 57, 27, 61,125,233,138, 85,147, 28,118,150,225, 5,225,233, 57,198,114,185, 84,212,189,207,187,110,154, 58,145,
-178, 85, 63,124, 40,250, 95,168,104,173,255, 71,136,150, 68,174,126,247,187,175, 38,203,230,108,189,138,163,107, 39,230,153,245,
-121,190, 79,103, 10,110, 30,183, 76,250,162, 22,175,146, 66,149,111,120, 59,130,162, 39, 16, 20,165, 36, 72, 66,194,115,124, 26,
-107,183,207,181,228, 63,202,122,221,220,243,188,128,189,127,229, 86,141, 0, 9,168,187,101,231,126,141,159,135, 20, 86, 7,135,
-161,195, 71, 98,243,230,205,106, 95,119, 9,172,118, 22,139,151, 46, 53, 24,147,143,106,146,211, 10, 51,186,245,253,252,212,147,
-164,220,152,212, 44,235,174,170,166,205,230,224,160, 55,179, 48,219, 72,212,107,212, 26,139,151,213,151,165,166, 36,126,190,233,
-247,223,166,220,191, 79,109,230, 41,114,182, 53,235, 65, 90,153, 47,157,127,227,158,110,158,222,219, 7, 78,152,231,241, 40,151,
-134, 0, 7, 18,220,100,120,247,253, 41,110, 97,254,114, 40,101,148, 71, 98, 74, 70,192,180, 47,191,188,252,132, 19,218,232,181,
- 79, 18, 43, 75, 79,173, 90,181, 6,245,233,211, 71,241,197, 23, 95,136,130,130,130,240,251,182,221, 33, 29,122, 14,233,155,153,
-149, 19, 36, 8, 2,252, 52,154,180,113, 31, 12, 57,124,236,216,177,148,180,180, 52,209,162, 69,139,218,238,223,191,191, 97,118,
-118,182,203, 51, 83, 78, 16, 96,181,113,224,138, 7, 72,173,206, 86,101,126, 26, 24, 24, 40,205,200,200,176,149, 82, 25,136,103,
- 66, 33,209,179,107,167,182,244,186,227, 73, 48, 90, 57, 40,101, 34, 36,229,152,209,170,121, 19,226, 87,142,109, 86,150,193,177,
-239,190, 61,211, 79, 37, 68,245,107, 23, 10,141,167, 2, 27,215,204,195,161, 43,137, 81, 57, 70, 2,171, 5,106, 66,128,148,238,
-174,228,179, 86,191,213,170,142,127,151,150, 33,184,222,170,142,255,197,155,113,241,242, 33, 75, 39,103, 24, 69,103, 10, 79, 76,
- 49,148,221,241,144,240, 82,139,177,225,100, 10, 20, 50, 26, 74, 25, 13,165,212,249, 77,146,196,235,205,106, 3, 26, 4, 81, 60,
- 55,150,162,232,177,195,222, 29, 82, 99,196,176, 33, 2, 40, 18,187,247, 30,238,191,117,235,150, 44,198, 97,255,141, 35,169, 13,
-229,181,159,231, 10,148, 4, 52,238, 18,124,249, 91, 12,220,228, 34,168, 21, 34,184, 41, 68,232,210,212, 23, 20,249,202, 73,244,
-156,216, 63,172,247,196,129,181, 58, 71, 4,171,234,221, 73,208,221, 31, 59,247,198,138,243, 69,157, 63, 91,179,188,161,183,177,
-200, 78,127, 63,109, 28,157,158,153,217,121,247,225, 11, 93, 56,251,152, 56,214, 97,250, 70,123,119,119,153,170,112,122,220,149,
- 22,129,145,131,101, 14, 35,115,239, 78, 92,122,157, 66,155, 20,177,201,122, 40,101, 52, 84, 37,101, 43,163,161,148,137,160,146,
-209,200, 76, 79, 66,129,137,186,156,225, 77,118,198,133, 43, 85,218, 38,223,234,224,112, 59,209,136, 90, 17,205, 17, 16, 80, 3,
-246,222,239,213,250, 59,122,239,193,107, 23, 14, 44, 48,103, 63,252,198, 85, 59,219,142, 92,197,244,169, 19,110, 18,192,173,226,
- 65,186,197,247, 11,215,182,252,113,250,199,207, 93,155, 54,123, 85,203, 87, 87,178,212, 51,187, 12,252,104,118,135,238, 3, 97,
- 40,200,193, 95,167,118,161,103,159,119,240,222,152, 79,225,225,225,179,120,217,220,175,238,176, 54,125,244, 75,125,174,127,253,
- 55,155, 52,110,176, 53,176, 70,141, 32,158,119,158,242, 33, 8,128,209,160,195, 87,159,141, 3, 47, 8,104,214,162, 77, 23, 89,
-135,238,130, 80,124, 26, 72, 94,126,158, 41,238,225,253,110,214,220,184,191, 93, 46, 75,171,149,209,106,181,184,125,251, 54,226,
-227,227, 17, 27, 27,139,252,252,124,184,187,187, 27, 77,166, 42,237,253,230,214,180,105,211, 17,209,209,209, 50, 79,207,103,135,
- 52,216,237,118,168,213,106,140, 24, 49, 66,212,163, 71,143,192,183,223,126,123,116, 76, 76,204, 54, 0,250, 50,211, 83,240, 56,
- 83,237, 23,241, 75,167,183, 58, 77, 2, 0,185, 91, 64,226,234,223, 15,199, 86, 56,161,117,175, 17,210,190,253, 27,117, 32, 8,
- 32, 32,172, 52,231,199,103, 87,160, 18, 41,175, 94,189, 26, 70, 81, 20,253,108, 12,226,241,211,198,157,245, 79, 95,186, 55,104,
-225,226, 37, 50, 55,165, 20, 90,157, 29, 31,190, 55,208,229, 49, 88,238, 23,209,187,125,251,142, 7,127,156,253, 29,173, 82, 42,
-113,234,239, 39,152,252,217,151,214,172,228,152, 37, 2, 47, 90,107,214,198,231,190,230, 80, 41,224, 31, 64,189,154, 42,168,251,
-245,148, 77, 28,213, 79,102,103, 56, 20,153, 24,216, 28, 28, 56, 94,128,206,196,224,126,170, 1, 62,110, 85, 63, 34, 76, 16,132,
-214, 0,124, 1,104, 9,130,184, 94,250,119,201,132,174,132, 27,191,240, 59,175,120,124,240, 6, 96,135,115,165,254,211,230, 83,
-252,187,188,235, 37,207,223, 7,208,160,216, 38, 7,224, 26, 65, 16,133,229,144,173,151, 84, 46,250,200,145, 35, 66,159, 62,125,
-158,246,248, 47,254,126, 17, 82,177,168,134,210,221, 23,130,240, 0, 4,241,236, 54,141,127, 96,254,146,101, 43,188, 62,249,104,
- 66,138,190,168, 32,164,248,242, 25, 87, 6, 11,154,160,150,117,122, 35,178,199,164,143, 62, 66, 68, 88, 77, 49,199,113, 66, 76,
-124, 34,179,105,195,198,247, 47, 94,145,172,208,167,199,204, 44, 37, 65, 86,105,217, 39,199,115,233, 47, 42, 88, 28,207,189, 56,
-187,125,249,144,106, 2,240, 80, 73,240,203,241, 36, 8, 2, 64, 64,128,187, 82,132, 29,231,211,145,120,115,159,190, 79, 51,189,
-105,196,194, 89, 93, 58,247,158, 18,125, 63,193,186, 43, 55,215,122, 18, 64,118, 69, 54,203,238,208,121,216, 28, 28, 24,150,197,
-158,195,135, 17,213,165, 45,218,183,111,139,142, 29,218,211, 55,110,222, 29,243,209,164,113, 65,120,182,186,227,169, 77,153, 95,
-221,214, 42,119,159, 93,131, 38, 45, 82,223, 75,103, 65, 83, 64,168,191, 28, 94,106, 49,236, 44,129,100,173,163,248,205,241,192,
-228,105,179,189,166,127, 62,233,152, 94, 43,105, 12, 60,112, 84,148,119,179,217, 44, 25, 57,114,164,136, 97, 24,199,136, 15, 63,
-237,145,157,173,237,255,211,202,127, 73, 53, 26, 63,152,173, 44,110,198, 62,110,240,227,143,179, 67, 15,159, 56,127, 96,214,151,
- 19, 15, 70, 69, 69,185,239,220,185,147,175,172, 60,159,155, 33,230,228,173,217,184,117,207,230,229, 75,230, 35, 46,165, 16, 27,
-214,173,133,192,177,191, 84, 82, 84,165,109, 10, 35, 71,142,148, 31, 56,112,160,102,122,122,186,222,108, 54,107,159,211, 35, 72,
-130,206, 41, 48,195, 71, 45,129,152, 38,225,231, 41,131,198, 93, 10, 17, 5,144, 4,193,149,101,115,195,174,163,115,121,179, 14,
-135,182,219,135,109, 92, 51, 15, 99, 62,249, 22, 49,121,146, 19,164,194,125,238,199,195, 6, 77,247,149,115, 81, 53, 60, 72, 77,
-151,150,181,160,148,137, 49, 99,202, 72,180,185,153,172,201, 40,226,191,213, 90,168,230,179, 79, 60, 61,172,251,204,243,226,136,
- 83,193, 82, 43, 68, 56,177,117,113,174, 73,167,213,149,184,228,236, 54,107,138,139,205,248, 76, 25, 51,219,233,205,155, 52,154,
- 55,105,252, 88,242,141,118,109, 4,146, 20, 33,207, 96, 39, 4, 1,248,108,242, 68,124, 60,113,156,127, 90,102,238,247,107,215,
-254, 50, 51,250,180, 48,199,164,125, 56,171, 34,155, 36,225, 84,129, 84, 50, 26, 42,185,147,184,168,100, 52,172,118, 14, 4, 1,
-202, 35,184,133,142,112, 42,185,153, 5, 41,229,206,192,159,179,233, 21,220,232,236,233, 68,117,253,194, 93,133, 87,146, 50, 99,
-231,222,188,155,115, 13, 64, 65, 80, 71,143,209, 14, 86,128,209,202, 34, 41,199, 12,214, 33, 16, 99,122,133,160,246, 96, 34, 98,
-254,198, 91,155,143,223,133, 91,169, 78,255, 57,155, 25, 87,247, 88,189, 27, 15, 28,186,124,213,186,235, 75,230,125, 75,229,233,
-236,224, 5, 1, 50, 9, 5,185,132, 46,254, 80,176,152,116, 88,251,243,175,217, 44,136, 65,184,112,129,173, 74,251, 4, 47,188,
- 55,176,119,199, 29, 4, 32, 33, 72,113,122,141,144, 90, 33, 93,251,190, 47,235,218,111, 36, 56,214, 62,253,230, 37,225,156, 57,
- 55,238,172, 43, 54, 27, 55,108, 0, 2,184,101,202,141,159, 8, 0, 74, 77,248, 47,245, 35,234,183,124,241, 90,221,186, 17, 45,
- 93,169,247,167, 74,169, 76,253,137,167,151,239,183, 17,141,154,107,114, 10,109,132,218,187, 38,146, 30,221,198,246,159,191,223,
-194, 91,237,179,207, 30,221, 53,111,197,134,253,239,118,141, 26,136,141, 63,253,107, 70,126,214, 83,162,117,166,148, 90,245,222,
-166,223,214, 7,137, 36, 82, 48, 44, 15,134, 19,156,223, 44,135,130,130, 66, 48, 44, 15,153, 66, 13,150, 39,192,112, 60, 24,150,
-135,205,206, 42, 39,142,124,251, 35, 43,240,119, 89,233, 12,172,223,233,164, 88, 42, 13, 17,224, 60,187, 86, 16, 4, 36,101, 91,
-200,128,128,128,109, 0, 32,149, 74, 33,149, 74,193,243, 60,110,198,105, 63,241,137, 8,159,132, 98,130,199, 57,236, 41, 69,201,
-127,246, 44, 47,239,254,254,254,125, 95, 36, 89, 86,171, 21, 70,163, 17,151,174, 92,119,255,109,243,158,168,164,148,244, 48, 94,
-112,183,169, 53, 97, 61, 13,185, 79,250,150, 87,158,134,156,184,143,220, 34,199,145, 95,124, 60,186,238,170, 77, 71,174, 61, 62,
- 57,183,194, 56,173,218, 93,191,182,127, 49,225,157, 86, 11, 87,110,120, 84,248,231, 47, 83, 43,171, 35,154,166, 69, 90,173,246,
-233,251,189,250,215,237,173,110,197,101, 12, 88,177,124,133,236,230, 19, 3,238, 37,101, 98,116,183, 96,231, 12,199,133,122, 87,
-250,133,249,132,214,169,179,109,237,202,133,244,163, 76, 43,214,236,187,134,232,131,191, 92,202,206,253, 59, 10, 57, 89,150, 87,
-233, 67,254, 1,162, 85,174,205,115,119,243, 96,180,178,176,217, 89, 48,188, 0,189,153, 65,110,145, 29,122,179, 3, 70, 11,139,
-209,221,131,203,124,174, 18, 62,226, 75, 16,196, 17, 65, 16,250, 8,130,208, 13,128,164,228,183,115,204, 38,142, 20, 19,178,231,
-126, 79,159, 62,253,155, 5, 11, 22,196,150,220, 91,114,189,228,222,138,174,151,122,222,123,198,140, 25,141, 23, 46, 92, 56,191,
- 93,187,118, 59,254,250,235,175, 68, 0,133,174,186, 15,233,210,153, 57,114,228, 72,101, 5, 29,230, 96, 28, 82, 55,185, 8,161,
-181,131,241,193, 55, 27,125,254, 88, 56, 54, 87, 38,161,169,227,199,143,123,229,219, 85, 32, 73,202,229, 41,138,202,183, 94,123,
-177, 88,114,116,233,210,165, 24,214,183,131, 60, 53,143, 49,222, 77,181,228,152,236, 96, 53,190,225,146,185,243, 23,170, 22, 46,
- 90,252,241,145, 67,124,145, 49,231,254,226,178, 93,124,173,110, 80, 68,169, 24, 44,130,128,192,115,233,133,201,215, 91, 1,192,
-235,196, 98, 25,173, 12,168,226,216, 26,130, 0,204, 86, 22, 20, 69,228, 22,197,237,186, 63, 98,206,220, 46, 91,118,156,206, 20,
- 72, 15,131,201,148,164,128,243,204,193, 42,195,106,231, 96, 99, 56,196,222,185,137,142,145, 13,209,190, 85,125,152,173, 28,204,
- 54, 22,181,235, 68, 0,128, 79,153, 21, 71,145,137, 2,199, 88, 5,129, 83,247,105,237, 11,141,135, 4, 1,158, 82, 72, 37, 52,
- 24, 22,176,216,121, 88,237, 28,146,115, 45, 48, 88,228,104,210,105, 72,168,119,192, 13, 91,118,178,252, 64, 65,234,141, 65, 21,
-146, 83,142,195,166,109,123,234,102,102,230,244, 63,118, 96,171, 84,171,103,112, 55,217,132,220, 34, 27, 64,249,226,135,249,107,
-164, 95, 79, 29, 63, 96,211,246,189, 41, 93, 59,180, 77,169,106,158,205,218,184, 45,187,118,239,249,165, 79,159, 1,242,216,191,
-143,225,209,237,179,243, 76,185, 85,138,207, 34,155, 53,107,198,142, 31, 63,222, 48,127,254,252,160, 67,135, 14,213,214,106,181,
-183, 1, 48, 30, 30, 30,245,195,235,134,220, 57,117,226,120,224,219, 3,134,136,210,243, 44,112, 87,136, 17,162, 81,224,202,165,
-147,140, 68, 34, 42, 51,222,164,216, 61, 56, 28, 93,191,194,161, 43,137, 81,177,249,178,243,227,198,142, 78, 57,117, 49, 46,127,
-245,230, 83,255, 10, 84, 49,183,101,188,118,245,141, 86,117,252,167, 79, 30,137, 5,171,182,224,194,205,184, 92, 19, 25, 48, 47,
-203,198,158, 46, 95, 74, 7,104,138,128, 90, 46,130, 73,175,213, 37,220, 58, 17,254, 15,201,212,163, 79, 29,216, 66, 22, 24, 24,
-164,229, 89,137,204, 2, 3, 56, 94,128,135, 66, 12,150, 23, 80, 84,144, 71,108,221,178, 25,215,175, 95, 33, 65,145, 31, 2,152,
- 85, 97,129, 18, 78, 87,161, 74, 38,114, 42, 66,114,231, 55,195,241,136,168, 91, 7,235, 87, 47,115,243,209,248,225,205,142,174,
-199, 70,171,189, 67,154,237,248,125, 53,206,255,117,235,173, 11, 43,214,180, 86,213,240, 93, 69, 16,220, 18, 8,176,218, 28, 28,
-116, 69,133,144,216,211,208, 38, 80, 11, 47, 5,135,100,125, 0, 98,178, 31,169, 42,235,240,243, 99,246,223, 38,132, 1, 51,247,
- 28,142, 94,208,179,251, 91,136, 73,214, 67, 46,161, 33,147, 80,144, 73, 40,136, 8, 14,203,126,254,133, 41,212, 25,250,228,199,
- 30,204,123,133,246,121,166,120,246,235, 36,119,156,209,119,203,170,153,127,140,251,106, 81,207,168,129,239, 19, 49,215,207,125,
- 99, 6,206,186, 54,209, 19, 92,186,198,243,174,143,113, 50,181,207,202, 41, 95,207,157,210,163,207, 16, 80, 20, 13,134, 97,255,
-137,233,136, 0, 0, 32, 0, 73, 68, 65, 84,176,119,231, 22,252,190,230,135,135,118, 99,254,251, 0,120,123, 46, 53,126,215,150,
-159,135,124,245,253, 50,162,113,179, 54,109,207,101,189,124,188, 39, 79, 17,235, 70,141,157, 48,212,207,207, 79,253, 76,209, 18,
- 16, 30,209, 16,189,251,189,131,147, 7,247,227,126,236, 93,240,130,147, 48,241,188,128,162,194,252,108,150,177,111, 42,215,227,
- 33,147,133,108,252,125,115, 61,146, 36,158, 30, 32, 63,245,163, 15,236, 19, 63,251,230,205,222, 61, 58,197, 74, 40,232,147, 83,
-179, 60,174,220,122,208,132, 23,169,130,198, 78, 91, 38,182,218, 56,232,204, 12,142,109, 40,159,235,200, 60,131,219,213,106,217,
-123,236,196,239,214, 75,165, 20,233,104, 20, 30,148,216, 41,178, 81, 90,112, 13, 31,195,143, 11,215,180,185,252,247,173,222,239,
-142, 24, 43, 27, 93,191, 37, 81,195, 91,174,254, 96,196,192,166, 28,235, 24,101, 46, 72, 43,119,127, 65,145,194,179, 40,184,118,
- 93,243, 51,197, 40,124, 31, 33, 32,244, 57,230, 65, 32,209,146, 19, 63, 8, 0, 2,106, 4, 91, 69, 82, 55, 67, 21, 20, 24, 1,
- 0, 86,253,186,189,213,157,248,204,113,203,151,175, 80,220,124, 98,192,237, 39, 58, 72,197, 36, 28, 12, 15,194, 69, 81,155, 23,
-168, 9,223,206,152,238, 86,104,226,112,254,174, 22,177, 55,206, 9,118,163,117,132,130,117, 27, 4,141,122, 20,128, 58, 0, 18,
- 8, 66, 88,103,202,241, 63, 8, 92,168,242, 65,167, 60,239,156, 47,187,249,134,133,114,180,180,183, 72,162,108, 71, 16, 66, 35,
- 66,128, 39, 32,100, 20, 20,143,169,174, 50, 53, 83, 78, 60, 22,205,255, 30, 43,127,219,143,204,124, 43,220,185, 52, 28,220, 48,
- 23, 95, 44,216, 6,139,173,252,168,134,202,248, 72, 89,196,232, 69,194, 85,242,119,201,125, 11, 22, 44,232,243, 66,221,244, 41,
-167,206, 94,186,175,228,249,133, 11, 23,206, 47,245,239,102, 87, 73,214, 83,162, 85,146,169, 74,200, 86,184,111, 64,200, 95, 7,
- 15,236,243, 44, 52, 58, 32, 19, 83, 8,174, 93, 23,179, 86, 31,244,237,213,202, 7,121, 14,119,108, 95,191,164,192,106, 54,236,
-116,169,179,208, 68,180,149,171,148,199,246,237,221,143,176, 96,141,120,235,165,130,164, 91,137,150,167, 82,175, 94,155, 34,169,
-237,102,166, 7, 13, 28,168, 56, 27,125,238, 51, 35, 80, 38,209,162, 8,170,230,175,155,247,106,212,114, 17, 8, 2, 48, 88, 88,
-140, 27,245,206,235, 15, 99, 2, 79,141,125,127, 52,136, 98,146,165,207,207,198, 55, 95,127,100, 85, 50,143,238,167, 38,167,102,
-116,235,251,197, 89,189,145,176, 14, 29,249,209,245,251,241, 11, 10,205,230, 87, 59,228,199,102,231, 96,115,240,120,242, 36, 1,
- 83, 71,119,135,136, 34, 65, 81,188, 51, 88,154, 45,191, 49, 26, 51,227, 11,224, 47, 30,188,101,233, 39,191,214,240,211,120,171,
-148,114, 65,165,144, 18,141,234,215, 19, 71, 70,182,151,212,142,104, 42,190,244,192,130, 84,173, 5,137,153, 58, 72,253,154,211,
-195,186,244,194,150, 21,211,222, 42, 72,189, 65,226,229, 32,197,231,112,250,252,213,190,191,253,188, 92,154, 83,228,192,195, 84,
- 35,178, 11,173,200, 42,180, 33,187,192, 10,149, 92,132,142,253,198, 75,143, 30, 92,215,183,107,135,182,171, 94, 37,223,137,137,
- 73, 71,147, 51,178,134, 52,109,209, 6, 91,254,248,189,131,135, 71,109,183,162,162, 36,189,171,181, 51,119,238, 92,201,194,133,
- 11,233,213,171, 87,235, 35, 35, 35,253,103,204,152,209, 51, 55, 55,247, 90,173, 90,181, 34, 78,238,219, 20,221,188, 99,255,214,
-224, 29,190, 29, 58,117, 22, 75,121, 26,167,142, 28,113,236,218,185, 53,223, 98, 49, 76,172,144,112, 40,220,231,230, 24, 9,248,
- 6, 6,198,170, 36, 92,119,154, 44,138, 47, 60, 49,101,115, 33,176, 47, 44,106,242,153,115, 55,226,226, 91,221, 76,214, 68,223,
-124,156, 91, 96,118,132, 63, 57,241, 69,133, 29, 47, 69, 16, 16, 81, 36,212,114, 26,100,113,175,170,170,209,244, 49, 8,194,183,
- 68, 57, 37, 64, 20,127, 3, 4,129,204,194,212,219, 46,196,108, 16, 2, 47, 0,113,233, 38, 24,173, 78,105,190,166,143, 2,218,
-156,116,252,180,106, 19,110,221,184,142, 30,189,250, 97,237,175, 91, 49,110,212, 16,107,101,179, 31,146, 44, 86,180, 74,169, 89,
- 42, 57, 13,128, 64,145,137,193,222,203,105,168, 19, 74,186, 60, 48, 0,128, 90,165,128,206, 96, 1, 41, 86, 35,225,230, 49,197,
-241,115,127,207,152, 57,103,249,151,133, 89,119, 83, 31,223,187,132, 8, 31, 29, 66, 3, 29,136,205,118,195,141,252,218,136,168,
- 27, 6, 82,124,221, 37,219,121,177, 77, 22, 29, 36,247,246,105,213,188, 97,187, 16,141, 7, 44,118,174, 88,213,162,240,251,198,
-205, 72, 78, 74, 31,155,127,255,224,173,127,130,209,154,114, 19,181, 82, 77,221,143,239,253,125, 54,113,224,136,143, 17, 16, 24,
-220,172, 40,245,182,139,131,151,107,164,138,115,145,104,137, 21, 30, 51,166,126,251,175, 41, 61,222, 30,140,171,151,206,226,118,
-108, 2,218,182,109,141, 94, 3,134,193,160, 47,168,191,123,243,138,238,172,217,112,146,150,178, 83,218,180,239, 66,240, 28,135,
- 71, 15, 99, 18,202,178,101,201,138,187,125, 37, 43,206,237, 57,247,148, 79,253,102, 42,119,175,219, 54, 7,135,140,140,116,252,
-249,215,249, 22,150,172,184, 42,109, 32, 44, 21, 83, 56,117, 43, 23,142,226, 51, 76, 59,118,234,110, 23,147,182, 14,243,150,111,
-140,204,202,204, 34,149,110, 62,188, 87, 96, 3,113,128,212, 97,187,243, 68, 39,118, 48, 60,194,106, 40, 43,180,233, 91,163,238,
-252,105,211,166, 54,160,196,114, 24, 76, 54,123, 86,102,134,255,250,237,231,140, 15, 30,222, 11,172,169,113,119,251,215,138,117,
- 98,189,149, 64,174,206,134, 2,131,158, 24, 49,225,171, 26,191,173, 89,240, 94, 69, 68,171,140,112,145,208,163,167, 46,213,247,
- 84,139, 9,163,149,229,243,245, 14,110,196,128,215, 91,116, 89, 76,178,198, 47, 95,182, 66,113,235,137, 1,119,158,232, 32, 19,
- 83,144,136, 73,216, 25, 30, 46,190, 78,164,191,198,127, 98,251, 86, 77,112,242,118, 30, 40,138,132,197, 80,104,166,145, 31,223,
-234,173, 30,138,150,109, 34,209,249,173, 78,120, 28, 31, 23,124,228,208,222,174, 87,254,188,144,205, 58,194, 63, 49,105,227,247,
- 87, 73, 88, 48,155, 41, 70,226,255, 65, 64, 96,173, 55, 6, 13,251,192, 61, 36, 56,144,208,248,120,131, 21,104,140, 31,245,142,
-203,111,190,147,152, 3, 11,231,204,128,205,102,135,175,135, 4,130, 0,108, 92, 53, 11,118,187, 29, 53,188,165,208,153,202, 63,
- 77,174, 50, 62, 82,158, 10, 85,165,216,147, 82,100,172,162,235, 4, 65, 28,153, 62,125,250, 55, 0,132,233,211,167,127, 83,242,
-123,193,130, 5, 22, 0,153,149,184, 14,215, 63, 71,180, 74, 50, 87,254,219, 45,142,240,241, 14,184,114,234,228, 9,247, 3,119,
-120, 92,221,127, 3,111,183, 13,128,152, 38,161,112,175,129, 59, 73, 58, 28,221,247,115,209,193, 29,235, 50,108, 54,219,226,202,
-125,205,117, 91,169, 20,202,147,127,108,217,201,251,120,123,147, 63,157,210, 62,201, 55,176, 79, 93, 90,241,127, 31,226,111,156,
- 92, 31, 32,128, 56, 33,147,201,234,218,237,118,207,202, 42,118,227,169,148,226, 32, 94,226,159,232, 91, 65, 80, 20,183,101,235,
- 22,248,184, 73, 96, 99,120, 76,255,242, 83,203,232, 30,170,162, 17,239, 14,235,210,185,247,148,104,145,178,222,217,246, 45,234,
- 9,205,155, 55, 47,162, 40,202,165, 80, 10,141, 70, 51,139, 36,201,225, 18,137, 68,109,183,219, 13,118,222,170, 48, 89,237,176,
- 58, 0,179,217, 10,145,216, 73, 22, 69, 20, 1,139,213, 14,179,197, 94,241,139,145, 29,115, 25, 64,184,190,148,166,116,246, 65,
-152,100,219,238,131,159, 14,126,119,232,204,192,102, 3, 84, 73, 89, 58,136, 9, 7, 90, 55, 8,192,185, 19,251,133,244,228,248,
-169,149,145, 44, 0,200,213, 22, 4,249,250,250,225, 86,162, 17, 25,249, 22,100, 23,147,172,172, 66, 27, 12, 22, 3,154,134,212,
- 64,145, 78, 23,244,202,229, 11,236, 63,121,242,228,144,222,253,135, 98,202,151,179,223,220,240,243,146,187, 74,137,104,140, 41,
-231,209,121, 87,136, 86, 76, 76, 76,193,215, 95,127, 93,231,215, 95,127, 37,223,123,239, 61, 75,147, 38, 77,100, 35, 71,142,124,
-115,243,230,205, 50,133, 66,102,185,115,233,208,204, 15, 39, 79,239,191,126,229,220,102,133,133,133, 4,203, 48,199, 29,133,133,
-211,141,149,144,185,180, 67,223, 60,252,225,137,227,253,238, 29,124, 15,121, 41,200, 70, 82,193, 62, 12, 13,102,237,196,131, 89,
-142, 39, 39, 86, 27,228, 67,150, 78,206, 44,226,191,181,146,154,121,149,145, 44, 0, 32, 41, 2,118,150,131, 90, 46, 2, 73,146,
- 37, 36, 62,224,247,157,199, 21,190,238, 18,136, 40, 18, 52, 69, 64,111,102,144,167,119,224,227, 15, 92,221, 33, 68,224, 89, 78,
-128,197,206,194, 92, 60, 59, 52,232,243, 48,227,203,207,209,171,239, 64,124, 56,241,115, 20, 90,128, 27,137, 6, 56, 24,166,210,
-151,130, 36, 72,152,109, 44,198,244, 8, 65,129,209, 1,147,133,133,157,229,161,144,208, 16,209, 36,148, 50, 26,110, 10, 17, 32,
- 8,226,146,206, 68, 36, 18, 89, 25,134,217, 82,193,140, 30,181,131,252, 96, 97, 72,180, 25,186, 4,221,218,133, 35,246,242, 94,
-250,194,213,123,161,159,125,249, 45, 62, 29,215, 23,123, 30,214,129,151, 38, 4, 42,165, 28,140, 64, 2, 16, 92, 12,216,155,197,
-147,142,129,195,127,249,117, 99,220,143,223, 79,151, 21,153, 8, 72,197, 20,162,207,158,193,149,191,111,172,204,187,127,112, 11,
-254, 65,136, 4,210,207,205,205, 13, 50, 9, 5,187,195,102,119, 61,116, 65,128, 0,180, 80,106,194,127, 41,158,241,183,224,120,
-148,113,173,114,162, 69,203,220,166,127,242,229,143,243,123,188, 61, 24,167,142,236,193,238, 61, 59,185,118, 81, 99,169,173,191,
-255,140, 55,187,245,195,155, 61,134,226,248,254,205,159,155,120,162,225,248, 41, 51,231,116,236,210, 27,167,142,238, 65, 78,118,
-250, 82, 87,211, 75,137,136, 41, 93,186,247,133,213,206,161, 67,215, 62, 56,113,120,255,100, 20, 47,178,112,125, 16,123,161,127,
- 6,201,126, 62,117,138, 40,183,200, 46,210,234,237, 72,215,154,145,148, 99,198,193, 29, 27, 4,215,251, 11,123,235,142, 77,107,
-138,198, 47,138, 78, 11,170, 25, 96, 19,217, 44,242,248,132, 39,245, 63,252, 96,180, 40,180,110,125, 50, 87,103,131, 86,103, 67,
-158,206, 6,163,149, 69,221,154,245, 72,134, 37,218, 85,181,158,125,220, 37,162,181,135, 19,225,166, 20,161,125,253, 87, 95,104,
-203,243,252, 51,146,181,220, 73,178,238, 38,234, 32, 21, 83,144,138, 73, 72,197, 20, 88, 78,112,105,226, 34,215,132,247,254,248,
-147,143,106,216, 89, 32, 95,103, 7, 77, 17,208,248,120, 42, 91, 55, 27,142,141, 75, 38, 3, 0,198,125,253, 19, 62, 28, 51, 18,
- 13, 26, 53, 65, 81, 97,161,255,240,193,189,151, 3,216,239,106, 90,143,157, 58, 31,124,234,226,173,175, 63,158,246,131,234,221,
-190,157,169,219, 79,116,200, 42,176, 33, 33,222, 80, 37,229, 13, 0, 88,142,135, 0, 1,155,118, 30,129, 92, 66, 67,171,115, 64,
- 16, 4,204, 93,189, 11,106,185, 8, 89,133, 78,119,127, 69,168,144,143, 84,160, 72, 85, 65,109,236, 3,103, 44,151,175,171,138,
-214,130, 5, 11, 98, 23, 44, 88, 80,166, 66, 86,138,100,189,218,161,210, 98,177,178,190,155,183,207,213, 83, 39,142,169,247,223,
-225,112,238, 78, 62, 6,119,168, 9, 99, 65, 42, 22,127,249,110, 1, 1,193, 78, 82, 84,145,205, 98,222,103,177,152,230, 1,112,
- 84,216,104,252,195, 91, 40,101,170, 51,107,215,255,193,250,104, 52,216,114,169, 32,189,208,196, 50,207,220, 86, 12,113,227,228,
-250, 80,150,103,162,172, 57,143,175, 87, 54, 19,231, 5,136, 23,252,124, 16,128, 0,158,231, 33,240, 60, 68, 50,149,210, 39, 44,
- 50,167,184,163,147,209, 36, 97, 45,221, 3, 8, 60,155,158,151, 88,177, 12, 74, 0,112, 87,136,176,243, 66, 6, 0,228, 80,134,
-155, 15, 70,188,235,116, 23, 90,237, 50,125,163, 58,117,132,214,173, 91, 23,201,229, 46,109,127, 69,249,249,249, 93,155, 57,115,
-102,253, 15, 63,252, 80, 42,145, 72,192,178,172,215,186,245,235,249,245,243,198, 97,208,228,181, 16, 75,164,176, 88, 29, 16,137,
-104, 20,234,140, 40,210,155, 97, 48, 51, 85,111, 65, 79,158,216,181,192,162, 3,251, 37, 3,123,170,154,182,145,144, 98,180,140,
- 8,192,185,147, 7,132,171, 39, 54,142,179,228,198,255,225, 98, 67,132,209,202, 32, 51,223,138,140,124, 43,178, 11,173,200, 46,
-176, 33,187,208, 10,130, 32, 96,181,179,175, 53,112,153,114,227,118,111,249,227,183,126, 54, 7,134,117,236, 49, 16,159,255,176,
- 54,100,203, 47, 11,207, 36, 10,228, 27, 46, 6,218,114,177,177,177,201, 31,124,240, 65,179,237,219,183, 83,141, 27, 55,182, 60,
-120,240, 64, 81, 76, 34, 29, 42,149, 66,190, 97,205,130,147,109,218,180,217,153, 17,255,240,108,177, 63,189,210,142, 61,164,211,
-251, 82,185,227,214,248, 96,101,251,158, 97,254, 10, 4, 43, 13, 61,235,171,238, 44,206,239,242,233,124,109,244,202,220, 44, 27,
-123, 90,107,161,154,103, 24, 69, 46,197,224, 49, 54,107,202,160,193,195, 64, 17, 36, 28, 86,115, 74, 73,227,210,184, 75, 48,107,
-235, 67,168,100, 34,168,229, 52, 84,114, 17,222,108,232,133, 42,244,103, 2,195,241, 48,219, 56, 88,108, 44,172,118, 22, 62, 65,
-158,248,117,203,110,164,230, 90,112,240,122, 30,226, 82, 12,168, 87, 83, 9, 65,168,188,155,228, 57,198,212,247,157,247,212, 20,
- 73,128, 34, 9,178, 97,253,112, 20, 24, 29, 16,211, 36,196, 50, 57,148, 82, 26,110,114, 17,196, 98, 17,114,115,115, 97,179,217,
- 16, 28, 28, 44,171,152, 10, 10, 80,171,228,168, 23, 90, 3, 14,134,197,177,139,247, 49,111,234, 32,116,239,216, 10,132, 72,133,
-135,182, 22, 80,123,169,193,147, 36, 28, 44, 15,187,131, 3, 64, 90,203,179, 23, 20, 20,212, 69,169, 84, 42,205,102,179, 33, 53,
- 53,245,124,118,220,254, 84,142,234, 63,254,196,169,232, 45,125,122,117,199,173,187,177,216,179,255,208,165, 60,111,221,180,146,
-103, 26, 53,106, 20,233,227,227,163,202,207,207,215,199,196,196, 92,123,213,121,129, 64,146,159,181,123,243, 45, 24,139,114,145,
-147,150,228,242, 44,186, 65,136, 26,223, 45, 88,219, 50, 34, 60,162, 37, 39, 56,137, 87,195, 96, 53,190,248, 97, 85,203, 58,245,
-194, 91,150, 44, 8,105, 16, 92,241,182,108,180, 66,221, 99,212,135,159, 47,232, 55,248,125, 68,159, 58,132,101,243,190,220,162,
-116,247,109,224,229,233,222,188,113,100, 15, 92, 58,115, 8, 50,181, 63, 60,189,253,223,124,111,204, 39,221, 6,191, 55, 1, 87,
- 46,157,193,202,133,223,108,230,108,134,109,174,164, 85,169, 9,245,109,214,162,205, 8,181,151, 31,138,116, 6,168, 61, 53,104,
-208,180,245,136,251,119,108, 95,155,114, 19,181,175, 76, 58, 4, 1, 54,135,128, 66,163, 3,105, 90, 11,146,179,157, 68,139,231,
-171, 16, 19,196,241,132, 74, 70,211, 94,204,227,224,123,103,162,133,144, 32, 63, 98,209,156, 47, 41, 7,100,208, 22, 57, 73,150,
- 86,111,135, 86,103,135,209,202,192, 75, 73,131,231,248, 42,207,186, 11,141, 14,168, 21, 34,184, 43,196, 46,171,140,101,225,231,
-223,119, 70,220,137,207, 28,176,108,217, 10,197,237,196, 82, 36, 75,228, 84,179,164, 98, 10, 28,207, 3, 46,188,241, 34, 90, 52,
-165,127,239,110, 72,203,179, 56, 87, 45,147, 4,234, 53,105, 3, 31, 57,143,174, 67,167, 3, 0,250,246,118,134,182, 37,102,153,
-112,248,170, 22,120, 62,176,187,226,190,216, 98,161,214,111, 61,250,217,238, 93, 59,220,173, 28,141,117,199,147, 97,182,177,144,
-137, 41, 72,197, 20,228, 98,234,185,120,236,202,137,150, 51,230, 46, 53,143,129,217,106,133,222,194, 64, 0,112,237,177, 17, 22,
- 59, 11,157,137, 65,100,125,207,215, 19, 66, 8,226,168, 32, 8,111,191, 72,136, 94, 36, 75,165, 20,169,178,108, 92, 47,109,163,
-228,254,242,136, 92,233,152, 45, 0, 85, 90,193, 69,191,200, 28, 75,255, 22, 43, 61, 27,184,171,221,175,158, 56,126, 68,181,255,
- 14,143,243,119,157, 36,139,177,228, 97,233,215,195,211,245, 69,121,157, 1, 60,113,245, 63, 83,248, 52,104, 42,147, 72,163,255,
-181, 98,157, 67,227, 23,200,239,187, 90,148,171, 51,115,207,177, 9,206,102, 35, 5, 94, 16, 91,115, 30,187,228, 67, 32, 73,194,
-241,195,228,129,224, 5, 1,179, 86,236,198,252,105, 67,161,146,191,167, 32, 8, 66, 97,178,178,152, 58,251, 55, 44,253,110,172,
- 90, 33,165, 65, 16,206,152,168, 81,195, 6,186,214, 0,173, 44, 18,254,222,110, 52, 36, 30,121, 80,218, 93,216,246,205, 94, 55,
-218,182,109, 91,228,233,233, 9,185, 92,254, 76,169, 40, 7,126,126,126,223,253,240,195, 15, 17, 19, 39, 78,124,186,217, 39, 77,
-211,248,248,163,143, 72,142, 19,112,252,248, 70,248,214,106,129, 67,167,175, 34,170, 75,107, 24,205, 86, 20, 20, 25,192,131,122,
-229,134,104, 40,202,139,206, 78,190,215,230,141,206,125,113,254,228, 1,225,234,241, 13,227,170,178, 71,143,167,151,103,218,205,
-123, 9, 13, 8,194,203,169,104, 21,147, 44, 59,195, 35,196, 79,129,180,228, 4,120,184,187,167,185,106, 79,238, 27,209,159, 32,
-133,137, 4,132,141,166,156, 71,187, 1, 8,166,172, 7,195,119,111, 91,127, 55, 54,230,246,188, 62, 35,166,208, 61, 6,127, 68,
-253,178,224,147,111, 0,184,186,241,158, 35, 46, 46,238,254,216,177, 99,219, 95,185,114,133, 3, 96, 38, 8,130,161, 40, 74, 97,
-183,219,197,157, 59,119,214, 61,124,248,240, 60,202, 14, 90,124, 14,111,126,176,219,135,144, 26,122, 73,120,199,240, 16,181,161,
-123,231, 14,237,208,174, 81, 16,210, 58,180, 3,128, 41, 41, 70, 85,132,181,206,111, 59, 25, 86,126,236,151,223, 15,207, 31, 55,
-180,219,212, 45,244,172,101, 89, 71,102, 85, 24,136,154,246,224, 66,207,178,104, 60, 77,145, 80,203, 69, 80,201,105,168,229, 34,
-168,101, 34, 48,172, 80,149,153,163,192,176,188, 83,209,178,179, 48, 90, 88, 68,223,206, 65,182,206,142, 34,131, 3, 22, 7, 7,
- 1,130,115, 54,234, 66,111,174,125,252,167, 71,201, 72,234, 17,220, 66,183,126,245, 18,183,189,151,211,159,174,232,115, 87, 72,
-160, 86, 56, 87, 99, 95,188,120, 17,222,222,149,207,246,121,158,199,158, 19,215,176,108, 83, 52, 78,108,252, 10, 50, 49,133,166,
-253,103,227,253, 1,109,193, 11, 60, 18,226, 98,115,234, 53,108,230, 71,146,114,144, 4, 1, 27,195, 3, 16,202, 45, 79,187,221,
-238,157,154,154,170,175, 91,183,174,127,141, 26, 53, 6, 83, 20, 37,192,112,219,118, 96, 71,129,249,236,145,109, 10,147,197,198,
- 41, 88,221,198,186, 89,150,183, 81,183, 46, 8,130, 16,220,220,220,196,209,209,209,198, 38, 77,154,248,190,226,171, 68,202, 53,
-225, 43, 63,156,244,217,224, 58, 97, 97,216,189,109, 35, 4,129,216,235,234,195, 91, 15, 95,193,156, 25,207,175, 48,252,226,135,
- 85, 45,151,206,158,242,220,181, 73, 51,150, 85,184,234, 80, 46, 85, 77, 27, 52,124, 60,110, 92,251, 11,139,103,127,177,195,102,
- 44,120,159, 97,153, 33, 5, 89,137, 59, 66, 27,182,133,224, 48,224,212,174, 37, 24, 58,114,156,180, 71,159,193,184,114,233, 12,
-230,127, 51,105,171,185, 40,247, 3,184, 24,228,204, 11,162,137,157,123, 14, 16, 89,108, 14,172, 90,244, 61, 38, 76,155,135,200,
- 46,125, 69, 49,183,175, 78, 4,240,163,203,225, 16, 14, 14,157,155,248, 56,201, 51,195,227, 80, 34, 69,151,213, 2,105,138, 32,
-155,135,121,192, 98,103,161,175,100, 82, 73,139, 69,217, 69, 58,125,173, 53,243, 63,163, 76, 86, 22, 90,157, 29,185, 58, 27,242,
-138,158, 17,172, 60,157, 13, 90,157, 29, 34,154, 64,252,147, 20,144, 34,186,202,241,121,133, 70, 6,109,194, 61,157,239,232, 43,
-122, 71, 24,218,173,237,137, 11,119, 6, 45, 91,182, 92,118, 39,201,128,187,137,250, 98, 37,139,130, 84, 68, 66, 82,252, 55,199,
- 59, 99, 35, 43,130,155,111, 88,232,232, 81,239,117,117, 83,201,145,249, 40, 23, 52,229,220, 34,198, 93, 19, 4,119,169, 21,159,
- 76, 26, 15, 31,111, 15,164,230,217,176,114,127, 60,238,222,127, 12,222, 82,181,108,175, 90,183, 35,234,195,143,191,240, 32, 69,
- 18,108, 62,153,228, 76, 39,197,225,225,213,195,214,204,132,123, 38,163, 62, 95,128,192,185, 24,131, 76, 8, 44,231,108,110,243,
-103, 77,199,142, 77, 63,225,228,205,220,167, 45,240,242,222,165,248,108,198, 92,228,233,237, 40,171, 93, 86,196, 71, 0,104, 75,
- 41, 81, 47,253, 46, 69,142,202,250, 77, 20,255,182,151, 99,195,254, 2,185,178,191,112,221,254,130,189,178,246,254, 91, 95,169,
-235,240, 37, 82,228,225,219, 88, 33, 83,254,117,252,248, 97,229,129,187,194, 83,146,229, 48,231, 9,243,166,244, 77,215, 23,105,
-123, 84,137,100,249,214,107, 44, 85, 72, 47,204,156,187,210,230, 23, 88,139, 61,118, 91,159,111,176,114,236,203, 49, 8, 74, 78,
-233,238,107,165, 37,210,101, 34,139,253,251,188,188, 7,166,202,148, 39, 94, 16,112,228,239,108, 8,130,115,138,180,235, 98, 6,
-138,103,230,224,120,167, 91,229,244,237, 92,208,197,113, 40,174,202,223, 63,175,251, 73,255,118, 19,157,105,196,252, 89, 79,221,
-133,145,205,156, 74,150,155,155, 27, 60, 60, 60,160, 82,169, 80,153,235,144, 32,136, 81, 31,126,248,225, 75,179,255,220,220, 92,
-116,235,218, 25,171,127,250, 21,205,186,142,198,233, 63, 79,194,193,240,104,218, 48, 12,181,106,120, 34, 45,199,240, 74, 47,186,
-210, 47,226,227, 54,157, 7,124,243,102,151,190,136, 62,177, 79,184,122,226,247,241, 85,221, 8,241,237,110,237, 15,207,153, 51,
- 43,116,230,188, 53, 82,181,140,198, 3,163, 29, 36, 65, 32,196, 79, 1,111, 37,137,243, 7, 54, 91,135,246,109,239,242,230,120,
- 65, 65,129, 91,150,174, 94,175, 92,186,112,118,231, 27, 55,137,104, 99,102,124, 1, 0,152,115,226, 22, 61, 4,238,215,252,235,
-212,177,102,157, 6,194,175, 70, 88,247,196,156,135, 46,147, 13, 0,230, 39, 79,158, 36,206,156, 57, 51, 98,225,194,133, 2, 69,
- 81, 60, 0,233,138, 21, 43,204,143, 30, 61,186, 13,231,210, 92, 84, 54,216,116,237,222,104,170, 74,194, 69,122, 41,200, 70, 97,
-254, 10,180,107,228,244,138, 14,125,251, 77, 4, 5, 7,227, 73,182,185,121,129,153, 23, 25,237, 84,216,218,117,119,175,215,246,
-161,198,177, 22,251,125, 0, 7,171, 90, 63, 4,158, 5,200,151,168, 89,106,185, 8,188,179,173, 84,137,104,217, 28, 28, 44, 54,
- 14, 22, 59, 11,147,157,131,217,206,129, 23,156,239, 4, 65, 16,112,176, 60, 92,154, 54,191,208,246,221,188,124, 16, 86,155,128,
-155,194,153, 54,183,226,237, 30, 8, 0,222,222,222,208,104, 52, 46,169,162,118,135,243, 21,183, 51,252, 83,183,190,221,193, 66,
- 16, 4,196,199,199,125,149,156,152,216,191,110,189,186, 29, 27, 54,109,230,165,144,146, 0, 80, 46,209, 50,155,205,156, 90,173,
-214,120,121,121,145, 25, 25, 25, 79,201,115,221,230,157,217,253,251,246, 98,208,160,129,198, 7,215,238, 60, 93,226,110,177, 88,
-136, 55,222,120,195, 45, 40, 40,136,180,217,108,250,170, 86,147,210, 55,124,128,167,183,215,188, 81, 31, 76, 8,239,220, 45, 10,
-231,206,158,194,193,125,219,255, 48,107,227, 79,185,106, 36, 34,162,254, 75,171, 14,235,212, 11,127,105,213, 97,173,208,122, 21,
- 18,173,134, 77, 91,183, 21, 8, 26, 39,143,236, 18,172,164, 99, 18, 0,158,179, 26,118,237,252,249,187, 31,135, 79,156, 81,167,
-119,191,225, 24, 53,242,125,208, 52,133,243,167, 15, 99,233,236,207,143, 26,117,185,163, 93, 9, 19,112, 74,111, 13,196,129,242,
-160, 79,131,235, 52,198,205,171,151,144, 16, 31, 19,123,231,250,149, 70,117,155, 68,194,183, 70,200,167, 41, 62,212, 66, 60,120,
-224,168,204,140,221,106, 77,121,127,244, 72,148, 94,117,216,174, 69,132, 55,241,226, 11, 0,192,108,200,117,108, 88, 50,245, 81,
-201,170, 67,222, 97, 79, 41,207,174,174, 80,187,231,252,159,127, 79,235,255,118, 20,153,167,183, 59, 21, 44,157,189,248, 99, 67,
- 94,201,223,122, 27,234,213, 80, 33, 46,246, 38,111,213,229,237,173,226,123,105,125,127, 72,207,251, 37,109,151,231, 5, 16,128,
-181,202,110, 41,145,219,248, 69,139,151,201,238, 36, 26,113, 55, 73,239,116, 21,138, 40, 39,193, 18,145, 79, 73,151,115, 53,123,
- 37,234, 16, 65,205, 31, 51,122, 24,242,244, 14,240, 60, 64, 83,100,241, 71,140, 84, 3,129, 52,131, 25,121,133, 90, 36, 38,167,
-160, 40, 59, 1, 36, 73,194,167, 70,184,203, 59, 73,115,130, 36,192,108, 23,154, 12,126,187, 35,189,239,175, 44, 40,164, 52,108,
-134, 28, 28,223,185, 68,107, 51,234,231, 89,204,198,125,174,236,231,248, 44, 4,129,208,234,141, 86, 63,169,136,194,238, 77,107,
- 48,228,253, 73,207,245,190, 95,125, 59, 7, 32, 9, 20, 20, 26, 64, 16,132,182,106,253, 18,113,189,162,223,175,168,140,189,182,
-141, 50,200,214,203, 19,133,242,103,163,194,241, 83, 39, 14, 43, 47, 39, 75,113, 45, 46,171,152,100,105,249,185,147,223, 78, 55,
-232, 10,122, 2,136,175,218,188,144,236, 57,116,204,180,216,176,240,134,182,115, 49,198,164, 34, 19, 83,110,156, 67,187,193, 51,
- 99,111, 28, 93,221, 91,199, 60,249, 72, 25,208,144,227, 89,118,145, 69, 27, 63,187, 28,215,161,100,246,202,221, 79,221,134, 95,
- 47,220,236,252,155,227,192, 9, 60, 4, 30,248,228,187,159,193,242, 28,120,142, 3,207, 9, 96, 56, 65, 81, 89,114, 53, 53,106,
-237, 43,124,184,171,254,136, 31, 95,118, 23,122,120,120,192,219,219, 27,222,222,222,112,115,115,171,148,104,137, 68, 34, 21, 77,
- 63, 95,212, 41, 41, 41, 72, 78, 78,134,155,155, 27, 4,158,129,157, 1, 26, 71,246,192,189,132, 24,156,185,124, 27, 2,207, 65,
-169,170,250, 41, 47, 74,191,136,143, 90,191,213,127, 77,151,126, 99,113,122,223, 58,225,250,197,195, 19, 44,185,241,191,185,172,
-208,115, 28,193, 48, 12,222,238,241, 86,202,173,216,199, 39,190,157, 54, 49,170,125,159, 9,210,118, 17,129,176,218, 57,164, 39,
- 39,224,252,129,223,173,225,161, 1, 39,187,118,104,155,194, 48, 12, 56,142,171,116, 32,183,218, 29,121,148, 72,174, 28, 54,108,
-132,232,250,181,107,123,149,190,245,118,115, 4,121,135, 16,248,166,132, 32, 12,106,218,180, 1, 28, 12, 15,179, 89, 95, 88,213,
- 60, 27, 12,134,196,141, 27, 55,134,142, 30, 61, 90,209,176, 97, 67, 81, 66, 66, 2,150, 46, 93,154,111, 48, 24, 18, 93,181,113,
-234, 98,220, 10,154, 40,124, 84,162,104,165,190,217, 14,195,250,188,137, 29, 71, 47,227,252,165, 43, 72, 49,170,110, 27, 89,250,
- 64, 90, 74,166,173,145,151,126,111,191,118,181,168,221,155, 10,247,198,190, 53,253, 93, 65,144,158,202,187, 48,203,228,250,203,
- 13, 24, 44, 12,220, 20,206,253,158, 74,148, 45,138, 32, 92,102, 68, 4,144,120,233,202,205,198,173,234, 53,196,173, 68, 29,114,
-139,108,176,216, 88,240,188, 0, 30, 2,188,213, 18,200,196, 36, 82,147, 19,193, 11,142,164, 42, 14, 21,218, 78, 29, 59,209, 0,
- 1,130, 16,104, 17, 77, 67,128,115,127, 69,185, 92,110,212,104, 52, 46, 41, 90, 14,150,197,160,168,182,136,108,221, 20,253, 39,
- 56,247,204, 60,251,199,116,120,170, 68,216,177,229, 55,164, 93, 92,177, 37,180,221,196, 83, 49,247, 98,223,137,189,245,215,136,
- 94, 45,229,205,253,233, 76,113,121, 50,169,201,100,218, 11, 64, 34, 22,139,163, 58,118,236,232,181,119,239,222, 34, 31, 31, 31,
- 94, 34, 22,107,251,245,237,195,139,196,226,130,146,123,255,252,243, 79,209,132, 9, 19,212,133,133,133,169, 57, 57, 57, 87, 0,
- 48, 21, 79, 4, 35,186,129,196,118, 16,132, 76, 37, 87,164,212,174, 29, 86,163,117,100, 91,247, 1,131,134, 64, 42,145,226,244,
-169, 19, 88,181,124,225, 46, 99,214,131, 49, 85, 41,201,127,106,213, 97,122,106, 82,162,217, 98,107,210,184,213, 91,196,165, 83,
- 7,166, 56,224,179,156,146, 58,150,116, 27, 52,169, 78, 98,166, 17,171, 22,124, 5, 79,119, 37,146, 18, 30, 90, 30, 61,184,247,
- 51, 99,213,127,229, 50,201, 2,160,200,231,222,105, 55, 50,202,211,230,224,112, 49,250,168,149,103,249,168, 43, 23,142, 37,212,
- 12,111, 45,107,220,186,171,103,222,193,223, 6,153,129, 29,149,217,201,120,248,178,130, 43,216,139,146,206, 70,159,113,247, 11,
-105, 68, 17, 32,224,176, 89,161,125,114,157, 53,231, 60,212,235, 51, 98, 92, 90,133,155,159,134,239,102,252,240,175,143, 90,183,
-106,165, 20, 32,123, 78,193, 42, 33, 88,121,122, 59,124,212, 18, 88,244, 90, 60,186,126,194,106,214, 82, 21,238,119,198,218, 77,
-138,188,220, 28,201,179,112,134,248,200,138,238,207,203,205,145,176,118,147,162,242,161,142,130,155, 82,130,123, 73, 25, 79, 3,
-223,165, 34,103,108,150, 68, 68, 61,141,211, 42,233, 11, 42,193, 91, 98,153, 7, 50,242,173, 32, 32,128,231, 88,176,140, 29, 6,
-189, 30, 25,153,217,200,201,206,129,193, 80, 4,133,202, 19,141,155,183,129, 90, 41,195,157,243,187, 32, 8,130, 75,251, 26, 50,
-132, 40,162,117,100, 7,105, 76,178, 51, 22, 75, 38, 18,112,120,251,194,124,163, 62,183,131, 49,235,209,163,170,246,197, 44,199,
-157,185,123,255, 81,163,154, 1,181,137,219, 9, 58,108,249,117, 53,236,197,202, 38,195,112,136, 73, 53, 33,171,192,140,212, 39,
- 15, 4,158,227,206,224,255, 8,232,242, 5, 64,208, 77, 27, 55, 64,143,247, 6,224,167,159,126,198,147,196,100,126,222,148,222,
-169, 70, 67, 81,175, 42,144,172,110, 40,222,107,195,156, 19,183,200,226,217, 58,253,208,173, 2,210, 98, 23, 42, 12,240,145,249,
-134,160,195,152,165, 39, 45,134, 2, 9,103, 51,211,135,183,140,217, 94,150, 77, 39,131,134,125,222, 23, 67,161,146,211, 32, 8,
- 2, 37,238,194,181,115,198, 67, 33,117,250,150, 45, 54, 22,239, 77, 93,134, 45,203, 62,135, 0, 96,248,144,203,230,242,210, 9,
-231,217,133,159, 4,224, 90,205,148,228,220,140,110,125,191, 56,107,117, 72,109,125, 6,142,190,209,170, 85,171, 34,185, 92, 14,
-185, 92, 14, 55, 55, 55,120,122,122,194,195,195,163,210,188, 51, 12, 99,180,219,237,222, 18,137, 4, 60,207, 35, 41, 41, 9, 73,
- 73, 73,208,233,116,208,106,181, 48, 25,245,236,181,179,187,233,198,237,122,163, 70, 88, 19,132,212,107, 6, 17, 69,128,166, 73,
-156, 63,244,107,121,233, 44,155,100,117,234,183,182,107,255, 15,113,122,223,122,225,250,197,195, 19, 45,185,241,191,186, 90, 71,
-197,238,158, 59,131, 6, 13,106, 50, 97,194, 4,241, 15,211, 38,156, 60,122,234,124,252,238, 35,235,251, 22, 22, 22, 5, 9,130,
- 0, 15,119,247,180,161,125,219, 31,238,252, 70,235,148,179,103,207,242,219,183,255, 63,246,238, 59,174,234,234,255, 3,248,235,
- 14,184,131, 11, 92,246, 30, 38, 67, 92,160,104,166,162, 56, 83, 75, 83, 83, 83,115,102,206,242,167, 13,115,164,137,166, 86,106,
-238,180, 52,247,200,189,194,109,185, 35,149,139,226, 6, 4, 1,145, 61, 46,151,187,231,249,253,193,200,148,233,248,182,222,207,
-199,227, 62,224,194,189, 47, 62,235, 94,222,247,124,206,231,156,159,116, 28, 14,231, 70,117,153,165,111, 82,185, 91,126, 57,253,
-235,156,246, 29, 58, 98,253,230,159, 58,220,186,125,167,195,253,251,137,240,245, 15,192, 43,245,131,161,230, 56,226,215,115, 23,
-160,148,231,110,169,205,114, 62,209,170,197, 41, 42, 42,250,109,208,160, 65,221, 46, 94,188,200, 29, 52,104,144, 58, 63, 63,255,
-210, 99,173, 88,172,166,204,152, 31,222,206, 3,176,197,191,195,200,221,143, 12,242,201, 0,190,241,243,247,195,217, 11, 49,136,
-185,120,249,251,124, 27,191,185,163,134,190, 55,182, 94,111,222,232,222,109,234,241,220, 28,109,176, 99,221, 18,222,225,152,212,
-165,169, 5,230,245,223,156,155, 51,175, 54,251,168,226, 31, 71,137, 1, 17,141,156, 96, 52, 51, 88, 88,233, 27,174,157,200,170,
-170, 55,222,167, 50,249,122,225,168,241,227,198,221,111, 26,214,252,163,161,239,141,183,110, 30,224,139, 43, 73,114,128,195,129,
-147,135, 4, 89, 89, 89, 56,191,119,157,169,232,209,221,239,121, 60,203,151,117,216,158, 40, 74,187, 22,244,216,221,177,249,249,
-249, 56,123,246, 44,202, 11, 44, 87, 87,215,170, 10,173, 63,101, 22,228,100, 94,154,183,120,109,196,152,225,111,163, 87,199, 38,
- 56,119,245, 62,244,101,227, 53,149, 95, 74,158, 18,243,131, 96,242,160, 0,253, 7,253, 26, 40, 52, 70, 65,234, 23, 15,138,207,
-163,116, 14, 86, 75, 21,203,169, 47, 44, 44, 60,124,239,222,189,118,205,154, 53,171,119,244,232,209,194, 91,151, 79, 76,122,124,
- 33, 62,253,244, 83,219, 53,107,214,216, 48,198, 46,233,245,250,228, 90,173, 59, 23, 59,100,177,177,206, 6,163, 5, 23, 46, 95,
-111,212, 37,162, 57, 44, 12,184,122,245, 42,214,111, 88,175,189, 17,127,237, 91, 85,142,199,151,213, 20, 47,149,110, 79,243,243,
- 93,117, 88,145,153,245, 40,245,219, 83, 71,246,110,123,181,195, 91, 24, 50,241,203, 47,207, 30,249,105, 78,139,246,189,184,141,
- 94,237, 6, 89,204,175, 56,125,244,248, 66,131,178,112, 14,106,238, 59, 82,233,114, 10,197, 54,255,215,184, 69, 7,164,167,165,
-226, 65,226,205, 45,218,194,164,204,180,251,188, 45,153, 25,105,227,235, 55,137,192,197, 19, 59, 39, 85, 83,104, 85,123,204,251,
-186,138,215, 29,141, 62, 60, 56, 35,227, 7, 15,149, 70, 43,100,140,105,133, 2,126,182, 45,183,100,151,162,214,203,121,199,144,
-151, 89,175,223, 59, 67,199, 31, 89,185,114,153,149,187,131, 13,178,139,180, 80,104, 12, 40, 81, 27,192,229,112, 16,228, 37,129,
-186,164, 16,231,246, 46, 54,234,149, 69,131,128,251,134,170, 50, 37,110, 33,243,139,146,126,157,248,233,132, 51, 16, 72,125,189,
- 94,233, 60,163,218,214,186,146, 71,215,222,250,116,194,207, 33,140,177, 46, 18,183,144, 18, 85,238,189, 89, 85,173, 59,135, 83,
-250,250, 30,210,201, 23, 6, 83,233,248, 99, 38, 11, 96,182, 88,202, 90,249, 0, 86,113, 62,159, 83,195,186,115, 44,187,142, 92,
- 66,102,142, 28, 26,189, 17, 58,189, 9, 6,163, 25, 92, 30, 15, 14,142, 14, 8,126, 37, 28, 82, 7,123,228,100,103, 34,230,151,
-195, 72,136, 63,119,137,195, 48, 87,147,151,248, 75,109,246,145,181,216, 33,196,211,203,131,155,165,208, 67, 44,224,225,218,185,
-163, 6,163, 94,247,109, 45,139,172,167, 50,229, 5,133, 75, 63,154,242,217,187,155, 54,110,246, 8,173,111,143,140,124, 13, 50,
-242,180, 40,209, 26,203, 10, 49, 11,116,202,124,196,255,186, 57,219,172, 45, 89,138,255,136, 42, 11, 45,147, 65, 91,178,239,248,
- 21,231,233,115, 22,243,146,238, 39, 27,231, 79,238,153,161, 81, 42,222,172,115, 75,214, 99, 54,125, 88,127,231,203, 88,137,167,
- 78, 23, 50, 11, 44,140,225,231,203,217, 21,167, 11, 45,101, 61, 47,227,238, 87, 63,141,224,227,115, 23,118,124,115,210,169,248,
-123, 37,219, 53,154, 28,233,221,164,111,139, 0,128,199,227, 85,220,202,251,102,105,181, 90,125, 13,167, 80,182,254,248,227,143,
-211,198,143, 31, 47,124,248,240, 33,238,223,191, 15,185, 92, 14,145, 72,132,227,199,143, 27, 97, 49,125, 27,127,241,192,131,123,
-178,147,179, 67, 90,118,243, 9,109,243, 38,108,108, 36,224,179,218,119,198,180,113,107, 48,184,101,135,222,223,117,233, 59, 6,
-167, 15,252,200,174,158, 59, 60, 65,147,151,176,174,174,219, 82, 46,151,223, 2,144,248,237,183,223, 54, 95,191,126,125,253, 41,
- 83,166, 36,111,253,110,206, 74, 0, 40, 40, 40, 0, 0,196,197,197,177, 9, 19, 38,232,180, 90,109, 74, 81, 81,145, 12, 53, 92,
- 0, 1, 0,154, 60,155,175,214,175,254,166,233,195, 71, 89,111, 7, 52,109, 5,215,250,173,224, 17,244, 26,138, 74, 12,184,146,
-148,137,228, 59,191,224,206,133,189, 71,213,182,166, 57,168,227,248,198,205,154, 53,243,229,114,185,175, 40,149, 74,143,198,141,
- 27, 55,147, 72, 36,113,205,154, 53, 11,231,243,249, 25,177,177,177,169,117,201, 74, 59,183, 89,231,223, 97,228,138,180, 18,187,
- 78,201,217,234,240,180, 18,187, 56,181, 80,250, 73,222,175, 43,116,155,120,222, 75,153, 33,255,214,158,205,138,125, 59,214, 45,
-225, 13, 29,251,169,249,102,177,227,100,190, 88,112,170,110,205,213,220,172, 15, 70,244,249, 99,120,135,178,150,172,178,239,107,
-213, 76, 95, 92, 28, 95, 12, 96, 90,252,109,171,239,110, 78, 30, 55, 47,236,213,136, 97,145,111, 12,226,154,172,109,113,226,192,
- 15, 44, 37,254,215, 61,124,102,158,169,169, 69,170, 17, 16, 0, 0, 32, 0, 73, 68, 65, 84,197,108, 0, 53,158, 14,210,235,107,
- 83,100, 61,189,140, 15, 37, 29,247,252,180, 97,228,190, 3,251,191,238,219,187,143,243,234, 47, 6, 98,241,218,131,144,136,133,
- 96, 22, 11, 6,118,242, 29, 48,123,116,195,183,124,221, 69,222,251,206,100,156,159,184,236,230, 52,181,218,144, 80,139,150, 24,
-150,159,159,127,193,214,214, 54,175, 93,187,118,173,133, 66, 33, 39, 63, 63,159,239,230,230,102,146, 74,165,250,140,140, 12,181,
- 78,167,219, 7,160, 78,195,142, 27,140, 22, 60,200,209,226,208,254,125,184,126,249, 23,220,185,115,175,228,206,237, 59,171, 56,
-124,182, 76,149,147, 88, 8,212,249, 3, 62, 44,149, 94,117,200,234,124,213,161, 89, 87,178, 99,235,247,243, 59,171,181,186,145,
-205,218,246, 68,189, 70, 17, 92,131,209,140, 27, 87,207,224,204,222,101,139, 13,202,194,233,207,179,143,189,124,234, 7, 51,158,
- 0,191,157, 61, 2,102,177,124, 15, 0,204, 98,249, 62,238,226,209,241,175,189, 57, 26, 78,110,245,154,201,211,227, 56,120,134,
-209,195,173,249, 92,213,177,125,155, 14, 60,120,240, 0,119,239,222, 69, 82, 82, 18, 10, 11, 11,177, 99,199,131, 58,237, 31,117,
- 81,234,169,132,219,220,238,253, 7, 14,249,121,192,224,225,162,250,193,161,220, 16, 31, 71, 56,219,242,113, 47, 41, 21, 9,177,
-241,150,123, 87,142,106, 13,138,220,190,154,162,212, 42, 11, 63, 27,151, 70,238,128,121,122,249,220,133,109,218, 68,132,124,182,
-224,235,214,206,174,110,149,190,143, 23,228,229, 10,166, 78, 60, 28, 18,243,251,111,181,154,235,208, 98, 54, 23,140, 29, 57,200,
-194, 43,157, 40, 20, 21,237,212,101, 91,175,244,195, 84,233,207,153,197, 84, 99, 11,254,123,111,183,135,201, 98,129, 74, 99,128,
- 66,165, 67,113,137, 22, 89,185, 5,184, 30, 31,143,115, 63, 31,198,253,123,215, 83,140,122,253, 73, 46,151,179, 87,147,147,112,
-174,110,103,154,248,245,157,157,156,144, 82,168,132, 72,192, 71,106, 66,172, 78,165, 40,222,254,172,199,145,166, 32, 49, 43,151,
-199,233, 54,104,208,224,227,157,187,247,150,190,218,182,171,141,139,189, 3,172,249, 12,137, 15, 50, 33,187,116, 92,149,124,253,
-188,194,168, 87,246,120, 17,179,190,252,205,213,124,213,161, 65,167,122,235,221, 62, 29,246,243,120,124,129,197, 98,210, 25,244,
-186,254,207, 83,100,189, 44,140,153, 51, 70,190,251,246,159, 62, 27,152, 44, 76,252,238, 59, 39, 52,143,127, 86, 48,154,153,205,
-187,239, 92, 82,151,190,129, 84,221,177,207,211,211,169,103,249,220,133,105,105, 5, 87, 11, 11,117,103, 0,100,104,181,218,103,
- 94,198,156,156,156,121, 11, 22, 44,232,165, 86,171, 27,118,236,216, 81,104,111,111,143,130,130, 2,156, 60,121,210, 24, 29, 29,
-125, 59, 55, 55,119, 54,144,107,210, 32,124, 75,188,246,192,136,123,177, 39,103, 55,108,217,221, 39,180,237,155,181,127, 51, 19,
-138,199,116,238,253, 62,231,244,193, 31,217,149,179, 7, 63,208,228, 37,174,125,142,205,106,208,106,181,151,181, 90,237,205,153,
- 51,103,190,234,238,238,238, 62,123,246,108,145, 66,161,176, 90,189,122,181, 54, 63, 63, 63, 91,161, 80,196,160,154,254, 52, 79,
-139, 51, 22, 63, 66,191, 99,251,126,236,196,246,253,248,186,131,139,119, 55,169,171, 79,160, 60,239, 81, 74,113, 94,230, 73, 0,
-167,203, 6,138,172,147,230,205,155, 7,112, 56,156, 65, 0,154, 74, 36,146, 32, 91, 91, 91, 33, 99,172, 33,135,195,185,101,177,
- 88,226, 27, 55,110, 28,125,251,246,237, 58, 13, 38,155,118,110,179,206, 55, 36,226,167, 66,181,197, 90,207,181,254, 41,237,220,
-102, 29, 0,228,158,250, 76, 13,224,208,237,142,211,250, 29,142, 73, 93,121,171, 72, 58, 41,239,236,215,135,235,186,204,197, 25,
-215,131, 94,212,241,175,205,186,157, 1, 96,100,124, 44,150,220,136,139,137,226, 48, 88,153, 97,154,175,201, 77,138,125, 17,249,
- 86, 86, 86, 90,111,111,239, 74,175, 46, 20, 10,133, 90,157,174,186, 6,148,115, 38,101, 22,214, 3, 29, 54,239,223,189,121,228,
-193,195,135,190,142,236,210,215, 89,228,227,131, 87,220, 56,216, 60,189,197,164, 95,226,242,174,244,254,236,252,154,228, 76,109,
- 60,234,216, 31, 70,169, 84, 38, 0, 40, 82, 42,149,125, 24, 99, 15, 57, 28,142,111, 81, 81,209, 53,163,209,120,163,206, 5,129,
- 5, 67,218,180,105,181,131,195,225,240,153,201,178, 40,198,138,247,147, 54,235, 78, 6,158,115, 90,146,208, 87,236,241,241,236,
- 21, 45, 2,131, 26,180, 40,159,235,176, 73, 61, 59,140,155,182,164, 69,189,250,193, 45,254,152,255,176,198,110, 2,204,168, 46,
- 26,181,127,195,162,243,113,191,159,249,220,197,179, 94,189,236,140,228, 59, 15,147,174,205, 51,107, 21,251,159,119, 63, 63, 72,
-186,181,108,253,183,211,166,100, 61, 74, 89,175,206, 75,188, 9, 0,234,188,196,155,119,100,248, 34, 63, 59, 99, 74, 65,110,242,
-183,207,186, 45, 84, 42, 85,230,246,237,219, 29, 34, 34, 34,184,238,238,238,200,203,203,195,153, 51,103, 44, 22,139,229, 81,157,
-179, 10, 83,206,168, 10, 57, 78, 91,214,126,183,200, 90, 98,247,166,201,100,242, 98, 12,224,243,249, 89,122,181,226,120, 9, 87,
-242, 25,138, 82,181,213,255,207,176,112, 0,112,203,231, 46,180, 88, 44,156, 69, 43, 55,167, 90,137,236, 42, 29, 12,209,168, 45,
-177,177, 88, 44,181,158,235, 80,158, 46, 11,124, 81,175,111, 14, 99,115,155,181,108,253,185,209,104,208,150,189, 62,180, 0,180,
-140,161,128,203,229,156,227, 89,140, 39, 20,207,241, 97,138,195,129, 61,227,240, 97, 39,230,131, 3, 14,148,197,133,172, 46,125,
-178, 42, 45,136,115, 19,110,169,115, 59,248, 31,211,239, 30,241,235,169,163,239,152,205,230, 87,202,218, 12, 30,232, 52,170, 61,
-202, 44,199, 45, 64,172, 9,255,126, 71,202,139, 45,206, 75,254, 67,181, 58,141,242,119,202, 12,169, 47,238,227,227,237, 62,226,
- 65,106,238,149,228,135,234, 45,248,243,180, 58,207,179,156, 60,119,119,247, 47, 56, 28,206, 48,129, 64, 96,171,215,235, 85,140,
-177,173, 57, 57, 57,243,240,212,228,191,225, 86, 98, 55,205, 8,129,200,102,150, 65,171,250, 77,157,155, 48,164,166,117,183,113,
-109,208, 77, 36,145, 76,211,106, 84, 91,213, 57, 9,155, 95,240,246,148, 10,133,194,112, 91, 91, 91,171,252,252,252,203, 0,138,
-255, 78,251,189, 89,179,102,126, 92, 46,247, 21,139,197,226, 14, 64,138,210,171, 66,242,249,124,254,163,178, 22, 45, 86,215,204,
-118,239,237,113,233,242,122,147,143, 79,158,191,183,188,236,180, 98, 5,239, 1, 75, 69,195,222,236,244,233,150,253,135, 42,187,
-234,240, 31,119,204,255,239, 50, 59,240,109, 61,243, 71,114, 5,210,249, 93, 66,180,234,252,204, 71, 19, 46,220,200,187, 12,160,
-228,121,150,211,218,218,122,168,193, 96, 16, 91, 91, 91,107, 12, 6,195,246,191,203,186,139,221, 66,222,231,130,213,122,102, 10,
- 11, 56,177, 79, 92,180,242,111, 57,150,120,161,161,161,237,173,173,173,253,204,102,179,141, 94,175, 87,107, 52,154, 7,169,169,
-169,191,161,234,137,207, 95,234,114, 74,220,130,151, 89, 91, 11, 39, 3,128,193,160, 91,161,202, 77,252,184,186, 39, 86,243,248,
-127,244, 62,114,121,165,101, 34,159,103,229,138,178,129,185, 45, 38, 83, 94, 78,202,213,224,191,112, 57,201, 51,238, 92,202,164,
- 76,202,164,204, 39,113,105,123, 82,230, 95,153, 41,242,108,228, 43,242,108, 84,235, 65,151,171,120, 60,109, 79, 82,110,108, 37,
- 55, 0,181, 24,176,148, 16, 66, 94, 2, 11,109, 2,242, 87,210,102,221,121,248, 50, 31, 79,254,115,170,236, 19,205,169,166, 42,
-173, 75,147,224,179, 84,182,167, 41,147, 50, 41,147, 50, 41,147, 50, 41,243, 63,151, 89, 83,246, 63,241,148,228,216, 39,238, 31,
- 1,240, 63,233,240, 79,205,170,148, 73,153,148, 73,153,148, 73,153,148,249, 95, 83, 81,120,113,105, 91, 16, 66, 8, 33,132,188,
- 28,212, 71,139, 16, 66, 8, 33,228,249, 84,118,234,144, 10, 45, 66, 8, 33,132,144, 23,160,202,206,240,116,234,144, 16, 66, 8,
- 33,228,249,148,183,104,121,226,137,225, 29,168,208, 34,132, 16, 66, 8,121, 49,178, 80, 89,235, 86,116,116, 52,171,236,123, 66,
- 8, 33,132,144,255,133,127,120, 45,242,120, 75,214,216,178,251, 0, 30,107,209,162, 2,139, 16, 66, 8, 33,127,151, 98,235, 31,
-166,188, 37,171,252,150,245, 84,161,213,171, 87, 47, 14, 21, 91,132, 16, 66, 8,249,171,252, 27,107, 17,238,147, 43, 72,187,153,
- 16, 66, 8, 33,127,101,177,245,111, 90, 31, 26,222,129, 16, 66, 8, 33,228,249,120, 2,232,249,216,253,255,217, 20, 60,132, 16,
- 66, 8, 33,255,118, 99,171,186, 79, 45, 90,132, 16, 66, 8, 33, 47,190,216, 34,132, 16, 66, 8, 33,255,100, 52,179, 57,101, 82,
- 38,101, 82, 38,101, 82, 38,101,254,219,149,143,163, 5, 84, 53,142, 22, 33,132, 16, 66, 8,121, 38, 61, 81, 58,126,214,216,178,
-175, 61,169,208, 34,132, 16, 66, 8,121,177,158,154,126,135, 10, 45, 66, 8, 33,132,144, 23, 91, 96,173,163, 66,139, 16, 66, 8,
- 33,228, 37,163, 66,139, 16, 66, 8, 33,228, 37,225,160,234, 43, 7, 78,215, 33,231, 89,174, 62, 56, 77,153,148, 73,153,148, 73,
-153,148, 73,153,255,185,204,154,178, 79,227,159,167,124,100,248, 35,248,163, 35,252,186,255,197, 31,166, 75, 95, 41,147, 50, 41,
-147, 50, 41,147, 50, 41,243,223,110,236, 19, 95, 43,208,169, 67, 66, 8, 33,132,144, 23, 91,108,209, 20, 60,132, 16, 66, 8, 33,
- 47, 72,149,167, 9,169, 69,139, 16, 66, 8, 33,228,249, 84, 57,169, 52, 21, 90,132, 16, 66, 8, 33, 47,167,224,162, 66,139, 16,
- 66, 8, 33,228, 5, 22, 89, 99, 43,253,109,116,116, 52,163,109, 68, 8, 33,132,144,191,202,191,182, 22, 41, 95, 49, 42,182, 8,
- 33,132, 16, 66,181, 72,157,121,226,143,171, 13,199,150,221, 7, 64, 87, 29, 18, 66, 8, 33,132, 60,175,158,248,243,149,135, 99,
-203,239, 83,161, 69, 8, 33,132, 16,242,252,198, 86,251, 91, 58,109, 72, 8, 33,132,144,191,210,191,177, 22,225,208,110, 37,132,
- 16, 66, 8,121, 46,149,181,102,173,163,205, 66, 8, 33,132, 16,242,114, 11, 46, 66, 8, 33,132, 16,242, 50,138,172,151, 61, 96,
- 41,205,108, 78,153,148, 73,153,148, 73,153,148, 73,153,255,149, 34,235,241, 33, 30, 0,208, 85,135,132, 16, 66, 8, 33,207,139,
- 38,149, 38,132, 16, 66, 8,121, 73,104, 82,105, 66, 8, 33,132,144,255,113,193, 69,133, 22, 33,132, 16, 66,200, 11, 44,178,254,
- 84,108, 81, 31, 45, 66, 8, 33,132,144,231, 83,101, 31, 45, 14,170,190,114,224,116, 29,254,192,179, 92,125,112,154, 50, 41,147,
- 50, 41,147, 50, 41,147, 50,255,115,153, 53,101,159,198, 63,223, 88,252,143, 6, 44,165, 75, 95, 41,147, 50, 41,147, 50, 41,147,
- 50, 41,243,191,134,134,119, 32,132, 16, 66, 8,121,209,133,213,147,168,208, 34,132, 16, 66, 8,121, 62, 52,142, 22, 33,132, 16,
- 66,200, 75,226,137,210, 86,173,242,175,225, 84,104, 17, 66, 8, 33,132,188, 24, 61, 81,218,170, 85,254,149, 10, 45, 66, 8, 33,
-132,144, 23,168,210,113,180, 56, 0, 16, 29, 29,205,202,238,119,236,213,171,215, 57,218, 86,132, 16, 66, 8,249, 95,250,183,214,
- 34, 21, 45, 90,189,122,245,226, 0, 56, 75,187,154, 16, 66, 8, 33,127,133,127, 99, 45,194,125,162,146,236, 72,187,153, 16, 66,
- 8, 33,127,133,127, 99, 45,194,127,162,138, 36,132, 16, 66, 8,249, 75,252,131,107, 17, 79,148,118,132, 63, 82,246, 21, 40, 27,
-242,129,198,209, 34,132, 16, 66, 8,121, 62,229, 87, 27, 62, 53,245, 14,181, 98, 17, 66, 8, 33,132, 60,159,202, 70,134, 95, 71,
-155,133, 16, 66, 8, 33,228, 37,162, 22, 45, 66, 8, 33,132,144,231,247,120,171,214,255,172, 53,139,102, 54,167, 76,202,164, 76,
-202,164, 76,202,164,204,255, 82,145,245,167,251, 52, 50, 60, 33,132, 16, 66,200, 75, 66, 87, 29, 18, 66, 8, 33,132, 60,159,242,
- 43, 14, 31,191, 79,133, 22, 33,132, 16, 66,200, 11, 44,182,158, 66,167, 14, 9, 33,132, 16, 66,158,207,216,170,126, 65,133, 22,
- 33,132, 16, 66,200, 75, 42,184, 56,168,250,202,129,211,117, 8,126,150,171, 15, 78, 83, 38,101, 82, 38,101, 82, 38,101, 82,230,
-127, 46,179,166,236,211,248,231,249,203, 6, 44,165, 75, 95, 41,147, 50, 41,147, 50, 41,147, 50, 41,243, 63,139, 78, 29, 18, 66,
- 8, 33,132,252, 13, 10, 45, 87, 62,159,255,185, 88, 44, 94, 35, 22,139,215,242,249,252,111, 1, 56,214,245, 15, 74, 36,146, 73,
- 30, 30, 30,119, 61, 60, 60, 50,252,252,252,142,218,217,217,124, 20, 32, 68, 36, 0,171, 23,180, 62, 33, 0, 62, 18,139,197,119,
- 68, 34, 81, 42,128,109, 0, 62, 2,224,242, 60,193,243,188,208,255,230,228, 62, 7,231,121,161,255, 19,191,234,233,238,238,126,
- 1, 64,183, 23,181, 83, 6,219,160,235, 0, 9,210, 7, 72,144, 62,216,230,217, 63, 53,216,217,217, 13,243,244,244,140,113,118,
-118,126,228,233,233,121, 73, 36, 18, 13,168, 99,132,155,187,187,251, 98, 95, 95,223, 4, 47, 47,175,229, 40,157,157,252,111,171,
-189, 16,237, 91, 11,145,215, 70,128,146, 8, 1,214,180, 17,224,245,215, 1,155,103,140,107, 7, 96,175,189,189,253, 53, 62,159,
- 31, 13,160, 95,217,241,213,143,207,231, 71,219,219,219, 95, 3,176,183,236,113,207,114,156, 46, 6,240, 8,192, 87,101,247,255,
-207,215,215,183, 36, 44, 44, 44, 53, 44, 44,108, 83, 80, 80,208,240,218,134,217,216,216,188,238,235,235,187,207,207,207, 47,181,
- 77,155, 54,133,222,222,222,247,124,124,124, 54, 11,133,194,142,244, 22, 71, 8, 33,127,127,111, 1,248, 26,192,170,248,248,120,
- 25, 99, 76,198, 24,147,197,199,199,203, 0,172, 1,240, 13,170,110, 66,252,211,207,157,157,157,231,206,159, 63, 95,155,149,149,
-197,242,242,242, 88, 66, 66, 2, 91, 54,107,154,165,187, 19,159, 5,184, 58,170, 61, 61, 61,239,251,251,248,236,108, 98,203,157,
- 6, 32,176, 54,153,143,113, 20,139,197,151,103,205,154,165,188,112,225,130, 82,175,215, 43, 45, 22,139, 50, 51, 51, 83,121,250,
-244,105,101, 68, 68,132, 18,192,199, 0,120,117,200,172,240,165, 23,206,177, 13, 95,176, 47,189,112,238,241,159, 55,108,216,240,
-182,197, 98, 97,253,251,247,215, 1,240,174, 75,230,147,188, 1, 81, 19,123, 56, 12,176, 69,142,105,243, 60,198, 86, 79, 97, 3,
- 36, 72,127,150, 76, 55, 55,183, 67,147, 38, 77, 82, 60,122,244,136,233,116, 58,150,158,158,206,198,141, 27, 87,236,230,230,182,
-189,150,235,238, 28, 26, 26,154, 19, 19, 19, 99,145,203,229,236,236,217,179,150,166, 77,155,230,212,178,216,234,250,196,178,172,
-243,242,242, 58, 90,151,155,155,155,219,250,186,238,163,215,132, 72, 55,200,206, 48,118,245, 36, 59,220,191, 13, 91,214,210,135,
-245,115, 18,200,219, 9,240,127, 29, 42, 31,202,164,170,204,119, 58,116,232,160,186,113,227,134,185,160,160,128,221,190,125,219,
- 50,102,204, 24, 45,128, 91, 99,198,140,209,222,190,125,219, 82, 80, 80,192,110,220,184, 97,238,208,161,131, 10,192,232, 58, 44,
- 39, 23,192,198, 57,115,230, 48,198, 24,155, 63,127, 62, 11, 11, 11, 99,157, 59,119,102, 74,165,146, 49,198, 82, 25, 99,155, 76,
- 38,211,200,218,100, 74,165,210, 97,147, 38, 77, 82,170,213,106, 86,206, 98,177, 48,185, 92,206, 86,173, 90,165,242,240,240, 56,
- 90,197,135, 12, 58,229, 65,153,148, 73,153,127,183,204,127, 50, 79,148,246,211, 42,191,213,186, 97,226,221,105,211,166,149, 23,
- 85,199,218,181,107,119,101,228,200,145,178,145, 35, 71,202,218,181,107,119, 22,192,137,216,216, 88,217,212,169, 83,101, 0,222,
-173, 97, 71, 56,182,109,219, 86,158,157,157,205,130,131,131, 89,189,122,245, 88,118,118, 54, 99,140,177,171,239,180, 96,191, 52,
- 2,123,120,254, 24, 59,121, 96, 47, 27,227,201,103,237, 61,165, 70, 79, 15,143, 2, 23, 23,151, 5,248,243,156,140,149,237,220,
-183, 27, 53,106, 84,114,235,214, 45,101, 98, 98,162,114,238,220,185,202,206,157, 59, 43, 67, 67, 67,149,253,250,245, 83,174, 92,
-185, 82,105, 48, 24,148,235,215,175, 87,218,219,219,223,170,164,216,122,230, 66,139,207,231,175,136,143,143,103,247,239,223,103,
-101,173, 20, 85,101, 74, 29, 28, 28,122, 56, 58, 58,126,236,224,224,208, 3,128, 20, 0,130, 1,219,102, 82,248,253, 95,179,128,
-134,209,239,118, 13, 92,213,245,213, 22, 3,236,184,114,227,119, 83, 24,235,239,247, 76,133,150, 84, 42, 29,246,209, 71, 31,149,
-232,116, 58,166, 86,171,153, 82,169,100,106,181,154,149,148,148,176,119,223,125, 87, 33, 18,137,222,174, 41,211,197,197,101,222,
-249,243,231, 77,217,217,217,236,252,249,243,236,232,209,163,108,245,234,213, 22, 55, 55,183,165,117,125, 1,122,120,120,156, 58,
-121,242,164, 44, 46, 46, 78,118,249,242,101,153,209,104,148, 25, 12, 6,153,193, 96,144, 69, 71, 71,203,246,239,223, 47,219,181,
-107,151, 76,175,215,203,244,122,189, 76,167,211,201,234,215,175,127,188,174,251,168,149, 16, 15,245, 23, 14, 51,182,244, 67, 86,
-188,112, 2,147,127,242, 38,203, 29, 23,201,214,188,234,195, 34,197,248, 25, 79,207,237, 89,105,166,149,149,213,185,212,212, 84,
-203,140, 25, 51,244,141, 27, 55, 46, 30, 53,106,148, 86,167,211, 49,198, 24,211,233,116,108,212,168, 81,218,198,141, 27, 23,207,
-152, 49, 67,255,224,193, 3, 11,159,207, 63, 93,135,229,252,166,188,200, 58,119,238, 28,123,156, 82,169,100,157, 59,119, 78, 13,
- 11, 11,219,244,202, 43,175, 12,169, 41,211,214,214,182,207,244,233,211,149,172, 18, 70,163,145,149,148,148,176, 7, 15, 30, 88,
-234,213,171,151, 9,192,153,222,204, 41,147, 50, 41,147, 10,173,151,102,108, 13,247, 43,223,136, 83,167, 78,149, 49,198,100, 51,
-103,206,148,149,181,108, 89, 3,176, 45,187,241, 1, 12,158, 62,125,186,140, 49, 38,155, 54,109, 90,249, 99,170,218, 17,111,237,
-217,179,199,176,124,249,114,230,238,238,206, 60, 60, 60,216,138, 21, 43,152,197, 98, 97,217,209,219,217, 47,141,192,238,124, 62,
-130, 49,198, 88,194,130,137,236,151, 70, 96,201,223,127,201,134, 14, 29,170,182,177,177,121,183,154,157,235,212,162, 69,139, 18,
-141, 70,163,220,188,121,179,210,198,198,230, 42,128,198, 40, 61, 21,201, 41, 91,214,225,141, 27, 55, 86,220,188,121, 83,249,211,
- 79, 63, 41, 1,204,173,229, 1, 19, 8,160,147, 68, 34,233, 55,221,219, 42,145,109,248,130, 77,119,199, 13, 0, 77, 1,184,150,
- 61,198,107,218,180,105,140, 49,198,124,125,125,207, 87,145, 41, 13, 13, 13,157,150,152,152, 24,101, 52, 26,163,226,226,226,162,
- 26, 52,104, 48,163,119,125,207, 54, 7,223,125, 61,188,248,203, 9,225,108,201, 39,161,223,190,209,170,235,206, 65, 29,223,125,
-239, 21,151, 11,163,220, 68,234,129, 82, 94,201, 19,167, 14,107,117, 96,123,123,123, 95, 78, 79, 79,175, 40,174, 74, 74, 74,216,
-163, 71,143, 88, 74, 74, 10,187,112,225, 2,243,244,244,252,165,166, 76, 15, 15,143,219,233,233,233,236,251,101,203, 88,255,166,
- 13, 89,164,131, 29,235,224,104,199, 90,218,138, 84,141,128,150,117, 45,180,174, 93,187, 38, 3, 32, 3, 32, 43, 40, 40,144, 21,
- 20, 20,200,138,138,138, 42,126, 6, 64, 86, 92, 92, 44, 43, 46, 46,150,233,245,122, 89, 64, 64, 64,157, 11,173, 8, 17, 34, 94,
- 19,161,176,141, 16,154,183,188, 93, 50, 39,212,119, 49,255,254,110, 27, 86,244, 97,103,182, 60,220,155,181, 19,224,255,106,153,
-249,150, 64, 32, 56, 11, 96, 74, 89, 81, 62,162, 71,143, 30,106,198, 24,235,209,163,135, 26,192,136,178,159,127, 84, 86,100,245,
-168,229,114,114,131,130,130, 84,229, 45, 89, 0,126, 11, 10, 10, 82,133,133,133,177,176,176, 48,230,235,235, 91, 82,150, 93,171,
- 55,180,192,192,192, 4,141, 70, 83, 81, 0,202,229,114,150,153,153,201,146,147,147,217,173, 91,183,216,213,171, 87, 89,106,106,
- 42,219,189,123,183,217,193,193,225, 8,189,153, 83, 38,101, 82, 38, 21, 90, 47,181,208,122,242,246,103,209,209,209,236,137, 31,
- 45,140,141,141,149, 77,159, 62, 93, 86, 67,101, 54,118,230,204,153,229,173, 94, 95, 87,243,207,127,125, 66, 66, 2, 27, 49, 98,
- 4, 11, 9, 9, 97, 33, 33, 33,108,228,200,145,172,184,184,152, 41,147,110,178, 95, 26,129, 93, 29,216,146, 49,198, 88,201,157,
- 56,246, 75, 35, 48,217,208,182,236,250,245,235,204,199,199,231,100, 53,127,255,231, 75,151, 46,229,109,223,190, 61, 27,165,253,
-177,172, 0,180, 6,176, 66, 44, 22,111, 68,233,233,194,122, 0, 28,131,131,131, 11,213,106,181,178,127,255,254, 74, 0,126,213,
-100,118, 8, 9, 9,185,191,126,253,122,150,155,155,203, 10, 11, 11,217,162,136, 6,140,109,248,130,205,111, 89,207,242,253,247,
-223,235,166, 76,153,162,114,114,114,138, 6,224,213,191,127,127, 19, 99,140, 69, 70, 70,230, 84, 22,230,224,224,208, 35, 49, 49,
- 49, 74,171,213, 70,201,229,242,168,194,194,194,168,195, 7, 15, 70,117,111,218, 96, 68,241,151, 19,194, 15,190,251,122,248, 27,
-222,142,253,150,118,123,117,252,163, 25,163,251,207,108,219,248,142,246,155,201,103,222,169,239,190,248, 89,246,182,171,171,107,
-150, 78,167, 99, 0,158,186,221,191,127,159, 57, 59, 59,167,215,148,225,228,228, 52,243,163,193,131,204,111,215,243,102,247,151,
-207, 98,198, 83, 63, 49,227,209,205, 44,105,225, 39,172,183,135,139,162,181, 53,119,122,109,151,199,195,195,227,212,229,203,151,
-255, 84,104, 21, 21, 21, 85, 90,104, 41, 20, 10,153, 94,175,151, 5, 5, 5, 29,127,222,163,190,181, 0, 1, 29,196,188,171,113,
- 35,218,179,188, 9,157, 89, 15,169, 85,234,115,196, 13, 6,112, 22,192,208, 58, 62,143, 11,224,155,242,130,106,225,194,133,140,
- 49,198,130,130,130, 84,120,190,139, 81,164, 13, 27, 54, 76, 25, 61,122,180,169, 81,163, 70,185, 17, 17, 17,242, 43, 87,174,176,
-115,231,206,177,163, 71,143,178,189,123,247,178,155, 55,111,178, 71,143, 30,177,132,132, 4,214,179,103, 79, 57,128, 14,244, 94,
- 72, 8,249, 59,171,164, 22,249,199,227,150,175, 88,175, 94,189, 56,143,173,160, 20,128,168,101,203,150,121,223,124,243,205, 18,
-148,142, 5,193, 9,229,225,157,206, 98,254,245,206, 98,254,245, 80, 30,222, 41,107, 49, 90,183, 96,193,130,121, 97, 97, 97, 89,
- 0,196, 0, 60, 42,251, 67,140,177,246,206,206,206, 72, 79, 79,135, 84, 42,133, 84, 42, 69,122,122, 58, 24, 99, 48, 49,192,200,
- 0,157,193, 0,141, 70, 3,173,133, 65, 99, 1, 20, 74, 37, 60, 60, 60, 96, 48, 24, 2,170, 88,254,102, 3, 7, 14, 12, 8, 13,
- 13,205,155, 58,117,106, 38, 74,251,202,108,124,255,253,247, 79,253,246,219,111,161, 74,165,178,240,214,173, 91,218,166, 77,155,
-246, 0,224,145,152,152, 56,108,213,170, 85, 24, 49, 98, 4,170,249,167,211,180,103,207,158, 71,111,222,188, 25, 48,116,232, 80,
-156, 61,123, 22,139, 22, 45, 66,126,126, 62, 3, 0,157, 78,199,204,102,179,161,109,219,182,134,229,203,151,183,138,140,140,188,
- 92,191,126,125, 30, 0,164,164,164, 36, 85, 22,200,225,112, 26,248,251,251, 67,167,211, 33, 47, 47, 15, 55,111,222,132,157, 84,
-138,248,204,124,247,142, 75,191, 47,248,252,224, 41,171,193,173, 66,157, 62,126, 61, 66,247,213,201,179,193,141,189,220,221,245,
- 6,163, 71, 66, 86, 78,230,179,236, 84,107,107,235,244,252,252,124,232,245,122,104, 52, 26, 40, 20, 10, 20, 20, 20, 32, 63, 63,
- 31,153,153,153,176,182,182,190, 95, 83,134,125, 97,225,249,148, 75,231, 56,187,127, 88,136, 0, 83, 33,248,251, 86,128,127,104,
- 13, 2,245,121, 88, 59,107,156,157,222,217,117,142,189,157, 93,145,131,131,195, 58, 0, 65, 53,229,133,135,135,163,160,160, 0,
- 5, 5, 5,112,118,118,134,163,163, 35, 28, 29, 29, 33,151,203, 81, 92, 92, 12,133, 66,129,224,224, 96, 52,107,214, 12, 91,183,
-110,125, 33, 7,247,239,122, 36,155, 96,158,112,234, 94, 38,172, 37, 18,212,119,180,245,127,213, 22, 78,213, 60,165,179,149,149,
-213, 30, 39, 39,167,147, 0, 62, 4, 32, 1,240,161,147,147,211, 73, 43, 43,171,190, 0,230, 3,216, 94,199,197,248,106,206,156,
- 57,211, 18, 19, 19,109,174, 95,191,142,169, 83,167, 98,238,220,185, 72, 74, 74,250, 14,128,165,236, 49, 31, 56, 59, 59, 71,115,
-185,220, 31, 1,188, 9,160,135,167,167,103,151, 26,114,251, 78,153, 50, 69,219,162, 69,139,132, 59,119,238,244,189,116,233, 82,
-203, 79, 62,249,164, 56, 45, 45, 13, 9, 9, 9,240,244,244,132,175,175, 47,148, 74, 37,138,138,138,208,183,111, 95,169,189,189,
-253,187,244, 54, 78, 8,249, 59, 23, 89, 79,212, 34,255,180, 22,173, 74,239, 87,250,137,218,198,198,102,142, 76, 38,107, 19, 22,
- 22,198, 7,176, 27, 0, 66,121, 24,208,183,109,243,141, 7,215, 45, 12,219,191,124, 86, 88,247,176,224,141,161, 60,148, 95,197,
- 22,221,178,101, 75, 71,153, 76,214, 86, 40, 20,254, 95, 21, 11,193, 0,192,209,209, 17, 82,169, 20, 14, 14, 14,112,116,116,132,
-197, 98,129, 82,173,133,202, 12,148,104,245, 40, 46, 46, 70, 73,217,125,165,206, 0,149, 74, 85,241,220, 74,116, 28, 61,122,116,
-222,170, 85,171,114,179,178,178, 22, 2,104, 58, 98,196,136, 62, 43, 87,174,196,175,191,254,170,125, 51, 36,208,121, 65,251,230,
-243, 26,103, 37, 69,133, 88, 97, 12,128,243,231,207,159, 71,219,182,109,193,225,112, 6, 85, 22, 40, 22,139,215,236,220,185, 83,
-124,235,214, 45, 4, 6, 6,222, 26, 52,104,208, 59, 11, 23, 46, 12,144, 40, 11, 47, 2,128,169, 32,251,214,196,137, 19,191, 88,
-176, 96, 65, 94, 94, 94,158, 65,173, 86,187,245,238,221, 27,233,233,233,120,244,232,209,111, 85, 20,153, 9,113,113,113,172,184,
-184, 24,201,201,201,136,139,139, 19,127,241,197, 23,173,204, 92,110,159, 12,216,189, 55, 34,162,101,171,161,173,155, 99,123,204,
-117,235, 11,247, 82, 28, 90,214,243,118,188,246, 48,235, 21, 35, 7,247,159,101,111,151,148,148,172,152, 55,111,158, 82,169, 84,
- 34, 35, 35, 3, 55,110,220,192,157, 59,119,144,154,154,138, 69,139, 22, 41, 11, 11, 11, 87,214,148,225, 37,226,127,186,248,147,
-247, 57,252,219,191, 1,215,207, 1,234, 18, 64,163,132,238,174, 12,155,238,102, 99,245,190, 3,130,180,244,116,135, 93,187,118,
-141,246,243,243,147, 1, 8,174, 46,143,177,210, 93,200,229,114,159, 44, 66,193,229,114, 75, 0,100, 75, 36,146,135,118,118,118,
- 15,185, 92,110, 54, 99, 76,245, 66, 62, 73,152, 96, 0,143, 7, 8,196,224, 90, 85, 59,181,231, 59,131, 6, 13,218,249,240,225,
-195,238,201,201,201,109, 86,174, 92, 57, 79, 36, 18,197,175, 92,185,114, 94,114,114,114,155,135, 15, 31,118, 31, 52,104,208, 78,
- 0,195,235,242,247,131,130,130, 38, 70, 69, 69, 97,209,162, 69,104,214,172, 25,130,131,131,213,115,230,204, 89, 1, 96, 22,128,
-255, 11, 10, 10,186, 56,113,226,196, 81,185,185,185, 30, 25, 25, 25,205,190,251,238,187,113, 43, 86,172,120, 53, 51, 51, 83, 84,
- 67,116,187,110,221,186,225,216,177, 99, 0,144, 5, 32,185,160,160,192,148,153,153,137,134, 13, 27,162, 85,171, 86, 80, 42,149,
- 80, 42,149,144,203,229,240,247,247,135,197, 98,105, 67,111,229,132, 16,242, 63, 45,184, 42, 47,180, 68, 34,145, 99,120,120, 56,
-234,215,175,239,136,178,171,181,156, 5,252, 25, 31,143, 30,108, 99, 43, 59, 14, 78,220, 47, 24,212,190,137,141,179,128, 63,163,
-236, 41,124,127,127,127, 97,120,120, 56, 36, 18,137,119, 21,127,252,108,118,118, 54,194,195,195,225,224,224, 0,169, 84,138,240,
-240,112, 24, 12, 6, 20,151,148, 64,101, 6,212, 70, 11,138,139,139, 81,152,151, 3,181, 25, 48,217, 57, 35, 53, 53, 21, 60, 30,
- 47,165,138, 76,207,192,192,192,188,248,248,248, 60, 0,231, 1,140,159, 59,119, 46,166, 79,159,142,217,179,103,239,180,201,122,
-208,109,231,177, 67,206, 59,230,124,224, 26, 44,224, 12, 6, 96,120,248,240, 33, 28, 28, 28, 32,145, 72, 42, 45, 12, 34, 35, 35,
- 91, 72, 36, 18,108,222,188,153,101,100,100, 68,160,244, 18,254, 20, 14,167,180,216, 19,115, 81, 12, 96,133, 76, 38,123,237,139,
- 47,190,184,215,181,107, 87,171,214,173, 91, 99,254,252,249, 0, 16, 93, 89,166, 92, 46,255,125,248,240,225,250, 51,103,206,224,
-238,221,187,146,131, 7, 15, 14,152, 63,127,126,147,180,180, 52,225,207, 71,143,191,177,237,161, 98,192,194,147, 23, 68, 11, 78,
-156,253,221,197, 94,210,248, 21, 23, 39,196,165, 61,178, 54,243,112,165,166, 61,250,154, 21,111,116, 71, 17, 63,174,189,144,155,
-213, 81,196,151,189,106,197,123,191,164,164,100,215,225,195,135, 79,124,242,201, 39,202,220,220, 92,216,217,217,161,160,160, 0,
- 95,125,245,149, 50, 46, 46,110,159, 94,175,255,185,166, 92,179,133,181,240,173,231, 7,220,143,175,248,153,193,194,112, 69,111,
-141, 94,227, 39, 35,164, 97, 67,232,245,122, 52,109,218,148, 51,119,238, 92,137, 84, 42,253,172,198,162,135,251,212,225,102,226,
-112, 56,217,140,177, 71, 74,165, 50, 67, 44, 22,167, 89, 91, 91,167, 21, 22, 22,102, 48,198,114, 94, 68,157,197,184,248,180,109,
-211, 32, 64, 40, 70, 90,129, 50,243,170, 18,133,149, 61,208,206,206,238,253,213,171, 87,139, 54,108,216, 96,156, 56,113,162,110,
-220,184,113, 86, 26,141,198,109,220,184,113, 86, 19, 39, 78,212,109,216,176,193,184,122,245,106,145,173,173,109,191,103, 89, 16,
-163,209,136,248,248,248,133, 73, 73, 73, 18,148, 14, 55, 50,121,206,156, 57, 35, 18, 19, 19, 69,171, 86,173,194,222,189,123,177,
-119,239, 94,244,233,211, 7,147, 38, 77, 66, 84, 84, 84,117,113, 54, 97, 97, 97,225,206,206,206, 56,119,238, 92, 38,128, 52, 0,
- 45,108,109,109,237,250,244,233,131,238,221,187, 67,171,213,194, 96, 48, 84, 20, 90, 60, 30, 15, 14, 14, 14,206,244, 30, 72, 8,
- 33, 47,189,200,250, 83,177,197, 7,128,242,166,186, 94,189,122,113,170,251,199,104, 46,202,133, 92,165, 70,106,177, 26,233, 69,
-150, 63,253,206, 98,177, 84,251,215, 51, 51, 51,127,142,137,137,121, 63, 60, 60,156,159,153, 89,122, 70, 44, 60, 60, 28,106,181,
- 26,153,215, 47, 67,101, 1, 36,129,161, 80,169, 84, 40,186,115, 13,182, 97,109,224,220,115, 40,150,174, 90,165, 43, 40, 40,248,
-161,178, 76,129, 64, 96,229,227,227,147,151,146,146, 98, 2, 80, 40,149, 74,187,249,249,249,225,236,217,179, 0,176,157, 1,139,
- 17,119, 6, 56,183, 31,172,180, 73,197,214,223,223, 31,185,185,185, 80, 42,149,103, 43,203,140,137,137, 73, 52, 26,141, 77,123,
-247,238,205,217,178,101,203,110,133, 66, 49, 27,192, 13,157, 5,188,235, 15,115,160, 50, 67, 4,224,117, 71, 71,199,143,162,162,
-162,186, 76,156, 56, 17,135, 15, 31,198,201,147, 39, 13, 40,237, 11, 22, 83, 73,108,113,114,114,242,218, 41, 83,166,180,230,114,
-185,227, 79,157, 58,101, 10, 14, 14, 86, 24, 12, 6,115,131,144, 16,238,236,185, 95, 90,127, 56,126,172, 67,129, 26,183,187, 55,
-240,108,203,225, 0,183, 31,229,166, 37, 41, 81, 80,221, 54,141, 20,240,162,251, 70,132, 69,190, 63,232, 45, 91, 73, 96, 99,168,
-110, 94,246, 88,187,231,232, 82,113, 92, 98,175,115,185,185,125, 14, 31, 62, 60,224,236,217,179, 31,234,245,250,250, 66,161,240,
-190, 92, 46, 95,174, 84, 42,107, 44,178,120, 60, 94, 79,157,167,143,163,188,176, 16,162,178,150, 40,133,209,130,124,157, 9,119,
- 29,130,241,174,143,111,197,105,208,236,236,108,120,120,120,112,204,102,243, 91,213,101,158, 60,121, 18,189,122,245, 42, 47, 60,
-193,225,112,192,225,112,242, 67, 66, 66,114,132, 66, 97,129,181,181,181, 98,241,226,197, 90,173, 86, 11, 62,159, 47, 50,155,205,
-188,231, 57,218, 91,217,192, 77,200, 56,107,198,245,238,212,181, 89,227,134,236,252,213,235,156, 34,181,118, 83, 53,173,128,223,
- 5, 5, 5,241, 11, 11, 11,127, 6,112,215,104, 52,238,216,189,123,183,104,216,176, 97,218, 61,123,246, 12, 1, 16,176,100,201,
-146, 1, 74,165,178, 78, 83, 42, 36, 37, 37,125,183, 96,193,130,105, 51,103,206,196,214,173, 91, 39, 38, 37, 37, 77, 47,107,233,
-234, 19, 21, 21,133,197,139, 23, 99,235,214,173,150,187,119,239, 30,181, 88, 44, 73,159,124,242, 73,152,187,187,123,126, 86, 86,
- 86, 82, 53,177, 45,123,244,232,161,187,120,241,162,160,164,164,228, 2,128,143, 38, 76,152, 48,250,181,215, 94, 83, 12, 26, 52,
-200,182,176,176, 80,110, 99, 99, 35, 88,191,126,189, 35,159,207,135, 74,165, 2,135,195, 65, 73, 73,137,158,222, 7, 9, 33,127,
- 87, 85,213, 34,255, 16, 85,254,111,224, 87,182,130,106,181, 58, 39, 61, 61,189,225,163, 71,143, 76, 0, 76, 0, 80,160, 55,125,
-189, 96,253,254, 13,253, 90, 7, 73,178,140, 70, 28,188,122, 75, 93,160, 55,149,119,126, 55, 61,122,244,168, 36, 45, 45,205, 78,
-163,209, 40,171,248, 91,191,173, 89,179, 70,115,230,204, 25,187,228,228,100,152,205,102,180,104,209, 2, 9, 9, 9, 40,186, 27,
- 15, 73,195, 22,144,116,232,133, 91,178,171,136, 59,121, 26, 15,148,122,211,189, 89, 11,138,149, 42, 85,148,193, 96, 56, 88, 89,
-160,149,149, 85, 33, 0,198, 24, 51, 3,128, 66,161,184,161, 84, 42,219,187,187,187,227,246,237,219, 18,149, 25,147, 6,204, 88,
-186,146, 49,102,182, 46,189,154,235,227, 65,131, 6, 33, 54, 54, 22, 0, 98, 43,203, 84, 40, 20, 19,199,140, 25,115,102,243,230,
-205,252,228,228,228,238, 27, 54,108,232,126,239,222, 61,198, 41, 76, 55, 95, 84, 91, 33, 96,196,164, 87,191,247, 15, 57,217,171,
- 87, 47,120,122,122, 98,253,250,245, 88,190,124,185,241,131, 15, 62, 72, 92,190,124,249,171,185,185,185, 59,170, 88,255, 98,185,
- 92,126,220,217,217,249,195, 38, 77,154,148,168, 84, 42, 20, 20, 20, 32, 51, 51, 19, 78,206,206, 92, 19,184,109, 93, 29, 28,118,
-252,156, 93, 34,225, 31,255, 29,151, 51,178,170,109,205,106,109,197, 27,222, 47,178,121,228,255,205,156, 97,139,139, 7,193, 25,
- 19, 5,182, 97, 30, 38,143, 28, 96,167,213,237,232,160,186,158, 58, 76,166, 80,108, 83, 40, 20,123,235,120,176,244,104,219,182,
-237,206, 5, 11, 22,136, 63, 95,180, 0, 75, 26,122,195, 84, 80,128, 60,157, 25,249, 58, 19, 20, 69,119,113,251,246, 45, 56, 59,
-187,224,193,131, 7,208,106,181,184,115,231, 14,227,241,120, 63,215,212,162, 83,238,177,211,133,114,161, 80, 88, 96,101,101,149,
-195,231,243, 11,147,147,147, 85, 90,173, 22, 92, 46, 87, 98, 54,155,197,181, 88, 86, 31, 23, 23,151, 79, 80, 58,152,232,225,146,
-252,252, 21,225, 86,112, 0, 31, 29,253, 93,156,223,152, 53,110,152,139,159,151,155, 60, 57,241,190,241,135, 19,151,242,181,186,
-170, 47,214, 0, 16, 93, 88, 88, 88,209, 34,185,103,207,158,201,123,246,236, 25, 13, 96, 35, 74,231,221, 58, 45,151,203,191,127,
-134, 23,223,172,125,251,246, 77,155, 57,115, 38,196, 98,113,197,224,169, 98,177, 88, 4, 0, 63,253,244, 19,110,223,190,253, 26,
-202,250,107, 89, 44,150,157, 89, 89, 89, 53,101, 6,132,134,134, 38,239,223,191, 95, 0,192,107,194,132, 9,109, 86,174, 92,137,
-145, 35, 71,230,221,186,117,171, 53,128, 20, 0, 1,227,199,143,191,178,117,235, 86, 71,139,197,130,162,162, 34,232,245,250, 20,
-122, 43, 39,132, 80,177,245, 82,132, 3,136, 67,233,248, 89, 61, 1, 28, 65,105,183,142, 42,249,150, 85,103, 39, 0,244, 46,255,
-255, 88, 69,103,120,160,244,138,172,227, 0,126, 4,224, 94, 85,168,179,179,243,103, 35, 70,140, 48,102,100,100,176,236,236,108,
-182,119,239, 94,246,241,251, 35,204,175, 7,122, 89, 2,189,220, 85,174,174,174, 9,158, 46, 78,155,154,219,224, 99, 0, 62,181,
- 88,177, 17,247,238,221, 27, 59, 98,196,136,247,203,254,238,251, 59,119,238, 84,158, 58,117, 74,201,227,241,162, 81, 58,180, 67,
-121, 65, 57,252,173,183,222, 82,234,116, 58,101, 72, 72, 72, 33, 74, 59,238, 87,101, 64,199,142, 29,139,142, 29, 59,198,204,102,
-243, 83, 99, 20,229,229,229,177,147, 39, 79,178,136,136, 8, 57,128, 97, 93,186,116, 57,123,233,210,165,179,237,218,181,219, 87,
-211, 2,187,184,184,204,184,126,253,122,108,106,106,170,236,200,145, 35,178, 29, 59,118,200,198,143, 31,127, 35, 44, 44, 76,147,
-152,152,104, 49,153, 76,236,250,181,107, 44,164, 65, 3, 21, 0,255,170,114, 58,139,249, 87, 20,235,231, 49,237,252,145, 76,219,
-215,151, 1, 96, 37, 75, 63, 99, 57, 19,187,178,132, 15,223, 96,157, 68,188,152,103, 57, 82,125,108,111,173, 0, 0, 32, 0, 73,
- 68, 65, 84,156,156,156, 78,196,198,198,178,146,146, 18,118,243,230, 77, 54,188, 87,119, 22, 51,186, 43, 59,222, 61,136,109,237,
-240, 10, 91,218, 45,140,117,239,208,158,173, 89,179,134,237,223,191,159,205,152, 49,195,226,226,226, 82,130,106,250,104,121,120,
-120,156,218,189,123,183, 12,128,140,199,227,201, 20, 10,133,172,164,164,228,231,135, 15, 31,174, 14, 9, 9,153,214,164, 73,147,
- 33, 13, 27, 54,236,220,233, 21,255,105, 93,236,132, 9, 93,237, 69,247, 27,216,218, 44,197,211,227, 94, 85,144, 2,254,129, 1,
- 1, 37,231,206,157,179,232,116, 58,118,225,194, 5, 75,163, 6,193,218, 37, 3,123,236,123,176,254,155,125,218, 99, 91, 78,168,
- 15,173,187,180,231,189, 94,241, 29,109,184, 91,218, 72, 42,134,227,120, 86,131, 1, 28,196, 31, 87, 29,142, 0,112, 8,213, 95,
-133,200, 5,176,113,254,252,249,143, 95,105, 8, 0,220,176,176, 48, 25, 99, 76, 22, 22, 22, 38,171,235,130,216,216,216,124,114,
-248,240,225, 57,126,126,126,139, 6, 13, 26,180, 94, 46,151, 31, 25, 50,100, 72, 60, 74, 47, 6,225,160,116,118,132,183,124,124,
-124,242,226,226,226,216,217,179,103, 89,255,254,253, 75,172,173,173,135,210,219, 56, 33,132,188, 20, 99,171,248, 90,173, 5,241,
-241,241,229, 99,104, 77,168, 46,124,250,244,233,178,216,216, 88, 25, 74, 71,137,175, 22,159,207, 63,240,193, 7, 31, 48,119,119,
-119,165,155,155,219, 1, 43, 30,111,180,175, 24,225,120,182, 75,221,219,111,219,182,173,207,119,223,125,215, 19,192,107, 0,172,
-188,189,189, 51,179,179,179,149,151, 46, 93, 82, 70, 68, 68, 40, 93, 92, 92,114, 67, 67, 67,149, 75,150, 44, 81, 26,141, 70,229,
- 39,159,124,162,196,211,227,125, 85, 70, 4,224, 67,129, 64,112,160, 81,163, 70,241,179,122,119, 54, 46,154, 52,154,141, 8,114,
- 85, 2,248, 14,192, 7, 0, 28, 0, 88, 13, 24, 48,224,151, 59,119,238,156, 8, 13, 13, 93, 91,139, 92,175, 38, 77,154,252,186,
-115,231,206,216,253,251,247,203, 62,251,236,179, 88,103,103,231,140,196,196, 68,139, 86,171,101, 69, 69, 69, 76, 46,151,179, 35,
- 71,142,152,157,156,156, 86, 85,185,226, 66, 94, 22, 59,185,189,210, 33, 28, 30,206, 28,202, 34, 4,220, 71,207,114,164, 72, 36,
-146,194,130,130, 2,150,157,157,205,146,147,147,217,190,125,251, 88,143,182,173,216,174,241,253,216,246,247,251,176,197, 61, 90,
-177,215,236, 68, 42, 15, 59,219, 88, 59, 59,187,220,218, 92,117,232,225,225,113, 74,167,211, 85, 12,223,224,227,227, 35, 11, 9,
- 9,217, 31, 26, 26,186,244,240,225,195,147,151, 45, 91,214,167,211, 43,254,211,190,234,222, 86,163, 62,189,135,149,236,254,142,
- 77,111, 17,172, 45, 43,230, 43,229,237,236,180,237,220,217,179,150,242,226,215,100, 50,177,131, 7, 14,176,129,111,188, 30, 95,
-124,252,167, 31, 47, 68, 77,220,249, 73,139,224,131, 17, 34, 12,174,174, 96,171,248, 40, 98, 11,231, 72,123,238,234, 55,253,156,
-178,218, 75,185,223,181,182,251,211,244, 82, 3,131,131,131,147, 25, 99, 89, 13, 27, 54, 76, 6,176,189, 97,195,134,143,223,127,
-175,138,216,138,193, 73,231,204,153,195,202, 94, 31, 92, 0,179, 23, 44, 88, 32, 99,140,201,130,130,130, 46, 2, 64, 51, 9, 92,
- 58, 72,185, 63,246, 14,112, 47,232, 32,229,254,216, 76, 82,249,148, 81,254,214,104,208,222,213,230, 66,159, 32,207,146,142,222,
-210,243,219, 55,109, 88,244,230,155,111,174, 7,176, 10,192, 60,103,103,231, 11,131, 7, 15,190,189,117,235,214,219, 75,150, 44,
- 49, 36, 38, 38,178, 81,163, 70,169,132, 66,225, 60,122, 31, 36,132,144,151,166,124,100,120,207,186, 20, 90,111, 77,155, 54, 77,
-198, 24, 43, 31, 75,107, 88, 37,143,233, 61,115,230, 76, 25, 99,172,124,116,248, 39, 7, 48,171,108, 64,179, 57,171, 87,175,102,
- 66,161,240,199,103, 92,153,199, 51, 61,250,246,237,219, 90,161, 80,188,234,238,238,254,106, 89,203,149,175,139,139, 75,242,142,
- 29, 59,148, 26,141, 70,201, 24, 83,154, 76, 38,101,108,108,172,178, 99,199,142,202,199, 62,245,215,180,156,127,242,185, 7, 46,
- 94,157,245, 62,251,220, 3, 23,159,248,213,208,141, 27, 55, 30, 75, 73, 73,249,217,222,222,126,106, 45, 51,125, 93, 93, 93,103,
- 59, 57, 57,157,112,113,113,249,220,201,201, 41,203, 96, 48,176,162,162, 34,150,144,144,192,206,158, 61,203, 98, 98, 98,152,147,
-147, 83, 70, 85,203,217, 69,204,255,189,104,209,135,204,178,113, 1,211,175,156,193, 0, 48,249,178,233, 44,127,205, 92,118,117,
- 76,119,214, 81,196,251,237, 25,182, 39, 28, 28, 28,214, 29, 56,112,192,146,148,148,196,162,163,163,217,145, 35, 71,216,164, 73,
-147, 88, 3, 47, 79, 93,107, 1, 55,167,189,144,127,226, 89, 6, 44,213,233,116, 50,133, 66, 33, 83, 42,149,178, 70,141, 26,201,
- 90,181,106,181,191,117,235,214, 75,247,236,217, 51,249,171,175,190,234,211,197, 78,152,160, 62,189,135,177,207,222, 96,236,195,
-118,236,254,232,142,172,179,152,127,189,202, 76,119,247,140,242,209,218, 85, 42, 21, 59,127,254, 60,251,245,215, 95,153,135,139,
-139, 34, 82,204, 27, 27, 33, 68,135, 8,123, 56,212,118, 57, 59, 73,185,155,126, 95,243,181, 89,115,108, 43,251,105,196, 27,166,
-142, 14,220,213,143, 61,110, 23, 99, 44,171,127,255,254, 15, 24, 99, 89,251,246,237,123,200, 24,203,234,215,175,223, 3,198, 88,
- 22,128,157,149,101, 62, 49, 56,233,198,178, 34,235,195, 57,115,230,200, 24, 99,178, 57,115,230,200,128,210, 65, 84, 59, 72,185,
-155, 47,175, 93,108,209, 29,217,204,246,140,234,105,238, 32,229,110,174,116, 57, 29,248, 63,199,109, 92,198,244, 39,182,179, 3,
-147,134,152,219,121,216,159, 11, 14, 14, 94, 60,121,242,228,253, 49, 49, 49, 55,204,102,243,237,228,228,228,219,171, 86,173,186,
-221,166, 77,155,139,206,206,206,241, 2,129,224,131,154,246,209, 11, 66,153,148, 73,153,148, 73,158,108, 96,170,230,119, 63, 47,
- 92,184, 80,194, 24,251,100,192,128, 1,248,230,155,111, 6, 54,105,210,100,176,183,183,183, 43, 0,100,102,102,170,111,222,188,
-169, 24, 48, 96, 0,102,207,158,141, 69,139, 22, 45, 69,105, 95,150,255,165,236,131, 7, 15,250, 76,156, 56, 49,247,171,175,190,
-178,140, 26, 53,170, 33,128,155,249,249,249, 13,134, 12, 25,242, 33,159,207, 31,224,239,239, 31,154,149,149,149,167,209,104,182,
- 3, 88,139, 26,206,153, 86, 69,200,133,185,101, 61, 79,156,224,194,252,216,143,223,152, 61,123,246,160,126,253,250, 25,150, 45,
- 91,102, 82, 40, 20,135,107, 25,247, 48, 47, 47,239,203,242, 59, 78, 78, 78, 30,215,175, 95,255,192,205,205,141,155,156,156, 12,
-157, 78,135,164,164, 36, 11, 74, 79, 77, 85, 74,105, 98, 43,190,223,119, 42,228,147,161,189,236,213,119,175,193,154,199,131,209,
- 74,128,236,223, 79, 96,227,249,187, 10,149, 1, 43,159,101, 61,229,114,249,183,147, 38, 77, 26, 50,117,234, 84,145,191,191, 63,
-231,183,223,126,195,238,221,187,117,185,185,185, 61, 0,156,251, 99,232,167,186,177, 88, 44, 16, 8, 4, 0,128,233,211,167,131,
-203,229, 90,229,230,230, 10, 56, 28,142,144,195,225,216,112, 56, 28,158, 49,229, 54, 44,138, 34,228, 20,201,241, 48, 71, 94,109,
-158,217, 98,217,125,249,242,229,143,155, 55,111,206,189,122,245, 42,242,242,242,144,148,148,196,204,140,237, 60,175, 49,151,118,
- 74,212,213,126,249,108,156,156,251, 54,115, 20,114, 5,155,102, 35, 82,207,229,253, 96, 65,127,148,142,165, 5, 0, 27, 57, 28,
-142, 53,128,130, 70,141, 26,117,186,115,231,142,184, 81,163, 70,154,187,119,239, 30,227,112, 56,222, 0, 54, 87,150, 41, 22,139,
-243, 1,228,239,219,183, 15, 0,198,160,116,227,181,136,138,138,202, 58,127,254, 60,230,204,153,147, 3, 96, 53, 0,216, 58, 58,
-247, 14,149, 90,115, 4, 91,230,160,141, 14,220,149, 22, 86,105,171,171,173,155,123,231, 38, 18, 46,172, 54,124,129, 87, 61, 66,
-184, 2,147,161,233,220,185,115,207, 43,149, 74,221,174, 93,187,244,239,189,247, 30, 47, 49, 49,241, 10,128, 11, 0,246,161,172,
-143, 37, 33,132,144,151,234,201, 22,172, 26,251,104, 61, 89,181,126, 3,224,251,123,247,238, 85, 76, 42,125,239,222, 61, 25,128,
- 31, 80, 58, 26,252, 91,117,168,120,103,149,181,104,173,125,198,149,121, 50, 83, 20, 30, 30, 46,190,115,231,142, 53, 42,159,196,
-145,243, 12,153, 79,169,108,174,195,224,224,224,229, 70,163,113,255, 15, 63,252,176,135,199,227, 13,121,142,106,223, 63, 40, 40,
-168,104,199,142, 29,150,232,232,104, 54,107,214, 44,179,167,167,103, 17,158,238,163,245,167,204, 72, 1,111,239,148,134,222,138,
-216, 97,237,216,253,201,189,217,133,161, 29,217, 88,111, 91, 69,164,136,183,251, 57, 63,149, 4, 73,165,210,141, 98,177, 88, 97,
-111,111,127, 10, 64,219,231,217, 71,206,206,206, 91, 61, 60, 60, 78, 61,126,115,119,119,223,239,234,234,250,157,139,139,203, 44,
- 7, 7,135,113, 1, 34,193,178,201, 13,188,180,241,125, 27,177,211, 17,174,108,168,139,224,201, 83,135, 79, 46,167,103, 64, 64,
- 64,193,182,109,219, 44, 63,255,252, 51,155, 49, 99,134,165, 94,189,122, 10, 84,211,175,173,218, 22, 45, 7,222,238,189,253, 90,
- 91,114,122,122,179,111, 26,218, 89, 58, 57,242,170,186, 66,113,104, 89, 1, 60,162,166,204,192,192,192, 31, 24, 99,155,230,207,
-159,191, 9,127,204, 5,250,250,220,185,115,163, 24, 99, 81,115,231,206,141, 2,208, 29, 0, 34,165,220,109,219,251,180, 52,103,
-190,233,197,190,110,104,107,142,148,114,183, 85,218,146,233,196, 63,120,104,116, 79, 75,214,232, 8, 54, 59, 72, 98,110,237, 36,
-252, 69, 32, 16, 76, 70,105,139,115, 43, 0, 2,250,212, 76,153,148, 73,153,212,162,245,183, 43,188,106,197,195,201,201,105, 99,
-253,250,245,247,248,251,251,239,177,181,181, 93,138,210, 78,243,117,221, 17, 1, 11, 22, 44, 80, 72,165,210,102, 47,112,231,186,
- 1,240,198,211, 19,231,190,176, 3,230, 75, 79, 76, 76,156, 58,240,250,151,158,152,248,216,143, 91, 53,108,216,240,107,148,142,
-230,253,188, 7,161,191,147,147,211, 42, 39, 39,167,140,178,190, 89,254,181,201,108,201,227, 13,233, 36,226,253,214, 86,192,205,
-238, 36,226, 95,122,149,199,123,247, 31,250, 2,172,238, 98,139,170, 50,125, 92, 92, 92,150, 57, 57, 57,101,186,184,184,172,170,
- 99,145,245,167,204,102, 98,120,118,118,224, 29,108,107,199, 81,117,150,242,246,181,180,169,250,162,142, 58,172,123,248,156, 57,
-115, 70, 50,198, 70,122,121,121, 13,120,172,240, 15,157, 61,123,118, 47,198, 88,175,242, 17,224, 91,217,192,173,163, 3,111, 71,
-132, 61, 71,222,209,129,183,163,149, 13,220,170, 90,206, 78, 14,188,221, 17,246, 28,121,164, 61,119,135,159, 16,245,232,205,156,
- 50, 41,147, 50,169,208,250,119, 20, 90,116,192, 80, 38,101, 82, 38,101, 82, 38,101, 82, 38, 21, 90,149, 23, 86,143,223, 42,206,
-176,241,105,219, 16, 66, 8, 33,132, 60,151, 42, 7, 44,229, 84, 83,149,214,165, 99,251,179, 84,182,167, 41,147, 50, 41,147, 50,
- 41,147, 50, 41,243, 63,151, 89, 83,246,255,250,194,186,127, 52,106, 86,165, 76,202,164, 76,202,164, 76,202,164,204,255, 44, 46,
-109, 2, 66, 8, 33,132,144,231, 18, 94,246,245,201,129, 75, 43,239,163,197,111, 53, 63,199,100, 50,185, 1, 0,159,207,207, 53,
- 94,153,229, 89, 93,186, 21,208,197, 84, 58,253, 14,248,192, 24, 19,112,170,146,204, 83, 38,147,201,177, 44,179,200,120,101, 86,
-247,106, 51, 91,205, 63,241,248,227, 77, 87,102,189,254,228, 99, 24,192,179,106, 53, 63,243,137,101,245,170,237, 86,225,224, 79,
- 99, 98,189,180,229,252,167,100,254,151, 89,189, 54, 63,199,104, 44, 61,142,172,172,248,185,134,203,213, 31, 71,214,175,205,207,
-124,252,241,198,203,179,220,171,203,180, 17, 11, 11, 2,189, 93,151, 86,151,153,156,153,255,137, 74,173,117,174, 46,179,174,175,
- 77, 95, 79,207, 46,230,178,215, 38, 15, 24,147,145,149,117,234,111,118, 44,181, 4, 48, 11,128,253, 99, 63,139, 7,240, 17, 29,
-149,132,144,127, 88,161, 21,135,210,121, 14,215,149, 21, 91,235,170, 44,180, 76, 38,147,155,236, 64, 20, 84, 58,160,203,240,249,
-110, 1,125,215, 62, 53, 81,178, 73, 91, 36,144,223,218, 21,202, 51, 42, 28, 93,249, 6,251,204,204, 76, 14, 0,112, 56,156, 31,
- 1,248, 85,146,233, 40, 59, 16, 5,181, 30,136, 28, 60,215,209, 15,176,207,179,182,254, 84, 44,145,116,210,104, 52, 77, 0, 64,
- 44, 22,223,210,168, 84,103, 92, 13,134, 37, 79, 62,190,170, 53,123,124, 89, 59, 15,155,239,214,176,239,218, 73,102,139, 69,240,
-232,234, 15,145,218,252, 68,190,149, 73,183,250,115,224, 88, 84, 37, 69, 85, 21,121,127,252,221,119,102, 56, 91, 1,157, 5, 34,
- 81, 51, 7, 71,199,246, 22,198, 26, 89, 44, 22,142,217,100,186,173, 40, 46,190, 96, 49,153,174,155,244, 42,103,217,225,175, 45,
-213, 45,231,147,235,242, 14,192, 63, 0, 12,144,216,218,118,226, 89, 89,181, 5, 0,179,209,248,155, 74,169, 60,243, 54,176,183,
- 54,235, 94,219,237,243,172,143,255,175, 49, 26, 77,110, 41, 39,162,160, 51, 2,225,253,191,118, 11, 27,178,101, 7, 0,232,115,
-175,187, 43, 19, 15,191, 6, 0,146,192, 94,151,133, 30,225, 57, 0,192, 79,203,114, 75,136,158, 9,157, 17,104,212,107,174, 91,
- 77,153,239,205,222,237, 60,117,108, 63, 33, 0,156,220,247, 93,131, 95,247,127,255, 6, 0,116,238, 55,225, 88,183,254, 19, 19,
- 0, 96,209,186,253,206, 59,191, 30, 88,109,102,237, 94,155,197,214,197,137,209, 65,122, 69,150,131,175,132,239,145,152,152,200,
- 5, 0, 47, 47,175, 90,189, 54,125, 0,105, 22,240, 33,151,199,107, 31, 24, 20, 20, 14,128, 37,223,191, 31,103, 54,153, 46,122,
- 2,171, 95,240,177, 52,137,177, 63, 15,206,202,225,112,232,128, 36,132,252,211, 28, 41, 43,174,142, 60,245, 97,182,170,103,168,
-116,192,185, 36,160, 67,235, 48,140, 29,242,166,237,227,191,219,187,118,174, 95,226,213, 67, 13, 55,108, 89,194, 13, 11, 11, 67,
- 74, 74, 74,173,150, 66,173, 7,206, 38, 2,144,223,177, 43,146, 72,238, 47, 91,188,216,254,245,215, 95,231,123,121,121,129,195,
-225, 32, 59, 59,187,245,233,211,167, 91,126,252,241,199,227, 33,191, 83,164,214,163,228,108, 98,205,185,229,203,218,164, 65, 61,
-204,154, 56, 80, 10, 0,159, 15, 95,221,242,234,189, 28,167,251,247,239,119,153, 54,109, 90, 1,239,204,153,239, 93,128, 77, 57,
-192,195,218, 44,231,214,159, 47,139,164, 89, 63, 5, 12,157, 56,113, 95, 80, 80,144,173,191,191, 63,199,206,206, 14, 60, 30, 15,
- 69, 69, 69,126, 55,111,222,124,227,202,149, 43,170,211,231,126, 20,196, 94,233,157,156, 43,122, 77, 91,171,117,215,100,138, 78,
-218,217,221, 26,246,246,219, 62, 3, 7, 14, 20, 5, 6, 6, 2, 0,238,223,191, 31,188,119,239,222,193,251,246,237,155, 13, 77,
-166, 73,173,135,182,166,117,175,200, 4, 32, 2,218, 58,184,185, 13,229, 89, 89, 53, 49,153, 76,222,101,173, 13,143,204, 70,227,
- 45,121,110,238,246, 39, 31, 79,158,166, 51, 2,119,178,128,174,237,195, 49,172, 95, 87, 9, 0, 76, 27,180,160,117,218,131, 36,
-107,189, 94,143, 6, 33,141, 34,230,125,189,244, 4,184, 92,108,219,127,186,226,241,181,201,140,191,147,130,168,121,203,144,121,
- 99,111,107,115,113, 82,167, 18, 69, 49, 15, 0,236,165,210,126,123,119,253,116,198, 43,116,192,239, 73,249,134, 90,101, 86,247,
-218, 60,190,107,149,103,198,205, 51,141,215,156,220,104,229,231,231,135, 27, 55,110,212,237,181, 89,124,207,206,226,233,121,123,
-201,103,159,121, 68, 70, 70,194,214,214, 22,124, 62, 31, 38,147,169,235,197,139, 23,187, 70, 69, 69, 77, 64,241, 61, 85,109, 95,
-155,181,176,132,195,225,116,122,111,236, 36,207, 55,251, 12, 64,191, 30, 17,116, 32, 18, 66,254,105,202, 91,175, 30,191,242,112,
- 93,181,133, 22,159,207,207,125,125,196, 87,110,237, 95,107,138,171,215, 19,138, 83,211,179,148,229,191, 43,188,181,183, 65,159,
- 8,239,198,231,207,159,131, 78,167,195,111,191,253,134,235,215,175,227,193,131, 7, 24, 55,110,156,174,236,212, 97,101,153, 69,
-145,131,231, 58,162, 56,209, 54, 88,112,239,149,211,119,239,242,180, 90, 45,206,159, 63,143,162,162, 34, 8, 4, 2,248,248,248,
-160, 91,183,110,252,187,119,239, 58,117,121,189,135, 52,178,199,187, 41,144, 6, 43,249,124,126, 81, 85,243,136,240,249,252,220,
- 46,195,231,187, 53, 14,174,135,251,169,153,197,179,190,222,160,180, 88, 24, 63,249, 65,154,225,220,185,115, 8, 15, 15,199,169,
- 83,167,156, 11, 11, 11,191, 88,189,122,245, 44,171,133,107, 86, 24,245, 5, 83, 80,117, 94, 81,228,224,185,142,206,185,123,252,
-127, 61,126,208,250,214,173, 91,214, 63,252,240, 3, 10, 10, 10, 32, 16, 8,224,224,224, 0, 15, 15, 15, 52,104,208,128,243,249,
-231,159,219,246,234,117, 11,255, 55,102,128,191, 33, 96,244,189,170,150,179, 98,221,149,105, 54, 46,138,147,129,251,143, 28,225,
-182,107,215,238, 79, 31,219,235,215,175,143,238,221,187,139,134, 14, 29, 26, 56,112,240, 16, 75,100,207,247,238,195,214, 95, 93,
- 99,166,234,161,216, 89, 29,227,213,117,240,224,195,115,231,206,117,240,240,240,128, 68, 34, 1, 0, 20, 23, 23,251,164,166,166,
-182,158, 61,123,118,255,203,241,187,248,145,189, 30,102, 66,226,171,169,110,123,254, 87, 89, 89,241,115,203, 91,145,236, 36,226,
-162,135, 25, 57, 42, 0,208,235,245,208,235,245,208,233,116,248, 96,194, 56,222,152,254,173,130,252,219, 79,186,246,224, 81, 78,
- 97,163,211,191, 59,149, 63,215, 88, 67, 38, 95,253, 64, 46, 79,255,101, 76,212,103,159,121,184,187,255,113, 70,112,219,214,173,
-188,194,194,194,174, 81, 81, 81,141,153, 77, 71,121,163, 94,115, 29,170,203,172,238,181, 41, 79, 56,242,202,188,137,221,155,173,
-253, 58, 26,102,179, 25, 49, 49, 49, 56,127,254, 60,150, 46, 93,202,142, 29, 59, 86,108, 47,145,140, 65,181,175,205,123,118,237,
- 60,179, 3, 22, 46,220,199, 17, 10,133, 56,116,232, 16,238,222,189, 11, 46,151,139,176,176, 48, 12, 27, 54, 12, 93,187,118,245,
- 24, 59,118, 28,139,236, 49, 40, 25,210,144,146,231, 60,150,184, 0, 38,205,136, 90,232, 57,124,244,135, 88, 52,239,115, 42,180,
- 8, 33,255,228,214,172, 42,135,120, 64,116,116, 52, 43,187,117, 0, 0, 6,112,235,247, 93,187,115, 79,172,229, 72,253,190,107,
-119, 50,128,203, 0,174, 61, 80,175,121,243,230, 70,185, 92,206,174, 92,185,194, 62,248,224, 3,213,138, 21, 43,206, 28, 57,114,
-100,175,201, 96, 88,239,229,233,249, 45,171,162,131, 61, 3,184,254,128,212,198,198, 38, 47, 61, 61,157, 29, 61,122,148,205,153,
- 51,135,109,223,190,157, 29, 59,118,140,157, 62,125,154, 29, 59,118,140,237,220,185,147,197,199,199,179,132,132, 4, 38,145, 72,
-242,252, 1,105, 53,153, 60, 6,240, 26,244,253, 97,202,190,171,198,185, 33,125,215,126,204, 0,158, 35,208,176,121,243,230,230,
-189,123,247,178,109,219,182,177, 45, 91,182,176,248,248,120,150,159,159,207,248, 66, 73, 94,249,243,170, 90, 78, 6,112,189,189,
-189,243,228,114, 57,243,245,245,101, 2,129,128,185,187,187,179, 6, 13, 26,176,214,173, 91,179, 55,222,120,131, 13, 25, 50,132,
-125,241,197, 23, 76, 46,151, 51,145, 72,148, 83,254,188,170, 50,195, 1,177, 68, 34, 73,151,201,100,172, 42, 26,141,134,229,231,
-231,179, 19, 39, 78, 48,137, 68,146, 30, 14,136,171,203, 20, 3, 45, 66, 67, 67,243,242,243,243,153,193, 96, 96,233,233,233,236,
-230,205,155,236,238,221,187, 44, 61, 61,157,105, 52,154,138,236,132,132, 4, 22, 16, 16,144, 39, 6, 90, 48,186, 8,162,202, 99,
-233,201,155,159,187,251, 27, 30, 30, 30,154,125,251,246,177, 71,143, 30,177,205,155, 55, 51, 46,176,224,201,199, 85,151, 41, 0,
-186,181,107,215,206, 28, 19, 19,195,174, 93,187,198,166, 79,159,206,186,119,239,206,122,244,232,193,162,162,162, 88, 70, 70, 6,
-203,200,200, 96,111,188,241,134, 89, 0,116,171,233,248,172,236,181, 41, 5,252,122,245,234,165, 49, 24, 12, 44, 57, 57,153, 53,
-105,210, 36,131, 7, 12,149, 0,141, 59, 0,194,154,142, 79,111,192,209,211,211, 51, 43, 38, 38,134,237,223,191,159,249,251,251,
-231,241,128,247,236,129,250,246, 64,125, 30,240, 94,253,250,245,243, 98, 98, 98, 88, 65, 65, 1,243,243,243,203,242, 6, 28,159,
-227, 88,226, 2,216, 56, 35,106, 33,187,151,161, 98, 51,162, 22, 50, 0,233,140, 49,134, 74,250,120, 18, 66,254,253,158,172, 69,
-254, 45, 42,222, 36,123,245,234,197, 1,112,182,186, 7,107,120,188,175, 22, 45, 90,196,215,106,181,216,176, 97, 67,201, 59,253,
-251,239,233,208,190,125,242, 43,254,254,114, 14,151, 91,227,108,195,121, 66,225,228, 69,139, 22, 57,232,245,122,196,198,198,162,
-101,203,150,240,240,240,128,173,173, 45,108,109,109,225,230,230,134,144,144, 16,228,230,230,194,206,206, 14, 83,167, 78,149,230,
- 9,133,147,107,202,181, 88, 24, 31, 0,204, 22,139,192, 26, 24, 27,240,234,171,177,179,103,207,230, 58, 59, 59,195,201,201, 9,
-182,182,182,184,123,247, 46,244,122, 61,108,196, 54,181, 26,164,149,203,229,114,109,109,109,241,235,175,191, 98,210,164, 73,104,
-219,182, 45, 28, 28, 28, 96,103,103,135, 38, 77,154,160, 91,183,110, 24, 51,102, 12,146,147,147,193,169, 69,167,146,219,124,254,
-135, 99,198,140,113, 11, 15, 15,175,244,247, 90,173, 22,114,185, 28,121,121,121,240,241,241,193,128, 1, 3,220,110,243,249, 31,
- 86,149,231, 12,120,248, 4, 7, 31,190,114,229,138,139, 68, 34,193,182,109,219,112,240,224, 65, 28, 63,126, 28, 71,143, 30, 69,
-116,116, 52, 14, 29, 58,132,188,188, 60, 0, 64,112,112, 48,118,239,222,237, 98,235,230, 22,237, 12,120,208, 75,186,118,210,114,
-114, 78, 54,201,206,118, 25, 58,100,200, 5,165, 82,137,161, 67,135,226,171,111,190,249,220, 10,248,184, 54,207, 15, 1,164, 78,
-158,158,155, 22, 46, 92,200,205,206,206,198,219,111,191,157,191,228,155,111,222,143, 59,113, 34, 80,118,252,120,224, 87,115,231,
-190,223,161, 67,135,252,140,140, 12,108,221,186,149,235,238,231,183, 41, 4,144,214,117, 57, 75,128, 73,203,151, 47, 23,105,181,
- 90,188,254,250,235,201,150, 91,183, 66, 76,192, 79, 74,224,238, 89,192, 80,211,243,179,128, 15,167, 78,157,234, 33, 20, 10,241,
-233,167,159,230,171,211,210,154,154,128, 45,197, 64,106, 49,144,106, 2,182,148,164,164, 52, 29, 62,124,120,190, 80, 40,196,178,
-101,203, 60,178,254,152,116,187,182, 90, 2, 56, 12,224, 28,128,204,247,198, 78,122, 47,188, 85, 27,108, 93,191, 26, 95,207,157,
-182, 9,192, 59, 28, 14,103, 59,128, 41,116,228, 17,242,223, 84,155, 90,228,111,170,202, 41,119,248,143, 87,146, 0, 58, 86,151,
-226,232,236,220,178,105,211,166, 56,127,254, 60, 66, 67, 67,175, 56, 56, 56,152,172,133, 66, 88, 89, 89,129, 89,106,172,179, 32,
-150, 72,186,116,237,218,149,255,251,239,191, 35, 32, 32, 0, 98,177, 24, 86, 86, 86,127,186, 89, 91, 91,195,211,211, 19, 10,133,
- 2, 93,186,116,177, 90,185,114,101, 23,232,116,243,106,252,135,152,120,211, 54,239,247,133, 67,126,220,188,169,126,100,100, 36,
-138,139, 21,176, 88, 44,176,177,177,129, 94,175, 7,159,207, 47, 61, 5,100,100,138,218,108, 49,179,217,108,230,241,120, 8, 8,
- 8,192, 87, 95,125, 5,173, 86, 11,107,107,107, 0,128, 66,161,128, 92, 46,199,205,155, 55,145,154,154,138,178, 79,225,213,178,
-147, 74,223, 28, 56,112, 96,165, 19,254,234,116, 58, 20, 23, 23,163,184,184, 24,114,185, 28, 90,173, 22,109,218,180, 17, 28,137,
-142,126, 19, 5, 5, 75, 42,125,142, 72,212,127,235,214,173,110, 2,129, 0, 26,141, 6, 37, 37, 37,120,248,240, 33,210,210,210,
-180,185,185,185, 38, 59, 59, 59,174,191,191, 63, 87, 40, 20, 10,251,246,237,203, 81, 40, 20,224,112, 56,232,213,171,151,243,142,
-109,219, 6, 66,175, 95, 74, 47,233,218, 57, 9,232, 90,232,245,111,189,214,170,213,175, 87,174, 94, 13,159, 60,121, 50,226,227,
-227, 23,218,236,218,117, 78, 13, 92,175,238,185,201,192,135,223, 62, 86,192,176,180,180, 80, 3,144,247,216, 67, 82,253, 83, 82,
-142, 15, 31, 62,252, 70,124,124,188,203,178,101,203, 60,222,121,251,237, 15, 1, 44,168,203, 50,218, 73,165,175,122,122,122,226,
-216,177, 99, 72,127,240, 96,154, 9,208,212,233, 19, 23,143,215, 46, 50, 50, 18,135, 14, 29, 66, 70, 90,218, 52,211,159,151,177,
-244,131, 18,144,199, 79, 78,158,182,105,211,166,141,163, 70,141, 2,143,207,111, 7, 83,157, 78, 28, 62,213,241,125,212,184,201,
-216,180,110,229, 38, 0,163, 1, 88, 0, 92,161, 35,142,144,255,118,171, 86, 77,181,200, 63,168,216, 90, 87,231, 22, 45, 55, 55,
- 55,111, 91, 91, 91,100,102,102,162, 81,195,134,185, 66,161, 16, 2, 43, 43,136, 4,130, 90, 45,129, 90,173, 14,245,242,242, 66,
-113,113, 49, 92, 92, 92, 96,109,109, 93,113, 19, 8, 4, 21,223,219,217,217,129,203,229,194,207,207, 15,106,181, 58,180,198,220,
-156,155,110,187, 86, 78,248, 32,230,220,177,250,111,191,221, 15,142,142, 78,240,245,245,129,155,155, 27,196, 98, 49,124,125,125,
- 17, 24, 24,200,150, 44, 89, 2, 27,183,176, 90,189,145, 63, 94, 60,241,249,124,152,205,102,228,228,228,224,222,189,123,136,143,
-143, 71, 76, 76, 12,174, 93,187,134,146,146, 18,212,162,206,130, 90,163,105,198,231,243, 43, 45,178,228,114, 57,228,114,121, 69,
-161,149,151,151,135,212,212, 84, 40, 85,170,230,213, 20,189,253,154, 54,109,202, 3, 0,177, 88,140,230,205,155, 99,237,218,181,
-166,159, 15, 30, 28,212, 56, 38,198,201,247,196, 9,135, 31,127,248, 97,208,128, 1, 3,204,191,255,254, 59, 20, 10, 5,238,220,
-185, 3, 87, 87, 87,190, 64, 36, 26, 72, 47,231,186,145, 1, 42,151,146,146, 30,109,219,182, 77, 41, 46, 46,198,226,197,139,185,
- 86,118,118,235,230, 86,113,138,175, 2,143, 23, 17, 25, 25,137,195,135, 15, 35, 51, 45,109,122, 90, 37, 5, 76, 26,144,151,158,
-156, 60,125,211,166, 77,232,214,173, 27, 56,124,126,157, 59, 42,181,110,221,186,169,197, 98,193,141, 27, 55,224, 0, 92,174,235,
-243, 3,131,130,194,203, 91,126, 37,192,133,170, 30, 39, 1, 46,196,197,197, 65, 44, 22,163, 81,227,198, 45,234,248,103,150,112,
- 56,156,172, 81,227, 38, 99,255,241, 75, 0,128, 77,235, 86,230, 60, 86,100, 17, 66,168, 69,235,159,218,162, 85, 94, 88, 61,126,
-195,159, 10,173, 90, 22, 31, 0, 0, 43, 43, 43, 8,132, 66, 8, 4,130,210, 2, 73, 40,172,117, 6,135,195,129, 72, 36,170, 40,
-172, 30, 47,176, 30,255,222,198,198,166, 86, 5, 12, 0, 20, 37, 29,111, 63,250,253, 81, 2,161, 80, 8,189, 94, 7,198, 24,132,
- 66, 17, 28, 28, 28, 16, 16, 16, 0,133, 66,129,182, 17, 29,116, 15,229,214,209,206,141,250,198, 63,203,214, 51,153, 76, 80,169,
- 84, 40, 42, 42, 66, 97, 97, 33, 20, 10, 5, 52, 26, 77,173, 47, 69,183, 88, 44,188,135, 15, 31,226,167,159,126, 66, 65, 65, 1,
-128,210,142,214,229,197, 85,249,215,148,148, 20,108,219,182, 13, 15, 30, 60,168,211,254,105,223,190, 61,162,163,163,121, 29,187,
-116, 89,127,202,223, 63,243,148,191,127,102,199, 46, 93,214, 31, 62,124,152,231,237,237,141,212,212, 84,196,198,198,162,168,168,
- 8,140, 49,186,126,254, 25,220, 7,138,212,133,133,163, 62,255,252,115,102,107,107,139,197,223,126,219,108, 1,240,110,109, 11,
- 24,105, 53, 5,140,244,249, 10, 24, 48,198, 96,177, 88, 96, 54,155,159,105,221, 56, 28, 14,199,202,202,170,174, 67, 43,212,229,
-193, 21, 29,223,167,126,241, 21,142, 30,218, 91,254,243, 68, 42,178, 8, 33,255, 2, 85,118,132,231, 63, 86, 65, 86,124,173, 74,
- 78, 78,206, 35,149, 74, 85,223,223,223, 31, 25, 25, 25,110,126,126,126,105, 2, 43, 43, 88, 11, 4,224,112,107,174, 9,108,108,
-108,110,100,102,102, 70,120,123,123,195,100, 50, 85, 20, 85, 79,158, 58, 44,111,165,185,118,237, 26,108,108,108,110, 64, 91,237,
-200, 9, 48,235,139,234,181,104,209,162,162,101,200,193,193, 1, 14, 14, 82, 8,133, 34,204,156, 57,211,178,108,201,146,213,126,
-157,231, 22,143,252,248,115,246,249,130,245, 47,116,203,214,246, 31,147,141,141,205, 13, 95, 95,223, 54, 82,169, 20,251,247,239,
- 71,106,106, 42,138,138,138,160, 86,171,161,211,233,160, 86,171,161,215,235, 33, 18,137,208,184,113, 99,216,219,219,227,244,233,
-211, 55,160,211, 85, 94, 92, 22, 20,236,191,113,227, 70,155, 86,173, 90, 85,180,168,116,234,212,137,211,169, 83, 39,151,138, 86,
- 52,181, 26,249,249,249,184,114,229, 10, 78,159, 62, 13, 14,135,131,196,196, 68,179, 78,163,217, 73,175,137,103,163, 5,126,227,
-109,218,180,113,252,248,241,239, 71, 68, 68,192, 12,188, 1, 96,219, 95, 88,192, 0, 0, 98, 98, 98,110,154,205,230,136, 6, 13,
- 26, 64, 14,188, 6,224, 80,157,138,200,164,164, 56,147,201,212,165, 89,179,102,216,191,103, 79,123, 0,169,149, 61, 78, 5,180,
- 15, 15, 15,135, 70,163,193,157,219,183,101,117, 40,178,214,207,136, 90,248,222,240,209, 31, 98,235,250,213,216,180,110,229,195,
-141,107, 87,248,162, 22,253,199, 8, 33,255,169,214,172, 26,107,145,191,169,177, 85, 21, 95,252,186,164, 20, 23, 21,201,226,226,
-226,234,183,104,209, 2,235,215,175,111,213,182, 77,155, 71,214, 2,129, 73, 96,109, 13,110, 45,254,145,104, 84,170, 95,126,249,
-229,151,215,250,246,237,203,255,253,247,223,225,225,225, 81, 81,104,149,127,229,243,249, 96,140,193,198,198, 6, 7, 14, 28, 48,
-104, 84,170, 95,106,108, 45, 50, 91,204,220,178, 66,143, 49, 6,185, 92, 14,107,107,107, 44, 93,186, 12,171,150, 44, 25, 98, 6,
-246, 6, 75, 92, 63, 3, 32,250,203,254, 65,171,213,191, 30, 61,122,180,229,236,217,179,173,124,124,124, 32,151,203, 81, 84, 84,
-132,130,130, 2, 40, 20, 10, 40, 20, 10, 20, 21, 21, 65, 46,151, 67, 36, 18, 33, 62, 62,222,168, 85,171,127,173, 42, 79,168,213,
-238, 27, 49, 98,196,212,184,184, 56, 79, 62,159, 15,163,209, 8,139,197, 2,139,197, 2,131,193,128,164,164, 36,220,186,117, 11,
-119,239,222, 69, 97, 97, 33,172,172,172,192,227,241,112,237,218,181, 34,137,209,184, 71, 79,175,233,103,102, 5,236,191,120,241,
-226,251,195,134, 13,131,151,143, 79, 7,100,100,212,170,128, 57, 88, 77, 1, 83,252,108, 5,204, 31, 5, 80, 73,201,213,148,148,
-148,136,142, 29, 59,194,211,199,103, 97,227,140,140, 83,183,235,208, 79,203,108, 50, 93,184,120,241, 98,151,225,195,135, 99,253,
-250,245, 11, 93, 83, 82,142,231, 61,113,154,211, 21,112,125, 37, 48,112,225,123,239,189,135,147, 39, 79,194,108, 50, 93,168, 38,
-242,241, 17,223,235,189, 55,118,146,239, 19, 29,223,215,114, 56,156,137, 0, 22,211, 17, 69, 8,249, 55,183,104,213,233,212,161,
-216,108,158, 49,101,202, 20, 35,151,203, 69,191,126,253,236, 14, 29, 62, 60,224,218,245,235, 1,185,185,185, 14,102,179,185,198,
- 44, 87,157,110,197,148, 41, 83,228,122,189, 30, 33, 33, 33, 40, 44, 44,132,217,108, 6,159,207, 7,159,207, 7,135,195, 1,151,
-203,133,173,173, 45,226,226,226,176,113,227, 70,133,171, 78,183,162,198,127, 18,102,243,141,109,219,182,129,199,227, 49,145, 72,
- 4, 14,135, 3, 62,159,143,101,203,150,229,174, 2,246, 3, 0,143,203,213, 3, 0,151,203,169,109,239,221, 26,207, 91, 10, 4,
- 2, 88, 74, 47, 2,168,241,177,142, 58,221,242, 69,139, 22,149,220,185,115, 7, 42,149,170,162,245, 77,169, 84, 86,116,174,151,
-203,229,224,112, 56, 80,169, 84, 56,124,248,112,137,163, 78,183,188,170,188, 2, 32, 59, 35, 49,177,119,171, 86,173, 10, 82, 82,
- 82, 80, 92, 92,140, 27, 55,110,224,244,233,211,216,189,123, 55, 78,158, 60,137,164,164, 36,152, 76, 38,120,123,123,131, 49,134,
-131, 7, 15, 22,155, 74, 74,222, 40, 0,178,233, 53, 81,181,122, 30, 30, 93,220,221,220,210, 93, 93, 92, 50,234,121,120,116,121,
-242,247, 82, 32, 33, 33, 33, 1, 38,147, 9, 1, 1, 1, 78,213,245,211, 98, 38,211,197,139, 23, 47, 98,248,240,225,240,173, 95,
-255, 27,127,192,245,201,199,248, 3,174,254,129,129,223,148, 23, 48,204,100,186, 88,215,101,182, 3, 86,126,246,217,103, 26,107,
-107,107,236,218,181, 43,192, 24, 20,116,151, 15,188,107, 11, 52,236, 8, 88,215,244,124, 79, 96,245, 23, 95,124,145,205,225,112,
-176,125,251,118, 23,105, 96,224, 77, 62, 48, 66, 10,212,147, 2,245,248,192, 8,105, 96,224,205, 93,187,118,185,152, 76, 38,124,
-252,241,199,217,158,192,234,106, 34, 39, 49,198,222, 98,140, 69, 50,198,124, 55,174, 93,129,163,135,246,150, 23, 89,163, 81,218,
-233,125, 24,128,155,116,196, 17, 66,254,205, 42,109,134,226,183,154,159, 3, 48,183, 14,173,195,112,245,250,189, 98, 23, 71,251,
- 19,229,191, 43,188,181,183, 65,231, 80,251,176, 53,107,214,192,202,202, 10, 15, 31, 62,196,237,219,183, 97,111,111,143, 33, 67,
-134,232, 52, 37, 37,189, 31,155,235,176, 43,128,211,101,153,165,243,169, 21, 39,218, 6,242,227,235, 31, 63, 26,205,147, 74,165,
- 80, 42,149,224,114,185, 16,137, 68,176,177,177,129, 88, 44, 70,108,108, 44,122,190,213,199,156,103, 19,249,199,128,165,127,204,
-167, 86,145, 89, 62,214,208,107,128, 77, 28,240,169,155,151,215,148, 89,179,102,137,187,119,239, 14,107,107,107,248,212, 11,206,
- 14,232,177,120, 37,151,203, 49,101, 20, 40,102, 6,214,243,146,222, 78, 76, 5,192,201, 53, 94,153,229,245,216, 92,135, 79, 45,
-167,159,254, 92,192,129, 45, 75,236,155, 55, 47,237,143, 46,151,203,145,147,147,131,220,220, 92,200,229,114,168, 84, 42, 0, 64,
-116,116, 52,142,158,191,171,208,248, 12, 72,174,106, 57,255, 88,247,123,118, 94,134,203,175,236,216,182,133,231,234,234,138,156,
-156, 28,228,229,229, 65, 46,151, 67,163,209,192,108, 54,163,176,176, 16, 27, 54,109, 49, 23,216, 70, 62,168, 24, 16,178,186, 76,
-213, 67,177,147,242,146,119,120, 99,127,246,254,251,239,219,217,219,219,195, 98,177,160,168,168, 8,233,233,233, 72, 73, 73,193,
-249,243,231, 85,185,114, 61, 84, 46,175,103, 84, 12, 88, 90, 73,230, 11,244,143,203,124,124,220, 42, 47, 79,207,204,180,180, 52,
- 55,179,217, 12,111,111,111,147,188,176,240, 27, 1,112,210, 14,200,250,127,246,174, 59, 44,138,107,125,191, 51, 59,219,119, 89,
-250,210, 81, 68, 64,186, 34,150, 24, 75, 20,236,216, 75, 52, 26, 77,108, 49, 49,177,196, 36, 26, 19, 91,212, 24, 99,162,166, 89,
-163,198,146,216,176, 4, 59,138, 98,185, 54,176,208, 65, 4, 1, 41, 75,221, 93,182,183,249,253, 33,112,209, 0,187,152,228,222,
- 27,127,251, 62,207, 62, 44,187,179,239,156,115,230,204,153,247,124,231, 59,223, 7,128,174, 0, 62,219,248,221,119,111,143, 24,
- 49, 2, 93,186,116, 41, 44, 45, 43,243,105,170, 47,209, 0,163, 3, 96,171,244,244, 76,189,117,235,150,107, 65, 65, 1,222,124,
-243,205,138,199, 15, 31, 46,170,247,215,146, 2,189,218,180,111,191,246,192,129, 3, 78,237,218,181, 67, 88, 88, 88, 41,183,160,
- 32, 36, 19,144, 54,211, 63,155,189, 55,107,178, 78,250,204, 30, 21,218,229,221,119,223,133,193, 96, 64, 98, 98, 34,110,222,188,
-137,199,143, 31,227,218,181,107, 53, 34,129,224,245, 70,185, 14,155,236,159,131,253, 21,190,251,246,237, 37, 88, 44, 22,118,237,
-218,133,228,228,100, 0, 64, 68, 68, 4,222,122,235, 45, 24, 12, 6, 76,154, 52,153, 62,153,201,203,109,169,127, 2, 8, 5,176,
- 30, 79, 69, 94, 23,154,166,185, 4, 65, 20, 3,240, 66,235,124,178,172,253,211,202,105,229,252,255,195,249, 82,194,108,174,195,
- 85,155, 97,251,108,154,143, 25,197,135,183,174,160,122,246,234, 29,184, 98,249, 50,178,107,215,174,240,242,242, 66, 68, 68, 4,
- 10, 10, 10, 56,118,118,118,230,242,169,213,246, 30, 52,241, 81,120,120,184,221,162, 69,139,108, 7, 12, 24,192,244,242,242, 2,
- 77,211, 72, 78, 78, 70,108,108,172,110,199,142, 29, 50,165,203,176,154,164,132, 95,107, 45,201,167,118, 19, 80, 2, 88,233, 89,
- 92,188,237,189,217,179,151,117,234,220,121,218,242,229,203, 73, 33,159,199, 92,179,100, 58, 23, 0, 86,253,112,208,118,196,216,
- 55,176,209,237,243,221,133, 0, 0, 32, 0, 73, 68, 65, 84, 15,232, 51,177,233, 60,114,141,203, 89, 80, 52,227,241,144, 81, 81,
-126, 31,206,121,219, 56,126,252,120,129, 72, 36,130,151,151, 23,236,237,237,145,155,155,139,162,162, 34,250,247,223,127,175,253,
-215,221, 44,230,177,115,183, 31,115,109,221, 44,201, 75, 40,239, 61,112, 92,222,144, 33, 67,236,167, 76,153, 98, 19, 25, 25,201,
-228,112, 56,224,112, 56, 40, 43, 43, 67, 78, 78,142,238,247,223,127,175, 85,138, 7, 87, 39, 37, 28,144, 91,152,235, 80,213,123,
-194,138,156, 43,231,151,207, 79,125,240, 96,178, 9,232,168,211,233, 60,140, 70, 35, 65,146,100,137,201,100,122,160,147,203,119,
-106, 34,150,111,176,230, 58,180, 12, 70,163,145,101, 52, 26, 81, 83, 83,131,243,231,207, 83, 15, 31, 62,252,236,222,189,123,159,
- 21, 23, 23, 67,175,215, 99,204,152, 49,136,136,136, 64, 66, 66, 2,202,203,202,126,111,137, 43, 19,144,114,138,138,222,154, 49,
- 99,198,233,189,123,247,146,247,238,221,115,218,181,107,215,207, 77, 9,152,201,147, 39,155,202, 10, 10,222,210, 0,210, 22,250,
-103, 75,247,102,197,153, 3,223,223, 27, 57,122,108,240,242,165,159, 49,123,244,232, 1, 39, 39, 39,244,234,213, 11, 58,157,206,
- 46, 40, 40,200,220,189, 41,239, 61,232,245,220,142, 29, 59, 10, 54,108,216,224,250,246,219,111, 99,206,156, 57, 0, 0,149, 74,
-133,115,231,206, 97,254,252,249,165, 5, 84, 55,133,185,254, 89,103,169,170, 23, 96,151, 1,244, 6,144, 11,171,227,187, 21, 86,
- 88,241,114,162, 62,169,180, 27,158, 38,150, 62,137,167,147,115,243,185, 14,175,220, 76, 65,227, 52, 31, 79,225,150,102,240,158,
-242,112,214,194,181, 97, 12,189,204,158, 73,168, 69,217, 89, 89,132,185,156,135, 13,249,212,108,253,107, 29, 31,253,214,117,205,
-170, 85,115, 55,110,220, 24, 85, 31,194,129,207,231, 63, 80, 41, 20, 23,156, 53,154, 77, 74, 91,255, 11,173,205,205, 87, 4,148,
- 1,152,109,159,148,244, 93,204,136, 49,235,184, 14,190,204, 79, 87,239, 80, 51, 72, 82,155, 83, 92,142,141,126,128,192,130, 13,
-146, 74, 45,144, 90,227,102, 40,115, 28,155,249,249, 71, 31,125,184,106,229,202,174, 66,161,176,143,206, 96,240, 55,153, 76,128,
-201,148,173, 84, 40, 46,211, 58,221, 45, 77,196,210,111,184,182,110,180,197,121, 9,237,130,228, 14,121,135,187,238,222,185,243,
-131, 67,135, 14,253,161,238,142, 26,205,119, 74,187,160,120, 75,234,222,248, 24, 53,112, 29, 18,201,245,150, 76,151,214, 92,135,
- 22,206, 62, 76,166,153,246,246,246,123,162,162,162,184,209,209,209, 24, 58,116, 40,122,244,232, 1,147,201, 4,154,166, 33,151,
-203,113,240,224, 65,172, 91,183, 46,219, 7, 88,105,142, 79, 3, 92,224,156, 58, 53,184, 99,199,142,187, 90, 18, 48,117, 34,203,
-172, 79, 98,203,247, 38, 39,219, 96, 59, 60,127,194,123,107,252,180,178, 18, 59, 71,190,193, 53, 53,229, 1,105,249,189,217, 65,
-110, 76, 62,216,109,204,168, 81,239, 49, 40,170, 87,221, 14, 72, 58, 61, 45, 45,169, 62,169, 52, 34,222, 58,223,202,190, 84, 31,
-187,206,234,248,110,133, 21, 86,188,236, 66,107, 40,158,250,107, 53,164,228,105, 54,215, 97,189,213,135,162, 40, 73,238,177, 89,
-111,180,196,206, 4,162,234, 44, 89, 48,155,235,176,238,125, 62, 32,135, 70,243,197, 51,193, 72, 27,237, 46,100, 62,119,124,107,
-194, 34, 86, 3,153, 48,104, 98, 32, 73, 3, 78,204,126,202,215,117,213, 39,141,235,212,236, 67,246,153,243,178,170,212,192, 21,
-212,214, 94, 65,109,109,147, 78,187, 76,138, 85,101,174,156,207,215,189, 0,144,253,217,186, 63,207,105, 86, 60,252,137,246,252,
-255,134, 39, 21, 21,199, 0, 8, 61,227,226, 92,206,196,197,141,255,112,193,130, 49,110,238,238,237,157,156,156,236,109,108,108,
-200, 27, 55,110, 60, 50,168,213,223,117, 2,118,215, 89, 83,205, 66, 3, 92,232, 80, 80, 16, 50,110,212,168,247, 8,138,234,217,
- 88,192,208, 6,195, 53, 95,224,199,150, 44, 89, 47,122,111,122,113,220,162,234, 44, 89, 96, 0, 51, 44,233, 27, 69, 79,203,177,
- 26, 6,195,106,220,191,223, 68,159,111,117, 95, 90, 69, 16,132, 28, 86,199,119, 43,172,176,226,229, 69,125,190,195,147,255,233,
- 19, 71, 91, 57,173,156, 47, 17, 39, 3, 79,119,209, 89,219,211,202,105,229,180,114, 90, 57,173,176, 8,148,181, 9,172,176,194,
- 98, 24,241,239,101, 48, 43,172,176,194, 10, 43,172,168, 71,189,111, 86, 99,108, 3,158,186,238, 52,167, 74, 91,179,155,224, 69,
-148,109,188,149,211,202,105,229,180,114, 90, 57,255, 43,156,124,252,113,217,219,218,158, 86,206,255, 20,167, 57,238,127,226,110,
-198,122,159,172, 6,223,172,255, 20,172,102, 85, 43,167,149,211,202,105,229,180,114, 90, 57,173,156, 47, 59,220,234, 68, 86,227,
- 23,128, 86, 6, 44,181,194, 10, 43,172,120, 89,177,124, 57, 72,154, 6, 65,211,203, 73,154, 62,196,160,233,177, 12,154,198,159,
- 74, 5, 50,118,108,211,193,108,223,127,195,222,198,218,226, 86, 88,241, 82,161, 4,205, 36,149,182,250,104,253,119,225,237,234,
-234,186, 21, 0, 81, 90, 90, 58, 19, 64,129,181, 73,254,247,224,224,224, 16,101, 48, 24, 32,147,201, 46,188,140,245, 11,110,143,
- 81, 52,137,160,134, 15,104, 20,164,231, 96, 79, 83,199, 6,249,225, 77, 16,255,142,197, 69,152,144,158,246, 16, 71, 91,113, 58,
-114,112,180,215,143, 0,112, 58,190,240, 61,252, 61,113,181, 2,156,157,157,207, 82, 20, 69, 25,141,198,217, 18,137, 36,174,121,
- 33, 52,150, 1, 0, 76, 58, 97,113, 77,169,120,209,188,119, 8,166, 82,179,179, 70,163, 82, 72, 25, 76, 70, 30,135,233,122,117,
-214,219,228,233,234,218, 87,210,154,250,253,225,195,135,155,205,226, 29,226,135,193,164, 49,120, 88, 68,232,163,220,245,155,186,
-110,236,227,235,196,124, 84,120, 87,248,213, 22,233, 86,182, 93,155, 97,111,142, 39,226, 40, 62, 49,121,231,206,202,218,151,245,
-222, 89, 3,144,122, 38,179, 3, 97, 50,249,130, 32,248, 4, 0,218,100, 50, 17, 36,249,136,107, 48,100, 45, 4,106, 95,128,211,
- 65, 7,132, 49, 57, 28, 47,163,193,224, 66, 0, 52,131,162,202,244, 26, 77, 33, 11,184,191, 24,168,121,217, 57, 89, 28,142,167,
-209, 96,112, 1,128,255,197,114, 90,241, 44,154, 21, 90, 66,161,240, 14, 73,146,158,141,147,225,214,231, 19,172,255,172,241,119,
- 4, 65,192,104, 52, 22, 85, 87, 87, 71,182,226,252, 34, 0,227, 1,212,111, 81,223, 15,224, 32, 94,220,225, 88,196, 98,177, 22,
- 10, 4,130,126, 42,149, 42, 4, 0,120, 60, 94,170, 66,161,184,168,211,233,214,191, 32, 47, 5, 96,156, 80, 40,236, 75,146,100,
- 95,154,166, 9,154,166, 19,106,107,107, 47, 2, 56, 4,224, 69, 34, 37,240,196, 98,241,106, 7, 7,135,137,139, 23, 47,174,116,
-116,116,236, 48,127,254,252,219, 85, 85, 85,191, 86, 84, 84, 44, 65, 43,114,212,253,205,104,239,234,234,186,159,201,100, 50, 10,
- 11, 11,251, 2,128,151,151, 87,130, 86,171, 53, 74, 36,146, 55, 0, 60,108, 37,159, 0, 64,119,161, 80, 24, 41, 20, 10,123, 27,
-141,198,160,186,252,140,233,181,181,181,137, 58,157,238, 14,128, 27, 0, 20,255, 67,247,136, 13, 69, 81,123,235,250,186, 63, 0,
-249,203, 54, 8,208, 36,130,210, 82, 51, 58, 52, 8,175,144,192,230, 15, 38,224,221,196,177, 22, 11,173,126,125,220,134, 13, 31,
-222,159, 4, 0,173,254,244,176,139,151, 75,142,255,197,213, 9, 24, 61,122,244,245,189,123,247,218,107, 52, 26,204,156, 57,115,
-127,124,124,252,143, 50,153,108,113,139, 3,135,208,126,254,215, 27,206,241, 9,130, 4, 0,177,201,100, 20, 63,121,242,208, 63,
- 45,229,250,160,212,212,127,173, 81,101, 92,188, 97, 34,152,179,116,232,149, 97, 73, 33,130,124, 17, 51,108,204,168,161, 43, 87,
- 46,199,196,215, 39,182, 77, 77, 85,243, 60, 68,185,236, 42,149,192,207,209, 89, 60,124,229,170,195,196,213, 43,199,134,239,221,
-181,226,226,219,111, 59,246,123, 9,197, 22,177,140,205,246,214, 27,141,131, 72,160,132,178,177,201, 5,139,165, 4, 0,210,104,
-100,104,101,178,246, 74,138,154,244, 5,112,235,115,131,225,174,165,156,171, 40,170,187,173,159, 95,239,215,143, 29,131,208,203,
-139,162, 56, 28, 18, 0, 12, 26,141, 87,109, 97,161,219,129,225,195,187, 45,207,202,186,180, 28,184,105,229,252,175,112, 90,209,
- 26,161, 69,146,164,231,147, 39, 79,196, 2,129,224,233, 96, 76,211, 48, 26,141, 48, 26,141, 13,201,139,105,154,110,248,107, 48,
- 24, 16, 24, 24,104,209,140, 22, 64, 63, 0, 83, 95,123,237,181,177,235,215,175,103,134,133,133,213,167, 12,233,245,233,167,159,
-254,144,156,156,124, 4,192,110, 60, 13,222,104,233,140,119,160, 64, 32,216,247,245,215, 95,139,250,247,239, 79,185,187,187,131,
- 32, 8,148,150,150,118,143,143,143,143,156, 63,127,254,108,133, 66, 49, 9,192,217, 86,180, 79,168,141,141,205,225, 81,163, 70,
-121,246,233,211,135, 27, 28, 28, 12,163,209,136,187,119,239,190,125,231,206,157, 9, 71,142, 28, 89, 38,151,203,199,194,242,124,
-109,132, 80, 40,156, 34, 18,137, 86, 47, 93,186,212, 97,210,164, 73,236,148,148,148,106, 95, 95, 95,226,234,213,171,206, 7, 15,
- 30,156,189,118,237,218,113, 50,153,108, 73,109,109,237, 47,176, 32,135,162,141,141,205, 29,146, 36, 61, 45, 17,194, 0, 90, 35,
-134, 59,249,248,248, 28,188,114,229,138, 79,126,126,190,113,228,200,145,123, 0,224,226,197,139, 97,122,189,158, 24, 48, 96,192,
-233,162,162,162,241, 0, 44, 29, 36,195, 29, 28, 28,142, 79,156, 56,209,161,125,251,246,124, 31, 31, 31, 66, 32, 16,128,193, 96,
- 64, 42,149,186,167,164,164, 68,223,188,121, 83, 21, 31, 31, 95,165,209,104,134, 3,184,223,138,235,212, 67, 44, 22, 79,102, 50,
-153,161, 6,131,193, 3, 0, 40,138,122,162,215,235, 83, 36, 18,201, 94, 0,215, 95,244, 6,113,113,113,249,126,245,234,213, 78,
- 18,137,132, 94,187,118,237,247,114,185,124,202,203, 58, 24,236,255,245, 16,238,220,190, 9, 60, 77,155, 67, 52,209,255, 8, 0,
-172,121,243, 22, 32,178, 75, 55,188, 49,113,156, 89,206, 33, 81,158, 95, 51,217, 44, 71,181, 90,125, 93,170,212, 28, 18,240,185,
-227, 39, 78,136,201, 6,128,211,103, 46,141,239,218,213, 62,193,150,207, 25,199,229,114,123,232,181,186,202, 83, 23,138, 62,106,
-141,168,242,240,240, 56,107,111,111,207,175,170,170, 42, 45, 47, 47,223, 60,108,216,176, 85,187,119,239,182,127,244,232, 17, 10,
- 11, 11, 49,119,238, 92, 97, 81, 81,209,123,247,239,223,255,151, 86,171,109,214,178, 37,151, 87,109,250,116,209,136,165,182,182,
- 78, 12, 1, 95, 4, 27, 91, 7,248,182,239,136,238, 61,134, 97,240,208,105,200,201, 78,238,190,123,215,202,228, 39, 79,226,191,
- 20, 58,180, 91, 85, 83,227,211,236,184, 20, 28,128, 62,195, 71, 61, 21, 89, 75,151, 46, 71, 86, 70,134, 60, 63,143,124,255,228,
- 49,138, 63, 56, 42,144, 99,208,150,230, 95,189,114,204,167,103,175,145, 0, 16,185,119,215,138,139,239,191, 97, 31,245,253,254,
-234,151, 69,196, 19, 43,153,204, 80, 24, 12, 1,142,110,110, 7,212, 38, 19,173,151, 74,189, 76, 74,165, 27, 0, 24,152, 76,173,
- 64, 40,124,224,238,231,151,152,149,148,212,251, 11,138,234,245,121,203, 9,202,235, 57,167, 12,220,176, 65, 28, 49,123, 54,171,
- 54, 47, 79,151,187,101,139,178, 44, 49,209, 72,113, 56,180,215,160, 65,132,115,223,190,220,217,233,233,172,107,107,215,246,102,
-174, 88,225,187, 68,167,219,103,229,252,143,114,254,127, 71,189, 19,124,227,221,135,219, 90, 20, 90, 4, 65, 64, 32, 16,224,192,
-129, 3, 96, 50,153,160, 40, 10, 76, 38,179,217,247,222,222,222,150, 20,100,180,171,171,235, 15, 63,254,248,163,203,192,129, 3,
-193,229,114, 27,190, 96, 48, 24,232,223,191, 63,162,163,163,153,197,197,197, 19, 14, 28, 56, 48, 97,205,154, 53,101, 53, 53, 53,
-115, 80,151, 24,186, 5,244,237,208,161, 67,236,185,115,231,120,106,181, 26,137,137,137,168,174,174, 6,155,205,134,167,167, 39,
- 6, 12, 24, 64,101,100,100, 56,244,239,223, 63, 54, 43, 43, 43, 6, 64,130, 5,101,141, 20,139,197,151, 15, 29, 58,196,237,216,
-177, 35,145,147,147,131,136,136, 8, 0,128, 84, 42,197,200,145, 35,185,147, 38, 77,106, 63, 97,194,132, 27, 18,137,164, 15,128,
- 59,102,248, 58,187,186,186,254, 50,106,212, 40,247, 53,107,214,136,108,108,108,144,159,159, 95,226,234,234,234, 95,223,222, 19,
- 38, 76, 96, 15, 27, 54,204,109,221,186,117,155, 14, 31, 62,252,145, 68, 34,153, 2, 32,169, 69,213, 90, 39,136,249,124, 62,202,
-202,202,176,127,255,126,188,247,222,123, 96, 48, 24,144, 72, 36, 56,120,240, 32,222,127,255,253,122, 65, 99,145, 24,230,243,249,
-209,126,126,126, 63, 95,188,120,209,211,206,206, 14,238,238,238,228,231,159,127, 30,234,235,235,203,107,219,182, 45,163,164,164,
- 4,177,177,177,190,147, 39, 79, 62, 94, 80, 80,240,182, 70,163, 49,187,164,230,226,226,178,243,228,201,147,222,169,169,169,216,
-178,101, 11,170,170,170,192,102,179, 97,103,103, 7, 87, 87, 87,248,251,251, 19,139, 22, 45,226, 15, 27, 54,140, 63,103,206,156,
-157, 90,173,182,147, 5,215,168,163, 88, 44,222,218,183,111, 95,223, 21, 43, 86,216,185,186,186,162,126, 98, 32,149, 74, 61,243,
-243,243,187, 47, 93,186,116,236,157, 59,119, 30, 73, 36,146, 89, 0,238,181,242,198,233, 20, 28, 28, 28, 51,114,228, 72, 70, 73,
- 73, 9,246,238,221, 27, 35,151,203, 59,181, 66, 92,254,163,112,231,246, 77,204,124,119,110,173,187,151, 23,235,220,217,159, 71,
- 31, 62, 26,112,219,142,247, 52, 33,117,141, 10,186,177,163,178,186, 12, 24, 56,141, 53,100,232,200,218,109, 63,109, 18, 90, 34,
-180,152,108,150,227,254,125,223, 22, 92,185,122, 39,244,124,252,205, 65,163,135, 15,167, 89, 44, 59, 95, 0,248,104,254, 60,102,
-236,137, 19,187,250, 71,119, 43,238,213, 51,178,224,141, 73, 11,188, 91, 81,220,128,128,128,128, 75,201,201,201, 46, 28, 14, 7,
- 85, 85, 85,142,219,182,109,251,182,103,207,158,100,110,110, 46, 50, 50, 50,144,151,151, 7,169, 84,138,254,253,251, 11,147,146,
-146, 54, 3,104, 86,104,233,200,126,171,221,219,234,191,115,228, 9,124,116, 70,153,152,214,151, 4,159, 63,121, 62,252,183,189,
-170, 8, 23,183, 64,255,169,111, 45,195,202, 85, 71,152,191,238,255,106,233,133,248,223, 0,210,167,249,140, 0, 52,122,124,186,
-100, 49,100,114, 13, 38, 77,156,129,201, 19,103, 56,210,208,186,209, 70,181, 64,171,170,182,179, 97,165,199,253,184,227,219, 81,
- 0, 60, 27,137,173, 11, 47,139,216, 90,201, 98,249,192,100,242,245, 31, 57,242, 88,238,153, 51,237,104,157,206,137,193,102, 23,
-217, 56, 56,148, 25, 52, 26, 90,175,211,177, 84, 42,149, 71,110,106,170, 91,207, 69,139, 46, 92, 93,187,182,207, 23, 12, 70,151,
-207,141,198,219,205,114, 82, 84,183,152, 31,126,112, 14,157, 62,157,115,111,197, 10, 69, 69, 98,162,202,111,200,144,234,136,119,
-222,209, 0,128, 60, 47,143,149,181,108, 25,223,185,119,111,222, 43, 11, 23,218, 27,181, 90,215,149, 43, 87,118, 93,250, 52,121,
-121,171, 56,189,199,143, 55, 46,221,181,171, 75,226,130, 5,175, 17,122, 61, 99,208, 43,175,220, 93,187,119,239,147, 63,195,249,
- 87,150,179,248,242,101, 77,149,175, 47, 34, 70,142,172,244, 22,139, 53,127,101,221,255, 76, 57,173,104, 64,189,175,214,204,198,
- 51, 84,196,197,197,245, 1,112, 9,192,138,152,152,152,229, 0, 96,107,107, 91, 86, 83, 83, 35,142,141,141, 53, 43,178,152, 76,
- 38,220,220,220,224,239,239, 47,145, 72, 36, 46, 45, 20,160,208,100, 50,121,210, 52,221, 96,125,105, 14, 26,141, 6,217,217,217,
- 8, 15, 15, 47,194,211, 68,180,205, 26,117,248,124,126,110, 70, 70,134, 83, 90, 90, 26,238,220,185, 3, 95, 95, 95,216,219,219,
-131,201,100, 66,175,215, 67, 38,147,161, 67,135, 14,224,112, 56,232,220,185,115,133, 66,161,240, 53,179, 4,196, 17, 8, 4,217,
-151, 47, 95,246,138,136,136,192,173, 91,183,224,229,229, 5, 87, 87, 87, 0, 64, 94, 94, 30,174, 94,189,138, 33, 67,134, 32, 57,
- 57, 25, 99,198,140, 41, 84, 40, 20,254, 0, 52,205, 17, 58, 56, 56,148, 92,188,120,177, 40, 44, 44, 76,173, 80, 40,200,178,178,
- 50,102, 98, 98,162, 65, 46,151, 11,165, 82, 41,179,166,166,134, 41,147,201, 40,133, 66,193, 36, 73,146,165, 82,169,152, 23, 46,
- 92, 96,232,116,186, 22, 3,100,214, 95,167, 19, 39, 78, 32, 44, 44, 12,177,177,177,248,240,195, 15,113,237,218, 53,120,121,121,
-225,208,161, 67, 88,184,112, 33, 50, 51, 51,225,228,228,132,224,224, 96,115,215, 8,237,219,183,207,121,240,224, 65,123, 22,139,
- 85,159,215,177, 62, 95, 30,202,203,203,241,240,225, 67, 60,121,242, 4,126,126,126,152, 56,113,226,195, 39, 79,158,248,153,235,
-121, 30, 30, 30,229,169,169,169, 78,225,225,225, 40, 43, 43,131,157,157, 29,108,109,109, 97,103,103,215,240,222,215,215, 23, 11,
- 22, 44,128,171,171,171, 68,173, 86,187,152, 19, 65, 97, 97, 97,103, 47, 92,184,224, 36, 18,137, 80, 90, 90, 10,153, 76, 6,138,
-162,192,231,243,225,228,228,212, 32,228,179,179,179, 49,116,232,208,138,220,220,220,129,173, 16, 73,164,139,139, 75,198,253,251,
-247,253,105,154, 70, 65, 65, 1, 50, 51, 51,241,238,187,239,102,171,213,234, 64,188, 68, 57,251, 26,249, 93,177,166,188, 53,147,
- 53,106, 68, 15,109,122,106, 28,193, 49,101,162, 83,168, 72, 10, 0,119, 83,100,182, 26,178, 3,130, 66, 98,232,163,199,175,179,
-127,217,189,141, 9, 19, 92, 64, 32, 51, 61, 27, 95, 52,199, 61,160,175,219,244,121,243,222, 14,125,173,103, 31, 82,174, 80,136,
- 55,111,222,208, 57, 55, 55, 93, 12, 0,190,190, 65,146,217,179,231, 39,217, 8, 4,146, 75, 87, 47,155, 54,110,220,153,114, 46,
-161,100,135, 5, 69,246,245,247,247,255,215,137, 19, 39,156,196, 98, 49,108,109,109,161, 80, 40,160,211,233,144,150,150,166, 62,
-112,224,128, 94, 36, 18,217,148,150,150,162,166,166, 6, 4, 65,224,196,137, 19, 5, 0,218, 60, 79, 84,239,163, 5, 0,239, 14,
- 14, 98, 6,247,243,183,103,113, 12, 60, 30, 51,203, 13,132,145, 67,208, 66,151,211,103,239,134,159, 62,127,235,141, 81,163, 63,
-116,238,213,103, 20,150,126, 54, 86, 95, 92, 92, 16,161, 67,175,140,166,124,180, 2,253,208,111,228,152, 81,227, 86,174, 92,142,
-229, 75, 87, 32,238,196, 49,169, 80, 64,106, 68,118, 76,219,222,221, 95, 85, 47,120,111, 68, 97,109,109,177,215,202,117, 7, 38,
- 14, 29,177,192,179,103,175,145,184,122,229, 24,246,238, 90,113,135,224,209,255,232,101,196,101, 0,139,164,168,105,238, 62, 62,
-251, 36,197,197, 30,124,161,144, 57, 55, 62, 94,108, 52, 26,111,143, 91,184, 80,126,244,194,133, 6, 43,233,231, 36,233,206, 96,
- 48,220,253,135, 14,189,159, 19, 23, 55,141, 99, 48,196,126, 2,148, 63,207,185, 28,176,183,243,245,157,245, 65,118, 54,235,222,
-242,229,181,134,226,226,234,200,249,243, 43,154, 58,127,209,249,243, 2,182,187,187,200,126,248,112,135, 77,109,218,208,122,137,
-100,107, 83, 62, 70, 77,113,198, 11,133,118,191,157, 62, 29, 69, 51,153,125, 62,254,228, 19, 94, 76, 76, 12,100, 50, 25,142, 28,
- 57,130,173, 91,182,104,220,220,220, 30,184,167,164, 36,135,202,100,159, 89,202, 25, 57,127,126,133,209,104, 36,198, 45, 92,216,
- 63, 53, 47,175, 95,169, 68,210, 22, 0,220, 28, 28, 10, 35,125,125,239,236,140,139,203,252,222,199,199,100,105, 57,183,159, 57,
-227,114, 56, 63,127,186,131,131, 3,175, 76, 34,161, 56,108,118,101,247,224,224, 67, 63, 45, 89,114,201,112,255, 62,139,235,233,
- 41,178,141,137,105,117,221, 35,231,207,175,168,146,203,169, 15, 86,173,122,245,113, 89, 89,219, 90,141,198,175, 70, 46,119, 53,
-234,245,164,136,207,175,108,215,161,131, 68,149,152, 88,210, 78,169,156,187, 3,144,252, 93,253,167, 41, 45,242, 15,194,243,113,
-180,254,144,235,240, 82, 76, 76,204, 31,118,215,208, 52,109,145, 53,139,201,100, 62,179, 76,213, 2, 88, 4, 65, 32, 41, 41, 9,
-142,142,142,112,117,117, 5,135,243,108,242,193,242,242,114, 92,187,118, 13,233,233,233,232,216,177, 99,253, 50, 70,243,138,136,
-195,153,183,110,221, 58, 59,173, 86,139, 59,119,238, 32, 50, 50, 18, 28, 14, 7, 44, 22,235, 25, 17, 40,145, 72, 16, 18, 18,130,
-143, 63,254,216,118,205,154, 53,243, 52, 26, 77,179, 51, 82,138,162,230,204,152, 49, 67, 92,111,193, 42, 44, 44, 68,231,206,157,
- 27,190,119,118,118,198,221,187,119, 17, 25, 25, 9, 79, 79, 79,140, 29, 59, 86,188,119,239,222, 57, 6,131, 97,125,115,156,108,
- 54,155, 12, 11, 11,235, 2, 0, 2,129, 0, 36, 73,102,137, 68, 34,103, 23, 23, 23,129, 72, 36,250, 67, 29,119,237,218, 85, 67,
-146,164,222,172, 26, 32, 73,148,150,150, 34, 52, 52, 20, 82,233,211, 12, 46, 10,133, 2,126,126,126,144,201,100, 13,162,213,221,
-221, 29, 42, 85,203,174, 95,225,225,225,203, 3, 3, 3, 7, 8, 4, 2, 14,147,201,196,189,123,247, 16, 17, 17,129, 3, 7, 14,
-192,219,219, 27,124, 62, 31,217,217,217, 8, 11, 11,195,229,203,151,225,236,236,140,144,144, 16,142, 88, 44,190, 82, 85, 85,149,
-240,248,241,227,229, 45,148,147, 20, 10,133,184,124,249, 50,118,238,220,137,188,188, 60, 20, 23, 23,195,198,198, 6,157, 58,117,
- 66,112,112, 48,122,244,232,129,236,236,108, 16,230, 59,147,171,191,191,127,220,173, 91,183,156,104,154,198,222,189,123, 81, 91,
- 91, 11,173, 86, 11,146, 36,193,229,114, 97,111,111,143,126,253,250,193,217,217, 25,254,254,254, 56,120,240,160,211,224,193,131,
- 79, 73, 36,146, 78, 0, 74,205,181,171,189,189,253,220,101,203,150,121,137,197, 98,228,231,231, 67, 42,149,194,197,197, 5,175,
-189,246,154, 71,124,124,252, 92,189, 94,191,225,101, 17, 90,141, 28,223,137,115,103,127, 30,237,223,174, 58,172, 99, 7,190, 87,
-108,156,139,215,129, 56, 73, 8, 0,132, 6,185,164,142,142,225, 23,222, 75,141, 43, 60,119,246,216,157,244, 44,196,194,130,165,
-109,169, 82,115,232,124,252,205, 65, 17, 29, 59,155,214,125,181,112,232,123,239, 78,231,136, 93,166,161,172,224, 24,226, 47, 38,
-121, 47,252,112,134,243,250,111,182,159, 62, 31,127,147,148, 42, 53,159, 89,102,202,242,254,126,247, 79, 61,156,228, 21,135,145,
-147,193, 6,207, 38, 20,190,190, 1,144,201,100,224,114,185,220,137, 19, 39, 26, 23, 47, 94,172, 20,137, 68,124,130, 32,144,144,
-144, 32, 1, 48,208, 28,175, 90,108, 79, 27,117,122, 3,205,102,152,104,194, 70, 69, 24,171,216, 41,105,143, 48, 32,186,111, 89,
-207,110,161,107, 22,175,252,230, 83,255,128, 8,231,183,167,175, 96,174, 90,254,198, 22, 16,232,213, 20, 79, 70, 14, 46, 18,135,
-142,242, 0, 12, 93,249,197,114,228,230,102,219,207,156, 90,179,130,226,240,220, 3,219,188,106,179,101,103,194, 32, 63, 63,159,
-182, 11,230,140, 61,249,237, 15,223, 14,109,108,217,218,189,107,217,113, 0, 81,150,180,237,255, 34, 72,138,234, 64, 18, 68,161,
- 76,169,100,208, 58,157,211,220,248,120,213,185, 27, 55, 46,220,159, 57,211, 38,156,197, 10, 8,103,177,192,208,233, 42,151, 0,
- 21, 95,152, 76,197,203, 40, 74,244,232,248,113,119,138,205, 78, 86,155, 76, 97, 48,153,154,138,159, 20, 62, 57, 46, 14,181, 5,
- 5,250,170, 43, 87,212, 81, 63,252, 80,225, 53,112,224, 6,173, 78,231, 84, 63, 84,144, 4, 1,162,222,117,194,100, 34,168,143,
- 63, 38,105,138,130,222,222,126, 42,170,171, 3,204,113,126, 88, 82, 50,250,141,233,211,135, 30, 63,115, 6, 62, 62, 62, 13,207,
- 51, 59, 59, 59, 44, 92,184, 16,243,231,207,231,220,189,123,183,235,225,195,135,187,174,255,250,107, 23, 0,163, 45, 41,231,185,
- 27, 55,236,223, 89,185,114, 73,199,200, 72,239, 61,251,247,115,218,183,111, 15, 0,120,248,240,161,255, 87,107,215,182, 9, 13,
- 11, 43, 91, 51,111,222,238,212,197,139, 67, 0, 92,105,137,179, 52, 49, 81,123, 56, 63,127,250,197,132, 4,187,208,208, 80, 0,
- 64,102,102,166,120,211,166, 77, 51, 66,198,142,157,180,114,246,236,207, 98,212,234, 26, 81,121, 57, 39,230,251,239,169,223,198,
-141, 51,203, 89, 95, 78, 0,120,237,237,183,231,245,234,219, 55,120,244,244,233, 14,222,222,222,132, 80, 40,132, 78,167, 67,113,
-113,177,125,106,106,106,251, 56,185, 92,118,244,198,141,189, 48, 26,251,255,141, 93,168, 73, 45,242, 15,179,100,253,241,190,168,
-251,251, 90, 92, 92, 28, 93,167, 38, 27, 30,224, 70,163,209, 34,145, 69, 81, 20, 8,130,176, 84,108,129,166,105, 84, 84, 84, 32,
- 37, 37, 5, 15, 31, 62,132, 66,161,192,163, 71,143,176,109,219, 54,124,245,213, 87,184,125,251, 54,244,122, 61,116, 58,243, 57,
-104, 5, 2, 65,116,116,116, 52,117,227,198, 13,248,250,250,130,199,227,129,205,102,131,197, 98, 53,188,184, 92, 46,220,220,220,
- 32,147,201, 16, 21, 21,197, 20, 8, 4,209,102,172, 68, 67,198,143, 31,207,174,255,191,182,182, 22, 12, 6,163, 65,180,212,214,
-214,162,170,170, 10, 53, 53, 53, 40, 41, 41,193, 43,175,188,194,182,181,181, 29, 98,233,213, 80, 42,149,181, 18,137,196,174, 87,
-175, 94,246,233,233,233,127,200,246,123,233,210, 37,181, 90,173,102,146, 36,105,145,163,253,190,125,251, 16, 27, 27,139, 11, 23,
- 46,160,168,168, 8, 91,182,108,193,158, 61,123,112,226,196, 9,100,103,103,227,187,239,190,195,230,205,155,177,123,247,238, 22,
-175, 81, 96, 96,224,224,189,123,247,118,235,222,189, 59,159,193, 96, 32, 51, 51, 19, 11, 22, 44, 64, 77, 77, 13,156,157,157, 1,
- 0,101,101,101,216,176, 97, 3, 52, 26, 13,132, 66, 33, 60, 60, 60,184, 43, 87,174,236,233,236,236, 60,160,165, 50, 26,141, 70,
- 35,131,193, 64,155, 54,109,176,116,233, 82,108,222,188, 25,103,207,158,197,161, 67,135, 48,123,246,108, 4, 7, 7, 35, 57, 57,
- 25,183,111,223, 6, 77,211, 45, 62,100,184, 92,238,216, 61,123,246,136,217,108, 54, 76, 38, 19,228,114, 57, 10, 10, 10,112,243,
-230, 77,245,177, 99,199,106, 79,158, 60,169,188,114,229,138,250,250,245,235, 52,128, 6,193, 25, 19, 19,227,200,102,179, 95,183,
-160, 73,157, 93, 93, 93, 63,157, 49, 99, 6,183,113,159, 45, 45, 45,197,232,209,163,249, 60, 30,111, 49, 0,231,151,208,228, 77,
- 31, 62, 26,112,155, 99,202, 68,108,220, 19,175,199, 69,198, 87, 23,126,244,141,195,194,143,190,113,120, 92,100,124, 53, 54,238,
-137, 23,199,148,137,195, 71, 3,110, 91, 32, 4,200,126,125,220, 70,184, 56,218,109, 29, 61,124, 56,189,121,243,134,206,239,189,
- 59,157,211, 38, 96, 33,184,182, 19,225,225,251, 14,162,122,123, 19,225,193, 36,119,243,230, 13,157, 71, 15, 31, 78,187, 56,218,
-109,237,215,199,109, 4,204,132,157, 17, 59,114, 61,248, 28, 5,218,251, 7,227,181, 62, 29,193, 36,114,112,228,208, 78,148,148,
-148,160,184,184, 24,101,101,101,130, 97,195,134,161,180,180, 84,157,144,144, 32, 81,169, 84,125, 0,100,153,171,124, 81, 81,154,
- 73, 93,107,212,153,140, 76,131, 92,202, 82,206,158,123, 56,250,118, 42,235,173,210, 26,143, 97,108,142, 61,123,112,255,174,251,
-119,238, 88,138,118,237, 66,209,165,235,128, 87,236,133,255, 10,110, 86,188,230, 34,238,247, 35, 71,143, 79, 28, 63,209,144,247,
- 40,255, 81,128, 11, 87, 75,211,180,126,238,162,237,253,153, 2,175,240,246, 65,189,157,211,115,140,110, 75, 63,126,253,215,147,
-199,191, 45,186,122,229, 24,122,246, 26, 9, 15,119,255, 62, 83,167,130,253, 79,237, 64, 4, 77,251, 50,133,194, 92,189, 84,218,
-134,226,112, 10,140, 70,163,211,173, 89,179,236,116, 44,150,155, 81,167, 43, 54,234,116,197, 58, 54, 91,244, 99, 80,144, 39, 77,
-211,142,118,158,158, 79,104, 54,219,219,160,211,229, 16, 36,217,174,201,217, 57,135,227, 41,108,211,134, 42, 61,119, 78,235, 59,
-108, 88, 53, 0,104,117, 58,167,188,252,124,219, 50,137,196,182,180,172,204,246,113, 97,161,109,238,163, 71,182,217, 57, 57,182,
- 25, 57, 57,162, 7, 41, 41,194,187, 15, 30, 8, 9, 6,195,197, 18,206,188,226,226,240,143, 63,254, 24, 60, 30, 15, 6,131,161,
-169, 49, 27, 10,133, 2, 83,167, 78,133, 18,232,110, 9,167,209,104, 36,222, 89,185,114,201, 39, 75,150,180,143,141,141,229,116,
-235,214, 13, 14, 14, 14,112,112,112, 64,183,110,221,112,248,200, 17,246,236, 57,115, 60, 63,221,177, 99, 42,201,225,120,153,227,
-172,240,243,131,131,131, 3,175, 94,100, 1, 64,135, 14, 29,176,101,203, 22,206,153,179,103,109,191,248,249,231,111, 86, 92,191,
- 30,166,121,252, 88,225, 24, 16, 64,179, 57, 28, 79, 75,219, 19, 0,228,106,117,232,134, 77,155, 28,157,156,156,136,178,178, 50,
-228,228,228,224,241,227,199, 48, 24, 12,232,210,165, 11,113,232,200, 17, 91, 45,131,209,245,111,238, 66,127,208, 34,255, 32,204,
- 68, 51,113,180,168,186, 7,208,101, 0, 68, 92, 92, 28, 93,191,156, 88,247,112,108, 16, 83,150, 8,173, 23, 65, 77, 77, 13,106,
-106,106,176, 99,199,142, 6, 97, 84, 15,173, 86,107,137,104, 9,115,119,119,135, 84, 42, 69, 64, 64,192, 51,150, 44, 22,139, 5,
-138,162,192, 98,177,192,225,112,160,209,104,224,237,237, 13,165, 82, 25,214, 18,167, 74,165,234,228,224,224,208,240,128,213,104,
- 52, 13, 34,171,190,188, 90,173, 22,213,213,213,168,173,173,133, 92, 46,135, 66,161,136,176,164,190, 38,147, 9, 41, 41, 41, 15,
- 59,116,232,208,137,193, 96, 64, 40, 20, 10, 20, 10, 69,131,111, 81, 85, 85, 21,126,249,229, 23,197,155,111,190,233,116,226,196,
- 9,179, 9,139, 9,130,192,251,239,191, 15, 14,135, 3,165, 82,137,205,155, 55,227,131, 15, 62, 0,139,197,130, 92, 46,199,150,
- 45, 91,176, 96,193, 2, 80, 20, 5,173, 86,139, 77,155, 54, 53,203,149,150,150,150,119,227,198,141,136,206,157, 59,219, 31, 61,
-122,180,188,127,255,254,206, 3, 7, 14, 4,143,199,131, 74,165,130, 94,175, 71,247,238,221, 17, 24, 24, 8,137, 68,130,211,167,
- 79, 87,248,251,251, 59,221,188,121,211, 84, 90, 90,250,216,140,184,166, 27, 89, 12, 97, 52, 26, 81, 86, 86,134,154,154, 26,148,
-151,151,163,184,184, 24, 69, 69, 69,160, 40, 10,102,116, 22, 28, 29, 29,199,132,134,134, 50, 0,128,199,227,161, 83,167, 78, 88,
-178,100,137, 65,165, 82,141, 7,112,186,238,176,193,219,183,111, 63,122,245,234, 85,202,221,221, 29, 25, 25, 25,112,118,118,166,
-184, 92,238,235, 90,173,182, 69,107,148,171,171,235,174,223,127,255,221,161, 94, 92,215,183,179, 82,249,244,114,140, 30, 61,218,
- 97,207,158, 61,187, 12, 6,195, 16,188,100,176,227,129,213, 41, 84, 36, 61, 16, 39, 9, 89,248,209, 55, 84, 96,232,211,201,235,
-204, 89,160,214,127,253, 97,200,164, 17,162,147,118, 60, 25,203, 28,207,224,104,175, 31,135, 15,239, 79, 78,156, 16,147,205, 98,
-217,249,110,221,182, 66, 44,118,153,214, 72,134,137,224,232, 36,130,111, 27, 54,113,248,100,186,120,209,226, 47, 52,251,246,124,
-155,251,235,111,113,131,216,204,243, 3, 78,199, 23,206,110,142, 59,235, 97,205, 9,165,134, 27, 36,171,188, 79, 56,184,188,138,
- 78, 29, 59, 64,236, 92,141,237,187, 14,192,167, 93, 23,104, 52, 26,136, 68, 34,190,209,104,212, 49, 24,140,125,150,136, 44, 0,
-184,112,161,198, 20, 18, 82,163,101,200, 77,134,247, 62, 88, 63,170,255,224,225,193,253,250, 69,155,206,157, 63,167,123, 53, 66,
- 87, 50,120, 96,167,178, 51,231,127,204, 46, 41,126,228, 31, 18,214, 19,105,169, 9,131,104, 26, 41, 4,209,180,232, 76,205,193,
- 25,181, 41, 45,225,192,129,153, 38,149, 41,153,183,106,245,131,193, 67,135, 78, 9,237,221,171,183,233,124,252, 69, 45, 27, 21,
-233,162,158, 61,158,188, 55,125,240,209,159,247,109, 26,112,230,244, 46, 63,169,236,113,220,238,221,205,187, 32,252,207, 43,117,
-130,112,182, 17, 8,202, 43,229,242,142, 99, 86,172,144,141, 91,184,240,108, 56, 69, 5, 27,117,186, 71, 43, 0, 21, 77,211,132,
-201, 96, 88,252, 96,255,126,198,114,130, 88,180, 2, 48,173,102, 48,152, 69, 38,147,210,131, 36,249,203, 0,106,197,115, 59,185,
-141, 6,131, 11,197,225,144,229, 9, 9,134,176,105,211, 52,245,247, 35,159,207,199,241,227,199,193,102,179, 27, 94, 44, 22,171,
-225,189,139,139, 11,136,186,109,164,127,152,248, 53,193, 9, 0, 37, 37, 37, 40, 45, 45,133,173,173, 45,156,157,157, 81, 90, 90,
-138,235,215,175, 35, 43, 43, 11, 76, 38, 19,131, 6, 13, 2,217,140,111,243,243,156,227, 22, 46,236, 31, 20, 22,230, 61,107,214,
- 44,242,249,231,163, 78,167, 67, 85, 85, 21, 70,140, 24, 65,158, 62,125,218,245, 76, 65,193,112, 0,251, 90,226,140, 24, 58,180,
-178,236,240,225, 38,207,221,185,115,103,226,218,181,107,156, 65, 3, 7,206,255,112,245,234, 31,191,223,179,167,208,104, 48,184,
-182,166,238, 36, 73,146, 4, 65,192,203,203, 11, 85, 85, 85,168,173,125,186,130, 45, 20, 10, 97,111,111, 15,189, 94, 15, 19, 77,
- 51,255,206,254,211,156, 22,249,135, 96, 91, 35,193,245,140,101,139,170, 91, 23,173, 31, 40, 94,107,252, 96, 49,153, 76, 22,137,
- 44, 38,147,105,214,231,202, 18, 43,215,243,176, 68,104,213,151,149,203,229, 62, 99,201,170, 23, 88,245,229, 36, 73, 18, 12, 6,
-195,236, 67,188, 78, 12, 49,228,114, 57,142, 28, 57,130, 62,125,250, 52, 44, 75, 73,165, 82,212,212,212, 64, 42,149, 66,173, 86,
- 35, 47, 47, 15, 23, 46, 92,128,159,159, 31, 96, 97,240,215,220,220,220, 59, 62, 62, 62,145,245, 15,241,190,125,251,122,238,222,
-189,187,120,200,144, 33,238, 52, 77,227,179,207, 62,171,232,222,189,187, 83,227,135,188, 57, 48, 24, 12, 92,191,126, 29,126,126,
-126,160,105, 26, 44, 22, 11,153,153,153, 16,139,197, 48,153, 76,160, 40, 10,229,229,229,176,177,105, 57, 70, 98, 74, 74,202, 91,
-111,191,253,118,177,173,173,109,120,101,101,101, 9,135,195,233,149,152,152,232,165,211,233, 32, 18,137, 32, 18,137,112,234,212,
- 41,216,217,217, 97,222,188,121, 5, 42,149,234,186, 64, 32,112, 81,169, 84,247, 75, 75, 75, 63,107,205,245, 54, 24, 12, 80, 40,
- 20,168,174,174, 70, 85, 85, 21,100, 50, 25,212,106,181,217, 50, 54,133, 94,189,122, 33, 46, 46,142,241,229,151, 95,254,156,155,
-155, 11, 0,240,245,245,197,188,121,243, 24, 30, 30, 30,200,203,203,195,157, 59,119,160,211,233, 64,211,116,139, 55, 47, 69, 81,
-125,223,124,243,205,158,222,222,222,132, 78,167,131,201,100,130, 70,163, 65,253,251,130,130, 2, 4, 5, 5,145,109,218,180,121,
- 37, 55, 55,183, 47, 44,219, 88, 97, 5,128,178,130, 99,240, 96,138, 1, 82, 4, 90,117, 12,149, 21, 47, 22,197, 69, 34,145,172,
-254,248,243,107,211,190, 95,167,115, 41, 42, 1, 58,132,142,132,127,112, 20,222,154,108,192,151, 95, 31,129,119,155, 14,120,252,
-248, 49,250,246,237,203, 42, 46, 46,126,187,182,182,118,161,165,220,231,207,223, 48,158, 59,117,122,236,184,215,167, 68, 70, 71,
- 15, 49,156, 61,123, 10, 41,247,207,166,190,253,250, 24, 9,109,170, 37, 28,236,120,201,153, 25,183,253,195, 59,189, 6,173,193,
-216, 11, 88,190, 14, 88, 78, 55,127,191, 67,123,242,164, 27,121,242,216,174,201, 19, 39, 77,237, 24, 21, 53, 64,127,246,252,239,
-184,243,175,243,247,190, 89, 55,227,242,151,155, 14,246,237, 63,104, 76,136,179,203,245, 83,161, 1,154,233, 94,142,182, 15,183,
-239,174,250, 39, 95,102,138,197,229, 26, 0,144,118,109,218,120, 30,189,112, 33,191, 19,147,201, 16, 1, 70,154,166, 59, 0,112,
- 34, 41,234,211, 19,211,167, 71, 4,213, 61, 72, 13,128, 41, 8, 32,165,128, 86, 0,176,209, 76,200, 28,138,203, 53,161,110, 92,
- 36, 9, 2, 52, 77, 63, 35,178,158, 23, 90, 36, 73,154, 53, 0, 52,230,108,252, 44,170,159, 80,111,221,186, 21, 28, 14, 7,108,
- 54, 27, 76, 38,211,172,251, 69, 99,206,212,188,188,126,191,236,219,199,105, 74,100, 85, 86, 86,162,178,178, 18,181,181,181,152,
- 48, 97, 2,107,197,237,219,157, 81,231,250,209, 28,167,183,155,155, 70,192,227,149,165,165,165,185, 7, 7, 7, 63, 83, 94,153,
- 76, 6, 30,143,135,125,251,247,179, 98,134, 14,125, 55,234,212,169,111, 96, 38,254, 85, 83,117, 39, 8, 2, 98,177, 24,246,246,
-246, 32, 8, 2, 6,131, 1,165,165,165, 72, 77, 77,197,237,175,151, 40,128, 0, 0, 32, 0, 73, 68, 65, 84,219,183,193, 32, 8,
-195,223,217,121,154,210, 34,255, 64,171,214, 31,150, 15,235, 45, 90, 68,115,214, 23, 75,133, 22,131,193,120, 97,171, 86,115,176,
-100,233,144,207,231, 63, 40, 46, 46,126,213,195,195, 3, 6,131,161, 65,104, 53,182,196,213, 91,201,120, 60, 30,238,222,189, 11,
- 62,159,255, 64,173, 86,183,200, 73,211,244, 43, 93,187,118, 69,108,108, 44, 18, 18, 18,240,232,209, 35, 40,149, 74,104, 52, 26,
-168, 84, 42,164,166,166,194,100, 50, 33, 52, 52, 20, 2,129, 0,124, 62,255, 65,189,229,171, 57, 40, 20,138, 18, 38,147,217,129,
-199,227, 53,124,230,230,230,134,202,202, 74,147, 94,175,199, 47,191,252, 34,115,117,117, 21,240,120, 60,139,133, 43, 65, 16,144,
- 72, 36,240,244,244,108,240,209,146,203,229, 16,139,197,245,194, 2, 26,141, 6, 54, 54, 54,160,105,218,220, 53, 82,231,228,228,
-124,216,232,255, 46,227,198,141,251,245,192,129, 3,237,226,227,227,113,243,230, 77, 56, 59, 59, 99,205,154, 53,143,242,243,243,
- 39, 2,184, 45,145,252,181,126,145,150,244,161,202,202,202, 35, 15, 30, 60,120,165,107,215,174, 13,163, 68,223,190,125,137,190,
-125,251, 58, 53, 54,245,151,151,151,227,214,173, 91,136,143,143, 7, 65, 16,200,206,206, 54,170, 84,170, 95, 91,160,102,121,120,
-120,236, 94,178,100,137,208, 96, 48, 52,244,109, 30,143, 7, 46,151, 11, 22,139, 5, 6,131,129,252,252,124,140, 24, 49,194,246,
-135, 31,126,216,165,209,104,218, 3,208,225, 37, 65,141, 10,186,187, 41, 50,219,208, 32,151,212,109, 91,191,124,117,230,172,167,
- 99,196,182,173, 95, 26, 66,131,196,169,119, 83,202,108, 35,197,230,235,123, 58,190,240, 61,173,254,244,176,211,103, 46,141,255,
-104,254, 60,166,175,111,144, 36,254, 98,146,119,148,225, 11,194,209, 73,132,202, 10, 25,242, 11,202,144,251, 88, 75,251,250, 6,
- 73,238,220,122,192,249,122,195, 70,127,133, 82,125,240,226,229,146,223,205,208,171,175, 92,127, 52,242,155,239, 56,151,167,188,
-221,133,205,227,185,163,170,226, 1,188,189,157, 49, 34, 38, 28, 59,247, 92,135,173,173, 3, 92, 92, 92, 64,146,164,192,210,186,
- 87, 84, 84, 16, 71,126,187, 50,237,205,169, 51,186, 15, 28, 48,212,112,230,236, 73, 42,225,220,137,235,187,182,125,122,148,102,
- 40,248, 4, 45,231,181,245,113,189,255, 48,231,238,196,126,209, 19,192, 99,217,248, 1,129, 77,118,216,134, 13, 6, 52, 10, 98,
- 15, 44,231,190, 57,117,102,143,129, 3,135, 27,206,158, 61,134,179,167,246,220, 88,182,172,237,169, 71, 79,246,179,254,117,187,
-136, 59,114,236,236,234,184,211,233,218, 49,195,124,178,220, 5,157, 84,192,163,127,108,255, 33, 9, 66, 86, 81, 94, 46, 98, 50,
-153,170, 93,111,188,145, 13, 0,122,138,170,148, 51, 24,206, 4, 65,100, 2,200, 92, 13, 56,129,205,150,142, 51, 24,140, 11,189,
-189, 89, 84, 73, 9,163,218,104, 52, 50, 0,246, 71,127,204,191, 8, 6, 69,149, 25, 52, 26, 47,207,129, 3, 25,202,199,143,153,
- 66, 23, 23, 3, 0,232,245,122,179, 66, 11,205,108, 90,121,158,211,210,250, 41,149, 74,152,154, 17,130,207,115,150, 74, 36,109,
-235, 38,225, 13,208,235,245, 13, 34,171,178,178, 18, 53, 53, 53, 16, 8, 4, 40,215,104, 92, 44,225, 28,208,173,219, 47, 43,150,
- 47, 95,120,248,200, 17, 86, 99,145, 85,255, 98, 50,153,248,106,221, 58,214, 7, 31,125, 52,251, 93,138,154,139, 38,150, 65,155,
-107,207,250, 73, 59,131,193, 0, 69, 81,120,252,248, 49, 10, 10, 10,240,248,241, 99, 60,126,252, 24, 60, 30, 15,244,223,188, 9,
-232, 31,236,159,133, 70, 75,133, 51,159,183,114,181, 24,222,161, 53,206,240,150, 10, 3,163,209,248,151, 10, 45,133, 66, 17,127,
-225,194,133,110, 35, 71,142,164,110,220,184, 1, 87, 87,215, 6,161, 85,255,183,126, 57,138,207,231,227,232,209,163, 58,133, 66,
- 17,111,230,102,186,112,234,212,169,200,165, 75,151, 50,223,122,235, 45,164,165,165, 97,214,172, 89,168,169,169,129, 76, 38, 67,
-101,101, 37,148, 74, 37,186,117,235, 6, 46,151,139,251,247,239,235,149, 74,229, 5,115, 75,103, 18,137,164,214,217,217,217,237,
-249,239,198,142, 29,235,242,211, 79, 63, 41, 51, 50, 50,244,175,190,250,170,200, 82,193, 81,143,223,126,251,173,193, 82,151,149,
-149,133,159,126,250, 9, 52, 77,131,166,105, 36, 37, 37, 97,253,250,245, 13,177,207, 90,137,219, 21, 21, 21, 6,189, 94, 15, 63,
- 63, 63,120,120,120, 64,173, 86, 99,227,198,141, 6, 0,183,255, 91,189, 89,173, 86, 31,158, 50,101,202, 39,201,201,201,110, 20,
- 69, 61, 53,105,215,213, 79,167,211, 33, 39, 39, 7,169,169,169,200,200,200, 64, 85, 85, 85,195, 68,224,238,221,187,213,122,189,
-254, 96,115,188,206,206,206,159,237,220,185,211,149,207,231, 63,211,159,235,173,161,245, 86,210,242,242,114,216,217,217, 33, 42,
- 42, 74,124,225,194,133,207, 52, 26,205,210,151, 68,103, 17, 99, 71,101,117,249,224,189,145, 24, 29,195, 47,140,141,123,114,109,
-253,215, 31,214, 57,195,139, 83, 71,199,120, 20,222,203,180,195,216, 81,199,186, 0, 40, 66,203,126, 90,166,139,151, 75,142,119,
-237,106,159, 16,123,226,196,174,197, 31,207, 79, 90,248,225, 12,103,165,234, 33,215,183, 13,155, 0,128,220,199, 90,250,126,154,
- 73,189,254,155,249, 73, 95,174,251,129, 44,171,172,153,117,235, 86,243,225, 13, 26,139, 23,146, 4,215, 55,176, 79,177,127, 64,
- 79,159, 27,215,247, 65,200, 87,161, 67, 96, 23, 12, 28,240, 10, 18, 46,221, 69,105,185, 26, 37, 37, 37,208,104, 52, 45,134, 75,
-200,184,127,116, 50, 77,208,222, 4, 77, 20, 16, 36,205,157, 60,101,122,175,161, 67,135,211,113,113, 39, 12,199,142,238,187,122,
-112,239,119,135, 73, 22,147, 82,105,109,181, 4,161,150,130, 76, 73,171, 85, 60,157,208, 48, 57,172,230,205,175,117,129, 93,131,
- 67, 2, 93, 39, 79,153,101, 59,100,240, 8,250,212,169, 99,166,131, 7,126, 73, 56,184, 35,108,159,137,148,177, 74, 10,149, 28,
-169, 76, 47,165, 9,182, 93,173,204,164, 44,203,109,175,118, 31, 58, 86, 7, 28,254,199,118, 32,218,100,122, 76,107,181, 62, 96,
- 50, 11,105,131,193, 21,122,125,213, 10,181,250,201, 23,108,118,219,101, 20,213, 25, 4, 97,210, 17,132, 2, 90,109, 46, 0, 56,
- 20, 20,184,105, 69,162, 82,134, 90,221, 30, 70, 99,147, 1,144,117, 26, 77, 81,109, 97,161,155, 67,159, 62,156,156,229,203,249,
- 46,221,186,169,137, 58, 31,226,150,132, 22,131,193, 0, 72,210,100, 9,167,165,245, 83,169, 84, 48, 1,250, 23,225, 52, 24, 12,
-207,136,172,122,161, 85,127,191, 88,194,185,109,217,178, 27,222, 3, 7, 86, 93,186,116,201,229,181,215, 94, 35,228,114, 57,228,
-114,249, 51, 98,203,221,221,157, 8, 14, 13,229,255,150,144,224,107,105,123, 90, 36,162, 73,242,111, 23, 90,255,112, 52,155, 72,
-154, 50,179,132,102,177,208,178,208,162,165,215,235,245, 16,139,197,168,168,168,104,246,193, 79,146, 36,120, 60, 94,253, 26,113,
-139, 59,239, 52, 26,205,198,133, 11, 23,206, 25, 60,120,176, 83,135, 14, 29, 80, 94, 94, 14, 23, 23, 23,112,185,220, 6,223,177,
-122,190,164,164, 36,236,220,185, 83,166,209,104, 54,154,225,220,176,110,221,186,247, 70,143, 30,237,224,234,234, 10,123,123,123,
-220,191,127, 31,246,246,246,144,201,100,200,204,204,132,141,141, 77,131,223,206,137, 19, 39,228, 26,141,102,131, 25,241, 70, 39,
- 38, 38,234,108,108,108,238,151,151,151, 51,170,170,170,168,234,234,106, 74, 38,147, 49,165, 82, 41,243,204,153, 51, 78,182,182,
-182,202,139, 23, 47,150,123,123,123, 51, 30, 61,122,196,208,235,245,102,213, 43, 65, 16,152, 59,119, 46, 88, 44, 22, 52, 26, 13,
- 54,110,220,136,133, 11, 23, 54,248,100,173, 91,183, 14, 75,150, 44,105, 16,206,219,183,111,111,221,192, 73,211,208,233,116,208,
-235,245, 22,111, 80,248, 83, 51, 98,203, 4,123,105,118,118,118, 76,215,174, 93,207, 29, 58,116,200,177, 46, 38, 25,202,202,202,
- 80, 86, 86,134,242,242,114,212,214,214,194, 96, 48,192,195,195, 3,101,101,101, 56,118,236,152, 84, 46,151, 15, 68, 11, 59, 14,
- 25, 12,198,148, 94,189,122, 81,207,151,161,126,150, 87, 47,222, 57, 28, 14,138,139,139,209,183,111, 95,246,165, 75,151,166, 0,
-248, 71, 11,173,198,225, 29, 6, 12,156,198, 10, 10,233,161,189,151, 26, 87, 24,232, 83, 86, 56,105,132,232, 36, 0,220, 77, 41,
-179,189,151,105,135,160,144, 24,122,192, 64,251,200,178,210,109, 97, 0,116, 45,165,235, 1, 0, 91, 62,103, 92,255,232,110,197,
- 54, 2, 1,185,254,155,237,167, 55,111,222,208,249,240,201,127,135,119, 88,255,205,211,240, 14,253,163,187,153, 50,210, 51,198,
- 1,216, 97,169,120,137,137, 25,150,188,115,247, 78,100,164, 94,116,255,100,110, 56,187,170, 76, 15,158,208, 11,145,157, 92,176,
-109,247, 3,220,187,119,175, 84,171,213,246,109,177,127, 19,180,119,106, 90, 74, 64, 88, 72,176,235,228, 41, 51, 69, 49, 49, 35,
- 16, 23,119, 28,123,127,217,145, 56,102,194,232,159,159, 84,203, 24, 98, 38,159,197,167, 77,108, 6,203,150, 98,113,120, 18,173,
-246,105, 4, 2, 38,147, 43, 2,198,181,248,224,121,103,230, 36,219,126,209, 35,112,242,212,113,236,253,101,219,229,207, 67,198,
-238,240,137, 8, 34,186,117,254,122,182, 79, 59,159, 54,138,218, 50, 25, 73,176,117,106,181,201,230,235, 95,242,191,205, 93, 50,
- 37, 23,192, 55,248,135,238, 58,100, 27,141,247, 52, 58,221, 36,175,200,200,219,197,183,111,135,173,209,235, 29, 62, 5,170, 62,
-215,106,243, 15, 1,133, 53, 0, 57,171,110, 76,255, 6,224,170, 40,202,205,150, 36,239,202,141,198,193, 96, 48, 82,209,244, 68,
-252,254,222, 33, 67,186,126,240,240, 33,203,185,103, 79, 94,113, 66, 2,191, 46, 19, 73,139, 66,139,162, 40,208,205, 47,117, 61,
-195, 73,236,217, 67, 2, 0,139,197,106,118,140, 99,177, 88, 80, 42,149,208, 55,111,193,126,134,211,237,236,217,194,135, 15, 31,
-250, 59, 56, 56, 60, 35,178,170,170,170, 26,222,171,213,106, 40,149, 74,240,120,188, 84, 85,211, 43, 34,207,112,150, 37, 38,170,
-215,206,157,187,116,226,132, 9,223,197, 95,184,192,117,116,116,132, 84, 42,125, 70,104,105,181, 90,244,139,138, 98,173, 75, 78,
-158, 12,153,108,153, 37,237,233,210,183,175, 89,127, 96, 6,131, 1,211,223,188,116,248, 18, 96,102, 83,194,139, 52,183,132, 99,
-233,174,195,102, 30,144,207,239,238, 91, 18, 25, 25,169,206,202,202,130,183,183,119,131, 88,105,124, 78,145, 72, 4, 59, 59, 59,
- 36, 37, 37, 97,245,234,213, 42, 0, 75,204,112,202,149, 74,229,235,253,251,247, 87, 81, 20,133,192,192,192,134,248, 89, 38,147,
- 9,108, 54, 27, 2,129, 0,201,201,201, 24, 54,108,152, 82,169, 84,190,142, 63,198,208,122,158, 83,170, 84, 42,223, 24, 48, 96,
-128, 50, 45, 45, 13,189,122,245,194,189,123,247, 80, 91, 91,139,218,218, 90,228,229,229, 33, 56, 56, 24, 74,165, 18, 63,253,244,
-147, 74,169, 84,190, 1, 64,218, 18,167, 92, 46, 31,182,112,225, 66,198,175,191,254,234,227,225,225, 17,210,165, 75,151, 14, 81,
- 81, 81,237, 71,141, 26,213,102,200,144, 33,110,254,254,254,234,129, 3, 7, 58, 15, 30, 60,216, 89,169, 84, 50,175, 93,187, 86,
-162,215,235, 7,155, 41,103,131, 56,201,202,202,106, 88, 42,164, 40, 10, 21, 21, 21, 13,145,251,235, 7,165,102,132,112,180, 57,
-177, 93, 47,176,234, 5,151, 5,126,110, 77,113,154,253, 17,155,205,174,183,120,210, 22,112,222, 77, 79, 79,239,223,167, 79,159,
-187,211,166, 77,147,151,150,150,194,198,198, 6,190,190,190, 8, 8, 8,128,147,147, 19,116, 58, 29,142, 30, 61,170, 56,118,236,
-216, 3,169, 84,218, 23,127,140,161, 21,253, 92, 59,230, 53, 53,200,214, 91,179,234,133, 22,151,203,133,135,135, 71,125,219,230,
-181,166, 61, 95, 16,127, 47,103,157,128,137,234, 55,176,221,144,161, 35,109,143, 30,191,206,254,238,199, 99, 15, 34,163,177,221,
-177,173,236,132, 99, 91,217,137,200,104,108,255,238,199, 99, 15,142, 30,191,206, 30, 50,116,164,109, 84,191,129,237,210, 82, 51,
- 58, 52,206,123,216, 84, 57,185, 92,110,143, 94, 61, 35,171, 47, 93,189,108,250,114,221, 15,100,191,190, 99,146,119,252,124,244,
-232,142,159,143, 30,237,215,119, 76,242,151,235,126, 32, 47, 93,189,108,234,213, 51,178,154,203,229,246,176,164,238,239,204,156,
-100, 59,116,200, 8,196,197, 29, 53, 28,254,237,167,117, 7,142,100,247,153, 62, 39,177, 44, 43,235, 30, 45, 41, 58, 11, 38,249,
- 24,233,233,233,210, 58,145,149,101, 9,231,172, 25,147, 26,139,172, 43,142,174,189,182,167,167,195,120,254,252,239,250, 11, 23,
-146, 85, 87,238, 74,164,119,210, 42,170,138,203,171, 30,201,100,149, 90,147,201, 8,163,209,200, 88,177,162,193, 97,183,201,107,
-244,234,171,175,225, 98,252,126,252,178,123,171,212,100,130,122,220,225,195,198,113,227,150,211,109,218,182,109,179,239,183,253,
- 68,204,240,145,182, 52, 96, 26, 54,122,132,221,175, 7,126, 37,218,249,181,107,235,235,219, 16,210,230, 31,215,151, 62, 1,106,
- 9, 32,189,228,214,173, 46,194, 94,189,238, 27,152,204,128,149, 44, 86,251, 77, 0,123, 28, 96,156, 5,232,151, 1,228, 50,192,
- 67, 69, 81, 29,121, 6,195, 61,185, 82,233, 9, 0, 95,208,244,163,166, 56,151, 3,213,178,199,143, 47, 39,253,240,131,198,229,
-245,215, 29,216, 46, 46, 34, 24,141, 68,253,248,222,220,139,162,168,231, 45, 48,205,114,122, 56, 57, 61, 57,113,226, 4, 2, 2,
- 2,224,225,225,129,198, 62,178,245, 1,185, 29, 29, 29,113,228,200, 17,208,207, 6,167,110,150, 51,194,199, 39,233,171,181,107,
-181, 38,147, 9,213,213,213,127,176,102, 85, 87, 87,195,100, 50,225,212,201,147, 90,217,211, 76, 32, 22,213,189, 47,131, 81, 59,
-177,119,239, 47,135, 14, 29,170,123,248,240, 97,195,206,235,122,203,150, 68, 34,129, 80, 40,132, 90,163,241, 2,192,183,132, 83,
-114,230,140, 0,102,198,245, 38, 44, 90,127, 71, 95,250,167,139,172,198, 9,165,103, 90,100,209, 50, 24, 12,240,242,242,122, 38,
-165, 11, 73,146,207,188, 90,185,227,112, 79, 90, 90,218,217,129, 3, 7, 46,237,222,189,251, 59, 75,151, 46,101,116,232,208, 1,
- 82,169, 20,246,246,246, 16,139,197,200,204,204,196,137, 19, 39,140, 21, 21, 21, 91, 0,172, 68, 19, 1,236,154, 64, 66,118,118,
-118, 76,120,120,248,129, 69,139, 22,217, 14, 24, 48,128,233,229,229, 5,154,166,145,156,156,140,216,216, 88,221,142, 29, 59,100,
-117, 34,203, 82,231,229,115,197,197,197, 99, 6, 15, 30,188,111,202,148, 41, 54, 70,163,145,153,151,151, 7,141, 70, 3,189, 94,
-143,130,130, 2, 93, 92, 92, 92,173, 82,169,156, 4,224,156, 5,124, 73, 53, 53, 53,193,231,207,159,159,114,237,218,181,213,211,
-166, 77,115,140,138,138, 98, 25, 12, 6, 92,189,122,181, 60, 34, 34, 66, 44,145, 72,116, 71,142, 28,169, 84,171,213, 75,140, 70,
-163, 69, 41,120, 8,130,128, 76, 38,131,147,147, 19, 52, 26, 13, 76, 38, 19,180, 90, 45,132, 66, 97, 67,218, 36,154,166,209, 26,
-231,250,231,250, 0, 67,167,211, 97,194,132, 9, 48,153, 76,216,184,113, 35, 12, 6, 67,171,201,108,109,109,239,220,189,123, 55,
-166, 83,167, 78, 13,226,165,190, 15,113, 56, 28, 56, 57, 57,193,209,209, 17,113,113,113, 96, 50,153,119,204,249,187,213,225, 94,
- 69, 69, 69,196,249,243,231,123, 60,120,240,224, 77, 0,157,116, 58,157,135,209,104, 36, 72,146, 44,161,105,250,190, 76, 38,251,
- 25, 22,166,224,145, 72, 36,171,167, 78,157, 26,177,127,255,126, 33, 69,253,251,214,160, 40, 10, 28, 14, 7,245,193, 49,105,154,
-134, 86,171,197,103,159,125, 38, 83, 40, 20,171, 95,150, 81, 34,178, 75, 55,108,251,105,147,240,194,197,179,229,233,217,136,181,
-183, 79,127,190,255, 21,149,149,110, 11, 43, 46, 44, 20, 70,118,233,102, 17,167, 94,171,171,124, 99,210, 2,239,186, 20, 60,159,
-229,229,229,111,221,183,231,219, 92, 0,248,122,195, 70,255,178,202,154, 89, 25,233, 25,227,182,110,253,173,135, 94,171,171,180,
-132,243,223,226,101,159, 20, 52,212, 0,110, 38, 63, 40,243, 25,246,250,153, 37,126,237, 68,195, 37,149,170, 39,181,181,202,247,
- 1,228, 90, 90,247,158,175,246,193,197,115,191, 98,239, 47,251,100,180,137,161,118,114,114,162, 1, 32, 61,221,137, 78, 79,175,
-161,255,237, 87,108,167, 96,210,247, 86, 46,120, 63,106,129, 84, 86,181, 97,227, 79, 45, 47,165,132,119,236,142,240,142,221, 49,
-231,253, 79,109,131, 67, 2,189, 1,224,240, 97, 24, 67,252,210,126, 95,250,249,242,225, 43, 87, 46,135, 76,174, 65,125,186,158,
-204,148,180,147,185,185,208,254,147,251,209, 82,131,225,234, 74,154, 30,165, 76, 76, 12,235,241,209, 71,183,174,172, 95,239, 35,
-101, 48, 94, 93, 1,152, 72,130, 48,130,166,121, 36, 73,150, 8,244,250,100, 57,155,237, 70,152, 76,157,109,140,198,163,122,163,
-145,110,129,243, 38, 22, 44,240, 87, 86, 85, 57,247,252,228, 19, 39,234,163,143,200,150,156,225, 27,223,191,150,112,222,190,127,
-255,228,172,233,211,159, 44, 91,186,116,224,150,173, 91,121, 97, 97, 97, 40, 45, 45, 69, 96, 96, 32, 60, 60, 60,112,254,252,121,
- 28, 57,120, 80, 81, 35,151, 47, 1,176,217, 18,206, 61,167, 78,101,118, 8, 9,169,216,186,117,171,251,208,161, 67, 9,133, 66,
- 1,169, 84, 10,169, 84, 10,141, 70,131,186,128,208,116, 86,118,118,186, 94,175,223, 98,105,221,141,229,229,220,149,221,186, 21,
-177, 76,166,175,198,140, 30,189,112,229, 23, 95,112,218,181,107, 71,104, 52,154, 6,171,150, 78,167,131, 80, 40,212,105,181, 90,
- 71, 52,225,247,214, 20, 39,103,199, 14, 67,121,121, 57,156,157,157, 27,194, 53, 53,142, 75, 40,151,203, 65,211,244, 75,155, 0,
-253,239, 68,179, 10,201,222,222,254, 14, 69, 81,158,141,173, 91, 77,229,206,107,252,153, 94,175, 47,170,168,168,136,124, 78,241,
- 54,231, 15,229, 11, 96, 77,191,126,253,198,124,248,225,135,196,165, 75,151,112,236,216, 49, 58, 55, 55,247,112,157, 21, 43,183,
-133,217, 83,115,156, 54, 28, 14,103,158, 64, 32,136,174, 15,225,192,231,243, 31, 40, 20,138,248,186,229, 66,249, 11,112,138, 56,
- 28,206, 92,129, 64,208,191, 46,253, 10,108,108,108,238, 42, 20,138,243, 26,141,102, 19,154, 79, 84,221, 18, 39,207,214,214,118,
-181,147,147,211, 27, 31,125,244,145, 99, 98, 98, 98,201,197,139, 23, 89, 53, 53, 53,251,181, 90,109, 75, 73,165,255,192,233,224,
-224,112,135,193, 96,120,254, 77,215, 8,225,225,225,113,195,134, 13, 27, 58,105,210, 36,232,245,122,108,222,188, 25,231,207,159,
- 63,153,147,147, 19, 99,102,134,251, 60,167,147,167,167,231,165,119,222,121,167,205,132, 9, 19,248,246,246,246,160, 40, 10, 10,
-133, 2, 57, 57, 57, 72, 78, 78,166,143, 31, 63, 94,155,148,148, 84,164, 84, 42, 95, 3, 80,209,138,246,252, 51, 51,241,103, 56,
- 41,138,234,227,229,229,245,219,178,101,203,108,250,247,239,207,115,116,116, 4,131,193,128, 94,175, 71, 73, 73, 9, 82, 82, 82,
-112,246,236, 89,197,225,195,135, 21,149,149,149, 19, 0, 92,254,111,148,243,175,228, 12,242,199,231,207, 37,138,110, 54,218,187,
-153, 99,205,150,179, 95, 31,183, 17,227,198, 12, 30, 4, 0,135,142,156, 62, 99, 65, 82,233,102,203,105,174,172,150,112, 6,250,
-145,203, 82,211, 82,158, 9,104, 25, 18, 28,154, 21, 20, 54,122,149, 37, 68,141, 34,195, 63, 83,247, 70,203,177,141,109,186,207,
- 44,179, 6,249, 34,102,196,184, 81, 67, 63, 93,178, 24,107, 86,127,137,227,135,142,158, 76,207,125, 38, 77,208, 63,174, 47, 53,
-126,182,172, 96, 48,250,145, 36,233, 69,176,217,183,244, 10, 69,182, 13,192,148, 3,140, 21,128, 98, 37,139,213, 30, 70, 99, 8,
-104,154,146, 19, 68,220,122,163,209, 30, 64,177, 57,206, 85, 20,213,157,239,230,214,123,163,201,180,248, 94, 74,138,176,241,132,
-173,222,242,220,120, 82,233,238,238, 46, 41, 41, 41,113,177,132, 51,230,251,239,117, 74,129,128,179,248,171,175,250,212,170,213,
-125, 86,174, 92, 73,221,190,125, 27, 63,253,240,131, 65, 93, 84,180,175, 28,152,219,204,106, 72,179,156,109,230,206,229,126,252,
-211, 79,111,249,250,249,137,223,124,243, 77, 38,147,201,132, 66,161, 64, 97, 97, 33,206,157, 61,171, 77, 75, 79, 79,147,201,100,
-195, 91, 83,247,152,239,191,215,217,249,250,130,239,236, 76, 95, 72, 72,176,157, 53,111,222, 59,109,125,124,108, 7, 14, 26,196,
- 20,137, 68,168,174,174, 70, 94, 94, 30,142, 30, 61, 42,169,173,173,117, 7, 96,180,132,115,223,181,107,225,167, 46, 95, 30,187,
-106,213, 42,118,104,104, 40,108,109,109, 33,151,203,145,146,146,130,203,151, 47,107,182,108,217, 34,149, 74,165,239, 24,141,198,
- 19,127, 99, 95,122, 41,151, 14,255,110, 15,127, 75, 46, 68, 36,128,207,235,222,127, 1,243, 57, 3,255,201,131,207,243,240,118,
-112,112,216,166, 86,171,105,149, 74, 53, 11, 64,193,255, 96, 57,169,200,200,200,159, 36, 18, 73, 15,154,166, 97,107,107,123, 61,
- 53, 53,245, 93, 52,179,243,198, 12, 39, 3, 64, 15,161, 80,216,205,198,198,166,143, 70,163, 9,170, 91,126, 75, 87, 40, 20,151,
-117, 58,221,205, 58,235,147,241,191, 92,119, 6,128,254,238,238,238,211, 77, 38,147, 31, 65, 16,118, 70,163, 17,122,189,190,198,
-100, 50,229, 72,165,210, 29, 0,206,255, 15,148,243, 47,225, 12,110,143, 81, 52,137,160,230, 4,193, 51, 66,235, 57, 1, 65,152,
-144,158,246, 16, 71, 91, 81, 78,114,112,180,215,143,192,211,157,137, 48,239, 92,251,111,161,101,129,120,105,181,200,108,207,152,
- 74, 19,244, 51,156, 4, 77, 20, 4,134,143,218,251,103,132,150,165, 8, 14, 64, 31,208,232, 97,162,113, 51, 35, 7, 23, 95,182,
-177,110, 25,224, 66,146,100, 87,130, 36,219,211,128,130, 32, 8, 3,104,218, 1, 52,253, 16, 12, 70,234, 82,157,238, 33,154, 78,
- 96,222, 44,231, 26,192,225, 7,123,251,235, 36, 69,185, 2, 32,235,172, 47, 38, 19, 65, 24,105,130, 48, 52, 94,222,122,110, 98,
-217, 34,167, 14, 8, 99,114, 56, 94, 70,131,193,165, 20, 16,158, 50, 26, 59,171,105,186,214, 19,248,252, 46,144,217,218,186,215,
-115, 50, 56, 28,239, 83, 52, 61,162, 92, 32, 8,151,168, 84,206, 0,104,161, 64,144, 46, 83, 40,126, 81,171,213, 63,182,182,238,
- 58, 32,140,197,225,120, 26, 13, 6, 23, 0, 32, 41, 74,114, 64,163,241, 42, 18,137,222, 84,107, 52,109,132, 66,161, 94,171,213,
-202,212,106,245, 36,131,193,112,161, 53,117,207, 49, 24,130,175,145,100, 47,157, 64,224,168, 35, 8,129,214, 96,208,105,117,186,
- 66,181, 90,253, 0,192,183, 0, 30,254,205,125,201,138, 23,188, 1,173,156, 86, 78, 43,167,149,211,202,249,255,156,115, 45, 32,
- 90, 3, 56, 88,219,243,111,229,228, 3,240,174,155, 44,254, 19,235,254, 82, 90,183, 40,107, 91, 88, 97,133, 21, 86, 88,241,119,
- 99, 81,243,110, 22, 86,252,117, 80,162, 9,159, 44, 43,254,187, 32, 90, 80,165,173, 49, 9,190,136,178,141,183,114, 90, 57,173,
-156, 86, 78, 43,167,149,211,202,249,255,142,211, 28,247, 63,113, 73,114,102, 19,159,109,251, 79,156,216,106,254,181,114, 90, 57,
-173,156, 86, 78, 43,167,149,211,202,249,255, 22,164,181, 9,154,133, 75,221,235,175, 62,214,138,151,187, 47,252, 39,224, 81,247,
-106,205,241,110,214,203,104,133, 21, 86, 88,241,255, 67,104, 89,250,208,250, 51, 15,183, 63,251, 96,252,146, 32, 80, 76, 16, 40,
- 6,240,229, 95,120,172, 57,184, 59, 57, 57,125, 16, 28, 28,188,207,197,197,101, 14, 0,113, 43,127,239,207,231,243, 55, 9, 4,
-130, 75, 2,129,224, 18,159,207,223, 4,192,255, 47,186,110, 4,128, 89, 28, 14, 39,193,205,205,237, 9,155,205, 78, 0,240, 14,
- 94,124,231,106, 7, 60,141,147,246, 5,128,240,214,252, 80, 28, 50,226,160,115,200,136,251,206, 33, 35, 82, 28, 67,135,249, 59,
-135,140, 72,113, 14, 25,113, 95, 28, 50,226,224,223,208, 95,255,202,235,251, 87,149,167,128, 32, 80, 96, 97,121,190, 37,128, 66,
-130, 64,209,255, 72,249,173,176,194, 10, 43,172,104, 86, 5,184,187,143,113,115,115,139,119,115,115, 59,239,238,238, 62,198,130,
-159, 68, 55,241,144, 48, 18, 4,140,102, 6,253,150,142, 51,103,174,108,252,219,245, 22, 86,173, 49,167, 11, 65,192, 72,215,129,
- 32, 96, 18,139,197,223,185,185,185,125,249,252, 75, 44, 22,127, 71, 16, 48, 53, 58,214,216, 72,224,181,214,172,234, 50,121,242,
-228, 67,213,213,213,113, 90,173, 54, 46, 59, 59, 59,238,181,215, 94, 59,240,156, 37,162, 89, 78, 46,151, 59,177,107,183, 30, 73,
-151,175,222,204,206,202,201, 47, 78,203,124,148,255,251,153, 11,183, 67,195,194,111,113,185,220,137,173,184, 70, 4,128, 89, 20,
- 69, 37, 8,133,194, 34,138,162, 18, 0,204,102, 48, 24, 39,214,174, 93,155,159,154,154, 90,118,237,218,181,154,203,151, 47, 63,
-153, 54,109, 90, 14, 65, 16,191, 55, 33,216,163, 45,176,192, 44,125,252,248,241,153,146,146,146,179, 60, 30,111,181, 5,199, 55,
-112, 58,135,140,184, 47,145,234,104,137, 84, 71, 59,135,140,160, 27,189,191,223,202, 54, 55,119,141,254,208, 23, 56, 28,142,183,
- 25, 65,255,119,154,232,255, 80, 30, 0,174,117,223, 69, 2,248,190,238, 85,191,157,221,149,203,225,252, 85,253,243,175,104, 79,
- 43,167,149,211,202,105,229,124, 89, 17, 81,247,215, 13, 79,253,181, 26,158,221,173,221,117,248, 94,118,118,182, 16, 0, 2, 2,
- 2,222, 5,112,164, 53, 66,130, 32,240,177,201, 68,147, 0, 64,146,196, 39,125,251,246,139,224,241,120,207, 68, 65, 86,169, 84,
-236,132,132,139, 81, 38, 19, 77,212, 29,247, 49, 77, 99, 19,128, 50, 75,207,161,213,106, 72, 38,147, 13,146, 36, 22,132,134,134,
-181,173,168,168, 72, 36, 73,114,223,147, 39, 79,170, 91,109,198, 33, 8,108,223,190, 61,192,205,205,237, 15,209,154, 75, 74, 74,
-216, 35, 70, 12,111, 21,223, 84,128,163,225,112,186,177, 8,194,205,104, 48,216, 1, 0, 69, 81,213,183,217,236,200, 53,171, 86,
-241, 9,130, 48, 85, 86, 86, 66,165, 82, 97,254,252,249,188,180,180,180,145, 21, 21, 21, 63,154,161, 13, 8,239, 24, 49,255,236,
-217, 51, 65,178,170,106,245,246, 13, 91,147, 84, 20, 75,233, 19, 28,200,250,105,219, 47,246, 51,223,154,244,126, 70, 70,234, 93,
- 52,157,142,164, 49, 72, 0, 71,231,205,155, 23, 18, 19, 19,195,150,203,229, 92,149, 74,213,118,223,190,125,159, 69, 70, 70, 10,
- 59,117,234,196,254,237,183,223, 8,169, 84, 10,154,166,249,129,129,129,244,248,241,227,213, 7, 14, 28,152, 3,224,187, 22,132,
-239,199, 79,219,146,220,216,161, 67,135,101, 0,144,157,157,205,106,212,198,204,160,160, 32, 1, 0,100,102,102,174,160,105,211,
- 60, 0,160,105,172, 3,176,184, 9,211, 90,118, 72,207,113, 0, 1,191,212,171,135,184, 33,189,198,169, 65, 35,135, 0,178,235,
- 38, 4, 43,129, 70,113,161,158, 69,122,113,113,241, 11,229, 38, 28, 58, 52,134, 32, 8,226,112, 82, 82,210, 17,137, 68,226, 99,
- 50, 25,103,180, 84,206,230,174,149,179,179,243, 89,163,209,168,169,170,170,106, 8,148,233, 28, 62,170,135,163,141, 32,170,188,
- 90,158, 88,153,118,252,178,133,125,147,112,116,116,156, 90, 81, 81,241, 37,128,233,233,233,233, 17, 0, 16, 20, 20,196, 2,112,
- 71, 36, 18,189,170,211,106, 9,235,248,103,133, 21, 86, 88,241, 31, 17, 90,201, 0,134,226,223, 41,120,182,189,136,208, 98, 3,
- 64, 98, 98, 34, 0,112, 94,160, 32, 68, 99, 1, 51,119,238, 92,184,185,185, 61, 47, 94,112,233, 82,194,159,169,236, 51,231,248,
-226,139, 47,132, 53, 53, 53,209, 63,255,252,115,111,154,166,215, 23, 23, 23,223, 48,243,251, 50,154,198, 58,146, 36, 62, 33, 8,
- 2, 28, 14, 55,235,157,119,222, 73,174,251,174,237,239,191,255,206, 31, 54,108,152, 18, 64, 62, 0,112, 56, 92, 15, 6,131, 12,
-160,105,186,254,129,219,172, 32, 28, 11,248, 26,216,236,126,179,190,255,222,208,121,216, 48, 74,224,236, 76, 0, 64,126, 70,134,
-227,186,175,191,126,181, 58, 55,151,173,114,116,172,172, 84, 40, 84, 89, 89, 89,224,112, 56, 4,131,193,232,108,174,194, 2,129,
-224,131, 85,107,190, 18,200,170,106, 84,106,153, 92,203, 48,232, 53, 54, 60,190,177,172, 84, 82, 41,228, 9,148,159,124,190,156,
-253,222,140, 41, 31, 40, 20,138,119,205, 80,205, 89,176, 96, 65, 80,215,174, 93, 61, 14, 30, 60, 72, 72,165, 82, 80, 20, 37,236,
-212,169, 19, 34, 35, 35,141, 23, 47, 94, 36,124,124,124, 16, 26, 26,138,171, 87,175,226,250,245,235, 68, 68, 68, 4, 63, 54, 54,
-118,178, 94,175,255,206,156,184,102, 48,200,249,129,129,129,157, 4, 2,129, 54, 32, 32, 0, 51,102,204, 0, 77,211,136,142,142,
- 14, 21, 10,133, 71, 20, 10, 5, 59, 51, 51,163,183, 57,145, 45, 73, 61, 62,190,222,178, 5, 32, 12, 52,114,202, 83,143, 55, 94,
-126, 12,202,204,204,236, 94, 93, 93,141,167,215,133,110, 72, 96,222,187,119,239,214,244,165, 50,154,198,186, 97,195, 98, 62, 1,
- 8, 34, 58, 58,186,102,206,156, 57,100, 70, 70,198, 27,163, 70,141, 12,205,206,206, 65, 43, 39, 3, 1, 3, 6, 12,184,122,234,
-212, 41,199,128,128,128,242,170,170,170,134, 47, 92, 29,237, 6, 94,142,221,248,193,234, 77,251, 2,247,208, 68, 77,121,250,177,
- 7,102,250, 38, 49,117,234, 91,101, 66,161,112,244,225,195,135, 51, 75, 74, 74, 40, 22,171, 65,187, 50,196, 98,177,115, 64, 64,
-192,108, 7, 7, 7, 9,131, 36,197, 52,104,218, 92,255,180,194, 10, 43,172,176,226,133,113,178, 78, 92,157,124,254, 11, 10, 0,
-226,226,226, 26, 34,211,198,196,196, 52, 59, 3,166,105,186,236,222,189,123, 94, 74,165, 18, 52, 77, 91, 50, 96, 55,222,162, 89,
- 70, 16,228, 79, 36, 73,188, 75, 16, 4, 66, 67,195, 30,109,220,184,177,169,156, 94,218,208,208,176, 71, 12, 6,217,142,166,105,
- 16, 4,185,153,166, 77,101,205,112, 54,249, 32, 98,179, 57, 31, 3,128,171,171, 91,238,233,211,167,181, 99,199,142,197,215, 95,
-127,205, 90,180,104,209, 66,138,162,230, 20, 20, 20,148,182, 80, 78, 0, 88,236,236, 44,230,111,223,190, 61,224,157,119,222, 73,
- 46, 41, 41, 89, 12, 0,110,110,110, 95, 2, 8, 6,144,223,232, 51,108,217,114,224,201,140, 25, 51,178, 36, 18,201,226,230, 56,
- 71, 3,237,189, 2, 3,251,173, 76, 76,164, 73,141,134,168,184,114, 69, 86, 94, 86,166,127, 88, 94,206,223,125,231, 78,204,103,
- 95,126,201,244,242,246,198,165, 19, 39,156, 42,148,202,114,169, 70,163, 46, 43, 43,163, 13, 6,195,117, 11,234, 30, 34,118, 22,
-243,183,126,187,249,182, 13,147, 97, 18,123,122, 16, 76, 7, 7,138,228,139,216, 12,138,212,180,107,235,207, 6, 16, 98,238, 26,
-177, 88,172,201, 3, 6, 12,224, 31, 56,112,128, 8, 13, 13,133,157,157, 29,174, 92,185,130,187,119,239,162,186,186,154,212,235,
-245,232,210,165, 11,190,250,234, 43,120,123,123,163,166,166, 6, 5, 5, 5, 78,108, 54,219, 89,175,215, 55,215,158,207,244,167,
-143, 63,254, 24,110,110,110, 48, 24, 12,168,170,170,130,193, 96,128, 80, 40, 4, 0, 20, 21, 21,225,196,137,227,150,244, 37,179,
-160,105, 26,175,188,242,138,156, 32,136,244,231, 45, 90,173,225,244,240,240,248,173,188,188, 98,112,191,126,253, 80, 93, 93,173,
- 95,190,124, 57,194,195,195, 17, 16, 16, 96,182,156,238,238,238,179, 12, 6,195, 82, 0,208,233,116,187,185, 92,238,219,123,247,
-238,117,108,156, 34,164,222,146, 85, 38,169,172,190,126, 59, 53,115,193,172,177,175, 37,222, 72, 41,212, 49, 71, 20, 72,239, 31,
-151, 54, 81,206,197, 44, 22,251,231, 54,109,218,124, 59,119,238, 92, 55, 7, 7, 7,104, 52,154,207, 74, 75, 75, 49,123,246,108,
- 0,192,144, 33, 67,194,153, 76,230,233,105,211,166,193,199,199,231, 73, 85, 85, 85, 65, 82, 82,210, 12,165, 82,153,242,162,237,
-105, 33,172,156, 86, 78, 43,167,149,243,133, 97,169, 22,249, 31, 69, 9,158, 13,231,176,237, 25,161, 21, 19, 19, 67,196,197,197,
-209, 22, 84,172,210,211,211,211,139,199,227, 1, 64,101,107, 75, 97, 50,153,230, 56, 58, 58, 74, 22, 47, 94,220, 51, 32, 32, 64,
- 59,103,206,156,148,252,252,252, 37,141,143,105,219,182,237,234, 31,126,248, 1, 89, 89, 89,249, 95,126,249,229,213,202,202,202,
-214,230, 49, 91, 68,211,216, 88,103, 29,171, 56,113,226, 68,120, 98, 98,226,187, 27, 54,108,112,126,239,189,247, 88, 31,124,240,
-193, 36, 0, 95,155, 35, 97, 48, 24,202,166,150, 11,155,130,155,155,155,150,193, 96, 52, 27, 36, 46, 6,224,113,217,236,190, 43,
- 19, 19,105,109,126,190,114,231, 55,223,216,108,189,117,107,153,158,166, 93,196, 98, 49,122,189,250,106, 45,151,193,168,144,148,
-150,154,196,237,219, 51,242, 78,159,118, 82,177,217,197, 7, 14, 28,144, 86, 86, 86, 30, 51,107,194, 35, 8,153,137,166,181, 66,
- 79,111,253,216,145,253, 67,111,223,188,155, 97, 35,118, 34, 35, 58,133,134,103,100,229, 39,193,100,210, 17, 4, 97, 54, 88,160,
-173,173,109, 64,101,101, 37,100, 50, 25,156,157,157,177,113,227, 70,184,186,186, 66,169, 84, 34, 53, 53,149,246,244,244, 36, 18,
- 19, 19,225,233,233,137,242,242,114,104,181, 90,200,229,114,137, 70,163,105, 46, 55, 99, 25, 73, 50,118,145, 36,241, 22, 65, 16,
-104,215,206,247,241,143, 63,254,168, 53,153, 76, 8, 10, 10,194,168, 81,163, 16, 27, 27,139,212,212,212,122,203,147,182, 77,155,
-182,143, 73,146,104, 83,167,149, 94,216, 2, 83,159,218,167,184,184,120,244, 11,222, 52,164,187,187,251, 36, 63, 63,191,119, 39,
- 78,156,168,103,179,217, 80, 40, 20,245,109,161, 31, 60,120, 72,205,176, 97, 49,182, 39, 79,158,108,182,156, 58,157,110,233,147,
- 39, 79,220, 84, 42, 21, 6, 13, 26,244,193,250,245,235, 5,108, 54, 27, 0, 96, 52, 26,159,177,100,173,218,176,231,236,188,165,
- 63, 38,156,253,237, 43,247, 85,139,222,126,109,210,156,213, 9, 0,206, 52, 85, 48,173, 86,155, 43,149, 74,167, 47, 88,176, 96,
-223,150, 45, 91,236,151, 44, 89, 2,147,201, 4,154,166, 97, 48, 24, 26, 18,137,155, 76, 38, 28, 61,122, 20, 15, 31, 62, 92,253,
-156,200,178,194, 10, 43,172,248,159, 67, 43,180,200,255, 34,220,240,116,217, 16,207,139,173,255,120,100,120, 6,131,177,245,220,
-185,115,157,122,247,238, 77, 69, 69, 69,133,158, 57,115, 38,244,201,147, 39, 41,117,214,131,208,168,168,168, 80,177, 88,140, 77,
-155, 54, 41, 25, 12,198,214, 23, 60, 77,195, 67,175,180,180, 52, 25,192,250,216,216,216,117,179,102,205,130,171,171,107,112, 73,
- 73,201,127,180,206, 34, 14, 39, 98,218,198,141, 6,166, 94, 79,126,191,126,189,232,155,132,132,117, 7, 15, 29,162, 94,121,229,
- 21,130,166,105, 60,184,127,159,247,213,119,223,241, 39,140, 28,153,159,153,155,107, 56,126,246,172,190,236,201,147,170, 39,229,
-229, 75, 1, 84,153,227,215,235,245,255,202,206,206,118,239,213,231, 21,143,203,183, 82,238,142, 29, 57,164, 31,147, 34,137,156,
-252,162, 59,110,174, 78,182,151, 18,226, 85,122,189,254, 95,230,120, 20, 10, 69,158,193, 96,112,160,105,218,249,210,165, 75,112,
-118,118, 70,117,117, 53,244,122, 61,180, 90,173, 86,169, 84,114, 43, 43, 43,161, 86,171,161,209,104, 32, 18,137,240,224,193,131,
- 50,131,193,112,177, 57, 78,163,209, 56,141,195,225,124,193,100, 50,217, 44, 22,171,248,206,157, 59,144,201,100,109,237,236,236,
-190, 54, 24, 12, 40, 46, 46, 70, 98, 98,226, 71, 34,145, 40, 31, 0,184, 92, 46,216,108,142,163, 70,163, 49, 0,120,242,162,109,
- 78,211,244, 11, 95, 47, 87, 87, 87,111, 30,143,183,242,147, 79, 62, 14,234,216,177, 19,202,203,203, 97, 50,153, 32, 16, 8,160,
- 84, 42, 33, 18,137,208,163, 71,143,188,149, 43, 87,150,208, 52,102,182, 32, 6, 25,117,215, 7,179,102,205, 18,136, 68, 34, 20,
- 22, 22, 34, 48, 48,176, 65,104,149,148, 87, 62,184,118, 59, 37, 99,193, 59,227,250,236, 63,145,144,126,246,210,157,244,145,131,
- 94,237, 72, 16,116,219,150,202, 40,145, 72,202, 41,138,154, 51,107,214,172, 47, 2, 2, 2,218,209, 52, 13,127,127,127, 12, 24,
- 48, 0,167, 79,159, 70, 86, 86, 22, 20, 10,133,241,198,141, 27,191,150,148,148,252,110, 29,194,173,176,194, 10, 43,254, 86,252,
-193, 55,235, 25,139,214,127, 18, 18,137,164, 60, 35, 35,227, 76, 82, 82, 82,204,248,241,227,113,233,210,165,241,103,103, 1, 0,
- 0, 32, 0, 73, 68, 65, 84,169, 0, 22, 0, 0,135,195,153, 58,126,252,120, 36, 37, 37, 33, 35, 35,227,140, 68, 34, 41,255, 43,
-206,201,102,179,213, 90,237, 83,227, 20,151,203,229,182,242,231,109,235,150, 12, 1,160,109, 11,159, 53,111, 26,161, 40,183,176,
- 65,131,168,234,187,119,101,219,111,222,252, 98,223,190,125, 84,207,158, 61, 9,189, 78, 7,163,201, 4, 95, 95, 95, 34, 42, 58,
- 90,176,107,223, 62, 7,163, 66,145,184,234,147, 79,174,108,155, 54,173, 54,187,206, 15,204, 28, 52, 26,205,119,239,206,158, 30,
-157,112,233,138, 71,112, 96,123,135, 51,231, 18,146, 29, 29,109,249, 1,126,126,130,202,234, 42,227,146, 69, 31, 81, 26,141,230,
-123,115, 60, 42,149,234,104,124,124,252, 72, 47, 47, 47,231,148,148, 20,104,181, 90, 24,141, 70, 68, 69, 69,129,166,105, 14, 0,
- 19, 69, 81,200,200,200,128, 78,167,147,100,103,103, 23,231,228,228,112, 0,172, 53, 83,190,199, 26,141, 6,233,233, 79, 87,237,
- 60, 61, 61,251, 15, 29, 58, 20, 6,131, 1,131, 6, 13,194,241,227,199,251,167,167,167,127,211, 88,243,253,217,107, 94,103, 33,
- 11,114,119,119,143,173,251,200, 34, 39,120, 15, 15,143, 80, 95, 95,223, 45,107,215,174,101,121,122,122,130,166,105,216,219,219,
- 65,169, 84,162,162,162, 18,193,193,193,240,242,242,194,218,181,107, 1,224,215,150, 44,110, 38,147, 9, 37, 37, 37,200,203,203,
- 67,110,110, 46,188,188,188, 64, 16, 4,228,114, 57, 12,134,167, 57,185,249,114,217,201, 31,118,253,222,247,208,150,165, 33,221,
-194,252,189,111, 38,167, 73, 38,143,238,207,247,247,241, 14, 40, 79, 89, 78, 2,203,155, 77,186, 92, 92, 92,156, 83, 92, 92, 60,
- 94, 34,145,176,106,106,106, 34,251,247,239,191, 41, 58, 58, 26,201,201,201,184,114,229,202, 4, 14,135, 35,209,233,116, 6, 87,
- 87,215,153, 4, 65,136,116, 58,221,254,202,202,202, 18,235,120,104,133, 21, 86, 88,241,151,163,222, 71, 11,141,254,182,206,162,
-245,127,236,157,119,120, 20, 85, 27,197,207,108,223,108,122,217,144, 66, 2,132,146, 16, 2, 4,164, 72, 15, 8,210,130,116, 80,
- 41,130, 74, 19, 69,164, 8, 22, 64, 44,128, 74, 83,145,170,210,123,211,128, 64,162,180, 72, 64, 58, 36, 36,129, 4, 82,119,211,
-203, 38,219,167,220,239,143, 20, 19, 72,217, 77, 98,129,111,126,207, 51,207,236,206,206,156,185, 83,246,206,153,247,182,192,192,
- 64,219,164,164,164, 73, 77,155, 54,149, 2,128,141,141, 77,155,230,205,155,207, 79, 76, 76, 44,178, 54, 53, 58,157,238,192,238,
-221,187, 95, 92,179,102,141,100,200,144, 33, 45,142, 28, 57,210, 5, 0,134, 12, 25,210,194,222,222, 30,187,119,239, 54,235,116,
-186, 6,235, 19,137,166,233,222,157, 59,119, 70, 94, 94, 30,146,146,146,172, 42, 66,249,229,151, 95, 20, 40,169,151, 85,227,178,
-154, 96, 76, 38,103, 39,111,111, 65,250,217,179,230, 60,141,198,179,119,159, 62, 20,109, 54, 67, 32, 16, 32, 55, 55, 23, 41, 41,
- 41,112,116,114,162, 98,239,223,183,219,182,112,225, 47, 77,131,131,165,172,201,228,106, 69, 50,181, 57, 89,153, 83,222,158,253,
-214,209, 61,123,246, 42, 11, 52,154, 4, 27, 27,133, 81, 38,147,120,204,121,251,109, 54, 47, 47,111, 50,128, 98, 11,116, 86,238,
-217,179,103,208,160, 65,131,110,251,250,250,186,103,103,103,123, 20, 20, 20,176,121,121,121, 66,148,212,181,162, 0,224,236,217,
-179,208,104, 52, 12,203,178, 23, 80,210, 23,150,201,210,132, 54,105,210,196,177, 83,167, 78, 33, 74,165, 18,133,133,133,112,117,
-117, 69,135, 14, 29, 66,132, 66,225, 15,201,201,201,133, 13,121,215,135,135,135,219, 19, 66,158, 39,132, 96,208,160, 65, 22,109,
-195,178,236,212,161, 67,135, 74, 40,138,130, 94,175,131, 92,110, 3, 91, 91, 59,216,219, 59,192,223, 63, 0, 42,149, 10, 3, 7,
- 14, 52, 37, 36, 36,124,175, 86,171, 15,212,162, 5,149, 74,133,236,236,108,164,164,164, 32, 39, 39, 7, 0,144,147,147, 83, 94,
- 57,191, 33, 40, 44, 44, 28,222,189,123,247,121, 51,103,206, 4,195, 48, 24, 62,124, 56, 82, 83, 83, 87, 63,122,244,104,191,151,
-151,215,132,169, 83,167, 42, 93, 93, 93, 49,111,222, 60, 27, 0,159,240,249, 33, 15, 15, 15, 79,131,243,120, 29,173, 39, 35, 90,
- 53,149,137,122,120,120,244,162, 40,234, 35,189, 94, 47, 45, 43,146,161, 40, 74,170, 84, 42,143,235,245,250, 21,106,181,218,170,
- 74,113, 5, 5, 5,154,135, 15, 31, 30,143,138,138, 26, 59,106,212, 40,132,135,135, 79, 6,128, 81,163, 70, 33, 42, 42, 10, 15,
- 31, 62, 60, 94, 80, 80,208, 32, 3,144,122,123,123, 15,238,211,167,207,168,206,157, 59, 35, 44, 44, 12, 44,203, 94,178,102,251,
-138, 45, 12, 81, 69,171,195,178,101, 22,137, 9,133,160, 40,170, 60,154,145,147,157,141,248,184, 56,228,229,231,195,104, 48, 64,
-171,211,177,254,205,154,233, 11, 77, 38, 49, 5, 88, 91,246,149,124,253,234,229, 20,157, 86,235,238,234,236,162, 87, 40,100, 40,
-208, 20, 74,174, 93,189, 92, 12, 32,193, 66, 13, 19, 33,164,207,175,191,254,186, 68, 40, 20,142,179,179,179,195,172, 89,179,132,
- 33, 33, 33,144, 72, 36, 48, 26,141, 40, 40, 40,192,238,221,187,179, 89,150,245, 43,221,198, 78,161, 80,236, 16, 10,133,105, 69,
- 69, 69, 31,213,186, 3,147,105, 72,104,104,168,200,100, 50,225,179,207, 62,195,210,165, 75, 49,104,208, 32,209,213,171, 87,135,
- 0,216,211, 80,119, 60,199,113, 24, 48, 96, 64,197,202,240,247, 44,217, 78, 44, 22,183,109,217,178, 37,178,179,179,145,157,157,
- 13,165, 82, 9, 47, 47, 47,120,120,120, 96,245,234,213,100,253,250,245,167,204,102,243,247, 57, 57, 57,153,150,164, 33, 49, 49,
-177, 60, 50,104, 48, 24,160,213,106,145,154,154, 90, 94,116,168,183,117, 24, 52,123,202,176, 96,173, 94,175,187,114,231,126,202,
- 71,239, 76,232,166,213,235,117,247, 31,165,196, 3,223,112, 22,220,223,211, 38, 79,158, 60,109,236,216,177, 40, 46, 46, 70, 84,
- 84, 20,122,244,232,129, 47,191,252,210,243,194,133, 11,239,117,238,220, 25, 98,177, 24,231,206,157, 3,195, 48,169,124, 94,200,
-195,195,243, 95,230, 41,173,159, 85, 35, 53, 70,180,124,124,124,156, 88,150, 93, 48,116,232,208, 1, 35, 70,140,192,192,129, 3,
- 43,253,190,103,207, 30,251,195,135, 15,175,248,230,155,111, 6,153,205,230,149,214, 20,245,113, 28,119,116,207,158, 61, 67,186,
-117,235,166,232,219,183,111,115, 0,144,201,100,166, 61,123,246,232, 56,142, 59, 90,135, 99, 41,235,136, 49, 19, 0,188,188,188,
-218,139, 68,162, 81,131, 7, 15,110, 63,101,202, 20, 68, 71, 71, 99,247,238,221, 15,252,253,253, 35, 51, 51,173,170, 95,157, 84,
- 75,171,195, 21,181, 69,183,132, 82,105,110, 65, 70,134,147,157,175,175,216,217,222, 94, 29, 22, 22,230,211,191,127,127, 42, 53,
- 53, 21,249,249,249, 48, 24, 12,184,122,245, 42, 39, 2,146, 69,206,206, 84,114, 84, 20, 37,148, 74,115, 81,185, 37, 95,173,248,
-120, 58,183,250,120,209,140,166, 6,163, 33,168,176,176,144, 17,137,197,226,198, 30, 78,169,113, 9, 86,149,196, 25, 21, 10, 69,
- 39, 0, 34,142,227,116, 46, 46, 46,138, 51,103,206, 64, 42,149,130,162, 40,180,107,215, 14,114,185, 92, 66, 8, 73, 1, 0,123,
-123,123,233,230,205,155, 29, 39, 76,152,112,177, 54,225,142, 29, 59,138,101, 50,217, 75,254,254,254,136,138,138,194,221,187,119,
-147,163,162,162,154,116,236,216, 17,190,190,190, 47,121,122,122, 30,188,113,227, 6,221, 16, 55,118, 73,139, 85,235, 43,195,179,
- 44,203, 81, 20, 5,129, 64, 0,142,227,144,157,157, 13, 63, 63, 63,108,216,176, 1,235,214,173,251, 76,173, 86,255,108,133, 22,
-171,209,104, 96,107,107,139,187,119,239, 26,135, 14, 29, 42, 19, 8, 4,120,240,224, 65,185,209,114,119,115,105,211,163,115,219,
-214,159,173,221,121,218, 86, 38,147, 13, 12,233, 20, 24,115, 63, 57,141, 16,170,214, 98,227,192,192, 64,137,159,159,223,228,177,
- 99,199, 34, 49, 49, 17, 43, 86,172,200, 81,171,213,103, 79,159, 62, 61,122,230,204,153,194, 30, 61,122, 32, 55, 55, 23, 63,253,
-244, 19,115,237,218,181, 31, 51, 50, 50,118,242,217, 56, 15, 15, 15,207,127,196,104,249,248,248,140,149, 72, 36,243,198,143, 31,
- 47, 12, 8, 8, 64,102,102, 38, 28, 28, 28,104,138,162,196, 0,224,228,228, 68,219,216,216, 96,198,140, 25, 8, 14, 14,238,181,
-112,225,194, 30, 34,145,104,131, 74,165,218, 97,201,142,179,178,178,116, 2,129,224,208,172, 89,179, 86,222,188,121,195, 15, 0,
-254,252,243,207,135, 42,149,106, 81, 86, 86,150,206,202,227, 40,235, 20,147,146,201,228, 87, 90,181,106,245,168, 83,167, 78, 14,
- 35, 70,140,128, 82,169,196,245,235,215,177,106,213,170,251, 38,147,105,201,249,243,231,153,127,250, 36, 51, 70, 99,198,181, 99,
-199,236, 67, 94,125,213, 97,206,208,161, 95,191, 53,107,214,154,143, 63,254, 88, 20, 16, 16, 64,233,116, 58, 92,185,114,133, 28,
- 62,124,152,254,233,211, 79,215,193,214, 86, 28,117,248,176,212,100, 50, 37, 91, 25,185,235,211,179,119,175,128,175,215,124, 3,
-131,190, 24, 87, 46,157, 64,126,126, 54, 54,111, 57, 18,224,237, 77,250,164,167,167,159,183, 84,139,162, 40,255,240,240,112,119,
- 66, 8,164, 82, 41,150, 47, 95, 14, 47, 47, 47, 56, 56, 56,160,168,168, 8,239,189,247,158,227,187,239,190,235, 8, 0,209,209,
-209,229,221, 51,212,134, 74,165,234, 62, 99,198, 12,123,134, 97,112,234,212, 41, 19, 69, 81, 31, 69, 68, 68,252,208,174, 93, 59,
-105,175, 94,189,236,119,238,220,217, 3,192,185,134, 50, 90,117,220,238,193,153, 51,103, 58,143, 27, 55,142,136,197, 98,170,160,
-160, 0, 78, 78, 78,216,176, 97,131, 86,173, 86,159,176, 82,107,249,162, 69,139,150,148,126,222,254,209, 71, 31,189,177,114,229,
- 74,101, 70, 70, 70,121, 84, 51, 43, 39,239,247,238, 67,223,102,115, 11, 10, 77, 63,174, 93, 56,198, 70, 46,147,126,180,242,199,
-115,180, 16,151,107,189,175, 24, 70,170, 80, 40,164,132, 16, 28, 58,116, 8,201,201,201, 83,115,115,115, 51, 88,150, 61,178, 96,
-193,130,249, 1, 1, 1,205,226,226,226,146,139,138,138,190,204,202,202,122,196,103,119, 60, 60, 60, 60,127, 27,101,149,224,203,
- 90, 31,158, 64, 73,113, 98,245, 70,139,101,217, 25,167, 79,159, 22,114, 28,135, 45, 91,182,224,218,181,107, 68,161, 80,124,164,
- 80, 40,190,179,177,177, 97,245,122,253,244, 55,223,124,115,194,210,165, 75, 5,189,122,245, 66, 84, 84,148,192,207,207,111, 50,
-128,138, 70,171, 63,106,232,107,163,176,176,240,106,102,102,134, 95,133, 14, 42,253,100, 50,249,213, 90, 14,230,113,205,199, 59,
-197,236,186,124,249,114,173,167,167,167,233,238,221,187,216,180,105, 19,119,237,218,181,179, 82,169,116,179, 90,173, 54, 90,168,
-217, 16,148,107, 74, 25,230,250,174,249,243, 3,159, 27, 62,156,123, 99,222,188, 98,137,141,205, 59, 95,127,243,205,194,130,162,
- 34, 47, 80, 20,113,117,116, 76,222,178,124,249,138, 65, 47,189, 84, 28,125,254,188,252,102,120,184, 88, 73,211,183,172, 73,103,
-122,122,250,249,115,231, 46, 98,251,214, 53, 48,155,141, 80,167,151,248,180,156,220, 66,212, 98,178,158,208,100, 24,166,112,244,
-232,209, 18, 0, 54, 19, 39, 78,148,102,101,101,161, 69,139, 22, 0, 0,141, 70,131, 19, 39, 78,160,117,235,214, 0,128, 59,119,
-238,148,127,174, 45,157,182,182,182, 47,245,232,209, 3,201,201,201,136,142,142,254, 77,173, 86,231, 2,248, 45, 53, 53,117, 72,
-231,206,157,113,244,232,209, 97, 53, 24, 45,171,174,145,133, 70,235, 9, 77, 27, 27,155, 69, 71,142, 28,153,122,233,210,165,113,
-243,231,207, 23,191,240,194, 11, 0,128,162,162, 34, 29, 0,214, 26, 77,189, 94,191, 25, 64,121,203,217,164,164,164, 93,243,230,
-205,187, 48,119,238, 92,101, 89,250,178, 99,126,142,202, 6,162,130, 66,166,126,220,189,115, 80,192,231,235,119,159, 78, 73,205,
-220, 93,120,239,120,161, 37,199, 78, 8, 1, 77,211,224, 56, 14, 46, 46, 46,218,220,220, 92,100,101,101, 61,202,202,202,154,149,
-144,144, 96,213,177, 55,228, 61,207,107,242,154,188, 38,175,249,127,138,229, 61,195, 19, 66, 24,142,227,112,238,220, 57, 28, 57,
-114,132, 53,155,205,211,212,106,117,197,222,170,191,185,126,253,122,248,232,209,163,119,196,197,197, 9, 99, 98, 98, 64, 8, 97,
-173, 73,141,193, 96,160, 41,234,201,101,245, 61,202,237,219,183, 35, 35, 35,195,156,154,154, 26,193, 48,204,209,122,182, 94,172,
-119,171,195,237,128,241, 21,147, 41, 98,105,207,158, 3,150,132,135,203,222,248,224, 3,227,107, 83,166, 44, 96, 77, 38, 90, 40,
-145,112, 82, 91, 91, 1, 43,147,137,163,207,159,151,175,159, 57,211, 69,111, 52,158,218,109, 69, 5,243,178,136, 86, 72, 72, 47,
-188,246,198, 92,232, 43, 68,180,162,174,198,195,104,134, 85, 17, 45,163,209, 24,164, 86,171, 33,151,203, 83, 0,120, 76,154, 52,
- 9, 28,199, 65,175,215,163,168,168, 8, 42,149,170,112,202,148, 41,108,169,121, 18,141, 26, 53,202,193, 18,221,230,205,155,123,
-137,197, 98,156, 58,117, 10, 98,177,248, 4, 0,136,197,226, 19,225,225,225, 67, 94,126,249,101,120,123,123, 55, 79, 76, 76,164,
- 80, 75,253, 52,247,160,225, 7, 8,208, 10, 20, 90,150,132,224,208, 82, 25, 52,252, 54, 5,220, 47,237, 53,254, 94,199,142, 29,
- 1, 11,235,101, 85,164,180,113,199, 58,154,166, 15, 46, 92,184,112, 86,215,174, 93, 95, 92,186,116, 41,133,210,174, 26,234, 73,
-124,122,122,122,239,197,139, 23,159, 38,132, 84, 50,253, 89, 57,121,191,119, 11,157, 77, 10, 10, 10,111,102,223,251,249,142, 85,
- 17, 83,134,169, 87,119, 22, 60, 60, 60, 60, 60, 13, 22,213,122,130,106,141, 22, 69, 81, 91,250,244,233, 51, 13,128,144,162,168,
- 77, 42,149,234,137,204, 95,173, 86,199,123,121,121,125,213,172, 89,179,233, 0, 8, 69, 81, 91,172, 76, 84, 38, 33, 88, 37, 16,
- 80, 11, 75,204, 93,157, 58,168, 44, 27,150,100, 33, 0, 74, 32, 16,238,184,113,227,198, 7, 41, 41, 41,217, 22, 70, 32,106,164,
- 33, 90, 29, 2,192, 94,224,209,248,228,228,211,243,218,182,237, 63,104,230, 76,180, 31, 52,200,193,171, 73, 19, 86,111, 54,115,
-119, 34, 35,169, 75,135, 14, 73,110,134,135,139,245, 70,227,169,163, 64,138,181,233, 76, 79, 79, 63,255,251,217,243,103,198,140,
- 26,242, 98,243,102, 94, 37,166,225,145, 10, 57,121,133,103,172, 49, 89,143,153,222,225, 27, 54,108,248, 89, 34,145,136, 42, 14,
-101, 99, 54,155,243,140, 70, 99, 16, 0,228,231,231,123,109,217,178,101,159, 64, 32, 72,174, 77, 47, 38, 38,230,248,146, 37, 75,
- 70, 37, 37, 37,157, 73, 77, 77, 77, 2,128,148,148,148, 36,154,166,119,168,213,234, 81,201,201,201,135, 97, 65, 35, 0, 2,180,
-138,142, 60,216, 14, 0,130,122,142, 69,116,228, 65, 57,128,118, 65, 61,199, 2, 0,234, 58,150, 97, 69, 74,187, 65,248, 40, 42,
- 42,106,207,139, 47,190,248, 38,234,209,167,215,227,102,203,108, 54, 55,121,124, 97, 89,100,203, 26, 33,147,201, 68,235,245,122,
-134,101, 89,145,217,108, 38, 38,147,137,230,243, 57,158, 90,224,199,190,228,121,106, 33,132,116, 6,160, 44,203, 54, 75,231,202,
-199, 62,155, 80, 58, 92, 96, 89, 86, 89,250, 61,155,162,168,171, 21, 52,202,151, 91,176, 45, 0,228, 0,184, 77, 81, 84,117, 65,
-144, 45,213,125,175,214,104,169, 84,170,195,176, 96,208,104, 75,215,171,129,197,165,227,196, 1,117, 31,135,173, 92,131,101,217,
-204,148,148,148,122, 95, 80,129, 64,240,104,216,176, 97, 86,173, 95,219, 58,251,129,228,183,141,198,157, 97,223,126,219,225,212,
-166, 77,222, 44,195,184, 82, 0, 17, 74,165,185, 38,147, 41, 73, 73,211,183,172,141,100, 85,138,198, 60, 76, 31,152,248, 48, 29,
- 45, 91,182, 36, 15, 30, 60,104,136, 76,245,150, 86,171,245,169,237, 22,208,233,116,189, 44, 52,131,123,211,211,211,247, 86, 97,
-216,247,169,213,234,125, 86, 60, 41,238,151,154, 42, 1, 71,113, 99,130,122,142, 61, 4,128, 43, 27, 84,186, 33,201,200,200,136,
- 67,105, 63,111,255, 53,146,147,147,141, 20, 69,237, 90,181,106,213,196,155, 55,111,238, 87,169, 84, 70, 62, 43,230,225,225,121,
-150, 77, 22, 69, 81, 97,165,223, 67, 75,131, 66, 97,143,127, 46, 91,167,108,189,138,235,148,105, 60,190,188,166,109, 1, 96,209,
-162, 69, 31,172, 88,177, 66, 1,192,210,193,152,235, 60,168,244,223, 69,230,127, 68,163,162, 41,216,250,119, 28,232,183,128, 9,
- 12,115, 25, 76,133, 58,249,116,195, 6, 34, 30, 60,120,240, 76,191,181,150, 13, 42, 93,129,182,255,175,153, 79, 82, 82,210, 6,
- 95, 95,223,205, 42,149,138, 1, 15,143, 5,207, 43,254, 20,240, 60,165, 40,171, 50, 70,213,152,178,208,154,126,175,244,226, 94,
-197,122, 85,125,167, 40, 42,108,197,138, 21,161, 86,164,183, 60,162, 37,224,175, 29, 15,207,211,205,191,209,146,150,135,135,135,
-231,153,120,243,120, 44,138, 85,102,190, 30,255,190,104,209,162, 15, 80,115,137,147, 39, 74,162, 88,158,165,223,203,235,107, 81,
- 40,105, 57, 80, 21,214,180, 38,232, 95,135,227,139,224, 53,121, 77, 94,147,215,228, 53,121, 77, 94,243,255, 78,179, 54,237,136,
- 42, 12,209,208,234,138,250,106, 42, 70,124,252,115,109,219,214,182, 46, 69, 81,213,117,243, 83, 86, 84,248,248,252,111,167, 63,
-175,201,107,242,154,188, 38,175,201,107,242,154,188,102,125, 32,132,116, 38,132, 12, 69, 73,241, 55, 33,132, 12, 37,132, 12, 90,
-180,104,209,226,178,101,139, 22, 45, 90, 76, 8,121,161,108,189,210,117,202,183, 41, 91,246,248,252,241,101, 53,173, 91, 67, 18,
-167, 61,246,185,252,251,127,165,142, 22, 15, 15, 15, 15, 15, 15, 15, 79,149,148,181, 24,172, 16,109,202, 6,112,103,197,138, 21,
-249, 21,234, 78,101, 3,184, 5, 32,184,116,189,236, 82,147, 86,177,110,149,169,244,187,169,138,117, 76,150,172, 91, 13, 91,170,
-249,204, 27,173,234, 8,246, 16,124,234,219,216,189, 83,233, 5, 0, 41, 29, 4,152, 43,237,175,136,148,117, 92,196,113, 32,132,
- 64,149, 85,112,253, 78, 22, 62,174,235,254,252,189,224,226, 46,151,175,227, 8,233, 89,186,232,124, 97,174,113,110,180, 6, 5,
-150,106,180,110,132, 64,185, 0, 11, 56,130,246, 0, 32,160,112,219,192,225,171,216, 76,235,251,147,170,234, 62, 15, 82, 98,154,
-212, 70, 49,222,209,201,185,101,126,126,206,125,179,193,120, 48, 38, 27,155, 81,135, 10,182,205,157,241, 60, 71,240, 1, 0,129,
- 88,128,213,247,243, 44,110,201,193,195,195,195, 83,223,232, 72,189,250,197,163, 40,138,173, 66,147,170,167, 38,223, 80,193, 2,
-179, 85,197,226, 63,171, 88,118,245,191,148,110,171,140, 86, 27, 37,102,130,194, 50, 0, 4, 4,159,196,100, 99,163, 85,219,123,
-162,191, 92, 40,220, 6, 64,104, 48,179,243, 8,135, 11, 85,158, 76, 1,122,203, 37,194,213, 0, 56, 3,203,190, 30,163,182,188,
-190, 88,144, 55, 6,137, 56,193, 46,142, 16, 49,203,145, 29, 32, 8,179,147,224,143,203,233, 48, 88,147, 86,223,198,238,157,142,
-253,169,126,241,236,198, 57,232,218,190, 5, 8,203, 0, 28, 13, 69,175, 5,248,109,237, 36,116, 13,244, 5,225,104,128, 99, 96,
- 55,248,107, 12,110,235, 72,238,100,213,109, 28,108,127, 47,184, 52,113,115,191,187,117,235, 54, 15,175,230,109, 40,142, 49, 35,
-238,207, 51, 19,222, 93,184,164, 95, 16, 10,219, 90, 98,182,218,123,226, 13,223,166, 1, 11,230, 46, 91, 35,244,244,242,177,229,
-104, 35,147,241,232, 94,199,111,190, 92,114, 88, 34, 72, 94,125, 91,141,109,150,222,203,109,148,152, 46,146, 73,199,218,200,109,
- 91,234,116, 69, 15, 88, 51,125, 80, 32, 22, 13,250,234,235,117, 29, 66, 6, 12,177, 99,139, 50, 4, 52,135, 54, 7,246,239,107,
-242,237,134,239,135,220, 85,179, 47, 1,224,172, 57,102,142, 96, 97,252,206,105, 67,196, 34, 33, 21, 56,117,171, 16, 96,234,100,
-180, 2,221,241, 10, 69, 80,107,247, 18,132,194,197,123, 89,216, 91,151,125,180,118,199, 15, 20,129, 63, 40, 28,162, 8,246,197,
-100, 35,139,207,242,120,120,158, 45, 4, 2,193, 89,142,227,250, 54,176, 49,120,158, 16,114,153, 63,187,255,223, 88, 23,209,162,
-240, 89,116, 66,170, 51, 88, 51,130,252,155,127, 10, 88,103,180,228, 66,225,142,171,247, 51, 61,192,152,177,245,243, 89,251, 77,
- 52,192,208,102,176, 12, 13,150,161,193, 48,102,176, 52, 13, 66, 27,177,228,199,179,128,169, 8,157,218,182,218, 1,176,158,150,
-238, 67, 76, 4,187,174, 71,158,113,161, 76,133,216,187,113,197,219,169,217,197,111, 71,220, 86,229,180,113,215, 47,142,201,194,
- 79,214, 24,130,179,155,230, 96,247,209, 19,105,235,127,208,198,114,132,192,197,193, 38, 96, 66,104,180,207,206,227,103, 83,215,
-237, 48,196, 2,128,163,173, 52, 96,242,237,251,190,245,185, 8,238,114,249,186,205,223,127,235,225,233,106, 67, 49,151, 86,130,
- 97, 89,248, 52, 25, 42, 92, 60,123,130,231,103,107,183,173,133,198,248, 90, 77,219, 7,184,163, 77,211,102,129,243,118,156,184,
-228,171,213,100,153,206,236,249, 32, 1, 70,208, 30,222,129,226, 79, 87,172, 17,126,248,254,156,247, 76,108,218,149,184, 44,196,
-212,150,215, 4,186,227,248,138,149, 95,183,239, 55, 56,212,142, 43,206, 22, 26,180,197,254, 91,127,220,182,172,117,251, 46,138,
- 94,109, 27, 75,178, 14,206,160,244, 69,121, 48, 11,228,178,126, 65,253, 29,244, 19, 95,166,183,110,223, 61, 59, 38, 11,223, 88,
-115,204, 44,249,235,222,227,184,186,247,186, 78, 17,244,186,121,249,236,116, 86,117, 21,132,165, 1,214, 92, 62, 7, 75,131,112,
- 37,243,174, 51,126, 4, 80, 55,163, 37, 32,120, 49, 34,242,170,103,102,134,186,243,218,175,191, 88, 76,174, 94,253, 21, 44,118,
-221,203,195,121,107, 13, 38, 0,127, 63, 87,225,105,154,133, 49,181,128,245, 47, 91,216,207, 95,214,221,211,142,122, 33,165,144,
-186,112, 49, 65,127,158,207,154,120,120,254,149,136, 9, 67, 8, 17, 53,176,230, 16, 66,200,201,122,202, 44, 0,240, 70,233,231,
-109, 0,190,106,128,164, 53, 6,224, 81,250, 57, 3, 64, 26,127, 7,212,139,199, 43,191,215,185, 31, 45, 57, 8, 7, 28, 26, 1,
- 0, 54,214,166,130, 0,114, 80, 66,128,214, 98,248,224, 1,112,115,247, 0,104, 29, 96,214, 1,180, 30,160,181, 0,173, 71,142,
- 58, 25, 48,107,129,196, 95,193, 16, 34,179,250,112,141,133, 64,252, 65,188,208,209, 23, 74, 71, 57,230, 12,111,227,182,229, 84,
-252,182,109,103,226,250,199,100, 97,188, 69,105, 37, 4, 93,219,181,196,250,109,218,216, 95,110,100, 15, 4,128, 33,193,174,167,
-186,182,105,226,179,110,135, 33,246,228,157,252, 65, 0, 48, 40,200,225,215, 46, 1,158,190, 92, 61,186,167,225, 8,233,229,213,
-180, 37,197,222,220, 12, 78,147, 6,141, 70,143,180, 71, 59,225,236,253,156,128,229,208,167,182,237,109,132, 88,244,206,135,171,
-196, 58, 77,166,137, 51,103,179, 74, 97,190, 80, 36,229, 40,164,159, 55, 22,115, 5,236,220,105,147,152,121, 31,127,190, 8,192,
-132,154,116,218,184, 99,246,234,213,235,218,245,232,212,218, 61,227,240, 28,170, 56, 63, 19,140, 80, 33, 27,222,173, 7,156, 90,
-181,225, 50,207,173,166,164,205,251,195,201,181, 57,210, 47,237, 65,210,229, 35, 84,207,142,163,100, 63,237,149, 76, 4,204, 85,
- 26,173,150,110,232, 57,176,119,151,253,205,125,189, 60, 9,225,192,113, 4,132, 99, 81,108,160,177,248, 64, 34, 88,150,197,232,
-129, 61, 95,176,149, 82,132,227, 56, 16,194, 33, 53, 35, 87,247,251,149,216, 23, 18,243,113,197,146, 72, 85,240,243,125,123,222,
-190,126,185, 53, 29,255, 11, 58, 77, 88, 17, 75, 1,145, 21,238,185,158, 55, 78,255,212, 26,248,177,238, 94,142, 2,155,116,106,
- 37,124,123, 79, 19,110,222,123, 74, 89,152,157, 62,249,240,206,239,199,108,220,188,121,119,108, 22,102, 88, 99,178,222,237, 45,
-141, 92,251,187,198,181, 91,115,219,236,212, 10,113, 74, 63,103,193,192, 77, 39, 99,222,137, 90,222,181,245,135, 39, 72,193,133,
- 4,195, 29, 62,223,226,225,249,103, 33,132, 52,184,217, 74, 78, 78, 86,213,199,108,121,123,123,247, 78, 79, 79,255,178,172,182,
- 10, 69, 81, 95, 54,109,218,116,201, 95, 47,170,149,222,245, 10, 89,150,157,144,158,158,126,161, 38,205,161, 67,135,122,157, 56,
-113,162, 89, 5,205,102, 0,154, 85,181,174,147,147, 19,219,189,123,247,164, 19, 39, 78,168,248, 59,164, 78,134,203,106,163, 21,
-155,114,112, 78, 71,163,186, 24, 0, 98, 45, 88,191, 82,145,159,129,102, 87,110, 95, 54,105,101, 80, 83, 23, 20,105, 77, 56,115,
- 45, 9, 44, 75,131,101,152,210,200, 22, 3,150,161, 49, 48,216, 13,221, 13, 51,240, 77, 88, 28, 24,150, 91, 81,147,230,227,152,
- 9,247, 74,135,254,227, 14,112, 28,145,202,196,130, 66,127, 31, 87,247,121,163,131, 5,115,134, 7, 65,111,102,198,237, 57,151,
-240,251,189, 44,108,181, 72,147,123,178,123, 34, 82,213, 50,150,169,245,216,107,136, 70,117,237, 31,210,203,129, 24, 11, 65,231,
- 36,162, 72, 71, 35, 49,151, 70,134,161, 0, 50, 74,109,145, 38, 71,208,190,177,183,167,226,143,253,239, 63,114, 21,106, 68,238,
- 66, 70, 34, 21, 48, 96, 57, 34, 36, 5, 49, 70,151,214, 3,196,101,245,182,106, 74,167,141,194,126, 82,239, 23,135, 58,166,236,
-153, 70,217,248, 15,132,123, 71, 31, 60,186,176, 29, 89,215,194,144,171, 74,162, 28, 12, 5,104,228,218, 2,131, 39,140,199, 87,
-227, 59,163, 72, 83, 4,161, 58,193, 81, 42,150, 57, 1,230, 42, 53, 9,139, 9,171, 87,125,238, 41, 18, 10, 74,206,103,217,196,
-210,208, 27,141, 0,203, 64, 46,226, 64,145,178,223,104,176,180, 89,209,126,212,251,179, 0,246, 74,109,199,126, 47, 11,123,219,
- 40,209, 11, 28,221,154,208,122, 80, 64,100, 76,246, 95,230, 39,208, 29,175, 60, 55,112, 74, 47, 66,225, 98, 93,174, 81, 91, 87,
-132,118,106,102,103,107,171,137, 69,218,161,183,145, 0, 57,105,212,227, 13,188, 50,117,182, 98,203,150, 45,195, 0, 50, 19,149,
-235,168,149,107,182,110, 36,156, 78,179, 88, 2, 0,122,154,108,183,151, 82, 83, 87,239,139,114,133,240,175, 17, 30,202, 34, 89,
- 9,185, 92,190,249,236, 71,113,207,207, 11, 11,105,119, 51, 36,149,162,100, 41,231, 31, 24, 11,173,185,151,172,132,215,228, 53,
-255,118, 77, 7, 7, 7,191,166, 77,155, 46,161,105,186,183, 68, 34,105,100, 54,155,193,113, 92,134, 84, 42,189,152,148,148,180,
- 92,163,209, 60,252,175, 29,251,237,219,183,173, 49, 91,181,106,138,197, 98,196,197,197, 61,176,194,108, 69, 60,182,253,174,200,
-200, 72, 28, 56,112, 0, 0, 16, 31, 31,143, 86,173, 90,217, 86,181,225,163, 71,143,108, 67, 66, 66,118, 1,240,169, 73,243,206,
-157, 59,126,191,252,242, 11, 14, 29, 58, 4, 0,136,139,139,131,191,191,127,149,137,137,140,140, 20,190,250,234,171,126, 0, 84,
-255,192, 53,122, 22, 76, 86,197,249, 95, 70, 43, 44, 44,140,132,134,134, 82,143,127,174,130, 68, 95,103,105, 71, 24, 88, 0, 72,
-180, 54, 5,247, 50,177,106,253,206,211,131,126, 59,180,161,183, 92, 34,192,210,173,243, 82,179,243,138,158, 23, 81, 37,197, 47,
- 12,129,192,217, 78, 26,181, 98,114,176,111,126,177, 1, 63,255,153,126, 33, 38,203,186, 16,105,140, 26,225, 0,231, 84,242,141,
-133, 65,159,229, 63,249,171,240,125,251, 22, 13,106, 63,119,120,123, 28,191,148, 52, 23, 96,106,237,245,157,112, 28, 8,199,148,
- 87,126, 47,125,117, 0,184,202, 3,248,114, 32, 37,203, 56,235, 34, 90,125, 0, 81,190, 59, 6,219, 43,164,223, 77,159,254,166,
- 3,157,125, 31,121, 38, 9, 82,243, 13,200,208,139, 81, 44,114, 71,122,236, 29, 86, 64, 33,188,214,144, 11, 5, 13, 97, 12, 78,
-206, 82, 59, 65,219, 1,179,188, 53,167, 62,200,151, 82,140,208, 97,228,103, 78, 57,191,173, 73, 98,180,217, 90,138, 66,173,221,
-207, 59, 58, 58,181, 50,228, 38, 9, 11,243,115,224,228, 17,132, 65,227, 66,241,201,208, 54, 40,210,104,145,157, 23, 69, 90,122,
- 58, 80,201, 23,119,227,195,193,129,200,205, 84,195, 72, 3,148,214,152,103, 48, 25,138,171, 61,143, 2,108,126,119,254,194, 87,
-154,120, 42,109,203, 26, 21, 16,142, 69,112, 96,115, 12,232,221, 21,225,145,127,224,234,157,120,112,165,141, 10, 8,199, 33, 45,
- 43, 63,211, 96,102,183, 91,117, 66, 89, 6,132, 54, 84,105,196, 80,135, 34,195,182,238, 80,176,192,199,157,253,236, 95, 95, 20,
-218,196,222, 86, 70,193, 64,179, 48,152,104, 20,253,241, 29, 92,155,182,131, 66, 46,167, 58, 66, 47,186,129,170,207,173,129,198,
-146,135,234, 2, 79, 20,103,224,213, 1, 65,239,236, 88,241,150, 45, 37, 47,185, 53,105,182,114, 36,235,143,101,157, 79,191,250,
-233,177,179, 7, 14,190,236,245,213,130, 73, 33, 3,223,219,126, 22,192, 41, 62,223,226,121, 26, 25, 51,102,140, 60, 51, 51,243,
-156,143,143, 79,155, 1, 3, 6, 40,122,245,234, 5,173, 86,139, 51,103,206, 64,171,213, 54,241,241,241,105,114,230,204,153, 81,
- 41, 41, 41, 49,141, 27, 55, 14, 57,116,232,144,197,117,104, 75, 13,144,176, 60, 11, 6, 24,138,162, 80,186,140, 42, 93, 86,231,
-113,110,165, 82, 41,146,147,147, 27, 60,178,149,158,158,254,160, 46,145,173,226,226, 98,137,183,183, 55,148, 74, 37, 88,150,133,
- 86,171,197,177, 99,199, 80, 88, 88, 8,142,227, 96, 99, 99,131,207, 86,111, 69,236,141,115,184,114,229, 10, 10, 11, 11, 37,181,
-105,166,165,165, 81,193,193,193, 48, 26,141, 96, 24, 6, 6,131, 1, 17, 17, 17,229,223, 69, 34, 17, 22,126,186, 22,241,215,206,
-225,230,205,155, 72, 75, 75,251, 71, 70, 27,177,194,139,252, 23,169,182,207,172,127,188,213, 33,203, 50,139,183,236,216, 23,181,
-120,198,120,204,126,185,191,207,242, 13, 71,250,223,203,193, 14, 0, 8,116,195,228,137,125, 91,250, 58, 41,196,248,100,207, 53,
-128,144,197,245,221, 95,116, 30,226,219, 52,226,230, 30,189,146,124,238,131,241, 29,209,220,211,161, 85,190, 52, 79,154,152,104,
-193,152,130, 28, 3,103, 59, 89,192,144, 96,215, 83,224, 56, 56,217,203, 90,131,101,224,100, 39, 11, 24, 20,228,240, 43, 0, 56,
- 40,196,173,171,138,124, 85, 71, 39, 31,241, 52,133, 76, 52,205,214,222,201,247,181, 97, 3,108,134, 12, 27,101, 99, 39,102,144,
-123,229, 12, 52,226,198,160, 93,154,192, 72,231, 33,237, 97, 2,251,219,229,123,233, 57, 69,198,121,181, 38,147,224, 66,250,195,
- 56,165, 95,251, 1,206, 57, 97, 31,102,249, 77,217,211, 76, 0, 78, 80,180,123,100,166,173,123, 23,155, 63, 19, 31, 22,115,164,
-202,136, 78, 37, 52,133,133, 73, 52, 11, 79, 61, 43,178, 79, 56,251, 19, 22, 13,110,135,252,188, 44, 24,204, 12, 10,245,140,217,
-195, 73, 46, 51, 62,188, 11,163,153,129,137,230, 32,118,242,198,153,168, 59, 57, 28, 77,255, 90,157,102, 98, 46,110, 38, 30,187,
-105, 87,113, 89,115, 55, 4,191,239, 96,115, 19,180, 30,201,105, 42,236, 56, 17,213, 49, 49, 23, 55,235,115,157, 9,199,148, 20,
- 63, 87,136,100, 81, 4,189,234, 82, 9,190,181, 59,186, 72,228,146,111,191,156,251,106,155,110,254, 46, 50, 46, 45, 10, 20,103,
-134, 45, 43,130, 94,202,194,209,167, 57, 56, 83, 17,209, 25, 12, 5,209, 64, 77, 23, 95, 8, 0,196,172,197, 87,147,130,108, 41,
-231,230, 96, 19, 79, 65,212, 97, 26,232,210,104,127, 66, 46,119,199,124,246,163,216,238,243,127,233,243,105,120,223,123,170, 19,
- 75,239,121,143,249, 46, 24,216,222,148,127, 92,243, 60,141, 4, 4, 4,120,164,167,167, 71,207,159, 63,223,101,228,200,145, 56,
-122,244, 40, 52, 26, 13,182,111,223,142,117,235,214, 97,217,178,101,160,105, 26, 91,182,108, 81, 28, 62,124,184,203,247,223,127,
-159,230,235,235, 27,148,146,146,146, 81,139,193,162, 0,200, 0,136, 75,159, 93, 20, 0,238,228,201,147, 24, 50,100, 8, 78,158,
- 60,201,149, 46, 99, 81,242,242, 83,167,177, 63,165, 82, 41,164, 82, 41, 10, 11, 11, 27,196,108,137,197, 98,216,217,217, 65, 42,
-149,162,168,168,200,106,179,197, 48,140, 48, 45, 45, 13,133,133,133, 24, 48,108, 24,214,174, 88,129,190,125,251, 98,192,128, 1,
- 32,132, 32, 34, 34, 2,253,123,180,197,248,151, 66,112,239,222, 61, 48, 12, 99, 81,122, 51, 50, 50,144,153,153,137, 65,195,134,
- 97,235,247,223,163,107,215,174, 8, 8, 8, 0,195, 48, 56,119,238, 28,198, 12,236, 1,249,136,254,136,143,143,231,111,106,203,
-163, 89, 13, 82, 71,171,222, 68,103,227, 50,119,252,124,216,203, 3,187,132, 14,235,217, 6, 91,247,255,246, 57,148,154,125, 0,
-224,106,148,125, 54,169,111,115,196,164,228,227,183,155,170,176,123, 57,104,144,214, 26, 28, 11, 55, 87, 7, 5, 32,148, 66,111,
-230, 24,135,196,218, 43, 48,115,132, 64,209,251,125, 76, 28, 22,227,211,181,141,143, 79, 89,171, 67,187, 33,107, 48,249,206, 3,
-223,206, 1, 30,190, 96,105,128,165,225, 48,126, 15,240,169,109,173,233,232,209, 76, 26,254,238,156, 57,221, 7,143, 24,103, 35,
- 85, 56,130,213,164,130,206,184,131,220,251, 23,160, 85,180, 66, 70,114, 34, 14,156,190, 82,120, 63, 45, 87, 35, 16,224, 76,102,
-161,113, 65, 98, 62,138,107,211, 53,208, 88,177,228,195,121, 67, 15,236,219,111, 47,107,222,147, 74,248,110, 72,161, 84,196,200,
-148,205,158, 19,232,228,110,228,139,237,251, 29,180, 38,172,172, 77, 71,167,213, 28,137, 56,115,106,124, 75,191,158,246,143,174,
-158,128,222, 96,132,145, 6,130,186,132,128,101,137,148, 18, 80,156,131, 80, 72,101,229,230,131,162,217,204,139,183, 30,169, 35,
-111, 37, 10,141,246, 88, 89, 99,239, 34,143,187,123, 74,248,206,176,144, 14, 0,173,199, 75,189,219, 97,237,238,223,222, 6,216,
- 41,245,187,200, 37, 17, 45, 2,244,108,163,196, 38, 66,208,243,218,177,117,173, 59,141,120, 23,214, 68,180,130,220, 48, 56,208,
-207,235,167,181,159,189,239,226,218,184,149,144,226,104, 16,143,246,128, 38,141, 80,105, 81,112,244,238, 10,214,171, 7,182,124,
-243,117, 49,199,145,125,168,161,107, 11,150, 3,184,148,243, 96, 99,143, 34, 49, 49, 17,110, 77,174, 1,148, 0,164,233, 35,152,
-153,146,205,140,102,114, 98,253,246, 95,250, 46,232,183, 34,104, 88,107,145,111,212,173,132,172,113, 83,189, 20,207,251, 10,253,
- 99,212,182,130, 28,173,150,227,243, 47,158,167, 9,131,193,112,100,213,170, 85, 46,161,161,161,101, 17, 25, 68, 69, 69, 97,219,
-182,109,176,181,173,156, 79, 14, 25, 50, 4,132, 16,151,165, 75,151, 30, 1,208,173, 58,205,238,221,187, 15,187,121,243,166,170,
- 67,135, 14,137,165,102, 75, 2, 64,112,247,238, 93, 65,106,106, 42,229,236,236, 76,188,188,188,104,149, 74,197, 1, 96,167, 78,
-157, 42, 60,120,240, 96, 75,173, 86,123,190,174, 70, 75, 42,149, 54, 72,157, 45,177, 88, 12,138,162, 32,149, 74, 33,145, 72, 64,
- 8,177,202,108,177, 44, 43, 58,121,242, 36,174, 93,187,134,101, 29, 58, 96,174,183, 55, 92, 92, 92,112,238,220, 57, 16, 66, 96,
-107,107,139,188,188, 60,236,219,183, 15,253,250,245, 3,195, 48, 18, 75,116, 15, 29, 58,132,235,215,175,227,211, 78,157, 48,215,
-209, 17,118,118,118,136,136, 40, 41, 13,148,201,100, 72, 78, 78, 70, 68, 68, 4, 66, 66, 66,248,155,186,158, 88,124,243,244, 1,
- 68,121, 20, 60,204, 38, 61, 8, 67, 0, 10, 94,129,129,144,220,187, 87,185,114,142, 37, 8, 4,248,240,155, 29, 97, 67,215,188,
- 59,140,154, 54,188,163,215,242,159,206,206, 4,128,215, 71,251,123, 43,100, 34,172, 63, 30, 67, 4, 2,124,216, 16, 7, 24, 24,
- 8, 9,149,139,153, 3,186, 6, 64, 85, 96, 66,130,170,224,247,123,128, 69,163, 56,255,182,102, 34,118,254,124, 46,117,221, 78,
- 67, 44, 33, 4, 78,118,178,128,201,183, 19,124,127, 58,121, 61,101,245, 1, 67, 44,225, 8,156, 20,226,214, 83,238,245,168,181,
-213, 97, 39, 31,241,180,247,230,205,235, 49,124,202,124, 57, 19,123, 16,166,132,211,224,204,122,104,204, 18, 20, 8, 61,144,150,
-146,130, 47,182,132,165,106,180,166,241,209,217,214, 25,204,251,185, 40, 22, 81,154,145, 95,124,242, 65,248,138,207,150,218,233,
- 19,207, 21, 11, 41, 70, 47,108,218, 71,244,217,178, 53, 84,145,209, 52, 46, 49, 31, 69,181,233, 24,237,177,114,213,234,111,134,
-190, 57, 97, 84,172,127,171, 62,174,172,234,161,171, 65,163,201,218,115,234,186, 71,233,155, 34, 5, 0, 9,105,185,200, 46,212,
- 50, 44, 67,159,183, 23, 99, 63,250, 14, 83, 0, 0, 32, 0, 73, 68, 65, 84,121,140, 37,209,193, 82,252,220,161, 12,237, 25,244,
-170,210, 94, 2,125,113, 1,220,237,197, 24,216,181,197,171,244,159,241,239, 63,204,178,198,174, 61,110,180,104, 16, 90,143,203,
- 43,251,181, 38, 44,221, 26, 44, 13,243,237, 93,214, 71,198, 40,204,157,221,219,206,193,217,244, 72, 0,173, 45, 96,227, 6,202,
-161, 9,224,216,140, 18, 7,142,131, 42, 49,154,121,251,213, 9,185, 15,147,210,126,112,179,169,185, 88,155,230, 8,184,164,115,
- 40,206, 76,192, 93,149, 25, 65, 89, 37,165,237, 14,153, 55,192,242, 61,230,240, 60,163, 36, 39, 39, 79, 90,188,120,113,100,215,
-174, 93, 27,185,185,185,161, 93,187,118,248,249,231,159, 49,127,254,252,242,117, 58,116,232, 0, 66, 8,242,242,242,176,106,213,
-170, 12,149, 74, 53,169,198, 23,244,232,232,216,157, 59,119,246,110,211,166,141, 89, 34,145, 20, 0,144, 21, 20, 20,200,243,242,
-242, 40,131,193, 0,142,227, 56, 71, 71, 71, 86,165, 82,209,227,199,143, 55, 94,186,116,169,133, 86,171, 77,174, 79, 68,203,199,
-199,231,110,110,110,110, 33, 69, 81,245,238,250,161,204,100,185,185,185, 41,139,139,139, 57, 0,249,117,233,250,129, 97, 24,116,
-234,212, 9,167, 47,220,192,201,223, 46, 65,163,138,195,204, 55, 39,161, 93,187,118, 56,125,250,116,157,175, 89,112,112, 48, 78,
- 69, 68, 34,242,218, 45, 36,199,223,198,219, 51,223, 68, 80, 80, 16, 78,157,226,107, 47, 88,193, 9, 84,174,155,117,226,113,163,
- 21, 18, 22, 22, 86,150,245, 63, 97, 95, 91,187, 33, 88,236, 36,221,181,116,112,139, 64,241,128,165,160,196, 54, 56,216,234, 84,
-143, 15,191,248, 46, 86,232,158, 60,225,110, 86,237,173,195, 42,253,105,178, 16, 77,174,196,238,189,117,175,245,171, 47,117,245,
-193,214,159, 21, 31, 3,192,184, 94,126,248,243,126, 54,174,196,103,237,141,201, 70,116,125,143,186,173, 59, 20,108, 14,246,174,
-122,103,120, 72,147,198, 30,216,118, 52, 18, 20,133, 35, 22, 61,112, 9, 33, 93,219, 52,193,186,157,143,183, 48,244,240, 93,125,
-192, 16,123, 38,186,104, 48, 0, 12,104,173,248,181,115, 11,103, 95, 82,177,226, 86, 21,216, 72, 69,211, 7,143,154, 40,103,226,
-127, 6,146, 34, 64, 49, 70,232,205, 28,212, 57, 69,208, 57,250,224, 92,212, 45,125,161,193,244,110, 76,118,221,162,120,247,114,
-144, 40,185,122, 43,165, 88,171,247, 84, 40, 91, 24,132, 2,142, 43, 54, 18,252, 25,147,164,137,201, 64,156, 37, 26,137,137, 48,
- 61,239,205,244,218,180,227,192, 18,177, 68, 58, 78, 72,129,114,119,178, 85,110, 90,243, 41,236,237,237,192,153,138, 1,109, 54,
- 70,190,245, 69,246, 93, 21,237, 7, 0,173, 92, 97,215,203, 79,188, 67, 36,160,210,206, 38,152, 63,170,109, 31, 20,141, 25, 19,
- 6,118, 16,115, 38, 45,222, 89,181, 31,155,223, 31,142,137, 47, 4,138, 79,252, 17, 63, 3,192,242,186, 94,107,194, 50, 32,180,
- 30,221, 62,184, 16, 75, 1,145, 4,232,121,237,192,103,173,129, 27, 22,107,116, 4,196,172,136, 10,108,239,107, 43,225,210,254,
- 0,151,246, 7, 17,250,244, 0,229,219,155,162, 60, 58,145,111,191, 92,166,221,186,117,219, 25, 78,128, 79, 44,232, 42, 3, 44,
- 7,228,196, 71,194,100, 50,129,102, 1,131,193, 0,173, 86, 11,219,132, 83,229,117,180, 36, 98,106,208,156,215,134, 5,147, 98,
-149,238,151, 88, 38,101,219,155,173,187,145, 98,149,238,114, 10, 27,159,163, 53,242,209, 44,158,167,145, 68,149, 74, 53,104,200,
-144, 33,191,157, 62,125,218,165,109,219,182, 0,128,107,215,174,149,188,116,118,234, 4,127,127,127,100,102,102,226,229,151, 95,
-206, 81,171,213,131, 80, 75,157,223,162,162,162,135,135, 14, 29,106,164,213,106, 59,124,244,209, 71, 89, 77,154, 52,209, 24, 12,
- 6,170,160,160,128, 99, 24, 6,206,206,206,210, 14, 29, 58,160,123,247,238,197, 81, 81, 81, 77, 83, 83, 83,139, 0, 36,213, 37,
-241,195,135, 15,199,133, 11, 37,141,246, 26,162, 95, 45,137, 68,130,182,109,219,122, 39, 38, 38,166,151, 62, 91,172,206,227, 43,
- 62, 94,110,221,186,133,243, 55,210, 32, 50,233, 33,205, 86,225,242,209, 67, 24, 54,125, 22, 24,166,238, 99,203,223,186,117, 11,
-199, 34, 46,195, 86, 38, 66, 92, 92, 52, 14, 29, 58,132,153, 51,103,214, 75,179,142,212,232, 69,254,227,168, 81, 77, 61, 45, 17,
- 0,132,134,134,158, 47,139, 86, 84,164,121,115, 72,101,197, 88, 58,160,163,247,194,113, 61, 91, 8,105,141, 10, 28,203, 65, 40,
- 6,220,221, 28,176,107,215, 94,191,189,251,247, 71,125,191,225,251,111, 56,134,249,240,110, 22,116, 86, 36,106,233,154,253,145,
-227,118,205, 11, 17,205, 28,220,218, 5, 0, 36, 34, 1,214,255, 28,205, 0, 88, 90,159,163,125,222, 27,242, 98, 26,211,220, 93,
- 29, 63, 94,252,198, 80,151,144, 78,254, 56,127,229, 46,190, 57, 20,117, 65,154,133,157, 22,223,220, 28,141,199,253, 83, 85,173,
- 14,193,213, 94,239,146,101,137,135,196,214, 25,230,164,179,128,217, 0,131,209,140,212, 92, 22,169,121, 6,136, 20, 18, 92,139,
- 79,211,187,102, 32,172, 30,135, 77,217, 42,228, 94, 75, 62, 95,221,216,160, 47,102, 52,249, 57,140, 68,122, 89,172,176,145,169,
-173,169,170,112, 57, 29,134,222,205,196,207, 1,156, 80, 42, 39,186, 15,222,123,205, 54, 61,230, 52, 90, 10, 84,160, 8,129, 77,
-224, 80,216,219, 8, 37, 61,155,138, 83, 0,192,214, 86, 33, 93,245,201,124,199,119,223,255,164,214, 58, 96,129,128,196,191,185,
-199,187,109,155, 56,227,194,245, 88, 92,184,147, 28,125,225, 90, 92, 80,223,118, 94,240,111,236, 52, 71,154, 95,176,242, 30,172,
-143,144,150, 92, 24, 6,160, 13,229,173, 14, 3,221,241, 74,231,113, 31, 85,215,218,176, 74,154, 1, 92, 60, 75, 64, 9,133, 0,
- 37, 40,105, 1,153,250, 7, 68, 78,205,201,222, 3,199,116,219,182,237,252,244, 94,142,229,141, 51,104, 22,172, 70,163,129,173,
-173, 45, 78,197, 51,198,137, 3, 37, 50,129, 64,128,212,248, 27,127, 85,134,119, 17,180,145,244,253,172,245, 31,203, 58,159,182,
-151, 82, 50,175,161,159, 4, 50,119,118,166,213,245, 33,193,195,243, 95,160,176,176,240,246,189,123,247, 6,182,111,223,126,251,
- 59,239,188, 99, 63, 97,194, 4,175, 55,223,124, 83, 0, 0,153,153,153,220,186,117,235, 84,223,126,251,109, 97, 78, 78,206, 20,
-154,166, 45,233,202,132,168,213,234, 75, 63,252,240, 67,246,197,139, 23,131,186,116,233, 34,123,238,185,231, 56,103,103,103,145,
- 76, 38, 99, 77, 38,147, 33, 62, 62,158, 77, 76, 76,244, 44, 40, 40,120, 0, 32, 1,117, 24,177,162, 52,122,181, 92, 40, 20, 46,
- 33,132,180,109,136, 58, 90, 10,133,194, 11,192, 3,138,162, 90, 90, 91,108,248,196, 3, 91, 36, 66,126,126, 62,116, 25,209,144,
-167,221, 71,123, 91, 1,218, 56,219,193,193,193,161, 94,166,168,176,176, 16,208,166, 35, 50,242, 22,192, 48,112,116,116,132,163,
-163,227, 63,110,180,170,243, 34, 79, 9,211,170, 88, 86,115, 29,173, 54, 74,204,180, 49, 97,221,244,161, 45, 36,205,124, 27,195,
-152,118, 13,183, 82,139,241,225,243, 93, 98,132, 50,123,195,244, 73,195, 59,141, 26,211, 20, 33,221, 59, 83,205, 60, 29,231,172,
- 92,179,241,173, 54,200,153, 31,147,133,245,150,164, 40, 38, 27, 15, 57,100,109, 59,123, 59,109, 70, 99,133, 30, 28, 71,112,246,
-142, 26,119,146,242,183,197,102,227,161, 53, 71,215,198, 19,253, 69, 16,236, 39,132,200, 29,109,109,139,218,248, 55,118,235,223,
- 45, 88, 48,168, 79, 39, 72,132, 64,228,159,183, 48,119,205,145,203, 28, 71,134,222,176,176,216,176,164,133, 97,101, 3, 85,210,
-194,144,174,212,194,144, 16, 66, 74, 90, 29,214, 28,124, 16, 10,169, 12, 93,242, 85, 15,177,107, 43,232, 19,206, 34, 41,159, 67,
-114, 86, 17, 52, 34, 15, 24,211,211, 1,194,165,156,175,185, 98,117,141,184,185,185,185,251,181,241,111,241,221,142, 67, 48,235,
- 10,241,240,220,118, 20,231,171,241,217,166,159, 91,120,123,187,246, 73, 79, 79, 63,111, 69,102,227,255, 91,216, 94,119, 16, 64,
- 40,150,225,196,247, 7,144,227,106, 3, 55,133, 4,156, 62, 27,211,223,157,224, 56,120,192, 4, 71, 0, 72,142,187,137, 38, 10,
-189, 69,186,102, 87,140, 26,215, 55,192, 9,180, 30, 59, 78,221, 52, 8,128, 65, 59,207, 68, 39,244,109,237, 36, 31,215,179,137,
-243,114, 85,193,104,228,214,173, 83,209,178,136, 86,121,132,175, 14,173, 13, 15, 1,108,107, 14, 9,251, 47,101,217,142, 25,240,
-156, 66, 34,162, 40, 82,156, 14, 98,227,134,141, 59, 14, 22, 75,105,235, 70, 98,231,128,229, 93, 87, 60, 92, 82,114,159, 96,251,
-224, 21,215,222, 8,255,248,121,101, 70, 70, 6,204,165,101,135, 15,243,184,223, 39, 13,104,195,166, 21,114,166, 51, 43, 71,142,
-161,108,148,210, 5, 95,237, 60, 71, 0,190, 55,105,158,167, 26,189, 94,127, 93,175,215,183, 91,176, 96,193, 43, 31,124,240, 65,
-111, 91, 91, 91, 63, 0,208,106,181, 15,105,154,190, 80,250,255,180,166,117, 32, 1,240, 32, 33, 33,225, 97, 66, 66, 66,163,221,
-187,119, 59, 1,144,151,254,102, 0, 80, 0, 32, 19,245,104,113, 88,102,170, 40,138, 90,210, 80,231,161,204, 84, 81, 20,213,178,
- 46,219, 11, 4, 2,150,162, 40, 80, 20, 5,153, 76,134,139, 23, 47, 98,236,208, 1,184,119,162, 0,109,157,236,208,101,202,116,
-236, 15, 15,135, 80, 40, 4, 69, 81, 16, 10,133, 86, 61, 71, 68, 34, 17, 34, 35, 35, 49,241,229, 49,144,137, 0, 71, 71, 71, 44,
- 88,176, 0,199,143, 31,135, 72,196,143,210,103, 5, 91, 42, 24, 46, 11,251,209,162,176, 60,124,251, 23, 18,176, 52,126,217,254,
- 53,194,238, 22,155,226,178,241, 97, 64, 54,214, 29, 66, 17,151,189,102,231,140,240,200,187, 95, 77, 29, 31,170,232,215,119, 0,
-250,133,244, 21, 5,117,238,243, 49, 80,201,104,245, 71, 13,125,109,176, 28, 62,221,114, 42,118,250,254,115,241, 20,204, 69, 24,
-255, 98,103,194,114,248,180,150,131,121, 66,211,209,198,110,127,100, 84,148, 51,204,197, 72,186,249,187,188,169, 95, 11,128, 53,
-227,193,131,251,248,118,199, 81,238,220,159,113,187, 76, 12,222, 73,204,135,214, 82,205,146, 39, 37, 3, 71, 91,105,192,160, 32,
-135, 95, 57, 16, 56, 41, 36,173, 9,199,194, 73, 33,110, 61,160,181,226, 87, 66, 8,177,183, 17,183, 38, 44, 93,171,166,222,196,
-108,222,241,227,182,213,175,191,254,186,109, 78, 90, 6, 84,154,187, 40,150,122,131, 86,248, 32,225,230, 5,189,206,200, 88,242,
- 16,175,246,124,230,228,228,100, 93,191,146,135,253,155, 86,128, 54, 25,145,149, 86,226, 85, 85, 57, 26, 56,184,121, 71,165,167,
-167, 91,172,105,102,184,194, 81, 19,166, 73,108,236, 97, 51,113, 84,168, 52, 33,215,136,142, 94,246, 37,153, 70,113, 54,238, 69,
- 68, 34,164,180,142,105, 98,170, 0, 77,130,189, 44, 74,167,189, 92,242,206,224,231,188,241, 48, 69,141,139,209,233, 59, 30,230,
- 65,197,198,170,119, 36,168, 10,102, 12,127,222, 23,107,143,199,188, 13,208,123,173, 57,246, 64,119,188, 66, 8,122,150, 84,134,
-215,131, 0, 61, 3,221,241,138,133, 45, 13,159,208, 20, 73,240,234,234, 95,147, 63, 58,120, 53,103,248,194, 87,123, 57,116,239,
- 62, 68, 10,198,132, 34,189,145,190, 87, 0,141, 53,154, 26, 61,183, 25,192,230,178, 31,174,167,113,187,122, 45,141,186,176,247,
- 77, 31,101,153, 87,191,144, 96,140, 2, 16, 53,181,171,205,199,146,190,159, 5, 68, 45,239,122,250,142,154,219,125, 33,161,188,
- 15,173, 90,255, 71,117,132,215,228, 53,255, 9, 77, 22,192, 46,154,166,119, 21, 20, 20, 52,164,166, 10, 79,246,235, 84,175, 99,
-175, 88, 76, 72, 8, 17,149, 70,179,106,171, 12, 95,163,102,197, 98, 66, 66,200,201,210,104, 86,109, 81,173, 74,154, 28,199,169,
- 58,117,234,228, 50,108,216, 48,176, 44,139,251,247,239, 35, 57, 53, 21,253,103,188, 13, 39, 39, 39, 92,184,125, 27,113,113,113,
- 88,178,100, 9,104,154,198,177, 99,199,210,106,211, 20,137, 68,230, 22, 45, 90, 72, 70,140, 24, 1,134, 97,144,152,152,136,244,
-244,116,204,157, 59, 23,142,142,142,184,126,253,122,185,102, 78, 78, 14, 68, 34,145,185,138,232,214,223,113, 47, 61,237, 60, 97,
-178,106, 54, 90, 0, 11,150, 70, 97,248, 82,172,191, 8,179,153, 70,235,152,108, 60,138,249, 43, 34,181, 81,120,229,246, 47,183,
-239,198, 62,188,254, 71, 63, 41,178,238,192,218, 55,137,251,185, 80,219,203,139,138, 96, 46,114, 64,226,175,120,148, 89, 84,124,
- 63, 23,106,171,223, 24, 56,150,130, 89, 7,168,175,225,210,133,243, 56,119,249, 22,174,222,137,101, 47, 93,143,223, 47,224,240,
-233,189, 92,220,175,195, 91, 8,236,134,174,197,107,119, 30,248,118,246,111,228, 11,150, 1,225,104, 56,142,223,139, 41, 49,221,
-125, 59, 55,119,242, 45,137,100,209,112,126,227,119, 96,181,188, 70,189,107,169,244, 22,233,241,211,163,139, 10,114,159,127,161,
- 79, 55, 91,199,192,193,200,121, 16,143,251,183, 34,245,215,239, 38, 92,186,150, 74,111,169,207,213,245,246,246,238,253, 66,159,
- 0,140,159,190, 24,102, 93, 33, 18,207,253,136,226,188, 12, 92,140,178, 67,172, 70,211, 13,128,197, 17,173,168, 20, 38, 8, 41,
-249,232,209, 84,156, 98, 15,163,199,164,208, 97,144, 81, 6,112, 70, 13, 40, 93, 14, 18,210, 77,133,163, 55,165,178, 0,160,144,
- 81, 34, 91, 82,232, 96, 81,228,177,137,107, 43,133,144,198,206,240,104,112, 92,201,240, 77, 28,135,141, 59,127, 79,152,241,233,
-196,142,104,227,235, 28,124, 51, 61,139,130, 21, 33,127,138,160,215,213,253,159,180, 54,252,246, 49,192,153, 17, 57,199,165,117,
-175,245,121,189, 80,199,225,118,238,170,144, 14, 96, 6, 68,186,205,115,214,159,250,184, 83,120, 76,207,121,111, 12,119, 0,105,
-144, 22,186,241, 49, 25,108,239,174, 43,147, 79,115,164,114,121,110, 73,100, 43,144,168, 52,228,230,133, 4, 35,223, 43, 60, 15,
- 15, 15, 0,160,184,184,120,250,148, 41, 83, 54,139,197, 98, 37, 0,138,227, 56,112, 28, 39,250,234,171,175,196, 44,203, 10, 4,
- 2, 1, 43, 20, 10,153,147, 39, 79,210, 44,203,102, 27, 12,134,233,181,105, 50, 12,147, 48,107,214,172, 22,181,181, 80,220,183,
-111, 95,153,201, 74,224,175,132, 69, 38,171,226,188, 60,202, 37,170, 33, 72,251, 73,143,137, 75,151, 2,160, 64,176, 44, 38, 27,
-143, 30, 95,229, 78, 30, 84,109,132,230,185, 65,157,251, 44, 45,219,198,218,148, 25, 88,118, 76,231,118,254,251, 0,192, 72,216,
-137,117, 57, 58,141, 81, 63,174, 67,231,110,251, 57, 66, 68, 12, 33,219, 4, 28, 14, 27, 24,220,179,164,165, 93,117,168,178, 10,
-174, 15,110,235, 72,128,146, 34,195,242,226,194,210,110, 28, 8, 33,164,188,184,240,107, 57,114, 10,141,181,246, 3,245,199, 35,
-211, 0, 19,115,117,218,153, 63,110, 78,103, 89,226, 33, 20, 82, 25,122, 19,179,185,190, 38, 11, 0,210,211,211,207, 71,132,167,
-159,185, 29,220,232, 69, 55, 69,105,148, 75, 7,228,232,112, 38, 61,187,248,124, 93, 52,243,181,244,240, 15,214, 29,255, 89, 42,
- 22,138, 64, 72, 73,135,162,132,192, 96,102,243,162, 82,152, 32, 0,104,231, 2,175, 5,199,152,125, 66, 33,149, 92,155,222,149,
- 56,245,218,241, 43, 35,230, 71, 39,229,111, 75, 42,192, 93, 0, 72, 42,192,221, 3,145,143, 62, 78,200, 40,154,127, 55, 57,255,
-107, 88, 89,175,130, 80,184,216,121,252,210, 39,150,213,247,124,198,170,113, 11,192, 72, 32,109,192,248,121,223,206,163, 40, 52,
-212,240, 19,241,122, 51,105,242,248,194,178,200, 22,159, 87,241,240,252, 55, 40,139,106, 9, 4,130,229, 13,168,121,146,162,168,
- 33, 0, 30, 88,177,217,149,226,226,226,118, 13,124,120,185, 12,195,228, 90,178,226,191, 80, 33,254,105,101,203,191,181,227,254,
-188,230, 63,175,217,178,101, 75, 98,133, 97,225,207, 39,175,201,107,242,154,255, 87,154,132, 16, 97,125,166,106, 52,169,250, 76,
-252, 53,122,234,153, 86,221,119,190,166,219, 51,200,131, 7, 15, 40,254, 44,240,240,240,240, 84, 13, 69, 81,236,223,160,201,247,
-142,199, 83,102,176, 42, 69,183, 4,252, 57,225,225,225,225,225,225,225,225,105, 16,147, 85,113, 94, 98,194, 81,125,248,207,154,
-214, 4,117, 9, 33, 70,240,154,188, 38,175,201,107,242,154,188, 38,175,249,127,167, 89,155, 54,223,154,241,111, 54, 96,188, 38,
-175,201,107,242,154,188, 38,175,201,107,254,255,105, 62,205, 84, 91, 71,139, 47, 58,228,225,225,225,225,225,225,225,249,155,224,
- 43,195,243,240,240,240,240,240,240,240,212,143, 90, 7,149,230,225,225,225,225,225,225,225,225,169, 27, 53, 15, 42,205,195,195,
-195,195,195,195,195,195, 83,103,172, 31, 84,154,135,135,135,135,135,135,135,135,199, 34,182,240,167,128,135,135,135,135,135,135,
-135,231,159,161,114,171,195,176,176, 48, 82,113,206,195,195,195,195,195,195,195,243, 79,242,172,122, 17,190,232,144,135,135,135,
-135,135,135,135,167,126, 76,227,141, 22, 15, 15, 15, 15, 15, 15, 15,207,223, 67,181,117,180,202, 58, 44, 13, 41, 13,213,133,240,
-231,138,135,135,135,135,135,135,231, 95,224,217,246, 34,124,253, 44, 30, 30, 30, 30, 30, 30, 30,222,139,240,240,240,240,240,240,
-240,240,240,252,151,224,199, 58,228,225,225,225,225,225,225,225,249,135, 13,215,223,110,180,248,145,205,121, 77, 94,147,215,228,
- 53,121, 77, 94,147,215,252,127, 50, 89,149,204, 22,223,234,144,135,135,135,135,135,135,135,167,126,212,218,234,144,135,135,135,
-135,135,135,135,135,167,110, 76, 3, 16, 90,250, 57, 20, 21,162, 90,124, 68,139,135,135,135,135,135,135,135,167,126,108, 1,224,
- 89,106,176, 78, 0, 80,243, 70,139,135,135,135,135,135,135,135,167, 97,168, 88, 47,107,104, 5,243,197, 27, 45, 30, 30, 30, 30,
- 30, 30, 30,158,122, 82,109, 29, 45, 10,213,183, 28,136,176, 98, 7,117,105,125, 16,193,107,242,154,188, 38,175,201,107,242,154,
-188,230,255,157,102,109,218, 17,120,250,152,102,141,249,106, 72,248,166,175,188, 38,175,201,107,242,154,188, 38,175,201,107,254,
-223,210,224,173, 14, 59, 2, 54,252,105,125, 38,105, 84, 58,241,240,240,240,240,240,240,212,204,223,211,234, 48, 16,120, 99, 66,
- 91,229, 38,250,110,182,195, 93, 64, 87,211,186, 74,165,114,179, 66,161,152,160,211,233,180, 20, 69,113,101,203, 9, 33, 0, 80,
-113,172,163,196,236,236,236, 94,181,237, 91, 42,149,174,107,212,168,209, 27,197,197,197, 58,138,162, 8, 69, 81,160, 40, 10, 0,
-158,152,179, 44,155,150,155,155,219,233,169,190,132,132, 8,221, 26, 53,250, 83, 44, 20,122, 91,187, 41,203,113,143,178, 50, 51,
-187, 89,177,201, 10,138,194,194,146,221,226, 75, 0,139,159,181,127, 4, 1,132,150,172,215, 22,176,143, 7,198,179, 2,193,219,
- 98, 96,131,145,227, 54, 1, 0, 5,176,117,221,183,241, 10, 90, 80, 4,193, 20, 5, 71, 66, 80, 72, 40,220,146,117, 69,194,191,
-116, 42, 70,137,197,226,225, 14, 14, 14,118,185,185,185,231, 1,236, 3,240,178,171,171,107, 31,141, 70, 83, 76,211,244,113, 0,
- 71,234, 34,220, 43, 24,239, 75, 37,226,169, 6, 51,189,234,143, 91,248,177, 79, 71,184, 50, 28, 86,202, 37,162, 94, 70, 19,243,
-101,228,109,108,179, 82,146, 42,157,202,242, 12,171,199, 72, 59,104,225,117, 7,128, 99,206,206,254, 50,165,195,111, 98,169,240,
- 81, 65,102,241,132, 49, 89, 89,169, 99,235,113,221,255,139,184,185,185,189, 38, 16, 8, 62, 39,132,128,101,217, 15,243,242,242,
-182, 55,144,244,135, 0,156, 74, 63, 23, 0,248,188,158,122,201, 0,124, 75, 63,167, 0,104,194, 63,215,235,204,198,163, 71,143,
-206,232,219,183, 47,214,174, 93,139,141, 27, 55, 38,101,103,103,175, 4,176, 3,128,233, 95,208,225,169,142, 54,192,144,175, 6,
-118,101,233,159, 62,229, 42, 44,238, 95,205,159,249,135, 73,147, 38,153, 9, 33, 36, 46, 46,142,152, 76, 38, 66,211, 52, 97, 24,
-134, 48, 12, 67,104,154, 46,159,188,189,189,211, 31,219,252, 9, 77,129, 64,176,126,244,232,209, 69,132, 16,114,237,218, 53,162,
-215,235,137,209,104, 36, 38,147,137, 24, 12, 6,162,215,235, 43, 77,141, 26, 53,202,172, 73,211,193,193,225,154,179,179,115,166,
-179,179,115,166,139,139, 75,166,139,139, 75,166,171,171,107,249,228,230,230, 86, 62, 41,149,202, 76,165, 82,153,233,226,226,114,
-173,182,116,150, 50, 16,192,121, 11,166,129, 85,108,219,191,162,209,242,244,244,204, 36,117,160,113,227,198,169, 22,164,179,140,
- 70, 20, 5,182,108, 91,138, 2, 39,147,201,124, 43,254,142, 39, 35, 93,181,134,148,189,188,188, 70,123,122,122, 70,120,122,122,
-134,123,121,121,141,182,224, 22,171,164,105,111,111,127,205,205,205, 45,211,195,195, 35,171,108,242,244,244,172, 52,121,121,121,
-149, 79,141, 26, 53,202,116,118,118,174,246, 26, 17, 64, 88,221,116, 14, 16,201,128,126, 34,161, 48,172, 81,163, 70,154, 59,119,
-238,176,132, 16, 34, 16, 8,210,203,214,177,230,216, 31, 55, 89,186, 72,124,152,115, 86,118,165,248,209,202,194,156,179,178, 43,
-186, 72,124,104,188,130, 22,117,213,180,144,170, 52, 39, 79,158, 60,249, 86,102,102,102,122, 65, 65,129,122,211,166, 77,241,114,
-185, 60,114,211,166, 77,241, 5, 5, 5,234,204,204,204,244,201,147, 39,223, 2, 48,203, 10, 77, 0, 64,183, 96, 60,255,250, 40,
- 79,221,173, 99, 19,117,253, 58,139,110,246,104,139,208, 1,221, 36,233,223, 45, 10,212, 93,216,218, 83,215,247, 57,193, 93, 43,
- 53, 41,145, 72,212,221,215,215,119,170, 82,169,156, 84, 58, 77, 44,155, 60, 60, 60, 38,122,120,120, 76,116,118,118, 30, 91,147,
-230, 65, 64,104,201,228, 35,151,119, 31,235,231,171, 75, 94,190,140,220,121,247,109, 50,181,185,143,102,140,187,123,211,127,225,
- 26,253,173,154,238,238,238, 42,154,166,137,217,108, 38,174,174,174,170, 6, 76,231,215,132,144,175, 9, 33, 95, 3,248,186, 1,
- 52,203,243, 51, 43, 12,118, 77,154,114,145, 64, 48, 79, 33,149,134,203, 68,162, 44,153, 72,148,165,144, 74,195, 69, 2,193,124,
- 0,242,255,210, 53,250, 27, 52,237,148, 74,229,195,117,235,214, 17,157, 78, 71,116, 58, 29, 89,183,110, 29, 81, 42,149, 15, 1,
-216, 89,161, 89, 87,157,103, 41,130,245,248,212,112, 17,173, 64,160, 83,191,224,150,135,231,188, 54, 30,220,161,117, 84, 45,111,
- 76, 63,116,235,212,105,234,142, 29, 59, 0, 0, 19,134, 15,199,139, 93,186,192,222,206, 22, 82,105, 73,114, 40, 66, 65, 34,150,
- 96,196,220,247, 44,217,253,151, 35, 70,140,120,245,208,161, 67,118, 0,176,113,227, 70,140, 26, 53, 10, 46, 46, 46, 80, 40, 20,
-144, 72, 36, 16,139,197,149,230,181, 33, 20, 10, 27,167,167,167,187,203,229,242,242, 40, 27,199,113,149, 38, 66, 72, 89,244, 13,
- 12,195,160, 85,171, 86,150,158,174, 69,133,133,133,189,181, 90,109,185, 70, 85,147,159,159, 31, 0,156,182, 68,240,243,207, 62,
- 5,199,104, 33, 18, 1, 12, 3, 24,205, 2,112,164, 74,115,131, 89,179,102,149,167,187, 46, 12, 29, 26, 74, 81, 20,117,232,250,
-245,235,135,179,178,178,154,113, 28,251,102, 29, 35, 93,111,221,191,127,223, 14, 0,252,253,253,103, 1, 56,108, 77, 58, 68, 34,
- 81,227,219,183,111,187,203,100,178,106, 35,151, 21, 34,152, 48,155,205,232,216,177, 35, 99,205, 62, 26, 1,190,121, 2,193,155,
- 29,158,123,110,218,210, 17, 35,228,127,254,249,167, 92, 32, 16,128, 97, 24,124,245,213, 87, 12, 33,196,169, 13,224, 16, 3,104,
-106,144,249, 0,192,107,165, 15,131,109, 0,190,170,228, 22, 8,130,245,180, 44, 52,177,120, 68,151,174, 77,223, 71, 76,244,157,
- 46,205,237,142,193, 94,100, 76, 0,254,217,168,150,131,131,195,240,181,107,215, 42,183,109,219,166,137,139,139, 51,111,218,180,
- 73, 57,125,250,116,123,179,217,140, 25, 51,102,100, 7, 4, 4, 72,214,174, 93,171, 60,114,228, 72, 63,173, 86,251,189, 85,215,
-139,194,167, 47, 15,127, 17, 6, 90, 0,154,102,148,158, 74,251, 93,115, 38,135,136, 9, 49, 97,231,241,235,160, 25,238, 71, 43,
- 35, 89,221,198,140, 25,211,124,239,222,189,162,216,216, 88, 81,235,214,173,193,113, 28, 88,150, 5, 77,211, 0, 0,142,227,208,
-178,101,203,122,159,151,169,128,191, 91, 35,151,240,110, 67, 6,219,120,202,101,112,201,207,198,235, 18,145,253,118,133,113, 55,
-128,238,207, 84,100,151, 16,136, 68, 34,164,166,166,194,221,221,221,134,227, 56, 53,128,101,249,249,249, 91,240,236,210, 69, 42,
- 18, 29,222,249,227,122,143,174,221,187, 11, 27,121,186, 35,254,126, 10, 68, 20,219,255,246,213,235, 33, 83,103,206,155, 99, 98,
-152,209, 0,254,124,214, 14,220,163,251,172,145,148, 64,184,145, 34, 28, 62,249,238,231,162, 21, 95,174, 83,204,120,115,178,112,
-238,220,185,240,241,241,105, 54,114,228,200, 47, 1,204,172, 85,167,235,172,145, 16, 10, 54,130, 16, 44,253,246,231,162, 47,190,
- 92,167,152, 89, 7,157,167,156,106,255, 35,245, 54, 90,129, 64,243, 32, 31,247, 51, 43, 22,206, 20,147, 95,127, 18,232,114,179,
-170, 93, 87,169, 84,110, 30, 52,104,208,132,237,219,255,138, 70,119,107,219, 22, 35,251,245,132,187,171, 35, 20,182,210,146,199,
- 17, 71,225, 86,220, 35,139, 12,129,143,143,207,140,195,135, 15,219, 85, 52, 19, 18,137,164,124,170,104,178,202,166,178, 7,112,
- 77,200,229,114, 68, 68, 68, 64, 36, 18, 65, 40, 20, 66, 36, 18,149, 79, 21,191, 11,133, 66, 52,106,100, 85,213,165,149,142,142,
-142,237,139,138,138, 28, 10, 10, 10,224,235,235,171, 1,112,187,194,239,237,179,179,179, 29,172, 17,228, 24, 45,230,190, 30, 8,
-177,233, 50, 76,226, 46,208,139,122,224,210,213,123, 8, 59,125, 30,233,170, 12,244,124,190, 3, 38,189, 50, 6,225,225,225, 96,
- 89,171, 75, 58, 50, 9,193,151,195,134,133,190, 15, 80, 84,255,254,253, 11,102,207,158, 45,136,141,141,125,117,228,200, 17,109,
-239,223,127, 80, 26, 85,164, 22, 18,130,245, 0, 50, 45,212,149, 2,192,133, 11, 23, 0, 64, 86,151,123, 79, 38,147, 33, 42, 42,
- 10,101,197,196, 2,129, 0, 2,129, 0, 66,161, 16,191, 60,112,131,214, 36,128, 46,243, 46,222, 14,245,133,159,159, 31, 4,130,
-218,171, 36,134, 0,242, 75,192, 72, 74, 44,158,235,233,229,213,172, 79,243,230,138,136,136, 8, 33, 0, 52,105,210,132,168,213,
-234,130,227,199,143, 23,137,128,141, 77, 8,217, 81,147,201,242,241,241,233,145,158,158,254,121,217, 57,167, 40,234,203,166, 77,
-155, 46, 41,191,110, 28,135,101, 63,106,197,115,230,188, 43,233, 26,242, 17, 0,160,235,176,189,208, 36,174, 8,164,242, 62,112,
-252,167,115, 9,141, 70,179,191,101,203,150,194,220,220,220, 75, 0,146,105,154, 94,180,107,215, 46,247,215, 95,127, 61,107,247,
-238,221, 43, 1,120,173, 90,181, 42, 68,171,213, 30,176, 70,183,103,123, 12,121,174,125,219,231,125,125,124,112,254,210,159,144,
- 72,197, 78,179, 94, 11,133,157,157, 8, 95,111, 59,193, 37,167,229,205,142,188,141, 29, 86,152,172, 46, 99,198,140,105,182,119,
-239, 94, 41, 0,220,190,125, 27, 25, 25, 25, 80, 42,149,176,177,177,129, 88, 44,134, 80, 40,132, 88, 44,110, 16,147,229,232,227,
-122,229,216,177,227, 54, 46, 46, 78,248,238,189, 57,152,148,149, 9, 39,123, 59,208,197,218,102,207,216,131,194,191, 87,175, 94,
-114,150,101,161,213,106,113,238,220, 57, 71, 27, 27, 27,199,198,141, 27, 47,133, 21,173,167,228,114,121,166,193, 96,112, 47,253,
-156,101, 48, 24, 26, 1,208,200,100,178,178,124,186,184,116,110,105,113, 98, 50,158, 44, 38, 76,161, 40,170,226,178,186,210,185,
- 75,231,246, 17, 71, 14,237,177, 43, 44,202,128,147,115, 22, 4, 40,196,150, 45, 27, 96, 99,227,128,165, 75, 63, 16, 61,234,223,
-207,123,224,144,209, 17,209,247,226,251, 63,115,102,139, 80, 91,250, 15,155,224, 98,163,176, 47,125,150,208,216,190,117, 14, 4,
- 2, 1,150, 44, 89,130,160,160,160,105,209,209,209, 31, 1,200,171, 89, 6, 91,218,245, 30,231, 34,149,151, 92, 98,142,165,177,
-105,223,252, 18,157,197,211,241,242, 48,191,105, 11,198, 60, 60, 21,212, 28, 69,165, 47,230,122,177, 0, 41, 84, 87,148, 27,134,
-176,176,176, 62,161,161,161,231,171,251,254, 20,224,137,191,250,207,170,100,190, 68, 97, 97, 97, 36, 52, 52,148,170,112,112,149,
-190,215, 68, 48,224,230,236,168,136,216,184,108,142,157,232,242, 9,161, 62,229, 1, 84,134, 74, 15,242, 74, 77, 52, 21, 10,197,
-132,237,219,183, 87, 10, 41,249, 54,114,135, 68, 34,134, 88, 66,193,169, 87, 73,239,245, 5, 23,195, 64, 81,213,154,172, 74,154,
- 90,173,214,112,243,230, 77,187,109,219,182,193,221,221, 29,205,154, 53,131, 66,161,128, 92, 46,175,100,174, 42, 26,174, 42,140,
- 86, 37,205,178,223, 69, 34, 17, 4, 2, 1,194,195,195,193, 48, 12,198,140, 25,243,132,201, 18,137, 68,213, 25,183,234,154,167,
-158, 6,112,155, 16,210,187,244, 1,124, 27, 64,159, 10,191, 15, 84, 42,149,139, 0,172,180, 84, 83, 40, 36, 16, 26, 46,129,107,
-188, 14,162,212, 57, 48,137,131,113, 54,242, 58,182,111, 94, 11, 0,104,214,186, 51,198,142, 12, 45,143,198, 89,152,206,114,188,
-189,189,247,101,103,231, 12,238,215,175, 31,242,243,243,233,101,203,150,161,125,251,246,240,247,247,183,232, 26, 85,243,230,156,
-121,251,246,109, 31,189, 94, 15, 66,136, 37,230,236, 9, 77,138,162,176,107,215, 46, 24, 12,134, 39, 86,118,238,243, 5,230,143,
-106,130, 41,111,239,192,151,113, 7,240,253,247,223,215,120,236, 10,160,189,193,177,229,122,169,144,105,191,242,131,183,100,147,
- 38, 77, 18, 78,153, 50, 5, 41, 41, 41,120,253,245,215, 13,225,225,225,166, 12,181,250,184,148,227,190, 51, 87, 54,198,213,106,
-202,100,178,157,167, 79,159,198,129, 3, 37,190, 36, 62, 62, 30,173, 90,181,178,173,100,146,243, 14,162, 40,249, 59, 92,249, 37,
- 22, 93,135,237,197,149, 95, 94, 1, 91,112, 66,220,169, 21, 10,173, 57,159,117,160, 42,205, 3,185,185,185,229, 38,106,247,238,
-221, 54,187,119,239, 30, 1,224,103, 0, 7, 0, 32, 47, 47,111,141,149,154, 0,133, 41,227, 70,141,128, 72, 98,143,216, 7,105,
-232,211,173, 35, 26,185,187,227,246,189, 4, 36,167,231,101, 82, 20, 94, 27,216, 93,186, 82,175, 55,125,116,241, 22,126,168, 69,
-147,106,220,184,177,255,193,131, 7, 37, 21, 34,208,229,255,113,161, 80, 88,254,189,204,120,215,229,254, 44, 51, 89,246,141,237,
-174,124,186,161,135,237,149, 59,187,209,170,201, 16, 56, 15, 9,197, 15,103,206,224,126,116,140,193,164, 99, 94,248, 23,174,209,
-223,165,233, 63,106,212,168, 75,123,246,236,113, 74, 77, 77,197,133, 11, 23,208,172, 89, 51,232,116, 58, 75, 94,120, 43,105, 26,
- 12, 6,247,178,109, 40,138,114, 47, 11,188,155, 76,166,178,139, 81,246, 71,116,170,176,158, 83, 13,154,190, 21,214, 43, 51, 87,
- 77, 26,224,216,165,114,137,228,224,177, 35,251,236, 98, 98, 47,160, 67,240,243,176,115,108, 3,142,205, 64,110, 94, 49,242, 31,
-168,240,217,103, 95, 98,233,178, 15,241,243,209, 67,118, 1,129,193,135, 77, 12,211, 18,128,225,153,185,238, 20,153, 22,241,203,
-238,141, 20,225,160,207,140,149,137,181, 15, 21, 19, 94, 25, 45, 28, 63,126, 60,126,254,249,103, 68, 71, 71,111,172,193,100, 69,
- 84,136,204, 79,187,123,225,192, 70, 16, 2,125, 86,172, 76,162,127,168,152,252,234, 88,225,164,151, 95,196,229,223,215,227,197,
- 14, 15,239,122,185, 99,100,126,169,197, 22, 9,145, 43,147,227, 15,114, 5,151, 43,152,173,115, 0,168, 10, 6,235, 28,254,170,
-131,249, 52, 48,180,212, 88, 77,123,252,197, 68, 84, 23,131, 5, 0,173, 0, 59, 74, 42,185,178,125,233, 91, 94,138,148,104,145,
-241,110, 20, 84, 70,142,108, 74, 98,184,142,128,205, 13, 64,255,248, 54, 58,157, 78,155,144,144, 96,243,218,200,145,232,222,182,
- 45, 60, 93, 93,209,178,113, 99,216,200,164,144, 74,196,149, 94, 89, 45, 46, 67,160, 40, 18, 16, 16,128, 97,195,134, 65, 44, 22,
- 67,161, 80,192,206,206, 14, 82,169,180,202,104,150,165,111,185,132, 16, 8,133, 66,220,189,123, 23,201,201,201,112,114,114,194,
- 31,127,252,129, 23, 94,120,225,137,168, 86, 69,115,102, 77,136,190,138, 7,127,153, 17, 59,109,141, 22,203, 82, 40, 38,193,144,
- 39,205,134,142,234, 8,163,145,129,209,104,196, 15,145,102,252,153,160,133,217,108,130,209,104,172,105,159,213, 33,240,242,242,
-154,208,178,101,203, 89,175,188,242, 10, 45,149, 74,161,213,106,161,211,233, 16, 29, 29, 77, 15, 30, 60,164, 96,216,176, 80,199,
- 19, 39, 78,144,210,162,195, 76, 43,180,115,189,189,189,125, 74,139,103,115,235,114, 87, 83, 20, 85,110, 98, 30,231,181, 53, 49,
- 16, 9, 75,174,201,198,141, 27,193,178, 44, 8, 33,213, 94, 36, 3, 69,253,182,236,139,213,142,171,214,253, 8, 71,151, 70, 56,
-127,254, 60,123,234,212,169, 34, 10,136,191, 31, 29,189,230, 37,224,228, 65,192,108, 77,250,242,243,243,109,154, 53,107,134,198,
-141, 27,131,227, 56,208, 52, 93, 30,125,201,205,205,133, 94,175,135,139,109, 1, 90,184, 54, 6, 83,116, 14,234,187,159,192,211,
- 46, 22, 59, 78,155,232,231,252,113,235, 63,144,113,252, 84, 58,213,243,173, 25,222,238, 30, 62, 16, 16, 26,170,172, 92,140, 24,
-250, 34,132, 18, 59, 60, 74,205, 65,112,155,230,158,175,190,212,195, 83, 72, 49, 88,184,114,239, 44,128,251,161, 54,185,226,226,
- 98, 54, 54, 54, 22,183,111,151,248, 93, 7, 7, 7,216,218,218, 86,250,143, 11, 4,130,122, 69,180,202, 76,214, 23, 27, 95,176,
- 21,136,181,208,176, 17,216,182,235, 58,130, 3, 66,177,233,202, 85, 3,155,153,215,255,107,131, 33,126,223, 83, 28,204,240,240,
-240,152,206,113,220, 82, 66, 72, 65,207,158, 61, 27,237,221,187,215, 57, 61, 61, 29,215,175, 95,199,146, 37, 75,178, 89,150,101,
- 8, 33, 20, 33,228,147, 6,216, 29, 87,193, 96, 53, 36, 98,133, 28,111,187, 57, 80,195, 69, 2,135,102,140,166,248, 81,142,137,
- 28,215, 49,220,183, 0,232, 26, 51, 55,129,224,141, 67,251, 55,122,185, 41, 57,132, 40,251, 65,157,105,198, 23,239, 77, 70,110,
-110, 17,126,216,186, 2,128, 20,102, 70,136,222, 33,163,225,238,238,141,105,111, 78,243,216,184,121,211, 91, 12,199,125,141,103,
-132,140, 75,223, 31, 5, 16,161, 84, 42,163,223,154, 54, 77,217,172,217, 68,200,229,114,236,219,183, 15,123,191,251,142, 93, 7,
-140,149, 1,103,103, 0, 71,107,212,185,242,151,206,156, 25, 51,148,129,129, 51, 32,147,201,240,251,169,159, 96,200,216, 85, 52,
-180, 59,204, 58, 3,134, 54, 29, 70, 92,146,126,161,242,196, 98, 60, 0, 0,177, 28,106, 0,143, 23,131, 61,109, 6,171,140, 19,
-248,171, 94,214,180, 74, 17,173, 58,231,157, 98,233,157,173,239,190,220,164, 17,140,148, 41,242, 23,164, 27, 57,118,213,125,179,
-240, 70, 33,153,127,175, 10,147, 85,122, 99,115,190,190,190,232,215,169, 19, 70,246,234, 5,145, 72, 4,185, 84, 2,123,185, 13,
- 8, 91, 18,201, 42, 43, 58,172,225,153,136,170,162, 79,174,174,174,144, 72, 36,229, 6,203,138,104, 86,149,154, 28,199, 65, 36,
- 18,225,246,237,219,232,217,179, 39,124,124,124,112,224,192, 1, 12, 28, 56,240,137,162, 68,107, 77, 86,153,209,122,172, 24,111,
- 32,128,178, 72,150, 85, 70,203, 96,162,144, 99, 10, 6, 69,181, 5,195, 0, 44, 1,140, 6, 3, 8, 1, 8, 1,104,179, 9, 6,
-131,161,124,159,150, 20,201,122,120,120,248,218,216,216, 44,127,255,253,133,129,193,193, 29,144,157,157, 13,142,227, 96,107,107,
- 11,157, 78, 7, 7, 7, 7,116,239,222,253,209,242,229,203,213,132, 96,154,149, 38,171,222,148,157,243, 51,103,206, 84, 42, 54,
- 44,155,180,234, 52, 76,121,103, 55,164,162,146,162,165,178, 58, 60, 53,229,187,125,123,247,192,165, 27,241,204, 27, 11,215, 27,
-197,185,215, 87,122,112,220,246,180,122, 28, 23, 33, 4, 57, 57, 57,200,204,204,196,240, 17, 35,176,119,207, 30, 36, 37, 37,161,
- 77,155, 54,232,219,183, 47,220,221,221,145,148,148,132, 63, 47, 26, 97,204,207, 67,158,233, 58, 20,246, 93,113,236,124,130,113,
-201, 70,115,194,191,152, 97, 12, 7, 48,217,193,193,193, 79,167,211,169, 25,134, 57, 8,224, 32,128,177, 34,145,104,172, 66,161,
-240,212,104, 52, 15, 81,210,154,232,120,109, 98, 54,114,185,171, 76,238, 0,142, 49, 66, 36, 18,193,199,167, 25, 8,107, 66,190,
- 70,143,215,198, 15,195,141,219,247,112,234,236,101,134,166,185,111, 44, 57,165,223, 22,203, 0, 0, 32, 0, 73, 68, 65, 84,173,
- 66,161,144,248,251,251, 35, 43, 43, 11, 98,177, 24, 54, 54, 54,176,179,179,195,226,197,139,241,221,119,223,149,155,172,186, 26,
-173,169,128,191,131,175,221,229,207, 55,148,152,172, 12,149, 26,153,105, 98, 40, 93, 27,225,155,239,214,105,243,147, 50,186,254,
- 8,196, 63,237, 15, 89,142,227, 62, 73, 79, 79,119, 23,137, 68, 30, 12,195, 32, 53, 53, 21,215,174, 93,195,236,217,179, 51,115,
-115,115, 67, 80,199, 99,148,203,229, 89,101,145,172,210,162,195,234,138, 19, 11, 42, 68,178, 10,106,144,172,174,152,176,121,179,
-198,246,225, 91,215,206,245,237,220,181,187, 64, 33,114,200, 47,126,144,209, 51,242,194,249,238,179,215,254,240, 86,114,126,241,
-139, 0, 18,171, 19,149,137,197,131,159,239,209, 67, 4,146, 9,145,180, 39,190, 92, 53, 30,217, 57, 26,228,231, 21, 65, 34,177,
-133,137, 22,130,229, 40,116,239,217, 11, 63,237,216,143,160, 55, 95, 23, 74,197,226, 1,140,201,244,204, 24,173, 82, 86,124,251,
-237,183,190, 1, 1, 1,216,190,125, 59,206,238,220,137, 73,133,133, 56, 47, 16, 8,105,177,216,237, 36, 77,111, 65, 45, 70,171,
-162, 78, 80, 80, 16,126,252,241, 71,236,218,181, 43,101,194, 11, 89,135,231, 78,128,187,217,140, 65,215,227,224,210,116, 24,112,
- 61, 14, 46,207, 5,160, 37, 35,194, 3,138,170,220, 29, 84, 88, 88, 88,159,138,243,167, 12, 53,170, 41, 98, 23, 1, 8, 9, 11,
- 11, 35, 21,231,181,102,156,202, 86, 51, 86,188,232,215,164,109, 11, 95,138, 62,176, 30,169, 90,198,244, 81,156, 89,122,191,152,
-204,189, 7,172,171,225, 13,130, 8,133, 66,216,219,216, 64,233,228, 84, 18,230, 23, 8, 0, 14,224,104,128, 98, 75, 12, 0,225,
- 40, 16,214,170, 12, 3, 82,169,180,202,138,239,214,214,205,170,168, 89, 84, 84,132, 71,143, 30, 97,218,180,105, 80, 40, 20, 37,
-206, 61, 35, 3, 77,154, 52,129, 72, 36, 66,122,122, 58,126,255,253,119,248,249,249, 65, 38,147, 89,229,182, 42, 68,151,218,163,
-164,149, 97,123,181, 90,237,224,233,233, 9,171, 35, 90, 28,129,206, 72,193,100, 98,113,255,254,125,168, 84, 42, 60,122,248, 0,
-157,181, 26, 16, 8, 65, 8,177, 42,162,229,237,237,221,182,121,243,230,155, 86,174, 92, 41,105,220,184, 49, 8, 33,112,118,118,
-130, 78,167, 67, 78, 78, 46,218,180,105, 3, 31, 31, 31,172, 92,185, 18, 0,246,254,211, 38,235,177,123,170,220,104, 85, 52, 92,
-239,188,228,139,188, 60, 59, 8,133,130,114,227, 92, 75, 29, 45, 9, 0,132,188, 56, 74, 20,126,234,164, 45, 3, 44,207, 16, 10,
-151,139,106,191,142, 52,203,113,138,234,126, 79, 77, 77,133, 88, 44,198,161,131, 7,145,151,153,137,224,224, 96,116,233,210, 5,
- 15, 30, 60,192,141, 27, 55,224,234,234, 10,101,227,110, 56,255,208,140, 24,149, 30,142,142,142, 72, 72, 19,252,155, 93, 6,188,
-217,191,127,255, 37,107,214,172,113,247,240,240, 16,103,103,103, 7,108,216,176, 33,120,195,134, 13,115,222,122,235,173, 70,111,
-189,245,150,179, 82,169, 20,101,100,100,248,191,247,222,123,207, 69, 68, 68,248, 1, 88, 93,147,160,173,173,189,139, 80, 98, 11,
-138, 18,193,201,209, 25, 34,169, 45, 56, 70, 4,150, 3, 28, 28,149,184,116,227, 16,254,184, 83, 52, 61, 43, 23, 7, 45,138,143,
-149, 94,119, 87, 87,215, 39, 34,213,179,103,207,198,214,173, 91,203,139, 17,235,106,178,190,216,240,130, 29, 85,106,178, 50, 82,
- 69,160,140,126,248,229,104, 84, 65,126, 82, 70,207,103,193,100,149,229,113,132, 16, 60,124,248, 16, 58,157, 14, 23, 47, 94,196,
- 39,159,124,146,253,184,201,114,119,119,127,211,193,193, 97, 89,113,113,241,151, 25, 25, 25,235,107,125,241, 43, 49, 81,101,159,
-203,230, 85, 22, 39, 90,152,212, 38, 85, 69,178,124, 60,229,167,111, 92,220,221,196,145,220,162,144, 60, 13,184,175,137,182,191,
-226,222,123, 72,231,161,130,142,223,127,218,180,203,244,197,167, 83, 53,134,128,234, 34, 91, 28,203,118,180,181,179, 7,144,133,
-235,215,206,149,155,172,220,188, 66, 24,205, 66, 24, 77, 20, 12,102, 1,250,245, 31,132,239, 54,237, 66,122, 86, 30, 88,150,109,
-247,140,153, 44,151,182,109,219,206, 24, 59,118, 44,150, 47, 95,142,136, 53,107, 76, 51, 41, 74, 35, 2,200, 9,150, 5, 71, 8,
- 37,176,172, 18,123, 37,157,175,191,254,250, 40,128,151, 87,206, 70,183,252, 98,188,230, 53,140,184, 52, 29, 86,178,226,152,247,
- 9, 0,184,100, 71, 84,126,100,134,134,134, 82,101, 37,107,214,150,176,253,215, 17,133,134,134,158, 15, 11, 11, 67,197,121, 77,
- 27,216, 55, 10, 24,178, 96,222,172, 85,157, 7,246,162,212,243, 6, 32, 79, 99, 96, 62,136, 49, 75,211,244, 53,155,172,138, 44,
-216,176, 1, 55,226, 75,254,199,141,221,221,177,240,213, 87, 65, 24,224,143,232, 24,236,143,136,192,248,254,253, 97, 43,151, 91,
- 28,217,224, 56,174,202, 40, 86,197,104,150,181, 81,167,130,130, 2, 28, 60,120, 16, 93,186,116,129, 66,161,128, 72, 36, 66,251,
-246,237,113,239,127,236, 93,103, 88, 20, 87,219,190,103,182,194,178,244,222, 85, 20, 12,138,189, 37, 98,236, 45,182,168, 81,177,
-188,246, 26, 11,106, 84,108,177,196, 26, 53,246,138, 49,118,236, 26, 43,118, 44,216, 5, 65, 17,164,151,101,233, 44,176,125,118,
-118,230,251, 65,121, 81, 41, 11,166,188,201,231,115, 93,123,205,206,206,238,189,103,230,204,156,115,159,167, 70, 69,193,195,195,
- 3, 4, 65,224,252,249,243, 24, 56,112, 32,226,227,227,241,229,151, 95,138,147,147,147,107, 76,180,222,188,121, 99,198,178,236,
-215,165,218,143,218,138, 70,163,193,219,183,111,209,175, 95, 63, 88, 90, 90,194,217,249, 56,110, 6, 31,133,200,231, 63, 32, 8,
-212,136,104,233,245,250,113,125,250,244,225, 19, 4, 1,149, 74, 9, 35, 35, 99,152,152,136, 97,106,106, 6, 47,175,134, 72, 79,
- 79, 71,207,158, 61,181,113,113,113,187,164, 82,233,201,154,182,213,219,219,219, 36, 41, 41,233, 63,117,234,212, 17, 0,128,177,
-177,113, 35, 15, 15,143, 31,226,227,227,139,106,170,213, 42, 37, 88, 4, 65,128,195,225,148, 17, 45, 46, 73,194,209,193,174,108,
-191,196, 63,141,168, 2,171, 80,146,171, 17, 2,128,155,155, 27,118,236,253,157,236,211,167, 15,102,205,154, 5,157, 78,135, 93,
-187,138,131,236,134, 15, 31, 14,138,162,112,230, 76,113,144, 36,151,203,173, 82,109,242,252,249,115,188,120,241, 2, 58,157, 14,
- 5, 5, 5,184,122,245, 42, 66,238,221, 67,208,249, 91, 72, 74,136, 69,211,134,238, 24, 63,126, 28,120, 60, 30, 14, 29, 58, 4,
- 95, 95,223,191,117, 64,224,241,120, 35, 3, 3, 3, 29, 15, 30, 60, 40, 59,127,254,188,162, 93,187,118,194, 45, 91,182,216,237,
-216,177,195, 86,171,213,194,223,223, 63,235,241,227,199,154,111,191,253,214,100,223,190,125,142,245,235,215,239, 78,211,116, 69,
- 68,203, 4,192, 48, 0,163,242,139,180, 92, 89,145, 10, 12,173, 69, 66, 82, 34, 10,228, 90, 48,122, 10, 41,105,233,144,171,245,
-200,205, 43, 66,211, 22, 61,182,223,189,123,119, 49, 69, 81,139, 0, 92,170,174,157,175, 95,191,198,227,199,143,145,148,148,132,
-132,132,132,247,153,226,196,137, 56,114,228, 72,141, 53, 90, 21,147, 44, 14, 8,141, 7, 46,157,127, 34,203,138,149,254,107, 72,
- 86,201, 24,180,204,209,209,113,153,163,163,163,209,245,235,215,205,235,212,169, 3,154,166,181, 31,106,178, 58,117,234,180, 36,
- 48, 48,208,209,195,195, 99, 58,128,173,255, 11,109, 39, 73, 76,252,121,247, 20, 27, 83, 65, 74, 58,222,109, 42,201, 37,200, 1,
-148,133,192,221, 99,224,182, 95,154, 56,253,219, 5,150, 1, 7, 87, 78,100,192, 84, 26, 33, 27, 23,159,138,221,187,119, 96,182,
-255, 24,252,246,235,207, 96, 24, 46, 52, 58, 14,220,234,182,131,134, 98, 64,144, 92, 52,107,209, 10,119,238,222, 7,143, 4, 78,
- 29,220,253, 47,227, 89,200,139,140,140,220,117,254,252,249, 25,179,102,205, 2,195, 48,130,229,187,119,171,178,179,179,215,162,
-102,249,175, 62,196, 25,184,123,247,238,152,128, 29,217,231,102,143, 4, 39,233, 34,145,247, 34, 26, 86,223, 45, 96,113,122, 61,
-129,150, 13,145, 39,170,120,138,191,247,193,246,223, 65,180, 74,153,100,249,109, 69,210,194,179,222, 79,230, 86,150,227, 72, 83,
-103,155,249,179,166,114,227, 51,212, 56, 83,103,132,252,246,225,109, 38, 25,180,112,123, 28,212, 91,106,242,199, 39,110,223, 46,
-123,191,225,248,241, 10,143, 73,191,251,206,224,149, 89,101, 90,172,154,106,178, 0, 64, 36, 18, 89,116,239,222, 29, 93,187,118,
-197,224,193,131,203,124,178,154, 55,111,142,160,160, 32, 12, 26, 52, 8, 97, 97, 97,112,116,116,196, 23, 95,124,129, 47,190,248,
- 2, 87,174, 92,169,233, 32, 7,189, 94, 15, 31, 31,159,210,168,195,166,105,105,105,102,181,237, 72,141, 70,131,220,220, 92, 88,
- 89, 89, 65, 32, 16,160,109,219, 54,152, 49,179, 45,108, 28, 15,192,199,187, 33, 20, 10, 69, 89,248,187, 1,147,173, 79,131, 6,
- 13,144,157,157,141,236,236,108,216,218,218,194,201,201, 9, 14, 14, 14,216,180,105, 19,187,117,235,214,107, 20, 69,237,202,201,
-201,169,177, 38,203,193,193,161, 3, 65, 16, 75, 84, 42,149,160,220, 10, 87, 96,107,107,123, 65,165, 82,173,149, 74,165, 6, 59,
-130, 18, 4, 1,138,162, 64, 16, 4, 46, 39, 56, 65,161, 37, 80,152,246, 2,179,250,187,191, 71,188,120, 60, 94,181,230, 82,150,
-101, 21,126,126,126,118,174,174, 46, 72,141,123,141,211,167, 89,252,242,203, 47,165, 81,145,136, 41, 89, 24,148,238,119,238,220,
- 25,117,235,214, 5, 91,131, 92, 25, 12,195,224,213,171, 87, 56,126, 33, 4,142,238,222, 72,121,247, 22, 47,175, 92, 68, 29, 91,
- 43, 52,110,209, 10, 58,157,238,147, 82,111,252, 17,162,211,233,246,123,122,122,178, 90,173, 54, 4,192,142,136,136,136, 49, 82,
-169,212,255,247,223,127,119, 26, 50,100, 72,250,197,139, 23,183, 0, 56, 24, 17, 17, 49,101,213,170, 85, 93,105,154,174, 48, 90,
-144,195,225,252, 54,103,206,156, 78, 67,134, 12, 33,248,164, 78,123, 61,248, 16,151,166,117,196,188, 69,251,245,119, 31,132,144,
- 52,173, 35, 6,251,205, 97,174,220,142, 32, 39,207,220,160,111,222,174, 15, 34, 35, 35, 29,250,246,237,187, 74,167,211, 85, 73,
-180, 74, 53, 85,149,105, 40, 57, 28, 14,198,140, 25,131,160, 32,195, 61,168,198, 3, 30,102,238,226,199,107,118,118, 19, 19, 92,
-121, 57,146, 85, 31,151,206, 63,145,101,190, 75,255, 87,145, 44, 0,200,205,205,221, 11, 96, 47,195, 48,153, 38, 38, 38, 40, 42,
- 42,170,232,254, 51,138,136,136, 48, 18, 8, 4,232,209,163,135,213,205,155, 55, 99, 72,146,220,154,158,158, 94, 41,227,168,200,
- 76, 88,145, 57, 17,159, 16,117,104,105,139,190,109, 59,180, 48,141, 54, 95,105,106,196, 85,135,213,137, 49, 50, 35, 0, 20,104,
-236, 19, 66,147,135, 21, 18, 89,194,230,173, 58,183,132, 25,215,164,175,140, 46,170,144,104,145, 28,206,203,130,124, 89,239,194,
- 34, 45, 30, 60,140,132,223,176, 6,208, 80, 4, 24,134,132, 92,161, 1, 56, 60,144, 0,134,143, 24, 13,150,224, 34, 47, 51, 29,
- 28, 14, 39, 2, 52,141,127,153, 44,156, 50,101, 74,239, 69,139, 22,213,155, 63,127, 62,230,207,159,239, 30, 24, 24,184,119,205,
-154, 53,243,179,179,179,155,160,154,228,227, 85,224,212,185, 24,180,116,238,133,251,123, 10,250,124,165,122,215,178, 97,177,230,
-171,101, 67,228,241,120,136,229,114,144,203,178,239,187, 25,245,237,219,183, 99,249,237, 63, 76, 62,116,130, 47,219, 55,200, 71,
-171, 65, 61,231, 94, 45,154,251,204, 92,188,104,177,105, 84,232, 93, 4,252,180,131,245,108,213,189,104,239,253,151, 90,185, 73,
-221,222,242,156,216,135,134,242, 11, 0,232,213,101, 16,154, 54,106,243,209, 65,223,206,197,201,218, 31,220,121,142,204,108,137,
-193,147,109, 9, 57,168,208, 39,203,144,144,254, 15, 69,165, 82,201, 34, 35, 35,237,210,210,210,222,115,124,175, 91,183, 46, 8,
-130,192,147, 39, 79,240,248,241, 99,248,249,249,129,203,229,130,199,227, 33, 36, 36,164, 70,218,152,114,218,165,210,168,195,158,
- 46, 46, 46,149, 69, 27, 86,139,165, 82,169, 80, 80, 80,128,224,224, 96, 52,104,208, 0,107,214,172,129,147,163, 61, 22, 47,158,
- 11,134, 97, 80, 88, 88, 8,189, 94,111,168, 70,139, 41,213, 22, 49, 12,131,236,236,108,212,171, 87, 15, 59,119,238,196,150, 45,
- 91, 86, 73,165,210,223,107,218, 70, 87, 87, 87, 11,189, 94, 63,175, 79,159, 62,221,191,253,246, 91,244,236,249,126, 62,214, 99,
-199,142,153,158, 57,115,102,237,182,109,219,122, 81, 20,181, 46, 43, 43, 43,219, 16,220, 3, 7,138,211, 47,137,218, 45, 67,192,
-144, 58, 24, 53,237, 16, 54,109, 58, 11,161, 80,248,222,196,187,114,229,202, 42, 73, 12,195,178,158,252,156,208,244,185, 11, 54,
-218,173, 93,123, 19, 55,111,102,129, 36, 73, 56, 58, 58,130, 36, 73, 36, 38, 38,130, 36, 73,184,187,187,131, 36, 73, 72, 36,146,
- 82,159,192,124, 84, 16,245, 88,241, 42,156,132, 90,173, 70,106, 74, 18,210,226, 98, 32, 46,204,128,173,153, 8,249,175, 95,161,
-233,248,137,101,249,159,254,102, 57,162,213,106,143,148,219,223,120,241,226, 69, 45, 65, 16,131, 81,236,167, 81,170,209, 88, 69,
-211,244,170,202, 64,218,181,107,215,124,209,162, 69,188,210,116, 27, 78,110,171,105,138,162, 24, 0,104,216,244,235,247,216,126,
-108,108, 44, 54,109,218, 4,133, 66, 1, 62,159,207, 55,228, 58, 48, 12, 83, 22, 97, 88, 17, 9,171, 9,201, 2, 0,107,119,151,
-237, 79, 94,132,232,195,227,246,168, 34,162,175, 26, 75, 83, 72,144,218,127, 47,201,250, 80,179,229,226,226,178,140, 97, 24,150,
-101,217,165,229, 14, 9,221,220,220,238, 95,191,126,221,154,166,105,108,219,182,205, 34, 35, 35,195,226,235,175,191, 14, 0, 80,
- 41,209,170,200, 76, 88,145, 57, 17,229,162, 14,133, 66,161,149, 86, 91,169,242,228,163,168, 67,189, 30, 94,102,166, 22,200, 71,
- 26, 52, 54,186,230, 50,107, 58,239,134,116, 98,152, 83,114,139, 70, 38,122, 93, 61,178, 80, 11,103,145, 5, 24,150,173, 52, 52,
- 90,163,211, 93, 13,123,241,178,135,155,107, 3,206,239,151,238, 97,192,192, 33,208,104, 72,168,117, 4, 8, 14, 15, 4,135,143,
- 38, 77, 91,224,139,198, 77,193, 2,120,254, 52,148,214,234,116, 55,254, 77,125,239,216,126,134, 31, 65, 96, 43, 88,134,173, 32,
-143, 86,189,129, 3, 7,174, 5, 48,179, 58, 28,187,118, 51,252, 72,178, 24,167,124, 30,173, 57, 51,166,224,245, 83,158,249,189,
- 23,235,249, 61,219,225,114,246, 77, 2, 34,163,255, 70, 29,242,200, 79, 74,205,241, 79, 33, 92,213, 19, 45, 87, 87, 87, 11, 51,
-161,209,129,239,199,143, 51, 77, 14,127,132,140, 55, 79,240,240, 94, 76,254,137, 51,103,243, 20,185, 89,227,107, 64,178,202,204,
-124,214, 14,117, 80,215,251, 99,162,101, 36,182, 5, 0,212,245,110, 3,142, 73,205,210, 8, 85,164,205,170, 13,201, 42, 63, 96,
- 87,148, 67,107,242,228,201, 8, 12, 12, 68,251,246,237,225,233,233, 89, 54,216,215, 84,107, 86,129,118,169,198,209,134,229,165,
-168,168, 8,238,238,238,216,183,111, 31, 34, 34, 34, 96,106,106, 10, 63, 63, 63, 20, 21, 21,149, 17, 44, 67,157,225, 89,150,141,
-189,126,253,122,235,161, 67,135,178, 60, 30,143,144,201,100,176,176,176,192,206,157, 59, 21, 82,169,244,114, 45, 72,214, 16, 62,
-159, 63,119,216,176, 97,156,134, 13, 27, 34, 51, 51, 19,102,102,102, 58,130, 32,120, 0, 96, 97, 97,161, 51, 54, 54,198,148, 41,
- 83,208,172, 89,179, 14,243,231,207,111,207,229,114,119,166,167,167, 31,170,234, 94, 34, 8,162,108, 66, 29,191,245, 45,180,218,
-226, 9,122,215,174, 93, 40,241,117,251,175,137, 32, 46, 14, 48, 32,146, 69, 44, 22,195,211,211,179,194,190,239,208,161, 3,158,
- 63,127, 94,108,154,228,114, 97,103,103,135,135, 15, 31, 26, 20, 73, 85,154, 8, 50, 50, 50, 18,222,117,109, 16,113,243, 58,108,
- 68, 60, 52,115,114,128, 75,135,142,136,137,137,249, 59,181, 89, 4,138,253, 48,186,149,220,131,251, 1, 76, 46,183,191, 19,192,
-246,154, 0,210, 52,205,146, 36, 73,164,166,166, 82, 34,145,136,176,178,178,226, 10,133, 66,104, 52,154, 50,194, 21, 27, 27,139,
- 75,151, 46, 33, 45, 45, 13, 86, 86, 86,164,185,185, 57, 40,138,202, 55, 4,223,203,203, 11, 14, 14, 14,239, 57,190,143, 31, 63,
-190, 86, 36,107, 12,224, 19,184,122, 93, 29, 33,201, 49,247,182,233,133,132,183,137,106, 82, 11,163,255, 15, 36, 11, 0,100, 50,
-217, 94, 0,123, 75,247,109,108,108,198,114, 56,156,197, 26,141,198, 60, 36, 36,196,194,214,214,150, 56,116,232,144,110,233,210,
-165, 50, 14,135,147, 79, 16,196,230,191,159, 28,226, 77, 78, 65,156, 59,207,210,137, 9, 87,179,161,254,169, 1, 95,228,243, 26,
-216, 18,141,125, 48, 48, 43,234,193, 88, 58,238,171, 76,105, 6,201,130,121, 83,197, 24,188, 63, 96,209,202,121, 49,111, 95,186,
- 25,153, 25, 97,242,148, 69,184,124,237, 14, 8,146,135,251,161, 79,160,165,244,200,201, 43,192,176,225, 35,225,226,104,131, 55,
-143,131,179,105,134,217,249,239, 34,217,204,142, 30, 3,198, 90, 10,141, 69, 37,215, 68,143, 35,191,206, 5, 73,110,197,143, 63,
-254, 8, 31, 31,159,105,145,145,145, 43, 80, 77, 30, 45,130, 96,118, 52,233, 56,220,146, 47, 44,198, 97, 25, 61,246,157, 10, 40,
-201,163, 53, 27, 59,247,158,105,210,184,110,194,242,170,242,104,253,139, 72, 86,249,109,213, 68,203,221,221, 93,104,194,195, 36,
- 30,135, 59,255,251, 17,223,218,102,197,189, 70, 90,212,203, 98,243, 2,165,162, 50,222, 69, 25,146, 10,189, 27,222,207,223,193,
- 86,101,186, 82,171, 13, 90,209,191,135, 89, 58,225,126,168,205,170, 33,201,250, 8,179, 60,217, 42,159, 55,203,213,213, 21,107,
-215,174, 53, 36,143,214,135,231, 94, 42, 61, 81,236, 0, 95,222, 25,190,167,129, 36,171, 66, 76, 91, 91, 91,228,230, 22,103, 72,
-232,212,169, 19, 58,117,250,111, 60, 3, 69, 81,101, 90, 44, 83, 83,211,138, 52, 90, 31, 97, 26, 27, 27, 7,156, 61,123,118, 92,
-104,104,232,208, 31,126,248,129,215,181,107,215, 82, 50,167,132, 97,181,221,222,195,212,235,245, 83,130,131,131, 57, 12,195, 96,
-223,190,125,120,254,252, 57, 43, 18,137,150,136, 68,162, 29,198,198,198,122,149, 74, 53,121,226,196,137, 35,151, 47, 95, 78,118,
-232,208, 1,143, 30, 61, 34,235,213,171, 55, 26,120, 47,137,101,133,231,254,228,201, 19,144, 36, 9, 58, 47, 5,211, 2, 78,192,
-196,152,139,183,111,223, 34, 47, 47,239,163, 36,166,134, 92,207,242,154,146,210, 87,135, 14, 29,202,204,144,109,219,182, 5,135,
-195, 65, 88, 88, 88,101,102,216,242,152,172,181,181,117,217,253,193,231,243,113,231,206, 29,252,244,211, 79,112,179,178, 64,126,
- 84, 4, 28, 58,117, 65,247,113, 19,225,231,231, 7, 14,135, 3, 43, 43,171, 50,205,175, 1,247,210,167, 72,121,204,113,222,222,
-222,163,223,188,121,227,210,164, 73, 19,199,200,200,200,206, 62, 62, 62,238, 17, 17, 17,165,251, 66, 24,230,155, 83,134,249,236,
-217,179,211, 59,118,236,152, 50,102,204, 24, 62,195, 48,250,228,228,100, 29, 0,194,193,193,129,243,236,217, 51,230,247,223,127,
-135, 74,165,130,139,139, 11,233,236,236, 76,220,184,113,131,137,138,138,122,194,178,236, 34, 67,206, 93,175,215,191,151,198,161,
-244,253,177, 99,199,106,252,188,215,249,194,107, 77,215,175, 27,186,230,164,135, 65, 42,137,131,190,192,150,186,116,254,162,166,
-134, 36,235,207,238,163,191, 18,115,229,187,119,239,156, 53, 26, 13, 4, 2, 1,118,237,218, 69,173, 93,187,246, 77, 78, 78,142,
- 47, 42,142, 40,127, 15,179,150, 81,135,121, 85, 96,126, 20,117, 88,144,139,203,231, 47, 60,107, 45, 30,184, 31,211,210,179,203,
- 28, 27, 89,130,176, 58,107,223,200, 87,212,166,137,132,188,178,140, 44,210, 43, 47, 87,113,238, 90,149, 86, 59,100,224,160,225,
-183,130,130,142,139,151, 46, 91,134,135, 79, 34,144, 43,147,131, 97, 57, 96, 8, 2,139, 23, 47,133,131,141, 21, 10,211,223, 41,
- 53, 20, 53, 16,239,231,208,250,199,247, 59, 65,144,211,111,252,126,104, 43, 73,128, 81,100, 70, 11, 57, 69,113,162, 81,126, 3,
-185, 67,134, 12,193,217,179,103, 17, 25, 25,185,167, 10,146, 85,134,201,178,228,244,136,144, 19, 91, 9,128, 81,101, 71, 11,185,
-242, 4,209,232, 17, 3,185,126,126,126, 56,119, 41, 20, 65, 23, 19,118, 7, 93,196, 69,252,187,165,230,153,225, 77,185,136,244,
-109,228,225,220,161, 69, 99, 35,174, 94,133,180,168, 56,228, 41,212,184,241, 58, 89, 70,178,100,173,115,235, 20, 15,144,124,164,
-164,188,171, 96,101,101, 84, 50,161,171,107,132, 73,146,228,123,218,172, 79,209,100,149,111,167,189,189,253,123,229, 92,202, 79,
-220,165, 62, 64,181, 72,237, 16,144,146,146, 98,150,146,146, 2,150,101,241,228,201, 19,179,182,109,219, 6,124,138, 54,107,238,
-220,185,101, 90,171, 15,183, 21,125, 86,157,148, 56,165,111,209,233,116,167,230,207,159, 63,173,109,219,182, 61,150, 45, 91, 70,
-160, 6, 5,120, 63,208,230,208, 12,195,224,238,221,187, 56,123,246,172,158,162,168, 73, 82,169, 52,162,220, 87,182,189,120,241,
-226,198,160, 65,131, 14, 69, 71, 71,115,222,188,121, 3,150,173, 62,238, 84,165, 82,193,211,211, 19, 52, 77, 99,253, 52, 87, 20,
- 21, 53, 1, 77,211,208,235,245, 48, 49, 49, 41,211,226,149, 39,207,213,221, 71,122,189,254, 35,162,245,228,201, 19,112, 56, 28,
-248,250,250,226,229,203,151,101, 26,173,234, 52, 80, 20, 69,165,216,219,219,219,175, 92,185,178,172, 93,217,217,217,184,126,253,
- 58,218,125,249, 21, 26, 77,154,140,244,244,116,108,222,188, 25, 78, 78, 78, 88,179,102, 13,242,242,242, 64,211,244, 95,173, 78,
-239,253,230,205, 27,151, 17, 35, 70,100, 69, 68, 68,184, 92,186,116,201,162,111,223,190, 38,195,135, 15,207,138,136,136,112, 33,
- 8,226, 43,212,208, 9,154, 97,152,133,139, 23, 47,190,182,102,205,154,128,153, 51,103,182, 29, 51,102, 12,143,199,227, 49, 18,
-137,132, 62,126,252, 56,225,233,233, 73,242,249,124, 34, 56, 56,152,121,250,244,233, 99,154,166,215, 3,184, 95, 19,141,115,121,
-146,197,225,112, 12, 37, 89,239,137,191,157,112,180, 41,153,237,187, 99,215, 90,178, 97, 93, 23,234,240,241,235,169,247, 31,189,
-139,231,104,104,255, 3, 85,164, 6,248, 55, 11,135,195, 57,233,237,237, 61,118,250,244,233,198, 61,123,246, 20, 46, 95,190,188,
-160,168,168,168, 50,146, 85,193,130,249, 47,137, 58,252,117,225, 15,151,252,231, 52, 25,235, 49,193,161, 14,110, 42,178,144,207,
-229,144,102, 22, 36, 90,184,115, 80,148, 19,107,123,241,214,193, 68, 0,213,229,101,123,246,226, 85,100,183,198, 77,154,159, 89,
-191,102,189,221,146, 5,243,121,103, 46, 93, 5, 75, 83,120, 18, 18, 2, 49, 95,207, 70,189,184,153,169,161,180,223,226, 95, 88,
-130, 71,250,112,123, 16,128, 11, 86, 86, 86,225,227,198,140,241,244,246, 30, 14,145, 72,132,211,167, 79,227,200,182,109,250, 45,
-192, 80, 33,240,114, 74, 53,249,244,178, 30,151,225,132, 77, 28, 55,206,171, 69,139, 9, 16,137, 68, 56,117,234, 20, 14,109,217,
- 98, 48,206, 63, 92, 74, 51,195, 95,198,127, 51,196, 87,227,163, 69, 18, 69,143,223, 37,203,159,188, 75,150,131, 97, 89,134,101,
- 53, 36,137, 84, 5, 69,173,121,151, 32,169, 21, 41, 40, 53, 29,174, 90, 61,253,143,179,121,148, 35, 63,181, 13,233,174,128,100,
-165,149,175,145, 86,126,146,174,236,189, 78,167, 75, 51, 16,126,157,155,155,219, 71,159,213, 94,245,203,214,136,100, 25,154, 71,
- 11, 0,114,115,115,165, 0,150, 60,122,244,232, 88,143, 30, 61, 38, 2,144,212,178,143,246,117,236,216,113, 18, 0, 14, 65, 16,
-123,210,211,211, 35, 62,122,224,165,210, 24, 39, 39,167, 13,117,235,214,157, 92,188, 48, 37,246, 85, 51,145, 39, 52,105,210,132,
-170,168, 47, 42,219,103, 24,166,218, 62,146,201,100,104,211,166,205, 71, 53, 45, 89,150, 69,114,114,114,169,198,169,236,218, 87,
- 69,224,228,114,249,228, 25, 51,102,236,229,241,120,110, 0,136, 82,146,171,215,235, 57,219,183,111, 55,210,235,245, 28, 0, 4,
- 73,146, 52,143,199, 83,159, 61,123,150,166,105, 58, 69,163,209, 76,254,139, 7,136, 83, 68,113, 41, 6,197,155, 55,111, 26,150,
-104,178,210, 34, 35, 35,195,130,130,130,108, 1,156,168, 37,238,125,165, 82,121,127,237,218,181, 29,118,237,218,181,112,242,228,
-201,109,252,252,252,184,157, 58,117,194,229,203,151,245,119,239,222,125,162, 82,169,214,213,132, 96,149,244,101,129,171,171,107,
- 25,225,170,230, 89,174,210,145,215,218, 93,184, 99,228, 84, 39,163,125,235,174,203,115,210,181,161, 58,185,118,209, 65, 32, 18,
-255,143, 37, 51, 51,243, 7, 0, 75, 55,111,222,156,222,172, 89, 51, 33,159,207,215, 26, 74,178,254, 66,161, 25,153,252,155, 95,
-186,127,119,161,227,226, 25,117,187,119,246, 21,185,214,177,115,142,138,203, 68,236,163,203,138,240,139,171,147, 88, 77,254, 0,
- 0,134,120,174, 63,213, 80, 84,131,185,243,231, 78, 19,240,120, 61,244,122,125,211,174, 55,206,179, 28, 14, 39, 66,171,211,221,
- 40, 49, 23,170,255,197, 93,190,106,195,134, 13,158,222,222,222, 56,125,250, 52,110, 28, 61,138, 97, 57, 57,184,195,225,112, 72,
- 62,223,250, 34, 69,109,132, 97, 4,105,213,166, 77,155,188,124,124,124,112,242,228, 73, 4, 31, 58,132,161,181,195,169,108,174,
-107, 13,192,182,100, 55, 7, 64, 52,128,150, 0,140, 1,104, 80, 92,218,201,166,252, 20, 86,114,172,244,248, 61,130, 32,254, 76,
- 71,216,234, 51,195,127, 40,145,177, 73, 45,255,232, 86,168, 84,170, 60, 79, 79,207, 26,197, 92,235,116,186, 42,109,184, 52, 77,
-167,121,120,120, 24,172,181, 48,132, 20,229,229,229,181,250, 19, 59,227,147,124,177,222,155, 68, 24, 38,201,209,209,145, 41,157,
-244, 43, 34, 97, 21,125,198, 2,137, 53,249,159,140,140,140,104, 0,115,106,219,206,244,244,244, 51, 48,160,104,180,161,223, 3,
-128,252,252,252, 63,188,152, 47,193,178,146,229,203,151,215,136, 96,131,101,171, 34,159, 17,114,185,188,173, 33,255, 77, 81, 20,
-254, 70, 57, 89,242, 34, 35, 35, 35, 39, 18, 4,209, 19,197, 38,129, 61,248, 99,178,121,223, 47, 44, 44,188,255,243,207, 63,119,
-216,183,111,159, 63,203,178, 40, 44, 44,220, 82, 83,130, 85,182,122,206,202,186,252, 71,157,120, 94,166,246,246,241, 61,105, 93,
- 84, 50,202, 63, 80,174, 61,132,207, 82,166,140, 98, 89,246,183, 81,163, 70,181, 3,112,240, 83,193, 42,137, 58,252, 84, 73,100,
-242, 11,154,221,153,251,211,184, 59, 22,166,125,160,231, 54,132,150,188, 8,109,238,101, 0, 7, 96,152,155, 67,217,249,210, 12,
-179,137,214,106, 55,149,155, 92,254, 63,244,179,149,143,143,143,255,216,177, 99,177,116,233, 82, 4,111,220, 72, 77, 37,136, 2,
- 30,192, 94, 43, 94,104,146, 4,176,192, 80,156,209,163, 71, 99,233,210,165,184,178,126,125,109,113,170, 18, 91,130, 32, 46, 1,
- 64, 64, 64,192,162,181,107,215, 90, 46, 92,184,176,233,186,117,235,214,148,236,191, 46, 61, 94, 50,215,245, 93,184,112, 97,227,
-114,199,139, 0, 60,251,147,175,103,133,153,225,255,108,233,246, 25,243, 51,230,103,204,207,152,159, 49, 63, 99,126,198,252,140,
-249, 41,194,178,108,159,226, 77,229,219,202,222,151,219,254, 45,194,197,103,249, 44,159,229,179,124,150,207,242, 89, 62,203, 63,
- 80,202,107,177,106,115,252, 15,148, 82, 31,173,242,178, 15, 40, 14,235,174,140,149,214, 36,234,161, 54,204,246,230,103,204,207,
-152,159, 49, 63, 99,126,198,252,140,249, 25,243,255, 29,102,117,216, 31,253,158,101,217, 62, 4, 65, 92, 98, 89,182,111,101,219,
- 82, 98,245,225,251,114,219, 63,204,237,160, 2, 41,245,205,250,200, 71,235,207,150,207,106,213,207,152,159, 49, 63, 99,126,198,
-252,140,249, 25,243, 51,230, 39, 73,169, 9, 16, 0, 27, 16, 16,176,240,127,208,116,232, 88, 66,178,202,191, 0, 84, 97, 58,100,
-217, 83, 28,137, 4,102, 2,129,136, 15, 0, 90,173,146,114,118, 70, 33, 65, 12,249, 59, 11,222,126,150,127,166,148,134,123,103,
-254,193,223,253, 44,159,229,179,124,150,207,242,255, 67,178, 75, 53, 85, 0,178, 1, 16, 37,251,218,146,109,118, 9, 33,251,240,
-253,123,199,255, 68,145,162, 18, 77, 22,183, 50,146,149,147, 35,178,225,114,243,189,244,122,245, 23, 0,192,229,146,111,115,114,
- 44, 99, 88,246, 84, 78,109,200,150,141,157,221, 11, 30,135,227,108,200,119,117,122,189, 36, 39, 51,243,253,212,241, 4,241,111,
- 32,120,134,146,136, 79, 33, 27,127, 58, 81,177,177,177,177,183,183,183,239,111,102,102,246,165, 76, 38,123,154,157,157,125,174,
-138,186,135,107, 9, 2,243,139,239, 43,252, 12, 96, 97, 21,208, 53,249,238,135,226, 41, 18,137,166, 17, 4,225, 83,242,128, 69,
- 42,149,202, 93, 0,222,253, 63, 28,144,140, 1,124,203,229,114, 71,219,216,216,180,201,200,200, 88, 14,160,182,217,188,185, 0,
-230, 90, 88, 88, 12,179,176,176,240,200,203,203,139, 47, 44, 44, 60, 9, 96, 19,128,106, 67,165,151,207,116,252,178, 83,207, 78,
- 75,238, 6,223, 93,181,124,155,244,209, 71,199,231, 58, 90,247,232,222,126,233,221,139,161, 43, 23,237, 76,207,171, 97,219,200,
-146, 23, 80, 28, 29,201,226,227,100,175,159, 42, 60, 0,253, 0,116, 2,112, 23,192, 69, 67,206,187, 18,105, 7, 96, 81, 73,155,
- 55, 1,184,243, 63,126, 31,153,216,219,219,175, 7,208,143,203,229,190,145, 72, 36,147, 0,164,253,205,109,226, 2,104, 13,192,
- 7,197,105, 56,158,193,176, 20, 14,213,138,181,181,117, 95, 46,151, 59,173, 36,181,203,174,220,220,220, 75,255,171, 29, 35, 16,
- 8,182, 56, 56, 56, 76, 80,169, 84, 74,130, 32,216,242,249, 30,105,154, 78,203,201,201,105,245,111, 27,212, 8,130,120,246, 63,
-222,196, 73, 21,124, 86,121, 30, 45,137, 4,102, 92,110,190, 87, 86, 70,196,176,116,233,171,161, 0,224,228,216,244,164,157, 67,
-147, 19, 18,137,128,114,104, 56, 80,204, 19,113,119,113, 56,188,230,106,173,198,134,199,229,229, 80,180, 46,140,212,178,211, 50,
-162,207, 85,152,108,145,199,225, 56, 39,197,220,177,163,169, 60,240,140,156,192, 51,118,171,180,181, 78, 78, 78,181, 58, 75, 75,
- 75, 15, 83, 74,104,228,207,227,113,186, 51, 44,237,195, 50, 0, 73,240, 34,105,189,238, 22, 95,163,249, 37, 63, 63,190,168,182,
- 87,176,161, 53, 28, 88,192, 15, 4,186,131,197, 13, 2, 8,138,206, 69, 70, 13, 32, 12, 37, 17,159, 66, 54,202,255,118, 51,128,
- 31,254,232, 59,201,217,217,217,178,111,223,190, 91,126,250,233, 39, 99,177, 88, 76,164,164,164,244, 92,176, 96,193,215,207,159,
- 63,159, 35,145, 72,210, 63, 36,125, 4,129,249, 12,195,146, 0, 64,146,196, 2, 91, 91, 59, 17,135,195,249, 40,183,145, 94,175,
- 23,101,103,103, 77,103, 24,150, 40,249,238,124,150,197, 86, 67, 8,163,145,145,209,112,159, 38,205,231,172,223,176, 73,108,111,
-103,103, 66,235, 25, 42, 49, 57, 73,180, 36,224,135,182,113,177,239,182,170,213,234,227,181,121,174, 57, 28,206, 48,161, 80,216,
- 23,128,119,201,103, 81, 26,141,230,146, 94,175, 63, 97,232,132,110,111,111,127,143,195,225,212,169,201, 31,235,245,250,148,204,
-204, 76,223, 90,118,209, 16, 55, 55,183, 3, 29, 59,118, 20,181,105,211, 6, 2,129, 0, 75,151, 46,157, 43,149, 74,171, 35, 90,
- 92, 0,115, 69, 34,209, 48, 19, 19, 19, 15,185, 92, 30,167, 82,169,206, 8, 4,130,110, 91,183,110,117,109,223,190,189,105,102,
-102, 38,193,225,112,236,175, 92,185,242,159, 45, 91,182,244,164,105,186,107,117,147, 92, 65, 28,187, 68,216,207,187, 67, 65,220,
-157, 37, 0,122,127,120,156, 86, 27,141,102, 57,174,125, 85,236,203,212, 18,242, 97, 48,201,226,241,120, 91, 29, 28, 28,198,170,
-139,115, 5,176, 31, 78, 56, 0,160,213,106,243,101, 50, 89,195,218, 60,242, 0,198, 91, 88, 88,140,157, 55,111,158,101,239,222,
-189,113,244,232,209,239, 3, 3, 3,243, 11, 11, 11,127, 67,113, 34,204,232, 26, 98,206,207,200,200,248,134,199,227, 17,174,174,
-174, 28,149, 74, 85, 19,162,229,133,226, 34,204,207, 0,236, 66,113,234,130,206, 64,241,243, 14,224,231, 82,226, 70,146,228,174,
-134, 13, 27,246,143,138,138,218, 13, 96, 85,109,159,117, 7, 7,135,189, 59,119,238, 28, 58, 96,192, 0, 78,118,118,182,115,179,
-102,205,142,101,100,100,116,248, 3,134,145,113, 66,161,112,118,211,166, 77, 27, 69, 71, 71,199, 20, 22, 22,110, 42,185,158, 85,
- 61, 83, 46, 0,186, 89, 88, 88,116, 93,188,120,177,184,111,223,190,216,183,111,223, 55,129,129,129,242,162,162,162, 91, 40,246,
-233,249, 36, 18,200,229,114,167,165,165,165,217,176, 44, 11, 71, 71,199,105, 0,254, 39,137, 22, 73,146, 91, 7, 13, 26, 52,246,
-216,177, 99,162,164,164, 36,145,179,179,115, 89,242,108,130, 32,106, 61,127,126,150, 79,150,125,229, 8, 87,245,121,180, 4, 2,
- 17, 95,175, 87,127,145, 46,125, 53,244,235,142,219,205, 1,224, 94,200,140,161,118, 14,141, 35, 5, 2, 81,140,208,204,232,236,
-160,126,221,154,127,215,183, 35,225,226,104,135, 52,105,150,253,175, 65,193,189, 46, 5,223, 57,139,226, 4, 98, 21, 10, 77,229,
-193,152,186,137,232, 7,219, 96,211, 41, 29, 59,174,164,225, 81,120, 34,148, 5, 57,168,227, 96,140, 13,254, 61,224, 96, 41,170,
-221,210,203,206,179, 51,205, 21,158, 24, 49,124,148,121,255,111,189,121,238, 14, 14, 96, 89, 33, 98,226,228, 95, 93,189,126,167,
-245,153, 83,199,167,153,240, 60,135, 41,178,222, 25, 60,184,181,112,132,177,130,194,183, 92, 14,241,159,246,173, 26,117, 29,254,
- 77, 7,178,145,119, 3,188,121, 29,213,227,194,237, 39, 27,200,208,215,183,104, 61,123,216,132,143,243, 47,165, 85, 38,244,251,
-136,112,116,237,218,173,131, 80, 40,124, 47,121,146, 70,163,225,223,186,117,179, 93,109,200, 70,233,127,104,181, 26,146,199, 19,
-128, 36,137, 57, 62, 62, 77,188,115,114,114,238, 16, 4,113, 32, 61,189,102,218,130, 25,128, 32,159,203,109, 73, 10,133,142,122,
-173,214, 26, 0, 8,129, 32, 63,145, 36,155, 44, 94,180, 72,204,225,112,152,220,220, 92, 40,149, 74, 98,226,196,137, 70,113,113,
-113,131, 36, 18,201,182,106, 86, 36, 8, 12, 12,244,114,116,116,252,168,122,172, 84, 42, 21, 12, 24,208,191, 54, 93,239,213,180,
- 89,139,217,193,193,215,188, 11,243,242,213,129,155,247,190,208, 25,137, 52,245,188, 27,242,118,237, 59,100, 62,105,236,200, 25,
-111,223,190, 14, 67,205,234,213,185, 25, 27, 27,159,221,184,113,163, 79,231,206,157,121,118,118,118,200,204,204, 68, 84, 84,148,
-207,237,219,183,191, 61,116,232,208, 92,149, 74, 53, 8, 48,168, 32,170,231,173,195, 7,236, 76,172,172,161,215,233,224,212,180,
- 69, 89,126,179,216,219,215, 65, 83, 20, 24,157, 14,222,125,191, 45,209, 38,179,240,246,246,174,109,214, 93,167,198,141, 27, 31,
- 89,179,102, 13, 95,163,209,224,201,147, 39,184,115,231, 14, 35,149, 74,171, 75,136,203, 37, 8,226,250,178,101,203, 92,124,125,
-125, 77,115,114,114,160,215,235,109,206,159, 63, 63,173,121,243,230,102,174,174,174,130,195,135, 15, 67, 46,151,131,166,105, 43,
- 15, 15, 15,171,225,195,135,107, 15, 31, 62, 60, 23,192,250,202, 52, 89,133,113,236, 18, 41,225,209,171, 97,203,209,200, 32,174,
-245,154,221, 11, 87,205,234, 19,101,154,173, 94, 30, 30,166,133, 18,209, 2,177, 89, 19,171, 66,201,205, 5,189, 60, 60, 2,175,
-197, 27,180, 24, 34, 75, 38,155, 17, 65, 65, 65,162,168,168, 40,145,183,183, 55, 24,134, 41,203,192, 95,154,112,214,211,211,179,
- 54,215,113,221,148, 41, 83, 22, 12, 29, 58, 20, 77,155, 54, 45, 75,138,250,227,143, 63, 98,193,130, 5,150,247,238,221,155,123,
-252,248,241,185,231,206,157, 91, 15, 32,160,134,218,152, 82,169,105, 31,175, 72, 72, 72, 24,114,246,236,217,145,243,231,207,247,
- 4, 48, 29,192,210,220,220,220,142, 37,218, 24, 65, 9,209, 26, 55,119,238,220,169, 1, 1, 1,248,230,155,111,150, 62,121,242,
-100,117, 45,181,124, 28,154,166,191, 25, 48, 96, 0, 71,167,211,193,196,196, 4, 58,157,174,254,167, 42, 37, 0,236,156, 60,121,
-242,212, 41, 83,166,192,210,210, 18, 58,157,206, 43, 40, 40, 40,112,233,210,165, 95, 2, 24, 95, 73, 91, 71, 79,157, 58,117,129,
-137, 32,113, 0, 0, 32, 0, 73, 68, 65, 84,240,168, 81,163,208,170, 85, 43,112,185,197,151,113,227,198,141, 88,185,114,165,248,
-250,245,235,223, 30, 62,124,248,219, 11, 23, 46,156,193,251,101,187,106, 36, 12,195,128,203,229, 34, 53, 53, 21,118,118,118, 66,
-134, 97,130, 9,130,216,151,151,151,119,238,127,104, 50,255,121,200,144, 33, 35,142, 29, 59, 38, 6,128, 13, 27, 54, 96,246,236,
-217,176,183,183,135, 88, 44,254, 76,117,254,119, 52, 90,147,170,213,104, 85, 39, 74,165,178,197,194,153,255, 1, 73, 22,175, 26,
- 27,212,115,195,218, 69,147,136, 11,151,130, 91, 84,169,131, 55,114, 66,244,131,109, 16,186,250, 67,163,163,241, 56, 60, 1, 55,
- 54,244, 44,158, 45,123, 47,134,134,234, 90, 58,217, 88, 9,140,141,127,214,234,245, 15,225,224,240, 4,201,201,217,213,145, 44,
- 91, 7,251, 75,123,246,172, 55,246,169,223, 16, 20,173,131, 36, 75, 2,130, 16,194,197,217, 20,227, 70,247,230,117,236,232,100,
-179, 98,197,222,203, 25, 12, 6, 42,115,222, 85,155, 48,212,203, 6, 7, 91,248,120, 14, 29,222,199, 87,216,196,167, 49,248, 66,
-227,178, 99, 45, 91,181, 66,203, 86,173,200, 0,121, 81,247,167,207, 94,116, 63,125,253,177, 70,169, 75, 62, 25,147,131, 49,213,
- 12, 50,101,132, 99,214,172, 89,176,183,183,127,239, 11,153,153,153,184,125,251, 86,133,191,169,193, 64, 86,246, 31,171, 87,175,
- 54,205,207,207,239,189,127,255,254, 46, 12,195,172,206,200,200,120, 96, 8,200, 40,160, 78,129, 80,216,117,236,166, 77, 76,243,
-254,253, 57, 22, 14, 14, 36,163,215, 19,233,241,241,214,155,183,109,235,148, 23, 27,107,172,176,178,202,203, 87,169,148, 49, 49,
- 49, 48, 50, 50, 34,184, 92,110,235, 10,160, 50, 89, 22, 63,147, 36,177,128, 32, 8, 8,133, 70, 49, 83,166, 76,121, 89,114,172,
-206,197,139, 23, 69,253,250,245, 83, 2, 72, 2, 0,161,208,200,153,195, 33,189,138, 51,177,227,103, 67, 8,166,137,137,201,204,
- 85,107,214,155, 20,230,201, 84,148, 66,161,179, 53, 19, 19,132,216,148, 83, 88, 80, 84, 36,145,102,107, 22, 47, 95,201,153, 60,
-110,212, 76,133, 66, 49,205, 80,146,213,172, 89,179,167,103,207,158,181,179,182,182,134, 76, 38, 67,110,110, 46,158, 62,125, 10,
-134, 97, 48,104,208, 32,225, 87,109,219,180, 88,180,120,201,163, 84,137,228, 75, 67,200,150,137,149, 13, 54,248, 54, 47,158,172,
-147,114,203,250,103,223,144,190,101,223, 89,153, 86, 80,170,157,251,148, 18, 82, 95,118,237,218,149, 15, 0,227,199,143, 47, 44,
- 42, 42, 90, 11,224, 24,170,207,232, 63,119,201,146, 37,206,245,234,213,115, 63,118,236, 24,228,114, 57, 0,216,213,171, 87, 15,
- 94, 94, 94,250,187,119,239,194,203,203, 11,166,166,166,184,119,239, 30, 30, 61,122,132, 86,173, 90,153,242,249,252,161, 20, 69,
- 85, 72,180, 58,245,236,180, 68,216,207,187, 67,195,150,163, 33, 54,115, 68,224,241, 19,136,126,113,168,131,134,138, 90,194,215,
-135,140, 82,177,194, 49,217, 41,226,128, 58,173, 58, 90, 55,104,220, 31,238, 45, 95,218,168,245,247, 19,150,116,175,183,142,107,
-164, 62,180,124,147, 52,183, 50,146, 5, 96,195,160, 65,131,134, 4, 5, 5, 89, 0, 64, 68, 68, 4, 50, 51, 51, 97,107,107, 11,
- 35, 35, 35,240,120,188,178,250,164,181,148, 49,187,118,237, 42, 35,109, 52, 77,151, 85, 1, 16,137, 68,248,250,235,175,209,188,
-121,115,156, 59,119,110, 76, 37, 68,203,183,109,219,182, 71,221,221,221, 93,203,127,168, 80, 40,224,231,231, 7, 0,232,216,177,
- 99, 87, 99, 99, 99,182,148, 16, 74,165, 82,249,179,103,207,186, 3,120, 82, 9,179, 84, 73, 36, 18,204,155, 55, 15,137,137,137,
-223,239,217,179, 39, 25,128,145, 64, 32, 40, 91, 31, 3,240,106,220,184,241,214,217,179,103, 35, 46, 46, 14,111,222,188,121,138,
-218,155, 82,245, 38, 38, 38,177, 58,157,174, 21, 77,211, 80,169, 84, 24, 56,112,160,209,153, 51,103, 50, 57, 28,206,219,156,156,
-156,145, 40,246, 73, 49, 84,140, 0,108,154, 50,101,202,212,249,243,231,227,214,173, 91,184,112,225, 2, 70,141, 26, 5,127,127,
-127,136,197,226,177,254,254,254,143, 80, 92,208,252, 67,233,186,107,215, 46,232,245,250,143,158, 13, 35, 35, 35,248,250,250,162,
- 81,163, 70,184,112,225, 66,215, 79, 32, 90,238,190,190,190, 2,134, 97,160, 80, 40,112,247,238, 93,177,177,177,177,216,197,197,
-101, 34,128,255, 25,162,229,238,238, 62, 37, 40, 40, 72, 92,222,250, 35, 20, 10, 81,238, 62,248, 44,127,191, 70,171,202, 21, 86,
-153,104,181, 74,138,203, 37,223, 58, 57, 54, 61,121, 47,100, 70,153,233, 16, 32,223,106,181, 74, 10, 0,244, 12,139, 66, 37, 13,
- 99, 33,137,164,140, 34,188,142,207,169, 8,234,189, 16, 77,158,177, 27,132,109,146,192,178, 44,180,148, 30,154,130, 12,172,189,
-172, 68, 84,154, 26, 90, 69, 62,180, 84,177, 27,150,141,141, 13, 55, 56,248,234,236,155, 55,111, 79,253,237,183,223, 56,105,230,
-230,111,138,128, 22, 21, 97, 90, 90,122,152, 50, 2,193,201,221,123,150, 26,179,156,120,196,164, 40,208,192,165, 13,108, 44, 92,
-145,145,163,192,195, 55, 87,240,246,221, 37,212,115,116,135,255,204, 94, 70,171,214, 28, 59,193,167,235,186,201,100,137,133,149,
-181,179,116, 21,181,247, 90, 12,232,188,120,232,115,227,160, 47, 74,255,232, 11, 98, 91, 55,180,236,236, 12, 91,215,250,194, 49,
-254, 43, 71, 3,239, 17,173,242,152,153, 4, 65,238, 38, 73, 98, 42, 65, 16,104,218,180, 89,218,166, 77,155, 42, 74, 5, 78, 53,
-109,218, 44,141,195, 33, 93,138, 7,118,114, 23,203, 50,153,213,180,243, 61, 82, 35, 16, 8,231, 23,171,253, 29, 83, 47, 95,190,
- 76, 13, 25, 50, 4, 27, 55,110, 20, 44, 88,176, 96, 49,135,195, 25, 95,129,121,239, 61,204,129,128,155, 69,253,250, 61, 86, 63,
-124,200,242,116, 58, 34,239,233,211, 66,153, 84, 74,103, 20, 21, 9, 78,189,125,251,205,132, 31,126, 16,184,186,186,226,193,165,
- 75,214,217, 10, 5, 43,211,104, 84, 50,153,140,165,105,250,105, 37,152, 11,109,109,237, 68,129,129,129, 94, 83,166, 76,121, 41,
-149, 74, 23, 2,128,163,163,227, 90, 0,141, 0, 36,149,251, 12,123,246,156,144, 76,156, 56, 49, 38, 43, 43,107, 97, 85,237, 44,
- 39,141,237,108,237, 68,199,247, 30,126,101,101,106, 76,218,186, 56,145, 60, 11, 11, 46, 45, 48,230, 51,128,170,158,107,125, 19,
- 0,141, 43,249,237,135,152,132,177,177,241,217,223,127,255,221,142,199,227, 65,175,215,195,214,214, 22,137,137,137,144,201,100,
- 40, 42, 42, 66,194,219, 40,212,117,117,197,138,128, 5,142,211, 23, 4,156, 85, 42,149,173, 62,152,204, 62, 46,128,172,163, 62,
-210,236, 85, 84,197,224, 67,179,151,129,253, 94, 94, 18, 83, 82, 82, 32, 22,139,225,227,227, 35,126,248,240,225,253, 42, 72, 86,
-249, 34,192, 67,219,183,111,111,122,236,216, 49,180,106,213, 10,230,230,230,184,123,247, 46, 34, 34, 34, 64, 81, 20, 41,151,203,
- 33, 22,139,177,110,221, 58,184,185,185,161,168,168, 8, 73, 73, 73,214, 60, 30,207,230,131,140,246,101,152,119,131,239,174, 42,
-136,187,179, 36,131,184,214, 43,240,248, 9, 76, 28, 62, 12, 14,108,252,125,243,250,196,170, 30,253,218,255,200,114, 92,251,154,
-152, 54,181,244,244,233, 7,190, 64,140,233,243, 87, 34, 38,242,162,165,178,232,213,247,132, 62,213,117,249,166, 83,179, 42, 56,
-119, 2, 0,233,234,234, 58,225,212,169, 83,166,101,170, 23, 14,167,172,230, 97,249, 34,240, 85, 20,124,175,246,122, 18, 4,129,
-196,196, 68,216,217,217, 65, 44, 22,151, 21, 16,143,138,138,194,227,199,143, 81, 90,141,162, 18,204,145, 55,111,222,116, 53, 49,
- 49,121,239, 11, 44,203, 34, 39, 39, 7, 52, 77, 67, 36, 18, 65,175,215,131,162, 40,232,116, 58,168,213,106,113,163, 70,141,166,
-233,116,186, 39, 21, 97, 50, 12, 51,103,232,208,161,237,159, 60,121,226,177,109,219, 54,104,181,218, 13, 25, 25, 25, 24, 60,120,
- 48, 24,134, 65,215,174, 93,219,177, 44, 27,189,120,241, 98, 0,192,236,217,179,117, 10,133, 98, 74,109,206,189, 68, 26,181,108,
-217,210,227,214,173, 91,232,208,161, 3, 52, 26, 13, 54,110,220,104,182,103,207, 30,179,195,135, 15,219,206,159, 63,255, 64,118,
-118,118,207,106, 48, 9, 0, 27, 28, 28, 28,166,118,234,212,201,184,164,134, 41, 14, 29, 58,132, 21, 43, 86, 4, 1, 88,124,245,
-234,213,101, 23, 46, 92, 24, 61, 97,194, 4,172, 88,177,194, 95, 38,147,237,175, 12, 51, 33, 33, 1,182,182,182, 48, 51, 51, 43,
- 30, 44, 41, 10, 97, 97, 97,184,113,227, 6,190,248,226, 11, 67,206,169,178,118,186, 15, 26, 52,232,192,241,227,199, 77, 83, 83,
- 83,113,239,222, 61,212,173, 91, 23, 74,165,210,144,218,176, 55,255,132, 9,187, 82, 76,149, 74,165, 78, 73, 73, 17,175, 95,191,
- 30,142,142,142,112,119,119,135,145,145, 17, 8,130,128, 78,167,171,170,188, 90,181,237,236,216, 17,220, 28,137,229, 0,115, 11,
-203,239, 89,150,229, 22, 20,228,239,165, 32, 59, 29, 31, 15,237, 95,120,238,255,100,105, 1,224, 37,222,175,121, 40, 45, 35, 90,
-151, 46, 93, 98,251,246,237, 75,148,110,157,157, 81,152,147, 99, 25, 99,231,208,228,132,157, 67,227,146,186, 95,228, 91, 14,199,
- 50,198,222, 94, 89, 8, 0, 20,205, 34,244,173, 12,175, 98, 51, 16, 17,155, 1, 19,161, 97,202, 23, 13, 69, 23,123,172,178, 44,
-212,242,255, 46, 90, 41,101, 62, 52, 84,177,187,135, 86,163, 68, 65,246, 27, 98,200,192,238, 70, 83,167, 78,134,163,163,179,109,
-101,120,148,208,200,127,250,236,111, 44,172, 44,120,184,244,240, 26,218,125, 49, 16, 70, 66, 30,114, 11,212, 0, 1,188,139,191,
- 1, 48,166,136,140, 73, 65,219,198, 34,244,236,225, 45, 62,119, 58,250, 7, 0, 75, 13,105, 47,157,246, 20,124,207,222,224,233,
-117,208,229, 68,131,145, 37, 3, 38, 14, 80, 17, 98,228, 74,147,241,246,254, 25,131,214,140, 12,195,124,111, 99, 99, 35, 91,188,
-120,113,167, 6, 13, 26, 80,211,166, 77, 11, 79, 78, 78,158,243,193,106,229,151, 93,187,118, 33, 54, 54, 86,178,122,245,234,187,
- 57, 57, 57, 75,106,216,209, 1, 44,139, 45, 37,166,184,156,243,231,207,183, 12, 9, 9,241,223,178,101,139,253,140, 25, 51, 4,
- 51,102,204, 24, 7,224,167,170,204,133,133, 66, 97,183,213,247,238,177,116, 90,154,230,200,246,237,130,157,161,161,139, 41,134,
-113,178,177,179, 35,190,106,219, 86, 33, 34,201,156,220,204, 76,218,214,195,131,147,120,227,134, 53,107,108,156,126,245,234,213,
- 66,185, 92, 94,105,233, 28, 14,135,163,172,200, 92, 88,145, 56, 58, 58,106, 43,242,225,170, 98, 66, 44,100, 88,150,178,168, 87,
-143,237,209,245,203, 6,177,209,241,241, 70, 22, 22, 28,207, 6,117, 27,190,126,155,248,148,213,235,213, 4, 65, 20, 26,100, 43,
-225,112,134,109,217,178,165,137,153,153, 25, 24,134,129,185,185, 57,178,179,179,161,213,106, 81, 88, 88, 8,109, 81, 1,180, 5,
- 5,136, 72, 78, 68,251, 78,157, 48,164, 87, 15,239,195,231,127, 31,166,215,235,131,170,180,231, 53,109, 81,166,201, 90, 89,199,
-250,191,182,160, 84, 89, 25,233, 90,223,194, 19,124,177, 24,221,231, 4,124,202,131,254,242,242,229,203, 87, 6, 13, 26,244,205,
- 15, 63,252, 64, 74,165,210,107,137,137,137,237, 1,188,169,234, 71, 98,177,184,126, 78, 78, 14,228,114, 57,204,205,205,177,101,
-203, 22,216,219,219, 67,169, 84,226,217,179,103,172,139,139, 11,113,247,238, 93,184,184,184, 32, 55, 55, 23, 20, 69, 65,165, 82,
-101,104,181,218, 74,205,229, 37,230,193,222,179,123,225,106,244,139, 67, 29,156,137,132,103, 67,231,118,140,141,142,120,155,114,
-253,198,195,159,104,181, 81,170, 44,237,230,130,122,173, 95,218,124, 63,111, 5,118,108, 88,134,232, 39,247,242,236,221, 10,119,
- 26, 19,154,131, 85,181, 87,161, 80,168,223,190,125,107, 26, 30, 30, 14,130, 32, 96,110,110, 14,145, 72, 84, 33,217,170,133,144,
-229, 53, 80, 10,133, 2,124, 62, 31,214,214,214,216,191,127,127,217,196, 91,183,110,221,170, 48,246,118,239,222,125,152,155,155,
-155,105,249, 15, 91,183,110,141,201,147, 39, 99,247,238,221, 8, 13, 13,125,175,158,102, 70, 70,134, 84,167,211, 85,117,222,178,
-204,204,204, 94, 3, 7, 14,124,113,255,254,125,179,253,251,247,131,166,233, 10, 95,129,129,129,120,252,248,241, 82, 0,111,107,
-121, 31,125, 49,120,240,224,123, 71,143, 30,181,200,206,206, 70,233,189,161, 80, 40,160,215,235,209,176, 97, 67,130,166,233,234,
-252,222, 72, 14,135,115,126,251,246,237,253, 38, 78,156, 8, 46,151, 11,173, 86,139,237,219,183, 99,193,130, 5,153, 37,139, 82,
- 10,192,226,131, 7, 15,142,238,223,191, 63,154, 53,107,230,125,231, 78,229,158, 29,114,185, 28,114,185, 28, 60, 30, 15, 14, 14,
- 14, 88,181,106, 21,180,218,226, 97,197,203,203,171,236, 49, 6,176,215,203,203,171, 95, 76, 76,204, 70, 20,251,174,125, 36, 14,
- 14, 14, 3, 89,150,157,164,215,235,139, 58,116,232, 96,125,252,248,113, 83,137, 68,130, 23, 47, 94, 96,233,210,165,249, 12,195,
-232, 25,134, 33, 84, 42, 85,130,157,157,221, 11,161, 80,104,172, 84, 42,243,114,115,115,215, 0,184,246,119,205,228, 4, 65, 16,
- 60, 30, 15,227,199,143, 7,151,203,133,177,177, 49,212,106, 53,116, 58, 93, 25,153, 71, 13,205,210, 13, 26,136,173,185,224, 79,
-180, 52,109,228, 63,100, 86, 95, 91, 71, 39,103, 88,152, 9, 17, 21,245,166,253,237, 91, 55,182, 11,184,209,123, 24,173,110, 79,
-116, 82,193,159, 94,236,254, 67, 46,242, 15, 37, 90, 31,213, 60,228, 86,220,153, 67,244, 44,123, 42, 71, 34, 17, 80, 2,129, 40,
-166, 84,203,101,111,175, 44, 36,136, 33,122,219,198, 3, 64, 83,186,146,129,130, 45,121, 25, 72,180,116,122,196, 70, 71,226,254,
-245,223, 97,163,148, 32, 39,161, 57,192,111, 2,173,170, 0,106, 45, 85, 66, 74,244, 8,127,113, 11,133, 5,121,240,105,213, 23,
- 32,201,199,149,225,153, 91, 19,125,191,106,217,148, 19,155, 18,137,214, 94,223,193,195,165, 3,146,165,133,144,201, 53,200, 47,
- 84,163,185, 79, 0,178,243, 85, 40, 84,170,241, 38,246, 48,156,157, 60, 72,130, 27,223,213, 80,162,165,121,115, 22,154,183, 23,
-192,119,111, 15, 65,195,254,224,184,251, 34,229,213, 29,132, 95,221,140,180,215, 15,192, 50,122, 56,122,181, 49,244, 33,217,126,
-237,218,181, 54,237,219,183,231,118,235,214,173,217,149, 43, 87,154, 73,165,210,240, 18,130,209,172, 91,183,110,205,108,109,109,
-177,117,235, 86, 21, 65, 16,219,107,217,217,101, 26,176,172,172,172,167, 0, 86,159, 61,123,118,251,228,201,147, 97,103,103,215,
- 36, 61, 61,189,210, 31,102,243,120,205,198,172, 89,195,242, 56, 28, 54,104,199, 14,254,138,107,215, 54,253,118,240, 32,191, 75,
-231,206, 4,203,178, 8, 11, 11, 19,173,223,177, 67, 52, 98,192,128,164,228,172, 44, 58, 36, 52,148,146,166,165, 21,101, 41, 20,
- 43,164, 82,105,198,223,113,103,235,116,186, 71, 9,137, 9,206,173,218, 54,183,125, 25,149,240,186,103,151,175,190, 34, 73,146,
-140,142, 79, 14,181,181, 53, 19,221,184,126,131,210,233,116,143, 12,193, 18, 10,133,125,187,116,233,194,205,207,207,135,147,147,
- 19,178,179,179, 33,145, 72,138, 53, 14, 5,249,160, 10, 10,160, 43,148, 65,175,144, 35,225,217, 83, 52,247,168, 39, 60, 37, 20,
-246, 85, 42,149, 85, 18,173,210, 85,102, 69,133,174, 75, 63, 19,152,154, 66, 32, 22,131,168,185,217,112,128,133,133,197, 2,153,
- 76,118, 5,192, 42,138,162,166, 47, 88,176,160,245,182,109,219,108, 86,175, 94,109, 54,105,210,164, 83,114,185,188, 57,138,139,
-170, 86, 54,129,197,209, 52,109, 13,192,254,214,173, 91,176,179,179, 67, 65, 65, 65,169,166, 69,171, 84, 42,141,114,115,115,161,
-209,104,160,213,106, 97,102,102,134,231,207,159,231,209, 52,125,177,186,198,153,213, 39, 86,105,168,168, 37,214,222, 38,233, 20,
-109,217, 49, 43,143,201, 95,190, 73,186, 18,192,166, 94, 30, 30,129, 20,115, 47,225, 93,228, 69,203,196,103,119,243,210,223, 41,
- 60,246, 95, 73,168,202, 71,139, 5,192, 16, 4,193,122,121,121, 33, 59, 59, 27, 28, 14, 7, 34,145, 8, 98,177, 24, 11, 23, 46,
-196,246,237,219,107, 67,180,140, 76, 76, 76,214,144, 36, 57,140, 36, 73, 91,189, 94,143,128,128, 0,244,235,215, 15, 2,129, 0,
- 20, 69,149,105, 52, 75,181, 84,213,104, 58,194, 30, 63,126,108,246,248,241,123,195, 86,103, 27, 27,155,219, 26,141, 6,241,241,
-241, 56,127,254,124, 39, 0, 33, 53,236,235,248,176,176,176, 94,190,190,190,135, 90,182,108, 89,159,101, 89, 52,105,210, 4,126,
-126,126, 56,124,248, 48,194,195,195, 81, 80, 80,192,220,184,113,227, 55, 0, 27,107, 58,135,151, 92,223,134,131, 7, 15,126,112,
-236,216, 49,203,220,220, 92,168, 84, 42, 40, 20, 10,156, 58,117, 10,237,219,183,135,141,141, 13,142, 30, 61, 74,179, 44, 91, 85,
-223,147, 36, 73,238,223,179,103, 79,191, 9, 19, 38, 96,231,206,157, 8, 10, 10, 66,255,254,253, 49,108,216, 48,100,103,103,219,
-111,216,176, 97,116,137,153,112,153,159,159, 31,228,114, 57,158, 61,123, 22,101,224, 51, 15,153, 76, 6,153, 76, 6, 99, 99,227,
-242,207, 24, 1,224,240,230,205,155,135,251,251,251,195,195,195, 99, 89, 66, 66,194,102, 84, 16, 37,202, 48,204, 20,137, 68, 98,
-201,229,114,173,105,154, 70,106,106, 42,158, 63,127,142,239,191,255, 62, 47, 47, 47,111, 50,128,100, 0,139,199,143, 31,191,106,
-206,156, 57,101,247,210,156, 57,115, 46, 93,185,114,165,215, 95,173,205,241,242,178,104, 44,224, 8,103,229, 23,113,172,243,243,
-243,203,198, 14,173, 86, 11,141, 70,243,158, 38,139,207,231, 89,183,110,238,118, 89,165, 44, 90,244,230,157,172,210, 2,233,222,
-245,205,155,138, 76,204,253,219,119,232, 50,178, 71,175,111, 57,180, 78,135,224,224,139,248,245,215, 93,232,236,235, 5,143, 6,
- 77, 48, 99,230, 44,115,141,150, 14,184,113,227,218, 2,139,199,247,175, 21, 21,202, 22, 86,133,249,255, 92, 46,151,144,171,203,
- 21,154, 14, 43, 98,144, 37, 41, 28,242, 75,118,109, 44, 45, 45,119,232,245,250,206,102,102,102, 96,100, 49,120,243,252, 9,242,
-242,121,208,168,244, 96,216, 98,178,101, 16,113,209,104,113, 47,248, 2,182,108,222,132,220,220, 92,248,126,221, 9,114,174, 43,
-220, 92,221,160, 86, 41, 75, 30, 26,128,210,234, 96,107,239,142,151, 47,195,117,133, 10, 69,165, 3, 18,223,136,242,118,179,247,
-130,134,250, 18, 70, 2, 1, 10,138,180,200, 47, 33, 89, 71, 79, 15,133, 70,169, 2,173,165, 64,107,117,176,117, 27,140, 47,236,
-187,128,209, 95,108, 92,163,203,199,232, 65, 37,222, 3,149,120, 15,198, 95,206,196,239,107,135,127, 48,145, 26, 86,119, 55, 59,
- 59, 59,235,245,235,215, 23,195,194,194, 6, 14, 29, 58, 20,119,238,220,153, 4, 96,106,137,249,102,210,208,161, 67, 17, 22, 22,
-134,215,175, 95, 95,204,206,206,206,250, 35,122, 94, 32, 16,168, 52,154,226, 57, 86, 36, 18, 25, 85,243, 93,231,214,131, 6,145,
- 5, 47, 95, 22,110,126,248,112, 89,224,254,253,252,110, 93,187, 18, 58,154, 6,163,215,163,129,167, 39,209,163, 71, 15,147,195,
- 39, 79, 90,115,116,186,199,243,166, 79,191,181,123,212,168,162,167, 10,133,161,142,230,117, 74, 76,134, 0, 80,167,138,207, 12,
- 22,141, 70,179,109,202,196,177,221, 66,238, 61,112,117,115,117, 54, 11,190, 17, 18, 46, 52, 22,144, 30,117,235,115,242, 11,242,
-184, 43,151, 45, 50,214,104, 52,134,146, 86,111, 27, 27, 27,100,100,100, 32, 54, 54, 22, 26,141, 6, 58,157, 14,140, 82, 1,109,
-190, 12,218,130, 60, 16,106, 21,132,122, 61,212, 57,153,168,227, 81, 15,248,111, 68, 98,181,166,168,138,136, 86,233,214,200,204,
- 12,124, 19, 49, 72, 30,207,224,226,232, 0, 90,182,105,211,230,228,153, 51,103,248,227,198,141,107,123,243,230,205, 29, 0,146,
- 37, 18, 73,215,165, 75,151, 62,221,177, 99,135,112,242,228,201, 13, 55,110,220, 56, 26,192,222,202, 64,212,106,245,201,203,151,
- 47,143,112,119,119,183,143,136,136,128, 90,173, 6,195, 48,232,221,187, 55, 80,236, 91, 3, 0,136,142,142, 86,169,213,234,172,
-200,200,200,194,228,228,100, 10, 6, 68, 9, 46,223, 38,125, 84,152,113,111,144,189,131,243, 99, 35,227, 58,117, 89,249,203,129,
-179,191,115,222,176,249,180, 68,125, 45, 62,190,104, 73,247,122,235, 20, 69,175,190,183,112,145,239,188,118, 41,193, 16, 71,248,
-178,232, 66,107,107,107,112,185, 92,240,120, 60,240,249,124, 16, 4,129,153, 51,103, 98,223,190,125,213,153, 14,223, 35, 89,166,
-166,166,175, 87,172, 88,225, 50,121,242,100,190,145,145, 17,242,243,243,113,244,232, 81,140, 31, 63, 30,191,254,250,107,133,254,
- 47, 6,152,148, 62,212,150,250,143, 26, 53, 10, 90,173, 22,126,126,126, 8, 12, 12,244,215,235,245, 33,181,120,164, 31,135,135,
-135,123,134,135,135,155, 1,232, 63,108,216,176,131,131, 7, 15, 70, 72, 72, 8, 46, 94,188,216, 9,197, 65, 31, 42, 0,107, 1,
-216,149,108,171,122, 62, 77,236,237,237,119, 49, 12,211,223,214,214, 54,220,203,203,203,231,216,177, 99, 22, 89, 89, 89,165,193,
- 15, 72, 76, 76,196,129, 3, 7,164,251,247,239, 47,212,235,245,214, 36, 73, 94,150,201,100, 11,171, 32,108,251, 55,111,222, 60,
-182,196, 28,136, 51,103,206,176,155, 54,109, 34,150, 46, 93,138,252,252,124,116,238,220, 25,123,246,236,153, 37,151,203,155,109,
-218,180,105,226,144, 33, 67,176,114,229, 74, 40, 20,138,205,213, 45, 86,170, 32, 95, 4,128,175, 54,111,222,236,238,239,239,143,
- 51,103,206,160,101,203,150,198, 9, 9, 9,187, 1, 76,168,168,255, 88,150, 69, 66, 66, 2,148, 74, 37, 30, 60,120,128,101,203,
-150,229,151, 35, 89,179,166, 78,157,186,106,214,172, 89, 88,179,102, 13, 27, 17, 17,145, 53,120,240, 96,251,125,251,246,113, 26,
- 52,104, 48, 75,169, 84,254,101, 68,171, 97, 3,171,117,173, 91,118, 88,224,232,220, 0, 71,143, 29, 71, 94, 94, 94,217, 53, 41,
-189, 46, 44,203,162,168,168, 8, 25, 25, 25, 48, 55, 51,197,134,141,171,190,153, 54,105,172, 43,138,211, 96,124,172,178,244,176,
-220, 56,120,216,184,185,126, 35,198, 34, 34,252, 5, 14, 31,220,139,200,136,176, 50, 60, 90, 71, 33, 38,234, 57, 98,162,158,195,
-222,193, 29, 61,186,117, 34,134, 15, 31,222,123,212,136, 97,182, 0,254,180,212, 17,255, 96,109, 22,240,113, 30,173,125,239, 17,
-173,106,212,117, 54,150,150,150,175, 79,156, 56, 97,237,235,235,203,161,105, 26,215,130,131,241,253,212,255, 96,244,168, 0, 80,
-176, 4,173,229,131,225, 27, 25,212, 18,149, 74, 9, 22, 44, 20, 10, 5, 66, 67, 67,193, 50, 52, 14,239,219, 4,150,101,202,136,
- 22,192, 66, 75, 81,112,118,107,136, 93,129,171,105,240,120, 79,161,171, 56,117, 77, 97, 46, 71,175,163, 89, 72,178, 82,144, 34,
-141,132,185,169, 27,184, 60, 55,228,202,148,224,146, 14,208,169,163,161, 47,249,173, 82,145, 6, 21,245,105,253,167,175, 64,123,
-202,214, 96,208, 85,169, 84, 71,142, 28, 57,242,205, 47,191,252, 34,232,211,167,143,215,233,211,167,191, 2,128, 62,125,250,120,
-153,153,153,225,200,145, 35, 90,149, 74,117,228, 15,212,248,116,105,211,166, 13,242,243,243,145,152,152, 24, 94,229,185,105,181,
-214, 98, 59, 59, 78,214,157, 59,186,236,252,124,215, 46, 93,186, 16, 58,154, 6, 73, 16,200, 43, 40, 64,114, 82, 18, 44, 44, 44,
-136,215,209,209,226,237, 51,102,156,243,242,241,225,150, 70, 36, 26, 34, 23, 47, 94, 20,161,216, 47,171,202,207,106, 40,138,172,
-204,140,177,211,167, 79, 63,119,228,200, 81,243,204,172,204, 24,161, 64, 64,139,197, 70, 78,163, 70, 78,227,202,100,178, 17, 0,
-228,134,130,229,231,231, 35, 33, 33, 1,198,198,198,224,243,120, 96, 84, 74,232, 21,114,168,243,178,193,161,180, 16,232,245,176,
- 18, 9,225,106,111, 15, 55, 91, 27,131, 48, 99,111, 95, 47,115,124, 47,111, 46,220,208,198, 27, 2, 19, 49, 4,166, 98, 76,187,
-116,183,100, 53,202, 7,150,254,100, 8,172,141,179,179,243,239,199,142, 29,227,103,103,103, 35, 44, 44, 44, 28, 64, 1, 0, 83,
- 0, 76, 84, 84,212,205,200,200,200,190, 37, 81,119,213, 69,139,109, 58,123,246,108,119, 95, 95, 95,186,110,221,186, 38, 89, 89,
- 89,174,249,249,249,140, 84, 42,125, 79, 37,116,253,250,117, 97, 81, 81,145,130, 97,152,115, 37, 36,171,218,252, 69,179,191,115,
- 54, 10,125,137,153, 29,123,214,105, 98,102,211, 20,121,244,203, 38,143,195,165, 51,103,127,231,188,109,243,105,137,218,152,208,
- 28, 36,244,169,174, 92, 35,181,161, 78,204, 44, 80,236, 43, 21, 26, 26,138,228,228,100, 36, 36, 36,188, 71,168, 38, 77,154,132,
-195,135, 15, 27,164,209, 50, 49, 49, 89,179,124,249,114, 23,127,127,127,126, 57, 82,132,233,211,167,163,160,160, 0,129,129,129,
-152, 62,125,122,141, 39,254, 15,164, 94,151, 46, 93,250, 56, 58, 58, 34, 55, 55, 23, 14, 14, 14,240,245,245,237, 23, 18, 18, 82,
- 23, 64, 98, 45,239,251,105, 61,123,246, 92,181, 98,197, 10,232,116, 58,140, 31, 63, 30,239,222,189, 59,249,238,221,187, 45,110,
-110,110, 51,231,207,159,111,111,111,111,143,161, 67,135,154,208, 52, 61,168, 50, 16, 43, 43,171,181,123,247,238, 29,209,167, 79,
- 31,146,162,168,175,111,223,190,141,164,164, 36,104,181, 90,208, 52,141,184,184, 56, 76,159, 62, 93, 90, 18,221, 24,103, 64,187,
-198, 45, 94,188,120,236,204,153, 51,177,126,253,122, 44, 95,190,252, 55,115,115,115,159,230,205,155,183, 88,190,124, 57,230,205,
-155, 7,119,119,119, 88, 91, 91,127,177,116,233, 82,239, 57,115,230, 96,219,182,109, 88,182,108,217,111, 0, 14,212,230, 66, 48,
- 12, 67,172, 91,183,174,217,230,205,155, 29, 75, 73, 22, 73,146, 56,113,226, 4, 94,190,124,217, 47, 62, 62,190,162,223,236,113,
-112,112,152,228,232,232, 40,184,113,227,134,216,221,221, 29, 52, 77,235, 74, 72,214,118, 55, 55,183,239,227,226,226,208,167, 79,
- 31,196,199,199, 31, 1, 48,218,220,220, 92, 49,103,206, 28,145,177,177,177,185, 82,169,252,171, 38,111,112, 72, 98,204,154,149,
-243,240,236,101, 52,206,158,229,227,217,179,103,176,183,183,135, 80, 40, 4,203,178,208,104, 52,200,206,206,134,142,210,160, 73,
-227,122, 56,180,127, 29,178,178,178, 1,146,168,212,229,134, 32,137,145, 99,255, 51, 16,247, 31, 4, 99,247,238,189,144,203, 21,
-149, 44,190,141,208,192,203, 27,206, 78,118, 72, 77, 75, 5, 65,194,230,207, 60,215,127,184,233,176,108, 8,130, 33,233, 29,202,
-139,133,133,197,150,160,160, 32,235,206,157, 59,115, 20, 10, 5, 24,134, 65, 7, 95, 95,204,244,247,199,197, 99,199,224,217,214,
- 15,132, 86, 12, 90,100, 88,212,131, 90,165, 68,163, 22, 95, 97,200,208, 97, 72, 73, 78, 70,207,190,131,161, 86, 43,203, 86, 24,
-165, 26, 45,173,150,130,141,157, 43,174, 95,191,206,193,248,241,111,176,189, 98,165,132,158, 18,188,138,137, 83,183,151,169, 94,
- 34,244,217, 97, 80, 26, 10, 77,154, 44, 5,197, 88,195,206,101, 18,116,186,243, 40,204,190, 93,108,198,176,238,140,180,148, 20,
-144, 28,254,235,218, 94, 65, 70,145,253, 73,131,110, 65, 65, 65, 65, 66, 66,194,233,208,208,208,145,131, 6, 13,194,245,235,215,
- 39, 2,192,160, 65,131, 16, 26, 26,138,132,132,132,211, 5, 5, 5, 5,127, 68,111, 59, 58, 58,246,239,212,169,147, 95,235,214,
-173,113,233,210, 37,176, 44,123,223,160, 7,155,199, 99, 73,146, 4,195, 48, 32, 0,228,202,100,120,247,238, 29,114,115,114,160,
-211,233,160,144,203, 25,111, 47, 47, 57,203, 48,166, 53,105, 79,249, 8, 67, 84, 16,117, 88,250, 89, 45, 78, 53,249,233,227,135,
- 41, 69,114,185,173,165,133,101,145, 64, 32,208,231,203,100, 5,111, 94, 71,104, 13,156, 28, 74, 37, 42, 50, 50,210, 39, 61, 61,
- 29, 41, 41, 41,160, 21, 69,224,104,180, 32, 53, 74,116,253,234, 75, 24,131,133, 17, 24,240, 24, 29,120, 28, 30,138,138,163,243,
-170, 53,119,232,203, 45, 18, 74, 73, 22, 65, 16,197,230, 66, 19, 19, 8,196,166,239,105,184, 12,185,159,132, 66,225,177, 83,167,
- 78, 57, 58, 59, 59, 99,229,202,149,112,113,113,249,194,201,201, 73,105,110,110,110,108,111,111,143, 70,141, 26,225,171,175,190,
-194,213,171, 87, 97,192, 53,160, 89,150,237,113,255,254,253,185, 15, 31, 62, 28, 98, 98, 98, 66,204,152, 49,131,219,187,119,111,
- 8,133, 66, 40,149, 74,228,231,231,227,248,241,227, 57, 12,195,148, 6,165, 88,139, 68,162, 3, 4, 65, 36, 42, 20, 10,255, 15,
- 1, 15,253,210,196, 41, 43,143, 25,207,202, 69, 3, 59,246,172,211,164, 75,207,110,168,231,217, 5, 93,122,166, 0,192, 58, 43,
-110,146,223,207,139, 45,206, 89,152, 18, 7,174, 95,187,177,204,183, 99,151,197, 11,228,119, 86,173,223, 39,171,214,159,142, 32,
- 8, 48, 12,243, 94,238,160, 15,143,143, 30, 61, 26, 39, 78,156,168,246, 58,146, 36, 57,108,242,228,201,252, 15, 52,207,144, 72,
- 36,232,219,183, 47, 6, 13, 26,244, 30,209,178,177,177,129,131,131, 3,146,146,146, 0, 32,215,192,251,106,230,184,113,227, 8,
-149, 74,133, 9, 19, 38, 32, 48, 48, 16,126,126,126, 68, 72, 72,200, 76, 0,254, 53,189,217, 73,146,220, 48,127,254,252,185,211,
-167, 79, 71, 94, 94, 30,174, 92,185,130,222,189,123,227,196,137, 19,182, 87,174, 92, 89,211,185,115,103,112, 56, 28, 92,186,116,
- 9, 52, 77, 87,153,235,139,207,231,247,239,211,167, 15,153,154,154, 10, 62,159,143, 86,173, 90, 33, 45, 45, 13, 74,165, 18, 18,
-137, 4,179,102,205,202,200,205,205,237,100,232,115,196,231,243,253,103,206,156,137,160,160, 32, 4, 4, 4, 28, 4, 48,161,160,
-160, 96,200,195,135, 15,131, 6, 12, 24, 0,137, 68,130,115,231,206, 97,217,178,101,196,232,209,163,177,115,231, 78,204,154, 53,
-235,183, 18,173, 83,101, 55,126, 81, 86, 86,150,121,253,250,245,145,153,153, 9,185, 92,142,115,231,206,217, 93,189,122,181,174,
-179,179,179, 89, 66, 66,130,254,167,159,126, 18,248,251,251, 99,203,150, 45, 8, 11, 11,195,225,195,135,209,165, 75, 23, 58, 62,
- 62,190, 66, 45, 89, 73,202,134,115, 44,203,222, 48, 49, 49, 65, 81, 81, 81,233,115,247, 67, 64, 64,192,244,181,107,139,149,236,
-233,233,233, 24, 51,102,204,168, 91,183,110, 49,157, 59,119, 22,241,249,124,168,213,106,197, 95, 57,107, 51,122, 6, 0,131,186,
-174, 98, 4, 95,220,143, 23,225,241,120, 17, 30, 9,129,176,216, 9, 94,165, 82,162, 69,147, 6,104,219,170, 13,210,165, 18, 28,
- 57,188, 31, 86, 54,206, 85,142, 35, 44,203,130,207,213,195,219,203, 1,199, 14,239,197,165, 43,183,112,248,200,241, 50,159, 55,
- 46,151,135,230, 45,218,162, 85, 43, 95,196, 39,196, 97,255,254,221,176,181,115,253,108, 28,172,165,148,153, 14,203,111, 63, 96,
-254, 93,124,125,125, 57,114,185, 28,106,181, 26, 25, 25, 25, 72, 74, 74,130,133,165, 5,226,211, 19,209, 73, 68, 33,131, 41, 68,
- 84,248,107, 61,193,225,133, 85,247,135,125, 58, 54, 7, 58, 54,199,247,227,252,170, 88,178,178, 48, 49,179, 41, 54,221,208,116,
- 44,182,109,163, 43, 35, 90,180, 94,119, 51,248,198,237, 54,227, 70,247,231, 93,191, 29, 8,157,150,129, 74,103, 14,133, 90, 11,
- 5,197, 3,105,222, 27,200, 9, 1,135, 43, 68,187,102, 13,112,238,236, 85,138,165,117,183, 12,190, 64,246, 62,160, 51, 35,203,
- 17,173,172, 15,236, 14, 86, 6,155, 14,203, 38, 94,189,254,196,209,163, 71,191,253,242,203, 47, 69,157, 59,119,174, 95, 50,113,
- 82, 71,143, 30, 85,150, 36,195,172,169,188,151, 13,222,193,193,161, 5,159,207,247,235,221,187,119,139,177, 99,199,226,205,155,
- 55, 56,114,228, 72, 76,131, 6, 13,238, 72,165,149, 71,100,115, 4,130, 92,121, 86,150,133,184,110, 93,174,165,169,105,250,213,
- 43, 87,220,187,117,239, 78,164,164,164, 32, 55, 55, 23,106,181, 26, 97,225,225, 44,143,195, 73, 35,204,204,200,232,151, 47, 73,
-142, 64,144, 91,153,182,177, 2, 73,170, 38,234,112,109,109,181, 91,174,142,150,245,151, 5, 76,169,167,214,168,125, 10, 11, 11,
-105, 46,143,199,115,113,176, 72,142,142, 51,124, 76,212,104, 52,151,110,222,188,249,109,183,110,221,132, 49,175,194, 64, 23, 20,
- 64, 91,144, 15, 62,163,135, 85,139,102,224, 80, 26, 64,171,131,179, 55, 11,181, 76,132,144, 39,209, 58,141, 70, 83,109, 82,195,
- 82,162, 69,126, 64, 12, 4, 98, 49,132,166,102, 16,138,197, 31, 18,134,234, 86,114,162, 30, 61,122,116,109,215,174, 29, 88,150,
-197,190,125,251, 64, 81,148,128,162, 40,104,181, 90, 80, 20,133,194,194, 66, 28, 62,124, 24,187,118,237,122, 8,224, 55, 3, 78,
-159, 54, 54, 54, 30, 64, 16,132, 29,151,203, 85,218,218,218,154,156, 56,113,162, 44,221, 68,243,230,205, 97,106,106,202, 71, 73,
- 82, 72, 59, 59, 59,222,175,191,254,106,209,175, 95,191,123, 21,154, 59,154,124, 49,175, 30,109,217,209,200,184, 78, 93, 51,155,
-166,168,231,217, 5, 0,208,189,239, 56,212,107,224,134,194,156, 87,117,213,170,164,129,124,110,190,229,235,109,146, 55,198,125,
-124,198, 42,178,238,190, 67,197,225,253, 21, 78, 20, 36, 73, 86,106,142, 53,132,100, 21,115, 22,210,182,212,207, 7, 0,114,115,
-115, 33,149, 74, 17, 21, 21,133,134, 13, 27, 34, 47, 47, 15,206,206,206,208,106,181,104,221,186, 53, 84, 42, 21, 54,111,222,140,
- 7, 15, 30, 60, 4, 48,203,128,255, 48,246,244,244, 28,211,162, 69, 11, 92,185,114, 5,207,158, 61,147, 4, 7, 7, 59,251,250,
-250,162,110,221,186, 99, 19, 19, 19, 23,149,152,250, 12, 21, 19, 95, 95,223, 25,211,167, 79, 71,100,100, 36,166, 76,153,146,155,
-154,154,122,238,228,201,147, 19,150, 45, 91, 70,246,236,217, 19, 82,169, 20, 27, 54,108,208, 63,120,240, 96, 35,128,149,213, 92,
-199,183,169,169,169, 46,106,181, 26,121,121,121,160,105, 26, 74,165, 18, 87,175, 94,197,225,195,135, 51, 75, 72, 86,172,161,141,
-107,214,172, 89, 35,146, 36, 17, 20, 20, 4, 0, 75, 80,156,177,255,220,192,129, 3, 37, 63,253,244,147,243,194,133, 11, 49,113,
-226, 68, 80, 20,133,245,235,215, 99,225,194,133,151, 75, 72, 86, 85,131,232, 47, 14, 14, 14,147,166, 76,153,242,197,156, 57,115,
- 16, 26, 26,106,247,252,249,243, 86, 97, 97, 97,112,117,117, 69,110,110, 46,215,218,218, 26, 91,182,108,193,236,217,179,207, 0,
-200,121,244,232,209,176,132,132,132,181, 0, 54, 84, 67,218,247, 56, 59, 59, 79, 98, 89,150, 85, 42,149, 73, 1, 1, 1, 27, 86,
-175, 94,141,217,179,103,227,245,235,215, 40, 40, 40,128,169,169, 41, 49,127,254,252, 49, 75,150, 44,193,248,241,227, 89,133, 66,
-177,235,175,158,168, 89, 86, 15,101,126, 36,244, 26, 75, 52,111,210, 16,205,125,234, 32,248,246, 11, 0, 64,215,193,190, 80, 42,
-138,112,240,224, 62,196,198,190, 3,151,199,131,133,149,131, 33,154, 64,104, 11,223, 66, 70, 73,209,173,115, 43,244,238,217, 9,
-191, 29, 58, 1, 90, 71, 97,194,184, 17,200,151,201,112,232,208,126,196, 39,196,129,203,227,193,218,230,207, 79,132, 90, 21, 23,
-249,199, 19, 45, 3,204, 79, 96, 24, 6, 18,137, 4,207,159, 63, 71, 98, 98, 34, 68, 34, 17, 84,180,158,217,125,243, 1, 67, 16,
-252, 52,134,101, 31,178,116, 89,150,226,143, 49,244,122, 73,185,140,181,230,150,150,150, 2,141, 70, 5,154,214,149,155, 85, 8,
-128, 0,248, 92,192,209,169, 30, 82, 83, 82, 89,181, 90,125,183,202, 21,148, 70,189,229,194,185, 83,211,191,106,239,107,211,187,
-235, 10,156, 59,191, 20,249,133,133, 80, 83, 60, 40,212, 20,148,106,192,194,202, 11,173,155, 52, 69,122,122, 46, 94, 61, 11,145,
-115, 53, 74, 67, 28, 69,223,109, 95, 60,206,115,220,247,243, 96,236,222, 30,154,168,115, 96,228,153,101, 26, 45, 35,177, 37,172,
-220,188, 33, 83,104,112,234,214, 11,160, 6,165, 94,178,178,178,148, 28, 14,231,232,244,233,211,215,191,120,241,220, 5, 0, 94,
-188,120,145, 38,149, 74, 23,100,101,101,213, 84, 39, 93,154, 13,158, 48, 50, 50,126,209,160, 65,131,244, 86,173, 90,153, 15, 28,
- 56, 16, 54, 54, 54, 8, 11, 11,195,218,181,107,223, 82, 20, 53, 47, 36, 36,164, 74, 83,143, 86,171,149,188, 56,127,222,172,211,
-127,254, 99, 49,175, 95,191, 13,211,167, 79,223,178,114,229, 74,158,167,167, 39,161,163, 40, 68, 68, 68,176,199,142, 30,213,237,
- 90,184,112,179,192,196,132,251,244,194, 5, 58, 60,122,154, 0, 0, 32, 0, 73, 68, 65, 84, 30,173,209, 72,254,238,155,216,217,
-217,185,163,239,215, 29,188, 55,254,178, 13,106,149, 28, 79, 66, 47, 35, 63, 63, 27,123,247,157,245,118,118,102, 59, 74, 36,146,
- 16, 67, 9,240,129, 3, 7,230,182,109,209,162,133,135,171, 43, 34,146, 19, 33, 96,244,224,211, 52, 56,148, 6, 36,173,134,171,
- 15, 11,130, 52,133, 52,163, 16,171,131, 78, 71, 26, 66,140,191,248,166, 63, 86,166, 21,128, 32, 8,108,250,210, 7, 2, 83, 49,
-248, 38, 98, 76,251,253,118, 25, 49,184,180,114, 33, 4, 98, 49,234,183, 53, 40, 33,188,242,206,157, 59,207, 35, 34, 34, 90,251,
-248,248, 96,238,220,185, 72, 74, 74, 2,195, 48,200,204,204, 84, 75,165, 82, 73,118,118,118, 18,138,243,255, 4, 86, 51,137,149,
-103, 29,206, 33, 33, 33,101,230,134, 91,183,110,193,201,201, 9,230,230,230, 40, 44, 44,196,228,201,147, 45,126,252,241, 71, 0,
-192,243,231,207, 81,158,160,124, 40, 17, 47,162, 54,202,138,216,124, 86,254,114, 96, 30,253,178, 73,151,158,169,232,222,119, 44,
-110, 92,250, 13,183,131,111,194,138,155,148, 8,147,162,171, 57,137, 57,133,105, 10,207, 61,222, 45, 39,112,164,138,224, 61, 51,
-250,199,112, 28, 29,153, 83, 11,119, 23,202,170,106,171,167,167, 39,236,237,237,203,124,180,184, 92, 46,198,143, 31, 15,150,101,
- 13, 37, 89, 37,115, 13,147,173, 86,171,237,141,140,140,144,145,145,129,184,184, 56,196,199,199,151,165, 14, 96, 24, 70,247,195,
- 15, 63,240,102,204,152,129,221,187,119,227,238,221,187, 15, 1,172, 0, 96,232, 98,109,196,208,161, 67, 77,181, 90, 45,142, 31,
- 63, 78, 3,232,123,234,212,169,231,173, 91,183,230,246,234,213,203,116,231,206,157, 35, 74,250,200, 96,162,101,102,102,198,167,
- 40, 10, 59,119,238, 68,106,106,106, 71, 0, 81, 79,159, 62,221, 51,116,232,208, 93, 62, 62, 62, 13, 34, 35, 35,223,201,229,242,
-105, 0, 94, 85, 7,150,153,153, 57,174, 85,171, 86,167, 24,134,113,239,214,173,155,201, 47,191,252, 98, 22, 29, 29, 13, 23, 23,
- 23, 48, 12, 19,129, 26,150,176,122,247,238, 93,148, 84, 42,245,238,212,169, 19,174, 94,189,186, 78,175,215,175, 1,176,126,234,
-212,169,206,201,201,201,104,209,162, 5,172,172,172, 16, 29, 29, 93, 36,149, 74,119,161,184, 36, 81,117, 42,220, 4, 0, 11,246,
-236,217,211,116,207,158, 61,126, 86, 86, 86,237,194,194,194,112,255,254,125,108,220,184, 17, 63,254,248, 35, 58,116,232,128,185,
-115,231,230, 0,240, 3, 64, 39, 36, 36, 24,148, 55,175, 84,179, 5, 0, 45, 91,182, 76, 95,187,118, 45, 38, 76,152,192,254,250,
-235,175, 91,143, 30, 61,234, 63, 98,196,136,178, 57,112,204,152, 49,236,145, 35, 71,198,160,184, 12,211, 95, 41, 58,138,210,194,
-204,170, 30,228,178, 20,100,167,134, 66,100,234,128,158, 93,154, 65,169,210,226,226,133, 51,120, 21, 17, 14,146, 36, 97,239,224,
- 10, 11, 75, 27,196,196,188, 3,170,142, 54,214, 81, 20, 5, 83,203, 58,144, 23,164, 66,155,245, 2,198, 98, 59,140,253,207, 64,
- 40, 85, 20,206,158, 59,131,200,200, 87,224,112, 56,112,112,116,133,185, 69, 49, 38,193, 86, 29,193,252, 89, 0, 84,144, 79,171,
- 90,162,197,225,112,238, 92,187,118,237,187,182,109,219,114, 99, 99, 99, 17, 27, 91,188,184,201,207,207,167, 9,232, 79,103, 69,
- 92, 24, 94,197,207,187,161, 36, 58,163,124,237, 66,177,169,169, 36,250,109,148,125,126, 94, 38,194, 95, 62, 64,108, 76, 4, 18,
-227,163, 64, 81,106,112, 72, 18, 36,135, 68,157,122,141,241,224, 97,168, 86, 77,211,161,149, 97, 22,183, 35,190,200,196,206,115,
-216,170,149,139, 46,205,158,183,220,120,200,119,187,241, 42,250, 13,228,180, 3, 88, 22,112,176, 54, 65,115,143,249,144,164,103,
- 35,232,183,157, 74,134,162, 70,126,144, 67,235, 35, 76, 0,176,207, 65,163, 93,251,126, 27, 31,120,248,216,242,121, 51, 38,219,
- 15, 24, 52, 18,130,188, 55,208,165,191, 64,189,214,189, 65, 8, 45,112,229,250,109,132, 60,127,147,201,232,217,229,246,185,248,
- 53,166, 26,204,242, 34,147,201, 30,101,100, 72, 93,202,101,129,119, 17, 10,141,170,139,142,251, 16,243,189,140,243, 28, 14,217,
-114,213,170, 85, 58,123,123,123, 42, 50, 50, 18,187,119,239,102, 94,188,120,113,157, 36,201,237, 82,169, 84, 93, 29,166,173, 78,
- 23,126, 44, 32,160, 81,155, 65,131,216,225, 51,102, 40, 33, 20,206,220,176,105, 83, 64,118,126,190, 19,203, 48,176,181,178, 74,
-219,176,112,225,218,239,134, 14,205,127,253,224,129,113,232,249,243,198, 2,154,126, 97, 64, 59,255, 8,169, 20, 83, 34,145,132,
-220,189,123, 31, 7, 3,127, 1, 69,105, 32,149, 36, 3, 0,114,114, 11, 80, 13,201,250, 16,147, 85, 42,149,131,150,252,248,227,
-227, 37,179,253, 29,190,238,218, 13, 41,225, 97,160,242,178, 65,232,104,240, 8, 46, 20, 89, 34,100,101,202,177,224,200,201, 44,
-185, 82, 57,168,130, 73,162,194,118,150,106,172,132,102,166,224,155,136, 33, 16,155,190,167,197, 50, 50, 51,131,192, 68, 12,174,
- 64, 80,145, 3,247, 71,152,114,185,124,240,119,223,125,247,234,233,211,167,150, 19, 38, 76,192, 87, 95,125,245, 82,165, 82,117,
- 6, 80, 84,219,235,201, 48,140,228,235,175,191, 38, 9,130, 16,143, 28, 57, 82,152,157,157, 93,150, 89, 93, 46,151,227,234,213,
-171,104,216,176, 56,170,255,245,235,215,104,220,184,113,165,152, 19, 23, 68, 74, 0,172,156,253,157,243,134,199,225,210,153, 0,
-214,213,107,224,138,219,193, 55,113,255,118,104, 64, 59, 31,102,219, 55, 35, 91,255, 36,234, 60,116,158,119,203, 9, 28,177,153,
- 35, 14,157, 61,195,137,122,177,127,181, 82, 25, 81, 31,187,207,253, 80, 89, 59, 9,130, 0,203,178, 31,165,114,224,112, 56, 56,
-122,244,104, 77,207,253,100, 96, 96,224,212, 41, 83,166,240,165, 82, 41,222,190,125, 11,133, 66, 1, 35, 35, 35, 4, 7, 7,211,
- 0,118, 30, 61,122, 52,248,232,209,163,189, 80, 28, 77,116,171, 38,247,167,137,137,201,244,158, 61,123,226,237,219,183,120,246,
-236,217, 25, 0,175, 94,190,124,121, 38, 54, 54,118, 88,135, 14, 29,240,219,111,191, 77, 87,169, 84,129, 53,193,100, 24,166,124,
-206,164,210,138, 15,225,114,185,188, 93,104,104,104, 77,251, 93,154,155,155,219,190,132, 88,167,218,219,219,155,133,135,135,195,
-205,205, 13, 20, 69,181,173,233,189, 84, 80, 80,240,203,246,237,219,127, 29, 55,110, 28,126,250,233,167,145, 39, 79,158, 28,249,
-205, 55,223,160, 79,159, 62, 56,112,224, 0, 94,189,122,181, 14,134,149, 21,171,232,220, 95, 1,120,101,111,111,255,189,171,171,
- 43, 54,110,220,136,136,136,136,181, 43, 87,174, 92,248,234,213, 43, 52,108,216, 80, 24, 21, 21, 69,215,102, 12, 1, 0, 51, 51,
- 51, 51,157, 78,135,243,231,207, 63, 1, 48,123,228,200,145,118, 91,182,108,241, 19,139,197,200,203,203, 83, 69, 70, 70,142, 0,
-112,225,175, 30,235, 88,130, 88, 60, 97,226,204, 61, 19, 39,140, 48,106,213,178, 57,148,133,105, 80,201, 51,161, 44,202,192,246,
-192,235, 32, 8, 18,182,182,142,176,115,112, 65,114,114, 10, 30, 94,190,162, 85, 40, 85, 91, 4, 58,102, 93,213,152, 51,138, 49,
- 91, 20, 99, 42, 21, 89, 80,201,179,202, 48,237,236,156, 74, 48,147,241, 32,244,138, 90,165, 80,252,162,101,137,159,255,228,115,
-255, 39, 75,205,106, 29,150,151,252,252,252, 89,147, 39, 79,238,188, 96,193, 2,107,154,166, 57, 86, 86, 86, 72, 78, 78,166, 79,
-159, 62,157, 39,151,203,103,213,166, 53, 92, 30,239,149,167, 87,195,206, 3, 6, 12,160,251,247,239,199, 31, 53,174, 23,215,214,
-206, 14, 5,178, 92,196,188, 13, 67,244,155, 23,240,108,216, 12,203, 86,110, 6, 44, 44,170, 45, 36, 89, 82, 86,167,239,138, 37,
- 63,156,104,223,177,135, 89,195,198,205,248,205,235,155,131,210,209, 72, 75, 75,195,133,243,225, 84,228,243,251,133, 12,173, 29,
-166,204, 49,172, 4, 79, 8, 64, 35, 23,123,125,236,168,163,107, 54,108,159,187,115,239,193,121, 11,102, 78, 48,233,224,219, 29,
- 17, 55,127,195,153, 75, 39, 20,106,141,118, 3,159,131, 77,145,185, 80,198,212,240, 26,168,213,106,234,195,249, 84,173, 86, 83,
-159,218,211, 7, 14, 28, 64,102,102,166, 54, 41, 41,233, 26, 77,211, 39,171, 40,246,252,145,108, 7,180, 3, 53,154,155, 75,124,
-125,123, 45, 9, 14, 54, 26, 51,127,190,118,228,168, 81, 63, 64,163,161, 32, 16,176, 92, 19, 19, 18, 66, 33,239,245,131, 7,198,
- 91,167, 78,181, 34,180,218, 27, 7,171, 72, 27, 80,129,252,225, 81,135,165, 26,173, 78,157, 58, 96,204,132,217, 80,149,211,104,
- 61,122, 22, 3, 13, 5,131, 53, 90, 37,146,146,148,154,218,110,230,226, 37,103,135,245,236,234,237,227, 94,231,255,216,187,238,
-176, 40,174,245,253,206,204,246, 93,138, 72, 71, 20, 43, 74, 81, 80,108,216, 16, 75,236,137, 53,118, 81, 19,141,221, 88, 34,234,
- 53,150, 68, 33,154,216, 53,106,212, 88,110,236, 45, 98, 23, 13, 26, 27, 42, 74, 81, 68, 69, 4, 4, 68,122,221, 58, 51,231,247,
- 7, 69, 68, 88, 22, 52,191,155,155,187,239,243,204,179, 59, 59,103,190, 61,115,206,204, 57,239,188,231, 59,223,145, 88, 55,168,
- 15, 19, 59, 59,100,164,165,225,207,187, 79,116, 43, 14, 29,143, 44, 38, 89, 6,197,149,225,121,190,200,201, 29, 64,247, 89, 11,
- 64, 49, 12, 80, 28,198,161,100,230, 80,131, 54, 29, 64, 9, 4,224, 8, 15,181, 90,109,136,211,223,171,231,207,159, 15, 25, 61,
-122,116,112, 80, 80, 16,221,171, 87,175,150, 39, 78,156,224, 63,228,222, 81, 42,149,237, 1, 64, 42,149,198,213,170, 85,171,206,
-132, 9, 19,160,211,233, 80, 88, 88,136,156,156, 28,188,122,245, 42,123,194,132, 9, 90, 0,144,201,100,226,161, 67,135,154, 85,
-101,115,221,209, 36,213,215, 67,235,108,172, 45,120, 57, 34, 55, 61,188, 65,109,193,203,184,246,205,249,141,235,142, 38,169,204,
- 28, 10,190, 79,127, 25, 18,147, 82,112, 97,219,222,227,199,152,113,131,134,112,142, 38, 79,253,165, 54,228,104, 85,118, 41,138,
-122, 47, 56,169,129, 36,235, 29,228,229,229, 45, 92,178,100, 73,191,172,172, 44,199,222,189,123,139, 92, 93, 93,113,251,246,109,
- 4, 5, 5,177,183,110,221, 74, 44, 40, 40, 88, 4, 64, 5,224, 98, 77,202,180,105,211,166, 13, 4, 2, 65,201, 80,218,230,226,
-159, 55,159, 56,113, 98,248, 23, 95,124,129,250,245,235,187, 61,126,252, 88,130,106, 60, 71,132,144,210, 81,134,143, 9,138,162,
- 98, 55,108,216, 80,199,206,206,142, 58,119,238, 28,203, 48, 76, 77,148,155,221, 59,119,238,108,167,211,233,190,156, 52,105, 18,
-124,124,124,192,178, 44,246,239,223,143,157, 59,119, 26, 74,178,244, 34, 38, 38,230,126, 98, 98, 98,151,121,243,230,225,199, 31,
-127, 92, 56,111,222, 60, 36, 38, 38, 34, 38, 38,230,193,135,216,205,205,205, 85, 38, 36, 36,200,189,189,189, 91, 71, 70, 70, 70,
-250,250,250,186,127,241,197, 23, 8, 12, 12, 36,127,252,241,199, 80, 0,231,254, 19,189,247,147,103,153,251,132,156,224,194,138,
-239,215,126,219,184, 81,131,175, 38,142,255,156,105,234,236,142,130,156, 87,176,180,178,133, 99,221,134, 72,123,147,142,243,231,
-207,113,233,233,217,187, 57,154, 90,254,236, 89,102,242,135,216,172,227,216, 16,111,222,188,193,217,179,103,185,236,172,220, 29,
-208,209, 43, 30,199,103,167,194, 8, 67,148,172, 73,208, 19, 37, 94, 31,172, 44, 44, 44, 14,152,153,153,165,154,153,153,165, 90,
- 88, 88, 28, 0, 12,154,125,208,163, 76,235,192,188,179, 13, 29, 42,133, 84,218, 30, 2,193,156, 90, 22, 22,231,204,205,205, 51,
-186,118,237,170,217,182,109,155,234,241,227, 40, 62, 41, 41,145,152,155,155,231,148,166,175,200,102, 57, 88, 88, 52, 50, 85,216,
-187,127,107,238,216,242, 79, 19,123,183, 60, 19,123,183, 60,115, 71,207, 27, 10,123,183,101, 22, 22,141, 76, 13,202,103, 37,104,
-104, 3,107,103, 43,108,105,102, 77, 41,157,173,176,165,161, 13,172, 13,190,118,253,195,126, 28, 69,129, 67,209, 52,108,212,192,
-102,137, 13,158, 97,152, 61,142,142,142,246,168, 94,192,186,247,108,142, 1,234,143,145, 72,190, 60,226,239,239, 23,247,199, 31,
-163,115, 95,188, 24,153, 19, 27,251,249,131, 67,135,134,111, 30, 62,124,204, 72,137,100,210, 80,160,145,161, 54,237,237,237, 3,
-238,223,191, 31,100,232, 86,134,120, 25, 92,158,141, 26,214,185,208,171, 71, 59, 50,125,242, 96, 50,125,242, 96,210,171, 71, 59,
-210,168, 97,157, 11, 31, 80, 71, 20,195, 48, 35,228,114,249, 1,133, 92, 30,161,144,203, 35,228,114,249, 1,134, 97, 70, 64,191,
- 15,213, 59, 54, 45, 45, 45,239,217,218,218,166, 86,103,179,178,178, 10,171, 70, 62, 71, 54,104,208, 32,145,166,233,117,213,124,
-166,245,217,116,150,201,100,177, 10,133,226, 85,217, 77, 38,147,149, 13, 12,101, 41,151,203, 79, 43, 20,138,245,134,216, 92,189,
-216,253,219, 27, 23,167,133,175, 94,236,254,109,249, 99, 51, 6, 90, 76,184, 29,188, 60, 99,198, 64,139, 9,134,228,211,198,198,
-230, 15, 27, 27,155, 20, 27, 27,155, 20, 91, 91, 91,189,155,149,149,213, 61, 3,108, 74, 77, 77, 77,215,155,154,154,166, 42, 20,
- 10,206,196,196, 36, 85,161, 80,172, 67,153,208, 22, 53, 45, 79,154,166, 3,221,220,220, 84, 12,195,236, 42,119,232,199,198,141,
- 27,171, 4, 2,193,154,106,218, 52,235,220,185, 51,247,240,225, 67,226,227,227, 67, 0, 88,124,196,122,183,179,176,176, 56,103,
-102,102,150, 96,106,106,186, 9,128,162,134, 54, 41, 0, 35,234,212,169,243,160, 91,183,110,133,117,234,212,185, 9,224,179,143,
-152,207,126, 3, 7, 14,228, 19, 18, 18, 8, 33,132, 36, 36, 36,144,129, 3, 7,242, 40, 10, 20,249, 33,109,242,226, 41, 83,166,
-144, 91,183,110,145, 91,183,110,145,155, 55,111,146,126,253,250,241, 0,198,126, 96, 59,143,143,117,237,174, 13,173, 26,185, 52,
-177, 56, 60,106, 72, 39,254,226,169,117,100,233,162,175, 72, 79, 31,119,210,172,177,197,113,103,103, 75,231,143, 97,243,219, 69,
-147, 73,143, 46,110,188,107, 35,139, 67,174, 13,173, 26,253, 63, 95,251, 63, 81,213,194, 95,237,112,246, 86, 90,124,151, 44, 85,
- 12, 7, 7, 7,100,100,180,147, 10, 4,157, 36, 18,137, 47,205, 48, 87, 51,211,210,102, 23,191,110,113,255, 95, 82,173,222, 14,
-189, 17,196,122,150, 36,168,137,205,119, 28,217,107,104,179, 58, 54, 12,178, 89,217,162,210,188, 90,157,108,201,178,247, 54, 65,
-111, 25,188, 99,179, 78,157, 58, 95,242, 60,223,192,208, 12,209, 52, 29,151,148,148,244, 75, 77,202,179, 73,147, 38,164,120,120,
-155,250,152,245,254, 87,220, 75,255, 75, 54,247,174,109,225,208,172,133,203,252,136,251,143,127, 44, 30, 86, 44,197,178, 25, 22,
-166,157,186,117, 93,242,231,149, 63,190, 91,182, 41, 43,239, 63,124,237, 52, 12,244,105,251, 8, 54, 75,130,132, 86,203,166, 80,
- 40,220,214,182,109,219, 47,111,223,190,189,139,227,184, 73,255,163,247,103, 63,134, 97,230, 53,109,218,180,101, 76, 76,204, 3,
-142,227,126, 68, 5,129, 34,107,144,207, 69, 13, 26, 52,152, 42, 18,137, 36,249,249,249, 89,201,201,201, 75, 0, 28,254,187,149,
-167,107,147,218,173, 9, 41, 13,186,189, 50,250,121,102,232, 71,179, 73,120,142, 39,204,247, 49, 47, 50,194,254, 3,245,254, 79,
- 35, 89, 59,254, 63,254,184,135,209,166,209,166,209,166,209,166,209,230, 71,183, 41, 51,150,167,209,230, 63,208,230, 63, 18, 2,
- 99, 17, 24, 97,132, 17, 70,252,215, 65,105, 44, 2, 35,140,248,219,161,172,170, 85,170,102, 81,122, 88,105,117, 36,193,154, 48,
-219,203, 70,155, 70,155, 70,155, 70,155, 70,155, 70,155, 70,155,255,115, 54,255,169, 36,107,135,158,253,191, 12, 70, 89,213,104,
-211,104,211,104,211,104,211,104,211,104,211,104,243,127,129,104, 85,184,111, 28, 58, 52,226, 47,199,198, 65,168, 3, 0, 51, 79,
- 32,233,175, 72,111,132, 17, 70, 24, 97,132, 17,255, 97,236, 64, 37, 67,135,127, 7,162,229, 0,160, 61,138, 22,190,125, 2,224,
- 58,128,172, 15,176,103, 5,224,115,138,162,134, 1, 0, 33,228, 8,138,102,141,164, 27,114,178, 84, 42, 77, 85,169, 84, 54,197,
-223,223,168, 84,170,178,107, 25, 80,120,127, 54, 27, 41,179, 85,136, 6, 13, 26,164,170,213,106, 27, 3,254, 62,135, 16, 18, 78,
-211,116,132,137,137,201,149,152,152,152,160,234, 92,184,175,175,175, 31,195, 48, 43, 1,128,227,184,197, 87,175, 94,221,243, 23,
-214, 91,187,186, 14,118,191,106,117, 90, 54, 53, 45,115, 9,222, 15,228, 7, 0,216,210, 31, 1, 20,139,249,197,223,215, 76, 11,
-210, 31, 71,167,186,233,245,160,181, 80, 40,156,110,107,107,219,231,213,171, 87,247, 0,124, 3, 84, 29,213,184,110,221,186, 99,
- 5, 2,193,104,142,227, 26, 49, 12, 19,203,178,236,191, 19, 19, 19,247, 25,219, 16, 35,140, 48,194, 8, 35, 12, 32, 91,239,161,
- 90, 68,171,153, 37,236, 8, 48, 2, 20,122,130,224, 18, 5, 28,124,146,129,215,134,158,223,183, 25,116, 58,182,232, 63, 69, 52,
-184,115,207,233, 29,125,250,244,113,156, 49, 99, 6, 58,116,232,128,219,183,111,123,239,222,189,123,194,225,195,135,195,121,158,
-191, 10,224, 54, 96, 80, 40, 5, 5,138,226,180,140,234,211,167, 79,143,149, 43, 87, 50,238,238,238, 80, 42,149,248,227,143, 63,
- 58,173, 89,179,102,253,141, 27, 55, 46, 3,248,173,152, 16, 84,186, 0,158, 74,165,178, 41, 89,140,147,162, 40,155,161, 67,135,
-134,150, 37, 87,197,235,171, 81,132,144, 91, 20, 69,221,228, 56,238,246,209,163, 71, 19,155, 1,237, 38, 55, 16, 29,157, 29,167,
-117, 44,111, 83,173, 86,219,156, 92,189, 10, 2,137, 4,234,188, 92,120,143,127, 75,122, 47,125, 59, 31, 20,207,130, 1,201,242,
-253,126,125, 56,128,136,228,228,228,112, 31, 31,159,184,234,214, 48,195, 48, 43,207,159, 63,111, 79, 8, 65,175, 94,189, 86, 2,
-248,171,136,150,164,125,107,207,171,167,143, 29,144,230,103,166,162,247,103,195,255,253, 52,241,141, 31,128, 99,239,144,166, 62,
-176,165, 40,204,159,178,234, 55, 6, 0,182, 46, 26,245,205,186, 79,176,241,235,139,120, 13,192,183,152,252, 0,192,106, 0, 87,
-183,244,129, 45,128, 5, 83, 86,253, 70, 1,192,207,139, 70,205,223,210, 7, 27,166,157,171,118,216,138,169,126,126,126, 27, 87,
-174, 92,201,216,219,219, 35, 41, 41,169,183,155,155, 91,211,220,220, 92, 55,232,113, 34,174, 95,191,254,161,206,221, 6, 52, 28,
- 60,108,132,220,218,202, 2,201, 41,233,102,135, 14,236,154,204,220,250,163,207,203,151, 47,135, 27,219, 16, 35,140, 48,194, 8,
- 35, 42, 65,205, 35,195,183,178,135,172, 64,139,129, 2,134, 26,219,177,181, 91,247,145,125, 59,211,110,174, 77,240, 40,234,241,
- 39,167,174,220, 89, 67,223,140, 10,102, 57,178, 79, 33,194,201,176, 20,253, 51, 97,116, 44, 4, 23, 79,254, 86,212, 19, 78, 24,
-197,132,134,134, 54,241,242,242, 42, 93, 26,166,123,247,238,232,222,189, 59,181,117,235, 86,207,139, 23, 47,122,238,220,185, 83,
- 27, 28, 28,252, 43,244,199, 71,153,222,184,113,227, 53, 27, 55,110,148,248,248,248, 64, 34,145,148, 30, 48, 49, 49,193,128, 1,
- 3, 48, 96,192, 0, 38, 57, 57,185,215,233,211,167,123,173, 94,189, 90, 19, 31, 31, 63, 15,111,163, 52,235,197,146, 37, 75, 90,
- 87,240,243,121,138,162,158,179, 44,251,192,211,211, 51,177, 41,208,100,114,223, 14,151,166,118,116, 86,204, 94,184,187, 66, 59,
- 2,177, 24,123,253,138,250,234,178, 68, 43,238,202, 57,152,152,153,102,200, 77, 77,195, 1, 68, 0, 8, 39,132, 68,196,198,198,
- 62,118, 1, 60,219, 91,208,191,238,202,226, 61,170, 65,182,144,152,152, 8,115,115,115,153,143,143, 79, 10, 69, 81,203,254,248,
-227,143,143,237,144,215,110,217,252,169,162,172,151,225,120, 29,125, 11,115,134,117,146,207,222,244,251,119, 42,141,238,152,190,
-147, 40,138,166, 87,223,228,253, 81,180, 24,239,146,140,140, 12, 31, 0,176,180,180, 20, 3,184,186,238, 14,250,126,221,145,250,
-144,216,110, 34,134, 97,182,236,222,189,251,139,177, 99,199, 22, 45, 29,241,231,159, 48, 49, 49,193,138, 21, 43,234,207,157, 59,
- 55,128,101,217, 89,149, 41, 89,157,187, 13,104,184,225,199,239,220,242, 50,115,212,219,183, 28,190,235,208,188, 25, 61,101,250,
- 92,211, 13, 90,181, 29,199,113, 99,141,202,150, 17, 70, 24, 97,132, 17,213, 81,179,170, 36, 90, 77,173,176,167, 85,115,231,207,
- 71,246,235, 36,105,209,220, 29, 34,201,219,208, 45, 94,173, 91,195,171,117,107,218, 63, 63,175,103,232,221,251, 61,143, 94,188,
-173, 46,212,197, 31,142, 73,135,159,161,185, 42, 89,148,118,229,103,182,221, 10,178,223, 72, 1, 64, 81,203, 70,181,232,228,235,
- 43, 29, 59,118,132,163,163,163, 40, 56, 56,120, 98, 21, 68,107,209,147, 39, 79, 36, 12,163, 63, 30,170,131,131, 3,134, 14, 29,
-138,102,205,154,137,187,118,237,186,168, 50,162, 37,149, 74,223, 80, 20,101, 3, 0,181,107,215,230,150, 45, 91,246,128, 20, 1,
- 0, 8, 33,228, 22, 77,211,183,121,158,191,243,251,239,191,191,114, 3,108,122,123, 53,187, 62,117,204, 80, 57, 57,186,190, 82,
-146,160,202,205,173,240,119,185,137, 34, 77,166, 80,132, 75,228,210, 8, 20,173,229, 21,225,232,232,248,216, 13,112,108,219,172,
-193,197,173, 95,143, 50,221, 53,233,187, 42,203,178, 85,171, 86, 77, 61, 60, 60,164, 28,199,161,160,160, 0, 63,255,252,179,185,
- 76, 38, 51,239,211,167,207,210,178, 55,128, 43,208, 98,136, 3, 51,105,121, 50, 55,173, 6, 55, 82,173,206,222,173, 95, 14, 29,
-208,199,172,117,251,206,120,122,117, 63, 50, 51,243,144,147,157, 15,158,231,223,139,235, 51,237, 28, 82,183,244,199,154,173, 11,
- 71, 45,160,104,154,242, 28,244, 13, 62,181,203,153,185,109,219,182, 40, 0, 66,177, 88, 92,246, 62,116,144,213,105,190,166,201,
- 39,157,241,243,226, 49, 32, 60, 79, 0,172,169,134,154,101, 99,106,106,122,234,226,197,139,237,218,180,105,131,219,183,111,227,
-197,139, 23,152, 58,117,170,102,218,180,105,162,113,227,198, 81,115,230,204,153,177,122,245,234,163, 0,110,188,247, 32, 8, 4,
-163, 63, 27, 60, 92,156,159,157,171,210,168,181,154,218, 86,181,120,117,129,170, 48, 61, 43, 87, 53,124,212,151,154,168,176, 59,
-163, 1,188, 71,180, 62,176, 60,141, 48,194, 8, 35,140, 48, 0,132,144, 54, 0,172, 1,164, 81, 20,117,183,236,126,113,146,146,
-213, 90,202,239,167,163,104, 84,202,178,140,185,116, 20,185,251, 88, 3,224, 0,132, 82, 20,149,245,129, 89,212, 63,203, 48, 40,
- 40,136,148,253, 44, 67,180, 8, 33,132,232, 50,158, 19,117,204, 57, 82,120,247,151,247, 54,101,212, 49,146, 18,122,152,220,249,
-237, 91,210,212, 74,255, 42,236,125,155, 65, 55,202, 3,100, 74, 27,144, 89, 93,107,169, 66, 67, 67,131,121,158, 15,242,239, 12,
- 66, 30,253, 70,200,163,223,200,215,222, 32, 71,143, 30, 61, 31, 16, 16, 16,180,111,223,190, 32, 0, 85,249, 41,165,230,221,189,
- 73,238,216,128, 84,134, 39, 79,158,144,109,219,182,145,133, 11, 23,146, 93,187,118, 17, 84, 17, 65,189, 87,175, 94,127, 68, 70,
- 70,146,113,227,198, 61,128,158,192,128,174,128, 98,116,125,187,104,245,161,245, 90,205,216, 22, 36,171,139,180,194,235,183,183,
-183,127, 39, 63,129,206,118,100,115, 91,103,178,167,167,215,107, 66,200,121, 66, 72, 32, 33,100, 56, 33,164, 25, 0,180, 2,204,
- 62,179,183,124,166, 58,188, 65,169,153,212,190,202,117,239, 90,181,106,213,116,222,188,121,153, 26,141,134,196,197,197,145,237,
-219,183,147, 75,151, 46,145,147, 39, 79,146, 78,157, 58, 37,151,201,175,237,132,102, 78,169,154,157,203,213, 53,185,139,132, 12,
-179,249,238,165,163,228,217,245, 35, 36,244, 96, 0,249,247,191, 70,146, 25,159,181,211,154,201, 36, 42, 0,221, 42, 59,111, 90,
- 71, 52,105, 86,223, 58, 38, 62, 62,158,104,181, 90, 50,126,252,120,210,171, 87, 47,242,201, 39,159,144, 30, 61,122,144,238,221,
-187,147,110,221,186,145, 43, 87,174,144,228,228,100,210,163,179, 87, 65,127, 87,180,174, 70,214,154, 59, 57, 57,189,142,139,139,
- 35, 90,173,150, 4, 7, 7,147,253,251,247,147,224,224, 96,226,239,239, 79, 0,236,153, 50,101,138, 50, 43, 43,139,244,234,213,
-235, 21, 42,136, 26,239,228,228,244, 56, 50, 38, 49,113,221,170, 95,174,236,221,124,224,202,241,163,151,174,156,186, 16,122,230,
-228,133,187,135,239, 60,140, 61,233,228,228,244,184,130,250,255,160,242, 52,194, 8, 35,140, 48,162,106, 46, 82, 76,180,250, 21,
-139, 29,253, 8, 33, 61,202,237,247, 43, 38, 78,239,237,251,251,251, 47, 44,187, 95,146,198,223,223,127, 33, 0,226,237,237,125,
-128, 16,210,228, 35,100,127, 82, 5, 91,213,138, 86, 9,216, 87,161, 16, 57,247,129,144,211, 65,151,254, 4,124,118, 60,160,176,
-131,146, 50, 65, 70, 74, 60,162,175, 31,211,191,144, 68, 49,206, 62,129, 16, 64,240,227,199,143, 17, 29, 29,141,196,196, 68,200,
-229,242,247,210,253,249,231,159,144,201,100,176,183,183, 55,140,233,106,222,237,231,194,189,156, 96,226,237,131,244,145, 95, 33,
- 56, 56, 24,111,222,188,129, 72, 36,130, 88, 44, 6,203,178, 85,218,163,233,162, 21,127, 75, 84,172,138,210,248, 0, 2, 73,109,
-147,211, 91,151,206,106, 64,223, 10, 18, 42, 19,158, 33, 89,197, 25,166,228,153, 40, 32, 87,200, 83,100, 50,121,233,112, 33,128,
- 8,138,162,158,182, 2,132, 10, 19,233,233, 95,191,159, 99,199,132, 5, 75,149,207,194, 43,180,209,163, 71,143,201, 0,150, 18,
- 66,178, 61, 60, 60,108, 87,174, 92,105,145,148,148,132, 71,143, 30,225,240,225,195,105,108,209,133, 82,132,144,229, 0,208, 30,
-144,214,178,174,117, 97,243,183,179, 76,113,245,144,184, 38,119,145,185,235,128, 51, 67,198, 77,153,182,113,214, 0, 20,228, 41,
-241,219,165, 48,156,191,255,252, 83, 0,127, 66,143,223,219,150, 27,120, 6,164,117, 31, 60,120,240,131,107,215,174, 89,237,220,
-185, 19, 44,203, 86,184,237,220,185, 19,151,175,223,159, 9,224,158,129,217,114,104,208,160,193,229, 59,119,238, 88,203,229,114,
- 92,186,116, 9,217,217,217,165, 74,150,159,159, 31,149,157,157, 61,226,231,159,127, 30,242,242,229,203, 31,175, 95,191,158,129,
-162,181, 32,223,185, 17, 24,134,121,206,178, 90, 23,123,215, 38,130, 97, 3, 58,119,206,207, 8,135,137,165, 7,110, 61,124,126,
- 58, 59, 43, 67,201, 48,204,243,178,233, 63, 70,121, 26, 97,132, 17, 70, 24, 81, 61, 80, 20, 21, 68, 8,233, 79, 81, 84, 80,249,
-223,202,127, 47, 73, 23, 16, 16, 80,186, 95,114, 78, 96, 96,224,170, 50,251,133, 31, 41,123,122,157,225,187, 22, 51,200,174, 21,
- 37, 82, 63, 58, 14,117,244, 41,136,156, 58, 66,220,236, 83, 48, 78,157,144, 16,126, 21, 15,207,173,195,171,168, 63, 65,120, 14,
-246, 77,219, 26,154, 17,149,139,139, 11, 84,170, 34,215, 44,181, 90, 13,145,194, 66, 53,103,210, 40, 41, 0,240, 2,169,186, 12,
-131, 53,200,160,105, 71, 95,180, 77, 37, 8,181, 45, 18, 42,218,166, 22,157,247,253,248,241, 16,137, 68, 16,137, 68,160,138, 93,
-127, 12, 33, 90, 84,113, 98,190,104,248,170,162, 76, 80,133, 18,225,111, 7,151, 78,111, 43,121, 25, 33, 86, 71,222, 66,178,154,
- 39,167, 83,185, 51,134,228, 87,174,144, 39,201,228,242, 8,153,137,162,148,104, 81, 20,245, 28, 0,136, 80,184,111,255,242,233,
- 30,138,212, 88,133,234,110, 48, 82, 84,188,182, 18, 51,203,207,157, 59,103, 35, 16, 8,236, 56,142, 67, 66, 66, 2,162,162,162,
-176, 97,195,134,212,188,188,188,174, 97, 97, 97, 49,101,185, 35, 39, 19, 31,222,183, 98, 86, 67, 65,120,136, 84,253, 60,178,218,
-119,143, 85,243,129,189, 62,237,234,121,102,242,152,197, 24,216,247, 19,140,235,234, 70,226,146, 51, 85, 0, 46, 21, 75,175, 85,
- 33, 41, 44, 44,172,103,151, 46, 93,254,221,178,101, 75, 87, 66, 8, 90,180,104,129, 17, 35, 70, 96,223,190,125,120,248,240, 33,
-114,115,115,181, 23, 47, 94, 92, 15, 96,183,129,217,146, 91, 88, 88,156,191,114,229,138,181, 92, 46,199,197,139, 23,161, 84, 42,
- 97,111,111,143,105,211,166,137, 3, 3, 3,247,230,230,230, 14, 11, 8, 8,144,198,197,197,109,190,112,225, 66,125, 20,173, 59,
-247,222, 77,160,209,104,118,252,182,111,207,198,105,211,103,212,185,114,251, 81,176, 58, 63,207,220,201, 41, 49,215,218,194,196,
-116,253, 15,203,235,105, 52,154,201, 21,151,231, 31, 53, 42, 79, 35,140, 48,194, 8, 35,222,131, 94, 46, 82,150, 60,149, 39, 91,
-213, 33,105, 0,148,254,254,254,139, 40,138, 10,242,247,247, 95, 20, 16, 16,160, 4,144,252, 87,144,172, 82,162,213,191,127,255,
-144,160,160, 32,244,239,223, 63,164, 82, 19, 60, 7,109,220, 53,104,227,174, 65,230, 61, 19,191, 7,140, 44,119,241,124,141,115,
- 55, 96,197,165, 43,106,181, 90,176,103,207,158, 82,191, 45, 0,224, 56,238,163,215, 98,117,136, 86, 49,209,123, 47, 19, 13, 36,
- 38, 33, 59,190, 30,214,222,146, 43, 20,106,254, 60,141, 36, 53,207,254,248, 76, 91,120, 55,155,172,174,204,230,201,217,147,145,
-120,253, 50,228, 38, 38,137, 95, 92,139, 40, 85,177,138, 73,214, 11, 0,168, 47, 49, 13,222, 54,107, 96, 39, 59, 17, 68,154, 51,
- 71,144,172,230,213,219, 94,234,118, 87,114,179,129, 16,130, 23, 47, 94,160,176,176, 16, 55,111,222,196,177, 99,199,210, 42, 32,
- 89,104, 32, 49,249, 99,215, 55,163,219,153,229,189, 22,105,238, 94, 70,178,154, 55,104,168,203,170,197,192,142, 34,154,186, 72,
-209,140,172,123,251,166,152,253,229, 32,172,219,245, 59,171,177,233,220,127,227,169,179,159,231,171,181,139, 12, 36, 89,165, 98,
- 99, 88, 88,152, 91, 88, 88,152, 4,128,239,136, 17, 35,206, 14, 25, 50, 4, 33, 33, 33, 56,125,250,180, 51,128,148,226,116, 43,
- 80,180, 80,246,106, 0,177,149, 9,143, 34,145,232,224,229,203,151,221, 29, 28, 28,112,249,242,101, 40,149, 74, 76,153, 50, 69,
- 51,125,250,116,145,159,159, 31,149,147,147, 83,170,100,221,188,121, 51,163, 50,146, 5, 0, 73, 73, 73,231,142, 29,222,223,161,
- 75,151, 46,131, 26, 58, 55, 51,139,205,203,125, 35,151, 75,101,215, 67,174,138,238,222,185,177, 57, 41, 41, 41,180,226,242, 12,
- 54,184, 60,141, 48,194, 8, 35,140,168, 28, 6,113,145,114,202, 84,117, 80,230, 60, 97, 64, 64, 64, 84, 64, 64,192, 59,138,215,
- 7,162,252,172,195, 51, 37,125, 90,141,226,104,113, 57, 9,239, 95, 0,207, 87,231, 98,223,251,205,194,194,130,149,201,100,239,
- 16, 45,222, 64,155,153, 39, 14, 32,118,234,168, 82, 37,171, 68,217, 66,111,191, 15, 34, 90, 60,207,223, 4,240, 78, 38,228, 54,
- 77, 71,174, 31,224,218,209,173, 97, 29, 90,119,120, 3, 94, 21,178,170,165, 79,180,170,232, 60,242,233,227, 10,156,172, 75,109,
-178, 58, 72, 21,178,120,153,137,162, 60,201,122, 9, 0, 10, 91,231, 33, 63,246,105,214,213,179, 89, 99,154, 61,180, 22, 73,133,
-186,124,255,199, 90,109,108, 1, 57, 94, 73, 25, 46,253,228,147, 79,150, 90, 90, 90, 74, 55,110,220,104,238,228,228, 4,150,101,
- 53,229, 73,150,220,166,233,200, 13, 3,155,119,108,106,103, 65,235,142,110, 66,162,146, 43,220, 16,171,219,107, 8,201,178, 50,
- 55,185,176,109,213, 84,153, 92, 34,132, 74,165, 66,224,214,163,184,120, 35,178,127,122,228,201, 11, 0, 46,124,192, 13,249, 69,
-255,254,253,215,173, 88,177, 2, 58,157, 14, 19, 39, 78,196,243,231,207, 47, 62,121,242,100, 67,189,122,245,230,125,243,205, 55,
- 14,118,118,118,248,252,243,207, 69, 58,157,206,175, 18, 27, 63,252,246,219,111,253, 61, 61, 61, 17, 18, 18,130,236,236,108,216,
-219,219, 99,250,244,233,226,128,128,128,189,185,185,185,195, 86,173, 90, 37,125,241,226,133, 94, 37,235,157,251,154,227,190,223,
-190,110,234,188, 54,237, 59,209,207,158,197,176, 9,109,125,232,171,151, 79, 95,179,180,180,220,155,144,144,240,182, 60, 7,181,
-168,118,121, 26, 97,132, 17, 70, 24,241,113, 64, 81,212,153, 98,191,171,119, 84,174,242, 36,172, 68,177, 42,187, 95, 62,125,241,
-241,143,241,178,188,163, 2,226,245,110,120,135,254,253,251, 27, 60,173,158, 47, 72, 51,136, 60,149, 71,223,102,208,213, 49,129,
- 96,145, 15, 13,145,194, 66, 53, 96,197,165, 43,149,165, 85, 40, 20, 6, 43, 90,188, 90, 85, 85,165, 84,139,104, 21,251,104,157,
- 39,132,188, 67,180,204,109,155,250, 44,248,102,214,250, 78, 67,122,211,169, 95,122, 35, 59, 95,173,254,230, 17,203,191, 42,212,
- 79,178,138,122,113, 93,156, 92, 97, 18, 33, 85,200,203,146,172, 4, 0,144,218, 52,110, 59,127,246,180,173,221, 70, 14,160,210,
-166,116, 66, 86,182, 82, 61, 47,138,165,146,148,100,216, 99,224,106, 69,230,174, 92,185,178, 29,192,118, 31, 31,159, 84,133, 66,
-129,252,252,252,247,234,160, 36,191, 29,135,244,166, 83,191,104,135,204, 2,173,250,155, 40, 22,201, 74,254, 96, 85, 36,203,186,
-150,233,133,109, 43,167,202,147, 95,189,132, 72, 36,130,137,137, 9, 46,253, 25,129,244,168, 83, 31, 66,176, 64,211,244, 50,127,
-127,255,165,211,166, 77, 67, 70, 70, 6, 78,159, 62,141,190,125,251,226,192,129, 3, 78,103,207,158, 93,231,235,235, 11,134, 97,
- 16, 20, 20, 4,157, 78,247,180, 18, 51,131, 38, 77,154, 52,111,200,144, 33, 8, 13, 13, 69, 74, 74,202, 59, 74, 86,118,118,246,
-136,173, 91,183, 14,137,139,139,171, 82,201, 42,135,182, 13, 26,183, 18, 45, 92,242, 19,212,133,111, 4,105, 73,183, 67,130, 47,
-209,183, 50, 51, 51,229, 0,114,106, 90,158, 70, 24, 97,132, 17, 70, 24,172,106, 85,198, 69,210,138, 73, 84, 90, 69,251,101, 8,
- 86, 69,251, 84, 57, 21, 76, 83,238,248,195,191,242,154, 12, 82,180, 4,182,205,193,166, 70,150, 33, 90,111,222, 57, 46, 53,173,
-109,208,208,161,142,133, 96,219,238,210, 56, 90,210,140,140, 12,169,149,149,149,170, 44, 65,144,203,229,112,112,112, 64, 86, 86,
- 22,118,236,216, 1, 84,237, 20,205,154, 13, 25,131,182, 35, 39,226,174,163, 24, 68,167, 45, 85,182,182,141, 31,255, 14,217, 18,
-137, 68, 37,190, 97, 85,117,186,119,138,149,166, 91, 0, 72, 43,231,134,223, 73, 21,138,241, 82,171,186, 86,179,167,126, 33,140,
-123,163,198,149, 78, 11,179,143,254,176,192, 36,145,152, 76, 75, 64,206,141, 42,236,197,126,246,243,254,242, 74,214,171,150,206,
- 13, 23, 75,229,210, 47,197,181,235,219,249,207,153, 42,140, 75, 85, 83, 87,218,126,147,123,108,245, 55,242, 23, 48,157,247, 10,
-217, 87, 13,168,158,165,125,251,246, 93, 74, 8, 33, 60,207, 47, 1,128,178,249,157, 51,253, 75, 97,236,107, 21,130, 59, 45,206,
- 58,246,195, 2,211, 68,232,207,175, 85,139,129, 29,109, 45,204, 46,108, 91, 53, 77,158,146, 20, 15,137, 68, 2, 83, 83, 83, 36,
-166,230, 64, 40, 96,148, 31,120,191, 73, 58,119,238,188, 96,234,212,169,136,136,136,192,148, 41, 83, 82, 18, 18, 18,142, 31, 58,
-116,104,202,183,223,126, 43,232,213,171, 23, 82, 82, 82,176,102,205, 26,221,159,127,254,185, 10,192,154, 10,239, 71,129,224,139,
-239,190,251,142, 36, 39, 39, 83, 47, 94,188,128,189,189, 61,102,204,152, 33, 94,181,106, 85,169, 79, 86,117,148,172, 18, 36, 37,
- 37,133, 92,188,124, 11,159,158, 91, 15, 86,167, 14,201,206, 72,184, 22, 29,155, 21, 82, 91, 44,158, 91,167, 85,139, 26,149,167,
- 17, 70, 24, 97,132, 17, 31, 69,197,186,171,111,255,111,128,138,134, 14, 13, 34, 90, 79, 55, 45,158,224, 60, 97,218,124,200,156,
- 58, 66,253,248, 4,248,252,212, 82, 69, 75,106, 98,129,218,245, 92,145, 93,160,198,145,224,251, 0,240,180, 58,185,202,203,203,
-131,151,151, 23,182,248, 53,237,166,202,203,144,202, 0,168, 37,102,170,147,226,206, 87,206,158, 61, 91,200,243,252, 65, 0,103,
-171, 48,179,204,221,221,125,243, 79, 63,253, 36,118, 29, 57, 1,249,183,175,151, 87, 80, 32,147,201, 32,145, 72, 16, 30, 30,142,
- 43, 87,174,104, 0, 44,171,162, 66,239,176, 44,251,240,208,161, 67,175,154, 52,172,211,219,171,165,199,204, 69, 11,253, 77, 31,
- 93,191,136, 37,171, 54,243, 77, 90,247,202, 9, 60,112, 50, 47,199,164, 94,119,101,202,147, 7, 6, 92,234,195,114, 36, 43,217,
-165, 65,221,110, 45,155,187,207, 95,178,100,177, 89,212,245, 75,248,118,245, 54,226,236,217, 35,103,245,177, 83,185,233,242,250,
-159,168,222, 68,135, 26, 82,134, 33, 33, 33,219, 1,108, 47,217, 47,159, 95,255, 21, 27,248, 12, 99, 47,114, 0, 0, 32, 0, 73,
- 68, 65, 84,166,109,122,103, 5, 30, 56, 86,144,107, 90,175,135,190,252, 90,187, 14,234,224,104,109,113, 97,211,247, 95,201, 95,
- 39, 37, 64, 34,145,192,196,196, 4, 9, 41,217, 88,186,254,112,129,150,231,123,127, 40,209, 50, 53, 53,149,104,181, 90,108,217,
-178, 5, 9, 9, 9,222, 0, 18,238,221,187,183,109,248,240,225, 27, 91,180,104,225, 18, 21, 21,245, 52, 63, 63,127, 26,128,232,
-202,140,212,170, 85,203,219,218,218,154,186,117,235, 22,190,250,234, 43,205,140, 25, 51, 68,227,198,141,163,178,178,178,106,170,
-100, 1, 0,234,212,169,227,211,179,123,123,116,236, 57, 37, 68,163,202,190, 22, 23,189, 55,132, 38, 55,164, 53, 45, 79, 35,140,
- 48,194, 8, 35,254,103, 80,179,192,224, 62,128,160,169, 37, 38,187,215, 17,189,222,247,195, 12,146, 23,123,147, 40, 67,183,147,
-220, 19, 95,146, 51,107,198,145,179,155,102,147, 41,253,220,137,139, 13,245,186,169, 37, 38,251,188, 79,220,222, 89,221,187,111,
- 51,232,122, 54, 6,233,217, 24,164, 95, 83,232, 0, 44,106,213,170,213,201,233,109,223,198,209,154,222, 22, 4,192, 87, 0, 76,
- 42,201, 86, 69, 43,134,219, 3,216,225,229,229,197, 94,189,122,149, 60, 25,214,131,132,185, 88,145,105,211,166,145,111,191,253,
-150,140, 26, 53,138, 88, 91, 91,179,197, 5, 97, 95,149,205, 79, 63,253,212, 17, 0,234,214,173, 91,171,181,107,147,215,225,193,
-167,201,181,125, 27,201,174,233,131, 73,187, 22,174,233,118, 46, 93, 30,202,236,155,181,172,162,248, 74,109,218,217,217, 45, 36,
-132,244, 38,132,216, 3,128,179,179,165, 73, 43,151, 38,201, 15, 47,159, 38,215,247,111, 38,187,166, 15, 38,237, 61,220, 50, 28,
- 93,125,163,165, 54, 46,109, 13,177, 89, 17, 42,204,111,115,151,116,219, 38, 29, 30,232,201,111,169,205,134,109, 63, 63,245, 42,
- 57,149,220,185,115,135,156, 61,123,150, 92,191,126,157,236, 59,116,138,212,107, 51, 44,223,170,197,192,142,213,184,117, 42,203,
-167,121,191,126,253,200,211,167, 79, 73,159, 62,125, 8, 0,243, 26,218, 60, 25, 23, 23, 71, 34, 35, 35,201,162, 69,139, 8,128,
- 61, 83,167, 78, 85,230,228,228,144, 30, 61,122, 36, 20, 19, 44, 65, 77,242,217,168, 65,157,192, 65, 3, 58, 47,155,254,213, 16,
-159, 15, 45,207,143, 8,163, 77,163, 77,163, 77,163,205,255, 5,155,255,205,176, 47, 86,181, 74, 62, 91, 25,164,104,133, 0, 44,
- 50,176,189,185,141,246,223,171,214,108,154,187,101,251,158,249, 11,102,126,161,232,220,169, 39, 34, 46,255,138, 99, 65,135, 10,
- 84,106,205, 26, 17,131,159, 34, 51, 80, 24, 83, 69, 46,138,227,104,189,131,176,176, 48,121,237,198,111, 99, 48, 61, 43,138,205,
-186,173,154, 23,152, 2, 96,210,253,251,247,127,242,245,245, 93,249,101,199,182,131,167,119,232, 6,157, 78,135,125,251,246, 33,
- 62, 62,254, 56,128,197,134, 42,110, 17, 17, 17,233,110,141,157,102, 9, 25,193,252,105,163, 6, 89,167, 61,127,132, 87,143,195,
- 0, 0,106,181, 82,247,250,233, 53,207,234,100, 78, 38,147,221,177,182,182,126, 98,109,109,157,213,180, 97,221, 73, 18, 8,151,
- 76, 25,241,153, 77, 70, 92, 52, 18,163,138, 70, 70,213,170, 66,237,171,167, 87, 93,106, 82,187, 78, 78, 78, 18,133, 16,147, 43,
-204,175, 70,165, 75,125, 22,221,210, 16, 59,133,106,205,170,229,235,246,125,242,253,252,241, 18, 51, 51, 51,220,143,124,134, 37,
-107, 15, 20, 40, 53,186,222,233, 17, 39, 63,202,240, 24, 33, 4, 58,157,206,224,137, 14,149, 96,129,167,167,103,179,149, 43, 87,
- 58,251,249,249,225, 67,149,172,178,136,141, 75,242,175, 83,183,145,219,179, 39,247,125,107,203, 68,255,254,144,242, 52,194, 8,
- 35,140, 48,226,127, 6,253,138,197,156, 73,101, 62,195,170, 36, 90, 37,136,124,131, 66, 0, 43, 26, 50,249,219, 22,174, 92,183,
-148,166,214,143,231, 9,249,149,165,177,252, 69, 6,210, 62, 48,115,133, 66, 1,216, 79, 6,142, 18, 0,128, 80, 80,179, 14,178,
- 24, 79, 1, 12,249,229, 70,104,155, 95,110,132,254,171,248,183,239, 1, 84,107, 44,215, 84,128,200, 78,110,141,234,116,110,229,
- 46,101, 56, 37, 94, 61,126,142,204, 2, 21, 46, 69,197,103,211,132,254,181,186,153,122,241,226,197, 31, 0, 96,107, 46,127,220,
-217,173,113,189, 46, 94,238,114, 33,165,193,171, 71,247,145,163,212,224, 98, 84,124, 14, 40,170,198, 14,213, 31, 43,191,169, 17,
-167,238,254, 14,170, 7, 69, 81,151, 23, 77, 31, 41, 89,186,246,224, 71, 37, 89, 0, 10,147,146,146, 50, 10, 11, 11, 45,147,147,
-147, 53,168,121,144,184,103,185,185,185, 45,102,207,158,189, 98,222,188,121,243,127,248,225, 7, 81, 77,124,178, 42, 67, 86, 82,
-252,137, 46,238, 31,175,254,141, 48,194, 8, 35,140,248,159,192,164,114,159, 48,152,104,149, 18,134, 55, 72, 3, 48,173, 81, 35,
- 50, 39, 54, 22,154,143,149,179,138,148,174, 15,196, 93, 0, 3,106,124, 54, 77,229,221,126, 26,159,127,231,105,124, 62,120, 66,
-120, 66,212, 52,141,196, 2,173,118,213,211, 23, 73, 53,159,117, 71, 81,220,221,103, 9,202,123,207, 19, 85,132,231, 9, 79,136,
-134,162,240, 90,167,227, 87, 69,189,136, 63,245,119,200,111,122,196,201, 27, 65, 44,213,249,198,157,200, 57, 5, 5,218,205,233,
-143, 79,222,252,136,245,162,139,136,136, 24,237,237,237, 61,129,227,184,109, 0,116, 31, 96, 75,195,178,236,130,192,192,192,227,
- 17, 17, 17,135,111,222,188,153,242, 49, 72,214, 95, 90,255, 70, 24, 97,132, 17, 70,252, 83, 81,179, 69,165, 43,195,199, 36, 89,
-127, 71, 68, 62,123,233,245, 87,216,141,122,246,178,249,127, 67,126, 83, 31,159,184,151, 10,140,248,139,138,247, 34,199,113, 23,
- 63, 38,169, 62,127,254,124, 3, 84,176,172,206,223,173,254,141, 48,194, 8, 35,140,248,199, 98, 82,101,228, 75, 96, 44, 27, 35,
-254, 1, 32, 31,139,100, 25, 97,132, 17, 70, 24, 97, 68, 13, 80,169,162, 69,161,242,153, 3,151,171,241, 7, 53,153,125,112,217,
-104,211,104,211,104,211,104,211,104,211,104,211,104,243,127,206,230, 63, 17,246, 40,114,136, 63, 83,252,169,151,124,125, 76, 24,
-167,190, 26,109, 26,109, 26,109, 26,109, 26,109, 26,109, 26,109,254,211, 81,161, 35, 60, 80,228, 60,108,132, 17, 70, 24, 97,132,
- 17,255, 77,144, 20,111, 53, 61,110,132, 17,127, 53,217, 42, 37, 92, 53,241,209,106, 82,252,249,236, 47,204,236,116,123,123,251,
- 73, 30, 30, 30,174, 34,145,136,206,203,203, 91,126,245,234,213,101,229, 19,117,118, 19,220, 99,104, 56,190,253,133, 2, 40, 6,
-160,105,112, 4,175,174,135, 43, 91, 27,235,253,111, 13, 39,153,153,245,239, 20,205,136, 57, 86, 11, 78,167, 69,145,187, 85, 17,
-120,158,141,231,180,234, 94,149,157,108,231, 57,168, 30,203,241, 63, 0,100, 11, 64, 79, 5,248,173, 20, 4, 83, 8,216,159, 41,
- 48, 95,129, 33,171,193, 81,223, 8,132,204,194,148,176,163,137,255,132, 2, 59,114,228, 8,243, 33,231, 15, 27, 54,172,194, 5,
- 68, 29, 28, 28,130,228,114,121,227,202,206, 43, 40, 40, 72, 73, 73, 73,241,253,135,223,143, 93, 0,108, 2,224, 94,238,247,104,
- 0,179, 0, 4,127,232, 31,248, 0, 2, 91, 96,178, 8,248, 6, 0,180,192,234, 84, 96,123,200,223,200,199,208,218,218,250,154,
- 64, 32,112, 46, 40, 40, 40,200,203,203,107,100,106,106, 26,171, 80, 40, 20, 44,203, 62, 77, 75, 75,235,162,239, 92, 82, 52, 41,
-165, 74, 52, 7, 76, 99,128,225, 28, 77,207, 16, 2, 91,212, 60,191,173,184, 5, 55,100,129,219,169,120,187, 60,215,124, 0, 91,
-171,121,220, 8, 35,254, 10,124,208,172,195,166, 69,237, 3,124, 0,116,105,211,166,141,109, 65, 65, 1,162,163,163, 83, 1, 92,
- 3, 16, 82,188,197,124,140,156,210, 52,253,227,186,117,235,230,206,152, 49,163,116, 49,232,240,240,112,120,122,190, 31, 35,148,
-161,225,120,245,244,101,155,187, 17, 49,104,211, 99,104, 49,209,162,129,130, 20,248,246,108, 91,211, 44,152, 90, 88, 88, 44,167,
- 40,106, 24, 77,211, 85, 54, 26, 60,207,115,132,144, 35, 89, 89, 89, 75, 1,228, 85,231,143, 20,114,137,142,229,184, 10,255, 67,
-192, 48, 92, 65,161,186,210,176, 23,181,107,215,190, 73,211,116,195,178, 11,102, 3,239, 46,160, 93,217, 49,150,101, 95,165,167,
-167, 27, 66, 66,165,180, 64, 52,139,162, 68, 61, 65,243, 77, 1, 10, 20,232, 24,158,211, 92,226, 89,237, 6, 0,170, 15, 33, 89,
-246,117, 27, 93,255,122,113,160, 99,228,227,104, 44,154, 62, 10, 63,108,218,131,133,179, 38, 96,195,142, 3,152, 53,105, 36,220,
-220,220,245,182,186, 60, 68,171, 22,207, 28,214, 35, 96,203,225, 78, 11,167, 13,147, 4,108, 57,210,121,209,244,225,226, 85,155,
- 15,119, 94, 52,253,115, 73,192,230,195,157, 22,206, 28, 38, 91,181,245, 40, 15, 96, 76, 77, 50, 57,210,217,161,128, 98,217, 10,
-223,140,137, 64,160, 62,240, 52, 89,241,159,120,162,253,252,252, 60,148, 74,229,253, 81, 61, 91, 5,182,108, 90, 39,169,162, 52,
- 25,175,147,234,196, 62, 9,243, 23,138,100, 94,159,249,239, 9,215, 43, 15, 72, 36, 13,163,163,163,157,121,158, 7,199,113, 96,
- 89,182,244, 83,163,209,160, 75,151, 46, 31,107,226,204, 0, 0,203,139, 30, 86, 4, 0, 56,252, 1,182, 76, 4, 2,193,215, 98,
-177,216,135,101, 89, 87, 0, 16, 10,133,143,213,106,117, 8,203,178,235, 0,228, 87,211,222,250,164,164, 36, 55, 19, 19, 19,104,
-181,218,210, 5,232, 25,134,113,169, 87,175,222, 22,149, 74,229,252,161, 23,111, 11, 76,238,208,169,211,134,113,115,231, 50,202,
-107,215,176, 97,247,238,245,200,205, 5,128, 45, 85,157, 43, 22,139, 47,208, 52,237, 84,157,255,227,121, 62, 94,163,209,244,170,
-206, 57, 2,129,192, 57, 57, 57,217,198,193,193, 1,121,121,121, 80, 40, 20,138,146,253, 15, 65, 8, 64,245, 6,186,176, 12, 51,
-219,210,202,170,243,253,139, 23, 21,205,155, 55,167, 25,134, 89, 8,195,131, 84, 75, 0,172, 33,132,200,138,251,139, 13,237,219,
-183,247,166, 40,138, 5, 64,120,158,167,239,220,185, 51,146,231,121, 65,113,155,183, 6,192,110, 0,106, 35, 15, 48,226,255, 65,
-205,218, 81, 93,162,117, 22,128, 79,155, 54,109,100, 35, 70,140,128,143,143, 15,156,157,157, 33,149, 74,139, 26,241,140, 12,219,
- 7, 15, 30,124,126,237,218,181,207, 79,159, 62,141, 71,143, 30, 41, 1,252, 9,160,194,135,186,123,255, 78, 51,164, 38,146,141,
- 0,144,246, 42, 35,229,213,139, 55, 27, 83, 82, 82,214, 0, 40, 27, 34,188,209,152, 49, 99,230,204,156, 57, 19, 65, 65, 65, 56,
-112,224, 0,212,106, 53,242,242,244,240,151,194, 55,200,186, 18, 8, 40,226,128,132, 16, 64,110, 3, 40,108,107, 92, 82, 22, 22,
- 22,203,103,205,154, 53,219,205,205,173, 52,138,185, 78,167, 3,203,178,208,233,116,200,202,202,194,156, 57,115,138, 58, 90, 66,
-192,243, 60,206,157, 59, 55, 99,210,164, 73,200,202,202,250,186, 34,155,237,189,234,222,163, 41,218,177, 68,171, 33, 28,247,234,
-246,131, 87,173, 89,142, 99, 84, 42,109,133, 43,149, 75,165, 34,189, 36, 79, 40, 20, 58, 62,250,253,119, 27, 90, 44, 6,225, 56,
-128,231, 65,120,190,184, 56,139, 55, 82,244, 27,225,120, 16, 29, 7,158,229,193, 42,213,104, 59,117,170, 33, 69,209, 65, 40,150,
- 29, 24,253,229, 92,187,118,237,219, 11,235,215,117, 0,203,241,120, 30,247,202,238,254,189,219, 29,143,236,221, 50, 69,163,204,
- 27, 9,160, 70,113,182,196,114,179,139,155,127,254,197,241,238,131, 72, 4, 95,189,134,203, 87, 66, 0, 0, 23,174,222, 44, 33,
-220, 85, 86, 21,216,252, 22,179, 38, 14,148, 4,110, 62, 40,156, 53,113, 16,243,195,230, 67,194,153, 19, 62, 99, 2, 55, 30, 16,
-205,156,240, 25, 19,184,233,128,104,230,196,129, 76,192,134, 93, 30, 0, 44, 0,100, 85,102,172,178, 58,162, 88, 86,242,239,216,
- 84, 6, 0,210,182,109,131,238,205, 27, 56, 44, 93, 10, 0, 24,221,200,214,224,161, 9, 43, 43,171,123, 66,161,208,177,170,116,
- 58,157,174, 74, 18,236,231,231,231,169, 84, 42,239,177, 44, 75, 4, 2,129,255,168, 65,159,156,236,221,217, 51,163,108,154,240,
-240,135,150,171, 86,253, 62,240,240,253, 60,242,185,151,233,253,160, 31,253, 90,247,159,183,231,161,158, 14,153, 86,171,213,120,
-250,244, 41,202, 46,242, 94, 6, 92, 13, 31, 41, 26,192, 6, 75, 75,203,118, 25, 25, 25,163, 1, 44,202,205,205,245, 96, 24, 6,
-181,107,215, 94,164,209,104,158,155,155,155,239,204,201,201,185, 89,172, 26, 25,186,100, 64, 23, 51, 51,179,125, 39, 78,156,176,
-104,213,170, 21,157,158,158,142, 6, 13, 26, 32, 51, 51,179,237,181,107,215,188, 38, 78,156, 56, 49, 47, 47,111,108,241,203,160,
-161,104, 38,151,203,201,184,113,227, 40,142,123,123,185,187,118,237, 66,175,230,108, 99,235, 90,242, 66,149,134,228, 4, 63, 53,
-255, 74, 36, 18,253, 25, 31, 31,159, 83,221,194, 16, 1,223,140,155, 59,151, 49,121,249, 18, 38, 15, 31, 98,116,110,174,224,135,
- 34,117,171, 74,162, 69,211,180,211,190, 3,191, 58,139,197, 98,176, 44, 91, 74, 6, 75,218, 40,157, 78, 7,173, 86, 11,157, 78,
- 7,142,227,160,211,234, 16,240,253,234, 26,183,133,114,185, 92,110,111,111,159, 42,151,203,229, 31, 72, 46,235,101,210,244,151,
- 45,189,188, 38, 45, 29, 56, 80, 26, 26, 26, 42,165,105, 26, 44,203, 98,205,154, 53, 44, 33,164,150, 27, 96,246, 8,200,173,174,
-109,137, 68, 34,216,187,119,239, 72,177, 88, 12, 0,208,104, 52,104,222,188, 57,101,236,243,141,248, 15,146,173,247, 84, 46,125,
- 68,171, 79,110,110, 46, 56,142,131,169,169, 41, 24,230,221,126,223,210,210, 18, 61,123,246, 68,151, 46, 93, 48, 98,196, 8, 60,
-122,244, 72, 54, 98,196,136,158,149, 25, 27, 53,183, 63,234, 58,219, 22,119, 38,188,253,141, 51, 15, 2,119,125,119,212,250,245,
-235,215,115,203, 36,155, 56,121,242,100, 42, 35, 35, 3,195,134, 13,187,166, 86,171, 63,133,158,135,143,227,241,202,119,196,104,
-240,132,146,173,187,243, 11,165, 81, 41, 9, 77,211,202,146,161,195,154,148, 18, 69, 81,195, 28, 28, 28,112,240,224, 65,104, 52,
-239,135, 11, 51, 51, 51, 67, 84, 84,212, 91, 85,141, 97,208,190,125,123,134,162,168, 97, 0,190,174,216, 38,237,120,227,238, 75,
-155,146,253,254, 61,221, 69,237,189,232,212,228,212, 2, 2,128, 90,188,120,113, 41,113, 3,128,229,203,151, 27,146, 79,208, 66,
- 33,210, 66, 66,222, 54,196, 2, 26,180,136, 2, 37, 4,104, 65,209, 40, 42, 8, 64, 56,128,103, 1, 94, 7, 72,237,235, 26, 82,
- 12,109,235,212,115, 14, 90,181,118,107, 45,181,142,224,224,169, 96,196,197,189, 0, 67,211,104,212,216, 25,159,116,237, 44,244,
-106,227, 93,119,245,178,185,167,147, 19,158,245, 1, 16, 90,237,130,230,137,180,113, 61, 43,236,220,117, 31,214, 22, 38, 24, 54,
-176, 47,100, 82, 9,126,216,244, 43,190, 95, 56, 29,206,141,156,176,125,253,202, 74, 79, 55, 55, 55, 95,225,234,220,216,105,235,
-222, 51,112,117,113, 97,182,238, 59, 3, 87,183,226, 79,119, 87,102,235,190, 51,112,115,119, 99,182,238, 59, 3, 15,247,102,245,
-239,165,220, 89,145,153,153, 57,189,242,242, 44, 87, 71,159, 20,213,145, 48,159, 47,109,180, 95, 78,153, 2, 0,165, 68,171, 58,
- 16, 10,133,142,201,201,201, 54, 85,165,171, 74, 53, 40, 86,178,238,177, 44,139, 55,111,222, 80,217,217,217,164, 86,173, 90, 3,
-207,111, 95,116,162, 87, 39,207, 76, 0,120,248,240, 97,237,128,128, 85, 3, 15,221,203,133,242,246,102,234,223,191,135,240,163,
- 63,245,185,119, 42,208,207, 11,197, 75, 66,148,135, 90,173,142,107,217,178, 37, 41,254, 94, 71, 34,145,136,202,221,111, 14, 77,
-154, 52,121, 79,181, 54, 96, 72,113,195,173, 91,183,166,187,185,185,193,197,197,229,102,187,118,237,204, 20, 10, 5,206,159, 63,
- 15, 87, 87, 87,119, 51, 51,179, 59, 71,142, 28, 17, 46, 88,176,192,115,247,238,221, 0, 48,195,128,226,236,225,235,235,123, 48,
- 40, 40, 72, 42, 18,137,160, 84, 42, 17, 21, 21, 5,115,115,115,136,197, 98,124,246,217,103, 76,199,142, 29, 45,187,118,237,122,
- 44, 38, 38,102, 36,170, 49, 3, 74,165, 82,145, 69,139, 22, 65, 46,151, 67, 46,151, 67,161, 80, 64,161, 80,192, 68, 10,106,219,
-172,122,178,153, 59,178,101, 95, 47,221, 22,184,111,235,178,171,117,235,242,223, 38, 38, 38,102, 87,247, 94, 80, 94,187, 6,147,
-135, 15,129, 50,207,174,161, 48, 87,212,134,191,191,127, 85,138, 20, 68, 34, 17, 58,116,232, 80,165,189,218,181,107, 31, 23, 8,
- 4,239,188,153,178, 44, 43,245,247,247,231, 98, 98, 98, 20, 52, 77, 43,120,158,135,191,191, 63,199,178,172,212,198,198,230, 38,
-207,243,169,233,233,233,131,245,217,237, 10, 72,111, 2,131, 40,161,240,107,123, 7,135, 6, 62,141, 26,201, 47, 95,190,204, 0,
-128,147,147, 19, 73, 73, 73,201, 62,117,234, 84,158, 0,248,217,137,144,189,213, 32, 89,106, 0,243,105,154,222, 32,145, 72, 4,
-245,235,215,143, 95,178,100,201,173, 98,133, 20,132, 16,186,126,253,250,109,101, 50,153,147, 90,173,102, 81, 52,116,104, 84,179,
-254, 1, 32,132,120, 21,241,246, 82,104, 0,136, 75, 4,252,162,222, 14, 86,229,126, 7,128,244,226, 23, 69,219, 74,246, 51, 0,
- 60, 2,208, 12,128, 77,241,177,187, 20, 69,101,214, 32,155,149, 43, 90, 65, 65, 65,165,175,176,253,251,247, 47,237, 88, 76, 77,
- 77,113,247,238, 93, 80, 20, 5, 83, 83, 83,152,153,153,193,220,220, 28,185,185,185,120,244,232, 17,162,163,163,241,242,229, 75,
- 80, 20,133, 70,141, 26,161,228,102, 47,131,210, 6,238,183,159,130, 32, 53,145,128,162,128, 86,221, 60,224,209,165, 57,218,132,
-198,206,186,119,153,218,145,146,146,242, 20,128,160,121,243,230, 19,219,183,111,143,181,107,215, 66,173, 86,175,173,132,100,149,
-218,188,254,136,109, 13, 0,246,246,246,243,246,159,127, 46, 31,211,187,113, 97, 74, 74,202,143, 53, 40,156,119, 26,226,244,244,
-116,131,215,226,227,121, 30, 89, 89, 89,122,109,150, 87, 8,214,109,216, 92, 43, 47, 39, 21,223,253,176, 31, 58,157, 14,115,231,
-206, 5,207,243,165, 91,118,118,182, 65,249, 36, 28,247,190,118, 64, 23,141,158, 82, 2,160,222,240, 34, 94,145,112,112, 51, 40,
- 2, 80, 28,128,247,175,171,124, 39, 36,101, 68,178, 67,203,126,216, 88, 43, 44,250, 21, 78, 5,135, 65,155,155,132,148,135, 39,
-138, 36,199, 14, 35,113, 88,205,160,157, 71, 99,204, 94,188,218,226, 95,179,199, 30,210, 40,243, 92,240,238, 48,226,229,170, 31,
- 26, 14,223,173, 88,129, 29, 27,215, 98,245,218,141,200,205,201,134, 80,104, 85,220,208,115,224, 56, 78,255,181, 19,210,219,127,
-214,120,234,135,159,143,163,173,155, 61,142,157, 15, 69,167,150, 78, 56,113,241, 30,186,120, 53,192,169,203, 97,232,214,174, 49,
-206,134, 68, 98,246,228,145,212,200, 11,187,123, 87,167,142,214,175,223, 92, 43, 47, 55, 21, 65, 43,247,226,205,150, 45,136,159,
- 62, 29,109,139,211,132, 82, 20, 68,142,142,128,168,234, 58, 42,143,199,143, 31, 67,173, 86, 87,244,102, 14, 87, 87,215, 42,235,
- 93,169, 84,222,103, 89,150,164,166,166, 82,169,169,169, 80, 40, 20, 84, 84, 84, 36,231,238,222,124, 16,137, 62,250, 11, 0, 4,
- 4,172, 26,116,248,126, 46, 10,111,110,132,242,214, 38,136, 26,132,211, 59,150, 79,214, 78, 90,186,253,126,153,103,244,157,124,
-190,126,253,186,207,235,215,175, 1, 0, 13, 27, 54,140,142,137,137,105, 86, 50,212, 92, 60,132, 40, 98, 89,214,185,100, 56,145,
-101, 89,168,213,106,244,232,209,131,209,119,237, 22, 22, 22,237, 93, 93, 93, 17, 22, 22,134,141, 27, 55,214,246,245,245,197,179,
-103,207, 64, 81, 20, 86,173, 90, 69,185,185,185, 9,211,211,211,209,171, 87, 47, 28, 63,126,188, 67,110,110,110, 85,229,105,170,
- 80, 40,118,159, 62,125, 90, 74,211, 52,242,242,242,192,243, 60, 58,118,236, 8,154,166, 17, 25, 25,137,197,139, 23,227,248,241,
-227, 56,121,242,164,204,203,203,107,119, 97, 97,161, 43,222, 29,214,175,172,142,136, 74,165, 34, 18,137, 4, 18,137, 4, 82,169,
- 20, 82,169, 20, 98,177, 24,249, 42, 96,210,186,120, 53, 35,181,226,221, 91,118,106, 60,126,230, 42,250,199, 37, 19,174, 0, 56,
-101,232, 61, 15, 20,249,100,109,248,245,215,141,163,115,114,104, 0,216, 73, 81,188,150,144,213,134, 60,239, 0,144,175,202,129,
- 83, 35, 71, 28, 59,116, 18, 67,134, 15,172,144,100, 9,133, 34,136,132, 66,152,213, 86, 84,105, 83, 36, 18,217, 70, 71, 71, 91,
- 10,133, 66, 16, 66,192,113, 28,180, 90,109,234,191,254,245, 47,235,126,253,250,153,158, 59,119,142,238,215,175, 31,111, 97, 97,
- 81, 16, 26, 26,250,134,101, 89,203,206,157, 59, 87,106, 83, 14,120,168,204,155,108, 16, 51,172, 71,224,162,105,146,177, 99,199,
- 50,227,199,143, 71, 66, 66, 2, 38, 78,156,168,186,116,233,146,230,117, 74,202, 41, 49,207,111,214, 2,225,134,182,201,229,176,
-213,195,195,163,213,137, 19, 39, 38,248,251,251,223,155, 55,111,222,119,101, 15,174, 89,179,102,197,217,179,103,157, 6, 13, 26,
-180,239,225,195,135, 91,171,211, 46,125,104,223, 97,180,249, 97,168,140,139,148,136,163, 20, 69, 5,149,105,179,251,151,236,251,
-251,251, 47, 10, 8, 8,136,162, 40, 42,168,236,239, 37,233,138, 95, 22,131, 42,218, 47, 62,183,246,194,133, 11,155, 7, 6, 6,
-174,242,246,246, 62,120,243,230,205, 23, 0,170, 75,180,244,251,104,149, 92, 80,217,139, 44,215,169, 33, 55, 55, 23,185,185,185,
- 72, 76, 76,196,182,109,219,138, 31,104, 33, 4, 2, 1, 4, 2, 65,169, 63, 67,101, 8, 14,250,115, 19,128, 77,173, 90,181, 18,
- 70,220, 58,114,238,155, 29, 51,187,183,238,209,138,185, 31, 28, 49, 20, 69,235, 17,246, 25, 55,110,156, 21, 0,236,221,187, 55,
- 29,192,185,255, 16,107, 62,242,244,233,211,217,246,246,246,165, 62, 42,101,135, 15, 89,150,133, 84, 42, 69,137, 47,139, 74,165,
-194,182,109,219, 88, 66,200, 17, 61, 54, 17, 19,117, 5, 79,163,174, 22,157,199,243,224,185,183,231, 47, 91,182, 12,132,144,210,
-206,126, 74,177,114, 82, 37,201,171,168,204, 73,185,207,114,191, 19,142,171, 98,120, 66, 52,115,232,216,233,246, 60, 37,192,239,
- 87, 30, 64, 40, 20,130, 47,163,102, 10,153,162,183,229,168,103,201,112,176,117,199,167, 35, 39,219,157,216,183,121, 38,171, 85,
-253, 80,221,178,118,241,240,198,172,217,179,241,203,142, 29, 88,188,116, 69, 41, 3, 96, 57, 14,108,149,249,164,233, 30, 29,155,
-131,205, 79, 6,195, 48,232,214,182, 49, 24,134, 65, 79,239,166, 96, 24, 6,189, 58,186, 64, 32, 16,160,119, 39, 55, 52,105,210,
- 4, 2,129,128,174,162,222, 17, 19, 21,140,167, 81,127,148, 33,189, 4, 4,128, 54, 37,229,189,244,186,148, 20,144,122,150,213,
-189,183, 48,113,226,196,236,196,196, 68,109,249, 99,117,235,214, 21, 93,187,118,173, 86, 37,195,118,165,144,201,100, 94, 2,129,
-224,126,102,102, 38, 47,151,203,105,158,231,120,119,247,230,204,249,237,139, 78,148,164, 89,184,112,209,137,207,189,204, 6,237,
- 63, 18, 68, 68,245, 59, 81,148, 80,194,126,185,116,187, 72, 40,146,121, 1, 74, 67, 94, 30,104,181, 90,141, 39, 79,158,160,170,
-252, 16, 66,244, 14,211,100,101,101,141,115,117,117,189,182,105,211,166,218, 20, 69,225,250,245,235, 96, 24,166,116,139,141,141,
- 5, 77,211,248,230,155,111,180,185,185,185, 95, 84,149, 55,129, 64, 48,251,216,177, 99,230, 98,177, 24,121,121,121,165,207, 13,
-195, 48,136,142,142,198,143, 63,254,136,113,227,198, 33, 33, 33, 1, 14, 14, 14,152, 59,119,174, 73, 96, 96,224,108,173, 86,187,
-194,128, 42, 10,215,104, 52,173,229,114, 57,164, 82, 41, 74, 8, 23, 0, 92,140, 18, 70, 42,149,202, 22,150,150,133,118,214, 33,
- 65,191,119,240,253,212,211,210,218,222, 59, 37, 37,165, 90, 75,103, 61, 7,118,196,113,220,191,250,156, 56, 97,115,227,196, 9,
-254,246,233,211,175, 36,121,121,219, 13,190,135,116, 52,226, 99, 95,193,203,203, 11,247,239,223,135,151,151, 87, 89,210, 4,177,
- 88, 12,145, 72, 4,145, 72, 4, 43, 11,131, 92, 40, 8, 77,211,184,113,227, 6, 56,142,131, 70,163,129, 70,163,129,155,155, 91,
-230,213,171, 87, 77, 0, 32, 54, 54,150,140, 25, 51, 38,251,206,157, 59,104,217, 82,255,122,234, 42,138, 10, 94,182,234, 39,243,
- 31,214,239,134,121,109, 91,132,132,132,112,231,207,159,207,163,128,152,167, 81, 81,107, 63, 5,206, 30, 1,180,213, 41, 51, 91,
- 91,219,107, 12,195,212, 47,251, 91, 70, 70,134,197,224,193,131,145,149,149,213,119,240,224,193,157,138,219,132,164,163, 71,143,
-142, 1, 0,177, 88, 12,154,166, 57, 24,241, 95,133,170,184, 72, 89,162, 84,158,112, 5, 4, 4,244, 47,255, 91, 89, 82, 85,209,
-247,178,231, 6, 6, 6,174, 42, 99, 91, 89,131,236, 87,237,163, 21, 20, 20, 68, 42, 96,144, 6,163, 42,162, 85,130,176,176, 48,
-157,131,131,195, 47, 79, 31,188,236,222,216,163, 17,100, 10,201, 39, 0, 54, 73, 36,146, 57, 99,199,142,197,237,219,183, 17, 25,
- 25,185, 11, 31, 56, 11,167,121,243,230, 23, 36, 18,137, 83, 37,195, 36,241,145,145,145,189, 42,233, 24,150,158, 62,125, 26,250,
-156,225,175, 92,185, 82,182, 83, 42,235, 12, 95,241,141,193, 19,232,180, 58, 20, 20, 42,223,118,226,197, 68,171,160,160, 0,195,
-135, 15,127, 71,209,122,243,230, 77,149,215, 71, 81, 20,126, 60,117, 10,151,142, 28, 65, 95, 79, 79, 28, 15, 13, 69,224,216, 81,
-112,113,170, 3,194, 81, 32, 20,144,112, 96, 51, 50,114,243,241, 91,240, 13,100,230, 21, 98,116,231,206,112, 54,179,210,111, 87,
- 40,234,217,182,189,183,232,242,205, 71, 16, 10, 5,160,193,131,232, 10,225,224,218, 21, 12, 77,195,220,182, 1, 68, 66, 33,132,
- 66, 1, 98, 19,211,225,218,188,141, 56, 72, 44,237, 89, 19,162, 85,215,169, 1, 56,142,195,184,113,227,112,240,224, 65, 88,218,
- 57,193,188,110,115,124,191,118, 7,250,246,232, 92,229,245,151,188,193, 11, 4, 2, 48, 12,243,222,103,201,119, 67,212, 73,194,
- 19,104,203,215, 17, 79, 0, 66,224,184,114, 37, 28, 87,174, 68,104,241,127,186, 21, 20, 64,169, 84, 2,237,220,171, 69,178, 52,
- 26, 13, 18, 19, 19,181,175, 95,191,182,173,224,120,170, 70,163,169,146,216,236,217,179, 39,220,207,207,175,117,237,218,181,239,
-133, 63,124,168,243,240,244, 20,158,219,182,232,100,201,176, 33, 0,120,122,122,102, 46, 90,180,232,228,152, 97,253, 7,110,245,
- 31,193, 77, 93,177, 79, 32,145,201, 90,247,159,183, 39,252,192,176, 97, 85,143,205,168,213,113, 30, 30, 30,196,144,235, 42, 44,
- 44,124,173,231,240, 0, 0,203, 91,181,106,101,230,235,235,139,107,215,174, 97,200,144, 33,106,173, 86,251, 20, 0,250,245,235,
-215,244,183,223,126, 19, 63,122,244, 8,214,214,214,194,248,248,248,221,168,194, 65, 94, 44, 22,119,109,211,166, 13,173, 86,171,
-223, 35, 89,129,129,129, 24, 57,114, 36,154, 54,109, 10,158,231,145,159,159, 15, 95, 95, 95,225,198,141, 27,187, 26, 72,180,102,
-185,184,184,252,136,162, 89,135,101,219,194,199,197, 67, 80,200,200,200,120,253,224, 78,112, 84,231, 30,131, 91,215,111,210,220,
- 62, 50,252,190, 94,131, 54, 54, 54, 11,105,154,254,156,231,121, 38, 55, 55, 55,241,129, 70,211,196,205,201,201,182,227,192,129,
-200, 17, 10,153, 13,193,193,116,106, 94,158, 9, 0,131,134, 32, 85,186, 2, 56, 53, 42,114,245, 27, 50,124, 32,238,223,191,143,
-161, 35, 6, 65, 36, 18, 65, 32, 16, 22, 61,155,162, 34, 69,171,150,149,153, 65,247,166, 78,167, 43,109,195, 75,252,188,180, 90,
- 45, 74, 92,179,228,114,121,233, 49,181, 90, 13,138,162,244,221, 27,180,111,151,142,184, 25, 22,195,126,241,205, 6,181, 48,227,
-126,160, 29,207,239,121, 5,164,126, 64,115,238,124,120,197, 18, 27,153,153, 57, 56,157, 14,238, 3,135,150, 62, 39,119,118,110,
-149,129,231,101,217,241,113,152,113,228,244,199, 94, 51,215,136,255, 0,170,226, 34,101,137,210,135,130,162,168, 32,127,127,255,
- 69, 0,136,191,191,255,162,146,253,128,128, 0, 37,128,164, 26,146,173,247, 84, 46,193,199, 32, 89, 37,195, 11,250,224,235,235,
- 59,195,212,212,116, 99,201,126,226,237, 36, 36,222, 78,130,107, 51,247,142,173, 60, 91,231,140, 28, 57, 18,150,150,150,152, 55,
-111, 30, 1,176,171,186,255, 31, 27, 19,101, 2,128,216,219,219,207, 43,110,144, 61, 67, 67, 67,173,239,222,189,139, 54,109,218,
-188,149,238,181, 90,116,234,212, 73,159,169,188, 98,167,246,175, 63,158, 74,198, 67,171,213,162,176, 80, 9,141, 70, 11, 86,199,
-131,101, 89,120,185,155, 98,223, 14,255,162,223,216, 18,245,172, 72, 53,115,180, 51,133,169,137, 80, 71,211,148,242, 94,248,235,
- 10, 91, 76,141, 70,131,240,248,120, 60,124,249, 18, 0,240,105,128,126,199,215,125,193,215,224,230,230, 86, 85,110, 27, 59, 58,
-216, 33,249, 82,120, 81,227,173, 76,196,221, 63, 15,195,212,212, 4, 0,224,238, 51, 26, 34, 81, 17,209, 42, 80,106, 97,213,172,
- 46, 40, 66, 42, 13, 11, 32,183,176,187, 32, 16, 73,157, 8,199,131, 16, 30,132,231, 64, 8, 15, 70, 40,146,207,152, 50, 1, 60,
-207,161,109,219,182,160, 24, 6,156, 78,141, 97, 3,122, 34, 43, 39, 15,150,181, 12,235, 36, 68, 34, 17,124,124,124,100,149, 29,
-127,246,236,153,178, 44, 49,211, 95, 71, 58, 20, 20, 40,161, 86,171,161,213,176,208,234, 88,112, 13, 69,248,238, 95,163,192,106,
- 89, 20,142,240,134, 86,199,130,159, 61, 8, 90,141, 14, 9,114,154,246,112,181,210,209,160,148, 15, 30,167,153, 85, 69,180, 74,
-200, 65,101,168,200, 39,176, 18,178,245,208,207,207,207,203,195,211,243,254,231, 61, 60,127,138,136,140, 74,142,136,140,122, 47,
-157, 83, 83,207,184,169,129, 7,231, 10, 69, 50,175,254,243,244,207, 58, 44,139,178,195,136, 31,136, 69,121,121,121, 30, 38, 38,
- 38,136,137,137, 1,195, 48,160, 40,234, 25, 0, 15, 0,176,183,183,127, 46, 16, 8, 26, 49, 12,131, 45, 91,182, 80, 2,129,160,
-133,183,183,247, 34,149, 74,117, 88,207, 11,157,171,169,169,233, 59,106,150, 72, 36,130,191,191, 63,198,140, 25, 83, 74,178, 68,
- 34, 17,246,236,217,131,214,173, 91, 67,163,209,184, 26,152,223,187, 0, 58, 27,160,248, 81,197,228,188, 74, 50,202,178,172, 95,
-198,231,159, 55, 65, 72, 8, 58, 54,106,228,230,229,229, 5,173,246,173,160,211,168, 81,163,186,121,121,121,175,149, 74,229,191,
- 81, 20,134,224,129, 94, 82,164,226, 17, 31, 91,228,126,122,255,254,125,180,109,219,182, 84,193, 42,171,102,137, 68, 34,200,196,
- 38,213, 34, 90, 60, 95,212, 46,229,229,229,209, 33, 33, 33, 86, 46, 46, 46, 20, 0,184,184,184, 80, 15, 30, 60,168, 45,151,203,
-211, 27, 55,110, 92,213, 11,176, 8, 0,186,126, 50, 88,112,233,252, 89, 5, 11,172,120,205, 48, 43, 4, 85,182,145, 68,199,241,
-124,165, 78,247, 50, 51,115,236,241, 27, 14, 0,248,182, 71,239,210,151,173,243,203, 23, 65, 40, 20,162,251,188, 69,239, 61, 75,
- 60,207, 51, 48,226, 31, 69,178, 42, 82,180, 62,172,111,126,171,104, 5, 4, 4, 68, 5, 4, 4,188,167,142, 85, 19, 85, 43, 90,
-101,165,187,234,162,228, 97,173, 12,107,215,174, 69,139, 22, 45,244,118, 68, 27, 55,110,196,254,253,251,215, 2,136,173,182,228,
-216,189,149, 59,214,157,136,106,212,212,157, 2,128, 21,179, 7,208, 5, 5, 5,184,113,227, 6,204,205,205,241,236,153,193, 97,
-191, 76,205,205,205,151,211, 52, 61,140, 41, 63, 3,160, 98,130,201,241, 60,127, 36, 39, 39,167,210,240, 14,132, 0, 90, 29,139,
-130, 66, 21, 52, 26, 13,102,127,179,185,202, 76, 4, 0,148, 86,147, 39,240,233,226, 45,171, 76,209,105,219,162, 43,166,141, 53,
-121,175,243,102,104,128,166,129,150,109,139, 20,151, 7,161, 81,224,121,128,227, 1, 43, 27, 11,236, 58,240,147, 94,146,207,114,
-124,241,219, 49,135,124, 53, 7,215,246,253,241,234,113, 72,169,130, 36, 22, 21, 13, 25,139,132, 66,240,132, 42,138,250, 80, 89,
-171, 43,150, 57,101,165,196, 58,239, 8,138,192,164,254, 45,112,244,114, 56,134,246,240,192,213, 59,143,224,219,206, 13, 81, 79,
- 95,194,221,185, 62,182,236, 62, 2, 66,144,247,243,186,239, 95,191,237,208,216,120, 67, 20,173,219,183,111, 43,203,171, 88,101,
- 63, 73,213,253, 33, 8,121,171,104, 41, 85,106,204, 91,104, 80,232,157,162, 58,234,220, 94,102, 72, 98,125,138,149, 33, 68,172,
-188,178,133, 42,194,179, 52, 4,208, 26, 88,240,159,108, 56, 57,142,195,153, 51,103, 74,235,163,162,122, 44, 91,119, 6,144, 28,
-196,199,199, 35, 42, 42, 10,237,219,183, 71, 78, 78, 14,132, 52,141,185, 17, 17,112, 27, 59, 22, 26,145, 8, 60,207, 67, 44, 22,
- 99,242,228,201, 6,151,103, 53, 91,231, 98,199,107,174, 42,227, 63,121,123,123, 55,137, 41, 40, 64, 84,116, 52,122, 44, 91, 6,
- 0, 56,123,246,236, 59,247,196,156, 57,115,196,143, 30, 61,154,120,239,222,189,137,201,201,201,107, 1,204,173,180,157, 37,234,
- 82, 31,173,207, 71, 13, 65, 19,151,134,216,255,235,129,210,227,115,230,207,130, 80, 40,130, 80, 36, 68, 45,243, 90, 6, 93,141,
- 78,167, 43, 37,173,133,133,133,244,217,179,103, 29,123,246,236, 41,154, 53,107, 22, 5, 0,251,247,239,167, 55,109,218,164,184,
-116,233,146,168, 78,157, 58, 41, 85, 40, 4,185, 73, 25,106, 9, 0,212,171, 87, 15,155,183,255, 78,247,235,215, 15,179,102,205,
-130, 78,167,195,214,173, 69,207,213,200,145, 35,161,213,106,113,236,216,177,146,231, 88,175, 26,197,106,181,239,221, 55, 20, 69,
- 65, 40, 20, 66, 36, 22, 1, 60, 15,138,162, 20,107,214,172, 89, 17, 21, 21,213,198,197,197, 5,106,181,122, 44,138, 38,127, 24,
-227,104,253,151,145, 45,125, 92,164, 34, 95,171, 98, 85,170, 50,164,149,245,219,170,140,168,149,245,217, 66,205, 38, 80, 24,230,
-163, 85, 17, 24,134,169, 82,173, 42,153,170,171, 15,115,230,204,129,169,169,105,101, 29, 16,137,136,136,120,148,146,146,178, 3,
-192,230, 26, 85, 78,112, 88,212,242,175, 7,229,161,120,108,181, 86,173, 90,233,221,186,117,203, 7,160, 61,124,248,221, 23,100,
-181, 90, 93,105, 7,110,110,110,190,124,231,206,157, 51, 7, 14, 28, 72,151, 15, 49, 80,118,120,175,100,211,233,116, 56,124,248,
-240,204, 5, 11, 22, 32, 39, 39,231,107,125,157,120, 97,129, 18,202, 98, 71,232,231,145, 71, 13,109,212, 43, 61,100, 82,203, 30,
-142, 13, 61, 42,237, 76,104, 81,145, 15,145,109,189,183, 29,152,169,169, 20,156, 30,155, 20, 69,199,190, 76, 72,174, 83,215,174,
- 54,158, 39,166,193,182,126, 11,100, 37,189, 45, 7,129,128,129,176,120,232,176,150,153, 2,105,111,222,128,166, 25,189,196,248,
-251,223,194,112, 39,242, 37,142, 93,126, 0,173,170, 0,235,246,158,135, 86,157, 15,173,170, 0, 90, 85,209,231,170, 5, 95,130,
-162,240, 90,167, 46,104, 90,157,122, 23, 8, 4,104,215,174, 93,165, 68, 39, 41, 41,201, 64, 69,139,148, 42, 90, 74, 85, 53,235,
-200,176, 55, 39,189,138, 85,201,241,154, 18,131,146,144, 15, 50,153,172,245,158, 61,149,135,113,168, 8,118,118,118,231, 76, 76,
- 76, 26, 24,154,190, 26,193, 75, 87,213,170, 85,107,185,139,139,139,235,186,117,235,132, 12,195,160,123,247,238, 77,237,236,236,
-226, 1,192,221,221,221,161,164,141,153, 58,117, 42,185,125,251,118,100,209, 59, 70,229, 16,139,197,209,230,230,230,173,125,125,
-125,145,147,147,131,196,196, 68, 40, 20, 10,184,253,244, 19, 34,166, 78,133,231,182,109,160,187,117, 3, 69, 81, 16,139,197,136,
-136,136,128, 76, 38,139, 86,169, 42, 13,249,214, 14,192,106, 0, 29,241,118,184,144, 0,184,129,162,176, 11,119, 42,104,239,104,
- 0,224,120,190,170,202, 26, 53,111,222, 60,100, 11,133, 64,191,126, 16,197,198, 66,171,213,162,125,251,246,165, 42,123,251,246,
-237, 33, 16, 8,224,225,225, 1, 7, 7, 7,108,217,178,101,148, 62,162,165,202,215, 34, 62,246, 21,188,189,189, 75,149,171,126,
-253,250,149, 42, 90, 66,161,176, 84,217,162,184,170,137, 43, 69, 81,164,236, 75, 50,199,113,148, 64, 32, 16,124,253,245,215,212,
-144, 33, 67,136, 70,163,225,197, 98, 49,125,236,216, 49,234,234,213,171,130,130,130,130,170,212,134,130, 17, 35, 70,216,212,173,
-235,136,196,231, 81, 56,122,148, 96,237,218,181,184,118,173, 40,202, 70, 76, 76,209,196,213,146,125, 95, 95, 95, 52,104,208, 0,
-164,138, 27,185,181, 22,192, 0, 0, 32, 0, 73, 68, 65, 84,191,249,160, 97,248,182,103,159,162,246,164,129, 53,132, 34, 33,196,
- 34, 17,230, 69,191, 42,173,107,179, 61, 7,197,129,129,129, 67, 93, 92, 92,138,134,246, 1,129, 49,142,214,127, 23,170, 16,122,
-210,202,145, 36, 77,153,253, 52, 0, 84,241,126, 90, 25, 66,149, 70, 81,212, 93, 66, 72,155,114,105, 75,142,107,202,125,150, 28,
-127, 88,131,236,151,172,117,248, 30,249,210,247, 70,252,244,214,173, 91,206, 94, 94, 94, 72, 72, 72,120,111, 38, 92, 73,199,165,
- 80, 40, 32,147,201,112,243,230, 77, 0,120, 90,153,177,171, 87,175,110, 66, 81,212,101, 20, 15, 27,120,251,126,222,245,102,219,
-222,109,240, 91,192,129,156,148,148, 20, 15,188,141,161, 67, 57, 56, 56,140, 17,138, 5,195, 27, 53,175,231, 3,158, 95, 29,124,
-250,198, 50,125, 87,216,168,169,123, 62, 0,101,201,172,195, 26,206, 62, 4, 77,211,195, 6, 14, 28, 72, 63,122,244, 8,195,135,
- 15,199,254,253,251, 43, 77, 59,102,204, 24, 28, 60,120, 16, 3, 7, 14,164, 23, 46, 92, 88,105,120,135,119,213, 18,205, 71,187,
- 41, 99,158, 61,196,190,131, 59, 43,245, 65,178,177, 41,242,199,122,243, 38,189,244,183, 54, 94,250, 71, 70,120, 86,115, 41,236,
- 94,168,119,135, 46,221, 69,137,169,217,224, 89, 53, 84,121,111,207, 47,204, 78, 5, 97, 85, 16,201,107,195,206,202, 28,247,111,
- 93,212,104, 53,170, 75,250,108,206, 28,232,142,169, 3, 92, 1,194, 99,208,220, 93, 8,218, 60,163,244, 13,186,211,144, 89, 8,
- 62,188,193, 96, 31,191,242, 16, 10,133,136,136,136, 80, 86,166,102, 49, 12, 99, 72, 76,174, 98,213, 81,135,194, 66, 37, 10,149,
-170,143,217,118, 88,219,218,218,254,108, 97, 97, 33,173,132, 72, 89, 91, 91, 91,255,108,105,105, 41, 53,116,232,176, 50,146, 85,
- 28, 87,235,158,159,159, 95,181,200,150, 68, 34,105,240,244,233,211,210, 96,165,250, 62, 53, 26, 13,124,125,125, 13, 13, 94,122,
- 26,192, 11,123,123,251, 27,110,110,110,230,207,159, 63,199,129, 3, 7, 68, 66,161,176, 94, 73,251,145,151,151, 7,134, 97,240,
-230,205, 27, 29,128, 9,168, 98,232, 76,173, 86,135,132,132,132,180, 28, 48, 96, 0, 19, 29, 29, 13,134, 97,138,242,229,237, 13,
-207,109,219, 16,249,245,215,240,121,249, 18, 42,173, 22, 82,169, 20, 23, 46, 92,208, 22, 22, 22,134, 84,102, 79, 38,147,237,136,
-139,139,115,151, 74,165,208,106,181,224,121, 30, 52, 77, 83, 2,129,160, 83,173, 90,181, 54, 2,104, 83,174,178,108, 60,219,248,
- 54,227, 88,150, 75, 73,120,158, 86, 85, 1,100,100,100,224,244,233,211,104,223,190, 61,124,124,124,144,148,148,132,216,216, 88,
-244,237,219,183, 52,205,195,135, 15, 17, 22, 22,134,198,141, 27, 87,173,232,209, 58, 52,110,214, 0, 34,145,168, 72,205, 17,138,
-138, 95,124,132,165, 74,150, 72, 40,130, 80, 32,132, 84, 38, 53, 88,209,162, 40, 10, 52, 77,131,162, 40,200,100,178,146,151,108,
-222,209,209, 49, 37, 51, 51,211, 30, 0, 35,147,201,192,113,156,222,151, 22,158, 16,103, 81,250,205,228,185, 11,126,180, 9, 8,
-184,140,203,151,223,128,166,105,216,219,219,131,166,105,196,197,197,129,166,105, 56, 57, 57,129,166,105, 36, 37, 37,149,144,196,
- 44, 84, 78,134, 75,159, 27,138,162, 74, 73,150, 72, 44, 42, 85,182, 0, 32, 59, 59, 91, 53,112,224,192,127,171,213,234,241,168,
-217,170, 39, 70,252,141, 65, 81,212,221,255,196,185,213, 64,191, 98, 98,245,158, 83,188,190,155,177,111,135, 14, 29,182,141, 28,
- 57,178,251,250,245,235, 97, 98, 98,130,148,148,148,210, 14, 81, 44, 22,163,110,221,186,200,204,204,196,246,237,219,241,234,213,
-171, 43, 0, 38, 27,154,163,148,148,148,219,207, 30, 60,205,240, 29,218,193,210,189, 67,179, 90,137, 79, 95,181, 79, 73, 73,185,
- 89, 76,178,118,141,156,211,119,188,239,224,182, 16,137,133, 72,124,246, 26,193,167,111,252,191, 84, 38,195, 48, 12, 69, 81, 24,
- 62,124,184, 65,233, 71,140, 24,129,144,144, 16,232, 27,102,228, 75, 20,173, 66, 21, 10,148, 31,239,197,106,218,140, 49,152, 54,
- 99, 76, 41,153, 48,100,232, 5, 0, 28, 28, 14,233, 33, 90,218,245, 65,135,182, 79,106,213,214,219,169,181,123, 3,220,185,247,
- 0,191,109,123, 43, 50,236,222,180, 2, 63,236,190,130,186,182, 22,208,170, 11,112,238,232, 47,175,181,234,194,245, 53, 20,229,
-138,200, 45, 69,129, 16,190, 90,215, 94, 66,158,132, 66, 33,154, 55,111, 94,169,162,149,153,153,169,172, 74,205, 42,173, 35,141,
- 14,249, 5, 74, 40, 11, 63, 26,209,242,236,212,169,211,165, 35, 71,142, 88,218,216,216, 32, 57, 57,185, 60,209,242,236,216,177,
-227,165, 35, 71,142, 88,218,218,218, 34, 49, 49,209,224,176, 34, 21,144, 44,164,165,165, 81, 89, 89, 89,188,133,133, 69,181,200,
- 22, 77,211, 80,171,213,120,252,248,177,161,127,107,240,108, 46,115,115,243, 61, 7, 15, 30, 52, 79, 79, 79, 7,195, 48,120,252,
-248,241, 59,179, 14, 75,182, 93,187,118,137, 6, 13, 26,180, 51, 59, 59, 91,239,180, 54,150,101,215,142, 25, 51,102, 98, 82, 82,
-146,133,141,141, 13, 82, 82, 82, 32, 22,139, 65, 8, 1,229,235,139,206, 47, 94, 64,203,113,144,201,100,136,137,137,193,142, 29,
- 59, 10,138, 67,197, 84, 40,144, 81, 20,229, 44, 18,137, 48,122,244,232,119, 14,236,221,187, 23,159,182,102, 90, 91,155, 11,242,
- 89, 72,213,169,178, 62,231, 24,134,161, 60,219,117,107,218,174, 75,191,230, 79, 34,239, 60, 79, 75,125, 85, 85,163,164,211,104,
- 52,112,113,113,193,221,187,119,113,249,242,101,116,235,214, 13, 62, 62, 62, 8, 15, 15,199,197,139, 23, 17, 22, 22, 6,138,162,
- 96,105,105, 89,226,126,161,215, 7, 67, 83,200,226, 77,114,198,123,234, 85,249,125,145, 72, 4,181,210,176,201,125,209,209,209,
-184,123,247,110,105,104, 25,134, 97,216,177, 99,199,130, 16, 66,226,226,226, 96,106,106, 74,252,252,252, 56,129, 64,192, 38, 37,
- 25,230, 31,108, 98, 98, 2,103,103,231,119, 94,124, 74,182,206,157, 59,227,222,189,123,160,105, 26, 2,129, 0, 54, 54, 54,184,
-113,227, 70,149, 55,126, 9,169, 42, 33, 89, 2,145,240, 29,210,199,243,124, 94,120,120,248, 36, 0,225,197, 74, 22, 96,140,163,
-101,196,255, 31,206,224,253,133,165,171, 84,180, 94, 0,232,113,224,192,129, 81, 39, 79,158, 92,187,113,227, 70,235,254,253,251,
- 35, 43, 43, 11, 78, 78, 78,176,183,183, 71, 80, 80, 16,206,158, 61,155,206,113,220, 92, 0, 21, 73, 63, 61,160, 39,102, 77,210,
-243,148, 35,234,252,252,169, 94, 62,174,184,114,248,122,128,157,157,221,100,134, 97,102,251, 45,250,108,124,215,129,109, 16, 19,
- 22,135,219, 23, 35,144,154,144, 94,165,205,242,206,240,181,106,213,154, 40,151,203,197,168, 96, 42,113, 5,179, 14, 75,109,114,
- 28,199,105, 52, 26, 28, 58,116,200, 32,178,117,224,192, 1,168, 84, 42,112,239,143,175,150,218, 36, 60,161, 4, 66, 9, 28,234,
-186, 64,171, 45, 0,207,215,120, 66,101,169,205,146, 55,208,231, 98, 49,108,210,211,113,231,206, 29,195, 40,119,191,126, 85,213,
-145, 74,163,202, 27,189, 97,229,188,160,233,254,171,107,117,235,208, 18,223,254,180, 23, 90,237,110,208, 12, 13,153, 68, 4,175,
-182, 29,193, 64,141,159, 3,231,103, 23,230,102,141,198,251, 75,241,188, 99,147,232, 27, 97, 33, 0,199,243,184,124, 45,212,224,
-107, 47, 51,204, 1,129, 64,128,103,207,158, 41, 43,154,109,200, 48, 69,195,156, 37,111,234,250,108, 18,158,167,132, 34, 41,234,
- 58,185, 65,163,206,255, 40,117,100, 99, 99, 51,255,196,137, 19,150, 37,161, 18,194,195,195, 65, 81,212,227,183,138, 99,209,113,
-165, 82,137,200,200, 72,132,135,135, 3, 69, 51,220, 12,126,142, 74,148,172,180,180, 52, 42, 37, 37, 5,114,185,156, 14, 15, 15,
- 87,123,120,120,220,171,226,249, 46,181,169, 82,169, 94, 86,230, 63,169, 82,169,234, 72,165, 82, 97,185, 14,207,161, 73,147, 38,
- 49, 21, 12, 33,190,151,207,156,156,156, 59, 11, 22, 44,240,234,221,187, 55,230,207,159,159,105, 97, 97, 97,250,243,207, 63, 11,
- 24,134,161,166, 79,159,206,189,121,243, 38,255,151, 95,126, 49, 63,121,242, 36,178,179,179,111, 26,112,237,121, 42,149,106, 82,
-135, 14, 29,246,158, 63,127, 94,238,236,236,140,220,220, 92, 16, 66,176,103,207, 30, 76,159, 62, 29, 82,169, 20, 49, 49, 49,248,
-244,211, 79, 11, 11, 11, 11, 39,225,125,223,201, 18,155, 20, 69, 81,132,231,121, 44, 89,178,164, 52, 56,105, 73,176, 82, 83, 25,
-133, 29,115, 26, 42,102,253,146,163, 24,245,237, 47, 99, 1,128, 99, 89,238, 73,228,157,231,123, 54,127,123, 85, 36, 18, 93,171,
-162,142, 22,207,154, 53,235,231,126,253,250,201, 76, 76, 76,144,153,153,137, 27, 55,110,224,214,173, 91,184,125,251, 54, 52, 26,
- 13, 44, 45, 45, 97, 97, 97,129,148,148, 20, 68, 71, 71, 43, 1, 44,214,103, 83, 44, 23,162, 81,211,146,153,191, 69, 10,150,176,
-204,108,195,178,234,150, 72, 40, 52,232, 57,234,210,165, 11,218,181,107, 87, 66, 86,184,248,248,248, 20,181, 90, 77,149, 33,253,
- 73, 37,132,188, 94,189,122,236,254,253,251, 73, 85, 54,121,158,127,143, 76,119,238,220,185,244,165,176, 93,187,118, 96, 24, 6,
- 15, 30, 60,168,204, 53,229, 29,155,183,119,108,193,249,239, 22, 67, 44, 18, 97,238,227,196, 82,210,181,183, 91, 43, 8,197, 34,
-184, 14, 24, 82,246,220,173, 40, 26, 46, 68, 57,146,165,175, 63,250,224,231,221,104,243,127, 30, 41,168,193, 18, 60, 37,248, 77,
-165, 82,157,251,242,203, 47, 3, 61, 61, 61,191, 92,183,110, 29, 37, 18,137,176,108,217, 50,146,156,156,252,107,241, 27, 67, 86,
- 77,114, 69, 8,249,245,143,227, 55,167,140,243, 31, 72,205, 89,239,215,233, 94,112,100,116,139, 14,206,104,209,193, 25,247,174,
- 60,194,230, 69, 7,246,115, 58,110,201,235,215,175, 19,170, 48,165,238,209,177, 89,121,103,120,203,144,171,193,150,213,157,117,
-200,243,252,145, 3, 7, 14,204, 28, 60,120, 48, 29, 26, 26,250,158, 79, 86,201,178, 59, 60,207,227,210,165, 75,208,106,181,248,
-245,215, 95,121,158,231, 43,143,163, 5,114,106,195,250,192,113,191,238, 59, 37, 22,139, 40,220,186,118, 12, 57, 89,250,103,117,
-137, 68, 66,236,218,115, 92, 43, 18, 9,159, 84,116, 92,171,213, 38, 6, 7, 7,219,246,226, 56, 33, 77,211, 21, 17,168, 10,113,
-228,200, 17, 29,207,243,241, 85, 36,187,153,250, 42, 97,192,247,243, 39, 28,232,247,249,151,182, 29, 58,116, 18, 90,217,216,130,
-162, 40,188, 73,125,131,152,200, 80,221,185, 99, 59, 83, 11, 10, 13, 91,130,103,194,143,127,148,250,100, 1, 64,255,233, 27, 75,
-253,179, 0, 96,128,223, 2,248,182,119, 7,101,136,244,244,150,100,241, 44,203, 66,161, 80,128,101,217, 10, 67, 60,152,155,155,
-203, 84, 42,149,178, 56, 16,163,222, 55,102, 2,124,244, 58,226, 56,206, 53, 43, 43, 11, 5, 5, 5,184,117,235, 22, 89,185,114,
-101, 90, 90, 90, 90,169,211,166, 78,167,115,205,204,204, 68,126,126, 62,110,222,188, 73, 2, 3, 3,211, 50, 50, 50, 22, 85,231,
- 25,146,201,100,173, 5, 2,193,189,172,172, 44, 94, 46,151,211, 58,157, 78,231,225,225, 33,145,201,100, 6, 47,168,158,146,146,
-210,187,178, 99,141, 26, 53,122,250,244,233,211, 38, 28,199,149, 93, 3, 81,164, 82,169,156, 59,116,232, 96, 72,251, 49,107,247,
-238,221, 56,126,252,120,219,220,220,220, 49,241,241,241,123, 1,180, 21, 8, 4,120,240,224,193, 99,149, 74, 53,114,240,224,193,
-123,178,178,178,238,160,104, 9, 30, 67,112, 62, 38, 38,102,180,171,171,235,238,229,203,151,155,248,248,248, 8, 28, 28, 28,208,
-166, 77, 27,196,196,196,224,204,153, 51,186,173, 91,183, 22, 20, 22, 22, 78, 0,112, 73,127,181,131, 98, 89, 22, 98,177,184,116,
-147, 72, 36, 16,137, 68,200, 83, 18,124,241, 83,172,146,133, 76,185,118,217,164, 51, 4,160, 94, 39,198,166,191,121,157,120,135,
-162,168,107, 41, 41, 41, 57,149,148,153, 88,165, 82,181, 36,132, 48, 20, 69,173,215,106,181,126, 51,102,204,176, 95,181,106, 21,
-154, 53,107,134,244,244,116, 40, 20, 10, 56, 59, 59, 35, 45, 45, 13,161,161,161, 92, 97, 97,225, 54, 0, 43, 80,236, 63, 82, 25,
-178,211,115,225,104, 87,239, 29,229,147, 16, 2,194, 1, 58, 53, 7, 78, 75,160,161,116, 16, 10,117, 16,137, 68,134, 12,169, 16,
-158,231,145,101,111, 15, 62, 50, 18,183,111,223, 6, 33,164, 82, 85,205,197,197,197, 32,133,148,227,184,247,136,214,157, 59,119,
-192, 48, 12, 58,117,234,132,176,176,176, 82, 69,203, 32,191, 68,194, 67, 44, 17,191, 51, 92, 72, 81, 20, 68, 98, 49,132, 98, 81,
- 69,179,113,140, 42,150, 17,127, 27, 24, 58,142,157, 13, 96,242,195,135, 15,247,118,237,218, 53,136, 16, 34, 68,209,120,228,245,
- 15,249,243,215,175, 95,223,191,121,230,254, 66, 91, 71,139,192, 62, 99, 58,161, 89, 75, 39,112, 44,135, 27,103, 31,224,215, 85,
- 39, 15, 38, 37, 38,249,193,128,181,207,120,158,191,218,177,117, 51, 26,101, 98,117, 59, 56, 56,240, 53,153,117,152,147,147,179,
-116,238,220,185,152, 63,127,126, 77,102, 29, 86,136,136,232,180,201, 20,136,227,128, 62,157,123,129,162,137, 70,163,214,211,240,
-161, 52,114,169, 72, 36,124,114, 55, 60,197,163,162,116,105,105,105,189,198,143, 31,127, 73, 32, 16, 52,168, 78,153,243, 60, 31,
-159,154,154,218,189,234,148,236, 13,181, 50,215,249,244,193,237, 95,159, 63,190,187, 23,207,115,141, 41, 0,140, 64,244, 92,167,
-213, 94, 80, 43,115,215,193,192, 69,165,215, 76,246,198,172, 13, 23,177,101,254, 0,204, 8, 60,140,157, 75,190,192,194,159, 14,
- 96,245,252, 89, 88,185,241,223,248,118,214,104, 12, 29, 53,158, 39, 20,253,167,161,215,193, 48,204,249,237,219,183,143,251,226,
-139, 47, 74, 39, 45, 16, 66,222,105,132,117, 58,157,146,231,121,108,219,182,141, 7,112, 94,159,189,119,235,136, 34,250,252,165,
- 12,173,163,220,220,220, 9,222,222,222,123, 0, 72, 8, 33,207,178,178,178,190, 2,222, 46, 13,149,159,159, 63,161, 67,135, 14,
-123, 8, 33, 18,138,162,222, 59,110, 8,138, 67, 61,180,182,176,176,184, 87,172,100, 73,106,226, 16,175,175,168,245, 12, 43, 26,
- 50,132,248,127,236, 93,119, 92, 20, 87,219, 61, 51,219,151, 93,202,210, 89,138, 2,138,130,162, 66,108,216, 91, 36, 42,214,136,
-198, 40,150,152,152,188,182,168, 73, 4,163,177,151, 36,182,168, 49,106,236, 70, 99,195,168,136, 53, 88, 18,141,177,128,136,160,
-210,123, 91,150,178,192,246,157,153,239, 15, 74, 16, 41,139, 38,239,151, 55,217,243,251, 45,187,195,204,156,189,247,238,157,185,
-103,158,251,220,231,161, 1,204,173, 19,241,125, 93,247,238,221,235, 38,149, 78, 40, 41, 41,233,250, 10,229,186,170, 82,169, 58,
- 46, 91,182,108,129, 64, 32, 24,168, 84, 42,219, 1,128, 72, 36,122,174,209,104,174,171, 84,170, 45,104, 62, 54,149,150,166,233,
-231, 6,131,193,215,206,206,174,106, 69,109,181,216, 2,128,115, 15,168, 7, 0,213,173,202, 40,126,212,232,130, 69, 70, 70,182,
-150, 72, 36, 67, 9,130, 24,207, 48,140,119,121,121,185,102,217,178,101,119, 78,158, 60, 89,230,238,238, 62,108,196,136, 17,132,
-181,181, 53,238,223,191,207,200,229,242,211, 0,150,192,136,149,214, 52, 77,103,124,253,245,215,104,233,245,222,212,126,157, 78,
-151, 31, 25, 25,105,251, 86, 97, 33,155,166,105,140, 28, 57,242, 5, 1, 87, 31,207,158, 61,131, 70,163,105, 54,152, 99,105,105,
- 41,186,119,239,254,194, 3,106,205, 43, 35, 35, 3,214,214,214, 47,124, 79,115,207, 88,154,178, 18, 12, 90,176, 24,168, 94, 81,
- 90,131, 42, 75, 22, 3, 70,107,210, 85, 38,252,125,241, 87, 39,223, 52,202,180,232,228,228, 52, 81, 32,226,207,110,213,206,169,
-115,110, 74, 97,124,121,153,242, 72, 94, 94,222,238, 70,110,228, 70,113,182, 48, 96,169,201,252,251, 23,113,254, 17, 71,139, 2,
-195, 80, 96,104, 6, 12, 67,131,166,169,170,132,215, 12, 13,134,162, 8,130,192,175, 90, 85,147,145,193,235,151, 83, 98,107,107,
-187,138, 97,152,183, 88, 44, 22, 89,247, 70, 93,247,115,181, 37,235,146, 76, 38,251,162, 1,203,235,255, 92,123,158, 60,121,178,
- 65,241,111,236,170,195,224,224, 96,170,133,215,230,117,145, 72,228,212,208,190,202,202,202,204,188,188,188,161,127,147,246,172,
-187, 98,176, 37,156, 45, 94,117,216, 28,103,171, 86,173,248, 58,157,206, 31,128, 23, 65, 16, 86, 0,138,117, 58,221,229,162,162,
-162, 2, 0, 93, 1, 44,171, 62,103, 53,128, 7,255,207,215,187,208,214,214,118, 63, 73,146, 46,198,156,108, 48, 24,180,197,197,
-197, 83,235, 61, 16,252, 49, 5, 15,176, 4, 92,238, 61,144,164,115, 67,215, 99, 99,159,193, 48, 57,149, 42, 85,119,226,143,123,
-126, 45,167,141,141,205, 3, 54,155,237, 98, 68,217,178,229,114,121, 87,211, 61,249,127,154,243,127, 25,245,157,224, 27,141, 20,
-255, 87, 8, 45, 19,167,137,211,196,105,226, 52,113,154, 56, 77,156, 38,206,127,186,208,106,112,219,180, 4,214, 4, 19, 76, 48,
-193, 4, 19, 76, 48,225,245,112,161,158,216,186, 80,243,129,104, 66,149,182,196, 36,248, 42,202,246,154,137,211,196,105,226, 52,
-113,154, 56, 77,156, 38,206,127, 29,167, 9,127, 34, 76,102, 85, 19,167,137,211,196,105,226, 52,113,154, 56, 77,156,255,116, 52,
- 58,117, 72,154,218,198, 4, 19, 76, 48,193, 4, 19, 76, 48,225,175,129,209, 66, 75,228,224,237, 99,219,170,243, 65,137, 75,167,
- 88,137, 75,167, 88,219, 86,157, 15,138, 28,188,125,254,165,237, 38, 4,240, 46,155,205,190,234,232,232,168, 64, 35,169,119,254,
- 1,176, 0, 48, 30, 85,241,125,198, 2, 48,251, 51,201,251, 3,236,137,192,236, 16, 32, 51, 4,200,156, 8,204,238,255, 15,244,
- 27, 92, 49,207, 41,224,214,197,119, 47,174,152,231, 20,208,224,254, 69, 78, 54,119,175, 4,127,179,110,182,212,250, 79,250, 74,
-115,123,123,251, 61, 14, 14, 14,233,246,246,246, 25,246,246,246,251, 1, 88,154,110,119, 38,152, 96,130, 9,127, 25,106,124,180,
-106, 94,181, 62, 90,108, 0,136,136,136,232, 15,224, 6,128, 1, 65, 65, 65, 55,235,159, 45,113,243,157,217,198,163,205,167,107,
- 86, 44, 33, 28,237,109,205, 12, 20,173, 75, 75,207,234,176,124,205,134, 83,185, 60,246,230,146,204,184,189,175, 80, 40,130,197,
- 98, 77,228,243,249, 65, 0,106, 4, 91,130, 70,163,137,160, 40,234, 56,140, 91,166, 13, 7, 7,135, 91, 44, 22,171,117, 75,190,
-152,162,168,204,130,130,130, 62,175,216,152,193,110,110,110,251,251,247,239,111,214,189,123,119,240,120, 60, 44, 91,182,108, 81,
- 94, 94,222, 22, 99, 9, 36, 18, 79,115, 29, 95,240, 49,155,199,123,147,209,107,125, 25, 48, 0,201,143,163, 13,154,159,185, 26,
-205,230,146,146,148,114, 35,169,150, 0,152, 86,221, 86,123, 1,124,253, 58,189,100,170, 31,244,122,170,170, 79,112,217,160,206,
-166, 90,222,248,252,243,207,217, 65, 65, 65,216,187,119,111,159, 61,123,246,124, 80, 94, 94,254, 51,128,115, 0,146, 95,183, 87,
- 58, 0,179,122,245,233,243,205,212, 69,139, 88,170, 91,183,240,205,254,253, 91, 81, 21,111,233,219,150,246, 37, 46, 23,227,109,
-109, 57, 65, 12, 3,127, 2, 32, 8, 32, 70, 38,167, 35,117, 58,234, 56,140,136,197,214, 4,222,197,139,203,241,143,182,148,160,
- 44,153, 89,202, 31,233,211,183, 44,249,250, 82, 0,195,234,239, 55,168, 5, 83, 25,150,107,144,138,137,206, 2,176,233, 53,155,
-213,204,206,206, 46,246,236,217,179, 46,221,187,119,103, 3,192,131, 7, 15, 66,130,130,130, 6,201,100, 50, 95, 0,138,255,167,
-155,144,128, 77,146,179,121, 28,206,155, 20, 69,117, 2, 0, 22,139,245, 88,171,215, 95, 53,208,244,183, 48, 50, 38,155, 9, 38,
-152,240,207, 69,115, 90,228,111,142, 70, 35,195,215, 84,142,169,251, 94, 23, 34,251,246, 29,122, 14,126,251, 89, 89,185, 82,157,
-158,158, 83,178,112,246,218,171, 31,204,223,248,211,166,239, 35, 34,111,254,158,112,215,167,251,208,120,145,125,251, 14,141, 80,
- 55, 54,135,235, 38, 20, 10, 31,238,220,185, 83,247,252,249,115,166,180,180,148,121,246,236, 25,115,250,244,105,230,163,143, 62,
- 82, 11,133,194,135, 0,220,140,225,116,112,112, 40,120, 22,117,133,201,142,141,102, 50, 30,252,206,232,245,122, 70,167,211, 49,
- 58,157,142,137,191, 20,193,196,158, 11,103, 98, 78, 31,103,180, 90, 45,163,213,106, 25,141, 70,195,120,120,120,228, 26, 89,206,
-250,144,118,236,216, 81, 27, 17, 17,193,156, 58,117,138, 89,180,104, 17,211,165, 75, 23, 10,192, 28, 99,235, 46,178,247, 26,104,
-238,220, 89, 54, 51,244, 91,221,133, 59,151,153, 39,169, 49,204,147,212, 68,230,228,181, 4,102,218, 39,219,116,230,206, 93,100,
- 34,123,175,129,205,213, 93, 34,145,244, 36, 8,130,169, 1, 0,166,117,235,214, 21,117, 95,110,110,110, 47,188, 92, 93, 93, 43,
-220,221,221,147,109,108,108,252, 27,226,156,212, 9, 12, 19,127,148, 97,226,143, 50,159,247, 3,243,228,201,147,187, 12,195,220,
-168,121,169, 84,170, 27,103,206,156,185, 49,122,244,232, 27, 0, 70, 53,209, 78, 70,181,103, 8,144, 89,126,246, 44,195,108,217,
-194, 48,253,251, 51, 9, 0, 19, 2,100,182,144,211,195,209,145, 19,179,241,235, 15,180,103,207, 30, 96, 46, 94,188,192, 68, 70,
- 70, 48, 63,157,217,207,108,221, 50, 91,231,224,192,137, 3,208,182, 5,156,108, 0,107, 1,108, 70,149,229,242,185, 76, 38, 99,
-242,243,243, 25, 0,207,171,255,183,217,206,206,110, 19, 26,182,190, 13,169,107,201, 90,240,150,227,197, 9,195,250, 48,229,101,
-185,204,132, 97,125,152, 5,111, 57,190, 96,217,122,203,211,211,124,238,200, 78,178, 39, 15,142, 80,115, 71,118,146,189,229,233,
-105,254,138,237, 73,160, 42, 79,232,206,168,168, 40, 3, 83, 7,122,189,158, 57,116,232, 16, 37,145, 72, 14,180,128,179,157,157,
-157, 93,134,181,181,245,243,186,255,180,235, 60,182,151,119,223,144,229, 54, 29, 70,247,111, 65, 57,187, 11,184,220,236,171, 39,
-190,163,228,153,143, 25,173,170,128, 41, 75,138,102,178, 19,238, 50,135,118,111,214,243,216,236,108, 0,221, 95,167, 47,181, 16,
- 38, 78, 19,167,137,243,111,200,217,148, 22,249, 95, 6,187,126, 5,235,131,207,231,133, 46,255,124, 49, 81, 42, 47, 85,169, 21,
-229, 90,189, 90,173, 38,185,140,250,113,124,106, 33,201,102,149, 46,152, 63,207, 60, 52,236,243,208, 74, 96,178,145,223,233,214,
-165, 75,151,123,225,225,225,246,214,214,214, 40, 43, 43,131, 92, 46,199,189,123,247,192, 48, 12,198,141, 27,199,239,209,173,155,
-255,210,101,203,126,203,206,201, 9, 64,227, 3,239, 31,226,197,218, 22, 95,247,169,202, 69,251, 69,186,188,106,212, 33, 8,236,
- 9, 14,170, 61,102, 85,118, 85,182, 12,129, 64, 80,155,144,248, 21, 16, 48,120,240, 96, 46, 0,188,247,222,123,138,242,242,242,
-245,213, 22, 14,163, 50,173,138,236,189, 6,218, 58, 73, 35,190,219,245,181,176, 83, 27, 47,232,244, 6,100,228,231,130,205,177,
-130,139, 11, 23,211, 39,191,201,233,215,203,218,118,237,234, 61, 23,242,105,140, 85, 22, 37, 94,110,140,203,202,202,234,208,241,
-227,199,113,226,196, 9, 0,192,243,231,207,225,229,229, 37,106,174, 12,113,113,113,158,163, 70,141,250, 81, 46,151,183,109,238,
-216,250,129,241,249,124, 62,250,244,233,131, 14, 29, 58,224,236,217,179, 3,170, 45, 91,175, 5,213,173, 91, 16, 63,122, 4,220,
-124,165,135, 23,143, 55,222,104,117, 55,242,194, 17,219, 11,145, 9,216,180,105, 63,146,147,171, 12,109,158,158,158,120,119, 82,
- 48,231,241,227, 59, 29,199,143,127,247,206, 47,191, 36,247,169, 22, 74,205, 97,229,247,223,127,191,196,221,221, 29,227,199,143,
- 15,238,216,177,163,163,133,133, 5,118,239,222, 13, 39, 39, 39, 79,173, 86,155,116,246,236, 89,105,126,126, 62,230,205,155,135,
-130,130,130, 69,141, 17, 13, 8, 28,176,148, 63,210,167,111,251, 55,166, 66,108,225,132,239,143, 29,199,179,135,135,250,106,116,
- 9, 75,185,212,205, 41, 42,134, 63, 77,150, 41, 14,109,221,181,191, 77,219,142,163,208,234,141,104, 91, 53,245, 75,234,210, 55,
- 61, 54,176, 5,234, 67, 43, 54,229,201, 95, 34, 29,127,146,229,171,120,106, 29,119, 21,114, 96, 5, 93, 35,176,106,173,181, 12,
- 70,245,235,215,175,246,135, 75, 79, 79,135, 70,163,129,143,143, 15,169,213,106, 7, 26,217,174,237,134, 14, 29,250,107,100,100,
-164, 77,187,118,237,100,197,197,197,181, 59, 28,109,172, 2,111,134,111,157,183,246,155, 31,188, 15, 51, 68,169, 44,225,167,199,
-205,112,117,239,221,243,141,107, 23,195,143,136,137,138, 44,240,172,138, 0, 90,142,148, 31,247,129, 48,179,198,196,143, 22,178,
- 7, 14, 30,228,252,230,176,183,175, 61, 75, 76, 30, 12,224,190,233,185,222, 4, 19,254,213, 86, 45,230,159, 86,167, 90,161, 21,
- 20, 20, 68, 52, 84, 65,154,161, 59, 59,216,219, 8,183,110, 60,120,159,165,211,106, 69, 86,150, 90,142,165, 5, 77,152, 91,178,
-116, 90,125, 69, 43,207, 86, 60,154,161, 59, 55,194, 95,127,137, 39, 33, 20, 10,195,207,157, 59,103,207,225,112, 64,211, 52,236,
-236,236,144,150,150,134,210,210, 82,148,151,151, 35, 57, 33, 1,238,110,174, 88, 17,186,216,105,222,226,208,112,165, 82,217, 21,
- 47, 78, 35,190,180,108,148,210,191,152, 55,186, 38, 5,203, 75,143,252,213,255,107, 96,159,177, 75, 81,211, 50, 51, 51, 33, 22,
-139,225,235,235, 43,190,125,251,246, 47, 77,136,172, 23, 56, 37, 18, 79,115,154,207, 59,177,243,187,101, 66,157, 62, 14,241, 41,
-197,104,239,222, 23, 14, 54,110,200, 45,214,226,238,189,115,136,139, 61,138, 54,206,110,152,243,209, 32,193,134,175, 79, 29,231,
- 26,220,221, 74, 75,211, 20, 13,113, 42, 20, 10,177,135,135, 7,220,220,170,242,158, 81, 20,133,248,248,120, 80, 20, 85,187, 93,
-247,253,224,233, 40, 24, 20, 25,152, 26, 18, 2,185, 92, 46,110,136,147,195,130, 97,225, 7,239,178,133, 28,128, 39,178,214, 86,
- 84, 84,212,166,225,208,233,116,136,137,137, 65, 64, 64, 64,255,147, 39, 79, 54,167,138,140,106, 79, 29,240,213, 55, 7, 14,108,
-155, 92, 86, 70, 2,192, 94,130,160,117, 12,243,149,177,125,201,222,158,115,250,210,197,195,182, 44,242, 41,172, 45,191,196,189,
-123, 25,208,233,170,202, 43,151, 23, 98,238,108, 5,184, 28,115,156, 61,251,131,141,143, 79,159,211,249,249, 58, 95,188, 56,141,
-216, 80, 57, 5, 23, 47, 94,196,220,185,115, 17, 31, 31, 47,173,201,209, 38, 20, 10,177,113,227, 70,150,143,143,143, 84, 36, 18,
-225,210,165, 75, 40, 40, 40, 32,154, 42,231,141,203, 55,214,148, 37, 95, 95,154, 79, 92,122,235,251, 99,199,241,254,164,137,112,
-100, 82,126,177,108, 67,172, 25, 58,178,247, 23, 12,203, 53, 72,100,222, 89,226,229, 59, 18, 92,158, 24,115, 62, 91,133,231,113,
-231, 37,202,242,216,217, 4,149,229,186, 98,211,201,249, 47,149,243, 84, 48,245,222,209,219,111, 92,117,187,223,234, 81,204, 7,
-191,231, 69,239,137,253, 67,104,121,178, 9,146,178, 4,170,210,154, 36, 37, 37, 33, 57, 57, 25,108, 54, 27, 42,149, 10, 6,131,
-161,193,114, 74,165,210, 89, 6,131,225,139,234,223,249,160, 64, 32,152,113,228,200, 17,155,186, 66,219,174,243,216, 94, 54,230,
-162,193, 5,133,242,146, 59,247,159, 60, 91, 56,107,252,128, 91,119,227,178,116,156,209,153,101,177,103,203, 26,105, 79,129,144,
-199, 59,125,233,204, 15, 98,125,106, 20, 68, 62, 3,192, 17,123,129,210,231, 64, 89, 82,137,242,228, 60,104,190,219, 1,191,217,
- 11,112,254,167, 83,226,142,157,186,158,212,232,245, 94, 0,180,175,112,109,182, 4, 38, 78, 19,167,137,243,239,201,217,168, 22,
- 97, 24,230, 13, 0, 14,213,155,242,106, 93, 96, 11,160, 8, 85, 25, 5, 28,170,239, 29,188, 58,167,213,223,174,123,108,253,237,
-186,159,229,213,159,237,171,223,239, 19, 4, 81,220, 76,209,157, 80,149,154,240, 66,245, 59, 80, 61,149,216,172,227, 49, 65,144,
- 10,138,162,249, 92, 59,123,245,123, 19, 6,119,186,114,237, 65,140,153,173, 5, 59,112,128,127,255,123,143, 83,127, 35, 72, 66,
- 79, 16,164, 81,126, 31, 44, 22,107,226,214,173, 91, 59, 89, 88, 88,128,166,105, 88, 90, 90, 66, 38,147, 65,171,213,162,172,172,
- 12,154,114, 5,116,229, 10, 60,202, 74, 71,239,254, 3,240,246, 91, 67,125,126,248,233,220, 68,138,162,126,108,138, 87,218,217,
-191,214,146,181,170,181,205, 31,166,137,172,210, 90,209,245,165,191, 23,184, 98, 49,222, 92, 24,250, 58,125, 32,250,194,133, 11,
- 23,199,141, 27, 55,236,147, 79, 62, 33,243,242,242, 46,165,165,165,245, 6, 16,223,172,168,224, 11, 62,254,207,199, 65, 18,137,
-152,193,201,171,231,208,207,127, 18,204,120, 44,200, 21, 58, 16, 4,144,240, 36, 28, 4, 97,141,216,231,121,232,235,103,129,161,
-129, 62,226,159, 78, 37,124,130, 63,252,131, 94,250,105, 74, 74, 74, 80, 88, 88, 8,189, 94, 15,189, 94,143,241,193,193, 56,124,
-232, 16, 42, 43, 43,161, 82,169,160,213,106, 65, 81, 20, 72,146,196,213,136,147,200, 74, 77, 64,175,128, 0,160,145,212, 75,135,
- 98,192, 1,112,247,217,179,103, 72, 72, 72, 64,118,118, 54, 4, 2, 1, 28, 29, 29,177,106,213, 42,104, 52, 85,249,196,130,131,
-131,251, 3,120,252,186, 23, 84, 50,176, 39,141,162,150, 14, 59,115,198,254,246,153, 51,244,221,243,231,179,249,229,229,187,141,
- 57,151,203,197,248,175,191,250,168,189, 72, 36, 66,118,230, 86,120,123,115,177,104,129, 13,214,127, 89, 4, 0,152, 55,215, 5,
-221,186,218, 66, 81,122, 10,182,246, 75,176,109,219,252, 54,211,166,109, 14, 81, 42,169,131,205, 80, 47, 61,119,238,220,219, 94,
- 94, 94,206,209,209,209, 4,143,199,131, 80, 40,132, 80, 40,132, 64, 32, 64, 97, 97, 33,210,210,210,152,175,191,254, 58, 7,192,
-210,166,136, 86,108,203,251, 13,192,176, 5,111,225,226,179,135,135,250, 58,179, 82, 31,189, 61,167, 79,122,236,221,232,242, 43,
- 87,111,175, 54,168, 5, 89,165,217,215, 22,123,116,139,182,157,253,233, 74,236,248,122, 57,158,253,126,171,216,193, 77,241,173,
-144,208, 52, 88,206,254,253, 87,176,157, 28,172, 13,179,166,189,109,117,222,225,206,172, 72, 54, 33,203, 47,122,184, 17,105,209,
- 42,126, 91,255, 41,237, 60, 73,109, 84, 84,148,176, 95,191,126, 80,171,213,181,150,201, 35, 71,142,208, 6,131,225,122,131,125,
- 83,167,251, 34, 39, 39,199, 73,165, 82,225,173,183,222,154,183,113,227, 70, 81, 77, 62, 57,138,162, 94,176,100,173,217,114,248,
-242,199, 95,124,123,253,242,143, 95, 74,215,132,206, 24, 48,121,206,218,235,104, 36,143, 36,155, 36,103,159, 63,179,223, 81, 32,
-209, 67,104, 61, 20,234, 2, 21,158,237,121, 31, 74,133, 26,221,214,172, 4,192,131, 86, 79, 98,247,200,241,224,216, 72,177,124,
-230, 12,233,231,187,191,255,136,166,233,173,166,231,122, 19, 76, 48,161, 30, 28, 8,130,136, 0,128,208,208,208, 37,235,215,175,
-127, 66, 16, 68, 4,195, 48, 65,213, 6,148, 8,134, 97,130,106,142,169, 22,103, 47,109,215, 28, 91,127,187,254,231,176,176,176,
-142, 27, 54,108, 88, 23, 16, 16,240,227,157, 59,119, 82, 1, 52, 39,180, 70, 84, 11,171,151, 82,239,144, 53, 10,178,238,251, 11,
- 22, 45,154,190,149,148,154,174, 28, 58,164,135, 75,196,205,199,247,167, 79, 31, 49,120,226,200,126,129,105,153,242,132, 54,173,
- 28,109,159, 60,121,108, 65,211,244, 45, 99, 90,137,207,231, 7, 13, 26, 52,136, 93, 82, 82, 2, 51, 51, 51,200,100, 50,228,228,
-228, 64,167,211, 65, 93, 86, 10, 77, 89, 41,212,165, 37,208,149,149, 32,249,193, 61,116,110,227,201,175,118,150,111, 18, 53, 86,
-151,250,150,170,186,150, 45,158,185, 57,248,230,230, 32, 90, 62,109, 56,218,202,202,234,110,205,160,170,211,233,102, 47, 94,188,
-184,136,166,105,172, 93,187,214, 66, 44, 22,159, 4,192,111,142,196,220,142, 21, 20,224,231, 75, 62, 77,139, 69,159, 46, 83,209,
-206, 99, 56,210, 10, 84, 40, 42,215,161,176, 84,135,110,253,182,163,117,151,149,112,245, 91,143,132,140, 98, 72,157,189, 72,176,
-249, 77, 38,127,206,202,202,122, 97,251,199, 99,199,160, 84, 42,209,166, 77, 27, 76,154, 52, 9,139, 23, 47,198,164, 73,147, 32,
-149, 74, 49,121,194, 40, 44, 95,190, 28,249,249,249,205, 21, 85,211,174, 93, 59, 77,171, 86,173, 52,173, 90,181,210,232,116, 58,
- 84, 84, 84,160,180,180,180,126,123,207,111,105, 67,218,219,219,135, 57, 58, 58,198,218,219,219, 63,225,243,249,145, 49, 4,241,
- 84,221,170,149, 67,239, 49, 99,136, 14, 19, 38,176, 50,132, 66,226, 38, 32, 54,134,203,214,154, 51, 98,224,160, 97,188,210,146,
-253,181, 70,170, 25,211,237,240,235,205,142,184,253, 75, 87,204,157,221, 6, 4, 41, 0, 65,242,160,172,140, 66,143,238, 1, 92,
- 43, 43,162,185,190,244, 46,128,152,222,189,123, 75,231,204,153, 67,240,249,124,204,155, 55, 79, 55,115,230,204,196, 73,147, 38,
- 37,254,252,243,207, 84,171, 86,173,224,234,234, 74,184,186,186, 58, 1,136,169, 62,167, 73, 88,180, 33,214,104,116, 9,191, 88,
-121,137, 82, 41,216,246,170,208,243,199,175,216,148, 39, 95,179, 51,117, 83,218, 51,165,231,179,223,111,201, 19,227,206,211,105,
-247,111, 20,229, 38,150,123,174,217,153,186,105,201,183,185, 13, 94,212, 55,111,130, 14,143,184,169, 83, 86, 42,217, 99, 70, 14,
- 84,206,122,111, 98, 59,107,113,199, 35,112, 30,218,165,181,155,203,228,229,235,182,233,102,126,244,177,110,239,190,253, 76,121,
-121, 57, 20, 10, 5,182,109,219,102, 56,127,254,124, 14, 69, 81, 31, 55,246, 12, 4, 0,122,189, 30,179,102,205, 18, 89, 88, 88,
- 32, 43, 43,171,214, 34, 10, 0,121, 50,249,227,219,247,227,158, 46,252, 48,184,127,165, 70,163,185,124,227, 65, 66, 7,175, 86,
- 46, 4,193, 52,186, 16,133,199,225,188,217,181, 71, 15, 22,195,148,130, 96,187, 33,249,208,215, 80,228, 23, 67, 81, 88, 12, 22,
- 71, 4, 3,248,208,211, 60, 88,117,238,142,231,247,163,225,108,231,192,230,115, 56,129,166,241,196, 4, 19,254,157,104, 74,139,
-212, 21, 75, 27, 54,108, 88,215,212,254, 58,239,218,122,219,181, 66,170,190, 8,171,251, 25, 0, 54,108,216,176,142, 97,152,160,
- 59,119,238, 28, 3,160, 50,178, 10, 31,212,121, 55, 62,142, 22, 75,173, 93,255,201,226,165,144, 88, 10, 45,187,251,123, 57,158,
-189,116,243,193,173, 59, 15, 18, 90,187,218,218, 49,122,173,228,171,205, 59, 92, 8,165,106,131,145,133,240,177,181,181,133, 78,
-167, 67, 82, 82, 18,178,179,179,161,211,233, 96,168,172,132,166,180, 20,234,146, 18, 80,149,229,224, 82, 20, 84,178, 66,216,152,
- 9,128, 63, 86, 36, 54, 99,121, 35, 26, 20, 90, 53,239, 2, 11, 11,240,205, 45, 64,114, 56,205,102,138,175,131, 55,186,119,239,
-126, 34, 46, 46,174,199,144, 33, 67, 86,163,106,137,124, 70, 78, 78,206,224,101,203,150,105, 28, 28, 28, 48,107,214,172,246, 0,
-166, 54, 43, 50,121, 90,159, 86,142,237,209,206,115, 42, 90,187, 14, 66,105,165, 30, 50,133, 30,133,165, 58,236,222, 30,128,211,
-123,187,227,215,211,125, 17,119,249, 77,148,234, 29, 33,150,142, 6, 67,105, 59, 54,197,121,245,234, 85,172, 90,181, 10,171, 87,
-175,198,218,181,107,177,122,245,106,228,228,228,192,215,215, 23,153,153,153,184,120,241, 34,242,242,242, 96,107,107,139,123,247,
-238, 97,203,150, 45,248,245,215, 95,155,173,116,141,112, 53,226,152, 22,205,165, 27, 12,134,105,121, 99,198,116, 42,176,182,238,
-224,239,239, 63,108,222,188,121,158,189,123,247,174,221,239,233,233,233, 38, 20, 10,243, 81,181,130,210,175, 41, 46, 26,240,183,
-179,243,133, 86,243,180,250, 55,230,128, 32, 4, 24,244,102, 2,122,247,125, 0,157,158, 11,146,224,131, 36, 5, 48, 24,228,144,
- 72,164, 96, 24,194,183,153, 34, 46,147,201,100, 94,215,174, 93, 35,211,210,210, 32, 16, 8, 0, 32,125,197,138, 21, 59, 54,109,
-218, 20,111, 99, 99, 67, 69, 68, 68,224,167,159,126, 66, 80, 80, 16,107,230,204,153, 94,174,174,174,187,154,171,247,138,109,121,
-191, 29,221,124,241, 29,142, 94,226, 39, 16,182,118, 71,165,120,244,127,250,219,138, 0,224, 82, 74, 74,185,189,155, 98, 67,101,
-121,108,166,149, 75,197,151,151, 82,154, 91,113,186,130,126,152,248,244,238,209, 51,151,202, 10, 11, 74, 56,254,157, 58,170,214,
-175,250,148,219,218,189,237, 87,203, 23,127,232,152,163, 16, 44, 42, 9, 57, 0, 0, 32, 0, 73, 68, 65, 84,148,190, 57,239,226,
-211,240, 75,247, 42,166, 76,127,223,240,222, 7,115,212, 23, 47, 93, 61, 67,211,116, 39, 52,178,226,144,166,105,228,229,229,225,
-201,147, 39, 72, 73, 73,129, 76, 38, 67, 81, 81, 17,202,203,203,107,167, 27,205,202, 21, 23,118, 28, 56,255, 72, 36, 20,154,245,
-232,228,229,246,123,116,124,161, 72, 40, 52,243,114,119,107, 7,172,104,240, 62, 66, 81, 84, 39,129,153, 16, 0,129,210,184, 91,
-168, 40,169, 64, 69,105, 5,202,139, 43,160,209,177,160,214,144, 80,105, 73,180,234, 63, 20, 21,149,106, 84,200,203, 64, 83, 84,
- 23,211,112, 99,130, 9, 38, 52, 49,214, 71,132,134,134, 46, 49,242, 88,163,167, 55,235, 11,175,208,208,208, 37, 4, 65, 68,132,
-133,133,117, 68,227, 11,170,234, 98, 79, 3, 47, 0, 70,132,119,144,203, 19, 43,204, 9,159,113, 11, 62,251,226,226,177,125,219,
-237, 53, 26,101,166,141, 68, 76,137,205,120,182,239,205, 90,139,242,138,146,177,149,198,135, 35, 64, 73, 73, 9, 82, 83, 83, 33,
- 20, 10,193,229,112, 64,169, 84,160, 84,149, 80,149,200, 65,234, 52,224, 82, 20,172,205,132,104, 37,117, 68,107, 7, 71,163, 56,
-147,162,174,212, 58,190,215,157, 46,252,186,187, 15,120, 34, 49,120,230, 98,252, 39,226, 6, 0,128,203,229, 2,203, 86, 27,101,
- 52,113,118,118, 62,119,244,232, 81,174, 76, 38, 67, 76, 76,204, 35, 0,101, 0,204, 1,208, 9, 9, 9,215,226,226,226,130,188,
-188,188, 0,160, 77,115,100,138, 34,146,210, 27, 24,100,229,167, 35, 45, 59, 26,214,150, 30,224,152,181, 67, 97,169, 14,124,161,
- 7,244,154, 63,102, 31,213,138, 12,168,116, 44,163,234,174,213,106, 97, 48, 24, 96, 48, 24,160,213,106,241,193, 7, 31,224,246,
-157, 59,248,241,167,159,145,154,252, 28,237,221, 29, 17, 18, 50, 5,221,187,119,199,157, 59,119,154,228,154,234, 7,189,179, 24,
-236,205,195, 72,240,196, 54,154,158,139, 47,255,222,156,216, 34, 8,130, 65, 35, 83,145,245,176, 41, 32, 32,160,237,243,202, 74,
- 60,121,250, 20, 67, 86,172, 0, 0, 68, 70, 70,190, 80,151,133, 11, 23,242,226,227,227,223,123,240,224,193,123,185,185,185,155,
- 1, 52,236,108,206, 0, 23, 46,252,134, 15, 63,140,135, 76, 38, 3, 0, 28, 63,246,135, 46, 77, 75,213,225,173, 17, 85, 51, 90,
- 86, 86, 86,216,188,217,215,168,246,164, 40, 10,123,246,236,169,157, 46, 4, 0, 54,155,221,123,225,194,133,227, 26, 58,190,109,
-219,182,220,230, 56, 23,140,119, 22,252,250,136,153,109,217,182,117, 71, 11,219,206,144,235,163,125,163,115,242,230, 46, 24,239,
-188,117,203,169, 28,181,144,208, 28, 36,168, 44, 87,182, 64,125,200,152, 50,166, 92,218,174,149,183,154,118, 40, 95,166,248,124,
-206,251,239,218, 88, 88,217, 87,238,221,177, 94, 66,178, 72,230,220, 3, 93,105, 71, 79, 27,171,209, 61,191,169,248,112,193,178,
-104,173, 33,107, 14,178,206, 61, 71, 19, 33, 46, 40,138, 66,110,110, 46,100, 50, 25, 50, 51, 51, 81, 84, 84, 53,253, 90, 84, 84,
- 4,154,166, 95,231,134, 8, 85,102, 38, 50,206,236, 69,235, 41, 83,208,109,245, 42, 80, 52, 27, 42, 37,133,205,189, 6,163,164,
- 76, 5, 13, 77, 64,250, 70, 47,188, 31,249, 11, 72,134, 2,118,127,107, 26, 73, 76, 48,225, 95, 10, 99,194, 59,212, 8,162,245,
-235,215, 7,253,217,223, 95, 87,108,173, 95,191,254,201,250,245,235, 91,242, 93,245,167, 12,107,183,107,124,180,110,212,113, 64,
-123,105,208, 44, 47, 74, 72,137,143,103,231, 86,170, 42,205, 28,236,237, 52,102, 2, 62, 93,166, 40,103, 69, 63,126,164,171,204,
- 79,126,214,130,122, 36,196,197,197,249,230,230,230, 34, 51, 35, 3, 6, 85, 37, 72,141, 22,140, 90,137, 33,125,122, 65, 0, 64,
- 64, 18,224,210, 58,176, 89, 60,148, 87, 40, 0, 32,161,217,193, 81,175,127,201,178, 69, 16, 4,120,230,230,224,137, 68,224,137,
-205, 95,176,112, 25, 99,177,225,243,249, 71, 79,158, 60,233,228,236,236,140, 85,171, 86,193,197,197,197, 91, 42,149, 42, 45, 45,
- 45,133, 14, 14, 14,232,208,161, 3,122,245,234,133,139, 23, 47, 2, 70,196,148,210, 27, 4,177,207,210,209,187,168,248, 14,126,
-185,241, 29,180, 42, 13,252,251,127, 7, 29,187, 53,236, 58,174, 4,157,116, 4,202,252,179, 85,214, 3,199,145,200,206, 76, 7,
-193,226, 61, 49,214,242, 84,243,249,209,163, 71, 56,118,246, 38,156, 90,249, 32, 51,241, 41,158, 94,191,134,219,118, 54,104,229,
-211,161,118, 26,168,209, 50, 82, 96,175,249,182, 42, 76,212,210,217,239,242,139,139,139,249,214,214,214,154,154,182,115,114,114,
-122, 29,177,245,238, 39,159,124,130, 82, 14, 7, 24, 49, 2,220,148, 20,232,116, 58,244,236,217, 19,221,186,117, 3, 0,244,236,
-217, 19,108, 54, 27,157, 59,119,134, 84, 42,197,183,223,126,251,110, 99, 66,139, 36, 16, 99, 48,200,189, 61, 61, 61,107,133,214,
-161,195, 50, 68, 63,120, 19, 4,120,216,182, 35,169,246, 88, 55, 55, 55,228,231,165,128, 32,152,184,102,202,184,218,209,209,113,
-153,147,147,147,231,166, 77,155, 88, 2,129, 0, 31,125,244,145, 71, 69, 69, 69,235,106, 83, 50,194,194,194, 0, 0,203,151, 47,
-199,138, 21, 43,160,209,104,148,141,145, 29,218,220, 73, 90, 88, 76,191,199, 84,152,141, 29,104,219,186,211,160,192, 33,240,240,
- 26,132, 65,129,153, 0,176,206,154,157, 62,225,171,207,173,206, 88,153, 19,251,175, 92,186,186,188, 79,255, 65,159, 47,174,184,
-190,230,203, 61,165,205,250, 60,150,101, 28, 44,127,198,155,184,101,251,174,195, 91,190, 8,155, 47,200,148,105, 75,114, 74,152,
- 10, 49,159, 45,110,227, 64,136,231,126,182, 58, 53, 55, 55,101, 17,178, 46, 53,187,210,146,166,105,164,164,164,212,250,244,169,
-213,106, 84, 86, 86, 34, 43, 43,171,182,207,168, 68, 22,111,205,153, 62,178, 75,165, 74,165,252,253,113, 98,230,210,121,147, 3,
- 42, 85, 42,101, 98, 90,230,115, 96, 91,131,106,140, 36,201,199,202,114,229, 16,101,169, 26,178,152,103,112, 25,220, 10,122, 3,
- 1,173,129,130, 76, 94, 14,141, 1,160, 72, 14, 58, 78, 8, 1, 69,176, 81,148,155, 3,146,197,122,132, 23,157,246, 77, 48,193,
-132,127, 15,154,212, 34, 53, 22,173,128,128,128, 31,235, 90,157,106, 62, 3,208,160,105, 87, 30, 89, 93, 49, 85, 51,157,216,216,
-247,212,227, 53, 22, 47,249,104, 53, 27,222,161,230, 59, 93, 45, 21,210,175,151, 79,118,161, 13,134,246,133, 69, 5, 6, 54,155,
-207,113,181, 84,229, 21,103, 26,255,237, 26,141, 38,226,218,181,107, 99,222,124,243, 77,126,226,227, 71,208,150,149, 65, 91, 86,
- 10, 14,109,128,181,176, 43, 72,157, 6,132, 86, 11,103,111, 26,234,114, 33,110,222,142,211,107, 52,154, 8, 99,133, 22,201, 98,
-189,232,151, 37, 22,131,111,110, 1,190, 88, 92,127,106,177, 57, 81, 96, 54,116,232,208,193, 61,123,246, 4,195, 48,216,179,103,
- 15,116, 58, 29, 79,167,211, 65,171,213, 66,167,211, 65,161, 80,224,240,225,195,216,185,115,231,109, 0, 7,154, 29,204, 12,218,
-107,151,175, 70,117,159, 49, 57,136, 19, 25,177, 25, 6, 45, 5, 21,225,130,202, 74, 61, 42,180,102,160,108,166, 0, 5, 23,192,
- 98, 11, 16,208,217, 3,103, 79,133,235, 96,208,252,108,164, 10,127,193, 42,148,149,153,142,236,228,231, 16, 43,242, 97,103, 97,
- 6,101,202,115,248,135, 76,125, 37,235,132,171,171, 43,104,154,198,192,129, 3,107,157,171, 95, 85,108,201,229,114,156, 63,127,
- 30, 61,123,246, 68,255,254,253,145,147,147,131,148,148, 20, 12, 31, 62,188,246,152, 71,143, 30, 33, 58, 58, 26,109,218, 52,109,
- 36, 44, 42,214, 71,102,103,197, 4,143, 30, 61,154,123,247,238, 93, 48, 12, 3, 47, 47, 11, 88,152,139, 64,144,124,248,248,216,
- 3,168,122, 6, 24, 48, 96, 0, 20,138, 20, 67, 73, 9, 19,217, 76,117,143, 2,248, 73,171,213, 38,245,235,215, 79,154,156,156,
-140, 5, 11, 22,176,143, 31, 63, 94, 99, 74, 70,104,232,139,139, 41, 84,170,198,167,238,219,119,242,254,212,195, 32,233, 47, 16,
-182,118,183,176,237, 12, 15,175, 65, 0,128, 55,131,102,192,163,173, 27, 20, 69,177,238,106, 85,250, 88, 46,187, 68, 18,187, 45,
- 39, 94, 56,194,119,186,186,240, 70, 34,170,166, 78,155,253,217, 85,137,199, 11, 50, 57, 83, 78,252,116,238,226,172,225, 65,163,
- 56,122,202, 96,240,109,197,177, 58,121,230, 66, 97, 78, 70,230, 55,200,188, 20,247,135,253,175, 73, 43, 30,165, 80, 40, 32, 18,
-137, 16, 23, 23,167, 25, 49, 98, 4,159, 36, 73, 36, 37, 37,213, 10, 45,123, 91,235, 14,189,187,249,122,175,217,114,248,178,136,
-207,231, 7, 14,232,234, 19,159,152,145,205, 48, 68,122,163,214, 86,189,254,234,227,152, 71, 3,237,164,109, 89, 41, 55,238,194,
-166,239,112,104, 52, 36, 84, 90, 26, 26, 3, 96, 96,113,225,228,215, 3, 86,109,124,192, 0,184,127,247,182, 94,163,215, 95, 54,
-141, 53, 38,152,240,175,182,106, 49, 77,137,164,234,207,197, 0,210,215,175, 95, 95, 84,199,218, 36, 3,240, 8, 64,151,234,227,
-100,245,206,147, 17, 4,113,159, 97,152,110,117,120,100,117, 4, 87,221,207,218,122,199, 60,106,129,200,170,251,254,162,208,106,
-108, 73, 37, 0,216,218,218,218,251,251,119,109,243,253,190, 19, 96, 24, 6,207,162, 55,162,164,240, 41,150,173,251,173,141,179,
-179,115,255,156,156,156,155,198,148,128,162,168,227,251,247,239, 95,212,227, 13,127,127,119, 23, 23, 60, 74, 79, 3,151,161,192,
-165, 40,144, 58, 13,216,148, 22, 46,190, 20, 72, 66,140,220,220, 50,108, 56,122, 34,174, 58, 74,124,147,240, 30, 62, 10,171,178,
-203, 64, 16, 4, 54, 5,248,130,103, 46, 6, 87, 36,198,127,206, 69,213,138,171,136, 85, 97,224,137,197,104,211,195,168,128,240,
-202,235,215,175, 63,120,252,248,113, 55, 95, 95, 95, 44, 90,180, 8,233,233,233,160,105, 26, 5, 5, 5,234,188,188,188, 28,153,
- 76,150, 14,224, 12,128,239, 97, 68,228,113,174, 70,189, 53,226,244,161, 57, 1,125,250,219,142, 30,187, 19, 63,157, 90,136,210,
- 50, 5,148, 6, 33, 42,213, 6, 84,106, 88,176,182,233,132, 30,157, 59, 35, 55,167, 16, 79,238, 94,174, 96,107,148, 27, 91,210,
- 65, 9,130, 64,116,116, 52, 60,165,230,120,254,203, 77,216,154,113,208, 69,234, 8,105,239, 62,181,241,165,154, 2,135, 5,195,
-187,239,190, 91, 27, 25,126,232,208,161,105, 83,166, 76,113, 90,184,112, 33,246,237,219,135,219,183,111,191,228,160,221,191,127,
-127,220,186,117,107, 37,128,229,205, 25,245,180, 90, 45,188,189,189,113,255,254,125, 92,187,118, 13,131, 6, 13, 66,255,254,253,
- 17, 27, 27,139, 43, 87,174, 32, 58, 58, 26, 4, 65,192,198,198, 6,250, 42,241,172,111,140, 76,167,195,201, 47,191,218,191,100,
-203,150,157, 29, 39, 79,158,140,211,167,127,196,140,233,237, 65,144,124, 16, 4, 31,163, 70,182,199,170,213,247,209,163,199, 0,
-216,218,114,176,101,243,217, 84,149,138, 58,108, 68, 51,174,185,114,229,138, 84,173, 86,163,180,180,148, 17,139,197,132, 92, 94,
-181,162,181, 33,139,150, 82,169, 20, 52, 70,244,248, 97,194,198,210,114,166,132,169,136, 30, 91,108,136,238, 52, 40, 48, 11,111,
- 6, 77,199,213,136, 3,136,186,124, 13,214,236,244, 52,136,202, 47, 22,165, 21, 41,242, 42,189,118,249,188, 49,147,149, 93,121,
-121,215,220, 81,207, 89, 78, 78,244,201,176,239, 20,165, 77, 9, 45, 0, 68,113,252,145,115,103, 24,140,234, 21,208,163,173,175,
-155, 19,175,164,168,144, 57,117,246, 98,156, 46,237,244,249, 58, 2,139,105, 70,168,175, 10, 13, 13,253,162,250,243,193,165, 75,
-151,206,220,176, 97,131, 93,126,126,126,173,143, 86, 97, 81,113, 84,175, 17,115, 41,121,105,153,118,255,150,207,198, 11, 5,124,
-222,210, 13,251,111,232, 89,184,219, 24,175,129,166,191,157,176, 96,217,252,196,103,209,206,173,133, 60,156,253,108, 57, 30, 93,
-185, 14, 61,201,197,135,215,126,135, 70, 71,161,180, 72,142,159,223,155, 13,177,131, 4, 59,111,156, 46,160,105,250, 59,211, 80,
- 99,130, 9,255, 94, 52,166, 69, 8,130,104, 40,198, 94, 65, 3,255,187,223,212,121,141,240,252, 25,104, 52, 42,188, 81, 75,240,
-138,138,138, 10,111,221,250, 29, 55, 34,214,224,102,196, 26, 60,137,126,132,220, 28, 45,114, 10,212,176,176,176,248,173,137, 83,
-235, 71,142,101,148, 74,229,184,165,203,190,200, 23, 8,205,208,111,240, 96, 56,218,217,195,140,203, 1,203, 64,131, 69,112, 80,
- 33,179,194,243, 88, 37, 22,239, 63, 82, 88,161, 84,142,107, 96,144, 24,210,152,200, 32, 8, 2,124, 11,115,240,196,230,224,155,
- 91,188, 48,141, 40,176,176,128,192,220, 2,108, 30,175, 33,103,248,151, 56, 43, 42, 42,222, 30, 63,126,124, 73, 89, 89, 25,102,
-206,156,137,155, 55,111, 70, 95,190,124,217, 34, 54, 54, 86, 40,147,201,218, 2, 24, 10, 96,119, 19, 34,235, 5,206,146,146,148,
-114,198,160,153,184,254,139,143, 85,106,131, 13,130,167, 30,135,136,204,130,129,162,193, 0,144, 90,243,208,123,200,106, 20,106,
-123,225,248,174,181, 74, 90,167,158, 92, 47,134,214, 11,156, 12,195, 48, 14, 14, 14, 47,181,193,181,107,215, 16, 60,254,109, 4,
-142, 29, 3, 59,119, 79,216, 15, 25,142,192,153, 31, 98,215,174, 93, 32, 73, 18,182,182,182,245, 7,222, 90,206, 67, 49,224, 28,
-123, 12,226,216, 99, 16, 7,163,193, 6, 16,114,228,200,145, 47,187,116,233,114,253,246,237,219, 27, 1, 76,172,251, 93,117,176,
-162,158, 53,171,161,223,232,243,249,243,231,171, 18, 19, 19, 33, 18,137, 96, 48, 24,112,251,246,109,236,220,185, 19,155, 54,109,
- 66,116,116, 52,108,108,108,208,166, 77, 27,104, 52, 26,220,191,127, 95, 5,224,243, 38, 56,105,153,204,240,246,182,109, 27,228,
- 65, 65,125,177,127,255, 14, 56, 58,246, 2,135,237, 8, 54,199, 14, 34,177, 55,246,126,255, 37,134, 13,243,199,185,179, 39,138,
-139,228,134,183, 1, 24,140,232, 75,234,223,127,255, 29,187,118,237,194,248,241,227,115,130,131,131,169,178,178,178, 90,139, 22,
-195, 48, 96, 24, 6, 43,170,125,204, 52, 26, 13,191, 49,206,247, 23,199,229,124,182,246,201,170,130,252,156,158, 55,175,255,246,
-110,212,229,107, 72, 77,140, 66,212,229,107,248, 37,234, 78,104, 65,126, 78, 79,255,238,237,184,227,102,206,249,244, 80,248,105,
-150,216,194, 9,135,194, 79,179, 38,205,253,120,109,215,192, 65,159, 55,215,231,171,127, 71,166,162,176, 32,108,221,198,237, 21,
- 6,157,154,252,250,155,111,115, 85,178,188,207,235,244, 75,166,185,254,169, 82,169,118,171,213,106,169, 90,173,150,106, 52,154,
-207,211,211,211,251, 45, 90,180, 72, 70, 81, 84,173,181, 84, 22,127,238,183,167,191, 30, 92,103,111, 43, 17,246,234,214,177,253,
-230,221,167,110,100,102, 21,252, 80, 39,134, 86, 67,229, 84, 87,168,212,111,143, 25, 55,165,178,180, 68,131,128,143, 67, 65, 11,
-196,208, 80,128,158, 97,193, 64,176,241,120,205,102, 8,173,205,113, 52,237,161,178, 76,175,123, 27, 47,198,208,106,170,238,175,
- 3, 19,167,137,211,196,249,247,228,252, 95,134, 19, 94,204,117,232,244,130, 69,171,185, 37,149,206,206,206,253, 70,143, 26,130,
- 1, 65, 75,193, 48, 12,158, 62,252, 10, 37,178,103,112,118,228, 35, 37, 83, 17, 0,224,102, 11, 10,147,153,158,149,213,115,254,
-231, 75,195,131,135, 14,246,241,117,119,231,183,110,221, 10, 34,123,123, 20, 21,201,240,235,221,120,253,218, 99, 39,227,170, 69,
-150, 81, 19,147, 52, 77, 87, 57,185, 3, 24, 60,127, 49, 8, 22, 11,168, 14,227, 80, 51, 48,186,119,235, 5,130,205, 6,197,208,
-208,104, 52,198,172,150,203, 78, 78, 78,126,123,242,228,201, 63, 71, 68, 68,144,129,129,129,126,103,206,156,121,157,156,121,168,
- 44, 76,188, 14, 32,104,109,216,172,227, 61, 7,141,177,240,234,216,149,219,181, 53, 11, 58, 61,129,220,156, 12, 68,132,223,211,
-197,255,126, 89,193, 24,212, 19,149, 69,137,215,155,226,210,233,116,153,109,219,182,117,216,181,107, 87,173, 51, 60, 69, 81, 40,
- 42, 42,194,111,191,253,134, 78,221,122,192,103,250,123,144,201,100,216,182,109, 27,220,220,220, 48,114,228, 72, 20, 23, 23,195,
- 96, 48, 24, 59,225, 75, 1,184, 92,253, 66, 61,145, 69, 84,167, 0,106,114,218,208,211,211,147,167, 86,171,253, 24,134, 97, 17,
- 4,177, 85,171,213, 78, 11, 11, 11,115, 90,183,110, 29,218,183,111,143,162,162, 34,136, 68, 34,120,121,121, 65, 38,147,225,222,
-189,123,148, 82,169,220,133,170, 68,214,178,102,202,151,116,239, 94, 90,207,121,243,254, 19,254,229,134, 89, 94,106,205, 0,158,
-181,117, 31, 48,140, 1, 50, 89, 58,202, 21,183,117,171, 87, 29, 72, 46, 40,212,143, 3,144,104,100,157,151,207,153, 51, 7, 0,
- 4, 0,150,166,164,164,196,248,248,248,120, 53,102,209, 50, 6, 91, 78,229,168, 1, 28,123, 59, 80,186, 64, 81, 20,235,101,205,
- 78, 79,235,233, 75,111,219,114, 42, 71,109, 33,173, 92, 83,148,126,243,121, 94,229,229, 93,135,194, 79,179,166,142,125,155,114,
- 17, 39,134, 10,236,153, 83, 70, 80, 51, 93,186,116,113, 37,136, 98,143, 66,249,179, 7, 51,102,206,154, 96,201, 85, 69,118,113,
-145,183, 33,221,252, 5,209,209,209,105,104,225,202,208,106, 60,207,201,201,233, 23, 22, 22,118,153, 97,152, 23,124, 19, 10,139,
-138,163, 2,130,230, 48,165,165,101, 49,178,132,115,198,196, 82,187,119,239, 97,244, 96,223, 78,254,167,191, 92,183,193, 97,192,
-252, 69,236,231,215,111, 0,148, 30, 25, 55,111,128,226,107,233,205,119,174, 22,148,233,116, 99, 97,138, 10,111,130, 9,255,122,
-107, 86, 83, 90,228,111,142, 17,104,196, 25,222,232,202,120,122, 56, 95,110,239,213,122,168,155,139, 29, 0, 32, 37, 45, 23, 41,
-105, 57, 87, 82, 82,115, 2,155, 81,188,141, 45,175,172, 77, 42, 77, 84,135,112, 96,140, 75, 42,253, 2,167,141,141,205, 3, 54,
-155,237,210,146,214,160, 40, 42,183,168,168,200,223,200,114, 78,114,119,119,223,144,145,145, 17, 78,211,244,130, 22,170,253, 6,
- 57,107,146, 74,147,108,222, 16,198,160,237, 4, 0, 4,155,103, 76, 82,233,186,156,157,196, 98,241,110, 14,135,227, 86,243, 59,
-214,248, 96, 81, 20,197,210,233,116, 2,138,162, 88, 0, 8,146, 36, 13, 28, 14, 71, 77, 16,132,193, 96, 48,100,106, 52,154, 89,
-248, 35,224,104, 83,117,111,118,160,175, 22, 90,104,192,162,117, 13, 0, 18, 19, 19,219, 73, 36,146,137, 4, 65,140,103, 24,198,
-187,188,188, 92,179,108,217,178,232,147, 39, 79, 42,220,221,221,223, 26, 49, 98, 4, 17, 27, 27,139,184,184, 56, 70, 46,151,159,
-170,182, 98,165,180,176, 47,145,124, 62,235, 29,107,107,114, 4,195,160, 11, 24, 16, 4,137,199,101,101,116,164, 82, 73,253, 80,
- 45, 24, 91,218, 63,107,240,110,235,214,173, 15,164,165,165,113, 26,179,164, 54, 86,247,250,248,234,243,142, 75, 3,250,246,125,
-251,183, 95,126, 57,243,217,218, 39,171,234,238,155, 59, 70, 50, 99,210,236,249, 95, 29,251,246,155,207,182,255, 84,178,223,152,
-114,250,249,249,121, 18, 4, 49, 17,128, 47,195, 48,109, 25,134, 16, 16, 4, 83, 66, 16,196, 19, 0,177, 90,173, 54, 34, 62, 62,
- 62,251, 53,234,254, 42, 79,184,141,113,214, 38,149, 6, 69,117,166, 0,198,200,164,210,255,237,114,154, 56, 77,156, 38,206,255,
- 63,206,255,101,124,208,192,255,140,139, 12, 95,131,148,212,156,192,148,212, 28,180,109,219,150, 73, 74, 74,106,145, 72,107,108,
-144,166, 40,234, 71,165, 82,249,227,235,144,200,229,242,174,127,113,227, 29, 75, 75, 75, 59,246,103, 18, 86, 11,169, 85,213,175,
- 87,197,227,138,138,138, 30,198, 30,172,211,233,254,138,182, 33,170,173, 89, 43, 27, 59, 96,232,208,161, 25, 58,157,238, 26,128,
- 44,130, 32,172, 0, 20,235,116,186,203, 6,131,161, 32, 41, 41,169,235,230,205,155,107, 34,223,175, 6,240,224, 21,203, 65,107,
- 52,212,209,220, 92,234,232, 95, 80,199,163, 90,173,118,161,141,141, 77, 27,181, 90,205, 83,171,213,220,186,139, 15,132, 66,161,
-172, 41,135,248,186,176, 50, 39, 14,114,217, 37, 54, 86,230, 68,125, 33, 5,107,103,156, 86, 85,198,181,183,118,198,105, 99, 11,
- 22, 19, 19,147,210,165, 75,151, 35, 36, 73,186, 51, 12,227, 0, 48,150, 12, 3, 25,195, 48, 69,108, 54, 59, 39, 62, 62, 62,231,
-111,116, 19, 82, 27,104,122,163, 65,171,253,195,239,208,180,186,208, 4, 19, 76,248,231,160, 81, 31, 45,118, 75,153,146,146,146,
- 8, 83,123,154, 80, 87,108, 53,181, 51, 35, 35, 67, 3,224, 78,245,171, 62, 30, 0, 24,249,119,175, 96, 94, 94,158,127, 99,251,
-140, 21, 89, 64,149,207, 22, 16,215, 96,116,246, 21,219, 75,202,177, 61,252,211,150,150,237,209,163, 71,153, 48,114,138,221, 4,
- 19, 76, 48,193,132,191, 12,175,111,209, 50,193, 4, 19, 76, 48,193, 4, 19, 76, 48,161, 65,236,169, 35,184, 94,176,110, 17,104,
-124,229, 64, 75,230, 94, 95,101,245,193, 53, 19,167,137,211,196,105,226, 52,113,154, 56, 77,156,255, 58,206,127, 42, 94, 18, 89,
-255, 13,152,150,190,154, 56, 77,156, 38, 78, 19,167,137,211,196,105,226,252, 55,136,172,250, 47, 0,166,169, 67, 19, 76, 48,225,
- 95,140,147, 39, 79, 26,149, 84,244,157,207,246, 6,137,197,146,101, 21,138,178, 13, 63,110,156,113,166,230,255,193,193,193,148,
-169, 21, 77, 48,193, 4,188,138, 51,188,135,135, 75, 7,146,162,123, 51, 12,201, 98, 72, 70, 79, 40, 84,199, 83, 74, 74, 94, 8,
- 59,224,234,234,106,197, 33, 49,146, 96, 24, 17, 65,208, 20,205, 34,111,167,166,102,199,183,160, 96, 60,137, 68, 50,135,203,229,
- 14,209,106,181, 46, 36, 73,102,107, 52,154,107, 74,165,114, 7, 94, 14, 92,248,255,134,118,237,218, 77,186,113,227,134, 85,159,
- 62,125, 52, 66,161,208,160, 82,169,216,151, 46, 93,226, 15, 27, 54,172, 52, 57, 57,249,149, 86, 36, 74,165,210, 65,123,247,238,
-245, 8, 12, 12, 68,219,182,109, 43, 39, 78,156,200, 13, 8, 8,224,206,156, 57, 51, 53, 55, 55, 55,170,133,116, 29, 8,130, 56,
- 76, 16, 4,139,166,233, 16,252, 17,186,225,207, 6, 73,146,228, 44,130, 32,198, 50, 12,227, 73, 16, 68, 10,195, 48,103,104,154,
-110, 42,112,107, 83,120, 27,192,112,146, 36,253, 1,128,166,233,104, 0,145,128,241, 43,239,254,155,156,102,102,102,126, 0,160,
- 84, 42, 99,254, 44, 78,130, 32,252, 0,128, 97,152, 87,229,156, 46, 20, 10,223, 7, 0,149, 74,245, 61,140, 72, 7, 85, 31,204,
- 46,111,198,127,229, 83, 0, 64,244,114,111, 0, 64, 75,182,137, 15,159, 18, 45,249,174,134,248, 90,194,209, 0,134, 79,158, 60,
-121,221, 15, 63,252,176, 28,192,217,191,162,227, 59, 58,186,238,216,244,205, 30,233,199,115,222,219,128,170,140, 16, 77, 95,144,
-192,155, 60, 22,107,148,150,162,126,137, 7, 78, 2, 96, 91, 91, 91, 79,226,241,120,253,180, 90,173, 19,155,205,206,211,106,181,
-183,202,202,202,142,161,137, 12, 8, 70,183,107, 2, 36, 58, 37, 28, 9,250,143, 60,111, 12, 9, 13,215, 12,249,132, 15, 74,254,
- 6,183, 81, 18,192,252,234,186,238, 67,227,225, 60,154,186,249,124, 44,149, 74,199, 42, 20, 10, 37,139,197, 98, 80,181,234,185,
-234, 79,213,126,130,166,233,194,226,226,226,144,230,184, 68,110,104,207, 19, 17,135, 41, 61, 84, 6, 13,243, 81,101, 22,158,138,
- 93,209,139, 1, 66, 24,192,157,100,145,118, 52, 77,231, 1,136, 34, 13, 56, 95,145,139,164,191,233,224,222,170,186, 93, 91, 87,
-111,115, 0, 56, 0,136, 5,240, 49,128, 10,147,254,249,175,161,190, 51,252, 5, 0,121,181, 66,171, 78,184,251, 1, 65, 65, 65,
- 55, 61, 60, 92, 58,140, 31, 51,110,221,135,179, 62, 34, 88, 44, 18,113, 79,158,176,223, 13,153, 62, 84, 34,145, 56,139, 53, 26,
- 31, 16, 4,173, 20, 8,226, 20,138,178,156,147,199,126, 48,247,110,223,158,162, 40, 26,187,118,127, 55,236,212, 79,225, 75,140,
- 20, 91,237, 28, 29, 29, 15,135,134,134, 58,142, 26, 53,138,229,232,232,136,244,244,116,171, 31,127,252,177,253,246,237,219, 39,
-148,148,148,132, 0,120,254, 10,149,237,235,104, 77, 14, 53, 23, 18,131, 81, 78,161, 92,143,159,243, 85,184, 2,224,151, 87,109,
- 61,165, 82, 57, 87,169, 84,246,232,214,173, 27,179,111,223, 62, 98,218,180,105, 12, 65, 16,132, 74,165, 58, 8,224,149,132,150,
- 72, 36,250, 54, 48, 48,208,203,203,203, 43, 37, 57, 57,121,248,137, 19, 39, 34,167, 78,157,234, 41, 18,137, 18, 1,180,107, 33,
-221, 1,185, 92,222, 69,165, 82,193,197,197,101, 31,128, 55,254,130, 78, 68,176, 88,172, 51,206,206,206,204, 87, 95,125,117,182,
- 75,151, 46, 14,197,197,197,134, 79, 63,253,116,200,221,187,119,135, 81, 20, 53,170, 5, 98, 75, 66, 16,196,110, 7, 7, 7,219,
- 13, 27, 54, 36,117,237,218, 53,150,207,231,243, 18, 19, 19,205, 22, 46, 92,184,224,249,243,231, 19, 24,134,153, 5,180,104,128,
-144, 16, 4,177, 91, 42,149,218,174, 91,183, 46,221,223,223, 63,142,203,229,114, 19, 19, 19, 69,139, 23, 47,254,248,233,211,167,
-175,196, 73,146,228,174, 30, 61,122, 72,150, 47, 95,158,208,190,125,251, 59, 44, 22,139,151,157,157, 77,174, 88,177, 98,206,213,
-171, 87,131,105,154,254,240, 85,202,105,111,111, 47, 89,177, 98, 69, 66, 64, 64,192, 93, 46,151,203,125,246,236, 25, 25, 26, 26,
- 58, 39, 41, 41,201,232,114, 90, 91, 91, 15, 36, 8, 98, 79,126,126, 62, 27, 0,156,156,156,186, 91, 88, 88,108,175,155,211,178,
- 38, 20,133, 94,175, 47, 87,171,213,147,139,139,139, 27, 12,132, 59, 45,108,219, 72, 0,216,174,171,217,174,122,111,110, 27,216,
-117,222,152, 74,251, 57, 86,197,197,219, 84, 57, 99, 12, 0, 76,170, 78, 21,190,169, 18, 96,179,217,180,159,227,199, 76, 76,126,
-139, 66,198,140, 30, 52,104,208,138,168,168,168,239, 6, 12, 24,176,248,200,145, 35,246, 89, 89, 89, 95,254,242,203, 47,174,239,
-188,243,206,180,159,127,254,121,125, 81, 81,209,169, 63,171,243,243,184,124, 62, 65, 18, 16, 10,204, 44,140, 57,158, 67,146, 65,
-119, 70,143,126,255,251,103,207,252,183, 63,125,234, 81,233,228,212, 99,222,188,121, 14,227,198,141, 35, 93, 93, 93,145,148,148,
-100,115,228,200, 17,159,239,191,255,126,108,105,105,233,124, 0, 25,175, 35,178, 42, 75,209, 73,163,133, 63,195,192,170,246,130,
- 37, 80,202,215, 33,154, 73,192,227,191,129,216,250,226,192,129, 3,203,147,146,146,176,126,253,122, 0,216,209,194,243, 23,142,
- 30, 61,122, 68,120,120,184,240,228,201,147,194,110,221,186,193,209,209, 17,213, 15, 83,181,129,169, 61, 60, 60,140,107, 51, 26,
-155,182, 70,206,120, 35,174,248, 34,190, 29,151,191, 94,232, 2, 67,175,209, 94, 99,131,166,249,195,210,206, 12, 2, 49, 27,165,
-114,133,239,179,232,172,192,235, 39,146,190, 76,122, 40,219, 80,153,137, 47,208,120, 76,190,255, 23,216,216,216,236, 75, 77, 77,
- 29, 40, 18,137, 94,248,127, 74, 74,138,159,151,151, 87, 25,128, 69, 45, 21,110,118,118,118, 71,105,154,214,200,229,242,247, 0,
-192,220,220,252, 7,145, 72, 36,201,203,203, 91,242, 87, 61,200,212,160,190, 22,249, 31,183,104,213,250,107, 53,148,235,144, 32,
- 41,186,247,135,179, 62, 34, 38, 78,122, 39, 63, 41, 37,149,102,115,120,147, 46, 93,190,108,214,161, 67, 7, 82,179, 99, 7, 12,
- 50, 25,244, 11, 22,244,186,118,237,154, 62,120,210, 20, 21,135, 69, 28,240,244,112, 55, 59,126,236, 71,199,240,211,167,122, 3,
-104, 78,104,241, 28, 29, 29, 15,223,184,113,195,217,195,195, 3,165,165,165, 72, 79, 79, 71,101,101, 37, 38, 76,152,192,233,221,
-187,183,243,248,241,227, 15,151,149,149,245,105,129,101,203,161,173, 11, 59, 98,214,244,113,237,134, 13,237, 45,114,118,109, 3,
- 38, 95,141,172,228,167,221, 34,110,220,157,119,224,116,228,243,164, 50, 38, 8, 13,231, 70,106, 18, 69, 69, 69,159,141, 29, 59,
-246,244,192,129, 3,237,248,124, 62,164, 82, 41, 49,106,212,168,194,220,220,220,149,175,172, 90,170, 83,216,144, 36, 73,213,125,
-111, 32, 61,144, 49,112,145, 72, 36,144, 72, 36, 0,224,252,186, 79,158, 86, 86, 86, 59,204,205,205,199, 43, 20, 10, 21, 73,146,
- 12, 65, 16,140, 86,171, 21, 74, 36,146, 71, 9, 79,159, 75, 53, 26, 77,219,141, 91,191,255,102, 80,223, 46, 22, 87,175, 94,197,
-184,113,227,152, 43, 87,174,204, 50, 54, 79, 29, 65, 16,187,199,142, 29,171, 92,182,108,153, 58, 41, 37,221, 57,225,121, 10, 33,
- 18,240,104, 91, 91, 91,206,189,123,247,216, 91,182,108, 17,172, 88,177, 98, 55,195, 48,227, 91,208,158,187,223,121,231, 29,221,
- 39,159,124,146,247, 44, 41,213,254,113, 66, 18, 35, 22,112, 12,182,182, 54,172,187,119,239,210,175,194, 73,146,228,174,207, 62,
-251, 76, 49,107,214,172, 18,121,113,153, 99,137,162,130,225,115, 88,122, 71, 71, 71,246,217,179,103, 53, 71,143, 30, 37,223,127,
-255,253, 93, 52, 77, 7,183,160,125,119,141, 26, 53,170, 60, 52, 52,180, 52, 49, 37,205,241,113,252,115,152,241, 57,122, 7, 7,
-123,214,253,251,247,117, 27, 55,110, 36,215,172, 89, 99, 84, 57, 69, 34,209,161, 19, 39, 78,176,207,158,173,186,247,253,246,219,
-111,164,167,167,167, 89,221, 99, 84,106, 13, 72, 2, 40, 42, 42, 50, 11, 8, 8, 56, 4,224,165,224,190,254, 43,159, 98, 90, 24,
- 48,119,238,220,188,150,118, 22,127,167,121,205, 30, 67,125,231,205,108, 81,206, 24,195,102,179,233,247,223,127, 63,191,254,126,
-181, 90, 77, 0, 24,133, 47,141, 23, 91,195,135, 15,255,252,194,133, 11,109,142, 28, 57,178,249,232,209,163, 90, 0, 16, 8, 4,
-182, 63,254,248,227,250, 9, 19, 38, 96,194,132, 9,203, 78,157, 58,245,167, 9, 45,138,161,116, 0,192, 23,240,249, 79,159, 62,
- 37,188,189,189,155,140,184,175,163,233, 7,223, 63,123,214,245, 63,222,222,221,138,105,186, 45,119,216,176,138,133, 11, 23, 22,
- 41, 20, 10,164,167,167, 67,167,211, 97,218,180,105,172, 1, 3, 6, 72, 39, 76,152,176,173,188,188,252,109, 0, 58, 35,250,228,
- 70,103,103,231, 15,202,202,202, 42,106,172, 58,125, 66, 40,118, 63, 63, 3,191,115, 91, 61,143,203, 50,112, 71, 46,160,137, 43,
- 59,136, 74,111, 15,252, 10, 0, 92, 37,100, 45,124, 24,104, 16, 22, 46,240,160, 56, 88, 99,231, 34, 28, 36,203, 80,173,170,204,
-108, 82, 44,189, 45, 18,137,198, 84, 86, 86,158,170, 30,156,219, 5, 5, 5,225,238,221,187, 0,208,187, 90,104, 13, 34, 73,242,
- 93,154,166,247, 2,104, 42,149,219,188,209,163, 71,191, 25, 30, 30,110, 14, 0,167, 78,157,130, 94,175,135,167,167, 39,184, 92,
- 46,120, 60, 30, 56, 28, 78,109,118, 16, 35,225,100,103,103, 11, 91, 75, 14, 36,214,162, 97,139,119,142,102,187,117,176, 64, 33,
-245, 4,197, 76, 41, 12,140, 6, 92, 27, 17,218, 7, 90,193,127,232, 32,242,252,174,184, 37,231,191, 77,232,170, 36, 49, 18, 25,
-208,252, 93, 70,118,146, 36,249,177,177,177,144, 74,165, 47,252,159,197, 98, 1, 64,191, 87,160, 92,150,146,146, 18,240,240,225,
- 67, 12, 28, 56,112, 89,167, 78,157,222,186,121,243,166,163, 92, 46,199,192,129, 3,183,101,103,103,159,253,171,235, 84, 87,139,
-252, 83, 76, 93,100, 61, 37, 57,160,234, 41,152,100,177, 88, 36, 82, 83,210,245, 3, 7, 14,158,154,153,153, 41,238,209,163, 7,
-201,225,112, 80, 25, 21, 5,245,253,251, 16,139,197, 24, 59,118, 44,231,214,173, 91, 22, 22, 98,139,153,105,169,105,229, 44, 22,
- 9,134, 33,155,245,121,144, 72, 36,115,150, 44, 89,226,232,229,229, 5,131,193, 80, 27,209,220, 96, 48, 32, 43, 43, 11, 98,177,
- 24, 33, 33, 33,246,102,102,102,115,140,172, 71,235,118,158,246,209, 55, 34,119,191,177,240,195,225,162,118,102, 87, 33,202,154,
- 15,241,169,255,192, 39,247, 18, 66,199,244, 16, 93,249,118,153,127, 27,169,117,116, 29, 19,171,209,208,104, 52,191,198,197,197,
-205,188,121,243, 38, 13, 0,215,175, 95,103, 18, 18, 18,102,189,206, 83, 40, 77,211, 40, 45, 45, 5, 77,211,172,234,237,154,247,
-255,215,254, 96, 97, 97,177,235,173,183,222,122, 39, 35, 35, 67,120,241,226, 69,155,204,204, 76,219,180,180, 52,187,118,237,218,
-177,215,175, 95,127, 65,173,209,177,244, 20,163, 53, 80,250,242,188, 39, 79, 82, 74, 10, 10,162,247,239,223,175, 34, 8, 98,172,
-145,223,241,182,147,147,147, 77, 88, 88, 24, 8,142, 89,247,246, 62,157,188, 88, 28,161, 37,201,225, 89,170, 84,106, 42, 53, 53,
- 53, 43, 44, 44,204,189, 75,151, 46, 82, 84, 77,175, 25,197, 41,149, 74,109, 63,249,228, 19,176,249,230,126,157,187,248,183,225,
-241, 69,230, 44,142,208,188, 71,143, 30, 3, 82, 82, 82,114, 67, 67, 67,157,186,117,235,214, 34,206,110,221,186, 73,222,127,255,
-125,131, 64,104, 30,224,225,225,233,211,185,163,207,136,118,237,218,141, 97,179,217, 6,153, 76,150, 17, 18, 18,226, 52,114,228,
- 72,135,150,112,218,219,219, 75, 66, 67, 67, 13,174,173, 60, 3, 3,223, 28,218,147, 43, 52,183,100,243, 68, 86, 74,165,154,122,
-246,236, 89,198,210,165, 75,157,252,252,252,236,141,225, 84, 42,149, 28, 91, 91, 91,248,250,250,162,131,167, 39,202,202,202, 16,
- 30, 30,142, 3, 7, 14, 96,239,222,189, 56,118,236, 24,186,246, 25, 10,115,115,115,228,230,230, 66,161, 80,112,254,219, 29,138,
-250,206,155,217,174,253, 96,212, 71, 31,125,148,251,254,251,239,231, 11,133, 66,186,254,203,218,218,154,154, 60,121,114, 65,200,
-226,173,163,106,166, 22,155,177,100,197, 70, 70, 70, 38, 31, 57,114, 4, 29, 58,116, 64, 96, 96, 32, 15, 0,230,204,153,195,155,
- 48, 97, 2, 78,156, 56,129, 83,167, 78,197,123,121,121,221, 6, 48,218,152,114,134,132,132,244, 9, 14, 14,254, 37, 56, 56, 56,
-102,226,196,137,123,102,205,154,245,194,200,149,151,155,253, 64,171,213,162,139,127, 55,179,213,251,126,159,220, 28, 95, 2,112,
-100,207,211,167, 7, 54, 60,121,146,177,172, 67, 7,171, 86,105,105,214, 7, 55,110,180,173, 73,210,173,215,235,145,149,149, 5,
-137, 68,130,201,147, 39,219,242,249,252, 16, 35,138,185,101,244,232,209,211, 51, 51, 51,197,223,127,255,189, 83, 76, 76,140, 52,
- 47, 47,207,233,231,107,151,237, 62, 93, 52,199,220, 82,204,227,229,202, 24, 2, 0,210,114, 33,122,154,138, 62, 12, 3,171,186,
-211,137,175, 4, 39, 8,133, 46,216,222,166,143,213,243, 79, 78,248, 77, 12,141,240,183,149, 56,241,195,154, 56,163,243, 87, 95,
-125,117,242,252,249,243,147,250,244,233,115, 26,128,176,129, 99, 4, 93,187,118, 13, 63,113,226,196,244,190,125,251,254, 10,192,
-183,209,167, 72, 23,151,177, 63,253,244,147, 77,205,182,173,173, 45, 4, 2,193, 75, 34,139,203,229,130, 36,201, 22, 87,111,237,
-143,147,216,214, 62, 26,196,149, 68,226,196, 87,177,248,106,216, 51,122, 93,175, 52,205,142,144,167,184,114, 34, 22,133,136,197,
-240,255,180,193,164,165, 93,134,152, 81, 88,243,119, 26,192,101, 50,217,187,253,250,245, 59, 57,124,248,112,205,195,135, 15, 33,
-147,201,224,236, 92,251,172,157,255, 10,148,214,102,102,102,112,117,117,133,151,151,215,164, 91,183,110, 57,234,245,122,164,165,
-165,161,176,176, 48,250,191, 81,167,186, 90,228,127, 12,245, 29,225, 47,188, 36,180,170,115, 11,221, 0, 0,134, 32, 42, 99,227,
-226, 56, 44, 30,111,202, 15, 71,143,242,185, 92, 46, 50, 50, 50, 16, 31, 31, 15,229,207, 63, 67,117,231, 14, 10, 10, 10, 80, 81,
- 81, 1, 7, 7, 7,236,222,183, 79,164,165,152, 25,207,158, 63,103, 49, 36, 83,215,223,160,193, 37,158,124, 62,127,200,184,113,
-227, 26, 21,100,185,185,185, 24, 62,124, 56,135,197, 98, 53,180,170,161, 62, 39, 33,181, 35,206,255,124,122,181,147, 19, 47, 30,
- 72, 90, 8,148, 71, 3,140, 6, 48,104,129,156,199,192,133,149,104, 85,241,148,184,188,122,170,163,179, 25,251,124, 3, 74,185,
-185,165,168,158,222,222,222,123,167, 76,153, 66, 2,192,160, 65,131, 8,111,111,239, 61, 0, 60,155, 56,231, 90, 51,131,228,221,
-146,146, 18, 76,152, 48,193,166, 77,155, 54,215, 38, 76,152, 96, 83,243,255, 87,229,172,177, 38,119,232,208, 65, 46, 16, 8,142,
- 1, 70,221, 96,107, 57,173,172,172,118, 12, 31, 62,124,252,209,163, 71,185, 0,112,227,198, 13,156, 63,127, 30, 79,158, 60, 65,
- 98, 98, 34,237,239,239,111,183,117,239,201, 93, 59,190, 59,180,101, 76,239, 46,210, 1,221,253,125,196, 21, 37, 21, 14, 14, 14,
-189, 25,134,241, 52,178,156,195, 87,174, 92, 25,159,144,156, 97, 73,178, 57,108, 46,135,205,183,176, 16, 57, 54,112,168,183, 0,
- 0, 32, 0, 73, 68, 65, 84, 72,204, 69, 46,214,102, 2,103, 62, 73,136,149, 74,101,254,177, 99,199,104, 0,195,141,229, 92,189,
-122,117,106, 66, 82,134, 21, 65,178,217, 28, 54,135, 43, 22,155, 89, 13, 11, 28,216, 13, 0,184, 96,184, 10,133,162,224,192,129,
- 3,186,150,112, 46, 95,190, 60,174,184,180, 66,194,230,112, 56,108, 54,171,182, 45, 69, 66,161,157, 25,159,207,211,104, 52, 57,
-223,124,243,141,170, 37,156, 43, 87,174,140,127,150,156,105, 77, 18, 4,139, 32, 72,182,133,185,200,198,198,210,204,206, 78, 44,
-180, 53, 99,179,120, 10,133, 34,231,240,225,195, 70,113,234,116, 58,110, 65, 65, 1, 18, 18, 18,224,218,173, 27,174, 94,189, 10,
- 55, 55, 55, 76,152, 48, 1,239,188,243, 14,132, 66, 33, 6, 5,116, 66, 88, 88, 24,146,147,147,161,211,233,248, 13,113,214,248,
- 73,213,135, 84, 42,125,216, 92,231,169,119,238, 11,229,244,115, 4,179, 93,251,193,168,186, 2,171, 49,126,107,107,107,170, 33,
-107, 87,125,206,225,195,135,127,254,243,207, 63,183, 57,124,248,240,168,144,144,144, 95, 15, 31, 62,140,158, 61,123, 34, 33, 33,
- 1,238,238,238, 56,120,240, 32,222,121,231,157, 95,183,109,219, 54,234,225,195,135, 93, 60, 60, 60,150, 52,199, 57,113,226,196,
-217,126,126,126, 81,249,249,249, 1,197,197,197,190,225,225,225, 51,198,142, 29,155, 58,105,210,164,193,181,130, 81,175, 63,122,
-225,220,105,140, 24, 53, 14,237, 59,250,238,154,182,228, 72,167,102,174, 77,230, 9,176,231, 64, 94,158,236,168, 90,173,156,192,
-225,152,153,253,254,187,245,169,239,190,179,173,155, 89, 32, 39, 39, 7, 35, 71,142,228,112,185,220,190,205,148,243,171, 49, 99,
-198, 76, 8, 15, 15,151,212, 88,117,238,220,185,131,199,143, 31, 35, 61, 61, 29,165,165,165, 24, 60,171, 2, 31,173,175,226,254,
-104, 61,131,161,115, 24,209, 43,222, 67,106, 33,116,131,163,141, 5,251,246,140,111,218,207,249, 96, 87, 7,182,216,154,131, 31,
- 22, 39,162, 40, 77,115,170, 17, 78, 34, 32, 32,224, 72,112,112, 48,161,213,106,161,213,106,181, 0, 26,140,234,235,236,236, 44,
-232,220,185, 51,102,205,154, 69, 90, 88, 88,108,107,172,156,149,149,149,154,200,200, 72,132,132,132, 96,254,252,249,104,219,182,
- 45, 36, 18, 9, 56, 28, 14, 14, 29, 57,110,251,206,140, 15,219,189,209,167, 95,151, 14,111,244,236, 92,174, 97,117,227, 8, 37,
-239, 55, 98, 13,105,176,238, 21,246, 15, 17,151,246, 27,182,143,202,166,239, 29, 84, 86,124,250,238,215, 79,159,221, 44,120,178,
- 36,120, 79, 28,243, 91,175,162, 35, 31,103,162, 64,159,128,190, 19, 90,193,195, 79,178, 64,228, 10,239, 87,109, 79, 35,209, 34,
-206, 78,157, 58,245,185,119,239, 30,191, 95,191,126,200,200,200, 0,135, 83,251, 60, 69,189, 78, 57, 87,174, 92,201, 87,171,213,
-120,244,232, 17,166, 78,157,154,163,211,233, 22,188, 78, 57, 91, 98,209,170,209, 34,255, 99,216, 83,239,149,215,152, 69,107, 37,
- 0,232,105,156,159, 50,117,134, 50, 34, 34,194,140,199,227, 33, 35, 35, 3,121,121,121, 56,116,224, 0, 53,200,222,190, 60,208,
-217, 89,113,232,192, 1, 70,171,213,130, 97, 24,120,123,123, 99,252,248,241,194,183, 39, 76, 42, 36, 20,170,227, 70, 76,243, 56,
-213,204,175,207,152, 49,227,165,253,159,126,250, 41, 44, 44, 44, 64, 16,132,163, 17,149, 11,158,183,114,140,139,196,195,170,128,
-201, 63, 84, 12,150, 0, 96,155, 3,108, 11, 64, 96, 9,240,205, 1,158, 25, 52, 15,163,138, 73, 38, 48,125, 92,223,247,156, 1,
-180,100,170, 7, 82,169,116, 89, 84, 84,148,221,195,135, 15, 25,133, 66,129,188,188, 60,102,221,186,117,118, 82,169,116,217,171,
-254, 34,185,185,185,171, 71,140, 24, 81, 48,117,234, 84,203, 75,151, 46,185, 78,157, 58,213,114,196,136, 17, 5,185,185,185,171,
- 95,231,151,230,114,185,172, 39, 79,158, 88,175, 89,179,230, 29, 0, 15, 58,118,236, 40,119,118,118,126,128, 42,167,201, 38, 97,
-110,110, 94, 43,178,106,172,107,108, 54, 27, 28, 14, 7, 82,169, 84, 91, 92, 92, 76,245,125,195, 83,232,109, 73,234,165,124,174,
-208, 90, 40,112, 49,183,176,236, 33,151,203, 99, 9,130, 72, 49,114,138,207,175,123,247,238, 28,138,225,208, 31, 77, 25, 36,157,
- 51,125,160,253,206, 53,239,187,125,179,250, 3,231,175, 86,204,244, 94,253,217,228,129, 36, 77,171,221,221,221, 29,107, 28,218,
-141, 48,159,251,119,237,218,149, 77,131,131,132,231,233, 5, 25,217, 57,229,111, 14, 8,168,181, 92,118,240,243, 15,180,179,179,
-235,231,237,237,221,149, 32, 8,163,150, 36, 11,133, 66,191,246,237,219,179, 73, 22,135,176,145,152,187,154,139,133, 14,181, 83,
- 40, 86, 86,189,172,237,236,130, 73,134, 41,115,114,114,178, 23, 10,133,126, 45,168, 59,155, 6, 23, 14,246,214,150,118,182, 86,
-226,192,129,189,219, 6,244, 10,104,215,169, 71,207,128,142,111,116,125,155, 48, 24, 20,158,158,158,246, 53, 78,242,205, 88, 90,
- 5, 71,143, 30,197,154, 53,107,208,185, 85, 43, 56, 59, 59,195,222,222, 30,119,238,220,193,189,123,247, 32,145, 72, 80, 88, 88,
-136,141, 27, 55,226,204,153, 51,208,233,116,230, 45,237, 79,198,136,173,166, 96, 48, 24,200,250, 2,171, 49,126,161, 80, 72,215,
- 56,201, 55,134,200,200,200, 35, 53,150,172,143, 63,254,184,207,214,173, 91,127,125,250,244, 41,196, 98, 49,238,221,187,135, 25,
- 51,102,252,186,109,219,182, 62, 31,126,248, 33, 14, 28, 56,128,212,212,212,125, 77,241, 77,156, 56,113,197,204,153, 51,191,185,
-121,243, 38,233,224,224, 0,137, 68,130, 49, 99,198, 96,223,190,125,108,131,193,176, 63, 56, 56, 56, 38, 56, 56, 56,134,202,186,
-242,249,201,189,235,238,196,197,198, 96,246,188, 79,120, 90,131, 62,212,136,234, 51, 42,177,184,220,208,175, 95,241, 9,189, 94,
- 57,145,203, 53,179,140,137,177, 62,191,127,127,173,216, 10, 11, 11,131,165,165, 37, 80,229,192,140, 38,172, 58, 31,156, 57,115,
-166,246,126,104, 99, 99, 3, 30,143, 7, 46,151, 11, 14,135, 3, 22,139,133,107,187, 68,248, 46,172, 74, 95,124, 23, 70,224,202,
- 14,162,242,117,126, 59, 51,103,248, 74, 28,120, 49,255, 57,216,177,139,239, 96, 27,220,249, 49, 31,235, 70, 60,204,190,119, 66,
-182, 80, 93,136, 77,141,156,246,198,167,159,126,218,161,176,176, 16,247,239,223,199,253,251,247, 27,179, 0,169,207,157, 59,247,
-101, 69, 69, 5, 60, 60, 60, 48,122,244,232,126, 0,186, 53,114,221,160,107,215,174, 24, 57,114, 36, 6, 14, 28,136,206,157, 59,
- 67,171, 51,112,130,167,124,208,254, 73,170,204,121,221,198,117,102, 81,215,195,201, 95,127,189,201, 58,114,250,138,101,192,192,
-161,223,112,205,157,238, 66,104,227,100, 76, 61,149,148, 28,126, 78,195,176,231,231,121,228,246, 27, 83,197,135,206,111,247, 52,
- 55, 55, 39,162,239,199,232, 15,125,123, 34,211, 87, 52,186,240,238,143,114, 40,137,124, 12,158,238, 65,210,192,248,191,203,200,
- 46, 16, 8,182,222,188,121,211, 81,167,211, 33, 46, 46, 14,243,231,207, 87,191, 38,101,173, 1,196,213,213, 21, 55,110,220,192,
-228,201,147,213, 5, 5, 5,191,253,183,234, 84, 87,139,252, 83,192,174,163, 32,107,145,149,149, 85, 42,145, 72,156,219,183,111,
- 79,106,181,218,170, 41,137, 83,167,168,189,251,247, 95, 80,171,213,243, 0,112,119,236,220,185,203,217,197,101,224,148,144, 16,
- 66,175,215, 99,196,136, 17,188,136,136, 8,155,148,194,194,114, 35, 6,156, 23,190,111,218,180,105,216,186,117, 43, 0, 96,238,
-220,185,181,166,117,194, 8,135, 37,177, 37,134, 7, 6,117,181,200, 18,109,183,208,245,210, 87,180, 78, 54,191, 43,170, 16,118,
- 5,201, 99, 67,192, 2,173,211, 27, 18, 11,199, 62, 72, 78,244,233, 32, 44,150,187, 15,233,216, 31,123,175, 30, 30,174,164,212,
- 39,140,190,225,152,153,117, 23,139,197,120,240,224, 65,113,215,174, 93, 75, 25,134,177, 92,189,122,181,173,153,153, 89,247,215,
-104,251,180,231,207,159,247,235,221,187,247, 28,146, 36,135,208, 52,125,173,160,160, 96, 7,128, 52, 35,207,255, 8,192,114, 0,
-181, 79,150, 90,173, 22, 36, 73,130, 97, 24, 76,156, 56, 17, 97, 97, 97, 29, 30, 63,126,140,168,168, 40,235, 33, 67,134,220, 5,
- 80, 10,224, 61, 0, 13, 90,205, 20, 10,133,234,222,189,123,194,168,168, 40,208, 52, 13,107,107,107, 88, 88, 88,128,207,231, 99,
-204,152, 49,226,208,208,208,193,151, 47, 95, 46, 84,180,118, 99, 9,242,114, 42,249, 98,177, 57, 28,157,251,126, 56,233,221,167,
- 12,195,156,105,193,205,129, 39,100, 27,212, 4,165, 33,191,250, 98, 27,105,198,229, 18, 2, 46, 27,124, 90,137,207,191, 92, 75,
-112, 25,138,141, 22,206,207,115,185, 92,174, 57, 31, 90, 22,143,165, 55, 35,192,252, 25, 23, 7,139,197,226, 9,184,141,251, 99,
-112, 72,146, 36, 73,146, 11,192,232,164,125,124, 62,159,107,206,103, 26,229, 20,178, 8, 22, 65, 16, 60, 52,178, 18,205,207, 17,
- 76,141, 21,137, 55, 47, 69, 83, 87, 20,247,237,219, 23, 23,162, 30,224,212,249,107, 40,202,136,197,210,197, 31,163, 91,183,110,
-136,136,136,104,178, 76, 53, 62, 90,141, 89,151,165, 82,233,195,220,220,220, 55, 26, 59,183,169, 41,195, 70,172, 84, 47,243,127,
- 97, 9,255,149, 79,209,140,143,214,232,190,125,251,206, 62,122,244,168,246,173,183,222,226, 77,156, 56, 17,190,190,190,125,166,
- 79,159, 14, 0, 24, 50,100, 8,182,110,221,218,103,250,244,233, 56,126,252, 56,194,195,195, 53, 3, 6, 12, 88,124,227,198,141,
- 28, 84,173,232,124, 9, 52, 77,143,220,189,123,119,125, 75, 33, 12, 6, 3,244,122,189,147,193, 96,112,170,190, 23,225,155,111,
-182, 21, 93,185, 28,129,197, 75, 86,194,222,206,209,207,200, 62, 68, 76,251,228,147,162,131, 27, 55, 98,227,241,227,248,196,221,
-221,236,112,124, 60,174,168,213, 56, 17, 21, 85, 84,253, 61,205,250,102, 86, 86, 86,170, 34, 35, 35, 45, 78,156, 56, 1, 43, 43,
- 43,180,109,219, 22,214,214,214,224,112, 56, 32, 89, 66,176,184, 18,180,239,216, 29,192, 61, 0,128,187, 20,149,222, 30,248,149,
- 32, 80,202,144, 45,247, 41,226,187,161,181,173,139,224,230,236, 3,190, 86, 22,246, 92, 92,218,145,137,203,219,179,206,168,139,
-176, 25, 6, 60, 67,227, 62, 95, 93, 61, 60, 60, 80, 88, 88,136,200,200,200, 74,160, 81, 65, 6,154,166,191,220,185,115,231,167,
- 75,150, 44,225,123,123,123, 3,128, 31,128,251, 13, 29, 43, 18,137,224,236,236, 92, 43, 44, 39, 78,253,208,115,214,194, 15,133,
- 99,135, 14, 4,155,109,139,210, 74, 61,228,229,122, 72,108,197, 88,188, 48, 88,112,173,171,115,183,221,219,126, 56,167, 82,161,
- 27,240,242,253,128, 32,112,255,247,216, 95, 59, 9,188, 1,130, 4,178,200,235, 32, 64,160,130,208,131, 96,177, 24,138,162,144,
-153,153, 9,134, 97, 48,121,236,140,172, 15,214,133,219,247,153,172,128,107,123, 41, 8, 6,253,255, 46, 66,192,198,198,198, 79,
- 46,151, 35, 45, 45, 13, 83,167, 78,205, 41, 42, 42,186, 90, 89, 89, 57, 35, 55, 55, 23, 0,138, 95,129,178, 86,204,251,249,249,
-161,123,247,238,152, 48, 97,130, 64,169, 84, 6,123,122,122, 58,203,100,178, 94,127,101,125,234,107,145,127,148,208,106,240, 66,
-211,235,219,107,118,237, 66,229,181,107,224, 93,185,130, 19, 82,105,133, 90,173, 94, 4, 32,171,250,194,255,248,192,193,131,183,
- 71,253,246,155,133,246,233, 83,120, 62,126, 12,142,149,149, 95, 75, 11,176,127,255,126, 40, 20, 10,148,149,149, 1, 0,182,111,
-223, 14,133, 66, 1,131,145, 9,103,217, 92,244,113,180,119, 71, 62, 18, 65,179, 73,113,122,123,101, 79,177,218, 60,215, 57,211,
-161,178,140,116,198,211,140, 30, 34,149, 92,219,147, 96,105,161, 46, 82,194,185,119, 91,176,193,238,211,146, 50,214,204,251,179,
-217,236,226,231,207,159,143,108,215,174,221,121, 0,182,175,226, 15, 80, 15, 73, 5, 5, 5,243, 94,229, 68, 22,139,181, 60, 53,
- 53,213,126,223,190,125,115, 86,175, 94,205,212, 21, 90, 53,159,217,108, 54, 24,134,129,165,165, 37, 56, 28,142,195,157, 59,119,
- 28,122,244,232,241, 45, 77,211,126,141,212,147,241,245,245, 69,106,106, 42,216,108, 54, 44, 45, 45, 65, 27,116, 88,185,240, 67,
- 80, 44, 62,251,179,207, 62,243, 27, 55,110, 92,220,190,125,251,244, 22, 1,189,123,201,229,242, 39,179, 39, 79,137, 59,123,246,
-172,182, 58,196, 67,243,143,248, 12, 19,147,152,152,200,114,145, 58,176, 24,131,146, 22,113, 1, 65,236, 55, 12, 79,236, 8, 1,
-155,197,112, 9, 18,124,129,208, 50, 45, 59, 91, 78,211,116,130, 49,156, 52, 77, 71,167,166,166, 10, 29,236,109,216, 74,149,182,
- 66,200, 97,120,233,209, 15, 82, 90,251,119,245, 4, 0,117,244,189, 27,252,246, 62,194,244, 2,153,200,221,221,221, 40, 78,149,
- 74, 21,147,147,147,195,114,112,112, 96,103,100,101,159,179, 18,139,236, 44,172,172,122, 2,128,174,188,236, 30,169,209,200, 88,
- 28,182,131, 76, 46, 47, 86,169, 84,169,198,214, 61, 57, 57,153,237,228,100,207,186,116,229,231,243, 14,102,124,123,115, 30,219,
-130, 79, 16,132, 25,139, 80,112, 13,116,145,192,204,204, 62, 45, 59,187,152, 97,152, 70, 45,132, 27, 74,167,140,173,250,189, 86,
- 30,175,195,141,216,216, 88, 92,252, 53, 1, 34, 70, 11, 66, 93,134, 43, 7,190,199,228,207,150,188,182,223, 95,115, 98,235,149,
-172, 89,187,125, 30,214,227, 71, 94, 51,142,240,147, 39, 79, 94,121,228,200,145, 90, 7,148,132,132, 4, 12, 26, 52,168,102,154,
- 3,129,129,129,232,209,163, 7, 18, 18, 18,224,229,229,133,168,168, 40, 62,139,197,226, 79,153, 50,101,221, 15, 63,252, 16,217,
-172,221,127,207, 30,204,152, 49,163, 33,199,234,100, 0,106, 66,226, 93, 17,182,225,144,109,177,188, 8,133,178,252, 24, 99,219,
-129, 32, 8, 76,251,228,147,162,221, 90, 45,142,254,254, 59, 66, 68, 34,179,131, 73, 73, 24,209,163, 7, 58, 13, 26, 84,100,204,
-189,174,198,170,163, 86,171,193,225,112, 96, 97, 97, 1, 27, 27, 27,112,185, 92,176, 56, 82,176,121, 93, 64,114,185,240,239,219,
- 5, 27, 23,137,148, 83,135, 97, 27, 65,160,148,207, 67, 52,215,172, 81, 95, 29, 66,228,134, 49, 12, 3,133, 50, 11,215,107, 4,
-137,101, 43, 88,114,204, 57, 87,102,126,235,109,101, 97,207,197,197,109, 25,184,242,109,246,105,117, 62,150, 86,183, 5,221,196,
-131, 68, 39, 43, 43, 43,100,101,101, 33, 51, 51, 51, 30, 77, 59,248, 43, 19, 18, 18, 82,248,124,126, 7, 59, 59, 59, 0,240,104,
-236,193,156,166,233, 90, 63,172,195, 71, 79,218,250,245,243, 20,188,217,167, 3, 14,157, 95,139,255, 4,111, 3,135, 69,128,162,
-116,216,188, 53, 8,148,166, 2,193,163, 62, 32,250, 15,241,234,114,237,188,118,166, 94, 85,242,253, 75, 15, 2,108,172,249,250,
-157, 59, 86,124, 49,217, 9, 52, 97,101,107,107, 47,226,114,185,176,177,112,210, 46,153,181, 32,143, 97,152,218,235,134,195,226,
-234,201,114,107,149, 60,191, 66,104,197, 81, 1, 12,217,250,213,162,217,252,249,200,206,206,158,215,175, 95,191,117,229,229,229,
- 37,149,149,149,147, 1,192,195,195,163, 21, 73,146,124, 0, 77,205,142,180, 66,195, 97, 33,184,143, 31, 63,134,185,185, 57,114,
-114,114,234, 26, 95, 64,211,244,223,102, 17,192,223, 20,254, 0,162, 1, 56, 1, 24,129, 58,225, 29,200,106, 83, 93,255,136,136,
- 8, 38, 34, 34,162,127,237,224,197, 48,180,161,184, 24,140,166,170,109, 57, 28, 14, 3,160,238,138, 38, 51, 43, 43, 43,130,227,
-226, 2,130, 95,229,250,193,252,137, 75, 95,245,122,227, 66,203,208, 20, 88, 32,116, 96,234, 60,180, 84, 10, 8,172,181, 29,140,
-121,188,101,200,231, 89,213, 29,233, 0, 3, 3, 10, 52,171,133,197, 97, 42, 43, 43, 97, 48, 24, 36,109,218,180,185, 96, 48, 24,
- 36,213,131, 27,243,255,245,139, 82, 20,149,194, 98,177, 48,103,206, 28,212, 88,127,180, 90, 45,242,243,243,161,209,104,160,213,
-106,145,154,154,138,178,178, 50,104,181, 90, 60,121,242, 4, 30, 30, 30, 96,177, 88, 78, 77,220,204, 25,134, 97,224,234,234,138,
-214,173, 91,131, 69, 48,216,251,213, 10,124, 62,255, 67,188,227, 65, 99,255,142,205, 24, 48, 96,128,143,187,187,123, 0,155,205,
-166, 28, 29, 29,185,225,225,225,231, 40,138, 26, 3,227,239, 60,145, 97, 97, 97,173, 59,118,236,104,111,101, 97,174,231,243, 88,
-224,233, 43, 25,190, 70,206,176,149, 69,112,117,109,101,128,208,204, 43, 36, 36,132,106,204, 10,209, 16,231,162, 69,139,156,188,
-189,189, 45, 37, 86,230,149, 60, 14,171,144, 11,166,168, 44,246,254, 93, 0,224,217,217,171, 33, 48,235, 48,117,234, 84, 67, 75,
- 56,151, 45, 91,230, 97,103,103,103, 69,130, 41,167,116,186, 63,230,219, 53, 90, 57,193,225,168,192,229,117,157, 59,119, 46,209,
- 18,206, 79, 63,253,212,189, 67,135, 14, 86, 86, 22,162, 10, 54,135,149,199,165,233, 60, 1,232,124,142, 86, 87, 34,176,179, 85,
-194, 76,236, 31, 18, 18,210, 40,103,141, 53, 43, 52, 52, 52,171,158,240, 70,113,113, 49,212,249,113,224,230, 60, 69, 23, 49, 7,
-221,236, 36,224,243,249,181, 75,223, 27,235,174,141,249,104, 53, 36,182,140, 61,183,235,170, 38,166, 0,119,251, 60,172, 31, 55,
- 43, 55, 55, 23, 78, 78, 78, 77, 94, 79, 63,252,240,195,146,129, 3, 7, 22, 6, 6, 6,106, 47, 92,184, 0,130, 32, 16, 21, 21,
-133,156,156, 28, 4, 6, 6,130, 97,152,154, 85,109,136,137,137,193,144, 33, 67,254,143,189,235,142,111,170,122,223,207,189,217,
- 77,154,116,143,116,208, 66,161,165,180,133, 2, 66,217, 67, 80, 16, 80,148,249, 69,144,189, 5, 1, 21, 17, 80,145, 13,162, 40,
-178, 5, 4, 28,200, 20, 40, 2, 50, 75, 89, 5,202, 42,165,180,172,210,221,210, 38, 77,154, 52,251,222,251,251,163, 73, 12,165,
- 35, 41,160,226, 47,207,231,115, 63,201, 29,121,114,238,185,247,156,243,156,247,156,243,190,250, 78,157, 58,229,154,253,107,213,
-138, 81,163, 70,193,104, 52, 66,165, 82, 65, 38,147, 33, 62, 62, 30,177,177,177,140, 80, 40,236,199, 10,126,125,209,192, 49,179,
-219,197, 52,107,142, 53,171, 86,232,121,108,206, 82, 71,202, 43, 65, 16, 24,254,225,135,197,138, 22, 45,100,219,213,234,242, 17,
- 18,137,176, 97,118,182,231,149,163, 71,189, 13, 6,131, 93, 28, 22,171, 78, 80, 80,144, 85,100,113,185, 92,176,121, 62, 96,137,
-154,130,231,213, 3, 66,255,126, 56,117,149,175,115, 19, 97,159,216, 21, 71, 68,238,213,187,118, 16, 6, 99, 81,187,193,210,189,
-237,255, 39, 61, 33,172,135,205,230,246,128,100,216,196,222,145,223, 68, 52,244, 9,117,193,133, 93, 5,248,115, 77,206,239,218,
- 2,204, 3,112,183,182,114,110, 48, 24,180, 20, 69,129, 36, 73,176,217,108,219, 57,129,231,126,255,253,119, 92,185,114, 5,176,
-113,219, 83, 86, 86, 70,177, 88, 44, 8, 4, 2, 0,112,173,161,190, 3,135,195, 1,135,195,193,233,139,103,188,254,215,191, 15,
-113,254,250, 49,180,143, 29,130, 18,149, 1,133, 10, 3, 74,203,129,232, 86,115, 17,211,125, 31,110, 60, 40, 67,243,102, 49, 44,
- 22, 79, 52,188, 42, 62,237, 67,100,171,179, 48,160, 36,149,110,164,207,113, 57,124, 97,255,237,212, 51,187,111,220,218,177,246,
-224,221,118,173, 58,169,205,198, 4,168, 84, 42,134, 32, 8,102,250,216,217,247,183,143,146, 83,171,134,222,160,217, 58,193,189,
-191,177,170, 15,241,241,241, 57,239,229,229,117,210, 44,142, 66,196, 98,241, 57,169, 84,154,134,138,133, 30,251,243,243,243, 35,
-213,106,117,123, 84, 44,206,122, 84, 82, 82,242,170,217,242,244,168, 6, 75,216,102,165, 82, 57,141,162,168,183,204,219, 27, 20,
- 69, 53,207,200,200,136,106,222,188,121,106, 88, 88,216,181,176,176,176,195, 97, 97, 97, 7,194,194,194, 14,116,237,218,245, 91,
-139,187,135, 23, 60,108,248,148, 22,121,201,132, 22,204, 34,107,163,249, 19, 86,161, 5,224,116,229, 9,104, 38, 62,255,150,105,
-242,100,184, 31, 56, 0, 78, 70, 6, 70, 14, 31, 46, 17, 10,133,171, 80,225,163,169,189,171,171,235,154,121,243,230,137,189,151,
- 44, 65,192,153, 51,200,140,143,135,145,195,185, 92,151,212,105, 52, 26,176,217,108,171, 37, 70, 36, 18,129,162, 40, 84,101,242,
-125,170, 0,154,112, 33,183, 48, 13, 60,132,130, 6,163, 58,162,236,148, 52,228,254, 92,223,120,101,131,240,187,106,110,248,124,
-159, 54,190,171, 66, 58, 36,169, 9,182,138,231, 46, 64, 86, 86, 54, 40,208, 14,141, 55,107,181, 90,133, 90,173, 70,243,230,205,
-189,174, 92,185,210, 48, 54, 54,214,211,124,252,210, 51, 62,152,182, 1, 1, 1,187, 2, 3, 3, 31, 6, 4, 4,236, 2,208,214,
-129,223,110, 78, 76, 76, 4,139,197,194,188,121,243, 80, 86, 86, 6,131,193,128,146,146, 18,100,101,101, 65,175,215, 35, 39, 39,
- 7,119,238,220,129, 94,175, 71,102,102, 38,116,186,218, 59, 36, 52, 77, 67, 34,145, 64,171, 81, 97,221,162, 57,248,108,214, 12,
- 40,238, 37, 35, 39,175, 16,238,110, 34, 76,157, 58,149,229,225,225, 65,211, 52, 29, 74, 81, 84,119,154,166,215,219,243,156,108,
-222,183,179,193,193,193, 49,203,151, 47,143,154,179,104, 61, 87,194, 86, 49,124,177,128,230,137,249, 12,175, 73, 27,140,154,187,
-138,251,221,202,175,211, 47, 92,184,144, 11,251,156,119,146, 0,206,182,104,209, 34, 34, 55, 55, 55, 54, 50, 50,178,177,119, 72,
-125, 62, 95, 26, 88,202,149,214, 83, 50, 58,109, 18, 17, 88,175,227,250,245,235, 83,206,157, 59,151,231, 8,167, 72, 36,106,178,
-109,219,182, 24, 63, 63,191, 24,142,139,139,160, 92,161,216,105, 42, 87,239, 98,185,123, 8, 72,137,251, 27,251,246,237, 75,222,
-179,103, 79,129, 35,156,225,225,225,145,139, 22, 45,138,110,218,180,105,180,127,131,134,124,151,192,224, 18, 65, 80, 72,137, 75,
-211, 88, 62,130, 66,123,174, 89,179,230,218,133, 11, 23,236,226,100,177, 88, 38,146, 36,193,225,112, 32, 20, 10,113,228,200, 17,
- 76, 30, 51, 4,193,129, 94,104, 28, 25,137,110,147,166, 97,207,158, 61,214, 57, 60, 44, 22,171,218, 22,125,235,146,169, 7, 91,
- 72,137,100,108,104,146,140, 13, 77,146, 91, 72,137,228,106,197,150,249,124, 85,215,216, 85, 27, 85, 51,220,104,135,216,250,227,
-244,233,211,203, 70,140, 24,193,235,213,171, 23,146,146,146, 48,106,212,168,179,123,247,238, 5, 0, 36, 37, 37, 97,250,244,233,
-103, 79,156, 56,129, 9, 19, 38,224,213, 87, 95,229, 37, 38, 38,174,129, 29,190,127, 76, 38, 19,182,108,217, 2,147,201, 4, 87,
- 87, 87,120,122,122,162, 79,159, 62, 72, 73, 73,153,240,227,143, 63,166,177, 56,156,119,123,191,213, 31,135, 14,236,197,157, 91,
- 41, 19,182, 46, 30,230,176, 83, 96,146, 36,209,107,248,240,226,226,232,104,217, 86,165,178,124,180,135,135, 48,178,160,192,243,
-212,174, 93,222,118, 8, 53,130,162, 40,171,184,178,136, 14,203,198,230,249,128, 45,138, 1, 91,220, 10, 55,238,114,141,220, 56,
- 92,229,181,194,237,154,252,103,113,120,228,168,126,115, 26,160,223,156, 6,232, 59,179,254, 72, 97, 61,108, 18,213,195,196, 94,
- 31,132,118, 13,107,229, 6,101,145, 1,241,223,100, 62,210,150, 96, 9,128, 59,246,148,115,154,166, 83,115,115,115,193,227,241,
- 80,175, 94,189, 8, 0,150,121,129,155,199,142, 29, 59,101,254,252,249, 51, 0,204, 55, 31,115,237,218,181,107,180, 74,165, 66,
- 70, 70, 6, 0, 92,169,193, 26,108, 93,101, 40, 83,102,242,235, 7, 52, 69,108,147,241,240,240,104,134, 92,153, 30,121, 50, 61,
- 54,173,123, 27,201,137, 11,113,229,207,247,240,168,160, 0, 46,254,239,128, 50,233, 98,236,232,212, 7, 92,191,126,157, 72, 76,
- 76, 36,104,154,134,209,104,100,202,148, 74,230,234,217,179,208, 36, 36, 16, 18,137,132,232,208,186,147,106,235,194, 67,151,246,
-173, 62,123,197, 80,238,112, 71,253, 89,240,217,253,251,247,219,238,218,181,171, 43,128,207,154, 54,109,122, 33, 43, 43,171,221,
-153, 51,103, 26, 7, 5, 5,173,170, 43,169,197, 45, 68,102,102,230, 19,155,217, 45,132,222, 44, 26,122,153,197, 92, 95, 0,211,
-241, 12,171,236, 29,192,233,151,120, 50,252, 33, 84, 90,109, 88, 89,104,217, 58, 10, 67,152,135,135,216,104, 52,228, 28, 59,118,
-204, 64,146, 36,132, 66, 33, 70,140, 26, 69,174, 91,187,182,227,144,182,109, 79,142,123,237,181,195, 39, 79,156,104, 17, 23, 23,
- 7,134, 97, 64,146, 36,126,251,237, 55,141, 86,171, 41, 9, 14, 14,118,183,167,210,176, 45, 64, 74,165,210, 42,180, 20, 10, 5,
-252,252,252,236, 30, 58, 84, 43,113,252,196,145,100, 57, 67, 77,202,234,117,119,165, 97,105,193,219,113,165, 52,197, 86, 80, 70,
- 40, 52, 12,202,180, 96, 39,145,158,113, 35,194,223, 49, 60,232, 30,119, 39, 33,237,124,137,150,210, 58,180, 90,162,168,168,104,
-206,192,129, 3, 75,164, 82, 41, 33,145, 72, 16, 24, 24, 72,246,237,219,183, 56, 59, 59,123,126, 93,159,136,151,151,215,255,186,
-118,237,122, 48, 55, 55,119, 64, 66, 66, 66,232,153, 51,103, 6,116,237,218,245,160,151,151,215,255,236,164,216, 57,123,246,108,
- 53,143,199, 67,155, 54,109, 80, 86, 86, 6,243, 42,159, 26, 55,123,134, 72,185, 92, 46, 54, 44,255, 2,159,205,154, 1, 89, 90,
- 18,110,156, 61,134,211, 5, 4,230, 46,250, 26, 92, 46,183, 78,190,190, 26,249, 8,155, 54, 13, 16,223,158, 62,106,112,222,167,
-179,102,137,175, 93,187,198,153,242,193,116, 38, 51, 95, 6, 94,175, 21, 44,116,158, 67, 94, 87,251,160,247, 27,221, 48,239,179,
-143,154,154,157,118,214,136, 38, 62,194,166, 49, 1,226,212,143,198, 13,185,255,193, 7, 31,184, 44, 93,186, 84,219,182,109, 91,
- 77, 97, 97,161,139,200,195, 51,146,237,230, 30,147,153, 95,224,218,182,109,219, 7,147, 38, 77, 42,117,148,115,238,220,185,194,
-163, 71,143,178, 7, 14, 28,104,146,203,229,174, 28, 23,151,230, 4, 95,208,250,177, 92,238, 54, 96,224,192,187, 3, 6, 12, 40,
- 55, 59, 44,181,155,243,243,207, 63, 23,222,185,115,135,221,182,109, 91, 99, 65, 65,129, 88,228,229, 29,203,114,247,108,245, 48,
-191, 80,210, 58, 46,238,222,148, 41, 83,212, 53,165,211, 86,164,136,197,226,220,246,237,219,227,155,111,190,193,119,223,125,135,
-158, 61,123, 34,229, 86, 10,122, 79,153,129,168,137,211,113,224,252, 69,228,230,230, 98,193,130, 5,136,141,141, 5,151,203,189,
- 83,101,121,156,144, 70, 92, 43, 0,113,173, 0, 4, 49, 33,141,176,236, 87,107,217,154,175,128,237,245, 85, 93,119,229,243,170,
- 45, 93, 45,164, 68,114, 77,243,176,106, 19, 91, 3, 6, 12,152,108,113,225, 48,122,244,232,179,171, 86,173,234, 48,122,116, 69,
- 71,187, 77,155, 54, 88,184,112, 97,135,185,115,231,158, 93,180,104, 17,186,117,235,134,176,176,176, 90, 23,190, 80, 20, 5,147,
-201,132, 33, 67,134,192,100, 50,225,241,227,199, 72, 79, 79,199,198,141, 27,193, 48,140, 0, 0,164, 1, 65,175,240,120, 60, 92,
-191,122,185,252,179,209,113, 63, 59, 96,201, 34,108, 59, 49, 42,149, 10, 3, 38, 78, 44,206,105,212, 72,182,190,184,184,124,140,
-135,135,176,254,163, 71,158, 98,189, 62, 16, 53,204, 75, 36, 8, 2, 52, 77, 91,133,149, 69,112, 85,222,204, 13,165, 93, 48,148,
-211,127,156,249, 41, 15, 0,208,105, 88, 0,250,206,172, 63, 82, 26, 46,252,190,227,208, 10,163,247,158,133,247,153,178, 60,106,
- 41,140, 72,117,192, 98,157,148,148,148, 4,119,119,119, 12, 28, 56,144, 79,146,228, 18, 75,127, 21, 21,190,179, 86, 90,184,248,
-124,254,138,247,222,123,143, 44, 45, 45,197,141, 27, 55, 0,224, 68,117,245, 18,195, 48,214,123, 87,201, 8, 80, 52, 15,231,174,
- 30,193,159,103,118,227, 97,238, 99, 60, 42,210, 2,108, 55,104,213, 57, 48,104,114,161, 47,189, 10,165, 78,104, 87,130,185, 92,
-238,227,166, 77,155, 50,173, 90,181, 98, 24,134,193,189,123,247, 76,153,143, 30,153, 46,127,251, 45,115,115,252,120, 66,156,158,
-206,117,113,113, 33, 26, 52,104, 0,129, 64, 64, 11, 4,130,146,191,177,241,126, 33,238, 22, 94,128, 91,136,231,105,213, 98,240,
-114, 34, 31, 79,174, 54,180, 58, 48,173,202, 97, 41, 24,137,203,224,221,107,214,185, 13, 28, 50, 76, 29, 27, 27,235, 17, 24, 24,
- 8,130, 32,240,246, 59,239, 16, 93, 19, 18,196,156,128, 0,120,181,108,105, 29,142, 56,126,236, 24,142, 28, 57,162, 62,244,251,
-190,192, 81, 99,198,188, 9, 96, 91, 13,137, 97,243,249,124,235,255,230,231,231,131,207,231, 91,231, 68, 40,149, 74,248,248,248,
- 32, 63, 63, 31,118,142,204,109,255,116,214,197, 89, 69,113,115, 26,196,137, 57,196, 97,117, 1, 40,134, 1,135,160, 0, 13, 3,
- 35, 5,232,140, 12, 94,169,207,242,252, 83, 99,242,136, 79,218,251, 0,192,118, 71,114, 79,167,211,157,186,118,237,218,120,154,
-166,119, 3, 32, 19, 18, 18,232,212,212,212,201,176,127,226,250,211,102,123,161,112,230,201,147, 39, 61,103,206,156, 41,143,143,
-143, 87,244,233,211,199,109,227,198,141,158,175,190,250,234,204,146,146,146, 29,246, 24, 2,179,178,178,182,101,103,103, 79,110,
-213,170, 21,100, 50, 25, 12, 6, 3,146,147,147, 17, 30, 30,142, 43, 87,174, 32, 34, 34, 2,151, 47, 95, 70,227,198,141, 65, 81,
- 20,180, 90, 45,104,154,166,106,171,204,101,197,143,129,146, 44,228, 37, 29, 70,250,205,100,156,204, 35,176,122,199, 65,212, 11,
-109, 80, 39, 63, 53, 17,190,194,104,169,143,215,159, 75,191,252,220, 55,243,212,111,216,187,101, 53,125,250,240,225, 40,158, 24,
-227, 59, 15,153,214, 95,111, 68, 8, 0, 94,187,184, 86,232,229,113,135, 18,134,162,224,100,106,205, 14, 22, 35,124,133,209,126,
-222, 94, 71,191, 90, 50, 95,124,239,200, 86,236,220,240, 13,179,231,167, 95, 99,181, 64, 92,116,116,116, 47,146, 36,221, 1,104,
-205,243,188,236, 10,109, 83, 21,231,241,131, 7, 91,104,129,184,253,251,247,247, 18, 10,133,254, 0,140,229,229,229,247,159,133,
-243, 68,124,124, 11, 75, 58, 9,130,240, 5, 96, 96, 24,230, 30, 28, 12,193, 51,104,208,160,133,211,167, 79,159, 69, 81,148,143,
- 77,239,156,181, 98,197, 10, 54, 77,211, 44,134, 97, 12, 36, 73, 26,142, 30, 61, 74,153, 76,166, 60,173, 86, 59,241, 89,106,145,
-254,253,251,227,226,197,139, 95,162, 98, 17,134,189,214,234, 39,230,105,153, 67,246,212,153, 63, 33, 33, 97,193,187,239,190,251,
-233,142, 29, 59,210, 87,173, 90,245,214,132, 9, 19,240,219,111,191,161, 81,163, 70,184,126,253, 58,230,204,153, 3, 0, 29,230,
-206,157,123, 96,243,230,205, 97,153,153,153, 43,236,176,104,192,100, 50,225,215, 95,127,197,219,111,191, 13, 31, 31, 31, 4, 4,
- 4,128, 32,136, 83, 99,198,140, 89, 11, 0, 44,130,197, 5, 0,157, 86,167,139,140,108,101,183, 5,151,203,229, 90,235,186,130,
-130, 2,235, 74,193,215,223,125,183,120,211,210,165,248, 89,163,193, 24, 15, 15, 97, 78, 80,144,244,192,189,123,227,110, 85, 84,
-206, 76, 77, 86,157,218, 68,150,189, 83, 26, 52,249,152,253,251,226,135,254, 0,122,118, 26, 22,128, 78,195, 2,208,170,175, 47,
- 65,178, 8,220,252,179, 4, 41,199,101,123,140, 74,156,130, 99,225,114, 82,151, 44, 89,114,160,115,231,206,111, 53,105,210, 4,
- 99,199,142,157,180,101,203, 22,174,209,104,252, 0,127,185,121,112, 35, 73,114,254,134, 13, 27,198,121,122,122, 34, 49, 49, 17,
-103,206,156, 57, 5, 32,171,186,122, 9,128,213,103, 86,189,224, 8,237,157, 76,149,176, 40,247, 28,206, 38,254,142, 70,177,211,
-224,226,255, 38, 60, 35, 23,193,144,246, 29,244, 37,127,194, 51,184, 15,114, 50,239,129,197,230,167,212, 54, 9,133, 97,152, 91,
- 57, 57, 57, 97, 97, 97, 97,196,195,135, 15, 77, 0, 24,138,162, 24, 67,199,142,198,168,165, 75, 57, 41,147, 38, 17,237,238,220,
- 97, 49, 4, 65, 39, 39, 39, 3,192,237,127,162, 21,183,184, 91, 72, 73, 73,169,206,221,130, 67,104,218,180,105,135, 51,103,206,
-240,181, 90, 45, 78,159, 62,141,214,173,173,107,187,254, 81,239,247,182, 90,228, 37,195,184, 42,142,109,124,194,162,245,196,139,
- 77, 19,156,198, 17, 17, 20,151,196,143,111,191,249,102,249,181,107,215,172,189, 62,237,165, 75, 80, 31, 57, 2,138,162,192, 48,
- 12,206, 36, 36,224,189, 97,195, 84, 28, 22,177,169,126,253, 80,134, 96,158,240,221,210,189,138,222,195,192,129, 3, 7, 90, 43,
-159,236,236,108,136, 68, 34,240,120, 60,208, 52, 13,147,201, 4, 22,139, 5, 55, 55, 55,152, 76,166,170, 76, 48,149, 57,141,148,
- 76, 61, 96,115,239,161,249, 1, 42, 3, 51,222,189, 62, 66,184, 46,214,194,233, 47, 33,240, 86, 44, 7,222,236, 34,230,196,138,
-215,242,104, 93,201, 0, 60,189,162,171,182, 37,255, 17,205,154, 53, 91,251,222,123,239,145, 0,208,189,123,119,178, 89,179,102,
-223,163,230, 80, 57, 53,114, 10, 4, 2, 62, 0, 28, 60,120, 80,150,158,158,222,243,224,193,131, 50,219,227,118,114,110, 92,190,
-124, 57,132, 66, 33, 76, 38, 19,244,122,189,117,126,150,237,167,193, 96,128,183,183, 55, 14, 29, 58, 4,138,162, 14,213,150,206,
-224,144, 80, 16, 62, 13,177,237,224, 73,156, 41,230,214, 69,100, 89, 57, 27,250,139, 26,251,123,123, 29,251,106,241, 2, 31,249,
-221,100,228,228,228, 48, 71,143, 28,186,160, 5,114, 21,101,248,172, 84,141,198, 26, 61, 4,173,195,144,117,108,195, 39,204,220,
- 78, 48,162,234, 85,131, 86,206, 40,127, 81,227, 64, 31,175,163, 95,127,181, 88, 92,122, 55, 25,249, 5, 5,248,227,208,193,107,
- 90,192, 50,220, 56,146,166,233, 24,154,166, 99, 0,140,172, 65,188, 56,196, 89, 94, 94,222,180,188,188,188,233,243,228,100, 24,
-166, 41,195, 48,118,115,218,206,137, 90,185,114,101, 90,126,126,254,123, 69, 69, 69, 61, 44,155, 92, 46,239,174, 82,169,186,148,
-151,151,119,212,172, 12,117, 43, 47, 47,247, 85,169, 84, 82,173, 86,251, 10,128,100, 7,222,121, 43,108,189, 78,231,231,231,207,
-203,207,207, 39,106, 75, 39,107, 98, 26,241,203,215, 31,253,190, 97,195, 6,233, 51,242, 63,145,206,226,226,226,221, 59,118,236,
-104,222,160, 65,131,176,145, 35, 71, 98,253,250,245, 88,181,106,149, 14, 0, 54,111,222,172,179,177,100, 5,103,102,102,182,170,
-102,216,176,187,141,181,100,251,235,175,191,206,156, 57,115, 6,111,191,253,182,213,145,232, 15, 63,252, 0,147,201,164,236,214,
-173, 27, 13, 0, 26,109,185,146,161, 25,232, 13,213,142,191, 63,149,159, 60, 30,239, 13, 91,127,129, 22,103,204, 60, 30, 15, 12,
-195,160,113,135, 14,197,165,177,177,178, 45, 10, 69,249,188,166, 77, 37,227, 34, 35, 71, 54, 1,134, 85,197, 73, 16,196, 19, 86,
-157,202,155, 3,150, 44,219,116, 22,105,242, 48,246,247,197, 15,143, 88, 44, 91, 2, 87, 54,180,101, 38,236, 91,250,240,177,246,
- 49,126,168, 78,252,212,116,239, 50,153,108,202,210,165, 75,117, 30, 30, 30,232,223,191, 63, 22, 45, 90, 52,166, 67,135, 14, 10,
- 95, 95,223,139,141, 26, 53,186, 57,120,240,224,252,228,228,228, 41, 93,187,118, 69, 70, 70, 6,190,254,250,235, 82,185, 92, 62,
-180, 38, 78,130, 32,172,150,188,190,189,187,203,214,125,255, 13,221,173,243,100, 8, 93, 36, 48,114,130, 33, 83, 25, 33, 87, 51,
-208,243,227,192,227,242,209,163,109, 52, 46, 30,221, 90, 78,233,213,219,106,123,231, 85, 42,213,158, 17, 35, 70, 40,185, 92, 46,
-244,122, 61,195,225,112,192,175,152,119, 76,115,122,246, 52,180, 75, 77, 53, 81, 12, 67, 19, 4,129, 15, 63,252, 80, 45,151,203,
-119,212,165, 28, 57, 0, 91,206,231,229,110,161,123,165,246,231,121,184,133,120, 17,247,254, 50, 99, 99, 21,219, 95, 22, 45,203,
-146, 74,203, 39, 65,208, 20, 69,209,168,223,160,190, 56,243, 97,214,234, 65,131, 6,142,238,213,171,183,176,119,239,222,130,232,
-180,138,222,232,193,131, 7,177,119,239,222,242, 63,255,252, 83,201,231,176, 54, 7,215, 11,246,163, 40, 26, 4, 65,215,168,134,
-197, 98,241, 7,179,103,207,118, 81, 40, 20, 88,181,106, 21,221,188,121,115, 82, 36, 18,193, 96, 48, 96,243,230,205,198,232,232,
-104, 14, 73,146, 80, 40, 20, 32, 73,242,142,157, 55,120, 67,145,149,219, 99,109,215,126,123, 91,189, 63,202, 43,170,107, 59,143,
- 46,193,129, 48,182,100,144,151,253, 16,233, 39,254,148,223, 58,250,109, 9,180,133,253, 80,123,120,160,170, 26,130, 47,254,252,
-243, 79,223, 41, 83,166, 48, 90,173,150,200,202,202, 98, 22, 47, 94,236, 59,118,236,216, 47,242,242,242,254, 87,199,135, 66,148,
-150,150,130, 32, 8,218, 92,114, 30,194, 56, 0, 0, 32, 0, 73, 68, 65, 84,145, 88,122,253,142,140,203,165,108,219,182,109,255,
- 59,239,188,211,183, 91,183,110, 72, 75, 75,179, 14, 17,218, 10, 45,203,234,195, 37, 75,150,148, 2,248,180, 54, 82, 14,135,131,
- 85,219,118,163, 84, 94, 12, 63,191, 0, 8, 92, 92, 80,215, 21,150, 60,146,156,183,108,193,231,190,197,183, 47, 18, 41, 23, 78,
-210,187,110, 20, 22,153, 40,166,106,143,255,101,121,140, 89,253,215,220,155, 33, 89,243,150, 45,158,239,102, 25,214,220,113, 53,
- 95, 73, 80,204,148,103, 42, 34, 47, 11,231,223,140,128,128, 0,228,231,231, 19, 1, 1, 1,140,121,142, 22, 83,131,208,122,242,
- 5,175, 24, 46, 35,106, 26, 54,172, 43,255,131, 7, 15, 22,183,108,217,242,163,140,140,140, 93, 81, 81, 81, 19, 0,212,211,233,
-116,165,115,231,206,253,106,243,230,205,163,237,177,100, 1,192,111,191,253,246,237,168, 81,163,142,188,249,230,155,159,208, 52,
-221,204,166, 97,127,224,235,235,107, 29,194,125, 92, 88, 48,107,252,232, 33,179, 84, 42,185,221,126,238, 92, 93, 93,199,205,157,
- 59, 87,160, 86,171,177,102,205, 26, 58, 58, 58,154,180,116,138,126,250,233, 39, 83, 68, 68, 4,123,224,228,201,197, 43, 11, 10,
-176, 48, 49, 81, 61, 43, 38,166,249,150,244,244, 87, 64,211,219,171,179,234, 84,101,201,178, 76,187,168, 35,242,204, 98,235, 7,
- 0, 61,219, 13,242,199,254,229, 15, 33,207,212,127, 5, 19,238,193,142,176, 64, 85, 32,103,207,158, 61, 61, 10, 11, 11,247,127,
-254,249,231,110,175,188,242, 10, 98, 98, 98, 56,174,174,174,113, 22,119, 49, 10,133, 2,199,143, 31,199,250,245,235,245,183,110,
-221,122,167,166,225, 42,138,162,138, 34, 34, 34, 44,249,192, 16, 4, 81,162,212, 17,110, 59,155,196,185,142, 28,191,139, 56,123,
-249, 60,242, 12, 52,116, 70, 26,245, 27,180, 64,151,158, 43,113,224,240, 77, 42, 47, 51, 53,213,168,145,111,178, 35,189,247,238,
-222,189,187,111,193,130, 5,131, 62,249,228, 19,151,226,226, 98, 74,167,211,209,187,119,239,102,141, 28, 57,146, 98,216,108,154,
-203,102,227,131, 15, 62,208,148,150,150,254, 14,252,173, 1,166, 95,136,187,133, 23,224, 22,226,185, 89,179,108, 63,255, 43,168,
-178,132,210, 44,242,220,250, 13,235,222,248,237,215, 29,254, 44, 22,233,127,239,254,253,203,111,245, 27,144,123,236,216, 49, 79,
-174,155, 91,107, 0,180,126,194,132, 11, 6,157, 70, 22,191,127,127, 72,253,250,161,177,230,160,210, 12,205, 34,207,213,244,135,
- 42,149, 74,157,152,152, 88,254,233,167,159, 18,217,217,217,191,248,249,249, 13, 62,124,248,176,107,191,126,253, 52,105,105,105,
-123,252,253,253,251,118,237,218, 85,252,209, 71, 31,233, 84, 42,149, 35,129, 71, 83,153,199,242, 38,151, 62, 95,241,238,165,229,
-235, 94, 3,155,213, 30, 58, 14, 64, 27,207,193, 80,118, 12,192, 47,112,192,223,145, 45, 68, 34, 81,172, 80, 40,196,181,107,215,
-228,113,113,113,122,173, 86,203, 93,180,104,145,151, 72, 36,138,173,107,198, 51, 12,195,200,229,114,208, 52,205, 6, 64,152, 63,
- 65, 59,190, 22,255,127,111,189,245,214,254,157, 59,119,190,222,187,119,111,132,133,133,193,104, 52, 34, 34, 34, 2,122,189, 30,
-225,225,225,208,233,116,248,242,203, 47,161, 80, 40,102,160,134,152,103, 4, 65,192,100, 50, 89, 39,219, 6, 6,133, 84,248,233,
-121, 6, 55, 22, 34, 14, 25,118, 39,126, 11,138, 74,138,233,157,215, 11, 11,203, 13, 84,143,187,143,203,111, 85,190,174,156,130,
-186,235,200,169,185, 0,160,163,107,142, 56, 47,226, 33, 44,253,208, 15, 40, 44, 42,198,111, 87,243, 75,213, 6,186,103,122, 21,
-156, 14,165,243, 37,225,108,241,101, 26, 6, 76,181,255,218,103,129,189,130,170, 58, 92, 43, 0,113, 69,184,133,193,134, 45, 85,
-250,200,122, 70,254,253, 25, 25, 25,251, 1, 32, 53, 53, 53,123,200,144, 33,179, 30, 62,124,184, 0,192, 31,153,153,153, 27, 28,
- 33,218,178,101, 75, 6,128, 81, 53, 93,179, 99,197,168,125, 0,246, 57,194, 91, 86, 86,166, 77, 78, 78,214,126,244,209, 71, 68,
-118,118,246, 97,127,127,255,215,143, 28, 57, 34,236,215,175,159, 46, 37, 37,229, 68, 64, 64, 64,167,238,221,187,187,254,145,148,
-148, 91,126,239, 94,124,252,195,135, 65, 70,154,142,175,169,124, 62,103,145,245,132,216,218,183,240,225,178,253,203, 30,118,167,
-117,216,163,151,227, 2,128,156,103,224, 60,115,238,220,185,168, 97,195,134,237,236,211,167, 79,187,168,168, 40,212,171, 87, 15,
-233,233,233,120,252,248, 49,110,220,184,129,131, 7, 15, 30,212,106,181,181, 6,212,150,201,100, 79,135, 39, 18,120, 6,108, 93,
- 51,239,224,229,179,173, 35, 58,246, 30,225, 18, 19, 64, 67,111, 96,144,253,232, 30,190,252,108, 83,121,254,163,140, 84,131,201,
-240, 14,236, 92,168,163,209,104, 54,126,247,221,119,156,248,248,248,222,171, 87,175, 22,135,132,132,176,184, 92, 46, 9,128,185,
-114,229, 10, 51,117,234, 84,117,113,113,241, 33,165, 82,185,241,111,110,163,207,220,191,127,191, 5,139,197,122,174,238, 22,158,
-193, 45,132, 19,207, 19, 13, 26, 4, 69, 53, 12, 9,152, 16, 86, 47,104,114,131,144,224,225, 85, 77,114, 15,243,240, 16, 55, 8,
- 13, 28, 23, 86, 47,104,114,195,144,128, 9, 13, 26, 4, 69,217, 97, 90, 12,147, 72, 36,135,165, 82,105,115, 0,112,115,115,235,
-235,238,238,126,203,205,205,173,175,185, 23,216,215,213,213,245,118,116,116,244,216,191,209, 92, 89, 35,103, 68, 68,196, 16,149,
- 74, 53, 41, 34, 34, 98,136,101,255,222,189,123,214,253,186,112, 6, 7, 7,119,187,114,229,202,255, 86,172, 88,209,191, 81,163,
- 70,125, 23, 47, 94,220,255,247,223,127,255, 95, 80, 80,208, 43,117,224,228, 3,248,153,195,225, 20,242,120,188, 34, 14,135, 83,
-104,217,216,108,118, 33,139,197, 42, 4,176,161, 26,107, 89,119,155, 94,206, 89, 63, 63,191, 76, 63, 63,191, 76,127,127,255, 76,
-127,127,255, 76,169, 84,250,212,230,237,237,125,214,222,252,140,244,119,237, 16, 87, 79,124,174,169,212,245,108, 19, 63, 81,228,
-243,120, 70,145,254,174, 29, 90,215,115, 59,215, 84, 42, 78,252,255,198,217,220, 31, 12,179, 62,146, 97,214, 71, 50,205,253,193,
-212,182,255, 60,205,254, 82,169,148,145, 74,165,243, 94,212, 80, 66, 53,252,127,123,121,127,142,156, 97, 98,177,120, 71,189,122,
-245, 44,117,221,155, 18,137,228,148,171,171,235,155,230,186,238, 77,145, 72,148, 16, 29, 29, 61,162, 54, 78, 79, 79,207, 43,190,
-190,190, 5,230, 45,223,207,207, 47,223,207,207, 47,223,215,215, 55,207,215,215, 55,207,199,199, 39,215,178,185,187,187, 95,172,
-227,189,251, 2,104, 3,224, 21, 0,146,231,152,159, 13, 0,140, 55,215, 65, 75, 1,140, 5,208,236, 57, 60, 35,130,227,226, 57,
-145,239, 30,124,142,227,234, 83,198,113,245, 41,227,187, 5,157,171, 33, 4,143, 61,156,141, 61, 61, 61, 23, 73, 36,146,223,197,
- 98,113,162, 88, 44,222,239,237,237,189, 24, 64,227,127,232, 93,114, 5,176, 25, 21,254,153,254, 64,197, 80,248,126, 84, 44, 42,
- 8,249, 23,190,243,255,159, 49,238,159,250,227,238, 78, 78, 39,167,147,211,201,233,228,116,114,190,132,156,164, 51, 63,157, 66,
-203, 65,161, 85,121, 3, 80,131,103,120, 39,156,112,194, 9, 39,156,248,127, 12,218,153, 5, 78, 56,136, 42,135,150,137, 26, 84,
-169, 35,190,166,234,162,108,143, 59, 57,157,156, 78, 78, 39,167,147,211,201,233,228,252,127,199,233,196,115,132,211,172,234,228,
-116,114, 58, 57,157,156, 78, 78, 39,167,147,243,191, 14,231,208,161, 19, 78, 56,225,132, 19, 78, 56,225,196, 11,194, 70, 27,193,
-245,196, 16,162, 83,104, 57, 14, 18,192, 36, 0, 3, 0, 52, 68, 69, 52,251,221, 0,214,162,110, 99,250, 18, 0,179, 0,180, 71,
-197,234,156, 7, 0, 18, 81,177, 58, 71,229,204,238,170,225,237,237, 61,155,195,225,184, 3, 21,161, 77, 44,159,182,223, 41,138,
- 42, 85, 42,149,139, 95, 80, 18, 88,176,211,131,178, 37,173,182,105,179,253, 52, 26,141, 47, 50,157, 78,252, 59, 17,225,233,233,
-249,179, 76, 38, 27, 10,155, 32,203, 78, 56,241, 95,128,143,143,207, 4,131,193, 48,151,203,229, 46,122,252,248,241,186,255, 71,
-183,254,148,200,122, 66,104,197,199,199, 39, 0, 64,159, 62,125, 58, 3,128,187,187,251,121,146, 36, 27, 56,242, 15, 52, 77, 63,
- 40, 45, 45,173,214,129,154,187,187,251,121, 22,139,245, 20,167,209,104, 20,179,217,236,178,170,126, 99, 50,153,114,148, 74,229,
- 43,255,146, 76, 36, 0,196,123,120,120,104, 23, 44, 88,176,182, 75,151, 46,193,121,121,121,166,153, 51,103,118,186,126,253,122,
-111, 0,111, 56, 40,182,218, 18, 4,177,181,121,243,230,251,134, 15, 31,190, 51, 46, 46,142, 87, 82, 82, 34,222,189,123,119,224,
-182,109,219,146,105,154, 30,138, 26, 2,173,254,127, 6,135,195,113,207,201,201, 17, 3, 21,161, 73,204,194, 10, 70,163, 17, 70,
-163, 17,106,181, 26,177,177,177,207,253,127,253,253,253, 91, 16, 4,177,218,213,213,245, 21,149, 74,117, 25,192,228,252,252,252,
-235,142,164,213,100, 50,129, 97, 24,107, 58,163,162,162,156, 15,212, 49,140,225,241,120, 61,195,195,195, 91,235,116, 58,249,131,
- 7, 15, 46, 81, 20,245, 57,158, 95,140, 54, 55, 0,159,243,249,252,184,134, 13, 27, 6,103,100,100,100, 27, 12,134, 36, 84, 4,
- 67, 86, 60, 15,145,213,185,115,231,179,107,214,172,241,154, 56,113,226,217,196,196,196, 14, 78,177,229,196, 63,133,224,224, 96,
-119,181, 90,189, 9, 64, 11, 14,135,227, 47, 16, 8,224,226,226, 82,192,231,243,175,185,184,184,140, 62,119,238, 92,169,163,156,
- 20, 69,125,158,153,153,233,223,166, 77,155,229,190,190,190, 95, 22, 23, 23,107, 13, 6,195, 9,185, 92, 62, 3,128,178,166,223,
- 86,214, 34, 47,153,200,178,253,132, 69,116,177,205, 55,198, 0,232,242,132, 2, 99,179,131, 30, 61,122,228, 43, 16, 8, 64,211,
-180,181, 49,171,188, 89,142,235,245,122,196,196,196, 24,106,105,112,130,179,179,179,125,121, 60,158,245,152, 94,175, 71, 96, 96,
- 32,157,147,147,227,107, 14,123, 96,133, 78,167, 67, 80, 80,208,191, 41,230,209, 36, 79, 79, 79, 69, 86, 86,118,172, 86,103,152,
- 63,118,202,167,179,135, 14,120,205,227,252,249,243,244, 27,111,188,161, 75, 72, 72,152,132,138,192,169,118, 85,230, 4, 65,108,
-155, 57,115,230,151, 2,161,196,235,228,249, 84,221,182,221,135,114,155, 71,212, 39,102,204,152,193,154, 58,117,234,153, 22, 45,
- 90,252, 76,211,116, 75, 56, 96,217,242,240,240, 56,194,231,243, 67,205,249,151, 37,151,203, 95,255, 23,190,144,108, 60,237, 60,
-182,170, 99,181,162,164,164, 4, 26,141,230,169, 45, 42, 42,202,222, 88,153, 14,165,155,195,225,236, 95,178,100, 73, 96, 65,126,
- 62,190, 89,185,178, 13, 42, 44,153,109,236,249,113, 81, 81,209, 83,233,140,140,140,132, 19, 14, 97,214,151, 95,126,185,228,221,
-119,223, 5, 69, 81,208,104, 52, 1,119,239,222,141,158, 59,119,238, 59,247,238,221,107, 13,224,254,179,118,198,195,195,195,211,
-166, 77,155,230,217,186,117,107,152,163, 84, 4, 36, 38, 38,182,217,188,121,243,123, 89, 89, 89,145, 0, 30, 63,203, 31,120,122,
-122,254,252,195, 15, 63,120, 9,133, 66, 28, 56,112,192,171, 91,183,110,137, 87,175, 94,237,248, 12, 98,139,244,242,242,154, 10,
-224, 85,154,166,121, 0,146,228,114,249, 66, 56,238,213, 93,234,234,234,186,135, 36,201,250,192, 95,222,232, 73,146,244, 38, 8,
-162,216,114,140, 32, 8, 95,154,166, 47,200,100,178,118,206,215,241,229,134,151,151,215,152,194,194,194, 53,124, 62,159,235,225,
-225, 1,161, 80, 8, 54,155, 13, 54,155, 93,143,207,231,215,227,243,249,189,186,118,237, 58,249,212,169, 83, 53,122,216,111,219,
-220,111, 36, 72, 98, 62,139, 32, 89, 0, 64,114, 68, 18, 55, 55, 55,204,159, 63, 95,212,183,111, 95, 17, 0,156, 61,123,118,248,
-136, 17, 35,186,229,228,228,196, 84, 39,182,170,210, 34, 47, 17, 54,214,212,224,193,172, 30, 19,158, 40,185, 36, 9, 30,143,135,
-139, 23, 47,194, 30,103,229,150, 16, 9, 53,214, 6,102, 15,227,215,175,255,101, 0,176, 52, 52, 60, 30, 15,231,206, 61,233, 84,
-190,109,219,182,214,194,254,119, 97, 64, 84,133,147,199, 93,239, 87,164,107,224,234, 10,239,218,187,222,143, 68,167,175, 31, 97,
-192,212,121,131,203,181,134, 86, 0,212,165,114,185,252,242,222,189,121,205, 35, 34,184, 63,255,252,115,235,192,192,192, 1, 14,
- 8,173, 89, 45, 91,182,220,195,114,113,243, 30, 62, 98,228,240,209,108,210,240,222,248,143, 22,101,231, 23,171,199,141, 27,183,
-247,192,129, 3,195,151, 45, 91,118,251,227,143, 63,158, 5, 96,142,189,233, 23, 8, 4,161,119,238,220, 9,167, 40, 10, 81, 81,
- 81,255,198, 48, 6,205, 81,225,124,239, 93, 0,191,154,143, 13, 65,133,231,254, 22, 0,174, 57, 66,102,177, 96, 85,181, 61,111,
- 4, 6, 6, 70, 14, 27, 54,204, 91, 86, 92,140,111, 86,174,180, 28,126, 5,181, 12, 35, 90,202,143, 94,175, 71,255,254,253,135,
- 81, 20,197,182,136, 64,157, 78,167, 87, 40, 20, 90,252, 53,177,244, 49,128,215,236, 72, 78, 3,145, 72,244, 21,128, 22, 26,141,
- 38, 16, 0, 68, 34, 81, 46, 77,211,251,212,106,245, 28,252, 21,192,215,225, 14, 46,128,104, 84, 31, 10,138, 89,178,100, 73,198,
-167,159,126,122,255, 31,224, 12,245,243,243, 91, 60,112,224, 64, 28, 58,116, 8,127,252,241,135,209,197,197,133, 61, 98,196, 8,
- 98,242,228,201, 30,211,166, 77,235, 5,224,187,103,124,204,189,190,252,242, 75,207, 38, 77,154, 96,247,238,221,184,113,227,134,
- 38, 60, 60,220,165, 75,151, 46, 96,179,217,158,179,103,207,126, 3,192,214,103,249, 3,153, 76,182,240,163,143, 62,218,246,235,
-175,191,138, 31, 60,120,128,213,171, 87,123, 15, 30, 60, 56, 33, 43, 43,171,179, 3, 98,139, 15, 96, 42,128,174, 44, 22,171,227,
-136, 17, 35, 76, 83,166, 76,225,144, 36,105, 92,185,114,165,207,230,205,155, 7,115, 56,156, 22, 37, 37, 37,246,116,210, 72, 0,
-243, 71,143, 30, 61,234,212,169, 83, 30,151, 46, 93,226,121,121,121,129,162, 40,171,165,152,166,105, 95,203, 59,107, 50,153, 16,
- 25, 25, 25,100,243,123,151,151, 85,104,144, 36,105,160,105,154, 3, 64, 0, 64, 87,219,254,127, 73,100,121,122,122, 78,148,201,
-100,107,253,253,253,225,231,231,247, 84, 91,171,211,233, 32, 16, 8,184,254,254,254, 63,244,237,219,151,179,127,255,254,106,135,
- 0, 9, 22,241,249,129, 29, 11, 2, 61, 61,196, 0,128,111,215, 31, 45, 7,128,223,127,255, 29,121,121,121,240,240,240, 64, 76,
- 76, 12,107,193,130, 5,210, 25, 51,102,124, 35,151,203, 71, 87,199, 85, 89,139,188,100, 22,173,141, 85,237,215, 56, 71,139, 97,
- 24,107,156, 60, 59, 95,218,202,135,142, 87,226, 35,244,122, 61, 42, 91,180, 44,133,151,195,225, 84, 54, 63,130, 32, 8,166, 38,
-206, 42, 48, 66, 36, 18,197,170,213,234,239, 29,232,221, 90, 57,119,189, 31,137,109,252,153, 67, 44,145, 72,123,125, 84,241,185,
- 13,192,249,135,163, 87,175,233,220, 57,112,234,103,171,230,105, 74,242,138,103, 15,123, 51, 52,220,223,203, 69, 84, 90,164,240,
-108,220,184, 71, 37,139, 76,109,233,236, 52,124,248,240,237,127, 94,204, 36, 4, 2, 46,151,205, 98,113, 58, 52,141,240, 10,118,
- 99,185,137, 1,183,236,251, 25,231, 71,142, 28,217,244,227,143, 63,238,232, 0, 39,204, 13, 46,126,250,233, 39, 16, 4, 65, 58,
-114,239,207, 17,199,107, 18, 89, 12,195,128, 32,136, 95,108, 26,149, 95,204,199,174,218,136, 45,118, 77,249,105,177,166, 90, 68,
-213,136, 17, 35,134,153, 76, 38,182, 77, 37, 81, 89,192, 84, 37, 98,236,186,119,169, 84,250, 39,128,215, 8,130,128, 94,171,213,
-127,245,245,215,182,167,175, 84, 18, 89,199,171, 43, 75, 70,163, 17, 20, 69,177,175, 94,189,202,177,121,215, 57, 0, 68, 0,188,
- 25,134, 1, 73,146, 55,237,200,207, 72,161, 80,120,254,224,193,131,146, 87, 94,121,133,224,241,120, 48,153, 76, 72, 73, 73, 9,
- 94,182,108,217,248,227,199,143,191,161, 86,171,163,240,116,240,116,123,158, 81,116, 98, 98,162, 58, 44, 44,172, 74,225,168, 84,
- 42,217, 17, 17, 17,157,171, 17, 69, 47,154, 51,167,176,176,240,237,215, 94,123,109, 66, 65, 65, 65,154,201,100,250, 4, 64,140,
-183,183,247,213,126,253,250,193,197,197,165,171, 70,163,249,238, 89,222,121, 95, 95,223,190,237,218,181,195,234,213,171,177,108,
-217,178,238, 0, 78, 0,232,166, 84, 42,143,191,245,214, 91,112,119,119,127,187,180,180,116,235, 51,148,163,136, 78,157, 58,253,
- 48,127,254,124,241,161, 67,135, 16, 30, 30,142,178,178, 50,124,248,225,135,190, 95,124,241,197,233,210,210,210, 46, 54,229,162,
- 58,206, 40, 62,159,191,245,215, 95,127,117, 13, 11, 11, 11,227,114,185,100, 88, 88, 24,100, 50, 25,180, 90, 45,127,209,162, 69,
- 77, 93, 92, 92,174,127,247,221,119, 91, 1,244,171, 37,157, 36,128,133, 27, 54,108,152, 48,110,220, 56,247, 97,195,134, 81,122,
-189, 30, 59,119,238, 4,139,197, 2,135,195,129, 80, 40,180, 6,175,230,114,185,104,220,248, 41, 39,233, 7,106,184, 95, 5, 42,
-230,161,186,195,177, 97,215,227, 53,240, 89,135, 62, 56, 28, 14, 4, 2, 1, 4, 2, 1,248,124, 62,238,220,185,243,153, 64, 32,
- 88, 73, 16,132,201, 30, 78,226, 47,117, 17, 11,224, 82,109,251,120,122,106,200,223, 89,127, 90, 16, 68, 16,196,183, 0,186, 86,
- 52,187,100,130,183,183,247, 7,133,133,133,143,236,229,148, 74,165, 94, 37, 37, 37,223, 73,165, 82,248,249,249, 89,219,239,192,
-192, 64, 24,141, 70, 20, 22, 22,130, 97, 24,148,150,150, 66, 40, 20, 34, 32, 32,224,187,113,227,198,237,222,184,113, 99, 73,149,
-156, 52,150,189, 53,120,238,231, 44, 22,139, 4, 0, 22,219,213,117,218,167, 64,104,104, 40, 58,116,232, 0,173, 86, 11,133, 66,
-129,232,232,104, 54, 65, 16,195, 9,130,144, 48, 12,179, 14,192,201,255,160,161,176,218,201,240, 95, 86, 30, 23,181, 68,139,231,
-114,185,118, 9, 45,243,245,181, 89, 80, 72,163,209, 8, 46,151,251,132, 69,130, 32, 8, 80, 20,245,196,113,139,208,170,139, 80,
-159, 60,121, 50,253,195, 15, 63, 76,144,203,229,235, 81,199,161,132,225,195,135, 63, 53,223, 99,198,140, 25, 57, 69, 69, 69, 76,
-255, 30,177,162,180,195,121,249, 13, 61, 92, 93,124,196,226,250, 2, 15, 79,247,146,146,146, 11,230,202,196, 94, 52,106,217,178,
-165,203,182,189,137, 57, 99,167, 47, 89,240, 74,152,151,164, 89,144,183,135,191,155, 11,207,149, 36,212, 2,147, 49,199,211,211,
- 51,220,209,116, 91,234, 5,161, 80, 8,146, 36,255, 77, 22, 45,182, 69,100,201,100, 50, 28, 58,116, 8,189,123,247,190,106, 17,
- 33, 74,165, 18,249,249,249,144, 74,165, 87,205,150,143, 90,135, 17,105,154,134,193, 96,128,193, 96,176, 10, 24,155,119,200, 42,
- 96, 44,215,178, 88,172,155,117, 76,251, 2, 15, 15,143, 78, 93,187,118,229,237,216,185,147,199, 48,140, 26, 21, 49,212, 84, 12,
- 83, 77,128,236, 74, 48,153, 76, 86, 43, 27,135,195, 65, 86, 86,150,181,225,178,196,150, 20, 8, 4,246,153, 50,248,252,143,126,
-251,237, 55, 73,235,214,173,137,146,146, 18,208, 52,109,173, 36,215,174, 93, 43, 24, 48, 96, 64, 96,114,114,242,108,157, 78,247,
-101, 29,238,149,168, 78, 16, 1,128, 68, 34, 49,193, 62,143,217,181,114,154, 76, 38,162,125,251,246, 31, 23, 23, 23, 55,213,104,
- 52,139,236,201, 70, 0, 7,114,114,114,108, 27,246,235,105,105,105,154, 65,131, 6,185,212,175, 95, 63, 46, 53, 53,245,153, 94,
-210,136,136,136,182, 28, 14, 7, 73, 73, 73, 58, 0,150,158,117,194,141, 27, 55,116,253,250,245,227, 7, 7, 7,183, 45, 45,181,
-123,202, 74, 68,100,100,228, 49, 95, 95, 95, 23, 75, 29,234,227,227,195,217,184,113,163, 56, 55, 55, 23, 6,131, 1,179,102,205,
- 66,159, 62,125,224,237,237,141, 25, 51,102,248, 45, 95,190,252,103,149, 74,213,178, 38,163, 53,143,199,219,126,247,238,221,112,
-169, 84,234,114,241,226, 69, 52,107,214, 12,197,197,197, 40, 40, 40,128, 74,165, 66, 65, 65, 1, 70,143, 30,237,251,205, 55,223,
- 4,216, 97,201,178,138,172,141, 27, 55,150,238,217,179,135,181,105,211, 38, 49,135,195,177, 10, 45, 54,155,109, 21, 90,150,216,
-138,117, 24,105, 40, 53,139, 54,119,133, 66,241, 44,243,220,248, 0,120,182, 34,139,207,231,131,207,231, 67, 32, 16, 60, 83, 92,
-214,151, 4,129, 4, 65,164,114,185, 92,190, 80, 40,228,146, 36, 9, 62,159,223,195,211,211,243, 86, 76, 76, 76,204,177, 99,199,
- 50,237, 33,209,106,181,219,249,124, 62,199,215,215, 23, 0, 16, 30, 30,142,102,205,154, 65,173, 86,211, 10,133, 2,238,238,238,
-228,163, 71,143,160,209,104,144,159,159,143,144,144, 16, 14, 73,146,219, 81, 49, 15,249, 41,156,191, 90,176, 30,192,122,203,190,
-183,183,119,161,173,165, 83, 32, 16, 32, 48, 48, 16,185,185,185, 16,139,197,172, 47,190,248,162,223,206,157, 59,223, 57,127,254,
-252,112, 0, 63,217, 80,125,249, 18,207,209,178,136, 44,219,207,191,132, 86,159, 62,125,230,197,199,199,119,174,170, 23,206,225,
-112,158,219, 92, 23,139,160,146, 72, 36,149,173, 86,160,105,186, 58,139,150,195,255, 35, 16, 8, 92, 38, 78,156, 88,182,110,221,
- 58,135,197,214,192,213,105, 86, 43,214, 83,221,200,168,168,243,179,103,207,238,123,234,212,169,220, 87,194,234,179, 69,121,143,
- 84, 2,137,187, 59,130,234,245, 30,241,118,191, 27,168, 88,125,104, 47,238,150,149,149,185, 52, 12, 18,234, 73, 82, 75,212,227,
-179,197, 82, 17,151,239,239,225, 17,200,213,235,138, 36, 30, 30, 60,157, 78, 87,138, 26,130, 64, 3,128,159,159,223, 81, 23, 23,
-151, 16,203,190,135,135,135, 27,195, 48, 16, 10,133,144, 74,165,174, 44, 22, 43,221,166,112, 61, 42, 44, 44,236, 81, 91,194,220,
-221,221,143,242,249,252, 16,146, 36, 65, 16, 4, 88, 44, 22, 72,146, 4, 73,146,214,239, 44, 22, 11, 4, 65,160,188,188,252, 81,
-102,102,102, 15, 59,238,215, 4,160, 5, 65, 16, 87, 15, 29, 58,132,184,184, 56, 28, 62,124, 24, 61,123,246,132, 66,161, 64, 74,
- 74, 10, 58,117,234, 4, 84, 12, 41,218, 5,219,201,239,150, 78,193,157, 59,119,172,194,197,118, 19,139,197,207, 98, 98, 63, 59,
-112,224, 64,252,240,195, 15,140,185, 51, 33, 34, 8,162,153,155,155,219,157,219,183,111,219, 53, 15,134, 97, 24, 24, 12,127, 93,
-106,105,188,204,243, 33, 28, 10, 14,204, 98,177,122,180,108,217,146, 80, 40, 20, 22, 1, 9, 54,155, 13, 22,139, 5, 22,139,133,
- 53,107,214,184,180,110,221,122, 46,159,207,255,152,203,229, 42,141, 70,227, 14,173, 86,187, 8, 64,233,191,169, 70,234,216,177,
-227,244,236,236,236, 62, 33, 33, 33, 7,159,129,134, 49, 26,141,122, 0, 46, 44, 22,139,243, 28,234, 40,150,249,221,210,218,136,
-125,147,121,159,143,138, 97, 98,187,224,237,237,253,243, 31,127,252, 17, 20, 18, 18, 2,163,209, 8,147,201, 4,149, 74,133,132,
-132, 4,232,116, 58,152, 76, 38,132,135,135,227,243,207, 63,215,126,240,193, 7,130, 13, 27, 54, 20,169, 84,170,161,181,208,126,
-176,123,247,110,145, 84, 42,117,209,104, 52,184,127,255, 62, 90,182,108,137,178,178, 50,168,213,106,148,151,151,195, 96, 48, 64,
-169, 84,186, 83, 20,165,175,133,235, 51, 91,145, 53,126,252,248,155, 60, 30,175,229,148, 41, 83,144,147,147, 99, 45,243, 99,199,
-142,133,159,159,159,181, 44,153,235,100,135, 42,102, 54,155, 13, 62,159, 15, 46,151, 91, 90,175, 94, 61, 16, 4, 33,120,244,232,
- 81, 93,134,226, 36, 0,148, 28, 14,135,103, 43,176,248,124, 62,146,146,146,102,243,120,188,234,172, 89,213,149, 75,198,145,253,
-127, 26, 4, 65,124,203,229,114,249,158,158,158, 92,155, 14, 39,215,213,213, 21,190,190,190,171, 1,244,178,243,190,155,123,122,
-122, 90,235,247,216,216, 88,100,103,103,239, 83, 40, 20,239, 21, 21, 21,129, 36,201,237, 36, 73,190, 99,233,164,202,229,114, 4,
- 7, 7, 55,175,142,175, 93, 11,255, 9, 32,152, 39, 44, 90,149, 58,104,144, 72, 36,120,248,240, 33,212,106, 53,147,145,145, 65,
- 76,156, 56,145,208,235,245, 63, 38, 39, 39, 95, 64,197,106,251,106,181,200, 75, 2,199,231,104, 89, 44, 90,246, 54, 0, 4, 65,
-212,218,155, 48, 26,141,174,209,209,209, 85, 77,248, 34,170, 18, 90,230,225,164, 58,189,232, 28, 14, 71, 92, 87,177, 85, 25, 7,
-247,252,234,183,236,243, 89,159,123, 6,212,111,248,241,199,159,177,223,124,243,205,139,219,182,109,163, 60,155,244,234,118,242,
-232, 79,126,223,125, 56,243,240, 31,127,252, 1, 84, 76,140,182, 23,103,227,227,227,253,103, 76,157,140,207, 63,250,224,136, 36,
-220,155,231, 74,120,138, 4, 58,245, 99, 87, 48, 26,126,163,200, 62,123, 15, 30,204, 7,144, 92, 19,137, 80, 40, 12, 73, 77, 77,
- 13,183, 93, 72,160,215,235, 33, 20, 10,113,242,228, 73, 31, 23, 23, 23, 31, 0,208,104, 52,136,137,137,177,215, 98, 18,146,158,
-158, 30, 46, 22,139, 81, 94, 94, 14,157, 78, 7,163,209, 8,154,166, 65, 16, 4, 56, 28, 14,120, 60, 30, 68, 34,145,163, 43,251,
-174, 1,120,183,119,239,222,191, 28, 62,124, 24,209,209,209,144,203,229, 72, 75, 75,179,136, 44,135,230,104, 89,172, 68,182,243,
-177,216,108, 54,126, 14, 11,195,216,188, 60,171,128,249,214,205, 13,159,211,117,139,166, 17, 19, 19,195,156, 61,123, 22, 71,142,
- 28,193, 91,111,189, 69,236,223,191,223, 64, 81, 20, 55, 47, 47,239,102, 94, 94,158, 93, 28, 52, 77, 91,211,106,169,183,109, 5,
-150,163, 66,203,100, 50,137,121, 60, 30,180, 90, 45, 44,150, 7,219,173, 65,131, 6,144,201,100,108,165, 82,201,206,203,203, 19,
- 46, 92,184,112,202,233,211,167,165,101,101,101, 67,254,201, 90,104,221,186,117, 33, 99,199,142,205, 98,179,217, 76,207,158, 61,
-135, 61,122,244,232,109,169, 84,122,226,212,169, 83, 95, 3,136,112,148,207,219,219,251, 10,155,205, 14, 82, 42,149,220, 93,187,
-118, 25,203,202,202,184, 62, 62, 62,133,150,186,195,146,215, 70,163,209,174,149,203,222,222,222, 87,138,139,139,185,223,127,255,
-189,177,164,164,132,235,231,231, 87,104,225, 41, 45, 45,229,238,218,181,203,168, 84, 42,185,110,110,110, 87, 20, 10, 69,173,124,
-197,197,197, 67,135, 15, 31,158,120,226,196, 9,111, 22,139,133, 71,143, 30,161,164,164, 4,238,238,238,216,190,125, 59, 66, 66,
- 66,176,123,247,110,153, 76, 38, 27,243,213, 87, 95,205, 53,139,172,218,230,104,117,138,139,139, 11, 41, 45, 45,133,187,187, 59,
-212,106, 53,174, 92,185,130,168,168, 40,228,229,229,129, 36, 73,184,187,187, 99,237,218,181,229, 4, 65,200,106, 34,114,113,113,
-121,123,220,184,113,238, 0, 48,110,220, 56,247,113,227,198, 85,217,192,181,109,219, 22,171, 87,175,174, 44,180, 28,233, 24, 88,
-173, 78, 54,226, 72,219,166, 77, 27,156, 62,125,122,166,131,226, 72,111, 17,109,149,173, 89,124, 62,223,225,197, 52, 52, 77,115,
- 81, 49,165,129,176,103,255, 95,128,206, 46, 46, 46,220,202, 7,203,203,203,185, 82,169,180,163, 3,194,215,203,197,165,194,224,
- 20, 18, 18, 2,133, 66, 65,233,245,250,193, 63,253,244,147, 17, 0, 90,180,104, 49,152,162, 40,173,201,100, 98,241,120, 60,168,
-213,106,248,250,250,122,213, 96, 27,253,228,192,142,133,254,149,231,104, 73,165, 82,180,104,209, 2, 58,157, 14,249,249,249, 72,
- 72, 72, 48, 82, 20,245,203,186,117,235,104, 31, 31,159, 81,253,251,247,103, 37, 39, 39,191, 15, 96,122,117, 90,228, 37,179,102,
-109,172, 86,104,153, 21,228,105, 0, 93, 42,223,100,101,241, 83,147,208,170,109,232,144,199,227,149,102,101,101,137,108, 27, 21,
-147,201,132,128,128, 0,154, 97, 24,162, 42,161,245, 44,166, 96, 14,135, 35,254,244,211, 79, 75,215,173, 91, 55,244,225,195,135,
-243,236,249,205,174,247, 35,177,173,146,200, 90,191,108,254,234,239,151, 45,244,188,119,228, 71,108, 90,181,130,162, 40, 36, 55,
-109,218,180,163, 74,165, 98,187,137,140, 40, 46,197, 97,179,200,178, 87, 20,146, 0,182, 92,186,116, 41,185, 87,175, 94,231,182,
-252,182,215, 51,239,254,253, 11,124,101,113,190,164, 81, 56,155, 27, 24,242, 78,153, 86,203, 29, 60,120,176, 15,128,254,181, 85,
- 98,165,165,165, 40, 40, 40,168, 44,192,112,231,206,157,167,174,181, 43,113, 36, 9,138,162,176,103,207, 30, 8,133, 66,136, 68,
-162, 39, 54,139,200,170,227, 66,133,116, 0,232,217,179, 39,100, 50, 25, 92, 93, 93,237, 78, 87,101,241,194, 48, 12,244,122, 61,
-244,122, 61, 12, 6, 3, 5,128,195,102,179, 49, 58, 39,199,106,229,113, 68,192, 84, 70,211,166, 77,153,243,231,207,227,220,185,
-115, 80,171,213,248,254,251,239, 33,149, 74, 95, 5,240,153,163, 92, 54,147,244, 41,165, 82,201, 81, 42,149, 86,235, 32,135,195,
-177, 90, 15,236,180,228,113,217,108,182,181, 55,106,217,108,173, 90, 44, 22, 11,126,126,126,240,247,247,199,250,245,235,185,245,
-235,215,239,243, 79,214, 64,203,151, 47,111,244,237,183,223,110,222,182,109,219,225,161, 67,135,238, 76, 73, 73, 25,233,230,230,
-118,243,228,201,147, 11,249,124, 62, 93,199,242, 29,148,151,151,231,107,123,136,166,105,161,201,100,178, 10,219,242,242,114,187,
- 59, 24, 28, 14, 39, 40, 53, 53, 85, 8, 0, 11, 23, 46,228, 0, 16, 90, 38,131, 91, 56,203,203,203, 57, 81, 81, 81, 65,246,190,
-235,137,137,137, 29,187,119,239,126,254,216,177, 99, 30, 33, 33, 33,200,205,205, 69,110,110, 46, 26, 53,106,132,197,139, 23,171,
-149, 74,101,123, 0,233, 42,149,106,191,157,156, 1, 30, 30, 30,156,172,172, 44,152, 76, 38, 52,111,222, 28,107,215,174,197,224,
-193,131, 17, 19, 19, 3,165, 82,137,212,212, 84,108,221,186,213,131,203,229,214, 88,119,104, 52,154,253, 27, 55,110, 12,174,108,
-209, 26, 54,108,152,168,176,176,208,250, 78,206,159, 63,255,137, 33, 68, 71,234,100,243,208, 86,181, 91, 93, 96, 50,153, 36, 2,
-129, 64,201,231,243,121,150,249, 89, 9, 9, 9, 14, 91,179, 42,117, 0, 29,217,255,199, 96, 17,173, 85,180,173,240,247,247,183,
-155,135,207,231, 19,150,186,209,100, 50, 65,161, 80, 80, 82,169,212, 58,188,127,245,234, 85, 42, 52, 52,148, 98,177, 88, 44, 30,
-143, 7,130, 32, 32, 20, 10,171,173,240, 25,138,153,255,230,224,207,158, 88,117, 56,237, 83,192, 96, 48,224,234,213,171, 48, 24,
- 12, 72, 72, 72, 48,126,245,213, 87,121,165,165,165,211, 0,176,143, 30, 61, 58,124,230,204,153, 44, 95, 95,223,238, 69, 69, 69,
-168, 77,139,188, 68, 98,235, 41, 43,151,165, 21, 58,221,167, 79, 31,194,188,180,146,176, 8, 39, 71,132,150,185,240,213,218,242,
- 18, 4,129,252,252,124,235,190,175,175,175,195,255,101, 47,188,188,188,212,109,219,182, 21, 23, 23, 23,239, 95,190,124,121,157,
- 44, 89,235,151,205, 95,189,100,193, 23,158,178,219, 23,145,147,151, 15, 89,145, 49,249,236,205,135,251, 0,236, 3, 0,108,104,
-114,154,152,144,182,198, 94,206, 72,111,151, 88, 14,151,189,239,181, 94,125,130, 7,141,155, 78, 78,154, 52,169,195,240,225,195,
- 21, 67,135, 14,157,234,234,234, 26, 97, 48, 24,228,123, 15, 29,202, 28, 52,104, 80,125,138,162,134,163, 22,159, 35, 26,141,230,
- 81,151, 46, 93,108,243, 83,114,252,248,113,191,204,204, 76, 76,158, 60,249,113,110,110,110,169,237,181,246,164,209, 96, 48, 60,
-138,141,141,173,118,184,208, 50,164, 8, 0,101,101,101,143, 28,200,210, 33, 48, 79,124, 47, 41, 41,193,157, 59,119,192,102,179,
-209,166, 77, 27,156, 61,123, 22, 29, 58,116,184,234,136, 85, 75,171,213, 34, 36, 36, 4, 90,173, 22,106,181,186, 28, 0,127,123,
-253,250, 0,128,247, 75, 74,112,229,171,175,112,113,201, 18,216,190,207,246,162, 89,179,102,204,197,139, 23,113,243,230, 77,232,
-116, 58,140, 25, 51, 6, 0, 8,243,187,235,136,203,140, 48, 22,139,213,179, 87,175, 94, 1, 0,160, 86,171,137, 75,151, 46, 65,
- 32, 16, 88,203,194,193,131, 7,145,155,155, 11,130, 32,224,225,225, 17, 36,151,203,235, 3,120, 88,131,217,159,120,248,240, 33,
-150, 46, 93, 10,154,166, 49,115,230, 76,132,135,135, 91, 5,214,163, 71,143,176,112,225, 66, 80, 20,133, 47,190,248, 2,141, 26,
- 53,130,209,104, 20,160,142, 46, 52,158, 7,102,204,152,113,111,223,190,125,135,179,179,179,223, 88,182,108, 89,103,130, 32,232,
-143, 63,254,120,169, 68, 34,161,158,133, 87,174, 40,195,157,187,143,172, 66,168,242,230,227,237,233, 48, 95,198,253,108,235,239,
- 41,202,150,143,130,151,167,135,163, 73, 44, 55, 26,141,234,119,222,121,199,125,207,158, 61, 68,163, 70,141,240,224,193, 3,139,
-101,168, 28,142,187,116,200,149,201,100,225, 44, 22,139,123,247,238, 93,132,134,134, 34, 46, 46, 14,139, 22, 45, 66,113,113, 49,
- 76, 38, 19,124,125,125,105,163,209,120,213, 96, 48,156,169,133,107,254,248,241,227,185, 0, 38,152, 45, 91, 77,167, 77,155, 70,
-175, 88,177, 2, 87,175, 94,181, 90,176,108, 39,195, 59, 58,116,104,107,117,178,221, 18, 18, 18,102,242,120, 60, 6, 64, 18, 28,
-119,244,172,175,108,209,170,139, 53,235, 69,225, 69,174,100,148, 74,165, 9, 98,177,184,143, 92, 46,127,194,170,213,190,125,123,
-131,159,159, 95,162,189, 60,174,174,174,114, 22,139,229, 5, 0,185,185,185, 16,137, 68,220,251,247,239, 47, 65,133,243,108,212,
-175, 95,127,137, 76, 38,227,214, 55,215,167,254,254,254,208,235,245,213, 78, 99,185,112,173,240, 71, 0, 63, 90,246, 61, 61, 61,
-243, 21, 10,133,203,138, 21, 43, 84, 75,150, 44,209, 80, 20,165, 3,112,178,180,180,212,234, 71,171,160,160, 64,193,225,112, 60,
-221,221,221, 3, 45, 66,171, 42, 45,242,146,161,122,139,150, 89, 73, 50,149, 5, 17, 65, 16, 79, 77, 80,175, 69,104,213, 42,178,
- 40,138,122,194,202, 96,153,240, 94,213,127,153, 27,245, 58, 13, 29,154, 69,150, 96,239,222,189,219,151, 47, 95,158,100,239,239,
-108,231,104,109,248,122,193, 50,139,200,186,113,238, 24,246,167, 41,138,103, 46, 89,249,109, 93,159, 64, 19,111, 97, 51, 63, 63,
-175,211, 95, 45,158, 47,185,119,100, 43,118,110,248,134,185,113,249,114,235,203,151, 47,191, 55,121,242,228,122,230, 23, 75, 6,
-224, 58,128, 65,176, 99,149, 78,110,110,110,143, 74,141,112, 58,151,203,245, 19, 10,133,200,205,205, 85,101,100,100, 56, 60, 36,
- 83, 92, 92,220,227, 5,188,128,108,139,200, 42, 46, 46, 70,106,106, 42,186,118,237, 10, 0, 56,123,246, 44,218,183,111,143,228,
-228,100,180,108,217,242, 42,128, 86,168,197, 81,171,209,104, 44,109,210,164,137,213,186,165, 80, 40,104, 0, 24,151,159,143,141,
- 82, 41,216,108, 54, 46, 46, 89,130, 57, 70, 35, 22, 57, 40,224, 99, 99, 99,153, 75,151, 46, 33, 51, 51, 19, 38,147, 9,125,251,
-246, 69, 29, 11,125, 76,100,100,228,241,147, 39, 79,250,184,186,186, 66,173, 86, 67,165, 82, 97,196,136, 17, 24, 60,120, 48,116,
- 58, 29,118,237,218,133, 3, 7, 14, 64, 44, 22, 67,173, 86, 67,173, 86,123,244,238,221,251,124,122,122,122, 39, 0,119,171, 17,
- 90, 76,143, 30, 61,144,152,152, 8, 22,139,133,214,173, 91,163,164,228,175,197, 64,126,126,126, 85,157, 99,253,147, 66,139,205,
-102, 51, 9, 9, 9,203, 58,119,238,140,236,236,236, 55, 90,182,108,249,253,200,145, 35,115,159,149,215,195, 77,140,216,168, 48,
-232,116, 58,232,116, 58, 4, 4, 4,160,172,172, 12,247,238,221,131, 78,167,131,159,175,187,195,124, 45, 98, 26, 89,249,124,125,
-125,161, 86,171,241,240,225, 67,232,245,122,120,123, 59, 36,180,130,123,244,232,113,234,151, 95,126,241,218,186,117,171,190, 75,
-151, 46,188,239,191,255,158,144, 72, 36,176,105, 88, 28, 69,194,217,179,103, 67,186,119,239,222,248,246,237,219, 72, 72, 72,128,
- 94,175, 71,139, 22, 45,144,145,145,129,182,109,219, 66,165, 82, 37, 93,190,124,249,128, 61,134, 97, 0,115,199,143, 31, 15,139,
-216, 74, 76, 76, 68,126,126, 62,196, 98,241, 83, 66,203, 50,247,209,188,106, 60,192,158,196, 90, 4,145,141,229,105,142,187,187,
-187, 1,192,183,117,180, 62, 1, 0,178,179,179,249, 77,155, 54,213, 9, 4, 2,158, 89,180,173,124, 22,190,231,137,231,176,146,
-177, 90,248,251,251, 79,243,246,246,238,222,160, 65, 3, 20, 22, 22,114,121, 60, 30,218,183,111,111,104,213,170,149,193,223,223,
-255,125,123,121,248,124,254,109, 46,151,219,169,162, 51, 65, 33, 43, 43, 11, 66,200, 69,216, 0, 0, 32, 0, 73, 68, 65, 84, 12,
-195,204,140,137,137,249,160,172,172, 12, 37, 37, 37, 60,137, 68, 98,237, 84, 55,110,220, 24, 58,157,238,182, 3,150,183,249,161,
-161,161,115,185, 92,238,162,226,226,226,170,220, 66,240,220,221,221, 37, 92, 46, 23, 6,131,225, 9,177, 89, 89,139,188,236, 34,
-235, 9,161,101,163, 34,159, 16, 58,142, 88,180,236,177, 26, 88, 38,216,219,238, 91, 68, 93,229,255,170,171, 15, 45, 55, 55, 55,
-157, 69,100, 45, 90,180, 40,169, 46, 28,187,127,249, 73,234, 70,151, 7,231, 37,253,129,244,155,201,216,151, 90, 90, 60,115,201,
-202,169,111,246, 31, 82, 88, 89,152,217,131,112, 31, 97,140,159,175,215,233,175,151, 47,145,200,110, 95, 68,126, 65, 1,254, 72,
-186,156,108, 0, 82, 1,204,124,158,166,101,160, 98,232,144,197, 98,253,155, 94, 88,235,100,248,252,252,124,139,200,106, 1, 0,
- 29, 58,116,184,106, 22, 89,176,215,162, 85, 90, 90, 90, 57,100, 77,119, 0,222,150,251,103,179,217,104, 63,119,174,195, 34, 11,
- 0,147,156,156, 12,153, 76,102,233, 41,214, 85,100,193,223,223,255,163,147, 39, 79,250,108,217,178, 69,185,109,219,182, 18,154,
-166, 57,177,177,177, 65,175,188,242, 10,177,125,251,118, 0,192,160, 65,131, 48,115,230, 76,220,186,117, 11, 34,145, 8, 29, 58,
-116,160,230,205,155,231, 59,109,218,180,247, 11, 11, 11,167, 86,217, 58,210, 52, 87, 32, 16,156, 0,240,234,237,219,183, 1,224,
- 60, 42, 66, 56, 89,172, 8,213,158,179,167,241, 45, 43, 43,227,136,197,226, 42, 93, 67,112, 43,122, 67,142, 90, 32,172,156,231,
-206,157, 91,250,245,215, 95,239,251,240,195, 15,239, 62, 35,103,149, 22,173, 62,125,250, 64,163, 51, 32,167, 80, 1,138, 50, 65,
- 99, 40,114,152,207,214,162,213,167, 79, 31,148,107,245,200,202,151,193,100,162, 80,166,177,187, 45, 23,190,246,218,107, 71,119,
-236,216,225,127,225,194, 5, 80, 20, 69,103,100,100, 60,124,231,157,119, 36, 31,127,252,177,215, 51, 44, 50, 90, 53,100,200,144,
- 1,231,206,157,147, 53,110,220,216, 51, 41, 41, 9, 69, 69, 69, 48,153, 76,120,245,213, 87,193,227,241,178,150, 44, 89,194, 5,
-176,202,222,103, 99, 22, 91,134,203,151, 47,143,189,120,241,162,167,167,167, 39,143,142,140, 68,254,177, 99,216,179,103,207, 83,
- 63,216,176, 97, 3, 96,167, 23,126,139,197,233,210,165, 75,207, 69, 96, 61,209, 82,243,120,117, 30,126,124, 89,113,233,210,165,
-220, 73,147, 38, 69, 73, 36,146,111, 59,118,236,216,213,203,203,139,244,240,240, 72, 8, 12, 12,252, 32, 54, 54,214,238,209, 5,
- 14,135, 51, 82, 36, 18,221, 51,153, 76, 44,149, 74, 5,181, 90, 93, 81, 73,155, 76, 60,146, 36, 81,191,126,125,107, 91,210,186,
-117,107,248,251,251, 83,105,105,105, 35,237,229,127,252,248,241, 19,171, 16,171,192,248,246,237,219,179,117, 58, 29, 50, 51, 51,
-207,218,158,168, 74,139,188, 36, 24, 87,163,248,178,220,148,237,205, 5, 6, 6,102, 27,141, 70, 38, 21, 96,174, 95,191,206,140,
- 27, 55,174,198, 77,171,213, 50,190,190,190,249, 85, 52,126,176,229,212,233,116, 79,252, 78,167,211, 49,126,126,126,148, 70,163,
-121,138, 83,163,209, 48, 65, 65, 65,185, 53,113, 86,129, 17,215,174, 93, 91, 55,103,206,156, 56, 7, 50,200,202,201,172,143,100,
-182,110,221,250, 63,134, 97, 58,119,140, 10,185, 57, 48,214,143,105, 31,238,155,119, 96,247, 47,131, 25,134,233, 92,121,179, 56,
- 56,173,137, 51,210, 79,212,164, 91,116, 61,249,141, 35,191, 50, 39, 87, 76, 97,190,238, 27,206,180, 12, 18,151, 70,122,187, 56,
- 26, 35,166,214,104,233,209,209,209,233, 52, 77, 51,122,189,158,137,142,142,206,120, 30,156,117, 64, 77,156,205, 81, 49,151,109,
- 72, 21,199,154, 63, 67, 58,111, 48, 12,195,200,100, 50, 70,165, 82, 49, 58,157,142,161, 40,138,177, 5,128, 27,118,112, 50, 6,
-131,129,145,203,229, 12,236,159,115, 87, 37,167, 84, 42,125,120,255,254,125,166, 97,195,134,217,102,115,252, 52,181, 90,205, 84,
-134, 90,173,102,186,118,237,202,100,100,100, 48,161,161,161,218,140,140, 12, 70, 42,149,222,169, 37,157, 13,130,131,131, 79,120,
-123,123, 39, 0, 8,119,224, 92,141,249,185,107,215,174, 48,134, 97,198, 48, 12, 51,174,154,109, 12,195, 48,145,255, 52,167, 57,
-127, 11, 25,134, 97,202,203,203, 25,153, 76,198,228,229,229, 49,229,229,229,140, 74,165, 98,174, 93,187,198, 92,184,112,129,185,
-121,243, 38,227,233,233, 89,104, 15,167,133, 79,175,215, 51, 74,165,146, 41, 42, 42, 98, 52, 26, 13,163, 86,171,153,148,148, 20,
-230,202,149, 43,204,237,219,183,171,226,123,138,211,203,203,107, 67, 65, 65,129,234,252,249,243,229,235,215,175, 47,247,247,247,
-191, 13, 32, 4, 64,132,135,135, 71,193,148, 41, 83, 24, 87, 87,215, 71,117, 44, 71, 81, 28, 14,231,218,178,101,203, 46,197,199,
-199, 23, 30, 56,112, 64,191,121,243,230,156,201,147, 39,159, 97,179,217,215, 0, 68,213,177, 28,249,186,187,187,159, 79, 74, 74,
- 50,201,229,114,166,180,180,148, 81, 42,149,140, 90,173,102, 52, 26, 13,163,215,235, 25,163,209,200,156, 57,115,134,241,243,243,
-179, 29,150,252,164,134,142,245,116,134, 97, 62, 98, 24,134,253,188,235, 58, 27,238,142,207,139,243,121,212,117, 36, 73, 26,204,
-117, 71,155,138,221,154,247,255,169,116,118,235,214,237,139,193,131, 7, 51, 61,123,246,100, 90,180,104,241,212,214,178,101, 75,
-102,226,196,137, 76,124,124, 60,243,213, 87, 95,125,241, 28,210,201, 70,197,162,151,197,221,186,117, 51, 38, 38, 38, 50,131, 6,
- 13, 98, 0,244,168, 73,139,252, 23, 4,151,197,189, 3, 97,251, 9, 0, 6,131, 33, 59, 61, 61, 93,218,216,100, 98, 1,192,154,
- 53,107,158,178, 76,217, 34, 49, 49,209, 68, 16,196,189,154,254,221, 96, 48,100,159, 60,121,210,111,245,234,213, 28, 27, 19, 48,
- 76, 38, 19,157,151,151, 71,126,255,253,247, 79, 92,127,250,244,105,147,201,100,202,114,240, 38,183, 54,111,222,124,235,243,200,
-173, 51,183, 50, 63, 56,250,199,239,222,109,226, 58,150, 74, 60, 61,171,236,133,237,122, 63, 18,196,132,154,173, 90, 4,155, 92,
-180,108,241,124,119,203, 16,228,111, 87, 11, 74,181, 58,170,107, 90,177,230,198,243,126,194, 42,149, 42,211,178, 18, 80,173, 86,
-103,253, 11, 95,194,107,168,240,113,101,170,116,172, 21,158,113,210, 41, 77,211,112,115,115,179, 90, 67,235, 96, 17,101, 44, 22,
- 86,203,163,123,150,244, 48, 12,115, 46, 37, 37, 37,116,196,136, 17,226,109,219,182,221,167, 40,138, 51,122,244,104,131,191,191,
- 63,247,236,217,179, 70, 0, 68,231,206,157,217, 5, 5, 5, 76,110,110,174,236,173,183,222, 42, 27, 59,118,172,215,245,235,215,
-121, 52, 77,215,230,180,240, 65,118,118,118,183, 58,156,171, 17, 3, 7, 14,188,143,103, 15, 99,243,194, 57, 45,144,149, 42,113,
- 63, 51,215,236,193,156, 6,245,168,208, 58,175,202,104, 52, 65,166, 44,113,216,162,117,239, 97,174, 57,196, 24, 5,138,202, 51,
-243, 85, 76,136,103,228,229,181,183, 38,108,118,135,121,243,230,245, 34, 73,146,188,120,241,162,110,249,242,229,217,143, 31, 63,
-238, 11, 32, 11, 0,228,114,121,151,173, 91,183,254,108,135, 43,135,234,144,106, 52, 26,219,126,242,201, 39, 83, 1,116, 0, 80,
-207,204,125,214,108,201,170,171, 7,243,162,210,210,210,215,123,245,234,117,140,197, 98,213,183, 41, 71,222, 0,138, 45,229,130,
- 97, 24,223,194,194,194, 55,236, 33, 36, 8, 98,229,139,170, 72, 94, 36,247, 51,214, 67, 47,197, 74,198, 19, 39, 78,124,217,183,
-111, 95,118, 72, 72,200,236,144,144, 16, 82, 46,151, 67,165, 82,129, 36, 73,248,251,251, 35, 58, 58, 26,254,254,254,244,237,219,
-183, 23,207,154, 53,171, 86,159,124, 77,154, 52, 9, 51, 26,141, 13, 73,146, 12, 3, 16,198, 48, 76, 24, 65, 16, 97, 0, 60, 1,
- 64, 34,145, 72, 66, 67, 67,217,109,218,180, 65, 92, 92, 28, 78,159, 62,141,221,187,119,255, 8,224,168,173, 53,171,178, 22,249,
- 55, 32,181, 57,152,168,107, 32,110,181, 68,103,130,198,105,134, 68,151,232,100,171,159,189,202, 34,171,250,160,210, 85,152,254,
-122,188,250,234,171,214, 2,103, 71,163,146, 89, 91,225,123,252,248,113,143,145, 35, 71, 62,193, 73, 81,148,174,164,164,100, 82,
-187,118,237,214,178, 88, 44,126,165, 23,246, 81, 81, 81,209,223, 26,171,175,178, 31,173, 30,189,222, 46,126, 86, 78, 87, 46,217,
- 48,253,208, 15, 40, 44, 42,198,111, 87, 11,228,101,122,170, 75, 70,113,121,202,139, 72,255,163, 71,143,122,190, 4,138,191, 42,
-209,250,172,193,179, 31,219,225,144,180,182, 24,117,132,217,157,200,115, 41,228, 5, 5, 5, 43,230,206,157,251,250,226,197,139,
-125, 14, 31, 62, 44,177,116, 80,250,245,235, 87,148,146,146,210, 17, 0, 95,171,213, 30, 95,188,120,177,207,252,249,243,189, 0,
-120, 1, 64,239,222,189, 11, 11, 11, 11, 87,195,137, 26, 97, 52, 26,115,162,155, 52,182,118,252,108, 93, 58,216,126, 55,153, 76,
- 57,142,240, 85,197, 99,187, 79, 81, 84,141,124, 44, 22,235,195,184,184, 56,214,135, 31,126, 88,120,248,240, 97, 75, 32, 93, 91,
-133,150, 94,139, 83, 82,123,160, 3,176,220,188, 61, 79,168,101, 50, 89, 91, 7,127, 67, 57,223,198, 42, 59,148,142,236,255, 35,
-216,191,127,255,103,131, 6, 13,218,234,233,233,249, 83, 88, 88, 88, 99, 63, 63, 63,137,139,139, 11,116, 58, 93,153, 94,175,191,
-147,158,158, 62,244,179,207, 62,123, 96,151,133, 99,235, 86, 22, 0, 46, 77,211, 2,146, 36, 69, 0, 36, 4, 65,120, 88,132, 22,
- 65, 16, 48, 24, 12,200,204,204,196,156, 57,115,168, 19, 39, 78,124, 5,224, 11, 7, 58,174,173, 0,248,216,212,227, 62, 0,244,
-168,112, 96,251,152, 32,136,203, 47, 58,191, 8, 26,167,163,174,129, 72,109,142,170,218,137,154,131, 74, 87, 87,224, 30, 63,126,
-220,246,121, 23,226,234, 56, 31, 63,126, 28,242,111, 41, 33,195,117,203,127,197,134,229, 79,196, 57,180,136,176,170,246,107,131,
- 66, 99,154,188,234,232,173, 21, 58, 19, 67, 27, 76,244,168,140,199,229,169,206,122,232,185,227,181,231, 85,150,158, 99,154, 82,
-210,210,210,218, 77,158, 60,249, 51,161, 80,216, 26, 0,202,203,203, 47,230,229,229, 45,128,121, 85, 97,109,231,157,168, 30,197,
-197,197,175,252, 27,249,244,122,253, 7,237,218,181,251,142,162,168,175, 77, 38,211,217,255, 7,143, 66,235,124, 27, 95, 94,236,
-220,185,243, 1,128,182, 0, 48, 96,192, 0, 22, 0,236,222,189,219, 97,241, 60, 98,196, 8,138, 97, 24,131,249,125, 80,163, 98,
-117,161,220, 82,167,170,213,106,121, 94, 94,222,109,138,162,110, 3,248, 25,142,175,184,245, 33, 8, 34,158, 97,152, 62,102,225,
- 22,207, 48, 76, 31,219, 99, 47,218,170, 85,203, 37,181, 79,134,119,162, 2,187, 83, 65, 84, 30, 10,172,109,191, 54,164, 23,170,
- 19, 0,180,116,230,238,255, 75,220,207,203,203, 27,254, 12,231,157,120,249,144,165,215,235,251,254, 63,186, 95,133,243,145,255,
- 71,218,191, 58, 8, 44, 11,110,223,190,253,194,166, 8,252,211,136,186,246,100, 7,188,242,190, 13,198, 85, 37,188,156, 66,203,
- 9, 39,156,112,194,137,103, 65,169, 51, 11,156,248, 47,195, 50, 55,203,178, 95,205, 28,173,202,243,179,172,251, 4,170, 95, 57,
-224, 72, 84,242,186,172,146, 56,238,228,116,114, 58, 57,157,156, 78,206,127,156,211, 29, 64, 40,128,101,181, 92, 87,121,117, 97,
- 33,128, 98, 0, 70,103,126, 58, 57,159, 65, 63,216, 5,134, 97,122,215, 52,116, 72, 16,196,161, 23, 37,180,172,147,225,155, 99,
- 94,244, 53,204,179,236,219, 43,180, 94, 52,186, 59, 57,157,156, 78, 78, 39,167,147,211,201,233,228,116,114, 62,163,208,234, 58,
-107,214,172, 79, 81,225, 26,131,153, 53,107,214,167, 12,195,244,174, 56,197,244,126,145,255,125,171, 37, 58,167, 54, 7, 99,217,
-110,181, 68,231,106, 46, 29,103,179, 89,225, 28, 58,116,194, 9, 39,156,112,194, 9, 39,254,237, 56,191,100,201,146,242, 37, 75,
-150, 88, 38,190, 63, 6, 64,152, 45, 92,143, 95,228, 31,155,135, 9,237, 89, 40, 85,115, 8,158,127, 0, 1, 36,155, 59,140,195,
-229,119, 5, 67, 71, 3, 0, 72,214, 45, 74,175, 61,101, 50, 25,126, 2,144, 87, 87,226, 72,160, 73, 35,119,151, 3, 58,138,226,
-102,151,233, 7,164, 85,132, 57,112, 24, 3,128,246,124, 30,239, 79,190,187,187, 75, 85,231,117,165,165, 26,157, 94,255,250,110,
-224,156,179, 12, 56,225,132, 19, 78, 56,241,146, 64,228,225,225,113,130, 36,201, 16,203, 1, 91,191,131,149,125, 16, 82, 20,149,
- 47,147,201, 94, 71,197, 80,241,223,201,105,251,123, 61,234,216,150, 63,111, 56, 58,116,200, 6,158,240,194,250,183, 68,204,102,
-113,248, 99,197,110,238,139,254, 55,242, 3,175,240,136,198, 68,112,112, 32,192, 0, 89,217, 57,126,247,238,102,116,219,185,109,
-213, 12,165, 66, 54,199,168,211,253,224, 40,119, 19, 64, 84,207,149,127,246,135, 89,239,186,179, 97,194,144,133,191, 28, 33, 84,
-134,224,219, 21,203, 77, 29, 18, 89,238, 94, 94, 71,151, 28, 63,238,226,209,172,217, 19,231, 24,134,169,136,175,119,227,134,203,
-236,215, 95, 63, 58, 64, 38,235,225, 20, 91,255, 73,248, 75, 36,146,105, 28, 14,167,139,193, 96, 8,225,241,120,217, 20, 69, 37,
-200,229,242,111, 1,228, 58,179,231,191,141,198,254,162,142,141,195, 66,126,201, 43, 40,188,170,212,234, 71,167,231,169,100,206,
- 92,113, 24, 53,197,215,252,199, 98,111, 2,128,171,171,235, 21,146, 36,131,108, 69,128, 37,102,175,101,191,242, 39, 77,211, 15,
-100, 50, 89,187, 26,104,195, 60, 61, 61,215, 2,104, 85,155,195,100,179,111,182,203, 50,153,108, 18,170, 95,173, 39,246,240,240,
-248,146, 32,136,129, 36, 73,178,106,187, 39,154,166, 41,134, 97,118,201,229,242, 47, 0,148, 85,119,157,135,135,199,241,180,180,
-180, 86,190,190,190,181, 90,105, 76, 38, 19,178,178,178,124, 90,183,110,125, 70, 38,147, 69,190, 72,206,191, 91,139,212, 21, 53,
-172, 58,172,246, 69, 7,240, 68,124,161, 23,234,145,149, 43,112, 61,208,182, 83,143,174, 19,167,126, 40,186,150,114, 7,127,158,
-190, 0,165, 90, 7, 22, 73,194, 93, 44, 68, 68, 68, 67, 98,229,198, 61,222, 63,174, 95,249,245,197,196, 99,189,181,106,197, 91,
- 14,201,116, 33,123,206,204,119, 90,139,188, 60, 41,128,166,240, 81,175, 88,209,236,248,171,115, 80,110,250,212, 97,145,117,226,
-132,176,168,176, 16,243, 3, 2,192, 54,153, 32, 32, 73, 8, 8, 2, 2,146,132, 72, 32, 64,207,205,155,177,224,240, 97,225,103,
-111,188,225, 20, 91,255, 49,184,186,186,142, 12, 8, 8, 88,190,105,211, 38,175, 6, 13, 26, 64, 36, 18, 65, 38,147,121,167,167,
-167, 55,159, 62,125,250,240,252,252,252,185, 74,165,114,131, 51,167,254,187,160,105, 12,219,178,104, 82, 96,254,163,187,129,227,
- 23,255, 26, 65,120, 81, 93,238,148,104, 10,156, 57, 99, 55,154, 3,184,138,170,227,151,214,116,174, 90, 8, 4,130, 66,173, 86,
-235, 91,211, 53, 60, 30,175, 72,175,215,251,213,198, 69,146,100, 80,110,110,174,175, 80, 40, 4, 69, 81,230,104, 0,180,181, 35,
-109, 27,253,196,236,168, 22,145,145,145,134,154, 56,197, 98,241,154,162,162,162,238,150, 56,129, 54,130,170, 74,228,230,230,118,
-143,138,138, 90, 83, 86, 86,246,122, 53,226,229,203,169, 83,167, 78,139,137,137,177, 88,129,204, 81, 16, 42, 62,139,139,139, 49,
-121,242,100,235,127,208, 52,141, 99,199,142, 77, 29, 57,114, 36,228,114,249,244, 26,238, 61,196,215,215,151, 48, 7, 20,175, 22,
-243,230,205,195,188,121,243,176,106,213, 42,130,195,225,184,215,146,159,207,133,243,239,210, 34,117,177, 96,213,226, 25,254, 16,
-158,156,155,117,232, 41,161,245,119,128,197,225,143,106,213,174,123,151,201,211,102,138,126,253,253, 36,210,111,223, 64,218,217,
- 29, 79, 92,243,202,235, 35, 81, 80, 92,134,145, 19, 63,114, 37, 88,236, 46,137,199,247,143, 50,234, 52, 91,236,180,102,249,133,
-240,121, 83,218,180,142,230,228,186,164,195,223,195, 5, 29, 90, 54,226, 4, 31,189, 57, 69, 13,211,119,183, 43, 86,201, 56, 36,
-178, 54,189,251, 46, 58, 26,141,240,101,177,192, 34, 8,176, 0,144, 4, 1,173, 78,135,203,195,134,161,245,246,237,248,226,224,
- 65,225,151,111,190,233,144,216, 18,137, 68,215, 8,130,240, 80,169, 84,189, 81, 17, 88,250,101, 64,148,171,171,235, 33,134, 97,
-228,106,181,186,249,191, 40, 93, 82, 84,140,209, 87,238, 29,115, 81,177,162,202,161,200,194,124, 62,127,236,128, 1, 3, 86,174,
- 94,189, 90, 88, 88, 88,136,188,188, 60, 80, 20, 5,129, 64,128,240,240,112,226,248,241,227, 94, 51,103,206, 92,113,232,208, 33,
-126, 89, 89,217,119,142,116,108, 56, 28,206, 70, 79, 79,207, 55,252,252,252, 68, 69, 69, 69,229,165,165,165,199,116, 58,221, 88,
-212, 61,108, 10,201,225,112,134,134,134,134,190, 29, 16, 16,224,151,155,155, 91,156,147,147,115, 64,167,211,253,136, 58, 6,106,
-182,201,211,102, 48,123,171, 7,144, 31, 26, 26,122, 43, 51, 51,179,232, 57,114,230,133,134,134,166,214,129, 83, 4, 96, 39,128,
-128, 90,174,203, 3, 48, 8, 14, 90,179,173, 25,203,208,127, 44,252,118,211,232,249, 35, 58, 16, 91,166,119, 15,159,176,234,248,
- 5,146,203,116,186,157,175,205,118,106, 40,251, 68,150, 57,164, 85,101, 65, 85,211,185, 26,161,211,233,124, 12, 6, 3, 56,213,
- 4,139, 87,171,213, 16,139,197, 62,246, 38,210,197,197, 5, 59,118,236, 0,135,195, 1,135,195,129, 92, 46, 71, 80, 80,144,117,
-159,203,229, 90,191,215,171, 87,175, 86, 62,138,162, 90,179, 88, 44,168, 84, 42, 80, 20,101,221, 74, 75, 75,193, 48, 12,248,124,
- 62, 40,170, 34,156,147,205,249,214,213,241, 17, 4, 49, 48, 32, 32, 0,191,254,250, 43,244,122,253, 83,231, 37, 18, 9, 82, 82,
-254, 10, 50,194, 98,177, 16, 23, 23, 71, 18, 4, 49, 16,192,244, 26,120, 25, 0, 24, 55,110, 28, 88, 44, 22, 88, 44, 22, 72,146,
-180,126,183,108, 20, 69, 97,222,188,121,168, 20,154,236,111,227,252,183,161, 22,207,240,249,168,102,142, 22,249,130,211,101,187,
-196, 51, 64, 40,146, 44,157,244,193, 71,174,135,206,220, 68, 86,118,214, 83, 34, 11, 0,174,252,249, 35,242,243,114,113, 53, 45,
- 7, 67, 71,189,239, 42,145,184, 47,173, 84,161, 86,187,108,212, 77,204,253,106,214,160, 14, 2,149, 49, 15,101, 30, 0, 43,140,
- 7,142, 80,141,153,125,154,241, 37, 98,238,114,123,210,201,231,241,254, 92,114,252,184, 85,100,181,215,233,192,167, 40,152, 40,
-202, 42,178,244, 38, 19, 52,122, 61,164, 42, 21,238,141, 28, 9,198,104,196,220,125,251,132,124, 30,239, 79,123,210, 9, 0, 92,
- 46, 87,122,224,192,129,122, 77,155, 54, 61, 13,251,157,153, 30,127,193,207,168, 38,180,140,141,141, 77,216,190,125,123, 61, 46,
-151, 43,125, 30,156, 2,129,160,191, 72, 36,122, 44, 16, 8,250,215, 49,157, 36,128,133,163, 71,143, 78,110,216,176,225, 73,179,
-176,178,138,154,134, 13, 27, 30, 31, 61,122,244, 53, 0,243,170,121,215,171,226, 12, 12, 8, 8, 88,180,122,245,106, 97, 70, 70,
- 6,114,115,115, 97, 52, 26, 49,100,200, 16, 80, 20, 5,141, 70, 3,189, 94,143,101,203,150,137,188,188,188,230,160, 34, 80,176,
- 61,247,206,117,115,115,203,216,182,109,219,128,135, 15, 31,186,158, 60,121,146, 72, 73, 73, 17,173, 88,177,162,175,151,151, 87,
- 58, 0,126, 29,242,147,148, 74,165, 91,246,239,223, 63, 41, 37, 37, 37,104,239,222,189,156,139, 23, 47, 74,215,175, 95, 63, 70,
- 42,149,110, 7,192,170,227, 51,106, 46, 20, 10,187,125,252,241,199,244,249,243,231,115,207,159, 63,159,187,114,229, 74,116,236,
-216,177,253,252,249,243, 91,212,145,179,165, 88, 44,126,245,227,143, 63,166, 19, 19, 19,243,146,146,146,114, 86,172, 88, 65,190,
-250,234,171, 29, 22, 45, 90,212,204, 65,206,157,231,207,159,239,156,157,157,221, 32, 39, 39,167,126, 78, 78, 78,104, 78, 78, 78,
-104,110,110,110, 72,126,126,126,189,130,130,130,224,162,162,162,224,132,132,132, 14, 0,126,177,135,179,177,159,104,210,244, 33,
-221,203,231,140,234,197,124,250,222,107,204,204, 33,157,153, 55, 58, 53,253,157,197,102, 19, 73,169, 89, 8,114, 3,126,156,220,
- 42, 36,216, 91,148, 18,237,233, 26,241, 47, 43,155,255, 54, 78,182, 69, 72,201,100, 50, 28, 58,116, 8,102,235, 85,115, 91,145,
-165, 84, 42,145,159,159,111, 57,199,182, 39,157, 18,137,228,196,166, 77,155, 24,173, 86, 11,133, 66,129,162,162, 34,100,103,103,
-227,222,189,123, 40, 41, 41,193,157, 59,119, 32, 20, 10, 79,216,147, 78,130, 32, 64, 81,148, 85, 72, 29, 59,118, 12,163, 71,143,
-134, 76, 38,179, 30, 99,179,217,214,239,150,223,212,198,105,177, 60, 81, 20,133,164,164, 36,140, 31, 63, 30, 43, 87,174,196, 47,
-191,252,130,248,248,120,200,100, 50,171,216, 50,153, 76,181,114, 22, 23, 23,131,166,237,235, 51, 49, 12, 3,133, 66, 97,247,115,
-183, 21, 64,108, 54,251, 41, 81,100,217, 28,121,151,158,145,243, 95, 11, 59, 60,195, 87,223,195,182,124, 49,155,234,186,188,168,
- 68,146,108,238,208,129, 35,166,122,229, 20, 41,145, 91,168, 0,139,252,171,221,107,209,125, 4,216, 44, 18,151,142, 86, 24,174,
- 72, 22, 11, 10,181, 14,165, 42, 3, 6,140,152,230,249,195,202,207,135,154, 12,218, 26,125,188,196, 0,225,209,174,174,239, 68,
- 69,213, 35,111,243,211,208,226,141,179,160,104,128, 73,124, 19,205,229,190,172,200, 63,121,239,168,203, 12,139, 82,128,140, 26,
-173, 25,238,238, 46, 30,205,154, 97,126, 64, 0, 58, 25,141,224, 50, 12, 94, 43, 44,196,141,105,211,160,219,179, 7, 36, 0,110,
-255,254,232,250,237,183, 56, 19, 16, 0,127,141, 6,165, 51,102,192,231,200, 17,112, 37, 18, 23, 60,182,111,241, 3, 65, 16,232,
-210,165, 11,142, 31, 63,238,213,179,103,207,163, 55,111,222,236,103, 50,153,206,212, 37,111,221,220,220,174,176,217,236,160,218,
-174, 51,153, 76, 57, 10,133,194,225, 48, 35,108, 54,187, 83, 92, 92,220,190,189,123,247,122, 24, 12,134,231,210, 11,225,241,120,
- 61,251,246,237,187,105,221,186,117,146, 49, 99,198,108,138,143,143, 47,215,235,245, 71, 28,121,165, 0, 44,220,176, 97,195,132,
-113,227,198,185,143, 25, 51,134,185,119,239,158,173,245,202,167, 99,199,142, 13, 55,109,218,228,223,170, 85,171,169,227,199,143,
-231, 2,152, 91,155,149,199,213,213,117,226,166, 77,155,188,139,139,139,161, 82,169,172,149,108, 78, 78, 14, 92, 92, 92, 64,146,
- 36, 72,146, 4,135,195,193,210,165, 75,189, 38, 78,156, 56, 77, 38,147, 77,179,195, 74,182,113,237,218,181, 62,175,191,254, 58,
-249,240,225, 67,144, 36, 9,129, 64,128,119,223,125,151,212,104, 52, 30,243,231,207,223,170, 86,171, 7, 59,146,135, 28, 14,103,
-232,198,141, 27, 35,218,183,111,207, 78, 75, 75, 67,219,182,109,113,233,210, 37,244,239,223,159, 83, 86, 86, 86,127,230,204,153,
-163,117, 58,157,163,126, 92,164, 66,161, 48,230,212,169, 83,217,193,193,193,214,138,165,126,253,250, 84,239,222,189,101,105,105,
-105,141,207,159, 63, 95,210,174, 93, 59, 71, 2,150, 7, 10,133,194,200, 63,254,248, 35,127,254,252,249,221, 54,108,216,208, 23,
- 0, 90,183,110,125, 96,193,130, 5, 39,101, 50, 89,244,153, 51,103,100,157, 58,117,202,177,147, 47, 64, 42,149, 82,147, 39, 79,
-118,173,233,162,205,155, 55,151,162, 34,224,114, 3, 0, 53,198,107,107, 28,234, 63,103,249,180,129, 46,160, 12, 96,140, 26,192,
- 80, 14, 24, 84,160,245,229, 32,184, 46,128, 81, 3, 31,190, 12, 59, 39, 54,150,124,242,235,253,219,212, 29,162,119, 90,113,217,
- 17, 56, 81,101, 85, 3,160, 5, 65, 16, 87, 15, 29, 58,132,184,184, 56, 28, 58,116, 8,189,123,247,190,106, 43, 6, 82, 82, 82,
-208,169, 83, 39,152, 45, 90,118,205,213, 82, 40, 20,179,230,205,155,151, 56,116,232, 80,225, 19,149, 1, 73,194,221,221, 29,189,
-122,245,210,170,213,234, 89,246, 38,148,162, 40,176,217,108,228,228,228, 96,243,230,205, 88,188,120, 49,194,195,195, 97, 52, 26,
-159, 18, 91,230,122,207,174,202,207,100, 50,225,242,229,203,248,105,251,118,204,157, 51, 7, 98,177, 24, 0, 96, 48, 24, 32,147,
-203, 33, 16, 8,172, 98,172, 22,225,180,235,238,221,255,107,239,218,195,154,186,178,253,111,159,115,242,132, 64, 32, 16, 16, 4,
-100,116,172,180, 87,171,131,232,197,199,248,168,212, 50, 90, 71,107,125,116, 20,116, 70,138,218,250,205,168,157,142, 95,191, 78,
- 91, 95, 51, 78,123,117,208,218,218,150,145,106,107,181, 29,139,218, 58, 85,219,218, 14, 62,166,222,170, 80, 91,161,248,192, 7,
-162, 16, 72, 8,132, 16, 66,158,231,220, 63,200,137, 1, 9, 36,112,162,216,203,250,190,243,145,199,225,151,181, 95,103,255,246,
- 90,107,175,125,121,121, 92, 92, 92, 43,151, 33,255,215,245,204, 2,203,178,112, 56, 28,104,110,110, 70, 78, 78,142,131,227,184,
-189,157,205, 63, 60, 41, 90,190,124, 57, 44,150,219, 6,245,161,174,152,228,196,196, 68, 12, 27, 54,204,253,158,162, 40,206, 87,
-204,127,140, 30, 2,179,199,221, 73,171, 55, 2, 0,226,226,226,144,148,148,132,152,152, 24,175,152,129,230, 34, 93, 17, 63, 50,
-195,123, 39, 90,119,227,164,108,145, 88, 54,113,192,192, 65,228, 70,149, 30, 12,195, 32, 88, 25,137,209, 51, 86,128,166, 41, 40,
-194, 34, 65,156,230,219,140,152,162,193,208, 12,244, 70, 51, 18,251, 15,164,164, 50,249, 68, 83, 39, 68, 43, 84, 41,218,246,252,
-220,209,178, 90,199, 77,200, 19,100,112,242,211,105,172, 4, 84,132, 17,207,165, 63, 32,207,254,244,135,109, 48,216, 31,241, 69,
- 95,218,225, 64, 20, 77,195,198,113,248,126,249,114, 36,231,230,162,136, 39,134,185,185, 40,202,206,134, 74, 36,130,148,162,192,
-217,237,119,248,244,125, 33, 90, 0, 80, 81, 81,129,252,252,124,213,236,217,179,247,159, 63,127,126,190,159,100,131,199,138,252,
-246,219,111,163,250,247,239,239,245,158,171, 87,175, 34, 37, 37,197,111,247,148, 68, 34, 73,127,228,145, 71,246,228,231,231, 43,
- 75, 74, 74, 16, 21, 21,213,109,162, 37,149, 74,199,165,165,165,237,121,239,189,247, 66,181, 90, 45,114,115,115, 67,167, 77,155,
-182,187,176,176,112,134,197, 98,241,133,108,182, 34, 89,185,185,185,245,121,121,121,255, 64,107, 23, 97, 85, 94, 94,222,187, 35,
- 70,140,120, 38, 59, 59, 59, 12,192, 18, 87,236, 64,135,100, 75, 42,149, 78, 24, 48, 96, 64,171, 85,173, 84,218, 98,108, 10, 14,
- 14,134, 82,169,132, 88, 44,134,197, 98, 65,114,114, 50,145, 72, 36, 99,125, 41,115, 72, 72, 72,218, 19, 79, 60, 65,157, 60,121,
- 18, 26,141, 6, 97, 97, 97, 80, 40, 20,112, 58,157,200,202,202,162,115,114,114, 38,152, 76,254,121,184,226,227,227,167, 79,154,
- 52,137, 41, 46, 46,198,181,107,215, 96,177, 88,112,241,226, 69,132,134,134, 34, 51, 51, 83,252,218,107,175, 77,187,117,235,150,
-191, 68,107, 72,118,118,118,181, 39,201,226, 37, 56, 56,152, 12, 26, 52, 72, 31, 17, 17, 49, 28,128, 63, 68,107,200,178,101,203,
-106, 54,108,216, 48,238,232,209,163,238,164,151, 71,143, 30,253, 19, 0,108,217,178,229,132, 90,173, 30, 14,192, 87,162, 5,142,
-227,216,167,158,122,170, 92, 34,145, 64, 36, 18, 65, 34,145,180,186,196, 98, 49, 40,138, 10,225,135,115,103,120, 63, 94,211,188,
-154,245,167,141, 27,131,101,180,232, 15, 51, 30, 70, 66,152, 24,144,171, 32, 30,183, 10, 36,172,197,104,201,233,175, 2, 95,172,
-194,166, 39,244, 84,246, 7,205, 7,108,206,112,245,149,186, 58,227, 61,158, 3, 70, 0,248, 59, 90, 14,215,125, 17,192,183, 61,
-100,110,250, 14, 64,242,212,169, 83,221,100,235,240,225,195, 72, 79, 79, 71,125,125, 61,138,139,139, 61, 73,150, 63, 7, 44,127,
-103,183,219,207,125,248,225,135,163,103,207,158, 77, 60,198, 23, 74, 74, 74,112,225,194,133, 34, 95,241, 40,138, 2,203,178, 16,
-137, 68,216,184,113, 35,108, 54, 27, 62,248,224, 3,124,252,241,199,160, 40, 10,132, 16, 16, 66, 16, 26, 26,138,215, 95,127,221,
-175,231,158,211,233,196,206,157, 59,177,234, 79,127,114,147, 44,151, 39, 3,125,162,163, 17, 17, 25,137, 43, 87,174,116, 74,180,
-234,234,234, 94, 57,120,240, 32, 58, 10,134, 63,120,240,160,251,117,155, 96,248,206,231, 57,154,134,197, 98,193,163,143,222, 62,
- 42,118,217,178,101,238,215,122,189, 30, 52, 77,243,117, 65,124,197, 52,115,192, 12,217,237,207,166, 60,247, 92, 43, 11,157, 55,
-204,187,193, 69,132,178,110,181, 67,182,146, 93,214,217, 24, 0, 83,209, 18,163, 85, 5,220,197, 24, 45,142, 99, 31,140,235, 27,
-139,115,101,231,193,208, 52, 36,202, 72, 40, 85,209, 96, 29, 86, 24,106,174,161, 96,223,155, 0,128,119,118,238, 5, 69, 81, 96,
- 24, 26, 22,171, 19, 15, 36,196,130,101,217, 7, 59,194,126, 8, 24, 61, 33, 58,242,191,227,251,133,145,226,240,107, 24, 20, 21,
-209,198, 17, 34,197, 3,149, 10, 50, 74, 33, 31, 89,103,104, 24,253, 35,240, 77,167,100,128,162, 64, 17,130, 32,177, 24,150,252,
-252,150,168,205,220,150, 57,171, 40, 59, 27,212,129, 3, 8,145, 74, 65, 19, 2,198,101,130,238,138, 52, 52, 52,128, 16,130, 93,
-187,118,133,103,102,102,238, 46, 46, 46,206,110,110,110,206,247, 7,163,190,190,126,234,152, 49, 99,190,222,185,115,167,186, 79,
-159, 62,119,124,175,209,104,176,112,225, 66,109,125,125,189, 95, 73,221,100, 50,217,147,211,167, 79,223,190, 99,199,142,208,203,
-151, 47,163,177,177, 17,106,181,186,187, 93, 97,120,106,106,234,254,252,252,124,165, 70,163,129,193, 96,128,197, 98,193,174, 93,
-187,194,166, 76,153,146, 95, 90, 90,154, 14,160,176, 19,140,151, 60, 73,214,226,197,139,127, 0, 16, 5, 96, 91, 91, 14,234,250,
-238, 97, 15,178,101, 0,240, 90, 7, 43,209,126,193,193,193,168,169,169,193,194,133, 11,113,233,210,109, 3,104,108,108,172,123,
-165,119,229,202, 21,168,213,106, 16, 66,162,124, 41,180, 90,173, 86, 88,173, 86, 44, 90,180, 8, 21, 21, 21,173, 48,111,222,188,
- 9, 66, 72,144,191, 21, 25, 29, 29, 29,109, 54,155,241,203, 95,254, 18,205,205, 45,231,250,206,153, 51, 7, 34,145, 8, 53, 53,
- 53, 16,137, 68,145, 93,104,159,200,169, 83,167,122, 77,173, 18, 26, 26,106, 11, 15, 15,127,200, 79,204,136,105,211,166,221,202,
-205,205,189, 99, 99,203,233,211,167,127,173, 82,169,142,170, 84,170, 65,126, 98,178,158,164, 74, 44, 22,183, 34, 90, 34,145, 8,
- 20, 69,249, 28,163,118,169,198,244, 6, 67,170,134,109,120,118,242,194,132, 40, 37,184,198,106,136, 31,121, 5,231,180,114,108,
-204, 57, 4, 0,248,227,188, 20, 12, 77, 91, 15,235,142,201, 88, 62,138,150,100,220,180, 60, 15,224,165,123,252,204,255, 31, 0,
-252, 46,184,183, 0, 12,235, 65,243,145,155,108, 29, 62,124, 24,131, 7, 15, 70, 93, 93, 29, 74, 75, 75,187, 74,178,248,231,221,
-170, 53,107,214,124, 49,115,230,204, 96,126,209, 42,151,203,177,114,229, 74,115, 99, 99,227, 42,191, 58, 17,203,130, 97, 24,247,
- 34, 89, 38,147, 33, 57, 57,217, 77,178, 8, 33,104,106,106, 2,195, 48,252,142, 68,226,163,142,136,233,211, 7, 33, 33, 33, 24,
-248,192, 3,184,236,122,142,240,175,165, 82, 41, 8, 33,112, 56, 58, 53,228, 25, 93, 65,237, 43,132,158,146,121, 82,212,161,233,
- 56, 54, 22, 44,203,242, 36,147, 19, 2, 51, 50, 50, 18,141,141,141,190, 98,246, 72,241, 98,209,226,137,214, 84,180,196,106,221,
-145,222, 97, 60,128, 2, 4,112, 75, 37, 1, 71, 88,142, 3, 67, 83, 46,223, 45, 13,154,166,160,215, 86, 97,243, 43, 75, 92, 36,
-235, 99,124,118,162, 20,113, 3, 6,223,246,227, 18, 2,112, 29,119,110,181, 82,156,187,116,102,170,188,154, 84, 33, 44, 54, 8,
- 50, 89, 27,254, 24, 46, 6, 73,164,240,236,132,184,160, 51, 7,155,115,127, 52,216, 58,157, 40,100, 20,213, 18,252, 78, 72,187,
-193, 61,148,235, 59,154, 16,112, 28, 7,142,245, 47,238,152, 39,242,114,185, 28, 54,155, 13, 52, 77, 99,235,214,173, 97,105,105,
-105,219,252, 37, 90, 0, 74,170,171,171,167,100,101,101, 29,222,187,119,111,100,100,100,100,171,213, 67, 86, 86,150,174,186,186,
-122, 10,252, 12,186, 23,137, 68,219,222,122,235,173,208,235,215,175,163,169,169, 9,114,185,220,253,240,233,106,255, 28, 57,114,
-228,231, 71,142, 28, 9, 55, 24, 12,176,217,108,144,203,229,224, 56, 14, 52, 77,227,163,143, 62,138,120,252,241,199, 15,221,184,
-113,227,145,142,116,149,203,229, 51, 92,196, 9,217,217,217, 97,217,217,217,227, 1,175,153,122,221,146,157,157, 29,182, 98,197,
-138,105,102,179,249,181, 14,202, 92,161,215,235,251,200,229,114,236,219,183, 15, 10,133, 2, 65, 65, 65,136,141,141,133, 94,175,
- 71, 80, 80, 16, 56,142,131,221,110,231, 31, 22,181,190, 20, 92,171,213, 54, 58, 28, 14,229,225,195,135, 81, 91,123,251, 95, 18,
- 18, 18, 80, 95, 95, 15,150,101,155,252,173,204,202,202,202,106, 66, 72,252,185,115,231,112,253,250,117,164,167,167,227,192,129,
- 3, 72, 73,105,241, 14, 91,173,214,174, 36,241,115,210, 52,205,117,208,111, 9,128,112, 33, 49, 93,147,151, 95,152, 44,203,178,
- 60,201,242,252,235, 73,190, 58,249,205, 86,195,249,161,104, 69,222,134,165,147, 22, 78, 30, 28, 9,179,246, 26,100, 33,145, 32,
- 97,137,216,152,115, 8,197, 87, 91,218,107,227,238,179,216,179,118, 10, 32, 87, 33, 73,169, 67,159, 16,230,137, 11, 53,247,156,
-104, 41, 61,215, 9, 61,117, 98, 74, 79, 79,135, 94,175,135, 66,161, 16, 34, 62,231,148,217,108,190,248,201, 39,159, 12,159, 58,
-117, 42, 36, 18, 9, 46, 94,188,136,194,194,194, 82, 0,167,252, 37, 90, 34,145, 8,107,214,172,193,146, 37, 75, 16, 29, 29,141,
- 85,171, 86,129, 97, 24,247, 69, 8,113, 91,184,252,145,168,232,142, 55, 62,242, 1,241,157, 25,195,149, 74,229, 26,138,162,102,
-211, 62, 84,156,211,233,116,178, 44,187,215, 96, 48,116,152,222,129, 15, 92,247,165, 45, 60,235,160,147, 57,173,219,152,119,131,
-139,116, 69,218,238, 54,244, 98,209,226,119, 29,222,113, 20, 16, 95,202, 2,151,201,174, 32, 80,138, 18,138,190,112,243, 86, 37,
- 34,194, 21, 46,146,229,186, 40, 10, 67, 7,183, 44,102, 63, 59, 81,138,184,254,131,193,208, 52, 24,154,134, 66, 46, 69,181,166,
- 10, 12, 67, 93,240,134, 59,132,198,204,153,131,226, 19,195, 35, 68,208,169,173,136,137,246, 98, 24, 24, 30,130,184, 24, 9, 30,
-139,144,245, 27, 66, 99,102,199,214, 55,206, 77,180,108, 14, 7,196, 79, 62,233,118, 23, 22,101,103, 35, 57, 55, 23,206,233,211,
- 97,178,217, 90,153,138,187, 74,180,228,114, 57,140, 70, 35,230,207,159,175,183,219,237,207,116,177,138, 11,107,107,107,103,101,
-100,100,212,242, 4,198,102,179, 33, 35, 35,163,182,182,182,118,150, 15, 86,162, 59,196,110,183, 63,147,146,146,162,215,233,116,
-110, 61,187,242,192,225, 69,165, 82,125,150,151,151,167,178, 88, 44,112, 56, 28,110, 76,185, 92, 14,154,166,161, 86,171,177,103,
-207, 30,181, 74,165,234,240,204, 42,179,217,252, 73,110,110,110, 61, 0,228,230,230,214, 19, 66,142, 17, 66,222, 38,132,188,213,
-230,122,155, 16,114,204,243, 94,179,217,188,191, 35,108,171,213,122,172,180,180,148, 11, 10, 10, 2, 77,211,176,217,108,144,201,
-100,110,147,120, 67, 67, 3,204,230, 22, 55,119, 97, 97, 33,236,118,251, 73, 95,202,110, 52, 26,191,218,185,115, 39,155,144,144,
-128,193,131, 7, 35, 57, 57, 25,169,169,169,232,215,175, 31,214,173, 91,231, 52,153, 76,126,143,189,202,202,202,207,254,249,207,
-127,218,227,227,227, 49,124,248,112, 72,165, 82, 12, 29, 58, 20,177,177,177,248,235, 95,255,106, 53, 24, 12,135,187,208, 76, 55,
-206,159, 63, 79,119, 64,114, 67,225,195,238,221, 54, 82,113,230,204, 25, 58, 53, 53,245,211,182, 95,140, 28, 57,242, 83,133, 66,
-161,228, 77,236,254,172,200, 61,201,149, 84, 42,117, 95,252,231, 12,195,248,178,250,161, 30,138, 86,228,253,109,201,196,133,147,
- 7,135,227,211,175,190,133,216, 86, 15, 88, 59,240, 8, 58,237, 32,226, 96, 68, 43, 69,113, 61, 96, 14, 88, 14,224, 7,180,228,
- 97, 90,133,158, 37,238,192,247,218,218, 90,148,150,150,162,176,176, 16,169,169,169, 56,121,242, 36,112, 59, 64,222,111, 49, 24,
- 12,171,214,174, 93,107,226,119,242,189,248,226,139,102,163,209,184,202,223,103, 48,199,113, 16,137, 68, 72, 74, 74,194,138,112,
- 76,117,201, 0, 0, 13, 69, 73, 68, 65, 84, 21, 43,112,232,208, 33, 92,188,120, 17,118,187,221, 77,132,248,152, 76,127, 44, 90,
- 98,177, 24,209,209,209,176,219,237,110,107, 22, 0, 92,190,116, 9, 12,195,128,101, 89, 88,173,214, 78, 45, 90, 74,165,114,205,
-246,237,219,127,175,211,233, 98,180, 90,109,148,231, 85, 93, 93, 29, 85, 85, 85, 21,117,235,214,173,168,138,138,138,168,242,242,
-242,168,107,215,174,197,188,250,234,171,191, 87, 42,149,107,124,209,147,166,105, 12, 29, 58, 20,203,150, 45,115, 95,111,188,241,
-134,251, 42, 40, 40,240, 59,120,157,166,105, 36,173,222,136, 41, 90,206,125, 29, 82, 19,247, 85,252,199,197, 29, 97, 6,156,139,
-116,137,191,184,118, 27,122, 30, 44,221,142,240,187, 14,249,103,153, 59,108,163,109, 48,124,192,196, 97,109,254,250,106,217,165,
-137, 73, 67, 70, 80, 26, 93, 99,171,237,159,201, 19,102,129, 16,130,190,253, 7,131,102, 24,208, 52, 5,134,166, 17, 22, 42, 67,
-233,185,115,172,197,108,254,186, 61,204,241, 0, 35,145, 75,222,152,247,216, 80, 89,165,164, 6,234,152, 96,136, 69, 45,220,145,
-187, 58,171,205, 12,193, 0, 67, 66,240,219, 91, 17,242,175,171,155,223, 8, 55,217, 62, 61,230,101, 5,200,178, 44, 20, 82, 41,
-154, 45, 22,152, 29, 14, 76,216,188,217,237, 46,164, 8,193,119, 0, 30,222,188, 25,223,228,231, 35, 84, 34, 1,164, 82,159,119,
-133,180, 71,180,116, 58, 29, 22, 44, 88, 80, 91, 85, 85,149,217,149, 24, 45, 94, 44, 22,203,113,141, 70,147, 57,107,214,172, 93,
-251,246,237, 83,205,154, 53, 75,175,209,104, 50,125,140,123,186, 67,154,155,155,243, 43, 42, 42,154, 22, 44, 88,240,254,238,221,
-187, 35, 34, 35, 35,221, 43,145, 46,117, 86, 66,116,147, 38, 77,146,250,114, 95, 39,183,172,117, 5,183, 47,113, 89,182, 30, 94,
-188,120,241, 55,104,137,191,242,148,213,239,188,243,206, 28, 15, 23,227,219, 0, 54,119, 4,220,208,208,240,214,138, 21, 43,126,
-119,252,248,241, 72,153, 76, 6, 66, 8,196, 98, 49, 6, 14, 28,232,222, 69, 35, 18,137,192,113, 28,158,123,238, 57, 93, 77, 77,
-205, 22, 31,219,102,241,218,181,107,199, 53, 55, 55,135, 47, 88,176,128,150,201,100,168,174,174, 70, 78, 78,142,115,199,142, 29,
-245, 38,147,105, 97, 23,136,240,206,151, 95,126,121, 66, 99, 99, 99,255,172,172, 44,177,193, 96,128,217,108,198,243,207, 63,111,
-125,247,221,119,111,154,205,102,191, 19,254,142, 26, 53,170,172,188,188,124,108, 83, 83, 83, 93, 80, 80, 80, 91,107, 31, 9, 14,
- 14, 30, 1,224,125,127, 48,147,147,147,175,220,184,113, 35,117,253,250,245,199,236,118,187,232,244,233,211,238, 96,248,173, 91,
-183, 22,200,100,178, 73,240,243,240, 85, 66, 8, 43,149, 74, 91, 89,176,218,190,102, 24,166,211,103,218,131,125,130,214,255,237,
-233,113, 11, 31,125, 72,137, 79,190, 58,139,181,251,175, 94,120, 96,161, 58,233,231,225, 90,176,218, 82,252,113, 94, 10, 54,238,
- 62, 11,160,197,117,200,214, 20,131,171,187, 2, 46, 36, 30,215,244,186,202, 30, 48, 7, 20,160, 37,101, 70, 79,147, 86, 36,171,
-184,184, 24, 19, 39, 78, 4, 0,156, 60,121, 18, 99,198,140,193,201,147, 39, 49,118,236, 88,191,115,105,185,228,223, 13, 13, 13,
-229, 5, 5, 5,255, 21, 31, 31,143, 83,167, 78, 93, 3,240,111,127,149,228,137, 22,195, 48,248,205,111,126,131,180,180, 52, 36,
- 36, 36,180,218,109,200,191,246,135,108, 56, 28, 14, 12, 25, 50, 4, 22,171, 21, 98,177,216,237,154,100, 24, 6,234,168, 40,148,
-149,149,249,100,209,162, 40,106,246,140, 25, 51,168,146,146, 18,204,157, 59, 23,187,118,237,242,122,111, 70, 70, 6, 62,252,240,
- 67,204,152, 49,131,122,225,133, 23, 58, 76,239,192, 7,161,251, 82, 38,126,158,238,236,185, 47, 20,102,160,185, 72,119,196, 35,
-181, 67,187, 78,147,118, 62,203,109, 69,180, 60,146,132, 5,134,104, 57,108,187, 14,124,240,230,138,212,109, 99,213, 49, 81, 74,
-232, 13,102, 55,217, 42, 42,248, 24, 0, 48,115,241, 95,192,208, 45, 46,197, 80,133, 12,114, 49,141,252,247,182,232,108,182,230,
-118,123,151, 81, 68, 45,121, 97,244, 64,165, 36,216,142,134, 62, 28, 6,171,111,159,148, 67,250,127,124, 39,225,250, 69, 56, 34,
-139,235, 48,239,231,138,208, 45, 37,245, 75, 96,103,223,184, 99, 66,172,175, 55,215,159, 59, 39, 79,223,190, 29,167, 51, 51,209,
-215,233,196,177,216, 88,168, 68, 34, 40,165, 82, 80,132,192,252,175,127,225,155,125,251, 16, 45,149, 2, 33, 33,112,172, 91, 7,
- 75,105, 41,236, 70,163,185, 11, 43, 51,204,153, 51, 71,167,211,233,102, 89,173,214,227,221,173,103,179,217,124,164,162,162, 98,
-201,168, 81,163,182,217,237,246,103,204,102,115,183,118, 70, 89,173,214, 35, 26,141,230,201, 57,115,230,124,188,127,255,254,200,
-176,176,176, 46, 99,213,214,214,166, 8,212,157, 88, 0,127,118, 5,183, 47,201,206,206, 14, 59,115,230,204,239,242,242,242,182,
-121,172, 38,162, 22, 45, 90,244,116, 27,146,213,233,174, 67, 0, 55,106,106,106,214,173, 92,185,242, 47,155, 54,109, 82,240,129,
-239,223,127,255, 61, 28, 14, 7, 68, 34, 17,156, 78, 39, 22, 45, 90,212, 88, 91, 91,187, 17,222, 51, 58,223,209,181, 26, 26, 26,
- 6,174, 95,191, 62,111,243,230,205,105, 52, 77, 7, 59,157, 78, 83, 83, 83,211,177,230,230,230,133,232, 90, 30, 45, 86,171,213,
- 46,120,233,165,151, 22,228,228,228,204,160, 40, 42,202,225,112,232,140, 70,227, 65,179,217,252, 46,186,224, 74, 58,117,234,148,
-118,222,188,121, 87,181, 90,237,131,113,113,113, 6,133, 66, 97,181, 90,173,180, 92, 46, 15, 13, 14, 14, 78, 6,112,138, 16,242,
-163, 63,152, 69, 69, 69,154,172,172,172,235, 22,139, 37,233,237,183,223, 62, 17, 26, 26,250, 21, 33,132,136,197,226,112,185, 92,
- 62, 17,192, 49, 66,200,101,127, 48, 41,138, 98, 61,173, 87,109,227,179, 36, 18,137, 79, 49, 90,253,213, 65,191, 77, 27,200,224,
-147,175,207, 98,237, 39, 55,118, 58, 57,110,223,190,162,186,127,173, 26, 3,216,246,206,195,208, 89,239,183,184, 11, 1,176, 53,
-197,176,237,205, 0, 9,138,196,137, 91, 34, 24,204,182,207,208, 43,237,137, 59,189,131, 78,167, 67, 73, 73, 9, 79,178,146, 1,
- 96,236,216,177, 69, 60,217, 42, 44, 44,196,240,225,195,139, 0,136,252,237,175, 13, 13, 13, 43,231,207,159,127,196,181, 56, 94,
-217,133,133,159,155,104,241,132, 42, 33, 33,193,253,222,243,242,136,209,242, 73,156, 78, 39,196, 98, 49, 24,134, 65, 76,108,172,
-251,183, 56,142, 67, 89, 89, 25,244,122,189, 79, 68,139,166,105,154, 16,130,185,115,125,219,144,252,212, 83, 79,225,216,177, 99,
-160,125,100,133, 52, 77, 35, 49, 49,177,211,123,120, 94,234, 43,102, 92, 92, 92,151, 49, 3,205, 69,186, 74,176,218,123,221, 30,
-169,242, 54, 32,238,150, 84, 54, 54, 26,254,252,222,246,173,155, 22, 45,125, 78, 81,124,165, 26,134, 70, 11,104,154,242,124,120,
-130, 97,104,132, 6,203, 16,223, 71,137,221,255,248,187,209,216, 80,255, 18,188,156,123,152, 16, 34, 94, 60,105,196,207,165,226,
- 24, 19,146, 30,158, 3, 90,118,155, 4,112, 26, 47,222,193, 49, 95,224, 87, 55, 76,178, 3, 55, 76,139,191,171,179,222, 73,180,
-172,214,201, 47, 62,246,216,231,107, 15, 29, 10, 26,185,115, 39,174, 44, 90,132, 88,179, 25, 82,151, 43,145, 34, 4, 10,177, 24,
- 10,177,184,133,100,229,228,192,236,112, 96,115,102,102,147,197,106,125,204,159, 65, 94, 91, 91,139,233,211,167,107, 43, 43, 43,
-167,160, 11,174, 61,111, 98, 50,153,242, 1,228, 11,133,103,177, 88,142,223,188,121,243, 87,211,167, 79, 63,116,228,200, 17,117,
- 15, 73, 50,199,147, 45,219,153, 51,103,158, 62,113,226,196, 21,180, 62, 88,180,254,196,137, 19, 87,178,178,178, 72, 94, 94,222,
-187, 0, 94,134,143, 9, 60, 77, 38,211,214, 47,191,252, 18,227,198,141,123,121,195,134, 13, 17, 41, 41, 41,136,138,138,130,209,
-104, 68, 97, 97, 33,150, 47, 95,174,111,104,104,216, 80, 95, 95,191,201, 79,157,109, 22,139, 37,195,115, 43,181, 16,245, 96,177,
- 88,118, 84, 85, 85,237, 16, 10,240,217,103,159,253,190,172,172,172, 86,173, 86,255,183, 88, 44,126, 24, 45,113, 64, 26, 0,239,
-250, 75,136,120, 89,186,116,233,185,178,178, 50, 93,223,190,125, 83, 93,152, 97,104, 57,198,104,123, 23, 48, 43,207,158, 61, 27,
- 55, 98,196, 8, 74, 36, 18,113, 52, 77, 67, 36, 18,113, 12,195,112,174,184, 26, 14, 0, 14, 30, 60, 40, 5,208,225,177, 57, 87,
-106,204,235, 51,254,254,159, 23,126,212, 52,239, 43,173,110, 90, 1,128,219, 91, 28,244,197, 80, 53, 61,121,242,160,155,176,228,
-142, 5, 9,109, 73, 84,201, 53, 86,129, 4, 71,227, 38,219, 23,171, 63,189,160,113,128,188,214,203,169,218, 95, 87,195,149,222,
-161,170,170,202,147,100,241, 86,171,228,177, 99,199, 22,185, 72, 22,255, 93, 87,226,203,142,178, 44,219,173, 57,140,227, 56,172,
- 93,187, 22,239,188,243, 14, 58,203,104,238,218,221, 71, 58,195,227, 45, 90, 78,167, 19, 54,155, 13,197,197,197,238,156, 93,188,
-187,144, 79,237,224,112, 56, 58,220,173,238,116, 58,157, 86,171, 21, 31,125,244,145, 79,100,107,207,158, 61,104,110,110,134,179,
- 19, 6,231,153,138, 97,216,176, 97,208,235,245,238,205, 62,201,201,183, 83,229,217,108, 54,191,136, 43,143,153,148,148, 4,157,
- 78, 7, 62, 94, 56, 62,243,182,177,199, 97, 50,253, 84,251,189, 87,139,214, 93,159, 49,165, 65,161, 71, 82, 70,167,141,201,124,
-122,121,112,163,197,137,235,215,203,161,173,169, 2, 69, 40,196,244,141, 67,191,126,137,144, 75, 40,236,202,221,100, 42,250,230,
-171,255, 52, 26,235,210,189, 97, 77, 85,138,191,201,121,114, 76,234,128, 1, 33, 4, 14, 59,224,180, 3, 14, 59,192,186,254,242,
-159,177,173,251, 92, 73, 73, 61,247,194,119,250,255,253,204, 96,107,247,204,170, 89,192,152, 48,149,234,243,213, 7, 15, 6,177,
- 54, 27,106, 87,174, 68,144,195, 1,153,107, 85,210, 82, 16, 41, 28,235,214,181,144,172,140,140, 38, 67,125,189, 95, 71,240, 68,
- 70, 70,158, 37,132, 68,106,181,218,251, 42, 51,188, 90,173,254,140,227, 56,157, 78,167, 75,233, 65,122, 69, 1,168, 7, 96,107,
-103, 33,161,134,255,241, 63,188, 36,170,213,234, 23, 40,138, 26,197,113, 92, 4, 69, 81,117, 44,203,158,170,169,169,121, 21, 64,
- 89,239,124,122,207,132,207, 12,255,179, 78,238,171, 1,240, 7,180, 4, 5, 95,247, 21,124,168, 82,169,180, 72,236,251,127, 61,
- 88, 58, 97,118,178, 18,253,251,132, 64, 36,150,161,178,193,129,163, 63, 54, 96,123,129,166,194,108,119, 62,126, 73,219,116,190,
-183, 41, 58, 20,193,143,224, 17, 82, 84, 42,213,183,159,127,254,121, 74,255,254,253, 41,207,128,119, 62, 87, 30,239,222, 98,152,
- 22, 46,119,252,248,113,199,220,185,115, 79, 85, 87, 87,143,243,134, 25, 18, 18,242,197, 15, 63,252,240,168,193, 96,184,131, 80,
-121,102,138,231,223,155, 76, 38, 44, 93,186,244, 75,111, 71,240, 40,149,202,156, 77,155, 54,253,126,230,204,153, 20,159,142,194,
-243,226,143, 11,226, 47,155,205,134,247,223,127,159,221,178,101,203,235, 6,131,193,171,235, 48, 38, 38,166,162,178,178, 50,142,
- 79,181,224, 75, 82,209,196,196,196,170,242,242,242,216,187,137,121, 31, 19,174, 86,214,173,123, 98,154, 16,201,229,207,134, 40,
-194, 95,153, 57,127, 89, 68,226,128, 7, 72,116, 76, 95, 16, 80,168,214,220, 66,249,213, 75,220,254, 15,222,172, 53, 53,232,215,
-152,205,166, 55, 59,194,121, 8, 24,240,179, 80,241, 94,137, 19,131,192, 19,160, 54,231, 83,221,177,226, 0, 96, 19, 81, 23,174,
- 27,237,115,126,236,192,237,195,147,173, 63,239,223, 31, 36, 25, 52,232,142, 68,113, 44,203,194, 82, 90,138,205,153,153,126,147,
-172, 94,233,149, 94, 17, 68,250,163,243, 28, 89,118,180,228,231,242,215, 98, 66,146,162,130,231,112,192,108, 10,236, 16,138, 16,
-137,131,195, 69,112,248, 34,136,105,218, 86, 84, 5,115,111,245,251, 36, 61,246, 80,105, 0,193, 42,149,234, 43,154,166,251,241,
- 22, 25, 79,107,125, 59, 7, 74, 95,175,174,174,158, 4,160,163, 29,194, 3, 66, 66, 66,222,116, 58,157, 35,125, 57, 84,154,166,
-233,211, 70,163,241, 89,116,112,168,116, 32,118, 29, 70, 68, 68,148,149,151,151, 15,224,119, 81,123,206,149,237,237, 44,191,124,
-249, 50,198,143, 31, 95,174,209,104, 18,239, 38,102, 79, 21, 47,187, 14,123,142, 69,203, 67, 98,197, 82,197, 2,137, 92,246, 8,
-107,119, 36,129, 0,140, 72,116,193,218,108,254,218, 98,110,124, 15, 94,220,133,119, 83,102, 1, 99,164, 18,201, 23,226,208, 80,
-121,123,164,205,110, 52,154, 45, 86,235,228, 94,146,213, 43,189,210, 43,189,210, 43,247,145, 12, 82,169, 84,159,139, 68, 34,169,
- 39,153,108,251,154, 23,135,195,209,172,213,106,211, 1, 92,188,203,152,255, 63,197,207, 32,181, 52, 95, 49, 93,215,248,158,142,
- 25,192,178,115, 2, 98,142,119, 97,174,190, 79,244, 28,223, 83, 49,249,242,250,129,155,230, 79, 63, 18,170, 62, 61,244,228,132,
-214, 51, 80,152, 66,141,163,118,244,228, 2,208,238,171,239, 19, 61,199,247, 52,204,182,253,199, 71, 92,191, 48,125,236, 83,254,
-234,201, 9,173,103,160, 48,187, 59,142, 58,208,147,235,110, 95,242,210,246,171,113, 31, 74,201, 47,192,149,252, 2, 92,241,240,
-118,243, 54,102,123,251, 63,191, 2, 9, 3,181, 19,128, 79,187,239,194, 39, 61, 21,211,179, 30,132, 60, 42, 32, 0,199, 14, 20,
- 8,141,217,166, 62,133,146,213,174, 29, 38,199,224, 67,194, 81,127,202, 46, 68,187,183, 41,171, 32,184, 93, 32, 89,126, 97, 10,
-213,239, 3,141, 41,212, 88,106,139, 41, 68,191,111,175,221, 3,216, 70, 66,233, 41,200, 88, 10, 68,159,111,167,255,116, 27,183,
- 45,166, 16, 99,169, 45,166, 16,253,254,110, 96, 10, 49,150,218,195, 20,162,223,123,107,251,251,213,208,196,187, 11, 93, 41, 30,
-136, 15,100, 43, 23, 0,168,174, 84, 90, 0, 45,101, 19,132,198, 20, 90,231, 64,144, 77, 63, 44, 48,247, 28, 83,224, 54, 90,237,
-194, 20,114,117, 51, 65,168, 54, 10, 68,127,247,196, 20, 10,191, 45,142, 16,237,212, 30,102,119,245,245,162,167,224,101,239,110,
-191,191, 91,152, 2,183,145, 32, 99,169, 13,230, 4,129, 23, 3, 19, 60,222,175, 22, 18, 83,168,177,212,142,158,221,110,167,246,
- 48,187,171,175, 23, 61, 5, 47,187, 16,115, 72,160,112,239,165, 69,139,163,188,246,137,220, 54,215, 93, 33, 26,247,204, 37,231,
- 39,246, 79, 10,211, 79,247, 76, 90, 0,218,254,158,234, 41, 36,102, 91, 29,133,116,247, 4, 82, 79, 33, 49,253,208,245, 39,135,
-121,191,181,123, 79,172, 79,111,120,221,113, 75,121,179,142, 6, 66, 79, 33, 49,125,196,254, 73, 96,118,163,237,127,114,194,244,
- 20, 69,248,138, 23,120,101, 2,129, 45, 48, 1, 43,183,192,122, 78, 8,132,133, 48, 0, 34,184,158,174,149,242, 43, 1, 40,251,
-253, 82,167,189, 99,169,119, 44,245,184,177,212,166, 79, 78, 16,208, 82, 36,168,229,185, 45,166, 16,191,225,137, 33, 84, 31, 13,
-116,217,133, 28, 75,129,104,251,251, 77,254, 15,176, 49,196,128, 26,186,125, 59, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130,
+137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 2, 90, 0, 0, 2,
+128, 8, 6, 0, 0, 0, 68,254,214,163, 0, 0, 10, 79,105, 67, 67, 80, 80,104,111,116,111,115,104,111,112, 32, 73, 67, 67, 32,
+112,114,111,102,105,108,101, 0, 0,120,218,157, 83,103, 84, 83,233, 22, 61,247,222,244, 66, 75,136,128,148, 75,111, 82, 21, 8,
+ 32, 82, 66,139,128, 20,145, 38, 42, 33, 9, 16, 74,136, 33,161,217, 21, 81,193, 17, 69, 69, 4, 27,200,160,136, 3,142,142,128,
+140, 21, 81, 44, 12,138, 10,216, 7,228, 33,162,142,131,163,136,138,202,251,225,123,163,107,214,188,247,230,205,254,181,215, 62,
+231,172,243,157,179,207, 7,192, 8, 12,150, 72, 51, 81, 53,128, 12,169, 66, 30, 17,224,131,199,196,198,225,228, 46, 64,129, 10,
+ 36,112, 0, 16, 8,179,100, 33,115,253, 35, 1, 0,248,126, 60, 60, 43, 34,192, 7,190, 0, 1,120,211, 11, 8, 0,192, 77,155,
+192, 48, 28,135,255, 15,234, 66,153, 92, 1,128,132, 1,192,116,145, 56, 75, 8,128, 20, 0, 64,122,142, 66,166, 0, 64, 70, 1,
+128,157,152, 38, 83, 0,160, 4, 0, 96,203, 99, 98,227, 0, 80, 45, 0, 96, 39,127,230,211, 0,128,157,248,153,123, 1, 0, 91,
+148, 33, 21, 1,160,145, 0, 32, 19,101,136, 68, 0,104, 59, 0,172,207, 86,138, 69, 0, 88, 48, 0, 20,102, 75,196, 57, 0,216,
+ 45, 0, 48, 73, 87,102, 72, 0,176,183, 0,192,206, 16, 11,178, 0, 8, 12, 0, 48, 81,136,133, 41, 0, 4,123, 0, 96,200, 35,
+ 35,120, 0,132,153, 0, 20, 70,242, 87, 60,241, 43,174, 16,231, 42, 0, 0,120,153,178, 60,185, 36, 57, 69,129, 91, 8, 45,113,
+ 7, 87, 87, 46, 30, 40,206, 73, 23, 43, 20, 54, 97, 2, 97,154, 64, 46,194,121,153, 25, 50,129, 52, 15,224,243,204, 0, 0,160,
+145, 21, 17,224,131,243,253,120,206, 14,174,206,206, 54,142,182, 14, 95, 45,234,191, 6,255, 34, 98, 98,227,254,229,207,171,112,
+ 64, 0, 0,225,116,126,209,254, 44, 47,179, 26,128, 59, 6,128,109,254,162, 37,238, 4,104, 94, 11,160,117,247,139,102,178, 15,
+ 64,181, 0,160,233,218, 87,243,112,248,126, 60, 60, 69,161,144,185,217,217,229,228,228,216, 74,196, 66, 91, 97,202, 87,125,254,
+103,194, 95,192, 87,253,108,249,126, 60,252,247,245,224,190,226, 36,129, 50, 93,129, 71, 4,248,224,194,204,244, 76,165, 28,207,
+146, 9,132, 98,220,230,143, 71,252,183, 11,255,252, 29,211, 34,196, 73, 98,185, 88, 42, 20,227, 81, 18,113,142, 68,154,140,243,
+ 50,165, 34,137, 66,146, 41,197, 37,210,255,100,226,223, 44,251, 3, 62,223, 53, 0,176,106, 62, 1,123,145, 45,168, 93, 99, 3,
+246, 75, 39, 16, 88,116,192,226,247, 0, 0,242,187,111,193,212, 40, 8, 3,128,104,131,225,207,119,255,239, 63,253, 71,160, 37,
+ 0,128,102, 73,146,113, 0, 0, 94, 68, 36, 46, 84,202,179, 63,199, 8, 0, 0, 68,160,129, 42,176, 65, 27,244,193, 24, 44,192,
+ 6, 28,193, 5,220,193, 11,252, 96, 54,132, 66, 36,196,194, 66, 16, 66, 10,100,128, 28,114, 96, 41,172,130, 66, 40,134,205,176,
+ 29, 42, 96, 47,212, 64, 29, 52,192, 81,104,134,147,112, 14, 46,194, 85,184, 14, 61,112, 15,250, 97, 8,158,193, 40,188,129, 9,
+ 4, 65,200, 8, 19, 97, 33,218,136, 1, 98,138, 88, 35,142, 8, 23,153,133,248, 33,193, 72, 4, 18,139, 36, 32,201,136, 20, 81,
+ 34, 75,145, 53, 72, 49, 82,138, 84, 32, 85, 72, 29,242, 61,114, 2, 57,135, 92, 70,186,145, 59,200, 0, 50,130,252,134,188, 71,
+ 49,148,129,178, 81, 61,212, 12,181, 67,185,168, 55, 26,132, 70,162, 11,208,100,116, 49,154,143, 22,160,155,208,114,180, 26, 61,
+140, 54,161,231,208,171,104, 15,218,143, 62, 67,199, 48,192,232, 24, 7, 51,196,108, 48, 46,198,195, 66,177, 56, 44, 9,147, 99,
+203,177, 34,172, 12,171,198, 26,176, 86,172, 3,187,137,245, 99,207,177,119, 4, 18,129, 69,192, 9, 54, 4,119, 66, 32, 97, 30,
+ 65, 72, 88, 76, 88, 78,216, 72,168, 32, 28, 36, 52, 17,218, 9, 55, 9, 3,132, 81,194, 39, 34,147,168, 75,180, 38,186, 17,249,
+196, 24, 98, 50, 49,135, 88, 72, 44, 35,214, 18,143, 19, 47, 16,123,136, 67,196, 55, 36, 18,137, 67, 50, 39,185,144, 2, 73,177,
+164, 84,210, 18,210, 70,210,110, 82, 35,233, 44,169,155, 52, 72, 26, 35,147,201,218,100,107,178, 7, 57,148, 44, 32, 43,200,133,
+228,157,228,195,228, 51,228, 27,228, 33,242, 91, 10,157, 98, 64,113,164,248, 83,226, 40, 82,202,106, 74, 25,229, 16,229, 52,229,
+ 6,101,152, 50, 65, 85,163,154, 82,221,168,161, 84, 17, 53,143, 90, 66,173,161,182, 82,175, 81,135,168, 19, 52,117,154, 57,205,
+131, 22, 73, 75,165,173,162,149,211, 26,104, 23,104,247,105,175,232,116,186, 17,221,149, 30, 78,151,208, 87,210,203,233, 71,232,
+151,232, 3,244,119, 12, 13,134, 21,131,199,136,103, 40, 25,155, 24, 7, 24,103, 25,119, 24,175,152, 76,166, 25,211,139, 25,199,
+ 84, 48, 55, 49,235,152,231,153, 15,153,111, 85, 88, 42,182, 42,124, 21,145,202, 10,149, 74,149, 38,149, 27, 42, 47, 84,169,170,
+166,170,222,170, 11, 85,243, 85,203, 84,143,169, 94, 83,125,174, 70, 85, 51, 83,227,169, 9,212,150,171, 85,170,157, 80,235, 83,
+ 27, 83,103,169, 59,168,135,170,103,168,111, 84, 63,164,126, 89,253,137, 6, 89,195, 76,195, 79, 67,164, 81,160,177, 95,227,188,
+198, 32, 11, 99, 25,179,120, 44, 33,107, 13,171,134,117,129, 53,196, 38,177,205,217,124,118, 42,187,152,253, 29,187,139, 61,170,
+169,161, 57, 67, 51, 74, 51, 87,179, 82,243,148,102, 63, 7,227,152,113,248,156,116, 78, 9,231, 40,167,151,243,126,138,222, 20,
+239, 41,226, 41, 27,166, 52, 76,185, 49,101, 92,107,170,150,151,150, 88,171, 72,171, 81,171, 71,235,189, 54,174,237,167,157,166,
+189, 69,187, 89,251,129, 14, 65,199, 74, 39, 92, 39, 71,103,143,206, 5,157,231, 83,217, 83,221,167, 10,167, 22, 77, 61, 58,245,
+174, 46,170,107,165, 27,161,187, 68,119,191,110,167,238,152,158,190, 94,128,158, 76,111,167,222,121,189,231,250, 28,125, 47,253,
+ 84,253,109,250,167,245, 71, 12, 88, 6,179, 12, 36, 6,219, 12,206, 24, 60,197, 53,113,111, 60, 29, 47,199,219,241, 81, 67, 93,
+195, 64, 67,165, 97,149, 97,151,225,132,145,185,209, 60,163,213, 70,141, 70, 15,140,105,198, 92,227, 36,227,109,198,109,198,163,
+ 38, 6, 38, 33, 38, 75, 77,234, 77,238,154, 82, 77,185,166, 41,166, 59, 76, 59, 76,199,205,204,205,162,205,214,153, 53,155, 61,
+ 49,215, 50,231,155,231,155,215,155,223,183, 96, 90,120, 90, 44,182,168,182,184,101, 73,178,228, 90,166, 89,238,182,188,110,133,
+ 90, 57, 89,165, 88, 85, 90, 93,179, 70,173,157,173, 37,214,187,173,187,167, 17,167,185, 78,147, 78,171,158,214,103,195,176,241,
+182,201,182,169,183, 25,176,229,216, 6,219,174,182,109,182,125, 97,103, 98, 23,103,183,197,174,195,238,147,189,147,125,186,125,
+141,253, 61, 7, 13,135,217, 14,171, 29, 90, 29,126,115,180,114, 20, 58, 86, 58,222,154,206,156,238, 63,125,197,244,150,233, 47,
+103, 88,207, 16,207,216, 51,227,182, 19,203, 41,196,105,157, 83,155,211, 71,103, 23,103,185,115,131,243,136,139,137, 75,130,203,
+ 46,151, 62, 46,155, 27,198,221,200,189,228, 74,116,245,113, 93,225,122,210,245,157,155,179,155,194,237,168,219,175,238, 54,238,
+105,238,135,220,159,204, 52,159, 41,158, 89, 51,115,208,195,200, 67,224, 81,229,209, 63, 11,159,149, 48,107,223,172,126, 79, 67,
+ 79,129,103,181,231, 35, 47, 99, 47,145, 87,173,215,176,183,165,119,170,247, 97,239, 23, 62,246, 62,114,159,227, 62,227, 60, 55,
+222, 50,222, 89, 95,204, 55,192,183,200,183,203, 79,195,111,158, 95,133,223, 67,127, 35,255,100,255,122,255,209, 0,167,128, 37,
+ 1,103, 3,137,129, 65,129, 91, 2,251,248,122,124, 33,191,142, 63, 58,219,101,246,178,217,237, 65,140,160,185, 65, 21, 65,143,
+130,173,130,229,193,173, 33,104,200,236,144,173, 33,247,231,152,206,145,206,105, 14,133, 80,126,232,214,208, 7, 97,230, 97,139,
+195,126, 12, 39,133,135,133, 87,134, 63,142,112,136, 88, 26,209, 49,151, 53,119,209,220, 67,115,223, 68,250, 68,150, 68,222,155,
+103, 49, 79, 57,175, 45, 74, 53, 42, 62,170, 46,106, 60,218, 55,186, 52,186, 63,198, 46,102, 89,204,213, 88,157, 88, 73,108, 75,
+ 28, 57, 46, 42,174, 54,110,108,190,223,252,237,243,135,226,157,226, 11,227,123, 23,152, 47,200, 93,112,121,161,206,194,244,133,
+167, 22,169, 46, 18, 44, 58,150, 64, 76,136, 78, 56,148,240, 65, 16, 42,168, 22,140, 37,242, 19,119, 37,142, 10,121,194, 29,194,
+103, 34, 47,209, 54,209,136,216, 67, 92, 42, 30, 78,242, 72, 42, 77,122,146,236,145,188, 53,121, 36,197, 51,165, 44,229,185,132,
+ 39,169,144,188, 76, 13, 76,221,155, 58,158, 22,154,118, 32,109, 50, 61, 58,189, 49,131,146,145,144,113, 66,170, 33, 77,147,182,
+103,234,103,230,102,118,203,172,101,133,178,254,197,110,139,183, 47, 30,149, 7,201,107,179,144,172, 5, 89, 45, 10,182, 66,166,
+232, 84, 90, 40,215, 42, 7,178,103,101, 87,102,191,205,137,202, 57,150,171,158, 43,205,237,204,179,202,219,144, 55,156,239,159,
+255,237, 18,194, 18,225,146,182,165,134, 75, 87, 45, 29, 88,230,189,172,106, 57,178, 60,113,121,219, 10,227, 21, 5, 43,134, 86,
+ 6,172, 60,184,138,182, 42,109,213, 79,171,237, 87,151,174,126,189, 38,122, 77,107,129, 94,193,202,130,193,181, 1,107,235, 11,
+ 85, 10,229,133,125,235,220,215,237, 93, 79, 88, 47, 89,223,181, 97,250,134,157, 27, 62, 21,137,138,174, 20,219, 23,151, 21,127,
+216, 40,220,120,229, 27,135,111,202,191,153,220,148,180,169,171,196,185,100,207,102,210,102,233,230,222, 45,158, 91, 14,150,170,
+151,230,151, 14,110, 13,217,218,180, 13,223, 86,180,237,245,246, 69,219, 47,151,205, 40,219,187,131,182, 67,185,163,191, 60,184,
+188,101,167,201,206,205, 59, 63, 84,164, 84,244, 84,250, 84, 54,238,210,221,181, 97,215,248,110,209,238, 27,123,188,246, 52,236,
+213,219, 91,188,247,253, 62,201,190,219, 85, 1, 85, 77,213,102,213,101,251, 73,251,179,247, 63,174,137,170,233,248,150,251,109,
+ 93,173, 78,109,113,237,199, 3,210, 3,253, 7, 35, 14,182,215,185,212,213, 29,210, 61, 84, 82,143,214, 43,235, 71, 14,199, 31,
+190,254,157,239,119, 45, 13, 54, 13, 85,141,156,198,226, 35,112, 68,121,228,233,247, 9,223,247, 30, 13, 58,218,118,140,123,172,
+225, 7,211, 31,118, 29,103, 29, 47,106, 66,154,242,154, 70,155, 83,154,251, 91, 98, 91,186, 79,204, 62,209,214,234,222,122,252,
+ 71,219, 31, 15,156, 52, 60, 89,121, 74,243, 84,201,105,218,233,130,211,147,103,242,207,140,157,149,157,125,126, 46,249,220, 96,
+219,162,182,123,231, 99,206,223,106, 15,111,239,186, 16,116,225,210, 69,255,139,231, 59,188, 59,206, 92,242,184,116,242,178,219,
+229, 19, 87,184, 87,154,175, 58, 95,109,234,116,234, 60,254,147,211, 79,199,187,156,187,154,174,185, 92,107,185,238,122,189,181,
+123,102,247,233, 27,158, 55,206,221,244,189,121,241, 22,255,214,213,158, 57, 61,221,189,243,122,111,247,197,247,245,223, 22,221,
+126,114, 39,253,206,203,187,217,119, 39,238,173,188, 79,188, 95,244, 64,237, 65,217, 67,221,135,213, 63, 91,254,220,216,239,220,
+127,106,192,119,160,243,209,220, 71,247, 6,133,131,207,254,145,245,143, 15, 67, 5,143,153,143,203,134, 13,134,235,158, 56, 62,
+ 57, 57,226, 63,114,253,233,252,167, 67,207,100,207, 38,158, 23,254,162,254,203,174, 23, 22, 47,126,248,213,235,215,206,209,152,
+209,161,151,242,151,147,191,109,124,165,253,234,192,235, 25,175,219,198,194,198, 30,190,201,120, 51, 49, 94,244, 86,251,237,193,
+119,220,119, 29,239,163,223, 15, 79,228,124, 32,127, 40,255,104,249,177,245, 83,208,167,251,147, 25,147,147,255, 4, 3,152,243,
+252, 99, 51, 45,219, 0, 0, 0, 6, 98, 75, 71, 68, 0,255, 0,255, 0,255,160,189,167,147, 0, 0, 0, 9,112, 72, 89,115, 0,
+ 0, 13,213, 0, 0, 13,213, 1, 61,214, 88,241, 0, 0, 0, 7,116, 73, 77, 69, 7,220, 3, 15, 13, 43, 47, 99,146, 79, 17, 0,
+ 0, 32, 0, 73, 68, 65, 84,120,218,236, 93,119,120, 20,197, 3,125,187,183,215,239,114,233, 61, 16,146, 64, 32,148,132, 80, 20,
+144, 94, 5,162,168, 8, 2, 34, 69, 44,136, 40,160, 40,168,136, 72, 87,233, 42, 32, 42, 77, 65,176, 1, 1, 41,145, 18, 72, 2,
+132, 38, 61, 65, 18, 72, 35,237, 82,175,183,221,223, 31,201,157,151,203,181, 64,162, 63,116,223,247,237,119,119,123,187,111,103,
+103,103,102,223,188,105, 0, 11, 22, 44, 88,176, 96,193,130, 5, 11, 22, 44, 88,176, 96,193,130, 5, 11, 22,255,106, 36, 38, 38,
+ 50, 13, 56,124,160,187,156,181, 91,159,255,119,206, 38,188,119,166, 17, 57,251,212,114,126,244,144,132,179,207,255, 43,167,249,
+126, 27,192, 59,176, 33,233,168,177,226,211, 42,156, 76, 99,135,179,169, 56, 27, 43, 31,217, 9, 39,211, 4,207,253,163,135, 36,
+156,125,254,223, 56,109,211,143,155,188, 13,226,116, 51, 77, 53, 52,156, 76, 99,135,179,169, 56, 31, 52, 31, 57, 9, 39,243,160,
+105,201,193,179,255, 8,255, 33, 80, 77, 40,178,220, 70, 66, 66, 2, 97,197, 79,252,191,114, 90,199,131,153,191, 49,195,218,136,
+ 56,222,216,156, 54,241,217, 88,248, 40, 33, 33,129, 72, 76, 76, 60, 1,160, 79, 99,222,123, 99, 60,119,155,123,109, 20,222,251,
+ 16, 89, 13,226,108,172,116,223,212,156,141,149,151,108, 57, 27, 35,221,219,123,238, 77,248,140, 26, 43,156,141,146,151,154, 34,
+205,219, 73, 63, 15,204,107,203,217, 24,121,201,150,179, 49,210,253,223,193,217, 24,121,201, 30,103, 99,164,123, 71,207,254,191,
+102, 80,145,255,176, 32,176,205,224,125,255,159, 5, 81, 83,137,205, 6, 56, 48,255, 56,103, 35, 63,163,143,106, 57, 27,179,118,
+211,183,177,158, 81, 83,164,119,107,206,198,226,183,229,105,140,231,100,143,243, 65,195,235, 32,156,141,126,239, 15,154,238,255,
+ 46,206, 70,126, 70,141,146,151,108, 56,251, 54,114,101,160,175,213,239,143, 26,147,179,177,242,146,157,112, 62,240,115,178,199,
+249,160,225,117, 16,206, 70,191,247,198,120,135, 52, 21,239,191, 26, 77,213,124,214,216,156, 13,228,254, 87,113, 54,176,121,102,
+ 96, 19, 60,251,127, 52,156,141,201,105, 27,198,198,108,238,105,202,112, 54, 38,103, 3,194,250,175,227,124,216,158,251,255, 99,
+124, 58,226,123,144,102, 41, 71,238,104, 83,132,179, 49, 57,221,228,254, 87,112, 62,192,179,255,215,129,250,127, 9,136, 57,226,
+ 27,185,102,130, 70,118, 96,154, 82,184, 54,102, 56,251, 54,133, 67,216, 4,104,244,112,214,214,148,231, 55,193,189, 63, 44,113,
+202,230, 37, 54, 47,253,223,229, 37,155, 52,217,183, 17,157,162, 70,117,158,109, 57, 27,227, 26,214, 28,141,149, 70,155,250,222,
+ 27, 51, 47, 53,197,179,103,241, 0, 46, 4,203,201,114,178,156, 44, 39,203,201,114,178,156,255, 89,206,127, 37, 72, 54, 10, 88,
+176, 96,193,130, 5, 11, 22, 44, 88,176, 96,193,130, 5, 11, 22, 44, 88, 60, 84,112,216,190, 27, 18, 18,146, 40, 22,139, 91, 58,
+250, 95,169, 84,222,187,119,239, 94, 63, 54, 10,255, 57,176,207,136,197, 67, 4, 18,127, 57,232, 52, 0,166,118, 99,193,130, 5,
+139,127, 53, 28,118,134, 23, 8, 4,145, 55,110,220,136,166,105, 26, 38,147, 9, 70,163,209,242,169,211,233,208,187,119,239, 6,
+119,164, 15, 12, 12, 76,230,112, 56, 45, 26,114,142,201,100,202, 41, 42, 42,234,233,228,144, 84, 0,145, 4,241,151,102, 52,127,
+119,244, 9,160,192, 96, 48,116,114,198, 73, 16, 68,164, 45,159, 3, 46,243,119,167,156,158,158,158,231, 40,138, 10,179,199,229,
+232, 59, 77,211, 89, 37, 37, 37, 61,254,206,103,244, 95, 70, 96, 96, 96, 50, 69, 81, 13, 78,159,133,133,133, 14,211,103,112,112,
+240, 69,146, 36, 67, 26, 64,201,161,105, 58,227,222,189,123, 61,157, 8,145, 84, 0,145, 78,107, 80, 54,233,137, 32,136, 60,147,
+201,212,197, 85, 62,114,198,101, 39,141,186,226,180,136, 44,138,162,150, 5, 4, 4, 76, 85,169, 84, 26, 0, 12,135,195, 97,172,
+194, 6, 0, 48, 26,141, 37, 21, 21, 21, 29,216,148,200,130, 5,139,255,132,208,162,105,154,212,106,181,200,204,204, 4,195,216,
+ 45,239, 77,247,113,189,232,243,191, 31, 9,240, 8, 8,132, 81,175,135,196,207,223,194, 93,116,253, 42,140, 6, 61,140, 58, 29,
+154,119,237,102, 14, 3,218,182,109,203,113,193, 25,182,124,249,242, 0, 15, 15, 15,104, 52, 26,104, 52, 26,104,181, 90,104, 52,
+ 26,232,116, 58,232,116, 58,232,245,122,232,245,122, 24,141, 70,104,181, 90, 36, 37, 37,153, 12, 6,131, 83,206,197,139, 23, 7,
+200,100, 50, 11,159,121, 51,115,154,121, 13, 6, 3, 52, 26, 13,142, 30, 61,234,148,147,162,168,176,130,130,130, 0, 30,143, 7,
+134, 97, 64,211, 52, 24,134,169,179,217, 34, 42, 42, 74,239, 44,144, 77,244,140,254,203,136, 94,188, 99,127,128,167, 72, 0, 35,
+ 77, 35, 33, 46,202,242, 71,214,215,187,193, 24, 77,160,141, 70,180,122,125,188,101,127, 76, 76,140,211,244,201, 48, 76,248,226,
+ 29,251,189,220,229,148,203,229,234, 54,109,218, 20,160,198,109,118, 36,180,194,212,106,117, 64, 45,127, 61, 65, 68,146,100,157,
+237,208,161, 67, 72, 72, 72,112,117,239, 97, 51,103,206, 12, 48, 24, 12,208,233,116,208,106,181, 48, 24, 12, 48, 26,141,150,205,
+100, 50, 89, 54,157, 78,135, 51,103,206,184,235,100, 45, 31, 52,104,208,228,253,251,247, 75,126,253,245, 87, 73,139, 22, 45,192,
+227,241,192,225,112,192,225,112, 64,146, 36, 40,138,194,163,143, 62, 74,176, 73,144, 5, 11, 22,255, 25,161,165,213,106,179,227,
+227,227,153,218,239,161, 2,129,128,103, 83,203, 13,105,213,170, 85,134,237,121,174,154,171, 60, 2, 2, 49,183,153, 15, 0,224,
+195,187,114,203, 11,226,147, 30, 29, 45,199,124,156, 95, 9, 0, 16,137, 68, 32,172,171,209, 14, 32,145, 72, 48,104,208, 32,240,
+249,124,116,233,210, 5, 92, 46,215,238,198,227,241,192,229,114, 93, 70, 10, 65, 16,144, 74,165, 88,176, 96,129, 89, 36, 65, 34,
+ 20, 96,122,143, 46, 16,130,193, 87, 87,111, 65, 71, 51,160, 40,202,178,185,195,201,227,241,112,229,202, 21, 80, 20, 5, 14,135,
+ 99,249, 52,127,223,187,119, 47,158,125,246, 89, 80, 20, 5,145, 72, 4,184,152, 57,216,250, 25,233,116,186, 96, 62,159,175, 7,
+ 96, 22,103, 60,130, 32,130,238,231, 25,253,151,225, 41, 18, 96,194,250, 95, 0, 0,185,171, 94,183, 60,187, 51,175,125,104, 57,
+ 38,252,229,209, 32, 8, 2, 92, 46, 23, 36, 73, 54, 26,103, 89, 89,153,122,204,152, 49,167, 60, 60, 60, 14, 85, 85, 85,193,133,
+128, 67,110,110, 46, 40,138,114,152,222, 73,146,196,202,149, 43,241,231,159,127,186,117,239, 26,141, 6,155, 54,109,130,201,100,
+170,195,107,254,110,187,207, 77,145,181,104,240,224,193,227,247,239,223,239, 77, 16, 4, 62,255,252,115,240,120, 60, 12, 27, 54,
+ 12,190,190,190, 56,124,248, 48,120, 60, 30,222,121,231, 29, 54,241,177, 96,193,194, 89,153,199, 5,208, 17,128,127,173,137, 80,
+ 13,192,203,234,144,146,218, 79,127,243,111,130, 32,210,237,240,116,173, 61,166,132, 32,136,116,171,223, 58, 0,124, 59,251,229,
+ 0, 68,181,155, 22, 53,238,127,123,171,235,152,207,131,163,235, 82, 64,205,250, 67, 0,142, 3,232,155,144,144,112, 2, 0, 10,
+ 11, 11,135, 22, 22, 22, 2, 0, 34, 35, 35,111,100,100,100,180, 49,107,158,218,230, 41,158,209,104,140, 54, 55, 85,153,221,162,
+129, 3, 7, 58,173,225, 27,245,250,122, 2,196,158,150,178,215, 92,225, 72,192,232,245,122,140, 30, 61, 26, 0, 28,190,116,172,
+ 55, 55,180, 27,116, 58, 29, 40,138, 66,235,102,254,152, 55, 36, 30,143, 48, 6, 40, 21, 4,140,149, 74,140,144, 26,112,163,109,
+ 39,108,204, 41,193,221, 42, 5, 40,138,114,139,147,166,105,135, 34,139,195,225, 96,253,250,245, 24, 51,102, 12, 56, 28,142, 91,
+124,214,207, 40, 34, 34, 98,127, 70, 70,134, 47, 65, 16,218,218,103, 36, 48, 26,141, 50,163,209,232,107, 50,153,124, 27,242,140,
+254,203, 48,210,180,221,116,232, 40,205,186,243,156,220,225, 44, 43, 43, 83, 39, 36, 36,156, 22, 8, 4, 91, 3, 3, 3, 11,242,
+242,242, 92, 10, 45, 91,241, 99, 91,169, 88,177, 98, 5,214,174, 93,139,126,253,250,185, 21, 78,173, 86, 11,130, 32,176,113,227,
+198,122,255, 45, 92,184,176,222,245, 92,112, 18, 0,200,144,144,144,215, 14, 30, 60, 40, 51, 31,235,231,231, 7, 46,151,139, 14,
+ 29, 58,192,195,195, 3,167, 78,157,130,201,100,114, 59, 95,178, 96,193,226,223, 11,123, 90,196, 10,189,231,206,157,219,101,217,
+178,101, 75,186,119,239,190, 51, 53, 53,117, 7, 65, 16,137, 86,101, 98, 66,109,249,154,104,254,205, 48, 76, 87,107,209, 83, 43,
+214,252, 9,130, 72, 52, 31,111,253,219,252,201, 48,204, 64, 0,124,243,239,185,115,231,182, 95,182,108,217,146, 57,115,230,188,
+183,116,233, 82,222,220,185,115, 99,151, 45, 91,182,196,124, 29,123,225,176,231,104, 57, 93,123,202,220, 68,117,243,230, 77, 71,
+ 77, 84,214, 47, 0,167,165,165,196,207,223,226,100,125, 28,238,107,217,191, 32,175,194,242, 2, 91,215,185, 37, 36, 18, 9,134,
+124,252,169, 91, 78,145, 78,167, 67,113,113,177,197,101,112,181,185,203, 41, 22, 9,145, 52,179, 3,114,229,124,124,148, 86,134,
+253,151,254, 4,151,203,197,227,109, 59, 96, 40,207, 3, 31,132,243, 49,243,214, 29, 24, 24,247,250,244, 50, 12, 99, 87, 96,153,
+191,155,155, 80,220, 21, 90, 54,207, 40, 87,163,209,200, 51, 51, 51,213,116,205,139, 93,196, 48,140, 55, 65, 16,213,181, 46, 87,
+176,187,207,232,191,140,132,184, 40,139,235,116,198, 99,128,101,255,179,202, 43,150,103,242,214,250, 79, 0, 0,253, 58, 61,234,
+ 50, 63,184,195, 41,151,203,213, 61, 7,244, 61, 97, 82,235,182,140, 31, 63, 62,251,216,177, 99, 34,119,194,106, 79,104,153, 93,
+ 91,179,200,162, 40, 10, 58,157,206,173,123,215,233,116, 14,243, 7,143,199,187, 31, 71, 11, 74,165, 82,183,103,207, 30,172, 91,
+183, 14,190,190,190, 24, 60,120, 48,130,131,131,177,123,247,110, 48, 12,131,215, 95,127, 29, 34,145,200,236, 94,179, 9,144, 5,
+139,255, 54,156,105, 17,193,178,101,203,150,216, 10, 25,235,223,214, 2,202, 70, 76, 89,139,181,246, 46,222,255,137,182,226,201,
+124, 93,130, 32, 18,151, 46, 93,154,224, 34, 28, 37,142,132,150,211, 41,241,181, 90,109,118, 92, 92,156, 91,106, 66,165, 82, 21,
+186, 18, 27,246,106,245,214, 46,129, 84, 42,133, 68, 38, 5,233,102,185,107, 48, 24, 44, 66,229,200,145, 35, 16,137, 68, 24, 54,
+108,216, 3, 57, 90,122,189, 30,124, 30, 23,164, 95, 32, 38,172, 58, 6,121,181,218,242,130, 57,158,149,141, 11, 69,197,152,217,
+125, 0, 36,162, 98, 40,116, 58,183,156, 55,154,166,235,137, 44,138,162, 48,122,244,104,139,155, 96,221,111, 5, 78,154, 14,125,
+125,125,207, 81, 20, 21,102,245,140,132,145,145,145,192, 95,253,122, 8,154,166, 21, 94, 94, 94, 63, 3, 8, 97, 24, 38, 12,128,
+135, 59,207,136,133,253,244,105,187,159,182,113,170,238,135, 83, 46,151,171, 19, 18, 18, 78,155,212,186, 45,249,249,249,167, 1,
+ 8, 31,121,228,145, 6, 11, 45,179,192,226,114,185, 88,185,114, 37,214,174, 93,107,249,223, 93,161,101, 52, 26,235, 8,168, 91,
+183,110,213,185,150,173,176,115,209,108,202,160,102,116, 33, 29, 25, 25,105, 57, 39, 40, 40, 8, 94, 94, 94,160,105, 26, 52, 77,
+ 67, 40, 20, 66, 36, 18,129,199,227,177,137,142, 5, 11, 22,206,180,136,122,206,156, 57,239, 17, 4,145, 88,235, 44, 93,117, 34,
+168,236,105,143,174, 54, 98,173,196,193,113, 9,246,196,150,245,119, 51,230,206,157,219,222, 54, 28,246,154, 43, 45,165,170,205,
+180,251,117, 96,221, 68,213, 88, 47, 49,103, 47, 50,169,151, 12, 34,137, 4, 28, 14, 9,130, 32, 24, 87, 92,122,189,222, 82,240,
+ 79,157, 58,213,105,191, 21,119,251, 83,233,245,122,144, 20, 7,247,130, 34, 96, 34, 79, 90,206, 53,111, 36,197,197,221,160, 54,
+224,220,188, 8,174,155, 47, 92, 91, 71,235,245,215, 95,199,166, 77,155, 64,146,164, 37, 78, 40,138, 66,171, 86,173,144,157,157,
+237,148,139,162,168,176,187,119,239, 6, 88,199,163, 89,196, 50, 12, 3,147,201,132,168,168, 40, 77,102,102,230,155,108,214,125,
+ 48,145,229,104,191,201, 68,187,237,194,216, 59, 78, 46,151,171, 71,141, 26,117,162,178,178,114, 75,187,118,237,110,161,238, 20,
+ 8, 46,249, 40,138,170, 35,176,204, 34,107,205,154, 53,117, 68,145,193, 96,112,171, 34, 96, 48, 24,234, 9,158,207, 62,251,172,
+206, 39, 0,244,232,209,195, 45,103, 24, 0, 67,146, 36,195,227,241, 48,104,208, 32,196,198,198,226,215, 95,127, 5, 77,211,152,
+ 54,109, 26, 68, 34, 17, 86,175, 94, 13,163,209,136,229,203,151,179,142, 22, 11, 22, 44,156,105, 17,237,210,165, 75,175, 46, 93,
+186,212,226, 44,217, 58, 90, 14,222,187,195,107, 69,149,191, 89,164, 1,208,218, 19, 68,246, 92, 50, 91, 1,102,189,111,217,178,
+101, 75,108,195, 97,219, 92, 89, 71,104,253, 93, 40,188,118, 5,159, 62, 22, 15,160,110,115,225,250, 71,219, 64, 34,149, 64,226,
+ 33,197,168,189, 39, 1,160,182,208,159,227,150,163,101, 22, 90,114,185,220,169,200,106,136,163, 69,242, 41,252, 24, 86, 14,134,
+207, 5,165, 51,212, 17, 90, 28,138,139, 92,223, 8,144, 92, 30, 40,147,209, 45, 78,134, 97,234, 53, 21, 78,156, 56, 17, 4, 65,
+ 88, 70,136,197,197,197, 89,115, 17,174, 94,142,179,125,106,250,224,217, 54,199, 46, 47,213,176, 57,246,126,210,231,185,175,113,
+227,167,215, 0, 0, 61,149, 74,203,179, 88, 28,247,215,216,129, 85, 87, 78, 88,220,199,143,241,246,125,113,202,229,114,245, 35,
+ 49,237, 79,243,124, 60,183,228,228,228,156, 6, 64, 62,247,220,115, 94,113,113,113,110,229, 73,243,224, 10, 91,145,101,237,100,
+153, 63, 93,140,176,181, 18,142, 38,183, 4,148,185, 25,209,141, 52,207,152,211,182, 76, 38,131, 84, 42,181,140,184, 21, 10,133,
+ 16,139,197,150,254,157,110, 10, 55, 22, 44, 88,252,119,225,109, 22, 58,181, 98,169,142,211, 84,219,183, 42,193,250,183, 61,199,
+171,214,129, 74,118, 81,190,238,175, 21,104,118, 97,118,214,108,206, 73,116, 36,210, 40,179,130,180,254, 12, 10, 10,250, 77, 42,
+149, 70,184,123,247, 13, 25,197,102, 50,232,235, 57, 91, 4, 65, 64,234, 33,133, 72, 42,129,200, 67,234,208,245,114, 38,180,204,
+ 78,145,249,165,179,117,235, 86, 72,165, 82, 76,154, 52,169,193,125,180, 44, 66,139, 71,226,176,224, 40, 56,124,170,142,200,162,
+ 40, 10, 28, 46, 23,133,210, 96,144, 92, 46, 40,163,123, 46, 89,101,101, 37, 40,138,194,188,121,243, 44, 53,120,107,145,213,144,
+123,118, 6,146, 32,204,238,150,160,101,203,150,111, 19, 4, 17, 14,160,133, 82,169, 20,220,187,119,175, 63,155, 95,157, 40, 3,
+147,161,158, 11,229,200,125,189, 95, 78,179,147,197,243,241,220,210,166, 77, 27,139,147, 37, 22,139,205,163, 77, 93, 63, 99,146,
+180, 43,178,108, 71, 8, 82, 20, 85,147,150, 93,140,142,180,118,180,150, 46, 93,106,225,181,118,178,204,104, 72, 62, 50,135,245,
+196,137, 19,184,112,225, 2,166, 78,157, 10,145, 72,132,181,107,215,194,104, 52, 98,225,194,133, 16,137, 68,224,243,249,108,226,
+ 99,193,130,117,179,234,104, 17, 27,148,216,244,131, 34,108, 68, 77,137, 61,129,101,221, 76,104,254, 78, 16,132,193, 14,175,206,
+166, 73,209,118,191,249, 83,190,116,233,210, 99,102, 39,203,106,127,157,112,184,116,180, 4, 2, 65, 68,102,102,166,101, 34, 76,
+103,159, 58,157, 14,253,250,245,115,219, 25, 51,143, 58,164, 40, 78, 29, 97, 33,246,144, 66, 44,243,128, 72, 42,181, 21, 28,132,
+171, 66,220, 92, 35,182, 22, 90,243,231,207, 7, 69, 81,216,180,105, 19, 0,224,237,183,223,118,187,143,150,153, 19, 38, 2,121,
+204,109,196,175,122, 22,186,239, 12, 40, 74,249, 3, 20, 69, 33,160,219, 80,208,143, 60, 11,149, 72, 10,202,100,116,123,212, 97,
+ 89, 89, 25,178,179,179,193,225,112, 48,107,214,172, 58,115, 29,217,142,100, 59,114,228,136,203,123,183,231,100,205,207, 41,179,
+240,136, 68, 34,242,143, 63,254,136,160,105, 58, 82,173, 86,183,236,209,163, 7,205,102,101, 23,162,136, 54,186, 37,170,220, 77,
+159,182,156,230, 62, 89,149,149,149, 91,114,114,114,206, 0, 32,199,143, 31,239, 37, 22,139,241,205, 55,223,168, 0,240,119,239,
+222, 45,114, 37,138,204,233,198,149,200,226,114,185, 53,105,217,157,123,103,234, 78, 89,226,170, 99,188, 59,105,222, 28, 86,130,
+ 32, 96, 50,153, 32, 18,137,234, 56, 89, 66,161, 16, 2,129,128, 77,120, 44, 88,176,112, 85,150,164,187, 93,142, 51, 76, 87, 43,
+ 81,149,126, 63,188, 13,185,158, 43, 80,142,132,134, 86,171,197,245,235,215,221,229,113,123, 98,204,102, 93, 30,197,199,249,149,
+ 32, 8, 2, 95,245,104, 7,137, 76, 10,177, 68,130,145,191,158,176, 20,220, 87,150,188, 13,129, 68,138,144, 94,131,221, 42,200,
+205, 77,135,214, 66,171,162,162, 2, 92, 46, 23,139, 22, 45, 2, 73,146, 88,190,124, 57, 66, 67, 67,113,239,222, 61,236,222,189,
+219, 45, 71,139, 99,226, 32,248,133, 24,136, 39,122, 66,246, 66,111,120, 15,154,143,124, 29,133, 84,141, 24,189, 53,215,192, 63,
+188, 6, 58,218,228,246, 8, 44,163,209,136, 19, 39, 78,216,118,120,183,244,169, 50, 26,141, 48, 24, 12,208,235,245, 88,190,124,
+185, 59, 35, 60,235, 61, 55,115, 28,214, 78,130,202,201,200,200,240,103, 24,198, 7,128, 39,128, 82, 54,187, 58, 71,112,183,215,
+225,223,229, 85, 0,192,222,165, 47, 90,246,207,187,242, 87,250, 92,249, 93,205, 2, 0,109, 90, 12,110, 16,167, 92, 46, 87, 63,
+222,175, 71,178,134,230,110,238,208,161, 67, 29, 39, 75, 40, 20, 18,181,191,221,178,203, 72,146, 4,135,195,169,215, 92,232, 72,
+108,185,211, 71,203,104, 52, 90, 38, 18,117,214,159,241,126, 28,173, 23, 95,124, 17,193,193,193, 22, 39,235,227,143, 63,134, 72,
+ 36,194,220,185,115, 97, 48, 24,176,102,205, 26, 54,241,177, 96,193,226,111, 23,101,127, 7,236,150,164, 26,141,230, 78,108,108,
+ 44, 28,252, 23, 42, 20, 10,185, 54, 55, 21,210,170, 85,171, 12, 59, 77,136, 3, 1, 36,217, 43,212, 9,130,128,135,204, 3, 66,
+169, 4, 98, 27, 23, 75,232, 33,131, 64, 42, 5,201,179, 91,152,215,227, 52,247, 45,177, 22, 90,230,173,178,178, 18, 92, 46, 23,
+235,214,173,131, 76, 38,131, 86,171,117,201,105,126,233,112, 56, 28,168,114,171,113, 99, 73, 18,248,194, 84,180, 28, 60, 6,193,
+ 92, 17,120,167,126,134,218,100,112, 53, 97,105, 61,206,232,232,104,124,248,225,135,245,166,117,112,132,208,208, 80,151,247,110,
+235,100,173,108,215, 28, 60, 62, 15,111, 93,203,133, 86,171, 37,198,140, 25, 67, 3, 80, 3, 40, 81,171,213, 57,238,196,103, 35,
+224,161,231,116, 54, 42,214, 12,154, 49,217, 19, 48,118, 57,205, 78,150,134,230,110,206,206,206, 54, 59, 89,158, 98,177, 24, 27,
+ 54,108, 80, 1, 32, 23, 46, 92, 40, 14, 15, 15,231,184,147,150, 56, 28, 14, 86,173, 90,101,183, 79,150, 61,209,213,144,124,100,
+125,110,159, 62,125,236, 78, 88,234, 64,188,213,227, 52,135,213,215,215,215,226,100,153, 76, 38,203,104, 67,243,236,243, 78, 42,
+ 21,108,250,100, 57, 89,206,255, 14,231,191, 18,118, 75,224,123,247,238, 61,238,232,132,168,168,168,204,204,204,204, 86,230,165,
+ 56,106, 11, 78,158, 70,163,137,238,209,163,135, 75,107,135,166,105, 8, 4, 2, 48, 12,131,254, 31, 46, 3, 65, 2, 36,234,190,
+196, 2, 30, 27, 0, 14,135, 2, 93,179,212,135,203, 81,135,106,181,186,206,203,193,222,166, 80, 40,160,213,106,221,158,205, 91,
+163,209,212,153,130,129, 96,104,220,253,125, 87,189,209,135,230,205,221,126, 59, 66,161,176, 78,211,143, 11,199,138,112,199,209,
+178,110,122,228,241,121,160,120, 92,179,163, 85,125,235,214,173, 81,108, 50,119, 31,230, 1, 11, 0,208,186,199, 48,208,180, 9,
+140,201, 84,103,153,164,152,136,199, 65, 51, 38,232, 13, 42,104,181, 90, 87,211,158, 16,165,165,165,234, 81,163, 70,157, 0,240,
+237,136, 17, 35, 50, 80, 51,187, 48, 35,149, 74, 5, 92, 46,151, 6, 80, 6,128, 41, 47, 47,247,204,207,207,167, 53, 26, 77,115,
+ 87,225,220,191,127, 63,174, 95,191,142, 94,189,122,213, 89, 14,202,236,138, 90,207,238,238, 78,250, 52, 55,151,219,155, 17,222,
+145,144,115, 23, 28, 14, 7,158,158,158,224,241,120, 88,180,104, 17,120, 60, 30,196, 98, 49, 0, 96,205,154, 53,150,201, 87, 89,
+176, 96,193,226, 63, 35,180, 92,149,155, 78,154, 21,157, 54, 33, 26,141,198,188,240,240,240, 6, 93,204,100, 50, 21,185, 16,110,
+121,187,119,239,230, 89,187, 16,174, 62, 25,134, 41,114,241,178,205,219,187,119, 47,207,158,187,225,104,129,105, 87,156, 38,147,
+ 41,175, 69,139, 22, 14, 29, 19,123, 48, 24, 12,249,174, 68,235,178, 18,117, 29,145,240,214,181, 92,135,107, 39,178,112,153,214,
+156,164,207,247,239, 55,125,222,106,221,186,117,190,151,151,215,129,192,192, 64,121, 74, 74,138,111,215,174, 93,125,173,143,233,
+218,181,107,176,205,105, 58, 56, 94,231, 16, 4, 65,228,141, 24, 49,194,110,154, 55,139, 38, 59,233, 51,207, 85,154, 63,123,246,
+ 44,207,250,124, 71,252, 86,249, 40,207, 13,225,122, 55, 62, 62,158,180,230,113,148,246, 13, 6, 67, 9,155, 10, 89,176, 96,241,
+159, 23, 90,106,181, 58, 55, 54, 54,214,232,224,191, 28,103,231,202,229,242, 46,141,125, 3, 6,131,161,199,195,192, 89, 90, 90,
+218,168,247,110, 52, 26,243,106, 39, 40,117,122, 12,155,196,255,185,103, 4, 0,197,197,197,143, 0,128, 82,169,132,171,101,117,
+ 26, 32, 8, 27, 61,125, 26,141,198, 30, 77, 17,167,101,101,101,221,217,148,197,130, 5, 11, 86,104, 53, 0,236, 98,196,255, 31,
+104, 10,209,202,130, 5, 11, 22, 44, 88,176,104, 92,144,108, 20,176, 96,193,130, 5, 11, 22, 44, 88, 52, 13, 8,212,140, 28,176,
+135,134,140, 38, 24,120, 31,215, 78, 98, 57, 89, 78,150,147,229,100, 57, 89, 78,150,243, 63,199,233,138,155, 29,205,216,196, 2,
+140,229,100, 57, 89, 78,150,147,229,100, 57, 89,206,255, 30,231,191, 18,108,211, 33, 11, 22, 44, 88,176, 96,193,130, 69, 19,129,
+ 98,163,224, 31, 3, 7, 13,152, 81,223, 21, 24,134,241, 6,224,104,193, 56, 29, 65, 16,229,247,193, 73, 0,224,213,110,230,137,
+142, 12, 0,244, 0,244, 4, 65, 48,174, 57, 62, 34, 11, 10,188,219, 51, 38,110, 87,134, 32,184, 52,141, 75,205,155, 55,187, 72,
+ 16, 67,117, 0, 32, 9,140,105, 43,149,136, 6,106,245,186, 8, 1,151,127,189, 66,169, 56,162, 45,206,188,195, 38, 15, 22, 44,
+254, 17, 60, 1, 96, 1,106,186,149, 44, 5,176,139,141, 18, 22, 44,154, 72,104, 73,165,210,115, 36, 73,134,185,154,159,199,140,
+218,181,204,242,202,203,203,187, 52,224,218,163,164, 82,105, 63, 46,151,251, 24, 0, 24, 12,134, 20,133, 66,113, 12,192,110, 0,
+198,251,188, 39, 25,128,209, 0,198,213,254,254,190,182,176,168,186, 79,190, 88, 79, 79,207,159,184, 92, 46, 83, 90, 90,218, 13,
+ 0,124,125,125, 79, 27, 12, 6,162,170,170,106, 36,128,203, 13,228, 35,185, 92,238,202,110,221,186,245, 62,121,242,228,183, 0,
+214, 53,210,179, 20,144, 36,105, 87,160,208, 52,221,226, 62, 68, 22, 15,128,231,186,117,235,124,183,111,223, 30,159,151,151,215,
+ 1, 0,194,194,194,174,140, 31, 63,254,226,244,233,211,229, 12,195, 84, 18, 4,161,119,198, 83, 80,224,221,190,184, 48,107,106,
+ 81,241,245,209, 0, 16, 20,220, 97, 23,135, 67,242, 24,230,124,154,216,111,156, 95,171,150, 45, 94,221,249,205, 58, 94,139,136,
+102, 56,154,122,161,227,244, 55,223,107,159, 15,172, 96,197,214,223, 7, 15, 15,143,115, 36, 73,134, 57,203,227,246,242,188,201,
+100,202, 43, 43, 43,235,226,136,147,162,168, 48,103,229,133,189,125, 52, 77,103,149,150,150,218,157,106, 66, 38,147,165, 81, 20,
+ 21,225, 46,151,249,211,104, 52,230, 57, 26,165, 43,147,201,206,113, 56,156, 48,103,247,105,239, 63,154,166,179, 74, 74, 74, 28,
+133,179,222,189, 55, 70, 56,239,135,211, 89, 56,205,229, 17,128, 53,190,190,190,143,202,229,242,231, 1,188, 87, 85, 85, 21,199,
+225,112,224,227,227,243,158, 78,167,251,211,211,211,243,235,202,202,202, 84, 0,111, 2, 96,215, 75,101,193,162,177, 32,147,201,
+138, 20, 10, 5, 99, 6, 77,211,140,193, 96, 96,180, 90, 45,163, 86,171, 25,165, 82,201, 40, 20, 10,166,170,170,138,169,172,172,
+100,228,114, 57,227,239,239,111, 59,121,163,163, 54,220, 14, 50,153, 44,115,217,178,101,218,236,236,108, 70,175,215, 51,122,189,
+158,185,115,231, 14,243,233,167,159,106,101, 50, 89, 38,128, 14, 14,206, 29,232,160,176, 24, 4, 96, 71,124,124,188,110,255,254,
+253,140, 70,163, 97,148, 74, 37,179,107,215, 46,166, 93,187,118, 58, 0, 59,106,143, 33,221,228, 4,128,158, 65, 65, 65,121,183,
+111,223, 54, 29, 57,114, 68,239,233,233,153,228,233,233,153,116,231,206, 29,211,237,219,183,105, 63, 63,191, 60, 0, 61, 27, 16,
+ 78, 0,120,246,173,183,222, 42,186,115,231, 14,211,167, 79,159, 75, 86,251, 9,184, 94,231,110,160, 61, 39,139, 97,152, 32,134,
+ 97,130, 81, 51,201,101,189,141, 97,152,224,218, 99,188,221,228,148,100,101,101, 53, 11, 12, 12, 92, 70, 16,132,206,150,143, 32,
+ 8, 93, 96, 96,224,178,172,172,172,102, 12,195, 72,156,113,230,229,172,127,233,192,254, 1, 21,202,242,155,140,178,252, 38,243,
+237,230,190, 85,175, 76,127,126, 71,112, 84,167, 77, 94, 97,237,215, 93,191,121,107, 35,195, 48, 27,143,165,103,110,156,255,229,
+111, 27,159,158,190,122,131,111,120,252, 43, 13,136,207, 7, 1,203, 9,192,203,203,171, 80,169, 84, 50, 12,195, 48, 38,147,137,
+209,235,245,140, 86,171,101, 84, 42, 21,163, 80, 40,152,234,234,106, 75, 62,175,172,172,180,124, 15, 8, 8,112,152,223,189,189,
+189,139,212,106,117,157,178, 67,167,211, 89,202, 15,149, 74,197,168, 84, 42, 70,169, 84, 90, 54,133, 66,193,132,132,132,228, 58,
+ 9,231, 61,115, 56,105,154,102,140, 70, 35,163,215,235, 45,188, 26,141,166,206,166,213,106, 25,173, 86,203,132,135,135,187, 29,
+ 78,119, 56, 53, 26, 13, 19, 22, 22, 86,224,136,211,199,199,167, 72,163,209,212,225,180,190,127, 91, 94,243,239,160,160,160,194,
+134,112,186, 19, 78,103,241, 89,139,117, 25, 25, 25,140, 90,173,102, 66, 67, 67,229, 35, 71,142, 52,152, 76, 38,102,255,254,253,
+ 76,124,124, 60,221,183,111, 95,125,105,105, 41, 51,105,210, 36,198, 73,165,144,205, 71, 44, 39,139,251,113,180, 8,130,128, 68,
+ 34,193, 15, 63,252,224,112, 57, 14,235,239,205,155, 55,119,247,154, 93, 34, 34, 34, 78,156, 58,117, 74, 20, 28,252,215,132,216,
+ 58,157, 14,222,222,222,152, 54,109, 26,255,137, 39,158,104, 53,120,240,224,211,119,239,222,237, 3,224,156, 11,190,103,252,253,
+253, 63,159, 55,111, 94,224,115,207, 61, 7, 95,223, 58,147,110, 99,212,168, 81, 24, 57,114, 36, 47, 35, 35, 99,204,214,173, 91,
+199,172, 95,191,190, 80,161, 80, 76, 7,240,179, 51, 82,145, 72, 52, 34, 36, 36,100,195,169, 83,167, 2, 2, 2, 2, 16, 25, 25,
+ 73,190,243,206, 59,173,162,163,163, 69, 97, 97, 97,228,189,123,247,240,235,175,191,134,142, 29, 59,246,199,162,162,162, 87,245,
+122,253, 30, 55,238,157,239,235,235,251,222,171,175,190,234, 87, 85, 85,101, 60,127,254,124,166,121, 63,159,207, 95,216,189,123,
+247,174,199,143, 31,255, 14,192,215,247,227,100, 49, 12, 83,133,191,154,248,204, 48,152,255,119,199,217, 98, 24,134,127,233,210,
+ 37,159,238,221,187,255,172,213,106, 59, 77,157, 58, 53,103,201,146, 37, 34,153, 76, 38, 3, 64, 84, 85, 85,149, 47, 88,176, 64,
+183,122,245,234,119,219,182,109, 59, 32, 45, 45,237, 25,134, 97, 12,181,130,172, 62, 31, 65, 88,194,147,155, 95,130, 19,169, 52,
+255,195,185,111,135,125,178, 56,226,110,250,181, 92,154, 18,201,176, 47,249, 42,138,228, 10,252,150,118, 13, 65,190, 30, 4, 79,
+192,109,239, 25,218,174, 79,101,254,181,100, 56,153, 33,157, 69,227,128, 32, 8,136,197, 98,236,219,183,175,222,210, 85,246,150,
+181,162, 40, 10, 94, 94, 94, 46, 87, 55, 16, 10,133, 56,114,228,136,221,181, 23,237, 45,233,227,233,233, 9,103,149, 13,130, 32,
+ 32, 20, 10,145,146,146, 2,146, 36,237, 46, 13,100,187, 79, 34,145,128,116,178,214,149,153, 51, 57, 57,217, 37,151,249, 83, 42,
+149, 2, 53, 77,255,142, 51,165, 64,128, 83,167, 78, 57,188,103,219,239,210,218,245, 94, 93,113,166,164,164,212, 89,250,203,118,
+ 73, 48,235,223, 18,137, 4,132, 11, 82,111,111,239,110, 97, 97, 97, 56,123,246, 44,118,239,222,237,211,190,125,123,220,186,117,
+ 11, 4, 65, 96,201,146, 37, 68,187,118,237,184,133,133,133,232,213,171, 23,126,249,229,151, 30, 85, 85, 85,108,134, 97,241,143,
+128, 97, 24, 46,128,142, 0,252, 81,211,237,166, 26,128, 23,106, 86,210,224, 3,144, 3, 16,213,110, 90, 0, 10, 0,126,181,167,
+151,214,150, 45,214, 2,161,196,122,241,105,134, 97,186,214,114,155, 87,168,240,183, 58,214,124, 13,219,223,182,159,118,185, 41,
+ 0, 72, 76, 76, 52,191,204,250, 38, 36, 36,156,176,190, 57,119, 68,150,121,157, 50, 59,121,218,118,136,166, 64, 34,145,252,116,
+250,244,105,145,191,255, 95,247,160,213,106, 81, 93, 93, 13,133, 66,129,234,234,106,120,120,120, 96,247,238,221,162, 1, 3, 6,
+252, 84, 93, 93, 29, 93, 27,105,142, 56, 87,221,187,119, 47,208,104, 52,130,207,183,223, 69,137, 36, 73,196,196,196,224,189,247,
+222,195,144, 33, 67,130,250,245,235,183,202, 70,104,213, 27, 74, 42, 22,139, 55,156, 63,127, 62, 64, 44, 22, 35, 51, 51, 19,121,
+121,121,120,235,173,183,154,209, 52,141,220,220, 92,220,186,117, 11,249,249,249,216,186,117,107,192, 83, 79, 61,181,193,142,208,
+178, 55, 60,117,234,204,153, 51,219,120,123,123,147,159,126,250,105,133, 82,169,252,162,118,255,135,107,215,174,125,161,119,239,
+222, 1, 83,166, 76, 97, 82, 82, 82,182,215, 62, 56,135,241,105,221, 39,171,182,153, 15,181,137,239,134,205, 57, 49, 86,255,131,
+ 97,152, 32, 0, 90,130, 32, 42,236,112, 18, 0, 60, 7, 15, 30, 60, 75,171,213,118, 58,117,234,212,159,143, 61,246, 88, 56,128,
+123,230,196,231,233,233, 41, 89,181,106, 85, 96, 66, 66, 66, 70,255,254,253, 59, 13, 30, 60,120, 86, 73, 73,201, 18,134, 97, 74,
+172,250,108, 89, 56,105, 26,151,130,130, 59,236, 74, 78,155, 62,250,120,138,142,247,246,155,243,115,154, 55,107, 81,121, 41,179,
+204,116, 45,171, 4,213,106, 35,158,238, 95,179,128,121,183, 14,205,241,249, 15,167, 48,109,198,251,220,159,119,109, 27,249, 39,
+ 3,137,162,224,218,126, 39,241,249,160, 96, 57, 97,105, 98, 2,151,203,197,208,161, 67, 65, 16, 68,189,181, 60,185, 92, 46,210,
+210,210,208,191,127,127,112,185, 92,188,248,226,139,110,113, 82, 20,133,193,131, 7, 91,214, 81,180,230,179, 21, 13, 14, 52, 65,
+146, 77, 97, 11,138,162, 64,146,164,195,133,180,109, 57, 93,149, 75,230,112, 58,227,178,254,207, 85, 56,107,151, 60,114, 91,100,
+185,203,105, 14, 39, 69, 81,232,209,163, 7, 46, 94,188,232, 84,116, 57,208,151,117,238,189,188,188,124, 66,116,116,116,242,186,
+117,235,124, 0, 64, 46,151, 91, 22,188,231,112, 56,184,121,243, 38,116, 58, 29, 62,250,232, 35,125, 85, 85,213, 20, 54, 31,177,
+156, 77,201,233, 76,139, 0,232, 61,119,238,220, 46,203,150, 45, 91,210,189,123,247,157,169,169,169, 59, 8,130, 72,100, 24, 38,
+193,252, 57,119,238,220,246,203,150, 45, 91, 50,103,206,156,247,150, 46, 93,122,149, 32,136, 68, 0,176,253, 93, 91,150, 36,216,
+136, 56,127, 51, 79,109,158,171,115,172,189,223,182,159,246,184,235, 56, 90, 9, 9, 9, 68,237, 77, 18,214,133,154,187, 66,203,
+157,181,251, 40,138,122,125,201,146, 37,129,206, 68,150, 66,161, 64, 65, 65, 1,194,195,195,241,226,139, 47, 6,174, 91,183,238,
+117,163,209,248,153, 19, 90, 30,135,195,193,217,179,103, 81, 92, 92,140,216,216, 88, 68, 68, 68,212, 57,224,246,237,219, 56,112,
+224, 0, 42, 42, 42,208,185,115,103,160,166,115,183, 93,196,197,197,125, 20, 19, 19, 51,152, 36, 73,163, 72, 36,194,165, 75,151,
+208,169, 83, 39,252,240,195, 15,104,222,188, 57,196, 98, 49, 50, 50, 50, 16, 27, 27,139, 19, 39, 78,192,223,223, 31,241,241,241,
+198,170,170,170,147,101,101,101,199,238,222,189,251,145,163,112,134,134,134,206,127,229,149, 87,248, 5, 5, 5,244,150, 45, 91,
+ 78, 1, 56, 5,224,245,247,223,127,127,242,144, 33, 67, 2, 46, 92,184, 80,153,158,158,126,198,129,200,114,199,201, 50,218,190,
+148, 76, 38,147, 86,173, 86,235,180, 90,173,129, 36,201, 59, 4, 65,232, 76, 38, 83,180, 35, 19, 98,226,196,137, 81,165,165,165,
+211,102,204,152,145, 93, 43,178,110,162,166, 3, 60, 0,192,104, 52,106, 21, 10, 69, 85,247,238,221,195,199,142, 29,251,231,142,
+ 29, 59,166, 77,156, 56,113,247,150, 45, 91, 20, 0,212,182,132,205,155, 55,187,200,225,144, 60,101,181, 79,214,143,187,191,158,
+121, 96,239,235,205,114,115,243, 91,249,250,249, 43,121, 82,255,130,221,223,111, 62, 7, 64, 87, 80, 82,133,203,183, 11,193,229,
+114,112, 61,183, 18,189, 31, 31,197,253, 51,115,113, 79, 0,251,217,186, 92,211, 87, 22,205,139, 80, 31, 63,126,220,169,163,149,
+150,150, 6, 46,151, 11,145, 72,132,213,171, 87, 59, 37, 53, 11, 3,179, 91,228, 74,204,152, 23, 71,119,230, 62,209, 52,109, 89,
+232,221,118,251,226,139, 47, 48, 99,198,140, 58,215,168, 21, 27,132, 43, 78, 71,225, 11,111,209, 2,197, 69, 69,117,246,185,179,
+ 40,189,201,100, 2,151,203,197,166, 77,155,144,144,144,128,196,196, 68,167,159, 67,135, 14, 5, 73,146,140, 59,241,217,163, 71,
+ 15,232,245,122, 75,152,111,222,188,105,151,119,253,250,245,174,130,249, 4,128, 5,157, 58,117,146,245,235,215, 15,201,201,201,
+ 24, 57,114,164, 86,175,215,103, 2,192,240,225,195, 91,175, 91,183,142,127,254,252,121,248,250,250,114,115,114,114,190, 5,219,
+ 65,158, 69, 19,195,158, 22, 49,191,243,150, 45, 91,182,196, 86,196, 88,195,252, 63, 65, 16,137, 75,151, 46, 77,176, 22, 69,214,
+191,205,174,147,141,136,107,111,237, 72, 89,139, 40, 71, 2,202,230,125,107,125,124,137, 93,161, 85,123, 99,125,173, 93, 32,115,
+225,235, 74,100, 57,169, 57,214,129,167,167,231,176,167,159,126,218, 34,114, 52, 26,141, 69, 96,153, 69,150,249,119, 70, 70, 6,
+186,116,233,194,243,244,244, 28, 38,151,203, 63,115, 67,196, 33, 36, 36, 4,165,165,165,184,114,229, 10,194,195,195, 97, 48, 24,
+112,232,208, 33, 84, 86, 86,130,203,229,130,199,227, 65,175,119,218,119, 27, 49, 49, 49, 67,183,111,223,222,101,219,182,109,229,
+230, 26,221,247,223,127, 15,134, 97,224,239,239, 15,149, 74,133,162,162, 34, 28, 59,118, 12, 70,163, 17, 82,169, 20,145,145,145,
+252, 17, 35, 70,244, 92,176, 96, 1,215,137,208,234, 49,114,228, 72, 79,153, 76,134, 55,223,124,147,209,235,245, 75,107,247,205,
+159, 62,125,186,239,157, 59,119,116, 47,189,244,210, 89,189, 94,255,169,217, 76,180, 22, 56, 14, 30,172, 67, 39,203, 96, 48,152,
+227, 52, 91,161, 80,192,207,207, 47,220,218,217,114, 36, 6, 83, 82, 82,122, 0,224, 44, 92,184, 80, 8,160,200, 58, 12, 58,157,
+ 14, 10,133, 2, 74,165,210, 80, 89, 89, 89, 60,123,246,108,227,142, 29, 59, 56,181,231, 92,183, 39,180, 8, 98,168, 78, 38, 19,
+243, 25,134,243,254,198,141, 27,165, 67,134, 12, 33,165, 82, 41,170,171,171,101,191, 29, 60, 40, 29,208,175,103,228,146,101,159,
+ 28,150,133,197, 22,165, 92,202, 66,126, 97, 37,116, 6, 3, 34,131, 61,107,252, 48, 22, 77,142,218,129, 44, 22, 71,203, 90, 84,
+ 36, 39, 39,227,241,199, 31,183,228,117, 30,143, 87,199,249,114,197, 73, 81, 20, 30,127,252,241,122, 14,207,241,227,199,237,186,
+ 79,174, 96, 45,138,108,197,145, 61, 1, 70,146,164,203, 5,214,205,110,158, 61,177,101,237,234,219,136, 55, 87,205, 28,160, 40,
+ 10,211,167, 79, 7,151,203,197, 59,239,188, 3,138,162, 16, 31, 31, 15,138,162,208,189,123,119,112,185, 92,244,239,223,191,193,
+247,126,250,244,105,116,234,212,201, 18,166,248,248,120,116,237,218, 21, 20, 69,161, 87,175, 94,224,114,185, 24, 60,120,176, 59,
+156,239, 85, 87, 87,199, 73, 50, 7, 8,223, 0, 0, 32, 0, 73, 68, 65, 84,165, 82,100,100,100,128,195,225,128, 32,136, 91, 0,
+226, 0, 32, 56, 56,248, 79,149, 74, 21,165,209,104,240,202, 43,175, 16, 58,157, 46,246,157,119,222,121, 95,163,209,176, 66,139,
+ 69,147,193, 86,139, 88, 65, 61,103,206,156,247, 8,130, 72, 52, 59, 84,182,206,147,189,223,118,202, 38,179, 3,149, 94,155, 87,
+187,218,136,184, 18,130, 32,210, 25,134, 25,238,232, 92, 0, 58, 27, 97, 85,167,233,208,186,217,208,165,163,101, 46,124,221, 21,
+ 90,174,160,209,104, 58, 6, 4, 4, 56, 20, 89,214,159, 58,157, 14, 17, 17, 17,208,104, 52, 29, 27,250,210, 8, 14, 14,134, 94,
+175,199,215, 95,127, 13, 30,143, 7, 30,239, 47,125,161,211, 57, 55,139,174, 93,187,150,125,250,244,233, 78,157, 59,119,246,254,
+229,151, 95, 74,250,244,233,227, 63,100,200, 16,136, 68, 34,168,213,106, 24, 12, 6,116,235,214, 13, 49, 49, 49,200,203,203,195,
+111,191,253, 86, 26, 29, 29,237,119,230,204, 25,186,176,176,240,174, 19,234, 65, 3, 6, 12, 0, 65, 16, 56,120,240, 96, 41,128,
+116,129, 64,112, 96,241,226,197,222, 58,157,142, 30, 63,126,124, 78, 89, 89,217, 12, 0,122, 62,159,191,182, 79,159, 62,221,147,
+146,146,190,163,105,122,117, 67, 19,170,109,220, 42,149, 74, 8,133, 66,119,166,146,224,150,149,149,117, 0, 0,137, 68,226, 3,
+224, 79, 75, 10, 87,171,235,136, 97,157, 78,167,241,241,241,145, 0, 64,237, 57, 92, 7,156,254, 70, 35,126,188,123, 55,203,195,
+186,255,156,151,151, 23,198,141, 29, 75, 62,214,163, 7, 63,174, 99,199,193, 31,172,216,246, 67,136,175, 76, 23, 25,226, 11,131,
+201,128,164,195,135,104,134, 54, 28,102,139,157,191, 71,104,153,197,134,173,163,197,229,114,113,226,196,137,122,251,120, 60, 30,
+190,250,234, 43,183,132,129, 89, 84, 57,106, 58,179,105,234, 34, 92, 9, 24, 46,151, 11, 14,135,131, 77,155, 54,129,166,105,204,
+156, 57,179, 78,115,162, 53,191, 91,118,158,149, 8,140,153, 79, 3,208, 33,111,165,192,114,190,109,120,107,207,113,203, 37, 91,
+183,110,157, 91,142,214,240,225,195, 93, 10, 87,235, 22, 6,235,112, 93,188,120,209, 46,239,198,141, 27, 93,198,167,201,100,194,
+254,253,251, 45, 34,213,140, 15, 62,248,224, 21, 62,159, 31,120,242,228, 73, 20, 22, 22, 66,169, 84, 66,161, 80,160, 91,183,110,
+145, 36, 73, 94, 42, 44, 44,188,115,253,250,245,167,217,220,195,226,111,116,180,180, 75,151, 46,189,186,116,233, 82,187,142,149,
+173,179,228,204,121, 50, 11,172, 90, 65,228,111, 22,111,168,233, 86,147,238,234, 92, 0,124,219,166, 67,167, 70,144,141,138, 92,
+ 96,175,240,117,167,249,208, 77, 59,157, 34, 8, 2, 26,141,198,174,192,178, 22, 7,122,189, 30,101,101,101, 48,153, 76,247, 61,
+215,151,189,154,172, 43,161,117,229,202,149, 73,147, 39, 79, 46,240,244,244,140, 43, 41, 41, 41,166,105,186,127, 90, 90,154, 63,
+ 69, 81,144,201,100,144,201,100, 56,112,224, 0,196, 98, 49,166, 79,159, 94,108, 50,153,146, 61, 60, 60,124,213,106,245, 31,133,
+133,133, 31, 56, 84, 48, 92,238,224, 94,189,122,225,252,249,243, 40, 47, 47, 63, 2, 32,254,249,231,159,127,188, 89,179,102,196,
+226,197,139, 53,183,111,223, 94, 13,160, 88, 34,145,108,223,190,125,123,191,206,157, 59,123,140, 31, 63, 30, 39, 78,156,216, 8,
+ 64,227,238, 61, 43,149,202, 58, 2,171,170,170, 10,213,213,213,144, 72, 36, 70, 55,227,140,139,191, 70, 24,130, 97, 24,203,179,
+169,117,179,204,207,135,161, 40,202, 60,170,209,145,200,130, 68, 34, 89,184,109,219, 54,145,237, 32, 5,147,201,132,162,162, 34,
+200,100, 50,204,251,224, 3,222,199,111, 77,233,196,145, 6,166,145, 36, 1,157,158,169, 96,104,221, 33,101,209,115, 39,129,143,
+216,146,231,111,128, 89, 24, 60,249,228,147,245,154, 11,121, 60, 30,142, 28, 57,130,167,158,122,202, 82,113,233,220,185,179,203,
+202,149, 89, 24, 60,241,196, 19, 22,103,232,208,161, 67,118,155,253,204,142,148, 59,130,208,124,236, 27,111,188, 1,138,162,240,
+249,231,159, 99,214,172, 89, 32, 73, 18, 43, 87,174, 4, 73,146,248,240,195, 15,221, 22,153,214, 2,230,206, 39, 53,159, 97,179,
+170, 32, 95, 31, 8, 0,240,144,201,204, 55,212,160,178,135,162, 40,139,147,213,177, 99, 71,112,185, 92,116,239,222, 29, 20, 69,
+ 89,156,172, 97,195,134, 89,199, 35,227, 14, 39, 69, 81,200,204,204,180,132,185,123,247,238,117,156, 44,138,162, 48,124,248,112,
+119,130,185,196,203,203,107, 65, 76, 76, 76,219, 85,171, 86,113, 57, 28, 14, 6, 12, 24,208, 58, 40, 40,232,174,209,104,244, 93,
+184,112,161,216,206, 57, 34, 0,113,109,219,182,149,176,185,134, 69, 19, 58, 90, 11,236,252,229,109,221,231,170, 1, 21,201, 68,
+235,227,205, 28,182,226,168,214, 33, 75,118,197,101,239, 92, 87,160,204, 10,210,153,165,238,142,208,170,181,157,157, 94, 76, 44,
+ 22, 95, 46, 46, 46,238, 46, 18,137,234,136, 44,123,130,139,195,225,160,176,176, 16, 98,177,248,178, 86,171,109,180,135,232,170,
+233, 16,128,230,214,173, 91,111, 89,253, 30, 56,108,216,176, 45, 71,142, 28, 9, 78, 74, 74,194,153, 51,103,224,239,239,143,117,
+235,214,221, 43, 42, 42,154, 4,224, 72,105,105,169,203,235, 70, 69, 69,117,144, 74,165, 72, 73, 73, 1,128, 19, 0,166, 76,155,
+ 54,141, 48, 24, 12, 88,191,126,189, 18,192, 65, 47, 47,175,253,187,119,239,238, 20, 23, 23,199, 79, 74, 74,170, 58,115,230,204,
+239,110,138, 44, 19, 77,211,245, 4,150,117,156,122,120,120,184,227,104, 25, 60, 61, 61,175, 84, 85, 85,141, 82,171,213, 85, 2,
+129,192,163,170,170, 74,107, 45,176,204,252, 20, 69,113, 51, 51, 51, 11, 0, 68,122,122,122, 94,129,131,102, 78,138,162, 6, 12,
+ 24, 48,128,178,125, 6, 69, 69, 69, 40, 44, 44,132, 94,175, 71,231,206,157, 9, 14, 97,224,148,231, 94,182,153,214,129, 21, 89,
+127,147,163,197,152,243,186,121,148,160,189,145,134,135, 14, 29,178,252, 38, 73, 18,155, 55,111,118, 75, 20, 29, 57,114,196,105,
+135,117,155,166, 67,151,214,184,249,248, 47,191,252, 18, 12,195, 88,156, 44,146, 36, 49,103,206, 28, 8, 4, 2, 44, 94,188, 24,
+115,230,204, 1, 69, 81, 46,155, 14,173, 5, 76,139,119, 84,214,149,163,154, 76, 81,219, 31,138, 32, 8,107,177, 69,184, 43,222,
+156,185,121,238,180, 4, 88,115,154,207, 19, 10,133, 14, 59,194,219,112, 58,187,192, 62, 0, 89,193,193,193, 41,221,187,119,247,
+ 60,119,238, 28, 86,174, 92,201,211,106,181,205,147,146,146, 44,215,181, 23, 95, 74,165, 82,196,230, 28, 22, 77,225,102, 57,249,
+187,196,166,127, 21, 97,221,140,231,228,211,246,120, 88,237,179,230, 45, 33, 8,194, 96,231,122, 37,118,196,149,237, 53,172,143,
+ 41,113,232,104,185, 42, 44, 92, 9, 46,119, 28, 45,149, 74,245,251,193,131, 7,187,142, 29, 59,150,114,214,108,168, 84, 42, 17,
+ 24, 24,136,171, 87,175, 26, 85, 42,213,239,110, 56,101,141, 41,180,108,145, 84, 92, 92,204, 49, 24, 12,104,213,170, 21, 66, 67,
+ 67,161,209,104, 80, 81, 81,193, 1,112,196, 77, 14,158, 68, 34,225, 0, 64, 69, 69, 5, 80, 51,212,180,117,116,116, 52,206,159,
+ 63,143,178,178,178,159, 1, 12, 89,176, 96, 65,231,110,221,186,241,126,248,225, 7,213,212,169, 83,127, 54, 24, 12,110, 41, 13,
+154,166,117, 70,163, 49,130, 36, 73,125, 69, 69, 69,190,117,124, 6, 6, 6,250, 72, 36, 18,162,168,168,200,224,142,208,138,139,
+139, 59,155,147,147,131,133, 11, 23,150, 44, 89,178, 36,186,186,186,186,188,178,178,210,104, 45,182, 52, 26, 13,233,231,231, 39,
+ 88,191,126,189, 8, 0,226,226,226,206, 58, 18, 90, 74,165,178,153, 88,252, 87,197, 88,171,213,162,176,176, 16,133,133,133, 40,
+ 42, 42, 66,117,117, 53, 34, 35, 35,161, 82,169,194,217, 98,230, 31, 19, 90,117,154,207,172,243,183,245,139,188, 33,121,221, 90,
+192, 60,249,228,147,150,190, 93,102,135,204,188,253,248,227,143,182, 29,204,221, 18, 90, 95,126,249, 37,222,120,227, 13, 8,133,
+ 66,172, 90,181,170, 78,211,161,173, 56,160,105,154,112,231,222, 35,222, 85,163,112,173, 15,184, 92, 46,124,167, 22,213,105,162,
+179, 35, 56,220, 10,231,146, 37, 75, 26,165,233,208,154, 51, 60,188, 38,171,108,218,180, 9,163, 70,141,194,201,147, 39,239,187,
+233,176,125,251,246,223, 39, 38, 38,122, 94,187,118, 13, 85, 85, 85, 40, 41, 41,129, 86,171, 69, 94, 94,158,195, 86,129,218,178,
+ 92,200,230, 28, 22,127,115, 57,149,254,119,242, 54,230,245, 40, 23, 47,112,183,133,150, 59,142,150, 86,171, 93,245,230,155,111,
+ 78, 27, 56,112,160,143,135,135, 7, 10, 10, 10,234,137, 44,133, 66, 1,169, 84, 10,181, 90,141,189,123,247, 86,105,181,218, 85,
+174,196,129,193, 96, 64, 64, 64, 0, 74, 75, 75, 65, 59,232, 63, 77,146, 36, 68, 34, 17, 20, 10, 5,224,162,147,185,189, 23,134,
+ 94,175,135,193, 96,128,193, 96,128, 94,175,119, 89, 75,182, 53,243, 36, 18,137, 89,120, 0,128, 50, 36, 36,164,149, 80, 40, 68,
+118,118, 54, 80, 51,178,111,224,227,143, 63,206,149,203,229,204, 75, 47,189,116,138, 97,152, 87,224,124,118,124, 93,114,114,114,
+ 4, 0,136, 68,162, 12, 0,200,203,203, 51, 84, 84, 84,212,113, 10,197, 98, 49,243,212, 83, 79, 5, 51, 12,131,228,228,228, 8,
+ 30,143,199,192,241,168, 70,205,158, 61,123,174,121,122,122,238, 88,182,108,217,216,132,132,132,171, 29, 58,116,136, 80, 42,149,
+197,106,181, 90,173,209,104, 24, 14,135,195,243,246,246, 22, 30, 62,124,248,207,180,180,180,129, 50,153,108,199,158, 61,123,174,
+ 57,114,222, 36, 18, 73,158, 74,165,106, 97,126,166,214, 34,171,176,176, 16, 12,195, 32, 43, 43, 11, 98,177, 56,199, 85,179, 46,
+139,166,131,185, 82,101,235,188,216,238,115, 87,100, 89, 11,131,195,135, 15, 59,157, 67,203, 93, 78,107, 81, 52,107,214, 44,172,
+ 93,187,182,158,163,181,120,241, 98, 0,192, 7, 31,124,224,118, 31, 45,179,123, 85,184,214, 7, 65,111,148,213, 9, 59, 0, 16,
+230,240, 53, 44,207,131,162, 40, 44, 92,184,176, 94, 39,117,235,166, 61, 55,155,248,234,132,179,184,184, 24, 20, 69,193,199,199,
+ 7,227,198,141,195,224,193,131, 45, 77,144, 13,229,189,113,227, 70,202,187,239,190, 27,219,190,125,123, 44, 90,180,168,204,203,
+203,203,227,229,151, 95,166, 42, 42, 42, 8,103,142, 22, 43,180, 88,176,104, 4,161,101,206, 96,238,142, 58,116, 80, 88, 14, 68,
+221,185, 54, 42, 85, 42,213,184, 65,131, 6,253,178,107,215, 46, 81, 84, 84, 20,110,220,184,129,178,178, 50,232,116, 58,240,120,
+ 60, 4, 7, 7,163,162,162, 2,155, 55,111, 86,171, 84,170,113, 0, 42, 93,112,190,223,165, 75,151, 13,159,125,246,153, 48, 62,
+ 62, 30,101,101,101, 80, 40, 20, 22, 33, 68, 16, 4,100, 50, 25, 68, 34, 17,206,158, 61,139, 67,135, 14,169, 1,188,239,130,211,
+158,154,131, 94,175,183, 8, 46, 55,132,150, 53,167,196,236,234,168, 84, 42, 0, 48, 52,107,214, 44, 8, 0,178,178,178, 0,224,
+ 78,100,100,228,130,168,168, 40, 98,251,246,237, 12,195, 48,135, 28,136, 44, 11, 39, 65, 16,101, 12,195,148, 3, 8,210,233,116,
+ 60, 0,168,172,172,212,251,249,249, 5, 8, 4, 2, 90, 36, 18,209, 66,161,144, 46, 40, 40, 48, 26,141, 70, 30, 0,244,234,213,
+ 75, 7,160,208,102,141, 66,107, 78,154, 97,152,170,141, 27, 55, 46, 24, 63,126,124,247, 30, 61,122,180,127,237,181,215,174,188,
+244,210, 75,100,104,104,168,119,117,117,181,230,214,173, 91,229, 43, 86,172,168, 62,125,250,244, 64, 46,151,123,119,227,198,141,
+ 11, 0, 84, 17, 4, 65,219,227, 52, 26,141,191, 39, 37, 37, 77, 74, 72, 72,160,242,243,243, 81, 84, 84,100, 17, 89, 69, 69, 69,
+136,137,137, 65, 90, 90,154, 73,175,215, 39, 53, 32, 62, 27, 11, 44,103, 77, 37,132, 49,231,117, 71, 2,203, 92,153,114,151,211,
+ 90, 20,141, 26, 53,170,142,139,197,227,241,240,211, 79, 63,217, 45, 55,236,228,171, 58,247,110, 61,199,215,187,239,190, 91, 71,
+180,205,155, 55,207, 97,113,230, 42, 62,205, 60,149,155, 66,235,142, 58,116,144,207,157,133,211, 92,118,114,185, 92,204,155, 55,
+207,109, 71, 11,245,251,104,213,227, 52,223,123,159, 62,125,160, 82,169, 44, 66,214,145,163,229, 42, 62, 77, 38,211, 27,107,215,
+174,101,100, 50,217,163, 85, 85, 85,207,231,228,228,108, 85,169, 84,143, 84, 86, 86, 58,117,180,180, 90,173,128,205, 71, 44, 39,
+154,102,126,174,255,142,208,170,125, 73,162, 89,179,102,117,214,206, 34, 73,178,206,214,144,126, 6,181, 56,156,153,153,249,204,
+ 99,143, 61,246,221, 27,111,188,225, 17, 31, 31,207,109,209,162, 5,148, 74, 37,178,179,179,113,245,234, 85,227,158, 61,123,170,
+ 84, 42,213,243, 0,220, 25,117,182,237,218,181,107,135,134, 12, 25,242, 97,183,110,221, 94,157, 63,127, 62,167,117,235,214,168,
+172,172,132,183,183, 55, 2, 2, 2,112,243,230, 77,236,221,187,215, 84, 90, 90,186, 1,192,199,176,211,134,234,170,194,175,215,
+235, 49,102,204, 24,208, 52,141,213,171, 87,195,157, 5,149,173,160,215,235,245, 12, 0,162,182, 63,151,170,118,118,105,220,186,
+117, 11, 0,238, 70, 68, 68,120, 0, 64, 82, 82, 18,129,154,249,181,220,169,225, 51, 12,195, 88,156,173,152,152,152,108,219,194,
+209,236,100,153, 93, 48, 87,225, 38, 8, 66,195, 48, 76,177, 74,165, 26, 50,107,214,172, 15,191,252,242,203,177, 95,126,249,101,
+189,227,100, 50,217,142,149, 43, 87,126, 60,122,244,232, 98,130, 32, 28,246, 35, 83, 42,149, 31, 76,152, 48, 97,244,229,203,151,
+ 61,132, 66, 33,148, 74, 37,228,114, 57,244,122, 61, 34, 35, 35, 81, 92, 92,140,109,219,182, 85,171,213,234,143,216,236,248,207,
+192, 90, 24, 56,114,181,220, 16, 89, 14, 93,157,125,251,246,217,157,163,170,161,156,182, 98,195,221,185,173,156, 85,138,204,211,
+210,216,155, 50,162,129,229, 90, 61, 94,138,162,240,233,167,159, 90, 38,109,181,231,100, 53,196,209, 50,115,250,248,248,212,216,
+228, 98, 49,104,154,198,240,225,195, 31,132,151, 6, 48,221,106,198,247, 37,179,103,207, 94, 16, 19, 19,211, 26,128,192, 58, 14,
+ 26,232,226,179, 96,193,194,149,208, 50,153, 76,121,109,218,180,169, 83,192,185, 90,204,212, 96, 48,228,185,121,221, 67, 74,165,
+ 50,114,229,202,149,111, 74, 36,146,129, 42,149, 42,182,182,224,184,172, 84, 42,147,180, 90,237, 26, 52,108, 17,232, 18, 0,175,
+159, 62,125,122,245,144, 33, 67, 22,247,239,223,255,217,183,222,122,139, 96, 24, 6,235,215,175,103,110,223,190,253, 99,173,139,
+117,251,126, 34,201,199,199,231,218,230,205,155, 3,127,249,229, 23, 24, 12, 6,172, 89,179, 6, 30, 30, 30,215,202,202,202,220,
+165, 40, 62,122,244,232,150, 30, 61,122,188,144,150,150,182, 13,192, 31, 39, 78,156,216,218,179,103,207, 9,105,105,105,223, 3,
+184,122,236,216,177,173,221,186,117,155,144,158,158,190, 27,192,197, 6, 20,190, 22,103,203,104,180,223,210,232,192,201,114,198,
+ 89,197, 48,140,126,242,228,201,111,141, 30, 61,250,235,244,244,244, 71, 42, 42, 42, 98, 1,192,203,203,235,114,215,174, 93,207,
+238,218,181,235,102,173,147,229,170,179,126,137, 82,169,124, 42, 54, 54,246,231, 69,139, 22, 73,218,183,111, 79,181,106,213, 10,
+119,238,220,193,149, 43, 87,140,223,126,251,173, 66,173, 86, 63, 9,160,156,205,142,255,156,208, 98, 24, 6, 94, 94, 94,117, 42,
+ 81,230, 33,255, 13,109, 46,180,126, 49,155,151,234,177,229,117,196,233,108,218, 4, 51,164, 82,169,101,114, 83,119,186, 44,208,
+180,243,249,216, 24,134,177,112,154, 55, 55, 68,150,203, 17,130,181, 75,224,184,205,233,206,244, 14, 18,137, 4, 6,131,193,194,
+235,198,200,207,134,170,197,125, 0,246, 25, 12,134, 91, 0, 90,178,226,138, 5,139, 38, 20, 90,229,229,229, 93,154,248,218, 85,
+ 90,173,246, 99,173, 86,251,177,121,135, 70,163,121, 80,206,219, 0, 70, 31, 61,122,244,179,163, 71,143,154,219, 17, 22,194,245,
+122,137, 78,113,227,198,141, 4, 46,151,251,213,142, 29, 59,186, 49, 12, 3, 79, 79,207,211,119,238,220,121,185, 33, 28, 38,147,
+105,114, 90, 90,218, 52,212,246,101,210,235,245,147, 83, 82, 82,222, 68,205,122, 76, 48,153, 76,147,207,156, 57, 99,249,221,192,
+ 23, 37,195, 48,140,150, 97,152, 16, 7,135,104, 27,232,192,153,157, 45,221,174, 93,187, 20, 0, 46,225,175,121,178, 12,181,155,
+198,166,185,208, 25,142, 41,149,202, 86,243,230,205, 91,194,225,112, 6, 40,149,202, 80,137, 68,146,107, 52, 26,127, 87,169, 84,
+239,163,102,141, 42, 22,255, 16,116, 58, 93,126,155, 54,109, 40,123, 21, 40,103, 47,114,103, 21, 43,147,201,148, 23, 29, 29,237,
+178,114,102,135, 51,223,137,104,184, 27, 25, 25, 73,186,203,101,134, 94,175, 47,118, 22,206,200,200, 72, 52,148,211,213,189, 71,
+ 68, 68,216,189,119, 23,130,208,225,189, 27,141,198,251,226,116, 22,159,206,160, 86,171,203,253,253,253, 21, 26,141,134,171,213,
+106,185, 70,163,177,142,253, 40, 18,137, 74,212,106, 53,155,121, 88,176,120, 16,161,245,144,227, 28,106,150,151,104, 44,104, 47,
+ 95,190,252,130,197,158, 42, 46,190, 95, 30, 91, 37,169,112,241,187, 33,194,168,209, 29,161, 90, 33,165,106, 36,186, 82,133, 66,
+241,146,249,135,185, 15, 8,139,127, 30,114,185,252,209,198,230, 44, 43, 43,107,244,138, 90,105,105,105,247, 38,184,247, 46,255,
+ 85, 78,103, 40, 40, 40,120,212,133, 16, 99, 51, 14, 11, 22,110,130,100,163,128, 5, 11, 22, 44, 88,176, 96,193,162,105, 64,160,
+102,228,128, 61, 52,100, 52,193,192,251,184,118, 18,203,201,114,178,156, 44, 39,203,201,114,178,156,255, 57, 78, 87,220,236,104,
+198, 38, 22, 96, 44,231,255, 63, 39, 7, 0, 33, 18,137, 8,161, 80, 72,136,197, 98,130,141, 79,150,147,229,100, 57, 89, 78,150,
+147, 69,125,252,227,125,180,252,253,253,147, 41,138,138, 86, 42,149,202,234,234,234, 40, 15, 15,143,219, 18,137, 68, 98, 52, 26,
+ 51, 75, 74, 74,122, 63, 32,253,100,129, 64, 48, 51, 46, 46,174,221,205,155, 55, 51,170,170,170, 86, 0,248, 6,246, 71, 12,113,
+109,246, 19, 0,226,155, 55,111,190, 85, 40, 20,138, 51, 50, 50,230, 0,248,222,141,120, 36,224, 98, 68,146, 53,188, 37, 60, 46,
+106,250,147,245, 5,112, 28,192,190,114,165,222,240, 32, 55,125,191,156, 82,169,212,167,101,203,150,235, 35, 34, 35, 35, 25, 64,
+203, 48, 53,243, 15, 25, 13,122,222,213, 43, 87,146,239,220,185,179,161,127,255,254, 95,135,133,133, 5,114,185, 92,131,121,212,
+151, 74,165,226,109,219,182,173, 21,155,157, 88,176, 96,193,130, 5, 11, 55,133,150,164, 57,218,240, 37,196, 54,147, 1,106,163,
+150,153,170,204,197, 13,105, 51,244, 96,128, 23, 24, 32,130,228,144,254, 38, 19, 93, 72,107, 8, 35,215, 32,138, 38, 25, 74, 88,
+ 85, 85, 21,218,224, 0, 80, 84,116, 65, 65, 65, 64, 72, 72,136,121,241, 99,137,249,247, 3,128, 0,240,197, 43,175,188, 50,245,
+213, 87, 95,133,183,183, 55, 12, 6, 67,235,157, 59,119,110,154, 55,111, 94,119, 0, 47,218, 17, 67, 12,234, 78, 18,218, 58, 54,
+ 54,118,127,106,106,170,111, 69, 69, 5, 58,119,238,188,162,184,184,216,145,208, 50, 54, 52,128,222, 18, 94, 27, 0, 47, 6,121,
+ 9, 38,125, 51,171,191,119,139, 1,175,225,202,143, 11,166, 77,255,230,114, 57,128,205, 0,190, 41, 87,234,111,254, 93,156, 30,
+ 30, 30, 1,109,162,163,119,253,248,243,207,189, 79, 31, 59, 6, 31, 1, 31, 18, 17, 31, 96,128,192, 86,109,240,218,236,217,198,
+ 71, 30,121,164,223,119,223,125, 23,151,158,158,142,208,208, 80,136, 68, 34,136,197, 98,200,229,114,108,219,182,237,190,211, 17,
+ 77,211,247, 0, 28, 37,141,216,167, 40,192, 45, 54, 91,178, 96,193,130, 5,139,127,189,208, 98,104,172, 88,125, 96,114,231, 43,
+101,191,225,139,103, 10,151,138,194, 96,236, 49, 34,250,233,132,137,157,224,233, 47,134, 80, 74,161, 66, 94,213,225,230,133, 92,
+ 28,223,253, 39,188, 13,173,145,246,251,249,235, 42,149,170,237,253, 4, 68, 44, 22,139,131,131,131,139,196,214, 11,227,221, 31,
+132, 0, 86,188,250,234,171, 83,223,121,231, 29,252,254,251,239,216,179,103, 15,198,143, 31,143, 25, 51,102, 64, 42,149, 78,154,
+ 49, 99, 70, 26,128,175,157,112,180,142,141,141, 61,149,154,154,234,171, 86,171,113,229,202, 21,148,149,149,253,209, 88,145,238,
+ 45,225, 45, 91,255,114,220,187,221,158,158, 14,255,246,131, 64,144, 53,143,161,215,236,189,184,248,166,218, 59, 47,229,187,183,
+246,252,248,253, 91,203,247,220, 90, 94,174,212,207,249, 59, 56,163,162,162,214,237,250,233,167,222, 97, 97, 97,216,159,125, 27,
+ 45, 35,130,209,172, 77, 39, 84,102,223, 70,201,221, 44,232,244,122,244,237,219, 55,238,212,169, 83, 40, 40, 40,128,159,159, 31,
+ 52, 26, 13,210,211,211, 33, 20, 58, 94,141,163, 1,233,104,200,177, 93,183,150,223, 58, 95,178, 76,153,131, 15, 1,152,216,236,
+249,175, 65,235,102,205,154,253, 44, 18,137,100, 25, 25, 25, 31, 0,216,210,132,215, 26,215,173, 91,183, 53,151, 46, 93,186,160,
+213,106,223, 4,144,193, 70, 63, 11, 22, 44,254, 73, 56, 27,117, 24,236,239,239, 7,191, 72, 46,188,125, 36, 67,151,255,244,252,
+211,175, 45, 29, 0, 94, 84, 62,202,164,103,112,151,249, 29, 26,223,155,104, 51,132,135,183,191,233, 7,223,238,114,192, 71, 85,
+128,112, 8, 28, 17,250,248,248,252, 28, 16, 16,144,106,189, 25,141, 70,225,156, 57,115, 76, 25, 25, 25,146,130,130,130,128,140,
+140, 12,201,156, 57,115, 76, 70,163, 81,232, 31,232,115,193,163, 57, 47, 47,162,183,168, 68,210, 28,175,187,112,176, 62, 11, 10,
+ 10, 82,141, 29, 59, 86,221,161, 67,135,169, 12,195, 96,235,214,173,120,249,229,151,119,254,246,219,111, 17, 99,198,140,217,122,
+244,232, 81, 76,153, 50, 5, 94, 94, 94, 51,220, 21, 89, 23, 46, 92,192,132, 9, 19, 74,140, 70,227,140, 70,140,247,137,163, 86,
+156, 65,200, 35,207,130,195, 19, 89,214, 82, 35, 72, 18, 92,145, 12, 97,143, 61,143, 87, 22,127, 7, 0, 19,255, 46,206,200,168,
+168,150,231,146,147,241,237,194, 69,104, 29, 16,128,208,102,161,240,105,211, 1, 30,254,126,160, 40, 10, 12, 3,134,207,231,211,
+229,229,229,144,203,229,144,203,229,200,206,206,198,241,227,199,113,239,222, 61, 52, 70, 58,154,253,109,127, 50,225,181,182,239,
+137,155,225,160,179,116,196,226,225, 18, 89,177,177,177,167,110,220,184, 17,147,148,148, 20, 18, 26, 26,250, 73, 83, 94,172, 75,
+151, 46,203, 79,158, 60,233,115,240,224,193, 65, 65, 65, 65,201, 0, 90,223, 79,152,155, 55,111,126,189,117,235,214,121, 0,198,
+ 53,114, 16, 39,118,239,222,189,140,207,231, 31,186,207,176,177, 96,241, 48,161, 3,128, 88, 86,104,185,129,197, 59,199, 82, 62,
+109,181,184, 82,126, 0,187, 62,249, 3,159, 12,189, 73, 47,238,158, 77,127,254,194, 13, 28,222,245, 7,138,241, 7,134,189,214,
+ 18, 99, 63,232, 56, 80,108,194, 34,153, 76,118,193, 30, 15,143,199, 11,204,200,200,240,205,202,202,242,189,125,251,182,111,102,
+102,166,239,181,107,215,138, 42, 42, 42, 20,195,135, 15,167, 1, 96,248,240,225,244,221,156,187,170, 65, 79,247,161,195, 7,160,
+227,172,159,218,133,206, 73,236,228,231, 29, 44,152,235,232, 30, 56, 28,206,158, 47,191,252,242,173,220,220, 92,209,247,223,127,
+143,244,244,116, 68, 69, 69, 97,209,162,133,229, 35,122,180,237,245, 72,148,239, 42, 79, 17,247,179, 45, 91,182, 64, 44, 22,163,
+ 99,199,142,142, 92,183, 22, 29, 58,116, 72, 49,139,172,139, 23, 47,226,249,231,159,215,203,229,242,171, 0,150, 1,216, 67,145,
+ 68,178,191,167,164, 66, 34,160,238, 18, 4, 14,160,166,207, 87,120,195,163,158, 64,229,221, 75, 48,233,213,160, 4, 18,112,120,
+ 66,144, 20, 31,101,183,210,144,241,235, 66, 84,100,221,207,194,225, 15,192, 73,146, 26, 79, 46, 23,113,126,190,136,141,136,132,
+143, 80, 6, 85,218, 49,160, 66, 1, 30, 79, 0,128,129, 64, 32, 64,117,117, 53, 46, 92,184,128,235,215,175,227,220,185,115, 56,
+123,246, 44,138,138,138,112,191,233,104, 73,143,108,173,163,116,196,150, 81,255, 14,145,149,154,154,234,171,209,104,112,227,198,
+ 13,148,148,148, 92,108,202, 11,102,100,100,148,167,166,166, 34, 44, 44, 12,223,127,255,189,127, 68, 68,196,201, 6, 10,154,214,
+177,177,177,167,174, 95,191, 30,147,148,148, 20, 26, 16, 16,176,162, 49,195,247,200, 35,143, 44, 62,121,242,164,247,225,195,135,
+ 7,251,251,251,223,175, 16,100,193,226,255, 25, 2, 0, 47, 16, 4,113,182, 67,135, 14,151,219,183,111,255, 7, 65, 16,105, 0,
+ 70,225,223, 59,119,167, 83, 88,110, 58, 49, 49,241, 4, 0, 36, 36, 36,244,177, 61, 72, 17,112, 30,249,217, 69,216, 60,177,152,
+ 86,151,160, 98,209,123,159,237, 57,127,250,226, 83,111,206,120,211,123,245,198,229,216,158,118, 0, 99, 86, 24,209,107,116, 59,
+156,217,159,243,214,196,126,115,241,214,140,217, 64,253, 33,154, 12, 73,146, 72, 73, 73,129,201,100,130, 78,167,131, 78,167, 67,
+187,118,237,202,142, 29, 59, 38, 5,128,204, 63, 51, 24,174,175, 78, 48,240, 29, 25,111,202,128, 24, 40,228,122,124,247,110, 38,
+ 74,179,181, 63,214,114, 36,213,145, 7, 36,249,245,134, 13, 27,158,152, 50,101, 10,190,248,226, 11,236,220,185, 19, 79, 62,249,
+ 36,158,123,238, 57,148,148,148,120,135,226, 30, 6,180,243, 11,233, 59,125, 67,159, 49, 99,198, 64,161, 80, 32, 61, 61,253,186,
+ 77,184,146, 80,211, 25,254,245,227,199,143,251,168,213,106, 84, 87, 87,163,111,223,190,144,203,229, 60, 0,253,237,196,157, 39,
+128,230,106,181, 26, 45, 90,180,104, 93, 82, 82,210,195, 14,103, 61,120, 75,120, 22,113,171, 87,150, 67,175, 44, 7,135, 39,132,
+208, 59, 12, 87,191,155, 1,134,174,105, 49,243, 12,239,104,239,244, 38,227, 20, 11, 4, 72, 76, 77,193,241,196,125,104, 27, 25,
+137,158,177,177, 56,117,249, 10,120, 36,129,145,147, 38, 3, 52, 19,144,146,146, 66,148,148,148,224,242,229,203, 88,184,112, 33,
+114,114,114,112,224,192, 1,152, 76, 38,183,194,105,147,142, 84,139,222,251, 44,123,236,179,207,223, 60,120,228,183, 59,137,191,
+255, 52,104,123,218,209,248, 49, 43,140, 68,175,209,237,112,246, 64,206,204,108,162,252, 91,101, 46,110, 56,227,124, 64,176,156,
+ 77,199,217,190,125,251,246,167, 83, 83, 83,197,106,181, 26,187,119,239,198,252,249,243, 13,122,189,158, 2,176,199,206,185,233,
+ 0,190, 64,253,165,183,236,133, 83, 6, 96, 26,128,174,245,210,152, 66, 81,242,204, 51,207, 24, 22, 44, 88,192,125,252,241,199,
+177,111,223, 62,191,145, 35, 71, 94,204,200,200,136,199, 95,205,136, 73,174,132,225,125,116, 25,112, 43, 62,107,133, 96,112,104,
+104, 40,182,111,223,238, 63, 97,194,132,228,162,162,162,222,176,223,196,201,166, 37,150,243, 97,226,108, 1,224, 85,169, 84, 58,
+165,111,223,190,222, 79, 62,249, 36,124,125,125, 97, 52, 26,145,155,155,219, 45, 49, 49,177, 91,106,106,106,129, 78,167, 91, 11,
+ 96, 19,128, 10,123,164,206,180,200, 67, 45,180, 18, 19, 19, 25,212,140, 80,179, 11,149, 73,142,248,224,161,232,246,187,148,172,
+ 40,171,210, 47, 24,185,244,104, 69,142,254,169,175,190,250, 10,207, 61, 49, 1,251,126, 23,227,244,206,189, 24, 56,190, 16, 3,
+ 39, 71,226,207,147,142,187, 69, 24, 12, 53,131,223,140, 70, 35, 12, 6, 3,244,122, 61,244,122, 61,196, 98, 49,174,221,188, 2,
+163,119, 9,231,249, 53,173, 56,161,109, 36, 72,221, 89,136, 3,171,115,116,138, 98,195, 92, 93, 57,126,170,103,223, 0, 95,175,
+ 90,181,106,210,148, 41, 83,176, 96,193, 2,252,244,211, 79,204,138, 21, 43,136,121,243,230,161,188,188, 28,253,250,245,195, 43,
+147,159,199,181,184, 16,188, 59,127,177,108,212,168, 81,248,248,227,143,161, 84, 42, 87, 57, 8,158,151, 78,167,179, 44,118,155,
+151,231,122,233,198,156,156, 28, 48,206,151, 82,131,183,132, 39,244,146,240,150,112, 72,226, 57, 14, 1,127,131,137,193,241, 5,
+189,192,137, 25,137,249,107,119,194, 68, 51, 24,247,212, 32, 68, 42,170, 32, 18, 75,106, 20, 41,109,186, 47,206,232,161,111,130,
+228, 10, 97,210,107,176,101,203,102,236, 57, 84, 1,157,252, 14, 94,123, 60, 10,129, 78, 56,141, 70, 35,211,188,121, 27,180,108,
+175, 3, 35,224,225,216, 93, 45, 98,251, 36,224,198,181,219,200,175,212, 35, 46,182,125,139,201,147, 95,132, 64, 32,192,237,219,
+183,177,100,201, 18, 40,149, 74,119,215,133,179,151,142,164,171, 95, 91, 43,124,245,197,215,222,187,144,126, 49,119,235, 23,187,
+126,153,246,238,148,175, 79,239, 60, 24, 59,112,124, 33, 6, 76,138, 36, 55, 92, 42,127, 22,192, 2,182,130,248, 80, 98,195,153,
+ 51,103,196, 42,149, 10,213,213,213,120,249,229,151, 49,109,218, 52,174,189, 74, 75,113,113, 49, 82, 82, 82,158,156, 62,125,250,
+152,194,194,194,222,112,190,238,165,119,167, 78,157, 82,143, 29, 59,214,218,195,195,195,178,147,166,105,232,245,122, 75,153,162,
+213,106,161,213,106, 33,147,201,144,154,154, 42,244,241,241,217, 5,231, 77, 24,127, 71,151, 1, 84, 85, 85, 61, 59,106,212,168,
+228,109,219,182,249, 71, 70, 70,226,251,239,191,247,127,241,197, 23, 79,222,189,123,183, 23,216,254,100, 44, 30, 94,204,121,230,
+153,103, 22, 7, 6, 6,146, 29, 58,116, 64,112,112, 48,180, 90, 45, 42, 43, 43,193, 48, 12,252,252,252, 48,105,210, 36, 60,245,
+212, 83, 33,201,201,201,203,143, 29, 59,182,160,188,188,124, 51,128, 53, 0, 50,173, 68,150, 83, 45,242,208, 59, 90, 9, 9, 9,
+ 39,234,168, 24, 2,233,103,254, 56, 21, 43,140, 1, 8, 18,200, 37,143,129, 0,129, 10,131,158,103,168, 34,215, 30, 62,124,216,
+ 91,169, 84, 66,161, 80, 96,104,223, 17,152,187,225, 23,244,124,190, 10,205,218,132, 96,245,135, 7, 12,174,132, 22, 77,211, 48,
+ 26,141,168,174,174, 38, 79,156, 56,225, 23, 30,209,140,120,254,173, 33,152,254,125, 59,200, 2,120, 56,248,121, 14,202, 83, 67,
+148, 76,105,197, 29, 93,121,217, 86, 59,133,239,228,247,223,127,127,210, 27,111,188,129,229,203,151, 99,217,226,143, 79,135, 4,
+ 5, 62, 18, 31, 31, 79,124,244,209, 71,152, 61,123, 54,194,195,195,193, 17,120,160,101,223,231, 49,107,214, 44,172, 93,187, 22,
+ 95,173, 94,170,111,231, 35, 77,187, 86, 86,111,181, 27, 3,128, 69, 3, 6, 12,120,226,240,225,195, 62, 66,161, 16, 87,175, 94,
+197,248,241,207, 67,204, 5,184, 28, 18, 96,104, 48, 52, 13,130, 96,224, 47, 19,192, 91,196,129,191, 7, 23, 49,126,116,251,114,
+ 70,218,250,106,153, 34,195,158, 32,242,245,224, 95,221,241,193,136,176,216, 73, 95,240, 40,129, 20,218,202, 66,252,182,102, 26,
+ 22, 45,254, 26,167, 82, 79,163,162,162, 2,131, 7, 14,192,154, 81,126,127, 89,127, 78,196,155, 35,206, 27,187,222,195, 43, 83,
+167, 99,227,250,117, 32,185, 66,252,118,226, 28, 14, 31, 61,137,148,148, 20,188, 52,113, 44, 62,143, 46,116,200,105, 50, 25,224,
+ 31, 16,142,199,250, 68, 65,234, 33, 5, 73, 0, 45, 34,252,225,231,155,135,160, 32, 2,105,167,143, 34, 57, 57, 25, 30, 30, 30,
+136,136,136,192,218,181,107,145,157,157,141,151, 95,126, 25,124, 62,223, 33,175,163,116,164, 32, 12, 32, 76,252, 86, 30, 30, 30,
+ 59,116, 58,221, 42,189, 94,191,247,249, 81,147,119,188,188,228,231,118, 61,159,175,226, 52,107, 19, 2,130, 65, 31, 86,104, 61,
+180,144, 24, 12, 6,152,215,115,206,205,205,117,122,112, 92, 92, 28,182,108,217,210,110,226,196,137,201,133,133,133,143,193,254,
+162,242,178, 78,157, 58,165, 38, 39, 39,183,214,104, 52,200,202,202,114, 43, 32,181, 11, 35, 43,157, 28, 98,238, 50,224, 99,221,
+101,160,172,172,204,220,101,192, 30,202, 80,179,142,234, 93, 59,255,133, 3,120,179,182,134, 15, 59,194,242,234,248,241,227,123,
+110,223,190,157, 23, 21, 21,133,125,251,246,249,141, 26, 53, 42, 37, 35, 35,163, 43,128,108, 54,233,176,120, 8, 49,113,225,194,
+133,164,201,100, 66,105,105, 41,180, 90,109,189, 60,200, 48, 12,196, 98, 49,134, 14, 29,138, 33, 67,134, 8,206,159, 63, 63, 53,
+ 41, 41,233,213,172,172,172,249,181,121,201,174, 22,249, 87, 9,173,122, 47, 94, 10,139, 62, 29,147,234, 37,144,146,177,160, 9,
+ 47, 63,191, 0, 9,151,203, 37,188,196,129, 94,171, 86,206, 46,187,121,243,230,189, 93,187,118, 5,119,239,222, 29, 96,128, 78,
+205, 6, 67, 94,120, 26, 94, 92, 53, 74,229,165,142,230,145, 98,126, 61,176, 91, 82, 94, 94, 73,183,137,108,167, 86,169, 84,228,
+129, 3, 7,194,122,245,238,201,219,155,250, 29,241,236,178, 96,200, 2,120,248,109,237, 93, 92,252,222, 64, 79,155, 56,162,242,
+207, 75,107,170,237,213,112,121, 60,222,140, 55,222,120, 3, 59,119,238,196,156, 57,115,182, 60,213,173,229,160,103,134,245, 37,
+ 83, 82, 82, 48, 98,196, 8,228,231,231,227,151, 95,126,193,252,249,243, 49, 97,194, 4,124,241,197, 23,184,240,227, 39,184,190,
+164, 43,111,238,206,219,215,232,155,196,240, 27,165,213, 7,109,104,179,111,220,184,241, 88,255,254,253, 79,238,221,187,215, 47,
+ 38, 38, 6,219,182,109,199,204,215, 95,197,143, 11, 70, 33, 58, 80, 12,232, 21,160,117, 42, 16, 60, 17, 96, 80,131, 41,191, 11,
+189, 94, 45,125,119,199,237,235, 38, 59,156, 94, 18,222,146,239,223,127, 34,172,211,212,109, 60,243,190, 91,183,239, 96,237,241,
+114,156, 74, 61, 13,115, 19, 69, 72,128,183,109, 84, 57,124,104,246, 56, 9,146, 66,199,151,190,198,220,170, 4, 28,218,188, 4,
+ 67, 95, 94, 8,121,105, 49, 82, 83, 83, 17, 26, 26,138,207, 55,110,198,140,233, 83, 97,162, 25, 71,207,156,215,166, 77, 36, 56,
+156, 2,240, 5, 52, 8, 0,122,125, 57,252,252, 40, 52,107,230, 7,128,176,184, 87, 4, 65, 96,216,176, 97,122,134, 97,138, 52,
+ 26, 77,233,174, 93,187, 8,103,233,232,147,209,169,161,124, 49,249, 40, 1,210, 51, 32, 32,144, 16, 8, 5, 8,244,142,192, 7,
+111,190, 6,197, 11,234, 71,183,109,219,182,235,219,111,191, 45, 72, 77, 77,221, 78, 8,124,110,203, 11, 21,209, 94, 92, 53,192,
+144,205, 1,154, 45,194, 30, 78,140,126,228,145, 71, 46,254,246,219,111, 66, 62,159,143,189,123,247, 98,254,252,249,134,178,178,
+178,147,182,162, 39, 48, 48,176,253,214,173, 91, 35, 34, 35, 35,177,110,221,186,118, 35, 71,142,156, 6, 96,137, 29,206,105,199,
+142, 29,107,173,209,104,112,241,226, 69, 76,152, 48, 33,187,168,168,232,170,173,192,139,136,136,232,181, 98,197, 10,110,231,206,
+157, 81, 85, 85,133, 65,131, 6,169, 0,188,234, 36,172, 13,233, 50, 0,160,102,173, 63, 7, 93, 6,224,235,235,251, 77, 78, 78,
+ 78, 63,145, 72,228, 52,130,244,122, 61,242,242,242,224,229,229,133,196,196, 68,159,150, 45, 91,126, 0, 96, 50,155,116, 88, 60,
+140,208,233,116,216,185,115, 39, 58,117,234,132,182,109,219, 66,161, 80, 88, 68,151, 78,167,131,209,248,215, 44, 72, 36, 73,162,
+107,215,174,136,142,142, 38,102,206,156, 57,206, 90,104,253, 27, 97,126,233, 46,176,109, 23,213,100, 35, 23,192, 56, 90, 36,120,
+ 95, 40, 20,142, 14,111, 30,139, 54,109,218, 8,159,126,250,105,190, 78,167,147,158, 56,154,252,103,207,158, 61, 81, 86, 86, 22,
+ 60,103,206,156,178,176,102, 97,116,242,164,114, 95,130, 41, 7, 71,199, 79, 1,234, 47, 58,170,229, 84, 55,223,251,231,242, 96,
+ 0, 56,158, 22, 81,253,204,160,177,165, 28, 14,135, 58,125,227, 24,209,123, 6, 5,255, 22, 34,164,237, 46, 4, 63,187, 51, 34,
+ 3, 43, 33,147,201, 28,206, 79,213,177, 99,199,118, 36, 73, 98,231,206,157, 0,240,193,141,236,194, 75,146, 35, 39, 62,219,179,
+120, 11,247,221,247, 63,196,220,185,115,241,210, 75, 47, 65,175,215, 99,249,242,229, 72, 77, 77,197,175,191, 28,135, 49,105, 46,
+ 86, 60, 93, 70,190,252,157,230, 87,189,201,219,255,118,121,121,181, 13,117,198,173, 91,183,122, 13, 29, 58,244,228,238,221,187,
+253, 90,183,110,141, 21,107,191,196,248, 55,167,224,236,210, 65,128,200, 7,188,222,239,130,240, 10,175,145, 67,101, 89,192,225,
+119, 29,114,114, 72,226,185,216,137, 95, 88, 4, 81, 70, 70, 6,166,207,122, 7,191, 29, 60, 12,115, 19,197,204, 55,167, 99,235,
+218,143,161, 60,179, 1, 66,159,102,144, 4, 68,161,234,238, 37, 0,144,219, 28, 42, 43,123, 0, 0, 32, 0, 73, 68, 65, 84,187,
+119, 91, 78, 0, 80,203,239, 66,113,239, 38, 34,135,188,137, 15,198,141,199,208,151,129,181,139,222,193, 11, 19,198,224,243,141,
+155, 17, 25, 25,137,207,215,111,194,228,201,147,100, 85, 57,185,173, 97,211, 76,113, 46,253,194,141, 85,171, 23,138, 85, 42,165,
+ 39,143,207, 15, 2,195, 32, 56, 56, 24, 85, 85,213, 48, 24, 12, 80, 42, 85, 32, 73, 18, 36, 73,130,195,225, 96,196,136, 17,188,
+228,228,228,102,127,252,241,135,127,173, 5, 28,109,109, 1,155,161,201,198,216,103,158,121,102,112, 96, 96, 32,233,235,235,139,
+ 62,125,250,192,100, 50, 65,171,213,130,166,105,240,249, 38,139,165,124,242,228,201, 57,122, 83,184,113,203,132, 36, 13,135, 40,
+215, 82, 90, 97, 82,227,173,105,205,226,111, 70, 70,102,102,102,252,192,129, 3, 79,254,248,227,143,126,195,134, 13, 67,203,150,
+ 45,185, 79, 63,253,180,191, 74,165, 26, 96,125, 96, 81, 81,145,247,132, 9, 19,206,229,230,230, 70,212,238,234,234,128,179,171,
+135,135, 7,178,178,178,204, 34,171,139,109, 37,140,207,231, 31,186,116,233, 18,151,207,231, 35, 61, 61, 29, 19, 39, 78, 44,205,
+206,206,118,213, 44,119, 95, 93, 6,104,154,214,218,251,143, 36, 73,193,249,243,231,225,106, 46, 64,146, 36,193,227,213,201,198,
+ 21,108,178, 97,241,144,194,160,211,233,208,165, 75, 23,100,103,103,227,252,249,243, 22,193, 85, 90, 90,138,130,130,130, 58, 7,
+159, 61,123, 22, 23, 46, 92, 64,239,222,245,230, 36, 95,240,111,236,163,101,113, 34, 18, 19, 19,251,216,216,118,124,137, 68,114,
+246,185,231,158,107,246,244,211, 79,123,113, 56, 28,104, 52, 26, 24,141, 70,164,165,165,161,109,219,182,170,118,237,218, 85, 12,
+ 31, 62,156, 40, 45, 45,237,127,245,234,213,172,210,210,210,120,153, 76,150,245,216, 99,143,105, 52, 26, 77, 61,165,229, 21, 69,
+233,150, 95,236,198, 3,128,228,237, 5,200,217,239,163, 48,168, 77,226,200,145,149,100,159, 9, 33,168, 42,214, 99,245,179, 55,
+240,235,166,163, 88,241,217, 10, 83,239,222,189,243, 22, 47, 94, 92, 80, 80, 80,240,152, 45,151,167,167,231,181,228,228,228,182,
+ 71,143, 30,197,236,217,179,191, 51,153, 76,203,132, 92,206,193, 73, 47,189, 18,166,215,235,113,254,252,121,248,248,248, 32, 39,
+ 39, 23,188,128, 56,196,246,123, 1,111,143,235,138, 56,239,114,232, 54, 15,198,141, 2, 53,198,239,210, 46,186, 89,172,156,231,
+ 32,110, 90,135,134,134, 38,111,223,190,221, 63, 48, 48, 16,227,158, 25,134,180,247, 98,193, 27,186, 2,151, 74,196,248,236,251,
+115, 0,128,183,199,117,113,200,233, 45,225,145, 1, 50,190,225, 70,126, 53, 9, 0,119,238,220,193,132, 23,198,227,224,161, 26,
+145,117,241,226, 69,140, 27, 55, 14,237, 99,162, 33, 22,242,161,173, 44, 2,109, 50,224,110, 94, 33,242,203, 52,101, 70,154,190,
+202, 48,200,134, 85, 19,133, 45,231,221,187,119,177, 98,249, 98,220,186,126, 9,122, 69, 25,120, 18,111,164,157,191,130, 62,125,
+250,130,161,141, 40, 47,202, 69, 78,169, 10,155,183,108, 69, 84, 84, 20, 84, 42, 21, 70,141, 26, 85,230,164,153, 34,227,198,141,
+ 27,209,107,215,174,197,252,249,243,241,203, 47,191,192,100, 50, 65, 32, 16,128,162, 40,240,249,124, 68, 69, 69,225,250,245,154,
+241, 4, 52, 77,227,252,249,243, 72, 74, 74, 98,108, 45, 96,107, 62,147,201,132,146,146, 18,232,116, 58,168, 84, 42,168,213,106,
+ 48, 12, 3, 14,135, 3,134, 97, 44,181, 29, 14,135,131,172,172, 44, 92,190,124,153,217,183,111,223, 39, 12,195,204, 97,203,176,
+135, 26,173, 67, 66, 66,146,183,109,219,230, 31, 28, 28,140,126,253,250,229, 22, 22, 22, 54,183,115,220, 30,134, 97,158,204,202,
+202, 66, 84, 84,212, 94, 0, 35,238,231,152,240,240,240,146,244,244,116,191,107,215,174, 97,220,184,113, 37,181,125,190, 92,245,
+125,138,136,137,137, 73, 63,124,248,176, 15, 73,146,184,122,245, 42,198,141, 27,167, 47, 43, 43, 59, 5,199, 77,142,119, 80,211,
+191,228,174,157,255,194, 1,204, 3,224,227,224, 92, 73,116,116,116,207,115,231,206,241, 8,130,192,157, 59,119,204,121,178, 75,
+ 45, 47, 11, 22, 15, 27,158, 10, 9, 9,249,118,218,180,105,158,221,186,117, 67, 94, 94, 30,242,243,243, 81, 94, 94,142,248,248,
+120,180,111,223, 30,183,111,223,198,161, 67,135,112,225,194, 5, 8, 4, 2,132,133,133, 65,186, 99, 39,190, 34,112, 13, 64,123,
+ 39, 90,228,223, 35,180,108, 33, 16, 8, 62,152, 56,113,226,140,215, 94,123,205, 71, 32, 16,224,236,217,179,224,241,120,160,105,
+ 26, 3, 6, 12, 64,118,118, 54, 70,140, 24, 81, 86, 88, 88,248, 52,128,147,238, 92, 76, 22, 44, 40, 28,254,126,112, 96,239,241,
+ 53, 53,189,228,237, 5, 56,183,183, 24,179,118,117, 4,201, 33,240,205,244, 27, 48,101, 54,167, 91, 71,197, 48, 0,140,205,154,
+ 53, 43,220,186,117,171, 93,161, 5, 96,242,148, 41, 83,190,153, 60,121, 50, 78,156, 56,129, 93,187,118, 97,216,176, 97, 24, 62,
+124, 56,190,253,246, 91,120,201, 79,227,147, 95,175, 97,236,135, 7,112, 53,171,198, 24,106, 31,233,139, 29, 31, 15,131,230,243,
+120, 48,165, 25, 72,216, 73,221, 56,246,167,194,209, 84, 15,100, 11,111,209, 79,126,254, 94, 79,105, 24, 30, 94,237, 46,198,139,
+ 67,226,192, 31,181,189, 65,156,173,130,165,133,215,179, 10, 2, 41,129, 20,111,188,250, 34, 62, 90,242, 41, 76, 38, 19,170,171,
+171, 17, 22, 22,102, 91,163,173,135,218, 38,138, 52,235, 38, 10,107,206, 39,135, 63,142,157,187,127,134,187,205, 20,124, 62, 31,
+ 90,173, 22, 45, 91,182,220, 12,251,205, 20, 25,151, 46, 93,138, 94,188,120, 49, 54,108,216,128,125,251,246,193,104, 52, 66, 32,
+ 16, 64, 34,145, 64, 36, 18,193,207,207, 15,151, 47, 95,174,115, 82, 85, 85, 21,102,206,156,153,137,250,195,213, 51, 46, 93,186,
+ 20,237,204, 82, 54,247,219,179, 36, 74,130, 64,101,101,165, 35, 62, 22, 15,161,216,226,241,120,171,253,253,253, 59,230,231,231,
+207, 66,253,165,172,188,159,125,246,217,171, 63,252,240, 67,240,157, 59,119,220, 18, 90,143, 61,246,152, 93, 71, 11,192,196,160,
+160,160,143,171,171,171, 43, 85, 42,213, 40,184,223,193,188,117,171, 86,173, 78,238,221,187,215, 79, 44, 22,227,250,245,235, 24,
+ 63,126,124,137, 92, 46,239,141,198,237,164,222,186, 77,155, 54,167,206,158, 61,235,203,229,114,145,158,158,142, 9, 19, 38,148,
+178,157,225, 89,252, 11,224, 1, 96,118,100,100,228,219, 83,167, 78, 21,180,107,215, 14,121,121,121, 40, 41, 41, 65,121,121, 57,
+ 78,159, 62, 13, 0, 8, 13, 13, 69,104,104, 40,110,222,188,137,148,148,148, 42,133, 66, 49, 25,192, 47,255,230,136,113,216, 71,
+ 75, 44, 22, 63,247,194, 11, 47,248,152, 76, 38,244,238,221,187, 76,167,211,153,102,207,158,237, 31, 20, 20, 4, 15, 15, 15, 12,
+ 26, 52,168,188,170,170,170, 59,224,254,146, 41, 2,147,236,110,241,239,193,210,100, 20,136,123,143, 15, 65,239,241, 33,232, 58,
+ 34, 0, 36,135,192,229,195,114,240, 75, 91,170, 94,152, 50,165,178, 89,179,102, 6,146, 36,209,188,121,115,227,246,237,219, 29,
+117, 86,250,246,235,175,191,126,212, 96, 48,188,244,242,203, 47,163, 79,159, 62, 48, 26,141,216,190,125, 59,100,185, 7,176,240,
+249, 46,142, 3, 98, 50,128,224, 73, 16,232,105, 10,115, 36,178,218, 6, 74,191, 89,246,106,191,167, 6,117,240,197,222, 99, 23,
+ 49,172, 13, 23,208, 85,223, 15,231,174, 43, 91,223,152, 26, 59,233, 75, 94,105, 81, 30, 26,169,137,194,194,169, 85, 85,163,145,
+155, 41, 12, 58,157, 14, 18,137, 4, 92, 46, 23, 2,129, 0, 70,163, 17, 4, 65, 32, 62, 62, 30,205,155, 55, 71, 78, 78,142, 59,
+ 22,112, 99, 91,202, 44, 30, 94,100,232,245,250, 33,249,249,249,214,142,143,165,179,248,179,207, 62,219,101,251,246,237,193,133,
+133,133,248,227,143, 63,128,154,169, 30,236, 33,189,168,168,232, 73,177, 88,140,173, 91,183, 70, 76,152, 48,225,156, 85, 31, 45,
+115,231,244, 45,133,133,133, 91,238, 39,140,182, 93, 6,182,110,221,234, 63,106,212,168,221, 42,149,170, 67, 99, 69,132, 72, 36,
+ 90,115,230,204, 25, 95, 46,151,139,180,180, 52,140, 27, 55,174,196,201,244, 14, 44, 88, 60, 76,168, 6, 48, 47, 43, 43,235,243,
+183,223,126,251,131,118,237,218,189, 58,101,202, 20,170,109,219,182,200,207,207, 71,118,118, 54, 90,182,108,137,220,220, 92,124,
+247,221,119,186,146,146,146,213,168, 25,108, 82,249,159,141, 49, 47, 47,175,187, 59,119,238,100,130,130,130, 44,253,132,124,124,
+124,138,230,207,159,207,200,229,114,198,215,215,183,192, 13,154, 58,171,123,135,132,132,156,184,120,241, 98, 86, 79, 95, 40,199,
+125, 17,193,124, 85,221,147,249,170,186, 39,179, 38,191, 27, 19,209,195,219,248,218,180,215,242, 62,255,252,243, 91, 27, 54,108,
+200,252, 31,123,215, 29, 30, 69,181,183,223,153,237, 37,189,147, 4, 18, 32,244,208,139, 32, 29,129, 32,132,122, 85,138,128,162,
+126, 72, 64, 44, 8, 4,244,114, 17,145, 4, 68,165,233, 5, 47,150, 0,210,171, 20,169, 66,128, 80, 36, 32, 37,161, 5, 18, 72,
+207,166,111,175,115,190, 63,178,179,110,194, 38,187, 27,192, 58,239,243,204, 51, 59,237,221,211,230,156,247,252,206,239,156, 89,
+187,118,237,157,252,252,252, 59,225,225,225,103,234,224,164, 2,228,130,189,221,219, 69,145,231, 7, 63, 71,122,182,141, 32, 97,
+222,162,156,107,241,145, 68,187, 44,130, 88,138,210,201,229,219, 69,100,220,191, 15,144,113,255, 62, 64, 46,223, 46, 34,150,194,
+235, 68,179, 64, 76,212,203,155,145,103, 26,251,220,114, 20,206, 86, 33,178, 37,251, 23, 12, 35,134, 29,147,201,182,184,182,164,
+117,176,236,102,125, 57,125,229, 66, 73,179, 6, 30,247,206, 38, 12, 50,156,223,183,142, 60,211,181, 19,201,201,201, 33,121,121,
+121,228,240,225,195,196,207,207,207, 0,224, 56,170,214, 22,114,180,125,129,223, 22, 68,125,132,243,226,143, 95,147,151,134,245,
+ 37,189,163, 27,144,168, 16, 57, 35, 21,241,212, 0,246,219, 61,127,188,121,243,230, 6,165, 82, 73, 84, 42, 21,185,126,253, 58,
+105,209,162, 69, 9,126,155, 17, 53,208,129, 9,184,124,252,248,241,196, 17,146,147,147,201,181,107,215,200,212,169, 83, 73,231,
+206,157, 73,207,158, 61,201,184,113,227,200,255, 17, 16, 0, 55, 28,112,142, 10, 13, 13, 45, 95,178,100, 9, 57,121,242, 36,217,
+176, 97, 3, 89,178,100, 9,121,255,253,247,201,230,205,155,201,141, 27, 55,200,158, 61,123,156,241, 57, 10,231,147, 0,199,249,
+199,112, 30, 78, 75, 75,179,149, 41,139,197, 66,114,115,115,201,145, 35, 71, 72, 72, 72,200, 13, 84,173,147,229,136,211,171,117,
+235,214, 55,111,221,186, 69, 30, 62,124, 72,140, 70,163,141,227,230,205,155, 4,192,169, 39, 16,206, 22, 97, 97, 97, 69, 39, 79,
+158, 36,183,110,221, 34, 33, 33, 33,217, 79, 50,238,145,145,145, 69, 10,133,130,156, 56,113,130, 4, 6, 6, 22,161,110,139, 45,
+ 87,150, 56,206,191, 50,103, 36,128,141,157, 59,119,182,172, 90,181,138,188,249,230,155, 36, 34, 34,194,130,170, 69,190,195,240,
+ 15, 66,173, 22,173,242,242,242,136, 55,223,124,243,242,179,207, 62,219,181,160,160,128,237,141, 25,104,154, 38, 10,133,130, 49,
+ 26,141,185,238,254,153,209,104, 44,184,126,253,122,192,138, 35,151,139,102, 47,154, 25,148,140, 60,217,179, 47,133, 96,239,178,
+ 76,188,216,127, 74, 89,108,204, 40, 83,100,100,164,205,130,117,235,214, 45,232,245,122,109, 29,148,228,153, 38, 62,221,118,204,
+110,141,125,103,239, 98,209,181,226,239,229, 34,222,174, 93,151,203,246,207,237, 9, 24,183, 79, 64,251, 23, 54, 96,243,162,161,
+ 0, 0,166,232, 6,140,219, 39,130,146, 5,224,116,174, 0, 21, 90,227, 1, 71,164, 77, 2,101,175, 14,108,198,199,222, 19,151,
+176,104,239,195,239, 45,132,212,155,179, 76,109,212, 1,136,158,178,250,124, 2,112,126,172,222,104, 9, 24,208,191, 31,246,253,
+184,159,110,213,170, 21, 54,109,218, 36,156, 56,113, 98,180, 59, 67, 20, 53, 57, 45, 12, 9,160,128, 98, 2,108, 17, 11,120,243,
+181, 6,139,142,109, 52,172,195, 20, 66, 7,195, 20,181,249,130,236,201,203,203, 59,113,225,194,133, 11,111,191,253,118, 11,137,
+ 68, 66, 9, 4, 2, 88, 44, 22, 48, 12, 3,139,197,130,242,242,114,220,186,117, 11,141, 27, 55,182,153,128, 15,120,122, 84, 2,
+170,255,212,198, 55,127,254,124,155, 73,185, 99,199,142,200,201,201, 65, 86, 86, 22, 46, 95,190,108, 51, 41,187,200,199,225,175,
+ 15,241,249,243,231, 33, 22,255,246,149,165,171, 87,175,226,173,183,222, 74,179,250, 84, 85,214,242, 92,101,122,122,122,207,161,
+ 67,135,158, 94,181,106, 85,107,251, 33,231,147, 39, 79, 2,128,254, 73, 88,223,114,115,115,251,196,196,196,172,244,247,247,239,
+ 80, 80, 80,176,224, 73, 70, 60, 43, 43,235,189,118,237,218, 45, 81, 42,149,149,110, 14,109,114,224,240, 87, 67, 22,128,137,169,
+169,169,203, 82, 83, 83, 63, 64,213, 84,250,197, 0,210,185,164,169, 5, 97, 97, 97,119,231,206,157,171,187,120,241,162, 37, 46,
+ 46,174, 68, 46,151, 79,171,135,226,149, 6, 4, 4,108, 13, 10, 10, 74,241,247,247,191,228, 17, 44, 82,200, 27,210, 70,207, 64,
+113,129,143,143,207,245,160,160,160,115,246,223, 65,244,243,243,251, 25, 64,120, 93,156, 45,131,229,211, 95,232,232,159,219, 42,
+ 68,182, 18, 85,159, 20,162, 90, 4,203, 14,239,158,224, 73, 52, 31,251, 17,205, 34, 47,162, 93,217,150,104, 87,182, 37,154,197,
+254, 68,187,162, 13,185,147,208,157,116,139,244,206,111, 26, 44, 15,248,189, 56, 89, 88, 87,113,111, 17, 25, 25,169,184,116,233,
+ 18,201,202,202, 34, 7, 15, 30, 36, 50,153,236,122,125,123, 16,246, 43,195, 87, 75,108,169,244, 72,101,101, 37,209,233,116,228,
+196,137, 19, 36, 56, 56,216, 81, 15,186,174, 94, 73, 16,128,213,109,218,180, 49,173, 88,177,130,236,221,187,151,172, 89,179,134,
+140, 26, 53,138,204,153, 51,135,140, 29, 59,150, 4, 6, 6,234,173,230, 95,111, 23, 56,235,203,199,245, 28,255, 94,156, 17,214,
+ 94,173,189,229,118,126, 13, 75, 86, 93,156, 94,214,251,107,179,252,114,121,196,113,114,156,127, 77,206,127, 46, 2, 3, 3, 63,
+ 93,176, 96,129,250,167,159,126, 50,206,156, 57, 83,213,160, 65,131,211, 79, 40, 35,130, 0,116, 7,208,165,150, 74,182, 94,153,
+219,222,219,219,187, 69,144,236,231,185,207,249,145,203,115,155,144,138, 21, 29,136,230,171, 30,228,110, 66, 87,242,229,203,205,
+ 73,135, 80,207,135,205, 3,101,109,255, 96,206,250, 12, 81,184, 85,176, 93, 28,166,112,133,211, 93, 19,240,211, 48, 41,115, 21,
+ 26,199,201,113,114,156, 28, 39, 39,180,254,190,104,214,172, 89, 70,187,118,237,238,199,197,197,165,253, 69, 50,151,106, 25, 36,
+ 31,219, 34, 72,190,187, 85,144,244, 94,155, 96, 89, 78,139, 32,217,177, 22,129,178,247, 59, 53,128,244, 79,194,217, 66, 36, 18,
+ 29, 9, 13, 13, 85, 0,120,229, 41,164,231,132,144,144,144,135, 86,107, 89,139, 39,192, 25, 13, 96, 43,128, 45, 0, 90, 63,129,
+112,186,202,199, 85,104, 28, 39,199,201,113,114,156,156,208,250,123, 98,218,180,105,124,174,192,112,156, 28, 39,199,201,113,114,
+156, 28, 39,199,201, 9, 45,247, 65,213,145, 88,199,158,114,130, 31,227, 56, 57, 78,142,147,227,228, 56, 57, 78,142,243, 31,199,
+233,140,251, 24, 56,112,202,156,227,228, 56, 57, 78,142,147,227,172,149,147,178,110,180,117, 99,143,255,204,113,167,254,196,113,
+255,167,112,254, 45,193,255,131,254,151,205, 8, 6,117,125, 61,153,195, 31, 9,251, 23,132,112,249,196,225, 79, 10, 15, 62,159,
+255,174, 72, 36,234,107, 54,155, 91, 3,128, 64, 32, 72,215,235,245,167,204,102,243, 23, 0, 84, 92, 18,253, 97,117, 7,207,174,
+177,181, 88, 55,252, 9,235, 18,123, 81,192, 60,102,187,244, 52,226,254, 79,230,252,219, 11,173, 14,114,185,252, 63, 34,145,168,
+ 9, 69, 81, 22,181, 90,125, 77,175,215,175, 3,112,238, 49,255,243,155,224,224,224, 87, 74, 74, 74, 24,246, 35,197, 20, 69,129,
+166,105, 8, 4, 2,109, 69, 69,133, 87,125, 72, 3,219,142,122,159, 79, 81, 51, 45,196,178,174,232,250,190, 79,156,157,231, 80,
+247, 11, 35, 20, 10,199,248,249,249,249, 40, 20, 10, 66,211, 85,171, 71,240,120, 60,118,133,121,115, 69, 69,197,247,174,146,249,
+250,250, 94,244,243,243,243, 97,159,167, 40, 10, 37, 37, 37,229, 69, 69, 69,221, 0, 64, 34,145,156,149,203,229,254,124, 62, 31,
+ 60, 30, 15, 60, 30, 15, 26,141,166,164,164,164,164,231,239, 25,105, 95, 95,223, 20,154,166,155,184,243, 12,195, 48,247,203,202,
+202,158,229,138, 76,117,108,223,190,157, 23, 19,246, 90, 20,159,104,219,211, 52,241,102, 24,170,194, 76, 73,175, 30,206,253, 38,
+195,149,231, 95,124,241, 69,139, 11,183,245,241,242,242,218,176,123,247,110,223, 78,157, 58,209,197,197,197,104,220,184, 49, 74,
+ 75, 75,187, 37, 39, 39,119,126,237,181,215, 94, 83, 42,149,147, 0, 36,115, 57, 82, 55, 68, 34,209,138,224,224,224,215, 85, 42,
+149,134,162, 40, 66, 81, 20, 40,170,170,159, 85,115,111,177, 88,114, 74, 74, 74,186, 56,105,108, 5, 34,145,232,243,144,144,144,
+201, 26,141, 70, 99,229,115,200, 11, 0, 38,147, 41,167,184,184,184,139, 75,117,125, 96,224, 58,169, 84,250,178, 70,163, 81, 83,
+ 20,197,216, 95, 35,132,216, 55,230,247,138,139,139,123, 59, 19, 6, 34,145,104,101,112,112,240,171,214,184,219,194,249,184,113,
+ 15, 14, 14,158,172, 86,171, 93,226,172, 35,238,143,112, 62,141,112,254, 73, 57,255,254, 66,171, 99,199,142, 91, 46, 92,184,208,
+ 92, 32, 16, 0, 0,116, 58, 93,187,213,171, 87, 79,154, 59,119,110, 34,128,121,245,252,191,164,222,189,123,143, 75, 78, 78,166,
+247,238,221, 75,119,237,218, 21, 20, 69,193, 98,177,192, 98,177,160,109,219,182,210,250, 70,196, 91, 46,139,191,124,244,107, 73,
+135,129,111,204, 44, 2, 62,113,118,190, 46,129, 9,224, 67, 0, 77,220, 12,130,194,154, 46,151,127,175, 70,252, 41, 9, 3, 74,
+ 40, 20,254,171,119,239,222,222,199,142, 29,163,178,179,179, 41,169, 84,106, 91,172,212,100, 50,161, 77,155, 54,110, 89, 66,125,
+124,124,188,226,227,227,163,158,127,254,121,236,220,185, 19,147, 38, 77, 66,175, 94,189,238, 20, 21, 21, 1, 0,228,114,185,127,
+ 90, 90, 90,115, 63, 63, 63,104, 52, 26, 84, 84, 84, 96,208,160, 65, 40, 41, 41,121,236, 2,238, 21,142, 38, 22, 1, 22, 7,134,
+ 75, 7, 40, 30,104, 23,169, 31, 98, 77,109,247, 10, 4,130,240, 7, 15, 30, 4,137, 68, 34, 16, 66,192, 48,140,195, 61,251,219,
+104, 52,162, 77,155, 54,198,218,248,158,233, 24,190,152,162, 41,219,135,133,137,217, 82,122,225,106,222,135,143, 27, 39, 63, 63,
+191,203, 98,177, 56,216,169, 90,182,107,200,116, 58, 93, 97,105,105,105, 39, 39,143, 68, 2, 24,206,227,241,154,241,249,252,150,
+ 0, 34,205,102,115, 48, 0, 8,133,194, 66, 30,143,151,101, 50,153,110, 25, 12,134,187, 0,126, 68, 29, 31, 64,142, 9,123, 45,
+138, 50,107, 94, 80,234,153,161,178,166,137, 45, 52,247,226,111,203,196,154,131, 49, 97,175,237,112, 85,108, 57,193,192,254,253,
+251,111,217,191,127,191, 68, 40, 20, 66,171,213,226,198,141, 27,240,246,246,134, 72, 36,194,200,145, 35,121, 61,123,246,244,239,
+215,175,223,206,219,183,111,143,135,123, 62, 31, 45, 0,108, 67,213, 7,165,223, 68,245, 47, 20,212, 7, 97, 0, 70,160,234,155,
+143,141,141, 70, 99, 49,128, 84,107,152,238, 0,136, 8, 12, 12,252,129, 97, 24,125, 73, 73,201,107,112,240,161,234,238,157, 27,
+ 94,162,105, 58,156,181, 9, 48,196,146,115, 62, 53,231,137, 52, 80, 52, 77,175,140,141,141,125,117,199,142, 29,178,212,212, 84,
+ 89,235,214,173,109, 29, 34,182,204,219,163,113,227,198,206,172, 26,124,154,166, 87,188,240,194, 11,227, 55,110,220, 40,123,240,
+224,129, 44, 52, 52,212,198,105, 47,182, 88, 56,251,132,152, 93,217,255,102,240,224,193, 19, 55,108,216, 32,216,183,111,159, 52,
+ 32, 32, 0,254,254,254, 14,191, 25,219,179,103, 79,198,121,212,233,149, 35, 71,142,156,184,117,235, 86,217,133, 11, 23,100,109,
+219,182, 5,143,199,123,236,184,143, 26, 53,106,252,150, 45, 91,100,215,174, 93,147, 53,107,214, 12,172, 81,161, 38, 31, 77,211,
+104,216,176,161, 75,156, 35, 70,140, 24,191,109,219, 54,217,229,203,151,101, 45, 91,182,180,165, 39, 91, 39,213, 39,156,127,114,
+206,127,132, 69, 75,100, 52, 26,113,234,212, 41,208, 52, 13, 63, 63, 63,188,242,202, 43, 56,122,244,104,252,137, 19, 39,246,215,
+195,178,245,141, 85,100, 9, 0, 96,215,203,163,112, 95, 0,188, 85,100,128, 80, 40,196,189,123,247,192,227,241,220, 54, 45,138,
+197,226,201,132,144,127,107,114,127, 17,107,181, 38,232,242, 46,201,164, 82,169,173, 1,208,228, 89,207,231, 95,146, 73,165,210,
+123, 60, 30,239, 99,149, 74,149, 84, 27, 95,179,102,205, 54,221,184,113,163,149,179,143, 61,215,132, 70,163, 65,163, 70,141, 34,
+ 74, 75, 75,155,253, 30,141,184, 51, 78,179,217, 12,137, 68, 2,214, 26,101, 48, 24,160, 82,169,156,113, 82, 66,161,112, 12, 43,
+178, 0, 96,243,230,205, 8, 9, 9, 65, 80, 80,144,237,163,210, 44,167,171,224,241,120,136,137,137,193,194,133, 11,145,152,152,
+136,217,179,103, 87,171,104, 5, 2, 1,252,252,252,240,211, 79, 63,193,203,203, 11, 17, 17, 17, 96, 5,126,173, 2, 42,130,166,
+ 76, 38,134,214,230,193,177,229,163, 1,164, 82, 30,150, 70,245,242,121,115,216,187,145,252, 6,205,101, 88, 60,248,210, 60,245,
+ 67,253,154,186,132,137, 80, 40,196,245,235,215, 31,169, 16, 28,222,207, 35, 48,136, 43,253, 26,247,145, 42, 28,137, 56,138,166,
+252,206, 93,122,104,179,208, 14, 25,208,138,255, 76, 39,254, 87,214,166, 18, 52, 13, 48, 76, 85,211, 73, 81, 32,102, 19, 83,118,
+233, 90,222, 2, 23,210, 51, 52, 43, 43, 43,200, 89, 26,177, 48,155,205, 8, 13, 13,229, 57,185,109,104,116,116,244,174,184,184,
+ 56, 97,179,102,205, 40,161, 80, 8, 62,159, 15, 62,159,207, 10,244, 8, 66, 72, 4,195, 48,253, 10, 11, 11,201,234,213,171,151,
+157, 60,121,114, 52,128,131, 14, 43, 22,162,109,175,212, 51, 67, 79, 95, 65,183, 23, 6,206,197, 79,219,227,187,245,238,200,192,
+ 83,166,205, 0, 80, 47,161,197,138, 13,139,153,161,238,100, 86,248,237,220,185,131,162,105, 90,175, 84, 42,193, 48, 12,122,246,
+236, 9,154,166,113,253,250,117,124,240,193, 7,216,181,107, 23,246,236,217, 35,237,220,185,243,183, 26,141,166, 53,170,190,197,
+230, 84,100, 69, 71, 71, 95,185,112,225,130,196,104, 52,162,123,247,238,231,111,223,190,221, 25,245, 91,193,221, 23,192,103,243,
+230,205,155, 24, 23, 23,199,243,241,241,129, 72, 36,130, 82,169, 68, 70, 70,198,228,239,191,255,158,172, 93,187,246, 75, 0,158,
+ 89, 89, 89, 61, 46, 94,188,136,254,253,251,191, 13,224,221, 71, 21, 1, 47,252,236,197,204, 32,246,120, 68, 76, 59, 97,143, 46,
+116, 97,149, 21,167,230,221, 4,140,133,201,185,248,107,174, 43, 66,108,217,168, 81,163, 38,236,216,177,195, 3, 0,254,251,223,
+255, 98,204,152, 49,240,243,243,131, 76, 38,131, 80, 40,132, 64, 32,168,182,119,210,216,242, 0, 44, 27, 59,118,236, 11, 27, 55,
+110,244, 4,128,141, 27, 55, 98,212,168, 81,240,247,247,135,167,167, 39, 68, 34,145,237,123,175,110,118, 48,190,233,213,173,219,
+148, 13, 27, 54, 0, 0, 62,120,231, 29, 60,255,204, 51,240,144, 73, 33,147,138,192,166,133,136, 39,192,144,183,102, 58,213,151,
+ 0,150,143, 25, 51,230,165,173, 91,183,122, 2, 64,106,106, 42,138,138,138, 16, 28, 28, 12,169, 84, 10,145, 72,100,139, 51, 69,
+ 81,144, 74,165, 46,197,125,204,152, 49, 47,108,217,178,197, 19, 0,146,146,146, 16, 19, 19, 99,139,187, 88, 44,134, 80, 40,172,
+182,213, 20,157,142, 56, 71,143, 30,253,194,182,109,219, 60, 1,224,251,239,191,199,192,129, 3,225,235,235,107, 75, 79,150,203,
+157, 60,250,147,115,254, 51,132,214,149, 43, 87,254, 37,151,203, 19, 0, 4,138, 68, 34,159,241,227,199, 55,156, 50,101, 10,198,
+142, 29,139, 19, 39, 78, 76,117, 83,104, 81,193,193,193,175, 36, 39, 39,219, 90,104, 3,121, 68, 48,185,221,128, 91,241,239, 75,
+ 83,167,134, 36,102,168,112,254,226, 45, 72, 64, 83, 23,151, 47, 15,212,221,189, 11,139,193,128, 69,247,148, 85,231,205,132, 58,
+245,222, 91, 33, 29, 86,124,249,111, 0, 73,117, 52,182, 98,189, 94,143, 59,119,238,184, 21,136,236,236,108, 71, 31,127,174,119,
+ 35, 30, 17, 17, 81,215, 11,232,148,243,240,225,195,152, 53,107, 22,110,221,186, 5,246, 83, 37, 46,112, 82,126,126,126, 62,172,
+200, 98, 69,144, 84, 42,133, 64, 32,160,248,124, 62,197, 14,237, 89, 95, 46,151,132, 49, 77,211,216,180,105, 19,150, 46, 93,138,
+ 57,115,230, 96,221,186,117,104,223,190,253,111,133,144,207, 71,101,101, 37,124,125,125,225,235,235, 91, 77, 32,214,134,202, 7,
+ 12, 1, 28,139, 44,105, 35,132, 72,165,252,131, 99, 63,137,234,208,246, 57,127,168, 74,140,216, 52,247, 14,138, 51,245, 59,156,
+165, 39, 33, 4,237,219,183, 7, 69, 81, 54,161,193,110, 2,129, 0,124, 62, 31, 60, 62, 15, 58,170, 18, 77,122, 9,241,206,206,
+ 86,210, 6,205,101, 82, 71, 34,174,102, 54,127,254,197, 42, 25, 24, 82,229, 4, 66, 24,128, 1, 8, 8, 24,194,160, 48, 55, 3,
+255, 89,248,169,203,173,143, 64, 32,192,221,187,119,109,225,102, 45,195,172, 48,178,183, 26, 68, 70, 70, 58, 45, 75, 66,161,240,
+163, 61,123,246,136, 54,109,218,132,173, 91,183,130,162, 40,136,197, 98,200,229,114,248,248,248,192,223,223,223,182,133,135,135,
+ 83,223,126,251,173,176,125,251,246, 31, 85, 86, 86, 30,116,156,231,196, 91,214, 52,177,197, 11, 3,231, 2, 0, 94,152, 75, 80,
+118,231,147, 14,116,249, 2,239,250, 91, 94,170,196,198,226,197,139,241,241, 51,207, 64, 36, 18,145,138,138,114, 9,219,185,224,
+209, 60,164,165,221,192,138, 21, 43, 48, 97,194, 4,220,187,151, 65, 34, 34, 34,245,179,102,205,242, 72, 76, 76,124,199,104, 52,
+ 46,114, 38,178,218,181,107,119, 38, 37, 37, 69,162,209,104,192, 48, 12, 14, 30, 60, 40, 27, 56,112,224,233,204,204,204,222,238,
+138,173,200,200,200,125, 41, 41, 41, 61, 3, 3, 3, 81, 81, 81,129,202,202, 74,152, 76, 38,240,120, 60, 68, 68, 68, 96,217,178,
+101,212,200,145, 35,103, 76,158, 60, 89, 39,149, 74, 89,203, 70,164, 35,174,154,239,247,234, 53, 95,249, 16, 82, 85,126, 8, 67,
+170,237, 75,139,178,240,206,123,174,125,189,170, 97,195,134,111,238,220,185,211,195,222,178,100, 47, 2,236, 69, 22,187, 57, 17,
+ 6,116,163, 70,141,166,252,240,195, 15, 54,206,128,128,128,106,239, 15, 77,211, 56,125,250, 52, 18, 62,154, 7,223,192, 80,172,
+ 90,243, 95,151,134, 11, 99, 98, 98, 94, 78, 74,250,173,234,110,215,180, 41,134,245,124, 6, 65, 1, 94, 8,240,245,172, 74, 39,
+134,194,213, 91,153, 78,219, 35, 0,116,195,134, 13, 95,219,190,125,187,135,125,135,144,141, 43,219,121,102,173,248, 6,131, 1,
+ 93,186,116,113, 41,238,246,156,172,181,141, 21,109,108,122,178,255,195,190,175, 78,194, 57,133, 21,194, 86,193, 89,141, 67, 32,
+ 16, 96,251, 79, 27,106,181,102,215,151,211,221,124,175,201,153,149,149,133, 37, 75,150,128,237,180,217,187, 10,133,133,133, 97,
+213,170, 85, 78,235,165, 26,239, 64, 87, 0,129,118,167, 12, 0, 68,118,123, 5, 69, 81,191, 56,184,143, 61, 47,176,142, 88, 5,
+ 90,219, 14, 37, 0, 31, 7,124,181,241, 20, 91,219,188,192, 26,247, 87,251,159, 90,133,214,254,253,251,217,183,184, 95,108,108,
+236, 41,235,239,114,177, 88,156, 45,147,201, 66, 0, 40, 15, 30, 60,136,255,251,191,255,131,213,180, 58,194,219,219,251,134, 3,
+171,206, 21,189, 94, 63, 23, 64,161,245, 20,107,174,167, 75, 75, 75,153,163, 71,143,210, 27, 71, 15,134,129, 0, 29,255,157,128,
+152,216, 88, 28, 14, 19,129, 7,160,219,205, 98,200,100, 50,126,101,101,165,201,222,111,203,129,239,214,177, 26, 5,138, 39,225,
+243,209,253,204, 1,204, 58,115, 0,221,228, 34,148,236,216, 6,229,217,100,208, 52,133, 62,242, 0,204,158,112, 20,207,122,137,
+ 33,210,171, 65,211,180,163,146,109,227,188,115,231,206,139, 94, 94, 94, 9, 53, 18,216, 21,220, 71,213,119,156, 80, 75, 56, 93,
+106,196,217,237,242,101,135, 35,144,181,114, 90,135,224, 32,151,203,113,252,248,113,219, 61,207, 61,247, 28,116, 58, 29,252,252,
+252, 92,226, 84, 40, 20, 36, 47, 47,143,218,184,113, 35, 4, 2, 1,252,253,253, 33,147,201,168, 13, 27, 54,204, 19, 10,133,225,
+ 58,157,142, 49, 24, 12, 16,137, 68,171,216,252,225,243,249,234,202,202, 74,255,218, 56,121, 60, 30,226,226,226,240,254,251,239,
+ 99,221,186,117,152, 58,117,234, 35, 22, 47,157, 78,135,128,128, 0,155,216,114,240, 2,186, 52,244, 35, 11, 67, 91,159, 96,209,
+145, 41,171, 90, 5,135,181,148, 35,101, 75, 1, 14,172,204,202, 81, 23, 90,190, 48,148, 97,167, 51, 78, 66, 8, 50, 50, 50,106,
+ 21,195, 37,101,197,120,255,227, 55,209,241, 53, 57,106, 17,113,191,113, 50, 4, 55, 46, 31, 70,218,181, 99, 96, 44, 12, 44, 12,
+ 1, 33, 22, 48,102, 32,245,232,249,230,249,247,243,194, 8, 72,149,235, 45, 0,113,133,202,220,215, 95,212, 18,192,222, 83, 37,
+134, 21,206,226,206,231,243,161,211,233,176,103,207, 30,220,188,121, 19, 7, 15, 30,132, 86,171, 69, 64, 64, 0,124,124,124,240,
+204, 51,207, 96,242,228,201,136,140,140,116,154,239,132,144,164,236,236,236,142,189,122,245,162,202,203,203, 81, 94, 94, 14,173,
+ 86, 11,139,197, 2,179,217, 12, 62,159, 15,137, 68, 2,169, 84,138,224,224, 96,232,116, 58,162,215,235,147,106,227,100, 24,170,
+ 66,115, 47,254,246, 79,219,227,187,189, 48,151, 96,199, 82, 10, 81,141,196,154,227,151, 60,167,236, 61, 51,123, 16, 0,194, 16,
+155,105,129,152, 44, 76,241,251,243, 62,155, 81, 87, 56,217, 60, 73, 73, 73,193,140, 25, 51, 96,177, 88, 40, 1,159, 15, 66, 8,
+ 40,154,198,237,219,183,177,122,213,106,140, 27, 55, 14,205,162,162, 96, 48, 26,161, 82,169,208,191,127,127,193,170, 85,171,250,
+217, 9,173, 99,117,136, 44,127,173, 86, 11,165,178,202,248, 37, 18,137,176, 99,199,142,128,225,195,135, 39,231,229,229,213,245,
+ 61,210, 71, 56, 61, 61, 61, 35,120, 60, 30,174, 95,191,142,181,107,215,226,248,241,227, 40, 44, 44, 44, 11, 13, 13,245,238,215,
+175, 31,253,206, 59,239,160, 99,199,142,248,238,187,239, 36,206, 56, 9, 33,200,186,115, 26, 89,119,207,128, 97,170,132,101,213,
+230,248,119, 29, 61,160,106,225, 84,171,213,186, 43, 87,174,120,172, 95,191, 30, 65, 65, 65,104,220,184, 49,100, 50, 25, 36, 18,
+ 73,181, 70,214,190,225,117,246,110,106,181, 90, 93, 86, 86,150,199,150, 45, 91,224,239,239,143,200,200, 72,200,100, 50,136, 68,
+ 34,240,249,124, 80, 20,133,141, 27, 55, 98,243,194, 9,200,186,117, 13,163,134, 13,114, 26, 78,153, 76,246,114, 82, 82, 82, 53,
+ 19, 72,176,175, 47,248, 2, 26, 60, 1, 5,223,231, 70, 3, 0,202, 78,236,174,178, 85, 57,143, 59,165, 84, 42,117, 23, 46, 92,
+240,184,116,233, 18, 24,134, 65,100,100, 36, 52, 26, 13,188,188,188,108,241, 63,122,244, 40, 70,142, 28,137, 77,155, 54,161, 71,
+143, 30, 78,227,174, 82,169,116,215,174, 93,243,248,225,135, 31,224,231,231,135,134, 13, 27,218,226,206,110, 2,129, 0, 60, 30,
+ 15, 77,154, 52, 65, 69, 69, 5, 60, 60, 60,156,230, 81,106,106,170,199, 15, 63,252, 0, 95, 95, 95,132,135,135,219, 44,110,172,
+ 56, 90,250,213,194,106, 4, 18,170,193, 99,115,186,155,239, 53, 57, 71,141, 26,133,168,168, 40,120,121,121, 65, 46,151,219,184,
+235,226,172, 69,139,216,244, 54, 69, 81,251,237,222,137, 88,138,162,246,219,239,107,187,207,250,179,207,188,121,243,186, 36, 38,
+ 38, 46,233,209,163,199,150,148,148,148,205,181,241,213,198, 51,111,222,188,232,196,196,196, 37,246,247, 59,248,159,218, 45, 90,
+177,177,177,148, 53,146, 20,128,198,157, 59,119,254,229,196,137, 19,126,158,158,158,182,155, 31, 62,124,136,242,242,114,120,122,
+122,122,125,254,249,231, 94,253,250,245, 67,112,112,176,173, 7,112,231,206,157, 54, 45, 90,180,168, 4, 80,211,110,203,208, 52,
+141,103,159,125, 22, 55,172,163, 29, 49,177,177, 8, 15, 15,183, 57,121, 72, 36, 18,204,152, 49,131,154, 53,107, 22,159,181,102,
+ 16, 66,160,213,106,209,160, 65, 3,105, 93, 86, 8, 0,136,214, 22, 99,119,191, 62,160, 41, 64,115,249, 34,132, 34, 10, 52,143,
+ 66, 39, 82,130, 67,253,251,128, 2, 96,248,245, 28, 92,176,194, 92, 6, 48,232,105,152, 15,157, 53,226, 14,226, 69,213,151,147,
+181,104,164,164,164,192, 98,177,184,202, 73,104,154,134, 92, 46, 71, 72, 72, 8,164, 82, 41,100, 50, 25,181,101,203,150, 15, 27,
+ 55,110,220, 96,214,172, 89,116,101,101, 37,253,236,179,207, 98,204,152, 49,124,118,136, 51, 58, 58,218,105, 92, 78,157, 58,133,
+181,107,215, 98,234,212,169, 14, 45, 90, 20, 69, 33, 48, 48, 16, 94, 94, 94,245, 78, 95,113, 35, 68, 6,132, 75, 78, 77,255,174,
+173,143, 87,144, 16, 63,173,121,136,195,171,179,119,235,138,241, 57,204,184, 5,160,204, 85,139,150, 35, 1, 12, 30, 3,139, 95,
+ 9, 94, 93,221, 28, 97, 45,189,145,178,165, 0, 7,191,120,104, 81, 41, 76,179, 29,136, 56, 48, 0,140,102, 19, 52, 42,173,109,
+ 72,215, 98,177,224,218,201, 95,155,223,255,245, 78,244,254, 45,155, 4, 0,160, 59,185,187,218,160,231,152,175,182,181,232,235,
+ 43,184,112,170,204,116,161,174, 50,207,231,243,241,202, 43,175, 32, 49, 49, 17, 47,191,252, 50, 14, 30, 60,136, 5, 11, 22,224,
+245,215, 95,127,196,170,229,172,231,104, 50,153,190,158, 52,105,210,212, 29, 59,118,180,156, 59,119, 46,205, 90,180,100, 50, 25,
+ 40,138,130, 78,167,131, 94,175,135, 86,171,197,173, 91,183,152, 55,222,120,227,182,193, 96,248,186,214,225, 74, 74,122, 85, 38,
+214, 28,108, 26, 78, 71,169, 51, 63,245,236,245, 76,164,150,146,118,174, 24,221, 98, 32, 25,250, 74,164, 47, 8, 1, 97, 0,134,
+ 0,122,189, 26, 51,102,188,205,115,165,172,103,221, 57,141, 43,151, 47, 66, 42, 21, 67,165, 84,193,194, 88, 64, 24, 2,177, 80,
+128, 15, 63,152,143,113,227,198, 35,170,105, 83, 88, 44, 22, 8, 5, 66,124,255,253,247,232,210,165, 11, 12, 6, 67,107, 23, 44,
+ 89,254, 58,157, 14, 87,174, 92, 65,255,254,253,145,157,157,141,244,244,116, 52,111,222, 28, 27, 54,108, 8, 28, 63,126,124,114,
+ 81, 81,145,203, 31,127,191,118,237,218,188, 14, 29, 58,172, 84,169, 84,165, 42,149,106, 37,128,205, 0,202, 51, 50, 50, 90,103,
+100,100,172, 62,124,248,112,239,255,252,231, 63,188, 26, 62, 58,188, 90, 34, 15,147,201, 12,173, 86, 95,167,192, 98,143, 9, 97,
+ 92,122,103, 40,138, 34, 45, 91,182,196,240,225,195, 33, 16, 8, 32,147,201,224,225,225, 81,109,216,172,166,224,170, 43,139, 0,
+ 48, 20, 69, 33, 52, 52, 20, 67,135, 14,133, 80, 40,172,198,201,150,195,161, 67,135, 98,230,162,127,227,235,153, 3,176,118, 82,
+115, 12, 92, 92,232,204, 53, 67,245,243,207, 63, 75,223,159, 58, 21, 29,154, 53, 67,128,151, 23, 26, 5, 7, 66, 42, 22, 65,104,
+ 31, 38,202, 37, 35, 59, 1,192,240,120, 60,180,109,219, 22,133,133,133,200,204,204, 68,102,102, 38,104,154, 70,175, 94,189,108,
+ 86,152,187,119,239, 98,209,162, 69,208,235,245, 46,199,189, 89,179,102, 24, 48, 96, 0, 68, 34, 17,100, 50, 89,181, 33, 67, 54,
+ 77,149, 74, 37,162,162,162,176,119,239, 94,180,104,209,194, 41,103,171, 86,173,208,183,111,223,106,233, 41,149, 74,109,162, 8,
+ 0,178, 47,168,108,255, 17, 22, 22,230, 22,231,145,139, 15,177,254,232,207,208, 27, 24, 84,106, 76,213,189, 48, 2,188,112,230,
+135,185, 46,197,157,229,252,223,255,254,135,242,242,114, 91,221,201,118,202, 89, 35, 74,195,134, 13,241,223,255, 58,182,100,214,
+208, 34,142,234,129, 88, 23,219, 91,246, 62,182,112,137, 19, 19, 19,151,212,124,222, 25,159,253,245, 26,207, 27,106,136,179, 66,
+183,134, 14,197, 98,241,252,159,127,254,217,175,162,162, 2,119,239,222, 5, 77,211,182, 49,117, 62,159, 15,163,209,136,123,157,
+170, 47, 17, 0, 0, 32, 0, 73, 68, 65, 84,247,238,193,207,207, 15, 69, 69, 69, 16,139,197,224,241,120, 48, 24, 12, 0,208,169,
+182, 6,156, 16,130,153,138, 42, 23,161,159, 66,133,200, 2, 48, 76, 81,245, 98,176, 14,241, 59,119,238,132,135,135, 7, 60, 61,
+ 61,109,123,103,195, 72,215, 50, 51, 80, 40,160, 64,159, 59, 13,138, 6,104, 10,160,120, 0, 77, 19,208, 20, 5,250, 92, 50, 40,
+ 10,144,251,251,186,219,118, 59,115,140,175,211, 1,222,157, 70,188,230,239,147, 39, 79,194, 85,206,168,168, 40,120,120,120,216,
+182,195,135, 15, 87,179,104, 89, 44, 22,248,251,251,187,194, 73,172,254, 56, 8, 10, 10,130, 64, 32,160, 54,108,216, 48,175, 73,
+147, 38, 13,222,123,239, 61,154,199,227,225,242,229,203, 72, 75, 75, 67,100,100,164,203, 62, 91,229,229,229,249,243,230,205,179,
+204,155, 87, 53,135, 34, 58, 58, 26,229,229,229, 69,182, 97,192,202,202,146,193,131, 7, 87,243,219, 40, 46, 46, 46,169,197,179,
+ 66, 32, 15, 71, 44, 33,168,212,100,227,103, 54,204,222, 17,240, 22,120, 10,142,188,254,101, 43, 31,175, 32, 33, 14,173,122,128,
+ 35, 95,230,236,212, 21,224, 67,171, 79, 16,227,106,166, 59, 26, 54,206, 45,200,198, 27, 31,142,198,164, 53,209, 96, 69, 28,239,
+ 78,123,144,146,242, 82, 67, 89,105,146, 35, 17,199, 48, 12,204, 70, 51, 52, 58, 29, 84, 74,141,205, 58, 84,148, 87,232, 51,119,
+214,187,130,229, 51, 94, 5, 0,204, 90,177, 6,202,117,191, 85,100,187,103,141, 11, 26,253,217,214,120, 0, 35,235, 10,167, 74,
+165,130, 78,167, 67,211,166, 77,145,146,146, 2,165, 82,137, 33, 67,134,128,162, 40,219, 12, 81, 55, 96,200,205,205,237, 25, 27,
+ 27,251,203, 23, 95,124,209,180,117,235,214,148, 90,173,134, 70,163,129,253,254,218,181,107,100,243,230,205,247, 53, 26,205,179,
+ 86,211,185, 67, 28,206,253, 38, 35, 38,236,181, 29,199, 47,243, 98,131,162,110,123,229,150, 53, 53,151,228,138,213,149,218, 91,
+ 58, 11, 73, 3,177, 0, 22, 48, 32,102, 6, 22,235,176,151, 11, 53, 39, 76, 38, 51, 44, 22, 6, 15, 31, 62, 68,122, 90, 26,218,
+181,109, 9,157,222, 12, 33, 95,128,153, 55,110,160,213,120,192, 32, 20,128, 97, 24, 80, 20,141,169, 83,167, 26,173, 67, 6,181,
+ 66, 42,149,174, 62,115,230,140,191, 78,167, 67,106,106, 42, 38, 78,156,104, 40, 46, 46, 22, 1,192,203, 47,191,108,216,184,113,
+163, 40, 42, 42, 10, 27, 54,108, 8, 28, 51,102,204,118,181, 90,221,214,197, 52,221,148,159,159,191,169,230, 73,127,127,255, 85,
+ 15, 31, 62,236,103,239,243, 99, 54,155,109,193,113, 24,117, 6, 48,153, 76,208,106,245,168,168, 80,194, 96, 52, 89,235, 76, 6,
+ 22,139,217,186,103, 96,182,214,163, 34, 33,223,179, 83,219, 16, 21, 33, 4, 52, 69,149,167, 94, 47,104, 88,151,104,119, 52,196,
+229,162, 53,171, 38, 44,236, 44, 51,127,127,127, 8, 4, 2,108,218,180, 9, 87,207, 30,134,136, 71, 96, 49,155, 96, 54, 25, 97,
+ 49, 25, 32,224,241,112,252,114, 38, 6,181,242,116, 73, 16, 6, 4, 4, 96, 88,143, 30,136,237,209,163,106,122, 27,159, 15, 15,
+177, 24, 50,161,164,202,146, 5,128, 88,104, 87, 23, 17, 96,216,112, 6, 7, 7,227,210,165, 75,152, 57,115, 38,150, 46, 93, 10,
+169, 84,106,155,253,124,243,230, 77,108,219,182, 13,131, 6, 13,114, 59,238,172, 5, 47, 62, 62, 30,121,121,121, 88,177, 98, 5,
+ 58,119,238, 12,129, 64,128,242,242,114, 60,251,236,179, 40, 44, 44,116,137,211,126,120, 79, 36, 18, 85,179, 62,177, 2,208,221,
+ 60,178,231,124,117, 84, 3,236, 59,187, 25, 20, 40,156,255,225,221,106,162,240,191, 91, 79,187,205,185, 96,193,130,106,225,116,
+197,154,229,178, 31, 82,117,171,147,211,251, 40,138, 74,101,141,173,241,241,241,243, 41,138,218, 31, 31, 31, 63, 63, 33, 33,225,
+134, 43,124,142,174, 83, 20,117,192, 42,194,134,217,157, 75,117, 75,104,201,100,178,110, 30, 30, 30,184,123,247, 46,134, 12, 25,
+ 98, 40, 41, 41,185, 45, 16, 8,154, 23, 23, 23,139,139,138,138,160,209,104, 84, 31,127,252,113, 38, 0,105,247,238,221,163,142,
+ 31, 63,142,236,236,108,108,220,184, 17, 0,118,215,230,167,195, 48,140,173, 80,212,236,182,241,120, 60,156, 59,119, 14,231,206,
+ 85,119,253, 90,191,126,189,211, 6, 99,204,158, 31,113,249,242,101,216, 47, 15,192,254,182, 63, 39,145, 72,128,186,103,120, 84,
+131, 51,199,120,103, 14,240,174, 54,226,181, 85,128,174, 22,196,220,220,220, 90,159, 63,119,238, 92, 53,139,150, 51, 78, 30,143,
+ 7,139,197, 2,169, 84, 74, 9,133, 66, 74, 40, 20,134,179, 34,139,199,227,217, 94, 24,177, 88, 12,177, 88, 92,173,151, 90, 27,
+242,242,242,250,231,229,229,213,122, 93,161, 80,244, 84, 40, 20, 46,197, 85, 22,134,143,158, 29,219, 96, 30, 0,156,221,154,255,
+157,230, 33, 94, 7, 0,194,167,118,189,250,121,139,168,192, 72, 41,206,109, 47,192,145, 47,115,246,232, 10,176,208, 58,164,203,
+184,154,230, 7,142,238,197,155, 83,167, 65,204,147,217,249,100,209, 40,231,101, 99,250,198, 22, 96, 69, 92,234, 70, 3,246,111,
+253, 8, 41, 71,159, 55,213,101, 41, 51,154, 76,208,106, 12, 80,170,180,248, 40,225,187,170,147, 31,225, 2,128, 11, 61,223,156,
+137,184,152, 65, 3,220, 29,166,102,211, 59, 40, 40, 8,167, 78,157, 2, 69, 81,216,190,125, 59,188,189,189, 17, 19, 19, 3, 47,
+ 47, 47,196,199,199,227,197, 23, 95,116,183, 50,171, 40, 41, 41,233,249,206, 59,239,252,242,233,167,159, 54,106,216,176, 33, 12,
+ 6, 3,140, 70, 35, 12, 6, 3, 50, 50, 50,176,121,243,230,108,141, 70,211, 19, 64,133, 51,178,195,185,223,100,236, 74,158,149,
+ 55,112,236, 24,237,205,194,159, 80, 80, 80, 2,179, 57, 23,140,197, 12,163,217, 82,101,225, 51,155, 97, 54, 91, 32, 20,242,188,
+ 62,253,228,221,163, 12, 8,104,154, 50, 0,120,190, 54,177, 17,209, 48, 8, 94,158, 94,104,221,170, 9, 78, 28, 90, 15,131,209,
+ 12,163, 65, 13,227,244, 24,164,103, 29,135,229,254, 49, 88, 24, 11,206,164,164,233, 77, 22, 34,144, 74,229, 84,195, 6,158,188,
+ 59,247,117, 14,195,233,227,227, 19,173, 80, 40,112,231,206, 29, 76,158, 60,185,160,164,164, 36, 29,192,115, 0, 80, 82, 82,114,
+102,226,196,137,173,147,146,146, 66, 26, 55,110, 12, 15, 15, 15, 47,181, 90,237, 44,234, 30, 0,226, 0, 12, 70,117, 7,252, 82,
+ 0, 31,211, 52, 45, 78, 77, 77,125,100,166, 93,114,114, 50, 0, 92,112,220, 3,178, 90,180,116, 58, 40, 74,202,240,250,155, 31,
+254,214, 51, 2,169, 38, 46, 8, 8,166,189, 5, 9, 0, 20, 23,102,224,213,215,103,138,235, 84, 28, 12,227,176, 33,116,195, 71,
+167, 90, 71,141, 45,163, 30, 30, 30, 85,195,111,123, 55,227,192,103,111, 2, 22, 35,136, 73, 11, 24, 53,128, 81, 5,198,160, 1,
+ 37,148, 2, 38,173, 75, 66,203,195,195, 3, 30, 82, 41,130,124,124, 64, 8, 1,159,199,131, 64,192, 7, 99, 2, 40, 11,101, 43,
+ 35,140,197,165,178,110,235, 84, 74,165, 82,100,101,101, 33, 46, 46, 14, 70,163, 17,163, 70,141,130,193, 96,128, 78,167,131, 86,
+171, 69,147, 38, 77,160,209,104, 92,226, 99,103, 43,122,120,120, 64, 40, 20,226,221,119,223, 69,151, 46, 93,176,104,209, 34,204,
+153, 51, 7, 77,154, 52,193,180,105,211,176,121,243,102, 68, 71, 71, 59,227, 37,246,121,196,166, 39, 43,182,236,135,248, 0,184,
+157, 71, 53, 57, 41,138,174, 38,216,216,237,237, 73,207,185,205,153,152,152, 8,133, 66,241,136, 37,139,253, 29, 22, 22,134,175,
+190,250,170,190, 35, 67,172,245, 40,216,193,181, 97, 53, 45, 81,132,144,174, 86,223, 41,125, 66, 66,194,141,132,132,132, 88,138,
+162,246, 39, 36, 36,196,214,102,209,114,196,227,224,186,194,213, 48,243,107,140,141,246,179,191,200, 38,180,159,159, 31,175, 81,
+163, 70,180,151,151, 23,202,203,203, 17, 24, 24, 72, 20, 10,197, 88,153, 76,182,112,203,150, 45, 81, 42,149, 10, 55,111,222,196,
+170, 85,171, 46, 0, 88, 89,151,208, 58, 24,104, 53, 29, 91, 45, 89,246,199,195,135, 15, 71,227,198,141,171, 89,179,164, 82,105,
+157,133,135,189,102,107, 20,121, 60,180,104,209, 66,122,255,254,125,173, 80, 40, 68,120,120,184,180,160,160, 64, 43, 20, 10,221,
+158,233,226,204, 49,222,153, 3,188, 35,225,211,181,107,215,106, 22, 44,251,189,253,239,125,251,246, 57, 29, 58,100, 57, 91,183,
+110,109, 75, 47, 79, 79, 79,246, 89, 0,192,144, 33, 67,192, 48, 12, 2, 2, 2, 92,226,100, 69,173,213, 1, 30, 58,157,142, 81,
+ 42,149,116,106,106, 42, 68, 34, 17, 60, 61, 61,109,190, 58, 18,137,196,102,205,252,189, 32, 16,209, 83,198,124, 80,101, 96,244,
+111, 40,126,117,239,178, 76, 80,192,229,161,111, 71,246,111,218,213, 27,149, 69, 70,236,255, 60,235,129,174, 4, 9, 0,110,185,
+ 99,201,210,209,149, 94,235,206,188,131, 14, 47,139,208, 64,215, 11,159, 46,168, 42,202, 19,103,140,198,176,215,249, 96, 69, 28,
+125,167, 29,182,127, 55, 31,205,154, 53, 3, 33,132,170,189, 66, 96, 96, 48,153,160,213,106,161, 82, 85,173,155,153,113,189,250,
+ 8,163, 81, 95, 89,255,180,176, 86,176,165,165,165, 56,124,248, 48,126,250,233, 39,116,233,210,197,161,168,118, 67,112, 41, 74,
+ 75, 75,123,205,158, 61,251,252,226,197,139, 67,253,252,252, 96, 52, 26,241,240,225, 67,124,251,237,183,121, 26,141,166,151, 59,
+ 21, 12, 8, 96, 50,153,161,211,232, 81, 81,169,196,194, 79,190,175,181,232, 1, 64,105,209, 45, 12, 31,241,162,168, 46,177,209,
+ 48,204, 7,201,201,201, 24, 52,176, 23,134,141,156, 92,171,216,120,115, 70, 53,177, 33,172,163, 35,240, 94,175, 94,189, 62, 81,
+ 42,149,229, 26,141,230, 69, 0,203,237,251, 83, 37, 37, 37,189, 71,140, 24,241,133,159,159, 95,231,162,162,162,249, 46,196, 58,
+ 62, 43, 43,107,126, 68, 68, 68,181,147,122,189, 30, 17, 17, 17, 45,138,138,138, 38,244,233,211,231,223, 0,252,236, 46,123, 2,
+ 56, 2,224,171,218,202, 18, 59,116,168, 82,105,225,229,211, 0,185,153,167,156, 6, 68,200,211,129, 48, 76,157,117, 8,219, 1,
+174,109,115, 50, 51,238,145,160,178,247,178, 13,246,243,255,154,132,231,227, 18, 33, 19, 0, 75, 94,237,137, 38, 62, 0,164,126,
+ 16,246,153, 11,202,199,154, 70,113, 63,186, 68, 62,103,237, 90, 92,182,214,199,225,129,129,152, 61,118, 44,136, 9, 72, 73, 75,
+195,214,159,127,198,216,254,253, 33,147, 72, 92,238,176, 48, 12, 3,161, 80,136,140,140, 12,164,164,164,160, 85,171, 86,184,123,
+247,110,181,101, 40, 8, 33,174,198,223, 22,119,177, 88, 12,129, 64,128,130,130, 2,196,198,198, 66, 40,172, 26,198, 62,117,234,
+ 20,102,207,158,141, 41, 83,166,160, 95,191,126, 72, 79, 79,119,137,147, 16,242,200,108,197,154,195,185,238,230, 81, 77,206,154,
+237,126,125,242,157,229, 92,188,120,177,195, 9, 21,174,112, 58,210, 34, 14,242, 46,213, 94, 12,177,150, 39,123, 97, 84,243, 24,
+128, 47,123, 46, 62, 62,126,190,171,207,217, 31,179, 22, 49,119,134, 48,109, 66, 43, 54, 54,182, 90,204, 75, 75, 75,207,159, 63,
+127,190,141, 92, 46,199,173, 91,183, 68, 94, 94, 94,109,216, 10,157,166,105,108,223,190,221,115,232,208,161, 71,151, 47, 95, 30,
+206, 48, 12, 10, 11, 11,241,254,251,239,171,204,102,243, 56, 0,230,218, 26,112,103,150,169, 31,127,124,244,101,219,187,119,175,
+ 75, 67, 32,172,144,226,243,249,240,245,245,213,106,181, 90,200,100, 50,248,250,250,106, 53, 26, 13,228,114, 57, 59, 86, 76,227,
+183,153, 10,206,172, 79,206, 28,227,107, 58,192, 59, 69, 90, 90,154, 75,247, 89,135, 90, 93, 42,229, 89, 89, 89,181, 86, 36,167,
+ 78,157, 2, 99,173,104, 93,229,180,246,242, 8, 43,252,100, 50, 25,252,252,252, 32, 22,139, 33,149, 74,171,137, 44,177, 88,236,
+244,197,113,182, 32,169, 68, 34,185, 40,151,203,125,216,235, 2,129, 0, 74,165,178,188,180,180,180,219, 35, 22, 34, 13,115, 48,
+121, 99,222,148, 62, 19, 67,209,103, 98, 40, 0,188,122,105, 95,209, 43,189, 95,174,114,254,220,185,248, 30, 81,230, 89, 18, 97,
+ 66,154, 59, 34, 11, 0,136, 72, 47, 27,243, 65,135, 42,235,194,198,243,152,187,248, 29,180,107,213, 1, 62,207,230,162,105,215,
+ 80, 84, 22, 25,241,235, 22, 11, 86,254,231,125,180,110,221,218,169,192,100, 64, 96, 54,154,161,213,234,160, 82,106,241,164, 97,
+ 48, 24, 32, 22,139,177,121,243,102,244,236,217, 19,221,187,119,127, 68,100,213,211, 60,159, 83, 90, 90,218,111,229,202,149, 23,
+ 62,255,252,115, 95,149, 74,133,239,190,251,174, 66,165, 82,245, 3,144,227, 86,154, 50, 4, 38,163, 17, 26,157, 30,106, 85, 85,
+ 26,220,187,177,179,158, 61,217, 42,177,209,179, 91,115, 76,159,254, 38, 50,239,103, 64, 85,126,247,177,197, 6,128,205, 5, 5,
+ 5,155,235,184,126,207,108, 54,199,178,235,190,185,128,103, 34, 34, 34, 80, 80, 80, 80,237,228,131, 7, 15, 96,177, 88,244,168,
+ 90, 39,235, 53,123, 67, 50,106,153, 65,107,215,131,174,178,142,106,245, 80,169,170,172, 32, 58,117,241, 19, 41, 71,172,216,168,
+205, 39,171, 62,101,136,162, 40,155,211,247,140, 25, 51,112,237,234, 85, 60, 23, 90,137, 38, 33,158, 32,149,185, 16, 14,248, 15,
+126, 85, 72,177,252,139,131,110,115,111,179,115,129, 88,190,109,155,195,107,247, 70,142,116, 43,238,183,111,223,134, 84, 42,133,
+197, 98,121,164,189,113, 55,254,246, 2,230,139, 47,190,192,236,217,179,241,253,247,223,227,218,181,107,232,208,161, 3, 6, 14,
+ 28,136,162,162, 34, 92,189,122, 21,122,189,222,229,112,218,251,205,221,190,159,134, 99, 41,135,240, 32, 39, 19,121, 5,217,245,
+206,119,123,206,154, 66,107,215,177, 43,248,215,160, 78,245,226, 92,184,112, 33,138,138,138,170, 89,178,236,235,165,218, 44, 90,
+ 53,181, 72, 13, 20,215,240,133, 98,143, 13, 53, 68, 79,205,227,154,247, 3, 64, 17, 0,158,147,231,106, 30, 23, 39, 36, 36,156,
+100, 45, 97, 86, 94,158, 51,255,172, 90,135, 14, 1, 36,142, 28, 57,114,196,170, 85,171, 2, 37, 18,137,109, 6, 82,124,124, 60,
+102,207,158,141,166, 77,155, 34, 32, 32, 32,204,199,199, 7, 37, 37, 37, 88,186,116, 41,178,178,178,254, 15, 14, 22,218,171, 41,
+180,122,223, 87, 66, 36,250,173,195,202, 90,182, 0, 96,202,148, 41,143, 88,180,216, 12,170, 11, 38,147, 9,254,254,254,208,104,
+ 52,224,241,120, 24, 53,106, 20,239,250,245,235,150,152,152, 24,140, 30, 61,154,119,245,234, 85,203,176, 97,195,192,227,241, 48,
+ 96,192,128,202, 93,187,118,205, 2,240,153, 11, 98,235,137, 57,198,179,133,204,213,181,143, 92, 17,151,117,113, 82, 20, 5,141,
+ 70, 3,190,117, 86,150,171,156,236,208,161,253, 11, 72,211, 52,124,124,124,108,149, 7,107,209, 98,133,150, 51, 94,103, 11,146,
+202,100, 50,175, 91,183,110, 69,177, 19, 47,138,139,139, 49, 96,192,128, 59,165,165,165,143,112,105,243, 49,127,207,146,204, 16,
+ 0, 67, 88,177,213,117,100, 16, 69,243, 40, 92, 59, 82,130,171,135, 74, 47,155, 42,209, 27,192, 90, 0,255, 5,176, 20,192, 92,
+ 0,211,236,142, 31, 58,172, 32,117, 66,125,242,198, 60, 25,203,155,188,241, 28,190,220,181, 23,239,110,173,114,220,223,245,201,
+125, 76,125,105, 33,218, 69,183,115,109, 45, 32, 6, 48,154, 45, 80,105,117, 80,105, 53,120, 82, 96,223,135,117,235,214, 33, 61,
+ 61, 29, 58,157, 14,171, 87,175,182, 77, 42,176, 23, 89,143, 33,184, 50,164, 82, 41, 51,100,200, 16,156, 63,127, 30, 98,177,216,
+132,122,172,127,197, 16, 6, 70,179, 25, 58,173, 22, 42,231, 67,110, 78, 27, 48,163,201, 4,134,177,160,107,135,112, 92,191,118,
+ 13,114, 94, 49,254,132,176,169,234,244,244,116, 24, 12, 6, 44, 90,180,200,242,203, 47,191,156, 68,213, 2,168,172, 5,111, 66,
+223,190,125, 63,150,203,229, 62, 7, 14, 28,120, 27,192,247,117,197,221,100,182,138,246,199, 76,199,218, 70, 4, 28,249,100,213,
+103,201, 29,251,134,149, 97, 24,252,223, 27,111, 96, 96,104, 37, 70,119, 14,132, 58,255, 14,100,222,129,160,124, 34,177,252,139,
+131,184,113,223,229, 69,137, 9, 0, 12,233, 59, 18,237, 91, 61,186, 60, 88,175,231,170,250,100,103,142, 95, 68, 97,113,158,219,
+113, 87,171,213,181, 90,174,220,176,104,217,222, 57, 54,253, 58,118,236,136,230,205,155,227,228,201,147,232,212,169, 19,238,222,
+189,139,187,119,239, 34, 43, 43, 11,215,174, 93, 67, 89, 89,153,219,121,180,231,200, 86,148, 41, 75, 33, 18,138, 80, 90, 94,140,
+ 7,185,153, 8,246, 15,121,236,124,103,209,114,216, 66, 0, 64,104,160,183, 91, 66,203,158,115,217,178,101,143,136,247,122, 46,
+223,100,207,127,177,174, 99,119,159,255, 61, 81,155,208,202, 84, 40, 20,221,199,142, 29, 27, 15,160,171,245, 92, 5,128,109, 71,
+143, 30, 29, 25, 20, 20,212,191, 71,143, 30,124,145, 72,132,148,148, 20,236,218,181,235,123, 0, 91,235,250, 35,145, 72,164,141,
+140,140,148,178, 5,145,125, 17,189,188,188,120, 75,151, 46,165,214,175, 95, 95,171,149,203, 89, 6, 85, 84, 84, 64,173, 86,195,
+219,219, 27, 70,163, 17, 67,134, 12,177,164,167,167, 67, 40, 20, 98,196,136, 17,150,180,180, 52, 91, 70,255,239,127,255, 11,215,
+106,181,207,254,244,211, 79,131, 1,244,113, 35,173, 88,199,120, 15,184,232, 0, 95, 91, 47,207, 21,184, 58, 28, 87, 27,231,204,
+153, 51,235,197, 41, 20, 10,205,236,202,239, 52, 77,195,104, 52,162, 83,167, 78, 40, 42, 42,178,189, 52,114,185,220, 38,178, 92,
+ 17, 90,206, 22, 36,229,243,249, 48, 24, 12,232,211,167, 15, 40,138,194,154, 53,107,234, 10,107,145, 54, 15,111,236, 89,146,249,
+ 63, 86,108, 73, 60,248,208, 41,205, 56,241,101, 25, 12, 37,240, 26, 51,102,204,248,157, 59,119, 98,233,210,165,211,226,227,227,
+149, 47,188,240,194,180,237,219,183,219,142, 1,196, 59, 34,150, 18,239, 74,205,249,230,178,100,220,129,157,136, 3, 43,226, 42,
+110,120, 34, 89,119, 6, 87, 83,175, 3, 0,214,174, 93, 11,212, 53, 20,203, 48,148,135,135, 63, 66, 67, 91, 32, 48, 72, 7,198,
+ 69,231, 17, 87, 49,103,206,156,106, 98,202,209,202,203,246, 67,140,245, 17, 54,246,251,122,113, 0,182, 33, 47,181, 90,247,216,
+ 66,139, 21, 27, 62, 94, 66,132,133, 53, 64, 69,129,253,176, 62, 5,118,170, 82, 85,152, 73,189, 29,110, 89, 4, 5, 5,117, 47,
+ 42, 42,218, 91,227,116, 41,128,143,235,232, 88,218, 50, 58, 59, 59, 27, 49, 49, 49, 56,116,232, 16,111,247,238,221,207,237,219,
+183, 47,237,206,157, 59,217,157, 58,117,106, 56,117,234, 84,113,159, 62,125, 80, 92, 92,140,206,157, 59,127,148,155,155, 91,135,
+208,178,166,163, 78, 15,181,250,201, 91, 71, 29, 89,179, 30,167, 97,100,211,125,193,130,127, 99, 96,131,114,140,234,224,141,164,
+253,103, 49,161,163, 20, 48,136,221,230, 99,195,226, 23,218, 24,145,209,221, 31,185, 46,246,170, 90,203, 53, 50,186, 59,232,236,
+187,110,199,221, 62,204, 53,203, 76,125,202,144,125,122,190,254,250,235,152, 59,119, 46, 6, 15, 30,140,187,119,239, 34, 57, 57,
+ 25,119,239,222,197,204,153, 51, 17, 29, 29,141, 14, 29, 58,184,197,185,239,216, 14, 84,170, 42, 64, 83, 52, 74, 43, 74,160,211,
+107, 49,103,218,130,199,206,119, 91,227,127, 44,161,106,116,224,232,229,122,115,126,240,193, 7, 40, 40, 40,168,102,201,122, 28,
+191,172,191, 58,234, 90, 45, 45, 19,192,255, 57, 24,174,240, 92,180,104,209,160,128,128, 0, 80, 20,133, 47,190,248, 2,126,126,
+126, 61, 1,220, 48, 24, 12,197,106,181,122,182,157, 8, 25, 8,235, 90, 27,133,133,133, 14,231,237,171,213,106,227,160, 65,131,
+ 4, 13, 26, 52,168, 54,219, 80, 46,151,215,102,221,177,113,178,215,204,102, 51,230,204,153,131, 37, 75,150,160, 81,163, 70, 24,
+ 54,108, 24, 98, 99, 99, 65, 81, 20,134, 12, 25,130, 97,195,126, 27,202,245,241,241, 17, 30, 58,116,168, 47, 77,211,105,118, 13,
+ 72, 53, 78, 71, 96, 29,227, 77, 38,147,171, 14,240,213, 56,217,194, 54,115,230, 76, 44, 89,178, 4,243,231,215,237,234, 81, 75,
+ 35,254,212, 57, 75, 75, 75,171, 85,246, 50,153,108,205,232,209,163,249,217,217,217,213,196,149,253,230,160, 34,170,198,233,108,
+ 65, 82, 30,143,135,224,224, 96, 44, 94,188, 24,254,254,254, 8, 9, 9,113,180,144,159, 61,103,158,189,216,122,246,165, 16,236,
+ 93,150,137,231,187,141,197,237, 83, 43,245,110, 52, 16,213,194,105,177, 88,178,222,121,125,110,208,138,245, 75,121,172,216, 98,
+ 69,220,233,175, 85, 88,149,248, 45,250,244,238, 99, 51,179, 39, 39, 39,155, 29, 88,121,108,156, 22,194,164,126,154,248,239, 94,
+223,109,220, 39, 16,139,128,115,201, 59, 81, 89, 86,125, 56, 73,111,252,109, 42,181,168,211,115, 48, 92, 62,238, 82, 89, 98,197,
+244,194,133, 11,177,112,225,194, 58, 35,185,110,221, 58,167,156,174,138, 46,119,210,211,106,210,162,100,114, 95, 72,228,161,104,
+ 19,237, 11,134,152,221,173,163,108,156, 53,197, 70, 64,128, 63, 42, 10,170,203, 58,202,150, 70,117,106, 96,103,113,255,229,226,
+197,139, 35,252,253,253,145,147,147, 19, 40, 16, 8, 70, 84, 51, 87,105,181,136,140,140,108,161, 80, 40,158,117,198, 57,115,230,
+ 76,253,135, 31,126, 40, 30, 55,110, 28, 70,143, 30,141,113,227,198,137,133, 66, 97, 51, 66, 8,140, 70, 35,114,114,114,112,252,
+248,113, 40, 20,138,155,117,133,147, 33,132,146,202,124, 32,145, 55, 64,155,182, 62, 96, 24,115,125,235,124,135,117, 72, 77,107,
+150,155, 34,203, 97,249, 4,128, 95,142,239,197,130,119,219,226,251, 3, 23,176,234, 34,208,222,167, 8,109, 2, 21, 96, 20, 55,
+241,254,132, 46, 88,254,195,165,170,119,233,148,211, 60, 34,117,149, 65,157,214,248, 88,113,183,183, 92,217,255,143, 11, 62, 90,
+143,112,178,157, 68,165, 82,137,242,242,114, 36, 37, 37,225,213, 87, 95, 69, 81, 81, 17,178,178,178,112,231,206, 29,108,217,178,
+ 5, 50,153,172, 94,121, 52,235,141, 15,240,225,242,247, 64, 64,208, 50,170, 13,226,227, 22,162,107,251, 30,143,157,239, 53,225,
+130, 53,171, 86,206, 21, 43, 86,212,183, 44,253,227,132,150, 67, 4, 4, 4,140,235,219,183, 47,116, 58, 29, 2, 3, 3,145,149,
+149, 5,154,166,155, 2, 85, 67,120, 97, 97, 97,219, 20, 10, 69, 83, 87,249,120, 60, 30,204,102,179,205,247,135,221, 0, 96,248,
+240,225,248,241,199, 31,157,246, 40, 66, 66, 66,208,176, 97, 67,188,243,206, 59,143,204,114,176,159,233, 32,149, 74,113,224,192,
+129,130,210,210,210, 82, 66,136,194,157,120,179,142,241,103,206,156,113,217, 1,222, 30, 70,163, 49,251,206,157, 59, 13,214,173,
+ 91,199,171,163,241,179,161,150, 70,252,169,115, 58,234,153, 18, 66,106, 21, 89,174, 44, 35,224,108, 65, 82, 62,159,143,219,183,
+111, 99,193,130, 5,160, 40, 10, 59,119,186,228,195,147,167,205,195, 27,187, 23,103, 46,221,147,144, 57,218, 84, 1,201, 73,245,
+202, 59, 0, 86,239,216,177,163, 3, 69, 81,236, 80,225,127,119,236,216,225,105,127, 92,171,169,172,168, 40,230,197, 23, 95, 60,
+ 74, 81, 84, 83,221,201, 10, 79, 0, 34, 86,196,229, 94,211,169, 94,158,240,178,129,207,231, 91,126, 51, 88, 49, 89,133,133,133,
+207,215,198,119,253, 86,201,122,154,166,125,135, 63,223,171, 29, 40, 10, 70,195,163, 35,213, 30,101, 42,155,200, 26,253,217, 86,
+236,158, 53,214, 21,209,147,113,250,244,105,191,117,235,214,241, 93,201,247,211,167, 79,155, 9, 33,110, 15,251,177, 13,142,209,
+104,132, 86, 91, 63, 43, 10, 33, 36, 37,225,147, 15, 7,109,216,116, 80, 64, 81, 6,156, 59,181, 19, 21,229,142,221, 25, 68, 2,
+ 62,214, 39,237, 50, 11, 5, 60,135, 78, 39, 79, 80,108, 56,195,151,163, 70,141, 26,183,122,245,234, 54,142, 46,186, 48, 9, 38,
+ 75,167,211, 33, 55, 55, 23, 26,141,102,199,188,121,243,140, 7, 15, 30,124,109,204,152, 49,232,208,161, 3, 26, 52,104,128,252,
+252,124,100,100,100, 32, 41, 41,137,156, 61,123,118, 7,128,233, 78,210,113,111,226, 39, 31, 78, 78,250,225,160,136,166,140, 56,
+151,188, 19, 21, 53, 68,251,163,214,105, 1,190,249,126,151, 81, 40, 20,220,114,102, 45,178,183,102, 61,201,134,113,196,196, 56,
+140, 94,185, 10, 77,187,198, 32,113,233, 64,124,243,201,139,248,124,136, 16,198,237, 19,208,254,133, 13,216,188,104, 40, 0, 32,
+244, 27, 23,173, 37,124, 33, 30, 58,176, 88,149, 87, 72,172,226,198, 61,171, 41, 27,247,186, 44, 87,238, 90,180,104,154, 70,227,
+198,141,209,180,105, 83,244,236,217, 19,157, 58,117, 66,255,254,253,113,245,234, 85, 92,189,122, 21, 51,103,206,172, 75,100, 57,
+205,163,126,207, 14,194,133,222,183, 30, 59,111,106,230,251,147,128, 43,101, 41, 46, 46, 14, 0,254, 81,214, 45,183,133, 86,101,
+101,229, 85,134, 97,218,121,123,123,179, 22, 41,219,181, 7, 15, 30,128, 97, 24,141,187, 25, 99, 48, 24,216,197, 49,171,173,203,
+196, 58,199,215,245,226, 19, 66, 44,165,165,165,232,219,183, 47,122,247,238,109, 27, 62,177,223,236,132, 9,118,239,222, 13, 66,
+ 72, 55,119,227,109,231, 24,175,130,155, 14,240,108, 35,222,167, 79,159,163,124, 62,223,165,175,104, 58,107,196,159, 22,167,163,
+252, 97, 24,166, 86,145,229, 74, 69,228,108, 65, 82, 62,159, 15,185, 92,142, 61,123,246, 32, 32, 32,192,157,224,229,233, 10, 48,
+ 11,192,151,168,154,132,113, 23, 0, 59,141, 47,206,254,221,174,113, 92, 27,212, 10,133,130,237, 26,134,238, 94,156,185,116,239,
+210,204,129,140, 30, 59,117, 10,252, 0, 40, 47,194,137,211,114, 77, 92, 77, 87, 44,171,235,122, 95,127,209, 41, 0,129,163, 63,
+219,250,240, 84,137, 49, 98,244,103, 91, 31,236,158, 53,182, 81, 93,207, 20, 20, 20, 12, 30, 59,118,236, 33, 87,243,221,108, 54,
+103, 22, 20, 20, 60,239,110,153, 37,132,224,214,173, 91,204,235,175,191, 94,172, 80, 40, 94,172, 79, 5, 19,191, 96,213,231, 75,
+ 62,154,225, 63,100, 80,247,174,160, 1, 67,237,206,191,132, 2, 8, 95,192,203,158, 61,127,197, 27, 47,190,248,226,239, 42, 54,
+106, 86,115, 5, 5, 5, 61,255,245,175,127, 77,199,111,174, 19,213,132, 20,106,153, 93,109,197,202,134, 13, 27,182,229,241,120,
+ 98, 0, 11, 0, 60, 56,123,246,236,151,103,207,158, 29, 12,224, 25, 30,143,215,192, 98,177,228, 90, 59, 61, 91, 1,252,234,188,
+ 28, 21, 77, 5, 97,194,135, 12,124, 38, 6, 20, 69, 12, 6,189,147, 14, 18, 8, 8, 33, 66,161,224,214, 47, 87,243,219,215,213,
+145,178,251, 2,199, 19,159, 65, 60,125,250,116, 76,159, 62,221, 86,158,214,172,233,141, 29,215,207,224,133,246, 57,208,127,221,
+ 11,148, 87, 35,151, 59,124, 0,240,193,191, 95,127, 98, 97,179,143,187,189, 69,203,209,123,224,142,143, 22,143,199, 67,113,113,
+ 49,110,223,190,141,194,194, 66,104, 52, 26,164,167,167,195,104, 52,162,172,172, 12,109,219,182,173,119, 56,159, 84, 30,253,145,
+156,255,196,225, 67,183,133,150,209,104,252, 79,227,198,141, 5, 18,137,164,141,197, 98, 1, 33, 4, 22,139,133, 88, 69,141,219,
+179,240, 4, 2,129,174,121,243,230,148,163,217, 9,236,111,185, 92,174,173,195, 90,146, 16, 25, 25, 57,143,162, 40, 94,109,189,
+ 16,246, 55,195, 48, 22, 62,159,159, 80,207,180,122, 92,199,120,251, 70,252, 73,225,105,112,214,204, 31,117,171, 86,173,108, 95,
+180,175,185, 38,138,245, 99,171,106, 39,226,188,206, 5, 73,213,106,117,126, 76, 76,140,197,254,186,253,130,166,206, 52,172,117,
+123,210, 96, 69, 92, 99, 59, 17,103,121,226,255, 66,145, 7, 67,199,189, 22,113,170,196, 24, 1, 0,172,216, 2, 33, 15,234,120,
+ 74, 91, 80, 80,208,247,105, 87, 14,247,239,223, 55, 60,243,204, 51,155,148, 74,101, 28,128,122,123,243,207,255,207,154,249, 79,
+ 34, 60, 79, 75,108,212, 86,108, 1, 44,169,103, 80, 31,148,148,148, 12,168,113,238, 87, 86, 80,177,235,218,185, 29,255,155,197,
+207, 63,233, 60, 54,155,205, 57, 77,155, 54,117,203,114, 99, 50,153,114,156, 93,175,185, 70,152, 61,110,192, 27,243,207, 3, 85,
+147,191, 75, 92,226,212,233,116,165, 61,122,244, 16,184, 25,183, 34, 87,227,222,160, 65, 3,132,134,134,218,246, 44,106,158,119,
+ 22, 78,179,217,156, 19, 30, 30,142,128,128,128, 90, 87,124,175,233,147,229, 10,231,147,206,163,186, 56, 67, 67, 55, 60,113,206,
+250,134,147,131,107, 24,200,113,114,156, 28,231, 95,150,147,199,165, 39,199,201,113,114,156,191, 35,231,223, 18,156,151, 26, 7,
+ 14, 28,106,131,133, 75, 2, 14, 28, 56,112,120, 60, 80,117,168,210, 99,110,240,212, 71,217, 30,227, 56, 57, 78,142,147,227,228,
+ 56, 57, 78,142,243, 31,199,233,140,251, 24, 56, 60, 85, 1,198,113,114,156, 28, 39,199,201,113,114,156, 28,231, 63,143,243,111,
+ 9,110,232,144, 3, 7, 14, 28, 56,112,224,192,129, 19, 90, 28, 56,112,224,192,129, 3, 7, 14,156,208,226,192,129, 3, 7, 14,
+ 28, 56,112,224,192, 9, 45, 14, 28, 56,112,224,192,129, 3, 7, 78,104,113,224,192,129, 3, 7, 14, 28, 56,112,224,192,129, 3,
+ 7, 14, 28, 56,112,224, 80, 5, 10, 0,246,239,223,111,251, 32, 96,108,108, 44,197, 37, 11, 7, 14, 28, 56,112,224,192,225,247,
+196,223, 90,139,216, 71,142, 3, 7, 14, 28, 56,112,224,192,129,211, 34, 79, 6, 52, 39,182, 56,112,224,192,129, 3, 7, 14,156,
+216,226, 34,198,129, 3, 7, 14, 28, 56,112,224, 68,214, 95, 10,213, 44, 90,156,224,226,192,129, 3, 7, 14, 28, 56,252,145, 98,
+235, 47,170, 69,136,117,179, 63,230,192,129, 3, 7, 14, 28, 56,112,224,240,152, 2,171,174, 61, 7, 14, 28, 56,112,224,192,129,
+ 3,135, 39, 36,184,216,223,191,155,208,226,190,108,206,113,114,156, 28, 39,199,201,113,114,156, 28,231, 63, 22,124, 46, 9, 56,
+112,224,192,129, 3, 7, 14, 28, 30, 27,246, 86, 44,138, 19, 90, 28, 56,112,224,192,129, 3, 7, 14, 79, 78,100, 81,142,142,185,
+111, 29,114,224,192,129, 3, 7, 14, 28, 56, 60, 37,112, 22, 45, 14, 28, 56,112,224,192,129, 3,135,199, 3, 5,110,232,144, 3,
+ 7, 14, 28, 56,112,224,192,225,169,138, 45,135, 39,107,155, 57,112,204, 13,242,250,204, 62, 56,198,113,114,156, 28, 39,199,201,
+113,114,156, 28,231, 63,142,211, 25,247, 49,252,245,208, 23,192, 73, 0,253,172,251, 90,133,215,147, 6, 55,245,149,227,228, 56,
+ 57, 78,142,147,227,228, 56, 57,206,191, 59,106, 93,168,148,115,134,231,224, 12,124,212, 61,196,236,236, 58, 7, 14, 28, 56,112,
+224,240, 79, 19, 91,196,190,145,116,132,102, 0,230, 3,240,182, 59,119, 17, 64, 66,141,251,126, 0, 32,179, 59, 86, 3, 88, 4,
+224,174,211,208, 16, 34,180,242,139,173, 27, 3, 64, 7, 64, 15, 64, 73, 81,148,137,203,179, 63, 28, 61, 0,196, 90,127,239, 7,
+112,206,205,235,127, 43, 52,104,208, 64,234,235,235, 59,248,242,229,203,162,244,244,116,156, 62,125,154,172, 95,191,222, 88, 86,
+ 86,118, 36, 63, 63, 95,203, 21,151,191, 5, 98, 0,196, 91,127, 39, 2, 56,252,152,124,148, 76, 38,155, 41,151,203,135,138,197,
+226, 80,179,217, 76,105, 52,154, 60,181, 90,125,212,108, 54,127,102,173,247,220,197, 72, 63, 63,191,215, 90,182,108,217, 44, 43,
+ 43, 43, 55, 47, 47,239, 7, 0,219, 1,188, 24, 26, 26, 58, 33, 50, 50, 50,236,214,173, 91,119, 75, 75, 75,191, 1,176,247, 15,
+ 12, 39, 7, 14,255, 36, 80,117, 89, 35, 28, 97, 1, 33,100, 66, 53, 6,234, 81,142, 1, 3, 6,140, 56,114,228,136,140, 97, 24,
+176,155, 84, 42, 53, 3,120,197,137,200,242, 79, 73, 73,137,136,139,139, 27,157,151,151,215, 69,169, 84,118, 3, 0,153, 76,118,
+ 33, 40, 40,232,151,149, 43, 87,110, 33,132,228, 80, 20,165,116, 51,162,124,129, 64,240,170,175,175,239, 80,179,217,220,137, 16,
+ 2,129, 64,112,185,172,172,236,176,201,100,250, 6, 64,125,196,155,136,207,231, 79, 23,139,197, 49,102,179,185, 29, 0,240,249,
+252,107,122,189,254,176,217,108,254, 18,128,161, 30,156, 18,145, 72, 52,221,203,203,107,144,193, 96,104, 7, 0, 34,145,232, 90,
+101,101,229, 81,131,193,240,165, 85,112,254,209,224, 3,136, 37,132, 8, 0,128,199,227,141,236,214,173, 91, 4, 69, 81, 12, 69,
+ 81,132, 16, 66, 93,184,112,161,163,197, 98,161,173,229, 35, 22,192, 47, 0,204,127,197, 55, 36, 32, 32, 96, 9,195, 48,161,117,
+102,154, 68,210,229,242,229,203, 45,183,109,219,102,249,250,235,175,203,167, 76,153,226, 17, 23, 23,199, 95,179,102,205,151,249,
+249,249,111,215,188,223,223,223,255,115,154,166, 3, 92,249,127,134, 97,138, 75, 74, 74,222,251,163,226, 63,121,178,174,154,185,
+ 59, 41, 73, 18, 5, 32,167,158,229,251,233,113,234, 38, 19, 0, 72,146, 36, 69, 77,214, 77,206, 96,127, 63, 46,175, 29,226,191,
+ 58,166,236, 67, 8, 48,125,144, 39,253,184, 66, 43, 44, 44, 44,105,242,228,201,227,218,181,107,199, 39,132,192,100, 50, 65,175,
+215,183, 60,119,238, 92,191,157, 59,119,118, 81, 42,149, 47,186, 73,249,198,220,185,115, 23,127,252,241,199, 1, 2,129,128, 50,
+153, 76, 81,219,182,109,235, 52,117,234,212,119,214,173, 91,215,240,165,151, 94,242,100,207, 47, 88,176,160,107, 98, 98, 98, 19,
+ 0,159,253, 1,225,228,192,225,159,134,190,168,238,163,245, 17,128,133,117, 9, 45,185,181,241, 44,180, 90,178, 96,183,183,225,
+196,137, 19,251,248,124, 62,107,209,234,166, 86,171,131,107, 88,193, 28,137,172,200,137, 19, 39,246,216,177, 99,199,146,151, 94,
+122,169, 64, 38,147, 53, 31, 51,102,140,146,162, 40,222,182,109,219, 58, 54,109,218, 84, 58,124,248,240,137, 3, 6, 12,152, 69,
+ 8, 57, 77, 81,148,194,197, 72,182,241,243,243,219,181,108,217,178,136,152,152, 24, 97, 64, 64, 0, 8, 33,200,203,203, 11, 59,
+112,224,192,144,143, 62,250,104, 86,105,105,233, 40, 0,105,110, 36, 92, 87,169, 84,186,227,163,143, 62,106, 48,100,200, 16,126,
+ 72, 72, 8,116, 58, 29,210,211,211, 7, 30, 62,124,184,207,186,117,235,222,214,106,181, 47, 88, 5,134,171,232,230,237,237,189,
+243,187,185,115,131,187,191,250, 42,223,207,207, 15,132, 16, 40, 20,138,129,103, 54,108,232, 55,109,217,178,183, 43, 42, 42,254,
+229, 40,189,255, 72,136, 68, 34,122,227,198,141, 29, 68, 34, 17, 0,192, 96, 48, 32, 58, 58,154,250,187,188, 33, 20, 69,133,231,
+229,229,121, 11,133, 66,135,215, 45, 22, 11,250,244,233,211, 88, 40, 20,226,179,207, 62, 51, 21, 23, 23,119, 92,189,122,245,229,
+205,155, 55, 7,124,249,229,151, 47, 0,120, 68,104,209, 52, 29,144,147,147,227,144,211, 98,177,192,104, 52,194,108, 54,195, 96,
+ 48,160,117,235,214,127,104,252,147,146, 36,225, 0,222,155, 60, 89,247,174,245,212,103, 0,102, 1,184,143,122,126,179,235, 41,
+112,218,151,183,207,237,126, 63,118, 88,237, 16, 1, 0, 7,175,234, 0,192,239,113,211, 85, 46,151,183, 26, 63,126, 60, 95,161,
+ 80, 64, 32, 16,192,104, 52,162,160,160, 0,209,209,209,188, 77,155, 54,181,112,151, 47, 42, 42,106, 74, 98, 98, 98,224,193,131,
+ 7,141, 27, 55,110, 52, 12, 26, 52, 72, 48,101,202, 20,175, 62,125,250,180, 14, 15, 15,167,191,253,246, 91,253,209,163, 71, 77,
+ 19, 39, 78, 20, 37, 36, 36, 4, 30, 56,112, 96,120, 90, 90,218,103,191,119, 56, 57,112,248, 7,226, 36,126, 91,226,129,221,215,
+ 41,180, 96, 39,174, 70, 2,128, 64, 32,232, 24, 28, 28,156,100, 54,155, 67,172, 86,157,130,194,194,194,207, 76, 38,211, 21,235,
+189,123, 25,134, 25,225,204,146, 53,113,226,196, 30,135, 14, 29, 90,126,238,220,185,138,146,146,146,144,125,251,246,233,102,205,
+154,149, 5, 0,247,239,223,111, 50,124,248,240,176, 25, 51,102,228, 12, 30, 60,120,101,255,254,253,223, 34,132, 28,165, 40, 74,
+237, 76,100, 69, 71, 71,167, 36, 39, 39,123,250,248,248, 84,187, 16, 25, 25,137,183,222,122, 75, 56, 98,196,136,166,207, 61,247,
+220,217,140,140,140,222, 0,174,187, 34,136,154, 53,107,118,236,196,137, 19, 30,190,190,190, 40, 47, 47, 71, 65, 65, 1, 52, 26,
+ 13,188,188,188,240,210, 75, 47, 9,251,246,234,217,112,198,204,183,143,229,228,230, 14,116, 81,108,117,235,217,166,205,177,205,
+ 9, 9, 30,166,135, 15, 33,149, 74,161, 82,169, 0, 0,158,158,158,232,210,184, 49,255,210,134, 13, 97, 19,230,204, 57,246,203,
+237,219, 3,255, 32,177, 37,182,238,245, 0,246,243,120,188,145, 34,145,136, 30, 57,114, 36,142, 29, 59, 70,233,116, 58,190,213,
+186, 99, 30, 57,114, 36,164, 82, 41, 12, 6,135,200,170, 5, 0, 0, 32, 0, 73, 68, 65, 84, 3,131,170,161, 67,243, 95,249, 45,
+ 17,137, 68,200,200,200,168,118, 78,169, 84, 66,161, 80,160,164,164, 4,122,189, 30,229,229,229, 96, 24,134,146, 74,165, 10,134,
+ 97, 64,211,116, 77, 1, 80, 13, 66,161, 16,183,111,223,174,118,206,108, 54, 67,173, 86, 67,175,215,195,104, 52, 66,169, 84, 74,
+ 61, 61, 61,155, 5, 4, 4,228, 0,216, 91, 90, 90,250, 89, 97, 97,225,131,223, 57,250,197,172, 32, 74, 74,146,220, 3, 32,250,
+ 51,114,218, 89,178,194,172,199,191, 62,161,176,178,120,184,255,138,174,145,213, 58,150,249, 4,248, 24, 0, 56,125,250, 52, 10,
+ 11, 11, 81, 92, 92, 12,133, 66,129,240,240,112, 16, 66,220, 30,142,203,200,200,248,170,109,219,182,212,141, 27, 55, 14, 3, 88,
+179,109,219,182, 87, 74, 75, 75,227,103,207,158,237,247,233,167,159,150,206,153, 51, 39, 17,192,247,219,182,109,123,179, 85,171,
+ 86, 67,111,222,188,185,238,143, 8, 39, 7, 14, 79, 26,132,144,174, 0, 2,217,186,197, 90,239,250,219, 29, 95,165, 40,202, 96,
+119,159,193, 90, 55,212,220,179, 96,143, 21, 20, 69,253, 98,247,156,130,162,168, 95,234, 27,204, 26,251,170, 78, 55, 0,236,223,
+191,159,176,155,163, 39,131,130,130,102, 14, 24, 48, 96,121,106,106,106,235,252,252,124,223,252,252,124,223,212,212,212,214, 3,
+ 6, 12, 88, 30, 20, 20, 52,211, 46, 33,106, 62,122,204,238,154, 48, 37, 37, 37, 98,215,174, 93,137,199,142, 29,171,232,216,177,
+163,225,196,137, 19,230,193,131, 7, 23, 89, 27,104,243,224,193,131,139,126,254,249,103, 75,247,238,221,165,135, 14, 29,202, 62,
+123,246,236,231, 59,118,236, 8, 38,132,240, 28,113, 90, 33,240,241,241,217,115,234,212,169, 71, 68,150, 61, 26, 54,108,136,253,
+251,247,123,249,248,248,236, 5, 32,172, 45,156, 86, 72, 36, 18,201,206,159,127,254,217,195,211,211, 19, 69, 69, 69, 16, 8, 4,
+ 8, 10, 10, 66, 69, 69, 5, 10,242,243,241,224,206, 29,208, 6, 3,190,248,228, 99, 79,169, 84,186,195, 65,101,255, 8,167,183,
+183,247,206,205, 75,150,120,148, 28, 59,134, 95, 23, 47,134,209,104,180, 13,185, 26,141, 70,156,141,139,131,226,248,113,124,187,
+ 96,129,135,183,183,247, 78, 0, 18, 39,156, 79, 2,246,156,113, 0, 74,173, 91, 28,128,115,209,209,209,169,233,233,233,232,221,
+187, 55,182,111,223,222,126,246,236,217,113,179,103,207,142,219,190,125,123,251,222,189,123, 35, 61, 61, 29,209,209,209,169,168,
+238,159,245,180,195,249,212, 56, 45, 22, 75,181,141, 97,126,107, 99, 66, 67, 67,139,118,237,218,133,151, 94,122,137, 22,137, 68,
+249, 99,199,142, 21,159, 57,115,134, 88, 69,166,203,225,212,233,116,208,106,181, 80,171,213,184,127,255,190,116,217,178,101,189,
+ 22, 46, 92, 24,117,236,216,177,176,249,243,231, 79, 11, 12, 12,188, 28, 28, 28, 28,241, 59,199,221, 88,227,247, 23, 0,114,221,
+180, 16, 61,109, 78, 98,125, 30,147,117,147, 59,216, 85,176,238,242,214,149,158, 5,214,176,170, 1, 60,120,156,178, 52, 96,192,
+128,182, 81, 81, 81,193,219,110,248,162, 76,216, 18,140,208, 7,140,208, 7, 22,255,174,200, 16, 61,143, 70,141, 26, 5,123,120,
+120,244,112, 51,156, 27,111,220,184,241,140,181,167, 92, 2, 96,249,156, 57,115, 62,162, 40,234,244,156, 57,115, 62, 6,176,220,
+122,126,241,205,155, 55,187, 3,216,252, 7,133,243, 47,241,190,115,156,127, 46, 78, 39, 90, 36,144,162,168,253, 20, 69,237,159,
+ 55,111, 94,127, 0,254, 53,142,159,181,191, 15,128,200,209,158,221,236,206, 7, 18, 66,134,217, 61, 23, 88,207,224, 83, 14,182,
+223,132, 22, 0,196,198,198, 82,177,177,177,236,133,139, 20, 69,237, 3,112, 81, 32, 16,116,236,208,161,195,200,159,126,250,201,
+ 51, 48,240,183,255, 15, 12, 12,196,142, 29, 59, 60,219,180,105, 51, 82, 32, 16,116, 4,112,209,203,203,107, 95, 29, 86, 24,159,
+184,184,184,209,147, 38, 77,170,236,216,177, 35, 0,148,167,165,165,201,186,119,239,174, 54,155,205,148,217,108,166,186,119,239,
+174, 78, 75, 75,147,153, 76, 38,101,215,174, 93,229,207, 61,247, 92,214,123,239,189, 55,209,129,224,176,199,248,165, 75,151,134,
+251,250,250,214,165,132,161, 84, 42, 17, 28, 28,140,184,184,184, 16,129, 64,240, 90, 93,169,197,231,243,167, 47, 93,186, 52,200,
+199,199, 7,101,101,101, 8, 15, 15,135,193, 96,192,237,219,183,161, 83,171, 96, 82, 86,194, 84, 89, 14,197,189,187,240, 17,240,
+ 49,113, 68,108, 48,159,207,159,238,196, 90, 50,253,155, 57,115,130, 13, 89, 89,184,191,125, 59, 44,230, 71,141, 63,102,163, 17,
+215,254,247, 63,232,114,114,144,248,250,235,193, 34,145,104,250,239,108,201,250,148, 16, 34, 37,132, 72, 41,138, 90,217,163, 71,
+143, 77, 82,169, 52, 46, 33, 33, 33,230,200,145, 35, 67,146,147,147,251,153,205,102,129,217,108, 22,156, 62,125,186,183, 78,167,
+227,139,197, 98,240,249,124,130,191, 41, 4, 2, 1,132, 66, 33,164, 82, 41,122,245,234,117,111,253,250,245,166,240,240,112,193,
+206,157, 59,125, 67, 67, 67,229,107,214,172, 41, 87, 42,149, 75, 93,229, 51, 26,141,208,235,245,208,106,181,208,233,116, 56,113,
+226, 68,227, 25, 51,102,240,117, 58,157,101,248,240,225,165, 38,147, 73, 63,103,206, 28, 47, 63, 63,191, 89,191,103, 60, 39, 79,
+214, 49, 86,203,211, 77,171,104,201,196, 99,250, 60, 61, 13, 78, 0, 6,171, 79, 22,139, 0, 43,183,225, 9, 37,133, 25,128,202,
+ 42,180,244, 53,222,143,118,118, 22, 95,167, 40, 47, 47, 95,247,205, 55,223,132,211, 98, 31,156, 49, 12,197, 22,230, 35, 28,241,
+ 94,131,162,136,247, 17, 20, 30,133,113,227,198, 5, 17, 66,214, 60,129, 48,175, 6,208, 7,192,202,250, 60,252, 59,132, 51, 66,
+ 46,151,111,247,244,244, 60, 35,151,203,183,195, 58, 60,251, 56, 24, 20,133,129, 35, 90,209, 57,131,154,130,140,104, 69,231, 12,
+138,226,150, 26,248,187,160,134, 22,177,135,130, 16, 18, 75, 8,137, 77, 76, 76, 92, 98,215,190,179,199, 82, 23, 45, 99,177,132,
+144,216,106, 10,169, 74, 96, 61,182,209,205,193, 86,165, 41,236,149,164, 93,228,108,179, 11,131,131,131,147,146,146,146, 60,107,
+ 50,230,231,231,163,178,178, 18, 31,126,248,161,231,164, 73,147,222,206,201,201,153,236, 36, 16,162,130,130,130, 78, 19, 38, 76,
+144, 24,141,198, 50,134, 97,232,202,202, 74,190,183,183,183,133,189,193,219,219,219, 82, 81, 81, 33, 80,171,213, 60,139,197,162,
+159, 52,105,146,232,245,215, 95,239, 2,128, 87, 27,105, 96, 96,224,160,161, 67,135,214, 58,116, 96, 50,153,160, 86,171,161, 86,
+171, 97, 52, 26,209,171, 87, 47,241,250,245,235, 7, 23, 21, 21,253,183, 86,197, 33, 22, 15, 26, 52,104,144,160,180,180, 20,222,
+222,222,120,240,224, 1, 50, 51, 51,161, 87,169, 96, 84, 85,194,168, 82,194,172,172, 4,169,172, 64,201,221, 91,232,222,170,165,
+240, 7,177, 56, 70,173, 86,127, 94, 27,167,151,151,215,160,238,175,188,194,151,203,229,232, 55,161,106,158,193,161, 86,173, 64,
+ 44, 22, 48, 22, 11, 44,102, 51, 98,110,223,134,201,100, 2, 77,211,232, 90, 90,202,247,218,176, 97,144, 66,161, 88,254, 71, 20,
+118,177, 88,204,223,184,113,227,120,145, 72, 4, 66, 8,101, 48, 24,112,228,200,145,127,220, 75, 47, 18,137, 32,145, 72, 96, 52,
+ 26, 17, 25, 25,169,157, 48, 97, 66,202, 39,159,124,210,136,166,105,185, 80, 40,252,169,164,164,100, 73,126,126,254,125, 87,249,
+ 76, 38, 19, 12, 6, 3, 12, 6, 3,180, 90, 45,238,221,187, 23,210,184,113, 99, 42, 46, 46,206,162,209,104,154,172, 90,181, 42,
+227,200,145, 35,178,165, 75,151,142, 1,240,214,239, 29,223,201,147,117,173, 0,180, 74, 74,146, 8,173,150, 95,195,159,140,147,
+160,202,241, 29, 73,146,164,116, 0,138, 39, 40,178, 68, 0,188, 27,249,243,213, 2, 30, 84, 0, 60,173,162, 96, 12, 69, 81,221,
+ 91,183,110,237,155,158,158, 94, 70, 8, 57, 15, 96, 11,128,252,186,200, 24,134,161, 24,134,193,212,110,229,136,235,193,131,201,
+ 84,129,138,138, 10, 60,120,240, 0,105,105,105,184,112, 33,173,190,239,230,107, 30, 30, 30,131, 37, 18, 73,164,217,108,166, 85,
+ 42,213, 3,141, 70,115,140, 97,152,117,168,135,143,218,211, 10, 39, 11,185, 92,190,108,254,252,249, 61,189,189,189,113,229,202,
+149, 38, 91,183,110, 93,166, 86,171, 31,203,185, 94, 34,160,191,253,124,197,154,176,176, 32, 31, 92, 77,254, 49,108,201,218,109,
+223, 2, 76, 56, 39, 83,254,250,168,161, 69,236,197,208, 47,132,144, 97, 20, 69,237,175, 41,148,220, 50, 59, 61,230,243, 78, 44,
+ 90, 53, 63, 44, 93, 93,104,213,162, 32, 97, 54,155, 67,236, 45, 89,132, 16,228,231,231, 35, 55, 55, 23, 10,133, 2,190,190,190,
+ 48, 26,141, 33,174,212, 15, 74,165,178,155,191,191,191, 70, 32, 16,232,181, 90, 45,100, 50, 25, 35, 16, 8,136,245,127, 40,235,
+172, 69,139, 94,175,167,248,124,190,201,211,211,211, 67,175,215,183, 68, 29,190,100,132,144,110,254,254,254, 14,175,233,245,122,
+168, 84, 42,168,213,106,168, 84, 42,232,245,122, 4, 7, 7,195,108, 54,119,170,179, 75,107, 54,183, 11, 12, 12, 68, 94, 94, 30,
+164, 82, 41,114,114,114, 96, 80, 41, 97, 84, 42, 97, 86, 87,194, 82, 81, 1,166,178, 18,140,186, 18, 38,131, 6, 97,205, 91,129,
+157,145, 88,107, 55,220, 96,104,231,239,239, 15,181,250, 55,119, 51, 98, 21, 88,102,179, 25,102,171,115, 52, 59,156, 24, 16, 16,
+ 0,118, 70,226,239, 4, 61,128,217, 52, 77,175, 20,139,197,252,105,211,166, 33, 63, 63,191, 90,153,152, 54,109,154,205, 39,171,
+ 79,159, 62,167, 37, 18,137, 89,161, 80, 64,175,215, 11,254,174, 47, 61, 69, 81,160, 40,170, 42,143,204,102, 4, 4, 4,168,139,
+139,139, 47,148,151,151,143,175, 15,159,201,100, 98,103,116, 65,171,213,130, 16,130, 43, 87,174, 64, 34,145, 8, 44, 22,203, 13,
+179,217, 44, 19, 8, 4,160,173,206, 95,191, 23,172, 51, 2, 63, 3, 16,110,181, 16,189,134, 42,135,243, 92, 7, 21,137, 75, 73,
+231, 34,167,251,194, 77, 55,153,181, 52,229,162,126,195,145,142,208,175,165,143,232,243,132,238, 65, 62, 29,134,203,213, 50, 17,
+ 79,205, 60,232, 16,249,221,167,105, 91, 39, 77,124,205,115,209,162, 69, 17, 1, 1, 1,146,140,140, 12,221,199, 31,127,220,120,
+227,198,141, 20,170,134,233,106,197,195,135, 15,119,207,159, 63,223,111,232,208,161, 77,196, 98, 49, 85, 81, 81, 1,133, 66,129,
+194,194, 66,100,102,102,146,171, 87,175,222,211,235,245,219,221, 9,100,131, 6, 13,214,143, 31, 63,126, 82,231,206,157, 5,172,
+133, 84,173, 86,119, 60,117,234,212,136, 67,135, 14,245, 86,171,213,110,151,203,236,236,236,237, 31,124,240,129,252,249,231,159,
+111, 41, 22,139,233, 39, 17, 78,123,208, 52, 29,236,225,225,129, 99,199,142,193,199,199, 7, 52, 77, 7, 63,110,121,213, 25,153,
+176,208, 16,127,232,206,126,142,150,129, 17,208, 25,153, 48, 78,162,252,125, 44, 90,181,180,245, 93, 89,139,148, 19,177,164,141,
+143,143,159, 79, 81,212,254,248,248,248,249,142, 44, 90,214,159, 22,251,251,236,238,215, 63,105,177,229,214, 66,147, 12,195, 32,
+ 55, 55, 23,121,121,121,200,205,205, 69, 73, 73, 9,104,154, 6, 33,196,149,217,103,132,162, 40,230,232,209,163,190, 41, 41, 41,
+234,174, 93,187,150,179,254, 47,102,179,153, 50,153, 76,148,213, 47,134,122,240,224,129,240,204,153, 51, 62, 55,111,222, 12,182,
+246, 86, 25, 39,166,192, 71,206,177, 2,203,126,211,233,116,144, 72, 36,174,169, 14,107, 67,120, 37, 53,181, 74,100,169,148,214,
+ 33,195, 10, 88, 42, 43, 64,212, 74,136, 44, 38,136, 64, 64,233, 52, 46,167,159, 61, 88,145,101,180, 10, 45,131,193, 0,147,201,
+ 4,134, 97, 96, 54,255, 33,126,229, 95,181,111,223,190,211,238,221,187,167,228,230, 62,218, 22,142, 26, 53, 10,111,189,245, 22,
+102,204,152,113,115,216,176, 97, 87,127,252,241, 71, 76,159, 62, 29, 12,195,116, 0, 80, 1,224,208,223,237,165,215,235,245, 54,
+ 11,148, 78,167,131,209,104, 4,220,248,172, 66,205,178,201,230,173,217,108,102,185,169,221,187,119,225,244,233,211,116, 90,218,
+141,240,105,211,226, 88,135,251,223, 59,170, 57,168,154,185, 39,178, 86, 20, 6, 84,249, 63,213,182,164, 66, 83,212, 61,100, 71,
+234,226,124, 28,180, 95,219,254,165,119,223,125,119, 16,170,102, 56,223,127, 76,139,214,243, 34,154,250,122,102, 59, 63,201,172,
+246,254,106, 17,159, 82,221,254,122,190, 42,179,145,151, 58,184,161,204, 16,222,216, 39,116,201,146, 79, 26,220,188,121, 75,255,
+225,135, 31,166,143, 29, 59, 54,104,214,172, 89,173,119,238,220,217, 91,167,211,125, 3,160,188, 54,163,203,136, 17, 35,206, 7,
+ 5, 5, 53, 94,187,118,109, 81,118,118,182,175,201,100,146, 27,141, 70, 70,173, 86,103,106,181,218, 99, 70,163,241, 24,128, 84,
+119, 2,235,233,233,217,254,149, 87, 94, 17,148,151,151,131,207,231,195,104, 52,162,168,168, 8, 61,123,246,228,237,219,183,175,
+ 77,125, 18,160,172,172,236,243,111,190,249,230,228,230,205,155, 7,123,121,121,117, 22,139,197, 33, 0, 44, 74,165,178, 80,173,
+ 86,255, 90,159,112, 86,171,231, 44,150,194,212,212,212,166, 94, 94, 94,120,248,240, 33, 44, 22, 75,225,227,150, 1,137,144,206,
+190,150,188,175, 97,171,128,198, 56,147,114, 30, 18, 33,157,205, 45,245,245,183, 7,235, 67, 5,123, 1,229, 64, 32,165, 36, 36,
+ 36, 72, 19, 19, 19,145,144,144,112,195,145, 69,139, 21, 92, 9, 9, 9, 55,216,251,236,238, 79,126,140, 48,214,110,209,170, 77,
+ 65, 2, 85,179, 11, 21, 10,133,175,143,143,143, 77, 96,229,229,229, 33, 47, 47, 15, 34,145, 8, 15, 30, 60,128, 72, 36,202,119,
+165, 19, 34,149, 74, 47,117,236,216,177,197,253,251,247,133, 31,127,252,113,195,212,212, 84,175,158, 61,123,182,149, 74,165, 22,
+ 66, 8,116, 58, 29,157,158,158,238,177,124,249,242,176,110,221,186, 25,186,117,235,118,121,219,182,109, 90,212,177,254, 21, 69,
+ 81, 23,243,243,243,155, 68, 70, 70,178,162,173,154,184,178, 23, 92, 64,213,144, 39,159,207,191, 92, 87, 64,249,124,254,181,219,
+183,111, 15,148, 73,196, 48, 40, 43, 97, 84, 85,194,172, 84,194,162,172,128,165,162, 2, 80, 87, 66,100, 54, 67, 96, 49, 65, 42,
+145, 32, 55, 39, 7,124, 62,255, 90, 93,156, 34,145,232, 90, 97, 97,225, 64, 31, 31, 31, 91, 35,106, 50,155,171, 54,139, 5, 6,
+179,217,102,209, 18, 8, 4,200,206,206,134, 72, 36,186,246,123,151,100,154,166, 45,236, 18, 14,181,196, 3,193,193,193, 76,247,
+238,221, 49,125,250,116, 88, 44, 22,107, 54, 80,253, 0,156, 65,149,127,203, 95, 18,142,196, 45,235,180,174,213,106,161, 82,169,
+ 80, 86, 86,198,151, 74,165, 45,194,194,194,206, 27, 12,134,237,102,179,249,219,204,204,204,202,218, 56,173,194,204, 38,186, 24,
+134, 1, 33, 4, 22,139, 5, 38,147, 9, 66,161,144, 57,117, 42, 25,203,191, 88,134,164,111, 55,146, 17, 35, 70, 80,251,246,237,
+ 3,195, 48, 57,191,115,244, 13, 86,209, 82, 87,165, 81,115, 73,133,247, 81,247,146, 10,181,113,218,247,254,236,207, 81, 14,238,
+121, 4,239,190,251,238, 97, 84, 13, 25, 22, 91,197,220,227,112,126, 86,190,229, 19, 9,204, 22,181,254,212,102,213,166, 59,149,
+234, 69,155, 86, 92, 50,136,120,149, 93,250, 6,183,107,210,184, 5,207,199,199,151,254,239,186,149, 37, 63,108,220,145,241,240,
+225,195,202, 47,191,252,178, 71,139, 22, 45,188,127,253,245,215,176,218,132,150, 76, 38,107,246,218,107,175,189, 82, 86, 86, 38,
+ 76, 74, 74,218,150,159,159,127, 9, 85, 75,203,216,207,160, 30, 6,224,123,171, 16, 13,182,214,115,103, 0,124, 92, 87,127,141,
+162, 40,252,252,243,207,143,204, 14,100, 30, 79,157,251, 68, 69, 69,189,116,255,254,253,211,133,133,133,255,170,121, 81, 40, 20,
+ 46,106,222,188,121,204,141, 27, 55, 62, 2,112,208, 29, 98,141, 70, 51,103,199,142, 29,159,242,120,188, 80,139,197,146,247,255,
+236, 93,119, 88, 20,215, 23, 61, 51,219,151,222, 97, 5, 65, 65, 84, 20, 53, 63, 75, 52,177,160,177,196, 88, 18, 19,193, 30,141,
+ 49, 26,147, 88, 99,139, 93,212, 24, 53,177, 17,187,198, 32,177, 18, 75, 68, 77,212,216, 21, 27, 6, 27, 54,164, 73, 7, 5, 22,
+182,239,206,204,239, 15,118,201,178,236,194, 46, 26,141,102,206,247,237,183,187, 51,111,206,123,111,234,153,251,238,189, 79,161,
+ 80, 76,123,102,139,150,150, 30,181,100,253,238,205, 10, 53,229, 47, 22,112, 50,148, 90,250, 51, 86,135,188,190,214, 44, 61, 10,
+140,172, 81, 5, 0, 8,147,255,137,250,135,145,154, 97, 24, 67,217, 2, 35, 43,150,218,196, 10,102,110, 93,193, 51, 36, 75,103,
+ 44,221,227, 44, 89,180,190, 1,240, 38,128, 43,121,121,121,171, 63,254,248,227,239,119,236,216,225, 40,149, 74,145,151,151,135,
+252,252,124,112,185, 92, 56, 57, 57, 97,221,186,117,138,188,188,188,213,198,219,160,106, 6,121, 0, 80,122,120,120, 92,139,137,
+137,241,217,180,105, 19,119,248,240,225,233,189,123,247,110,188,110,221,186, 20, 62,159,207, 80, 20, 69,168, 84, 42, 98,204,152,
+ 49, 65, 43, 87,174, 76,227,112, 56,118, 3, 6, 12, 32,236,237,237,175,160,154,180, 1, 5, 5, 5,199, 15, 28, 56,240,225,228,
+201,147,133,106,181,218,172, 37,203,176,204,197,197, 5, 23, 46, 92, 80, 23, 21, 21, 29,171,193,138,113,252,247, 35,135, 59, 13,
+ 29, 56,144,175, 45,149, 66, 91, 42,133, 78, 42, 5, 85, 90, 12,162, 76, 10, 30,165,131,152, 79,195,199, 79, 4,157,194, 1,135,
+175, 38,106, 85, 42, 85,181,137, 13,165, 82,233,241,243,209,209,157,223, 12, 8,224, 94, 24, 63, 30, 26,173, 22,239,221,191, 95,
+ 33,174, 52, 26, 13, 14, 54,111, 14,138, 32,240,198,232,209,120,168,211,233,164, 82,233,241,127,227,197,112,227,198,141,252, 33,
+ 67,134, 36,208, 52,221, 18, 47,104,210,204, 23, 1,173, 86, 91,197, 26, 69, 81, 84,185,213,177,220,114, 32, 56,124,248,112,167,
+164,164, 36,254,173, 91,183,112,238,220,185, 55,118,236,216,241,141,191,191,127,243,140,140,140,220,154,196,155,185,164,191,208,
+251, 31,238,217,185, 23,159,127,254, 57,145,155,155,139, 93,187,118,161,166,228,169,255, 4,134, 15, 87,210,209,209,162,186, 48,
+241,123, 50,147, 82,225, 47, 88,153, 82,193, 18,167,114,120,185,149, 76, 20, 93,158,108, 84, 57,188,124, 56, 80, 20, 93,163,165,
+ 12,195,149,195,165,122,135,248,156,231,192, 41,131,142, 18,171,207,236, 44,235,125, 36,163, 52, 62, 71,177, 16,192, 31, 80, 82,
+204,195,235,204,141, 86,173, 92, 61, 0, 64,165,164,124,130,131,131,195,184, 92,174, 0, 0, 28, 28, 28, 90,185,187,187,175,123,
+242,228, 73, 7,115,199,180, 79,159, 62,237,188,188,188,254,119,244,232,209,196,156,156,156,219, 0, 46,155, 22, 10, 10, 10,154,
+125,247,238,221, 54, 60, 30,143,168,225, 28, 1, 0,132,133,133, 53, 18, 10,133,238, 71, 30, 56, 67,202,111, 0,134, 83, 2,112,
+ 69,160, 92, 90, 32,157,223, 4,126,126,151,220,139,138,138,222, 40, 41, 41, 73,180,241,208,119,249,240,195, 15,127,138,142,142,
+246, 11, 11, 11, 99,174, 95,191, 78,154,142, 34, 4, 5, 5,245,136,143,143,111,249,217,103,159,109,216,189,123,247, 23,168, 28,
+105, 91, 19,210,245,249, 6,159, 27,142, 39,227, 4, 64, 5,232,109,102,172, 66,249, 15,192,150,148, 11,207,144,158,225,153,154,
+104,209,128, 97, 97,249,155,250,156, 88,111,106,181,218,191,110,220,184,113,112,192,128, 1,101, 79,158, 60,129,187,187, 59,234,
+213,171, 7,130, 32,176,110,221, 58, 69,106,106,234,175,250, 92, 90,111,102,103,103,191,175, 23, 91,230, 80,186,102,205,154,221,
+219,183,111,119, 73, 72, 72,224,232,116, 58,167,198,141, 27,203, 47, 94,188,232,192,227,241, 24, 62,159, 79, 39, 36, 36,216, 5,
+ 5, 5, 41, 9,130, 16,254,249,231,159, 79, 46, 93,186,228, 63,117,234,212,173,168, 28, 38,110,138,157,139, 22, 45,202, 74, 73,
+ 73,129, 74,165,130, 84, 42, 69, 73, 73, 73,197,167,184,184, 24, 37, 37, 37,224,241,120,200,205,205,197,190,125,251,114,244, 89,
+226,171,179,108,172,253,113,221,250,130,156,140,116, 56,217,137,161,147, 22,131, 42,121, 2,148,150, 64,160,213,192,158, 71,161,
+110, 3, 49, 68,118, 78,200,147,150, 33,250,226,213, 92,125,150,120,203,230, 2,181,122,237,184,149, 43,243,116,124, 62, 2, 34,
+ 34,160,209, 15, 21, 26, 11, 45,138, 32,224,223,181, 43, 72,103,103,124,251,235,175,121,250, 44,241, 47, 20, 52, 77,115,212,106,
+117,117,253, 0, 77,211,153, 73, 73, 73,187, 1,156, 38, 8,130, 33, 8,130, 65,121,178,182,178, 87,249, 66,214,106,181,152, 59,
+119, 46,248,124, 62,230,206,157,139,121,243,230,225,251,239,191,199,250,245,235,241,203, 47,191,224,240,225,195,245,207,159, 63,
+207, 63,123,246, 44,179,100,201,146,194,160,160, 32,206,232,209,163, 93,196, 98,241,164,234, 56,167, 77,155, 6, 71, 71, 71, 76,
+155, 54, 13,203,150, 45,195,150, 45, 91,112,240,224, 65, 92,184,112, 1, 28, 14,135,206,204,124, 12,165, 82,201,172, 89,179, 38,
+235,224,193,131,138,213,171, 87,131,203,229, 18, 47,233, 38, 49, 73, 47,168,140, 45, 65,166, 41, 21,158, 0, 88,133,154,125,163,
+ 44,113, 66, 20, 29, 93, 87, 47,142,146,141, 4,209, 33, 0,147, 81,125,120,181,129,227, 11, 0, 62,207,129,115,150,120,200,156,
+ 36,151,205,247, 30,197,231, 40,102, 1,248,221,208, 39, 39, 39, 39,241,254,253, 7,184, 0,240,107,236, 62,222,253,251,247,157,
+ 15, 28, 56, 32,242,242,242,194, 47,191,252, 34, 18,139,197, 94, 22, 56,169,131, 7, 15,170, 4, 2,129,251,168, 81,163,122,182,
+105,211,102,162,254, 69,180, 43,128,166, 40,143, 94,236,254,232,209,163, 59, 30, 30, 30, 15,142, 29, 59, 38,179,230, 0,149,150,
+150,110,253,249,231,159,235, 61,165,220,112, 68,246, 33,162,233,229, 56,236,242, 19,210, 3,230,193,174, 78,107, 12, 30, 60,184,
+ 14, 69, 81,155,109, 60,238,131,251,245,235,247,115,116,116,180,223,168, 81,163,114,175, 95,191,158, 7, 32, 26, 64,140,241,231,
+238,221,187,133, 31,127,252,113,206,230,205,155, 37, 3, 6, 12, 88, 15,160, 63,251,232,103,193,162,242,187, 16,106,138, 58, 52,
+243,192,173,248,157,159,159,191,166,168,168,232,194,195,135, 15, 39,168,213,106, 9, 65, 16, 12,159,207,207,205,203,203, 91,109,
+148,176,212,156, 95, 73, 55,232,115,109, 16, 4,161,101, 24, 38,179, 75,151, 46,147,186,118,237, 26, 21, 23, 23,167,236,220,185,
+ 51, 98, 99, 99, 61,186,116,233, 34,167,105,154, 57,114,228,136,199,187,239,190, 43, 63,125,250,180,108,204,152, 49,141, 27, 54,
+108, 56,122,218,180,105, 5, 4, 65,208,230, 56, 13,207,178,226,226,226,126, 61,123,246,188,240,235,175,191, 58,185,184,184, 64,
+167,211, 65, 46,151, 67, 46,151,131, 97, 24, 56, 59, 59,163,160,160, 0, 11, 23, 46,148,150,148,148,124, 96, 70,184,153,114, 42,
+149, 74,101,255, 47, 38, 78, 62,190,122,193, 92, 71,255,250,245,241,228,158, 18, 58,165, 28, 60,134, 68,221, 70,206,224, 11,196,
+120,120,191, 20, 83,118,239, 47, 85, 40,149,225,102,222,150,171,112,150,148,148,244, 31, 62,111,222,137, 13, 83,167, 58,252,207,
+219, 27, 28, 14, 7, 42,149, 10, 20, 69,129,199,227, 33,116,248,112,240, 61, 61, 49,123,247,110,153, 84, 42,237,143,170, 83,241,
+152,114, 62, 15, 24,115,126,113,227,198,141,143, 67, 66, 66, 48,118,236, 88,244,235,215,175, 82,193, 3, 7, 14, 96,253,250,245,
+ 80,169, 84, 31, 3,184, 14, 96, 29,202,135, 58, 96, 34,178,254,233,118, 62,119, 78,138,162,138,238,223,191,239,180,124,249,114,
+ 66,163,209, 96,193,130, 5, 48, 8, 78,195,121,253,229,151, 95,214,113,116,116,196,252,249,243,213,133,133,133,239, 44, 91,182,
+236,100, 76, 76,140,199,214,173, 91, 7, 3,152,102,202, 73,211,116,254,205,155, 55, 29, 55,108,216, 64,234,116, 58,172, 88,177,
+162,202,240,228,200,145, 35,161,209,104,193,225,112,213, 74,165,170,169, 88, 44, 78,118,119,119, 23, 51,149,157,187, 94,228,254,
+244, 69,121, 10, 3, 99,199,119,181,177,127, 22, 44,167, 84,176,133,179, 64, 20, 29,221, 89, 57,124,248,105,189, 32, 74,210,151,
+137, 53,152,244,109,224, 52, 8,194,218,112, 30,215,127,106,132, 82,169, 68, 65, 65, 1, 10, 11, 11,225,226,226, 2, 14,135, 67,
+ 88,106,167, 74,165,186, 53,101,202,148, 27,155, 55,111,238, 22, 31, 31,223,247,236,217,179, 93, 78,156, 56,161, 76, 79, 79,215,
+105,181, 90, 70, 34,145,112, 59,116,232, 32,234,213,171,151,189, 80, 40, 36,103,205,154, 85,184,120,241, 98, 15, 84,246, 97, 51,
+237, 59,135, 32, 8,124,221,169, 20,211,186,112,160, 86,107, 80, 92, 92,140,172,172, 76,220,185,115, 7,241,241,247,192, 48, 12,
+105,195,113,119, 7, 48,107,215,174, 93,190, 2,129,128,216,189,123,119,157,221,187,119,215,104, 73,221,177, 99, 71,157, 61,123,
+246, 68,234, 71, 47, 50, 95,197,235,157,229,252,215,114,190,202, 48,205, 12,143, 26,133,150,254, 62,255, 38,244,147,146,106,181,
+218, 43,102, 82, 56,124, 3, 96,174,145, 21,172, 38,115,158,148, 97,152,115,221,186,117,251,178,107,215,174, 43,123,244,232,145,
+147,147,147, 19,184, 98,197, 10, 63,157, 78,167,185,115,231, 14,153,156,156,156,126,237,218,181, 6, 13, 27, 54, 28,125,247,238,
+221, 51, 4, 65,104,172,232,224,157,228,228,228,246, 93,186,116,217, 55,122,244,104,255,118,237,218, 9, 92, 92, 92,192,229,114,
+145,146,146,130,196,196, 68,245,158, 61,123, 50,139,139,139,109,153,130,231, 74, 90, 86, 86,247, 1, 95, 77,248,117,116,191,190,
+ 30,109, 27, 55, 18, 72, 36, 18, 64,161,192,189,140, 92, 92,186,151,168,217,114,238, 82,129, 74,165,234, 15,235,167,224,185,114,
+237,225,195,110,239, 76,157,250,107,228,208,161,222,200,201,225, 74, 36, 18, 8, 4, 2,164,166,166, 34,153,166,117, 75, 55,110,
+204,211,139,172, 23,157, 21, 94, 8, 96, 57, 77,211, 92, 0, 16,139,197, 24, 55,110, 28,140,167,220, 89,191,126, 61, 20, 10, 5,
+ 0,112, 9,130, 88, 14,224,167, 87,221,138,101,192,211,167, 79,103,191,247,222,123, 75,184, 92,174,197,172,183,174,174,174, 40,
+ 45, 45,133, 78,167,163,178,178,178,238,185,186,186,130,199,227,129, 97, 24,179,215,209,147, 39, 79,102,247,239,223,127, 17, 73,
+146,150, 44, 31,112,114,114, 74, 63,121,242,100,240,103,159,125, 70,110,219,182, 45,101,212,168, 81,194,147, 39, 79, 82, 12,195,
+236,123,209,251,160, 99,199,157,192,134,225,225, 0,194,129, 42, 14,239, 89,250,101, 54,165, 84,232,216,113, 39, 54,224,111, 78,
+227, 97, 60,131, 32,210, 91,161,154,136,162,163, 87,162,220,207,162, 90,238,142, 59, 59, 98,195,112, 60, 87, 78,107, 96,172,125,
+101, 50, 25, 40,138,170,206,154,247, 87,108,108,236,202,107,215,174,121,126,249,229,151,129, 67,135, 14,117,234,210,165,139,131,
+113, 1,133, 66, 65, 31, 58,116, 72,182,126,253,250,146,115,231,206,165,141, 28, 57,178, 93,117,237,204,200,200, 56,252,237,183,
+223, 58,247,234,213,171, 33,128, 10,255,172,130,130, 2,164,167,167,227,214,173, 91,233, 26,141,230, 55, 27,186,244, 4, 64,228,
+160, 65,131,150,111,223,190,189,206,168, 81,163,114,247,236,217,115, 11,229, 9,139, 77,225,210,175, 95,191,230,219,183,111,151,
+140, 26, 53, 42, 23,229,126,100,153, 96,193,130,133, 1,157, 81,213, 79,171,218,145,137,159,213,106, 53,163, 84, 42, 25,185, 92,
+206,148,149,149, 49, 48, 63, 11,252,193,236,236,108, 38, 51, 51,147,201,200,200, 96,210,210,210, 24, 0,191,152, 40, 94,115, 55,
+ 44,251, 29, 59,118, 52,240,245,245, 93, 96,103,103,247, 7,135,195,145,114, 56, 28,169, 80, 40,252,221,221,221,125,222,210,165,
+ 75,125, 25,134,225, 87,163,162, 45,129,203,227,241, 62,243,242,242, 58,232,230,230,150,233,234,234,154,233,229,229,117,144,199,
+227,125, 14,128, 87,131, 50,183, 4, 17,151,203,157, 98,111,111,127, 92, 40, 20,230, 11,133,194,124,123,123,251,227, 92, 46,119,
+ 10,170, 79,164, 90, 45,167, 64, 32,152,226,233,233,121,220,201,201, 41,223,201,201, 41,223,211,211,243,184, 64, 32,120, 22,206,
+103,121, 43, 49, 8, 45, 57,163, 7, 65, 16,218, 55,222,120, 99, 67,203,150, 45,215,181,108,217,114, 93,139, 22, 45, 54,233,173,
+146,140,222,218, 34,135,229,228,141,255,100, 59, 95, 26,103,104,104,104,204,246,237,219,233,217,179,103, 75, 27, 54,108,248,116,
+246,236,217,210,237,219,183,211,161,161,161, 49,181,229,244,246,246, 14, 8, 13, 13,125,186,121,243,102,221,253,251,247,153,205,
+155, 55,235, 66, 67, 67,159,154,100,134,127, 17,125, 39, 0, 4,233,173, 63,191, 1,216,139,114,231,119, 95, 0,196,112,229,112,
+ 70, 31,125,248, 7,128, 30, 22,142,189,181,156,126,202,225,195, 25,189, 79,213, 49, 0, 73, 70,255,195, 80,217,255,235, 69,112,
+154, 69,211,166, 77, 31, 50, 70, 80,171,213, 76, 65, 65, 1,115,255,254,125,230,220,185,115,140,159,159,223, 67, 43, 56,221, 1,
+140, 1,112,200,199,199,231,238, 91,111,189,149,209,190,125,251,140,128,128,128, 20, 30,143, 23,143,242, 12,239,161,250,207,114,
+ 0, 13,107,224,124,203,197,197,229, 91, 63, 63,191,223,130,131,131, 47,212,171, 87, 47,222,205,205, 45, 78, 36, 18,125,135,191,
+ 51, 99,219,122,206,119,249,240,195, 15,211,203,202,202,168, 86,173, 90,221, 53,183, 81, 72, 72,200,249,178,178, 50,106,224,192,
+129,153, 0,250,252, 23,174,119,150,243,165,112,254,167, 16,172, 23, 76, 7,141, 62,223,152, 41,247,141, 73,153,159,245,219,214,
+120, 32, 24,134,225, 48, 12, 99,207, 48,140, 51,195, 48,110, 12,195,184, 48, 12,227,192, 48,140,176, 6,243, 55,123, 98,255,115,
+156, 95,232, 5,148, 92,255,219, 20, 53,173,127,173,247,167,175,175,175,107,155, 54,109,190,218,191,127,255,148, 71,143, 30, 77,
+217,191,127,255,148, 54,109,218,124,229,235,235,235,250, 44,237,244,246,246, 14,104,210,164, 73, 84, 72, 72, 72,102,147, 38, 77,
+162, 76, 68,214,139,236,187, 64, 47, 98, 66,244,159, 64,253, 50, 2,229,185,176,214,234,133, 77,144,133, 55, 53, 91, 56, 13,124,
+191, 1,120, 87,255,249, 77,191,204,239, 37,112, 86, 65,253,250,245,143, 54,111,222,252, 97,139, 22, 45,146, 91,180,104,241,176,
+105,211,166, 15, 27, 55,110,252, 48, 40, 40,232, 97,221,186,117, 31,122,120,120, 28,173,197, 49,114, 3, 32, 65,213,105,192, 94,
+246, 57,223, 57, 52, 52,244,146, 72, 36, 50,155, 27,140,203,229, 70,182,104,209,226, 38,202, 35, 37,217,251, 39,203,201, 10,173,
+127, 17,216,147,240,213,227, 20,162,250,105, 70,106, 90,207,238,207, 87,155,211,236, 92, 93,122, 33, 19,168, 23, 56,130,231,192,
+105,204,103, 56,167,130,140, 68,211,203,224,100,207, 37,150,147,229,100,133,214,115, 7,151,221, 5, 44, 76,160,122,198,245, 44,
+ 94,109,216,146, 19,235, 89, 56,205,241, 61,122,201,156, 44, 88,176, 96,241,188,238,157,157, 1,156, 49,188, 21, 90, 82,165,182,
+ 68, 19,212, 70,217,158, 96, 57, 89, 78,150,147,229,100, 57, 89, 78,150,243, 63,199,105,192, 74, 11,203,239,153,252,223,244,138,
+ 10,175, 23,146,166,135, 53,171,178,156, 44, 39,203,201,114,178,156, 44, 39,203, 89, 91,140,126, 69, 69, 86,152,225, 15, 59,116,
+200,130, 5, 11, 22, 44, 88,176, 96,241,252, 80,115, 30,173,189,123,247,114, 12,191, 7, 13, 26, 52,146,162,168,175, 12,255, 57,
+ 28,206,143,187,118,237,250,169,186, 26, 34, 34, 34,168,234, 56,205,161,166,122,204,113, 54,109,232, 52,214,221,217,110, 66,113,
+137,124, 85, 74, 54,117, 78,169, 84, 54, 49,172, 19,137, 68, 73, 63,253,244,211,131,231,221,206,145, 35, 71, 54, 52,173,167,158,
+ 31,175,179,155,163,104,220,211,226,178, 21,183, 31,150,109, 98,207,177,151, 2, 15, 0,125, 28, 69,252,247,155,186,240,223,186,
+245, 68,121, 81,166,161, 14,161, 60, 26,182,232,117,236,176,143,143, 79, 99, 39, 39,167, 97, 0,154,202,229,114, 47, 59, 59,187,
+124, 0,119,164, 82,105, 76,110,110,238, 61,107,121,194,234, 33, 29,128,191,254,111,198,153, 52, 4, 88,179,174, 38,244, 8,130,
+146, 1,132, 4, 1,205,177,228,191,157,209,223,109, 0, 37,205, 84, 93,222,163, 1,212, 12, 3, 62, 1,168,142, 61,130,232, 53,
+ 58, 84, 78, 0,186,163, 60,133,195, 13,148,167,159,144,179,151, 44, 11, 22,175, 21, 76,135, 10, 43,254,115, 45,136,137, 78,124,
+ 46, 17,197,128,113, 1, 24,119,149, 74,197, 19, 8, 4, 80,171,213,176,179, 19,175, 29, 51,106,228, 2,144, 40,214,234, 48,238,
+167,159,126,170,245, 76,215,182,212, 3,224,148,233,246,174, 78,226, 69,167, 15, 77,119,237,212,123,233,119,234,212,194,105,165,
+165,165,164, 80, 40,132, 74,165,130,179,179,115,251,177,163, 71,183, 34,121,140,154,207,183,191,184,114,229,202,220,218,182,115,
+210,164, 73, 62, 26,141,242,109,154,166, 5,106,181, 90,104, 90,143,179,157,253,210,211,135,166,219,133,245,249,110, 1,192, 10,
+173,151, 0, 65,128,171,253,153, 85,131, 58,135,188,213, 52, 24,244,157,179, 80,170, 53,239,159,206, 44,123,127, 94,124,246,228,
+204, 50, 77, 75, 60,135,132,149,255, 34,112, 2, 3, 3,191,244,244,244, 28,184,113,227, 70,126, 96, 96, 32, 68, 34, 17, 20, 10,
+133,228,209,163, 71,146,177, 99,199,134,137,197,226,221, 41, 41, 41,107, 97,221, 68,112,254,167,127,158, 3, 0,104, 63,108,161,
+ 63,202, 39,139,150,155,174,235, 60, 98,161, 63,128,169,168, 60, 49,114, 14,202, 83, 40,152,187,235, 8,226,182,127,143,247, 63,
+158,194, 5, 48,182,162,241, 36,240,251, 47,171,209,115,208,132, 74,203, 9, 6,220, 67,219,191, 71,159,143,167, 88,156, 71,241,
+221, 96, 66, 75,211,140, 69, 75, 60, 73, 18,186, 63, 30, 50,230, 38, 24,206, 67,121, 14,176, 42,148, 40,159,208,217,108,249,222,
+141, 57,121, 26, 45,101, 54,225, 44,159,199,201, 63,124,143,170,178,237,240,255, 65,171,165,202,239,173,124, 46,168,131, 41,206,
+167,103,205,154,197,237,211,167, 15,182,108,217,210, 97,211,166, 77,163, 75, 75, 75,255,212,239,183,100,246,242,101,193,226,181,
+ 22, 92,230,133, 22,151,131, 13,191,253,250, 83,131,188,252, 66, 12,255,236,107,236,220,185, 19, 69, 69, 69,112,117,117,133,128,
+207,231,173, 90, 62,199,199,201,201,222,103,248,232,105, 27, 0, 52,174,109,107,108,172, 39,216,116,123, 66, 63,149, 14,151, 67,
+242, 4, 2, 1,185,123,247,110, 20, 23, 23,195,197,197, 5, 2, 1,143, 92,249,221, 55, 98, 39, 39, 7,241,167, 95,204,232,128,
+242,252, 63,181,130, 90, 93,214, 97,255,206,159,156, 10, 10, 10, 48,226,243,105, 48,173,135,207,231, 83,134, 7, 11,123,142,189,
+ 20,204,218, 56,238,227,144,102,142,128,230,246, 5,240, 56, 28,216, 57,187,162, 59,151, 3, 14,129, 38,195,255, 72,155, 9, 96,
+222,235,210,217,192,192,192, 47, 35, 34, 34, 6, 46, 90,180,136, 79,146,229, 41,231,100, 50, 25, 20, 10, 5,124,125,125,113,250,
+244,105,254,236,217,179, 7, 30, 56,112, 0, 41, 41, 41,107,108,229,191,125,251,118, 61,127,127,127, 37, 0,244,109,238,104,186,
+ 46,192,176, 14, 0, 28, 29, 29,107,228,115,119,177, 87,221,190,125,169,169, 97,187, 47,187,250, 82, 22,150, 43, 1,216, 85,199,
+ 69,211, 12,247, 88,212, 88,139,235, 63, 91,180, 67,119, 99,239,185,198,129,129,129, 10,227,229, 14, 14, 14,150, 54,241, 46, 43,
+ 43,243, 55, 93,104, 40,175,209, 82, 94,150,234,235, 49,110,189, 89, 1,166,165,192,221,177, 99, 7, 0,224,135, 41, 67, 56,155,
+ 47, 23,114,185,220,242, 91,237,242,229,203, 17, 25, 25, 41,248,227,143, 63,122,109,223,190,189,215,193,131, 7, 87, 89, 18,170,
+ 44, 88,176,120, 37, 69,150,241,183,101,161, 69, 18,132,163,147,163, 3,194, 7,143,193,209,163,191,163, 83,167, 78, 21,235,234,
+215,175,143,136,254, 31, 96,215,207, 43, 1,192,241, 89, 90,244,172,245, 20,149,200,230,245, 28, 24,181, 48, 35,183, 44, 62, 46,
+ 46, 14, 29, 59,118,172,180,253,224, 1,225,248,101,235,114, 84,147,101,222, 42, 16, 12,201,119,116,178,199,160,225,159,195, 92,
+ 61,163, 71,244,139,123, 55, 98,117,183,188, 39,178,149,236,121,246,226,209,192,199,189, 71,243,144,198, 40,218,183, 22,137,197,
+ 74, 28,205, 86,226,211,238,109, 17,234, 38, 70, 71, 29, 5, 31,123,222, 59,185, 50,237,107,109,100,132,121, 0, 0, 32, 0, 73,
+ 68, 65, 84, 33,180,124,124,124, 26,123,122,122, 86, 18, 89,165,165,165, 40, 43, 43,131, 84, 42, 69,105,105, 41, 72,146,196,180,
+105,211,248,103,206,156, 25,232,227,227,115,194,138, 97,196, 12,189, 37, 11,224,240,202,230,206,157,171,242,242,242, 82,217,217,
+217, 49, 92,190,176,180,243,136,133,142, 0, 64,114,249,165,171, 86,173, 82,251,250,250, 42,185, 92,174, 96,194,132, 9,164, 53,
+109, 86,169, 84,140, 49,167, 90,173,170, 88,190,116,233, 82,181,183,183,183,202,206,206,142,209,104,172, 55, 58,222, 76,125, 10,
+ 33,159, 3, 33,159, 3,145,128, 7,199,122,109, 32, 44,186, 5,157, 78,135,101,203,150,105,124,124,124,212,118,118,118,140, 64,
+ 32,224,143, 31, 63,190,198,118,142, 28, 57,146,113,113,113,209,216,217,217,241, 35, 35, 35,171, 68, 10,157,188,145, 5,177,128,
+ 7, 59, 33, 23,193,245,253, 32,100, 20, 86,183,149,195,169,236,141, 32, 20, 10,209,161, 67, 7, 52,109,218, 20, 7, 15, 30,236,
+204, 10, 45, 22, 44, 94, 11, 88,140, 48,228, 2, 64, 92, 92, 92, 24,202, 39, 68, 68,159, 62,125,136,242, 45, 24, 76,253,178, 63,
+ 62, 29, 49, 8, 20, 69, 87,204,243, 69,144, 4,190,248,164, 23,104,218,154, 17,137,154, 67, 60,107, 81, 79, 5, 39, 67,144, 28,
+ 0,104, 16, 32, 97, 70,127, 58, 20, 20, 77,255, 61, 80,194, 1,198,140,232, 89,190,236, 57,180,147, 3, 10, 95,143,253, 8,230,
+234,105,220,160, 14,169,211, 40, 65, 84,158,236,241,159,152,108,147,229, 52,131,166,117, 37, 65, 90,133, 2, 74,165, 22,209,247,
+158, 42,142,103,201,188, 72,151,180,130,213,225,237, 68,156,130,108, 4, 56, 10,130,115,101,218,215,162,239, 78, 78, 78,195, 54,
+110,220, 88, 69,100,229,229,229,145,101,101,101,208,104, 52,116,105,105, 41, 40,138,194,140, 25, 51,120,179,103,207, 30,150,155,
+155, 27,105,208, 60,230, 56,245,126, 87, 83,111,223,190, 29, 48,107,214, 44,205, 59,239,188,147, 81,191,126,125, 25,135,195,129,
+ 68, 34, 89,221,189,123,119,183, 69,139, 22,105,122,245,234,149,198,225,112, 16, 28, 28, 44,187,117,235, 86, 0, 0,177,181,125,
+ 55,230,252,233,228,143, 12, 0, 16, 4,129,238,221,187,167, 7, 7, 7,203, 56, 28, 14, 30, 28, 90,202, 88,187, 63,121, 92, 18,
+ 13,125,157,245, 55, 17, 2, 16, 59, 84,120,226,117,239,222, 61,179,113,227,198,101, 36, 73,226,230,205,155,126,168, 58,173, 85,
+ 21, 78,177, 88,172, 29, 60,120,112,198,189,123,247,204,149, 7,151, 67,162, 93, 99,189, 1,203,183, 37,144,121,222, 98, 59,121,
+ 28,232,102,127, 57,132,235, 34, 2,132,142, 30, 42,169, 84, 10, 39, 39,167,114, 11,153, 70,131,191,254,250, 11,111,189,245, 86,
+216,222,189,123,207,176,215, 59,203,201,114,254, 13,115, 90,228, 21,180,102, 25, 79,116, 95,201, 71,235,180,105,167, 40, 74,135,
+250,254,222, 88, 58,103, 36, 40,138, 6, 69, 81,208,233,191, 41,138,130, 86,163,121, 46, 45,123,150,122, 92,157,196,139,126,223,
+ 61,206,245,157,126,203,187, 46,153, 53,226, 56, 69, 1, 52,173,133, 86, 11, 80,180, 22, 52, 69, 65,171,125, 62,174, 57, 90,154,
+ 70,128,159, 15,150,204, 26, 1,211,122, 98,118,237,237,123,242,183,105,118,157,250,124,247,245,131,116,249, 50, 86,216,191, 88,
+136,248, 66, 46,195, 21, 65,173,214,161, 84, 77,171, 1,200,148, 90, 90,195,216,123,136, 0,128, 75, 18,175, 83,116,109,211,192,
+192,192, 74, 34,235,251,239,191,247, 88,183,110,157, 47, 0,244,239,223, 63,171,107,215,174,133,247,239,223,135, 68, 34, 33, 10,
+ 11, 11,123, 3,152,160,223,118, 42,128,117, 22,120,101,254,254,254, 74, 79, 79, 79,149, 65, 16,145, 36, 9, 46,151, 11,127,127,
+127,165,151,151,151, 42, 56, 56, 88,198,231,243, 65,146, 36, 12, 66,207,170,215, 60,130, 0,135,195,129,129,211,212,218, 99,224,
+180, 5, 60, 46, 89,245,246,102,196, 73,146,164,217,250, 44,158, 67, 34, 17, 3,192, 98,121, 14,105,116,123,228, 86,239, 33, 16,
+253, 23,120, 0, 78, 51, 12,131,235,215,175, 35, 37, 37, 5,124, 62, 31, 62, 62, 62,136,140,140,132, 74, 85,174,119, 35, 34, 34,
+194, 0,220,100,175, 96, 22, 44, 42,112,250, 21, 20, 88,166, 86,173,234,125,180,226,226,226,194,250,244,233,115,198, 32,128,202,
+197,142, 25,241,163,213, 65,171,213, 0, 12,243, 92,132,150,165,122, 40,138,174,182, 30,131,143, 22, 77, 51, 92,179, 34,139,166,
+161,211,106,159,203,222,163, 41, 45,104, 90, 11,115,245, 16, 4, 73,233,111,248,124,246, 58,121,241,240,241, 15, 32,181,254,245,
+113, 78,167,132,175,187, 80,128, 66, 5, 2, 27,133,112,254,146,107,113,225, 70, 18, 60, 28,156, 94,155,227, 34,151,203,189, 68,
+ 34, 17,100, 50, 89,133, 37,107,221,186,117,190,106,181,154, 4, 0, 46,151,231, 87, 64,251,138, 40, 26,112,118,202, 65, 81, 81,
+137, 59,195, 48,132, 94,240, 44, 7,240, 19,170,201,238,207,231,243, 43, 4,138,177, 0, 18, 10,133,181, 18, 48, 6, 24,196, 25,
+159,207, 55,187,220,116,120,173, 38,240,141,133, 22,152,114,171,150,137,216,226,112, 56, 48,248, 70,213, 4,129, 64, 80,209,119,
+115,224,114,140,234,227,216,238,138,169,209,104, 80, 86, 86,134,226,226, 98,136, 68,229, 6, 51,134, 97, 64, 16,196, 4, 0, 19,
+217,171,152, 5, 11,243, 90,228, 21, 22, 91,230,133, 22,202, 77,118, 4, 0,232,180, 26,179,226,103,239,161, 11,200,200,149,193,
+199,227, 10, 24, 27,179,158, 14, 28, 56,240,103,137, 68,210,206,240, 95, 40,118,112, 31, 61,110, 62,116, 58, 13, 28,197, 36, 62,
+ 27,214,179,146,200, 42,183,104,169, 45,206, 9, 82, 84, 34,155,215, 51, 98,205, 66,103, 39,247,120, 83,241,179, 36, 58, 33,188,
+ 72,170,242, 35,201,171, 40, 34, 36, 84,196,152,249, 35,141,110,238, 55,118,175,159, 59,217,106,123, 32, 65,242,194,199,174, 30,
+205,112, 29,154,216,145,165,103,167,143,104,187,223, 88,204,185,185,185,197,245, 8, 95,213, 45,239, 41,235,163,245, 50,224,232,
+236, 66,250,181,238,140,214, 19,162,112,242,155,233, 12, 80, 4,119,137, 47,217,229,203,197,112,104,221, 23,151, 62, 27, 70, 3,
+ 79, 95,139,190,218,217,217,229,203,229,114,137, 66,161,128, 84, 42,133, 84, 42,173, 44, 8,120, 60, 98,244,231, 95,121,240,248,
+ 2,104, 53,106, 28,141, 89, 92, 35,167, 33,133, 67,223,230,142,224,240, 4,165,119, 2, 3, 87,115,185, 92,144, 36,137, 67,107,
+167, 79,216,183, 98,156, 35, 0,220,136, 91, 43, 29, 52,237,199, 53, 36, 73, 66,165, 82, 9,109,105,247,227,199,143,253, 84, 42,
+149, 82, 47,208, 12,194, 15,169,169,169,117, 85, 42,149,194,120,185, 53, 16,219, 57, 2, 46,245, 1, 59,175, 42,214,179,180,180,
+180, 58, 90,173, 86,206,229,114,161, 86,171,173, 82, 69, 36, 73,242,111,222,188,233, 71,211,180,217,242, 77,131,234, 0, 62,205,
+ 1,129,179,213,125,102,172,120, 17,213,139,173, 23,150, 65,154, 5,139, 87,197,178,245, 10, 94, 19,132,133,223, 21, 66,171,115,
+ 92, 92, 28, 99,252,134,168,211,106,245, 34,235,111,209, 67, 81, 52,178, 11,148,184,127,255, 1, 86,173, 90,133, 11,151,166, 56,
+ 47, 90,180, 72, 56,123,246,108,213,192,129, 3, 87,208, 52,221,130, 36,201, 27,248,123,168,162,178, 85,136,166,235, 38, 36, 36,
+ 4, 26,254,107,181, 90, 56, 58, 58,194,209,209, 17,141,131,253,170,136, 44,138,162,160,169,102,232,208,224,163, 69, 48, 52,163,
+213, 82,160,104,186, 66,252, 20, 73, 85,126,191,157,184,222,192,168,120, 35,195,143, 14,109,154, 88, 22,131, 99, 35, 43,250,177,
+123,253,220,201,139,182,108, 17, 22, 81,158,227, 7,133,127, 26, 26, 49,104, 24, 6,127,244, 94,152, 74,173, 62,200, 33, 25, 90,
+ 91, 81, 31, 72, 48, 48,245,209, 98,241,130,144, 92, 44,211,242,132, 98, 56,248,212,195,131, 50,138,207,225,112,174, 60, 42,150,
+243, 73, 14, 23, 36,151,143, 59, 69, 74,237,107,212,221, 59,201,201,201,146,186,117,235, 66, 42,149, 66,167,211,209,253,251,247,
+207,226,114,121,126, 92, 30,143,232, 51,232, 43, 58, 55, 55, 91, 75,146, 28, 48, 12,133,247, 34,198, 18, 66,145,152,175, 81,171,
+117, 40, 31, 58, 52,103,205, 50, 78,225,224,216,189,123,119, 55, 67, 36,224,190, 21,227, 28,141,214, 57,181,106,213,202,205, 56,
+234,208, 74,107, 17, 49,112,224, 64,177,191,191, 63, 1, 0, 87, 99,102, 25,172,103, 68,223,190,125, 69,254,254,229,126,248,127,
+174, 29,103, 53,167,135, 29, 3,148,164, 2, 37,105, 85, 44, 89,125,251,246, 21, 6, 6, 6,218,116, 45,234, 29,224, 45,230,238,
+178,231,234,128,220,235, 86,113, 13,255, 31,180,190, 14,224,174,120,143,132,192,193, 93,213,110,250, 31,151, 89,177,197,130,133,
+ 85, 48,209, 34,175, 20,194,244, 2,177,179,254,187, 66,112,113, 1, 64,111,162, 35,140,116, 22,180, 58, 77, 21,145, 69, 81, 20,
+120,132, 10,171, 86,173,194,196,137, 19, 1,128, 63,121,242,228,253,139, 22, 45,250,144,166,233, 22, 12,195,116, 36, 8,162,186,
+183,198,211, 18,137, 36,143, 97, 24, 30, 73,146, 29,215,174, 93,235,214,171, 87, 47, 56, 58, 58,130,161,153, 42, 34,139,162,104,
+104, 52,106,139,211,220,186, 58,137, 23,253,190,119,188,235, 59, 31, 44,239, 74,209,244,113,131,200,162, 41, 10,160,203, 55,122,
+146,159,133, 99, 71, 15, 98,195,250, 13, 69, 32,152,187, 96, 64,235,197, 32, 44,136,193, 22,231,175, 38,117,236,208,166, 9, 22,
+109,217, 34,188,157,144,179,255,171, 73, 51, 67, 35, 6, 13,195,222, 93, 49, 32,117,197,215,141, 69, 22,165,165, 81, 82, 84,216,
+247, 20,235,163,245,178,224,118,236,248,113, 98,216,176, 97,116,105,105, 41,248, 2, 1,173,213,106, 57,111,191,253, 54, 53,113,
+226, 68, 50, 55, 55, 23,210,210, 50, 46, 0, 55,188, 6,102, 45,169, 84, 26, 51,118,236,216,176,179,103,207,242, 73,146,132, 84,
+ 42, 69,151, 46, 93, 10, 11,104, 95,209,232,207,191,242,200,206,206,210, 57,137,185, 42, 62,159,135,252,252,124, 58,172,215, 16,
+197,160,145, 19,235, 76,156,181,100, 99,206,197,245,235,172,169,195, 56, 18,208,116,221,230,205,155,213,190,190,190, 74,161, 80,
+ 40, 24, 49, 98,132, 85,227,135,106,181,154, 89,186,116,169,202, 52,186, 80,173, 86, 51,171, 86,173, 82,251,249,249,169,196, 98,
+ 49,163,213,214,236,247, 73,146,132,238,179, 69, 59,116, 58,157,174,146, 21,203, 32,178,180, 52, 81, 22, 21, 21,165,241,243,243,
+ 83,219,217,217, 49, 66,161,144,111, 77, 59,191,250,234, 43,198,213,213, 85, 99,111,111,207,159, 54,109,218, 51, 69, 29,106, 41,
+112, 23,173,173, 72,239, 32,116,116,116, 68,105,105,105, 69, 91, 37, 18, 9, 43,182, 88,176, 48,131, 42, 90,228,213,180,194, 89,
+151, 71,139, 6,202,242,242, 11,189, 60,188,235, 65,167,211,233, 63, 90,232,180, 90,140, 31, 51, 8, 43,214, 71, 1,128, 65,108,
+117,159, 60,121,242,126, 0, 53,222,204,118,239,222,189,112,242,228,201, 78,121,121,121,127,252,252,243,207,110, 67,134, 12,193,
+212,169, 83,177,124,249,114,240, 4, 34,184,121,214,173,168,199, 80,111, 97,193, 83, 48, 96,202, 44,216,233, 52,229, 55, 41,112,
+221, 61, 3,160,165,180,160,181, 90,104,181, 90, 16,156,242,174, 29, 59,122, 16, 67, 62,249, 10, 60,161,147,235,143,171,150, 41,
+ 66, 91, 75, 62,156, 61,106,148,202, 10, 35, 32,121, 59, 33,103,255, 87, 19,167,117, 55,136,172, 95, 99,214,223,253, 97,198, 7,
+ 59,133, 2,110, 69, 61, 90,154, 6, 73,114, 88, 31,173,151, 36,178,132, 66, 97,236,145, 35, 71, 30,182,108,217,146,144,201,100,
+208,106,181, 40, 44, 44,196,254,253,251,239, 48, 12, 3, 87, 87, 87, 28, 57,114,132, 30, 50,100, 72,172, 74,165, 10,127,213,197,
+ 86,110,110,238, 61,177, 88,188,123,230,204,153,131,102,204,152,193,163,105, 26,247,239,223, 7, 8,130,225,241, 5, 32, 73, 18,
+ 60, 30, 23, 37, 37, 82,218,206,193, 37, 71,195,112,236,120,124, 1, 72, 14,191,186, 48,225, 12,125, 50, 82,144, 92,126,169, 33,
+ 18,144,207,231,227,210,222,239,165,157, 71, 44,116, 2, 0,190, 80, 92,212,163, 71,143,244, 38, 77,154,200,174, 93,187, 22,128,
+170, 81,135,166,215,167,174,223,136,105, 28, 59,177, 72,214,189,123,247, 12, 3,103,218,241, 31,165,195,190,152, 69, 16, 28,129,
+172, 79,159, 62,233,161,161,161, 50, 14,135,131,164,131,203,164,253, 70, 76, 19, 17,213, 36, 89,253,227, 33,243,217,141,189,231,
+ 26, 47, 94,188, 88,219,171, 87,175,199, 6,127,177,180,180,180, 58,189,123,247, 22,174, 92,185, 82,219,187,119,239,204,102,205,
+154,149,145, 36,137,132,132, 4,191,234, 44, 85, 6,136,197, 98,237,167,159,126,154,113,235,214,173,218, 70, 29, 86,139,186,117,
+235,130,166,105,116,233,210, 5, 74,165,146,181,108,177, 96,241,122,194, 52,143,150,229,204,240, 90,157,246,171, 49, 19, 22,252,
+ 8, 16, 14, 70,119,129,191, 13, 75, 12,136, 41, 83,190,182, 7, 32, 54,136,173, 73,147, 38,213, 56,205,137,145,200,106, 61,100,
+200, 16,124,243,205, 55,248,225,135, 31,168,229,203,151,115,238, 61, 72,213,140,248, 98, 94,177, 73, 61, 96,192,148,209, 90,250,
+ 43,115,124, 69, 37,178,121, 29,123,127,183, 32, 43, 79,126,126,196,216,217, 21,119, 47, 10,128,148,144, 80, 0,176, 97,253,122,
+ 25, 79,232,100, 31, 49,104, 24, 0,116,255,113,213,178,253,139,176,165,102,177,197, 16, 33, 95, 77,154,230,106, 16, 89,107, 87,
+ 46,190,229, 76,228, 69,141,251,250,142,214,184, 30, 0,112,115,196,254,142,189,191,123, 55,255,169,108, 53,123,158,189, 56, 8,
+ 4,130,133, 39, 79,158,180,111,222,188, 57,241,228,201, 19, 80, 84,249, 17,209,104, 52, 40, 41, 41, 65,105,105, 41, 84, 42, 21,
+ 90,181,106, 69,174, 89,179,198,126,220,184,113, 11,213,106,245, 23,175,122,191, 83, 82, 82,214,254,246,219,111, 56,115,230,204,
+192, 25, 51,102,240,124,124,124, 8,103,231, 60, 66,171, 81, 3, 96,152,130,130, 2,218,206,193, 37,199,195,219, 47, 35, 59, 55,
+ 63, 68,171, 81,131,166, 52, 22,189,205,245,233, 29,166,220,190,125,187,222,247,223,127,175, 54,142, 4, 28, 52,237,199, 53,173,
+ 90,181,114,139,138,138, 82,247,233,211, 39,221,224,188,110,141, 51,252,177, 71,152,112,251,246,205,166,166,156,157, 71,127,191,
+213,192,105, 28,141,216,247,235,141, 91,131,131,131,221, 66, 67, 67,211,171,227, 13, 12, 12, 84, 72, 36, 18,117,227,198,141,203,
+120, 60, 94,185, 37, 75,171,149, 7, 6, 6,210,222,222,222,234, 38, 77,154,148,217,234,180, 47, 22,139, 25,131, 85,204, 28,108,
+137, 58,228,113,160, 27, 50,100, 72, 69,102,248, 41,193,193, 57,195,134, 13,147, 76,158, 60, 25, 91,183,110,197,133, 11, 23,170,
+136,253,176,176, 48,156, 61,123,118, 1, 94,163,196,186, 44, 88,252,199, 80,125, 30, 45, 83,108,219, 22,243, 39,140,124,154,204,
+ 97,209,162, 69, 66,189, 37,171,251,196,137, 19,161, 80, 40, 92,205, 20,235, 6,125,174, 13,115, 34,107,217,178,101, 59, 25,134,
+241, 3,208,129,162,232,203,155,183,108,235, 98,169,190,136,136,136, 42,156, 12, 65,114, 72,146, 40, 19,240,152,191,214,111,218,
+250, 75,165,242,229,206,239,141, 64,224,198,143,171,150, 41, 0,116, 55, 21, 91,248,123,154,145, 10, 78, 3, 62, 31,251,121,133,
+200,250,113,213,178,227,161,173,253, 63,156, 61,106,161, 89,113,182,112,222, 24,123,146, 36,222, 54,241,209,170,194,249, 28,192,
+114,254,141, 46, 67,134, 12,105,209,182,109, 91,210, 88,100,169,213,234,138,196,157, 6,103,241,172,172, 44,132,133,133,145, 45,
+ 90,180,104,118,229,202,149, 46,248,123, 58,167, 87,181,239, 84, 74, 74,202, 26, 31, 31,159, 19,115,231,206, 29, 86, 88, 88,216,
+187,168,168,216, 61,110,219, 66,244,140, 24, 75,132,245, 26, 44, 83, 51, 92, 81,102, 78, 94,227,211, 71,118,184, 29,221,189, 22,
+ 26,181,122, 12,128,187,248, 59,189,131, 41,167,220,144,198,161,113,227,198, 50, 99,161,226,239,239,175,172, 83,167,142, 42, 52,
+ 52,180, 98,185,133,104,190, 42,125,183,149, 83,239,255, 37,171,105,127, 26, 68,155,105,218, 8, 59, 59, 59, 24,196,151, 45,237,
+ 52,142,182, 52,123,163,172, 57,234,176,130, 83,159,222,161,146, 78,139,137,137,233, 22, 19, 19,211, 26,192, 95, 40,159,235, 80,
+ 11,148, 15, 37, 26, 57,205,207,215,127,216,235,157,229,252,175,114,190,202, 8,195,223,190, 89, 64,185,175,214, 25,139, 66,171,
+ 38, 24, 28,223, 1,144,147, 38, 77, 42, 82, 40, 20,174,195,134, 13,171,118,155,220,220,220,173,209,209,209,149, 68,214, 71, 31,
+125,244, 73,108,108,236,137,252,252,252, 90,245,202,213, 73,188,232,204,161,233,174, 97,125,190,155, 8, 96,185, 5, 67, 30, 29,
+218, 90,242,225,143,171,150,237, 55, 17, 91,219, 1,124,100, 73,149,246,120,239, 3,236,216,246,163,193,183, 75,124,235, 90,214,
+209,129,215, 35,205, 70, 43,186, 56, 8, 35,245,237,152,204,250,104,189, 24,240,249,252,206, 51,102,204,224,203,100,178, 42, 34,
+203, 84,104, 73,165, 82,220,184,113, 3, 35, 70,140, 16, 38, 38, 38,118,214,104, 52,167, 94,135,125,144,155,155,123, 79,159,140,
+116,130, 33,133,131, 80, 36,230, 15, 30, 57,209,175, 34,234,112,247, 90,168,148, 10, 0,224, 90,147,222,129,203,229,242, 19, 19,
+ 19, 3, 12, 86, 43,141, 70, 35, 52, 44,191,118,237, 90,128, 33,183,150, 82,169,180, 58,234,240,159,226,188,121,243,166,159, 33,
+ 58,210, 16, 93,200,229,114,249, 9, 9, 9,126, 6, 78,149, 74,101, 85,212,161, 64, 32,224, 39, 38, 38,250, 81, 20,245,220,162,
+ 14,141,133, 49,202,231, 89,172, 52,215,162,222,183,140, 32, 8,130, 97,135, 13, 89,176,120,229, 97, 26, 41, 89,253,164,210, 53,
+193,224,248,110,195, 38,220,186,117,235,246, 24, 52,104, 80, 37,145, 21, 30, 30, 78,237,219,183,239,180, 68, 34,201, 35, 73,242,
+158,173,237,168,240,209, 66,149, 55, 72,144, 36,121,163, 67,155, 38, 32, 73,242,198,236, 81,163, 84,139,176,165,146,216, 58,184,
+127,207,187,153, 69,119,204, 75, 51, 0,238, 94,190, 24,242,201, 87, 24,242,201, 87,174, 0,218, 3,150,163, 21,171,107, 7,139,
+127, 6, 4, 65, 8,234,212,169,115, 75,169, 84,130, 32, 8,168, 84,170, 10,129, 85, 90, 90,138,146,146,146,138,255, 26,141, 6,
+ 5, 5, 5,240,247,247, 7, 65, 16,175,181, 31,157, 70,163,209,205, 88,240,125, 52,135,203,215,209,180,134,208,104, 52, 35,109,
+185,206,103,204,152, 65,194,140,239,213,184,113,227,204, 46,127, 89,156, 51,103,206, 52, 27, 37, 56,110,220,184,106,163, 7, 45,
+225,235,175,191,126,110, 81,135,214,223,190, 88,176, 96,241,154,193,108,232, 94,173,132, 22, 73,146, 55,204, 68, 23, 18, 0, 24,
+146, 36,111,152,201,114,160,203,200,200, 88,224,226,226, 50, 70, 38,147,253,254,209, 71, 31, 77, 10, 15, 15,167,128,114, 7,249,
+218,246,168,168, 68, 54,175,115,223,165,147,139,203, 84, 81,166,235, 76, 45, 79, 6,177,181,118,245,178,117,251, 99,119,133,231,
+102,103,174,179,212, 55, 75,130,202, 82,180, 98,137, 84,177,160,115,223,165, 19,139,164, 10,214, 71,235, 5,129,162,168, 99, 98,
+177,152, 48, 76,166,108,108,189,146, 74,165,144,203,229,208, 79, 73, 3, 0, 40, 43, 43,131,179,179, 51, 40,138, 98, 94,179, 93,
+161, 2, 48, 85,111,173, 2,128,169,169,167,215, 24,159,219, 55,141,215, 85, 99,205,202,177,102,130,104,115,219, 85,183,238, 31,
+224,204,171,102,130,232,234,144,103, 35, 95, 30, 0,240,121,156,124, 75,147, 71,243,121,156,252,106,252,246,109,124,111, 32, 24,
+ 0, 11,216, 43,155, 5,139, 87,247,253,255,101, 85,220,141,229,100, 57, 89,206, 23,194, 41,212,127,172, 93,199,238, 79,150,147,
+229,100, 57,255,109,156,230, 48,250, 21, 17, 90,140,153, 15,128, 90, 90,180, 88,176, 96,241,175,131,170,150,235, 88,176, 96,193,
+130,197,179,163,202,100,210,198, 43, 44,169, 82, 91,162, 9,106,163,108, 79,176,156, 44, 39,203,201,114,178,156, 44, 39,203,249,
+159,227,172,137,219,120,251,209, 0, 54,189, 34, 98,235,165, 4,180,176,102, 85,150,147,229,100, 57, 89, 78,150,147,229,100, 57,
+107, 11,118,232,144, 5, 11, 22, 44, 88,176, 96,193,226, 63, 14,219, 18,150,178, 48, 3,255, 15,102,131,198, 76,253,238, 92,134,
+199, 7,231,191,110, 93, 12, 15, 15,231,216, 82, 62, 53,213,133,188, 14,201, 15, 78,246,252,190,101, 50,237, 15,244,245,121, 81,
+ 53,157,136, 30,129, 45, 63,182, 19,217,125,161, 86,171,235, 59, 56, 58,230, 63,125, 82,176,225,105,198,205,181, 70,101,156, 46,
+ 95,190, 44,105,219,182,109, 54,128, 82,163, 55, 5, 22, 44, 88, 60, 79,184, 52,169, 11,130, 24, 9, 48,127,135, 93,210,204, 29,
+148,220,221, 86,169,156,115,200, 39, 32,137,166, 70, 75, 20, 96,176, 25,197, 73,143,107,120,224,184, 36, 39, 39, 7, 52,104,208,
+ 32, 29, 64,177,105,237,102,214,177,215, 57,139, 87, 25, 97,168,156,176,180,226, 90,120,118,161, 21,252, 81,125,232,200,225, 96,
+ 48, 20, 4, 18,145, 26,219,191, 86, 60, 65, 31,250,130,230,190, 9,160, 37,192,180,180, 23,139,254,167, 80,107,242,105,134,249,
+ 24,143,246,252,101, 51, 95,253,240,177,176, 60,157,197, 2,164,198,174,183,137,143,102,102, 93, 61,187, 79,232, 98, 71,160, 65,
+171,143,166,161,114, 6,231,218, 66, 0,160, 35, 73,146, 77,237,236,236, 36,114,185,188,128,166,233,199, 40, 31,159, 46,170, 37,
+ 39, 9,224, 83, 7,123,251,158, 1,142,130,150, 25,133, 37, 89,165, 90,234, 28,202, 19,186, 22, 61,175, 51,170, 92,100,249,108,
+154, 56,184,237,136,101,227,187,193,165,243,210,105,114,160, 58,161, 69,248, 53,122,251,224,192, 65, 17,157,191, 28, 61,194,193,
+215,211, 1, 57,133, 50,247,245, 91, 99,190,143,137,217,209,103,212,192,238, 61, 1, 96,225,194,133,253,234,214,173, 91,143,195,
+225,164,206,153, 51,103,251,188,121,243, 24,194,242, 76,229, 18,253, 57,108,184,225,219, 3, 8, 5, 16, 8, 32, 5,192,109, 84,
+206, 50, 94, 27,188, 18,156,190,190,190,117,104,154, 30,229,237,237,221, 59, 47, 47,239, 48, 73,146, 91,178,178,178,178, 95,230,
+ 93,135, 97,152,141, 4, 65,140,102, 24,102,147, 13,223, 99,108,169, 67, 36, 18,229, 41,149, 74, 47,253,239,124,165, 82,233,253,
+ 79,245,231, 69,214,245,130,222,191, 63, 59,118,254,118, 79,227, 69, 61, 58, 52, 53,115, 71, 33,154, 30, 59,127,167, 83,229,114,
+161,148,133,123, 32,193, 48, 12, 22, 44, 88, 64, 68, 70, 70,126, 18, 20, 20, 20, 76,146,228,253,185,115,231, 86, 74,125, 99,186,
+206,232, 58,103,197, 22,139, 87, 21,182, 77, 42, 93, 35,154,132,219, 67,201,132, 3,196,136,176, 54,255,235, 48,230,227,190, 4,
+195, 17, 97,240,103,211,117, 54,115, 5,140, 16,130,163, 88,212,188,105,163, 73, 17,125,187,145,173, 67,235, 65,226,233, 12,144,
+ 60,108, 60,146,230, 30,181,108,206, 58, 0,109,107,209,202,121,143,226,119,122,229, 20, 83, 32, 8,128, 32, 0,146, 0,202,148,
+ 52,122,244, 27, 62, 15,192,122, 27,239, 74,164,139, 29,129, 73, 59,149, 0,192,121, 14, 7,165,158,167,167,231, 39, 19, 38, 76,
+176, 15, 13, 13,117, 17,137, 68, 2,165, 82,233,157,156,156,236, 57,103,206,156, 80,133, 66,113, 8,192, 85, 27, 57,253, 27,248,
+213,217, 19, 53,233,211, 55, 91, 4, 6,128,167, 46, 3,173,146,213,125,144,252,240,173,207,215,237,253,236,206, 83,229, 32,212,
+ 98,202,132,194,194, 66, 2, 0, 60, 60, 60,152,202, 34,171,221,136,149,147,123, 96,210,138, 99,144, 43,213,191, 84,199,225, 86,
+239,141, 97, 31,126,248, 65,231,197,179,198, 57,100, 61,209, 32, 49, 85, 1, 55, 7, 62,230, 77, 29, 43, 80,169,180,111,173,219,
+ 30, 51,250,199,239,166,111,166, 40,234, 29, 0,173, 41,138,186, 6, 96,251,130, 5, 11, 44,221,124, 35, 1,204,212,159,208, 59,
+ 56, 28,206,241, 46, 93,186,212, 31, 53,106, 20,209,170, 85, 43, 36, 36, 36, 4,238,220,185,179,219,225,195,135, 83, 41,138,186,
+ 9,224, 62,244,211,158, 88, 1, 30,128, 70, 28, 14,167,249,191,153, 83, 34,145,136,213,106,245,112, 63, 63,191,209,111,191,253,
+118,243,190,125,251, 18,141, 26, 53,194,189,123,247, 90, 29, 61,122,116,222,185,115,231,110,102,102,102,110, 18, 8, 4,209, 57,
+ 57, 57,138, 23,254, 28, 39,136,209, 0,234,232,117,242, 2, 43,190,179, 81,158, 75, 42,199,218, 58,148, 74,165,151, 97, 10, 27,
+130, 32,188,254,201,254,216, 88, 87, 18, 65, 16,110,250,178,168,238,155, 36, 73,232,116, 58, 25, 69, 81, 65, 53,112, 54,210,191,
+ 72, 89,173,117, 1, 84,151, 8, 90, 12, 0, 61,218, 55,125, 10, 2,119, 42, 44, 90, 85, 95, 50,239, 84, 8, 48, 6, 77,143, 93,
+184,227, 86,201, 10,102,250, 22,187, 96, 1, 49,111,222, 60,204,159, 63,191, 47,128,142, 52, 77,159, 11, 9, 9, 89, 83,137,146,
+166, 43,214,205,155, 55,111,117, 53,215, 57, 11, 22,175, 10, 58,195,150, 73,165, 45,190,255, 4,245,239, 4, 10, 35, 2,220,189,
+194,199,143, 26, 32, 14, 13,105, 0, 37, 28,144, 86, 72,225, 72,220, 81, 0,216,109,155,213,105, 64,107, 46, 87, 25,189,108,254,
+212,198, 29,223, 12,197,173, 44, 45,174,101, 81,144,167,106,193, 33,181,160,104, 6, 96,160,172,109,175, 51,139,116, 56,127, 95,
+ 13,146, 0, 56, 36, 64,146, 4, 56,100, 45,201,104,245,131,133,219,174,135, 22,230,209, 0,173,126,240,140, 7,164,105,195,134,
+ 13,135, 69, 70, 70,186,228,230,230,218, 39, 36, 36, 64, 40, 20,194,213,213,149, 35,145, 72,234,172, 88,177, 66, 49,126,252,248,
+222, 26,141, 38, 13, 64,161,149,156, 33,189, 90, 55,191,184,105,217, 66,103,237,229,163, 40,222,245, 43, 56, 36, 3,190,189, 3,
+234,139,197, 56,250, 97, 3,183,240,184,212,125, 87,242,100, 33, 0,178,106, 34,187,123,247, 46, 71,165, 82, 13,114,114,114,106,
+199,227,241,188, 69,174,245,232,108,110,235, 39, 5, 68, 96, 74,190,151,188,211,228,110,222, 61,127,152,216, 5,147, 86, 28,195,
+170,157,151,126,110,137,220,185,213,229,205,182,179,115, 24, 51,254,139, 81, 14,153,133, 26, 44,218, 87,136,109,103,165, 24,222,
+209, 17,147,222,115,198,144,193, 3,237,247,254, 26, 59, 6,192,102,163, 77,238,133,132,132, 16,119,239,222, 53,119,243,117, 5,
+ 48, 93,173, 86,147,124, 62,159, 16,137, 68,195, 22, 47, 94,172, 25, 60,120,112,166,161, 64,199,142, 29,209,177, 99, 71,162,180,
+180, 52,240,212,169, 83,129, 49, 49, 49,186,248,248,248, 36, 0, 7, 45, 91, 44,196, 25, 74,165,162,174, 72, 44,150,175, 95,183,
+238,135, 78,157, 58,209, 66,225,223,233,167,106,195, 9, 0,206,206,206,155,189,188,188,136,111,190,249, 38,251,121,113,214,171,
+ 87,239,216,155,111,190,217,165, 71,143, 30,220,246,237,219,163, 78,157, 58, 21,235, 60, 60, 60,208,177, 99, 71,226,241,227,199,
+ 45,206,157, 59,183,238,216,177, 99,107,254,250,235,175, 83,105,105,105, 61, 94,176, 69,107,147, 94, 76,228,216, 88,254,149, 7,
+ 65, 16, 14, 27, 55,110,244, 50,204,201,168,213,106, 65, 81, 84,197,183,225, 67,211, 52, 40,138,194,226,197,139, 41,153, 76,102,
+205, 62,146, 25,189, 53, 27, 62,180,185,111,129, 64,224, 97, 72,216, 91,195,157,253,142, 68, 88,220,196,222,222, 62, 0, 64, 47,
+120, 6, 79,175, 92,160,252,253, 89, 38,147,165,231,168, 92,238, 0,232, 84, 13,155, 75,100,100,228,240,249,243,231,127, 96,100,
+165,109, 30, 17, 17, 97, 58,237, 85,115,253,183,140, 32,136,211, 36, 73, 30, 2,176, 13,207,209,234,206,226,245, 2,195, 48,109,
+ 0,120, 26, 45, 82,163,124, 84, 8,250,231, 36, 1,192,221,100,185,113, 57,195,119,129,126,185,167,126, 59,198,136,183,128, 32,
+136,171,181,108,226, 25, 88,240,211,226, 2, 64, 92, 92, 28,211,167, 79, 31,194,240,109, 94, 20,133, 31,249,116,240,251, 61,123,
+119,125, 27,164,200, 21, 15,242,129,248, 12, 6, 92, 82, 11, 18, 12, 46, 95, 56,197,128, 75, 71,155,108,101,217,122, 82,175,255,
+215,205, 67, 67,150,110, 89, 54,129,147,148,207,197,182,115,114,104,148,101, 40,200,205, 64,126,118, 58,114, 50, 83,144,149,145,
+114, 19, 32,230, 89,205, 89,229,192, 0, 20,173,127, 7,164,129,106, 34, 47,107,230,212,200,238, 6, 54, 10, 13, 45, 18, 80,128,
+ 70,118,215,138,234, 45,113, 54, 11, 14, 14, 30, 60,107,214, 44,183,219,183,111,139,229,114,185,234,232,209,163,247,210,210,210,
+156, 36, 18,201,211,177, 99,199, 6,215,169, 83,199,233,163,143, 62, 18,236,218,181,171, 31, 42,135,181, 90,226, 12,125,191,221,
+255,226,183,174, 89,105,255,100,111, 20,212,201, 55,112, 36, 71,134, 11,121,114, 38,208, 89, 72,124,213,194, 19, 14, 66, 46, 22,
+182,175,227,208,107,127,242, 82, 45, 77, 15,169,142,243,226,197,139, 18, 59, 59,187, 21, 67,135, 14,149,140, 27, 55, 78, 72,113,
+ 93,184,177,241, 79,156,167,175,139,175, 35, 87,105, 56,131,187,212,195,228,161,205, 49,121,213, 73,131,200, 26, 93,191,126, 49,
+125,253,186,101, 78,173, 70, 83,223,207,203, 9,137,105, 10,108, 59, 43,197,159,179,234,160,235,226,108,124,212,146,139, 16,127,
+ 7,232, 52,218, 70, 17, 17, 17,209,250,183,246,171, 0,250, 69, 68, 68, 52,230,112, 56, 39, 1, 28,168,233, 24,137, 68,230,103,
+ 79,113,117,117, 69, 88, 88, 24, 66, 66, 66,184,157, 58,117,106,110, 34, 96, 42,113,106, 52,106, 9, 77, 51,112,116,116, 20,187,
+187,187,187, 58, 58, 58, 62, 49,247,160,178,133, 19, 0,220,220,220,250,135,133,133,113,119,238,220, 89,152,154,154,122,121,240,
+224,193, 41, 78, 78, 78,149,172,191,246,246,246, 8, 14, 14,198,156, 57,115,184, 61,123,246,172,145,211,219,219,187,123, 76, 76,
+ 12, 8,130,168,120,104, 87, 49, 22, 7, 4,192,199,199, 7,189,122,245,226,246,239,223,191,123, 90, 90, 90,173,174, 35, 27,112,
+194,140, 69,107,129,201,113,178, 56,252,102,174,188, 21,199, 61,223, 96, 93,210,243,225, 25,174,205,106,135, 59, 69, 34, 81,133,
+ 21,202, 76, 93, 85, 56, 73,146,196,236,217,179, 65, 16, 4,120, 60, 30,248,124,190,217,239,206,157, 59,219,218,206,199, 4, 65,
+144,124, 62,127, 58,151,203, 29,165, 82,169,252, 68, 34, 81, 54, 69, 81, 63,171, 84,170,197, 0,180, 12,195,184, 88, 16, 89,102,
+ 57,237,237,237, 3, 30, 60,120,208,208, 82, 67, 84, 42, 21,154, 55,111, 14,168,144, 84, 29,103,114,114,114, 64, 80, 80, 80, 35,
+ 0,134, 41,218,206, 50, 12,211,201,232,191, 49,206, 50, 12,243,158,254,247,253, 71,143, 30, 5, 52,104,208,160,232, 69,157,159,
+ 44,231,191,143,179, 6, 45,226, 73, 16, 68,156,209,181,218,199,240,127,198,140, 25, 51,151, 44, 89,114,155, 32,136, 56,227,229,
+198,229,140,191,245,247,155, 56,134, 97,250,124,243,205, 55,161,223,125,247,221,183,134,178,255,132, 72,180,197,162,229, 84,160,
+180,199,185, 12, 39,112, 57, 20,184, 36, 1, 46, 7, 0, 67, 32, 61, 45, 25,165,210,226,243, 72,221,151,106,157, 37, 43,188,253,
+ 27,111, 52, 91,182, 99,213, 52,242,167,115,114, 20,203,148,184,251,215,105, 92, 61,125, 32,151,210, 81, 7, 64, 48,215, 0, 50,
+ 1, 41,244, 61, 32,182,118,115, 92, 16, 12,183, 92,104,233,197, 85, 37,177,245,210,208,162,113,227,198, 3,231,204,153,227,113,
+253,250,117, 81, 73, 73, 73,233,142, 29, 59,178, 85, 42, 85, 26,128, 63,210,211,211, 27,175, 94,189, 90,176,108,217,178,102,205,
+154, 53,147,236,217,179, 71,109,102, 58,163, 42,156, 83, 71, 12,137, 31, 53,126,162, 40,105,207, 90, 8,146, 18, 48,251, 70, 33,
+245,103,142,124, 22,128, 85,120, 92,214,190, 64,169, 59,190, 50,172, 46, 89,207,145,143, 6, 46,130,206,119,159, 42,171,181,100,
+217,217,217,173,136,137,137, 9,104,211,166, 13, 9, 0,231,238,235,132,211,215,197,215,249, 99, 73,123,162,125, 83,119,228, 23,
+171, 48, 97,109, 34,142,198,231,255,110, 16, 89, 53, 53,210,209,209,177, 32, 51, 95,234,237,238, 32,194,199, 29, 28,208,117,113,
+ 54,194, 91, 11, 33,228, 19,184,151,154,139, 6, 65,245,136,196,243, 7, 91,235, 69, 86,155,156,156, 28, 0,104, 13, 32,245,241,
+227,199,146,182,109,219,150, 24,209, 21, 1, 88, 42, 16, 8,102, 19, 4,193,180,105,211, 38,177, 89,179,102,101,174,174,174, 80,
+ 40, 20, 80,169, 84,224,243,249, 80, 40, 20, 72, 79, 79,199,229,203,151,225,234,234,106,211,129, 42, 43, 43,131,163,163, 35,104,
+154,126,102, 78,138,162,136, 13, 27, 54,216,223,190,125,219, 62, 54, 54,214,123,210,164, 73, 79,154, 52,105,114,109,224,192,129,
+ 15,189,188,188, 84, 55,110,220,192,197,139, 23, 81, 84, 84,132,118,237,218, 89,197,169, 86,171,193,229,114,161, 80, 40, 32, 20,
+ 10,193,229,114,161,211,233, 64,211,116,133,248, 42, 43, 43,195,211,167, 79,193,231,243,161, 86,171, 95,198, 27,104, 21, 11, 85,
+117,195,111,181,177,104, 25, 11, 53, 43, 69, 86, 77,150, 40,139,195,157,197,197,197, 98, 23, 23,151,233, 0,114,106,170,139, 32,
+ 8,112, 56, 28,240,249,124, 16, 4,129, 78,157, 58,225,211, 79, 63, 69,203,150, 45,145,156,156,140, 93,187,118,225,234,213,171,
+224,241,120, 21,229,173, 30,159,232,220,153, 35, 18,137, 46,190,255,254,251,161,179,102,205, 18,213,171, 87, 15, 73, 73, 73,254,
+223,125,247,221,244, 19, 39, 78,124, 32,147,201, 90, 27,238,118,213, 91,233,245, 67,130,229,195,133,189, 84, 42, 21,146,146,146,
+108,217,166, 10, 26, 52,104,144, 78,146,228, 67,154,166,207, 1,104,206, 48, 76, 39,130, 32,142,162,220, 47,209, 24, 50,134, 97,
+222, 35, 8, 66, 10,224, 38, 73,146,247,105,154, 78,103,237, 54, 44,172,184,175,244, 49,253, 79, 16, 68,220,146, 37, 75,250,152,
+ 19, 87,102,174,205, 74,203,191,251,238,187,111,141,254, 63,139, 69, 53, 12,149,157,225, 59,235,173, 92,127, 11,173,184,184,184,
+234, 21, 8,141,143,226,246,237,188,212, 85,131,128,208, 86, 29,141,172, 67, 12, 18, 46, 95, 4,192,252,108, 85, 83, 36,125,196,
+ 36,135,251,243,134,111,199,145, 27, 79,203,241, 56, 59, 31, 23,143,252,140,130,156,180,109, 0, 51, 9,169,177,210,103, 62, 18,
+245, 62,106,230,229,238,225,162,212, 48,160, 25, 0, 85,196,214, 75, 65,203, 70,141, 26,245,143,143,143,247, 80, 42,149,162,243,
+231,207,203, 99, 98, 98,114, 53, 26,205,105, 0, 23,244,101,174, 23, 20, 20, 68,232,133, 9,135,203,229, 10, 52, 26, 77,117,190,
+ 11, 45,167,142, 26,126,126,233,134,173,162,135,183, 18,177, 58,246, 8,138,229,114,234,116,190,162, 31, 0,131,162, 63,121,189,
+ 80,145,197,128,169,203, 35, 9, 72,236,121, 62,119,159, 42, 69,128,249, 33, 89,149, 74, 53,120,232,208,161, 18,131,200, 2,128,
+194, 82, 45, 87,174,210,114,218, 55,117, 71,171, 46, 17, 72, 56,181, 23,123,206,102, 33,200,211,238,108,125,251, 98,171,246,104,
+ 65,126,206,134,149, 81, 27, 87, 46, 93, 48, 85, 48,185,151, 51,194, 91,243, 32,226, 19,112,178,227, 97,241,154,205,218,235,151,
+207,222,144, 72, 36,113, 0,250,229,228,228, 64, 34,145,148, 1,184,207,225,112, 82, 41,138, 50,231,212, 61, 23,128,119,116,116,
+ 52,169,213,106,203,146,147,147,225,227,227, 3,111,111,111, 56, 59, 59,227,238,221,187,248,243,207, 63,113,239,222, 61,208, 52,
+141, 55,222,120,195,166,131,245,228,201, 19,220,184,113, 3,189,122,245,158, 84, 80,144,239,228,234,230, 46, 59,127,238,236,247,
+181,225,164,105,154, 0,128,208,208, 80,132,134,134,138,178,178,178,252,226,226,226,188, 22, 45, 90,148, 17, 16, 16,176, 67,161,
+ 80, 84,178, 28, 88, 43,180, 12,226,194, 32, 2, 69, 34, 17,248,124, 62,164, 82, 41,242,242,242, 80, 90, 90, 30,180,233,226,226,
+242, 82,132,150, 5, 11,213,115, 43,255, 15,139,195, 42,195,157, 46, 46, 46, 67, 1, 76,183,178, 47,208,233,116,224,243,249,104,
+219,182, 45,162,162,162,112,245,234, 85, 28, 56,112, 0,254,254,254, 24, 49, 98, 4, 72,146,196,237,219,183,109,109, 34, 29, 31,
+ 31, 63,189, 95,191,126,161,209,209,209,162,244,244,116,220,187,119, 15, 46, 46, 46,136,138,138, 18,142, 30, 61,186,193,169, 83,
+167,230,162, 60,248,165,122, 24, 69, 23,202,196,146, 1,205,155, 55,175, 82,196,199,199,199,249,143, 63,254,240,170, 16, 96,166,
+ 17,137, 85, 81, 60,119,238,220,149, 33, 33, 33,171,244,195,133, 29, 1,216, 51, 12,211, 57, 54, 54,150, 0,128,240,240,112,134,
+ 32, 8,195, 3,233,230,222,189,123,187,220,189,123,151,153, 63,127, 62,235,163,197,194,146, 22, 25,109,184, 38, 45, 9, 40, 91,
+132,154,177, 60,104, 55, 9, 0, 0, 32, 0, 73, 68, 65, 84,197,203,128,111,190,249, 38,116,201,146, 37, 87,158, 81,100, 25,191,
+ 49, 49, 6,177, 85,241, 48,181, 56,100, 88, 97,251, 34, 37, 62, 94,238,110, 51, 70,180, 7, 77, 3, 58, 10,208, 81, 12,100,114,
+ 5,146,110, 93,149, 67, 68,196, 90,213, 28,161, 96,217,162, 89, 19, 3, 19, 51, 73,100, 23,105,112,230,224, 70,166, 32, 39,173,
+ 63, 82,247,142,124, 62, 34,107, 64,115, 31,111,175, 51, 59, 55, 46, 36,175,166,168, 65,209,229, 58,139,166,153,138,223, 47, 1,
+ 62,158,158,158, 67, 46, 93,186,228, 41, 20, 10, 69, 15, 30, 60,160,247,238,221, 91,164,209,104, 78, 24,137, 44, 0,104,223,186,
+117,107,157,131,131, 3,100, 50,153, 70,163,209, 40,171, 17, 89,126,157, 91,182, 56,187,116,195, 86,145, 82,173, 70,137, 66, 5,
+142,187,151,169,200, 2,128,183,187, 52,244,245, 37, 68,142, 96, 0,164, 73, 53,217,150, 68, 22, 0, 8,133,194,110,227,198,141,
+171, 52, 47,158,135, 35, 79,103, 39,228, 81, 23,238, 20,210, 9,167,246,226,220,237, 66, 90,196,231, 80,158, 76, 74,160,181, 59,
+160, 56,243,206,134, 3,191,197, 29,255,122,206,178, 50,185,172, 20, 65,117,196, 40, 43, 45,193,226, 37, 75,181,241,241,231, 78,
+ 79,159,244,249, 91,123,247,238,253, 14,229,206,224, 0,112,127,239,222,189,195,231,204,153,179, 29,127,167,121, 48, 69,246,144,
+ 33, 67, 50,155, 54,109, 90, 18, 18, 18, 82,242,228,201, 19,220,185,115, 7, 69, 69, 69, 88,189,122, 53,146,146,146, 96,176, 8,
+ 90,229,171, 82, 85, 32,161,168,232,169, 3,195, 48, 40,122,250,196,126,214,172, 89,206,181,225,164, 40,170,210,181,229,235,235,
+139,177, 99,199,242,229,114,185, 75, 70, 70,134,147,241, 58,107, 57,213,106, 53, 12,150, 33,134, 97,160, 86,171, 81, 82, 82, 2,
+181, 90,141,135, 15, 31, 86,136, 44,125,253, 47,205,162,101,248, 45, 18,137,242, 12,231,178, 97, 8, 78, 36, 18,229, 91, 42,255,
+ 44, 48,170,139,209,255,182, 85, 28,214,216, 31, 43,143, 59,248,124, 62, 62,253,244, 83, 92,185,114, 5,201,201,201,224,112, 56,
+144,201,100,144,203,229,232,222,189, 59, 4, 2,129,173, 22, 45,134,207,231, 15,157, 57,115,166, 40, 53, 53, 21,133,133,133, 6,
+103,122, 80, 20,133, 73,147, 38,137,133, 66,225, 80, 91, 77,247, 57, 57, 57,239, 62,124,248,176,145,233, 39, 55, 55,183,196,216,
+167,176,182,136,141,141, 37,194,195,195,153,240,240,112,198, 32,184, 88,176, 48, 7, 11, 90,100,147, 37,139,214,243,176,138, 25,
+ 44, 91,208, 7,136,212, 2, 6,145, 21,102, 36,188, 8,131,133,203,186,161,195,160, 1,255,243,118,119, 59, 21,189, 54,210, 33,
+238, 22,129,204,199,105, 40,200, 73, 71,235,183, 58, 35,233, 86, 34,104, 45,181, 15, 15, 99,107,246,228,172, 23,222, 48, 36,164,
+201, 23, 97,111, 53,195,178,184, 50, 60, 72,248, 3,197, 5, 57, 63, 34,109,239,190,231,114,132, 2,194, 91,120,123,185,157,218,
+190, 54,210,229,232, 29, 18,143, 31,167,225,224,246,149,140, 86,163, 42, 70,229, 72, 46,155,223,154,197,180, 90, 80, 86,156, 7,
+117, 41, 5, 17, 41, 23,217, 56, 72,145, 11,224,220,202,149, 43,187,182,107,215, 78, 48,100,200,144,220,162,162,162,131, 0, 46,
+ 25,149,105,218,176, 97,195, 94, 81, 81, 81,222,143, 31, 63,198,137, 19, 39,114, 81, 30,250,111, 9,153,103, 19,111,173,251,115,
+251,230,169,226,192,198, 88, 61,243,107, 93,236,213, 59,239, 3, 56,106, 84, 38,164, 91,243,134,113,139,166,124, 73,210,215,127,
+199,141,244, 60,164,148,168,254,180, 68, 88, 88, 88, 72,200,229,242, 0, 23, 23, 23,227, 19, 18, 18,123,153,106,218,128,134,217,
+221,167,159,175,163,212, 80, 16,242, 72,102,194, 7, 1,217, 87, 14,198,186, 23, 42, 11, 9, 67, 52, 98, 77,248,108, 96,183, 15,
+214,198,236,255, 56, 46,238,240, 23, 26,149,178, 89,227,198,141,152,107,241,167,110, 76,159,244,121,207, 90, 30,113,135, 43, 87,
+174,144, 28, 14,167,146, 64, 55,182, 16,217,106, 41,178, 5,214,114,154, 10, 45, 3,116, 58, 29, 81, 91, 78,149, 74, 85, 33,180,
+ 76, 31,238,230, 4,227, 63,209,127, 91, 44, 84,198, 67,134, 6,127, 58,165, 82,233,165,247,217,242,126,158, 22,173,103,137, 68,
+172,110,248,210,150,246,145, 36, 9,154,166,193,231,243,241,198, 27,111, 32, 46, 46, 14,110,110,110,112,114,114,130,147,147, 19,
+196, 98, 49,220,221,221, 43,132, 22, 73, 90, 29,165,195,168, 84, 42,127,127,127,127, 60,124,248, 16, 34,145,168,226, 35, 20, 10,
+ 17, 26, 26, 10,153, 76,230,139,151,105,187,103,193,226,159,189,175,196, 25,139, 37,130, 32,226,102,204,152, 49,179,182,124, 51,
+102,204,152,105,206,194,245,140,130,171,146,117,139,107,172, 32,205, 42, 73,189,200,218,246,227, 2,167,253,127, 1,153,153,169,
+ 56,190,103, 77,169, 86,163, 46,162,105,109, 64,202,189, 68,128,196,207, 86, 53,129,100,222,252,160, 87, 23,226,248,109, 53,164,
+197, 5,184,127,237,143, 52, 40, 4,223, 60, 55,145,229,237,113, 42,122,237, 2,151, 67,183, 8, 60,126,156,134,163, 59, 87, 75,
+181, 26, 77, 55,164,198, 94,123, 22,234,161,124,254, 7,252,186, 25,125, 70,117,204, 6, 69, 80, 24,154,116,247,189,252, 92,124,
+144,115,190,250,200, 48, 99, 20, 20, 20, 28, 92,185,114, 37,177,124,249,242, 48,165, 82,249, 43, 0, 99, 19,101,179,160,160,160,
+ 65,155, 54,109,114,123,252,248, 49,239,252,249,243,178, 83,167, 78, 49, 0, 14,213, 96,113,153,214,125,228, 88, 78,203,122,190,
+227,174,167,101,189, 15,224,119,163,213,161,125, 90, 53,189,176,117,201, 92, 71,237,133, 88,148,229, 60,198, 55, 23, 50,165, 0,
+172,222,223, 90,173, 22, 37, 37, 37,208,150, 61,209,181,150,200, 74,230, 71,120,169,242,138,148, 92, 30, 45,215,133, 56,229,171,
+ 78, 61, 73,225,216,217,217,217,180, 47,215, 46,153, 26, 3, 32, 38, 34, 34, 34,250,102,252,225,214, 18,137,228,112, 72, 72, 8,
+ 1, 0, 22, 34, 12, 45, 33, 18,192,164,183,223,126,155,104,219,182,237,229, 85,171, 86, 29,171, 78,172,212,198,162, 85, 19,172,
+229,164,105,154,180,176,127,137,218,114, 26, 91,180,106, 18, 90, 47,211,162,101, 78,180, 24,139, 68, 99, 33,244,111,136, 58,172,
+ 78, 76,217,210, 62,131,159, 28,159,207, 71, 98, 98, 34,234,214,173, 11,141, 70, 3, 71, 71, 71, 56, 58, 58,194,193,193, 1,165,
+165,165,224,241,120,176,177,207,180, 72, 36,202,184,115,231, 78, 35, 79, 79, 79, 80, 20, 85, 73,108, 61,120,240, 0,246,246,246,
+ 89,182, 90,180, 36, 18,201, 31,250,168,195, 74,240,241,241,113,126, 30,251,213,216,146, 21, 30, 30,206, 14, 17,178,168,214,154,
+101,193,170, 85, 96, 98,137, 82, 27,253, 47, 64,121, 14,183, 62,250,223, 48,243, 91,109,102,217,147, 37, 75,150,156, 50,242,239,
+ 42,120,198, 46, 24, 82, 60, 84,138,112,225,214,100,201,242,114,115, 61,181,101,245,124,167, 61, 9, 64,214,227, 84,156,217, 23,
+ 85,162,163, 52,239,128,102,114,226, 79,236,139, 5, 1, 57, 82, 98,207, 88,119,139, 64,203,150, 77, 2,112,224,182, 22, 5,153,
+ 15,192, 48,244, 54,228,199,200,159,249,232, 4,125,244,134,151,155,199,169,109, 81,243,157,247, 39, 18,200,124,156,138,227,123,
+162,164, 58,173,188, 43, 82,247, 37,212,150,246, 83,192,149, 99, 47, 90,215,191,115,203, 1, 1, 65,126,160, 25, 45,104, 62,131,
+143,166,121,112,239, 95,151, 31, 56, 39, 42,217, 67,151,209, 95,100, 93,178,206,129,174,172,172,236, 0,128,107,168,156, 94,161,
+ 69,112,112,240,128,117,235,214,121,102,102,102,138,174, 95,191,174,216,184,113, 99, 62, 77,211,251, 1, 88, 51,148,250,245,245,
+180,172, 45,168,156, 47,167,197,212,145, 67,226,135,124, 50, 74,148,122, 34, 6,174,169, 73,152,114, 33,155,186, 95,164, 30,172,
+183,174,153,133,135,135, 7, 83, 88, 88,152, 94, 92, 92,220,200,222,222, 30, 79,158, 60,193,211,167, 79, 81, 82, 82, 2,149,244,
+169,206,157, 42,150, 17,186,167,224,241,120,200,127,172, 5, 69, 81,185,214, 90,179, 0,184, 70, 70, 70,126, 70,211,180, 33, 35,
+ 98,165,232, 66,163,114,134,243,161, 81, 68, 68, 68,180, 81,212,161,177, 51,188, 33,189, 3,161, 79,239,208,238,247,223,127,191,
+219,179,103,207, 76,115, 98, 69, 40, 20,218,236, 40,109, 41,138,177, 54,156,150, 44, 90,166,203,109,225, 52, 12, 95, 26,156,224,
+ 77,151, 27,192,225,112, 64,211, 52,172, 8,170,248, 71, 69,139,113,116, 96,109, 68,142,201,177,169, 54,113,104, 45, 35, 17,159,
+171, 69,203,112, 44,248,124, 62,126,251,237, 55,124,242,201, 39,160, 40, 10,118,118,118,112,112,112,128,189,189, 61,246,237,219,
+ 7, 67,250, 7, 91,244,171, 86,171,253,101,201,146, 37, 51, 55,108,216, 32,102, 24, 6, 2,129,160, 66,104,205,159, 63, 95,161,
+209,104,126,177, 74,104, 25, 50,190,211,204, 29,123,123, 93,181, 81,135,230,182,177,224,175,229, 18, 25, 25, 57,156,166,233, 15,
+ 96,146,194,193,164, 92,165,212, 15,108,122, 7, 22, 86,220, 79,174,254,139,155,103, 16, 88,132,145, 37,171, 66,112,145,213,137,
+ 23, 79, 87,151, 83,155, 87,207,119,218,113,149, 64,106, 74, 10, 78,255,186,166, 92,100, 61,218,243, 23,210, 99,243,144, 26,219,
+ 1, 41,177,239, 90,253,246, 68, 16, 45,235,120,185,224,169,140,134,180, 48, 3, 96,112,253,121,136, 44, 79, 87,207, 83, 63, 69,
+205,119,222,251, 23,137,212,212, 84, 28,223,179,166, 68,167, 83,190,243, 44, 34,107, 40,159,255, 65,112, 67,191,228,217,159,125,
+ 48,160,109, 3, 31,184,103,220,197,161, 17, 3,176,112,215,135,112,244,228,224,205, 94,142,248,116,177,207, 0, 73,168,240,161,
+164, 3, 62,176,129,218, 88,100,181,172, 95,191,254,128, 75,151, 46,121, 52,111,222, 92,116,239,222, 61,229,198,141, 27,243, 21,
+ 10,197, 49, 0,137, 54,112, 26,139,172,150, 51, 70,143,136, 95,186, 57, 90, 68,242, 5, 88,246,203, 33,140, 63,155, 73, 29, 78,
+151, 70,160,242,176,162, 89,168, 84,170, 19, 81, 81, 81, 42,146, 36,241,244,233, 83, 20, 22, 22, 34, 63, 63,191,226,187,184,184,
+ 24, 28, 14, 7, 39, 79,158, 84, 75,165,210, 75,214, 54,240,226,197,139,245,179,178,178, 66,114,114,114, 90,235, 63,247, 80, 30,
+ 93,232, 96,180,172,117, 78, 78, 78, 24,128,171,134,229,153,153,153,245, 46, 95,190, 44,169,137,223,209,209, 17,124, 62,191,146,
+ 69, 75, 40, 20,194,219,219, 27, 58,157, 14,187,119,239, 6,128,167,213,113,240,249,130, 28,146, 36, 64, 51,180, 74, 36, 18,209,
+ 18,137,196,172,192,178,133, 83,143,204,247,222,123, 79,153,144,144, 96,214,162, 85, 27, 78,134, 97,228, 61,122,244, 64,118,118,
+ 54, 68, 34, 81,197,195,218, 32,168, 72,146,132, 80, 40, 68,110,110, 46,198,140, 25, 3,134, 97,228, 47,250,206, 99,236,211,164,
+ 23, 67, 4, 0, 66, 47,132,170,248,105, 89,235, 3,101, 24, 26,100, 24, 6, 6,193,101,178,190,162, 46,107,178,183,155,248,116,
+141, 46, 46, 46, 94, 90,222, 28,102,163,201,247, 38, 27, 30, 10, 21, 66, 43, 41, 41, 9,209,209,209, 40, 46, 46,134, 64, 32, 64,
+ 81, 81, 17,182,110,221,138, 59,119,238, 64, 32, 16,192,176, 47,172,213,111,109,219,182, 93,122,238,220,185, 59,131, 7, 15, 86,
+ 36, 38, 38, 66,161, 80, 32, 49, 49, 17,239,190,251,174,242,194,133, 11,201, 10,133, 34, 18,214, 12, 29, 26, 50,190,235,167,215,
+ 81,169, 84,184,126,253,186,217,143,165,109, 76,145,156,156, 28, 64, 81, 84, 35,134, 97, 58, 50, 12,227, 4,125, 10, 7,253,127,
+227,207,123,250,117, 78, 12,195,116,164, 40, 42, 56, 57, 57, 57,128,149, 19, 44, 94, 81,156, 49, 18, 91,140,145,200, 58, 83,189,
+ 69,139, 38,163,182,172, 89,224,244,203, 21, 18,143,211,147,113,237,200,186, 18,138,214,190, 99,227,116, 56,221, 96,148,107, 67,
+ 36,182,111, 70, 19,229,225,204,210,194,199, 0,195,169,141,208,170,196, 9,154,140,218,186,102,190,243,206,107, 4,178, 31, 63,
+194,133,131,107, 75,116, 58, 85, 87,164,196, 94,175, 13,231, 80, 62,127, 14,143, 67,204,238,209,254,127,252, 14,255,107, 8,251,
+252, 52,228,102,102, 99,119, 82,193,211,228, 34,213,168, 11,132, 6,233,143, 84, 91,122,125,230,230,230,234,195, 67,159,207,221,
+221, 46, 29,146, 30, 32,120, 50, 13,163, 97,150,228, 92,168,152,150,162,114, 59,171,194,199,209,209,113,240,181,107,215,156, 68,
+ 34,145,248,218,181,107,244,198,141, 27,159, 40, 20,138, 35, 0,226,173,234,123, 85,248,181,105, 24,116,230,219,181,155, 69,101,
+ 50, 57,100,106, 13,132,222, 18,106,127,252,173,254,176,156, 0,179, 18,167, 80, 40,220,185,115,231,206, 94,157, 58,117, 10,104,
+214,172, 25,249,244,233, 83,148,149,149, 85, 56, 87,123,122,122, 34, 41, 41,137, 78, 77, 77,205, 22, 10,133,187,172,109,231,219,
+111,191,157, 74,146,228, 61,253, 48,218, 61,152, 68, 23, 26, 21,109,148,147,147,211, 70, 34,145,156, 1, 96,103, 20,117,104,204,
+105, 72,239, 48, 19, 0, 73, 16,196,213,196,196,196,178,158, 61,123, 66, 44, 22, 67, 38,147,193,223,223, 31, 58,157, 14, 71,142,
+ 28, 65, 66, 66,130,140,166,233, 51,102,196,107,165,118, 42,149, 10,127, 0,164, 66, 46,127, 99,248,240,225, 97,147, 39, 79,174,
+ 20,146,238,229,229, 5, 55, 55, 55,155, 56, 1,224,233,211,167, 77,126,255,253,247,137,137,137,137, 95,247,234,213,203,121,230,
+204,153,194,250,245,235,131,162, 40,178,182,156, 69, 69, 69,206,215,175, 95,255,190, 67,135, 14, 95,246,236,217,147,251,237,183,
+223,194,217,217, 25, 20, 69, 65, 44, 22, 67, 42,149, 34, 50, 50, 18,231,207,159,215, 49, 12,179,182,164,164,100,138,141,231, 18,
+158,245,218,180,100, 1,178,148,146,193, 66,249,127,188,157, 38, 62, 93,208,167,112,152,110, 33,131, 61,172, 61,231, 13, 66,139,
+195,225, 32, 45, 45, 13, 27, 55,110,172,146, 71,203,144,254,193, 2,183,185,190, 51,167, 79,159,166, 8,130,120,235,218,181,107,
+211, 63,254,248,227, 81, 50,153,204,207,222,222, 62, 91,171,213,254,172, 80, 40, 22,163,220, 31,149,111,203, 61, 68, 38,147,165,
+155,139, 58, 52, 45, 3,184, 84,203,105,146,222,161, 82, 10, 7,147,109, 42,165,126, 48,147,222,225, 31, 63,238, 44,231,191,146,
+243, 85, 23, 91,150, 19,150, 86, 65,203,209, 60,158, 66,219,252, 92, 50,241, 44, 34,171,170,181, 68, 41, 79,158,187, 51,227,127,
+106,149, 18,178,146,188,251, 72,219,157,255, 76,221,210,183,243,108, 50,129,180,212, 71,184, 18,183,182,188,157, 41,177,181,110,
+ 39, 1,124,179,254,104, 44,159,112,118,195,141,137,159, 32,187, 88,134,163, 41, 69,123, 24,185,234,139, 95,128, 34,156, 7, 72,
+157,234,220,214, 89,185,235, 58,126,228, 60,192,195,151,135, 21, 83,127,134,104,134, 59,255,205,174,157,108,153, 3, 49, 87, 36,
+ 18,157, 91,189,122,117,183,142, 29, 59, 10, 35, 34, 34,204, 57,200,219,138,204,171, 15, 30,173, 63,188,225,135,169,238,205,219,
+225,199, 57,211,168,157,241,183, 76,163, 16,171, 69, 72, 72, 8,117,241,226,197,201, 99,198,140, 89,209,173, 91,183, 58,239,191,
+255,190,192,223,223, 31, 66,161, 16,143, 30, 61,194,185,115,231,212, 41, 41, 41,217,114,185,124,114,139, 22, 45,108,201,113, 86,
+ 52,119,238,220,165,250, 58, 8,253,112, 97,107,232,163, 11, 13,133,244, 73, 75, 91, 3,176,155, 63,127,254,199, 0, 96, 33,236,
+123, 46,128, 13, 0,184, 12,195,228,198,196,196,188,117,240,224,193,183, 38, 77,154,196,239,213,171, 23, 46, 93,186,132,227,199,
+143,107, 52, 26, 77,188, 94,184, 90, 59, 85, 14, 13,224,186, 78,167,187,181,108,217,178,183, 56, 28,206, 92,195,138, 59,119,238,
+ 96,219,182,109,181,225,212, 1,248, 62, 47, 47,111,125, 76, 76,204,220, 19, 39, 78,140, 28, 62,124,184,147, 86,171, 69, 82, 82,
+ 18,126,250,233,167, 90,113,150,148,148, 76,244,240,240,152,125,228,200,145,159,143, 29, 59,214,111,216,176, 97,228,248,241,227,
+ 17, 21, 21,133, 95,127,253,149,166, 40,234, 32,143,199, 27, 94, 88, 88, 40,123, 25,119, 29,253, 48, 92,182,141,115, 29,214,200,
+251, 44, 67,131, 86, 34,231, 89, 9, 12,253,232,220,185,115,133,149,209, 96,133, 51, 46, 67, 16,132,205, 67,135, 0, 92, 24,134,
+161, 1,172, 69,249,252,162,198, 89,225, 57,248, 59,115,188,181,140, 77,115, 84, 46,119,160, 66, 82,245,147, 74,187, 0, 12,154,
+214,192, 86, 60,119,238,220,149,243,230,205, 91,105,154,194,193,184,144,105,234,135, 5, 11, 22,128, 77,239,192,226,117,133,121,
+161,117,125,147, 86, 27,216,127,230,234,111,167,205,211,105,213, 37, 12, 52,225,120,180, 47,241, 89, 43, 99,104,102,198,201, 29,
+243,163,192,160,136,161,116,211,159,185,245,255, 80, 59, 9,103, 55,148, 70,142,197,175,183,179,153, 92,153,246,195, 95, 52,154,
+ 74,214,160,114,159, 44,122,224, 41,101,209,110,215, 58,188,253, 19,223,113, 39, 14, 63,253,216,230,122,242,243,243,127, 91,185,
+114, 37,249,195, 15, 63,132,201,229,114, 83, 7,249,218, 98, 90,223,113, 51, 56,111, 6, 7,140,187,242, 48,253, 3, 88, 49, 92,
+104,138,183,223,126, 59,231,238,221,187, 67,142, 29, 59, 54,248,236,217,179,221,100, 50, 89, 0, 65, 16,176,179,179, 75, 87,169,
+ 84, 39,132, 66,225, 78, 27, 69, 22, 0, 96,222,188,121,204,130, 5, 11,136,187,119,239, 50, 28, 14,231, 79, 0,169, 28, 14, 39,
+205,216, 9,222,120,185, 97,155,249,243,231, 91,243, 64, 60, 91, 86, 86,150, 16, 25, 25,217, 41, 50, 50,242, 13,189, 85,232, 44,
+254,246,249,178, 21, 90, 0,103,249,124, 65, 54, 65, 16,126,124,129, 80,118,241,226,197, 19,207,200, 41,215,104, 52,211, 31, 63,
+126,188, 98,197,138, 21,139,237,237,237,219,220,185,115,231,207,103,225,212,139,168,254,110,110,110,117,162,163,163,247,110,221,
+186,181, 29,151,203,189, 68, 16, 68, 68, 73, 73,201, 75,157, 84, 90, 63, 65,244, 2, 27,230, 58,180,138,247,121, 39, 41,253, 39,
+132, 27, 69, 81,101,179,103,207,206, 55, 21, 94,166,214, 43,195,127,125, 42, 23,107,246,169, 45, 81,148, 53, 8, 23,162, 12, 0,
+202,231, 46, 44,159, 86,199,218, 73,165, 1, 40,106,186,206, 73,146, 60, 8,224, 62, 73,146, 15, 77, 3, 93,140,215, 45, 88,176,
+160,166,235,156, 5,139, 87, 26, 86,220,217,230,147,192,252,218,122,210,190, 64,115,229,243,105,231, 16, 62,127, 1, 9, 76, 5,
+ 64, 48,192,138, 95, 52,154, 89,213,109,232,243, 54, 22, 51, 4, 38,233,119,230,183,185, 23,176,168, 22,125,247,133, 21,243, 15,
+218,200,217, 24,213, 79, 40, 91,133, 51, 60, 60,156, 99,225, 97, 94,105, 82,105, 75,136,141,173,200,226,111,169,157,198,231,155,
+227,229,203,151,235,180,109,219, 54, 7,149,157,254,205, 45,103,108,236, 59, 7, 0,245,156,247,231, 43,193, 25, 20, 20, 36,120,
+244,232,145,250,223,117,109,178,156,255, 74, 78,151, 38,117, 65,224, 51, 24,231, 14,170,214,162,101, 36,208, 24,230, 39, 20, 39,
+ 61,182,208, 78,195,117,238,146,156,156, 28,208,160, 65,131,116, 0,197, 38,237, 48,183,142, 97,143,209,127,158,211, 28, 70,163,
+242, 84,116, 44,204, 28, 8,150,147,229,100, 57, 89, 78,150,147,229,100, 57, 89,206,218, 10,173, 87, 26, 36, 88,176, 96,193,130,
+ 5, 11, 22, 44, 88,252, 35, 32,170, 81,165,182,152, 4,107,163,108, 79,176,156, 44, 39,203,201,114,178,156, 44, 39,203,249,159,
+227,172,137,219,120,251, 87,117,232,240,133,181,155, 53,171,178,156, 44, 39,203,201,114,178,156, 44, 39,203,249, 44,130,229,149,
+ 6, 23, 44, 88,176, 96,193,130, 5,139, 87, 6,221, 26, 66,194,165, 64,254,254,200,170, 32,170, 26,209, 51, 8,190, 0,240,188,
+248,254,163,144, 0,232,109,244,255, 48,244,145,241,172,208,122,117, 17, 12, 96, 38, 0,227,185,200,174, 0, 88, 98, 82,110, 7,
+ 0,227, 9, 9,101, 40,159, 39,240,161, 45,149,145, 36,185,164, 83,167, 78, 95,156, 63,127,254, 7,157, 78, 23, 89,139,246, 6,
+ 72, 36,146,165, 4, 65,180, 2,192, 35, 8,226, 81, 94, 94,222, 18,157, 78,247, 44, 81, 43,129, 62, 62, 62,223, 1,248, 31, 73,
+146, 60,130, 32,146,243,242,242, 22,233,116,186,211,207,192,233,232,237,237,221,158, 97, 24, 31, 0, 28, 30,143,247, 36, 43, 43,
+235, 50,106,153, 91, 41,124,126, 18, 95, 42,211,241, 0,192,201,158,171,141,157,223, 68, 99,237, 50,246, 20,103,193,226,191, 13,
+166, 60, 50,185, 18,222, 13,194, 98, 70,135, 41, 20, 64,244,168,143, 53,127,164, 98,138,165,237, 9, 51, 81,205,166,156,239, 6,
+ 97, 49,197,148,115,244, 8,194,247,127, 60, 66,181,145,246,214,112, 26,176, 9, 32, 71, 91, 49, 75, 1, 97, 93,244,245,191, 29,
+189, 81,121,168,176, 98,232,176, 90,161, 53,176, 33, 36, 20, 23,220,216, 36, 24,194,120, 29, 1,188,161,127,200, 63, 68,121,174,
+162,210,103,108,220,171,194,249,111,195, 92,134, 97,134, 84, 58, 89,205,228, 33,122,231,157,119,222, 63,118,236,152,157, 97,190,
+ 59,154,166, 33, 22,139,117, 0, 70,216, 80,151,215,192,129, 3,103,108,217,178, 5, 3, 6, 12,152, 29, 23, 23,183, 18, 64,153,
+181, 27,187,186,186,134,187,184,184, 68,109,222,188,217,179, 93,187,183, 8,129, 64,128, 71,143,146,253,198,140, 25,211,236,238,
+221,187, 7,243,243,243, 71,217,218,121, 55, 55,183,161, 46, 46, 46, 43, 54,110,220,232,209,161, 67, 7, 16, 4,129,132,132, 4,
+191,137, 19, 39,190,145,145,145,177, 43, 47, 47,239, 75, 91, 57,221,221,221, 27, 58, 59, 59,119,249,241,199, 31,197,237,219,183,
+135, 72, 36, 66, 98, 98,162,195,231,159,127,238,147,149,149,149,148,151,151,119,198, 86,145,117, 51,225, 80, 63,157, 70,181, 12,
+ 0,184,124,225,180,118, 43,226, 15,221, 60,117,168,111, 77,203,194,231, 39, 29, 96,197, 22, 11, 22, 44,140, 49,180, 14,124, 24,
+ 6, 83,143,253, 52,135, 4,128, 30, 35, 23,142, 31, 90, 7, 63,252,146,109,121, 14, 91, 27,249,166, 12,247, 69, 84,116, 22,242,
+158,165,157,155, 0,114, 34,151, 59,254,205,182,109, 61,190,186,112, 33, 89, 3,252,252, 31, 57, 68,102,135, 57, 45, 10,173,254,
+ 77, 16,169, 43,183,152, 16, 61, 27, 96,215,241, 84,206,185,119,222,121,167,193,167,159,126, 74,180,108,217, 18, 9, 9, 9, 13,
+119,237,218,213,251,240,225,195,201, 20, 69, 37, 0,184, 13,235,179, 90,243, 0,132,114, 56,156, 86,255,114,206,127, 51,236,245,
+226, 42, 15,127, 39, 58,173,146,240,244,228,201,147,191,113,185, 92,131, 69,235, 77,153, 76,230,109, 98, 5,179, 6,245,180, 90,
+ 45,238,221,187, 7,146, 36,121, 0,234,163,234,148, 26,150,224,103,103,103,183, 46,254, 74,130, 59,193, 21,163, 72, 9, 64,169,
+129,192,193, 27, 91,182,197,184, 77,158,240,101,255,211,167, 79,159, 43, 45, 45,221,110, 67,123,234,219,219,219,175,188,113,227,
+134,187,157,157, 29,104,154, 70,105,105, 41,124,124,124,176,121,243,102,151,201,147, 39, 15,145, 74,165,167,149, 74,229,175,182,
+136,115,103,103,231, 46,183,110,221, 18, 27, 38,148, 86,171,213,240,243,243,195,142, 29, 59,132,227,199,143,111, 82, 92, 92,156,
+169, 86,171, 83,172, 37,148,202,116, 60,157, 70,181, 44,122,237,252,186, 0, 48,252,203,249,203, 4,165, 78, 71,172, 89, 38,149,
+233, 14, 3, 96,133, 22,139, 23,141, 86, 30, 30, 30,177,133,133,133,103, 0,140,194,243,177, 52, 52, 20,137, 68, 45,104,154,246,
+ 33, 73, 18, 28, 14, 39, 87, 38,147,221, 0,240,160,182,132,238, 65,157,251, 66,104,247, 9, 24,250, 13, 18, 0, 65,146,137,148,
+ 70,190,237,201,131,211,135,158,137, 83, 32, 30, 9, 48,111,144, 0, 77,144,228, 13, 90, 39,223, 92,120,239,244,209,127,203,193,
+185, 84,130, 70, 65, 62,214, 79,140,249, 60,248, 6, 5, 66, 66,210, 32,119,164, 89, 63,172, 56, 14,232, 53, 97,194, 4,159, 47,
+191,248,130,248,100,196,136,224, 51,231,207, 19, 97,182,204, 86,240,106,194,162,227,187, 89,161, 21,222, 4,174, 12, 48,125, 87,
+212, 76,146,203,225, 16,131, 39, 44, 25,178,117,237,247,100,247,190, 17, 21,195, 39, 29, 59,118, 68,199,142, 29,137,101,203,150,
+ 5,255,249,231,159,193, 59,118,236,208,197,199,199,223, 0,176,219, 82,101,239, 6, 65, 65, 3, 34, 62,143, 43, 27, 60,103,251,
+198,182,109,219,254,159,189,243, 14,139,226,106,219,248, 61,219,251, 46, 11, 11, 75, 71, 84, 58, 54,136, 98, 87, 44,216, 80, 44,
+137, 93, 99,124,237, 45,209, 68, 99, 98, 52, 38,182,216, 98, 84,140, 26,107,236,250, 26,123, 47,177, 87, 80, 64,197, 74,103, 89,
+154,244,178,253,124,127, 0,126, 72, 40, 11,152,215,148,249, 93,215, 92, 11,103,103,238, 61,211,206,220,243,156, 6, 30,143,135,
+250,104, 2, 64,247,198,140, 24,182,101,195,136, 97,211,230,199,183,110,221,150,188, 11,205,191, 17,119,129, 55,147, 90,203,157,
+156,156,218, 25, 12, 6, 62, 0,176, 88,172,226,196,196,196,105, 40,153, 27, 16, 0,142,154, 76,166,126,181,208,102, 0, 88,208,
+175, 95,191,121, 83,167, 78,133,179,179, 51,166, 79,159, 14,189, 94, 31,118,250,244,233,249, 0,150,161,134,155,199,198,198,102,
+254,134, 13, 27, 44, 89, 92, 17,252,230,196, 34, 37,219, 0, 0, 16,243,128, 99,147, 8,166, 79,159, 46,189,127,255,254,162,218,
+ 24, 45, 27, 27,155,239,126,249,229, 23, 75,161, 80, 8, 66,200,155,185, 24,243,243,243,145,159,159,143, 41, 83,166, 72,159, 60,
+121,242, 67,109,140,150, 82,169,108,183,126,253,122, 1,159,207, 71,126,126, 62, 71,167,211, 81,121,121,121, 40, 44, 44, 36, 90,
+173, 86, 55,109,218, 52,222,163, 71,143, 58,167,164,164,196,128,230,175, 2, 19,192, 0, 54,155, 61,176,113,227,198, 31,188,120,
+241,226,129,193, 96, 56, 12,224,240, 59,120,153,234,106,111,111,191, 88,165, 82,173, 7,176,235,223,114, 64,149, 74,229,225,155,
+ 55,111, 58,109,216,176,225,227, 85,171, 86,157, 2,240,223,122,200,113, 56, 28,206,160, 78,157, 58, 57,141, 30, 61,154,171, 84,
+ 42,161,209,104, 16, 27, 27, 43, 61,112,224,128,203,195,135, 15,147, 74,103,196, 48,251,133,194,202,189,173, 24, 44,233,190, 54,
+109,219,181, 31, 60,104,128, 68,105, 37, 67,145,214,136, 23,241, 41,206,103, 78, 29,235, 20,205, 17,220,212,233,114,134,102, 62,
+191,153, 95, 91,205,192,192,174,237,187,117,237, 42,145, 89,200,144, 83,160,195,171,184,100,151,203,231,143,119, 96,177, 4, 87,
+ 77,148,126,100, 90,212,249,194,247,121,110,166, 3,172, 2,190, 85,179,230,109,253,238, 7,141, 93,244, 1, 33, 4, 12,130,181,
+ 21,163, 89,211, 1,214,218,146,105,191,106,165, 7, 66, 8, 69, 97,101,249,104, 86,143, 70, 88, 76, 8, 62, 7, 3, 84,143, 26,
+170, 41,203, 8, 2,120, 22,150,150, 1, 19,199,143,167,242,114,115,241,240,225,195,194,138, 38,235, 71, 7,112,174, 50,208,224,
+104, 98,221,205,246, 95, 52,154, 85,105,213,161,217,227,104, 9,133,194, 74,211,101, 50, 25, 2, 3, 3,177,116,233, 82, 22, 0,
+255, 10, 95,191, 61,201, 42,192, 59,177,113, 46,100, 34, 30,195,217,217, 89, 34,149, 74,235,173, 9, 0, 32, 38,215,182,206,164,
+215,189, 95,191,250,248,194,158,213,190, 5,121,217,236,138,171,136,197, 98,120,120,120, 96,222,188,121,230,105,214,159,255,169,
+166,173,173,173,103,135, 14, 29,252, 47, 93,185, 98,161, 82,169,120, 42,149,138,119,238,210, 37,139, 54,109,218,248,219,218,218,
+122,190, 57, 84,132,212, 38,159,223,135,134,134,206, 63,122,244, 40,163, 67,135, 14,144,203,229, 8, 12, 12,196,169, 83,167, 88,
+171, 86,173, 90, 2, 96, 94, 77,249,100, 48, 24,237, 59,116,232, 64,129, 16,168,115, 12,184,179,212, 19, 15, 87,122, 33,175,152,
+224,117, 78, 46,138,138,138, 33, 20, 10,249, 40,169,238, 53,119,223,219,182,105,211,134, 2,240,198, 92,229,229,149, 44,249,249,
+ 5,208,106,117,224,241,120, 18, 0,124,115, 53, 9, 33,182,237,218,181, 3, 0,232,116,186, 55,111,120,217,217,217, 84, 78, 78,
+ 14,180, 90, 45,216,108, 54, 7, 53,183,107,124,163, 41, 21,177,244, 44, 14,111,246,232, 41,223, 38,142,158,242,109, 34,139,195,
+155,173,149,228, 26,205, 73,147,138, 88,250,247,124,125, 90, 51, 24,140,109,141, 26, 53,122,194, 96, 48,118, 2,176,173,167,102,
+ 75, 0, 75, 4, 2,193, 5, 47, 47,175, 68,161, 80,120,169,212,168,183,169,163, 38, 87, 40, 20, 94, 90,178,100,201,193, 7, 15,
+ 30, 12,190,120,241,162,107,100,100,228,160,229,203,151,239, 19,139,197,215,240,118,187,196, 90,223,155,174,174,174, 91,239,220,
+185,211,178,109,219,182, 91, 0,240,222,209,253,206, 4,208, 2,102,205,200,241, 94,206,187,189,159,159,159, 19,159,207, 71,183,
+110,221, 0,160,115,125, 52, 57, 28,206,160,121,243,230, 53,250,230,155,111,184, 41, 41, 41,184,116,233, 18,238,222,189, 11,131,
+193,128, 73,147, 38,241, 70,143, 30,221, 80, 34,145, 12,170, 85, 62, 89,210,125, 51, 62,253,172,231, 23,211,199, 73, 34, 18,116,
+216,126, 33, 1, 71,110,165, 32,173,144,139,190,131, 70,203,122,132, 12,233,193,229,201,246,213, 86,243,203, 57,115,122,142,255,
+100,184,228,113,138, 9,199,110,171,113,251,105, 14, 12,108, 11,244, 30,244, 31,121,243,118, 61,251,176,192,222,241,190,207,209,
+ 47, 64,235, 25, 51,102, 88,207, 94,185,251,134,125,203, 1,107,211,179,208,161,188,241,113, 7, 44, 44, 69,162, 1, 79, 59,117,
+ 26, 39, 40,153, 47,182, 90,205,183,244,252, 67,214,165,101,161, 99,249,246, 89, 29, 45,225, 86, 90,173,200, 60,183,237, 27, 6,
+161, 48,125,132,253, 91,229, 64,165,249,252, 29, 24, 60,227,179,207,216, 50,185, 28,161,161,161,208, 20, 20,188,213,102,182,171,
+ 19,122, 94, 16,178,146, 26,122, 57, 62, 9,116,161,174,253, 3,223, 87,198, 87, 25,209, 58,113,226, 4, 9, 14, 14,166, 0,224,
+208, 19,100, 13,242,198, 15, 67,166, 46,153, 71, 49, 40,210,192,183,237, 99,135, 70, 62, 5, 86, 86, 86, 40, 44, 44,132, 70,163,
+ 1,135,195, 65,113,113, 49, 18, 18, 18,112,251,246,109,200,229,242, 90,229, 36, 55, 55, 23, 98,177, 24, 98,177,248,157,104,206,
+253,184, 27,239, 85, 98, 58,239,236,237,223, 59,253, 52,249,191,173, 27,181,232, 28,217,117,200,244, 40,169,181,125,113,100,100,
+ 36,110,222,188,137,172,172, 44, 4, 4, 4,252, 83, 78,230,221,210, 54, 89,119, 1,200, 27, 55,110,236,120,246,194, 85,121,126,
+177, 73, 26,151,170,103,155, 76, 38, 8,133,118,134,253,135,142,229, 12, 30,212,151, 82,171,213,105, 0,238,150,154,219,154,230,
+ 84,228, 3,240,252,240,195, 15,191,156, 60,121, 50, 94,190,124,137,113,227,198, 21,221,189,123, 55,179,109,219,182, 86,191,252,
+242,139, 96,230,204,153,184,114,229,202,130, 19, 39, 78,252, 6, 32, 22, 64,165,115,181, 17, 66, 56, 28, 14, 7,134, 82,219,160,
+ 51,154,222,248,251,220,220, 92,144,162, 44,112, 56, 28, 38, 0,107,152,217,142,206,100, 50,113,216,108,246, 27,147,149,144,154,
+139,132,180, 66,228,230,107, 81, 84,100,128,182,136,128, 41,180, 98, 1,113, 74, 0,113,230, 70, 71,248,124, 62, 12, 6, 3,242,
+242, 74,178, 81, 22, 41,211,106,181,200,201,201, 1,147,201, 20, 3,144, 2,120,109,142, 96,105, 35,247, 35,165,213,128,184,183,
+187,159,226,197,201,185,111,165, 73, 69, 44,253,161,153,222, 76, 43,199,230,215, 91, 12,222,225,245, 38,237,253,182,207,226, 89,
+ 91, 91, 95, 62,120,240,160,183,155,155, 27, 98, 99, 99,189, 62,250,232,163,128,148,148,148, 22,168,253,156,140, 66, 6,131,241,
+195,232,209,163, 39, 15, 27, 54,140,114,119,119, 7,139,197,130,193, 96,112,124,249,242,101,224,129, 3, 7,230,108,221,186,245,
+ 23,163,209, 56, 11,230,183,251, 99,112,185,220,253,155, 54,109,234, 24, 16, 16,128,157, 59,119,226,238,221,187,166,150, 45, 91,
+ 50, 70,141, 26, 5, 23, 23,151,128, 81,163, 70, 29,209,104, 52,189,235, 24,217,114,105,211,166,141, 19,147,201, 68,219,182,109,
+ 57, 55,111,222,244, 3,112,179,158,199, 84,236,232,232,120,165,115,231,206, 45, 46, 92,184, 16,174, 86,171, 59,215, 98,127, 1,
+ 32,196,222,222,126,185, 76, 38,147,215,162,140, 45, 76, 78, 78,254, 28,192, 33, 51, 55,105,237,239,239,143,248,248,120,120,122,
+122,130,195,225,180,209,233,116, 19, 0,244, 4,240, 53,128, 39,181,200,175,123,215,174, 93,157, 58,119,238, 76, 29, 58,116,232,
+ 77,251, 80, 6,131, 1,131,193, 0, 14,135,131,214,173, 91, 51,194,194,194, 28,238,221,187,231, 14, 51,170, 17,173, 26,117,238,
+219,182,125,167,246, 29, 3,154, 49, 86, 29,122, 1,163,201, 8, 38,101, 0,139, 50,193,164,231,129,199, 97,194,221,247, 3,230,
+211, 71, 17, 1, 90,141,174,111,230,243, 11,199,205,209,236, 25,212,189,131,183,167, 59,227,167, 35,175,144,157,252,196,152, 28,
+125, 53,131,193,100,192,219,191,139,194,221,167, 5,179, 69, 64,103,182, 42,246, 81, 96,113,113,199,110, 89, 47,175, 94,120, 31,
+ 55,228, 66,128,233,232,160, 24, 16,220,189, 51, 39, 69,165, 42, 56,112,232,120, 84,161, 30,183, 1,224, 10, 64,245, 6,154, 53,
+109,213,170,211, 47,203,150, 89,217,217,217,177, 71, 14, 27,102,216, 28, 30, 30,142, 42,170,126, 23, 2, 76,133,173,109,183,137,
+ 19, 39, 50, 83, 84, 42,114,224,240,201,200, 50, 61,148,188,165, 52,109,230,232, 21,140,130,167,181,170,166,236, 11,112,149,182,
+182,222, 19, 38, 76,128, 90,165,194,206, 93,187,242,139,129, 91,101, 81,172, 99, 76,172,247,105,100, 59,102,246,127,250, 81, 78,
+118, 10, 76, 92,176,185, 77,160, 46,173, 17, 82,254,255,252,151,247, 34,127, 99,147, 53,190, 82,163, 85,145,255, 62,193,124, 9,
+ 7,174, 7, 14,236,101,164,231,233, 10, 94,190,124, 9,133, 66, 1, 59, 59, 59,200,100, 50, 60,126,252, 24,151, 46, 93,194,179,
+103,207, 96, 50,153,208,188,121,243, 90,229, 38, 35, 35, 3, 17, 17, 17,144,203,229,239, 76,179,145,147, 53,166, 58, 89,115, 82,
+ 51,115, 57, 23,238, 62, 11,216, 60,119,144, 15,195,107,208,214,242,147,196,106,181, 90,252, 67,120,211,187,208,201,201,169,221,
+246,237,219, 57, 26, 3, 36,238, 19,110,173, 40, 40, 54,138, 0, 64,196,103, 22,132, 45,247,152,245,253,247,223, 23,124,242,201,
+ 39, 94,137,137,137, 75,205,136,245, 47,238,218,181,235, 23,132, 16,246,140, 25, 51, 0, 0,163, 71,143,206,189,125,251,182, 59,
+128,180, 75,151, 46,217,143, 29, 59,246,249,229,203,151,133,159,125,246, 25,211, 96, 48, 60,102,177, 88,228,196,137, 19,223, 1,
+248,246, 15, 79, 68, 6,227,126,120,120,120, 3,123, 23, 15,184, 88, 49,208, 97,222,179,146, 2, 78,104, 66, 82,220, 43, 68, 71,
+222,133,173,173,173,204,206,206,238, 73, 82, 82,146, 46, 57, 57,121, 78, 65, 65,193,134, 26,242,248, 48, 44, 44,204,206,197,197,
+ 5,249,249,249, 72, 74, 47,196,244,195, 66,228, 22,149, 4, 49,216, 40, 66, 11, 39, 15,137,128,161,189,155,150,150,166,211,106,
+181,223,228,228,228,108,175, 78,147,205,102,103, 70, 70, 70,138,157,157,157, 81, 92, 92, 76, 94,191,126, 77, 21, 20, 20, 32, 47,
+ 47,143, 58,121,242,100,255,148,148,148,150,174,174,174,148,163,163,227,119, 41, 41, 41, 69,201,201,201,227,204,169,154, 44, 53,
+ 76, 70, 22,139,181,106,252,248,241,131,127,251,237,183,251,135,190,245, 14, 41, 87, 93, 34,243,245,245, 61,219,172,153,143,253,
+174,149, 77,215, 2, 88,241, 23,184,182,198,124,245,213, 87,222,150,150,150,152, 56,113, 34, 22, 46, 92,136,249,243,231,187, 77,
+156, 56,113, 60,128, 31,107,161, 35,176,181,181,189,247,211, 79, 63,121,181,107,215, 14,167, 78,157,194,222,189,123, 17, 19, 19,
+ 99,112,117,117,101, 5, 4, 4, 96,193,130, 5,232,209,163,199,184,105,211,166,117, 82,169, 84,126,102,154,143, 79, 22, 44, 88,
+ 16,210,190,125,123,124,252,241,199,154,223,127,255,125, 48,128,115,231,207,159,239,114,229,202,149, 67,187,119,239, 22, 44, 89,
+178,164,219,204,153, 51, 39, 2, 88, 87,135,253,239,223,177, 99,201, 28,202,237,219,183,199,242,229,203,123,212,211,104,113,173,
+172,172, 78,238,220,185,179,133,135,135, 7, 70,142, 28,233, 55,120,240,224,147, 89, 89, 89,221, 1,152, 85, 32, 57, 56, 56,252,
+112,244,232,209,198, 85,213, 44, 84,134, 70,163,177, 28, 48, 96,192,178,184,184,184, 90, 25,173, 61,123,246,224,243,207, 63, 71,
+243,230,205,155,181,110,221,122,227,132, 9, 19,240,225,135, 31,118,125,252,248,177, 18, 37,189,150,107,132,207,231, 55, 27, 58,
+116, 40,247,206,157, 59, 0, 0, 95, 95, 95,180,104,209, 2,155,104,178,222, 0, 0, 32, 0, 73, 68, 65, 84,241,241,241,184,127,
+255, 62, 52, 26, 13,148, 74, 37, 6, 14, 28,200,143,139,139,107,150,145,145, 81,163,209, 98,240,132, 99, 66,130,123, 75,142,221,
+ 78,129,209,100,192, 7,141,165, 8,240,178,193,211,164, 92,132, 61, 73,130, 81,203,129,212,210, 10,109, 58, 5, 89,170,147, 99,
+198,100, 2, 53,183,215,226, 9,199, 12, 12,233, 35, 62,118, 75,133,108, 85, 52,121,113,247,183, 75,250,226,130,113, 0,112,255,
+226,190,141,182, 86,130,238,238,254, 31, 48, 59,119,239, 39, 63,188, 87, 61, 38,235,127, 51,183,223, 31,184,226,132, 77, 46,236,
+140,209,179,135,119, 32,108,185,227, 93,137, 94,191,190,236,187, 30, 64,208,156,175,190,106,253,159,241,227,249, 38,147, 9,187,
+127,253, 53, 55, 34, 60,252,233,120,192, 52,161, 10,189,245,128,203,224,144, 16,158, 68, 42,197,167,211,167, 67,162,215, 95,126,
+115, 72,128,174,159,126,241, 69,187, 41, 83,166, 8, 54,126, 55,249,126,143,177,139,252, 77,132, 80,101,213,148,123,170, 15,197,
+181, 28, 27, 18, 2,137, 84,138, 25, 51,102,128,210,233,206,190, 49, 80, 44, 92,254,164,127,135,128,225,125,219,131, 2,133,189,
+ 39,174,227, 69,124,122,228,229, 20,188,250,187,186,170, 10, 84,217, 70,171,218,170,195, 60, 29, 82,187,246, 25,148,226,238,238,
+158,231,230,230,150,151,153,153,137,168,168, 40,100,101,101, 97,221,186,117,136,142,142,134,201,100,170,179,129, 49,153, 76,120,
+215,154, 0,160,180,146, 98,100,239, 86, 44, 77,113, 1, 63, 61, 61,253,173,234,163,127,144,209,122,131,193, 96,224,187,186,186,
+130, 1, 80, 57,133,122,177,122, 79, 71, 74,189,167, 35,149, 83,168, 23,107,181, 90,134, 88, 44,134, 70,163,225,155, 33,197,238,
+213,171,215, 23,191,253,246, 27,123,241,226,197,104,210,164, 9,116, 58, 29,110,223,190,157, 4, 32,173,116, 29,213,213,171, 87,
+ 85,101, 70,120,233,210,165, 56,124,248, 48,213,173, 91,183, 57,149, 93, 79, 41, 41, 41, 63, 76,152, 48,225,117, 97,222,107,108,
+ 26, 82,132, 67, 35,211,177, 45, 36, 6,195,172, 14,226,117,106, 2, 54,111,222,140,243,231, 47, 80,231,206,157,231,252,254,251,
+239,162, 62,125,250,172,117,112,112, 56, 81, 93, 38, 85, 42,213,226, 41, 83,166,100,231,229,229, 33, 47, 47, 15, 69, 69,197,120,
+ 93, 0, 68,174,246, 70,228,106,111, 20,155, 4, 8, 93,191,129, 17, 25, 25,169,136,137,137,177,239,219,183,239,106, 59, 59,187,
+173,213,105, 38, 39, 39,223,153, 58,117,106,113,110,110, 46,180, 90,173,206,104, 52,106,139,138,138,244,251,246,237,251,204,202,
+202,170,205,169, 83,167,216,231,207, 95, 96,253,254,251, 21,206,165, 75,151,100,129,129,129,251,149, 74,229, 14,115, 34,101, 76,
+ 38,115,205,174, 93,187,198,132,134,134, 42, 3, 2, 2,124, 42, 84, 69,217,117,239,222,189,193,175,191,254,234,176,124,249,242,
+ 57, 40,233,128,242, 94, 81, 40, 20,211, 66, 66, 66, 16, 26, 26,138,227,199,143,207, 92,187,118, 45,122,245,234, 5,123,123,251,
+169, 48,191,218, 11, 0, 86,252,248,227,143, 94, 94, 94, 94, 24, 61,122,180,118,220,184,113,179,182,111,223,238,122,237,218, 53,
+206,142, 29, 59, 26, 76,156, 56,113,198,240,225,195,139, 27, 54,108,136,117,235,214, 53,102, 48, 24,107,204,186,191,149,202,207,
+134, 13, 27,134,149, 43, 87,226,247,223,127, 31,132,146, 7,170, 22,192,233, 27, 55,110,244, 93,178,100, 9, 6, 13, 26, 4, 71,
+ 71,199, 25,117,137, 60,121,123,123,127,211,179,103, 79, 92,187,118, 13,126,126,126,104,211,166,205, 76, 0,138, 58, 30, 78,134,
+ 88, 44,222,191,125,251,246, 14, 13, 26, 52,192,162, 69,139,208,168, 81, 35,108,221,186,181,131, 72, 36,218, 15, 51,155,111,200,
+100, 50,177, 80, 40,196,156, 57,115,200,160, 65,131, 94,215,180,204,156, 57,147,240,120, 60,200,229,114,115, 59,190, 8,248,124,
+126,219, 38, 77,154,224,246,237,219, 56,127,254, 60,230,205,155,135,207, 62,251, 12,233,233,233, 24, 58,116,168, 16,192,135,181,
+216,111, 27,107,107,107,228,230,150,204, 11,223,164, 73, 19, 60,120,240, 0,233,233,233,112,116,116,132, 90,173,134,149,149, 21,
+ 60, 60, 60, 96, 50,153,108,204,147, 36, 77, 20,150, 50,164,101,105,192,130, 1,254,238, 10, 92,142,202, 68, 66,186, 22, 54, 86,
+ 22, 80,167,165,195,193,138, 15, 39, 39,103, 16, 98,106, 98,150, 3,102, 50,252,121,124, 1, 94,231,233,144,252,228,247, 76,157,
+ 81, 51, 33, 59,246, 70, 98,118,236,141, 68,157,166,120,194,253,235,231, 51, 27, 40, 5,112,114,114, 2, 69, 76,173,222,199,253,
+248,145, 51,156, 68, 2,214,232,243,219,190,161, 78,252, 50,151,210,100, 38,180,236,169, 44,137, 44, 91, 3,174, 31, 13, 29,218,
+118,214,172, 89,252,212,212, 84,211,240, 33, 67, 94, 47,254,246,219, 11,103,106,120, 49,200, 7,220,186,119,239, 14, 6,128, 51,
+231,206, 21,168,129, 36, 0, 80, 2, 78,253, 6, 12,232,248,213,151, 95, 10, 50, 50, 51, 77,183, 95,230, 31,139, 78, 35, 3, 45,
+141,112, 53,167,125,150, 17,104, 90,166,123,246,236, 89, 82, 4,220, 7,128,206, 78,152, 26,212,206, 55, 96, 84, 72, 71,164,164,
+101, 97,198,226,109,216,120,224,202, 89,153,158,116,249, 7, 61,138,199,215,201,104,149, 86,253,252, 33,173,176,240,143,181, 7,
+245, 53, 48,127,134,102,101,252, 19,141, 86, 25,122,125, 73, 45,137, 86,111,130, 86,111, 42,123,171, 69, 81, 81,145,217, 18,103,
+207,158,221, 57,125,250,116,172, 94,189, 26,207,159, 63, 7,135,195, 65,147, 38, 77,236, 0,136,203,202,124,127,127,127, 27, 6,
+131,129,167, 79,159, 98,213,170, 85,248,228,147, 79,200,205,155, 55,183,162,242,241, 82, 30,188,126,253,122,253,132,113,159,100,
+103,165, 38, 64, 95,148,133,180,228, 87,208, 20,100, 99,209,210, 31, 80,168,103, 65,157,163,131, 58, 71, 7, 6,207, 18, 27,127,
+217,206,244,246,246,238,201,100, 50,131,171,201,231,237,212,212,212, 95, 38, 77,154,148,173, 86,171,223,236,159, 86, 79,160,213,
+191,125,189, 10,133, 66,172, 89,179, 70,230,238,238, 30,194, 98,177, 2,171,209, 76, 73, 76, 76,140,158, 52,105,146, 54, 53, 53,
+ 21, 57, 57, 57, 56,118,236, 88,223, 6, 13, 26,200,151,173, 88, 77, 21,232, 88, 80,103,235,160,206,214,129, 43,182,193,254, 67,
+191, 49, 61, 60, 60,134,179, 88,172, 54, 53,153,172,221,187,119,143, 26, 50,100,136,100,197,138, 21,175,143, 30, 61, 26, 10,160,
+252, 9,121,186,102,205,154, 3,251,247,239,207,251,226,139, 47, 44,151, 47, 95, 62,243, 61,155,173,192, 33, 67,134,120,154, 76,
+ 38, 28, 60,120, 48, 18,192,143,191,253,246,219, 61,141, 70,131,161, 67,135,186,150, 86, 35,153, 67,203,225,195,135, 79,238,208,
+161, 3, 62,253,244, 83,221,133, 11, 23,252, 1,172, 70, 73, 85, 46, 1, 16, 15, 96,237,149, 43, 87,154, 79,155, 54, 77,211,170,
+ 85, 43,124,252,241,199,159, 0,232, 80,131,110,219, 97,195,134,121,153, 76, 38,236,219,183, 47, 2,192,169, 10,223, 95, 58,116,
+232,208,109,173, 86,139, 17, 35, 70, 52, 4, 80,155,130,156,195,227,241, 14,126,255,253,247, 22,201,201,201, 24, 53,106,148,230,
+233,211,167,248,246,219,111, 5, 50,153,236, 84,185,123,192,108,120, 60,222,230,159,127,254, 57,164,105,211,166,152, 52,105,146,
+118,195,134, 13,211, 39, 79,158,172,245,247,247, 71,104,104,104, 8,151,203,173,213, 20, 29, 42,149, 42,251,201,147, 39, 86, 53,
+ 45, 73, 73, 73,230,118,207, 23,138,197,226, 91,190,190,190,185, 77,154, 52,249,192, 96, 48,224,241,227,199,175,118,238,220,105,
+106,210,164, 9,214,175, 95,143,229,203,151, 35, 56, 56, 24, 76, 38,211,108,163,197,100, 50,161,211,233, 32, 20, 10,193, 98,177,
+240,234,213,171,178,161,101,192,225,112, 0, 0, 34,145, 8, 2,129, 0, 12, 6,195,172,222,104, 20, 5,146, 91,168, 7,155,205,
+ 0,139, 97, 66,116,124, 14,116,122, 19,248, 28, 38,216, 44, 10, 32, 38, 88,136,216,224,115,153, 96, 80,148,201, 76, 77,228, 20,
+232,192,229, 48,192,230,112, 41,134,193, 40,120,243,112,100, 25, 5, 2, 1,151, 82, 72,121,224,115,254, 66,211, 2, 83, 37, 13,
+203,199, 0,108,145,179,243,224,149,171, 86,113,115,243,243, 49,104,208,160,215,113,247,238,237, 42, 2,238,117,170,161,147, 18,
+131,197,114,239,220,169, 19,194,194,195,145,151,149,245, 2, 40,105, 28,207,181,183, 31,178,102,205, 26,110, 81,113, 49, 6, 13,
+ 28,152,253,252,250,245,221,137,249, 56,177, 47,190,196,136,213,120,222, 57, 28,219, 50,221,156,172,172, 44,160,100, 8, 9,165,
+181,120,217,148,225, 61,144, 87, 88,140,217, 63,236, 50,133, 71,167, 76,189,150,132, 62,191,169,144,243, 15,123, 12,143,175,176,
+ 0, 48, 99,192,210,178,232, 82, 77,102, 69,163,209,188,115, 3, 84, 95,205,202, 76, 98,125, 53,255,138,176, 88,172,226,103,207,
+158,113,165, 86,246, 38, 43, 9, 59,171,193, 39,215,101, 0, 96, 41,102,229,232,140,122,147, 74,165, 2,143,199, 43, 54,179,186,
+ 97,220,230,205,155, 23, 1,240, 97,177, 88, 39,182,111,223, 78,237,218,181, 75, 62,108,216,176,151, 79,158, 60, 73,246,245,245,
+117,217,190,125,187, 20, 0,214,174, 93, 75,246,239,223,223, 3, 37, 67,102, 84, 57,142, 75,106,106,234,183,153,153,153, 55,167,
+ 76,153,178,142,203,229,202, 69, 34,145,213,181,107,215,168, 98, 29, 65,203,175,226,223,244, 68,148, 10, 24,184, 58, 87,138,241,
+227,199, 51,159, 60,121,178, 52, 57, 57,249, 68, 53,154,115,178,179,179,175, 61,127,254,124,181,204,177,133,181,200,229, 43, 89,
+192,220,167, 0, 0, 23, 5, 27,140,210,114, 49, 59, 59, 27,233,233,233,152, 60,121,178,252,229,203,151,115,146,147,147, 47, 87,
+ 19,213,186,146,145,145,145,244,232,209,163,206,108, 54,155, 43, 18,137, 90,222,186,117,139, 42,214,154,208,108, 78, 60, 94,231,
+151,228,211, 82,204,194,253,239,149,152, 58,117, 42,235,197,139, 23, 63,164,164,164,180,175,180, 48, 99, 48,150,151, 55, 89,179,
+103,207,126, 8,160, 33,128,183,170, 70,141, 70, 35, 53, 98,196,136, 40, 0, 77,190,248,226, 11, 75, 66,200,204, 57,115,230,188,
+ 6,176,233,127,125, 45, 73,165,210,101, 19, 38, 76,192,254,253,251,145,149,149,181, 6, 0,114,115,115,127,220,179,103,207,190,
+113,227,198,225,215, 95,127, 93,150,158,158,126, 6, 53,119,213,238, 53,116,232, 80,156, 62,125, 26, 23, 47, 94,252, 6,192,227,
+ 42,214,123,126,237,218,181, 57, 71,143, 30,253,105,216,176, 97,216,182,109, 91, 79, 0,213, 53,144,237,222,163, 71, 15,156, 58,
+117, 10,153,153,153,161,149,173,144,157,157,189,225,216,177, 99,173,123,244,232,129,165, 75,151,118, 7,112,201,140, 93,247,146,
+201,100,219,127,250,233,167,150, 77,155, 54,197,240,225,195,139,117, 58, 93,207, 47,190,248,226,248,222,189,123, 37, 59,119,238,
+252, 96,252,248,241,119, 74,199,124,187,109, 86, 40,139,193, 88,178,106,213,170,177,157, 59,119,198,204,153, 51, 13,103,207,158,
+237, 7,224,220,153, 51,103, 94,206,158, 61,251,228,170, 85,171,152, 43, 87,174, 28, 59, 99,198,140,116,147,201,244,190,204,245,
+247,107,215,174,109, 29, 20, 20,132, 87,175, 94,225,246,237,219,208,233,116,191,222,186,117,235,170,155,155,219,247, 90,173,246,
+184, 72, 36, 26, 45,145, 72,124, 91,180,104,209,229,254,253,251, 66,152,215, 78, 47, 53, 54, 54,214, 66, 38,147,193, 96, 48, 32,
+ 50, 50, 18,206,206,206,208,233,116,136,137,137, 65,211,166, 77,193,225,112,144,154,154,138,114,209,242, 26, 76, 17, 35,242,101,
+156,170,161,165, 68, 4, 24,249,120,240, 52, 9,214, 10, 57,140, 20, 3,106,117, 10, 90,120, 58,130,162, 40,100,103,170, 65, 81,
+ 84,148, 57,154, 70, 98, 10, 75, 80,165, 57, 88, 73,120,104,218, 58,200,234,214,153,244, 93,210,134,237,198,179,152, 20,147,203,
+ 19,111, 26,251,241,199, 10,147,137, 32, 59, 51, 21, 44, 6,227,238,251, 56, 65, 7, 19,144,216,169, 17,255, 65,208,216, 69, 45,
+ 40, 2, 82,164,195,206,109,169,200, 18, 2, 45,214,126,253,181,133,149, 66,129,225,195,135,155, 50,147,147, 47, 20,154, 57,176,
+114, 67, 55, 55,165, 88, 34,193,141, 27, 55,192, 44,105, 99,139,173,128,215,242,217,179,173,108,108,109,241,201,216,177,166,212,
+132,132, 75, 69,128,170, 54,121,109,216,168, 17,187, 76,151, 81,170,155,194,196,244, 47,250,117,224,137, 4, 60, 44,217,248, 27,
+ 18, 51, 10,246,221, 74,193,198,127,104,188, 99,115,181, 17,173,170, 26,159,149, 52,170, 22, 86,107, 86,248,124,254,155,104, 74,
+ 45,222,244,222,185,102, 77,252, 25,154,239,145,185, 0,142, 2,152,155,152,152, 24, 61,118,236, 88,157, 65,167,201,187,185,168,
+225,151,225, 75, 27, 76,186,245,173,221,164, 35,211,101, 95, 22,230,188,206, 91,187,118,173, 62, 49, 49, 49,186,252, 54, 53,104,
+ 39, 0, 56,181, 99,199,142, 13, 7, 15, 30, 68,147, 38, 77,240,248,241, 99,155,130,130, 2,191,168,168, 40, 75, 47, 47, 47,236,
+218,181, 11,251,247,239, 95, 13,224,124,117, 38,171, 12,131,193,112, 65,173, 86,123,196,199,199, 55,182,176,176,208, 91, 88, 88,
+160, 98, 79,196,220, 34, 19, 50,179,115, 96,105,105, 5,169, 84,234,106,134, 57, 63,165, 86,171,221, 77,114,207,142,238, 25,107,
+114,194,150, 56, 33,108,137, 19, 78,205,177,135,157, 5, 23, 89, 89, 89, 72, 79, 79, 71,122,122, 58, 40,138,130, 94,175,247, 54,
+ 67, 51, 38, 37, 37,101, 75, 66, 66,194, 81,165, 82, 9,137, 68, 2, 2, 64,157,173,199,195,149, 94,120,184,210, 11,234,108, 61,
+114,243,242,208,160, 65, 3, 72, 36,146,170,170, 40, 24, 14, 14, 14,189,135, 12, 25, 34, 1,128, 82, 3,213,149, 16, 50,169,146,
+101,162,193, 96,104, 87,182,238,231,159,127,110, 9,160,199,255,248,122, 98, 2,152, 50,110,220,184, 15,248,124, 62,214,175, 95,
+ 31, 3, 96,119, 89, 89,191, 97,195,134,167, 0, 48,125,250,116, 95, 0, 51, 81,197, 72,208,111, 66, 67, 28,142,191,183,183, 55,
+110,221,186, 5, 0,191,213,240,219,135,110,222,188, 9, 55, 55, 55,240,249,252,150, 53,172,235,234,228,228,132,167, 79,159, 2,
+192,131, 42,214,121,240,244,233,211,146,234, 30,138,114, 53, 99,223, 67,130,130,130, 34, 47, 95,190,220,178,109,219,182, 24, 59,
+118,172,246,206,157, 59,189, 1, 92,125,240,224, 65,224,136, 17, 35, 10,220,221,221,113,229,202, 21,175, 17, 35, 70,220,100, 48,
+ 24,139,204,208,252,228,187,239,190,155,219,191,127,127,124,247,221,119,228,192,129, 3,195, 1,156, 43,253,238,236,190,125,251,
+ 70, 45, 94,188,152, 12, 28, 56, 16, 11, 23, 46,156, 11, 96, 82,117, 98, 5, 5, 5, 57, 70,163, 17, 5, 5, 5,102,133,228,205,
+ 93, 95,161, 80,244, 10, 10, 10,194,188,121,243,224,224,224,128,227,199,143, 19, 0, 39, 0, 92,211,106,181, 29, 1,172, 42, 40,
+ 40, 56,114,235,214, 45,116,239,222,157,131,183,167, 24,169,238,247, 35,247,236,217,163,145,201,100,112,113,113, 65,195,134, 13,
+161, 86,171, 17, 23, 23,135,166, 77,155,194,223,223, 31, 6,131, 1, 91,182,108, 41,206,203,203, 51,107, 76, 62,131,182, 96,231,
+249,147,135,115,172, 36, 60, 56,218,200,208,192,193, 18,249,217, 25, 72, 87,171,224,239,237,140, 78,254, 13,144,145,163,197,217,
+ 19,135,179,242,242, 10,119,154, 21,194,215, 20,110,191,112,230,120,142, 92,194,129,135,167, 47, 70,140,157,222,162,133, 95,192,
+249, 86,173,218,157, 93,177,108, 73,179,174,109,188,169,164,140, 98,156, 62,241, 91, 86, 78,110,238,246,247, 81,208, 47, 4,152,
+197, 50,247,171,161, 71,195,182,248,244, 28,183, 37, 58, 9,107, 0, 64,207,100,122,245,238,213, 11, 73, 73, 73, 56,124,240, 96,
+ 74, 33, 16, 97,174,158, 64, 32, 96, 0, 64, 78, 78, 14,120,165,237,238, 12,128,103,159, 62,125,144,158,145,129, 61,187,119,167,
+159, 6,194,107,147,207,190, 0, 87, 40, 40, 9, 8,230,228,228,128, 2,114, 1,128, 98,161,119,171, 38,110, 72,127,157,139,203,
+119,163,243, 27, 20, 97,114,117, 58,127,227,134,240,117,107,163, 5, 32, 99,230,204,153,224,241,120,176,179,179,123, 99,142,202,
+204, 10,151,203,133,157,157, 29, 12, 6, 3,246,237,219, 7, 0, 25,213,190,225, 1,154,126,147,150,154, 52,122, 82,200,102,179,
+223,137,102,233,155,163,102,208,236,109,166, 51, 55, 43,239, 20, 83, 23,205,191, 1,173, 74,199,196,106, 5, 32, 43, 46, 46, 46,
+105,240,160,126, 57,241, 47, 31,169, 11,178, 85, 41,185,153,137, 41,137, 49, 81,234,175,230,204,204, 73, 74, 74, 74, 68,201, 88,
+ 90,173, 84, 42, 85,217, 54,230, 48,115,240,224,193, 63,143, 27, 55,142, 60,124,248, 16, 0, 16, 22, 22,134,143, 63,254,152,140,
+ 26, 53,106, 13,128, 47,235,144,239,130,162,162,162,183,162, 33, 58,163,233, 77,149, 95,110,110, 46, 84, 42, 21,180, 90,173,217,
+142,248,249,217,149,207, 94,199,221,215,251,186,136,224,235, 34,130,151,147, 16,148, 33,255,141,201, 74, 79, 79, 47,123,115, 46,
+174, 69, 62,115, 53, 26,205, 91,249, 44, 95, 53,153,155,155, 11,181, 90, 13,163,209, 88,213,131,204,148,156,156,124,118,255,254,
+253,121, 0,176, 98,197,138,215, 20, 69, 93,164, 40,234,231, 74,150,141, 44, 22,235, 70,217,186, 43, 87,174,124,141, 63, 86,137,
+253,153,244,111,218,180,105,214,220,185,115,215,207,152, 49, 3, 27, 55,110, 68, 74, 74,202,151,248,255,177,120, 76, 25, 25, 25,
+179, 67, 67, 67, 49,102,204, 24,204,159, 63,127,165,159,159, 95, 46,128, 17, 85, 9, 90, 91, 91, 59,178, 88, 44,132,135,135,231,
+ 2,120, 85,195,239,171,195,195,195, 83, 41,138,130,157,157, 93,163,234, 86,180,180,180,108, 44,145, 72,144,156,156, 12,148,190,
+ 49, 87, 66,156, 74,165, 34, 92, 46, 23,246,246,246,110, 53,237,188, 92, 46,159,189,101,203, 22,214,163, 71,143,208,181,107,215,
+164, 43, 87,174,116, 7, 80,214, 37, 61, 60, 44, 44,172, 67, 96, 96,224,179,243,231,207,227,135, 31,126,160,154, 55,111, 62,169,
+ 38, 77, 23, 23,151,137,159,124,242, 9,214,173, 91,135, 77,155, 54, 77, 2,112,176,194, 42,123, 67, 67, 67,167,111,218,180, 9,
+ 99,199,142,133,171,171,235,136,234,244,226,227,227,231,116,238,220, 57,236,249,243,231,102,205,120, 96,230,250,129, 1, 1, 1,
+141,139,138,138,176,125,251,246, 87,141, 27, 55,190,119,240,224,193,153,248,227, 3,251,200,225,195,135, 49,114,228, 72, 52,111,
+222,124, 59,128, 97,230,220,150, 79,158, 60, 73,188,116,233,146,137,195,225,192,197,197, 5,193,193,193, 24, 62,124, 56,154, 53,
+107, 6,157, 78,135,195,135, 15,155,162,162,162,146,180, 90,173, 89, 99, 41,101, 62,255,253,120,108,236,179, 27,225,119,174,234,
+ 89, 76, 6,156,237, 44, 49,160, 91, 11,252,231,195,118,240,247,114, 64,124, 90, 17, 46, 93, 58,175,143,141,125,117,203,156, 30,
+135,101,154,209,143, 35,110, 62, 10,191,110, 96,179, 40,120,121,186, 99,222, 87,179,229,139, 23,204,177,112,111,228,140,136,152,
+ 28,156, 63,119, 90,175, 74, 74,188,252,190,122, 28, 94, 1, 56, 98, 30, 37, 98, 50, 24, 48, 50,120, 5,204,210,142, 52, 77,124,
+124, 60,148,182,182, 56,121,242, 36, 24,181,232, 17,122, 5,224,136,197, 37,181,224,249,249,249, 40,211,107,236,233,233,233,236,
+226,130, 83, 39, 79,130,105, 50, 61,233, 84,203, 1, 70,159,150, 84, 67,191,209,165,128,226,201, 78,144, 52,118,178,241,148,203,
+ 68,184, 19,241, 2, 26, 61,185,187, 59, 11,239,117, 60,178, 63,145,241,168, 99,213,225,138,141, 27, 55,182,218,178,101, 75,247,
+153, 51,103,138, 71,143, 30, 13, 62,159,143,194,194, 66, 56, 58, 58,194,104, 52,226,204,153, 51,184,127,255,126,190,201,100, 58,
+143, 63, 14, 27,208, 13,229,122,105,156,125, 5, 65,137,223, 42,108,117,244,163,143,222,137, 38, 0,136, 95,152,164,153, 13,180,
+187,214, 30,188, 62,112,207,217,112,234,211, 97,157, 24,254,158, 78, 0, 0,165, 82, 9,169, 84, 90,107,205,119,192,159,174, 89,
+190, 90, 87,173, 86, 63, 85,171,213,105,227,198,141,243, 42,107,248,206,227,241,138, 75, 35, 89, 89,149,109, 99, 70, 62,117, 0,
+ 38,111,217,178,229, 88, 78, 78,206,217, 47,190,248, 2,139, 23, 47,198,241,227,199, 59, 0,184, 81,199,125, 55,102,101,101,101,
+223,189,123, 87,233,230,237,135,134, 54,108,116,252,230, 57, 8, 33,176, 18, 18,228,101,191,198,131, 7,225,200,203,203,187, 83,
+155,124,234,116,186,236,180,180, 52,133,141,141, 13, 94,191,126,141,140,140,140, 55, 38, 43, 43, 43, 11,175, 95,191, 38, 20,245,
+135, 49, 91,170,211, 44, 72, 75, 75, 43,140,142,142,230, 42,157,220,208,200,134,131,128,175,158, 2,132,192,217,146,129,188,220,
+108,220,186,117, 11, 57, 57, 57,191, 87,165,105, 50,153,102,141, 24, 49,130, 9, 96,212, 23, 95,124, 97, 9,160,249,236,217,179,
+207,163, 66,207, 66, 22,139,245,227,174, 93,187,154,148, 85, 49,206,153, 51,103, 53,128, 45,255,171,107,201,202,202,106,214,201,
+147, 39, 37, 58,157, 14,107,215,174,197,234,213,171,183,226,143, 3, 85,158, 92,191,126,125, 40,131,193,152, 50,117,234, 84, 76,
+152, 48, 65,248,193, 7, 31,204, 76, 73, 73,217, 93,153,102,114,114,242, 60,127,127,255,249,105,105,105, 75,204, 50,203,207,159,
+143,247,247,247,159,151,150,150,182,188,186,115, 36, 18,137, 68, 70,163, 17,177,177,177, 89, 64,149,237, 59,138, 99, 99, 99,147,
+141, 70,163,163, 80, 40,180,172,233,250,204,202,202, 90,242,193, 7, 31,124,155,154,154,122, 14,192,162, 74, 12,249,195,148,148,
+ 20,223, 25, 51,102, 76, 91,182,108,217, 64,181, 90,189,175, 38,205,248,248,248, 37,129,129,129,223, 60,123,246,108, 7,170,174,
+ 2, 94,191,112,225, 66,221,174, 93,187, 38,197,198,198, 46,173, 65,243, 68, 70, 70,198,137, 90,156,223,170,214,127,163,201,100,
+ 50,103, 47, 91,182,140,177,113,227, 70, 16, 66, 86, 26,141,198,170,242, 25,113,228,200,145,157,237,218,181, 27,125,240,224, 65,
+190,175,175,239, 4,141, 70,179,183,166,235,179,176,176,240,240,193,131, 7, 7, 70, 68, 68, 56,142, 30, 61,154,239,225,225, 1,
+157, 78,135,148,148, 20,108,220,184,177, 56, 42, 42, 42, 41, 59, 59,251,112,109,202, 16,131, 54,119,216,205, 75, 71,247,198, 61,
+143,106,211,185,103,136, 92,171,115, 4, 47,147,137,236, 76, 53,206,156, 56,156, 21, 27,251,234, 86, 97, 97,246,176,218,104,234,
+ 52, 57, 67,111, 93, 62,182, 47, 41, 54,186,117,199,192,222,242, 98,173, 11,120, 28, 6, 50, 83,147,113,230,228,209,215,177,177,
+ 49,215,138,245,154,143,223, 87, 57,207,116,197, 34,166,250,254,184,137,125, 91, 64, 32,119,124,192, 6,214,182, 3, 4, 10,165,
+146, 83,122,239, 64, 92,210,230,209, 44,205, 84,128,235, 86, 90, 75, 85, 88, 88, 8, 54,160, 29, 3,176,173,173,173, 5, 0,240,
+236,217, 51, 8, 75,106, 53,106,149,207,124, 64, 36, 44,167,203, 0, 10, 51, 89,112,104, 44, 21, 81, 0,144,164,206,132, 86, 95,
+237,115,227,239,206,230,114,134,107,115, 93, 4, 56, 0,186,137,197,226,197,243,231,207, 95,121,231,206,157,149,193,193,193, 43,
+121, 60,222,226,210,131,205,169,230, 68,252,207, 52, 91,218,195, 50,176, 17,117, 53,168, 49,101,154,216, 65,110,252, 56, 64,164,
+237,210,165, 75,104, 61,243, 89,159,155,229,207,212, 60,170,215,235, 9, 74,170,237,142,162,234, 42,193,185,229,190, 87, 39, 36,
+ 36,144,210,191,107,147, 79,197,144, 33, 67, 76,121,121,121,100,240,224,193, 4, 53, 79,225, 83,173, 38,143,199, 11,236,216,177,
+163, 62, 53,253, 53,121, 26,147, 76,110,135, 61, 38,103, 47,221, 36,251, 14,159, 36,235, 66, 55,145,102,205,154,105, 1,184,212,
+ 70,147,197, 98,117, 9, 12, 12,204, 76, 77, 77, 37,209,209,209,228,234,213,171,228,208,161, 67,100,211,166, 77,228,231,159,127,
+ 38, 78, 78, 78,169, 0,148,181,209, 20, 8, 4, 33,189,122,245,210,103,231, 22,146,216,228, 76, 18, 25, 29, 75,110,220,141, 36,
+103, 46,221, 32,187,247, 30, 36, 62, 62, 62,197,102,104, 50,153, 76,230,186,125,251,246,229, 18, 66, 72, 72, 72, 72, 18,222, 30,
+ 72,181,225,172, 89,179,210, 8, 33,100,249,242,229,153,168,188, 33,252,159,125, 45,245,116,112,112,120,202,225,112, 78, 2, 24,
+ 85,195,118, 67, 89, 44,214,113, 91, 91,219,123, 0, 6,188,135,251, 40,216,198,198,230, 54,128,154,102, 56, 40, 91,175,255, 63,
+228,126,255, 51, 52,187,176, 88,172,171, 64,245,147, 8,151, 43,175,191,103, 50,153,167, 0,116,173,101, 62,221, 21, 10,197, 96,
+185, 92,254,169, 92, 46,255,212,198,198,102, 48,151,203,117,175,207,190, 91,185,119,235,235,236,215,239,136, 83,243, 62,241,206,
+ 45,130,227, 93,253, 67,142, 88,185,119,235, 91, 95, 77, 23,255,144,163,206, 45,130, 19,156, 91,244,141,107,216, 50,228,136,194,
+179, 91,175,247,121,142, 70, 57,192,190,123, 67, 24,200,213,111, 8,185,250, 13,233,214, 16,166, 54, 22,240,105, 5, 72,122,116,
+235,182,138, 24,141,171, 6,246,239,191,202, 13,176, 34, 0,179,226, 82,153,166, 31, 32,125,179,109, 72,200,170, 70,128,162, 59,
+ 32,236,212,161,195, 74, 98, 52,174, 26, 49,116,232, 42,103,192,182, 50,189,170, 52, 9,192,116, 0,236,203,235, 42,128,198, 31,
+186,194,119,110, 95, 87, 66,174,126, 67, 22,126,228, 65,252,149, 24, 85,131,102, 85,145,162,191,117, 68,171,182,136, 74, 11,215,
+165,165,159,162,119,112, 17,190,115,205,214,118,240,232,214,152,138,238,237,201,122,141,146, 46,201,162,127, 96, 33,185, 67,171,
+213,146,226,226, 98, 82, 88, 88, 72,242,243,243, 43, 26,168, 55,134, 76,165, 82,145,164,164, 36,146,144,144, 64,226,226,226, 8,
+254,191,237,141,217,249,148, 74,165, 91, 62,250,232, 35, 35,155,205, 94,247, 46,246,221,210,210,114,105, 64, 64,128,238,167,159,
+126, 34, 71,142, 28, 33,191,252,242, 11,153, 58,117, 42,105,210,164,137,198,194,194, 98, 88, 93, 52,109,109,109,231,121,122,122,
+102,110,221,186,149,236,222,189,155,172, 89,179,134,124,253,245,215, 70, 71, 71, 71,181, 68, 34,233, 81, 23, 77, 27, 27,155,205,
+237,219,183,215,109,222,188,153,156, 63,127,158,236,217,179,135,204,154, 53,139,120,121,121,105, 68, 34,209, 32, 51, 53,153, 44,
+ 22,107,213,196,137, 19,213,246,246,246, 39, 43,124, 39,244,241,241,185, 55, 98,196, 8, 21,128, 57,255,160,235,147,214,164, 53,
+105,205, 63,193,104, 13,183,135, 3, 1,152, 66, 14,103,104,167, 14, 29, 86,114,128,161,181, 53, 69,124, 38,243,195,118, 1, 1,
+ 43, 57,192,176,178,117,249, 76,230,135,157, 58,116, 88,201,102, 50, 71, 86,165, 87,157, 38, 1,152, 28, 22,107, 78,187, 54,109,
+ 86,177,128,175,202,210,186, 52,164,158,204,234,233, 68, 58,184, 80, 47, 70,218, 64,248, 15, 54, 90,239, 28,214,159,112, 17,254,
+ 93, 52,255, 42, 55,181, 91,169, 97, 58, 90,139,136,214, 81,148,204,162,238, 86,199,124, 10,222,241,190, 55, 85, 40, 20,167,221,
+220,220,210, 27, 52,104,160,146,203,229,123, 1, 56,214, 83,211,215,214,214,246, 87,165, 82,249,220,206,206, 46, 66,161, 80,252,
+136,146, 81,231,235,172,201,102,179, 3,148, 74,229,239,174,174,174,217, 46, 46, 46,169, 10,133, 98, 95, 37,145, 44,115, 52,237,
+ 80,121,161,194, 41,253,142,126,232,208,154,180, 38,173,249,150,129, 9,106,132,101,221, 27,194,208,189, 33,140, 65,174,248,177,
+188, 65, 9, 6, 4,117, 53, 69, 31, 3,188,138,235,215,164, 87,147, 38, 1,152,109, 1,113,197,109,122, 59,194,199, 76,205,191,
+123, 68,171,172,156,175,221,240, 14, 85, 96,248, 19, 50,249,119,209,252,171,240, 2,213, 52, 70, 46,199,210,119,248,155, 69,239,
+120, 31, 34, 51, 50, 50,122,101,100,188,211,190, 9,143,212,106,245,168,119, 41,168,215,235,239,164,166,166,118,126, 7, 82, 85,
+117,189,214,193,204,110,217, 52, 52, 52,255, 30, 40,192,136, 87,248,178,155, 59,214,178,140, 96,156,137, 65,114,133, 46,121, 69,
+ 84, 93, 52, 75, 48,238,168,164,140,167,234,154,207,255, 39,255, 15, 26, 73,120, 76,253,123, 78, 91, 10, 74,218,104,213,219,104,
+209,208,208,208,208,208,208,252, 15,184,240,156,126, 17,251, 27,112, 18,111, 71,223, 78,150, 51,162, 85,134, 62,107,211,147,162,
+ 46,225,211, 11,180, 38,173, 73,107,210,154,180, 38,173, 73,107,254,235, 52,203,168,106,238,212,167, 21,254,175, 83, 47,190,127,
+ 11,116, 61, 59,173, 73,107,210,154,180, 38,173, 73,107,210,154,255,116,234, 60,142, 22, 13, 13, 13, 13, 13, 13, 13, 13, 77,245,
+ 84, 25,117,163,141, 22, 13, 13, 13, 13, 13, 13, 13, 77,253,176, 67,201, 20, 85, 39,241,255, 83, 85,109, 6,106,158,130,231, 45,
+150, 45, 91,198,112,115,115, 19,115,185,220, 38,175, 94,189, 98, 76,158, 60,185,222, 29, 9, 86,254,184,142,225,226,226, 34, 6,
+208, 36, 51, 43,143,241,201,127,190,160,232,243, 69, 67, 67, 67, 67, 67, 67,243, 55,162, 79,169,177, 42,251,124, 19,225,170,149,
+209, 90,180,104, 17, 18, 18, 18, 68, 0,134,248,250,250,114, 55,108,216, 64, 14, 28, 56, 80, 47, 99,244,213,156, 89,136,143,143,
+ 23, 1, 24, 98,163,176,224,110,219,178,130, 28, 60,126,253,157,155, 45,133, 66, 97,245,191,220,142,134,134,134,134,134,134,230,
+ 95,197,248,114,159,227,235,100,180, 88, 44, 22,147,203,229, 54, 98, 48, 24,189,248,124,126, 75, 0, 40,157,146,165,206,176, 88,
+ 44, 38,151,199,107,196,100, 50,123,241,120, 37,154, 31,245,109, 95, 95,205,174, 34,145, 40, 81, 40, 20,222, 7, 32,144, 72, 36,
+225, 58,157,238,177, 68, 34,185, 89, 27, 29,137, 68,114,179,116,187,112, 0, 2,161, 80,120, 95, 36, 18, 37,178, 88,172,174,244,
+245, 68, 67, 67, 67, 67, 67, 67, 83,202,230, 74,150, 63,114,226,196,137, 42, 13, 14,151,203,101,248,250,250,182,119,113,113,185,
+225,237,237,173,117,116,116, 60, 36, 20, 10, 69,245,204, 24,195,205,195,171,189,189,157,242, 70,139, 70,118, 90, 27, 27,155, 67,
+108, 54,187, 62,154, 76,137, 68,178, 38, 40, 40, 40,231,198,141, 27, 68, 42,149,166, 2,176,176,182,182, 86, 17, 66,136,173,173,
+173,169, 54, 98,182,182,182, 38, 66, 8,177,182,182, 86, 1,176,144, 74,165,169, 55,110,220, 32, 65, 65, 65, 57, 18,137,100, 13,
+106, 30,209,150,134,134,134,134,134,134,166, 22, 84,231, 69,254,194,148, 69,177,236,234,188,115, 92, 46,215, 79,161, 80, 68,125,
+246,217,103,198,205,155, 55, 19, 23, 23,151,187, 54, 54, 54,109, 20, 10,197, 91, 13,234,199,140, 25, 83,155,106, 63, 63,137, 84,
+ 22,181, 99, 70, 79, 99,209,182, 16,226, 96,103,115,215,194,194,162,141, 84, 42,125, 75,115,196, 39, 19,204,209,180,151,201,100,
+ 17,203,150, 45, 43,206,206,206, 38,132, 16, 34,147,201, 82, 1,200,149, 74,165, 42, 38, 38,134, 40, 20, 10, 2,243,163,120, 12,
+133, 66, 65, 98, 98, 98,136, 82,169, 84, 1,144,203,100,178, 84, 66, 8,201,206,206, 38,203,150, 45, 43,150,201,100, 17, 0,236,
+233,219,130,134,134,134,134,134,230, 95,109,180, 42, 26, 46,243,170, 14, 91,182,108,201, 83, 42,149,109, 36, 18, 73,127,177, 88,
+ 28,218,175, 95, 63,223,129, 3, 7, 50, 52, 26,141,209,215,215,215,222,213,213,117,154, 92, 46, 31,197,231,243,155,113,185,220,
+145, 82,169,212,110,239,222,189,110,213,105, 54,109,254, 1,207,194, 66,222,134,203,229,245, 23,139, 37,161, 19, 63,236,226, 59,
+106,230, 32, 6, 71, 27,103,236,210,204,217,190, 73, 35,187,105,182,114,209, 40, 22,147,209,140,162,168,145,124, 62,223,110,247,
+182, 77,110, 53,236, 88, 35,123,123,251,240,189,123,247, 54, 25, 50,100, 8, 47, 58, 58, 26, 0, 96, 52, 26,185, 0,244, 76, 38,
+ 19, 60, 30, 15, 58,157, 46, 11,128,185, 39,144,232,116,186, 44, 30,143, 7, 38,147, 9, 0,250, 82, 61, 68, 71, 71, 99,200,144,
+ 33,188,189,123,247, 54,177,183,183, 15, 7,208,136,190, 53,104,104,104,104,104,104,254,181,148,153,171,147,168, 80,117,200, 42,
+115,143,193,193,193,111, 69,141,184, 92,238,134,103,207,158,181,179,180,180,108,196,102,179,141, 67,135, 14,229,141, 24, 49, 2,
+233,233,233,166,252,252,124,166,159,159,159,242,222,189,123,189, 12, 6, 67, 7, 11, 11,139,194,236,236,108,133, 70,163,121, 1,
+ 96, 90, 53, 25,217,240,252,105, 84, 59, 43,185,101, 35, 46,155,105,156, 58,118, 4,239,171, 57, 61, 65,105,194, 76,198,180, 76,
+230,247,254, 22,202, 31,111, 22,244,122,166, 51,118, 40,144,241, 11,213, 57,154, 26, 53, 21, 10,133, 63,135,195,185,127,250,244,
+105, 8,133, 66,228,228,228,128,203,229, 2, 0,242,243,243,101, 0, 88, 20, 69,129,203,229, 34, 55, 55, 87, 94,155,163,150,155,
+155, 43,231,114,185,160, 40, 10, 0, 88,165,122,224,114,185,200,201,201,129,155,155, 27,117,250,244,105,155, 94,189,122,189,212,
+233,116, 31,100,100,100,132,209,215, 26, 13, 13, 13, 13, 13, 77,237,169,204,139,252,141,168,113, 28,173,206,165,161,186,242, 19,
+231,238,180,182,182,182, 21,139,197,222,227,199,143,103, 40, 20, 10,220,191,127,223, 84, 80, 80,192, 96,179,217, 96,179,217,204,
+ 46, 93,186,136, 13, 6,131,240,212,169, 83,212,203,151, 47,211,245,122,253,247,153,153,153,247,170,201,200,206,198, 22, 60, 91,
+129, 5,215,251,248, 23, 29, 25,214,110,153,192,217,133, 38,146,159,198, 96,153, 8, 20, 34, 19,115, 85, 7, 74,172,150,185, 10,
+167,238, 75,167,174,189,204, 78,215,235,245,223,231,229,229, 85,167,153, 12, 0,165,121,130, 84, 42,133,209, 88,126,126, 75, 16,
+ 6,131, 1, 30,143, 87,167, 35,199,227,241,192, 96, 48,128,114,145, 48,153, 76, 6, 38,147, 9, 6,131, 1, 54,155,253, 86, 62,
+104,104,104,104,104,104,104,234, 68,101, 94,228,239, 66,249,113,180,204,155,155, 82,169, 84, 82, 82,169,212,174,121,243,230,223,
+ 6, 5, 5,197, 12, 24, 48,160,240,167,159,126, 34,171, 87,175, 38,171, 86,173, 34, 91,183,110, 53, 94,190,124, 89,255,159,255,
+252,167,216,221,221,253, 69,104,104,168, 55, 0,244,238,221,187,202,234, 72, 11,185, 37, 37,230,178,236,124,188,155,126, 59,188,
+115,147,152,111,250,123, 20,234,118,248, 17,211,124, 39, 98, 92,231, 74,140, 7,187, 26,201,179, 21,250, 37,227,186, 22, 55,112,
+105,240,226,231,173,251,189, 1,160, 91, 80,239,106,171, 56, 21, 10, 69, 75, 71, 71,199,212,115,231,206,153,178,178,178, 72,102,
+102,102, 89, 27,173,108, 0, 50, 23, 23, 23,149,193, 96, 32,114,185,252,117,109,142,154, 92, 46,127,109, 48, 24,136,139,139,139,
+170,196, 95,201,178, 9, 33, 36, 51, 51,147,100,101,101,145,115,231,206,153, 28, 29, 29, 83, 21, 10, 69, 75,250,254,160,161,161,
+161,161,161,249,215, 50,190,194,103,205,180,107,215,142,146, 74,165,140,166, 77,155,138,237,237,237, 91,219,219,219,223,249,241,
+199, 31,201,234,213,171, 13, 27, 55,110, 36,191,254,250,171,225,227,143, 63,206, 21,137, 68, 39,185, 92,174, 28, 0, 92, 93, 93,
+171, 13,249,181,108,221,134, 18,240,121, 12, 79, 79, 31,177,194,202,170,181,181,149,229, 29,221,234, 38,132, 44,116, 48,144, 45,
+ 45, 8, 57,216,211,176, 98,112,171, 92, 54,155,115, 18,128, 28, 0, 28,237,237,204, 13, 35,218,219,216,216, 68, 44, 92,184,176,
+ 64,167,211,145,210, 94,134,169, 0, 44, 92, 92, 92, 84,132, 16,226,232,232,152, 8, 64, 97,166,158,194,209,209, 49,145, 16, 82,
+102,180, 44,108,109,109, 83, 9, 33, 68,167,211,145,133, 11, 23, 22,216,216,216,208,141,225,105,104,104,104,104,104,104,170,156,
+235,176,202, 72,209,141, 27, 55, 72,110,110,174, 41, 57, 57,217,152,159,159, 47,245,243,243,147, 51,153, 76, 40,149, 74, 38,147,
+201, 52, 21, 20, 20, 48, 21, 10,133,138,205,102,239,214,106,181, 89,253,251,247,167, 98, 99, 99,171,109,104,126,239,246, 45, 82,
+ 84,172, 49, 37, 37, 37, 26, 11,243,115,165,163,154, 89,202, 89, 6, 29, 76,126,237,152,185, 2,119,147,169, 40,139,233,101,199,
+ 83,113, 56,236,221, 0,178, 6, 4,247,161,146, 84, 41,230, 54, 94, 87,165,165,165,249,109,216,176, 97, 75,199,142, 29,179, 10,
+ 11, 11,203,218, 86, 85, 28,130,193,194, 76,189,138,235, 49, 41,138, 66, 97, 97, 33, 58,118,236,152,181, 97,195,134, 45,105,105,
+105,126, 0, 84,244,245, 69, 67, 67, 67, 67, 67,243,175,166,202,113,180,106, 28,234,160,176,176, 80,206,225,112,186,181,106,213,
+170, 65, 65, 65,129,105,209,162, 69,137, 63,253,244,211,174, 23, 47, 94,232, 45, 44, 44, 26, 9, 4,130, 79, 81, 76,136,102, 0,
+ 0, 32, 0, 73, 68, 65, 84,135, 12, 25,162, 56,114,228, 8,233,208,161, 67,197,232, 83,165,179,123, 23, 21,229,203,121, 28,118,
+183, 79, 3, 36, 13, 18,117,114,147,247,167,119, 19, 59,205,191,185,235,183, 71, 44,125, 83,203,162, 70,150, 92,234,211, 33, 67,
+ 6, 43,126, 59,113,146,180,105,211,218, 44,205, 82,140,105,105,105,159,222,191,127,127,112,195,134, 13,147,244,122,125, 18,128,
+204,162,162,162, 84,123,123,251, 52,157, 78,151, 4, 64, 87,201,118,149,105,234,116, 58, 93,146,189,189,125, 90, 81, 81, 81, 42,
+128, 76,189, 94,159,212,176, 97,195,164,251,247,239, 15, 78, 75, 75,251, 20,128,177,154,188,208,179,186,211,154,180, 38,173, 73,
+107,210,154,180,230,191,135, 63, 68,179, 0, 51, 38,149,230,241,120, 29,157,157,157,219, 63,122,244,200,120,235,214,173, 28, 6,
+131,241,115,239,222,189, 15, 29, 62,124, 56,192,210,210,210,198,201,201, 73,121,241,226,197, 64, 0, 7,174, 93,187,102, 86,244,
+ 73,192,227,116,108,225, 40,107,191,249, 33, 49,110,187,255, 60,199,200,228,253,220,101,208,160, 67,211,119,237, 9,176, 87, 72,
+108, 90,216, 73,149,167, 78,157, 9, 4,112,224,214,173,219,181, 30, 79,195, 96, 48, 92, 76, 75, 75,115, 42,251, 63, 61, 61,221,
+ 79,161, 80,120,163, 36,250,148, 99,166, 76,188,201,100,234,109, 50,153,236, 51, 50, 50,158, 0, 64, 70, 70,198, 7,244,117, 68,
+ 67, 67, 67, 67, 67, 67, 83,137,201,218, 92,217,255,213, 70,180,184, 92,174, 3,147,201,244, 73, 74, 74,138, 63,117,234,212,163,
+150, 45, 91,246,138,143,143, 95, 70, 8,137, 19, 10,133,227, 19, 19, 19,159, 39, 38, 38,106,139,138,138, 38,214, 34, 51, 14, 96,
+112,124,238,171,138,226,127,184,248,248, 81,211, 54, 61,122,169,213,170,101, 70, 66,226,184, 66,233,248,103, 9,233,207,111,167,
+105,180,197,197,181,210,172,145,140,140,140, 39, 25, 25, 25, 57,181,220, 38,167,204,100,209,208,208,208,208,208,208,208,212,150,
+154, 34, 90, 58,163,209,184, 66,163,209,200,127,251,237,183,228,160,160, 32, 13, 0,108,216,176,193, 52,118,236,216,235,175, 94,
+189,234,250,228,201,147, 94,182,182,182,151, 0, 80, 49, 49, 49,230, 68,159,116, 38,147,113,133, 86,171,145, 95,188, 28,150,220,
+177,125, 83, 13, 0,108, 92,191,214, 52,116,252,140,235,175,162, 31,117,125, 22, 21,222,203,214,214,246,146,209,192,162, 82,212,
+113,132, 62, 77, 52, 52, 52, 52, 52, 52, 52,127, 97, 54,227,237, 42,195,205,102, 25, 45,173, 86,155,174,213,106, 1, 32, 43, 40,
+ 40,232,173,239,182,110,221, 74, 0, 20, 0, 56,152,153,153, 89,155,204,164, 23, 21, 21, 1, 64, 86,199,246, 77,223,250, 98,223,
+230,159,222,104,230,231,229,210,167,141,134,134,134,134,134,134,230,239,100,182,254, 0,131, 62, 46, 52, 52, 52, 52, 52, 52, 52,
+ 52,245, 98,124, 85,255, 83,168,186,231,192,133, 90,252, 64, 93,122, 31, 92,160, 53,105, 77, 90,147,214,164, 53,105, 77, 90,243,
+ 95,167, 89,147,246, 5,252,253,168,178, 49,252,159, 13,221,245,149,214,164, 53,105, 77, 90,147,214,164, 53,105,205,127, 58,118,
+120,123,120, 7,187,178, 47, 88,244,177,161,161,249,123, 67, 14,130,137, 44, 79, 87, 16, 98, 15, 38, 55, 5, 41,145,175,168,111,
+ 97,170,183,102,170,143, 11, 4,122, 37, 12,252,116,164, 70,196,212, 87,147,134,134,230,159,135,109,219,201, 3, 40, 6,243,103,
+138,152, 80,148, 26,205,227, 20,197, 9,211, 82,226,255,141,222, 34, 5, 85, 68,176,104,163, 69, 67,243,119, 39,221,203, 3, 44,
+ 44, 5, 3,118, 32,186,151,176,246, 89, 10, 60,142,170,183, 38,199,180, 8, 70,134, 35,136,238, 25,108, 60,151, 1, 79, 31,211,
+ 7,251,159,199,180,169,147,200,147,168, 59, 72, 72, 80,161, 81, 99, 59,120,120,181,197, 79,107, 67, 41,250,200,208,152,247, 86,
+ 70,109,238,214,119,132,165, 64, 40, 1, 0,152, 12,122,108,157,217,226,188,193, 96,216, 9,224, 8,128,162,127,251, 33,250,159,
+ 55,134,103,179,217,169, 0, 76,124, 62,255, 48,202,133,214,104,104,254, 4,236, 74,175, 51, 83,233,117, 87, 27,196, 44, 22,107,
+190, 80, 40,188,204,227,241,210,120, 60, 94,154, 72, 36,186,204, 98,177,230, 3, 16,255,101,202,184, 95,155, 8,193, 48,246,210,
+234, 77, 14,103, 34,179,109, 10, 53, 70, 15, 48, 12,189,201, 86,119,113,189, 52, 89, 84, 80,177,206,228,188,251,110,161,178, 64,
+107,240, 6, 65,189, 52,203, 97,193,225,112,206,192,252, 57, 71,105,254,100,226, 99,162,112,234,196, 42, 44,250,110, 52,182,111,
+158,136,167, 79,110,215, 75,207, 27,248,224, 3, 22,235,115, 47,160, 11, 74,218, 1,211,252,147,161,200,248, 11,199,119,167, 31,
+223,187, 62,125,255,170,137,228,232,210, 96,172, 93,187,182,219,232,209,163,119, 59, 59, 59,167, 3,248,136, 54, 90,255, 99,244,
+122,189, 77, 70, 70, 6,181,115,231,206,126, 50,153,236, 37,139,197,154, 11,128,243,111, 57,224, 98,177,248,166, 84, 42, 77,149,
+201,100,169, 82,169, 52,188,166,244,127, 40, 30,214,214,214,241,150,150,150,207,202, 39, 90, 55, 27,208,214,173,221,168, 5, 86,
+ 62, 33,157,234,169,207, 97,177, 88,115,101, 50,217,203,157, 59,119,246, 75, 78, 78,166,244,122,189, 77, 45,182,239, 40,151,203,
+159,220,185,115,231,155,140,140,140, 78,137,183,183, 90,171,239,108,178,142,255,125, 85,231,251,167,214,125, 99, 97, 33,123, 12,
+160,227, 95,226, 72, 22,155,148, 96, 48, 3, 31,165, 20, 10, 83,114,245,202,176,184, 66, 9,192,236, 12,109, 61, 94, 98,114, 76,
+ 74,128,116,121,152, 84, 36,186,249,218, 90,121,237,149, 70, 10, 6, 35, 16,197,148,109,189, 11, 28, 6, 99,146,201,100,234,206,
+225,112, 62,165,159, 80,127, 13,120, 60, 14, 64, 8,196, 34, 62, 0, 2, 70, 61,173, 17,151,193,104,119,179, 95,191, 69,115,154,
+ 53,155,230, 5,244,173,194,108, 81, 0,166,123,121,121,157, 6, 48,244, 29,238,206, 15,158,158,158,201, 0,102,188,171,114,201,
+223,223,191,109, 96, 96,224,130, 22, 45, 90,116,122, 87,154,255, 36,212, 55, 55,252,150,114,125,157,141,234, 70,168, 77,118,204,
+213,233,118, 74,185, 41, 38, 38, 6,125,250,244,193,250,245,235,133,190,190,190,187, 0,216,255, 11,110, 37,191,178, 23,124, 84,
+104,163,101,182,209,250,208, 21,237,134, 53,196,149,193,174,200, 27,210, 16,249, 35, 27,226,250, 32, 87,116,169, 75,110,172,172,
+172,208,177, 99, 71,102,114,114,178, 96,214,172, 89, 11,248,124,126, 44,128, 30,117,209, 18, 8, 4,247,133, 66, 97, 34,139,197,
+122, 43, 47, 66,161,240,190, 72, 36, 74,100,177, 88, 93,203,167, 75, 36,146,155, 82,169, 52, 85, 34,145,132, 87, 97,132,238, 75,
+165,210, 84,177, 88,124,191,124, 58,139,197,234, 42, 22,139,147, 36, 18, 73,197,244, 46, 18,137, 36,177, 98,122, 85,176,217,108,
+199,196,196, 68,155,164,164, 36, 27, 46,151,171, 44,159,158,144,144, 96,147,152,152,248, 86,122,109, 96,177, 88, 93, 68, 34, 81,
+162, 80, 40,188, 95, 89,122,197,125,170,138,114,199,174,139, 57,233,181, 45,120,130,130,130,174,167,164,164, 56, 91, 88, 88,188,
+ 53,113,183,165,204,162,199,175, 91, 67,103,134,244, 14,154,100,237,221,191,105, 29,245,123,240,249,252,216, 89,179,102, 45, 72,
+ 78, 78, 22,180,105,211,134,201, 96,212,234,125,162, 91, 72, 72,200,209,212,212, 84,135,230,205,155, 51, 13, 6, 3, 30, 29,155,
+ 15, 97,196,167,224,199,110,132,147, 32,157,245,242,252, 50,199,160,206, 31, 28,197,123,110, 12, 74, 14,122,115, 64,153, 58,154,
+ 8,177,126,146, 92,108,221,167,223, 71,172, 7,137, 69,214,122,163,209, 18, 96,118, 38,219, 93,120,117,210,100,233, 59,152, 8,
+ 81, 94,140, 99, 91, 7, 14,158,198,188, 20,199,178,214, 27,141, 86, 96,160, 83, 93, 52,203, 95,254, 76, 38,115,230,170, 85,171,
+ 24, 0,166, 2,224,254,155, 12, 77, 43,123, 56,116,105,204,188,235,103,135,118,239, 80,214,183,244,126,247,168,175,208,150,237,
+167, 49,118,194,102,184,123,181,174,151,142,214,100,122,186, 47, 38,230,236,200,198,141,131,231, 52,107, 54,166, 18,179, 69, 1,
+152,179,108,217,178, 81,143, 30, 61,178,110,216,176,225,132,119,244,210,191,102,217,178,101,179, 31, 61,122,100,239,234,234,186,
+176,150,154, 85,150, 75,114,185,188,199,150, 45, 91,102,246,233,211,103,146,191,191,127,211,119,161,249, 15,102,253,195,135, 15,
+157, 87,173, 90,245,229,216,177, 99,115, 1,160,107,215,174, 28, 0,109,234, 93,222, 17,194, 37,132, 4, 18, 66,250, 16, 66,186,
+ 18, 66, 90,149,254,221,178,116,233, 67, 8,233, 86,225,179,101,233,182,101,223, 7, 84,161,209,167,226,118,229,182,169,248,255,
+ 91,127, 87, 98,180,250,160,164,173, 86,159,183,118,224,196,137, 19,164,252,103, 69,134,184,226,219,105,109, 29, 10,159, 28,223,
+ 67,242, 19, 99, 72, 86,244, 3,242, 96,243, 18, 50,173,165,117,225,240,134,248,161,246,199,139,144, 27, 55,110,144, 71,143, 30,
+145,252,252,124,242,252,249,115, 18, 16, 16, 80, 36, 20, 10, 47, 2,112,173,141,152, 68, 34, 73,189,120,241, 34, 9, 10, 10,202,
+ 17,139,197, 43,203,110, 46,169, 84,154,122,227,198, 13, 18, 20, 20,148, 35,145, 72,214, 0, 96, 2,192,160, 65,131,210, 8, 33,
+196,218,218, 90, 85,153, 94, 72, 72, 72, 22, 33,132,200,100,178,178,170, 38,166, 68, 34, 89, 51,101,202,148,252,123,247,238, 17,
+185, 92, 94,150,206,144, 74,165, 43,167, 78,157,154, 31, 22, 22, 86, 62,189, 90, 44, 45, 45, 19,141, 70, 35, 57,126,252, 56,177,
+177,177, 81,149,187,153, 19,141, 70, 35, 57,122,244,104,149,121,171, 46, 80, 32, 22,139, 87,140, 28, 57, 50, 47, 46, 46,142, 88,
+ 89, 89,165,150, 75, 95, 57,122,244,232,188,132,132, 4,162, 80, 40,204,202,163,149,149, 85,234,205,155, 55,201,192,129, 3,115,
+203, 31, 83, 43, 43,171,212, 91,183,110,149,165,175, 48,167, 32,179,183,183,159, 96, 99, 99,163,178,177,177, 81, 89, 88, 88, 44,
+182,179,179, 83,167,167,167, 19, 66, 8,105,212,168, 81, 90,249, 72,150,141,111,191,207, 54, 30,188,117,231,106, 84,102,122,179,
+238,147, 86,200,154,133,200,106,113, 12, 92,133, 66,225,197, 78,157, 58, 21, 37, 38, 38,146,130,130, 2, 18, 17, 17, 65,110,220,
+184, 65, 94,188,120, 65, 0,152, 51,195,128, 68, 44, 22, 39,107, 52, 26,147, 70,163, 49,165,167,167, 27,211,210,210,140,209, 43,
+237, 8,217,198,126,179,100, 31,237, 75,212, 87,151,154,164, 98, 97, 18, 0,201,123, 51, 90,161, 62,142,100,147,231,190,199,243,
+157,163,175, 46,235,169, 39,113,151,200,158, 49,214,250, 43,159, 57,188, 36, 63,123,253,151,108,242,118,170,147,230,207,222,123,
+ 34,190,118,126,186,110,225,116,125,124,124, 60,249,124,116, 79,195,185,105, 14,175,200, 70,175,131,117,209, 44,199,176, 1, 3,
+ 6,228, 39, 36, 36, 16, 31, 31,159, 2, 38,147, 57,246,223,100,178,186,121,112,147, 35,118,127,110,234,235, 43,204,124, 71,102,
+203,215,198,198, 38, 99,199,142, 29, 68, 34,145,164,213,213,108,125,216,191, 51, 41,202,185, 72,250, 7,183,170,246, 30, 25, 60,
+120, 48, 9, 12, 12, 36,211,166, 77,171,233, 94,162,188,128,126, 59,155, 53, 59,106,250,240, 67,227,206,102,205,142,122, 1,253,
+ 74, 13, 22, 5,224,203,229,203,151,135,233,245,250,176,237,219,183,135,245,235,215, 47, 12,192,231,245, 60, 22, 63,253,240,195,
+ 15, 68,175,215,147,237,219,183,147,126,253,250, 17, 0,107,235, 83, 46,149, 69,178,252,252,252, 62, 59,114,228,200,157,167, 79,
+159,166, 7, 7, 7,175,104,214,172,153,172,174,154,127, 69,196, 98,177, 91,211,166, 77,119,249,248,248, 36, 52,111,222, 92,235,
+237,237, 93,236,225,225, 17,231,235,235,187,131,199,227,185,214, 81,182,117,187,118,237,140, 87,174, 92, 33, 3, 6, 12, 32,229,
+ 76, 72,181, 84,231, 69, 8, 33,173,190,252,242,203,185, 0,200,151, 95,126, 57,151, 16,210,167,212, 79,244, 41,255,119,197,207,
+ 50,243, 84,246,127,101, 26,101, 75,101,154,149,253, 70,133,223, 65, 21,145,172,241,127,216,185, 19, 39, 78,116, 58,113,226,196,
+149,138, 59,247, 81, 67,180,157,214,214,161,168, 40, 61,133, 68, 45,249,148, 92, 14,116, 36, 55, 58,219,146,103, 51, 7,144,148,
+221,107,200,228, 22,242,194, 15, 27, 34,176,182, 70, 43, 44, 44,140,132,133,133,145,240,240,112, 18, 27, 27, 75,114,114,114,200,
+254,253,251,141, 86, 86, 86, 69, 60, 30,111, 25, 0,129, 57, 98, 82,169, 52,149, 16, 66, 52, 26, 13, 89,188,120,113,113,105,164,
+ 74, 41,147,201, 82, 9, 33, 36, 59, 59,155, 44, 91,182,172, 88, 38,147, 69, 0,176, 87, 40, 20,137, 49, 49, 49, 68,169, 84, 86,
+106,102,228,114,121,234,211,167, 79,203,140,147,131, 92, 46,143, 58,118,236,152,142, 16, 66,146,146,146,136,165,165,101, 42, 0,
+165,149,149,213,131, 19, 39, 78,232, 8, 33, 68,165, 82,149,165,155,101,180,138,138,138,200,185,115,231,222,202, 67, 89,250,233,
+211,167,223, 50, 96,102,160,148,201,100, 97,251,247,239,215, 26,141, 70, 18, 21, 21, 85,102, 18,149, 22, 22, 22,225, 7, 15, 30,
+212, 26,141, 70, 18, 29, 29,109,182, 25,108,208,160, 65, 26, 33,132, 24, 12, 6,178,113,227, 70, 77,217, 49, 45, 75,215,106,181,
+100,195,134, 13, 26,169, 84, 26, 6,160,218,232,155, 66,161, 80,105,181, 90,146,157,157, 77, 2, 2, 2,242,111,220,184, 65,114,
+115,115, 9, 33,132, 52,104,208, 32, 13, 0, 60, 59,141,253,254,206,243,252,220, 79,102,135, 30,112,109, 53,124,201,217,187,201,
+ 73, 91,142,220, 15, 83,248,134,244, 52, 39,168,201,227,241,150,217,217,217, 21, 95,187,118,205,168,211,233, 72, 66, 66, 2, 9,
+ 15, 15,127,115,141, 69, 70, 70,154,101,180, 88, 44,214,252, 59,119,238,232,140, 70,163, 41, 35, 35,195,152,150,150,102, 76, 75,
+ 75, 51, 84, 52, 90,100, 27,155,100,156, 30, 71, 78,110,158,161,229,112, 56,243,223, 79, 52, 11, 76,178,201, 51,132,108,242, 12,
+219, 49, 82,145,145, 23,190,151,144,243, 51,200,171,239, 27,146,249, 61, 37,121,166, 77,158, 97,100,147,215,135,228,219, 78,172,
+ 90,105,110,246,238, 75, 54,121,134,253,240,145, 75,230,131,176,123,228,202,149, 43,100,195,154,229,100, 90, 55,135, 2,211, 38,
+207, 48,242,179,247,192,218,104,150,135,199,227, 61,191,126,253, 58,185,122,245, 42, 89,184,112, 33, 17, 10,133, 9,239, 34,170,
+ 71,126,246,112, 33,191,120,116, 34, 91,221,237,200,239,157,254,114, 29,124, 90,217,195,161,187, 7, 55, 41,227,193, 17, 66, 94,
+191, 32,234,149, 62,164,167, 39,187,190,102,203,215,198,198, 38, 61, 46, 46,142,168,213,106,178,122,245,106, 34,149, 74,235,100,
+182, 62,236,223,153, 20,101, 95,168,214,104,133,132,132,144, 31,127,252,145,232,245,122,210,186,117,107,115, 94, 90,254, 96,182,
+ 60,129, 16, 0,115, 87,172, 88,241,198,100,133,134,134,134, 69, 70, 70,134, 57, 59, 59,159,170,199,177, 88,187, 98,197,138, 55,
+ 38, 43, 52, 52,148, 68, 70, 70, 18, 23, 23,151,196,250,148, 75,221,187,119,255, 62, 54, 54, 54,119,222,188,121, 7, 58,118,236,
+184,228,193,131, 7, 73, 39, 79,158, 12,243,243,243,235, 89, 87,205,119, 16,213, 97,149, 70,118,184,132, 16, 54, 33,164,204,188,
+178, 0,176,203, 2, 10,230, 48,114,228, 72, 97,219,182,109,195, 70,140, 24, 81,184, 99,199, 14, 18, 23, 23, 71, 34, 34, 34,200,
+138, 21, 43,200,130, 5, 11,200,182,109,219,200,192,129, 3, 11, 2, 2, 2,238,124,248,225,135,252, 90,100,211,199,213,213, 53,
+231,232,209,163,100,207,158, 61,132,195,225,156, 52,119,195,234,188, 72, 85,102,170, 42,131, 85,241,187,106,140, 88,181,134,205,
+140,223,251,163,169,170, 24, 9, 41,247,247,239,193,193,193,157,254,240,240, 33,248,110,252,172,239,249,177, 59, 86, 35,117,255,
+122, 48,179, 83,193,206,203,132,230,250, 73,232,175, 31,195,168, 54,109, 4, 2,138, 90, 84,219, 11,134,203,229,130,203,229,130,
+195,225,160,176,176, 16, 42,149, 10,237,219,183,103,132,135,135,243, 39, 76,152, 48, 67, 32, 16, 36, 0,232, 95,227,221, 76,149,
+ 68,164,111,222,188,137,113,227,198,241,118,237,218,213,220,218,218,250,161,209,104,228, 2, 64,116,116, 52,134, 12, 25,194,219,
+187,119,111, 19,123,123,251,112,157, 78, 39,228,241,120, 96, 50,153, 85,234,113,185, 92,232,245,122,158,187,187,123,196,195,135,
+ 15,125,131,131,131,217,241,241,241,136,137,137,129, 94,175,231,122,120,120, 68,134,135,135, 55,239,211,167, 15, 59, 49, 49, 17,
+241,241,241,111,242, 97, 78,126,181, 90, 45,120, 60, 30,202, 87,105, 81, 20, 5,141, 70, 3, 46,151,107,182, 22,139,197,234,226,
+229,229, 21,249,240,225, 67,191,144,144, 16,206,189,123,247,144,148,148, 4,163,209,200,245,246,246,142,124,248,240, 97,139,126,
+253,250,113, 34, 34, 34,144,154,154, 10,115,171,208,202,214,123,248,240, 33, 70,140, 24,193, 61,115,230, 76, 11, 59, 59,187, 8,
+131,193,192, 5,128,200,200, 72, 12, 25, 50,132,123,246,236, 89, 63, 39, 39,167,136, 26,170, 18,153, 0,160,215,235, 49, 97,194,
+ 4,145, 84, 42, 69, 98, 98, 34, 76, 38, 19,140, 70, 35, 0, 32, 51, 43, 51,242, 97,100, 84,244,168, 97, 31,117, 42,210,105, 52,
+183,238,222,127,210,168,129,139, 35, 69,145, 6, 53,100,181,191, 72, 36, 74, 88,185,114,229,103,113,113,113, 60, 47, 47, 47,198,
+171, 87,175,144,151,151, 7, 14,135,243,230, 26, 51,119,191,185, 92,110,103, 31, 31, 31, 86,113,113, 49, 76, 38, 19, 0, 16, 6,
+163,242, 22, 43,252,236,235,240, 86, 26,216, 2,129,160,243,123,121,122,231,250, 88,193,132,238,241,233, 90, 30,207,194, 81, 34,
+182,243, 0, 18,174,162,161, 53, 15, 76, 6,147,127, 47,166, 80, 4,144,238,112,206,176,170,157,166,169,123, 76,154,150,167,183,
+108, 34,182,119,116, 70,102,102, 38,156, 26,121,161,152,107,205,189,249,162, 64, 12,170,150,154,255, 79, 7,119,119,119, 91, 55,
+ 55, 55,100,100,100,192,207,207, 15,114,185, 92, 14,160,123,157, 31, 58,219, 93,120,200, 69, 59,128,177, 18, 70,106, 33,244,172,
+165,120,145,238, 71, 54,249,177,255, 74, 38, 75, 42,230,222,222,187,111,191,131,149,179, 55,112,242, 19, 40, 45,120,216, 58,201,
+207,210, 90,198, 59, 90, 71,179,229,171, 84, 42, 47,221,185,115, 71,193,231,243, 17, 30, 30, 14, 31, 31, 31,172, 94,189,218, 90,
+ 46,151, 95,173, 91,100,139,128, 80, 85,155,172,142, 29, 59, 98,234,212,169,216,181,107, 23, 44, 45, 45, 49, 98,196,136,154,204,
+ 22,137, 6,142,255, 16, 17,177,125,215,203,151, 39, 70, 54,110, 28, 60,194,195, 99,241,196,161, 67,199, 78,159, 62, 29,203,151,
+ 47,199,209,163, 71,209,174, 93, 59,140, 31, 63, 94,159,144,144,176,179,174, 85, 85, 43, 87,174,156, 54, 99,198,140,138,154,186,
+248,248,248, 31,234, 85, 46,101,102, 70, 70, 68, 68, 68, 15, 27, 54,172, 83,113,113,177,230,238,221,187, 79, 92, 93, 93, 29, 1,
+ 52,168,171,102, 61, 12, 22, 69, 8,225, 3, 16,150, 46, 34, 0,194,189,123,247,202, 66, 66, 66,164,165,105,130,210,165,198,234,
+125, 31, 31, 31,199,231,207,159, 39,207,156, 57,211,111,215,174, 93, 2,161, 80,136,236,236,108,252,242,203, 47,152, 59,119, 46,
+ 40,138, 2, 33, 4,219,182,109, 19,142, 25, 51,166,213,203,151, 47,147, 93, 92, 92,204,105,210,194, 19,139,197, 7, 23, 47, 94,
+ 44, 53,153, 76,152, 51,103, 78,134, 78,167,155, 90,250,221, 60, 11, 11,139,219, 40, 49,220,213, 81,169, 23, 41,247,172, 60, 81,
+225,216, 4, 87, 76,171,248, 29, 33, 36,184, 58,141, 90,158,139,202,126,239,100,117,102,171,252, 19,168,115,165, 46, 18,104,102,
+235,234,137,156,243, 7, 33, 96, 81, 16, 48, 75, 23, 22, 5,198,171, 72, 56,241,217,208, 19,226, 91, 87,163, 85,182,176,217,108,
+ 20, 22, 22,194,104, 52, 98,238,220,185,188,115,231,206, 89, 49, 24,140,255,214,164, 83,222, 48, 61,123,246, 12,222,222,222,212,
+241,227,199,149, 83,167, 78, 21,148,253, 78, 78, 78, 14,220,220,220,168,211,167, 79,219,124,253,245,215,226,234,204, 12, 69, 81,
+224,112, 56,152, 49, 99,134,224,238,221,187,150,246,246,246,120,245,234, 21, 94,191,126, 13,177, 88,140, 25, 51,102, 8,238,220,
+185, 99,109,111,111,143,184,184, 56,228,228,228, 64, 44, 22,215,218,104,113, 56,156,183,182,161, 40, 10, 58,157,174, 86,198, 64,
+ 38,147,237, 9, 11, 11,179,150,201,100,136,136,136,128,193, 96,128, 76, 38,195,180,105,211, 4, 97, 97, 97,214, 22, 22, 22,136,
+142,142, 6, 33, 4, 82,169,180, 86,121, 4, 0,147,201,132,232,232,104, 52,104,208, 0, 87,175, 94,181,153, 56,113, 34,191, 44,
+253,197,139, 23,112,116,116,196,213,171, 87,109, 68, 34,209,158,170,180, 76, 38, 19, 82, 82, 82,240,232,209, 35,188,122,245, 10,
+233,233,233,200,200,200, 64, 94, 94, 30, 12, 6, 3, 0, 64,152,151,123,114,239,129,227, 15, 5, 2,129,208,199,195,221, 57, 50,
+234,113,154, 64, 32, 16,186, 56, 59,123, 0,223, 50,170, 49,132,255,141,143,143,183, 26, 51,102, 12, 71,173, 86, 35, 43, 43, 11,
+ 44, 22,235, 15,215, 22,151,107, 94, 83, 32,131,193,224,205,231,243, 41,157, 78,247, 38, 2,198,229,114,241,217,158, 66,248,204,
+199, 91,203,208, 53,105, 32, 70, 61,180, 90,173,247,255, 60,154, 5, 80,160,180,238,160, 40,191,219,175, 10, 44, 59, 4, 15,227,
+ 32,230, 12, 96,210, 3, 12, 22, 58, 55,115,100, 29,141, 44, 80,130,160, 25, 52,240, 34,164,230,158, 95, 4,160, 0,157, 27, 64,
+125,112,238,185,193,170,221,128, 73,156,228,228,100,112, 56, 28,240,120, 60,248,117, 25,196,218,251, 80,111, 11, 10,205,161,131,
+167, 57,154,111,133, 29, 5,130,111, 22, 44, 88, 32, 42,175, 57,118,236, 88,145, 76, 38, 91, 80,103,147, 85, 32,108, 3, 3,153,
+241, 40,185,176,193,226,147,106,239,151,105, 69,158, 32,100, 38,160,111,241, 14,204, 86,103, 30,143, 23, 3,160,125,189, 76,150,
+132,123,107,223,190,253, 14,150, 78, 37, 38, 11,134, 98,128, 45,128,173,181, 5,182,126, 22,104,105,109, 33,168,173,217,242, 85,
+ 42,149, 23,111,223,190,173,224,243,249, 8, 11, 11, 3,135,195, 1,159,207, 71,211,166, 77,177,105,211, 38,107, 75, 75,203, 90,
+155, 45, 2, 82,105,204,183,127,255,254,164, 99,199,142,152, 50,101, 10,118,238,220, 9,173, 86,139,197,139, 23, 35, 62, 62,222,
+ 44,217,104,224,248,178,136,136, 29, 75, 31, 61,122,246,165,175,175, 87,127,145,200,114,202,136, 17,178,175,191,254,250,196,177,
+ 99,199,182,247,233,211, 39,227,238,221,187, 63, 2, 56, 88,203,195, 75, 1, 8, 93,181,106,213,148, 50,227,246,245,215, 95,111,
+ 59,118,236,216,210, 62,125,250,164,220,189,123,119, 38,128,208,250,148, 75, 38,147,233,228,127,255,251,223,135, 2,129, 64,232,
+233,233,233, 28, 21, 21,149, 38, 16, 8,132,206,206,206, 30,157, 58,117, 98,212, 69,179, 46,216,216,216,116,189,125,251,182, 15,
+ 74, 58,141,241,202,140, 86, 84, 84,148, 69,110,110,174,133, 88, 44,182,176,179,179,147,148,153,173, 1, 3, 6, 88,176, 88,172,
+106,175,219,252,252,252, 99,243,230,205,147, 13, 24, 48,160,236,127, 92,191,126, 29, 59,119,238,132, 72, 36,122,107,221,126,253,
+250, 97,220,184,113,114,173, 86,251, 95, 51,178, 59,122,194,132, 9,158, 74,165, 18,223,124,243,141, 38, 57, 57,185, 43,128,120,
+ 0,178,110,221,186,125, 31, 21, 21, 21,208,170, 85,171, 3, 0,252,171,187,247, 42,243, 34,229,141,142, 57,105,117, 93,223, 92,
+179, 85, 33,169,202, 49,180,222, 50, 90,193,193,193, 87, 80, 69, 79, 42,221,235, 84,240, 96,132,128, 73, 65,200, 44,103,182, 96,
+ 2, 43, 39, 13, 84, 29,122,169, 84,246, 48,228,114,185, 96, 50,153,208,106,181, 48,119,162,234, 50, 83, 32,149, 74, 33, 22,139,
+ 81, 84, 84, 4,131,193, 0, 62,159, 95,102, 70, 32,149, 74,193,102,179,193,102,179,193,231,243,255, 16, 77,170, 24,205,225,112,
+ 56, 16,137, 68, 72, 73, 73, 65,124,124, 60, 76, 38, 19,196, 98, 49, 68, 34, 17,184, 92, 46, 84, 42, 21, 84, 42, 21, 8, 33, 16,
+137, 68, 16,137, 68,168, 77,131,107,163,209, 88,233,195, 95,175,215,215, 42,162,101, 48, 24,240,228,201, 19, 36, 36, 36,128,207,
+231,191,217, 87, 30,143,135, 23, 47, 94, 64,173, 86, 67, 40, 20, 66, 42,149, 66, 38,147,153,173, 91,182, 47, 18,137, 4, 2,129,
+ 0, 89, 89, 89, 40, 44, 44,124,115, 76,165, 82, 41, 68, 34, 17,114,114,114,144,150,150, 86,237,190, 27,141, 70,168, 84, 42,164,
+167,167, 35, 49, 49, 17, 25, 25, 25,111, 10,160,210,168, 81,253, 2, 59,185,185,200,204,204,124, 19,137,172,106, 49, 7,147,201,
+132,188,188, 60,220,190,125,155, 50,153, 76,200,206,206, 54,165,171,213,198,201, 42, 46,142,126,251, 51,217,127,230, 65,241,222,
+ 83, 97, 69,135, 47, 62, 42, 10, 61, 28, 89,196, 15, 88,104,192,251, 96,131,175, 12,122,118, 80, 70,190,158,151,174,227,200,148,
+190,221,128,152,211, 0,131, 5,240,229,104,221,164, 33,226,179,140,162,167,169, 90, 62, 40,244, 64,168,135,220, 44, 77, 35,187,
+123,122,158,158, 23,167,179,150,122, 55,243, 71,106,106, 42,120, 60, 30,120, 60, 30, 62,104,215, 13, 49,153, 70,225,227,228, 34,
+ 33, 8,130,204,210,252,127, 26,137,197,226, 54,237,219,183,167,202,107,246,238,221, 27, 20, 69, 53, 5,224, 85,171, 66,110,109,
+ 35, 46,116,194,214, 96,145, 25,143, 83, 10,237,143, 70, 21,123,244,237, 63,200,242,167, 11,105,222, 79,212, 26, 87, 16,253, 44,
+ 16,157,127, 61,204, 86, 39,137, 68,114, 98,221,186,117,174,124, 62,255, 52,128, 14,117, 17, 17, 11,152, 27,191,153, 50,204, 65,
+ 94,102,178,244,133, 0, 75, 0,176, 5, 0, 75, 0, 91, 27, 5, 22,141,235,110, 41,228,179, 15,215,194,176,238, 13, 13, 13,181,
+174,104,178,202, 22, 63, 63, 63,204,159, 63,223,218,210,210,114,143, 57,122, 43, 87, 44, 39,217, 57, 57, 0, 1,114,115,243,177,
+114,197,242,172,178,239, 6, 12, 24, 64, 58,116,232,128, 41, 83,166, 96,233,210,165, 56,117,234, 20, 90,183,110,141,241,227,199,
+163, 85,171, 86, 53, 73, 7,201,100,178, 93,221,186,117,187,173,146, 72,198,165,248,251,115, 47,202,100, 57, 93,115,114,100, 46,
+ 81, 81, 58, 79, 32, 18,192,134,164,164,164,158,181, 48, 89, 67,165, 82,105, 88,215,174, 93,117, 18,137, 36, 97,245,234,213,147,
+167, 78,157,138,229,203,151, 99,222,188,121,191, 0,248, 15,128,175,146,146,146,236,171, 51, 89,127, 86,185,244,103,149,117, 70,
+163, 49,241,224,193,131,173,116, 58,157, 99,105,245, 32, 47, 59, 59, 91,250,250,245,107,137, 78,167, 19,153, 76, 38,145,133,133,
+133, 24,128,112,212,168, 81,172,199,143, 31,123, 27, 12,134,228,234, 52,213,106,245,240, 57,115,230,100,100,100,100, 0, 0,154,
+ 54,109,138,236,236,108,124,254,249,231,248,244,211,146, 14,193, 45, 90,180, 0, 33, 4,169,169,169, 88,185,114,101,170, 90,173,
+254,216,140,236, 54,118,119,119, 71, 84, 84, 20,158, 60,121,114, 1,128, 9, 37,237, 88,115, 30, 60,120,240, 48, 61, 61, 29,123,
+246,236,225, 56, 56, 56, 28, 67, 21, 67,188, 84,231, 69,234, 2, 69, 81, 39,235,178, 93, 89,228,170,178,136, 88, 21, 84, 31,209,
+ 10, 14, 14,166,202,127,190, 21, 49,162, 16,145,112,255, 42, 44,125,253,223,138,102, 9,153, 20, 4, 82, 25, 98, 18,227,193, 1,
+245,232, 93, 25,173,172,172, 44, 76,158, 60,185,104,248,240,225,153, 38,147,105,144,185,166, 64, 38,147, 65, 38,147,225,241,227,
+199,100,224,192,129,169,171, 87,175, 46, 42,111,180,158, 61,123, 70,130,130,130,210, 22, 44, 88,144, 95,157,209, 42,139,104, 45,
+ 91,182,172,168,115,231,206,233,143, 30, 61, 34,101,102, 74, 44, 22, 99,229,255,177,119,221,225, 81, 84,111,247,204,204,246,150,
+ 94, 73, 72, 8,161, 36, 64, 32,132, 22, 64, 80, 32, 64, 64, 58, 34,130,136,130, 34, 69, 68, 20, 17, 21,233, 2,210,155, 82, 20,
+ 69,105, 2,130,210, 17, 8, 85,105, 9, 45,148, 52, 72, 47,155, 77,207,246,221,153,185,223, 31, 73, 48, 64,202, 38,168, 63,245,
+219,243, 60,243,108,246,238,204,201,109,115,231,204,123,239,125,223, 21, 43, 12, 61,122,244, 80, 95,187,118,141, 84,164,213,197,
+162, 69,211,244, 35,161, 85,249, 26,154,166,193,243,124,157,132,150, 78,167, 27,253,226,139, 47,170,239,223,191, 79, 42,202,233,
+232,232,136, 85,171, 86, 25,122,247,238,173,190,115,231, 14,169, 72,115,112,112,176, 89, 12, 86,252,127,149, 74, 5, 7, 7, 7,
+220,189,123,151,244,233,211, 71,189,110,221, 58, 99,229,244,123,247,238,145, 65,131, 6,169, 75, 75, 75, 71,215, 36, 94, 42,166,
+243, 88,150,133,209,104, 68, 94, 94, 30,210,211,211, 31,153,211, 13, 10,135,200, 81, 47, 15, 12, 53, 24, 12,250,187,241, 9,105,
+173, 67, 90,122, 24, 12, 6,125,106, 90, 90, 60, 48,143,175,129,123,120,171, 86,173,242, 39, 79,158,108, 40, 44, 44,124,102,161,
+ 37, 22,139,239, 11, 4, 2,210,173, 91, 55, 98, 54,155, 73,122,122,186, 53,175,176,144, 13, 94,188,152,220,153, 62,157,146, 69,
+ 71, 75,148, 74, 37, 85,206, 73, 63,120,240,128,151,201,100,247,255,118,161, 69,243, 94,160,200,115, 23, 18,180, 78,189, 7,142,
+ 20, 83, 57, 87, 1,139, 22,144, 56, 3, 18,103, 8, 20,174,232,215,173, 45,179,237,114,137, 23, 8,223, 5, 34,137,111,173,156,
+ 66,226, 9,240,221, 78,198, 27,157,159,123,105,170,184,160,160, 0, 12,195, 60, 18, 69,114,133, 2,189,134,188, 70,127,123,213,
+228, 5,144,174,160, 24,223, 58,220,235, 51, 63,251,236, 51, 81, 97, 97, 33,104,154,254,131, 83, 46,199,196,137, 19, 37, 14, 14,
+ 14,179,109, 30,252,246,182, 16, 65, 40, 9, 7,200,123,113, 57,198, 6, 7,111, 27,130, 62, 88,186, 85,214,170,109, 71,188,253,
+130,135,108,233,145,220, 86, 55,211, 13,141, 1,110, 58, 88,115,251,122,136,173,110, 42,149,234, 72,116,116,180,188,127,255,254,
+ 88,177, 98,133, 66, 38,147, 29,171,207,192,175,211,114,239, 44, 88,247,131,250,214,234,190,128, 69, 87, 38,176, 42, 29,185, 90,
+ 30,115,182, 70, 21, 91,173,100,148,173,156, 6,131, 97,236,155,111,190,153,191,127,255,254,167, 68,150, 84, 42, 69,114,114, 50,
+ 62,255,252,243,130,130,130,130, 90, 31,138,171, 86,174,136,137,189,121, 6,223,126,189, 0, 0,193,250, 85,147,112,233,194,110,
+167, 23,158,239, 78, 26, 53,106, 68, 58,118,236,136,201,147, 39, 99,209,162, 69,136,139,139,131,155,155, 27, 38, 77,154,132,231,
+159,127, 30, 43, 87,174,172,105,144,234,243,206, 59,239,124,158,145,145, 17,116,242,228, 73,129, 70,163,241, 88,249,205, 55,197,
+251,138,139, 11,150,196,198,198,125, 18, 18,210,108, 86,155, 54,175,215,224,250,161, 74,145, 53,101,202,148, 93, 25, 25, 25, 97,
+167, 78,157, 18,106, 52, 26,223, 41, 83,166, 96,249,242,229,152, 61,123,246,102, 0,111,195,182, 13, 47, 54,143, 75, 12,195, 68,
+ 14, 31, 62, 60,212, 96, 48,232,227,226,226,210, 66, 66, 66, 60, 12, 6,131, 62, 45, 45, 45,254,220,185,115,124,125, 56,235,131,
+252,252,252,164,157, 59,119,198, 79,157, 58, 53, 44, 35, 35,163, 5, 0,215,210,210, 82, 69,105,105,169,196,108, 54,203,156,157,
+157,157,219,182,109,235, 54, 97,194, 4,229,141, 27, 55, 90,100,100,100,104,203,173, 72,213,194, 98,177,196, 21, 22, 22, 14,232,
+219,183,111, 81, 97, 97, 33,218,180,105,131,129, 3, 7,194,203,203, 11, 13, 26, 52,192,224,193,131,209,188,121,115,228,231,231,
+ 99,212,168, 81, 5, 26,141,166, 47,128, 7, 54,100, 55, 41, 39, 39, 7, 93,186,116,193,130, 5, 11, 6,140, 24, 49,226, 78,183,
+110,221, 74, 66, 66, 66,244,190,190,190,193,107,215,174,133,143,143, 15,246,238,221,235, 45,145, 72,118, 86, 33,178,170,213, 34,
+ 0, 52,229,130,199,252,196,167,166,150,223,108,189,182,202,191,109, 56,239, 73,177, 85,249,120,106,234,176,234, 6, 1,230,124,
+191,119,155, 81,236,215, 20,142, 65,161,144, 75,165,144,137,197,144, 57,187,194,196,243,248, 38, 57, 71,175, 35,100,118, 93, 59,
+207,147, 15, 66,138,162,176, 97,195, 6,182,115,231,206,198,168,168,168,245, 6,131,193, 15,101, 94,101,109, 22, 5,235,214,173,
+211, 79,155, 54,237,102,110,110,110,168, 84, 42, 53, 87,164,175, 95,191, 94,255,218,107,175,197,102,100,100,132,201,229,114,125,
+117,235,179, 42, 11, 45,137, 68, 98,202,205,205,237, 56,126,252,248,251, 95,125,245,149, 78, 46,151, 67,161, 80, 64, 34,145,152,
+115,115,115, 67, 39, 79,158,124,115,249,242,229,122,153, 76, 6,133, 66, 81,167,105, 57, 66,200, 83,130,170,114,186,173, 96, 89,
+ 54, 42, 55, 55, 55,116,218,180,105, 55,214,174, 93,171,171, 16, 64,149,243,184,114,229, 74,189, 82,169,172,147, 69,171,226, 60,
+133, 66,129, 53,107,214,232,167, 78,157,122, 51, 55, 55, 55, 84, 34,145,152, 43,165,235,222,121,231,157, 27,185,185,185,161, 44,
+203, 70,213,240, 54,198,149,148,148, 64, 32, 16, 32, 54, 54,214, 36, 18,137, 64,211, 52, 18, 19, 19, 31, 13, 62, 46, 46, 46, 45,
+ 67, 91,135, 4,255,176,107,239, 57,153, 72, 34,233,220,177,125,139, 7, 41,169, 25,132, 80, 41,181,100,245,103,131,193,224, 23,
+ 21, 21,181,190,115,231,206,198, 13, 27, 54,176,213, 89,182,108,129,201,100, 58,119,253,250,117,171, 84, 42,165,178,179,179, 89,
+134, 97,192,113, 28, 49,117,236,104,106,189,118, 45,185, 59,107, 22,229,160, 80, 8, 68, 34, 17,228,114, 57,117,252,248,113,179,
+ 94,175, 63,247,247, 11, 45,200, 65, 65,150,144,107, 82, 73,105,150, 66,252,207,101, 34, 75,234, 4, 72,157, 1,169, 51,124,124,
+124,113, 53, 89,175, 2, 13, 49, 56, 27,124,136, 17,162, 0, 5,121,172, 26, 42,161, 88, 70,229,228,228, 60, 18, 68, 21, 71, 64,
+211, 22,184,158,170, 85,130, 34, 18, 48,168,139, 11,146, 1,174,174,174,130,236,236,236,167, 56, 91,182,108,201, 88,173, 86,219,
+ 93,187,100,113,222, 0, 63, 37, 62,199,232,125,224,166, 46,104,250,146,111,101, 50,174, 8,136, 94,135, 86,129, 13, 48,253,165,
+182,226, 79, 15,106, 90, 93, 75,209, 7,130, 33,111,131,215,186,215, 33,159,207,169, 84,170, 99,215,174, 93,147,171, 84, 42, 60,
+120,240, 0, 29, 59,118,196,150, 45, 91,228,114,185,252, 40,128, 58,173,199,187,162, 70,170,182,148,235, 60,115,111, 90,206,173,
+108,246, 49,145,165,209, 17,188,249,197,193,162,194, 18,227,240,203,233,213,223, 63, 85,224, 70, 81, 81, 81,159,217,179,103,231,
+107, 52,154,199, 68, 86,106,106,106,197, 67,241, 5, 0,181,190,252,158, 61,115, 34,108,241,162,105,184, 22,125, 7,253, 6,188,
+135,235,183,146,240,201, 71, 67,224,228, 32, 67, 84, 84, 20,134, 14, 29,138, 5, 11, 22, 32, 49, 49, 17, 63,254,248, 35,181,101,
+203, 22,234,242,229,203,212, 23, 95,124, 65,213,178,164,225,213, 37, 75,150,224,218,181,107,232,223,191, 63,206,159, 63,143,130,
+130, 2,236, 62,118, 44, 97,103, 66,194, 39, 21,107,182,170,113,253, 80, 37, 28, 28, 28, 62, 88,178,100, 9,162,163,163, 31,113,
+230,231,231, 99,201,146, 37, 25, 0, 38,213, 69,100,213,101, 92,106,211,166, 77,240,174, 93,187,206, 73,165, 82, 73,199,142, 29,
+ 91, 36, 39, 39,103, 0, 72,169, 7,103,201,179,204, 84,229,229,229,253,190,101,203,150,203, 61,123,246,148,143, 29, 59,214,253,
+151, 95,126,113,213,235,245, 13, 36, 18,137,135,217,108, 22,223,187,119,143,217,183,111,159,215,221,187,119,147,141, 70,227, 85,
+ 91,234, 35, 55, 55,247,106, 92, 92, 92,223, 54,109,218,220, 91,191,126,125,134,183,183, 55, 63, 97,194, 4,188,249,230,155,112,
+119,119,231,214,172, 89,147,214,173, 91,183,216,164,164,164, 8,189, 94,127,219,198,188,126,183,120,241,226,223,118,237,218,133,
+129, 3, 7,226,139, 47,190,192,238,221,187,113,230,204, 25,217,133, 11, 23,196, 91,182,108,129, 72, 36, 66,120,120, 56,250,244,
+233,211,171,124,186,211,214,231,210, 53,138,162,142, 80, 20,117,234,137,207,107, 53,253, 86,135,107,171,251,187,198,243,158,200,
+230,150, 39, 14,219,241,106, 32,230, 77, 12, 81,233,127, 31, 19, 78,114, 38, 60, 71,212, 35, 91,144,139,207,187,144,241, 77, 40,
+221,216,122,186,119, 48, 24, 12,143,142,253,251,247, 19, 47, 47, 47,157, 74,165,170,179,123, 7, 47, 47, 47,117, 73, 73, 9,233,
+208,161, 67,129,187,187,251, 35, 87, 4,222,222,222,106,157, 78, 71,194,195,195, 11, 60, 60, 60, 30,185,119,240,245,245, 77, 39,
+132, 16,127,127,255,172,234, 38,158,227,147, 0, 0, 32, 0, 73, 68, 65, 84,248, 88,150, 37, 94, 94, 94, 21, 59,244,132, 46, 46,
+ 46, 27, 59,117,234, 84,160, 86,171,137,183,183,247, 35,215, 9,238,238,238, 43, 58,118,236,248,100,122,109,249, 77,207,200,200,
+ 32, 25, 25, 25,164, 97,195,134, 89,149,211, 83, 83, 83, 73,106,106, 42,241,245,245,173,179,123, 7,119,119,247,229, 85,228,165,
+ 94,121,244,243,243, 83, 27, 12, 6,210,165, 75,151,199,234,212,207,207, 79,109, 52, 26, 43,210,109,114,239, 32,147,201,222,150,
+ 74,165, 89, 82,169, 52, 75, 34,145,124,222,168, 81,163,220, 61,123,246,144, 53,107,214, 84,108, 73,135,123,203, 65,157,155,118,
+121,253, 19,247,150,131, 63,120, 22,247, 14, 42,149,234,180,151,151,151,110,255,254,253,143,245, 47,131,193, 96,179,123, 7,153,
+ 76,150,161,213,106,121,181, 90,109,253,237,183,223,244,209,209,209,250,216,216, 88,125,114,114,178, 33, 63, 55,215,162, 86,171,
+ 13,197,197,197,166,155, 55,111,154,228,242,255,141,123, 7,178,165,121, 83,178, 49,248, 96,210,130,128,187,211,186,203,141,183,
+ 23,133, 18,242,211, 80, 66,142,190, 73, 72,212, 76,114,117,243, 4,210, 37, 64,194,253, 54,163, 97, 60,217, 20,116,192, 22,151,
+ 12,100, 75,235,166,100, 99,240,209,132,249, 1,119,199,118,107, 96,252,230,171, 53,228,202,149, 43, 36, 54, 54,150, 60,120,240,
+128, 28,253,121, 15,233, 18, 40, 47,227,220, 24,124,176,142,110, 30,186, 74, 36, 18,237,170, 85,171,200,229,203,151, 31,113, 30,
+ 60,120,144,200,229,114, 61, 96,219,174,101, 2, 80,100, 99,203, 33,236, 87, 65, 23, 62,237,173, 44,205, 63, 60,147,144,219,219,
+ 8,217,210,138,144,239, 58, 17,178,231, 69, 66, 14,189, 78, 46,175,121,137,116, 13, 16, 89,201,166,160,243,100,115, 75,155, 23,
+219, 11,133,194,146,253,251,247,147,172,172, 44,114,254,252,121, 18, 29, 29, 77,238,223,191, 79,210,210,210,200,145, 35, 71,136,
+ 80, 40, 52,162, 30, 97,203, 58,121,194, 63,162,153, 40,251,230,210,174,132,252, 50,138,104,118,190, 74, 6,132,168, 10,194, 27,
+ 62,147, 63,186,182,174,174,174,121, 71,142, 28, 33,201,201,201,228,220,185,115,196,195,195, 35, 15,128,205,235,101, 7,244,235,
+ 70,136,249, 38,233,209, 61,132,180,105, 19, 66,158,239,218,140,100, 38,173, 35, 29,219, 53, 34, 27, 55,110, 36,106,181,154, 52,
+106,212,136,212, 53, 99, 17, 17, 17, 87, 8, 33, 49,253,251,247,143, 1,112, 60, 34, 34, 34,230,225,195,135, 49, 29, 59,118,188,
+140,154, 93, 63, 84,139, 94,189,122, 89, 8, 33,164,127,255,254, 4, 64, 86, 68, 68, 4,121,248,240, 33,233,216,177,163,185, 62,
+149,103,203,184, 20, 22, 22,214,185,103,207,158,159,132,133,133,125, 96,139,123,135, 90, 56,255, 44, 39,212, 12,202,156,127,182,
+ 4,208,190,252,104, 81,158,198, 60, 3,231,235, 66,161,240, 27, 23, 23,151, 51,206,206,206, 81, 12,195,108, 1, 48, 6,245,243,
+111, 70,151, 91, 24,127,117,119,119, 79,108,211,166,141,161,111,223,190,164, 95,191,126,100,202,148, 41,132,231,121,178,103,207,
+ 30,178, 96,193, 2,210,196,213,149, 93, 3,228,109, 2,222,128, 29,101, 14, 75,223, 8,164,206,141,110,140,210, 81,141,161, 29,
+215,132,178,197, 97,105, 68,117, 66,139,231,121, 18, 31, 31, 79,122,244,232,161, 83, 40, 20,153,176,221, 97,233, 99,156,110,110,
+110,209, 30, 30, 30, 79, 57,209,172,148,254,152,195, 82, 15, 15,143,223,189,189,189,213,238,238,238,215,171,226,116,115,115,139,
+246,246,246, 86,187,185,185, 61,230,220,147, 97,152,254,110,110,110,153, 79,166, 11, 4,130,158, 30, 30, 30,233, 79,166, 87, 83,
+118,120,121,121,165,103,101,101, 17,141, 70, 67,252,252,252,178,158, 20, 96, 57, 57, 57,143, 9, 48, 91, 56,107,203, 75, 13,121,
+172,146,211,134, 58,173, 79,187, 87,160,185,143,143, 79,238,202,149, 43,137, 82,169,124,108,203,115, 80,247,113,159, 93, 73,208,
+150,188,249,209,198, 61, 85, 56, 44,181,213, 57,104, 95,133, 66,145,217,163, 71, 15, 93,124,124, 60,225,121,158,240, 60, 95,157,
+208,170,138, 51,178,125,251,246,249,121,121,121, 92,105,105, 41,155,158,158,110,122,248,240,161, 97,209,162, 69, 22,141, 70, 99,
+212,106,181,230, 91,183,110,153,188,189,189, 53, 0, 34,235,218, 70,245, 68,196,147,211,103,100,115,139,174,100, 83,139, 35,247,
+231,250,223,123,189,147,194, 20,179,178, 63, 33, 81, 51,201,229,141,111,146,206, 1,226, 50, 65,180, 57,248, 24,249,182,121,119,
+178, 46, 80,108, 19,231, 55, 77,186,145,205,193,199,238,206,241,191, 55,180,157,187,121,215,182,205, 36, 49, 49,145, 28,220,183,
+147,132, 55, 46, 23, 89,155, 90,252, 74, 54,182,232, 97, 11,103, 85, 98,107,235,214,173, 36, 49, 49,145, 28, 56,112,192, 86,145,
+ 21, 81,149,208,250, 56, 66, 89,244,102, 39,169,105, 84, 91,177,121,112, 43,145,165, 79, 83, 17,219,197, 95,192,133,122,211,124,
+ 11,119,144, 62, 65, 50, 19,217, 20,116,158,108,106,209,215,214,124,138,197,226, 52, 84,242,169,243,228, 33,145, 72, 52, 53, 8,
+173,136, 90,197, 86,115, 73,246,233, 5, 61,201,192, 54,170,124, 27, 69, 86,109,125,169,173,155,155, 91,222,119,223,125, 71, 60,
+ 61, 61, 53, 54,138,172, 71,156,131, 6,244, 33,169, 73, 71,201,129, 61, 75, 72,143,238, 45,200,246,173,211,200,149,243,115,201,
+139,253,122,144,136,136, 8,146,151,151, 71,122,246,236, 73,234,154, 79, 71, 71,199,237, 90,173, 54,230,196,137, 19, 49, 17, 17,
+ 17, 49,219,183,111,143,185,120,241, 98,140, 92, 46,223, 94, 97,156,120, 82,108,181,120,122,252,143,120,194,162, 21, 83, 90, 90,
+ 74, 78,156, 56, 65, 34, 34, 34,200,246,237,219,201,197,139, 23,137, 92, 46,143,169,239,125,100,235,184,212,187,119,239,207,146,
+147,147, 75,230,204,153,179,167, 10,135,165,182,114, 38,254, 73,249,252, 83,198,144,255, 1,167, 74, 38,147,197,220,188,121,147,
+ 20, 22, 22,146, 16, 79, 79,178,152, 97, 72,134, 72, 68,178, 68, 34,178, 17, 40,248, 15,200,164, 9,213, 77, 29,254,213,168, 82,
+104, 25,141, 70, 50, 99,198, 12,179, 84, 42,213,139, 68,162,186,134,224,249, 87,119, 66, 55, 55,183,223, 61, 61, 61,213,158,158,
+158,143,137,189,202,233,110,110,110,215,255,227, 55, 96,115,145, 72,148, 42, 20, 10, 31, 15,193,211,114, 80,231, 38, 93,199,206,
+246,108, 53,168,223, 51,230, 83, 36, 18,137, 62,150, 74,165,250, 25, 51,102,152,181, 90,109, 93,132, 22, 0,244,150,203,229,153,
+223,127,255,189, 33, 33, 33,193, 90, 80, 80,192, 94,185,114,197, 26, 29, 29,109,158, 55,111, 94,169, 92, 46,207, 68,245,110, 9,
+254,150,250, 36,235, 2,197, 21, 98,235,246,108,255,251, 3, 67,228,150, 45,239,247, 33,157, 27, 61, 33,178,170,247,228, 94, 53,
+103,185,216,186,241,169,223,253, 30,205,149,236,146,217,211, 73,120, 99,217,227, 34,171, 14,156, 79,138, 45,185, 92, 94, 58,119,
+238,220,186, 88,178, 30, 23,132,223, 4,249,145,205,193,219,203, 68, 84, 45,199,198,160,175,201,134, 32,191,127,202,125,212,201,
+ 19,254,189,154, 75,238,212,193,146,101, 75, 62,219, 58, 59, 59,223,171,131, 37,235, 17,231,134, 13,235,201,171, 35,123,147,164,
+123,251,137, 54,255, 40,185,126,105, 21, 25, 54, 40,140,132,135,119, 36,155, 55,111, 38,113,113,113,164, 67,135, 14,164, 30,249,
+236, 51,113,226,196,152,135, 15, 31,198, 60,120,240, 32,230,226,197,139, 49, 67,134, 12,137, 1,208,167,242, 76, 80,133,216,178,
+ 12, 27,102,106, 75,211,211,107,225,124,101,226,196,137,228,225,195,135,228,193,131, 7,228,226,197,139,100,200,144, 33, 4,117,
+ 11,223, 83,175,113, 41, 44, 44,172,115,143, 30, 61,102,183,107,215,174,223,159,197,249,255, 80,104, 41,134, 14, 29,202,115, 28,
+ 71,250,245,235,199,173, 5,138,182, 80,148,122, 11, 69,169, 55, 3,154,255,186, 69,235,175, 14,248, 25, 1,224, 84,229, 4,169,
+ 84,170, 54, 26,141,238, 74,165,242,103,173, 86, 59, 21,101,219, 34,159,137,243,175,200,167,157,243, 63,193,233,173, 84, 42,215,
+107,181,218, 33, 82,169, 84, 99, 52, 26, 61,235,192,233, 36,145, 72,166, 75,165,210, 30,122,189,190, 57, 0, 40, 20,138,120,147,
+201,116,198, 96, 48,172, 6, 80,244,191, 46, 59, 89, 23, 40,134, 88,220, 30, 4,179, 98,210,116,141,151,156, 40,240,127,191,167,
+115, 90,151, 38,138,100, 8,249, 47, 64,153,174, 82,111,164,154,234,204, 41,163, 58,130, 19,206,186,154,162,111,244,197,201, 82,
+255, 15,122, 40,211,186, 4, 42,211, 64,240, 5, 36,250, 75,117,229,124, 82,108, 41, 20,138,239,117, 58,221, 91, 0,206,212,181,
+236,100,111, 11, 17,116, 86, 31, 88,153, 16,144, 26, 66,248, 16,162, 7,205,196, 34, 7,106,106,222, 61,139,253, 62,170,154,243,
+171,175,190, 36,167, 78, 30,133, 73, 95,128,236,220, 18,188, 58,102, 28,218,182, 13,131,155,155, 27, 22, 47, 94,140,166, 77,155,
+ 98,193,130, 5, 84, 61,242,217, 71,169, 84,190, 26, 28, 28, 28,120,247,238,221, 7,122,189,126, 7,128, 95,159,124,254, 4, 3,
+ 61,228, 2, 65,168,129,101,207,223, 3,162,107,225,124, 69,169, 84,126, 16, 28, 28,220,234,238,221,187,119,244,122,253, 74, 0,
+187,237, 99,221,191,131,147,166,233,213,254,254,254,195,146,147,147,103, 1,216,133,255, 71,248,219,133,150,157,211,206,249, 47,
+228,172,184, 79,200, 63, 45,159,127,136, 45,126, 42, 40, 52, 6,161, 50, 32,226,215,212, 34,178,106,231,148, 81, 29,193, 10,222,
+ 3,133,134, 32,200, 1,161, 87,215, 34,178,254, 94,145, 9, 80,152, 87,195,248, 53, 15,132,170,190,189,236,125,190, 10,124,246,
+217,103,228,248,241,227,144,203,229, 48, 24, 12,232,219,183, 47, 22, 46, 92, 72,217,199, 16, 59,231,223,200,249,159,132,192, 94,
+ 5,118,216, 81, 43,200, 63, 53, 99,212,187, 15,204,100,111,139,107,200, 99,102,128, 70, 99,128, 77,133,142,205,161,222, 77, 53,
+ 63, 35,231, 21,228, 81,211,192,160, 57,196,108, 18,180,230, 28,106, 82,253, 57,255,130, 55, 68,130,121,255,220,118,249, 55,226,
+ 73, 81, 21, 29, 29,109,175, 20, 59,236,176, 29, 19,240,248, 78,195, 71,223,237, 66,203, 14, 59,254,229,160, 70,220,179, 0,200,
+ 40, 63,254,177,156,118,216, 97,135, 29,255, 15, 5, 23, 40, 84,191,160,173, 46, 38,193,250, 44,180, 59,101,231,172, 23, 39, 3,
+192, 17,128, 19,202,124,144, 84,108,233,173,205,205, 70, 63, 0, 86,123,125,218, 57,237,156,118, 78, 59,167,157,243,127,204, 89,
+ 27,247,191,113, 74,178,170, 93,134, 91,254,142,127, 28, 97,231,252, 83,209,247, 63, 83,118,130, 80, 16,172, 41, 63, 66,237,237,
+110,231,180,115,218, 57,237,156,255,239, 57,255,147,176, 79, 29,254,187, 32,253,215,230,156, 16,111, 0, 21, 78, 46, 99, 97,164,
+130, 33,197, 52, 0, 64, 41,174, 19,130, 4, 0, 33,229,191,167, 83, 84,157,119,163,218, 97,135, 29,118,216, 97,199,255, 10, 97,
+ 0,174, 3,240, 6,240, 34,128, 35, 40,247,170,240, 63, 21, 90, 50,215,102,222, 16,208,109, 40,158, 4, 3, 0,161,169,251, 96,
+249, 91,134,252,132,103,126,200, 42, 27, 52,119, 33, 16,239,165, 96, 30,161,205,138,127,102,103,104, 33,205, 29,134,121,186,169,
+ 94,205,201, 47,254,254, 78,156,246,151,186, 92,235,232,232,239, 40,117,113,126,201,100,177,134,136, 69,162, 52, 75, 81,201,150,
+194,194, 7,165,245,200,134, 75, 77, 63,206,155, 71,168,195,217,215, 41,145,220, 66,187, 58,136, 40, 45,180, 68,155,173,228, 3,
+138,146,201,190,125, 35, 72, 93,219,134,162,241,130, 66,165,106, 39,145,202, 59,202, 85,206,205,120, 2, 20,168, 51, 83,204, 86,
+246, 34,103,214,199, 16, 30,103,235,208, 86,175, 1, 88, 2, 0,232,217,243, 20, 66,224,128,213, 21, 25,199,164,158,183,241, 90,
+ 84, 20, 42,156,203,126, 12, 96,105, 29,178,235, 4,192, 31, 64,113, 72, 72,136, 62, 54, 54, 86,243,103,245,209,103,105,247,154,
+ 32,145, 72,101, 86,171,197,194,113,220, 51, 7,166,150,200, 29,230, 62, 21, 94,137,162, 97,212, 22,206,183,143,125,118,216, 97,
+135, 29,127,171,208,122, 17,101, 83,134,181, 47,134,247,111,249,220, 53,169, 84, 22, 0, 0, 60, 33,224, 9,160, 43, 41,138,201,
+121, 16,221, 23, 0,220, 26,133,157, 16, 74, 29,218,241,164,236,119,142, 7, 88,139, 49,185, 36,245, 74, 7, 91,114,164,112,111,
+ 62,180,103, 68,175, 97, 3, 6,188, 24,212, 58,164,117, 19, 0,184, 29,123, 59,233,240,225, 35,113, 81,167,168,253, 58, 77,252,
+129,103, 50,160, 64,186,176,125,251,182,207, 69, 71, 95, 95, 0, 96,202,179,214,160,171,171,114,234,175, 63,205,232,222,107,216,
+ 10, 5, 80,183, 7,174,212,197,249,165,193, 3, 35,219,126,248,238, 68,250,205, 25,139, 3,174,253,118,118,153,210,187, 85, 17,
+225,173,191,234,212, 35, 47,212, 20, 56,249, 73,253, 88,157,192,218, 81,112,156, 94,243, 93,103,103, 67, 65,210, 72,194,115, 35,
+ 41,138, 2, 35,150,239,115, 15,124,110,143,211, 11,239, 23, 2,176,121,199,152,131,119,203, 8, 15,111,223,253, 35,199, 77,151,
+202, 29, 61, 5, 96, 68, 0, 40,100,165,220, 67,212,238, 37,206,239,205,223, 26,246,219,173, 84,246,244, 79, 95, 26, 41,145,112,
+152, 62,251,110,237,243,233,169,169, 78,240,247, 47,251,251,235,175, 63, 67, 64,227,219, 40, 91,107, 6,172, 66,241, 15, 89, 8,
+ 1,202,132, 86, 74, 10,156,109,205,107,223,254, 47,247, 78, 75, 77, 88,144,149,153,246, 11, 45, 16,240,133,197,186,247, 93, 93,
+ 61,180,249,249,185, 61, 80,190,144,219,205,205, 77,145,151,151,103, 1, 96,249, 59,219,253,165, 55, 22,126,189,239,187,207,222,
+170,234,183,201,239, 45, 92,237,239,235,164,120,119,202,248, 42, 3,114, 63, 31, 57,254,195,115,199,183, 46,175, 85, 16, 43, 84,
+115,135,191, 53,123,222, 11, 61,251, 60,150,126,229,210, 69,236,220,240, 25,116,165,118,177,101,135, 29,118,216,241, 55,224, 72,
+185,184, 58,242,228, 15,213, 10, 45,169, 84, 22,112,249,236, 97,151, 3, 23,211, 1, 0, 17, 97, 94,248,100,209,250, 62,219,215,
+ 69,199, 1, 64,231,158, 3,154, 47,248,248, 93,252,126, 39, 23,132, 16,180,109,234,138,126,131, 71,216, 38, 60, 60, 91,116,120,
+233,165,225,163,103,204,248, 96, 80, 98, 98, 98,202,174, 93,187, 46, 0, 64,183,238,221,155, 46, 94,188,248,229, 21,206, 46,146,
+ 31,247,253,148,105, 84,223,187, 86,159,210, 74, 27, 4,250, 4, 53,107,252,234,143,223,174,167, 95,232, 59,124, 84, 10,116, 75,
+140, 89, 15, 50,109,185,214,205,205,109,154, 80, 40,116, 4,202,162,177, 87,192, 98, 33, 94, 0,192,114,188,202,185, 65, 80, 41,
+ 35,146,114, 18,137,232,110,169, 86,251,125, 73,230,189,111,106,226, 52, 89,173,173,222,155,244, 6,125,227, 65, 62, 2, 90,117,
+ 99,214, 44,249, 20, 60,103,117,158,254,241,162,151,162,175,252, 8,157, 26,231,108, 44,154,240,201, 4, 31,159,112,102,225, 18,
+101,111,138,194,235,254,157,199, 13, 89,176,109,159,176,125, 83, 7,152,172, 60,142,197,228,119,222,184,122,225,242,223, 54,190,
+120, 8,192,102, 0,167, 1,212, 42,234, 92, 92, 93,118, 76,155,189, 90,169, 51,255, 97, 37, 41, 23, 89,248,250,251,189,184,153,
+206, 35, 56, 40, 88,224, 53,109,153,114,243,162, 9,219,244,101,113,182,170,146,187,129, 0,186, 2,247, 93,240,246,252, 94,248,
+ 97,233,231,240,240,208, 65,165, 74, 3, 5, 79, 0,205,202, 79, 76, 16,231, 33, 29,192,199,185,185, 80, 44,152,136,190, 55,128,
+143, 66,129, 92, 0,191, 81, 53, 69,141, 39,236,146,247,102, 45, 15,113,111, 28,210, 49, 54, 46, 19,151,143,124, 9, 77, 78,170,
+ 83, 97, 97,222,247, 13,155,134, 18,133,163,123, 88, 81,206, 67, 56, 56,225, 33, 69,184,193,197,197,133, 57, 0,108,178, 34,121,
+121,121,205,245,241,235,212,189,162,221, 93,252,219, 22, 86,252, 70, 51,130, 29,121, 15,175,189, 91,211,245,254,193, 3,199, 47,
+249,178, 91,143,251, 55, 79,236, 77,123, 16,115,145,181, 90, 76,205,130,218,180,127,227,245, 81, 47,223,207,116, 11,213, 20,153,
+112,243,246,157,182, 75,151,126,177,244, 78,236,237,219, 42,149,147,115,227,230,161,157,130,219,244, 31, 85, 96,118, 9,180, 69,
+104,177, 44, 7, 87,175, 64, 8,165, 42,248,122, 58,162,168,212, 4,157,137,133,155, 87, 99,176, 44,107, 31,250,236,176,195, 14,
+ 59,254, 30,100,227,241,197,239, 91,106, 21, 90, 0,160,148, 9, 16,247, 48, 7, 0,224, 36, 3,166,190, 61, 22,249,121,154,230,
+102,150,199,184,177, 99,112,253,126, 54,226,146, 53, 32,132,160,185,175,205, 65,184,193,128,111, 63,110,252,184,231, 79,252,250,
+235,213,207,102,127,246, 3, 69,225, 18, 0,108,222,242,117,231, 57,115,231,188, 53,102,236,152,222,251,246,237,187, 3,160, 94,
+ 66, 75, 64,169,214, 47, 95,250,185, 56, 35,207,104,156, 54, 99, 22,255,193,251,211,214, 0, 24,110,147,146, 17, 10, 29, 51, 50,
+ 50,148, 52,253,120, 44,205, 47, 62,159,117,190,247,176, 21, 9, 41,105, 69, 55, 78, 28, 60,216,161,101,203,150,200,200,204,233,
+186,108,237,166,208, 99, 39,100,111,148,150, 24,134,233,243,238, 85, 25,180, 89, 34, 20,222,153,191,108, 99, 91,222,169, 41,253,
+201, 91,253,209,170, 73, 3,100,230, 22,161,123,223, 65,130,152,107,215,250, 0, 54, 11,173, 39,157, 7,190,100,230,115, 67, 23,
+127,127,165,215,144, 46, 13,218,211, 52, 3,173,193, 10, 77,177, 9, 28, 15,116,107,225,136,200,237,107, 5, 5, 58,235,208, 69,
+ 63,165, 15,189,180,110,128,218, 88,156,245, 14,128,253,181,216, 3, 93,124, 61, 28, 16,151, 94, 90,165,200,210, 25,203, 30,224,
+ 34,134, 3, 5,226, 90, 3, 81, 87, 0,223, 1,193,192,201,119, 70,195,211,115,151,167,167,231, 75, 30,158, 94, 49,205, 71,191,
+ 65,249, 4,180, 80,105, 13, 22,220,189,115,187,180,101,187, 88, 82, 90,144, 59,221,168, 43,220,119, 15,136, 13, 6,246,148,115,
+188,129, 26,132, 86, 66,194,189,162, 55, 94,233, 33,184,145, 84,138, 7, 10, 5, 90,117, 25,130, 98, 77,134, 48,242,141,249,157,
+ 12,165,197, 82, 87, 79,127,220,251,125, 47, 52,105,137,109,141,102,211, 1, 23,191,206, 61, 14,125,247,145,185, 54,235,150,151,
+151,215,220,183,223,126,123,158, 38,251,254,194,222,195, 86,180, 73, 73, 43,186, 49,122,254,153, 14,147,135, 54,197,177, 91, 37,
+248,124,124,143, 87, 1,212, 40,180, 24, 1,225,164, 74,175,128, 97,175,188, 51,171,129,187,116,150, 92, 70,195, 73, 33,198,175,
+ 87,114,241,227,175,233,176,178, 4,225,109,154, 53,159,250,225,234,109,222,174, 98,100,231,153,145,169, 49, 66,157,103,132, 54,
+ 95,111,178,169, 67, 80, 20,114, 53,249, 56,114,232, 8, 40,161, 20, 20, 77,193,106,177, 64, 64,211,160,104,202, 62,244,217, 97,
+135, 29,118,252, 61,168,118,215,161, 0, 0, 14, 31, 62, 76, 6, 12, 24,240,212,168,204,113, 4,113,201,101, 75,112, 24,134,193,
+139,207, 53,197,154,101,243, 97, 48,179,184,249,176, 24, 7,126, 79,135, 89, 87, 4, 66, 8,242, 90,121, 84,245,143, 31,155, 82,
+ 90,177, 68, 22,198, 72,132, 35,127,187,162,104,228,226,236,236,156,112,231, 7,221,156,247,213, 45, 4,196, 18,179,232,139,166,
+ 15, 69, 46,130, 46,123,247,238,105, 57,112,192, 0,177, 82,169,154, 73, 4,161,190, 66, 29,249,160,184,248, 86,113,117,156, 79,
+ 66,230, 17, 60,104,208,139,145, 61,189,188, 60,249,209,139,175,220, 95,255, 78,152, 95,179,166,205,186,198, 89, 13,131, 12,185,
+ 9, 7,171,185,236, 17, 39,207,243,160,105, 26,106,181, 26, 28,199,193,100, 50,193,106,181, 34, 61, 61, 69,205, 19,226,203,129,
+167,189,189,125, 33, 16,136, 17,208,200, 31, 27,215, 44,145,111,255,241, 96,199,143, 62, 91,248,139, 62, 15,225,248,195,185,229,
+ 35, 78, 99, 65,225,190,163,199,127,117, 39,136,106,240,201, 91,253,153,220, 66, 45,162,174, 37,226,250,221,244,186, 54,228,147,
+ 46, 28, 26,101,166, 38,150,172, 88,177,130, 89,112, 44, 49,189,103,191,225,156,127,147, 54,141, 76, 28, 1, 64, 65, 34, 18, 64,
+ 36,160,225,239, 46,197,207,179, 66,112,101,240, 45,207, 62, 97,238,171, 9, 33,251,107,170, 79,147,201,202, 61, 23,172, 96, 66,
+ 3, 29,113, 43,169, 16, 87,143, 93,194,180,217,171, 17,253,208,132, 82,173, 30, 20,103, 2, 67, 76,200, 75,125, 0,150,227, 72,
+109,237, 94,134,176, 66, 0,144, 72, 36, 31, 31, 56,116,188,129,137,151, 34,167,200, 4,117,161, 9, 77,195,135, 41, 82, 51, 53,
+248,110,254,203, 31, 3,216, 23, 12,148,218,192, 41, 1,208, 35,229, 97,188,213,108,230,120,163,133,163, 91,249, 57,226,155,147,
+215, 16,210,227, 21,163,152, 97,100, 42, 71, 55,128, 0,173,186,191,130,171,191,108,128,146,102,218,201, 28, 36,161, 0,174,214,
+212,151, 42, 68,214,220,185,115, 49,229,237,151,193, 19, 34,228,192,211, 0,240,213,129, 68,248, 7,120,212,212, 70,127,132,139,
+225,104,202, 98, 33, 40,213, 90,161, 41, 50, 67, 37, 21, 32, 62, 77,135,196, 84, 45, 94,238,235,131, 97,189,188,193,241, 4, 99,
+102, 94,199,240, 62,222, 24, 61,192, 23,160, 40,228, 21,154, 97, 50,115,213,150,157,166,233,198, 12,195,132,113, 28,119,189,236,
+ 59, 3, 14, 64, 73, 97, 30, 76, 38, 19, 24,134,129,179,139, 59, 0,234,177,115,121,158,127,104,235,125, 84, 79,216, 57,237,156,
+118, 78, 59,103,189, 81,157, 22,249,151,160, 90, 87, 14,116, 77, 87, 37,165, 23, 32,238, 97, 14,218, 5,251,160, 73, 35,111, 92,
+141, 47,196,142,168,116,108, 61,145,138,168,155, 26,240, 2, 21,114, 74,128,132, 20, 53, 18, 82,243,106,245,159,205, 72,132, 35,
+223,123,175,120, 70,235,150, 37,225,103,143, 77,133,143,123, 66,203,143, 62, 42,154,202, 72,132, 35,157, 27,170,118,205,154, 49,
+253, 85,149, 92, 46, 54,155,204, 8,108,236, 47,125,247,157,169,111, 80,206, 18,155, 99, 34,169,124, 90, 56, 75,100,178,111, 22,
+205,155, 41, 89,125, 32, 33, 77,103,134,110,255, 37,245,131, 15,102,205, 41, 16, 8,165, 27, 85, 62, 45,108, 94,251, 99,181, 90,
+ 97, 50,153, 96, 54,155, 97,177, 88,144,153,126,111,208,233, 3, 31,246,109,220,208,165,175, 68, 42, 5, 1, 80, 98, 96,241, 48,
+ 91,143, 30,189,122, 51,237,194,194, 90, 41,189, 91,140,175,138,171,184, 56,181,152, 39,140,234,240,207, 59,153, 61, 39,111,224,
+135,195,215,240,203,153, 27,184,122,238, 24, 75,120,235,163,248, 95, 74,239,166,205,149,222,173, 83,149, 13,218,168, 31, 29, 62,
+ 33, 53,186,103,102, 24,154,244,232, 21,113,234,237, 41,239,158,213,151,230,231,126,179,126,126,166, 38, 43,229,158, 68, 68,177,
+114, 9, 3,173,145,197,182,211, 89,120,105,201, 77,220, 77,211,130, 16, 82,107, 0,111, 30,120,127,228,248, 15, 57,171,197,130,
+ 32, 63, 37,118,110, 89,138, 65, 61, 66,209,179,181, 51, 58, 52, 81, 64, 46, 48,225,206,253, 56,236,222,185,141,229,121,250,131,
+ 90,110,196,200,242, 35, 6, 0,180, 90,237,135, 31,205,252, 64, 99,102,121, 88,172, 60, 44,229,159,167,119,127,161,225,140,250,
+ 15,203,175,139,169,116, 93,117, 55,243,186, 55, 39,127,212,227,155, 29,167,122,239, 63,159, 77,171,243, 45,136, 58,190, 15,222,
+ 13, 3, 33, 98,104, 25, 40, 0, 20, 5, 80, 20, 8, 33,112,247,111, 1, 35,207,227,167, 77,159,250,160,134,245,106, 21, 34,107,
+194,132, 9,184,119,239,222, 99,237,158,148,152,140,164,196,100,156, 58,113, 25, 0,224,226,223,182,208,197,191,109,161, 91,227,
+ 14,155,171,226, 50,115, 86,222,192,114,200, 41, 50, 66, 46,165,225,231, 35,199,208,158,222, 88,255, 73, 27,140,238,239,131, 12,
+181, 30, 19, 22,222,132,167,167, 16, 63,159,207,198,186, 93, 73,104,230,175,192,144,158, 13,240,250, 64,223,170,173,181, 2, 65,
+ 63,161, 80, 56,106,200,144,161,243, 37, 82,197,146,119, 22,238,152, 39,147, 8, 42,172,177, 96, 24, 6, 86,171, 21, 52, 77, 97,
+228,180,245,243, 36,114,213,146, 33, 67,134,206, 23, 10,133,163, 4, 2, 65, 63,251, 75,167, 29,118,216, 97,199, 95,102,209,170,
+ 56,188, 31, 27,183,171,187,194,104, 52, 36, 15, 31, 57, 6,222, 30, 94,202,193, 47,188, 46,138, 73, 42,130, 38, 59, 21,137,241,
+177,208, 27,173, 16, 57, 55, 6,164, 94,104, 20,224,143, 91,113,191, 88,214, 45, 63,162,229, 89, 83,114,117,124,131, 6,121,251,
+ 38,222,167,232,229,203,252, 46,199,199, 21,182,219, 57,251, 59,140, 30,173,116, 91,190,204,239,114,202, 3, 5, 45,151,146, 46,
+111,140, 29, 69,209, 20,193, 71, 31,205,192,224, 1,145, 24,247,198,107,212,247,223,111, 11, 47,178,177,148, 60,132, 27, 62,254,
+116,190, 88, 93,196,154,175,198,107, 77,114,133, 76,246, 91,130, 86,215, 42,192, 79,214,127,216,235, 89, 71,246,126,179, 26,192,
+ 88, 91,184, 42, 4,150,213,106,133,197, 98, 1, 0,174,204,122, 80,246,153, 95,106, 70,110,145, 9,234, 34, 19, 88,142,199,176,
+145, 99,101,215,162,111,142, 5, 80,205,122, 45,158,183,178, 86,236, 63,121, 29,153,215,246,241, 20,205, 20, 87, 90, 12, 15,165,
+119,211,230, 94, 94,126,231, 7, 12,123,205, 93, 44, 45,155,134, 45,213,153,240,253,166,101, 53,230,147,166, 40,194,115,108, 17,
+107,181,234, 2, 27, 7,102, 6,183, 12,149, 94, 60,123, 98,208,111,167,246,107,217,192,215,156,146, 82,178,193, 8, 37, 96, 68,
+ 82,152, 44,182,109, 60, 84, 39, 94,254, 18, 0, 53,126,242,140, 53,211, 63,252,132,121,127,221, 5,152,141,122,152, 12, 58,148,
+ 20, 23, 66, 38,176,226,206,239, 7, 89,194, 89,167,235,178,111,124, 89, 61, 19,149, 5, 32,171,114, 74, 65, 65, 65,212,239, 23,
+206, 31,186,242,251,133,113, 94,129,237,104,179,149, 71, 98,236, 21, 62, 51, 33,250,144,201, 84, 18, 5, 0, 20,144, 15,224, 68,
+ 77,134, 75,149,131,147,227,184, 41, 31,142,119,146, 41,232,216,140, 34,164,102,151,128,147,249,192,203,183,201, 31,243,171,124,
+ 89,121, 59, 6,185,163, 79,232,203,184,120, 59,141, 59,177,231,203,222, 0, 14, 2,208,215, 36,178, 98, 98, 98, 32, 18,137, 30,
+107,247, 38, 77, 3, 80, 49,117, 88, 84, 48,213,105,219,242,215, 1, 0, 61,159,235, 62, 1,192,219, 79,189,168,228,148,192,213,
+204,162, 83, 11, 23, 4, 53, 86, 34, 51,223, 12, 66, 9,176,247,116, 30, 18, 50,116, 56,121, 85, 3,111, 23, 49,120, 51, 13, 70,
+ 2,236,191,152,137,139,119,242, 48,166, 95, 67,220,127, 88, 80,141,176,102,194,222,255, 96,198,130,181,107,215,157, 25, 62,121,
+249, 75,221,194, 2, 81, 82,170, 69,102,129, 21, 90, 93, 41,116, 90, 29,100,114, 57, 36, 98, 49, 24,129, 0,253,222,248,252,165,
+163,223,125,122,246,253, 15,102, 44, 88,181,114,197, 28,150,101,143,217,199, 67, 59,236,176,195,142,191,212,162, 53,161,114, 90,
+181, 66, 43,245,238,197, 14, 0,208,188,125,159,124,165, 84,224, 34,160, 41,168, 51,146,240,253,138,105,224,121,130,254,111, 45,
+135, 42,192, 11, 50, 17, 3,147, 54, 95, 91,144,116,174,166,181, 58,160, 40,107,239, 47, 55,103, 6, 76,158, 20,232,176,115,167,
+ 86, 8, 0, 59,119,106,133,147, 38, 54,116,248,106,115,114, 64,167,231,218,129,112, 28, 6, 12, 30,142,145,175,140, 68, 74,142,
+ 30, 63,157, 79,131,206, 96,182,105,183,156,204, 45, 56,212,205,213, 61,242,189,215, 35, 21, 2,134,162,154,249, 59, 50,233, 26,
+ 43,203, 48, 66,238,208,181,226,172, 97,195, 94,113,139, 58,186,167, 39,231, 22, 28,106,200,187,127,179, 54, 62,147,201,244,216,
+212,161,139, 91,227,163,189,135,175,200,200,206, 41, 61,146, 83,104,236,164,179,178, 80, 23,153,144, 91,100, 66,145,206, 2, 47,
+149, 51, 88,171,185,117,117,124,132,144, 31,134, 12, 31,243, 26, 0,154,162,217,239,180,217,247,227,203,126,249, 67,100, 69, 14,
+ 30,237,126, 62, 38, 9,137,209,199, 10, 9,207,150,121,113,167,248,140,154,235, 21,132,161,192,139, 4,148,149,161,105,222, 98,
+209, 90, 61, 60,220,163,206, 69, 29, 31,104,100, 31,128, 17, 73, 30,157,107,120,124, 58,170, 54,177,181, 1, 0,214,174, 91,179,
+178, 75,239,209,162,115,215,147, 97,176, 2,157,195,154,227,231, 31,191, 54, 17, 98,253, 80,151,125, 99, 67, 29, 58,161, 83,195,
+134, 13,167, 9,197,226,158, 50,185,170,161,187,183, 31,109, 97, 57, 88,172, 28, 20,174, 62,180, 68,233,210,155,167, 69, 23, 89,
+139, 57,202,162,211,172, 5, 80,173,190, 62,121,249,110,207, 77,107, 87,190,228,237,170, 64, 67, 55, 17, 14,157, 43,228,172, 2,
+158,246,240, 15,162, 0,192,207,195, 1,119,175,159,197,173, 91,183,209,186,115, 36, 92, 85,190, 80,138, 56,146,151,248, 91,129,
+167,151, 79, 91,117, 78,166,232, 73,161,229,229,229, 53,119,204,152, 49,243,188,189,189,177,102,205,154, 71,233,149,219, 61, 4,
+232, 84,121,234,240,171, 3,137, 53, 22,248,141, 1,141,240, 92,168, 7,120, 30,120,119,245, 45,196, 38,149, 96,203,199, 97, 24,
+214,195, 7,155,127, 73, 70,155,102, 10,104, 13, 60, 44,102, 14, 34, 49,141, 22,141,149,144,136, 24,156,185,158,135, 82,157,174,
+ 70,110,138,145,160,119,143,206,200, 43,210,195,221, 81,140,198, 13,221,161,148, 55, 70,169,129, 69,106, 78, 49,138,117, 86,228,
+ 21,234,208,181,115, 71,252,186, 93,108, 31, 2,237,176,195, 14, 59,254, 30,171, 22, 80,201,135,214, 99, 66,235,240,225,195, 4,
+ 0,170,154, 31,205, 84, 23,192, 85, 41,128,123,131, 0,188, 58,109, 37,126, 88,253, 62, 56,206, 10, 66, 0,150,179,205, 51, 1,
+ 33,194,147, 83, 38, 5, 4, 55, 10, 96,220, 95, 29, 45, 55,236,216,169,151,189, 58, 90,110, 8,105,237, 90, 60,101, 82, 64,114,
+169,209,175, 43,203,113,248,237, 78, 46, 98,147,139, 17,155, 82, 2,165,204,118, 55, 95,140, 88, 52,105,217,210, 37, 34, 1, 67,
+ 81,119, 82,181,218,140,124, 86,203, 8,133, 22,185, 76, 76,204, 68, 96, 74,201, 35,249,189,134,188, 97, 56,180,125,237,120, 0,
+239, 84,107, 21, 43,223,105, 88, 97,201,170,248, 36,132, 16, 10,224,121,138,227, 50,242,140,208, 90,172, 80, 23,254, 33,180, 40,
+182,250,153, 83,165,119,211,230, 14, 42,229,113,134, 97, 36,132, 0, 86, 11,251, 50,188,155,246,213,102, 39,198, 87, 22, 89,151,
+239,100, 33,233,198, 41, 53,103,209,143,209,231,198,157,182,181,236, 20, 5,194, 48,224, 25,154,226, 41, 10,188,144, 38,102, 16,
+194, 63,153, 35,125, 29,132, 86,133,216, 18, 11,153,217,191,238, 94,237, 49,238,197, 22,248,241,124,153,230, 51,150,106, 74,116,
+153,117, 18, 89,112,117,117, 29, 59,115,230,204,185,131,134,143, 70,177,145,130,186,176,204, 26,104,182,242, 16, 41,220,208,123,
+202,183, 13,179, 53, 37, 13, 19,175, 30,234,154,119, 99,103,177,213, 88,188,166,218,124, 37,101, 93, 53,232,117, 40, 49,148,149,
+103,198,216, 32,230,179, 47, 79,130, 37, 2,184,184,251,192,221, 65,132,215, 95,238,135,243,254,141,112,239,254,125,204,158,127,
+ 4,158, 78, 14,177,151,206, 30,108, 18, 22,222,109,213,209, 3,187,158, 18,113, 57, 57, 57,243,183,111,223,142,208,208,208,121,
+237,218,181, 67, 78, 78, 78,133, 64,126,212,238, 73,137,101, 6,219, 10,161,117,253,250, 45,132,133,181,169,182,204,173,155, 56,
+ 96,223,153, 44,124,123, 56, 5, 50, 9,131, 0, 31, 41, 38, 45,187,129, 30,109,221, 48,117, 68, 99, 40,101,254, 40, 42,181,194,
+108,229, 97, 48,177,200, 47,177, 32, 51,223,136,116,181, 1, 22,107,205,107,225, 9, 8, 98,227, 51, 96, 50, 25,225,236,236, 12,
+165,220, 8,169,147, 31, 0, 6,133,234,226,178,221,135,122, 35,228, 50,137,125,232,179,195, 14, 59,254, 53,168, 73,139,252,139,
+172, 90, 79, 91,180,106, 42, 16, 33, 64, 66,106, 30, 26,249,186,195,183, 81, 19,196,223,187, 85,105,176, 7, 88,206,182,233,168,
+131, 7,179, 51, 86,174,116,224,223,127,191,184,243,178,101,126,151, 38, 77,108,232, 24,210,218,181,120,230,204,180,206,171, 86,
+ 57, 94, 58,121, 89,200,145,114,127, 93, 21,190,185, 8,169,139,143, 77,186, 99,104,203,198,204,252,157, 9,105,167,111,151,230,
+138, 68, 34,171,151,179,148, 82, 41,197, 12, 67, 11,197, 38, 43,109,106,222, 42,140, 57, 68, 83, 97, 53,177, 84, 8,173, 39,167,
+ 14,243, 53, 73,131,126,253,105, 70,200, 11, 67,150,187,100,106, 12, 40, 54, 51,143,166, 14, 25,154,194,237,123,169, 0, 35,138,
+173,138,211, 65,229,114, 98,215,142, 31,252, 86, 45,251, 28, 22,150,195,148,247, 63,195, 27, 99,199,156,128,119,211,190,126, 1,
+ 65, 49, 23, 14,125, 39,239, 59,113, 35, 82,227,162,115, 88, 83,201,238,186,136,172, 71, 98, 11, 32, 28,225,233,130,194, 18,165,
+137,133, 20, 85,232, 62,147,133,175, 87,207,209, 26, 88, 28,186,146,131,195, 7,118,195, 81,165,168, 23,135,163,163, 99,139,238,
+221,159, 7, 37, 16,195,108, 53,193,204,242, 48, 87, 90,163,101,177,242,176, 18, 33,228,222,109, 80,112,247,231, 22, 48, 22, 87,
+203,245,218,107,125, 10, 90,182,110,183,247,211,247,223, 26, 49,226,213,113,232, 20,254, 28,226,110,253, 14,207,134,193, 80, 58,
+185,145, 75,201,133,108,231, 96, 63,193,216,193, 29,168, 40,223, 64, 4,180,232,130,132,187,215, 90,139, 68,162,219,105,137,247,
+171,157,146,204,201,201,169,240, 57, 53,175, 93,187,118, 72, 75, 75, 67, 65,165,118,111,210, 52, 0, 0, 16,127,191,108, 19, 67,
+133,200,226,249,170,251,233,132, 37, 55, 80, 98,224,224,230, 44, 6, 67,209, 0, 33,104,228, 45, 67,116, 66, 1,198,204, 47, 68,
+120, 75, 23,248,121,203, 1, 66,160, 53, 90, 97, 54,243,176,240,128,217,200,130,161,171,221, 50,200,113, 28,199,209,196,202, 92,
+143,141,135, 88, 36,132, 99,145, 14, 50,153, 12, 34, 81, 30, 40,154, 6,203,242,176, 88,173, 48,232, 13,216, 27,125, 25,132,179,
+ 48, 28,199,113, 40,159, 6,181,195, 14, 59,236,248, 39,226, 95,188, 16,190,178,184,170,222,162, 85, 19,252,125, 61,113, 37, 54,
+ 25,173,131, 27,195,209, 65,133,251, 73, 25, 96,104, 33,104, 10,176,178,182,139, 33, 98,177,254,184,106,149, 35, 82,147, 21,244,
+ 87, 27,147, 3,166, 76, 10, 72, 94,181,202,241, 18,177, 88,127, 4, 48,134, 16,160, 76,108,149, 9, 46,174, 14,186,128,240,214,
+134,158, 46,114, 38,250,129, 46,159,166, 25,147,171,163,148,119,117,148,208,174, 42,177, 80, 36,100,120,150,208, 22, 95,143, 0,
+ 35,225,121, 91,226,234, 61, 54,117,200,113, 28, 40,138,230,202,133,152, 34, 61,223,128, 98, 35, 3,117,145, 9,133,165, 22, 52,
+243, 81,224, 84,212, 62, 61,103, 53,236,172,210,218, 38, 20, 57, 54, 9,240,197, 39, 11, 87,193, 96,226,144,144,169,133, 72, 34,
+241,242,244,106,117,115,204,228, 89,146,119,183, 36, 97,124, 79, 87,188,127, 33, 41, 83,175,150,206,170, 75,203,114, 28, 7,131,
+209, 44, 82,231, 21, 58,151,148,234, 28,100, 82,137,193,221,197, 49,175,170,115,141,230,250, 61,103,229, 82, 1, 6,134,123,193,
+104, 25, 5,131,137,197,239,167,247,215,135,166,177,103, 3, 95,104,205,149,196, 85,185,216,170, 44,186,132, 74,119, 0, 84,227,
+218,138,125,247,118,204,203,119,111,199, 44,184,118,233,220,174,101,223,156, 14,217,190, 97, 14,214,255,146, 4,134, 97, 40, 98,
+101,133,107,127, 73,134,175, 19, 67,180, 86, 33,101,228, 40,232, 10, 52, 8,234,216,175,213,174, 47, 63,157,133, 50,151, 17, 38,
+ 91,196, 86,161, 58,250, 81,187, 31, 63,246,104,223, 2, 10,111,110, 43, 74, 58,179,190, 76,226, 51,130,125, 85,171,118,139,217,
+195, 81, 76, 56,214,194, 87,246,104,229, 40,163, 64,120,224,218, 29, 53,174,199,211,112,117, 16, 65, 41, 19,194,202,242,208,155,
+ 89, 24,140, 28,205,179, 22, 83, 53,237,125,125,237,154,213,115, 70,141, 26, 53,105,247,158,121, 7, 67, 35,223, 27, 84, 82,148,
+ 15,161, 88, 6,145, 64, 4,154,161,193,114, 28,204, 70, 29, 10,139, 10,144,252,219,247, 7, 71,142, 24, 26,182,118,205,234, 57,
+ 21,187, 20,237,176,195, 14, 59,236,248,203,172, 89, 79,193, 38,161,165,148, 75, 65, 24, 41, 46,196, 36, 33,168,101, 27,108, 59,
+120, 21, 77, 91,135, 35,187,148, 5, 1, 93,235,110,195, 10,204,248,216,112, 29,192,245, 65,131,228,190, 67,135,250,244, 38, 68,
+120,114,227,230,146, 12, 0,104, 28, 82, 70,195,243, 4,132, 0,132, 47, 19, 92,182,155,116, 4,169,201,217, 37,141, 2,188, 20,
+184,155, 97, 49, 41, 36, 34,218, 89, 33,102,220, 29,197, 34,145, 64, 0,142, 80,166,236,236, 36, 19, 5,164,216, 66,247,228,212,
+161, 92,233,125,180,215,144,229,154,148,180,226,232,102, 5,250,208, 98,139,179,110, 80,142, 0, 0, 32, 0, 73, 68, 65, 84, 24,
+132, 0,205,124, 20,136,189,124,132, 83,103, 38, 38, 24,212,113,155,170,182,146,129,177,176, 60,110, 62, 40, 70,145,206,138, 34,
+173, 5, 93,123, 12, 20,117,141, 24,132, 11,177,121,224, 89, 43,150,125,125,164,148, 35,214,145,192, 61,107, 29, 10, 77, 95,185,
+126,199, 87, 83,168,147, 8, 5,130,162,224,166,254, 15,197, 34, 33, 91, 82, 82, 34,126,252, 44, 6, 10,153, 24, 5, 90, 43, 0,
+ 88,235,218,123,138,117, 86, 28,188,156,131, 67,251,119, 65, 38,147,129,212,163, 7,138, 68, 34, 39,161, 72, 10,139,174,108,186,
+176,226,176, 60,113,208, 2, 9, 64, 11,156,108,164,189,103, 54, 27,126, 79,142,187,220,130,235,209,148, 25, 27, 17,128,215, 38,
+ 76,135, 79,147,214, 24, 56,112, 40,218, 4,168,168,253,151,210, 96,181,178,165, 94,129,173, 84,164,108,151,109, 2,128, 80, 0,
+151,109,177,108,169, 42,181,123,139,174,129,161,127, 8, 45,160, 32,245, 70,141,187, 88, 57,115,126,166,222, 76,211,132,240, 85,
+190, 50, 8, 1, 16, 51,160,206, 38,200, 1, 32,160, 1, 1, 67, 3, 20,197,112, 28, 87,101, 59,177, 44,251, 43,207,243,234, 29,
+ 59,118,168, 57,142,187, 30,115,100,229,205, 38, 47, 76,156, 7,182, 0, 86,107,217,114, 70,177, 68, 14,158,162,145,116,254,219,
+121,156,197,240,203,142, 29, 59, 42,220, 59,220,182,143,133,118,216, 97,135, 29,127, 9, 42,199, 56,124,177,178,248,178, 73,104,
+113, 60,129,155,171, 11,172, 68,128,100,117, 49,116,148, 7,140,122, 2,142,163,192, 17, 82,147,171,241, 8, 84,177, 61,255,224,
+193,236, 12, 0, 91,159,176, 73, 61,178,100, 61,250,172,122, 74,166, 74, 78,138,112,167, 14, 30, 59, 59, 98, 80,183,158,206,247,
+179,115, 50, 68, 66, 90, 32, 16, 49, 66,145,128,166, 68, 2,218,236, 32, 19, 48,251, 54,239, 22, 19, 10,103,107,227, 52, 26,141,
+136,136,120, 60, 48,121,220,157, 75, 30, 5,185, 9,102, 66,241,188,187,184, 20,110,142,238,120,152,146,134,211,199,246,235,213,
+153,137,113,156,201, 56, 24,143, 75,206, 63, 56, 9,225, 11,138, 77, 48, 90, 56, 20,106, 45, 40,210, 89,192,186,119,198,207,191,
+103, 65, 42, 98,160,190,185,207,160,201,201,152,102,202, 77, 76,174,165, 41, 62,194, 99,190,180, 72,198,155,227,198, 10, 87,175,
+ 88,102, 10, 11,107, 71, 10, 10, 10,160,213,106,255,168, 19,138,130,212,193, 3, 42,153, 0,137,215,142, 34,241,244, 42, 3,128,
+ 79,109,169,207,202,112,144, 11, 48,168,147, 23, 76,150, 81,200, 43, 54,225,218,217,159,107,235, 50, 79,113,202,229,114, 89,133,
+245,170,178, 91, 7,115, 37,171, 22, 87,222,222,180, 64, 34,171,130,179, 55,128,147, 79, 38,150, 20, 23, 31,185,126,233,212, 36,
+227,132,215,160, 46, 50,193,144,159,132,239,127,222,116,218, 82,154,208,163,207,234, 21,244,244,193, 77,112,250,122,129,234,182,
+128, 1,120, 32,114,212,140,151,142,239, 90,177,189,182,178, 87,136,173,231,187,117,152, 71, 51,212, 33, 66,253, 33,150,178,178,
+178,108, 42,123,177, 58,177,220,130, 84,167, 57,112, 80, 20,205, 16,254,177, 24,136,143,229,147,231,249,219, 21,162, 73, 64, 81,
+131, 85,114, 57,242, 52,197,168,112,178,107, 52,148,194,197,173, 1,104,138,130,181,210,185,117,109,247,122,192,206,105,231,180,
+115,218, 57,255,191,226,169, 24,135,117,176,104, 17, 4,122, 43,208,212, 71, 1,163,197, 3, 70, 51, 7,157,145, 67,137,222,130,
+ 18,189, 21,201, 57,122,196, 30,124,246, 28,150, 89,177,202, 92,159,147, 50,127,155,224,120, 98,179,245, 68,108, 49, 47, 92,185,
+108,241,203,187,195,218,154,223,125,209,187,225,173,100,115, 22, 69,209, 6,154, 17, 88, 93, 84, 2,225,253,251,183, 52,151,206,
+ 31,237, 46,101,185,215,244, 53,240,176, 44, 91,236,227,227, 83,241, 64,123,148,222,162,137,108,240,111, 71, 62,106,252,252,160,
+101,238,171, 63,159,161,167, 25, 17, 79, 9, 68,177,156,213,176,203,160,142,219,136, 26,236,122,180, 72,122,239,202,141,187,225,
+ 78, 46, 13,145,152,169,131,206,200,194,194,242,112, 86,138,144,113,251,132, 37,249,126,244, 30,109,214,173,109,245,168,182,157,
+241,247, 98,125, 35, 35,251, 14, 15, 15,239,204,204,153,243, 25,130,130,130, 96, 48, 24, 64,211, 52, 26, 54,106,130,228,248, 27,
+184,124,100, 33,167,207, 79,217, 4, 96, 1,128, 58, 7, 92,206, 43, 49,227, 88,116, 46,142, 28,248, 17,140,176, 94, 59,216,104,
+153, 76, 38,173, 74, 92, 85, 22, 93,143, 78, 22,138,165, 40,179, 62,241,143,117,196,170,113, 60, 41,254,238,189,215, 95,125,165,
+133,202,209, 9,253,135,142,204,189,116,225,244,128, 3,223,111, 94,147,159,146,254,242,103, 75,214, 57,244,110,239, 77,185, 40,
+197, 40,210,241,216,153,122, 47, 16, 54,218, 96,115,114,114,230,167, 39, 71,143,249,237,200, 71, 3,159, 31,180,204, 61,250,167,
+217,143, 22,209,211,140, 96, 71,109,215, 23,164,199,156,174,171,200,170,144, 90,132, 16,155, 38,206, 9, 0,161, 72, 12, 15, 15,
+111, 80, 20, 96,101,121,152,173, 44, 4, 66,251, 78, 67, 59,236,176,195,142,191, 25, 19,158,248,180,205,162,101, 52, 26,147,159,
+139, 24, 8,158, 39,224, 8,192,115,229,150, 39,254, 15,235, 19,103, 53, 38, 63,107,238,120,158,187,186, 97,203,214,254, 97, 29,
+159,103, 90,250, 41, 81,146,159,131,203,191,157, 97,193,147, 75,182, 92,159,159,159,160,149,121, 54, 29,254,242, 75, 67,247,142,
+ 29, 55,177,168,123,143, 30, 10, 15, 15, 47, 83, 70,102,134,254,219,237, 59,172, 39,142,254,210,157, 7,251, 74,126,126,162,182,
+ 38,158,226,226,226,181, 85,165, 75,196,202,174, 0, 26, 51, 2,202,108,208, 36,212,105, 69,120, 94,102,250,176,197, 11,231,165,
+140,126,107,186, 56,208,167, 9,114,139, 25, 36,103,228,224,254,249, 95, 76,153,241,215, 14,148,100, 92, 31,111, 35, 85,118, 21,
+105, 25, 0, 86, 95,190,124,169, 85,100,100,100,223,158, 61,123,146, 9, 19, 38,128, 16,224,244,150, 73,164, 32,249,242,190,114,
+ 43,214,131,122,182, 75,234,249, 75, 55, 92, 70,116,111, 47,112, 85,141,199,214, 31,143, 90, 65,248,212, 58,210,120,250,250, 53,
+ 18,148, 77, 23,150,185,116,120,242, 48, 91,255, 88, 63, 38, 82,122, 10,244,136,245,172,166,188, 79,105,141,196,248,187,173, 19,
+227,239,142, 3,144,187,119,199,215,135, 0,192,100, 48, 76,140, 58,125, 48,245,238,157,232,215, 6,189,250, 65,147, 86,161, 29,
+ 4,251,182,173,134,197,168,219, 15,192,230,254, 42, 17, 51, 41, 21,237, 94,219, 84,225, 83,237,158,114,249, 40, 69, 51, 2, 91,
+ 69, 83, 37, 75, 36, 77,120,222,166, 5,117,132,231,144,249,224, 54, 92,188,252,160, 82, 57,130, 39, 22,192,108,130, 38, 61, 14,
+ 28,103,143,117,104,135, 29,118,216,241, 55,161,254,107,180,210,239,149,249,211,250,171, 81,154,147, 59,102,219,182, 31, 22,253,
+176,125,119, 87,163,217,236, 67, 32, 74,231, 88,243, 57, 45,135, 57,182,114, 24,212,137,209,174,174,205, 66,190,253,122,195,167,
+223,110,253,234,121,240, 92, 48, 5,164, 16, 10,103,165, 86,110,108,109, 34,171,198,135,102, 94,233,230,222,195, 87, 24,242,243,
+181, 63,212,245, 90, 67,126, 92, 14,205, 88, 26,110, 94,179,112, 57, 77, 51,125, 56,142, 23,242,156, 53,145,179, 24,191, 48,104,
+226, 14,194,230, 85,110, 40,168,225,183, 59, 0,238, 68, 69, 69,117,139,138,138,234, 8, 96, 45,202, 98, 40, 70, 63, 75,187,152,
+242, 75,123,125, 56,227,195,211, 31,128,242,231,121, 2,150,227, 83, 69, 6,125,175, 58,210, 52, 12, 12,108, 34,183, 88,185,167,
+ 22,192, 87, 94, 8,255, 72,104, 57,250,202, 1, 52,180, 81,104, 1,101,187,233,190,126, 42,145,101,151,102,103,165,255,184,241,
+139,105,111, 3, 8, 0,112, 17,192,134,191,171,221, 45,198,146,188,191,250,190, 97, 45,166,249, 25,183, 14, 34,235,142,200,155,
+ 18,148,185,114, 32,156, 25, 60,107,206,102,173,150,249,246,177,207, 14, 59,236,176,227,111,179,102,109,169,234,187,224,159,146,
+195,194,194, 7,165, 40,172, 57, 72,175, 45,200,207, 79,208, 2,120,106,231,158,254, 25,121, 99, 19, 74,126, 66, 66,201, 79,245,
+189, 94,151,251, 80, 3, 60, 28,251,140,217,176,101, 33,251,133,242,227, 79, 65, 94,222, 61, 29,242,208,233, 89,155,101,231,142,
+237,247,119,239,254, 81, 72,104, 70,200, 19, 70,196, 18, 74,200,242,148,208,106,229, 97,178, 88,173, 22,150,181,130, 99, 45,224,
+ 57, 43,225, 45, 86,148,121,135,255, 51,144, 10,224,227,255, 85,187,255, 29, 96,173,150,249,176, 90, 0,232,236, 67,157, 29,118,
+216, 97,199, 63, 75,112,253,115,132,150, 29,255,105, 60, 72, 74,140, 15,183, 87,131, 29,118,216, 97,135, 29,255,113,145, 85,249,
+ 19, 64,217,218,243,136,106, 46,168,203,110,130,136,122,100,232,148,157,243,153, 57,133, 0,196, 0,148, 0,106,155,218,234,139,
+186, 59,172,252, 95,148,253, 35, 0, 55,236,237,110,231,180,115,218, 57,237,156,255, 89,206,218,184,237,187, 25,255, 98, 1,102,
+231,180,115,218, 57,237,156,118, 78, 59,167,157,243,255, 31,231,191, 25, 19,170, 56, 0,216,167, 14,237,176,195, 14, 59,236,248,
+127, 8, 87,215,102, 74,224,209,186,222, 90, 33,119,107,225, 9, 0,250,188,123,106,123,237,217, 81, 5, 42,199, 57,124,108,141,
+ 22, 93, 79, 66, 33, 45, 16,127, 40, 87,185,222, 83, 56,186,102,254, 63,175, 92,170,121, 35,197,212,222,221, 3,126, 14,106, 44,
+ 27, 92,151, 11,229,238,205,191,243,106,210, 41, 77,225,209,124, 42,188,195,100,207,146, 9,133, 71, 99,119,101,195,246,191,169,
+124, 90,245,251, 11,202, 40,105,217,178,101,231,150, 45, 91,118, 6,240,167, 68, 41,150,123, 52, 31,229,219, 52,252,188, 71, 96,
+219, 51, 10,207,102, 47,253,217, 25, 86,122, 55,117, 85, 54,108,247,147,178, 65,155, 66,165,119,155, 18,165,111,187,115, 42,183,
+ 22,129,181, 93,215,112,208,226,224,249,187, 98,119, 53, 28,180, 56,184,170,223,157, 35,215,169,230,238, 78,248,220,117,224, 23,
+ 74,251,184, 82, 63, 52,236, 58,202,201,251,249, 15, 92,235,122,157, 79,243,240, 59,141, 90,117,203,109,208,172, 83,172,173,215,
+248, 6,117,190,238,223,178,171,218,183,121,231,104,123,205,219, 6,169,123,227,206, 82,103,191, 35, 18,103,191,163, 18,151,198,
+ 61,158,149,207,219,219, 91, 22, 28, 28, 28, 25, 30, 30,254,118,175, 94,189,222,107,219,182,237, 4,127,127,255, 62,255,203, 23,
+125,185, 71,243,143, 77, 66, 42,207, 36,164,242,228, 30,205,107,221, 44,163,240, 8, 90, 68,209, 92, 22, 69,115, 89, 10,143,160,
+ 69,255,148,182,146,120, 54,247,151,123, 52, 95,165,242,106,121, 85,230,209,108, 96, 93,175,119,118,118,238,227,238,238, 62,164,
+226,112,118,118,238, 99,191, 3,234,141,202, 86,172,103,182,104, 49, 66,137,252,226,232,113, 83, 66,150,206,155, 37, 93,179,245,
+103,172,249,124,198, 93,147,174,168,229, 63,177,228,110,141, 59, 70, 51, 52,227, 91, 57,141,227,185,140,188,135, 87,219,255, 25,
+252, 65,141,100,227, 63,157, 57,230,253, 81, 47, 71,248, 71, 12,152, 70,197, 61, 52,252, 98,187, 68, 67,232,158,159, 14, 52, 60,
+127,246,204,186,173, 91,183, 44,208,176, 65,171,132, 18,193,134,146,244, 59, 69,117,201,131,131,123, 96, 99,129,194,237,252,115,
+131,167,120,197,156,218,177,141, 51,243,189,245,121,149,162,127,215, 31,238, 77,154, 52,233,192, 48,140,235,212,169, 83, 69, 0,
+176,122,245,234,166, 28,199,229, 39, 37, 37, 93, 67, 61,156,159,150, 9,204,160, 49,107,151,207,255,161, 95,191,254,200,202,211,
+ 97,217,170, 47, 95, 56,126,120,207, 8,157, 58, 97,223,159,209, 38, 78, 78, 1, 14, 16,169,110, 79,155,185,192, 35,242,133, 14,
+140,214,200,226,248,249, 27,221,118,124,185,224, 42,208,162, 99,105,222,189,106,125,138,241,250,226,217,158, 74, 18,201,235,139,
+ 1, 96,212, 83, 15,123,165, 53,194, 93,198, 69,122, 75, 4, 55,242,129, 90,131, 62, 58, 53,234,122, 66, 40,145,248,211, 52, 13,
+154, 2,104,154, 2, 67, 81,101,113, 66, 45,134,212,204,251, 23,250,254, 19,238, 19,149, 95,199, 28, 48, 2, 87,154,250, 35,127,
+ 20, 93,254, 73, 72, 73, 78,194, 69,215, 63,225,223, 56,134, 52,117,106,213,181,169,238,219,115, 15, 11, 20,130,238,239, 29,161,
+ 8,253, 85,218,133, 85, 55,109, 18, 0, 82,169,243,161, 67,135,220, 35, 35, 35, 29, 61, 90, 13, 62,103,203, 53, 98, 70,219,242,
+240,225,131,162,200,200,190,117,232,159,205,123,131,166,183, 83,128,144,231,201,106,134, 39,123,180,249,241, 73, 64,221,162, 79,
+201, 60,130,198,211, 32, 54,143, 51, 60,168,104, 67,110,220,214,250, 86,174, 64,226,208, 75, 40, 18,189,215,184,121,235,176,204,
+148,196,104,157,182,116, 21,107, 42, 62, 87,103, 34, 43,251,225,169, 11, 49,253, 4, 66, 33, 21,217,171, 19, 99, 2,206, 60, 75,
+163,123,122,122, 14, 89,191,126,125, 96,231,206,157, 1, 0, 44,203, 58,236,221,187,215,107,225,194,133,138,248,248,248,253,245,
+164,245,113,119,119,247, 19,139,197, 62, 0, 96, 54,155, 51, 53, 26, 77, 26,128, 90, 95,252, 21,158,129,110, 32, 88,112,225,252,
+121, 1, 0,116,235,214,125,145,223,115,239, 56, 51, 34,165,161,202,234, 48,151, 42,138,146,206, 76,191,124,229, 18, 5, 0,225,
+157, 58,207,146,187,181,216,240,191,180,108, 73, 61,130, 58,209,192,251,225,221, 34,134,141,124,101, 12,221,170,153, 31,250,244,
+238,249,145, 1, 56, 84,167, 62, 35, 16,200,174, 94,189,218,132,166,105,134,101, 89, 99,120,120,120,218,179,228,171, 65,243,206,
+191, 83,160, 27, 90, 88,243,215,154, 7,209,139,128,167, 2,199, 48,142, 13,195, 62, 5, 35,120,139,231,249,244,210,180,232, 46,
+255, 65,139,214,211,245, 92, 87, 38, 90, 32,126,111,212, 27,147, 67,166,127,240,137,116,218,154, 40, 28,249,114, 86,222, 63, 85,
+100, 1, 0, 67, 51,190, 39,126, 61,225, 33, 23, 51, 0, 0,173,145, 69,191,200,200,218,159, 8,141, 58,158,165, 41, 42,168, 34,
+148, 56,199, 90,164, 2,161,216, 72,149, 9, 36, 80, 0,220, 26, 52,138,242,100, 47,202, 71,189, 28,225,191,125,247,201,140,180,
+140,252, 58, 15,106, 20, 35, 66,120,247, 62,136,232,221,215,241,234,149,223, 23,108,217,180,241, 99,214, 98,221,200, 91,249, 85,
+198,130,196,172, 90, 7,115,175,102,237,196, 74,183,227,195,222, 94,232,106,164, 93, 48,231,243,181,110,231,143,237, 60,151,153,
+ 30,202,167,166,166, 27, 9, 69,221, 45, 44,200,126, 79,151,147, 20,103,107,149, 41,149,202, 64,165, 82, 25,218,166, 77, 27,233,
+140, 25, 51,132, 47,188,240,194, 31,146,125,194, 4,209,217,179,103,189, 87,172, 88,209,255,214,173, 91, 70,173, 86,123, 83,171,
+213, 62, 64, 29, 22,218,123,121,185,191, 51,124,232, 64,244, 28, 54, 5, 28, 79, 97,194,228,233, 56,113,108,255, 68, 0,127,138,
+208,178,202, 29, 22,190,245,246, 12,247,240, 14,109,153, 5, 59,227, 32, 19, 11,208,183,125, 16,245,198,212,217, 78, 91,215, 45,
+248, 6,121,120,190, 42, 75, 22,175, 47,158, 29,226,102,126,101, 80,231,198, 56,184,203,252, 10,122,205, 4, 45,119, 92,148,126,
+240,147,251, 0, 16, 24, 57, 85, 37,225, 52,235, 27, 56, 49, 30, 18, 78,179, 62, 48,114,234,169, 7,199,215,151,214,148, 23,161,
+ 68,226,191,107,231,206,102,206, 42, 17, 4, 52, 5,134,161, 32, 96,104, 24,205, 28, 70,188,252,202,159,214,205,101, 30,205,250,
+211,101,193,178,193, 3,223, 25,114, 19,142,214,165, 77, 40, 70,228,122,248,224, 1,129,135,163, 4, 12, 67,129,161, 1,134,166,
+144,162, 54, 96,252,248, 55, 28,159, 85,176,247,235,234,209,225,195,145, 65,125,195, 67, 92,218,252,120,137,114, 12,239, 55,210,
+ 53,207, 40,127,125,247, 47,103, 94, 33,221,166, 95, 33,132, 95,158,113,113,237,175, 53,145,152, 76, 38,117,223,200,126, 14,148,
+ 64, 33, 63,245,243,182,238, 2,154,130,149, 35, 96, 57, 2,174, 60, 54, 42, 85,254, 6, 67,211, 20, 8, 79,240,214, 91,227,209,
+ 55,178,159,158,103,249, 12,219, 7, 57,122,251,241, 83,191,185,155,172, 60, 86,172,223,186, 64, 87,172, 89,240,240,190,107,138,
+182, 56,111,186, 33, 55,193,230, 56, 24, 52, 72,251,244, 7,177,111,239, 60,124, 25, 33, 45, 91,128,227,203,242, 25,228,171,192,
+206, 35,151, 17, 28, 20, 92,150,111,158,160,121, 67, 37, 58,180,239, 0, 60, 21,154,204, 86,145,165,154,243,252,139, 99,230, 15,
+ 24, 49, 14, 30,238,238,160,137,117,192,169, 35, 59, 7,124,247,213,242, 15, 89, 99,201,138, 58,145, 17,238,209,115,129,240,252,
+ 51, 91,157, 26, 52,104,224,222,161,195, 31,238, 24, 89,150, 69, 64, 64, 0, 50, 51, 51,131,234,243,158,230,237,237,253,226,220,
+185,115, 61,250,247,239, 47,244,242,242, 2, 0,228,228,228,248, 28, 63,126, 60,108,238,220,185,185,217,217,217, 71, 80,131, 71,
+ 31,206, 74,139,104, 1, 24,169, 84, 94, 86, 70, 80,244,140,119, 94,107,227,233,221,160,202, 64,238, 26, 77,142,120,230,148, 51,
+148, 64, 32, 42, 63, 31, 52, 33, 60, 85,131,149, 40, 66, 40, 20, 86, 57, 67, 97, 97, 28,194,137,208,241, 77,154,161,203, 58, 43,
+107,213, 20,166, 93,111, 81, 7, 75, 92, 43,161, 88,180,113,248,200,113, 93, 94, 26, 54, 24,222,238,142, 56,117,241, 22, 38,190,
+243,190,149,181, 88, 87,213,107,240, 96, 24, 65,110,110,110,138,179,179,179,215,179, 63,111,169,198, 39, 79, 28,243, 56,117, 58,
+106,214,202, 53,235, 38, 89,204,172,149, 39,228, 81, 28, 99,153, 76, 34,236, 61,224,101, 7,143, 38,225,210,117,115,223, 20,254,
+ 7, 45, 90, 91,254, 20,161, 37,150,169, 94,254,108,230, 84,233,194, 29,151,113,228,203,137,121,250,146, 60,247, 71,111, 10, 14,
+ 78,215,117, 37, 69, 97,245,201,161,210,189,121,103,138, 17,188, 77, 49,140,130,162, 41, 49,207,241,233,172,217,188,200,144,159,
+144,253,172,165,231,121,130,159,126,207,173,155, 0, 34,104,186,253,199, 3, 30,158, 78, 18, 24, 45, 28, 70,142, 26,131, 31,126,
+248, 65,229,238, 40,134,209,204, 98,249,202,149,165,218,148, 35, 30, 41,233,133,153, 17, 3,223,255,245, 65,114,110,108, 90,182,
+113, 79, 93,243,102,178,112, 40,209,179,208,155,104, 52,107,213, 1,203, 87, 5, 75,211, 82, 31,190,191,237,187,111,222,189,123,
+151,249,129,103,232,249,198,236,123,233, 85,222,116, 94, 33,125, 29,156, 93,119, 13,125,251,115,167,132, 92, 1, 8, 44, 72,114,
+144,226,229,215,223,117, 8,244,146, 65, 33,101,156, 30,166,102,122,207,248,240,195,139, 15, 56,210,177, 68,243,224, 97,109,249,
+105,212,168,209,176, 1, 3, 6,200, 63,248,224, 3, 97,195,134, 13,241,221,206,189,254,221,250,142, 24,152,149,173,110, 72, 8,
+129,167,135, 71,250, 91,111,140, 56,116,244,232,209,212,244,244,116,225,178,101,203, 58, 29, 56,112,160,101, 78, 78,142,205,111,
+166, 28, 33, 48,154, 56,112,229, 15, 72, 77,177,169,206,250,212,199,199, 71,146,153,153,105,170,100,101,160,254, 48, 20, 82,125,
+123, 61,223, 73,176,249, 88, 50,180, 70, 14, 10,169, 16,201,106, 61,218,183,109, 77,125,205,177,161, 85, 17,142,127,249,197,217,
+158, 74, 18, 57,168,115, 99,120, 56,203,241,237,134,207,113,240,210,195, 72,181,150,194,122,194,188,237, 45, 17,244, 86,240,217,
+235, 95,104,223,196,171,103, 59,127, 92,107,223,196,235,124, 76, 92,188,108,196,202,169,153, 90,225,169,194,227,239,150, 86, 61,
+240,208,112, 81,137,176,245, 68, 42,228, 82, 1, 20, 82, 1, 20,146,178, 79,154,166,158,237,173,214,187, 69, 67,134,231,198, 51,
+140, 96,252, 43, 47,143,104, 48,250,149, 17, 4, 12,141,189, 63, 29, 26,188, 99,199,246,108,171,197,252, 13, 71, 51, 91,171,235,
+ 63,143, 85, 40, 13,120, 56,138,241,225, 55,177,112,144, 9,161,146, 11,225, 32, 23,162,103, 27,119, 48,116,189,179,232, 60,113,
+112, 96,255,137, 67, 27,245, 8,242, 83, 54,187,153, 84,124,119,252,162,232, 53,103,139,122,188,183, 97,117, 75, 87,109,145, 89,
+ 48,103,198, 91,130,140,172,172, 30,123, 15,157,235,201,153,199,197,177, 22,221, 39,154, 91,123,171,180, 10,103,196, 93, 10,243,
+ 9,127, 73,106,209, 90,111,223,140,203,104, 82,104,146,224, 78, 74, 9, 20, 82, 1,148, 21,117, 43, 21, 64, 33, 21, 66, 41, 21,
+ 32, 43, 35, 25, 5, 58,230, 98,166, 43,221, 3,231, 46,213,201, 77,190,209,194,225,198, 67, 45, 26, 5,181,133,183,119, 3,152,
+251,191,218,232, 74,212, 79,191, 92, 61,247,243, 18,125,206,253, 79,108,229,217,121,248, 50,102, 77,127, 59,134, 2,174,151, 63,
+164,195,230, 44,253,178,221,130, 89, 83, 30, 75,155, 49,127, 93,187,250, 91,178, 84,179,123, 14,157, 60,191, 91,239,161, 40, 45,
+ 80,227,247, 95,247,160,239,128,225,120,117,220, 52, 56, 57,185, 45, 95,181,104,230, 77,214, 84, 18,245,212,152,235, 21,252, 92,
+235,144, 22, 59,124, 26, 52,104,200,243,101, 81, 62, 8, 1,180,165,197,152,249,222, 91,224, 9, 65,104, 88,199,158,210,110,189,
+ 9, 41,143, 6,146,151,159,167,139,187,127, 55,194,152, 27,119,197,230,186, 52, 26,173, 26,141, 6, 55,110,220, 64,124,124, 60,
+238,220,185,131,252,252,124, 56, 58, 58,106,117,186, 58,249,126,115,104,211,166,205,232,168,168, 40,169,179,243, 31, 65, 26,204,
+102, 51, 84, 42, 21, 70,143, 30, 45,236,211,167,143,207,139, 47,190, 56, 54, 54, 54,118, 39,128,146, 42,243, 83,144,152,165,242,
+ 12,218,244,252, 11,207, 79, 2, 0,153,131,247,195,245,223, 29,186, 83,227, 11,173, 99, 3,255, 46, 93,186, 54, 1, 33,160, 64,
+214,234,243,227,115,106,176, 18, 41, 46, 95,190, 28,200, 48,140,224,143,103, 16,143,175,190,253, 49,248,228,133,219,195,150, 46,
+ 95, 33,117, 80, 72,160, 41, 54,227,205, 87,135,218,252, 12,150,121, 6,245,239,210,165,251, 47, 11,230,127, 38, 80, 42, 20,248,
+245,202, 3, 76,125,239, 67, 99,118, 74,236, 10,194, 11,191,212,107,226,115,159,241, 81, 73,240, 39,160,153,175, 18,170, 65,125,
+165, 19, 95, 27, 36, 53, 91, 57, 20,233,172, 48, 89, 56,112, 60, 65,177,206,138,187,105,165,112,115,168,123,136, 48, 66, 72, 7,
+ 0,238, 0, 52, 20, 69, 93,171,252,189,226,133,174, 66, 27, 63,241, 61,175,252,249,224, 10,192,140,178,157,250,143,186, 79,249,
+247,234,210, 43,174,191, 11,160, 69, 57, 39, 7,224, 42, 69, 81,133,213,136,173,167,172, 92,130,195,135, 15,147, 1, 3, 6, 60,
+ 26,241,159,252,254, 36, 36, 34, 97, 3,133,163, 59, 8,185, 7,138,250,227, 52, 15, 47,159,252, 21,171,214,184,188, 51,249,237,
+212,146,162, 2,255,242,228, 83,182, 60, 44, 4, 20,179,234,249,174,225,125, 38, 77,158,140,160, 64, 95, 17,199,113, 36, 54,254,
+161,117,219,214,111, 95, 63,127, 73,188,166, 36, 35,118,118, 37, 19,100,157,182,125,114, 60,151,241,164, 5,139,227,185, 39,223,
+110,159, 14, 82, 77, 1, 78, 74, 49, 54, 29, 75, 6, 33, 0, 5, 2, 71,133, 16,187,207,102,224, 97,204,254,146, 1,161, 37,186,
+209, 75,231,245,236,209,255,221,168,187, 73,198, 61,185,185,198, 19, 0,114,106,226,172,122, 64,231, 97,178,112,176,178, 44,246,
+ 29, 58,132,200,158,157,208,165, 75, 39,116,239,214, 69, 16, 29,115,107,220,228, 73,111, 53,196, 31,187, 59, 30,113, 74, 61,155,
+118, 80, 58,186,237, 25, 54,105,153,234,118, 6, 11, 1, 3, 52,246,146,193, 69, 37,130,153,165,144,162,177,148,223, 57, 78,152,
+ 58, 99,190,203,172,247, 39, 29, 45,209,136, 67,128,123,150,154,202,174,215,235,197, 99,198,140, 17, 90,173, 86,203,232, 55,167,
+245,201,201,209, 12,254,106,237, 23, 18, 15, 15, 79,232,141, 44, 98,238, 36,182, 88,176, 96,126,227, 67,199,207,254, 60,239,195,
+137,191, 68, 70, 70, 58,254,248,227,143,124,109,245,249,216, 27,162, 58,111,195,183, 59,246,253,176,122,197, 98,196,165, 22, 98,
+235,230, 47, 65, 56,118, 83, 45, 85, 85,153,147,140, 25, 51, 70,246,243,207, 63,251,102,100,100,148,232,245,122,205, 99,246, 8,
+154, 18,168, 11,244,112, 83,137, 33, 18,208,240,116,150,194,195, 81, 2, 33, 3,208, 20,197, 85,197,185,117,207,145, 69,188,190,
+ 24, 7,119,153, 95,249,118,195,231, 24,247,206,167,136,205, 19, 31,167,229,142,139,166,188, 50,108,150,187,140,139,108,224, 68,
+123,244,108,215, 8, 10,169, 8, 31,191, 59, 6, 29, 99, 82, 60, 50,139,248, 79, 53, 6,166,237,252,227,143,130,117,159,122,220,
+ 56, 82,102,193, 82,201,133, 56,190, 99,121,174,174, 88, 83, 92, 49, 37,103, 54, 25, 83,109,236,198,167,170,120,179,157,213,182,
+117,171,207, 39, 77, 24, 79,119,237,220,145,208,180, 16,121,165,102,138, 16,224,189,169, 19, 49,101,226, 91, 94,233, 89,185,115,
+190,252,114,211,236,168,147,100,161, 78,115,127, 94, 77,156, 52, 85,102, 5, 82, 74, 5, 80,202,202,132,139, 82, 42,128,209,204,
+129,162,192, 56,249,133, 21, 83,101,150,220,172,130,212,106,223,192, 31,227,116,241,107,117,250,228, 67, 85,112,225,158,194, 75,
+201, 89,119, 22,197,220, 82, 95, 5, 80,208,176,187,211, 88, 11, 75,160, 53,178, 72, 86,235,193, 90, 8, 53,174,159, 63, 2, 94,
+162,130, 22,127,123,253,135, 99,183,224, 80,105,208,127,140, 51,243,242, 62,163,107,200,208,145,171,215,109,190,182,226,243, 79,
+153,188, 98, 51,120, 66, 32, 21, 51,144,137, 5,229, 7, 3,131,174, 24, 95,110,252, 58,135, 5, 53, 12,231,206,177,117,233,159,
+224,201,171, 67,251,119,223, 77, 1, 98,138, 22,101, 52,240,111,228,223,107,224,235,210, 94,131,198,128, 99,205,179, 98, 46,144,
+ 51,250,220,184,211,182,112,134,180,108, 1, 10,184,174,203,141,159, 8, 0, 10,143,230,155,130,131,130,219, 61,153,214,180,105,
+ 80, 59, 91,218,253,145,165, 84,170,122,199,217,197,253,211,160, 86,109, 61,212,133, 38, 74,229,234,139,228,132, 27,216,181,113,
+206,118,222,104,158,127,250,200,158,207,215,108, 61,240,114,175,200,161,248,246,171, 47, 62,206,207,126, 36,180, 78, 85,178, 86,
+189,186,237,155, 45, 13,133, 98, 9,172, 44, 15, 43, 71,202, 62, 89, 14, 5, 5,133,176,178, 60,164,114, 21, 88,158,130,149,227,
+ 97,101,121,152,204,172, 98,226,152, 23, 39, 27,129, 43, 85,229,211, 39,248,249, 19, 34,137,196,159,160, 44,118, 45, 33, 4,201,
+ 57, 6,218,219,219,123, 39, 0, 72, 36, 18, 72, 36, 18,240, 60,143,152, 56,205, 59,110, 65,205, 39,161, 92,224,113, 22,115,106,
+ 81,202,111,125,171, 43,187,151,151,215,192, 39, 69,150,209,104,132, 86,171,197,133, 75,215, 28,191,249, 97, 95,100,114,106, 70,
+ 32, 79, 28, 77, 42,143,192,190,165,185, 15, 6, 86, 87,159,165,234,184,201, 14,225,111,209, 31, 76, 25,219,116,221,182,195, 87,
+ 19, 79, 44,170,113,157, 86, 64,175,143,204, 31,188, 61,188,253,210,181, 91, 19, 10,127,219, 52,189,182, 54, 18, 8, 4, 66,141,
+ 70,243,232,254, 94,255,245,174,246,215,227, 50,135,172, 89,189, 70, 26,243,160, 20,183,147,179, 48, 54,194,175,236, 13,199,134,
+118, 87,120, 6,186, 53,110,210,100,231,151,107,151, 10, 18,178,140,216,176,255, 42,162,126,217,116, 33, 39,247, 74, 36,212,217,
+134,250,140, 33,127,130,208,170,150,243,204,173, 60,104,141, 44, 76,102, 22, 86,158,160, 68,111, 69,110,145, 25, 37,122, 11,180,
+ 6, 22, 99,123,251, 85,121, 93, 45,122,196,157,162,168,195,132,144, 1,132,144, 8, 0,226,138,239,101,207,108,234,112,185, 32,
+123,236,251,172, 89,179, 62, 89,178,100,201,157,138,115, 43,210, 43,206,173, 41,189,210,245,174, 31,127,252,113,200,210,165, 75,
+ 23,119,238,220,121,247,239,191,255,254, 16, 64,161,173,211,135,130,202,133, 57,124,248,112,109, 21, 29,104,177, 90, 36, 14, 50,
+ 33, 26, 7,248,225,141, 79,190,117,251,126,233,248, 92,169, 88,192, 28, 59,118,204, 37,223,172, 4, 77, 51, 54,191,162, 40,221,
+155,117, 17,137,196, 71, 86,174, 92,137, 87, 6,118,147,165,229, 89,181,183,210, 12,106,157, 25,172,135,123,115,241,162,197, 75,
+149, 75,151, 45,159,114,248, 32, 95,164, 85,223, 93, 94,245, 20, 95,251,104,134,170,180, 6,139,162, 64,120, 46,163, 48,229, 90,
+123, 0,120,150,181, 88, 90,163, 21, 76,249,218, 26,138, 2,244, 70, 22, 12, 67,229, 22,197,237,185, 59,122,225,162,158,219,119,
+159,204, 34,180, 83,169, 78,151, 44, 71, 89,204,193, 58,195,104,230, 96,178,114,184,115, 51, 6,221,195, 91,162, 75,251, 96,232,
+141, 28,244, 38, 22, 1, 77,130, 0,192,173,202,134, 99,232,135,132,179, 26, 9,225, 84, 3, 58,184,195,195, 73, 12,111,103, 9,
+ 36, 98, 1,172, 44, 96, 48,243, 48,154, 57,164,228, 26, 80,106,144,161,245,243, 35, 26,187,122, 71,155,114, 82,100, 63, 23,164,
+ 69, 15,171, 81,156,114, 28,182,237,220,215, 52, 43, 75, 61,248,232,207, 59, 36,154, 18, 43,110,165,232,144, 91,100, 2, 24,119,
+204, 93,188, 65,242,209,244, 9, 67,182,237,250, 41,181, 87,183, 78,169,117, 45,179, 94, 19,183,125,207,222,125,155, 6, 12, 24,
+ 34,187,115,229, 40, 18,110,156,254, 92,151, 91,167,245, 89,116,104,104, 40, 59, 97,194,132,210,197,139, 23, 55, 60,120,240, 96,
+128, 70,163,185, 1,192,234,228,228, 20,220,188,169,255,205, 95,143, 31,243,121,113,200, 8, 97, 70,158, 1,142,114, 17,252, 61,
+228,184,116,225,132, 85, 44, 22, 86,185,222,164,124,122,112, 20,122,205,196,193, 75, 15, 35,239,228, 75,207,190, 53,126,108,234,
+175,231,227,242,215,255,240,235, 23, 62, 74,235, 13, 41,175, 89, 31,221,190,137,215,172,169, 99,176,100,221,118,156,139,137,203,
+213,209,222,159,103,155,216,147,213,155,210, 1, 1, 67, 65, 37, 19, 66, 87,162, 41, 78,186,126,188,249,159,100,166, 30,251,235,
+207,219,233,130, 82, 43,210,243,140, 84, 86, 65, 41, 56,158,192, 73, 46, 2,203, 19, 20, 21,228, 81, 59,182,255,128,107,215, 46,
+209, 96,232, 55, 1,204,171,177, 66,169,178,169, 66,165, 84, 88,102, 17,146,149,125, 90, 57, 30, 65, 77,155, 96,203,250, 85, 14,
+110, 30,158,120,174,187,237,107,163, 85,174,254,161,187,191, 91,143,179,191, 95,127,225,220,154, 13, 29,148, 13,220,215, 81, 20,
+183, 2, 4, 70,147,133, 67,113, 81, 33,196,230,116,116,244,209,192, 69,206, 33,165,196, 27,177, 57, 9,202,218, 6,252,252,216,
+ 3, 55, 40, 50,100,246,190, 67, 81, 75,250,246,126, 1,177, 41, 37,144,137, 5,144,138, 25, 72,197, 12,132, 20,135, 85, 27, 55,
+ 89, 11,139, 75, 7,228,223,249, 37,175, 30,253,243, 84,249,219,111,153,184,227,180,238,219,215,205,254,254,173,153,203,250, 70,
+ 14,125,157,138,189,118,230, 19, 61,112,218,182, 23, 61, 98, 83, 26,207,219,254,140,147,170,220,214,190,251,209,162,119,251, 12,
+ 24, 1,134, 17,192,106,181,226,167, 31,183,227,187, 13,115,239,155,181,249,175, 3,224,205,185,204,132, 61,219, 55,142,152, 57,
+103, 21, 21, 18,218,177,211,153,236,167,195,123,254, 31,123,231, 29, 21,213,213,181,241,231, 78, 99, 26,189,131,130, 21, 4, 11,
+ 40,246, 94,163,198, 30, 53,193, 18, 49,177, 39,198, 36,198, 68,141, 38,106,212,104, 76,236, 45,177,197,168,177,247,142, 13, 91,
+140, 10, 40,138, 40, 72,239,157,233,125,230,158,239, 15,192, 88, 40,131,229,123, 83,206,111,173, 89,112,135,225,153, 91,207,125,
+238, 62,251,236,195,114,153, 95,198,140,155, 20,234,225,225, 97,247, 87, 68,139,160, 81, 64, 19,244, 27, 52, 12,103,143, 30,198,
+131,216, 24,176,164,212, 48,177, 44,129,172,164, 40,215,108, 50,108,175,180,199, 67, 36,170,179,237,215, 29,254, 28, 14,243,100,
+ 2,249,207, 63,250,192, 48,249,179,175, 59,245,235,221, 53,214,134, 11, 69,106,122,142,227,141,232,184, 32,150,111,235, 51,110,
+198, 10,129, 78,111,129, 92, 99,194,169,173,149,123, 29,145,147,111,251,186, 45,251,141,155,252,205, 38,161,144,203, 49, 54,109,
+228,147,220,181, 93,211, 12, 95,111, 87,229,119, 75,215,181,185,118, 51,186,223,123,163,198,137,194, 2, 91, 50,222, 46, 98,187,
+ 15, 70,189, 19,108, 49, 27,199,104,138, 51, 42,173, 47,200,151, 56,201,124,235,249,105,254,138, 24, 53, 58,196, 16,212,127,198,
+121, 48, 72,214,230,197, 15, 5, 0, 47,111, 95, 29, 95,104,175,172, 65, 4,134, 0,192,154,205,187, 91,221,141,207,158,176,114,
+229, 42, 73, 84,146, 18,119,146,228, 16, 10, 56, 48,154, 88, 48, 86, 6,181, 89,194,157, 52,103,246, 44,251, 18,181, 5, 17, 49,
+ 5,136,141,188, 68, 12, 42,221, 40,137,217,126, 40,220,237,198, 0,104, 8, 32,145, 97,200, 47,234, 60,207,163,192,229, 26, 79,
+116,202,178,165,207,203,246,110, 13,234, 91,120,194,126,124, 27,105,123,134, 33, 77, 25, 2, 39,128,100, 21,151,221, 83,173,117,
+106,234,188,120, 44,251,254, 91,172,222,114, 24,217, 69, 58, 56, 88, 50,112,116,235, 34,124,177,228,119,104,245,149,103, 53, 84,
+231, 71, 42, 50, 70,207, 27,174,242,223,203, 63,183,100,201,146, 1,207, 29,155, 1,149, 28,179, 23, 62, 87,254,255, 75,151, 46,
+253,254,169,191,107,172, 53, 89, 79,140, 86,249, 70, 85, 99,182, 26,185,121,213,249,227,232,145, 67, 78, 37, 42, 35, 68, 2, 46,
+124,235,249, 97,254,218,163,110,111,183,114, 69,161,209, 1,187, 55,253, 84,172,211, 40,247, 90,213, 88,184, 7,180, 21,219, 74,
+ 79, 29, 58,120, 24, 13,124,221, 5,187,174, 22,167, 68, 39,107,159,132,122, 21, 5,105, 54,245,236, 53,188,161,239,188, 35,185,
+112,241,210,103, 42,160, 66,163,197,101,184,181, 55,239, 56,232,110, 39,230,131, 97, 0,165,214,140, 9, 99,134,189,250,109,140,
+176,220,113, 99,195,192,148,153, 44, 69, 81, 46,190,158,249,145, 78,106, 74,120,144,158,154,158,213,107,224, 23, 23, 20, 42, 70,
+ 23,250,254, 71,183, 31,196, 47, 41,209,104, 94,110,146, 31,189,193, 2,189,145, 69, 82, 82, 34, 62, 15,123, 11,124, 46, 7, 92,
+ 46, 91,154, 44,109,174,252,100, 84,101,199, 23,195, 83, 48,124,231,242,169,155,189, 61,220, 93,108,165, 98, 98, 43, 17, 50, 77,
+ 3,253, 5,237,218,117,176,169, 23, 16, 44,184, 26,167, 69,122,129, 22,201,217,114, 8, 61, 90,240, 70,244,120, 27, 59, 87,205,
+232, 86,156, 30,201,193,139, 73,138,207,112, 46,226,207,129, 91, 54,174, 20,230,201,140,120,152,174, 66,110,137, 14, 57, 37,122,
+228, 22,235, 96, 43,230,163,203,160,137,194,147, 71,127, 25,216,179,115,219, 53, 47,179,221,201,201, 41, 39, 83,179,114,222, 13,
+ 14,105,131,157,191,253,218,217,209,177,158,189, 76,150,162,176,246,232, 44, 90,180,200,102,233,210,165,188,181,107,215, 42,218,
+181,107,231, 57,123,246,236, 62,249,249,249,183,234,214,173, 27,112,246,208,246,139, 45,186, 12,110, 13,214,232,214,185,107,119,
+129,144,229, 33,252,196, 9,227,190,189,187,138,180, 90,229,228, 42, 13,135,196, 97, 81,158,138,129, 91,173, 90,177,182, 54,150,
+183,120, 28, 89,124,201,153,105, 59, 74,128, 67, 13,250,126,114,254, 82,228,163,248, 86, 81,169,238, 23,163, 30,231, 23,107,140,
+141,146,206,124, 81,101,195,203,101, 24,240,185, 28,216,137,121,224,148,181,170,182,222,193,143,193, 48,110,229,145, 83, 6, 76,
+217, 79,128, 97,144, 93,146,126,199,138,156, 13,134,176, 4,120,148,169,134, 74, 87, 26,154,175,237, 42, 65, 65, 94, 38, 54,172,
+217,142,232,200,219,232,253,246, 32,172,223,188, 11, 19,198,188,171,171,238,233,135,195, 41,139,104, 61, 21,205,178, 21,243, 0,
+ 48,144,169, 77, 56,120, 45, 3, 13,235,115,172,190, 49, 0,128,157,173, 4,114,165, 22, 28,129, 29, 18,163, 78, 73, 78, 95,186,
+ 57,123,238,194,149, 95,150,228,196,164, 63,190,119, 21, 1,174,114,212,175,101, 68,108,174, 61, 34,139,234, 33,192,175, 1, 56,
+130,219, 86,105, 23,198, 6, 45, 59,202, 57, 56,160, 85,139, 38,237,235,184, 59, 66,107,176,148, 69,181,184,248,117,219, 14,164,
+166,100,142, 43,122,112, 52,250,117, 56, 90,117,126,114,129,208,221,239,227,123, 55, 47, 36,191, 51,234, 99,120,213,242,109, 46,
+ 75,191, 99,229,205,203, 58, 83,101,177,210,104, 9, 36,142,179, 63,159,243,195,180,222,253,135,227,207,171, 23,112, 39, 54, 17,
+109,219,182,198,219, 67, 70, 64,169, 40, 14,220,191, 99,213, 91,102,141,242, 44, 79,104,158,214,166, 67, 15,134,181, 88,144,240,
+240,126, 98, 69, 90,218,156, 71,119,110,228, 60,178,127,166,123,202, 53,176,185,173,131,243, 29,189,209,130,172,172, 76, 92,255,
+ 35, 34, 68,155,243,168, 70, 5,132,133, 2, 46,194,163,243, 97, 44,155,195,180, 75,215,183, 12, 2,142,190,243,226,149,219,169,
+ 20,239, 5, 0, 0, 32, 0, 73, 68, 65, 84,218,229,100,231,112,164,246,174,172,115,173,198, 2, 47,161, 81,127, 55, 73, 46, 48,
+154, 88, 52,240,150, 86,169,233,230,237,247,253,140, 25,159, 55,230, 10,196, 80,170,245,134,156,236, 44,207, 77,187, 47,169,226,
+ 30,222,171, 85,219,221,193,254,135, 85,191, 8, 20, 58, 6,249,114, 61,138,149, 10,102,212,164,175,188,183,172, 91, 50,186, 42,
+163, 85, 65,186, 72,253,147,225, 87, 3,157,236, 4,140, 74,103,102,139, 20, 70,203,168, 33,175, 54,232,178,204,100, 77, 92,185,
+ 98,149, 36, 58, 73,137,187, 73,114,136, 4, 92,216, 8, 56, 48,152, 88, 88,121, 57,113, 60,221, 61, 39,119,104, 21,132,179,119,
+ 10,193,229,114,160, 85,150,104,120, 40,138,111,213,173,183,164,101,155,118,232,222,173, 43, 30,199, 63,242, 61,113,236, 96,207,
+ 27,215, 47,231,154,141,141,166,170, 11,226, 15,215, 40,176,160,209,112, 77, 54,158, 31,120,213,170,219,113,232,136, 15, 28,234,
+248,214, 98,220, 93, 93, 96, 38, 60, 76, 28, 51,204,234, 43,191,212,152, 3, 75, 23,206,134, 94,111,128,155,163, 13, 8, 1,182,
+173,153, 15,131,193, 0,111, 23, 33,228,234,202,103,147,171,206,143, 84, 22,133,170, 81,238,201, 83,102,172,170,247, 25,134, 57,
+ 49,107,214,172,175, 1,144, 89,179,102,125, 93,190,188,100,201, 18, 45,128,236,106,186, 14, 55, 61, 99,180,202, 55,174,242,171,
+ 91, 16,224,234,226,117, 35,252,236, 25,135, 35,119, 89,252,121, 56, 18,253,219,122, 65,192,227, 64,226,224,141,187, 41,114,156,
+ 60,180, 81,118,116,207, 47, 89,122,189,254,199,234,251,154,253, 90,217, 74,164,103,127,219,185,151,117,117,113,225,108, 8, 47,
+ 72, 42, 82,154,159,116,105,197,223, 60,198, 70,158,221,228, 69,192,156, 17,137, 68,126, 6,131,193,169,186, 3,187, 45, 60,173,
+ 44,137,151,121, 29,109, 43, 24, 46,215,178,115,215, 78,184,218,219, 64,111, 98, 49,235,203, 79,181, 97,189,109,101,163,222, 27,
+209,163,123,191,105, 23,249, 82,255, 11, 29, 66,252, 73,139, 22, 45,100, 92, 46,215,170, 84, 10,119,119,247,249, 28, 14,103,164,
+141,141,141,157,193, 96, 80, 26, 88,157, 68,173, 51, 64,103, 4, 52, 26, 29,248,130, 82,179,200,231, 50,208,234, 12,208,104, 13,
+ 85, 95, 24,185,247,175, 1,104,164,120, 42,166,116, 33,174,129,205,239,251,143,126, 58,252,189,208,185,181,154, 15,177, 77,201,
+145, 67,192, 24,209,186,177, 23, 46,157, 57, 76, 50, 83,227, 63,175,206,100, 1, 64,126, 65,177,143,155,155, 7,162,147, 85,200,
+ 42,210, 34,183,204,100,229,148,232,161,212, 42, 17, 92,199, 27, 50,185,220,231,165,247, 47,112,248,236,217,179,239,246, 27, 28,
+138,105, 95, 46,232,180,117,227, 79, 49, 82, 27,254,135,234,188,132, 8,107,140,214,253,251,247,139,103,206,156,217,112,243,230,
+205,156,209,163, 71,107,131,130,130, 68,239,191,255,126,167, 29, 59,118,136, 36, 18,145,246,238,213, 99,115,199,127, 50,107,240,
+166,213,139,154,151,148,148, 48,102,147,233,180,177,164,100,150,170, 26, 51,151,113,236,235,135,243,146,140, 99,223,234,236,118,
+204, 89,194,105, 42, 36,134, 17,104, 60,127, 47,226,230, 27,147,206,172, 85,138,223, 93,254, 73,182,140,157,163,227,184, 47,174,
+206,100, 1, 0,135,203,192, 96,182,192, 78,204, 7,135,195, 41, 55,241, 94,191,238, 61, 45,113,115,176, 1,159,203, 1,143,203,
+ 64,161, 49,161, 80, 97,196,199, 31, 88, 91, 33,132,176,102, 11,129,214, 96,134,166,236,233, 80,169, 40,196,236, 47,167,227,237,
+129,239, 96,252,228,233, 40,209, 2,145,201, 74, 24, 77,166,106, 47, 10, 14,195,129, 70,111,198,135,189,235,160, 88,101,132, 90,
+107,134,193,204, 66, 98,195, 3,159,199,129, 84,196,131,189,132, 15, 16, 34, 40,111, 76,248,124,190,206,100, 50,237,172,226,137,
+ 30,245,124, 60,160, 53,113,208, 38,244, 39,244,106,223, 8,177,215, 14,242, 46,255,121,175,254,103, 95,206,193,167, 19, 6,226,
+192,195,134,112,118,175, 3, 91,169, 24, 38,194, 1, 64,172, 76,216,155,207,114,140,239,140,252,121,243,182, 71,223,125, 59, 75,
+ 36, 83, 51, 16, 10,184,184,120,225, 60,110,220,140, 92, 93,248,224,232, 78,188, 70,248,132,227, 97,111,111, 15,145, 13, 23, 6,
+163,222, 96,125,234, 2, 1, 1, 66,164,238,141,126, 46,123,226, 15,177,176,168,224,189,234,141, 22, 79,100, 63,107,234,151,223,
+125,223,187,255,112,132,159, 56,128,253, 7,246, 90,218,247, 29,199,221,245,235, 70,116,234, 53, 8,157,122,135,226,244,225, 29,
+211,213, 44,211,100,226,180,185, 11,187,244,232,135,240,147, 7,144,151,155,185,220,218,245,229,242,153,105, 61,222, 26, 8,157,
+193,130,206, 61, 7,224,204,241,195,159,160,108,144,133,245, 55,177,231,218,103,112,204,211, 63,159,198,207,151, 25,248, 5, 10,
+ 3, 50, 11, 52, 72,201,211,224,232,158,173,196,250,246,194,208,186, 75,112,109,254,196,101, 23, 51,124,106,123,233,249,122,173,
+ 56, 62, 49, 41,112,252, 7, 97,252,250,126,129,156,124,185, 30, 5,114, 61, 10,229,122,168,116,102,248,213,246,231,152,204, 76,
+251,154, 30,103, 87, 7, 27,254,250,227,201,176,151,242,209, 33,240,229, 7,218,178, 44,251,151,201, 90, 89,106,178, 98,146,229,
+ 16, 10,184, 16, 10, 56, 16, 10,184, 48, 91,136, 85, 15, 46, 98,247, 70,253, 62,158,250,145,183,193, 12, 20,201, 13,224,113, 25,
+184,187, 58, 73, 91, 55, 31,137,109, 63,125, 2, 0,152, 48,115, 3,198,127,248, 62, 26, 55, 13,130,172,164,196,115,228,240,126,
+ 43, 1, 28,182,118, 93, 79,133, 71,248,134, 95,137,158,249,241,140,121,182,239, 13,236,206,189,147, 36, 71, 78,177, 30,137,241,
+202, 26, 69,222, 0,192,108, 97, 65, 64,176,125,239, 9,136,109,120, 40,144, 27, 65, 8,193,162,181,251, 96, 39,230, 35,167,164,
+180,187,191, 42,170,244, 35, 85, 68,164,106, 16,109, 28,128,210, 92, 46, 55,107, 35, 90, 75,150, 44,137, 93,178,100, 73,133, 17,
+178,167, 76,214,203, 77, 42, 45, 16, 72, 3,237, 93, 92,255, 12, 63,115,202,238,240, 93, 11, 46,221, 45,194,240,206,181,161, 42,
+ 78,199,143, 95,190, 87,204,128, 24, 56, 92,174, 76,175,213, 28,210,106,213,139, 1, 24,171, 60,105, 60, 27,133, 72, 69,182,231,
+215,111,250,205,236,234,238,142,157, 87,139, 51, 75,212,102,211, 95,221, 86, 38, 38,242,236,166,250,102,214,212, 87,151,247,248,
+118,117, 79,226, 44,129, 96,201,198,163, 0, 8, 88,150, 5, 97, 89,240, 69,182, 82,215, 6,237,242,202, 26, 58, 17,143,195,232,
+158,110, 1, 8,107,206, 44, 76,174, 58, 12,202, 0,112,144,240,177,247,114, 22, 0,228,113,149, 81,113,163,222, 43,237, 46,212,
+ 25, 68,138,166, 13, 27,146,214,173, 91,203,196, 98,171,202, 95,113, 61, 60, 60,110,205,157, 59, 55,112,252,248,241, 66, 27, 27,
+ 27,152,205,102,231, 95, 54,109, 98, 55, 45,158,128,161,159,172,135,192, 70, 8,173,206, 8, 62,159,135, 18,185, 10, 50,133, 6,
+ 74,141,169,230,103, 80, 82,146,161, 0, 88,118,228,176,205, 59,125,108,131,219,216,112, 4,104, 25,224,133, 75,103,143,144, 63,
+207,108,155,160,205,143,255,205,202, 19, 17, 42,157, 9,217, 69, 58,100, 21,233,144, 91,162, 67,110,177, 30,185, 37, 58, 48, 12,
+ 3,157,193,252, 74, 55, 46,117,254,163,253, 59,127,219, 50, 72,111,196,136, 46,189,223,193,244,121,235,235,236,252,121,233,249,
+100,194,233,104,101,162,173, 37, 54, 54, 54,245,131, 15, 62,104,190,123,247,110,110,179,102,205,180,113,113,113,146, 50, 19,105,
+180,181,149,136,183,174, 91,114,182, 77,155, 54,123,179,226, 31, 94, 40,235, 79,175,182, 97,175,211,117,172, 80,108,140,158,232,
+ 43,237,208,167,129,167, 4,190, 82,101,159, 64,219,187, 63, 22,245,248,244,251,130,139,171,243,115,244,230,115, 5, 90,110,139,
+ 44, 21,223,170, 28, 60,147, 94,151, 54,116,248, 8,112, 25, 14,140, 58, 77, 90,249,201,229,238, 96,131,249,187, 30,194, 86,196,
+135,157,152, 7, 91, 49, 31,157,154, 56,163, 6,237, 25, 49, 89, 88,104,244, 22,104,245,102,232, 12,102,184,250, 56, 97,243,206,
+253, 72,207,215,226,232,237, 66, 60, 74, 83,194,191,182, 20,132, 84,223, 76,178, 22,147,122,224,176,209,118, 92, 14, 3, 46,135,
+225, 52, 9,108,132, 98,149, 17, 2, 30, 7, 2,145, 24, 82, 33, 15,246, 98, 62, 4, 2, 62,242,243,243,161,215,235,225,235,235,
+ 43,170,218, 10, 18,216,217,138,225, 95,223, 27, 70,147, 25,167,174, 60,192,226,207,135,226,173, 46,173,192,240,109,241, 80, 31,
+ 2, 59,103, 59,176, 28, 14,140,102, 22, 6,163, 5, 0, 71, 87,153,158,143,143, 79, 15,169, 84, 42,213,104, 52,202,244,244,244,
+136,220, 71,135,211, 45,220,193, 19,207,132, 95,220, 57,224,237,183, 16, 29, 19,139, 3,135,143, 93, 45,116,145,207, 40,255,159,
+166, 77,155,182,115,117,117,181, 45, 42, 42, 82,220,191,127,255,214,203, 62, 23, 16, 14,231,179,246,157,186, 65, 37,203, 71, 94,
+ 70,138,213, 79,209,141,235,216,225,155, 37,235, 91, 6, 52, 10,104,105, 33,165,198,171,137,175, 29,190,152,183,166,101, 67,255,
+ 70, 45,203, 7,132, 52,246,173,186, 44, 27, 79, 98,215,123,204,248,233, 75, 6, 13, 31,139,139,225,199,176, 98,241,151, 59,165,
+ 14,110,141,157,157, 28, 90, 52,107,215, 27, 87,207, 31,131,200,206, 19, 78, 46,158,157, 70,127, 56,181,215,240,209,147,112,227,
+234,121,172, 94,250,245, 14,139, 94,249,187, 53,235, 42,117,175,239,214, 60,164,205, 40, 59,103, 15,200,228, 74,216, 57,185,163,
+113,112,235, 81, 15,238,234,103,170,243,147, 11, 94,218,116, 16, 2,189,145,160, 68,101, 68, 70,129, 22,169,185,165, 70,139,101,
+107,144, 19,100, 97, 25, 91, 17,143,231,108,122,236,123,239,252, 69, 82,199,199,131, 89,182,240, 75,174, 17, 34, 20,200, 74, 77,
+ 86,129,194,128, 2,185, 1, 42,157, 9,206, 82, 30, 88, 11, 91,227,167,238, 18,149, 17,118, 18, 62, 28, 36, 2,171,163,140, 21,
+177,241,215,189, 1,119,227,179,135,172, 88,177, 74,114, 39,249, 41,147,197, 47,141,102, 9, 5, 92, 88, 88, 22,176,226,138,231,
+243,248,211, 6,247,235,133,140, 66,109,233,168,101, 14, 3,255,160, 54,112, 21,179,232, 25, 58, 11, 0, 48,176, 95,105,106, 91,
+114,142, 26,199,255, 44, 0,158, 77,236,174,186, 45,214,106,185,155,118,157,252,108,255,190, 61, 14, 58, 11, 15,191,156, 78,133,
+ 70,111,134, 72,192,133, 80,192,133, 88,192,125, 38, 31,187,122,163, 85,154,115,151, 94,104,130, 70,167,131, 66,107, 2, 1,112,
+235,177, 10, 90,131, 25,114,181, 9,237, 2,157, 94, 45, 16,194, 48, 39, 9, 33,253,159, 55, 68,207,155,165,167, 34, 82, 21,105,
+220,126, 90,163,252,243,149, 25,185,167,115,182, 0,212,104, 4, 23,239,121,231,248,244,178, 64,234,212,216,193,206,225,207, 51,
+167, 79,216, 30,190,203, 34, 34,166,212,100,153,180,133, 88, 62,115,100,166, 66, 86,216, 29, 64,146,181, 95, 38,113,109, 28, 44,
+178, 17, 94,252, 97,213, 47, 70,119,143, 90,236,161, 63,101,249,114,141,229, 25, 55, 97,209,235, 57,132, 37, 2, 93,222, 99,171,
+250, 16, 56, 28,198, 56,239,147,119,192, 18,130,249,171,246,227,251, 25,161,176, 21,143,150, 48, 12, 35, 81,235,204,248,124,193,
+ 22, 44,255,102,156,157, 68,200, 3,195,148,230, 68,141, 25,241,142,117, 39,160,206,140,196,155,187, 85,202,228, 19,113, 79,119,
+ 23,182,237,244,118,100,219,182,109,101, 78, 78, 78, 16,139,197,127, 69, 42, 42,193,195,195,227,155,121,243,230, 5, 76,158, 60,
+249, 73,177, 79, 30,143,135,143, 63,250,136, 99,177, 16,156, 62,189, 13,110,117, 67,112,236,220,159,232,219,163, 53, 84, 26, 29,
+138,101, 74,176,224,190,244,137,168,148, 21, 94,204, 77,189,215,166, 99,247,129,136, 56,123,132,252,121,122,235,132,154,212,232,
+113,114,118,202,136,186,151,216,152, 97,156, 75, 35, 90,101, 38,203, 96, 98, 81,199, 67,130,140,212, 68, 56, 58, 56,100, 88,171,
+ 39,118, 11, 24,204,112,200,100, 6,100,155, 58, 47, 97, 63, 0,162,206,137, 27,185,255,247, 77, 49,177,247,239, 44, 30, 48,106,
+ 26,175,247,240,143,184, 63, 47,153,250, 53, 0,107, 11,239, 25, 31, 61,122,244, 96,220,184,113, 29,110,220,184, 97, 1,160, 97,
+ 24,198,196,229,114, 37, 6,131, 65,208,189,123,119,249,195,135, 15, 35, 80,113,210,226, 51,116,250, 96,191, 43, 35, 84,190,109,
+195, 26, 71,214,177, 83,190,213,189,115,123,180,111,234,131,140,206,237, 1, 96, 90,154,202, 54, 64,215,112,203, 94,147, 89,124,
+234,231, 95,143,127, 63, 33,180,215,231, 59,121,243, 87,228,156,152, 95,101, 34,106, 70,220,229, 62, 21,217,120, 30,151, 3, 59,
+ 49, 31,182, 98, 30,236,196,124,216,137,248, 48,153, 73, 77,158, 28,137,201,204,150, 70,180, 12,102,168,180,102, 92,188,147,135,
+ 92,185, 1, 50,165, 17, 90,163, 5, 4,164,244,105,212,138,214,188,224,241,117,199,242, 59,169,163,111,136,124,211,218,159,236,
+ 15, 94,203,124, 50,162,207, 65, 98, 3, 59, 73,233,104,236, 43, 87,174,192,197,165,250,167,125,150,101,113,224,204, 45,172,216,
+126, 17,103,182,125, 5,145,128,139,224,193, 11, 48,118, 72, 91,176,132, 69,226,163,216, 60,255, 38,205, 61, 56, 28, 49, 56, 12,
+ 3,189,137, 5, 64, 42,221,159, 6,131,193, 37, 61, 61, 93,225,231,231,231,233,237,237, 61,156,203,229, 18, 40,239,232,143,236,
+ 41,214, 92, 56,241,187, 68,173,213, 91, 36,102,249, 54,191, 28,109,127,248,249,129, 97, 24, 98,111,111, 47,184,120,241,162, 42,
+ 40, 40,200,237, 37, 47, 37,142,216,189,209,234,241, 83, 62, 27,222,176, 65, 3,236,255,125, 27, 8, 97, 14, 90,251,207,187,142,
+223,192,194,217,207,142, 48,252, 98,222,154,150,203, 23, 76,123,230,189, 41,179, 87, 84, 57,234, 80, 44,180,157, 49,116,228, 68,
+ 68,222,250, 3, 63, 46,248, 98,143, 94, 85, 60,214,100, 54,189, 91,156,147,188,167,126,147,182, 32, 70, 37,194,247,253,132,208,
+247, 39, 8,123, 15, 24,142, 27, 87,207,227,251,175,167,236,210,200,242, 63,128,149, 73,206, 44,225, 79,238,222,103, 8, 95,171,
+ 55, 98,205,178,111, 49,105,198, 98,180,235, 49,144,127,255,206,159,147, 1,124,103,117, 58,132,209,130,238, 65,174,165,230,217,
+196,226, 88, 50,151, 87,209, 25,200,227, 50,156, 22, 13, 28,161, 53,152,161,168,230,161,146, 39,224,231,202,228,138,186,235,190,
+255,140,171,214,153, 81, 32, 55, 32, 95,174, 71,161,236, 47,131, 85, 40,215,163, 64,110, 0,159,199, 32, 62, 41, 13, 28, 62,175,
+198,249,121, 37, 42, 19,218, 52,114, 42,189, 70, 95,178,119,196,196,179,111,123,230,242,221,161, 43, 86,172, 20,221, 77, 81, 34,
+ 38, 89, 81, 22,201,226, 66,200,231,192,166,236,119, 11, 91,154, 27, 89, 21,246,110, 13,234,135,141, 25,221,211,222, 86,140,236,
+132,124,240,184,165, 37, 98, 28,220,125,224, 32,212, 97,234,148,137,112,117,113, 68,122,161, 30,171, 15,199, 35,230,193, 99,176,
+218,154,109,246,154, 95,246,244, 29,255,241, 23,142, 28,190, 13,118,156, 77, 41, 93, 79,174, 5, 15,255, 60,174,203, 78,188,167,
+ 86, 41,138, 8,136,197,202, 28,100,134,152, 45,165,167,219,247,243,103, 97,207,246, 13, 56, 27,149,255,228, 12,188,118,112, 57,
+ 62,155,189, 8,133, 10, 3, 42, 58, 47,171,242, 35, 0, 10,158,138, 68,189,176,252,148, 57,170,104,153, 41, 91, 54, 84,162, 97,
+120,206, 92, 25,158,123,223,240,156, 94, 69,181,255, 54, 85,219,117,248,130, 41,114,116,107, 38, 17, 73,255, 56,125,250,184,244,
+ 72, 12,121, 98,178,140,154, 66,178,120,218,192, 76,133,172,160,119,141, 76,150,155,127, 51,161, 68,120,121,238,162,213,122,143,
+ 90,117,205,167,238, 40,138,148, 58,139,249,197, 28, 4,169, 69,234,224,166,227,217, 8, 87,240,181,134,111, 11, 11,227,212,213,
+ 69,158, 88, 66,112,226,102, 46, 8, 41,125, 68,218,119, 37, 11,101, 79,230,176,176,165,221, 42,231,238,228,131, 87,150,135, 98,
+109,248,123,227, 47, 27, 20,253,131,228,234, 81,223,207,127,210, 93,216,174,121,105, 36,203,222,222, 30,142,142,142,176,181,181,
+ 69,117, 93,135, 12,195,140, 25, 63,126,252, 11, 79,255,249,249,249,232,213,179, 59,214,110,216,140,230, 61,195,112,238,250, 89,
+ 24, 77, 44,130,155, 52, 64, 93,111, 39,100,228, 41, 95,234, 66,151,122, 4,124,220,166,251,144,175, 59,245, 24,136,139,103, 14,
+145, 63,207,252, 58,177,166,133, 16,251,247,234,112,124,225,194,249,245,231, 46, 94, 39,180, 19,241, 16,167, 50,128,195, 48,168,
+227, 33,129,139,148,131,136, 35, 59,116,161, 3, 59, 88, 93, 28,207,199,167,214,206,229,107, 55, 73,151, 47, 93,208, 61, 50,138,
+185,168,202,142, 47, 6, 0, 77,222,163,101, 15,129, 7,181,255, 8, 63,213,188,235, 59,240,240,110,240, 86,114,222, 67,171,205,
+ 6, 0, 77, 82, 82, 82,242,220,185,115, 3,150, 46, 93, 74,184, 92, 46, 11, 64,184,106,213, 42, 77, 66, 66,194, 29,148, 14,205,
+ 69,117, 55,155,158,111, 53,253,220,214,198,210,206, 89,194,105,218,192, 83,130,246, 77, 75,123, 69, 67,251,119,130,143,175, 47,
+146,114, 53, 45,138, 53, 44, 95,101,224, 54, 88,255, 75,204,237,122,174,220, 9,102,173,225, 1,128,163, 53, 61, 62, 12,254, 74,
+144, 47,143,102,217,137,249, 96, 75,207,149, 26, 25, 45,189,209, 2,173,222, 2,173,193, 12,181,193, 2,141,193, 2,150,148, 94,
+ 19, 12,195,192,104,102, 97,213, 99,243,115,231,190,189,179, 43, 26,212, 99, 96, 47, 41, 93, 55,251,178,114, 15, 12, 0, 23, 23,
+ 23,184,187,187, 91, 21, 21, 53, 24, 75, 47,113,131,137,125,210,173,111, 48,154, 65, 8, 65,124,252,163,175, 82,147,147, 7,251,
+249,251,117,105, 18,220,220, 89, 34,228, 0, 64,165, 70, 75,163,209, 88,236,236,236,220,157,157,157, 57, 89, 89, 89, 79,204,179,
+ 95,139,238,230,195,135, 14, 98,232,208,119, 84,113,183,238, 62, 25,226,174,213,106,153,142, 29, 59,218,251,248,248,112,244,122,
+189,162,166,135, 73,234,214,104,136,147,139,243,226, 49, 31, 76,106,212,189, 87, 95, 92,186, 16,142,163,135,118,255,166, 41,136,
+ 15,183, 86, 36, 32, 32,240,133, 81,135, 13,253, 27,189, 48,234,176,110,125,255, 42,141, 86,147,224,214,109, 9,195,195,217, 19,
+251,136,142, 99,156, 2,128,181,232,148,251,246,110,252,230,187,145,147,103, 55,236, 55,104, 36,198,188, 63, 22, 60, 30, 23, 17,
+231,142, 99,249,130,233, 39, 85,242,252, 48,107,210, 4, 74, 67,111,141, 5,181,196, 62,159,250, 54,108,134,168, 63,175, 34, 49,
+254,126,236,221,219, 55,154,250, 5,181,131,155,119,157, 79,211, 92,185, 75, 17, 23,103,172, 78,198,160,211,165,141, 13,123, 31,
+ 79,143, 58,108, 31, 18,224,194, 60,127, 1, 0,208, 40,243,141, 91,127,250, 60,161,124,212, 33,107, 52,164, 85,166, 43, 47, 41,
+ 56, 16,113,253,230,140,193,253,251,114, 10, 21,134,210, 8,150,220, 80,246,210,163,176,252,119,133, 30,254,222,182,120, 20, 27,
+197,234,228,133, 7,107,120, 93,234,198,190,219,231, 65,249,185,203,178, 4, 12,160,171,113,183, 20,223,126,226,178, 31, 87,136,
+238, 38,171, 16,147,162, 40,237, 42,228,115, 75, 13, 22,159,243,196,116,149,142,102,175, 38, 58,196,112,191,255, 48,108, 4, 10,
+ 21, 70,176, 44,192,227,114,202, 94, 2,164, 43, 25,100, 40, 53, 40, 44, 41, 64,114,106, 26,100,185,137,224,112, 56,112,245,110,
+100,117, 37,105, 11,177,241,210, 24, 72,208,240,254, 93,120,135,254,200,129, 68,200,131, 94,153,135,211,123,127, 42,208,171, 20,
+139,181, 26,213, 33,107,234, 57,254,149,130,192, 20, 40, 84, 58, 15, 33,159,139,253,219,215,225,221,177, 83,158,105,125,191,154,
+179, 16,224, 48, 40, 46, 81,130, 97,152,130,154,181, 75,204,237,170,150, 95, 50, 50,246,202, 26, 21,152,173, 23, 31, 20, 42,127,
+ 26, 37,167,195,207, 28,151, 94, 75, 21,226,214,163,156, 50,147, 85,192, 46,250,164,127,166, 82, 94,220, 7, 64,124,205,158, 11,
+ 57,125, 66, 63,156, 17,219,160, 81, 19,253,165,251,170, 20,153,218, 84,105,158, 67,251,225,115, 99, 35, 79,174,237, 39, 55, 37,
+125, 36,245,106, 98, 97,205,230,101,218,130,248, 5,149,116, 29,218, 44, 88,189,255, 73,183,225,204,165, 59, 74,127,183, 88, 96,
+ 33, 44, 8, 11, 76,253,102, 35,204,172, 5,172,197, 2,214, 66, 96,178, 16, 73,117,171,235,238, 93,247, 80,201,195,125,129,163,
+190,123,177,187,208,209,209, 17, 46, 46, 46,112,113,113,129,189,189,125,181, 70,139,207,231,219,242,120,207,238,234,180,180, 52,
+164,166,166,194,222,222, 30,132, 53,193, 96, 2,154,181,235,141,123,137,247,113,254,218, 29, 16,214, 2,169,109,205,103,121,145,
+122, 4,124,212,186,219,224,117, 61, 6,141,195,185, 67,191,144,219, 87,142, 79,210,230,199,111,177, 58, 66,111,177, 48, 38,147,
+ 9,253,123,119, 75,139,142,125,124,102,206,140,201,125, 59, 12,152, 36,108, 31, 80, 11, 58,131, 5,153,169,137,136, 56,242,171,
+174, 81,125,175,179, 61, 59,183, 77, 51,153, 76,176, 88, 44,213,222,200,117, 6, 99, 33,151, 47,150,142, 24, 49,138,127,251,214,
+173,131, 82, 55,255,253, 22,134,115,151, 33,108, 48, 67,200,208,224,224,198, 48,154, 88,104, 52,138,146,154,110,179, 82,169, 76,
+222,182,109, 91,253,176,176, 48, 73,147, 38, 77,248,137,137,137, 88,190,124,121,145, 82,169, 76,182, 86, 35,252,202,163, 85, 60,
+166, 36,161, 60,162,149,222,169, 61, 70, 12,232,132, 61, 39,175, 33,226,234, 13,164,169,108,239,168,204,188, 35, 25,105,217,250,
+166,206,138,131,131,218,215,229,238,223, 94,114, 48,182,219,172,247, 8, 17,134, 23, 94,158,175,182,254,226, 6,148, 90, 19,236,
+ 37,165,245,158,202, 35, 91, 92,134,177,218, 17, 49, 64,242,213, 27, 81,205, 90,249, 55, 65,116,178, 28,249, 50, 61,180,122, 51,
+ 88,150,128, 5,129,139,157, 13, 68, 2, 14,210, 83,147,193, 18, 99, 74, 13,111, 21, 5, 93,187,116,229, 1, 12, 24,134,240,248,
+ 60, 30, 8, 74,235, 43,138,197, 98,149,187,187,187, 85, 17, 45,163,217,140,161,125,219,162, 93,235, 96, 12,158, 84, 90, 51,243,
+194,111,179,224,100,203,199,158,157, 91,144,113,101,213,206,250,237, 39,135,223,191, 23, 59, 44, 54,250,143, 81,111,183, 20,183,
+240,228,101, 11, 42, 11,147,170,213,234,131, 0,108, 4, 2, 65,223, 46, 93,186, 56, 31, 60,120, 80,230,234,234,202,218, 8, 4,
+ 5,131, 6, 14, 96,249, 2, 65,113,249,103,175, 95,191,206,159, 52,105,146, 93, 73, 73, 73,122, 94, 94,222, 13, 0,166,170, 31,
+ 4, 3,122,129,131,221, 96, 24,145,173, 88,146, 86,175, 94, 3,239,214,237,218, 58, 12, 25,250, 46,132, 54, 66,156, 11, 63,131,
+ 53, 43,151,238, 83,229,196,125, 88,147, 61,249,186, 70, 29,102,166,167, 36,107,180,250,160,102,173,186, 49, 87,195,143, 76, 51,
+194,117, 37, 87,104,252,169,215,208, 41, 13,147,179, 85, 88,179,228, 43, 56, 57, 72,145,146,248, 80,155, 16,119,111,163, 73,167,
+248,202,106,147, 5, 64, 82,100, 25,214,254,253,190, 78,122,163, 5, 87, 46,158,212,177,102,182,239,141,203,167, 18,107, 55,106,
+ 45,106,214,186,167, 83,225,209, 45, 67, 53,192,158,234,116,178, 30,190, 24,193, 37, 6, 89,202,133,139,231, 29, 60,234, 52,229,
+ 50, 96, 96,212,235, 80,144,116,219,172,201,123,168, 80,100,221,183,106, 20,110, 81, 6,190,153, 61,239,135,143, 90,183,106, 37,
+ 37, 16, 61, 19,193, 42, 55, 88,133, 10, 3, 92,237,108,160, 85, 20, 32,225,246, 25,157,166,128, 91,101,189, 51,179, 65, 45, 41,
+204,207,179,249, 43,157, 33,190, 93, 85,159, 47,204,207,179, 49, 27,212,146,234,111,117, 92,216, 75,109,112, 47, 37,235, 73,226,
+187,144, 95,154,155,101,195,231, 62,201,211, 42,111, 11,170,161,155, 64,228,136,172, 34, 29, 24, 16,176, 22, 51,204, 38, 3,148,
+ 10, 5,178,178,115,145,151,155, 7,165, 82, 6,137,173, 19,154,181,104, 3, 59,169, 8,119, 35,246,129, 16, 98, 85, 93, 67, 19,
+195, 15,104,221,174,179,240,126,106,105, 46,150,136, 79,112,124,247,210, 34,149, 34,191,179, 42, 39, 33,161,166,109,177,217, 98,
+ 57, 31,243, 32,161,105,109,175,122,204,157, 68, 57,118,110, 94, 11, 67, 89,100,211,100,178,224,126,186, 26, 57,197, 26,164, 39,
+197, 17,214, 98, 57,143,255, 8,188,202, 3,128,224, 5, 55,107,140,222,163,135, 96,195,134,141, 72, 74, 78,101, 23, 79,235,151,
+174, 82,202,222,174,129,201,234,133,178, 90, 27,154,188, 71,203,180, 78,173, 51,143, 69, 23,115,180, 6, 82,101,130,143,200,173,
+ 14, 58,127,184,252,172, 86, 89,108, 99,209,107,120,199,119,126,184,187, 34,205, 82, 7, 13,195,226, 47, 66, 97, 43,230,129, 97,
+ 24,148,119, 23,174, 95, 56, 17, 18, 97,105,223,178, 86,111,198,232,207, 87, 96,231,138,233, 32, 0, 70,190,123, 77, 83,217,122,
+162,116,238,194,169, 94,184, 85, 59, 45, 53, 63,171,215,192, 47, 46,232,140, 66,253,128,119,194, 34, 91,181,106, 37, 19,139,197,
+ 16,139,197,176,183,183,135,147,147, 19, 28, 29, 29,171,221,118,147,201,164, 50, 24, 12, 46, 54, 54, 54, 96, 89, 22, 41, 41, 41,
+ 72, 73, 73,129, 92, 46, 71, 65, 65, 1,212, 42,133,249,214,133,253,188,102,237,251,193,187, 65, 16,234,248, 55, 7,159,203,128,
+199,227, 32,226,216,230,202,214,179, 98,147,213,117,208,250,158,131,199,227,220,161, 77,228,246,149,227,147,181,249,241,155,173,
+ 61, 70,101,221, 61,119,135, 14, 29, 26, 52,105,210, 36,193,188, 25,147,206,158, 12,143,136,223,127, 98,211,192,146, 18,153, 15,
+ 33, 4,142, 14, 14, 25,161, 3, 59, 28,239,222,177,117,218,133, 11, 23,216,221,187,119,235, 25,134,185, 87,149,102,105, 35,149,
+255,219,133,243, 23,231,119,238,218, 13, 91,182,239,238, 26,251, 32,174,107, 98, 98, 2,124,234, 52, 64,189,250,254,208, 48, 78,
+184,120,249, 42, 84,178,252,223,172, 89,207,231,162, 90, 76, 73, 73,201, 31,161,161,161,189,175, 93,187,198, 9, 13, 13,213, 20,
+ 22, 22, 94,127, 42,138, 69,170,211,188,241,243, 59, 5, 0,126,171,211,117,236,190, 44,163,236, 83, 0, 75,125,235,248, 34,226,
+234, 13,220,184,118,115, 99,161,196,119,193,135,163, 63,152, 88,119, 16,119,252,160,246,117,185,238, 78, 18,252,190,105, 57,247,
+216,141,212, 21,169, 69,150, 45, 75, 47,207, 95,104,205, 49,122,114,227, 80, 26,209,177,177, 51, 76, 22, 2,150,148, 54,184,118,
+ 34,126,101, 13,239, 11,154, 60,131,240,195,201,147, 38, 37, 54, 11,110,241,217,232, 15, 38, 11, 90, 52,240,193,173,199, 50,128,
+ 97,224,236, 41, 69, 78, 78, 14,174, 28,216,100, 46,201,122,184,145,203,101,191,171,193,254, 68, 73,218, 29,191,167, 22, 39, 22,
+ 22, 22, 34, 34, 34, 2,229, 6,203,205,205,173, 50,163,245,140,102, 81, 94,246,245,133, 63,254,210,113,194,152,119, 48,160, 91,
+ 83, 92,190,157, 8, 67, 89,189,166,242,161,228,201, 55,126,182,249, 52,180,129,225,163,161,141, 20, 90,147, 77,234, 55, 41,242,
+ 43, 40,157,131,149,173,100, 61, 13,197,197,197,199, 30, 61,122,212,169,121,243,230,117, 79,157, 58, 85, 28,123,243,236,180,167,
+ 87,226,139, 47,190,176,221,176, 97,131,132, 16,114,221, 96, 48, 36, 89,181,237, 28,252, 30, 21, 25,233, 98, 52,177,184,122,243,
+110,227,158, 29, 91,128, 37,192,237,219,183,177,101,235, 22,221,189,152, 59, 63,169,243, 60,191,171,194,188, 84,184, 63, 45,175,
+ 54,234,240,137,102, 78, 86,234, 79,231, 78, 30,216,217,186,235, 64,140,154,250,221,119, 17, 39,119,207,111,217,121, 0,167,113,
+235,222,136,186,113, 17,231, 79,157,249,193,168, 42,158,143,234,115, 71, 42, 92, 79,161, 88,242, 73,147,150, 93,145,158,150,138,
+148,132,251,191,233,138, 31,103,167, 37,114,127,203,206, 76,155, 92,191,105, 71, 92, 59,187,103, 90, 21, 70,171,202,115,222,199,
+ 77,188,233,212,137, 99, 35, 50, 51,127,246, 84,107,117, 66, 66,136, 78,104,195,203,181,229, 40,247, 42,172, 94,207, 56, 99, 65,
+118,221,161,239,142,158,124,114,205,154,149,124, 15, 71, 9,114, 75,116, 80,104,141, 80,106,140,224, 48, 12,252,188,165,208, 40,
+139,113,249,192,143, 38,131,170, 36, 20, 72, 52, 86,166, 41,117, 15, 88, 84,242,248,226,212, 47,166, 92,130,141,131,143,119,189,
+ 30,179,171,140,214, 41,179,238, 12,252, 98,202,241, 0, 66, 72, 79,169,123,128, 82,157,255,104,110,101,219,206, 48,165,215,247,
+168,238, 62, 48,154, 75,235,143,153, 89,192,194,178,101, 81, 62,128, 60,233,207,103,170,217,118,134,221,123,242, 58,178,243,100,
+208, 26, 76,208, 27,204, 48,154, 44,224,112,185,112,116,114,132,127,189, 16, 56, 56,218, 35, 47, 55, 27, 55, 46, 28, 67,124,204,
+229,235, 12,193, 2,109, 65,194, 5,107,142,145, 64,236, 24,224,229,237,201,201, 81, 24, 32,182,225,226,206,229, 83, 70,147, 65,
+255,147,149, 38,235, 5, 77, 89, 81,241,138,207,102,124, 57,242,215,109,219, 61,131,234,219, 35,179, 80,139,204, 2, 29,148, 58,
+ 83,153, 17, 99,161, 87, 21, 34,230,226,246, 92,139, 78,185, 2,255, 17, 42, 53, 90,102,163, 78,121,240,204, 45,151, 89,243,127,
+228, 62, 78, 76, 50, 45,250,180,127,166, 86,165,232, 87,227, 72,214, 83,252,250,113,253, 61,111, 98, 35, 94,232, 46, 36, 44, 88,
+ 66,112,252,102,238,147,238, 66,182, 44,243, 50, 58,177,234,105, 4,159,158,187,176, 91,191,105,231, 98, 30, 41,119,105,181,121,
+ 14, 15, 31,255, 84, 2, 0, 92, 46,247,201,171, 60, 55, 75,167,211, 25,170,233, 66,217,177,121,243,230,153,147, 39, 79, 22,102,
+100,100, 32, 49, 49, 17, 50,153, 12, 34,145, 8,103,206,156, 49,129, 53,255, 20,115,237,112,202,163,168,240,111, 3, 90,245,174,
+ 29,212,190, 31, 36, 18, 41,120,196,250,100, 76,137,123,163, 17,173,186, 14, 90,215,115,200, 4,156, 63,188,153,220,190,124,108,
+138,182, 32,126, 83, 77,247,165, 76, 38,139, 5,144,240,211, 79, 63,181,216,178,101, 75,253, 25, 51,102, 36,237, 88, 55,127, 13,
+ 0, 20, 21, 21, 1, 0,162,163,163,201,148, 41, 83,244, 58,157, 46,185,164,164, 36, 10,213, 12,128, 0, 0,109,129,228,251, 45,
+235,151, 54,203,200,202,121,167, 65,179, 54,112,171,223, 6,158,126,109, 81,162, 52,226,214,227,108, 36,197, 93, 64,220,213, 3,
+167, 52,182,230,249,168, 97,125,227,230,205,155,251,112, 56,156,122, 42,149,202,179, 73,147, 38,205,165, 82,105,116,243,230,205,
+ 67,120, 60, 94,102,100,100,100,106, 77,180,210, 46,111,215,215,233, 58,118,117,154,210,174,123, 82,174, 38, 36, 77,105, 23,173,
+ 17, 58, 76, 47,184,184, 90,255, 43,183,214, 10, 98, 44,140,221,191, 93,113,240,247, 77,203,185,163, 39,126, 97,185, 47,119,250,
+148, 39,182, 57, 87,179,112, 53, 39,231,163,176,193,127,149,119, 40,139,100,149,253,110, 85,152, 94, 46,143,145, 3,152, 25,243,
+128,191,238,254,167,147, 22, 6,183,238,248,126,151,183, 67, 57,102,129, 45,206, 30,254,153, 36,199, 92,220,207, 35,150, 57, 90,
+ 43,102, 3,168,182, 59,200, 96,176,198,100,189,184,142, 25,210,110,251,119,111, 29,123,240,240,161, 37, 67, 6, 13,118, 89,255,
+205,123,248,241,151, 35,144,138,133, 32, 44,139,247,186,251, 12,255,118,124,224, 64, 31, 15, 81,173,131,151, 50,175, 76, 93,121,
+127,166, 70, 99,140,183, 34, 18, 67, 10, 11, 11,175,218,218,218, 22,116,234,212,169,157, 80, 40,100, 10, 11, 11,121,238,238,238,
+102, 7, 7, 7, 67,102,102,166, 70,175,215, 31, 4, 80,163,178,227, 70, 19,139,148, 60, 29,142, 30, 58,136,187, 55, 47, 32, 46,
+238,145, 50,238, 65,220, 90,134, 71, 86,170,243, 18,138,129, 26, 63,224,131,173,112,212, 33,169,241,168, 67,139, 94,249,251,142,
+141,139,122,104,116,250,177,205, 59,244, 71,221,198, 29, 57, 70,147, 5,247,110, 95,194,165, 3, 43,127, 52,170,138,103,189,202,
+ 49,246,174, 93,223,159,112,109,240, 71,196, 73, 16,150,221, 8, 0,132,101, 55, 70, 95, 59, 53,185,109,191,241,112,118,175,219,
+ 92,150, 30,205,224, 37,170,135, 11,120, 28,245,233,131,191, 30, 78, 73, 73,193,195,135, 15,241,248,241, 99, 20, 23, 23,227,247,
+223, 83,106,116,124, 52, 37,169,231,226, 31,112,250, 12,123,111,212,241,225, 35,198,136,234,251, 7,113, 2,106, 59,193,197,150,
+135, 71,143, 83, 17, 31, 25,195, 62,186,117, 74,103, 84,228, 15,209,150,164, 86,106,252, 36,174,141, 61, 0,203,172,242,185, 11,
+219,183,239, 24,240,229,226, 37,237, 92,220,220, 43,108,199,139, 10,242,109,190,154,122, 44,224,198,159,127, 88, 53,215, 33,107,
+177, 20, 77, 28, 27,202,114, 75, 39, 10,197,147, 56,117,217,222, 43,125,152, 42,125,159,176,230,106, 35,248, 31,188,211, 25,102,
+150,133, 90,107,132, 66,173,135, 92,169, 67, 78,126, 17,238,198,196,224,242,241, 99, 72,124,116, 55,217,100, 48,132,115, 56,204,
+ 1,109, 94,252,229,154,245, 52,241,234,187, 56, 59, 35,185, 88, 5,145, 13, 15,169,241,145,122,181, 66,190,235,101,207, 35,109,
+ 81, 66, 78, 62,151,233, 29, 26, 58,226, 76,143, 62,131, 28, 90,119,232, 37,113,181,119,132,128, 71,144,144,146,141,168,235,103,
+212, 73,119,175, 40, 76, 6, 85,223,215, 49,235,203,223,156,234, 71, 29, 26,245,234,129, 35, 7,119, 61,196,229,242,108, 88,214,
+172, 55, 26,244,195, 94,197,100,189, 41, 8,177,100,142, 29,249,206, 51,207, 6,102,150,136, 71,190,123, 86,251,244,179,130,201,
+ 66, 36, 35,223,189,174, 41,109, 64, 42, 79,236,243,242,114,238, 95, 62,119, 97, 90, 90,209,237,226, 98,253, 37, 0,153, 58,157,
+238,165,215, 49, 47, 47,111,225,226,197,139, 7,104, 52,154,192,110,221,186, 9,237,237,237, 81, 84, 84,132,240,240,112,211,137,
+ 19, 39, 30,228,231,231,127, 11,228,155,181, 8,249, 45, 70,119, 56,236, 81,100,248,183,129,173,250,212, 14,234,208,207,250,198,
+ 76, 40,158,208, 99,208, 56,230,252,145,205,228, 86,196,145,143,180, 5, 9,191,188,194,110, 53,234,116,186,155, 58,157,238,254,
+156, 57,115, 90,123,120,120,120,124,251,237,183, 34,133, 66,193, 95,191,126,189,174,176,176, 48, 87,161, 80,220, 64, 21,249, 52,
+ 47, 18,109,146,103, 97,232,233,131,155,187,147,131,155,223,114,116,173,213,219,193,173,118, 67, 89, 65, 86,178,188, 32, 59, 28,
+192,249,178, 66,145, 53,162, 69,139, 22, 13, 24,134, 9, 5,208, 76, 42,149,250,217,218,218, 10, 9, 33,129, 12,195,196,178, 44,
+ 27,211,164, 73,147, 19, 15, 30, 60,168, 81, 49,217,180,203,219,245, 62, 1, 29,119, 23,107, 88,129,129, 35,216,157,118,121,187,
+ 30, 0,242,207,125,169, 1,112,244, 65,183,153, 67,143,221, 72, 93, 19, 91,226, 48,173, 32, 98,201,177,154,174,179, 60,243,174,
+223,235, 58,255,117, 57, 15, 50, 1,140,141,137,196,242,123,209, 55,230, 49, 4,124, 11,204,139,180,249,143, 35, 95,135, 62,159,
+207,215,213,170, 85,171,194,209,133, 66,161, 80,167,215, 87, 21, 64,185,108, 86,229, 96, 11,208,117,251,161,125,219,199, 30, 57,
+118,116, 73,151,158, 67, 92, 68,181,107,163,158, 59,131,237,179, 90, 78,187, 16, 93,112,107,208,151, 87, 54, 36,101,235, 98, 80,
+195,124, 24,149, 74, 21, 15,160, 68,165, 82, 13, 38,132,100, 48, 12,227, 83, 82, 82,114,199,100, 50,221,171,177, 33, 96, 49,170,
+125,251, 54,191, 51, 12,195, 35,102,118,217, 13, 62,119,183, 46, 39, 46, 19,175, 56, 45, 73, 80, 61,123,124,254,237,234,150, 13,
+253, 26,181, 44,159,235,176,105, 93, 59, 76,154,185,188,101,221,250,254, 45,255,154,255,176,218, 52, 1, 98,210,148,124,120,104,
+235,178, 43,209,127, 94,250,218,213,171,110,221,220,204,164,184,140,199,119, 22, 90,116,138, 67,175,122,156, 83, 30,199,174,220,
+242,211,204, 25, 57, 89,201, 91, 52, 5, 9,247, 1, 64, 83,144,112, 63, 46, 10,223, 20,230,102,206, 40,202, 79,250,233,101,247,
+133, 90,173,206,222,181,107,151, 99,199,142, 29, 57, 30, 30, 30, 40, 40, 40,192,165, 75,151, 88,150,101,179,106,172, 85,156,124,
+ 73, 93,204, 56,255,246,203,186,101, 2,169, 93, 63,179,217,236, 77, 8,192,227,241,114, 12, 26,197, 25, 37, 71,250, 37, 74, 82,
+117, 85,223, 51, 88, 6, 0,167,124,238, 66,150,101,153,101,107,182,167,242, 69,118, 21, 22, 67, 52,233,148, 18,150,101,173,158,
+235, 80,150, 30,213,240,117, 93,223, 12, 33, 11,154,183,106,247,181,201,100,212,149, 93, 31, 58, 0, 58, 66, 80,196,225, 48,151,
+185,172,233,172,226, 21, 30,166, 24, 6,246,132,225,193, 78,204, 3, 3, 6, 42,121, 49,169, 73, 78, 86,133,134, 56, 63, 62, 86,
+147,223,181,206,105,195,190,176,139,231, 78, 53,148,119, 13, 0, 0, 32, 0, 73, 68, 65, 84,189,107,177, 88,234,149,197, 12, 82,
+244, 90,245,126, 85,142,211,111, 64,164, 25,255,126, 78,150,155, 45,230, 13,127,145, 85,221, 40,127, 39,205,128,250,226,193,181,
+107,121,132,165,164,230,223, 74,202,208,252,134,103,167,213,121,149,245,228,122,120,120,124,195, 48,204,251, 54, 54, 54,182, 6,
+131, 65, 77, 8,217,145,151,151,183, 16, 47, 76,254, 27,194, 23,187,107,195,108, 68,146,185, 70,157,250, 15, 77,126,252,168,234,
+182, 93,226,214,168,183, 72, 42,157,169,211,170,119,104,242,226,183,191,230,253,233, 32, 20, 10, 67,108,109,109,249,133,133,133,
+ 55, 1,200,255, 78,199,189,121,243,230,190, 28, 14,167, 30,203,178, 30, 0, 28, 80, 58, 42,164,144,199,227,101,149, 69,180, 72,
+ 77, 53, 59,125,176,223,181,231, 91, 77, 63, 15,191,242,104, 85, 89,183,226, 19,106, 13, 95, 33,122,191, 95,247, 47,126, 59,116,
+180,162, 81,135,255,184,115,254,255, 79,179, 43,207,214,171,112, 44,199,198, 97, 81,207, 0,157,166, 48, 59,107,202,213,123, 5,
+ 55, 1, 40, 95,101, 61, 5, 2,193,104,163,209, 40, 22, 8, 4, 90,163,209,184,235,239,178,237, 98,247,128,113, 28, 16,171,103,
+166, 96,193, 68, 62, 55,104,229,223,114, 46,113,131,130,130, 58, 11, 4, 2, 95,139,197, 34, 49, 24, 12, 26,173, 86,155,146,154,
+154,250, 7, 42,159,248,252,141,174,167,212,221,127,165, 64, 32,252, 20, 0,140, 70,253,106,117,126,194,231, 85,253, 99, 21,159,
+255, 71, 31, 35,215,122,173, 18,120, 92,190, 27,202, 10,115,179,102,115, 65, 94,242,109,255,255,225,122, 82, 94,242,224, 82, 77,
+170, 73, 53,169,230,243,112,232,254,164,154,255, 75, 77,145, 87, 99, 31,145, 87, 99,171,139, 46, 87,242,121,186, 63, 41,229, 76,
+172,224, 5,192,138,130,165, 20, 10,133,242, 6, 96,233, 46,160,252, 47,209,229,196,101,188,201,207, 83,254,115, 84,154, 19,205,
+ 84,225, 74,107, 18, 18,124, 25,103,123,158,106, 82, 77,170, 73, 53,169, 38,213,164,154,255, 57,205,234,180,255,137, 93,146, 19,
+159, 91, 62, 9,224,255, 37,225,159,134, 85,169, 38,213,164,154, 84,147,106, 82, 77,170,249, 95,227,137,241,226,208,125, 65,161,
+ 80, 40, 20, 10,133,242,102,160, 57, 90, 20, 10,133, 66,161, 80, 40,175, 70, 69, 93,135,212,104, 81, 40, 20, 10,133, 66,161,188,
+ 6, 42, 77,134,167, 93,135, 20, 10,133, 66,161, 80, 40,175, 70,121, 68,203, 11,207,149,119,160, 70,139, 66,161, 80, 40, 20, 10,
+229,245,144,131,138,162, 91, 39, 78,156, 32, 21,253, 78,161, 80, 40, 20, 10,133,242,255,193, 63,220,139, 60, 29,201,154, 88,182,
+ 12,224,169,136, 22, 53, 88, 20, 10,133, 66,161, 80,254, 46,102,235, 31, 70,121, 36,171,252,149,243,130,209, 26, 48, 96, 0, 67,
+205, 22,133, 66,161, 80, 40,148,255, 21,255, 70, 47,194,121,126, 3,233, 97,166, 80, 40, 20, 10,133,242,191, 52, 91,255,166,237,
+161,229, 29, 40, 20, 10,133, 66,161, 80, 94, 13, 47, 0,253,159, 90,254,127,155,130,135, 66,161, 80, 40, 20, 10,229,223,206,196,
+202,150,105, 68,139, 66,161, 80, 40, 20, 10,229,245,155, 45, 10,133, 66,161, 80, 40, 20,202, 63, 25, 58,179, 57,213,164,154, 84,
+147,106, 82, 77,170, 73, 53,255,237,148,215,209, 2, 42,171,163, 69,161, 80, 40, 20, 10,133, 66,121, 41,250,163,180,126,214,196,
+178,159,253,169,209,162, 80, 40, 20, 10,133, 66,121,189,188, 48,253, 14, 53, 90, 20, 10,133, 66,161, 80, 40,175,215, 96,109,162,
+ 70,139, 66,161, 80, 40, 20, 10,229, 13, 67,141, 22,133, 66,161, 80, 40, 20,202, 27,130, 65,229, 35, 7,206,215, 64,231,101, 70,
+ 31,156,167,154, 84,147,106, 82, 77,170, 73, 53,169,230,127, 78,179, 58,237,243,248,231, 81, 94, 25,254, 36,254, 74,132,223,244,
+255,241,197,116,232, 43,213,164,154, 84,147,106, 82, 77,170, 73, 53,255,237, 76,124,238,231, 19,104,215, 33,133, 66,161, 80, 40,
+ 20,202,235, 53, 91,116, 10, 30, 10,133, 66,161, 80, 40,148,215, 68,165,221,132, 52,162, 69,161, 80, 40, 20, 10,133,242,106, 84,
+ 58,169, 52, 53, 90, 20, 10,133, 66,161, 80, 40,111,198,112, 81,163, 69,161, 80, 40, 20, 10,133,242, 26, 77,214,196, 10,255,122,
+226,196, 9, 66,247, 17,133, 66,161, 80, 40,148,255, 21,255, 90, 47, 82,190, 97,212,108, 81, 40, 20, 10,133, 66,161, 94,164,198,
+120,225,175,209,134, 19,203,150, 1,208, 81,135, 20, 10,133, 66,161, 80, 40,175, 74,127, 60, 59,242,112, 98,249, 50, 53, 90, 20,
+ 10,133, 66,161, 80, 40,175,206,196, 42,255, 74,187, 13, 41, 20, 10,133, 66,161,252, 47,249, 55,122, 17,134, 30, 86, 10,133, 66,
+161, 80, 40,148, 87,162,162,104,214, 38,186, 91, 40, 20, 10,133, 66,161, 80,222,172,225,162, 80, 40, 20, 10,133, 66,161,188, 9,
+147,245,166, 11,150,210,153,205,169, 38,213,164,154, 84,147,106, 82, 77,170,249, 95, 49, 89, 79,151,120, 0, 64, 71, 29, 82, 40,
+ 20, 10,133, 66,161,188, 42,116, 82,105, 10,133, 66,161, 80, 40,148, 55, 4,157, 84,154, 66,161, 80, 40, 20, 10,229,255,217,112,
+ 81,163, 69,161, 80, 40, 20, 10,133,242, 26, 77,214, 51,102,139,230,104, 81, 40, 20, 10,133, 66,161,188, 26,149,230,104, 49,168,
+124,228,192,249, 26,124,193,203,140, 62, 56, 79, 53,169, 38,213,164,154, 84,147,106, 82,205,255,156,102,117,218,231,241,207,103,
+ 34,254,159, 10,150,210,161,175, 84,147,106, 82, 77,170, 73, 53,169, 38,213,252,175, 65,203, 59, 80, 40, 20, 10,133, 66,161,188,
+110, 99,245, 60,212,104, 81, 40, 20, 10,133, 66,161,188, 26,180,142, 22,133, 66,161, 80, 40, 20,202, 27,194, 11,165, 81,173,242,
+159, 33,212,104, 81, 40, 20, 10,133, 66,161,188, 30,250,163, 52,170, 85,254,147, 26, 45, 10,133, 66,161, 80, 40,148,215, 72,133,
+117,180, 24, 0, 56,113,226, 4, 41, 91,238, 54, 96,192,128,203,116, 95, 81, 40, 20, 10,133, 66,249,255,228,223,234, 69,158, 68,
+180, 6, 12, 24,192, 0,136,160,135,154, 66,161, 80, 40, 20,202,255,130,127,163, 23,225, 60,231, 36,187,209,195, 76,161, 80, 40,
+ 20, 10,229,127,193,191,209,139,240,158,115,145, 20, 10,133, 66,161, 80, 40,255, 19,254,193, 94,196, 11,165,137,240, 39,203,126,
+ 2,101, 37, 31,104, 29, 45, 10,133, 66,161, 80, 40,148, 87,163,124,180,225, 11, 83,239,208, 40, 22,133, 66,161, 80, 40, 20,202,
+171, 81, 81,101,248, 77,116,183, 80, 40, 20, 10,133, 66,161,188, 65,104, 68,139, 66,161, 80, 40, 20, 10,229,213,121, 58,170,245,
+255, 22,205,162, 51,155, 83, 77,170, 73, 53,169, 38,213,164,154, 84,243,191,100,178,158, 89,166,149,225, 41, 20, 10,133, 66,161,
+ 80,222, 16,116,212, 33,133, 66,161, 80, 40, 20,202,171, 81, 62,226,240,233,101,106,180, 40, 20, 10,133, 66,161, 80, 94,163,217,
+122, 1,218,117, 72,161, 80, 40, 20, 10,133,242,106, 76,172,236, 15,212,104, 81, 40, 20, 10,133, 66,161,188, 33,195,197,160,242,
+145, 3,231,107, 32,252, 50,163, 15,206, 83, 77,170, 73, 53,169, 38,213,164,154, 84,243, 63,167, 89,157,246,121,252,243,248,159,
+ 21, 44,165, 67, 95,169, 38,213,164,154, 84,147,106, 82, 77,170,249,159,133,118, 29, 82, 40, 20, 10,133, 66,161,252, 13,140,150,
+ 27,143,199,251, 90, 44, 22,111, 16,139,197,191,240,120,188,159, 0, 56,213,244, 11,165, 82,233, 52, 79, 79,207,135,158,158,158,
+153,190,190,190,167,236,236, 36,159, 53, 16,162, 11, 0,254,107,218,158, 0, 0,159,137,197,226, 56,145, 72,148, 10, 96, 39,128,
+207, 0,184,190,138,240, 66,111, 12,187,255,233,224, 35, 11,189, 49,236,185, 63,245,247,240,240,184, 10,160,247,235, 58, 40, 35,
+ 36,232, 53, 92,138,244,225, 82,164,143,144,188,252, 83,131,157,157,221,251, 94, 94, 94, 55, 92, 92, 92,178,188,188,188,174,139,
+ 68,162,225, 53,148,112,247,240,240,248,209,199,199, 39,222,219,219,123, 21, 74,103, 39,255,219,210, 89,136,206,237,132, 40,104,
+111, 3,101, 71, 27,108,104,111,131,183,222, 2, 36, 47, 41,215, 9,192, 1,123,123,251, 59, 60, 30,239, 4,128,161,101,231,215,
+ 80, 30,143,119,194,222,222,254, 14,128, 3,101,159,123,153,243,244, 71, 0, 89, 0,190, 47, 91,254,196,199,199, 71, 25, 28, 28,
+156, 26, 28, 28,252,171,159,159,223, 24,107,197, 36, 18,201, 91, 62, 62, 62, 7,125,125,125, 83,219,183,111, 95, 92,171, 86,173,
+ 71,181,107,215,222, 46, 20, 10,187,209, 38,142, 66,161, 80,254,254, 12, 4,176, 4,192,218,152,152,152, 40, 66, 72, 20, 33, 36,
+ 42, 38, 38, 38, 10,192, 6, 0, 75, 81,121, 8,241,153,247, 93, 92, 92, 22, 44, 90,180, 72,151,147,147, 67, 10, 10, 10, 72,124,
+124, 60, 89, 57,119, 38,219,199,153, 71, 26,184, 57,105,188,188,188, 18,235,212,174,189,167,169, 45,103, 38,128,134,214,104, 62,
+133,147, 88, 44,190, 57,119,238, 92,213,213,171, 87, 85, 6,131, 65,197,178,172, 42, 59, 59, 91,117,254,252,121, 85,199,142, 29,
+ 85, 0, 62, 7,192,173,129,230, 19,190,243,198,101,178,245, 27,242,157, 55, 46, 63,253,126, 96, 96,224, 3,150,101,201,176, 97,
+195,244, 0,106,213, 68,243,121,106, 1,162,166,246,112, 28,110,139, 60,243,246,133,132,172,159, 65,134, 75,145,254, 50,154,238,
+238,238, 71,167, 77,155,166,200,202,202, 34,122,189,158,164,167,167,147, 73,147, 38,201,221,221,221,119, 89,185,237, 46, 65, 65,
+ 65,121, 55,110,220, 96,101, 50, 25,137,136,136, 96,155, 53,107,150,103,165,217,234,245,220,186,108,242,246,246, 62, 85,147,151,
+187,187,251,150,154, 30,163,182, 66,164, 27,163, 46, 17,114, 59,156, 28, 27,214,158,172,108, 85,155, 12,117,182,145,117,178,193,
+ 39, 93, 43, 46,101, 82,153,230,187, 93,187,118, 85,223,187,119,207, 82, 84, 84, 68, 30, 60,120,192, 78,152, 48, 65, 7, 32,118,
+194,132, 9,186, 7, 15, 30,176, 69, 69, 69,228,222,189,123,150,174, 93,187,170, 1,140,175,193,122,114, 0,108,155, 63,127, 62,
+ 33,132,144, 69,139, 22,145,224,224, 96,210,163, 71, 15,162, 82,169, 8, 33, 36,149, 16,242,171,217,108, 30,107,141,166,131,131,
+195,251,211,166, 77, 83,105, 52, 26, 82, 14,203,178, 68, 38,147,145,181,107,215,170, 61, 61, 61, 79, 85,242,144, 65,187, 60,168,
+ 38,213,164,154,127, 55,205,127, 50, 94, 40,205,211, 42,127, 89, 29,152, 24, 57,115,230,204,114, 83,117,186, 83,167, 78,183,198,
+142, 29, 27, 53,118,236,216,168, 78,157, 58, 69, 0, 56, 27, 25, 25, 25,245,213, 87, 95, 69, 1, 24, 89,205,129,112,234,208,161,
+131, 44, 55, 55,151,248,251,251,147,186,117,235,146,220,220, 92, 66, 8, 33,183,223,109, 73, 46, 52, 6,201,184,114,154,132, 31,
+ 62, 64, 38,120,241, 72,103, 47, 7,147,151,167,103,145,171,171,235, 98, 60, 59, 39, 99, 69, 7,247,157,198,141, 27, 43, 99, 99,
+ 99, 85, 9, 9, 9,170, 5, 11, 22,168,122,244,232,161, 10, 10, 10, 82, 13, 29, 58, 84,181,102,205, 26,149,209,104, 84,109,217,
+178, 69,101,111,111, 31, 91,129,217,122,105,163,197,227,241, 86,199,196,196,144,196,196, 68, 82, 22,165,168, 76,211,193,209,209,
+177,175,147,147,211,231,142,142,142,125, 1, 56, 0,128, 63, 96,219,220, 1,190,159, 52,111, 16,120, 98,100,175,134,107,123,181,
+110, 57,220,142, 35, 51,173,155, 65,200, 48,223,151, 50, 90, 14, 14, 14,239,127,246,217,103, 74,189, 94, 79, 52, 26, 13, 81,169,
+ 84, 68,163,209, 16,165, 82, 73, 70,142, 28,169, 16,137, 68,239, 84,167,233,234,234,186,240,202,149, 43,230,220,220, 92,114,229,
+202, 21,114,234,212, 41,178,126,253,122,214,221,221,125, 69, 77, 47, 64, 79, 79,207,115,225,225,225, 81,209,209,209, 81, 55,111,
+222,140, 50,153, 76, 81, 70,163, 49,202,104, 52, 70,157, 56,113, 34,234,208,161, 67, 81,123,247,238,141, 50, 24, 12, 81, 6,131,
+ 33, 74,175,215, 71,213,175, 95,255, 76, 77,143, 81, 27, 33, 50, 12, 87,143, 17,178,226, 99, 34,255, 97, 10,145, 77,239, 71,242,
+ 39,117, 33, 27, 90,215, 38, 93,196, 56,142, 23,231,246,172, 80,147,207,231, 95, 78, 77, 77,101,103,207,158,109,104,210,164,137,
+252,195, 15, 63,212,233,245,122, 66, 8, 33,122,189,158,124,248,225,135,186, 38, 77,154,200,103,207,158,109, 72, 73, 73, 97,121,
+ 60,222,249, 26,172,231,210,114,147,117,249,242,101,242, 52, 42,149,138,244,232,209, 35, 53, 56, 56,248,215,122,245,234,141,170,
+ 78,211,214,214,118,240,172, 89,179, 84,164, 2, 76, 38, 19, 81, 42,149, 36, 37, 37,133,173, 91,183,110, 54, 0, 23,218,152, 83,
+ 77,170, 73, 53,169,209,122, 99, 76,172,102,185,226,157,248,213, 87, 95, 69, 17, 66,162,230,204,153, 19, 85, 22,217, 18, 0,176,
+ 45,123,241, 0,140,152, 53,107, 86, 20, 33, 36,106,230,204,153,229,159,169,236, 64, 12,220,191,127,191,113,213,170, 85,196,195,
+195,131,120,122,122,146,213,171, 87, 19,150,101, 73,238,137, 93,228, 66, 99,144,184,175,195, 8, 33,132,196, 47,158, 74, 46, 52,
+ 6, 73,218,248, 29, 25, 61,122,180, 70, 34,145,140,172,226,224, 58,183,108,217, 82,169,213,106, 85,219,183,111, 87, 73, 36,146,
+219, 0,154,160,180, 43,146, 41, 91,215, 49, 77,154, 52, 81,220,191,127, 95,181,123,247,110, 21,128, 5, 86,158, 48, 13, 1,116,
+151, 74,165, 67,103,213,226, 39,144,173,223,144, 89, 30,184, 7,160, 25, 0,183,178,207,120,207,156, 57,147, 16, 66,136,143,143,
+207,149, 74, 52, 29,130,130,130,102, 38, 36, 36,204, 51,153, 76,243,162,163,163,231, 53,106,212,104,246,160,250, 94,237,143,140,
+124, 43, 68,254,221,148, 16,178,124,122,208, 79,111,183,233,181, 39,180,219,200, 15,234,185, 94,253,208, 93,164,121,207,129,171,
+124,174,235,208,170, 19,187, 86,173, 90, 55,211,211,211,159,152, 43,165, 82, 73,178,178,178, 72,114,114, 50,185,122,245, 42,241,
+242,242,186, 80,157,166,167,167,231,131,244,244,116,178,113,229, 74, 50,172, 89, 32,233,226,104, 71,186, 58,217,145, 86,182, 34,
+117, 99,160, 85, 77,141,214,157, 59,119,162, 0, 68, 1,136, 42, 42, 42,138, 42, 42, 42,138, 42, 41, 41,121,242, 30,128, 40,185,
+ 92, 30, 37,151,203,163, 12, 6, 67, 84,131, 6, 13,106,108,180, 58,138,208,177,173, 8,197,237,133,208, 14,172,229,154, 61,165,
+190,171,229,207,145,237, 73,201,199, 61,200,170,144, 90,164,147, 13, 62,177, 82,115,160,141,141, 77, 4,128, 25,101,166, 60,172,
+111,223,190, 26, 66, 8,233,219,183,175, 6, 64, 88,217,251,159,149,153,172,190, 86,174, 39,199,207,207, 79, 93, 30,201, 2,240,
+135,159,159,159, 58, 56, 56,152, 4, 7, 7, 19, 31, 31, 31,101,153,182, 85, 13, 90,195,134, 13,227,181, 90,237, 19, 3, 40,147,
+201, 72,118,118, 54, 73, 74, 74, 34,177,177,177,228,246,237,219, 36, 53, 53,149,236,219,183,207,226,232,232,120,146, 54,230, 84,
+147,106, 82, 77,106,180,222,168,209,122,254,245, 44, 39, 78,156, 32,207,189,245, 67,100,100,100,212,172, 89,179,162,170,113,102,
+ 19,231,204,153, 83, 30,245, 90, 82,197,205,127, 75,124,124, 60, 9, 11, 11, 35, 1, 1, 1, 36, 32, 32,128,140, 29, 59,150,200,
+229,114,162,122,124,159, 92,104, 12,114,251,189, 86,132, 16, 66,148,113,209,228, 66, 99,144,168,209, 29,200,221,187,119, 73,237,
+218,181,195,171,248,254,227,215,175, 95, 47,216,181,107, 87, 46, 74,243,177,248, 0,218, 1, 88, 45, 22,139,183,161,180,187,176,
+ 46, 0, 39,127,127,255, 98,141, 70,163, 26, 54,108,152, 10,128,111, 21,154, 93, 3, 2, 2, 18,183,108,217, 66,242,243,243, 73,
+113,113, 49, 89,214,177, 17, 33, 91,191, 33,139, 90,213,101, 55,110,220,168,159, 49, 99,134,218,217,217,249, 4, 0,239, 97,195,
+134,153, 9, 33,164, 75,151, 46,121, 21,137, 57, 58, 58,246, 77, 72, 72,152,167,211,233,230,201,100,178,121,197,197,197,243,142,
+ 29, 57, 50,175, 79,179, 70, 97,242,239,166,132, 28, 25,249, 86,200,219,181,156,134,174,232,221,122,114,214,236,241,195,230,116,
+104, 18,167, 91,250,233,165,119,235,123,252,248, 50, 71,219,205,205, 45, 71,175,215, 19, 0, 47,188, 18, 19, 19,137,139,139, 75,
+122,117, 26,206,206,206,115, 62, 27, 17,106,121,167,110, 45,146,184,106, 46, 49,157,219, 77, 76,167,182,147,199, 63, 76, 39,131,
+ 60, 93, 21,237, 4,156, 89,214,174,143,167,167,231,185,155, 55,111, 62, 99,180, 74, 74, 74, 42, 52, 90, 10,133, 34,202, 96, 48,
+ 68,249,249,249,157,121,213,179,190,157, 13, 26,116, 21,115,111, 71,135,117, 38, 5, 83,122,144,190, 14,252,212, 87,144, 27, 1,
+ 32, 2,192,232, 26,254, 31, 7,192,210,114, 67,245,195, 15, 63, 16, 66, 8,241,243,243, 83,227,213, 6,163, 56, 4, 6, 6, 38,
+143, 31, 63,222,220,184,113,227,252,142, 29, 59,202,110,221,186, 69, 46, 95,190, 76, 78,157, 58, 69, 14, 28, 56, 64,238,223,191,
+ 79,178,178,178, 72,124,124, 60,233,223,191,191, 12, 64, 87,218, 22, 82, 40,148,191, 51, 21,120,145,127, 60,156,242, 13, 27, 48,
+ 96, 0,243,212, 6, 58, 0, 16,181,106,213,170, 96,233,210,165,203, 81, 90, 11,130, 9,226,226,221, 30, 98,222,221, 30, 98,222,
+221, 32, 46,222, 45,139, 24,109, 90,188,120,241,194,224,224,224, 28, 0, 98, 0,158, 21,125, 17, 33,164,179,139,139, 11,210,211,
+211,225,224,224, 0, 7, 7, 7,164,167,167,131, 16, 2, 51, 1, 76, 4,208, 27,141,208,106,181,208,177, 4, 90, 22, 80,168, 84,
+240,244,244,132,209,104,108, 80,201,250, 55,127,239,189,247, 26, 4, 5, 5, 21,124,245,213, 87,217, 40,205,149,217, 54,110,220,
+184,115,127,252,241, 71,144, 74,165, 42,142,141,141,213, 53,107,214,172, 47, 0,207,132,132,132,247,215,174, 93,139,176,176, 48,
+ 84,113,211,105,214,191,127,255, 83,247,239,223,111, 48,122,244,104, 68, 68, 68, 96,217,178,101, 40, 44, 44, 36, 0,160,215,235,
+137,197, 98, 49,118,232,208,193,184,106,213,170, 54, 93,186,116,185, 89,191,126,125, 46, 0, 36, 39, 39, 63,174, 72,144, 97,152,
+ 70,117,234,212,129, 94,175, 71, 65, 65, 1,238,223,191, 15, 59, 7, 7,196,100, 23,122,116, 91,177,177,232,235, 35,231,248, 35,
+218, 4, 57,127,254, 86, 71,253,247,225, 17,254, 77,188, 61, 60, 12, 70,147,103,124, 78, 94,246,203, 28, 84,129, 64,144, 94, 88,
+ 88, 8,131,193, 0,173, 86, 11,133, 66,129,162,162, 34, 20, 22, 22, 34, 59, 59, 27, 2,129, 32,177, 58, 13,251,226,226, 43,201,
+215, 47, 51,251,126,254, 1, 13,204,197,224, 29, 92, 13,222,209, 13,104,104, 40,192, 47,115, 39,217, 25, 92,220,230,219,219,217,
+149, 56, 58, 58,110, 2,224, 87,157, 94, 72, 72, 8,138,138,138, 80, 84, 84, 4, 23, 23, 23, 56, 57, 57,193,201,201, 9, 50,153,
+ 12,114,185, 28, 10,133, 2,254,254,254,104,222,188, 57,118,236,216,241, 90, 78,238, 63, 13, 72, 50,195, 50,229,220,163,108, 8,
+164, 82,212,119,178,173,211,218, 22,206, 85,252, 75, 15, 62,159,191,223,217,217, 57, 28,192,199, 0,164, 0, 62,118,118,118, 14,
+231,243,249, 67, 0, 44, 2,176,171,134,171,241,253,252,249,243,103, 38, 36, 36, 72,238,222,189,139,175,190,250, 10, 11, 22, 44,
+192,227,199,143,215, 1, 96,203, 62,243,145,139,139,203, 9, 14,135,179, 25, 64, 63, 0,125,189,188,188,122, 86,163, 59,100,198,
+140, 25,186,150, 45, 91,198,199,197,197, 13,185,126,253,122,171,233,211,167,203,211,210,210, 16, 31, 31, 15, 47, 47, 47,248,248,
+248, 64,165, 82,161,164,164, 4, 67,134, 12,113,176,183,183, 31, 73,155,113, 10,133,242,119, 54, 89,207,121,145,127, 90, 68,171,
+194,229, 10,159,168, 37, 18,201,252,168,168,168,246,193,193,193, 60, 0,251, 0, 32,136,139,225, 67, 58,180,216,118,100,211, 15,
+193,135, 86,205, 13,238, 19,236,191, 45,136,139,242, 81,108, 39, 90,181,106,229, 20, 21, 21,213, 65, 40, 20,126, 82,201, 74, 16,
+ 0,112,114,114,130,131,131, 3, 28, 29, 29,225,228,228, 4,150,101,161,210,232,160,182, 0, 74,157, 1,114,185, 28,202,178,101,
+149,222, 8,181, 90,253,228,127, 43,160,219,248,241,227, 11,214,174, 93,155,159,147,147,243, 3,128,102, 97, 97, 97,131,215,172,
+ 89,131,139, 23, 47,234,250, 5, 52,116, 89,220,185,197,194, 38, 57,143,231, 5,240, 49, 1,192,149, 43, 87,174,160, 67,135, 14,
+ 96, 24, 38,180, 34, 65,177, 88,188, 97,207,158, 61,226,216,216, 88, 52,108,216, 48, 54, 52, 52,244,221, 31,126,248,161,129, 84,
+ 85,124, 13, 0,204, 69,185,177, 83,167, 78,253,102,241,226,197, 5, 5, 5, 5, 70,141, 70,227, 62,104,208, 32,164,167,167, 35,
+ 43, 43,235,143, 74, 76,102,124,116,116, 52,145,203,229, 72, 74, 74, 66,116,116,180,248,155,111,190,105, 99,225,112, 6,103,194,
+238,131,176,142,173,218,140,110,215, 2,187,110,220, 21, 92,125,148,236,216,170,110, 45,167, 59, 25, 57,245, 76, 12, 18, 95,230,
+104, 43,149,202,213, 11, 23, 46, 84,169, 84, 42,100,102,102,226,222,189,123,136,139,139, 67,106,106, 42,150, 45, 91,166, 42, 46,
+ 46, 94, 83,157,134,183,136,247,197,143,211,199, 49,188, 7,127, 0,119, 47, 3, 26, 37,160, 85, 65,255, 48, 10,191, 62,204,197,
+250,131,135,109,210,210,211, 29,247,238,221, 59,222,215,215, 55, 10,128,127, 85,122,132,148, 30, 66, 14,135,243,188, 9, 5,135,
+195, 81, 2,200,149, 74,165, 25,118,118,118, 25, 28, 14, 39,151, 16,162,126, 45, 79, 18,102, 24,193,229, 2, 54, 98,112,248, 85,
+ 78,237,249,110,104,104,232,158,140,140,140, 62, 73, 73, 73,237,215,172, 89,179, 80, 36, 18,197,172, 89,179,102, 97, 82, 82, 82,
+251,140,140,140, 62,161,161,161,123, 0,140,169,201,247,251,249,249, 77,157, 55,111, 30,150, 45, 91,134,230,205,155,195,223,223,
+ 95, 51,127,254,252,213, 0,230, 2,248,196,207,207,239,218,212,169, 83, 63,204,207,207,247,204,204,204,108,190,110,221,186, 73,
+171, 87,175,110,157,157,157, 45,170, 70,186, 83,239,222,189,113,250,244,105, 0,200, 1,144, 84, 84, 84,100,206,206,206, 70, 96,
+ 96, 32,218,180,105, 3,149, 74, 5,149, 74, 5,153, 76,134, 58,117,234,128,101,217,246,180, 41,167, 80, 40,148,255, 87,195, 85,
+177,209, 18,137, 68, 78, 33, 33, 33,168, 95,191,190, 19,202, 70,107,185,216,240,102,127, 62,126,132,196, 54,234, 12,152,232, 11,
+ 8,237,220, 84,226, 98,195,155, 93,246, 47,188, 58,117,234, 8, 67, 66, 66, 32,149, 74,107, 85,242,229, 17,185,185,185, 8, 9,
+ 9,129,163,163, 35, 28, 28, 28, 16, 18, 18, 2,163,209, 8,185, 82, 9,181, 5,208,152, 88,200,229,114, 20, 23,228, 65, 99, 1,
+204,118, 46, 72, 77, 77, 5,151,203, 77,174, 68,211,171, 97,195,134, 5, 49, 49, 49, 5, 0,174, 0,152,188, 96,193, 2,204,154,
+ 53, 11,223,126,251,237, 30, 73, 78, 74,239, 61,167,143,186,252, 62,255, 35, 55,127, 27,102, 4, 0, 99, 70, 70, 6, 28, 29, 29,
+ 33,149, 74, 43, 52, 6, 93,186,116,105, 41,149, 74,177,125,251,118,146,153,153,217, 17,165, 67,248,147, 25,166,212,236,137, 57,
+144, 3, 88, 29, 21, 21,213,246,155,111,190,121,212,171, 87, 47,126,187,118,237,176,104,209, 34, 0, 56, 81,145,166, 76, 38,251,
+115,204,152, 49,134, 75,151, 46,225,225,195,135,210, 35, 71,142, 12, 95,180,104, 81,211,180,180, 52,225,241, 83,103,222,222,153,
+161, 24,254, 67,248, 85,209,226,179, 17,127,186,218, 75,155,212,115,117, 70,116, 90,150,192,194,197,173,234,142,104, 91, 62,119,
+124, 55, 17, 47,186,179,144,147,211, 77,196,139,106,205,231,142, 83, 42,149,123,143, 29, 59,118,118,250,244,233,170,252,252,124,
+216,217,217,161,168,168, 8,223,127,255,189, 42, 58, 58,250,160,193, 96, 56, 94,157,174,133, 37, 45,125,234,250, 2,137, 49, 79,
+222, 51,178, 4,183, 12, 2, 12,152,252, 41, 2, 2, 3, 97, 48, 24,208,172, 89, 51,102,193,130, 5, 82, 7, 7,135, 47,171, 53,
+ 61,156, 23, 78, 55, 51,195, 48,185,132,144, 44,149, 74,149, 41, 22,139,211, 4, 2, 65, 90,113,113,113, 38, 33, 36,239,117,248,
+ 44,194,193, 23, 29,154,249, 1, 66, 49,210,138, 84,217,183, 85, 40,174,232,131,118,118,118,227,214,175, 95, 47,218,186,117,171,
+105,234,212,169,250, 73,147, 38,241,181, 90,173,251,164, 73,147,248, 83,167, 78,213,111,221,186,213,180,126,253,122,145,173,173,
+237,208,151, 89, 17,147,201,132,152,152,152, 31, 30, 63,126, 44, 69,105,185,145, 79,231,207,159, 31,150,144,144, 32, 90,187,118,
+ 45, 14, 28, 56,128, 3, 7, 14, 96,240,224,193,152, 54,109, 26,230,205,155, 87,149,156, 36, 56, 56, 56,196,197,197, 5,151, 47,
+ 95,206, 6,144, 6,160,165,173,173,173,221,224,193,131,209,167, 79, 31,232,116, 58, 24,141,198, 39, 70,139,203,229,194,209,209,
+209,133,182,129, 20, 10,133,242,198, 77,214, 51,102,139, 7, 0,229,161,186, 1, 3, 6, 48, 85,221, 24, 45, 37,249,144,169, 53,
+ 72,149,107,144, 94,194, 62,243, 55,150,101,171,252,246,236,236,236,227, 55,110,220, 24, 23, 18, 18,194,203,206, 46,237, 17, 11,
+ 9, 9,129, 70,163, 65,246,221,155, 80,179,128,180, 97, 16,212,106, 53, 74,226,238,192, 54,184, 61, 92,250,143,198,138,181,107,
+245, 69, 69, 69, 63, 87,164,105, 99, 99,195,175, 93,187,118, 65,114,114,178, 25, 64,177,131,131, 67,111, 95, 95, 95, 68, 68, 68,
+ 0,192, 46, 2,252,136,232, 75,192,229, 67, 32,165, 33, 21,219, 58,117,234, 32, 63, 63, 31, 42,149, 42,162, 34,205, 27, 55,110,
+ 36,152, 76,166,102,131, 6, 13, 98,126,251,237,183,125, 10,133,226, 91, 0,247,244, 44,184,119, 51,242,160,182, 64, 4,224, 45,
+ 39, 39,167,207,230,205,155,215,115,234,212,169, 56,118,236, 24,194,195,195,141, 40,205, 5,187, 81,129,172, 60, 41, 41,233,151,
+ 25, 51,102,180,227,112, 56,147,207,157, 59,103,246,247,247, 87, 24,141, 70, 75,163,128, 0,206,183, 11,190, 19,124, 60,121,162,
+ 99,145, 6, 15,250, 52,242,234,192, 48,192,131,172,252,180,199, 42, 20, 85,181, 79,187,216,112, 79, 12,233, 24,220,101, 92,232,
+ 64, 91,105,195, 38, 80,223,191,233,249,203,254, 83, 43,196,209, 9, 3, 46,231,231, 15, 62,118,236,216,240,136,136,136,143, 13,
+ 6, 67,125,161, 80,152, 40,147,201, 86,169, 84,170,106, 77, 22,151,203,237,175,247,170,237, 36, 43, 46,134,168, 44, 18,165, 48,
+177, 40,212,155,241,208,209, 31, 35,107,251, 60,233, 6,205,205,205,133,167,167, 39, 99,177, 88, 6, 86,165, 25, 30, 30,142, 1,
+ 3, 6,148, 27, 79, 48, 12, 3,134, 97, 10, 3, 2, 2,242,132, 66, 97,145, 64, 32, 80,252,248,227,143, 58,157, 78, 7, 30,143,
+ 39,178, 88, 44,220, 87, 57,219,219, 72,224, 46, 36,204,134, 73,131,186,247,106,222, 36,144, 92,185,125,151, 41,209,232,126,173,
+ 34, 10,184,206,207,207,143, 87, 92, 92,124, 28,192, 67,147,201,244,251,190,125,251, 68,239,191,255,190,110,255,254,253,163, 0,
+ 52, 88,190,124,249,112,149, 74, 85,163, 41, 21, 30, 63,126,188,110,241,226,197, 51,231,204,153,131, 29, 59,118, 76,125,252,248,
+241,172,178, 72,215,224,121,243,230,225,199, 31,127,196,142, 29, 59,216,135, 15, 31,158, 98, 89,246,241,244,233,211,131, 61, 60,
+ 60, 10,115,114,114, 30, 87, 33,219,170,111,223,190,250,107,215,174,217, 40,149,202,171, 0, 62,155, 50,101,202,248,182,109,219,
+ 42, 66, 67, 67,109,139,139,139,101, 18,137,196,102,203,150, 45, 78, 60, 30, 15,106,181, 26, 12,195, 64,169, 84, 26,104, 59, 72,
+161, 80,254,174, 84,230, 69,254, 33, 84,122,111,224, 85,180,129, 26,141, 38, 47, 61, 61, 61, 48, 43, 43,203, 12,192, 12, 0, 69,
+ 6,243,146,197, 91, 14,109, 29,218,206, 79,154, 99, 50,225,200,237, 88, 77,145,193, 92,158,252,110,206,202,202, 82,166,165,165,
+217,105,181, 90, 85, 37,223,245,199,134, 13, 27,180,151, 46, 93,178, 75, 74, 74,130,197, 98, 65,203,150, 45, 17, 31, 31,143,146,
+135, 49,144, 6,182,132,180,235, 0,196, 70,221, 70,116,248,121,164,168, 12,230, 71,115, 23,203, 85,106,245, 60,163,209,120,164,
+ 34, 65, 62,159, 95, 12,128, 16, 66, 44, 0,160, 80, 40,238,169, 84,170,206, 30, 30, 30,120,240,224,129, 84,109,193,180,225,179,
+ 87,172, 33,132, 88, 4,165,163,185, 62, 15, 13, 13, 69,100,100, 36, 0, 68, 86,164,169, 80, 40,166, 78,152, 48,225,210,246,237,
+219,121, 73, 73, 73,125,182,110,221,218,231,209,163, 71,132, 41, 78,183, 92,211,240,209, 32,108, 90,235,141,117, 2,194, 7, 12,
+ 24, 0, 47, 47, 47,108,217,178, 5,171, 86,173, 50,125,244,209, 71, 9,171, 86,173,106,157,159,159,255,123, 37,219, 47,151,201,
+100,103, 92, 92, 92, 62,110,218,180,169, 82,173, 86,163,168,168, 8,217,217,217,112,118,113,225,152,193,233,224,230,232,248,251,
+241, 92,165,148,119,230, 79,220,204,204,169, 50,154,213,142,207, 29, 51,180, 75,139, 46,159,204,153,109,139,107, 71,192, 76,152,
+ 7,178,117, 33, 62, 29, 59,220, 78,167,255,189,171,250,110,234,251, 81, 10,197, 78,133, 66,113,160,134, 39, 75,223, 14, 29, 58,
+236, 89,188,120,177,248,235,101,139,177, 60,176, 22,204, 69, 69, 40,208, 91, 80,168, 55, 67, 81,242, 16, 15, 30,196,194,197,197,
+ 21, 41, 41, 41,208,233,116,136,139,139, 35, 92, 46,247,120,117, 17,157,114,158,234, 46,148, 9,133,194, 34, 62,159,159,199,227,
+241,138,147,146,146,212, 58,157, 14, 28, 14, 71,106,177, 88,196, 86,172,107,109, 87, 87,215,233, 40, 45, 38,122, 76, 89, 88,184,
+ 58,132, 15, 71,240,208,173,142,171,203,219,115, 39,189,239,234,235,237, 46, 75, 74, 72, 52,253,124,246,122,161, 78, 95,249, 96,
+ 13, 0, 39,138,139,139,159, 68, 36,247,239,223,255,233,254,253,251,199, 3,216,134,210,121,183,206,203,100,178,141, 47,113,241,
+205, 61,120,240,224,204, 57,115,230, 64, 44, 22, 63, 41,158, 42, 22,139, 69, 0,176,123,247,110, 60,120,240,160, 45,202,242,181,
+ 88,150,221,147,147,147, 83,157,102,131,160,160,160,164, 67,135, 14,217, 0,240,158, 50,101, 74,251, 53,107,214, 96,236,216,177,
+ 5,177,177,177,237, 0, 36, 3,104, 48,121,242,228, 91, 59,118,236,112, 98, 89, 22, 37, 37, 37, 48, 24, 12,201,180, 41,167, 80,
+ 40,212,108,189, 17, 66, 0, 68,163,180,126, 86,127, 0, 39, 81,154,214, 81, 41, 62,101,238,236, 44,128, 65,229,247,199, 74,146,
+225,129,210, 17, 89,103, 0,108, 6,224, 81,153,168,139,139,203,151, 97, 97, 97,166,204,204, 76,146,155,155, 75, 14, 28, 56, 64,
+ 62, 31, 23,102,121,171,161, 55,219,208,219, 67,237,230,230, 22,239,229,234,252,107, 11, 9, 62, 7, 80,219,138, 13, 11,123,244,
+232,209,196,176,176,176,113,101,223, 59,110,207,158, 61,170,115,231,206,169,184, 92,238, 9,148,150,118, 40, 55,148, 99, 6, 14,
+ 28,168,210,235,245,170,128,128,128, 98,148, 38,238, 87,198,240,110,221,186,149,156, 62,125,154, 88, 44,150, 23,106, 20, 21, 20,
+ 20,144,240,240,112,210,177, 99, 71, 25,128,247,123,246,236, 25,113,253,250,245,136, 78,157, 58, 29,172,110,133, 93, 93, 93,103,
+223,189,123, 55, 50, 53, 53, 53,234,228,201,147, 81,191,255,254,123,212,228,201,147,239, 5, 7, 7,107, 19, 18, 18, 88,179,217,
+ 76,238,222,185, 67, 2, 26, 53, 82, 3,168, 83,153, 78, 15, 49,239,150, 98,203, 66,162, 91, 52,150,232,134,248, 16, 0, 68,185,
+226, 75,146, 55,181, 23,137,255,248,109,210, 93,196,189,241, 50,103,138,179,179,243,217,200,200, 72,162, 84, 42,201,253,251,247,
+201,152, 1,125,200,141,241,189,200,153, 62,126,100, 71,215,122,100, 69,239, 96,210,167,107,103,178, 97,195, 6,114,232,208, 33,
+ 50,123,246,108,214,213,213, 85,137, 42,114,180, 60, 61, 61,207,237,219,183, 47, 10, 64, 20,151,203,141, 82, 40, 20, 81, 74,165,
+242,120, 70, 70,198,250,128,128,128,153, 77,155, 54, 29, 21, 24, 24,216,163,123,189, 58, 51,123,218, 9,227,123,217,139, 18, 27,
+217, 74, 86,224,197,186, 87, 79,112, 0,234, 52,108,208, 64,121,249,242,101, 86,175,215,147,171, 87,175,178,141, 27,249,235,150,
+191,215,247, 96,202,150,165, 7,117,167,127, 59,171, 57,186,233,250,254, 15, 6,196,116,147,112,126,107, 47,125, 82,142,227,101,
+ 25, 1,224, 8,254, 26,117, 24, 6,224, 40,170, 30,133,200, 1,176,109,209,162, 69, 79,143, 52, 4, 0, 78,112,112,112, 20, 33,
+ 36, 42, 56, 56, 56,170,166, 43, 34,145, 72,166, 31, 59,118,108,190,175,175,239,178,208,208,208, 45, 50,153,236,228,168, 81,163,
+ 98, 80, 58, 24,132, 65,233,236, 8, 3,107,215,174, 93, 16, 29, 29, 77, 34, 34, 34,200,176, 97,195,148, 2,129, 96, 52,109,198,
+ 41, 20, 10,229,141, 48,177,146,159, 85,178, 56, 38, 38,166,188,134,214,148,170,196,103,205,154, 21, 21, 25, 25, 25,133,210, 42,
+241, 85,194,227,241, 14,127,244,209, 71,196,195,195, 67,229,238,238,126,152,207,229,142,247, 17, 35, 4, 47, 55,212,189,243,206,
+157, 59, 7,175, 91,183,174, 63,128,182, 0,248,181,106,213,202,206,205,205, 85, 93,191,126, 93,213,177, 99, 71,149,171,171,107,
+126, 80, 80,144,106,249,242,229, 42,147,201,164,154, 62,125,186, 10, 47,214,251,170, 8, 17,128,143,109,108,108, 14, 55,110,220,
+ 56,102,238,160, 30,166,101,211,198,147, 48, 63, 55, 21,128,117, 0, 62, 2,224, 8,128, 63,124,248,240, 11,113,113,113,103,131,
+130,130,126,177, 66,215,187,105,211,166, 23,247,236,217, 19,121,232,208,161,168, 47,191,252, 50,210,197,197, 37, 51, 33, 33,129,
+213,233,116,164,164,164,132,200,100, 50,114,242,228, 73,139,179,179,243,218, 74, 55, 92,200,205, 33,225,187, 42, 44,225,144, 49,
+103, 52,233,104,195,201,122,153, 51, 69, 42,149, 22, 23, 21, 21,145,220,220, 92,146,148,148, 68, 14, 30, 60, 72,250,118,104, 67,
+246, 78, 30, 74,118,141, 27, 76,126,236,219,134,180,181, 19,169, 61,237,108, 35,237,236,236,242,173, 25,117,232,233,233,121, 78,
+175,215, 63, 41,223, 80,187,118,237,168,128,128,128, 67, 65, 65, 65, 43,142, 29, 59,246,233,202,149, 43, 7,119,175, 87,103,230,
+247,125, 58,104, 53,231,247, 19,229,190,117,100, 86, 75,127, 93,153,153,175,144, 90, 46,206, 59, 47, 71, 68,176,229,230,215,108,
+ 54,147, 35,135, 15,147,247,222,126, 43, 70,126,102,247,230,171,243,166,238,153,222,210,255, 72, 71, 17, 70, 84,101,216,158, 60,
+138,216,194,165,139, 61,103,125, 63, 95,231,156,206, 14,156,117,237,236,158,153, 94,234, 61,127,127,255, 36, 66, 72, 78, 96, 96,
+ 96, 18,128, 93,129,129,129, 79, 47,127, 80,137,236,147,226,164,243,231,207, 39,101,215, 7, 7,192,183,139, 23, 47,142, 34,132,
+ 68,249,249,249, 93, 3,128,230, 82,184,118,117,224,108, 30,212,192,163,168,171, 3,103,115,115,105,197, 83, 70,213, 17,160, 81,
+103, 55,201,213,193,126, 94,202,110,181, 28,174,236,250,117,235,178,126,253,250,109, 1,176, 22,192, 66, 23, 23,151,171, 35, 70,
+140,120,176, 99,199,142, 7,203,151, 47, 55,254, 31,123, 87, 30,214,196,181,190,223,153, 76,246, 4,194, 26,194,174,178,168, 32,
+168,184,111,184,224, 46,238,104,221,171,117,185, 86,175,214,214,218,186, 20,193,170, 85, 91,107,181,181, 85,107, 69, 69, 91, 20,
+113, 41,238,168, 21,173,187, 40,130,130, 32, 59,178,132, 45, 4, 66,246,100,126,127, 40, 92,106, 89,130,109,127,183,246,230,125,
+158, 60,132,228,204,155,115,102,206,153,121,207,119,190,243,125,105,105,105,244,156, 57,115, 20, 28, 14,231, 83,243,125,208, 12,
+ 51,204, 48,227, 47, 67,109,100,120,199,150, 8,173,209, 31,125,244,209,125,154,166,107, 99,105,205,104,160,204,152,213,171, 87,
+223,167,105,186, 54, 58,252,171, 1,204, 26, 10,104, 22,182,115,231, 78,154,195,225,124,255,154,141,169,207, 41, 25, 55,110, 92,
+ 79,185, 92,222,205,193,193,161,219, 75,203,149,171,157,157, 93,198,225,195,135,171,149, 74,101, 53, 77,211,213,122,189,190,250,
+222,189,123,213, 3, 6, 12,168,174, 55,235,111,174,158,191,193, 42, 9,174,223, 93,243, 14,189, 74,130,235,175,124, 53,125,223,
+190,125,103, 51, 51, 51,127,182,180,180, 92, 97, 34,167,171,189,189,125,168,141,141,205,121, 59, 59,187, 85, 54, 54, 54,133, 90,
+173,150,174,168,168,160,159, 62,125, 74,255,242,203, 47,244,205,155, 55,105, 27, 27,155,252,198,234, 25,196,163,110, 85,108, 89,
+ 68, 27,247,109,160, 53, 59, 86,210, 0,104,217,182,143,233,210,111,195,233,187,243,134,209, 3,184,140, 27,175,113, 62, 97,101,
+101,181,231,248,241,227,198,244,244,116, 58, 54, 54,150, 62,125,250, 52,189,100,201, 18,186,173,147,163,186, 39,155, 44,238,199,
+161,206,191, 78,192, 82,181, 90,125, 95, 46,151,223,175,174,174,190,239,227,227,115,191,123,155,137,145, 13, 0, 0, 32, 0, 73,
+ 68, 65, 84,247,238, 49, 61,123,246,252,242,232,209,163, 75, 55,110,220, 56, 54,200,130,243,180, 38,238, 40, 77,127, 56,130,166,
+ 23,245,165,159,205, 29, 64, 15,226, 81, 15, 27,229,116,112,200,175,141,214,174, 80, 40,232,248,248,120,250,242,229,203,180,196,
+206, 78, 30,200, 99,204,239,195, 65,255, 62,150,176, 50,181,158, 3, 69,100,196,173,111, 63, 51, 40,207, 30,164,127,156, 53, 66,
+ 63,192,138,220, 89,175, 92, 20, 77,211,133, 19, 39, 78,204,162,105,186,240,216,177, 99,121, 52, 77, 23, 78,152, 48, 33,139,166,
+233, 66, 0, 63, 53,196,249, 74,112,210,125, 47, 69,214,162,176,176,176,251, 52, 77,223, 15, 11, 11,187, 15,188, 8,162,218, 95,
+ 68,238,191,189,251,115,163,250,244,126,250,232,156, 81,134,254, 34,114,127,131,245,180,162,126, 78,216,183,141,214,156, 63, 68,
+ 31, 95, 50,205,208, 87, 98,121,213,219,219,251,243,165, 75,151,198,220,188,121,243,145,193, 96,120,156,145,145,241,248,235,175,
+191,126,220,171, 87,175,235,182,182,182,137,108, 54,251,221,230,174,209,159, 4, 51,167,153,211,204,105,230, 52,227, 85, 3, 83,
+ 19,223,253,188,121,243,102, 1, 77,211,239,135,132,132, 96,211,166, 77,147, 59,116,232, 48,197,217,217,217, 30, 0, 10, 10, 10,
+106,146,146,146,228, 33, 33, 33, 8, 13, 13,197,150, 45, 91,190,196, 11, 95,150,255, 79, 20,157, 56,113,194,101,241,226,197,210,
+141, 27, 55, 26,231,204,153,211, 30, 64, 82,105,105,105,219,105,211,166, 45,162, 40, 42,196,221,221,221,191,176,176,176, 68,169,
+ 84, 30, 2,176, 27,205,172,153, 54, 6, 14, 9, 67,215, 86,142, 56, 79,194, 80,239,227, 17,161,161,161,111, 77,152, 48, 65,187,
+109,219, 54,189, 92, 46, 63,101, 34, 93, 94, 73, 73,201,186,218,127,108,108,108, 36, 15, 31, 62,124, 87, 44, 22,147, 25, 25, 25,
+ 80,171,213, 72, 79, 79, 55,226,197,210, 84,131,168,214,211,219,191, 59,118,177,221,251,211,131, 45,107, 82, 30,128,197, 96, 64,
+199,100,163,232,214,121,236,139, 79,145, 43,180,216,241, 58,237,148,201,100, 95, 44, 89,178,100,218,138, 21, 43,184,238,238,238,
+196,141, 27, 55,112,228,200, 17,181, 84, 42, 29, 14,224,234,127, 66, 63,181, 12, 70,163, 17,108, 54, 27, 0,240,241,199, 31,131,
+ 36, 73,166, 84, 42,101, 19, 4,193, 33, 8,130, 79, 16, 4, 67,151,249, 24, 70,121, 5,138, 43,100,200, 43,150, 53,201,103, 48,
+ 26,143,220,190,125,123, 89,231,206,157,201,187,119,239,162,164,164, 4,233,233,233,180,129,166,127,138, 87, 26, 94, 56, 37,170,
+ 77,175, 31,223,198,118, 92, 39,107, 14,201,142, 8, 69,160,134,100,236, 50, 98, 34, 94,196,210, 2,128,125, 4, 65,176, 0,148,
+249,248,248, 12,124,242,228, 9,207,199,199, 71,153,146,146,114,150, 32, 8,103, 0,251, 27,226,228,241,120,165, 0, 74,143, 29,
+ 59, 6, 0,243,240,226,228,117, 89,187,118,109, 97,124,124, 60,194,194,194,138, 1,236, 4, 0,161,181,237, 24,127, 17,139, 96,
+ 31, 8, 67, 47, 53,200, 29, 70,186, 65,171,171, 80,236, 48,168,131,128, 4,243,135, 79,208, 77,210,142,100,235,181,126,225,225,
+225,241,213,213,213,234,168,168, 40,205,236,217,179, 25,105,105,105,119, 0, 92, 3,112, 12, 47,125, 44,205, 48,195, 12, 51,204,
+248, 75,241,170, 5,171, 89, 31,173, 87, 85,235, 38, 0,223,165,166,166,214, 37,149, 78, 77, 77,189, 15, 96, 23, 94, 68,131, 31,
+221, 2,197,187,230,165, 69,107,247,107, 54,230, 85, 78,110, 64, 64, 0,239,201,147, 39, 44, 52,156,196,145,120, 13,206,223,161,
+161, 92,135,222,222,222, 95,233,116,186,152, 93,187,118, 29,101, 48, 24,211,254,128,218,119,247,242,242,170, 56,124,248,176, 49,
+ 54, 54,150, 94,179,102,141,193,209,209,177, 2,191,247,209,250, 13,103, 32,155, 17,189,188,189,179,252,222,140,190,244,179,165,
+ 99,232,107,211, 7,208,243,157,133,242, 64, 46,227,200, 31,156,149,120,137, 68,162,125, 60, 30, 79,110,105,105,121, 17, 64,239,
+ 63,114,141,108,109,109, 15, 74, 36,146,139,245, 95, 14, 14, 14, 49,246,246,246,223,216,217,217,173,177,178,178, 90,224,193,101,
+111, 91,218,214, 73,149, 56,206,135,142,235, 99, 79, 79,183, 99,191,186,116,248,106, 61, 29, 61, 60, 60,202, 34, 35, 35,141, 63,
+255,252, 51,189,114,229, 74, 99,171, 86,173,228,104,194,175,173, 73,139,150, 21,227, 72,244,132,158,198,226, 81,206,244,166,246,
+ 22,198,129,214,140,198,118, 40, 78,127, 41,128,103, 53,199,233,233,233,185,139,166,233,136,245,235,215, 71,224, 63,185, 64,135,
+132,135,135,175,165,105,122,109,120,120,248, 90, 0,195, 0, 32, 80, 68, 70, 30, 26,219,213, 80, 48,210,137,254,172,189,208, 16,
+ 40, 34, 35, 27,180,100,218, 80, 39, 78,206, 29,101, 44,156,219,135, 14,245, 18, 24,122,218,112, 46,177,217,236,165,120, 97,113,
+238, 14,128,109,158, 53,155, 57,205,156,102, 78,179, 69,235,111, 39,188, 76,130,196,198,198,102, 95,155, 54,109,142,186,187,187,
+ 31, 21, 10,133, 95,226,133,211,124, 75, 47,132,199,134, 13, 27,228, 34,145,168,211,159,120,113,197, 0,156,241,251,196,185,127,
+ 90,135, 89,231,136,197,105, 43, 38, 63, 92,231,136,197,245, 62,238,222,190,125,251,207,240, 34,154,247, 31,237,132,238, 54, 54,
+ 54, 95,219,216,216,228,191,244,205,114, 55,133,179, 43,131, 49,109, 32,151,113,163, 55,155, 44, 26,200,165,126,237,198, 96, 76,
+125, 67, 7, 96, 83,155, 45, 26,227,116,177,179,179,219,102, 99, 99, 83, 96,103,103,247,117, 11, 69,214,111, 56, 59,241,224, 56,
+200,138,113,162,183, 5,161, 24, 36, 98, 28,235,202,111,124, 83, 71, 11,218, 30, 16, 22, 22,246, 54, 77,211,111, 59, 57, 57,133,
+212, 19,254,254,161,161,161,193, 52, 77, 7,215, 70,128,239,206,135,120,128, 21,227,112, 31, 75, 66, 54,192,138,113,184, 59, 31,
+226,198,234, 57,208,138,113,164,143, 37, 33, 11,180, 36, 15,187,113,208,202,124, 51, 55,115,154, 57,205,156,102,161,245,207, 16,
+ 90,230, 14, 99,230, 52,115,154, 57,205,156,102, 78, 51,167,153,211, 44,180, 26, 22, 86,245, 95,117, 43,108,148,249,220,152, 97,
+134, 25,102,152, 97,134, 25,102,252, 33, 52, 26,176,148,104, 66,149,182,196,177,253,117,148,109,156,153,211,204,105,230, 52,115,
+154, 57,205,156,102,206,255, 57,206,230,184,255,191, 55,214,189,209, 48,155, 85,205,156,102, 78, 51,167,153,211,204,105,230, 52,
+115,254,207,130, 52,159, 2, 51,204, 48,195, 12, 51,204, 48,195,140, 63,132,128,151,127, 95, 13, 92,218,176,143, 22,213,125,125,
+177, 94,175, 23, 3, 0, 69, 81, 82,221,157, 53,142, 77,177, 51,129, 32,253,139,244, 59,160,128,121,122,224, 98, 3,156, 23,245,
+122,189,245, 75,206, 10,221,157, 53,195,154,228,236,190,254,124,253,242,250, 59,107,134,188, 90,134, 6, 24,204,238,235, 11, 94,
+169,171,147,169,103,133,192,111, 98, 98,253,101,245,124, 83, 56,255,151,193,236,177,190, 88,167,123,209,143,152, 76, 74,170,189,
+221,116, 63, 98,245, 88, 95, 80,191,188,238,246, 26,135,166, 56,249, 60, 78,153,167,179,253,151, 77,113,102, 20,148,190,175,168,
+ 81,217, 54,197,217,210,177,233,234,232, 24,100,120, 57, 54, 25,192,188,252,194,194,139,127,179,190,212, 21,192, 26, 0,150,245,
+ 62, 75, 4,240,158,185, 87,154, 97,134, 25,111,152,208, 74,192,139, 60,135,123, 94,138,173, 61,141, 10, 45,189, 94, 47,190,127,
+124, 45, 20,106, 32,104,230,122,177,199,184,221,191, 75,148,172, 87, 85,176,101,201, 81,254, 12,157,220,218,158,210, 90, 22, 20,
+ 20, 16, 0, 64, 16,196,247, 0,220, 26,224,180,190,127,124, 45,106, 52, 64,224,148,112,107, 55,192,178,132,197,250,128, 39, 16,
+ 12, 84, 42,149, 29, 0,128,199,227, 37, 43, 21,138, 43,246, 90,237,214, 87,203, 55,214,178,250,117, 29, 52, 99,189,184,253,184,
+221, 75, 12, 70, 35,251,249,221, 93,129,170,210, 52,138,169, 87,239, 92, 5,156, 93,219,128,168,106,132,239, 63,191, 59,105,165,
+ 45, 19, 24,196,230,114, 59, 89, 89, 91,247, 51,210,180,143,209,104, 36, 12,122,253, 99,121,101,229, 53,163, 94,255, 80,175, 81,
+216,222, 63,245,153,177,169,122,190,218,150, 73, 0,117, 28, 8, 17, 8,133, 3, 25, 76,102,111, 0, 48,232,116, 55, 20,213,213,
+ 87,198, 3,209,166,180,221,212,243,243,186,229,255,215,160,211,233,197,153,231,215, 66,173, 3, 2, 38,126, 38,238, 56,237,192,
+ 97, 0,208, 72, 31, 58, 84,167,157,234, 1, 0, 2,207,224,219, 28, 73, 64, 49, 0, 80, 57,133,226,167,177,171,161,214, 1, 62,
+193,225,226,230, 56,103,135, 30,177, 93, 49,127, 2, 7, 0, 46, 28,251,166,237,229,152,239, 70, 0,192,160, 9, 11,207, 14,157,
+184,248, 41, 0,108,217, 19, 99,251,211,103,147,155,228, 52,109,108, 86,178, 42,211, 98,189, 52,242, 66, 43, 87, 1, 37, 73, 75,
+ 75, 35, 1,192,201,201,201,164,177,233, 2,136, 10,129, 69, 36,131,209,207,211,203, 43, 0, 0,157,241,236, 89,130, 65,175,191,
+238, 8,236,252,147,251,210, 18,154,254,109,112, 86,130, 32,204, 29,210, 12, 51,204,120,211,112,250,165,184, 58,253,187,201,108,
+ 99, 71, 40,212,192,213,116,160,127,207,142,152, 63,109,164,176,254,119,209,187,195,221,210,238,158,108,255,195,129,173,100,199,
+142, 29,145,153,153,105, 82, 45,106, 52,192, 47,105, 0,100, 79, 44, 42, 4,130,103,219, 62,255,220,114,200,144, 33,148,147,147,
+ 19, 8,130, 64, 81, 81, 81,207,184,184,184,174,203,150, 45,251, 23,100, 79, 42,106, 52,168,250, 37,173,121,222,218,186,118,104,
+219, 10,107, 22, 79, 22, 1,192,170,153, 59,187,222, 77, 45,182,121,246,236, 89,208, 71, 31,125, 84,198,184,114,229, 59, 59, 32,
+162, 24,200, 51,165,158, 7,127,190,205, 21, 21,254,232, 49,125,241,226, 99, 94, 94, 94, 66,119,119,119,194,194,194, 2, 12, 6,
+ 3, 21, 21, 21,110, 73, 73, 73, 35,238,220,185,163,136,187,250, 61,251,222,157, 49, 25, 82,110, 15,149, 73,109, 87, 22,112, 47,
+ 88, 88, 36,207, 24, 63,222,101,242,228,201, 92, 79, 79, 79, 0,192,179,103,207,188,163,163,163,167, 28, 59,118, 44, 20,202, 2,
+125,141, 6,170,230,218, 94,199, 9,128, 11,244,182, 18,139,167, 51,152,204, 14,122,189,222,249,165,181,225,185, 65,167, 75,150,
+ 73,165,135, 94, 45,111,198,239,161,214, 1, 79, 10,129,193,253, 2, 48, 99,194, 96, 1, 0,124,244,214,134,158, 57, 89,233, 44,
+141, 70,131,182,237,124,250,124,250,217,151,231, 65,146,136,140,137,171, 43,111, 10,103,226,147, 76,172,253,116, 27, 10, 30, 69,
+247, 52, 84,166, 15,172,146, 87, 50, 0,192, 82, 36,154, 16, 29,245,227, 21, 39,255,144, 91,233,165, 90,147, 56,155, 26,155,231,
+162,190,118,204, 79,186,226,251,237,133,125, 76, 55, 55, 55, 60,122,244,168,101, 99,179, 50,213,194,232,232,248,120,235,135, 31,
+ 74, 2, 3, 3, 33, 20, 10, 65, 81, 20,244,122,253,224,235,215,175, 15, 94,187,118,237, 66, 84,166, 42, 76, 29,155, 38, 96, 43,
+ 65, 16, 3,103,207, 95,226, 56,114,108, 8, 38, 12,239,211,100, 97,173, 70,195, 96,177,217, 6,115,111, 53,195, 12, 51,254, 70,
+168,181, 94,213,223,121,184,167, 73,161, 69, 81,148,116,200,172,141,226,126, 61,252,112,247,225,211,202,236,220,194,234,218,239,
+202,147,163,219,142,237,227,236, 27, 31,127, 21,106,181, 26, 55,110,220,192,195,135, 15,145,149,149,133, 5, 11, 22,168, 95, 46,
+ 29, 54,196, 89, 17, 56, 37,220, 26,149,105, 66,111,118,106,235,184,148, 20,134, 74,165, 66,124,124, 60, 42, 42, 42,192,102,179,
+225,226,226,130,161, 67,135, 82, 41, 41, 41, 54, 65, 67,134,139, 2,135, 79,205,132,200,187,154,162,168,138,198,242,136, 80, 20,
+ 37, 13,154,185, 94,236,235,221, 10,207,178, 11, 42,215,124,246, 67,181,209, 72, 83, 25, 89, 57,218,171, 87,175, 34, 32, 32, 0,
+ 23, 47, 94,180, 45, 47, 47,255,100,231,206,157,107,152,155,191,221,174,211,148, 45, 71,227,124, 21,129, 83,194,173,109,165, 71,
+221, 47,159, 59,193, 74, 78, 78,102,237,218,181, 11,101,101,101, 96,179,217,176,178,178,130, 68, 34, 65,219,182,109,137, 85,171,
+ 86, 9,131,131,147,241,239,121, 33,238, 90,143,185,169,141,213,179,174,237,213, 57,124, 59,249, 5,207,152,211,167,201,190,125,
+251,254,102,218,222,166, 77, 27, 12, 27, 54,140, 59,125,250,116,207,201, 83,166, 25, 3, 71,205,126, 6,161,123, 77,179,156,138,
+ 60,158,109,205, 77,167,193, 83,166,156, 10, 15, 15,183,146, 72, 36, 16, 8, 4, 0,128,202,202, 74,151,236,236,236,158,161,161,
+161, 19,111, 39, 70, 81,129,193,121, 5, 16,184, 42,155, 58,159,255,171, 96, 50, 41,105,173, 21,201, 66,192,171,200,203, 47, 86,
+ 0,128, 70,163,129, 70,163,129, 90,173,198,187, 11, 23, 48,230, 77,236,238,229,222,111,201,131,172,231,197,229, 62,113,183,108,
+106,143,213, 53,195, 73,213,100,201,100,185,151,230,173,253,240, 67,137,131,195,127, 86, 4, 35, 15, 30,100,148,151,151, 15, 94,
+187,118,173, 47,205, 31, 32,243, 9, 14,183,106,138,179,169,177, 41,123,122,186,245,167,139,135,117,218,253, 89, 44, 12, 6, 3,
+110,222,188,137,248,248,120,124,249,229,151,244,217,179,103, 43, 45, 5,130,121,104,114,108,166, 90,244,117, 44,242,216,188,249,
+ 24,193,225,112,112,242,228, 73,164,164,164,128, 36, 73,116,236,216, 17, 51,102,204,192,224,193,131, 37,243,231, 47,160, 3,135,
+191,149, 1, 81,187,170, 63,216,151, 72, 0, 75, 86,174,221,236, 56,115,238, 34,108,249,116, 85,179, 66,203, 44,178,204, 48,195,
+140,191,177, 53,171,209, 16, 15,136,141,141,165, 95,190,250, 3, 0, 13,144,109,198,237,254,233,232, 61,227,233, 54,227,118,255,
+ 68, 3, 36, 13,144,150, 64,171,206,157, 59,235,100, 50, 25,125,231,206, 29,250,221,119,223, 85,108,223,190,253,202,233,211,167,
+163,245, 90,237, 94, 39, 71,199, 47,232, 70, 28,236,105,128,116, 7, 68,124, 62,191, 36, 55, 55,151, 62,115,230, 12, 29, 22, 22,
+ 70, 31, 58,116,136, 62,123,246, 44, 29, 23, 23, 71,159, 61,123,150,254,233,167,159,232,196,196, 68,250,233,211,167,180, 64, 32,
+ 40,113, 7, 68, 77,112, 50,104,128,209,118,220,174,229,199,238,234,194,219,141,219,189,140, 6, 24,214, 64,251,206,157, 59, 27,
+162,163,163,233,200,200, 72,250,192,129, 3,116, 98, 98, 34, 93, 90, 90, 74, 83, 28, 65, 73,237,113,141,213,147, 6, 72,103,103,
+231, 18,153, 76, 70,187,186,186,210,108, 54,155,118,112,112,160,219,182,109, 75,247,236,217,147, 30, 49, 98, 4, 61,109,218, 52,
+250,147, 79, 62,161,101, 50, 25,205,229,114,139,107,143,107,140, 51, 0,224, 9, 4,130,220,251,247,239,211,141, 65,169, 84,210,
+165,165,165,244,249,243,231,105,129, 64,144, 27, 0,240,154,226,228, 1, 93,252,253,253, 75, 74, 75, 75,105,173, 86, 75,231,230,
+230,210, 73, 73, 73,116, 74, 74, 10,157,155,155, 75, 43,149,202, 58,238,167, 79,159,210, 30, 30, 30, 37, 60,160, 11,109,222, 4,
+209,104, 95,122,245,229,230,224, 48, 66, 34,145, 40,143, 29, 59, 70, 63,127,254,156,222,191,127, 63, 77, 2, 27, 94, 45,215, 20,
+ 39, 27, 24,218,183,111, 95,195,205,155, 55,233, 7, 15, 30,208, 31,127,252, 49, 61,108,216, 48,122,248,240,225,244,218,181,107,
+233,252,252,124, 58, 63, 63,159, 30, 49, 98,132,129, 13, 12,109,174,127, 54, 52, 54, 69,128, 91,112,112,176, 82,171,213,210, 25,
+ 25, 25,116,135, 14, 29,242, 25,192,116, 1,224,219, 31,224, 52,215, 63,157, 1,107, 71, 71,199,194,155, 55,111,210, 49, 49, 49,
+180,187,187,123, 9, 3,152,109, 9,180,177, 4,218, 48,128,217,109,218,180, 41,185,121,243, 38, 93, 86, 86, 70,187,185,185, 21,
+ 58, 3,214,127,160, 47,145, 0,246,173, 92,187,153, 78,205, 87,208, 43,215,110,166, 1,228,210, 52, 77,163, 1, 31, 79, 51,204,
+ 48,227,159,143, 87,181,200, 63, 5,117, 55,201,224,224, 96, 2,192, 47, 77, 21, 86, 50, 24, 27,183,108,217, 66,169, 84, 42,252,
+240,195, 15, 85,147, 38, 78, 60,218,191, 95,191,140,214,238,238, 50,130, 36,155,205, 54, 92,194,225, 44,221,178,101,139,149, 70,
+163,193,189,123,247,208,181,107, 87, 72, 36, 18, 8,133, 66, 8,133, 66,136,197, 98,180,107,215, 14, 82,169, 20, 22, 22, 22, 88,
+177, 98,133,168,132,195, 89,218, 28,175,209, 72, 83, 0, 96, 48, 26,217, 44, 96,190, 71,183,110,247, 66, 67, 67, 73, 91, 91, 91,
+216,216,216, 64, 40, 20, 34, 37, 37, 5, 26,141, 6,124, 30,223,164, 32,173, 36, 73,146, 66,161, 16,151, 47, 95,198,146, 37, 75,
+208,187,119,111, 88, 89, 89,193,194,194, 2, 29, 58,116,192,208,161, 67, 49,111,222, 60,100,100,100,128, 48,193,169,228, 49, 69,
+ 45,154, 55,111,158, 56, 32, 32,160,193,239, 85, 42, 21,100, 50, 25, 74, 74, 74,224,226,226,130,144,144, 16,241, 99,138, 90,212,
+ 24,159, 45, 32,113,241,246, 62,117,231,206, 29, 59,129, 64,128,200,200, 72,156, 56,113, 2,231,206,157,195,153, 51,103, 16, 27,
+ 27,139,147, 39, 79,162,164,164, 4, 0,224,237,237,141, 35, 71,142,216, 9,197,226, 88, 91, 64, 98, 30,210,166, 33,167,184,248,
+ 66,135,162, 34,187,233,211,166, 93,171,174,174,198,244,233,211,177,113,211,166, 85, 76, 96,153, 41,199,183, 3, 68, 54,142,142,
+ 17,155, 55,111, 38,139,138,138, 48,126,252,248,210,173,155, 54,189,147,112,254,188,231,253,115,231, 60, 55,134,135,191,211,191,
+127,255,210,252,252,124, 28, 60,120,144,116,112,115,139,104, 7,136, 90, 90,207, 42, 96,201, 87, 95,125,197, 85,169, 84, 24, 50,
+100, 72,134, 49, 57,185,157, 30,248,177, 26, 72,249, 5,208, 54,119,124, 33,176,104,197,138, 21, 18, 14,135,131, 15, 62,248,160,
+180, 38, 39,199, 79, 15, 28,168, 4,178, 43,129,108, 61,112,160, 42, 51,211,111,230,204,153,165, 28, 14, 7,219,182,109,147, 20,
+254, 39,233,182,169,232, 10,224, 20,128,171, 0, 10,102,207, 95, 50, 59,160,123, 47, 28,220,187, 19,159,133,127, 20, 1, 96, 18,
+ 65, 16,135, 0, 44, 55,247, 60, 51,204,248,223,132, 41, 90,228,111,138, 70, 83,238, 80,245,149, 36,128, 1, 77,177, 88,219,218,
+118,245,243,243, 67,124,124, 60,252,253,253,239, 88, 89, 89,233, 89, 28, 14,152, 76, 38,104, 99,179, 58, 11, 60,129, 32,104,240,
+224,193,212,173, 91,183,224,225,225, 1, 30,143, 7, 38,147,249,155, 23,139,197,130,163,163, 35,228,114, 57,130,130,130,152, 59,
+118,236, 8,130, 90,253,105,179, 15,196,180, 36, 97,201,173,205,211,190,223, 31,209, 38, 48, 48, 16,149,149,114, 24,141, 70,240,
+249,124,104, 52, 26, 80, 20,245, 98, 9, 72, 71,203, 77, 57, 99, 6,131,193,192, 96, 48,224,225,225,129,141, 27, 55, 66,165, 82,
+129,197, 98, 1, 0,228,114, 57,100, 50, 25,146,146,146,144,157,157,141,151,179,240, 38, 97, 33, 18,141,156, 60,121,114,131, 9,
+127,213,106, 53, 42, 43, 43, 81, 89, 89, 9,153, 76, 6,149, 74,133, 94,189,122,177, 79,199,198,142, 68, 89,217,214, 6,143,225,
+114, 39, 30, 60,120, 80,204,102,179,161, 84, 42, 81, 85, 85,133,188,188, 60,228,228,228,168,164, 82,169,222,194,194,130,116,119,
+119, 39, 57, 28, 14,103,220,184,113,132, 92, 46, 7, 65, 16, 8, 14, 14,182, 61, 28, 25, 57, 25, 26,205,151,230, 33,109, 26, 46,
+ 0,234, 46, 26,205,232, 30,221,187, 95,190,115,247,110,192,210,165, 75,145,152,152,184,153, 31, 21,117,181, 6,120,216,212,177,
+ 25,192,162, 47,234, 9, 24, 58, 39,199, 95, 11,148,212, 43,146,237,158,153,121,110,230,204,153,143, 18, 19, 19,237,182,109,219,
+ 38,153, 52,126,252, 34, 0, 27, 90, 82, 71, 11,145,168,155,163,163, 35,206,158, 61,139,220,172,172,143,244,128,178, 69, 51, 46,
+ 6,163,111, 96, 96, 32, 78,158, 60,137,252,156,156,143,244,191,173,227,139,137, 18, 80, 66,101,100,124, 20, 17, 17,177,111,206,
+156, 57, 96, 80, 84, 95,232, 91,180,112,248, 59,199,247, 57, 11,150, 34, 98,207,142, 8, 0,115, 1, 24, 1,220, 49,247, 56, 51,
+204,248,223,182,106, 53,167, 69,222, 32,177,181,167,197, 22, 45,177, 88,236, 44, 20, 10, 81, 80, 80, 0,159,246,237,165, 28, 14,
+ 7,108, 38, 19, 92, 54,219,164, 26,212,212,212,248, 59, 57, 57,161,178,178, 18,118,118,118, 96,177, 88,117, 47, 54,155, 93,247,
+222,194,194, 2, 36, 73,194,205,205, 13, 53, 53, 53,254,205,242, 22, 39,137,163,118, 44,124,247,230,213,179,109,198,143,159, 0,
+107,107, 27,184,186,186, 64, 44, 22,131,199,227,193,213,213, 21,158,158,158,244,214,173, 91,193, 23,119, 52,233, 70, 94, 95, 60,
+ 81, 20, 5,131,193,128,226,226, 98,164,166,166, 34, 49, 49, 17, 55,111,222,196,131, 7, 15, 80, 85, 85, 5, 19,116, 22,106,148,
+202, 78, 20, 69, 53, 40,178,100, 50, 25,100, 50, 89,157,208, 42, 41, 41, 65,118,118, 54,170, 21,138,206, 77,136,222, 9,126,126,
+126, 12, 0,224,241,120,232,220,185, 51,118,239,222,173,255,249,196,137,183,124,111,222,180,113, 61,127,222,234,251, 93,187,222,
+ 10, 9, 9, 49,220,186,117, 11,114,185, 28, 79,158, 60,129,189,189, 61,197,230,114, 39,155,135,115,203,112, 31, 80,216, 85, 85,
+ 13,239,221,187,119,102,101,101, 37, 62,255,252,115,146,105, 97,177, 39,188,145, 37,190, 58, 48, 24,125, 2, 3, 3,113,234,212,
+ 41, 20,228,228,124,156,211,128,128,201, 1, 74,114, 51, 50, 62,142,136,136,192,208,161, 67, 65, 80, 84,159,150,214,175,103,207,
+158,126, 70,163, 17,143, 30, 61,130, 21,112,187,165,199,123,122,121, 5,212, 90,126, 5,192,181,198,202, 9,128,107, 9, 9, 9,
+224,241,120,240,241,245,237,210,194,159,217, 74, 16, 68,225,156, 5, 75, 17,115,238, 87, 0, 64,196,158, 29,197,245, 68,150, 25,
+102,152, 97,182,104,189,169, 22,173, 90, 97, 85,255,133,223, 8, 45, 19,197, 7, 0,128,201,100,130,205,225,128,205,102,191, 16,
+ 72, 28,142,201, 28, 4, 65,128,203,229,214, 9,171,250, 2,171,254,123, 62,159,111,146,128, 1,128,138,244,115,253,230,190, 51,
+135,205,225,112,160,209,168, 65,211, 52, 56, 28, 46,172,172,172,224,225,225, 1,185, 92,142,222,125,250,171,243,100,172, 88, 91,
+159,113,137,175,115,246,244,122, 61, 20, 10, 5, 42, 42, 42, 80, 94, 94, 14,185, 92, 14,165, 82,105,242, 86,116,163,209,200,200,
+203,203,195,143, 63,254,136,178,178, 50, 0, 47, 28,173,107,197, 85,237,223,204,204, 76, 68, 70, 70, 34, 43, 43,171, 69,215,167,
+ 95,191,126,136,141,141,101, 12, 8, 10,218,123,209,221,189,224,162,187,123,193,128,160,160,189,167, 78,157, 98, 56, 59, 59, 35,
+ 59, 59, 27,247,238,221, 67, 69, 69, 5,104,154, 54,239,159,127, 13, 60, 3, 42,106,202,203,231,172, 90,181,138, 22, 10,133,248,
+252,139, 47, 58,109, 0,166,154, 42, 96, 68, 77, 8, 24,209, 31, 19, 48,160,105, 26, 70,163, 17, 6,195,235,249,138, 19, 4, 65,
+ 48,153,204,150,134, 86,104, 73,225, 58,199,247, 21,159,108,196,153,147,209,181,159,167,153, 69,150, 25,102,152,241, 15, 64,163,
+142,240, 84, 61, 5, 89,247,183, 49, 20, 23, 23, 63, 87, 40, 20,109,220,221,221,145,159,159, 47,118,115,115,203, 97, 51,153, 96,
+177,217, 32,200,230, 53, 1,159,207,127, 84, 80, 80,208,199,217,217, 25,122,189,190, 78, 84,189,186,116, 88,107,165,121,240,224,
+ 1,248,124,254, 35,168,154,140,156, 0,131,166,162, 85,151, 46, 93,234, 44, 67, 86, 86, 86,176,178, 18,129,195,225, 98,245,234,
+213,198,109, 91,183,238,116, 27, 20, 94,249,246,178, 85,244,170, 13,123,255,212, 51,107,234,131,137,207,231, 63,114,117,117,237,
+ 37, 18,137, 16, 19, 19,131,236,236,108, 84, 84, 84,160,166,166, 6,106,181, 26, 53, 53, 53,208,104, 52,224,114,185,240,245,245,
+133,165,165, 37,226,226,226, 30, 65,173,110, 88, 92,150,149,197, 60,122,244,168, 87,247,238,221,235, 44, 42, 3, 7, 14, 36, 6,
+ 14, 28,104, 87,103, 69,171,169, 65,105,105, 41,238,220,185,131,184,184, 56, 16, 4,129,180,180, 52,131, 90,169,252,201, 60, 38,
+ 94, 15, 42,224, 6, 35, 34, 98,223,191,254,245,175,119,250,244,233, 3, 3, 48, 2, 64,228,127, 81,192, 0, 0,110,222,188,153,
+100, 48, 24,250,180,109,219, 22, 50,160, 7,128,147, 45, 18,145,233,233, 9,122,189, 62,168, 83,167, 78,136, 57,122,180, 31,128,
+236,134,202, 41,128,126, 1, 1, 1, 80, 42,149,120,242,248,241,253, 22,136,172,189, 43,215,110,158, 61,115,238, 34, 28,220,187,
+ 19, 17,123,118,228,237,219,189,221, 21, 38,248,143,153, 97,134, 25,255, 83,214,172,102,181,200,223, 20,243, 27, 19, 95, 84, 75,
+ 88, 42, 43, 42,238, 39, 36, 36,180,233,210,165, 11,246,238,221,219,189,119,175, 94,207, 89,108,182,158,205, 98,129, 52,225, 65,
+162, 84, 40, 46, 93,186,116,169,199,184,113,227,168, 91,183,110, 65, 34,145,212, 9,173,218,191, 20, 69,129,166,105,240,249,124,
+ 28, 63,126, 92,171, 84, 40, 46, 53,107, 45, 50, 24, 13,228, 75,161, 71,211, 52,100, 50, 25, 88, 44, 22,190,252,114, 27,190,222,
+186,117,154, 1,136,246, 22,216,127, 8,128,251, 95,123, 64,215,212, 92, 62,115,230, 76,215,208,208, 80,166,139,139, 11,100, 50,
+ 25, 42, 42, 42, 80, 86, 86, 6,185, 92, 14,185, 92,142,138,138, 10,200,100, 50,112,185, 92, 36, 38, 38,234, 84, 53, 53,151, 27,
+227,227,168, 84,199,102,205,154,181, 34, 33, 33,193,145,162, 40,232,116, 58, 24,141, 70, 24,141, 70,104,181, 90,164,167,167, 35,
+ 57, 57, 25, 41, 41, 41, 40, 47, 47, 7,147,201, 4,131,193,192,131, 7, 15, 42, 4, 58,221, 81,141,121, 76,191, 54,152, 64,204,
+245,235,215,223,153, 49, 99, 6,156, 92, 92,250, 35, 63,223, 36, 1,115,162, 9, 1, 83,249,122, 2,230, 63, 2,168,170,234,110,
+102,102,102,159, 1, 3, 6,192,209,197,101,179,111,126,254,197,199, 45,240,211, 50,232,245,215,174, 95,191, 30, 52,115,230, 76,
+236,221,187,119,179,125,102,230,185,146, 87,150, 57,237, 1,251,214,158,158,155,103,207,158,141, 11, 23, 46,192,160,215, 95,107,
+130,178,126,196,247, 86,179,231, 47,113,125,197,241,125, 55, 65, 16,139, 1,124,110,238, 81,102,152, 97,198, 63,217,162,213,162,
+165, 67,158,193,176,114,249,242,229, 58,146, 36, 49, 97,194, 4,139,147,167, 78,133, 60,120,248,208, 67, 42,149, 90, 25, 12,134,
+102,185,236,213,234,237,203,151, 47,151,105, 52, 26,180,107,215, 14,229,229,229, 48, 24, 12,160, 40, 10, 20, 69,129, 32, 8,144,
+ 36, 9,161, 80,136,132,132, 4,236,219,183, 79,110,175, 86,111,111,246, 33, 97, 48, 60,138,140,140, 4,131,193,160,185, 92, 46,
+ 8,130, 0, 69, 81,216,182,109,155,244,107, 32, 6, 0, 24, 36,169, 1, 0,146, 36, 76,245,222,109,118,221,146,205,102,195,248,
+ 98, 19, 64,179,101,173,213,234,175,182,108,217, 82,245,228,201, 19, 40, 20,138, 58,235, 91,117,117,117,157,115,189, 76, 38, 3,
+ 65, 16, 80, 40, 20, 56,117,234, 84,149,181, 90,253, 85, 99,124,101, 64, 81,126, 90,218,152,238,221,187,151,101,102,102,162,178,
+178, 18,143, 30, 61, 66, 92, 92, 28,142, 28, 57,130, 11, 23, 46, 32, 61, 61, 29,122,189, 30,206,206,206,160,105, 26, 39, 78,156,
+168,212, 87, 85,141, 40, 3,138,204, 99,162,113,180,146, 72,130, 28,196,226, 92,123, 59,187,252, 86, 18, 73,208,171,223,139,128,
+167, 79,159, 62,133, 94,175,135,135,135,135, 77, 83,126, 90,180, 94,127,253,250,245,235,152, 57,115, 38, 92,219,180,217,228, 14,
+216,191, 90,198, 29,176,119,247,244,220, 84, 43, 96,104,189,254,122, 75,235,108, 1,236,248,240,195, 15,149, 44, 22, 11, 81, 81,
+ 81, 30, 58, 47,175, 20, 10,152, 42, 4,218, 15, 0, 88,205, 29,239, 8,236,252,228,147, 79,138, 8,130,192,161, 67,135,236, 68,
+158,158, 73, 20, 48, 75, 4,180, 18, 1,173, 40, 96,150,200,211, 51, 41, 42, 42,202, 78,175,215, 99,217,178,101, 69,142,192,206,
+ 38, 40,151,208, 52, 61,154,166,233, 64,154,166, 93,247,237,222,142, 51, 39,163,107, 69,214, 92,188,112,122,159, 1, 32,201,220,
+227,204, 48,195,140,127, 50, 26, 52, 67, 81,221,215, 23, 3,180,184,127,207,142,184,251, 48,181,210,206,218,242,124,237,119,229,
+201,209,109, 7,249, 91,118,252,246,219,111,193,100, 50,145,151,151,135,199,143, 31,195,210,210, 18,211,166, 77, 83, 43,171,170,
+198,212,203,117, 56, 24, 64,220, 75,206, 23,249,212, 42,211,132,158, 84, 98,155,115,103, 98, 25, 34,145, 8,213,213,213, 32, 73,
+ 18, 92, 46, 23,124, 62, 31, 60, 30, 15,247,238,221,195,168,209, 99, 13, 37,252,192,255, 4, 44,253, 79, 62,181, 58,206,218, 88,
+ 67, 61, 0,126, 2,240,129,216,201,105,249,154, 53,107,120,195,134, 13, 3,139,197,130, 75, 43,239, 34,143,225,159,239, 32, 73,
+ 66,159, 95, 38, 95,237,217,202, 73,244, 56, 45, 27, 0, 33,213,221, 89,227, 84, 47,215,225,239,234,233,166,185,234,113,252,192,
+ 86,203,206,157, 95,248,163,203,100, 50, 20, 23, 23, 67, 42,149, 66, 38,147, 65,161, 80, 0, 0, 98, 99, 99,113, 38, 62, 69,174,
+116, 9,201,104,172,158,255,105,123,170,133,147,246,118,235,195,145, 7, 24,246,246,246, 40, 46, 46, 70, 73, 73, 9,100, 50, 25,
+148, 74, 37, 12, 6, 3,202,203,203,241, 67,196, 1, 67,153, 48, 48,171, 46, 32,100, 83,156,138, 60,158, 77,245,175,206, 1,190,
+238,244, 59,239,188, 99, 97,105,105, 9,163,209,136,138,138, 10,228,230,230, 34, 51, 51, 19,241,241,241, 10,169, 76, 3,133,221,
+144,252,186,128,165, 13,112,254,137,120,227, 56,235,199,173,114,114,116, 44,200,201,201, 17, 27, 12, 6, 56, 59, 59,235,101,229,
+229,155,216,192, 5, 11,160, 16, 0, 93, 10,172,249,106,199,142, 57, 99,199,142, 69,183,110,221,242,138,138,139, 91, 55,212,151,
+104,128,209, 14, 16,213,184,184, 36,223,185,115, 71,146,155,155,139,153, 51,103,150,230, 60,123,246,113,173,191, 86, 37,208,207,
+221,211,115, 83, 84, 84,148, 93,155, 54,109,224,239,239, 95,196,205,205,237,144, 10, 84, 54,210, 63, 27, 29,155,178,167,167, 91,
+ 47, 28,239,215,237,221,119,223,133, 94,175, 71,124,124, 60,110,223,190,141,156,156, 28,252,250,235,175, 50, 75,129,224,173,122,
+185, 14, 27,236,159, 35,188, 21, 30,135, 14, 69, 18, 44, 22, 11, 17, 17, 17, 72, 72, 72, 0, 0, 4, 4, 4, 96,246,236,217,208,
+235,245,152, 62,125, 6,125, 58,149,151,209, 84,255, 4,224, 7,224, 11,188, 16,121,221,104,154,230, 18, 4, 81, 0,192, 21, 45,
+243,201, 50,247, 79, 51,167,153,243,127,135,243, 31,137,102,115, 29,174,255, 14,162,223,166,249,152, 87, 16,189, 59,156,234,219,
+ 47,176,125,120,216, 90,178,123,247,238,112,117,117, 69, 64, 64, 0,114,115,115, 57, 86, 86, 86,205,229, 83,171, 14, 28, 62, 53,
+179, 99,199,142, 86, 31,127,252,177,104,232,208,161, 76, 87, 87, 87,208, 52,141,132,132, 4,196,196,196,104,247,238,221, 43,175,
+113, 24, 45,187,127,229,199,106, 83,242,169,221, 6,106, 0,172,115, 41, 40,216,179,104,225,194,181,157,187,116,121, 39, 44, 44,
+140, 20,242,121,204,141,171,231,114, 1, 96,253, 55, 71, 68, 99, 67,166,225, 43, 47,160,255,212,134,243,200,213,175,103,110,254,
+188,156,145,227,131,188, 62, 88, 60,199, 48,121,242,100,129,165,165, 37, 92, 93, 93, 97,109,109,141,140,140, 12,228,231,231,211,
+ 63,255,252,115,245,205, 7, 79,153, 39, 46,220,205,225,138, 28, 77,201, 75, 88, 21, 56,108, 82,214,200,145, 35,173,103,205,154,
+101,209,181,107, 87, 38,135,195, 1,135,195, 65,113,113, 49,210,211,211,181, 63,255,252,115,117,141,120, 68,197,253, 43, 81, 85,
+ 38,230, 58, 84, 6, 78, 9, 79,191,118, 49,108, 89,242,163, 71, 51,140, 64, 39,173, 86,235,108, 48, 24, 8,146, 36, 11,141, 70,
+227, 35,109, 85,213, 62,117, 64,216, 54,115,174, 67,211, 96, 48, 24, 88, 6,131, 1, 50,153, 12, 23, 47, 94,164,158, 61,123,182,
+230,225,195,135,107, 10, 10, 10,160,211,233, 48,113,226, 68, 4, 4, 4,224,202,149, 43, 40, 41, 46,254,185, 41,174, 84,160,146,
+147,159, 63,123,222,188,121,103, 35, 35, 35,201,135, 15, 31,218, 69, 68, 68,252,208,144,128,153, 49, 99,134,177, 56, 55,119,182,
+ 26,168,108,162,127, 54, 53, 54, 75,207, 69,125,253,112,220,132, 16,223,176,208, 53,204,222,189,123,195,206,206, 14,253,250,245,
+131, 86,171,181,242,241,241,105,110,108, 86, 5, 14,127, 43,163, 83,167, 78,130,109,219,182, 73,230,204,153,131,197,139, 23, 3,
+ 0,148, 74, 37, 46, 92,184,128,101,203,150, 21,229, 82, 61, 20,205,245,207,151,150,170, 90, 1,118, 21, 64, 32,128, 12,152, 29,
+223,205, 48,195,140,127, 38,106,147, 74, 59,226, 69, 98,233,211,120, 49, 57,111, 62,215,225,181,219, 73,168,159,230,227, 5, 28,
+ 31,235,221,102, 61, 91,176,124,147, 63, 67, 39,183,102, 18, 42,203,180,167, 79,137,230,114, 30,214,229, 83, 19,121, 87,219,102,
+254,212,125,227,250,245, 75,191,250,234,171,160,218, 16, 14,124, 62,255,145, 82,161,184,100,175, 86,111,175, 17,121, 95,106,105,
+110,190,124,160, 24,192, 66,235,251,247,119, 4,143,157,184,133,107,227,193, 92,181, 97,175,138, 65,146,154,244,130, 18,124,229,
+ 5, 8, 76,216, 32, 89,163, 1,146,101,142,250, 98,219,144,212, 79, 62,252,240,131,245,235,214,117, 23, 10,133,253,181,122,189,
+183,209,104, 4,140,198,180, 26,133,226, 42,173,213,222, 81, 7,132,110,229,138, 28,105,147,243, 18, 90,249, 84,217,100, 69,119,
+223,191,111,223,146,163, 71,143,254,174,237,182,106,245,142, 26, 43,159, 56, 83,218, 94,191,140, 10,184, 1,169,244, 70, 83,166,
+ 75,115,174, 67, 19,103, 31, 70,227,124,107,107,235,131, 65, 65, 65,220,193,131, 7, 99,212,168, 81,232,221,187, 55,140, 70, 35,
+104,154, 70, 85, 85, 21,142, 28, 57,130, 45, 91,182,164,181, 6,214, 53,199,167, 6, 46,113,206,156, 25,209,169, 83,167,136,166,
+ 4,204, 75,145,213,172, 79, 98,211, 99,147,147,166, 23,141,201,158,178,104,163,151, 70, 94,104,101,203,215, 75,146,147, 30,145,
+166,143,205,118, 85,134,132, 35, 61, 38,142, 31,191,136, 65, 81,253, 94,238,128,164,159, 60,126,124,191, 54,169, 52, 2,102, 95,
+108, 97, 95,170,141, 93,103,118,124, 55,195, 12, 51,254,233, 66,107, 20, 94,248,107,213,165,228,105, 52,215, 97,173,213,135,162,
+ 40,105,198,137, 5,211,154, 98,103, 2, 65, 47, 45, 89,104, 54,215,225,203,247,217, 64, 21,212,234, 79,127, 19,140,180,222,238,
+ 66,230, 43,229, 91, 18, 22,177, 2, 72,133, 94, 29, 12,233, 99,224,212,194, 23,124,221,215,127, 84,191, 77,141, 62,100,127,243,
+187,172,114, 21,112, 13,213,213,215, 80, 93,221,160,211, 46,147, 98,149, 55, 87,207, 87,219,158, 11,200,255,104,219, 95,229,108,
+ 86, 60,252,129,243,249,191,134,231,165,165, 39, 0, 8, 93, 98, 99, 29,206,197,198, 78,254,224,253,247, 39, 58, 58, 57,121,218,
+217,217, 89, 91, 88, 88,144,183,110,221,202,212,171, 84, 59, 58, 3,251, 95, 90, 83,155,133, 26,184,212, 46, 55,183,195,164,241,
+227, 23, 17, 20,213,183,190,128,161,245,250, 95, 61,128,157, 77, 89,178, 94,119,108,186,114, 28,131, 94, 90,178,192, 0,230,153,
+210, 55,242, 95,212, 99, 3,244,250, 13, 72, 76,108,160,207,183,184, 47,173, 39, 8,162, 10,102,199,119, 51,204, 48,227,159,139,
+218,124,135,167,255,191,127,120,176,153,211,204,249, 15,226,100,224,197, 46, 58,243,249, 52,115,154, 57,205,156,102, 78, 51, 76,
+ 2,101, 62, 5,102,152, 97, 50, 12,248,207, 50,152, 25,102,152, 97,134, 25,102,212,162,214, 55,171, 62,246, 0, 47, 92,119, 26,
+ 83,165, 45,217, 77,240, 58,202, 54,206,204,105,230, 52,115,154, 57,205,156,255, 21, 78, 62,126,191,236,109, 62,159,102,206,255,
+ 47,206,230,184,223,196,221,140,181, 62, 89,117,190, 89,255, 95, 48,155, 85,205,156,102, 78, 51,167,153,211,204,105,230, 52,115,
+254,211,225,248, 82,100,213,127, 1,104, 97,192, 82, 51,204, 48,195,140,127, 42,194,194, 64,210, 52, 8,154, 14, 35,105,250, 40,
+131,166, 67, 24, 52,141, 63,148, 10, 36, 36,164,225, 96,182,255,158,102,109, 97, 62,227,102,152,241,143, 66, 33, 26, 73, 42,109,
+246,209,250,239,194, 77, 34,145,236, 6, 64, 20, 21, 21,205, 7,144,107, 62, 37,127, 63,216,216,216, 4,233,245,122,200,229,242,
+ 75,127, 22, 39,131,193, 32, 12, 6, 3,253,119,104,159,175, 39,198,211, 36,124,234, 62,160,145,251, 36, 29, 7, 27, 42,235,227,
+133,153, 32,254, 19,139,139, 48,226,201,227,103, 56,222,130,159, 35, 71, 12,118,221, 9, 0,103,227,242, 22,225,175,137,171,213,
+214,222,222,254,114,207,188, 0, 0, 32, 0, 73, 68, 65, 84,254, 60, 69, 81,148,193, 96, 88, 40,149, 74, 99, 27, 23, 66, 33, 12,
+ 0, 96,210, 87, 86,202,138,196, 31,191,247, 47,130, 89,163,222, 39, 83, 43, 21,149, 12, 38, 35,139,195,148, 92, 95, 48,135, 60,
+ 91, 81,221,235,113, 67,199, 71, 71, 71, 55,154,197,187,131, 23, 70,144, 6,223,209, 1,126,153, 25, 95,108,239,254, 85,127, 15,
+ 59,102,102,222, 3,225,230, 93,149,187,217, 86,238,163,103, 78, 38, 98, 41, 62, 49, 99,223,190,178,234,127,234,216,217, 8,144,
+ 58, 38,179, 29, 97, 52,122,128, 32,248, 4, 0,218,104, 52, 18, 36,153,201,213,235,159, 46, 7,170, 95,131,211, 70, 11,248, 51,
+ 57, 28, 87,131, 94,239, 64, 0, 52,131,162,138,117,106,117, 30, 11, 72, 92, 9,200,254,233,156, 44, 14,199,197,160,215, 59, 0,
+192,223,177,158,102,252, 22,141, 10, 45,161, 80,120,143, 36, 73,151,250,201,112,107,243, 9,214,126, 86,255, 59,130, 32, 96, 48,
+ 24,242, 43, 42, 42,186,182,224,247, 45, 1, 76, 6, 80,187, 69,253, 48,128, 35,120,125,135, 99, 75, 22,139,181, 92, 32, 16, 12,
+ 82, 42,149, 29, 0,128,199,227, 37, 43, 20,138,203, 90,173,246,139,215,228,165, 0, 76, 18, 10,133, 3, 73,146, 28, 72,211, 52,
+ 65,211,244,149,234,234,234,203, 0,142, 2,120,157, 72, 9, 60,177, 88,188,193,198,198,102,234,202,149, 43,203,108,109,109,219,
+ 45, 91,182,236,110,121,121,249,143,165,165,165,171,209,130, 28,117,127, 49, 60, 37, 18,201, 97, 38,147,201,200,203,203, 27, 8,
+ 0,174,174,174, 87, 52, 26,141, 65, 42,149, 78, 3,240,172,133,124, 2, 0, 61,133, 66, 97, 87,161, 80, 24,104, 48, 24,124, 94,
+230,103,124, 82, 93, 93, 29,175,213,106,239, 1,184, 5, 64,241, 55, 26, 35, 22, 20, 69, 69,190,236,235,222, 0,170,254, 12,210,
+191,139,200, 2, 0,154,132,207,227,228,148,118,117,194,171, 67,251,198, 11, 19,112,107,160,172,201, 66,107, 80,127,199,209, 99,
+198, 12, 33, 1, 64,163, 59, 59,250,242,213,194,147,127,114,115,218, 78,152, 48,225, 70,100,100,164,181, 90,173,198,252,249,243,
+ 15,199,197,197,237,148,203,229, 43,155,188,113, 8,173,151,125,190,237, 2,159, 32, 72, 0, 16, 27,141, 6,241,243,231,207,188,
+ 31, 39,221, 24,158,156,124,115,163, 50,229,242, 45, 35,193, 92,160, 69,191, 20, 83, 42,225,227,129,224,209, 19,199,143, 90,183,
+ 46, 12, 83,223,154,218, 42, 57, 89,197,115,182,204, 96,151, 43, 5, 94,182,246,226, 49,235,214, 71, 19,215,175,157, 24, 19, 25,
+ 17,126,121,206, 28,219, 65,255, 64,177, 69,172,101,179,221,116, 6,195,112, 18, 40,164, 44, 44, 50,192, 98,213, 0, 0,105, 48,
+ 48, 52,114,185,103, 13, 69, 77,255, 20,184,243,137, 94,255,192, 84,206,245, 20,213, 83,228,229, 21,248,214,137, 19, 16,186,186,
+ 82, 20,135, 67, 2,128, 94,173,118,173,206,203,115,140, 26, 51,166, 71,216,211,167,191,132, 1,183,205,156,255, 21, 78, 51, 90,
+ 34,180, 72,146,116,121,254,252,185, 88, 32, 16,188,184, 25,211, 52, 12, 6, 3, 12, 6, 67, 93,242, 98,154,166,235,254,234,245,
+122,180,111,223,222,164, 25, 45,128, 65, 0,222, 30, 48, 96, 64,200, 23, 95,124,193,244,247,247,175, 77, 25,210,111,213,170, 85,
+223, 36, 36, 36, 28, 3,176, 31, 47,130, 55,154, 58,227, 29, 38, 16, 8, 14,125,254,249,231,150, 67,134, 12,161,156,156,156, 64,
+ 16, 4,138,138,138,122,198,197,197,117, 93,182,108,217, 66,133, 66, 49, 29,192,249, 22,156, 31, 63, 11, 11,139,232,241,227,199,
+187,244,239,223,159,235,235,235, 11,131,193,128, 7, 15, 30,204,185,119,239,222,148, 99,199,142,173,173,170,170, 10,129,233,249,
+218, 8,161, 80, 56,203,210,210,114, 67,104,104,168,205,244,233,211,217, 73, 73, 73, 21, 30, 30, 30,196,245,235,215,237,143, 28,
+ 57,178,112,211,166, 77,147,228,114,249,234,234,234,234, 3, 48, 33,135,162,133,133,197, 61,146, 36, 93, 76, 17,194, 47, 31,240,
+166,138,225,206,173, 91,183, 62,114,237,218,181,214,217,217,217,134,113,227,198, 29, 4,128,203,151, 47,251,235,116, 58, 98,232,
+208,161,103,243,243,243, 39, 3, 48,245, 38,217,209,198,198,230,228,212,169, 83,109, 60, 61, 61,249,173, 91,183, 38, 4, 2, 1,
+ 24, 12, 6, 42, 43, 43,157,146,146,146, 6,223,190,125, 91, 25, 23, 23, 87,174, 86,171,199, 0, 72,108,193,117,234, 45, 22,139,
+103, 48,153, 76, 63,189, 94,239, 12, 0, 20, 69, 61,215,233,116, 73, 82,169, 52, 18,192,141,215, 29, 32, 14, 14, 14, 95,111,216,
+176,193, 78, 42,149,210,155, 54,109,250,186,170,170,106,150, 41,199, 69, 68, 68,144,179,103,207,254, 75,162,160,175, 91, 23,206,
+ 12, 13, 93,171,251,179,121, 15,255,120, 20,247,238,222, 6, 94,164,205, 33, 26,232,127, 4, 0,214,123,239,189,143,174,221,122,
+ 96,218,212, 73,205,114,142, 12,114,249,156,201,102,217,170, 84,170, 27,149, 53,234,163, 2, 62,119,242,212, 41,193,105, 0,112,
+246,220, 47,147,187,119,183,190, 34,226,115, 38,113,185,220,222, 58,141,182,236,204,165,252, 15, 91, 34,170,156,157,157,207, 91,
+ 91, 91,243,203,203,203,139, 74, 74, 74,190, 27, 61,122,244,250,253,251,247, 91,103,102,102, 34, 47, 47, 15, 75,151, 46, 21,230,
+231,231, 47, 74, 76, 76,188,169,209,104, 26,181,108, 85, 85,149,111, 95,245,241,216, 80,145,200,142, 33,224, 91,194, 66,100, 3,
+ 15,207, 78,232,217,123, 52, 70,140,122, 7,233,105, 9, 61,247, 71,172, 75,120,254, 60,238, 51,161, 77,155,245, 50, 89,235, 70,
+175,173,111, 91,244, 31, 51,254,133,200, 10, 13, 13,195,211,148,148,170,236, 44,242,223,167, 79, 80,252, 17, 65,237, 57,122, 77,
+ 81,246,245,107, 39, 90,247,237, 55, 14, 0,186, 70, 70,132, 95,254,247, 52,235,160,175, 15, 87, 84,253, 67,158, 43,196, 58, 38,
+211, 15,122,125, 91, 91, 71,199, 40,149,209, 72,235, 42, 43, 93,141, 53, 53,142, 0,160,103, 50, 53, 2,161,240,145,147,151, 87,
+252,211,251,247, 3, 63,165,168,126,159, 52,157,160,188,150,115,214,176,109,219,196, 1, 11, 23,178,170,179,178,180, 25,187,118,
+213, 20,199,199, 27, 40, 14,135,118, 29, 62,156,176, 31, 56,144,187,240,201, 19,214,175,155, 54, 5, 50,195,195, 61, 86,107,181,
+135,204,156,255,175,156,255,235,168,117,130,175,191,251,112, 79,147, 66,139, 32, 8, 8, 4, 2, 68, 69, 69,129,201,100,130,162,
+ 40, 48,153,204, 70,223,187,185,185,153, 82,145, 9, 18,137,228,155,157, 59,119, 58, 12, 27, 54, 12, 92, 46,183,238, 11, 6,131,
+129, 33, 67,134, 96,240,224,193,204,130,130,130, 41, 81, 81, 81, 83, 54,110,220, 88, 44,147,201, 22,227,101, 98,232, 38, 48,176,
+ 93,187,118, 49, 23, 46, 92,224,169, 84, 42,196,199,199,163,162,162, 2,108, 54, 27, 46, 46, 46, 24, 58,116, 40,149,146,146, 98,
+ 51,100,200,144,152,167, 79,159, 6, 3,184, 98, 66, 93,187,138,197,226,171, 71,143, 30,229,118,234,212,137, 72, 79, 79, 71, 64,
+ 64, 0, 0,160,178,178, 18,227,198,141,227, 78,159, 62,221,115,202,148, 41,183,164, 82,105,127, 0,247,154,225,235, 34,145, 72,
+ 14,140, 31, 63,222,105,227,198,141,150, 22, 22, 22,200,206,206, 46,148, 72, 36,222,181,231,123,202,148, 41,236,209,163, 71, 59,
+110,217,178,101,123,116,116,244,135, 82,169,116, 22,128,251, 77,170,214,151,130,152,207,231,163,184,184, 24,135, 15, 31,198,162,
+ 69,139,192, 96, 48, 32,149, 74,113,228,200, 17,252,251,223,255,174, 21, 52, 38,137, 97, 62,159, 63,216,203,203,235,135,203,151,
+ 47,187, 88, 89, 89,193,201,201,137,252,228,147, 79,252, 60, 60, 60,120,173, 90,181, 98, 20, 22, 22, 34, 38, 38,198, 99,198,140,
+ 25, 39,115,115,115,231,168,213,234,102,151,212, 28, 28, 28,246,157, 62,125,218, 45, 57, 57, 25,187,118,237, 66,121,121, 57,216,
+108, 54,172,172,172, 32,145, 72,224,237,237, 77,124,252,241,199,252,209,163, 71,243, 23, 47, 94,188, 79,163,209,116, 54,225, 26,
+117, 18,139,197,187, 7, 14, 28,232, 17, 30, 30,110, 37,145, 72, 80, 59, 49,168,172,172,116,201,206,206,238, 25, 26, 26, 26,114,
+239,222,189, 76,169, 84,186, 0,192,195, 22, 14,156,206,190,190,190,193,227,198,141, 99, 20, 22, 22, 34, 50, 50, 50,184,170,170,
+170,179, 41,226,146,162,168,191,204, 98,101,164,105, 14,128, 63, 93,104,221,187,123, 27,243,223, 93, 90,237,228,234,202,186,112,
+254,135, 9,209,199,219,222,181,226,189, 72, 72, 45, 83, 66, 27, 50,254,105,183,161,195,222, 97,141, 28, 53,174,122,207,183,219,
+133,166, 8, 45, 38,155,101,123,248,208,151,185,215,174,223,243,187, 24,119,123,248,132, 49, 99,104, 22,203,202, 3, 0, 62, 92,
+246, 30, 51,230,212,169,136, 33,131,123, 20,244,235,219, 53,119,218,244,247,221, 90, 80,221,182,109,219,182,253, 37, 33, 33,193,
+129,195,225,160,188,188,220,118,207,158, 61, 95,246,237,219,151,204,200,200, 64, 74, 74, 10,178,178,178, 80, 89, 89,137, 33, 67,
+134, 8,239,223,191,255, 29,128, 70,133,150,150, 28,180,193,169,149,110,135, 45, 79,208, 90,107,144,139,105, 93,161,239,197,211,
+ 23, 59,254, 20,169, 12,112,112,108,239,253,246,236,181, 88,183,254, 24,243,199,195,155, 67, 47,197,253, 4,144,173, 27,207, 8,
+ 64,163,247,170,213, 43, 33,175, 82, 99,250,212,121,152, 49,117,158, 45, 13,141, 35,109, 80, 9, 52,202, 10, 43, 11,214,147,216,
+157,123,191, 28, 15,192,165,158,216,186,244, 79, 17, 91,235, 88,172,214, 48, 26, 61,188,199,141, 59,145,113,238, 92, 27, 90,171,
+181, 99,176,217,249, 22, 54, 54,197,122,181,154,214,105,181, 44,165, 82,233,156,145,156,236,216,247,227,143, 47, 93,223,180,169,
+255,167, 12, 70,183, 79, 12,134,187,141,114, 82, 84,143,224,111,190,177,247,155, 59,151,243, 48, 60, 92, 81, 26, 31,175,244, 26,
+ 57,178, 34,224, 95,255, 82, 3, 64, 85, 86, 22,235,233,218,181,124,251,192, 64, 94,175,229,203,173, 13, 26,141,100,221,186,117,
+221, 67, 95, 36, 47,111, 17,167,219,228,201,134,208,136,136,110,241,239,191, 63,128,208,233, 24,195,123,245,122,176, 41, 50,242,
+249, 31,225,252, 51,235, 89,112,245,170,186,220,195, 3, 1,227,198,149,185,137,197,234, 63,179,237,127,164,158,102,212,161,214,
+ 87,107,126,253, 25, 42, 98, 99, 99,251, 3,248, 5, 64,120,112,112,112, 24, 0,136, 68,162, 98,153, 76, 38,142,137,137,105, 86,
+100, 49,153, 76, 56, 58, 58,194,219,219, 91, 42,149, 74, 29,154,168, 64,158,209,104,116,161,105,186,206,250,210, 24,212,106, 53,
+210,210,210,208,177, 99,199,124,188, 72, 68,219,168, 81,135,207,231,103,164,164,164,216, 61,126,252, 24,247,238,221,131,135,135,
+ 7,172,173,173,193,100, 50,161,211,233, 32,151,203,209,174, 93, 59,112, 56, 28,116,233,210,165, 84,161, 80,120, 52,179, 4,196,
+ 17, 8, 4,105, 87,175, 94,117, 13, 8, 8,192,157, 59,119,224,234,234, 10,137, 68, 2, 0,200,202,202,194,245,235,215, 49,114,
+228, 72, 36, 36, 36, 96,226,196,137,121, 10,133,194, 27,128,186, 49, 66, 27, 27,155,194,203,151, 47,231,251,251,251,171, 20, 10,
+ 5, 89, 92, 92,204,140,143,143,215, 87, 85, 85, 9, 43, 43, 43,153, 50,153,140, 41,151,203, 41,133, 66,193, 36, 73,146,165, 84,
+ 42,153,151, 46, 93, 98,104,181,218, 38, 3,100,214, 94,167, 83,167, 78,193,223,223, 31, 49, 49, 49,248,224,131, 15,240,235,175,
+191,194,213,213, 21, 71,143, 30,197,242,229,203,145,154,154, 10, 59, 59, 59,248,250,250, 54,119,141,224,233,233,153,254,232,209,
+ 35, 79, 22,139, 85,155,215,177, 54, 95, 30, 74, 74, 74,240,236,217, 51, 60,127,254, 28, 94, 94, 94,152, 58,117,234,179,231,207,
+159,123, 53,215,243,156,157,157, 75,146,147,147,237, 58,118,236,136,226,226, 98, 88, 89, 89, 65, 36, 18,193,202,202,170,238,189,
+135,135, 7,222,127,255,125, 72, 36, 18,169, 74,165,114,104, 78, 4,249,251,251,159,191,116,233,146,157,165,165, 37,138,138,138,
+ 32,151,203, 65, 81, 20,248,124, 62,236,236,236,234,132,124, 90, 90, 26, 70,141, 26, 85,154,145,145, 49,172, 5, 22, 56,210,193,
+193, 33, 37, 49, 49,209,155,166,105,228,230,230, 34, 53, 53, 21,239,190,251,110,154, 74,165,106,143,255, 98,206,190, 3,251, 15,
+112,102,189, 61, 75,253,103,241,213,243,187, 98,205,154, 61,159, 53,126,108,111,205,147,228, 88,130, 99, 76, 69,103, 63,203, 74,
+ 0,120,144, 36, 23,169,201,118,240,233, 16, 76, 31, 63,121,131,125, 96,255, 30, 38,140,112, 0,129,212, 39,105,248,180, 49,238,
+161, 3, 29,231,190,247,222, 28,191, 1,125,251,147, 85, 10,133,248,187,239,182,117,201,200,120, 34, 6, 0, 15, 15, 31,233,194,
+133,203,238, 91, 8, 4,210, 95,174, 95, 53,126,245,213,190,164, 11, 87, 10,247,154, 80,101, 15,111,111,239,155,167, 78,157,178,
+ 19,139,197, 16,137, 68, 80, 40, 20,208,106,181,120,252,248,177, 42, 42, 42, 74,103,105,105,105, 81, 84, 84, 4,153, 76, 6,130,
+ 32,112,234,212,169, 92, 0,238,175, 18,213,250,104, 1,192,187, 35,124,152,190,131,188,173, 89, 28, 61,143,199,124,234, 8,194,
+192, 33,104,161,195,217,243, 15, 58,158,189,120,103,218,248, 9, 31,216,247,235, 63, 30,161,107, 66,116, 5, 5,185, 1, 90,244,
+ 75,105,200, 71,171,189, 23, 6,141,155, 56,126,210,186,117, 97, 8, 11, 13, 71,236,169, 19,149, 66, 1,169,182,180, 98,138, 2,
+123,246, 81,189,191,104,108, 94,117,117,129,235,186, 45, 81, 83, 71,141,125,223,165,111,191,113,184,126,237, 4, 34, 35,194,239,
+ 17, 60,250,141, 94, 70, 92, 11,176, 72,138,122,199,169,117,235, 67,210,130, 2,103,190, 80,200, 92, 26, 23, 39, 54, 24, 12,119,
+ 39, 45, 95, 94,117,252,210,165,186, 9,200, 39, 36,233,196, 96, 48,156,188, 71,141, 74, 76,143,141,125,135,163,215,199,124, 4,
+148,188,202, 25, 6, 88, 91,121,120, 44, 88,146,150,198,122, 24, 22, 86,173, 47, 40,168,232,186,108, 89,105, 67,191,159,127,241,
+162,128,237,228,100,105, 61,102,140,205,118,119,119, 90, 39,149,238,110,200,199,168, 33,206, 56,161,208,234,167,179,103,131,104,
+ 38,179,255,138,143, 62,226, 5, 7, 7, 67, 46,151,227,216,177, 99,216,189,107,151,218,209,209,241,145, 83, 82, 82,130,159, 92,
+190,198, 84,206,174,203,150,149, 26, 12, 6, 98,210,242,229, 67,146,179,178, 6, 21, 73,165,173, 0,192,209,198, 38,175,171,135,
+199,189,125,177,177,169, 95,183,110,109, 52,181,158,223,159, 59,231, 16,157,157, 61,215,198,198,134, 87, 44,149, 82, 28, 54,187,
+172,167,175,239,209,111, 87,175,254, 69,159,152,200,226,186,184, 88,138,130,131, 91,220,246,174,203,150,149,150, 87, 85, 81, 75,
+214,175,239,147, 83, 92,220,170, 90,173,246,146, 85, 85, 73, 12, 58, 29,105,201,231,151,181,105,215, 78,170,140,143, 47,108, 83,
+ 83,179,116, 47, 32,253,171,250, 79, 67, 90,228, 13,194,171,113,180,126,151,235,240,151,224,224,224,223,237,174,161,105,218, 36,
+107, 22,147,201,252,205, 50, 85, 19, 96, 17, 4,129,251,247,239,195,214,214, 22, 18,137, 4, 28,206,111,147, 15,150,148,148,224,
+215, 95,127,197,147, 39, 79,208,169, 83,167,218,101,140,198, 21, 17,135,243,222,150, 45, 91,172, 52, 26, 13,238,221,187,135,174,
+ 93,187,130,195,225,128,197, 98,253, 70, 4, 74,165, 82,116,232,208, 1, 43, 86,172, 16,109,220,184,241, 61,181, 90,189,174, 9,
+107,196,226,121,243,230,137,107, 45, 88,121,121,121,232,210,165, 75,221,247,246,246,246,120,240,224, 1,186,118,237, 10, 23, 23,
+ 23,132,132,132,136, 35, 35, 35, 23,235,245,250, 47, 26,227,100,179,217,164,191,191,127, 55, 0, 16, 8, 4, 32, 73,242,169,165,
+165,165,189,131,131,131,192,210,210,146,213,192,210,147,140, 36,201,102,173, 22, 36, 73,162,168,168, 8,126,126,126,168,172,124,
+145,193, 69,161, 80,192,203,203, 11,114,185,188, 78,180, 58, 57, 57, 65,169,108,218,245,171, 99,199,142, 97,237,219,183, 31, 42,
+ 16, 8, 56, 76, 38, 19, 15, 31, 62, 68, 64, 64, 0,162,162,162,224,230,230, 6, 62,159,143,180,180, 52,248,251,251,227,234,213,
+171,176,183,183, 71,135, 14, 29, 56, 98,177,248, 90,121,121,249,149,156,156,156,176, 38,234, 73, 10,133, 66, 92,189,122, 21,251,
+246,237, 67, 86, 86, 22, 10, 10, 10, 96, 97, 97,129,206,157, 59,195,215,215, 23,189,123,247, 70, 90, 90, 26,136,230, 59,147,196,
+219,219, 59,246,206,157, 59,118, 52, 77, 35, 50, 50, 18,213,213,213,208,104, 52, 32, 73, 18, 92, 46, 23,214,214,214, 24, 52,104,
+ 16,236,237,237,225,237,237,141, 35, 71,142,216,141, 24, 49,226,140, 84, 42,237, 12,160,168,185,243,106,109,109,189,116,237,218,
+181,174, 98,177, 24,217,217,217,168,172,172,132,131,131, 3, 6, 12, 24,224, 28, 23, 23,183, 84,167,211,109,251,111,141,230, 63,
+ 83,100, 1, 64, 61,199,119,226,194,249, 31, 38,120,183,169,240,239,212,142,239, 26, 19,235,224, 26, 21, 43,237, 0, 0,126, 62,
+ 14,201, 19,130,249,121, 15,147, 99,243, 46,156, 63,113,239,201, 83,196,152,178,180, 93, 89,163, 62,122, 49,238,246,240,128, 78,
+ 93,140, 91, 54, 47, 31,181,232,221,185, 28,177,195, 59, 40,206, 61,129,184,203,247,221,150,127, 48,207,254,139,173,223,159,189,
+ 24,119,155,172,172, 81,175, 49,205,148,229,246,245,254,111,123,219, 85,149, 70, 35, 61,133, 13,158,133, 31, 60, 60,218, 66, 46,
+151,131,203,229,114,167, 78,157,106, 88,185,114,101,141,165,165, 37,159, 32, 8, 92,185,114, 69, 10, 96, 88,115,188, 42,177, 53,
+109,208,234,244, 52,155, 97,164, 9, 11, 37, 97, 40,103, 39, 61,206,196,208,193, 3,139,251,246,240,219,184,114,221,214, 85,222,
+109, 3,236,231,204, 13,103,174, 15,155,182, 11, 4,250, 53,196,147,146,142,203,196,209,227, 60, 0,163,214,125, 26,134,140,140,
+ 52,235,249,111,203,194, 41, 14,207,169,189,123, 31,139, 93,251,174, 12,247,242,106,221,234,253,197, 33,167,191,252,230,203, 81,
+245, 45, 91,251, 35,214,158, 4, 16,100,202,185,253, 59,130,164,168,118, 36, 65,228,201,107,106, 24,180, 86,107,183, 52, 46, 78,
+121,225,214,173, 75,137,243,231, 91,116,100,177,218,118,100,177,192,208,106,203, 86, 3,165,159, 26,141, 5,107, 41,202, 50,243,
+228, 73, 39,138,205, 78, 80, 25,141,254, 48, 26, 27,138,159,212,113, 70,108, 44,170,115,115,117,229,215,174,169,130,190,249,166,
+212,117,216,176,109, 26,173,214,174,246, 86, 65, 18, 4,136, 90,215, 9,163,145,160, 86,172, 32,105,138,130,206,218,250,109, 84,
+ 84,180,109,142,243,131,194,194, 9,211,230,206, 29,117,242,220, 57,180,110,221,186,238,121,102,101,101,133,229,203,151, 99,217,
+178,101,156, 7, 15, 30,116,143,142,142,238,254,197,231,159, 59, 0,152, 96, 74, 61, 47,220,186,101,253,175,117,235, 86,119,234,
+218,213,237,224,225,195, 28, 79, 79, 79, 0,192,179,103,207,188, 55,111,218,228,238,231,239, 95,188,241,189,247,246, 39,175, 92,
+217, 1,192,181,166, 56,139,226,227, 53,209,217,217,115, 47, 95,185, 98,229,231,231, 7, 0, 72, 77, 77, 21,111,223,190,125, 94,
+135,144,144,233,235, 22, 46, 92, 19,172, 82,201, 44, 75, 74, 56,193, 95,127, 77,253, 52,105, 82,179,156,181,245, 4,128, 1,115,
+230,188,215,111,224, 64,223, 9,115,231,218,184,185,185, 17, 66,161, 16, 90,173, 22, 5, 5, 5,214,201,201,201,158,177, 85, 85,
+242,227,183,110, 69,194, 96, 24,242, 23,118,161, 6,181,200, 27,102,201,250,253,184,120,249,119, 64,108,108, 44,253, 82, 77,214,
+ 61,192, 13, 6,131, 73, 34,139,162, 40, 16, 4, 97,170,216, 2, 77,211, 40, 45, 45, 69, 82, 82, 18,158, 61,123, 6,133, 66,129,
+204,204, 76,236,217,179, 7,155, 55,111,198,221,187,119,161,211,233,160,213, 54,159,131, 86, 32, 16, 12, 30, 60,120, 48,117,235,
+214, 45,120,120,120,128,199,227,129,205,102,131,197, 98,213,189,184, 92, 46, 28, 29, 29, 33,151,203, 17, 20, 20,196, 20, 8, 4,
+131,155,177, 18,141,156, 60,121, 50,187,246,255,234,234,106, 48, 24,140, 58,209, 82, 93, 93,141,242,242,114,200,100, 50, 20, 22,
+ 22,162, 87,175, 94,108,145, 72, 52,210,212,171, 81, 83, 83, 83, 45,149, 74,173,250,245,235,103,253,228,201,147,223,101,251,253,
+229,151, 95, 84, 42,149,138, 73,146,164, 73,142,246,135, 14, 29, 66, 76, 76, 12, 46, 93,186,132,252,252,124,236,218,181, 11, 7,
+ 15, 30,196,169, 83,167,144,150,150,134, 29, 59,118,224,187,239,190,195,254,253,251,155,188, 70,237,219,183, 31, 17, 25, 25,217,
+163,103,207,158,124, 6,131,129,212,212, 84,188,255,254,251,144,201,100,176,183,183, 7, 0, 20, 23, 23, 99,219,182,109, 80,171,
+213, 16, 10,133,112,118,118,230,174, 91,183,174,175,189,189,253,208,166,234,104, 48, 24, 12, 12, 6, 3,238,238,238, 8, 13, 13,
+197,119,223,125,135,243,231,207,227,232,209,163, 88,184,112, 33,124,125,125,145,144,144,128,187,119,239,130,166,233, 38, 31, 50,
+ 92, 46, 55,228,224,193,131, 98, 54,155, 13,163,209,136,170,170, 42,228,230,230,226,246,237,219,170, 19, 39, 78, 84,159, 62,125,
+186,230,218,181,107,170, 27, 55,110,208, 0,234, 4,103,112,112,176, 45,155,205,126,203,132, 83,106, 47,145, 72, 86,205,155, 55,
+143, 91,191,207, 22, 21, 21, 97,194,132, 9,124, 30,143,183, 18,128,125, 83, 4,145,145,145,127,217,205, 34, 44, 60,204,242, 47,
+162,166,163,143,183,189,203, 49,166, 34, 38,246,185,107, 78,190,161,207,242, 15,183,218, 44,255,112,171, 77, 78,190,161, 79, 76,
+236,115, 87,142, 49, 21,209,199,219,222, 53, 65, 8,144,131,250, 59,142,117,176,181,218, 61, 97,204, 24,250,187,239,182,117, 89,
+244,238, 92,142,123,219,229,224,138,166,194,217,227, 95, 8, 10,116, 35, 58,250,146,220,239,190,219,214,101,194,152, 49,180,131,
+173,213,238, 65,253, 29,199,162,153,176, 51, 98, 91,174, 51,159,163,128,167,183, 47, 6,244,239, 4, 38,145,142, 99, 71,247,161,
+176,176, 16, 5, 5, 5, 40, 46, 46, 22,140, 30, 61, 26, 69, 69, 69,170, 43, 87,174, 72,149, 74,101,127, 0, 79,155,107,124,126,
+254, 99,163,170,218,160, 53, 26,152,250,170, 74, 86,205,194,165,209,131,239, 38,179,102, 23,201,156, 71,179, 57,214,236, 17, 67,
+186, 31,222,183, 55, 20,109,218,248,161, 91,247,161,189,172,133, 55,125, 27, 21,175, 25,136,253,249,216,241,147, 83, 39, 79,213,
+103,101,102,103,182,117,224,106,104,154,214, 45,253,248,251, 33, 76,129,107, 71, 79,159, 64,251, 39,233, 6,199,208, 21,111,253,
+120,250,228,151,249,215,175,157, 64,223,126,227,224,236,228,221,255,237,183,193,126, 83, 45, 90, 4, 77,123, 48,133,194, 12, 93,
+101,165, 59,197,225,228, 26, 12, 6,187, 59, 11, 22, 88,105, 89, 44, 71,131, 86, 91, 96,208,106, 11,180,108,182,229, 78, 31, 31,
+ 23,154,166,109,173, 92, 92,158,211,108,182,155, 94,171, 77, 39, 72,178, 77,131,179,115, 14,199, 69,232,238, 78, 21, 93,184,160,
+241, 24, 61,186, 2, 0, 52, 90,173, 93, 86,118,182,168, 88, 42, 21, 21, 21, 23,139,114,242,242, 68, 25,153,153,162,180,244,116,
+ 81, 74,122,186,229,163,164, 36,225,131, 71,143,132, 4,131,225, 96, 10,103, 86, 65, 65,199, 21, 43, 86,128,199,227, 65,175,215,
+ 55,116,207,134, 66,161,192,219,111,191,141, 26,160,167, 41,156, 6,131,129,248,215,186,117,171, 63, 90,189,218, 51, 38, 38,134,
+211,163, 71, 15,216,216,216,192,198,198, 6, 61,122,244, 64,244,177, 99,236,133,139, 23,187,172,218,187,247,109,146,195,113,109,
+142,179,212,203, 11, 54, 54, 54,188, 90,145, 5, 0,237,218,181,195,174, 93,187, 56,231,206,159, 23,125,250,195, 15, 91,195,111,
+220,240, 87,231,228, 40,108,219,182,165,217, 28,142,139,169,231, 19, 0,170, 84, 42,191,109,219,183,219,218,217,217, 17,197,197,
+197, 72, 79, 79, 71, 78, 78, 14,244,122, 61,186,117,235, 70, 28, 61,118, 76,164, 97, 48,186,255,197, 93,232,119, 90,228, 13,194,
+124, 52, 18, 71,139,122,249, 0,186, 10,128,136,141,141,165,107,151, 19, 95, 62, 28,235,196,148, 41, 66,235,117, 32,147,201, 32,
+147,201,176,119,239,222, 58, 97, 84, 11,141, 70, 99,138,104,241,119,114,114, 66,101,101, 37,218,182,109,251, 27, 75, 22,139,197,
+ 2, 69, 81, 96,177, 88,224,112, 56, 80,171,213,112,115,115, 67, 77, 77,141,127, 83,156, 74,165,178,179,141,141, 77,221, 3, 86,
+173, 86,215,137,172,218,250,106, 52, 26, 84, 84, 84,160,186,186, 26, 85, 85, 85, 80, 40, 20, 1,166,180,215,104, 52, 34, 41, 41,
+233, 89,187,118,237, 58, 51, 24, 12, 8,133, 66,129, 66,161,168,243, 45, 42, 47, 47,199,129, 3, 7, 20, 51,103,206,180, 59,117,
+234, 84,179, 9,139, 9,130,192,191,255,253,111,112, 56, 28,212,212,212,224,187,239,190,195,146, 37, 75,192, 98,177, 80, 85, 85,
+133, 93,187,118,225,253,247,223, 7, 69, 81,208,104, 52,216,190,125,123,163, 92,143, 31, 63,206,186,117,235, 86, 64,151, 46, 93,
+172,143, 31, 63, 94, 50,100,200, 16,251, 97,195,134,129,199,227, 65,169, 84, 66,167,211,161,103,207,158,104,223,190, 61,164, 82,
+ 41,206,158, 61, 91,234,237,237,109,119,251,246,109, 99, 81, 81, 81, 78, 51,226,154,174,103, 49,132,193, 96, 64,113,113, 49,100,
+ 50, 25, 74, 74, 74, 80, 80, 80,128,252,252,124, 80, 20,133,102,116, 22,108,109,109, 39,250,249,249, 49, 0,128,199,227,161,115,
+231,206, 88,189,122,181, 94,169, 84, 78, 6,112,246,101,177, 17,223,127,255,253,241,235,215,175, 83, 78, 78, 78, 72, 73, 73,129,
+189,189, 61,197,229,114,223,210,104, 52, 77, 90,163, 36, 18, 73,196,207, 63,255,108, 83, 43,174,107,207,115, 77,205,139,203, 49,
+ 97,194, 4,155,131, 7, 15, 70,232,245,250, 70,197,117, 97, 97,225, 95,103, 53, 32, 24,234,191,138,219,138, 7, 86,103, 63,203,
+202,168, 88,105,135,229, 31,110,165,218,251,189,152,188,206, 95, 0,234,139,207, 63,232, 48,125,172,229,105, 43,158,156,213, 28,
+207,136,193,174, 59,199,140, 25, 66, 78,157, 18,156,198, 98, 89,121,236,222, 19, 46, 22, 59,188, 83,175, 17,150,176,181,179,132,
+135, 59,155,136, 62,253, 68,252,241,202, 79,213,135, 14,126,153,241,227, 79,177,195,217,204,139, 67,207,198,229, 45,108,140,251,
+233, 51,217,169, 26, 53,215, 71, 94,150, 72,216, 56,244, 65,231, 78,237, 32,182,175,192,247, 17, 81,104,221,166, 27,212,106, 53,
+ 44, 45, 45,249, 6,131, 65,203, 96, 48, 14,153, 34,178, 0,224,210, 37,153,177, 67, 7,153,134, 81,101,212, 47, 90,242,197,248,
+ 33, 35,198,248, 14, 26, 52,216,120,225,226, 5,109,159, 0,109,225,136, 97,157,139,207, 93,220,153, 86, 88,144,233,221,193,191,
+ 47, 30, 39, 95, 25, 78,211, 72, 34,136,134, 69,103,114, 58,206,169,140,143,175, 68, 69,205, 55, 42,141, 9,188,245, 27, 30,141,
+ 24, 53,106,150, 95, 96,191, 64,227,197,184,203, 26, 54, 74,159, 88,246,237,253,124,209,220, 17,199,127, 56,180,125,232,185,179,
+ 17, 94,149,242,156,216,253,251,161,198, 27, 10,154, 32,236, 45, 4,130,146,178,170,170, 78, 19,195,195,229,147,150, 47, 63,223,
+145,162,124, 13, 90,109,102, 56,160,164,105,154, 48,234,245, 43, 31, 29, 62,204, 8, 35,136,143,195, 1,227, 6, 6,131,153,111,
+ 52,214, 56,147, 36,127, 45, 64,133,191,178,147,219,160,215, 59, 80, 28, 14, 89,114,229,138,222,255,157,119,212,181,227,145,207,
+231,227,228,201,147, 96,179,217,117, 47, 22,139, 85,247,222,193,193, 1,196,203,109,164,191,155,248, 53,192, 89, 59,110,139,138,
+138, 32, 18,137, 96,111,111,143,162,162, 34,220,184,113, 3, 79,159, 62, 5,147,201,196,240,225,195, 65, 54,226,219,252, 42,231,
+164,229,203,135,248,248,251,187, 45, 88,176,128,124,245,249,168,213,106, 81, 94, 94,142,177, 99,199,146,103,207,158,149,156,203,
+205, 29, 3,224, 80, 83,156, 1,163, 70,149, 21, 71, 71, 55,248,219, 93,186,116, 33,126,253,245, 87,206,240, 97,195,150,125,176,
+ 97,195,206,175, 15, 30,204, 51,232,245,146,150,180,157, 36, 73,146, 32, 8,184,186,186,162,188,188, 28,213,213, 47, 86,176,133,
+ 66, 33,172,173,173,161,211,233, 96,164,105,230, 95,217,127, 26,211, 34,111, 8,246,212, 19, 92,191,177,108, 81, 47,215, 69,107,
+111, 20, 3,234, 63, 88,140, 70,163, 73, 34,139,201,100, 54,235,115,101,138,149,235, 85,152, 34,180,106,235,202,229,114,127, 99,
+201,170, 21, 88,181,245, 36, 73, 18, 12, 6,163,217,135,248, 75, 49,196,168,170,170,194,177, 99,199,208,191,127,255,186,101,169,
+202,202, 74,200,100, 50, 84, 86, 86, 66,165, 82, 33, 43, 43, 11,151, 46, 93,130,151,151, 23, 96, 98,240,215,140,140,140,123,173,
+ 91,183,238, 90,251, 16, 31, 56,112,160,203,254,253,251, 11, 70,142, 28,233, 68,211, 52,214,172, 89, 83,218,179,103, 79,187,250,
+ 15,249,230,192, 96, 48,112,227,198, 13,120,121,121,129,166,105,176, 88, 44,164,166,166, 66, 44, 22,195,104, 52,130,162, 40,148,
+148,148,192,194,162,233, 24,137, 73, 73, 73,179,231,204,153, 83, 32, 18,137, 58,150,149,149, 21,114, 56,156,126,241,241,241,174,
+ 90,173, 22,150,150,150,176,180,180,196,153, 51,103, 96,101,101,133,247,222,123, 47, 87,169, 84,222, 16, 8, 4, 14, 74,165, 50,
+177,168,168,104, 77, 75,174,183, 94,175,135, 66,161, 64, 69, 69, 5,202,203,203, 33,151,203,161, 82,169,154,173, 99, 67,232,215,
+175, 31, 98, 99, 99, 25,159,125,246,217, 15, 25, 25, 25, 0, 0, 15, 15, 15,188,247,222,123, 12,103,103,103,100,101,101,225,222,
+189,123,208,106,181,160,105,186,201,193, 75, 81,212,192,153, 51,103,246,117,115,115, 35,180, 90, 45,140, 70, 35,212,106, 53,106,
+223,231,230,230,194,199,199,135,116,119,119,239,149,145,145, 49, 16,141,108,172,168, 63, 97,248,179, 17, 26,250,137, 6,111, 32,
+138,115, 79,192,153, 41, 6, 72, 75,208,202, 19, 40, 43,125,189, 40, 46, 82,169,116,195,138, 79,126,125,231,235, 45, 90,135,252,
+ 66,160,157,223, 56,120,251, 6, 97,246, 12, 61, 62,251,252, 24,220,220,219, 33, 39, 39, 7, 3, 7, 14,100, 21, 20, 20,204,169,
+174,174, 94,110, 42,247,197,139,183, 12, 23,206,156, 13,153,244,214,172,174,131, 7,143,212,159, 63,127, 6, 73,137,231,147,231,
+188, 53, 81, 74, 27,171, 9, 27, 43, 94, 66,106,202, 93,239,142,157, 7, 64,163, 55,244, 3,194,182, 0, 97,116,227,227, 29,154,
+211,167, 29,201,211, 39, 34,102, 76,157,254,118,167,160,160,161,186,243, 23,127,198,189,155, 23, 31,110,221, 50,239,234,103,219,
+143, 12, 28, 50,124, 98, 7,123,135, 27,103,252,218,170,231,186,218,138,158,125,191,191, 28,111, 48, 40, 22,151,171, 7, 64, 90,
+185,187,187, 28,191,116, 41,187, 51,147,201,176, 4, 12, 52, 77,183, 3, 96, 71, 82,212,170, 83,115,231, 6,248,188,124,144,234,
+ 1,163, 15, 64, 86, 2, 26, 1,192, 70, 35, 33,115, 40, 46,215,136,151,247, 69,146, 32, 64,211,244,111, 68,214,171, 66,139, 36,
+201,102, 13, 0,245, 57,235, 63,139,106, 39,212,187,119,239, 6,135,195, 1,155,205, 6,147,201,108,214,253,162, 62,103,114, 86,
+214,160, 3,135, 14,113, 26, 18, 89,101,101,101, 40, 43, 43, 67,117,117, 53,166, 76,153,194, 10,191,123,183, 11, 94,186,126, 52,
+198,233,230,232,168, 22,240,120,197,143, 31, 63,118,242,245,245,253, 77,125,229,114, 57,120, 60, 30, 14, 29, 62,204, 10, 30, 53,
+234,221,160, 51,103,182,162,153,248, 87, 13,181,157, 32, 8,136,197, 98, 88, 91, 91,131, 32, 8,232,245,122, 20, 21, 21, 33, 57,
+ 57, 25,119,239,222, 5,131, 32,244,127,101,231,105, 72,139,188,129, 86,173,223, 45, 31,214, 90,180,136,198,172, 47,166, 10, 45,
+ 6,131,241,218, 86,173,198, 96,202,210, 33,159,207,127, 84, 80, 80,208,199,217,217, 25,122,189,190, 78,104,213,183,196,213, 62,
+244,120, 60, 30, 30, 60,120, 0, 62,159,255, 72,165, 82, 53,201, 73,211,116,175,238,221,187, 35, 38, 38, 6, 87,174, 92, 65,102,
+102, 38,106,106,106,160, 86,171,161, 84, 42,145,156,156, 12,163,209, 8, 63, 63, 63, 8, 4, 2,240,249,252, 71,181,150,175,198,
+160, 80, 40, 10,153, 76,102, 59, 30,143, 87,247,153,163,163, 35,202,202,202,140, 58,157, 14, 7, 14, 28,144, 75, 36, 18, 1,143,
+199, 51, 89,184, 18, 4, 1,169, 84, 10, 23, 23,151, 58, 31,173,170,170, 42,136,197,226, 90, 97, 1,181, 90, 13, 11, 11, 11,208,
+ 52,221,220, 53, 82,165,167,167,127, 80,239,255,110,147, 38, 77,250, 49, 42, 42,170, 77, 92, 92, 28,110,223,190, 13,123,123,123,
+108,220,184, 49, 51, 59, 59,123, 42,128,187, 82,233,159,235, 23,105, 74, 31, 42, 43, 43, 59,246,232,209,163, 94,221,187,119,175,
+187, 75, 12, 28, 56,144, 24, 56,112,160, 93,125, 83,127, 73, 73, 9,238,220,185,131,184,184, 56, 16, 4,129,180,180, 52,131, 82,
+169,252,177, 9,106,150,179,179,243,254,213,171, 87, 11,245,122,125, 93,223,230,241,120,224,114,185, 96,177, 88, 96, 48, 24,200,
+206,206,198,216,177, 99, 69,223,124,243, 77,132, 90,173,246, 4,240,187,142,186,108,217,178, 55,210,199, 70,166,132,246, 65,146,
+ 92,228,231,227,144,188,103,247,103,125,230, 47,120,113,143,216,179,251, 51,189,159,143, 56,249, 65, 82,177,168,171, 24,205, 14,
+204,179,113,121,139, 52,186,179,163,207,158,251,101,242,135,203,222, 99,122,120,248, 72,227, 46,223,119, 11,210,127, 74,216,218,
+ 89,162,172, 84,142,236,220, 98,100,228,104,104, 15, 15, 31,233,189, 59,143, 56,159,111,251,202, 91, 81,163, 58,114,249,106,225,
+207,205,208,171,174,221,200, 28,183,117, 7,231,234,172, 57,221,216, 60,158, 19,202, 75, 31,193,205,205, 30, 99,131, 59, 98,223,
+193, 27, 16,137,108,224,224,224, 0,146, 36, 5,166,182,189,180,180,148, 56,246,211,181,119,102,190, 61,175,231,176,161,163,244,
+231,206,159,166,174, 92, 56,117, 35, 98,207,170,227, 52, 67,193, 39,232, 42, 94,171,214,146,196,103,233, 15,166, 14, 26, 60, 5,
+ 60,150,133, 23,208,190,193, 14, 91,183,193,128, 70,110, 76, 84, 24,119,230,219,243,123, 15, 27, 54, 70,127,254,252, 9,156, 63,
+115,240,214,218,181,173,206,100, 62, 63,204,186,121, 55,159, 59, 46,100, 97, 69,236,217, 39,154,137,163, 91, 63,117, 18,116, 86,
+ 2,153,111,172,202, 34, 9, 66, 94, 90, 82, 98,201,100, 50,149, 17,211,166,165, 1,128,142,162,202,170, 24, 12,123,130, 32, 82,
+ 1,164,110, 0,236,192,102, 87, 78,210,235, 13,203,221,220, 88, 84, 97, 33,163,194, 96, 48, 48, 0,246,135,191,207,191, 8, 6,
+ 69, 21,235,213,106, 87,151, 97,195, 24, 53, 57, 57, 76,161,131,131, 30, 0,116, 58, 93,179, 66, 11,141,108, 90,121,149,211,212,
+246,213,212,212,192,216,136, 16,124,149,179, 72, 42,109,245,114, 18, 94, 7,157, 78, 87, 39,178,202,202,202, 32,147,201, 32, 16,
+ 8, 80,162, 86, 59,152,194, 57,180, 71,143, 3,225, 97, 97,203,163,143, 29, 99,213, 23, 89,181, 47, 38,147,137,205, 91,182,176,
+150,124,248,225,194,119, 41,106, 41, 26, 88, 6,109,236,124,214, 78,218, 25, 12, 6, 40,138, 66, 78, 78, 14,114,115,115,145,147,
+147,131,156,156, 28,240,120, 60,208,127,241, 38,160, 55,216, 63, 11,245,150, 10,231,191,106,229,106, 50,188, 67, 75,156,225, 77,
+ 21, 6, 6,131,225, 79, 21, 90, 10,133, 34,238,210,165, 75, 61,198,141, 27, 71,221,186,117, 11, 18,137,164, 78,104,213,254,173,
+ 93,142,226,243,249, 56,126,252,184, 86,161, 80,196, 53, 51,152, 46,157, 57,115,166,107,104,104, 40,115,246,236,217,120,252,248,
+ 49, 22, 44, 88, 0,153, 76, 6,185, 92,142,178,178, 50,212,212,212,160, 71,143, 30,224,114,185, 72, 76, 76,212,213,212,212, 92,
+106,110,233, 76, 42,149, 86,219,219,219, 59,190,250, 93, 72, 72,136,195,183,223,126, 91,147,146,146,162,235,211,167,143,165,169,
+130,163, 22, 63,253,244, 83,157,165,238,233,211,167,248,246,219,111, 65,211, 52,104,154,198,253,251,247,241,197, 23, 95,212,197,
+ 62,107, 33,238,150,150,150,234,117, 58, 29,188,188,188,224,236,236, 12,149, 74,133,175,190,250, 74, 15,224,238,127,171, 55,171,
+ 84,170,232, 89,179,102,125,148,144,144,224, 72, 81,212, 11,147,246,203,246,105,181, 90,164,167,167, 35, 57, 57, 25, 41, 41, 41,
+ 40, 47, 47,175,155, 8, 60,120,240,160, 66,167,211, 29,105,140,215,222,222,126,205,190,125,251, 36,124, 62,255, 55,253,185,214,
+ 26, 90,107, 37, 45, 41, 41,129,149,149, 21,130,130,130,196,151, 46, 93, 90,163, 86,171, 67,241,207, 0, 17, 50,254,105,183, 37,
+139,198, 97, 66, 48, 63, 47, 38,246,249,175, 95,124,254,193, 3,214,187, 21, 0, 0, 32, 0, 73, 68, 65, 84, 75,103,120,113,242,
+132, 96,231,188,135,169, 86, 8, 25,127,162, 27,128,124, 52,237,167,101,188,124,181,240,100,247,238,214, 87, 98, 78,157,138, 88,
+185, 98,217,253,229, 31,204,179,175, 81, 62,227,122,184,179, 9, 0,200,200,209,208,137,143,141,170, 47,182, 46,187,255,217,150,
+111,200,226, 50,217,130, 59,119, 26, 15,111, 80, 95,188,144, 36,184, 30,237,251, 23,120,183,237,219,250,214,141, 67, 16,242,149,
+104,215,190, 27,134, 13,237,133, 43,191, 60, 64, 81,137, 10,133,133,133, 80,171,213, 77,134, 75, 72, 73, 60, 62,131, 38,104, 55,
+130, 38,114, 9,146,230,206,152, 53,183,223,168, 81, 99,232,216,216, 83,250, 19,199, 15, 93, 63, 18,185, 35,154,100, 49, 41,165,
+ 70,164, 33, 8, 85, 37,200,164,199,213,138, 23, 19, 26, 38,135,213,184,249,245,101, 96, 87,223, 14,237, 37, 51,102, 45, 16,141,
+ 28, 49,150, 62,115,230,132,241, 72,212,129, 43, 71,246,250, 31, 50,146,114, 86, 97, 94, 13,167, 82,174,171,164, 9,182, 85,181,
+220, 88, 83,156,225,169,114, 26, 21,162, 5,162,223,216, 14, 68, 27,141, 57,180, 70,211, 26, 76,102, 30,173,215, 75,160,211,149,
+135,171, 84,207, 63,101,179, 91,253, 31,123,215, 29,223, 84,245,190,159,155,221, 38,221,139, 14, 90, 70,129,210,197,178,128,178,
+ 87, 89, 45,162, 40,136,162, 56, 25,138,162, 44, 65, 16, 16, 80,134,130,128,130, 44, 21,144,189,161, 32, 80,164,165,140,130,108,
+232,166,133,206,164, 77,186,146, 54,251,142,243,251,131,182, 22,236, 72, 10,250, 83,191,121, 62,159,124,114,115,115,239,147,115,
+206, 61, 57,247,185,239,121,207,251, 46, 16, 8,158, 1, 69,113,102,138,210,194,100,202, 2, 0,183,220, 92, 31,147,147, 83, 33,
+223, 96,104, 3,150,173, 51, 0,178,217,104,204,175,204,203,243,113,235,219, 87,114,111,225, 66,105,179,238,221, 13, 84,149, 15,
+113, 67, 66,139,207,231, 3, 60, 30,103, 9,167,165,245,211,235,245,224,234, 9,173,210, 24, 39,195, 48,143,136,172,106,161, 85,
+253,127,177,132,115,211,130, 5,151, 3,134, 12, 41,141,143,143,111,214,175, 95, 63,170,162,162, 2, 21, 21, 21,143,136, 45, 95,
+ 95, 95, 42, 52, 60, 92,186, 59, 46, 46,208,210,246,180, 72, 68,243,120,127,185,208,250,151,163,222, 68,210,130, 70,166,208, 44,
+ 22, 90, 22, 90,180,104,154,166,225,229,229,133,226,226,226,122,111,252, 60, 30, 15,246,246,246,213,115,196, 13,174,188, 51, 26,
+141,171,103,204,152, 49,101,216,176, 97, 30,237,219,183,135, 74,165, 66,179,102,205, 96,103,103, 87,227, 59, 86,205,119,253,250,
+117,252,244,211, 79, 26,163,209,184,186, 17,206,111, 87,172, 88,241,193,168, 81,163,220,188,189,189,225,234,234,138,219,183,111,
+195,213,213, 21, 26,141, 6,105,105,105,112,116,116,172,241,219, 57,122,244,104,133,209,104,252,182, 17,241, 70, 18, 18, 18,204,
+142,142,142,183, 85, 42, 21,191,180,180, 84, 80, 86, 86, 38,208,104, 52, 66,181, 90, 45, 60,121,242,164,135,179,179,179,238,236,
+217,179,170,128,128, 0,254,253,251,247,249, 52, 77, 55,170, 94, 41,138,194,212,169, 83, 33, 18,137, 96, 52, 26,177,122,245,106,
+204,152, 49,163,198, 39,107,197,138, 21,152, 59,119,110,141,112,222,188,121,179,117, 3, 39, 33, 48,155,205,160,105,218,226, 5,
+ 10, 79,244, 68,108,153, 96, 47,204,200,200,136,238,214,173,219,233,125,251,246,185, 87,197, 36, 67, 81, 81, 17,138,138,138,160,
+ 82,169, 80, 89, 89, 9,134, 97,224,231,231,135,162,162, 34, 28, 62,124, 88, 93, 81, 81, 49, 4, 13,172, 56,228,243,249,227,123,
+247,238, 45,120,188, 12,213, 79,121,213,226, 93, 34,145, 64, 46,151,163,127,255,254,226,248,248,248,241, 0,254,213, 66,171,118,
+120,135,193, 67,222, 17,133,132,245, 48,221, 74,138,201, 11,110, 85,148, 55,110,164,211,113, 0,184,121,183,200,249, 86,154, 11,
+ 66,194,162,201,224, 33,174, 17, 69,133,155, 58, 0, 48, 55,148,174, 7, 0,156,165,146,209,145,131,186,203, 29,101, 50,222, 55,
+ 43, 55,255,250,195, 15,223, 62,179,255,248, 31,225, 29,190, 89,249, 48,188, 67,228,160,238, 92,106, 74,234,104, 0, 91, 44, 21,
+ 47,209,209, 35,110,252,180,245, 39,164, 38,157,245,253,116,106, 71,113,105, 17, 13,123, 7,127, 68,116,110,134, 77, 91,239,224,
+214,173, 91,133, 38,147,169,127,131,253,155, 34, 1, 73,201,119,131, 58,132,133,122,191, 62,126,130, 83,116,244, 72,196,196, 28,
+193, 47,219,182, 36,188, 52,118,212,143, 5,101, 26,190,151, 80, 42,146, 18, 78,204, 23, 57, 11, 68, 18,123,165,201,244, 48, 2,
+129, 80,104,231, 4,140,110,240,198, 51,105,194, 56,231, 1,131, 70,226,248,137, 35,248,101,219,166,115,159,135,189,188,165, 85,
+151, 16,170,251, 51, 95, 79,110,213,186, 85, 11,109,101,145,134, 71,137,205, 6, 3,231,248,245,182,236, 85, 89,115,199,103, 1,
+ 88,137,127,233,170, 67, 49,203,222, 50,154,205,227,252, 35, 34,174,202,175, 94,237,240, 21, 77,187,125, 6,148,126,110, 50,101,
+239, 3,242,202, 1,222,196,170, 49,125, 37, 96,167, 23, 8,124,156,121,188,155, 21, 44, 59, 12,124,126, 18,234,126, 16,191,253,
+203,240,225,221, 62,202,204, 20,121,246,234,101, 47,143,139,147, 86,101, 34,105, 80,104, 9, 4, 2,144,250,167,186, 30,225,164,
+182,111,231, 1, 15,167,252,235, 27,227, 68, 34, 17,116, 58, 29,104,212,107,209,125,132,211,231,212,169,188,204,204,204,118,110,
+110,110,143,136,172,210,210,210,154,109,131,193, 0,157, 78, 7,123,123,251, 36,125,221, 51, 34,143,112, 22, 37, 36, 24,150, 77,
+157, 58,255,213,177, 99,215,158,249,237, 55, 59,119,119,119,168,213,234, 71,132,150,201,100,194,128,129, 3, 69, 43,110,220,120,
+ 29, 26,205, 2, 75,218,179, 89,255,254,141,250, 3,243,249,124,112,127,241,212,225,127, 0, 19,234, 18, 94,188,198,166,112, 44,
+ 93,117, 88,207, 13,242,241,213,125,115, 35, 34, 34, 12,233,233,233, 8, 8, 8,168, 17, 43,181,127,211,201,201, 9, 46, 46, 46,
+184,126,253, 58,190,252,242, 75, 61,128,185,141,112, 86,232,116,186, 87, 34, 35, 35,245, 2,129, 0,193,193,193, 53,241,179, 56,
+142,131, 88, 44,134, 76, 38,195,141, 27, 55, 48, 98,196, 8,157, 78,167,123, 5,127,142,161,245, 56,167, 90,167,211,189, 54,120,
+240, 96, 93,114,114, 50,122,247,238,141, 91,183,110,161,178,178, 18,149,149,149,120,240,224, 1, 66, 67, 67,161,211,233,176,126,
+253,122,189, 78,167,123, 13,128,186, 33,206,138,138,138, 17, 51,102,204,224,239,218,181,171,149,159,159, 95, 88,215,174, 93,219,
+ 15, 28, 56,176,205,139, 47,190,216, 98,248,240,225, 62,237,218,181, 51, 12, 25, 50,196,115,216,176, 97,158, 58,157, 78,120,241,
+226, 69, 5, 77,211,195, 26, 41,103,141, 56, 73, 79, 79,175,153, 42, 20, 8, 4, 40, 46, 46,174,137,220, 95, 61, 40,213, 35,132,
+ 7, 53, 38,182,171, 5, 86,181,224,178,192,207,173, 46,206, 70, 79, 18,139,197,213, 22, 79, 98, 1,231,205,148,148,148,200,190,
+125,251,222,124,231,157,119, 42, 10, 11, 11,225,232,232,136,192,192, 64, 4, 5, 5,193,195,195, 3,102,179, 25,135, 14, 29,210,
+ 30, 62,124,248,142, 90,173,238,143, 63,199,208, 26,244, 88, 59, 62,168,107,144,173,182,102, 85, 11, 45, 59, 59, 59,248,249,249,
+ 85,183,237, 3,107,218,179,137,248,107, 57,171, 4,204,192, 1, 67, 90, 15,143,122,193,249,208,145, 75,226,181,235, 14,223,137,
+ 24,132,205,238, 45, 53, 71,221, 91,106,142, 70, 12,194,230,181,235, 14,223, 57,116,228,146,120,120,212, 11,206, 3, 7, 12,105,
+157,156,148,218,190,118,222,195,186,202,105,103,103,215,163,119,175,136,178,248, 11,231,184,165, 43,190,231, 13,232,255,210,141,
+ 45, 63, 30, 58,180,229,199, 67,135, 6,244,127,233,198,210, 21,223,243,226, 47,156,227,122,247,138, 40,179,179,179,235, 97, 73,
+221, 39, 77, 24,231, 28, 53,124, 36, 98, 98, 14, 49,251,119,175, 95,177,231, 64, 70,223,119,167, 36, 20,165,167,223, 34,202,252,
+ 83, 16,242,114,144,146,146,162,174, 18, 89,233,150,112, 78,124,111, 92,109,145,117,222,221,187,247,230,148, 20,176,177,177,199,
+232,223,126,187,161, 63,127, 83,169,190,150, 92, 92, 42, 87,149,222,215,104, 74, 76, 28,199,130,101, 89,254, 23, 95,212, 56,236,
+214,121,141,122,246,236,135,179,103,118, 98,219,214,141,106,142,131, 97,244,254,253,236,232,209, 11, 73,139,150, 45, 91,236,216,
+189,147,138,126,254, 5,103, 2,112, 35, 70,141,116,217,181,103, 23,213,186,109,235,150,129,129, 53, 33,109,254,117,125,233, 83,
+160,146, 2, 82, 20,191,255,222,213,161,119,239,219,140, 80, 24,180, 72, 36,106,179, 6, 16,143, 6,216,137, 0,189, 0,224, 45,
+ 0,252,244, 2, 65, 39,123,134,185, 85,161,211, 53, 7,128,197,132,220,175,139,115, 33, 80,166,201,201, 57,119,253,251,239,141,
+205, 94,121,197, 77,220,172,153, 19, 88,150,170, 30,223,235,123, 9, 4,130,199, 45, 48,245,114,250,121,120, 20, 28, 61,122, 20,
+ 65, 65, 65,240,243,243, 67,109, 31,217,234,128,220,238,238,238, 56,112,224, 0,200,163,193,169,235,229,236,210,170,213,245,229,
+203,150,153, 56,142, 67, 89, 89,217,159,172, 89,101,101,101,224, 56, 14, 39,142, 31, 55,105, 30,102, 2,177,168,238,253,249,252,
+202, 87,251,244, 89, 26, 21, 21,101,206,204,204,172, 89,121, 93,109,217, 82, 42,149,112,112,112,128,193,104,244, 7, 32,181,132,
+ 83,121,242,164, 12,141,140,235,117, 88,180,254,138,190,244,111, 23, 89,181, 19, 74, 79,176,200,162,197, 48, 12,252,253,253, 31,
+ 73,233,194,227,241, 30,121, 89,185,226,112,123,114,114,242,169, 33, 67,134,204,127,246,217,103, 39,205,159, 63,159,223,190,125,
+123,168,213,106,184,186,186,194,203,203, 11,105,105,105, 56,122,244, 40, 91, 92, 92,188, 1,192, 34,212, 17,192,174, 14,196,101,
+100,100, 68,119,236,216,113,207,236,217,179,157, 7, 15, 30, 44,244,247,247, 7, 33, 4, 55,110,220,192,193,131, 7,205, 91,182,
+108,209, 84,137,172, 56, 11,203,122, 90, 46,151,191, 52,108,216,176, 29,227,199,143,119,100, 89, 86,248,224,193, 3, 24,141, 70,
+208, 52,141,220,220, 92,115, 76, 76, 76,165, 78,167, 27, 7,224,180, 5,124,215,203,203,203, 67, 99, 99, 99,199, 95,188,120,241,
+203,119,222,121,199,125,224,192,129, 34,134, 97,112,225,194, 5, 85,151, 46, 93,188,148, 74,165,249,192,129, 3, 37, 6,131, 97,
+ 46,203,178, 22,165,224,161, 40, 10, 26,141, 6, 30, 30, 30, 48, 26,141,224, 56, 14, 38,147, 9, 14, 14, 14, 53,105,147, 8, 33,
+176,198,185,254,177, 62,192, 55,155,205, 24, 59,118, 44, 56,142,195,234,213,171,193, 48,140,213,100,206,206,206,215,110,222,188,
+ 25,221,185,115,231, 26,241, 82,221,135, 36, 18, 9, 60, 60, 60,224,238,238,142,152,152, 24, 8,133,194,107,141,249,187, 85,225,
+ 86,113,113,113,151,216,216,216, 30,119,238,220,121, 3, 64,103,179,217,236,199,178, 44,197,227,241, 20,132,144,219, 26,141,230,
+ 71, 88,152,130, 71,169, 84,126,249,230,155,111,118,217,185,115,167,131, 64,240,199, 95, 67, 32, 16, 64, 34,145,160, 58, 56, 38,
+ 33, 4, 38,147, 9,243,230,205,211,104,181,218, 47,255, 43,163, 68, 68,215,238,216,180,126,141,195,111,103, 79,169, 82, 50,112,
+208,213, 53,229,241,254,151, 95, 84,184,169,131, 60, 47,207, 33,162,107,119,139, 56,105,147,185,228,181,113,211, 2,170, 82,240,
+204,123,240, 32,123,227,142,237,171,178, 0,224,235,111, 87,183, 43, 42, 41,159,152,146,156, 58,122,195,134,221, 61, 24,179,185,
+196, 18,206, 63,196,203, 14, 53, 8, 12, 0,174,220,184, 83,212,106,196, 43, 39,231,182,109,237,244,188,178, 68, 95, 80, 89,169,
+251, 16, 64,150,165,117,239,213,179, 47,206,158,222,133, 95,182,237,208, 16,142,111,240,240,240, 32, 0,144,146,226, 65, 82, 82,
+202,201, 31,126,197, 46, 90, 33,185,181,104,218,135, 3,167,169, 53,165,223,174, 94,223,240, 84, 74,199, 78,207,162, 99,167,103,
+ 49,229,195,207,156, 67,195,130, 3, 0, 96,255,126,176, 97,109,147,143,205,255,124,225,243,139, 22, 45,132,166,194,136,234,116,
+ 61,105,119,147,143,103,101,193,244,111,238, 71,243, 25,230,194, 34, 66, 94,212, 37, 36,116,232, 49,115,230,239,231,191,249,166,
+149,154,207,239,249, 5,192,241, 40,138, 5, 33,246, 60, 30, 79, 33,163,233, 27, 21, 98,177, 15,197,113,207, 56,178,236, 33,186,
+129,252,159,243, 25,230, 10,166, 77,107,167, 43, 45,245,236,245,233,167, 30,130,153, 51,121, 13, 57,195,215,254,255, 90,194,121,
+245,246,237,227, 19,223,125,183, 96,193,252,249, 67, 54,108,220,104,223,161, 67, 7, 20, 22, 22, 34, 56, 56, 24,126,126,126,136,
+141,141,197,129,189,123,181,229, 21, 21,115, 1,252, 96, 9,231,246, 19, 39,210,218,135,133, 21,111,220,184,209, 55, 42, 42,138,
+210,106,181, 80,171,213, 80,171,213, 48, 26,141,168, 10, 8, 77,210, 51, 50, 82,104,154,222, 96,105,221, 89,149,202,110, 81,247,
+238,249, 34,142, 91,254,210,168, 81, 51, 22, 45, 94, 44,105,221,186, 53,101, 52, 26,107,172, 90,102,179, 25, 14, 14, 14,102,147,
+201,228,142, 58,252,222,234,226,148,108,217,194,168, 84, 42,120,122,122,214,132,107,170, 29,151,176,162,162, 2,132,144,255,108,
+ 2,244,191, 18,245, 42, 36, 87, 87,215,107, 2,129,160,121,109,235, 86, 93,185,243,106,239,163,105, 58,191,184,184, 56,226, 49,
+197, 91,159, 63, 84, 32,128,175, 6, 12, 24,240,210,244,233,211,169,248,248,120, 28, 62,124,152,100,101,101,237,175,178, 98,101,
+ 53,240,244, 84, 31,167,163, 68, 34,249, 88, 38,147, 13,170, 14,225, 32,149, 74,239,104,181,218, 51, 85,211,133, 21, 77,224,116,
+146, 72, 36, 83,101, 50, 89,100, 85,250, 21, 56, 58, 58,222,212,106,181,177, 70,163,113, 13,234, 79, 84,221, 16,167,189,179,179,
+243,151, 30, 30, 30,175,205,156, 57,211, 61, 33, 33, 65,113,246,236, 89, 81,121,121,249, 78,147,201,212, 80, 82,233, 63,113,186,
+185,185, 93,227,243,249,205,255,162,107,132,142, 29, 59,198,140, 24, 49, 34,106,220,184,113,160,105, 26, 63,252,240, 3, 98, 99,
+ 99,143,223,187,119, 47,186,145, 39,220,199, 57, 61,154, 55,111, 30, 63,105,210,164, 22, 99,199,142,149,186,186,186, 66, 32, 16,
+ 64,171,213,226,222,189,123,184,113,227, 6, 57,114,228, 72,229,245,235,215,243,117, 58, 93, 63, 0,197, 86,180,231,147, 60,137,
+ 63,194, 41, 16, 8,250,250,251,251,239, 94,176, 96,129, 99,100,100,164,189,187,187, 59,248,124, 62,104,154,134, 66,161,192,221,
+187,119,113,234,212, 41,237,254,253,251,181, 37, 37, 37, 99, 1,156,251,255, 40,231,211,228, 12,105,135,207, 31, 75, 20, 93,111,
+180,247, 70,142,109,180,156, 3,250,250,140, 28,253,210,176,161,132, 16,236, 59,112,242,100, 92, 66,163, 73,165,235, 45,103, 99,
+101,181,132, 51,184, 45,111, 65, 82,242,221, 71, 2, 90,134,133,134,167,135,116, 24,181,196, 18,162, 90,145,225, 31,169,123,173,
+233,216,218, 54,221, 71,166, 89, 67, 2, 17, 61,114,244,139, 81,159,205,157,131,175,190, 92,138, 35,251, 14, 29, 79,201,122, 36,
+ 77,208,191,174, 47,213,190,183,124,193,231, 15,224,241,120,254,148, 88,252, 59,173,213,102, 56, 2,194, 10,128,255, 5,160, 93,
+ 36, 18,181, 1,203,134,129, 16, 65, 5, 69,197,124,195,178,174, 0,228,141,113, 46, 17, 8,158,149,250,248,244, 89,205,113,115,
+110,221,189,235, 80,251,129,173,218,242, 92,251,161,210,215,215, 87,169, 80, 40,154, 89,194, 25,253,221,119,102,157, 76, 38,153,
+179,124,121,223, 74,131,161,239,162, 69,139, 4, 87,175, 94,197,250,239,191,103, 12,249,249, 59, 84,192,212,122,102, 67,234,229,
+108, 49,117,170,221,172,245,235,223, 10,108,219,214,235,141, 55,222, 16, 10,133, 66,104,181, 90,228,229,229,225,244,169, 83,166,
+228,148,148,100,141, 70,243,188, 53,117,143,254,238, 59,179, 75, 96, 32,164,158,158,228,183,184, 56,231,137, 31,127, 60,169,101,
+171, 86,206, 67,134, 14, 21, 58, 57, 57,161,172,172, 12, 15, 30, 60,192,161, 67,135,148,149,149,149,190, 0, 88, 75, 56,119, 92,
+188,216,241,196,185,115, 47, 47, 89,178, 68, 28, 30, 30, 14,103,103,103, 84, 84, 84,224,238,221,187, 56,119,238,156,113,195,134,
+ 13,106,181, 90, 61,137,101,217,163,127, 97, 95,250, 79, 78, 29,254,213, 30,254,150, 92,136, 8, 0,159, 87,109, 47, 70,227, 57,
+ 3,255,205,131,207,227, 8,112,115,115,219,100, 48, 24,136, 94,175,159, 8, 32,247, 31, 88, 78, 65, 68, 68,196,122,165, 82,217,
+131, 16, 2,103,103,231, 75, 73, 73, 73,239,163,158,149, 55,141,112,242, 1,244,112,112,112,232,238,232,232,216,215,104, 52,134,
+ 84, 77,191,165,104,181,218,115,102,179,249, 74,149,245,137,253,127,174, 59, 31, 64,164,175,175,239,187, 28,199,181,165, 40,202,
+133,101, 89,208, 52, 93,206,113,220, 61,181, 90,189, 5, 64,236, 63,160,156, 79,133, 51,180, 13, 94, 36, 60,132,212, 39, 8, 30,
+ 17, 90,143, 9, 8,138, 67, 74,114, 38, 14, 89, 81, 78,222,208, 65,254,235, 56, 22, 56, 29,151,247, 1, 26,119,174,253, 67,104,
+ 89, 32, 94,172, 22,153,109,248,111, 18,138, 60,194, 73, 17, 42, 55,184,227,139,191, 60,137,208,178, 20,161, 65,232, 11,130, 30,
+ 28,193,149,212,123, 56,251, 95, 27,235, 22, 0,205,120, 60, 94, 55,138,199,107, 67, 0, 45, 69, 81, 12, 8,113, 3, 33,153,224,
+243,147,230,155,205,153,168, 59,129,121,189,156, 95, 1,110,223,187,186, 94,226, 9, 4,222, 0,120, 85,214, 23,142,163, 40,150,
+ 80, 20, 83,123,122,235,177, 7,203, 6, 57,205, 64, 7,161, 68,226,207, 50, 76,179, 66,192,225, 4,203, 62, 99, 32,164,178, 57,
+240,249, 77, 32,205,218,186, 87,115,242, 37,146,128, 19,132,140, 84,201,100, 29,149,122,189, 39, 0,226, 32,147,165,104,180,218,
+109, 6,131, 97,157,181,117, 55, 3, 29, 68, 18, 73,115,150, 97,154, 1, 0, 79, 32, 80,238, 49, 26,253,243,157,156,222, 48, 24,
+141, 45, 28, 28, 28,104,147,201,164, 49, 24, 12,227, 24,134,249,205,154,186,223, 99,152,208,139, 60, 94,111,179, 76,230,110,166,
+ 40,153,137, 97,204, 38,179, 57,207, 96, 48,220, 1,176, 10, 64,230, 95,220,151,108,104,226, 31,208,198,105,227,180,113,218, 56,
+109,156,255,227,156,203, 0,167,175, 0, 55, 91,123,254,165,156, 82, 0, 1, 85, 15,139,255,198,186,255, 39,173, 91, 2, 91, 91,
+216, 96,131, 13, 54,216,240, 87, 99,118,253,110, 22, 54, 60, 61,232, 80,135, 79,150, 13,255,191,160, 26, 80,165,214,152, 4,155,
+162,108,207,216, 56,109,156, 54, 78, 27,167,141,211,198,105,227,252,159,227,108,140,251,223, 56, 37, 57,161,142,125,155,254,142,
+ 31,182,153,127,109,156, 54, 78, 27,103,157, 24, 49, 98, 4,207,214,158, 54, 78, 27,167,141,243,191, 14,158,173, 9,234, 69,179,
+170,215,211, 62,214,134,255,118, 95,248, 59,224, 87,245,178,230,120,159,127, 90,163, 30, 59,118,140, 3,128, 59, 41,119, 37, 21,
+ 21, 21,182,177,200, 6, 27,108,176, 9,173,191,249,166,245, 36, 55,183, 39,189, 49, 46,165, 40,200, 41, 10,114, 0, 75,159,226,
+177,141,193,215,195,195,227,163,208,208,208, 29,205,154, 53,155, 2,192,203,202,243,219, 73,165,210, 53, 50,153, 44, 94, 38,147,
+197, 75,165,210, 53, 0,218, 61,165,235, 70, 1,152, 40,145, 72,226,124,124,124, 10,196, 98,113, 28,128, 73,104,250,202,213,246,
+120, 24, 39,109, 49,128,142,214,156,232, 21, 54,114,175,103,216,200,219,158, 97, 35,239,186,135,143,104,231, 25, 54,242,174,103,
+216,200,219, 94, 97, 35,247,254, 5,253,245,105, 94,223,167, 85,158, 92,138, 66,174,133,229, 89, 69, 1,121, 20,133,252,127, 72,
+249,255,132, 14, 33,225,198,209, 99,198,216,219,134, 99, 27,108,176,225,127, 30,190,190,190, 47,249,248,248,156,241,241,241,137,
+245,245,245,125,201,130, 83, 6,213,113,147, 96, 41, 10,108, 35,131,126, 67,199, 53,102,174,172,125,238, 55, 22, 86,173, 54,103,
+ 51,138, 2, 75,170, 64, 81,224,188,188,188,214,250,248,248, 44,125,252,229,229,229,181,150,162,192,213, 58,150,173, 37,240,172,
+ 53,171, 54,123,253,245,215,247,149,149,149,197,152, 76,166,152,140,140,140,152,126,253,250,237,121,204, 18, 81, 47,167,157,157,
+221,171,221,186,247,184,126,238,194,149,140,244,123,217,242,228,180,251,217,199, 78,254,118, 53,188, 67,199,223,237,236,236, 94,
+181,226, 26, 81, 0, 38, 10, 4,130, 56, 7, 7,135,124,129, 64, 16, 7, 96, 50,159,207, 63,186,108,217,178,236,164,164,164,162,
+139, 23, 47,150,159, 59,119,174,224,157,119,222,185, 71, 81,212,177, 58, 4,251, 32, 11, 44, 48,243,115,114,114, 78, 42, 20,138,
+ 83,246,246,246, 95, 90,112,124, 13,167,103,216,200,219, 74,181,153, 40,213,102,226, 25, 54,146,212,218,190,109,101,155, 55,118,
+141,254,212, 23, 36, 18, 73, 64, 35,130,254,175, 52,209,255,169, 60, 0,188,171,190,139, 0,240, 93,213,171,122, 57,187,183,157,
+ 68,242,180,250,231,211,104, 79, 27,167,141,211,198,105,227,252,175,162, 75,213,187, 15, 30,250,107,213,220,187,173, 93,117,248,
+ 65, 70, 70,134, 3, 0, 4, 5, 5,189, 15,224,128, 53, 66,130,162, 48,139,227, 8, 15, 0,120, 60,234,211,254,253, 7,116,177,
+183,183,127, 36, 10,178, 94,175, 23,199,197,157, 29,200,113,132,170, 58,110, 22, 33, 88, 3,160,200,210,223, 48,153,140, 60,161,
+ 80, 12, 30,143,154, 22, 30,222,161,101,113,113,113, 2,143,199,219, 81, 80, 80, 80,102,181, 25,135,162,176,121,243,230, 32, 31,
+ 31,159, 63, 69,107, 86, 40, 20,226,145, 35,159,183,138,239, 77, 64, 98,148, 72,186,139, 40,202,135,101, 24, 23, 0, 16, 8, 4,
+101, 87,197,226,136,175,150, 44,145, 82, 20,197,149,148,148, 64,175,215,227,147, 79, 62,177, 79, 78, 78,126,161,184,184,120, 93,
+ 35,180, 65, 29, 59,117,249,228,212,169,147, 33,154,210, 50,195,230,111, 55, 94,215, 11, 68,186, 86,161,193,162,245,155,182,185,
+ 78,120,107,220,135,169,169, 73, 55, 81,119, 58,146,218,224, 1, 56,244,241,199, 31,135, 69, 71, 71,139, 43, 42, 42,236,244,122,
+125,203, 29, 59,118,204,139,136,136,112,232,220,185,179,120,247,238,221,148, 90,173, 6, 33, 68, 26, 28, 28, 76,198,140, 25, 99,
+216,179,103,207, 20, 0,107, 27, 16,190,179, 30,182, 37,111,117,251,246,237, 23, 0, 64, 70, 70,134,168, 86, 27, 11, 67, 66, 66,
+100, 0,144,150,150,246, 5, 33,220,199, 0, 64, 8, 86, 0,152, 83,135,105, 45, 35,172,215,104,128, 66,219,164, 11,251,236,194,
+122,143, 54,128,224, 30, 5,100, 84, 61, 16, 44, 2,106,197,133,122, 20, 41,114,185,188, 73,185, 9,163,162,162, 41,138,162,246,
+ 95,191,126,253,128, 82,169,108,197,113,236,123, 13,149,179,190,107,229,233,233,121,138,101, 89, 99,105,105,105, 77,160, 76,207,
+142, 47,246,112,119,148, 13, 84,149, 85, 36,148, 36, 31, 57,103, 97,223,164,220,221,221,223, 44, 46, 46, 94, 10,224,221,148,148,
+148, 46, 0, 16, 18, 18, 34, 2,112,205,201,201,169,167,217,100,162,108,227,159, 13, 54,216, 96,195,223, 34,180,110, 0,136,194,
+ 31, 41,120, 54, 53, 69,104,137, 1, 32, 33, 33, 1, 0, 36, 77, 40, 8, 85, 91,192, 76,157, 58, 21, 62, 62, 62,143,139, 23,196,
+199,199, 61, 73,101, 31,249,141,197,139, 23, 59,148,151,151, 15,250,241,199, 31,251, 16, 66,190,145,203,229,151, 27, 57,191,136,
+ 16,172,224,241,168, 79, 41,138,130, 68, 98,151, 62,105,210,164, 27, 85,223,181, 60,118,236,152,116,196,136, 17, 58, 0,217, 0,
+ 32,145,216,249,241,249,188, 32, 66, 72,245, 13,183, 94, 65,248, 50, 16,200,136,197, 3, 38,126,247, 29,243,204,136, 17, 2,153,
+167, 39, 5, 0,217,169,169,238, 43,190,254,186,103, 89, 86,150, 88,239,238, 94, 82,162,213,234,211,211,211, 33,145, 72, 40, 62,
+159,255, 76, 99, 21,150,201,100, 31, 45,249,106,185, 76, 83, 90,174, 55,104, 42, 76,124,134, 54, 58,218, 75,217,162, 66,101,137,
+131,189, 76,247,233,231, 11,197, 31,188, 55,254, 35,173, 86,251,126, 35, 84, 83,166, 77,155, 22,210,173, 91, 55,191,189,123,247,
+ 82,106,181, 26, 2,129,192,161,115,231,206,136,136,136, 96,207,158, 61, 75,181,106,213, 10,225,225,225,184,112,225, 2, 46, 93,
+186, 68,117,233,210, 69,122,240,224,193,215,105,154, 94,219,152,184,230,243,121,159, 4, 7, 7,119,150,201,100,166,160,160, 32,
+188,247,222,123, 32,132, 96,208,160, 65,225, 14, 14, 14, 7,180, 90,173, 56, 45, 45,181, 79, 99, 34, 91,153,116,100, 76,181,101,
+ 11, 64, 7, 16,220, 83, 37, 29,169, 61,253, 24,146,150,150,246,108, 89, 89, 25, 30, 94, 23, 82,147,192,188, 79,159, 62,214,244,
+165, 34, 66,176, 98,196,136,232, 79, 1,138, 26, 52,104, 80,249,148, 41, 83,120,169,169,169,175,189,248,226, 11,225, 25, 25,247,
+ 96,229,195, 64,208,224,193,131, 47,156, 56,113,194, 61, 40, 40, 72, 85, 90, 90, 90,243,133,183,187,203,144,115, 7, 87,127,244,
+229,154, 29,193,219, 9, 85,174, 74, 57,124,167,145,190, 73,189,249,230, 91, 69, 14, 14, 14,163,246,239,223,159,166, 80, 40, 4,
+ 34, 81,141,118,229,123,121,121,121, 6, 5, 5, 77,118,115,115, 83,242,121, 60, 47, 2, 66, 26,235,159,255,223,200, 72, 79, 21,
+182, 11, 10,166,109,227,181, 13, 54,216,240, 47,196,241, 42,113,117,252,241, 47, 4, 0, 16, 19, 19, 83, 19,153, 54, 58, 58,186,
+222, 39, 96, 66, 72,209,173, 91,183,252,117, 58, 29, 8, 33,150, 12,216,181,151,104, 22, 81, 20,111, 61,143, 71,189, 79, 81, 20,
+194,195, 59,220, 95,189,122,117, 93, 57,189, 76,225,225, 29,238,243,249,188,214,132, 16, 80, 20,239, 7, 66,184,162,122, 56,235,
+188, 17,137,197,146, 89, 0,224,237,237,147,245,235,175,191,154, 94,126,249,101,124,253,245,215,162,217,179,103,207, 16, 8, 4,
+ 83,114,115,115, 11, 27, 40, 39, 0,204,241,244,244,146,110,222,188, 57,104,210,164, 73, 55, 20, 10,197, 28, 0,240,241,241, 89,
+ 10, 32, 20, 64,118,173,125,216,176, 97, 79,193,123,239,189,151,174, 84, 42,231,212,199, 57, 10,104,227, 31, 28, 60, 96, 81, 66,
+ 2,225, 25,141, 84,241,249,243, 26, 85, 81, 17,157,169, 82, 73,183, 94,187, 22, 61,111,233, 82,161,127, 64, 0,226,143, 30,245,
+ 40,214,233, 84,106,163,209, 80, 84, 84, 68, 24,134,185,100, 65,221,195,188, 60,189,164, 27, 87,253,112,213, 81,200,231,188,154,
+251, 81, 66, 55, 55, 1, 79,234, 36,230, 11,120,198,214, 45,219,137, 1,132, 53,118,141, 68, 34,209,235,131, 7, 15,150,238,217,
+179,135, 10, 15, 15,135,139,139, 11,206,159, 63,143,155, 55,111,162,172,172,140, 71,211, 52,186,118,237,138,229,203,151, 35, 32,
+ 32, 0,229,229,229,200,205,205,245, 16,139,197,158, 52, 77,215,215,158,143,244,167, 89,179,102,193,199,199, 7, 12,195,160,180,
+180, 20, 12,195,192,193,193, 1, 0,144,159,159,143,163, 71,143, 88,210,151, 26, 5, 33, 4,207, 61,247, 92, 5, 69, 81, 41,143,
+ 91,180,172,225,244,243,243,219,173, 82, 21, 15, 27, 48, 96, 0,202,202,202,232,133, 11, 23,162, 99,199,142, 8, 10, 10,106,180,
+156,190,190,190, 19, 25,134,153, 15, 0,102,179,121,171,157,157,221,219,191,252,242,139,123,237, 20, 33,213,150,172, 34,101, 73,
+217,165,171, 73,105,211, 38,190,220, 47,225,242,221, 60,179,112,100,174,250,246, 17,117, 29,229,156, 35, 18,137,127,108,209,162,
+197,170,169, 83,167,250,184,185,185,193,104, 52,206, 43, 44, 44,196,228,201,147, 1, 0,195,135, 15,239, 40, 20, 10,127,125,231,
+157,119,208,170, 85,171,130,210,210,210,220,235,215,175,191,167,211,233,238, 54,181, 61, 45,196, 19,113,214, 35,178,254,113,229,
+180,113,218, 56,109,156,127, 13,167,165, 90,228, 31, 10, 5, 30, 13,231,176,233, 17,161, 21, 29, 29, 77,197,196,196, 16, 11, 42,
+ 86,210,188,121,115,127,123,123,123, 0, 40,177,182, 20, 28,199, 77,113,119,119, 87,206,153, 51,167, 87, 80, 80,144,105,202,148,
+ 41,119,179,179,179,231,214, 62,166,101,203,150, 95,126,255,253,247, 72, 79, 79,207, 94,186,116,233,133,146,146, 18,107,243,152,
+205, 38, 4,171,171,172, 99,197, 71,143, 30,237,152,144,144,240,254,183,223,126,235,249,193, 7, 31,136, 62,250,232,163,113, 0,
+190,110,140,132,207,231,235,234,154, 46,172, 11, 62, 62, 62, 38, 62,159, 95,111,144,184,104,192,222, 78, 44,238,191, 40, 33,129,
+152,178,179,117, 63,173, 92,233,184,241,247,223, 23,208,132, 52,243,242,242, 66,239,158, 61, 43,237,248,252, 98,101, 97, 33,231,
+213,166, 13,255,193,175,191,122,232,197, 98,249,158, 61,123,212, 37, 37, 37,135, 27, 53,225, 81,148,134, 35,196,228,208, 60,128,
+126,249,133,200,240,171, 87,110,166, 58,122,121,240,186,116, 14,239,152,154,158,125, 29, 28,103,166, 40,170,209, 96,129,206,206,
+206, 65, 37, 37, 37,208,104, 52,240,244,244,196,234,213,171,225,237,237, 13,157, 78,135,164,164, 36,210,188,121,115, 42, 33, 33,
+ 1,205,155, 55,135, 74,165,130,201,100, 66, 69, 69,133,210,104, 52,214,151,155,177,136,199,227,255,204,227, 81,111, 81, 20,133,
+214,173, 3,115,214,173, 91,103,226, 56, 14, 33, 33, 33,120,241,197, 23,113,240,224, 65, 36, 37, 37, 85, 91,158, 76, 45, 90,180,
+204,225,241,168, 22, 85, 90,169,201, 22,152,234,212, 62,114,185,124, 84, 19,255, 52, 60, 95, 95,223,113,109,219,182,125,255,213,
+ 87, 95,165,197, 98, 49,180, 90,109,117, 91,208,195,134, 13, 47, 31, 49, 34,218,249,248,241,227,245,150,211,108, 54,207, 47, 40,
+ 40,240,209,235,245, 24, 58,116,232, 71,223,124,243,141, 76, 44, 22, 3, 0, 88,150,125,196,146,181,228,219,237,167, 62,158,191,
+ 46,238,212,238,229,190, 75,102,191,221,111,220,148, 47,227, 0,156,172,171, 96, 38,147, 41, 75,173, 86,191, 59,109,218,180, 29,
+ 27, 54,108,112,157, 59,119, 46, 56,142, 3, 33, 4, 12,195,212, 36, 18,231, 56, 14,135, 14, 29, 66,102,102,230,151,143,137, 44,
+ 27,108,176,193,134,127, 28,172,208, 34,255, 68,248,224,225,180, 33, 30, 23, 91,127,123,100,120, 62,159,191,241,244,233,211,157,
+251,244,233, 35, 24, 56,112, 96,248,201,147, 39,195, 11, 10, 10,238, 86, 89, 15,194, 7, 14, 28, 24,238,229,229,133, 53,107,214,
+232,248,124,254,198, 38,254, 76,205, 77,175,176,176,240, 6,128,111, 14, 30, 60,184, 98,226,196,137,240,246,246, 14, 85, 40, 20,
+127,107,157,157, 36,146, 46,239,172, 94,205, 8,105,154,247,221, 55,223, 56,173,140,139, 91,177,119,223, 62,193,115,207, 61, 71,
+ 17, 66,112,231,246,109,251,229,107,215, 74,199,190,240, 66,118, 90, 86, 22,115,228,212, 41,186,168,160,160,180, 64,165,154, 15,
+160,180, 49,126,154,166, 19, 51, 50, 50,124,123,247,125,206,239,220,239,119,111,190,252,194,240, 1, 66, 1,143,186,151,157,127,
+205,199,219,195, 57, 62,238,140,158,166,233,196,198,120,180, 90,237, 3,134, 97,220, 8, 33,158,241,241,241,240,244,244, 68, 89,
+ 89, 25,104,154,134,201,100, 50,233,116, 58,187,146,146, 18, 24, 12, 6, 24,141, 70, 56, 57, 57,225,206,157, 59, 69, 12,195,156,
+173,143,147,101,217,119, 36, 18,201, 98,161, 80, 40, 22,137, 68,242,107,215,174, 65,163,209,180,116,113,113,249,154, 97, 24,200,
+229,114, 36, 36, 36,204,116,114,114,202, 6, 0, 59, 59, 59,136,197, 18,119,163,209,200, 0, 40,104,106,155, 19, 66,154,124,189,
+188,189,189, 3,236,237,237, 23,125,250,233,172,144, 78,157, 58, 67,165, 82,129,227, 56,200,100, 50,232,116, 58, 56, 57, 57,161,
+ 71,143, 30, 15, 22, 45, 90,164, 32, 4, 19, 26, 16,131,252,170,235,131,137, 19, 39,202,156,156,156,144,151,151,135,224,224,224,
+ 26,161,165, 80,149,220,185,120,245,110,234,180, 73,163,251,238, 60, 26,151,114, 42,254, 90,202, 11, 67,123,118,162, 40,210,178,
+161, 50, 42,149, 74,149, 64, 32,152, 50,113,226,196,197, 65, 65, 65,173, 9, 33,104,215,174, 29, 6, 15, 30,140, 95,127,253, 21,
+233,233,233,208,106,181,236,229,203,151,119, 41, 20,138, 99,182, 33,220, 6, 27,108,176,225, 47,197,159,124,179, 30,177,104,253,
+157, 80, 42,149,170,212,212,212,147,215,175, 95,143, 30, 51,102, 12,226,227,227,223, 4, 48, 13, 0, 36, 18,201,155, 99,198,140,
+193,245,235,215,145,154,154,122, 82,169, 84,170,158,198,111,138,197, 98,131,201,244,208, 56,101,103,103,103,103,229,233, 45,171,
+166, 12, 1,160,101, 3,251,234, 55,141, 8, 4, 62, 29,134, 14, 21,148,221,188,169,217,124,229,202,226, 29, 59,118, 8,122,245,
+234, 69,209,102, 51, 88,142, 67, 96, 96, 32, 53,112,208, 32,217,207, 59,118,184,177, 90,109,194,146, 79, 63, 61,191,233,157,119,
+ 42, 51,170,252,192, 26,131,209,104, 92,251,254,228,119, 7,197,197,159,247, 11, 13,110,227,118,242,116,220, 13,119,119,103,105,
+ 80,219,182,178,146,178, 82,118,238,236,153, 2,163,209,248, 93, 99, 60,122,189,254,208,153, 51,103, 94,240,247,247,247,188,123,
+247, 46, 76, 38, 19, 88,150,197,192,129, 3, 65, 8,145, 0,224, 4, 2, 1, 82, 83, 83, 97, 54,155,149, 25, 25, 25,242,123,247,
+238, 73, 0, 44,107,164,124, 57, 70,163, 17, 41, 41, 15,103,237,154, 55,111, 30, 25, 21, 21, 5,134, 97, 48,116,232, 80, 28, 57,
+114, 36, 50, 37, 37,101,101,109,205,247,164,215,188,202, 66, 22,226,235,235,123,176,106,151, 69, 78,240,126,126,126,225,129,129,
+129, 27,150, 45, 91, 38,106,222,188, 57, 8, 33,112,117,117,129, 78,167, 67,113,113, 9, 66, 67, 67,225,239,239,143,101,203,150,
+ 1,192,174,134, 44,110, 28,199, 65,161, 80,224,193,131, 7,200,202,202,130,191,191, 63, 40,138, 66, 69, 69, 5, 24,230, 97, 78,
+110,105,133,230,248,247, 63, 31,235,191,111,195,252,176,238, 29,218, 5, 92,185,145,172,124,125, 84,164,180, 93,171,128, 32,213,
+221,133, 60, 96, 97,189, 73,151,229,114,249, 61,185, 92, 62, 70,169, 84,138,202,203,203, 35, 34, 35, 35,215, 12, 26, 52, 8, 55,
+110,220,192,249,243,231,199, 74, 36, 18,165,217,108,102,188,189,189, 39, 80, 20,229,100, 54,155,119,150,148,148, 40,108,227,161,
+ 13, 54,216, 96,195, 83, 71,181,143, 22,106,189, 91,103,209, 10, 9, 9,145,101,103,103,191,209,178,101, 75, 49, 0,216,219,219,
+135, 6, 6, 6,206,200,202,202,170,176,182, 52, 58,157,110,239,142, 29, 59, 6,175, 90,181, 74, 52,124,248,240, 54, 7, 15, 30,
+236, 6, 0,195,135, 15,111,227,232,232,136, 29, 59,118,152,117, 58,221, 83,139,137, 68,211,116,159,174, 93,187,162,180,180, 20,
+217,217,217, 86, 77,161, 28, 59,118, 76,138,135,126, 89, 13,238,107, 8,140,201,228,234,226,231,199, 43,136,139, 51,151,106, 52,
+ 62,125,250,246,165,104,179, 25, 60, 30, 15, 37, 37, 37,200,205,205,133,179,139, 11,149,154,145,225,176,101,214,172, 99, 45, 59,
+117, 18,179, 38,147,187, 21,197,212, 22, 43,139,222,250,112,202, 7,135,118,238,220,229, 89,174,209,100,218,219, 75,141, 18,137,
+200,123,234,135, 31,178,165,165,165,227, 1, 84, 90,192,179,108,231,206,157, 67,135, 14, 29,122, 59, 32, 32,192, 75,165, 82,121,
+151,151,151,179,165,165,165,124, 60,244,181,162, 0, 32, 46, 46, 14, 26,141,134, 97, 89, 54, 1, 15, 99, 97,153, 44, 45,104,139,
+ 22, 45,156, 35, 34, 34,250,121,122,122, 66,173, 86,195,221,221, 29,157, 59,119,238,199,231,243,127,204,201,201, 81, 63,205, 94,
+ 31, 27, 27,235, 72, 8,121,150, 16,130,161, 67,135, 90,116, 14,203,178,111, 71, 69, 69,137, 40,138,130, 94,175,131,157,157, 61,
+100, 50, 7, 56, 58, 58, 33, 40,168, 61,228,114, 57,134, 12, 25, 98,202,204,204, 92,175, 80, 40,246, 54,194, 5,185, 92, 14,149,
+ 74,133,220,220, 92, 20, 23, 23, 3, 0,138,139,139,107,156,243,159, 6,212,106,245,200, 30, 61,122, 76,159, 60,121, 50, 24,134,
+193,200,145, 35,145,151,151,183,242,193,131, 7,123,124,125,125,199,189,253,246,219,158,238,238,238,152, 62,125,186, 61,128, 47,
+108,227,161, 13, 54,216, 96,195, 83,199,227, 62, 90,127,182,104, 53, 52, 39,234,237,237,221,155,162,168,121,122,189, 94, 92, 61,
+ 37, 67, 81,148,216,211,211,243,136, 94,175, 95,170, 80, 40,172,114,138, 43, 47, 47,215,220,191,127,255, 72, 98, 98,226,232, 81,
+163, 70, 33, 54, 54,118, 60, 0,140, 26, 53, 10,137,137,137,184,127,255,254,145,242,242,242,167,146,128,212,207,207,111, 88,223,
+190,125, 71,117,237,218, 21, 49, 49, 49, 96, 89,246,146, 53,231,215, 94, 97,136, 58, 86, 29, 86,239,179,136,201,113,202, 59, 0,
+ 0, 32, 0, 73, 68, 65, 84,140,207, 7, 69, 81, 53,214,140, 98,149, 10,233,105,105, 40, 45, 43,131,209, 96,128, 86,167, 99,131,
+ 90,181,210,171, 77, 38, 33, 5, 88, 59,247,149,115,253,234,229, 92,157, 86,235,229,238,234,166,151, 74, 37, 40,215,168, 69,215,
+174, 94,174, 4,144,105, 33,135,137, 16,210,247,215, 95,127,157,207,231,243,199, 56, 56, 56,224,253,247,223,231,247,235,215, 15,
+ 34,145, 8, 70,163, 17,229,229,229,216,177, 99,135,138,101,217,214, 85,231, 56, 72,165,210,109,124, 62, 63,191,162,162, 98, 94,
+163, 63, 96, 50, 13,143,142,142, 22,152, 76, 38, 44, 89,178, 4, 11, 22, 44,192,208,161, 67, 5, 87,175, 94, 29, 14, 96,231,211,
+234,241, 28,199, 33, 50, 50,178,182, 51,124,138, 37,231, 9,133,194,240,182,109,219, 66,165, 82, 65,165, 82,193,211,211, 19,190,
+190,190,240,246,246,198,202,149, 43,201,154, 53,107, 78,154,205,230,245,197,197,197, 69,150,148, 33, 43, 43,171,198, 50,104, 48,
+ 24,160,213,106,145,151,151, 87, 51,117,168,151, 57, 13,157,242,214,136, 78, 90,189, 94,119,229, 78, 70,238,188,143,198, 61,167,
+213,235,117, 25, 15,114,211,129,181,156, 5,253,123,194,248,241,227, 39,140, 30, 61, 26,149,149,149, 72, 76, 76, 68,207,158, 61,
+177, 98,197, 10,159,132,132,132,105, 93,187,118,133, 80, 40, 68,124,124, 60, 24,134,201,179,141,133, 54,216, 96,195, 63, 25,255,
+ 82,255,172, 6,209,160, 69,203,223,223,223,133,101,217,153, 81, 81, 81,145, 47,188,240, 2,134, 12, 25,242,200,247, 59,119,238,
+116, 60,112,224,192,210,181,107,215, 14, 53,155,205,203,172,153,234,227, 56,238,208,206,157, 59,135, 63,247,220,115,210,254,253,
+251, 7, 2,128, 68, 34, 49,237,220,185, 83,199,113,220,161, 38,212,165, 58, 16, 99, 17, 0,248,250,250,118, 20, 8, 4,163,134,
+ 13, 27,214,241,173,183,222, 66, 82, 82, 18,118,236,216,113, 47, 40, 40,232, 66, 81,145, 85,254,213,217,141,172, 58, 92,218,152,
+117,139, 47, 22,151,148, 23, 22,186, 56, 4, 4, 8, 93, 29, 29, 21, 49, 49, 49,254,131, 6, 13,162,242,242,242, 80, 86, 86, 6,
+131,193,128,171, 87,175,114, 2, 32, 71,224,234, 74,229, 36, 38, 82,124,177,184, 4,180,117, 43,221,253,125, 92,219,125, 62,123,
+ 82, 75,131,209, 16,166, 86,171, 25,129, 80, 40,108,238,237,146,151,150,105,213, 76,156, 81, 42,149, 70, 0, 16,112, 28,167,115,
+115,115,147,158, 62,125, 26, 98,177, 24, 20, 69,161, 67,135, 14,176,179,179, 19, 17, 66,114, 1,192,209,209, 81,188,113,227, 70,
+231,113,227,198,157,111,140,184, 75,151, 46, 66,137, 68,242,124, 80, 80, 16, 18, 19, 19,113,247,238,221,156,196,196,196, 22, 93,
+186,116, 65, 64, 64,192,243, 62, 62, 62,251,110,220,184,241, 84,150,247, 63, 92,177,106,189, 51, 60,203,178, 28, 69, 81,224,241,
+120,224, 56, 14, 42,149, 10,173, 91,183,198,186,117,235,176,122,245,234, 37, 10,133,226,168, 21, 92,172, 70,163,129, 76, 38,195,
+221,187,119,141, 81, 81, 81, 18, 30,143,135,123,247,238,213, 8, 45, 47, 15,183,208,158, 93,195,131,151,124,187,253,148, 76, 34,
+145, 12,233, 23, 17,146,156,145,147, 79, 8,213,232,180,113, 72, 72,136,168,117,235,214,227, 71,143, 30,141,172,172, 44, 44, 93,
+186,180, 88,161, 80,196,157, 58,117,234,165,201,147, 39,243,123,246,236,137,146,146, 18,252,252,243,207,204,181,107,215,126, 42,
+ 44, 44,220,110, 27,198,109,176,193, 6, 27,254, 33, 66,203,223,223,127,180, 72, 36,154,254,202, 43,175,240,219,183,111,143,162,
+162, 34, 56, 57, 57,209, 20, 69, 9, 1,192,197,197,133,182,183,183,199,164, 73,147,208,169, 83,167,222,179,102,205,234, 41, 16,
+ 8,214,201,229,242,109,150,252,176, 82,169,212,241,120,188,253,239,191,255,254,178,155, 55,111,180, 6,128,223,127,255,253,190,
+ 92, 46,159,173, 84, 42,117, 86,214,163, 58, 40, 38, 37,145,216, 93,105,215,174,221,131,136,136, 8,167, 23, 94,120, 1,158,158,
+158,184,126,253, 58,150, 47, 95,158, 97, 50,153,230,159, 59,119,142,249,187, 27,153, 49, 26, 11,175, 29, 62,236,216,239,181,215,
+156,166, 70, 69,125,243,193,251,239,175,250,252,243,207, 5,237,219,183,167,116, 58, 29,174, 92,185, 66, 14, 28, 56, 64,255,188,
+120,241,106,200,100,194,196, 3, 7,196, 38,147, 41,199, 74,203, 93,223, 94,125,122,183,255,102,213, 90, 24,244,149,184,114,233,
+ 56,202,202, 84,216,184,233, 96,123, 63, 63,210,183,160,160,224,156,165, 92, 20, 69, 5,197,198,198,122, 17, 66, 32, 22,139,177,
+104,209, 34,248,250,250,194,201,201, 9, 21, 21, 21,152, 54,109,154,243,199, 31,127,236, 12, 0, 73, 73, 73, 53,225, 25, 26,131,
+ 92, 46,239, 49,105,210, 36, 71,134, 97,112,242,228, 73, 19, 69, 81,243,206,156, 57,243, 99,135, 14, 29,196,189,123,247,118,220,
+190,125,123, 79, 0,241, 79, 75,104, 53,241,188,123,167, 79,159,238, 58,102,204, 24, 34, 20, 10,169,242,242,114,184,184,184, 96,
+221,186,117, 90,133, 66,113,220, 74,174, 69,179,103,207,158, 95,181,189,117,222,188,121,239, 46, 91,182,204,179,176,176,176,198,
+170,169, 44, 46, 61,219, 35,234, 67,182,164, 92,109,250,233,219, 89, 47,219,219, 73,196,243,150,253, 20, 79,243,113,185,209,126,
+197, 48, 98,169, 84, 42, 38,132, 96,255,254,253,200,201,201,121,187,164,164,164,144,101,217,131, 51,103,206,156,209,190,125,251,
+ 86,105,105,105, 57, 21, 21, 21, 43,148, 74,229, 3,219,112,103,131, 13, 54,216,240,151,161,218, 9,190,122,245,225,113, 60,156,
+ 78,172, 95,104,177, 44, 59,233,212,169, 83,124,142,227,176,105,211, 38, 92,187,118,141, 72,165,210,121, 82,169,244,123,123,123,
+123, 86,175,215, 79,124,239,189,247,198, 45, 88,176,128,215,187,119,111, 36, 38, 38,242, 90,183,110, 61, 30, 64,109,161, 53, 8,
+ 13,196,218, 80,171,213, 87,139,138, 10, 91,215, 10, 80,217, 90, 34,177,187,218, 72,101, 30,231,124, 60, 40,102,247, 69,139, 22,
+105,125,124,124, 76,119,239,222,197,134, 13, 27,184,107,215,174,197,137,197,226,141, 10,133,194,104, 33,231,211, 64, 13,167,152,
+ 97,174,255, 50, 99, 70,200, 51, 35, 71,114,239, 78,159, 94, 41,178,183,255,232,155,181,107,103,149, 87, 84,248,130,162,136,187,
+179,115,206,166, 69,139,150, 14,125,254,249,202,164,115,231,236,110,198,198, 10, 61,105,250,150, 53,229, 44, 40, 40, 56, 23, 31,
+127, 30, 91, 55,175,130,217,108,132,162,224,161, 78, 43, 46, 81,163, 17,145,245, 39, 78,134, 97,212, 47,189,244,146, 8,128,253,
+235,175,191, 46, 86, 42,149,104,211,166, 13, 0, 64,163,209,224,248,241,227, 8, 14, 14, 6, 0,220,185,115,167,102,187,177,114,
+202,100,178,231,123,246,236,137,156,156, 28, 36, 37, 37,253,166, 80, 40, 74, 0,252,150,151,151, 55,188,107,215,174, 56,116,232,
+208,136, 6,132,150, 85,215,200, 66,161,245, 39, 78,123,123,251,217, 7, 15, 30,124,251,210,165, 75, 99,102,204,152, 33, 28, 56,
+112, 32, 0,160,162,162, 66, 7,128,181,134, 83,175,215,111, 4, 80,179,114, 54, 59, 59,251,151,233,211,167, 39,124,242,201, 39,
+158,213,229, 83, 37, 31, 77, 84, 1,137, 97,253,222,254,188, 71,215,176,246, 95,174,217,113, 42, 55,175,104,135, 58,229,136,218,
+146,186, 19, 66, 64,211, 52, 56,142,131,155,155,155,182,164,164, 4, 74,165,242,129, 82,169,124, 63, 51, 51,211,170,186, 63,205,
+ 62,111,227,180,113,218, 56,109,156,255,163,176, 60, 50, 60, 33,132,225, 56, 14,241,241,241, 56,120,240, 32,107, 54,155, 39, 40,
+ 20,138,218,209,170,215, 94,191,126, 61,246,165,151, 94,218,150,150,150,198, 79, 78, 78, 6, 33,132,181,166, 52, 6,131,129,166,
+168, 63,239,123,210, 90,110,221,186, 21,133,133,133,230,188,188,188, 51, 12,195, 28,122,194,213,139, 79,188,234,112, 43, 96,124,
+213,100, 58,179,160, 87,175,200,249,177,177,146,119, 63,251,204,248,230, 91,111,205,100, 77, 38,154, 47, 18,113, 98,153,140,199,
+ 74, 36,194,164,115,231,236,214, 76,158,236,166, 55, 26, 79,238,176,194,193,188,218,162,213,175, 95,111,188,249,238, 39,208,215,
+178,104, 37, 94, 77,135,209, 12,171, 44, 90, 70,163, 49, 76,161, 80,192,206,206, 46, 23,128,247, 27,111,188, 1,142,227,160,215,
+235, 81, 81, 81, 1,185, 92,174,126,235,173,183,216, 42,241, 36, 24, 53,106,148,147, 37,188,129,129,129,190, 66,161, 16, 39, 79,
+158,132, 80, 40, 60, 14, 0, 66,161,240,120,108,108,236,240,177, 99,199,194,207,207, 47, 48, 43, 43,139, 66, 35,254,105, 94, 97,
+ 35,247, 18,160, 29, 40,180,125,104,130, 67, 91,207,176,145,183, 41, 32,163, 42,106,124, 74,151, 46, 93, 0, 11,253,178,106,163,
+106,113,199,106,154,166,247,205,154, 53,235,253,238,221,187, 15, 94,176, 96, 1,133,170, 80, 13, 79,136,244,130,130,130, 62,115,
+230,204, 57, 69, 8,121, 68,244, 43,139, 75,207, 62, 23, 61,133,148,151,171,111,170, 82,142,222,177,202, 98,202, 48, 79, 20,206,
+194, 6, 27,108,176,193,134,167,102,213,250, 19,234, 21, 90, 20, 69,109,234,219,183,239, 4, 0,124,138,162, 54,200,229,242, 63,
+ 13,254, 10,133, 34,221,215,215,247,235, 86,173, 90, 77, 4, 64, 40,138,218,100,101,161,138, 8,193,114, 30,143,154,245, 80,220,
+ 53, 41, 64,101,117, 90,146, 89, 0, 40, 30,143,191,237,198,141, 27,159,229,230,230,170, 44,180, 64, 52,136,167,177,234, 16, 0,
+118, 1, 15, 94,201,201, 57, 53, 61, 60,124,208,208,201,147,209,113,232, 80, 39,223, 22, 45, 88,189,217,204,221,185,112,129,186,
+180,127,191,232,102,108,172, 80,111, 52,158, 60, 4,228, 90, 91,206,130,130,130,115,103,227,206,157,126,121,212,240,193,129,173,
+124, 31,138,134, 7,114, 20,151,170, 79, 91, 35,178, 30, 19,189, 35,215,173, 91,119, 84, 36, 18, 9,106,167,178, 49,155,205,165,
+ 70,163, 49, 12, 0,202,202,202,124, 55,109,218,180,155,199,227,229, 52,198,151,156,156,124,100,254,252,249,163,178,179,179, 79,
+231,229,229,101, 3, 64,110,110,110, 54, 77,211,219, 20, 10,197,168,156,156,156, 3,176, 96, 17, 0, 1,218, 37, 93,216,215, 1,
+ 0,194,122,141, 70,210,133,125,118, 0, 58,132,245, 26, 13, 0,104,106, 46,195,218,168, 10,131, 48, 47, 49, 49,113,231,224,193,
+131,223,195, 19,196,244,122, 92,108,153,205,230, 22,143,239,172,182,108, 89, 67,100, 50,153,104,189, 94,207,176, 44, 43, 48,155,
+205,196,100, 50,217,210,215,216,208, 24,108,185, 47,109,248,215,130, 16,210, 21,128,103,245,176, 89,245,238,249,216,182, 9, 85,
+233, 2,171,135,202,170,207, 42,138,162,174,214,226,168,217,111,193,185, 0, 80, 12,224, 54, 69, 81,245, 25, 65, 54,213,247,185,
+ 94,161, 37,151,203, 15,192,130,164,209,150, 30,215, 0,230, 84,229,137, 3,154,158,135,173,134,131,101,217,162,220,220,220, 39,
+190,160, 60, 30,239,193,136, 17, 35,172, 58,190,177, 99,246, 0, 57, 31, 26,141,219, 99,190,251,174,243,201, 13, 27,252, 88,134,
+113,167, 0,194, 23,139, 75, 76, 38, 83,182, 39, 77,223,178,214,146,245,136, 53,230,126,193,144,172,251, 5,104,219,182, 45,185,
+119,239,222,211, 24, 84,111,105,181, 90,255,198,186,128, 78,167,235,109,161, 24,220, 85, 80, 80,176,171, 14,193,190, 91,161, 80,
+236,182,226, 78,145, 81, 37,170,120, 28,197,189, 28,214,107,244,126, 0, 92,117, 82,233,167,137,194,194,194, 52, 84,197,121,251,
+167, 33, 39, 39,199, 72, 81,212, 47,203,151, 47,127,253,230,205,155,123,228,114,185,209, 54, 20,219, 96,131, 13,255,101,145, 69,
+ 81, 84, 76,213,231,232, 42,163, 80,204,227,219,213,199, 84, 31, 87,251,152,106,142,199,247, 55,116, 46, 0,204,158, 61,251,179,
+165, 75,151, 74, 1, 88,154,140,185,201, 73,165,255, 42, 20,253, 67, 56,106,139,130,205,127, 69, 69,191, 3, 76, 96,152,203, 96,
+106,249,228,211, 79,215, 16,113,239,222,189,255,244, 83,107,117, 82,233, 90, 8,255, 95, 29,124,178,179,179,215, 5, 4, 4,108,
+148,203,229, 12,108,176,193,130,251,149,173, 9,108,248,151,194,179, 46, 97, 84,143, 40,139,110,232,251, 71, 30,220,235, 56,174,
+174,207, 20, 69,197, 44, 93,186, 52,218,138,242,214, 88,180,120,182,107,103,131, 13,255,110,252,127,172,164,181,193, 6, 27,108,
+248, 79, 60,121, 60,102,197,170, 22, 95,143,127,158, 61,123,246,103,104,120,198,201, 7, 15,173, 88, 62, 85,159,107,252,181, 40,
+ 60, 92, 57, 80, 23,172, 89, 77, 48,168, 9,245, 59, 99,227,180,113,218, 56,109,156, 54, 78, 27,167,141,243,127,142,179, 49,238,
+ 51,117, 8,162,168,250,166,250, 26,154, 70,124,124,187,177,115, 27, 59,150,162,168,250,194,252, 84, 79, 21, 62,254,254,151, 99,
+144,141,211,198,105,227,180,113,218, 56,109,156, 54, 78, 27,231,147,128, 16,210,149, 16, 18,133,135,211,223,132, 16, 18, 69, 8,
+ 25, 58,123,246,236, 57,213,251,102,207,158, 61,135, 16, 50,176,250,184,170, 99,106,206,169,222,247,248,251,227,251, 26, 58,182,
+129, 34, 78,120,108,187,230,243, 63,197, 71,203, 6, 27,108,176,193, 6, 27,108,176,161, 78, 84,175, 24,172,101,109, 82, 1,184,
+179,116,233,210,178, 90,190, 83, 42, 0,183, 0,116,170, 58, 78, 85, 37,210,106,251, 86,153,170, 62,155,234, 56,198,100,201,177,
+245, 96, 83, 61,219, 54,161, 85, 31, 58,121,243, 22, 7, 52,247,138,168,186, 0, 32, 85, 73,128,185,170,120, 69,164, 58,112, 17,
+199,129, 16, 2,185,178,252,250, 29, 37, 62,111,234,239, 5,249,194,205,203,206,110, 53, 71, 72,175,170, 93,231,212, 37,198, 79,
+146, 52, 40,183,148, 35,184, 25, 66,236,120,152,201, 17,116, 4, 0, 30,133,219, 6, 14, 95,167, 22, 89, 31, 79,170,174,126, 30,
+230,137, 9, 98,123,233, 43,206, 46,174,109,203,202,138, 51,204, 6,227,190,100, 21, 54,162, 9, 14,182,129,174,120,150, 35,248,
+ 12, 0, 79,200,195,202,140, 82,139, 87,114,216, 96,131, 13, 54, 60,169,117,228,137,226,226, 81, 20,197,214,193, 73, 61, 33,167,
+109,161,130, 5, 98,171,142,221,191,215,177,239,234, 63,169,220, 86, 9,173, 80, 79, 76, 6,133,133, 0, 8, 8,190, 72, 86,225,
+ 7,171,206,247,193, 32, 59, 62,127, 11, 0,190,193,204, 78, 39, 28, 18,234,108, 76, 30,250,216,137,248, 43, 1,112, 6,150,125,
+ 39, 89, 97,185,191, 88,152, 31,134, 10, 56,222, 47, 28, 33, 66,150, 35,219, 64, 16,227, 32,194,197,203, 5, 48, 88, 83,214,128,
+230, 94, 17,135,127, 87, 12,142,251, 97, 42,186,119,108, 3,194, 50, 0, 71, 67,218,123, 38,126,251,246, 13,116, 15, 9, 0,225,
+104,128, 99,224, 48,236, 27, 12, 11,119, 38,119,148, 77,203,131, 29,228, 11,183, 22, 30, 94,119, 55,111,222,226,237, 27, 24, 74,
+113,140, 25,105,191,159, 30,247,241,172,249, 3,194,160, 14,183, 68,108,117,244,193,187, 1, 45,219,207,252,100,225, 42,190,143,
+175,191,140,163,141, 76,225,131,148, 46,107, 87,204, 63, 32,226,229,172,188,173,192, 22, 75,251,114,168, 39, 38, 10, 36,226,209,
+246,118,178,182, 58, 93,197, 61,214, 76,239,227, 9, 5, 67,191,254,102,117,231,126,145,195, 29,216,138, 66, 30,205, 33,116,239,
+158,221, 45,190, 91,183,126,248, 93, 5,251, 60, 0,206,154, 58,115, 4,179,210,183, 79, 24, 46, 20,240,169,144,183, 55,243, 1,
+166, 73, 66, 43,196, 11,175, 82, 4,141,134,151, 32, 20,206,167, 40,177,171, 41,191, 17,236,133, 31, 41,130, 32, 80,216, 79, 17,
+236, 78, 86, 65,105, 27,242,108,176,225,191, 5, 30,143, 23,199,113, 92,255,167, 44, 12,158, 37,132, 92,182,181,238,255, 54,172,
+179,104, 81, 88,146,148,153,231, 10,214,140,176,160,192,197,128,117, 66,203,142,207,223,118, 53,163,200, 27,140, 25,155,191,124,
+127,143,137, 6, 24,218, 12,150,161,193, 50, 52, 24,198, 12,150,166, 65,104, 35,230,255, 20, 7,152, 42, 16, 17,222,110, 27,192,
+250, 88,250, 27, 66,194,251,229,250,133,211,110,148, 73,141, 93, 63, 44,253, 48, 79, 85,249,225,153,219,242,226, 80, 47,253,156,
+100, 37,126,182, 70, 16,196,109,152,138, 29,135,142,231,175,249, 81,155,202, 17, 2, 55, 39,251,246,227,162,147,252,183, 31,137,
+203, 91,189,205,144, 10, 0,206, 50,113,251,241,183, 51, 2,158,228, 34,120,217,217,173,222,184,254, 59,111, 31,119,123,138,185,
+180, 12, 12,203,194,191, 69, 20,127,206,148,113, 62, 75,190,221,242, 45, 52,198, 55, 27, 58,191,189, 23, 66, 91,182, 10,153,190,
+237,248,165, 0,173, 70,105, 58,189,243,179, 76, 24, 65,123,251,133, 8, 23, 47, 93,197,159,251,233,212,105, 38, 54,255, 74,154,
+ 18,201,141,141, 53, 33, 94, 56,178,116,217, 55, 29, 7, 12,139,118,224, 42, 85,124,131,182, 50,104,243, 79, 91, 22, 6,119,236,
+ 38,237, 29,222, 92,164,220, 55,137,210, 87,148,194,204,179,147, 12, 8, 27,228,164,127,125, 44,189,121,235,142, 41,201, 74,172,
+181,166,206, 44,249,163,239,113, 92,211,163,174, 83, 4,189,111, 94,142,155,200,202,175,130,176, 52,192,154,107,222,193,210, 32,
+220,195,247,238,147,126, 2,208, 52,161,197, 35, 24,124,230,194, 85,159,162, 66, 69,215,111,191,249,106, 14,185,122,245, 87,176,
+248, 37,165, 20,231,172, 21,152, 0,130, 90,187,243, 79,209, 44,140,121,229,108, 80,245,206, 1, 65,146, 30, 62, 14,212,192, 92,
+ 53,149,112, 62, 83,127,206, 54, 52,217, 96,195,255,139,197,132, 33,132, 8,158, 50,231,112, 66,200,137, 39,164,153, 9,224,221,
+170,237, 45, 0,190,126, 10, 69,107, 14,192,187,106,187, 16, 64,190,173, 7, 60, 17, 30,119,126,111,114, 28, 45, 59, 16, 14,216,
+255, 2, 0,216, 91, 91, 10, 2,216,129,226, 3,180, 22, 35,135, 69,194,195,203, 27,160,117,128, 89, 7,208,122,128,214, 2,180,
+ 30,197,138, 28,192,172, 5,178,126, 5, 67,136,196,234,234, 26,213, 64,250, 62, 12,236, 18, 0, 79,103, 59, 76, 29, 25,234,177,
+233,100,250,150, 45,167,211, 6, 37, 43,241,138, 69,101, 37, 4,221, 59,180,197,154, 45,218,212, 99, 55, 84, 67, 0, 96,120, 39,
+247,147,221, 67, 91,248,175,222,102, 72, 61,113,167,108, 40, 0, 12, 13,115,250,181, 91,123,159, 0,238, 9,194,211,112,132,244,
+246,109,217,150, 98,111,110, 4,167,201,135, 70,163, 71,254,131,237,112,245,123,134,199,114,232,219,216,249,246,124,204,254,104,
+238,114,161, 78, 83,100,226,204, 42,214,147, 95,198, 23,136, 57, 10, 5,231,140,149, 92, 57,251,201,132, 55,152,233,159,127, 57,
+ 27,192,184,134,120, 66,189, 48,101,229,202,213, 29,122, 70, 4,123, 21, 30,152, 74, 85,150, 21,129,225, 75, 37, 35,159,235, 9,
+151,118,161, 92, 81,252, 74, 74, 28, 56, 8, 46,238,129, 40,184,180, 19,217,151, 15, 82,189,186,140,146,252,188, 75,244, 58, 96,
+174, 83,104,181,245, 64,175, 33,125,186,237, 9, 12,240,245, 33,132, 3,199, 17, 16,142, 69,165,129,198,156,189, 89, 96, 89, 22,
+ 47, 13,233, 53, 80, 38,166, 8,199,113, 32,132, 67, 94, 97,137,238,236,149,212,129, 89,101,184, 98,137,165,170,211,179,253,123,
+221,190,126, 57,152, 78, 63,134,136,113, 75, 83, 41,224, 66,173, 62,215,235,198,169,159,131,129,159,154,174,229, 40,176,217, 39,
+151, 33,160,207, 4,254,198, 93, 39, 61,213,170,130,241, 7,182,175,127,249,135,141, 27,119,164, 42, 49,201, 26,145,245,113, 31,
+241,133,111,207,106,220,159, 11,148,169,242,106,217, 41, 91,187,242,134,108, 56,145,252, 81,226,162,238,193,115,143,147,242,132,
+ 76,195, 29,219,184,101,131, 13,127, 47, 8, 33, 79, 93,108,229,228,228,200,159, 68,108,249,249,249,245, 41, 40, 40, 88, 81,237,
+173, 66, 81,212,138,150, 45, 91,206,255,227, 65,245,145,103, 61, 53,203,178,227, 10, 10, 10, 18, 26,226,140,138,138,242, 61,126,
+252,120,171, 90,156,173, 0,180,170,235, 88, 23, 23, 23,182, 71,143, 30,217,199,143, 31,151,219,122, 72,147, 4,151,213, 66, 43,
+ 53,119,223,212, 46, 70, 69, 37, 0,164, 90,112,252, 35, 83,126, 6,154, 93,182,117,225, 27,203,194, 90,186,161, 66,107,194,233,
+107,217, 96, 89, 26, 44,195, 84, 89,182, 24,176, 12,141, 33,157, 60,208,195, 48, 9,107, 99,210,192,176,220,210,134, 56, 31,135,
+153,112,175,118, 30, 52,102, 47,199, 17,177, 68,200, 83, 7,249,187,123, 77,127,169, 19,111,234,200, 48,232,205,204,152,157,241,
+153,103, 83,148,216,108, 17, 39,247,231,240, 68,164,174,125, 44,211,104,221, 27,176, 70,117, 31,212,175,183, 19, 49,170, 65, 23,
+103,161, 66, 71, 35,171,132, 70,161,161, 28, 18, 74, 97, 17, 39, 71,208,177,185,159,143,244,226,158, 79, 31,184,243, 53, 2, 47,
+ 62, 35, 18,243, 24,176, 28,225,147,242,100,163, 91,112,164,176,218,111,171,161,114,218, 75, 29,223,232, 51, 56,202, 57,119,231,
+ 4,202, 62,104, 8,188,186,248,227, 65,194, 86, 40,175,197,160, 68,158, 77, 57, 25,202,209,204,189, 13,134,141,123, 5, 95,191,
+210, 21, 21,154, 10,240, 21,153,206, 98,161,196, 5, 48,215,201, 73, 88,140, 91,185,252, 75, 31, 1,159,247,176, 61,171, 95, 44,
+ 13,189,209, 8,176, 12,236, 4, 28, 40, 82,253, 29, 13,150, 54, 75, 59,142,250,244,125,128,189,210, 88,221, 83,148,216, 21,234,
+137,222,224,232, 96, 66,235, 65, 1, 23,146, 85,127,136,159, 16, 47,188,250,204,144,183,122, 19, 10,231,155,114,141,194,221, 17,
+ 29,209,202, 65, 38,211,164, 34,127,255,135,200,132, 29,105,214,243, 93,188,250,246, 20,233,166, 77,155, 70, 0,100, 50, 30,245,
+ 81,171,225, 12,110,198,159, 72,179,152, 15, 0,122,154,108,117, 20, 83,111,175,220,157,232, 14,254, 31, 25, 30,170, 45, 89,153,
+ 37, 92,153, 57,110, 94,218,179,211, 99,250,117,184,217, 47,143,162, 36,185,231,238, 25,213,214,244, 37, 43, 97,227,180,113,254,
+229,156, 78, 78, 78,173, 91,182,108, 57,159,166,233, 62, 34,145,168,153,217,108, 6,199,113,133, 98,177,248,124,118,118,246, 34,
+141, 70,115,255,159, 86,247,219,183,111, 91, 35,182, 26,229, 20, 10,133, 72, 75, 75,187,103,133,216, 58,243,216,249,191, 92,184,
+112, 1,123,247,238, 5, 0,164,167,167,163, 93,187,118,178,186, 78,124,240,224,129,172, 95,191,126,191, 0,240,111,136,243,206,
+157, 59,173,143, 29, 59,134,253,251,247, 3, 0,210,210,210, 16, 20, 20, 84,103, 97, 46, 92,184,192,127,237,181,215, 90, 3,144,
+255, 13,215,232,191, 32,178,106,191,255, 33,180, 98, 98, 98, 72,116,116, 52,245,248,118, 29,200, 10,112, 21,119,129,129, 5,128,
+ 44,107, 75,144, 82,132,229,107,182,159, 26,250,219,254,117,125,236, 68, 60, 44,216, 60, 61, 79, 85, 90,241,172,128,122, 56,253,
+194, 16,240, 92, 29,196,137, 75,199,119, 10, 40,171, 52,224,232,239, 5, 9,201, 74,235, 76,164,201, 10,196, 2,156,203,195, 79,
+ 44, 12,122,101,208,248,175, 99,119,239,158, 61,180,227, 39, 35, 59,226,200,165,236, 79, 0,166,209,168,239,132,227, 64, 56,166,
+198,249,189,234,209, 1,224, 30, 77,224,203,129, 60,220,199, 89,103,209,234, 11, 8,202,188, 48,204, 81, 42,254,126,226,196,247,
+156,104, 85, 6, 74, 77, 34,228,149, 25, 80,168, 23,162, 82,224,133,130,212, 59, 44,143, 66,108,163, 38, 23, 10, 26,194, 24, 92,
+ 92,197, 14,188,240,200,247,253, 52, 39, 63, 43, 19, 83, 12,223,233,197, 37, 46,197,191,173,202,102,180, 42, 45, 69,161,209,240,
+243,206,206, 46,237, 12, 37,217,124,117, 89, 49, 92,188,195, 48,116, 76, 52,190,136, 10, 69,133, 70, 11, 85,105, 34,105,235,227,
+ 68,229,156,223,129,185,195, 66, 80, 82,164,128,145, 6, 40,173,177,212, 96, 50, 84,214,219,142, 60,108,252,120,198,172, 87, 91,
+248,120,202,170, 23, 21, 16,142, 69,167,144, 64, 68,246,233,142,216, 11, 23,113,245, 78, 58,184,170, 69, 5,132,227,144,175, 44,
+ 43, 50,152,217,173, 86, 53, 40,203,128,208,134, 58,133, 24,154, 48,101, 24,238, 5, 41, 11,124,222,181,181,227, 59,179,163, 91,
+ 56,202, 36, 20, 12, 52, 11,131,137, 70,197,197,239,225,222,178, 3,164,118,118, 84, 23,232, 5, 55, 80,119,219, 26,104,204,191,
+175, 40,247, 65,101, 33, 94,139, 12,251,104,219,210, 15,100,148,221,195,174, 73,179,143, 90,178, 46, 46,236,122,234,181,197,135,
+227,246,238, 27,235,251,245,204, 55,250, 13,153,182, 53, 14,192, 73,219,184,101,195,191, 17, 47,191,252,178, 93, 81, 81, 81,188,
+191,191,127,104,100,100,164,180,119,239,222,208,106,181, 56,125,250, 52,180, 90,109, 11,127,127,255, 22,167, 79,159, 30,149,155,
+155,155,220,188,121,243,126,251,247,239,183,216,135,182, 74, 0,241,107,134, 96,128,161, 40, 10, 85,251,168,170,125, 77,206,115,
+ 43, 22,139,145,147,147,243,212, 45, 91, 5, 5, 5,247,154, 98,217,170,172,172, 20,249,249,249,193,211,211, 19, 44,203, 66,171,
+213,226,240,225,195, 80,171,213,224, 56, 14,246,246,246, 88,178,114, 51, 82,111,196,227,202,149, 43, 80,171,213,162,198, 56,243,
+243,243,169, 78,157, 58,193,104, 52,130, 97, 24, 24, 12, 6,156, 57,115,166,230,179, 64, 32,192,172,197,223, 34,253, 90, 60,110,
+222,188,137,252,252,252,191, 37,219,136, 21, 90,228,159,136,122, 99,102,253,237,171, 14, 89,150,153,179,105,219,238,196, 57,147,
+ 94,193,148,177,131,252, 23,173, 59, 56, 40,165, 24,219, 0, 32,196, 3,227, 95,239,223, 54,192, 69, 42,196, 23, 59,175, 1,132,
+204,121,210,223, 75, 42, 69,122,104, 51,238,147, 67, 87,114,226, 63,123,165, 11, 2,125,156,218,149,137, 75,197, 89, 89, 22,228,
+ 20,228, 24,184, 58, 72,218, 15,239,228,126, 18, 28, 7, 23, 71, 73, 48, 88, 6, 46, 14,146,246, 67,195,156,126, 5, 0, 39,169,
+ 48,184, 46,203, 87,125,136,240, 23, 78,144, 74, 4, 19,100,142, 46, 1,111,142,136,180, 31, 62, 98,148,189,131,144, 65,201,149,
+211,208, 8,155,131,118,107, 1, 35, 93,138,252,251,153,236,111,151, 83, 10,138, 43,140,211, 27, 45, 38, 65, 66,193,253, 52,207,
+214, 29, 35, 93,139, 99,230, 42, 91,191,181,179, 21, 15, 28,175, 98,199,139, 69, 50,175,110,246,191,103,221,175,228, 72,157, 22,
+157, 71,160, 81,171,179,105, 22, 62,122, 86,224,152, 25,247, 51,102, 15,235,128,178, 82, 37, 12,102, 6,106, 61, 99,246,118,177,
+147, 24,239,223,133,209,204,192, 68,115, 16,186,248,225,116,226,157, 98,142,166,127,173,143, 51,171, 4, 55,179, 14,223,116,168,
+189, 47,208, 3,157, 62,117,178,191, 9, 90,143,156,124, 57,182, 29, 79,236,146, 85,130,155, 79,114,157, 9,199, 60,156,126,174,
+101,201,162, 8,122, 55,197, 9, 62,216, 11,221, 68,118,162,239, 86,124,242, 90,232,115, 65,110, 18, 46, 63, 17, 20,103,134,140,
+ 21, 64, 47,102,225,236, 31, 8,206, 84, 65,116, 6, 67,121, 18,208,208,197,231, 3, 0, 49,107,241,245, 27, 97, 50,202, 53, 16,
+108,214, 73, 8, 58, 79, 0, 93,101,237,207, 44,225,238,152,227,230,165,246,152,113,172,239,226,216,254, 41,242,227, 11, 82,252,
+ 94,254,190, 19,176,181,165,237,118,109,195,191, 17,237,219,183,247, 46, 40, 40, 72,154, 49, 99,134,219,139, 47,190,136, 67,135,
+ 14, 65,163,209, 96,235,214,173, 88,189,122, 53, 22, 46, 92, 8,154,166,177,105,211, 38,233,129, 3, 7,186,173, 95,191, 62, 63,
+ 32, 32, 32, 44, 55, 55,183,176, 17,129, 69, 1,144, 0, 16, 86,221,187, 40, 0,220,137, 19, 39, 48,124,248,112,156, 56,113,130,
+171,218,199,226,225,195, 79,147,114,127,138,197, 98,136,197, 98,168,213,234,167, 34,182,132, 66, 33, 28, 28, 28, 32, 22,139, 81,
+ 81, 81, 97,181,216, 98, 24,134,159,159,159, 15,181, 90,141,200, 17, 35,240,237,210,165,232,223,191, 63, 34, 35, 35, 65, 8,193,
+153, 51,103, 48,168,103, 56, 94,121,190, 31, 82, 82, 82,192, 48,140, 69,229, 45, 44, 44, 68, 81, 81, 17,134,142, 24,129,205,235,
+215,163,123,247,238,104,223,190, 61, 24,134, 65,124,124, 60, 94, 30,210, 19,118, 47, 12, 66,122,122,186,173, 83, 91,110,205,122,
+ 42, 62, 90, 79,140, 36, 21, 46,115, 71,206,197,140, 29,210, 45,122, 68,175, 80,108,222,243,219,151,240,212,236, 6, 0,119,163,
+100,201, 27,253, 3,145,156, 91,134,223,110,202, 99, 82,138,241, 84, 86,107,112, 44, 60,220,157,164, 0, 95, 12,189,153, 99,156,
+178, 26,119, 96,230, 8,129,180,207,167,120,125, 68,178,127,247, 80,127,255,234, 85,135, 14,195, 87, 97,252,157,123, 1, 93,219,
+123, 7,128,165, 1,150,134,211, 43, 59,129,197,178, 70,203,209,179,149, 56,246,227,169, 83,123, 12,123, 97,140,189, 88,234, 12,
+ 86,147, 7,186,240, 14, 74, 50, 18,160,149,182, 67, 97, 78, 22,246,158,186,162,206,200, 47,209,240,120, 56, 93,164, 54,206,204,
+ 42, 67,101, 99,188, 6, 26, 75,231,207,157, 30,181,119,247, 30, 71, 73, 96, 47, 42,243,251,225,106,177,128,145,120,182,122,134,
+167,179,243, 32, 95,109,221,227,164, 53, 97, 89, 99, 60, 58,173,230,224,153,211, 39, 95,105,219,186,151,227,131,171,199,161, 55,
+ 24, 97,164,129,176,110,253,192,178, 68, 76,241, 40,206,137,207,167,148, 37,101,160,104,182,232,252,173, 7,138, 11,183,178,248,
+ 70, 71, 44,107, 48,186,200,227,234,158,226,127, 52,162, 95,103,128,214,227,249, 62, 29,240,237,142,223, 62, 4,216,183,158,236,
+ 34, 63,180,104, 17,160, 87,168, 39, 54, 16,130, 94,215, 14,175, 14,142,120,225, 99, 88, 99,209, 10,243,192,176,144,214,190, 63,
+127,187,228, 83, 55,247,230,237,248, 20, 71,131,120,119, 4, 52,249,132,202, 79,132,179, 95,119,176,190, 61,177,105,237, 55,149,
+ 28, 71,118,163,129,208, 22, 44, 7,112,185,231,192,166, 30, 66, 86, 86, 22, 60, 90, 92, 3, 40, 30, 72,203, 7, 48, 51, 15, 79,
+ 51,154,201,241, 53, 91,143,245,159, 57, 96,105,216,136, 96, 65, 64,226,173, 76,229,152,183,125,165,207, 6,240,131,146, 21, 50,
+ 94,177, 86,203,217,198, 47, 27,254, 77, 48, 24, 12, 7,151, 47, 95,238, 22, 29, 29, 93,109,145, 65, 98, 98, 34,182,108,217, 2,
+153,236,209,113,114,248,240,225, 32,132,184, 45, 88,176,224, 32,128,231,234,227,236,209,163,199,136,155, 55,111,202, 59,119,238,
+156, 85, 37,182, 68, 0,120,119,239,222,229,229,229,229, 81,174,174,174,196,215,215,151,150,203,229, 28, 0,246,237,183,223,230,
+239,219,183,175,173, 86,171, 61,215, 84,161, 37, 22,139,159,138,207,150, 80, 40, 4, 69, 81, 16,139,197, 16,137, 68, 32,132, 88,
+ 37,182, 88,150, 21,156, 56,113, 2,215,174, 93,195,194,206,157,241,137,159, 31,220,220,220, 16, 31, 31, 15, 66, 8,100, 50, 25,
+ 74, 75, 75,177,123,247,110, 12, 24, 48, 0, 12,195,136, 44,225,221,191,127, 63,174, 95,191,142,197, 17, 17,248,196,217, 25, 14,
+ 14, 14, 56,115,230,225,108,160, 68, 34, 65, 78, 78, 14,206,156, 57,131,126,253,250,217, 58,245, 19,194,226,206,211, 23, 16,148,
+ 82,240, 54,155,244, 32, 12, 1, 40,248,134,132, 64,148,146,242,168,115,142, 37,224,241, 48,119,237,182,152,168, 85, 31,143,160,
+ 38,140,236,226,187,232,231,184,201, 0,240,206, 75, 65,126, 82,137, 0,107,142, 36, 19, 30, 15,115,159, 70, 5, 67, 66, 32,162,
+ 74, 48, 57,178,123,123,200,203, 77,200,148,151,159, 77, 1, 44,202,226,252,219,170,215,177,253,104,124,222,234,237,134, 84, 66,
+ 8, 92, 28, 36,237,199,223,206, 12,248,249,196,245,220,149,123, 13,169,132, 35,112,145, 10,131,223, 74,233,217,232,170,195, 8,
+127,225,132,105,211,167,247, 28,249,214, 12, 59, 38,117, 31, 76,153,167,192,153,245,208,152, 69, 40,231,123, 35, 63, 55, 23, 95,
+109,138,201,211,104, 77,175, 36,169,172, 19,152, 25, 37,168, 20, 80,154, 23,191,250,226,179,216,165, 75, 22, 56,232,179,226, 43,
+249, 20,163,231,183,236, 43, 88,178,112, 21, 85, 97, 52,141,201, 42, 67, 69, 99, 60, 70, 71, 44, 91,190,114,109,212,123,227, 70,
+165, 6,181,235,235,206,202,239,187, 27, 52, 26,229,206,147,215,189,171,158, 20, 41, 0,200,204, 47,129, 74,173,101, 88,134, 62,
+231, 40,196,162,100, 75,172,131, 85,104,237, 5,207,232, 94, 97,175,121, 58,138,160,175, 44,135,151,163, 16, 67,186,183,121,141,
+254, 61,253,211,251, 74,107,228,218,227, 66,139, 6,161,245,184,188,108, 64, 48, 97,233, 96,176, 52,204,183,127,177,222, 50, 70,
+225,147, 41,125, 28,156, 92, 77, 15,120,208,202, 0,123, 15, 80, 78, 45, 0,231, 86,148, 48,100, 12,228, 89, 73,204,135,175,141,
+ 43,185,159,157,255,163,135,125,195,211,218, 52, 71,192,101,199,163,178, 40, 19,119,229,102,132, 41, 31,206,182, 59, 21,221, 0,
+107,139,152, 99,195,127, 20, 57, 57, 57,111,204,153, 51,231, 66,247,238,221,155,121,120,120,160, 67,135, 14, 56,122,244, 40,102,
+204,152, 81,115, 76,231,206,157, 65, 8, 65,105,105, 41,150, 47, 95, 94, 40,151,203,223,104,240, 1, 61, 41, 41,117,251,246,237,
+125, 66, 67, 67,205, 34,145,168, 28,128,164,188,188,220,174,180,180,148, 50, 24, 12,224, 56,142,115,118,118,102,229,114, 57,253,
+202, 43,175, 24, 47, 93,186,212, 70,171,213,230, 60,137, 69,203,223,223,255,110, 73, 73,137,154,162,168, 39, 14,253, 80, 45,178,
+ 60, 60, 60, 60, 43, 43, 43, 57, 0,101, 77, 9,253,192, 48, 12, 34, 34, 34,112, 42,225, 6, 78,252,118, 9, 26,121, 26, 38,191,
+247, 6, 58,116,232,128, 83,167, 78, 53,249,154,117,234,212, 9, 39,207, 92,192,133,107,183,144,147,126, 27, 31, 78,126, 15, 97,
+ 97, 97, 56,121,210,230,189, 96, 5,142,227, 81,223,172,227,143, 11,173,126, 49, 49, 49,213, 67,255,159,228,107,176, 7, 58, 9,
+ 93,196,191, 44, 24,214, 38, 68, 24,185, 0,148,208, 30,251,218,157,236, 57,247,171,239, 83,249, 94, 57,227,238, 42, 27, 95, 29,
+246,200,159, 70,137, 36,114, 37,117,215,173,148,224,215,158,239,238,143,205, 71,165,159, 3,192,152,222,173,241,123,134, 10, 87,
+210,149,187,146, 85, 72,122,210, 90,135,123, 65,202, 22, 99,215,242,143, 70,246,107,209,220, 27, 91, 14, 93, 0, 69,225,160, 69,
+ 55, 92, 66, 72,247,208, 22, 88,189,253,241, 21,134,222, 1, 43,247, 26, 82, 79, 39, 85, 12, 3,128,200, 96,233,175, 93,219,184,
+ 6,144,218,142, 91,117,192, 94, 44,152, 56,108,212,235,118, 76,250, 81, 32,251, 12, 40,198, 8,189,153,131,162,184, 2, 58,103,
+127,196, 39,222,210,171, 13,166,143,147, 85, 77,179,226,165, 20, 35, 75,116,245, 86,110,165, 86,239, 35,245,108, 99,224,243, 56,
+174,210, 72,240,123,114,182, 38,185, 16,105,150,112,100,101,193,244,172, 31,211,123,195,182,189,243,133, 34,241, 24, 62, 5,202,
+203, 69,230,185, 97,213, 98, 56, 58, 58,128, 51, 85, 2, 90, 21, 94,252,224, 43,213, 93, 57,221, 26, 0,218,185,195,161,119,107,
+225, 54, 1,143,202,143,203, 52,207,107,236, 55, 40, 26,147,198, 13,233, 44,228, 76, 90,124,180,124, 15, 54,126, 58, 18,175, 15,
+ 12, 17, 30,191,152, 62, 9,192,162,166, 94,107,194, 50, 32,180, 30,207,125,150,144, 74, 1, 23, 8,208,235,218,222, 37,193,192,
+ 13,139, 57,186, 0, 66, 86, 64,133,116, 12,144,137,184,252,139,224,242, 47, 18,190,127, 79, 80, 1,125, 40,202, 59,130,124,183,
+ 98,161,118,243,230, 45,167, 57, 30,190,176, 32, 84, 6, 88, 14, 40, 78,191, 0,147,201, 4,154, 5, 12, 6, 3,180, 90, 45,100,
+153, 39,107,124,180, 68, 66,106,232,212, 55, 71,116, 34,149,114,221,177, 84, 38,119,203,123,193,207,145, 74,185,238,114, 46,155,
+ 94,172, 53,218,172, 89, 54,252, 27,145, 37,151,203,135, 14, 31, 62,252,183, 83,167, 78,185,133,135,135, 3, 0,174, 93,187,246,
+240,161, 51, 34, 2, 65, 65, 65, 40, 42, 42,194,216,177, 99,139, 21, 10,197, 80, 52,226,243, 91, 81, 81,113,127,255,254,253,205,
+180, 90,109,231,121,243,230, 41, 91,180,104,161, 49, 24, 12, 84,121,121, 57,199, 48, 12, 92, 93, 93,197,157, 59,119, 70,143, 30,
+ 61, 42, 19, 19, 19, 91,230,229,229, 85, 0,200,110, 74,225, 71,142, 28,137,132,132,135,139,246,158, 70, 92, 45,145, 72,132,240,
+240,112,191,172,172,172,130,170,123,139,213, 99,124,237,219,203,173, 91,183,112,238, 70, 62, 4, 38, 61,196, 42, 57, 46, 31,218,
+143, 17, 19,223, 7,195, 52, 61,183,252,173, 91,183,112,248,204,101,200, 36, 2,164,165, 37, 97,255,254,253,152, 60,121,242, 19,
+113, 54, 17, 13,106,145,127, 56, 20,168,199, 79, 75, 0, 0,209,209,209,231,170,173, 21,181, 17, 24, 8,177,164, 18, 11, 34,187,
+248,205, 26,211,171, 13,159,214,200,193,177, 28,248, 66,192,203,195, 9,191,252,178,171,245,174, 61,123, 18,215,175, 91,191,150,
+ 99,152,185,119,149,208, 89, 81,168, 5,171,246, 92, 24,243,203,244,126,130,201,195,130,221, 0, 64, 36,224, 97,205,209, 36, 6,
+192,130, 39,169,237,179,126,197,208, 97,164, 0, 0, 32, 0, 73, 68, 65, 84,176,171,164, 49,193,203,221,249,243, 57,239, 70,185,
+245,139, 8,194,185, 43,119,177,118,127, 98,130, 88,137,237, 22,119,110,142,198,227,250,169,174, 85,135,224, 26,247,187,100, 89,
+226, 45,146,185,194,156, 29, 7,152, 13, 48, 24,205,200, 43, 97,145, 87,106,128, 64, 42,194,181,244,124,189,123, 33, 98,158,160,
+218,148, 76,106,231, 59,255,203,149,205, 13,250, 74, 70, 83, 86,204,136,196,151,133, 82,123,137,194, 26, 87,133,203, 5, 48,244,
+105, 37,124, 6,224,248, 98, 59,162,251,108,218,155,178,130,228, 83,104,203,147,131, 34, 4,246, 33, 81,112,180,231,139,122,181,
+ 20,230, 2,128, 76, 38, 21, 47,255, 98,134,243,199,159,126,209,168, 15, 88, 8, 32, 10, 10,244,254, 56,188,133, 43, 18,174,167,
+ 34,225, 78, 78, 82,194,181,180,176,254, 29,124, 17,212,220,101,170,184,172,124, 89, 10,172,183,144, 62,188, 48, 12, 64, 27,106,
+ 86, 29,134,120,225,213,174, 99,230,213,183,218,176, 78,180, 2,184,116,150,128,226,243, 1,138,247,112, 5,100,222, 69, 8, 92,
+ 2,201,174,189,135,117, 91,182,108, 95,156, 82,108,249,226, 12,154, 5,171,209,104, 32,147,201,112, 50,157, 49,190, 62, 68, 36,
+225,241,120,200, 75,191,241,135, 51,188, 27, 47, 84,212,127, 73,240,197,133, 93, 79, 57,138, 41,137,111,212, 23, 33,204,157,237,
+249, 77,189, 73,216, 96,195, 63, 1,106,181,250,118, 74, 74,202,144,142, 29, 59,110,253,232,163,143, 28,199,141, 27,231,251,222,
+123,239,241, 0,160,168,168,136, 91,189,122,181,252,187,239,190, 83, 23, 23, 23,191, 69,211,180, 37,161, 76,136, 66,161,184,244,
+227,143, 63,170,206,159, 63, 31,214,173, 91, 55,201, 51,207, 60,195,185,186,186, 10, 36, 18, 9,107, 50,153, 12,233,233,233,108,
+ 86, 86,150, 79,121,121,249, 61, 0,153,104, 66,198,138, 42,235,213, 34, 62,159, 63,159, 16, 18,254, 52,124,180,164, 82,169, 47,
+128,123, 20, 69,181,181,118,218,240, 79, 55,108,129, 0,101,101,101,208, 21, 38,193, 46, 63, 3, 29,101, 60,132,186, 58,192,201,
+201,233,137, 68,145, 90,173, 6,180, 5,184,112,225, 22,192, 48,112,118,118,134,179,179,243,223, 46,180,234,211, 34,255, 18, 76,
+168, 99, 95,195, 62, 90,161,158,152,108,111,194,234,137, 81,109, 68,173, 2,154,195,152,127, 13,183,242, 42, 49,247,217,110,201,
+124,137,163, 97,226, 27, 35, 35, 70,189,220, 18,253,122,116,165, 90,249, 56, 79, 93,182,234,135, 15, 66, 81, 60, 35, 89,137, 53,
+150,148, 40, 89,133,251, 28,148, 91,226,110,231, 79,106, 46,213,131,227, 8,226,238, 40,112, 39,187,108, 75,170, 10,247,173,169,
+ 93,168, 15, 6, 9,192,219, 67, 8,177,115,150,201, 42, 66,131,154,123, 12,122,174, 19,111,104,223, 8,136,248,192,133,223,111,
+225,147, 85, 7, 47,115, 28,137,186, 97,225,180,225,195, 21,134,143, 10,168,135, 43, 12,233, 71, 86, 24, 18, 66,200,195, 85,135,
+ 13, 27, 31,248,124,170, 80,151,115,213, 91,232,222, 14,250,204, 56,100,151,113,200, 81, 86, 64, 35,240,134,177,160, 0, 32, 92,
+238,185,134, 29,171, 27,132,135,135,135, 87,235,208,160, 54,223,111,219, 15,179, 78,141,251,241, 91, 81, 89,166,192,146, 13, 71,
+219,248,249,185,247, 45, 40, 40, 56,103,197, 96, 19,244, 91,204, 46, 47, 16,128, 47,148,224,248,250,189, 40,118,183,135,135, 84,
+ 4, 78,175,194,196,143,199, 57, 15,139, 28,231, 12, 0, 57,105, 55,209, 66,170,183,136,215,236,142, 81, 99,250,183,119, 1,173,
+199,182,147, 55, 13, 60, 96,232,246,211, 73,153,253,131, 93,236,198,244,106,225,186, 72, 94,254, 18, 74,154, 22, 84,180,218,162,
+ 85, 99,225,107,194,106,195,253, 0, 27,204, 33,115,207, 37,165,236,229,200,103,164, 34, 1, 69,145,202, 2, 16,123, 15,252,176,
+109, 95,165,152,182, 46, 19, 59, 7, 44,234,190,244,254,252,135,253, 4, 91,135, 45,189,246,110,236,231,207,122, 22, 22, 22,194,
+ 92, 53,119,120,191,148, 59,251, 70,100, 40,155,175,230, 76,167,151,189,248, 50,101,239, 41,158,249,245,246,120, 2,216,162, 73,
+219,240,175,134, 94,175,191,174,215,235, 59,204,156, 57,243,213,207, 62,251,172,143, 76, 38,107, 13, 0, 90,173,246, 62, 77,211,
+ 9, 85,255, 79,107, 86, 7, 18, 0,247, 50, 51, 51,239,103,102,102, 54,219,177, 99,135, 11, 0,187,170,239, 12, 0,202, 1, 20,
+225, 9, 86, 28, 86,139, 42,138,162,230, 63,173,118,168, 22, 85, 20, 69,181,109,202,249, 60, 30,143,165, 40, 10, 20, 69, 65, 34,
+145,224,252,249,243, 24, 29, 21,137,148,227,229, 8,119,113, 64,183,183, 38, 98, 79,108, 44,248,124, 62, 40,138, 2,159,207,183,
+234, 62, 34, 16, 8,112,225,194, 5,188, 62,246,101, 72, 4,128,179,179, 51,102,206,156,137, 35, 71,142, 64, 32,176,101,233,179,
+ 2,155,106, 9, 46, 11,227,104, 81, 88, 20,187,245, 43, 17, 88, 26,199,182,126,131,152,255, 99,239,188,195,162,184,218, 40,126,
+166,108, 99, 89, 58, 75, 47, 34, 17, 16,197,222,149,168,177, 37, 17, 99,139, 45, 49,182,168,196,104,212,152,216,141,198, 24,187,
+ 17, 99, 47,201,103,239,198,130, 73, 84, 18,123, 65,197, 2, 34, 32, 40, 74,239,157, 93,182, 76,249,254,160, 4,148,178,139,166,
+153,249, 61,207, 60,179,101,246,236,204,220,221,185,103,222,123,239,123, 35,138,180,209,153,152,231,147,137,160, 35, 40,228, 50,
+191,219, 29,120,238, 74,196,170,177,195, 2,228,111,117,239,133,183,186,117,167,155,182,237,186, 0,168, 98,180,122,162,150, 92,
+ 27, 44,135,111,182,253, 26, 53,241,224,133, 24, 2,186, 66, 12,235,221,150,103, 57,124, 83,199,193,188,160,105, 97,162, 56,120,
+229,250,117, 43,232,138,240,244,238,239,178, 6, 13,223, 0, 88, 29, 98, 99, 31, 97,253,174,159,184, 11, 55,163,247,104, 25,124,
+246, 56, 23,197,134,106,150,214,148, 12, 44, 76, 37, 62,111, 55, 53,255,133, 3, 15, 75,185,184, 49,207,177,176,148,139, 26,247,
+106, 44,255,133,231,121,222,204, 68,212,152,103,245,117,106,170,181,204,214, 93, 63,238, 88, 51,110,220, 56,211,172,164, 52,164,
+ 20, 68,160, 72,226, 12,189,220, 21,113,119, 47,169, 85, 26,198,144, 74,188,198,243,153,149,149,149, 17, 22,154,131,131, 91,150,
+ 65,175,213, 32, 35,169,212,171,166,100, 21,192,220,214,249,122,114,114,178,193,154, 58,134,203, 31,244,225, 4,177,137, 25, 76,
+ 70, 14, 10,144,196,101,107,208,202,201,172,244,162, 81,148,137,135, 33, 87,208,173,172,143,233,227, 68, 18,238, 45,156, 12,218,
+ 79, 51,153,248,179,119, 90, 59,227, 73, 66, 42, 46, 63, 72,222,245, 36, 7, 41,108, 84,234,174,184,148,188,192,254, 29,220,176,
+246, 68,228, 20, 64,191,223,152, 99,247,181,195, 8,158, 71,151,210,206,240,106,240, 64, 23, 95, 59,140, 48,112,164,225, 11,154,
+180, 24, 31,172,249,229,217,252,195,183,178,250,207,252,192,223,188, 83,167,119, 37, 96,180, 40, 84,107,244, 15,243, 80, 96,140,
+102,129,154,219, 10, 96,107,249, 27, 97, 73,220, 30,255,133,215, 47,237, 31,239,170, 44,247,234,151,226, 52,215, 1, 92, 31,219,
+222,100,129,184,251, 18,159,235,139,219,159, 9, 79,229,246, 94,138,171,200,161, 85,231,255,168,158, 8,154,130,230, 95,161,201,
+ 2,216,163,215,235,247,228,229,229,189, 74,205, 20,188,152,215,233,165,142,189,114, 51, 33,207,243,116, 89, 52,171,174,206,240,
+181,106, 86,110, 38,228,121,254,231,178,104, 86, 93, 81,173, 42,154, 28,199,165,180,105,211,198,186, 95,191,126, 96, 89, 22,143,
+ 30, 61,194,179,196, 68,244, 12,156, 2, 75, 75, 75, 92,186,127, 31,209,209,209,248,234,171,175,160,215,235,113,252,248,241,164,
+186, 52,105,154,214,189,241,198, 27,226, 1, 3, 6,128, 97, 24, 60,126,252, 24,201,201,201,152, 62,125, 58, 44, 44, 44, 16, 22,
+ 22, 86,161,153,149,149, 5,154,166,117,213, 68,183,254,140,223,210,191,157, 23, 76, 86,237, 70, 11, 96,193,234,145,127,110, 33,
+214, 93,134, 78,167, 71,227,200, 76,196, 71,254, 17,145,218, 76,133,222, 63,117, 63, 34,234, 73,216,213,183, 36,200, 8,135,177,
+119, 18,143,178,145,106, 38, 43, 44,132,174,208, 28,143,127, 65,124,122, 97,209,163,108,164, 26,125,199,192,177, 4,116, 42, 32,
+245, 54,174, 93,186,136, 11, 55,238,225, 86,120, 20,123, 45, 44,230, 32,201,225,155,135,217,120, 84,143,187, 16, 40,250,174,197,
+232,240, 88,183,182,222,246,110, 96, 25,240,156, 30, 22,195,246, 99, 76,100, 39,183,182,158,150,110,165,145, 44, 61,172, 62,254,
+ 29, 88, 35,171, 85,239,118,162,126,155,228,196,153,193,133,121,217, 29,122,116,237,104,106,225,251, 14,178, 98, 99,240,232,222,
+ 21,117, 88, 68,220,181,219,137,250,109, 47, 83,186,206,206,206,111,246,232,234,131, 97, 19,231, 64,167,202,199,227, 11, 63,162,
+ 40, 39, 13,151,175, 43, 16, 85, 80,208, 17,128,193, 17,173,235, 9, 76, 83, 36,228,162,115, 3, 81,130, 25, 52, 14, 31, 5,244,
+131,148, 40, 1,167, 41, 0,161,202, 66, 92,178, 54,127,240,150, 68, 22, 0,228, 82,130, 54,229,243,205, 13,138, 60,186,219,120,
+201, 41, 61,118,159,123, 0,142, 43,157,190,137,227,176,121,247,239,113,129,223,140,108,133, 38,110, 86, 45,238, 38,103, 16, 48,
+ 34,228, 79,240,240,191,117,240,235,198, 37,191, 45, 0, 56, 29,174, 76,181,110,236,191, 46,199, 31,245,156,110, 39, 34, 5,201,
+ 0, 2, 65,171,182, 78, 93,247,235,130, 54,231, 34,187,204,248,184,191, 57,248, 87, 50, 66, 55, 38, 50,141,125,179,253,242,103,
+103, 56,190,106,123,110,105,100,203,151, 79, 41,224,239, 94,138,211, 8, 89,225, 5, 4, 4, 0, 0, 69, 69, 69, 19,199,140, 25,
+179, 85, 36, 18, 41, 1, 16, 28,199,129,227, 56,122,213,170, 85, 34,150,101, 73,146, 36, 89,138,162,152,159,127,254, 89,207,178,
+108,102, 73, 73,201,196,186, 52, 25,134,137,155, 52,105,210, 27,117,141, 80, 60,112,224, 64,185,201,138, 19, 74,194, 32,147, 85,
+121, 93, 17,229,162,107, 9,210,126,221,121,228,194,133, 0, 8,240, 88, 20,153,137,248,231, 55, 9,207, 65, 74, 19, 74, 55,189,
+105,219,174, 11,203, 63, 99,236,158,149,176,236,251,109,155,121, 31, 0, 0, 13,207,142,172,207,209, 21,104,212, 67, 91,182,237,
+120,144,227,121,154,225,249, 29, 36,135,163, 37, 12, 30, 26, 50,210,174, 38, 82, 50,242,194,222,241,179,224,129,210, 38,195,138,
+230,194,178, 52, 14, 60,207,243, 21,205,133,171,101,200,202,215,212,153, 7,234,106,188,182,151,150,185, 53,225,236,213,187, 19,
+ 89,150,119,160, 40, 34, 77,173,101,182,190,172,201, 2,128,228,228,228,139, 33,231,146,207,222,111, 97,223,219, 86, 94, 22,229,
+ 82, 1, 89, 42,156, 77,206, 44,186, 88, 31,205,220, 98,125,255,185, 65, 39, 78, 74, 68, 20, 13,158, 47, 77, 40,202,243, 40,209,
+177, 57,215, 19,152,166, 0,208,204, 26, 78, 95, 30,103, 14, 80, 20,241,172, 46,189,208,232,212,181,195,150,135,124,241,224,105,
+238,142,167,121,136, 0,128,167,121,136, 56,116, 37,126, 65, 92, 90,225, 23, 17,207,114, 87,195,200,126, 21, 60,129,203,109,135,
+ 45,124,225,181,151, 61,159, 81,169,184, 7, 96, 32,144,212,107,216,140,245, 51, 8, 2,175,106,250,137, 24,181,142,119,127,254,
+197,242,200,150,112,173, 18, 16,248,103, 80, 30,213, 34, 73,114,241, 43,212,252,153, 32,136,119, 1,196, 26,241,177,208,162,162,
+162,102,175,248,240,178, 25,134,201, 54,100,195,191,161, 67,252,191,149,109,127,215, 23,247, 20, 52,255,122,205, 70,141, 26,241,
+ 70, 24, 22,225,124, 10,154,130,166,160,249,159,210,228,121,158,122,153,165, 6, 77,226,101, 22,161,140,254,245, 76,168,233,185,
+208,211,237, 53, 36, 54, 54,150, 16,206,130,128,128,128, 64,245, 16, 4,193,254, 9,154, 66,118, 60,129,114,131, 85, 37,186, 69,
+ 10,231, 68, 64, 64, 64, 64, 64, 64, 64,224,149,152,172,202,235, 82, 19,142,154,195,127,198,140, 38,168, 79, 8, 49, 68,208, 20,
+ 52, 5, 77, 65, 83,208, 20, 52, 5,205,255,156,102, 93,218,194,104,198, 63,217,128, 9,154,130,166,160, 41,104, 10,154,130,166,
+160,249,223,211,252, 55, 83, 99, 31, 45,161,233, 80, 64, 64, 64, 64, 64, 64, 64,224, 79, 66,232, 12, 47, 32, 32, 32, 32, 32, 32,
+ 32,240,114,212, 57,169,180,128,128,128,128,128,128,128,128, 64,253,168,125, 82,105, 1, 1, 1, 1, 1, 1, 1, 1,129,122, 99,
+252,164,210, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6,177, 77, 56, 5, 2, 2, 2, 2, 2, 2, 2, 2,127, 13, 85, 71, 29, 6, 7,
+ 7,243,149,215, 2, 2, 2, 2, 2, 2, 2, 2,127, 37,175,171, 23, 17,154, 14, 5, 4, 4, 4, 4, 4, 4, 4, 94,142, 9,130,
+209, 18, 16, 16, 16, 16, 16, 16, 16,248,115,168,177,143, 86,121,194,210,110,101,161,186,110,194,185, 18, 16, 16, 16, 16, 16, 16,
+248, 27,120,189,189,136,208, 63, 75, 64, 64, 64, 64, 64, 64, 64,240, 34, 2, 2, 2, 2, 2, 2, 2, 2, 2,255, 36,132,185, 14,
+ 5, 4, 4, 4, 4, 4, 4, 4,254, 98,195,245,167, 27, 45, 97,102,115, 65, 83,208, 20, 52, 5, 77, 65, 83,208, 20, 52,255, 75,
+ 38,171,138,217, 18, 70, 29, 10, 8, 8, 8, 8, 8, 8, 8,188, 28,117,142, 58, 20, 16, 16, 16, 16, 16, 16, 16, 16,168, 31, 19,
+ 0, 4,148, 61, 14, 64,165,168,150, 16,209, 18, 16, 16, 16, 16, 16, 16, 16,120, 57,182, 1,112, 44, 51, 88,167, 1,164, 10, 70,
+ 75, 64, 64, 64, 64, 64, 64, 64,224,213, 80,185, 95, 86,223, 74,230, 75, 48, 90, 2, 2, 2, 2, 2, 2, 2, 2, 47, 73,141,125,
+180, 8,212, 60,114, 32,196,136, 47,168,207,232,131, 16, 65, 83,208, 20, 52, 5, 77, 65, 83,208, 20, 52,255,115,154,117,105,135,
+224,223,199, 4, 99,204,215,171, 68, 24,250, 42,104, 10,154,130,166,160, 41,104, 10,154,130,230,127,150, 87, 62,234,176, 21, 96,
+ 34,156,214,215, 18,251,178, 69, 64, 64, 64, 64, 64, 64,160,118,254,156, 81,135,190,192,199, 31,250, 41,183,232, 35, 50,205, 35,
+ 0, 85,109,219, 42,149,202,173,114,185,252, 67,149, 74, 85, 76, 16, 4, 87,254, 58,207,243, 0, 80,121,174,163,199,153,153,153,
+254,117,125,183, 68, 34, 9,178,183,183,255,184,168,168, 72, 69, 16, 4, 79, 16, 4, 8,130, 0,128, 23,214, 44,203, 38,101,103,
+103,183,249, 87, 23, 33,207, 83,182,246,246, 55, 69, 20,229,108,236, 71, 89,142,139,207, 72, 79,239,104,196, 71,150, 17, 4,102,
+150,126, 45, 86, 2,152,243,186,253, 35,120,128, 50,100, 59, 63,192, 44, 6, 24,198,146,228, 20, 17,176, 81,195,113, 91, 0,128,
+ 0,216,250,126,183, 38, 20,111, 16, 60, 90, 16, 4, 44,120, 30,249, 60,129,123,210,246,136,251,155, 78,197, 32,145, 72,212,223,
+220,220, 92,145,157,157,125, 17,192, 1, 0,195,109,108,108,186, 22, 20, 20, 20,233,245,250, 19, 0,142,213, 71,216,191, 5,102,
+ 73,196,162,177, 37, 58,253,138,171,247,240, 99,215, 86,176, 97, 56, 44,151,137,105,127,141,150, 89,121,229, 62,118, 24, 41, 73,
+148, 45,229,215, 12,163,231, 72, 59,108, 96,185, 3,192,113, 43, 43,111,169,210,252, 55,145,132,138,207, 75, 47,250,240,253,140,
+140,196, 33, 47, 81,238,255, 68,108,109,109, 71,147, 36,249, 45,207,243, 96, 89,118, 94, 78, 78,206,206, 87, 36, 61, 15,128,101,
+217,227, 60, 0,223,190,164,222, 51, 0,110,101,143, 19, 0,184, 11,245,122,189,217,252,211, 79, 63, 5,118,239,222, 29,107,215,
+174,197,230,205,155,159,102,102,102, 46, 7,176, 11,128,246,111,208, 17,168,137, 38,192,187,171,250,180,103,245,255,251,134,171,
+244,114,207, 26,254,204, 63,124,244,209, 71, 58,158,231,249,232,232,104, 94,171,213,242,122,189,158,103, 24,134,103, 24,134,215,
+235,245, 21,139,179,179,115,242,115, 31,127, 65,147, 36,201,117,131, 7, 15, 46,228,121,158,191,125,251, 54,175, 86,171,121,141,
+ 70,195,107,181, 90,190,164,164,132, 87,171,213, 85, 22,123,123,251,244,218, 52,205,205,205,111, 91, 89, 89,165, 91, 89, 89,165,
+ 91, 91, 91,167, 91, 91, 91,167,219,216,216, 84, 44,182,182,182, 21,139, 82,169, 76, 87, 42,149,233,214,214,214,183,235,218,207,
+ 50,250, 0,184,104,192,210,167,154,207,246,172,108,180, 28, 29, 29,211,249,122,224,226,226,146,104,192,126,150, 99, 79, 16, 96,
+203, 63, 75, 16,224,164, 82,169, 91,229,247,241, 98,164,171,206,144,178,147,147,211, 96, 71, 71,199, 16, 71, 71,199,115, 78, 78,
+ 78,131, 13,248,137, 85,209, 52, 51, 51,187,109,107,107,155,238,224,224,144, 81,190, 56, 58, 58, 86, 89,156,156,156, 42, 22,123,
+123,251,116, 43, 43,171, 26,203,136, 7,168,154,150, 11, 0, 45, 5,222,162, 41, 42,216,222,222,190, 32, 60, 60,156,229,121,158,
+ 39, 73, 50,185,124, 27, 99,142,253,121,147,165,186,130,121, 89,231,165,161, 69,241,203,243,179,206, 75, 67, 85, 87, 48, 79, 19,
+138, 55,234,171,105, 32,213,105,142, 26, 53,106,212,189,244,244,244,228,188,188,188,212, 45, 91,182,196,200,100,178, 43, 91,182,
+108,137,201,203,203, 75, 77, 79, 79, 79, 30, 53,106,212, 61, 0,147,140,208, 4, 0,116,108,129, 14,227, 6, 57,170,238, 29, 31,
+169,122,171, 45,125,183,179, 31, 2,122,117, 20, 39,111,152,237,171,186,180,189,139,170,123,107, 50,194, 72, 77,130,166,233, 78,
+110,110,110, 99,149, 74,229, 71,101,203,200,242,197,193,193, 97,164,131,131,195, 72, 43, 43,171, 33,181,105, 30, 6, 40, 67, 22,
+ 87,153,172,211,144,134,110,170,103,139, 23,241,225,211,166,240, 99, 61, 93, 11,222,183,179,107,240, 55,148,209,159,170,105,103,
+103,151,162,215,235,121,157, 78,199,219,216,216,164,188,194,253, 92,205,243,252,106,158,231, 87, 3, 88,253, 10, 52, 43,174,103,
+ 70, 24,236,218, 52,101, 52, 73,206,144, 75, 36,231,164, 52,157, 33,165,233, 12,185, 68,114,142, 38,201, 47, 0,200,254, 73,101,
+244, 39,104, 42,148, 74,229,147,160,160, 32, 94,165, 82,241, 42,149,138, 15, 10, 10,226,149, 74,229, 19, 0, 10, 35, 52,235,171,
+243, 58, 69,176,158, 95, 94, 93, 68,203, 23,104,243, 86,139, 70, 71,167,142, 30, 6,238, 72, 16, 81,199, 29,211, 15, 29,219,180,
+ 25,187,107,215, 46, 0,192,135,253,251,163,119,187,118, 48, 83,152, 66, 34, 41,221, 29,130, 39, 32, 22,137, 49, 96,250,231,134,
+124,253,202, 1, 3, 6,124,112,228,200, 17, 5, 0,108,222,188, 25,131, 6, 13,130,181,181, 53,228,114, 57,196, 98, 49, 68, 34,
+ 81,149,117, 93, 80, 20,229,146,156,156,108, 39,147,201, 42,162,108, 28,199, 85, 89,120,158, 47,143,190,129, 97, 24,120,121,121,
+ 25,122,186,102,231,231,231,191, 89, 92, 92, 92,161, 81,221,210,176, 97, 67, 0, 56, 99,136,224,183, 75,190, 1,199, 20,131,166,
+ 1,134, 1, 52, 58, 18, 28, 95,173,185,193,164, 73,147, 42,246,187, 62,244,237, 27, 64, 16, 4,113, 36, 44, 44,236,104, 70, 70,
+134, 7,199,177,227,235, 25,233,250,244,209,163, 71, 10, 0,240,246,246,158, 4,224,168, 49,251, 65,211,180,203,253,251,247,237,
+164, 82,105,141,145,203, 74, 17, 76,232,116, 58,180,106,213,138, 49,230, 59,236, 1,183, 28,146, 28,223,178,117,235, 9, 11, 7,
+ 12,144,221,188,121, 83, 70,146, 36, 24,134,193,170, 85,171, 24,158,231, 45,155, 0,230,145, 64, 65, 45, 50,115, 1,140, 46,171,
+ 12,118, 0, 88, 85,197, 45,240,104,161,214, 75, 3, 30, 23, 13,104,215,190,193, 44, 68, 62, 8,111,231,169, 56, 14, 51, 90, 19,
+ 7,252,181, 81, 45,115,115,243,254,107,215,174, 85,238,216,177,163, 32, 58, 58, 90,183,101,203, 22,229,196,137, 19,205,116, 58,
+ 29, 2, 3, 3, 51,125,124,124,196,107,215,174, 85, 30, 59,118,236,173,226,226,226, 77, 70,149, 23,129,111,134,247,239,141, 18,
+ 61, 9,189,158, 81, 58, 42,205,246, 76, 29,213, 77,196,243, 90,236, 62, 17, 6, 61,195,253,104,100, 36,171,227,251,239,191,239,
+185,127,255,126, 58, 42, 42,138,110,220,184, 49, 56,142, 3,203,178,208,235,245, 0, 0,142,227,208,168, 81,163,151, 62, 47, 99,
+ 1,111, 91,123,235,115, 29,223,125,199,196, 81, 38,133,117,110, 38,198,137,105,179,157,114,205, 94, 0,157, 94,171,200, 46,207,
+131,166,105, 36, 38, 38,194,206,206,206,132,227,184, 84, 0,139,114,115,115,183,225,245,165,157,132,166,143,238,254,113,157, 67,
+251, 78,157, 40,123, 71, 59,196, 60, 74, 0, 77,176, 61,239,223, 10,235, 54,246,147, 25, 83,181, 12, 51, 24,192,205,215,237,192,
+ 29, 58, 77, 26, 72,144,212,102,130,231,240,245,134,147,133,203, 86, 6,201, 3,199,143,162,166, 79,159, 14, 87, 87, 87,143,129,
+ 3, 7,174, 4,240, 73,157, 58,237, 39, 13, 4, 69,110, 6,207, 99,225,250,147,133, 75, 87, 6,201, 63,169,135,206,191,156, 26,
+255, 35, 47,109,180,124, 1,207,166,174,118,103,151,205,252, 68,196,255,242, 63, 82,149,157, 81,227,182, 74,165,114,235,219,111,
+191,253,225,206,157,127, 68,163, 59,250,249, 97,224, 91, 93, 96,103, 99, 1,185,169,164,180, 58,226, 8,220,139,142, 55,200, 16,
+184,186,186, 6, 30, 61,122, 84, 81,217, 76,136,197,226,138,165,178,201, 42, 95,202, 43,224,218,144,201,100, 8, 9, 9, 1, 77,
+211,160, 40, 10, 52, 77, 87, 44,149,159, 83, 20, 5,123,123,163,186, 46, 45,183,176,176,104, 94, 88, 88,104,158,151,151, 7, 55,
+ 55,183, 2, 0,247, 43,189,223, 60, 51, 51,211,220, 24, 65,142, 41,198,244,113,190, 16,105,111, 64, 43,106, 7, 53,221, 25,215,
+110, 61, 68,240,153,139, 72, 78, 73, 67,151, 14, 45,241,209,136,247,113,238,220, 57,176,172,209, 45, 29,233, 60,143,149,253,250,
+ 5,204, 2, 8,162,103,207,158,121,147, 39, 79, 38,163,162,162, 62, 24, 56,112,128,223,163, 71,177,101, 81, 69, 98, 38,207, 99,
+ 29,128,116, 3,117, 37, 0,112,233,210, 37, 0,144,214,231,183, 39,149, 74,113,253,250,117,148, 55, 19,147, 36, 9,146, 36, 65,
+ 81, 20, 78,197,218,162, 88, 75, 66,149, 30,129, 41, 1,110,104,216,176, 33, 72,178,238, 46,137,221, 0,217, 53, 96, 32, 33, 18,
+ 77,119,116,114,242,232,234,233, 41, 15, 9, 9,161, 0,192,221,221,157, 79, 77, 77,205, 59,113,226, 68, 33, 13,108,118,231,249,
+ 93,181,153, 44, 87, 87,215,206,201,201,201,223,150,159,115,130, 32, 86, 54,104,208,224,171,138,114,227, 56, 44,250,177, 88, 52,
+117,234, 52,113,251,110,243, 1, 0,237,251,237, 71,193,227,101,190, 68,206, 92,139,191,250, 42, 81, 80, 80,112,176, 81,163, 70,
+ 84,118,118,246, 53, 0,207,244,122,253,236, 61,123,246,216,141, 27, 55, 46, 99,239,222,189,203, 1, 56,173, 88,177,162, 91,113,
+113,241, 33, 99,116,187, 52,199,187,173,155,251,117,112,115,117,197,197,107, 55, 33,150,136, 44, 39,141, 14,128, 66, 65, 99,245,
+142,211,220,179,164,156,201, 87,238, 99,151, 17, 38,171,221,251,239,191,239,177,127,255,126, 9, 0,220,191,127, 31,105,105,105,
+ 80, 42,149, 48, 49, 49,129, 72, 36, 2, 69, 81, 16,137, 68,175,196,100, 89,184,218,132, 30, 63,126,194,196,218,218, 18, 27, 62,
+159,138,143, 50,210, 97,105,166,128,190,168,216,227, 53,171, 40,188,253,253,253,101, 44,203,162,184,184, 24, 23, 46, 92,176, 48,
+ 49, 49,177,112,113,113, 89, 8, 35, 70, 79,201,100,178,244,146,146, 18,187,178,199, 25, 37, 37, 37,246, 0, 10,164, 82,105,249,
+117,186,168,108,109,104,115,226, 51,188,216, 76,152, 64, 16, 68,229,215,234, 75,219,118,109,155,135, 28, 59,178, 79,145, 95,152,
+ 6, 75,171, 12,144,200,199,182,109, 27, 97, 98, 98,142,133, 11,231,210,241, 61,223,114,238,243,238,224,144, 7, 15, 99,122,190,
+118,102,139, 39,182,245,236,247,161,181,137,220,172,172, 46,209, 99,231,246,169, 32, 73, 18, 95,125,245, 21,154, 54,109, 58,225,
+193,131, 7,243, 1,228,212, 46,131,109,205,222, 28,106, 45,145,149, 22, 49,199,234,177,229,192, 23,165, 58,115, 38, 98,120,191,
+134, 19,190,124,255,201,175, 77, 61, 81, 88,118, 99,174, 22,145, 72, 32,218,163,194, 48, 4, 7, 7,119, 13, 8, 8,184, 88,211,
+243,127, 1,142,248, 35,127, 86, 21,243, 69, 7, 7, 7,243, 1, 1, 1, 68,165,131,171,242,188, 54, 90, 0,182, 86, 22,242,144,
+205,139,166, 42,232, 27,167, 41,117, 66, 44, 82, 74,170, 84,228, 85,134,104,202,229,242, 15,119,238,220, 89, 37,164,228,102,111,
+ 7,177, 88, 4,145,152,128,165,127,105,246,250,188,203,193, 32,136, 26, 77, 86, 21,205,226,226,226,146,187,119,239, 42,118,236,
+216, 1, 59, 59, 59,120,120,120, 64, 46,151, 67, 38,147, 85, 49, 87,149, 13, 87, 53, 70,171,138,102,249,251, 52, 77,131, 36, 73,
+156, 59,119, 14, 12,195,224,253,247,223,127,193,100,209, 52, 93,147,113,171,105,120,234, 25, 0,247,121,158,127,179,172, 2,190,
+ 15,160,107,165,247,251, 40,149,202,217, 0,150, 27,170, 73, 81, 60,168,146,107,224, 92,130, 64, 39, 78,133, 86,212, 2,231,175,
+132, 97,231,214,181, 0, 0,143,198,109, 49,100, 96, 64, 69, 52,206,192,253,172,192,217,217,249, 64,102,102,214, 59,111,189,245,
+ 22,114,115,115,245,139, 22, 45, 66,243,230,205,225,237,237,109, 80, 25,213,112,231,156,126,255,254,125, 87,181, 90, 13,158,231,
+ 13, 49,103, 47,104, 18, 4,129, 61,123,246,160,164,164,228,133,141,173,186, 46,197, 23,131,220, 49,102,202, 46,172,140, 62,132,
+ 77,155, 54,213,122,236,114,160,121,137, 69,163,117, 18,138,105,190,124,238,167,210,143, 62,250,136, 26, 51,102, 12, 18, 18, 18,
+ 48,110,220,184,146,115,231,206,105,211, 82, 83, 79, 72, 56,110,131,174,170, 49,174, 81, 83, 42,149,238, 62,115,230, 12, 14, 29,
+ 42,245, 37, 49, 49, 49,240,242,242, 50,173, 98,146,115, 14,163,240,217, 6,132,158,138, 66,251,126,251, 17,122,106, 4,216,188,
+211,162, 54, 94,200, 55,230,124,214,131,234, 52, 15,101,103,103, 87,152,168,189,123,247,154,236,221,187,119, 0,128,147, 0, 14,
+ 1, 64, 78, 78,206,119, 70,106, 2, 4,198, 12, 29, 52, 0,180,216, 12, 81,177, 73,232,218,177, 21,236,237,236,112,255, 97, 28,
+158, 37,231,164, 19, 4, 70,247,233, 36, 89,174, 86,107,231, 95,190,135, 31,234,208, 36, 92, 92, 92,188, 15, 31, 62, 44,174, 20,
+129,174,248,143, 83, 20, 85,241,188,220,120,215,231,247, 89,110,178,204, 92, 20,161,223,108,236,108, 26, 26,190, 23, 94,238,239,
+194,234,221, 0,252,112,246, 44, 30, 61,136, 44,209,170,152, 30,127, 67, 25,253, 89,154,222,131, 6, 13,186,182,111,223, 62,203,
+196,196, 68, 92,186,116, 9, 30, 30, 30, 80,169, 84,134,220,240, 86,209, 44, 41, 41,177, 43,255, 12, 65, 16,118,229,129,119,173,
+ 86, 91, 94, 24,229,127, 68,203, 74,219, 89,214,162,233, 86,105,187,114,115,229,254, 10,142, 93, 34, 19,139, 15, 31, 63,118, 64,
+ 17, 25,117, 9, 45, 91,116,128,194,162, 9, 56, 54, 13,217, 57, 69,200,141, 77,193,146, 37, 43,177,112,209, 60,156,252,233,136,
+194,199,183,197, 81, 45,195, 52, 2, 80,242,218,148, 59,193, 79, 8, 57,181,119, 51,193,115, 80,167, 71, 73, 69,197, 79,228, 31,
+142, 24, 76, 13, 27, 54, 12, 39, 79,158,196,131, 7, 15, 54,215, 98,178, 66, 42, 69,230, 39, 68, 92, 58,180, 25, 60, 15,117, 70,
+148, 84,172,126, 34, 31,245,193, 16,234,163,225,189,113,227,247,117,232,221,242, 73,132,147, 29, 6,230,150, 89,108,154, 66,182,
+ 84,134,171,124, 40,110, 84, 50, 91, 23, 0, 16,149, 12,214, 5,252,209, 7,243,223, 64,223, 50, 99, 53,225,249, 27, 19,186, 62,
+ 6, 11, 0,188, 0, 5, 33, 17,135,238, 92,248,169,147, 60,225, 1,173,137,184,142, 20, 13,199,111,121,202,112,173, 0,147, 59,
+128,250,249,207,168, 84,170,226,184,184, 56,147,209, 3, 7,162,147,159, 31, 28,109,108,208,200,197, 5, 38, 82, 9, 36, 98, 81,
+149, 91, 86,131,219, 16, 8,130,247,241,241, 65,191,126,253, 32, 18,137, 32,151,203,161, 80, 40, 32,145, 72,170,141,102, 25,122,
+151,203,243, 60, 40,138, 66, 68, 68, 4,158, 61,123, 6, 75, 75, 75, 92,189,122, 21, 61,122,244,120, 33,170, 85,217,156, 25, 19,
+162,175,166,226, 47, 55, 98,103,140,209, 98, 89, 2, 69,124, 11,200,158, 78,134,138,104, 5,141,134,129, 70,163,193, 15, 87,116,
+184, 25, 87, 12,157, 78, 11,141, 70, 83,219,119,214, 4,233,228,228,244, 97,163, 70,141, 38,141, 24, 49, 66, 47,145, 72, 80, 92,
+ 92, 12,149, 74,133, 7, 15, 30,232,223,121,231,221,188,126,253, 2, 44, 78,159, 62,205,151, 53, 29,166, 27,161,157,237,236,236,
+236, 90,214, 60,155, 93,159, 95, 53, 65, 16, 21, 38,230,121, 70,127, 23, 9,154, 42, 45,147,205,155, 55,131,101, 89,240, 60, 95,
+ 99, 33,149, 16,196,111,139,150,174,177, 88, 17,244, 35, 44,172,237,113,241,226, 69,246,215, 95,127, 45, 36,128,152, 71, 15, 30,
+124,247, 30,240,243, 97, 64,103,204,254,229,230,230,154,120,120,120,192,197,197, 5, 28,199, 65,175,215, 87, 68, 95,178,179,179,
+161, 86,171, 97,109,154,135, 55,108, 92,192, 20, 94, 64,106,196,215,112, 84, 68, 97,215, 25,173,190,181, 55,238,253, 3, 46, 28,
+255, 43, 91, 94,242,174, 25,206,118, 14,174, 32,121, 61, 82, 50,178, 49,160,111,111, 80, 98, 5,226, 19,179,208,162,137,167,227,
+ 7,239,117,118,164, 8, 6, 51,151,239,159, 4,112, 63,212, 37, 87, 84, 84,196, 70, 69, 69,225,254,253, 82,191,107,110,110, 14,
+ 83, 83,211, 42,255,113,146, 36, 95, 42,162, 85,110,178,150,110,238, 97, 74,138,138, 81,192,134, 96,199,158, 48,180,240, 9,192,
+150,208, 91, 37,108,122, 78,207,213, 37, 37, 49, 7,254,197,193, 12, 7, 7,135,137, 28,199, 45,228,121, 62,175, 75,151, 46,246,
+251,247,239,183, 74, 78, 78, 70, 88, 88, 24,190,250,234,171, 76,150,101, 25,158,231, 9,158,231,191,126, 5, 95,199, 85, 50, 88,
+175, 18,145, 92,134, 41,182,230, 68,127,154, 52,247, 96, 10,138,226,179,180,252, 9, 21,195,173, 7,160,175,245,226, 70,146, 31,
+ 31, 57,184,217,201, 86,201,161,155,242, 45,164,166,235,176,244,243, 81,200,206, 46,196, 15,219,151, 1,144, 64,199, 80,120,179,
+219, 96,216,217, 57, 99,194,248, 9, 14,155,183,110,249,148,225,184,213,120, 77, 72,187,182,233, 39, 0, 33, 74,165,242,193,167,
+ 19, 38, 40, 61, 60, 70, 66, 38,147,225,192,129, 3,216,191, 97, 3, 27, 4, 12,145, 2,231, 3,129,159,106,213, 9,253, 67,103,
+106, 96,160,210,215, 55, 16, 82,169, 20,191,255,250, 63,148,164,237, 41,236,219, 9, 58, 85, 9,250, 54,232,199, 91, 63, 61, 69,
+228,136, 68,136, 5, 0,145, 12,169, 0,158,111, 6,251,183, 25,172,114, 78,227,143,126, 89, 19,170, 68,180,234,125,237, 20, 73,
+194,183, 79, 27,238,110, 15, 13,161,189,114, 10,201, 26,142, 93,241, 72, 71,221,201,231,191,120, 88,141,201, 42,251, 97,115,110,
+110,110,120,171, 77, 27, 12,244,247, 7, 77,211,144, 73,196, 48,147,153,128,103, 75, 35, 89,229, 77,135,181,212,137,168, 46,250,
+100, 99, 99, 3,177, 88, 92, 97,176,140,136,102, 85,171,201,113, 28,104,154,198,253,251,247,209,165, 75, 23,184,186,186,226,208,
+161, 67,232,211,167,207, 11, 77,137,198,154,172,114,163,245, 92, 51, 94, 31, 0,229,145, 44,163,140, 86,137,150, 64,150,182, 5,
+ 8,194, 15, 12, 3,176, 60,160, 41, 41, 1,207, 3, 60, 15,232,117, 90,148,148,148, 84,124,167, 33, 77,178, 14, 14, 14,110, 38,
+ 38, 38,139,103,205,154,233,219,162, 69, 75,100,102,102,130,227, 56,152,154,154, 66,165, 82,193,220,220, 28,157, 58,117,138, 95,
+188,120,113, 42,207, 99,130,145, 38,235,165, 41, 63,231,103,207,158,173,210,108, 88,190, 20,167, 38, 97,204,103,123, 33,161, 75,
+155,150,202,251,240,212,118,221,237,254,102,103, 92,187, 19,195,124, 60,115,157, 70,148, 29,182,220,129,227,118, 38,189,196,113,
+241, 60,143,172,172, 44,164,167,167,163,255,128, 1,216,191,111, 31,158, 62,125,138, 38, 77,154,160,123,247,238,176,179,179,195,
+211,167, 79,113,243,178, 6,154,220, 28,228,104,195, 32, 55,107,143,227, 23,227, 52, 95,109,214,197,253,141, 23,140,254, 0, 70,
+153,155,155, 55, 84,169, 84,169, 12,195, 28, 6,112, 24,192, 16,154,166,135,200,229,114,199,130,130,130, 39, 40, 29, 77,116,162,
+ 46, 49, 19,153,204, 70, 42, 51, 7,199,104, 64,211, 52, 92, 93, 61,192,179, 90,228, 22,168, 49,122, 88, 63,220,185,255, 16,191,
+158,191,193,232,245,220,247,134,156, 86,138,162,120,111,111,111,100,100,100, 64, 36, 18,193,196,196, 4, 10,133, 2,115,230,204,
+193,134, 13, 27, 42, 76, 86,125,141,214, 88,192,219,220, 77,113,227,219,141,165, 38, 43, 45, 37, 21,233, 73, 34, 40,109,236,241,
+253,134,160,226,220,167,105,237,127, 4, 98,254,237,149, 44,199,113, 95, 39, 39, 39,219,209, 52,237,192, 48, 12, 18, 19, 19,113,
+251,246,109, 76,158, 60, 57, 61, 59, 59,187, 27,234,121,140, 50,153, 44,163, 60,146, 85,214,116, 88, 83,115, 98, 94,165, 72, 86,
+ 94, 45,146, 53, 53, 19,122,122,184,152,157,219,190,118,186, 91,219,246,157, 72, 57,109,158, 91, 20,155,214,229,202,165,139,157,
+ 38,175,253,225,211,103,185, 69,189, 1, 60,174, 73, 84, 42, 18,189,211,161,115,103, 26,124, 58,104, 73, 23,172, 92, 49, 12,153,
+ 89, 5,200,205, 41,132, 88,108, 10,173,158, 2,203, 17,232,212,197, 31,255,219,117, 16, 77,199,143,163, 36, 34, 81, 47, 70,171,
+125,109,140, 86, 25,203,214,175, 95,239,230,227,227,131,157, 59,119,226,252,238,221,248, 40, 63, 31, 23, 73,146,210,139, 68,182,
+ 63,235,245,219, 80,135,209,170,172,211,180,105, 83,252,248,227,143,216,179,103, 79,194,135, 61, 50,142, 78,255, 16,118, 58, 29,
+222, 14,139,134,117,131,126, 64, 88, 52,172, 91,251,160, 17, 67, 35,150, 32,170,166,131, 10, 14, 14,238, 90,121,253, 47, 35, 21,
+ 53, 52,177,211, 0,186, 5, 7, 7,243,149,215,117, 94, 56,149, 94,129,203,122, 55,116,247,123,195,141,208, 31, 90,135,196, 98,
+ 70, 59, 63, 90, 39,121, 84,196, 79,127, 8, 4,213,114, 7,193, 83, 20, 5, 51, 19, 19, 40, 45, 45, 75,195,252, 36, 9,112, 0,
+167, 7, 8,182,212, 0,240, 28, 1,158, 53,234,130, 1,137, 68, 82,109,199,119, 99,251,102, 85,214, 44, 44, 44, 68,124,124, 60,
+ 38, 76,152, 0,185, 92, 94,234,220,211,210,224,238,238, 14,154,166,145,156,156,140,223,127,255, 29, 13, 27, 54,132, 84, 42, 53,
+202,109, 85,138, 46, 53, 71,233, 40,195,230,169,169,169,230,142,142,142, 48, 58,162,197,241, 80,105, 8,104,181, 44, 30, 61,122,
+132,148,148, 20,196, 63,137, 69,219,226, 2,240,160,192,243,188, 81, 17, 45,103,103,103, 63, 79, 79,207, 45,203,151, 47, 23,187,
+184,184,128,231,121, 88, 89, 89, 66,165, 82, 33, 43, 43, 27, 77,154, 52,129,171,171, 43,150, 47, 95, 14, 0,251,255,106,147,245,
+220,111,170,194,104, 85, 54, 92,159,189,231,134,156, 28, 5, 40,138,172, 48,206,117,244,209, 18, 3, 64,183,222,131,232,115,191,
+254,108,202, 0,139,211, 40,106, 49, 93,119, 57,234, 89,142,147,215,244,126, 98, 98, 34, 68, 34, 17,142, 28, 62,140,156,244,116,
+180,104,209, 2,237,218,181, 67,108,108, 44,238,220,185, 3, 27, 27, 27, 40, 93, 58,226,226, 19, 29, 34, 83,212,176,176,176, 64,
+ 92, 18,249,119,166, 12, 24,223,179,103,207,175,190,251,238, 59, 59, 7, 7, 7, 81,102,102,166,207,198,141, 27, 91,108,220,184,
+113,234,167,159,126,106,255,233,167,159, 90, 41,149, 74, 58, 45, 45,205,251,243,207, 63,111, 29, 18, 18,210, 16,192,154,218, 4,
+ 77, 77,205,172, 41,177, 41, 8,130,134,165,133, 21,104,137, 41, 56,134, 6,203, 1,230, 22, 74, 92,187,115, 4, 87,195, 11, 39,
+102,100,227,176, 65,241,177,178,114,183,177,177,121, 33, 82, 61,121,242,100,108,223,190,189,162, 25,177,190, 38,107,233,198, 30,
+ 10,162,204,100,165, 37,210, 32, 52, 13,113,234,167,235,121,185, 79,211,186,188, 14, 38,171,252, 26,199,243, 60,158, 60,121, 2,
+149, 74,133,203,151, 47,227,235,175,191,206,124,222,100,217,217,217,141, 55, 55, 55, 95, 84, 84, 84,180, 50, 45, 45,109, 93,157,
+ 55,126,165, 38,170,252,113,249,186,218,230, 68, 3,119,213,189,186, 72,150,171,163,236,204,157,203,123,221, 45,248,123, 4,158,
+ 77, 0, 30, 21, 60, 48, 11,181,123,243,221,182,125,201, 86,155,190,105,208,110,226,156, 51,137, 5, 37, 62, 53, 69,182, 56,150,
+109,101,170, 48, 3,144,129,176,219, 23, 42, 76, 86,118, 78, 62, 52, 58, 10, 26, 45,129, 18, 29,137,183,122,190,141, 13, 91,246,
+ 32, 57, 35, 7, 44,203, 54,123,205, 76,150,181,159,159, 95,224,144, 33, 67,176,120,241, 98,132,124,247,157,246, 19,130, 40,160,
+ 1,254, 52,203,130,227,121,130, 52,172, 19,123, 21,157,213,171, 87,255, 4,200,224,209, 35, 0, 0, 32, 0, 73, 68, 65, 84, 96,
+248,242,201,232,152, 91,132,209, 78,253,120,235, 6,253, 74, 55,124,127, 22, 15, 0,214,153, 33, 85,171,204,128,128, 0,162,188,
+101,205,216, 22,182,127, 58,116, 64, 64,192,197,224,224, 96, 84, 94,215,246, 1, 51,123,159,119,191,156, 49,105, 69,219, 62,254,
+ 68,234,140, 94,200, 41, 40, 97,230, 70,234, 36, 73,234,218, 77, 86,101,190,220,184, 17,119, 98, 74,255,199, 46,118,118,152,249,
+193, 7,224, 25,224,234,131, 72, 28, 12, 9,193,176,158, 61, 97, 42,147, 25, 28,217,224, 56,174,218, 40, 86,229,104,150,177, 81,
+167,188,188, 60, 28, 62,124, 24,237,218,181,131, 92, 46, 7, 77,211,104,222,188, 57, 30, 62,124, 8, 79, 79, 79, 16, 4,129,227,
+199,143, 99,224,192,129,120,252,248, 49, 58,118,236,168,120,246,236,153,209, 70, 43, 50, 50,210,156,231,249, 55,203,163, 31,245,
+ 69,163,209, 32, 42, 42, 10,253,250,245,131,149,149, 21,156,157,247, 35,228,204, 94,200,253, 62, 2, 65,192, 40,163,197,178,236,
+216,190,125,251,138, 9,130,128, 90,173,130, 76,102, 2, 83, 83, 5,204,204,204,225,237,237,131,148,148, 20,244,233,211, 71, 27,
+ 23, 23,183, 41, 53, 53,245,144,177,251,234,235,235,107,250,244,233,211,143, 26, 52,104, 32, 1, 0, 19, 19,147, 38,158,158,158,
+ 95, 60,126,252,184,208,216,168, 86,185,193, 34, 8, 2, 20, 69, 85, 24, 45,154, 36,225,232, 96, 87,241,188,172,127, 26, 81,139,
+ 86, 65,114,182, 70, 10, 0,110,110,110,216,176,245, 36,217,183,111, 95, 76,157, 58, 21,122,189, 30,155, 54,149, 14,178, 27, 49,
+ 98, 4,116, 58, 29,142, 30, 45, 29, 36, 73,211,116,173, 97,147,219,183,111, 35, 44, 44, 12,122,189, 30,249,249,249,248,229,151,
+ 95,112,241,210, 37, 28, 56,254, 27,158, 62,137, 69,115, 31,119,140, 27, 55, 22, 34,145, 8,187,118,237, 66,151, 46, 93,254,214,
+ 11,130, 72, 36,250,112,251,246,237,142, 59,119,238,204, 59,126,252,120,113,135, 14, 29,164, 65, 65, 65,118, 27, 54,108, 80,106,
+181, 90, 76,155, 54, 45,227,198,141, 27,154, 1, 3, 6,152,110,219,182,205,241,141, 55,222,232,197, 48, 76,117, 70,203, 20,192,
+ 48, 0, 35,115, 11,181,116, 94,161, 26, 28,163,197,147,167,241,200, 47,210,130, 99,117, 72, 72, 74, 65, 81, 9,139,236,156, 66,
+ 52,111,213,123,253,133, 11, 23,230,233,116,186,185, 0,130,235,218,207, 7, 15, 30,224,198,141, 27,120,250,244, 41,158, 60,121,
+ 82,213, 41,142, 31,143, 61,123,246, 24, 29,209,170,222,100, 81, 32, 52,158, 8, 62, 30,154,151, 17,155,250,218,152,172,178,107,
+208, 66, 71, 71,199,133,142,142,142,178,179,103,207, 90, 52,104,208, 0, 12,195,104,159,143,100,117,235,214,109,254,246,237,219,
+ 29, 61, 61, 61, 39, 3, 88,247, 79,216,119,146,196,248,149,155, 3,109,205, 36, 9, 41,120,180,166, 44,151, 32, 5,168, 10,128,
+ 11,251, 64,119, 94, 16, 63,121,192, 44,171,217, 59, 23,143,231,192,213, 56, 66, 54,238,113, 34, 54,111,222,128,233,211, 70,227,
+127, 63,172, 4,199,209,208,232, 41,184,121,116,128, 70,199,129, 32,105,180,104,213, 6,231, 47, 92,134,136, 4, 14,239,220,252,
+154,249, 44,228, 68, 68, 68,108, 58,126,252,248,148,169, 83,167,130,227, 56,201,162,205,155,213,153,153,153,203, 96, 92,254,171,
+231,117, 6,110,222,188, 57,102,246,134,204,159,166,127, 8,234,233, 41, 34, 39, 44, 26,214,239,207,226,113,100, 5,129,214, 62,
+200,145, 87, 95,197, 95,122,110,253,122, 24,173,114, 39, 89,121, 93, 29,173,188, 26,126, 99, 97,109, 53,150, 52,115,182,157, 57,
+245, 19,250,113, 90, 9,142, 54,248,160,232,247,221,223,155,166, 49,210,245,113, 40, 9, 50,230,139, 15,254,254,123,197,227, 85,
+251,247, 87,251, 94,234,251,239, 27,124,103, 86, 83, 20,203,216, 72, 22, 0,200,229,114,203, 94,189,122,161, 71,143, 30, 24, 60,
+120,112, 69,159,172,150, 45, 91,226,192,129, 3, 24, 52,104, 16,238,222,189, 11, 71, 71, 71, 52,110,220, 24,141, 27, 55,198,207,
+ 63,255,108,236, 69, 14, 44,203,194,207,207,175,124,212, 97,243,164,164, 36,243,250, 22,164, 70,163, 65,118,118, 54,172,173,173,
+ 33,145, 72,208,190,125, 59, 76,249,172, 61,108, 29,127,132,159,175, 15,138,139,139, 43,134,191, 27, 80,217,250, 53,106,212, 8,
+153,153,153,200,204,204,132, 82,169,132,147,147, 19, 28, 28, 28,176,102,205, 26,126,221,186,117,191,234,116,186, 77, 89, 89, 89,
+ 70, 71,178, 28, 28, 28,252, 9,130,152,175, 86,171, 37,149,238,112, 37, 74,165,242,132, 90,173, 94,150,154,154,106,112, 71, 80,
+130, 32,160,211,233, 64, 16, 4, 78, 63,113, 66,177,150, 64, 65, 82, 24,166,190,231, 94,197,120,137, 68,162, 58,155, 75,121,158,
+ 47, 30, 62,124,184,157,171,171, 11, 18,227, 30,224,200, 17, 30,223,125,247, 93,249,168, 72,196,148,221, 24,148, 63,239,222,189,
+ 59, 60, 60, 60,192, 27,145, 43,131,227, 56,220,191,127, 31,251, 79, 92,132,163,187, 47, 18, 30, 69,225,206,207,167,208, 64,105,
+141,166,173,218, 64,175,215,191, 84,234,141, 87,129, 94,175,223,225,229,229,197,107,181,218,139, 0, 54,132,135,135,143, 78, 77,
+ 77,157,118,242,228, 73,167, 33, 67,134,164,156, 58,117, 42, 8,192,206,240,240,240,192, 37, 75,150,244, 96, 24,166,218,209,130,
+ 20, 69,253,239,243,207, 63,239, 54,100,200, 16, 66, 76,234,181,103,207,236,162, 25, 70, 79,124, 57,119, 7,123,225,202, 69,146,
+ 97,244,196,224,225,159,115, 63,255, 30, 78, 78,252,108, 21,219,178, 67, 95, 68, 68, 68, 56, 4, 4, 4, 44,209,235,245,181, 26,
+173,242, 72, 85, 77, 17, 74,138,162, 48,122,244,104, 28, 56, 96,120, 15,170,113,128,167,185,187,226,198,210,141, 61, 21, 4, 93,
+ 84,201,100,189,129,224,227,161,121,233,143, 82, 94, 43,147, 5, 0,217,217,217, 91, 1,108,229, 56, 46,221,212,212, 20,133,133,
+133,213,253,254,100,225,225,225, 50,137, 68,130,222,189,123, 91,135,132,132,196,144, 36,185, 46, 37, 37,165, 70,199, 81, 93, 51,
+ 97,117,205,137,120,137, 81,135, 86, 74, 4,180,247,111,101, 22,109,177,216, 76, 70,151,220,109, 16, 35, 51, 39, 0,228,107,236,
+159, 92,123, 54,172,128,200,144,182,108,211,189, 53,204,105,211,128, 60,166,176, 90,163, 69, 82,212,157,252,220,188,119, 10, 10,
+181,184,114, 53, 2,195,135, 53,130, 70, 71,128,227, 72, 20, 21,107, 0, 74, 4, 18,192,136, 15, 70,129, 39,104,228,164,167,128,
+162,168,112, 48, 12, 94, 51,230, 4, 6, 6,190, 51,119,238,220,134, 51,103,206,196,204,153, 51,221,183,111,223,190,117,233,210,
+165, 51, 51, 51, 51,155,161,142,228,227,181,232, 52, 56,117, 96,193,140, 19,151,183,228,247,237,164,126,212,218,167, 52,242,213,
+218, 7, 57, 34, 17, 98,105, 10,217, 60, 95,181,155, 81, 64, 64, 64,215,202,235,127, 25,207,119,130,175,120,110, 80, 31,173, 70,
+ 13,157,223,110,213,210,239,179,121,115,231,153, 61,188,118, 1,179,191,217,192,123,181,233, 85,184,245,242, 29,109,145,169,199,
+ 59, 69, 89,177, 87, 13,245, 23, 0,240,246, 91,131,208,188, 73,187, 23,222,236,210,189, 52, 89,251,149,243,183,145,158,153,108,
+112,101, 91,102, 14,170,237,147,101,200,144,254,231, 81,171,213,121, 17, 17, 17,118, 73, 73, 73, 85, 58,190,123,120,120,128, 32,
+ 8,132,134,134,226,198,141, 27, 24, 62,124, 56,104,154,134, 72, 36,194,197,139, 23,141,138,198, 84,138, 46,149,143, 58,236,227,
+226,226, 82,211,104,195, 58,181,212,106, 53,242,243,243,113,230,204, 25, 52,106,212, 8, 75,151, 46,133,147,163, 61,230,205,155,
+ 1,142,227, 80, 80, 80, 0,150,101, 13,141,104,113,229,209, 34,142,227,144,153,153,137,134, 13, 27, 98,227,198,141, 8, 10, 10,
+ 90,146,154,154,122,210,216,125,116,117,117,181,100, 89,246,203,190,125,251,246, 26, 48, 96, 0,250,244,169,154,143,117,223,190,
+125,102, 71,143, 30, 93,246,253,247,223,191,173,211,233,150,103,100,100,100, 26,162,251,227,143,165,233,151,228, 29, 22, 98,246,
+144, 6, 24, 57,105, 23,214,172, 57, 6,169, 84, 90,165,226, 93,188,120,113,173, 38,134,227,121, 47,113,214,181,148, 25,179, 86,
+219, 45, 91, 22,130,144,144, 12,144, 36, 9, 71, 71, 71,144, 36,137,248,248,120,144, 36, 9,119,119,119,144, 36,137,228,228,228,
+242, 62,129,185,168,102,212, 99,245,119,225, 36, 74, 74, 74,144,152,240, 20, 73,113, 49, 80, 20,164, 65,105, 46, 71,238,131,251,
+104, 62,110,124, 69,254,167,191,153, 61, 90,173,118, 79,165,231,171, 79,157, 58,165, 37, 8, 98, 48, 74,251,105,148, 71, 52,150,
+ 48, 12,179,164, 38,145, 14, 29, 58,180,156, 59,119,174,168, 60,221,134,147,219,183,140, 78,167,227, 0,192,167,249,155, 85,220,
+126,108,108, 44,214,172, 89,131,226,226, 98,136,197, 98,177, 33,231,129,227,184,138, 17,134,213,153, 48, 99, 76, 22, 0,216,184,
+187,172, 15, 13,187,200,222,139,219,162, 14,143,254,197, 36, 53,129, 4,169,125,125, 77,214,243,145, 45, 23, 23,151,133, 28,199,
+241, 60,207, 47,168,244,150,212,205,205,237,242,217,179,103,109, 24,134,193,247,223,127,111,153,150,150,102,249,230,155,111,206,
+ 6, 80,163,209,170,174,153,176,186,230, 68, 84, 26,117, 40,149, 74,173,181,218, 26,131, 39, 47,140, 58,100, 89,120,155,155, 89,
+ 34, 23, 73,208,216,234, 91,230,217, 48, 57,231, 82,199,223,117,122,214,170,137, 41,171,111, 72, 22,104,225, 44,183, 4,199,243,
+ 53, 14,141,214,232,245,191,220, 13,187,211,219,205,181, 17,117, 50,248, 18,250, 15, 28, 2,141,134, 68,137,158, 0, 65,137, 64,
+ 80, 98, 52,107,222, 10,141,155, 54, 7, 15,224,246,205,107,140, 86,175, 63,247, 58,149,189, 99,231, 41,195, 9, 2,235,192,115,
+124, 53,121,180, 26, 14, 28, 56,112, 25,128,207,234,210,177,235, 48,101, 56, 73,150,234, 84,206,163,245,249,148, 64, 60,184, 41,
+178,184, 20,182, 66,220,167, 3, 78,103,134, 16,144,203,254, 24,117, 40, 34, 95, 42, 53,199,191,197,112,213,109,180, 92, 93, 93,
+ 45,205,165,178, 31, 63, 29, 55,214,236,217,189,235, 72,139, 12,197,213, 75, 49,185, 7,143, 30,203, 41,206,206, 24,103,132,201,
+170,104,230,179,113,104, 0, 15,223, 23,141,150, 76,161, 4, 0,120,248,182, 3,101,106, 92, 26,161,234,162, 89,245, 49, 89,149,
+ 47,216,213,229,208,154, 56,113, 34,182,111,223,142,206,157, 59,195,203,203,171,226, 98,111,108,212,172,154,232,146,209,163, 13,
+ 43, 83, 88, 88, 8,119,119,119,108,219,182, 13,225,225,225, 48, 51, 51,195,240,225,195, 81, 88, 88, 88, 97,176, 12,237, 12,207,
+243,124,236,217,179,103,219, 14, 29, 58,148, 23,137, 68, 68, 94, 94, 30, 44, 45, 45,177,113,227,198,226,212,212,212,211,245, 48,
+ 89, 67,196, 98,241,140, 97,195,134, 81, 62, 62, 62, 72, 79, 79,135,185,185,185,158, 32, 8, 17, 0, 88, 90, 90,234, 77, 76, 76,
+ 16, 24, 24,136, 22, 45, 90,248,207,156, 57,179, 51, 77,211, 27, 83, 82, 82,118,213,246, 91, 34, 8,162,162, 66, 29,183, 46, 10,
+ 90,109,105, 5,189,105,211, 38,148,245,117,251,163,137, 32, 46, 14, 48, 96, 36,139, 66,161,128,151,151, 87,181,101,239,239,239,
+143,219,183,111,151, 54, 77,210, 52,236,236,236,112,245,234, 85,131, 70, 82,149, 39,130,140,136,136,128,175,135, 45,194, 67,206,
+194, 86, 46, 66, 11, 39, 7,184,248,119, 69, 76, 76,204,223, 25,205, 34, 80,218, 15,163,103,217,111,112, 7,128,137,149,158,111,
+ 4,176,222, 24, 65,134, 97,120,146, 36,137,196,196, 68,157, 92, 46, 39,172,173,173,105,169, 84, 10,141, 70, 83, 97,184, 98, 99,
+ 99, 17, 28, 28,140,164,164, 36, 88, 91, 91,147, 22, 22, 22,208,233,116,185,134,232,123,123,123,195,193,193,161, 74,199,247,113,
+227,198,213,203,100,141, 6,252,182,127,187,188,129,148,164, 44,124,109,223,198,147,168,248, 18, 82, 11,217,127,193,100, 1, 64,
+ 94, 94,222, 86, 0, 91,203,159,219,218,218,142,161, 40,106,158, 70,163,177,184,120,241,162,165, 82,169, 36,118,237,218,165, 95,
+176, 96, 65, 30, 69, 81,185, 4, 65,172,253,251,205, 33, 34,179,242,227,220, 69, 86, 78,220,189, 18,254,218,180,196,217,141,115,
+ 69,141,148, 68, 83, 63, 12,204,120,120,101, 12, 19,215, 41, 61, 53,141,228,193, 69,214,114, 13,222, 49,123,238,226, 47, 99,162,
+238,184,201,204,101,152, 24, 56, 23,167,127, 61, 15,130, 20,225,242,181, 80,104,117, 44,178,114,242, 49,108,196,135,112,113,180,
+ 69,228,141, 51,153, 12,199,109,124,189, 76, 54,183,161,119,255, 49, 86, 82, 19,121,217, 57, 97,177,231,135, 25, 32,201,117,248,
+234,171,175,224,231,231, 55, 41, 34, 34,226,107,212,145, 71,139, 32,184, 13,205,186,142,176, 18, 75, 75,117,120,142,197,182,195,
+179,203,242,104, 77,199,198,173, 71,155, 53,245,120,178,168,182, 60, 90,175,145,201,170,188,174,221,104,185,187,187, 75, 77, 69,
+152, 32,162,232,153,159,126, 48, 64,153, 17,247, 0, 73, 15,239,148, 54, 47,232,212,186,180, 71, 15, 13, 73,133,222, 19, 85,243,
+119,240,181, 53, 93,149,148, 24,116, 71, 95, 69,179,188,194,125, 62,154,101,164,201,122, 65,179,178,217,170,156, 55,203,213,213,
+ 21,203,150, 45, 51, 36,143,214,243,199, 94, 78, 31,148,118,128,175,220, 25,190,143,129, 38,171, 90, 77,165, 82,137,236,236,210,
+ 12, 9,221,186,117, 67,183,110,127,140,103,208,233,116, 21, 81, 44, 51, 51,179,234, 34, 90, 47,104,154,152,152,204, 62,118,236,
+216,216,107,215,174, 13,253,226,139, 47, 68, 61,122,244, 40, 55,115, 42, 24, 54,183, 91, 21, 77,150,101, 3,207,156, 57, 67,113,
+ 28,135,109,219,182,225,246,237,219,188, 92, 46,159, 47,151,203, 55,152,152,152,176,106,181,122,226,248,241,227, 63, 92,180,104,
+ 17,233,239,239,143,235,215,175,147, 13, 27, 54, 28, 5, 84, 73, 98, 89,237,177,135,134,134,130, 36, 73, 48, 57, 9,152, 52,251,
+ 32, 76, 77,104, 68, 69, 69, 33, 39, 39,231,133, 36,166,134,156,207,202,145,146,242,197,223,223,191,162, 25,178,125,251,246,160,
+ 40, 10,119,239,222,173,169, 25,182,178, 38,111, 99, 99, 83,241,251, 16,139,197, 56,127,254, 60,190,249,230, 27,184, 89, 91, 34,
+247, 97, 56, 28,186,189,133, 94, 99,199, 99,248,240,225,160, 40, 10,214,214,214, 21,145, 95, 3,126, 75, 47, 67,101,205,177,190,
+190,190,163, 34, 35, 35, 93,154, 53,107,230, 24, 17, 17,209,221,207,207,207, 61, 60, 60,188,252,185, 20,134,245,205,169,208,188,
+117,235,214,145, 13, 27, 54, 4,142, 30, 61, 90,204,113, 28,251,236,217, 51, 61, 0,194,193,193,129,186,117,235, 22,119,242,228,
+ 73,168,213,106,184,184,184,144,206,206,206,196,185,115,231,184,135, 15, 31,134,242, 60, 63,215,144, 99,103, 89,182, 74, 26,135,
+242,199,251,246,237, 51,250,255,222,160,177,247,210, 30,111,250,184,102,165,220, 69,106,114, 28,216,124,165, 46,248,248, 41,141,
+145, 38,235,207, 46,163,191, 82,115,241,163, 71,143,156, 53, 26, 13, 36, 18, 9, 54,109,218,164, 91,182,108, 89,100, 86, 86, 86,
+ 23, 84, 63,162,188,138,102, 61, 71, 29,230,212,162,249,194,168,195,252,108,156, 62,126,226, 86, 91,197,192, 29,152,148,146, 89,
+209,177,145, 39, 8,235, 99,246, 77,186,200,219, 53, 75, 38,127, 94, 72, 22,178,170,211,181, 28,187, 86,173,213, 14, 25, 56,104,
+196,111, 7, 14,236, 87, 44, 88,184, 16, 87, 67,195,145,157, 87, 4,142,167,192, 17, 4,230,205, 91, 0, 7, 91,107, 20,164, 60,
+ 82,105,116,186,129,168,154, 67,235, 95, 95,238, 4, 65, 78, 62,119,114,215, 58,146, 0, 87,156, 30, 45,165, 10,227,228, 35,135,
+ 15,164,135, 12, 25,130, 99,199,142, 33, 34, 34, 98, 75, 45, 38,171, 66,147,231,201,201,225, 23, 15,174, 35, 0, 78,157, 25, 45,
+165,139,158,200, 71,125, 48,144, 30, 62,124, 56,126, 10,190,134, 3,167,158,108, 62,112, 10,167,240,122, 99,124,102,120, 51, 26,
+ 17, 93,154,120, 58,251,183,106, 42,163, 89, 53,146, 30,198, 33,167,184, 4,231, 30, 60,203, 35,121,178,222,185,117, 74, 47,144,
+ 98, 36, 36, 60,170,230,206, 74, 86, 86,161,151, 24,165, 73,146,100,149,104,214,203, 68,178, 42,239,167,189,189,125,149,233, 92,
+ 42, 87,220,229,125,128,234,145,218, 97,118, 66, 66,130,121, 66, 66, 2,120,158, 71,104,104,168,121,251,246,237,103,191, 76, 52,
+107,198,140, 25, 21, 81,171,231,215,213,189, 86, 23,101,157,210,131,244,122,253,225,153, 51,103, 78,106,223,190,125,239,133, 11,
+ 23, 18, 48, 98, 2,222,231,162, 57, 12,199,113,184,112,225, 2,142, 29, 59,198,234,116,186, 9,169,169,169,225,149, 54,249, 62,
+ 44, 44,236,220,160, 65,131,118, 69, 71, 71, 83,145,145,145,224,249,186,199,157,170,213,106,120,121,121,129, 97, 24,172,152,228,
+138,194,194,102, 96, 24, 6, 44,203,194,212,212,180, 34,138, 87,217, 60,215,245, 59, 98, 89,246, 5,163, 21, 26, 26, 10,138,162,
+208,165, 75, 23,220,185,115,167, 34,162, 85, 87, 4, 74,167,211, 37,216,219,219,219, 47, 94,188,184, 98,191, 50, 51, 51,113,246,
+236, 89,116,232,216, 9, 77, 38, 76, 68, 74, 74, 10,214,174, 93, 11, 39, 39, 39, 44, 93,186, 20, 57, 57, 57, 96, 24,230,175, 14,
+167,191, 19, 25, 25,233,242,193, 7, 31,100,132,135,135,187, 4, 7, 7, 91, 6, 4, 4,152,142, 24, 49, 34, 35, 60, 60,220,133,
+ 32,136, 78, 48,178, 19, 52,199,113,115,230,205,155,247,235,210,165, 75,103,127,246,217,103,237, 71,143, 30, 45, 18,137, 68, 92,
+114,114, 50,179,127,255,126,194,203,203,139, 20,139,197,196,153, 51,103,184,155, 55,111,222, 96, 24,102, 5,128,203,198, 68,156,
+ 43,155, 44,138,162, 12, 53, 89, 85,152,102, 39, 29,101, 70,102,118,217,176,105, 25,233,227,225,162,219,189,255,108,226,229,235,
+143, 30, 83, 26,102,218,143,181,164, 6,120,157,161, 40,234,144,175,175,239,152,201,147, 39,155,244,233,211, 71,186,104,209,162,
+252,194,194,194,154, 76, 86, 53, 55,204,127,201,168,195, 31,230,124, 17, 60,237,243,102, 99, 60, 63,118,104,128,144,226, 12,228,
+210, 20,105,110, 73,162,149, 59,133,194,172, 88,229,169,223,118,198, 3,168, 43, 47,219,173,176,251, 17, 61,155, 54,107,121,116,
+197,210, 21,118,243,103,205, 20, 29, 13,254, 5, 60,163, 67,232,197,139, 80,136, 89,254, 97, 88, 72,186, 70,167, 29,128,215,112,
+ 10,158,212,171,235, 15, 0, 56, 97,109,109,125,111,236,232,209, 94,190,190, 35, 32,151,203,113,228,200, 17,236,249,254,123, 54,
+ 8, 24, 42, 5,238, 4,214,145, 79, 47,227, 70,133,206,221,241, 99,199,122,183,106,245, 49,228,114, 57, 14, 31, 62,140, 93, 65,
+ 65, 6,235,252,203, 41,207, 12,127, 26,127,100,136,175,163,143, 22, 73, 20,222,120,244,172, 40,244,209,179, 34,112, 60,207,241,
+188,134, 36,145, 88,172,211, 45,125,244, 36,185, 94,166,160,188,233,112,201,183,147, 95, 93,155, 71, 37,243, 83,223, 33,221,213,
+152,172,164,202,115,164, 85,174,164,107,122,172,215,235,147, 12,148, 95,238,230,230,246,194,107,245, 15,253,242, 70,153, 44, 67,
+243,104, 1, 64,118,118,118, 42,128,249,215,175, 95,223,215,187,119,239,241, 0,146,235, 89, 70,219,186,118,237, 58, 1, 0, 69,
+ 16,196,150,148,148,148,240, 23,254,240,169,169, 49, 78, 78, 78,171, 60, 60, 60, 38,150,222,152, 18,219,234,168,200,159, 52,107,
+214, 76, 87, 93, 89,212,244,156,227,184, 58,203, 40, 47, 47, 15,237,218,181,123, 97, 78, 75,158,231,241,236,217,179,242,136, 83,
+197,185,175,205,192, 21, 21, 21, 77,156, 50,101,202, 86,145, 72,228, 6,128, 40, 55,185, 44,203, 82,235,215,175,151,177, 44, 75,
+ 1, 32, 72,146,100, 68, 34, 81,201,177, 99,199, 24,134, 97, 18, 52, 26,205,196,191,248, 2,113,152, 40,157,138,161, 56, 50, 50,
+210,167, 44,146,149, 20, 17, 17,113,247,192,129, 3, 74, 0, 7,235,169,123, 89,165, 82, 93, 94,182,108,153,255,166, 77,155,230,
+ 76,156, 56,177,221,240,225,195,233,110,221,186,225,244,233,211,236,133, 11, 23, 66,213,106,245,114, 99, 12, 86, 89, 89,230,187,
+186,186, 86, 24,174, 58,254,203,181,118,228,181,113,151,110,248,240, 19, 39,217,182,229,103,139,178, 82,180,215,244, 69,218,185,
+ 59,129, 8,252,135, 73, 79, 79,255, 2,192,130,181,107,215,166,180,104,209, 66, 42, 22,139,181,134,154,172,191, 16,134,203, 43,
+122,247,187, 94,239,159,232, 58,111,138, 71,175,238, 93,228,174, 13,236,156, 31,198,165, 35,246,250,233,226,123,167,190,125,202,
+107,114,251, 3, 48,164,231,250, 77,141, 78,215,104,198,204, 25,147, 36, 34, 81,111,150,101,155,247, 56,119,156,167, 40, 42, 92,
+171,215,159, 43,107, 46, 44,121,141,139,124,201,170, 85,171,188,124,125,125,113,228,200, 17,156,219,187, 23,195,178,178,112,158,
+162, 40, 82, 44,182, 57,165,211,173,134, 97, 6,105,201,154, 53,107,188,253,252,252,112,232,208, 33,156,217,181, 11, 67,235,167,
+ 83, 83, 93,215, 22,128,178,236,105, 22,128,104, 0,173, 1,152, 0,208,160,116,106, 39,219,202, 85, 88,217,123,229,239, 95, 34,
+ 8,226,207,236, 8, 91,119,102,248,231,137,136,125,218,250, 85,239,133, 90,173,206,241,242,242, 50,106,204,181, 94,175,175,181,
+ 13,151, 97,152, 36, 79, 79, 79,131,163, 22,134,152,162,156,156,156, 54,127, 98, 97,188, 84, 95,172, 42,149, 8,199, 61,117,116,
+116,228,202, 43,253,234, 76, 88,117,175,241, 64,188, 49,223,147,150,150, 22, 13,224,243,250,238,103, 74, 74,202, 81, 24, 48,105,
+180,161,219, 1, 64,110,110,238, 43,159,204,151,224,249,228, 69,139, 22, 25,101,176,193,243,181,153,207,240,162,162,162,246,134,
+124,183, 78,167,195,223,200,161,178,133,140,136,136, 24, 79, 16, 68, 31,148, 54, 9,108,193,171,201,230,125,185,160,160,224,242,
+202,149, 43,253,183,109,219, 54,141,231,121, 20, 20, 20, 4, 25,107,176, 42,238,158, 51, 50, 78,191,170, 3,207, 73,215,254,190,
+127, 75,210, 91,234, 60,221,180,237, 69,218, 93, 16,168, 8, 70,241, 60,255,191,145, 35, 71,118, 0,176,243,101,197,106, 24,117,
+248,178,196,115,185,249, 45,206,207,248,102,236,121, 75,179,190, 96,105, 31,104,201, 83,208,102,159, 6,240, 35, 12,235,230, 80,
+113,188, 12,199,173, 97,180,218, 53,149, 42,151,255, 66, 57, 91,251,249,249, 77, 27, 51,102, 12, 22, 44, 88,128, 51,171, 87,235,
+ 62, 33,136,124, 17,192,255, 90,122,163, 73, 18,192, 44, 67,117, 70,141, 26,133, 5, 11, 22,224,231, 21, 43,234,171, 83, 27, 74,
+130, 32,130, 1, 96,246,236,217,115,151, 45, 91,102, 53,103,206,156,230,203,151, 47, 95, 90,246,252, 65,249,251,101,117, 93,192,
+156, 57,115,154, 86,122,191, 16,192,173, 63,249,124, 86,155, 25,254,207,166,167,160, 41,104, 10,154,130,166,160, 41,104, 10,154,
+130,230,203,192,243,124,223,210, 85,205,235,154, 30, 87, 90,255, 45,208, 16, 16, 16, 16, 16, 16, 16, 16,248, 23, 82, 57,138, 85,
+159,247, 95, 33,229,125,180, 42,179, 13, 40, 29,214, 93,147, 43, 53,102,212, 67,125,156,109,136,160, 41,104, 10,154,130,166,160,
+ 41,104, 10,154,255, 57,205,186,180, 95,248, 60,207,243,125, 9,130, 8,230,121, 62,160,166,117,185,177,122,254,113,165,245, 43,
+235,118, 80, 13,229,125,179, 94,232,163,245,103, 35,132, 85, 5, 77, 65, 83,208, 20, 52, 5, 77, 65, 83,208,124, 41,202,155, 0,
+ 1,240,179,103,207,158,243, 15,108, 58,116, 44, 51, 89,149, 23, 0,181, 52, 29,242,252, 97, 42, 57, 25,230, 18,137, 92, 12, 0,
+ 90,173, 74,231,236,140, 2,130, 24,242,119, 78,120, 43,240,239,164,124,184,119,250, 43,222, 86, 64, 64, 64, 64,224,191, 65,102,
+121,164, 10, 64, 38, 0,162,236,185,182,108,157, 89,102,200,158,127, 92,229,253, 63,145, 84,212, 16,201,162,107, 50, 89, 89, 89,
+114, 91,154,206,245,102,217,146,198, 0, 64,211,100, 84, 86,150, 85, 12,207, 31,206,170,143,217,178,181,179, 11, 19, 81,148,179,
+ 33,219,234, 89, 54, 57, 43, 61,189,106,234,120,130,120, 29, 12,158,161, 38,226,101,204,198,159,110, 84,108,109,109,237,237,237,
+237,223, 51, 55, 55,239,152,151,151,119, 51, 51, 51,243,167, 90,230, 61, 92, 70, 16,152, 89,250,187,194, 74, 0,115,106,145, 54,
+102,219,231,241,146,203,229,147, 8,130,240, 43,251,131, 69,168, 84,170, 77, 0, 30,253, 7, 47, 72, 38, 0, 6,208, 52, 61,202,
+214,214,182, 93, 90, 90,218, 34, 0,245,205,230, 77, 3,152, 97,105,105, 57,204,210,210,210, 51, 39, 39,231,113, 65, 65,193, 33,
+ 0,107, 0,212, 57, 84,122,209,103,142, 29,187,245,233, 54,255,194,153, 11, 75, 22,125,159,122,253,133,247,103, 56,218,244,238,
+213,121,193,133, 83,215, 22,207,221,152,146, 99,228,190,145,101, 11, 80, 58, 58,146,199,139,201, 94, 95, 22, 17,128,126, 0,186,
+ 1,184, 0,224,148, 33,199, 93, 3, 29, 0,204, 45,219,231, 53, 0,206,255,195,127, 71,166,246,246,246, 43, 0,244,163,105, 58,
+ 50, 57, 57,121, 2,128,164,191,121,159,104, 0,109, 1,248,161, 52, 13,199, 45, 24,150,194,161, 78,108,108,108, 2,104,154,158,
+ 84,150,218,101, 83,118,118,118,240, 63,181, 96, 36, 18, 73,144,131,131,195,199,106,181, 90, 69, 16, 4, 95, 57,223, 35,195, 48,
+ 73, 89, 89, 89,109, 94,183,139, 26, 65, 16,183,254,225,187, 56,161,154,215,106,206,163,149,156, 12,115,154,206,245,206, 72, 11,
+ 31,150,146,122,127, 40, 0, 56, 57, 54, 63,100,231,208,236, 96,114,178, 68,231,224, 51, 80, 33,146,211,155, 40, 74,212,178, 68,
+171,177, 21,209,162, 44, 29,163,191, 75,106,249, 73,105,209, 63, 85,155,108, 81, 68, 81,206, 79, 99,206,219, 49,186, 28,136,100,
+ 78, 16,153,184,213,184,183, 78, 78, 78,245, 58, 74, 43, 43, 79, 51,157, 84, 54, 77, 36,162,122,113, 60,227,199,115, 0, 73,136,
+ 34, 24, 86,255,155, 88,163,249, 46, 55,247,113, 97,125,207,160,143, 13, 28,120, 96, 56, 8,244, 2,143,115, 4,112, 32, 58, 27,
+105, 70, 72, 24,106, 34, 94,198,108, 84,254,236, 90, 0, 95,188,234, 95,146,179,179,179, 85, 64, 64, 64,208, 55,223,124, 99,162,
+ 80, 40,136,132,132,132, 62,179,102,205,122,243,246,237,219,159, 39, 39, 39,167, 60,111,250, 8, 2, 51, 57,142, 39, 1,128, 36,
+137, 89, 74,165,157,156,162,168, 23,114, 27,177, 44, 43,207,204,204,152,204,113, 60, 81,182,237, 76,158,199, 58, 67, 12,163, 76,
+ 38, 27,225,215,172,229,231, 43, 86,173, 81,216,219,217,153, 50, 44,167,139,127,246, 84, 62,127,246, 23,237,227, 98, 31,173, 43,
+ 41, 41,217, 95,159,255, 53, 69, 81,195,164, 82,105, 0, 0,223,178,215, 30,106, 52,154, 96,150,101, 15, 26, 90,161,219,219,219,
+ 95,162, 40,170,129, 49, 95,204,178,108, 66,122,122,122,151,122, 22,209, 16, 55, 55,183, 31,187,118,237, 42,111,215,174, 29, 36,
+ 18, 9, 22, 44, 88, 48, 35, 53, 53,181, 46,163, 69, 3,152, 33,151,203,135,153,154,154,122, 22, 21, 21,197,169,213,234,163, 18,
+137,164,231,186,117,235, 92, 59,119,238,108,150,158,158, 78, 80, 20,101,255,243,207, 63,127, 20, 20, 20,212,135, 97,152, 30,117,
+ 85,114,249,113,252,124,105, 63, 95,255,252,184,243,243, 1,188,243,252,251, 76,137,108, 20, 79,185, 6,168,249, 59,137,101,230,
+195, 96,147, 37, 18,137,214, 57, 56, 56,140, 41, 41,205, 21,192, 63, 95,225, 0,128, 86,171,205,205,203,203,243,169,207, 95, 30,
+192, 56, 75, 75,203, 49, 95,126,249,165,213, 59,239,188,131,189,123,247,126,186,125,251,246,220,130,130,130,255,161, 52, 17,102,
+180,145,154, 51,211,210,210,222, 21,137, 68,132,171,171, 43,165, 86,171,141, 49, 90,222, 40,157,132,249, 22,128, 77, 40, 77, 93,
+208, 29, 40,253,191, 3, 88, 89,110,220, 72,146,220,228,227,227,243,222,195,135, 15, 55, 3, 88, 82,223,255,186,131,131,195,214,
+141, 27, 55, 14,237,223,191, 63,149,153,153,233,220,162, 69,139,125,105,105,105,254,175,224, 50, 50, 86, 42,149, 78,111,222,188,
+121,147,232,232,232,152,130,130,130, 53,101,231,179,182,255,148, 11,128,158,150,150,150, 61,230,205,155,167, 8, 8, 8,192,182,
+109,219,222,221,190,125,123, 81, 97, 97,225,111, 40,237,211,243, 82, 38,144,166,233, 73, 73, 73, 73,182, 60,207,195,209,209,113,
+ 18,128,127,164,209, 34, 73,114,221,160, 65,131,198,236,219,183, 79,254,244,233, 83,185,179,179,115, 69,242,108,130, 32,234, 93,
+127, 10,188, 52,219, 42, 25,174,186,243,104, 73, 36,114, 49,203,150, 52, 78, 73,189, 63,244,205,174,235, 45, 0,224,210,197, 41,
+ 67,237, 28,154, 70, 72, 36,242, 24,169,185,236,216,160,126, 61, 91,190, 31,208,149,112,113,180, 67, 82,106,134,253, 15, 7,206,
+188, 29,124,230,252, 49,148, 38, 16,171, 22, 70,151, 3, 19, 93, 8,162,175,124, 15,219,110, 41,216,240,115, 18,174,223,139,135,
+ 42, 63, 11, 13, 28, 76,176,106, 90,111, 56, 88,201,235,119,235,101,231,213,157,161,165, 7, 63, 24, 49,210,226,189, 1,190, 34,
+119, 7, 7,240,188, 20, 49,113, 69,157,126, 57,123,190,237,209,195,251, 39,153,138,188,134, 21,103, 60, 50,248,226,214,202, 17,
+ 38,197, 58, 12,160, 41,226,163,206,109,154,244, 24,241,174, 63,217,196,183, 17, 34, 31, 60,236,125,226,247,208, 85,228,181, 7,
+191, 49, 44,191,219, 84,140,227,119, 82,107, 77,232,247,130,225,232,209,163,167,191, 84, 42,173,146, 60, 73,163,209,136,127,251,
+ 45,164, 67,125,204, 70,249,119,104,181, 26, 82, 36,146,128, 36,137,207,253,252,154,249,102,101,101,157, 39, 8,226,199,148, 20,
+227,162, 5, 83, 0, 73, 46, 77,183, 38,165, 82, 71, 86,171,181, 1, 0, 66, 34,201,141, 39,201,102,243,230,206, 85, 80, 20,197,
+101,103,103, 67,165, 82, 17,227,199,143,151,197,197,197, 13, 74, 78, 78,254,190,142, 59, 18,108,223,190,221,219,209,209,241,133,
+217, 99, 83, 83, 83, 37,253,251,191, 87,159,162,247,110,222,162,213,244, 51,103,126,245, 45,200,201, 45,217,190,118,107,152, 94,
+ 38,215, 52,244,245, 17,109,218,182,203, 98,194,152, 15,167, 68, 69, 61,184, 11,227,230,171,115, 51, 49, 49, 57,182,122,245,106,
+191,238,221,187,139,236,236,236,144,158,158,142,135, 15, 31,250,253,254,251,239, 3,118,237,218, 53, 67,173, 86, 15, 2, 12,154,
+ 16,213,235,183,221, 63,218,153, 90,219,128,213,235,225,212,188, 85, 69,126,179,216,223,207,130,209,233,192,233,245,240, 13, 24,
+ 80, 22, 77,230,225,235,235, 91,223,172,187, 78, 77,155, 54,221,179,116,233, 82,177, 70,163, 65,104,104, 40,206,159, 63,207,165,
+166,166,214,149, 16,151, 38, 8,226,236,194,133, 11, 93,186,116,233, 98,150,149,149, 5,150,101,109,143, 31, 63, 62,169,101,203,
+150,230,174,174,174,146,221,187,119,163,168,168, 8, 12,195, 88,123,122,122, 90,143, 24, 49, 66,187,123,247,238, 25, 0, 86,212,
+ 20,201, 42,136,227,231,167, 18,158,111,251,180, 30,133, 52,226,215,183,167,191,141, 95,204,223, 32, 42, 34, 91,111,123,122,154,
+ 21, 36,203,103, 41,204,155, 89, 23, 36,135,204,122,219,211,115,251,175,143, 13,186, 25, 34,203, 42,155, 15, 14, 28, 56, 32,127,
+248,240,161,220,215,215, 23, 28,199, 85,100,224, 47, 79, 56,235,229,229, 85,159,243,184, 60, 48, 48,112,214,208,161, 67,209,188,
+121,243,138,164,168, 95,125,245, 21,102,205,154,101,117,233,210,165, 25,251,247,239,159,241,211, 79, 63,173, 0, 48,219,200,104,
+ 76, 57,198,150,241,215, 79,158, 60, 25,114,236,216,177, 15,103,206,156,233, 5, 96, 50,128, 5,217,217,217, 93,203,162, 49,146,
+ 50,163, 53,118,198,140, 25,159,204,158, 61, 27,239,190,251,238,130,208,208,208,111,235, 25,229,163, 24,134,121,183,127,255,254,
+148, 94,175,135,169,169, 41,244,122,253, 27, 47, 27,148, 0,176,113,226,196,137,159, 4, 6, 6,194,202,202, 10,122,189,222,251,
+192,129, 3,219, 23, 44, 88,208, 17,192,184, 26,246,117,212, 39,159,124, 50,120,228,200,145,104,211,166, 13,104,186,244, 52,174,
+ 94,189, 26,139, 23, 47, 86,156, 61,123,118,192,238,221,187, 7,156, 56,113,226, 40,170, 78,219,101, 20, 28,199,129,166,105, 36,
+ 38, 38,194,206,206, 78,202,113,220, 25,130, 32,182,229,228,228,252,244, 15,170,204, 87, 14, 25, 50,228,131,125,251,246, 41, 0,
+ 96,213,170, 85,152, 62,125, 58,236,237,237,161, 80, 40, 4,171,243,207,137,104, 77,168, 51,162, 85, 23, 42,149,170,213,156,207,
+ 62, 2, 73,150,222, 53, 54,106,232,134,101,115, 39, 16, 39,130,207,180,170, 53, 6, 47,115, 66,244,149,239, 33,117,157, 6,141,
+158,193,141,123, 79,112,110, 85,159,210,218,242,157,121,208,232,122,148, 87, 54,214, 18, 19,147,149, 90,150,189, 10, 7,135, 80,
+ 60,123,150, 89,151,201, 82, 58,216, 7,111,217,178,194,196,239, 13, 31,232, 24, 61,146, 51,146, 65, 16, 82,184, 56,155, 97,236,
+168,119, 68, 93,187, 58,217,126,253,245,214,211,105, 28, 6,170,178, 30,213,153, 48,212,219, 22, 59, 91,249,121, 13, 29,209,183,
+139,180,153, 95, 83,136,165, 38, 21,239,181,110,211, 6,173,219,180, 33,103, 23, 21,246,186,121, 43,172,215,145,179, 55, 52, 42,
+253,179, 67, 49, 89, 24, 93,199, 69,166,194,112, 76,157, 58, 21,246,246,246, 85, 54, 72, 79, 79,199,239,191,255, 86,237,103,140,
+184,144, 85,124,199,183,223,126,107,150,155,155,251,206,142, 29, 59,222,226, 56,238,219,180,180,180, 43,134,136,140, 4, 26,228,
+ 75,165, 61,198,172, 89,195,181,124,239, 61,202,210,193,129,228, 88,150, 72,121,252,216,102,237,247,223,119,203,137,141, 53, 41,
+182,182,206,201, 85,171, 85, 49, 49, 49,144,201,100, 4, 77,211,109,171,145, 74,231,121,172, 36, 73, 98, 22, 65, 16,144, 74,101,
+ 49,129,129,129,119,202,222,107,112,234,212, 41,121,191,126,253, 84, 0,158, 2,128, 84, 42,115,166, 40,210,187, 52, 19, 59, 86,
+ 26, 98, 48, 77, 77, 77, 63, 91,178,116,133,105, 65, 78,158, 90, 87, 92,172, 87,154, 43, 8, 66, 97, 70, 21,228, 23, 22, 38,167,
+102,106,230, 45, 90, 76, 77, 28, 59,242,179,226,226,226, 73,134,154,172, 22, 45, 90,220, 60,118,236,152,157,141,141, 13,242,242,
+242,144,157,157,141,155, 55,111,130,227, 56, 12, 26, 52, 72,218,169,125,187, 86,115,231,205,191,158,152,156,220,209, 16,179,101,
+106,109,139, 85, 93, 90,150, 86,214, 79,179, 43,202,103,219,144,128,138,109, 22, 39,229,151, 71,231, 94,102, 10,169,142, 61,122,
+244, 16, 3,192,184,113,227, 10, 10, 11, 11,151, 1,216,135,186, 51,250,207,152, 63,127,190,115,195,134, 13,221,247,237,219,135,
+162,162, 34, 0,176,107,216,176, 33,188,189,189,217, 11, 23, 46,192,219,219, 27,102,102,102,184,116,233, 18,174, 95,191,142, 54,
+109,218,152,137,197,226,161, 58,157,174, 90,163,213,173, 79,183,249,210,126,190,254, 62,173, 71, 65, 97,238,136,237,251, 15, 34,
+ 58,108,151,191, 70,247,112,190,152,189, 56, 82,205, 75, 71,103, 38, 40,102, 55,104,211,213,166, 81,211,247,224,222,250,142,109,
+ 9,123,249,201,252, 94, 13,151,211,178,146, 93,139,214,164,102,215,100,178, 0,172, 26, 52,104,208,144, 3, 7, 14, 88, 2, 64,
+120,120, 56,210,211,211,161, 84, 42, 33,147,201, 32, 18,137, 42,230, 39,173, 39,163, 55,109,218, 84, 97,218, 24,134,169,152, 5,
+ 64, 46,151,227,205, 55,223, 68,203,150, 45,241,211, 79, 63,141,174,193,104,117,105,223,190,253, 94,119,119,119,215,202, 47, 22,
+ 23, 23, 99,248,240,225, 0,128,174, 93,187,246, 48, 49, 49,225,203, 13, 97,106,106,106,209,173, 91,183,122, 1, 8,173,193, 89,
+170,147,147,147,241,229,151, 95, 34, 62, 62,254,211, 45, 91,182, 60, 3, 32,147, 72, 36, 21,247,199, 0,188,155, 54,109,186,110,
+250,244,233,136,139,139, 67,100,100,228, 77,212,191, 41,149, 53, 53, 53,141,213,235,245,109, 24,134,129, 90,173,198,192,129, 3,
+101, 71,143, 30, 77,167, 40, 42, 42, 43, 43,235, 67,148,246, 73, 49, 20, 25,128, 53,129,129,129,159,204,156, 57, 19,191,253,246,
+ 27, 78,156, 56,129,145, 35, 71, 98,218,180,105, 80, 40, 20, 99,166, 77,155,118, 29,165, 19,154, 63, 79,143, 77,155, 54,129,101,
+217, 23,254, 27, 50,153, 12, 93,186,116, 65,147, 38, 77,112,226,196,137, 30, 47, 97,180,220,187,116,233, 34,225, 56, 14,197,197,
+197,184,112,225,130,194,196,196, 68,225,226,226, 50, 30,192, 63,198,104,185,187,187, 7, 30, 56,112, 64, 81,185,245, 71, 42,149,
+162,210,239, 64,224,239,143,104,213,122,135, 85,129, 86,171,210,209, 52, 25,229,228,216,252,208,165,139, 83, 42,154, 14, 1, 50,
+ 74,171, 85,233, 0,128,229,120, 20,168, 24,152, 72, 73, 60, 77, 43,196,131,199, 89,213, 73, 85, 25,162, 41, 50,113,131,180,170,
+ 8,231,172, 0, 0, 32, 0, 73, 68, 65, 84,221, 83,240, 60, 15,173,142,133, 38, 63, 13,203, 78,171,240, 48,169, 4,218,226, 92,
+104,117,165,221,176,108,109,109,233, 51,103,126,153, 30, 18,242,251, 39,255,251,223,255,168, 36, 11,139,200, 66,160, 85,117,154,
+ 86, 86,158,102,156, 68,114,104,243,150, 5, 38, 60,245, 24, 49, 9,197,104,228,210, 14,182,150,174, 72,203, 42,198,213,200,159,
+ 17,245, 40, 24, 13, 29,221, 49,237,179,183,101, 75,150,238, 59, 40,102, 60,220,242,242,226, 11,106,218,207,242,187,168,173,191,
+198,128,201,121, 12, 54, 59, 14,108, 97,202, 11, 27, 40,148,110,104,221,221, 25, 74,215, 55,164,163,167, 45, 30, 5, 84, 49, 90,
+149, 53,211, 9,130,220, 76,146,196, 39, 4, 65,160,121,243, 22, 73,107,214,172,169, 46, 21,184,174,121,243, 22, 73, 20, 69,186,
+148, 94,216,201, 77, 60,207,165,215,177,159, 85, 76,141, 68, 34,157, 89, 26,246,119, 76, 60,125,250,180,110,200,144, 33, 88,189,
+122,181,100,214,172, 89,243, 40,138, 26, 87, 77,243, 94, 21,205,129,128,155,229, 27,111,244,254,246,234, 85, 94,164,215, 19, 57,
+ 55,111, 22,228,165,166, 50,105,133,133,146,195, 81, 81,239,126,252,197, 23, 18, 87, 87, 87, 92, 9, 14,182,201, 44, 46,230,243,
+ 52, 26,117, 94, 94, 30,207, 48,204,205, 26, 52,231, 40,149,118,242,237,219,183,123, 7, 6, 6,222, 73, 77, 77,157, 3, 0,142,
+142,142,203, 0, 52, 1,240,180,210,107,216,178,229, 96,242,248,241,227, 99, 50, 50, 50,230,212,182,159,149,104,106,167,180,147,
+239,223,186,251,190,181,153, 9,169,116,113, 34, 69,150,150, 52, 35, 49, 17,115,128,186,161,235, 27,166, 0,154,214,240,217,231,
+ 53, 9, 19, 19,147, 99, 39, 79,158,180, 19,137, 68, 96, 89, 22, 74,165, 18,241,241,241,200,203,203, 67, 97, 97, 33,158, 68, 61,
+132,135,171, 43,190,158, 61,203,113,242,172,217,199, 84, 42, 85,155,231, 42,179, 23, 39, 64,214,235, 94,136,236, 85, 55,139,193,
+243,205, 94, 6,150,123,101,226, 19, 18, 18,160, 80, 40,224,231,231,167,184,122,245,234,229, 90, 76, 86,229, 73,128,135,118,238,
+220,217,108,223,190,125,104,211,166, 13, 44, 44, 44,112,225,194, 5,132,135,135, 67,167,211,145, 69, 69, 69, 80, 40, 20, 88,190,
+124, 57,220,220,220, 80, 88, 88,136,167, 79,159,218,136, 68, 34,219,231, 50,218, 87,104, 94, 56,115, 97, 73,126,220,249,249,105,
+196,175,111,111,223,127, 16,227, 71, 12,131, 3,255,248,178,197, 27,196,146,222,253, 58,127,197, 83,174, 1,166,102,205,173,188,
+252,250, 65, 44, 81, 96,242,204,197,136,137, 56,101,165, 42,188,255, 41,193, 38,186, 46, 90,115,120,106, 53,199, 78, 0, 32, 93,
+ 93, 93, 63, 62,124,248,176, 89, 69,232,133,162, 42,230, 60,172, 60, 9,124, 45, 19,190,215,121, 62, 9,130, 64,124,124, 60,236,
+236,236,160, 80, 40, 42, 38, 16,127,248,240, 33,110,220,184,129,242,217, 40,106,208,252, 48, 36, 36,196,213,212,212,180,202, 6,
+ 60,207, 35, 43, 43, 11, 12,195, 64, 46,151,131,101, 89,232,116, 58,232,245,122,148,148,148, 40,154, 52,105, 50, 73,175,215,135,
+ 86,167,201,113,220,231, 67,135, 14,237, 28, 26, 26,234,249,253,247,223, 67,171,213,174, 74, 75, 75,195,224,193,131,193,113, 28,
+122,244,232,209,129,231,249,232,121,243,230, 1, 0,166, 79,159,174, 47, 46, 46, 14,172,207,177,151,209,164,117,235,214,158,191,
+253,246, 27,252,253,253,161,209,104,176,122,245,106,243, 45, 91,182,152,239,222,189, 91, 57,115,230,204, 31, 51, 51, 51,251,212,
+161, 73, 0, 88,229,224,224,240, 73,183,110,221, 76,202,230, 48,197,174, 93,187,240,245,215, 95, 31, 0, 48,239,151, 95,126, 89,
+120,226,196,137, 81, 31,127,252, 49,190,254,250,235,105,121,121,121, 59,106,210,124,242,228, 9,148, 74, 37,204,205,205, 75, 47,
+150, 58, 29,238,222,189,139,115,231,206,161,113,227,198,134, 28, 83, 77,251,233, 62,104,208,160, 31,247,239,223,111,150,152,152,
+136, 75,151, 46,193,195,195, 3, 42,149,202,144,185, 97, 67,254,132, 10,187, 70, 77,181, 90, 93,146,144,144,160, 88,177, 98, 5,
+ 28, 29, 29,225,238,238, 14,153, 76, 6,130, 32,160,215,235,107,155, 94,173,206,253,236,218, 21,116, 86,178, 85,127, 11, 75,171,
+ 79,121,158,167,243,243,115,183,234,144,119,228,241, 99,104,255,194, 99,255, 55,211, 10,192, 29, 84,157,243, 48,181,194,104, 5,
+ 7, 7,243, 1, 1, 1, 68,249,218,217, 25, 5, 89, 89, 86, 49,118, 14,205, 14,218, 57, 52, 45,155,247,139,140,162, 40,171, 24,
+123,123, 85, 1, 0,232, 24, 30,215,162,242,112, 63, 54, 13,225,177,105, 48,149, 26, 22,124,209,232,152,210, 30,171, 60,143,146,
+162, 63,110, 90,117,170, 92,104,116,165,221, 61,180, 26, 21,242, 51, 35,137, 33, 3,123,201, 62,249,100, 34, 28, 29,157,149, 53,
+233,233,164,178,105,147,167,191,107,105,109, 41, 66,240,213, 95,209,161,241, 64,200,164, 34,100,231,151, 0, 4,240,232,241, 57,
+128, 51, 67, 68, 76, 2,218, 55,149,163, 79,111, 95,197, 79, 71,162,191, 0,176,192,144,253,101,146,110, 66,236,245, 14, 68,172,
+ 30,250,172,104,112,121,207, 0, 83, 7,168, 9, 5,178, 83,159, 33,234,242, 81,131,238, 25, 57,142,251,212,214,214, 54,111,222,
+188,121,221, 26, 53,106,164,155, 52,105,210,189,103,207,158,125,254,220,221,202,119,155, 54,109, 66,108,108,108,242,183,223,126,
+123, 33, 43, 43,107,190,145, 5, 61,155,231, 17, 84,214, 20,151,117,252,248,241,214, 23, 47, 94,156, 22, 20, 20,100, 63,101,202,
+ 20,201,148, 41, 83,198, 2,248,166,182,230,194, 2,169,180,231,183,151, 46,241, 76, 82,146,102,207,250,245,146,141,215,174,205,
+211,113,156,147,173,157, 29,209,169,125,251, 98, 57, 73,102,101,167,167, 51, 74, 79, 79, 42,254,220, 57, 27,222,196, 36,229,151,
+ 95,126, 41, 40, 42, 42,170,113,234, 28,138,162, 84,213, 53, 23, 86,135,163,163,163,182,186, 62, 92,181, 84,136, 5, 28,207,235,
+ 44, 27, 54,228,123,247,232,216, 40, 54,250,241, 99,153,165, 37,229,213,200,195,231, 65, 84,252, 77,158,101, 75, 8,130, 40, 48,
+168,173,132,162,134, 5, 5, 5, 53, 51, 55, 55, 7,199,113,176,176,176, 64,102,102, 38,180, 90, 45, 10, 10, 10,160, 45,204,135,
+ 54, 63, 31,225,207,226,209,185, 91, 55, 12,121,187,183,239,238,227, 39,135,177, 44,123,160,214,246,188,230,173, 42, 34, 89,139,
+ 27,216,252,209, 22,148,152, 87, 97,186, 86,180,242,130, 88,161, 64,175,207,103,191,204, 31,253,206,233,211,167,127, 30, 52,104,
+208,187, 95,124,241, 5,153,154,154,250,107,124,124,124,103, 0,145,181,125, 72,161, 80,188,145,149,149,133,162,162, 34, 88, 88,
+ 88, 32, 40, 40, 8,246,246,246, 80,169, 84,184,117,235, 22,239,226,226, 66, 92,184,112, 1, 46, 46, 46,200,206,206,134, 78,167,
+131, 90,173, 78,211,106,181, 53, 54,151,151, 53, 15,190, 51,253,109,252, 18, 29,182,203,223,153,120,114,107,232,140,174,177,209,
+225, 81, 9,103,207, 93,253,134, 41,145, 37,230, 37,133,204,106,216,246,142,237,167, 95,126,141, 13,171, 22, 34, 58,244, 82,142,
+189, 91,193, 70, 19, 66,179,179,182,253, 45, 46, 46, 46,137,138,138, 50,187,119,239, 30, 8,130,128,133,133, 5,228,114,121,181,
+102,171, 30,144,149, 35, 80,197,197,197, 16,139,197,176,177,177,193,142, 29, 59, 42, 42, 94, 15, 15,143,218, 52,182,246,234,213,
+107,152,155,155,155, 89,229, 23,219,182,109,139,137, 19, 39, 98,243,230,205,184,118,237, 90,149,249, 52,211,210,210, 82,245,122,
+125,109,199,157,151,158,158,254,246,192,129, 3,195, 46, 95,190,108,190, 99,199, 14, 48, 12, 83,237,178,125,251,118,220,184,113,
+ 99, 1,128,168,122,254,142, 26, 15, 30, 60,248,210,222,189,123, 45, 51, 51, 51, 81,254,219, 40, 46, 46, 6,203,178,240,241,241,
+ 33, 24,134,169,171,223, 27, 73, 81,212,241,245,235,215,247, 27, 63,126, 60,104,154,134, 86,171,197,250,245,235, 49,107,214,172,
+244,178,155, 82, 29,128,121, 59,119,238, 28,245,222,123,239,161, 69,139, 22,190,231,207,215,220,179,163,168,168, 8, 69, 69, 69,
+ 16,137, 68,112,112,112,192,146, 37, 75,160,213,150, 94, 86,188,189,189, 43,254,198, 0,182,122,123,123,247,139,137,137, 89,141,
+210,190,107, 47,224,224,224, 48,144,231,249, 9, 44,203, 22,250,251,251,219,236,223,191,223, 44, 57, 57, 25, 97, 97, 97, 88,176,
+ 96, 65, 46,199,113, 44,199,113,132, 90,173,126, 98,103,103, 23, 38,149, 74, 77, 84, 42, 85, 78,118,118,246, 82, 0,191,254, 93,
+ 53, 57, 65, 16,132, 72, 36,194,184,113,227, 64,211, 52, 76, 76, 76, 80, 82, 82, 2,189, 94, 95, 97,230, 97,100,179,116,163, 70,
+ 10, 27, 26,226,241, 86,102, 77,166, 13,153, 26,160,116,116,114,134,165,185, 20, 15, 31, 70,118,254,253,183,115,235, 37,116,244,
+ 22, 78,171,223, 18,253, 52,255, 79,159,236,254,121, 47,242, 47, 53, 90, 47,204,121, 72, 87, 95,152, 67, 88,158, 63,156,149,156,
+ 44,209, 73, 36,242,152,242, 40,151,189,189,170,128, 32,134,176,202,166,253,193,232,244,101, 23, 10,190,108, 49,208,104,233, 89,
+196, 70, 71,224,242,217,147,176, 85, 37, 35,235, 73, 75, 64,220, 12, 90,117, 62, 74,180,186, 50, 83,194,226, 94,216,111, 40,200,
+207,129, 95,155, 0,128, 36,111,212,164,103, 97, 67, 4,116,106,221,156,138, 77,136, 64, 91,239,247,225,233,226,143,103,169, 5,
+200, 43,210, 32,183,160, 4, 45,253,102, 35, 51, 87,141, 2, 85, 9, 34, 99,119,195,217,201,147, 36,232,199, 61, 12, 53, 90,154,
+200, 99,208, 68,157,128,216,189, 51, 36, 62,239,129,114,239,130,132,251,231,113,239,151,181, 72,122,112, 5, 60,199,254,159,189,
+235, 14,139,226,106,191,103,102, 59,187, 75,239, 69,177,130, 98,239, 13, 69,108,104,236, 29, 75,172,209,168,216, 27,106,172, 81,
+209,104, 98,239, 37, 6,123, 55, 98, 23, 21, 11,118, 64, 64,172,244,178, 82,151,182,125,103,103,126,127, 80,130, 72, 89,208,228,
+251,126,249,246, 60,207, 60,187, 51, 59,115,246,157,123,239,220,123,230,189,247,190, 23,246,174,109,245,125, 72,118, 92,191,126,
+189,109,167, 78,157,216, 61,122,244,104,126,245,234,213,230, 18,137, 36,172, 80, 96, 52,239,209,163, 71,115,107,107,107,108,219,
+182, 77, 65, 16,196,142,106,102,118,177, 7, 44, 45, 45,237, 25,128,117,231,207,159,223, 49,117,234, 84,216,216,216, 52, 77, 73,
+ 73, 41,247,194,116, 14,167,249,248,245,235, 25, 14,139,197,156,220,185,147,187,250,250,245, 95,127, 63,114,132,219,205,211,147,
+ 96, 24, 6,161,161,161,194,141, 59,119, 10, 71, 15, 28, 24, 23,159,150, 70, 5, 5, 7,107, 36, 73, 73,121,105, 50,217,106,137,
+ 68,242,233, 63, 81,178,181, 90,237,227,152,216, 24,199,214,237, 90, 88,135, 68,197, 68,122,117,235,216,145, 36, 73,242,109,116,
+124,176,181,181,137,240,214,205, 91, 26,173, 86,251, 88, 31, 46, 62,159,223,175, 91,183,110,108,169, 84, 10, 7, 7, 7,164,167,
+167, 35, 57, 57,185,192,227,144, 35,133, 38, 39, 7,218,220,108,232,100,249,136,121,254, 12, 45,234,214,225,159,225,243,251,201,
+229,242, 10,133, 86,209, 91,102, 89, 11, 93, 23, 29,227, 25, 27,131, 39, 22,131,168,122,183,225, 64, 51, 51,179,197,217,217,217,
+ 87, 1,172,213,104, 52, 62,139, 23, 47,110,179,125,251,118,171,117,235,214,153, 76,153, 50,229, 76,126,126,126, 11, 20, 44,170,
+ 90, 94, 3,246,145,162, 40, 75, 0,182,129,129,129,176,177,177, 65, 78, 78, 78,145,167, 69, 45,151,203, 5,153,153,153, 80,169,
+ 84, 80,171,213, 48, 49, 49,193,139, 23, 47,178, 40,138,186, 92,153,113, 38,245,136,181, 42, 77,212, 79,150,110,162, 20, 13,101,
+238,145,150, 69, 75, 87,253, 42, 89, 3,224,215,222,117,235, 30,208,208,247, 99,222, 71, 92, 54,143,125,126, 47, 43,229,189,172,
+238,193,171, 49, 21,141,209, 98, 0,208, 4, 65, 48,174,174,174, 72, 79, 79, 7,139,197,130, 80, 40,132, 88, 44,198,146, 37, 75,
+176, 99,199,142,234, 8, 45,129, 72, 36, 90, 79,146,228, 72,146, 36,173,117, 58, 29,124,125,125,209,191,127,127,240,120, 60,104,
+ 52,154, 98,143,102,145,151,170, 18, 79, 71,232,147, 39, 79, 76,158, 60,249,172,218,242,180,178,178,186,163, 82,169, 16, 29, 29,
+141,139, 23, 47,118, 5, 16, 84,197,188,142, 14, 13, 13,237,237,238,238,254, 71,171, 86,173,234, 49, 12,131,166, 77,155,194,219,
+219, 27,254,254,254, 8, 11, 11, 67, 78, 78, 14,125,235,214,173,223, 1,108,174,106, 27, 94,152,190, 13,134, 14, 29,250,240,248,
+241,227,230,153,153,153, 80, 40, 20,144,201,100, 56,115,230, 12, 58,117,234, 4, 43, 43, 43, 28, 59,118,140, 98, 24,166,162,188,
+ 39, 73,146, 60,184,119,239,222,254,147, 39, 79,198,174, 93,187,112,242,228, 73, 12, 24, 48, 0, 35, 71,142, 68,122,122,186,237,
+166, 77,155,198, 21,118, 19,174,244,246,246, 70,126,126, 62,158, 63,127, 30,165,231, 51,143,236,236,108,100,103,103,195,200,200,
+168,228, 51, 70, 0,240,223,178,101,203,168, 57,115,230,160,110,221,186, 43, 99, 98, 98,182,160,140, 89,162, 52, 77,255,152,156,
+156,108,206,102,179, 45, 41,138, 66, 98, 98, 34, 94,188,120,129, 25, 51,102,100,101,101,101, 77, 5, 16, 15, 96,217,164, 73,147,
+214,206,155, 55,175,184, 44,205,155, 55, 47,224,234,213,171,189,255,105,111,142,171,171, 89, 99, 30,139, 63, 91,154,199,178,148,
+ 74,165,197,117,135, 90,173,134, 74,165,250,204,147,197,229,114, 44,219,180,168,121, 69, 33,207, 91,250,250,125,118,185, 11,164,
+187,213, 51,109, 38, 20,153,206,233,212,185,219,152, 94,189, 7,177, 40,173, 22, 55,110, 92,198,161, 67,187,225,233,238,138,186,
+245,155, 98,230,172,217,166, 42, 53,229,123,235,214,245,197,102, 79, 30, 92,207,203,205, 94, 82, 17,231,255, 56,174, 20,138,171,
+ 43,101,118, 29,150,165, 32, 11, 67, 56, 72, 11,119,173,204,205,205,119,234,116, 58, 79, 19, 19, 19,208,217,239,240,250,197, 83,
+100, 73, 57, 80, 41,116,160,153, 2,177,165,151,112, 81,169,113,255,198, 37,108,221,242, 43, 50, 51, 51,225,222,165, 43,242,217,
+ 53, 80,179, 70, 77, 40, 21,242,194,135, 6,208,168,181,176,182,117, 70, 72, 72,152, 54, 87, 38, 43,183, 66,226, 10, 52,110, 53,
+109, 93,161,210,116,128,128,199, 67, 78,158, 26,210, 66,145,117,236,236, 8,168,228, 10, 80,106, 13, 40,181, 22,214, 53,135,162,
+161,109, 55,208,186,203,141,171,148,124,180, 14,154,216,251,208,196,222,135, 81,135, 89,248,211,111, 84,169,134, 84,191,117,119,
+211,211,211,211, 34, 35, 35, 47,135,134,134, 14, 30, 49, 98, 4,238,222,189, 59, 5,192,180,194,238,155, 41, 35, 70,140, 64,104,
+104, 40, 34, 35, 35, 47,167,167,167,167,125,139,156,231,241,120, 10,149,170,160,141, 21, 10,133,130, 74,206,117,108, 51,100, 8,
+153, 19, 18,146,187,229,209,163,149, 7, 14, 30,228,246,232,222,157,208, 82, 20,104,157, 14,245, 93, 92,136, 94,189,122,137,252,
+ 79,159,182,100,105,181, 79, 22,250,248, 4,238, 25, 59, 54,239,153, 76,166,239, 64,243, 90,133, 93,134, 0, 80,171,130, 99,122,
+ 67,165, 82,109,255,241,135, 9, 61,130,238, 63,172, 81,179,134,163,201,141, 91, 65, 97,124, 35, 30, 89,183,118, 61,150, 52, 39,
+139,189,102,229, 82, 35,149, 74,165,175,104,117,179,178,178,194,167, 79,159,240,225,195, 7,168, 84, 42,104,181, 90,208,114, 25,
+212,210,108,168,115,178, 64, 40, 21,224,235,116, 80,102,164,162, 86,221, 58,192, 95, 51, 18, 43,237,138, 42, 75,104, 21,125, 10,
+ 76, 76,192, 21,137, 65,114, 56,122, 47,142, 14,160, 85,219,182,109, 79,159, 59,119,142, 59,113,226,196,118,183,111,223,222, 9,
+ 32, 62, 57, 57,185,251,242,229,203,159,237,220,185,147, 63,117,234,212, 6,155, 55,111, 30, 7, 96, 95,121, 36, 74,165,242,244,
+149, 43, 87, 70, 59, 59, 59,219,134,135,135, 67,169, 84,130,166,105,244,233,211, 7, 40, 24, 91, 3, 0,120,251,246,173, 66,169,
+ 84,166, 69, 68, 68,228,198,199,199,107,160,199, 44,193, 85,219, 37,143,115, 63,221, 31, 98,107,231,248, 68, 96, 84,171, 54,147,
+ 31, 50,120,238, 48,199, 77, 91,206, 38, 43,175, 71, 71,231,253,212,179,206, 6, 89,222,171, 25,102, 78,249,187,174, 7,196,232,
+ 51, 16,190,120,118,161,165,165, 37,216,108, 54, 56, 28, 14,184, 92, 46, 8,130,192,172, 89,179,176,127,255,254,202,186, 14, 63,
+ 19, 89,198,198,198,145,171, 87,175,118,154, 58,117, 42, 87, 32, 16, 64, 42,149,226,216,177, 99,152, 52,105, 18, 14, 29, 58, 84,
+230,248, 23, 61,186,148, 74,123, 75,231,140, 29, 59, 22,106,181, 26,222,222,222, 56,112,224,192, 28,157, 78, 23, 84,141, 71,250,
+ 73, 88, 88,152, 75, 88, 88,152, 9,128, 1, 35, 71,142, 60, 50,116,232, 80, 4, 5, 5,225,242,229,203, 93, 81, 48,233, 67, 1,
+192, 15,128, 77,225,103, 69,207,167,200,214,214,118, 55, 77,211, 3,172,173,173,195, 92, 93, 93,155, 28, 63,126,220, 44, 45, 45,
+173,104,242, 3, 98, 99, 99,113,248,240, 97,201,193,131, 7,115,117, 58,157, 37, 73,146, 87,178,179,179,151, 84, 32,216, 14,110,
+217,178,101, 66, 97,119, 32,206,157, 59,199,252,250,235,175,196,242,229,203, 33,149, 74,225,233,233,137,189,123,247,206,206,207,
+207,111,254,235,175,191,254, 48,124,248,112,172, 89,179, 6, 50,153,108, 75,101, 47, 43, 21,136, 47, 2, 64,199, 45, 91,182, 56,
+207,153, 51, 7,231,206,157, 67,171, 86,173,140, 98, 98, 98,246, 0,152, 92, 86,254, 49, 12,131,152,152, 24,200,229,114, 60,124,
+248, 16, 43, 87,174,148,150, 16, 89,179,167, 77,155,182,118,246,236,217, 88,191,126, 61, 19, 30, 30,158, 54,116,232, 80,219,253,
+251,247,179,234,215,175, 63, 91, 46,151,255, 99, 66,171, 65,125,139, 13,109, 90,117, 94,108,239, 88, 31,199,142,159, 64, 86, 86,
+ 86,113,154, 20,165, 11,195, 48,200,203,203,195,167, 79,159, 96,106, 98,140, 77,155,215,126, 55,125,202,132, 26, 40, 8,131,241,
+165,203,178,174,249,230,161, 35, 39,206,247, 30, 61, 1,225, 97, 47,225,127,100, 31, 34,194, 67,139,249, 40,173, 6,239,162, 94,
+224, 93,212, 11,216,218, 57,163, 87,143,174,196,168, 81,163,250,140, 29, 61,210, 26,192,223, 22, 58,226,255,177, 55, 11,248, 50,
+142,214,254,207,132, 86, 37,238, 58, 43,115,115,243,200, 83,167, 78, 89,186,187,187,179, 40,138,194,245, 27, 55, 48, 99,218,247,
+ 24, 55,214, 23, 26,152,131, 82,115, 65,115, 5,122, 89,162, 80,200,193,128,129, 76, 38, 67,112,112, 48, 24,154,130,255,254, 95,
+193, 48,116,177,208, 2, 24,168, 53, 26, 56,214,108,128,221, 7,214, 81,224,112,158, 65, 91,118,232,154,220, 76,150, 78, 75, 49,
+ 72, 78, 75, 64,130, 36, 2,166,198, 53,193,230,212, 68,102,182, 28,108,210, 14, 90,229, 91,232, 10,175,149,203,146,160,208,124,
+ 93,254,233,202,240,158, 50, 85,168,116, 21, 10,197,209,163, 71,143,126,247,219,111,191,241,250,246,237,235,122,246,236,217,142,
+ 0,208,183,111, 95, 87, 19, 19, 19, 28, 61,122, 84,173, 80, 40,142,126, 67,143, 79,183,182,109,219, 66, 42,149, 34, 54, 54, 54,
+172,194,123, 83,171, 45,197, 54, 54,172,180,187,119,181,233, 82,105,141,110,221,186, 17, 90,138, 2, 73, 16,200,202,201, 65,124,
+ 92, 28,204,204,204,136,200,183,111,197, 59,102,206,188,224,218,164, 9,187,104, 70,162, 62,184,124,249,178, 16, 5,227,178, 42,
+ 60, 86, 69,200,210, 82, 63, 77,240,241,241,185,112,244,232, 49,211,212,180,212,119,124, 30,143, 18,139, 5, 14, 99,199, 76,103,
+103,103,103,143, 6,144,175, 47,153, 84, 42, 69, 76, 76, 12,140,140,140,192,229,112, 64, 43,228,208,201,242,161,204, 74, 7, 75,
+163, 6, 79,167,131,133,144,143, 26,182,182,168,105,109,165, 23,231,135, 59, 55,139, 7,190,151,236, 46,220,212,214, 13, 60,145,
+ 24, 60, 99, 49,166, 7,220, 43,124, 27,229, 2,203,127,214,135,214,202,209,209,241,207,227,199,143,115,211,211,211, 17, 26, 26,
+ 26, 6, 32, 7,128, 49, 0, 58, 42, 42,234,118, 68, 68, 68,191,194, 89,119,149,205, 22,251,245,252,249,243, 61,221,221,221,169,
+218,181,107,139,210,210,210,106, 72,165, 82, 90, 34,145,124,230, 18,186,121,243, 38, 63, 47, 47, 79, 70,211,244,133, 66,145, 85,
+105,252,162,185,195, 28, 5,193, 33,152,229,225, 85,171,169,137, 85, 51,100, 81, 33, 77,159,132, 73,102,205, 29,230,184,125,203,
+217,100,165, 17,161, 58, 66,232, 18,107,176, 5, 74,125, 7, 49, 51, 64,193, 88,169,224,224, 96,196,199,199, 35, 38, 38,230, 51,
+ 65, 53,101,202, 20,248,251,251,235,229,209, 18,137, 68,235, 87,173, 90,229, 52,103,206, 28,110, 9, 81, 4, 31, 31, 31,228,228,
+228,224,192,129, 3,240,241,241,169,114,195, 95, 10,117,186,117,235,214,215,222,222, 30,153,153,153,176,179,179,131,187,187,123,
+255,160,160,160,218, 0, 98,171, 89,238,167,123,121,121,173, 93,189,122, 53,180, 90, 45, 38, 77,154,132,247,239,223,159,126,255,
+254,253,214,154, 53,107,206, 90,180,104,145,173,173,173, 45, 70,140, 24, 33,162, 40,106, 72,121, 36, 22, 22, 22,126,251,246,237,
+ 27,221,183,111, 95, 82,163,209,116,185,115,231, 14,226,226,226,160, 86,171, 65, 81, 20, 62,126,252, 8, 31, 31, 31, 73,225,236,
+198,143,122,216, 53,113,217,178,101, 19,102,205,154,133,141, 27, 55, 98,213,170, 85,191,155,154,154, 54,105,209,162, 69,203, 85,
+171, 86, 97,225,194,133,112,118,118,134,165,165,101,195,229,203,151,187,205,155, 55, 15,219,183,111,199,202,149, 43,127, 7,112,
+184, 58, 9, 65,211, 52,177, 97,195,134,230, 91,182,108,177, 47, 18, 89, 36, 73,226,212,169, 83, 8, 9, 9,233, 31, 29, 29, 93,
+214, 53,123,237,236,236,166,216,219,219,243,110,221,186, 37,118,118,118, 6, 69, 81,218, 66,145,181,163,102,205,154, 51, 62,126,
+252,136,190,125,251, 34, 58, 58,250, 40,128,113,166,166,166,178,121,243,230, 9,141,140,140, 76,229,114,249, 63,213,120,131, 69,
+ 18,227,215,175, 89,136,231, 33,111,113,254, 60, 23,207,159, 63,135,173,173, 45,248,124, 62, 24,134,129, 74,165, 66,122,122, 58,
+180, 26, 21,154, 54,174,131, 63, 14,110, 64, 90, 90, 58, 64, 18,229, 14,185, 33, 72, 98,204,132,239, 7,227,193,195, 27,216,179,
+103, 31,242,243,101,229,188,124, 11, 80,223,213, 13,142, 14, 54, 72, 76, 74, 4, 65,194,234,239,188,215,255,231, 93,135,197, 85,
+ 16,244, 9,239, 80, 18,102,102,102, 91, 79,158, 60,105,233,233,233,201,146,201,100,160,105, 26,157,221,221, 49,107,206, 28, 92,
+ 62,126, 28, 46,237,188, 65,168,197,160,132,250,205,122, 80, 42,228,104,212,178, 35,134,143, 24,137,132,248,120,120,245, 27, 10,
+165, 82, 94,252,134, 81,228,209, 82,171, 53,176,178,169,129,155, 55,111,178, 48,105,210,107,236, 40,219, 41,161,211,240, 94,189,
+251,168,236,148,173, 8, 65,240,115,127,104, 84, 26, 52,109,186, 28, 26,218, 18, 54, 78, 83,160,213, 94, 68,110,250,157,130,110,
+ 12, 75, 79, 36, 37, 36,128,100,113, 35,171,155,130,180, 44,253,171, 42,221,156,156,156,156,152,152,152,179,193,193,193, 99,134,
+ 12, 25,130,155, 55,111,254, 0, 0, 67,134, 12, 65,112,112, 48, 98, 98, 98,206,230,228,228,228,124,139,220,182,183,183, 31,208,
+181,107, 87,239, 54,109,218, 32, 32, 32, 0, 12,195, 60,208,235,193,230,112, 24,146, 36, 65,211, 52, 8, 0,153,217,217,120,255,
+254, 61, 50, 51, 50,160,213,106, 33,203,207,167,221, 92, 93,243, 25,154, 54,174,138, 61, 37,103, 24,162,140, 89,135, 69,199,170,
+113,171,241,207,158, 60, 74,200,203,207,183, 54, 55, 51,207,227,241,120, 58,105,118,118,206,235,200,112,181,158,141, 67, 17,162,
+ 34, 34, 34,154,164,164,164, 32, 33, 33, 1,148, 44, 15, 44,149, 26,164, 74,142,238, 29, 59,192, 8, 12, 4,160,193,161,181,224,
+176, 56,200, 43,152,157, 87,105,119,135,174,196, 75, 66,145,200, 34, 8,162,160,187, 80, 36, 2, 79,108,252,153,135, 75,159,242,
+196,231,243,143,159, 57,115,198,222,209,209, 17,107,214,172,129,147,147, 83, 67, 7, 7, 7,185,169,169,169,145,173,173, 45, 26,
+ 53,106,132,142, 29, 59,226,218,181,107,208, 35, 13, 40,134, 97,122, 61,120,240, 96,254,163, 71,143,134,139, 68, 34, 98,230,204,
+153,236, 62,125,250,128,207,231, 67, 46,151, 67, 42,149,226,196,137, 19, 25, 52, 77, 23, 77, 74,177, 20, 10,133,135, 9,130,136,
+149,201,100,115, 74, 19,254,241, 91, 83,135,180, 44,122, 18,147, 47, 28,236,225, 85,171,105, 55,175, 30,168,227,210, 13,221,188,
+ 18, 0, 96,131, 5, 59,206,251,151,101,102, 23,204,140,137,195, 55,175,223, 90,233,238,209,109,217,226,252,187,107, 55,238,207,
+174,116, 60, 29, 65, 16,160,105,250,179,216, 65,165,127, 31, 55,110, 28, 78,157, 58, 85,105, 58,146, 36, 57,114,234,212,169,220,
+ 82,158,103, 36, 39, 39,163, 95,191,126, 24, 50,100,200,103, 66,203,202,202, 10,118,118,118,136,139,139, 3,128, 76, 61,203,213,
+172,137, 19, 39, 18, 10,133, 2,147, 39, 79,198,129, 3, 7,224,237,237, 77, 4, 5, 5,205, 2, 48,167,170,133,157, 36,201, 77,
+139, 22, 45,154,239,227,227,131,172,172, 44, 92,189,122, 21,125,250,244,193,169, 83,167,172,175, 94,189,186,222,211,211, 19, 44,
+ 22, 11, 1, 1, 1,160, 40,170,194, 88, 95, 92, 46,119, 64,223,190,125,201,196,196, 68,112,185, 92,180,110,221, 26, 73, 73, 73,
+144,203,229, 72, 78, 78,198,236,217,179, 63,101,102,102,118,213,247, 57,226,114,185,115,102,205,154,133,147, 39, 79,194,215,215,
+247, 8,128,201, 57, 57, 57,195, 31, 61,122,116,114,224,192,129, 72, 78, 78,198,133, 11, 23,176,114,229, 74, 98,220,184,113,216,
+181,107, 23,102,207,158,253,123,161,215,169,188,130,159,151,150,150,102, 90,175, 94, 61,164,166,166, 34, 63, 63, 31, 23, 46, 92,
+176,185,118,237, 90,109, 71, 71, 71,147,152,152, 24,221,207, 63,255,204,155, 51,103, 14,182,110,221,138,208,208, 80,248,251,251,
+163, 91,183,110, 84,116,116,116,153, 94,178,194,144, 13, 23, 24,134,185, 37, 18,137,144,151,151, 87,244,220, 45,240,245,245,245,
+241,243, 43,112,178,167,164,164, 96,252,248,241, 99, 3, 3, 3,105, 79, 79, 79, 33,151,203,133, 82,169,148,253,147,173, 54,173,
+163, 1,208,168, 93, 67,140, 27,151, 15,226,101, 88, 52, 94,134, 69,128,199, 47, 24, 4,175, 80,200,209,178,105,125,180,107,221,
+ 22, 41,146,100, 28,245, 63, 8, 11, 43,199, 10,235, 17,134, 97,192,101,235,224,230,106,135,227,254,251, 16,112, 53, 16,254, 71,
+ 79, 20,143,121, 99,179, 57,104,209,178, 29, 90,183,118, 71,116,204, 71, 28, 60,184, 7,214, 54, 53, 12,157,131,213, 68,113,215,
+ 97,201,207, 82,202,191,155,187,187, 59, 43, 63, 63, 31, 74,165, 18,159, 62,125, 66, 92, 92, 28,204,204,205, 16,157, 18,139,174,
+ 66, 13, 62,209,185,136, 10,139,212, 17, 44, 78,104,101,127,216,215,163, 5,224,209, 2, 51, 38,122, 87,240,202,202, 64,100, 98,
+ 85,208,117, 67, 81, 31,176,125, 59, 85,158,208,162,116,218,219, 55,110,221,105, 59,113,220, 0,206,205, 59, 7,160, 85,211, 80,
+104, 77, 33, 83,170, 33,211,112, 64,154,246, 1, 50,130,192, 98,243,209,190,121,125, 92, 56,127, 77,195, 80,218, 64,189, 19,200,
+182, 9,168,212,136, 18, 66, 43,173, 84,191,131,133,222, 93,135,197, 13,175, 78,119,234,216,177, 99,131, 58,116,232, 32,244,244,
+244,172, 87,216,112,106,142, 29, 59, 38, 47, 12,134, 89, 85,124, 22, 13,222,206,206,174, 37,151,203,245,238,211,167, 79,203, 9,
+ 19, 38,224,245,235,215, 56,122,244,232,187,250,245,235,223,149, 72,202,159,145,205,226,241, 50,243,211,210,204,196,181,107,179,
+205,141,141, 83,174, 93,189,234,220,163,103, 79, 34, 33, 33, 1,153,153,153, 80, 42,149, 8, 13, 11, 99, 56, 44, 86, 18, 97, 98,
+ 66,190, 13, 9, 33, 89, 60, 94,102,121,222,198, 50, 16, 87,201,172, 67,191,234,122,183,106,216,155,215, 91,233,251, 99, 29,165,
+ 74,217, 36, 55, 55,151, 98,115, 56, 28, 39, 59,179,248,183, 31,245,175, 19, 85, 42, 85,192,237,219,183, 7,245,232,209,131,255,
+238, 85, 40,168,156, 28,168,115,164,224,210, 58, 88,180,108, 14,150, 70, 5,168,181,112,116, 99,160,204, 22, 34,232,233, 91,173,
+ 74,165,170, 52,168, 97,145,208, 34, 75, 9, 3,158, 88, 12,190,177, 9,248, 98,113,105,193, 80,217,155,156,176, 87,175, 94,221,
+219,183,111, 15,134, 97,176,127,255,126,104, 52, 26,158, 70,163,129, 90,173,134, 70,163, 65,110,110, 46,252,253,253,177,123,247,
+238, 71, 0,126,215,227,246, 41, 35, 35,163,129, 4, 65,216,176,217,108,185,181,181,181,232,212,169, 83,197,225, 38, 90,180,104,
+ 1, 99, 99, 99, 46, 10,131, 66,218,216,216,112, 14, 29, 58,100,214,191,127,255,251,101,118,119, 52,109,184,176, 14,101,238, 33,
+ 48,170, 85,219,196,170, 25,234,184,116, 3, 0,244,236, 55, 17,117,234,215, 68,110,198,171,218, 74, 69,220, 96, 46, 91,106, 30,
+185, 61,249,181, 81,223, 38, 19,100,105,247,222,163,236,233,253,101, 54, 20, 36, 73,150,219, 29,171,143,200, 42,208, 44,164,117,
+209, 56, 31, 0,200,204,204,132, 68, 34, 65, 84, 84, 20, 26, 52,104,128,172,172, 44, 56, 58, 58, 66,173, 86,163, 77,155, 54, 80,
+ 40, 20,216,178,101, 11, 30, 62,124,248, 8,192,108, 61,254,195,200,197,197,101,124,203,150, 45,113,245,234, 85, 60,127,254, 60,
+249,198,141, 27,142,238,238,238,168, 93,187,246,132,216,216,216,165,133, 93,125,250, 66,228,238,238, 62,211,199,199, 7, 17, 17,
+ 17,248,241,199, 31, 51, 19, 19, 19, 47,156, 62,125,122,242,202,149, 43, 73, 47, 47, 47, 72, 36, 18,108,218,180, 73,247,240,225,
+195,205, 0,214, 84,146,142,111, 18, 19, 19,157,148, 74, 37,178,178,178, 64, 81, 20,228,114, 57,174, 93,187, 6,127,127,255,212,
+ 66,145,245, 65, 95,227,154, 55,111,222,136, 36, 73,156, 60,121, 18, 0,126, 66, 65,196,254, 11,131, 7, 15, 78,254,249,231,159,
+ 29,151, 44, 89,130, 31,126,248, 1, 26,141, 6, 27, 55,110,196,146, 37, 75,174, 20,138,172,138, 42,209,223,236,236,236,166,252,
+248,227,143, 13,231,205,155,135,224,224, 96,155, 23, 47, 94,180, 14, 13, 13, 69,141, 26, 53,144,153,153,201,182,180,180,196,214,
+173, 91, 49,119,238,220,115, 0, 50, 30, 63,126, 60, 50, 38, 38,198, 15,192,166, 74, 68,251, 94, 71, 71,199, 41, 12,195, 48,114,
+185, 60,206,215,215,119,211,186,117,235, 48,119,238, 92, 68, 70, 70, 34, 39, 39, 7,198,198,198,196,162, 69,139,198,255,244,211,
+ 79,152, 52,105, 18, 35,147,201,118,255,211, 13, 53,195,232, 32,151, 70, 64,167, 50, 71,139,166, 13,208,162, 73, 45,220,184,243,
+ 18, 0,208,125,168, 59,228,178, 60, 28, 57,178, 31, 31, 62,188, 7,155,195,129,153,133,157, 62,158, 64,168,115,223, 32, 91, 35,
+ 65, 15,207,214,232,227,213, 21,191,255,113, 10,148, 86,131,201, 19, 71, 67,154,157,141, 63,254, 56,136,232,152,143, 96,115, 56,
+176,180,250,251, 3,161, 86,164, 69,254,223, 11, 45, 61,186,159, 64,211, 52,146,147,147,241,226,197, 11,196,198,198, 66, 40, 20,
+ 66, 65,233,232, 61,183, 31,210, 4,193, 77,162, 25,230, 17, 67, 21, 71, 41,254,146, 67,167, 75, 46, 17,177,214,212,220,220,156,
+167, 82, 41, 64, 81,218, 18,173, 10, 1, 16, 0,151, 13,216, 59,212, 65, 98, 66, 34,163, 84, 42,239, 85,248, 6,165, 82,110,189,
+116,225,140, 79,199, 78,238, 86,125,186,175,198,133,139,203, 33,205,205,133, 82,195,129, 76,169,129, 92, 9,152, 89,184,162, 77,
+211,102, 72, 73,201,196,171,231, 65,249,108,149, 92,159,129,162,239,119, 44,155,232, 50,113,198, 66, 24, 57,119,130, 42,234, 2,
+232,252,212, 98,143,150, 64,108, 14,139,154,110,200,150,169,112, 38,240, 37, 80,133,165, 94,210,210,210,228, 44, 22,235,152,143,
+143,207,198,151, 47, 95, 56, 1,192,203,151, 47,147, 36, 18,201,226,180,180,180,170,250,164,139,162,193, 19, 2,129,209,203,250,
+245,235,167,180,110,221,218,116,240,224,193,176,178,178, 66,104,104, 40,252,252,252,222,104, 52,154,133, 65, 65, 65, 21,118,245,
+168,213,234,228,151, 23, 47,154,116,253,254,123,179,133,253,251,111,242,241,241,217,186,102,205, 26,142,139,139, 11,161,213,104,
+ 16, 30, 30,206, 28, 63,118, 76,187,123,201,146, 45, 60,145,136,253,236,210, 37, 14,165, 82, 37,255,167, 11,177,163,163,163,135,
+123,151,206,110,155,127,219, 14,165, 34, 31, 79,131,175, 64, 42, 77,199,190,253,231,221, 28, 29, 25,143,228,228,228, 32,125, 5,
+240,225,195,135,231,183,107,217,178,101,221, 26, 53, 16, 30, 31, 11, 30,173, 3,151,162,192,210,168, 64, 82, 74,212,104,194,128,
+ 32,141, 33,249,148,139,117, 39,207, 70,232, 35,140, 27,126, 55, 0,107,146,114, 64, 16, 4,126,237,208, 4, 60, 99, 49,184, 34,
+ 49,166,255,121,167, 88, 24, 4,172, 89, 2,158, 88,140,122,237,244, 10, 8, 47,191,123,247,238,139,240,240,240, 54, 77,154, 52,
+193,252,249,243, 17, 23, 23, 7,154,166,145,154,154,170,148, 72, 36,201,233,233,233,113, 40,136,255,115,160,146, 70,172,164,234,
+112, 12, 10, 10, 42,238,110, 8, 12, 12,132,131,131, 3, 76, 77, 77,145,155,155,139,169, 83,167,154,173, 88,177, 2, 0,240,226,
+197, 11,148, 20, 40,165, 17,254, 50,106,115,118, 30, 35,101,242, 67, 6,103, 81, 33, 77,187,121, 37,162,103,191, 9,184, 21,240,
+ 59,238,220,184, 13, 11,118, 92, 44, 68,121,215, 50, 98, 51,114,147,100, 46,123,221, 90, 77,102, 73,100, 55,246,206, 28,240,142,
+101,111, 79,159, 89,178, 39, 55,187, 34, 91, 93, 92, 92, 96,107,107, 91, 60, 70,139,205,102, 99,210,164, 73, 96, 24, 70, 95,145,
+ 85,216,214,208,233, 74,165,210, 86, 32, 16,224,211,167, 79,248,248,241, 35,162,163,163,139, 67, 7,208, 52,173, 93,176, 96, 1,
+103,230,204,153,216,179,103, 15,238,221,187,247, 8,192,106, 0,250,190,172,141, 30, 49, 98,132,177, 90,173,198,137, 19, 39, 40,
+ 0,253,206,156, 57,243,162, 77,155, 54,236,222,189,123, 27,239,218,181,107,116, 97, 30,233, 45,180, 76, 76, 76,184, 26,141, 6,
+187,118,237, 66, 98, 98,162, 7,128,168,103,207,158,237, 29, 49, 98,196,238, 38, 77,154,212,143,136,136,120,159,159,159, 63, 29,
+192,171,202,200, 82, 83, 83, 39,182,110,221,250, 12, 77,211,206, 61,122,244, 16,253,246,219,111, 38,111,223,190,133,147,147, 19,
+104,154, 14, 71, 21,151,176,122,255,254,125,148, 68, 34,113,235,218,181, 43,174, 93,187,182, 65,167,211,173, 7,176,113,218,180,
+105,142,241,241,241,104,217,178, 37, 44, 44, 44,240,246,237,219, 60,137, 68,178, 27, 5, 75, 18, 85,230,194,141, 1,176,120,239,
+222,189,205,246,238,221,235,109, 97, 97,209, 62, 52, 52, 20, 15, 30, 60,192,230,205,155,177, 98,197, 10,116,238,220, 25,243,231,
+207,207, 0,224, 13,128,138,137,137,209, 43,110, 94,145,103, 11, 0, 90,181,106,149,226,231,231,135,201,147, 39, 51,135, 14, 29,
+218,118,236,216,177, 57,163, 71,143, 46,110, 3,199,143, 31,207, 28, 61,122,116, 60, 10,150, 97,250, 39,161,213,104,212, 48,177,
+168,131,252,236, 4,164, 39, 6, 67,104,108, 7,175,110,205, 33, 87,168,113,249,210, 57,188, 10, 15, 3, 73,146,176,181,171, 1,
+ 51,115, 43,188,123,247, 30,168,120,182,177, 86,163,209,192,216,188, 22,242,115, 18,161, 78,123, 9, 35,177, 13, 38,124, 63, 24,
+114,133, 6,231, 47,156, 67, 68,196, 43,176, 88, 44,216,217,215,128,169, 89, 1, 39,193, 84, 60,131,217, 0, 0,101,196,211,170,
+ 84,104,177, 88,172,187,215,175, 95, 31,214,174, 93, 59,246,135, 15, 31,240,225, 67,193,203,141, 84, 42,165, 8,232,206,166,133,
+ 95, 26, 85,193,229, 61, 80, 56, 59,163,228,218,133, 98, 99,227,228,183,111,162,108,165, 89,169, 8, 11,121,136, 15,239,194, 17,
+ 27, 29, 5,141, 70, 9, 22, 73,130,100,145,168, 85,167, 49, 30, 62, 10, 86, 43, 41, 42,184, 60,206, 2, 59,162,243, 68, 54, 46,
+ 35,215,174, 89, 26, 48,119,225, 42,163,225,195,246,224,213,219,215,200,167,236,192, 48,128,157,165, 8, 45,234, 46, 66,114, 74,
+ 58, 78,254,190, 75, 78,107, 52, 99, 74,197,208,250,130, 19, 0,108, 51,208,104,247,254,223, 39, 29,240, 63,190,106,225,204,169,
+182, 3,135,140, 1, 47,235, 53,180, 41, 47, 81,167, 77, 31, 16,124, 51, 92,189,121, 7, 65, 47, 94,167,210, 58,102,149,109, 38,
+ 14,189,171,132,179, 36,178,179,179, 31,127,250, 36,113, 42, 17, 5,222,137,207, 23, 84, 54, 59,174, 52,231,103, 17,231, 89, 44,
+178,213,218,181,107,181,182,182,182,154,136, 61,213,231,155, 0, 0, 32, 0, 73, 68, 65, 84,136, 8,236,217,179,135,126,249,242,
+229, 77,146, 36,119, 72, 36, 18,101,101,156,214, 90,109,216,113, 95,223, 70,109,135, 12, 97, 70,205,156, 41, 7,159, 63,107,211,
+175,191,250,166, 75,165, 14, 12, 77,195,218,194, 34,105,211,146, 37,126,195, 70,140,144, 70, 62,124,104, 20,124,241,162, 17,143,
+162, 94,234, 97,231,183, 64,185,156,201,201,201, 65,247,238, 61,192,145, 3,191, 65,163, 81, 65,146, 28, 15, 0,200,200,204, 65,
+ 37, 34,171, 52, 39, 35,151,203,135,252,180, 98,197,147,159,230,206,177,235,210,189, 7, 18,194, 66,161,201, 74, 7,161,165,192,
+ 33,216,144,165, 9,145,150,154,143,197, 71, 79,167,229,203,229, 67,202,104, 36,202,180,179,200, 99,197, 55, 49, 6, 87, 36, 6,
+ 79,108,252,153, 23, 75, 96, 98, 2,158, 72, 12, 54,143, 87,214, 0,238, 47, 56,243,243,243,135, 14, 27, 54,236,213,179,103,207,
+204, 39, 79,158,140,142, 29, 59,134, 40, 20, 10, 79, 0,121,213, 77, 79,154,166,147,187,116,233, 66, 18, 4, 33, 30, 51,102, 12,
+ 63, 61, 61,189, 56,178,122,126,126, 62,174, 93,187,134, 6, 13, 10,102,245, 71, 70, 70,162,113,227,198,229,114,254,176, 56, 34,
+ 25,192,154,185,195, 28, 55, 61, 9,147,204, 2,176,161, 78,253, 26,184,115,227, 54, 30,220, 9,246,109,223,132,222,254,221,152,
+ 54, 63, 11, 61, 71, 44,116,107, 53,153, 37, 54,177,199, 31,231,207,177,162, 94, 30, 92, 39,151,135,215,195,158, 11, 11,202,179,
+147, 32, 8, 48, 12,243, 69, 40, 7, 22,139,133, 99,199,142, 85,245,222, 79, 31, 56,112, 96,218,143, 63,254,200,149, 72, 36,120,
+243,230, 13,100, 50, 25, 4, 2, 1,110,220,184, 65, 1,216,117,236,216,177, 27,199,142, 29,235,141,130,217, 68,129, 85, 41,159,
+ 34,145,200,199,203,203, 11,111,222,188,193,243,231,207,207, 1,120, 21, 18, 18,114,238,195,135, 15, 35, 59,119,238,140,223,127,
+255,221, 71,161, 80, 28,168, 10, 39, 77,211, 37, 99, 38, 21,173,248, 16,150,159,159,223, 62, 56, 56,184,170,249, 46,201,204,204,
+236, 84, 40,172, 19,109,109,109, 77,194,194,194, 80,179,102, 77,104, 52,154,118, 85, 45, 75, 57, 57, 57,191,237,216,177,227,208,
+196,137, 19,241,243,207, 63,143, 57,125,250,244,152,239,190,251, 14,125,251,246,197,225,195,135,241,234,213,171, 13,208,111, 89,
+177,178,238,253, 21,128, 87,182,182,182, 51,106,212,168,129,205,155, 55, 35, 60, 60,220,111,205,154, 53, 75, 94,189,122,133, 6,
+ 13, 26,240,163,162,162,168,234,212, 33, 0, 96, 98, 98, 98,162,213,106,113,241,226,197,167, 0,230,142, 25, 51,198,102,235,214,
+173,222, 98,177, 24, 89, 89, 89,138,136,136,136,209, 0, 46,253,211,117, 29, 67, 16,203, 38,255, 48,107,239, 15,147, 71, 11, 90,
+183,106, 1,121,110, 18, 20,249,169,144,231,125,194,142, 3, 55, 65, 16, 36,172,173,237, 97, 99,231,132,248,248, 4, 60,186,114,
+ 85, 45,147, 43,182,242,180,244,134,138, 57,103, 22,112,182, 44,224,148,203,210,160,200, 79, 43,230,180,177,113, 40,228,140,199,
+195,224,171, 74,133, 76,246,155,154, 33,126,249,155,239,253,255, 51,170,182,214, 97, 73, 72,165,210,217, 83,167, 78,245, 92,188,
+120,177, 37, 69, 81, 44, 11, 11, 11,196,199,199, 83,103,207,158,205,202,207,207,159, 93, 29,107,216, 28,206, 43, 23,215, 6,158,
+ 3, 7, 14,164, 6, 12,232,207, 29, 59,177, 55,219,218,198, 6, 57,217,153,120,247, 38, 20,111, 95,191,132, 75,131,230, 88,185,
+102, 11, 96,102, 86,233, 66,146,133,203,234,244, 91,253,211,130, 83,157, 60,122,153, 52,104,220,156,219,162,158, 41, 52, 90, 10,
+ 73, 73, 73,184,116, 49, 76, 19,241,226, 65, 46, 77,169, 71,202, 51,244, 91,130, 39, 8,160,144,137,125, 77,108, 52,199,214,111,
+218, 49,127,215,190, 35, 11, 23,207,154, 44,234,236,222, 19,225,183,127,199,185,128, 83, 50,165, 74,189,137,203,194,175, 17,153,
+144,191,171, 98, 26, 40,149, 74, 77,233,246, 84,169, 84,106,190, 54,167, 15, 31, 62,140,212,212, 84,117, 92, 92,220,117,138,162,
+ 78, 87,176,216,243, 23,216, 1,168, 7,171, 84,183,127,114,119,239,253,211,141, 27,130,241,139, 22,169,199,140, 29,187, 0, 42,
+149, 6, 60, 30,195, 22,137, 72,240,249,156,200,135, 15,141,182, 77,155,102, 65,168,213,183,142, 84, 16, 54,160, 12,124,243, 89,
+135, 69, 30,173,174, 93, 59, 99,252,228,185, 80,148,240,104, 61,126,254, 14, 42, 13,244,246,104, 21, 34, 33, 46, 49,177,253,172,
+101, 63,157, 31,233,213,221,173,137,115, 45,190,117,237, 90, 16,219,217, 33, 51, 61, 29, 15,159,191,213,174, 57,117, 62,162, 80,
+100,233, 21, 87,134,166,233,130, 65,238, 0,186,207, 94, 12,130,197, 2, 10,195, 56, 20,205, 28,170,221,166, 35, 8, 54, 27, 58,
+134,134, 74,165,210,103,208, 95,210,199,143, 31,135,142, 25, 51, 38, 48, 32, 32,128,244,242,242,106,113,225,194, 5,250,107,202,
+142, 66,161,104, 15, 0, 2,129, 32,214,204,204,204,113,226,196,137,208,106,181,144,203,229,200,201,201, 65, 82, 82, 82,246,196,
+137, 19, 53, 0, 96,100,100,196, 27, 54,108,152, 73,101,156, 91,206, 38, 43,231, 14,115,220,110,193,142,243,206,205,120, 85,219,
+130, 29, 23,219,190, 9,189,125,203,217,100,165,137,131,108,109, 70, 92,208, 59,137,236,198,222, 63,206,159, 99,141, 27, 60, 84,
+231, 36,126,239, 43,176, 97,206, 86,198, 75, 16,196, 23,193, 73,245, 20, 89,159, 33, 47, 47,111,201,242,229,203,251, 74,165, 82,
+167,222,189,123,115,221,220,220,240,228,201, 19, 4, 4, 4, 80,143, 31, 63, 78,148,201,100, 75, 1, 40, 1,220,172, 78,154,186,
+186,186,214,102,179,217, 69, 93,105, 59, 11, 15,239,188,112,225,194,200,201,147, 39,163, 86,173, 90,141,162,162,162,248,168,194,
+115,196, 48, 76,113, 47,195,183, 4, 65, 16,209,219,182,109,115,180,179,179, 35,174, 93,187, 70,177, 88,172,234,120,110, 14, 31,
+ 60,120,176,157, 86,171,253, 97,202,148, 41,240,240,240, 0, 69, 81, 56,122,244, 40, 14, 30, 60,168,175,200,170, 16,239,222,189,
+123,153,152,152,216,101,193,130, 5,216,188,121,243,146, 5, 11, 22, 32, 49, 49, 17,239,222,189, 11,253, 26,222,220,220, 92, 69,
+ 66, 66,130,176, 67,135, 14,173, 35, 34, 34, 34, 60, 61, 61, 27, 79,158, 60, 25, 27, 54,108, 96,238,221,187, 55, 12,192,181,255,
+ 68,235,253,246, 67,150, 63, 71,199,190,177,102,237,111, 43,234,213,173,253,227,164, 9, 35, 88,174, 46,141, 33,203, 73,130,165,
+149, 45,156,106,212, 65,122, 90, 6,174, 95,191,166,203,200,200, 62,172, 35,137,213, 31, 62,100,165,124, 13,167,163, 83, 29,164,
+165,165,225,234,213,171,186,108,105,238,126,104,201, 53, 81,241,217,169, 48, 64, 31, 79,214, 20, 84, 16, 37,190, 34, 88,153,155,
+155,159, 48, 49, 49, 73, 53, 49, 49, 73, 53, 55, 55, 63, 1,232, 53,251,160, 71,137,218,129,245,217, 54,108,152, 0, 2, 65,123,
+176,217,243,204,204,205,175,153,154,154,102,118,237,218, 85,189,119,239, 94,101, 84, 84, 36,157,156,156,200,152,154,154,230, 20,
+159, 95, 22,103, 41,152,155,215, 53, 22,217, 55, 94, 97,234,212,226,161,216,190, 81,158,216,190, 81,158,169, 83,243, 71, 34,251,
+ 70,171,204,205,235, 26,235,101,103, 57,168, 99, 3,107, 23, 43,236,106, 96, 77, 40, 92,172,176,171,142, 13,172,245,190,247,138,
+187,253,116, 4, 1, 29, 10,166, 97,163, 26,156, 69, 28, 52,139,197, 58,226,228,228,100,143,170, 5,172,251,130,115, 44, 80,107,
+ 44,159,255,195, 25, 95,223,241,177,247,238,141,201,141,137, 25,149, 19, 29, 61, 34,244,212,169,145, 59, 71,142, 28, 59,138,207,
+159, 50, 12,168,171, 47,167,189,189,189,223,203,151, 47, 3,244,221, 74, 8, 47,189,211,179,110, 29,199, 27, 94, 61,218, 49, 62,
+ 83,135, 48, 62, 83,135, 48, 94, 61,218, 49,117,235, 56,222,248,138, 60, 34, 88, 44,150,183, 80, 40, 60, 33, 18, 10,195, 69, 66,
+ 97,184, 80, 40, 60,193, 98,177,188, 81,241, 24,170,207, 56, 45, 45, 45, 95,216,218,218,166, 86,101,179,178,178, 10,169,130,157,
+163,106,215,174,157, 72,146,228,150, 42, 62,211, 21,113,186, 24, 25, 25, 69,139, 68,162,164,146,155,145,145, 81,201,192, 80,150,
+ 66,161,240,178, 72, 36,218,170, 15,231, 47,203, 26,175,120,116,115,198,171, 95,150, 53, 94, 81,250,183,153,131,204, 39, 62, 9,
+ 92,157, 57,115,144,249, 68,125,236,180,177,177,185,103, 99, 99, 35,177,177,177,145,216,218,218, 86,184, 89, 89, 89,189,208,131,
+ 83, 96,108,108,188,213,216,216, 56, 85, 36, 18,233,196, 98,113,170, 72, 36,218,130, 18,161, 45,170,155,158, 36, 73,110,104,212,
+168,145,146,197, 98, 29, 42,245,211,230,122,245,234, 41,217,108,246,166, 42,114,154,116,238,220, 89, 23, 22, 22,198,120,120,120,
+ 48, 0,204,191, 97,190,219,153,155,155, 95, 51, 49, 49, 73, 48, 54, 54,222, 1, 64, 84, 77, 78, 2,128,183,163,163, 99,104,183,
+110,221,228,142,142,142,193, 0, 6,126, 67, 59,251, 14, 26, 52,136, 78, 72, 72, 96, 24,134, 97, 18, 18, 18,152, 65,131, 6,209,
+ 40, 8, 20,249, 53,117,242,178,105,211,166, 49,143, 31, 63,102, 30, 63,126,204, 4, 7, 7, 51,125,251,246,165, 1,124,255,149,
+245, 60,190,213,189,187,213,177,170,219,176,190,249,233,209, 67,221,233,155,151,182, 48, 43,151,254,200,244,244,104,204, 52,168,
+103,126,222,197,197,210,229, 91,112,174, 88, 58,149,233,209,165, 17,237, 86,215,252,148, 91, 29,171,186,255,240,189,255, 27,189,
+ 90,248,187, 7,156,253,229, 90,252, 92, 44,149, 13, 7, 7, 7,100,102,182, 19,176,217,238,124, 62,223,147,100,177,238,102,165,
+167,207, 41,124,221,210,253, 83,174,218, 10, 27,244,186,224, 85,176, 36, 65,117, 56, 63, 27,200, 94, 77,206,170,112,232,197, 89,
+222,162,210,180, 74,149, 98, 73, 81, 47,118,160,194, 52,248,140,211,209,209,241, 7,154,166,107,235,107, 16, 73,146,177,201,201,
+201, 7,170,147,158,245,235,215,103, 10,187,183,137,111,153,239,127, 71, 89,250, 95,226,252,227,183,166, 14, 13,154, 54, 92, 24,
+254, 50,106,115, 97,183, 98, 49, 86,205, 52, 55,118,239,214,117,249,195, 59,247,126, 94,181, 67,154,247, 31,190,119, 18,122,142,
+105,251, 6,156, 69, 65, 66,171,196,201,225,112,246,182,109,219,246,135, 39, 79,158, 28,210,233,116, 83,254, 71,203,103, 95, 22,
+139,181,192,213,213,181,197,187,119,239, 66,117, 58,221,102,148, 17, 40,178, 26,118, 46,173, 93,187,246,116, 46,151,203,207,207,
+207,151,166,164,164, 44, 7,112,250,191, 45, 61,221,234, 91,180,102,152,226,160,219,235,222,124,204,122,246,205, 56, 25, 90, 71,
+ 51,172,181,239, 98, 50, 67,254, 3,249,254,111, 19, 89,251,255,137, 63,238, 97,224, 52,112, 26, 56, 13,156, 6,206,111,206,105,
+100, 72, 79, 3,231,191,144,243, 95, 9,182, 33, 9, 12, 48,192, 0, 3,254,223, 65, 97, 72, 2, 3, 12,248,175, 67, 73,175, 86,
+177, 55,139,168, 64,149, 86,197, 37, 88, 29,101,123,219,192,105,224, 52,112, 26, 56, 13,156, 6, 78, 3,231,255, 28,231,191, 85,
+100,237,175, 96,255,111,131,193,173,106,224, 52,112, 26, 56, 13,156, 6, 78, 3,167,129,243,127, 65,104,149,185,111,232, 58, 52,
+224,111,199,246,193,112, 4,128, 89, 23,144,252,119,156,111,128, 1, 6, 24, 96,128, 1,255, 97,236, 71, 57, 93,135,255, 13, 66,
+203, 1, 64,123, 20, 44,124,251, 22,192, 3, 0,210,175,224,179, 2, 48,130, 32,136,225, 0,192, 48,204, 25, 20,204, 26,201,208,
+231, 98,129, 64,144,170, 84, 42,109, 10,191,167, 41,149,202,146,107, 25, 16,248,114, 54, 27, 83, 98, 43, 19,181,107,215, 78, 85,
+169, 84, 54,122,252,125, 14,195, 48,175, 72,146, 12, 23,139,197,119,222,189,123, 23, 80,149, 27,247,244,244, 28,207, 98,177,214,
+ 1,128, 78,167, 91,118,247,238,221, 35,127, 99,190,181,171,225, 96,247,187, 70,171,161, 82,211,179,150,227,203, 64,126, 0,128,
+ 93,253,224, 71, 80, 88, 88,248,125,211,140,128,138,227,232, 84,245,252, 10,208,154,195,225,248,216,218,218,246, 73, 74, 74,122,
+ 1, 96, 17, 80,121, 84,227, 26, 53,106,124,207,102,179,199,232,116,186,186, 44, 22, 43,154,162,168, 99,137,137,137,254,134, 58,
+196, 0, 3, 12, 48,192, 0, 61,196,214, 23,168,146,208,106, 96, 9, 59, 6,240, 6,129,158, 96,112,139, 0, 78,190,205,196, 39,
+125,175,255,174, 1,180, 90,170,224, 63,185, 36,116,215, 62,146,251,251,244,233,227, 52,115,230, 76,116,236,216, 17, 79,158, 60,
+233,112,248,240,225,137,167, 79,159,126, 69,211,244, 93, 0, 79, 0,189, 66, 41,136, 80, 16,167,101,116,159, 62,125,122,172, 91,
+183,142,213,184,113, 99, 40, 20, 10,220,187,119,207,125,211,166, 77, 91, 31, 61,122,116, 27,192,241, 66, 65, 80,238, 2,120, 74,
+165,210,166,104, 49, 78,130, 32,108,134, 13, 27,246,172,164,184, 42, 92, 95,141, 96, 24,230, 49, 65, 16,193, 58,157,238,201,217,
+179,103, 19, 27, 0,237,166,214,230,158,157, 19,171,113, 42,205,169, 82,169,108, 46,254,178, 30,108, 62, 31,170,188, 92,116,152,
+240,151,232,189,181, 98, 33, 8,154, 2, 11,140,212,115,237,214, 87, 0,194, 83, 82, 82, 94,121,120,120,196, 86, 53,135, 89, 44,
+214,186,235,215,175,219, 51, 12, 3, 47, 47,175,117, 0,254, 46,161,197,111,223,186,249,221,203,231, 78, 8,242,179, 82,209,123,
+224,200, 99,239, 19,211,198, 3, 56,247,153,104,234, 3, 91,130,192,194,105,235,143,179, 0, 96,247,210,209,139,182,244,194,246,
+185, 55,241, 9,128,103,161,248, 1,128, 95, 0,220,221,213, 7,182, 0, 22, 79, 91,127,156, 0,128, 61, 75, 71, 47,220,213, 7,
+219,102, 92,171,114,216,138,233,227,199,143,223,190,110,221, 58,150,189,189, 61,146,147,147,123, 55,106,212,200, 53, 55, 55,183,
+ 17, 42, 24, 68, 92,171, 86,173, 83,157,187,245,175, 51,100,184,183,208,218,202, 28, 41,146, 12,147, 83, 39, 14, 77,101, 61,190,
+215, 39, 46, 46,110,164,161, 14, 49,192, 0, 3, 12, 48,160, 28, 84, 63, 50,124, 75,123, 24,201, 52, 24,196,102, 17,223,119,106,
+221,168,251,168,239, 58,147,141,220,234,227,117,100, 84,175, 75,119,158,110, 34,131, 35, 3, 41, 29,227, 47,226,226, 98,136,164,
+226,153, 48, 90, 10,236,155, 23,143, 23,180,132, 19, 71,179,158, 61,123, 86,191, 85,171, 86,197, 75,195,116,239,222, 29,221,187,
+119, 39,118,239,222,221,252,230,205,155,205, 15, 30, 60,168, 9, 12, 12,252, 29, 21,199, 71,241,169, 87,175,222,166,237,219,183,
+243, 61, 60, 60,192,231,243,139,127, 16,139,197,232,223,191, 63,250,247,239,207, 74, 73, 73,241,186,124,249,178,215, 47,191,252,
+162,142,143,143, 95,128,191,162, 52, 87,136,229,203,151,183, 46,227,240,117,130, 32, 62, 82, 20, 21,218,188,121,243, 68, 87,160,
+254,212,239, 58,222,154,222,201, 69, 52,103,201,225, 50,121,216, 60, 30,254, 24, 95,208, 86,151, 20, 90,177,119,174, 65,108, 98,
+156, 41, 52, 54,126, 5, 32, 28,192, 43,134, 97,194,163,163,163,163, 26, 2,205,219,155,147,191, 31,146,210,205,170, 32,182,144,
+152,152, 8, 83, 83, 83, 35, 15, 15, 15, 9, 65, 16,171,238,221,187,247,173, 7,228,181, 91,181,112, 58, 87, 26,247, 10,159,222,
+ 60,198,188,225,238,194, 57, 59,254,252, 89,169,214,158,171,232, 34,130, 32,201, 95,130,105, 95, 20, 44,198,187, 60, 51, 51,211,
+ 3, 0, 44, 45, 45,121, 0,238,110,121,138,239,230,118, 34,190, 38,182, 27,151,197, 98,237, 58,124,248,240,228,239,191,255,190,
+ 96,233,136,135, 15, 33, 22,139,177,102,205,154, 90,243,231,207,247,163, 40,106,118,121,158,172,206,221,250,215,217,182,249,231,
+ 70,121, 89, 57,170,125,187, 78, 63,119,104,210,128,156,230, 51,223,120,155, 70,101,167,211,233,190, 55,120,182, 12, 48,192, 0,
+ 3, 12,168,138, 55,171, 82,161,229,106,133, 35, 45,155,184,140, 24,213,215,157,223,180, 73, 99,112,249,127,133,110,105,213,186,
+ 53, 90,181,110, 77,250,230,231,245,124,246,252,101,207,179, 55,159,168,228,218,248,211,239, 50, 48, 94, 95,171,138, 22,165, 93,
+ 55,208,182,155, 44, 59, 77, 0, 0, 34, 51, 27,229,210,139,159,238,116,234,212, 9, 78, 78, 78,220,192,192,192, 73,149, 8,173,
+165,111,223,190,229,179, 88, 21,199, 67,117,112,112,192,176, 97,195,208,160, 65, 3, 94,215,174, 93,151,150, 39,180, 4, 2, 65,
+ 26, 65, 16, 54, 0, 96, 97, 97,161, 91,181,106, 85, 40, 83, 0, 0, 96, 24,134,121, 76,146,228, 19,154,166,159,254,249,231,159,
+ 73,141, 0,155,222,173, 26, 60,152, 62,118,152,144, 57,187,181, 92,145,160,204,205, 45,243,184, 80, 44, 74, 55, 18,137, 94,241,
+133,130,112, 20,172,229, 21,238,228,228, 20,213, 8,112,106,219,160,246,205,221,115, 71, 27, 31,154,242,115,165,105,217,178,101,
+ 75,215,102,205,154, 9,116, 58, 29,100, 50, 25,246,236,217, 99,106,100,100,100,218,167, 79,159,149, 37, 11,128, 27,208,116,168,
+ 3,107,202,234, 20,221,140,106, 20, 36,179,206, 29, 90,199, 13,235,223,199,164,117,251,206,120,127,247, 40,178,178,242,144,147,
+157, 15,154,166,191,136,235, 51,227, 26, 82,119,245,195,166,221, 75, 70, 47, 38, 72,146,104, 62,120, 17, 6,216,229,204,218,187,
+119,111, 36, 0, 14,143,199, 43, 89, 14, 29,140, 28,155,108,170,223,171, 51,246, 44, 27, 11,134,166, 25, 0,155,170,224,205,178,
+ 49, 54, 54,190,116,243,230,205,118,109,218,180,193,147, 39, 79, 16, 19, 19,131,233,211,167,171,103,204,152,193, 29, 55,110, 28,
+ 49,111,222,188,153,191,252,242,203, 89, 0,143,190,120, 16,216,236, 49, 3,135,140,228,229,103,231, 42,213, 42,141,218,194,202,
+140, 86,201,148,242, 12,105,174,114,228,232, 31,212,145, 33, 79,199, 0,248, 66,104,125,101,122, 26, 96,128, 1, 6, 24,160, 7,
+ 24,134,105, 3,192, 26, 64, 58, 65, 16,207, 75,238, 23,158, 82,180, 90, 75,233,253, 12, 20,244, 74, 89,150,160,203, 64,193,112,
+ 31,107, 0, 58, 0,207, 8,130,144,126,165,137, 21,207, 50, 12, 8, 8, 96, 74,126,150, 16, 90, 12,195, 48,140, 54,243, 35,163,
+122,119,141,145, 63, 63,240,197,166,136, 60,199, 72,158,157,102,158, 30, 95,193,184, 90, 85,188, 10,251,119, 13,160, 29,221, 12,
+204,180, 54, 96,102,119, 53, 83, 62,123,246, 44,144,166,233, 0,223,206, 96,152,215,199, 25,230,245,113,102,110, 7, 48,103,207,
+158,189,238,231,231, 23,224,239,239, 31, 0,160,178,113, 74,169,121,207,131,153,167, 54, 96,202,195,219,183,111,153,189,123,247,
+ 50, 75,150, 44, 97, 14, 29, 58,196,160,146, 8,234, 94, 94, 94,247, 34, 34, 34,152,113,227,198,133,162,130,192,128,110,128,104,
+ 76, 45,187, 55,170, 83, 91, 53,234,239,155, 50,210, 46,130, 50,239,223,222,222,254, 51,123, 54,184,216, 49, 59,219,186, 48, 71,
+122,182,250,196, 48,204,117,134, 97, 54, 48, 12, 51,146, 97,152, 6, 0,208, 18, 48, 25,104,111,249, 65,121,122,155, 66, 61,165,
+125,165,235,222,181,108,217,210,117,193,130, 5, 89,106,181,154,137,141,141,101,246,237,219,199,220,186,117,139,185,120,241, 34,
+227,238,238,158, 82,194, 94,219,137, 13,156, 83,213, 7, 87,171,170, 83,138, 56, 44,214,206,231,183,206, 50, 31, 30,156, 97,158,
+157,244, 99,142,253, 52,138,153, 57,176,157,198,196,136,175, 4,208,173,188,235,102,116, 66,253, 6,181,172,223,197,199,199, 51,
+ 26,141,134,153, 48, 97, 2,227,229,229,197,244,234,213,139,233,209,163, 7,211,189,123,119,166, 91,183,110,204,157, 59,119,152,
+148,148, 20,166, 71,231, 86,178,126,110,104, 93, 5,211,154, 56, 59, 59,127,138,141,141,101, 52, 26, 13, 19, 24, 24,200, 28, 61,
+122,148, 9, 12, 12,100,124,125,125, 25, 0, 71,166, 77,155,166,144, 74,165,140,151,151, 87, 18,202,136, 26,239,236,236, 28, 21,
+241, 46, 49,113,203,250, 3,119,254,216,121,226,206,249,179,183,238, 92,186,241,236,202,197, 27,207, 79, 63, 13,139,190,232,236,
+236, 28, 85, 70,254,127, 85,122, 26, 96,128, 1, 6, 24, 80,185, 22, 41, 20, 90,125, 11,157, 29,125, 25,134,233, 81,106,191,111,
+161,112,250, 98,223,215,215,119, 73,201,253,162,115,124,125,125,151, 0, 96, 58,116,232,112,130, 97,152,250,223,192,252, 41,101,
+108,149,123,180,138, 64, 37, 61, 3,215,165, 15, 56, 58, 45,180, 25,111, 65,103,199, 3, 34, 59, 40, 8, 49, 50, 37,241,120,243,
+224, 92,197, 11, 73, 20,226,234, 91,112, 0, 4, 70, 69, 69,225,205,155, 55, 72, 76, 76,132, 80, 40,252,226,188,135, 15, 31,194,
+200,200, 8,246,246,246,250, 41, 93,245,231,237,220,171, 86,206, 16,119,240, 64,198,168, 31, 17, 24, 24,136,180,180, 52,112,185,
+ 92,240,120, 60, 80, 20, 85, 41, 31, 73, 22,172,248, 91,228,197, 42,235, 28, 15,128,205,183, 16, 95,222,189,114,118,109,242,113,
+ 0, 71,145,240, 1, 41, 74,157,126,158, 60,177, 8, 66,145, 80, 98,100, 36, 44,238, 46, 4, 16, 78, 16,196,251,150, 0, 71, 36,
+ 22, 92,254,125,237, 60, 59, 86, 72,160, 64,241,225, 85,153, 28, 61,122,244,152, 10, 96, 37,195, 48,217,205,154, 53,179, 93,183,
+110,157,121,114,114, 50, 94,191,126,141,211,167, 79,167, 83, 5, 55, 74, 48, 12,179, 26, 0,218, 3, 2, 51,107,179, 27, 59, 87,
+204, 54,198,221, 83,188,234,148, 34, 83,183,254, 87,134,142,155, 54, 99,251,236,254,144,229, 41,112,252, 86, 8,174,191,252, 56,
+ 0,192, 67, 84, 48,238,109,215, 35,124, 0,210,187, 15, 25, 50, 36,244,254,253,251, 86, 7, 15, 30, 4, 69, 81,101,110, 7, 15,
+ 30,196,237, 7, 47,103, 1,120,161,167, 89, 14,181,107,215,190,253,244,233, 83,107,161, 80,136, 91,183,110, 33, 59, 59,187,216,
+147, 53,126,252,120, 34, 59, 59,219,123,207,158, 61, 67,227,226,226, 54, 63,120,240, 32, 19, 5,107, 65,126, 86, 16, 88, 44,214,
+ 71,138,210, 52,180,119,171,207, 30,222,191,115,231,252,204, 87, 16, 91, 54,195,227,176,143,151,179,165,153, 10, 22,139,245,177,
+228,249,223, 34, 61, 13, 48,192, 0, 3, 12,168, 26, 8,130, 8, 96, 24,166, 31, 65, 16, 1,165,143,149,254, 94,116,158,159,159,
+ 95,241,126,209, 53, 27, 54,108, 88, 95, 98, 95,254,141,204,171,112, 48,124,215, 66, 5,217,181,172,147, 84,175,207, 67,245,230,
+ 18,184,206,157,192,107, 48, 0, 44,103,119, 36,188,186,139,176,107, 91,144, 20,249, 16, 12,173,131,189,107, 91,125, 13, 81, 54,
+108,216, 16, 74,101,193,208, 44,149, 74, 5,174,200, 92, 57,111,202,104, 1, 0,208,108,129,170,132,130,213,139,208,184,147, 39,
+218,166, 50,120,102, 91,224,168,104,155, 90,112,221,218, 9, 19,192,229,114,193,229,114, 65, 20, 14,253,209, 71,104, 17,133, 39,
+211, 5,221, 87,101, 25, 65,200,249,156,227, 39, 87,250,180,229,199,133,243, 84, 17,143,145,162,162,153,203,169,186, 43,250,216,
+ 43, 20, 9,147,141,132,194,112, 35,177,168, 88,104, 17, 4,241, 17, 0, 24, 14,199,255,232,106,159,102,162,212,104,145,242,121,
+ 32, 36, 74, 90, 83, 14,205,234,107,215,174,217,176,217,108, 59,157, 78,135,132,132, 4, 68, 70, 70, 98,219,182,109,169,121,121,
+121, 93, 67, 66, 66,222,149,212,142, 58, 35,222,105,255, 53,179,235,176, 95, 5, 9, 84, 31, 35,170, 92,122,172,154, 12,242, 26,
+208,181,249,149,169, 99,151, 97,208,119,189, 48,174,107, 35, 38, 54, 37, 75, 9,224, 86,161,235,181, 50, 36,135,132,132,244,236,
+210,165,203,177, 22, 45, 90,184, 49, 12,131,166, 77,155,194,219,219, 27,254,254,254, 8, 11, 11, 67,110,110,174,230,230,205,155,
+ 91, 1, 28,214,211, 44,161,185,185,249,245, 59,119,238, 88, 11,133, 66,220,188,121, 19, 10,133, 2,246,246,246,152, 49, 99, 6,
+111,195,134, 13,127,228,230,230, 14,247,243,243, 19,196,198,198,238,188,113,227, 70, 45, 20,172, 59,247, 69, 33, 80,171,213,251,
+143,251, 31,217, 62,195,103,166,227,157, 39,175, 3, 85,249,121,166,206,206,137,185,214,230, 98,227,173, 27, 87,215, 84,171,213,
+ 83,203, 78,207,123,213, 74, 79, 3, 12, 48,192, 0, 3,190, 64,133, 90,164,164,120, 42, 45,182,170, 34,210, 0, 40,124,125,125,
+151, 18, 4, 17,224,235,235,187,212,207,207, 79, 1, 32,229,239, 16, 89,197, 66,171, 95,191,126, 65, 1, 1, 1,232,215,175, 95,
+ 80,185, 20,180, 14,154,216,251,208,196,222,135, 81,135, 89,248,211,111, 84,169,155,167,171,109, 93,255, 53,183,238,168, 84, 42,
+246,145, 35, 71,138,199,109, 1,128, 78,167,251,230,185, 88, 21,161, 85, 40,244,190, 48,162, 54, 95, 28,180,127,238,240,246,150,
+ 58, 57, 71,253,240, 50,146, 85, 52,181,249,131, 70,254, 60,155,249,165, 60,206,139,115,166, 34,241,193,109, 8,197,226,196,201,
+247,195,139,189, 88,133, 34, 43, 6, 0,106,241,141, 3,247,206, 30,228,110,199, 5, 87,125,229, 12, 82, 84,180,106,111,156,246,
+112, 57,133, 13, 12,195, 32, 38, 38, 6,114,185, 28,193,193,193, 56,119,238, 92,122, 25, 34, 11,181,249,226,123,135, 22,141,105,
+103,146,247,137,171,126,126, 27, 41, 42, 90,175,174, 46,171,166,131, 58,113, 73,226, 38, 65,178,140,186,183,119,197,156, 31, 6,
+ 99,203,161, 63, 41,181, 77,231,126,219, 47, 93, 29,145,175,210, 44,213, 83,100, 21, 59, 27, 67, 66, 66, 26,133,132,132,240, 1,
+120,122,123,123, 95, 29, 58,116, 40,130,130,130,112,249,242,101, 23, 0,146,194,243,214,160, 96,161,236, 95, 0, 68,151,231,120,
+228,114,185, 39,111,223,190,221,216,193,193, 1,183,111,223,134, 66,161,192,180,105,211,212, 62, 62, 62,220,241,227,199, 19, 57,
+ 57, 57,197,158,172,224,224,224,204,242, 68, 22, 0, 36, 39, 39, 95, 59,119,250,104,199, 46, 93,186, 12,174,227,210,192, 36, 58,
+ 47, 55, 77, 40, 20, 24, 61, 8,186,203,125,254,244,209,206,228,228,228,103,101,167,103,160,222,233,105,128, 1, 6, 24, 96, 64,
+249,208, 75,139,148,242, 76, 85, 5, 37,174,227,248,249,249, 69,250,249,249,125,230,241,250, 74,148,158,117,120,165,168, 77,171,
+ 86, 28, 45, 93, 78,194,151, 55, 64,211, 85,185,217, 47,142,153,155,155, 83, 70, 70, 70,159, 9, 45, 90, 79,206,172, 11, 39, 16,
+ 61,125,116,177, 39,171,200,179,133,222,227,191, 74,104,209, 52, 29, 12,224, 51, 35,132, 54,174,163,182,246,119,235,212,168,142,
+ 35,169, 61,189, 13, 73,114, 74,185,242,173, 70,249, 38,143, 25, 16, 85,198, 32,235, 98, 78, 74, 11,129,200, 40,222, 72, 44, 42,
+ 45,178,226, 0, 64,100,235, 50,116,115,159, 6, 93,155, 55,168, 71, 82,167,126, 67,178, 92,155,239, 27,165,209, 68,203,152,243,
+229,164,225,202, 94,189,122,173,180,180,180, 20,108,223,190,221,212,217,217, 25, 20, 69,169, 75,139, 44,161,141,235,168,109,131,
+154,116,114,181, 51, 39,181,103,119, 32, 81,161,147,111,139,214,254,161,143,200,178, 50, 21,223,216,187,126,186,145,144,207,129,
+ 82,169,196,134,221,103,113,243, 81, 68,191,140,136,139, 55, 0,220,248,138, 2, 57,185, 95,191,126, 91,214,172, 89, 3,173, 86,
+139, 73,147, 38,225,227,199,143, 55,223,190,125,187,173,102,205,154, 11, 22, 45, 90,228, 96,103,103,135, 17, 35, 70,112,181, 90,
+237,248,114, 56, 54, 30, 63,126,188, 95,243,230,205, 17, 20, 20,132,236,236,108,216,219,219,195,199,199,135,231,231,231,247, 71,
+110,110,238,240,245,235,215, 11, 98, 98, 98, 42,244,100,125, 86,174,117,186,181,251,182, 76, 95,208,166,189, 59,249,225,195, 59,
+ 42,161,173, 7,121,247,246,229,251,150,150,150,127, 36, 36, 36,252,149,158,131,155, 86, 57, 61, 13, 48,192, 0, 3, 12,248, 54,
+ 32, 8,226, 74,225,184,171,207,188, 92,165, 69, 88,145,199,170,228,126,233,243, 11,127,255, 22, 47,203,251,203, 16, 94,159,135,
+119,232,215,175,159,222,211,234,105, 89,186, 94,226,169, 52,190,107, 0,173,163, 24,236,165, 30, 36,184, 34,115,101,255, 53,183,
+238,148,119,174, 72, 36,210,219,163, 69,171,148,149,101, 74,149,132, 86,225, 24,173,235, 12,195,124, 38,180, 76,109, 93, 61, 22,
+ 47,154,189,213,125,104,111, 50,245,135, 14,200,206, 87,169, 22,189,166,232, 36,121,197, 34,171,160, 21,215,198, 10, 69,226,112,
+129, 72, 88, 82,100, 37, 0,128,192,166, 94,219,133,115,102,236,238, 54,170, 63,145, 62,205, 29,210,108,133,106, 65, 36, 69, 36,
+ 43,152,225, 81,192,221,178,232,238,220,185,179, 15,192, 62, 15, 15,143, 84,145, 72,132,252,252,252, 47,242,160,200,222, 78, 67,
+123,147,169,147,219, 33, 75,166, 81, 45,138,164,144,162,160, 79, 86, 38,178,172,205,140,111,236, 93, 55, 93,152,146, 20, 7, 46,
+151, 11,177, 88,140, 91, 15,195,145, 17,121,233,107, 4, 22, 72,146, 92,229,235,235,187,114,198,140, 25,200,204,204,196,229,203,
+151,241,221,119,223,225,196,137, 19,206, 87,175, 94,221,226,233,233, 9, 22,139,133,128,128, 0,104,181,218,247,229,208, 12,158,
+ 50,101,202,130,161, 67,135,226,217,179,103,144, 72, 36,159,121,178,178,179,179,189,119,239,222, 61, 52, 54, 54,182, 82, 79, 86,
+ 41,180,173, 93,175, 37,119,201,242, 95,161,146,167,177,211,147,159, 4, 5,222, 34, 31,103,101,101, 9, 1,228, 84, 55, 61, 13,
+ 48,192, 0, 3, 12,208,219,171, 85,158, 22, 73, 47, 20, 81,233,101,237,151, 16, 88,101,237, 19,165,188, 96,234, 82,191,135,253,
+157,247,164,151, 71,139,109,219, 4, 84,106, 68, 9,161,149,246,217,239, 2, 99, 11,189,186, 14,181, 20,216,123, 15, 23,199,209,
+ 18,100,102,102, 10,172,172,172,148, 37, 5,130, 80, 40,132,131,131, 3,164, 82, 41,246,239,223, 15, 84, 62, 40,154, 50, 25, 58,
+ 22,109, 71, 77,194,115, 39, 30, 24,173,166,216,179,181,119,194,132,207,196, 22,151,203, 45, 26, 27, 86, 89,163,251,180,208,211,
+244, 24, 0,211,210,165,206,207, 2,145,104,130,192,170,134,213,156,233,147, 57,177,105, 42,220,113, 95,146,125,118,227, 98,113,
+ 34, 35,158,145,128,156, 71,149,240, 69, 15,220,115,180,180, 39, 43,169,133, 75,157,101, 2,161,224, 7,158, 69, 45, 59,223,121,
+211, 57,177,169, 42,226, 78,219, 69,185,231,126, 89, 36,140,129,241,130, 36,100,223,213, 35,123, 86,126,247,221,119, 43, 25,134,
+ 97,104,154, 94, 14, 0, 37,237,157,231,243, 3, 39,250,147, 18,129,238,203,164,231, 54, 46, 54, 78, 68,197,246, 90, 53, 29,212,
+201,214,220,228,198,222,245, 51,132,146,228,120,240,249,124, 24, 27, 27, 35, 49, 53, 7, 28, 54, 75,241,149,229,141,223,185,115,
+231,197,211,167, 79, 71,120,120, 56,166, 77,155, 38, 73, 72, 72, 56,127,234,212,169,105, 43, 86,172, 96,123,121,121, 65, 34,145,
+ 96,211,166, 77,218,135, 15, 31,174, 7,176,169,204,242,200,102, 79,254,249,231,159,153,148,148, 20, 34, 38, 38, 6,246,246,246,
+152, 57,115, 38,111,253,250,245,197, 99,178,170,226,201, 42, 66,114,114,114,208,205,219,143, 49,224,218, 86, 80, 90, 85, 80,118,
+102,194,253, 55,209,210, 32, 11, 30,111,190, 99,203,166,213, 74, 79, 3, 12, 48,192, 0, 3,190,137, 23,235,121, 69,251,255, 5,
+ 40,171,235, 80, 47,161,245,126,199,178,137, 46, 19,103, 44,132,145,115, 39,168,162, 46,128,206, 79, 45,246,104, 9,196,230,176,
+168,233,134,108,153, 10,103, 2, 95, 2,192,251,170, 88,149,151,151,135, 86,173, 90, 97,215,120,215,110,202,188, 76,129, 17, 0,
+ 21,223, 68,121,145,215,249,206,213,171, 87,229, 52, 77,159, 4,112,181, 18,154, 85,141, 27, 55,222,249,235,175,191,242,220, 70,
+ 77, 68,254,147, 7,165, 61, 40, 48, 50, 50, 2,159,207,199,171, 87,175,112,231,206, 29, 53,128, 85,149,100,232, 83,138,162,194,
+ 78,157, 58,149, 84,191,142, 99,239, 86, 45,154,205, 90,186,196,215,248,245,131,155, 88,190,126, 39, 93,191,181, 87,206,134, 19,
+ 23,243,114,196, 53,187, 43, 36,111, 67,245,184,213,176, 82, 34, 43,165, 97,237, 26,221, 90, 52,105,188,112,249,242,101, 38,145,
+ 15,110, 97,197, 47,123, 25,151,230, 61,114,126, 57,119, 41, 55, 67, 88,171,151, 50,237,205, 51,125,210, 48, 40, 40,104, 31,128,
+125, 69,251,165,237,245, 93,179,141,118,109,211, 91,186,225,196, 57, 89,174,113,205, 30, 21,217,107,237, 54,184,163,147,181,249,
+141, 29,107,127, 20,126, 74, 78, 0,159,207,135, 88, 44, 70,130, 36, 27, 43,183,158,150,105,104,186,247,215, 10, 45, 99, 99, 99,
+190, 70,163,193,174, 93,187,144,144,144,208, 1, 64,194,139, 23, 47,246,142, 28, 57,114,123,211,166, 77, 27, 70, 70, 70,190,207,
+207,207,159, 1,224, 77,121, 36,102,102,102, 29,172,173,173,137,199,143, 31,227,199, 31,127, 84,207,156, 57,147, 59,110,220, 56,
+ 66, 42,149, 86,215,147, 5, 0,112,116,116,244,232,217,189, 61, 58,245,156, 22,164, 86,102,223,143,125,243, 71, 16,201, 60, 18,
+ 84, 55, 61, 13, 48,192, 0, 3, 12,248,159, 65,245, 2,131,123, 0,108, 87, 75, 76,109,236,200,253,228,191,113, 38,147, 23, 29,
+204, 40,158,237, 99,114, 47,252,192, 92,217, 52,142,185,186, 99, 14, 51,173,111, 99,166,161, 13,241,201,213, 18, 83, 61,190, 20,
+110,159,173,238,253, 93, 3,104,123,214, 3,211,179, 30,152,190,174,208, 2, 88,218,178,101,203,139, 62,109,255,138,163,229,211,
+ 22, 12,128, 31, 1,136,203, 49,171,172, 21,195,237, 1,236,111,213,170, 21,117,247,238, 93,230,237,240, 30, 76, 72, 67, 43,102,
+198,140, 25,204,138, 21, 43,152,209,163, 71, 51,214,214,214, 84, 97, 66,216, 87,198, 57, 96,192, 0, 39, 0,168, 81,163,134, 89,
+107,183,250,159, 94, 5, 94,102,238,251,111,103, 14,249, 12, 97,218, 53,117,203,176,107,216, 37,204,200,190, 65,139, 74,146,175,
+152,211,206,206,110, 9,195, 48,189, 25,134,177, 7, 0, 23, 23, 75,113,203,134,245, 83,194,110, 95,102, 30, 28,221,201, 28,242,
+ 25,194,180,111,214, 40,211,201,205,243,141,192,166, 97, 91,125, 56,203, 66,153,246, 54,105,152, 97, 91,191, 99,104, 5,246, 22,
+115,214,105, 59,226, 82, 82, 74, 42,243,244,233, 83,230,234,213,171,204,131, 7, 15, 24,255, 83,151,152,154,109,134,231, 91, 53,
+ 29,212,169, 10, 69,167, 60, 59, 77,251,246,237,203,188,127,255,158,233,211,167, 15, 3,192,180,154,156, 23, 99, 99, 99,153,136,
+136, 8,102,233,210,165, 12,128, 35,211,167, 79, 87,228,228,228, 48, 61,122,244, 72, 40, 20, 88,236,234,216, 89,183,182,227,134,
+193,253, 59,175,242,249,113,168,199,215,166,231, 55,132,129,211,192,105,224, 52,112,254, 47,112,254,127,134,125,161, 87,171,232,
+179,165, 94, 30,173, 32,128, 66, 38,246, 53,177,209, 28, 91,191,105,199,252, 93,251,142, 44, 92, 60,107,178,168,179,123, 79,132,
+223,254, 29,231, 2, 78,201,148, 42,245, 38, 46, 11,191, 70,100, 66,254,174, 18, 43, 10,227,104,125,134,144,144, 16,161, 69,189,
+191, 98, 48,125, 40,136,205,186,183,138, 55, 40, 1, 48,229,229,203,151,191,122,122,122,174,251,161, 83,219, 33, 62, 29,187, 65,
+171,213,194,223,223, 31,241,241,241,231, 1, 44,211,215,227, 22, 30, 30,158,209,168,158,243,108, 14,139,189,112,198,232,193,214,
+233, 31, 95, 35, 41, 42, 4, 0,160, 82, 41,180,159,222,223,111, 94, 21,227,140,140,140,158, 90, 91, 91,191,181,182,182,150,186,
+214,169, 49,133, 15,206,242,105,222, 3,109, 50, 99,223, 32, 49,178,160,103, 84,165,148,107,146,222,223,109, 88,157,220,117,118,
+118,230,139, 56,152, 90,166,189,106,165, 54,245,195,155, 22,250,240,200, 85,234,245,171,183,248,247, 90,187,112, 2,223,196,196,
+ 4, 47, 35, 62, 96,249,111, 39,100, 10,181,182,119, 70,248,197,111,210, 61,198, 48, 12,180, 90,173,222, 19, 29,202,193,226,230,
+205,155, 55, 88,183,110,157,203,248,241,227,241,181,158,172,146,136,142, 77,246,117,172, 81,183,209,135,183, 47, 61, 45,140,184,
+199,190, 38, 61, 13, 48,192, 0, 3, 12,248,159, 65,223, 66,103,206,148, 18,159, 33,149, 10,173, 34, 68,164, 65, 14, 96, 77, 29,
+ 86,254,222, 37,235,182,172, 36,137,173, 19,104,134,249,157, 34,177, 58, 38, 19,233, 95,105,156,156,195, 6,213,107,208,104, 54,
+ 0,112,216,213,107, 32, 11,241, 30,192,208, 3,143,158,181, 57,240,232,217, 79,133,199,214, 2,168, 82, 95,174, 49, 27, 17,238,
+141,234, 58,118,110,217, 88,192,210, 41,144, 20,245, 17, 89, 50, 37,110, 69,198,103,147, 12,249,123, 85,141,138,137,137,185, 7,
+ 0,182,166,194,168,206,141,234,213,236,210,170,177,144, 67,168,145,244,250, 37,114, 20,106,220,140,140,207, 1, 65, 84,123, 64,
+245,183,178, 55, 53,252,210,243, 63, 65,244, 32, 8,226,246, 82,159, 81,252,149,191,157,252,166, 34, 11,128, 60, 57, 57, 57, 83,
+ 46,151, 91,166,164,164,168, 81,253, 32,113, 31,114,115,115,155,206,153, 51,103,205,130, 5,216, 12, 53,220, 0, 0, 32, 0, 73,
+ 68, 65, 84, 11, 22,110,220,184,145, 91,157, 49, 89,229, 65,154, 28,127,161, 75,227,111,151,255, 6, 24, 96,128, 1, 6,252, 79,
+ 96, 74,169, 79,232, 45,180,138, 5, 67, 26,210, 1,204,168, 91,151,153, 23, 29, 13,245,183,178,172, 44, 79,215, 87,226, 57,128,
+254,213,190,154, 36,242,158,188,143,207,127,250, 62, 62, 31, 52,195,208, 12,163, 34, 73, 36,202, 52,154,245,239, 99,146,171, 63,
+235,142, 32,116,207, 63, 36, 40, 94,124, 76, 84, 50, 52,205,208, 12,163, 38, 8,124,210,106,233,245,145, 49,241,151,254, 27,236,
+205, 8,191,248, 40,128, 34, 58, 63,122, 26, 49, 79, 38,211,236,204,136,186, 24,252, 13,243, 69, 27, 30, 30, 62,166, 67,135, 14,
+ 19,117, 58,221, 94, 0,218,175,224, 82, 83, 20,181,120,195,134, 13,231,195,195,195, 79, 7, 7, 7, 75,190,133,200,250, 91,243,
+223, 0, 3, 12, 48,192,128,127, 43,170,183,168,116,121,248,150, 34,235,191, 17, 17, 31,226, 90,253, 29,188,145, 31,226,154,252,
+127,176, 55, 53,234,194,139, 84,192,251,111, 74,222,155, 58,157,238,230,183, 20,213,215,175, 95,175,141, 50,150,213,249,111,203,
+127, 3, 12, 48,192, 0, 3,254,181,152, 82,158,248, 98, 27,210,198,128,127, 1,152,111, 37,178, 12, 48,192, 0, 3, 12, 48,160,
+ 26, 40,215,163, 69,160,252,153, 3,183,171,240, 7,213,153,125,112,219,192,105,224, 52,112, 26, 56, 13,156, 6, 78, 3,231,255,
+ 28,231,191, 17,246, 40, 24, 16,127,165,240,179, 66,241,245, 45, 97,152,250,106,224, 52,112, 26, 56, 13,156, 6, 78, 3,167,129,
+243,223,142, 50, 7,194, 3, 5,131,135, 13, 48,192, 0, 3, 12, 48,224,255, 19,248,133, 91,117,127, 55,192,128,191, 91,108, 21,
+ 11,174,234,140,209,170, 95,248,249,225,111, 52,214,199,222,222,126, 74,179,102,205,220,184, 92, 46,153,151,151,183,250,238,221,
+187,171, 74,159,212,185, 17,251, 5,139,132,211, 95, 71, 8,128, 96, 1, 36, 9, 29,131,164, 7,175, 20,173, 13,249,254, 95, 13,
+103, 35, 19,235, 63, 9,146,197,211, 81, 26,232,180, 26, 20, 12,183, 42, 0, 77, 83,241, 58,141,202,171,188,139,237,154, 15,174,
+ 73,233,232,141, 0,179, 11, 32,167, 3,244,110, 2,236,105, 12,168, 61, 4, 88, 63,130,197,252, 2, 29,177,136,205, 97, 45,145,
+132,156, 77,252, 55, 36,216,153, 51,103, 88, 95,115,253,240,225,195,203, 92, 64,212,193,193, 33, 64, 40, 20,214, 43,239, 58,153,
+ 76, 38,145, 72, 36,158,255,242,242,216, 5,192, 14, 0,141, 75, 29,127, 3, 96, 54,128,192,175,253, 3, 15,128,109, 11, 76,229,
+ 2,139, 0, 64, 3,252,146, 10,236, 11,250, 47, 26, 99,104,109,109,125,159,205,102,187,200,100, 50, 89, 94, 94, 94, 93, 99, 99,
+227,104,145, 72, 36,162, 40,234,125,122,122,122,151,138,174,101, 10, 38,165, 84,138, 38,128,241, 59, 96,164,142, 36,103,114,128,
+ 93, 42,154,222, 91, 88,131,235,179,192,237,116,252,181, 60,215, 66, 0,187,171,248,187, 1, 6,252, 29,248,170, 89,135,174, 5,
+245, 3, 60, 0,116,105,211,166,141,173, 76, 38,195,155, 55,111, 82, 1,220, 7, 16, 84,184,189,251, 22,150,146, 36,185,121,203,
+150, 45,243,103,206,156, 89,188, 24,244,171, 87,175,208,188,249,151, 49, 66, 89, 36,156,238, 94,190,109,243, 60,252, 29,218,244,
+ 24, 86, 40,180, 72, 64, 38,129,103,207,182,213, 53,193,216,220,220,124, 53, 65, 16,195, 73,146,172,180,210,160,105, 90,199, 48,
+204, 25,169, 84,186, 18, 64, 94, 85,254, 72, 36,228,107, 41,157,174,204,255, 96,179, 88, 58,153, 92, 85,110,216, 11, 11, 11,139,
+ 96,146, 36,235,148, 92, 48, 27,248,124, 1,237,242,126,163, 40, 42, 41, 35, 35, 67, 31, 17, 42, 32,217,220,217, 4,193,237, 9,
+146,118, 5, 8, 16, 32,223,209, 58,245, 45,154,210,108, 3,160,252, 26,145,101, 95,163,238,131,185,203, 54, 56, 69, 68,189,193,
+ 82,159,209,216,184,227, 8,150,204,158,136,109,251, 79, 96,246,148, 81,104,212,168,113,133,181, 46, 13,238,250,101,179,134,247,
+240,219,117,218,125,201,140,225,124,191, 93,103, 58, 47,245, 25,201, 91,191,243,116,231,165, 62, 35,248,126, 59, 79,187, 47,153,
+ 53,220,104,253,238,179, 52,128,177,213, 49,114,148,139,131,140,160,168, 50,223,140, 25, 54, 91,117,226,125,138,232, 63,241, 68,
+143, 31, 63,190,153, 66,161,120, 57,186,103,203, 13, 45, 92, 29,147,203, 58, 39,243, 83,178, 99,244,219, 16, 95, 14,215,168,213,
+ 64,223, 35,175, 42,116, 15,240,249,117,222,188,121,227, 66,211, 52,116, 58, 29, 40,138, 42,254, 84,171,213,232,210,165,203,183,
+154, 56,211, 31,192,234,130,135, 21,126, 0, 78,127, 5,151,152,205,102,207,229,241,120, 30, 20, 69,185, 1, 0,135,195,137, 82,
+169, 84, 65, 20, 69,109, 1,144, 95, 69,190,173,201,201,201,141,196, 98, 49, 52, 26, 77,241, 2,244, 44, 22,171, 97,205,154, 53,
+119, 41,149, 74,151,175,189,121, 91, 96,106, 71,119,247,109,227,230,207,103, 41,238,223,199,182,195,135,183, 34, 55, 23, 0,118,
+ 85,118, 45,143,199,187, 65,146,164,115, 85,254,143,166,233,120,181, 90,237, 85,149,107,216,108,182, 75, 74, 74,138,141,131,131,
+ 3,242,242,242, 32, 18,137, 68, 69,251, 95,131, 32,128,232, 13,116,161, 88,172, 57,150, 86, 86,157, 95,222,188, 41,106,210,164,
+ 9,201, 98,177,150, 64,255, 32,213,124, 0,155, 24,134, 49, 42,108, 47,182,181,111,223,190, 3, 65, 16, 20, 0,134,166,105,242,
+233,211,167,163,104,154,102, 23,214,121,155, 0, 28, 6,160, 50,232, 0, 3,254, 1,111,214,254,170, 10,173,171, 0, 60,218,180,
+105, 99,228,237,237, 13, 15, 15, 15,184,184,184, 64, 32, 16, 20, 84,226,153,153,182,161,161,161, 35,238,223,191, 63,226,242,229,
+203,120,253,250,181, 2,192, 67, 0,101, 62,212,221,251,185,207, 20,136,249,219, 1, 32, 61, 41, 83,146, 20,147,182, 93, 34,145,
+108, 2, 80, 50, 68,120,221,177, 99,199,206,155, 53,107, 22, 2, 2, 2,112,226,196, 9,168, 84, 42,228,229, 85,160, 95,228,105,
+144,222,217, 0,136, 98,129,132, 32, 64,104, 3,136,108,171,157, 82,230,230,230,171,103,207,158, 61,167, 81,163, 70,197, 81,204,
+181, 90, 45, 40,138,130, 86,171,133, 84, 42,197,188,121,243, 10, 26, 90,134, 1, 77,211,184,118,237,218,204, 41, 83,166, 64, 42,
+149,206, 45,139,179,125,171, 26, 47, 72,130,116, 42,242,213, 48, 58, 93,210,147,208,164,214,148, 78,199, 82, 42, 53,101,174, 84,
+ 46, 16,112, 43, 20,121, 28, 14,199,233,245,159,127,218,144, 60, 30, 24,157, 14,160,105, 48, 52, 93,152,156,133, 27, 83,112,140,
+209,209, 96,180, 58,208, 20, 13, 74,161, 66,219,233,211,245, 73,138,142, 28,158,209,137, 49, 63,204,183,107,215,190, 61,167, 86,
+ 13, 7, 80, 58, 26, 31, 99,147,236, 94,190,120,210,233,204, 31,187,166,169, 21,121,163, 0, 84, 43,206, 22, 79,104,114,115,231,
+158, 3, 78,207, 67, 35, 16,120,247, 62,110,223, 9, 2, 0,220,184, 27, 92, 36,184, 43,205, 42, 80,249, 77,103, 79, 26,196,223,
+176,243, 36,103,246,164,193,172,141, 59, 79,113,102, 77, 28,200,218,176,253, 4,119,214,196,129,172, 13, 59, 78,112,103, 77, 26,
+196,242,219,118,168, 25, 0,115, 0,210,242,200,202,203, 35,130,162,248,199,162, 83, 89, 0,144,190,119, 47,180,105,105,112, 88,
+185, 18, 0, 48,166,174,173,222, 93, 19, 86, 86, 86, 47, 56, 28,142, 83,101,231,105,181,218, 74, 69,240,248,241,227,155, 43, 20,
+138, 23, 20, 69, 49,108, 54,219,119,244,224, 94, 23,123,119,110,158, 89,242,156, 87,175,194, 44,215,175,255,115,208,233,151,121,
+204,136, 86,198, 47, 3, 54,143,111,221,111,193,145,176, 10, 26,100, 82,165, 82,225,253,251,247, 40,185,200,123, 9,232,170,249,
+ 72,145, 0,182, 89, 90, 90,182,203,204,204, 28, 3, 96,105,110,110,110, 51, 22,139, 5, 11, 11,139,165,106,181,250,163,169,169,
+233,193,156,156,156,224, 66,175,145,190, 75, 6,116, 49, 49, 49,241,191,112,225,130,121,203,150, 45,201,140,140, 12,212,174, 93,
+ 27, 89, 89, 89,109,239,223,191,223,106,210,164, 73,147,242,242,242,190, 47,124, 25,212, 23, 13,132, 66, 33, 51,110,220, 56, 66,
+167,251,235,118, 15, 29, 58, 4,175, 38, 84, 61,107, 51,161, 92,169,102,114, 2,223,155,254,200,229,114, 31,198,199,199,231, 84,
+ 53, 49,184,192,162,113,243,231,179,196,113,113, 16,135,133, 97, 76,110, 46,123, 99,129,119,171, 82,161, 69,146,164,179,255,137,
+223, 93,120, 60, 30, 40,138, 42, 22,131, 69,117,148, 86,171,133, 70,163,129, 86,171,133, 78,167,131, 86,163,133,223,218, 95,170,
+ 93, 23, 10,133, 66,161,189,189,125,170, 80, 40, 20,126,165,184,172,153, 69,146, 63,180,104,213,106,202,202, 65,131, 4,207,158,
+ 61, 19,144, 36, 9,138,162,176,105,211, 38,138, 97, 24,179, 70,128,201,107, 32,183,170,220,124, 62,159,253,199, 31,127,140,226,
+241,120, 0, 0,181, 90,141, 38, 77,154, 16,134, 54,223,128,255,160,216,250,194,203, 85,145,208,234,147,155,155, 11,157, 78, 7,
+ 99, 99, 99,176, 88,159,183,251,150,150,150,232,217,179, 39,186,116,233, 2,111,111,111,188,126,253,218,200,219,219,187,103,121,
+100,163,231,247, 67, 13, 23,219,194,198,132,182,127,116, 37,116,195,161,159,207, 90,127,250,244,105,126,137,211, 38, 77,157, 58,
+149,200,204,204,196,240,225,195,239,171, 84,170, 1,168,224,225,211,209, 72,242,244, 30, 3,154, 33,140,182, 60, 61, 64,168,149,
+ 10,134, 36, 73, 69, 81,215, 97,117, 82,137, 32,136,225, 14, 14, 14, 56,121,242, 36,212,234, 47,195,133,153,152,152, 32, 50, 50,
+242, 47,175, 26,139,133,246,237,219,179, 8,130, 24, 14, 96,110,217,156,164,211,163,231,113, 54, 69,251,253,122, 54,230,182,111,
+ 69,166,166,164,202, 24, 0,196,178,101,203,138,133, 27, 0,172, 94,189, 90, 31, 59, 65,114, 56, 72, 15, 10,250,171, 34,102,147,
+ 32,185, 4, 8, 14, 64,178, 11,122, 81,193, 0,140, 14,160, 41,128,214, 2, 2,251, 26,250, 36, 67, 91,199,154, 46, 1,235,127,
+219,109,166,210, 50, 56,121, 41, 16,177,177, 49, 96,145, 36,234,214,115, 65,175,174,157, 57,173,218,116,168,241,203,170,249,151,
+ 83, 18, 62,244, 1,240,172,202, 9, 77, 51,130,122, 53,173,112,240,208, 75, 88,155,139, 49,124,208,119, 48, 18,240,177,113,199,
+239, 88,187,196, 7, 46,117,157,177,111,235,186,114, 47, 55, 53, 53, 93,227,230, 82,207,121,247, 31, 87,224,214,176, 33,107,183,
+255, 21,184, 53, 42,252,108,236,198,218,237,127, 5,141, 26, 55, 98,237,246,191,130,102,141, 27,212,122, 33,121,186, 38, 43, 43,
+203,167,252,244, 44,149, 71,189, 10,242,136,147, 79, 23, 87,218,113,211,166, 1, 64,177,208,170, 10, 56, 28,142, 83, 74, 74,138,
+ 77,101,231, 85,230, 53, 40,244,100,189,160, 40, 10,105,105,105, 68,118,118, 54, 99,102,102, 54,232,250,190,165, 23,188,220,155,
+103, 1, 64, 88, 88,152,133,159,223,250, 65,167, 94,228, 66,241,100, 39,113,236,207, 32,122,204, 0,143, 23,151, 54,140,111,133,
+194, 37, 33, 74, 67,165, 82,197,182,104,209,130, 41,252,238,200,231,243,185,165,202,155, 67,253,250,245,191,240, 90,235,209,165,
+184,237,241,227,199, 62,141, 26, 53, 66,195,134, 13,131,219,181,107,103, 34, 18,137,112,253,250,117,184,185,185, 53, 54, 49, 49,
+121,122,230,204, 25,206,226,197,139,155, 31, 62,124, 24, 0,102,234,145,156, 61, 60, 61, 61, 79, 6, 4, 4, 8,184, 92, 46, 20,
+ 10, 5, 34, 35, 35, 97,106,106, 10, 30,143,135,129, 3, 7,178, 58,117,234,100,217,181,107,215,115,239,222,189, 27,133, 42,204,
+128, 82, 42,149,204,210,165, 75, 33, 20, 10, 33, 20, 10, 33, 18,137, 32, 18,137, 32, 22,128,216, 59,187,166,209,172,253,217, 70,
+115, 87,238,221,224,191,123,213,221, 26, 53,232, 21,137,137,137,217, 85, 45, 11,138,251,247, 33, 14, 11, 3, 74, 60,187,250,194,
+ 84,100, 1, 95, 95,223,202, 60, 82,224,114,185,232,216,177, 99,165,124, 22, 22, 22,231,217,108,246,103,111,166, 20, 69, 9,124,
+125,125,117,239,222,189, 19,145, 36, 41,162,105, 26,190,190,190, 58,138,162, 4, 54, 54, 54,193, 52, 77,167,102,100,100, 12,169,
+136,183, 43, 32, 8, 6, 6, 19, 28,206, 92,123, 7,135,218, 30,117,235, 10,111,223,190,205, 2, 0,103,103,103, 70, 34,145,100,
+ 95,186,116, 41,143, 13,236,113,102,152, 63,170, 32,178, 84, 0, 22,146, 36,185,141,207,231,179,107,213,170, 21,191,124,249,242,
+199,133, 30, 82, 48, 12, 67,214,170, 85,171,173,145,145,145,179, 74,165,162, 80,208,117,104,240,102,253, 11,192, 48, 76,171, 2,
+221, 94, 12, 53, 0, 94,145, 3,191,160,181,131, 85,169,227, 0,144, 81,248,162,104, 91,206,126, 38,128,215, 0, 26, 0,176, 41,
+252,237, 57, 65, 16, 89,213, 48,179,124,143, 86, 64, 64, 64,241, 43,108,191,126,253,138, 27, 22, 99, 99, 99, 60,127,254, 28, 4,
+ 65,192,216,216, 24, 38, 38, 38, 48, 53, 53, 69,110,110, 46, 94,191,126,141, 55,111,222, 32, 46, 46, 14, 4, 65,160,110,221,186,
+ 40, 42,236, 37, 80, 92,193, 29,255, 53, 0, 2, 49, 31, 4, 1,180,236,214, 12,205,186, 52, 65,155,103,209,179, 95,220, 38,246,
+ 75, 36,146,247, 0,216, 77,154, 52,153,212,190,125,123,252,246,219,111, 80,169, 84,191,149, 35,178,138, 57, 31,188,166, 90, 3,
+128,189,189,253,130,163,215, 63, 10,199,246,174, 39,151, 72, 36,155,171,145, 56,159, 85,196, 25, 25, 25,122,175,197, 71,211, 52,
+164, 82,105,133,156,165, 61, 4, 91,182,237, 52,203,203, 73,197,207, 27,143, 66,171,213, 98,254,252,249,160,105,186,120,203,206,
+206,214,203, 78, 70,167,251,210,119, 64, 22,244,158, 18,108,160,230,200, 2, 93,145,112,114, 39,136,255, 99,239,186,195,162,184,
+214,247, 59,179,125,233,189, 41,160,162, 40, 8,130, 13,197,134,189, 68, 76,172, 49,118,163,137, 55,137, 37,150, 68,108,209,152,
+ 40, 36,214,152,104,212, 24,163, 49, 54,236, 98,139,221,196,174, 32, 82, 20, 20, 17,144,186,244,178,109,118,103,206,239, 15,138,
+128,108, 65,115,127, 55,247,102,223,231,217,103,119,118,102,223, 61,101,230,156,247,124,231, 59,223, 33, 0,197, 2,120, 53, 95,
+245, 59, 33, 9, 79, 40, 61,176,226,155, 77, 54,209,143, 94,224,248,197,104, 48,165,153,200,126,112,180,210,228,216,109, 28, 14,
+170,120,232, 18,208, 18,159, 46,249,214,118,233,167,147, 14,168, 21,101, 62,168, 59,141,120,193,240, 67,195,226,171,149, 43,177,
+125,211,122,124,187,126, 19, 74, 75,138, 33, 16, 56, 84, 53,244, 44, 88,150,213,159,119, 66, 6,135,205,153, 74,125,243,227, 17,
+ 4,181,117,197,225,179,119,208,163,189, 39,142,254,126, 15,189, 58, 54,199,241, 11,209,232,219,165, 37, 78, 95,141,195,167, 51,
+198, 81,227,206,237, 28,220,152, 58,218,184,241, 7,155,178,210, 92, 68,173,218,141,188,205,155,145, 54,115, 38,130,170,174,185,
+ 67, 81, 16, 54,109, 10, 8, 13,215, 81,125, 36, 38, 38, 66,165, 82, 53, 52, 50,135,175,175,175,193,122, 87, 40, 20,247,181, 90,
+ 45,201,205,205,165,114,115,115, 97,110,110, 78,197,199,199,177,126,126,254, 35,200,163, 67, 63, 1, 64,120,248,234, 17, 7,239,
+151, 66,126, 99, 19, 20, 55,191,135,176,121, 44,189,253,203, 25,204,135,203,183,221,175,245,140,214, 73,103, 78, 78,206,144,156,
+156, 28, 0, 64,139, 22, 45, 30, 37, 37, 37,181,169,158,106,174,154, 66, 20,106,181, 90,239,234,233, 68,173, 86, 11,149, 74,133,
+254,253,251,243,244,229,221,214,214,182,171,175,175, 47,162,163,163,177,105,211, 38,187, 62,125,250,224,201,147, 39,160, 40, 10,
+171, 87,175,166,218,182,109, 43,200,207,207,199,160, 65,131,112,228,200,145,110,165,165,165,134,202,211,210,220,220,124,231,201,
+147, 39, 37, 52, 77,163,172,172, 12, 28,199,161,123,247,238,160,105, 26,113,113,113, 88,178,100, 9,142, 28, 57,130, 99,199,142,
+ 73, 59,118,236,184, 83, 46,151,251,162,238,180,190,174, 58, 34, 74,165,146,136,197, 98,136,197, 98, 72, 36, 18, 72, 36, 18,136,
+ 68, 34,148, 43,129, 15, 55,164,169,120, 18, 7,206,175,125,143,150, 83,103,175,166,215, 46,123,255, 18,128,227,198,222,243, 64,
+165, 79,214,119,191,252,178,105, 66, 73, 9, 13, 0, 59, 40,138, 99, 8,249,214,152,231, 29, 0,202,149, 37,240,244,106,138,195,
+ 7,142, 97,212,216,225, 13,138, 44,129, 64, 8,161, 64, 0, 43, 59,115,131,156, 66,161,208,249,209,163, 71,246, 2,129, 0,132,
+ 16,176, 44, 11,134, 97,114,151, 46, 93,234, 56,116,232, 80,203, 51,103,206,208, 67,135, 14,229,108,109,109, 43,238,220,185,147,
+167,213,106,237,123,246,236,169,147,211, 12, 8, 80, 90,183,250, 78,196,211, 6, 68, 44,254, 68, 60,105,210, 36,222,212,169, 83,
+145,158,158,142,105,211,166, 41,207,159, 63,175,206,201,206, 62, 46,226,184, 31, 24, 32,214,216, 54,185, 30,182, 4, 4, 4,116,
+ 56,122,244,232,251, 97, 97, 97,247, 22, 44, 88,240, 85,237,147,107,214,172, 89,121,250,244,105,207, 17, 35, 70,252,250,224,193,
+131, 45,141,105,151,222,180,239, 48,113,190, 25,116,105,145,106,227, 40, 69, 81, 81,181,218,236,208,234,227,176,176,176,197,225,
+225,225,241, 20, 69, 69,213,254,190,250,186,170,193, 98, 84, 67,199, 85,191,181, 91,180,104,145,127, 68, 68,196,234,224,224,224,
+253, 55,110,220,120, 6,160,177, 66, 75,191,143, 86,117,134,106,103,178, 94,167,134,210,210, 82,148,150,150, 34, 35, 35, 3, 91,
+183,110,173,122,160, 5,224,243,249,224,243,249, 53,254, 12,186,112, 49,234,207,239, 1,124,223,161, 67, 7,193,195,155,145,103,
+ 62,223, 62,187, 95,167,254, 29,120,247, 47, 62, 28,141,202,253, 8,135, 76,158, 60,217, 1, 0,118,239,222,157, 15,224,204,127,
+ 72, 53, 71, 38, 39, 39,127,234,234,234, 90,227,163, 82,123,250, 80,171,213, 66, 34,145,160,218,151, 69,169, 84, 98,235,214,173,
+ 90, 66, 72,164, 30, 78, 36,197, 95, 66,114,252,229,202,223,113, 28, 56,246,229,239, 87,172, 88, 1, 66, 72, 77,103,255, 81,149,
+229,196,160,200,107,168,204, 73,189,247,122,223, 19,150, 53, 48, 61, 33,156, 61,122,210, 76, 87,142,226,227,196,165, 24, 8, 4,
+ 2,112,181,172,153, 2, 94,229,104, 57,254, 73, 22,220,156,253,240,246,184, 25, 46, 71,127,253, 97,182,150, 81,126,211,216,178,
+246, 9, 8,198,156, 79, 63,197, 79,219,183, 99,201,242,149, 53, 10, 64,203,178,208, 26, 76, 39, 77,247,239,238, 15,109,121, 22,
+120, 60, 30,250, 6,181, 4,143,199,195,128,224,214,224,241,120, 24,212,221, 7,124, 62, 31,131,123,180, 69,171, 86,173,192,231,
+243,105, 3,245,142,164,248,139, 72,142,191, 82, 75,244, 18, 16, 0, 76,118,246, 43,215,107,178,179, 65, 60,236, 27,123,111, 97,
+218,180,105,197, 25, 25, 25, 76,253,115,238,238,238,194,107,215,174,217,232,152,182,171,129, 84, 42,237,200,231,243,239, 23, 22,
+ 22,114,102,102,102, 52,199,177,156,159,159, 63,239,236,182,197, 71,171,175, 89,180,104,241,209,119, 59, 90,141,216, 19, 25, 69,
+132,205,122, 80,148, 64,172,253, 96,249, 54,161, 64, 40,237, 8, 40,140, 25, 60,208, 42,149, 10,143, 31, 63,134,161,244, 16, 66,
+244, 78,211, 20, 21, 21, 77,246,245,245,189,246,253,247,223,219, 81, 20,133, 63,254,248, 3, 60, 30,175,230,149,146,146, 2,154,
+166,241,249,231,159, 51,165,165,165,211, 13,165,141,207,231,127,122,248,240, 97,107,145, 72,132,178,178,178,154,231,134,199,227,
+225,209,163, 71, 88,187,118, 45, 38, 79,158,140,244,244,116,184,185,185, 97,254,252,249, 22, 17, 17, 17,159, 50, 12,179,210,136,
+ 42,138, 85,171,213,157,204,204,204, 32,145, 72, 80, 45,184, 0,224,247,120, 65,156, 66,161,104,103,111, 47,119,113,188, 26,117,
+162, 91,159,183, 3,237, 29, 93,131,179,179,179, 27,181,117,214, 83, 96,123, 42,203, 46, 29,114,244,168,211,245,163, 71,185, 91,
+ 39, 79,190, 16,151,149,109, 51,250, 30,210,208, 72, 75,121,129,142, 29, 59,226,254,253,251,232,216,177, 99,109,209, 4,145, 72,
+ 4,161, 80, 8,161, 80, 8, 7, 91,163, 92, 40, 8, 77,211,184,126,253, 58, 88,150,133, 90,173,134, 90,173, 70,219,182,109, 11,
+ 47, 95,190,108, 1, 0, 41, 41, 41,100,226,196,137,197,183,111,223, 70,251,246,250,247, 83, 87, 82,212,197, 21,171,215, 89,127,
+179,113, 39,172,237,156,113,245,234, 85,246,236,217,179,101, 20,144,148, 28, 31,191,254,109,224,116, 36,192, 52,166,204,156,157,
+157,175,241,120,188,102,181,191, 43, 40, 40,176, 29, 57,114, 36,138,138,138,222, 26, 57,114,100,143,170, 54, 33,243,208,161, 67,
+ 19, 1, 64, 36, 18,129,166,105, 22, 38,252, 87,193,144, 22,169, 45,148,234, 11,174,240,240,240,208,250,223,213, 22, 85, 13,125,
+174,253,219,136,136,136,213,181,184, 21,175,145,124,195, 62, 90, 81, 81, 81,164, 1, 5,105, 52, 12, 9,173,106, 68, 71, 71,107,
+220,220,220,126, 74,142,121,222,175,101,128, 23,164,230,226,129, 0,190, 23,139,197,243, 38, 77,154,132, 91,183,110, 33, 46, 46,
+238,103,188,225, 42, 28,127,127,255,115, 98,177,216, 83,199, 52, 73, 90, 92, 92,220, 32, 29, 29,195,242,147, 39, 79, 66,159, 51,
+252,165, 75,151,106,119, 74,181,157,225, 27,190, 49, 56, 2, 13,163, 65,133, 92,241,178, 19,175, 18, 90, 21, 21, 21, 24, 59,118,
+108, 29,139, 86, 94, 94,158,193,252, 81, 20,133,181,199,143,227,124,100, 36,222, 10, 12,196,145, 59,119, 16, 49,105, 60,124, 60,
+155,128,176, 20, 8, 5,164,239,251, 1, 5,165,229,216,123,241, 58, 10,203,228,152,208,179, 39,188,173, 28,244,243, 10,132, 3,
+130,186, 6, 11, 47,220, 72,128, 64,192, 7, 13, 14, 68, 35,135,155,111,111,240,104, 26,214,206,205, 33, 20, 8, 32, 16,240,145,
+146,145, 15, 95,255,206,162, 40,145,100,192,235, 8, 45,119,207,230, 96, 89, 22,147, 39, 79,198,254,253,251, 97,239,226, 9,107,
+119,127,124,189,126, 59,222,234,223,211, 96,254,171, 71,240,124, 62, 31, 60, 30,239,149,247,234,207,198, 88, 39, 9, 71,192,212,
+175, 35,142, 0,132,160,233,170, 85,104,186,106, 21,238, 84,253,103,219,138, 10, 40, 20, 10,160,139, 95,163, 68,150, 90,173, 70,
+ 70, 70, 6,147,147,147,227,220,192,249, 92,181, 90,109, 80,216,236,218,181, 43,118,202,148, 41,157,236,236,236,238,197, 62,120,
+160, 9, 8, 12, 20,156,217,186,248, 88,245,180, 33, 0, 4, 6, 6, 22, 46, 94,188,248,216,196, 49,161,195,183,132,189,199,126,
+188,242, 87,190, 88, 42,237, 20,186, 96, 87,236,190, 49, 99, 12,207,205,168, 84,169, 1, 1, 1,196,152,124,201,229,242, 28, 61,
+167,135, 1,248,178, 67,135, 14, 86,125,250,244,193,181,107,215, 48,106,212, 40, 21,195, 48,201, 0, 48,116,232,208,214,123,247,
+238, 21, 37, 36, 36,192,209,209, 81,144,150,150,182, 19, 6, 28,228, 69, 34, 81,239,206,157, 59,211, 42,149,234, 21,145, 21, 17,
+ 17,129,113,227,198,161,117,235,214,224, 56, 14,229,229,229,232,211,167,143, 96,211,166, 77,189,141, 20, 90,115,124,124,124,214,
+162,114,213, 97,237,182, 48,177,106, 10, 10, 5, 5, 5, 57, 49,183, 47,198,247,236, 63,178, 83,179, 86,254,174,113,177,247,245,
+ 18, 58, 57, 57, 45,162,105,250, 93,142,227,120,165,165,165, 25, 49,106,117,171,182,158,158,206,221,135, 15, 71,137, 64,192,251,
+238,226, 69, 58,183,172,204, 2,128, 81, 83,144, 74, 77, 5, 60,189, 42, 93,253, 70,141, 29,142,251,247,239, 99,244,123, 35, 32,
+ 20, 10,193,231, 11, 42,159, 77, 97,165, 69,203,198,193,202,168,123, 83,163,209,212,180,225,213,126, 94, 12,195,160,218, 53,203,
+204,204,172,230,156, 74,165, 2, 69, 81,250,238, 13,186, 79,175,238,184, 17,157,164,157,254,249,119, 42, 65,193,253, 8, 23,142,
+219,245, 2,200,125,131,230,220,251,224,202,101, 78, 82, 43,107,176, 26, 13,252,134,143,174,121, 78,110,239,216, 34, 5,199, 73,
+139,211, 82, 49, 43,242,228, 95,189,103,174, 9,255, 1, 24,210, 34,181,133,210,155,130,162,168,168,176,176,176,197, 0, 72, 88,
+ 88,216,226,234,227,240,240,112, 5,128,204,215, 20, 91,175, 88,185,248,127,133,200,170,158, 94,208,135, 62,125,250,204,178,180,
+180,220, 84,125,156,113, 43, 19, 25,183, 50,225,219,198,175,123,135,192, 78, 37,227,198,141,131,189,189, 61, 22, 44, 88, 64, 0,
+252,220,216,255, 79, 73,138,183, 0, 64, 92, 93, 93, 23, 84, 53,200,129,119,238,220,113,188,123,247, 46, 58,119,238,252,210,116,
+207, 48,232,209,163,135, 62,170,178, 42,167,246,185,127,157,149,140, 3,195, 48,144,203, 21, 80,171, 25,104, 53, 28,180, 90, 45,
+ 58,250, 89,226,215,237, 97,149,223,105,171,173,103,149, 86,179,166, 46,150,176,180, 16,104,104,154, 82,220,139,205,105,176,197,
+ 84,171,213,136, 77, 75,195,131,231,207, 1, 0,111,135,235,119,124,253,245,226, 53,180,109,219,214, 80,106, 91, 54,117,115, 65,
+214,249,216,202,198, 91,145,129,187,127, 30,132,165,165, 5, 0,192, 47,100, 2,132,194, 74,161, 85,161, 96,224,208,198, 29, 20,
+ 33, 58,195, 2,152,217,186,156,227, 11, 37,158,132,229, 64, 8, 7,194,177, 32,132, 3, 79, 32, 52,155,245,209,251,224, 56, 22,
+ 65, 65, 65,160,120, 60,176, 26, 21,198, 12, 27,128,162,146, 50,216,219, 24,215, 73, 8,133, 66,132,132,132, 72,117,157,127,242,
+228,137,162,182, 48,211, 95, 71, 26, 84, 84, 40,160, 82,169,192,168,181, 96, 52, 90,176, 45,132,248,106,233,120,104, 25, 45,228,
+239, 5,131,209,104,193,125, 58, 2,140, 90,131,116, 51,154, 14,240,117,208,208,160, 20, 49,137, 50, 43, 67, 66,171, 90, 28,232,
+ 66, 67, 62,129, 58,196,214,131, 41, 83,166,116, 12, 8, 12,188,255,110,255,192,117, 15,227,226,179, 30,198,197,191,114,157,103,
+235,192,212,143, 35,246,207, 23, 8,165, 29, 67, 23,232, 95,117, 88, 27,181,167, 17,223, 16,139,203,202,202, 2, 44, 44, 44,144,
+148,148, 4, 30,143, 7,138,162,158, 0, 8, 0, 0, 87, 87,215,167,124, 62,223,139,199,227, 97,243,230,205, 20,159,207,111, 23,
+ 28, 28,188, 88,169, 84, 30,212, 51,160,243,181,180,180,172, 99,205, 18, 10,133, 8, 11, 11,195,196,137, 19,107, 68,150, 80, 40,
+196,174, 93,187,208,169, 83, 39,168,213,106, 95, 35,211,123, 23, 64, 79, 35, 44,126, 84,149, 56, 55, 40, 70,181, 90,237,148,130,
+119,223,109,133,171, 87,209,221,203,171,109,199,142, 29,193, 48, 47, 13, 58, 94, 94, 94,238,101,101,101, 57, 10,133,226, 55, 84,
+134, 33,136,209, 43,138,148, 28,210, 82, 42,221, 79,239,223,191,143,160,160,160, 26, 11, 86,109,107,150, 80, 40,132, 84,100,209,
+ 40,161,197,113,149,237, 82, 89, 89, 25,125,245,234, 85, 7, 31, 31, 31, 10, 0,124,124,124,168,152,152, 24, 59, 51, 51,179,252,
+150, 45, 91, 26, 26, 0, 11, 1,160,247,192,145,252,243,103, 79,155,107,129,149, 57, 60,222, 74,190,193, 54,146,104, 88,142,211,
+233,116, 47,181,178,198,174, 41, 99, 1, 0, 95,244, 31, 92, 51,216, 58,251,229, 98, 8, 4, 2,244, 91,176,248,149,103,137,227,
+ 56, 30, 76,248,159, 18, 89, 13, 89,180,222,172,111,126,105,209, 10, 15, 15,143, 15, 15, 15,127,197, 58,214, 72, 24,182,104,213,
+ 54,221, 53, 22,213, 15,171, 46,172, 95,191, 30,237,218,181,211,219, 17,109,218,180, 9,123,246,236, 89, 15, 32,165,209, 38,199,
+126, 29,252,176,225,104,188, 87,107, 63, 10, 0, 86,126, 58,140,174,168,168,192,245,235,215, 97,109,109,141, 39, 79,140, 14,251,
+101,105,109,109,253, 37, 77,211, 99,120,245, 87, 0, 52, 44, 48, 89,142,227, 34, 75, 74, 74,116,134,119, 32, 4, 96, 52, 90, 84,
+200,149, 80,171,213,248,244,243, 31, 12, 38, 34, 28,160, 24,117, 25, 63,164, 87,176, 84,151, 69, 39,168, 93,111,124, 50,201,226,
+149,206,155, 71, 3, 52, 13,180, 15,170,180,184,196,220,137, 7,199, 1, 44, 7, 56, 56,217,226,231,125,235,244,138,124, 45,203,
+ 85,141,142, 89,148,171, 88,248,118, 13,197,139,196,171, 53, 22, 36,145,176,114,202, 88, 40, 16,128, 35, 84,101,212, 7, 93,173,
+174, 72,234, 89,148,157,226,189, 61,234, 33, 62, 12,109,135, 67, 23, 98, 49,186,127, 0, 46,223, 78, 64,159, 46,109, 17,159,252,
+ 28,126,222,205,176,121,103, 36, 8, 65,217,143, 27,190,206,121,217,161,105,211,140,177,104,221,186,117, 75, 81,223,138, 85,251,
+157, 24,238, 15, 65,200, 75,139,150, 66,169,194,130, 69, 70,133,222,169,172,163,158, 93,165,198, 92,172,207, 98,101,140, 16,171,
+111,217,130,129,240, 44, 45, 0,116, 2, 22,254, 39, 27, 78,150,101,113,234,212,169,154,250,104,168, 30,107,215,157, 17, 34, 7,
+105,105,105,136,143,143, 71,215,174, 93, 81, 82, 82, 2, 1, 77, 99,254,195,135,104, 59,105, 18,212, 66, 33, 56,142,131, 72, 36,
+194,140, 25, 51,140, 46,207, 70,182,206, 85,142,215,172, 33,242,117,193,193,193,173,146, 42, 42, 16,255,232, 17,250,175, 88, 1,
+ 0, 56,125,250,116,157,123, 98,222,188,121,162,132,132,132,105,247,238,221,155,150,149,149,181, 30,192,124,157,237, 44, 81,213,
+248,104,189, 59,126, 20, 90,249,180,192,158, 95,246,213,156,159,247,217, 28, 8, 4, 66, 8,132, 2,216, 88,219, 24,149, 27,141,
+ 70, 83, 35, 90,229,114, 57,125,250,244,233,166, 3, 6, 12, 16,206,153, 51,135, 2,128, 61,123,246,208,223,127,255,189,249,249,
+243,231,133, 77,154, 52,201, 54, 96, 33, 40,205, 44, 80,137, 1,192,195,195, 3, 63,108, 59, 65, 15, 29, 58, 20,115,230,204,129,
+ 70,163,193,150, 45,149,207,213,184,113,227,192, 48, 12, 14, 31, 62, 92,253, 28,235,181, 70,105, 25,230,149,251,134,162, 40, 8,
+ 4, 2, 8, 69, 66,128,227, 64, 81,148,249,154, 53,107, 86,198,199,199,119,246,241,241,129, 74,165,154,132,202,197, 31,166, 56,
+ 90,255,101, 98, 75,159, 22,105,200,215,170,202, 42,165, 11,178,218,126, 91,186,132, 90,109,159, 45,188,222, 2, 10,227,124,180,
+ 26, 2,143,199, 51,104,173,170, 94,170,171, 15,243,230,205,131,165,165,165,174, 14,136, 60,124,248, 48, 33, 59, 59,123, 59,128,
+ 31, 94,171,114, 46, 70,199,127, 57,119, 68, 25,170,230, 86,109,108,108,242,251,246,237, 91, 14,128, 57,120,176,238, 0, 89,165,
+ 82,233,236,192,173,173,173,191,220,177, 99,199,236,225,195,135,211,245, 67, 12,212,158,222,171,126,105, 52, 26, 28, 60,120,112,
+246,194,133, 11, 81, 82, 82, 50, 87, 95, 39, 46,175, 80, 64, 81,229, 8,253, 52,238,144,177,141,186,206, 83, 22, 54,174,104,218,
+ 34, 64,103,103, 66, 11, 43,125,136,156, 61, 94,118, 96,150,150, 18,176,122, 56, 41,138, 78,121,158,158,213,196,221,197, 14, 79,
+ 51,100,112,110,214, 14, 69,153, 47,203,129,207,231, 65, 80, 53,117,104, 99,101, 14, 89, 94, 30,104,154,167, 87, 24,127,189, 55,
+ 26,183,227,158,227,240,133, 24, 48,202, 10,108,216,125, 22,140,170, 28,140,178, 2,140,178,242,125,245,194, 15, 64, 81,200,209,
+168, 42, 90, 55,166,222,249,124, 62,186,116,233,162, 83,232,100,102,102, 26,105,209, 34, 53, 22, 45,133,178,145,117,100,220,200,
+ 73,175,197,170,250,252,235, 10,131,234,144, 15, 82,169,180,211,174, 93,186,195, 56, 52, 4, 23, 23,151, 51, 22, 22, 22,205,141,
+189,190, 17,193, 75, 87,219,216,216,124,233,227,227,227,187, 97,195, 6, 1,143,199, 67,191,126,253, 90,187,184,184,164, 1,128,
+159,159,159, 91,117, 27,243,241,199, 31,147, 91,183,110,197, 85,142, 49,116, 67, 36, 18, 61,178,182,182,238,212,167, 79, 31,148,
+148,148, 32, 35, 35, 3,230,230,230,104,187,110, 29, 30,126,252, 49, 2,183,110, 5,221,183, 47, 40,138,130, 72, 36,194,195,135,
+ 15, 33,149, 74, 31, 41,149, 58, 67,190,117, 1,240, 45,128,238,120, 57, 93, 72, 0, 92, 71,101,216,133,219, 13,180,119, 52, 0,
+176, 28,103,168,178,198, 47, 88,176, 0,197, 2, 1, 48,116, 40,132, 41, 41, 96, 24, 6, 93,187,118,173,177,178,119,237,218, 21,
+124, 62, 31, 1, 1, 1,112,115,115,195,230,205,155,199,235, 19, 90,202,114, 6,105, 41, 47, 16, 28, 28, 92, 99,185, 26, 58,116,
+104,141, 69, 75, 32, 16,212, 88,182, 40,214,176,112,165, 40,138,212, 30, 36,179, 44, 75,241,249,124,254,220,185,115,169, 81,163,
+ 70, 17,181, 90,205,137, 68, 34,250,240,225,195,212,229,203,151,249, 21, 21, 21,134,172, 13, 21,239,189,247,158,147,187,123, 83,
+100, 60,141,199,161, 67, 4,235,215,175,199,181,107,149, 81, 54,146,146, 42, 23,174, 86, 31,247,233,211, 7,205,155, 55, 7, 49,
+112,227,251,143, 24,131, 47, 6, 12,169,108, 79,154, 59, 66, 32, 20, 64, 36, 20, 98,193,163, 23, 53,117,109,181,107,191, 40, 34,
+ 34, 98,180,143,143, 79,229,212, 62,192, 55,197,209,250,239,130, 1, 67,143,172,158, 72, 82,215, 58,150, 1,160,170,142,101,181,
+ 4,149,140,162,168,187,132,144,206,245,174,173, 62,175,174,247, 94,125,254,193,107, 36,191,122,175,195, 87,196,151,190, 17,113,
+242,205,155, 55,189, 59,118,236,136,244,244,244, 87, 86,194, 85,119, 92,230,230,230,144, 74,165,184,113,227, 6, 0, 36,235, 34,
+187,124,249,242,247,168,140,186,140,170,105,131,224, 62,239,246,190, 17, 52,184, 51,246,134,239, 43,201,206,206, 14,192,203, 24,
+ 58,148,155,155,219, 68,129,136, 63,214,203,223, 35, 4, 28,247,237,197,147,215, 87,232,203,161, 87,107,191,114, 0,138,234, 85,
+135,175,185,250, 16, 52, 77,143, 25, 62,124, 56,157,144,144,128,177, 99,199, 98,207,158, 61, 58,175,157, 56,113, 34,246,239,223,
+143,225,195,135,211,139, 22, 45,210, 25,222,161,174,181, 68,253,151,221,148, 73, 79, 30,224,215,253, 59,116,250, 32, 57, 57, 85,
+250, 99,229,229,229,215,124,215,185,163,254,153, 17, 78,171, 62, 31,125,239, 78,112,183, 94,253,132, 25,185,197,224,180, 42, 40,
+203, 94,254, 94, 94,156, 11,162, 85, 66,104,102, 7, 23, 7,107,220,191,249,187,154, 81, 43,207,235,227,156, 61,220, 15, 31, 15,
+243, 5, 8,135, 17,243,127, 70,212, 15,179,106, 70,208, 61, 70,205,193,197,131,223, 25,237,227, 87, 31, 2,129, 0, 15, 31, 62,
+ 84,232,178,102,241,120, 60, 99, 98,114, 85, 89, 29, 53,144,203, 21,144, 43,148,127,101,219,225,232,236,236,252,163,173,173,173,
+ 68,135,144,114,116,116,116,252,209,222,222, 94, 98,236,212,161, 46,145, 85, 21, 87,235,222,148, 41, 83, 26, 37,182,196, 98,113,
+243,228,228,228,154, 96,165,250,222,213,106, 53,250,244,233, 99,108,240,210,147, 0,158,185,186,186, 94,111,219,182,173,245,211,
+167, 79,177,111,223, 62,161, 64, 32,240,168,110, 63,202,202,202,192,227,241,144,151,151,167, 1,240, 62, 12, 76,157,169, 84,170,
+171, 87,175, 94,109, 63,108,216, 48,222,163, 71,143,192,227,241, 42,211, 21, 28,140,192,173, 91, 17, 55,119, 46, 66,158, 63,135,
+146, 97, 32,145, 72,112,238,220, 57, 70, 46,151, 95,213,197, 39,149, 74,183,167,166,166,250, 73, 36, 18, 48, 12, 3,142,227, 64,
+211, 52,197,231,243,123,216,216,216,108, 2,208,185, 94,101, 57, 5,118,238,211,134,213,106,217,236,244,167, 50, 67, 5, 80, 80,
+ 80,128,147, 39, 79,162,107,215,174, 8, 9, 9, 65,102,102, 38, 82, 82, 82,240,214, 91,111,213, 92,243,224,193, 3, 68, 71, 71,
+163,101,203,150,134, 45,122,180, 6, 45,219, 52,135, 80, 40,172,180,230, 8,132, 85, 3, 31, 65,141, 37, 75, 40, 16, 66,192, 23,
+ 64, 34,149, 24,109,209,162, 40, 10, 52, 77,131,162, 40, 72,165,210,234, 65, 54,215,180,105,211,236,194,194, 66, 87, 0, 60,169,
+ 84, 10,150,101,245, 14, 90, 56, 66,188,133,249, 55,178,230, 47, 92,235, 20, 30,126, 1, 23, 46,228,129,166,105,184,186,186,130,
+166,105,164,166,166,130,166,105,120,122,122,130,166,105,100,102,102, 86,139,196, 34,232, 22,195, 53,207, 13, 69, 81, 53, 34, 75,
+ 40, 18,214, 88,182, 0,160,184,184, 88, 57,124,248,240,223, 84, 42,213, 84,188,222,174, 39, 38,252,141, 65, 81,212,221,255,196,
+111, 27,129,161, 85,194,234, 21,167,120,125, 55,227, 91,221,186,117,219, 58,110,220,184,126, 27, 55,110,132,133,133, 5,178,179,
+179,107, 58, 68,145, 72, 4,119,119,119, 20, 22, 22, 98,219,182,109,120,241,226,197, 37, 0, 51,140, 77, 81,118,118,246,173, 39,
+ 49,201, 5,125, 70,119,179,247,235,214,198, 38, 35,249, 69,215,236,236,236, 27, 85, 34,235,231,113,243,222,154,218,103,100, 16,
+132, 34, 1, 50,158,228,224,226,201,235,255, 47,149,201,227,241,120, 20, 69, 97,236,216,177, 70, 93,255,222,123,239,225,234,213,
+171,208, 55,205,200, 85, 91,180,228, 74, 84, 40,254,186,129,213, 39,179, 38,226,147, 89, 19,107,196,132, 49, 83, 47, 0,224,230,
+118, 64,143, 95,191, 93,233, 0, 0, 32, 0, 73, 68, 65, 84,208, 98, 54, 70, 29,216,246, 97,135,160, 96,207, 78,126,205,113,251,
+ 94, 12,246,110,125,105,100,216,249,253, 74,124,179,243, 18,220,157,109,193,168, 42,112,230,208, 79, 57,140, 74,190,241, 53,141,
+114,149,226,150,162, 64, 8,215,168,188, 87,139, 39,129, 64, 0,127,127,127,157, 22,173,194,194, 66,133, 33,107, 86, 77, 29,169,
+ 53, 40,175, 80, 64, 33,255,203,132, 86, 96,143, 30, 61,206, 71, 70, 70,218, 59, 57, 57, 33, 43, 43,171,190,208, 10,236,222,189,
+251,249,200,200, 72,123,103,103,103,100,100,100, 24, 29, 86,164, 1,145, 5,153, 76, 70, 21, 21, 21,113,182,182,182,141, 18, 91,
+ 52, 77, 67,165, 82, 33, 49, 49,209,216,191, 53,122, 53,151,181,181,245,174,253,251,247, 91,231,231,231,131,199,227, 33, 49, 49,
+177,206,170,195,234,215,207, 63,255, 44, 28, 49, 98,196,142,226,226, 98,189,203,218,180, 90,237,250,137, 19, 39, 78,203,204,204,
+180,117,114,114, 66,118,118, 54, 68, 34, 17, 8, 33,160,250,244, 65,207,103,207,192,176, 44,164, 82, 41,146,146,146,176,125,251,
+246,138,170, 80, 49, 13, 26,200, 40,138,242, 22, 10,133,152, 48, 97, 66,157, 19,187,119,239,198,219,157,120,157, 28,173,249,229,
+ 90, 72, 84,185,210, 33,103,120, 60, 30, 21,216,165,111,235, 46,189,134,250, 63,142,187,253, 84,150,251,194, 80,163,164, 81,171,
+213,240,241,241,193,221,187,119,113,225,194, 5,244,237,219, 23, 33, 33, 33,136,141,141,197,239,191,255,142,232,232,104, 80, 20,
+ 5,123,123,251,106,247, 11,189, 62, 24,106,185, 22,121, 89, 5,175, 88,175,234, 31, 11,133, 66,168, 20,198, 45,238,123,244,232,
+ 17,238,222,189, 91, 19, 90,134,199,227,105, 39, 77,154, 4, 66, 8, 73, 77, 77,133,165,165, 37,153, 50,101, 10,203,231,243,181,
+153,153,198,249, 7, 91, 88, 88,192,219,219,187,206,192,167,250,213,179,103, 79,220,187,119, 15, 52, 77,131,207,231,195,201,201,
+ 9,215,175, 95, 55,120,227, 87,139,170,106,145,197, 23, 10,234,136, 62,142,227,202, 98, 99, 99, 63, 4, 16, 91,101,201, 2, 76,
+113,180, 76,248,255,195, 41,188,186,177,180, 65,139,214, 51, 0,253,247,237,219, 55,254,216,177, 99,235, 55,109,218,228, 24, 26,
+ 26,138,162,162, 34,120,122,122,194,213,213, 21, 81, 81, 81, 56,125,250,116, 62,203,178,243, 1, 52,100,250,233, 15, 61, 49,107,
+ 50,159,102, 71,170,202,203, 63,238, 24,226,139, 75, 7,255, 8,119,113,113,153,193,227,241, 62,157,178,248,157,169,189,135,119,
+ 70, 82,116, 42,110,253,254, 16,185,233,249, 6, 57,235, 59,195,219,216,216, 76, 51, 51, 51, 19,161,129,165,196, 13,172, 58,172,
+225,100, 89,150, 85,171,213, 56,112,224,128, 81, 98,107,223,190,125, 80, 42,149, 96, 95,157, 95,173,225, 36, 28,161,248, 2, 49,
+220,220,125,192, 48, 21,224,184,215, 94, 80, 89,195, 89, 61, 2,125, 42, 18,193, 41, 63, 31,183,111,223, 54, 78,114, 15, 29,106,
+168,142,148,106,101,217,132,239, 86, 45,136,154, 25,246,173, 77,223,110,237,241,197,186,221, 96,152,157,160,121, 52,164, 98, 33,
+ 58, 6,117, 7, 15, 42,252, 24,241, 89,177,188,180,104, 2, 94,221,138,167, 14, 39,209, 55,195, 66, 0,150,227,112,225,218, 29,
+163,243, 94,107,154, 3,124, 62, 31, 79,158, 60, 81, 52,180,218,144,199,171,156,230,172, 30,169,235,227, 36, 28, 71, 9,132, 18,
+184,123,182,133, 90, 85,254,151,212,145,147,147,211,103, 71,143, 30,181,175, 14,149, 16, 27, 27, 11,138,162, 18, 95, 90, 28, 43,
+207, 43, 20, 10,196,197,197, 33, 54, 54, 22,168, 92,225,102,244,115, 84,109,201,146,201,100, 84,118,118, 54,204,204,204,232,216,
+216, 88, 85, 64, 64,192, 61, 3,207,119, 13,167, 82,169,124,174,203,127, 82,169, 84, 54,145, 72, 36,130,122, 29,158, 91,171, 86,
+173,146, 26,152, 66,124, 37,157, 37, 37, 37,183, 23, 46, 92,216,113,240,224,193,248,236,179,207, 10,109,109,109, 45,127,252,241,
+ 71, 62,143,199,163,102,206,156,201,230,229,229,149,255,244,211, 79,214,199,142, 29, 67,113,113,241, 13, 35,242, 94,166, 84, 42,
+ 63,236,214,173,219,238,179,103,207,154,121,123,123,163,180,180, 20,132, 16,236,218,181, 11, 51,103,206,132, 68, 34, 65, 82, 82,
+ 18,222,126,251,109,185, 92, 46,255, 16,175,250, 78, 86,115, 82, 20, 69, 17,142,227,176,108,217,178,154,224,164,213,193, 74, 45,
+165, 20,182,207,107, 97, 62,231,167, 18,243,241, 95,252, 52, 9, 0, 88,173,150,125, 28,119,251,233,174, 31,190,184, 44, 20, 10,
+175, 25,168,163, 37,115,230,204,249,113,232,208,161, 82, 11, 11, 11, 20, 22, 22,226,250,245,235,184,121,243, 38,110,221,186, 5,
+181, 90, 13,123,123,123,216,218,218, 34, 59, 59, 27,143, 30, 61, 82, 0, 88,162,143, 83,100, 38,128, 87,235,234,149,191,149, 22,
+ 44, 65,173,213,134,181,173, 91, 66,129,192,168,231,168, 87,175, 94,232,210,165, 75,181, 88, 97,211,210,210,178, 85, 42, 21, 85,
+ 75,244,103, 86, 11,114, 15, 15, 15,237,158, 61,123,136, 33, 78,142,227, 94, 17,211, 61,123,246,172, 25, 20,118,233,210, 5, 60,
+ 30, 15, 49, 49, 49,186, 92, 83,234,112,222,218,190, 25,103,191, 90, 2,145, 80,136,249,137, 25, 53,162,107,119,223, 14, 16,136,
+132,240, 29, 54,170,246,111,183,160,114,186, 16,245, 68,150,190,254,232,141,159,119, 19,231, 63, 30,217,120,141, 45,120,170,177,
+ 87,169, 84,158,249,224,131, 15, 34, 2, 3, 3, 63,216,176, 97, 3, 37, 20, 10,177, 98,197, 10,146,149,149,245, 75,213,136,161,
+232,117, 82, 69, 8,249,229,202,145, 27, 31, 77, 14, 27, 78,205,219, 56,165,199,189,139,113,143,218,117,243, 70,187,110,222,184,
+119, 41, 1, 63, 44,222,183,135,213,176,203,114,114,114,210, 13, 80,169,250,119,111, 83,223, 25,222,254,234,229,139,246,141, 93,
+117,200,113, 92,228,190,125,251,102,143, 28, 57,146,190,115,231,206, 43, 62, 89,213,219,238,112, 28,135,243,231,207,131, 97, 24,
+252,242,203, 47, 28,199,113,186,227,104,129, 28,255,110, 99,196,228, 95,126, 61, 46, 18, 9, 41,220,188,118, 24, 37, 69,250, 87,
+117, 9,133, 2,252,188,235, 8, 35, 20, 10, 30, 55,116,158, 97,152,140,139, 23, 47, 58, 15, 98, 89, 1, 77,211, 13, 9,168, 6,
+ 17, 25, 25,169,225, 56, 46,205,192,101, 55,114, 95,164, 15,251,250,179,247,247, 13,125,247, 3,231,110,221,122, 8, 28,156,156,
+ 65, 81, 20,242,114,243,144, 20,119, 71,115,230,240,142,220, 10,185,113, 91,240,188,191,246, 74,141, 79, 22, 0,132,206,220, 84,
+227,159, 5, 0,195,166, 44, 68,159,174,126,160,140, 49, 61,189, 20, 89,156, 86,171,133,185,185, 57,180, 90,109,131, 33, 30,172,
+173,173,165, 74,165, 82, 81, 21,136, 81,239,136,153, 0,127,121, 29,177, 44,235, 91, 84, 84,132,138,138, 10,220,188,121,147,172,
+ 90,181, 74, 38,147,201,106,156, 54, 53, 26,141,111, 97, 97, 33,202,203,203,113,227,198, 13, 18, 17, 17, 33, 43, 40, 40, 88,220,
+152,103, 72, 42,149,118,226,243,249,247,138,138,138, 56, 51, 51, 51, 90,163,209,104, 2, 2, 2,196, 82,169,212,232, 13,213,179,
+179,179, 7,235, 58,231,229,229,149,156,156,156,220,138,101,217,218,123, 32, 10,149, 74,165,119,183,110,221,140,105, 63,230,236,
+220,185, 19, 71,142, 28, 9, 42, 45, 45,157,152,150,150,182, 27, 64, 16,159,207, 71, 76, 76, 76,162, 82,169, 28, 55,114,228,200,
+ 93, 69, 69, 69,183, 81,185, 5,143, 49, 56,155,148,148, 52,193,215,215,119,231,151, 95,126,105, 17, 18, 18,194,119,115,115, 67,
+231,206,157,145,148,148,132, 83,167, 78,105,182,108,217, 82, 33,151,203,223, 7,112, 94,127,181,131,210,106,181, 16,137, 68, 53,
+ 47,177, 88, 12,161, 80,136, 50, 5,193,244,117, 41, 10, 45,164,138,245, 43, 62, 60, 69, 0, 42, 39, 35, 37, 63, 47, 39,227, 54,
+ 69, 81,215,178,179,179, 75,116,148,153, 72,169, 84,182, 39,132,240, 40,138,218,200, 48,204,148, 89,179,102,185,174, 94,189, 26,
+109,218,180, 65,126,126, 62,204,205,205,225,237,237, 13,153, 76,134, 59,119,238,176,114,185,124, 43,128,149,168,242, 31,209,133,
+226,252, 82, 52,117,241,168, 99,249, 36,132,128,176,128, 70,197,130,101, 8,212,148, 6, 2,129, 6, 66,161,208,152, 41, 21,194,
+113, 28,138, 92, 93,193,197,197,225,214,173, 91, 32,132,232,180,170,249,248,248, 24,101, 33,101, 89,246, 21,161,117,251,246,109,
+240,120, 60,244,232,209, 3,209,209,209, 53, 22, 45,163,252, 18, 9, 7,145, 88, 84,103,186,144,162, 40, 8, 69, 34, 8, 68,194,
+134, 86,227,152,172, 88, 38,252,109, 96,236, 60,118, 49,128, 25, 15, 30, 60,216,221,187,119,239, 40, 66,136, 0,149,243,145,127,
+188,201,159,231,228,228,220,191,113,234,254, 34,231,166,182, 17, 67, 38,246, 64,155,246,158, 96,181, 44,174,159,142,193, 47,171,
+143,237,207,204,200,156, 2, 35,246, 62,227, 56,238,114,247, 78,109,104,212,138,213,237,230,230,198,189,206,170,195,146,146,146,
+229,243,231,207,199,103,159,125,246, 58,171, 14, 27,196,195, 71,178, 25, 20, 72,211, 97, 67,122, 14, 2, 69, 19,181, 90,165,167,
+225, 67, 77,228, 82,161, 80,240,248,110,108,118, 64, 67,215,201,100,178, 65, 83,167, 78, 61,207,231,243,155, 55,166,204, 57,142,
+ 75,203,205,205,237,103,248, 74,237,117,149,162,212,251,228,254,109,115,207, 30,217, 57,136,227,216,150, 20, 0, 30, 95,248, 84,
+195, 48,231, 84,138,210, 13, 48,114, 83,233, 53, 51,130, 49,231,187,223,177,249,179, 97,152, 21,113, 16, 59,150, 77,199,162,117,
+251,240,237,103,115,176,106,211,111,248, 98,206, 4,140, 30, 63,149, 35, 20,253,167,177,249,224,241,120,103,183,109,219, 54,121,
+250,244,233, 53,139, 22, 8, 33,117, 26, 97,141, 70,163,224, 56, 14, 91,183,110,229, 0,156,213,199, 87,183,142, 40,162,207, 95,
+202,216, 58, 42, 45, 45,125, 63, 56, 56,120, 23, 0, 49, 33,228, 73, 81, 81,209,191,128,151, 91, 67,149,151,151,191,223,173, 91,
+183, 93,132, 16, 49, 69, 81,175,156, 55, 6, 85,161, 30, 58,217,218,218,222,171,178,100,137, 95,199, 33, 94, 95, 81,235,153, 86,
+ 52,102, 10,145, 3, 48,171, 86,196,247,213, 65, 65, 65,181, 55,149, 78, 44, 42, 42,234,244, 26,233, 58,175, 80, 40,252,150, 45,
+ 91, 54, 87, 34,145,244,145,203,229,173, 1,192,220,220, 60, 73,165, 82, 93, 86, 40, 20, 27, 96, 56, 54,149,154,227,184, 36,173,
+ 86,235,239,232,232, 88,185,162,182, 74,108, 1,192,137,123,236, 61,128,237, 92,105, 20,223,107,116,194, 78,159, 62,221,204,214,
+214,118, 32, 69, 81,163, 9, 33, 62,101,101,101,170,101,203,150,221,136,140,140, 44,105,222,188,249,144,161, 67,135, 82,118,118,
+118,184,123,247, 46, 41, 40, 40, 56, 12, 96, 49,140, 88,105,205,113, 92,218,154, 53,107,208,216,231, 93,223,121,134, 97,114, 78,
+159, 62,237, 48, 56, 47,143,207,113, 28,134, 13, 27, 86, 71,192,213,199,227,199,143,161, 82,169, 12, 6,115, 44, 46, 46, 70, 80,
+ 80, 80,157, 1,106,245, 43, 45, 45, 13,118,118,118,117,254,199,208, 24, 75, 85, 82,132,190,115, 23, 2, 85, 43, 74,171, 81,105,
+201, 34, 32,106,147,174, 50,225,239,139,127,247,230,155, 70,153, 22, 93, 93, 93,199, 74,204,197,159,120,182,118, 13,200, 74,201,
+ 75, 40, 43,145,239,201,206,206,222,166,163, 33, 55,138,179,145, 1, 75, 77,230,223,127, 19,231,203, 56, 90, 44, 8, 97, 65, 56,
+ 2, 66, 56,112, 28, 91,185,225, 53,225, 64, 88,150,162, 40,252,169, 86,232,141, 12, 94, 63,157,182, 14, 14, 14, 43, 9, 33,131,
+121, 60, 30, 93,187,161,174,253,185,202,146,117, 86, 38,147,125,209,128,229,245,191,174, 60, 35, 35, 35, 27, 20,255,198,174, 58,
+ 28, 51,102, 12,219,200,103,243,178,185,185,185,107, 67,231, 42, 42, 42,210,179,179,179, 7,254, 77,202,179,246,138,193,198,112,
+ 54,122,213,161, 33, 78, 79, 79, 79, 49,195, 48, 29, 0,120, 83, 20,101, 3,160,144, 97,152,115,249,249,249,185, 0, 58, 1, 88,
+ 86,245,155,175, 0,220,251, 15, 63,239, 82, 7, 7,135,157, 52, 77, 55, 53,230,199, 90,173, 86, 93, 88, 88, 56,185,222,128,224,
+229, 20, 60,192,147, 8,133,119, 64,211, 77, 26,122, 30,117,125, 6, 33,153, 21, 10, 69, 16,245,178,205,175,225,180,183,183,191,
+199,231,243,155, 26,145,182, 23, 5, 5, 5,157, 76,109,242,127, 53,231,127, 51,234, 59,193,235,140, 20,255,239, 16, 90, 38, 78,
+ 19,167,137,211,196,105,226, 52,113,154, 56, 77,156,255,235, 66,171,193, 99,211, 18, 88, 19, 76, 48,193, 4, 19, 76, 48,193,132,
+ 55,195,169,122, 98,235, 84,245, 7, 74,143, 42,109,140, 73,240,117,148,237, 5, 19,167,137,211,196,105,226, 52,113,154, 56, 77,
+156,255, 56, 78, 19,254, 66,152,204,170, 38, 78, 19,167,137,211,196,105,226, 52,113,154, 56,255,215,161,115,234,144, 54,149,141,
+ 9, 38,152, 96,130, 9, 38,152, 96,194,191, 7, 70, 11, 45,115,103, 31, 95, 7,207,128, 93,182, 77,219,197,218, 54,109, 23,235,
+224, 25,176,203,220,217,199,247, 31, 90,110, 82, 0,227,249,124,254,121, 23, 23,151, 82,232,216,122,231,127, 0, 86, 0, 70,163,
+ 50,190,207, 8, 0,102,127, 37,121, 8,192, 31, 11,124, 50, 9, 72,159, 4,164,143, 5, 62, 9,249, 31,244, 27, 92, 49,219, 53,
+248,218,153,241,103, 86,204,118, 13,110,240,252,124, 87,251, 91,191,143,249,110,245, 39,110,118,127,209, 95, 90, 58, 57, 57,109,
+119,118,118,126,238,228,228,148,230,228,228,180, 19,128,181,169,185, 51,193, 4, 19, 76,248,183,161,218, 71,171,250, 85,227,163,
+197, 7,128,168,168,168, 16, 0, 87, 0,244, 14, 13, 13,189, 90,255,215,182, 30,254,211, 91,182,104,249,217,215, 43, 22, 83, 46,
+ 78, 14,102, 90,150, 99, 82,159,103,180, 93,254,117,196,161, 44, 17,127,125, 81,122,220,142,215, 72, 20,197,227,241,198,138,197,
+226, 80, 0,213,130, 45, 81,165, 82, 69,177, 44,123, 0,198, 45,211,134,179,179,243, 53, 30,143,215,172, 49,127,204,178,108,122,
+110,110,110,143,215, 44,204, 49, 30, 30, 30, 59, 67, 66, 66,204,130,130,130, 32, 18,137,176,108,217,178,249,217,217,217, 27,140,
+ 37,176,181,245,178,100,196,146, 79,249, 34,209, 0,162, 81,251, 19, 16,128, 22,199,113, 90,213, 69,161, 74,181,190,168, 40,165,
+204, 72,170,197, 0,166, 84,149,213, 14, 0,107,222,228, 46,153,220, 30, 26, 13, 91,121, 79, 8,249, 96,143, 63,179,190,178,100,
+201, 18,126,104,104, 40,118,236,216,209, 99,251,246,237, 31,150,149,149, 93, 4,112, 2,192,211, 55,189, 43,157,129, 25,221,122,
+244,248,110,242,252,249, 60,197,181,107,248,110,231,206,141,168,140,183,180,185,177,247,146, 80,136,209, 14, 14,130, 80, 66,208,
+129, 2, 40, 10,136,145, 21,112,167, 25,134, 61, 0, 35, 98,177,233,193,120,212, 93,142,191,183,177, 4, 37, 79,201, 82,241, 48,
+223,158, 37, 79, 47, 47, 5, 48,164,254,121,173, 82, 50,153,240,220, 67, 21, 36, 58, 3,192,186, 55, 44, 86, 51, 71, 71,199,216,
+227,199,143, 55, 13, 10, 10,226, 3,192,189,123,247, 38,133,134,134,246,149,201,100,254, 0, 74,255, 67,141,144,132, 79,211,159,
+136, 4,130, 1, 44,203,182, 3, 0, 30,143,247, 80,173,209,156,215,114,220,102, 24, 25,147,205, 4, 19, 76,248,223,133, 33, 45,
+242, 55,135,206,200,240,213,153, 35,181,223,107,195,220,169, 77,219,174,253, 70, 61, 46, 41,147, 43,159, 63,207, 44,154,247,201,
+170,243, 31,206, 89,123,108,221, 79, 81,167,175,222, 78,188,229, 27, 52, 48,193,220,169, 77, 91, 29,212,186,230,112, 61,164, 82,
+233,253, 45, 91,182, 48, 73, 73, 73,164,184,184,152, 60,126,252,152, 28, 62,124,152,124,244,209, 71, 74,169, 84,122, 31,128,135,
+ 49,156,206,206,206,185,143, 47,253, 78, 94,196, 70,147,180,123,183,137, 70,163, 33, 12,195, 16,134, 97, 72,194,217, 40, 18,123,
+226, 8,137, 57,124,128,168,213,106,162, 86,171,137, 74,165, 34, 45, 90,180,200, 50, 50,157,245,225,230,231,231,167,142,138,138,
+ 34,135, 14, 29, 34,243,231,207, 39,129,129,129, 44,128,153,198,230,221,220,201,187,143,101,147, 0,217,244,176,205,204,169, 27,
+231, 72,252,179, 24, 18,255, 44,153, 68, 94, 72, 36, 83, 22,108, 98, 44,155, 4,202,204,157,188,251, 24,202,187,173,173,109, 87,
+138,162, 72, 53, 0,144,102,205,154,149,215,126,121,120,120,212,121,185,187,187,151, 55,111,222,252,169,189,189,125,135,134, 56,
+199,181, 3, 33, 9,123, 9, 73,216, 75,150,244, 2,137,143,143,191, 69, 8,185, 82,253, 82, 40, 20, 87,142, 30, 61,122,229,157,
+119,222,185, 2,224,109, 61,229,100, 84,121, 78, 2,210,203,142, 31, 39,100,195, 6, 66, 66, 66, 72, 34, 64, 38, 1,233,141,228,
+108,225,226, 34,136, 89,187,230, 67,245,241,227,191,144, 51,103, 78,145,211,167,163,200,177,163, 59,201,198, 13,159, 48,206,206,
+130, 56, 0,173, 26,193,201, 7,176, 10,192,122, 84, 90, 46,147,100, 50, 25,201,201,201, 33, 0,146,170,190, 91,239,232,232,184,
+ 14, 13, 91,223,250,215,182,100,205, 29,236,114,230,221, 33, 61, 72, 89, 73, 22,121,119, 72, 15, 50,119,176, 75, 29,203,214, 96,
+ 47, 47,203, 89,195,218,201,226,239,237, 97,103, 13,107, 39, 27,236,229,101,249,154,229, 73,161,114,159,208, 45,151, 46, 93,210,
+146, 90,208,104, 52,100,247,238,221,172,173,173,237, 47,141,224,108,237,232,232,152,102,103,103,151, 84,251, 75,199,128, 17,221,
+124,122, 78, 90,110,223,246,157,144, 70,164, 51, 72, 34, 20,190, 56,127,240, 71,182, 32,253, 33, 81, 43,114, 73,201,147,104,242,
+ 34,241, 22,217,189,109,189, 70,196,231,191, 0, 16,244, 38,247, 82, 35, 97,226, 52,113,154, 56,255,134,156,250,180,200,127, 51,
+248,245, 51, 88, 31, 98,177, 40,108,249,146,133, 84,113, 65,177, 66, 89, 90,166,214, 40,149, 74, 90, 72,148, 15, 19,158,229,209,
+124, 94,241,220, 57,179, 45,195, 22, 45, 9,171, 0, 38, 24,249,159, 30,129,129,129,119,142, 28, 57,226,100,103,103,135,146,146,
+ 18, 20, 20, 20,224,206,157, 59, 32,132, 96,228,200,145,226, 46,157, 59,119, 88,186,108,217,205, 23,153,153,193,208,221,241,190,
+ 20, 47,118, 14, 88,211,163,114, 47,218, 47,158, 23, 84,246, 58, 20,133,237, 99, 66,107,174, 89,249,162,114,183, 12,137, 68, 82,
+179, 33,241,107, 32,184, 95,191,126, 66, 0,152, 54,109, 90,105, 89, 89, 89,120,149,133,195,168,157, 86,205,157,188,251, 56,184,
+186, 69,253,184,117,141,180, 93, 75,111, 48, 26, 45,210,114,178,192, 23,216,160,105, 83, 33,166, 78, 24, 32,232,213,205,206, 97,
+213, 87,219, 79,229,112, 24, 33,207, 79, 62,167,139,203,198,198,102,247,129, 3, 7,112,240,224, 65, 0, 64, 82, 82, 18,188,189,
+189,205, 13,165, 33, 46, 46,206,235,237,183,223,222, 95, 80, 80,208,202,208,181,245, 3,227,139,197, 98,244,232,209, 3,109,219,
+182,197,241,227,199,123, 87, 89,182,222, 8,138,107,215, 96,241,224, 1,112,245,181, 6, 47, 45, 58,118,244,188,117,250,212, 30,
+135, 83,167, 19,177,110,221, 78, 60,125, 90,105,104,243,242,242,194,248,113, 99, 4, 15, 31,222,240, 27, 61,122,252,141, 63,254,
+120,218,163, 74, 40, 25,194,151, 63,253,244,211,226,230,205,155, 99,244,232,209, 99,252,252,252, 92,172,172,172,176,109,219, 54,
+184,186,186,122,169,213,234, 39,199,143, 31,119,203,201,201,193,236,217,179,145,155,155, 59, 95, 23, 81,239, 65,189,151,138,135,
+249,246,108,211,113, 50, 44,172, 92,241,211,190, 3,120,124,127,119, 79, 21,147,184, 84,200, 94,157,168, 32,226, 41,178,116,139,
+176,102,157, 66,236, 91,249,189, 13,207,142,209, 14, 74,246,143,103, 75, 7,180,136,224, 75,148,187, 87,172,203, 46,120,133,116,
+116, 36,207,191,244,145, 93,220,121, 20, 0, 43,184,106,129, 85, 99,173, 37,120,187, 87,175, 94, 53, 21,247,252,249,115,168, 84,
+ 42,248,250,250,210,106,181,186,143,145,229,218,122,224,192,129,127,158, 62,125,218,190,117,235,214,178,194,194,194,154, 19, 46,
+246, 54,131,174, 30,217, 56,123,213,119,191,249,252, 74,168, 98, 89,226,177,135, 6,184,130,186,119,237,120,225,204,145, 61, 22,
+ 84,121, 6, 68, 54,249, 0, 87,128,148,253, 63,131, 50,179,195,216,143,230,241,251,244,235,219,100,192,144, 81, 23, 30, 39, 63,
+237, 7,224,174,105, 92,111,130, 9,255,104,171, 22,249, 95,203, 83,141,208, 10, 13, 13,165, 26,202, 32, 71,184, 0,103, 39,123,
+233,198,181,187,238,242, 24,181,218,220,198, 90, 45,176,182,226, 40, 75,107, 30,163,214,148,123,122,121,138, 56,194, 5,232,224,
+175,191,196,147,146, 74,165, 71, 78,156, 56,225, 36, 16, 8,192,113, 28, 28, 29, 29,145,154,154,138,226,226, 98,148,149,149,225,
+105, 98, 34,154,123,184, 99, 69,216, 66,215,217, 11,195,142,200,229,242, 78,168, 59,141,248,202,178, 81, 86, 83,119,223,232,234,
+ 45, 88, 94, 25,242, 87,125,215,192, 57, 99,151,162,166,166,167,167,195,194,194, 2,254,254,254, 22,215,175, 95,255, 67,143,200,
+170,195,105,107,235,101,201,137, 69, 7,183,252,184, 76,202,104,226,144,144, 82,136, 54,205,123,194,217,222, 3, 89,133,106,220,
+186,115, 2,113,177,123,209,178,137, 7,102,126,212, 87, 18,177,230,208, 1,161,182,185, 71,113,113,106,105, 67,156,165,165,165,
+ 22, 45, 90,180,128,135, 71,229,190,103, 44,203, 34, 33, 33, 1, 44,203,214, 28,215,126,223,117,248, 18,180,165,105,152, 60,105,
+ 18, 10, 10, 10, 44, 26,226, 20,240,160,157,247,225,120,190, 84, 0,136,204,237,212,229,229,229, 53,219,112, 48, 12,131,152,152,
+ 24, 4, 7, 7,135, 68, 70, 70, 26, 82, 69, 70,149, 39, 3,124,251,221, 47,191,108,154, 80, 82, 66, 3,192, 14,138,226, 24, 66,
+190, 53,246, 94,114,114, 18, 28, 62,123,230, 87, 7, 30,253, 8,118,214,223,224,206,157, 52, 48, 76,101,122, 11, 10,242, 48,235,
+147, 82, 8, 5,150, 56,126,252, 55,123, 95,223, 30,135,115,114, 24,127,212,157, 70,108, 40,157,146, 51,103,206, 96,214,172, 89,
+ 72, 72, 72,112,171,222,163, 77, 42,149, 98,237,218,181, 60, 95, 95, 95, 55,115,115,115,156, 61,123, 22,185,185,185,148,190,116,
+ 94, 57,119,229,235,146,167,151,151,230, 80,103, 7,255,180,239, 0, 62, 24, 55, 22, 46, 36,229, 15,235,150,212,215, 3,135,117,
+255,130,240,220, 67,205, 45, 3,108,189,253,135, 65, 40,178,192,204,207, 87, 34, 41,238,164,173,188, 44,246, 19,138,205,112, 95,
+177, 46,114,206, 43,233, 60, 52,134,157,182,247,122,199,243, 30,119, 61, 31,196,124,120, 59, 59,122,123,236, 75,161,229,197,167,
+104,214, 26,168,220,214,228,201,147, 39,120,250,244, 41,248,124, 62, 20, 10, 5,180, 90,109,131,233,116,115,115,155,161,213,106,
+191,168,170,231, 93, 18,137,228,253, 61,123,246,216,215, 22,218,142, 1, 35,186,217, 91,154,247,203,205, 43, 40,186,113, 55,254,
+241,188, 25,163,123, 95,187, 21,151,193, 8,222, 73, 47,137, 61, 94,162,163, 60, 37, 82,145,232,240,217,163,191, 89,104,158, 93,
+130,185,111,111, 8, 44,188,193,106, 50, 33, 47,170, 64,217,211,108,168,126,252, 1,237, 63,153,139,147,199, 14, 89,248,181,235,
+ 20,169,210,104,188, 1,168, 95,227,217,108, 12, 76,156, 38, 78, 19,231,223,147, 83,167, 22, 33,132,116, 4,224, 92,117, 88, 80,
+165, 11, 28, 0,228,163,114, 71, 1,231,170,182, 67, 84,235,103,245,143,107, 95, 91,255,184,246,231,130,170,207, 78, 85,239,119,
+ 41,138, 42, 52,144,116, 87, 84,110, 77,120,170,234, 29,168,154, 74, 52,232,120, 76, 81,116, 41,203,114, 98,161,163,147,114,218,
+187,253,218,253,126,225, 94,140,153,131, 21,127, 80,239, 14, 33,119, 30, 62,187, 73,209,148,134,162,104,163,252, 62,120, 60,222,
+216,141, 27, 55,182,179,178,178, 2,199,113,176,182,182,134, 76, 38,131, 90,173, 70, 73, 73, 9, 84,101,165, 96,202, 74,241, 32,
+227, 57,186,135,244,198,168,193, 3,125,127, 59,118, 98, 44,203,178,251,245,241,186, 5,116,168,177,100,173,108,102,255,210, 52,
+145, 81, 92, 35,186,190,233,224, 13,161,133, 5, 6,204, 11,123,147,123, 32,250,212,169, 83,103, 70,142, 28, 57,100,193,130, 5,
+116,118,118,246,217,212,212,212,238, 0, 18, 12,138, 10,177,228,211,143, 63, 13,181,181,181, 32,136, 60,127, 2,189, 58,140,131,
+153,136,135,130, 82, 6, 20, 5, 36,198, 31, 1, 69,217, 33, 54, 41, 27, 61,219, 91, 97,224, 32, 95,139, 99,135, 18, 23,224,165,
+127,208, 43, 85, 83, 84, 84,132,188,188, 60,104, 52, 26,104, 52, 26,140, 30, 51, 6,191,238,222,141,138,138, 10, 40, 20, 10,168,
+213,106,176, 44, 11,154,166,113, 62, 42, 18, 25,207, 18,209, 45, 56, 24,208,177,245,210,238, 24, 8, 0,220,122,252,248, 49, 18,
+ 19, 19,241,226,197, 11, 72, 36, 18,184,184,184, 96,229,202,149, 80,169, 42,247, 19, 27, 51,102, 76, 8,128,135,111,250, 64, 61,
+ 5,182,167,178,236,210, 33, 71,143, 58, 93, 63,122,148,187,117,242,228, 11,113, 89,217, 54, 99,126, 43, 20, 98,244,154,111, 63,
+106, 99,110,110,142, 23,233, 27,225,227, 35,196,252,185,246, 8,255, 38, 31, 0, 48,123, 86, 83,116,238,228,128,210,226, 67,112,
+112, 90,140, 77,155,230,180,156, 50,101,253, 36,185,156,221,101,128,122,233,137, 19, 39, 70,121,123,123, 55,137,142,142,166, 68,
+ 34, 17,164, 82, 41,164, 82, 41, 36, 18, 9,242,242,242,144,154,154, 74,214,172, 89,147, 9, 96,169, 62,162, 21,155,178,111, 2,
+ 24, 50,119, 48,206, 60,190,191,187,103, 19,222,179, 7,163,102,246,120, 30,123, 43,186,236,247,243,215,191,210, 42, 37, 25,197,
+ 47, 46, 44,108,209, 57,218,225,147,207,190,196, 15,107,150,227,241,237,107,133,206, 30,165,155,165,148,170,193,116,134,132,172,
+224,187, 58,219,105,103, 76, 25,101,115,210,249,198,140,211,124, 74,150,147,127,127, 45, 82,163, 21,226, 86, 29, 38,182,246,162,
+213,151, 46, 93,146,246,234,213, 11, 74,165,178,198, 50,185,103,207, 30, 78,171,213, 94,110,240,222,100,152, 47, 50, 51, 51, 93,
+ 21, 10, 5, 6, 15, 30, 60,123,237,218,181,230,213,251,201,177, 44, 91,199,146,245,245,134, 95,207,125,250,197,230,203,231,246,
+127,227,246,117,216,251,189, 39,204, 92,117, 25, 58,246,145,228,211,244, 39, 39,143,238,116,145,216,106, 32,181, 27, 8,101,174,
+ 2,143,183,127, 0,121,169, 18,157,191,254, 18,128, 8,106, 13,141,109,195, 70, 67, 96,239,134,229,211,223,119, 91,178,237,167,
+143, 56,142,219,104, 26,215,155, 96,130, 9,245,224, 76, 81, 84, 20, 0,132,133,133, 45, 14, 15, 15,143,167, 40, 42,138, 16, 18,
+ 90,101, 64,137, 34,132,132, 86, 95, 83, 37,206, 94, 57,174,190,182,254,113,253,207,139, 22, 45,242,139,136,136, 88, 29, 28, 28,
+188,255,198,141, 27,207, 0, 24, 18, 90, 67,171,132,213, 43, 91,239,208,213, 10,178,246,123, 29,139, 22,199, 93,123,242,236,185,
+124, 96,255, 46, 77,163,174, 62,188, 59,117,234,208,126, 99,135,245, 26,148,154, 94,144,216,210,211,197, 33, 62,254,161, 21,199,
+113,215,140, 41, 37,177, 88, 28,218,183,111, 95,126, 81, 81, 17,204,204,204, 32,147,201,144,153,153, 9,134, 97,160, 44, 41,134,
+170,164, 24,202,226, 34, 48, 37, 69,120,122,239, 14, 2, 90,122,137,171,156,229,245,162,218,234, 82,223, 82, 85,219,178, 37,178,
+180,132,216,210, 18, 84,227,167, 13,223,177,177,177,185, 85,221,169, 50, 12,243,201,194,133, 11,243, 57,142,195,170, 85,171,172,
+ 44, 44, 44, 34, 1,136, 13,145, 88, 58,242, 66,131,219,251,211,143, 82, 99,209, 35,112, 50, 90,183,120, 11,169,185, 10,228,151,
+ 49,200, 43,102,208,185,215,247,104, 22,248, 37,220,219,135, 35, 49,173, 16,110, 77,188,105,240,197,122, 55,127,206,200,200,168,
+115,188,127,223, 62,200,229,114,180,108,217, 18,227,198,141,195,194,133, 11, 49,110,220, 56,184,185,185, 97,194,187,111, 99,249,
+242,229,200,201,201, 49,148, 84, 85,235,214,173, 85,158,158,158, 42, 79, 79, 79, 21,195, 48, 40, 47, 47, 71,113,113,113,253,242,
+158,211,216,130,116,114,114, 90,228,226,226, 18,235,228,228, 20, 47, 22,139, 79,199, 80,212, 35,165,167,167,115,247,225,195,169,
+182,239,190,203, 75,147, 74,169,171,128,133, 49, 92, 14,118,130,161,125,250, 14, 17, 21, 23,237,172, 49, 82,189, 63,213, 17,127,
+ 94,245,195,245, 63, 58, 97,214, 39, 45, 65,209, 18, 80,180, 8,242,138, 75,232, 18, 20, 44,180,177,161, 12,221, 75,227, 1,196,
+116,239,222,221,109,230,204,153,148, 88, 44,198,236,217,179,153,233,211,167, 39,143, 27, 55, 46,249,226,197,139,172,167,167, 39,
+220,221,221, 41,119,119,119, 87, 0, 49, 85,191,209, 11,171,150,212,215, 42, 38,241, 15, 27,111,243,103, 44, 28,186,149,107,196,
+163, 87,172,203, 46,248,122,203,179,117,169,143,229, 94,143,111, 95, 43, 72,142, 59,201,165,222,189,146,159,149, 92,230,245,245,
+150,103,235, 22,111,206,106,240,161,190,122, 21,220,145,168,171,140,188, 66,206, 31, 62,172,143,124,198,180,177,173,237, 44,252,
+246,160,201,192,192,102, 30, 77, 39, 44, 95,189,137,153,254,209,167,204,142,159,119,146,178,178, 50,148,150,150, 98,211,166, 77,
+218,147, 39, 79,102,178, 44,251,169,174, 49, 16, 0,104, 52, 26,204,152, 49,195,220,202,202, 10, 25, 25, 25, 53, 22, 81, 0,200,
+150, 21, 60,188,126, 55,238,209,188,127,141, 9,169, 80,169, 84,231,174,220, 75,108,235,237,217,148,162,136,206,133, 40, 34,129,
+ 96, 64,167, 46, 93,120,132, 20,131,226,123,224,233,238, 53, 40,205, 41, 68,105, 94, 33,120, 2,115,104, 33,134,134, 19,193, 38,
+ 32, 8, 73,119,163,209,196,209,153, 47, 22, 8, 6,153,250, 19, 19, 76,248,103, 66,159, 22,169, 45,150, 34, 34, 34, 86,235, 59,
+ 95,235, 93, 93,239,184, 70, 72,213, 23, 97,181, 63, 3, 64, 68, 68,196,106, 66, 72,232,141, 27, 55,246, 1, 80, 24,153,133, 15,
+107,189, 27, 31, 71,139,167, 84,135, 47, 88,184, 20,182,214, 82,235,160, 14,222, 46,199,207, 94,189,119,237,198,189,196,102,238,
+ 14,142, 68,163,182,253,118,253, 15, 77, 41,185, 34,194,200, 68,248, 58, 56, 56,128, 97, 24, 60,121,242, 4, 47, 94,188, 0,195,
+ 48,208, 86, 84, 64, 85, 92, 12,101, 81, 17,216,138, 50, 8, 89, 22, 10, 89, 30,236,205, 36,192,203, 21,137, 6, 44,111, 84,131,
+ 66,171,250, 93, 98,101, 5,177,165, 21,104,129,192,224, 78,241,181,208, 49, 40, 40,232, 96, 92, 92, 92,151,254,253,251,127,133,
+202, 37,242,105,153,153,153,253,150, 45, 91,166,114,118,118,198,140, 25, 51,218, 0,152,108, 80,100,138,212,190,158, 46,109,208,
+218,107, 50,154,185,247, 69,113,133, 6,178, 82, 13,242,138, 25,108,251, 62, 24,135,119, 4,225,207,195, 61, 17,119,110, 0,138,
+ 53, 46,176,112,123, 7,132, 85,251,233,227, 60,127,254, 60, 86,174, 92,137,175,190,250, 10,171, 86,173,194, 87, 95,125,133,204,
+204, 76,248,251,251, 35, 61, 61, 29,103,206,156, 65,118,118, 54, 28, 28, 28,112,231,206, 29,108,216,176, 1,127,254,249,167,193,
+ 76, 87, 11, 87, 35,174,105,212, 92,186, 86,171,157,146, 61,124,120,187, 92, 59,187,182, 29, 58,116, 24, 50,123,246,108,175,238,
+221,187,215,156,247,242,242,242,144, 74,165, 57,168, 92, 65,217, 94, 31, 23, 7,116,112,116,244,135, 90,245,168,170,142, 5,160,
+ 40, 9,250, 14, 72, 68,247,158,247,192,104,132,160, 41, 49,104, 90, 2,173,182, 0,182,182,110, 32,132,242, 55,144,196,101, 50,
+153,204,251,194,133, 11,116,106,106, 42, 36, 18, 9, 0, 60, 95,177, 98,197, 15,235,214,173, 75,176,183,183,103,163,162,162,112,
+236,216, 49,132,134,134,242,166, 79,159,238,237,238,238,190,213, 80,190, 87,108,202,190,185,119,253,153,247, 4, 26,219,246, 18,
+105,179,230,168,176,120,231,227, 16, 7,115, 0, 56,155,146, 82,230,228, 81, 26, 81, 81, 22,155,110,211,180,252,155,179, 41,134,
+ 86,156,174,224,238, 39, 63,186,181,247,232,217,146,188,220, 34, 65,135,118,126,138,240,149,159, 9,155, 53,111,245,237,242,133,
+255,114,201, 44,149, 20, 15,152,125,230,209,145,179,119,202, 39, 78,253, 64, 59,237,195,153,202, 51,103,207, 31,229, 56,174, 29,
+116,172, 56,228, 56, 14,217,217,217,136,143,143, 71, 74, 74, 10,100, 50, 25,242,243,243, 81, 86, 86, 86, 51,221,104, 86, 86,122,
+234,135, 95, 78, 62, 48,151, 74,205,186,180,243,246,184, 29,157,144,103, 46,149,154,121, 55,247,104, 13,172,104,176, 29, 97, 89,
+182,157,196, 76, 10,128, 66,113,220, 53,148, 23,149,163,188,184, 28,101,133,229, 80, 49, 60, 40, 85, 52, 20,106, 26,158, 33, 3,
+ 81, 94,161, 68,121, 65, 9, 56,150, 13, 52,117, 55, 38,152, 96,130,158,190, 62, 42, 44, 44,108,177,145,215, 26, 61,189, 89, 95,
+120,133,133,133, 45,166, 40, 42,106,209,162, 69,126,208,189,160,170, 54,182, 55,240, 2, 96, 68,120,135,130,130,228,114, 75,202,
+119,228,220,207,191, 56,179,239,231,239,157, 84, 42,121,186,189,173, 5,107, 97, 38,114,152, 54, 99, 21,202,202,139, 70, 84, 24,
+ 31,142, 0, 69, 69, 69,120,246,236, 25,164, 82, 41,132, 2, 1, 88,133, 2,172,162, 2,138,162, 2,208,140, 10, 66,150,133,157,
+153, 20,158,110, 46,104,230,236, 98, 20,231,147, 75,191,215, 56,190,215,158, 46, 92, 19,228, 11,145,185, 5, 68,150, 22,248, 56,
+234, 10, 0, 64, 40, 20, 2,203,190, 50,202,104,210,164, 73,147, 19,123,247,238, 21,202,100, 50,196,196,196, 60, 0, 80, 2,192,
+ 18, 0,151,152,152,120, 33, 46, 46, 46,212,219,219, 27, 0, 90, 26, 34, 43,205,167, 89,141,150, 32, 35,231, 57, 82, 95, 68,195,
+206,186, 5, 4,102,173,145, 87,204, 64, 44,109, 1,141,234,229,236,163,178, 52, 13, 10,134,103, 84,222,213,106, 53,180, 90, 45,
+180, 90, 45,212,106, 53, 62,252,240, 67, 92,191,113, 3,251,143, 93,196,179,167, 73,104,211,220, 5,147, 38, 77, 68, 80, 80, 16,
+110,220,184,161,151,107,114,123,104,154, 88,128,191,126, 8, 13,145,133,189,170,235,194,115,183, 13,137, 45,138,162, 8,116, 76,
+ 69,214,195,186,224,224,224, 86, 73, 21, 21,136,127,244, 8,253, 87,172, 0, 0,156, 62,125,186, 78, 94,230,205,155, 39, 74, 72,
+ 72,152,118,239,222,189,105, 89, 89, 89,235, 1, 52,236,108, 78,128, 83,167,110,226, 95,255, 74,128, 76, 38, 3, 0, 28,216,247,
+ 82,151,166, 62, 99, 48,120,104,229,140,150,141,141, 13,214,175,247, 55,170, 60, 89,150,197,246,237,219,107,166, 11, 1,128,207,
+231,119,159, 55,111,222,200,134,174,111,213,170,149,208, 16,231,220,209, 77, 36,127, 62, 32,159, 88,183,106,230,103,229, 16,128,
+ 2, 77,180,127,116,102,246,172,185,163,155,108,220,112, 40, 83, 41,165, 84,187, 40, 54,195,157, 47, 81,238, 54, 38,141, 41,103,
+191, 87, 23,120, 78,217,157, 35, 43, 93, 50,243,131,241,246, 86, 54, 78, 21, 59,126, 8,183,165,121, 52, 57,113,143, 41,246,243,
+178,183,121,167,235,119,229,255,154,187, 44, 90,173,205,152,137,140, 19, 73,208, 19,226,130,101, 89,100,101,101, 65, 38,147, 33,
+ 61, 61, 29,249,249,149,211,175,249,249,249,224, 56,238, 77, 26, 68, 40,210,211,145,118,116, 7,154, 77,156,136,206, 95,173, 4,
+203,241,161,144,179, 88,223,173, 31,138, 74, 20, 80,113, 20,220, 58,118,195, 7,167,255, 0, 77, 88, 96,219,102, 83, 79, 98,130,
+ 9,255, 80, 24, 19,222,161, 90, 16,133,135,135,135,254,213,255, 95, 91,108,133,135,135,199,135,135,135, 55,230,191,234, 79, 25,
+214, 28, 87,251,104, 93,169,229,128,246, 74,167, 89,150,159,152,146,144,192,207,170, 80, 84,152, 57, 59, 57,170,204, 36, 98,174,
+164,180,140, 23,253,240, 1, 83,145,243,244,113, 35,242,145, 24, 23, 23,231,159,149,149,133,244,180, 52,104, 21, 21,160, 85,106,
+ 16,165, 28,253,123,116,131, 4,128,132,166, 32,228, 24,240,121, 34,148,149,151, 2, 64,162,193,206, 81,163,121,197,178, 69, 81,
+ 20, 68,150,150, 16,153,155, 67,100, 97, 89,199,194,101,140,197, 70, 44, 22,239,141,140,140,116,109,210,164, 9, 86,174, 92,137,
+166, 77,155,250,184,185,185,201,173,173,173,165,206,206,206,104,219,182, 45,186,117,235,134, 51,103,206, 0, 70,196,148,210,104,
+ 37,177,143,159,163,123,126,225, 13,252,113,229, 71,168, 21, 42,116, 8,249, 17, 12,191, 25, 28,253,190, 4,247,100, 15,228, 57,
+199, 43,173, 7, 46,195,240, 34,253, 57, 40,158, 40,222, 88,203, 83,245,231, 7, 15, 30, 96,223,241,171,112,245,244, 69,122,242,
+ 35, 60,186,124, 1,215, 29,237,225,233,219,182,102, 26, 72,103, 26, 89,240,191,222, 92, 25, 38,106,233, 39,227,197,133,133,133,
+ 98, 59, 59, 59, 85,117,217,185,186,186,190,137,216, 26,191,127, 26, 81,117, 0, 0, 32, 0, 73, 68, 65, 84, 96,193, 2, 20, 11,
+ 4,192,208,161, 16,166,164,128, 97, 24,116,237,218, 21,157, 59,119, 6, 0,116,237,218, 21,124, 62, 31, 1, 1, 1,112,115,115,
+195,230,205,155,199,235, 18, 90, 52,133, 24,173,182,192,199,203,203,171, 70,104,237,254, 85,134,232,123, 3, 64, 65,132, 77, 63,
+ 60,169,185,214,195,195, 3, 57,217, 41,160, 40, 18,103, 32,141, 95,185,184,184, 44,115,117,117,245, 90,183,110, 29, 79, 34,145,
+224,163,143, 62,106, 81, 94, 94,222,172,202,148,140, 69,139, 22, 1, 0,150, 47, 95,142, 21, 43, 86, 64,165, 82,201,117,145,237,
+ 94,223,206, 45,175,144,155, 70,202,205, 70,244,113,104,214,174,239,160,254,104,225,221, 23,125, 7,165, 3,192,106, 59,254,243,
+119,191, 93, 98,115,212,198,146,218,249,251,217,243,203,123,132,244, 93,178,176,252,242,215,223,108, 47, 54,232,243, 88,146,182,
+171,236,177,104,236,134,239,183,254,186,225,139, 69,115, 36,233, 50,117, 81,102, 17, 41,183, 16,243, 45, 90, 58, 83, 22,179, 62,
+255,234, 89, 86, 86,202,124,100,156, 53,184,210,146,227, 56,164,164,164,212,248,244, 41,149, 74, 84, 84, 84, 32, 35, 35,163,230,
+158, 81,152, 91, 13,158, 57,117, 88, 96,133, 66, 33,191,253, 48, 57,125,233,236, 9,193, 21, 10,133, 60, 57, 53, 61, 9,216,212,
+160, 26,163,105,250,161,188, 76,222, 95, 94,172,132, 44,230, 49,154,246,243,132, 70, 75, 65,173,101, 33, 43, 40,131, 74, 11,176,
+180, 0,126,239, 78, 2, 75,241,145,159,149, 9,154,199,123,128,186, 78,251, 38,152, 96,194, 63, 7,122,181, 72,181, 69, 43, 56,
+ 56,120,127,109,171, 83,245,103, 0, 42,232,119,229,145,213, 22, 83,213,211,137,186,254,167, 30,175,177,120,197, 71,203, 96,120,
+135,234,255,116,183, 46,117, 91,179,124, 66, 83, 78,171,109,147,151,159,171,229,243,197, 2,119,107, 69,118, 97,186,241,255,174,
+ 82,169,162, 46, 92,184, 48,124,192,128, 1,226,228,135, 15,160, 46, 41,129,186,164, 24, 2, 78, 11, 59,105, 39,208,140, 10,148,
+ 90,141, 38, 62, 28,148,101, 82, 92,189, 30,167, 81,169, 84, 81,198, 10, 45,154,199,171,235,151,101, 97, 1,177,165, 21,196, 22,
+ 22,245,167, 22, 13,137, 2,179,129, 3, 7,246,235,218,181, 43, 8, 33,216,190,125, 59, 24,134, 17, 49, 12, 3,181, 90, 13,134,
+ 97, 80, 90, 90,138, 95,127,253, 21, 91,182,108,185, 14,224, 23,131,157,153, 86,125,225,220,249, 75, 65,239, 79, 8, 21,156,142,
+ 90, 15,173,154,133,130,106,138,138, 10, 13,202,213,102, 96,237, 39, 2,185,167,192,227, 75, 16, 28,208, 2,199, 15, 29, 97,160,
+ 85, 93, 52, 82,133,215,177, 10,101,164, 63,199,139,167, 73,176, 40,205,129,163,149, 25,228, 41, 73,232, 48,105,242,107, 89, 39,
+220,221,221,193,113, 28,250,244,233, 83,227, 92,253,186, 98,171,160,160, 0, 39, 79,158, 68,215,174, 93, 17, 18, 18,130,204,204,
+ 76,164,164,164,224,173,183,222,170,185,230,193,131, 7,136,142,142, 70,203,150,250,141,132,249,133,154,211, 47, 50, 98,198,188,
+243,206, 59,194, 91,183,110,129, 16, 2,111,111, 43, 88, 89,154,131,162,197,240,245,117, 2, 80, 57, 6,232,221,187, 55, 74, 75,
+ 83,180, 69, 69,228,180,129,236,238, 5,112, 76,173, 86, 63,233,213,171,151,219,211,167, 79, 49,119,238, 92,254,129, 3, 7,170,
+ 77,201, 8, 11,171,187,152, 66,161,208, 61,117,223,166,157,207,103, 45,180,182, 33, 18,105,179,230, 86, 14, 1,104,225,221, 23,
+ 0, 48, 32,244,125,180,104,229,129,210,252,216,230, 74,197,243, 17, 66,126,145,109,236,166,204, 4,233, 80,255,169,202,188, 43,
+201,168,156, 58, 53, 88,237,138,228, 3,185,233,130,137, 7,143,157, 56, 51,227,173,208,183, 5, 26, 86,171,245,247, 20,216, 68,
+ 30, 61,149,151,153,150,254, 29,210,207,198,189,180,255,233,181,226,177,165,165,165, 48, 55, 55, 71, 92, 92,156,106,232,208,161,
+ 98,154,166,241,228,201,147, 26,161,229,228, 96,215,182,123,103,127,159,175, 55,252,122,206, 92, 44, 22, 15,234,221,201, 55, 33,
+ 57,237, 5, 33,212,115,157,214, 86,141,230,252,195,152, 7,125, 28,221, 90,241, 82,174,220,130,125,207,183,160, 82,209, 80,168,
+ 57,168,180,128,150, 39,132,107,251, 46,176,105,233, 11, 2,224,238,173,235, 26,149, 70,115,206,212,215,152, 96,194, 63,218,170,
+ 69,244,137,164,170,207,133, 0,158,135,135,135,231,215,178, 54,201, 0, 60, 0, 16, 88,117,157,172,222,239,100, 20, 69,221, 37,
+132,116,174,197, 35,171, 37,184,106,127, 86,215,187,230, 65, 35, 68, 86,237,247,186, 66, 75,215,146, 74, 0,112,112,112,112,234,
+208,161, 83,203,159,126, 62, 8, 66, 8, 30, 71,175, 69, 81,222, 35, 44, 91,125,179,101,147, 38, 77, 66, 50, 51, 51,175, 26,147,
+ 2,150,101, 15,236,220,185,115,126,151,142, 29, 58, 52,111,218, 20, 15,158,167, 66, 72, 88, 8, 89, 22, 52,163, 2,159, 85,163,
+169, 63, 11,154,178, 64, 86, 86, 9, 34,246, 30,140,171,138, 18,175, 23, 62,111,189,141,149, 47, 74, 64, 81, 20,214, 5,251, 67,
+100,105, 1,161,185, 5, 62, 62,113,169, 70, 92, 69,173, 92, 4,145,133, 5, 90,118, 49, 42, 32,188,252,242,229,203,247, 30, 62,
+124,216,217,223,223, 31,243,231,207,199,243,231,207,193,113, 28,114,115,115,149,217,217,217,153, 50,153,236, 57,128,163, 0,126,
+130, 17,145,199,133, 42,229,198,168,195,187,103, 6,247, 8,113,120,103,196, 22, 28, 59, 52, 15,197, 37,165,144,107,165,168, 80,
+106, 81,161,226,193,206,190, 29,186, 4, 4, 32, 43, 51, 15,241,183,206,149,243, 85,242,181,141,185, 65, 41,138, 66,116,116, 52,
+188,220, 44,145,244,199, 85, 56,152, 9, 16,232,230, 2,183,238, 61,106,226, 75,233,131,128, 7,237,248,241,227,107, 34,195, 15,
+ 28, 56, 48,117,226,196,137,174,243,230,205,195,207, 63,255,140,235,215,175,191,226,160, 29, 18, 18,130,107,215,174,125, 9, 96,
+185, 33,163,158, 90,173,134,143,143, 15,238,222,189,139, 11, 23, 46,160,111,223,190, 8, 9, 9, 65,108,108, 44,126,255,253,119,
+ 68, 71, 71,131,162, 40,216,219,219, 67, 83, 41,158, 53,186,200, 24, 6,145,223,124,187,115,241,134, 13, 91,252, 38, 76,152,128,
+195,135,247,227,253,169,109, 64,209, 98, 80,148, 24,111, 15,107,131,149, 95,221, 69,151, 46,189,225,224, 32,192,134,245,199,159,
+ 41, 20,236,175, 70, 20,227,215,191,255,254,187,155, 82,169, 68,113,113, 49,177,176,176,160, 10, 10, 42, 87,180, 54,100,209,146,
+203,229, 18, 93, 68, 15,239, 39,174, 45, 46, 35, 69,164, 60,122, 68,161, 54,186, 93,223, 65, 25, 24, 16, 58, 21,231,163,126,193,
+165,115, 23, 96,199,127,158, 10,243,178, 51,249,169,249,165,217, 21,222, 91,125, 59, 78,231,189,168, 56,183,117,214,219, 73, 60,
+ 87, 87, 46,114,209,143,165,197,250,132, 22, 0,170, 48, 97,207,137,163, 4,111,119, 11,238,210,202,223,195, 85, 84,148,159, 71,
+ 14, 29, 63, 19,199,164, 30, 62, 89, 75, 96, 17, 3, 66,125,101, 88, 88,216, 23, 85,159,119, 45, 93,186,116,122, 68, 68,132, 99,
+ 78, 78, 78,141,143, 86, 94,126,225,165,110, 67,103,177, 5,197, 37,234,157, 27, 62, 31, 45,149,136, 69, 75, 35,118, 94,209,240,
+112, 75, 23,175,150,227, 54,191, 59,119,217,156,228,199,209, 77,154, 73, 69, 56,254,249,114, 60,248,253, 50, 52,180, 16,255,186,
+112, 27, 42,134, 69,113,126, 1, 46, 78,251, 4, 22,206,182,216,114,229,112, 46,199,113, 63,154,186, 26, 19, 76,248,231, 66,151,
+ 22,161, 40,170,161, 24,123,185, 13,124,119, 87,223,239,116,240,252, 21,208, 25, 21,222,168, 37,120,249,249,249,121,215,174,221,
+198,149,168,175,113, 53,234,107,196, 71, 63, 64, 86,166, 26,153,185, 74, 88, 89, 89,221,212,243,211,250,145, 99,137, 92, 46, 31,
+185,116,217, 23, 57, 18,169, 25,122,245,235, 7, 23, 71, 39,152, 9, 5,224,105, 57,240, 40, 1,202,101, 54, 72,138,149, 99,225,
+206, 61,121,229,114,249,200, 6, 58,137,254,186, 68, 6, 69, 81, 16, 91, 89, 66,100, 97, 9,177,165, 85,157,105, 68,137,149, 21,
+ 36,150, 86,224,139, 68, 13, 57,195,191,194, 89, 94, 94, 62,106,244,232,209, 69, 37, 37, 37,152, 62,125, 58,174, 94,189, 26,125,
+238,220, 57,171,216,216, 88,169, 76, 38,107, 5, 96, 32,128,109,122, 68, 86, 29,206,162,162,148, 50,162, 85,141, 13,255,226, 83,
+133, 82,107,143, 49,147, 15,192,156,206,128,150,229, 64, 0,184,217,137,208,189,255, 87,200, 83,119,195,129,173,171,228, 28,163,
+156, 80, 47,134, 86, 29, 78, 66, 8,113,118,118,126,165, 12, 46, 92,184,128, 49,163, 71, 97,208,136,225,112,108,238, 5,167,254,
+111, 97,208,244,127, 97,235,214,173,160,105, 26, 14, 14, 14,245, 59,222, 26,206,221, 49, 16,236,123, 8,106,223, 67, 80,187,162,
+193, 7, 48,105,207,158, 61,223, 4, 6, 6, 94,190,126,253,250, 90, 0, 99,107,255, 87, 45,172,168,103,205,106,168,142,150,204,
+153, 51, 71,145,156,156, 12,115,115,115,104,181, 90, 92,191,126, 29, 91,182,108,193,186,117,235, 16, 29, 29, 13,123,123,123,180,
+108,217, 18, 42,149, 10,119,239,222, 85, 0, 88,162,135,147,147,201,180,163, 54,109,138, 40, 8, 13,237,137,157, 59,127,128,139,
+ 75, 55, 8,248, 46,224, 11, 28, 97,110,225,131, 29, 63,125,131, 33, 67, 58,224,196,241,131,133,249, 5,218, 81, 0,180, 70,220,
+ 75,202,219,183,111, 99,235,214,173, 24, 61,122,116,230,152, 49, 99,216,146,146,146, 26,139, 22, 33, 4,132, 16,172,168,242, 49,
+ 83,169, 84, 98, 93,156, 31, 44,140,203,252,124, 85,252,202,220,156,204,174, 87, 47,223, 28,127,233,220, 5, 60, 75,190,132, 75,
+231, 46,224,143, 75, 55,194,114,115, 50,187,118, 8,106, 45, 28, 57,125,230,103,187,143, 28,230, 89, 88,185, 98,247,145,195,188,
+113,179, 62, 93,213,105, 80,223, 37,134,238,249,170,122, 36,229,121,185,139, 86,175,253,190, 92,203, 40,233, 53,223,109,206, 82,
+200,178,151,212,186, 47,137,161,251, 83,161, 80,108, 83, 42,149,110, 74,165,210, 77,165, 82, 45,121,254,252,121,175,249,243,231,
+203, 88,150,173,177,150,202, 18, 78,220,124,244,231,174,213, 78, 14,182,210,110,157,253,218,172,223,118,232, 74,122, 70,238,111,
+181, 98,104, 53,148, 78,101,185, 66, 57,106,248,200,137, 21,197, 69, 42, 4,127, 26, 6, 78, 98, 1, 21, 11,104, 8, 15, 90,138,
+143,135, 95,175,135,212,206, 18,123, 83,239,203, 75, 52,204, 40,212,141,161,165, 47,239,111, 2, 19,167,137,211,196,249,247,228,
+252,111,134, 43,234,238,117,232, 90,199,162,101,104, 73,101,147, 38, 77,122,189,243,118,127,244, 14, 93, 10, 66, 8, 30,221,255,
+ 22, 69,178,199,104,226, 34, 70, 74,122,105, 48,128,171,141, 72, 76,250,243,140,140,174,115,150, 44, 61, 50,102, 96, 63, 95,255,
+230,205,197,205,154,121,194,220,201, 9,249,249, 50,252,121, 43, 65,179,106, 95,100, 92,149,200, 50,106, 98,146,227,184, 74, 39,
+119, 0,253,230, 44, 4,197,227, 1, 85, 97, 28,170, 59,198,230,157,187,129,226,243,193, 18, 14, 42,149,202,152,213,114, 47,158,
+ 62,125, 58,106,194,132, 9, 23,163,162,162,232, 65,131, 6,181, 63,122,244,232,155,236,153,135,138,188,228,203, 0, 66, 87, 45,
+154,113,160,107,223,225, 86,222,126,157,132,157,154,241,192,104, 40,100,101,166, 33,234,200, 29, 38,225,246,185, 82,162, 85,142,
+149,231, 39, 95,214,199,197, 48, 76,122,171, 86,173,156,183,110,221, 90,227, 12,207,178, 44,242,243,243,113,243,230, 77,180,235,
+220, 5,190, 83,167, 65, 38,147, 97,211,166, 77,240,240,240,192,176, 97,195, 80, 88, 88, 8,173, 86,107,236,132, 47, 11,224, 92,
+213, 11,245, 68, 22, 85,181, 5,144,222,105, 67, 47, 47, 47,145, 82,169,108, 79, 8,225, 81, 20,181, 81,173, 86, 79, 89,180,104,
+145,235,234,213,171,209,166, 77, 27,228,231,231,195,220,220, 28,222,222,222,144,201,100,184,115,231, 14, 43,151,203,183,162,114,
+ 35,107,153,129,244, 61,185,115, 39,181,235,236,217, 31, 31,249, 38, 98,134,183, 82,213, 91,100,103,215, 3,132,104, 33,147, 61,
+ 71, 89,233,117,230,171,149,191, 60,205,205,211,140, 4,144,108,100,158,151,207,156, 57, 19, 0, 36, 0,150,166,164,164,196,248,
+250,250,122,235,178,104, 25,131, 13,135, 50,149, 0,246,141, 26,228, 54,183, 52, 63,214,219,142,255, 60,181,171, 63,183,105,195,
+161, 76,165,149, 91,197,215,249,207,175, 38,101, 87,156,219,186,251,200, 97,222,228, 17,163,216,166, 22,201, 97, 18, 39,114,200,
+ 8,106, 18, 24, 24,232, 78, 81,133, 45,242, 10, 30,223,123,127,250,140,119,173,133,138,211,129, 77, 11, 90,210, 30, 29, 36,209,
+209,209,169,104,228,202,208, 42, 36,101,102,102,246, 90,180,104,209, 57, 66, 72, 29,223,132,188,252,194, 75,193,161, 51, 73,113,
+113, 73,140, 44,241,132, 49,177,212,238,220,185, 31,221,207,191, 93,135,195,223,172,142,112,238, 61,103, 62, 63,233,242, 21,128,
+213, 32,237,234, 21,176, 98, 53,183,254,198,249,220, 18,134, 25, 1, 83, 84,120, 19, 76,248,199, 91,179,244,105,145,191, 57,134,
+ 66,135, 51,188,209,153,241,106,209,228, 92, 27,239,102, 3, 61,154, 58, 2, 0, 82, 82,179,144,146,154,249,123,202,179,204, 65,
+ 6, 20,175,174,229,149, 53,155, 74, 83, 85, 33, 28,136,113,155, 74,215,225,180,183,183,191,199,231,243,155, 54,166, 52, 88,150,
+205,202,207,207,239, 96,100, 58,199, 53,111,222, 60, 34, 45, 45,237, 8,199,113,115, 27,169,246, 27,228,172,222, 84,154,230,139,
+250, 19,173,186, 29, 0, 80,124,145, 49,155, 74,215,230,108,103, 97, 97,177, 77, 32, 16,120, 84,215, 99,181, 15, 22,203,178, 60,
+134, 97, 36, 44,203,242, 0, 80, 52, 77,107, 5, 2,129,146,162, 40,173, 86,171, 77, 87,169, 84, 51,240, 50,224,168,190,188, 27,
+236,232,171,132, 22, 26,176,104, 93, 0,128,228,228,228,214,182,182,182, 99, 41,138, 26, 77, 8,241, 41, 43, 43, 83, 45, 91,182,
+ 44, 58, 50, 50,178,180,121,243,230,131,135, 14, 29, 74,197,198,198, 34, 46, 46,142, 20, 20, 20, 28,170,178, 98,165, 52,242, 94,
+162,197, 98,222,123,118,118,244, 80, 66, 16, 8, 2,138,162,241,176,164,132, 59, 45,151,179,191, 85, 9,198,198,222,159,213, 24,
+223,172, 89,179, 95, 82, 83, 83, 5,186, 44,169,186,242, 94, 31,223, 46,241, 91, 26,220,179,231,168,155,127,252,113,244,243, 85,
+241, 43,107,159,155, 53,220,246,253,113,159,204,249,118,223,230,239, 62,255,254, 88,209, 78, 99,210,217,190,125,123, 47,138,162,
+198, 2,240, 39,132,180, 34,132,146, 80, 20, 41,162, 40, 42, 30, 64,172, 90,173,142, 74, 72, 72,120,241, 6,121,127,157, 17,174,
+ 46,206,154, 77,165,193,178, 1, 44, 64,140,220, 84,250,255, 59,157, 38, 78, 19,167,137,243, 63,199,249,223,140, 15, 27,248,206,
+184,200,240,213, 72,121,150, 57, 40,229, 89, 38, 90,181,106, 69,158, 60,121,210, 40,145,166,171,147,102, 89,118,191, 92, 46,223,
+255, 38, 36, 5, 5, 5,157,254,205,133,183, 47, 53, 53,117,223, 95, 73, 88, 37,164, 86, 86,189, 94, 23, 15,203,203,203,187, 24,
+123, 49,195, 48,255,142,178,161,170,172, 89, 95,234,186, 96,224,192,129,105, 12,195, 92, 0,144, 65, 81,148, 13,128, 66,134, 97,
+206,105,181,218,220, 39, 79,158,116, 90,191,126,125,117,228,251,175, 0,220,123,205,116,112, 42, 21,187, 55, 43,139,221,251,111,
+200,227, 94,181, 90, 61,207,222,222,190,165, 82,169, 20, 41,149, 74, 97,237,197, 7, 82,169, 84,166,207, 33,190, 54,108, 44,169,
+ 93, 66,126,145,189,141, 37, 85, 95, 72,193,174, 9, 14, 43, 42,226,218,216, 53,193, 97, 99, 19, 22, 19, 19,147, 18, 24, 24,184,
+135,166,233,230,132, 16,103,128, 88, 19, 2, 25, 33, 36,159,207,231,103, 38, 36, 36,100,254,141, 26, 33,165,150,227,214,106,213,
+234,151,126,135,166,213,133, 38,152, 96,194,255, 14,116,250,104,241, 27,203,244,228,201, 19,202, 84,158, 38,212, 22, 91,250, 78,
+166,165,165,169, 0,220,168,122,213,199, 61, 0,195,254,238, 25,204,206,206,238,160,235,156,177, 34, 11,168,244,217, 2,226, 26,
+140,206,190,226,251,162, 50,124,127,228,179,198,166,237,193,131, 7,233, 48,114,138,221, 4, 19, 76, 48,193,132,127, 27,222,220,
+162,101,130, 9, 38,152, 96,130, 9, 38,152, 96, 66,131,216, 94, 75,112,213,177,110, 81,208,189,114,160, 49,115,175,175,179,250,
+224,130,137,211,196,105,226, 52,113,154, 56, 77,156, 38,206,127, 28,231,255, 42, 94, 17, 89,255, 31, 48, 45,125, 53,113,154, 56,
+ 77,156, 38, 78, 19,167,137,211,196,249, 79, 16, 89,245, 95, 0, 76, 83,135, 38,152, 96,194, 63, 24,145,145,145, 70,109, 42,250,
+222,231, 59, 66, 45, 44,108,151,149,151,150, 68,236, 95,251,254,209,234,239,199,140, 25,195,154, 74,209, 4, 19, 76,192,235, 56,
+195,183,104,209,180, 45,205,114,221, 9,161,121,132, 38, 26,170, 84,113, 32,165,168,168, 78,216, 1,119,119,119, 27, 1,141, 97,
+ 20, 33,230, 20,197,177, 28,143,190,254,236,217,139,132, 70, 36, 76,100,107,107, 59, 83, 40, 20,246, 87,171,213, 77,105,154,126,
+161, 82,169, 46,200,229,242, 31,240,106,224,194,255, 24, 90,183,110, 61,238,202,149, 43, 54, 61,122,244, 80, 73,165, 82,173, 66,
+161,224,159, 61,123, 86, 60,100,200,144,226,167, 79,159,190,214,138, 68, 55, 55,183,190, 59,118,236,104, 49,104,208, 32,180,106,
+213,170, 98,236,216,177,194,224,224, 96,225,244,233,211,159,101,101,101, 93,106, 36, 93, 91,138,162,126,165, 40,138,199,113,220,
+ 36,188, 12,221,240, 87,131,166,105,122, 6, 69, 81, 35, 8, 33, 94, 20, 69,165, 16, 66,142,114, 28,167, 47,112,171, 62,140, 2,
+240, 22, 77,211, 29, 0,128,227,184,104, 0,167, 1,227, 87,222,253,127,114,154,153,153,181, 7, 0,185, 92, 30,243, 87,113, 82,
+ 20,213, 30, 0, 8, 33,175,203, 57, 85, 42,149,126, 0, 0, 10,133,226, 39, 24,177, 29, 84,125,144,173, 62,164,195,151,143, 0,
+ 0,209,203,125, 0, 0,141, 57,166,254,245,136,106,204,127, 53,196,215, 24,142, 6,240,214,132, 9, 19, 86,255,246,219,111,203,
+ 1, 28,255,119,220,248, 46, 46,238, 63,172,251,110,187,219,167, 51,167, 69,160,114, 71, 8,253, 15, 36, 48, 64,196,227,189,173,
+102,217, 63, 18,128,255, 99,239,186,227,162,184,186,246, 51, 51, 59,219,119, 97,119,169, 75, 17, 5, 5, 17, 80,192,130, 61,162,
+ 38, 26,187, 70, 44, 81,177,196, 22,163, 38, 70,141, 26, 53, 26,107,140,137, 61,182,216,123,141,130,189,247,138,198,138,157,222,
+251,194, 46,219,103,190, 63, 96,121, 81, 41,139,154,188,201,251,113,126,191,113,156, 97,230,217,123,239,220,242,220,115,207, 61,
+103, 47, 0,142, 66,161,232,207,227,241, 90,235,245,122, 37,135,195, 73,209,235,245, 23,243,242,242,118,162,130, 8, 8, 86,151,
+235, 99,200, 13, 26, 56, 19,204,127,226,188,177, 36,116, 92, 17, 82,137,122,200,249, 7,116,163, 36,128,241,197,121,221,128,242,
+221,121, 84,212,249,124,237,226,226,210, 83,165, 82,105, 40,138, 98, 81,180,235,185,232,159,162,191, 19, 12,195,164,103,103,103,
+ 15,170, 12, 75, 92, 3,117,121, 98, 98,171,217,136, 66,147,142, 29,173, 78, 64,180,196, 29,205, 89, 96, 16, 11,212, 34, 41,210,
+129, 97,152, 20, 0,103, 73, 19, 34, 10,146,241,252, 31, 58,184,123, 20,151,107,205,226,107, 26,128, 19,128,123, 0,190, 6, 80,
+ 80,205,127,254, 54,121,211, 24,254, 8,128,148, 18,162, 85,202,221,125,155, 46, 93,186, 92,240,244,116,243,235,221,163,215,252,
+ 81, 35, 71, 19, 20, 69,226,193,195,135,156,207, 7, 13,249, 68, 46,151,187, 74,116,186,122, 32, 8, 70, 35, 16, 60, 80,169,242,
+146,246,238,220, 46,245,173, 91,215,108, 54, 51, 88,179,118,245,167,251,254, 56, 48,205, 74,178,229,227,236,236,188,117,202,148,
+ 41,206,221,186,117,163,156,157,157, 17, 27, 27, 43,219,181,107, 87,221, 21, 43, 86,244,201,201,201, 25, 4,224,233, 59,100,182,
+149,179,130,252, 68, 42, 36,218, 33,223,140,124, 35,206,164, 22,226, 36,128, 75,239, 90,122, 26,141,102,172, 70,163, 9,105,220,
+184, 49,187, 97,195, 6, 98,240,224,193, 44, 65, 16, 68, 97, 97,225,102, 0,239, 68,180,196, 98,241,170, 14, 29, 58,120,123,123,
+123,191,124,241,226, 69,167, 61,123,246, 28, 13, 15, 15,247, 18,139,197,207, 0,248, 84, 17,110, 83, 86, 86, 86, 96, 97, 97, 33,
+220,220,220, 54, 0,104,248, 23, 84, 34,130,162,168,131,174,174,174,236,162, 69,139, 14, 5, 6, 6, 58,101,103,103,155, 38, 77,
+154,212,254,250,245,235,159,154,205,230,110, 85, 32, 91,114,130, 32,214, 58, 57, 57,217, 47, 92,184,240,121,163, 70,141,238,241,
+249,124,222,179,103,207, 68, 19, 38, 76,248,230,233,211,167,125, 88,150, 29, 9, 84,105,128,144, 19, 4,177,214,197,197,197,126,
+254,252,249,177,193,193,193, 15,184, 92, 46,247,217,179,103,226,239,190,251,238,235,232,232,232,119,194, 36, 73,114, 77, 72, 72,
+136,252,135, 31,126,120, 92,183,110,221,171, 20, 69,241, 18, 19, 19,201, 89,179,102,125,117,234,212,169, 48,134, 97, 70,189, 75,
+ 58, 29, 29, 29,229,179,102,205,122,220,172, 89,179,235, 92, 46,151,251,228,201, 19,114,202,148, 41, 95, 61,127,254,220,234,116,
+ 42, 20,138, 80,130, 32,214,165,166,166,114, 0, 64,169, 84, 54,177,177,177, 89, 81, 58,166,165,197, 21,133,209,104,204,215,106,
+181, 3,178,179,179,203,116,132, 59,120,234,242,174, 0,176,194, 96,185, 46, 58, 87,118, 13,172,137,176, 38,211, 65,206, 69,126,
+241,126, 81, 15,237, 1, 0,253,139, 67,133,255,162, 6, 56, 28, 14, 19,228,252, 53,123, 55,181, 74, 46, 99,186,183,109,219,118,
+214,217,179,103, 87,183,105,211,230,187,109,219,182, 57, 38, 36, 36,252,116,233,210, 37,247,126,253,250, 13, 62,115,230,204,130,
+204,204,204,125, 31,170,242,243,184,124, 62, 65, 18, 16, 10, 68, 54,214, 60, 79,147,100,151,171,221,187, 15, 95,255,228, 73,240,
+138,232,104, 79,181, 82, 25, 50,110,220, 56,167, 94,189,122,145,238,238,238,120,254,252,185,221,182,109,219,234,173, 95,191,190,
+103,110,110,238,120, 0,113,239, 67,178,212,185,168,175,211, 35,152,101, 33, 43,105,176, 4,114,249, 6,220, 97, 31,227,254, 63,
+128,108,205,220,180,105,211, 15,207,159, 63,199,130, 5, 11, 0, 96,101, 21,223,159,208,189,123,247,206, 7, 14, 28, 16,238,221,
+187, 87,216,184,113, 99, 56, 59, 59,163,120, 50, 85,226,152,218,211,211,211,186, 50, 99,240,203,210,163, 67, 27, 62,200, 62,134,
+ 85,189, 82, 23, 8,221, 96,106,222,221,187,103,151,193,193,176,117, 16, 65, 32,225, 32, 55, 75, 21,240,228, 78, 66,135,115,123,
+158,255,244, 60, 42, 99,161, 58, 30, 51, 81,190, 79,190,255,138,216,217,217,109,120,245,234, 85,168, 88, 44,126,237,254,203,151,
+ 47,131,188,189,189,243, 0,124, 91, 85,226,230,224,224,176,131, 97, 24, 93, 86, 86,214, 48, 0,144, 74,165,219,197, 98,177, 60,
+ 37, 37,101,218, 95, 53,145,177,200,155, 92,228, 95,174,209, 42,177,215, 42, 43,214, 33, 65,154,153, 22,163, 70,142, 38,250,246,
+239,151,250,252,229, 43,134, 67,243,250, 31, 63,113, 66,228,231,231, 71,234, 86,174,132, 41, 35, 3,198,111,190,105,126,250,244,
+105, 99, 88,255,129,133, 52, 69,108,242,242,172, 37,218,189,115,151,243,129,253,251, 90, 0,168,140,104,241,156,157,157,183,158,
+ 63,127,222,213,211,211, 19,185,185,185,136,141,141,133, 90,173, 70,159, 62,125,232, 22, 45, 90,184,246,238,221,123,107, 94, 94,
+ 94,203, 42,104,182,156,234,184,113, 34, 71, 14,233,229,243,233, 39, 45,196,174,238,181,193,166,106,145,240, 34,186,113,228,249,
+235,227, 54,237, 63,250,244,121, 30,219, 5,101,199, 70,170, 80, 50, 51, 51, 39,247,236,217,115,127,104,104,168, 3,159,207,135,
+139,139, 11,209,173, 91,183,244,228,228,228,217,239,204, 90,138, 67,216,144, 36,105, 46,125, 46, 35, 60,144, 53,226, 38,151,203,
+ 33,151,203, 1,192,245,125,103,158, 50,153,108,165, 84, 42,237,173, 82,169, 10, 73,146,100, 9,130, 96,245,122,189, 80, 46,151,
+255,249, 56,250,169,139, 78,167,171,179,120,233,250,101,109, 91, 5,218,156, 58,117, 10,189,122,245, 98, 79,158, 60, 57,210,218,
+ 56,117, 4, 65,172,237,217,179,167,102,198,140, 25,218,231, 47, 99, 93, 31, 63,125, 73,136, 5, 60,198,222,222,158,190,121,243,
+ 38,103,201,146, 37,130, 89,179,102,173,101, 89,182,119, 21,202,115,109,191,126,253, 12, 19, 39, 78, 76,121,242,252,149,227,253,
+199,207, 89,137,128, 54,217,219,219, 81,215,175, 95,103,222, 5,147, 36,201, 53,147, 39, 79, 86,141, 28, 57, 50, 39, 43, 59,207,
+ 57, 71, 85,192,242,105,202,232,236,236,204, 57,116,232,144,110,199,142, 29,228,240,225,195,215, 48, 12, 19, 86,133,242, 93,211,
+173, 91,183,252, 41, 83,166,228, 62,123, 25,227,124,255,209, 83,136,248,180,209,201,201,145,186,117,235,150, 97,241,226,197,228,
+220,185,115,173, 74,167, 88, 44,222,178,103,207, 30,206,161, 67, 69,125,223,181,107,215, 72, 47, 47, 47, 81,233,103, 10,181, 58,
+144, 4,144,153,153, 41,106,214,172,217, 22, 0,111, 57,247, 13,158, 29,141,193, 83,129,177, 99,199,166, 84,181,178, 4, 43,199,
+ 85,250,140,121,181, 47,187, 68, 51,180, 7,135,195, 97,134, 15, 31,158,250,230,223,181, 90, 45, 1,160, 27,126,178,158,108,117,
+234,212,233,251, 35, 71,142,212,222,182,109,219,175, 59,118,236,208, 3,128, 64, 32,176,223,181,107,215,130, 62,125,250,160, 79,
+159, 62, 51,246,237,219,247,193,136,150,153, 53, 27, 0,128, 47,224,243,163,163,163, 9, 95, 95,223, 10, 61,238, 27, 24,230,246,
+250, 39, 79, 26,125,233,235,219, 56,155, 97,234,112, 63,253,180, 96,194,132, 9,153, 42,149, 10,177,177,177, 48, 24, 12, 24, 60,
+120, 48,213,166, 77, 27,151, 62,125,250, 44,207,207,207,255, 12,128,193,138, 58,185,216,213,213,117, 68, 94, 94, 94,129, 69,171,
+211,114,144,153,211, 58,200,196,111, 80,199,200,227, 82, 38,110,215,111, 24,226,228, 74, 66,237,235,137,203, 0,192,213, 32,163,
+138,147,129, 50,197,198, 13,158,102, 26,115, 29,220,132,109, 51,226, 10,127, 84,199, 87, 72,150, 62, 19,139,197, 61,212,106,245,
+190,226,193,217,167, 75,151, 46,184,126,253, 58, 0,180, 40, 38, 90,109, 73,146,252,156, 97,152,223, 1, 84, 20,202,109, 92,247,
+238,221, 63, 62,112,224,128, 20, 0,246,237,219, 7,163,209, 8, 47, 47, 47,112,185, 92,240,120, 60,208, 52, 93, 18, 29,196, 74,
+ 81, 58, 56,216,195,222,150,134, 92, 33,254,244,187,223,186,115,106,248,217, 32,221,252, 16,217,108, 46, 76,172, 14, 92, 59, 49,
+234,118,144, 33,248,147,182,100,196,154, 7,211, 34, 86, 61,110,164, 33,209, 21,113,208,253, 83, 70,118,146, 36,249,247,238,221,
+131,139,139,203,107,247, 41,138, 2,128,214,239, 0, 57,227,229,203,151,205,162,162,162, 16, 26, 26, 58,163,126,253,250, 29, 47,
+ 92,184,224,156,149,149,133,208,208,208,229,137,137,137,135,254,234, 60,149,230, 34,255, 43,170, 46,242, 13, 38,217,166,104, 22,
+ 76, 82, 20, 69,226,213,203, 88, 99,104,104,187,240,248,248,120, 73, 72, 72, 8, 73,211, 52,212,103,207, 66,123,235, 22, 36, 18,
+ 9,122,246,236, 73, 95,188,120,209,198, 70, 98,243, 69,204,171,152,124,138, 34,193,178,100,165, 54, 15,114,185,252,171,105,211,
+166, 57,123,123,123,195,100, 50,149,120, 52, 55,153, 76, 72, 72, 72,128, 68, 34,193,160, 65,131, 28, 69, 34,209, 87, 86,230,163,
+166,143,151,227,157,243, 71,215, 54,156, 48,170,147,216, 71,116, 10,226,132,241,144,236,251, 18,245,146,143, 99, 74,143, 16,241,
+201, 85, 51,130,107,187, 40,238,148, 82,177, 90, 45, 58,157,238,242,131, 7, 15,190,184,112,225, 2, 3, 0,231,206,157, 99, 31,
+ 63,126, 60,242,125,102,161, 12,195, 32, 55, 55, 23, 12,195, 80,197,215,150,243,127,181, 62,216,216,216,172,233,216,177, 99,191,
+184,184, 56,225,177, 99,199,236,226,227,227,237, 99, 98, 98, 28,124,124,124, 56, 11, 22, 44, 56,162,213, 25, 40,163,153,213,155,
+204,198,252,148,135, 15, 95,230,164,165,221,217,184,113, 99, 33, 65, 16, 61,173,252,141,207,148, 74,165,221,212,169, 83, 65,208,
+162, 38,117,235,213,247,166,104,161, 45, 73,243,108, 11, 11,181,230, 87,175, 94, 37, 76,157, 58,181, 86, 96, 96,160, 11,138,150,
+215,172,194,116,113,113,177,159, 56,113, 34, 56,124,105, 80,131,192,224,218, 60,190, 88, 74,209, 66,105, 72, 72, 72,155,151, 47,
+ 95, 38, 79,153, 50, 69,217,184,113,227, 42, 97, 54,110,220, 88, 62,124,248,112,147, 64, 40,109,230,233,233, 85,175,129,127,189,
+206, 62, 62, 62, 61, 56, 28,142, 41, 35, 35, 35,110,208,160, 65,202,174, 93,187, 58, 85, 5,211,209,209, 81, 62,101,202, 20,147,
+187,135, 87,135, 14, 31,127,210,148, 43,148,218,114,120, 98,153, 70,163, 53, 63,121,242, 36,110,250,244,233,202,160,160, 32, 71,
+107, 48, 53, 26, 13,109,111,111,143,128,128, 0,248,121,121, 33, 47, 47, 15, 7, 14, 28,192,166, 77,155,240,251,239,191, 99,231,
+206,157,104,212,242, 19, 72,165, 82, 36, 39, 39, 67,165, 82,209,127,119,133, 50,175,246,101, 87,232, 71,116, 27, 61,122,116,242,
+240,225,195, 83,133, 66, 33,243,230,161, 80, 40,204, 3, 6, 12, 72, 27,244,221,210,110,150,165,197, 74, 52, 89,247,142, 30, 61,
+250, 98,219,182,109,240,243,243, 67,135, 14, 29,120, 0,240,213, 87, 95,241,250,244,233,131, 61,123,246, 96,223,190,125,143,188,
+189,189,175, 0,232,110, 77, 58, 7, 13, 26,212, 50, 44, 44,236, 82, 88, 88,216,221,190,125,251,174, 27, 57,114,228,107, 35, 87,
+ 74,114,226,109,189, 94,143,192,224,198,162, 57, 27,110, 12,168, 12,239, 49,176,109, 93,116,244,166,133, 15, 31,198,205,240,243,
+147,121,196,196, 40, 54, 47, 94,108,111, 9,210,109, 52, 26,145,144,144, 0,185, 92,142, 1, 3, 6,216,243,249,252, 65, 86, 36,
+115, 73,247,238,221,135,196,199,199, 75,214,175, 95,175,188,123,247,174, 75, 74, 74,138,242,204,233, 19, 14,147,190,253, 74,106,
+ 43,225,241,146, 51, 88, 2, 0, 98,146, 33,142,126,133,150, 44, 11, 89,233,229,196,119, 18, 37,132, 66, 55,172,168,221, 82,246,
+116,226,158,160,190, 83, 34,131,237,229, 74,254,212, 10,222,104,176,104,209,162,189, 17, 17, 17,253, 91,182,108,185, 31,128,176,
+140,103, 4,141, 26, 53, 58,176,103,207,158, 33,173, 90,181,186, 12, 32,160,220, 89,164,155, 91,207, 63,254,248,195,206,114,109,
+111,111, 15,129, 64,240, 22,201,226,114,185, 32, 73,178,202,217,155,183,171, 63, 71, 81, 79,135, 7, 57, 71,177,103,209, 61, 44,
+250,244, 9, 51,191,121,140,110,229,160,104,156,220,115, 15,233,184,135, 78, 95,214, 70,255,233,129,237, 69,102,204,253, 39, 13,
+224, 25, 25, 25,159,183,110,221,122,111,167, 78,157,116, 81, 81, 81,200,200,200,128,171,107,201, 92, 59,245, 29, 32, 21, 34,145,
+ 8,238,238,238,240,246,246,238,127,241,226, 69,103,163,209,136,152,152, 24,164,167,167,223,249, 59,242, 84,154,139,252,203,228,
+ 77, 67,248, 35,111, 17,173,226,216, 66,231, 1,128, 37, 8,245,189, 7, 15,104,138,199, 27,184,125,199, 14, 62,151,203, 69, 92,
+ 92, 28, 30, 61,122, 4,205,153, 51, 40,188,122, 21,105,105,105, 40, 40, 40,128,147,147, 19,214,110,216, 32,214,155,217,161, 79,
+158, 62,165, 88,146, 45,109,111, 80,230, 22, 79, 62,159,223,190, 87,175, 94,229, 18,178,228,228,100,116,234,212,137,166, 40,170,
+172, 93, 13,111, 98, 18, 46, 14, 68,196,153,253,115,148, 74,222, 35,224,249, 4, 32,255, 14,192,234, 0,147, 30, 72,186, 15, 28,
+153, 13,143,130,104,226,196,156,112,103, 87, 17, 39,162, 12,166, 92,217, 86, 84, 47, 95, 95,223,223, 7, 14, 28, 72, 2, 64,219,
+182,109, 9, 95, 95,223,117, 0,188, 42,120,231,116, 37,131,228,245,156,156, 28,244,233,211,199,174,118,237,218,167,251,244,233,
+ 99,103,185,255,174,152, 22,109,178,159,159, 95,150, 64, 32,216, 9, 88,213,193,150, 96,202,100,178,149,157, 58,117,234,189, 99,
+199, 14, 46, 0,156, 63,127, 30, 17, 17, 17,120,248,240, 33,158, 61,123,198, 4, 7, 7, 59, 44,253,125,239,154,149,171,183, 44,
+233,209, 34,208,165, 77,147,224,122,146,130,156, 2, 39, 39,167, 22, 44,203,122, 89,153,206, 78,179,103,207,126,244,248, 69,156,
+ 45,201,161, 57, 92,154,195,183,177, 17, 59,201,165, 98, 55,133, 72,224,202, 39, 9,137, 70,163, 73,221,185,115, 39, 3,160,147,
+181,152,115,230,204,121,245,248,121,156,140, 32, 57, 28,154, 67,115, 37, 18,145,236,211, 14,161,141, 1,128, 11,150,171, 82,169,
+210, 54,109,218,100,168, 10,230, 15, 63,252,240, 32, 59,183, 64,206,161,105,154,195,161, 74,202, 82, 44, 20, 58,136,248,124,158,
+ 78,167, 75, 90,182,108, 89, 97, 85, 48,103,207,158,253,232,201,139,120, 5, 73, 16, 20, 65,144, 28, 27,169,216,206,206, 86,228,
+224, 32, 17,218,139, 56, 20, 79,165, 82, 37,109,221,186,213, 42, 76,131,193,192, 77, 75, 75,195,227,199,143,225,222,184, 49, 78,
+157, 58,133, 26, 53,106,160, 79,159, 62,232,215,175, 31,132, 66, 33,218, 54,171,143,169, 83,167,226,197,139, 23, 48, 24, 12,252,
+178, 48, 45,118, 82,111,138,139,139, 75, 84,101,149,231,141,119, 95, 75,103,144, 51,216, 21,250, 17,221, 74, 19,172,242,240, 21,
+ 10,133,185, 44,109,215,155,152,157, 58,117,250,254,204,153, 51,181,183,110,221,218,109,208,160, 65,151,183,110,221,138,166, 77,
+155,226,241,227,199,168, 85,171, 22, 54,111,222,140,126,253,250, 93, 94,190,124,121,183,168,168,168, 64, 79, 79,207,105,149, 97,
+246,237,219,119, 76, 80, 80,208,217,212,212,212,102,217,217,217, 1, 7, 14, 28, 24,218,179,103,207, 87,253,251,247,111, 87, 66,
+ 24,141,198, 29, 71, 14,239, 71,231,110,189, 80,215, 63, 96,205,224,105,219,234, 87,210, 54,217,135,192,186, 77, 41, 41, 25, 59,
+180, 90, 77, 31,154, 22,137,110,220, 80,236, 91,189,218,190,116,100,129,164,164, 36,116,237,218,149,230,114,185,173, 42, 73,231,
+162, 30, 61,122,244, 57,112,224,128,220,162,213,185,122,245, 42,238,223,191,143,216,216, 88,228,230,230,162,221,200, 2,140, 94,
+ 80,132, 61,122, 1,139, 79,190, 98,197,239,216,135,148,136,176, 6,156,237,108, 56, 87,134, 46,171,251,213,136, 53,126, 28,137,
+130,198,246,239,158, 33, 51, 70,183,175, 28, 76,162, 89,179,102,219,194,194,194, 8,189, 94, 15,189, 94,175, 7, 80,166, 87, 95,
+ 87, 87, 87, 65,131, 6, 13, 48,114,228, 72,210,198,198,102,121,121,233, 84,171,213,186,163, 71,143, 98,208,160, 65, 24, 63,126,
+ 60,234,212,169, 3,185, 92, 14,154,166,177,101,219,110,251,126, 67, 71,249, 52,108,217, 58,208,175, 97,211, 6,249, 58,170, 49,
+ 45,148, 15, 47, 71, 27, 82,102,222, 11, 28,163,240, 32,230, 26, 86,116, 75,100,110,110,214, 20, 76,250,252,231,232, 39, 23,210,
+ 30, 78, 11, 91,247,128,189,214, 60,115,219,215,241, 72, 51, 62, 70,171, 62, 30,240, 12,146,127, 35,118,135,239,187,150,167,149,
+ 82, 37,204,250,245,235,183,188,121,243, 38,191,117,235,214,136,139,139, 3, 77,151,204,167,204,239,147,206,217,179,103,243,181,
+ 90, 45,254,252,243, 79,132,135,135, 39, 25, 12,134,111,222, 39,157, 85,209,104, 89,184,200,191, 76,214,189,113,164,148,167,209,
+154, 13, 0, 70, 6, 17, 3,195,135,106, 34, 35, 35, 69, 60, 30, 15,113,113,113, 72, 73, 73,193,150, 77,155,204,109, 29, 29,243,
+ 59,184,186,170,182,108,218,196,234,245,122,176, 44, 11, 95, 95, 95,244,238,221, 91,248, 89,159,254,233,132,170,112,183, 21,203,
+ 60, 74,203,250,250,208,161, 67,223,250,251,164, 73,147, 96, 99, 99, 3,130, 32,156,173,200, 92,216,184,217, 61,220,228,158,178,
+ 52, 54,117, 75, 54, 40, 1,192,145, 2, 28, 27, 64, 96, 11,240,165, 0, 79, 4, 93,212,217,108,146,237, 16,219,171,213, 48, 87,
+ 0, 85, 89,234,129,139,139,203,140,179,103,207, 58, 68, 69, 69,177, 42,149, 10, 41, 41, 41,236,252,249,243, 29, 92, 92, 92,102,
+188,235, 23, 73, 78, 78,158,211,185,115,231,180,240,240,112,219,227,199,143,187,135,135,135,219,118,238,220, 57, 45, 57, 57,121,
+206,251,124,105, 46,151, 75, 61,124,248, 80, 49,119,238,220,126, 0,110,251,251,251,103,185,186,186,222, 70,145,209,100,133, 34,
+149, 74, 75, 72,150, 69,187,198,225,112, 64,211, 52, 92, 92, 92,244,217,217,217,230, 86, 13,189,132,190,182,164,209,133,207, 21,
+ 42,132, 2, 55,169,141,109, 72, 86, 86,214, 61,130, 32, 94, 90,185,196, 23,212,164, 73, 19,218,204,210,204, 15, 12,241,165, 0,
+ 0, 32, 0, 73, 68, 65, 84,232,129,109, 93,190, 26, 18,234,248,219,220,225, 53,150,205, 25,225,186,104,214, 23,190,115, 38, 15,
+ 8, 37, 25, 70, 91,171, 86, 45,103,139, 65,187, 21,234,243,224, 70,141, 26,113, 24,208,120,252, 52, 54, 45, 46, 49, 41,255,227,
+ 54,205, 74, 52,151,126, 65,193, 29, 28, 28, 28, 90,251,250,250, 54, 34, 8,194,170, 45,201, 66,161, 48,168,110,221,186, 28,146,
+162, 9, 59,185,212, 93, 42, 17, 58,149, 44,161,200,100,205, 21, 14, 14, 97, 36,203,230, 41,149, 74, 71,161, 80, 24, 84,133,188,
+115, 24,112,225,228,168,176,117,176,151, 73, 58,132,182,168,211,172,121, 51,159,250, 33, 77,155,249, 55,108,244, 25, 97, 50,169,
+188,188,188, 28, 45, 70,242,149,104, 90, 5, 59,118,236,192,220,185,115,209,192,195, 3,174,174,174,112,116,116,196,213,171, 87,
+113,243,230, 77,200,229,114,164,167,167, 99,241,226,197, 56,120,240, 32, 12, 6,131,180,170,245,201, 26,178, 85,145,152, 76, 38,
+242, 77,130, 85, 30,190, 80, 40,100, 44, 70,242,229,201,209,163, 71,183, 89, 52, 89, 95,127,253,117,203,165, 75,151, 94,142,142,
+142,134, 68, 34,193,205,155, 55, 49,116,232,208,203,203,151, 47,111, 57,106,212, 40,108,218,180, 9,175, 94,189,218, 80, 17, 94,
+223,190,125,103,125,241,197, 23,203, 46, 92,184, 64, 58, 57, 57, 65, 46,151,163, 71,143, 30,216,176, 97, 3,199,100, 50,109, 12,
+ 11, 11,187, 27, 22, 22,118,215,156,112,242,251,189,191,207,191,250,224,222, 93,140, 25, 55,145,167, 55, 25,167, 88,145,125,182,
+ 80, 34,201, 55,181,110,157,189,199,104,212,244,229,114, 69,182,119,239, 42, 34, 54,110, 44, 33, 91, 83,167, 78,133,173,173, 45,
+ 80,100,192,140, 10,180, 58, 35, 14, 30, 60, 88,210, 31,218,217,217,129,199,227,129,203,229,130,166,105, 80, 20,133,211,107,196,
+ 88, 61,181,136, 95,172,158, 74,224,228, 74, 66,253, 62,223, 78,228,138, 0,185, 19,239,238,151,155,253, 3, 3,218,217,225,234,
+174, 84,204,239, 28,149,120,115, 79,198, 4,109, 58,126, 41,231,181,134,147, 38, 77,242, 75, 79, 79,199,173, 91,183,112,235,214,
+173,242, 52, 64,218,195,135, 15,255, 84, 80, 80, 0, 79, 79, 79,116,239,222,189, 53,128,198,229,180, 27, 52,106,212, 8, 93,187,
+118, 69,104,104, 40, 26, 52,104, 0,189,193, 68,135, 13, 28, 81,247,225,171, 12,215,249,139,231,139,206,158, 59, 64, 94,190,124,
+129,218,182,255,164,109,179,208, 79,150,113,165,202,235, 16,218, 41,173,201,167,198,156,133, 32,229,167, 88,119,102, 28,185,226,
+124,184,100, 75,196, 10, 47,169, 84, 74,220,185,117,215,184,101,213,158,248, 0,113,247,244,235,187,178,160, 33, 82,209,110,136,
+ 39,201, 0,189,255, 41, 35,187, 64, 32, 88,122,225,194, 5,103,131,193,128, 7, 15, 30, 96,252,248,241,218,247,132, 44, 81,128,
+184,187,187,227,252,249,243, 24, 48, 96,128, 54, 45, 45,237,218,223,149,167,210, 92,228,127, 69, 56,165, 24,100,137, 36, 36, 36,
+228,202,229,114,215,186,117,235,146,122,189,190,104, 73, 98,223, 62,243,239, 27, 55, 30,209,106,181,227, 0,112, 87,254,246,219,
+ 26, 87, 55,183,208,129,131, 6, 17, 70,163, 17,157, 59,119,230, 69, 70, 70,218,189, 76, 79,207,183, 98,192,121,237,247, 6, 15,
+ 30,140,165, 75,151, 2, 0,198,142, 29, 91,162, 90, 39,172, 48, 88,146,216,162, 83,135, 46,141,108, 18,196, 43,108, 12,205,141,
+ 5, 53, 95, 72,175,139, 11,132,141, 64,242, 56, 16, 80, 96, 12, 70,211,179,244,158,183, 95, 60,171,231, 39,204,206,170,213,222,
+255, 35,252,126,106,107, 39,141, 89,187,199,234, 14, 71, 36,106, 34,145, 72,112,251,246,237,236, 70,141, 26,229,178, 44,107, 59,
+103,206, 28,123,145, 72,212,228, 61,202, 62,230,233,211,167,173, 91,180,104,241, 21, 73,146,237, 25,134, 57,157,150,150,182, 18,
+ 64,140,149,239,143, 6,240, 3,128,146,153,165, 94,175, 7, 73,146, 96, 89, 22,125,251,246,197,212,169, 83,253,238,223,191,143,
+179,103,207, 42,218,183,111,127, 29, 64, 46,128, 97, 0,202,212,154,169, 84,170,194,155, 55,111, 10,207,158, 61, 11,134, 97,160,
+ 80, 40, 96, 99, 99, 3, 62,159,143, 30, 61,122, 72,166, 76,153,210,238,196,137, 19,233,170,154, 53, 40, 65, 74,146,154, 47,145,
+ 72,225,236,218,106, 84,255,207,163, 89,150, 61, 88,133,206,129, 39,228,152,180,132, 89, 71, 46,154,185,156, 20,113,185,132,128,
+203, 1,159,209,224,251,159,230, 17, 92,214,204, 65, 21,215,231,185, 92, 46, 87,202,135,158,226, 81, 70, 17, 1,246, 67, 52, 14,
+138,162,120, 2,110,249,246, 24, 52, 73,146, 36, 73,114, 1, 88, 29,180,143,207,231,115,165,124,182, 92, 76, 33, 69, 80, 4, 65,
+240, 80,206, 78,180, 32,103,176, 22, 45, 18,111,220, 75, 93,105, 82,220,170, 85, 43, 28, 57,123, 27,251, 34, 78, 35, 51,238, 30,
+166,127,247, 53, 26, 55,110,140,200,200,200, 10,211,100,177,209, 42, 79,187,236,226,226, 18,149,156,156,220,176,188,119, 43, 90,
+ 50, 44, 71, 75,245, 54,254, 76, 91, 4,207,142, 70, 37, 54, 90,221, 91,181,106, 53,102,199,142, 29,250,142, 29, 59,242,250,246,
+237,139,128,128,128,150, 67,134, 12, 1, 0,180,111,223, 30, 75,151, 46,109, 57,100,200, 16,236,222,189, 27, 7, 14, 28,208,181,
+105,211,230,187,243,231,207, 39,161,104, 71,231, 91,194, 48, 76,215,181,107,215,190,169, 41,132,201,100,130,209,104, 84,154, 76,
+ 38,101,113, 95,132,101,203,150,103,158, 60, 17,137,239,166,205,134,163,131,115,144,149,117,136, 24, 60,113, 98,230,230,197,139,
+177,120,247,110, 76,172, 85, 75,180,245,209, 35,156,212,106,177,231,236,217,204,226,223,169,212, 54, 83,173, 86, 23, 30, 61,122,
+212,102,207,158, 61,144,201,100,168, 83,167, 14, 20, 10, 5,104,154, 6, 73, 9, 65,113,229,168,235,223, 4,192, 77, 0, 64, 45,
+ 23,168,125, 61,113,153, 32,144,203,146, 85,183, 41,226,215, 64, 77,123, 55,193,133, 49,155, 2,100, 54,142, 92, 28, 95, 25,143,
+ 19, 43, 18, 14,106, 51,241, 43, 76,120,130,242,109,190, 26,121,122,122, 34, 61, 61, 29, 71,143, 30, 85, 3,229, 18, 50, 48, 12,
+243,211,111,191,253, 54,105,218,180,105,124, 95, 95, 95, 0, 8, 2,112,171,172,103,197, 98, 49, 92, 93, 93, 75,136,101,223,240,
+ 81, 94, 35, 39,140, 18,246,252, 36, 20, 28,142, 61,114,213, 70,100,229, 27, 33,183,151,224,187, 9, 97,130,211,141, 92, 27,175,
+ 93,190,253,112, 97, 33, 26, 3,111,247, 7, 4,129, 91, 55,238, 93,174, 47,240, 5, 8, 18, 72, 32,207,129, 0,129, 2,194, 8,
+130,162, 88,179,217,140,248,248,120,176, 44,139, 1, 61,135, 38,140,152,127,192,177,229, 0, 21,220,235,186,128, 96,241,209, 63,
+133, 8,216,217,217, 5,101,101,101, 33, 38, 38, 6,225,225,225, 73,153,153,153,167,212,106,245,208,228,228,100, 0,200,126, 7,
+200, 18, 50, 31, 20, 20,132, 38, 77,154,160, 79,159, 62, 2,141, 70, 19,230,229,229,229,154,145,145,209,252,175,204,207,155, 92,
+228,127,138,104,149,217,208,140,198,186,186, 53,107,160, 62,125, 26,188,147, 39,177,199,197,165, 64,171,213,126, 11, 32,161,184,
+225,127,189,105,243,230, 43,221,174, 93,179,209, 71, 71,195,235,254,125,208, 50, 89, 80, 85, 19,176,113,227, 70,168, 84, 42,228,
+229,229, 1, 0, 86,172, 88, 1,149, 74, 5,147,149, 1,103, 57, 92,180,116,118,172,133, 84, 60, 3,195, 33, 37,177,117, 53, 77,
+ 37, 90,105,178,107,188,147, 58,143,116, 69,116, 92,136,184, 48, 75,223,148,160,244,208,102,106,224,218,162, 14, 56,224,180,172,
+ 74, 26, 45,235,254, 28, 14, 39,251,233,211,167, 93,125,124,124, 34, 0,216,191,139, 61,192, 27,242, 60, 45, 45,109,220,187,188,
+ 72, 81,212, 15,175, 94,189,114,220,176, 97,195, 87,115,230,204, 97, 75, 19, 45,203,255, 57, 28, 14, 88,150,133,173,173, 45,104,
+154,118,186,122,245,170, 83, 72, 72,200, 42,134, 97,130,202,201, 39, 27, 16, 16,128, 87,175, 94,129,195,225,192,214,214, 22,140,
+201,128,217, 19, 70,193, 76,241, 57,147, 39, 79, 14,234,213,171,215,131, 13, 27, 54, 24,109,154,181,104,158,149,149,245,112,204,
+128,129, 15, 14, 29, 58,164, 47,118,241, 80,249, 20,159,101,239, 62,123,246,140,114,115,113,162, 88,147,134, 17,115, 1,193,189,
+101, 44, 79,226, 12, 1,135, 98,185, 4, 9,190, 64,104, 27,147,152,152,197, 48,204, 99,107, 48, 25,134,185,243,234,213, 43,161,
+147,163, 29, 71, 83,168, 47, 16,210, 44, 47,246,206,237,151, 53,131, 27,121, 1,128,246,206,205,243,252,186,245,132,177,105, 25,
+226, 90,181,106, 89,133, 89, 88, 88,120, 55, 41, 41,137,114,114,114,226,196, 37, 36, 30,150, 73,196, 14, 54, 50, 89, 83, 0, 48,
+228,231,221, 36,117,186, 12,138,230, 56,101,100,101,101, 23, 22, 22,190,178, 54,239, 47, 94,188,224, 40,149,142,212,241,147,103,
+ 34,156, 68,124, 71, 41,143, 99,195, 39, 8, 66, 68, 17, 42,174,137,201, 20,136, 68,142, 49,137,137,217, 44,203,150,171, 33, 92,
+152, 59,176,103,209,247,154,189,187, 20, 54,238,221,187,135, 99,151, 31, 67,204,234, 65,104,243,112,114,211,122, 12,152, 60,237,
+189,237,254, 42, 35, 91,239,164,205, 90, 91, 47,234, 13,124,164, 84, 98, 8, 63, 96,192,128,217,219,182,109, 43, 49, 64,121,252,
+248, 49,218,182,109,107, 89,230, 64,135, 14, 29, 16, 18, 18,130,199,143, 31,195,219,219, 27,103,207,158,229, 83, 20,197, 31, 56,
+112,224,252,237,219,183, 31,173, 84,239,191,110, 29,134, 14, 29, 90,150, 97,245, 11, 0, 90, 66,238, 91, 48,117,225, 22,251,236,
+172, 76,164,103,164,222,181,182, 28, 8,130,192,224,137, 19, 51,215,234,245,216,113,227, 6, 6,137,197,162,205,207,159,163,115,
+ 72, 8,234,183,109,155,105, 77, 95,103,209,234,104,181, 90,208, 52, 13, 27, 27, 27,216,217,217,129,203,229,130,162, 93,192,225,
+ 5,130,228,114, 17,220, 42, 16,139,191, 21,107,194, 63,197,114,130, 64, 46,159,135, 59, 92, 81,185,182, 58,132,184, 6,122,176,
+ 44, 84,154, 4,156,179, 16, 18, 91, 15,216,210, 82,250,228, 23,171,124,101, 54,142, 92, 28, 91, 30,135,147,171, 18,247,107, 83,
+ 49,189,184, 44,152, 10, 38, 18,245,101, 50, 25, 18, 18, 18, 16, 31, 31,255, 8, 21, 27,248,107, 30, 63,126,252,146,207,231,251,
+ 57, 56, 56, 0,128,103,121, 19,115,134, 97, 74,236,176,182,238,216,107, 31,212,218, 75,240,113, 75, 63,108,137,152,135, 47,195,
+150,131,166, 8,152,205, 6,252,186,180, 11,204,186, 2,132,117, 27, 65,124,212,222, 59,240,116,132,254, 11, 99, 97,206,250,183,
+ 38, 2, 28,204,253,185,223, 85, 25, 95, 66,214, 7, 67,200,236,237, 29,197, 92, 46, 23,118, 54, 74,253,180,145,223,164,176, 44,
+ 91,210,110,104,138,107, 36,243, 21,133, 89,169, 5, 66, 25, 93, 8,176,100,205,119,243,102,243,225, 37, 49, 49,113, 92,235,214,
+173,231,231,231,231,231,168,213,234, 1, 0,224,233,233,233, 65,146, 36, 31, 64, 69,171, 35, 30, 40,219, 45, 4,247,254,253,251,
+144, 74,165, 72, 74, 74, 42,173,124, 1,195, 48,255,152, 77, 0,255, 80, 9, 6,112, 7,128, 18, 64,103,148,114,239, 64, 22,171,
+234, 62,138,140,140,100, 35, 35, 35, 63, 42, 25,188, 88,150, 49,101,103,131,213, 21,149, 45, 77,211, 44,128,210, 59,154, 68, 50,
+153,140,160,221,220, 64,240,139, 76, 63,216, 15,184,245,213,104,180,206,181, 12, 99, 6, 5,194, 0,182,212,164, 69, 45, 32, 48,
+207,190, 29,198,241,102, 32,149, 39, 43, 61,210, 1, 38, 22,102, 48, 84, 21,147,195,170,213,106,152, 76, 38,121,237,218,181,143,
+152, 76, 38,121,241,224,198,254,183,190,168,217,108,126, 73, 81, 20,190,250,234, 43, 88,180, 63,122,189, 30,169,169,169,208,233,
+116,208,235,245,120,245,234, 21,242,242,242,160,215,235,241,240,225, 67,120,122,122,130,162, 40,101, 5,157, 57,203,178, 44,220,
+221,221, 81,179,102, 77, 80, 4,139,223, 23,205,194,247,227, 71,161,159, 39,131,141, 43,127, 69,155, 54,109,234,213,170, 85,171,
+ 25,135,195, 49, 59, 59, 59,115, 15, 28, 56,112,216,108, 54,247,128,245, 61,207,209,169, 83,167,214,244,247,247,119,148,217, 72,
+141,124, 30, 5,158, 81,205,242,117, 89, 44, 71,147, 9,119,119, 15, 19,132, 34,239, 65,131, 6,153,203,211, 66,148,133,249,237,
+183,223, 42,125,125,125,109,229, 50,169,154, 71, 83,233, 92,176,153,121,247,110, 93, 7, 0,158,131,163, 22, 2,145, 95,120,120,
+184,169, 42,152, 51,102,204,240,116,112,112,144,145, 96,243,205, 6,195,127,214,219,117,250, 44,130,166, 11,193,229, 53, 26, 59,
+118, 44, 81, 21,204, 73,147, 38,213,242,243,243,147,201,108,196, 5, 28,154, 74,225, 50, 76,138, 0, 76, 42,173, 55,228, 8, 28,
+236, 53, 16, 73,130, 7, 13, 26, 84, 46,166, 69,155, 53,101,202,148,132, 55,136, 55,178,179,179,161, 77,125, 0,110, 82, 52, 2,
+ 37, 52, 26, 59,200,193,231,243, 75,182,190,151, 87, 93,203,179,209, 42,139,108, 89,251,110,163, 31, 43, 88, 2, 92, 91, 47,234,
+ 77,191, 89,201,201,201, 80, 42,149, 21,182,167,237,219,183, 79, 11, 13, 13, 77,239,208,161,131,254,200,145, 35, 32, 8, 2,103,
+207,158, 69, 82, 82, 18, 58,116,232, 0,150,101, 45,187,218,112,247,238, 93,180,111,223, 94,223,186,117,235,164, 98,255, 90,149,
+202,208,161, 67, 97, 52, 26, 81, 80, 80,128,236,236,108, 68, 70, 70, 34, 48, 48,144, 21,137, 68,189, 40,247, 79,230,133,125, 49,
+173,121, 64,131, 32,172, 90,190, 88,207,227,208, 11,171,210, 94, 9,130, 64,248,183,223,102,230, 5, 7,103,111, 85,171, 53,131,
+109,108, 68,181, 19, 18, 20,183, 79,156,176, 55, 24, 12, 86, 97, 88,180, 58,110,110,110, 37, 36,139,203,229,130,195,115, 0, 37,
+174, 15,158, 93, 7,136,156,123,225,220, 29,190,206, 86,140,131, 82, 9,142,139,101,229,187,118, 16,185, 99, 94,243,190,202, 3,
+ 45,250, 41,207,136,106, 96, 67,241,120, 64,178, 28,226,192,144, 95,125,106, 59,212, 20,226,218,222, 84,156, 92,149,248,135, 54,
+ 21,179, 0, 60,175,172,157, 27, 12, 6,173,217,108, 6, 73,146,224,112, 56,165,109, 2,175,252,241,199, 31,184,125,251, 54, 80,
+202,109, 79,126,126,190,153,162, 40, 8, 4, 2, 0,144, 84,208,223,129,166,105,208, 52,141,243,215, 47,218,245,251,172, 11,113,
+245,207, 83,104, 17,216, 31, 89, 5, 6,164,229, 25,144,171, 1,252, 27, 79, 71, 64,251,131,184,247, 42, 31, 65, 13, 2, 40,138,
+ 39, 14, 47, 11, 79, 27,131, 4,117, 60,122,103, 61, 98,234,232, 19,133,199,174, 29,122,252,232,226,190,123, 15,119,253, 22,241,
+188,121,227,214,234, 98,101, 2, 10, 10, 10, 88,130, 32,216,111,134, 79,123,185,117,104,142,121,249,128,123, 12, 71, 39,120,241,
+ 55,118,245, 30, 14, 14, 14, 87,237,236,236,206, 22,147, 35, 15,169, 84,122, 69,169, 84, 70,163,104,163,199,161,148,148, 20, 95,
+181, 90,221, 2, 69,155,179,226,178,178,178,218, 22,107,158,226, 42,208,132,109, 80,169, 84, 95,155,205,230,110,197,199,167,102,
+179, 57,232,217,179,103,126, 65, 65, 65,143,188,188,188,238,122,121,121, 29,243,242,242, 58,236,229,229,117, 56, 52, 52,116,169,
+197,221,195, 95,188,108,248, 22, 23,249,151, 17, 45, 20,147,172,117,197,103,148, 16, 45, 0,231,223, 52, 64, 51,241,249, 15, 77,
+ 99,198, 64,118,248, 48,232,103,207, 48, 36, 60,220, 70, 36, 18, 45, 71,145,143,166, 22, 18,137,100,213,172, 89,179,164,246, 11,
+ 22,192,229,226, 69,196, 70, 70,194, 72,211,183,222, 37,117,133,133,133,224,112, 56, 37,154, 24,177, 88, 12,179,217,140,178, 84,
+190,111, 53, 64, 19,174, 37,165, 69,131,135,154, 96,192, 22, 28, 87,181,190,209,255,229,116,199, 72,149,167,247,115, 53,215,251,
+ 71,135,166,142,203, 61, 90,222, 80, 19,156, 2,158, 76,128,248,248, 4,152,193, 84,105,189, 89,171,213,230,169,213,106, 4, 5,
+ 5,217,221,190,125,187,118, 96, 96,160,162,248,254,205,247,252, 48,205, 92, 92, 92,246,186,186,186,198,184,184,184,236, 5,208,
+172, 10,239,110,184,116,233, 18, 40,138,194,172, 89,179,144,159,159, 15,131,193,128,172,172, 44,196,199,199, 67,175,215, 35, 49,
+ 49, 17, 79,158, 60,129, 94,175, 71,108,108, 44,116,186,202, 39, 36, 12,195,192,198,198, 6,218,194, 2,172,158,247, 61,102, 76,
+153,128,188, 23, 81, 72, 76, 78,131,204, 86,140,113,227,198, 81,114,185,156, 97, 24,166,166,217,108,110,207, 48,204, 26,107,190,
+ 83,169,250,118,217,221,221, 61, 96,209,162, 69,126,223,207, 91,195,181,225, 20,176,124,169,128,225, 73,249, 44,175, 94, 83, 12,
+157,190,156,187,108,201, 47, 79,175, 93,187,150, 4,235,156,119,146, 0, 46, 7, 7, 7,251, 36, 37, 37, 5,250,250,250,214,181,
+247,168,197,231, 43, 93,115,185,202, 26, 42, 86,167,189, 65,184,214,104,181,102,205,154, 7, 87,174, 92, 73,174, 10,166, 88, 44,
+174,183,101,203,150, 0, 39, 39,167, 0, 90, 40, 20,104,242,242,246,152, 52,234,189,148, 76, 46, 32,109,100,159, 30, 60,120, 48,
+106,255,254,253,169, 85,193,244,246,246,246,157, 55,111,158,127,253,250,245,253,157, 61,107,243,133,174,238, 89, 2, 55,143, 44,
+ 97,253, 64, 62,220,106,118, 92,181,106,213,221,107,215,174, 89,133, 73, 81,148,137, 36, 73,208, 52, 13,145, 72,132,227,199,143,
+ 99,204, 23,253,225,238,106,135,186,190,190,104,247,229,215,216,191,127,127,137, 13, 15, 69, 81,229,142,232,155, 23,140,139, 8,
+ 86, 18, 81, 88, 91, 47, 10,107,235, 69, 5, 43,137,168,114,201, 86,241,223,203,122,198,170,222,168,156,229, 70, 43,200,214,209,
+243,231,207,255, 52,120,240, 96, 94,167, 78,157,112,227,198, 13, 12, 29, 58,244,242,129, 3, 7, 0, 0, 55,110,220,192, 55,223,
+124,115,249,204,153, 51, 24, 53,106, 20,218,182,109,203,187,116,233,210, 42, 88,225,251,199,100, 50, 97,227,198,141, 48,153, 76,
+144, 72, 36, 80, 40, 20,232,210,165, 11, 30, 60,120, 48,106,211,166, 77,209, 20, 77,127,222,185,219,103, 56,114,248, 0,158, 60,
+124, 48,106,243,252,129, 85,118, 10, 76,146, 36, 58,133,135,103,102,250,251,103,111, 86,169, 52,195,228,114,145,111,106,170,226,
+220,222,189,246, 86, 16, 53,194,108, 54,151,144, 43, 11,233,176, 28, 28,158, 3, 56,226, 0,112,164,141,113,239, 57,215,200, 13,
+193, 29, 94, 99, 60,174,200,127, 22,205, 35,135,246,250,222, 19,189,190,247, 68,247,201,181,134,136,106,224,119,113, 13,140,238,
+ 52,190,102,168, 87, 99, 91,168,210, 13,136,252, 53, 54, 78,155,133, 5, 0,158, 88,211,206, 25,134,121,148,148,148, 4, 30,143,
+135, 26, 53,106,248, 0,176,216, 5,110, 24, 62,124,248,216, 31,127,252,113, 2,128, 31,139,239, 73, 66, 67, 67,253, 11, 10, 10,
+240,236,217, 51, 0,184, 93,129, 54,184,100,151, 97,182, 42,150, 95,203,165, 62, 2,235,141,132, 92,222, 0, 73,217,122, 36,103,
+235,241,251,234, 30,136,186, 52, 23,183, 79, 14, 66, 92,106, 42,132,206, 61, 97, 54,233, 2,172,152,212,187,252,249,231,159,196,
+165, 75,151, 8,134, 97, 96, 52, 26,217,124,149,138,189,115,249, 50, 10, 47, 92, 32,108,108,108,136,150, 77, 90, 23,108,158,123,
+228,230,193,149,151,111, 27, 52, 85,158,168,191,143,204,120,249,242,101,179,189,123,247,134, 2,152, 81,191,126,253,107,241,241,
+241,205, 47, 94,188, 88,215,205,205,109,249,187,130, 90,220, 66,196,198,198,190,118, 20,187,133,208, 23,147,134, 78,197,100,174,
+ 59,128,111,240, 30,187,236,171, 32,231,255,197,198,240, 71,240,198,110,195, 55,137, 86,105, 71, 97,240,146,203,165, 70,163, 33,
+241,212,169, 83, 6,146, 36, 33, 18,137, 48,120,232, 80,114,245,111,191,181,234,223,172,217,217, 17, 31,127,124,236,236,153, 51,
+193, 33, 33, 33, 96, 89, 22, 36, 73, 98,247,238,221,133, 90,109, 97,150,187,187,187,204,154, 78,163,116, 3, 82,169, 84, 37, 68,
+ 43, 47, 47, 15, 78, 78, 78, 86, 47, 29,170, 85, 56,125,230,120, 84, 14,107,254, 50,190,211,243, 37,134,133,169, 61, 66,114, 25,
+ 51, 39,207,108, 68, 94, 33,139,124, 45, 56, 55, 72, 69,200, 96,239,158,134, 87,237, 67,158, 92,136,190,154,165, 53,107,171,180,
+ 91, 34, 61, 61,253,251,176,176,176, 44,165, 82, 73,216,216,216,192,213,213,149,236,222,189,123,102, 66, 66,194,143,239,250, 69,
+236,236,236,250,133,134,134, 70, 36, 37, 37,245,190,112,225, 66,205,139, 23, 47,246, 14, 13, 13,141,176,179,179,235,103, 37,196,
+158,105,211,166,169,121, 60, 30,154, 54,109,138,252,252,124, 20,239,242,169,240,176,102,137,148,203,229, 98,237,162, 31, 48, 99,
+202, 4,100, 71,223,192,189,203,167,112, 62,149,192,244,121,191,128,203,229,190,147,175,175, 58, 14,162,250,245, 93,164,143,191,
+ 25,218, 55,121,234,148, 41,210,187,119,239,210, 99,199,127,195,198,166,100,131,215,105, 49,133,143,190, 39,255, 84, 59,160,243,
+167,237, 48,107,198,196,250,197, 78, 59, 43,148,122, 14,162,250, 1, 46,210, 71, 19, 71,244,127, 57,126,252,120,225,194,133, 11,
+181,205,154, 53, 43, 76, 75, 75, 19,138,229, 10, 95,142,173, 44, 32, 54, 37, 85,210,172, 89,179, 87, 95,126,249,101,110, 85, 49,
+167, 79,159, 46, 58,113,226, 4, 39, 44, 44,204,148,147,147, 35,161,133,194, 32,130, 47,104,146,145,147, 99,219, 59, 44,236,121,
+239,222,189, 53,197, 14, 75,173,198,156, 57,115,166,232,201,147, 39,156,102,205,154, 25, 83, 83, 83,165, 98, 59,251, 64, 74,166,
+104, 28,147,146,102,211, 36, 36,228,197,216,177, 99,213, 21,165,179, 52, 73,145, 74,165, 73, 45, 90,180,192,175,191,254,138,101,
+203,150,161, 99,199,142,120,240,240, 1, 58,143,157, 0,191,209,223,224,240,213,235, 72, 74, 74,194,156, 57,115, 16, 24, 24, 8,
+ 46,151,251,164,204,246, 56, 42,154,184,155, 10,226,110, 42, 8, 98, 84, 52, 97,185, 46, 87,179,245, 99, 30, 74, 63, 95,214,115,
+183,103,150,173,233, 10, 86, 18, 81, 21,217, 97, 85, 70,182,122,247,238, 61,198,226,194, 97,216,176, 97,151,151, 47, 95,222,114,
+216,176,162,137,118,211,166, 77, 49,119,238,220,150,211,167, 79,191, 60,111,222, 60,180,107,215, 14, 94, 94, 94,149,110,124, 49,
+155,205, 48,153, 76,232,223,191, 63, 76, 38, 19, 50, 50, 50,240,244,233, 83,172, 91,183, 14, 44,203, 10, 0, 64,233,226,214,136,
+199,227,225,207, 59,183, 52, 51,134,133,108,175,130, 38,139, 40, 61,137, 41, 40, 40, 64,239,209,163, 51, 19,235,212,201, 94,147,
+153,169,249, 66, 46, 23,213,138,139, 83, 72,245,122, 87, 84, 96,151, 72, 16, 4, 24,134, 41, 33, 86, 22,194,245,230, 81, 60, 80,
+ 90, 37, 6, 13,115,244,226,182,100, 0, 64,235,129, 46,232, 62,185,214, 16,165,183,104, 69,171, 1, 69, 74,239,253,115, 95,178,
+249,201,230,133, 48,226, 81, 21, 52,214, 55,110,220,184, 1,153, 76,134,176,176, 48, 62, 73,146, 11, 44,243, 85, 20,249,206, 90,
+ 98,193,226,243,249,139, 7, 13, 26, 68,230,230,230,226,222,189,123, 0,112,166,188,126,137,101,217,146,188, 23,100, 19, 48, 51,
+ 60, 92,185,115, 28, 39, 47,238, 67, 76, 82, 6,226,210,181, 0,199, 22, 90,117, 34, 12,133, 73,208,231,222,129, 74, 39,178, 42,
+193, 92, 46, 55,163,126,253,250,108,227,198,141, 89,150,101,241,226,197, 11, 83,108, 92,156,233,214,210,165,236,253,145, 35, 9,
+233,211,167, 92,161, 80, 72,120,122,122, 66, 32, 16, 48, 2,129, 32,235,111, 28,188,255, 18,119, 11,127,129, 91,136, 15,169,213,
+ 98,241,239,148, 20,188,190,219,176,196,129,105, 89, 14, 75,193,218, 8,251,238, 91,181,218, 54,172,255, 64,117, 96, 96,160,220,
+213,213, 21, 4, 65,160, 71,207,158, 68,232,133, 11, 82,218,197, 5,118, 13, 27,150, 44, 71,156, 62,117, 10,199,143, 31, 87, 31,
+249,227,160,235,208, 47,190,232, 10, 96, 75, 5,137,225,240,249,252,146,223, 77, 73, 73, 1,159,207, 47,177,137, 80,169, 84,112,
+112,112, 64, 74, 74, 10,172, 92,153,219, 58,117,202,245, 41,233, 33,223,123,134, 72,105,226,152, 58, 21,102,150, 5, 77,152,129,
+ 66, 22, 70, 51,160, 51,178,104, 84,139, 82,156, 44, 52,201, 35,111, 28,120, 5, 96,107, 85, 74, 79,167,211,157,187,123,247,238,
+ 72,134, 97,246, 1, 32, 47, 92,184,192, 60,122,244,104, 12,172, 55, 92,127, 91,109, 47, 18, 77, 62,123,246,172, 98,242,228,201,
+ 57,145,145,145,121, 93,186,116,177, 93,183,110,157,162,109,219,182,147,179,178,178,118, 89,163, 8,140,143,143,223,146,144,144,
+ 48,166,113,227,198,200,206,206,134,193, 96, 64, 84, 84, 20,188,189,189,113,251,246,109,248,248,248,224,214,173, 91,168, 91,183,
+ 46,204,102, 51,180, 90, 45, 24,134, 49, 87,214,153,103,103,102, 0, 89,241, 72,190,113, 12, 79,239, 71,225,108, 50,129,149,187,
+ 34, 80,163,166,231, 59,249,169,241,113, 20,249, 43, 29,236, 78, 46,156, 61,211, 49,246,220,110, 28,216,184,146, 57,127,236,152,
+ 31, 79,138,145, 31,245,255,250, 51,189, 17, 30, 0,120,205, 67, 26,163,147,252,137, 89, 84, 19,169,103, 31, 85,236, 96,209,199,
+ 81,228,239,100,111,119,226,231, 5, 63, 74, 95, 28,223,140, 61,107,127,101,247,111,219, 25,168, 5, 66,252,253,253, 59,145, 36,
+ 41, 3,160, 45,182,243,178, 42,180, 77, 89,152,167, 35, 34,130,181, 64,200,161, 67,135, 58,137, 68, 34,103, 0, 70,141, 70,243,
+242,125, 48,207, 68, 70, 6, 91,210, 73, 16,132, 35, 0, 3,203,178, 47, 80,197, 16, 60,125,250,244,153,251,205, 55,223, 76, 49,
+155,205, 14,165,102,231,212,226,197,139, 57, 12,195, 80, 44,203, 26, 72,146, 52,156, 56,113,194,108, 50,153,146,181, 90,237,232,
+247,233, 69, 62,251,236, 51, 92,191,126,125, 54,138, 54, 97, 88,171,173,126,205, 78,171, 56,100,207, 59,227, 95,184,112, 97,206,
+231,159,127, 62,117,215,174, 93, 79,151, 47, 95,222,109,212,168, 81,216,189,123, 55,234,212,169,131, 63,255,252, 19,223,127,255,
+ 61, 0,180,156, 62,125,250,225, 13, 27, 54,120,197,198,198, 46,182, 66,163, 1,147,201,132,157, 59,119,162, 71,143, 30,112,112,
+112,128,139,139, 11, 8,130, 56,247,197, 23, 95,252, 6, 0, 20, 65,113, 1, 64,167,213,233,124,125, 27, 91,173,193,229,114,185,
+ 37,125, 93,106,106,106,201, 78,193, 79, 62,255, 60,243,247,133, 11,177,189,176, 16, 95,200,229,162, 68, 55, 55,229,225, 23, 47,
+ 70, 60, 44,234,156,217,138,180, 58,149,145, 44,107, 77, 26, 10, 83, 48,237,143,249, 49,206, 0, 58,182, 30,232,130,214, 3, 93,
+208,184,187, 35, 65, 82, 4,238,159,204,194,131,211,217,251,141, 42,156, 67,213,194,229, 60, 90,176, 96,193,225,143, 62,250,168,
+ 91,189,122,245, 48,124,248,240, 47, 55,110,220,200, 53, 26,141,227,241, 31, 55, 15,182, 36, 73,254,184,118,237,218, 17, 10,133,
+ 2,151, 46, 93,194,197,139, 23,207, 1,136, 47,175, 95, 2, 80,226, 51,171,134,187,143,246, 73,108,129, 40, 61,233, 10, 46, 95,
+250, 3,117, 2,191,134,208,185, 43, 20,190,243, 96,136, 94, 6,125,214, 73, 40,220,187, 32, 49,246, 5, 40, 14,255, 65,101, 70,
+ 40, 44,203, 62, 76, 76, 76,244,242,242,242, 34, 98, 98, 98, 76, 0, 88,179,217,204, 26, 90,181, 50,250, 45, 92, 72, 63,248,242,
+ 75,162,249,147, 39, 20, 75, 16, 76, 84, 84, 20, 0, 60,254,111,140,226, 22,119, 11, 15, 30, 60, 40,207,221, 66,149,164,126,253,
+250, 45, 47, 94,188,200,215,106,181, 56,127,254, 60,154, 52, 41,217,219,245, 95,245,126, 95,154,139,252,203,100, 68, 25,247,214,
+189,166,209,122,173, 98, 51, 4, 93,215,199,199,204, 37,177,169, 71,215,174,154,187,119,239,150,204,250,180, 55,111, 66,125,252,
+ 56,204,102, 51, 88,150,197,197, 11, 23, 48,104,224,192, 2,154, 34,126,175, 85,171, 38, 75,176,175,249,110,105, 95,198,236, 33,
+ 44, 44, 44,172,164,243, 73, 72, 72,128, 88, 44, 6,143,199, 3,195, 48, 48,153, 76,160, 40, 10,182,182,182, 48,153, 76,101,169,
+ 96,222,196, 52,154,179,213,189, 55,116, 30,144,226, 82, 96, 96, 71,202,106,193,131, 43, 44,105,156,206, 54, 4,186, 5,210,176,
+231,164,179,103, 22,127,156,204,232,178,122,227,237, 29, 93,149,109,249,247,105,208,160,193,111,131, 6, 13, 34, 1,160,125,251,
+246,100,131, 6, 13, 86,160,226, 80, 57, 21, 98, 10, 4, 2, 62, 0, 68, 68, 68,100, 63,125,250,180, 99, 68, 68, 68,118,233,251,
+ 86, 98,174, 91,180,104, 17, 68, 34, 17, 76, 38, 19,244,122,125,137,125, 86,233,179,193, 96,128,189,189, 61,142, 28, 57, 2,179,
+217,124,164,178,116,186,123,212, 4,225, 80, 27, 91, 34,206,226, 98, 38,247, 93, 72, 86, 9,102,109,103,113, 93,103,123,187, 83,
+ 63,207,159,227,144,243, 60, 10,137,137,137,236,137,227, 71,174,105,129,164,188,124,204,200, 85,163,110,161, 30,130, 38, 94,136,
+ 63,181,246, 59,118,122,107, 24, 81,246,174,193, 18, 76, 63,103,113, 93, 87, 7,187, 19,191,252, 60, 95,154,251, 60, 10, 41,169,
+169, 56,122, 36,226,174, 22,176, 44, 55, 14, 97, 24, 38,128, 97,152, 0, 0, 67, 42, 32, 47, 85,194,212,104, 52,245, 53, 26, 77,
+253, 15,137,201,178,108,125,150,101,173,198, 44,109, 19,181,100,201,146,232,148,148,148, 65,233,233,233, 29, 44, 71, 78, 78, 78,
+251,130,130,130, 54, 26,141,166, 85,225,146,154,182, 26,141,198,177,160,160, 64,169,213,106, 27, 1,136,170, 66,157, 47,145,210,
+ 94,167, 83, 82, 82,102,165,164,164, 16,149,165,147, 26, 29, 77,236,248,101,226, 31,107,215,174, 85,190, 39,254,107,233,204,204,
+204,220,183,107,215,174, 32, 79, 79, 79,175, 33, 67,134, 96,205,154, 53, 88,190,124,185, 14, 0, 54,108,216,160, 43,165,201,114,
+143,141,141,109, 92,206,178, 97,251, 82,218,146,173,159,124,242, 9,123,241,226, 69,244,232,209,163,196,145,232,250,245,235, 97,
+ 50,153, 84,237,218,181, 99, 0,160, 80,171, 81,177, 12, 11,189,161,220,245,247,183,202,147,199,227,125, 90,218, 95,160,197, 25,
+ 51,143,199, 3,203,178,168,219,178,101,102,110, 96, 96,246,198,188, 60,205,172,250,245,109, 70,248,250, 14,169, 7, 12, 44, 11,
+147, 32,136,215,180, 58,111, 30, 85,208,100,149, 78,103,122, 97, 50,134,255, 49, 63,230,184, 69,179, 37,144,112,160,205, 55,225,
+224,194,152, 12,109, 6,214,151, 71,126, 42,202,123,118,118,246,216,133, 11, 23,234,228,114, 57, 62,251,236, 51,204,155, 55,239,
+139,150, 45, 91,230, 57, 58, 58, 94,175, 83,167,206,253,190,125,251,166, 68, 69, 69,141, 13, 13, 13,197,179,103,207,240,203, 47,
+191,228,230,228,228, 12,168, 8,147, 32,136, 18, 77, 94,247,206,237,179, 87,175,248,149,105,247,209, 24,136,132, 54, 48,210,238,
+200, 46, 48, 34, 71,205, 66,207, 15, 1,143,203, 71,135,102,254,184,126, 98,179,198,172, 87,111,169,172,206, 23, 20, 20,236, 31,
+ 60,120,176,138,203,229, 66,175,215,179, 52, 77,131, 95,100,119,204,208, 29, 59, 26,154, 63,122,100, 50,179, 44, 67, 16, 4,190,
+253,246, 91,117, 78, 78,206,174,119,105, 71, 85,144,210,152, 31,202,221, 66,251, 55,198,159, 15,225, 22,226,175,200,251,191, 89,
+214,149,113,252, 71,163,101,217, 82,105, 57, 19, 4, 99, 54,155, 25,212,242,172, 37,141,141,137, 95,217,167, 79,216,176, 78,157,
+ 58,139, 58,119,238, 44,240,143, 46,154,141, 70, 68, 68,224,192,129, 3,154,147, 39, 79,170,248, 52,181,193,189,134,187,147,217,
+204,128, 32,152, 10,217,176, 84, 42, 29, 63,109,218, 52, 97, 94, 94, 30,150, 47, 95,206, 4, 5, 5,145, 98,177, 24, 6,131, 1,
+ 27, 54,108, 48,250,251,251,211, 36, 73, 34, 47, 47, 15, 36, 73, 62,177, 50,131,247,242,226,147, 58,252, 22,218,235, 64,227,175,
+134,218,249,133, 54,151,183,113,119,133,177, 33,139,228,132, 24, 60, 61,115, 50,231,225,137,165, 89,208,166,245, 66,229,225,129,
+202, 26, 8,126, 56,121,242,164,227,216,177, 99, 89,173, 86, 75,196,199,199,179,243,231,207,119, 28, 62,124,248, 15,201,201,201,
+253,222,241,163, 16,185,185,185, 32, 8,130, 41,238, 72, 44,179,254,170,172,203, 61,216,178,101,203,161,158, 61,123,118,111,215,
+174, 29,162,163,163, 75,150, 8, 75, 19, 45,203,238,195, 5, 11, 22,228, 2,152, 90, 25, 40, 77,211, 88,190,101, 31,114,115, 50,
+225,228,228, 2,129, 80,136,119,221, 97,201, 35,201, 89, 63,205,153,233,152,249,248, 58,241,224,218, 89,102,239,189,180,116,147,
+153, 45,219,227,127,126, 50, 91,204,254, 43,158,205,144,212,172,159,230,255,104,107, 89,214,220,117, 39, 69, 69,152,217,177,239,
+213, 68,254, 45,152,127,179,184,184,184, 32, 37, 37,133,112,113,113, 97,139,109,180,216, 10,136,214,235, 21,188,104,185,140,168,
+104,217,240, 93,241, 95,189,122, 53,191, 97,195,134, 19,159, 61,123,182,215,207,207,111, 20,128, 26, 58,157, 46,119,250,244,233,
+ 63,111,216,176, 97,152, 53,154, 44, 0,216,189,123,247,210,161, 67,135, 30,239,218,181,235,119, 12,195, 52, 40, 53,176,191,114,
+116,116, 44, 89,194,205, 72, 75,157, 50,114, 88,255, 41, 5, 5, 57, 86,251,185,147, 72, 36, 35,166, 79,159, 46, 80,171,213, 88,
+181,106, 21,227,239,239, 79, 90, 38, 69,219,182,109, 51,249,248,248,112,194,198,140,201, 92,146,154,138,185,151, 46,169,167, 4,
+ 4, 4,109,124,250,180, 17, 24,102,107,121, 90,157,178, 52, 89, 22,179,139,119,148,228, 98,178,181, 30, 64,199,230,125,156,113,
+104, 81, 12,114, 98,245, 63,195,132, 23,176, 34, 44, 80, 25,146,184,127,255,254, 14,105,105,105,135,102,206,156,105,219,168, 81,
+ 35, 4, 4, 4,208, 18,137, 36,196,226, 46, 38, 47, 47, 15,167, 79,159,198,154, 53,107,244, 15, 31, 62,236, 89,209,114,149,217,
+108, 78,247,241,241,177,148, 3, 75, 16, 68,150, 74, 71,216,238,169, 23, 34, 25, 50,114, 47,113,249,214, 85, 36, 27, 24,232,140,
+ 12,106,121, 6,163, 77,199, 37, 56,124,236,190, 57, 57,246,209, 35, 99, 97,206,239, 86,164,247,197,243,231,207, 15,206,153, 51,
+167,207,119,223,125, 39,204,204,204, 52,235,116, 58,102,223,190,125,212,144, 33, 67,204, 44,135,195,112, 57, 28,140, 31, 63,190,
+ 48, 55, 55,247, 15,224,111, 13, 48,253,151,184, 91,248, 11,220, 66,124, 48,109, 86,233,243,255,138,148,217, 66, 25,138,188,178,
+102,237,234, 79,119,239,220,229, 76, 81,164,243,139,151, 47,111,117,235,213, 59,233,212,169, 83, 10,174,173,109, 19, 0,140,126,
+212,168,107, 6, 93, 97,118,228,161, 67, 30,181,106,213, 12, 44, 14, 42,205, 50, 20,121,165,162, 31, 44, 40, 40, 80, 95,186,116,
+ 73, 51,117,234, 84, 34, 33, 33, 97,135,147,147, 83,223, 99,199,142, 73,122,245,234, 85, 24, 29, 29,189,223,217,217,185,123,104,
+104,168,116,226,196,137,186,130,130,130,170, 4, 30,125,196,102,228,212,187, 57,115,241,231, 55, 23,173,254, 24, 28,170, 5,116,
+ 52,192, 24,175,192,144,127, 10,192, 14, 84,193,223, 81,105, 17,139,197,129, 34,145, 8,119,239,222,205, 9, 9, 9,209,107,181,
+ 90,238,188,121,243,236,196, 98,113,224,187, 22, 60,203,178,108, 78, 78, 14, 24,134,225, 0, 32,138,207, 96,170,190, 23,191, 95,
+183,110,221, 14,237,217,179,231,147,206,157, 59,195,203,203, 11, 70,163, 17, 62, 62, 62,208,235,245,240,246,246,134, 78,167,195,
+236,217,179,145,151,151, 55, 1, 21,196, 60, 35, 8, 2, 38,147,169,196,216,214,213,205,163,200, 79,207,123,184,177, 16,211,164,
+215,147,200,141, 72,207,202,100,246,252,153,150,166, 49,152, 59, 60,207,208, 60,124,243, 57,141, 25,234,208, 33,227,146, 0, 64,
+199, 84, 28,113, 94,204,131,215,211, 35,235,145,150,158,137,221,119, 82,114,213, 6,166,227,211, 50, 48,171,148,206,127, 9,102,
+240,236,104,244, 30,103,253,179,239, 35,214, 18,170,242,228,110, 42,136,219,162,141, 44,214,110, 44,211, 71,214,123,226, 31,122,
+246,236,217, 33, 0,120,244,232, 81, 66,255,254,253,167,196,196,196,204, 1,112, 52, 54, 54,118,109, 85,128, 54,110,220,248, 12,
+192,208,138,158,217,181,120,232, 65, 0, 7,171,130,155,159,159,175,141,138,138,210, 78,156, 56,145, 72, 72, 72, 56,230,236,236,
+252,201,241,227,199, 69,189,122,245,210, 61,120,240,224,140,139,139, 75,235,246,237,219, 75,142,222,184,145,164,121,241, 34, 50,
+ 50, 38,198,205,200, 48,145, 21,181,207, 15, 76,178, 94, 35, 91, 7,231,198,252,116,232,167,152,246,140, 14,251,245, 57,184, 6,
+ 32,241, 61, 48, 47, 94,185,114,197,111,224,192,129,123,186,116,233,210,220,207,207, 15, 53,106,212,192,211,167, 79,145,145,145,
+129,123,247,238, 33, 34, 34, 34, 66,171,213, 86, 26, 80, 59, 59, 59,251,237,240, 68, 2,133,203,230, 85,179, 34,110, 93,110,226,
+211,170,243, 96, 97,128, 11,112,159,172, 26, 0, 0, 32, 0, 73, 68, 65, 84, 3,189,129, 69, 66,220, 11,204,158,241,187, 38, 37,
+238,217, 35,131,201,208, 19, 86,110,212, 41, 44, 44, 92,183,108,217, 50, 58, 50, 50,178,243,202,149, 43,165, 30, 30, 30, 20,151,
+203, 37, 1,176,183,111,223,102,199,141, 27,167,206,204,204, 60,162, 82,169,214,253,205, 99,244,197,151, 47, 95, 6, 83, 20,245,
+ 65,221, 45,188,135, 91,136,106,249,144,226,233,233,230, 87,219,195,101,148, 87, 13,183, 49,158, 30,238,225,101, 25,185,123,201,
+229, 82,207,154,174, 35,188,106,184,141,169,237,225, 50,202,211,211,205,207, 10,213,162,151,141,141,205, 49,165, 82, 25, 4, 0,
+182,182,182,221,101, 50,217, 67, 91, 91,219,238,197,179,192,238, 18,137,228,177,191,191,255,240,191, 81, 93, 89, 33,166,143,143,
+ 79,255,130,130,130, 47,125,124,124,250, 91,174, 95,188,120, 81,114,253, 46,152,238,238,238,237,110,223,190,221,111,241,226,197,
+159,213,169, 83,167,251,252,249,243, 63,251,227,143, 63,250,185,185,185, 53,122, 7, 76, 62,128,237, 52, 77,167,241,120,188,116,
+154,166,211, 44, 7,135,195, 73,163, 40, 42, 13,192,218,114,180,101,237, 75,205,114, 46, 59, 57, 57,197, 58, 57, 57,197, 58, 59,
+ 59,199, 58, 59, 59,199, 42,149,202,183, 14,123,123,251,203,214,150,167,175,179,164,101, 72, 13,233,149,250, 74,201,229,122, 78,
+ 98,223, 15,241,141,124,157, 37, 45,155,212,176,189, 82, 95, 41,189,244,255, 13, 51,200, 25, 44,187,198,151,101,215,248,178, 65,
+206, 96, 43,187,254,144,106,127,165, 82,201, 42,149,202, 89,127,213, 82, 66, 57,248,127,123,123,255,128,152, 94, 82,169,116, 87,
+141, 26, 53, 44,125, 93, 87, 27, 27,155,115, 18,137,164,107,113, 95,215, 85, 44, 22, 95,240,247,247, 31, 92, 25,166, 66,161,184,
+237,232,232,152, 90,124,164, 56, 57, 57,165, 56, 57, 57,165, 56, 58, 58, 38, 59, 58, 58, 38, 59, 56, 56, 36, 89, 14,153, 76,118,
+253, 29,243,238, 8,160, 41,128, 70, 0,108, 62, 96,121,122, 2, 24, 89,220, 7, 45, 4, 48, 28, 64,131, 15,240,141, 8, 90,168,
+ 24,205,151,185, 95,161, 37, 14,249,180,196, 33,159,111,235,118,165,130, 16, 60,214, 96,214, 85, 40, 20,243,108,108,108,254,144,
+ 74,165,151,164, 82,233, 33,123,123,251,249, 0,234,254,151,234,146, 4,192, 6, 20,249,103, 58,138,162,165,240, 67, 40,218, 84,
+224,241, 15,172,243,255,159,101,196,127,235,135,219, 87, 99, 86, 99, 86, 99, 86, 99, 86, 99, 86, 99,254, 11, 49,201,234,242,172,
+ 38, 90, 85, 36, 90,111, 30, 0, 42,240, 12, 95, 45,213, 82, 45,213, 82, 45,213,242,255, 88,152,234, 34,168,150, 42, 74,153, 75,
+203, 68, 5,172,180, 42,190,166,222,133,217,158,174,198,172,198,172,198,172,198,172,198,172,198,172,198,252,127,135, 89, 45, 31,
+ 80,170,213,170,213,152,213,152,213,152,213,152,213,152,213,152,213,152,255,235, 82,189,116, 88, 45,213, 82, 45,213, 82, 45,213,
+ 82, 45,213,242, 23,201,186, 82,132,235,181, 37,196,106,162, 85,117, 33, 1,124, 9,160, 55,128,218, 40,138,102,191, 15,192,111,
+120,183, 53,125, 27, 0, 83, 0,180, 64,209,238,156, 87, 0, 46,161,104,119, 78, 65,117,113,151, 45,246,246,246,211,104,154,150,
+ 1, 69,161, 77, 44,231,210,255, 55,155,205,185, 42,149,106,254, 95,148, 4, 10, 86,122, 80,182,164,181,116,218, 74,159,141, 70,
+227, 95,153,206,106,249,103,138,143, 66,161,216,158,157,157, 61, 0,165,130, 44, 87, 75,181,252, 47,136,131,131,195, 40,131,193,
+ 48,157,203,229,206,203,200,200, 88,253,255, 40,235,111,145,172,215,136, 86,100,100,228, 5, 0,232,210,165,203, 71, 0, 32,147,
+201,174,146, 36,233, 89,149, 95, 96, 24,230, 85,110,110,110,185, 14,212,100, 50,217, 85,138,162,222,194, 52, 26,141, 82, 14,135,
+147, 95,214, 59, 38,147, 41, 81,165, 82, 53,250,135, 20, 34, 1, 32, 82, 46,151,107,231,204,153,243, 91,155, 54,109,220,147,147,
+147, 77,147, 39, 79,110,253,231,159,127,118, 6,240,105, 21,201, 86, 51,130, 32, 54, 7, 5, 5, 29, 12, 15, 15,223, 19, 18, 18,
+194,203,202,202,146,238,219,183,207,117,203,150, 45, 81, 12,195, 12, 64, 5,129, 86,255, 63, 11, 77,211,178,196,196, 68, 41, 80,
+ 20,154,164,152, 88,193,104, 52,194,104, 52, 66,173, 86, 35, 48, 48,240,131,255,174,179,179,115, 48, 65, 16, 43, 37, 18, 73,163,
+130,130,130, 91, 0,198,164,164,164,252, 89,149,180,154, 76, 38,176, 44, 91,146, 78, 63, 63,191,234, 15, 90, 53,249,130,199,227,
+117,244,246,246,110,162,211,233,114, 94,189,122,117,211,108, 54,207,196,135,139,209,102, 11, 96, 38,159,207, 15,169, 93,187,182,
+251,179,103,207, 18, 12, 6,195, 13, 20, 5, 67,206,251, 16, 36,235,163,143, 62,186,188,106,213, 42,187,209,163, 71, 95,190,116,
+233, 82,203,106,178, 85, 45,255, 45,113,119,119,151,169,213,234,223, 1, 4,211, 52,237, 44, 16, 8, 32, 20, 10, 83,249,124,254,
+ 93,161, 80, 56,236,202,149, 43,185, 85,197, 52,155,205, 51, 99, 99, 99,157,155, 54,109,186,200,209,209,113,118,102,102,166,214,
+ 96, 48,156,201,201,201,153, 0, 64, 85,209,187,111,114,145,127, 25,201, 42,125,134,133,116,113,138, 51,198, 2,104,243, 26, 3,
+227,112,220,226,226,226, 28, 5, 2, 1, 24,134, 41, 25,204,222, 60, 44,247,245,122, 61, 2, 2, 2, 12,149, 12, 56,238, 9, 9,
+ 9,142, 60, 30,175,228,158, 94,175,135,171,171, 43,147,152,152,232, 88, 28,246,160, 68,116, 58, 29,220,220,220,254, 73, 49,143,
+190, 84, 40, 20,121,241,241, 9,129, 90,157,225,199,225, 99,167, 78, 27,208,251, 99,249,213,171, 87,153, 79, 63,253, 84,119,225,
+194,133, 47, 81, 20, 56,213,170,206,156, 32,136, 45,147, 39, 79,158, 45, 16,217,216,157,189,250, 72,183,101,223,145,164, 32,159,
+ 90,196,132, 9, 19,168,113,227,198, 93, 12, 14, 14,222,206, 48, 76, 67, 84, 65,179, 37,151,203,143,243,249,252,154,197,229, 23,
+159,147,147,243,201, 63,176, 66,114,240,182,243,216,178,238, 85, 42, 89, 89, 89, 40, 44, 44,124,235,240,243,243,179, 54, 86,102,
+149,210, 77,211,244,161, 5, 11, 22,184,166,166,164,224,215, 37, 75,154,162, 72,147,217,212,154,151,211,211,211,223, 74,167,175,
+175, 47,170,165, 74, 50,101,246,236,217, 11, 62,255,252,115,152,205,102, 20, 22, 22,186, 60,127,254,220,127,250,244,233, 61, 95,
+188,120,209, 4,192,203,247,157,140,123,123,123, 71,127,253,245,215,138, 38, 77,154,160, 56, 74,133,203,165, 75,151,154,110,216,
+176, 97, 80,124,124,188, 47,128,140,247,249, 1,133, 66,177,125,253,250,245,118, 34,145, 8,135, 15, 31,182,107,215,174,221,165,
+ 59,119,238,180,122, 15,178, 69,218,217,217,141, 3,208,150, 97, 24, 30,128, 27, 57, 57, 57,115, 81,117,175,238, 74,137, 68,178,
+159, 36,201, 90,192,127,188,209,147, 36,105, 79, 16, 68,166,229, 30, 65, 16,142, 12,195, 92,203,206,206,110, 94, 93, 29,255,221,
+ 98,103,103,247, 69, 90, 90,218, 42, 62,159,207,149,203,229, 16,137, 68,224,112, 56,224,112, 56, 53,248,124,126, 13, 62,159,223,
+ 41, 52, 52,116,204,185,115,231, 42,244,176,223, 44,200,105, 8, 72,226, 71,138, 32, 41, 0, 32,105,177,141,173,173, 45,126,252,
+241, 71,113,247,238,221,197, 0,112,249,242,229,240,193,131, 7,183, 75, 76, 76, 12, 40,143,108,149,197, 69,254, 69,178,174,162,
+ 1, 15,197,236,241,194,107, 45,151, 36,193,227,241,112,253,250,117, 88,227,172,220, 18, 34,161,194,222,160,216,195,248,159,127,
+254, 71, 1, 96, 25,104,120, 60, 30,174, 92,121,221,169,124,179,102,205, 74, 26,251,223, 37,189,253,138,156, 60,238,253,170, 40,
+ 93, 97, 43,139,188,107,239,253,202, 23,173,127,137, 67,239,113,179,250,106,180,134,198, 0,212,185, 57, 57, 57,183, 14, 28, 72,
+ 14,242,241,225,110,223,190,189,137,171,171,107,239, 42, 16,173, 41, 13, 27, 54,220, 79, 9,109,237,195, 7, 15, 9, 31,198, 33,
+ 13,131, 70, 78,156,151,144,146,169, 30, 49, 98,196,129,195,135, 15,135,255,244,211, 79,143, 39, 77,154, 52, 5,192,247,214,166,
+ 95, 32, 16,212,124,242,228,137,183,217,108,134,159,159,223, 63, 49,140, 65, 16,138,156,239,125, 14, 96,103,241,189,254, 40,242,
+220, 31, 12,224,110, 85,192, 44, 26,172,178,142, 15, 45,174,174,174,190, 3, 7, 14,180,207,206,204,196,175, 75,150, 88,110, 55,
+ 66, 37,203,136,150,246,163,215,235,241,217,103,159, 13, 52,155,205, 28, 11, 9,212,233,116,250,188,188, 60, 45,254, 99, 88,154,
+ 1,224, 99, 43,146,227, 41, 22,139,127, 6, 16, 92, 88, 88,232, 10, 0, 98,177, 56,137, 97,152,131,106,181,250,123,252, 39,128,
+111,149, 39,184, 0,252, 81,126, 40, 40,118,193,130, 5,207,166, 78,157,250,242,191,128, 89,211,201,201,105,126, 88, 88, 24,142,
+ 28, 57,130,163, 71,143, 26,133, 66, 33,103,240,224,193,196,152, 49, 99,228, 95,127,253,117, 39, 0,203,222,243, 51,119,154, 61,
+123,182,162, 94,189,122,216,183,111, 31,238,221,187, 87,232,237,237, 45,108,211,166, 13, 56, 28,142, 98,218,180,105,159, 2,216,
+252, 62, 63,144,157,157, 61,119,226,196,137, 91,118,238,220, 41,125,245,234, 21, 86,174, 92,105,223,183,111,223, 11,241,241,241,
+ 31, 85,129,108,241, 1,140, 3, 16, 74, 81, 84,171,193,131, 7,155,198,142, 29, 75,147, 36,105, 92,178,100,137,195,134, 13, 27,
+250,210, 52, 29,156,149,149,101,205, 36,141, 4,240,227,176, 97,195,134,158, 59,119, 78,126,243,230, 77,158,157,157, 29,204,102,
+115,137,166,152, 97, 24, 71, 75,157, 53,153, 76,240,245,245,117, 43,245,190,240,223, 74, 52, 72,146, 52, 48, 12, 67, 3, 16, 0,
+208, 85,118,253,191, 68,178, 20, 10,197,232,236,236,236,223,156,157,157,225,228,228,244,214, 88,171,211,233, 32, 16, 8,184,206,
+206,206,235,187,119,239, 78, 31, 58,116,168,220, 37, 64,130, 34,102, 30,222, 53,199, 85, 33,151, 2, 0,150,174, 57,161, 1,128,
+ 63,254,248, 3,201,201,201,144,203,229, 8, 8, 8,160,230,204,153,163,156, 48, 97,194,175, 57, 57, 57,195,202,195,122,147,139,
+252,203, 52, 90,235,202,186,174,208, 70,139,101,217,146, 56,121, 86, 86,218, 55,111,157,126, 3,143,208,235,245,120, 83,163,101,
+105,188, 52, 77,191,169,126, 4, 65, 16,108, 69,152,101,200, 96,177, 88, 28,168, 86,171, 87, 84, 97,118, 91,130,185,247, 43, 95,
+108,225, 79,238,111,137, 68,218,105, 98,209,121, 11,128,171, 49,195, 86,174,250,232, 35,215,113, 51,150,207, 42,204, 74,206,156,
+ 54,176,107, 77,111,103, 59,161, 56, 55, 61, 79, 81,183,110,135, 55, 52, 50,149,165,179,117,120,120,248,214,147,215, 99, 9,129,
+128,203,229, 80, 20,221,178,190,143,157,187, 45,101, 43, 5,108, 19, 94, 62,187, 58,100,200,144,250,147, 38, 77,106, 85, 5, 76,
+ 20, 15,184,216,182,109, 27, 8,130, 32,171,146,247, 15, 40,167, 43, 34, 89, 44,203,130, 32,136, 29,165, 6,149, 29,197,247,238,
+148, 34, 91,156,138,202,211,162, 77,181,144,170,193,131, 7, 15, 52,153, 76,156, 82,157,196,155, 4,166, 44, 18, 99, 85,222,149,
+ 74,229, 73, 0, 31, 19, 4, 1,189, 86,171,255,249,151, 95, 74,255,249,246, 27, 36,235,116,121,109,201,104, 52,194,108, 54,115,
+238,220,185, 67,151,170,235, 52, 0, 49, 0,123,150,101, 65,146,228,125, 43,202,211, 87, 36, 18, 93,141,136,136,176,105,212,168,
+ 17,193,227,241, 96, 50,153,240,224,193, 3,247,159,126,250,105,228,233,211,167, 63, 85,171,213,126,120, 59,120,186, 53,223,200,
+255,210,165, 75,106, 47, 47,175, 50,137,163, 74,165,226,248,248,248,124, 84, 14, 41,250,171, 49, 19,211,210,210,122,124,252,241,
+199,163, 82, 83, 83,163, 77, 38,211,119, 0, 2,236,237,237,239,244,234,213, 11, 66,161, 48,180,176,176,112,217,251,212,121, 71,
+ 71,199,238,205,155, 55,199,202,149, 43,241,211, 79, 63,181, 7,112, 6, 64, 59,149, 74,117,186, 91,183,110,144,201,100, 61,114,
+115,115, 55,191, 71, 59,242,105,221,186,245,250, 31,127,252, 81,122,228,200, 17,120,123,123, 35, 63, 63, 31,223,126,251,173,227,
+ 15, 63,252,112, 62, 55, 55,183, 77,169,118, 81, 30,166, 31,159,207,223,188,115,231, 78,137,151,151,151, 23,151,203, 37,189,188,
+188,144,157,157, 13,173, 86,203,159, 55,111, 94,125,161, 80,248,231,178,101,203, 54, 3,232, 85, 73, 58, 73, 0,115,215,174, 93,
+ 59,106,196,136, 17,178,129, 3, 7,154,245,122, 61,246,236,217, 3,138,162, 64,211, 52, 68, 34, 81, 73,240,106, 46,151,139,186,
+117,223,114,146,126,184,130,252,230,161,200, 14, 85,134,170, 45,187,158,174, 0,175,100,233,131,166,105, 8, 4, 2, 8, 4, 2,
+240,249,124, 60,121,242,100,134, 64, 32, 88, 66, 16,132,201, 26, 76,226, 63,236, 34, 16,192,205,202,174,241,182,105,200,223,217,
+127, 90,196,141, 32,136,165, 0, 66,139,134, 93,242,130,189,189,253,248,180,180,180, 56,107, 49,149, 74,165, 93, 86, 86,214, 50,
+165, 82, 9, 39, 39,167,146,241,219,213,213, 21, 70,163, 17,105,105,105, 96, 89, 22,185,185,185, 16,137, 68,112,113,113, 89, 54,
+ 98,196,136,125,235,214,173,203, 42, 19,147,193, 79,221,250, 78,159, 73, 81, 20, 9, 0, 20, 71, 34,249,122, 42, 80,179,102, 77,
+180,108,217, 18, 90,173, 22,121,121,121,240,247,247,231, 16, 4, 17, 78, 16,132, 13,203,178,171, 1,156,253, 31, 84, 20,150,107,
+ 12, 63,251,205,117, 81, 75,180,120, 46,151,107, 21,209, 42,126,190, 50, 13, 10,105, 52, 26,193,229,114, 95,211, 72, 16, 4, 1,
+179,217,252,218,125, 11,209,122, 23,162, 62,102,204, 24,102,253,250,245,163,114,114,114,214,224, 29,151, 18,194,195,195,223,178,
+247,152, 48, 97, 66, 98,122,122, 58,251, 89,135, 64,113,244,177,228,148,218,114,137,208, 65, 42,173, 37,144, 43,100, 89, 89, 89,
+215,138, 59, 19,107,165, 78,195,134, 13,133, 91, 14, 92, 74, 28,254,205,130, 57,141,188,236,108, 26,184,217,203,157,109,133, 60,
+ 9, 73,168, 5, 38, 99,162, 66,161,240,174,106,186, 45,253,130, 72, 36, 2, 73,146,255, 36,141, 22,199, 66,178,178,179,179,113,
+228,200, 17,116,238,220,249,142,133,132,168, 84, 42,164,164,164, 64,169, 84,222, 41,214,124, 84,186,140,200, 48, 12, 12, 6, 3,
+ 12, 6, 67, 9,129, 41, 85,135, 74, 8,140,229, 89,138,162,238,191, 99,218,231,200,229,242,214,161,161,161,188, 93,123,246,240,
+ 88,150, 85,163, 40,134, 90, 1,203,150, 19, 32,251, 13, 49,153, 76, 37, 90, 54,154,166, 17, 31, 31, 95, 50,112, 89, 98, 75, 10,
+ 4, 2,235, 84, 25,124,254,196,221,187,119,219, 52,105,210,132,200,202,202, 2,195, 48, 37,157,228,111,191,253, 38,232,221,187,
+183,107, 84, 84,212, 52,157, 78, 55,251, 29,242, 74,148, 71,136, 0,192,198,198,198, 4,235, 60,102, 87,138,105, 50,153,136, 22,
+ 45, 90, 76,202,204,204,172, 95, 88, 88, 56,207,154, 98, 4,112, 56, 49, 49,177,244,192,254,103,116,116,116, 97,159, 62,125,132,
+181,106,213, 10,121,244,232,209,123, 85, 82, 31, 31,159,102, 52, 77,227,198,141, 27, 58, 0,150,153,245,133,123,247,238,233,122,
+245,234,197,119,119,119,111,150,155,107,181,201,138,143,175,175,239, 41, 71, 71, 71,161,165, 15,117,112,112,160,215,173, 91, 39,
+ 77, 74, 74,130,193, 96,192,148, 41, 83,208,165, 75, 23,216,219,219, 99,194,132, 9, 78,139, 22, 45,218, 94, 80, 80,208,176, 34,
+165, 53,143,199,219,250,252,249,115,111,165, 82, 41,188,126,253, 58, 26, 52,104,128,204,204, 76,164,166,166,162,160,160, 0,169,
+169,169, 24, 54,108,152,227,175,191,254,234, 98,133, 38,171,132,100,173, 91,183, 46,119,255,254,253,212,239,191,255, 46,165,105,
+186,132,104,113, 56,156, 18,162,101,137,173,248, 14, 43, 13,185,197,164, 77,150,151,151,247, 62,118,110,124, 0,188,210, 36,139,
+207,231,131,207,231, 67, 32, 16,188, 87, 92,214,127,137,184, 18, 4,241,136,203,229,242, 69, 34, 17,151, 36, 73,240,249,252, 14,
+ 10,133,226, 97, 64, 64, 64,192,169, 83,167, 98,173, 1,209,106,181, 91,249,124, 62,237,232,232, 8, 0,240,246,246, 70,131, 6,
+ 13,160, 86,171,153,188,188, 60,200,100, 50, 50, 46, 46, 14,133,133,133, 72, 73, 73,129,135,135, 7, 77,146,228, 86, 20,217, 33,
+191, 37, 87,239,164,174, 1,176,198,114,109,111,111,159, 86, 90,211, 41, 16, 8,224,234,234,138,164,164, 36, 72,165, 82,234,135,
+ 31,126,232,181,103,207,158,158, 87,175, 94, 13, 7,176,173, 20,212,236,127,177,141,150,133,100,149, 62,255,135,104,117,233,210,
+101, 86,100,100,228, 71,101,205,194,105,154,254, 96,182, 46, 22, 66,101, 99, 99,243,166,214, 10, 12,195,148,167,209,170,242,239,
+ 8, 4, 2,225,232,209,163,243, 87,175, 94, 93,101,178, 21,182, 50,186, 68,139,245,214, 52,210,207,239,234,180,105,211,186,159,
+ 59,119, 46,169,145, 87, 45,142, 56, 57,174, 64, 96, 35,147,193,173, 70,231,193, 61,122,221, 67,209,238, 67,107,229,121,126,126,
+190,176,182,155, 72, 79,146, 90,162, 6,159, 35, 85,138,185,124,103,185,220,149,171,215,165,219,200,229, 60,157, 78,151,139, 10,
+130, 64, 3,128,147,147,211, 9,161, 80,232, 97,185,150,203,229,182, 44,203, 66, 36, 18, 65,169, 84, 74, 40,138,122, 90,170,113,
+197,165,165,165,117,168, 44, 97, 50,153,236, 4,159,207,247, 32, 73, 18, 4, 65,128,162, 40,144, 36, 9,146, 36, 75,254, 79, 81,
+ 20, 8,130,128, 70,163,137,139,141,141,237, 96, 69,126, 77, 0,130, 9,130,184,115,228,200, 17,132,132,132,224,216,177, 99,232,
+216,177, 35,242,242,242,240,224,193, 3,180,110,221, 26, 40, 90, 82,180, 74, 74, 27,191, 91, 38, 5, 79,158, 60, 41, 33, 46,165,
+ 15,169, 84,250, 62, 42,246,203, 97, 97, 97, 88,191,126, 61, 91, 60,153, 16, 19, 4,209,192,214,214,246,201,227,199,143,173,178,
+131, 97, 89, 22, 6,195,127, 30,181, 12, 94,197,246, 16, 85, 10, 14, 76, 81, 84,135,134, 13, 27, 18,121,121,121, 22, 2, 9, 14,
+135, 3,138,162, 64, 81, 20, 86,173, 90, 37,108,210,164,201,116, 62,159, 63,137,203,229,170,140, 70,227, 46,173, 86, 59, 15, 64,
+238, 63,169, 71,106,213,170,213, 55, 9, 9, 9, 93, 60, 60, 60, 34,222, 3,134, 53, 26,141,122, 0, 66,138,162,232, 15,208, 71,
+ 81,197,117, 75, 91,138,236,155,138,175,249, 40, 90, 38,182, 74,236,237,237,183, 31, 61,122,212,205,195,195, 3, 70,163, 17, 38,
+147, 9, 5, 5, 5,184,112,225, 2,116, 58, 29, 76, 38, 19,188,189,189, 49,115,230, 76,237,248,241,227, 5,107,215,174, 77, 47,
+ 40, 40, 24, 80, 9,236,248,125,251,246,137,149, 74,165,176,176,176, 16, 47, 95,190, 68,195,134, 13,145,159,159, 15,181, 90, 13,
+141, 70, 3,131,193, 0,149, 74, 37, 51,155,205,250, 74,176,102,148, 38, 89, 35, 71,142,188,207,227,241, 26,142, 29, 59, 22,137,
+137,137, 37,109,126,248,240,225,112,114,114, 42,105, 75,197,125,114,149, 58,102, 14,135, 3, 62,159, 15, 46,151,155, 91,163, 70,
+ 13, 16, 4, 33,136,139,139,123,151,165, 56, 27, 0, 42,154,166,121,165, 9, 22,159,207,199,141, 27, 55,166,241,120,188,242,180,
+ 89,229,181, 75,182, 42,215,255,109, 33, 8, 98, 41,151,203,229, 43, 20, 10,110,169, 9, 39, 87, 34,145,192,209,209,113, 37,128,
+ 78, 86,230, 59, 72,161, 80,148,244,239,129,129,129, 72, 72, 72, 56,152,151,151, 55, 40, 61, 61, 29, 36, 73,110, 37, 73,178,167,
+101,146,154,147,147, 3,119,119,247,160,242,240,154, 7, 59,143, 2,193,190,166,209,122, 99,130, 6, 27, 27, 27,196,196,196, 64,
+173, 86,179,207,158, 61, 35, 70,143, 30, 77,232,245,250, 77, 81, 81, 81,215, 80,180,219,190, 92, 46,242, 47,145,170,219,104, 89,
+ 52, 90,214, 14, 0, 4, 65, 84, 58,155, 48, 26,141, 18,127,127,255,178, 12,190,136,178,136, 86,241,114,210, 59, 85,116,154,166,
+165,239, 74,182,222,148,136,253, 59,157,126,154, 57,101,166,194,165, 86,237, 73,147,102,112,186,118,237,122,125,203,150, 45,102,
+ 69,189, 78,237,206,158,216,230,180,236,219,201,199,142, 30, 61, 10, 20, 25, 70, 91, 43,151, 35, 35, 35,157, 39,140, 27,131,153,
+ 19,199, 31,183,241,182,231, 73, 8,133, 88,160, 83,103, 72,192, 22,242,235,248,118, 57, 16, 17,145, 2, 32,170, 34, 16,145, 72,
+228,241,232,209, 35,239,210, 27, 9,244,122, 61, 68, 34, 17,206,158, 61,235, 32, 20, 10, 29, 0,160,176,176, 16, 1, 1, 1,214,
+106, 76, 60,158, 62,125,234, 45,149, 74,161,209,104,160,211,233, 96, 52, 26,193, 48, 12, 8,130, 0, 77,211,224,241,120, 16,139,
+197, 85,221,217,119, 23,192,231,157, 59,119,222,113,236,216, 49,248,251,251, 35, 39, 39, 7,209,209,209, 22,146, 85, 37, 27, 45,
+139,150,168,180, 61, 22,135,195,193,118, 47, 47, 12, 79, 78, 46, 33, 48, 75,109,109, 49,147,121,183,104, 26, 1, 1, 1,236,229,
+203,151,113,252,248,113,116,235,214,141, 56,116,232,144,193,108, 54,115,147,147,147,239, 39, 39, 39, 91,133,193, 48, 76, 73, 90,
+ 45,253,118,105,130, 85, 85,162,101, 50,153,164, 60, 30, 15, 90,173, 22, 22,205, 67,233,195,211,211, 19,217,217,217, 28,149, 74,
+197, 73, 78, 78, 22,205,157, 59,119,236,249,243,231,149,249,249,249,253,255,155,189,208,234,213,171, 61,134, 15, 31, 30,207,225,
+112,216,142, 29, 59, 14,140,139,139,235,161, 84, 42,207,156, 59,119,238, 23, 0, 62, 85,197,179,183,183,191,205,225,112,220, 84,
+ 42, 21,119,239,222,189,198,252,252,124,174,131,131, 67,154,165,239,176,148,181,209,104,180,106,231,178,189,189,253,237,204,204,
+ 76,238,138, 21, 43,140, 89, 89, 89, 92, 39, 39,167, 52, 11, 78,110,110, 46,119,239,222,189, 70,149, 74,197,181,181,181,189,157,
+151,151, 87, 41, 94,102,102,230,128,240,240,240, 75,103,206,156,177,167, 40, 10,113,113,113,200,202,202,130, 76, 38,195,214,173,
+ 91,225,225,225,129,125,251,246,101,103,103,103,127,241,243,207, 63, 79, 47, 38, 89,149,217,104,181, 14, 9, 9,241,200,205,205,
+133, 76, 38,131, 90,173,198,237,219,183,225,231,231,135,228,228,100,144, 36, 9,153, 76,134,223,126,251, 77, 67, 16, 68,118, 69,
+ 64, 66,161,176,199,136, 17, 35,100, 0, 48, 98,196, 8,217,136, 17, 35,202, 28,224,154, 53,107,134,149, 43, 87,190, 73,180,170,
+ 50, 49, 40,209, 58,149, 34, 71,218,166, 77,155,226,252,249,243,147,171, 72,142,244, 22,210,246,166, 54,139,207,231, 87,121, 51,
+ 13,195, 48, 92, 20,153, 52, 16,214, 92,255, 3,228, 35,161, 80,200,125,243,166, 70,163,225, 42,149,202, 86, 85, 32,190,118, 66,
+ 97,145,194,201,195,195, 3,121,121,121,102,189, 94,223,247,255,218,187,206,240, 38,174,180,123,102, 70,189, 88,238, 21, 3, 6,
+ 2,152, 14,166, 99, 58, 14, 16, 32, 75, 18,218, 38,212,133,152, 16,216, 44, 36, 11, 36, 31,201,134, 56,148, 64, 96, 33,129, 16,
+240, 66, 48, 16, 72, 66, 11, 29, 66, 89,140, 9, 53, 54, 4, 55,108, 76,115, 47,178, 44,217,146,101,149, 25,205,247,195,146, 34,
+ 27, 23,201,150, 41, 89,157,231,153,199, 26,207,232,232,206,157, 91,206,125,239,123,223,187,103,207, 30, 35, 0,132,133,133, 77,
+ 97, 24,166,130,166,105,138,207,231, 67,163,209,192,207,207,207,187, 14,219,232,210,163, 63,172, 8,168,238,163, 21, 24, 24,136,
+176,176, 48,232,116, 58,228,229,229, 33, 54, 54,214,200, 48,204,222,111,191,253,214,228,235,235,251,183, 9, 19, 38, 80,241,241,
+241, 11, 0, 44,170, 77,139,188, 96,214,172,232, 90,133,150, 89, 65, 94, 4, 48,180,250, 67, 86, 23, 63,117, 9,173,250,166, 14,
+249,124,190, 50, 51, 51, 83, 98,219,169,208, 52,141,160,160, 32, 19,203,178, 68, 77, 66,171, 49,166, 96, 46,151,235,246,209, 71,
+ 31, 41,191,253,246,219,169, 15, 31, 62, 92,110,207,119,246, 47,232,128, 93,213, 68,214,214, 53, 81,155, 55,173, 89,225,149,113,
+122, 39,182,127,189,142, 97, 24,196,119,237,218,117,144, 90,173,230,184, 75,140,144, 43,113,202, 44,178,236, 21,133, 36,128,239,
+110,220,184, 17, 63,102,204,152, 95,191,251,241,144, 87,238,253,251, 87, 5,165,242, 60, 89,219,118, 28, 94,179,150,175,151, 85,
+ 84,240,166, 76,153,226, 11, 96, 66,125,141,152, 82,169, 68,126,126,126,117, 1,134,187,119,239, 62,113,175, 93,137, 35, 73, 48,
+ 12,131,131, 7, 15, 66, 44, 22, 67, 34,145, 84, 57, 44, 34,171,129, 11, 21,210, 0, 96,244,232,209, 80, 40, 20,144, 74,165,118,
+167,171,186,120, 97, 89, 22,122,189, 30,122,189, 30, 6,131,129, 1,192,229,112, 56,152,157,157,109,181,242, 56, 34, 96,170,163,
+107,215,174,236,149, 43, 87,240,235,175,191, 66,163,209, 96,211,166, 77, 8, 12, 12, 28, 14,224, 19, 71,185,108,156,244,153,210,
+210, 82,110,105,105,169,213, 58,200,229,114,173,214, 3, 59, 45,121, 60, 14,135, 99, 29,141, 90, 14, 91,171, 22, 69, 81,240,247,
+247, 71, 64, 64, 0,182,110,221,202,107,213,170,213,184,103,217, 2,173, 93,187,182,237,198,141, 27,119,236,218,181,235,212,212,
+169, 83,127, 74, 76, 76,156,229,238,238,126,231,194,133, 11, 43, 4, 2,129,169,129,245, 59, 56, 55, 55,215,207,246, 95, 38,147,
+ 73, 76,211,180, 85,216,150,151,151,219, 61,192,224,114,185,193,201,201,201, 98, 0, 88,177, 98, 5, 23,128,216,226, 12,110,225,
+ 44, 47, 47,231,118,234,212, 41,216,222,178, 30, 23, 23, 55, 40, 34, 34,226,202,217,179,103, 61, 91,182,108,137,156,156, 28,228,
+228,228,160,109,219,182, 88,181,106,149,166,180,180, 52, 28, 64,154, 90,173, 62, 98, 39,103,144,167,167, 39, 55, 51, 51, 19, 52,
+ 77,163, 71,143, 30,216,178,101, 11,166, 76,153,130, 46, 93,186,160,180,180, 20,201,201,201,136,137,137,241,228,241,120,117,182,
+ 29, 90,173,246, 72,116,116,116,243,234, 22,173,105,211,166, 73, 10, 10, 10,172,101, 50, 42, 42,170,202, 20,162, 35,109,178,121,
+106,171,214,163, 33,160,105, 90, 38, 20, 10, 75, 5, 2, 1,223,226,159, 21, 27, 27,235,176, 53,171,218, 0,208,145,243,103, 6,
+139,104,173,161,111, 69, 64, 64,128,221, 60, 2,129,128,176,180,141, 52, 77, 67,165, 82, 49,129,129,129,214,233,253,132,132, 4,
+ 38, 36, 36,132,161, 40,138,226,243,249, 32, 8, 2, 98,177,184,214, 6,159,101,216,168, 87,167,124, 82,101,213,225,194,143, 0,
+131,193,128,132,132, 4, 24, 12, 6,196,198,198, 26,191,252,242,203, 92,165, 82,185, 16, 0,231,204,153, 51, 51,150, 44, 89, 66,
+249,249,249, 69, 20, 22, 22,162, 62, 45,242, 2,137,173, 39,172, 92,150, 94,232,226,184,113,227, 8,243,210, 74,194, 34,156, 28,
+ 17, 90,230,202, 87,111,207, 75, 16, 4,242,242,242,172,231,126,126,126, 14,255,150,189,240,246,246,214,244,239,223,223, 77, 46,
+151, 31, 89,187,118,109,131, 44, 89, 91,215, 68,109, 94,253,249,167, 94,138,148,107,200,206,205,131,162,208, 24,127,249,206,195,
+195, 0, 14, 3, 0,182,117,188, 72,188,147,250,141,189,156, 29,124, 68,221,185, 60,206,225,151,199,140,107, 62, 57,114, 17,249,
+238,187,239, 14,156, 49, 99,134,106,234,212,169,239, 73,165,210,246, 6,131,161,228,208,137, 19,143, 38, 79,158,220,138, 97,152,
+ 25,168, 39,230,136, 86,171,125, 60,116,232, 80,219,252,148,157, 59,119,206,255,209,163, 71,152, 63,127,126, 81, 78, 78,142,210,
+246, 94,123,210,104, 48, 24, 30,119,239,222,189,214,233, 66,203,148, 34, 0,148,149,149, 61,118, 32, 75,223,132,217,241,189,184,
+184, 24,119,239,222, 5,135,195, 65,191,126,253,112,249,242,101, 12, 28, 56, 48,193, 17,171, 86, 69, 69, 5, 90,182,108,137,138,
+138, 10,104, 52,154,114, 0,130,221,173, 90, 1, 0, 22, 20, 23,227,183, 47,191,196,181,213,171, 97, 91,158,237, 69,183,110,221,
+216,107,215,174,225,206,157, 59,208,233,116,152, 51,103, 14, 0, 16,230,178,235, 72,200,140, 54, 20, 69,141, 30, 51,102, 76, 16,
+ 0,104, 52, 26,226,198,141, 27, 16, 10,133,214,186,112,236,216, 49,228,228,228,128, 32, 8,120,122,122, 6,151,148,148,180, 2,
+240,176, 14,179, 63,241,240,225, 67,124,241,197, 23, 48,153, 76, 88,178,100, 9,218,181,107,103, 21, 88,143, 31, 63,198,138, 21,
+ 43,192, 48, 12, 62,253,244, 83,180,109,219, 22, 70,163, 81,136, 6,134,208,112, 6,222,127,255,253,140,195,135, 15,159,202,202,
+202,122,101,205,154, 53, 67, 8,130, 48, 45, 94,188,248, 11,153, 76,198, 52,134,183, 68, 85,134,187,247, 30, 91,133, 80,245,195,
+215,199,203, 97,190,244,251, 89,214,239, 51,140, 45, 31, 3,111, 47, 79, 71,147, 88,110, 52, 26, 53,175,191,254,186,199,193,131,
+ 7,137,182,109,219,226,193,131, 7, 22,203, 80, 57, 28, 15,233,144,163, 80, 40,218, 81, 20,197,187,119,239, 30, 66, 66, 66,208,
+183,111, 95,172, 92,185, 18,114,185, 28, 52, 77,195,207,207,207,100, 52, 26, 19, 12, 6,195,165,122,184,162,230,206,157,203, 3,
+240,142,217,178,213,117,225,194,133,166,117,235,214, 33, 33, 33,193,106,193,178,117,134,119,116,234,208,214,234,100,123,196,198,
+198, 46,225,243,249, 44,128,235,112, 60,208,179,190,186, 69,171, 33,214,172,166, 66, 83,174,100, 12, 12, 12,140,117,115,115, 27,
+ 87, 82, 82, 82,197,170, 21, 30, 30,110,240,247,247,143,179,151, 71, 42,149,150, 80, 20,229, 13, 0, 57, 57, 57,144, 72, 36,188,
+251,247,239,175, 70,101,240,108,180,106,213,106,181, 66,161,224,181, 50,183,167, 1, 1, 1,208,235,245,181,186,177, 92,189, 85,
+176, 19,192, 78,203,185,151,151, 87,158, 74,165, 18,173, 91,183, 78,189,122,245,106, 45,195, 48, 58, 0, 23,148, 74,165, 53,142,
+ 86,126,126,190,138,203,229,122,121,120,120, 52,179, 8,173,154,180,200, 11,134,218, 45, 90,102, 37,201, 86, 23, 68, 4, 65, 60,
+225,160, 94,143,208,170, 87,100, 49, 12, 83,197,202, 96,113,120,175,233,183,204,157,122,131,166, 14,205, 34, 75,120,232,208,161,
+221,107,215,174,189,110,239,247,108,125,180,182,173,255,124,141, 69,100,253,254,235, 89, 28, 73, 85,201,151,172,222,176,177,161,
+111,160,163,143,184,155,191,191,247,197, 47, 87, 69,201, 50, 78,199,224,167,109,255,102,127,191,121,179,207,205,155, 55,167,207,
+159, 63,191,133,185, 96, 41, 0,220, 6, 48, 25,118,172,210,201,201,201, 25, 85,173, 19, 78,227,241,120,254, 98,177, 24, 57, 57,
+ 57,234,244,244,116,135,167,100,228,114,249,168, 38, 40,128, 28,139,200,146,203,229, 72, 78, 78,198,176, 97,195, 0, 0,151, 47,
+ 95, 70,120,120, 56,226,227,227,209,179,103,207, 4, 0,189, 81, 79,160, 86,163,209,168,236,216,177,163,213,186,165, 82,169, 76,
+ 0, 16,153,151,135,232,192, 64,112, 56, 28, 92, 91,189, 26,203,140, 70,172,116, 80,192,119,239,222,157,189,113,227, 6, 30, 61,
+122, 4,154,166, 49,126,252,120, 52,176,210,119,233,208,161,195,185, 11, 23, 46,248, 74,165, 82,104, 52, 26,168,213,106,204,156,
+ 57, 19, 83,166, 76,129, 78,167,195,254,253,251,113,244,232, 81,184,185,185, 65,163,209, 64,163,209,120,142, 29, 59,246, 74, 90,
+ 90,218, 96, 0,247,106, 17, 90,236,168, 81,163, 16, 23, 23, 7,138,162,208,167, 79, 31, 20, 23,255,177, 24,200,223,223,191,166,
+107,212,179, 20, 90, 28, 14,135,141,141,141, 93, 51,100,200, 16,100,101,101,189,210,179,103,207, 77,179,102,205,202,105, 44,175,
+167,187, 27,186,119,106, 3,157, 78, 7,157, 78,135,160,160, 32,148,149,149, 33, 35, 35, 3, 58,157, 14,254,126, 30, 14,243,133,
+117,105,107,229,243,243,243,131, 70,163,193,195,135, 15,161,215,235,225,227,227,144,208,106, 62,106,212,168,255,238,221,187,215,
+ 59, 38, 38, 70, 63,116,232, 80,254,166, 77,155, 8,153, 76, 6,155,142,197, 81,196, 94,190,124,185,101, 68, 68, 68,104, 74, 74,
+ 10, 98, 99, 99,161,215,235, 17, 22, 22,134,244,244,116,244,239,223, 31,106,181,250,250,205,155, 55,143,218, 99, 24, 6,240,241,
+220,185,115, 97, 17, 91,113,113,113,200,203,203,131,155,155,219, 19, 66,203,226,251,104, 94, 53, 30,100, 79, 98, 45,130,200,198,
+242,180,204,195,195,195, 0, 96, 99, 3,173, 79, 0,128,172,172, 44, 65,215,174, 93,117, 66,161,144,111, 22,109, 27, 26,195,231,
+ 76, 56, 97, 37, 99,173, 8, 8, 8, 88,232,227,227, 19,209,186,117,107, 20, 20, 20,240,248,124, 62,194,195,195, 13,189,123,247,
+ 54, 4, 4, 4, 44,176,151, 71, 32, 16,164,240,120,188,193,149,131, 9, 6,153,153,153, 96, 89,118, 73,151, 46, 93,254, 81, 86,
+ 86,134,226,226, 98,190, 76, 38,179, 14,170, 67, 67, 67,161,211,233, 82, 28,176,188, 69,133,132,132,124,204,227,241, 86,202,229,
+242,154,194, 66,240, 61, 60, 60,100, 60, 30, 15, 6,131,161,138,216,172,174, 69, 94,116,145, 85, 69,104,217,168,200, 42, 66,199,
+ 17,139,150, 61, 86, 3,139,131,189,237,185, 69,212, 85,255,173,134,198,208,114,119,119,215, 89, 68,214,202,149, 43,175, 55,132,
+227,192,222, 61,129,238,166,242,230,185,215, 79, 34,237, 78, 60, 14, 39, 43,229, 75, 86,111,120,239,213, 9,111, 22, 84, 23,102,
+246,160,157,175,184,139,191,159,247,197,245,107, 87,203, 20, 41,215,144,151,159,143,147,215,111,198, 27,128,100, 0, 75,156,105,
+ 90, 6, 42,167, 14, 41,138,122,158, 10,172,213, 25, 62, 47, 47,207, 34,178,194, 0, 96,224,192,129, 9,102,145, 5,123, 45, 90,
+ 74,165,178,250,150, 53, 17, 0,124, 44,207,207,225,112, 16,254,241,199, 14,139, 44, 0,108,124,124, 60, 20, 10,133,101,164,216,
+ 80,145,133,128,128,128,127, 94,184,112,193,247,187,239,190, 43,221,181,107, 87,177,201,100,226,118,239,222, 61,184, 87,175, 94,
+196,238,221,187, 1, 0,147, 39, 79,198,146, 37, 75,144,148,148, 4,137, 68,130,129, 3, 7, 50,203,151, 47,247, 91,184,112,225,
+130,130,130,130,247,106,236, 29, 77, 38,158, 80, 40, 60, 15, 96,120, 74, 74, 10, 0, 92, 65,229, 22, 78, 22, 43, 66,173,215,236,
+233,124,203,202,202,184,110,110,110, 53,134,134,224, 85,142,134, 28,181, 64, 88, 57,127,253,245,215, 47,214,175, 95,127,248,131,
+ 15, 62,184,215, 72,206, 26, 45, 90,227,198,141,131, 86,103, 64,118,129, 10, 12, 67, 67,107, 40,116,152,207,214,162, 53,110,220,
+ 56,148, 87,232,145,153,167, 0, 77, 51, 40,211,218,221,151,139, 95,126,249,229, 51, 63,252,240, 67,192,213,171, 87,193, 48,140,
+ 41, 61, 61,253,225,235,175,191, 46, 91,188,120,177,119, 35, 22, 25,125,253,230,155,111, 78,252,245,215, 95, 21,161,161,161, 94,
+215,175, 95, 71, 97, 97, 33,104,154,198,240,225,195,193,231,243, 51, 87,175, 94,205, 3,240,181,189,239,198, 44,182, 12, 55,111,
+222,124,251,218,181,107, 94, 94, 94, 94,124, 83,135, 14,200, 59,123, 22, 7, 15, 30,124,226, 11,219,182,109, 3,236,140,194,111,
+177, 56,221,184,113,195, 41, 2,171, 74, 79,205,231, 55,120,250,241, 69,197,141, 27, 55,114,222,125,247,221, 78, 50,153,108,227,
+160, 65,131,134,121,123,123,147,158,158,158,177,205,154, 53,251, 71,247,238,221,237,158, 93,224,114,185,179, 36, 18, 73, 6, 77,
+211,148, 90,173,134, 70,163,169,108,164,105,154, 79,146, 36, 90,181,106,101,237, 75,250,244,233,131,128,128, 0, 38, 53, 53,117,
+150,189,252, 69, 69, 69, 85, 86, 33,214,128,185,225,225,225, 28,157, 78,135, 71,143, 30, 93,182,189, 80,147, 22,121, 65, 16, 89,
+167,248,178, 60,148,237,195, 53,107,214, 44,203,104, 52,178,201, 0,123,251,246,109, 54, 50, 50,178,206,163,162,162,130,245,243,
+243,203,171,161,243,131, 45,167, 78,167,171,242, 61,157, 78,199,250,251,251, 51, 90,173,246, 9, 78,173, 86,203, 6, 7, 7,231,
+212,197, 89, 3,102,222,186,117,235,219,101,203,150,245,117, 32,131,172,156,236,214, 14,108, 76, 76,204, 95, 89,150, 29, 50,168,
+ 83,203, 59,147,186,251,179,225,237,252,114,143, 30,216, 59,133,101,217, 33,213, 15, 75,128,211,186, 56, 59,248, 75, 58,142,232,
+220,162,228,247,211,251,216, 11,235,254,206,174, 31,223,142,237, 25,236,166,236,224, 35,114,116,143,152,122,119, 75,239,220,185,
+115,154,201,100, 98,245,122, 61,219,185,115,231,116,103,112, 54, 0,117,113,246, 64,165, 47,219,155, 53,252,175, 71, 35,210,249,
+ 59,203,178,172, 66,161, 96,213,106, 53,171,211,233, 88,134, 97, 88, 91, 0,248,221, 14, 78,214, 96, 48,176, 37, 37, 37, 44,236,
+247,185,171,145, 51, 48, 48,240,225,253,251,247,217,151, 94,122, 41,203,108,142, 95,168,209,104,216,234,208,104, 52,236,176, 97,
+195,216,244,244,116, 54, 36, 36,164, 34, 61, 61,157, 13, 12, 12,188, 91, 79, 58, 91, 55,111,222,252,188,143,143, 79, 44,128,118,
+ 14, 92,171, 51, 63,247,239,223,223,134,101,217, 57, 44,203, 70,214,114,204,119,133,129,130, 0, 0, 32, 0, 73, 68, 65, 84, 97,
+ 89,182,195,179,230, 52,231,111, 1,203,178,108,121,121, 57,171, 80, 40,216,220,220, 92,182,188,188,156, 85,171,213,236,173, 91,
+183,216,171, 87,175,178,119,238,220, 97,189,188,188, 10,236,225,180,240,233,245,122,182,180,180,148, 45, 44, 44,100,181, 90, 45,
+171,209,104,216,196,196, 68,246,183,223,126, 99, 83, 82, 82,106,226,123,130,211,219,219,123, 91,126,126,190,250,202,149, 43,229,
+ 91,183,110, 45, 15, 8, 8, 72, 1,208, 18, 64,123, 79, 79,207,252,191,255,253,239,172, 84, 42,125,220,192,122,212,137,203,229,
+222, 90,179,102,205,141,227,199,143, 23, 28, 61,122, 84,191, 99,199,142,236,249,243,231, 95,226,112, 56,183, 0,116,106, 96, 61,
+242,243,240,240,184,114,253,250,117,186,164,164,132, 85, 42,149,108,105,105, 41,171,209,104, 88,173, 86,203,234,245,122,214,104,
+ 52,178,151, 46, 93, 98,253,253,253,109,167, 37,151,214, 49,176, 94,196,178,236, 63, 89,150,229, 56,187,173,179,225, 30,228, 44,
+ 78,103,180,117, 36, 73, 26,204,109, 71,191,202,211,186,207,159, 85, 58, 71,140, 24,241,233,148, 41, 83,216,209,163, 71,179, 97,
+ 97, 97, 79, 28, 61,123,246,100,231,205,155,199, 30, 63,126,156,253,242,203, 47, 63,117, 66, 58, 57,168, 92,244,178,106,196,136,
+ 17,198,184,184, 56,118,242,228,201, 44,128, 81,117,105,145, 63,131,224,178,132,119, 32,108,255, 2,128,193, 96,200, 74, 75, 75,
+ 11, 12,165,105, 10, 0,190,249,230,155, 39, 44, 83,182,136,139,139,163, 9,130,200,168,235,215, 13, 6, 67,214,133, 11, 23,252,
+ 55,111,222,204,181, 49, 1,131,166,105, 83,110,110, 46,185,105,211,166, 42,247, 95,188,120,145,166,105, 58,211,193,135,140,233,
+209,163, 71,140, 51,114,235, 82,210,163,127,156, 57,249,179, 79,191,190,131,148, 50, 47,175, 26, 71, 97,251, 23,116, 0,241, 78,
+221, 86, 45,130, 67,174, 92,179, 42,202,195, 50, 5,249, 99, 66,190,178, 66,199, 12, 75,149,107,127,119,246, 27, 86,171,213,143,
+ 44, 43, 1, 53, 26, 77,230,115, 88, 8,111,161, 50,198, 21, 93,237,127,189,209, 72,167, 83,147,201, 4,119,119,119,171, 53,180,
+ 1, 22, 81,214, 98, 97,181,188,186,198,164,135,101,217, 95, 19, 19, 19, 67,102,206,156,233,182,107,215,174,251, 12,195,112,103,
+207,158,109, 8, 8, 8,224, 93,190,124,217, 8,128, 24, 50,100, 8, 39, 63, 63,159,205,201,201, 81,252,229, 47,127, 41,123,251,
+237,183,189,111,223,190,205, 55,153, 76,245, 5, 45,124,144,149,149, 53,162, 1,215,234,196,164, 73,147,238,163,241,219,216, 52,
+ 57,167, 5, 10,101, 41,238, 63,202, 49, 71, 48, 55,129,121, 92, 96,245,171, 50, 26,105, 40, 74,139, 29,182,104,101, 60,204, 49,
+111, 49,198,128, 97,114,205,124,149, 14,241,108, 73,121,253,189, 9,135, 51,112,249,242,229, 99, 72,146, 36,175, 93,187,166, 91,
+187,118,109, 86, 81, 81,209,120, 0,153, 0, 80, 82, 82, 50, 52, 38, 38,230,123, 59, 66, 57,212,134,100,163,209,216,127,233,210,
+165,239, 1, 24, 8,160,133,153,251,178,217,146,213,208, 8,230,133, 74,165,114,228,152, 49, 99,206, 82, 20,213,202,166, 30,249,
+ 0,144, 91,234, 5,203,178,126, 5, 5, 5,175,216, 67, 72, 16,196,134,166,106, 72,154,146,187,145,237,208, 11,177,146,241,252,
+249,243,159,141, 31, 63,158,211,178,101,203,255,107,217,178, 37, 89, 82, 82, 2,181, 90, 13,146, 36, 17, 16, 16,128,206,157, 59,
+ 35, 32, 32,192,148,146,146,178,234,195, 15, 63,172, 55, 38, 95,199,142, 29,219, 24,141,198,151, 72,146,108, 3,160, 13,203,178,
+109, 8,130,104, 3,192, 11, 0,100, 50,153, 44, 36, 36,132,211,175, 95, 63,244,237,219, 23, 23, 47, 94,196,129, 3, 7,118, 2,
+ 56, 99,107,205,170,174, 69,158, 7, 36,247, 0,219,233, 22,136,164,158, 24, 66,152,112,145, 37, 49,180,115,188, 53,206, 94,117,
+145, 85,251,166,210, 53,152,254, 70, 13, 31, 62,220, 90,225,236,232, 84, 30,213, 87,249,138,138,138, 70,205,154, 53,171, 10, 39,
+195, 48,186,226,226,226,119, 7, 12, 24,176,133,162, 40, 65,181, 2,251,184,176,176,240,169,238,213, 87, 61,142,214,168, 49,175,
+201, 27,203, 41,229,145, 47,165,157,248, 15, 10, 10,229,248, 49, 33,191,164, 76,207, 12, 77,151,151, 39, 54, 69,250, 31, 63,126,
+ 60,250, 5, 80,252, 53,137,214,198,110,158, 93,100, 71, 64,210,250,246,168, 35,204,225, 68,156, 82,201,243,243,243,215,125,252,
+241,199, 35, 87,173, 90,229,123,234,212, 41,153,101,128,242,198, 27,111, 20, 38, 38, 38, 14, 2, 32,168,168,168, 56,183,106,213,
+ 42,223,168,168, 40,111, 0,222, 0, 48,118,236,216,130,130,130,130,205,112,161, 78, 24,141,198,236,206, 29, 67,173, 3, 63,219,
+144, 14,182,159,105,154,206,118,132,175, 38, 30,219,115,134, 97,234,228,163, 40,234,131,190,125,251, 82, 31,124,240, 65,193,169,
+ 83,167, 44, 27,233,218, 42,180,180,122,130,146,218, 3, 29,128,181,230,195,153,208, 40, 20,138,254, 14,126,135,113,149,198, 26,
+ 7,148,142,156, 63, 19, 28, 57,114,228,147,201,147, 39,199,120,121,121,237,105,211,166, 77,168,191,191,191, 76, 36, 18, 65,167,
+211,149,233,245,250,187,105,105,105, 83, 63,249,228,147, 7,118, 89, 56, 98, 98, 40, 0, 60,147,201, 36, 36, 73, 82, 2, 64, 70,
+ 16,132,167, 69,104, 17, 4, 1,131,193,128, 71,143, 30, 97,217,178,101,204,249,243,231,191, 4,240,169, 3, 3,215,222, 0,124,
+109,218,113, 95, 0,122, 84, 6,176, 45, 34, 8,226,102, 83,231, 23, 97,194,197, 78,183, 64, 36,247, 64, 77,253, 68,221,155, 74,
+215, 86,225,138,138,138,250, 59,187, 18,215,198, 89, 84, 84,212,242,121,169, 33, 51,116,107,247, 97,219,218, 42,251, 28, 90, 68,
+ 88, 77,231,245, 65,165,165,231,127,125, 38,105,157,142,102, 77, 6,218,244,183,244,162,242,100, 87, 59,228,116,188,236,172,186,
+228,196, 52, 37,166,166,166, 14,152, 63,127,254, 39, 98,177,184, 15, 0,148,151,151, 95,203,205,205,253, 28,230, 85,133,245, 93,
+119,161,118,200,229,242, 94,207, 35,159, 94,175,255,199,128, 1, 3,190, 98, 24,102, 61, 77,211,151,255, 7, 94, 69,133,171, 52,
+190,184,248,233,167,159, 30, 0,232, 15, 0, 19, 39, 78,164, 0,224,192,129, 3, 14,139,231,153, 51,103, 50, 44,203, 26,204,229,
+ 65,131,202,213,133, 37,150, 54, 85,163,209,148,228,230,230,166, 48, 12,147, 2,224,123, 56,190,226,214,151, 32,136,227, 44,203,
+142, 51, 11,183,227, 44,203,142,179,253, 95, 83, 91,181,234,185,165,126,103,120, 23, 42,113, 32, 25, 68,245,169,192,250,206,235,
+ 67, 90,129, 38, 22, 64, 79, 87,238,254, 79,226,126,110,110,238,140, 70, 92,119,225,197, 67,166, 94,175, 31,255, 63,244,188, 42,
+215, 43,255,147,244,127, 13, 16, 88, 22,164,164,164, 52,153,139,192,179, 70,167, 91, 85, 7,224,213,207,109, 16, 89,147,240,114,
+ 9, 45, 23, 92,112,193, 5, 23, 26, 3,165, 43, 11, 92,248, 51,195,226,155,101, 57,175,197, 71,171,186,127,150,245,156, 64,237,
+ 43, 7, 28,217,149,188, 33,171, 36,206,185, 56, 93,156, 46, 78, 23,167,139,243,153,115,122, 0, 8, 1,176,166,158,251,170,175,
+ 46, 44, 0, 32, 7, 96,116,229,167,139,179, 17,250,193, 46,176, 44, 59,182,174,169, 67,130, 32, 78, 52,149,208,178, 58,195,247,
+192,242,206,183,176,220,114,110,175,208,106,106, 68,184, 56, 93,156, 46, 78, 23,167,139,211,197,233,226,116,113, 54, 82,104, 13,
+251,240,195, 15, 63, 66,101,104, 12,246,195, 15, 63,252,136,101,217,177,149,151,216,177, 77,249,219, 73, 61, 49, 36,185, 7, 88,
+203,145,212, 19, 67,106,185, 53,210,230,176,194, 53,117,232,130, 11, 46,184,224,130, 11, 46, 60,239,184,178,122,245,234,242,213,
+171, 87, 91, 28,223,139, 0, 16,102, 11, 87, 81, 83,254,176,121,154,208,158,133, 82,117,111,193,243, 12, 16, 68,114,120,211,184,
+ 60,193, 48,176,166,206, 0, 0,146, 74, 98,244, 21,255,165,105,195, 30, 0,185, 13, 37,238, 0,116,108,235, 33, 58,170, 99, 24,
+ 94, 86,153,126, 98,106,229, 54, 7, 14, 99, 34, 16, 46,224,243,127, 17,120,120,136,106,186,174, 83, 42,181, 58,189,126,228, 1,
+224, 87, 87, 29,112,193, 5, 23, 92,112,225, 5,129,196,211,211,243, 60, 73,146, 45, 45,255,176,141, 59, 88, 61, 6, 33,195, 48,
+121, 10,133, 98, 36, 42,167,138,159, 38,167,237,247,245,104, 96, 95,238,108, 56, 58,117,200, 1,170, 68, 97,125, 42, 59,102, 83,
+ 92,193,219,110,238, 30, 43,255, 58,235, 31,222,237,218,135, 18,205,155, 55, 3, 88, 32, 51, 43,219, 63,227, 94,250,136,159,118,
+125,253,126,169, 74,177,204,168,211,253,199, 81,238,142,128,164,133, 84,112,249, 63, 31,190,229,193, 1,141, 55, 87,236, 61, 77,
+168, 13,205, 83, 42,151,155, 58, 36,178, 60,188,189,207,172, 62,119, 78,228,217,173, 91,149,107, 44,203, 86,238,175,247,251,239,
+162,255, 27, 57,242,204, 68,133, 98,148, 75,108,253, 41, 17, 32,147,201, 22,114,185,220,161, 6,131,161, 37,159,207,207, 98, 24,
+ 38,182,164,164,100, 35,128, 28, 87,246,252,185, 17, 26, 32, 25, 20,218,166,229,222,220,252,130,132,210, 10,253,236,180, 92,181,
+194,149, 43, 14,163,174,253, 53,159,217,222,155, 0, 32,149, 74,127, 35, 73, 50,216, 86, 4, 88,246,236,181,156, 87,255,107, 50,
+153, 30, 40, 20,138, 1,117,208,182,241,242,242,218, 2,160,119,125, 1,147,205,177,217,110, 42, 20,138,119, 81,251,106, 61, 55,
+ 79, 79,207,207, 8,130,152, 68,146, 36, 85,223, 51,153, 76, 38,134,101,217,253, 37, 37, 37,159, 2, 40,171,237, 62, 79, 79,207,
+115,169,169,169,189,253,252,252,234,181,210,208, 52,141,204,204, 76,223, 62,125,250, 92, 82, 40, 20, 29,154,146,243,105,107,145,
+134,162,142, 85,135,181, 22,116, 0, 85,246, 23,106,210,136,172, 60,161,244,104,255,193,163,134,205,123,239, 3,201,173,196,187,
+248,229,226, 85,148,106,116,160, 72, 18, 30,110, 98,180,111,255, 18,177, 33,250,160,207,206,173, 27,214, 95,139, 59, 59,182, 66,
+163,250,139, 67, 50, 93,204, 89,182,228,245, 62, 18,111, 47, 6, 48, 49,248,231,152,238,146,255, 59,158,176, 12,229,244, 71, 14,
+139,172,243,231,197,133, 5, 5,136, 10, 10, 2,135,166, 33, 36, 73, 8, 9, 2, 66,146,132, 68, 40,196,232, 29, 59,240,249,169,
+ 83,226, 79, 94,121,197, 37,182,254,100,144, 74,165,179,130,130,130,214,110,223,190,221,187,117,235,214,144, 72, 36, 80, 40, 20,
+ 62,105,105,105, 61, 22, 45, 90, 52, 35, 47, 47,239,227,210,210,210,109,174,156,250,243,194,100,194,180,239, 86,190,219, 44,239,
+241,189,102,115, 87,237,107, 79,120, 51, 67,239, 22,107,243, 93, 57, 99, 55,122, 0, 72, 64,205,251,151,214,117,173, 86, 8,133,
+194,130,138,138, 10,191,186,238,225,243,249,133,122,189,222,191, 62, 46,146, 36,131,115,114,114,252,196, 98, 49, 24,134, 49,239,
+ 6, 96,178, 14,164,109,119, 63, 49, 7,170, 69,135, 14, 29, 12,117,113,186,185,185,125, 83, 88, 88, 24, 97,217, 39,208, 70, 80,
+213,136,156,156,156,136, 78,157, 58,125, 83, 86, 86, 54,178, 22,241,242,217,123,239,189,183,176, 75,151, 46, 22, 43,144,121, 23,
+132,202,191,114,185, 28,243,231,207,183,254,134,201,100,194,217,179,103,223,155, 53,107, 22, 74, 74, 74, 22,213,241,236, 45,253,
+252,252, 8,243,134,226,181, 98,249,242,229, 88,190,124, 57,190,254,250,107,130,203,229,122,212,147,159, 78,225,124, 90, 90,164,
+ 33, 22,172,122, 34,195,159, 64, 85,223,172, 19, 79, 8,173,167, 1,138, 43,248, 91,239, 1, 17, 67,231, 47, 92, 34,217,247,243,
+ 5,164,165,252,142,212,203, 63, 84,185,167,215,200, 89,200,151,151, 97,214,188,127, 74, 9,138, 51, 52,238,220,145,191, 25,117,
+218,239,236,180,102,249,183, 20,240,255,222,175, 79,103,110,142, 40, 13, 1,158, 34, 12,236,217,150,219,252,204,157,191,107, 64,
+127,149, 82,185, 74,198, 33,145,181,253,173,183, 48,200,104,132, 31, 69,129, 34, 8, 80, 0, 72,130, 64,133, 78,135,155,211,166,
+161,207,238,221,248,244,216, 49,241,103,175,190,234,144,216,146, 72, 36,183, 8,130,240, 84,171,213, 99, 81,185,177,244,139,128,
+ 78, 82,169,244, 4,203,178, 37, 26,141,166,199,115,148,174, 64, 84,206,209, 87, 31, 29,243, 80,185,162,202,161,157,133, 5, 2,
+193,219, 19, 39, 78,220,176,121,243,102,113, 65, 65, 1,114,115,115,193, 48, 12,132, 66, 33,218,181,107, 71,156, 59,119,206,123,
+201,146, 37,235, 78,156, 56, 33, 40, 43, 43,251,202,145,129, 13,151,203,141,246,242,242,122,197,223,223, 95, 82, 88, 88, 88,174,
+ 84, 42,207,234,116,186,183,209,240,109, 83, 72, 46,151, 59, 53, 36, 36,228,181,160,160, 32,255,156,156, 28,121,118,118,246, 81,
+157, 78,183, 19, 13,220,168,217, 38, 79,187,193, 28,173, 30, 64, 94, 72, 72, 72,210,163, 71,143, 10,157,200,153, 27, 18, 18,146,
+220, 0, 78, 9,128,159, 0, 4,213,115, 95, 46,128,201,112,208,154,109,205, 88,214,116,114,197,198,237,179,163,102, 14, 36,190,
+ 91, 20,209,238,157,175,207, 93, 37,121,236,224,148,188,138, 44,151,134,178, 79,100,153,183,180,170, 46,168,234,186, 86, 39,116,
+ 58,157,175,193, 96, 0,183,150,205,226, 53, 26, 13,220,220,220,124,237, 77,164, 72, 36,194, 15, 63,252, 0, 46,151, 11, 46,151,
+139,146,146, 18, 4, 7, 7, 91,207,121, 60,158,245,115,139, 22, 45,234,229, 99, 24,166, 15, 69, 81, 80,171,213, 96, 24,198,122,
+ 40,149, 74,176, 44, 11,129, 64, 0,134,169,220,206,201,230,122,159,218,248, 8,130,152, 20, 20, 20,132,125,251,246, 65,175,215,
+ 63,113, 93, 38,147, 33, 49,241,143, 77, 70, 40,138, 66,223,190,125, 73,130, 32, 38, 1, 88, 84, 7, 47, 11, 0,145,145,145,160,
+ 40, 10, 20, 69,129, 36, 73,235,103,203,193, 48, 12,150, 47, 95,142,106, 91,147, 61, 53,206,231, 13,245, 68,134,207, 67, 45, 62,
+ 90,100, 19,167,203,118,137,103,144, 88, 34,251,226,221,127,252, 83,122,226,210, 29,100,102,101, 62, 33,178, 0,224,183, 95,118,
+ 34, 47, 55, 7, 9,169,217,152,250,183, 5, 82,153,204,227,139,106, 13,106,173,203, 70,221,221,120, 95,126, 56,121,160, 80,109,
+204, 69,153, 39, 64,181,225,131, 43,214, 96,201,184,110, 2,153, 27,111,173, 61,233, 20,240,249,191,172, 62,119,206, 42,178,194,
+117, 58, 8, 24, 6, 52,195, 88, 69,150,158,166,161,213,235, 17,168, 86, 35, 99,214, 44,176, 70, 35, 62, 62,124, 88, 44,224,243,
+127,177, 39,157, 0,192,227,241, 2,143, 30, 61,218,162,107,215,174, 23, 97,127, 48,211,115, 77,252,142,234, 66,207,238,221,187,
+199,238,222,189,187, 5,143,199, 11,116, 6,167, 80, 40,156, 32,145, 72,138,132, 66,225,132, 6,166,147, 4,176, 98,246,236,217,
+241, 47,189,244,210, 5,179,176,178,138,154,151, 94,122,233,220,236,217,179,111, 1, 88, 94, 75, 89,175,137,179, 89, 80, 80,208,
+202,205,155, 55,139,211,211,211,145,147,147, 3,163,209,136, 55,223,124, 19, 12,195, 64,171,213, 66,175,215, 99,205,154, 53, 18,
+111,111,239,101,168,220, 40,216,158,103,231,185,187,187,167,239,218,181,107,226,195,135, 15,165, 23, 46, 92, 32, 18, 19, 19, 37,
+235,214,173, 27,239,237,237,157, 6, 64,208,128,252, 36, 3, 3, 3,191, 59,114,228,200,187,137,137,137,193,135, 14, 29,226, 94,
+187,118, 45,112,235,214,173,115, 2, 3, 3,119, 3,160, 26,248,142,122,136,197,226, 17,139, 23, 47, 54, 93,185,114, 37,231,202,
+149, 43, 57, 27, 54,108,192,160, 65,131,194,163,162,162,194, 26,200,217,211,205,205,109,248,226,197,139, 77,113,113,113,185,215,
+175, 95,207, 94,183,110, 29, 57,124,248,240,129, 43, 87,174,236,230, 32,231, 79, 87,174, 92, 25,146,149,149,213, 58, 59, 59,187,
+ 85,118,118,118, 72,118,118,118, 72, 78, 78, 78,203,188,188,188, 22,249,249,249,205, 11, 11, 11,155,199,198,198, 14, 4,176,215,
+ 30,206, 80,127,201,187,139,222,140, 40, 95,246,183, 49,236, 71,211, 95,102,151,188, 57,132,125,101,112,215,159, 41, 14,135,184,
+158,156,137, 96,119, 96,231,252,222, 45,155,251, 72, 18, 59,123, 73,219, 63,103,117,243,121,227,228, 88,132,148, 66,161,192,137,
+ 19, 39, 96,182, 94,245,176, 21, 89,165,165,165,200,203,203,179, 92,227,216,147, 78,153, 76,118,126,251,246,237,108, 69, 69, 5,
+ 84, 42, 21, 10, 11, 11,145,149,149,133,140,140, 12, 20, 23, 23,227,238,221,187, 16,139,197,231,237, 73, 39, 65, 16, 96, 24,198,
+ 42,164,206,158, 61,139,217,179,103, 67,161, 80, 88,255,199,225,112,172,159, 45,223,169,143,211, 98,121, 98, 24, 6,215,175, 95,
+199,220,185,115,177, 97,195, 6,236,221,187, 23,199,143, 31,135, 66,161,176,138, 45,154,166,235,229,148,203,229, 48,153,236, 27,
+ 51,177, 44, 11,149, 74,101,247,123,183, 21, 64, 28, 14,231, 9, 81,100, 57, 28, 41, 75,141,228,124,110, 97, 71,100,248,218, 71,
+216,150, 15,102, 83,221,208,166, 74, 36,201,225, 77,157, 52,243, 61,239,236,194, 82,228, 20,168, 64,145,127,244,123, 97, 17, 51,
+193,161, 72,220, 56, 83,105,184, 34, 41, 10, 42,141, 14, 74,181, 1, 19,103, 46,244,250,207,134,127, 77,165, 13, 21,117,198,120,
+233, 2,180,235, 44,149,190,222,169, 83, 11, 50, 69,144,138,176, 87, 46,131, 49, 1,108,220,171,232, 81,226, 71,117,248,133,255,
+186,166,204,176, 50, 17, 72,175,211,154,225,225, 33,242,236,214, 13, 81, 65, 65, 24,108, 52,130,199,178,120,185,160, 0,191, 47,
+ 92, 8,221,193,131, 32, 1,240, 38, 76,192,176,141, 27,113, 41, 40, 8, 1, 90, 45,148,239,191, 15,223,211,167,193,147,201, 68,
+ 40,178,111,241, 3, 65, 16, 24, 58,116, 40,206,157, 59,231, 61,122,244,232, 51,119,238,220,121,131,166,233, 75, 13,201, 91,119,
+119,247,223, 56, 28, 78,112,125,247,209, 52,157,173, 82,169, 28,222,102,132,195,225, 12,238,219,183,239,225, 67,135, 14,121, 26,
+ 12, 6,167,140, 66,248,124,254,232,241,227,199,111,255,246,219,111,101,115,230,204,217,126,252,248,241,114,189, 94,127,218,145,
+ 34, 5, 96,197,182,109,219,222,137,140,140,244,152, 51,103, 14,155,145,145, 97,107,189,242, 29, 52,104,208, 75,219,183,111, 15,
+232,221,187,247,123,115,231,206,229, 1,248,184, 62, 43,143, 84, 42,157,183,125,251,118, 31,185, 92, 14,181, 90,109,109,100,179,
+179,179, 33, 18,137, 64,146, 36, 72,146, 4,151,203,197, 23, 95,124,225, 61,111,222,188,133, 10,133, 98,161, 29, 86,178,232, 45,
+ 91,182,248,142, 28, 57,146,124,248,240, 33, 72,146,132, 80, 40,196, 91,111,189, 69,106,181, 90,207,168,168,168, 24,141, 70, 51,
+197,145, 60,228,114,185, 83,163,163,163,219,135,135,135,115, 82, 83, 83,209,191,127,127,220,184,113, 3, 19, 38, 76,224,150,149,
+149,181, 90,178,100,201,108,157, 78,231,104, 28,151, 64,177, 88,220,229,191,255,253,111, 86,243,230,205,173, 13, 75,171, 86,173,
+152,177, 99,199, 42, 82, 83, 83, 67,175, 92,185, 82, 60, 96,192, 0, 71, 54, 44,111, 38, 22,139, 59,156, 60,121, 50, 47, 42, 42,
+106,196,182,109,219,198, 3, 64,159, 62,125,142,126,254,249,231, 23, 20, 10, 69,231, 75,151, 46, 41, 6, 15, 30,156,109, 39, 95,
+ 80, 96, 96, 32, 51,127,254,124,105, 93, 55,237,216,177, 67,137,202, 13,151, 91, 3,168,115,191,182,208,144,128,101,107, 23, 78,
+ 18,129, 49,128, 53,106, 1, 67, 57, 96, 80,195,164, 47, 7,193, 19, 1, 70, 45,124, 5, 10,252, 52, 47, 84,182,116,223,253, 20,
+230, 46, 49, 54, 85, 94,118, 26, 46,212,216,212, 0, 8, 35, 8, 34,225,196,137, 19,232,219,183, 47, 78,156, 56,129,177, 99,199,
+ 38,216,138,129,196,196, 68, 12, 30, 60, 24,102,139,150, 93,190, 90, 42,149,234,195,229,203,151,199, 77,157, 58, 85, 92,165, 49,
+ 32, 73,120,120,120, 96,204,152, 49, 21, 26,141,230, 67,123, 19,202, 48, 12, 56, 28, 14,178,179,179,177, 99,199, 14,172, 90,181,
+ 10,237,218,181,131,209,104,124, 66,108,153,219, 61,187, 26, 63,154,166,113,243,230, 77,236,217,189, 27, 31, 47, 91, 6, 55, 55,
+ 55, 0,128,193, 96,128,162,164, 4, 66,161,208, 42,198,234, 17, 78,251,239,221,187,183, 48, 56, 56,184,202,148,161,229,175,185,
+205,130,201,100, 2, 77,211,168,168,168,192,134, 13, 27,104,150,101,247,215,215,255, 88, 68,209,194,133, 11,161,211,253, 97, 80,
+239,102,246, 73, 14, 9, 9, 65,247,238,221,173,231, 36, 73,178,246,114,254,103, 64, 23,104,109,238, 14, 93,190, 14, 0, 16, 28,
+ 28,140,208,208, 80, 4, 6, 6,214,202,217,212, 90,164, 33,112, 32, 50,124,237, 66,235,105,236,148,205,229, 9,135,181,105,219,
+158,200,204, 83,128,195,225, 64,226,238,131, 1,175, 45, 2, 69,145,144,122,248,128, 96,180,127, 40, 98,146, 2,135,226, 64, 81,
+166, 69, 72,235,182,164, 64, 40, 26,166,169, 71,104,201,220,185, 91, 22, 79, 25, 32, 44,166,179, 33,106, 33, 4, 99,233, 78,131,
+248, 32,189,203,240,193,232,118,162,200,163,119,182, 64,101, 28,110, 79,122, 41,154,134, 31, 69,193,192,178,248,125,225, 66,132,
+ 69, 71, 35,193, 34, 12,163,163,145, 16, 25, 9, 47, 46, 23, 2,146, 4,107, 52, 62, 49,167,111,143,208, 2,128,172,172, 44, 28,
+ 60,120,208,107,210,164, 73,135, 19, 19, 19,167, 58, 40, 54, 44, 92, 62,215,175, 95,247,107,221,186,117,173,247, 60,120,240, 0,
+189,122,245,114,120,122,138,207,231,143, 30, 62,124,248,190,131, 7, 15,186, 39, 39, 39,195,207,207,175,209, 66, 75, 32, 16, 12,
+142,136,136,216,183,107,215, 46, 89, 81, 81, 17,162,163,163,101,175,190,250,234,222,248,248,248,215,116, 58,157, 61, 98,179,138,
+200,138,142,142, 86,238,216,177,227, 63,168, 58, 69,152,183, 99,199,142,239,122,247,238,253,110,100,100,164, 7,128,119,204,190,
+ 3,117,138, 45,129, 64, 48,180, 77,155, 54, 85, 70,181, 2, 65,165,177, 73, 34,145,192,221,221, 29, 60, 30, 15, 58,157, 14, 97,
+ 97, 97, 4,159,207, 31,104,207, 51,187,185,185, 69,188,254,250,235,228,229,203,151,145,159,159, 15, 15, 15, 15, 72,165, 82, 48,
+ 12,131, 57,115,230, 80, 27, 54,108, 24,170,209, 56, 54,195,213,188,121,243,241, 35, 70,140,224, 36, 37, 37,225,225,195,135,208,
+233,116, 72, 75, 75,131, 76, 38,195,244,233,211,121,107,215,174,125, 53, 39, 39,199, 81,161,213, 37, 50, 50,178,192, 86,100, 89,
+ 32,145, 72,136,246,237,219, 43,188,189,189,123, 2,112, 68,104,117, 89,176, 96, 65,225,234,213,171, 7,159, 59,119,206, 26,244,
+242,220,185,115, 75, 0,224,171,175,190,138,243,245,245,237, 9,192, 94,161, 5,150,101, 77,127,253,235, 95, 31,243,249,124,112,
+185, 92,240,249,252, 42, 7,143,199, 3, 73,146,110,150,234, 92, 31, 95,202,195,252, 53,115,150,172, 91, 39, 17, 82,220,127,188,
+214, 21, 45, 60,120,128,200, 11,188,193, 75, 65,120, 84, 26, 45, 89,197, 3,224,151,165, 88,255,186,130,140,252,190,226,103, 3,
+227,233,123,191,164,164,236, 25,247, 1,189, 1,252, 27,149,155,235, 46, 3,112,253, 57,233,155,110, 1, 8, 27, 59,118,172, 85,
+108,157, 58,117, 10,163, 71,143,134, 82,169, 68, 82, 82,146,173,200,114,100,131,229, 91, 70,163,241,246, 15, 63,252, 48, 96,210,
+164, 73,132, 77,253, 66,114,114, 50,238,222,189,155, 96, 47, 31, 73,146, 48,153, 76,224,114,185, 88,183,110, 29, 12, 6, 3,190,
+255,254,123, 28, 56,112, 0, 36, 73,130, 32, 8, 16, 4, 1,153, 76,134,175,191,254,218,161,118,143, 97, 24,196,196,196, 96,233,
+146, 37, 86,145,101,158,201, 64,128,191, 63,188,125,124,112,255,254,253,122,133, 86, 73, 73,201,167,199,142, 29, 67, 93,206,240,
+199,142, 29,179,126,174,230, 12, 95,127, 63, 71, 81,208,233,116,120,249,229, 63,182,138, 93,176, 96,129,245,179, 66,161, 0, 69,
+ 81,150,188, 32,236,229,212,178,192,107,194, 63,254, 55,230,131, 15,170, 88,232,106,227,124, 26, 90,196, 89,214,173, 26,196, 86,
+152,217, 58, 27, 8, 96, 44, 42,125,180,242,128,167,232,163,197,178,166, 14,193,205,130,112, 59, 35, 17, 28,138, 2,223,221, 7,
+238, 94,254, 48,209,122,168, 10, 31,226,226,161,111, 0, 0,219, 98,246,131, 36, 73,112, 56, 20,116,122, 6,237, 90, 4,193,100,
+ 50,117,168,139,187, 35, 48, 96,168,191, 79,223,230, 45, 61,136, 36,207,135,104,239,231, 93,109, 34, 68,128,118,185, 82,162,191,
+ 84,212,167, 68, 85, 58, 32, 5,184, 82,175, 24, 32, 73,144, 4, 1, 49,143, 7,221,193,131,149, 94,155,209,149,125, 86, 66,100,
+ 36,200,159,127,134,155, 64, 0,138, 32,192, 49,155,160, 27,130,210,210, 82, 16, 4,129, 61,123,246,120, 78,159, 62,125,111, 82,
+ 82, 82,100, 69, 69,197, 65, 71, 56,148, 74,229,216,240,240,240, 11, 49, 49, 49,190, 1, 1, 1, 79, 92,207,207,207,199,204,153,
+ 51,139,148, 74,165, 67, 65,221,132, 66,225,132,241,227,199,111,223,185,115,167,236,222,189,123, 80,171,213,240,245,245,109,108,
+ 81,232,217,175, 95,191,195, 7, 15, 30,116,207,207,207,135, 74,165,130, 78,167,195,158, 61,123, 60,198,140, 25,115, 48, 53, 53,
+117, 52,128,248,122, 56, 62,177, 21, 89,115,231,206,189, 3,192, 15,192,150,234, 26,212,124,173,171,141,216, 82, 1, 88, 91,199,
+ 72,180,165, 68, 34, 65, 97, 97, 33,102,206,156,137,244,244, 63, 12,160, 65, 65, 65,214,145,222,253,251,247,225,235,235, 11,130,
+ 32,252,236,121,104, 95, 95, 95,169, 94,175,199,236,217,179,145,149,149, 85,133, 51, 59, 59, 27, 4, 65,136, 29,205, 72,127,127,
+127,127,173, 86,139, 65,131, 6,161,162,162,114, 95,223,201,147, 39,131,203,229,162,176,176, 16, 92, 46,215,167, 1,239,199,103,
+236,216,177,181,134, 86,145,201,100, 6, 79, 79,207,142, 14,114,122,191,250,234,171, 57,209,209,209, 79, 44,108,185,113,227,198,
+ 95,188,188,188,206,121,121,121,181,119,144,211,100, 43,170,120, 60, 94, 21,161,197,229,114, 65,146,164,221, 62,106,233,133,154,
+205, 28, 34,175,251,234,249, 35,103,182,240,115, 7,171, 46, 0,111,248,167,184, 93, 36,194,186, 13, 39, 1, 0,255,124,171, 23,
+186, 69,172,128,126,231, 72, 44,236, 79,241,167,101,235, 22, 3,248,228, 25,183,249, 95, 2,176,172,130,251, 22, 64,247,231,168,
+ 63,178,138,173, 83,167, 78,161,115,231,206, 40, 41, 41, 65,106,106,106, 67, 69,150,165,189, 91,250,217,103,159,253,242,198, 27,
+111, 72, 44,131, 86,145, 72,132,247,223,127, 95,171, 86,171,151, 58, 84,136, 76, 38,112, 56, 28,235, 32, 89, 40, 20, 34, 44, 44,
+204, 42,178, 8,130, 64,121,121, 57, 56, 28,142,101, 69, 34, 97,103, 26, 17, 24, 16, 0, 55, 55, 55,180,109,215, 14,247,204,237,
+136,229,179, 64, 32, 0, 65, 16,160,233,122, 13,121,101,102,167,246, 69,206,238,146, 45,162,168, 78,211,113, 80, 16, 76, 38,147,
+ 69,100,178,206,224,244,241,241,129, 90,173,182,151,243,185, 68, 45, 22, 45,139,208, 26,139, 74, 95,173, 39,194, 59, 12, 1,112,
+ 17, 77,184,164,146, 0, 75,152, 88, 22, 28,138, 52,207,221, 82,160, 40, 18,138,162, 60,108,252,244, 29,179,200, 58,128, 19,113,
+169, 8,110,211,249,143,121, 92,130, 0,216,186, 11,183,175, 59, 47,122,222, 27,253, 68, 5, 68, 30, 60,130,196, 16, 10,171,233,
+ 71, 79, 30,136, 16, 18,243,135, 6,139,111, 30,171,136, 78, 81, 25,234,237, 40,132, 36, 89,233,252, 78, 16, 53, 58,247,144,230,
+107, 20, 65,128,101, 89,176, 38,199,252,142, 45, 66, 94, 36, 18,193, 96, 48,128,162, 40,108,218,180,201, 35, 34, 34, 98,139,163,
+ 66, 11, 64,114, 65, 65,193,152, 57,115,230,156,218,191,127,191,143,143,143, 79,149,209,195,156, 57,115,228, 5, 5, 5, 99,224,
+160,211, 61,151,203,221,242,237,183,223,202, 30, 61,122,132,242,242,114,136, 68, 34,107,227,211,208,242,217,167, 79,159, 51,167,
+ 79,159,246, 84,169, 84, 48, 24, 12, 16,137, 68, 96, 89, 22, 20, 69,225,199, 31,127,244, 30, 55,110,220,201,204,204,204,225,117,
+165, 85, 36, 18,189,102, 22, 78,136,140,140,244,136,140,140, 28, 2,212, 26,169,215,138,200,200, 72,143, 69,139, 22,189,170,213,
+106,215,214,241,204, 89, 10,133, 34, 64, 36, 18,225,208,161, 67,144, 74,165, 16,139,197, 8, 10, 10,130, 66,161,128, 88, 44, 6,
+203,178, 48, 26,141,150,198,162,216,158, 7, 47, 42, 42, 82,211, 52,237,126,234,212, 41, 20, 23,255,241,149, 22, 45, 90, 64,169,
+ 84,194,100, 50,149, 59,154,153,185,185,185, 5, 4, 65, 52,191,125,251, 54, 30, 61,122,132,209,163, 71,227,231,159,127, 70,175,
+ 94,149,179,195,122,189,190, 33, 65,252, 24,138,162,216, 58,202, 45, 1,192,211,153,156,230,206,203, 33, 78,147,201,100,178,136,
+ 44,219,191,182,226,171,158,223,172, 82,157, 59,250, 75,119,172,158, 55, 98,230,200,206, 62,208, 22, 61,132,208,205, 7,132, 71,
+ 8,214,109, 56,137,164, 7,149,239,107,221,222,223,176, 47,106, 12, 32,242, 66,168,187, 28, 1,110,156,215,239, 22, 62,115,161,
+229,110, 59, 78,120, 94, 59,166,209,163, 71, 67,161, 80, 64, 42,149, 58,195, 63,231,170, 86,171, 77, 59,114,228, 72,207,177, 99,
+199,130,207,231, 35, 45, 45, 13,241,241,241,169, 0,174, 58, 42,180,184, 92, 46, 62,251,236, 51,188,243,206, 59,240,247,247,199,
+210,165, 75,193,225,112,172, 7, 65, 16, 86, 11,151, 35,240,243,175,123,225,163,197, 33,190, 62, 99,184,187,187,251,103, 36, 73,
+ 78,162,236,200, 56,134, 97, 24,147,201,180, 95,165, 82,213, 25,222,193,226,184,110,207,187,176,205,131,122,250,180, 70,115, 62,
+ 13, 45,210, 16, 84, 95,109, 88,139, 69,203,178,234,240,137,173,128, 44, 79,121,209,108,178,187,216, 84, 9, 37, 72,234,110,118,
+ 78, 46,188, 61,165,102,145,101, 62, 72, 18,221, 58, 87, 14,102, 79,196,165, 34,184,117,103,112, 40, 10, 28,138,130, 84, 36, 64,
+ 65,126, 30, 56, 28,242,110,109,188, 93, 40,188,241, 70,251,230, 33,158,222, 92,200,125,245, 8,244,175,197, 48,208,211, 13,193,
+129,124,140,242, 22,182,236, 66,225,141,186,173,111,172, 85,104, 25,104, 26,188, 9, 19,172,211,133, 9,145,145, 8,139,142, 6,
+ 51,126, 60, 52, 6, 67, 21, 83,113, 67,133,150, 72, 36, 66, 89, 89, 25,166, 78,157,170, 48, 26,141,239, 54, 48,139,227,139,139,
+139, 39, 78,155, 54,173,216, 34, 96, 12, 6, 3,166, 77,155, 86, 92, 92, 92, 60,209, 14, 43,209, 19, 48, 26,141,239,246,234,213,
+ 75, 33,151,203,173,233,108, 72,131, 99,129,151,151,215,137, 29, 59,118,120,233,116, 58,208, 52,109,229, 20,137, 68,160, 40, 10,
+190,190,190,216,183,111,159,175,151,151, 87,157,123, 86,105,181,218, 35,209,209,209, 74, 0,136,142,142, 86, 18, 4, 17, 75, 16,
+196, 86,130, 32,190,173,118,108, 37, 8, 34,214,246, 94,173, 86,123,184, 46,110,189, 94, 31,155,154,154,202,138,197, 98, 80, 20,
+ 5,131,193, 0,161, 80,104, 53,137,151,150,150, 66,171,173,156,230,142,143,143,135,209,104,188,108,207,179,151,149,149,157,143,
+137,137, 49,181,104,209, 2,157, 59,119, 70, 88, 88, 24,250,245,235,135,150, 45, 91,226,243,207, 63,103, 52, 26,141,195,117, 47,
+ 55, 55,247,196, 79, 63,253,100,108,222,188, 57,122,246,236, 9,129, 64,128,110,221,186, 33, 40, 40, 8,171, 86,173,210,171, 84,
+170, 83, 13,120, 77,153,137,137,137, 84, 29, 34, 87, 6, 59, 86,239, 86, 67,214,205,155, 55,169,126,253,250, 29,173,126,161, 79,
+159, 62, 71,165, 82,169,187,197,196,238,200,136,220, 86, 92, 9, 4, 2,235, 97,249, 63,135,195,177,103,244, 67,118,244,151,238,
+248,226,157, 97, 51, 71,118,246,196,209,243,215,193, 51, 40, 1,125, 29, 51,130,140, 17, 4, 79, 2,127,119,110,240,115,208, 7,
+ 44, 4,112, 7,149,113,152,150,226,249,130,213,241,189,184,184, 24,169,169,169,136,143,143, 71,191,126,253,112,249,242,101,224,
+ 15, 7,121,135,161, 82,169,150, 70, 69, 69,105, 44, 43,249,150, 45, 91,166, 45, 43, 43, 91,234,104, 27,204,178, 44,184, 92, 46,
+ 66, 67, 67,177,104,209, 34,156, 60,121, 18,105,105,105, 48, 26,141, 86, 33,100,241,201,116,196,162,197,227,241,224,239,239, 15,
+163,209,104,181,102, 1,192,189,244,116,112, 56, 28,152, 76, 38,232,245,250,122, 45, 90,238,238,238,159,109,223,190,253, 61,185,
+ 92, 30, 88, 84, 84,228,103,123, 20, 20, 20,248,229,229,229,249,229,228,228,248,101,101,101,249, 61,126,252,216,239,225,195,135,
+129,107,214,172,121,207,221,221,253, 51,123,210, 73, 81, 20,186,117,235,134, 5, 11, 22, 88,143,205,155, 55, 91,143,139, 23, 47,
+ 58,236,188, 78, 81, 20, 66,151,175,195,152, 34,214,122,156,244, 37,172, 71,210, 63,231,214,197,217,228, 90,164, 65,250,197,188,
+218,208,118, 99,233, 26, 96, 89,117,104,105,203,172,110, 27,213,157,225,155, 12,180,190,226,194,131,140,244, 97,161, 93,122,147,
+249,114,117,149,229,159, 97, 67, 39,130, 32, 8, 52,107,221, 25, 20,135, 3,138, 34,193,161, 40,120,200,132, 72,189,125,219,164,
+211,106, 47,212,196, 57, 4,224,240, 69,252,205,111,141,234, 38,204,229, 23,194, 55, 80, 2, 30,183, 82, 59,178, 15, 38, 86,235,
+ 33, 56, 64, 23, 55,204,202,241, 22, 93, 40,168,216,236,169, 49, 28,141,173,101, 4,104, 50,153, 32, 21, 8, 80,161,211, 65, 75,
+211, 24,186,113,163,117,186,144, 36, 8,220, 2,208,117,227, 70, 92, 57,120, 16, 50, 62, 31, 16, 8,236, 94, 21, 82,147,208,146,
+203,229,152, 49, 99, 70,113, 94, 94,222,244,134,248,104, 89,160,211,233, 46,229,231,231, 79,159, 56,113,226,158, 67,135, 14,121,
+ 77,156, 56, 81,145,159,159, 63,221, 78,191,167, 39, 80, 81, 81,113, 48, 43, 43,171,124,198,140, 25,187,247,238,221,235,237,227,
+227, 99, 29,137, 52,168,176, 18,132,124,196,136, 17, 2,123,238,171,231,150, 40,179,115,251, 59,102,203, 86,215,185,115,231, 94,
+ 65,165,255,149, 45,150,111,219,182,109,178,205, 20,227, 86, 0, 27,235, 34, 46, 45, 45,253,118,209,162, 69,127,187,116,233,146,
+143, 80, 40, 4, 65, 16,224,241,120,104,219,182,173,117, 21, 13,151,203, 5,203,178,248,224,131, 15,228,133,133,133, 95,217,249,
+110,230, 70, 69, 69, 13,174,168,168,240,156, 49, 99, 6, 37, 20, 10, 81, 80, 80,128, 13, 27, 54, 48, 59,119,238, 84,106, 52,154,
+153, 13, 16,194, 49,255,250,215,191,134,170,213,234,214,115,230,204,225,169, 84, 42,104,181, 90, 44, 94,188, 88,255,221,119,223,
+101,107,181, 90,135, 3,254,246,239,223, 63,227,241,227,199, 3,203,203,203, 75,196, 98,113,117,107, 31, 33,145, 72,122, 3,216,
+237, 8,103, 88, 88,216,253,204,204,204,126, 43, 86,172,136, 53, 26,141,220, 27, 55,110, 88,157,225, 55,109,218,116, 81, 40, 20,
+142,128,131,155,175, 18, 4, 97, 18, 8, 4, 85, 44, 88,213, 63,115, 56,156,122,219,180, 14, 1,226, 21, 95,188, 61,120,230,203,
+ 29,221,113,228,252,111,136, 58,252,224,110,187,153,190,161, 47,121, 22,193, 84,148,138,127,190,213, 11,235,246,254, 6,160,114,
+234,208, 84,152, 4,182,228, 62, 88,183,230,120,168,144,231, 62, 7,125,192, 69, 84,134,204,120,222, 80, 69,100, 37, 37, 37, 97,
+216,176, 97, 0,128,203,151, 47, 35, 60, 60, 28,151, 47, 95,198,192,129, 3, 29,142,165,101,198,127, 75, 75, 75, 31, 95,188,120,
+177, 83,243,230,205,113,245,234,213,135, 0,254,235,104, 34, 45, 66,139,195,225,224,205, 55,223, 68, 68, 68, 4, 90,180,104, 81,
+101,181,161,229,179, 35, 98,131,166,105,116,233,210, 5, 58,189, 30, 60, 30,207, 58, 53,201,225,112,224,235,231,135,140,140, 12,
+187, 44, 90, 36, 73, 78,122,237,181,215,200,228,228,100, 76,153, 50, 5,123,246,236,169,245,222,105,211,166,225,135, 31,126,192,
+107,175,189, 70,126,244,209, 71,117,134,119,176, 56,161,219,243, 76,150,126,186,190,118,223, 89,156, 77,173, 69, 26, 3,155,208,
+ 14, 53, 78,154,212,240,191,232, 42, 66,203, 38, 72, 88,211, 8, 45,218,176,231,231,239,191, 89,212,111,203, 64,223, 64, 63,119,
+ 40, 84, 90,171,216, 74,184,120, 0, 0,240,198,220,149,224, 80,149, 83,138, 50,169, 16, 34, 30,133,131,187,190,146, 27, 12, 21,
+ 53,150,174, 50, 46,249,206, 71, 3,218,186,243, 37, 70,148, 6,176,232,236,251,199, 78, 57, 68,235, 3, 79, 10,174, 30,158,240,
+ 73, 42,193, 91, 47, 73,101, 95, 37, 43,223,129,209,180,249,137, 14, 81,169,212, 42,111,223, 22,141,222,190, 29, 55,166, 79, 71,
+ 51,134, 65,108, 80, 16,188,184, 92,184, 11, 4, 32, 9, 2,218,227,199,113,229,208, 33,248, 11, 4,128,155, 27,232,207, 63,135,
+ 46, 53, 21,198,178, 50,109, 3, 70,102,152, 60,121,178, 92, 46,151, 79,212,235,245,151, 26,155,207, 90,173,246,116, 86, 86, 40,
+104, 68,151, 0, 0, 9, 69, 73, 68, 65, 84,214, 59,253,251,247,223, 98, 52, 26,223,213,106,181,141, 90, 25,165,215,235, 79,231,
+231,231, 79,152, 60,121,242,129,195,135, 15,251,120,120,120, 52,152,171,184,184,184,151,147,138,147, 9,192,199,102,231,246,119,
+ 34, 35, 35, 61,110,222,188,249,183, 29, 59,118,108,177, 25, 77,248,205,158, 61,251,237,106, 34,171,222, 85,135, 0, 50, 11, 11,
+ 11, 63,127,255,253,247, 87,174, 95,191, 94,106,113,124,255,253,247,223, 65,211, 52,184, 92, 46, 24,134,193,236,217,179,213,197,
+197,197,235, 80,123, 68,231, 39,138, 86,105,105,105,219, 21, 43, 86,236,216,184,113, 99, 4, 69, 81, 18,134, 97, 52,229,229,229,
+177, 21, 21, 21, 51,209,176, 56, 90,166,162,162,162, 25,159,124,242,201,140, 13, 27, 54,188, 70,146,164, 31, 77,211,242,178,178,
+178, 99, 90,173,246, 59, 52, 96, 42,233,234,213,171, 69,111,189,245,214,131,162,162,162, 14,193,193,193, 42,169, 84,170,215,235,
+245,148, 72, 36,146, 73, 36,146, 48, 0, 87, 9,130, 72,113,132, 51, 33, 33, 33,127,206,156, 57,143,116, 58, 93,232,214,173, 91,
+227,100, 50,217,121,130, 32, 8, 30,143,231, 41, 18,137,134, 1,136, 37, 8,226,158, 35,156, 36, 73,154,108,173, 87,213,253,179,
+248,124,190, 93, 62, 90,173,125,197,179, 34,218,114,112,228,194,111,136, 58,146, 25,195,176,236,161, 67, 9, 37,199,151,134, 3,
+134,253,111,161,219,196,221,149,211,133, 0, 76,133, 73, 48,236,159, 6, 66,236,131,184, 28, 46, 84, 90,195, 9,184, 80, 19,172,
+225, 29,228,114, 57,146,147,147, 45, 34, 43, 12, 0, 6, 14, 28,152, 96, 17, 91,241,241,241,232,217,179,103, 2, 0,174,163,229,
+181,180,180,244,253,169, 83,167,158, 54, 15,142,223,111,192,192,207, 42,180, 44,130,170, 69,139, 22,214,115,219,195,198, 71,203,
+ 46, 48, 12, 3, 30,143, 7, 14,135,131,192,160, 32,235,111,177, 44,139,140,140, 12, 40, 20, 10,187,132, 22, 69, 81, 20, 65, 16,
+152, 50,197,190, 5,201,127,253,235, 95, 17, 27, 27, 11,202, 78, 85, 72, 81, 20, 66, 66, 66,234,189,199,162, 75,237,229, 12, 14,
+ 14,110, 48,103, 83,107,145,134, 10,172,154, 62,215, 36,170,106,171, 16, 79, 11,185,106,181,234,227, 93,219, 55,173,159, 61,239,
+ 3,105,210,253, 2,168,212, 58, 80, 20,105,219,120,130,195,161, 32,147, 8,209, 60,192, 29,123,255,243,239,178,178, 82,229, 39,
+168,101,223,195, 22,110,188,185, 35,122,191, 36,224, 5,106, 16,218,117, 50, 40,225, 31, 34,128,205,175,101,118, 48,252, 23,188,
+146,169, 17,254,156,169,153,123,171, 68,255,164,208,210,235, 71, 46, 27, 53,234, 76,212,201,147,226, 62, 49, 49,184, 63,123, 54,
+130,180, 90, 8,204, 83,137, 36, 65, 64,202,227, 65,202,227, 85,138,172, 13, 27,160,165,105,108,156, 62,189, 92,167,215,143,114,
+164,146, 23, 23, 23, 99,252,248,241, 69,185,185,185, 99,208,128,169,189,218,160,209,104, 14, 2, 56,232, 44, 62,157, 78,119, 41,
+ 59, 59,251,149,241,227,199,159, 60,125,250,180,239,115, 18,100,206, 34,182, 12, 55,111,222,124, 59, 46, 46,238, 62,170,110, 44,
+170,140,139,139,187, 63,103,206, 28, 98,199,142, 29,223, 1,248, 23,236, 12,224,169,209,104, 54,157, 61,123, 22,131, 7, 15,254,
+215,234,213,171,189,123,245,234, 5, 63, 63, 63,148,149,149, 33, 62, 62, 30, 11, 23, 46, 84,148,150,150,174, 86, 42,149,235, 29,
+ 76,179, 65,167,211, 77,179, 93, 74,237,140,124,208,233,116, 59,243,242,242,118, 58,139,112,254,252,249,191,103,100,100, 20,251,
+250,250,246,229,241,120, 93, 81,233, 7,148, 15,224, 59, 71, 5,145, 5,243,230,205,187,157,145,145, 33,111,214,172, 89, 63, 51,
+167, 7, 42,183, 49,218,222, 0,206,220,223,126,251, 45,184,119,239,222, 36,151,203,101, 41,138, 2,151,203,101, 57, 28, 14,107,
+246,171, 97, 1,224,216,177, 99, 2, 0,117,110,155,115,191, 80,187, 98,218,191,127,253, 40, 37,191,226, 80,106, 65,249, 34, 0,
+236,254, 36,241, 47,221,124,169,145, 35,219,103, 67, 23, 61, 16,132,172, 50, 80, 37,171,206, 3, 33,241, 71,182,169, 25,150, 31,
+189,155, 79,131, 88,235,210, 84, 53,143,171, 97, 14,239,144,151,151,103, 43,178, 44, 86,171,176,129, 3, 7, 38,152, 69,150,229,
+ 90, 67,252,203,206,153, 76,166, 70,245, 97, 44,203, 34, 42, 42, 10,219,182,109, 67,125, 17,205,205,171,251,136,250,248, 44, 22,
+ 45,134, 97, 96, 48, 24,144,148,148,100,141,217,101,153, 46,180,132,118,160,105,186,206,213,234, 12,195, 48,122,189, 30, 63,254,
+248,163, 93, 98,107,223,190,125,168,168,168, 0, 83,143,130,179, 13,197,208,189,123,119, 40, 20, 10,235, 98,159,176,176, 63, 66,
+229, 25, 12, 6,135,132,171,133, 51, 52, 52, 20,114,185, 28, 22,127,225,230,211,255, 48,246,208, 26,205,159,181,220,215,106,209,
+122,234, 61,166, 64, 44, 59,221,107, 64, 68,248,244,183, 23, 74,212, 58, 6,143, 30, 61, 70, 81, 97, 30, 72,130, 68, 96,179, 96,
+180,108, 25, 2, 17,159,196,158,232,245,154,132, 43,231,127, 85,151,149,140,174,141,107,172, 59,239,202,134, 9,225,253,218,180,
+113, 35, 64, 27, 1,198, 8,208, 70,192,100,254,107,249,159,169,106,153, 75, 78, 86,178, 31,221, 82, 92, 59,161, 50,212,184,103,
+213, 68, 32,220,195,203,235,204,242, 99,199,196, 38,131, 1,197,239,191, 15, 49, 77, 67,104, 30,149, 84, 62,136, 0,244,231,159,
+ 87,138,172,105,211,202, 85, 74,165, 67, 91,240,248,248,248,252, 70, 16,132, 79, 81, 81,209, 11, 21, 25,222,215,215,247, 4,203,
+178,114,185, 92,222,235, 57, 74,151, 31, 0, 37, 0, 67, 13, 3, 9, 95, 56,238,255, 99, 65,136,175,175,239, 71, 36, 73,246,103,
+ 89,214,155, 36,201, 18,147,201,116,181,176,176,112, 13,128, 12, 87,127,250,204, 96,137, 12,223,170,158,251, 10, 1,252, 3,149,
+ 78,193,143,236, 37,239,230,238,238,174,227, 27, 15,255,165,179, 96,232,164, 48,119,180, 14,112, 3,151, 39, 68,110, 41,141,115,
+ 41,165,216,126, 49, 63, 75,107,100,198,165, 23,149, 39,186, 94, 69,157,112,250, 22, 60,206,132,151,151,215,245, 51,103,206,244,
+106,221,186, 53,105,235,240,110,137,149,103,153,222,226,112, 42,181,220,165, 75,151,232, 41, 83,166, 92, 45, 40, 40, 24, 92, 27,
+167,155,155,219, 47,119,238,220,121, 89,165, 82, 61, 33,168,108, 35,197, 91,206, 53, 26, 13,230,205,155,119,182,182, 45,120,220,
+221,221, 55,172, 95,191,254,189, 55,222,120,131,180,132,163,176, 61, 44,219, 5, 89, 14,131,193,128,221,187,119,155,190,250,234,
+171,175, 85, 42, 85,173, 83,135,129,129,129, 89,185,185,185,193,150, 80, 11,246, 4, 21, 13, 9, 9,201,123,252,248,113,208,211,
+228,124,129, 5, 87, 21,235,214, 51, 49, 77,112, 69,162,249,110, 82,207, 79,223,152,186,192, 59,164, 77, 59,194, 63,176, 25, 8,
+144, 40,200,207,193,227, 7,233,236,225,239,191, 41,214,148, 42, 62,211,106, 53,223,212,197,211, 17,104,211, 74,198,219,207,103,
+208, 30, 22, 1, 84,109,127,170, 39, 70, 28, 0, 12, 92,242,238,163, 50,227,228,148, 58,166,125, 44, 98,235,227,195,135,197,252,
+246,237,159, 8, 20,103, 50,153,160, 75, 77,197,198,233,211, 29, 22, 89, 46,184,224,130, 83,208, 26,245,199,200, 50,162, 50, 62,
+151,163, 22, 19, 34,212, 79, 50,153, 5, 38,145, 48,117, 33, 9,130, 79,179, 72, 3,139, 95,196,156,242, 45, 9,121,208,186,178,
+223, 46, 60,183,155, 74, 3,144,120,121,121,157,167, 40,170,165,197, 34, 99,107,173,175, 97, 67,233, 71, 5, 5, 5, 35, 0,212,
+181, 66,184,141,155,155,219, 55, 12,195,244,177,103, 83,105,138,162,110,148,149,149,205, 71, 29,155, 74, 55,197,170, 67,111,111,
+239,140,199,143, 31,183,177,172,162,182,237, 43,107, 90, 89,126,239,222, 61, 12, 25, 50,228,113,126,126,126,200,211,228,124, 94,
+ 81,203,170,195,231,199,162,101,131, 32,158, 64, 58,131, 47, 18, 14, 55, 25,233, 80, 16, 0,135,203,189,171,175,208, 94,208,105,
+213,187, 80,203,116,225,211,196, 68, 32, 92,192,231,255,194,147,201, 68, 53,137, 54, 99, 89,153, 86,167,215,143,116,137, 44, 23,
+ 92,112,193, 5, 23, 94, 32,180,247,242,242, 58,195,229,114, 5,182, 98,178,250,103, 11,104,154,174, 40, 42, 42, 26, 13, 32,237,
+ 41,115,254,111,194, 65, 39,181, 8,123, 57,205,199,144,231,157,179, 9,159,157,117, 34,231, 16, 51,231,242, 23, 36,157, 67,158,
+ 87, 78,203,243, 58,192, 27,225, 72, 57,114, 86,126,218,164,147,117,118, 58,155,138,211, 89,245,168,134,116,178, 77,240,222,151,
+191, 32,233, 28,242,188,113, 86, 47, 63,118,242, 58,196,105,103,153,114, 52,157,172,179,211,217, 84,156,141,173, 71,117,164,147,
+109,108, 89,170,229,221, 47,199, 11,136,228, 30, 96,147,123,128, 77,234, 89, 99,220,198,200,218,190,231,144, 35, 97, 83,173, 4,
+176,132,221, 55,243, 19,207, 43,167,109, 62, 56,115,171,128, 38,216,118,224,162,179, 57,171,229,167,179,176,220,188,194, 36, 22,
+118, 4, 28,117,228,217,157,241,222,171, 61,171, 83,120, 27, 32,178, 28,226,116, 86,185,111,106, 78,103,213,165,234,156,206, 40,
+247, 53,189,247, 38,124, 71,206, 74,167, 83,234, 82, 83,148,249, 26,202, 79,163,121,171,115, 58,163, 46, 85,231,116, 70,185,127,
+ 26,156,206,168, 75, 53,113, 58,163,220,215,246,238, 95, 84, 67,147,101,186,208, 28,226,129,176, 67,108, 69, 3, 0,217,144, 76,
+107, 66, 75,217, 80,103,115, 58, 59,205, 77, 33, 54, 29,176,192, 60,115, 78, 39,191,163,229,102, 78,103,142,110,134, 58,235, 29,
+ 53, 69,121,183,229,116, 22,127,117, 30,103,188,167,154, 56, 27,155,222, 90,210,233,244,103,111,108,185,127, 90,156, 78,126, 71,
+ 78,169, 75,213, 56,135, 58,121, 48, 48,212,230,124,185, 51, 57,157, 85,151,106, 72,103,163,223, 83, 77,156,141, 77,111, 45,233,
+116,250,179, 59,163, 15,105, 42,222,103,105,209, 98,201, 90,203, 68,116,181,227,169, 8,141,103, 54, 37,231, 32,247,159,138,211,
+193,233,153,136, 38,120,247,207, 52,157,206,228,172,158, 70,103, 78,247, 52,101, 58,157,201,233, 64, 90,255,116,156, 47,218,123,
+127, 30,243,179, 54,190,198, 76, 75,213,102, 29,109,138,116, 58,147,211, 78,238, 63, 5,103, 35,222,253,159, 14,156,231, 37, 33,
+150,140,119,242,200, 4, 78,182,192, 52,217,115, 59, 57,157, 67,155,194, 66,216, 4,112,122, 58,205, 35,229, 79,155,224,217, 95,
+148, 60,117,213, 37, 87, 93,122,238,234, 82,181, 50, 57,212,137,150, 34,167, 90,158,171,115, 58,227, 55,108, 57,156, 85, 70,155,
+250,217,157, 89,151,154,226,221,191,104,248,127,145,193,179,185, 29, 76,112,153, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130,
0};
diff --git a/source/blender/editors/datafiles/claystrips.png.c b/source/blender/editors/datafiles/claystrips.png.c
new file mode 100644
index 00000000000..b6ebc54ebb2
--- /dev/null
+++ b/source/blender/editors/datafiles/claystrips.png.c
@@ -0,0 +1,290 @@
+/* DataToC output of file <claystrips_png> */
+
+int datatoc_claystrips_png_size= 9087;
+char datatoc_claystrips_png[]= {
+137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 96, 0, 0, 0, 96, 8, 6, 0, 0, 0,226,152,
+119, 56, 0, 0, 0, 1,115, 82, 71, 66, 0,174,206, 28,233, 0, 0, 0, 6, 98, 75, 71, 68, 0,255, 0,255, 0,255,160,189,167,
+147, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 13,215, 0, 0, 13,215, 1, 66, 40,155,120, 0, 0, 0, 7,116, 73, 77, 69, 7,220,
+ 3, 18, 11, 2, 3,179,242, 79,233, 0, 0, 0, 25,116, 69, 88,116, 67,111,109,109,101,110,116, 0, 67,114,101, 97,116,101,100,
+ 32,119,105,116,104, 32, 71, 73, 77, 80, 87,129, 14, 23, 0, 0, 32, 0, 73, 68, 65, 84,120,218,237,125, 91,143, 37,199,113,230,
+ 87,153, 89, 85,231,214, 51,211,195, 33, 72, 13,181, 94,131, 67,137, 23,107, 13,138, 52, 47, 35,122, 73, 8, 16,236, 39, 61, 88,
+128, 40, 81,126,144, 4,239,171,254,131,159, 23,254, 27,122,149, 13,120, 33, 8,235, 39,173, 5,173,177, 90,136, 38, 69, 64,182,
+ 41,137,226,144,115, 35,102,166, 79,159, 91, 93, 51,115, 31, 42, 34, 39, 42, 79,158,230,202,242,202, 90,123, 26,104,244,189,186,
+ 42, 51, 50,226,139, 47,190,136,147, 1,240,120,240,246,175,246,166, 30, 44,193,131, 13,120,176, 1, 15,222, 30,108,192,131, 13,
+120,240,246, 96, 3, 30,108,192,131,183,223,252,155,249,109,186,153,233,108,134, 43, 79, 60, 1,103, 45,138,162,192,227,143, 63,
+142,178, 44,225,156,195,102,179,193,123,239,189, 55,250,253, 44,203,240,225,245,235, 56, 61, 57,121,176, 1,191,210,177,211, 26,
+ 90,107,124,226, 19,159,192,107,175,189,134,171, 87,175,226,145, 71, 31,133, 82,195,129,156,148, 37, 0,192, 57, 7,107, 45,148,
+ 82,225,103,222,123,120,239,195,231, 0,112,253,250,117,188,245,214, 91,248,251,183,222,194,141,235,215,113,227,198, 13,116, 93,
+ 7,248,223,254, 28, 51,251, 77,101,194, 58,207, 49,159,205,240,228, 83, 79,225,149, 87, 94,193,139, 47,190,136,135, 47, 93,130,
+115, 14, 93,215,193, 90,139,182,235, 0, 0, 69,158, 67, 41, 21, 22, 59,203, 50,104,173,145,101,217,104,241,189, 88, 96,185, 65,
+239,191,255, 62,190,251,221,239,226,199, 63,254, 49,238,220,185,131,174,109,255,253,110, 64, 94, 20,120,242,169,167,240,217,103,
+159,197,213,171, 87,113,229,202, 21,104,173,209,117, 29,156,115, 97, 33,123,107, 97,173, 13,139,169,149, 66,150,101,232,173, 69,
+145,231,208, 90,143,172,158,223,248,107,231,220,240,238, 61, 84,150,193, 58,135,147,123,247,240, 63,254,246,111,241,191,127,244,
+ 35,124,240,193, 7, 88,157,158,254,251,217,128,203,143, 61,134, 39, 62,245, 41,124,246,217,103,241,202, 31,254, 33, 30,190,116,
+105,180,232,236,195,121, 3,156,115,104,233, 36,104,173, 81,228,121,248,122, 62,155, 5, 11,143, 23, 94,158, 6,190,142,247, 30,
+150, 54, 68, 41,133,211,211, 83,252,253,155,111,226, 39,239,188,131,159,189,251, 46,174, 93,187,246, 91,227,158,254,197, 55,224,
+241, 43, 87,240,185,207,125, 14,207, 63,255, 60,254,227,239,254, 46,142,207,159, 71,219,117,240,222, 7, 95,206, 11,159,101, 89,
+176, 92,107, 45,250,190, 71,111, 45, 12,197,136,186,105, 96,173,197,185,163, 35,104,173,247, 22, 61,254,200, 27, 32, 55,193,210,
+201,106,154, 6,187,237, 22,215,174, 93,195,123,239,189,135, 55,223,124, 19,255,248, 15,255,240,111, 99, 3,102,243, 57,254,243,
+171,175,226,229,151, 94,194, 39, 63,249, 73, 92,190,124, 57,160, 23, 0,208, 90, 67,101,217,176, 80,145,213,242,231,206, 57,180,
+109,139,182,235,160,148,130,209, 26, 93,223, 3, 0, 22,243, 57,180,214,112,206, 33,203, 50,100,116, 45,190,190,116, 67,124, 45,
+107, 45, 44,197,151,158,174,211,180, 45,154,170, 66, 93,215, 56, 57, 57,193,187, 63,251, 25,254,219, 95,255,245,191,170,107,250,
+181, 54,224,252,241, 49,190,244, 39,127,130,171, 87,175,226,194,241, 49,142, 22,139, 96,229,222,123, 24, 99,194, 63,144,110, 39,
+203,178,251, 65,150,252, 54, 91,170,115, 14,125,223, 7,235, 85, 74, 97, 62,155,133, 83, 99,140, 9,127, 27,191,141, 92,144,181,
+104,218, 22,109,219,134,191,235,186, 14,117, 93,163,218,237,176,221,237,208,181, 45,150,167,167,184,121,227, 6,254,251,223,252,
+ 13,110,223,188,249,255,199, 6, 92,124,232, 33,124,227, 27,223,192, 75, 47,191,140,217,116, 58, 44, 52, 45, 44,163, 21,137, 88,
+ 84,150, 33, 19,238,199, 57, 7,103,109,248,199,210,109,100, 89,134,190,239,131,251, 49,198, 96, 82,150,240,222,163,235, 58,204,
+231,243,209,181, 83,110, 72,186,183,237,110, 23,126,191,235,186, 1,158, 2,232,105, 51,214,235, 53,178, 44, 67, 93,215,248,201,
+ 59,239,224,175,254,242, 47,127,163,168,233, 87,218,128,115,231,207,227,235, 95,255, 58,190,240,133, 47,160, 40,138, 17, 4,140,
+177,186, 86, 10, 16, 27,194,139, 12,239,225,163,127,204, 22,203, 39,196, 57,135,166,105,208,245, 61,138, 60, 15,238,172,239,123,
+204,102,179,189, 83, 21, 47,126,223,247,225,122, 50, 22,244,125, 31, 54,131, 97,111,181,221,226,206,157, 59,152, 76, 38,200,243,
+ 28,167,167,167,248,193, 15,126,128, 31,254,240,135,216,109,183,191, 29, 27,144, 23, 5,190,248,197, 47,226,171,111,188,129,243,
+231,206, 5, 95,204, 22,205,254, 89,126, 61,242,205,188,184, 2,201,132,197,243, 62,184, 32,185, 56,117,211,160,235, 58, 76,202,
+ 18,179,217, 44,248,245,233,116,186,247,247, 62,113, 10, 56,183,144, 27, 32,175,223,247,253,144,119,120,143,182,105,112,122,122,
+138,249,124, 62, 66, 91,255,248, 79,255,132,239,125,239,123,120,255,151,191, 68,211, 52,225, 57,126, 99, 27,144, 41,133,103, 63,
+251, 89,252,151, 63,251, 51,124,250,211,159, 30,225,116,233,207,179, 44, 11,110, 72,186,128, 44,203,194,131, 75,191,205, 65, 52,
+ 88, 45,197, 1,182,126,107, 45,218,182, 69,211,182,112,206, 97, 58,153,132,107,207,102,179,224,214,148, 64, 70,222,251,209,102,
+112, 80,103,100,197,247,237, 68, 96,230,251,104,219, 22,235,213, 10,219,237, 22,211,233, 20, 69, 81,192, 24, 3,173, 53,242,162,
+192,245, 15, 63,196,219,111,191,141,255,249,119,127,135,187,119,238, 96,179,217,192, 19, 0,248,127,182, 1,153, 82,248,210,151,
+190,132,175,253,233,159, 98, 49,159, 7, 24,201, 11,200,214,158, 17,181,192,139, 41,173,159, 79, 69,140,225, 99,183, 17,252, 63,
+ 16, 78, 3, 47, 82,219,117,152, 77,167, 97,115,138,162, 24,197,154, 17,158,167, 5,229,239,117,125,143,186,174,209,245, 61, 12,
+221, 87, 79,215,102, 3,225,141,170,171, 42, 24, 24, 7,110,109, 12, 84,150,161, 44, 75, 20,101,137,174,109,241,211,159,254, 20,
+ 63,121,231, 29,252,228,237,183,113,227,198,141, 95, 59,159, 72,110,128,210, 26, 95,254,242,151,241,213, 55,222,192,156,142, 63,
+ 47,120, 88,120,122, 88,249, 49, 14,142,177, 59,226, 13, 11, 27,112,192,255,243, 6,176, 43, 50, 90,195, 24, 19, 54, 32,143, 50,
+227,216,250,229, 6, 55, 77, 19,172,221, 82, 28,145,167,129,255, 23,103,209,174,239,177,221,110, 67,188, 97,247,202,107, 96,204,
+ 64,159,221,190,125, 27,255,235, 71, 63,194,219,111,189,133, 95,252,252,231,255,124,138, 6,192,159,199,139,255,250,235,175,227,
+245,175,124, 5,243,217, 44, 88,190, 49, 38,208, 3,169,119,185,232,108,245, 90, 88,190, 76,194,216, 90, 51,250,200,139,198,139,
+202,191,163,148, 2,188, 71, 71,176,148,131,120, 81, 20, 35, 67,144,159,103,156, 97, 39,178,102,118,135,241, 41,149,208,214,211,
+ 66,247,125,143,166,105,194,117, 84,244,236,179,217, 12, 79, 92,185,130, 79, 63,249, 36, 30,122,232, 33,156, 44,151,216,172,215,
+191,230, 6,100, 25,222,248,218,215,240,229,215, 95,199,185,163,163,224,219,195,113,167,223, 73,157, 2,249,181,116, 79,241,239,
+197,249, 64,240,231,226,154, 50,142,240, 27,199, 8,165, 20,138,162,216, 63, 1,194, 0,194,198,136,132,173,167,128, 44,145, 90,
+223,247,163,216,101, 9, 26,231,121, 14, 67,207,108,140, 65, 73,236, 44,111,162,124,198,249,124,142,199, 30,123, 12, 79, 63,253,
+ 52,202,201, 4, 63,255, 21, 79, 67,112, 65,231,206,159,199,183,190,245, 45,188,244,210, 75, 56, 90, 44, 70, 15,205,150, 42, 33,
+165, 92, 28, 25,116,247, 78,132,240,205,242,251,169,192,201,239,140, 82, 36, 69,225, 9, 45, 25,173, 49,159,207, 3, 12,150, 49,
+ 68, 34, 35,240,102, 18,199,180,217,110,135, 5,213, 58,184, 34,222, 80,201,200, 42,165,208, 81, 54,174,148,194,234,244, 20, 39,
+ 39, 39,184,120,241, 34,242, 60, 15,255,131, 93, 25,255,127, 0,168,235, 26,239,190,251, 46,190,253,237,111, 99,189, 90,253,223,
+159,128,231,158,123, 14,255,245, 47,254, 2, 87, 30,127, 28,139,249, 60, 4, 43,165, 84, 8,178,236,251,226,133,148, 46, 71, 90,
+112,216, 12,233,118,132,191,150,113, 32, 70, 70,242, 20,240, 3,202,235, 74, 43,142, 99, 83, 42, 47,136,239,155, 23,159,249, 37,
+134,171,236,218,188,247,232,218, 22,206,123,148,101,137,237,118, 59, 58,185,155,205, 38, 24, 4,159, 70,254,249,133, 11, 23,240,
+194, 11, 47,224,131,235,215,113,239,238,221,143,223,128,167,159,121,230,207,191,249,205,111, 6,254, 70,107, 13,107, 45,202,178,
+ 28, 61, 92,252, 32, 33,249, 74, 88,124, 88,244,136, 32,147,167, 73, 90,105,124, 50,100,102,172,148, 26, 78,129,181,200,201, 93,
+228, 84, 47,136, 93, 86,202, 29,202,205,224,235, 4, 74,131, 2, 51, 95, 83, 22,129, 44,185, 39,165, 20,202,162,192,122,189, 70,
+215,117, 48,198,224,252,133, 11, 35, 96, 16,146,204, 44,131,166,204,253,185,231,158, 3,128,143,117, 73,234,115, 87,175, 2, 64,
+ 88,112,107, 45,180, 82, 33,250, 75,146,139, 23, 94,243,194, 75, 11, 22,254, 44,184, 4,250,158, 34,107, 83,148, 29,139,149, 9,
+ 31,179,136, 39,210,145, 69,243,169,236,201, 37, 65, 4, 76,105,253, 35, 88, 43,232, 17, 25, 51,120,241,229,102, 72, 18, 47,203,
+ 50, 20,130,254,232,251, 30,199,199,199, 33, 22,236, 8, 37, 49,194,226,211, 83, 22, 5, 52,185, 52,231, 61, 62,255,249,207,227,
+ 43, 95,253, 42, 20,253,239,116, 73, 82, 36, 81,140, 8,140, 49,163, 84, 94, 30,113, 21, 33, 12, 9, 39,101, 80,221, 91,104,233,
+ 14,232,231, 50,176,203, 13,201,196,207, 37, 94,215, 90, 67,211,105,236,105,161,242, 40,248,142,114, 11, 50,160,140, 16,150, 12,
+206, 61, 17,127,177, 27,226,205,224, 4,174,169,107,204,230,115,180, 77, 3, 99, 12,150,203, 37, 38,147, 9,180,214, 40,203,114,
+244,127,229,198, 27,173, 97,180,198, 31,188,240, 2,178, 44,195,119,190,243, 29,180, 77,147, 40,207,146,181, 3,128, 86, 10, 5,
+ 5,154,192,102, 70,254, 62, 69, 39,179,149,239,185, 24,105,229, 7, 18,177,248,243,140, 16, 6,195, 94,165, 84,192,253,158, 32,
+105,211,182, 33, 96, 34,113, 63, 1,165,208,137,115,244, 51,166,185, 25,210,242,115,179,123,100,151, 35,223,172,181,232,187, 14,
+ 57,229, 31, 23, 47, 94,132,214, 26,211,233, 52,184, 66, 94,120,173, 53,114,226,174,216,131,216,190,199, 51,207, 60,131, 63,250,
+227, 63,134,206,243,253, 13,200,232, 2, 0,160,141, 9, 46, 68,137,239, 75, 50, 77, 50,156, 42,225,191,165,127, 15, 31,227,223,
+161, 19, 49,242,223, 34, 56,243, 38,168,136, 89,101, 43,141,171,106,242,132,166,226,129, 18,240,152, 51,237, 56,144, 75, 56,202,
+207,109,180,198,108, 62, 71,223,247, 3, 45,190, 88,160,156, 78,161,180,198,114,185, 28,242, 4,250,123, 25,136,229, 73,208, 4,
+ 99,255,224,249,231,241,218,107,175,141,248,176,160,138, 96,107,103,235,144,148, 3, 91,129, 60,194,217, 30,152, 77,159,146,189,
+ 19, 16,185,165, 24, 17,141,174, 67, 22, 37,173, 90,146,128,241,145,151,150, 31,111,146,220, 12, 43, 8,181, 80,165,163, 83, 34,
+ 51, 94, 6, 35,222,123, 56,186, 15, 38,239,182,155, 77, 72,214,202,178, 68,223,247,168,234, 26, 69,158, 7, 55,206,245,236,172,
+235,208, 57,135,178, 44,241,242, 75, 47,193, 89,139,239,127,255,251,193, 61, 42,208,131, 26, 99,194, 81,149, 55,109,173, 13,214,
+ 58, 90,124, 97,217, 18,117,248,120, 65,229,251,190, 15,186,191, 89, 7, 16,145,116, 29, 18, 81,197,185,200, 94, 18, 38, 3,179,
+176, 74, 25,180,115, 50, 58, 54, 50,118, 35, 50, 96, 51,147, 90,237,118,128,247,176,125, 31,114,130,158,104,139, 60,207, 81,144,
+123,153, 16,117,195, 44, 48,127,174,148,194,185,115,231,240,234,171,175,226,197, 23, 95, 20, 6, 67,255,144,143,184, 33,180, 50,
+ 98, 44, 19, 22, 31, 47,122,204,116,198, 27, 19,163,158, 56,136,199,144,213,138, 69,214, 74, 5,190, 62,150,160,200, 35, 31,223,
+ 71, 12, 85,131,175,167, 0, 25,200, 57, 66, 50,210,141,133, 4,144,138, 66,124, 42,202,201,100, 88,232,201, 4,198, 24,228,121,
+142,166,105, 80,148, 37,234,186,198,106,185, 68,158,231, 1,218, 22,101, 57, 32, 76, 65,217,191,242,202, 43,120,228,145, 71,216,
+149, 15,190,154,143, 78,236, 78,172,181,193,234, 51,177,248, 50,147, 77, 45,124, 42, 48, 38, 93, 81,180, 9, 1,182,146,213, 27,
+ 99,130,144,171, 20, 73,143, 68, 71,108,189, 41, 42, 67,210, 40,206,185, 16,216, 3,172,165,140,182,160, 69, 27,197, 0, 99, 48,
+153, 78, 81,148, 37, 76, 81, 12,240,211, 90,204,230,115, 76,166, 83,104,173,177, 94,175, 81,215, 53,118,219, 45,142,142,142,194,
+243, 44,142,142,134,196, 78, 84, 0, 45, 81, 34, 69, 81,224,229,171, 87,161,180,134,226,165,208, 34,121,226, 55, 46,223,177,107,
+ 10, 8, 72, 66, 60, 97,141,113, 54,187,151, 20, 69,112, 51,222, 8,127,192,189,177,159,150, 22,202, 11, 47,177,191, 20, 1,240,
+230, 72, 3,144,238,197,210,207,140, 49,131,239,142, 98,128, 68, 68,206, 57, 56,162,182, 79, 79, 78,144,231,121, 64, 64, 77,219,
+222,223,104,165,240,208,165, 75,104,219, 22,155,245,122,160,179, 5,146,155, 76, 38,152, 77,167,152, 78,167,184,112,254, 60, 62,
+243,153,207, 64, 5,151, 34,162,115,202,189,248,216,125, 36,104,135, 20, 85,145, 60, 5,188,192,156,128, 37,114, 10, 31,113, 68,
+188,128, 57,225,244,142,202,142,114,225,101,205, 89, 6,228,120,241, 89, 4,198, 11,220,245,125, 72,168,164, 2,143, 93,145,117,
+ 14, 74,107,204, 72,159,180, 89,175, 3,220, 60, 90, 44,134,210,105, 81,192,246, 61,218,166,193,100, 54, 27,174,217,117,152,204,
+102, 33,111,240,228, 90, 89,253,177,152,207, 15,171,163, 25, 10,202, 27, 98,182, 16,145,165,159, 85, 28, 63, 35, 9,216,183,252,
+ 67,247, 34,138,250,146,147,231,100, 43, 6, 8,169, 56, 36, 17,157, 44, 28,201,224, 44,197, 5, 18, 0,148, 69, 17,170,100,198,
+ 24,172, 86, 43,212,117,141,201,116,138,249,124, 14,219,247,216,108, 54,208, 68, 77,192,123, 44, 22, 11, 84, 85,133,122,183,187,
+ 15,169, 41,195,103, 99, 48,198,220,223,128, 81,150, 42,248,115,149, 58, 9, 7, 22, 54, 46,200,164, 24,208, 56, 14,248, 68,133,
+ 12,226, 84, 72, 84,195, 6, 97,164,139,161,251,180, 66,101,145,188,158,184,183,156, 54,144, 13,136,209,144, 44,234, 51, 97,199,
+155, 98, 5,162,241, 4, 69, 1,192, 20, 5,166,211,233, 80,212,161, 83, 85, 87, 21,156,181,152, 83, 37,209, 57,135,178, 40, 48,
+153, 76, 80,150, 37,114,170,234,121,112,127, 64,194, 69, 4,122,129,240,174,181,118,175, 40,157, 90,240, 36,250, 73, 36, 97,136,
+ 22,122, 47,120, 71,155,144, 58,101,172,148,144, 5,248,179, 72, 57, 41, 32, 96,229,134,230,228,140, 92, 25,187, 34,182,246,212,
+ 41, 41,203,114,168, 89, 55, 13,142, 22, 11, 28, 29, 29, 97,179,217, 12, 18, 23,165, 48,161, 18,170, 33, 55,197,155, 39, 11, 84,
+ 76,183, 27,196,148,177,120, 72,182, 58, 38,168,156,115, 67, 96, 57, 64, 46, 73, 42, 57,165,126, 56,116, 18,178, 68, 57,241,227,
+ 54,149, 23,107, 84, 44,250,152,205,226,123,147,226, 49, 9,101,165, 20,222, 11,177, 88,128,168,121, 14, 77, 39,162,109, 91, 44,
+ 79, 78,194, 38, 77,167, 83,116,125, 15,103, 45, 12,233, 90,251,190, 71, 78,238,139,107, 12,147,201, 4,206,251, 16,196, 21,179,
+138,225, 61,162, 3, 82, 5, 15, 31, 45,120,106, 19,246,172, 93, 34,161, 67,137, 89,164,112,115,194,237,201,148,223, 69, 52,134,
+ 22,185,139, 36,227,246, 42,111,130, 87,146,137, 22,187, 28, 94,252,160,206,163, 13,225,211, 16,199,141,245,122,141,147,123,247,
+ 80, 78, 38, 56, 62, 62,134,179, 22,155,205, 6,125,215,193, 8,101, 69, 57,153, 12, 65,154,174, 23,128, 68,215, 65, 33, 1,253,
+100,246, 40, 57, 32, 62, 54,103,249,217,189,120,146,250, 24, 37,101,238,128,202, 77,110,188,132,115,133,168, 7,200, 83,151,186,
+191, 44,170, 57,135,223, 37,106,187, 19,138,108,201,121, 41,165, 80,150,229,136, 41,182,214,162, 35,216, 57,153, 76,144, 41,133,
+187,119,239, 14,148,196,100, 18,146, 51,195, 37, 77,173,209,145, 52,134,121,173,166,105, 6, 24,107, 12,224,253,125, 24, 42,249,
+ 25,169, 84, 72, 21, 53,152,158,216,251,249, 33,173,140,116, 67, 18, 98,210,123,170,182,124,200,173,132,218, 2,163, 26, 82,209,
+ 85, 85,181, 39,222,149,174, 71,107, 29, 98,138,124,150, 44,203, 70,149, 48, 73, 71, 56,113, 58, 56, 54,228,100,217, 76,242,157,
+156,156, 96,181, 90, 97, 62,159,227,194,241,241,160, 73,173,235,251, 53, 11,239,135,216,153,101,152,206,102, 40,138, 98,168,180,
+145, 43, 50,114, 97,108, 92,120,161,155,222, 17, 49,181,231, 43,197,105,201, 82,137, 86,204,144,198,191,155,162, 57, 14, 72,207,
+195, 38, 9, 52,196,190, 56,203, 50,148,137, 26,177, 92,108,201,238,202,197,231, 24,199,207, 36,105, 25, 25, 3,216,215, 75,195,
+204,178, 12, 93,215,225,238,157, 59,120,248,225,135,199, 98, 1,231,144,211,198, 58,239,225,233,239,140, 49,104,182, 91, 56,231,
+ 80,215,181,128,161,226, 65,227,138, 23,223,164,132,161,214,218,225,194,241,226,127, 12,230,207, 82, 68,220, 25,180,197, 30,199,
+ 79,208,144, 51, 85,246,213, 92, 96,137,221, 97,138, 19,226, 86, 40, 22, 2,179, 8, 56,112,248, 66, 20, 16,171, 48,228,189, 24,
+ 99, 80, 78, 38, 88,173, 86,104,219, 22,147,201, 4, 71,231,206, 13, 39, 68,107, 52,117, 61, 64, 88,214, 29, 9,215,214,117, 29,
+202,162,184,223,164, 39,249,148, 56, 14,112,224, 83, 7,152,199, 36,245, 28, 23,102, 34,154,195,127, 76,226, 37, 73,183, 56, 31,
+144, 20, 68,219,182,129,117,116, 36,165,145,127, 31,171,239,228, 9,231,103, 27, 81, 14, 98,161,120,227,100,198, 45,101,244, 92,
+138,188,125,251, 54,238,221,189,139,163,163, 35,228,121,142,106,183,131, 39,133,181,230,120,165, 84,112,209, 92,176,209,198, 12,
+ 27,224, 36,121, 37,234,182, 25, 45, 24, 87,167, 98,110,197, 37,178, 80, 28, 42,208,124, 12,130, 58,132,166,226,160, 26, 47, 68,
+ 31, 89, 23,243, 70, 41, 88, 43, 23, 78,178,159,242,122,114,179,249,251, 49, 10,228,255, 83,150, 37,142,142,142,176, 94,173,176,
+ 92, 46,241, 24, 81, 18, 69, 89, 14, 25, 58, 9,203, 10,206, 5,178, 12, 93,211, 64, 41,133,182,235, 80, 87, 21,148, 39,127,197,
+ 21,160,192, 9, 37, 84,199,142, 45, 46,166,126, 15, 20, 92, 66, 16,162,119, 31,159, 32, 81,204,207, 14,104, 70, 37, 10,139,121,
+ 39, 99, 12, 12,249,126,185, 81, 62,186, 70,124, 93, 67,156, 18, 47,178,204,124,229,166,132,250, 46,209,206,129,132,227, 32, 76,
+144,114,177, 88,224,131, 15, 62,192,102,187, 69,145,231,152,207,231,208,198,160,239, 58,116, 84, 62,117,180, 30,225,228,101, 25,
+202,201, 4,134,143, 47, 43, 22,120, 51, 92,148, 84, 73,218, 90, 30, 99, 21, 87,185, 18,150,183, 39,212, 74, 48,160, 62,194,252,
+242,123, 82,101,237,163,250,174,166, 56,208,146, 66,129, 19,156,164, 4, 68,168, 61,152,144,235,163, 90, 64,236, 94,227, 46,204,
+174,239,209, 19,180,228,205, 45, 39, 19, 44,151, 75,220,187,115, 7,231,207,157, 27,130, 56,197, 22,254, 60, 47,138,128,176, 90,
+170, 31,228,198,192,120, 74,146, 88,135,153,114, 3, 28,136,186,174, 11, 13,119,225,253, 0,247, 63,242,223, 31,179,224, 72,180,
+ 48, 73, 12, 31,208, 11,113, 63,177,251,146,106,234, 84,117, 46,174,160,245, 36,127,103,186, 61,150,219,199, 20,119,208, 19,137,
+ 56, 25, 19,119,143, 60,250, 40,110,221,186,133,255,240, 59,191,131, 60,207, 49,157,205,194, 41,208, 81, 91,149, 22,140,174,145,
+ 62,109,100,185,194,255,115,214, 6, 0, 59,194,219,113,131, 92,172, 9,197, 33,138, 57,177,224, 42,209,184, 17,159,136,184, 3,
+ 82,234,254, 51,165, 70,253, 4,135,228,239,161, 51,134,122,199, 24,239,199, 89,116,252,191, 66,193,134,172,152, 99, 15,255, 77,
+211, 52, 88, 44, 22,120,255,151,191,196,127,250,253,223,199,241,133, 11, 35, 69,133,228,161, 24,113,221,231,130,168, 24, 35, 89,
+ 78, 25,148,229,162,177, 27, 96, 81, 43,136,172, 11, 15,113,198,130,199,139,157, 9,152,155, 90,236, 67, 27, 32, 85,212, 44, 87,
+ 47,242, 28, 59,234,255,146,192, 64, 26, 85,104, 87,165, 77,154,205,102, 48,132,238,228, 6,201, 66, 79, 74, 73,205,139,202,240,
+213,210, 61, 77, 72, 35,244,222, 47,126,129,201, 51,207,220, 87, 61,144, 75,148, 48,190,107,219, 80, 25, 51,153, 40,142,196, 90,
+ 77,169,112, 46,104,247,249, 98,206, 57, 40,194,206,129, 51, 74,248,254,176,224, 9,247,227, 18,139,140,132,208, 74, 6,217, 88,
+ 1, 97,140, 65, 81,150, 67, 79,153,176, 54,249, 55,142, 92, 84,219,182,208, 74,225,104,177, 8,113, 32,134,150,210, 35,196,174,
+136,117, 62,242,247,180,168, 45, 88,231,240,238,187,239,226,137, 79,125, 10, 57, 41, 36,156,247,128,240, 22,124, 10,114, 18,191,
+153, 61,205, 62, 91,126,148,177, 74, 78, 62, 21,148, 83, 46,200, 71,110,104,143,212, 59,227,116,140,126, 47,225, 86,164,236,144,
+147, 40,153,165,202, 92,161, 23, 69, 24, 54, 32,174,168,241,194,103, 66, 62, 25,187,174, 17,157,109, 12, 50,239,161, 68,166,204,
+235,178,152,207,177, 90,173,198,144, 85, 92, 87, 54,186, 56,242, 38,102, 68, 31,167,168, 1,162, 40,194,142, 43, 21, 84, 4,163,
+230,139,196, 73, 58, 52, 88, 35,213, 97, 19,147,112, 92, 89,114,145, 79,142,185,253, 92,244, 14, 75,221,191,188,127,166, 45,152,
+120,235, 5,197, 32, 75,149,177,223,143, 51,234, 80, 21,164,191,239,186, 14, 77,211,160,105,154, 16,212, 79,150,203,144,224,177,
+120, 87,214, 21,248, 36,122, 42, 12,153, 84, 6,155, 69, 5,114, 45, 52, 57, 82, 27, 31,138,206,146,204, 59, 64, 45, 28, 90,112,
+217,221, 46,239,197, 31,112,101,210,138, 36, 69, 13, 0,109,211, 12,165,194,201,228,254,105, 98, 45, 41,185, 14, 41,187,148,126,
+ 61,238, 49,142, 79,162,244,255,177,122,155, 81,207,209,209, 17,250, 15, 62, 64, 83,215,161,227, 50,206,101,164,235,180, 28,132,
+ 71, 42, 4,153, 92, 69,228, 26, 31, 85, 57,116, 67,138,159, 14,185, 22, 28,192,250,201, 77,226,251,144, 10,140, 3, 39, 71, 42,
+159,165,133,199, 56, 62, 14,172,103,125, 95,102,220,123,201,160,115, 48,121,126, 63, 87, 34,235,230,161, 34, 69, 81,192, 59,135,
+ 15, 63,252, 16,231, 47, 92, 24,209,229,220, 80, 50,146, 87,134, 13, 72, 80, 5, 35,249,160, 56,158,220, 65,210,117,221, 72,174,
+120, 22, 71,116, 40, 43,141, 33,104,170, 40,147,186, 70,140,215, 89, 4, 85,215,117,128,206,177,245,202, 19,196,165, 65, 43, 71,
+ 38, 68,150, 30,171, 45, 70,136, 42,203,224,100, 7, 15,117,221,111,169,177,251,218,181,107,120,242,169,167, 70, 48,151, 79, 67,
+181,219,161, 33,165,117, 81,150,247,201, 56,159,232, 78,137, 31, 66, 50,145, 93,223, 67, 19, 22,102,153,246, 89, 45,168,169, 90,
+109, 60,128, 73,138,189, 92,130,142,136,143,190,164,152, 21, 41,147,229,181, 36, 39, 31,199, 14,105,137, 49, 18,226,153, 67,113,
+126, 98,157, 11,254,159,107,209,252,222, 52, 13, 50,165, 48,155,207,113,235,214,173, 80, 46,141, 93,119,215,117, 65, 35,148,101,
+ 25,140, 79, 80, 6, 18,130, 58,241, 51, 14,118,121,158,163,109,219, 32, 99,148,141,124,177,111,151,232,232,172,138,215, 33, 42,
+ 34, 94, 56,230,105,226,241, 8, 69, 81,160,239,186, 97, 34, 10, 17, 94,210,144,120, 88, 71, 32,217, 36,161, 39,146, 58,173, 20,
+242,168, 1,208, 18, 32, 96, 8,202,198,200, 45,179,252,183,214, 90,108,214,107,220,254,232,163,209,224, 17, 94, 35,126, 30,110,
+ 32,183,214,194,100, 17, 93, 32,231, 56,248, 51,132,183, 93,215,193, 79, 38,201, 62,223, 67, 62, 53, 85,108, 65,164,162, 59, 43,
+ 35,150,238, 39,190, 78,128,151,130, 42, 1,117, 60, 74,216, 39,209,140, 76,236,228,233, 25,157, 56,225,158,117,158, 67,115, 25,
+149, 54,206, 90,139,150,144, 80, 85, 85,216,237,118,216,110, 54,232,218, 54,120, 6, 54, 28,107, 45,170,170, 66,219,182, 65,216,
+101, 82,130,172, 24, 13,113,207, 20, 39, 27,198, 24, 84,117, 61,238,255,194,253, 97,124,123,149,169,152, 9,149,138, 8,225, 91,
+ 15,117, 77,198,244, 64,223,247,131,178, 32,106,168,208, 90,135, 69, 97,171, 15,240, 79,148, 22, 57, 27,150,113, 33, 84,192,200,
+218, 37,157, 30,126,207,251, 80, 92, 97,119,210,118, 29,218,166, 25,180, 63,147, 9, 46, 28, 31,227,198,205,155,161,206, 44,103,
+ 87,180, 77, 3,109, 12,102,116, 95, 74,169,241, 6,248,216,250,152, 67, 23, 41,183,247,126,208, 82, 82,243,116,198, 52, 46,245,
+ 79, 37,229,138,169,158, 2, 81, 71,254, 56, 58,226, 80,153, 82, 6,114,206, 60,251,168,143,215,139,209, 7, 65,102, 40, 40,231,
+152, 82, 80, 66,166, 51,218,120, 25, 35,200,133,177,112,184,200,243,208,216,200,242,245, 15, 63,252, 16,199, 23, 47,142, 59,112,
+138, 2,166,239,131,166,200, 89, 59,176,161,158,118, 55, 5, 23, 67, 11,191, 96, 19,181,214, 80,100,109,140, 58,152,214,149,250,
+202, 84, 11,145, 44,222,251, 68,118,123,168, 56, 51, 98, 69,163,123,149,174,164, 35, 74,194, 8,245,155,204, 29, 0,160, 21,215,
+ 9,106,139, 4,112,224,160, 27, 43, 51, 36,213,209,247, 61, 90, 49,157,171,105, 26,120,231,112,235,214, 45, 60,243,123,191, 55,
+122,182,190,109, 81, 85, 85, 72,220,192, 65, 56,149,132,200,250,111, 28, 0, 57,203, 99, 40,154, 42,130, 39,191, 78,212,129, 67,
+162, 37, 78,139, 63, 35, 72, 75, 50,142,239,131,181, 62, 60, 23, 78,206,130,144,127, 35,185,127, 41,191, 31, 37, 90,214,194, 69,
+153,126,220,155, 44, 93, 22,103,182, 93,215,161,170, 42, 84, 85, 5, 0, 88, 46,151, 1, 9,113,204,100,174, 42,232, 76,181, 30,
+130,112,150,104,184, 8, 86,168,212, 64, 38,209,226, 51,146, 48,198,132,169, 34,241, 28, 55,159,144, 29,142, 18, 44,105,233,226,
+ 4,166,170, 95,103, 13, 4,137,169,137, 64, 15,183,109,208,101,114,192,147,194, 94, 69, 49, 65,142, 55,235, 73,205,236, 19,160,
+ 96,143,144,163,133,103, 5,116,136, 5,228, 90, 0, 96,183,219, 5, 99,181,148,116,113,214, 94,215, 53,106, 10,220, 6,114,192,
+197, 33, 26, 88,164,242,124, 81, 46, 62,199,110, 32, 38,157, 70, 13, 29, 9,154, 34, 86, 50, 28,170, 13,140,240,184, 64, 48, 28,
+236,248,235, 78, 44,196,174,170, 70, 67, 96, 99,215,193, 69, 28,110,178, 54,220,172,205,255, 87,248,252,216, 75,132, 46, 24, 99,
+ 6,139,110, 26,104,165, 80, 85, 21,238,221,187,135,205,118, 59,140,101, 35,218,158, 71, 25, 44,151, 75,236,170,106,168, 19,100,
+217, 16, 3, 36, 39, 62,202, 62,197, 64,189,216,205,140,228,125, 20,248,242, 60, 15, 69,253, 20, 17,151,154,148, 24, 99,252,179,
+ 20,114, 50, 75,149,115, 65,165,206, 7, 0,214,171,213,168,173, 40,238,176,148,195,252,130,242,193,185, 17,207,115, 72,161, 33,
+239, 37, 19, 94,161,109,219, 1,130,110,183, 33, 64,243,243, 54,117,141,213,106,133,211,211,211, 97, 38, 42, 53,117, 59,231, 96,
+ 88, 19,106, 83,202,231,104,113,184,154,196,197,232,140, 38,224, 26, 99,144,115,122, 79,169,126, 38, 10, 59,135, 84, 5,114,254,
+ 68,204, 66,166, 80, 79,120,120,177, 25, 13, 85,182,164, 74,186,109, 91,204,154, 6,115,154,123, 17, 10,239,236, 58,200,141,142,
+148,207, 89, 6, 37, 79, 0, 97,253, 61, 8, 76,168,176,237,186,161, 48, 67, 16,157,209,215,116, 58,133,202,178,209,224,191,134,
+ 96,234,185,115,231,208,118, 29,182,155, 13, 60,157, 86,195,205, 3, 18, 53, 72,109,103, 70, 15, 44,131, 72,128,127,162,237, 83,
+182,129,198,104, 37, 37, 57,116, 9, 25, 99,138,157, 60, 36,212, 98,203,231,222, 49,214,247, 79,167, 83, 84,116,196,251,190, 71,
+ 79,238,169,161, 5,145, 67, 58,226, 96, 45,179, 94, 47, 44, 93,198, 9, 43, 50,102, 93,150, 40,200, 61,183,212, 31,160,133,218,
+ 66,150, 79,101,207,242,108, 54,195,116, 58, 29, 88, 89,151,168,127,166, 70,199,112,242,163, 4, 21,192,124,183,244,197,204,121,
+200, 38,185,184, 74, 21,187,186, 56,144,230,162, 91, 63, 62, 33,222,123,100,162,200, 18, 55,228,149,147, 9,106,202, 74,243,162,
+ 8,147,216, 75,146, 9, 90, 49,111, 66,142,196, 57,132,245, 33,122,232,242, 60, 15,149,193,160,172,238,186,161,217,142,202,180,
+ 70,107, 76, 72, 45,119,243,230, 77, 92,190,124, 57,244, 19,179, 27, 83, 74, 97,181, 90, 81, 16,142,230, 56, 28,122,240,216, 63,
+243, 6,236,104,214,154, 34,157,166, 84,154,197, 11, 61,154, 57, 17,181,154, 30,146, 35,198,138,181,152,195,145,115,126,120,224,
+171,119, 14, 29,249,232,197, 98, 17,166,162,240,201,130,208,185,118,125, 31,178,219,152,140,211,137, 33, 32, 18,140, 72,151,215,
+182, 45,170,186,198,233,106, 53,140,177,161, 38, 14, 83, 20, 56, 71, 82, 21,134,171,203,229, 18,119,239,222,189, 79, 71,103,130,
+110,149, 92,121, 44,247,102, 9,139, 76, 76, 60,249, 85,173, 53,244, 25, 52,115,236,223, 15,113,239,113,160,142,121,168,184,101,
+ 41,110,228, 54,132,208,118,187,221,125,242, 75,184, 79,166, 36,100, 37,207, 71, 19,192, 98,191, 31,244, 61,226, 99,252, 51,174,
+ 22,206,166, 83,180, 77,131, 13,117,203, 24,173,209, 91, 27,166, 50,158,158,158, 98,181, 90, 13,227,119,138,130,116, 65,137,102,
+231, 94, 8,139,226,214,211,184, 27,134, 79, 0, 79, 52, 60,212, 47, 48,154,173, 35,160,175, 60,154,103,149, 49,189,247,208,228,
+ 71,157,184,159, 82,184, 5, 9, 26,154,186, 30, 70, 21, 19,111,197, 99,243, 57, 65,146, 42,235, 56, 33, 11, 68, 28,183,226,138,
+210,226,168,154, 70,110,136,131,112,215,117,129,202,168,118, 59,244,214, 98,117,122,138,187,119,239,162,170,170,209,240, 39, 0,
+ 48,177,168, 41,142, 7,169,252, 32,158, 86, 37,253,187,236,170,145,200, 74,102,159,169,215, 2, 72, 9,114,247,180, 64, 66,197,
+ 16,183, 20,197,243,133,186,174,195,122,189,198,226,232, 8,206,185, 16, 87,164, 27,100, 96, 97, 69,112,149, 60,146,146,185,144,
+ 82, 1, 21, 73, 57, 35, 67, 80,102, 66,119,187, 29, 90,106,194,240,222,163,169,170, 1,251,239,118, 3,253,192, 11, 79,109,171,
+134,103,107, 86, 85, 53,170, 36,237,233,242, 19, 83,173,138, 60, 15, 29,127,220,255, 42, 45,112,111,100,101,170, 67, 62, 66, 62,
+ 54,130,163,146,204,138, 55, 48, 12,141, 37,183, 35, 55,191,216,110, 3, 53,205, 57,129,108,194,147, 61, 16, 78, 36,115, 49,239,
+100, 5, 76,239, 89, 19, 36,160,167,167, 56, 18, 42,113,194,149, 43,165,176,221,110,177, 60, 61, 69, 79,241,130, 65,202,108, 54,
+195, 29, 0,134,199,206,112,144,136, 27,216,226,114, 99, 56,150,212,104,198, 68,156, 21,115,255, 83,243,219, 82,197,239,100, 91,
+ 83,162,150,156,211, 32, 17,185,153,114,100,129,142, 38,232, 50, 49,198,247, 50,165, 70,105,134,162,220, 25,207,227,102, 92, 20,
+216,153, 29,117, 18, 98, 83,188, 40,138, 2, 37, 25, 28,215, 4,154,166, 65, 77,133, 22,166,237, 37, 34,156, 77,167, 88,139, 17,
+104,114, 8,136, 97, 30,166,166,155,145, 74, 3, 45,146,171,152,254,149, 11,196,101, 74,105, 57, 49,172,149,110,202,201,169,234,
+137, 18,165, 84, 39,247,180, 24,135,200,185, 0, 93, 69,230,217, 19,223,239,196,160,214,158,104, 96, 54, 34,118, 33,150, 78, 68,
+ 75, 42,230, 64,222, 81, 0,149, 30,129, 45,158,239,131, 93, 55,187,177,134, 42, 93, 28, 23, 23,139, 5,154,166, 25, 32,103,219,
+142,158,183, 38,137,167,201, 34,157,191,148,242,201,241, 91, 49, 38,150,141,211,220,115,107,157,131,141,212,105,241, 34,203,210,
+165, 75,100,224,136,168,241,148, 80, 86, 14,214, 11, 83, 94, 40, 39,225,124,132, 19, 29,231, 28,118, 84,133,226,134, 10,182,218,
+174,239, 7,164, 98, 76, 24, 16, 46, 27,181, 37,241, 22, 98, 16,137,186,156,152,184,107, 73, 49,199,243,172,229,218,221,188,121,
+115,232,134,164,252,198,121,143,135, 46, 94, 28, 10,248,222,195, 88,145,112,100,162, 1, 46,158, 40, 37,221, 4, 19, 81, 33, 23,
+216,237, 6, 58, 66,140, 56,139,149,205,161,199, 76, 10,186,162, 65, 73, 41,169, 74,170,211, 61,116,184, 16, 58,145,253,107,252,
+ 55, 21,229, 39,211,233, 20,117, 85, 13,155, 50,155,161,164, 97,124, 44, 19, 9, 98, 45,242,233,188,169, 41,151,169,178, 12,208,
+ 26, 69,150, 1,162, 9,187,110, 26,212, 44,117,167,198, 12,118,207, 60,131,154,217, 80,103, 45,214,155, 13, 86, 12, 83,229,172,
+184, 84,159,173,117, 14,153, 88, 32, 89,233, 79, 77,175,141, 19, 23, 89, 73,219, 75,232, 68, 16, 5,171,211, 18,101, 72,159, 16,
+208, 6, 20, 70,228, 22, 43, 29, 24,217,176, 75, 89,173,215,152, 76, 38,184,120,241, 98,200, 98, 59,145,120, 49,101, 33, 11,229,
+ 41, 5, 30,183, 24,197,131,101,123, 58, 13, 25, 53, 92,120,239, 3,236,237,186, 14, 91, 2, 3,114,192,121, 77, 53,135, 48,178,
+140,253,219,161,196, 72, 90,117, 30, 77, 84, 12, 13,208,162,254,170,196, 64,138, 34, 33,251,142,133,185,253,129,222,227, 84,151,
+140, 44,148,123,231,144, 69,136, 43, 52, 67, 83,137,210,146, 85,242,230,196,226,168, 64, 97,208, 96, 37, 38,207,100, 64,102,244,
+ 35, 3,243,136, 92,164,231,204,148, 66,181,219, 13,100,156,181, 88,158,158, 66,122, 24,118,199,125,223,135,154,136,225,116,156,
+253, 92,140,201,229, 6,104, 65,218,133, 14,114, 94,104,178, 66,153,170,167,134, 55, 73,168, 25,187,158,148,184, 75,139,137, 94,
+113, 60,104,187, 14,158, 94, 33,169,174,235,208, 14, 84, 85, 21, 86,171, 21, 54,155, 13,242, 60,199,165, 75,151, 48,159,207, 71,
+250,165,208,124, 40,220,140,156,148, 30,247, 7,199, 39, 53, 32, 25,154,170,213, 52, 13,118,187, 93, 64, 90,121, 81, 4, 84,196,
+ 11,239, 40,145,148,242,124,195, 71, 72,214,114, 83,178, 18,217, 42,100,157, 67, 30,213,129, 25,246,229,121, 30,220,128, 19,181,
+130, 67,139, 28,143, 68,142,171, 93,169, 19, 32, 5, 82,172, 81,229,216,210, 52, 13,150,203, 37, 78, 78, 78,208,117, 29, 46, 94,
+188, 56, 12, 93, 37, 40,106,133,134,167, 35, 14,135,221,149, 49, 6, 77,219,134,110,120,110,196, 75,161, 58, 70, 87, 46, 86, 0,
+138,211,188, 38, 94, 40, 12,152,141, 84,223,148,144,233, 32, 39,137,219,126, 98, 55,196, 62,212, 8,139,151,189,183,123,170,103,
+ 65, 87, 28, 74,232,112, 70,149, 44,165,170, 11,121,138,214,208, 98,180,152,115, 14,125,219, 34,163,225,120,109,219, 98,179,217,
+224,248,248, 24,115,122,117,167,160,140,176, 22, 53,189,156,149,148,184, 48,244,118,226, 36, 4,119, 41,220, 88, 72,196,200, 69,
+ 49, 28,237,173, 13, 52,132, 38, 68,228, 4, 64,224,156, 41, 52,197,132,177,149, 2, 47, 75,210, 73,106,230,181,214,152, 16,165,
+ 26, 6, 94,136, 5,110,154, 38, 28, 83, 62, 9,121,180,152,146, 74, 72,225,250, 67,172,169, 68, 97, 35, 53, 91,215,193,208,189,
+ 48, 85, 60,235,123,108,214,107, 44,151, 75, 84,117,141,123,247,238, 97, 58,157,134, 23, 99,144,167, 74,206, 2,226,225,123,117,
+ 93,135, 83,145, 2, 14, 1,189,113,114, 38, 80, 98,156, 72, 90,154, 17,225, 5, 69,195, 49,131, 73, 77, 99,173, 69,211,117,168,
+118, 59,100,212,190, 41,135, 99,243, 8,128,120,138,148, 28,214, 23, 72, 42, 57, 12, 67,104,244,229, 72,176, 67,228, 94,234, 53,
+ 6,124,244,114, 38, 78, 36, 74, 74, 41, 24,106, 27,229, 69,109,154, 6,203,147, 19,172,214,107,220,190,125, 27, 77, 93,163, 41,
+ 75,172,215,235,144, 27,152,162, 0, 8, 5, 49,133,109, 8,159, 91,138, 11,204,221,239,197, 29, 81,168, 41,138, 2,104, 91, 52,
+ 20, 63,131, 52, 38,234,182, 12, 74,136,178, 12,192, 67,139,193,230,198,211,241,155, 76,167,123, 67,241,120, 40, 29,143,237,226,
+197,142,199,126,133,151,158,162,122,192, 89,242,148,184, 6, 28, 47,184,172, 64,133, 90, 52,161, 29, 67, 80,153,135,162,246,212,
+ 37,223, 25,131,150, 94, 29,239,206,157, 59,216, 85, 21,234,166, 65, 57,153,224,233,167,159,198,165,135, 31, 30, 93,191,205, 50,
+228,100, 88,204,224, 86, 85, 53,212, 13,120,146,138,128,164,204, 7,201,207, 57, 25, 11,191, 39, 74,152,153, 82,152,208,164, 21,
+103,109, 56, 5,108,253,204,157,193,123, 42, 73, 10,171,149, 40, 33,206,140,115,177, 0,241, 20, 90,153,213,198, 69,153,152,138,
+ 24,189, 40, 67,162, 22,124,232,149, 50, 70, 42,102, 81,171,104,182, 91,108, 54, 27,236,126,171,177,119, 0, 0, 2,206, 73, 68,
+ 65, 84,118, 59,228,121,142, 25,128,106,183,195,148, 70,200, 72,132,199,125,190,146,130,150,180, 2, 15,212,107,232,197,127,216,
+247, 59, 41, 40,227, 53,145,129, 89,142,244,177, 22,179,217, 12, 43, 10,194,185,156, 44, 73,180, 8,195, 83,211,117, 29, 26, 78,
+ 92, 68,237,210,123, 31, 38, 99,121,162,115,195, 28,207,104,248,133,161,105, 80,188, 73,129,150, 16,173, 64, 41, 69, 68,220,123,
+155,137,121,112,161,205,147, 11,222,252,114, 87, 81,128,102, 56,185, 88, 44, 70,254, 27,192,240,170,123, 98,182, 4,128,176,113,
+210,184, 24, 5, 5,185,137, 40,164, 56, 81, 27,224,207,101,125, 92,146,117,153,112,171, 53, 21,226, 83,221, 65,124,221,193, 5,
+ 17,127, 35, 19, 12, 69, 11, 33,155,203,100,191,112,140,203, 25, 31, 55,162, 90,212, 11,148, 32, 37,126,178,217,205,104,141, 76,
+136, 1,248,232, 59, 33,131, 73,141, 39,230,205,110, 9,245,116,109,139, 83,122,169, 17, 69, 10, 57, 69, 90,125,153,179, 56, 42,
+158,112,220,200,148, 10, 35,229,249,101,170, 88, 11,203,229, 67,153,187,184,232,217,246, 52,174,194, 32,184,198,192,181,228, 76,
+180,114, 57, 58, 81, 25, 48, 52,233,105, 10,104, 0, 6, 13, 60,177,126,124, 51, 74,142,174,164, 28, 64,186, 25,249, 66,155,124,
+131,187,170, 66, 71, 86,176,247,138, 71, 52, 67, 39, 12, 1, 20, 15, 16,203, 87,226,124, 36,188,200, 27, 33,150,144,132,209, 98,
+201,226, 74, 93, 85, 88,158,156,132,105,133,172, 96,227,190,134,150,192, 7, 23,108,182,219,237,208,110,196,197, 22, 97, 12, 46,
+114, 53,146,154, 72, 17,137, 18,150, 50,114, 98,113,150,117, 46,240, 96, 33, 19,102, 77,165,124,117, 33, 14, 80,101, 89, 98, 50,
+153,132, 1,213,169, 49,241,178,148,201,242,188,188, 44, 71,163,123,101, 33, 91, 74,202,195, 56, 74, 17, 99,152, 70,144,245, 87,
+230,107,120,209, 55,155,205,200, 18,173,152,232,251,232,163,143,226,242,229,203,152,209, 75,225, 90,231, 0,122,105,196,160,164,
+163,211,204, 19,208,121,174,167, 87,106,152,243,198, 69,123,218,144,150,105,110, 97, 48,225,100, 18, 49,168, 34, 96,161,201,224,
+216, 21,247, 17, 41,105,186,174,195, 71, 31,125,116, 95,116,171,245,253, 57, 65,121, 14, 80,225,165, 44,138, 33,251,229,128,196,
+ 92, 12,249, 75,134,109, 85, 85, 13, 20, 65,228,171,227,217,211, 18, 59,143,116, 68,209, 76, 33,239,253,160,191,140, 40,226, 94,
+ 8,104,229,171, 44, 49, 50, 89,204,231,120,255,253,247, 67,158,192,244,181, 38,151,215, 81,198,203,226,179,166,174, 67,241,158,
+101, 36, 77,211,160, 37, 94,200, 37, 12,110,143, 32,228, 87,103,162,181,104,154, 38, 12,238,246,228,254, 60,185,160,170,174, 7,
+ 20, 84,148, 37, 86,171,213,240,178, 75, 50,173,150,252, 63, 89,167,162, 76, 81,186, 19,185,192, 76, 90,181,109, 59,200,252,132,
+164, 59,140, 50, 16,175,178, 33,199, 9,164, 50,229, 84,214,204,110,145,255,215,150,168,240,176,168,125,143,140, 90, 86, 89,168,
+165, 8, 20,100, 81, 39, 13,191,122,119, 71,214, 45,135,175, 42,238,135, 38, 35,203,164, 98, 46,158,125, 23,189, 46, 50,207, 34,
+109,154, 38,232,146,156, 76,112,133,225,253, 31, 32, 1, 67,246, 69,185,191,176, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130,
+ 0};
+
diff --git a/source/blender/editors/datafiles/startup.blend.c b/source/blender/editors/datafiles/startup.blend.c
index 39918eb5ddc..0dcc7a1de3f 100644
--- a/source/blender/editors/datafiles/startup.blend.c
+++ b/source/blender/editors/datafiles/startup.blend.c
@@ -1,12 +1,12 @@
/* DataToC output of file <startup_blend> */
-int datatoc_startup_blend_size= 354920;
+int datatoc_startup_blend_size= 358796;
char datatoc_startup_blend[]= {
- 66, 76, 69, 78, 68, 69, 82, 45,
-118, 50, 54, 50, 82, 69, 78, 68, 32, 0, 0, 0,176, 9,186, 42,255,127, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
-250, 0, 0, 0, 83, 99,101,110,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 76, 79, 66,
- 48, 4, 0, 0,176, 5,186, 42,255,127, 0, 0,217, 0, 0, 0, 1, 0, 0, 0, 32, 32, 32, 48, 0, 0, 0, 0,250, 0, 0, 0,
- 1, 0, 0, 1, 8,136, 43, 5, 0, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 0, 16, 0, 0,128, 32, 4, 0, 14,174, 0, 0,
+ 66, 76, 69, 78, 68, 69, 82, 45,118, 50, 54, 50,
+ 82, 69, 78, 68, 32, 0, 0, 0, 56,211, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0,
+ 83, 99,101,110,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 76, 79, 66, 48, 4, 0, 0,
+224,206, 35, 0, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 32, 32, 32, 51, 3, 0, 0, 0,250, 0, 0, 0, 1, 0, 0, 1,
+248, 9,215, 3, 0, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 0, 16, 0, 0,128, 32, 4, 0,126,176, 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, 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, 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, 0, 0, 0, 0, 0, 0,
@@ -39,1149 +39,1156 @@ char datatoc_startup_blend[]= {
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,
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,
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,
- 0, 0, 0, 0, 87, 77, 0, 0, 88, 1, 0, 0, 24,181, 42, 5, 0, 0, 0, 0,147, 1, 0, 0, 1, 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, 0, 0, 0, 87, 77, 87,105,
-110, 77, 97,110, 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, 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,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,133, 42, 5, 0, 0, 0, 0,136,133, 42, 5,
- 0, 0, 0, 0,136,133, 42, 5, 0, 0, 0, 0,136,133, 42, 5, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 88,158, 53, 76,
-130,127, 0, 0,184,237,138, 77,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,156,146, 77,
-130,127, 0, 0,104,221,149, 77,130,127, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 2, 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,168,148,145, 77,130,127, 0, 0,168,148,145, 77,
-130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 39, 0, 76,130,127, 0, 0,120, 34, 0, 76,
-130,127, 0, 0, 88, 39, 0, 76,130,127, 0, 0,232, 35, 0, 76,130,127, 0, 0,120, 34, 0, 76,130,127, 0, 0,136,109, 7, 76,
-130,127, 0, 0,136,109, 7, 76,130,127, 0, 0,136,109, 7, 76,130,127, 0, 0, 68, 65, 84, 65, 0, 1, 0, 0,136,133, 42, 5,
- 0, 0, 0, 0,148, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,111, 7, 76,
-130,127, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 8,136, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,115, 99,114,101,
-101,110, 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, 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, 2, 5,108, 1,
-252, 4,181, 2, 0, 0, 0, 0, 1, 0,238, 3, 0, 0, 0, 0, 1, 0, 0, 0,232,185, 53, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,248,232, 53, 76,130,127, 0, 0,104,181,145, 77,
-130,127, 0, 0,104,181,145, 77,130,127, 0, 0, 88,187, 53, 76,130,127, 0, 0,104,160, 53, 76,130,127, 0, 0, 8, 11,185, 77,
-130,127, 0, 0, 8,162, 53, 76,130,127, 0, 0, 40,188, 53, 76,130,127, 0, 0, 8,249, 53, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 78, 0, 0, 8, 1, 0, 0,184,182, 42, 5, 0, 0, 0, 0,211, 0, 0, 0,
- 1, 0, 0, 0,136, 27, 43, 5, 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, 83, 82, 65,110,105,109, 97,116,105,111,110, 0, 46, 48, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,184, 42, 5,
- 0, 0, 0, 0,120,191, 42, 5, 0, 0, 0, 0,232,191, 42, 5, 0, 0, 0, 0, 40,204, 42, 5, 0, 0, 0, 0,152,204, 42, 5,
- 0, 0, 0, 0,184, 17, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 8,184, 42, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0,120,184, 42, 5, 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, 68, 65, 84, 65, 32, 0, 0, 0,120,184, 42, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,232,184, 42, 5,
- 0, 0, 0, 0, 8,184, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,222, 2, 0, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0,232,184, 42, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 88,185, 42, 5, 0, 0, 0, 0,120,184, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4,222, 2, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 88,185, 42, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,200,185, 42, 5, 0, 0, 0, 0,232,184, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,240, 4, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,200,185, 42, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0, 56,186, 42, 5, 0, 0, 0, 0, 88,185, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,195, 2,
- 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 56,186, 42, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,168,186, 42, 5,
- 0, 0, 0, 0,200,185, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4,195, 2, 1, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0,168,186, 42, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 24,187, 42, 5, 0, 0, 0, 0, 56,186, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 4, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 24,187, 42, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,136,187, 42, 5, 0, 0, 0, 0,168,186, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 24, 4,195, 2, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,136,187, 42, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0,248,187, 42, 5, 0, 0, 0, 0, 24,187, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 4, 60, 1,
- 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,248,187, 42, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,104,188, 42, 5,
- 0, 0, 0, 0,136,187, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 60, 1, 0, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0,104,188, 42, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,216,188, 42, 5, 0, 0, 0, 0,248,187, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,216,188, 42, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 72,189, 42, 5, 0, 0, 0, 0,104,188, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 24, 4, 88, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 72,189, 42, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0,184,189, 42, 5, 0, 0, 0, 0,216,188, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 1, 88, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,184,189, 42, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 40,190, 42, 5,
- 0, 0, 0, 0, 72,189, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 1,195, 2, 1, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0, 40,190, 42, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,152,190, 42, 5, 0, 0, 0, 0,184,189, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,152,190, 42, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 8,191, 42, 5, 0, 0, 0, 0, 40,190, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,192, 1, 4, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 8,191, 42, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0,120,191, 42, 5, 0, 0, 0, 0,152,190, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 4, 60, 2,
- 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,120,191, 42, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 8,191, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 60, 2, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,232,191, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 88,192, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,120,184, 42, 5, 0, 0, 0, 0,232,184, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0, 88,192, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,200,192, 42, 5, 0, 0, 0, 0,232,191, 42, 5,
- 0, 0, 0, 0,120,184, 42, 5, 0, 0, 0, 0,200,185, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,200,192, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 56,193, 42, 5, 0, 0, 0, 0, 88,192, 42, 5,
- 0, 0, 0, 0,232,184, 42, 5, 0, 0, 0, 0, 56,186, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0, 56,193, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,168,193, 42, 5, 0, 0, 0, 0,200,192, 42, 5,
- 0, 0, 0, 0,200,185, 42, 5, 0, 0, 0, 0, 56,186, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,168,193, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 24,194, 42, 5, 0, 0, 0, 0, 56,193, 42, 5,
- 0, 0, 0, 0, 8,184, 42, 5, 0, 0, 0, 0,168,186, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0, 24,194, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,136,194, 42, 5, 0, 0, 0, 0,168,193, 42, 5,
- 0, 0, 0, 0, 88,185, 42, 5, 0, 0, 0, 0,168,186, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,136,194, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,248,194, 42, 5, 0, 0, 0, 0, 24,194, 42, 5,
- 0, 0, 0, 0, 56,186, 42, 5, 0, 0, 0, 0, 24,187, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,248,194, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,104,195, 42, 5, 0, 0, 0, 0,136,194, 42, 5,
- 0, 0, 0, 0,168,186, 42, 5, 0, 0, 0, 0,136,187, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,104,195, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,216,195, 42, 5, 0, 0, 0, 0,248,194, 42, 5,
- 0, 0, 0, 0, 88,185, 42, 5, 0, 0, 0, 0,248,187, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,216,195, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 72,196, 42, 5, 0, 0, 0, 0,104,195, 42, 5,
- 0, 0, 0, 0,136,187, 42, 5, 0, 0, 0, 0,248,187, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0, 72,196, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,184,196, 42, 5, 0, 0, 0, 0,216,195, 42, 5,
- 0, 0, 0, 0, 8,184, 42, 5, 0, 0, 0, 0,104,188, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,184,196, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 40,197, 42, 5, 0, 0, 0, 0, 72,196, 42, 5,
- 0, 0, 0, 0, 24,187, 42, 5, 0, 0, 0, 0,216,188, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0, 40,197, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,152,197, 42, 5, 0, 0, 0, 0,184,196, 42, 5,
- 0, 0, 0, 0,168,186, 42, 5, 0, 0, 0, 0,216,188, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,152,197, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 8,198, 42, 5, 0, 0, 0, 0, 40,197, 42, 5,
- 0, 0, 0, 0,104,188, 42, 5, 0, 0, 0, 0,216,188, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0, 8,198, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,120,198, 42, 5, 0, 0, 0, 0,152,197, 42, 5,
- 0, 0, 0, 0,104,188, 42, 5, 0, 0, 0, 0, 72,189, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,120,198, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,232,198, 42, 5, 0, 0, 0, 0, 8,198, 42, 5,
- 0, 0, 0, 0,216,188, 42, 5, 0, 0, 0, 0, 72,189, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,232,198, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 88,199, 42, 5, 0, 0, 0, 0,120,198, 42, 5,
- 0, 0, 0, 0,200,185, 42, 5, 0, 0, 0, 0,184,189, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0, 88,199, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,200,199, 42, 5, 0, 0, 0, 0,232,198, 42, 5,
- 0, 0, 0, 0, 24,187, 42, 5, 0, 0, 0, 0,184,189, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,200,199, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 56,200, 42, 5, 0, 0, 0, 0, 88,199, 42, 5,
- 0, 0, 0, 0, 72,189, 42, 5, 0, 0, 0, 0,184,189, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0, 56,200, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,168,200, 42, 5, 0, 0, 0, 0,200,199, 42, 5,
- 0, 0, 0, 0,104,188, 42, 5, 0, 0, 0, 0, 40,190, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,168,200, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 24,201, 42, 5, 0, 0, 0, 0, 56,200, 42, 5,
- 0, 0, 0, 0, 72,189, 42, 5, 0, 0, 0, 0,152,190, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0, 24,201, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,136,201, 42, 5, 0, 0, 0, 0,168,200, 42, 5,
- 0, 0, 0, 0, 40,190, 42, 5, 0, 0, 0, 0,152,190, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,136,201, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,248,201, 42, 5, 0, 0, 0, 0, 24,201, 42, 5,
- 0, 0, 0, 0,136,187, 42, 5, 0, 0, 0, 0, 8,191, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,248,201, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,104,202, 42, 5, 0, 0, 0, 0,136,201, 42, 5,
- 0, 0, 0, 0, 24,187, 42, 5, 0, 0, 0, 0, 8,191, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,104,202, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,216,202, 42, 5, 0, 0, 0, 0,248,201, 42, 5,
- 0, 0, 0, 0, 56,186, 42, 5, 0, 0, 0, 0,120,191, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,216,202, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 72,203, 42, 5, 0, 0, 0, 0,104,202, 42, 5,
- 0, 0, 0, 0,248,187, 42, 5, 0, 0, 0, 0,120,191, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0, 72,203, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,184,203, 42, 5, 0, 0, 0, 0,216,202, 42, 5,
- 0, 0, 0, 0, 8,191, 42, 5, 0, 0, 0, 0,120,191, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0,184,203, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 40,204, 42, 5, 0, 0, 0, 0, 72,203, 42, 5,
- 0, 0, 0, 0,200,185, 42, 5, 0, 0, 0, 0, 40,190, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 0, 0, 0, 40,204, 42, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184,203, 42, 5,
- 0, 0, 0, 0,184,189, 42, 5, 0, 0, 0, 0,152,190, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
-160, 0, 0, 0,152,204, 42, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,104,208, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,200,185, 42, 5, 0, 0, 0, 0,120,184, 42, 5, 0, 0, 0, 0,232,184, 42, 5, 0, 0, 0, 0, 56,186, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0,196, 2, 0, 0,222, 2, 0, 0, 7, 7,241, 4,
- 27, 0, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 26, 43, 5, 0, 0, 0, 0,248, 26, 43, 5,
- 0, 0, 0, 0,136,205, 42, 5, 0, 0, 0, 0,248,206, 42, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,136,205, 42, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,248,206, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,128,148, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 32,158, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,
-240, 4, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0,158, 68, 0, 0,200, 65, 0, 0,158, 68, 0, 0,200, 65, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,241, 4, 26, 0,241, 4, 26, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0,196, 2, 0, 0,221, 2, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,241, 4, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,248,206, 42, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,205, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,240,109, 69, 0, 0,128,192, 0, 0, 0, 0, 0, 0, 0, 0,255,255,109, 69, 0, 0, 0,192, 0, 0, 0, 0,112, 7, 0, 0,
-129, 7, 0, 0, 18, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,
-111, 7, 0, 0, 18, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 2, 0, 0, 0, 1, 0, 3, 3, 2, 0, 0, 4, 10, 0,129, 7, 2, 0,112, 7, 1, 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,222, 2, 0, 0,222, 2, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 87, 77, 0, 0, 88, 1, 0, 0, 8, 78,210, 3, 0, 0, 0, 0,146, 1, 0, 0, 1, 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, 0, 0, 0, 87, 77, 87,105,110, 77, 97,110,
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,
+ 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, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,122,199, 3, 0, 0, 0, 0, 56,122,199, 3, 0, 0, 0, 0,
+ 56,122,199, 3, 0, 0, 0, 0, 56,122,199, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,232, 89,178, 3, 0, 0, 0, 0,
+120, 93,178, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136, 60,171, 3, 0, 0, 0, 0,
+104,164,152, 15, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 2, 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,120, 58,171, 3, 0, 0, 0, 0,120, 58,171, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 86,178, 3, 0, 0, 0, 0,184, 88,178, 3, 0, 0, 0, 0,
+ 88, 86,178, 3, 0, 0, 0, 0,136, 87,178, 3, 0, 0, 0, 0,184, 88,178, 3, 0, 0, 0, 0,232,255,210, 3, 0, 0, 0, 0,
+232,255,210, 3, 0, 0, 0, 0,232,255,210, 3, 0, 0, 0, 0, 68, 65, 84, 65, 0, 1, 0, 0, 56,122,199, 3, 0, 0, 0, 0,
+147, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93,198, 3, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0,248, 9,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,115, 99,114,101,101,110, 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, 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, 78, 0, 70, 5,178, 2,
+ 0, 0, 0, 0, 1, 0,238, 3, 0, 0, 0, 0, 1, 0, 0, 0,152,127,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,136, 39,205, 15, 0, 0, 0, 0,152, 0,212, 15, 0, 0, 0, 0,
+168,255,211, 15, 0, 0, 0, 0,104, 12,163, 3, 0, 0, 0, 0, 56, 9,163, 3, 0, 0, 0, 0, 88, 11,163, 3, 0, 0, 0, 0,
+ 88, 11,163, 3, 0, 0, 0, 0,152, 84,171, 3, 0, 0, 0, 0,120,149,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 78, 0, 0, 8, 1, 0, 0,136, 7,214, 3, 0, 0, 0, 0,210, 0, 0, 0, 1, 0, 0, 0,
+ 8,156,214, 3, 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,
+ 83, 82, 65,110,105,109, 97,116,105,111,110, 0, 46, 48, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168, 9,201, 3, 0, 0, 0, 0,
+ 72, 20,201, 3, 0, 0, 0, 0,184, 88,171, 3, 0, 0, 0, 0,248,107,171, 3, 0, 0, 0, 0, 24, 9,214, 3, 0, 0, 0, 0,
+248,150,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,168, 9,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+ 72, 10,201, 3, 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,
+ 68, 65, 84, 65, 32, 0, 0, 0, 72, 10,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,232, 10,201, 3, 0, 0, 0, 0,
+168, 9,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,222, 2, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+232, 10,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,136, 11,201, 3, 0, 0, 0, 0, 72, 10,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,240, 4,222, 2, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,136, 11,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0, 40, 12,201, 3, 0, 0, 0, 0,232, 10,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+240, 4, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 40, 12,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+200, 12,201, 3, 0, 0, 0, 0,136, 11,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,195, 2, 1, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0,200, 12,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,104, 13,201, 3, 0, 0, 0, 0,
+ 40, 12,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4,195, 2, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+104, 13,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 8, 14,201, 3, 0, 0, 0, 0,200, 12,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 24, 4, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 8, 14,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0,168, 14,201, 3, 0, 0, 0, 0,104, 13,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 24, 4,195, 2, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,168, 14,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+ 72, 15,201, 3, 0, 0, 0, 0, 8, 14,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 4, 60, 1, 0, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0, 72, 15,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,232, 15,201, 3, 0, 0, 0, 0,
+168, 14,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 60, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+232, 15,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,136, 16,201, 3, 0, 0, 0, 0, 72, 15,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,136, 16,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0, 40, 17,201, 3, 0, 0, 0, 0,232, 15,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 24, 4, 88, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 40, 17,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+200, 17,201, 3, 0, 0, 0, 0,136, 16,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 1, 88, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0,200, 17,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,104, 18,201, 3, 0, 0, 0, 0,
+ 40, 17,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 1,195, 2, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+104, 18,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 8, 19,201, 3, 0, 0, 0, 0,200, 17,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 8, 19,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0,168, 19,201, 3, 0, 0, 0, 0,104, 18,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+192, 1, 4, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,168, 19,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+ 72, 20,201, 3, 0, 0, 0, 0, 8, 19,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 4, 60, 2, 0, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0, 72, 20,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+168, 19,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 60, 2, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+184, 88,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,104, 89,171, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 72, 10,201, 3, 0, 0, 0, 0,232, 10,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+104, 89,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 24, 90,171, 3, 0, 0, 0, 0,184, 88,171, 3, 0, 0, 0, 0,
+ 72, 10,201, 3, 0, 0, 0, 0, 40, 12,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 24, 90,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,200, 90,171, 3, 0, 0, 0, 0,104, 89,171, 3, 0, 0, 0, 0,
+232, 10,201, 3, 0, 0, 0, 0,200, 12,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+200, 90,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,120, 91,171, 3, 0, 0, 0, 0, 24, 90,171, 3, 0, 0, 0, 0,
+ 40, 12,201, 3, 0, 0, 0, 0,200, 12,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+120, 91,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 40, 92,171, 3, 0, 0, 0, 0,200, 90,171, 3, 0, 0, 0, 0,
+168, 9,201, 3, 0, 0, 0, 0,104, 13,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 40, 92,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,216, 92,171, 3, 0, 0, 0, 0,120, 91,171, 3, 0, 0, 0, 0,
+136, 11,201, 3, 0, 0, 0, 0,104, 13,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+216, 92,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,136, 93,171, 3, 0, 0, 0, 0, 40, 92,171, 3, 0, 0, 0, 0,
+200, 12,201, 3, 0, 0, 0, 0, 8, 14,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+136, 93,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 56, 94,171, 3, 0, 0, 0, 0,216, 92,171, 3, 0, 0, 0, 0,
+104, 13,201, 3, 0, 0, 0, 0,168, 14,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 56, 94,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,232, 94,171, 3, 0, 0, 0, 0,136, 93,171, 3, 0, 0, 0, 0,
+136, 11,201, 3, 0, 0, 0, 0, 72, 15,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+232, 94,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,152, 95,171, 3, 0, 0, 0, 0, 56, 94,171, 3, 0, 0, 0, 0,
+168, 14,201, 3, 0, 0, 0, 0, 72, 15,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+152, 95,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 72, 96,171, 3, 0, 0, 0, 0,232, 94,171, 3, 0, 0, 0, 0,
+168, 9,201, 3, 0, 0, 0, 0,232, 15,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 72, 96,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,248, 96,171, 3, 0, 0, 0, 0,152, 95,171, 3, 0, 0, 0, 0,
+ 8, 14,201, 3, 0, 0, 0, 0,136, 16,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+248, 96,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,168, 97,171, 3, 0, 0, 0, 0, 72, 96,171, 3, 0, 0, 0, 0,
+104, 13,201, 3, 0, 0, 0, 0,136, 16,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+168, 97,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 88, 98,171, 3, 0, 0, 0, 0,248, 96,171, 3, 0, 0, 0, 0,
+232, 15,201, 3, 0, 0, 0, 0,136, 16,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 88, 98,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 8, 99,171, 3, 0, 0, 0, 0,168, 97,171, 3, 0, 0, 0, 0,
+232, 15,201, 3, 0, 0, 0, 0, 40, 17,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 8, 99,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,184, 99,171, 3, 0, 0, 0, 0, 88, 98,171, 3, 0, 0, 0, 0,
+136, 16,201, 3, 0, 0, 0, 0, 40, 17,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+184, 99,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,104,100,171, 3, 0, 0, 0, 0, 8, 99,171, 3, 0, 0, 0, 0,
+ 40, 12,201, 3, 0, 0, 0, 0,200, 17,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+104,100,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 24,101,171, 3, 0, 0, 0, 0,184, 99,171, 3, 0, 0, 0, 0,
+ 8, 14,201, 3, 0, 0, 0, 0,200, 17,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 24,101,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,200,101,171, 3, 0, 0, 0, 0,104,100,171, 3, 0, 0, 0, 0,
+ 40, 17,201, 3, 0, 0, 0, 0,200, 17,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+200,101,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,120,102,171, 3, 0, 0, 0, 0, 24,101,171, 3, 0, 0, 0, 0,
+232, 15,201, 3, 0, 0, 0, 0,104, 18,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+120,102,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 40,103,171, 3, 0, 0, 0, 0,200,101,171, 3, 0, 0, 0, 0,
+ 40, 17,201, 3, 0, 0, 0, 0, 8, 19,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 40,103,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,216,103,171, 3, 0, 0, 0, 0,120,102,171, 3, 0, 0, 0, 0,
+104, 18,201, 3, 0, 0, 0, 0, 8, 19,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+216,103,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,136,104,171, 3, 0, 0, 0, 0, 40,103,171, 3, 0, 0, 0, 0,
+168, 14,201, 3, 0, 0, 0, 0,168, 19,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+136,104,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 56,105,171, 3, 0, 0, 0, 0,216,103,171, 3, 0, 0, 0, 0,
+ 8, 14,201, 3, 0, 0, 0, 0,168, 19,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 56,105,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,232,105,171, 3, 0, 0, 0, 0,136,104,171, 3, 0, 0, 0, 0,
+200, 12,201, 3, 0, 0, 0, 0, 72, 20,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+232,105,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,152,106,171, 3, 0, 0, 0, 0, 56,105,171, 3, 0, 0, 0, 0,
+ 72, 15,201, 3, 0, 0, 0, 0, 72, 20,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+152,106,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 72,107,171, 3, 0, 0, 0, 0,232,105,171, 3, 0, 0, 0, 0,
+168, 19,201, 3, 0, 0, 0, 0, 72, 20,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 72,107,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,248,107,171, 3, 0, 0, 0, 0,152,106,171, 3, 0, 0, 0, 0,
+ 40, 12,201, 3, 0, 0, 0, 0,104, 18,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+248,107,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,107,171, 3, 0, 0, 0, 0,
+200, 17,201, 3, 0, 0, 0, 0, 8, 19,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
+ 24, 9,214, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 56, 10,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 40, 12,201, 3, 0, 0, 0, 0, 72, 10,201, 3, 0, 0, 0, 0,232, 10,201, 3, 0, 0, 0, 0,200, 12,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0,196, 2, 0, 0,222, 2, 0, 0, 7, 7,241, 4, 27, 0, 1, 0,
+ 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,197,207, 3, 0, 0, 0, 0,152,197,207, 3, 0, 0, 0, 0,
+136,221,175, 3, 0, 0, 0, 0, 56,223,175, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,136,221,175, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 56,223,175, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,148, 68,
+ 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 32,158, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,240, 4, 0, 0,
+ 0, 0, 0, 0, 25, 0, 0, 0, 0, 0,158, 68, 0, 0,200, 65, 0, 0,158, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,241, 4, 26, 0,241, 4, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0,196, 2, 0, 0,221, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,241, 4, 26, 0, 0, 0, 1, 0, 2, 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, 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, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,104,208, 42, 5,
- 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,248,232, 42, 5, 0, 0, 0, 0,152,204, 42, 5, 0, 0, 0, 0,168,186, 42, 5,
- 0, 0, 0, 0,136,187, 42, 5, 0, 0, 0, 0,248,187, 42, 5, 0, 0, 0, 0, 88,185, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 0, 0, 0, 0, 59, 1, 0, 0, 4, 4,216, 0, 60, 1, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184,231, 42, 5, 0, 0, 0, 0,184,231, 42, 5, 0, 0, 0, 0, 88,209, 42, 5,
- 0, 0, 0, 0,200,210, 42, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 88,209, 42, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0,200,210, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148, 67, 0, 0, 0, 0,
- 0, 0,208, 65, 98, 39, 38, 54, 0, 0, 88, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,215, 0, 0, 0, 0, 0, 0, 0,
- 25, 0, 0, 0, 0, 0, 87, 67, 0, 0,200, 65, 0, 0, 87, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,216, 0, 26, 0,216, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 34, 1, 0, 0, 59, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,216, 0, 26, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 56,223,175, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,221,175, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,109, 69,
+ 0, 0,128,192, 0, 0, 0, 0, 0, 0, 0, 0,255,255,109, 69, 0, 0, 0,192, 0, 0, 0, 0,112, 7, 0, 0,129, 7, 0, 0,
+ 18, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0,
+ 18, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 2, 0, 0, 0, 1, 0, 3, 3, 2, 0, 0, 4, 10, 0,129, 7, 2, 0,112, 7, 1, 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,222, 2, 0, 0,222, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 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, 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, 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, 68, 65, 84, 65,160, 0, 0, 0, 56, 10,214, 3, 0, 0, 0, 0,
+214, 0, 0, 0, 1, 0, 0, 0, 88, 11,214, 3, 0, 0, 0, 0, 24, 9,214, 3, 0, 0, 0, 0,104, 13,201, 3, 0, 0, 0, 0,
+168, 14,201, 3, 0, 0, 0, 0, 72, 15,201, 3, 0, 0, 0, 0,136, 11,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 25, 4, 0, 0,240, 4, 0, 0, 0, 0, 0, 0, 59, 1, 0, 0, 4, 4,216, 0, 60, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,184,123,199, 3, 0, 0, 0, 0,184,123,199, 3, 0, 0, 0, 0,232,224,175, 3, 0, 0, 0, 0,
+152,226,175, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,232,224,175, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+152,226,175, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148, 67, 0, 0, 0, 0, 0, 0,208, 65,
+ 98, 39, 38, 54, 0, 0, 88, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,215, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0,
+ 0, 0, 87, 67, 0, 0,200, 65, 0, 0, 87, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3,
+ 4, 0, 12, 0, 10, 0,216, 0, 26, 0,216, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 25, 4, 0, 0,240, 4, 0, 0, 34, 1, 0, 0, 59, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+216, 0, 26, 0, 0, 0, 1, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,152,226,175, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,232,224,175, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 67, 0, 0, 61,196, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 71, 67, 1, 0,145,195, 0, 0, 0, 0,199, 0, 0, 0,216, 0, 0, 0, 0, 0, 0, 0, 33, 1, 0, 0,
+ 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,198, 0, 0, 0, 0, 0, 0, 0, 33, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 1, 0, 0, 1, 0, 7, 0,
+ 18, 0, 0, 4, 6, 0,216, 0, 34, 1,199, 0, 34, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 25, 4, 0, 0,240, 4, 0, 0, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+216, 0, 34, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 51,214, 3, 0, 0, 0, 0,
+216, 71,214, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 56, 51,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,
+ 24, 53,214, 3, 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,
+ 66, 85, 84, 84, 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 66, 85, 84, 84, 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 67,111,110,116,101,120,116, 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, 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,220,255,199, 0, 36, 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, 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, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,200,210, 42, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,209, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 67, 0, 0, 61,196,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 71, 67, 1, 0,145,195, 0, 0, 0, 0,199, 0, 0, 0,216, 0, 0, 0, 0, 0, 0, 0,
- 33, 1, 0, 0, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,198, 0, 0, 0, 0, 0, 0, 0,
- 33, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 1, 0, 0,
- 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,216, 0, 34, 1,199, 0, 34, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,216, 0, 34, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,212, 42, 5,
- 0, 0, 0, 0, 24,230, 42, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 56,212, 42, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0,216,213, 42, 5, 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, 66, 85, 84, 84, 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66, 85, 84, 84, 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,
+ 24, 53,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,248, 54,214, 3, 0, 0, 0, 0, 56, 51,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,110,100,101,114,
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,
- 0, 0, 0, 0, 67,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,110,100,101,114,
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,
- 0, 0, 0, 0, 0, 0,220,255,199, 0, 36, 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, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 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, 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,135,255,199, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0,216,213, 42, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,120,215, 42, 5, 0, 0, 0, 0, 56,212, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,
-110,100,101,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,
-110,100,101,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 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, 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,135,255,199, 0, 61, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 68, 65, 84, 65, 88, 1, 0, 0,248, 54,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,
+216, 56,214, 3, 0, 0, 0, 0, 24, 53,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0,120,215, 42, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0, 24,217, 42, 5, 0, 0, 0, 0,216,213, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 76, 97,121,101,114,115, 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, 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, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,111,255,199, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 76, 97,121,101,114,115, 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, 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,111,255,199, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 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, 68, 65, 84, 65, 88, 1, 0, 0,
+216, 56,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,184, 58,214, 3, 0, 0, 0, 0,248, 54,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,
+105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,
+105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,105,109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140,254,199, 0,203, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0, 24,217, 42, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,184,218, 42, 5, 0, 0, 0, 0,120,215, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,
-109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,
-109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,105,109,101,110,115,105,111,110,115, 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, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140,254,199, 0,203, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 3, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0,184, 58,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,
+152, 60,214, 3, 0, 0, 0, 0,216, 56,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,184,218, 42, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0, 88,220, 42, 5, 0, 0, 0, 0, 24,217, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 0, 0, 0, 0, 0, 0,
+ 65,110,116,105, 45, 65,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 65,110,116,105, 45, 65,108,105, 97,115,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 58,254,199, 0, 58, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 58,254,199, 0, 58, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0,
+152, 60,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,120, 62,214, 3, 0, 0, 0, 0,184, 58,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,116,105,111,110,
+ 95, 98,108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,116,105,111,110,
+ 95, 98,108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 97,109,112,108,101,100, 32, 77,111,116,105,111,110, 32, 66,
+108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,254,199, 0, 0, 0, 20, 0, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 5, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0, 88,220, 42, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,248,221, 42, 5, 0, 0, 0, 0,184,218, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,
-116,105,111,110, 95, 98,108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,
-116,105,111,110, 95, 98,108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 97,109,112,108,101,100, 32, 77,111,116,105,
-111,110, 32, 66,108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,254,199, 0, 0, 0, 20, 0, 0, 0,
- 4, 0, 0, 0, 0, 0, 0, 0, 5, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0,120, 62,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,
+ 88, 64,214, 3, 0, 0, 0, 0,152, 60,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,104, 97,100,105,110,103, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0,248,221, 42, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0,152,223, 42, 5, 0, 0, 0, 0, 88,220, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,104, 97,100,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,104, 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,104, 97,100,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 83,104, 97,100,105,110,103, 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, 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, 83,104, 97,100,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 10,254,199, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 6, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 10,254,199, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 6, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0,
+ 88, 64,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 56, 66,214, 3, 0, 0, 0, 0,120, 62,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,
+109, 97,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,
+109, 97,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,101,114,102,111,114,109, 97,110, 99,101, 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, 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, 0, 68, 65, 84, 65,
- 88, 1, 0, 0,152,223, 42, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 56,225, 42, 5, 0, 0, 0, 0,248,221, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,
-114,102,111,114,109, 97,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,
-114,102,111,114,109, 97,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,101,114,102,111,114,109, 97,110, 99,101, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,242,253,199, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 7, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,242,253,199, 0, 0, 0, 0, 0, 0, 0,
- 4, 0, 0, 0, 0, 0, 0, 0, 7, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0, 56, 66,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,
+ 24, 68,214, 3, 0, 0, 0, 0, 88, 64,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 56,225, 42, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0,216,226, 42, 5, 0, 0, 0, 0,152,223, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 0, 0, 0,
+ 80,111,115,116, 32, 80,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 80,111,115,116, 32, 80,114,111, 99,101,115,115,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,218,253,199, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 8, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,218,253,199, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 8, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0,
+ 24, 68,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,248, 69,214, 3, 0, 0, 0, 0, 56, 66,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 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, 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, 68, 65, 84, 65,
- 88, 1, 0, 0,216,226, 42, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,120,228, 42, 5, 0, 0, 0, 0, 56,225, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116,
- 97,109,112, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116,
- 97,109,112, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,109,112, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,194,253,199, 0, 0, 0, 20, 0, 0, 0,
- 4, 0, 0, 0, 0, 0, 0, 0, 9, 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, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,109,112, 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, 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,194,253,199, 0, 0, 0, 20, 0, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 9, 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, 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, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,120,228, 42, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0, 24,230, 42, 5, 0, 0, 0, 0,216,226, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,248, 69,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,
+216, 71,214, 3, 0, 0, 0, 0, 24, 68,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 40,253,199, 0,130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0,
+ 79,117,116,112,117,116, 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, 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, 40,253,199, 0,130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 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, 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, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0, 24,230, 42, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,228, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,
-107,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,
-107,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 97,107,101, 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, 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, 16,253,199, 0, 0, 0, 0, 0, 0, 0,
- 4, 0, 0, 0, 0, 0, 0, 0, 11, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,
+216, 71,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 69,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,107,101, 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, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,107,101, 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, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 0, 0, 0,184,231, 42, 5, 0, 0, 0, 0,180, 0, 0, 0,
- 1, 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, 0, 0, 0, 4, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 97,107,101, 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, 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, 16,253,199, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 11, 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, 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, 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, 0, 0, 0, 68, 65, 84, 65,248, 0, 0, 0,184,123,199, 3, 0, 0, 0, 0,179, 0, 0, 0, 1, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,255, 21, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
-160, 0, 0, 0,248,232, 42, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,232,237, 42, 5, 0, 0, 0, 0,104,208, 42, 5,
- 0, 0, 0, 0, 8,184, 42, 5, 0, 0, 0, 0,104,188, 42, 5, 0, 0, 0, 0,216,188, 42, 5, 0, 0, 0, 0,168,186, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 4, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 15, 15, 24, 4,
- 88, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,236, 42, 5, 0, 0, 0, 0,200,236, 42, 5,
- 0, 0, 0, 0,232,233, 42, 5, 0, 0, 0, 0, 88,235, 42, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,232,233, 42, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 88,235, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 32,140, 68, 0, 0, 0, 0, 0, 0,208, 65, 39,182,158, 55, 0, 0,131, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0,
+ 4, 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, 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,
- 23, 4, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,224,130, 68, 0, 0,200, 65, 0,224,130, 68, 0, 0,200, 65, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 24, 4, 26, 0, 24, 4, 26, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 4, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 4, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 88,235, 42, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,233, 42, 5, 0, 0, 0, 0, 0, 0, 64,192,
- 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 72, 66,112,189, 17,192,246, 70,125, 67, 0, 0, 0, 0, 0, 0, 72, 66, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 4, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,
- 23, 4, 0, 0, 18, 0, 0, 0, 61, 0, 0, 0, 0, 0,128, 63, 0, 0, 72, 66, 0,124,146, 72, 0, 0, 72, 66,205,204,204, 61,
- 0, 0, 32, 65, 72, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 4, 8, 0, 24, 4, 62, 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, 23, 4, 0, 0, 26, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 4, 62, 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, 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, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+255, 21, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
+ 88, 11,214, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,120, 12,214, 3, 0, 0, 0, 0, 56, 10,214, 3, 0, 0, 0, 0,
+168, 9,201, 3, 0, 0, 0, 0,232, 15,201, 3, 0, 0, 0, 0,136, 16,201, 3, 0, 0, 0, 0,104, 13,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 4, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 15, 15, 24, 4, 88, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 92,200, 3, 0, 0, 0, 0,216, 92,200, 3, 0, 0, 0, 0,
+ 72,228,175, 3, 0, 0, 0, 0,248,229,175, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 72,228,175, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0,248,229,175, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,140, 68,
+ 0, 0, 0, 0, 0, 0,208, 65, 39,182,158, 55, 0, 0,131, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 23, 4, 0, 0,
+ 0, 0, 0, 0, 25, 0, 0, 0, 0,224,130, 68, 0, 0,200, 65, 0,224,130, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 24, 4, 26, 0, 24, 4, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 4, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 24, 4, 26, 0, 0, 0, 1, 0, 2, 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, 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, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0,200,236, 42, 5,
- 0, 0, 0, 0,191, 0, 0, 0, 1, 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, 0, 0, 0, 15, 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, 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, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,248,229,175, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,228,175, 3, 0, 0, 0, 0, 0, 0, 64,192, 0, 0,126, 67,
+ 0, 0, 0, 0, 0, 0, 72, 66,112,189, 17,192,246, 70,125, 67, 0, 0, 0, 0, 0, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 4, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 23, 4, 0, 0,
+ 18, 0, 0, 0, 61, 0, 0, 0, 0, 0,128, 63, 0, 0, 72, 66, 0,124,146, 72, 0, 0, 72, 66,205,204,204, 61, 0, 0, 32, 65,
+ 72, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 4, 8, 0, 24, 4, 62, 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, 23, 4, 0, 0, 26, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 24, 4, 62, 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, 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, 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, 0, 0, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0,216, 92,200, 3, 0, 0, 0, 0,
+190, 0, 0, 0, 1, 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, 0, 0, 0, 15, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65,
-160, 0, 0, 0,232,237, 42, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,168,244, 42, 5, 0, 0, 0, 0,248,232, 42, 5,
- 0, 0, 0, 0,136,187, 42, 5, 0, 0, 0, 0, 8,191, 42, 5, 0, 0, 0, 0,120,191, 42, 5, 0, 0, 0, 0,248,187, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 61, 1, 0, 0, 59, 2, 0, 0, 3, 3,216, 0,
-255, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184,241, 42, 5, 0, 0, 0, 0,184,241, 42, 5,
- 0, 0, 0, 0,216,238, 42, 5, 0, 0, 0, 0, 72,240, 42, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,216,238, 42, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 72,240, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,128,244, 67, 0, 0, 0, 0, 0, 0,208, 65, 98, 39, 38, 54, 0, 0, 88, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,
-215, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 87, 67, 0, 0,200, 65, 0, 0, 87, 67, 0, 0,200, 65, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,216, 0, 26, 0,216, 0, 26, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 34, 2, 0, 0, 59, 2, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 0, 26, 0, 0, 0, 1, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 72,240, 42, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216,238, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,128,141, 67, 0, 0,244,194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 67, 0, 0, 83,195, 0, 0, 0, 0,199, 0, 0, 0,
-216, 0, 0, 0, 18, 0, 0, 0,228, 0, 0, 0, 0, 0, 0, 0,198, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,
-198, 0, 0, 0, 18, 0, 0, 0,228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 18, 2, 0, 0, 2, 0, 3, 3, 0, 0, 12, 4, 6, 0,216, 0,229, 0,199, 0,211, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 61, 1, 0, 0, 33, 2, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 0,229, 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, 0, 31, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
+120, 12,214, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 40, 14,214, 3, 0, 0, 0, 0, 88, 11,214, 3, 0, 0, 0, 0,
+168, 14,201, 3, 0, 0, 0, 0,168, 19,201, 3, 0, 0, 0, 0, 72, 20,201, 3, 0, 0, 0, 0, 72, 15,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 61, 1, 0, 0, 59, 2, 0, 0, 3, 3,216, 0,255, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,255,208, 3, 0, 0, 0, 0, 40,255,208, 3, 0, 0, 0, 0,
+168,231,175, 3, 0, 0, 0, 0, 88,233,175, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,168,231,175, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 88,233,175, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,244, 67,
+ 0, 0, 0, 0, 0, 0,208, 65, 98, 39, 38, 54, 0, 0, 88, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,215, 0, 0, 0,
+ 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 87, 67, 0, 0,200, 65, 0, 0, 87, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,216, 0, 26, 0,216, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 34, 2, 0, 0, 59, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,216, 0, 26, 0, 0, 0, 1, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 88,233,175, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168,231,175, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,141, 67,
+ 0, 0,244,194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 67, 0, 0, 83,195, 0, 0, 0, 0,199, 0, 0, 0,216, 0, 0, 0,
+ 18, 0, 0, 0,228, 0, 0, 0, 0, 0, 0, 0,198, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,198, 0, 0, 0,
+ 18, 0, 0, 0,228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 18, 2, 0, 0, 2, 0, 3, 3, 0, 0, 12, 4, 6, 0,216, 0,229, 0,199, 0,211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 61, 1, 0, 0, 33, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,216, 0,229, 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, 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, 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, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0, 40,255,208, 3, 0, 0, 0, 0,
+183, 0, 0, 0, 1, 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, 0, 0, 0, 3, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0,184,241, 42, 5,
- 0, 0, 0, 0,184, 0, 0, 0, 1, 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, 0, 0, 0, 3, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+152, 13,214, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 68, 65, 84, 65, 16, 0, 0, 0,152, 13,214, 3, 0, 0, 0, 0,237, 0, 0, 0, 1, 0, 0, 0, 14, 0, 0, 0, 14, 0, 0, 0,
+248, 30,199, 3, 0, 0, 0, 0, 68, 65, 84, 65,224, 0, 0, 0,248, 30,199, 3, 0, 0, 0, 0,236, 0, 0, 0, 14, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0,168,194,217, 3, 0, 0, 0, 0, 19, 0, 0, 0, 1, 0, 1, 0,168,194,217, 3, 0, 0, 0, 0,
+ 20, 0, 0, 0, 1, 0, 1, 0,168,194,217, 3, 0, 0, 0, 0, 21, 0, 1, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 1, 0, 24, 51,163, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,184,219,217, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 1, 0,136, 48,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,152, 7,218, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 1, 0,216, 29,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,168,225,217, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 1, 0,120,209,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,200,213,217, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 1, 0, 24, 98,200, 3, 0, 0, 0, 0, 21, 0, 0, 0, 1, 0, 1, 0,168,194,217, 3, 0, 0, 0, 0,
+ 68, 65, 84, 65,160, 0, 0, 0, 40, 14,214, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 72, 15,214, 3, 0, 0, 0, 0,
+120, 12,214, 3, 0, 0, 0, 0, 40, 17,201, 3, 0, 0, 0, 0,200, 17,201, 3, 0, 0, 0, 0, 8, 14,201, 3, 0, 0, 0, 0,
+136, 16,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 1, 0, 0, 23, 4, 0, 0, 89, 0, 0, 0,194, 2, 0, 0,
+ 1, 1, 87, 2,106, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184, 73,214, 3, 0, 0, 0, 0,
+184, 73,214, 3, 0, 0, 0, 0, 8,235,175, 3, 0, 0, 0, 0, 72, 88,214, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
+ 8,235,175, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 56, 83,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 64,113, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,192, 21, 68, 0, 0, 0, 0, 0, 0,208, 65,
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,
+ 0, 0, 0, 0, 86, 2, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128, 21, 68, 0, 0,200, 65, 0,128, 21, 68, 0, 0,200, 65,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 87, 2, 26, 0, 87, 2, 26, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 1, 0, 0, 23, 4, 0, 0, 89, 0, 0, 0,114, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 2, 26, 0, 0, 0, 1, 0, 2, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 24,243, 42, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 68, 65, 84, 65, 16, 0, 0, 0, 24,243, 42, 5, 0, 0, 0, 0,238, 0, 0, 0, 1, 0, 0, 0, 14, 0, 0, 0,
- 14, 0, 0, 0,120,243, 42, 5, 0, 0, 0, 0, 68, 65, 84, 65,224, 0, 0, 0,120,243, 42, 5, 0, 0, 0, 0,237, 0, 0, 0,
- 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 88,162, 45, 5, 0, 0, 0, 0, 19, 0, 0, 0, 1, 0, 1, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 20, 0, 0, 0, 1, 0, 1, 0, 88,162, 45, 5, 0, 0, 0, 0, 21, 0, 1, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8,189, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,120,198, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8, 30, 47, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,168,212, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8,123, 46, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 72,184, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,216,191, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 56,183, 45, 5, 0, 0, 0, 0, 21, 0, 0, 0, 1, 0, 1, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,168,244, 42, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 56, 2, 43, 5,
- 0, 0, 0, 0,232,237, 42, 5, 0, 0, 0, 0, 72,189, 42, 5, 0, 0, 0, 0,184,189, 42, 5, 0, 0, 0, 0, 24,187, 42, 5,
- 0, 0, 0, 0,216,188, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 1, 0, 0, 23, 4, 0, 0, 89, 0, 0, 0,
-194, 2, 0, 0, 1, 1, 87, 2,106, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136, 0, 43, 5,
- 0, 0, 0, 0,136, 0, 43, 5, 0, 0, 0, 0,152,245, 42, 5, 0, 0, 0, 0, 88,251, 42, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 1, 0, 0,152,245, 42, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 8,247, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,113, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,192, 21, 68, 0, 0, 0, 0,
- 0, 0,208, 65, 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, 0, 0, 0, 0, 86, 2, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128, 21, 68, 0, 0,200, 65, 0,128, 21, 68,
- 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 87, 2, 26, 0, 87, 2,
- 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 1, 0, 0, 23, 4, 0, 0, 89, 0, 0, 0,
-114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 2, 26, 0, 0, 0, 1, 0, 2, 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, 68, 65, 84, 65, 40, 1, 0, 0,
+ 56, 83,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,232, 84,214, 3, 0, 0, 0, 0, 8,235,175, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 15, 67, 0, 64, 70,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67,255,127, 70,196, 0, 0, 0, 0,
+143, 0, 0, 0,160, 0, 0, 0, 18, 0, 0, 0, 43, 3, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
+ 0, 0, 0, 0,142, 0, 0, 0, 18, 0, 0, 0, 43, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,160, 0, 44, 3,143, 0, 26, 3, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 1, 0, 0,193, 1, 0, 0,115, 0, 0, 0,194, 2, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 80, 2, 0, 0, 5, 0, 3, 0, 1, 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, 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, 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, 0, 68, 65, 84, 65,
- 40, 1, 0, 0, 8,247, 42, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,120,248, 42, 5, 0, 0, 0, 0,152,245, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67, 0, 64, 70,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67,255,127, 70,196,
- 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0, 18, 0, 0, 0, 43, 3, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0,
- 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 18, 0, 0, 0, 43, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,160, 0, 44, 3,143, 0,
- 26, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 1, 0, 0,193, 1, 0, 0,115, 0, 0, 0,
-194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 80, 2, 0, 0, 5, 0, 3, 0, 1, 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, 68, 65, 84, 65, 40, 1, 0, 0,
+232, 84,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,152, 86,214, 3, 0, 0, 0, 0, 56, 83,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 16, 67, 0, 0,206,194, 0, 0, 0, 0, 0, 0, 0, 0,231,102, 16, 67, 0, 0,206,194, 0, 0, 0, 0,
+143, 0, 0, 0,160, 0, 0, 0, 18, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
+ 0, 0, 0, 0,142, 0, 0, 0, 18, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,160, 0,120, 0,143, 0,102, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 1, 0, 0,193, 1, 0, 0,115, 0, 0, 0,115, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 6, 0, 34, 0, 2, 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, 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, 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, 0, 68, 65, 84, 65,
- 40, 1, 0, 0,120,248, 42, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,232,249, 42, 5, 0, 0, 0, 0, 8,247, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 67, 0, 0,206,194, 0, 0, 0, 0, 0, 0, 0, 0,231,102, 16, 67, 0, 0,206,194,
- 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0, 18, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0,
- 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 18, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,160, 0,120, 0,143, 0,
-102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 1, 0, 0,193, 1, 0, 0,115, 0, 0, 0,
-115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 6, 0, 34, 0, 2, 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, 68, 65, 84, 65, 40, 1, 0, 0,
+152, 86,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 72, 88,214, 3, 0, 0, 0, 0,232, 84,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 35, 67, 0,128, 96,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67, 0,128, 96,196, 0, 0, 0, 0,
+163, 0, 0, 0,180, 0, 0, 0, 18, 0, 0, 0,147, 3, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
+ 0, 0, 0, 0,162, 0, 0, 0, 18, 0, 0, 0,147, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,180, 0,148, 3,163, 0,130, 3, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 4, 0, 0, 23, 4, 0, 0,115, 0, 0, 0,194, 2, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 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, 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, 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, 0, 68, 65, 84, 65,
- 40, 1, 0, 0,232,249, 42, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 88,251, 42, 5, 0, 0, 0, 0,120,248, 42, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67, 0,128, 96,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67, 0,128, 96,196,
- 0, 0, 0, 0,163, 0, 0, 0,180, 0, 0, 0, 18, 0, 0, 0,147, 3, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0,
- 17, 0, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 18, 0, 0, 0,147, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,180, 0,148, 3,163, 0,
-130, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 4, 0, 0, 23, 4, 0, 0,115, 0, 0, 0,
-194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 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, 68, 65, 84, 65, 40, 1, 0, 0,
+ 72, 88,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152, 86,214, 3, 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, 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, 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, 68, 65, 84, 65,
- 40, 1, 0, 0, 88,251, 42, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,249, 42, 5,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 1, 0, 0, 23, 4, 0, 0,115, 0, 0, 0,194, 2, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 2, 80, 2, 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, 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, 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,193, 1, 0, 0, 23, 4, 0, 0,115, 0, 0, 0,
-194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 2, 80, 2, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,115,214, 3, 0, 0, 0, 0, 68, 65, 84, 65,112, 3, 0, 0,
+ 8,115,214, 3, 0, 0, 0, 0,173, 0, 0, 0, 1, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,200,167,141, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 13,128,191, 0, 0,128,191,
+ 0, 0, 0, 0, 0, 0, 0, 0, 74,215, 76,190, 0, 0, 0, 0, 68,239,209, 62, 51,177,205,190,184,158, 81, 63, 0, 0, 0, 0,
+ 70,119,105, 63,143, 74, 70, 62, 35, 44,185,190, 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63, 42, 61,228, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,214,211,111,193, 0, 0,128, 63, 69,239,209, 62, 70,119,105, 63,176, 84, 89,188, 0, 0, 0, 0,
+ 53,177,205,190,142, 74, 70, 62,166, 33,101, 63, 0, 0, 0, 0,185,158, 81, 63, 35, 44,185,190, 43, 61,228, 62, 0, 0, 0, 0,
+164, 96, 68, 65,111,121,173,192,248,209,213, 64, 0, 0,128, 63,178,157,229, 62,209,162,227,190, 48,180, 81,191,184,158, 81,191,
+117, 90,127, 63, 13,114, 91, 62, 26, 63,185, 62, 35, 44,185, 62,145,180,109,188,105,147,125, 63,138, 84,228,190, 42, 61,228,190,
+ 0, 0, 0, 0, 0, 0, 0, 0, 9,185,108, 65,214,211,111, 65, 99,240,191, 62,110,116, 85, 63, 64,185, 70,188, 0, 0, 82,180,
+ 48,221,185,190, 44, 45, 51, 62, 28, 11, 79, 63, 0, 0, 56,179, 67,108,117,194,183,204,216, 65,105,156, 5,194,212,247,159,192,
+235, 62,114, 66, 59,254,213,193,158,225, 3, 66, 55, 8,160, 64, 68,239,209, 62, 51,177,205,190,184,158, 81, 63, 0, 0, 0, 0,
+ 70,119,105, 63,143, 74, 70, 62, 35, 44,185,190, 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63, 42, 61,228, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,214,211,111,193, 0, 0,128, 63,178,157,229, 62,209,162,227,190, 48,180, 81,191,184,158, 81,191,
+117, 90,127, 63, 13,114, 91, 62, 26, 63,185, 62, 35, 44,185, 62,145,180,109,188,105,147,125, 63,138, 84,228,190, 42, 61,228,190,
+ 0, 0, 0, 0, 0, 0, 0, 0, 9,185,108, 65,214,211,111, 65, 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, 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, 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, 0, 0, 0, 0,200,252, 42, 5, 0, 0, 0, 0, 68, 65, 84, 65,
-120, 3, 0, 0,200,252, 42, 5, 0, 0, 0, 0,174, 0, 0, 0, 1, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,200,167,141, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 13,128,191,
- 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0, 74,215, 76,190, 0, 0, 0, 0, 68,239,209, 62, 51,177,205,190,184,158, 81, 63,
- 0, 0, 0, 0, 70,119,105, 63,143, 74, 70, 62, 35, 44,185,190, 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63, 42, 61,228, 62,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,214,211,111,193, 0, 0,128, 63, 69,239,209, 62, 70,119,105, 63,176, 84, 89,188,
- 0, 0, 0, 0, 53,177,205,190,142, 74, 70, 62,166, 33,101, 63, 0, 0, 0, 0,185,158, 81, 63, 35, 44,185,190, 43, 61,228, 62,
- 0, 0, 0, 0,164, 96, 68, 65,111,121,173,192,248,209,213, 64, 0, 0,128, 63,178,157,229, 62,209,162,227,190, 48,180, 81,191,
-184,158, 81,191,117, 90,127, 63, 13,114, 91, 62, 26, 63,185, 62, 35, 44,185, 62,145,180,109,188,105,147,125, 63,138, 84,228,190,
- 42, 61,228,190, 0, 0, 0, 0, 0, 0, 0, 0, 9,185,108, 65,214,211,111, 65, 99,240,191, 62,110,116, 85, 63, 64,185, 70,188,
- 0, 0, 82,180, 48,221,185,190, 44, 45, 51, 62, 28, 11, 79, 63, 0, 0, 56,179, 67,108,117,194,183,204,216, 65,105,156, 5,194,
-212,247,159,192,235, 62,114, 66, 59,254,213,193,158,225, 3, 66, 55, 8,160, 64, 68,239,209, 62, 51,177,205,190,184,158, 81, 63,
- 0, 0, 0, 0, 70,119,105, 63,143, 74, 70, 62, 35, 44,185,190, 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63, 42, 61,228, 62,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,214,211,111,193, 0, 0,128, 63,178,157,229, 62,209,162,227,190, 48,180, 81,191,
-184,158, 81,191,117, 90,127, 63, 13,114, 91, 62, 26, 63,185, 62, 35, 44,185, 62,145,180,109,188,105,147,125, 63,138, 84,228,190,
- 42, 61,228,190, 0, 0, 0, 0, 0, 0, 0, 0, 9,185,108, 65,214,211,111, 65, 12,163, 91, 64, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 12,163, 91, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,163, 91, 64,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 92, 62, 55, 63, 56,186,224,190,237,203,148,190,
- 3,236,234,190,214,211,111, 65,214,211,111, 65, 0, 0, 0, 0, 0, 0, 0, 0,236, 15, 72, 59, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,255,255, 1, 0, 0, 0, 0, 0, 0, 0, 1, 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, 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, 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, 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, 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, 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, 12,163, 91, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 12,163, 91, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,163, 91, 64, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 92, 62, 55, 63, 56,186,224,190,237,203,148,190, 3,236,234,190,
+214,211,111, 65,214,211,111, 65, 0, 0, 0, 0, 0, 0, 0, 0,236, 15, 72, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 32, 33, 12, 66, 86,152,137, 66,113, 27,126, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 96, 1, 0, 0,184, 73,214, 3, 0, 0, 0, 0,174, 0, 0, 0, 1, 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, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 32, 65,205,204, 76, 62, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0,200,213,217, 3, 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, 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, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 32, 33, 12, 66, 86,152,137, 66,113, 27,126, 66, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 96, 1, 0, 0,136, 0, 43, 5, 0, 0, 0, 0,175, 0, 0, 0,
- 1, 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, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65,205,204, 76, 62, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 1, 0, 7, 0,216,191, 45, 5, 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, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 3, 0, 8, 8,128, 0, 0, 0, 12, 66,
+ 0, 0,128, 63,205,204,204, 61, 0, 0,250, 67, 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, 16, 0, 10, 0, 7, 1, 0, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
+ 72, 15,214, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,104, 16,214, 3, 0, 0, 0, 0, 40, 14,214, 3, 0, 0, 0, 0,
+232, 15,201, 3, 0, 0, 0, 0,104, 18,201, 3, 0, 0, 0, 0, 8, 19,201, 3, 0, 0, 0, 0, 40, 17,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 1, 0, 0, 89, 0, 0, 0, 3, 1, 0, 0, 2, 2,192, 1,171, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,149,199, 3, 0, 0, 0, 0, 8,149,199, 3, 0, 0, 0, 0,
+248, 89,214, 3, 0, 0, 0, 0, 8, 95,214, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,248, 89,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0,168, 91,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 89, 68,
+ 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,224, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,191, 1, 0, 0,
+ 0, 0, 0, 0, 25, 0, 0, 0, 0,128,223, 67, 0, 0,200, 65, 0,128,223, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,192, 1, 26, 0,192, 1, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 1, 0, 0, 89, 0, 0, 0,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,192, 1, 26, 0, 0, 0, 1, 0, 2, 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, 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, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0,
- 1, 0, 3, 0, 8, 8,128, 0, 0, 0, 12, 66, 0, 0,128, 63,205,204,204, 61, 0, 0,250, 67, 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, 16, 0, 10, 0, 7, 1, 0, 3, 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, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,168, 91,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 88, 93,214, 3, 0, 0, 0, 0,248, 89,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 67,
+ 0, 0,112,193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 67, 0, 0,254,194, 0, 0, 0, 0,200, 0, 0, 0,217, 0, 0, 0,
+ 18, 0, 0, 0,144, 0, 0, 0, 0, 0, 0, 0,199, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,199, 0, 0, 0,
+ 18, 0, 0, 0,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 10, 6, 0, 0, 2, 0, 3, 3, 0, 0, 0, 4, 6, 0,217, 0,145, 0,200, 0,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 0, 0, 0,115, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,217, 0,145, 0, 0, 0, 2, 0, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0, 56, 2, 43, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,232, 10, 43, 5,
- 0, 0, 0, 0,168,244, 42, 5, 0, 0, 0, 0,104,188, 42, 5, 0, 0, 0, 0, 40,190, 42, 5, 0, 0, 0, 0,152,190, 42, 5,
- 0, 0, 0, 0, 72,189, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 1, 0, 0, 89, 0, 0, 0,
- 3, 1, 0, 0, 2, 2,192, 1,171, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 8, 43, 5,
- 0, 0, 0, 0,232, 8, 43, 5, 0, 0, 0, 0, 40, 3, 43, 5, 0, 0, 0, 0,120, 7, 43, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 1, 0, 0, 40, 3, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,152, 4, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 89, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,224, 67, 0, 0, 0, 0,
- 0, 0,208, 65, 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, 0, 0, 0, 0,191, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,223, 67, 0, 0,200, 65, 0,128,223, 67,
- 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,192, 1, 26, 0,192, 1,
- 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 1, 0, 0, 89, 0, 0, 0,
-114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 1, 26, 0, 0, 0, 1, 0, 2, 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, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 88, 93,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 8, 95,214, 3, 0, 0, 0, 0,168, 91,214, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 1, 0, 0,152, 4, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 8, 6, 43, 5, 0, 0, 0, 0, 40, 3, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 67, 0, 0,112,193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 67, 0, 0,254,194,
- 0, 0, 0, 0,200, 0, 0, 0,217, 0, 0, 0, 18, 0, 0, 0,144, 0, 0, 0, 0, 0, 0, 0,199, 0, 0, 0, 0, 0, 0, 0,
- 17, 0, 0, 0, 0, 0, 0, 0,199, 0, 0, 0, 18, 0, 0, 0,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 10, 6, 0, 0, 2, 0, 3, 3, 0, 0, 0, 4, 6, 0,217, 0,145, 0,200, 0,
-127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 0, 0, 0,115, 0, 0, 0,
- 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,217, 0,145, 0, 0, 0, 2, 0, 3, 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, 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, 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, 68, 65, 84, 65,
- 40, 1, 0, 0, 8, 6, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,120, 7, 43, 5, 0, 0, 0, 0,152, 4, 43, 5,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0,191, 1, 0, 0,191, 1, 0, 0,115, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 8, 95,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 93,214, 3, 0, 0, 0, 0, 0, 0, 16,193, 0, 0,130, 67,
+ 0, 0,160,192, 0, 0,160, 64, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 16,193, 0, 0, 32, 65, 0, 0, 0, 0, 17, 0, 0, 0,
+ 18, 0, 0, 0,144, 0, 0, 0, 18, 0, 0, 0,230, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 18, 0, 0, 0,230, 0, 0, 0,
+ 18, 0, 0, 0,144, 0, 0, 0,111, 18,131, 58,111, 18,131, 58, 0,124,146, 72, 0, 80, 67, 71, 0, 0, 0, 0, 0, 0, 0, 0,
+105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0,231, 0,145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,217, 0, 0, 0,191, 1, 0, 0,115, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,231, 0,145, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 1, 0, 0,191, 1, 0, 0,115, 0, 0, 0,
- 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 8,149,199, 3, 0, 0, 0, 0,
+178, 0, 0, 0, 1, 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, 0, 0, 0, 2, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 1, 0, 0,120, 7, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 6, 43, 5,
- 0, 0, 0, 0, 0, 0, 16,193, 0, 0,130, 67, 0, 0,160,192, 0, 0,160, 64, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 16,193,
- 0, 0, 32, 65, 0, 0, 0, 0, 17, 0, 0, 0, 18, 0, 0, 0,144, 0, 0, 0, 18, 0, 0, 0,230, 0, 0, 0, 0, 0, 0, 0,
- 17, 0, 0, 0, 18, 0, 0, 0,230, 0, 0, 0, 18, 0, 0, 0,144, 0, 0, 0,111, 18,131, 58,111, 18,131, 58, 0,124,146, 72,
- 0, 80, 67, 71, 0, 0, 0, 0, 0, 0, 0, 0,105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0,231, 0,145, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,217, 0, 0, 0,191, 1, 0, 0,115, 0, 0, 0,
- 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,231, 0,145, 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, 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, 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, 0, 0, 0, 0, 0, 68, 65, 84, 65,
-240, 0, 0, 0,232, 8, 43, 5, 0, 0, 0, 0,179, 0, 0, 0, 1, 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, 0, 0, 0, 2, 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, 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, 40,119,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,112, 0, 0, 0,
+ 40,119,214, 3, 0, 0, 0, 0, 37, 1, 0, 0, 1, 0, 0, 0,168,194,217, 3, 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, 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, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,160, 0, 0, 0,104, 16,214, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,248,150,214, 3, 0, 0, 0, 0,
+ 72, 15,214, 3, 0, 0, 0, 0,104, 18,201, 3, 0, 0, 0, 0, 40, 12,201, 3, 0, 0, 0, 0,200, 17,201, 3, 0, 0, 0, 0,
+ 8, 19,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 1, 0, 0, 5, 1, 0, 0,194, 2, 0, 0,
+ 12, 12,192, 1,190, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,230,208, 3, 0, 0, 0, 0,
+200,230,208, 3, 0, 0, 0, 0,184, 96,214, 3, 0, 0, 0, 0, 24,100,214, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
+184, 96,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,104, 98,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0,192, 94, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,224, 67, 0, 0, 0, 0, 0, 0,208, 65,
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,
- 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, 40, 10, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65,112, 0, 0, 0, 40, 10, 43, 5, 0, 0, 0, 0, 38, 1, 0, 0, 1, 0, 0, 0, 88,162, 45, 5,
+ 0, 0, 0, 0,191, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,223, 67, 0, 0,200, 65, 0,128,223, 67, 0, 0,200, 65,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,192, 1, 26, 0,192, 1, 26, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 1, 0, 0, 5, 1, 0, 0, 30, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 1, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,232, 10, 43, 5, 0, 0, 0, 0,215, 0, 0, 0,
- 1, 0, 0, 0,184, 17, 43, 5, 0, 0, 0, 0, 56, 2, 43, 5, 0, 0, 0, 0, 40,190, 42, 5, 0, 0, 0, 0,200,185, 42, 5,
- 0, 0, 0, 0,184,189, 42, 5, 0, 0, 0, 0,152,190, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-191, 1, 0, 0, 5, 1, 0, 0,194, 2, 0, 0, 12, 12,192, 1,190, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 40, 16, 43, 5, 0, 0, 0, 0, 40, 16, 43, 5, 0, 0, 0, 0,216, 11, 43, 5, 0, 0, 0, 0,184, 14, 43, 5,
- 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,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,216, 11, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 72, 13, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 94, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0,
- 0, 0,224, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,191, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,223, 67,
- 0, 0,200, 65, 0,128,223, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0,
- 10, 0,192, 1, 26, 0,192, 1, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-191, 1, 0, 0, 5, 1, 0, 0, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 1, 26, 0,
- 0, 0, 1, 0, 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
+104, 98,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 24,100,214, 3, 0, 0, 0, 0,184, 96,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 55, 67, 0, 0, 0,194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 67, 0, 0,201,195, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,199, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
+ 0, 0, 0, 0,199, 0, 0, 0, 18, 0, 0, 0,163, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 8, 4, 0, 0, 2, 0, 3, 3, 0, 0, 2, 4, 6, 0,200, 0,164, 1,200, 0,146, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,199, 0, 0, 0, 31, 1, 0, 0,194, 2, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 0,164, 1, 0, 0, 2, 0, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 72, 13, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,184, 14, 43, 5,
- 0, 0, 0, 0,216, 11, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 67, 0, 0, 0,194, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 72, 67, 0, 0,201,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-199, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,199, 0, 0, 0, 18, 0, 0, 0,163, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 8, 4, 0, 0, 2, 0, 3, 3, 0, 0, 2, 4,
- 6, 0,200, 0,164, 1,200, 0,146, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-199, 0, 0, 0, 31, 1, 0, 0,194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 0,164, 1,
- 0, 0, 2, 0, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
+ 24,100,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104, 98,214, 3, 0, 0, 0, 0,
+ 0, 0, 32,193, 0, 0,104, 68, 0, 0, 72,194, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,104, 68, 0, 0,201,195, 0, 0, 0, 0,
+231, 0, 0, 0,248, 0, 0, 0, 18, 0, 0, 0,163, 1, 0, 0, 0, 0, 0, 0,230, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
+ 0, 0, 0, 0,230, 0, 0, 0, 18, 0, 0, 0,163, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,124,146, 72, 0, 64, 28, 70,
+ 10,215, 35, 60, 0, 0, 72, 66, 74, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 4, 4, 0,248, 0,164, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 0, 0, 0,191, 1, 0, 0, 31, 1, 0, 0,194, 2, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 0,164, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,184, 14, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 72, 13, 43, 5, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,104, 68, 0, 0, 72,194, 0, 0, 0, 0, 0, 0, 32,193,
- 0, 0,104, 68, 0, 0,201,195, 0, 0, 0, 0,231, 0, 0, 0,248, 0, 0, 0, 18, 0, 0, 0,163, 1, 0, 0, 0, 0, 0, 0,
-230, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,230, 0, 0, 0, 18, 0, 0, 0,163, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0,124,146, 72, 0, 64, 28, 70, 10,215, 35, 60, 0, 0, 72, 66, 74, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 4,
- 4, 0,248, 0,164, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 0, 0, 0,
-191, 1, 0, 0, 31, 1, 0, 0,194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 0,164, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 72, 1, 0, 0,
+200,230,208, 3, 0, 0, 0, 0, 38, 1, 0, 0, 1, 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, 0, 0, 0, 12, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 72, 1, 0, 0, 40, 16, 43, 5, 0, 0, 0, 0, 39, 1, 0, 0, 1, 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, 0, 0, 0, 12, 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, 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, 0, 0, 0,
+168,194,217, 3, 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, 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, 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,
+ 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
+248,150,214, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104, 16,214, 3, 0, 0, 0, 0,
+168, 19,201, 3, 0, 0, 0, 0, 8, 14,201, 3, 0, 0, 0, 0,200, 12,201, 3, 0, 0, 0, 0, 72, 20,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 61, 2, 0, 0,194, 2, 0, 0, 1, 1,216, 0,134, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152, 75,214, 3, 0, 0, 0, 0,152, 75,214, 3, 0, 0, 0, 0,
+200,101,214, 3, 0, 0, 0, 0,120,103,214, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,200,101,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0,120,103,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102, 68,
+ 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,165, 67, 0, 0, 0, 64, 0, 0,208, 65, 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, 0, 0, 0, 0, 73, 1, 0, 0,
+ 0, 0, 0, 0, 23, 0, 0, 0, 0,128,164, 67, 0, 0,200, 65, 0,128,164, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 74, 1, 24, 0, 74, 1, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 61, 2, 0, 0, 61, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 26, 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, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,162, 45, 5, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,120,103,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,101,214, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,184, 17, 43, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,232, 10, 43, 5, 0, 0, 0, 0, 8,191, 42, 5, 0, 0, 0, 0, 24,187, 42, 5, 0, 0, 0, 0, 56,186, 42, 5,
- 0, 0, 0, 0,120,191, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 61, 2, 0, 0,
-194, 2, 0, 0, 1, 1,216, 0,134, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 25, 43, 5,
- 0, 0, 0, 0, 72, 25, 43, 5, 0, 0, 0, 0,168, 18, 43, 5, 0, 0, 0, 0, 24, 20, 43, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 1, 0, 0,168, 18, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 24, 20, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,165, 67, 0, 0, 0, 64,
- 0, 0,208, 65, 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, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0,128,164, 67, 0, 0,200, 65, 0,128,164, 67,
- 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 74, 1, 24, 0, 74, 1,
- 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 61, 2, 0, 0,
- 61, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 26, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 1, 0, 0, 24, 20, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168, 18, 43, 5,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 61, 2, 0, 0,194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,216, 0,134, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 4, 0, 0,240, 4, 0, 0, 61, 2, 0, 0,
-194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 0,134, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 24,152,214, 3, 0, 0, 0, 0, 68, 65, 84, 65,112, 3, 0, 0, 24,152,214, 3, 0, 0, 0, 0,
+173, 0, 0, 0, 1, 0, 0, 0, 56,255, 13, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,228,100, 64,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,154, 65,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,
+ 72, 1, 77,190, 0, 0, 0, 0,221,149, 47, 63, 86,126,162,190, 8,165, 39, 63, 0, 0, 0, 0, 51, 70, 58, 63,225,251,159, 62,
+149, 84, 28,191, 0, 0, 0, 0,192, 56, 49,188, 55, 53,101, 63, 52,247,227, 62, 0, 0, 0, 0, 90, 38,173,190, 0,222,192,190,
+152, 9, 52,193, 0, 0,128, 63,223,149, 47, 63, 55, 70, 58, 63,160, 56, 49,188, 0, 0, 0, 0, 88,126,162,190,229,251,159, 62,
+ 55, 53,101, 63, 0, 0, 0, 0, 7,165, 39, 63,150, 84, 28,191, 51,247,227, 62, 0, 0, 0, 0,110,101,239, 64,151, 62,208,192,
+ 78,255,170, 64, 0, 0,128, 63, 47,201,194, 63, 61, 73,145,191,244,250, 39,191, 8,165, 39,191,190,164,206, 63,209, 10,143, 63,
+180,164, 28, 63,149, 84, 28, 63,224,153,196,188,136,239, 76, 64, 10,108,228,190, 52,247,227,190,125, 21, 64,191,126,113,172,191,
+216, 49, 49, 65,152, 9, 52, 65,149, 70,158, 62, 24,234,167, 62,192,214,159,187, 0, 0, 6,181,196,188,181,189, 71,238,178, 61,
+127, 45,128, 62, 0, 0,226, 51,168,120, 21,194,107, 5, 2, 66,203,135,213,193,147,214,159,192,177, 38, 19, 66,124,173,255,193,
+ 96,101,210, 65,128, 40,160, 64,221,149, 47, 63, 86,126,162,190, 8,165, 39, 63, 0, 0, 0, 0, 51, 70, 58, 63,225,251,159, 62,
+149, 84, 28,191, 0, 0, 0, 0,192, 56, 49,188, 55, 53,101, 63, 52,247,227, 62, 0, 0, 0, 0, 90, 38,173,190, 0,222,192,190,
+152, 9, 52,193, 0, 0,128, 63, 47,201,194, 63, 61, 73,145,191,244,250, 39,191, 8,165, 39,191,190,164,206, 63,209, 10,143, 63,
+180,164, 28, 63,149, 84, 28, 63,224,153,196,188,136,239, 76, 64, 10,108,228,190, 52,247,227,190,125, 21, 64,191,126,113,172,191,
+216, 49, 49, 65,152, 9, 52, 65, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136, 21, 43, 5, 0, 0, 0, 0, 68, 65, 84, 65,
-120, 3, 0, 0,136, 21, 43, 5, 0, 0, 0, 0,174, 0, 0, 0, 1, 0, 0, 0, 56,255, 13, 64, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0,228,100, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,154, 65,128,191,
- 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0, 72, 1, 77,190, 0, 0, 0, 0,221,149, 47, 63, 86,126,162,190, 8,165, 39, 63,
- 0, 0, 0, 0, 51, 70, 58, 63,225,251,159, 62,149, 84, 28,191, 0, 0, 0, 0,192, 56, 49,188, 55, 53,101, 63, 52,247,227, 62,
- 0, 0, 0, 0, 90, 38,173,190, 0,222,192,190,152, 9, 52,193, 0, 0,128, 63,223,149, 47, 63, 55, 70, 58, 63,160, 56, 49,188,
- 0, 0, 0, 0, 88,126,162,190,229,251,159, 62, 55, 53,101, 63, 0, 0, 0, 0, 7,165, 39, 63,150, 84, 28,191, 51,247,227, 62,
- 0, 0, 0, 0,110,101,239, 64,151, 62,208,192, 78,255,170, 64, 0, 0,128, 63, 47,201,194, 63, 61, 73,145,191,244,250, 39,191,
- 8,165, 39,191,190,164,206, 63,209, 10,143, 63,180,164, 28, 63,149, 84, 28, 63,224,153,196,188,136,239, 76, 64, 10,108,228,190,
- 52,247,227,190,125, 21, 64,191,126,113,172,191,216, 49, 49, 65,152, 9, 52, 65,149, 70,158, 62, 24,234,167, 62,192,214,159,187,
- 0, 0, 6,181,196,188,181,189, 71,238,178, 61,127, 45,128, 62, 0, 0,226, 51,168,120, 21,194,107, 5, 2, 66,203,135,213,193,
-147,214,159,192,177, 38, 19, 66,124,173,255,193, 96,101,210, 65,128, 40,160, 64,221,149, 47, 63, 86,126,162,190, 8,165, 39, 63,
- 0, 0, 0, 0, 51, 70, 58, 63,225,251,159, 62,149, 84, 28,191, 0, 0, 0, 0,192, 56, 49,188, 55, 53,101, 63, 52,247,227, 62,
- 0, 0, 0, 0, 90, 38,173,190, 0,222,192,190,152, 9, 52,193, 0, 0,128, 63, 47,201,194, 63, 61, 73,145,191,244,250, 39,191,
- 8,165, 39,191,190,164,206, 63,209, 10,143, 63,180,164, 28, 63,149, 84, 28, 63,224,153,196,188,136,239, 76, 64, 10,108,228,190,
- 52,247,227,190,125, 21, 64,191,126,113,172,191,216, 49, 49, 65,152, 9, 52, 65,102,103, 97, 64, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,102,103, 97, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102,103, 97, 64,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,241, 22, 72, 63, 78,162,246,190, 43, 8, 90,190,
- 2, 35,171,190, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253,191,136, 59, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 0, 0, 0, 0, 2, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,102,103, 97, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102,103, 97, 64,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102,103, 97, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63,241, 22, 72, 63, 78,162,246,190, 43, 8, 90,190, 2, 35,171,190, 0, 0, 32, 65, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,253,191,136, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 65, 1, 2, 0, 0,
+255,255, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, 0, 0, 0,128, 63,190,133, 65, 66,
+ 99,212, 90, 66, 27,183,118, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 96, 1, 0, 0,
+152, 75,214, 3, 0, 0, 0, 0,174, 0, 0, 0, 1, 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, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65,205,204, 76, 62,
+ 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0,200,213,217, 3, 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, 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, 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, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 7, 0, 0, 0,128, 63,190,133, 65, 66, 99,212, 90, 66, 27,183,118, 66, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 96, 1, 0, 0, 72, 25, 43, 5, 0, 0, 0, 0,175, 0, 0, 0,
- 1, 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, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65,205,204, 76, 62, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 1, 0, 7, 0,216,191, 45, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 3, 0, 8, 0,128, 0, 0, 0, 12, 66, 0, 0,128, 63, 10,215, 35, 60,
+ 0, 0,250, 67, 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, 16, 0,
+ 10, 0, 7, 1, 0, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0,
- 1, 0, 3, 0, 8, 0,128, 0, 0, 0, 12, 66, 0, 0,128, 63, 10,215, 35, 60, 0, 0,250, 67, 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, 16, 0, 10, 0, 7, 1, 0, 3, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 78, 0, 0, 8, 1, 0, 0, 8,156,214, 3, 0, 0, 0, 0,
+210, 0, 0, 0, 1, 0, 0, 0,248, 9,215, 3, 0, 0, 0, 0,136, 7,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 67,111,109,112,111,115,105,116,105,110,103, 0,103, 46, 48, 48, 49, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+232, 20,201, 3, 0, 0, 0, 0, 8, 29,201, 3, 0, 0, 0, 0,168,108,171, 3, 0, 0, 0, 0, 24,123,171, 3, 0, 0, 0, 0,
+152,157,214, 3, 0, 0, 0, 0, 40,231,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 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, 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, 68, 65, 84, 65, 32, 0, 0, 0,232, 20,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0,136, 21,201, 3, 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, 68, 65, 84, 65, 32, 0, 0, 0,136, 21,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+ 40, 22,201, 3, 0, 0, 0, 0,232, 20,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 0, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0, 40, 22,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,200, 22,201, 3, 0, 0, 0, 0,
+136, 21,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 5, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+200, 22,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,104, 23,201, 3, 0, 0, 0, 0, 40, 22,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,104, 23,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0, 8, 24,201, 3, 0, 0, 0, 0,200, 22,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,234, 3, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 8, 24,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+168, 24,201, 3, 0, 0, 0, 0,104, 23,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7,234, 3, 1, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0,168, 24,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 72, 25,201, 3, 0, 0, 0, 0,
+ 8, 24,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 6, 92, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+ 72, 25,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,232, 25,201, 3, 0, 0, 0, 0,168, 24,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 92, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,232, 25,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0,136, 26,201, 3, 0, 0, 0, 0, 72, 25,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 32, 6,234, 3, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,136, 26,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+ 40, 27,201, 3, 0, 0, 0, 0,232, 25,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 1, 0, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0, 40, 27,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,200, 27,201, 3, 0, 0, 0, 0,
+136, 26,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 6,140, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+200, 27,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,104, 28,201, 3, 0, 0, 0, 0, 40, 27,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 4, 3,140, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,104, 28,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0, 8, 29,201, 3, 0, 0, 0, 0,200, 27,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 4, 3, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 8, 29,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,104, 28,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 6, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0,168,108,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 88,109,171, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,136, 21,201, 3, 0, 0, 0, 0, 40, 22,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0, 88,109,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 8,110,171, 3, 0, 0, 0, 0,
+168,108,171, 3, 0, 0, 0, 0,136, 21,201, 3, 0, 0, 0, 0,104, 23,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0, 8,110,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,184,110,171, 3, 0, 0, 0, 0,
+ 88,109,171, 3, 0, 0, 0, 0, 40, 22,201, 3, 0, 0, 0, 0, 8, 24,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0,184,110,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,104,111,171, 3, 0, 0, 0, 0,
+ 8,110,171, 3, 0, 0, 0, 0,104, 23,201, 3, 0, 0, 0, 0, 8, 24,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0,104,111,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 24,112,171, 3, 0, 0, 0, 0,
+184,110,171, 3, 0, 0, 0, 0,200, 22,201, 3, 0, 0, 0, 0, 72, 25,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0, 24,112,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,200,112,171, 3, 0, 0, 0, 0,
+104,111,171, 3, 0, 0, 0, 0,168, 24,201, 3, 0, 0, 0, 0, 72, 25,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0,200,112,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,120,113,171, 3, 0, 0, 0, 0,
+ 24,112,171, 3, 0, 0, 0, 0, 8, 24,201, 3, 0, 0, 0, 0,232, 25,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0,120,113,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 40,114,171, 3, 0, 0, 0, 0,
+200,112,171, 3, 0, 0, 0, 0,104, 23,201, 3, 0, 0, 0, 0,232, 25,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0, 40,114,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,216,114,171, 3, 0, 0, 0, 0,
+120,113,171, 3, 0, 0, 0, 0,168, 24,201, 3, 0, 0, 0, 0,232, 25,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0,216,114,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,136,115,171, 3, 0, 0, 0, 0,
+ 40,114,171, 3, 0, 0, 0, 0, 8, 24,201, 3, 0, 0, 0, 0, 72, 25,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0,136,115,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 56,116,171, 3, 0, 0, 0, 0,
+216,114,171, 3, 0, 0, 0, 0,104, 23,201, 3, 0, 0, 0, 0,136, 26,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0, 56,116,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,232,116,171, 3, 0, 0, 0, 0,
+136,115,171, 3, 0, 0, 0, 0,232, 25,201, 3, 0, 0, 0, 0, 40, 27,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0,232,116,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,152,117,171, 3, 0, 0, 0, 0,
+ 56,116,171, 3, 0, 0, 0, 0,136, 26,201, 3, 0, 0, 0, 0, 40, 27,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0,152,117,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 72,118,171, 3, 0, 0, 0, 0,
+232,116,171, 3, 0, 0, 0, 0,136, 26,201, 3, 0, 0, 0, 0,200, 27,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0, 72,118,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,248,118,171, 3, 0, 0, 0, 0,
+152,117,171, 3, 0, 0, 0, 0, 40, 27,201, 3, 0, 0, 0, 0,200, 27,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0,248,118,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,168,119,171, 3, 0, 0, 0, 0,
+ 72,118,171, 3, 0, 0, 0, 0,232, 20,201, 3, 0, 0, 0, 0,104, 28,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0,168,119,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 88,120,171, 3, 0, 0, 0, 0,
+248,118,171, 3, 0, 0, 0, 0,104, 28,201, 3, 0, 0, 0, 0, 8, 29,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0, 88,120,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 8,121,171, 3, 0, 0, 0, 0,
+168,119,171, 3, 0, 0, 0, 0,200, 22,201, 3, 0, 0, 0, 0, 8, 29,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0, 8,121,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,184,121,171, 3, 0, 0, 0, 0,
+ 88,120,171, 3, 0, 0, 0, 0,168, 24,201, 3, 0, 0, 0, 0, 8, 29,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0,184,121,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,104,122,171, 3, 0, 0, 0, 0,
+ 8,121,171, 3, 0, 0, 0, 0,200, 27,201, 3, 0, 0, 0, 0,104, 28,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0,104,122,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 24,123,171, 3, 0, 0, 0, 0,
+184,121,171, 3, 0, 0, 0, 0, 40, 27,201, 3, 0, 0, 0, 0, 8, 29,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 0, 0, 0, 24,123,171, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+104,122,171, 3, 0, 0, 0, 0,232, 20,201, 3, 0, 0, 0, 0,136, 26,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,160, 0, 0, 0,152,157,214, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,184,158,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,104, 23,201, 3, 0, 0, 0, 0,136, 21,201, 3, 0, 0, 0, 0, 40, 22,201, 3, 0, 0, 0, 0,
+ 8, 24,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,235, 3, 0, 0, 5, 4, 0, 0,
+ 7, 7,127, 7, 27, 0, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,198,207, 3, 0, 0, 0, 0,
+ 88,198,207, 3, 0, 0, 0, 0, 40,105,214, 3, 0, 0, 0, 0,216,106,214, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
+ 40,105,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,216,106,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 32,148, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,224,239, 68, 0, 0, 0, 0, 0, 0,208, 65,
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,
- 0, 0, 0, 0, 83, 78, 0, 0, 8, 1, 0, 0,136, 27, 43, 5, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 8,136, 43, 5,
- 0, 0, 0, 0,184,182, 42, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 67,111,
-109,112,111,115,105,116,105,110,103, 0,103, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,126, 7, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,192,239, 68, 0, 0,200, 65, 0,192,239, 68, 0, 0,200, 65,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,127, 7, 26, 0,127, 7, 26, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,235, 3, 0, 0, 4, 4, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127, 7, 26, 0, 0, 0, 1, 0, 2, 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, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 28, 43, 5, 0, 0, 0, 0,136, 34, 43, 5,
- 0, 0, 0, 0,248, 34, 43, 5, 0, 0, 0, 0, 40, 44, 43, 5, 0, 0, 0, 0,152, 44, 43, 5, 0, 0, 0, 0,200, 96, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 6, 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, 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, 68, 65, 84, 65, 32, 0, 0, 0,216, 28, 43, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 72, 29, 43, 5,
- 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, 68, 65, 84, 65,
- 32, 0, 0, 0, 72, 29, 43, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,184, 29, 43, 5, 0, 0, 0, 0,216, 28, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,184, 29, 43, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 40, 30, 43, 5, 0, 0, 0, 0, 72, 29, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,126, 7, 5, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 40, 30, 43, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0,152, 30, 43, 5, 0, 0, 0, 0,184, 29, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,152, 30, 43, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 8, 31, 43, 5,
- 0, 0, 0, 0, 40, 30, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,234, 3, 1, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0, 8, 31, 43, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,120, 31, 43, 5, 0, 0, 0, 0,152, 30, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7,234, 3, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,120, 31, 43, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,232, 31, 43, 5, 0, 0, 0, 0, 8, 31, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 32, 6, 92, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,232, 31, 43, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0, 88, 32, 43, 5, 0, 0, 0, 0,120, 31, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 92, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 88, 32, 43, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,200, 32, 43, 5,
- 0, 0, 0, 0,232, 31, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 6,234, 3, 1, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0,200, 32, 43, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 56, 33, 43, 5, 0, 0, 0, 0, 88, 32, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 56, 33, 43, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,168, 33, 43, 5, 0, 0, 0, 0,200, 32, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 32, 6,140, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,168, 33, 43, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0, 24, 34, 43, 5, 0, 0, 0, 0, 56, 33, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3,140, 1,
- 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 24, 34, 43, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,136, 34, 43, 5,
- 0, 0, 0, 0,168, 33, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0,136, 34, 43, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 34, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 6, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,248, 34, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,104, 35, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 29, 43, 5,
- 0, 0, 0, 0,184, 29, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,104, 35, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,216, 35, 43, 5, 0, 0, 0, 0,248, 34, 43, 5, 0, 0, 0, 0, 72, 29, 43, 5,
- 0, 0, 0, 0,152, 30, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,216, 35, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 72, 36, 43, 5, 0, 0, 0, 0,104, 35, 43, 5, 0, 0, 0, 0,184, 29, 43, 5,
- 0, 0, 0, 0, 8, 31, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 72, 36, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,184, 36, 43, 5, 0, 0, 0, 0,216, 35, 43, 5, 0, 0, 0, 0,152, 30, 43, 5,
- 0, 0, 0, 0, 8, 31, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,184, 36, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 40, 37, 43, 5, 0, 0, 0, 0, 72, 36, 43, 5, 0, 0, 0, 0, 40, 30, 43, 5,
- 0, 0, 0, 0,232, 31, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 40, 37, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,152, 37, 43, 5, 0, 0, 0, 0,184, 36, 43, 5, 0, 0, 0, 0,120, 31, 43, 5,
- 0, 0, 0, 0,232, 31, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,152, 37, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 8, 38, 43, 5, 0, 0, 0, 0, 40, 37, 43, 5, 0, 0, 0, 0, 8, 31, 43, 5,
- 0, 0, 0, 0, 88, 32, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 8, 38, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,120, 38, 43, 5, 0, 0, 0, 0,152, 37, 43, 5, 0, 0, 0, 0,152, 30, 43, 5,
- 0, 0, 0, 0, 88, 32, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,120, 38, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,232, 38, 43, 5, 0, 0, 0, 0, 8, 38, 43, 5, 0, 0, 0, 0,120, 31, 43, 5,
- 0, 0, 0, 0, 88, 32, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,232, 38, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 88, 39, 43, 5, 0, 0, 0, 0,120, 38, 43, 5, 0, 0, 0, 0, 8, 31, 43, 5,
- 0, 0, 0, 0,232, 31, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 88, 39, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,200, 39, 43, 5, 0, 0, 0, 0,232, 38, 43, 5, 0, 0, 0, 0,152, 30, 43, 5,
- 0, 0, 0, 0,200, 32, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,200, 39, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 56, 40, 43, 5, 0, 0, 0, 0, 88, 39, 43, 5, 0, 0, 0, 0, 88, 32, 43, 5,
- 0, 0, 0, 0, 56, 33, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 56, 40, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,168, 40, 43, 5, 0, 0, 0, 0,200, 39, 43, 5, 0, 0, 0, 0,200, 32, 43, 5,
- 0, 0, 0, 0, 56, 33, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,168, 40, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 24, 41, 43, 5, 0, 0, 0, 0, 56, 40, 43, 5, 0, 0, 0, 0,200, 32, 43, 5,
- 0, 0, 0, 0,168, 33, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 24, 41, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,136, 41, 43, 5, 0, 0, 0, 0,168, 40, 43, 5, 0, 0, 0, 0, 56, 33, 43, 5,
- 0, 0, 0, 0,168, 33, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,136, 41, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,248, 41, 43, 5, 0, 0, 0, 0, 24, 41, 43, 5, 0, 0, 0, 0,216, 28, 43, 5,
- 0, 0, 0, 0, 24, 34, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,248, 41, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,104, 42, 43, 5, 0, 0, 0, 0,136, 41, 43, 5, 0, 0, 0, 0, 24, 34, 43, 5,
- 0, 0, 0, 0,136, 34, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,104, 42, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,216, 42, 43, 5, 0, 0, 0, 0,248, 41, 43, 5, 0, 0, 0, 0, 40, 30, 43, 5,
- 0, 0, 0, 0,136, 34, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,216, 42, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 72, 43, 43, 5, 0, 0, 0, 0,104, 42, 43, 5, 0, 0, 0, 0,120, 31, 43, 5,
- 0, 0, 0, 0,136, 34, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 72, 43, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,184, 43, 43, 5, 0, 0, 0, 0,216, 42, 43, 5, 0, 0, 0, 0,168, 33, 43, 5,
- 0, 0, 0, 0, 24, 34, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,184, 43, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 40, 44, 43, 5, 0, 0, 0, 0, 72, 43, 43, 5, 0, 0, 0, 0, 56, 33, 43, 5,
- 0, 0, 0, 0,136, 34, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 40, 44, 43, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184, 43, 43, 5, 0, 0, 0, 0,216, 28, 43, 5,
- 0, 0, 0, 0,200, 32, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,152, 44, 43, 5,
- 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,104, 48, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152, 30, 43, 5,
- 0, 0, 0, 0, 72, 29, 43, 5, 0, 0, 0, 0,184, 29, 43, 5, 0, 0, 0, 0, 8, 31, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,235, 3, 0, 0, 5, 4, 0, 0, 7, 7,127, 7, 27, 0, 1, 0, 0, 0, 0, 0,
- 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,135, 43, 5, 0, 0, 0, 0,120,135, 43, 5, 0, 0, 0, 0,136, 45, 43, 5,
- 0, 0, 0, 0,248, 46, 43, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,136, 45, 43, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0,248, 46, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,148, 68, 0, 0, 0, 0,
- 0, 0,208, 65, 0, 0, 0, 0, 0,224,239, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,126, 7, 0, 0, 0, 0, 0, 0,
- 25, 0, 0, 0, 0,192,239, 68, 0, 0,200, 65, 0,192,239, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,127, 7, 26, 0,127, 7, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,235, 3, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,127, 7, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,248, 46, 43, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136, 45, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,109, 69, 0, 0,128,192,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,109, 69, 0, 0, 0,192, 0, 0, 0, 0,112, 7, 0, 0,129, 7, 0, 0, 18, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 18, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 2, 0, 0, 0,
- 1, 0, 3, 3, 2, 0, 0, 4, 10, 0,129, 7, 2, 0,112, 7, 1, 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, 5, 4, 0, 0, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
+216,106,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,105,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0,240,109, 69, 0, 0,128,192, 0, 0, 0, 0, 0, 0, 0, 0,255,255,109, 69, 0, 0, 0,192, 0, 0, 0, 0,
+112, 7, 0, 0,129, 7, 0, 0, 18, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
+ 0, 0, 0, 0,111, 7, 0, 0, 18, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 2, 0, 0, 0, 1, 0, 3, 3, 2, 0, 0, 4, 10, 0,129, 7, 2, 0,112, 7, 1, 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, 5, 4, 0, 0, 5, 4, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 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, 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, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,104, 48, 43, 5, 0, 0, 0, 0,215, 0, 0, 0,
- 1, 0, 0, 0, 88, 53, 43, 5, 0, 0, 0, 0,152, 44, 43, 5, 0, 0, 0, 0,136, 34, 43, 5, 0, 0, 0, 0,120, 31, 43, 5,
- 0, 0, 0, 0,232, 31, 43, 5, 0, 0, 0, 0, 40, 30, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,
-126, 7, 0, 0, 0, 0, 0, 0, 91, 0, 0, 0, 15, 15, 94, 1, 92, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 56, 52, 43, 5, 0, 0, 0, 0, 56, 52, 43, 5, 0, 0, 0, 0, 88, 49, 43, 5, 0, 0, 0, 0,200, 50, 43, 5,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
+184,158,214, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,216,159,214, 3, 0, 0, 0, 0,152,157,214, 3, 0, 0, 0, 0,
+ 8, 29,201, 3, 0, 0, 0, 0,168, 24,201, 3, 0, 0, 0, 0, 72, 25,201, 3, 0, 0, 0, 0,200, 22,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,126, 7, 0, 0, 0, 0, 0, 0, 91, 0, 0, 0, 15, 15, 94, 1, 92, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 94,200, 3, 0, 0, 0, 0, 40, 94,200, 3, 0, 0, 0, 0,
+136,108,214, 3, 0, 0, 0, 0, 56,110,214, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,136,108,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 56,110,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,115, 68,
+ 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,175, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 93, 1, 0, 0,
+ 0, 0, 0, 0, 25, 0, 0, 0, 0,128,174, 67, 0, 0,200, 65, 0,128,174, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 94, 1, 26, 0, 94, 1, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,126, 7, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 94, 1, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 56,110,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,108,214, 3, 0, 0, 0, 0, 0, 0, 64,192, 0, 0,126, 67,
+ 0, 0, 0, 0, 0, 0, 72, 66, 50, 51, 74,193,154,209,131, 67, 0, 0, 0, 0, 0, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 93, 1, 0, 0,
+ 18, 0, 0, 0, 65, 0, 0, 0, 0, 0,128, 63, 0, 0, 72, 66, 0,124,146, 72, 0, 0, 72, 66,205,204,204, 61, 0, 0, 32, 65,
+ 72, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 4, 8, 0, 94, 1, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,126, 7, 0, 0, 26, 0, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 94, 1, 66, 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, 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, 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, 0, 0, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0, 40, 94,200, 3, 0, 0, 0, 0,
+190, 0, 0, 0, 1, 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, 0, 0, 0, 15, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 88, 49, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,200, 50, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,115, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0,
- 0, 0,175, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,174, 67,
- 0, 0,200, 65, 0,128,174, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0,
- 10, 0, 94, 1, 26, 0, 94, 1, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,
-126, 7, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 1, 26, 0,
- 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,200, 50, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 88, 49, 43, 5, 0, 0, 0, 0, 0, 0, 64,192, 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 72, 66, 50, 51, 74,193,
-154,209,131, 67, 0, 0, 0, 0, 0, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 93, 1, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 93, 1, 0, 0, 18, 0, 0, 0, 65, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 72, 66, 0,124,146, 72, 0, 0, 72, 66,205,204,204, 61, 0, 0, 32, 65, 72, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 4,
- 8, 0, 94, 1, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,
-126, 7, 0, 0, 26, 0, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 1, 66, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
+216,159,214, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,248,224,214, 3, 0, 0, 0, 0,184,158,214, 3, 0, 0, 0, 0,
+168, 24,201, 3, 0, 0, 0, 0,232, 25,201, 3, 0, 0, 0, 0, 8, 24,201, 3, 0, 0, 0, 0, 72, 25,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,126, 7, 0, 0, 93, 0, 0, 0,233, 3, 0, 0, 4, 4, 94, 1,141, 3, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,125,199, 3, 0, 0, 0, 0, 56,125,199, 3, 0, 0, 0, 0,
+232,111,214, 3, 0, 0, 0, 0, 40,161,214, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,232,111,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 40,161,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148, 67,
+ 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,175, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 93, 1, 0, 0,
+ 0, 0, 0, 0, 25, 0, 0, 0, 0,128,174, 67, 0, 0,200, 65, 0,128,174, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 94, 1, 26, 0, 94, 1, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,126, 7, 0, 0,208, 3, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 94, 1, 26, 0, 0, 0, 1, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 40,161,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,111,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,174, 67,
+ 0,128, 92,196, 0, 0, 0, 0, 0, 0, 0, 0,255,127,166, 67,255,191, 92,196, 0, 0, 0, 0, 77, 1, 0, 0, 94, 1, 0, 0,
+ 0, 0, 0, 0,114, 3, 0, 0, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 76, 1, 0, 0,
+ 0, 0, 0, 0,114, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64,
+ 10, 3, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0, 94, 1,115, 3, 77, 1,115, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,126, 7, 0, 0, 93, 0, 0, 0,207, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 94, 1,115, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+120, 77,214, 3, 0, 0, 0, 0, 8,210,214, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,120, 77,214, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 88, 79,214, 3, 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, 66, 85, 84, 84, 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 85, 84, 84, 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 67,111,110,116,101,120,116, 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, 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,220,255, 76, 1, 36, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0, 88, 79,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 40,193,214, 3, 0, 0, 0, 0,
+120, 77,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,114,101,110,100,101,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,114,101,110,100,101,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 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, 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,135,255, 76, 1, 61, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0, 56, 52, 43, 5, 0, 0, 0, 0,191, 0, 0, 0, 1, 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, 0, 0, 0, 15, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 40,193,214, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 8,195,214, 3, 0, 0, 0, 0, 88, 79,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, 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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, 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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,121,101,114,115, 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, 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,111,255, 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 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, 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, 0, 0, 0,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0, 88, 53, 43, 5, 0, 0, 0, 0,215, 0, 0, 0,
- 1, 0, 0, 0,232, 77, 43, 5, 0, 0, 0, 0,104, 48, 43, 5, 0, 0, 0, 0,120, 31, 43, 5, 0, 0, 0, 0, 88, 32, 43, 5,
- 0, 0, 0, 0, 8, 31, 43, 5, 0, 0, 0, 0,232, 31, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,
-126, 7, 0, 0, 93, 0, 0, 0,233, 3, 0, 0, 4, 4, 94, 1,141, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,168, 76, 43, 5, 0, 0, 0, 0,168, 76, 43, 5, 0, 0, 0, 0, 72, 54, 43, 5, 0, 0, 0, 0,184, 55, 43, 5,
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,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 72, 54, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,184, 55, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0,
- 0, 0,175, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,174, 67,
- 0, 0,200, 65, 0,128,174, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0,
- 10, 0, 94, 1, 26, 0, 94, 1, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,
-126, 7, 0, 0,208, 3, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 1, 26, 0,
- 0, 0, 1, 0, 1, 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,
+ 68, 65, 84, 65, 88, 1, 0, 0, 8,195,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,232,196,214, 3, 0, 0, 0, 0,
+ 40,193,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,100,105,109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,100,105,109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,105,109,101,110,115,105,111,
+110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140,254, 76, 1,203, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,184, 55, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 72, 54, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,174, 67, 0,128, 92,196, 0, 0, 0, 0, 0, 0, 0, 0,
-255,127,166, 67,255,191, 92,196, 0, 0, 0, 0, 77, 1, 0, 0, 94, 1, 0, 0, 0, 0, 0, 0,114, 3, 0, 0, 0, 0, 0, 0,
- 82, 1, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 0, 0,114, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 3, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4,
- 6, 0, 94, 1,115, 3, 77, 1,115, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,
-126, 7, 0, 0, 93, 0, 0, 0,207, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 1,115, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,232,196,214, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0,200,198,214, 3, 0, 0, 0, 0, 8,195,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 57, 43, 5, 0, 0, 0, 0, 8, 75, 43, 5,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 40, 57, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,200, 58, 43, 5,
- 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, 66, 85, 84, 84,
- 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 85, 84, 84,
- 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,110,116,
-101,120,116, 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, 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,220,255,
- 76, 1, 36, 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, 0, 0, 0, 0, 0, 65,110,116,105, 45, 65,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58,254, 76, 1, 58, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,200, 58, 43, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,104, 60, 43, 5, 0, 0, 0, 0, 40, 57, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,110,100,101,114, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,110,100,101,114, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0,200,198,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,168,200,214, 3, 0, 0, 0, 0,
+232,196,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,109,111,116,105,111,110, 95, 98,108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,109,111,116,105,111,110, 95, 98,108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 97,109,112,108,101,100, 32,
+ 77,111,116,105,111,110, 32, 66,108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,254, 76, 1, 0, 0,
+ 20, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 5, 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, 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, 0,135,255, 76, 1, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,168,200,214, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0,136,202,214, 3, 0, 0, 0, 0,200,198,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,104, 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,104, 60, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 8, 62, 43, 5,
- 0, 0, 0, 0,200, 58, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,121,101,
-114,115, 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, 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,111,255,
- 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,104, 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83,104, 97,100,105,110,103, 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, 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, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 8, 62, 43, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,168, 63, 43, 5, 0, 0, 0, 0,104, 60, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,105,111,110,115,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,254, 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 6, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,105,111,110,115,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,105,109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140,254, 76, 1,203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 3, 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,
+ 68, 65, 84, 65, 88, 1, 0, 0,136,202,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,104,204,214, 3, 0, 0, 0, 0,
+168,200,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,112,101,114,102,111,114,109, 97,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,112,101,114,102,111,114,109, 97,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,101,114,102,111,114,109, 97,
+110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,242,253, 76, 1, 0, 0,
+ 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 7, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,168, 63, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 72, 65, 43, 5,
- 0, 0, 0, 0, 8, 62, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,110,116,105,
- 45, 65,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58,254,
- 76, 1, 58, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 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, 68, 65, 84, 65, 88, 1, 0, 0,104,204,214, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 72,206,214, 3, 0, 0, 0, 0,136,202,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,
+103, 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, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,
+103, 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, 0, 0, 0, 0, 0, 0, 0, 80,111,115,116, 32, 80,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,218,253, 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 8, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 72, 65, 43, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,232, 66, 43, 5, 0, 0, 0, 0,168, 63, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,116,105,111,110, 95, 98,108,117,
-114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,116,105,111,110, 95, 98,108,117,
-114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 97,109,112,108,101,100, 32, 77,111,116,105,111,110, 32, 66,108,117,114, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,254, 76, 1, 0, 0, 20, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
- 5, 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, 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,
+ 68, 65, 84, 65, 88, 1, 0, 0, 72,206,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 40,208,214, 3, 0, 0, 0, 0,
+104,204,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,115,116, 97,109,112, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,115,116, 97,109,112, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,109,112, 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, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,232, 66, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,136, 68, 43, 5,
- 0, 0, 0, 0, 72, 65, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,115,104, 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,115,104, 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,104, 97,100,
-105,110,103, 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, 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, 10,254,
- 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 6, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,194,253, 76, 1, 0, 0,
+ 20, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 9, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,136, 68, 43, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 40, 70, 43, 5, 0, 0, 0, 0,232, 66, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,109, 97,110, 99,
-101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,109, 97,110, 99,
-101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,101,114,102,111,114,109, 97,110, 99,101, 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, 68, 65, 84, 65, 88, 1, 0, 0, 40,208,214, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 8,210,214, 3, 0, 0, 0, 0, 72,206,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,242,253, 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
- 7, 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, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 79,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 40, 70, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,200, 71, 43, 5,
- 0, 0, 0, 0,136, 68, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 80,111,115,116,
- 32, 80,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,218,253,
- 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 8, 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, 40,253, 76, 1,130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 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, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,200, 71, 43, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,104, 73, 43, 5, 0, 0, 0, 0, 40, 70, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 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, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0, 8,210,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 40,208,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95, 98, 97,107,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95, 98, 97,107,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 97,107,101, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,109,112, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,253, 76, 1, 0, 0,
+ 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 11, 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, 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, 0,194,253, 76, 1, 0, 0, 20, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
- 9, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 0, 0, 0, 56,125,199, 3, 0, 0, 0, 0,
+179, 0, 0, 0, 1, 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, 0, 0, 0, 4, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0,104, 73, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 8, 75, 43, 5,
- 0, 0, 0, 0,200, 71, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,117,116,112,
-117,116, 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, 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, 40,253,
- 76, 1,130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 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, 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, 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, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 8, 75, 43, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104, 73, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,107,101, 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, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,107,101, 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, 2, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,255, 21, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,160, 0, 0, 0,248,224,214, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 8,230,214, 3, 0, 0, 0, 0,
+216,159,214, 3, 0, 0, 0, 0,104, 28,201, 3, 0, 0, 0, 0,200, 27,201, 3, 0, 0, 0, 0, 40, 27,201, 3, 0, 0, 0, 0,
+ 8, 29,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 3, 0, 0, 31, 6, 0, 0, 0, 0, 0, 0,139, 1, 0, 0,
+ 1, 1, 27, 3,140, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,211,214, 3, 0, 0, 0, 0,
+232,211,214, 3, 0, 0, 0, 0,216,162,214, 3, 0, 0, 0, 0,152,169,214, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
+216,162,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,136,164,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 64,113, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,192, 70, 68, 0, 0, 0, 0, 0, 0,208, 65,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 97,107,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 26, 3, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128, 70, 68, 0, 0,200, 65, 0,128, 70, 68, 0, 0,200, 65,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 27, 3, 26, 0, 27, 3, 26, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 3, 0, 0, 31, 6, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 3, 26, 0, 0, 0, 1, 0, 2, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,253, 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
- 11, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
+136,164,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 56,166,214, 3, 0, 0, 0, 0,216,162,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 15, 67, 0, 64, 70,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67,255,127, 70,196, 0, 0, 0, 0,
+143, 0, 0, 0,160, 0, 0, 0, 18, 0, 0, 0, 43, 3, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
+ 0, 0, 0, 0,142, 0, 0, 0, 18, 0, 0, 0, 43, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,160, 0, 44, 3,143, 0, 26, 3, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 3, 0, 0, 5, 3, 0, 0, 26, 0, 0, 0,139, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,114, 1, 0, 0, 5, 0, 3, 0, 1, 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, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65,248, 0, 0, 0,168, 76, 43, 5, 0, 0, 0, 0,180, 0, 0, 0, 1, 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, 0, 0, 0, 4, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,
+ 56,166,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,232,167,214, 3, 0, 0, 0, 0,136,164,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 16, 67, 0, 0,206,194, 0, 0, 0, 0, 0, 0, 0, 0,231,102, 16, 67, 0, 0,206,194, 0, 0, 0, 0,
+143, 0, 0, 0,160, 0, 0, 0, 18, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
+ 0, 0, 0, 0,142, 0, 0, 0, 18, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,160, 0,120, 0,143, 0,102, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 3, 0, 0, 31, 6, 0, 0, 26, 0, 0, 0, 26, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 6, 0, 34, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,
+232,167,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,152,169,214, 3, 0, 0, 0, 0, 56,166,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 35, 67, 0,192,108,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67, 0, 0,184,195, 0, 0, 0, 0,
+163, 0, 0, 0,180, 0, 0, 0, 18, 0, 0, 0,129, 1, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
+ 0, 0, 0, 0,162, 0, 0, 0, 18, 0, 0, 0,129, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,180, 0,130, 1,163, 0,112, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 6, 0, 0, 31, 6, 0, 0, 26, 0, 0, 0,139, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 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, 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, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 21, 0, 0,
-160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,232, 77, 43, 5,
- 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,120, 91, 43, 5, 0, 0, 0, 0, 88, 53, 43, 5, 0, 0, 0, 0, 24, 34, 43, 5,
- 0, 0, 0, 0,168, 33, 43, 5, 0, 0, 0, 0, 56, 33, 43, 5, 0, 0, 0, 0,136, 34, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 5, 3, 0, 0, 31, 6, 0, 0, 0, 0, 0, 0,139, 1, 0, 0, 1, 1, 27, 3,140, 1, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 89, 43, 5, 0, 0, 0, 0,200, 89, 43, 5, 0, 0, 0, 0,216, 78, 43, 5,
- 0, 0, 0, 0,152, 84, 43, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,216, 78, 43, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 72, 80, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,113, 68, 0, 0, 0, 0,
- 0, 0,208, 65, 0, 0, 0, 0, 0,192, 70, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 26, 3, 0, 0, 0, 0, 0, 0,
- 25, 0, 0, 0, 0,128, 70, 68, 0, 0,200, 65, 0,128, 70, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 27, 3, 26, 0, 27, 3, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 5, 3, 0, 0, 31, 6, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 27, 3, 26, 0, 0, 0, 1, 0, 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
+152,169,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,167,214, 3, 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, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 72, 80, 43, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0,184, 81, 43, 5, 0, 0, 0, 0,216, 78, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67, 0, 64, 70,196,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67,255,127, 70,196, 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0, 18, 0, 0, 0,
- 43, 3, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 18, 0, 0, 0,
- 43, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0,
- 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,160, 0, 44, 3,143, 0, 26, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 5, 3, 0, 0, 5, 3, 0, 0, 26, 0, 0, 0,139, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0,114, 1, 0, 0, 5, 0, 3, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,184, 81, 43, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 40, 83, 43, 5, 0, 0, 0, 0, 72, 80, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 67, 0, 0,206,194,
- 0, 0, 0, 0, 0, 0, 0, 0,231,102, 16, 67, 0, 0,206,194, 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0, 18, 0, 0, 0,
-119, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 18, 0, 0, 0,
-119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0,
- 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,160, 0,120, 0,143, 0,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 5, 3, 0, 0, 31, 6, 0, 0, 26, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 6, 0, 34, 0, 2, 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, 0, 5, 3, 0, 0, 31, 6, 0, 0, 26, 0, 0, 0,139, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 3,114, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 40, 83, 43, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0,152, 84, 43, 5, 0, 0, 0, 0,184, 81, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67, 0,192,108,196,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67, 0, 0,184,195, 0, 0, 0, 0,163, 0, 0, 0,180, 0, 0, 0, 18, 0, 0, 0,
-129, 1, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 18, 0, 0, 0,
-129, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0,
- 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,180, 0,130, 1,163, 0,112, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 31, 6, 0, 0, 31, 6, 0, 0, 26, 0, 0, 0,139, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 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, 0, 24,226,214, 3, 0, 0, 0, 0, 68, 65, 84, 65,112, 3, 0, 0,
+ 24,226,214, 3, 0, 0, 0, 0,173, 0, 0, 0, 1, 0, 0, 0, 93,101,230, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 30,133,119, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,154, 65,128,191, 0, 0,128,191,
+ 0, 0, 0, 0, 0, 0, 0, 0, 72, 1, 77,190, 0, 0, 0, 0,221,149, 47, 63, 85,126,162,190, 8,165, 39, 63, 0, 0, 0, 0,
+ 51, 70, 58, 63,225,251,159, 62,149, 84, 28,191, 0, 0, 0, 0,191, 56, 49,188, 54, 53,101, 63, 50,247,227, 62, 0, 0, 0, 0,
+ 90, 38,173,190,254,221,192,190,152, 9, 52,193, 0, 0,128, 63,223,149, 47, 63, 55, 70, 58, 63,192, 56, 49,188, 0, 0, 0, 0,
+ 87,126,162,190,228,251,159, 62, 56, 53,101, 63, 0, 0, 0, 0, 7,165, 39, 63,150, 84, 28,191, 50,247,227, 62, 0, 0, 0, 0,
+110,101,239, 64,151, 62,208,192, 77,255,170, 64, 0, 0,128, 63, 42, 6,158, 63, 99, 28,157,191,244,250, 39,191, 8,165, 39,191,
+211,164,167, 63, 55,175,154, 63,180,164, 28, 63,149, 84, 28, 63, 39,127,159,188,135,157, 93, 64, 8,108,228,190, 50,247,227,190,
+ 4,213, 27,191,122,122,186,191,216, 49, 49, 65,152, 9, 52, 65, 25, 25,195, 62,176,249,206, 62,128,238,196,187, 0, 0,192,179,
+ 55, 15,168,189,201,118,165, 61,152, 15,109, 62, 0, 0,152, 51,211,120, 21,194,144, 5, 2, 66, 6,136,213,193,193,214,159,192,
+219, 38, 19, 66,196,173,255,193,154,101,210, 65,173, 40,160, 64,221,149, 47, 63, 85,126,162,190, 8,165, 39, 63, 0, 0, 0, 0,
+ 51, 70, 58, 63,225,251,159, 62,149, 84, 28,191, 0, 0, 0, 0,191, 56, 49,188, 54, 53,101, 63, 50,247,227, 62, 0, 0, 0, 0,
+ 90, 38,173,190,254,221,192,190,152, 9, 52,193, 0, 0,128, 63, 42, 6,158, 63, 99, 28,157,191,244,250, 39,191, 8,165, 39,191,
+211,164,167, 63, 55,175,154, 63,180,164, 28, 63,149, 84, 28, 63, 39,127,159,188,135,157, 93, 64, 8,108,228,190, 50,247,227,190,
+ 4,213, 27,191,122,122,186,191,216, 49, 49, 65,152, 9, 52, 65, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,152, 84, 43, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 83, 43, 5, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 5, 3, 0, 0, 31, 6, 0, 0, 26, 0, 0, 0,139, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 27, 3,114, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 62,250,150, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 62,250,150, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,250,150, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,241, 22, 72, 63, 78,162,246,190, 44, 8, 90,190, 3, 35,171,190,
+214,211,111, 65,214,211,111, 65, 0, 0, 0, 0, 0, 0, 0, 0, 80, 49,183, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,160, 65, 1, 2, 0, 0,255,255, 0, 0, 92, 62, 55, 63, 56,186,224,190,237,203,148,190, 3,236,234,190, 1, 0, 0, 0,
+ 0, 0,128, 63,190,133, 65, 66,100,212, 90, 66, 31,183,118, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 96, 1, 0, 0,232,211,214, 3, 0, 0, 0, 0,174, 0, 0, 0, 1, 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, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 32, 65,205,204, 76, 62, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0,200,213,217, 3, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 8, 86, 43, 5, 0, 0, 0, 0, 68, 65, 84, 65,120, 3, 0, 0, 8, 86, 43, 5, 0, 0, 0, 0,174, 0, 0, 0,
- 1, 0, 0, 0, 93,101,230, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30,133,119, 64, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,154, 65,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0, 72, 1, 77,190,
- 0, 0, 0, 0,221,149, 47, 63, 85,126,162,190, 8,165, 39, 63, 0, 0, 0, 0, 51, 70, 58, 63,225,251,159, 62,149, 84, 28,191,
- 0, 0, 0, 0,191, 56, 49,188, 54, 53,101, 63, 50,247,227, 62, 0, 0, 0, 0, 90, 38,173,190,254,221,192,190,152, 9, 52,193,
- 0, 0,128, 63,223,149, 47, 63, 55, 70, 58, 63,192, 56, 49,188, 0, 0, 0, 0, 87,126,162,190,228,251,159, 62, 56, 53,101, 63,
- 0, 0, 0, 0, 7,165, 39, 63,150, 84, 28,191, 50,247,227, 62, 0, 0, 0, 0,110,101,239, 64,151, 62,208,192, 77,255,170, 64,
- 0, 0,128, 63, 42, 6,158, 63, 99, 28,157,191,244,250, 39,191, 8,165, 39,191,211,164,167, 63, 55,175,154, 63,180,164, 28, 63,
-149, 84, 28, 63, 39,127,159,188,135,157, 93, 64, 8,108,228,190, 50,247,227,190, 4,213, 27,191,122,122,186,191,216, 49, 49, 65,
-152, 9, 52, 65, 25, 25,195, 62,176,249,206, 62,128,238,196,187, 0, 0,192,179, 55, 15,168,189,201,118,165, 61,152, 15,109, 62,
- 0, 0,152, 51,211,120, 21,194,144, 5, 2, 66, 6,136,213,193,193,214,159,192,219, 38, 19, 66,196,173,255,193,154,101,210, 65,
-173, 40,160, 64,221,149, 47, 63, 85,126,162,190, 8,165, 39, 63, 0, 0, 0, 0, 51, 70, 58, 63,225,251,159, 62,149, 84, 28,191,
- 0, 0, 0, 0,191, 56, 49,188, 54, 53,101, 63, 50,247,227, 62, 0, 0, 0, 0, 90, 38,173,190,254,221,192,190,152, 9, 52,193,
- 0, 0,128, 63, 42, 6,158, 63, 99, 28,157,191,244,250, 39,191, 8,165, 39,191,211,164,167, 63, 55,175,154, 63,180,164, 28, 63,
-149, 84, 28, 63, 39,127,159,188,135,157, 93, 64, 8,108,228,190, 50,247,227,190, 4,213, 27,191,122,122,186,191,216, 49, 49, 65,
-152, 9, 52, 65, 62,250,150, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,250,150, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,250,150, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63,241, 22, 72, 63, 78,162,246,190, 44, 8, 90,190, 3, 35,171,190,214,211,111, 65,214,211,111, 65, 0, 0, 0, 0,
- 0, 0, 0, 0, 80, 49,183, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0,255,255, 1, 0, 0, 0, 0, 0, 0, 0,
- 2, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 3, 0, 8, 8,128, 0, 0, 0, 12, 66,
+ 0, 0,128, 63,205,204,204, 61, 0, 0,250, 67, 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, 16, 0, 10, 0, 7, 1, 0, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
+ 8,230,214, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 40,231,214, 3, 0, 0, 0, 0,248,224,214, 3, 0, 0, 0, 0,
+136, 26,201, 3, 0, 0, 0, 0,104, 23,201, 3, 0, 0, 0, 0,232, 25,201, 3, 0, 0, 0, 0, 40, 27,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 6, 0, 0,141, 1, 0, 0,233, 3, 0, 0, 16, 16, 32, 6, 93, 2, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168,174,214, 3, 0, 0, 0, 0,168,174,214, 3, 0, 0, 0, 0,
+ 72,171,214, 3, 0, 0, 0, 0,248,172,214, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 72,171,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0,248,172,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 66, 68,
+ 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,196, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 31, 6, 0, 0,
+ 0, 0, 0, 0, 25, 0, 0, 0, 0,224,195, 68, 0, 0,200, 65, 0,224,195, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 32, 6, 26, 0, 32, 6, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 6, 0, 0,141, 1, 0, 0,166, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 32, 6, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,248,172,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,171,214, 3, 0, 0, 0, 0, 0, 0, 32,193, 0, 0, 0, 68,
+ 0, 0, 32,193, 0, 0, 0, 68,128,195,217,195,192,225,108, 68, 96,240,187, 64, 62, 16,253, 67, 15, 6, 0, 0, 32, 6, 0, 0,
+ 18, 0, 0, 0, 66, 2, 0, 0, 0, 0, 0, 0, 14, 6, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 14, 6, 0, 0,
+ 18, 0, 0, 0, 66, 2, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,250, 70, 0, 0,250, 70,236, 81,184, 61, 10,215, 19, 64,
+ 10, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, 32, 6, 67, 2, 15, 6, 49, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 6, 0, 0,167, 1, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 32, 6, 67, 2, 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, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65, 48, 1, 0, 0,168,174,214, 3, 0, 0, 0, 0,
+191, 0, 0, 0, 1, 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, 0, 0, 0, 16, 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, 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, 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, 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, 10,215, 19, 64, 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, 0, 0, 0, 0, 0, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 10,206, 97, 63, 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, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
+ 40,231,214, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,230,214, 3, 0, 0, 0, 0,
+232, 20,201, 3, 0, 0, 0, 0,136, 26,201, 3, 0, 0, 0, 0,200, 27,201, 3, 0, 0, 0, 0,104, 28,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0,139, 1, 0, 0, 6, 6, 4, 3,140, 1, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,232,214, 3, 0, 0, 0, 0, 72,232,214, 3, 0, 0, 0, 0,
+ 88,176,214, 3, 0, 0, 0, 0,184,179,214, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 88,176,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 8,178,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,215, 67,
+ 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0, 65, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 3, 3, 0, 0,
+ 0, 0, 0, 0, 25, 0, 0, 0, 0,192, 64, 68, 0, 0,200, 65, 0,192, 64, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 4, 3, 26, 0, 4, 3, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 26, 0, 0, 0, 1, 0, 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 92, 62, 55, 63, 56,186,224,190,237,203,148,190, 3,236,234,190, 1, 0, 0, 0, 0, 0,128, 63,190,133, 65, 66,
-100,212, 90, 66, 31,183,118, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 96, 1, 0, 0,200, 89, 43, 5, 0, 0, 0, 0,175, 0, 0, 0, 1, 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, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65,
-205,204, 76, 62, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0,216,191, 45, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 8,178,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0,184,179,214, 3, 0, 0, 0, 0, 88,176,214, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 3, 0, 8, 8,128, 0, 0, 0, 12, 66, 0, 0,128, 63,
-205,204,204, 61, 0, 0,250, 67, 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, 16, 0, 10, 0, 7, 1, 0, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,120, 91, 43, 5,
- 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,200, 96, 43, 5, 0, 0, 0, 0,232, 77, 43, 5, 0, 0, 0, 0,200, 32, 43, 5,
- 0, 0, 0, 0,152, 30, 43, 5, 0, 0, 0, 0, 88, 32, 43, 5, 0, 0, 0, 0, 56, 33, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 31, 6, 0, 0,141, 1, 0, 0,233, 3, 0, 0, 16, 16, 32, 6, 93, 2, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 95, 43, 5, 0, 0, 0, 0, 72, 95, 43, 5, 0, 0, 0, 0,104, 92, 43, 5,
- 0, 0, 0, 0,216, 93, 43, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,104, 92, 43, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0,216, 93, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 66, 68, 0, 0, 0, 0,
- 0, 0,208, 65, 0, 0, 0, 0, 0, 0,196, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 31, 6, 0, 0, 0, 0, 0, 0,
- 25, 0, 0, 0, 0,224,195, 68, 0, 0,200, 65, 0,224,195, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 32, 6, 26, 0, 32, 6, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 31, 6, 0, 0,141, 1, 0, 0,166, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 32, 6, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,216, 93, 43, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104, 92, 43, 5, 0, 0, 0, 0, 0, 0, 32,193, 0, 0, 0, 68, 0, 0, 32,193,
- 0, 0, 0, 68,128,195,217,195,192,225,108, 68, 96,240,187, 64, 62, 16,253, 67, 15, 6, 0, 0, 32, 6, 0, 0, 18, 0, 0, 0,
- 66, 2, 0, 0, 0, 0, 0, 0, 14, 6, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 14, 6, 0, 0, 18, 0, 0, 0,
- 66, 2, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,250, 70, 0, 0,250, 70,236, 81,184, 61, 10,215, 19, 64, 10, 0, 0, 0,
- 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, 32, 6, 67, 2, 15, 6, 49, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 31, 6, 0, 0,167, 1, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 32, 6, 67, 2, 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, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65, 48, 1, 0, 0, 72, 95, 43, 5, 0, 0, 0, 0,192, 0, 0, 0,
- 1, 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, 0, 0, 0, 16, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0,139, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 3, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 10,215, 19, 64, 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, 0, 0, 0, 0, 0, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 10,206, 97, 63, 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, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,200, 96, 43, 5,
- 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120, 91, 43, 5, 0, 0, 0, 0,216, 28, 43, 5,
- 0, 0, 0, 0,200, 32, 43, 5, 0, 0, 0, 0,168, 33, 43, 5, 0, 0, 0, 0, 24, 34, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0,139, 1, 0, 0, 6, 6, 4, 3,140, 1, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,102, 43, 5, 0, 0, 0, 0, 8,102, 43, 5, 0, 0, 0, 0,184, 97, 43, 5,
- 0, 0, 0, 0,152,100, 43, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,184, 97, 43, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 40, 99, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,215, 67, 0, 0, 0, 0,
- 0, 0,208, 65, 0, 0, 0, 0, 0, 0, 65, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0,
- 25, 0, 0, 0, 0,192, 64, 68, 0, 0,200, 65, 0,192, 64, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 4, 3, 26, 0, 4, 3, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 4, 3, 26, 0, 0, 0, 1, 0, 2, 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, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,184,179,214, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,178,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 67, 0, 0,129,191, 0,128, 0, 64, 0, 0,100,190, 0,128,156, 63, 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, 0, 0, 0, 0, 4, 3, 0, 0,
+ 0, 0, 0, 0,114, 1, 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, 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, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 26, 0, 0, 0,139, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 4, 3,114, 1, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 40, 99, 43, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0,152,100, 43, 5, 0, 0, 0, 0,184, 97, 43, 5, 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, 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, 68, 65, 84, 65, 40, 33, 0, 0, 72,232,214, 3, 0, 0, 0, 0,
+184, 0, 0, 0, 1, 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, 0, 0, 0, 6, 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,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 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, 0, 0, 0,240, 65, 0, 0, 0, 0,154,153,153, 62,
+ 0, 0, 0, 0,100, 0, 0, 0,154,153,153, 62,100, 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, 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, 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, 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, 26, 0, 0, 0,139, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 3, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,152,100, 43, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 99, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0,
- 0, 0,128, 67, 0, 0,129,191, 0,128, 0, 64, 0, 0,100,190, 0,128,156, 63, 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, 0, 0, 0, 0, 4, 3, 0, 0, 0, 0, 0, 0,
-114, 1, 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, 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, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 26, 0, 0, 0,139, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 4, 3,114, 1, 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, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 33, 0, 0, 8,102, 43, 5, 0, 0, 0, 0,185, 0, 0, 0,
- 1, 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, 0, 0, 0, 6, 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,
-100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 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, 0, 0, 0,240, 65, 0, 0, 0, 0,154,153,153, 62, 0, 0, 0, 0,
-100, 0, 0, 0,154,153,153, 62,100, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -1302,6 +1309,7 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 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, 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, 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, 0, 0, 0,
@@ -1310,7 +1318,6 @@ char datatoc_startup_blend[]= {
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,
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,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0,
@@ -1432,2446 +1439,2463 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 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,100, 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,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 83, 78, 0, 0, 8, 1, 0, 0,248, 9,215, 3, 0, 0, 0, 0,
+210, 0, 0, 0, 1, 0, 0, 0,152, 66,216, 3, 0, 0, 0, 0, 8,156,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 68,101,102, 97,117,108,116, 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, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+168, 29,201, 3, 0, 0, 0, 0,136, 36,201, 3, 0, 0, 0, 0,200,123,171, 3, 0, 0, 0, 0,120,135,171, 3, 0, 0, 0, 0,
+184, 11,215, 3, 0, 0, 0, 0, 56, 16,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,102, 10, 64, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,168, 29,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0, 72, 30,201, 3, 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, 68, 65, 84, 65, 32, 0, 0, 0, 72, 30,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+232, 30,201, 3, 0, 0, 0, 0,168, 29,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,178, 2, 0, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0,232, 30,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,136, 31,201, 3, 0, 0, 0, 0,
+ 72, 30,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 5,178, 2, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+136, 31,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 40, 32,201, 3, 0, 0, 0, 0,232, 30,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 70, 5, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 40, 32,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0,200, 32,201, 3, 0, 0, 0, 0,136, 31,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,151, 2, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,200, 32,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+104, 33,201, 3, 0, 0, 0, 0, 40, 32,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 5,151, 2, 1, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0,104, 33,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 8, 34,201, 3, 0, 0, 0, 0,
+200, 32,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112, 4, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+ 8, 34,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,168, 34,201, 3, 0, 0, 0, 0,104, 33,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,112, 4,151, 2, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,168, 34,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0, 72, 35,201, 3, 0, 0, 0, 0, 8, 34,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+112, 4, 56, 2, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 72, 35,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+232, 35,201, 3, 0, 0, 0, 0,168, 34,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 5, 56, 2, 0, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0,232, 35,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,136, 36,201, 3, 0, 0, 0, 0,
+ 72, 35,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+136, 36,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 35,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,112, 4, 84, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,200,123,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,120,124,171, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 30,201, 3, 0, 0, 0, 0,
+232, 30,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,120,124,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 40,125,171, 3, 0, 0, 0, 0,200,123,171, 3, 0, 0, 0, 0, 72, 30,201, 3, 0, 0, 0, 0,
+ 40, 32,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 40,125,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,216,125,171, 3, 0, 0, 0, 0,120,124,171, 3, 0, 0, 0, 0,232, 30,201, 3, 0, 0, 0, 0,
+200, 32,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,216,125,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,136,126,171, 3, 0, 0, 0, 0, 40,125,171, 3, 0, 0, 0, 0, 40, 32,201, 3, 0, 0, 0, 0,
+200, 32,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,136,126,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 56,127,171, 3, 0, 0, 0, 0,216,125,171, 3, 0, 0, 0, 0,168, 29,201, 3, 0, 0, 0, 0,
+104, 33,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 56,127,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,232,127,171, 3, 0, 0, 0, 0,136,126,171, 3, 0, 0, 0, 0,136, 31,201, 3, 0, 0, 0, 0,
+104, 33,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,232,127,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,152,128,171, 3, 0, 0, 0, 0, 56,127,171, 3, 0, 0, 0, 0, 40, 32,201, 3, 0, 0, 0, 0,
+ 8, 34,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,152,128,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 72,129,171, 3, 0, 0, 0, 0,232,127,171, 3, 0, 0, 0, 0,200, 32,201, 3, 0, 0, 0, 0,
+ 8, 34,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 72,129,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,248,129,171, 3, 0, 0, 0, 0,152,128,171, 3, 0, 0, 0, 0,104, 33,201, 3, 0, 0, 0, 0,
+168, 34,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,248,129,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,168,130,171, 3, 0, 0, 0, 0, 72,129,171, 3, 0, 0, 0, 0, 8, 34,201, 3, 0, 0, 0, 0,
+168, 34,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,168,130,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 88,131,171, 3, 0, 0, 0, 0,248,129,171, 3, 0, 0, 0, 0,200, 32,201, 3, 0, 0, 0, 0,
+ 72, 35,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 88,131,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 8,132,171, 3, 0, 0, 0, 0,168,130,171, 3, 0, 0, 0, 0,136, 31,201, 3, 0, 0, 0, 0,
+ 72, 35,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 8,132,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,184,132,171, 3, 0, 0, 0, 0, 88,131,171, 3, 0, 0, 0, 0,168, 34,201, 3, 0, 0, 0, 0,
+ 72, 35,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,184,132,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,104,133,171, 3, 0, 0, 0, 0, 8,132,171, 3, 0, 0, 0, 0,168, 29,201, 3, 0, 0, 0, 0,
+232, 35,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,104,133,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 24,134,171, 3, 0, 0, 0, 0,184,132,171, 3, 0, 0, 0, 0, 40, 32,201, 3, 0, 0, 0, 0,
+232, 35,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 24,134,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,200,134,171, 3, 0, 0, 0, 0,104,133,171, 3, 0, 0, 0, 0, 8, 34,201, 3, 0, 0, 0, 0,
+136, 36,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,200,134,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,120,135,171, 3, 0, 0, 0, 0, 24,134,171, 3, 0, 0, 0, 0,104, 33,201, 3, 0, 0, 0, 0,
+136, 36,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,120,135,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,134,171, 3, 0, 0, 0, 0,232, 35,201, 3, 0, 0, 0, 0,
+136, 36,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,184, 11,215, 3, 0, 0, 0, 0,
+214, 0, 0, 0, 1, 0, 0, 0,216, 12,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 32,201, 3, 0, 0, 0, 0,
+ 72, 30,201, 3, 0, 0, 0, 0,232, 30,201, 3, 0, 0, 0, 0,200, 32,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 70, 5, 0, 0,152, 2, 0, 0,178, 2, 0, 0, 7, 7, 71, 5, 27, 0, 1, 0, 0, 0, 0, 0, 7, 0, 8, 0,
+ 72,207,177, 3, 0, 0, 0, 0, 24,199,207, 3, 0, 0, 0, 0, 24,199,207, 3, 0, 0, 0, 0,104,181,214, 3, 0, 0, 0, 0,
+ 24,183,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,196,207, 3, 0, 0, 0, 0,
+216,196,207, 3, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,104,181,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+ 24,183,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,163, 68, 0, 0, 0, 0, 0, 0,208, 65,
+ 0, 0, 0, 0, 0,224,168, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 70, 5, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0,
+ 0,192,168, 68, 0, 0,200, 65, 0,192,168, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3,
+ 4, 0, 12, 0, 10, 0, 71, 5, 26, 0, 71, 5, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 70, 5, 0, 0,152, 2, 0, 0,177, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 71, 5, 26, 0, 2, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 88, 6,178, 3, 0, 0, 0, 0,120,128,214, 15, 0, 0, 0, 0,120,128,214, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,120, 13,163, 3, 0, 0, 0, 0,216, 19,163, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 24,183,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,104,181,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,109, 69, 0, 0,128,192, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0,192,168, 68, 0, 0, 0, 0, 0, 0, 0, 64, 70, 5, 0, 0, 87, 5, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 69, 5, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 2, 0, 0, 0, 1, 0, 3, 3,
+ 2, 0, 0, 4, 10, 0, 87, 5, 2, 0, 70, 5, 2, 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,178, 2, 0, 0,178, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 40, 5,178, 3, 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, 0, 0, 0, 0,232, 20,163, 3, 0, 0, 0, 0,248,116,208, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,216, 12,215, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,
+248, 13,215, 3, 0, 0, 0, 0,184, 11,215, 3, 0, 0, 0, 0,104, 33,201, 3, 0, 0, 0, 0,168, 34,201, 3, 0, 0, 0, 0,
+ 72, 35,201, 3, 0, 0, 0, 0,136, 31,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,113, 4, 0, 0, 70, 5, 0, 0,
+ 0, 0, 0, 0, 55, 2, 0, 0, 4, 4,214, 0, 56, 2, 1, 0, 0, 0, 0, 0, 0, 0, 8, 0,248,205,177, 3, 0, 0, 0, 0,
+184,126,199, 3, 0, 0, 0, 0,184,126,199, 3, 0, 0, 0, 0,200,184,214, 3, 0, 0, 0, 0,120,186,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,205,207, 3, 0, 0, 0, 0, 88,195,207, 3, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 1, 0, 0,200,184,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,120,186,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0, 86, 67,
+ 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,213, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 85, 67, 0, 0,200, 65,
+ 0, 0, 85, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,214, 0,
+ 26, 0,214, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,113, 4, 0, 0, 70, 5, 0, 0,
+ 30, 2, 0, 0, 55, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,214, 0, 26, 0, 4, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 3,178, 3, 0, 0, 0, 0,
+200, 53,163, 3, 0, 0, 0, 0,200, 53,163, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 8,118,208, 3, 0, 0, 0, 0, 56,121,208, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 1, 0, 0,120,186,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+200,184,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,178, 67, 0, 0, 61,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 67,
+ 0,128, 7,196, 0, 0, 0, 0,197, 0, 0, 0,214, 0, 0, 0, 0, 0, 0, 0, 29, 2, 0, 0, 0, 0, 0, 0, 74, 1, 0, 0,
+ 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,196, 0, 0, 0, 0, 0, 0, 0, 29, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 1, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,214, 0,
+ 30, 2,197, 0, 30, 2, 0, 0, 72, 91,192, 15, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,113, 4, 0, 0, 70, 5, 0, 0,
+ 0, 0, 0, 0, 29, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,214, 0, 30, 2, 5, 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,200, 2,178, 3, 0, 0, 0, 0,
+ 8,150,212, 15, 0, 0, 0, 0,152, 72,163, 3, 0, 0, 0, 0,200,213,214, 3, 0, 0, 0, 0,184, 75,215, 3, 0, 0, 0, 0,
+ 72,122,208, 3, 0, 0, 0, 0,152,127,208, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0,200,213,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,168,215,214, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,232, 35,178, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 85, 84, 84, 79, 78, 83, 95,
+ 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 85, 84, 84, 79, 78, 83, 95,
+ 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,110,116,101,120,116, 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, 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,220,255,197, 0, 36, 0,
+ 0, 0, 0, 0, 0, 0, 38, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,168,215,214, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0,136,217,214, 3, 0, 0, 0, 0,200,213,214, 3, 0, 0, 0, 0, 40, 34,221, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,110,100,101,114, 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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,110,100,101,114, 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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 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, 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,135,255,197, 0, 61, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 11, 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, 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,100, 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,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 83, 78, 0, 0, 8, 1, 0, 0, 8,136, 43, 5, 0, 0, 0, 0,211, 0, 0, 0,
- 1, 0, 0, 0,104,139, 44, 5, 0, 0, 0, 0,136, 27, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 83, 82, 68,101,102, 97,117,108,116, 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, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,137, 43, 5,
- 0, 0, 0, 0, 40,142, 43, 5, 0, 0, 0, 0,152,142, 43, 5, 0, 0, 0, 0, 8,150, 43, 5, 0, 0, 0, 0,120,150, 43, 5,
- 0, 0, 0, 0, 8,122, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,150,113, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 88,137, 43, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0,200,137, 43, 5, 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, 68, 65, 84, 65, 32, 0, 0, 0,200,137, 43, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 56,138, 43, 5,
- 0, 0, 0, 0, 88,137, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,181, 2, 0, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0, 56,138, 43, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,168,138, 43, 5, 0, 0, 0, 0,200,137, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,252, 4,181, 2, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,168,138, 43, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 24,139, 43, 5, 0, 0, 0, 0, 56,138, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,252, 4, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 24,139, 43, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0,136,139, 43, 5, 0, 0, 0, 0,168,138, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,154, 2,
- 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,136,139, 43, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,248,139, 43, 5,
- 0, 0, 0, 0, 24,139, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,252, 4,154, 2, 1, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0,248,139, 43, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,104,140, 43, 5, 0, 0, 0, 0,136,139, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 4, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,104,140, 43, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,216,140, 43, 5, 0, 0, 0, 0,248,139, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 48, 4,154, 2, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,216,140, 43, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0, 72,141, 43, 5, 0, 0, 0, 0,104,140, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 4, 56, 2,
- 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 72,141, 43, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,184,141, 43, 5,
- 0, 0, 0, 0,216,140, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,252, 4, 56, 2, 0, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0,184,141, 43, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 40,142, 43, 5, 0, 0, 0, 0, 72,141, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 40,142, 43, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184,141, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 48, 4, 80, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,152,142, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0, 8,143, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,137, 43, 5, 0, 0, 0, 0, 56,138, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 8,143, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0,120,143, 43, 5, 0, 0, 0, 0,152,142, 43, 5, 0, 0, 0, 0,200,137, 43, 5, 0, 0, 0, 0, 24,139, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,120,143, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0,232,143, 43, 5, 0, 0, 0, 0, 8,143, 43, 5, 0, 0, 0, 0, 56,138, 43, 5, 0, 0, 0, 0,136,139, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,232,143, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0, 88,144, 43, 5, 0, 0, 0, 0,120,143, 43, 5, 0, 0, 0, 0, 24,139, 43, 5, 0, 0, 0, 0,136,139, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 88,144, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0,200,144, 43, 5, 0, 0, 0, 0,232,143, 43, 5, 0, 0, 0, 0, 88,137, 43, 5, 0, 0, 0, 0,248,139, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,200,144, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0, 56,145, 43, 5, 0, 0, 0, 0, 88,144, 43, 5, 0, 0, 0, 0,168,138, 43, 5, 0, 0, 0, 0,248,139, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 56,145, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0,168,145, 43, 5, 0, 0, 0, 0,200,144, 43, 5, 0, 0, 0, 0, 24,139, 43, 5, 0, 0, 0, 0,104,140, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,168,145, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0, 24,146, 43, 5, 0, 0, 0, 0, 56,145, 43, 5, 0, 0, 0, 0,136,139, 43, 5, 0, 0, 0, 0,104,140, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 24,146, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0,136,146, 43, 5, 0, 0, 0, 0,168,145, 43, 5, 0, 0, 0, 0,248,139, 43, 5, 0, 0, 0, 0,216,140, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,136,146, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0,248,146, 43, 5, 0, 0, 0, 0, 24,146, 43, 5, 0, 0, 0, 0,104,140, 43, 5, 0, 0, 0, 0,216,140, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,248,146, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0,104,147, 43, 5, 0, 0, 0, 0,136,146, 43, 5, 0, 0, 0, 0,136,139, 43, 5, 0, 0, 0, 0, 72,141, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,104,147, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0,216,147, 43, 5, 0, 0, 0, 0,248,146, 43, 5, 0, 0, 0, 0,168,138, 43, 5, 0, 0, 0, 0, 72,141, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,216,147, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0, 72,148, 43, 5, 0, 0, 0, 0,104,147, 43, 5, 0, 0, 0, 0,216,140, 43, 5, 0, 0, 0, 0, 72,141, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 72,148, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0,184,148, 43, 5, 0, 0, 0, 0,216,147, 43, 5, 0, 0, 0, 0, 88,137, 43, 5, 0, 0, 0, 0,184,141, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,184,148, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0, 40,149, 43, 5, 0, 0, 0, 0, 72,148, 43, 5, 0, 0, 0, 0, 24,139, 43, 5, 0, 0, 0, 0,184,141, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 40,149, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0,152,149, 43, 5, 0, 0, 0, 0,184,148, 43, 5, 0, 0, 0, 0,104,140, 43, 5, 0, 0, 0, 0, 40,142, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,152,149, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0, 8,150, 43, 5, 0, 0, 0, 0, 40,149, 43, 5, 0, 0, 0, 0,248,139, 43, 5, 0, 0, 0, 0, 40,142, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 8,150, 43, 5, 0, 0, 0, 0,213, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,149, 43, 5, 0, 0, 0, 0,184,141, 43, 5, 0, 0, 0, 0, 40,142, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,120,150, 43, 5, 0, 0, 0, 0,215, 0, 0, 0,
- 1, 0, 0, 0, 72,154, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,139, 43, 5, 0, 0, 0, 0,200,137, 43, 5,
- 0, 0, 0, 0, 56,138, 43, 5, 0, 0, 0, 0,136,139, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-252, 4, 0, 0,155, 2, 0, 0,181, 2, 0, 0, 7, 7,253, 4, 27, 0, 1, 0, 0, 0, 0, 0, 7, 0, 8, 0,120,154, 12, 5,
- 0, 0, 0, 0,216,138, 44, 5, 0, 0, 0, 0,216,138, 44, 5, 0, 0, 0, 0,104,151, 43, 5, 0, 0, 0, 0,216,152, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184,134,173, 77,130,127, 0, 0, 56,232,213, 76,
-130,127, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,104,151, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,216,152, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,161, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0,
- 0,160,159, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,252, 4, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,159, 68,
- 0, 0,200, 65, 0,128,159, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0,
- 10, 0,253, 4, 26, 0,253, 4, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-252, 4, 0, 0,155, 2, 0, 0,180, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 4, 26, 0,
- 2, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,156, 12, 5,
- 0, 0, 0, 0,184,215,146, 77,130,127, 0, 0,184,215,146, 77,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,184,190, 53, 76,130,127, 0, 0,152,195, 53, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,216,152, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,104,151, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,109, 69, 0, 0,128,192, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 71, 69, 0, 0, 0, 0, 0, 0, 96, 65,112, 12, 0, 0,129, 12, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0,
-111, 7, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,111, 12, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 2, 0, 0, 0, 1, 0, 3, 3, 2, 0, 0, 4,
- 10, 0,129, 12, 14, 0,112, 12, 14, 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,181, 2, 0, 0,181, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,155, 12, 5,
- 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,
- 0, 0, 0, 0,216,196, 53, 76,130,127, 0, 0, 72,199, 53, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0, 72,154, 43, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,152,188, 43, 5,
- 0, 0, 0, 0,120,150, 43, 5, 0, 0, 0, 0,248,139, 43, 5, 0, 0, 0, 0,216,140, 43, 5, 0, 0, 0, 0, 72,141, 43, 5,
- 0, 0, 0, 0,168,138, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 4, 0, 0,252, 4, 0, 0, 0, 0, 0, 0,
- 55, 2, 0, 0, 4, 4,204, 0, 56, 2, 1, 0, 0, 0, 0, 0, 0, 0, 8, 0, 24,150, 12, 5, 0, 0, 0, 0, 88,187, 43, 5,
- 0, 0, 0, 0, 88,187, 43, 5, 0, 0, 0, 0, 56,155, 43, 5, 0, 0, 0, 0,168,156, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,171,138, 77,130,127, 0, 0, 40, 6,185, 77,130,127, 0, 0, 68, 65, 84, 65,
- 40, 1, 0, 0, 56,155, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,168,156, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 55, 0, 0, 76, 67, 0, 0, 0, 0,
- 0, 0,208, 65, 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, 0, 0, 0, 0,203, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 75, 67, 0, 0,200, 65, 0, 0, 75, 67,
- 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,204, 0, 26, 0,204, 0,
- 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 4, 0, 0,252, 4, 0, 0, 30, 2, 0, 0,
- 55, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,204, 0, 26, 0, 4, 0, 1, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,153, 12, 5, 0, 0, 0, 0,136,233, 53, 76,
-130,127, 0, 0,136,233, 53, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,202, 53, 76,
-130,127, 0, 0,168,204, 53, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 1, 0, 0,168,156, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,155, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0,128,178, 67, 0, 0, 61,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 67, 0,128, 7,196,
- 0, 0, 0, 0,187, 0, 0, 0,204, 0, 0, 0, 0, 0, 0, 0, 29, 2, 0, 0, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 0, 0,
- 17, 0, 0, 0, 0, 0, 0, 0,186, 0, 0, 0, 0, 0, 0, 0, 29, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 1, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,204, 0, 30, 2,187, 0,
- 30, 2, 0, 0,152,214,146, 77,130,127, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 49, 4, 0, 0,252, 4, 0, 0, 0, 0, 0, 0,
- 29, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,204, 0, 30, 2, 5, 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, 56,151, 12, 5, 0, 0, 0, 0,216,199,138, 77,
-130,127, 0, 0,232, 37,140, 77,130,127, 0, 0, 24,158, 43, 5, 0, 0, 0, 0,168,216,148, 77,130,127, 0, 0,232,205, 53, 76,
-130,127, 0, 0,248,209, 53, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0, 24,158, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,184,159, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 40,152, 12, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 85, 84, 84, 79, 78, 83, 95, 80, 84, 95, 99,
-111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 85, 84, 84, 79, 78, 83, 95, 80, 84, 95, 99,
-111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,110,116,101,120,116, 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, 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,220,255,187, 0, 36, 0, 0, 0, 0, 0,
- 0, 0, 38, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,184,159, 43, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0, 88,161, 43, 5, 0, 0, 0, 0, 24,158, 43, 5, 0, 0, 0, 0, 72, 8,227, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,110,100,101,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,110,100,101,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82,101,110,100,101,114, 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, 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,135,255,187, 0, 61, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 11, 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, 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, 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, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0, 88,161, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,248,162, 43, 5, 0, 0, 0, 0,184,159, 43, 5,
- 0, 0, 0, 0, 72, 11,227, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,108, 97,
-121,101,114,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,108, 97,
-121,101,114,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,121,101,114,115, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0,136,217,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,104,219,214, 3, 0, 0, 0, 0,
+168,215,214, 3, 0, 0, 0, 0,200, 35,221, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,108, 97,121,101,114,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,108, 97,121,101,114,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,121,101,114,115, 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, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111,255,187, 0, 0, 0, 0, 0, 0, 0,
- 4, 0, 6, 0, 0, 0, 0, 0, 12, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111,255,197, 0, 0, 0,
+ 0, 0, 0, 0, 4, 0, 6, 0, 0, 0, 0, 0, 12, 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, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0,248,162, 43, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0,152,164, 43, 5, 0, 0, 0, 0, 88,161, 43, 5, 0, 0, 0, 0,184, 14,227, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,105,111,110,115, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,104,219,214, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 72,221,214, 3, 0, 0, 0, 0,136,217,214, 3, 0, 0, 0, 0,104, 37,221, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,105,111,110,115, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 68,105,109,101,110,115,105,111,110,115, 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, 68,105,109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,140,254,187, 0,203, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140,254,197, 0,203, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 13, 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, 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, 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, 68, 65, 84, 65,
- 88, 1, 0, 0,152,164, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 56,166, 43, 5, 0, 0, 0, 0,248,162, 43, 5,
- 0, 0, 0, 0,152, 17,227, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 97,110,
-116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 97,110,
-116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,110,116,105, 45, 65,108,105, 97,115,105,110,
-103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58,254,187, 0, 58, 0, 20, 0, 0, 0,
- 0, 0, 6, 0, 0, 0, 0, 0, 14, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0, 72,221,214, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,184, 43,215, 3, 0, 0, 0, 0,
+104,219,214, 3, 0, 0, 0, 0, 8, 39,221, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,110,116,105, 45, 65,108,105,
+ 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58,254,197, 0, 58, 0,
+ 20, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 14, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0, 56,166, 43, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0,216,167, 43, 5, 0, 0, 0, 0,152,164, 43, 5, 0, 0, 0, 0,168, 20,227, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,116,105,111,110, 95, 98,108,117,114, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,116,105,111,110, 95, 98,108,117,114, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,184, 43,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0,152, 45,215, 3, 0, 0, 0, 0, 72,221,214, 3, 0, 0, 0, 0,168, 40,221, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,116,105,111,110, 95, 98,108,117,114, 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, 0, 0, 0,
- 0, 0, 0, 0, 83, 97,109,112,108,101,100, 32, 77,111,116,105,111,110, 32, 66,108,117,114, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,116,105,111,110, 95, 98,108,117,114, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 34,254,187, 0, 0, 0, 20, 0, 0, 0, 4, 0, 6, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 97,109,112,108,101,100, 32, 77,111,116,105,111,110, 32, 66,108,117,114, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,254,197, 0, 0, 0, 20, 0, 0, 0, 4, 0, 6, 0, 0, 0, 0, 0, 15, 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, 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, 68, 65, 84, 65,
- 88, 1, 0, 0,216,167, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,120,169, 43, 5, 0, 0, 0, 0, 56,166, 43, 5,
- 0, 0, 0, 0,200, 8,183, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,104,
- 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,104,
- 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,104, 97,100,105,110,103, 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, 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, 10,254,187, 0, 0, 0, 0, 0, 0, 0,
- 4, 0, 6, 0, 0, 0, 0, 0, 16, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0,152, 45,215, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,120, 47,215, 3, 0, 0, 0, 0,
+184, 43,215, 3, 0, 0, 0, 0, 72, 42,221, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,115,104, 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,115,104, 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,104, 97,100,105,110,103, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,120,169, 43, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0, 24,171, 43, 5, 0, 0, 0, 0,216,167, 43, 5, 0, 0, 0, 0,152, 30,227, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,109, 97,110, 99,101, 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, 0, 10,254,197, 0, 0, 0,
+ 0, 0, 0, 0, 4, 0, 6, 0, 0, 0, 0, 0, 16, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,109, 97,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 80,101,114,102,111,114,109, 97,110, 99,101, 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, 0, 68, 65, 84, 65, 88, 1, 0, 0,120, 47,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 88, 49,215, 3, 0, 0, 0, 0,152, 45,215, 3, 0, 0, 0, 0,232, 43,221, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,109, 97,110, 99,101, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,242,253,187, 0, 0, 0, 0, 0, 0, 0, 4, 0, 6, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,109, 97,110, 99,101, 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, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 80,101,114,102,111,114,109, 97,110, 99,101, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0, 24,171, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,184,172, 43, 5, 0, 0, 0, 0,120,169, 43, 5,
- 0, 0, 0, 0, 88, 34,227, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,111,
-115,116, 95,112,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,111,
-115,116, 95,112,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 80,111,115,116, 32, 80,114,111, 99,101,115,115,
-105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,218,253,187, 0, 0, 0, 0, 0, 0, 0,
- 4, 0, 6, 0, 0, 0, 0, 0, 18, 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, 0,242,253,197, 0, 0, 0, 0, 0, 0, 0, 4, 0, 6, 0, 0, 0, 0, 0, 17, 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, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,184,172, 43, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0, 88,174, 43, 5, 0, 0, 0, 0, 24,171, 43, 5, 0, 0, 0, 0,200, 36,227, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0, 88, 49,215, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 56, 51,215, 3, 0, 0, 0, 0,
+120, 47,215, 3, 0, 0, 0, 0,136, 45,221, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 80,111,115,116, 32, 80,114,111,
+ 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,218,253,197, 0, 0, 0,
+ 0, 0, 0, 0, 4, 0, 6, 0, 0, 0, 0, 0, 18, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 83,116, 97,109,112, 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, 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,194,253,187, 0, 0, 0, 20, 0, 0, 0, 4, 0, 6, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 56, 51,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 24, 53,215, 3, 0, 0, 0, 0, 88, 49,215, 3, 0, 0, 0, 0, 72, 48,221, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 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, 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, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0, 88,174, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,248,175, 43, 5, 0, 0, 0, 0,184,172, 43, 5,
- 0, 0, 0, 0,200, 39,227, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,111,117,
-116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,111,117,
-116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,109,112, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36,253,187, 0,134, 0, 0, 0, 0, 0,
- 0, 0, 6, 0, 0, 0, 0, 0, 20, 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, 0,194,253,197, 0, 0, 0, 20, 0, 0, 0, 4, 0, 6, 0, 0, 0, 0, 0, 19, 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, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,248,175, 43, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0,152,177, 43, 5, 0, 0, 0, 0, 88,174, 43, 5, 0, 0, 0, 0, 56, 46,227, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,107,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,107,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0, 24, 53,215, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,248, 54,215, 3, 0, 0, 0, 0,
+ 56, 51,215, 3, 0, 0, 0, 0,232, 49,221, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,117,116,112,117,116, 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, 0, 0,
- 0, 0, 0, 0, 66, 97,107,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36,253,197, 0,134, 0,
+ 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 20, 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, 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, 12,253,187, 0, 0, 0, 0, 0, 0, 0, 4, 0, 7, 0, 0, 0, 0, 0, 21, 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, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,248, 54,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0,216, 56,215, 3, 0, 0, 0, 0, 24, 53,215, 3, 0, 0, 0, 0, 40, 53,221, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,107,101, 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, 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, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0,152,177, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 56,179, 43, 5, 0, 0, 0, 0,248,175, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95,115, 99,101,
-110,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95,115, 99,101,
-110,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 99,101,110,101, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,107,101, 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, 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,135,255, 41, 1, 61, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 5, 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, 66, 97,107,101, 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, 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, 12,253,197, 0, 0, 0, 0, 0, 0, 0, 4, 0, 7, 0, 0, 0, 0, 0, 21, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 56,179, 43, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0,216,180, 43, 5, 0, 0, 0, 0,152,177, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95,117,110,105,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95,117,110,105,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 85,110,105,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0,216, 56,215, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,184, 58,215, 3, 0, 0, 0, 0,
+248, 54,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84,
+ 95,115, 99,101,110,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84,
+ 95,115, 99,101,110,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 99,101,110,101, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 28,255, 41, 1, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 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, 0,135,255, 41, 1, 61, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0,216,180, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,120,182, 43, 5, 0, 0, 0, 0, 56,179, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95,107,101,121,
-105,110,103, 95,115,101,116,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95,107,101,121,
-105,110,103, 95,115,101,116,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75,101,121,105,110,103, 32, 83,101,116,115, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,254, 41, 1, 69, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,184, 58,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0,152, 60,215, 3, 0, 0, 0, 0,216, 56,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95,117,110,105,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,120,182, 43, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0, 24,184, 43, 5, 0, 0, 0, 0,216,180, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95,112,104,121,115,105, 99,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95,117,110,105,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95,112,104,121,115,105, 99,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 85,110,105,116,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 71,114, 97,118,105,116,121, 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, 28,255, 41, 1, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,131,254, 41, 1, 36, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 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, 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, 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, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0, 24,184, 43, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,184,185, 43, 5, 0, 0, 0, 0,120,182, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95,115,105,109,
-112,108,105,102,121, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95,115,105,109,
-112,108,105,102,121, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,105,109,112,108,105,102,121, 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, 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, 27,254, 41, 1, 80, 0, 20, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0,152, 60,215, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,120, 62,215, 3, 0, 0, 0, 0,
+184, 58,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84,
+ 95,107,101,121,105,110,103, 95,115,101,116,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84,
+ 95,107,101,121,105,110,103, 95,115,101,116,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75,101,121,105,110,103, 32, 83,
+101,116,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,254, 41, 1, 69, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 2, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,120, 62,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 88, 64,215, 3, 0, 0, 0, 0,152, 60,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95,112,104,121,115,105, 99,115, 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, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,184,185, 43, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0,184, 56,138, 77,130,127, 0, 0, 24,184, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95, 99,117,115,116,111,109, 95,112,114,111,112,115, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95,112,104,121,115,105, 99,115, 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, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95, 99,117,115,116,111,109, 95,112,114,111,112,115, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 71,114, 97,118,105,116,121, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 67,117,115,116,111,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,131,254, 41, 1, 36, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,223,253, 41, 1, 36, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 10, 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, 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, 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, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0,184, 56,138, 77,130,127, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 88,245,148, 77,130,127, 0, 0,184,185, 43, 5,
- 0, 0, 0, 0,152, 78,227, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 88, 84, 85, 82, 69, 95, 80, 84, 95, 99,
-111,110,116,101,120,116, 95,116,101,120,116,117,114,101, 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, 0, 0, 0, 0, 0, 0, 84, 69, 88, 84, 85, 82, 69, 95, 80, 84, 95, 99,
-111,110,116,101,120,116, 95,116,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0, 88, 64,215, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 56, 66,215, 3, 0, 0, 0, 0,
+120, 62,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84,
+ 95,115,105,109,112,108,105,102,121, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84,
+ 95,115,105,109,112,108,105,102,121, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,105,109,112,108,105,102,121,
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,
+ 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, 27,254, 41, 1, 80, 0,
+ 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,255,187, 0,204, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 5, 0, 0, 0, 18, 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, 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, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 88,245,148, 77,130,127, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0, 72, 67,149, 77,130,127, 0, 0,184, 56,138, 77,130,127, 0, 0, 8,142,227, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 84, 69, 88, 84, 85, 82, 69, 95, 80, 84, 95,109, 97,112,112,105,110,103, 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, 68, 65, 84, 65, 88, 1, 0, 0, 56, 66,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 24, 68,215, 3, 0, 0, 0, 0, 88, 64,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95, 99,117,115,116,111,109, 95,112,114,111,112,115, 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, 0, 0, 0,
- 0, 0, 0, 0, 84, 69, 88, 84, 85, 82, 69, 95, 80, 84, 95,109, 97,112,112,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 69, 78, 69, 95, 80, 84, 95, 99,117,115,116,111,109, 95,112,114,111,112,115, 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, 0, 0, 0,
- 0, 0, 0, 0, 77, 97,112,112,105,110,103, 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, 67,117,115,116,111,109, 32, 80,114,111,112,101,114,116,105,101,115, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 77,254,187, 0,171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,223,253, 41, 1, 36, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 10, 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, 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, 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, 68, 65, 84, 65,
- 88, 1, 0, 0, 72, 67,149, 77,130,127, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,168,216,148, 77,130,127, 0, 0, 88,245,148, 77,
-130,127, 0, 0, 24,145,227, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 88, 84, 85, 82, 69, 95, 80, 84, 95,105,
-110,102,108,117,101,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 88, 84, 85, 82, 69, 95, 80, 84, 95,105,
-110,102,108,117,101,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73,110,102,108,117,101,110, 99,101, 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, 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,223,252,187, 0, 86, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 4, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0, 24, 68,215, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,248, 69,215, 3, 0, 0, 0, 0,
+ 56, 66,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 88, 84, 85, 82, 69, 95,
+ 80, 84, 95, 99,111,110,116,101,120,116, 95,116,101,120,116,117,114,101, 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, 0, 0, 0, 0, 0, 0, 84, 69, 88, 84, 85, 82, 69, 95,
+ 80, 84, 95, 99,111,110,116,101,120,116, 95,116,101,120,116,117,114,101, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0,168,216,148, 77,130,127, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 67,149, 77,130,127, 0, 0,184, 63,226, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 79, 66, 74, 69, 67, 84, 95, 80, 84, 95, 99,111,110,115,116,114, 97,105,110,116,115, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 79, 66, 74, 69, 67, 84, 95, 80, 84, 95, 99,111,110,115,116,114, 97,105,110,116,115, 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, 0, 16,255,187, 0,204, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 5, 0, 0, 0, 18, 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, 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, 79, 98,106,101, 99,116, 32, 67,111,110,115,116,114, 97,105,110,116,115, 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, 68, 65, 84, 65, 88, 1, 0, 0,248, 69,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0,216, 71,215, 3, 0, 0, 0, 0, 24, 68,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 88, 84, 85, 82, 69, 95, 80, 84, 95,109, 97,112,112,105,110,103, 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, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,160,255,187, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 88, 84, 85, 82, 69, 95, 80, 84, 95,109, 97,112,112,105,110,103, 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, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,112,112,105,110,103, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
-248, 0, 0, 0, 88,187, 43, 5, 0, 0, 0, 0,180, 0, 0, 0, 1, 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, 0, 0, 0, 4, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 8,107,139, 77,130,127, 0, 0,255, 21, 0, 0,160, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,152,188, 43, 5, 0, 0, 0, 0,215, 0, 0, 0,
- 1, 0, 0, 0,136,193, 43, 5, 0, 0, 0, 0, 72,154, 43, 5, 0, 0, 0, 0, 88,137, 43, 5, 0, 0, 0, 0,184,141, 43, 5,
- 0, 0, 0, 0, 40,142, 43, 5, 0, 0, 0, 0,248,139, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 47, 4, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 15, 15, 48, 4, 80, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,105, 12, 5,
- 0, 0, 0, 0,104,192, 43, 5, 0, 0, 0, 0,104,192, 43, 5, 0, 0, 0, 0,136,189, 43, 5, 0, 0, 0, 0,248,190, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184, 66,185, 77,130,127, 0, 0,216, 90,138, 77,
-130,127, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,136,189, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,248,190, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,146, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0,
- 0, 0,134, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 47, 4, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,224,133, 68,
- 0, 0,200, 65, 0,224,133, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0,
- 10, 0, 48, 4, 26, 0, 48, 4, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 47, 4, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 4, 26, 0,
- 6, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248,107, 12, 5,
- 0, 0, 0, 0,168,170,141, 77,130,127, 0, 0,168,170,141, 77,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,232,212, 53, 76,130,127, 0, 0, 88,215, 53, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,248,190, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,136,189, 43, 5, 0, 0, 0, 0, 0, 0, 64,192, 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 72, 66, 88,218,103,194,
- 40,147,141, 67, 0, 0, 0, 0, 0, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 47, 4, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 47, 4, 0, 0, 18, 0, 0, 0, 53, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 72, 66, 0,124,146, 72, 0, 0, 72, 66,205,204,204, 61, 0, 0, 32, 65, 72, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 4,
- 8, 0, 48, 4, 54, 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,
- 47, 4, 0, 0, 26, 0, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 47, 4, 0, 0, 26, 0, 0, 0, 79, 0, 0, 0, 48, 4, 54, 0,
- 7, 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, 8,107, 12, 5,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77,254,187, 0,171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 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, 0, 0, 0,
- 0, 0, 0, 0,152,216, 53, 76,130,127, 0, 0, 72,222, 53, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0,104,192, 43, 5, 0, 0, 0, 0,191, 0, 0, 0, 1, 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, 0, 0, 0, 15, 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, 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, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0,216, 71,215, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,184, 75,215, 3, 0, 0, 0, 0,
+248, 69,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 88, 84, 85, 82, 69, 95,
+ 80, 84, 95,105,110,102,108,117,101,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 88, 84, 85, 82, 69, 95,
+ 80, 84, 95,105,110,102,108,117,101,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73,110,102,108,117,101,110, 99,
+101, 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, 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,223,252,187, 0, 86, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 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, 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, 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, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,184, 75,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 71,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 74, 69, 67, 84, 95, 80, 84, 95, 99,111,110,115,116,114, 97,105,110,116,115, 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, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 74, 69, 67, 84, 95, 80, 84, 95, 99,111,110,115,116,114, 97,105,110,116,115, 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, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 32, 67,111,110,115,116,114, 97,105,110,116,115, 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, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,255,187, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 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, 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, 0, 0, 0,
+ 68, 65, 84, 65,248, 0, 0, 0,184,126,199, 3, 0, 0, 0, 0,179, 0, 0, 0, 1, 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, 0, 0, 0, 4, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0,232,198,226, 3, 0, 0, 0, 0,255, 21, 0, 0,160, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,248, 13,215, 3, 0, 0, 0, 0,
+214, 0, 0, 0, 1, 0, 0, 0, 24, 15,215, 3, 0, 0, 0, 0,216, 12,215, 3, 0, 0, 0, 0,168, 29,201, 3, 0, 0, 0, 0,
+232, 35,201, 3, 0, 0, 0, 0,136, 36,201, 3, 0, 0, 0, 0,104, 33,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,111, 4, 0, 0, 0, 0, 0, 0, 83, 0, 0, 0, 15, 15,112, 4, 84, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+152,104,177, 3, 0, 0, 0, 0,120, 95,200, 3, 0, 0, 0, 0,120, 95,200, 3, 0, 0, 0, 0, 40,188,214, 3, 0, 0, 0, 0,
+216,189,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,207,207, 3, 0, 0, 0, 0,
+216,205,207, 3, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 40,188,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+216,189,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,146, 68, 0, 0, 0, 0, 0, 0,208, 65,
+ 0, 0, 0, 0, 0, 0,142, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,111, 4, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0,
+ 0,224,141, 68, 0, 0,200, 65, 0,224,141, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3,
+ 4, 0, 12, 0, 10, 0,112, 4, 26, 0,112, 4, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,111, 4, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+112, 4, 26, 0, 6, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+232,186,177, 3, 0, 0, 0, 0,232,169,209, 15, 0, 0, 0, 0,232,169,209, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,168,128,208, 3, 0, 0, 0, 0,216,131,208, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,216,189,214, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 40,188,214, 3, 0, 0, 0, 0, 0, 0, 64,192, 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 72, 66,
+ 88,218,103,194, 40,147,141, 67, 0, 0, 0, 0, 0, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,111, 4, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,111, 4, 0, 0, 18, 0, 0, 0, 57, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 72, 66, 0,124,146, 72, 0, 0, 72, 66,205,204,204, 61, 0, 0, 32, 65, 72, 0, 0, 0, 0, 0, 0, 2,
+ 4, 0, 0, 4, 8, 0,112, 4, 58, 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,111, 4, 0, 0, 26, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+112, 4, 58, 0, 7, 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,
+184,185,177, 3, 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, 0, 0, 0, 0,232,132,208, 3, 0, 0, 0, 0, 88,140,208, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0,120, 95,200, 3, 0, 0, 0, 0,190, 0, 0, 0, 1, 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, 0, 0, 0,
+ 15, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0, 24, 15,215, 3, 0, 0, 0, 0,
+214, 0, 0, 0, 1, 0, 0, 0, 56, 16,215, 3, 0, 0, 0, 0,248, 13,215, 3, 0, 0, 0, 0,168, 34,201, 3, 0, 0, 0, 0,
+ 8, 34,201, 3, 0, 0, 0, 0,200, 32,201, 3, 0, 0, 0, 0, 72, 35,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+113, 4, 0, 0, 70, 5, 0, 0, 57, 2, 0, 0,150, 2, 0, 0, 3, 3,214, 0, 94, 0, 1, 0, 0, 0, 0, 0, 0, 0, 8, 0,
+ 72,103,177, 3, 0, 0, 0, 0,200, 0,209, 3, 0, 0, 0, 0,200, 0,209, 3, 0, 0, 0, 0,184,107,215, 3, 0, 0, 0, 0,
+104,109,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,209,207, 3, 0, 0, 0, 0,
+ 24,208,207, 3, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,184,107,215, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+104,109,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,244, 67, 0, 0, 0, 0, 0, 0,208, 65,
+ 0, 0, 0, 0, 0, 0, 86, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,213, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0,
+ 0, 0, 85, 67, 0, 0,200, 65, 0, 0, 85, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3,
+ 4, 0, 12, 0, 10, 0,214, 0, 26, 0,214, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+113, 4, 0, 0, 70, 5, 0, 0,125, 2, 0, 0,150, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+214, 0, 26, 0, 8, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+136,184,177, 3, 0, 0, 0, 0, 40, 59,163, 3, 0, 0, 0, 0, 40, 59,163, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,104,141,208, 3, 0, 0, 0, 0,152,144,208, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,104,109,215, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,184,107,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,141, 67, 0, 0,244,194, 0, 0, 0, 0,
+ 0, 0, 0, 64, 0, 0, 71, 67, 0, 0,143,194, 0, 0,172,193,197, 0, 0, 0,214, 0, 0, 0, 18, 0, 0, 0, 67, 0, 0, 0,
+ 0, 0, 0, 0,196, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,196, 0, 0, 0, 18, 0, 0, 0, 67, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 18, 0, 0, 0, 2, 0, 3, 3,
+ 0, 0, 12, 4, 6, 0,214, 0, 68, 0,197, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+113, 4, 0, 0, 70, 5, 0, 0, 57, 2, 0, 0,124, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+214, 0, 68, 0, 9, 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,
+ 88,183,177, 3, 0, 0, 0, 0,232, 69,163, 3, 0, 0, 0, 0,232, 69,163, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,168,145,208, 3, 0, 0, 0, 0, 8,231,207, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0,200, 0,209, 3, 0, 0, 0, 0,183, 0, 0, 0, 1, 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, 0, 0, 0,
- 0, 0, 0, 0, 63, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,136,193, 43, 5, 0, 0, 0, 0,215, 0, 0, 0,
- 1, 0, 0, 0, 8,122, 44, 5, 0, 0, 0, 0,152,188, 43, 5, 0, 0, 0, 0,216,140, 43, 5, 0, 0, 0, 0,104,140, 43, 5,
- 0, 0, 0, 0,136,139, 43, 5, 0, 0, 0, 0, 72,141, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 4, 0, 0,
-252, 4, 0, 0, 57, 2, 0, 0,153, 2, 0, 0, 3, 3,204, 0, 97, 0, 1, 0, 0, 0, 0, 0, 0, 0, 8, 0,232,102, 12, 5,
- 0, 0, 0, 0, 88,197, 43, 5, 0, 0, 0, 0, 88,197, 43, 5, 0, 0, 0, 0,120,194, 43, 5, 0, 0, 0, 0,232,195, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,204,184, 77,130,127, 0, 0,120, 25,151, 77,
-130,127, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,120,194, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,232,195, 43, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,244, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 55,
- 0, 0, 76, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,203, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 75, 67,
- 0, 0,200, 65, 0, 0, 75, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0,
- 10, 0,204, 0, 26, 0,204, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 4, 0, 0,
-252, 4, 0, 0,128, 2, 0, 0,153, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,204, 0, 26, 0,
- 8, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248,104, 12, 5,
- 0, 0, 0, 0,200, 39,244, 77,130,127, 0, 0,200, 39,244, 77,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 56,225, 53, 76,130,127, 0, 0,168,227, 53, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,232,195, 43, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,120,194, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,141, 67, 0, 0,244,194, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 59, 67, 0, 0,172,194, 0, 0, 4,194,187, 0, 0, 0,204, 0, 0, 0, 18, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0,
-186, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,186, 0, 0, 0, 18, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 18, 0, 0, 0, 2, 0, 3, 3, 0, 0, 12, 4,
- 6, 0,204, 0, 71, 0,187, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 4, 0, 0,
-252, 4, 0, 0, 57, 2, 0, 0,127, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,204, 0, 71, 0,
- 9, 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, 8,104, 12, 5,
- 0, 0, 0, 0, 40, 21,188, 77,130,127, 0, 0, 40, 21,188, 77,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,232,228, 53, 76,130,127, 0, 0, 88,231, 53, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0, 88,197, 43, 5, 0, 0, 0, 0,184, 0, 0, 0, 1, 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, 0, 0, 0, 3, 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, 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, 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, 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, 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, 0, 0, 0,
- 0, 0, 0, 0, 8, 51,139, 77,130,127, 0, 0, 8, 51,139, 77,130,127, 0, 0,184,198, 43, 5, 0, 0, 0, 0, 0,115,101, 32,
- 83, 99,117,108,112,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65, 16, 0, 0, 0,184,198, 43, 5,
- 0, 0, 0, 0,238, 0, 0, 0, 1, 0, 0, 0, 42, 11, 0, 0, 42, 11, 0, 0, 24,199, 43, 5, 0, 0, 0, 0, 68, 65, 84, 65,
-160,178, 0, 0, 24,199, 43, 5, 0, 0, 0, 0,237, 0, 0, 0, 42, 11, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 19, 0, 0, 0, 1, 0, 1, 0, 88,162, 45, 5, 0, 0, 0, 0, 20, 0, 0, 0, 1, 0, 1, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 21, 0, 1, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8,189, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,120,198, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,168,212, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8,123, 46, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8,206, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,216,191, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 21, 0, 0, 0, 1, 0, 1, 0, 88,162, 45, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 30, 0,255,255, 3, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,184,182, 42, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,136, 27, 43, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 8,136, 43, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,104,139, 44, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,120,219, 44, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,232, 42, 45, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 8,114, 45, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 8,123, 46, 5,
- 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 24,181, 42, 5, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 8,189, 45, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,120, 42, 48, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 56,183, 45, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 72,184, 45, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 72,184, 45, 5, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 70, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 71, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 72, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 73, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 74, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 75, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 76, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 77, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 78, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 79, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 80, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 81, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 82, 0, 1, 0, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 31, 0, 83, 0, 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 8, 30, 47, 5,
- 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 70, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 71, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 72, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 73, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 74, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 75, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 76, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 77, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 78, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 79, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 80, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 81, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 82, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 83, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 84, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 85, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 86, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 87, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 88, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 89, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 90, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 91, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 92, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 93, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 94, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 95, 0, 1, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 31, 0, 96, 0, 1, 0, 0, 0,216,191, 45, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 70, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 71, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 72, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 73, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 74, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 75, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 76, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 77, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 78, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 79, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 80, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 81, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 82, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 83, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 84, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 85, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 86, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 87, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 88, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 89, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 90, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 91, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 92, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 93, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 94, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 95, 0, 1, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 31, 0, 96, 0, 1, 0, 0, 0,120,198, 45, 5, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 70, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 71, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 72, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 73, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 74, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 75, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 76, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 77, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 78, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 79, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 80, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 81, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 82, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 83, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 84, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 85, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 86, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 87, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 88, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 89, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 90, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 91, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 92, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 93, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 94, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 95, 0, 1, 0, 0, 0, 8,206, 45, 5, 0, 0, 0, 0, 31, 0, 96, 0, 1, 0, 0, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,184,182, 42, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,184,182, 42, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,184,182, 42, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,184,182, 42, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,184,182, 42, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,184,182, 42, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,184,182, 42, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,184,182, 42, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,184,182, 42, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,184,182, 42, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,136, 27, 43, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,136, 27, 43, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,136, 27, 43, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,136, 27, 43, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,136, 27, 43, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,136, 27, 43, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,136, 27, 43, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,136, 27, 43, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,136, 27, 43, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,136, 27, 43, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 8,136, 43, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 8,136, 43, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 8,136, 43, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 8,136, 43, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 8,136, 43, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 8,136, 43, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 8,136, 43, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 8,136, 43, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 8,136, 43, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 8,136, 43, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,104,139, 44, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,104,139, 44, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,104,139, 44, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,104,139, 44, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,104,139, 44, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,104,139, 44, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,104,139, 44, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,104,139, 44, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,104,139, 44, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,104,139, 44, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,120,219, 44, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,120,219, 44, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,120,219, 44, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,120,219, 44, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,120,219, 44, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,120,219, 44, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,120,219, 44, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,120,219, 44, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,120,219, 44, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,120,219, 44, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,232, 42, 45, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,232, 42, 45, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,232, 42, 45, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,232, 42, 45, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,232, 42, 45, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,232, 42, 45, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,232, 42, 45, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,232, 42, 45, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,232, 42, 45, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,232, 42, 45, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 8,114, 45, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 8,114, 45, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 8,114, 45, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 8,114, 45, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 8,114, 45, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 8,114, 45, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 8,114, 45, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 8,114, 45, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 8,114, 45, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 8,114, 45, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 8,123, 46, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 8,123, 46, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 8,123, 46, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 8,123, 46, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 8,123, 46, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 8,123, 46, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 8,123, 46, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 8,123, 46, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 8,123, 46, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 8,123, 46, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 8,123, 46, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 8,123, 46, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 8,123, 46, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 8,123, 46, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 8,123, 46, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 8,123, 46, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 8,123, 46, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 8,123, 46, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 8,123, 46, 5, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 24,181, 42, 5,
- 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 24,181, 42, 5, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 24,181, 42, 5,
- 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 24,181, 42, 5, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 24,181, 42, 5,
- 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 24,181, 42, 5, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 24,181, 42, 5,
- 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 24,181, 42, 5, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 24,181, 42, 5,
- 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 24,181, 42, 5, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 24,181, 42, 5,
- 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 8,189, 45, 5, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 8,189, 45, 5,
- 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 8,189, 45, 5, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 8,189, 45, 5,
- 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 8,189, 45, 5, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 8,189, 45, 5,
- 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 8,189, 45, 5, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 8,189, 45, 5,
- 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 8,189, 45, 5, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 8,189, 45, 5,
- 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 8,189, 45, 5, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0, 8,189, 45, 5,
- 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 8,189, 45, 5, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0, 8,189, 45, 5,
- 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 8,189, 45, 5, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0, 8,189, 45, 5,
- 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 8,189, 45, 5, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0, 8,189, 45, 5,
- 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 8,189, 45, 5, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0, 8,189, 45, 5,
- 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 8,189, 45, 5, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0, 8,122, 44, 5,
- 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,193, 43, 5, 0, 0, 0, 0,184,141, 43, 5,
- 0, 0, 0, 0, 24,139, 43, 5, 0, 0, 0, 0,104,140, 43, 5, 0, 0, 0, 0, 40,142, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 47, 4, 0, 0, 81, 0, 0, 0,153, 2, 0, 0, 1, 1, 48, 4, 73, 2, 1, 0, 0, 0, 0, 0,
- 0, 0, 8, 0,232,108, 12, 5, 0, 0, 0, 0, 40,137, 44, 5, 0, 0, 0, 0, 40,137, 44, 5, 0, 0, 0, 0,248,122, 44, 5,
- 0, 0, 0, 0,248,131, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 20,156, 77,
-130,127, 0, 0,152,149,185, 77,130,127, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,248,122, 44, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0,104,124, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,108, 68, 0, 0, 0, 0,
- 0, 0,208, 65, 0, 0, 0, 0, 0, 0,134, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 47, 4, 0, 0, 0, 0, 0, 0,
- 25, 0, 0, 0, 0,224,133, 68, 0, 0,200, 65, 0,224,133, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 48, 4, 26, 0, 48, 4, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 47, 4, 0, 0, 81, 0, 0, 0,106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 48, 4, 26, 0, 10, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 72,119, 12, 5, 0, 0, 0, 0,184,250,138, 77,130,127, 0, 0,184,250,138, 77,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,236, 53, 76,130,127, 0, 0,216,240, 53, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,104,124, 44, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0,120,127, 44, 5, 0, 0, 0, 0,248,122, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,178, 67, 0,192, 5,196,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67, 0,128,171,195, 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0,
- 86, 1, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0,
- 86, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 1, 0, 0,
- 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,160, 0, 87, 1,143, 0, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,159, 0, 0, 0, 67, 1, 0, 0,153, 2, 0, 0, 0, 0, 0, 0,159, 0, 0, 0, 67, 1, 0, 0,
-153, 2, 0, 0,160, 0, 87, 1, 11, 0, 5, 0, 3, 0, 0, 0, 0, 0, 0, 0,160, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 8,116, 12, 5, 0, 0, 0, 0,120, 64,141, 77,130,127, 0, 0,120, 64,141, 77,130,127, 0, 0,216,125, 44, 5,
- 0, 0, 0, 0, 88,230,149, 77,130,127, 0, 0, 24,242, 53, 76,130,127, 0, 0,136,244, 53, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,216,125, 44, 5, 0, 0, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0,216,204,146, 77,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,235,230, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95,111, 98,106,101, 99,116,109,111,100,101, 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, 0, 0,
- 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95,111, 98,106,101, 99,116,109,111,100,101, 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, 0, 0,
- 0, 0, 0, 0, 79, 98,106,101, 99,116, 32, 84,111,111,108,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,233,253,143, 0,255, 1, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0,
+ 3, 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, 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, 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, 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, 68, 65, 84, 65,
- 88, 1, 0, 0,216,204,146, 77,130,127, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 8, 92,138, 77,130,127, 0, 0,216,125, 44, 5,
- 0, 0, 0, 0, 88, 18,231, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,
-111,108,115, 95, 98,114,117,115,104, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,
-111,108,115, 95, 98,114,117,115,104, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,114,117,115,104, 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, 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,159,254,143, 0, 73, 1, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,120,243,211, 15, 0, 0, 0, 0,120,243,211, 15, 0, 0, 0, 0,136, 17,214, 3, 0, 0, 0, 0,
+ 0,115,101, 32, 83, 99,117,108,112,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65, 16, 0, 0, 0,
+136, 17,214, 3, 0, 0, 0, 0,237, 0, 0, 0, 1, 0, 0, 0, 42, 11, 0, 0, 42, 11, 0, 0,136,139,215, 3, 0, 0, 0, 0,
+ 68, 65, 84, 65,160,178, 0, 0,136,139,215, 3, 0, 0, 0, 0,236, 0, 0, 0, 42, 11, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0,
+168,194,217, 3, 0, 0, 0, 0, 19, 0, 0, 0, 1, 0, 1, 0,168,194,217, 3, 0, 0, 0, 0, 20, 0, 0, 0, 1, 0, 1, 0,
+168,194,217, 3, 0, 0, 0, 0, 21, 0, 1, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
+ 24, 51,163, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,184,219,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
+136, 48,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,152, 7,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
+216, 29,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,168,225,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
+120,209,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,200,213,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 21, 0, 0, 0, 1, 0, 1, 0,168,194,217, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,
+200, 66,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 30, 0,255,255, 3, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,136, 7,214, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+ 8,156,214, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,248, 9,215, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+152, 66,216, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 56, 43,217, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+232,117,217, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 24,157,217, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+216, 29,218, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0, 8, 78,210, 3, 0, 0, 0, 0, 30, 0,255,255, 1, 0, 0, 0,
+ 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+ 40, 77,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+200, 85,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+104, 94,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+ 8,103,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+168,111,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+ 72,120,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+232,128,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+136,137,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+104,176,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+ 72,183,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+ 40,190,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+ 8,197,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+232,203,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+200,210,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+168,217,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+136,224,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+184,212,210, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+200,219,210, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+216,226,210, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+232,233,210, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+248,240,210, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+152,231,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+168,238,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+184,245,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+200,252,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+216, 3,219, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+232, 10,219, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+248, 17,219, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+ 8, 25,219, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0, 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0, 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+ 24, 98,200, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+120,209,217, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 70, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 71, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 72, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 73, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 74, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 75, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 76, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 77, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 78, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 79, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 80, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 81, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 82, 0, 1, 0, 0, 0,
+152, 7,218, 3, 0, 0, 0, 0, 31, 0, 83, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,
+136, 48,218, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 70, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 71, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 72, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 73, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 74, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 75, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 76, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 77, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 78, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 79, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 80, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 81, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 82, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 83, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 84, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 85, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 86, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 87, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 88, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 89, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 90, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 91, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 92, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 93, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 94, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 95, 0, 1, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 31, 0, 96, 0, 1, 0, 0, 0,
+200,213,217, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 70, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 71, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 72, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 73, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 74, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 75, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 76, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 77, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 78, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 79, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 80, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 81, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 82, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 83, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 84, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 85, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 86, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 87, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 88, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 89, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 90, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 91, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 92, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 93, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 94, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 95, 0, 1, 0, 0, 0,
+184,219,217, 3, 0, 0, 0, 0, 31, 0, 96, 0, 1, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 21, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 22, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 23, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 24, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 25, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 26, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 27, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 28, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 29, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 30, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 31, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 32, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 33, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 34, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 35, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 36, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 37, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 38, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 39, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 40, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 41, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 42, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 43, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 44, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 45, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 46, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 47, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 48, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 49, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 50, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 51, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 52, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 54, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 55, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 56, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 57, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 58, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 59, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 60, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 61, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 62, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 63, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 64, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 65, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 66, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 67, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 68, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 69, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 70, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 71, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 72, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 73, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 74, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 75, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 76, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 77, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 78, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 79, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 80, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 81, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 82, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 83, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 84, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 85, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 86, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 87, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 88, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 89, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 90, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 91, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 92, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 93, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 94, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 95, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0, 31, 0, 96, 0, 1, 0, 0, 0,
+168,225,217, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,136, 7,214, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+136, 7,214, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,136, 7,214, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+136, 7,214, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,136, 7,214, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+136, 7,214, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,136, 7,214, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+136, 7,214, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,136, 7,214, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+136, 7,214, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 8,156,214, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+ 8,156,214, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 8,156,214, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+ 8,156,214, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 8,156,214, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+ 8,156,214, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 8,156,214, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+ 8,156,214, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 8,156,214, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+ 8,156,214, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,248, 9,215, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+248, 9,215, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,248, 9,215, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+248, 9,215, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,248, 9,215, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+248, 9,215, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,248, 9,215, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+248, 9,215, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,248, 9,215, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+248, 9,215, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,152, 66,216, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+152, 66,216, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,152, 66,216, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+152, 66,216, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,152, 66,216, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+152, 66,216, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,152, 66,216, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+152, 66,216, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,152, 66,216, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+152, 66,216, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 56, 43,217, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+ 56, 43,217, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 56, 43,217, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+ 56, 43,217, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 56, 43,217, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+ 56, 43,217, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 56, 43,217, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+ 56, 43,217, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 56, 43,217, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+ 56, 43,217, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,232,117,217, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+232,117,217, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,232,117,217, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+232,117,217, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,232,117,217, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+232,117,217, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,232,117,217, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+232,117,217, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,232,117,217, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+232,117,217, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 24,157,217, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+ 24,157,217, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 24,157,217, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+ 24,157,217, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 24,157,217, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+ 24,157,217, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 24,157,217, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+ 24,157,217, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 24,157,217, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+ 24,157,217, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,216, 29,218, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+216, 29,218, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,216, 29,218, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+216, 29,218, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,216, 29,218, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+216, 29,218, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,216, 29,218, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+216, 29,218, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,216, 29,218, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+216, 29,218, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,216, 29,218, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+216, 29,218, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0,216, 29,218, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+216, 29,218, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0,216, 29,218, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+216, 29,218, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0,216, 29,218, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+216, 29,218, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0,216, 29,218, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0,
+ 8, 78,210, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0, 8, 78,210, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0,
+ 8, 78,210, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0, 8, 78,210, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0,
+ 8, 78,210, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0, 8, 78,210, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0,
+ 8, 78,210, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0, 8, 78,210, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0,
+ 8, 78,210, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0, 8, 78,210, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0,
+ 8, 78,210, 3, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 1, 0, 1, 0, 0, 0,
+ 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 2, 0, 1, 0, 0, 0, 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 3, 0, 1, 0, 0, 0,
+ 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 4, 0, 1, 0, 0, 0, 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 5, 0, 1, 0, 0, 0,
+ 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 6, 0, 1, 0, 0, 0, 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 7, 0, 1, 0, 0, 0,
+ 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 8, 0, 1, 0, 0, 0, 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 9, 0, 1, 0, 0, 0,
+ 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 10, 0, 1, 0, 0, 0, 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 11, 0, 1, 0, 0, 0,
+ 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 12, 0, 1, 0, 0, 0, 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 13, 0, 1, 0, 0, 0,
+ 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 14, 0, 1, 0, 0, 0, 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 15, 0, 1, 0, 0, 0,
+ 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 16, 0, 1, 0, 0, 0, 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 17, 0, 1, 0, 0, 0,
+ 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 18, 0, 1, 0, 0, 0, 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 19, 0, 1, 0, 0, 0,
+ 24, 51,163, 3, 0, 0, 0, 0, 31, 0, 20, 0, 1, 0, 0, 0, 24, 51,163, 3, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
+ 56, 16,215, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 15,215, 3, 0, 0, 0, 0,
+232, 35,201, 3, 0, 0, 0, 0, 40, 32,201, 3, 0, 0, 0, 0, 8, 34,201, 3, 0, 0, 0, 0,136, 36,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 4, 0, 0, 85, 0, 0, 0,150, 2, 0, 0, 1, 1,112, 4, 66, 2, 1, 0,
+ 0, 0, 0, 0, 0, 0, 8, 0,232,105,177, 3, 0, 0, 0, 0,152, 92,215, 3, 0, 0, 0, 0,152, 92,215, 3, 0, 0, 0, 0,
+ 24,111,215, 3, 0, 0, 0, 0,216,117,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 24,214,207, 3, 0, 0, 0, 0, 88,210,207, 3, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 24,111,215, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0,200,112,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,108, 68,
+ 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,142, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,111, 4, 0, 0,
+ 0, 0, 0, 0, 25, 0, 0, 0, 0,224,141, 68, 0, 0,200, 65, 0,224,141, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,112, 4, 26, 0,112, 4, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 4, 0, 0, 85, 0, 0, 0,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,112, 4, 26, 0, 10, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 88,199,177, 3, 0, 0, 0, 0,248, 77,163, 3, 0, 0, 0, 0,248, 77,163, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,233,207, 3, 0, 0, 0, 0,120,238,207, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,200,112,215, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0,120,114,215, 3, 0, 0, 0, 0, 24,111,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,178, 67,
+ 0,192, 5,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67, 0, 0,168,195, 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0,
+ 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0,
+ 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64,
+ 10, 1, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,160, 0, 80, 1,143, 0, 80, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,159, 0, 0, 0, 71, 1, 0, 0,150, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,160, 0, 80, 1, 11, 0, 5, 0, 3, 0, 0, 0, 0, 0, 0, 0,160, 0, 50, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 88,195,177, 3, 0, 0, 0, 0,136, 64,163, 3, 0, 0, 0, 0,136, 64,163, 3, 0, 0, 0, 0,
+152, 77,215, 3, 0, 0, 0, 0, 8,165,165, 15, 0, 0, 0, 0,136,239,207, 3, 0, 0, 0, 0,184,242,207, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,152, 77,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0,120, 79,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,235,223, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95,111, 98,106,101, 99,116,109,111,
+100,101, 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, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95,111, 98,106,101, 99,116,109,111,
+100,101, 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, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 32, 84,111,111,108,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233,253,143, 0,255, 1, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 9, 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, 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, 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, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0,120, 79,215, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 88, 81,215, 3, 0, 0, 0, 0,
+152, 77,215, 3, 0, 0, 0, 0,136, 0,225, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80,
+ 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80,
+ 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,114,117,115,104, 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, 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,117,254,143, 0,115, 1,
+ 0, 0, 0, 0, 0, 0, 4, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 88, 81,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 56, 83,215, 3, 0, 0, 0, 0,120, 79,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 95,116,111,
+111,108, 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, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 95,116,111,
+111,108, 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, 0, 0, 0, 0, 0, 0, 84,111,111,108, 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, 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, 74,254,143, 0, 61, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 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, 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, 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, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0, 56, 83,215, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 24, 85,215, 3, 0, 0, 0, 0,
+ 88, 81,215, 3, 0, 0, 0, 0,200, 3,225, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80,
+ 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 95,115,116,114,111,107,101, 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, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80,
+ 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 95,115,116,114,111,107,101, 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, 0, 0, 0, 0, 83,116,114,111,107,101, 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, 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, 69,254,143, 0, 0, 0,
+ 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 0, 3, 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, 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, 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, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 24, 85,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0,248, 86,215, 3, 0, 0, 0, 0, 56, 83,215, 3, 0, 0, 0, 0,104, 5,225, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 95, 99,117,
+114,118,101, 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, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 95, 99,117,
+114,118,101, 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, 0, 0, 0, 0, 0, 67,117,114,118,101, 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, 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, 45,254,143, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 0, 4, 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, 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, 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, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0,248, 86,215, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,216, 88,215, 3, 0, 0, 0, 0,
+ 24, 85,215, 3, 0, 0, 0, 0, 72, 10,225, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80,
+ 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 95, 97,112,112,101, 97,114, 97,110, 99,101, 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, 86, 73, 69, 87, 51, 68, 95, 80,
+ 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 95, 97,112,112,101, 97,114, 97,110, 99,101, 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, 65,112,112,101, 97,114, 97,110,
+ 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229,253,143, 0, 0, 0,
+ 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 0, 7, 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, 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, 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, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,216, 88,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0,200,168,165, 15, 0, 0, 0, 0,248, 86,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95,118,101,114,116,101,120,112, 97,
+105,110,116, 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, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95,118,101,114,116,101,120,112, 97,
+105,110,116, 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, 0, 0, 0, 0, 0, 79,112,116,105,111,110,115, 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, 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,149,253,143, 0,146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 8, 92,138, 77,130,127, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0,136,203,138, 77,130,127, 0, 0,216,204,146, 77,130,127, 0, 0, 24, 24,231, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 95,116,111,111,108, 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, 0, 0,
- 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 95,116,111,111,108, 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, 0, 0,
- 0, 0, 0, 0, 84,111,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0,200,168,165, 15, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,232,166,165, 15, 0, 0, 0, 0,
+216, 88,215, 3, 0, 0, 0, 0, 40, 2,225, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80,
+ 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 95,116,101,120,116,117,114,101, 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, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80,
+ 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 95,116,101,120,116,117,114,101, 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, 0, 0, 0, 84,101,120,116,117,114,101, 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, 0,
- 0, 0, 0, 0, 0, 0, 74,254,143, 0, 61, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 93,254,143, 0, 0, 0,
+ 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 0, 1, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0,136,203,138, 77,130,127, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,152,154,145, 77,130,127, 0, 0, 8, 92,138, 77,
-130,127, 0, 0,232, 26,231, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,
-111,108,115, 95, 98,114,117,115,104, 95,115,116,114,111,107,101, 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, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,
-111,108,115, 95, 98,114,117,115,104, 95,115,116,114,111,107,101, 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, 0, 0, 0, 0, 83,116,114,111,107,101, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,232,166,165, 15, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 8,165,165, 15, 0, 0, 0, 0,200,168,165, 15, 0, 0, 0, 0, 8, 7,225, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,115, 99,117,108,112,116, 95,111,112,116,105,111,110,115,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111,254,143, 0, 0, 0, 0, 0, 0, 0,
- 4, 0, 0, 0, 0, 0, 0, 0, 2, 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, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,115, 99,117,108,112,116, 95,111,112,116,105,111,110,115,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 79,112,116,105,111,110,115, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0,152,154,145, 77,130,127, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0,184,192,149, 77,130,127, 0, 0,136,203,138, 77,130,127, 0, 0,184, 29,231, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 95, 99,117,114,118,101, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,254,143, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 0, 5, 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, 0, 0, 0,
- 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95, 98,114,117,115,104, 95, 99,117,114,118,101, 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, 0,
- 0, 0, 0, 0, 67,117,114,118,101, 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, 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, 87,254,143, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0, 8,165,165, 15, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+232,166,165, 15, 0, 0, 0, 0,168, 8,225, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80,
+ 84, 95,115, 99,117,108,112,116, 95,115,121,109,109,101,116,114,121, 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, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80,
+ 84, 95,115, 99,117,108,112,116, 95,115,121,109,109,101,116,114,121, 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, 0, 0, 0, 0, 0, 0, 0, 83,121,109,109,101,116,114,121,
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,
+ 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,253,253,143, 0, 0, 0,
+ 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 0, 6, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0,184,192,149, 77,130,127, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 88,230,149, 77,130,127, 0, 0,152,154,145, 77,
-130,127, 0, 0,184, 38,231, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,
-111,108,115, 95, 98,114,117,115,104, 95, 97,112,112,101, 97,114, 97,110, 99,101, 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, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,
-111,108,115, 95, 98,114,117,115,104, 95, 97,112,112,101, 97,114, 97,110, 99,101, 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, 65,112,112,101, 97,114, 97,110, 99,101, 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, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,254,143, 0, 0, 0, 0, 0, 0, 0,
- 4, 0, 0, 0, 0, 0, 0, 0, 4, 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, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,120,114,215, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 40,116,215, 3, 0, 0, 0, 0,200,112,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,178, 67,
+ 0, 0, 90,195, 0, 0, 0, 0, 0, 0, 0, 0,227,102, 16, 67, 24, 30, 90,195, 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0,
+ 0, 0, 0, 0,215, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0,
+ 0, 0, 0, 0,215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64,
+ 10, 3, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,160, 0,216, 0,143, 0,216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,159, 0, 0, 0,111, 0, 0, 0, 70, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,160, 0,216, 0, 12, 0, 6, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,136,196,177, 3, 0, 0, 0, 0, 88, 83,163, 3, 0, 0, 0, 0, 88, 83,163, 3, 0, 0, 0, 0,
+184, 90,215, 3, 0, 0, 0, 0,184, 90,215, 3, 0, 0, 0, 0,200,243,207, 3, 0, 0, 0, 0,248,246,207, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,184, 90,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184,197,177, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,108, 97,115,116, 95,111,112,101,114, 97,116,111,114, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,108, 97,115,116, 95,111,112,101,114, 97,116,111,114, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 88,230,149, 77,130,127, 0, 0,214, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184,192,149, 77,130,127, 0, 0,168, 47,231, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95,118,101,114,116,101,120,112, 97,105,110,116, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 99,117,108,112,116, 32, 77,111,100,101, 0, 32, 77,111,100,101, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95,118,101,114,116,101,120,112, 97,105,110,116, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216,255,144, 0, 16, 0, 0, 0, 0, 0, 0, 0, 39, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 79,112,116,105,111,110,115, 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, 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,149,253,143, 0,146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 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, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 1, 0, 0, 40,116,215, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,216,117,215, 3, 0, 0, 0, 0,
+120,114,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 67, 0, 96,158,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67,
+ 0, 96,158,196, 0,128,142,195,163, 0, 0, 0,180, 0, 0, 0, 0, 0, 0, 0,213, 3, 0, 0, 0, 0, 0, 0,162, 0, 0, 0,
+ 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0,213, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 1, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,180, 0,
+214, 3,163, 0,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 4, 0, 0,111, 4, 0, 0,
+111, 0, 0, 0,150, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0,
+ 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,189,177, 3, 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, 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, 68, 65, 84, 65,
- 40, 1, 0, 0,120,127, 44, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,136,130, 44, 5, 0, 0, 0, 0,104,124, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0,128,178, 67, 0, 0, 90,195, 0, 0, 0, 0, 0, 0, 0, 0,227,102, 16, 67, 24, 30, 90,195,
- 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0,215, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0,
- 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0,215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 3, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,160, 0,216, 0,143, 0,
-216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,159, 0, 0, 0,107, 0, 0, 0,
- 66, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 0,216, 0, 12, 0, 6, 0, 34, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248,116, 12, 5, 0, 0, 0, 0, 8,212,149, 77,
-130,127, 0, 0, 8,212,149, 77,130,127, 0, 0,232,128, 44, 5, 0, 0, 0, 0,232,128, 44, 5, 0, 0, 0, 0,200,245, 53, 76,
-130,127, 0, 0, 56,248, 53, 76,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0,232,128, 44, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,232,117, 12, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,108, 97,
-115,116, 95,111,112,101,114, 97,116,111,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,108, 97,
-115,116, 95,111,112,101,114, 97,116,111,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,101,114,116,101,120, 32, 80, 97,105,110,116,
- 32, 77,111,100,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216,255,144, 0, 16, 0, 0, 0, 0, 0,
- 0, 0, 39, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,136,130, 44, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0,248,131, 44, 5, 0, 0, 0, 0,120,127, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 67, 0, 96,158,196,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67, 0, 96,158,196, 0,128,142,195,163, 0, 0, 0,180, 0, 0, 0, 0, 0, 0, 0,
-213, 3, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0,
-213, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 1, 0, 0,
- 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,180, 0,214, 3,163, 0,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 47, 4, 0, 0, 47, 4, 0, 0,107, 0, 0, 0,153, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,248,110, 12, 5, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,248,131, 44, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,130, 44, 5, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,160, 0, 0, 0, 47, 4, 0, 0,107, 0, 0, 0,153, 2, 0, 0,160, 0, 0, 0, 47, 4, 0, 0,107, 0, 0, 0,
-153, 2, 0, 0,144, 3, 47, 2, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 8,110, 12, 5, 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, 0, 0, 0, 0,248, 25, 54, 76,130,127, 0, 0, 40, 25, 54, 76,130,127, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,104,133, 44, 5, 0, 0, 0, 0, 68, 65, 84, 65,120, 3, 0, 0,104,133, 44, 5, 0, 0, 0, 0,174, 0, 0, 0,
- 1, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,106,104,228, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 6,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0, 11,210, 76,190,
- 0, 0, 0, 0, 68,239,209, 62, 51,177,205,190,184,158, 81, 63, 0, 0, 0, 0, 70,119,105, 63,143, 74, 70, 62, 35, 44,185,190,
- 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63, 42, 61,228, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33,210,111,193,
- 0, 0,128, 63, 68,239,209, 62, 70,119,105, 63,176, 84, 89,188, 0, 0, 0, 0, 52,177,205,190,142, 74, 70, 62,166, 33,101, 63,
- 0, 0, 0, 0,185,158, 81, 63, 35, 44,185,190, 43, 61,228, 62, 0, 0, 0, 0, 62, 95, 68, 65, 51,120,173,192,115,208,213, 64,
- 0, 0,128, 63,178,157,229, 62,183,133, 55,191,116,169, 81,191,184,158, 81,191,117, 90,127, 63, 72,235,176, 62,158, 53,185, 62,
- 35, 44,185, 62,145,180,109,188,108,111,204, 63,218, 72,228,190, 42, 61,228,190, 0, 0, 0, 0, 0, 0, 0, 0, 33,171,108, 65,
- 33,210,111, 65,100,240,191, 62,110,116, 85, 63, 48,185, 70,188, 0, 0, 82,180,115,138,102,190,232, 62,222, 61,202,103, 0, 63,
- 0, 0, 64,179,197,112,117,194,178,208,216, 65,221,158, 5,194,231,251,159,192,221, 54,114, 66, 29,247,213,193, 59,221, 3, 66,
- 25, 4,160, 64, 68,239,209, 62, 51,177,205,190,184,158, 81, 63, 0, 0, 0, 0, 70,119,105, 63,143, 74, 70, 62, 35, 44,185,190,
- 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63, 42, 61,228, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33,210,111,193,
- 0, 0,128, 63,178,157,229, 62,183,133, 55,191,116,169, 81,191,184,158, 81,191,117, 90,127, 63, 72,235,176, 62,158, 53,185, 62,
- 35, 44,185, 62,145,180,109,188,108,111,204, 63,218, 72,228,190, 42, 61,228,190, 0, 0, 0, 0, 0, 0, 0, 0, 33,171,108, 65,
- 33,210,111, 65,204, 64, 16, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,204, 64, 16, 64, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,204, 64, 16, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 92, 62, 55, 63, 56,186,224,190,237,203,148,190, 3,236,234,190, 33,210,111, 65, 33,210,111, 65, 0, 0, 0, 0,
- 0, 0, 0, 0,135,102, 3, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 1, 0, 0, 0, 0, 0, 0, 0,
- 1, 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, 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,
+ 68, 65, 84, 65, 40, 1, 0, 0,216,117,215, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 40,116,215, 3, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 0, 0, 0,111, 4, 0, 0,
+111, 0, 0, 0,150, 2, 0, 0,160, 0, 0, 0,111, 4, 0, 0,111, 0, 0, 0,150, 2, 0, 0,208, 3, 40, 2, 13, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,188,177, 3, 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, 0, 0, 0, 0,
+ 40,151,207, 3, 0, 0, 0, 0,168, 34,208, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168, 62,216, 3, 0, 0, 0, 0,
+ 68, 65, 84, 65,112, 3, 0, 0,168, 62,216, 3, 0, 0, 0, 0,173, 0, 0, 0, 1, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71,137,247, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+142, 6,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0, 11,210, 76,190, 0, 0, 0, 0, 68,239,209, 62, 51,177,205,190,
+184,158, 81, 63, 0, 0, 0, 0, 70,119,105, 63,143, 74, 70, 62, 35, 44,185,190, 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63,
+ 42, 61,228, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33,210,111,193, 0, 0,128, 63, 68,239,209, 62, 70,119,105, 63,
+176, 84, 89,188, 0, 0, 0, 0, 52,177,205,190,142, 74, 70, 62,166, 33,101, 63, 0, 0, 0, 0,185,158, 81, 63, 35, 44,185,190,
+ 43, 61,228, 62, 0, 0, 0, 0, 62, 95, 68, 65, 51,120,173,192,115,208,213, 64, 0, 0,128, 63,178,157,229, 62, 69,228, 70,191,
+116,169, 81,191,184,158, 81,191,117, 90,127, 63, 69,188,191, 62,158, 53,185, 62, 35, 44,185, 62,145,180,109,188, 86,142,221, 63,
+218, 72,228,190, 42, 61,228,190, 0, 0, 0, 0, 0, 0, 0, 0, 33,171,108, 65, 33,210,111, 65,100,240,191, 62,110,116, 85, 63,
+ 48,185, 70,188, 0, 0, 82,180,137,185, 84,190, 30, 18,205, 61, 77,247,236, 62, 0, 0, 40, 51,197,112,117,194,178,208,216, 65,
+220,158, 5,194,231,251,159,192,221, 54,114, 66, 29,247,213,193, 58,221, 3, 66, 25, 4,160, 64, 68,239,209, 62, 51,177,205,190,
+184,158, 81, 63, 0, 0, 0, 0, 70,119,105, 63,143, 74, 70, 62, 35, 44,185,190, 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63,
+ 42, 61,228, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33,210,111,193, 0, 0,128, 63,178,157,229, 62, 69,228, 70,191,
+116,169, 81,191,184,158, 81,191,117, 90,127, 63, 69,188,191, 62,158, 53,185, 62, 35, 44,185, 62,145,180,109,188, 86,142,221, 63,
+218, 72,228,190, 42, 61,228,190, 0, 0, 0, 0, 0, 0, 0, 0, 33,171,108, 65, 33,210,111, 65, 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, 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, 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, 0, 0,128, 63, 32, 33, 12, 66,
- 85,152,137, 66,113, 27,126, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 96, 1, 0, 0, 40,137, 44, 5, 0, 0, 0, 0,175, 0, 0, 0, 1, 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, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65,
-205,204, 76, 62, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0,216,191, 45, 5, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 3, 0, 8, 24,128, 0, 0, 0, 12, 66, 0, 0,128, 63,
-205,204,204, 61, 0, 0,122, 68, 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, 16, 0, 10, 0, 7, 1, 0, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 78, 0, 0, 8, 1, 0, 0,104,139, 44, 5,
- 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,120,219, 44, 5, 0, 0, 0, 0, 8,136, 43, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 71, 97,109,101, 32, 76,111,103,105, 99, 0, 46, 48, 48, 49, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,184,140, 44, 5, 0, 0, 0, 0,104,146, 44, 5, 0, 0, 0, 0,216,146, 44, 5, 0, 0, 0, 0,152,155, 44, 5,
- 0, 0, 0, 0, 8,156, 44, 5, 0, 0, 0, 0, 40,212, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 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, 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, 68, 65, 84, 65, 32, 0, 0, 0,184,140, 44, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 40,141, 44, 5, 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, 68, 65, 84, 65, 32, 0, 0, 0, 40,141, 44, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0,152,141, 44, 5, 0, 0, 0, 0,184,140, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4,
- 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,152,141, 44, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 8,142, 44, 5,
- 0, 0, 0, 0, 40,141, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 5, 4, 0, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0, 8,142, 44, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,120,142, 44, 5, 0, 0, 0, 0,152,141, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,120,142, 44, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,232,142, 44, 5, 0, 0, 0, 0, 8,142, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,234, 3, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,232,142, 44, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0, 88,143, 44, 5, 0, 0, 0, 0,120,142, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7,234, 3,
- 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 88,143, 44, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,200,143, 44, 5,
- 0, 0, 0, 0,232,142, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 1, 0, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0,200,143, 44, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 56,144, 44, 5, 0, 0, 0, 0, 88,143, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 6,140, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 56,144, 44, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,168,144, 44, 5, 0, 0, 0, 0,200,143, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 32, 6, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,168,144, 44, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0, 24,145, 44, 5, 0, 0, 0, 0, 56,144, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7,140, 1,
- 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 24,145, 44, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,136,145, 44, 5,
- 0, 0, 0, 0,168,144, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 5,140, 1, 0, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0,136,145, 44, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,248,145, 44, 5, 0, 0, 0, 0, 24,145, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 5,234, 3, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,248,145, 44, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,104,146, 44, 5, 0, 0, 0, 0,136,145, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 1,140, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,104,146, 44, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248,145, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 1,234, 3,
- 1, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,216,146, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 72,147, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,141, 44, 5, 0, 0, 0, 0,152,141, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 72,147, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,184,147, 44, 5,
- 0, 0, 0, 0,216,146, 44, 5, 0, 0, 0, 0, 40,141, 44, 5, 0, 0, 0, 0,120,142, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,184,147, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 40,148, 44, 5,
- 0, 0, 0, 0, 72,147, 44, 5, 0, 0, 0, 0,152,141, 44, 5, 0, 0, 0, 0,232,142, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 40,148, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,152,148, 44, 5,
- 0, 0, 0, 0,184,147, 44, 5, 0, 0, 0, 0,120,142, 44, 5, 0, 0, 0, 0,232,142, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,152,148, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 8,149, 44, 5,
- 0, 0, 0, 0, 40,148, 44, 5, 0, 0, 0, 0,120,142, 44, 5, 0, 0, 0, 0, 88,143, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 8,149, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,120,149, 44, 5,
- 0, 0, 0, 0,152,148, 44, 5, 0, 0, 0, 0, 88,143, 44, 5, 0, 0, 0, 0,200,143, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,120,149, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,232,149, 44, 5,
- 0, 0, 0, 0, 8,149, 44, 5, 0, 0, 0, 0, 8,142, 44, 5, 0, 0, 0, 0, 56,144, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,232,149, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 88,150, 44, 5,
- 0, 0, 0, 0,120,149, 44, 5, 0, 0, 0, 0,200,143, 44, 5, 0, 0, 0, 0, 56,144, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 88,150, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,200,150, 44, 5,
- 0, 0, 0, 0,232,149, 44, 5, 0, 0, 0, 0,184,140, 44, 5, 0, 0, 0, 0, 88,143, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,200,150, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 56,151, 44, 5,
- 0, 0, 0, 0, 88,150, 44, 5, 0, 0, 0, 0,184,140, 44, 5, 0, 0, 0, 0, 56,144, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 56,151, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,168,151, 44, 5,
- 0, 0, 0, 0,200,150, 44, 5, 0, 0, 0, 0,232,142, 44, 5, 0, 0, 0, 0,168,144, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,168,151, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 24,152, 44, 5,
- 0, 0, 0, 0, 56,151, 44, 5, 0, 0, 0, 0, 8,142, 44, 5, 0, 0, 0, 0,168,144, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 24,152, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,136,152, 44, 5,
- 0, 0, 0, 0,168,151, 44, 5, 0, 0, 0, 0,200,143, 44, 5, 0, 0, 0, 0,168,144, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,136,152, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,248,152, 44, 5,
- 0, 0, 0, 0, 24,152, 44, 5, 0, 0, 0, 0, 24,145, 44, 5, 0, 0, 0, 0,136,145, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,248,152, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,104,153, 44, 5,
- 0, 0, 0, 0,136,152, 44, 5, 0, 0, 0, 0,232,142, 44, 5, 0, 0, 0, 0,136,145, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,104,153, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,216,153, 44, 5,
- 0, 0, 0, 0,248,152, 44, 5, 0, 0, 0, 0,168,144, 44, 5, 0, 0, 0, 0, 24,145, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,216,153, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 72,154, 44, 5,
- 0, 0, 0, 0,104,153, 44, 5, 0, 0, 0, 0, 88,143, 44, 5, 0, 0, 0, 0,248,145, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 72,154, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,184,154, 44, 5,
- 0, 0, 0, 0,216,153, 44, 5, 0, 0, 0, 0, 24,145, 44, 5, 0, 0, 0, 0,248,145, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,184,154, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 40,155, 44, 5,
- 0, 0, 0, 0, 72,154, 44, 5, 0, 0, 0, 0,120,142, 44, 5, 0, 0, 0, 0,104,146, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 40,155, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,152,155, 44, 5,
- 0, 0, 0, 0,184,154, 44, 5, 0, 0, 0, 0,136,145, 44, 5, 0, 0, 0, 0,104,146, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,152,155, 44, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 40,155, 44, 5, 0, 0, 0, 0,248,145, 44, 5, 0, 0, 0, 0,104,146, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0, 8,156, 44, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,216,159, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,142, 44, 5, 0, 0, 0, 0, 40,141, 44, 5, 0, 0, 0, 0,152,141, 44, 5,
- 0, 0, 0, 0,232,142, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,235, 3, 0, 0,
- 5, 4, 0, 0, 7, 7,127, 7, 27, 0, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,218, 44, 5,
- 0, 0, 0, 0,232,218, 44, 5, 0, 0, 0, 0,248,156, 44, 5, 0, 0, 0, 0,104,158, 44, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 1, 0, 0,248,156, 44, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,104,158, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,148, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,224,239, 68, 0, 0, 0, 0,
- 0, 0,208, 65, 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, 0, 0, 0, 0,126, 7, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,192,239, 68, 0, 0,200, 65, 0,192,239, 68,
- 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,127, 7, 26, 0,127, 7,
- 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,235, 3, 0, 0,
- 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127, 7, 26, 0, 0, 0, 1, 0, 2, 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, 60,203, 6, 64, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60,203, 6, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 60,203, 6, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 92, 62, 55, 63, 56,186,224,190,
+237,203,148,190, 3,236,234,190, 33,210,111, 65, 33,210,111, 65, 0, 0, 0, 0, 0, 0, 0, 0,114,145,245, 58, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 32, 33, 12, 66, 85,152,137, 66,113, 27,126, 66, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 96, 1, 0, 0,152, 92,215, 3, 0, 0, 0, 0,174, 0, 0, 0, 1, 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, 0, 0, 0,
+ 1, 0, 0, 0, 51, 51, 51, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65,205,204, 76, 62, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0,
+200,213,217, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 1, 0, 0,104,158, 44, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248,156, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0,240,109, 69, 0, 0,128,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,238, 68, 0, 0, 0, 0,
- 0, 0, 0, 64,112, 7, 0, 0,129, 7, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0,
- 17, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 2, 0, 0, 0, 1, 0, 3, 3, 2, 0, 0, 4, 10, 0,129, 7, 2, 0,112, 7,
- 2, 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, 5, 4, 0, 0,
- 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 3, 0,
+ 8, 24,128, 0, 0, 0, 12, 66, 0, 0,128, 63,205,204,204, 61, 0, 0,122, 68, 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, 16, 0, 10, 0, 7, 1, 0, 3, 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, 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, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
-160, 0, 0, 0,216,159, 44, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,104,184, 44, 5, 0, 0, 0, 0, 8,156, 44, 5,
- 0, 0, 0, 0, 56,144, 44, 5, 0, 0, 0, 0,200,143, 44, 5, 0, 0, 0, 0,168,144, 44, 5, 0, 0, 0, 0, 8,142, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,126, 7, 0, 0, 0, 0, 0, 0,139, 1, 0, 0, 4, 4, 94, 1,
-140, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,183, 44, 5, 0, 0, 0, 0, 40,183, 44, 5,
- 0, 0, 0, 0,200,160, 44, 5, 0, 0, 0, 0, 56,162, 44, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,200,160, 44, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 56,162, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,148, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,175, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,
- 93, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,174, 67, 0, 0,200, 65, 0,128,174, 67, 0, 0,200, 65, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 94, 1, 26, 0, 94, 1, 26, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,126, 7, 0, 0,114, 1, 0, 0,139, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 1, 26, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 83, 78, 0, 0, 8, 1, 0, 0,152, 66,216, 3, 0, 0, 0, 0,210, 0, 0, 0, 1, 0, 0, 0, 56, 43,217, 3, 0, 0, 0, 0,
+248, 9,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 71, 97,109,101, 32, 76,
+111,103,105, 99, 0, 46, 48, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 37,201, 3, 0, 0, 0, 0, 72, 45,201, 3, 0, 0, 0, 0,
+ 40,136,171, 3, 0, 0, 0, 0,184, 80,216, 3, 0, 0, 0, 0, 88, 17,215, 3, 0, 0, 0, 0,248, 22,215, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 6, 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, 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,
+ 68, 65, 84, 65, 32, 0, 0, 0, 40, 37,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,200, 37,201, 3, 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, 68, 65, 84, 65, 32, 0, 0, 0,
+200, 37,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,104, 38,201, 3, 0, 0, 0, 0, 40, 37,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,104, 38,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0, 8, 39,201, 3, 0, 0, 0, 0,200, 37,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+126, 7, 5, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 8, 39,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+168, 39,201, 3, 0, 0, 0, 0,104, 38,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0,168, 39,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 72, 40,201, 3, 0, 0, 0, 0,
+ 8, 39,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,234, 3, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+ 72, 40,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,232, 40,201, 3, 0, 0, 0, 0,168, 39,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,126, 7,234, 3, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,232, 40,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0,136, 41,201, 3, 0, 0, 0, 0, 72, 40,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,140, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,136, 41,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+ 40, 42,201, 3, 0, 0, 0, 0,232, 40,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 6,140, 1, 0, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0, 40, 42,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,200, 42,201, 3, 0, 0, 0, 0,
+136, 41,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 6, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+200, 42,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,104, 43,201, 3, 0, 0, 0, 0, 40, 42,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,126, 7,140, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,104, 43,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0, 8, 44,201, 3, 0, 0, 0, 0,200, 42,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 64, 5,140, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 8, 44,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+168, 44,201, 3, 0, 0, 0, 0,104, 43,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 5,234, 3, 1, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0,168, 44,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 72, 45,201, 3, 0, 0, 0, 0,
+ 8, 44,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 1,140, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+ 72, 45,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168, 44,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 1,234, 3, 1, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 40,136,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,216,136,171, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 37,201, 3, 0, 0, 0, 0,
+104, 38,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,216,136,171, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 88, 68,216, 3, 0, 0, 0, 0, 40,136,171, 3, 0, 0, 0, 0,200, 37,201, 3, 0, 0, 0, 0,
+168, 39,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 88, 68,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 8, 69,216, 3, 0, 0, 0, 0,216,136,171, 3, 0, 0, 0, 0,104, 38,201, 3, 0, 0, 0, 0,
+ 72, 40,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 8, 69,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,184, 69,216, 3, 0, 0, 0, 0, 88, 68,216, 3, 0, 0, 0, 0,168, 39,201, 3, 0, 0, 0, 0,
+ 72, 40,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,184, 69,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,104, 70,216, 3, 0, 0, 0, 0, 8, 69,216, 3, 0, 0, 0, 0,168, 39,201, 3, 0, 0, 0, 0,
+232, 40,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,104, 70,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 24, 71,216, 3, 0, 0, 0, 0,184, 69,216, 3, 0, 0, 0, 0,232, 40,201, 3, 0, 0, 0, 0,
+136, 41,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 24, 71,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,200, 71,216, 3, 0, 0, 0, 0,104, 70,216, 3, 0, 0, 0, 0, 8, 39,201, 3, 0, 0, 0, 0,
+ 40, 42,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,200, 71,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,120, 72,216, 3, 0, 0, 0, 0, 24, 71,216, 3, 0, 0, 0, 0,136, 41,201, 3, 0, 0, 0, 0,
+ 40, 42,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,120, 72,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 40, 73,216, 3, 0, 0, 0, 0,200, 71,216, 3, 0, 0, 0, 0, 40, 37,201, 3, 0, 0, 0, 0,
+232, 40,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 40, 73,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,216, 73,216, 3, 0, 0, 0, 0,120, 72,216, 3, 0, 0, 0, 0, 40, 37,201, 3, 0, 0, 0, 0,
+ 40, 42,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,216, 73,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,136, 74,216, 3, 0, 0, 0, 0, 40, 73,216, 3, 0, 0, 0, 0, 72, 40,201, 3, 0, 0, 0, 0,
+200, 42,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,136, 74,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 56, 75,216, 3, 0, 0, 0, 0,216, 73,216, 3, 0, 0, 0, 0, 8, 39,201, 3, 0, 0, 0, 0,
+200, 42,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 56, 75,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,232, 75,216, 3, 0, 0, 0, 0,136, 74,216, 3, 0, 0, 0, 0,136, 41,201, 3, 0, 0, 0, 0,
+200, 42,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,232, 75,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,152, 76,216, 3, 0, 0, 0, 0, 56, 75,216, 3, 0, 0, 0, 0,104, 43,201, 3, 0, 0, 0, 0,
+ 8, 44,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,152, 76,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 72, 77,216, 3, 0, 0, 0, 0,232, 75,216, 3, 0, 0, 0, 0, 72, 40,201, 3, 0, 0, 0, 0,
+ 8, 44,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 72, 77,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,248, 77,216, 3, 0, 0, 0, 0,152, 76,216, 3, 0, 0, 0, 0,200, 42,201, 3, 0, 0, 0, 0,
+104, 43,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,248, 77,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,168, 78,216, 3, 0, 0, 0, 0, 72, 77,216, 3, 0, 0, 0, 0,232, 40,201, 3, 0, 0, 0, 0,
+168, 44,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,168, 78,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 88, 79,216, 3, 0, 0, 0, 0,248, 77,216, 3, 0, 0, 0, 0,104, 43,201, 3, 0, 0, 0, 0,
+168, 44,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 88, 79,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 8, 80,216, 3, 0, 0, 0, 0,168, 78,216, 3, 0, 0, 0, 0,168, 39,201, 3, 0, 0, 0, 0,
+ 72, 45,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 8, 80,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0,184, 80,216, 3, 0, 0, 0, 0, 88, 79,216, 3, 0, 0, 0, 0, 8, 44,201, 3, 0, 0, 0, 0,
+ 72, 45,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,184, 80,216, 3, 0, 0, 0, 0,
+212, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80,216, 3, 0, 0, 0, 0,168, 44,201, 3, 0, 0, 0, 0,
+ 72, 45,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0, 88, 17,215, 3, 0, 0, 0, 0,
+214, 0, 0, 0, 1, 0, 0, 0,120, 18,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168, 39,201, 3, 0, 0, 0, 0,
+200, 37,201, 3, 0, 0, 0, 0,104, 38,201, 3, 0, 0, 0, 0, 72, 40,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,126, 7, 0, 0,235, 3, 0, 0, 5, 4, 0, 0, 7, 7,127, 7, 27, 0, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,216,199,207, 3, 0, 0, 0, 0,216,199,207, 3, 0, 0, 0, 0,136,119,215, 3, 0, 0, 0, 0,
+ 56,121,215, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,136,119,215, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+ 56,121,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,148, 68, 0, 0, 0, 0, 0, 0,208, 65,
+ 0, 0, 0, 0, 0,224,239, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,126, 7, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0,
+ 0,192,239, 68, 0, 0,200, 65, 0,192,239, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3,
+ 4, 0, 12, 0, 10, 0,127, 7, 26, 0,127, 7, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,126, 7, 0, 0,235, 3, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+127, 7, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 56,121,215, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,136,119,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,109, 69, 0, 0,128,192, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,238, 68, 0, 0, 0, 0, 0, 0, 0, 64,112, 7, 0, 0,129, 7, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 2, 0, 0, 0, 1, 0, 3, 3,
+ 2, 0, 0, 4, 10, 0,129, 7, 2, 0,112, 7, 2, 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, 5, 4, 0, 0, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 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, 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, 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, 68, 65, 84, 65,160, 0, 0, 0,120, 18,215, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,
+152, 19,215, 3, 0, 0, 0, 0, 88, 17,215, 3, 0, 0, 0, 0, 40, 42,201, 3, 0, 0, 0, 0,136, 41,201, 3, 0, 0, 0, 0,
+200, 42,201, 3, 0, 0, 0, 0, 8, 39,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,126, 7, 0, 0,
+ 0, 0, 0, 0,139, 1, 0, 0, 4, 4, 94, 1,140, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 56,128,199, 3, 0, 0, 0, 0, 56,128,199, 3, 0, 0, 0, 0,232,122,215, 3, 0, 0, 0, 0,152,124,215, 3, 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, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 1, 0, 0,232,122,215, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,152,124,215, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,175, 67,
+ 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,174, 67, 0, 0,200, 65,
+ 0,128,174, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 94, 1,
+ 26, 0, 94, 1, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,126, 7, 0, 0,
+114, 1, 0, 0,139, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 1, 26, 0, 0, 0, 1, 0,
+ 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 56,162, 44, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,160, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,128,174, 67, 0, 0, 61,196, 0, 0, 0, 0, 0, 0, 0, 0,255,127,166, 67,255,255,184,195, 0, 0, 0, 0, 77, 1, 0, 0,
- 94, 1, 0, 0, 0, 0, 0, 0,113, 1, 0, 0, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,
- 76, 1, 0, 0, 0, 0, 0, 0,113, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 64, 10, 1, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0, 94, 1,114, 1, 77, 1,114, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,126, 7, 0, 0, 0, 0, 0, 0,113, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 1,114, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,168,163, 44, 5, 0, 0, 0, 0,136,181, 44, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,168,163, 44, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 72,165, 44, 5, 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, 66, 85, 84, 84, 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101,120,116, 0, 0,
+ 68, 65, 84, 65, 40, 1, 0, 0,152,124,215, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+232,122,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,174, 67, 0, 0, 61,196, 0, 0, 0, 0, 0, 0, 0, 0,255,127,166, 67,
+255,255,184,195, 0, 0, 0, 0, 77, 1, 0, 0, 94, 1, 0, 0, 0, 0, 0, 0,113, 1, 0, 0, 0, 0, 0, 0, 78, 1, 0, 0,
+ 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 0, 0,113, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 1, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0, 94, 1,
+114, 1, 77, 1,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 0, 0,126, 7, 0, 0,
+ 0, 0, 0, 0,113, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 1,114, 1, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 85, 84, 84, 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101,120,116, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120, 94,215, 3, 0, 0, 0, 0,184,205,216, 3, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,110,116,101,120,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0,120, 94,215, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 88, 96,215, 3, 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, 66, 85, 84, 84, 79, 78, 83, 95,
+ 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 85, 84, 84, 79, 78, 83, 95,
+ 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,110,116,101,120,116, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,220,255, 76, 1, 36, 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, 0, 0, 0, 0, 0, 0, 0,220,255, 76, 1, 36, 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, 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, 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, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 72,165, 44, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,232,166, 44, 5,
- 0, 0, 0, 0,168,163, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,114,101,110,100,101,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,114,101,110,100,101,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,
-101,114, 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, 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,135,255,
- 76, 1, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 68, 65, 84, 65, 88, 1, 0, 0, 88, 96,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 56, 98,215, 3, 0, 0, 0, 0,120, 94,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,110,100,101,114, 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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,110,100,101,114, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0,232,166, 44, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,136,168, 44, 5, 0, 0, 0, 0, 72,165, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 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, 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, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,135,255, 76, 1, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,121,101,114,115, 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, 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,111,255, 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
- 2, 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, 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,
+ 68, 65, 84, 65, 88, 1, 0, 0, 56, 98,215, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 24,100,215, 3, 0, 0, 0, 0,
+ 88, 96,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,108, 97,121,101,114,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,108, 97,121,101,114,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,121,101,114,115, 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, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,136,168, 44, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 40,170, 44, 5,
- 0, 0, 0, 0,232,166, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,105,109,101,
-110,115,105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140,254,
- 76, 1,203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,111,255, 76, 1, 0, 0,
+ 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 40,170, 44, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,200,171, 44, 5, 0, 0, 0, 0,136,168, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,
-110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,
-110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,110,116,105, 45, 65,108,105, 97,115,105,110,103, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 24,100,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0,248,101,215, 3, 0, 0, 0, 0, 56, 98,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58,254, 76, 1, 58, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 4, 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, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68,105,109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,200,171, 44, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,104,173, 44, 5,
- 0, 0, 0, 0, 40,170, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,109,111,116,105,111,110, 95, 98,108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,109,111,116,105,111,110, 95, 98,108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 97,109,112,
-108,101,100, 32, 77,111,116,105,111,110, 32, 66,108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,254,
- 76, 1, 0, 0, 20, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 5, 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,140,254, 76, 1,203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 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, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,104,173, 44, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 8,175, 44, 5, 0, 0, 0, 0,200,171, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,104, 97,100,105,110,103, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,104, 97,100,105,110,103, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0,248,101,215, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,216,103,215, 3, 0, 0, 0, 0,
+ 24,100,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,110,116,105, 45, 65,108,105,
+ 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58,254, 76, 1, 58, 0,
+ 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 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, 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, 83,104, 97,100,105,110,103, 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, 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, 10,254, 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
- 6, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,216,103,215, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 88,196,216, 3, 0, 0, 0, 0,248,101,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,116,105,111,110, 95, 98,108,117,114, 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, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,116,105,111,110, 95, 98,108,117,114, 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, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 8,175, 44, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,168,176, 44, 5,
- 0, 0, 0, 0,104,173, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,109, 97,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,109, 97,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,101,114,102,
-111,114,109, 97,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,242,253,
- 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 97,109,112,108,101,100, 32, 77,111,116,105,111,110, 32, 66,108,117,114, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,254, 76, 1, 0, 0, 20, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 5, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,168,176, 44, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 72,178, 44, 5, 0, 0, 0, 0, 8,175, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,
-115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,
-115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 80,111,115,116, 32, 80,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,218,253, 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
- 8, 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, 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,
+ 68, 65, 84, 65, 88, 1, 0, 0, 88,196,216, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 56,198,216, 3, 0, 0, 0, 0,
+216,103,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,115,104, 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,115,104, 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,104, 97,100,105,110,103, 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, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 72,178, 44, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,232,179, 44, 5,
- 0, 0, 0, 0,168,176, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,109,
-112, 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, 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,194,253,
- 76, 1, 0, 0, 20, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 9, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,254, 76, 1, 0, 0,
+ 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 6, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,232,179, 44, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,136,181, 44, 5, 0, 0, 0, 0, 72,178, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 56,198,216, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 24,200,216, 3, 0, 0, 0, 0, 88,196,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,109, 97,110, 99,101, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,109, 97,110, 99,101, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 80,101,114,102,111,114,109, 97,110, 99,101, 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, 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, 40,253, 76, 1,130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 10, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,242,253, 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 7, 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, 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, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,136,181, 44, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,232,179, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95, 98, 97,107,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95, 98, 97,107,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 97,107,101,
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,
- 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, 16,253,
- 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0, 24,200,216, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,248,201,216, 3, 0, 0, 0, 0,
+ 56,198,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 80,111,115,116, 32, 80,114,111,
+ 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,218,253, 76, 1, 0, 0,
+ 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 8, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 0, 0, 0, 40,183, 44, 5,
- 0, 0, 0, 0,180, 0, 0, 0, 1, 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, 0, 0, 0, 4, 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, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,248,201,216, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0,216,203,216, 3, 0, 0, 0, 0, 24,200,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,109,112, 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, 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,194,253, 76, 1, 0, 0, 20, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 9, 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, 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, 2, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 21, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,104,184, 44, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,216,191, 44, 5,
- 0, 0, 0, 0,216,159, 44, 5, 0, 0, 0, 0,184,140, 44, 5, 0, 0, 0, 0, 88,143, 44, 5, 0, 0, 0, 0,200,143, 44, 5,
- 0, 0, 0, 0, 56,144, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 6, 0, 0, 0, 0, 0, 0,
-139, 1, 0, 0, 17, 17, 32, 6,140, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,191, 44, 5,
- 0, 0, 0, 0, 72,191, 44, 5, 0, 0, 0, 0, 88,185, 44, 5, 0, 0, 0, 0,216,189, 44, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65,
- 40, 1, 0, 0, 88,185, 44, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,200,186, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,196, 68, 0, 0, 0, 0,
- 0, 0,208, 65, 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, 0, 0, 0, 0, 31, 6, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,224,195, 68, 0, 0,200, 65, 0,224,195, 68,
- 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 32, 6, 26, 0, 32, 6,
- 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 6, 0, 0, 0, 0, 0, 0,
- 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 6, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65,
- 40, 1, 0, 0,200,186, 44, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,216,189, 44, 5, 0, 0, 0, 0, 88,185, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 67, 0, 0,185,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 67, 0, 0,185,195,
- 0, 0, 0, 0,203, 0, 0, 0,220, 0, 0, 0, 0, 0, 0, 0,113, 1, 0, 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0,
- 17, 0, 0, 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0,113, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 3, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,220, 0,114, 1,203, 0,
-114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,219, 0, 0, 0, 26, 0, 0, 0,
-139, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,220, 0,114, 1, 0, 0, 4, 0, 3, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,188, 44, 5, 0, 0, 0, 0, 56,188, 44, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65,
- 88, 1, 0, 0, 56,188, 44, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 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, 0, 0, 0, 76, 79, 71, 73, 67, 95, 80, 84, 95,112,114,111,
-112,101,114,116,105,101,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 79, 71, 73, 67, 95, 80, 84, 95,112,114,111,
-112,101,114,116,105,101,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,114,111,112,101,114,116,105,101,115, 0, 0,
+ 68, 65, 84, 65, 88, 1, 0, 0,216,203,216, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,184,205,216, 3, 0, 0, 0, 0,
+248,201,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80,
+ 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,117,116,112,117,116, 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, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,196,255,203, 0, 36, 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, 40,253, 76, 1,130, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 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, 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, 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, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,184,205,216, 3, 0, 0, 0, 0,
+213, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216,203,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,107,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,216,189, 44, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,186, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 68, 0, 0, 0, 0,
- 0, 0,112, 67, 0, 80, 31,195, 0,234,179, 68,224,198,182,194,184,177,165, 67, 51, 5, 0, 0, 68, 5, 0, 0, 18, 0, 0, 0,
-113, 1, 0, 0, 0, 0, 0, 0, 50, 5, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 50, 5, 0, 0, 18, 0, 0, 0,
-113, 1, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,250, 70, 0, 0,250, 70, 0, 0, 0, 63, 72,225,154, 63, 10, 0, 0, 0,
- 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, 68, 5,114, 1, 51, 5, 96, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,220, 0, 0, 0, 31, 6, 0, 0, 26, 0, 0, 0,139, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 5,114, 1, 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, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,107,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 97,107,101, 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, 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, 68, 65, 84, 65, 72, 0, 0, 0, 72,191, 44, 5, 0, 0, 0, 0,193, 0, 0, 0,
- 1, 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, 0, 0, 0, 17, 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,255, 7,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,216,191, 44, 5, 0, 0, 0, 0,215, 0, 0, 0,
- 1, 0, 0, 0,152,198, 44, 5, 0, 0, 0, 0,104,184, 44, 5, 0, 0, 0, 0, 24,145, 44, 5, 0, 0, 0, 0,136,145, 44, 5,
- 0, 0, 0, 0,232,142, 44, 5, 0, 0, 0, 0,168,144, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 5, 0, 0,
-126, 7, 0, 0,141, 1, 0, 0,233, 3, 0, 0, 9, 9, 62, 2, 93, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,168,195, 44, 5, 0, 0, 0, 0,168,195, 44, 5, 0, 0, 0, 0,200,192, 44, 5, 0, 0, 0, 0, 56,194, 44, 5,
- 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,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,200,192, 44, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 56,194, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,230, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0,
- 0,128, 15, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 61, 2, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 64, 15, 68,
- 0, 0,200, 65, 0, 64, 15, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0,
- 10, 0, 62, 2, 26, 0, 62, 2, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 5, 0, 0,
-126, 7, 0, 0,141, 1, 0, 0,166, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 2, 26, 0,
- 0, 0, 1, 0, 2, 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, 0, 0, 0, 0, 0, 16,253, 76, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 11, 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, 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, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 56,194, 44, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,200,192, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,181, 67, 0, 0, 0, 0, 0,128,218, 67, 0, 0, 0, 0,
-131,248, 1, 68, 0, 0, 0, 0, 86, 26, 3, 68, 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, 0, 0, 0, 0, 61, 2, 0, 0, 0, 0, 0, 0, 66, 2, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,122, 68, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 4,
- 10, 0, 62, 2, 67, 2, 62, 2, 67, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 5, 0, 0,
-126, 7, 0, 0,167, 1, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 2, 67, 2,
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,
+ 68, 65, 84, 65,248, 0, 0, 0, 56,128,199, 3, 0, 0, 0, 0,179, 0, 0, 0, 1, 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, 0, 0, 0, 4, 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, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65,160, 2, 0, 0,168,195, 44, 5, 0, 0, 0, 0,187, 0, 0, 0, 1, 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, 0, 0, 0, 9, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 21, 0, 0,160, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,152, 19,215, 3, 0, 0, 0, 0,
+214, 0, 0, 0, 1, 0, 0, 0,184, 20,215, 3, 0, 0, 0, 0,120, 18,215, 3, 0, 0, 0, 0, 40, 37,201, 3, 0, 0, 0, 0,
+232, 40,201, 3, 0, 0, 0, 0,136, 41,201, 3, 0, 0, 0, 0, 40, 42,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 31, 6, 0, 0, 0, 0, 0, 0,139, 1, 0, 0, 17, 17, 32, 6,140, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,248,217,208, 3, 0, 0, 0, 0,248,217,208, 3, 0, 0, 0, 0, 72,126,215, 3, 0, 0, 0, 0,
+168,129,215, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 72,126,215, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+248,127,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 67, 0, 0, 0, 0, 0, 0,208, 65,
+ 0, 0, 0, 0, 0, 0,196, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 31, 6, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0,
+ 0,224,195, 68, 0, 0,200, 65, 0,224,195, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3,
+ 4, 0, 12, 0, 10, 0, 32, 6, 26, 0, 32, 6, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 31, 6, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 32, 6, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,248,127,215, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+168,129,215, 3, 0, 0, 0, 0, 72,126,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 67, 0, 0,185,195, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 75, 67, 0, 0,185,195, 0, 0, 0, 0,203, 0, 0, 0,220, 0, 0, 0, 0, 0, 0, 0,113, 1, 0, 0,
+ 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0,113, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 3, 0, 0, 1, 0, 7, 0,
+ 18, 0, 0, 4, 6, 0,220, 0,114, 1,203, 0,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,219, 0, 0, 0, 26, 0, 0, 0,139, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+220, 0,114, 1, 0, 0, 4, 0, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,207,216, 3, 0, 0, 0, 0,
+152,207,216, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,152,207,216, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 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, 0, 0, 0,
+ 76, 79, 71, 73, 67, 95, 80, 84, 95,112,114,111,112,101,114,116,105,101,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 76, 79, 71, 73, 67, 95, 80, 84, 95,112,114,111,112,101,114,116,105,101,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 80,114,111,112,101,114,116,105,101,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,196,255,203, 0, 36, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
+168,129,215, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248,127,215, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,160, 68, 0, 0, 0, 0, 0, 0,112, 67, 0, 80, 31,195, 0,234,179, 68,224,198,182,194,184,177,165, 67,
+ 51, 5, 0, 0, 68, 5, 0, 0, 18, 0, 0, 0,113, 1, 0, 0, 0, 0, 0, 0, 50, 5, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
+ 0, 0, 0, 0, 50, 5, 0, 0, 18, 0, 0, 0,113, 1, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,250, 70, 0, 0,250, 70,
+ 0, 0, 0, 63, 72,225,154, 63, 10, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, 68, 5,114, 1, 51, 5, 96, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,220, 0, 0, 0, 31, 6, 0, 0, 26, 0, 0, 0,139, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 5,114, 1, 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, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65, 72, 0, 0, 0,
+248,217,208, 3, 0, 0, 0, 0,192, 0, 0, 0, 1, 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, 0, 0, 0, 17, 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,255, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
+184, 20,215, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,216, 21,215, 3, 0, 0, 0, 0,152, 19,215, 3, 0, 0, 0, 0,
+104, 43,201, 3, 0, 0, 0, 0, 8, 44,201, 3, 0, 0, 0, 0, 72, 40,201, 3, 0, 0, 0, 0,200, 42,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 65, 5, 0, 0,126, 7, 0, 0,141, 1, 0, 0,233, 3, 0, 0, 9, 9, 62, 2, 93, 2, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,228,216, 3, 0, 0, 0, 0, 40,228,216, 3, 0, 0, 0, 0,
+ 88,131,215, 3, 0, 0, 0, 0, 8,133,215, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 88,131,215, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 8,133,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,230, 67,
+ 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,128, 15, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 61, 2, 0, 0,
+ 0, 0, 0, 0, 25, 0, 0, 0, 0, 64, 15, 68, 0, 0,200, 65, 0, 64, 15, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 62, 2, 26, 0, 62, 2, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 65, 5, 0, 0,126, 7, 0, 0,141, 1, 0, 0,166, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 62, 2, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 8,133,215, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,131,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,181, 67,
+ 0, 0, 0, 0, 0,128,218, 67, 0, 0, 0, 0,131,248, 1, 68, 0, 0, 0, 0, 86, 26, 3, 68, 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, 0, 0, 0, 0, 61, 2, 0, 0,
+ 0, 0, 0, 0, 66, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,122, 68,
+ 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 4, 10, 0, 62, 2, 67, 2, 62, 2, 67, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 65, 5, 0, 0,126, 7, 0, 0,167, 1, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 62, 2, 67, 2, 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, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65,160, 2, 0, 0, 40,228,216, 3, 0, 0, 0, 0,
+186, 0, 0, 0, 1, 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, 0, 0, 0, 9, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 4, 0, 0, 0, 1, 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, 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, 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, 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,
@@ -3879,790 +3903,784 @@ char datatoc_startup_blend[]= {
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,
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,
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,
- 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, 68, 65, 84, 65,
-160, 0, 0, 0,152,198, 44, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 40,212, 44, 5, 0, 0, 0, 0,216,191, 44, 5,
- 0, 0, 0, 0,248,145, 44, 5, 0, 0, 0, 0,104,146, 44, 5, 0, 0, 0, 0,136,145, 44, 5, 0, 0, 0, 0, 24,145, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 63, 5, 0, 0,141, 1, 0, 0,233, 3, 0, 0, 1, 1,251, 3,
- 93, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,210, 44, 5, 0, 0, 0, 0,120,210, 44, 5,
- 0, 0, 0, 0,136,199, 44, 5, 0, 0, 0, 0, 72,205, 44, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,136,199, 44, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,248,200, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 64,113, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,192,126, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,
-250, 3, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,126, 68, 0, 0,200, 65, 0,128,126, 68, 0, 0,200, 65, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,251, 3, 26, 0,251, 3, 26, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 63, 5, 0, 0,141, 1, 0, 0,166, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,251, 3, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,248,200, 44, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,104,202, 44, 5, 0, 0, 0, 0,136,199, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 15, 67, 0, 64, 70,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67,255,127, 70,196, 0, 0, 0, 0,143, 0, 0, 0,
-160, 0, 0, 0, 18, 0, 0, 0, 43, 3, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,
-142, 0, 0, 0, 18, 0, 0, 0, 43, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,160, 0, 44, 3,143, 0, 26, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 69, 1, 0, 0,167, 1, 0, 0,233, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 67, 2, 0, 0, 5, 0, 3, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,104,202, 44, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,216,203, 44, 5, 0, 0, 0, 0,248,200, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 16, 67, 0, 0,206,194, 0, 0, 0, 0, 0, 0, 0, 0,231,102, 16, 67, 0, 0,206,194, 0, 0, 0, 0,143, 0, 0, 0,
-160, 0, 0, 0, 18, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,
-142, 0, 0, 0, 18, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,160, 0,120, 0,143, 0,102, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 63, 5, 0, 0,167, 1, 0, 0,167, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 6, 0, 34, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,216,203, 44, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 72,205, 44, 5, 0, 0, 0, 0,104,202, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 52, 67, 0, 0,109,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67, 0, 0,109,196, 0,128,145,195,163, 0, 0, 0,
-180, 0, 0, 0, 0, 0, 0, 0,144, 2, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,
-162, 0, 0, 0, 0, 0, 0, 0,144, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 64, 10, 1, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,180, 0,145, 2,163, 0,145, 2, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 5, 0, 0, 63, 5, 0, 0,167, 1, 0, 0,233, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 72,205, 44, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216,203, 44, 5, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 63, 5, 0, 0,167, 1, 0, 0,233, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,251, 3, 67, 2, 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, 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, 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,184,206, 44, 5, 0, 0, 0, 0, 68, 65, 84, 65,120, 3, 0, 0,184,206, 44, 5,
- 0, 0, 0, 0,174, 0, 0, 0, 1, 0, 0, 0,190, 35, 30, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 75, 40,139, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0,128,
- 0, 0, 0,128, 0, 0, 0,128, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,190, 35, 30, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 75, 40,139, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,149, 53,207, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-112,121,107, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,190, 35, 30, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 75, 40,139, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,207, 3,116, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-207, 3,116, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,207, 3,116, 64, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,149, 53,207, 65,
-214,211,111, 65, 0, 0, 0, 0, 0, 0, 0, 0,221, 57, 80, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0,251,251,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 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, 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, 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, 68, 65, 84, 65,160, 0, 0, 0,216, 21,215, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,
+248, 22,215, 3, 0, 0, 0, 0,184, 20,215, 3, 0, 0, 0, 0,168, 44,201, 3, 0, 0, 0, 0, 72, 45,201, 3, 0, 0, 0, 0,
+ 8, 44,201, 3, 0, 0, 0, 0,104, 43,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 63, 5, 0, 0,
+141, 1, 0, 0,233, 3, 0, 0, 1, 1,251, 3, 93, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+120,209,216, 3, 0, 0, 0, 0,120,209,216, 3, 0, 0, 0, 0,184,134,215, 3, 0, 0, 0, 0,216,234,216, 3, 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, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 1, 0, 0,184,134,215, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,104,136,215, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,113, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,192,126, 68,
+ 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,250, 3, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,126, 68, 0, 0,200, 65,
+ 0,128,126, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,251, 3,
+ 26, 0,251, 3, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 63, 5, 0, 0,
+141, 1, 0, 0,166, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,251, 3, 26, 0, 0, 0, 1, 0,
+ 2, 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, 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, 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,
+ 68, 65, 84, 65, 40, 1, 0, 0,104,136,215, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,120,231,216, 3, 0, 0, 0, 0,
+184,134,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67, 0, 64, 70,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67,
+255,127, 70,196, 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0, 18, 0, 0, 0, 43, 3, 0, 0, 0, 0, 0, 0,142, 0, 0, 0,
+ 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 18, 0, 0, 0, 43, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,160, 0,
+ 44, 3,143, 0, 26, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 69, 1, 0, 0,
+167, 1, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 67, 2, 0, 0, 5, 0,
+ 3, 0, 1, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 62, 55, 63, 56,186,224,190,237,203,148,190, 3,236,234,190, 1, 0, 0, 0,
- 0, 0,128, 63, 0, 0,180, 66, 0, 0,180, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 96, 1, 0, 0,120,210, 44, 5, 0, 0, 0, 0,175, 0, 0, 0, 1, 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, 0, 0, 0, 1, 0, 0, 0,
- 51, 51, 51, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 32, 65,205,204, 76, 62, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0,216,191, 45, 5,
+ 68, 65, 84, 65, 40, 1, 0, 0,120,231,216, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 40,233,216, 3, 0, 0, 0, 0,
+104,136,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 67, 0, 0,206,194, 0, 0, 0, 0, 0, 0, 0, 0,231,102, 16, 67,
+ 0, 0,206,194, 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0, 18, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0,
+ 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 18, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,160, 0,
+120, 0,143, 0,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 63, 5, 0, 0,
+167, 1, 0, 0,167, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 6, 0,
+ 34, 0, 2, 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, 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, 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,
+ 68, 65, 84, 65, 40, 1, 0, 0, 40,233,216, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,216,234,216, 3, 0, 0, 0, 0,
+120,231,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 67, 0, 0,109,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67,
+ 0, 0,109,196, 0,128,145,195,163, 0, 0, 0,180, 0, 0, 0, 0, 0, 0, 0,144, 2, 0, 0, 0, 0, 0, 0,162, 0, 0, 0,
+ 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0,144, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 1, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,180, 0,
+145, 2,163, 0,145, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 5, 0, 0, 63, 5, 0, 0,
+167, 1, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0,
+ 4, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 3, 0, 8, 8,128, 0,
- 0, 0, 12, 66, 0, 0,128, 63,205,204,204, 61, 0, 0,122, 68, 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, 16, 0, 10, 0, 7, 1, 0, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
-160, 0, 0, 0, 40,212, 44, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,198, 44, 5,
- 0, 0, 0, 0, 88,143, 44, 5, 0, 0, 0, 0,120,142, 44, 5, 0, 0, 0, 0,104,146, 44, 5, 0, 0, 0, 0,248,145, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 1, 0, 0,141, 1, 0, 0,233, 3, 0, 0, 3, 3, 68, 1,
- 93, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248,215, 44, 5, 0, 0, 0, 0,248,215, 44, 5,
- 0, 0, 0, 0, 24,213, 44, 5, 0, 0, 0, 0,136,214, 44, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 24,213, 44, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,136,214, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,128,244, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,162, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,
- 67, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,161, 67, 0, 0,200, 65, 0,128,161, 67, 0, 0,200, 65, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 68, 1, 26, 0, 68, 1, 26, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 1, 0, 0,141, 1, 0, 0,166, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 1, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,136,214, 44, 5,
- 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,213, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,128,141, 67, 0, 0,244,194, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,153, 67, 0, 64, 12,196, 0, 0, 0, 0, 51, 1, 0, 0,
- 68, 1, 0, 0, 18, 0, 0, 0, 66, 2, 0, 0, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,
- 50, 1, 0, 0, 18, 0, 0, 0, 66, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 18, 6, 0, 0, 2, 0, 3, 3, 0, 0, 12, 4, 6, 0, 68, 1, 67, 2, 51, 1, 49, 2, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 1, 0, 0,167, 1, 0, 0,233, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 1, 67, 2, 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, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0,248,215, 44, 5,
- 0, 0, 0, 0,184, 0, 0, 0, 1, 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, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 1, 0, 0,216,234,216, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 40,233,216, 3, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 63, 5, 0, 0,
+167, 1, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,251, 3, 67, 2, 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, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 88,217, 44, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 7,217, 3, 0, 0, 0, 0,
+ 68, 65, 84, 65,112, 3, 0, 0, 72, 7,217, 3, 0, 0, 0, 0,173, 0, 0, 0, 1, 0, 0, 0,190, 35, 30, 61, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 40,139, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,190, 35, 30, 61, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 40,139, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,149, 53,207, 65, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112,121,107, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,190, 35, 30, 61, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 40,139, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 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, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 68, 65, 84, 65, 16, 0, 0, 0, 88,217, 44, 5, 0, 0, 0, 0,238, 0, 0, 0, 1, 0, 0, 0, 14, 0, 0, 0,
- 14, 0, 0, 0,184,217, 44, 5, 0, 0, 0, 0, 68, 65, 84, 65,224, 0, 0, 0,184,217, 44, 5, 0, 0, 0, 0,237, 0, 0, 0,
- 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 88,162, 45, 5, 0, 0, 0, 0, 19, 0, 0, 0, 1, 0, 1, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 20, 0, 0, 0, 1, 0, 1, 0, 88,162, 45, 5, 0, 0, 0, 0, 21, 0, 1, 0, 1, 0, 0, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8,189, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,120,198, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8, 30, 47, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,168,212, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8,123, 46, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8,206, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 72,184, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,216,191, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 56,183, 45, 5, 0, 0, 0, 0, 21, 0, 0, 0, 1, 0, 1, 0, 88,162, 45, 5,
- 0, 0, 0, 0, 83, 78, 0, 0, 8, 1, 0, 0,120,219, 44, 5, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,232, 42, 45, 5,
- 0, 0, 0, 0,104,139, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 83, 99,
-114,105,112,116,105,110,103, 0,103, 46, 48, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,220, 44, 5, 0, 0, 0, 0,120,226, 44, 5,
- 0, 0, 0, 0,232,226, 44, 5, 0, 0, 0, 0, 24,236, 44, 5, 0, 0, 0, 0,136,236, 44, 5, 0, 0, 0, 0,152, 35, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 6, 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, 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, 68, 65, 84, 65, 32, 0, 0, 0,200,220, 44, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 56,221, 44, 5,
- 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, 68, 65, 84, 65,
- 32, 0, 0, 0, 56,221, 44, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,168,221, 44, 5, 0, 0, 0, 0,200,220, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,168,221, 44, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 24,222, 44, 5, 0, 0, 0, 0, 56,221, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,126, 7, 5, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 24,222, 44, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0,136,222, 44, 5, 0, 0, 0, 0,168,221, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,136,222, 44, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,248,222, 44, 5,
- 0, 0, 0, 0, 24,222, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168, 3, 0, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0,248,222, 44, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,104,223, 44, 5, 0, 0, 0, 0,136,222, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7,168, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,104,223, 44, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,216,223, 44, 5, 0, 0, 0, 0,248,222, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,240, 5,168, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,216,223, 44, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0, 72,224, 44, 5, 0, 0, 0, 0,104,223, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 5, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 72,224, 44, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,184,224, 44, 5,
- 0, 0, 0, 0,216,223, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104, 1, 1, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0,184,224, 44, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 40,225, 44, 5, 0, 0, 0, 0, 72,224, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 5,104, 1, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 40,225, 44, 5,
- 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,152,225, 44, 5, 0, 0, 0, 0,184,224, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,248, 2,104, 1, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,152,225, 44, 5, 0, 0, 0, 0,212, 0, 0, 0,
- 1, 0, 0, 0, 8,226, 44, 5, 0, 0, 0, 0, 40,225, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 5,236, 2,
- 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 8,226, 44, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,120,226, 44, 5,
- 0, 0, 0, 0,152,225, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7,236, 2, 0, 0, 0, 0, 68, 65, 84, 65,
- 32, 0, 0, 0,120,226, 44, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,226, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 2,168, 3, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,232,226, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 88,227, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,221, 44, 5,
- 0, 0, 0, 0,168,221, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 88,227, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,200,227, 44, 5, 0, 0, 0, 0,232,226, 44, 5, 0, 0, 0, 0, 56,221, 44, 5,
- 0, 0, 0, 0,136,222, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,200,227, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 56,228, 44, 5, 0, 0, 0, 0, 88,227, 44, 5, 0, 0, 0, 0,168,221, 44, 5,
- 0, 0, 0, 0,248,222, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 56,228, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,168,228, 44, 5, 0, 0, 0, 0,200,227, 44, 5, 0, 0, 0, 0,136,222, 44, 5,
- 0, 0, 0, 0,248,222, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,168,228, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 24,229, 44, 5, 0, 0, 0, 0, 56,228, 44, 5, 0, 0, 0, 0,248,222, 44, 5,
- 0, 0, 0, 0,104,223, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 24,229, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,136,229, 44, 5, 0, 0, 0, 0,168,228, 44, 5, 0, 0, 0, 0, 24,222, 44, 5,
- 0, 0, 0, 0,216,223, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,136,229, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,248,229, 44, 5, 0, 0, 0, 0, 24,229, 44, 5, 0, 0, 0, 0,200,220, 44, 5,
- 0, 0, 0, 0, 72,224, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,248,229, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,104,230, 44, 5, 0, 0, 0, 0,136,229, 44, 5, 0, 0, 0, 0,136,222, 44, 5,
- 0, 0, 0, 0, 72,224, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,104,230, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,216,230, 44, 5, 0, 0, 0, 0,248,229, 44, 5, 0, 0, 0, 0,104,223, 44, 5,
- 0, 0, 0, 0,184,224, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,216,230, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 72,231, 44, 5, 0, 0, 0, 0,104,230, 44, 5, 0, 0, 0, 0,216,223, 44, 5,
- 0, 0, 0, 0,184,224, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 72,231, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,184,231, 44, 5, 0, 0, 0, 0,216,230, 44, 5, 0, 0, 0, 0, 72,224, 44, 5,
- 0, 0, 0, 0, 40,225, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,184,231, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 40,232, 44, 5, 0, 0, 0, 0, 72,231, 44, 5, 0, 0, 0, 0,184,224, 44, 5,
- 0, 0, 0, 0, 40,225, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 40,232, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,152,232, 44, 5, 0, 0, 0, 0,184,231, 44, 5, 0, 0, 0, 0,216,223, 44, 5,
- 0, 0, 0, 0,152,225, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,152,232, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 8,233, 44, 5, 0, 0, 0, 0, 40,232, 44, 5, 0, 0, 0, 0,104,223, 44, 5,
- 0, 0, 0, 0,152,225, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 8,233, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,120,233, 44, 5, 0, 0, 0, 0,152,232, 44, 5, 0, 0, 0, 0,248,222, 44, 5,
- 0, 0, 0, 0, 8,226, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,120,233, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,232,233, 44, 5, 0, 0, 0, 0, 8,233, 44, 5, 0, 0, 0, 0, 24,222, 44, 5,
- 0, 0, 0, 0, 8,226, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,232,233, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 88,234, 44, 5, 0, 0, 0, 0,120,233, 44, 5, 0, 0, 0, 0,152,225, 44, 5,
- 0, 0, 0, 0, 8,226, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 88,234, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,200,234, 44, 5, 0, 0, 0, 0,232,233, 44, 5, 0, 0, 0, 0,136,222, 44, 5,
- 0, 0, 0, 0,120,226, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,200,234, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 56,235, 44, 5, 0, 0, 0, 0, 88,234, 44, 5, 0, 0, 0, 0,104,223, 44, 5,
- 0, 0, 0, 0,120,226, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 56,235, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,168,235, 44, 5, 0, 0, 0, 0,200,234, 44, 5, 0, 0, 0, 0, 40,225, 44, 5,
- 0, 0, 0, 0,120,226, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,168,235, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 24,236, 44, 5, 0, 0, 0, 0, 56,235, 44, 5, 0, 0, 0, 0, 72,224, 44, 5,
- 0, 0, 0, 0,184,224, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 24,236, 44, 5,
- 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168,235, 44, 5, 0, 0, 0, 0,200,220, 44, 5,
- 0, 0, 0, 0,216,223, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,136,236, 44, 5,
- 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 88,240, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,222, 44, 5,
- 0, 0, 0, 0, 56,221, 44, 5, 0, 0, 0, 0,168,221, 44, 5, 0, 0, 0, 0,248,222, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,169, 3, 0, 0, 5, 4, 0, 0, 7, 7,127, 7, 93, 0, 1, 0, 0, 0, 0, 0,
- 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 42, 45, 5, 0, 0, 0, 0, 88, 42, 45, 5, 0, 0, 0, 0,120,237, 44, 5,
- 0, 0, 0, 0,232,238, 44, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,120,237, 44, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0,232,238, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,148, 68, 0, 0, 0, 0,
- 0, 0,208, 65, 0, 0, 0, 0, 0,224,239, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,126, 7, 0, 0, 0, 0, 0, 0,
- 25, 0, 0, 0, 0,192,239, 68, 0, 0,200, 65, 0,192,239, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,127, 7, 26, 0,127, 7, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,236, 3, 0, 0, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,127, 7, 26, 0, 0, 0, 1, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,232,238, 44, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,237, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,239, 68, 0, 0, 0, 0,
- 0, 0, 28, 66, 0, 0, 0, 0, 0,192,237, 68, 0, 0, 0, 0, 0, 0,134, 66,110, 7, 0, 0,127, 7, 0, 0, 0, 0, 0, 0,
- 66, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,109, 7, 0, 0, 0, 0, 0, 0,
- 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 2, 2, 0, 0,
- 1, 0, 3, 3, 2, 0, 0, 4, 10, 0,127, 7, 67, 0,110, 7, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,169, 3, 0, 0,235, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,127, 7, 67, 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, 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, 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, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0, 88,240, 44, 5, 0, 0, 0, 0,215, 0, 0, 0,
- 1, 0, 0, 0,232, 8, 45, 5, 0, 0, 0, 0,136,236, 44, 5, 0, 0, 0, 0,216,223, 44, 5, 0, 0, 0, 0,152,225, 44, 5,
- 0, 0, 0, 0, 8,226, 44, 5, 0, 0, 0, 0, 24,222, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,241, 5, 0, 0,
-126, 7, 0, 0, 0, 0, 0, 0,235, 2, 0, 0, 4, 4,142, 1,236, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,168, 7, 45, 5, 0, 0, 0, 0,168, 7, 45, 5, 0, 0, 0, 0, 72,241, 44, 5, 0, 0, 0, 0,184,242, 44, 5,
- 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,
- 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 72,241, 44, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,184,242, 44, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0,
- 0, 0,199, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,141, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,198, 67,
- 0, 0,200, 65, 0,128,198, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0,
- 10, 0,142, 1, 26, 0,142, 1, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,241, 5, 0, 0,
-126, 7, 0, 0,210, 2, 0, 0,235, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 1, 26, 0,
- 0, 0, 1, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,184,242, 44, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 72,241, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,198, 67, 0, 0, 61,196, 0, 0, 0, 0, 0, 0, 0, 0,
-254,127,190, 67,254,127, 52,196, 0, 0, 0, 0,125, 1, 0, 0,142, 1, 0, 0, 0, 0, 0, 0,209, 2, 0, 0, 0, 0, 0, 0,
-126, 1, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,209, 2, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 1, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4,
- 6, 0,142, 1,210, 2,125, 1,210, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,241, 5, 0, 0,
-126, 7, 0, 0, 0, 0, 0, 0,209, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 1,210, 2,
- 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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,244, 44, 5, 0, 0, 0, 0, 8, 6, 45, 5,
- 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,
- 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 40,244, 44, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,200,245, 44, 5,
- 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, 66, 85, 84, 84,
- 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 85, 84, 84,
- 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,110,116,
-101,120,116, 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, 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,220,255,
-124, 1, 36, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,200,245, 44, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,104,247, 44, 5, 0, 0, 0, 0, 40,244, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,110,100,101,114, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,110,100,101,114, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 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, 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,135,255,124, 1, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 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, 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, 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, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,104,247, 44, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 8,249, 44, 5,
- 0, 0, 0, 0,200,245, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,121,101,
-114,115, 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, 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,111,255,
-124, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 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, 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, 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, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 8,249, 44, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,168,250, 44, 5, 0, 0, 0, 0,104,247, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,105,111,110,115,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,207, 3,116, 64, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,207, 3,116, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+207, 3,116, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,149, 53,207, 65,214,211,111, 65, 0, 0, 0, 0, 0, 0, 0, 0,221, 57, 80, 61, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 65, 0, 0, 5, 0,251,251, 0, 0, 92, 62, 55, 63, 56,186,224,190,237,203,148,190,
+ 3,236,234,190, 1, 0, 0, 0, 0, 0,128, 63, 0, 0,180, 66, 0, 0,180, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 96, 1, 0, 0,120,209,216, 3, 0, 0, 0, 0,174, 0, 0, 0, 1, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,105,111,110,115,
+ 1, 0, 0, 0, 51, 51, 51, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65,205,204, 76, 62, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0,
+200,213,217, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 68,105,109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140,254,124, 1,203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 3, 0,
+ 8, 8,128, 0, 0, 0, 12, 66, 0, 0,128, 63,205,204,204, 61, 0, 0,122, 68, 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, 16, 0, 10, 0, 7, 1, 0, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,168,250, 44, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 72,252, 44, 5,
- 0, 0, 0, 0, 8,249, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,110,116,105,
- 45, 65,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58,254,
-124, 1, 58, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,160, 0, 0, 0,248, 22,215, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+216, 21,215, 3, 0, 0, 0, 0,232, 40,201, 3, 0, 0, 0, 0,168, 39,201, 3, 0, 0, 0, 0, 72, 45,201, 3, 0, 0, 0, 0,
+168, 44,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 1, 0, 0,141, 1, 0, 0,233, 3, 0, 0,
+ 3, 3, 68, 1, 93, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104, 2,209, 3, 0, 0, 0, 0,
+104, 2,209, 3, 0, 0, 0, 0,136,236,216, 3, 0, 0, 0, 0, 56,238,216, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
+136,236,216, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 56,238,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0,128,244, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,162, 67, 0, 0, 0, 0, 0, 0,208, 65,
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,
+ 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,161, 67, 0, 0,200, 65, 0,128,161, 67, 0, 0,200, 65,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 68, 1, 26, 0, 68, 1, 26, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 1, 0, 0,141, 1, 0, 0,166, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 1, 26, 0, 0, 0, 1, 0, 2, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0, 72,252, 44, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,232,253, 44, 5, 0, 0, 0, 0,168,250, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,116,105,111,110, 95, 98,108,117,
-114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,116,105,111,110, 95, 98,108,117,
-114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 97,109,112,108,101,100, 32, 77,111,116,105,111,110, 32, 66,108,117,114, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,254,124, 1, 0, 0, 20, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
- 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
+ 56,238,216, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,236,216, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0,128,141, 67, 0, 0,244,194, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,153, 67, 0, 64, 12,196, 0, 0, 0, 0,
+ 51, 1, 0, 0, 68, 1, 0, 0, 18, 0, 0, 0, 66, 2, 0, 0, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
+ 0, 0, 0, 0, 50, 1, 0, 0, 18, 0, 0, 0, 66, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 18, 6, 0, 0, 2, 0, 3, 3, 0, 0, 12, 4, 6, 0, 68, 1, 67, 2, 51, 1, 49, 2, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 1, 0, 0,167, 1, 0, 0,233, 3, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 1, 67, 2, 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, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0,
+104, 2,209, 3, 0, 0, 0, 0,183, 0, 0, 0, 1, 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, 0, 0, 0, 3, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,104, 11,217, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65, 16, 0, 0, 0,104, 11,217, 3, 0, 0, 0, 0,237, 0, 0, 0, 1, 0, 0, 0,
+ 14, 0, 0, 0, 14, 0, 0, 0, 88, 32,199, 3, 0, 0, 0, 0, 68, 65, 84, 65,224, 0, 0, 0, 88, 32,199, 3, 0, 0, 0, 0,
+236, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,168,194,217, 3, 0, 0, 0, 0, 19, 0, 0, 0, 1, 0, 1, 0,
+168,194,217, 3, 0, 0, 0, 0, 20, 0, 0, 0, 1, 0, 1, 0,168,194,217, 3, 0, 0, 0, 0, 21, 0, 1, 0, 1, 0, 0, 0,
+168,194,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 24, 51,163, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
+184,219,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,136, 48,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
+152, 7,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,216, 29,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
+168,225,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,120,209,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
+200,213,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 24, 98,200, 3, 0, 0, 0, 0, 21, 0, 0, 0, 1, 0, 1, 0,
+168,194,217, 3, 0, 0, 0, 0, 83, 78, 0, 0, 8, 1, 0, 0, 56, 43,217, 3, 0, 0, 0, 0,210, 0, 0, 0, 1, 0, 0, 0,
+232,117,217, 3, 0, 0, 0, 0,152, 66,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 83, 82, 83, 99,114,105,112,116,105,110,103, 0,103, 46, 48, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 45,201, 3, 0, 0, 0, 0,
+ 8, 54,201, 3, 0, 0, 0, 0,104, 81,216, 3, 0, 0, 0, 0,216, 95,216, 3, 0, 0, 0, 0, 24, 24,215, 3, 0, 0, 0, 0,
+184, 29,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 6, 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, 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, 68, 65, 84, 65, 32, 0, 0, 0,232, 45,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+136, 46,201, 3, 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,
+ 68, 65, 84, 65, 32, 0, 0, 0,136, 46,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 40, 47,201, 3, 0, 0, 0, 0,
+232, 45,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+ 40, 47,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,200, 47,201, 3, 0, 0, 0, 0,136, 46,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 5, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,200, 47,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0,104, 48,201, 3, 0, 0, 0, 0, 40, 47,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+126, 7, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,104, 48,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+ 8, 49,201, 3, 0, 0, 0, 0,200, 47,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168, 3, 0, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0, 8, 49,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,168, 49,201, 3, 0, 0, 0, 0,
+104, 48,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7,168, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+168, 49,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 72, 50,201, 3, 0, 0, 0, 0, 8, 49,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,240, 5,168, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 72, 50,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0,232, 50,201, 3, 0, 0, 0, 0,168, 49,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+240, 5, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,232, 50,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+136, 51,201, 3, 0, 0, 0, 0, 72, 50,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104, 1, 1, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0,136, 51,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 40, 52,201, 3, 0, 0, 0, 0,
+232, 50,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 5,104, 1, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
+ 40, 52,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,200, 52,201, 3, 0, 0, 0, 0,136, 51,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,248, 2,104, 1, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,200, 52,201, 3, 0, 0, 0, 0,
+211, 0, 0, 0, 1, 0, 0, 0,104, 53,201, 3, 0, 0, 0, 0, 40, 52,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+240, 5,236, 2, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,104, 53,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,
+ 8, 54,201, 3, 0, 0, 0, 0,200, 52,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7,236, 2, 0, 0, 0, 0,
+ 68, 65, 84, 65, 32, 0, 0, 0, 8, 54,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+104, 53,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 2,168, 3, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+104, 81,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 24, 82,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+136, 46,201, 3, 0, 0, 0, 0, 40, 47,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 24, 82,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,200, 82,216, 3, 0, 0, 0, 0,104, 81,216, 3, 0, 0, 0, 0,
+136, 46,201, 3, 0, 0, 0, 0,104, 48,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+200, 82,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,120, 83,216, 3, 0, 0, 0, 0, 24, 82,216, 3, 0, 0, 0, 0,
+ 40, 47,201, 3, 0, 0, 0, 0, 8, 49,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+120, 83,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 40, 84,216, 3, 0, 0, 0, 0,200, 82,216, 3, 0, 0, 0, 0,
+104, 48,201, 3, 0, 0, 0, 0, 8, 49,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 40, 84,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,216, 84,216, 3, 0, 0, 0, 0,120, 83,216, 3, 0, 0, 0, 0,
+ 8, 49,201, 3, 0, 0, 0, 0,168, 49,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+216, 84,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,136, 85,216, 3, 0, 0, 0, 0, 40, 84,216, 3, 0, 0, 0, 0,
+200, 47,201, 3, 0, 0, 0, 0, 72, 50,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+136, 85,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 56, 86,216, 3, 0, 0, 0, 0,216, 84,216, 3, 0, 0, 0, 0,
+232, 45,201, 3, 0, 0, 0, 0,232, 50,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 56, 86,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,232, 86,216, 3, 0, 0, 0, 0,136, 85,216, 3, 0, 0, 0, 0,
+104, 48,201, 3, 0, 0, 0, 0,232, 50,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+232, 86,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,152, 87,216, 3, 0, 0, 0, 0, 56, 86,216, 3, 0, 0, 0, 0,
+168, 49,201, 3, 0, 0, 0, 0,136, 51,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+152, 87,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 72, 88,216, 3, 0, 0, 0, 0,232, 86,216, 3, 0, 0, 0, 0,
+ 72, 50,201, 3, 0, 0, 0, 0,136, 51,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 72, 88,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,248, 88,216, 3, 0, 0, 0, 0,152, 87,216, 3, 0, 0, 0, 0,
+232, 50,201, 3, 0, 0, 0, 0, 40, 52,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+248, 88,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,168, 89,216, 3, 0, 0, 0, 0, 72, 88,216, 3, 0, 0, 0, 0,
+136, 51,201, 3, 0, 0, 0, 0, 40, 52,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+168, 89,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 88, 90,216, 3, 0, 0, 0, 0,248, 88,216, 3, 0, 0, 0, 0,
+ 72, 50,201, 3, 0, 0, 0, 0,200, 52,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 88, 90,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 8, 91,216, 3, 0, 0, 0, 0,168, 89,216, 3, 0, 0, 0, 0,
+168, 49,201, 3, 0, 0, 0, 0,200, 52,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 8, 91,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,184, 91,216, 3, 0, 0, 0, 0, 88, 90,216, 3, 0, 0, 0, 0,
+ 8, 49,201, 3, 0, 0, 0, 0,104, 53,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+184, 91,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,104, 92,216, 3, 0, 0, 0, 0, 8, 91,216, 3, 0, 0, 0, 0,
+200, 47,201, 3, 0, 0, 0, 0,104, 53,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+104, 92,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 24, 93,216, 3, 0, 0, 0, 0,184, 91,216, 3, 0, 0, 0, 0,
+200, 52,201, 3, 0, 0, 0, 0,104, 53,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 24, 93,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,200, 93,216, 3, 0, 0, 0, 0,104, 92,216, 3, 0, 0, 0, 0,
+104, 48,201, 3, 0, 0, 0, 0, 8, 54,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+200, 93,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,120, 94,216, 3, 0, 0, 0, 0, 24, 93,216, 3, 0, 0, 0, 0,
+168, 49,201, 3, 0, 0, 0, 0, 8, 54,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+120, 94,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 40, 95,216, 3, 0, 0, 0, 0,200, 93,216, 3, 0, 0, 0, 0,
+ 40, 52,201, 3, 0, 0, 0, 0, 8, 54,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+ 40, 95,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,216, 95,216, 3, 0, 0, 0, 0,120, 94,216, 3, 0, 0, 0, 0,
+232, 50,201, 3, 0, 0, 0, 0,136, 51,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,
+216, 95,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 95,216, 3, 0, 0, 0, 0,
+232, 45,201, 3, 0, 0, 0, 0, 72, 50,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
+ 24, 24,215, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 56, 25,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+104, 48,201, 3, 0, 0, 0, 0,136, 46,201, 3, 0, 0, 0, 0, 40, 47,201, 3, 0, 0, 0, 0, 8, 49,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,169, 3, 0, 0, 5, 4, 0, 0, 7, 7,127, 7, 93, 0, 1, 0,
+ 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,200,207, 3, 0, 0, 0, 0,152,200,207, 3, 0, 0, 0, 0,
+232,239,216, 3, 0, 0, 0, 0,152,241,216, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,232,239,216, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0,152,241,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,148, 68,
+ 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,224,239, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,126, 7, 0, 0,
+ 0, 0, 0, 0, 25, 0, 0, 0, 0,192,239, 68, 0, 0,200, 65, 0,192,239, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,127, 7, 26, 0,127, 7, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,236, 3, 0, 0, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,127, 7, 26, 0, 0, 0, 1, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,152,241,216, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,239,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,239, 68,
+ 0, 0, 0, 0, 0, 0, 28, 66, 0, 0, 0, 0, 0,192,237, 68, 0, 0, 0, 0, 0, 0,134, 66,110, 7, 0, 0,127, 7, 0, 0,
+ 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,109, 7, 0, 0,
+ 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 2, 2, 0, 0, 1, 0, 3, 3, 2, 0, 0, 4, 10, 0,127, 7, 67, 0,110, 7, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,169, 3, 0, 0,235, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,127, 7, 67, 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, 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, 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, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0, 56, 25,215, 3, 0, 0, 0, 0,
+214, 0, 0, 0, 1, 0, 0, 0, 88, 26,215, 3, 0, 0, 0, 0, 24, 24,215, 3, 0, 0, 0, 0, 72, 50,201, 3, 0, 0, 0, 0,
+200, 52,201, 3, 0, 0, 0, 0,104, 53,201, 3, 0, 0, 0, 0,200, 47,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+241, 5, 0, 0,126, 7, 0, 0, 0, 0, 0, 0,235, 2, 0, 0, 4, 4,142, 1,236, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,184,129,199, 3, 0, 0, 0, 0,184,129,199, 3, 0, 0, 0, 0, 72,243,216, 3, 0, 0, 0, 0,
+248,244,216, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 72,243,216, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+248,244,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148, 67, 0, 0, 0, 0, 0, 0,208, 65,
+ 0, 0, 0, 0, 0, 0,199, 67, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,141, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0,
+ 0,128,198, 67, 0, 0,200, 65, 0,128,198, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3,
+ 4, 0, 12, 0, 10, 0,142, 1, 26, 0,142, 1, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+241, 5, 0, 0,126, 7, 0, 0,210, 2, 0, 0,235, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+142, 1, 26, 0, 0, 0, 1, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,248,244,216, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 72,243,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,198, 67, 0, 0, 61,196, 0, 0, 0, 0,
+ 0, 0, 0, 0,254,127,190, 67,254,127, 52,196, 0, 0, 0, 0,125, 1, 0, 0,142, 1, 0, 0, 0, 0, 0, 0,209, 2, 0, 0,
+ 0, 0, 0, 0,126, 1, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,209, 2, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 1, 0, 0, 1, 0, 7, 0,
+ 18, 0, 0, 4, 6, 0,142, 1,210, 2,125, 1,210, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+241, 5, 0, 0,126, 7, 0, 0, 0, 0, 0, 0,209, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+142, 1,210, 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,211,216, 3, 0, 0, 0, 0,
+152, 50,217, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 88,211,216, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,
+ 56,213,216, 3, 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,
+ 66, 85, 84, 84, 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 66, 85, 84, 84, 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101,120,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 67,111,110,116,101,120,116, 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, 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,220,255,124, 1, 36, 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, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0,232,253, 44, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,136,255, 44, 5,
- 0, 0, 0, 0, 72,252, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,115,104, 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,115,104, 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,104, 97,100,
-105,110,103, 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, 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, 10,254,
-124, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 6, 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, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,
+ 56,213,216, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 24,215,216, 3, 0, 0, 0, 0, 88,211,216, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,110,100,101,114,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,114,101,110,100,101,114,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,136,255, 44, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 40, 1, 45, 5, 0, 0, 0, 0,232,253, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,109, 97,110, 99,
-101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,109, 97,110, 99,
-101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,101,114,102,111,114,109, 97,110, 99,101, 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, 82,101,110,100,101,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,242,253,124, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
- 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,135,255,124, 1, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 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, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0, 40, 1, 45, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,200, 2, 45, 5,
- 0, 0, 0, 0,136,255, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 80,111,115,116,
- 32, 80,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,218,253,
-124, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 24,215,216, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,
+248,216,216, 3, 0, 0, 0, 0, 56,213,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,200, 2, 45, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,104, 4, 45, 5, 0, 0, 0, 0, 40, 1, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 0, 0, 0, 0, 0,
+ 76, 97,121,101,114,115, 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, 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, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 0, 0, 0, 0, 0,
+ 0, 0,111,255,124, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,109,112, 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, 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,194,253,124, 1, 0, 0, 20, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
- 9, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,
+248,216,216, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,216,218,216, 3, 0, 0, 0, 0, 24,215,216, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,
+105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,
+105,111,110,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,105,109,101,110,115,105,111,110,115, 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, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140,254,124, 1,203, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 3, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0,104, 4, 45, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 8, 6, 45, 5,
- 0, 0, 0, 0,200, 2, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68,
- 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,117,116,112,
-117,116, 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, 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, 40,253,
-124, 1,130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,216,218,216, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,
+184,220,216, 3, 0, 0, 0, 0,248,216,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 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, 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, 68, 65, 84, 65, 88, 1, 0, 0, 8, 6, 45, 5,
- 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104, 4, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,107,101, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,107,101, 0, 0, 0, 0, 0, 0,
+ 65,110,116,105, 45, 65,108,105, 97,115,105,110,103, 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, 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, 66, 97,107,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 58,254,124, 1, 58, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 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, 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, 16,253,124, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
- 11, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,
+184,220,216, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,152,222,216, 3, 0, 0, 0, 0,216,218,216, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,116,105,111,110,
+ 95, 98,108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,109,111,116,105,111,110,
+ 95, 98,108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 97,109,112,108,101,100, 32, 77,111,116,105,111,110, 32, 66,
+108,117,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,254,124, 1, 0, 0, 20, 0, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 5, 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, 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, 68, 65, 84, 65,248, 0, 0, 0,168, 7, 45, 5, 0, 0, 0, 0,180, 0, 0, 0, 1, 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, 0, 0, 0, 4, 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, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,152,222,216, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,
+120,224,216, 3, 0, 0, 0, 0,184,220,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,104, 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,104, 97,100,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 83,104, 97,100,105,110,103, 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, 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, 10,254,124, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 6, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 21, 0, 0,
-160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,232, 8, 45, 5,
- 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,120, 22, 45, 5, 0, 0, 0, 0, 88,240, 44, 5, 0, 0, 0, 0, 40,225, 44, 5,
- 0, 0, 0, 0,120,226, 44, 5, 0, 0, 0, 0,104,223, 44, 5, 0, 0, 0, 0,184,224, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,249, 2, 0, 0,239, 5, 0, 0,105, 1, 0, 0,167, 3, 0, 0, 1, 1,247, 2, 63, 2, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 20, 45, 5, 0, 0, 0, 0,200, 20, 45, 5, 0, 0, 0, 0,216, 9, 45, 5,
- 0, 0, 0, 0,152, 15, 45, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,216, 9, 45, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 72, 11, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,113, 68, 0, 0, 0, 0,
- 0, 0,208, 65, 0, 0, 0, 0, 0,192, 61, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,246, 2, 0, 0, 0, 0, 0, 0,
- 25, 0, 0, 0, 0,128, 61, 68, 0, 0,200, 65, 0,128, 61, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,247, 2, 26, 0,247, 2, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,249, 2, 0, 0,239, 5, 0, 0,105, 1, 0, 0,130, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,247, 2, 26, 0, 0, 0, 1, 0, 2, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,
+120,224,216, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,248, 44,217, 3, 0, 0, 0, 0,152,222,216, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,
+109, 97,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,
+109, 97,110, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,101,114,102,111,114,109, 97,110, 99,101, 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, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 72, 11, 45, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0,184, 12, 45, 5, 0, 0, 0, 0,216, 9, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67, 0, 64, 70,196,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67,255,127, 70,196, 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0, 18, 0, 0, 0,
- 43, 3, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 18, 0, 0, 0,
- 43, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0,
- 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,160, 0, 44, 3,143, 0, 26, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,249, 2, 0, 0,249, 2, 0, 0,131, 1, 0, 0,167, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 37, 2, 0, 0, 5, 0, 3, 0, 1, 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, 0, 0, 0,242,253,124, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 7, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,184, 12, 45, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 40, 14, 45, 5, 0, 0, 0, 0, 72, 11, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 67, 0, 0,206,194,
- 0, 0, 0, 0, 0, 0, 0, 0,231,102, 16, 67, 0, 0,206,194, 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0, 18, 0, 0, 0,
-119, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 18, 0, 0, 0,
-119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0,
- 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,160, 0,120, 0,143, 0,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,249, 2, 0, 0,239, 5, 0, 0,131, 1, 0, 0,131, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 6, 0, 34, 0, 2, 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, 68, 65, 84, 65, 88, 1, 0, 0,248, 44,217, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,
+216, 46,217, 3, 0, 0, 0, 0,120,224,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 40, 14, 45, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0,152, 15, 45, 5, 0, 0, 0, 0,184, 12, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67, 0,128,142,196,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67, 0, 0, 26,196, 0, 0, 0, 0,163, 0, 0, 0,180, 0, 0, 0, 18, 0, 0, 0,
-121, 2, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 18, 0, 0, 0,
-121, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0,
- 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,180, 0,122, 2,163, 0,104, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,239, 5, 0, 0,239, 5, 0, 0,131, 1, 0, 0,167, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 80,111,115,116, 32, 80,114,111, 99,101,115,115,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,218,253,124, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 8, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,152, 15, 45, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 14, 45, 5, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,
+216, 46,217, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,184, 48,217, 3, 0, 0, 0, 0,248, 44,217, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,115,116, 97,109,112, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,109,112, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,249, 2, 0, 0,239, 5, 0, 0,131, 1, 0, 0,167, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,247, 2, 37, 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,194,253,124, 1, 0, 0, 20, 0, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 9, 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, 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, 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, 8, 17, 45, 5, 0, 0, 0, 0, 68, 65, 84, 65,120, 3, 0, 0, 8, 17, 45, 5, 0, 0, 0, 0,174, 0, 0, 0,
- 1, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74,141,193, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,225,215,163,188,
- 0, 0, 0, 0, 68,239,209, 62, 51,177,205,190,184,158, 81, 63, 0, 0, 0, 0, 70,119,105, 63,143, 74, 70, 62, 35, 44,185,190,
- 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63, 42, 61,228, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,214,211,111,193,
- 0, 0,128, 63, 69,239,209, 62, 70,119,105, 63,176, 84, 89,188, 0, 0, 0, 0, 53,177,205,190,142, 74, 70, 62,166, 33,101, 63,
- 0, 0, 0, 0,185,158, 81, 63, 35, 44,185,190, 43, 61,228, 62, 0, 0, 0, 0,164, 96, 68, 65,111,121,173,192,248,209,213, 64,
- 0, 0,128, 63,178,157,229, 62, 30,132, 27,191,222,160, 81,191,184,158, 81,191,117, 90,127, 63,166,235,149, 62, 9, 46,185, 62,
- 35, 44,185, 62,145,180,109,188,212, 60,173, 63,129, 63,228,190, 42, 61,228,190, 0, 0, 0, 0, 0, 0, 0, 0, 96,132,111, 65,
-214,211,111, 65,217,236,191, 62, 54,117, 85, 63,224,246, 70,188, 0,160, 32,182,252, 5,136,190, 43, 33, 3, 62,235,135, 23, 63,
- 0, 0, 96, 53,215,104, 25,196,133,132,135, 67, 37, 9,167,195,136,252, 71,194, 3, 54, 25, 68,158, 87,135,195,205,209,166, 67,
-151,254, 71, 66, 68,239,209, 62, 51,177,205,190,184,158, 81, 63, 0, 0, 0, 0, 70,119,105, 63,143, 74, 70, 62, 35, 44,185,190,
- 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63, 42, 61,228, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,214,211,111,193,
- 0, 0,128, 63,178,157,229, 62, 30,132, 27,191,222,160, 81,191,184,158, 81,191,117, 90,127, 63,166,235,149, 62, 9, 46,185, 62,
- 35, 44,185, 62,145,180,109,188,212, 60,173, 63,129, 63,228,190, 42, 61,228,190, 0, 0, 0, 0, 0, 0, 0, 0, 96,132,111, 65,
-214,211,111, 65, 46, 86, 45, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 86, 45, 64, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 86, 45, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 92, 62, 55, 63, 56,186,224,190,237,203,148,190, 3,236,234,190,214,211,111, 65,214,211,111, 65, 0, 0, 0, 0,
- 0, 0, 0, 0,107,227, 29, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 1, 0, 0, 0, 0, 0, 0, 0,
- 1, 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, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,184, 48,217, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,
+152, 50,217, 3, 0, 0, 0, 0,216, 46,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 79,117,116,112,117,116, 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, 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, 40,253,124, 1,130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 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, 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, 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, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,
+152, 50,217, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184, 48,217, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,107,101, 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, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 98, 97,107,101, 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, 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,128, 63, 30, 33, 12, 66,
- 86,152,137, 66,116, 27,126, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 96, 1, 0, 0,200, 20, 45, 5, 0, 0, 0, 0,175, 0, 0, 0, 1, 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, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65,
-205,204, 76, 62, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0,216,191, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 97,107,101, 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, 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, 16,253,124, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 11, 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, 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, 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, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 3, 0, 8, 8,128, 0, 0, 0, 12, 66, 0, 0,128, 63,
- 10,215, 35, 60, 0, 0,250, 67, 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, 16, 0, 10, 0, 7, 1, 0, 3, 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, 68, 65, 84, 65,248, 0, 0, 0,184,129,199, 3, 0, 0, 0, 0,179, 0, 0, 0, 1, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,120, 22, 45, 5,
- 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,216, 28, 45, 5, 0, 0, 0, 0,232, 8, 45, 5, 0, 0, 0, 0,200,220, 44, 5,
- 0, 0, 0, 0, 72,224, 44, 5, 0, 0, 0, 0,184,224, 44, 5, 0, 0, 0, 0,216,223, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,239, 5, 0, 0, 0, 0, 0, 0,103, 1, 0, 0, 18, 18,240, 5,104, 1, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 27, 45, 5, 0, 0, 0, 0, 8, 27, 45, 5, 0, 0, 0, 0,104, 23, 45, 5,
- 0, 0, 0, 0,216, 24, 45, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,104, 23, 45, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0,216, 24, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,160, 67, 0, 0, 0, 0,
- 0, 0,208, 65, 0, 0, 0, 0, 0, 0,190, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,239, 5, 0, 0, 0, 0, 0, 0,
- 25, 0, 0, 0, 0,224,189, 68, 0, 0,200, 65, 0,224,189, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,240, 5, 26, 0,240, 5, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,239, 5, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,240, 5, 26, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 4, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,216, 24, 45, 5, 0, 0, 0, 0,216, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104, 23, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,189, 68, 0, 0, 0, 0,
- 0, 0, 51, 67, 0, 0, 0, 0, 0,224,187, 68, 0, 0, 0, 0, 0, 0,167, 67,223, 5, 0, 0,240, 5, 0, 0, 0, 0, 0, 0,
- 77, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,222, 5, 0, 0, 0, 0, 0, 0,
- 77, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 2, 2, 0, 0,
- 1, 0, 3, 3, 2, 0, 0, 4, 10, 0,240, 5, 78, 1,223, 5, 78, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,239, 5, 0, 0, 26, 0, 0, 0,103, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,240, 5, 78, 1, 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, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 72, 26, 45, 5, 0, 0, 0, 0,194, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,184, 26, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 4, 0, 0, 0,184, 26, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,136, 1, 0, 0, 8, 27, 45, 5, 0, 0, 0, 0,195, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+255, 21, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
+ 88, 26,215, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,120, 27,215, 3, 0, 0, 0, 0, 56, 25,215, 3, 0, 0, 0, 0,
+ 40, 52,201, 3, 0, 0, 0, 0, 8, 54,201, 3, 0, 0, 0, 0,168, 49,201, 3, 0, 0, 0, 0,136, 51,201, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,249, 2, 0, 0,239, 5, 0, 0,105, 1, 0, 0,167, 3, 0, 0, 1, 1,247, 2, 63, 2, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120, 52,217, 3, 0, 0, 0, 0,120, 52,217, 3, 0, 0, 0, 0,
+168,246,216, 3, 0, 0, 0, 0,104,253,216, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,168,246,216, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 88,248,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,113, 68,
+ 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,192, 61, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,246, 2, 0, 0,
+ 0, 0, 0, 0, 25, 0, 0, 0, 0,128, 61, 68, 0, 0,200, 65, 0,128, 61, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,247, 2, 26, 0,247, 2, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,249, 2, 0, 0,239, 5, 0, 0,105, 1, 0, 0,130, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,247, 2, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 88,248,216, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 8,250,216, 3, 0, 0, 0, 0,168,246,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67,
+ 0, 64, 70,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67,255,127, 70,196, 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0,
+ 18, 0, 0, 0, 43, 3, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0,
+ 18, 0, 0, 0, 43, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64,
+ 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,160, 0, 44, 3,143, 0, 26, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,249, 2, 0, 0,249, 2, 0, 0,131, 1, 0, 0,167, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 37, 2, 0, 0, 5, 0, 3, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 8,250,216, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0,184,251,216, 3, 0, 0, 0, 0, 88,248,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 67,
+ 0, 0,206,194, 0, 0, 0, 0, 0, 0, 0, 0,231,102, 16, 67, 0, 0,206,194, 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0,
+ 18, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0,
+ 18, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64,
+ 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,160, 0,120, 0,143, 0,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,249, 2, 0, 0,239, 5, 0, 0,131, 1, 0, 0,131, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 6, 0, 34, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,184,251,216, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0,104,253,216, 3, 0, 0, 0, 0, 8,250,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67,
+ 0,128,142,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67, 0, 0, 26,196, 0, 0, 0, 0,163, 0, 0, 0,180, 0, 0, 0,
+ 18, 0, 0, 0,121, 2, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,162, 0, 0, 0,
+ 18, 0, 0, 0,121, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64,
+ 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,180, 0,122, 2,163, 0,104, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,239, 5, 0, 0,239, 5, 0, 0,131, 1, 0, 0,167, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 26, 45, 5, 0, 0, 0, 0, 72, 26, 45, 5, 0, 0, 0, 0,
- 62, 62, 62, 32, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,104,253,216, 3, 0, 0, 0, 0,
+215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184,251,216, 3, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,249, 2, 0, 0,239, 5, 0, 0,131, 1, 0, 0,167, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,247, 2, 37, 2, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-112,121,116,104,111,110, 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,
- 8, 4, 0, 0, 8, 4, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,216, 28, 45, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
-152, 35, 45, 5, 0, 0, 0, 0,120, 22, 45, 5, 0, 0, 0, 0,152,225, 44, 5, 0, 0, 0, 0,104,223, 44, 5, 0, 0, 0, 0,
-248,222, 44, 5, 0, 0, 0, 0, 8,226, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,241, 5, 0, 0,126, 7, 0, 0,
-237, 2, 0, 0,167, 3, 0, 0, 3, 3,142, 1,187, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-168, 32, 45, 5, 0, 0, 0, 0,168, 32, 45, 5, 0, 0, 0, 0,200, 29, 45, 5, 0, 0, 0, 0, 56, 31, 45, 5, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,200, 76,217, 3, 0, 0, 0, 0, 68, 65, 84, 65,112, 3, 0, 0,200, 76,217, 3, 0, 0, 0, 0,
+173, 0, 0, 0, 1, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74,141,193, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,
+225,215,163,188, 0, 0, 0, 0, 68,239,209, 62, 51,177,205,190,184,158, 81, 63, 0, 0, 0, 0, 70,119,105, 63,143, 74, 70, 62,
+ 35, 44,185,190, 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63, 42, 61,228, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+214,211,111,193, 0, 0,128, 63, 69,239,209, 62, 70,119,105, 63,176, 84, 89,188, 0, 0, 0, 0, 53,177,205,190,142, 74, 70, 62,
+166, 33,101, 63, 0, 0, 0, 0,185,158, 81, 63, 35, 44,185,190, 43, 61,228, 62, 0, 0, 0, 0,164, 96, 68, 65,111,121,173,192,
+248,209,213, 64, 0, 0,128, 63,178,157,229, 62, 30,132, 27,191,222,160, 81,191,184,158, 81,191,117, 90,127, 63,166,235,149, 62,
+ 9, 46,185, 62, 35, 44,185, 62,145,180,109,188,212, 60,173, 63,129, 63,228,190, 42, 61,228,190, 0, 0, 0, 0, 0, 0, 0, 0,
+ 96,132,111, 65,214,211,111, 65,217,236,191, 62, 54,117, 85, 63,224,246, 70,188, 0,160, 32,182,252, 5,136,190, 43, 33, 3, 62,
+235,135, 23, 63, 0, 0, 96, 53,215,104, 25,196,133,132,135, 67, 37, 9,167,195,136,252, 71,194, 3, 54, 25, 68,158, 87,135,195,
+205,209,166, 67,151,254, 71, 66, 68,239,209, 62, 51,177,205,190,184,158, 81, 63, 0, 0, 0, 0, 70,119,105, 63,143, 74, 70, 62,
+ 35, 44,185,190, 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63, 42, 61,228, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+214,211,111,193, 0, 0,128, 63,178,157,229, 62, 30,132, 27,191,222,160, 81,191,184,158, 81,191,117, 90,127, 63,166,235,149, 62,
+ 9, 46,185, 62, 35, 44,185, 62,145,180,109,188,212, 60,173, 63,129, 63,228,190, 42, 61,228,190, 0, 0, 0, 0, 0, 0, 0, 0,
+ 96,132,111, 65,214,211,111, 65, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 1, 0, 0,200, 29, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 56, 31, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,244, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,199, 67,
- 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,141, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,198, 67, 0, 0,200, 65,
- 0,128,198, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,142, 1,
- 26, 0,142, 1, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,241, 5, 0, 0,126, 7, 0, 0,
-237, 2, 0, 0, 6, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 1, 26, 0, 0, 0, 1, 0,
- 2, 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, 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, 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,
- 68, 65, 84, 65, 40, 1, 0, 0, 56, 31, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-200, 29, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,141, 67, 0, 0,244,194, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,190, 67,
- 0, 0, 15,195, 0, 0, 0, 0,125, 1, 0, 0,142, 1, 0, 0, 18, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,
- 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 18, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 18, 6, 0, 0, 2, 0, 3, 3, 0, 0, 12, 4, 6, 0,142, 1,
-161, 0,125, 1,143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,241, 5, 0, 0,126, 7, 0, 0,
- 7, 3, 0, 0,167, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 1,161, 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, 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, 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, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 24, 1, 0, 0,168, 32, 45, 5, 0, 0, 0, 0,184, 0, 0, 0, 1, 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, 0, 0, 0, 3, 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, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 46, 86, 45, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 86, 45, 64,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 86, 45, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 92, 62, 55, 63, 56,186,224,190,237,203,148,190, 3,236,234,190,214,211,111, 65,214,211,111, 65,
+ 0, 0, 0, 0, 0, 0, 0, 0,107,227, 29, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0,
+255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 30, 33, 12, 66,
+ 86,152,137, 66,116, 27,126, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 96, 1, 0, 0,
+120, 52,217, 3, 0, 0, 0, 0,174, 0, 0, 0, 1, 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, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65,205,204, 76, 62,
+ 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0,200,213,217, 3, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 3, 0, 8, 8,128, 0, 0, 0, 12, 66, 0, 0,128, 63, 10,215, 35, 60,
+ 0, 0,250, 67, 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, 16, 0,
+ 10, 0, 7, 1, 0, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 34, 45, 5, 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, 68, 65, 84, 65,160, 0, 0, 0,120, 27,215, 3, 0, 0, 0, 0,
+214, 0, 0, 0, 1, 0, 0, 0,152, 28,215, 3, 0, 0, 0, 0, 88, 26,215, 3, 0, 0, 0, 0,232, 45,201, 3, 0, 0, 0, 0,
+232, 50,201, 3, 0, 0, 0, 0,136, 51,201, 3, 0, 0, 0, 0, 72, 50,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,239, 5, 0, 0, 0, 0, 0, 0,103, 1, 0, 0, 18, 18,240, 5,104, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,184, 80,217, 3, 0, 0, 0, 0,184, 80,217, 3, 0, 0, 0, 0, 24,255,216, 3, 0, 0, 0, 0,
+200, 0,217, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 24,255,216, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+200, 0,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,160, 67, 0, 0, 0, 0, 0, 0,208, 65,
+ 0, 0, 0, 0, 0, 0,190, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,239, 5, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0,
+ 0,224,189, 68, 0, 0,200, 65, 0,224,189, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3,
+ 4, 0, 12, 0, 10, 0,240, 5, 26, 0,240, 5, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,239, 5, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+240, 5, 26, 0, 0, 0, 1, 0, 2, 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, 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, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65, 16, 0, 0, 0, 8, 34, 45, 5, 0, 0, 0, 0,
-238, 0, 0, 0, 1, 0, 0, 0, 14, 0, 0, 0, 14, 0, 0, 0,104, 34, 45, 5, 0, 0, 0, 0, 68, 65, 84, 65,224, 0, 0, 0,
-104, 34, 45, 5, 0, 0, 0, 0,237, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 88,162, 45, 5, 0, 0, 0, 0,
- 19, 0, 0, 0, 1, 0, 1, 0, 88,162, 45, 5, 0, 0, 0, 0, 20, 0, 0, 0, 1, 0, 1, 0, 88,162, 45, 5, 0, 0, 0, 0,
- 21, 0, 1, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8,189, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 0,120,198, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8, 30, 47, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 0,168,212, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8,123, 46, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 0, 8,206, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 72,184, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 0,216,191, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 56,183, 45, 5, 0, 0, 0, 0,
- 21, 0, 0, 0, 1, 0, 1, 0, 88,162, 45, 5, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,152, 35, 45, 5, 0, 0, 0, 0,
-215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 28, 45, 5, 0, 0, 0, 0, 72,224, 44, 5, 0, 0, 0, 0,
-136,222, 44, 5, 0, 0, 0, 0,120,226, 44, 5, 0, 0, 0, 0, 40,225, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,247, 2, 0, 0,105, 1, 0, 0,167, 3, 0, 0, 9, 9,248, 2, 63, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,104, 39, 45, 5, 0, 0, 0, 0,104, 39, 45, 5, 0, 0, 0, 0,136, 36, 45, 5, 0, 0, 0, 0,
-248, 37, 45, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,136, 36, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,
-248, 37, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,230, 67, 0, 0, 0, 0, 0, 0,208, 65,
- 0, 0, 0, 0, 0, 0, 62, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,247, 2, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0,
- 0,192, 61, 68, 0, 0,200, 65, 0,192, 61, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3,
- 4, 0, 12, 0, 10, 0,248, 2, 26, 0,248, 2, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,247, 2, 0, 0,105, 1, 0, 0,130, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-248, 2, 26, 0, 0, 0, 1, 0, 2, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,200, 0,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 24,255,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,189, 68, 0, 0, 0, 0, 0, 0, 51, 67,
+ 0, 0, 0, 0, 0,224,187, 68, 0, 0, 0, 0, 0, 0,167, 67,223, 5, 0, 0,240, 5, 0, 0, 0, 0, 0, 0, 77, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,222, 5, 0, 0, 0, 0, 0, 0, 77, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 2, 2, 0, 0, 1, 0, 3, 3,
+ 2, 0, 0, 4, 10, 0,240, 5, 78, 1,223, 5, 78, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,239, 5, 0, 0, 26, 0, 0, 0,103, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+240, 5, 78, 1, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,248, 37, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,136, 36, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,189, 68, 0, 0, 0, 0, 0,192, 22, 68,
-248,150, 23, 68, 8, 41,100, 68, 46,224, 62, 67,233, 15,206, 67, 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, 0, 0, 0, 0,247, 2, 0, 0, 0, 0, 0, 0, 36, 2, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,122, 68, 0, 0, 0, 0, 1, 0, 3, 0,
- 0, 0, 0, 4, 10, 0,248, 2, 37, 2,248, 2, 37, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,247, 2, 0, 0,131, 1, 0, 0,167, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-248, 2, 37, 2, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,136, 96,216, 3, 0, 0, 0, 0,193, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 40,182,117, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 4, 0, 0, 0, 40,182,117, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,136, 1, 0, 0,184, 80,217, 3, 0, 0, 0, 0,194, 0, 0, 0, 1, 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, 0, 0, 0, 18, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136, 96,216, 3, 0, 0, 0, 0,136, 96,216, 3, 0, 0, 0, 0, 62, 62, 62, 32,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 2, 0, 0,104, 39, 45, 5, 0, 0, 0, 0,187, 0, 0, 0, 1, 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, 0, 0, 0,
- 9, 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, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 12, 0, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0,205,204,204, 61,231, 1, 0, 0,243, 1, 0, 0,122, 1, 0, 0,124, 1, 0, 0,231, 1, 0, 0,243, 1, 0, 0,
- 4, 0, 0, 0,124, 1, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112,121,116,104,
+111,110, 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, 8, 4, 0, 0,
+ 8, 4, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,152, 28,215, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,184, 29,215, 3,
+ 0, 0, 0, 0,120, 27,215, 3, 0, 0, 0, 0,200, 52,201, 3, 0, 0, 0, 0,168, 49,201, 3, 0, 0, 0, 0, 8, 49,201, 3,
+ 0, 0, 0, 0,104, 53,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,241, 5, 0, 0,126, 7, 0, 0,237, 2, 0, 0,
+167, 3, 0, 0, 3, 3,142, 1,187, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 4,209, 3,
+ 0, 0, 0, 0, 8, 4,209, 3, 0, 0, 0, 0,120, 2,217, 3, 0, 0, 0, 0, 40, 4,217, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 1, 0, 0,120, 2,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 40, 4,217, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,128,244, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,199, 67, 0, 0, 0, 0,
+ 0, 0,208, 65, 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, 0, 0, 0, 0,141, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,198, 67, 0, 0,200, 65, 0,128,198, 67,
+ 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,142, 1, 26, 0,142, 1,
+ 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,241, 5, 0, 0,126, 7, 0, 0,237, 2, 0, 0,
+ 6, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 1, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65,
+ 40, 1, 0, 0, 40, 4,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120, 2,217, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,128,141, 67, 0, 0,244,194, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,190, 67, 0, 0, 15,195,
+ 0, 0, 0, 0,125, 1, 0, 0,142, 1, 0, 0, 18, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,
+ 17, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 18, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 18, 6, 0, 0, 2, 0, 3, 3, 0, 0, 12, 4, 6, 0,142, 1,161, 0,125, 1,
+143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,241, 5, 0, 0,126, 7, 0, 0, 7, 3, 0, 0,
+167, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 1,161, 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, 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, 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, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 24, 1, 0, 0, 8, 4,209, 3, 0, 0, 0, 0,183, 0, 0, 0, 1, 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, 0, 0, 0, 3, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 11,217, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65, 16, 0, 0, 0,248, 11,217, 3, 0, 0, 0, 0,237, 0, 0, 0,
+ 1, 0, 0, 0, 14, 0, 0, 0, 14, 0, 0, 0,184, 33,199, 3, 0, 0, 0, 0, 68, 65, 84, 65,224, 0, 0, 0,184, 33,199, 3,
+ 0, 0, 0, 0,236, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,168,194,217, 3, 0, 0, 0, 0, 19, 0, 0, 0,
+ 1, 0, 1, 0,168,194,217, 3, 0, 0, 0, 0, 20, 0, 0, 0, 1, 0, 1, 0,168,194,217, 3, 0, 0, 0, 0, 21, 0, 1, 0,
+ 1, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 24, 51,163, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 1, 0,184,219,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,136, 48,218, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 1, 0,152, 7,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,216, 29,218, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 1, 0,168,225,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,120,209,217, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 1, 0,200,213,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 24, 98,200, 3, 0, 0, 0, 0, 21, 0, 0, 0,
+ 1, 0, 1, 0,168,194,217, 3, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,184, 29,215, 3, 0, 0, 0, 0,214, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152, 28,215, 3, 0, 0, 0, 0,232, 50,201, 3, 0, 0, 0, 0,104, 48,201, 3,
+ 0, 0, 0, 0, 8, 54,201, 3, 0, 0, 0, 0, 40, 52,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+247, 2, 0, 0,105, 1, 0, 0,167, 3, 0, 0, 9, 9,248, 2, 63, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,200,114,217, 3, 0, 0, 0, 0,200,114,217, 3, 0, 0, 0, 0,248, 82,217, 3, 0, 0, 0, 0,168, 84,217, 3,
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,
- 83, 78, 0, 0, 8, 1, 0, 0,232, 42, 45, 5, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 8,114, 45, 5, 0, 0, 0, 0,
-120,219, 44, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 85, 86, 32, 69,100,105,
-116,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 44, 45, 5, 0, 0, 0, 0, 72, 47, 45, 5, 0, 0, 0, 0,
-184, 47, 45, 5, 0, 0, 0, 0, 24, 52, 45, 5, 0, 0, 0, 0,136, 52, 45, 5, 0, 0, 0, 0,168, 96, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 6, 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, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,248, 82,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,168, 84,217, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,230, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0,
+ 0, 0, 62, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,247, 2, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,192, 61, 68,
+ 0, 0,200, 65, 0,192, 61, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0,
+ 10, 0,248, 2, 26, 0,248, 2, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+247, 2, 0, 0,105, 1, 0, 0,130, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 2, 26, 0,
+ 0, 0, 1, 0, 2, 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, 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,
- 68, 65, 84, 65, 32, 0, 0, 0, 56, 44, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,168, 44, 45, 5, 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, 68, 65, 84, 65, 32, 0, 0, 0,
-168, 44, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 24, 45, 45, 5, 0, 0, 0, 0, 56, 44, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 24, 45, 45, 5, 0, 0, 0, 0,
-212, 0, 0, 0, 1, 0, 0, 0,136, 45, 45, 5, 0, 0, 0, 0,168, 44, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-126, 7, 5, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,136, 45, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,
-248, 45, 45, 5, 0, 0, 0, 0, 24, 45, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0,248, 45, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,104, 46, 45, 5, 0, 0, 0, 0,
-136, 45, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,234, 3, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
-104, 46, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,216, 46, 45, 5, 0, 0, 0, 0,248, 45, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,126, 7,234, 3, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,216, 46, 45, 5, 0, 0, 0, 0,
-212, 0, 0, 0, 1, 0, 0, 0, 72, 47, 45, 5, 0, 0, 0, 0,104, 46, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-200, 3,234, 3, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 72, 47, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,216, 46, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 3, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,184, 47, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 40, 48, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,168, 44, 45, 5, 0, 0, 0, 0, 24, 45, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 40, 48, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,152, 48, 45, 5, 0, 0, 0, 0,
-184, 47, 45, 5, 0, 0, 0, 0,168, 44, 45, 5, 0, 0, 0, 0,248, 45, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,152, 48, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 8, 49, 45, 5, 0, 0, 0, 0,
- 40, 48, 45, 5, 0, 0, 0, 0, 24, 45, 45, 5, 0, 0, 0, 0,104, 46, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 8, 49, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,120, 49, 45, 5, 0, 0, 0, 0,
-152, 48, 45, 5, 0, 0, 0, 0,248, 45, 45, 5, 0, 0, 0, 0,104, 46, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,120, 49, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,232, 49, 45, 5, 0, 0, 0, 0,
- 8, 49, 45, 5, 0, 0, 0, 0,248, 45, 45, 5, 0, 0, 0, 0,216, 46, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,232, 49, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 88, 50, 45, 5, 0, 0, 0, 0,
-120, 49, 45, 5, 0, 0, 0, 0, 56, 44, 45, 5, 0, 0, 0, 0, 72, 47, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 88, 50, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,200, 50, 45, 5, 0, 0, 0, 0,
-232, 49, 45, 5, 0, 0, 0, 0, 56, 44, 45, 5, 0, 0, 0, 0,248, 45, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,200, 50, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 56, 51, 45, 5, 0, 0, 0, 0,
- 88, 50, 45, 5, 0, 0, 0, 0,216, 46, 45, 5, 0, 0, 0, 0, 72, 47, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 56, 51, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,168, 51, 45, 5, 0, 0, 0, 0,
-200, 50, 45, 5, 0, 0, 0, 0,104, 46, 45, 5, 0, 0, 0, 0,216, 46, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,168, 51, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 24, 52, 45, 5, 0, 0, 0, 0,
- 56, 51, 45, 5, 0, 0, 0, 0,136, 45, 45, 5, 0, 0, 0, 0, 72, 47, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 24, 52, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-168, 51, 45, 5, 0, 0, 0, 0,136, 45, 45, 5, 0, 0, 0, 0,104, 46, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,160, 0, 0, 0,136, 52, 45, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 88, 56, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,248, 45, 45, 5, 0, 0, 0, 0,168, 44, 45, 5, 0, 0, 0, 0, 24, 45, 45, 5, 0, 0, 0, 0,
-104, 46, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,235, 3, 0, 0, 5, 4, 0, 0,
- 7, 7,127, 7, 27, 0, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,113, 45, 5, 0, 0, 0, 0,
-120,113, 45, 5, 0, 0, 0, 0,120, 53, 45, 5, 0, 0, 0, 0,232, 54, 45, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
-120, 53, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,232, 54, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 32,148, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,224,239, 68, 0, 0, 0, 0, 0, 0,208, 65,
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,
- 0, 0, 0, 0,126, 7, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,192,239, 68, 0, 0,200, 65, 0,192,239, 68, 0, 0,200, 65,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,127, 7, 26, 0,127, 7, 26, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,235, 3, 0, 0, 4, 4, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127, 7, 26, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,168, 84,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,248, 82,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,189, 68, 0, 0, 0, 0, 0,192, 22, 68,248,150, 23, 68,
+ 8, 41,100, 68, 46,224, 62, 67,233, 15,206, 67, 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, 0, 0, 0, 0,247, 2, 0, 0, 0, 0, 0, 0, 36, 2, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,122, 68, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 4,
+ 10, 0,248, 2, 37, 2,248, 2, 37, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+247, 2, 0, 0,131, 1, 0, 0,167, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 2, 37, 2,
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,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
-232, 54, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120, 53, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0,240,109, 69, 0, 0,128,192, 0, 0, 0, 0, 0, 0, 0, 0,255,255,109, 69, 0, 0, 0,192, 0, 0, 0, 0,
-112, 7, 0, 0,129, 7, 0, 0, 18, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
- 0, 0, 0, 0,111, 7, 0, 0, 18, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 2, 0, 0, 0, 1, 0, 3, 3, 2, 0, 0, 4, 10, 0,129, 7, 2, 0,112, 7, 1, 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, 5, 4, 0, 0, 5, 4, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,160, 2, 0, 0,200,114,217, 3, 0, 0, 0, 0,186, 0, 0, 0, 1, 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, 0, 0, 0, 9, 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, 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, 68, 65, 84, 65,160, 0, 0, 0,
- 88, 56, 45, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,168, 96, 45, 5, 0, 0, 0, 0,136, 52, 45, 5, 0, 0, 0, 0,
- 56, 44, 45, 5, 0, 0, 0, 0,248, 45, 45, 5, 0, 0, 0, 0,216, 46, 45, 5, 0, 0, 0, 0, 72, 47, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,199, 3, 0, 0, 0, 0, 0, 0,233, 3, 0, 0, 6, 6,200, 3,234, 3, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 63, 45, 5, 0, 0, 0, 0, 56, 63, 45, 5, 0, 0, 0, 0,
- 72, 57, 45, 5, 0, 0, 0, 0,200, 61, 45, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 72, 57, 45, 5, 0, 0, 0, 0,
-216, 0, 0, 0, 1, 0, 0, 0,184, 58, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,215, 67,
- 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,114, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,199, 3, 0, 0,
- 0, 0, 0, 0, 25, 0, 0, 0, 0,192,113, 68, 0, 0,200, 65, 0,192,113, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,200, 3, 26, 0,200, 3, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,199, 3, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,200, 3, 26, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 32, 0, 0, 0, 0, 0, 0, 0, 12, 0, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+205,204,204, 61,231, 1, 0, 0,243, 1, 0, 0,122, 1, 0, 0,124, 1, 0, 0,231, 1, 0, 0,243, 1, 0, 0, 4, 0, 0, 0,
+124, 1, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,184, 58, 45, 5, 0, 0, 0, 0,
-216, 0, 0, 0, 1, 0, 0, 0,200, 61, 45, 5, 0, 0, 0, 0, 72, 57, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 67,
- 0,192,115,196, 0, 0, 0, 0, 0, 0, 0, 0,254,255, 74, 67,254,255,115,196, 0, 0, 0, 0,203, 0, 0, 0,220, 0, 0, 0,
- 0, 0, 0, 0,207, 3, 0, 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,202, 0, 0, 0,
- 0, 0, 0, 0,207, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64,
- 10, 3, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,220, 0,208, 3,203, 0,208, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,219, 0, 0, 0, 26, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,220, 0,208, 3, 0, 0, 4, 0, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 40, 60, 45, 5, 0, 0, 0, 0, 40, 60, 45, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 40, 60, 45, 5, 0, 0, 0, 0,
-214, 0, 0, 0, 1, 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, 0, 0, 0, 73, 77, 65, 71, 69, 95, 80, 84, 95,103,112,101,110, 99,105,108, 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, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 73, 77, 65, 71, 69, 95, 80, 84, 95,103,112,101,110, 99,105,108, 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, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 71,114,101, 97,115,101, 32, 80,101,110, 99,105,108, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,255,202, 0, 80, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 1, 0, 0,200, 61, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-184, 58, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 67, 51, 51, 43,191,154,153,213, 63,
- 51, 51,131,191,154,153, 1, 64, 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, 0, 0, 0, 0,236, 2, 0, 0, 0, 0, 0, 0,208, 3, 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, 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, 0, 0,220, 0, 0, 0,199, 3, 0, 0,
- 26, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,236, 2,208, 3, 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, 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, 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, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 33, 0, 0, 56, 63, 45, 5, 0, 0, 0, 0,185, 0, 0, 0, 1, 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, 0, 0, 0, 6, 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,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 2, 0, 1, 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, 0, 0, 0,240, 65, 0, 0, 0, 0,154,153,153, 62, 0, 0, 0, 0,100, 0, 0, 0,154,153,153, 62,100, 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, 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, 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, 83, 78, 0, 0,
+ 8, 1, 0, 0,232,117,217, 3, 0, 0, 0, 0,210, 0, 0, 0, 1, 0, 0, 0, 24,157,217, 3, 0, 0, 0, 0, 56, 43,217, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 85, 86, 32, 69,100,105,116,105,110,103,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168, 54,201, 3, 0, 0, 0, 0, 8, 59,201, 3, 0, 0, 0, 0, 56, 97,216, 3,
+ 0, 0, 0, 0, 24,104,216, 3, 0, 0, 0, 0,216, 30,215, 3, 0, 0, 0, 0, 24, 33,215, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 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, 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, 68, 65, 84, 65,
+ 32, 0, 0, 0,168, 54,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 72, 55,201, 3, 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, 68, 65, 84, 65, 32, 0, 0, 0, 72, 55,201, 3,
+ 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,232, 55,201, 3, 0, 0, 0, 0,168, 54,201, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 5, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,232, 55,201, 3, 0, 0, 0, 0,211, 0, 0, 0,
+ 1, 0, 0, 0,136, 56,201, 3, 0, 0, 0, 0, 72, 55,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 5, 4,
+ 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,136, 56,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 40, 57,201, 3,
+ 0, 0, 0, 0,232, 55,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 32, 0, 0, 0, 40, 57,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,200, 57,201, 3, 0, 0, 0, 0,136, 56,201, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,234, 3, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,200, 57,201, 3,
+ 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,104, 58,201, 3, 0, 0, 0, 0, 40, 57,201, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,126, 7,234, 3, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,104, 58,201, 3, 0, 0, 0, 0,211, 0, 0, 0,
+ 1, 0, 0, 0, 8, 59,201, 3, 0, 0, 0, 0,200, 57,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 3,234, 3,
+ 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 8, 59,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,104, 58,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 3, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 0, 0, 0, 56, 97,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,232, 97,216, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 72, 55,201, 3, 0, 0, 0, 0,232, 55,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 0, 0, 0,232, 97,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,152, 98,216, 3, 0, 0, 0, 0, 56, 97,216, 3,
+ 0, 0, 0, 0, 72, 55,201, 3, 0, 0, 0, 0, 40, 57,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 0, 0, 0,152, 98,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 72, 99,216, 3, 0, 0, 0, 0,232, 97,216, 3,
+ 0, 0, 0, 0,232, 55,201, 3, 0, 0, 0, 0,200, 57,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 0, 0, 0, 72, 99,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,248, 99,216, 3, 0, 0, 0, 0,152, 98,216, 3,
+ 0, 0, 0, 0, 40, 57,201, 3, 0, 0, 0, 0,200, 57,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 0, 0, 0,248, 99,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,168,100,216, 3, 0, 0, 0, 0, 72, 99,216, 3,
+ 0, 0, 0, 0, 40, 57,201, 3, 0, 0, 0, 0,104, 58,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 0, 0, 0,168,100,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 88,101,216, 3, 0, 0, 0, 0,248, 99,216, 3,
+ 0, 0, 0, 0,168, 54,201, 3, 0, 0, 0, 0, 8, 59,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 0, 0, 0, 88,101,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 8,102,216, 3, 0, 0, 0, 0,168,100,216, 3,
+ 0, 0, 0, 0,168, 54,201, 3, 0, 0, 0, 0, 40, 57,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 0, 0, 0, 8,102,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,184,102,216, 3, 0, 0, 0, 0, 88,101,216, 3,
+ 0, 0, 0, 0,104, 58,201, 3, 0, 0, 0, 0, 8, 59,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 0, 0, 0,184,102,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,104,103,216, 3, 0, 0, 0, 0, 8,102,216, 3,
+ 0, 0, 0, 0,200, 57,201, 3, 0, 0, 0, 0,104, 58,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 0, 0, 0,104,103,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 24,104,216, 3, 0, 0, 0, 0,184,102,216, 3,
+ 0, 0, 0, 0,136, 56,201, 3, 0, 0, 0, 0, 8, 59,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 0, 0, 0, 24,104,216, 3, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104,103,216, 3,
+ 0, 0, 0, 0,136, 56,201, 3, 0, 0, 0, 0,200, 57,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+160, 0, 0, 0,216, 30,215, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,248, 31,215, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 40, 57,201, 3, 0, 0, 0, 0, 72, 55,201, 3, 0, 0, 0, 0,232, 55,201, 3, 0, 0, 0, 0,200, 57,201, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,235, 3, 0, 0, 5, 4, 0, 0, 7, 7,127, 7,
+ 27, 0, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,201,207, 3, 0, 0, 0, 0, 88,201,207, 3,
+ 0, 0, 0, 0, 88, 86,217, 3, 0, 0, 0, 0, 8, 88,217, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 88, 86,217, 3,
+ 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 8, 88,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 32,148, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,224,239, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,
+126, 7, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,192,239, 68, 0, 0,200, 65, 0,192,239, 68, 0, 0,200, 65, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,127, 7, 26, 0,127, 7, 26, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,235, 3, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127, 7, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 8, 88,217, 3,
+ 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 86,217, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0,240,109, 69, 0, 0,128,192, 0, 0, 0, 0, 0, 0, 0, 0,255,255,109, 69, 0, 0, 0,192, 0, 0, 0, 0,112, 7, 0, 0,
+129, 7, 0, 0, 18, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,
+111, 7, 0, 0, 18, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 2, 0, 0, 0, 1, 0, 3, 3, 2, 0, 0, 4, 10, 0,129, 7, 2, 0,112, 7, 1, 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, 5, 4, 0, 0, 5, 4, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 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, 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, 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, 68, 65, 84, 65,160, 0, 0, 0,248, 31,215, 3,
+ 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 24, 33,215, 3, 0, 0, 0, 0,216, 30,215, 3, 0, 0, 0, 0,168, 54,201, 3,
+ 0, 0, 0, 0, 40, 57,201, 3, 0, 0, 0, 0,104, 58,201, 3, 0, 0, 0, 0, 8, 59,201, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,199, 3, 0, 0, 0, 0, 0, 0,233, 3, 0, 0, 6, 6,200, 3,234, 3, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,119,217, 3, 0, 0, 0, 0,120,119,217, 3, 0, 0, 0, 0,184, 89,217, 3,
+ 0, 0, 0, 0, 24, 93,217, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,184, 89,217, 3, 0, 0, 0, 0,215, 0, 0, 0,
+ 1, 0, 0, 0,104, 91,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,215, 67, 0, 0, 0, 0,
+ 0, 0,208, 65, 0, 0, 0, 0, 0, 0,114, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,199, 3, 0, 0, 0, 0, 0, 0,
+ 25, 0, 0, 0, 0,192,113, 68, 0, 0,200, 65, 0,192,113, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,200, 3, 26, 0,200, 3, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,199, 3, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,200, 3, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,104, 91,217, 3, 0, 0, 0, 0,215, 0, 0, 0,
+ 1, 0, 0, 0, 24, 93,217, 3, 0, 0, 0, 0,184, 89,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 67, 0,192,115,196,
+ 0, 0, 0, 0, 0, 0, 0, 0,254,255, 74, 67,254,255,115,196, 0, 0, 0, 0,203, 0, 0, 0,220, 0, 0, 0, 0, 0, 0, 0,
+207, 3, 0, 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0,
+207, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 3, 0, 0,
+ 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,220, 0,208, 3,203, 0,208, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,219, 0, 0, 0, 26, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,220, 0,208, 3, 0, 0, 4, 0, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 54,217, 3,
+ 0, 0, 0, 0, 88, 54,217, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 88, 54,217, 3, 0, 0, 0, 0,213, 0, 0, 0,
+ 1, 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, 0, 0, 0, 73, 77, 65, 71, 69, 95, 80, 84, 95,103,112,101,110, 99,105,108, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 73, 77, 65, 71, 69, 95, 80, 84, 95,103,112,101,110, 99,105,108, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 71,114,101, 97,115,101, 32, 80,101,110, 99,105,108, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,152,255,202, 0, 80, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 1, 0, 0, 24, 93,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104, 91,217, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 67, 51, 51, 43,191,154,153,213, 63, 51, 51,131,191,
+154,153, 1, 64, 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, 0, 0, 0, 0,236, 2, 0, 0, 0, 0, 0, 0,208, 3, 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, 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, 0, 0,220, 0, 0, 0,199, 3, 0, 0, 26, 0, 0, 0,
+233, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,236, 2,208, 3, 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, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 33, 0, 0,120,119,217, 3, 0, 0, 0, 0,184, 0, 0, 0, 1, 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, 0, 0, 0, 6, 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,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 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, 0,
+ 0, 0,240, 65, 0, 0, 0, 0,154,153,153, 62, 0, 0, 0, 0,100, 0, 0, 0,154,153,153, 62,100, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0,
@@ -4777,7 +4795,6 @@ char datatoc_startup_blend[]= {
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,
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,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -4793,6 +4810,7 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 1, 0, 0, 0,100, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -4907,454 +4925,456 @@ char datatoc_startup_blend[]= {
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,
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,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 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,160, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,160, 0, 0, 0,168, 96, 45, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 88, 56, 45, 5, 0, 0, 0, 0, 72, 47, 45, 5, 0, 0, 0, 0,216, 46, 45, 5, 0, 0, 0, 0,104, 46, 45, 5, 0, 0, 0, 0,
-136, 45, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,201, 3, 0, 0,126, 7, 0, 0, 0, 0, 0, 0,233, 3, 0, 0,
- 1, 1,182, 3,234, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,111, 45, 5, 0, 0, 0, 0,
-200,111, 45, 5, 0, 0, 0, 0,152, 97, 45, 5, 0, 0, 0, 0,152,106, 45, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
-152, 97, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 8, 99, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 64,113, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,128,109, 68, 0, 0, 0, 0, 0, 0,208, 65,
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,
- 0, 0, 0, 0,181, 3, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 64,109, 68, 0, 0,200, 65, 0, 64,109, 68, 0, 0,200, 65,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,182, 3, 26, 0,182, 3, 26, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,201, 3, 0, 0,126, 7, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,182, 3, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,
- 8, 99, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 24,102, 45, 5, 0, 0, 0, 0,152, 97, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 32, 67, 0, 0, 86,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67, 0, 0, 86,196, 0, 0, 0, 0,
-143, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 87, 3, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
- 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 87, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 63, 0, 0, 0, 64, 10, 3, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,160, 0, 88, 3,143, 0, 88, 3, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,201, 3, 0, 0,104, 4, 0, 0,146, 0, 0, 0,233, 3, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 0, 88, 3, 0, 0, 5, 0, 3, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,120,100, 45, 5, 0, 0, 0, 0,120,100, 45, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,
-120,100, 45, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 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, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95,
-111, 98,106,101, 99,116,109,111,100,101, 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, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95,
-111, 98,106,101, 99,116,109,111,100,101, 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, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 32, 84,111,111,108,115, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233,253,143, 0,255, 1, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 24,102, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,
- 40,105, 45, 5, 0, 0, 0, 0, 8, 99, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0,242,194, 0, 0, 0, 0,
- 0, 0, 0, 0,231,102, 16, 67, 91, 90,242,194, 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0,119, 0, 0, 0,
- 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0,119, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 3, 0, 0, 1, 0, 7, 0,
- 18, 0, 0, 4, 6, 0,160, 0,120, 0,143, 0,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-201, 3, 0, 0,104, 4, 0, 0, 26, 0, 0, 0,145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-160, 0,120, 0, 0, 0, 6, 0, 34, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,103, 45, 5, 0, 0, 0, 0,
-136,103, 45, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0,136,103, 45, 5, 0, 0, 0, 0,214, 0, 0, 0, 1, 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, 0, 0, 0,
- 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,108, 97,115,116, 95,111,112,101,114, 97,116,111,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,108, 97,115,116, 95,111,112,101,114, 97,116,111,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 79,112,101,114, 97,116,111,114, 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, 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,216,255,144, 0, 16, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
- 40,105, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,152,106, 45, 5, 0, 0, 0, 0, 24,102, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 35, 67, 0,128,126,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67,255,191,126,196, 0, 0, 0, 0,
-163, 0, 0, 0,180, 0, 0, 0, 18, 0, 0, 0, 12, 4, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
- 0, 0, 0, 0,162, 0, 0, 0, 18, 0, 0, 0, 12, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 63, 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,180, 0, 13, 4,163, 0,251, 3, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,126, 7, 0, 0, 26, 0, 0, 0,233, 3, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,
-152,106, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,105, 45, 5, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,100, 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,160, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+160, 0, 0, 0, 24, 33,215, 3, 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 31,215, 3,
+ 0, 0, 0, 0, 8, 59,201, 3, 0, 0, 0, 0,104, 58,201, 3, 0, 0, 0, 0,200, 57,201, 3, 0, 0, 0, 0,136, 56,201, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,201, 3, 0, 0,126, 7, 0, 0, 0, 0, 0, 0,233, 3, 0, 0, 1, 1,182, 3,
+234, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 59,217, 3, 0, 0, 0, 0,248, 59,217, 3,
+ 0, 0, 0, 0,200, 94,217, 3, 0, 0, 0, 0,136,101,217, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,200, 94,217, 3,
+ 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,120, 96,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 64,113, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,128,109, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,
+181, 3, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 64,109, 68, 0, 0,200, 65, 0, 64,109, 68, 0, 0,200, 65, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,182, 3, 26, 0,182, 3, 26, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,201, 3, 0, 0,126, 7, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,182, 3, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,120, 96,217, 3,
+ 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 40, 98,217, 3, 0, 0, 0, 0,200, 94,217, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 32, 67, 0, 0, 86,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 67, 0, 0, 86,196, 0, 0, 0, 0,143, 0, 0, 0,
+160, 0, 0, 0, 0, 0, 0, 0, 87, 3, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,
+142, 0, 0, 0, 0, 0, 0, 0, 87, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
+ 0, 0, 0, 64, 10, 3, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,160, 0, 88, 3,143, 0, 88, 3, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,201, 3, 0, 0,104, 4, 0, 0,146, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 0, 88, 3, 0, 0, 5, 0, 3, 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, 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,105, 4, 0, 0,126, 7, 0, 0, 26, 0, 0, 0,233, 3, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 3,208, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 56, 56,217, 3, 0, 0, 0, 0, 56, 56,217, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 56, 56,217, 3,
+ 0, 0, 0, 0,213, 0, 0, 0, 1, 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, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95,111, 98,106,101,
+ 99,116,109,111,100,101, 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, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87, 51, 68, 95, 80, 84, 95,116,111,111,108,115, 95,111, 98,106,101,
+ 99,116,109,111,100,101, 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, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 32, 84,111,111,108,115, 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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233,253,143, 0,255, 1, 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, 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, 8,108, 45, 5, 0, 0, 0, 0, 68, 65, 84, 65,120, 3, 0, 0,
- 8,108, 45, 5, 0, 0, 0, 0,174, 0, 0, 0, 1, 0, 0, 0, 72,246,172, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 13,128,191, 0, 0,128,191,
- 0, 0, 0, 0, 0, 0, 0, 0, 74,215, 76,190, 0, 0, 0, 0, 68,239,209, 62, 51,177,205,190,184,158, 81, 63, 0, 0, 0, 0,
- 70,119,105, 63,143, 74, 70, 62, 35, 44,185,190, 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63, 42, 61,228, 62, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 95,192, 0, 0,128, 63, 69,239,209, 62, 70,119,105, 63,160, 84, 89,188, 0, 0, 0, 0,
- 52,177,205,190,142, 74, 70, 62,166, 33,101, 63, 0, 0, 0, 0,185,158, 81, 63, 35, 44,185,190, 43, 61,228, 62, 0, 0, 0, 0,
-188,173, 54, 64,136, 95,161,191,147,231,198, 63, 0, 0,128, 63,185,214, 13, 63,208,249,224,190, 48,180, 81,191,184,158, 81,191,
-189,188,157, 63,140,225, 88, 62, 26, 63,185, 62, 35, 44,185, 62,241,213,146,188,206,156,122, 63,138, 84,228,190, 42, 61,228,190,
- 0, 0, 0, 0, 0, 0, 0, 0,100, 98, 82, 64, 0, 25, 95, 64,121, 92,155, 62,151,198, 44, 63,192,214, 32,188, 0, 0, 40,180,
-195, 15,188,190,132, 75, 53, 62,216,125, 81, 63, 0, 0,192,179,115, 77,100,193, 17,173,201, 64,181,148,248,192,203,247,159,192,
-233, 74, 87, 65,247, 46,190,192, 88,106,234, 64, 45, 8,160, 64, 68,239,209, 62, 51,177,205,190,184,158, 81, 63, 0, 0, 0, 0,
- 70,119,105, 63,143, 74, 70, 62, 35, 44,185,190, 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63, 42, 61,228, 62, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 95,192, 0, 0,128, 63,185,214, 13, 63,208,249,224,190, 48,180, 81,191,184,158, 81,191,
-189,188,157, 63,140,225, 88, 62, 26, 63,185, 62, 35, 44,185, 62,241,213,146,188,206,156,122, 63,138, 84,228,190, 42, 61,228,190,
- 0, 0, 0, 0, 0, 0, 0, 0,100, 98, 82, 64, 0, 25, 95, 64,248,201,250, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,248,201,250, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248,201,250, 62, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 92, 62, 55, 63, 56,186,224,190,237,203,148,190, 3,236,234,190,
- 0, 25, 95, 64, 0, 25, 95, 64, 0, 0, 0, 0, 0, 0, 0, 0,114,145,245, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,255,255, 1, 0, 0, 0, 0, 0, 0, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 40, 98,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,216, 99,217, 3,
+ 0, 0, 0, 0,120, 96,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 67, 0, 0,242,194, 0, 0, 0, 0, 0, 0, 0, 0,
+231,102, 16, 67, 91, 90,242,194, 0, 0, 0, 0,143, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0,
+142, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 3, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4,
+ 6, 0,160, 0,120, 0,143, 0,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,201, 3, 0, 0,
+104, 4, 0, 0, 26, 0, 0, 0,145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 0,120, 0,
+ 0, 0, 6, 0, 34, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 58,217, 3, 0, 0, 0, 0, 24, 58,217, 3,
+ 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,
+ 0, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, 24, 58,217, 3, 0, 0, 0, 0,213, 0, 0, 0, 1, 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, 0, 0, 0, 86, 73, 69, 87,
+ 51, 68, 95, 80, 84, 95,108, 97,115,116, 95,111,112,101,114, 97,116,111,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 73, 69, 87,
+ 51, 68, 95, 80, 84, 95,108, 97,115,116, 95,111,112,101,114, 97,116,111,114, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,112,101,114,
+ 97,116,111,114, 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, 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,216,255,
+144, 0, 16, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,216, 99,217, 3,
+ 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,136,101,217, 3, 0, 0, 0, 0, 40, 98,217, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 35, 67, 0,128,126,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 67,255,191,126,196, 0, 0, 0, 0,163, 0, 0, 0,
+180, 0, 0, 0, 18, 0, 0, 0, 12, 4, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,
+162, 0, 0, 0, 18, 0, 0, 0, 12, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
+ 0, 0, 0, 64, 10, 0, 0, 0, 1, 0, 7, 0, 18, 0, 0, 0, 6, 0,180, 0, 13, 4,163, 0,251, 3, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 7, 0, 0,126, 7, 0, 0, 26, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,136,101,217, 3,
+ 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 99,217, 3, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 30, 33, 12, 66, 85,152,137, 66,116, 27,126, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 96, 1, 0, 0,200,111, 45, 5, 0, 0, 0, 0,175, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,105, 4, 0, 0,126, 7, 0, 0, 26, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 3,208, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 51, 51, 51, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65,205,204, 76, 62, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0,
-216,191, 45, 5, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 40,153,217, 3, 0, 0, 0, 0, 68, 65, 84, 65,112, 3, 0, 0, 40,153,217, 3,
+ 0, 0, 0, 0,173, 0, 0, 0, 1, 0, 0, 0, 72,246,172, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 13,128,191, 0, 0,128,191, 0, 0, 0, 0,
+ 0, 0, 0, 0, 74,215, 76,190, 0, 0, 0, 0, 68,239,209, 62, 51,177,205,190,184,158, 81, 63, 0, 0, 0, 0, 70,119,105, 63,
+143, 74, 70, 62, 35, 44,185,190, 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63, 42, 61,228, 62, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 25, 95,192, 0, 0,128, 63, 69,239,209, 62, 70,119,105, 63,160, 84, 89,188, 0, 0, 0, 0, 52,177,205,190,
+142, 74, 70, 62,166, 33,101, 63, 0, 0, 0, 0,185,158, 81, 63, 35, 44,185,190, 43, 61,228, 62, 0, 0, 0, 0,188,173, 54, 64,
+136, 95,161,191,147,231,198, 63, 0, 0,128, 63,185,214, 13, 63,208,249,224,190, 48,180, 81,191,184,158, 81,191,189,188,157, 63,
+140,225, 88, 62, 26, 63,185, 62, 35, 44,185, 62,241,213,146,188,206,156,122, 63,138, 84,228,190, 42, 61,228,190, 0, 0, 0, 0,
+ 0, 0, 0, 0,100, 98, 82, 64, 0, 25, 95, 64,121, 92,155, 62,151,198, 44, 63,192,214, 32,188, 0, 0, 40,180,195, 15,188,190,
+132, 75, 53, 62,216,125, 81, 63, 0, 0,192,179,115, 77,100,193, 17,173,201, 64,181,148,248,192,203,247,159,192,233, 74, 87, 65,
+247, 46,190,192, 88,106,234, 64, 45, 8,160, 64, 68,239,209, 62, 51,177,205,190,184,158, 81, 63, 0, 0, 0, 0, 70,119,105, 63,
+143, 74, 70, 62, 35, 44,185,190, 0, 0, 0, 0,162, 84, 89,188,166, 33,101, 63, 42, 61,228, 62, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 25, 95,192, 0, 0,128, 63,185,214, 13, 63,208,249,224,190, 48,180, 81,191,184,158, 81,191,189,188,157, 63,
+140,225, 88, 62, 26, 63,185, 62, 35, 44,185, 62,241,213,146,188,206,156,122, 63,138, 84,228,190, 42, 61,228,190, 0, 0, 0, 0,
+ 0, 0, 0, 0,100, 98, 82, 64, 0, 25, 95, 64, 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, 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, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 3, 0,
- 8, 8,128, 0, 0, 0, 12, 66, 0, 0,128, 63,205,204,204, 61, 0, 0,250, 67, 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, 16, 0, 10, 0, 7, 1, 0, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 83, 78, 0, 0, 8, 1, 0, 0, 8,114, 45, 5, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-232, 42, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 86,105,100,101,111, 32,
- 69,100,105,116,105,110,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,115, 45, 5, 0, 0, 0, 0, 40,120, 45, 5, 0, 0, 0, 0,
-152,120, 45, 5, 0, 0, 0, 0, 8,128, 45, 5, 0, 0, 0, 0,120,128, 45, 5, 0, 0, 0, 0,216,153, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0, 88,115, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,200,115, 45, 5, 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, 68, 65, 84, 65, 32, 0, 0, 0,
-200,115, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 56,116, 45, 5, 0, 0, 0, 0, 88,115, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,222, 2, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 56,116, 45, 5, 0, 0, 0, 0,
-212, 0, 0, 0, 1, 0, 0, 0,168,116, 45, 5, 0, 0, 0, 0,200,115, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-240, 4,222, 2, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,168,116, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,
- 24,117, 45, 5, 0, 0, 0, 0, 56,116, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0, 24,117, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,136,117, 45, 5, 0, 0, 0, 0,
-168,116, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,195, 2, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
-136,117, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,248,117, 45, 5, 0, 0, 0, 0, 24,117, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,240, 4,195, 2, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,248,117, 45, 5, 0, 0, 0, 0,
-212, 0, 0, 0, 1, 0, 0, 0,104,118, 45, 5, 0, 0, 0, 0,136,117, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-240, 4, 92, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,104,118, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,
-216,118, 45, 5, 0, 0, 0, 0,248,117, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0,216,118, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 72,119, 45, 5, 0, 0, 0, 0,
-104,118, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 2,195, 2, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
- 72,119, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,184,119, 45, 5, 0, 0, 0, 0,216,118, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,184,119, 45, 5, 0, 0, 0, 0,
-212, 0, 0, 0, 1, 0, 0, 0, 40,120, 45, 5, 0, 0, 0, 0, 72,119, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 48, 2, 92, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 40,120, 45, 5, 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,184,119, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 68, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,152,120, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 8,121, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,200,115, 45, 5, 0, 0, 0, 0, 56,116, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 8,121, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,120,121, 45, 5, 0, 0, 0, 0,
-152,120, 45, 5, 0, 0, 0, 0,200,115, 45, 5, 0, 0, 0, 0, 24,117, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,120,121, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,232,121, 45, 5, 0, 0, 0, 0,
- 8,121, 45, 5, 0, 0, 0, 0, 56,116, 45, 5, 0, 0, 0, 0,136,117, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,232,121, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 88,122, 45, 5, 0, 0, 0, 0,
-120,121, 45, 5, 0, 0, 0, 0, 24,117, 45, 5, 0, 0, 0, 0,136,117, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 88,122, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,200,122, 45, 5, 0, 0, 0, 0,
-232,121, 45, 5, 0, 0, 0, 0,136,117, 45, 5, 0, 0, 0, 0,248,117, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,200,122, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 56,123, 45, 5, 0, 0, 0, 0,
- 88,122, 45, 5, 0, 0, 0, 0, 88,115, 45, 5, 0, 0, 0, 0,104,118, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 56,123, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,168,123, 45, 5, 0, 0, 0, 0,
-200,122, 45, 5, 0, 0, 0, 0, 24,117, 45, 5, 0, 0, 0, 0,216,118, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,168,123, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 24,124, 45, 5, 0, 0, 0, 0,
- 56,123, 45, 5, 0, 0, 0, 0,104,118, 45, 5, 0, 0, 0, 0, 72,119, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 24,124, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,136,124, 45, 5, 0, 0, 0, 0,
-168,123, 45, 5, 0, 0, 0, 0, 72,119, 45, 5, 0, 0, 0, 0,184,119, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,136,124, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,248,124, 45, 5, 0, 0, 0, 0,
- 24,124, 45, 5, 0, 0, 0, 0,216,118, 45, 5, 0, 0, 0, 0,184,119, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,248,124, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,104,125, 45, 5, 0, 0, 0, 0,
-136,124, 45, 5, 0, 0, 0, 0,248,117, 45, 5, 0, 0, 0, 0, 40,120, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,104,125, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,216,125, 45, 5, 0, 0, 0, 0,
-248,124, 45, 5, 0, 0, 0, 0,168,116, 45, 5, 0, 0, 0, 0, 40,120, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,216,125, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 72,126, 45, 5, 0, 0, 0, 0,
-104,125, 45, 5, 0, 0, 0, 0,104,118, 45, 5, 0, 0, 0, 0, 40,120, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 72,126, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,184,126, 45, 5, 0, 0, 0, 0,
-216,125, 45, 5, 0, 0, 0, 0, 88,115, 45, 5, 0, 0, 0, 0,168,116, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,184,126, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 40,127, 45, 5, 0, 0, 0, 0,
- 72,126, 45, 5, 0, 0, 0, 0,136,117, 45, 5, 0, 0, 0, 0,216,118, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 40,127, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,152,127, 45, 5, 0, 0, 0, 0,
-184,126, 45, 5, 0, 0, 0, 0,248,117, 45, 5, 0, 0, 0, 0,184,119, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,152,127, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 8,128, 45, 5, 0, 0, 0, 0,
- 40,127, 45, 5, 0, 0, 0, 0, 24,117, 45, 5, 0, 0, 0, 0, 72,119, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 8,128, 45, 5, 0, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-152,127, 45, 5, 0, 0, 0, 0,248,117, 45, 5, 0, 0, 0, 0, 72,119, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,160, 0, 0, 0,120,128, 45, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 72,132, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 24,117, 45, 5, 0, 0, 0, 0,200,115, 45, 5, 0, 0, 0, 0, 56,116, 45, 5, 0, 0, 0, 0,
-136,117, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0,196, 2, 0, 0,222, 2, 0, 0,
- 7, 7,241, 4, 27, 0, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,161, 45, 5, 0, 0, 0, 0,
-200,161, 45, 5, 0, 0, 0, 0,104,129, 45, 5, 0, 0, 0, 0,216,130, 45, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
-104,129, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,216,130, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0,128,148, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 32,158, 68, 0, 0, 0, 0, 0, 0,208, 65,
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,
- 0, 0, 0, 0,240, 4, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0,158, 68, 0, 0,200, 65, 0, 0,158, 68, 0, 0,200, 65,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,241, 4, 26, 0,241, 4, 26, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0,196, 2, 0, 0,221, 2, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,241, 4, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,
-216,130, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104,129, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0,240,109, 69, 0, 0,128,192, 0, 0, 0, 0, 0, 0, 0, 0,255,255,109, 69, 0, 0, 0,192, 0, 0, 0, 0,
-112, 7, 0, 0,129, 7, 0, 0, 18, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
- 0, 0, 0, 0,111, 7, 0, 0, 18, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 2, 0, 0, 0, 1, 0, 3, 3, 2, 0, 0, 4, 10, 0,129, 7, 2, 0,112, 7, 1, 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,222, 2, 0, 0,222, 2, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248,201,250, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+248,201,250, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248,201,250, 62, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 92, 62, 55, 63, 56,186,224,190,237,203,148,190, 3,236,234,190, 0, 25, 95, 64,
+ 0, 25, 95, 64, 0, 0, 0, 0, 0, 0, 0, 0,114,145,245, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 30, 33, 12, 66, 85,152,137, 66,116, 27,126, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 96, 1, 0, 0,248, 59,217, 3, 0, 0, 0, 0,174, 0, 0, 0, 1, 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, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65,
+205,204, 76, 62, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0,200,213,217, 3, 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, 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, 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, 68, 65, 84, 65,160, 0, 0, 0,
- 72,132, 45, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 56,137, 45, 5, 0, 0, 0, 0,120,128, 45, 5, 0, 0, 0, 0,
- 88,115, 45, 5, 0, 0, 0, 0,104,118, 45, 5, 0, 0, 0, 0, 40,120, 45, 5, 0, 0, 0, 0,168,116, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 15, 15,241, 4, 68, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,136, 45, 5, 0, 0, 0, 0, 24,136, 45, 5, 0, 0, 0, 0,
- 56,133, 45, 5, 0, 0, 0, 0,168,134, 45, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 56,133, 45, 5, 0, 0, 0, 0,
-216, 0, 0, 0, 1, 0, 0, 0,168,134, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,140, 68,
- 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 32,158, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,240, 4, 0, 0,
- 0, 0, 0, 0, 25, 0, 0, 0, 0, 0,158, 68, 0, 0,200, 65, 0, 0,158, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,241, 4, 26, 0,241, 4, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,241, 4, 26, 0, 0, 0, 1, 0, 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 3, 0, 8, 8,128, 0, 0, 0, 12, 66, 0, 0,128, 63,
+205,204,204, 61, 0, 0,250, 67, 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, 16, 0, 10, 0, 7, 1, 0, 3, 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, 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, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,168,134, 45, 5, 0, 0, 0, 0,
-216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,133, 45, 5, 0, 0, 0, 0, 0, 0, 64,192, 0, 0,126, 67,
- 0, 0, 0, 0, 0, 0, 72, 66,112,189, 17,192,246, 70,125, 67, 0, 0, 0, 0, 0, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0,
- 18, 0, 0, 0, 41, 0, 0, 0, 0, 0,128, 63, 0, 0, 72, 66, 0,124,146, 72, 0, 0, 72, 66,205,204,204, 61, 0, 0, 32, 65,
- 72, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 4, 8, 0,241, 4, 42, 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,240, 4, 0, 0, 26, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,241, 4, 42, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 78, 0, 0, 8, 1, 0, 0, 24,157,217, 3,
+ 0, 0, 0, 0,210, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,117,217, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 86,105,100,101,111, 32, 69,100,105,116,105,110,103, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,168, 59,201, 3, 0, 0, 0, 0,136, 66,201, 3, 0, 0, 0, 0,200,104,216, 3, 0, 0, 0, 0,120,116,216, 3,
+ 0, 0, 0, 0, 56, 34,215, 3, 0, 0, 0, 0,184, 38,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,168,194,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,168, 59,201, 3,
+ 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 72, 60,201, 3, 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, 68, 65, 84, 65, 32, 0, 0, 0, 72, 60,201, 3, 0, 0, 0, 0,211, 0, 0, 0,
+ 1, 0, 0, 0,232, 60,201, 3, 0, 0, 0, 0,168, 59,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,222, 2,
+ 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,232, 60,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,136, 61,201, 3,
+ 0, 0, 0, 0, 72, 60,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4,222, 2, 0, 0, 0, 0, 68, 65, 84, 65,
+ 32, 0, 0, 0,136, 61,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 40, 62,201, 3, 0, 0, 0, 0,232, 60,201, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 40, 62,201, 3,
+ 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,200, 62,201, 3, 0, 0, 0, 0,136, 61,201, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,195, 2, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,200, 62,201, 3, 0, 0, 0, 0,211, 0, 0, 0,
+ 1, 0, 0, 0,104, 63,201, 3, 0, 0, 0, 0, 40, 62,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4,195, 2,
+ 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,104, 63,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 8, 64,201, 3,
+ 0, 0, 0, 0,200, 62,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 92, 1, 0, 0, 0, 0, 68, 65, 84, 65,
+ 32, 0, 0, 0, 8, 64,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,168, 64,201, 3, 0, 0, 0, 0,104, 63,201, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,168, 64,201, 3,
+ 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 72, 65,201, 3, 0, 0, 0, 0, 8, 64,201, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 48, 2,195, 2, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 72, 65,201, 3, 0, 0, 0, 0,211, 0, 0, 0,
+ 1, 0, 0, 0,232, 65,201, 3, 0, 0, 0, 0,168, 64,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 1,
+ 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,232, 65,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0,136, 66,201, 3,
+ 0, 0, 0, 0, 72, 65,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 2, 92, 1, 0, 0, 0, 0, 68, 65, 84, 65,
+ 32, 0, 0, 0,136, 66,201, 3, 0, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 65,201, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 68, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,200,104,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,120,105,216, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 60,201, 3,
+ 0, 0, 0, 0,232, 60,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,120,105,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 40,106,216, 3, 0, 0, 0, 0,200,104,216, 3, 0, 0, 0, 0, 72, 60,201, 3,
+ 0, 0, 0, 0, 40, 62,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 40,106,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,216,106,216, 3, 0, 0, 0, 0,120,105,216, 3, 0, 0, 0, 0,232, 60,201, 3,
+ 0, 0, 0, 0,200, 62,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,216,106,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,136,107,216, 3, 0, 0, 0, 0, 40,106,216, 3, 0, 0, 0, 0, 40, 62,201, 3,
+ 0, 0, 0, 0,200, 62,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,136,107,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 56,108,216, 3, 0, 0, 0, 0,216,106,216, 3, 0, 0, 0, 0,200, 62,201, 3,
+ 0, 0, 0, 0,104, 63,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 56,108,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,232,108,216, 3, 0, 0, 0, 0,136,107,216, 3, 0, 0, 0, 0,168, 59,201, 3,
+ 0, 0, 0, 0, 8, 64,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,232,108,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,152,109,216, 3, 0, 0, 0, 0, 56,108,216, 3, 0, 0, 0, 0, 40, 62,201, 3,
+ 0, 0, 0, 0,168, 64,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,152,109,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 72,110,216, 3, 0, 0, 0, 0,232,108,216, 3, 0, 0, 0, 0, 8, 64,201, 3,
+ 0, 0, 0, 0, 72, 65,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 72,110,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,248,110,216, 3, 0, 0, 0, 0,152,109,216, 3, 0, 0, 0, 0, 72, 65,201, 3,
+ 0, 0, 0, 0,232, 65,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,248,110,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,168,111,216, 3, 0, 0, 0, 0, 72,110,216, 3, 0, 0, 0, 0,168, 64,201, 3,
+ 0, 0, 0, 0,232, 65,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,168,111,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 88,112,216, 3, 0, 0, 0, 0,248,110,216, 3, 0, 0, 0, 0,104, 63,201, 3,
+ 0, 0, 0, 0,136, 66,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 88,112,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 8,113,216, 3, 0, 0, 0, 0,168,111,216, 3, 0, 0, 0, 0,136, 61,201, 3,
+ 0, 0, 0, 0,136, 66,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 8,113,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,184,113,216, 3, 0, 0, 0, 0, 88,112,216, 3, 0, 0, 0, 0, 8, 64,201, 3,
+ 0, 0, 0, 0,136, 66,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,184,113,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,104,114,216, 3, 0, 0, 0, 0, 8,113,216, 3, 0, 0, 0, 0,168, 59,201, 3,
+ 0, 0, 0, 0,136, 61,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,104,114,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 24,115,216, 3, 0, 0, 0, 0,184,113,216, 3, 0, 0, 0, 0,200, 62,201, 3,
+ 0, 0, 0, 0,168, 64,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 24,115,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,200,115,216, 3, 0, 0, 0, 0,104,114,216, 3, 0, 0, 0, 0,104, 63,201, 3,
+ 0, 0, 0, 0,232, 65,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,200,115,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,120,116,216, 3, 0, 0, 0, 0, 24,115,216, 3, 0, 0, 0, 0, 40, 62,201, 3,
+ 0, 0, 0, 0, 72, 65,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,120,116,216, 3,
+ 0, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,115,216, 3, 0, 0, 0, 0,104, 63,201, 3,
+ 0, 0, 0, 0, 72, 65,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0, 56, 34,215, 3,
+ 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 88, 35,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 62,201, 3,
+ 0, 0, 0, 0, 72, 60,201, 3, 0, 0, 0, 0,232, 60,201, 3, 0, 0, 0, 0,200, 62,201, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0,196, 2, 0, 0,222, 2, 0, 0, 7, 7,241, 4, 27, 0, 1, 0, 0, 0, 0, 0,
+ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,202,207, 3, 0, 0, 0, 0, 24,202,207, 3, 0, 0, 0, 0, 56,103,217, 3,
+ 0, 0, 0, 0,232,104,217, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 56,103,217, 3, 0, 0, 0, 0,215, 0, 0, 0,
+ 1, 0, 0, 0,232,104,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,148, 68, 0, 0, 0, 0,
+ 0, 0,208, 65, 0, 0, 0, 0, 0, 32,158, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,240, 4, 0, 0, 0, 0, 0, 0,
+ 25, 0, 0, 0, 0, 0,158, 68, 0, 0,200, 65, 0, 0,158, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,241, 4, 26, 0,241, 4, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0,196, 2, 0, 0,221, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,241, 4, 26, 0, 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,232,104,217, 3, 0, 0, 0, 0,215, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,103,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,109, 69, 0, 0,128,192,
+ 0, 0, 0, 0, 0, 0, 0, 0,255,255,109, 69, 0, 0, 0,192, 0, 0, 0, 0,112, 7, 0, 0,129, 7, 0, 0, 18, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,111, 7, 0, 0, 18, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 2, 0, 0, 0,
+ 1, 0, 3, 3, 2, 0, 0, 4, 10, 0,129, 7, 2, 0,112, 7, 1, 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,222, 2, 0, 0,222, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 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, 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, 0, 68, 65, 84, 65,208, 0, 0, 0, 24,136, 45, 5, 0, 0, 0, 0,
-191, 0, 0, 0, 1, 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, 0, 0, 0, 15, 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, 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, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0, 88, 35,215, 3, 0, 0, 0, 0,214, 0, 0, 0,
+ 1, 0, 0, 0,120, 36,215, 3, 0, 0, 0, 0, 56, 34,215, 3, 0, 0, 0, 0,168, 59,201, 3, 0, 0, 0, 0, 8, 64,201, 3,
+ 0, 0, 0, 0,136, 66,201, 3, 0, 0, 0, 0,136, 61,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+240, 4, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 15, 15,241, 4, 68, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,200, 96,200, 3, 0, 0, 0, 0,200, 96,200, 3, 0, 0, 0, 0,152,106,217, 3, 0, 0, 0, 0, 72,108,217, 3,
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,
+ 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,152,106,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 72,108,217, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,140, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0,
+ 0, 32,158, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,240, 4, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0,158, 68,
+ 0, 0,200, 65, 0, 0,158, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0,
+ 10, 0,241, 4, 26, 0,241, 4, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+240, 4, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,241, 4, 26, 0,
+ 0, 0, 1, 0, 2, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
- 56,137, 45, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 40,145, 45, 5, 0, 0, 0, 0, 72,132, 45, 5, 0, 0, 0, 0,
-104,118, 45, 5, 0, 0, 0, 0, 72,119, 45, 5, 0, 0, 0, 0,248,117, 45, 5, 0, 0, 0, 0, 40,120, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0, 69, 0, 0, 0, 91, 1, 0, 0, 8, 8,241, 4, 23, 1, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,143, 45, 5, 0, 0, 0, 0,232,143, 45, 5, 0, 0, 0, 0,
- 40,138, 45, 5, 0, 0, 0, 0,120,142, 45, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 40,138, 45, 5, 0, 0, 0, 0,
-216, 0, 0, 0, 1, 0, 0, 0,152,139, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 26, 68,
- 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 32,158, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,240, 4, 0, 0,
- 0, 0, 0, 0, 25, 0, 0, 0, 0, 0,158, 68, 0, 0,200, 65, 0, 0,158, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,241, 4, 26, 0,241, 4, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0, 69, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,241, 4, 26, 0, 0, 0, 1, 0, 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 72,108,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,152,106,217, 3, 0, 0, 0, 0, 0, 0, 64,192, 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 72, 66,112,189, 17,192,
+246, 70,125, 67, 0, 0, 0, 0, 0, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+240, 4, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0, 18, 0, 0, 0, 41, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 72, 66, 0,124,146, 72, 0, 0, 72, 66,205,204,204, 61, 0, 0, 32, 65, 72, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 4,
+ 8, 0,241, 4, 42, 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,
+240, 4, 0, 0, 26, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,241, 4, 42, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,152,139, 45, 5, 0, 0, 0, 0,
-216, 0, 0, 0, 1, 0, 0, 0, 8,141, 45, 5, 0, 0, 0, 0, 40,138, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 67,
- 0, 0,125,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 67, 1, 0,125,195, 0, 0, 0, 0,203, 0, 0, 0,220, 0, 0, 0,
- 0, 0, 0, 0,252, 0, 0, 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,202, 0, 0, 0,
- 0, 0, 0, 0,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64,
- 10, 3, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4, 6, 0,220, 0,253, 0,203, 0,253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 21, 4, 0, 0,240, 4, 0, 0, 95, 0, 0, 0, 91, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,220, 0,253, 0, 0, 0, 4, 0, 4, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 8,141, 45, 5, 0, 0, 0, 0,
-216, 0, 0, 0, 1, 0, 0, 0,120,142, 45, 5, 0, 0, 0, 0,152,139, 45, 5, 0, 0, 0, 0, 0, 0,112,196, 0, 0,112, 68,
- 0, 0, 7,196, 0, 0, 7, 68, 0, 0,112,196, 0, 0,112, 68, 0, 0, 7,196, 0, 0, 7, 68, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0,200, 96,200, 3, 0, 0, 0, 0,190, 0, 0, 0, 1, 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, 0, 0, 0, 15, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 59, 70, 0,128, 59, 70,172,197, 39, 55, 0, 80,195, 71,
- 0, 0, 0, 0, 0, 0, 6, 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, 0, 0, 0, 0, 0, 20, 4, 0, 0, 91, 1, 0, 0, 91, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 7, 0, 1, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,120,142, 45, 5, 0, 0, 0, 0,
-216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,141, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,
- 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 17, 0, 0, 0,
- 18, 0, 0, 0,252, 0, 0, 0, 18, 0, 0, 0, 20, 4, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 18, 0, 0, 0, 20, 4, 0, 0,
- 18, 0, 0, 0,252, 0, 0, 0, 0, 0, 32, 65, 0, 0, 0, 63, 0,124,146, 72, 0, 0, 0, 66, 10,215, 35, 60, 0, 0,200, 66,
-105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 8, 0, 21, 4,253, 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, 20, 4, 0, 0, 95, 0, 0, 0, 91, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 21, 4,253, 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, 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, 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, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,232,143, 45, 5, 0, 0, 0, 0,
-181, 0, 0, 0, 1, 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, 0, 0, 0, 8, 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, 31, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,120, 36,215, 3, 0, 0, 0, 0,214, 0, 0, 0,
+ 1, 0, 0, 0,152, 37,215, 3, 0, 0, 0, 0, 88, 35,215, 3, 0, 0, 0, 0, 8, 64,201, 3, 0, 0, 0, 0, 72, 65,201, 3,
+ 0, 0, 0, 0,104, 63,201, 3, 0, 0, 0, 0,136, 66,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+240, 4, 0, 0, 69, 0, 0, 0, 91, 1, 0, 0, 8, 8,241, 4, 23, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,120,150,199, 3, 0, 0, 0, 0,120,150,199, 3, 0, 0, 0, 0,248,109,217, 3, 0, 0, 0, 0,136,160,217, 3,
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,
+ 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,248,109,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,168,111,217, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 26, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0,
+ 0, 32,158, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,240, 4, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0,158, 68,
+ 0, 0,200, 65, 0, 0,158, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0,
+ 10, 0,241, 4, 26, 0,241, 4, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+240, 4, 0, 0, 69, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,241, 4, 26, 0,
+ 0, 0, 1, 0, 2, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,168,111,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,216,158,217, 3,
+ 0, 0, 0, 0,248,109,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 67, 0, 0,125,195, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 75, 67, 1, 0,125,195, 0, 0, 0, 0,203, 0, 0, 0,220, 0, 0, 0, 0, 0, 0, 0,252, 0, 0, 0, 0, 0, 0, 0,
+202, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0,252, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 10, 3, 0, 0, 1, 0, 7, 0, 18, 0, 0, 4,
+ 6, 0,220, 0,253, 0,203, 0,253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 4, 0, 0,
+240, 4, 0, 0, 95, 0, 0, 0, 91, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,220, 0,253, 0,
+ 0, 0, 4, 0, 4, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 64, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,
- 40,145, 45, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,216,153, 45, 5, 0, 0, 0, 0, 56,137, 45, 5, 0, 0, 0, 0,
- 72,119, 45, 5, 0, 0, 0, 0, 24,117, 45, 5, 0, 0, 0, 0,216,118, 45, 5, 0, 0, 0, 0,184,119, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 2, 0, 0, 93, 1, 0, 0,194, 2, 0, 0, 2, 2, 48, 2,102, 1, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216,151, 45, 5, 0, 0, 0, 0,216,151, 45, 5, 0, 0, 0, 0,
- 24,146, 45, 5, 0, 0, 0, 0,104,150, 45, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 24,146, 45, 5, 0, 0, 0, 0,
-216, 0, 0, 0, 1, 0, 0, 0,136,147, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 89, 68,
- 0, 0, 0, 0, 0, 0,208, 65,154,216, 65, 55, 0, 0, 12, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 47, 2, 0, 0,
- 0, 0, 0, 0, 25, 0, 0, 0, 0,192, 11, 68, 0, 0,200, 65, 0,192, 11, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0, 48, 2, 26, 0, 48, 2, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 2, 0, 0, 93, 1, 0, 0,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 48, 2, 26, 0, 0, 0, 1, 0, 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,216,158,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,136,160,217, 3,
+ 0, 0, 0, 0,168,111,217, 3, 0, 0, 0, 0, 0, 0,112,196, 0, 0,112, 68, 0, 0, 7,196, 0, 0, 7, 68, 0, 0,112,196,
+ 0, 0,112, 68, 0, 0, 7,196, 0, 0, 7, 68, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,136,147, 45, 5, 0, 0, 0, 0,
-216, 0, 0, 0, 1, 0, 0, 0,248,148, 45, 5, 0, 0, 0, 0, 24,146, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 67,
- 0, 0,112,193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 67, 0, 0,157,195, 0, 0, 0, 0,200, 0, 0, 0,217, 0, 0, 0,
- 18, 0, 0, 0, 75, 1, 0, 0, 0, 0, 0, 0,199, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,199, 0, 0, 0,
- 18, 0, 0, 0, 75, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 10, 6, 0, 0, 2, 0, 3, 3, 0, 0, 0, 4, 6, 0,217, 0, 76, 1,200, 0, 58, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 0, 0, 0,119, 1, 0, 0,194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,217, 0, 76, 1, 0, 0, 2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0,128, 59, 70, 0,128, 59, 70,172,197, 39, 55, 0, 80,195, 71, 0, 0, 0, 0, 0, 0, 6, 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, 0, 0, 0, 0, 0,
+ 20, 4, 0, 0, 91, 1, 0, 0, 91, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
+ 0, 0, 7, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,248,148, 45, 5, 0, 0, 0, 0,
-216, 0, 0, 0, 1, 0, 0, 0,104,150, 45, 5, 0, 0, 0, 0,136,147, 45, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,136,160,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,216,158,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0,
+ 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 17, 0, 0, 0, 18, 0, 0, 0,252, 0, 0, 0, 18, 0, 0, 0,
+ 20, 4, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 18, 0, 0, 0, 20, 4, 0, 0, 18, 0, 0, 0,252, 0, 0, 0, 0, 0, 32, 65,
+ 0, 0, 0, 63, 0,124,146, 72, 0, 0, 0, 66, 10,215, 35, 60, 0, 0,200, 66,105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,
+ 8, 0, 21, 4,253, 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,
+ 20, 4, 0, 0, 95, 0, 0, 0, 91, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 4,253, 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, 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, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 47, 2, 0, 0, 47, 2, 0, 0,119, 1, 0, 0,194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,120,150,199, 3, 0, 0, 0, 0,180, 0, 0, 0, 1, 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, 0, 0, 0, 8, 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, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,104,150, 45, 5, 0, 0, 0, 0,
-216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248,148, 45, 5, 0, 0, 0, 0, 0, 0, 16,193, 0, 0,130, 67,
- 0, 0,160,192, 0, 0,160, 64, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 16,193, 0, 0, 32, 65, 0, 0, 0, 0, 17, 0, 0, 0,
- 18, 0, 0, 0, 75, 1, 0, 0, 18, 0, 0, 0, 86, 1, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 18, 0, 0, 0, 86, 1, 0, 0,
- 18, 0, 0, 0, 75, 1, 0, 0,111, 18,131, 58,111, 18,131, 58, 0,124,146, 72, 0, 80, 67, 71, 0, 0, 0, 0, 0, 0, 0, 0,
-105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 87, 1, 76, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,217, 0, 0, 0, 47, 2, 0, 0,119, 1, 0, 0,194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 87, 1, 76, 1, 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, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,216,151, 45, 5, 0, 0, 0, 0,
-179, 0, 0, 0, 1, 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, 0, 0, 0, 2, 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, 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, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 64, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,152, 37,215, 3, 0, 0, 0, 0,214, 0, 0, 0,
+ 1, 0, 0, 0,184, 38,215, 3, 0, 0, 0, 0,120, 36,215, 3, 0, 0, 0, 0, 72, 65,201, 3, 0, 0, 0, 0, 40, 62,201, 3,
+ 0, 0, 0, 0,168, 64,201, 3, 0, 0, 0, 0,232, 65,201, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 2, 0, 0, 93, 1, 0, 0,194, 2, 0, 0, 2, 2, 48, 2,102, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,232,151,199, 3, 0, 0, 0, 0,232,151,199, 3, 0, 0, 0, 0, 56,162,217, 3, 0, 0, 0, 0, 72,167,217, 3,
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,
+ 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 56,162,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,232,163,217, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 89, 68, 0, 0, 0, 0, 0, 0,208, 65,154,216, 65, 55,
+ 0, 0, 12, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0, 47, 2, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,192, 11, 68,
+ 0, 0,200, 65, 0,192, 11, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0,
+ 10, 0, 48, 2, 26, 0, 48, 2, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 2, 0, 0, 93, 1, 0, 0,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 2, 26, 0,
+ 0, 0, 1, 0, 2, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,153, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,112, 0, 0, 0,
- 24,153, 45, 5, 0, 0, 0, 0, 38, 1, 0, 0, 1, 0, 0, 0, 88,162, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,232,163,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,152,165,217, 3,
+ 0, 0, 0, 0, 56,162,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 67, 0, 0,112,193, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 72, 67, 0, 0,157,195, 0, 0, 0, 0,200, 0, 0, 0,217, 0, 0, 0, 18, 0, 0, 0, 75, 1, 0, 0, 0, 0, 0, 0,
+199, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,199, 0, 0, 0, 18, 0, 0, 0, 75, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 10, 6, 0, 0, 2, 0, 3, 3, 0, 0, 0, 4,
+ 6, 0,217, 0, 76, 1,200, 0, 58, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+216, 0, 0, 0,119, 1, 0, 0,194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,217, 0, 76, 1,
+ 0, 0, 2, 0, 3, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,160, 0, 0, 0,216,153, 45, 5, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 40,145, 45, 5, 0, 0, 0, 0,184,119, 45, 5, 0, 0, 0, 0,216,118, 45, 5, 0, 0, 0, 0,136,117, 45, 5, 0, 0, 0, 0,
-248,117, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 2, 0, 0,240, 4, 0, 0, 93, 1, 0, 0,194, 2, 0, 0,
- 8, 8,192, 2,102, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,160, 45, 5, 0, 0, 0, 0,
-136,160, 45, 5, 0, 0, 0, 0,200,154, 45, 5, 0, 0, 0, 0, 24,159, 45, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
-200,154, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 56,156, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,245, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0, 48, 68, 0, 0, 0, 0, 0, 0,208, 65,
+ 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,152,165,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 72,167,217, 3,
+ 0, 0, 0, 0,232,163,217, 3, 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, 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,191, 2, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,192, 47, 68, 0, 0,200, 65, 0,192, 47, 68, 0, 0,200, 65,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,192, 2, 26, 0,192, 2, 26, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 2, 0, 0,240, 4, 0, 0, 93, 1, 0, 0,118, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 2, 26, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 26, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
- 56,156, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,168,157, 45, 5, 0, 0, 0, 0,200,154, 45, 5, 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, 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, 47, 2, 0, 0,
+ 47, 2, 0, 0,119, 1, 0, 0,194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
+ 0, 0, 4, 0, 4, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0, 72,167,217, 3, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,152,165,217, 3, 0, 0, 0, 0, 0, 0, 16,193, 0, 0,130, 67, 0, 0,160,192, 0, 0,160, 64, 0, 0, 0, 0,
+ 0, 0,122, 67, 0, 0, 16,193, 0, 0, 32, 65, 0, 0, 0, 0, 17, 0, 0, 0, 18, 0, 0, 0, 75, 1, 0, 0, 18, 0, 0, 0,
+ 86, 1, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 18, 0, 0, 0, 86, 1, 0, 0, 18, 0, 0, 0, 75, 1, 0, 0,111, 18,131, 58,
+111, 18,131, 58, 0,124,146, 72, 0, 80, 67, 71, 0, 0, 0, 0, 0, 0, 0, 0,105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,
+ 0, 0, 87, 1, 76, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,217, 0, 0, 0,
+ 47, 2, 0, 0,119, 1, 0, 0,194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 1, 76, 1,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 4, 0, 0,240, 4, 0, 0,119, 1, 0, 0,194, 2, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 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, 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, 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, 68, 65, 84, 65, 40, 1, 0, 0,
-168,157, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 24,159, 45, 5, 0, 0, 0, 0, 56,156, 45, 5, 0, 0, 0, 0,
- 0, 0,240,195, 0, 0,240, 67, 0, 0,135,195, 0, 0,135, 67,238, 33,143,196,238, 33,143, 68, 0, 0, 7,196, 0, 0, 7, 68,
+ 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,232,151,199, 3, 0, 0, 0, 0,178, 0, 0, 0, 1, 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, 0, 0, 0, 2, 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, 0, 0, 0,
- 0, 0, 0, 0,191, 2, 0, 0, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 59, 70, 0,128, 59, 70,
-172,197, 39, 55, 0, 80,195, 71, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 4, 0, 0,192, 2, 76, 1,192, 2, 76, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 2, 0, 0,240, 4, 0, 0,119, 1, 0, 0,194, 2, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 2, 76, 1, 0, 0, 7, 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, 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, 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, 0, 68, 65, 84, 65, 40, 1, 0, 0,
- 24,159, 45, 5, 0, 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168,157, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65,
- 0, 0, 0, 0, 17, 0, 0, 0, 18, 0, 0, 0, 75, 1, 0, 0, 18, 0, 0, 0,201, 2, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
- 18, 0, 0, 0,201, 2, 0, 0, 18, 0, 0, 0, 75, 1, 0, 0, 0, 0, 32, 65, 0, 0, 0, 63, 0,124,146, 72, 0, 0, 0, 66,
- 10,215, 35, 60, 0, 0,200, 66,105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0,202, 2, 76, 1, 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, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 24,120,214, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+ 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,112, 0, 0, 0, 24,120,214, 3, 0, 0, 0, 0, 37, 1, 0, 0,
+ 1, 0, 0, 0,168,194,217, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-136,160, 45, 5, 0, 0, 0, 0,181, 0, 0, 0, 1, 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, 0, 0, 0, 8, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,184, 38,215, 3,
+ 0, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152, 37,215, 3, 0, 0, 0, 0,232, 65,201, 3,
+ 0, 0, 0, 0,168, 64,201, 3, 0, 0, 0, 0,200, 62,201, 3, 0, 0, 0, 0,104, 63,201, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 49, 2, 0, 0,240, 4, 0, 0, 93, 1, 0, 0,194, 2, 0, 0, 8, 8,192, 2,102, 1, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,153,199, 3, 0, 0, 0, 0, 88,153,199, 3, 0, 0, 0, 0,248,168,217, 3,
+ 0, 0, 0, 0, 8,174,217, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,248,168,217, 3, 0, 0, 0, 0,215, 0, 0, 0,
+ 1, 0, 0, 0,168,170,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,245, 67, 0, 0, 0, 0,
+ 0, 0,208, 65, 0, 0, 0, 0, 0, 0, 48, 68, 0, 0, 0, 0, 0, 0,208, 65, 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, 0, 0, 0, 0,191, 2, 0, 0, 0, 0, 0, 0,
+ 25, 0, 0, 0, 0,192, 47, 68, 0, 0,200, 65, 0,192, 47, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 2, 0, 3, 3, 4, 0, 12, 0, 10, 0,192, 2, 26, 0,192, 2, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 49, 2, 0, 0,240, 4, 0, 0, 93, 1, 0, 0,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,192, 2, 26, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,168,170,217, 3, 0, 0, 0, 0,215, 0, 0, 0,
+ 1, 0, 0, 0, 88,172,217, 3, 0, 0, 0, 0,248,168,217, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 64, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 83, 67, 0, 0,216, 11, 0, 0, 88,162, 45, 5, 0, 0, 0, 0,172, 0, 0, 0, 1, 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, 0, 0, 0, 83, 67, 83, 99,101,110,101, 0,
-116, 97,103,101, 0, 97,105,110, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,120,174, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0,
- 8,189, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,175, 45, 5, 0, 0, 0, 0, 40,176, 45, 5, 0, 0, 0, 0,
- 72,175, 45, 5, 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, 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,
- 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-152,176, 45, 5, 0, 0, 0, 0,152,142,138, 77,130,127, 0, 0, 17, 2, 24, 0, 90, 90, 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,240, 4, 0, 0,240, 4, 0, 0,119, 1, 0, 0,194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 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, 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, 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,192, 0, 0, 0, 68,172, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 88,172,217, 3, 0, 0, 0, 0,215, 0, 0, 0,
+ 1, 0, 0, 0, 8,174,217, 3, 0, 0, 0, 0,168,170,217, 3, 0, 0, 0, 0, 0, 0,240,195, 0, 0,240, 67, 0, 0,135,195,
+ 0, 0,135, 67,238, 33,143,196,238, 33,143, 68, 0, 0, 7,196, 0, 0, 7, 68, 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, 0, 0, 0, 0,191, 2, 0, 0, 0, 0, 0, 0,
+ 75, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 59, 70, 0,128, 59, 70,172,197, 39, 55, 0, 80,195, 71, 0, 0, 0, 0,
+ 0, 0, 6, 0, 0, 0, 0, 4, 0, 0,192, 2, 76, 1,192, 2, 76, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 49, 2, 0, 0,240, 4, 0, 0,119, 1, 0, 0,194, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,192, 2, 76, 1, 0, 0, 7, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0,100, 0, 0, 0,
- 0, 0, 1, 0, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 2,224, 1, 60, 0,
- 32, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 6, 0, 50, 0,141, 0,128, 7, 56, 4, 8, 0, 8, 0, 24, 0, 17, 0, 0, 0,
- 90, 0, 1, 0, 81, 0, 0, 0, 23, 0, 33, 0, 2, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 8, 0, 24, 0, 10, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,180, 45, 5, 0, 0, 0, 0,120,180, 45, 5, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 1, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 5, 0, 2, 0, 1, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 47,116,109,112, 47, 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, 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, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 8,174,217, 3, 0, 0, 0, 0,215, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,172,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0,
+ 0, 0, 0, 65, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 17, 0, 0, 0, 18, 0, 0, 0,
+ 75, 1, 0, 0, 18, 0, 0, 0,201, 2, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 18, 0, 0, 0,201, 2, 0, 0, 18, 0, 0, 0,
+ 75, 1, 0, 0, 0, 0, 32, 65, 0, 0, 0, 63, 0,124,146, 72, 0, 0, 0, 66, 10,215, 35, 60, 0, 0,200, 66,105, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 8, 0,202, 2, 76, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 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, 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, 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, 68, 65, 84, 65,240, 0, 0, 0, 88,153,199, 3, 0, 0, 0, 0,180, 0, 0, 0,
+ 1, 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, 0, 0, 0, 8, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 64, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 0, 0,216, 11, 0, 0,168,194,217, 3,
+ 0, 0, 0, 0,171, 0, 0, 0, 1, 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, 0, 0, 0, 83, 67, 83, 99,101,110,101, 0,116, 97,103,101, 0, 97,105,110, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,173,200, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,213,217, 3, 0, 0, 0, 0, 24, 51,163, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 40,117,216, 3, 0, 0, 0, 0,136,118,216, 3, 0, 0, 0, 0, 40,117,216, 3, 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, 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, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,207,217, 3, 0, 0, 0, 0,232,141,214, 15,
+ 0, 0, 0, 0, 17, 2, 24, 0, 90, 90, 2, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 0, 0, 0,
+ 68,172, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 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, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0,100, 0, 0, 0, 0, 0, 1, 0, 0, 0,128, 63, 0, 0, 0, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 2,224, 1, 60, 0, 32, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
+ 6, 0, 50, 0,141, 0,128, 7, 56, 4, 8, 0, 8, 0, 24, 0, 17, 0, 0, 0, 90, 0, 1, 0, 81, 0, 0, 0, 23, 0, 33, 0,
+ 2, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 8, 0, 24, 0, 10, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 24,174,200, 3, 0, 0, 0, 0, 24,174,200, 3, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 1, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 5, 0, 2, 0,
+ 1, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,116,109,112, 92, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0,
@@ -5374,7 +5394,6 @@ char datatoc_startup_blend[]= {
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,
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,
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,
- 31, 5, 0, 0, 12, 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, 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, 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, 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,
@@ -5387,6 +5406,7 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 5, 0, 0, 12, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0,
@@ -5398,459 +5418,471 @@ char datatoc_startup_blend[]= {
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,
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,
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,
- 0, 0, 0, 0, 0, 0, 0, 0,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 16, 0, 0, 0,128, 63, 0, 0,128, 63,
-173, 2, 95, 0,154,153,217, 63, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0,180, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66, 76, 69, 78, 68, 69, 82, 95, 82, 69, 78, 68, 69, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68,172, 0, 0, 0, 0,128, 63,102,166,171, 67, 0, 0,128, 63, 2, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 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, 0, 0, 0, 0,224,182, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-192,164,145, 77,130,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,131, 48, 5, 0, 0, 0, 0, 1, 0, 0, 0, 1, 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, 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,128, 2,224, 1, 60, 0,
- 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0,180, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 5, 0,205,204,204, 61,154,153,153, 62,205,204, 76, 62,219, 15, 73, 63,102,102,102, 63,
- 0, 0, 0, 64,154,153, 25, 63, 0, 0, 64, 65,102,102,166, 63, 0, 0, 0, 65, 0, 0,160, 65, 6, 0, 0, 0, 0, 0,192, 64,
- 0, 0,128, 63, 0, 0, 0, 0,205,204, 28, 65, 0, 0, 0, 0, 32, 0, 0, 0, 32, 0, 1, 0,128, 0, 5, 0,218, 0, 0, 0,
- 60, 0, 5, 0, 1, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,195,245, 28,193, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 25, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,128, 0, 0, 0,120,174, 45, 5, 0, 0, 0, 0,
- 9, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 72,175, 45, 5, 0, 0, 0, 0,144, 0, 0, 0, 1, 0, 0, 0,
-184,175, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,200, 1, 23, 1,
-120,198, 45, 5, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,184,175, 45, 5, 0, 0, 0, 0,144, 0, 0, 0, 1, 0, 0, 0,
- 40,176, 45, 5, 0, 0, 0, 0, 72,175, 45, 5, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0, 77, 2,226, 1,
- 8,206, 45, 5, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 40,176, 45, 5, 0, 0, 0, 0,144, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,184,175, 45, 5, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0,100, 0, 85, 1,
-216,191, 45, 5, 0, 0, 0, 0, 68, 65, 84, 65,232, 1, 0, 0,152,176, 45, 5, 0, 0, 0, 0,168, 0, 0, 0, 1, 0, 0, 0,
-200,178, 45, 5, 0, 0, 0, 0, 72,179, 45, 5, 0, 0, 0, 0,200,179, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 1, 0, 1, 0,205,204, 76, 63, 0, 0,180, 66, 9, 0, 1, 0, 0, 0,128, 63,111, 18,131, 58,205,204,204, 61,
- 0, 0, 1, 0, 32, 0, 32, 0, 32, 0, 1, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 1, 0, 0, 0,
- 0, 0, 0, 0, 2, 0, 80, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 5, 0, 5, 0,255,255,
- 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 66, 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,
- 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 66, 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 66,
- 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 66, 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 66,
- 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62, 0, 0, 0, 0,
- 1, 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, 0,128, 63, 10,215, 35, 60,205,204,204, 61, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,250, 0,205,204,204, 61,205,204,204, 61,
-102,102,166, 63, 0, 0,192, 63, 0, 0,240, 65, 72,225,122, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 67, 2, 0, 3, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 35, 0, 0, 0,204,197,121, 63, 0, 0, 0, 63, 35, 0, 0, 0,204,197,121, 63,
- 0, 0, 0, 63, 17, 0, 0, 0, 68, 65, 84, 65, 56, 0, 0, 0,200,178, 45, 5, 0, 0, 0, 0,165, 0, 0, 0, 1, 0, 0, 0,
- 8,116, 47, 5, 0, 0, 0, 0,168,148,145, 77,130,127, 0, 0,255,255,255,128, 1, 0, 0, 0, 18, 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, 68, 65, 84, 65, 56, 0, 0, 0,
- 72,179, 45, 5, 0, 0, 0, 0,165, 0, 0, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-200,200,255,128, 1, 0, 0, 0, 2, 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, 68, 65, 84, 65, 96, 0, 0, 0,200,179, 45, 5, 0, 0, 0, 0,163, 0, 0, 0, 1, 0, 0, 0,
-248,228, 47, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,100,100,128, 1, 0, 0, 0,128, 0, 0, 0, 1, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 0, 0,124, 7,231, 65,255, 74, 20, 65, 54, 86,123, 63, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,120, 0, 0, 0,120,180, 45, 5, 0, 0, 0, 0,150, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 76, 97,121,101,114, 0,114, 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, 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, 0, 0, 0,255,255, 15, 0, 0, 0, 0, 0,
-255,127, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 67, 65, 0, 0,200, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0,
- 22, 0, 0, 0, 1, 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, 0, 0, 0, 67, 65, 67, 97,109,101,114, 97, 0, 97,109,101,114, 97, 46, 48, 48, 49, 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, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 4, 0, 0, 0, 0, 63,205,204,204, 61, 0, 0,200, 66, 0, 0, 12, 66,161, 14,234, 64,
- 0, 0, 0, 63, 0, 0, 0, 66, 0, 0,144, 65, 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, 0, 0, 0, 0, 76, 65, 0, 0, 16, 2, 0, 0, 72,184, 45, 5, 0, 0, 0, 0,
- 36, 0, 0, 0, 1, 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, 0, 0, 0, 76, 65, 76, 97,109,112, 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, 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, 1, 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, 32, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,247,255,239, 65, 0, 0,150, 66,
-154,153, 25, 62, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,168,186, 45, 5, 0, 0, 0, 0, 2, 0, 0, 0, 46, 26,128, 63,
- 25, 4,240, 65, 0, 0, 52, 66, 0, 0,128, 63, 0, 0, 64, 64,205,204, 76, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 64, 11, 3, 0, 1, 0, 0, 0, 0, 2, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
-111, 18,131, 58, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
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,
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,
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,
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,
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,
- 0, 0, 0, 0, 0, 0, 0, 0,152,188, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 64, 1, 0, 0,
-168,186, 45, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 2, 0, 1, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,243, 4, 53,191,242, 4, 53, 63,242, 4, 53,191,243, 4, 53, 63,
- 56,188, 45, 5, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 56,188, 45, 5, 0, 0, 0, 0,
-118, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,152,188, 45, 5, 0, 0, 0, 0, 12, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 87, 79, 0, 0, 24, 2, 0, 0, 8,189, 45, 5, 0, 0, 0, 0,143, 0, 0, 0, 1, 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, 0, 0, 0, 87, 79, 87,111,114,108,100, 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,205,204, 76, 63,
+205,204, 76, 63,205,204, 76, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 16, 0, 0, 0,128, 63, 0, 0,128, 63,173, 2, 95, 0,154,153,217, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 4, 0, 1, 0,180, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 76, 69, 78,
+ 68, 69, 82, 95, 82, 69, 78, 68, 69, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,172, 0, 0,
+ 0, 0,128, 63,102,166,171, 67, 0, 0,128, 63, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 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, 0, 0, 0, 0, 48,209,117, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,149,158, 15, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 88, 87,171, 3, 0, 0, 0, 0, 1, 0, 0, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 2,224, 1, 60, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 4, 0, 1, 0,180, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 5, 0,
+205,204,204, 61,154,153,153, 62,205,204, 76, 62,219, 15, 73, 63,102,102,102, 63, 0, 0, 0, 64,154,153, 25, 63, 0, 0, 64, 65,
+102,102,166, 63, 0, 0, 0, 65, 0, 0,160, 65, 6, 0, 0, 0, 0, 0,192, 64, 0, 0,128, 63, 0, 0, 0, 0,205,204, 28, 65,
+ 0, 0, 0, 0, 32, 0, 0, 0, 32, 0, 1, 0,128, 0, 5, 0,218, 0, 0, 0, 60, 0, 5, 0, 1, 0, 5, 0, 0, 0, 0, 0,
+ 0, 0, 0, 64, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,195,245, 28,193,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,128, 0, 0, 0, 24,173,200, 3, 0, 0, 0, 0, 9, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-114, 99, 80, 61,114, 99, 80, 61,114, 99, 80, 61,199, 54, 36, 60,199, 54, 36, 60,199, 54, 36, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
-205,204, 28, 65, 0, 0, 0, 0, 0, 0, 32, 0,128, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 64,
- 0, 0,200, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0,
- 0, 0,112, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0,128, 63,205,204, 76, 61,
- 0, 0, 5, 0, 0, 0, 0, 0, 10,215,163, 59, 0, 0, 0, 0, 0, 0,128, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 1, 0, 0, 0, 2, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 0, 0, 0, 40,117,216, 3, 0, 0, 0, 0,143, 0, 0, 0, 1, 0, 0, 0,216,117,216, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,232, 1, 20, 1,184,219,217, 3, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 0, 0, 0,216,117,216, 3, 0, 0, 0, 0,143, 0, 0, 0, 1, 0, 0, 0,136,118,216, 3, 0, 0, 0, 0, 40,117,216, 3,
+ 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0,118, 2,238, 1,168,225,217, 3, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 0, 0, 0,136,118,216, 3, 0, 0, 0, 0,143, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216,117,216, 3,
+ 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0,108, 0, 86, 1,200,213,217, 3, 0, 0, 0, 0, 68, 65, 84, 65,
+232, 1, 0, 0, 8,207,217, 3, 0, 0, 0, 0,167, 0, 0, 0, 1, 0, 0, 0,216,202,207, 3, 0, 0, 0, 0,152,203,207, 3,
+ 0, 0, 0, 0,168, 1,211, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 1, 0, 1, 0,205,204, 76, 63,
+ 0, 0,180, 66, 9, 0, 1, 0, 0, 0,128, 63,111, 18,131, 58,205,204,204, 61, 0, 0, 1, 0, 32, 0, 32, 0, 32, 0, 1, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,232, 10,219, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 80, 0, 0, 2, 0, 2,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 5, 0, 5, 0,255,255, 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 72, 66, 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 72, 66, 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 66, 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 72, 66, 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 66, 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62, 0, 0, 0, 0, 1, 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, 0,128, 63, 10,215, 35, 60,205,204,204, 61,
+ 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,250, 0,205,204,204, 61,205,204,204, 61,102,102,166, 63, 0, 0,192, 63, 0, 0,240, 65,
+ 72,225,122, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 67, 2, 0, 3, 2, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0,
+ 35, 0, 0, 0,204,197,121, 63, 0, 0, 0, 63, 35, 0, 0, 0,204,197,121, 63, 0, 0, 0, 63, 17, 0, 0, 0, 68, 65, 84, 65,
+ 56, 0, 0, 0,216,202,207, 3, 0, 0, 0, 0,164, 0, 0, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,255,255,255,128, 1, 0, 0, 0, 18, 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, 68, 65, 84, 65, 56, 0, 0, 0,152,203,207, 3, 0, 0, 0, 0,164, 0, 0, 0,
+ 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,200,255,128, 1, 0, 0, 0, 2, 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, 68, 65, 84, 65,
+ 96, 0, 0, 0,168, 1,211, 3, 0, 0, 0, 0,162, 0, 0, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0,120, 58,171, 3,
+ 0, 0, 0, 0,255,100,100,128, 1, 0, 0, 0,128, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,155, 9, 25, 67,
+190, 23,237, 64, 75, 1,147, 63, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,120, 0, 0, 0, 24,174,200, 3,
+ 0, 0, 0, 0,149, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,
+101,114, 76, 97,121,101,114, 0,114, 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, 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, 0, 0, 0,255,255, 15, 0, 0, 0, 0, 0,255,127, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,
+ 0, 0, 0, 0, 67, 65, 0, 0,200, 0, 0, 0, 24, 98,200, 3, 0, 0, 0, 0, 22, 0, 0, 0, 1, 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, 0, 0, 0, 67, 65, 67, 97,
+109,101,114, 97, 0, 97,109,101,114, 97, 46, 48, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 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, 4, 0,
+ 0, 0, 0, 63,205,204,204, 61, 0, 0,200, 66, 0, 0, 12, 66,161, 14,234, 64, 0, 0, 0, 63, 0, 0, 0, 66, 0, 0,144, 65,
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,
+ 0, 0, 0, 0, 76, 65, 0, 0, 16, 2, 0, 0,120,209,217, 3, 0, 0, 0, 0, 36, 0, 0, 0, 1, 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, 0, 0, 0, 76, 65, 76, 97,
+109,112, 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, 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,
-104,191, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,104,191, 45, 5, 0, 0, 0, 0,
- 12, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0,112, 5, 0, 0,216,191, 45, 5, 0, 0, 0, 0,
-130, 0, 0, 0, 1, 0, 0, 0,120,198, 45, 5, 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, 79, 66, 67, 97,109,101,114, 97, 0, 97,109,101,114, 97, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0,
+ 1, 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, 32, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,247,255,239, 65, 0, 0,150, 66,154,153, 25, 62, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 8,212,217, 3, 0, 0, 0, 0, 2, 0, 0, 0, 46, 26,128, 63, 25, 4,240, 65, 0, 0, 52, 66, 0, 0,128, 63,
+ 0, 0, 64, 64,205,204, 76, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 11, 3, 0, 1, 0, 0, 0, 0, 2, 1, 0,
+ 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,111, 18,131, 58, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 64,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 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, 11, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,119,216, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 64, 1, 0, 0, 8,212,217, 3, 0, 0, 0, 0,119, 1, 0, 0,
+ 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 2, 0, 1, 0, 0, 0,128, 67, 0, 0, 0, 0,
+ 0, 0,128, 63,243, 4, 53,191,242, 4, 53, 63,242, 4, 53,191,243, 4, 53, 63, 40, 67,201, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,183, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0,250, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 6, 0, 0, 0,
- 1, 0, 0, 0,250, 0, 0, 0, 10, 0, 0, 0, 10, 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, 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, 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, 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,110,101,239, 64,150, 62,208,192, 78,255,170, 64, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 42,254,141, 63,192, 57, 49, 60, 34,159, 80, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,222,149, 47, 63, 53, 70, 58, 63,222, 56, 49,188, 0, 0, 0, 0, 86,126,162,190,227,251,159, 62,
- 55, 53,101, 63, 0, 0, 0, 0, 7,165, 39, 63,149, 84, 28,191, 51,247,227, 62, 0, 0, 0, 0,110,101,239, 64,150, 62,208,192,
- 78,255,170, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 1, 0,128, 63, 1, 0,128, 51, 1, 0, 0,179, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0,128, 63,
- 1, 0,128, 51, 0, 0, 0, 0, 2, 0, 0,179, 2, 0, 0,167, 1, 0,128, 63, 0, 0, 0, 0, 1, 0, 0, 53, 1, 0, 0, 41,
- 1, 0,128,168, 0, 0,128, 63,221,149, 47, 63, 86,126,162,190, 8,165, 39, 63, 0, 0, 0, 0, 51, 70, 58, 63,225,251,159, 62,
-149, 84, 28,191, 0, 0, 0, 0,192, 56, 49,188, 55, 53,101, 63, 52,247,227, 62, 0, 0, 0, 0, 90, 38,173,190, 0,222,192,190,
-152, 9, 52,193, 0, 0,128, 63, 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, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63,
-187,225, 16, 63, 0, 0,128, 63,205,204,204, 62,237, 54, 32, 63, 0, 0, 0, 0,143,194,117, 61, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 1, 0, 0,128, 63, 0, 0,128, 63, 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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 40, 67,201, 3, 0, 0, 0, 0,117, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 56,119,216, 3,
+ 0, 0, 0, 0, 12, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 79, 0, 0, 24, 2, 0, 0, 24, 51,163, 3,
+ 0, 0, 0, 0,142, 0, 0, 0, 1, 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, 0, 0, 0, 87, 79, 87,111,114,108,100, 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, 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, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0,114, 99, 80, 61,114, 99, 80, 61,114, 99, 80, 61,
+199, 54, 36, 60,199, 54, 36, 60,199, 54, 36, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,205,204, 28, 65, 0, 0, 0, 0, 0, 0, 32, 0,
+128, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 64, 0, 0,200, 65, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0,112, 65, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0,128, 63,205,204, 76, 61, 0, 0, 5, 0, 0, 0, 0, 0, 10,215,163, 59,
+ 0, 0, 0, 0, 0, 0,128, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 1, 0, 0, 0, 2, 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, 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,152,197, 45, 5, 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, 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, 0, 0, 0, 0,
- 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,152, 0, 0, 0,
-152,197, 45, 5, 0, 0, 0, 0,133, 0, 0, 0, 1, 0, 0, 0, 0,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 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, 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,205,204,204, 61,205,204, 76, 62, 10,215,163, 60, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 2, 0, 0, 0, 79, 66, 0, 0,112, 5, 0, 0,120,198, 45, 5, 0, 0, 0, 0,130, 0, 0, 0, 1, 0, 0, 0,
- 8,206, 45, 5, 0, 0, 0, 0,216,191, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 79, 66, 67,117, 98,101, 0,112,104,101,114,101, 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, 0, 0, 0, 0, 0, 0, 0, 0,232,119,216, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,232,119,216, 3, 0, 0, 0, 0, 12, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 79, 66, 0, 0,112, 5, 0, 0,200,213,217, 3, 0, 0, 0, 0,129, 0, 0, 0, 1, 0, 0, 0,184,219,217, 3,
+ 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, 79, 66, 67, 97,
+109,101,114, 97, 0, 97,109,101,114, 97, 46, 48, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 4, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 4, 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, 11, 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, 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, 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, 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, 0, 0, 0,248,139,141, 77,130,127, 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, 8, 30, 47, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0,
- 10, 0, 0, 0, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 6, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0,
- 10, 0, 0, 0, 10, 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, 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, 24, 98,200, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0, 10, 0, 0, 0,
+ 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 6, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0, 10, 0, 0, 0,
+ 10, 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, 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, 0, 0, 0, 0, 0, 0, 0,184,205, 45, 5, 0, 0, 0, 0,136,204, 45, 5, 0, 0, 0, 0, 1, 0, 0, 0, 1, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 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,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 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,110,101,239, 64,
+150, 62,208,192, 78,255,170, 64, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 42,254,141, 63,192, 57, 49, 60, 34,159, 80, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,222,149, 47, 63,
+ 53, 70, 58, 63,222, 56, 49,188, 0, 0, 0, 0, 86,126,162,190,227,251,159, 62, 55, 53,101, 63, 0, 0, 0, 0, 7,165, 39, 63,
+149, 84, 28,191, 51,247,227, 62, 0, 0, 0, 0,110,101,239, 64,150, 62,208,192, 78,255,170, 64, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 1, 0,128, 63,
+ 1, 0,128, 51, 1, 0, 0,179, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0,128, 63, 1, 0,128, 51, 0, 0, 0, 0, 2, 0, 0,179,
+ 2, 0, 0,167, 1, 0,128, 63, 0, 0, 0, 0, 1, 0, 0, 53, 1, 0, 0, 41, 1, 0,128,168, 0, 0,128, 63,221,149, 47, 63,
+ 86,126,162,190, 8,165, 39, 63, 0, 0, 0, 0, 51, 70, 58, 63,225,251,159, 62,149, 84, 28,191, 0, 0, 0, 0,192, 56, 49,188,
+ 55, 53,101, 63, 52,247,227, 62, 0, 0, 0, 0, 90, 38,173,190, 0,222,192,190,152, 9, 52,193, 0, 0,128, 63, 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, 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, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63,187,225, 16, 63, 0, 0,128, 63,205,204,204, 62,
+237, 54, 32, 63, 0, 0, 0, 0,143,194,117, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 2, 0, 1, 0, 0,128, 63, 0, 0,128, 63, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 68, 0, 0, 0, 7, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63,169, 19,208, 60, 0, 0,128, 63,
-205,204,204, 62,229,208, 34, 62, 0, 0, 0, 0,143,194,117, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 5, 0, 1, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 64, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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,248, 40,215, 3, 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, 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,216,204, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,215,140, 77,130,127, 0, 0,
- 56, 36,149, 77,130,127, 0, 0, 25, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 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, 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, 68, 65, 84, 65, 8, 0, 0, 0,184,205, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 4, 0, 0, 0,136,204, 45, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,152, 0, 0, 0,216,204, 45, 5, 0, 0, 0, 0,133, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,152, 0, 0, 0,248, 40,215, 3, 0, 0, 0, 0,132, 0, 0, 0,
1, 0, 0, 0, 0,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
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,
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,205,204,204, 61,
205,204, 76, 62, 10,215,163, 60, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 79, 66, 0, 0,
-112, 5, 0, 0, 8,206, 45, 5, 0, 0, 0, 0,130, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,198, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 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, 2, 0, 0, 0, 79, 66, 0, 0,
+112, 5, 0, 0,184,219,217, 3, 0, 0, 0, 0,129, 0, 0, 0, 1, 0, 0, 0,168,225,217, 3, 0, 0, 0, 0,200,213,217, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 67,117, 98,101, 0,112,104,101,114,101,
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,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 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, 10, 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, 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, 1, 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, 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, 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, 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, 72,184, 45, 5,
+ 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,232,107,205, 15,
+ 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,136, 48,218, 3,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0, 1, 0, 6, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0, 10, 0, 0, 0, 10, 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, 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, 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, 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,154,112,130, 64,183,178,128, 63,112,236,188, 64,
+ 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,136, 12,217, 3,
+ 0, 0, 0, 0,168,182,117, 3, 0, 0, 0, 0, 1, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,229,123, 38, 63,
- 87, 43, 98, 61,229,229,238, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54,236,148,190, 25,134,116, 63,236, 13, 98,189,
- 0, 0, 0, 0,221,102, 69,191, 57,174, 76,190, 34,194, 26, 63, 0, 0, 0, 0, 37,255, 16, 63,241,161, 95, 62,164,111, 75, 63,
- 0, 0, 0, 0,154,112,130, 64,183,178,128, 63,112,236,188, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 1, 0,128, 50, 0, 0, 0,179,
- 0, 0, 0, 0, 1, 0,128, 50, 1, 0,128, 63, 1, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 1, 0, 0, 39, 1, 0, 0, 52, 1, 0,128, 39, 0, 0,128, 63, 54,236,148,190,221,102, 69,191, 38,255, 16, 63,
- 0, 0, 0, 0, 24,134,116, 63, 57,174, 76,190,239,161, 95, 62, 0, 0, 0, 0,237, 13, 98,189, 35,194, 26, 63,166,111, 75, 63,
- 0, 0, 0, 0,209, 19, 13, 63,241, 65,102,190, 10, 10,231,192, 0, 0,128, 63, 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, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0,
- 0, 0, 0, 0, 5, 0, 1, 0, 0, 0, 68, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 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, 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, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 68, 0, 0, 0, 7, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0,
0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63,169, 19,208, 60, 0, 0,128, 63,205,204,204, 62,229,208, 34, 62, 0, 0, 0, 0,
143,194,117, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 5, 0, 1, 0, 0,128, 63,
0, 0,128, 63, 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, 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, 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, 0, 64, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 64, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 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, 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,200,211, 45, 5, 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, 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, 24, 42,215, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,243,206, 3, 0, 0, 0, 0,136,250,206, 3, 0, 0, 0, 0, 25, 0, 0, 38,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65,152, 0, 0, 0,200,211, 45, 5, 0, 0, 0, 0,133, 0, 0, 0, 1, 0, 0, 0, 0,192, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0,136, 12,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 4, 0, 0, 0,168,182,117, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,152, 0, 0, 0, 24, 42,215, 3, 0, 0, 0, 0,132, 0, 0, 0, 1, 0, 0, 0, 0,192, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 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, 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,205,204,204, 61,205,204, 76, 62, 10,215,163, 60,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,204,204, 61,205,204, 76, 62, 10,215,163, 60, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 79, 66, 0, 0,112, 5, 0, 0,168,225,217, 3, 0, 0, 0, 0,
+129, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184,219,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 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, 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, 1, 0, 0, 4, 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, 10, 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, 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, 2, 0, 0, 0, 77, 65, 0, 0,128, 3, 0, 0,168,212, 45, 5,
- 0, 0, 0, 0, 39, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 8, 90, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65, 77, 97,116,101,114,105, 97,108, 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, 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, 1, 0, 0, 0, 51, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,205,204, 76, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 10,215, 35, 60, 0, 0, 0, 0, 0, 0, 8, 0, 1, 0, 50, 0,205,204, 76, 62, 0, 0,128, 63, 0, 0,128, 63,
-205,204, 76, 62, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0,
- 0, 0,160, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 2, 0, 2, 0, 50, 0, 0, 6, 0, 0,128, 63, 0, 0,128, 63,
- 18, 0, 18, 0, 10,215,163, 59, 10,215,163, 59, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 4, 0, 67, 0, 64, 3, 67, 0, 64, 3,
- 1, 0, 4, 0, 12, 0, 4, 0, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0,128, 64, 0, 0, 0, 63,205,204,204, 61,
- 0, 0, 0, 63,205,204,204, 61,205,204,204, 61, 0, 0,128, 63, 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,128, 63, 0, 0,128, 63,120,216, 45, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,209,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0,250, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 6, 0, 0, 0,
+ 1, 0, 0, 0,250, 0, 0, 0, 10, 0, 0, 0, 10, 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, 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, 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, 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,154,112,130, 64,183,178,128, 63,112,236,188, 64, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,229,123, 38, 63, 87, 43, 98, 61,229,229,238, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 54,236,148,190, 25,134,116, 63,236, 13, 98,189, 0, 0, 0, 0,221,102, 69,191, 57,174, 76,190,
+ 34,194, 26, 63, 0, 0, 0, 0, 37,255, 16, 63,241,161, 95, 62,164,111, 75, 63, 0, 0, 0, 0,154,112,130, 64,183,178,128, 63,
+112,236,188, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 1, 0,128, 50, 0, 0, 0,179, 0, 0, 0, 0, 1, 0,128, 50, 1, 0,128, 63,
+ 1, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 1, 0, 0, 39, 1, 0, 0, 52,
+ 1, 0,128, 39, 0, 0,128, 63, 54,236,148,190,221,102, 69,191, 38,255, 16, 63, 0, 0, 0, 0, 24,134,116, 63, 57,174, 76,190,
+239,161, 95, 62, 0, 0, 0, 0,237, 13, 98,189, 35,194, 26, 63,166,111, 75, 63, 0, 0, 0, 0,209, 19, 13, 63,241, 65,102,190,
+ 10, 10,231,192, 0, 0,128, 63, 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, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 0, 0, 68, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63,
+169, 19,208, 60, 0, 0,128, 63,205,204,204, 62,229,208, 34, 62, 0, 0, 0, 0,143,194,117, 61, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 5, 0, 1, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 0, 0, 0, 0,248,217, 45, 5,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63,111,148, 26, 63,111,148, 26, 63,111,148, 26, 63,205,204, 76, 61,205,204,204, 61,102,102,166, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0,120,216, 45, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,123, 46, 5, 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, 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, 0, 0, 0, 0, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 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, 64, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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,200,231,217, 3, 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, 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, 0, 0, 0, 0,
+ 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,152, 0, 0, 0,
+200,231,217, 3, 0, 0, 0, 0,132, 0, 0, 0, 1, 0, 0, 0, 0,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 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, 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,205,204,204, 61,205,204, 76, 62, 10,215,163, 60, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 2, 0, 0, 0, 77, 65, 0, 0,128, 3, 0, 0,152, 7,218, 3, 0, 0, 0, 0, 39, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 8, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 77, 65, 77, 97,116,101,114,105, 97,108, 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, 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, 1, 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, 1, 0,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,205,204, 76, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 10,215, 35, 60, 0, 0, 0, 0,
+ 0, 0, 8, 0, 1, 0, 50, 0,205,204, 76, 62, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 16, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 2, 0, 2, 0, 50, 0, 0, 6, 0, 0,128, 63, 0, 0,128, 63, 18, 0, 18, 0, 10,215,163, 59, 10,215,163, 59,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 4, 0, 67, 0, 64, 3, 67, 0, 64, 3, 1, 0, 4, 0, 12, 0, 4, 0, 0, 0, 0, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 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,
+ 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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 63, 0, 0,128, 64, 0, 0, 0, 63,205,204,204, 61, 0, 0, 0, 63,205,204,204, 61,205,204,204, 61,
+ 0, 0,128, 63, 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,128, 63, 0, 0,128, 63,152, 11,218, 3, 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, 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, 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, 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, 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, 0, 0, 0, 0,152,120,216, 3, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,111,148, 26, 63,
+111,148, 26, 63,111,148, 26, 63,205,204, 76, 61,205,204,204, 61,102,102,166, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0,152, 11,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,216, 29,218, 3, 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, 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, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 40, 0, 0, 0,248,217, 45, 5, 0, 0, 0, 0, 12, 0, 0, 0, 1, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 0, 53, 0, 53, 0,104,218, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 16, 0, 0,104,218, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 2, 2, 2, 51, 2, 2, 2, 51, 6, 6, 6,153, 6, 6, 6,153, 6, 6, 6,153, 4, 4, 4,102, 3, 3, 3,102,
- 2, 2, 2, 51, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 51, 8, 8, 8,153,
- 11, 11, 11,204, 13, 13, 13,255, 12, 12, 12,255, 12, 12, 12,255, 11, 11, 11,255, 10, 10, 10,255, 10, 10, 10,255, 9, 9, 9,255,
- 9, 9, 9,255, 9, 9, 9,255, 4, 4, 4,102, 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, 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, 0, 0, 0, 0, 3, 3, 3, 51, 10, 10, 10,153, 18, 18, 18,255, 20, 20, 20,255,
- 22, 22, 22,255, 23, 23, 23,255, 22, 22, 22,255, 20, 20, 20,255, 19, 19, 19,255, 16, 16, 16,255, 14, 14, 14,255, 11, 11, 11,255,
- 10, 10, 10,255, 9, 9, 9,255, 9, 9, 9,255, 9, 9, 9,255, 8, 8, 8,204, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7,102, 19, 19, 19,204, 27, 27, 27,255, 31, 31, 31,255, 32, 32, 32,255,
- 33, 33, 33,255, 33, 33, 33,255, 31, 31, 31,255, 30, 30, 30,255, 27, 27, 27,255, 25, 25, 25,255, 22, 22, 22,255, 19, 19, 19,255,
- 16, 16, 16,255, 12, 12, 12,255, 10, 10, 10,255, 10, 10, 10,255, 10, 10, 10,255, 10, 10, 10,255, 4, 4, 4,102, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 13, 13,153, 29, 29, 29,255, 37, 37, 37,255, 40, 40, 40,255, 42, 42, 42,255, 42, 42, 42,255,
- 43, 43, 43,255, 41, 41, 41,255, 40, 40, 40,255, 38, 38, 38,255, 36, 36, 36,255, 33, 33, 33,255, 30, 30, 30,255, 27, 27, 27,255,
- 24, 24, 24,255, 20, 20, 20,255, 16, 16, 16,255, 12, 12, 12,255, 10, 10, 10,255, 10, 10, 10,255, 10, 10, 10,255, 7, 7, 7,153,
- 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,
- 0, 0, 0, 0, 13, 13, 13,102, 37, 37, 37,255, 44, 44, 44,255, 48, 48, 48,255, 50, 50, 50,255, 51, 51, 51,255, 51, 51, 51,255,
- 50, 50, 50,255, 49, 49, 49,255, 48, 48, 48,255, 45, 45, 45,255, 43, 43, 43,255, 41, 41, 41,255, 37, 37, 37,255, 34, 34, 34,255,
- 31, 31, 31,255, 28, 28, 28,255, 24, 24, 24,255, 20, 20, 20,255, 15, 15, 15,255, 11, 11, 11,255, 10, 10, 10,255, 11, 11, 11,255,
- 7, 7, 7,153, 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,
- 13, 13, 13,102, 41, 41, 41,255, 50, 50, 50,255, 54, 54, 54,255, 57, 57, 57,255, 58, 58, 58,255, 59, 59, 59,255, 59, 59, 59,255,
- 58, 58, 58,255, 57, 57, 57,255, 55, 55, 55,255, 53, 53, 53,255, 51, 51, 51,255, 48, 48, 48,255, 45, 45, 45,255, 41, 41, 41,255,
- 38, 38, 38,255, 35, 35, 35,255, 31, 31, 31,255, 27, 27, 27,255, 23, 23, 23,255, 17, 17, 17,255, 12, 12, 12,255, 11, 11, 11,255,
- 11, 11, 11,255, 5, 5, 5,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 36, 36, 36,204, 53, 53, 53,255, 59, 59, 59,255, 63, 63, 63,255, 65, 65, 65,255, 66, 66, 66,255, 66, 66, 66,255, 66, 66, 66,255,
- 65, 65, 65,255, 64, 64, 64,255, 62, 62, 62,255, 60, 60, 60,255, 57, 57, 57,255, 54, 54, 54,255, 51, 51, 51,255, 48, 48, 48,255,
- 44, 44, 44,255, 41, 41, 41,255, 37, 37, 37,255, 33, 33, 33,255, 29, 29, 29,255, 24, 24, 24,255, 19, 19, 19,255, 13, 13, 13,255,
- 11, 11, 11,255, 12, 12, 12,255, 3, 3, 3, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 19, 19,102,
- 56, 56, 56,255, 64, 64, 64,255, 68, 68, 68,255, 71, 71, 71,255, 73, 73, 73,255, 74, 74, 74,255, 74, 74, 74,255, 73, 73, 73,255,
- 72, 72, 72,255, 71, 71, 71,255, 69, 69, 69,255, 67, 67, 67,255, 64, 64, 64,255, 61, 61, 61,255, 58, 58, 58,255, 54, 54, 54,255,
- 50, 50, 50,255, 47, 47, 47,255, 43, 43, 43,255, 39, 39, 39,255, 34, 34, 34,255, 30, 30, 30,255, 25, 25, 25,255, 19, 19, 19,255,
- 13, 13, 13,255, 12, 12, 12,255, 10, 10, 10,204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 54, 54,255,
- 66, 66, 66,255, 72, 72, 72,255, 77, 77, 77,255, 79, 79, 79,255, 81, 81, 81,255, 81, 81, 81,255, 81, 81, 81,255, 80, 80, 80,255,
- 79, 79, 79,255, 77, 77, 77,255, 75, 75, 75,255, 73, 73, 73,255, 70, 70, 70,255, 67, 67, 67,255, 63, 63, 63,255, 60, 60, 60,255,
- 56, 56, 56,255, 52, 52, 52,255, 49, 49, 49,255, 44, 44, 44,255, 40, 40, 40,255, 35, 35, 35,255, 30, 30, 30,255, 24, 24, 24,255,
- 18, 18, 18,255, 12, 12, 12,255, 12, 12, 12,255, 6, 6, 6,102, 0, 0, 0, 0, 0, 0, 0, 0, 22, 22, 22,102, 67, 67, 67,255,
- 76, 76, 76,255, 81, 81, 81,255, 84, 84, 84,255, 87, 87, 87,255, 88, 88, 88,255, 88, 88, 88,255, 88, 88, 88,255, 87, 87, 87,255,
- 86, 86, 86,255, 84, 84, 84,255, 82, 82, 82,255, 79, 79, 79,255, 76, 76, 76,255, 73, 73, 73,255, 69, 69, 69,255, 65, 65, 65,255,
- 62, 62, 62,255, 58, 58, 58,255, 54, 54, 54,255, 49, 49, 49,255, 45, 45, 45,255, 40, 40, 40,255, 35, 35, 35,255, 29, 29, 29,255,
- 23, 23, 23,255, 16, 16, 16,255, 12, 12, 12,255, 12, 12, 12,204, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49,204, 76, 76, 76,255,
- 84, 84, 84,255, 89, 89, 89,255, 92, 92, 92,255, 94, 94, 94,255, 95, 95, 95,255, 95, 95, 95,255, 95, 95, 95,255, 94, 94, 94,255,
- 93, 93, 93,255, 91, 91, 91,255, 88, 88, 88,255, 85, 85, 85,255, 82, 82, 82,255, 79, 79, 79,255, 75, 75, 75,255, 71, 71, 71,255,
- 67, 67, 67,255, 63, 63, 63,255, 59, 59, 59,255, 55, 55, 55,255, 50, 50, 50,255, 45, 45, 45,255, 40, 40, 40,255, 34, 34, 34,255,
- 28, 28, 28,255, 21, 21, 21,255, 13, 13, 13,255, 14, 14, 14,255, 0, 0, 0, 0, 14, 14, 14,102, 70, 70, 70,255, 85, 85, 85,255,
- 92, 92, 92,255, 97, 97, 97,255,100,100,100,255,102,102,102,255,102,102,102,255,103,103,103,255,102,102,102,255,101,101,101,255,
- 99, 99, 99,255, 97, 97, 97,255, 94, 94, 94,255, 91, 91, 91,255, 88, 88, 88,255, 84, 84, 84,255, 81, 81, 81,255, 77, 77, 77,255,
- 72, 72, 72,255, 68, 68, 68,255, 64, 64, 64,255, 59, 59, 59,255, 55, 55, 55,255, 50, 50, 50,255, 44, 44, 44,255, 39, 39, 39,255,
- 32, 32, 32,255, 25, 25, 25,255, 17, 17, 17,255, 13, 13, 13,255, 7, 7, 7,102, 24, 24, 24,102, 80, 80, 80,255, 93, 93, 93,255,
-100,100,100,255,104,104,104,255,107,107,107,255,109,109,109,255,109,109,109,255,109,109,109,255,109,109,109,255,107,107,107,255,
-106,106,106,255,103,103,103,255,100,100,100,255, 97, 97, 97,255, 94, 94, 94,255, 90, 90, 90,255, 86, 86, 86,255, 82, 82, 82,255,
- 77, 77, 77,255, 73, 73, 73,255, 69, 69, 69,255, 64, 64, 64,255, 59, 59, 59,255, 54, 54, 54,255, 49, 49, 49,255, 43, 43, 43,255,
- 36, 36, 36,255, 29, 29, 29,255, 21, 21, 21,255, 14, 14, 14,255, 10, 10, 10,153, 29, 29, 29,102, 89, 89, 89,255,100,100,100,255,
-107,107,107,255,112,112,112,255,114,114,114,255,116,116,116,255,116,116,116,255,116,116,116,255,115,115,115,255,114,114,114,255,
-112,112,112,255,110,110,110,255,107,107,107,255,104,104,104,255,100,100,100,255, 96, 96, 96,255, 92, 92, 92,255, 87, 87, 87,255,
- 83, 83, 83,255, 78, 78, 78,255, 73, 73, 73,255, 68, 68, 68,255, 63, 63, 63,255, 58, 58, 58,255, 52, 52, 52,255, 46, 46, 46,255,
- 40, 40, 40,255, 33, 33, 33,255, 24, 24, 24,255, 17, 17, 17,255, 13, 13, 13,204, 46, 46, 46,153, 95, 95, 95,255,107,107,107,255,
-114,114,114,255,118,118,118,255,121,121,121,255,122,122,122,255,123,123,123,255,123,123,123,255,122,122,122,255,122,122,122,255,
-120,120,120,255,118,118,118,255,114,114,114,255,110,110,110,255,106,106,106,255,101,101,101,255, 97, 97, 97,255, 92, 92, 92,255,
- 87, 87, 87,255, 83, 83, 83,255, 78, 78, 78,255, 73, 73, 73,255, 68, 68, 68,255, 62, 62, 62,255, 56, 56, 56,255, 50, 50, 50,255,
- 44, 44, 44,255, 36, 36, 36,255, 28, 28, 28,255, 19, 19, 19,255, 12, 12, 12,204, 47, 47, 47,153,101,101,101,255,113,113,113,255,
-120,120,120,255,125,125,125,255,127,127,127,255,129,129,129,255,130,130,130,255,130,130,130,255,131,131,131,255,131,131,131,255,
-131,131,131,255,129,129,129,255,125,125,125,255,120,120,120,255,113,113,113,255,108,108,108,255,103,103,103,255, 97, 97, 97,255,
- 92, 92, 92,255, 87, 87, 87,255, 82, 82, 82,255, 77, 77, 77,255, 72, 72, 72,255, 66, 66, 66,255, 60, 60, 60,255, 54, 54, 54,255,
- 47, 47, 47,255, 39, 39, 39,255, 31, 31, 31,255, 22, 22, 22,255, 12, 12, 12,204, 48, 48, 48,153,106,106,106,255,118,118,118,255,
-126,126,126,255,131,131,131,255,134,134,134,255,135,135,135,255,137,137,137,255,138,138,138,255,142,142,142,255,147,147,147,255,
-149,149,149,255,148,148,148,255,142,142,142,255,133,133,133,255,124,124,124,255,115,115,115,255,108,108,108,255,102,102,102,255,
- 97, 97, 97,255, 92, 92, 92,255, 87, 87, 87,255, 81, 81, 81,255, 75, 75, 75,255, 69, 69, 69,255, 63, 63, 63,255, 57, 57, 57,255,
- 49, 49, 49,255, 42, 42, 42,255, 33, 33, 33,255, 24, 24, 24,255, 9, 9, 9,153, 32, 32, 32,102,109,109,109,255,123,123,123,255,
-131,131,131,255,136,136,136,255,140,140,140,255,142,142,142,255,144,144,144,255,148,148,148,255,156,156,156,255,168,168,168,255,
-176,176,176,255,177,177,177,255,168,168,168,255,153,153,153,255,137,137,137,255,124,124,124,255,114,114,114,255,107,107,107,255,
-101,101,101,255, 96, 96, 96,255, 90, 90, 90,255, 85, 85, 85,255, 79, 79, 79,255, 72, 72, 72,255, 66, 66, 66,255, 59, 59, 59,255,
- 52, 52, 52,255, 44, 44, 44,255, 35, 35, 35,255, 26, 26, 26,255, 10, 10, 10,153, 17, 17, 17, 51,110,110,110,255,127,127,127,255,
-136,136,136,255,142,142,142,255,145,145,145,255,148,148,148,255,151,151,151,255,159,159,159,255,174,174,174,255,195,195,195,255,
-212,212,212,255,216,216,216,255,204,204,204,255,179,179,179,255,154,154,154,255,135,135,135,255,121,121,121,255,112,112,112,255,
-106,106,106,255, 99, 99, 99,255, 94, 94, 94,255, 88, 88, 88,255, 82, 82, 82,255, 76, 76, 76,255, 69, 69, 69,255, 62, 62, 62,255,
- 54, 54, 54,255, 46, 46, 46,255, 37, 37, 37,255, 26, 26, 26,255, 6, 6, 6,102, 0, 0, 0, 0,107,107,107,255,130,130,130,255,
-140,140,140,255,146,146,146,255,150,150,150,255,153,153,153,255,158,158,158,255,169,169,169,255,191,191,191,255,219,219,219,255,
-246,246,246,255,254,254,254,255,237,237,237,255,204,204,204,255,170,170,170,255,145,145,145,255,127,127,127,255,117,117,117,255,
-110,110,110,255,103,103,103,255, 97, 97, 97,255, 91, 91, 91,255, 85, 85, 85,255, 78, 78, 78,255, 71, 71, 71,255, 64, 64, 64,255,
- 55, 55, 55,255, 47, 47, 47,255, 37, 37, 37,255, 25, 25, 25,255, 3, 3, 3, 51, 0, 0, 0, 0, 65, 65, 65,153,129,129,129,255,
-142,142,142,255,149,149,149,255,154,154,154,255,158,158,158,255,163,163,163,255,176,176,176,255,199,199,199,255,232,232,232,255,
-255,255,255,255,255,255,255,255,255,255,255,255,220,220,220,255,181,181,181,255,151,151,151,255,132,132,132,255,121,121,121,255,
-113,113,113,255,106,106,106,255,100,100,100,255, 94, 94, 94,255, 87, 87, 87,255, 80, 80, 80,255, 73, 73, 73,255, 65, 65, 65,255,
- 57, 57, 57,255, 48, 48, 48,255, 38, 38, 38,255, 16, 16, 16,153, 0, 0, 0, 0, 0, 0, 0, 0, 21, 21, 21, 51,127,127,127,255,
-143,143,143,255,152,152,152,255,157,157,157,255,161,161,161,255,165,165,165,255,177,177,177,255,198,198,198,255,227,227,227,255,
-253,253,253,255,255,255,255,255,250,250,250,255,217,217,217,255,181,181,181,255,153,153,153,255,135,135,135,255,124,124,124,255,
-117,117,117,255,110,110,110,255,103,103,103,255, 96, 96, 96,255, 89, 89, 89,255, 82, 82, 82,255, 74, 74, 74,255, 66, 66, 66,255,
- 57, 57, 57,255, 48, 48, 48,255, 35, 35, 35,255, 10, 10, 10,153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 93, 93,204,
-141,141,141,255,153,153,153,255,159,159,159,255,163,163,163,255,167,167,167,255,174,174,174,255,188,188,188,255,209,209,209,255,
-228,228,228,255,234,234,234,255,224,224,224,255,200,200,200,255,173,173,173,255,151,151,151,255,136,136,136,255,127,127,127,255,
-119,119,119,255,112,112,112,255,105,105,105,255, 98, 98, 98,255, 90, 90, 90,255, 83, 83, 83,255, 75, 75, 75,255, 66, 66, 66,255,
- 57, 57, 57,255, 46, 46, 46,255, 24, 24, 24,204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 20, 51,
-134,134,134,255,151,151,151,255,160,160,160,255,164,164,164,255,167,167,167,255,171,171,171,255,178,178,178,255,189,189,189,255,
-200,200,200,255,202,202,202,255,195,195,195,255,180,180,180,255,163,163,163,255,148,148,148,255,137,137,137,255,129,129,129,255,
-121,121,121,255,114,114,114,255,107,107,107,255, 99, 99, 99,255, 91, 91, 91,255, 83, 83, 83,255, 74, 74, 74,255, 65, 65, 65,255,
- 55, 55, 55,255, 41, 41, 41,255, 7, 7, 7, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 49, 49, 49,102,145,145,145,255,157,157,157,255,164,164,164,255,167,167,167,255,170,170,170,255,172,172,172,255,176,176,176,255,
-180,180,180,255,179,179,179,255,174,174,174,255,165,165,165,255,155,155,155,255,145,145,145,255,137,137,137,255,130,130,130,255,
-122,122,122,255,115,115,115,255,107,107,107,255, 99, 99, 99,255, 91, 91, 91,255, 82, 82, 82,255, 73, 73, 73,255, 63, 63, 63,255,
- 50, 50, 50,255, 22, 22, 22,153, 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, 78, 78, 78,153,149,149,149,255,160,160,160,255,166,166,166,255,168,168,168,255,169,169,169,255,170,170,170,255,
-169,169,169,255,167,167,167,255,164,164,164,255,158,158,158,255,151,151,151,255,144,144,144,255,137,137,137,255,130,130,130,255,
-123,123,123,255,115,115,115,255,106,106,106,255, 98, 98, 98,255, 89, 89, 89,255, 80, 80, 80,255, 70, 70, 70,255, 58, 58, 58,255,
- 27, 27, 27,153, 3, 3, 3, 51, 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, 80, 80, 80,153,150,150,150,255,160,160,160,255,165,165,165,255,167,167,167,255,167,167,167,255,
-166,166,166,255,163,163,163,255,160,160,160,255,155,155,155,255,149,149,149,255,143,143,143,255,137,137,137,255,129,129,129,255,
-121,121,121,255,113,113,113,255,105,105,105,255, 96, 96, 96,255, 86, 86, 86,255, 76, 76, 76,255, 63, 63, 63,255, 38, 38, 38,204,
- 7, 7, 7, 51, 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, 0, 0, 0, 0, 0, 0, 0, 0, 78, 78, 78,153,147,147,147,255,157,157,157,255,161,161,161,255,163,163,163,255,
-162,162,162,255,160,160,160,255,157,157,157,255,152,152,152,255,147,147,147,255,141,141,141,255,135,135,135,255,127,127,127,255,
-119,119,119,255,110,110,110,255,101,101,101,255, 91, 91, 91,255, 80, 80, 80,255, 66, 66, 66,255, 32, 32, 32,153, 7, 7, 7, 51,
- 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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,134,134,134,255,148,148,148,255,154,154,154,255,
-155,155,155,255,154,154,154,255,152,152,152,255,147,147,147,255,142,142,142,255,136,136,136,255,130,130,130,255,122,122,122,255,
-114,114,114,255,104,104,104,255, 93, 93, 93,255, 81, 81, 81,255, 54, 54, 54,204, 22, 22, 22,102, 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, 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, 73, 73, 73,153,103,103,103,204,
-137,137,137,255,140,140,140,255,140,140,140,255,137,137,137,255,133,133,133,255,127,127,127,255,120,120,120,255,113,113,113,255,
-102,102,102,255, 91, 91, 91,255, 64, 64, 64,204, 28, 28, 28,102, 6, 6, 6, 51, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 46, 46, 46,102, 72, 72, 72,153, 72, 72, 72,153, 92, 92, 92,204, 88, 88, 88,204, 81, 81, 81,204, 54, 54, 54,153,
- 35, 35, 35,102, 16, 16, 16, 51, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 0, 0,168, 1, 0, 0, 8,123, 46, 5,
- 0, 0, 0, 0, 33, 0, 0, 0, 1, 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, 0, 0, 0, 84, 69, 84,101,120, 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, 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, 1, 0, 0, 0, 50, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62, 0, 0,160, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 64, 0, 0, 0, 64,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 32, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 7, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 8, 0, 0, 0, 1, 0, 1, 0, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,205,204,204, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 40, 0, 0, 0,152,120,216, 3, 0, 0, 0, 0,
+ 12, 0, 0, 0, 1, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 53, 0, 53, 0,
+ 88, 13,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 16, 0, 0, 88, 13,218, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 51, 2, 2, 2, 51,
+ 6, 6, 6,153, 6, 6, 6,153, 6, 6, 6,153, 4, 4, 4,102, 3, 3, 3,102, 2, 2, 2, 51, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 51, 8, 8, 8,153, 11, 11, 11,204, 13, 13, 13,255, 12, 12, 12,255,
+ 12, 12, 12,255, 11, 11, 11,255, 10, 10, 10,255, 10, 10, 10,255, 9, 9, 9,255, 9, 9, 9,255, 9, 9, 9,255, 4, 4, 4,102,
+ 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,
+ 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,
+ 0, 0, 0, 0, 3, 3, 3, 51, 10, 10, 10,153, 18, 18, 18,255, 20, 20, 20,255, 22, 22, 22,255, 23, 23, 23,255, 22, 22, 22,255,
+ 20, 20, 20,255, 19, 19, 19,255, 16, 16, 16,255, 14, 14, 14,255, 11, 11, 11,255, 10, 10, 10,255, 9, 9, 9,255, 9, 9, 9,255,
+ 9, 9, 9,255, 8, 8, 8,204, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 7, 7,102, 19, 19, 19,204, 27, 27, 27,255, 31, 31, 31,255, 32, 32, 32,255, 33, 33, 33,255, 33, 33, 33,255, 31, 31, 31,255,
+ 30, 30, 30,255, 27, 27, 27,255, 25, 25, 25,255, 22, 22, 22,255, 19, 19, 19,255, 16, 16, 16,255, 12, 12, 12,255, 10, 10, 10,255,
+ 10, 10, 10,255, 10, 10, 10,255, 10, 10, 10,255, 4, 4, 4,102, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 13, 13,153,
+ 29, 29, 29,255, 37, 37, 37,255, 40, 40, 40,255, 42, 42, 42,255, 42, 42, 42,255, 43, 43, 43,255, 41, 41, 41,255, 40, 40, 40,255,
+ 38, 38, 38,255, 36, 36, 36,255, 33, 33, 33,255, 30, 30, 30,255, 27, 27, 27,255, 24, 24, 24,255, 20, 20, 20,255, 16, 16, 16,255,
+ 12, 12, 12,255, 10, 10, 10,255, 10, 10, 10,255, 10, 10, 10,255, 7, 7, 7,153, 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, 0, 0, 0, 0, 13, 13, 13,102, 37, 37, 37,255,
+ 44, 44, 44,255, 48, 48, 48,255, 50, 50, 50,255, 51, 51, 51,255, 51, 51, 51,255, 50, 50, 50,255, 49, 49, 49,255, 48, 48, 48,255,
+ 45, 45, 45,255, 43, 43, 43,255, 41, 41, 41,255, 37, 37, 37,255, 34, 34, 34,255, 31, 31, 31,255, 28, 28, 28,255, 24, 24, 24,255,
+ 20, 20, 20,255, 15, 15, 15,255, 11, 11, 11,255, 10, 10, 10,255, 11, 11, 11,255, 7, 7, 7,153, 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, 13, 13, 13,102, 41, 41, 41,255, 50, 50, 50,255,
+ 54, 54, 54,255, 57, 57, 57,255, 58, 58, 58,255, 59, 59, 59,255, 59, 59, 59,255, 58, 58, 58,255, 57, 57, 57,255, 55, 55, 55,255,
+ 53, 53, 53,255, 51, 51, 51,255, 48, 48, 48,255, 45, 45, 45,255, 41, 41, 41,255, 38, 38, 38,255, 35, 35, 35,255, 31, 31, 31,255,
+ 27, 27, 27,255, 23, 23, 23,255, 17, 17, 17,255, 12, 12, 12,255, 11, 11, 11,255, 11, 11, 11,255, 5, 5, 5,102, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 36, 36,204, 53, 53, 53,255, 59, 59, 59,255,
+ 63, 63, 63,255, 65, 65, 65,255, 66, 66, 66,255, 66, 66, 66,255, 66, 66, 66,255, 65, 65, 65,255, 64, 64, 64,255, 62, 62, 62,255,
+ 60, 60, 60,255, 57, 57, 57,255, 54, 54, 54,255, 51, 51, 51,255, 48, 48, 48,255, 44, 44, 44,255, 41, 41, 41,255, 37, 37, 37,255,
+ 33, 33, 33,255, 29, 29, 29,255, 24, 24, 24,255, 19, 19, 19,255, 13, 13, 13,255, 11, 11, 11,255, 12, 12, 12,255, 3, 3, 3, 51,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 19, 19,102, 56, 56, 56,255, 64, 64, 64,255, 68, 68, 68,255,
+ 71, 71, 71,255, 73, 73, 73,255, 74, 74, 74,255, 74, 74, 74,255, 73, 73, 73,255, 72, 72, 72,255, 71, 71, 71,255, 69, 69, 69,255,
+ 67, 67, 67,255, 64, 64, 64,255, 61, 61, 61,255, 58, 58, 58,255, 54, 54, 54,255, 50, 50, 50,255, 47, 47, 47,255, 43, 43, 43,255,
+ 39, 39, 39,255, 34, 34, 34,255, 30, 30, 30,255, 25, 25, 25,255, 19, 19, 19,255, 13, 13, 13,255, 12, 12, 12,255, 10, 10, 10,204,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 54, 54,255, 66, 66, 66,255, 72, 72, 72,255, 77, 77, 77,255,
+ 79, 79, 79,255, 81, 81, 81,255, 81, 81, 81,255, 81, 81, 81,255, 80, 80, 80,255, 79, 79, 79,255, 77, 77, 77,255, 75, 75, 75,255,
+ 73, 73, 73,255, 70, 70, 70,255, 67, 67, 67,255, 63, 63, 63,255, 60, 60, 60,255, 56, 56, 56,255, 52, 52, 52,255, 49, 49, 49,255,
+ 44, 44, 44,255, 40, 40, 40,255, 35, 35, 35,255, 30, 30, 30,255, 24, 24, 24,255, 18, 18, 18,255, 12, 12, 12,255, 12, 12, 12,255,
+ 6, 6, 6,102, 0, 0, 0, 0, 0, 0, 0, 0, 22, 22, 22,102, 67, 67, 67,255, 76, 76, 76,255, 81, 81, 81,255, 84, 84, 84,255,
+ 87, 87, 87,255, 88, 88, 88,255, 88, 88, 88,255, 88, 88, 88,255, 87, 87, 87,255, 86, 86, 86,255, 84, 84, 84,255, 82, 82, 82,255,
+ 79, 79, 79,255, 76, 76, 76,255, 73, 73, 73,255, 69, 69, 69,255, 65, 65, 65,255, 62, 62, 62,255, 58, 58, 58,255, 54, 54, 54,255,
+ 49, 49, 49,255, 45, 45, 45,255, 40, 40, 40,255, 35, 35, 35,255, 29, 29, 29,255, 23, 23, 23,255, 16, 16, 16,255, 12, 12, 12,255,
+ 12, 12, 12,204, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49,204, 76, 76, 76,255, 84, 84, 84,255, 89, 89, 89,255, 92, 92, 92,255,
+ 94, 94, 94,255, 95, 95, 95,255, 95, 95, 95,255, 95, 95, 95,255, 94, 94, 94,255, 93, 93, 93,255, 91, 91, 91,255, 88, 88, 88,255,
+ 85, 85, 85,255, 82, 82, 82,255, 79, 79, 79,255, 75, 75, 75,255, 71, 71, 71,255, 67, 67, 67,255, 63, 63, 63,255, 59, 59, 59,255,
+ 55, 55, 55,255, 50, 50, 50,255, 45, 45, 45,255, 40, 40, 40,255, 34, 34, 34,255, 28, 28, 28,255, 21, 21, 21,255, 13, 13, 13,255,
+ 14, 14, 14,255, 0, 0, 0, 0, 14, 14, 14,102, 70, 70, 70,255, 85, 85, 85,255, 92, 92, 92,255, 97, 97, 97,255,100,100,100,255,
+102,102,102,255,102,102,102,255,103,103,103,255,102,102,102,255,101,101,101,255, 99, 99, 99,255, 97, 97, 97,255, 94, 94, 94,255,
+ 91, 91, 91,255, 88, 88, 88,255, 84, 84, 84,255, 81, 81, 81,255, 77, 77, 77,255, 72, 72, 72,255, 68, 68, 68,255, 64, 64, 64,255,
+ 59, 59, 59,255, 55, 55, 55,255, 50, 50, 50,255, 44, 44, 44,255, 39, 39, 39,255, 32, 32, 32,255, 25, 25, 25,255, 17, 17, 17,255,
+ 13, 13, 13,255, 7, 7, 7,102, 24, 24, 24,102, 80, 80, 80,255, 93, 93, 93,255,100,100,100,255,104,104,104,255,107,107,107,255,
+109,109,109,255,109,109,109,255,109,109,109,255,109,109,109,255,107,107,107,255,106,106,106,255,103,103,103,255,100,100,100,255,
+ 97, 97, 97,255, 94, 94, 94,255, 90, 90, 90,255, 86, 86, 86,255, 82, 82, 82,255, 77, 77, 77,255, 73, 73, 73,255, 69, 69, 69,255,
+ 64, 64, 64,255, 59, 59, 59,255, 54, 54, 54,255, 49, 49, 49,255, 43, 43, 43,255, 36, 36, 36,255, 29, 29, 29,255, 21, 21, 21,255,
+ 14, 14, 14,255, 10, 10, 10,153, 29, 29, 29,102, 89, 89, 89,255,100,100,100,255,107,107,107,255,112,112,112,255,114,114,114,255,
+116,116,116,255,116,116,116,255,116,116,116,255,115,115,115,255,114,114,114,255,112,112,112,255,110,110,110,255,107,107,107,255,
+104,104,104,255,100,100,100,255, 96, 96, 96,255, 92, 92, 92,255, 87, 87, 87,255, 83, 83, 83,255, 78, 78, 78,255, 73, 73, 73,255,
+ 68, 68, 68,255, 63, 63, 63,255, 58, 58, 58,255, 52, 52, 52,255, 46, 46, 46,255, 40, 40, 40,255, 33, 33, 33,255, 24, 24, 24,255,
+ 17, 17, 17,255, 13, 13, 13,204, 46, 46, 46,153, 95, 95, 95,255,107,107,107,255,114,114,114,255,118,118,118,255,121,121,121,255,
+122,122,122,255,123,123,123,255,123,123,123,255,122,122,122,255,122,122,122,255,120,120,120,255,118,118,118,255,114,114,114,255,
+110,110,110,255,106,106,106,255,101,101,101,255, 97, 97, 97,255, 92, 92, 92,255, 87, 87, 87,255, 83, 83, 83,255, 78, 78, 78,255,
+ 73, 73, 73,255, 68, 68, 68,255, 62, 62, 62,255, 56, 56, 56,255, 50, 50, 50,255, 44, 44, 44,255, 36, 36, 36,255, 28, 28, 28,255,
+ 19, 19, 19,255, 12, 12, 12,204, 47, 47, 47,153,101,101,101,255,113,113,113,255,120,120,120,255,125,125,125,255,127,127,127,255,
+129,129,129,255,130,130,130,255,130,130,130,255,131,131,131,255,131,131,131,255,131,131,131,255,129,129,129,255,125,125,125,255,
+120,120,120,255,113,113,113,255,108,108,108,255,103,103,103,255, 97, 97, 97,255, 92, 92, 92,255, 87, 87, 87,255, 82, 82, 82,255,
+ 77, 77, 77,255, 72, 72, 72,255, 66, 66, 66,255, 60, 60, 60,255, 54, 54, 54,255, 47, 47, 47,255, 39, 39, 39,255, 31, 31, 31,255,
+ 22, 22, 22,255, 12, 12, 12,204, 48, 48, 48,153,106,106,106,255,118,118,118,255,126,126,126,255,131,131,131,255,134,134,134,255,
+135,135,135,255,137,137,137,255,138,138,138,255,142,142,142,255,147,147,147,255,149,149,149,255,148,148,148,255,142,142,142,255,
+133,133,133,255,124,124,124,255,115,115,115,255,108,108,108,255,102,102,102,255, 97, 97, 97,255, 92, 92, 92,255, 87, 87, 87,255,
+ 81, 81, 81,255, 75, 75, 75,255, 69, 69, 69,255, 63, 63, 63,255, 57, 57, 57,255, 49, 49, 49,255, 42, 42, 42,255, 33, 33, 33,255,
+ 24, 24, 24,255, 9, 9, 9,153, 32, 32, 32,102,109,109,109,255,123,123,123,255,131,131,131,255,136,136,136,255,140,140,140,255,
+142,142,142,255,144,144,144,255,148,148,148,255,156,156,156,255,168,168,168,255,176,176,176,255,177,177,177,255,168,168,168,255,
+153,153,153,255,137,137,137,255,124,124,124,255,114,114,114,255,107,107,107,255,101,101,101,255, 96, 96, 96,255, 90, 90, 90,255,
+ 85, 85, 85,255, 79, 79, 79,255, 72, 72, 72,255, 66, 66, 66,255, 59, 59, 59,255, 52, 52, 52,255, 44, 44, 44,255, 35, 35, 35,255,
+ 26, 26, 26,255, 10, 10, 10,153, 17, 17, 17, 51,110,110,110,255,127,127,127,255,136,136,136,255,142,142,142,255,145,145,145,255,
+148,148,148,255,151,151,151,255,159,159,159,255,174,174,174,255,195,195,195,255,212,212,212,255,216,216,216,255,204,204,204,255,
+179,179,179,255,154,154,154,255,135,135,135,255,121,121,121,255,112,112,112,255,106,106,106,255, 99, 99, 99,255, 94, 94, 94,255,
+ 88, 88, 88,255, 82, 82, 82,255, 76, 76, 76,255, 69, 69, 69,255, 62, 62, 62,255, 54, 54, 54,255, 46, 46, 46,255, 37, 37, 37,255,
+ 26, 26, 26,255, 6, 6, 6,102, 0, 0, 0, 0,107,107,107,255,130,130,130,255,140,140,140,255,146,146,146,255,150,150,150,255,
+153,153,153,255,158,158,158,255,169,169,169,255,191,191,191,255,219,219,219,255,246,246,246,255,254,254,254,255,237,237,237,255,
+204,204,204,255,170,170,170,255,145,145,145,255,127,127,127,255,117,117,117,255,110,110,110,255,103,103,103,255, 97, 97, 97,255,
+ 91, 91, 91,255, 85, 85, 85,255, 78, 78, 78,255, 71, 71, 71,255, 64, 64, 64,255, 55, 55, 55,255, 47, 47, 47,255, 37, 37, 37,255,
+ 25, 25, 25,255, 3, 3, 3, 51, 0, 0, 0, 0, 65, 65, 65,153,129,129,129,255,142,142,142,255,149,149,149,255,154,154,154,255,
+158,158,158,255,163,163,163,255,176,176,176,255,199,199,199,255,232,232,232,255,255,255,255,255,255,255,255,255,255,255,255,255,
+220,220,220,255,181,181,181,255,151,151,151,255,132,132,132,255,121,121,121,255,113,113,113,255,106,106,106,255,100,100,100,255,
+ 94, 94, 94,255, 87, 87, 87,255, 80, 80, 80,255, 73, 73, 73,255, 65, 65, 65,255, 57, 57, 57,255, 48, 48, 48,255, 38, 38, 38,255,
+ 16, 16, 16,153, 0, 0, 0, 0, 0, 0, 0, 0, 21, 21, 21, 51,127,127,127,255,143,143,143,255,152,152,152,255,157,157,157,255,
+161,161,161,255,165,165,165,255,177,177,177,255,198,198,198,255,227,227,227,255,253,253,253,255,255,255,255,255,250,250,250,255,
+217,217,217,255,181,181,181,255,153,153,153,255,135,135,135,255,124,124,124,255,117,117,117,255,110,110,110,255,103,103,103,255,
+ 96, 96, 96,255, 89, 89, 89,255, 82, 82, 82,255, 74, 74, 74,255, 66, 66, 66,255, 57, 57, 57,255, 48, 48, 48,255, 35, 35, 35,255,
+ 10, 10, 10,153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 93, 93,204,141,141,141,255,153,153,153,255,159,159,159,255,
+163,163,163,255,167,167,167,255,174,174,174,255,188,188,188,255,209,209,209,255,228,228,228,255,234,234,234,255,224,224,224,255,
+200,200,200,255,173,173,173,255,151,151,151,255,136,136,136,255,127,127,127,255,119,119,119,255,112,112,112,255,105,105,105,255,
+ 98, 98, 98,255, 90, 90, 90,255, 83, 83, 83,255, 75, 75, 75,255, 66, 66, 66,255, 57, 57, 57,255, 46, 46, 46,255, 24, 24, 24,204,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 20, 51,134,134,134,255,151,151,151,255,160,160,160,255,
+164,164,164,255,167,167,167,255,171,171,171,255,178,178,178,255,189,189,189,255,200,200,200,255,202,202,202,255,195,195,195,255,
+180,180,180,255,163,163,163,255,148,148,148,255,137,137,137,255,129,129,129,255,121,121,121,255,114,114,114,255,107,107,107,255,
+ 99, 99, 99,255, 91, 91, 91,255, 83, 83, 83,255, 74, 74, 74,255, 65, 65, 65,255, 55, 55, 55,255, 41, 41, 41,255, 7, 7, 7, 51,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 49, 49,102,145,145,145,255,157,157,157,255,
+164,164,164,255,167,167,167,255,170,170,170,255,172,172,172,255,176,176,176,255,180,180,180,255,179,179,179,255,174,174,174,255,
+165,165,165,255,155,155,155,255,145,145,145,255,137,137,137,255,130,130,130,255,122,122,122,255,115,115,115,255,107,107,107,255,
+ 99, 99, 99,255, 91, 91, 91,255, 82, 82, 82,255, 73, 73, 73,255, 63, 63, 63,255, 50, 50, 50,255, 22, 22, 22,153, 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, 78, 78, 78,153,149,149,149,255,
+160,160,160,255,166,166,166,255,168,168,168,255,169,169,169,255,170,170,170,255,169,169,169,255,167,167,167,255,164,164,164,255,
+158,158,158,255,151,151,151,255,144,144,144,255,137,137,137,255,130,130,130,255,123,123,123,255,115,115,115,255,106,106,106,255,
+ 98, 98, 98,255, 89, 89, 89,255, 80, 80, 80,255, 70, 70, 70,255, 58, 58, 58,255, 27, 27, 27,153, 3, 3, 3, 51, 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, 80, 80, 80,153,
+150,150,150,255,160,160,160,255,165,165,165,255,167,167,167,255,167,167,167,255,166,166,166,255,163,163,163,255,160,160,160,255,
+155,155,155,255,149,149,149,255,143,143,143,255,137,137,137,255,129,129,129,255,121,121,121,255,113,113,113,255,105,105,105,255,
+ 96, 96, 96,255, 86, 86, 86,255, 76, 76, 76,255, 63, 63, 63,255, 38, 38, 38,204, 7, 7, 7, 51, 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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 78, 78, 78,153,147,147,147,255,157,157,157,255,161,161,161,255,163,163,163,255,162,162,162,255,160,160,160,255,157,157,157,255,
+152,152,152,255,147,147,147,255,141,141,141,255,135,135,135,255,127,127,127,255,119,119,119,255,110,110,110,255,101,101,101,255,
+ 91, 91, 91,255, 80, 80, 80,255, 66, 66, 66,255, 32, 32, 32,153, 7, 7, 7, 51, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,134,134,134,255,148,148,148,255,154,154,154,255,155,155,155,255,154,154,154,255,152,152,152,255,
+147,147,147,255,142,142,142,255,136,136,136,255,130,130,130,255,122,122,122,255,114,114,114,255,104,104,104,255, 93, 93, 93,255,
+ 81, 81, 81,255, 54, 54, 54,204, 22, 22, 22,102, 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, 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, 73, 73, 73,153,103,103,103,204,137,137,137,255,140,140,140,255,140,140,140,255,
+137,137,137,255,133,133,133,255,127,127,127,255,120,120,120,255,113,113,113,255,102,102,102,255, 91, 91, 91,255, 64, 64, 64,204,
+ 28, 28, 28,102, 6, 6, 6, 51, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 46, 46,102, 72, 72, 72,153,
+ 72, 72, 72,153, 92, 92, 92,204, 88, 88, 88,204, 81, 81, 81,204, 54, 54, 54,153, 35, 35, 35,102, 16, 16, 16, 51, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 0, 0,168, 1, 0, 0,216, 29,218, 3, 0, 0, 0, 0, 33, 0, 0, 0, 1, 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, 0, 0, 0,
+ 84, 69, 84,101,120, 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, 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, 1, 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,128, 62, 0, 0,160, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 64, 0, 0, 0, 0, 2, 0, 0, 0,
+ 0, 0, 0, 0, 7, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 8, 0, 0, 0, 1, 0, 1, 0, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+205,204,204, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 2, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,248,124, 46, 5, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,248,124, 46, 5,
- 0, 0, 0, 0, 12, 0, 0, 0, 1, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
- 16, 0, 15, 0,104,125, 46, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 16, 0, 0,104,125, 46, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 72,121,216, 3, 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, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 72,121,216, 3, 0, 0, 0, 0, 12, 0, 0, 0, 1, 0, 0, 0,
+ 32, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 16, 0, 15, 0, 8, 32,218, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 16, 0, 0, 8, 32,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 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, 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, 0, 0, 0,
@@ -5978,52 +6010,53 @@ char datatoc_startup_blend[]= {
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,
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,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 0, 0,232, 4, 0, 0, 8, 30, 47, 5, 0, 0, 0, 0, 50, 0, 0, 0,
- 1, 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, 0, 0, 0, 77, 69, 67,117, 98,101, 0,112,104,101,114,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184, 44, 47, 5,
- 0, 0, 0, 0,152,131, 48, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,134, 48, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 24, 30,139, 77,130,127, 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,136, 37, 47, 5, 0, 0, 0, 0,200, 40, 47, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 77, 69, 0, 0,232, 4, 0, 0,136, 48,218, 3, 0, 0, 0, 0, 50, 0, 0, 0, 1, 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, 0, 0, 0, 77, 69, 67,117, 98,101, 0,112,
+104,101,114,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0,
- 0, 0, 0, 0, 56, 35, 47, 5, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 13,217, 3, 0, 0, 0, 0,200,218,208, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 56, 98,198, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136, 2,211, 3, 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,232,232,217, 3, 0, 0, 0, 0,
+ 24, 7,163, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184,122,209, 15, 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, 0, 0, 0, 0,248, 53,218, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 1, 0, 0, 0, 5, 0, 0, 0, 24, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120, 38, 47, 5, 0, 0, 0, 0,255,255,255,255,
-255,255,255,255,255,255,255,255, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255, 1, 0, 0, 0, 5, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,136, 56,218, 3, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,184, 69,146, 77,130,127, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 1, 0, 0, 0, 5, 0, 0, 0,
+ 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,156,173, 15, 0, 0, 0, 0,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,255,255,255,255, 1, 0, 0, 0,255,255,255,255,
+255,255,255,255, 2, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 1, 0, 0, 0, 5, 0, 0, 0, 16, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,132, 48, 5, 0, 0, 0, 0,255,255,255,255,
+255,255,255,255,255,255,255,255, 3, 0, 0, 0, 5, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 56, 64,218, 3, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 1, 0, 0, 0, 5, 0, 0, 0,
+ 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168, 61,218, 3, 0, 0, 0, 0,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,136,135, 48, 5, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 1, 0, 0, 0,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 2, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 6, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 51, 0, 0, 0,180, 0, 0, 0, 0, 4, 0,128, 63,
- 4, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 67, 0, 30, 0, 6, 0, 1, 0, 1, 0,
- 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0,184, 44, 47, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0,168,212, 45, 5, 0, 0, 0, 0, 68, 65, 84, 65, 8, 2, 0, 0, 56, 35, 47, 5, 0, 0, 0, 0,125, 1, 0, 0,
- 5, 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,
+255,255,255,255, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255, 1, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255, 2, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 24, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 51, 0, 0, 0,180, 0, 0, 0, 0, 4, 0,128, 63, 4, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 67, 0, 30, 0, 6, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 8, 0, 0, 0, 24, 13,217, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,152, 7,218, 3, 0, 0, 0, 0,
+ 68, 65, 84, 65, 8, 2, 0, 0,248, 53,218, 3, 0, 0, 0, 0,124, 1, 0, 0, 5, 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, 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, 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, 0, 0, 0,232,232,217, 3, 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, 0, 0, 0, 0,
- 0, 0, 0, 0,136, 37, 47, 5, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -6036,16 +6069,16 @@ char datatoc_startup_blend[]= {
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,
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,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,136, 37, 47, 5, 0, 0, 0, 0, 56, 0, 0, 0,
- 8, 0, 0, 0, 0, 0,128, 63,255,255,127, 63, 0, 0,128,191,230, 73,230, 73, 26,182, 1, 0, 0, 0,128, 63, 0, 0,128,191,
- 0, 0,128,191,230, 73, 26,182, 26,182, 1, 0, 1, 0,128,191,253,255,127,191, 0, 0,128,191, 26,182, 26,182, 26,182, 1, 0,
-250,255,127,191, 3, 0,128, 63, 0, 0,128,191, 26,182,230, 73, 26,182, 1, 0, 4, 0,128, 63,247,255,127, 63, 0, 0,128, 63,
-230, 73,230, 73,230, 73, 1, 0,245,255,127, 63, 5, 0,128,191, 0, 0,128, 63,230, 73, 26,182,230, 73, 1, 0, 3, 0,128,191,
-250,255,127,191, 0, 0,128, 63, 26,182, 26,182,230, 73, 1, 0,255,255,127,191, 0, 0,128, 63, 0, 0,128, 63, 26,182,230, 73,
-230, 73, 1, 0, 68, 65, 84, 65, 8, 2, 0, 0,120, 38, 47, 5, 0, 0, 0, 0,125, 1, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0,
+ 68, 65, 84, 65,160, 0, 0, 0,232,232,217, 3, 0, 0, 0, 0, 56, 0, 0, 0, 8, 0, 0, 0, 0, 0,128, 63,255,255,127, 63,
+ 0, 0,128,191,230, 73,230, 73, 26,182, 1, 0, 0, 0,128, 63, 0, 0,128,191, 0, 0,128,191,230, 73, 26,182, 26,182, 1, 0,
+ 1, 0,128,191,253,255,127,191, 0, 0,128,191, 26,182, 26,182, 26,182, 1, 0,250,255,127,191, 3, 0,128, 63, 0, 0,128,191,
+ 26,182,230, 73, 26,182, 1, 0, 4, 0,128, 63,247,255,127, 63, 0, 0,128, 63,230, 73,230, 73,230, 73, 1, 0,245,255,127, 63,
+ 5, 0,128,191, 0, 0,128, 63,230, 73, 26,182,230, 73, 1, 0, 3, 0,128,191,250,255,127,191, 0, 0,128, 63, 26,182, 26,182,
+230, 73, 1, 0,255,255,127,191, 0, 0,128, 63, 0, 0,128, 63, 26,182,230, 73,230, 73, 1, 0, 68, 65, 84, 65, 8, 2, 0, 0,
+136, 56,218, 3, 0, 0, 0, 0,124, 1, 0, 0, 5, 0, 0, 0, 3, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 40, 47, 5,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 7,163, 3, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -6058,93 +6091,99 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,144, 0, 0, 0,
+ 24, 7,163, 3, 0, 0, 0, 0, 53, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 35, 0,
+ 1, 0, 0, 0, 5, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0, 6, 0, 0, 0,
+ 0, 0, 35, 0, 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0, 5, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0,
+ 7, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 35, 0, 6, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0,
+ 68, 65, 84, 65, 8, 2, 0, 0, 72,156,173, 15, 0, 0, 0, 0,124, 1, 0, 0, 5, 0, 0, 0, 4, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65,144, 0, 0, 0,200, 40, 47, 5, 0, 0, 0, 0, 53, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 35, 0,
- 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0, 5, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0, 3, 0, 0, 0,
- 0, 0, 35, 0, 2, 0, 0, 0, 6, 0, 0, 0, 0, 0, 35, 0, 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0,
- 5, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 35, 0,
- 6, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 68, 65, 84, 65, 8, 2, 0, 0,184, 69,146, 77,130,127, 0, 0,125, 1, 0, 0,
- 5, 0, 0, 0, 6, 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, 67,111,108, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,205,203, 15, 0, 0, 0, 0,
+ 6, 0, 0, 0, 20, 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,
+ 67,111,108, 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, 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,
+184,122,209, 15, 0, 0, 0, 0, 9, 0, 0, 0, 36, 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, 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, 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,200,136,205, 15, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 8, 2, 0, 0,168, 61,218, 3, 0, 0, 0, 0,124, 1, 0, 0, 5, 0, 0, 0, 17, 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, 67,111,108, 0, 32, 70, 97, 99,
+101, 45, 86,101,114,116,101,120, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136, 2,211, 3, 0, 0, 0, 0,
+ 26, 0, 0, 0, 4, 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,
+ 78, 71,111,110, 32, 70, 97, 99,101, 45, 86,101,114,116,101,120, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 56, 98,198, 3, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 2, 0, 0,136,135, 48, 5, 0, 0, 0, 0,125, 1, 0, 0,
- 5, 0, 0, 0, 17, 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, 67,111,108, 0, 32, 70, 97, 99,101, 45, 86,101,114,116,101,120, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 24, 30,139, 77,130,127, 0, 0, 26, 0, 0, 0, 4, 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, 78, 71,111,110, 32, 70, 97, 99,101, 45, 86,101,114,116,101,120, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,134, 48, 5, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 96, 0, 0, 0,136, 2,211, 3, 0, 0, 0, 0, 62, 0, 0, 0, 24, 0, 0, 0,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 68, 65, 84, 65,192, 0, 0, 0,
+ 56, 98,198, 3, 0, 0, 0, 0, 59, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0,
+ 2, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 9, 0, 0, 0, 7, 0, 0, 0, 11, 0, 0, 0,
+ 6, 0, 0, 0, 10, 0, 0, 0, 5, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0,
+ 5, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 10, 0, 0, 0,
+ 6, 0, 0, 0, 6, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 6, 0, 0, 0, 11, 0, 0, 0,
+ 7, 0, 0, 0, 7, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 3, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0, 9, 0, 0, 0, 68, 65, 84, 65, 8, 2, 0, 0, 56, 64,218, 3, 0, 0, 0, 0,
+124, 1, 0, 0, 5, 0, 0, 0, 25, 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, 78, 71,111,110, 32, 70, 97, 99,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,200,218,208, 3, 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, 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, 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, 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, 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, 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, 68, 65, 84, 65, 96, 0, 0, 0, 24, 30,139, 77,130,127, 0, 0, 62, 0, 0, 0,
- 24, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255, 68, 65, 84, 65,192, 0, 0, 0,120,134, 48, 5, 0, 0, 0, 0, 59, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0,
- 9, 0, 0, 0, 7, 0, 0, 0, 11, 0, 0, 0, 6, 0, 0, 0, 10, 0, 0, 0, 5, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 4, 0, 0, 0, 5, 0, 0, 0, 10, 0, 0, 0, 6, 0, 0, 0, 6, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0,
- 6, 0, 0, 0, 6, 0, 0, 0, 11, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0, 9, 0, 0, 0, 68, 65, 84, 65,
- 8, 2, 0, 0, 40,132, 48, 5, 0, 0, 0, 0,125, 1, 0, 0, 5, 0, 0, 0, 25, 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, 78, 71,111,110, 32, 70, 97, 99,101, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,131, 48, 5, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 72, 0, 0, 0,200,218,208, 3, 0, 0, 0, 0,
+ 58, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0,
+ 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0, 12, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0, 16, 0, 0, 0, 4, 0, 0, 0,
+ 0, 0, 2, 0, 20, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0, 66, 82, 0, 0, 88, 6, 0, 0,200, 66,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0, 40, 77,218, 3, 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, 66, 82, 65,100,100, 0,104, 46, 48, 48, 49, 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, 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, 1, 0, 0, 2, 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, 0, 0, 0, 63, 0, 0, 0, 0,104, 75,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 0, 0, 0, 0, 68, 65, 84, 65,
- 72, 0, 0, 0,152,131, 48, 5, 0, 0, 0, 0, 58, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0,
- 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0, 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0, 12, 0, 0, 0, 4, 0, 0, 0,
- 0, 0, 2, 0, 16, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0, 20, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0, 66, 82, 0, 0,
- 88, 6, 0, 0, 8, 45, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0, 56, 55, 47, 5, 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, 66, 82, 65,100,100, 0,104, 46, 48, 48, 49, 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, 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, 1, 0, 0, 2, 12, 3, 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, 0, 63,
- 0, 0, 0, 0, 40, 53, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -6170,56 +6209,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 35, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0, 96, 67,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,104, 75,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191, 46,189,194, 61,248,121,216, 3, 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, 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, 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, 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, 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, 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, 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, 12, 0, 35, 0, 0, 0,
- 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0,160, 45, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,248,121,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63, 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0, 40, 77,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0,200, 66,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 66,108,111, 98, 0, 48, 48, 49, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 13, 3, 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, 0, 63, 0, 0, 0, 0, 8, 84,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0, 40, 53, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191,
- 46,189,194, 61,184, 54, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,184, 54, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63,
- 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0, 56, 55, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,232, 63, 47, 5, 0, 0, 0, 0, 8, 45, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 66,108,111, 98, 0, 48, 48, 49, 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, 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, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0,216, 61, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -6243,58 +6284,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62, 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63,
+ 68, 65, 84, 65, 56, 1, 0, 0,192, 77,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 8, 84,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186,168,122,216, 3, 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, 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, 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, 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, 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, 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, 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, 2, 0, 35, 0, 0, 0,
- 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62,
- 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63, 68, 65, 84, 65, 56, 1, 0, 0,208, 55, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,168,122,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,200, 85,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 40, 77,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 66,108,117,114, 0, 46, 48, 48, 52, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 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, 0, 0, 0, 63, 0, 0, 0, 0,168, 92,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,216, 61, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186,104, 63, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,104, 63, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,232, 63, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,152, 72, 47, 5, 0, 0, 0, 0, 56, 55, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 66,108,117,114, 0, 46, 48, 48, 52, 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, 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, 1, 0, 0, 2, 14, 3, 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, 0, 63,
- 0, 0, 0, 0,136, 70, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -6318,58 +6359,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 35, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0, 96, 86,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,168, 92,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191, 46,189,194, 61, 88,123,216, 3, 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, 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, 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, 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, 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, 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, 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, 12, 0, 35, 0, 0, 0,
- 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0,128, 64, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 88,123,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63, 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,104, 94,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0,200, 85,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 66,114,117,115,104, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 31, 3, 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, 0, 63, 0, 0, 0, 0, 72,101,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,136, 70, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191,
- 46,189,194, 61, 24, 72, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 24, 72, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63,
- 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,152, 72, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0,232, 63, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 66,114,117,115,104, 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, 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, 1, 0, 0, 2, 25, 3, 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, 0, 63,
- 0, 0, 0, 0, 56, 79, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -6393,58 +6434,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 35, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62, 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63,
+ 68, 65, 84, 65, 56, 1, 0, 0, 0, 95,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 72,101,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186, 8,124,216, 3, 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, 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, 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, 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, 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, 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, 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, 30, 0, 35, 0, 0, 0,
- 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62,
- 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63, 68, 65, 84, 65, 56, 1, 0, 0, 48, 73, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 8,124,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0, 8,103,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,168,205,210, 3, 0, 0, 0, 0,104, 94,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 67,108, 97,121, 0, 48, 48, 49, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 15, 3, 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, 0, 63, 0, 0, 0, 0,232,109,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0, 56, 79, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186,200, 80, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,200, 80, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0, 72, 81, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,248, 89, 47, 5, 0, 0, 0, 0,152, 72, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 67,108, 97,121, 0, 48, 48, 49, 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, 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, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0,232, 87, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -6468,58 +6509,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0, 4, 4, 4, 8, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62, 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63,
+ 68, 65, 84, 65, 56, 1, 0, 0,160,103,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,232,109,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186,184,124,216, 3, 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, 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, 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, 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, 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, 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, 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, 2, 0, 35, 0, 0, 0,
- 4, 4, 4, 8, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62,
- 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63, 68, 65, 84, 65, 56, 1, 0, 0,224, 81, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,184,124,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,168,205,210, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 8,103,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 67,108, 97,121, 32, 83,116,114,105,112,115, 0, 48, 49, 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, 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, 0, 0, 0, 0, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 3, 16, 3, 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, 0, 63, 0, 0, 0, 0, 24,114,219, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,232, 87, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186,120, 89, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,120, 89, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,248, 89, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,168, 98, 47, 5, 0, 0, 0, 0, 72, 81, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 67,108,111,110,101, 0, 48, 48, 49, 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, 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, 1, 0, 0, 2, 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, 0, 0, 0, 63,
- 0, 0, 0, 0,152, 96, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -6543,58 +6584,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0,160,119, 78, 63, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62, 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63,
+ 68, 65, 84, 65, 56, 1, 0, 0, 64,206,210, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 24,114,219, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186,152, 62,171, 3, 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, 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, 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, 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, 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, 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, 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, 16, 0, 35, 0, 0, 0,
- 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 51, 51, 51, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0,144, 90, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,152, 62,171, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,168,111,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0,168,205,210, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 67,108,111,110,101, 0, 48, 48, 49, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 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, 0, 0, 0, 63, 0, 0, 0, 0,136,118,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,152, 96, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191,
- 46,189,194, 61, 40, 98, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 40, 98, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63,
- 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,168, 98, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0, 88,107, 47, 5, 0, 0, 0, 0,248, 89, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 67,114,101, 97,115,101, 0, 48, 48, 49,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0, 72,105, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -6618,58 +6659,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 35, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 51, 51, 51, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0, 64,112,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,136,118,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191, 46,189,194, 61,104,125,216, 3, 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, 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, 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, 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, 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, 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, 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, 2, 0, 35, 0, 0, 0,
- 4, 6, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62,
- 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63, 68, 65, 84, 65, 56, 1, 0, 0, 64, 99, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,104,125,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63, 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0, 72,120,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0,168,111,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 67,114,101, 97,115,101, 0, 48, 48, 49, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 18, 3, 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, 0, 63, 0, 0, 0, 0, 40,127,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0, 72,105, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,228, 97,175,190, 50,131,112, 63,218,243,127,191,
- 10,183,157,188,216,106, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,216,106, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 64, 63, 10,215, 35, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0, 88,107, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0, 8,116, 47, 5, 0, 0, 0, 0,168, 98, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 68, 97,114,107,101,110, 0, 48, 54, 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, 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, 1, 0, 0, 2, 18, 3, 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, 0, 63,
- 0, 0, 0, 0,248,113, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -6693,58 +6734,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0, 4, 6, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62, 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63,
+ 68, 65, 84, 65, 56, 1, 0, 0,224,120,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 40,127,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,228, 97,175,190, 50,131,112, 63,218,243,127,191, 10,183,157,188, 24,126,216, 3, 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, 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, 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, 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, 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, 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, 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, 12, 0, 35, 0, 0, 0,
- 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0,240,107, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 24,126,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 64, 63, 10,215, 35, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,232,128,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 72,120,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 68, 97,114,107,101,110, 0, 48, 54, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 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, 0, 0, 0, 63, 0, 0, 0, 0,200,135,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,248,113, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191,
- 46,189,194, 61,136,115, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,136,115, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63,
- 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0, 8,116, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,184,124, 47, 5, 0, 0, 0, 0, 88,107, 47, 5,
- 0, 0, 0, 0, 0, 20, 1,160,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 68,114, 97,119, 0, 46, 48, 48, 49, 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, 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, 3, 0, 0, 2, 25, 3, 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, 0, 63,
- 0, 0, 0, 0,168,122, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -6768,58 +6809,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 35, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0,128,129,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,200,135,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191, 46,189,194, 61,200,126,216, 3, 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, 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, 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, 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, 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, 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, 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, 30, 0, 35, 0, 0, 0,
- 0, 4, 0, 8, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62,
- 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63, 68, 65, 84, 65, 56, 1, 0, 0,160,116, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,200,126,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63, 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,136,137,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0,232,128,218, 3, 0, 0, 0, 0, 0, 20, 1,160,255,255,255,255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 68,114, 97,119, 0, 46, 48, 48, 49, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 31, 3, 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, 0, 63, 0, 0, 0, 0, 88,146,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,168,122, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186, 56,124, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 56,124, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,184,124, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,104,133, 47, 5, 0, 0, 0, 0, 8,116, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 70,105,108,108, 47, 68,101,101,112,101,
-110, 0, 48, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0, 88,131, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -6843,58 +6884,59 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 35, 0, 0, 0, 0, 4, 0, 8, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62, 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63,
+ 68, 65, 84, 65, 56, 1, 0, 0, 32,138,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 88,146,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186,120,127,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,120,127,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,104,176,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0,136,137,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 70,105,108,108, 47, 68,101,101,112,101,110, 0, 48, 48, 49, 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, 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, 0, 2, 0, 35, 0, 0, 0,
- 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 20,174,199, 62,
- 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 56, 1, 0, 0, 80,125, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 3, 20, 3, 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, 0, 63, 0, 0, 0, 0, 24,148,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0, 88,131, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186,232,132, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,232,132, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,104,133, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0, 24,142, 47, 5, 0, 0, 0, 0,184,124, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 70,108, 97,116,116,101,110, 47, 67,111,
-110,116,114, 97,115,116, 0, 48, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0, 8,140, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -6917,59 +6959,59 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 20,174,199, 62, 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 63,
+ 68, 65, 84, 65, 56, 1, 0, 0, 0,177,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 24,148,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186, 40,128,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 40,128,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0, 72,183,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0,104,176,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 70,108, 97,116,116,101,110, 47, 67,111,110,116,114, 97,115,116, 0, 48, 48, 49, 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, 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, 2, 0, 35, 0, 0, 0,
- 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 20,174,199, 62,
- 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 56, 1, 0, 0, 0,134, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 3, 21, 3, 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, 0, 63, 0, 0, 0, 0,216,149,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0, 8,140, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186,152,141, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,152,141, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0, 24,142, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,200,150, 47, 5, 0, 0, 0, 0,104,133, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 71,114, 97, 98, 0, 48, 48, 49, 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, 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, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0,184,148, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -6992,59 +7034,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 20,174,199, 62, 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 63,
+ 68, 65, 84, 65, 56, 1, 0, 0,224,183,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,216,149,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186,216,128,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,216,128,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0, 40,190,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 72,183,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 71,114, 97, 98, 0, 48, 48, 49, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 75, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 62,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0,176,142, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 3, 22, 3, 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, 0, 63, 0, 0, 0, 0,152,151,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,184,148, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186, 72,150, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 72,150, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,200,150, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,120,159, 47, 5, 0, 0, 0, 0, 24,142, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 73,110,102,108, 97,116,101, 47, 68,101,
-102,108, 97,116,101, 0, 48, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0,104,157, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -7068,58 +7109,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0,192,190,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,152,151,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186,136,129,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,136,129,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0, 8,197,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 40,190,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 73,110,102,108, 97,116,101, 47, 68,101,102,108, 97,116,101, 0, 48, 48, 49, 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, 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, 2, 0, 35, 0, 0, 0,
- 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0, 64, 63, 0, 0, 64, 63, 0, 0, 64, 63,
- 0, 0,128, 62, 0, 0,128, 62, 0, 0,128, 62, 68, 65, 84, 65, 56, 1, 0, 0, 96,151, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 3, 23, 3, 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, 0, 63, 0, 0, 0, 0, 88,153,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,104,157, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186,248,158, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,248,158, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,120,159, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0, 40,168, 47, 5, 0, 0, 0, 0,200,150, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 76, 97,121,101,114, 0, 48, 48, 49, 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, 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, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0, 24,166, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -7143,58 +7184,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0, 64, 63, 0, 0, 64, 63, 0, 0, 64, 63, 0, 0,128, 62, 0, 0,128, 62, 0, 0,128, 62,
+ 68, 65, 84, 65, 56, 1, 0, 0,160,197,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 88,153,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186, 56,130,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 56,130,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,232,203,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 8,197,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 76, 97,121,101,114, 0, 48, 48, 49, 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, 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, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0,
- 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0, 16,160, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 3, 24, 3, 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, 0, 63, 0, 0, 0, 0, 24,155,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0, 24,166, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186,168,167, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,168,167, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0, 40,168, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,216,176, 47, 5, 0, 0, 0, 0,120,159, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 76,105,103,104,116,101,110, 0, 53, 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, 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, 1, 0, 0, 2, 24, 3, 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, 0, 63,
- 0, 0, 0, 0,200,174, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -7218,58 +7259,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0,128,204,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 24,155,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186,232,130,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,232,130,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,200,210,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0,232,203,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 76,105,103,104,116,101,110, 0, 53, 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, 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, 0, 0, 0, 0, 0, 0, 0, 12, 0, 35, 0, 0, 0,
- 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0,192,168, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 2, 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, 0, 0, 0, 63, 0, 0, 0, 0,216,156,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,200,174, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191,
- 46,189,194, 61, 88,176, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 88,176, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63,
- 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,216,176, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,136,185, 47, 5, 0, 0, 0, 0, 40,168, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 77,105,120, 0,104, 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, 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, 1, 0, 0, 2, 25, 3, 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, 0, 63,
- 0, 0, 0, 0,120,183, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -7293,58 +7334,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 35, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0, 96,211,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,216,156,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191, 46,189,194, 61,152,131,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,152,131,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63, 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,168,217,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0,200,210,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 77,105,120, 0,104, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 35, 0, 0, 0,
- 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 51, 51, 51, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0,112,177, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 2, 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, 0, 0, 0, 63, 0, 0, 0, 0,152,158,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,120,183, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191,
- 46,189,194, 61, 8,185, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 8,185, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63,
- 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,136,185, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0, 56,194, 47, 5, 0, 0, 0, 0,216,176, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 77,117,108,116,105,112,108,121, 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, 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, 1, 0, 0, 2, 26, 3, 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, 0, 63,
- 0, 0, 0, 0, 40,192, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -7368,58 +7409,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 35, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 51, 51, 51, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0, 64,218,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,152,158,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191, 46,189,194, 61, 72,132,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 72,132,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63, 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,136,224,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0,168,217,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 77,117,108,116,105,112,108,121, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 35, 0, 0, 0,
- 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0, 32,186, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 2, 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, 0, 0, 0, 63, 0, 0, 0, 0, 88,160,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0, 40,192, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191,
- 46,189,194, 61,184,193, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,184,193, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63,
- 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0, 56,194, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,232,202, 47, 5, 0, 0, 0, 0,136,185, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 78,117,100,103,101, 0, 48, 48, 49, 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, 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, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0,216,200, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -7443,58 +7484,57 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 35, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0, 32,225,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 88,160,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191, 46,189,194, 61,248,132,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,248,132,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63, 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,184,212,210, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0,136,224,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 78,117,100,103,101, 0, 48, 48, 49, 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, 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, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0,
- 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 62,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0,208,194, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 3, 28, 3, 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, 0, 63, 0, 0, 0, 0, 24,162,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,216,200, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186,104,202, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,104,202, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,232,202, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,152,211, 47, 5, 0, 0, 0, 0, 56,194, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 80,105,110, 99,104, 47, 77, 97,103,110,
-105,102,121, 0, 48, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 25, 3, 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, 0, 63,
- 0, 0, 0, 0,136,209, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -7519,57 +7559,57 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0, 80,213,210, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 24,162,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186,168,133,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,168,133,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,200,219,210, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0,184,212,210, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 80,105,110, 99,104, 47, 77, 97,103,110,105,102,121, 0, 48, 48, 49, 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, 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, 2, 0, 35, 0, 0, 0,
- 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0, 64, 63, 0, 0, 64, 63, 0, 0, 64, 63,
- 0, 0,128, 62, 0, 0,128, 62, 0, 0,128, 62, 68, 65, 84, 65, 56, 1, 0, 0,128,203, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 3, 29, 3, 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, 0, 63, 0, 0, 0, 0,216,163,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,136,209, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186, 24,211, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 24,211, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,152,211, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0, 72,220, 47, 5, 0, 0, 0, 0,232,202, 47, 5,
- 0, 0, 0, 0,253, 21,192, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 80,111,108,105,115,104, 0, 48, 48, 49,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0, 56,218, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -7594,57 +7634,56 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0, 64, 63, 0, 0, 64, 63, 0, 0, 64, 63, 0, 0,128, 62, 0, 0,128, 62, 0, 0,128, 62,
+ 68, 65, 84, 65, 56, 1, 0, 0, 96,220,210, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,216,163,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186, 88,134,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 88,134,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,216,226,210, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0,200,219,210, 3, 0, 0, 0, 0,253, 21,192, 32, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 80,111,108,105,115,104, 0, 48, 48, 49, 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, 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, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0,
- 4, 4, 4, 1, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 20,174,199, 62,
- 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 56, 1, 0, 0, 48,212, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 3, 21, 3, 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, 0, 63, 0, 0, 0, 0,152,165,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0, 56,218, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186,200,219, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,200,219, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0, 72,220, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,248,228, 47, 5, 0, 0, 0, 0,152,211, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 83, 99,114, 97,112,101, 47, 80,101, 97,
-107,115, 0, 48, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0,232,226, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -7670,56 +7709,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0, 4, 4, 4, 1, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 20,174,199, 62, 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 63,
+ 68, 65, 84, 65, 56, 1, 0, 0,112,227,210, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,152,165,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186, 8,135,216, 3, 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, 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, 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, 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, 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, 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, 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, 2, 0, 35, 0, 0, 0,
- 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 20,174,199, 62,
- 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 56, 1, 0, 0,224,220, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 8,135,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,232,233,210, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0,216,226,210, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 83, 99,114, 97,112,101, 47, 80,101, 97,107,115, 0, 48, 48, 49, 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, 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, 0, 0, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 30, 3, 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, 0, 63, 0, 0, 0, 0, 88,167,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,232,226, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186,120,228, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,120,228, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,248,228, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,168,237, 47, 5, 0, 0, 0, 0, 72,220, 47, 5,
- 0, 0, 0, 0, 12,215, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 83, 99,117,108,112,116, 68,114, 97,119,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0,152,235, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -7743,58 +7784,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 20,174,199, 62, 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 63,
+ 68, 65, 84, 65, 56, 1, 0, 0,128,234,210, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 88,167,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186,184,135,216, 3, 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, 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, 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, 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, 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, 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, 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, 2, 0, 35, 0, 0, 0,
- 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0,160,119, 78, 63, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62,
- 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63, 68, 65, 84, 65, 56, 1, 0, 0,144,229, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,184,135,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,248,240,210, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0,232,233,210, 3, 0, 0, 0, 0,168,205,210, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 83, 99,117,108,112,116, 68,114, 97,119, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 3, 31, 3, 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, 0, 63, 0, 0, 0, 0, 24,169,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,152,235, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186, 40,237, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 40,237, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,168,237, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0, 88,246, 47, 5, 0, 0, 0, 0,248,228, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 83,109,101, 97,114, 0, 48, 48, 49, 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, 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, 1, 0, 0, 2, 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, 0, 0, 0, 63,
- 0, 0, 0, 0, 72,244, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -7818,58 +7859,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0,160,119, 78, 63, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62, 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63,
+ 68, 65, 84, 65, 56, 1, 0, 0,144,241,210, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 24,169,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186,104,136,216, 3, 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, 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, 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, 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, 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, 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, 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, 16, 0, 35, 0, 0, 0,
- 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0, 64,238, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,104,136,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,152,231,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0,248,240,210, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 83,109,101, 97,114, 0, 48, 48, 49, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 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, 0, 0, 0, 63, 0, 0, 0, 0,216,170,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0, 72,244, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191,
- 46,189,194, 61,216,245, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,216,245, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63,
- 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0, 88,246, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0, 8,255, 47, 5, 0, 0, 0, 0,168,237, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 83,109,111,111,116,104, 0, 48, 48, 49,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0,248,252, 47, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -7893,58 +7934,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 35, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0, 48,232,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,216,170,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191, 46,189,194, 61, 24,137,216, 3, 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, 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, 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, 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, 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, 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, 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, 2, 0, 35, 0, 0, 0,
- 4, 4, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0, 64, 63, 0, 0, 64, 63, 0, 0, 64, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0,240,246, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 24,137,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63, 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,168,238,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0,152,231,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 83,109,111,111,116,104, 0, 48, 48, 49, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 33, 3, 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, 0, 63, 0, 0, 0, 0,152,172,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,248,252, 47, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186,136,254, 47, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,136,254, 47, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0, 8,255, 47, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,184, 7, 48, 5, 0, 0, 0, 0, 88,246, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 83,110, 97,107,101, 32, 72,111,111,107,
- 0, 48, 48, 49, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0,168, 5, 48, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -7968,58 +8009,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 35, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0, 64, 63, 0, 0, 64, 63, 0, 0, 64, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0, 64,239,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,152,172,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186,200,137,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,200,137,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,184,245,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0,168,238,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 83,110, 97,107,101, 32, 72,111,111,107, 0, 48, 48, 49, 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, 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, 0, 0, 2, 0, 75, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 62,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0,160,255, 47, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 3, 34, 3, 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, 0, 63, 0, 0, 0, 0, 88,174,218, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,168, 5, 48, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186, 56, 7, 48, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 56, 7, 48, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,184, 7, 48, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,104, 16, 48, 5, 0, 0, 0, 0, 8,255, 47, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 83,111,102,116,101,110, 0, 48, 49, 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, 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, 1, 0, 0, 2, 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, 0, 0, 0, 63,
- 0, 0, 0, 0, 88, 14, 48, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -8043,58 +8084,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0, 80,246,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 88,174,218, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186,120,138,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,120,138,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,200,252,218, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0,184,245,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 83,111,102,116,101,110, 0, 48, 49, 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, 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, 0, 0, 0, 0, 0, 0, 0, 16, 0, 35, 0, 0, 0,
- 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0, 80, 8, 48, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 2, 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, 0, 0, 0, 63, 0, 0, 0, 0,152,103,219, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0, 88, 14, 48, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191,
- 46,189,194, 61,232, 15, 48, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,232, 15, 48, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63,
- 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,104, 16, 48, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0,184, 7, 48, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 83,117, 98,116,114, 97, 99,116, 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, 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, 1, 0, 0, 2, 35, 3, 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, 0, 63,
- 0, 0, 0, 0, 8, 23, 48, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -8118,58 +8159,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 35, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0, 96,253,218, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,152,103,219, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191, 46,189,194, 61, 40,139,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 40,139,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63, 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,216, 3,219, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0,200,252,218, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 83,117, 98,116,114, 97, 99,116, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 35, 0, 0, 0,
- 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0, 0, 17, 48, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 2, 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, 0, 0, 0, 63, 0, 0, 0, 0, 88,105,219, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0, 8, 23, 48, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191,
- 46,189,194, 61,152, 24, 48, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,152, 24, 48, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63,
- 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0, 24, 25, 48, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,200, 33, 48, 5, 0, 0, 0, 0,104, 16, 48, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 84,101,120, 68,114, 97,119, 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, 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, 2, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0,184, 31, 48, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -8193,58 +8234,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 35, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0,112, 4,219, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 88,105,219, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63, 14,215,126,191, 54,189,194, 61, 14,215,126,191, 46,189,194, 61,216,139,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,216,139,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62, 31,133,107, 63, 0, 0, 0, 0, 0, 0, 64, 63, 10,215,163, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,232, 10,219, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0,216, 3,219, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 84,101,120, 68,114, 97,119, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 35, 0, 0, 0,
- 4, 4, 0, 8, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 51, 51, 51, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63, 68, 65, 84, 65, 56, 1, 0, 0,176, 25, 48, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 2, 0, 0, 3, 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, 0, 0, 0, 63, 0, 0, 0, 0, 24,107,219, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,184, 31, 48, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186, 72, 33, 48, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 72, 33, 48, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,200, 33, 48, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0,120, 42, 48, 5, 0, 0, 0, 0, 24, 25, 48, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 84,104,117,109, 98, 0, 48, 48, 49, 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, 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, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0,104, 40, 48, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -8268,58 +8309,58 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 35, 0, 0, 0, 4, 4, 0, 8, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 51, 51, 51, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 20,174,199, 62, 20,174,199, 62, 0, 0,128, 63,
+ 68, 65, 84, 65, 56, 1, 0, 0,128, 11,219, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0, 24,107,219, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186,136,140,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,136,140,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0,248, 17,219, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0, 8, 25,219, 3, 0, 0, 0, 0,232, 10,219, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 84,104,117,109, 98, 0, 48, 48, 49, 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, 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, 0, 0, 0, 0, 0, 0, 0, 2, 0, 75, 0, 0, 0,
- 4, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 62,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0, 96, 34, 48, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 3, 38, 3, 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, 0, 63, 0, 0, 0, 0,216,108,219, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0,104, 40, 48, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186,248, 41, 48, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,248, 41, 48, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0,
- 88, 6, 0, 0,120, 42, 48, 5, 0, 0, 0, 0,124, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 33, 48, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 84,119,105,115,116, 0, 48, 48, 49, 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, 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, 1, 0, 0, 3, 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, 0, 0, 0, 63,
- 0, 0, 0, 0, 24, 49, 48, 5, 0, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 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, 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, 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, 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,
@@ -8343,43 +8384,54 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 75, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0,144, 18,219, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,216,108,219, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186, 56,141,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 56,141,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 0, 0, 88, 6, 0, 0, 8, 25,219, 3, 0, 0, 0, 0,
+123, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 17,219, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 66, 82, 84,119,105,115,116, 0, 48, 48, 49, 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, 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, 0, 0, 0, 0, 0, 0, 0, 2, 0, 75, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 10, 0, 0, 0, 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 62,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0, 16, 43, 48, 5, 0, 0, 0, 0, 25, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 3, 39, 3, 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, 0, 63, 0, 0, 0, 0,152,110,219, 3, 0, 0, 0, 0,
+ 1, 0, 1, 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, 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, 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, 1, 2, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65,
- 64, 1, 0, 0, 24, 49, 48, 5, 0, 0, 0, 0,120, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,
-114, 97,255,186,168, 50, 48, 5, 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,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 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, 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, 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, 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, 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, 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,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,168, 50, 48, 5,
- 0, 0, 0, 0,118, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63,
- 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 85, 83, 69, 82,
-104, 38, 0, 0, 32,206,200, 4, 0, 0, 0, 0,210, 0, 0, 0, 1, 0, 0, 0, 1, 8, 17, 1, 63, 6, 0, 0, 5, 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, 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, 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, 0, 0, 0,
@@ -8404,19 +8456,39 @@ char datatoc_startup_blend[]= {
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,
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,
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,
- 47, 47, 0, 85,115,101,114,115, 47,116,111,110, 47, 68,101,115,107,116,111,112, 47, 0, 45,112,111,119,101,114,112, 99, 47, 98,
-105,110, 47, 98,108,101,110,100,101,114, 46, 97,112,112, 47, 67,111,110,116,101,110,116,115, 47, 82,101,115,111,117,114, 99,101,
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 75, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 10, 0, 0, 0,
+ 75, 0, 0, 0,102,102,102, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,205,204,204, 62, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 62, 0, 0,128, 62, 0, 0,128, 63, 0, 0,128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 56, 1, 0, 0,160, 25,219, 3, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 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, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 68, 65, 84, 65, 64, 1, 0, 0,152,110,219, 3, 0, 0, 0, 0,
+119, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 4, 0, 0, 0, 0, 0,128, 67,
+ 0, 0, 0, 0, 0, 0,128, 63,224,255,127,191, 46, 95,255,186,224,255,127,191,114, 97,255,186,232,141,216, 3, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,232,141,216, 3, 0, 0, 0, 0,117, 1, 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 62,215,163,112, 63, 0, 0, 0, 0, 0, 0, 64, 63,143,194,117, 61,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 85, 83, 69, 82,112, 38, 0, 0, 96, 41,141, 67, 1, 0, 0, 0,
+209, 0, 0, 0, 1, 0, 0, 0, 1, 8, 17, 1, 63, 6, 0, 0, 5, 0, 0, 0, 67, 58, 92, 85,115,101,114,115, 92,115,101,114,
+103,101,121, 92, 65,112,112, 68, 97,116, 97, 92, 76,111, 99, 97,108, 92, 84,101,109,112, 92, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -8428,7 +8500,6 @@ char datatoc_startup_blend[]= {
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,
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,
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,
- 47, 47, 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, 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, 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, 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,
@@ -8440,6 +8511,9 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 85,115,101,114,115, 47,116,111,110,
+ 47, 68,101,115,107,116,111,112, 47, 0, 45,112,111,119,101,114,112, 99, 47, 98,105,110, 47, 98,108,101,110,100,101,114, 46, 97,
+112,112, 47, 67,111,110,116,101,110,116,115, 47, 82,101,115,111,117,114, 99,101, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -8460,8 +8534,8 @@ char datatoc_startup_blend[]= {
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,
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,
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,
- 47, 47, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -8493,6 +8567,7 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -8556,7 +8631,6 @@ char datatoc_startup_blend[]= {
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,
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,
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,
- 47, 47, 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, 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, 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, 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,
@@ -8589,6 +8663,7 @@ char datatoc_startup_blend[]= {
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,
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,
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -8644,1701 +8719,1746 @@ char datatoc_startup_blend[]= {
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,
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,
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,
- 1, 0, 0, 0, 35, 0, 0, 0, 2, 0, 94, 1, 8, 0, 0, 0, 3, 0, 0, 0, 56, 52, 39, 0, 0, 0, 0, 0, 1, 0, 2, 0,
- 0, 8, 0, 0, 2, 0, 0, 0, 68,172, 0, 0, 36, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 72, 0, 0, 0, 0, 0, 64, 0,
- 5, 0, 2, 0,216, 89, 48, 5, 0, 0, 0, 0,216, 89, 48, 5, 0, 0, 0, 0,104, 62, 48, 5, 0, 0, 0, 0,104, 62, 48, 5,
- 0, 0, 0, 0,248,129, 48, 5, 0, 0, 0, 0,248,129, 48, 5, 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, 0, 0, 0, 0,168, 51, 47, 5, 0, 0, 0, 0,200, 61, 48, 5,
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,
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,
- 0, 0, 0, 0, 32, 0, 0, 0, 1, 0, 2, 0, 25, 0, 0, 0, 20, 0, 20, 0, 1, 0, 0, 0, 0, 0, 0, 0,205,204, 76, 63,
-205,204, 76, 63,205,204, 76, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 30, 90,100,191,
-154,153,153, 62,102,102,102, 63, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 31,250,254, 62, 9, 0, 0, 63,156,153, 25, 63,
- 0, 0, 0, 0,205,204, 76, 62,205,204, 76, 62,205,204, 76, 62, 0, 0,128, 63, 44,135, 22, 63, 32,133,235, 62,184,243,125, 62,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,195, 73, 76, 63, 42,135, 86, 63, 0, 0,128, 63, 0, 0, 0, 0, 1, 43,135, 61,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 16, 47, 93, 62, 58,180,200,190, 24, 47, 93,190, 0, 0, 0, 0, 14, 0, 1, 0,
- 25, 0, 15, 0,120, 0, 60, 0, 3, 0, 5, 0,128, 0, 0, 0, 0, 0, 0, 0,144, 31, 15, 0, 6, 0, 25, 0, 8, 0, 10, 0,
-200, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 0, 10, 0, 50, 0, 20, 0, 2, 0, 1, 0, 0, 0, 0, 0,128, 63, 60, 0, 0, 0,
- 0, 0, 2, 0, 2, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 10, 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, 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, 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, 68, 65, 84, 65,
-120, 35, 0, 0,216, 89, 48, 5, 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68,101,102, 97,117,108,116, 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, 25, 25, 25,255,153,153,153,255,100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 0, 25, 25, 25,255,153,153,153,255,100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 1, 0, 15, 0,
-241,255, 0, 0, 25, 25, 25,255,153,153,153,255,153,153,153,255, 90, 90, 90,255, 0, 0, 0,255,255,255,255,255, 1, 0, 0, 0,
- 25, 0, 0, 0, 0, 0, 0,255, 70, 70, 70,255, 86,128,194,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, 1, 0, 15, 0,
-241,255, 0, 0, 0, 0, 0,255, 70, 70, 70,255, 70, 70, 70,255,255,255,255,255, 0, 0, 0,255,255,255,255,255, 1, 0, 15, 0,
-241,255, 0, 0, 25, 25, 25,255,153,153,153,255,100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 0, 25, 25, 25,255,180,180,180,255,153,153,153,255, 90, 90, 90,255, 0, 0, 0,255,255,255,255,255, 1, 0,236,255,
- 0, 0, 0, 0, 25, 25, 25,255,180,180,180,255,153,153,153,255,128,128,128,255, 0, 0, 0,255,255,255,255,255, 1, 0,236,255,
- 0, 0, 0, 0, 0, 0, 0,255, 70, 70, 70,255, 70, 70, 70,255,255,255,255,255,255,255,255,255,204,204,204,255, 1, 0, 15, 0,
-241,255, 0, 0, 0, 0, 0,255, 63, 63, 63,255, 86,128,194,255,255,255,255,255, 0, 0, 0,255, 0, 0, 0,255, 0, 0, 25, 0,
-236,255, 0, 0, 0, 0, 0,255, 25, 25, 25,230, 45, 45, 45,230,100,100,100,255,160,160,160,255,255,255,255,255, 0, 0, 25, 0,
-236,255, 0, 0, 0, 0, 0,255, 0, 0, 0, 0, 86,128,194,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, 1, 0, 38, 0,
- 0, 0, 0, 0, 25, 25, 25,255,128,128,128,255,100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 0, 50, 50, 50,180, 80, 80, 80,180,100,100,100,180,128,128,128,255, 0, 0, 0,255,255,255,255,255, 1, 0, 5, 0,
-251,255, 0, 0, 0, 0, 0,255,190,190,190,255,100,100,100,180, 68, 68, 68,255, 0, 0, 0,255,255,255,255,255, 0, 0, 5, 0,
-251,255, 0, 0, 0, 0, 0,255, 0, 0, 0, 0, 86,128,194,255, 0, 0, 0,255, 0, 0, 0,255, 0, 0, 0,255, 0, 0, 0, 0,
- 0, 0, 0, 0,115,190, 76,255, 90,166, 51,255,240,235,100,255,215,211, 75,255,180, 0,255,255,153, 0,230,255, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 25, 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, 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,130,130,130,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,
- 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255,
- 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0, 0, 0, 0, 18,255,133, 0, 60,
-255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255,
- 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,
-240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,
-240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,255,255,255,128, 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, 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, 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, 57, 57, 57,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0,
- 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0,255, 0, 0, 0, 0,255,170, 64,255, 8, 48, 8,255,
- 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255, 32,255,255,255,
- 75, 75, 75,255,204, 0,153,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 32, 0, 0,255, 0, 32, 0,255, 0, 0,128,255,
- 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,
-144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,240,144,160,255,255,255,255,255, 0, 0, 0,255,144,144, 0,255,
- 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 1, 4, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 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, 0,200,200,200,255, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 76, 76,255, 0, 0, 0, 0,250,250,250,255,
- 15, 15, 15,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,102,102,102,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,160,160,160,100,127,112,112,100,255,140, 25,255,250,250,250,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,
- 0, 0, 0, 0, 0, 0, 0, 0,130,130,130,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255,
- 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0, 0, 0, 0, 18,255,133, 0, 60,
-255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255,
- 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,
-240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,
-240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,250,250,250,255,250,250,250,255,250,250,250,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,255,255,255,128, 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, 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, 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,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,102,102,102,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,255,255,255,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,150,150,150,100,112,112,112,100, 96,192, 64,255,
- 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 79,101, 73,255,
-135,177,125,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255,
- 75, 75, 75,255, 0, 0, 0, 0, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,
-144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255,
- 64,144, 48,255,128, 48, 96,255,153, 64, 48,255, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255,240,175,144,255,
- 82, 96,110,255,124,137,150,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 4, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0,255,255,133, 0,255,
- 4, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,
- 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255,
- 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0, 0, 0, 0, 18,255,133, 0, 60,
-255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255,
- 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,
-240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,
-240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,255,255,255,128, 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, 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, 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,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,102,102,102,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,255,255,255,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,150,150,150,100,112,112,112,100, 96,192, 64,255,
- 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 79,101, 73,255,
-135,177,125,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255,
- 75, 75, 75,255, 0, 0, 0, 0, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255, 80,200,255, 80, 12, 10, 10,128,255,140, 0,255, 96,192, 64,255,
-144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255,
- 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 0, 0, 0, 0,
- 82, 96,110,255,124,137,150,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 4, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0,255,255,133, 0,255,
- 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,102,102,102,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,255,255,255,150, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,150,150,150,100,112,112,112,100, 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,
- 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 79,101, 73,255,135,177,125,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255,
- 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0, 0, 0, 0, 18,255,133, 0, 60,
-255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255,
- 80,200,255, 80, 12, 10, 10,128,255,140, 0,255, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,
-240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,
-240,255, 64,255, 64,192, 48,255,240,144,160,255, 0, 0, 0, 0, 82, 96,110,255,124,137,150,255, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 4, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,255,255,255,128, 0, 0, 0,255,255,133, 0,255, 3, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,116,116,116,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0,
- 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255,
- 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255,
- 75, 75, 75,255, 0, 0, 0, 0, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,
-144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255,
- 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81,105,135,255,109, 88,129,255, 78,152, 62,255,
- 46,143,143,255,169, 84,124,255,126,126, 80,255,162, 95,111,255,109,145,131,255,255,255,255,128, 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, 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, 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, 53, 53, 53,255, 0, 0, 0, 0, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,
- 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255,
- 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,255,255,255, 10,255,133, 0, 60,
-255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255,
- 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,
-240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,
-240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,255,255,255,128, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-114,114,114,255, 18, 66,176, 38,255,133, 0,178,255,133, 0,127, 0,255, 0,255,255, 0, 0,255,225,210,195, 35, 0, 0, 0, 0,
- 0, 0, 0, 0,153,153,153,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,143,143,143,255,198,119,119,255,255, 0, 0,255,
- 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255,
- 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255,
- 75, 75, 75,255, 0, 0, 0, 0, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,
-144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255,
- 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 0,
-100, 0, 0,255, 0, 0,200,255,128, 0, 80,255, 95, 95, 0,255, 0,100, 50,255, 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,255,255,255,128, 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, 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, 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,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,
- 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255,
- 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0, 0, 0, 0, 18,255,133, 0, 60,
-255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255,
- 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,
-240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,
-240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,255,255,255,128, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51,127, 51, 76,
-130,135,140, 76,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,173,173,173,255,127,112,112,100, 0, 0, 0, 0,
- 91, 91, 91,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255,
- 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255,
- 75, 75, 75,255, 0, 0, 0, 0, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,
-144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255,
- 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 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, 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, 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, 57, 57, 57,255, 0, 0, 0, 0, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,
- 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255,
- 0, 0, 0,255,255,255,255,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0, 0, 0, 0, 18,255,133, 0, 60,
-255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255,
- 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,
-240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,
-240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 5,155,155,155,160,100,104,111,255,111,106,100,255,104,106,117,255,
-105,117,110,255, 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,255,255,255,128, 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, 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, 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,100,100,100,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0,
- 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255,
- 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255,
- 75, 75, 75,255, 0, 0, 0, 0, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,
-144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255,
- 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 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, 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, 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,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,
- 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255,
- 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0, 0, 0, 0, 18,255,133, 0, 60,
-255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255,
- 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,
-240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,
-240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,255,255,255,128, 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, 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, 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,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0,
- 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255,
- 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255,
- 75, 75, 75,255, 0, 0, 0, 0, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,
-144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255,
- 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,128,255,255,255,255,255,255, 0,170, 0,255,220, 96, 96,255,220, 96, 96,255, 3, 0, 4, 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, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 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, 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, 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, 57, 57, 57,255, 0, 0, 0, 0, 0, 0, 0,255,
-255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,
-255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,
- 0, 0, 0,255, 0, 0, 0, 0,255,170, 64,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255,
- 0, 0, 0,255,255,160, 0,255,219, 37, 18,255, 32,255,255,255, 75, 75, 75,255,204, 0,153,255, 0, 0, 0, 18,255,133, 0, 60,
-255,133, 0,255, 32, 0, 0,255, 0, 32, 0,255, 0, 0,128,255, 0, 0, 0, 0, 34,221,221,255, 35, 97,221,255,200,200,200,255,
- 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,219, 37, 18,255,240,255, 64,255,
-240,144,160,255,255,255,255,255, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255, 0, 0, 0, 0, 0, 0, 0,255,
-240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 1, 4, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,255,255,255,128, 0, 0, 0,255,255,255, 0,255, 4, 0, 0, 0,255,127,127, 0,255,255,255,255,255,255,255, 0,
-255,127, 0, 0,255,127,127,127,255,200,200,200,255,255, 0, 0,255, 0, 0,255,255, 0, 0, 0,255, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,154, 0, 0,255,189, 17, 17,255,247, 10, 10,255, 0, 0, 0, 0,247, 64, 24,255,246,105, 19,255,250,153, 0,255,
- 0, 0, 0, 0, 30,145, 9,255, 89,183, 11,255,131,239, 29,255, 0, 0, 0, 0, 10, 54,148,255, 54,103,223,255, 94,193,239,255,
- 0, 0, 0, 0,169, 41, 78,255,193, 65,106,255,240, 93,145,255, 0, 0, 0, 0, 67, 12,120,255, 84, 58,163,255,135,100,213,255,
- 0, 0, 0, 0, 36,120, 90,255, 60,149,121,255,111,182,171,255, 0, 0, 0, 0, 75,112,124,255,106,134,145,255,155,194,205,255,
- 0, 0, 0, 0,244,201, 12,255,238,194, 54,255,243,255, 0,255, 0, 0, 0, 0, 30, 32, 36,255, 72, 76, 86,255,255,255,255,255,
- 0, 0, 0, 0,111, 47,106,255,152, 69,190,255,211, 48,214,255, 0, 0, 0, 0,108,142, 34,255,127,176, 34,255,187,239, 91,255,
- 0, 0, 0, 0,141,141,141,255,176,176,176,255,222,222,222,255, 0, 0, 0, 0,131, 67, 38,255,139, 88, 17,255,189,106, 17,255,
- 0, 0, 0, 0, 8, 49, 14,255, 28, 67, 11,255, 52, 98, 43,255, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0,168, 51, 47, 5, 0, 0, 0, 0,208, 0, 0, 0,
- 1, 0, 0, 0, 72, 52, 47, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,105,111, 95,115, 99,101,110,101, 95, 51,100,115,
- 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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0, 72, 52, 47, 5,
- 0, 0, 0, 0,208, 0, 0, 0, 1, 0, 0, 0,152,125, 48, 5, 0, 0, 0, 0,168, 51, 47, 5, 0, 0, 0, 0,105,111, 95,115,
- 99,101,110,101, 95,102, 98,120, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 80, 0, 0, 0,152,125, 48, 5, 0, 0, 0, 0,208, 0, 0, 0, 1, 0, 0, 0, 56,126, 48, 5, 0, 0, 0, 0, 72, 52, 47, 5,
- 0, 0, 0, 0,105,111, 95, 97,110,105,109, 95, 98,118,104, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0, 56,126, 48, 5, 0, 0, 0, 0,208, 0, 0, 0, 1, 0, 0, 0,216,126, 48, 5,
- 0, 0, 0, 0,152,125, 48, 5, 0, 0, 0, 0,105,111, 95,109,101,115,104, 95,112,108,121, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0,216,126, 48, 5, 0, 0, 0, 0,208, 0, 0, 0,
- 1, 0, 0, 0,120,127, 48, 5, 0, 0, 0, 0, 56,126, 48, 5, 0, 0, 0, 0,105,111, 95,115, 99,101,110,101, 95,111, 98,106,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0,120,127, 48, 5,
- 0, 0, 0, 0,208, 0, 0, 0, 1, 0, 0, 0, 24,128, 48, 5, 0, 0, 0, 0,216,126, 48, 5, 0, 0, 0, 0,105,111, 95,115,
- 99,101,110,101, 95,120, 51,100, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 80, 0, 0, 0, 24,128, 48, 5, 0, 0, 0, 0,208, 0, 0, 0, 1, 0, 0, 0,184,128, 48, 5, 0, 0, 0, 0,120,127, 48, 5,
- 0, 0, 0, 0,105,111, 95,109,101,115,104, 95,115,116,108, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0,184,128, 48, 5, 0, 0, 0, 0,208, 0, 0, 0, 1, 0, 0, 0, 88,129, 48, 5,
- 0, 0, 0, 0, 24,128, 48, 5, 0, 0, 0, 0,105,111, 95,109,101,115,104, 95,117,118, 95,108, 97,121,111,117,116, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0, 88,129, 48, 5, 0, 0, 0, 0,208, 0, 0, 0,
- 1, 0, 0, 0,200, 61, 48, 5, 0, 0, 0, 0,184,128, 48, 5, 0, 0, 0, 0,105,111, 95, 99,117,114,118,101, 95,115,118,103,
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0,200, 61, 48, 5,
- 0, 0, 0, 0,208, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,129, 48, 5, 0, 0, 0, 0, 99,121, 99,108,
-101,115, 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, 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, 68, 65, 84, 65,
-232, 0, 0, 0,248,129, 48, 5, 0, 0, 0, 0,200, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68,101,102, 97,117,108,116, 32, 83,116,121,108,101, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 12, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,255,255, 0, 0,154,153, 25, 62,
- 0, 0,128, 63, 0, 0, 12, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,255,255, 0, 0, 0, 0,128, 62,
- 0, 0, 0, 0, 0, 0, 11, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,255,255, 0, 0,154,153, 25, 62,
- 0, 0,128, 63, 0, 0, 11, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 8, 0, 5, 0, 5, 0, 8, 0, 2, 0, 8, 0, 4, 0, 0, 0, 68, 78, 65, 49,
- 20, 4, 1, 0, 24, 38,172, 77,130,127, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 83, 68, 78, 65, 78, 65, 77, 69, 50, 13, 0, 0,
- 42,110,101,120,116, 0, 42,112,114,101,118, 0, 42,100, 97,116, 97, 0, 42,102,105,114,115,116, 0, 42,108, 97,115,116, 0,120,
- 0,121, 0,122, 0,120,109,105,110, 0,120,109, 97,120, 0,121,109,105,110, 0,121,109, 97,120, 0, 42,112,111,105,110,116,101,
-114, 0,103,114,111,117,112, 0,118, 97,108, 0,118, 97,108, 50, 0,116,121,112,101, 0,115,117, 98,116,121,112,101, 0,102,108,
- 97,103, 0,110, 97,109,101, 91, 54, 52, 93, 0,115, 97,118,101,100, 0,100, 97,116, 97, 0,108,101,110, 0,116,111,116, 97,108,
-108,101,110, 0, 42,110,101,119,105,100, 0, 42,108,105, 98, 0,110, 97,109,101, 91, 54, 54, 93, 0,112, 97,100, 0,117,115, 0,
-105, 99,111,110, 95,105,100, 0,112, 97,100, 50, 0, 42,112,114,111,112,101,114,116,105,101,115, 0,105,100, 0, 42,105,100, 98,
-108,111, 99,107, 0, 42,102,105,108,101,100, 97,116, 97, 0,110, 97,109,101, 91, 49, 48, 50, 52, 93, 0,102,105,108,101,112, 97,
-116,104, 91, 49, 48, 50, 52, 93, 0,116,111,116, 0, 42,112, 97,114,101,110,116, 0,119, 91, 50, 93, 0,104, 91, 50, 93, 0, 99,
-104, 97,110,103,101,100, 91, 50, 93, 0, 99,104, 97,110,103,101,100, 95,116,105,109,101,115,116, 97,109,112, 91, 50, 93, 0, 42,
-114,101, 99,116, 91, 50, 93, 0, 42,111, 98, 0, 98,108,111, 99,107,116,121,112,101, 0, 97,100,114, 99,111,100,101, 0,110, 97,
-109,101, 91, 49, 50, 56, 93, 0, 42, 98,112, 0, 42, 98,101,122,116, 0,109, 97,120,114, 99,116, 0,116,111,116,114, 99,116, 0,
-118, 97,114,116,121,112,101, 0,116,111,116,118,101,114,116, 0,105,112,111, 0,101,120,116,114, 97,112, 0,114,116, 0, 98,105,
-116,109, 97,115,107, 0,115,108,105,100,101, 95,109,105,110, 0,115,108,105,100,101, 95,109, 97,120, 0, 99,117,114,118, 97,108,
- 0, 42,100,114,105,118,101,114, 0, 99,117,114,118,101, 0, 99,117,114, 0,115,104,111,119,107,101,121, 0,109,117,116,101,105,
-112,111, 0,112,111,115, 0,114,101,108, 97,116,105,118,101, 0,116,111,116,101,108,101,109, 0, 42,119,101,105,103,104,116,115,
- 0,118,103,114,111,117,112, 91, 54, 52, 93, 0,115,108,105,100,101,114,109,105,110, 0,115,108,105,100,101,114,109, 97,120, 0,
-117,105,100, 0,112, 97,100, 51, 0, 42, 97,100,116, 0, 42,114,101,102,107,101,121, 0,101,108,101,109,115,116,114, 91, 54, 52,
- 93, 0,101,108,101,109,115,105,122,101, 0, 98,108,111, 99,107, 0, 42,105,112,111, 0, 42,102,114,111,109, 0,116,111,116,107,
-101,121, 0,115,108,117,114,112,104, 0,117,105,100,103,101,110, 0, 42,108,105,110,101, 0, 42,102,111,114,109, 97,116, 0, 98,
-108,101,110, 0,108,105,110,101,110,111, 0,115,116, 97,114,116, 0,101,110,100, 0,112, 97,100, 49, 0,102,108, 97,103,115, 0,
- 99,111,108,111,114, 91, 52, 93, 0,112, 97,100, 91, 52, 93, 0, 42,110, 97,109,101, 0,110,108,105,110,101,115, 0,108,105,110,
-101,115, 0, 42, 99,117,114,108, 0, 42,115,101,108,108, 0, 99,117,114, 99, 0,115,101,108, 99, 0,109, 97,114,107,101,114,115,
- 0, 42,117,110,100,111, 95, 98,117,102, 0,117,110,100,111, 95,112,111,115, 0,117,110,100,111, 95,108,101,110, 0, 42, 99,111,
-109,112,105,108,101,100, 0,109,116,105,109,101, 0,115,105,122,101, 0,115,101,101,107, 0,100,116,120, 0,112, 97,115,115,101,
-112, 97,114,116, 97,108,112,104, 97, 0, 99,108,105,112,115,116, 97, 0, 99,108,105,112,101,110,100, 0,108,101,110,115, 0,111,
-114,116,104,111, 95,115, 99, 97,108,101, 0,100,114, 97,119,115,105,122,101, 0,115,101,110,115,111,114, 95,120, 0,115,101,110,
-115,111,114, 95,121, 0,115,104,105,102,116,120, 0,115,104,105,102,116,121, 0, 89, 70, 95,100,111,102,100,105,115,116, 0, 42,
-100,111,102, 95,111, 98, 0,115,101,110,115,111,114, 95,102,105,116, 0,112, 97,100, 91, 55, 93, 0, 42,115, 99,101,110,101, 0,
-102,114, 97,109,101,110,114, 0,102,114, 97,109,101,115, 0,111,102,102,115,101,116, 0,115,102,114, 97, 0,102,105,101, 95,105,
-109, 97, 0, 99,121, 99,108, 0,111,107, 0,109,117,108,116,105, 95,105,110,100,101,120, 0,108, 97,121,101,114, 0,112, 97,115,
-115, 0,105, 98,117,102,115, 0, 42,103,112,117,116,101,120,116,117,114,101, 0, 42, 97,110,105,109, 0, 42,114,114, 0, 42,114,
-101,110,100,101,114,115, 91, 56, 93, 0,114,101,110,100,101,114, 95,115,108,111,116, 0,108, 97,115,116, 95,114,101,110,100,101,
-114, 95,115,108,111,116, 0,115,111,117,114, 99,101, 0,108, 97,115,116,102,114, 97,109,101, 0,116,112, 97,103,101,102,108, 97,
-103, 0,116,111,116, 98,105,110,100, 0,120,114,101,112, 0,121,114,101,112, 0,116,119,115,116, 97, 0,116,119,101,110,100, 0,
- 98,105,110,100, 99,111,100,101, 0, 42,114,101,112, 98,105,110,100, 0, 42,112, 97, 99,107,101,100,102,105,108,101, 0, 42,112,
-114,101,118,105,101,119, 0,108, 97,115,116,117,112,100, 97,116,101, 0,108, 97,115,116,117,115,101,100, 0, 97,110,105,109,115,
-112,101,101,100, 0,103,101,110, 95,120, 0,103,101,110, 95,121, 0,103,101,110, 95,116,121,112,101, 0,103,101,110, 95,102,108,
- 97,103, 0, 97,115,112,120, 0, 97,115,112,121, 0,116,101,120, 99,111, 0,109, 97,112,116,111, 0,109, 97,112,116,111,110,101,
-103, 0, 98,108,101,110,100,116,121,112,101, 0, 42,111, 98,106,101, 99,116, 0, 42,116,101,120, 0,117,118,110, 97,109,101, 91,
- 54, 52, 93, 0,112,114,111,106,120, 0,112,114,111,106,121, 0,112,114,111,106,122, 0,109, 97,112,112,105,110,103, 0,111,102,
-115, 91, 51, 93, 0,115,105,122,101, 91, 51, 93, 0,114,111,116, 0,116,101,120,102,108, 97,103, 0, 99,111,108,111,114,109,111,
-100,101,108, 0,112,109, 97,112,116,111, 0,112,109, 97,112,116,111,110,101,103, 0,110,111,114,109, 97,112,115,112, 97, 99,101,
- 0,119,104,105, 99,104, 95,111,117,116,112,117,116, 0, 98,114,117,115,104, 95,109, 97,112, 95,109,111,100,101, 0,114, 0,103,
- 0, 98, 0,107, 0,100,101,102, 95,118, 97,114, 0, 99,111,108,102, 97, 99, 0,118, 97,114,102, 97, 99, 0,110,111,114,102, 97,
- 99, 0,100,105,115,112,102, 97, 99, 0,119, 97,114,112,102, 97, 99, 0, 99,111,108,115,112,101, 99,102, 97, 99, 0,109,105,114,
-114,102, 97, 99, 0, 97,108,112,104, 97,102, 97, 99, 0,100,105,102,102,102, 97, 99, 0,115,112,101, 99,102, 97, 99, 0,101,109,
-105,116,102, 97, 99, 0,104, 97,114,100,102, 97, 99, 0,114, 97,121,109,105,114,114,102, 97, 99, 0,116,114, 97,110,115,108,102,
- 97, 99, 0, 97,109, 98,102, 97, 99, 0, 99,111,108,101,109,105,116,102, 97, 99, 0, 99,111,108,114,101,102,108,102, 97, 99, 0,
- 99,111,108,116,114, 97,110,115,102, 97, 99, 0,100,101,110,115,102, 97, 99, 0,115, 99, 97,116,116,101,114,102, 97, 99, 0,114,
-101,102,108,102, 97, 99, 0,116,105,109,101,102, 97, 99, 0,108,101,110,103,116,104,102, 97, 99, 0, 99,108,117,109,112,102, 97,
- 99, 0,100, 97,109,112,102, 97, 99, 0,107,105,110,107,102, 97, 99, 0,114,111,117,103,104,102, 97, 99, 0,112, 97,100,101,110,
-115,102, 97, 99, 0,103,114, 97,118,105,116,121,102, 97, 99, 0,108,105,102,101,102, 97, 99, 0,115,105,122,101,102, 97, 99, 0,
-105,118,101,108,102, 97, 99, 0,102,105,101,108,100,102, 97, 99, 0,115,104, 97,100,111,119,102, 97, 99, 0,122,101,110,117,112,
-102, 97, 99, 0,122,101,110,100,111,119,110,102, 97, 99, 0, 98,108,101,110,100,102, 97, 99, 0, 42,104, 97,110,100,108,101, 0,
- 42,112,110, 97,109,101, 0, 42,115,116,110, 97,109,101,115, 0,115,116,121,112,101,115, 0,118, 97,114,115, 0, 42,118, 97,114,
-115,116,114, 0, 42,114,101,115,117,108,116, 0, 42, 99,102,114, 97, 0,100, 97,116, 97, 91, 51, 50, 93, 0, 40, 42,100,111,105,
-116, 41, 40, 41, 0, 40, 42,105,110,115,116, 97,110, 99,101, 95,105,110,105,116, 41, 40, 41, 0, 40, 42, 99, 97,108,108, 98, 97,
- 99,107, 41, 40, 41, 0,118,101,114,115,105,111,110, 0, 97, 0,105,112,111,116,121,112,101, 0, 42,105,109, 97, 0, 42, 99,117,
- 98,101, 91, 54, 93, 0,105,109, 97,116, 91, 52, 93, 91, 52, 93, 0,111, 98,105,109, 97,116, 91, 51, 93, 91, 51, 93, 0,115,116,
-121,112,101, 0,118,105,101,119,115, 99, 97,108,101, 0,110,111,116,108, 97,121, 0, 99,117, 98,101,114,101,115, 0,100,101,112,
-116,104, 0,114,101, 99, 97,108, 99, 0,108, 97,115,116,115,105,122,101, 0,102, 97,108,108,111,102,102, 95,116,121,112,101, 0,
-102, 97,108,108,111,102,102, 95,115,111,102,116,110,101,115,115, 0,114, 97,100,105,117,115, 0, 99,111,108,111,114, 95,115,111,
-117,114, 99,101, 0,116,111,116,112,111,105,110,116,115, 0,112,100,112, 97,100, 0,112,115,121,115, 0,112,115,121,115, 95, 99,
- 97, 99,104,101, 95,115,112, 97, 99,101, 0,111, 98, 95, 99, 97, 99,104,101, 95,115,112, 97, 99,101, 0, 42,112,111,105,110,116,
- 95,116,114,101,101, 0, 42,112,111,105,110,116, 95,100, 97,116, 97, 0,110,111,105,115,101, 95,115,105,122,101, 0,110,111,105,
-115,101, 95,100,101,112,116,104, 0,110,111,105,115,101, 95,105,110,102,108,117,101,110, 99,101, 0,110,111,105,115,101, 95, 98,
- 97,115,105,115, 0,112,100,112, 97,100, 51, 91, 51, 93, 0,110,111,105,115,101, 95,102, 97, 99, 0,115,112,101,101,100, 95,115,
- 99, 97,108,101, 0,102, 97,108,108,111,102,102, 95,115,112,101,101,100, 95,115, 99, 97,108,101, 0,112,100,112, 97,100, 50, 0,
- 42, 99,111, 98, 97, 0, 42,102, 97,108,108,111,102,102, 95, 99,117,114,118,101, 0,114,101,115,111,108, 91, 51, 93, 0,105,110,
-116,101,114,112, 95,116,121,112,101, 0,102,105,108,101, 95,102,111,114,109, 97,116, 0,101,120,116,101,110,100, 0,115,109,111,
-107,101,100, 95,116,121,112,101, 0,105,110,116, 95,109,117,108,116,105,112,108,105,101,114, 0,115,116,105,108,108, 95,102,114,
- 97,109,101, 0,115,111,117,114, 99,101, 95,112, 97,116,104, 91, 49, 48, 50, 52, 93, 0, 42,100, 97,116, 97,115,101,116, 0, 99,
- 97, 99,104,101,100,102,114, 97,109,101, 0,111, 99,101, 97,110,109,111,100, 91, 54, 52, 93, 0,111,117,116,112,117,116, 0,110,
-111,105,115,101,115,105,122,101, 0,116,117,114, 98,117,108, 0, 98,114,105,103,104,116, 0, 99,111,110,116,114, 97,115,116, 0,
-115, 97,116,117,114, 97,116,105,111,110, 0,114,102, 97, 99, 0,103,102, 97, 99, 0, 98,102, 97, 99, 0,102,105,108,116,101,114,
-115,105,122,101, 0,109,103, 95, 72, 0,109,103, 95,108, 97, 99,117,110, 97,114,105,116,121, 0,109,103, 95,111, 99,116, 97,118,
-101,115, 0,109,103, 95,111,102,102,115,101,116, 0,109,103, 95,103, 97,105,110, 0,100,105,115,116, 95, 97,109,111,117,110,116,
- 0,110,115, 95,111,117,116,115, 99, 97,108,101, 0,118,110, 95,119, 49, 0,118,110, 95,119, 50, 0,118,110, 95,119, 51, 0,118,
-110, 95,119, 52, 0,118,110, 95,109,101,120,112, 0,118,110, 95,100,105,115,116,109, 0,118,110, 95, 99,111,108,116,121,112,101,
- 0,110,111,105,115,101,100,101,112,116,104, 0,110,111,105,115,101,116,121,112,101, 0,110,111,105,115,101, 98, 97,115,105,115,
- 0,110,111,105,115,101, 98, 97,115,105,115, 50, 0,105,109, 97,102,108, 97,103, 0, 99,114,111,112,120,109,105,110, 0, 99,114,
-111,112,121,109,105,110, 0, 99,114,111,112,120,109, 97,120, 0, 99,114,111,112,121,109, 97,120, 0,116,101,120,102,105,108,116,
-101,114, 0, 97,102,109, 97,120, 0,120,114,101,112,101, 97,116, 0,121,114,101,112,101, 97,116, 0, 99,104,101, 99,107,101,114,
-100,105,115,116, 0,110, 97, 98,108, 97, 0,105,117,115,101,114, 0, 42,110,111,100,101,116,114,101,101, 0, 42,112,108,117,103,
-105,110, 0, 42,101,110,118, 0, 42,112,100, 0, 42,118,100, 0, 42,111,116, 0,117,115,101, 95,110,111,100,101,115, 0,108,111,
- 99, 91, 51, 93, 0,114,111,116, 91, 51, 93, 0,109, 97,116, 91, 52, 93, 91, 52, 93, 0,109,105,110, 91, 51, 93, 0,109, 97,120,
- 91, 51, 93, 0, 99,111, 98, 97, 0, 98,108,101,110,100, 95, 99,111,108,111,114, 91, 51, 93, 0, 98,108,101,110,100, 95,102, 97,
- 99,116,111,114, 0, 98,108,101,110,100, 95,116,121,112,101, 0,112, 97,100, 91, 51, 93, 0,109,111,100,101, 0,116,111,116,101,
-120, 0,115,104,100,119,114, 0,115,104,100,119,103, 0,115,104,100,119, 98, 0,115,104,100,119,112, 97,100, 0,101,110,101,114,
-103,121, 0,100,105,115,116, 0,115,112,111,116,115,105,122,101, 0,115,112,111,116, 98,108,101,110,100, 0,104, 97,105,110,116,
- 0, 97,116,116, 49, 0, 97,116,116, 50, 0, 42, 99,117,114,102, 97,108,108,111,102,102, 0,115,104, 97,100,115,112,111,116,115,
-105,122,101, 0, 98,105, 97,115, 0,115,111,102,116, 0, 99,111,109,112,114,101,115,115,116,104,114,101,115,104, 0,112, 97,100,
- 53, 91, 51, 93, 0, 98,117,102,115,105,122,101, 0,115, 97,109,112, 0, 98,117,102,102,101,114,115, 0,102,105,108,116,101,114,
-116,121,112,101, 0, 98,117,102,102,108, 97,103, 0, 98,117,102,116,121,112,101, 0,114, 97,121, 95,115, 97,109,112, 0,114, 97,
-121, 95,115, 97,109,112,121, 0,114, 97,121, 95,115, 97,109,112,122, 0,114, 97,121, 95,115, 97,109,112, 95,116,121,112,101, 0,
- 97,114,101, 97, 95,115,104, 97,112,101, 0, 97,114,101, 97, 95,115,105,122,101, 0, 97,114,101, 97, 95,115,105,122,101,121, 0,
- 97,114,101, 97, 95,115,105,122,101,122, 0, 97,100, 97,112,116, 95,116,104,114,101,115,104, 0,114, 97,121, 95,115, 97,109,112,
- 95,109,101,116,104,111,100, 0,116,101,120, 97, 99,116, 0,115,104, 97,100,104, 97,108,111,115,116,101,112, 0,115,117,110, 95,
-101,102,102,101, 99,116, 95,116,121,112,101, 0,115,107,121, 98,108,101,110,100,116,121,112,101, 0,104,111,114,105,122,111,110,
- 95, 98,114,105,103,104,116,110,101,115,115, 0,115,112,114,101, 97,100, 0,115,117,110, 95, 98,114,105,103,104,116,110,101,115,
-115, 0,115,117,110, 95,115,105,122,101, 0, 98, 97, 99,107,115, 99, 97,116,116,101,114,101,100, 95,108,105,103,104,116, 0,115,
-117,110, 95,105,110,116,101,110,115,105,116,121, 0, 97,116,109, 95,116,117,114, 98,105,100,105,116,121, 0, 97,116,109, 95,105,
-110,115, 99, 97,116,116,101,114,105,110,103, 95,102, 97, 99,116,111,114, 0, 97,116,109, 95,101,120,116,105,110, 99,116,105,111,
-110, 95,102, 97, 99,116,111,114, 0, 97,116,109, 95,100,105,115,116, 97,110, 99,101, 95,102, 97, 99,116,111,114, 0,115,107,121,
- 98,108,101,110,100,102, 97, 99, 0,115,107,121, 95,101,120,112,111,115,117,114,101, 0,115,107,121, 95, 99,111,108,111,114,115,
-112, 97, 99,101, 0,112, 97,100, 52, 91, 54, 93, 0, 42,109,116,101,120, 91, 49, 56, 93, 0,112,114, 95,116,101,120,116,117,114,
-101, 0,112, 97,100, 54, 91, 52, 93, 0,100,101,110,115,105,116,121, 0,101,109,105,115,115,105,111,110, 0,115, 99, 97,116,116,
-101,114,105,110,103, 0,114,101,102,108,101, 99,116,105,111,110, 0,101,109,105,115,115,105,111,110, 95, 99,111,108, 91, 51, 93,
- 0,116,114, 97,110,115,109,105,115,115,105,111,110, 95, 99,111,108, 91, 51, 93, 0,114,101,102,108,101, 99,116,105,111,110, 95,
- 99,111,108, 91, 51, 93, 0,100,101,110,115,105,116,121, 95,115, 99, 97,108,101, 0,100,101,112,116,104, 95, 99,117,116,111,102,
-102, 0, 97,115,121,109,109,101,116,114,121, 0,115,116,101,112,115,105,122,101, 95,116,121,112,101, 0,115,104, 97,100,101,102,
-108, 97,103, 0,115,104, 97,100,101, 95,116,121,112,101, 0,112,114,101, 99, 97, 99,104,101, 95,114,101,115,111,108,117,116,105,
-111,110, 0,115,116,101,112,115,105,122,101, 0,109,115, 95,100,105,102,102, 0,109,115, 95,105,110,116,101,110,115,105,116,121,
- 0,109,115, 95,115,112,114,101, 97,100, 0, 97,108,112,104, 97, 95, 98,108,101,110,100, 0,102, 97, 99,101, 95,111,114,105,101,
-110,116, 97,116,105,111,110, 0,109, 97,116,101,114,105, 97,108, 95,116,121,112,101, 0,115,112,101, 99,114, 0,115,112,101, 99,
-103, 0,115,112,101, 99, 98, 0,109,105,114,114, 0,109,105,114,103, 0,109,105,114, 98, 0, 97,109, 98,114, 0, 97,109, 98, 98,
- 0, 97,109, 98,103, 0, 97,109, 98, 0,101,109,105,116, 0, 97,110,103, 0,115,112,101, 99,116,114, 97, 0,114, 97,121, 95,109,
-105,114,114,111,114, 0, 97,108,112,104, 97, 0,114,101,102, 0,115,112,101, 99, 0,122,111,102,102,115, 0, 97,100,100, 0,116,
-114, 97,110,115,108,117, 99,101,110, 99,121, 0,118,111,108, 0,103, 97,109,101, 0,102,114,101,115,110,101,108, 95,109,105,114,
- 0,102,114,101,115,110,101,108, 95,109,105,114, 95,105, 0,102,114,101,115,110,101,108, 95,116,114, 97, 0,102,114,101,115,110,
-101,108, 95,116,114, 97, 95,105, 0,102,105,108,116,101,114, 0,116,120, 95,108,105,109,105,116, 0,116,120, 95,102, 97,108,108,
-111,102,102, 0,114, 97,121, 95,100,101,112,116,104, 0,114, 97,121, 95,100,101,112,116,104, 95,116,114, 97, 0,104, 97,114, 0,
-115,101,101,100, 49, 0,115,101,101,100, 50, 0,103,108,111,115,115, 95,109,105,114, 0,103,108,111,115,115, 95,116,114, 97, 0,
-115, 97,109,112, 95,103,108,111,115,115, 95,109,105,114, 0,115, 97,109,112, 95,103,108,111,115,115, 95,116,114, 97, 0, 97,100,
- 97,112,116, 95,116,104,114,101,115,104, 95,109,105,114, 0, 97,100, 97,112,116, 95,116,104,114,101,115,104, 95,116,114, 97, 0,
- 97,110,105,115,111, 95,103,108,111,115,115, 95,109,105,114, 0,100,105,115,116, 95,109,105,114, 0,102, 97,100,101,116,111, 95,
-109,105,114, 0,115,104, 97,100,101, 95,102,108, 97,103, 0,109,111,100,101, 95,108, 0,102,108, 97,114,101, 99, 0,115,116, 97,
-114, 99, 0,108,105,110,101, 99, 0,114,105,110,103, 99, 0,104, 97,115,105,122,101, 0,102,108, 97,114,101,115,105,122,101, 0,
-115,117, 98,115,105,122,101, 0,102,108, 97,114,101, 98,111,111,115,116, 0,115,116,114, 97,110,100, 95,115,116, 97, 0,115,116,
-114, 97,110,100, 95,101,110,100, 0,115,116,114, 97,110,100, 95,101, 97,115,101, 0,115,116,114, 97,110,100, 95,115,117,114,102,
-110,111,114, 0,115,116,114, 97,110,100, 95,109,105,110, 0,115,116,114, 97,110,100, 95,119,105,100,116,104,102, 97,100,101, 0,
-115,116,114, 97,110,100, 95,117,118,110, 97,109,101, 91, 54, 52, 93, 0,115, 98,105, 97,115, 0,108, 98,105, 97,115, 0,115,104,
- 97,100, 95, 97,108,112,104, 97, 0,115,101,112,116,101,120, 0,114,103, 98,115,101,108, 0,112,114, 95,116,121,112,101, 0,112,
-114, 95, 98, 97, 99,107, 0,112,114, 95,108, 97,109,112, 0,109,108, 95,102,108, 97,103, 0,100,105,102,102, 95,115,104, 97,100,
-101,114, 0,115,112,101, 99, 95,115,104, 97,100,101,114, 0,114,111,117,103,104,110,101,115,115, 0,114,101,102,114, 97, 99, 0,
-112, 97,114, 97,109, 91, 52, 93, 0,114,109,115, 0,100, 97,114,107,110,101,115,115, 0, 42,114, 97,109,112, 95, 99,111,108, 0,
- 42,114, 97,109,112, 95,115,112,101, 99, 0,114, 97,109,112,105,110, 95, 99,111,108, 0,114, 97,109,112,105,110, 95,115,112,101,
- 99, 0,114, 97,109,112, 98,108,101,110,100, 95, 99,111,108, 0,114, 97,109,112, 98,108,101,110,100, 95,115,112,101, 99, 0,114,
- 97,109,112, 95,115,104,111,119, 0,114, 97,109,112,102, 97, 99, 95, 99,111,108, 0,114, 97,109,112,102, 97, 99, 95,115,112,101,
- 99, 0, 42,103,114,111,117,112, 0,102,114,105, 99,116,105,111,110, 0,102,104, 0,114,101,102,108,101, 99,116, 0,102,104,100,
-105,115,116, 0,120,121,102,114,105, 99,116, 0,100,121,110, 97,109,111,100,101, 0,115,115,115, 95,114, 97,100,105,117,115, 91,
- 51, 93, 0,115,115,115, 95, 99,111,108, 91, 51, 93, 0,115,115,115, 95,101,114,114,111,114, 0,115,115,115, 95,115, 99, 97,108,
-101, 0,115,115,115, 95,105,111,114, 0,115,115,115, 95, 99,111,108,102, 97, 99, 0,115,115,115, 95,116,101,120,102, 97, 99, 0,
-115,115,115, 95,102,114,111,110,116, 0,115,115,115, 95, 98, 97, 99,107, 0,115,115,115, 95,102,108, 97,103, 0,115,115,115, 95,
-112,114,101,115,101,116, 0,109, 97,112,116,111, 95,116,101,120,116,117,114,101,100, 0,115,104, 97,100,111,119,111,110,108,121,
- 95,102,108, 97,103, 0,105,110,100,101,120, 0,103,112,117,109, 97,116,101,114,105, 97,108, 0, 42, 98, 98, 0,115,101,108, 99,
-111,108, 49, 0,115,101,108, 99,111,108, 50, 0,113,117, 97,116, 91, 52, 93, 0,101,120,112,120, 0,101,120,112,121, 0,101,120,
-112,122, 0,114, 97,100, 0,114, 97,100, 50, 0,115, 0, 42,109, 97,116, 0, 42,105,109, 97,116, 0,101,108,101,109,115, 0,100,
-105,115,112, 0, 42,101,100,105,116,101,108,101,109,115, 0, 42, 42,109, 97,116, 0,102,108, 97,103, 50, 0,116,111,116, 99,111,
-108, 0,119,105,114,101,115,105,122,101, 0,114,101,110,100,101,114,115,105,122,101, 0,116,104,114,101,115,104, 0, 42,108, 97,
-115,116,101,108,101,109, 0,118,101, 99, 91, 51, 93, 91, 51, 93, 0, 97,108,102, 97, 0,119,101,105,103,104,116, 0,104, 49, 0,
-104, 50, 0,102, 49, 0,102, 50, 0,102, 51, 0,104,105,100,101, 0,118,101, 99, 91, 52, 93, 0,109, 97,116, 95,110,114, 0,112,
-110,116,115,117, 0,112,110,116,115,118, 0,114,101,115,111,108,117, 0,114,101,115,111,108,118, 0,111,114,100,101,114,117, 0,
-111,114,100,101,114,118, 0,102,108, 97,103,117, 0,102,108, 97,103,118, 0, 42,107,110,111,116,115,117, 0, 42,107,110,111,116,
-115,118, 0,116,105,108,116, 95,105,110,116,101,114,112, 0,114, 97,100,105,117,115, 95,105,110,116,101,114,112, 0, 99,104, 97,
-114,105,100,120, 0,107,101,114,110, 0,119, 0,104, 0,110,117,114, 98,115, 0, 42,107,101,121,105,110,100,101,120, 0,115,104,
- 97,112,101,110,114, 0,110,117,114, 98, 0, 42,101,100,105,116,110,117,114, 98, 0, 42, 98,101,118,111, 98,106, 0, 42,116, 97,
-112,101,114,111, 98,106, 0, 42,116,101,120,116,111,110, 99,117,114,118,101, 0, 42,112, 97,116,104, 0, 42,107,101,121, 0, 98,
-101,118, 0,100,114, 97,119,102,108, 97,103, 0,116,119,105,115,116, 95,109,111,100,101, 0,116,119,105,115,116, 95,115,109,111,
-111,116,104, 0,115,109, 97,108,108, 99, 97,112,115, 95,115, 99, 97,108,101, 0,112, 97,116,104,108,101,110, 0, 98,101,118,114,
-101,115,111,108, 0,119,105,100,116,104, 0,101,120,116, 49, 0,101,120,116, 50, 0,114,101,115,111,108,117, 95,114,101,110, 0,
-114,101,115,111,108,118, 95,114,101,110, 0, 97, 99,116,110,117, 0, 42,108, 97,115,116,115,101,108, 0,115,112, 97, 99,101,109,
-111,100,101, 0,115,112, 97, 99,105,110,103, 0,108,105,110,101,100,105,115,116, 0,115,104,101, 97,114, 0,102,115,105,122,101,
- 0,119,111,114,100,115,112, 97, 99,101, 0,117,108,112,111,115, 0,117,108,104,101,105,103,104,116, 0,120,111,102, 0,121,111,
-102, 0,108,105,110,101,119,105,100,116,104, 0, 42,115,116,114, 0, 42,115,101,108, 98,111,120,101,115, 0, 42,101,100,105,116,
-102,111,110,116, 0,102, 97,109,105,108,121, 91, 50, 52, 93, 0, 42,118,102,111,110,116, 0, 42,118,102,111,110,116, 98, 0, 42,
-118,102,111,110,116,105, 0, 42,118,102,111,110,116, 98,105, 0,115,101,112, 99,104, 97,114, 0, 99,116,105,109,101, 0,116,111,
-116, 98,111,120, 0, 97, 99,116, 98,111,120, 0, 42,116, 98, 0,115,101,108,115,116, 97,114,116, 0,115,101,108,101,110,100, 0,
- 42,115,116,114,105,110,102,111, 0, 99,117,114,105,110,102,111, 0, 42,109,112,111,108,121, 0, 42,109,116,112,111,108,121, 0,
- 42,109,108,111,111,112, 0, 42,109,108,111,111,112,117,118, 0, 42,109,108,111,111,112, 99,111,108, 0, 42,109,102, 97, 99,101,
- 0, 42,109,116,102, 97, 99,101, 0, 42,116,102, 97, 99,101, 0, 42,109,118,101,114,116, 0, 42,109,101,100,103,101, 0, 42,100,
-118,101,114,116, 0, 42,109, 99,111,108, 0, 42,109,115,116,105, 99,107,121, 0, 42,116,101,120, 99,111,109,101,115,104, 0, 42,
-109,115,101,108,101, 99,116, 0, 42,101,100,105,116, 95, 98,116,109,101,115,104, 0,118,100, 97,116, 97, 0,101,100, 97,116, 97,
- 0,102,100, 97,116, 97, 0,112,100, 97,116, 97, 0,108,100, 97,116, 97, 0,116,111,116,101,100,103,101, 0,116,111,116,102, 97,
- 99,101, 0,116,111,116,115,101,108,101, 99,116, 0,116,111,116,112,111,108,121, 0,116,111,116,108,111,111,112, 0, 97, 99,116,
- 95,102, 97, 99,101, 0,115,109,111,111,116,104,114,101,115,104, 0,115,117, 98,100,105,118, 0,115,117, 98,100,105,118,114, 0,
-115,117, 98,115,117,114,102,116,121,112,101, 0,101,100,105,116,102,108, 97,103, 0, 42,109,114, 0, 42,116,112, 97,103,101, 0,
-117,118, 91, 52, 93, 91, 50, 93, 0, 99,111,108, 91, 52, 93, 0,116,114, 97,110,115,112, 0,116,105,108,101, 0,117,110,119,114,
- 97,112, 0,118, 49, 0,118, 50, 0,118, 51, 0,118, 52, 0,101,100, 99,111,100,101, 0, 99,114,101, 97,115,101, 0, 98,119,101,
-105,103,104,116, 0,100,101,102, 95,110,114, 0, 42,100,119, 0,116,111,116,119,101,105,103,104,116, 0, 99,111, 91, 51, 93, 0,
-110,111, 91, 51, 93, 0,108,111,111,112,115,116, 97,114,116, 0,118, 0,101, 0,117,118, 91, 50, 93, 0, 99,111, 91, 50, 93, 0,
-102, 0,105, 0,115, 91, 50, 53, 54, 93, 0,116,111,116,100,105,115,112, 0, 40, 42,100,105,115,112,115, 41, 40, 41, 0,118, 91,
- 52, 93, 0,109,105,100, 0,112, 97,100, 91, 50, 93, 0,118, 91, 50, 93, 0, 42,102, 97, 99,101,115, 0, 42, 99,111,108,102, 97,
- 99,101,115, 0, 42,101,100,103,101,115, 0, 42,118,101,114,116,115, 0,108,101,118,101,108,115, 0,108,101,118,101,108, 95, 99,
-111,117,110,116, 0, 99,117,114,114,101,110,116, 0,110,101,119,108,118,108, 0,101,100,103,101,108,118,108, 0,112,105,110,108,
-118,108, 0,114,101,110,100,101,114,108,118,108, 0,117,115,101, 95, 99,111,108, 0, 42,101,100,103,101, 95,102,108, 97,103,115,
- 0, 42,101,100,103,101, 95, 99,114,101, 97,115,101,115, 0,115,116, 97, 99,107,105,110,100,101,120, 0, 42,101,114,114,111,114,
- 0,109,111,100,105,102,105,101,114, 0, 42,116,101,120,116,117,114,101, 0, 42,109, 97,112, 95,111, 98,106,101, 99,116, 0,117,
-118,108, 97,121,101,114, 95,110, 97,109,101, 91, 54, 52, 93, 0,117,118,108, 97,121,101,114, 95,116,109,112, 0,116,101,120,109,
- 97,112,112,105,110,103, 0,115,117, 98,100,105,118, 84,121,112,101, 0,114,101,110,100,101,114, 76,101,118,101,108,115, 0, 42,
-101,109, 67, 97, 99,104,101, 0, 42,109, 67, 97, 99,104,101, 0,100,101,102, 97,120,105,115, 0,112, 97,100, 91, 54, 93, 0,108,
-101,110,103,116,104, 0,114, 97,110,100,111,109,105,122,101, 0,115,101,101,100, 0, 42,111, 98, 95, 97,114,109, 0, 42,115,116,
- 97,114,116, 95, 99, 97,112, 0, 42,101,110,100, 95, 99, 97,112, 0, 42, 99,117,114,118,101, 95,111, 98, 0, 42,111,102,102,115,
-101,116, 95,111, 98, 0,111,102,102,115,101,116, 91, 51, 93, 0,115, 99, 97,108,101, 91, 51, 93, 0,109,101,114,103,101, 95,100,
-105,115,116, 0,102,105,116, 95,116,121,112,101, 0,111,102,102,115,101,116, 95,116,121,112,101, 0, 99,111,117,110,116, 0, 97,
-120,105,115, 0,116,111,108,101,114, 97,110, 99,101, 0, 42,109,105,114,114,111,114, 95,111, 98, 0,115,112,108,105,116, 95, 97,
-110,103,108,101, 0,118, 97,108,117,101, 0,114,101,115, 0,118, 97,108, 95,102,108, 97,103,115, 0,108,105,109, 95,102,108, 97,
-103,115, 0,101, 95,102,108, 97,103,115, 0, 98,101,118,101,108, 95, 97,110,103,108,101, 0,100,101,102,103,114,112, 95,110, 97,
-109,101, 91, 54, 52, 93, 0, 42,100,111,109, 97,105,110, 0, 42,102,108,111,119, 0, 42, 99,111,108,108, 0,116,105,109,101, 0,
-115,116,114,101,110,103,116,104, 0,100,105,114,101, 99,116,105,111,110, 0,109,105,100,108,101,118,101,108, 0, 42,112,114,111,
-106,101, 99,116,111,114,115, 91, 49, 48, 93, 0, 42,105,109, 97,103,101, 0,110,117,109, 95,112,114,111,106,101, 99,116,111,114,
-115, 0, 97,115,112,101, 99,116,120, 0, 97,115,112,101, 99,116,121, 0,115, 99, 97,108,101,120, 0,115, 99, 97,108,101,121, 0,
-112,101,114, 99,101,110,116, 0,102, 97, 99,101, 67,111,117,110,116, 0,102, 97, 99, 0,114,101,112,101, 97,116, 0, 42,111, 98,
-106,101, 99,116, 99,101,110,116,101,114, 0,115,116, 97,114,116,120, 0,115,116, 97,114,116,121, 0,104,101,105,103,104,116, 0,
-110, 97,114,114,111,119, 0,115,112,101,101,100, 0,100, 97,109,112, 0,102, 97,108,108,111,102,102, 0,116,105,109,101,111,102,
-102,115, 0,108,105,102,101,116,105,109,101, 0,100,101,102,111,114,109,102,108, 97,103, 0,109,117,108,116,105, 0, 42,112,114,
-101,118, 67,111,115, 0,115,117, 98,116, 97,114,103,101,116, 91, 54, 52, 93, 0,112, 97,114,101,110,116,105,110,118, 91, 52, 93,
- 91, 52, 93, 0, 99,101,110,116, 91, 51, 93, 0, 42,105,110,100,101,120, 97,114, 0,116,111,116,105,110,100,101,120, 0,102,111,
-114, 99,101, 0, 42, 99,108,111,116,104, 79, 98,106,101, 99,116, 0, 42,115,105,109, 95,112, 97,114,109,115, 0, 42, 99,111,108,
-108, 95,112, 97,114,109,115, 0, 42,112,111,105,110,116, 95, 99, 97, 99,104,101, 0,112,116, 99, 97, 99,104,101,115, 0, 42,120,
- 0, 42,120,110,101,119, 0, 42,120,111,108,100, 0, 42, 99,117,114,114,101,110,116, 95,120,110,101,119, 0, 42, 99,117,114,114,
-101,110,116, 95,120, 0, 42, 99,117,114,114,101,110,116, 95,118, 0, 42,109,102, 97, 99,101,115, 0,110,117,109,118,101,114,116,
-115, 0,110,117,109,102, 97, 99,101,115, 0,116,105,109,101, 95,120, 0,116,105,109,101, 95,120,110,101,119, 0, 42, 98,118,104,
-116,114,101,101, 0, 42,118, 0, 42,100,109, 0, 99,102,114, 97, 0,111,112,101,114, 97,116,105,111,110, 0,118,101,114,116,101,
-120, 0,116,111,116,105,110,102,108,117,101,110, 99,101, 0,103,114,105,100,115,105,122,101, 0, 42, 98,105,110,100,105,110,102,
-108,117,101,110, 99,101,115, 0, 42, 98,105,110,100,111,102,102,115,101,116,115, 0, 42, 98,105,110,100, 99, 97,103,101, 99,111,
-115, 0,116,111,116, 99, 97,103,101,118,101,114,116, 0, 42,100,121,110,103,114,105,100, 0, 42,100,121,110,105,110,102,108,117,
-101,110, 99,101,115, 0, 42,100,121,110,118,101,114,116,115, 0, 42,112, 97,100, 50, 0,100,121,110,103,114,105,100,115,105,122,
-101, 0,100,121,110, 99,101,108,108,109,105,110, 91, 51, 93, 0,100,121,110, 99,101,108,108,119,105,100,116,104, 0, 98,105,110,
-100,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 42, 98,105,110,100,119,101,105,103,104,116,115, 0, 42, 98,105,110,100, 99,111,115,
- 0, 40, 42, 98,105,110,100,102,117,110, 99, 41, 40, 41, 0, 42,112,115,121,115, 0,116,111,116,100,109,118,101,114,116, 0,116,
-111,116,100,109,101,100,103,101, 0,116,111,116,100,109,102, 97, 99,101, 0,112,111,115,105,116,105,111,110, 0,114, 97,110,100,
-111,109, 95,112,111,115,105,116,105,111,110, 0, 42,102, 97, 99,101,112, 97, 0,118,103,114,111,117,112, 0,112,114,111,116,101,
- 99,116, 0,108,118,108, 0,115, 99,117,108,112,116,108,118,108, 0,116,111,116,108,118,108, 0,115,105,109,112,108,101, 0, 42,
-102,115,115, 0, 42,116, 97,114,103,101,116, 0, 42, 97,117,120, 84, 97,114,103,101,116, 0,118,103,114,111,117,112, 95,110, 97,
-109,101, 91, 54, 52, 93, 0,107,101,101,112, 68,105,115,116, 0,115,104,114,105,110,107, 84,121,112,101, 0,115,104,114,105,110,
-107, 79,112,116,115, 0,112,114,111,106, 65,120,105,115, 0,115,117, 98,115,117,114,102, 76,101,118,101,108,115, 0, 42,111,114,
-105,103,105,110, 0,102, 97, 99,116,111,114, 0,108,105,109,105,116, 91, 50, 93, 0,111,114,105,103,105,110, 79,112,116,115, 0,
-111,102,102,115,101,116, 95,102, 97, 99, 0,111,102,102,115,101,116, 95,102, 97, 99, 95,118,103, 0, 99,114,101, 97,115,101, 95,
-105,110,110,101,114, 0, 99,114,101, 97,115,101, 95,111,117,116,101,114, 0, 99,114,101, 97,115,101, 95,114,105,109, 0,109, 97,
-116, 95,111,102,115, 0,109, 97,116, 95,111,102,115, 95,114,105,109, 0, 42,111, 98, 95, 97,120,105,115, 0,115,116,101,112,115,
- 0,114,101,110,100,101,114, 95,115,116,101,112,115, 0,105,116,101,114, 0,115, 99,114,101,119, 95,111,102,115, 0, 97,110,103,
-108,101, 0, 42,111, 99,101, 97,110, 0, 42,111, 99,101, 97,110, 99, 97, 99,104,101, 0,114,101,115,111,108,117,116,105,111,110,
- 0,115,112, 97,116,105, 97,108, 95,115,105,122,101, 0,119,105,110,100, 95,118,101,108,111, 99,105,116,121, 0,115,109, 97,108,
-108,101,115,116, 95,119, 97,118,101, 0,119, 97,118,101, 95, 97,108,105,103,110,109,101,110,116, 0,119, 97,118,101, 95,100,105,
-114,101, 99,116,105,111,110, 0,119, 97,118,101, 95,115, 99, 97,108,101, 0, 99,104,111,112, 95, 97,109,111,117,110,116, 0,102,
-111, 97,109, 95, 99,111,118,101,114, 97,103,101, 0, 98, 97,107,101,115,116, 97,114,116, 0, 98, 97,107,101,101,110,100, 0, 99,
- 97, 99,104,101,112, 97,116,104, 91, 49, 48, 50, 52, 93, 0,102,111, 97,109,108, 97,121,101,114,110, 97,109,101, 91, 54, 52, 93,
- 0, 99, 97, 99,104,101,100, 0,103,101,111,109,101,116,114,121, 95,109,111,100,101, 0,114,101,102,114,101,115,104, 0,114,101,
-112,101, 97,116, 95,120, 0,114,101,112,101, 97,116, 95,121, 0,102,111, 97,109, 95,102, 97,100,101, 0,112, 97,100, 48, 0, 42,
-111, 98,106,101, 99,116, 95,102,114,111,109, 0, 42,111, 98,106,101, 99,116, 95,116,111, 0,102, 97,108,108,111,102,102, 95,114,
- 97,100,105,117,115, 0,101,100,105,116, 95,102,108, 97,103,115, 0,100,101,102, 97,117,108,116, 95,119,101,105,103,104,116, 0,
- 42, 99,109, 97,112, 95, 99,117,114,118,101, 0, 97,100,100, 95,116,104,114,101,115,104,111,108,100, 0,114,101,109, 95,116,104,
-114,101,115,104,111,108,100, 0,109, 97,115,107, 95, 99,111,110,115,116, 97,110,116, 0,109, 97,115,107, 95,100,101,102,103,114,
-112, 95,110, 97,109,101, 91, 54, 52, 93, 0,109, 97,115,107, 95,116,101,120, 95,117,115,101, 95, 99,104, 97,110,110,101,108, 0,
- 42,109, 97,115,107, 95,116,101,120,116,117,114,101, 0, 42,109, 97,115,107, 95,116,101,120, 95,109, 97,112, 95,111, 98,106, 0,
-109, 97,115,107, 95,116,101,120, 95,109, 97,112,112,105,110,103, 0,109, 97,115,107, 95,116,101,120, 95,117,118,108, 97,121,101,
-114, 95,110, 97,109,101, 91, 54, 52, 93, 0,112, 97,100, 95,105, 49, 0,100,101,102,103,114,112, 95,110, 97,109,101, 95, 97, 91,
- 54, 52, 93, 0,100,101,102,103,114,112, 95,110, 97,109,101, 95, 98, 91, 54, 52, 93, 0,100,101,102, 97,117,108,116, 95,119,101,
-105,103,104,116, 95, 97, 0,100,101,102, 97,117,108,116, 95,119,101,105,103,104,116, 95, 98, 0,109,105,120, 95,109,111,100,101,
- 0,109,105,120, 95,115,101,116, 0,112, 97,100, 95, 99, 49, 91, 54, 93, 0,112,114,111,120,105,109,105,116,121, 95,109,111,100,
-101, 0,112,114,111,120,105,109,105,116,121, 95,102,108, 97,103,115, 0, 42,112,114,111,120,105,109,105,116,121, 95,111, 98, 95,
-116, 97,114,103,101,116, 0,109,105,110, 95,100,105,115,116, 0,109, 97,120, 95,100,105,115,116, 0,112, 97,100, 95,115, 49, 0,
- 42, 99, 97,110,118, 97,115, 0, 42, 98,114,117,115,104, 0,116,104,114,101,115,104,111,108,100, 0,115, 99, 97,108,101, 0,104,
-101,114,109,105,116,101, 95,110,117,109, 0, 42,108, 97,116,116, 0,112,110,116,115,119, 0,111,112,110,116,115,117, 0,111,112,
-110,116,115,118, 0,111,112,110,116,115,119, 0,116,121,112,101,117, 0,116,121,112,101,118, 0,116,121,112,101,119, 0,102,117,
- 0,102,118, 0,102,119, 0,100,117, 0,100,118, 0,100,119, 0, 42,100,101,102, 0, 42,108, 97,116,116,105, 99,101,100, 97,116,
- 97, 0,108, 97,116,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 42,101,100,105,116,108, 97,116,116, 0,118,101, 99, 91, 56, 93, 91,
- 51, 93, 0, 42,115, 99,117,108,112,116, 0,112, 97,114,116,121,112,101, 0,112, 97,114, 49, 0,112, 97,114, 50, 0,112, 97,114,
- 51, 0,112, 97,114,115,117, 98,115,116,114, 91, 54, 52, 93, 0, 42,116,114, 97, 99,107, 0, 42,112,114,111,120,121, 0, 42,112,
-114,111,120,121, 95,103,114,111,117,112, 0, 42,112,114,111,120,121, 95,102,114,111,109, 0, 42, 97, 99,116,105,111,110, 0, 42,
-112,111,115,101,108,105, 98, 0, 42,112,111,115,101, 0, 42,103,112,100, 0, 97,118,115, 0, 42,109,112, 97,116,104, 0, 99,111,
-110,115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108,115, 0,101,102,102,101, 99,116, 0,100,101,102, 98, 97,115,101, 0,
-109,111,100,105,102,105,101,114,115, 0,114,101,115,116,111,114,101, 95,109,111,100,101, 0, 42,109, 97,116, 98,105,116,115, 0,
- 97, 99,116, 99,111,108, 0,100,108,111, 99, 91, 51, 93, 0,111,114,105,103, 91, 51, 93, 0,100,115,105,122,101, 91, 51, 93, 0,
-100,115, 99, 97,108,101, 91, 51, 93, 0,100,114,111,116, 91, 51, 93, 0,100,113,117, 97,116, 91, 52, 93, 0,114,111,116, 65,120,
-105,115, 91, 51, 93, 0,100,114,111,116, 65,120,105,115, 91, 51, 93, 0,114,111,116, 65,110,103,108,101, 0,100,114,111,116, 65,
-110,103,108,101, 0,111, 98,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 99,111,110,115,116,105,110,118, 91, 52, 93, 91, 52, 93, 0,
-105,109, 97,116, 95,114,101,110, 91, 52, 93, 91, 52, 93, 0,108, 97,121, 0,112, 97,100, 54, 0, 99,111,108, 98,105,116,115, 0,
-116,114, 97,110,115,102,108, 97,103, 0,112,114,111,116,101, 99,116,102,108, 97,103, 0,116,114, 97, 99,107,102,108, 97,103, 0,
-117,112,102,108, 97,103, 0,110,108, 97,102,108, 97,103, 0,105,112,111,102,108, 97,103, 0,115, 99, 97,102,108, 97,103, 0,115,
- 99, 97,118,105,115,102,108, 97,103, 0,112, 97,100, 53, 0,100,117,112,111,110, 0,100,117,112,111,102,102, 0,100,117,112,115,
-116, 97, 0,100,117,112,101,110,100, 0,115,102, 0,109, 97,115,115, 0,100, 97,109,112,105,110,103, 0,105,110,101,114,116,105,
- 97, 0,102,111,114,109,102, 97, 99,116,111,114, 0,114,100, 97,109,112,105,110,103, 0,109, 97,114,103,105,110, 0,109, 97,120,
- 95,118,101,108, 0,109,105,110, 95,118,101,108, 0,109, 95, 99,111,110,116, 97, 99,116, 80,114,111, 99,101,115,115,105,110,103,
- 84,104,114,101,115,104,111,108,100, 0,111, 98,115,116, 97, 99,108,101, 82, 97,100, 0,114,111,116,109,111,100,101, 0, 98,111,
-117,110,100,116,121,112,101, 0, 99,111,108,108,105,115,105,111,110, 95, 98,111,117,110,100,116,121,112,101, 0,114,101,115,116,
-114,105, 99,116,102,108, 97,103, 0,100,116, 0,101,109,112,116,121, 95,100,114, 97,119,116,121,112,101, 0,101,109,112,116,121,
- 95,100,114, 97,119,115,105,122,101, 0,100,117,112,102, 97, 99,101,115, 99, 97, 0,112,114,111,112, 0,115,101,110,115,111,114,
-115, 0, 99,111,110,116,114,111,108,108,101,114,115, 0, 97, 99,116,117, 97,116,111,114,115, 0, 98, 98,115,105,122,101, 91, 51,
- 93, 0, 97, 99,116,100,101,102, 0,103, 97,109,101,102,108, 97,103, 0,103, 97,109,101,102,108, 97,103, 50, 0, 42, 98,115,111,
-102,116, 0,115,111,102,116,102,108, 97,103, 0, 97,110,105,115,111,116,114,111,112,105, 99, 70,114,105, 99,116,105,111,110, 91,
- 51, 93, 0, 99,111,110,115,116,114, 97,105,110,116,115, 0,110,108, 97,115,116,114,105,112,115, 0,104,111,111,107,115, 0,112,
- 97,114,116,105, 99,108,101,115,121,115,116,101,109, 0, 42,115,111,102,116, 0, 42,100,117,112, 95,103,114,111,117,112, 0, 98,
-111,100,121, 95,116,121,112,101, 0,115,104, 97,112,101,102,108, 97,103, 0, 42,102,108,117,105,100,115,105,109, 83,101,116,116,
-105,110,103,115, 0, 42,100,101,114,105,118,101,100, 68,101,102,111,114,109, 0, 42,100,101,114,105,118,101,100, 70,105,110, 97,
-108, 0,108, 97,115,116, 68, 97,116, 97, 77, 97,115,107, 0, 99,117,115,116,111,109,100, 97,116, 97, 95,109, 97,115,107, 0,115,
-116, 97,116,101, 0,105,110,105,116, 95,115,116, 97,116,101, 0,103,112,117,108, 97,109,112, 0,112, 99, 95,105,100,115, 0, 42,
-100,117,112,108,105,108,105,115,116, 0,105,109, 97, 95,111,102,115, 91, 50, 93, 0, 99,117,114,105,110,100,101,120, 0, 97, 99,
-116,105,118,101, 0,111,114,105,103,108, 97,121, 0,111,109, 97,116, 91, 52, 93, 91, 52, 93, 0,111,114, 99,111, 91, 51, 93, 0,
-110,111, 95,100,114, 97,119, 0, 97,110,105,109, 97,116,101,100, 0,100,101,102,108,101, 99,116, 0,102,111,114, 99,101,102,105,
-101,108,100, 0,115,104, 97,112,101, 0,116,101,120, 95,109,111,100,101, 0,107,105,110,107, 0,107,105,110,107, 95, 97,120,105,
-115, 0,122,100,105,114, 0,102, 95,115,116,114,101,110,103,116,104, 0,102, 95,100, 97,109,112, 0,102, 95,102,108,111,119, 0,
-102, 95,115,105,122,101, 0,102, 95,112,111,119,101,114, 0,109, 97,120,100,105,115,116, 0,109,105,110,100,105,115,116, 0,102,
- 95,112,111,119,101,114, 95,114, 0,109, 97,120,114, 97,100, 0,109,105,110,114, 97,100, 0,112,100,101,102, 95,100, 97,109,112,
- 0,112,100,101,102, 95,114,100, 97,109,112, 0,112,100,101,102, 95,112,101,114,109, 0,112,100,101,102, 95,102,114,105, 99,116,
- 0,112,100,101,102, 95,114,102,114,105, 99,116, 0,112,100,101,102, 95,115,116,105, 99,107,110,101,115,115, 0, 97, 98,115,111,
-114,112,116,105,111,110, 0,112,100,101,102, 95,115, 98,100, 97,109,112, 0,112,100,101,102, 95,115, 98,105,102,116, 0,112,100,
-101,102, 95,115, 98,111,102,116, 0, 99,108,117,109,112, 95,102, 97, 99, 0, 99,108,117,109,112, 95,112,111,119, 0,107,105,110,
-107, 95,102,114,101,113, 0,107,105,110,107, 95,115,104, 97,112,101, 0,107,105,110,107, 95, 97,109,112, 0,102,114,101,101, 95,
-101,110,100, 0,116,101,120, 95,110, 97, 98,108, 97, 0, 42,114,110,103, 0,102, 95,110,111,105,115,101, 0,119,101,105,103,104,
-116, 91, 49, 51, 93, 0,103,108,111, 98, 97,108, 95,103,114, 97,118,105,116,121, 0,114,116, 91, 51, 93, 0,116,111,116,100, 97,
-116, 97, 0,102,114, 97,109,101, 0,116,111,116,112,111,105,110,116, 0,100, 97,116, 97, 95,116,121,112,101,115, 0, 42,100, 97,
-116, 97, 91, 56, 93, 0, 42, 99,117,114, 91, 56, 93, 0,101,120,116,114, 97,100, 97,116, 97, 0,115,116,101,112, 0,115,105,109,
-102,114, 97,109,101, 0,115,116, 97,114,116,102,114, 97,109,101, 0,101,110,100,102,114, 97,109,101, 0,101,100,105,116,102,114,
- 97,109,101, 0,108, 97,115,116, 95,101,120, 97, 99,116, 0,108, 97,115,116, 95,118, 97,108,105,100, 0, 99,111,109,112,114,101,
-115,115,105,111,110, 0,112,114,101,118, 95,110, 97,109,101, 91, 54, 52, 93, 0,105,110,102,111, 91, 54, 52, 93, 0,112, 97,116,
-104, 91, 49, 48, 50, 52, 93, 0, 42, 99, 97, 99,104,101,100, 95,102,114, 97,109,101,115, 0,109,101,109, 95, 99, 97, 99,104,101,
- 0, 42,101,100,105,116, 0, 40, 42,102,114,101,101, 95,101,100,105,116, 41, 40, 41, 0,108,105,110, 83,116,105,102,102, 0, 97,
-110,103, 83,116,105,102,102, 0,118,111,108,117,109,101, 0,118,105,116,101,114, 97,116,105,111,110,115, 0,112,105,116,101,114,
- 97,116,105,111,110,115, 0,100,105,116,101,114, 97,116,105,111,110,115, 0, 99,105,116,101,114, 97,116,105,111,110,115, 0,107,
- 83, 82, 72, 82, 95, 67, 76, 0,107, 83, 75, 72, 82, 95, 67, 76, 0,107, 83, 83, 72, 82, 95, 67, 76, 0,107, 83, 82, 95, 83, 80,
- 76, 84, 95, 67, 76, 0,107, 83, 75, 95, 83, 80, 76, 84, 95, 67, 76, 0,107, 83, 83, 95, 83, 80, 76, 84, 95, 67, 76, 0,107, 86,
- 67, 70, 0,107, 68, 80, 0,107, 68, 71, 0,107, 76, 70, 0,107, 80, 82, 0,107, 86, 67, 0,107, 68, 70, 0,107, 77, 84, 0,107,
- 67, 72, 82, 0,107, 75, 72, 82, 0,107, 83, 72, 82, 0,107, 65, 72, 82, 0, 99,111,108,108,105,115,105,111,110,102,108, 97,103,
-115, 0,110,117,109, 99,108,117,115,116,101,114,105,116,101,114, 97,116,105,111,110,115, 0,119,101,108,100,105,110,103, 0,116,
-111,116,115,112,114,105,110,103, 0, 42, 98,112,111,105,110,116, 0, 42, 98,115,112,114,105,110,103, 0,109,115,103, 95,108,111,
- 99,107, 0,109,115,103, 95,118, 97,108,117,101, 0,110,111,100,101,109, 97,115,115, 0,110, 97,109,101,100, 86, 71, 95, 77, 97,
-115,115, 91, 54, 52, 93, 0,103,114, 97,118, 0,109,101,100,105, 97,102,114,105, 99,116, 0,114,107,108,105,109,105,116, 0,112,
-104,121,115,105, 99,115, 95,115,112,101,101,100, 0,103,111, 97,108,115,112,114,105,110,103, 0,103,111, 97,108,102,114,105, 99,
-116, 0,109,105,110,103,111, 97,108, 0,109, 97,120,103,111, 97,108, 0,100,101,102,103,111, 97,108, 0,118,101,114,116,103,114,
-111,117,112, 0,110, 97,109,101,100, 86, 71, 95, 83,111,102,116,103,111, 97,108, 91, 54, 52, 93, 0,102,117,122,122,121,110,101,
-115,115, 0,105,110,115,112,114,105,110,103, 0,105,110,102,114,105, 99,116, 0,110, 97,109,101,100, 86, 71, 95, 83,112,114,105,
-110,103, 95, 75, 91, 54, 52, 93, 0,101,102,114, 97, 0,105,110,116,101,114,118, 97,108, 0,108,111, 99, 97,108, 0,115,111,108,
-118,101,114,102,108, 97,103,115, 0, 42, 42,107,101,121,115, 0,116,111,116,112,111,105,110,116,107,101,121, 0,115,101, 99,111,
-110,100,115,112,114,105,110,103, 0, 99,111,108, 98, 97,108,108, 0, 98, 97,108,108,100, 97,109,112, 0, 98, 97,108,108,115,116,
-105,102,102, 0,115, 98, 99, 95,109,111,100,101, 0, 97,101,114,111,101,100,103,101, 0,109,105,110,108,111,111,112,115, 0,109,
- 97,120,108,111,111,112,115, 0, 99,104,111,107,101, 0,115,111,108,118,101,114, 95, 73, 68, 0,112,108, 97,115,116,105, 99, 0,
-115,112,114,105,110,103,112,114,101,108,111, 97,100, 0, 42,115, 99,114, 97,116, 99,104, 0,115,104,101, 97,114,115,116,105,102,
-102, 0,105,110,112,117,115,104, 0, 42,112,111,105,110,116, 99, 97, 99,104,101, 0, 42,101,102,102,101, 99,116,111,114, 95,119,
-101,105,103,104,116,115, 0,108, 99,111,109, 91, 51, 93, 0,108,114,111,116, 91, 51, 93, 91, 51, 93, 0,108,115, 99, 97,108,101,
- 91, 51, 93, 91, 51, 93, 0,108, 97,115,116, 95,102,114, 97,109,101, 0,118,101,108, 91, 51, 93, 0, 42,102,109,100, 0,115,104,
-111,119, 95, 97,100,118, 97,110, 99,101,100,111,112,116,105,111,110,115, 0,114,101,115,111,108,117,116,105,111,110,120,121,122,
- 0,112,114,101,118,105,101,119,114,101,115,120,121,122, 0,114,101, 97,108,115,105,122,101, 0,103,117,105, 68,105,115,112,108,
- 97,121, 77,111,100,101, 0,114,101,110,100,101,114, 68,105,115,112,108, 97,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,
-116,121, 86, 97,108,117,101, 0,118,105,115, 99,111,115,105,116,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 69,
-120,112,111,110,101,110,116, 0,103,114, 97,118, 91, 51, 93, 0, 97,110,105,109, 83,116, 97,114,116, 0, 97,110,105,109, 69,110,
-100, 0, 98, 97,107,101, 83,116, 97,114,116, 0, 98, 97,107,101, 69,110,100, 0,102,114, 97,109,101, 79,102,102,115,101,116, 0,
-103,115,116, 97,114, 0,109, 97,120, 82,101,102,105,110,101, 0,105,110,105, 86,101,108,120, 0,105,110,105, 86,101,108,121, 0,
-105,110,105, 86,101,108,122, 0, 42,111,114,103, 77,101,115,104, 0, 42,109,101,115,104, 66, 66, 0,115,117,114,102,100, 97,116,
- 97, 80, 97,116,104, 91, 49, 48, 50, 52, 93, 0, 98, 98, 83,116, 97,114,116, 91, 51, 93, 0, 98, 98, 83,105,122,101, 91, 51, 93,
- 0,116,121,112,101, 70,108, 97,103,115, 0,100,111,109, 97,105,110, 78,111,118,101, 99,103,101,110, 0,118,111,108,117,109,101,
- 73,110,105,116, 84,121,112,101, 0,112, 97,114,116, 83,108,105,112, 86, 97,108,117,101, 0,103,101,110,101,114, 97,116,101, 84,
-114, 97, 99,101,114,115, 0,103,101,110,101,114, 97,116,101, 80, 97,114,116,105, 99,108,101,115, 0,115,117,114,102, 97, 99,101,
- 83,109,111,111,116,104,105,110,103, 0,115,117,114,102, 97, 99,101, 83,117, 98,100,105,118,115, 0,112, 97,114,116,105, 99,108,
-101, 73,110,102, 83,105,122,101, 0,112, 97,114,116,105, 99,108,101, 73,110,102, 65,108,112,104, 97, 0,102, 97,114, 70,105,101,
-108,100, 83,105,122,101, 0, 42,109,101,115,104, 86,101,108,111, 99,105,116,105,101,115, 0, 99,112,115, 84,105,109,101, 83,116,
- 97,114,116, 0, 99,112,115, 84,105,109,101, 69,110,100, 0, 99,112,115, 81,117, 97,108,105,116,121, 0, 97,116,116,114, 97, 99,
-116,102,111,114, 99,101, 83,116,114,101,110,103,116,104, 0, 97,116,116,114, 97, 99,116,102,111,114, 99,101, 82, 97,100,105,117,
-115, 0,118,101,108,111, 99,105,116,121,102,111,114, 99,101, 83,116,114,101,110,103,116,104, 0,118,101,108,111, 99,105,116,121,
-102,111,114, 99,101, 82, 97,100,105,117,115, 0,108, 97,115,116,103,111,111,100,102,114, 97,109,101, 0, 97,110,105,109, 82, 97,
-116,101, 0,109,105,115,116,121,112,101, 0,104,111,114,114, 0,104,111,114,103, 0,104,111,114, 98, 0,122,101,110,114, 0,122,
-101,110,103, 0,122,101,110, 98, 0,102, 97,115,116, 99,111,108, 0,101,120,112,111,115,117,114,101, 0,101,120,112, 0,114, 97,
-110,103,101, 0,108,105,110,102, 97, 99, 0,108,111,103,102, 97, 99, 0,103,114, 97,118,105,116,121, 0, 97, 99,116,105,118,105,
-116,121, 66,111,120, 82, 97,100,105,117,115, 0,115,107,121,116,121,112,101, 0,111, 99, 99,108,117,115,105,111,110, 82,101,115,
- 0,112,104,121,115,105, 99,115, 69,110,103,105,110,101, 0,116,105, 99,114, 97,116,101, 0,109, 97,120,108,111,103,105, 99,115,
-116,101,112, 0,112,104,121,115,117, 98,115,116,101,112, 0,109, 97,120,112,104,121,115,116,101,112, 0,109,105,115,105, 0,109,
-105,115,116,115,116, 97, 0,109,105,115,116,100,105,115,116, 0,109,105,115,116,104,105, 0,115,116, 97,114,114, 0,115,116, 97,
-114,103, 0,115,116, 97,114, 98, 0,115,116, 97,114,107, 0,115,116, 97,114,115,105,122,101, 0,115,116, 97,114,109,105,110,100,
-105,115,116, 0,115,116, 97,114,100,105,115,116, 0,115,116, 97,114, 99,111,108,110,111,105,115,101, 0,100,111,102,115,116, 97,
- 0,100,111,102,101,110,100, 0,100,111,102,109,105,110, 0,100,111,102,109, 97,120, 0, 97,111,100,105,115,116, 0, 97,111,100,
-105,115,116,102, 97, 99, 0, 97,111,101,110,101,114,103,121, 0, 97,111, 98,105, 97,115, 0, 97,111,109,111,100,101, 0, 97,111,
-115, 97,109,112, 0, 97,111,109,105,120, 0, 97,111, 99,111,108,111,114, 0, 97,111, 95, 97,100, 97,112,116, 95,116,104,114,101,
-115,104, 0, 97,111, 95, 97,100, 97,112,116, 95,115,112,101,101,100, 95,102, 97, 99, 0, 97,111, 95, 97,112,112,114,111,120, 95,
-101,114,114,111,114, 0, 97,111, 95, 97,112,112,114,111,120, 95, 99,111,114,114,101, 99,116,105,111,110, 0, 97,111, 95,105,110,
-100,105,114,101, 99,116, 95,101,110,101,114,103,121, 0, 97,111, 95,101,110,118, 95,101,110,101,114,103,121, 0, 97,111, 95,112,
- 97,100, 50, 0, 97,111, 95,105,110,100,105,114,101, 99,116, 95, 98,111,117,110, 99,101,115, 0, 97,111, 95,112, 97,100, 0, 97,
-111, 95,115, 97,109,112, 95,109,101,116,104,111,100, 0, 97,111, 95,103, 97,116,104,101,114, 95,109,101,116,104,111,100, 0, 97,
-111, 95, 97,112,112,114,111,120, 95,112, 97,115,115,101,115, 0, 42, 97,111,115,112,104,101,114,101, 0, 42, 97,111,116, 97, 98,
-108,101,115, 0,115,101,108, 99,111,108, 0,115,120, 0,115,121, 0, 42,108,112, 70,111,114,109, 97,116, 0, 42,108,112, 80, 97,
-114,109,115, 0, 99, 98, 70,111,114,109, 97,116, 0, 99, 98, 80, 97,114,109,115, 0,102, 99, 99, 84,121,112,101, 0,102, 99, 99,
- 72, 97,110,100,108,101,114, 0,100,119, 75,101,121, 70,114, 97,109,101, 69,118,101,114,121, 0,100,119, 81,117, 97,108,105,116,
-121, 0,100,119, 66,121,116,101,115, 80,101,114, 83,101, 99,111,110,100, 0,100,119, 70,108, 97,103,115, 0,100,119, 73,110,116,
-101,114,108,101, 97,118,101, 69,118,101,114,121, 0, 97,118,105, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0, 42,
- 99,100, 80, 97,114,109,115, 0, 42,112, 97,100, 0, 99,100, 83,105,122,101, 0,113,116, 99,111,100,101, 99,110, 97,109,101, 91,
- 49, 50, 56, 93, 0, 99,111,100,101, 99, 84,121,112,101, 0, 99,111,100,101, 99, 83,112, 97,116,105, 97,108, 81,117, 97,108,105,
-116,121, 0, 99,111,100,101, 99, 0, 99,111,100,101, 99, 70,108, 97,103,115, 0, 99,111,108,111,114, 68,101,112,116,104, 0, 99,
-111,100,101, 99, 84,101,109,112,111,114, 97,108, 81,117, 97,108,105,116,121, 0,109,105,110, 83,112, 97,116,105, 97,108, 81,117,
- 97,108,105,116,121, 0,109,105,110, 84,101,109,112,111,114, 97,108, 81,117, 97,108,105,116,121, 0,107,101,121, 70,114, 97,109,
-101, 82, 97,116,101, 0, 98,105,116, 82, 97,116,101, 0, 97,117,100,105,111, 99,111,100,101, 99, 84,121,112,101, 0, 97,117,100,
-105,111, 83, 97,109,112,108,101, 82, 97,116,101, 0, 97,117,100,105,111, 66,105,116, 68,101,112,116,104, 0, 97,117,100,105,111,
- 67,104, 97,110,110,101,108,115, 0, 97,117,100,105,111, 67,111,100,101, 99, 70,108, 97,103,115, 0, 97,117,100,105,111, 66,105,
-116, 82, 97,116,101, 0, 97,117,100,105,111, 95, 99,111,100,101, 99, 0,118,105,100,101,111, 95, 98,105,116,114, 97,116,101, 0,
- 97,117,100,105,111, 95, 98,105,116,114, 97,116,101, 0, 97,117,100,105,111, 95,109,105,120,114, 97,116,101, 0, 97,117,100,105,
-111, 95, 99,104, 97,110,110,101,108,115, 0, 97,117,100,105,111, 95,112, 97,100, 0, 97,117,100,105,111, 95,118,111,108,117,109,
-101, 0,103,111,112, 95,115,105,122,101, 0,114, 99, 95,109,105,110, 95,114, 97,116,101, 0,114, 99, 95,109, 97,120, 95,114, 97,
-116,101, 0,114, 99, 95, 98,117,102,102,101,114, 95,115,105,122,101, 0,109,117,120, 95,112, 97, 99,107,101,116, 95,115,105,122,
-101, 0,109,117,120, 95,114, 97,116,101, 0,109,105,120,114, 97,116,101, 0,109, 97,105,110, 0,115,112,101,101,100, 95,111,102,
- 95,115,111,117,110,100, 0,100,111,112,112,108,101,114, 95,102, 97, 99,116,111,114, 0,100,105,115,116, 97,110, 99,101, 95,109,
-111,100,101,108, 0, 42,109, 97,116, 95,111,118,101,114,114,105,100,101, 0, 42,108,105,103,104,116, 95,111,118,101,114,114,105,
-100,101, 0,108, 97,121, 95,122,109, 97,115,107, 0,108, 97,121,102,108, 97,103, 0,112, 97,115,115,102,108, 97,103, 0,112, 97,
-115,115, 95,120,111,114, 0,105,109,116,121,112,101, 0,112,108, 97,110,101,115, 0,113,117, 97,108,105,116,121, 0, 99,111,109,
-112,114,101,115,115, 0,101,120,114, 95, 99,111,100,101, 99, 0, 99,105,110,101,111,110, 95,102,108, 97,103, 0, 99,105,110,101,
-111,110, 95,119,104,105,116,101, 0, 99,105,110,101,111,110, 95, 98,108, 97, 99,107, 0, 99,105,110,101,111,110, 95,103, 97,109,
-109, 97, 0,106,112, 50, 95,102,108, 97,103, 0,105,109, 95,102,111,114,109, 97,116, 0, 42, 97,118,105, 99,111,100,101, 99,100,
- 97,116, 97, 0, 42,113,116, 99,111,100,101, 99,100, 97,116, 97, 0,113,116, 99,111,100,101, 99,115,101,116,116,105,110,103,115,
- 0,102,102, 99,111,100,101, 99,100, 97,116, 97, 0,115,117, 98,102,114, 97,109,101, 0,112,115,102,114, 97, 0,112,101,102,114,
- 97, 0,105,109, 97,103,101,115, 0,102,114, 97,109, 97,112,116,111, 0,116,104,114,101, 97,100,115, 0,102,114, 97,109,101,108,
-101,110, 0, 98,108,117,114,102, 97, 99, 0,101,100,103,101, 82, 0,101,100,103,101, 71, 0,101,100,103,101, 66, 0,102,117,108,
-108,115, 99,114,101,101,110, 0,120,112,108, 97,121, 0,121,112,108, 97,121, 0,102,114,101,113,112,108, 97,121, 0, 97,116,116,
-114,105, 98, 0,102,114, 97,109,101, 95,115,116,101,112, 0,115,116,101,114,101,111,109,111,100,101, 0,100,105,109,101,110,115,
-105,111,110,115,112,114,101,115,101,116, 0,109, 97,120,105,109,115,105,122,101, 0,120,115, 99,104, 0,121,115, 99,104, 0,120,
-112, 97,114,116,115, 0,121,112, 97,114,116,115, 0,115,117, 98,105,109,116,121,112,101, 0,100,105,115,112,108, 97,121,109,111,
-100,101, 0,115, 99,101,109,111,100,101, 0,114, 97,121,116,114, 97, 99,101, 95,111,112,116,105,111,110,115, 0,114, 97,121,116,
-114, 97, 99,101, 95,115,116,114,117, 99,116,117,114,101, 0,111, 99,114,101,115, 0,112, 97,100, 52, 0, 97,108,112,104, 97,109,
-111,100,101, 0,111,115, 97, 0,102,114,115, 95,115,101, 99, 0,101,100,103,101,105,110,116, 0,115, 97,102,101,116,121, 0, 98,
-111,114,100,101,114, 0,100,105,115,112,114,101, 99,116, 0,108, 97,121,101,114,115, 0, 97, 99,116,108, 97,121, 0,109, 98,108,
-117,114, 95,115, 97,109,112,108,101,115, 0,120, 97,115,112, 0,121, 97,115,112, 0,102,114,115, 95,115,101, 99, 95, 98, 97,115,
-101, 0,103, 97,117,115,115, 0, 99,111,108,111,114, 95,109,103,116, 95,102,108, 97,103, 0,112,111,115,116,103, 97,109,109, 97,
- 0,112,111,115,116,104,117,101, 0,112,111,115,116,115, 97,116, 0,100,105,116,104,101,114, 95,105,110,116,101,110,115,105,116,
-121, 0, 98, 97,107,101, 95,111,115, 97, 0, 98, 97,107,101, 95,102,105,108,116,101,114, 0, 98, 97,107,101, 95,109,111,100,101,
- 0, 98, 97,107,101, 95,102,108, 97,103, 0, 98, 97,107,101, 95,110,111,114,109, 97,108, 95,115,112, 97, 99,101, 0, 98, 97,107,
-101, 95,113,117, 97,100, 95,115,112,108,105,116, 0, 98, 97,107,101, 95,109, 97,120,100,105,115,116, 0, 98, 97,107,101, 95, 98,
-105, 97,115,100,105,115,116, 0, 98, 97,107,101, 95,112, 97,100, 0,112,105, 99, 91, 49, 48, 50, 52, 93, 0,115,116, 97,109,112,
- 0,115,116, 97,109,112, 95,102,111,110,116, 95,105,100, 0,115,116, 97,109,112, 95,117,100, 97,116, 97, 91, 55, 54, 56, 93, 0,
-102,103, 95,115,116, 97,109,112, 91, 52, 93, 0, 98,103, 95,115,116, 97,109,112, 91, 52, 93, 0,115,101,113, 95,112,114,101,118,
- 95,116,121,112,101, 0,115,101,113, 95,114,101,110,100, 95,116,121,112,101, 0,115,101,113, 95,102,108, 97,103, 0,112, 97,100,
- 53, 91, 53, 93, 0,115,105,109,112,108,105,102,121, 95,102,108, 97,103, 0,115,105,109,112,108,105,102,121, 95,115,117, 98,115,
-117,114,102, 0,115,105,109,112,108,105,102,121, 95,115,104, 97,100,111,119,115, 97,109,112,108,101,115, 0,115,105,109,112,108,
-105,102,121, 95,112, 97,114,116,105, 99,108,101,115, 0,115,105,109,112,108,105,102,121, 95, 97,111,115,115,115, 0, 99,105,110,
-101,111,110,119,104,105,116,101, 0, 99,105,110,101,111,110, 98,108, 97, 99,107, 0, 99,105,110,101,111,110,103, 97,109,109, 97,
- 0,106,112, 50, 95,112,114,101,115,101,116, 0,106,112, 50, 95,100,101,112,116,104, 0,114,112, 97,100, 51, 0,100,111,109,101,
-114,101,115, 0,100,111,109,101,109,111,100,101, 0,100,111,109,101, 97,110,103,108,101, 0,100,111,109,101,116,105,108,116, 0,
-100,111,109,101,114,101,115, 98,117,102, 0, 42,100,111,109,101,116,101,120,116, 0,101,110,103,105,110,101, 91, 51, 50, 93, 0,
-110, 97,109,101, 91, 51, 50, 93, 0,112, 97,114,116,105, 99,108,101, 95,112,101,114, 99, 0,115,117, 98,115,117,114,102, 95,109,
- 97,120, 0,115,104, 97,100, 98,117,102,115, 97,109,112,108,101, 95,109, 97,120, 0, 97,111, 95,101,114,114,111,114, 0,116,105,
-108,116, 0,114,101,115, 98,117,102, 0, 42,119, 97,114,112,116,101,120,116, 0, 99,111,108, 91, 51, 93, 0, 99,101,108,108,115,
-105,122,101, 0, 99,101,108,108,104,101,105,103,104,116, 0, 97,103,101,110,116,109, 97,120,115,108,111,112,101, 0, 97,103,101,
-110,116,109, 97,120, 99,108,105,109, 98, 0, 97,103,101,110,116,104,101,105,103,104,116, 0, 97,103,101,110,116,114, 97,100,105,
-117,115, 0,101,100,103,101,109, 97,120,108,101,110, 0,101,100,103,101,109, 97,120,101,114,114,111,114, 0,114,101,103,105,111,
-110,109,105,110,115,105,122,101, 0,114,101,103,105,111,110,109,101,114,103,101,115,105,122,101, 0,118,101,114,116,115,112,101,
-114,112,111,108,121, 0,100,101,116, 97,105,108,115, 97,109,112,108,101,100,105,115,116, 0,100,101,116, 97,105,108,115, 97,109,
-112,108,101,109, 97,120,101,114,114,111,114, 0,102,114, 97,109,105,110,103, 0,112,108, 97,121,101,114,102,108, 97,103, 0,114,
-116, 49, 0,114,116, 50, 0, 97, 97,115, 97,109,112,108,101,115, 0,112, 97,100, 52, 91, 51, 93, 0,100,111,109,101, 0,115,116,
-101,114,101,111,102,108, 97,103, 0,101,121,101,115,101,112, 97,114, 97,116,105,111,110, 0,114,101, 99, 97,115,116, 68, 97,116,
- 97, 0,109, 97,116,109,111,100,101, 0,101,120,105,116,107,101,121, 0,111, 98,115,116, 97, 99,108,101, 83,105,109,117,108, 97,
-116,105,111,110, 0,108,101,118,101,108, 72,101,105,103,104,116, 0, 42, 99, 97,109,101,114, 97, 0, 42,112, 97,105,110,116, 95,
- 99,117,114,115,111,114, 0,112, 97,105,110,116, 95, 99,117,114,115,111,114, 95, 99,111,108, 91, 52, 93, 0,112, 97,105,110,116,
- 0,115,101, 97,109, 95, 98,108,101,101,100, 0,110,111,114,109, 97,108, 95, 97,110,103,108,101, 0,115, 99,114,101,101,110, 95,
-103,114, 97, 98, 95,115,105,122,101, 91, 50, 93, 0, 42,112, 97,105,110,116, 99,117,114,115,111,114, 0,105,110,118,101,114,116,
- 0,116,111,116,114,101,107,101,121, 0,116,111,116, 97,100,100,107,101,121, 0, 98,114,117,115,104,116,121,112,101, 0, 98,114,
-117,115,104, 91, 55, 93, 0,101,109,105,116,116,101,114,100,105,115,116, 0,115,101,108,101, 99,116,109,111,100,101, 0,101,100,
-105,116,116,121,112,101, 0,100,114, 97,119, 95,115,116,101,112, 0,102, 97,100,101, 95,102,114, 97,109,101,115, 0,114, 97,100,
-105, 97,108, 95,115,121,109,109, 91, 51, 93, 0,108, 97,115,116, 95,120, 0,108, 97,115,116, 95,121, 0,108, 97,115,116, 95, 97,
-110,103,108,101, 0,100,114, 97,119, 95, 97,110, 99,104,111,114,101,100, 0, 97,110, 99,104,111,114,101,100, 95,115,105,122,101,
- 0, 97,110, 99,104,111,114,101,100, 95,108,111, 99, 97,116,105,111,110, 91, 51, 93, 0, 97,110, 99,104,111,114,101,100, 95,105,
-110,105,116,105, 97,108, 95,109,111,117,115,101, 91, 50, 93, 0,100,114, 97,119, 95,112,114,101,115,115,117,114,101, 0,112,114,
-101,115,115,117,114,101, 95,118, 97,108,117,101, 0,115,112,101, 99,105, 97,108, 95,114,111,116, 97,116,105,111,110, 0, 42,118,
-112, 97,105,110,116, 95,112,114,101,118, 0, 42,119,112, 97,105,110,116, 95,112,114,101,118, 0,109, 97,116, 91, 51, 93, 91, 51,
- 93, 0,117,110,112,114,111,106,101, 99,116,101,100, 95,114, 97,100,105,117,115, 0, 42,118,112, 97,105,110,116, 0, 42,119,112,
- 97,105,110,116, 0, 42,117,118,115, 99,117,108,112,116, 0,118,103,114,111,117,112, 95,119,101,105,103,104,116, 0, 99,111,114,
-110,101,114,116,121,112,101, 0,101,100,105,116, 98,117,116,102,108, 97,103, 0,106,111,105,110,116,114,105,108,105,109,105,116,
- 0,100,101,103,114, 0,116,117,114,110, 0,101,120,116,114, 95,111,102,102,115, 0,100,111,117, 98,108,105,109,105,116, 0,110,
-111,114,109, 97,108,115,105,122,101, 0, 97,117,116,111,109,101,114,103,101, 0,115,101,103,109,101,110,116,115, 0,114,105,110,
-103,115, 0,118,101,114,116,105, 99,101,115, 0,117,110,119,114, 97,112,112,101,114, 0,117,118, 99, 97,108, 99, 95,114, 97,100,
-105,117,115, 0,117,118, 99, 97,108, 99, 95, 99,117, 98,101,115,105,122,101, 0,117,118, 99, 97,108, 99, 95,109, 97,114,103,105,
-110, 0,117,118, 99, 97,108, 99, 95,109, 97,112,100,105,114, 0,117,118, 99, 97,108, 99, 95,109, 97,112, 97,108,105,103,110, 0,
-117,118, 99, 97,108, 99, 95,102,108, 97,103, 0,117,118, 95,102,108, 97,103, 0,117,118, 95,115,101,108,101, 99,116,109,111,100,
-101, 0,117,118, 95,115,117, 98,115,117,114,102, 95,108,101,118,101,108, 0,103,112,101,110, 99,105,108, 95,102,108, 97,103,115,
- 0, 97,117,116,111,105,107, 95, 99,104, 97,105,110,108,101,110, 0,105,109, 97,112, 97,105,110,116, 0,112, 97,114,116,105, 99,
-108,101, 0,112,114,111,112,111,114,116,105,111,110, 97,108, 95,115,105,122,101, 0,115,101,108,101, 99,116, 95,116,104,114,101,
-115,104, 0, 99,108,101, 97,110, 95,116,104,114,101,115,104, 0, 97,117,116,111,107,101,121, 95,109,111,100,101, 0, 97,117,116,
-111,107,101,121, 95,102,108, 97,103, 0,109,117,108,116,105,114,101,115, 95,115,117, 98,100,105,118, 95,116,121,112,101, 0,112,
- 97,100, 50, 91, 53, 93, 0,115,107,103,101,110, 95,114,101,115,111,108,117,116,105,111,110, 0,115,107,103,101,110, 95,116,104,
-114,101,115,104,111,108,100, 95,105,110,116,101,114,110, 97,108, 0,115,107,103,101,110, 95,116,104,114,101,115,104,111,108,100,
- 95,101,120,116,101,114,110, 97,108, 0,115,107,103,101,110, 95,108,101,110,103,116,104, 95,114, 97,116,105,111, 0,115,107,103,
-101,110, 95,108,101,110,103,116,104, 95,108,105,109,105,116, 0,115,107,103,101,110, 95, 97,110,103,108,101, 95,108,105,109,105,
-116, 0,115,107,103,101,110, 95, 99,111,114,114,101,108, 97,116,105,111,110, 95,108,105,109,105,116, 0,115,107,103,101,110, 95,
-115,121,109,109,101,116,114,121, 95,108,105,109,105,116, 0,115,107,103,101,110, 95,114,101,116, 97,114,103,101,116, 95, 97,110,
-103,108,101, 95,119,101,105,103,104,116, 0,115,107,103,101,110, 95,114,101,116, 97,114,103,101,116, 95,108,101,110,103,116,104,
- 95,119,101,105,103,104,116, 0,115,107,103,101,110, 95,114,101,116, 97,114,103,101,116, 95,100,105,115,116, 97,110, 99,101, 95,
-119,101,105,103,104,116, 0,115,107,103,101,110, 95,111,112,116,105,111,110,115, 0,115,107,103,101,110, 95,112,111,115,116,112,
-114,111, 0,115,107,103,101,110, 95,112,111,115,116,112,114,111, 95,112, 97,115,115,101,115, 0,115,107,103,101,110, 95,115,117,
- 98,100,105,118,105,115,105,111,110,115, 91, 51, 93, 0,115,107,103,101,110, 95,109,117,108,116,105, 95,108,101,118,101,108, 0,
- 42,115,107,103,101,110, 95,116,101,109,112,108, 97,116,101, 0, 98,111,110,101, 95,115,107,101,116, 99,104,105,110,103, 0, 98,
-111,110,101, 95,115,107,101,116, 99,104,105,110,103, 95, 99,111,110,118,101,114,116, 0,115,107,103,101,110, 95,115,117, 98,100,
-105,118,105,115,105,111,110, 95,110,117,109, 98,101,114, 0,115,107,103,101,110, 95,114,101,116, 97,114,103,101,116, 95,111,112,
-116,105,111,110,115, 0,115,107,103,101,110, 95,114,101,116, 97,114,103,101,116, 95,114,111,108,108, 0,115,107,103,101,110, 95,
-115,105,100,101, 95,115,116,114,105,110,103, 91, 56, 93, 0,115,107,103,101,110, 95,110,117,109, 95,115,116,114,105,110,103, 91,
- 56, 93, 0,101,100,103,101, 95,109,111,100,101, 0,101,100,103,101, 95,109,111,100,101, 95,108,105,118,101, 95,117,110,119,114,
- 97,112, 0,115,110, 97,112, 95,109,111,100,101, 0,115,110, 97,112, 95,102,108, 97,103, 0,115,110, 97,112, 95,116, 97,114,103,
-101,116, 0,112,114,111,112,111,114,116,105,111,110, 97,108, 0,112,114,111,112, 95,109,111,100,101, 0,112,114,111,112,111,114,
-116,105,111,110, 97,108, 95,111, 98,106,101, 99,116,115, 0,112, 97,100, 91, 53, 93, 0, 97,117,116,111, 95,110,111,114,109, 97,
-108,105,122,101, 0,109,117,108,116,105,112, 97,105,110,116, 0,117,115,101, 95,117,118, 95,115, 99,117,108,112,116, 0,117,118,
- 95,115, 99,117,108,112,116, 95,115,101,116,116,105,110,103,115, 0,117,118, 95,115, 99,117,108,112,116, 95,116,111,111,108, 0,
-117,118, 95,114,101,108, 97,120, 95,109,101,116,104,111,100, 0,115, 99,117,108,112,116, 95,112, 97,105,110,116, 95,115,101,116,
-116,105,110,103,115, 0,115, 99,117,108,112,116, 95,112, 97,105,110,116, 95,117,110,105,102,105,101,100, 95,115,105,122,101, 0,
-115, 99,117,108,112,116, 95,112, 97,105,110,116, 95,117,110,105,102,105,101,100, 95,117,110,112,114,111,106,101, 99,116,101,100,
- 95,114, 97,100,105,117,115, 0,115, 99,117,108,112,116, 95,112, 97,105,110,116, 95,117,110,105,102,105,101,100, 95, 97,108,112,
-104, 97, 0,117,110,105,102,105,101,100, 95,112, 97,105,110,116, 95,115,101,116,116,105,110,103,115, 0,116,111,116,111, 98,106,
- 0,116,111,116,108, 97,109,112, 0,116,111,116,111, 98,106,115,101,108, 0,116,111,116, 99,117,114,118,101, 0,116,111,116,109,
-101,115,104, 0,116,111,116, 97,114,109, 97,116,117,114,101, 0,115, 99, 97,108,101, 95,108,101,110,103,116,104, 0,115,121,115,
-116,101,109, 0,115,121,115,116,101,109, 95,114,111,116, 97,116,105,111,110, 0,103,114, 97,118,105,116,121, 91, 51, 93, 0,113,
-117,105, 99,107, 95, 99, 97, 99,104,101, 95,115,116,101,112, 0, 42,119,111,114,108,100, 0, 42,115,101,116, 0, 98, 97,115,101,
- 0, 42, 98, 97,115, 97, 99,116, 0, 42,111, 98,101,100,105,116, 0, 99,117,114,115,111,114, 91, 51, 93, 0,116,119, 99,101,110,
-116, 91, 51, 93, 0,116,119,109,105,110, 91, 51, 93, 0,116,119,109, 97,120, 91, 51, 93, 0,108, 97,121, 97, 99,116, 0,108, 97,
-121, 95,117,112,100, 97,116,101,100, 0, 42,101,100, 0, 42,116,111,111,108,115,101,116,116,105,110,103,115, 0, 42,115,116, 97,
-116,115, 0, 97,117,100,105,111, 0,116,114, 97,110,115,102,111,114,109, 95,115,112, 97, 99,101,115, 0, 42,115,111,117,110,100,
- 95,115, 99,101,110,101, 0, 42,115,111,117,110,100, 95,115, 99,101,110,101, 95,104, 97,110,100,108,101, 0, 42,115,111,117,110,
-100, 95,115, 99,114,117, 98, 95,104, 97,110,100,108,101, 0, 42,115,112,101, 97,107,101,114, 95,104, 97,110,100,108,101,115, 0,
- 42,102,112,115, 95,105,110,102,111, 0, 42,116,104,101, 68, 97,103, 0,100, 97,103,105,115,118, 97,108,105,100, 0,100, 97,103,
-102,108, 97,103,115, 0, 97, 99,116,105,118,101, 95,107,101,121,105,110,103,115,101,116, 0,107,101,121,105,110,103,115,101,116,
-115, 0,103,109, 0,117,110,105,116, 0,112,104,121,115,105, 99,115, 95,115,101,116,116,105,110,103,115, 0, 42, 99,108,105,112,
- 0, 99,117,115,116,111,109,100, 97,116, 97, 95,109, 97,115,107, 95,109,111,100, 97,108, 0, 99,117,115,101,114, 0, 98,108,101,
-110,100, 0,118,105,101,119, 0,119,105,110,109, 97,116, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,109, 97,116, 91, 52, 93, 91,
- 52, 93, 0,118,105,101,119,105,110,118, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,
-101,114,115,105,110,118, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,109, 97,116,111, 98, 91, 52, 93, 91, 52, 93, 0,112,101,114,
-115,109, 97,116,111, 98, 91, 52, 93, 91, 52, 93, 0,116,119,109, 97,116, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,113,117, 97,
-116, 91, 52, 93, 0,122,102, 97, 99, 0, 99, 97,109,100,120, 0, 99, 97,109,100,121, 0,112,105,120,115,105,122,101, 0, 99, 97,
-109,122,111,111,109, 0,116,119,100,114, 97,119,102,108, 97,103, 0,105,115, 95,112,101,114,115,112, 0,114,102,108, 97,103, 0,
-118,105,101,119,108,111, 99,107, 0,112,101,114,115,112, 0, 99,108,105,112, 91, 54, 93, 91, 52, 93, 0, 99,108,105,112, 95,108,
-111, 99, 97,108, 91, 54, 93, 91, 52, 93, 0, 42, 99,108,105,112, 98, 98, 0, 42,108,111, 99, 97,108,118,100, 0, 42,114,105, 0,
- 42,114,101,110,100,101,114, 95,101,110,103,105,110,101, 0, 42,100,101,112,116,104,115, 0, 42,115,109,115, 0, 42,115,109,111,
-111,116,104, 95,116,105,109,101,114, 0,108,118,105,101,119,113,117, 97,116, 91, 52, 93, 0,108,112,101,114,115,112, 0,108,118,
-105,101,119, 0,103,114,105,100,118,105,101,119, 0,116,119, 97,110,103,108,101, 91, 51, 93, 0,114,111,116, 95, 97,110,103,108,
-101, 0,114,111,116, 95, 97,120,105,115, 91, 51, 93, 0,112, 97,100, 50, 91, 52, 93, 0,114,101,103,105,111,110, 98, 97,115,101,
- 0,115,112, 97, 99,101,116,121,112,101, 0, 98,108,111, 99,107,115, 99, 97,108,101, 0, 98,108,111, 99,107,104, 97,110,100,108,
-101,114, 91, 56, 93, 0, 98,117,110,100,108,101, 95,115,105,122,101, 0, 98,117,110,100,108,101, 95,100,114, 97,119,116,121,112,
-101, 0,108, 97,121, 95,117,115,101,100, 0, 42,111, 98, 95, 99,101,110,116,114,101, 0, 98,103,112,105, 99, 98, 97,115,101, 0,
- 42, 98,103,112,105, 99, 0,111, 98, 95, 99,101,110,116,114,101, 95, 98,111,110,101, 91, 54, 52, 93, 0,100,114, 97,119,116,121,
-112,101, 0,111, 98, 95, 99,101,110,116,114,101, 95, 99,117,114,115,111,114, 0,115, 99,101,110,101,108,111, 99,107, 0, 97,114,
-111,117,110,100, 0,103,114,105,100, 0,110,101, 97,114, 0,102, 97,114, 0,109,111,100,101,115,101,108,101, 99,116, 0,103,114,
-105,100,108,105,110,101,115, 0,103,114,105,100,115,117, 98,100,105,118, 0,103,114,105,100,102,108, 97,103, 0,116,119,116,121,
-112,101, 0,116,119,109,111,100,101, 0,116,119,102,108, 97,103, 0,112, 97,100, 50, 91, 50, 93, 0, 97,102,116,101,114,100,114,
- 97,119, 95,116,114, 97,110,115,112, 0, 97,102,116,101,114,100,114, 97,119, 95,120,114, 97,121, 0, 97,102,116,101,114,100,114,
- 97,119, 95,120,114, 97,121,116,114, 97,110,115,112, 0,122, 98,117,102, 0,120,114, 97,121, 0,112, 97,100, 51, 91, 50, 93, 0,
- 42,112,114,111,112,101,114,116,105,101,115, 95,115,116,111,114, 97,103,101, 0,118,101,114,116, 0,104,111,114, 0,109, 97,115,
-107, 0,109,105,110, 91, 50, 93, 0,109, 97,120, 91, 50, 93, 0,109,105,110,122,111,111,109, 0,109, 97,120,122,111,111,109, 0,
-115, 99,114,111,108,108, 0,115, 99,114,111,108,108, 95,117,105, 0,107,101,101,112,116,111,116, 0,107,101,101,112,122,111,111,
-109, 0,107,101,101,112,111,102,115, 0, 97,108,105,103,110, 0,119,105,110,120, 0,119,105,110,121, 0,111,108,100,119,105,110,
-120, 0,111,108,100,119,105,110,121, 0, 42,116, 97, 98, 95,111,102,102,115,101,116, 0,116, 97, 98, 95,110,117,109, 0,116, 97,
- 98, 95, 99,117,114, 0,114,112,116, 95,109, 97,115,107, 0,118, 50,100, 0, 42, 97,100,115, 0,103,104,111,115,116, 67,117,114,
-118,101,115, 0, 97,117,116,111,115,110, 97,112, 0, 99,117,114,115,111,114, 86, 97,108, 0,109, 97,105,110, 98, 0,109, 97,105,
-110, 98,111, 0,109, 97,105,110, 98,117,115,101,114, 0,114,101, 95, 97,108,105,103,110, 0,112,114,101,118,105,101,119, 0,116,
-101,120,116,117,114,101, 95, 99,111,110,116,101,120,116, 0,112, 97,116,104,102,108, 97,103, 0,100, 97,116, 97,105, 99,111,110,
- 0, 42,112,105,110,105,100, 0, 42,116,101,120,117,115,101,114, 0,114,101,110,100,101,114, 95,115,105,122,101, 0, 99,104, 97,
-110,115,104,111,119,110, 0,122,101, 98,114, 97, 0,122,111,111,109, 0,116,105,116,108,101, 91, 51, 50, 93, 0,100,105,114, 91,
- 49, 48, 53, 54, 93, 0,102,105,108,101, 91, 50, 53, 54, 93, 0,114,101,110, 97,109,101,102,105,108,101, 91, 50, 53, 54, 93, 0,
-114,101,110, 97,109,101,101,100,105,116, 91, 50, 53, 54, 93, 0,102,105,108,116,101,114, 95,103,108,111, 98, 91, 54, 52, 93, 0,
- 97, 99,116,105,118,101, 95,102,105,108,101, 0,115,101,108, 95,102,105,114,115,116, 0,115,101,108, 95,108, 97,115,116, 0,115,
-111,114,116, 0,100,105,115,112,108, 97,121, 0,102, 95,102,112, 0,102,112, 95,115,116,114, 91, 56, 93, 0,115, 99,114,111,108,
-108, 95,111,102,102,115,101,116, 0, 42,112, 97,114, 97,109,115, 0, 42,102,105,108,101,115, 0, 42,102,111,108,100,101,114,115,
- 95,112,114,101,118, 0, 42,102,111,108,100,101,114,115, 95,110,101,120,116, 0, 42,111,112, 0, 42,115,109,111,111,116,104,115,
- 99,114,111,108,108, 95,116,105,109,101,114, 0, 42,108, 97,121,111,117,116, 0,114,101, 99,101,110,116,110,114, 0, 98,111,111,
-107,109, 97,114,107,110,114, 0,115,121,115,116,101,109,110,114, 0,116,114,101,101, 0, 42,116,114,101,101,115,116,111,114,101,
- 0,115,101, 97,114, 99,104, 95,115,116,114,105,110,103, 91, 51, 50, 93, 0,115,101, 97,114, 99,104, 95,116,115,101, 0,111,117,
-116,108,105,110,101,118,105,115, 0,115,116,111,114,101,102,108, 97,103, 0,115,101, 97,114, 99,104, 95,102,108, 97,103,115, 0,
- 42, 99,117,109, 97,112, 0,115, 99,111,112,101,115, 0,115, 97,109,112,108,101, 95,108,105,110,101, 95,104,105,115,116, 0, 99,
-117,114,115,111,114, 91, 50, 93, 0, 99,101,110,116,120, 0, 99,101,110,116,121, 0, 99,117,114,116,105,108,101, 0,108,111, 99,
-107, 0,112,105,110, 0,100,116, 95,117,118, 0,115,116,105, 99,107,121, 0,100,116, 95,117,118,115,116,114,101,116, 99,104, 0,
- 42,116,101,120,116, 0,116,111,112, 0,118,105,101,119,108,105,110,101,115, 0,109,101,110,117,110,114, 0,108,104,101,105,103,
-104,116, 0, 99,119,105,100,116,104, 0,108,105,110,101,110,114,115, 95,116,111,116, 0,108,101,102,116, 0,115,104,111,119,108,
-105,110,101,110,114,115, 0,116, 97, 98,110,117,109, 98,101,114, 0,115,104,111,119,115,121,110,116, 97,120, 0,108,105,110,101,
- 95,104,108,105,103,104,116, 0,111,118,101,114,119,114,105,116,101, 0,108,105,118,101, 95,101,100,105,116, 0,112,105,120, 95,
-112,101,114, 95,108,105,110,101, 0,116,120,116,115, 99,114,111,108,108, 0,116,120,116, 98, 97,114, 0,119,111,114,100,119,114,
- 97,112, 0,100,111,112,108,117,103,105,110,115, 0,102,105,110,100,115,116,114, 91, 50, 53, 54, 93, 0,114,101,112,108, 97, 99,
-101,115,116,114, 91, 50, 53, 54, 93, 0,109, 97,114,103,105,110, 95, 99,111,108,117,109,110, 0, 42,100,114, 97,119, 99, 97, 99,
-104,101, 0, 42,112,121, 95,100,114, 97,119, 0, 42,112,121, 95,101,118,101,110,116, 0, 42,112,121, 95, 98,117,116,116,111,110,
- 0, 42,112,121, 95, 98,114,111,119,115,101,114, 99, 97,108,108, 98, 97, 99,107, 0, 42,112,121, 95,103,108,111, 98, 97,108,100,
-105, 99,116, 0,108, 97,115,116,115,112, 97, 99,101, 0,115, 99,114,105,112,116,110, 97,109,101, 91, 49, 48, 50, 52, 93, 0,115,
- 99,114,105,112,116, 97,114,103, 91, 50, 53, 54, 93, 0, 42,115, 99,114,105,112,116, 0, 42, 98,117,116, 95,114,101,102,115, 0,
- 42, 97,114,114, 97,121, 0, 99, 97, 99,104,101,115, 0, 99, 97, 99,104,101, 95,100,105,115,112,108, 97,121, 0, 42,105,100, 0,
- 97,115,112,101, 99,116, 0,112, 97,100,102, 0,109,120, 0,109,121, 0, 42,101,100,105,116,116,114,101,101, 0,116,114,101,101,
-116,121,112,101, 0,116,101,120,102,114,111,109, 0,115,104, 97,100,101,114,102,114,111,109, 0,108,105,110,107,100,114, 97,103,
- 0,108,101,110, 95, 97,108,108,111, 99, 0, 99,117,114,115,111,114, 0,115, 99,114,111,108,108, 98, 97, 99,107, 0,104,105,115,
-116,111,114,121, 0,112,114,111,109,112,116, 91, 50, 53, 54, 93, 0,108, 97,110,103,117, 97,103,101, 91, 51, 50, 93, 0,115,101,
-108, 95,115,116, 97,114,116, 0,115,101,108, 95,101,110,100, 0,102,105,108,116,101,114, 91, 54, 52, 93, 0,120,108,111, 99,107,
-111,102, 0,121,108,111, 99,107,111,102, 0,117,115,101,114, 0,112, 97,116,104, 95,108,101,110,103,116,104, 0,108,111, 99, 91,
- 50, 93, 0,115,116, 97, 98,109, 97,116, 91, 52, 93, 91, 52, 93, 0,117,110,105,115,116, 97, 98,109, 97,116, 91, 52, 93, 91, 52,
- 93, 0,112,111,115,116,112,114,111, 99, 95,102,108, 97,103, 0,114,117,110,116,105,109,101, 95,102,108, 97,103, 0,102,105,108,
-101,110, 97,109,101, 91, 49, 48, 50, 52, 93, 0, 98,108,102, 95,105,100, 0,117,105,102,111,110,116, 95,105,100, 0,114, 95,116,
-111, 95,108, 0,112,111,105,110,116,115, 0,107,101,114,110,105,110,103, 0,105,116, 97,108,105, 99, 0, 98,111,108,100, 0,115,
-104, 97,100,111,119, 0,115,104, 97,100,120, 0,115,104, 97,100,121, 0,115,104, 97,100,111,119, 97,108,112,104, 97, 0,115,104,
- 97,100,111,119, 99,111,108,111,114, 0,112, 97,110,101,108,116,105,116,108,101, 0,103,114,111,117,112,108, 97, 98,101,108, 0,
-119,105,100,103,101,116,108, 97, 98,101,108, 0,119,105,100,103,101,116, 0,112, 97,110,101,108,122,111,111,109, 0,109,105,110,
-108, 97, 98,101,108, 99,104, 97,114,115, 0,109,105,110,119,105,100,103,101,116, 99,104, 97,114,115, 0, 99,111,108,117,109,110,
-115,112, 97, 99,101, 0,116,101,109,112,108, 97,116,101,115,112, 97, 99,101, 0, 98,111,120,115,112, 97, 99,101, 0, 98,117,116,
-116,111,110,115,112, 97, 99,101,120, 0, 98,117,116,116,111,110,115,112, 97, 99,101,121, 0,112, 97,110,101,108,115,112, 97, 99,
-101, 0,112, 97,110,101,108,111,117,116,101,114, 0,111,117,116,108,105,110,101, 91, 52, 93, 0,105,110,110,101,114, 91, 52, 93,
- 0,105,110,110,101,114, 95,115,101,108, 91, 52, 93, 0,105,116,101,109, 91, 52, 93, 0,116,101,120,116, 91, 52, 93, 0,116,101,
-120,116, 95,115,101,108, 91, 52, 93, 0,115,104, 97,100,101,100, 0,115,104, 97,100,101,116,111,112, 0,115,104, 97,100,101,100,
-111,119,110, 0, 97,108,112,104, 97, 95, 99,104,101, 99,107, 0,105,110,110,101,114, 95, 97,110,105,109, 91, 52, 93, 0,105,110,
-110,101,114, 95, 97,110,105,109, 95,115,101,108, 91, 52, 93, 0,105,110,110,101,114, 95,107,101,121, 91, 52, 93, 0,105,110,110,
-101,114, 95,107,101,121, 95,115,101,108, 91, 52, 93, 0,105,110,110,101,114, 95,100,114,105,118,101,110, 91, 52, 93, 0,105,110,
-110,101,114, 95,100,114,105,118,101,110, 95,115,101,108, 91, 52, 93, 0,104,101, 97,100,101,114, 91, 52, 93, 0,115,104,111,119,
- 95,104,101, 97,100,101,114, 0,119, 99,111,108, 95,114,101,103,117,108, 97,114, 0,119, 99,111,108, 95,116,111,111,108, 0,119,
- 99,111,108, 95,116,101,120,116, 0,119, 99,111,108, 95,114, 97,100,105,111, 0,119, 99,111,108, 95,111,112,116,105,111,110, 0,
-119, 99,111,108, 95,116,111,103,103,108,101, 0,119, 99,111,108, 95,110,117,109, 0,119, 99,111,108, 95,110,117,109,115,108,105,
-100,101,114, 0,119, 99,111,108, 95,109,101,110,117, 0,119, 99,111,108, 95,112,117,108,108,100,111,119,110, 0,119, 99,111,108,
- 95,109,101,110,117, 95, 98, 97, 99,107, 0,119, 99,111,108, 95,109,101,110,117, 95,105,116,101,109, 0,119, 99,111,108, 95, 98,
-111,120, 0,119, 99,111,108, 95,115, 99,114,111,108,108, 0,119, 99,111,108, 95,112,114,111,103,114,101,115,115, 0,119, 99,111,
-108, 95,108,105,115,116, 95,105,116,101,109, 0,119, 99,111,108, 95,115,116, 97,116,101, 0,112, 97,110,101,108, 0,105, 99,111,
-110,102,105,108,101, 91, 50, 53, 54, 93, 0,105, 99,111,110, 95, 97,108,112,104, 97, 0, 98, 97, 99,107, 91, 52, 93, 0,116,105,
-116,108,101, 91, 52, 93, 0,116,101,120,116, 95,104,105, 91, 52, 93, 0,104,101, 97,100,101,114, 95,116,105,116,108,101, 91, 52,
- 93, 0,104,101, 97,100,101,114, 95,116,101,120,116, 91, 52, 93, 0,104,101, 97,100,101,114, 95,116,101,120,116, 95,104,105, 91,
- 52, 93, 0, 98,117,116,116,111,110, 91, 52, 93, 0, 98,117,116,116,111,110, 95,116,105,116,108,101, 91, 52, 93, 0, 98,117,116,
-116,111,110, 95,116,101,120,116, 91, 52, 93, 0, 98,117,116,116,111,110, 95,116,101,120,116, 95,104,105, 91, 52, 93, 0,108,105,
-115,116, 91, 52, 93, 0,108,105,115,116, 95,116,105,116,108,101, 91, 52, 93, 0,108,105,115,116, 95,116,101,120,116, 91, 52, 93,
- 0,108,105,115,116, 95,116,101,120,116, 95,104,105, 91, 52, 93, 0,112, 97,110,101,108, 91, 52, 93, 0,112, 97,110,101,108, 95,
-116,105,116,108,101, 91, 52, 93, 0,112, 97,110,101,108, 95,116,101,120,116, 91, 52, 93, 0,112, 97,110,101,108, 95,116,101,120,
-116, 95,104,105, 91, 52, 93, 0,115,104, 97,100,101, 49, 91, 52, 93, 0,115,104, 97,100,101, 50, 91, 52, 93, 0,104,105,108,105,
-116,101, 91, 52, 93, 0,103,114,105,100, 91, 52, 93, 0,119,105,114,101, 91, 52, 93, 0,115,101,108,101, 99,116, 91, 52, 93, 0,
-108, 97,109,112, 91, 52, 93, 0,115,112,101, 97,107,101,114, 91, 52, 93, 0, 97, 99,116,105,118,101, 91, 52, 93, 0,103,114,111,
-117,112, 91, 52, 93, 0,103,114,111,117,112, 95, 97, 99,116,105,118,101, 91, 52, 93, 0,116,114, 97,110,115,102,111,114,109, 91,
- 52, 93, 0,118,101,114,116,101,120, 91, 52, 93, 0,118,101,114,116,101,120, 95,115,101,108,101, 99,116, 91, 52, 93, 0,101,100,
-103,101, 91, 52, 93, 0,101,100,103,101, 95,115,101,108,101, 99,116, 91, 52, 93, 0,101,100,103,101, 95,115,101, 97,109, 91, 52,
- 93, 0,101,100,103,101, 95,115,104, 97,114,112, 91, 52, 93, 0,101,100,103,101, 95,102, 97, 99,101,115,101,108, 91, 52, 93, 0,
-101,100,103,101, 95, 99,114,101, 97,115,101, 91, 52, 93, 0,102, 97, 99,101, 91, 52, 93, 0,102, 97, 99,101, 95,115,101,108,101,
- 99,116, 91, 52, 93, 0,102, 97, 99,101, 95,100,111,116, 91, 52, 93, 0,101,120,116,114, 97, 95,101,100,103,101, 95,108,101,110,
- 91, 52, 93, 0,101,120,116,114, 97, 95,102, 97, 99,101, 95, 97,110,103,108,101, 91, 52, 93, 0,101,120,116,114, 97, 95,102, 97,
- 99,101, 95, 97,114,101, 97, 91, 52, 93, 0,112, 97,100, 51, 91, 52, 93, 0,110,111,114,109, 97,108, 91, 52, 93, 0,118,101,114,
-116,101,120, 95,110,111,114,109, 97,108, 91, 52, 93, 0, 98,111,110,101, 95,115,111,108,105,100, 91, 52, 93, 0, 98,111,110,101,
- 95,112,111,115,101, 91, 52, 93, 0,115,116,114,105,112, 91, 52, 93, 0,115,116,114,105,112, 95,115,101,108,101, 99,116, 91, 52,
- 93, 0, 99,102,114, 97,109,101, 91, 52, 93, 0,110,117,114, 98, 95,117,108,105,110,101, 91, 52, 93, 0,110,117,114, 98, 95,118,
-108,105,110,101, 91, 52, 93, 0, 97, 99,116, 95,115,112,108,105,110,101, 91, 52, 93, 0,110,117,114, 98, 95,115,101,108, 95,117,
-108,105,110,101, 91, 52, 93, 0,110,117,114, 98, 95,115,101,108, 95,118,108,105,110,101, 91, 52, 93, 0,108, 97,115,116,115,101,
-108, 95,112,111,105,110,116, 91, 52, 93, 0,104, 97,110,100,108,101, 95,102,114,101,101, 91, 52, 93, 0,104, 97,110,100,108,101,
- 95, 97,117,116,111, 91, 52, 93, 0,104, 97,110,100,108,101, 95,118,101, 99,116, 91, 52, 93, 0,104, 97,110,100,108,101, 95, 97,
-108,105,103,110, 91, 52, 93, 0,104, 97,110,100,108,101, 95, 97,117,116,111, 95, 99,108, 97,109,112,101,100, 91, 52, 93, 0,104,
- 97,110,100,108,101, 95,115,101,108, 95,102,114,101,101, 91, 52, 93, 0,104, 97,110,100,108,101, 95,115,101,108, 95, 97,117,116,
-111, 91, 52, 93, 0,104, 97,110,100,108,101, 95,115,101,108, 95,118,101, 99,116, 91, 52, 93, 0,104, 97,110,100,108,101, 95,115,
-101,108, 95, 97,108,105,103,110, 91, 52, 93, 0,104, 97,110,100,108,101, 95,115,101,108, 95, 97,117,116,111, 95, 99,108, 97,109,
-112,101,100, 91, 52, 93, 0,100,115, 95, 99,104, 97,110,110,101,108, 91, 52, 93, 0,100,115, 95,115,117, 98, 99,104, 97,110,110,
-101,108, 91, 52, 93, 0, 99,111,110,115,111,108,101, 95,111,117,116,112,117,116, 91, 52, 93, 0, 99,111,110,115,111,108,101, 95,
-105,110,112,117,116, 91, 52, 93, 0, 99,111,110,115,111,108,101, 95,105,110,102,111, 91, 52, 93, 0, 99,111,110,115,111,108,101,
- 95,101,114,114,111,114, 91, 52, 93, 0, 99,111,110,115,111,108,101, 95, 99,117,114,115,111,114, 91, 52, 93, 0,118,101,114,116,
-101,120, 95,115,105,122,101, 0,111,117,116,108,105,110,101, 95,119,105,100,116,104, 0,102, 97, 99,101,100,111,116, 95,115,105,
-122,101, 0,110,111,111,100,108,101, 95, 99,117,114,118,105,110,103, 0,115,121,110,116, 97,120,108, 91, 52, 93, 0,115,121,110,
-116, 97,120,110, 91, 52, 93, 0,115,121,110,116, 97,120, 98, 91, 52, 93, 0,115,121,110,116, 97,120,118, 91, 52, 93, 0,115,121,
-110,116, 97,120, 99, 91, 52, 93, 0,109,111,118,105,101, 91, 52, 93, 0,105,109, 97,103,101, 91, 52, 93, 0,115, 99,101,110,101,
- 91, 52, 93, 0, 97,117,100,105,111, 91, 52, 93, 0,101,102,102,101, 99,116, 91, 52, 93, 0,112,108,117,103,105,110, 91, 52, 93,
- 0,116,114, 97,110,115,105,116,105,111,110, 91, 52, 93, 0,109,101,116, 97, 91, 52, 93, 0,101,100,105,116,109,101,115,104, 95,
- 97, 99,116,105,118,101, 91, 52, 93, 0,104, 97,110,100,108,101, 95,118,101,114,116,101,120, 91, 52, 93, 0,104, 97,110,100,108,
-101, 95,118,101,114,116,101,120, 95,115,101,108,101, 99,116, 91, 52, 93, 0,104, 97,110,100,108,101, 95,118,101,114,116,101,120,
- 95,115,105,122,101, 0,109, 97,114,107,101,114, 95,111,117,116,108,105,110,101, 91, 52, 93, 0,109, 97,114,107,101,114, 91, 52,
- 93, 0, 97, 99,116, 95,109, 97,114,107,101,114, 91, 52, 93, 0,115,101,108, 95,109, 97,114,107,101,114, 91, 52, 93, 0,100,105,
-115, 95,109, 97,114,107,101,114, 91, 52, 93, 0,108,111, 99,107, 95,109, 97,114,107,101,114, 91, 52, 93, 0, 98,117,110,100,108,
-101, 95,115,111,108,105,100, 91, 52, 93, 0,112, 97,116,104, 95, 98,101,102,111,114,101, 91, 52, 93, 0,112, 97,116,104, 95, 97,
-102,116,101,114, 91, 52, 93, 0, 99, 97,109,101,114, 97, 95,112, 97,116,104, 91, 52, 93, 0,104,112, 97,100, 91, 55, 93, 0,112,
-114,101,118,105,101,119, 95, 98, 97, 99,107, 91, 52, 93, 0,112,114,101,118,105,101,119, 95,115,116,105,116, 99,104, 95,102, 97,
- 99,101, 91, 52, 93, 0,112,114,101,118,105,101,119, 95,115,116,105,116, 99,104, 95,101,100,103,101, 91, 52, 93, 0,112,114,101,
-118,105,101,119, 95,115,116,105,116, 99,104, 95,118,101,114,116, 91, 52, 93, 0,112,114,101,118,105,101,119, 95,115,116,105,116,
- 99,104, 95,115,116,105,116, 99,104, 97, 98,108,101, 91, 52, 93, 0,112,114,101,118,105,101,119, 95,115,116,105,116, 99,104, 95,
-117,110,115,116,105,116, 99,104, 97, 98,108,101, 91, 52, 93, 0,112,114,101,118,105,101,119, 95,115,116,105,116, 99,104, 95, 97,
- 99,116,105,118,101, 91, 52, 93, 0,109, 97,116, 99,104, 91, 52, 93, 0,115,101,108,101, 99,116,101,100, 95,104,105,103,104,108,
-105,103,104,116, 91, 52, 93, 0,115,111,108,105,100, 91, 52, 93, 0,116,117,105, 0,116, 98,117,116,115, 0,116,118, 51,100, 0,
-116,102,105,108,101, 0,116,105,112,111, 0,116,105,110,102,111, 0,116, 97, 99,116, 0,116,110,108, 97, 0,116,115,101,113, 0,
-116,105,109, 97, 0,116,101,120,116, 0,116,111,111,112,115, 0,116,116,105,109,101, 0,116,110,111,100,101, 0,116,108,111,103,
-105, 99, 0,116,117,115,101,114,112,114,101,102, 0,116, 99,111,110,115,111,108,101, 0,116, 99,108,105,112, 0,116, 97,114,109,
- 91, 50, 48, 93, 0, 97, 99,116,105,118,101, 95,116,104,101,109,101, 95, 97,114,101, 97, 0,109,111,100,117,108,101, 91, 54, 52,
- 93, 0,115,112,101, 99, 91, 52, 93, 0,100,117,112,102,108, 97,103, 0,115, 97,118,101,116,105,109,101, 0,116,101,109,112,100,
-105,114, 91, 55, 54, 56, 93, 0,102,111,110,116,100,105,114, 91, 55, 54, 56, 93, 0,114,101,110,100,101,114,100,105,114, 91, 49,
- 48, 50, 52, 93, 0,116,101,120,116,117,100,105,114, 91, 55, 54, 56, 93, 0,112,108,117,103,116,101,120,100,105,114, 91, 55, 54,
- 56, 93, 0,112,108,117,103,115,101,113,100,105,114, 91, 55, 54, 56, 93, 0,112,121,116,104,111,110,100,105,114, 91, 55, 54, 56,
- 93, 0,115,111,117,110,100,100,105,114, 91, 55, 54, 56, 93, 0,105,109, 97,103,101, 95,101,100,105,116,111,114, 91, 49, 48, 50,
- 52, 93, 0, 97,110,105,109, 95,112,108, 97,121,101,114, 91, 49, 48, 50, 52, 93, 0, 97,110,105,109, 95,112,108, 97,121,101,114,
- 95,112,114,101,115,101,116, 0,118, 50,100, 95,109,105,110, 95,103,114,105,100,115,105,122,101, 0,116,105,109,101, 99,111,100,
-101, 95,115,116,121,108,101, 0,118,101,114,115,105,111,110,115, 0,100, 98,108, 95, 99,108,105, 99,107, 95,116,105,109,101, 0,
-103, 97,109,101,102,108, 97,103,115, 0,119,104,101,101,108,108,105,110,101,115, 99,114,111,108,108, 0,117,105,102,108, 97,103,
- 0,108, 97,110,103,117, 97,103,101, 0,117,115,101,114,112,114,101,102, 0,118,105,101,119,122,111,111,109, 0,109,105,120, 98,
-117,102,115,105,122,101, 0, 97,117,100,105,111,100,101,118,105, 99,101, 0, 97,117,100,105,111,114, 97,116,101, 0, 97,117,100,
-105,111,102,111,114,109, 97,116, 0, 97,117,100,105,111, 99,104, 97,110,110,101,108,115, 0,100,112,105, 0,101,110, 99,111,100,
-105,110,103, 0,116,114, 97,110,115,111,112,116,115, 0,109,101,110,117,116,104,114,101,115,104,111,108,100, 49, 0,109,101,110,
-117,116,104,114,101,115,104,111,108,100, 50, 0,116,104,101,109,101,115, 0,117,105,102,111,110,116,115, 0,117,105,115,116,121,
-108,101,115, 0,107,101,121,109, 97,112,115, 0,117,115,101,114, 95,107,101,121,109, 97,112,115, 0, 97,100,100,111,110,115, 0,
-107,101,121, 99,111,110,102,105,103,115,116,114, 91, 54, 52, 93, 0,117,110,100,111,115,116,101,112,115, 0,117,110,100,111,109,
-101,109,111,114,121, 0,103,112, 95,109, 97,110,104, 97,116,116,101,110,100,105,115,116, 0,103,112, 95,101,117, 99,108,105,100,
-101, 97,110,100,105,115,116, 0,103,112, 95,101,114, 97,115,101,114, 0,103,112, 95,115,101,116,116,105,110,103,115, 0,116, 98,
- 95,108,101,102,116,109,111,117,115,101, 0,116, 98, 95,114,105,103,104,116,109,111,117,115,101, 0,108,105,103,104,116, 91, 51,
- 93, 0,116,119, 95,104,111,116,115,112,111,116, 0,116,119, 95,102,108, 97,103, 0,116,119, 95,104, 97,110,100,108,101,115,105,
-122,101, 0,116,119, 95,115,105,122,101, 0,116,101,120,116,105,109,101,111,117,116, 0,116,101,120, 99,111,108,108,101, 99,116,
-114, 97,116,101, 0,119,109,100,114, 97,119,109,101,116,104,111,100, 0,100,114, 97,103,116,104,114,101,115,104,111,108,100, 0,
-109,101,109, 99, 97, 99,104,101,108,105,109,105,116, 0,112,114,101,102,101,116, 99,104,102,114, 97,109,101,115, 0,102,114, 97,
-109,101,115,101,114,118,101,114,112,111,114,116, 0,112, 97,100, 95,114,111,116, 95, 97,110,103,108,101, 0,111, 98, 99,101,110,
-116,101,114, 95,100,105, 97, 0,114,118,105,115,105,122,101, 0,114,118,105, 98,114,105,103,104,116, 0,114,101, 99,101,110,116,
- 95,102,105,108,101,115, 0,115,109,111,111,116,104, 95,118,105,101,119,116,120, 0,103,108,114,101,115,108,105,109,105,116, 0,
- 99,117,114,115,115,105,122,101, 0, 99,111,108,111,114, 95,112,105, 99,107,101,114, 95,116,121,112,101, 0,105,112,111, 95,110,
-101,119, 0,107,101,121,104, 97,110,100,108,101,115, 95,110,101,119, 0,115, 99,114, 99, 97,115,116,102,112,115, 0,115, 99,114,
- 99, 97,115,116,119, 97,105,116, 0,119,105,100,103,101,116, 95,117,110,105,116, 0, 97,110,105,115,111,116,114,111,112,105, 99,
- 95,102,105,108,116,101,114, 0,117,115,101, 95, 49, 54, 98,105,116, 95,116,101,120,116,117,114,101,115, 0,112, 97,100, 56, 0,
-110,100,111,102, 95,115,101,110,115,105,116,105,118,105,116,121, 0,110,100,111,102, 95,102,108, 97,103, 0,103,108, 97,108,112,
-104, 97, 99,108,105,112, 0,116,101,120,116, 95,114,101,110,100,101,114, 0,112, 97,100, 57, 0, 99,111, 98, 97, 95,119,101,105,
-103,104,116, 0,115, 99,117,108,112,116, 95,112, 97,105,110,116, 95,111,118,101,114,108, 97,121, 95, 99,111,108, 91, 51, 93, 0,
-116,119,101, 97,107, 95,116,104,114,101,115,104,111,108,100, 0, 97,117,116,104,111,114, 91, 56, 48, 93, 0, 99,111,109,112,117,
-116,101, 95,100,101,118,105, 99,101, 95,116,121,112,101, 0, 99,111,109,112,117,116,101, 95,100,101,118,105, 99,101, 95,105,100,
- 0,118,101,114,116, 98, 97,115,101, 0,101,100,103,101, 98, 97,115,101, 0, 97,114,101, 97, 98, 97,115,101, 0, 42,110,101,119,
-115, 99,101,110,101, 0,114,101,100,114, 97,119,115, 95,102,108, 97,103, 0,102,117,108,108, 0,116,101,109,112, 0,119,105,110,
-105,100, 0,100,111, 95,100,114, 97,119, 0,100,111, 95,114,101,102,114,101,115,104, 0,100,111, 95,100,114, 97,119, 95,103,101,
-115,116,117,114,101, 0,100,111, 95,100,114, 97,119, 95,112, 97,105,110,116, 99,117,114,115,111,114, 0,100,111, 95,100,114, 97,
-119, 95,100,114, 97,103, 0,115,119, 97,112, 0,109, 97,105,110,119,105,110, 0,115,117, 98,119,105,110, 97, 99,116,105,118,101,
- 0, 42, 97,110,105,109,116,105,109,101,114, 0, 42, 99,111,110,116,101,120,116, 0,104, 97,110,100,108,101,114, 91, 56, 93, 0,
- 42,110,101,119,118, 0,118,101, 99, 0, 42,118, 49, 0, 42,118, 50, 0, 42,116,121,112,101, 0,112, 97,110,101,108,110, 97,109,
-101, 91, 54, 52, 93, 0,116, 97, 98,110, 97,109,101, 91, 54, 52, 93, 0,100,114, 97,119,110, 97,109,101, 91, 54, 52, 93, 0,111,
-102,115,120, 0,111,102,115,121, 0,115,105,122,101,120, 0,115,105,122,101,121, 0,108, 97, 98,101,108,111,102,115, 0, 99,111,
-110,116,114,111,108, 0,115,110, 97,112, 0,115,111,114,116,111,114,100,101,114, 0, 42,112, 97,110,101,108,116, 97, 98, 0, 42,
- 97, 99,116,105,118,101,100, 97,116, 97, 0,108,105,115,116, 95,115, 99,114,111,108,108, 0,108,105,115,116, 95,115,105,122,101,
- 0,108,105,115,116, 95,108, 97,115,116, 95,108,101,110, 0,108,105,115,116, 95,103,114,105,112, 95,115,105,122,101, 0,108,105,
-115,116, 95,115,101, 97,114, 99,104, 91, 54, 52, 93, 0, 42,118, 51, 0, 42,118, 52, 0, 42,102,117,108,108, 0, 98,117,116,115,
-112, 97, 99,101,116,121,112,101, 0,104,101, 97,100,101,114,116,121,112,101, 0,115,112, 97, 99,101,100, 97,116, 97, 0,104, 97,
-110,100,108,101,114,115, 0, 97, 99,116,105,111,110,122,111,110,101,115, 0,119,105,110,114, 99,116, 0,100,114, 97,119,114, 99,
-116, 0,115,119,105,110,105,100, 0,114,101,103,105,111,110,116,121,112,101, 0, 97,108,105,103,110,109,101,110,116, 0,100,111,
- 95,100,114, 97,119, 95,111,118,101,114,108, 97,121, 0,117,105, 98,108,111, 99,107,115, 0,112, 97,110,101,108,115, 0, 42,104,
-101, 97,100,101,114,115,116,114, 0, 42,114,101,103,105,111,110,100, 97,116, 97, 0,115,117, 98,118,115,116,114, 91, 52, 93, 0,
-115,117, 98,118,101,114,115,105,111,110, 0,112, 97,100,115, 0,109,105,110,118,101,114,115,105,111,110, 0,109,105,110,115,117,
- 98,118,101,114,115,105,111,110, 0,119,105,110,112,111,115, 0, 42, 99,117,114,115, 99,114,101,101,110, 0, 42, 99,117,114,115,
- 99,101,110,101, 0,102,105,108,101,102,108, 97,103,115, 0,103,108,111, 98, 97,108,102, 0,114,101,118,105,115,105,111,110, 0,
-110, 97,109,101, 91, 50, 53, 54, 93, 0,111,114,105,103, 95,119,105,100,116,104, 0,111,114,105,103, 95,104,101,105,103,104,116,
- 0, 98,111,116,116,111,109, 0,114,105,103,104,116, 0,120,111,102,115, 0,121,111,102,115, 0,108,105,102,116, 91, 51, 93, 0,
-103, 97,109,109, 97, 91, 51, 93, 0,103, 97,105,110, 91, 51, 93, 0,100,105,114, 91, 55, 54, 56, 93, 0,116, 99, 0, 98,117,105,
-108,100, 95,115,105,122,101, 95,102,108, 97,103,115, 0, 98,117,105,108,100, 95,116, 99, 95,102,108, 97,103,115, 0,100,111,110,
-101, 0,115,116, 97,114,116,115,116,105,108,108, 0,101,110,100,115,116,105,108,108, 0, 42,115,116,114,105,112,100, 97,116, 97,
- 0, 42, 99,114,111,112, 0, 42,116,114, 97,110,115,102,111,114,109, 0, 42, 99,111,108,111,114, 95, 98, 97,108, 97,110, 99,101,
- 0, 42,105,110,115,116, 97,110, 99,101, 95,112,114,105,118, 97,116,101, 95,100, 97,116, 97, 0, 42, 42, 99,117,114,114,101,110,
-116, 95,112,114,105,118, 97,116,101, 95,100, 97,116, 97, 0, 42,116,109,112, 0,115,116, 97,114,116,111,102,115, 0,101,110,100,
-111,102,115, 0,109, 97, 99,104,105,110,101, 0,115,116, 97,114,116,100,105,115,112, 0,101,110,100,100,105,115,112, 0,115, 97,
-116, 0,109,117,108, 0,104, 97,110,100,115,105,122,101, 0, 97,110,105,109, 95,112,114,101,115,101,101,107, 0,115,116,114,101,
- 97,109,105,110,100,101,120, 0, 42,115,116,114,105,112, 0, 42,115, 99,101,110,101, 95, 99, 97,109,101,114, 97, 0,101,102,102,
-101, 99,116, 95,102, 97,100,101,114, 0,115,112,101,101,100, 95,102, 97,100,101,114, 0, 42,115,101,113, 49, 0, 42,115,101,113,
- 50, 0, 42,115,101,113, 51, 0,115,101,113, 98, 97,115,101, 0, 42,115,111,117,110,100, 0, 42,115, 99,101,110,101, 95,115,111,
-117,110,100, 0,112,105,116, 99,104, 0,112, 97,110, 0,115, 99,101,110,101,110,114, 0,109,117,108,116,105, 99, 97,109, 95,115,
-111,117,114, 99,101, 0,115,116,114,111, 98,101, 0, 42,101,102,102,101, 99,116,100, 97,116, 97, 0, 97,110,105,109, 95,115,116,
- 97,114,116,111,102,115, 0, 97,110,105,109, 95,101,110,100,111,102,115, 0, 98,108,101,110,100, 95,109,111,100,101, 0, 98,108,
-101,110,100, 95,111,112, 97, 99,105,116,121, 0, 42,111,108,100, 98, 97,115,101,112, 0, 42,112, 97,114,115,101,113, 0, 42,115,
-101,113, 98, 97,115,101,112, 0,109,101,116, 97,115,116, 97, 99,107, 0, 42, 97, 99,116, 95,115,101,113, 0, 97, 99,116, 95,105,
-109, 97,103,101,100,105,114, 91, 49, 48, 50, 52, 93, 0, 97, 99,116, 95,115,111,117,110,100,100,105,114, 91, 49, 48, 50, 52, 93,
- 0,111,118,101,114, 95,111,102,115, 0,111,118,101,114, 95, 99,102,114, 97, 0,111,118,101,114, 95,102,108, 97,103, 0,111,118,
-101,114, 95, 98,111,114,100,101,114, 0,101,100,103,101, 87,105,100,116,104, 0,102,111,114,119, 97,114,100, 0,119,105,112,101,
-116,121,112,101, 0,102, 77,105,110,105, 0,102, 67,108, 97,109,112, 0,102, 66,111,111,115,116, 0,100, 68,105,115,116, 0,100,
- 81,117, 97,108,105,116,121, 0, 98, 78,111, 67,111,109,112, 0, 83, 99, 97,108,101,120, 73,110,105, 0, 83, 99, 97,108,101,121,
- 73,110,105, 0,120, 73,110,105, 0,121, 73,110,105, 0,114,111,116, 73,110,105, 0,105,110,116,101,114,112,111,108, 97,116,105,
-111,110, 0,117,110,105,102,111,114,109, 95,115, 99, 97,108,101, 0, 42,102,114, 97,109,101, 77, 97,112, 0,103,108,111, 98, 97,
-108, 83,112,101,101,100, 0,108, 97,115,116, 86, 97,108,105,100, 70,114, 97,109,101, 0, 98,117,116,116,121,112,101, 0,117,115,
-101,114,106,105,116, 0,115,116, 97, 0,116,111,116,112, 97,114,116, 0,110,111,114,109,102, 97, 99, 0,111, 98,102, 97, 99, 0,
-114, 97,110,100,102, 97, 99, 0,116,101,120,102, 97, 99, 0,114, 97,110,100,108,105,102,101, 0,102,111,114, 99,101, 91, 51, 93,
- 0,118,101, 99,116,115,105,122,101, 0,109, 97,120,108,101,110, 0,100,101,102,118,101, 99, 91, 51, 93, 0,109,117,108,116, 91,
- 52, 93, 0,108,105,102,101, 91, 52, 93, 0, 99,104,105,108,100, 91, 52, 93, 0,109, 97,116, 91, 52, 93, 0,116,101,120,109, 97,
-112, 0, 99,117,114,109,117,108,116, 0,115,116, 97,116,105, 99,115,116,101,112, 0,111,109, 97,116, 0,116,105,109,101,116,101,
-120, 0,115,112,101,101,100,116,101,120, 0,102,108, 97,103, 50,110,101,103, 0,118,101,114,116,103,114,111,117,112, 95,118, 0,
-118,103,114,111,117,112,110, 97,109,101, 91, 54, 52, 93, 0,118,103,114,111,117,112,110, 97,109,101, 95,118, 91, 54, 52, 93, 0,
- 42,107,101,121,115, 0,109,105,110,102, 97, 99, 0,110,114, 0,117,115,101,100, 0,117,115,101,100,101,108,101,109, 0, 42,112,
-111,105,110, 0,114,101,115,101,116,100,105,115,116, 0,108, 97,115,116,118, 97,108, 0, 42,109, 97, 0,107,101,121, 0,113,117,
- 97,108, 0,113,117, 97,108, 50, 0,116, 97,114,103,101,116, 78, 97,109,101, 91, 54, 52, 93, 0,116,111,103,103,108,101, 78, 97,
-109,101, 91, 54, 52, 93, 0,118, 97,108,117,101, 91, 54, 52, 93, 0,109, 97,120,118, 97,108,117,101, 91, 54, 52, 93, 0,100,101,
-108, 97,121, 0,100,117,114, 97,116,105,111,110, 0,109, 97,116,101,114,105, 97,108, 78, 97,109,101, 91, 54, 52, 93, 0,100, 97,
-109,112,116,105,109,101,114, 0,112,114,111,112,110, 97,109,101, 91, 54, 52, 93, 0,109, 97,116,110, 97,109,101, 91, 54, 52, 93,
- 0, 97,120,105,115,102,108, 97,103, 0,112,111,115,101, 99,104, 97,110,110,101,108, 91, 54, 52, 93, 0, 99,111,110,115,116,114,
- 97,105,110,116, 91, 54, 52, 93, 0, 42,102,114,111,109, 79, 98,106,101, 99,116, 0,115,117, 98,106,101, 99,116, 91, 54, 52, 93,
- 0, 98,111,100,121, 91, 54, 52, 93, 0,111,116,121,112,101, 0,112,117,108,115,101, 0,102,114,101,113, 0,116,111,116,108,105,
-110,107,115, 0, 42, 42,108,105,110,107,115, 0,108,101,118,101,108, 0,116, 97,112, 0,106,111,121,105,110,100,101,120, 0, 97,
-120,105,115, 95,115,105,110,103,108,101, 0, 97,120,105,115,102, 0, 98,117,116,116,111,110, 0,104, 97,116, 0,104, 97,116,102,
- 0,112,114,101, 99,105,115,105,111,110, 0,115,116,114, 91, 49, 50, 56, 93, 0, 42,109,121,110,101,119, 0,105,110,112,117,116,
-115, 0,116,111,116,115,108,105,110,107,115, 0, 42, 42,115,108,105,110,107,115, 0,118, 97,108,111, 0,115,116, 97,116,101, 95,
-109, 97,115,107, 0, 42, 97, 99,116, 0,102,114, 97,109,101, 80,114,111,112, 91, 54, 52, 93, 0, 98,108,101,110,100,105,110, 0,
-112,114,105,111,114,105,116,121, 0,101,110,100, 95,114,101,115,101,116, 0,115,116,114,105,100,101, 97,120,105,115, 0,115,116,
-114,105,100,101,108,101,110,103,116,104, 0,108, 97,121,101,114, 95,119,101,105,103,104,116, 0,109,105,110, 95,103, 97,105,110,
- 0,109, 97,120, 95,103, 97,105,110, 0,114,101,102,101,114,101,110, 99,101, 95,100,105,115,116, 97,110, 99,101, 0,109, 97,120,
- 95,100,105,115,116, 97,110, 99,101, 0,114,111,108,108,111,102,102, 95,102, 97, 99,116,111,114, 0, 99,111,110,101, 95,105,110,
-110,101,114, 95, 97,110,103,108,101, 0, 99,111,110,101, 95,111,117,116,101,114, 95, 97,110,103,108,101, 0, 99,111,110,101, 95,
-111,117,116,101,114, 95,103, 97,105,110, 0,115,110,100,110,114, 0,115,111,117,110,100, 51, 68, 0,112, 97,100, 54, 91, 49, 93,
- 0, 42,109,101, 0,108,105,110, 86,101,108,111, 99,105,116,121, 91, 51, 93, 0, 97,110,103, 86,101,108,111, 99,105,116,121, 91,
- 51, 93, 0,108,111, 99, 97,108,102,108, 97,103, 0,100,121,110, 95,111,112,101,114, 97,116,105,111,110, 0,102,111,114, 99,101,
-108,111, 99, 91, 51, 93, 0,102,111,114, 99,101,114,111,116, 91, 51, 93, 0,112, 97,100, 49, 91, 51, 93, 0,108,105,110,101, 97,
-114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, 97,110,103,117,108, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0,
- 42,114,101,102,101,114,101,110, 99,101, 0,109,105,110, 0,109, 97,120, 0,114,111,116,100, 97,109,112, 0,109,105,110,108,111,
- 99, 91, 51, 93, 0,109, 97,120,108,111, 99, 91, 51, 93, 0,109,105,110,114,111,116, 91, 51, 93, 0,109, 97,120,114,111,116, 91,
- 51, 93, 0,109, 97,116,112,114,111,112, 91, 54, 52, 93, 0, 98,117,116,115,116, 97, 0, 98,117,116,101,110,100, 0,100,105,115,
-116,114,105, 98,117,116,105,111,110, 0,105,110,116, 95, 97,114,103, 95, 49, 0,105,110,116, 95, 97,114,103, 95, 50, 0,102,108,
-111, 97,116, 95, 97,114,103, 95, 49, 0,102,108,111, 97,116, 95, 97,114,103, 95, 50, 0,116,111, 80,114,111,112, 78, 97,109,101,
- 91, 54, 52, 93, 0, 42,116,111, 79, 98,106,101, 99,116, 0, 98,111,100,121, 84,121,112,101, 0,102,105,108,101,110, 97,109,101,
- 91, 54, 52, 93, 0,108,111, 97,100, 97,110,105,110, 97,109,101, 91, 54, 52, 93, 0,105,110,116, 95, 97,114,103, 0,102,108,111,
- 97,116, 95, 97,114,103, 0, 42,115,117, 98,116, 97,114,103,101,116, 0,102, 97, 99,105,110,103, 97,120,105,115, 0,118,101,108,
-111, 99,105,116,121, 0, 97, 99, 99,101,108,101,114, 97,116,105,111,110, 0,116,117,114,110,115,112,101,101,100, 0,117,112,100,
- 97,116,101, 84,105,109,101, 0, 42,110, 97,118,109,101,115,104, 0,103,111, 0, 42,110,101,119,112, 97, 99,107,101,100,102,105,
-108,101, 0, 97,116,116,101,110,117, 97,116,105,111,110, 0,100,105,115,116, 97,110, 99,101, 0, 42, 99, 97, 99,104,101, 0, 42,
-119, 97,118,101,102,111,114,109, 0, 42,112,108, 97,121, 98, 97, 99,107, 95,104, 97,110,100,108,101, 0, 42,108, 97,109,112,114,
-101,110, 0,103,111, 98,106,101, 99,116, 0,100,117,112,108,105, 95,111,102,115, 91, 51, 93, 0, 42,112,114,111,112, 0, 99,104,
-105,108,100, 98, 97,115,101, 0,114,111,108,108, 0,104,101, 97,100, 91, 51, 93, 0,116, 97,105,108, 91, 51, 93, 0, 98,111,110,
-101, 95,109, 97,116, 91, 51, 93, 91, 51, 93, 0, 97,114,109, 95,104,101, 97,100, 91, 51, 93, 0, 97,114,109, 95,116, 97,105,108,
- 91, 51, 93, 0, 97,114,109, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 97,114,109, 95,114,111,108,108, 0,120,119,105,100,116,
-104, 0,122,119,105,100,116,104, 0,101, 97,115,101, 49, 0,101, 97,115,101, 50, 0,114, 97,100, 95,104,101, 97,100, 0,114, 97,
-100, 95,116, 97,105,108, 0,112, 97,100, 91, 49, 93, 0, 98,111,110,101, 98, 97,115,101, 0, 99,104, 97,105,110, 98, 97,115,101,
- 0, 42,101,100, 98,111, 0, 42, 97, 99,116, 95, 98,111,110,101, 0, 42, 97, 99,116, 95,101,100, 98,111,110,101, 0, 42,115,107,
-101,116, 99,104, 0,103,101,118,101,114,116,100,101,102,111,114,109,101,114, 0,108, 97,121,101,114, 95,117,115,101,100, 0,108,
- 97,121,101,114, 95,112,114,111,116,101, 99,116,101,100, 0,103,104,111,115,116,101,112, 0,103,104,111,115,116,115,105,122,101,
- 0,103,104,111,115,116,116,121,112,101, 0,112, 97,116,104,115,105,122,101, 0,103,104,111,115,116,115,102, 0,103,104,111,115,
-116,101,102, 0,112, 97,116,104,115,102, 0,112, 97,116,104,101,102, 0,112, 97,116,104, 98, 99, 0,112, 97,116,104, 97, 99, 0,
- 42,112,111,105,110,116,115, 0,115,116, 97,114,116, 95,102,114, 97,109,101, 0,101,110,100, 95,102,114, 97,109,101, 0,103,104,
-111,115,116, 95,115,102, 0,103,104,111,115,116, 95,101,102, 0,103,104,111,115,116, 95, 98, 99, 0,103,104,111,115,116, 95, 97,
- 99, 0,103,104,111,115,116, 95,116,121,112,101, 0,103,104,111,115,116, 95,115,116,101,112, 0,103,104,111,115,116, 95,102,108,
- 97,103, 0,112, 97,116,104, 95,116,121,112,101, 0,112, 97,116,104, 95,115,116,101,112, 0,112, 97,116,104, 95,118,105,101,119,
-102,108, 97,103, 0,112, 97,116,104, 95, 98, 97,107,101,102,108, 97,103, 0,112, 97,116,104, 95,115,102, 0,112, 97,116,104, 95,
-101,102, 0,112, 97,116,104, 95, 98, 99, 0,112, 97,116,104, 95, 97, 99, 0,105,107,102,108, 97,103, 0, 97,103,114,112, 95,105,
-110,100,101,120, 0, 99,111,110,115,116,102,108, 97,103, 0,115,101,108,101, 99,116,102,108, 97,103, 0,112, 97,100, 48, 91, 54,
- 93, 0, 42, 98,111,110,101, 0, 42, 99,104,105,108,100, 0,105,107,116,114,101,101, 0,115,105,107,116,114,101,101, 0, 42, 99,
-117,115,116,111,109, 0, 42, 99,117,115,116,111,109, 95,116,120, 0,101,117,108, 91, 51, 93, 0, 99,104, 97,110, 95,109, 97,116,
- 91, 52, 93, 91, 52, 93, 0,112,111,115,101, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,111,115,101, 95,104,101, 97,100, 91,
- 51, 93, 0,112,111,115,101, 95,116, 97,105,108, 91, 51, 93, 0,108,105,109,105,116,109,105,110, 91, 51, 93, 0,108,105,109,105,
-116,109, 97,120, 91, 51, 93, 0,115,116,105,102,102,110,101,115,115, 91, 51, 93, 0,105,107,115,116,114,101,116, 99,104, 0,105,
-107,114,111,116,119,101,105,103,104,116, 0,105,107,108,105,110,119,101,105,103,104,116, 0, 42,116,101,109,112, 0, 99,104, 97,
-110, 98, 97,115,101, 0, 42, 99,104, 97,110,104, 97,115,104, 0,112,114,111,120,121, 95,108, 97,121,101,114, 0,115,116,114,105,
-100,101, 95,111,102,102,115,101,116, 91, 51, 93, 0, 99,121, 99,108,105, 99, 95,111,102,102,115,101,116, 91, 51, 93, 0, 97,103,
-114,111,117,112,115, 0, 97, 99,116,105,118,101, 95,103,114,111,117,112, 0,105,107,115,111,108,118,101,114, 0, 42,105,107,100,
- 97,116, 97, 0, 42,105,107,112, 97,114, 97,109, 0,112,114,111,120,121, 95, 97, 99,116, 95, 98,111,110,101, 91, 54, 52, 93, 0,
-110,117,109,105,116,101,114, 0,110,117,109,115,116,101,112, 0,109,105,110,115,116,101,112, 0,109, 97,120,115,116,101,112, 0,
-115,111,108,118,101,114, 0,102,101,101,100, 98, 97, 99,107, 0,109, 97,120,118,101,108, 0,100, 97,109,112,109, 97,120, 0,100,
- 97,109,112,101,112,115, 0, 99,104, 97,110,110,101,108,115, 0, 99,117,115,116,111,109, 67,111,108, 0, 99,115, 0, 99,117,114,
-118,101,115, 0,103,114,111,117,112,115, 0, 97, 99,116,105,118,101, 95,109, 97,114,107,101,114, 0,105,100,114,111,111,116, 0,
- 42,115,111,117,114, 99,101, 0, 42,102,105,108,116,101,114, 95,103,114,112, 0,115,101, 97,114, 99,104,115,116,114, 91, 54, 52,
- 93, 0,102,105,108,116,101,114,102,108, 97,103, 0,114,101,110, 97,109,101, 73,110,100,101,120, 0, 97,100,115, 0,116,105,109,
-101,115,108,105,100,101, 0, 42,103,114,112, 0,110, 97,109,101, 91, 51, 48, 93, 0,111,119,110,115,112, 97, 99,101, 0,116, 97,
-114,115,112, 97, 99,101, 0,101,110,102,111,114, 99,101, 0,104,101, 97,100,116, 97,105,108, 0,108,105,110, 95,101,114,114,111,
-114, 0,114,111,116, 95,101,114,114,111,114, 0, 42,116, 97,114, 0,109, 97,116,114,105,120, 91, 52, 93, 91, 52, 93, 0,115,112,
- 97, 99,101, 0,114,111,116, 79,114,100,101,114, 0,116, 97,114,110,117,109, 0,116, 97,114,103,101,116,115, 0,105,116,101,114,
- 97,116,105,111,110,115, 0,114,111,111,116, 98,111,110,101, 0,109, 97,120, 95,114,111,111,116, 98,111,110,101, 0, 42,112,111,
-108,101,116, 97,114, 0,112,111,108,101,115,117, 98,116, 97,114,103,101,116, 91, 54, 52, 93, 0,112,111,108,101, 97,110,103,108,
-101, 0,111,114,105,101,110,116,119,101,105,103,104,116, 0,103,114, 97, 98,116, 97,114,103,101,116, 91, 51, 93, 0,110,117,109,
-112,111,105,110,116,115, 0, 99,104, 97,105,110,108,101,110, 0,120,122, 83, 99, 97,108,101, 77,111,100,101, 0,114,101,115,101,
-114,118,101,100, 49, 0,114,101,115,101,114,118,101,100, 50, 0,109,105,110,109, 97,120,102,108, 97,103, 0,115,116,117, 99,107,
- 0, 99, 97, 99,104,101, 91, 51, 93, 0,108,111, 99,107,102,108, 97,103, 0,102,111,108,108,111,119,102,108, 97,103, 0,118,111,
-108,109,111,100,101, 0,112,108, 97,110,101, 0,111,114,103,108,101,110,103,116,104, 0, 98,117,108,103,101, 0,112,105,118, 88,
- 0,112,105,118, 89, 0,112,105,118, 90, 0, 97,120, 88, 0, 97,120, 89, 0, 97,120, 90, 0,109,105,110, 76,105,109,105,116, 91,
- 54, 93, 0,109, 97,120, 76,105,109,105,116, 91, 54, 93, 0,101,120,116,114, 97, 70,122, 0,105,110,118,109, 97,116, 91, 52, 93,
- 91, 52, 93, 0,102,114,111,109, 0,116,111, 0,109, 97,112, 91, 51, 93, 0,101,120,112,111, 0,102,114,111,109, 95,109,105,110,
- 91, 51, 93, 0,102,114,111,109, 95,109, 97,120, 91, 51, 93, 0,116,111, 95,109,105,110, 91, 51, 93, 0,116,111, 95,109, 97,120,
- 91, 51, 93, 0,114,111,116, 65,120,105,115, 0,122,109,105,110, 0,122,109, 97,120, 0,112, 97,100, 91, 57, 93, 0,116,114, 97,
- 99,107, 91, 54, 52, 93, 0,111, 98,106,101, 99,116, 91, 54, 52, 93, 0, 42,100,101,112,116,104, 95,111, 98, 0, 99,104, 97,110,
-110,101,108, 91, 51, 50, 93, 0,110,111, 95,114,111,116, 95, 97,120,105,115, 0,115,116,114,105,100,101, 95, 97,120,105,115, 0,
- 99,117,114,109,111,100, 0, 97, 99,116,115,116, 97,114,116, 0, 97, 99,116,101,110,100, 0, 97, 99,116,111,102,102,115, 0,115,
-116,114,105,100,101,108,101,110, 0, 98,108,101,110,100,111,117,116, 0,115,116,114,105,100,101, 99,104, 97,110,110,101,108, 91,
- 51, 50, 93, 0,111,102,102,115, 95, 98,111,110,101, 91, 51, 50, 93, 0,104, 97,115,105,110,112,117,116, 0,104, 97,115,111,117,
-116,112,117,116, 0,100, 97,116, 97,116,121,112,101, 0,115,111, 99,107,101,116,116,121,112,101, 0,105,115, 95, 99,111,112,121,
- 0,101,120,116,101,114,110, 97,108, 0, 42,110,101,119, 95,115,111, 99,107, 0, 42,115,116,111,114, 97,103,101, 0,108,105,109,
-105,116, 0,115,116,114,117, 99,116, 95,116,121,112,101, 0,108,111, 99,120, 0,108,111, 99,121, 0, 42,100,101,102, 97,117,108,
-116, 95,118, 97,108,117,101, 0,115,116, 97, 99,107, 95,105,110,100,101,120, 0,115,116, 97, 99,107, 95,116,121,112,101, 0,111,
-119,110, 95,105,110,100,101,120, 0,116,111, 95,105,110,100,101,120, 0, 42,103,114,111,117,112,115,111, 99,107, 0, 42,108,105,
-110,107, 0,110,115, 0, 42,114,101, 99,116, 0,120,115,105,122,101, 0,121,115,105,122,101, 0, 42,110,101,119, 95,110,111,100,
-101, 0,108, 97,115,116,121, 0,111,117,116,112,117,116,115, 0,109,105,110,105,119,105,100,116,104, 0,117,112,100, 97,116,101,
- 0,108, 97, 98,101,108, 91, 54, 52, 93, 0, 99,117,115,116,111,109, 49, 0, 99,117,115,116,111,109, 50, 0, 99,117,115,116,111,
-109, 51, 0, 99,117,115,116,111,109, 52, 0,110,101,101,100, 95,101,120,101, 99, 0,101,120,101, 99, 0, 42,116,104,114,101, 97,
-100,100, 97,116, 97, 0,116,111,116,114, 0, 98,117,116,114, 0,112,114,118,114, 0, 42, 98,108,111, 99,107, 0, 42,116,121,112,
-101,105,110,102,111, 0, 42,102,114,111,109,110,111,100,101, 0, 42,116,111,110,111,100,101, 0, 42,102,114,111,109,115,111, 99,
-107, 0, 42,116,111,115,111, 99,107, 0,110,111,100,101,115, 0,108,105,110,107,115, 0,105,110,105,116, 0, 99,117,114, 95,105,
-110,100,101,120, 0,110,111,100,101,116,121,112,101, 0, 42,101,120,101, 99,100, 97,116, 97, 0, 40, 42,112,114,111,103,114,101,
-115,115, 41, 40, 41, 0, 40, 42,115,116, 97,116,115, 95,100,114, 97,119, 41, 40, 41, 0, 40, 42,116,101,115,116, 95, 98,114,101,
- 97,107, 41, 40, 41, 0, 42,116, 98,104, 0, 42,112,114,104, 0, 42,115,100,104, 0,118, 97,108,117,101, 91, 51, 93, 0,118, 97,
-108,117,101, 91, 52, 93, 0, 99,121, 99,108,105, 99, 0,109,111,118,105,101, 0,115, 97,109,112,108,101,115, 0,109, 97,120,115,
-112,101,101,100, 0,109,105,110,115,112,101,101,100, 0, 99,117,114,118,101,100, 0,112,101,114, 99,101,110,116,120, 0,112,101,
-114, 99,101,110,116,121, 0, 98,111,107,101,104, 0,103, 97,109,109, 97, 0,105,109, 97,103,101, 95,105,110, 95,119,105,100,116,
-104, 0,105,109, 97,103,101, 95,105,110, 95,104,101,105,103,104,116, 0, 99,101,110,116,101,114, 95,120, 0, 99,101,110,116,101,
-114, 95,121, 0,115,112,105,110, 0,119,114, 97,112, 0,115,105,103,109, 97, 95, 99,111,108,111,114, 0,115,105,103,109, 97, 95,
-115,112, 97, 99,101, 0,104,117,101, 0, 98, 97,115,101, 95,112, 97,116,104, 91, 49, 48, 50, 52, 93, 0, 97, 99,116,105,118,101,
- 95,105,110,112,117,116, 0,117,115,101, 95,114,101,110,100,101,114, 95,102,111,114,109, 97,116, 0,102,111,114,109, 97,116, 0,
-116, 49, 0,116, 50, 0,116, 51, 0,102,115,116,114,101,110,103,116,104, 0,102, 97,108,112,104, 97, 0,107,101,121, 91, 52, 93,
- 0, 97,108,103,111,114,105,116,104,109, 0, 99,104, 97,110,110,101,108, 0,120, 49, 0,120, 50, 0,121, 49, 0,121, 50, 0,102,
- 97, 99, 95,120, 49, 0,102, 97, 99, 95,120, 50, 0,102, 97, 99, 95,121, 49, 0,102, 97, 99, 95,121, 50, 0, 99,111,108,110, 97,
-109,101, 91, 54, 52, 93, 0, 98,107,116,121,112,101, 0,112, 97,100, 95, 99, 49, 0,103, 97,109, 99,111, 0,110,111, 95,122, 98,
-117,102, 0,102,115,116,111,112, 0,109, 97,120, 98,108,117,114, 0, 98,116,104,114,101,115,104, 0,114,111,116, 97,116,105,111,
-110, 0,112, 97,100, 95,102, 49, 0, 42,100,105, 99,116, 0, 42,110,111,100,101, 0, 99,111,108,109,111,100, 0,109,105,120, 0,
-102, 97,100,101, 0, 97,110,103,108,101, 95,111,102,115, 0,109, 0, 99, 0,106,105,116, 0,112,114,111,106, 0,102,105,116, 0,
-115,108,111,112,101, 91, 51, 93, 0,112,111,119,101,114, 91, 51, 93, 0,108,105,102,116, 95,108,103,103, 91, 51, 93, 0,103, 97,
-109,109, 97, 95,105,110,118, 91, 51, 93, 0,108,105,109, 99,104, 97,110, 0,117,110,115,112,105,108,108, 0,108,105,109,115, 99,
- 97,108,101, 0,117,115,112,105,108,108,114, 0,117,115,112,105,108,108,103, 0,117,115,112,105,108,108, 98, 0,116,101,120, 95,
-109, 97,112,112,105,110,103, 0, 99,111,108,111,114, 95,109, 97,112,112,105,110,103, 0,115,117,110, 95,100,105,114,101, 99,116,
-105,111,110, 91, 51, 93, 0,116,117,114, 98,105,100,105,116,121, 0, 99,111,108,111,114, 95,115,112, 97, 99,101, 0,103,114, 97,
-100,105,101,110,116, 95,116,121,112,101, 0, 99,111,108,111,114,105,110,103, 0,109,117,115,103,114, 97,118,101, 95,116,121,112,
-101, 0,119, 97,118,101, 95,116,121,112,101, 0,115,104,111,114,116,121, 0,109,105,110,116, 97, 98,108,101, 0,109, 97,120,116,
- 97, 98,108,101, 0,101,120,116, 95,105,110, 91, 50, 93, 0,101,120,116, 95,111,117,116, 91, 50, 93, 0, 42, 99,117,114,118,101,
- 0, 42,116, 97, 98,108,101, 0, 42,112,114,101,109,117,108,116, 97, 98,108,101, 0,112,114,101,115,101,116, 0, 99,104, 97,110,
-103,101,100, 95,116,105,109,101,115,116, 97,109,112, 0, 99,117,114,114, 0, 99,108,105,112,114, 0, 99,109, 91, 52, 93, 0, 98,
-108, 97, 99,107, 91, 51, 93, 0,119,104,105,116,101, 91, 51, 93, 0, 98,119,109,117,108, 91, 51, 93, 0,115, 97,109,112,108,101,
- 91, 51, 93, 0,120, 95,114,101,115,111,108,117,116,105,111,110, 0,100, 97,116, 97, 95,114, 91, 50, 53, 54, 93, 0,100, 97,116,
- 97, 95,103, 91, 50, 53, 54, 93, 0,100, 97,116, 97, 95, 98, 91, 50, 53, 54, 93, 0,100, 97,116, 97, 95,108,117,109, 97, 91, 50,
- 53, 54, 93, 0,115, 97,109,112,108,101, 95,102,117,108,108, 0,115, 97,109,112,108,101, 95,108,105,110,101,115, 0, 97, 99, 99,
-117,114, 97, 99,121, 0,119, 97,118,101,102,114,109, 95,109,111,100,101, 0,119, 97,118,101,102,114,109, 95, 97,108,112,104, 97,
- 0,119, 97,118,101,102,114,109, 95,121,102, 97, 99, 0,119, 97,118,101,102,114,109, 95,104,101,105,103,104,116, 0,118,101, 99,
-115, 99,111,112,101, 95, 97,108,112,104, 97, 0,118,101, 99,115, 99,111,112,101, 95,104,101,105,103,104,116, 0,109,105,110,109,
- 97,120, 91, 51, 93, 91, 50, 93, 0,104,105,115,116, 0, 42,119, 97,118,101,102,111,114,109, 95, 49, 0, 42,119, 97,118,101,102,
-111,114,109, 95, 50, 0, 42,119, 97,118,101,102,111,114,109, 95, 51, 0, 42,118,101, 99,115, 99,111,112,101, 0,119, 97,118,101,
-102,111,114,109, 95,116,111,116, 0,111,102,102,115,101,116, 91, 50, 93, 0, 99,108,111,110,101, 0,109,116,101,120, 0, 42,105,
- 99,111,110, 95,105,109, 98,117,102, 0,105, 99,111,110, 95,102,105,108,101,112, 97,116,104, 91, 49, 48, 50, 52, 93, 0,110,111,
-114,109, 97,108, 95,119,101,105,103,104,116, 0,111, 98, 95,109,111,100,101, 0,106,105,116,116,101,114, 0,115,109,111,111,116,
-104, 95,115,116,114,111,107,101, 95,114, 97,100,105,117,115, 0,115,109,111,111,116,104, 95,115,116,114,111,107,101, 95,102, 97,
- 99,116,111,114, 0,114, 97,116,101, 0,114,103, 98, 91, 51, 93, 0,115, 99,117,108,112,116, 95,112,108, 97,110,101, 0,112,108,
- 97,110,101, 95,111,102,102,115,101,116, 0,115, 99,117,108,112,116, 95,116,111,111,108, 0,118,101,114,116,101,120,112, 97,105,
-110,116, 95,116,111,111,108, 0,105,109, 97,103,101,112, 97,105,110,116, 95,116,111,111,108, 0,112, 97,100, 51, 91, 53, 93, 0,
- 97,117,116,111,115,109,111,111,116,104, 95,102, 97, 99,116,111,114, 0, 99,114,101, 97,115,101, 95,112,105,110, 99,104, 95,102,
- 97, 99,116,111,114, 0,112,108, 97,110,101, 95,116,114,105,109, 0,116,101,120,116,117,114,101, 95,115, 97,109,112,108,101, 95,
- 98,105, 97,115, 0,116,101,120,116,117,114,101, 95,111,118,101,114,108, 97,121, 95, 97,108,112,104, 97, 0, 97,100,100, 95, 99,
-111,108, 91, 51, 93, 0,115,117, 98, 95, 99,111,108, 91, 51, 93, 0, 97, 99,116,105,118,101, 95,114,110,100, 0, 97, 99,116,105,
-118,101, 95, 99,108,111,110,101, 0, 97, 99,116,105,118,101, 95,109, 97,115,107, 0, 42,108, 97,121,101,114,115, 0,116,121,112,
-101,109, 97,112, 91, 51, 52, 93, 0,116,111,116,108, 97,121,101,114, 0,109, 97,120,108, 97,121,101,114, 0,116,111,116,115,105,
-122,101, 0, 42,112,111,111,108, 0, 42,101,120,116,101,114,110, 97,108, 0,114,111,116, 91, 52, 93, 0, 97,118,101, 91, 51, 93,
- 0, 42,103,114,111,117,110,100, 0,119, 97,110,100,101,114, 91, 51, 93, 0,114,101,115,116, 95,108,101,110,103,116,104, 0,112,
- 97,114,116,105, 99,108,101, 95,105,110,100,101,120, 91, 50, 93, 0,100,101,108,101,116,101, 95,102,108, 97,103, 0,110,117,109,
- 0,112, 97,114,101,110,116, 0,112, 97, 91, 52, 93, 0,119, 91, 52, 93, 0,102,117,118, 91, 52, 93, 0,102,111,102,102,115,101,
-116, 0,112,114,101,118, 95,115,116, 97,116,101, 0, 42,104, 97,105,114, 0, 42, 98,111,105,100, 0,100,105,101,116,105,109,101,
- 0,110,117,109, 95,100,109, 99, 97, 99,104,101, 0,104, 97,105,114, 95,105,110,100,101,120, 0, 97,108,105,118,101, 0,115,112,
-114,105,110,103, 95,107, 0,112,108, 97,115,116,105, 99,105,116,121, 95, 99,111,110,115,116, 97,110,116, 0,121,105,101,108,100,
- 95,114, 97,116,105,111, 0,112,108, 97,115,116,105, 99,105,116,121, 95, 98, 97,108, 97,110, 99,101, 0,121,105,101,108,100, 95,
- 98, 97,108, 97,110, 99,101, 0,118,105,115, 99,111,115,105,116,121, 95,111,109,101,103, 97, 0,118,105,115, 99,111,115,105,116,
-121, 95, 98,101,116, 97, 0,115,116,105,102,102,110,101,115,115, 95,107, 0,115,116,105,102,102,110,101,115,115, 95,107,110,101,
- 97,114, 0,114,101,115,116, 95,100,101,110,115,105,116,121, 0, 98,117,111,121, 97,110, 99,121, 0,115,112,114,105,110,103, 95,
-102,114, 97,109,101,115, 0, 42, 98,111,105,100,115, 0, 42,102,108,117,105,100, 0,100,105,115,116,114, 0,112,104,121,115,116,
-121,112,101, 0, 97,118,101,109,111,100,101, 0,114,101, 97, 99,116,101,118,101,110,116, 0,100,114, 97,119, 0,100,114, 97,119,
- 95, 97,115, 0,100,114, 97,119, 95,115,105,122,101, 0, 99,104,105,108,100,116,121,112,101, 0,114,101,110, 95, 97,115, 0,115,
-117, 98,102,114, 97,109,101,115, 0,100,114, 97,119, 95, 99,111,108, 0,114,101,110, 95,115,116,101,112, 0,104, 97,105,114, 95,
-115,116,101,112, 0,107,101,121,115, 95,115,116,101,112, 0, 97,100, 97,112,116, 95, 97,110,103,108,101, 0, 97,100, 97,112,116,
- 95,112,105,120, 0,114,111,116,102,114,111,109, 0,105,110,116,101,103,114, 97,116,111,114, 0, 98, 98, 95, 97,108,105,103,110,
- 0, 98, 98, 95,117,118, 95,115,112,108,105,116, 0, 98, 98, 95, 97,110,105,109, 0, 98, 98, 95,115,112,108,105,116, 95,111,102,
-102,115,101,116, 0, 98, 98, 95,116,105,108,116, 0, 98, 98, 95,114, 97,110,100, 95,116,105,108,116, 0, 98, 98, 95,111,102,102,
-115,101,116, 91, 50, 93, 0, 98, 98, 95,115,105,122,101, 91, 50, 93, 0, 98, 98, 95,118,101,108, 95,104,101, 97,100, 0, 98, 98,
- 95,118,101,108, 95,116, 97,105,108, 0, 99,111,108,111,114, 95,118,101, 99, 95,109, 97,120, 0,115,105,109,112,108,105,102,121,
- 95,114,101,102,115,105,122,101, 0,115,105,109,112,108,105,102,121, 95,114, 97,116,101, 0,115,105,109,112,108,105,102,121, 95,
-116,114, 97,110,115,105,116,105,111,110, 0,115,105,109,112,108,105,102,121, 95,118,105,101,119,112,111,114,116, 0,116,105,109,
-101,116,119,101, 97,107, 0, 99,111,117,114, 97,110,116, 95,116, 97,114,103,101,116, 0,106,105,116,102, 97, 99, 0,101,102,102,
- 95,104, 97,105,114, 0,103,114,105,100, 95,114, 97,110,100, 0,112,115, 95,111,102,102,115,101,116, 91, 49, 93, 0,103,114,105,
-100, 95,114,101,115, 0,101,102,102,101, 99,116,111,114, 95, 97,109,111,117,110,116, 0,116,105,109,101, 95,102,108, 97,103, 0,
-116,105,109,101, 95,112, 97,100, 91, 51, 93, 0,112, 97,114,116,102, 97, 99, 0,116, 97,110,102, 97, 99, 0,116, 97,110,112,104,
- 97,115,101, 0,114,101, 97, 99,116,102, 97, 99, 0,111, 98, 95,118,101,108, 91, 51, 93, 0, 97,118,101,102, 97, 99, 0,112,104,
- 97,115,101,102, 97, 99, 0,114, 97,110,100,114,111,116,102, 97, 99, 0,114, 97,110,100,112,104, 97,115,101,102, 97, 99, 0,114,
- 97,110,100,115,105,122,101, 0, 97, 99, 99, 91, 51, 93, 0,100,114, 97,103,102, 97, 99, 0, 98,114,111,119,110,102, 97, 99, 0,
-114, 97,110,100,108,101,110,103,116,104, 0, 99,104,105,108,100, 95,110, 98,114, 0,114,101,110, 95, 99,104,105,108,100, 95,110,
- 98,114, 0,112, 97,114,101,110,116,115, 0, 99,104,105,108,100,115,105,122,101, 0, 99,104,105,108,100,114, 97,110,100,115,105,
-122,101, 0, 99,104,105,108,100,114, 97,100, 0, 99,104,105,108,100,102,108, 97,116, 0, 99,108,117,109,112,112,111,119, 0,107,
-105,110,107, 95,102,108, 97,116, 0,107,105,110,107, 95, 97,109,112, 95, 99,108,117,109,112, 0,114,111,117,103,104, 49, 0,114,
-111,117,103,104, 49, 95,115,105,122,101, 0,114,111,117,103,104, 50, 0,114,111,117,103,104, 50, 95,115,105,122,101, 0,114,111,
-117,103,104, 50, 95,116,104,114,101,115, 0,114,111,117,103,104, 95,101,110,100, 0,114,111,117,103,104, 95,101,110,100, 95,115,
-104, 97,112,101, 0, 99,108,101,110,103,116,104, 0, 99,108,101,110,103,116,104, 95,116,104,114,101,115, 0,112, 97,114,116,105,
-110,103, 95,102, 97, 99, 0,112, 97,114,116,105,110,103, 95,109,105,110, 0,112, 97,114,116,105,110,103, 95,109, 97,120, 0, 98,
-114, 97,110, 99,104, 95,116,104,114,101,115, 0,100,114, 97,119, 95,108,105,110,101, 91, 50, 93, 0,112, 97,116,104, 95,115,116,
- 97,114,116, 0,112, 97,116,104, 95,101,110,100, 0,116,114, 97,105,108, 95, 99,111,117,110,116, 0,107,101,121,101,100, 95,108,
-111,111,112,115, 0,100,117,112,108,105,119,101,105,103,104,116,115, 0, 42,101,102,102, 95,103,114,111,117,112, 0, 42,100,117,
-112, 95,111, 98, 0, 42, 98, 98, 95,111, 98, 0, 42,112,100, 50, 0, 42,112, 97,114,116, 0, 42,112, 97,114,116,105, 99,108,101,
-115, 0, 42, 42,112, 97,116,104, 99, 97, 99,104,101, 0, 42, 42, 99,104,105,108,100, 99, 97, 99,104,101, 0,112, 97,116,104, 99,
- 97, 99,104,101, 98,117,102,115, 0, 99,104,105,108,100, 99, 97, 99,104,101, 98,117,102,115, 0, 42, 99,108,109,100, 0, 42,104,
- 97,105,114, 95,105,110, 95,100,109, 0, 42,104, 97,105,114, 95,111,117,116, 95,100,109, 0, 42,116, 97,114,103,101,116, 95,111,
- 98, 0, 42,108, 97,116,116,105, 99,101, 0,116,114,101,101, 95,102,114, 97,109,101, 0, 98,118,104,116,114,101,101, 95,102,114,
- 97,109,101, 0, 99,104,105,108,100, 95,115,101,101,100, 0,116,111,116,117,110,101,120,105,115,116, 0,116,111,116, 99,104,105,
-108,100, 0,116,111,116, 99, 97, 99,104,101,100, 0,116,111,116, 99,104,105,108,100, 99, 97, 99,104,101, 0,116, 97,114,103,101,
-116, 95,112,115,121,115, 0,116,111,116,107,101,121,101,100, 0, 98, 97,107,101,115,112, 97, 99,101, 0, 98, 98, 95,117,118,110,
- 97,109,101, 91, 51, 93, 91, 54, 52, 93, 0,118,103,114,111,117,112, 91, 49, 50, 93, 0,118,103, 95,110,101,103, 0,114,116, 51,
- 0, 42,114,101,110,100,101,114,100, 97,116, 97, 0, 42,101,102,102,101, 99,116,111,114,115, 0, 42,102,108,117,105,100, 95,115,
-112,114,105,110,103,115, 0,116,111,116, 95,102,108,117,105,100,115,112,114,105,110,103,115, 0, 97,108,108,111, 99, 95,102,108,
-117,105,100,115,112,114,105,110,103,115, 0, 42,116,114,101,101, 0, 42,112,100,100, 0, 42,102,114, 97,110,100, 0,100,116, 95,
-102,114, 97, 99, 0, 95,112, 97,100, 0, 67,100,105,115, 0, 67,118,105, 0,115,116,114,117, 99,116,117,114, 97,108, 0, 98,101,
-110,100,105,110,103, 0,109, 97,120, 95, 98,101,110,100, 0,109, 97,120, 95,115,116,114,117, 99,116, 0,109, 97,120, 95,115,104,
-101, 97,114, 0, 97,118,103, 95,115,112,114,105,110,103, 95,108,101,110, 0,116,105,109,101,115, 99, 97,108,101, 0,101,102,102,
- 95,102,111,114, 99,101, 95,115, 99, 97,108,101, 0,101,102,102, 95,119,105,110,100, 95,115, 99, 97,108,101, 0,115,105,109, 95,
-116,105,109,101, 95,111,108,100, 0,118,101,108,111, 99,105,116,121, 95,115,109,111,111,116,104, 0, 99,111,108,108,105,100,101,
-114, 95,102,114,105, 99,116,105,111,110, 0,118,101,108, 95,100, 97,109,112,105,110,103, 0,115,116,101,112,115, 80,101,114, 70,
-114, 97,109,101, 0,112,114,101,114,111,108,108, 0,109, 97,120,115,112,114,105,110,103,108,101,110, 0,115,111,108,118,101,114,
- 95,116,121,112,101, 0,118,103,114,111,117,112, 95, 98,101,110,100, 0,118,103,114,111,117,112, 95,109, 97,115,115, 0,118,103,
-114,111,117,112, 95,115,116,114,117, 99,116, 0,115,104, 97,112,101,107,101,121, 95,114,101,115,116, 0,112,114,101,115,101,116,
-115, 0,114,101,115,101,116, 0, 42, 99,111,108,108,105,115,105,111,110, 95,108,105,115,116, 0,101,112,115,105,108,111,110, 0,
-115,101,108,102, 95,102,114,105, 99,116,105,111,110, 0,115,101,108,102,101,112,115,105,108,111,110, 0,114,101,112,101,108, 95,
-102,111,114, 99,101, 0,100,105,115,116, 97,110, 99,101, 95,114,101,112,101,108, 0,115,101,108,102, 95,108,111,111,112, 95, 99,
-111,117,110,116, 0,108,111,111,112, 95, 99,111,117,110,116, 0,112,114,101,115,115,117,114,101, 0,116,104,105, 99,107,110,101,
-115,115, 0,115,116,114,111,107,101,115, 0,102,114, 97,109,101,110,117,109, 0, 42, 97, 99,116,102,114, 97,109,101, 0,103,115,
-116,101,112, 0,105,110,102,111, 91, 49, 50, 56, 93, 0,115, 98,117,102,102,101,114, 95,115,105,122,101, 0,115, 98,117,102,102,
-101,114, 95,115,102,108, 97,103, 0, 42,115, 98,117,102,102,101,114, 0,108,105,115,116, 0,112,114,105,110,116,108,101,118,101,
-108, 0,115,116,111,114,101,108,101,118,101,108, 0, 42,114,101,112,111,114,116,116,105,109,101,114, 0, 42,119,105,110,100,114,
- 97,119, 97, 98,108,101, 0, 42,119,105,110, 97, 99,116,105,118,101, 0,119,105,110,100,111,119,115, 0,105,110,105,116,105, 97,
-108,105,122,101,100, 0,102,105,108,101, 95,115, 97,118,101,100, 0,111,112, 95,117,110,100,111, 95,100,101,112,116,104, 0,111,
-112,101,114, 97,116,111,114,115, 0,113,117,101,117,101, 0,114,101,112,111,114,116,115, 0,106,111, 98,115, 0,112, 97,105,110,
-116, 99,117,114,115,111,114,115, 0,100,114, 97,103,115, 0,107,101,121, 99,111,110,102,105,103,115, 0, 42,100,101,102, 97,117,
-108,116, 99,111,110,102, 0, 42, 97,100,100,111,110, 99,111,110,102, 0, 42,117,115,101,114, 99,111,110,102, 0,116,105,109,101,
-114,115, 0, 42, 97,117,116,111,115, 97,118,101,116,105,109,101,114, 0, 42,103,104,111,115,116,119,105,110, 0,103,114, 97, 98,
- 99,117,114,115,111,114, 0, 42,115, 99,114,101,101,110, 0, 42,110,101,119,115, 99,114,101,101,110, 0,115, 99,114,101,101,110,
-110, 97,109,101, 91, 54, 52, 93, 0,112,111,115,120, 0,112,111,115,121, 0,119,105,110,100,111,119,115,116, 97,116,101, 0,109,
-111,110,105,116,111,114, 0,108, 97,115,116, 99,117,114,115,111,114, 0,109,111,100, 97,108, 99,117,114,115,111,114, 0, 97,100,
-100,109,111,117,115,101,109,111,118,101, 0, 42,101,118,101,110,116,115,116, 97,116,101, 0, 42, 99,117,114,115,119,105,110, 0,
- 42,116,119,101, 97,107, 0,100,114, 97,119,109,101,116,104,111,100, 0,100,114, 97,119,102, 97,105,108, 0, 42,100,114, 97,119,
-100, 97,116, 97, 0,109,111,100, 97,108,104, 97,110,100,108,101,114,115, 0,115,117, 98,119,105,110,100,111,119,115, 0,103,101,
-115,116,117,114,101, 0,105,100,110, 97,109,101, 91, 54, 52, 93, 0,112,114,111,112,118, 97,108,117,101, 0,115,104,105,102,116,
- 0, 99,116,114,108, 0, 97,108,116, 0,111,115,107,101,121, 0,107,101,121,109,111,100,105,102,105,101,114, 0,109, 97,112,116,
-121,112,101, 0, 42,112,116,114, 0, 42,114,101,109,111,118,101, 95,105,116,101,109, 0, 42, 97,100,100, 95,105,116,101,109, 0,
-105,116,101,109,115, 0,100,105,102,102, 95,105,116,101,109,115, 0,115,112, 97, 99,101,105,100, 0,114,101,103,105,111,110,105,
-100, 0,107,109,105, 95,105,100, 0, 40, 42,112,111,108,108, 41, 40, 41, 0, 42,109,111,100, 97,108, 95,105,116,101,109,115, 0,
- 98, 97,115,101,110, 97,109,101, 91, 54, 52, 93, 0, 97, 99,116,107,101,121,109, 97,112, 0, 42, 99,117,115,116,111,109,100, 97,
-116, 97, 0, 42,112,121, 95,105,110,115,116, 97,110, 99,101, 0, 42,114,101,112,111,114,116,115, 0,109, 97, 99,114,111, 0, 42,
-111,112,109, 0, 42,101,100, 97,116, 97, 0,105,110,102,108,117,101,110, 99,101, 0, 42, 99,111,101,102,102,105, 99,105,101,110,
-116,115, 0, 97,114,114, 97,121,115,105,122,101, 0,112,111,108,121, 95,111,114,100,101,114, 0, 97,109,112,108,105,116,117,100,
-101, 0,112,104, 97,115,101, 95,109,117,108,116,105,112,108,105,101,114, 0,112,104, 97,115,101, 95,111,102,102,115,101,116, 0,
-118, 97,108,117,101, 95,111,102,102,115,101,116, 0,109,105,100,118, 97,108, 0, 98,101,102,111,114,101, 95,109,111,100,101, 0,
- 97,102,116,101,114, 95,109,111,100,101, 0, 98,101,102,111,114,101, 95, 99,121, 99,108,101,115, 0, 97,102,116,101,114, 95, 99,
-121, 99,108,101,115, 0,114,101, 99,116, 0,112,104, 97,115,101, 0,109,111,100,105,102,105, 99, 97,116,105,111,110, 0,115,116,
-101,112, 95,115,105,122,101, 0, 42,114,110, 97, 95,112, 97,116,104, 0,112, 99,104, 97,110, 95,110, 97,109,101, 91, 51, 50, 93,
- 0,116,114, 97,110,115, 67,104, 97,110, 0,105,100,116,121,112,101, 0,116, 97,114,103,101,116,115, 91, 56, 93, 0,110,117,109,
- 95,116, 97,114,103,101,116,115, 0,118, 97,114,105, 97, 98,108,101,115, 0,101,120,112,114,101,115,115,105,111,110, 91, 50, 53,
- 54, 93, 0, 42,101,120,112,114, 95, 99,111,109,112, 0,118,101, 99, 91, 50, 93, 0, 42,102,112,116, 0, 97,114,114, 97,121, 95,
-105,110,100,101,120, 0, 99,111,108,111,114, 95,109,111,100,101, 0, 99,111,108,111,114, 91, 51, 93, 0,102,114,111,109, 91, 49,
- 50, 56, 93, 0,116,111, 91, 49, 50, 56, 93, 0,109, 97,112,112,105,110,103,115, 0,115,116,114,105,112,115, 0, 42,114,101,109,
- 97,112, 0,102, 99,117,114,118,101,115, 0,115,116,114,105,112, 95,116,105,109,101, 0, 98,108,101,110,100,109,111,100,101, 0,
-101,120,116,101,110,100,109,111,100,101, 0, 42,115,112,101, 97,107,101,114, 95,104, 97,110,100,108,101, 0,103,114,111,117,112,
- 91, 54, 52, 93, 0,103,114,111,117,112,109,111,100,101, 0,107,101,121,105,110,103,102,108, 97,103, 0,112, 97,116,104,115, 0,
-116,121,112,101,105,110,102,111, 91, 54, 52, 93, 0, 97, 99,116,105,118,101, 95,112, 97,116,104, 0, 42,116,109,112, 97, 99,116,
- 0,110,108, 97, 95,116,114, 97, 99,107,115, 0, 42, 97, 99,116,115,116,114,105,112, 0,100,114,105,118,101,114,115, 0,111,118,
-101,114,114,105,100,101,115, 0, 97, 99,116, 95, 98,108,101,110,100,109,111,100,101, 0, 97, 99,116, 95,101,120,116,101,110,100,
-109,111,100,101, 0, 97, 99,116, 95,105,110,102,108,117,101,110, 99,101, 0,114,117,108,101, 0,111,112,116,105,111,110,115, 0,
-102,101, 97,114, 95,102, 97, 99,116,111,114, 0,115,105,103,110, 97,108, 95,105,100, 0,108,111,111,107, 95, 97,104,101, 97,100,
- 0,111,108,111, 99, 91, 51, 93, 0,113,117,101,117,101, 95,115,105,122,101, 0,119, 97,110,100,101,114, 0,102,108,101,101, 95,
-100,105,115,116, 97,110, 99,101, 0,104,101, 97,108,116,104, 0,115,116, 97,116,101, 95,105,100, 0,114,117,108,101,115, 0, 99,
-111,110,100,105,116,105,111,110,115, 0, 97, 99,116,105,111,110,115, 0,114,117,108,101,115,101,116, 95,116,121,112,101, 0,114,
-117,108,101, 95,102,117,122,122,105,110,101,115,115, 0,108, 97,115,116, 95,115,116, 97,116,101, 95,105,100, 0,108, 97,110,100,
-105,110,103, 95,115,109,111,111,116,104,110,101,115,115, 0, 98, 97,110,107,105,110,103, 0, 97,103,103,114,101,115,115,105,111,
-110, 0, 97,105,114, 95,109,105,110, 95,115,112,101,101,100, 0, 97,105,114, 95,109, 97,120, 95,115,112,101,101,100, 0, 97,105,
-114, 95,109, 97,120, 95, 97, 99, 99, 0, 97,105,114, 95,109, 97,120, 95, 97,118,101, 0, 97,105,114, 95,112,101,114,115,111,110,
- 97,108, 95,115,112, 97, 99,101, 0,108, 97,110,100, 95,106,117,109,112, 95,115,112,101,101,100, 0,108, 97,110,100, 95,109, 97,
-120, 95,115,112,101,101,100, 0,108, 97,110,100, 95,109, 97,120, 95, 97, 99, 99, 0,108, 97,110,100, 95,109, 97,120, 95, 97,118,
-101, 0,108, 97,110,100, 95,112,101,114,115,111,110, 97,108, 95,115,112, 97, 99,101, 0,108, 97,110,100, 95,115,116,105, 99,107,
- 95,102,111,114, 99,101, 0,115,116, 97,116,101,115, 0, 42,115,109,100, 0, 42,102,108,117,105,100, 95,103,114,111,117,112, 0,
- 42, 99,111,108,108, 95,103,114,111,117,112, 0, 42,119,116, 0, 42,116,101,120, 95,119,116, 0, 42,116,101,120, 95,115,104, 97,
-100,111,119, 0, 42,115,104, 97,100,111,119, 0,112, 48, 91, 51, 93, 0,112, 49, 91, 51, 93, 0,100,120, 0,111,109,101,103, 97,
- 0,116,101,109,112, 65,109, 98, 0, 98,101,116, 97, 0,114,101,115, 91, 51, 93, 0, 97,109,112,108,105,102,121, 0,109, 97,120,
-114,101,115, 0,118,105,101,119,115,101,116,116,105,110,103,115, 0,110,111,105,115,101, 0,100,105,115,115, 95,112,101,114, 99,
-101,110,116, 0,100,105,115,115, 95,115,112,101,101,100, 0,114,101,115, 95,119,116, 91, 51, 93, 0,100,120, 95,119,116, 0,118,
- 51,100,110,117,109, 0, 99, 97, 99,104,101, 95, 99,111,109,112, 0, 99, 97, 99,104,101, 95,104,105,103,104, 95, 99,111,109,112,
- 0, 42,112,111,105,110,116, 95, 99, 97, 99,104,101, 91, 50, 93, 0,112,116, 99, 97, 99,104,101,115, 91, 50, 93, 0, 98,111,114,
-100,101,114, 95, 99,111,108,108,105,115,105,111,110,115, 0,116,105,109,101, 95,115, 99, 97,108,101, 0,118,111,114,116,105, 99,
-105,116,121, 0,118,101,108,111, 99,105,116,121, 91, 50, 93, 0,118,101,108, 95,109,117,108,116,105, 0,118,103,114,112, 95,104,
-101, 97,116, 95,115, 99, 97,108,101, 91, 50, 93, 0,118,103,114,111,117,112, 95,102,108,111,119, 0,118,103,114,111,117,112, 95,
-100,101,110,115,105,116,121, 0,118,103,114,111,117,112, 95,104,101, 97,116, 0, 42,112,111,105,110,116,115, 95,111,108,100, 0,
- 42,118,101,108, 0,109, 97,116, 95,111,108,100, 91, 52, 93, 91, 52, 93, 0,118,111,108,117,109,101, 95,109, 97,120, 0,118,111,
-108,117,109,101, 95,109,105,110, 0,100,105,115,116, 97,110, 99,101, 95,109, 97,120, 0,100,105,115,116, 97,110, 99,101, 95,114,
-101,102,101,114,101,110, 99,101, 0, 99,111,110,101, 95, 97,110,103,108,101, 95,111,117,116,101,114, 0, 99,111,110,101, 95, 97,
-110,103,108,101, 95,105,110,110,101,114, 0, 99,111,110,101, 95,118,111,108,117,109,101, 95,111,117,116,101,114, 0,114,101,110,
-100,101,114, 95,102,108, 97,103, 0, 98,117,105,108,100, 95,115,105,122,101, 95,102,108, 97,103, 0, 98,117,105,108,100, 95,116,
- 99, 95,102,108, 97,103, 0,108, 97,115,116,115,105,122,101, 91, 50, 93, 0,116,114, 97, 99,107,105,110,103, 0, 42,116,114, 97,
- 99,107,105,110,103, 95, 99,111,110,116,101,120,116, 0,112,114,111,120,121, 0,116,114, 97, 99,107, 95,112,114,101,118,105,101,
-119, 95,104,101,105,103,104,116, 0, 42,116,114, 97, 99,107, 95,112,114,101,118,105,101,119, 0,116,114, 97, 99,107, 95,112,111,
-115, 91, 50, 93, 0,116,114, 97, 99,107, 95,100,105,115, 97, 98,108,101,100, 0, 42,109, 97,114,107,101,114, 0,115,108,105,100,
-101, 95,115, 99, 97,108,101, 91, 50, 93, 0,101,114,114,111,114, 0, 42,105,110,116,114,105,110,115,105, 99,115, 0,115,101,110,
-115,111,114, 95,119,105,100,116,104, 0,112,105,120,101,108, 95, 97,115,112,101, 99,116, 0,102,111, 99, 97,108, 0,117,110,105,
-116,115, 0,112,114,105,110, 99,105,112, 97,108, 91, 50, 93, 0,107, 49, 0,107, 50, 0,107, 51, 0,112,111,115, 91, 50, 93, 0,
-112, 97,116, 95,109,105,110, 91, 50, 93, 0,112, 97,116, 95,109, 97,120, 91, 50, 93, 0,115,101, 97,114, 99,104, 95,109,105,110,
- 91, 50, 93, 0,115,101, 97,114, 99,104, 95,109, 97,120, 91, 50, 93, 0,109, 97,114,107,101,114,115,110,114, 0,108, 97,115,116,
- 95,109, 97,114,107,101,114, 0, 42,109, 97,114,107,101,114,115, 0, 98,117,110,100,108,101, 95,112,111,115, 91, 51, 93, 0,112,
- 97,116, 95,102,108, 97,103, 0,115,101, 97,114, 99,104, 95,102,108, 97,103, 0,102,114, 97,109,101,115, 95,108,105,109,105,116,
- 0,112, 97,116,116,101,114,110, 95,109, 97,116, 99,104, 0,116,114, 97, 99,107,101,114, 0,112,121,114, 97,109,105,100, 95,108,
-101,118,101,108,115, 0,109,105,110,105,109,117,109, 95, 99,111,114,114,101,108, 97,116,105,111,110, 0,100,101,102, 97,117,108,
-116, 95,116,114, 97, 99,107,101,114, 0,100,101,102, 97,117,108,116, 95,112,121,114, 97,109,105,100, 95,108,101,118,101,108,115,
- 0,100,101,102, 97,117,108,116, 95,109,105,110,105,109,117,109, 95, 99,111,114,114,101,108, 97,116,105,111,110, 0,100,101,102,
- 97,117,108,116, 95,112, 97,116,116,101,114,110, 95,115,105,122,101, 0,100,101,102, 97,117,108,116, 95,115,101, 97,114, 99,104,
- 95,115,105,122,101, 0,100,101,102, 97,117,108,116, 95,102,114, 97,109,101,115, 95,108,105,109,105,116, 0,100,101,102, 97,117,
-108,116, 95,109, 97,114,103,105,110, 0,100,101,102, 97,117,108,116, 95,112, 97,116,116,101,114,110, 95,109, 97,116, 99,104, 0,
-100,101,102, 97,117,108,116, 95,102,108, 97,103, 0,112,111,100, 0,107,101,121,102,114, 97,109,101, 49, 0,107,101,121,102,114,
- 97,109,101, 50, 0,114,101,102,105,110,101, 95, 99, 97,109,101,114, 97, 95,105,110,116,114,105,110,115,105, 99,115, 0,112, 97,
-100, 50, 51, 0, 99,108,101, 97,110, 95,102,114, 97,109,101,115, 0, 99,108,101, 97,110, 95, 97, 99,116,105,111,110, 0, 99,108,
-101, 97,110, 95,101,114,114,111,114, 0,111, 98,106,101, 99,116, 95,100,105,115,116, 97,110, 99,101, 0,116,111,116, 95,116,114,
- 97, 99,107, 0, 97, 99,116, 95,116,114, 97, 99,107, 0,109, 97,120,115, 99, 97,108,101, 0, 42,114,111,116, 95,116,114, 97, 99,
-107, 0,108,111, 99,105,110,102, 0,115, 99, 97,108,101,105,110,102, 0,114,111,116,105,110,102, 0, 42,115, 99, 97,108,101,105,
- 98,117,102, 0,108, 97,115,116, 95, 99, 97,109,101,114, 97, 0, 99, 97,109,110,114, 0, 42, 99, 97,109,101,114, 97,115, 0,116,
-114, 97, 99,107,115, 0,114,101, 99,111,110,115,116,114,117, 99,116,105,111,110, 0,109,101,115,115, 97,103,101, 91, 50, 53, 54,
- 93, 0,115,101,116,116,105,110,103,115, 0, 99, 97,109,101,114, 97, 0,115,116, 97, 98,105,108,105,122, 97,116,105,111,110, 0,
- 42, 97, 99,116, 95,116,114, 97, 99,107, 0,111, 98,106,101, 99,116,115, 0,111, 98,106,101, 99,116,110,114, 0,116,111,116, 95,
-111, 98,106,101, 99,116, 0, 42, 98,114,117,115,104, 95,103,114,111,117,112, 0, 99,117,114,114,101,110,116, 95,102,114, 97,109,
-101, 0,100,105,115,112, 95,116,121,112,101, 0,105,109, 97,103,101, 95,102,105,108,101,102,111,114,109, 97,116, 0,101,102,102,
-101, 99,116, 95,117,105, 0,112,114,101,118,105,101,119, 95,105,100, 0,105,110,105,116, 95, 99,111,108,111,114, 95,116,121,112,
-101, 0,112, 97,100, 95,115, 0,105,109, 97,103,101, 95,114,101,115,111,108,117,116,105,111,110, 0,115,117, 98,115,116,101,112,
-115, 0,105,110,105,116, 95, 99,111,108,111,114, 91, 52, 93, 0, 42,105,110,105,116, 95,116,101,120,116,117,114,101, 0,105,110,
-105,116, 95,108, 97,121,101,114,110, 97,109,101, 91, 54, 52, 93, 0,100,114,121, 95,115,112,101,101,100, 0, 99,111,108,111,114,
- 95,100,114,121, 95,116,104,114,101,115,104,111,108,100, 0,100,101,112,116,104, 95, 99,108, 97,109,112, 0,100,105,115,112, 95,
-102, 97, 99,116,111,114, 0,115,112,114,101, 97,100, 95,115,112,101,101,100, 0, 99,111,108,111,114, 95,115,112,114,101, 97,100,
- 95,115,112,101,101,100, 0,115,104,114,105,110,107, 95,115,112,101,101,100, 0,100,114,105,112, 95,118,101,108, 0,100,114,105,
-112, 95, 97, 99, 99, 0,105,110,102,108,117,101,110, 99,101, 95,115, 99, 97,108,101, 0,114, 97,100,105,117,115, 95,115, 99, 97,
-108,101, 0,119, 97,118,101, 95,100, 97,109,112,105,110,103, 0,119, 97,118,101, 95,115,112,101,101,100, 0,119, 97,118,101, 95,
-116,105,109,101,115, 99, 97,108,101, 0,119, 97,118,101, 95,115,112,114,105,110,103, 0,105,109, 97,103,101, 95,111,117,116,112,
-117,116, 95,112, 97,116,104, 91, 49, 48, 50, 52, 93, 0,111,117,116,112,117,116, 95,110, 97,109,101, 91, 54, 52, 93, 0,111,117,
-116,112,117,116, 95,110, 97,109,101, 50, 91, 54, 52, 93, 0, 42,112,109,100, 0,115,117,114,102, 97, 99,101,115, 0, 97, 99,116,
-105,118,101, 95,115,117,114, 0,101,114,114,111,114, 91, 54, 52, 93, 0, 99,111,108,108,105,115,105,111,110, 0,119,101,116,110,
-101,115,115, 0,112, 97,114,116,105, 99,108,101, 95,114, 97,100,105,117,115, 0,112, 97,114,116,105, 99,108,101, 95,115,109,111,
-111,116,104, 0,112, 97,105,110,116, 95,100,105,115,116, 97,110, 99,101, 0, 42,112, 97,105,110,116, 95,114, 97,109,112, 0, 42,
-118,101,108, 95,114, 97,109,112, 0,112,114,111,120,105,109,105,116,121, 95,102, 97,108,108,111,102,102, 0,114, 97,121, 95,100,
-105,114, 0,119, 97,118,101, 95,102, 97, 99,116,111,114, 0,119, 97,118,101, 95, 99,108, 97,109,112, 0,109, 97,120, 95,118,101,
-108,111, 99,105,116,121, 0,115,109,117,100,103,101, 95,115,116,114,101,110,103,116,104, 0, 0, 84, 89, 80, 69, 17, 2, 0, 0,
- 99,104, 97,114, 0,117, 99,104, 97,114, 0,115,104,111,114,116, 0,117,115,104,111,114,116, 0,105,110,116, 0,108,111,110,103,
- 0,117,108,111,110,103, 0,102,108,111, 97,116, 0,100,111,117, 98,108,101, 0,105,110,116, 54, 52, 95,116, 0,117,105,110,116,
- 54, 52, 95,116, 0,118,111,105,100, 0, 76,105,110,107, 0, 76,105,110,107, 68, 97,116, 97, 0, 76,105,115,116, 66, 97,115,101,
- 0,118,101, 99, 50,115, 0,118,101, 99, 50,102, 0,118,101, 99, 51,102, 0,114, 99,116,105, 0,114, 99,116,102, 0, 73, 68, 80,
-114,111,112,101,114,116,121, 68, 97,116, 97, 0, 73, 68, 80,114,111,112,101,114,116,121, 0, 73, 68, 0, 76,105, 98,114, 97,114,
-121, 0, 70,105,108,101, 68, 97,116, 97, 0, 80,114,101,118,105,101,119, 73,109, 97,103,101, 0, 73,112,111, 68,114,105,118,101,
-114, 0, 79, 98,106,101, 99,116, 0, 73,112,111, 67,117,114,118,101, 0, 66, 80,111,105,110,116, 0, 66,101,122, 84,114,105,112,
-108,101, 0, 73,112,111, 0, 75,101,121, 66,108,111, 99,107, 0, 75,101,121, 0, 65,110,105,109, 68, 97,116, 97, 0, 84,101,120,
-116, 76,105,110,101, 0, 84,101,120,116, 77, 97,114,107,101,114, 0, 84,101,120,116, 0, 80, 97, 99,107,101,100, 70,105,108,101,
- 0, 67, 97,109,101,114, 97, 0, 73,109, 97,103,101, 85,115,101,114, 0, 83, 99,101,110,101, 0, 73,109, 97,103,101, 0, 71, 80,
- 85, 84,101,120,116,117,114,101, 0, 97,110,105,109, 0, 82,101,110,100,101,114, 82,101,115,117,108,116, 0, 77, 84,101,120, 0,
- 84,101,120, 0, 80,108,117,103,105,110, 84,101,120, 0, 67, 66, 68, 97,116, 97, 0, 67,111,108,111,114, 66, 97,110,100, 0, 69,
-110,118, 77, 97,112, 0, 73,109, 66,117,102, 0, 80,111,105,110,116, 68,101,110,115,105,116,121, 0, 67,117,114,118,101, 77, 97,
-112,112,105,110,103, 0, 86,111,120,101,108, 68, 97,116, 97, 0, 79, 99,101, 97,110, 84,101,120, 0, 98, 78,111,100,101, 84,114,
-101,101, 0, 84,101,120, 77, 97,112,112,105,110,103, 0, 67,111,108,111,114, 77, 97,112,112,105,110,103, 0, 76, 97,109,112, 0,
- 86,111,108,117,109,101, 83,101,116,116,105,110,103,115, 0, 71, 97,109,101, 83,101,116,116,105,110,103,115, 0, 77, 97,116,101,
-114,105, 97,108, 0, 71,114,111,117,112, 0, 86, 70,111,110,116, 0, 86, 70,111,110,116, 68, 97,116, 97, 0, 77,101,116, 97, 69,
-108,101,109, 0, 66,111,117,110,100, 66,111,120, 0, 77,101,116, 97, 66, 97,108,108, 0, 78,117,114, 98, 0, 67,104, 97,114, 73,
-110,102,111, 0, 84,101,120,116, 66,111,120, 0, 69,100,105,116, 78,117,114, 98, 0, 71, 72, 97,115,104, 0, 67,117,114,118,101,
- 0, 80, 97,116,104, 0, 83,101,108, 66,111,120, 0, 69,100,105,116, 70,111,110,116, 0, 77,101,115,104, 0, 77, 80,111,108,121,
- 0, 77, 84,101,120, 80,111,108,121, 0, 77, 76,111,111,112, 0, 77, 76,111,111,112, 85, 86, 0, 77, 76,111,111,112, 67,111,108,
- 0, 77, 70, 97, 99,101, 0, 77, 84, 70, 97, 99,101, 0, 84, 70, 97, 99,101, 0, 77, 86,101,114,116, 0, 77, 69,100,103,101, 0,
- 77, 68,101,102,111,114,109, 86,101,114,116, 0, 77, 67,111,108, 0, 77, 83,116,105, 99,107,121, 0, 77, 83,101,108,101, 99,116,
- 0, 66, 77, 69,100,105,116, 77,101,115,104, 0, 67,117,115,116,111,109, 68, 97,116, 97, 0, 77,117,108,116,105,114,101,115, 0,
- 77, 68,101,102,111,114,109, 87,101,105,103,104,116, 0, 77, 70,108,111, 97,116, 80,114,111,112,101,114,116,121, 0, 77, 73,110,
-116, 80,114,111,112,101,114,116,121, 0, 77, 83,116,114,105,110,103, 80,114,111,112,101,114,116,121, 0, 79,114,105,103, 83,112,
- 97, 99,101, 70, 97, 99,101, 0, 79,114,105,103, 83,112, 97, 99,101, 76,111,111,112, 0, 77, 68,105,115,112,115, 0, 77,117,108,
-116,105,114,101,115, 67,111,108, 0, 77,117,108,116,105,114,101,115, 67,111,108, 70, 97, 99,101, 0, 77,117,108,116,105,114,101,
-115, 70, 97, 99,101, 0, 77,117,108,116,105,114,101,115, 69,100,103,101, 0, 77,117,108,116,105,114,101,115, 76,101,118,101,108,
- 0, 77, 82,101, 99, 97,115,116, 0, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77, 97,112,112,105,110,103, 73,110,102,
-111, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,117, 98,115,117,114,102, 77,111,100,105,102,105,101,114, 68, 97,116,
- 97, 0, 76, 97,116,116,105, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67,117,114,118,101, 77,111,100,105,102,
-105,101,114, 68, 97,116, 97, 0, 66,117,105,108,100, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77, 97,115,107, 77,111,
-100,105,102,105,101,114, 68, 97,116, 97, 0, 65,114,114, 97,121, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77,105,114,
-114,111,114, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 69,100,103,101, 83,112,108,105,116, 77,111,100,105,102,105,101,
-114, 68, 97,116, 97, 0, 66,101,118,101,108, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66, 77,101,115,104, 77,111,100,
-105,102,105,101,114, 68, 97,116, 97, 0, 83,109,111,107,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,109,111,107,
-101, 68,111,109, 97,105,110, 83,101,116,116,105,110,103,115, 0, 83,109,111,107,101, 70,108,111,119, 83,101,116,116,105,110,103,
-115, 0, 83,109,111,107,101, 67,111,108,108, 83,101,116,116,105,110,103,115, 0, 68,105,115,112,108, 97, 99,101, 77,111,100,105,
-102,105,101,114, 68, 97,116, 97, 0, 85, 86, 80,114,111,106,101, 99,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 68,
-101, 99,105,109, 97,116,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,109,111,111,116,104, 77,111,100,105,102,105,
-101,114, 68, 97,116, 97, 0, 67, 97,115,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 87, 97,118,101, 77,111,100,105,
-102,105,101,114, 68, 97,116, 97, 0, 65,114,109, 97,116,117,114,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 72,111,
-111,107, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,111,102,116, 98,111,100,121, 77,111,100,105,102,105,101,114, 68,
- 97,116, 97, 0, 67,108,111,116,104, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67,108,111,116,104, 0, 67,108,111,116,
-104, 83,105,109, 83,101,116,116,105,110,103,115, 0, 67,108,111,116,104, 67,111,108,108, 83,101,116,116,105,110,103,115, 0, 80,
-111,105,110,116, 67, 97, 99,104,101, 0, 67,111,108,108,105,115,105,111,110, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0,
- 66, 86, 72, 84,114,101,101, 0, 83,117,114,102, 97, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 68,101,114,105,
-118,101,100, 77,101,115,104, 0, 66, 86, 72, 84,114,101,101, 70,114,111,109, 77,101,115,104, 0, 66,111,111,108,101, 97,110, 77,
-111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77, 68,101,102, 73,110,102,108,117,101,110, 99,101, 0, 77, 68,101,102, 67,101,
-108,108, 0, 77,101,115,104, 68,101,102,111,114,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,
-108,101, 83,121,115,116,101,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108,101, 83,121,115,
-116,101,109, 0, 80, 97,114,116,105, 99,108,101, 73,110,115,116, 97,110, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97,
- 0, 69,120,112,108,111,100,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77,117,108,116,105,114,101,115, 77,111,100,
-105,102,105,101,114, 68, 97,116, 97, 0, 70,108,117,105,100,115,105,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 70,
-108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 83,104,114,105,110,107,119,114, 97,112, 77,111,100,105,102,105,
-101,114, 68, 97,116, 97, 0, 83,105,109,112,108,101, 68,101,102,111,114,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0,
- 83,104, 97,112,101, 75,101,121, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,111,108,105,100,105,102,121, 77,111,100,
-105,102,105,101,114, 68, 97,116, 97, 0, 83, 99,114,101,119, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 79, 99,101, 97,
-110, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 79, 99,101, 97,110, 0, 79, 99,101, 97,110, 67, 97, 99,104,101, 0, 78,
-103,111,110, 73,110,116,101,114,112, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 87, 97,114,112, 77,111,100,105,102,105,
-101,114, 68, 97,116, 97, 0, 87,101,105,103,104,116, 86, 71, 69,100,105,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0,
- 87,101,105,103,104,116, 86, 71, 77,105,120, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 87,101,105,103,104,116, 86, 71,
- 80,114,111,120,105,109,105,116,121, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 68,121,110, 97,109,105, 99, 80, 97,105,
-110,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 68,121,110, 97,109,105, 99, 80, 97,105,110,116, 67, 97,110,118, 97,
-115, 83,101,116,116,105,110,103,115, 0, 68,121,110, 97,109,105, 99, 80, 97,105,110,116, 66,114,117,115,104, 83,101,116,116,105,
-110,103,115, 0, 82,101,109,101,115,104, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 69,100,105,116, 76, 97,116,116, 0,
- 76, 97,116,116,105, 99,101, 0, 98, 68,101,102,111,114,109, 71,114,111,117,112, 0, 83, 99,117,108,112,116, 83,101,115,115,105,
-111,110, 0, 98, 65, 99,116,105,111,110, 0, 98, 80,111,115,101, 0, 98, 71, 80,100, 97,116, 97, 0, 98, 65,110,105,109, 86,105,
-122, 83,101,116,116,105,110,103,115, 0, 98, 77,111,116,105,111,110, 80, 97,116,104, 0, 66,117,108,108,101,116, 83,111,102,116,
- 66,111,100,121, 0, 80, 97,114,116, 68,101,102,108,101, 99,116, 0, 83,111,102,116, 66,111,100,121, 0, 79, 98, 72,111,111,107,
- 0, 68,117,112,108,105, 79, 98,106,101, 99,116, 0, 82, 78, 71, 0, 69,102,102,101, 99,116,111,114, 87,101,105,103,104,116,115,
- 0, 80, 84, 67, 97, 99,104,101, 69,120,116,114, 97, 0, 80, 84, 67, 97, 99,104,101, 77,101,109, 0, 80, 84, 67, 97, 99,104,101,
- 69,100,105,116, 0, 83, 66, 86,101,114,116,101,120, 0, 66,111,100,121, 80,111,105,110,116, 0, 66,111,100,121, 83,112,114,105,
-110,103, 0, 83, 66, 83, 99,114, 97,116, 99,104, 0, 70,108,117,105,100, 86,101,114,116,101,120, 86,101,108,111, 99,105,116,121,
- 0, 87,111,114,108,100, 0, 66, 97,115,101, 0, 65,118,105, 67,111,100,101, 99, 68, 97,116, 97, 0, 81,117,105, 99,107,116,105,
-109,101, 67,111,100,101, 99, 68, 97,116, 97, 0, 81,117,105, 99,107,116,105,109,101, 67,111,100,101, 99, 83,101,116,116,105,110,
-103,115, 0, 70, 70, 77,112,101,103, 67,111,100,101, 99, 68, 97,116, 97, 0, 65,117,100,105,111, 68, 97,116, 97, 0, 83, 99,101,
-110,101, 82,101,110,100,101,114, 76, 97,121,101,114, 0, 73,109, 97,103,101, 70,111,114,109, 97,116, 68, 97,116, 97, 0, 82,101,
-110,100,101,114, 68, 97,116, 97, 0, 82,101,110,100,101,114, 80,114,111,102,105,108,101, 0, 71, 97,109,101, 68,111,109,101, 0,
- 71, 97,109,101, 70,114, 97,109,105,110,103, 0, 82,101, 99, 97,115,116, 68, 97,116, 97, 0, 71, 97,109,101, 68, 97,116, 97, 0,
- 84,105,109,101, 77, 97,114,107,101,114, 0, 80, 97,105,110,116, 0, 66,114,117,115,104, 0, 73,109, 97,103,101, 80, 97,105,110,
-116, 83,101,116,116,105,110,103,115, 0, 80, 97,114,116,105, 99,108,101, 66,114,117,115,104, 68, 97,116, 97, 0, 80, 97,114,116,
-105, 99,108,101, 69,100,105,116, 83,101,116,116,105,110,103,115, 0, 83, 99,117,108,112,116, 0, 85,118, 83, 99,117,108,112,116,
- 0, 86, 80, 97,105,110,116, 0, 84,114, 97,110,115,102,111,114,109, 79,114,105,101,110,116, 97,116,105,111,110, 0, 85,110,105,
-102,105,101,100, 80, 97,105,110,116, 83,101,116,116,105,110,103,115, 0, 84,111,111,108, 83,101,116,116,105,110,103,115, 0, 98,
- 83,116, 97,116,115, 0, 85,110,105,116, 83,101,116,116,105,110,103,115, 0, 80,104,121,115,105, 99,115, 83,101,116,116,105,110,
-103,115, 0, 69,100,105,116,105,110,103, 0, 83, 99,101,110,101, 83,116, 97,116,115, 0, 68, 97,103, 70,111,114,101,115,116, 0,
- 77,111,118,105,101, 67,108,105,112, 0, 66, 71,112,105, 99, 0, 77,111,118,105,101, 67,108,105,112, 85,115,101,114, 0, 82,101,
-103,105,111,110, 86,105,101,119, 51, 68, 0, 82,101,110,100,101,114, 73,110,102,111, 0, 82,101,110,100,101,114, 69,110,103,105,
-110,101, 0, 86,105,101,119, 68,101,112,116,104,115, 0, 83,109,111,111,116,104, 86,105,101,119, 83,116,111,114,101, 0,119,109,
- 84,105,109,101,114, 0, 86,105,101,119, 51, 68, 0, 83,112, 97, 99,101, 76,105,110,107, 0, 86,105,101,119, 50, 68, 0, 83,112,
- 97, 99,101, 73,110,102,111, 0, 83,112, 97, 99,101, 73,112,111, 0, 98, 68,111,112,101, 83,104,101,101,116, 0, 83,112, 97, 99,
-101, 66,117,116,115, 0, 83,112, 97, 99,101, 83,101,113, 0, 70,105,108,101, 83,101,108,101, 99,116, 80, 97,114, 97,109,115, 0,
- 83,112, 97, 99,101, 70,105,108,101, 0, 70,105,108,101, 76,105,115,116, 0,119,109, 79,112,101,114, 97,116,111,114, 0, 70,105,
-108,101, 76, 97,121,111,117,116, 0, 83,112, 97, 99,101, 79,111,112,115, 0, 84,114,101,101, 83,116,111,114,101, 0, 84,114,101,
-101, 83,116,111,114,101, 69,108,101,109, 0, 83,112, 97, 99,101, 73,109, 97,103,101, 0, 83, 99,111,112,101,115, 0, 72,105,115,
-116,111,103,114, 97,109, 0, 83,112, 97, 99,101, 78,108, 97, 0, 83,112, 97, 99,101, 84,101,120,116, 0, 83, 99,114,105,112,116,
- 0, 83,112, 97, 99,101, 83, 99,114,105,112,116, 0, 83,112, 97, 99,101, 84,105,109,101, 67, 97, 99,104,101, 0, 83,112, 97, 99,
-101, 84,105,109,101, 0, 83,112, 97, 99,101, 78,111,100,101, 0, 83,112, 97, 99,101, 76,111,103,105, 99, 0, 67,111,110,115,111,
-108,101, 76,105,110,101, 0, 83,112, 97, 99,101, 67,111,110,115,111,108,101, 0, 83,112, 97, 99,101, 85,115,101,114, 80,114,101,
-102, 0, 83,112, 97, 99,101, 67,108,105,112, 0, 77,111,118,105,101, 67,108,105,112, 83, 99,111,112,101,115, 0,117,105, 70,111,
-110,116, 0,117,105, 70,111,110,116, 83,116,121,108,101, 0,117,105, 83,116,121,108,101, 0,117,105, 87,105,100,103,101,116, 67,
-111,108,111,114,115, 0,117,105, 87,105,100,103,101,116, 83,116, 97,116,101, 67,111,108,111,114,115, 0,117,105, 80, 97,110,101,
-108, 67,111,108,111,114,115, 0, 84,104,101,109,101, 85, 73, 0, 84,104,101,109,101, 83,112, 97, 99,101, 0, 84,104,101,109,101,
- 87,105,114,101, 67,111,108,111,114, 0, 98, 84,104,101,109,101, 0, 98, 65,100,100,111,110, 0, 83,111,108,105,100, 76,105,103,
-104,116, 0, 85,115,101,114, 68,101,102, 0, 98, 83, 99,114,101,101,110, 0, 83, 99,114, 86,101,114,116, 0, 83, 99,114, 69,100,
-103,101, 0, 80, 97,110,101,108, 0, 80, 97,110,101,108, 84,121,112,101, 0,117,105, 76, 97,121,111,117,116, 0, 83, 99,114, 65,
-114,101, 97, 0, 83,112, 97, 99,101, 84,121,112,101, 0, 65, 82,101,103,105,111,110, 0, 65, 82,101,103,105,111,110, 84,121,112,
-101, 0, 70,105,108,101, 71,108,111, 98, 97,108, 0, 83,116,114,105,112, 69,108,101,109, 0, 83,116,114,105,112, 67,114,111,112,
- 0, 83,116,114,105,112, 84,114, 97,110,115,102,111,114,109, 0, 83,116,114,105,112, 67,111,108,111,114, 66, 97,108, 97,110, 99,
-101, 0, 83,116,114,105,112, 80,114,111,120,121, 0, 83,116,114,105,112, 0, 80,108,117,103,105,110, 83,101,113, 0, 83,101,113,
-117,101,110, 99,101, 0, 98, 83,111,117,110,100, 0, 77,101,116, 97, 83,116, 97, 99,107, 0, 87,105,112,101, 86, 97,114,115, 0,
- 71,108,111,119, 86, 97,114,115, 0, 84,114, 97,110,115,102,111,114,109, 86, 97,114,115, 0, 83,111,108,105,100, 67,111,108,111,
-114, 86, 97,114,115, 0, 83,112,101,101,100, 67,111,110,116,114,111,108, 86, 97,114,115, 0, 69,102,102,101, 99,116, 0, 66,117,
-105,108,100, 69,102,102, 0, 80, 97,114,116, 69,102,102, 0, 80, 97,114,116,105, 99,108,101, 0, 87, 97,118,101, 69,102,102, 0,
- 98, 80,114,111,112,101,114,116,121, 0, 98, 78,101, 97,114, 83,101,110,115,111,114, 0, 98, 77,111,117,115,101, 83,101,110,115,
-111,114, 0, 98, 84,111,117, 99,104, 83,101,110,115,111,114, 0, 98, 75,101,121, 98,111, 97,114,100, 83,101,110,115,111,114, 0,
- 98, 80,114,111,112,101,114,116,121, 83,101,110,115,111,114, 0, 98, 65, 99,116,117, 97,116,111,114, 83,101,110,115,111,114, 0,
- 98, 68,101,108, 97,121, 83,101,110,115,111,114, 0, 98, 67,111,108,108,105,115,105,111,110, 83,101,110,115,111,114, 0, 98, 82,
- 97,100, 97,114, 83,101,110,115,111,114, 0, 98, 82, 97,110,100,111,109, 83,101,110,115,111,114, 0, 98, 82, 97,121, 83,101,110,
-115,111,114, 0, 98, 65,114,109, 97,116,117,114,101, 83,101,110,115,111,114, 0, 98, 77,101,115,115, 97,103,101, 83,101,110,115,
-111,114, 0, 98, 83,101,110,115,111,114, 0, 98, 67,111,110,116,114,111,108,108,101,114, 0, 98, 74,111,121,115,116,105, 99,107,
- 83,101,110,115,111,114, 0, 98, 69,120,112,114,101,115,115,105,111,110, 67,111,110,116, 0, 98, 80,121,116,104,111,110, 67,111,
-110,116, 0, 98, 65, 99,116,117, 97,116,111,114, 0, 98, 65,100,100, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0,
- 98, 65, 99,116,105,111,110, 65, 99,116,117, 97,116,111,114, 0, 83,111,117,110,100, 51, 68, 0, 98, 83,111,117,110,100, 65, 99,
-116,117, 97,116,111,114, 0, 98, 69,100,105,116, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 83, 99,101,110,
-101, 65, 99,116,117, 97,116,111,114, 0, 98, 80,114,111,112,101,114,116,121, 65, 99,116,117, 97,116,111,114, 0, 98, 79, 98,106,
-101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 73,112,111, 65, 99,116,117, 97,116,111,114, 0, 98, 67, 97,109,101,114, 97,
- 65, 99,116,117, 97,116,111,114, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 65, 99,116,117, 97,116,111,114, 0, 98, 71,114,
-111,117,112, 65, 99,116,117, 97,116,111,114, 0, 98, 82, 97,110,100,111,109, 65, 99,116,117, 97,116,111,114, 0, 98, 77,101,115,
-115, 97,103,101, 65, 99,116,117, 97,116,111,114, 0, 98, 71, 97,109,101, 65, 99,116,117, 97,116,111,114, 0, 98, 86,105,115,105,
- 98,105,108,105,116,121, 65, 99,116,117, 97,116,111,114, 0, 98, 84,119,111, 68, 70,105,108,116,101,114, 65, 99,116,117, 97,116,
-111,114, 0, 98, 80, 97,114,101,110,116, 65, 99,116,117, 97,116,111,114, 0, 98, 83,116, 97,116,101, 65, 99,116,117, 97,116,111,
-114, 0, 98, 65,114,109, 97,116,117,114,101, 65, 99,116,117, 97,116,111,114, 0, 98, 83,116,101,101,114,105,110,103, 65, 99,116,
-117, 97,116,111,114, 0, 71,114,111,117,112, 79, 98,106,101, 99,116, 0, 66,111,110,101, 0, 98, 65,114,109, 97,116,117,114,101,
- 0, 98, 77,111,116,105,111,110, 80, 97,116,104, 86,101,114,116, 0, 98, 80,111,115,101, 67,104, 97,110,110,101,108, 0, 98, 73,
- 75, 80, 97,114, 97,109, 0, 98, 73,116, 97,115, 99, 0, 98, 65, 99,116,105,111,110, 71,114,111,117,112, 0, 83,112, 97, 99,101,
- 65, 99,116,105,111,110, 0, 98, 65, 99,116,105,111,110, 67,104, 97,110,110,101,108, 0, 98, 67,111,110,115,116,114, 97,105,110,
-116, 67,104, 97,110,110,101,108, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 67,111,110,115,116,114, 97,105,110,116,
- 84, 97,114,103,101,116, 0, 98, 80,121,116,104,111,110, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 75,105,110,101,109, 97,
-116,105, 99, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,112,108,105,110,101, 73, 75, 67,111,110,115,116,114, 97,105,110,
-116, 0, 98, 84,114, 97, 99,107, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 97,116,101, 76,105,107,101,
- 67,111,110,115,116,114, 97,105,110,116, 0, 98, 76,111, 99, 97,116,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116,
- 0, 98, 83,105,122,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83, 97,109,101, 86,111,108,117,109,101,
- 67,111,110,115,116,114, 97,105,110,116, 0, 98, 84,114, 97,110,115, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0,
- 98, 77,105,110, 77, 97,120, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,111,110, 67,111,110,115,116,114, 97,
-105,110,116, 0, 98, 76,111, 99,107, 84,114, 97, 99,107, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 68, 97,109,112, 84,114,
- 97, 99,107, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 70,111,108,108,111,119, 80, 97,116,104, 67,111,110,115,116,114, 97,
-105,110,116, 0, 98, 83,116,114,101,116, 99,104, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,105,103,105,100, 66,
-111,100,121, 74,111,105,110,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 67,108, 97,109,112, 84,111, 67,111,110,115,116,
-114, 97,105,110,116, 0, 98, 67,104,105,108,100, 79,102, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 84,114, 97,110,115,102,
-111,114,109, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 80,105,118,111,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98,
- 76,111, 99, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 76,105,109,105,116, 67,111,110,115,
-116,114, 97,105,110,116, 0, 98, 83,105,122,101, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 68,105,115,
-116, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,104,114,105,110,107,119,114, 97,112, 67,111,110,115,
-116,114, 97,105,110,116, 0, 98, 70,111,108,108,111,119, 84,114, 97, 99,107, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 67,
- 97,109,101,114, 97, 83,111,108,118,101,114, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 79, 98,106,101, 99,116, 83,111,108,
-118,101,114, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,111,110, 77,111,100,105,102,105,101,114, 0, 98, 65,
- 99,116,105,111,110, 83,116,114,105,112, 0, 98, 78,111,100,101, 83,116, 97, 99,107, 0, 98, 78,111,100,101, 83,111, 99,107,101,
-116, 0, 98, 78,111,100,101, 76,105,110,107, 0, 98, 78,111,100,101, 80,114,101,118,105,101,119, 0, 98, 78,111,100,101, 0,117,
-105, 66,108,111, 99,107, 0, 98, 78,111,100,101, 84,121,112,101, 0, 98, 78,111,100,101, 84,114,101,101, 69,120,101, 99, 0, 98,
- 78,111,100,101, 83,111, 99,107,101,116, 86, 97,108,117,101, 73,110,116, 0, 98, 78,111,100,101, 83,111, 99,107,101,116, 86, 97,
-108,117,101, 70,108,111, 97,116, 0, 98, 78,111,100,101, 83,111, 99,107,101,116, 86, 97,108,117,101, 66,111,111,108,101, 97,110,
- 0, 98, 78,111,100,101, 83,111, 99,107,101,116, 86, 97,108,117,101, 86,101, 99,116,111,114, 0, 98, 78,111,100,101, 83,111, 99,
-107,101,116, 86, 97,108,117,101, 82, 71, 66, 65, 0, 78,111,100,101, 73,109, 97,103,101, 65,110,105,109, 0, 78,111,100,101, 66,
-108,117,114, 68, 97,116, 97, 0, 78,111,100,101, 68, 66,108,117,114, 68, 97,116, 97, 0, 78,111,100,101, 66,105,108, 97,116,101,
-114, 97,108, 66,108,117,114, 68, 97,116, 97, 0, 78,111,100,101, 72,117,101, 83, 97,116, 0, 78,111,100,101, 73,109, 97,103,101,
- 70,105,108,101, 0, 78,111,100,101, 73,109, 97,103,101, 77,117,108,116,105, 70,105,108,101, 0, 78,111,100,101, 73,109, 97,103,
-101, 77,117,108,116,105, 70,105,108,101, 83,111, 99,107,101,116, 0, 78,111,100,101, 67,104,114,111,109, 97, 0, 78,111,100,101,
- 84,119,111, 88, 89,115, 0, 78,111,100,101, 84,119,111, 70,108,111, 97,116,115, 0, 78,111,100,101, 71,101,111,109,101,116,114,
-121, 0, 78,111,100,101, 86,101,114,116,101,120, 67,111,108, 0, 78,111,100,101, 68,101,102,111, 99,117,115, 0, 78,111,100,101,
- 83, 99,114,105,112,116, 68,105, 99,116, 0, 78,111,100,101, 71,108, 97,114,101, 0, 78,111,100,101, 84,111,110,101,109, 97,112,
- 0, 78,111,100,101, 76,101,110,115, 68,105,115,116, 0, 78,111,100,101, 67,111,108,111,114, 66, 97,108, 97,110, 99,101, 0, 78,
-111,100,101, 67,111,108,111,114,115,112,105,108,108, 0, 78,111,100,101, 84,101,120, 66, 97,115,101, 0, 78,111,100,101, 84,101,
-120, 83,107,121, 0, 78,111,100,101, 84,101,120, 73,109, 97,103,101, 0, 78,111,100,101, 84,101,120, 67,104,101, 99,107,101,114,
- 0, 78,111,100,101, 84,101,120, 69,110,118,105,114,111,110,109,101,110,116, 0, 78,111,100,101, 84,101,120, 71,114, 97,100,105,
-101,110,116, 0, 78,111,100,101, 84,101,120, 78,111,105,115,101, 0, 78,111,100,101, 84,101,120, 86,111,114,111,110,111,105, 0,
- 78,111,100,101, 84,101,120, 77,117,115,103,114, 97,118,101, 0, 78,111,100,101, 84,101,120, 87, 97,118,101, 0, 78,111,100,101,
- 84,101,120, 77, 97,103,105, 99, 0, 78,111,100,101, 83,104, 97,100,101,114, 65,116,116,114,105, 98,117,116,101, 0, 84,101,120,
- 78,111,100,101, 79,117,116,112,117,116, 0, 67,117,114,118,101, 77, 97,112, 80,111,105,110,116, 0, 67,117,114,118,101, 77, 97,
-112, 0, 66,114,117,115,104, 67,108,111,110,101, 0, 67,117,115,116,111,109, 68, 97,116, 97, 76, 97,121,101,114, 0, 67,117,115,
-116,111,109, 68, 97,116, 97, 69,120,116,101,114,110, 97,108, 0, 72, 97,105,114, 75,101,121, 0, 80, 97,114,116,105, 99,108,101,
- 75,101,121, 0, 66,111,105,100, 80, 97,114,116,105, 99,108,101, 0, 66,111,105,100, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,
-108,101, 83,112,114,105,110,103, 0, 67,104,105,108,100, 80, 97,114,116,105, 99,108,101, 0, 80, 97,114,116,105, 99,108,101, 84,
- 97,114,103,101,116, 0, 80, 97,114,116,105, 99,108,101, 68,117,112,108,105, 87,101,105,103,104,116, 0, 80, 97,114,116,105, 99,
-108,101, 68, 97,116, 97, 0, 83, 80, 72, 70,108,117,105,100, 83,101,116,116,105,110,103,115, 0, 80, 97,114,116,105, 99,108,101,
- 83,101,116,116,105,110,103,115, 0, 66,111,105,100, 83,101,116,116,105,110,103,115, 0, 80, 97,114,116,105, 99,108,101, 67, 97,
- 99,104,101, 75,101,121, 0, 75, 68, 84,114,101,101, 0, 80, 97,114,116,105, 99,108,101, 68,114, 97,119, 68, 97,116, 97, 0, 76,
-105,110,107, 78,111,100,101, 0, 98, 71, 80, 68,115,112,111,105,110,116, 0, 98, 71, 80, 68,115,116,114,111,107,101, 0, 98, 71,
- 80, 68,102,114, 97,109,101, 0, 98, 71, 80, 68,108, 97,121,101,114, 0, 82,101,112,111,114,116, 76,105,115,116, 0,119,109, 87,
-105,110,100,111,119, 77, 97,110, 97,103,101,114, 0,119,109, 87,105,110,100,111,119, 0,119,109, 75,101,121, 67,111,110,102,105,
-103, 0,119,109, 69,118,101,110,116, 0,119,109, 83,117, 98, 87,105,110,100,111,119, 0,119,109, 71,101,115,116,117,114,101, 0,
-119,109, 75,101,121, 77, 97,112, 73,116,101,109, 0, 80,111,105,110,116,101,114, 82, 78, 65, 0,119,109, 75,101,121, 77, 97,112,
- 68,105,102,102, 73,116,101,109, 0,119,109, 75,101,121, 77, 97,112, 0,119,109, 79,112,101,114, 97,116,111,114, 84,121,112,101,
- 0, 70, 77,111,100,105,102,105,101,114, 0, 70, 77,111,100, 95, 71,101,110,101,114, 97,116,111,114, 0, 70, 77,111,100, 95, 70,
-117,110, 99,116,105,111,110, 71,101,110,101,114, 97,116,111,114, 0, 70, 67, 77, 95, 69,110,118,101,108,111,112,101, 68, 97,116,
- 97, 0, 70, 77,111,100, 95, 69,110,118,101,108,111,112,101, 0, 70, 77,111,100, 95, 67,121, 99,108,101,115, 0, 70, 77,111,100,
- 95, 80,121,116,104,111,110, 0, 70, 77,111,100, 95, 76,105,109,105,116,115, 0, 70, 77,111,100, 95, 78,111,105,115,101, 0, 70,
- 77,111,100, 95, 83,116,101,112,112,101,100, 0, 68,114,105,118,101,114, 84, 97,114,103,101,116, 0, 68,114,105,118,101,114, 86,
- 97,114, 0, 67,104, 97,110,110,101,108, 68,114,105,118,101,114, 0, 70, 80,111,105,110,116, 0, 70, 67,117,114,118,101, 0, 65,
-110,105,109, 77, 97,112, 80, 97,105,114, 0, 65,110,105,109, 77, 97,112,112,101,114, 0, 78,108, 97, 83,116,114,105,112, 0, 78,
-108, 97, 84,114, 97, 99,107, 0, 75, 83, 95, 80, 97,116,104, 0, 75,101,121,105,110,103, 83,101,116, 0, 65,110,105,109, 79,118,
-101,114,114,105,100,101, 0, 73,100, 65,100,116, 84,101,109,112,108, 97,116,101, 0, 66,111,105,100, 82,117,108,101, 0, 66,111,
-105,100, 82,117,108,101, 71,111, 97,108, 65,118,111,105,100, 0, 66,111,105,100, 82,117,108,101, 65,118,111,105,100, 67,111,108,
-108,105,115,105,111,110, 0, 66,111,105,100, 82,117,108,101, 70,111,108,108,111,119, 76,101, 97,100,101,114, 0, 66,111,105,100,
- 82,117,108,101, 65,118,101,114, 97,103,101, 83,112,101,101,100, 0, 66,111,105,100, 82,117,108,101, 70,105,103,104,116, 0, 66,
-111,105,100, 83,116, 97,116,101, 0, 70, 76, 85, 73, 68, 95, 51, 68, 0, 87, 84, 85, 82, 66, 85, 76, 69, 78, 67, 69, 0, 83,112,
-101, 97,107,101,114, 0, 77,111,118,105,101, 67,108,105,112, 80,114,111,120,121, 0, 77,111,118,105,101, 67,108,105,112, 67, 97,
- 99,104,101, 0, 77,111,118,105,101, 84,114, 97, 99,107,105,110,103, 0, 77,111,118,105,101, 84,114, 97, 99,107,105,110,103, 84,
-114, 97, 99,107, 0, 77,111,118,105,101, 84,114, 97, 99,107,105,110,103, 77, 97,114,107,101,114, 0, 77,111,118,105,101, 82,101,
- 99,111,110,115,116,114,117, 99,116,101,100, 67, 97,109,101,114, 97, 0, 77,111,118,105,101, 84,114, 97, 99,107,105,110,103, 67,
- 97,109,101,114, 97, 0, 77,111,118,105,101, 84,114, 97, 99,107,105,110,103, 83,101,116,116,105,110,103,115, 0, 77,111,118,105,
-101, 84,114, 97, 99,107,105,110,103, 83,116, 97, 98,105,108,105,122, 97,116,105,111,110, 0, 77,111,118,105,101, 84,114, 97, 99,
-107,105,110,103, 82,101, 99,111,110,115,116,114,117, 99,116,105,111,110, 0, 77,111,118,105,101, 84,114, 97, 99,107,105,110,103,
- 79, 98,106,101, 99,116, 0, 77,111,118,105,101, 84,114, 97, 99,107,105,110,103, 83,116, 97,116,115, 0, 68,121,110, 97,109,105,
- 99, 80, 97,105,110,116, 83,117,114,102, 97, 99,101, 0, 80, 97,105,110,116, 83,117,114,102, 97, 99,101, 68, 97,116, 97, 0, 0,
- 84, 76, 69, 78, 1, 0, 1, 0, 2, 0, 2, 0, 4, 0, 4, 0, 4, 0, 4, 0, 8, 0, 8, 0, 8, 0, 0, 0, 16, 0, 24, 0,
- 16, 0, 4, 0, 8, 0, 12, 0, 16, 0, 16, 0, 32, 0,128, 0,120, 0,152, 8, 0, 0, 40, 0,144, 0,112, 5,112, 0, 36, 0,
- 56, 0,160, 0,200, 0, 0, 1, 96, 0, 40, 0, 48, 0,224, 0, 16, 0,200, 0, 40, 0,216, 11, 48, 5, 0, 0, 0, 0, 0, 0,
- 56, 1,168, 1,216, 4, 24, 0, 8, 3,200, 0, 0, 0,104, 0, 64, 1, 56, 4, 80, 0, 24, 1,144, 0, 56, 3, 16, 2, 88, 0,
- 16, 0,128, 3,152, 0,136, 4, 0, 0,104, 0,104, 0, 0, 1, 80, 0, 8, 0, 16, 0, 32, 0, 0, 0, 8, 2, 0, 0, 0, 0,
- 0, 0,232, 4, 12, 0, 16, 0, 8, 0, 12, 0, 4, 0, 20, 0, 48, 0, 64, 0, 20, 0, 12, 0, 16, 0, 4, 0, 8, 0, 8, 0,
- 0, 0,176, 0,144, 1, 8, 0, 4, 0, 4, 0, 0, 1, 32, 0, 8, 0, 16, 0, 16, 0, 64, 0, 24, 0, 12, 0, 64, 0, 4, 0,
-112, 0,200, 0,136, 0,184, 0,192, 0,128, 0,192, 0,192, 0,128, 0,120, 0,200, 0,120, 0,144, 0, 16, 1, 56, 0,192, 0,
- 24, 1, 40, 1,120, 0,184, 0,200, 0, 64, 1,200, 0, 88, 1,112, 0,168, 0, 0, 0,152, 0, 48, 0, 40, 5,192, 0, 0, 0,
-152, 0, 0, 0, 0, 0,128, 0, 8, 0, 8, 0,112, 1,144, 0,152, 2,136, 0,192, 0,120, 0,128, 0,224, 4,208, 0,200, 0,
-112, 0,208, 0,144, 0, 16, 5, 0, 0, 0, 0,120, 0, 48, 1,104, 1,160, 1,104, 1,136, 0,104, 0,112, 0,128, 0, 16, 0,
- 96, 1, 88, 0, 0, 0,200, 0,216, 0,152, 0, 48, 0, 24, 0,120, 0,152, 0,216, 1, 0, 1,184, 0, 0, 0, 72, 0, 32, 0,
-176, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 12, 0, 24, 2, 40, 0,184, 0,152, 0, 64, 0, 72, 0, 32, 0,120, 0, 24, 0,
- 56, 9, 64, 0, 24, 0, 16, 0, 56, 0,168, 0, 96, 0, 24, 0, 88, 6, 48, 0, 16, 0,168, 0, 96, 0, 24, 0, 56, 0,120, 0,
- 16, 0,232, 1, 32, 0, 8, 0, 24, 0, 80, 8, 0, 0, 0, 0,192, 8,104, 0, 8, 0,120, 3, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 96, 1, 56, 0,144, 0, 64, 0,240, 0,112, 0,248, 0,240, 0,160, 7,104, 0, 0, 0,168, 0, 0, 0, 24, 1, 16, 0,
- 16, 0, 40, 33,128, 16, 24, 16,216, 0,160, 2,168, 5, 64, 0, 24, 0,208, 0, 48, 1, 72, 0, 40, 0,136, 1,104, 0, 40, 1,
- 56, 0, 24, 4, 32, 0,232, 0, 32, 0, 32, 0, 8, 0, 48, 3,208, 1, 16, 0,120, 35, 80, 0, 56, 0,104, 38, 8, 1, 32, 0,
- 40, 0, 88, 1, 0, 0, 0, 0,160, 0, 0, 0, 40, 1, 0, 0, 48, 4, 8, 1, 16, 0, 8, 0, 44, 0, 16, 4, 80, 3,200, 4,
- 72, 1,208, 4, 32, 0, 12, 0, 24, 0, 32, 0, 16, 0, 24, 0, 24, 0, 32, 0,136, 1, 0, 0, 64, 0, 96, 0, 80, 0, 8, 0,
- 80, 0,136, 0,200, 0, 72, 0, 8, 0,136, 0, 76, 0, 72, 0,204, 0,136, 0,136, 0,128, 0,136, 0, 92, 0,128, 0, 80, 0,
-112, 0, 16, 0,168, 0, 32, 0, 72, 0,120, 0, 24, 0,144, 0,112, 0,148, 0, 32, 0,128, 0, 88, 0, 88, 0,208, 0,140, 0,
- 4, 0, 24, 0, 16, 0, 8, 0,152, 0, 48, 0, 40, 0, 72, 1, 0, 1, 16, 0, 32, 2, 4, 0, 40, 0,120, 0, 72, 1,120, 0,
- 56, 0,120, 0,160, 0,112, 0,184, 0, 24, 0, 88, 0, 80, 0, 80, 0, 80, 0, 8, 0, 72, 0,104, 0,104, 0, 80, 0, 80, 0,
- 24, 0, 88, 0,104, 0, 16, 0,144, 0,128, 0, 88, 0, 28, 0, 28, 0, 28, 0, 88, 0, 24, 0,160, 0, 16, 0,152, 0, 72, 0,
-168, 0, 48, 0,208, 0, 56, 0, 16, 0, 88, 1, 0, 0, 0, 0, 0, 0, 16, 0, 16, 0, 4, 0, 24, 0, 16, 0, 16, 0, 40, 0,
- 28, 0, 12, 0, 12, 0, 32, 4, 8, 4, 32, 0, 44, 0, 24, 0, 8, 0,128, 0, 64, 0, 32, 0, 16, 0, 32, 0, 32, 0, 8, 0,
- 96, 0, 20, 0,200, 3,216, 3,208, 3,200, 3,208, 3,208, 3,200, 3,208, 3,208, 3,208, 3,208, 3, 64, 0, 64, 0, 12, 0,
- 56, 0, 24, 0,104, 0, 0, 4, 24, 0, 56, 0, 56, 0, 20, 0, 16, 0, 64, 0, 40, 0, 32, 0,192, 0, 60, 0, 16, 3,104, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 32, 0, 40, 0,192, 0, 40, 0, 88, 1, 0, 1,168, 0, 0, 0, 0, 0, 0, 0,120, 0,
- 0, 0, 32, 0,136, 0, 0, 0,120, 0, 24, 0, 24, 0, 16, 0, 24, 0, 8, 0, 16, 0, 24, 0, 20, 0, 20, 0, 56, 0, 24, 2,
- 40, 1, 16, 0,104, 0, 0, 1, 40, 0,208, 0,104, 0,112, 0,168, 0, 32, 0,128, 0, 56, 0, 80, 0, 64, 0,104, 0, 72, 0,
- 64, 0,128, 0, 0, 0, 0, 0,184, 0, 8, 3, 0, 0,248, 0,192, 0, 16, 0, 72, 0, 48, 0, 64, 0, 56, 0, 24, 0,128, 0,
- 0, 1, 16, 6, 0, 0, 0, 0, 83, 84, 82, 67,208, 1, 0, 0, 12, 0, 2, 0, 12, 0, 0, 0, 12, 0, 1, 0, 13, 0, 3, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 35, 0, 0, 0, 2, 0, 94, 1,
+ 8, 0, 0, 0, 3, 0, 0, 0, 56, 52, 39, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 8, 0, 0, 2, 0, 0, 0, 68,172, 0, 0,
+ 36, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 72, 0, 0, 0, 0, 0, 64, 0, 5, 0, 2, 0, 88,174,219, 3, 0, 0, 0, 0,
+ 88,174,219, 3, 0, 0, 0, 0,200,152,170, 3, 0, 0, 0, 0,200,152,170, 3, 0, 0, 0, 0,200,154,199, 3, 0, 0, 0, 0,
+200,154,199, 3, 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, 0, 0, 0, 0,184,211,219, 3, 0, 0, 0, 0, 8,219,219, 3, 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, 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, 0, 0, 0, 0, 32, 0, 0, 0, 1, 0, 2, 0,
+ 25, 0, 0, 0, 20, 0, 20, 0, 1, 0, 0, 0, 0, 0, 0, 0,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 30, 90,100,191,154,153,153, 62,102,102,102, 63, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 31,250,254, 62, 9, 0, 0, 63,156,153, 25, 63, 0, 0, 0, 0,205,204, 76, 62,205,204, 76, 62,
+205,204, 76, 62, 0, 0,128, 63, 44,135, 22, 63, 32,133,235, 62,184,243,125, 62, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+195, 73, 76, 63, 42,135, 86, 63, 0, 0,128, 63, 0, 0, 0, 0, 1, 43,135, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 16, 47, 93, 62, 58,180,200,190, 24, 47, 93,190, 0, 0, 0, 0, 14, 0, 1, 0, 25, 0, 15, 0,120, 0, 60, 0, 3, 0, 5, 0,
+128, 0, 0, 0, 0, 0, 0, 0,144, 31, 15, 0, 6, 0, 25, 0, 8, 0, 10, 0,200, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 0,
+ 10, 0, 50, 0, 20, 0, 2, 0, 1, 0, 0, 0, 0, 0,128, 63, 60, 0, 0, 0, 0, 0, 2, 0, 2, 0, 8, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63,
+ 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,
+ 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63,
+ 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,
+ 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63,
+ 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,
+ 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63,
+ 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,
+ 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63,
+ 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,
+ 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63,
+ 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,
+ 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63,
+ 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,
+ 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63,
+ 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 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, 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, 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,128, 62, 0, 0, 0, 0, 68, 65, 84, 65,168, 36, 0, 0,
+ 88,174,219, 3, 0, 0, 0, 0,206, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68,101,102, 97,117,108,116, 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,
+ 25, 25, 25,255,153,153,153,255,100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
+ 25, 25, 25,255,153,153,153,255,100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 1, 0, 15, 0,241,255, 0, 0,
+ 25, 25, 25,255,153,153,153,255,153,153,153,255, 90, 90, 90,255, 0, 0, 0,255,255,255,255,255, 1, 0, 0, 0, 25, 0, 0, 0,
+ 0, 0, 0,255, 70, 70, 70,255, 86,128,194,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, 1, 0, 15, 0,241,255, 0, 0,
+ 0, 0, 0,255, 70, 70, 70,255, 70, 70, 70,255,255,255,255,255, 0, 0, 0,255,255,255,255,255, 1, 0, 15, 0,241,255, 0, 0,
+ 25, 25, 25,255,153,153,153,255,100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
+ 25, 25, 25,255,180,180,180,255,153,153,153,255, 90, 90, 90,255, 0, 0, 0,255,255,255,255,255, 1, 0,236,255, 0, 0, 0, 0,
+ 25, 25, 25,255,180,180,180,255,153,153,153,255,128,128,128,255, 0, 0, 0,255,255,255,255,255, 1, 0,236,255, 0, 0, 0, 0,
+ 0, 0, 0,255, 70, 70, 70,255, 70, 70, 70,255,255,255,255,255,255,255,255,255,204,204,204,255, 1, 0, 15, 0,241,255, 0, 0,
+ 0, 0, 0,255, 63, 63, 63,255, 86,128,194,255,255,255,255,255, 0, 0, 0,255, 0, 0, 0,255, 0, 0, 25, 0,236,255, 0, 0,
+ 0, 0, 0,255, 25, 25, 25,230, 45, 45, 45,230,100,100,100,255,160,160,160,255,255,255,255,255, 0, 0, 25, 0,236,255, 0, 0,
+ 0, 0, 0,255, 0, 0, 0, 0, 86,128,194,255,172,172,172,128,255,255,255,255, 0, 0, 0,255, 1, 0, 38, 0, 0, 0, 0, 0,
+ 0, 0, 0,255, 25, 25, 25,230, 45, 45, 45,230,100,100,100,255,255,255,255,255,255,255,255,255, 0, 0, 25, 0,236,255, 0, 0,
+ 25, 25, 25,255,128,128,128,255,100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
+ 50, 50, 50,180, 80, 80, 80,180,100,100,100,180,128,128,128,255, 0, 0, 0,255,255,255,255,255, 1, 0, 5, 0,251,255, 0, 0,
+ 0, 0, 0,255,190,190,190,255,100,100,100,180, 68, 68, 68,255, 0, 0, 0,255,255,255,255,255, 0, 0, 5, 0,251,255, 0, 0,
+ 0, 0, 0,255, 0, 0, 0, 0, 86,128,194,255, 0, 0, 0,255, 0, 0, 0,255, 0, 0, 0,255, 0, 0, 0, 0, 0, 0, 0, 0,
+115,190, 76,255, 90,166, 51,255,240,235,100,255,215,211, 75,255,180, 0,255,255,153, 0,230,255, 0, 0, 0, 63, 0, 0, 0, 0,
+ 0, 0, 0, 25, 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, 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,130,130,130,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 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, 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,255,255,255,128, 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, 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, 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, 57, 57, 57,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0,255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,170, 64,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255, 32,255,255,255, 75, 75, 75,255,204, 0,153,255,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 32, 0, 0,255, 0, 32, 0,255, 0, 0,128,255, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255,255,255,255,255, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 1, 4, 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, 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,255,255,255,128, 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, 0,200,200,200,255, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,255, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 76, 76,255, 0, 0, 0, 0,250,250,250,255, 15, 15, 15,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+102,102,102,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+160,160,160,100,127,112,112,100,255,140, 25,255,250,250,250,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,130,130,130,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,250,250,250,255, 0, 0, 0, 0,250,250,250,255,250,250,250,255, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 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, 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, 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,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+102,102,102,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,255,255,255,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+150,150,150,100,112,112,112,100, 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 79,101, 73,255,135,177,125,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+153, 64, 48,255, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255,240,175,144,255, 82, 96,110,255,124,137,150,255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 4, 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, 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,255,255,255,128, 0, 0, 0,255,255,133, 0,255, 4, 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, 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, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 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, 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,255,255,255,128, 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, 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, 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,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+102,102,102,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,255,255,255,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+150,150,150,100,112,112,112,100, 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 79,101, 73,255,135,177,125,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 12, 10, 10,128,255,140, 0,255, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 0, 0, 0, 0, 82, 96,110,255,124,137,150,255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 4, 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, 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,255,255,255,128, 0, 0, 0,255,255,133, 0,255, 3, 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, 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, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+102,102,102,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,255,255,255,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+150,150,150,100,112,112,112,100, 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 79,101, 73,255,135,177,125,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 12, 10, 10,128,255,140, 0,255, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 0, 0, 0, 0, 82, 96,110,255,124,137,150,255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 4, 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, 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,255,255,255,128, 0, 0, 0,255,255,133, 0,255, 3, 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, 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, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,116,116,116,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81,105,135,255, 32, 32,143,255,109, 88,129,255, 78,152, 62,255, 46,143,143,255,
+169, 84,124,255,126,126, 80,255,162, 95,111,255,109,145,131,255,255,255,255,128, 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, 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, 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, 53, 53, 53,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+255,255,255, 10,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 3, 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, 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,255,255,255,128, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,114,114,114,255, 18, 66,176, 38,255,133, 0,178,255,133, 0,127, 0,255, 0,255,
+255, 0, 0,255,225,210,195, 35, 0, 0, 0, 0, 0, 0, 0, 0,153,153,153,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+143,143,143,255,198,119,119,255,255, 0, 0,255, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 0,100, 0, 0,255, 0, 0,200,255,
+128, 0, 80,255, 95, 95, 0,255, 0,100, 50,255, 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, 0, 0, 0, 0,255,255,255,128, 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, 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, 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,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 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, 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,255,255,255,128, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 51,127, 51, 76,130,135,140, 76,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+173,173,173,255,127,112,112,100, 0, 0, 0, 0, 91, 91, 91,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 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, 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,255,255,255,128, 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, 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, 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, 57, 57, 57,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,255,255,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 5,155,155,155,160,100,104,111,255,
+111,106,100,255,104,106,117,255,105,117,110,255, 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, 0, 0, 0, 0,255,255,255,128, 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, 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, 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,100,100,100,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 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, 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,255,255,255,128, 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, 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, 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,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 0, 4, 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, 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,255,255,255,128, 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, 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, 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,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,140, 25,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 0,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 96,128,255,255,255,255,255,255, 0,170, 0,255,220, 96, 96,255,220, 96, 96,255, 3, 0, 4, 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, 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,255,255,255,128, 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, 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, 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, 57, 57, 57,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,
+114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, 0, 0, 0,255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,170, 64,255, 8, 48, 8,255, 85,187, 85,255,255,255,255,255,
+ 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255, 32,255,255,255, 75, 75, 75,255,204, 0,153,255,
+ 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 32, 0, 0,255, 0, 32, 0,255, 0, 0,128,255, 0, 0, 0, 0, 34,221,221,255,
+ 35, 97,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255,144,144, 0,255,128, 48, 96,255,
+219, 37, 18,255,240,255, 64,255,240,144,160,255,255,255,255,255, 0, 0, 0,255,144,144, 0,255, 64,144, 48,255,128, 48, 96,255,
+ 0, 0, 0, 0, 0, 0, 0,255,240,255, 64,255, 64,192, 48,255,240,144,160,255, 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, 3, 1, 4, 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, 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,255,255,255,128, 0, 0, 0,255,255,255, 0,255, 4, 0, 0, 0,
+255,127,127, 0,255,255,255,255,255,255,255, 0,255,127, 0, 0,255,127,127,127,255,200,200,200,255,255, 0, 0,255, 0, 0,255,
+255, 0, 0, 0,255, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,154, 0, 0,255,189, 17, 17,255,247, 10, 10,255, 0, 0, 0, 0,
+247, 64, 24,255,246,105, 19,255,250,153, 0,255, 0, 0, 0, 0, 30,145, 9,255, 89,183, 11,255,131,239, 29,255, 0, 0, 0, 0,
+ 10, 54,148,255, 54,103,223,255, 94,193,239,255, 0, 0, 0, 0,169, 41, 78,255,193, 65,106,255,240, 93,145,255, 0, 0, 0, 0,
+ 67, 12,120,255, 84, 58,163,255,135,100,213,255, 0, 0, 0, 0, 36,120, 90,255, 60,149,121,255,111,182,171,255, 0, 0, 0, 0,
+ 75,112,124,255,106,134,145,255,155,194,205,255, 0, 0, 0, 0,244,201, 12,255,238,194, 54,255,243,255, 0,255, 0, 0, 0, 0,
+ 30, 32, 36,255, 72, 76, 86,255,255,255,255,255, 0, 0, 0, 0,111, 47,106,255,152, 69,190,255,211, 48,214,255, 0, 0, 0, 0,
+108,142, 34,255,127,176, 34,255,187,239, 91,255, 0, 0, 0, 0,141,141,141,255,176,176,176,255,222,222,222,255, 0, 0, 0, 0,
+131, 67, 38,255,139, 88, 17,255,189,106, 17,255, 0, 0, 0, 0, 8, 49, 14,255, 28, 67, 11,255, 52, 98, 43,255, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0,
+184,211,219, 3, 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0,136,212,219, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+105,111, 95,115, 99,101,110,101, 95, 51,100,115, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 80, 0, 0, 0,136,212,219, 3, 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0, 88,213,219, 3, 0, 0, 0, 0,
+184,211,219, 3, 0, 0, 0, 0,105,111, 95,115, 99,101,110,101, 95,102, 98,120, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0, 88,213,219, 3, 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0,
+ 40,214,219, 3, 0, 0, 0, 0,136,212,219, 3, 0, 0, 0, 0,105,111, 95, 97,110,105,109, 95, 98,118,104, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0, 40,214,219, 3, 0, 0, 0, 0,
+207, 0, 0, 0, 1, 0, 0, 0,248,214,219, 3, 0, 0, 0, 0, 88,213,219, 3, 0, 0, 0, 0,105,111, 95,109,101,115,104, 95,
+112,108,121, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0,
+248,214,219, 3, 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0,200,215,219, 3, 0, 0, 0, 0, 40,214,219, 3, 0, 0, 0, 0,
+105,111, 95,115, 99,101,110,101, 95,111, 98,106, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 80, 0, 0, 0,200,215,219, 3, 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0,152,216,219, 3, 0, 0, 0, 0,
+248,214,219, 3, 0, 0, 0, 0,105,111, 95,115, 99,101,110,101, 95,120, 51,100, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0,152,216,219, 3, 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0,
+104,217,219, 3, 0, 0, 0, 0,200,215,219, 3, 0, 0, 0, 0,105,111, 95,109,101,115,104, 95,115,116,108, 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, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0,104,217,219, 3, 0, 0, 0, 0,
+207, 0, 0, 0, 1, 0, 0, 0, 56,218,219, 3, 0, 0, 0, 0,152,216,219, 3, 0, 0, 0, 0,105,111, 95,109,101,115,104, 95,
+117,118, 95,108, 97,121,111,117,116, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0,
+ 56,218,219, 3, 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0, 8,219,219, 3, 0, 0, 0, 0,104,217,219, 3, 0, 0, 0, 0,
+105,111, 95, 99,117,114,118,101, 95,115,118,103, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 80, 0, 0, 0, 8,219,219, 3, 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 56,218,219, 3, 0, 0, 0, 0, 99,121, 99,108,101,115, 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, 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, 68, 65, 84, 65,232, 0, 0, 0,200,154,199, 3, 0, 0, 0, 0,199, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,101,102, 97,117,108,116, 32, 83,116,121,108,101, 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, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0,255,255, 0, 0,154,153, 25, 62, 0, 0,128, 63, 0, 0, 12, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0,255,255, 0, 0, 0, 0,128, 62, 0, 0, 0, 0, 0, 0, 11, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0,255,255, 0, 0,154,153, 25, 62, 0, 0,128, 63, 0, 0, 11, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 8, 0, 5, 0, 5, 0, 8, 0,
+ 2, 0, 8, 0, 4, 0, 0, 0, 68, 78, 65, 49,136, 4, 1, 0,200,254,218, 15, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 83, 68, 78, 65, 78, 65, 77, 69, 58, 13, 0, 0, 42,110,101,120,116, 0, 42,112,114,101,118, 0, 42,100, 97,116, 97, 0, 42,102,
+105,114,115,116, 0, 42,108, 97,115,116, 0,120, 0,121, 0,122, 0,120,109,105,110, 0,120,109, 97,120, 0,121,109,105,110, 0,
+121,109, 97,120, 0, 42,112,111,105,110,116,101,114, 0,103,114,111,117,112, 0,118, 97,108, 0,118, 97,108, 50, 0,116,121,112,
+101, 0,115,117, 98,116,121,112,101, 0,102,108, 97,103, 0,110, 97,109,101, 91, 54, 52, 93, 0,115, 97,118,101,100, 0,100, 97,
+116, 97, 0,108,101,110, 0,116,111,116, 97,108,108,101,110, 0, 42,110,101,119,105,100, 0, 42,108,105, 98, 0,110, 97,109,101,
+ 91, 54, 54, 93, 0,112, 97,100, 0,117,115, 0,105, 99,111,110, 95,105,100, 0,112, 97,100, 50, 0, 42,112,114,111,112,101,114,
+116,105,101,115, 0,105,100, 0, 42,105,100, 98,108,111, 99,107, 0, 42,102,105,108,101,100, 97,116, 97, 0,110, 97,109,101, 91,
+ 49, 48, 50, 52, 93, 0,102,105,108,101,112, 97,116,104, 91, 49, 48, 50, 52, 93, 0,116,111,116, 0, 42,112, 97,114,101,110,116,
+ 0,119, 91, 50, 93, 0,104, 91, 50, 93, 0, 99,104, 97,110,103,101,100, 91, 50, 93, 0, 99,104, 97,110,103,101,100, 95,116,105,
+109,101,115,116, 97,109,112, 91, 50, 93, 0, 42,114,101, 99,116, 91, 50, 93, 0, 42,111, 98, 0, 98,108,111, 99,107,116,121,112,
+101, 0, 97,100,114, 99,111,100,101, 0,110, 97,109,101, 91, 49, 50, 56, 93, 0, 42, 98,112, 0, 42, 98,101,122,116, 0,109, 97,
+120,114, 99,116, 0,116,111,116,114, 99,116, 0,118, 97,114,116,121,112,101, 0,116,111,116,118,101,114,116, 0,105,112,111, 0,
+101,120,116,114, 97,112, 0,114,116, 0, 98,105,116,109, 97,115,107, 0,115,108,105,100,101, 95,109,105,110, 0,115,108,105,100,
+101, 95,109, 97,120, 0, 99,117,114,118, 97,108, 0, 42,100,114,105,118,101,114, 0, 99,117,114,118,101, 0, 99,117,114, 0,115,
+104,111,119,107,101,121, 0,109,117,116,101,105,112,111, 0,112,111,115, 0,114,101,108, 97,116,105,118,101, 0,116,111,116,101,
+108,101,109, 0, 42,119,101,105,103,104,116,115, 0,118,103,114,111,117,112, 91, 54, 52, 93, 0,115,108,105,100,101,114,109,105,
+110, 0,115,108,105,100,101,114,109, 97,120, 0,117,105,100, 0,112, 97,100, 51, 0, 42, 97,100,116, 0, 42,114,101,102,107,101,
+121, 0,101,108,101,109,115,116,114, 91, 54, 52, 93, 0,101,108,101,109,115,105,122,101, 0, 98,108,111, 99,107, 0, 42,105,112,
+111, 0, 42,102,114,111,109, 0,116,111,116,107,101,121, 0,115,108,117,114,112,104, 0,117,105,100,103,101,110, 0, 42,108,105,
+110,101, 0, 42,102,111,114,109, 97,116, 0, 98,108,101,110, 0,108,105,110,101,110,111, 0,115,116, 97,114,116, 0,101,110,100,
+ 0,112, 97,100, 49, 0,102,108, 97,103,115, 0, 99,111,108,111,114, 91, 52, 93, 0,112, 97,100, 91, 52, 93, 0, 42,110, 97,109,
+101, 0,110,108,105,110,101,115, 0,108,105,110,101,115, 0, 42, 99,117,114,108, 0, 42,115,101,108,108, 0, 99,117,114, 99, 0,
+115,101,108, 99, 0,109, 97,114,107,101,114,115, 0, 42,117,110,100,111, 95, 98,117,102, 0,117,110,100,111, 95,112,111,115, 0,
+117,110,100,111, 95,108,101,110, 0, 42, 99,111,109,112,105,108,101,100, 0,109,116,105,109,101, 0,115,105,122,101, 0,115,101,
+101,107, 0,100,116,120, 0,112, 97,115,115,101,112, 97,114,116, 97,108,112,104, 97, 0, 99,108,105,112,115,116, 97, 0, 99,108,
+105,112,101,110,100, 0,108,101,110,115, 0,111,114,116,104,111, 95,115, 99, 97,108,101, 0,100,114, 97,119,115,105,122,101, 0,
+115,101,110,115,111,114, 95,120, 0,115,101,110,115,111,114, 95,121, 0,115,104,105,102,116,120, 0,115,104,105,102,116,121, 0,
+ 89, 70, 95,100,111,102,100,105,115,116, 0, 42,100,111,102, 95,111, 98, 0,115,101,110,115,111,114, 95,102,105,116, 0,112, 97,
+100, 91, 55, 93, 0, 42,115, 99,101,110,101, 0,102,114, 97,109,101,110,114, 0,102,114, 97,109,101,115, 0,111,102,102,115,101,
+116, 0,115,102,114, 97, 0,102,105,101, 95,105,109, 97, 0, 99,121, 99,108, 0,111,107, 0,109,117,108,116,105, 95,105,110,100,
+101,120, 0,108, 97,121,101,114, 0,112, 97,115,115, 0,105, 98,117,102,115, 0, 42,103,112,117,116,101,120,116,117,114,101, 0,
+ 42, 97,110,105,109, 0, 42,114,114, 0, 42,114,101,110,100,101,114,115, 91, 56, 93, 0,114,101,110,100,101,114, 95,115,108,111,
+116, 0,108, 97,115,116, 95,114,101,110,100,101,114, 95,115,108,111,116, 0,115,111,117,114, 99,101, 0,108, 97,115,116,102,114,
+ 97,109,101, 0,116,112, 97,103,101,102,108, 97,103, 0,116,111,116, 98,105,110,100, 0,120,114,101,112, 0,121,114,101,112, 0,
+116,119,115,116, 97, 0,116,119,101,110,100, 0, 98,105,110,100, 99,111,100,101, 0, 42,114,101,112, 98,105,110,100, 0, 42,112,
+ 97, 99,107,101,100,102,105,108,101, 0, 42,112,114,101,118,105,101,119, 0,108, 97,115,116,117,112,100, 97,116,101, 0,108, 97,
+115,116,117,115,101,100, 0, 97,110,105,109,115,112,101,101,100, 0,103,101,110, 95,120, 0,103,101,110, 95,121, 0,103,101,110,
+ 95,116,121,112,101, 0,103,101,110, 95,102,108, 97,103, 0, 97,115,112,120, 0, 97,115,112,121, 0,116,101,120, 99,111, 0,109,
+ 97,112,116,111, 0,109, 97,112,116,111,110,101,103, 0, 98,108,101,110,100,116,121,112,101, 0, 42,111, 98,106,101, 99,116, 0,
+ 42,116,101,120, 0,117,118,110, 97,109,101, 91, 54, 52, 93, 0,112,114,111,106,120, 0,112,114,111,106,121, 0,112,114,111,106,
+122, 0,109, 97,112,112,105,110,103, 0,111,102,115, 91, 51, 93, 0,115,105,122,101, 91, 51, 93, 0,114,111,116, 0,116,101,120,
+102,108, 97,103, 0, 99,111,108,111,114,109,111,100,101,108, 0,112,109, 97,112,116,111, 0,112,109, 97,112,116,111,110,101,103,
+ 0,110,111,114,109, 97,112,115,112, 97, 99,101, 0,119,104,105, 99,104, 95,111,117,116,112,117,116, 0, 98,114,117,115,104, 95,
+109, 97,112, 95,109,111,100,101, 0,114, 0,103, 0, 98, 0,107, 0,100,101,102, 95,118, 97,114, 0, 99,111,108,102, 97, 99, 0,
+118, 97,114,102, 97, 99, 0,110,111,114,102, 97, 99, 0,100,105,115,112,102, 97, 99, 0,119, 97,114,112,102, 97, 99, 0, 99,111,
+108,115,112,101, 99,102, 97, 99, 0,109,105,114,114,102, 97, 99, 0, 97,108,112,104, 97,102, 97, 99, 0,100,105,102,102,102, 97,
+ 99, 0,115,112,101, 99,102, 97, 99, 0,101,109,105,116,102, 97, 99, 0,104, 97,114,100,102, 97, 99, 0,114, 97,121,109,105,114,
+114,102, 97, 99, 0,116,114, 97,110,115,108,102, 97, 99, 0, 97,109, 98,102, 97, 99, 0, 99,111,108,101,109,105,116,102, 97, 99,
+ 0, 99,111,108,114,101,102,108,102, 97, 99, 0, 99,111,108,116,114, 97,110,115,102, 97, 99, 0,100,101,110,115,102, 97, 99, 0,
+115, 99, 97,116,116,101,114,102, 97, 99, 0,114,101,102,108,102, 97, 99, 0,116,105,109,101,102, 97, 99, 0,108,101,110,103,116,
+104,102, 97, 99, 0, 99,108,117,109,112,102, 97, 99, 0,100, 97,109,112,102, 97, 99, 0,107,105,110,107,102, 97, 99, 0,114,111,
+117,103,104,102, 97, 99, 0,112, 97,100,101,110,115,102, 97, 99, 0,103,114, 97,118,105,116,121,102, 97, 99, 0,108,105,102,101,
+102, 97, 99, 0,115,105,122,101,102, 97, 99, 0,105,118,101,108,102, 97, 99, 0,102,105,101,108,100,102, 97, 99, 0,115,104, 97,
+100,111,119,102, 97, 99, 0,122,101,110,117,112,102, 97, 99, 0,122,101,110,100,111,119,110,102, 97, 99, 0, 98,108,101,110,100,
+102, 97, 99, 0, 42,104, 97,110,100,108,101, 0, 42,112,110, 97,109,101, 0, 42,115,116,110, 97,109,101,115, 0,115,116,121,112,
+101,115, 0,118, 97,114,115, 0, 42,118, 97,114,115,116,114, 0, 42,114,101,115,117,108,116, 0, 42, 99,102,114, 97, 0,100, 97,
+116, 97, 91, 51, 50, 93, 0, 40, 42,100,111,105,116, 41, 40, 41, 0, 40, 42,105,110,115,116, 97,110, 99,101, 95,105,110,105,116,
+ 41, 40, 41, 0, 40, 42, 99, 97,108,108, 98, 97, 99,107, 41, 40, 41, 0,118,101,114,115,105,111,110, 0, 97, 0,105,112,111,116,
+121,112,101, 0, 42,105,109, 97, 0, 42, 99,117, 98,101, 91, 54, 93, 0,105,109, 97,116, 91, 52, 93, 91, 52, 93, 0,111, 98,105,
+109, 97,116, 91, 51, 93, 91, 51, 93, 0,115,116,121,112,101, 0,118,105,101,119,115, 99, 97,108,101, 0,110,111,116,108, 97,121,
+ 0, 99,117, 98,101,114,101,115, 0,100,101,112,116,104, 0,114,101, 99, 97,108, 99, 0,108, 97,115,116,115,105,122,101, 0,102,
+ 97,108,108,111,102,102, 95,116,121,112,101, 0,102, 97,108,108,111,102,102, 95,115,111,102,116,110,101,115,115, 0,114, 97,100,
+105,117,115, 0, 99,111,108,111,114, 95,115,111,117,114, 99,101, 0,116,111,116,112,111,105,110,116,115, 0,112,100,112, 97,100,
+ 0,112,115,121,115, 0,112,115,121,115, 95, 99, 97, 99,104,101, 95,115,112, 97, 99,101, 0,111, 98, 95, 99, 97, 99,104,101, 95,
+115,112, 97, 99,101, 0, 42,112,111,105,110,116, 95,116,114,101,101, 0, 42,112,111,105,110,116, 95,100, 97,116, 97, 0,110,111,
+105,115,101, 95,115,105,122,101, 0,110,111,105,115,101, 95,100,101,112,116,104, 0,110,111,105,115,101, 95,105,110,102,108,117,
+101,110, 99,101, 0,110,111,105,115,101, 95, 98, 97,115,105,115, 0,112,100,112, 97,100, 51, 91, 51, 93, 0,110,111,105,115,101,
+ 95,102, 97, 99, 0,115,112,101,101,100, 95,115, 99, 97,108,101, 0,102, 97,108,108,111,102,102, 95,115,112,101,101,100, 95,115,
+ 99, 97,108,101, 0,112,100,112, 97,100, 50, 0, 42, 99,111, 98, 97, 0, 42,102, 97,108,108,111,102,102, 95, 99,117,114,118,101,
+ 0,114,101,115,111,108, 91, 51, 93, 0,105,110,116,101,114,112, 95,116,121,112,101, 0,102,105,108,101, 95,102,111,114,109, 97,
+116, 0,101,120,116,101,110,100, 0,115,109,111,107,101,100, 95,116,121,112,101, 0,105,110,116, 95,109,117,108,116,105,112,108,
+105,101,114, 0,115,116,105,108,108, 95,102,114, 97,109,101, 0,115,111,117,114, 99,101, 95,112, 97,116,104, 91, 49, 48, 50, 52,
+ 93, 0, 42,100, 97,116, 97,115,101,116, 0, 99, 97, 99,104,101,100,102,114, 97,109,101, 0,111, 99,101, 97,110,109,111,100, 91,
+ 54, 52, 93, 0,111,117,116,112,117,116, 0,110,111,105,115,101,115,105,122,101, 0,116,117,114, 98,117,108, 0, 98,114,105,103,
+104,116, 0, 99,111,110,116,114, 97,115,116, 0,115, 97,116,117,114, 97,116,105,111,110, 0,114,102, 97, 99, 0,103,102, 97, 99,
+ 0, 98,102, 97, 99, 0,102,105,108,116,101,114,115,105,122,101, 0,109,103, 95, 72, 0,109,103, 95,108, 97, 99,117,110, 97,114,
+105,116,121, 0,109,103, 95,111, 99,116, 97,118,101,115, 0,109,103, 95,111,102,102,115,101,116, 0,109,103, 95,103, 97,105,110,
+ 0,100,105,115,116, 95, 97,109,111,117,110,116, 0,110,115, 95,111,117,116,115, 99, 97,108,101, 0,118,110, 95,119, 49, 0,118,
+110, 95,119, 50, 0,118,110, 95,119, 51, 0,118,110, 95,119, 52, 0,118,110, 95,109,101,120,112, 0,118,110, 95,100,105,115,116,
+109, 0,118,110, 95, 99,111,108,116,121,112,101, 0,110,111,105,115,101,100,101,112,116,104, 0,110,111,105,115,101,116,121,112,
+101, 0,110,111,105,115,101, 98, 97,115,105,115, 0,110,111,105,115,101, 98, 97,115,105,115, 50, 0,105,109, 97,102,108, 97,103,
+ 0, 99,114,111,112,120,109,105,110, 0, 99,114,111,112,121,109,105,110, 0, 99,114,111,112,120,109, 97,120, 0, 99,114,111,112,
+121,109, 97,120, 0,116,101,120,102,105,108,116,101,114, 0, 97,102,109, 97,120, 0,120,114,101,112,101, 97,116, 0,121,114,101,
+112,101, 97,116, 0, 99,104,101, 99,107,101,114,100,105,115,116, 0,110, 97, 98,108, 97, 0,105,117,115,101,114, 0, 42,110,111,
+100,101,116,114,101,101, 0, 42,112,108,117,103,105,110, 0, 42,101,110,118, 0, 42,112,100, 0, 42,118,100, 0, 42,111,116, 0,
+117,115,101, 95,110,111,100,101,115, 0,108,111, 99, 91, 51, 93, 0,114,111,116, 91, 51, 93, 0,109, 97,116, 91, 52, 93, 91, 52,
+ 93, 0,109,105,110, 91, 51, 93, 0,109, 97,120, 91, 51, 93, 0, 99,111, 98, 97, 0, 98,108,101,110,100, 95, 99,111,108,111,114,
+ 91, 51, 93, 0, 98,108,101,110,100, 95,102, 97, 99,116,111,114, 0, 98,108,101,110,100, 95,116,121,112,101, 0,112, 97,100, 91,
+ 51, 93, 0,109,111,100,101, 0,116,111,116,101,120, 0,115,104,100,119,114, 0,115,104,100,119,103, 0,115,104,100,119, 98, 0,
+115,104,100,119,112, 97,100, 0,101,110,101,114,103,121, 0,100,105,115,116, 0,115,112,111,116,115,105,122,101, 0,115,112,111,
+116, 98,108,101,110,100, 0,104, 97,105,110,116, 0, 97,116,116, 49, 0, 97,116,116, 50, 0, 42, 99,117,114,102, 97,108,108,111,
+102,102, 0,115,104, 97,100,115,112,111,116,115,105,122,101, 0, 98,105, 97,115, 0,115,111,102,116, 0, 99,111,109,112,114,101,
+115,115,116,104,114,101,115,104, 0,112, 97,100, 53, 91, 51, 93, 0, 98,117,102,115,105,122,101, 0,115, 97,109,112, 0, 98,117,
+102,102,101,114,115, 0,102,105,108,116,101,114,116,121,112,101, 0, 98,117,102,102,108, 97,103, 0, 98,117,102,116,121,112,101,
+ 0,114, 97,121, 95,115, 97,109,112, 0,114, 97,121, 95,115, 97,109,112,121, 0,114, 97,121, 95,115, 97,109,112,122, 0,114, 97,
+121, 95,115, 97,109,112, 95,116,121,112,101, 0, 97,114,101, 97, 95,115,104, 97,112,101, 0, 97,114,101, 97, 95,115,105,122,101,
+ 0, 97,114,101, 97, 95,115,105,122,101,121, 0, 97,114,101, 97, 95,115,105,122,101,122, 0, 97,100, 97,112,116, 95,116,104,114,
+101,115,104, 0,114, 97,121, 95,115, 97,109,112, 95,109,101,116,104,111,100, 0,116,101,120, 97, 99,116, 0,115,104, 97,100,104,
+ 97,108,111,115,116,101,112, 0,115,117,110, 95,101,102,102,101, 99,116, 95,116,121,112,101, 0,115,107,121, 98,108,101,110,100,
+116,121,112,101, 0,104,111,114,105,122,111,110, 95, 98,114,105,103,104,116,110,101,115,115, 0,115,112,114,101, 97,100, 0,115,
+117,110, 95, 98,114,105,103,104,116,110,101,115,115, 0,115,117,110, 95,115,105,122,101, 0, 98, 97, 99,107,115, 99, 97,116,116,
+101,114,101,100, 95,108,105,103,104,116, 0,115,117,110, 95,105,110,116,101,110,115,105,116,121, 0, 97,116,109, 95,116,117,114,
+ 98,105,100,105,116,121, 0, 97,116,109, 95,105,110,115, 99, 97,116,116,101,114,105,110,103, 95,102, 97, 99,116,111,114, 0, 97,
+116,109, 95,101,120,116,105,110, 99,116,105,111,110, 95,102, 97, 99,116,111,114, 0, 97,116,109, 95,100,105,115,116, 97,110, 99,
+101, 95,102, 97, 99,116,111,114, 0,115,107,121, 98,108,101,110,100,102, 97, 99, 0,115,107,121, 95,101,120,112,111,115,117,114,
+101, 0,115,107,121, 95, 99,111,108,111,114,115,112, 97, 99,101, 0,112, 97,100, 52, 91, 54, 93, 0, 42,109,116,101,120, 91, 49,
+ 56, 93, 0,112,114, 95,116,101,120,116,117,114,101, 0,112, 97,100, 54, 91, 52, 93, 0,100,101,110,115,105,116,121, 0,101,109,
+105,115,115,105,111,110, 0,115, 99, 97,116,116,101,114,105,110,103, 0,114,101,102,108,101, 99,116,105,111,110, 0,101,109,105,
+115,115,105,111,110, 95, 99,111,108, 91, 51, 93, 0,116,114, 97,110,115,109,105,115,115,105,111,110, 95, 99,111,108, 91, 51, 93,
+ 0,114,101,102,108,101, 99,116,105,111,110, 95, 99,111,108, 91, 51, 93, 0,100,101,110,115,105,116,121, 95,115, 99, 97,108,101,
+ 0,100,101,112,116,104, 95, 99,117,116,111,102,102, 0, 97,115,121,109,109,101,116,114,121, 0,115,116,101,112,115,105,122,101,
+ 95,116,121,112,101, 0,115,104, 97,100,101,102,108, 97,103, 0,115,104, 97,100,101, 95,116,121,112,101, 0,112,114,101, 99, 97,
+ 99,104,101, 95,114,101,115,111,108,117,116,105,111,110, 0,115,116,101,112,115,105,122,101, 0,109,115, 95,100,105,102,102, 0,
+109,115, 95,105,110,116,101,110,115,105,116,121, 0,109,115, 95,115,112,114,101, 97,100, 0, 97,108,112,104, 97, 95, 98,108,101,
+110,100, 0,102, 97, 99,101, 95,111,114,105,101,110,116, 97,116,105,111,110, 0,109, 97,116,101,114,105, 97,108, 95,116,121,112,
+101, 0,115,112,101, 99,114, 0,115,112,101, 99,103, 0,115,112,101, 99, 98, 0,109,105,114,114, 0,109,105,114,103, 0,109,105,
+114, 98, 0, 97,109, 98,114, 0, 97,109, 98, 98, 0, 97,109, 98,103, 0, 97,109, 98, 0,101,109,105,116, 0, 97,110,103, 0,115,
+112,101, 99,116,114, 97, 0,114, 97,121, 95,109,105,114,114,111,114, 0, 97,108,112,104, 97, 0,114,101,102, 0,115,112,101, 99,
+ 0,122,111,102,102,115, 0, 97,100,100, 0,116,114, 97,110,115,108,117, 99,101,110, 99,121, 0,118,111,108, 0,103, 97,109,101,
+ 0,102,114,101,115,110,101,108, 95,109,105,114, 0,102,114,101,115,110,101,108, 95,109,105,114, 95,105, 0,102,114,101,115,110,
+101,108, 95,116,114, 97, 0,102,114,101,115,110,101,108, 95,116,114, 97, 95,105, 0,102,105,108,116,101,114, 0,116,120, 95,108,
+105,109,105,116, 0,116,120, 95,102, 97,108,108,111,102,102, 0,114, 97,121, 95,100,101,112,116,104, 0,114, 97,121, 95,100,101,
+112,116,104, 95,116,114, 97, 0,104, 97,114, 0,115,101,101,100, 49, 0,115,101,101,100, 50, 0,103,108,111,115,115, 95,109,105,
+114, 0,103,108,111,115,115, 95,116,114, 97, 0,115, 97,109,112, 95,103,108,111,115,115, 95,109,105,114, 0,115, 97,109,112, 95,
+103,108,111,115,115, 95,116,114, 97, 0, 97,100, 97,112,116, 95,116,104,114,101,115,104, 95,109,105,114, 0, 97,100, 97,112,116,
+ 95,116,104,114,101,115,104, 95,116,114, 97, 0, 97,110,105,115,111, 95,103,108,111,115,115, 95,109,105,114, 0,100,105,115,116,
+ 95,109,105,114, 0,102, 97,100,101,116,111, 95,109,105,114, 0,115,104, 97,100,101, 95,102,108, 97,103, 0,109,111,100,101, 95,
+108, 0,102,108, 97,114,101, 99, 0,115,116, 97,114, 99, 0,108,105,110,101, 99, 0,114,105,110,103, 99, 0,104, 97,115,105,122,
+101, 0,102,108, 97,114,101,115,105,122,101, 0,115,117, 98,115,105,122,101, 0,102,108, 97,114,101, 98,111,111,115,116, 0,115,
+116,114, 97,110,100, 95,115,116, 97, 0,115,116,114, 97,110,100, 95,101,110,100, 0,115,116,114, 97,110,100, 95,101, 97,115,101,
+ 0,115,116,114, 97,110,100, 95,115,117,114,102,110,111,114, 0,115,116,114, 97,110,100, 95,109,105,110, 0,115,116,114, 97,110,
+100, 95,119,105,100,116,104,102, 97,100,101, 0,115,116,114, 97,110,100, 95,117,118,110, 97,109,101, 91, 54, 52, 93, 0,115, 98,
+105, 97,115, 0,108, 98,105, 97,115, 0,115,104, 97,100, 95, 97,108,112,104, 97, 0,115,101,112,116,101,120, 0,114,103, 98,115,
+101,108, 0,112,114, 95,116,121,112,101, 0,112,114, 95, 98, 97, 99,107, 0,112,114, 95,108, 97,109,112, 0,109,108, 95,102,108,
+ 97,103, 0,100,105,102,102, 95,115,104, 97,100,101,114, 0,115,112,101, 99, 95,115,104, 97,100,101,114, 0,114,111,117,103,104,
+110,101,115,115, 0,114,101,102,114, 97, 99, 0,112, 97,114, 97,109, 91, 52, 93, 0,114,109,115, 0,100, 97,114,107,110,101,115,
+115, 0, 42,114, 97,109,112, 95, 99,111,108, 0, 42,114, 97,109,112, 95,115,112,101, 99, 0,114, 97,109,112,105,110, 95, 99,111,
+108, 0,114, 97,109,112,105,110, 95,115,112,101, 99, 0,114, 97,109,112, 98,108,101,110,100, 95, 99,111,108, 0,114, 97,109,112,
+ 98,108,101,110,100, 95,115,112,101, 99, 0,114, 97,109,112, 95,115,104,111,119, 0,114, 97,109,112,102, 97, 99, 95, 99,111,108,
+ 0,114, 97,109,112,102, 97, 99, 95,115,112,101, 99, 0, 42,103,114,111,117,112, 0,102,114,105, 99,116,105,111,110, 0,102,104,
+ 0,114,101,102,108,101, 99,116, 0,102,104,100,105,115,116, 0,120,121,102,114,105, 99,116, 0,100,121,110, 97,109,111,100,101,
+ 0,115,115,115, 95,114, 97,100,105,117,115, 91, 51, 93, 0,115,115,115, 95, 99,111,108, 91, 51, 93, 0,115,115,115, 95,101,114,
+114,111,114, 0,115,115,115, 95,115, 99, 97,108,101, 0,115,115,115, 95,105,111,114, 0,115,115,115, 95, 99,111,108,102, 97, 99,
+ 0,115,115,115, 95,116,101,120,102, 97, 99, 0,115,115,115, 95,102,114,111,110,116, 0,115,115,115, 95, 98, 97, 99,107, 0,115,
+115,115, 95,102,108, 97,103, 0,115,115,115, 95,112,114,101,115,101,116, 0,109, 97,112,116,111, 95,116,101,120,116,117,114,101,
+100, 0,115,104, 97,100,111,119,111,110,108,121, 95,102,108, 97,103, 0,105,110,100,101,120, 0,103,112,117,109, 97,116,101,114,
+105, 97,108, 0, 42, 98, 98, 0,115,101,108, 99,111,108, 49, 0,115,101,108, 99,111,108, 50, 0,113,117, 97,116, 91, 52, 93, 0,
+101,120,112,120, 0,101,120,112,121, 0,101,120,112,122, 0,114, 97,100, 0,114, 97,100, 50, 0,115, 0, 42,109, 97,116, 0, 42,
+105,109, 97,116, 0,101,108,101,109,115, 0,100,105,115,112, 0, 42,101,100,105,116,101,108,101,109,115, 0, 42, 42,109, 97,116,
+ 0,102,108, 97,103, 50, 0,116,111,116, 99,111,108, 0,119,105,114,101,115,105,122,101, 0,114,101,110,100,101,114,115,105,122,
+101, 0,116,104,114,101,115,104, 0, 42,108, 97,115,116,101,108,101,109, 0,118,101, 99, 91, 51, 93, 91, 51, 93, 0, 97,108,102,
+ 97, 0,119,101,105,103,104,116, 0,104, 49, 0,104, 50, 0,102, 49, 0,102, 50, 0,102, 51, 0,104,105,100,101, 0,118,101, 99,
+ 91, 52, 93, 0,109, 97,116, 95,110,114, 0,112,110,116,115,117, 0,112,110,116,115,118, 0,114,101,115,111,108,117, 0,114,101,
+115,111,108,118, 0,111,114,100,101,114,117, 0,111,114,100,101,114,118, 0,102,108, 97,103,117, 0,102,108, 97,103,118, 0, 42,
+107,110,111,116,115,117, 0, 42,107,110,111,116,115,118, 0,116,105,108,116, 95,105,110,116,101,114,112, 0,114, 97,100,105,117,
+115, 95,105,110,116,101,114,112, 0, 99,104, 97,114,105,100,120, 0,107,101,114,110, 0,119, 0,104, 0,110,117,114, 98,115, 0,
+ 42,107,101,121,105,110,100,101,120, 0,115,104, 97,112,101,110,114, 0,110,117,114, 98, 0, 42,101,100,105,116,110,117,114, 98,
+ 0, 42, 98,101,118,111, 98,106, 0, 42,116, 97,112,101,114,111, 98,106, 0, 42,116,101,120,116,111,110, 99,117,114,118,101, 0,
+ 42,112, 97,116,104, 0, 42,107,101,121, 0, 98,101,118, 0,100,114, 97,119,102,108, 97,103, 0,116,119,105,115,116, 95,109,111,
+100,101, 0,116,119,105,115,116, 95,115,109,111,111,116,104, 0,115,109, 97,108,108, 99, 97,112,115, 95,115, 99, 97,108,101, 0,
+112, 97,116,104,108,101,110, 0, 98,101,118,114,101,115,111,108, 0,119,105,100,116,104, 0,101,120,116, 49, 0,101,120,116, 50,
+ 0,114,101,115,111,108,117, 95,114,101,110, 0,114,101,115,111,108,118, 95,114,101,110, 0, 97, 99,116,110,117, 0, 42,108, 97,
+115,116,115,101,108, 0,115,112, 97, 99,101,109,111,100,101, 0,115,112, 97, 99,105,110,103, 0,108,105,110,101,100,105,115,116,
+ 0,115,104,101, 97,114, 0,102,115,105,122,101, 0,119,111,114,100,115,112, 97, 99,101, 0,117,108,112,111,115, 0,117,108,104,
+101,105,103,104,116, 0,120,111,102, 0,121,111,102, 0,108,105,110,101,119,105,100,116,104, 0, 42,115,116,114, 0, 42,115,101,
+108, 98,111,120,101,115, 0, 42,101,100,105,116,102,111,110,116, 0,102, 97,109,105,108,121, 91, 50, 52, 93, 0, 42,118,102,111,
+110,116, 0, 42,118,102,111,110,116, 98, 0, 42,118,102,111,110,116,105, 0, 42,118,102,111,110,116, 98,105, 0,115,101,112, 99,
+104, 97,114, 0, 99,116,105,109,101, 0,116,111,116, 98,111,120, 0, 97, 99,116, 98,111,120, 0, 42,116, 98, 0,115,101,108,115,
+116, 97,114,116, 0,115,101,108,101,110,100, 0, 42,115,116,114,105,110,102,111, 0, 99,117,114,105,110,102,111, 0, 42,109,112,
+111,108,121, 0, 42,109,116,112,111,108,121, 0, 42,109,108,111,111,112, 0, 42,109,108,111,111,112,117,118, 0, 42,109,108,111,
+111,112, 99,111,108, 0, 42,109,102, 97, 99,101, 0, 42,109,116,102, 97, 99,101, 0, 42,116,102, 97, 99,101, 0, 42,109,118,101,
+114,116, 0, 42,109,101,100,103,101, 0, 42,100,118,101,114,116, 0, 42,109, 99,111,108, 0, 42,109,115,116,105, 99,107,121, 0,
+ 42,116,101,120, 99,111,109,101,115,104, 0, 42,109,115,101,108,101, 99,116, 0, 42,101,100,105,116, 95, 98,116,109,101,115,104,
+ 0,118,100, 97,116, 97, 0,101,100, 97,116, 97, 0,102,100, 97,116, 97, 0,112,100, 97,116, 97, 0,108,100, 97,116, 97, 0,116,
+111,116,101,100,103,101, 0,116,111,116,102, 97, 99,101, 0,116,111,116,115,101,108,101, 99,116, 0,116,111,116,112,111,108,121,
+ 0,116,111,116,108,111,111,112, 0, 97, 99,116, 95,102, 97, 99,101, 0,115,109,111,111,116,104,114,101,115,104, 0,115,117, 98,
+100,105,118, 0,115,117, 98,100,105,118,114, 0,115,117, 98,115,117,114,102,116,121,112,101, 0,101,100,105,116,102,108, 97,103,
+ 0, 42,109,114, 0, 42,116,112, 97,103,101, 0,117,118, 91, 52, 93, 91, 50, 93, 0, 99,111,108, 91, 52, 93, 0,116,114, 97,110,
+115,112, 0,116,105,108,101, 0,117,110,119,114, 97,112, 0,118, 49, 0,118, 50, 0,118, 51, 0,118, 52, 0,101,100, 99,111,100,
+101, 0, 99,114,101, 97,115,101, 0, 98,119,101,105,103,104,116, 0,100,101,102, 95,110,114, 0, 42,100,119, 0,116,111,116,119,
+101,105,103,104,116, 0, 99,111, 91, 51, 93, 0,110,111, 91, 51, 93, 0,108,111,111,112,115,116, 97,114,116, 0,118, 0,101, 0,
+117,118, 91, 50, 93, 0, 99,111, 91, 50, 93, 0,102, 0,105, 0,115, 91, 50, 53, 54, 93, 0,116,111,116,100,105,115,112, 0,108,
+101,118,101,108, 0, 40, 42,100,105,115,112,115, 41, 40, 41, 0, 42,104,105,100,100,101,110, 0,118, 91, 52, 93, 0,109,105,100,
+ 0,112, 97,100, 91, 50, 93, 0,118, 91, 50, 93, 0, 42,102, 97, 99,101,115, 0, 42, 99,111,108,102, 97, 99,101,115, 0, 42,101,
+100,103,101,115, 0, 42,118,101,114,116,115, 0,108,101,118,101,108,115, 0,108,101,118,101,108, 95, 99,111,117,110,116, 0, 99,
+117,114,114,101,110,116, 0,110,101,119,108,118,108, 0,101,100,103,101,108,118,108, 0,112,105,110,108,118,108, 0,114,101,110,
+100,101,114,108,118,108, 0,117,115,101, 95, 99,111,108, 0, 42,101,100,103,101, 95,102,108, 97,103,115, 0, 42,101,100,103,101,
+ 95, 99,114,101, 97,115,101,115, 0,115,116, 97, 99,107,105,110,100,101,120, 0, 42,101,114,114,111,114, 0,109,111,100,105,102,
+105,101,114, 0, 42,116,101,120,116,117,114,101, 0, 42,109, 97,112, 95,111, 98,106,101, 99,116, 0,117,118,108, 97,121,101,114,
+ 95,110, 97,109,101, 91, 54, 52, 93, 0,117,118,108, 97,121,101,114, 95,116,109,112, 0,116,101,120,109, 97,112,112,105,110,103,
+ 0,115,117, 98,100,105,118, 84,121,112,101, 0,114,101,110,100,101,114, 76,101,118,101,108,115, 0, 42,101,109, 67, 97, 99,104,
+101, 0, 42,109, 67, 97, 99,104,101, 0,115,116,114,101,110,103,116,104, 0,100,101,102, 97,120,105,115, 0,112, 97,100, 91, 54,
+ 93, 0,108,101,110,103,116,104, 0,114, 97,110,100,111,109,105,122,101, 0,115,101,101,100, 0, 42,111, 98, 95, 97,114,109, 0,
+ 42,115,116, 97,114,116, 95, 99, 97,112, 0, 42,101,110,100, 95, 99, 97,112, 0, 42, 99,117,114,118,101, 95,111, 98, 0, 42,111,
+102,102,115,101,116, 95,111, 98, 0,111,102,102,115,101,116, 91, 51, 93, 0,115, 99, 97,108,101, 91, 51, 93, 0,109,101,114,103,
+101, 95,100,105,115,116, 0,102,105,116, 95,116,121,112,101, 0,111,102,102,115,101,116, 95,116,121,112,101, 0, 99,111,117,110,
+116, 0, 97,120,105,115, 0,116,111,108,101,114, 97,110, 99,101, 0, 42,109,105,114,114,111,114, 95,111, 98, 0,115,112,108,105,
+116, 95, 97,110,103,108,101, 0,118, 97,108,117,101, 0,114,101,115, 0,118, 97,108, 95,102,108, 97,103,115, 0,108,105,109, 95,
+102,108, 97,103,115, 0,101, 95,102,108, 97,103,115, 0, 98,101,118,101,108, 95, 97,110,103,108,101, 0,100,101,102,103,114,112,
+ 95,110, 97,109,101, 91, 54, 52, 93, 0, 42,100,111,109, 97,105,110, 0, 42,102,108,111,119, 0, 42, 99,111,108,108, 0,116,105,
+109,101, 0,100,105,114,101, 99,116,105,111,110, 0,109,105,100,108,101,118,101,108, 0, 42,112,114,111,106,101, 99,116,111,114,
+115, 91, 49, 48, 93, 0, 42,105,109, 97,103,101, 0,110,117,109, 95,112,114,111,106,101, 99,116,111,114,115, 0, 97,115,112,101,
+ 99,116,120, 0, 97,115,112,101, 99,116,121, 0,115, 99, 97,108,101,120, 0,115, 99, 97,108,101,121, 0,112,101,114, 99,101,110,
+116, 0,102, 97, 99,101, 67,111,117,110,116, 0,102, 97, 99, 0,114,101,112,101, 97,116, 0, 42,111, 98,106,101, 99,116, 99,101,
+110,116,101,114, 0,115,116, 97,114,116,120, 0,115,116, 97,114,116,121, 0,104,101,105,103,104,116, 0,110, 97,114,114,111,119,
+ 0,115,112,101,101,100, 0,100, 97,109,112, 0,102, 97,108,108,111,102,102, 0,116,105,109,101,111,102,102,115, 0,108,105,102,
+101,116,105,109,101, 0,100,101,102,111,114,109,102,108, 97,103, 0,109,117,108,116,105, 0, 42,112,114,101,118, 67,111,115, 0,
+115,117, 98,116, 97,114,103,101,116, 91, 54, 52, 93, 0,112, 97,114,101,110,116,105,110,118, 91, 52, 93, 91, 52, 93, 0, 99,101,
+110,116, 91, 51, 93, 0, 42,105,110,100,101,120, 97,114, 0,116,111,116,105,110,100,101,120, 0,102,111,114, 99,101, 0, 42, 99,
+108,111,116,104, 79, 98,106,101, 99,116, 0, 42,115,105,109, 95,112, 97,114,109,115, 0, 42, 99,111,108,108, 95,112, 97,114,109,
+115, 0, 42,112,111,105,110,116, 95, 99, 97, 99,104,101, 0,112,116, 99, 97, 99,104,101,115, 0, 42,120, 0, 42,120,110,101,119,
+ 0, 42,120,111,108,100, 0, 42, 99,117,114,114,101,110,116, 95,120,110,101,119, 0, 42, 99,117,114,114,101,110,116, 95,120, 0,
+ 42, 99,117,114,114,101,110,116, 95,118, 0, 42,109,102, 97, 99,101,115, 0,110,117,109,118,101,114,116,115, 0,110,117,109,102,
+ 97, 99,101,115, 0,116,105,109,101, 95,120, 0,116,105,109,101, 95,120,110,101,119, 0, 42, 98,118,104,116,114,101,101, 0, 42,
+118, 0, 42,100,109, 0, 99,102,114, 97, 0,111,112,101,114, 97,116,105,111,110, 0,118,101,114,116,101,120, 0,116,111,116,105,
+110,102,108,117,101,110, 99,101, 0,103,114,105,100,115,105,122,101, 0, 42, 98,105,110,100,105,110,102,108,117,101,110, 99,101,
+115, 0, 42, 98,105,110,100,111,102,102,115,101,116,115, 0, 42, 98,105,110,100, 99, 97,103,101, 99,111,115, 0,116,111,116, 99,
+ 97,103,101,118,101,114,116, 0, 42,100,121,110,103,114,105,100, 0, 42,100,121,110,105,110,102,108,117,101,110, 99,101,115, 0,
+ 42,100,121,110,118,101,114,116,115, 0, 42,112, 97,100, 50, 0,100,121,110,103,114,105,100,115,105,122,101, 0,100,121,110, 99,
+101,108,108,109,105,110, 91, 51, 93, 0,100,121,110, 99,101,108,108,119,105,100,116,104, 0, 98,105,110,100,109, 97,116, 91, 52,
+ 93, 91, 52, 93, 0, 42, 98,105,110,100,119,101,105,103,104,116,115, 0, 42, 98,105,110,100, 99,111,115, 0, 40, 42, 98,105,110,
+100,102,117,110, 99, 41, 40, 41, 0, 42,112,115,121,115, 0,116,111,116,100,109,118,101,114,116, 0,116,111,116,100,109,101,100,
+103,101, 0,116,111,116,100,109,102, 97, 99,101, 0,112,111,115,105,116,105,111,110, 0,114, 97,110,100,111,109, 95,112,111,115,
+105,116,105,111,110, 0, 42,102, 97, 99,101,112, 97, 0,118,103,114,111,117,112, 0,112,114,111,116,101, 99,116, 0,108,118,108,
+ 0,115, 99,117,108,112,116,108,118,108, 0,116,111,116,108,118,108, 0,115,105,109,112,108,101, 0, 42,102,115,115, 0, 42,116,
+ 97,114,103,101,116, 0, 42, 97,117,120, 84, 97,114,103,101,116, 0,118,103,114,111,117,112, 95,110, 97,109,101, 91, 54, 52, 93,
+ 0,107,101,101,112, 68,105,115,116, 0,115,104,114,105,110,107, 84,121,112,101, 0,115,104,114,105,110,107, 79,112,116,115, 0,
+112,114,111,106, 65,120,105,115, 0,115,117, 98,115,117,114,102, 76,101,118,101,108,115, 0, 42,111,114,105,103,105,110, 0,102,
+ 97, 99,116,111,114, 0,108,105,109,105,116, 91, 50, 93, 0,111,114,105,103,105,110, 79,112,116,115, 0,111,102,102,115,101,116,
+ 95,102, 97, 99, 0,111,102,102,115,101,116, 95,102, 97, 99, 95,118,103, 0, 99,114,101, 97,115,101, 95,105,110,110,101,114, 0,
+ 99,114,101, 97,115,101, 95,111,117,116,101,114, 0, 99,114,101, 97,115,101, 95,114,105,109, 0,109, 97,116, 95,111,102,115, 0,
+109, 97,116, 95,111,102,115, 95,114,105,109, 0, 42,111, 98, 95, 97,120,105,115, 0,115,116,101,112,115, 0,114,101,110,100,101,
+114, 95,115,116,101,112,115, 0,105,116,101,114, 0,115, 99,114,101,119, 95,111,102,115, 0, 97,110,103,108,101, 0, 42,111, 99,
+101, 97,110, 0, 42,111, 99,101, 97,110, 99, 97, 99,104,101, 0,114,101,115,111,108,117,116,105,111,110, 0,115,112, 97,116,105,
+ 97,108, 95,115,105,122,101, 0,119,105,110,100, 95,118,101,108,111, 99,105,116,121, 0,115,109, 97,108,108,101,115,116, 95,119,
+ 97,118,101, 0,119, 97,118,101, 95, 97,108,105,103,110,109,101,110,116, 0,119, 97,118,101, 95,100,105,114,101, 99,116,105,111,
+110, 0,119, 97,118,101, 95,115, 99, 97,108,101, 0, 99,104,111,112, 95, 97,109,111,117,110,116, 0,102,111, 97,109, 95, 99,111,
+118,101,114, 97,103,101, 0, 98, 97,107,101,115,116, 97,114,116, 0, 98, 97,107,101,101,110,100, 0, 99, 97, 99,104,101,112, 97,
+116,104, 91, 49, 48, 50, 52, 93, 0,102,111, 97,109,108, 97,121,101,114,110, 97,109,101, 91, 54, 52, 93, 0, 99, 97, 99,104,101,
+100, 0,103,101,111,109,101,116,114,121, 95,109,111,100,101, 0,114,101,102,114,101,115,104, 0,114,101,112,101, 97,116, 95,120,
+ 0,114,101,112,101, 97,116, 95,121, 0,102,111, 97,109, 95,102, 97,100,101, 0, 42,111, 98,106,101, 99,116, 95,102,114,111,109,
+ 0, 42,111, 98,106,101, 99,116, 95,116,111, 0,102, 97,108,108,111,102,102, 95,114, 97,100,105,117,115, 0,101,100,105,116, 95,
+102,108, 97,103,115, 0,100,101,102, 97,117,108,116, 95,119,101,105,103,104,116, 0, 42, 99,109, 97,112, 95, 99,117,114,118,101,
+ 0, 97,100,100, 95,116,104,114,101,115,104,111,108,100, 0,114,101,109, 95,116,104,114,101,115,104,111,108,100, 0,109, 97,115,
+107, 95, 99,111,110,115,116, 97,110,116, 0,109, 97,115,107, 95,100,101,102,103,114,112, 95,110, 97,109,101, 91, 54, 52, 93, 0,
+109, 97,115,107, 95,116,101,120, 95,117,115,101, 95, 99,104, 97,110,110,101,108, 0, 42,109, 97,115,107, 95,116,101,120,116,117,
+114,101, 0, 42,109, 97,115,107, 95,116,101,120, 95,109, 97,112, 95,111, 98,106, 0,109, 97,115,107, 95,116,101,120, 95,109, 97,
+112,112,105,110,103, 0,109, 97,115,107, 95,116,101,120, 95,117,118,108, 97,121,101,114, 95,110, 97,109,101, 91, 54, 52, 93, 0,
+112, 97,100, 95,105, 49, 0,100,101,102,103,114,112, 95,110, 97,109,101, 95, 97, 91, 54, 52, 93, 0,100,101,102,103,114,112, 95,
+110, 97,109,101, 95, 98, 91, 54, 52, 93, 0,100,101,102, 97,117,108,116, 95,119,101,105,103,104,116, 95, 97, 0,100,101,102, 97,
+117,108,116, 95,119,101,105,103,104,116, 95, 98, 0,109,105,120, 95,109,111,100,101, 0,109,105,120, 95,115,101,116, 0,112, 97,
+100, 95, 99, 49, 91, 54, 93, 0,112,114,111,120,105,109,105,116,121, 95,109,111,100,101, 0,112,114,111,120,105,109,105,116,121,
+ 95,102,108, 97,103,115, 0, 42,112,114,111,120,105,109,105,116,121, 95,111, 98, 95,116, 97,114,103,101,116, 0,109,105,110, 95,
+100,105,115,116, 0,109, 97,120, 95,100,105,115,116, 0,112, 97,100, 95,115, 49, 0, 42, 99, 97,110,118, 97,115, 0, 42, 98,114,
+117,115,104, 0,116,104,114,101,115,104,111,108,100, 0,115, 99, 97,108,101, 0,104,101,114,109,105,116,101, 95,110,117,109, 0,
+ 42,108, 97,116,116, 0,112,110,116,115,119, 0,111,112,110,116,115,117, 0,111,112,110,116,115,118, 0,111,112,110,116,115,119,
+ 0,116,121,112,101,117, 0,116,121,112,101,118, 0,116,121,112,101,119, 0,102,117, 0,102,118, 0,102,119, 0,100,117, 0,100,
+118, 0,100,119, 0, 42,100,101,102, 0, 42,108, 97,116,116,105, 99,101,100, 97,116, 97, 0,108, 97,116,109, 97,116, 91, 52, 93,
+ 91, 52, 93, 0, 42,101,100,105,116,108, 97,116,116, 0,118,101, 99, 91, 56, 93, 91, 51, 93, 0, 42,115, 99,117,108,112,116, 0,
+112, 97,114,116,121,112,101, 0,112, 97,114, 49, 0,112, 97,114, 50, 0,112, 97,114, 51, 0,112, 97,114,115,117, 98,115,116,114,
+ 91, 54, 52, 93, 0, 42,116,114, 97, 99,107, 0, 42,112,114,111,120,121, 0, 42,112,114,111,120,121, 95,103,114,111,117,112, 0,
+ 42,112,114,111,120,121, 95,102,114,111,109, 0, 42, 97, 99,116,105,111,110, 0, 42,112,111,115,101,108,105, 98, 0, 42,112,111,
+115,101, 0, 42,103,112,100, 0, 97,118,115, 0, 42,109,112, 97,116,104, 0, 99,111,110,115,116,114, 97,105,110,116, 67,104, 97,
+110,110,101,108,115, 0,101,102,102,101, 99,116, 0,100,101,102, 98, 97,115,101, 0,109,111,100,105,102,105,101,114,115, 0,114,
+101,115,116,111,114,101, 95,109,111,100,101, 0, 42,109, 97,116, 98,105,116,115, 0, 97, 99,116, 99,111,108, 0,100,108,111, 99,
+ 91, 51, 93, 0,111,114,105,103, 91, 51, 93, 0,100,115,105,122,101, 91, 51, 93, 0,100,115, 99, 97,108,101, 91, 51, 93, 0,100,
+114,111,116, 91, 51, 93, 0,100,113,117, 97,116, 91, 52, 93, 0,114,111,116, 65,120,105,115, 91, 51, 93, 0,100,114,111,116, 65,
+120,105,115, 91, 51, 93, 0,114,111,116, 65,110,103,108,101, 0,100,114,111,116, 65,110,103,108,101, 0,111, 98,109, 97,116, 91,
+ 52, 93, 91, 52, 93, 0, 99,111,110,115,116,105,110,118, 91, 52, 93, 91, 52, 93, 0,105,109, 97,116, 95,114,101,110, 91, 52, 93,
+ 91, 52, 93, 0,108, 97,121, 0,112, 97,100, 54, 0, 99,111,108, 98,105,116,115, 0,116,114, 97,110,115,102,108, 97,103, 0,112,
+114,111,116,101, 99,116,102,108, 97,103, 0,116,114, 97, 99,107,102,108, 97,103, 0,117,112,102,108, 97,103, 0,110,108, 97,102,
+108, 97,103, 0,105,112,111,102,108, 97,103, 0,115, 99, 97,102,108, 97,103, 0,115, 99, 97,118,105,115,102,108, 97,103, 0,112,
+ 97,100, 53, 0,100,117,112,111,110, 0,100,117,112,111,102,102, 0,100,117,112,115,116, 97, 0,100,117,112,101,110,100, 0,115,
+102, 0,109, 97,115,115, 0,100, 97,109,112,105,110,103, 0,105,110,101,114,116,105, 97, 0,102,111,114,109,102, 97, 99,116,111,
+114, 0,114,100, 97,109,112,105,110,103, 0,109, 97,114,103,105,110, 0,109, 97,120, 95,118,101,108, 0,109,105,110, 95,118,101,
+108, 0,109, 95, 99,111,110,116, 97, 99,116, 80,114,111, 99,101,115,115,105,110,103, 84,104,114,101,115,104,111,108,100, 0,111,
+ 98,115,116, 97, 99,108,101, 82, 97,100, 0,114,111,116,109,111,100,101, 0, 98,111,117,110,100,116,121,112,101, 0, 99,111,108,
+108,105,115,105,111,110, 95, 98,111,117,110,100,116,121,112,101, 0,114,101,115,116,114,105, 99,116,102,108, 97,103, 0,100,116,
+ 0,101,109,112,116,121, 95,100,114, 97,119,116,121,112,101, 0,101,109,112,116,121, 95,100,114, 97,119,115,105,122,101, 0,100,
+117,112,102, 97, 99,101,115, 99, 97, 0,112,114,111,112, 0,115,101,110,115,111,114,115, 0, 99,111,110,116,114,111,108,108,101,
+114,115, 0, 97, 99,116,117, 97,116,111,114,115, 0, 98, 98,115,105,122,101, 91, 51, 93, 0, 97, 99,116,100,101,102, 0,103, 97,
+109,101,102,108, 97,103, 0,103, 97,109,101,102,108, 97,103, 50, 0, 42, 98,115,111,102,116, 0,115,111,102,116,102,108, 97,103,
+ 0, 97,110,105,115,111,116,114,111,112,105, 99, 70,114,105, 99,116,105,111,110, 91, 51, 93, 0, 99,111,110,115,116,114, 97,105,
+110,116,115, 0,110,108, 97,115,116,114,105,112,115, 0,104,111,111,107,115, 0,112, 97,114,116,105, 99,108,101,115,121,115,116,
+101,109, 0, 42,115,111,102,116, 0, 42,100,117,112, 95,103,114,111,117,112, 0, 98,111,100,121, 95,116,121,112,101, 0,115,104,
+ 97,112,101,102,108, 97,103, 0, 42,102,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 42,100,101,114,105,118,
+101,100, 68,101,102,111,114,109, 0, 42,100,101,114,105,118,101,100, 70,105,110, 97,108, 0,108, 97,115,116, 68, 97,116, 97, 77,
+ 97,115,107, 0, 99,117,115,116,111,109,100, 97,116, 97, 95,109, 97,115,107, 0,115,116, 97,116,101, 0,105,110,105,116, 95,115,
+116, 97,116,101, 0,103,112,117,108, 97,109,112, 0,112, 99, 95,105,100,115, 0, 42,100,117,112,108,105,108,105,115,116, 0,105,
+109, 97, 95,111,102,115, 91, 50, 93, 0, 99,117,114,105,110,100,101,120, 0, 97, 99,116,105,118,101, 0,111,114,105,103,108, 97,
+121, 0,111,109, 97,116, 91, 52, 93, 91, 52, 93, 0,111,114, 99,111, 91, 51, 93, 0,110,111, 95,100,114, 97,119, 0, 97,110,105,
+109, 97,116,101,100, 0,100,101,102,108,101, 99,116, 0,102,111,114, 99,101,102,105,101,108,100, 0,115,104, 97,112,101, 0,116,
+101,120, 95,109,111,100,101, 0,107,105,110,107, 0,107,105,110,107, 95, 97,120,105,115, 0,122,100,105,114, 0,102, 95,115,116,
+114,101,110,103,116,104, 0,102, 95,100, 97,109,112, 0,102, 95,102,108,111,119, 0,102, 95,115,105,122,101, 0,102, 95,112,111,
+119,101,114, 0,109, 97,120,100,105,115,116, 0,109,105,110,100,105,115,116, 0,102, 95,112,111,119,101,114, 95,114, 0,109, 97,
+120,114, 97,100, 0,109,105,110,114, 97,100, 0,112,100,101,102, 95,100, 97,109,112, 0,112,100,101,102, 95,114,100, 97,109,112,
+ 0,112,100,101,102, 95,112,101,114,109, 0,112,100,101,102, 95,102,114,105, 99,116, 0,112,100,101,102, 95,114,102,114,105, 99,
+116, 0,112,100,101,102, 95,115,116,105, 99,107,110,101,115,115, 0, 97, 98,115,111,114,112,116,105,111,110, 0,112,100,101,102,
+ 95,115, 98,100, 97,109,112, 0,112,100,101,102, 95,115, 98,105,102,116, 0,112,100,101,102, 95,115, 98,111,102,116, 0, 99,108,
+117,109,112, 95,102, 97, 99, 0, 99,108,117,109,112, 95,112,111,119, 0,107,105,110,107, 95,102,114,101,113, 0,107,105,110,107,
+ 95,115,104, 97,112,101, 0,107,105,110,107, 95, 97,109,112, 0,102,114,101,101, 95,101,110,100, 0,116,101,120, 95,110, 97, 98,
+108, 97, 0, 42,114,110,103, 0,102, 95,110,111,105,115,101, 0,119,101,105,103,104,116, 91, 49, 51, 93, 0,103,108,111, 98, 97,
+108, 95,103,114, 97,118,105,116,121, 0,114,116, 91, 51, 93, 0,116,111,116,100, 97,116, 97, 0,102,114, 97,109,101, 0,116,111,
+116,112,111,105,110,116, 0,100, 97,116, 97, 95,116,121,112,101,115, 0, 42,100, 97,116, 97, 91, 56, 93, 0, 42, 99,117,114, 91,
+ 56, 93, 0,101,120,116,114, 97,100, 97,116, 97, 0,115,116,101,112, 0,115,105,109,102,114, 97,109,101, 0,115,116, 97,114,116,
+102,114, 97,109,101, 0,101,110,100,102,114, 97,109,101, 0,101,100,105,116,102,114, 97,109,101, 0,108, 97,115,116, 95,101,120,
+ 97, 99,116, 0,108, 97,115,116, 95,118, 97,108,105,100, 0, 99,111,109,112,114,101,115,115,105,111,110, 0,112,114,101,118, 95,
+110, 97,109,101, 91, 54, 52, 93, 0,105,110,102,111, 91, 54, 52, 93, 0,112, 97,116,104, 91, 49, 48, 50, 52, 93, 0, 42, 99, 97,
+ 99,104,101,100, 95,102,114, 97,109,101,115, 0,109,101,109, 95, 99, 97, 99,104,101, 0, 42,101,100,105,116, 0, 40, 42,102,114,
+101,101, 95,101,100,105,116, 41, 40, 41, 0,108,105,110, 83,116,105,102,102, 0, 97,110,103, 83,116,105,102,102, 0,118,111,108,
+117,109,101, 0,118,105,116,101,114, 97,116,105,111,110,115, 0,112,105,116,101,114, 97,116,105,111,110,115, 0,100,105,116,101,
+114, 97,116,105,111,110,115, 0, 99,105,116,101,114, 97,116,105,111,110,115, 0,107, 83, 82, 72, 82, 95, 67, 76, 0,107, 83, 75,
+ 72, 82, 95, 67, 76, 0,107, 83, 83, 72, 82, 95, 67, 76, 0,107, 83, 82, 95, 83, 80, 76, 84, 95, 67, 76, 0,107, 83, 75, 95, 83,
+ 80, 76, 84, 95, 67, 76, 0,107, 83, 83, 95, 83, 80, 76, 84, 95, 67, 76, 0,107, 86, 67, 70, 0,107, 68, 80, 0,107, 68, 71, 0,
+107, 76, 70, 0,107, 80, 82, 0,107, 86, 67, 0,107, 68, 70, 0,107, 77, 84, 0,107, 67, 72, 82, 0,107, 75, 72, 82, 0,107, 83,
+ 72, 82, 0,107, 65, 72, 82, 0, 99,111,108,108,105,115,105,111,110,102,108, 97,103,115, 0,110,117,109, 99,108,117,115,116,101,
+114,105,116,101,114, 97,116,105,111,110,115, 0,119,101,108,100,105,110,103, 0,116,111,116,115,112,114,105,110,103, 0, 42, 98,
+112,111,105,110,116, 0, 42, 98,115,112,114,105,110,103, 0,109,115,103, 95,108,111, 99,107, 0,109,115,103, 95,118, 97,108,117,
+101, 0,110,111,100,101,109, 97,115,115, 0,110, 97,109,101,100, 86, 71, 95, 77, 97,115,115, 91, 54, 52, 93, 0,103,114, 97,118,
+ 0,109,101,100,105, 97,102,114,105, 99,116, 0,114,107,108,105,109,105,116, 0,112,104,121,115,105, 99,115, 95,115,112,101,101,
+100, 0,103,111, 97,108,115,112,114,105,110,103, 0,103,111, 97,108,102,114,105, 99,116, 0,109,105,110,103,111, 97,108, 0,109,
+ 97,120,103,111, 97,108, 0,100,101,102,103,111, 97,108, 0,118,101,114,116,103,114,111,117,112, 0,110, 97,109,101,100, 86, 71,
+ 95, 83,111,102,116,103,111, 97,108, 91, 54, 52, 93, 0,102,117,122,122,121,110,101,115,115, 0,105,110,115,112,114,105,110,103,
+ 0,105,110,102,114,105, 99,116, 0,110, 97,109,101,100, 86, 71, 95, 83,112,114,105,110,103, 95, 75, 91, 54, 52, 93, 0,101,102,
+114, 97, 0,105,110,116,101,114,118, 97,108, 0,108,111, 99, 97,108, 0,115,111,108,118,101,114,102,108, 97,103,115, 0, 42, 42,
+107,101,121,115, 0,116,111,116,112,111,105,110,116,107,101,121, 0,115,101, 99,111,110,100,115,112,114,105,110,103, 0, 99,111,
+108, 98, 97,108,108, 0, 98, 97,108,108,100, 97,109,112, 0, 98, 97,108,108,115,116,105,102,102, 0,115, 98, 99, 95,109,111,100,
+101, 0, 97,101,114,111,101,100,103,101, 0,109,105,110,108,111,111,112,115, 0,109, 97,120,108,111,111,112,115, 0, 99,104,111,
+107,101, 0,115,111,108,118,101,114, 95, 73, 68, 0,112,108, 97,115,116,105, 99, 0,115,112,114,105,110,103,112,114,101,108,111,
+ 97,100, 0, 42,115, 99,114, 97,116, 99,104, 0,115,104,101, 97,114,115,116,105,102,102, 0,105,110,112,117,115,104, 0, 42,112,
+111,105,110,116, 99, 97, 99,104,101, 0, 42,101,102,102,101, 99,116,111,114, 95,119,101,105,103,104,116,115, 0,108, 99,111,109,
+ 91, 51, 93, 0,108,114,111,116, 91, 51, 93, 91, 51, 93, 0,108,115, 99, 97,108,101, 91, 51, 93, 91, 51, 93, 0,108, 97,115,116,
+ 95,102,114, 97,109,101, 0,118,101,108, 91, 51, 93, 0, 42,102,109,100, 0,115,104,111,119, 95, 97,100,118, 97,110, 99,101,100,
+111,112,116,105,111,110,115, 0,114,101,115,111,108,117,116,105,111,110,120,121,122, 0,112,114,101,118,105,101,119,114,101,115,
+120,121,122, 0,114,101, 97,108,115,105,122,101, 0,103,117,105, 68,105,115,112,108, 97,121, 77,111,100,101, 0,114,101,110,100,
+101,114, 68,105,115,112,108, 97,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 86, 97,108,117,101, 0,118,105,115,
+ 99,111,115,105,116,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 69,120,112,111,110,101,110,116, 0,103,114, 97,
+118, 91, 51, 93, 0, 97,110,105,109, 83,116, 97,114,116, 0, 97,110,105,109, 69,110,100, 0, 98, 97,107,101, 83,116, 97,114,116,
+ 0, 98, 97,107,101, 69,110,100, 0,102,114, 97,109,101, 79,102,102,115,101,116, 0,103,115,116, 97,114, 0,109, 97,120, 82,101,
+102,105,110,101, 0,105,110,105, 86,101,108,120, 0,105,110,105, 86,101,108,121, 0,105,110,105, 86,101,108,122, 0, 42,111,114,
+103, 77,101,115,104, 0, 42,109,101,115,104, 66, 66, 0,115,117,114,102,100, 97,116, 97, 80, 97,116,104, 91, 49, 48, 50, 52, 93,
+ 0, 98, 98, 83,116, 97,114,116, 91, 51, 93, 0, 98, 98, 83,105,122,101, 91, 51, 93, 0,116,121,112,101, 70,108, 97,103,115, 0,
+100,111,109, 97,105,110, 78,111,118,101, 99,103,101,110, 0,118,111,108,117,109,101, 73,110,105,116, 84,121,112,101, 0,112, 97,
+114,116, 83,108,105,112, 86, 97,108,117,101, 0,103,101,110,101,114, 97,116,101, 84,114, 97, 99,101,114,115, 0,103,101,110,101,
+114, 97,116,101, 80, 97,114,116,105, 99,108,101,115, 0,115,117,114,102, 97, 99,101, 83,109,111,111,116,104,105,110,103, 0,115,
+117,114,102, 97, 99,101, 83,117, 98,100,105,118,115, 0,112, 97,114,116,105, 99,108,101, 73,110,102, 83,105,122,101, 0,112, 97,
+114,116,105, 99,108,101, 73,110,102, 65,108,112,104, 97, 0,102, 97,114, 70,105,101,108,100, 83,105,122,101, 0, 42,109,101,115,
+104, 86,101,108,111, 99,105,116,105,101,115, 0, 99,112,115, 84,105,109,101, 83,116, 97,114,116, 0, 99,112,115, 84,105,109,101,
+ 69,110,100, 0, 99,112,115, 81,117, 97,108,105,116,121, 0, 97,116,116,114, 97, 99,116,102,111,114, 99,101, 83,116,114,101,110,
+103,116,104, 0, 97,116,116,114, 97, 99,116,102,111,114, 99,101, 82, 97,100,105,117,115, 0,118,101,108,111, 99,105,116,121,102,
+111,114, 99,101, 83,116,114,101,110,103,116,104, 0,118,101,108,111, 99,105,116,121,102,111,114, 99,101, 82, 97,100,105,117,115,
+ 0,108, 97,115,116,103,111,111,100,102,114, 97,109,101, 0, 97,110,105,109, 82, 97,116,101, 0,109,105,115,116,121,112,101, 0,
+104,111,114,114, 0,104,111,114,103, 0,104,111,114, 98, 0,122,101,110,114, 0,122,101,110,103, 0,122,101,110, 98, 0,102, 97,
+115,116, 99,111,108, 0,101,120,112,111,115,117,114,101, 0,101,120,112, 0,114, 97,110,103,101, 0,108,105,110,102, 97, 99, 0,
+108,111,103,102, 97, 99, 0,103,114, 97,118,105,116,121, 0, 97, 99,116,105,118,105,116,121, 66,111,120, 82, 97,100,105,117,115,
+ 0,115,107,121,116,121,112,101, 0,111, 99, 99,108,117,115,105,111,110, 82,101,115, 0,112,104,121,115,105, 99,115, 69,110,103,
+105,110,101, 0,116,105, 99,114, 97,116,101, 0,109, 97,120,108,111,103,105, 99,115,116,101,112, 0,112,104,121,115,117, 98,115,
+116,101,112, 0,109, 97,120,112,104,121,115,116,101,112, 0,109,105,115,105, 0,109,105,115,116,115,116, 97, 0,109,105,115,116,
+100,105,115,116, 0,109,105,115,116,104,105, 0,115,116, 97,114,114, 0,115,116, 97,114,103, 0,115,116, 97,114, 98, 0,115,116,
+ 97,114,107, 0,115,116, 97,114,115,105,122,101, 0,115,116, 97,114,109,105,110,100,105,115,116, 0,115,116, 97,114,100,105,115,
+116, 0,115,116, 97,114, 99,111,108,110,111,105,115,101, 0,100,111,102,115,116, 97, 0,100,111,102,101,110,100, 0,100,111,102,
+109,105,110, 0,100,111,102,109, 97,120, 0, 97,111,100,105,115,116, 0, 97,111,100,105,115,116,102, 97, 99, 0, 97,111,101,110,
+101,114,103,121, 0, 97,111, 98,105, 97,115, 0, 97,111,109,111,100,101, 0, 97,111,115, 97,109,112, 0, 97,111,109,105,120, 0,
+ 97,111, 99,111,108,111,114, 0, 97,111, 95, 97,100, 97,112,116, 95,116,104,114,101,115,104, 0, 97,111, 95, 97,100, 97,112,116,
+ 95,115,112,101,101,100, 95,102, 97, 99, 0, 97,111, 95, 97,112,112,114,111,120, 95,101,114,114,111,114, 0, 97,111, 95, 97,112,
+112,114,111,120, 95, 99,111,114,114,101, 99,116,105,111,110, 0, 97,111, 95,105,110,100,105,114,101, 99,116, 95,101,110,101,114,
+103,121, 0, 97,111, 95,101,110,118, 95,101,110,101,114,103,121, 0, 97,111, 95,112, 97,100, 50, 0, 97,111, 95,105,110,100,105,
+114,101, 99,116, 95, 98,111,117,110, 99,101,115, 0, 97,111, 95,112, 97,100, 0, 97,111, 95,115, 97,109,112, 95,109,101,116,104,
+111,100, 0, 97,111, 95,103, 97,116,104,101,114, 95,109,101,116,104,111,100, 0, 97,111, 95, 97,112,112,114,111,120, 95,112, 97,
+115,115,101,115, 0, 42, 97,111,115,112,104,101,114,101, 0, 42, 97,111,116, 97, 98,108,101,115, 0,115,101,108, 99,111,108, 0,
+115,120, 0,115,121, 0, 42,108,112, 70,111,114,109, 97,116, 0, 42,108,112, 80, 97,114,109,115, 0, 99, 98, 70,111,114,109, 97,
+116, 0, 99, 98, 80, 97,114,109,115, 0,102, 99, 99, 84,121,112,101, 0,102, 99, 99, 72, 97,110,100,108,101,114, 0,100,119, 75,
+101,121, 70,114, 97,109,101, 69,118,101,114,121, 0,100,119, 81,117, 97,108,105,116,121, 0,100,119, 66,121,116,101,115, 80,101,
+114, 83,101, 99,111,110,100, 0,100,119, 70,108, 97,103,115, 0,100,119, 73,110,116,101,114,108,101, 97,118,101, 69,118,101,114,
+121, 0, 97,118,105, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0, 42, 99,100, 80, 97,114,109,115, 0, 42,112, 97,
+100, 0, 99,100, 83,105,122,101, 0,113,116, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0, 99,111,100,101, 99, 84,
+121,112,101, 0, 99,111,100,101, 99, 83,112, 97,116,105, 97,108, 81,117, 97,108,105,116,121, 0, 99,111,100,101, 99, 0, 99,111,
+100,101, 99, 70,108, 97,103,115, 0, 99,111,108,111,114, 68,101,112,116,104, 0, 99,111,100,101, 99, 84,101,109,112,111,114, 97,
+108, 81,117, 97,108,105,116,121, 0,109,105,110, 83,112, 97,116,105, 97,108, 81,117, 97,108,105,116,121, 0,109,105,110, 84,101,
+109,112,111,114, 97,108, 81,117, 97,108,105,116,121, 0,107,101,121, 70,114, 97,109,101, 82, 97,116,101, 0, 98,105,116, 82, 97,
+116,101, 0, 97,117,100,105,111, 99,111,100,101, 99, 84,121,112,101, 0, 97,117,100,105,111, 83, 97,109,112,108,101, 82, 97,116,
+101, 0, 97,117,100,105,111, 66,105,116, 68,101,112,116,104, 0, 97,117,100,105,111, 67,104, 97,110,110,101,108,115, 0, 97,117,
+100,105,111, 67,111,100,101, 99, 70,108, 97,103,115, 0, 97,117,100,105,111, 66,105,116, 82, 97,116,101, 0, 97,117,100,105,111,
+ 95, 99,111,100,101, 99, 0,118,105,100,101,111, 95, 98,105,116,114, 97,116,101, 0, 97,117,100,105,111, 95, 98,105,116,114, 97,
+116,101, 0, 97,117,100,105,111, 95,109,105,120,114, 97,116,101, 0, 97,117,100,105,111, 95, 99,104, 97,110,110,101,108,115, 0,
+ 97,117,100,105,111, 95,112, 97,100, 0, 97,117,100,105,111, 95,118,111,108,117,109,101, 0,103,111,112, 95,115,105,122,101, 0,
+114, 99, 95,109,105,110, 95,114, 97,116,101, 0,114, 99, 95,109, 97,120, 95,114, 97,116,101, 0,114, 99, 95, 98,117,102,102,101,
+114, 95,115,105,122,101, 0,109,117,120, 95,112, 97, 99,107,101,116, 95,115,105,122,101, 0,109,117,120, 95,114, 97,116,101, 0,
+109,105,120,114, 97,116,101, 0,109, 97,105,110, 0,115,112,101,101,100, 95,111,102, 95,115,111,117,110,100, 0,100,111,112,112,
+108,101,114, 95,102, 97, 99,116,111,114, 0,100,105,115,116, 97,110, 99,101, 95,109,111,100,101,108, 0, 42,109, 97,116, 95,111,
+118,101,114,114,105,100,101, 0, 42,108,105,103,104,116, 95,111,118,101,114,114,105,100,101, 0,108, 97,121, 95,122,109, 97,115,
+107, 0,108, 97,121,102,108, 97,103, 0,112, 97,115,115,102,108, 97,103, 0,112, 97,115,115, 95,120,111,114, 0,105,109,116,121,
+112,101, 0,112,108, 97,110,101,115, 0,113,117, 97,108,105,116,121, 0, 99,111,109,112,114,101,115,115, 0,101,120,114, 95, 99,
+111,100,101, 99, 0, 99,105,110,101,111,110, 95,102,108, 97,103, 0, 99,105,110,101,111,110, 95,119,104,105,116,101, 0, 99,105,
+110,101,111,110, 95, 98,108, 97, 99,107, 0, 99,105,110,101,111,110, 95,103, 97,109,109, 97, 0,106,112, 50, 95,102,108, 97,103,
+ 0,105,109, 95,102,111,114,109, 97,116, 0, 42, 97,118,105, 99,111,100,101, 99,100, 97,116, 97, 0, 42,113,116, 99,111,100,101,
+ 99,100, 97,116, 97, 0,113,116, 99,111,100,101, 99,115,101,116,116,105,110,103,115, 0,102,102, 99,111,100,101, 99,100, 97,116,
+ 97, 0,115,117, 98,102,114, 97,109,101, 0,112,115,102,114, 97, 0,112,101,102,114, 97, 0,105,109, 97,103,101,115, 0,102,114,
+ 97,109, 97,112,116,111, 0,116,104,114,101, 97,100,115, 0,102,114, 97,109,101,108,101,110, 0, 98,108,117,114,102, 97, 99, 0,
+101,100,103,101, 82, 0,101,100,103,101, 71, 0,101,100,103,101, 66, 0,102,117,108,108,115, 99,114,101,101,110, 0,120,112,108,
+ 97,121, 0,121,112,108, 97,121, 0,102,114,101,113,112,108, 97,121, 0, 97,116,116,114,105, 98, 0,102,114, 97,109,101, 95,115,
+116,101,112, 0,115,116,101,114,101,111,109,111,100,101, 0,100,105,109,101,110,115,105,111,110,115,112,114,101,115,101,116, 0,
+109, 97,120,105,109,115,105,122,101, 0,120,115, 99,104, 0,121,115, 99,104, 0,120,112, 97,114,116,115, 0,121,112, 97,114,116,
+115, 0,115,117, 98,105,109,116,121,112,101, 0,100,105,115,112,108, 97,121,109,111,100,101, 0,115, 99,101,109,111,100,101, 0,
+114, 97,121,116,114, 97, 99,101, 95,111,112,116,105,111,110,115, 0,114, 97,121,116,114, 97, 99,101, 95,115,116,114,117, 99,116,
+117,114,101, 0,111, 99,114,101,115, 0,112, 97,100, 52, 0, 97,108,112,104, 97,109,111,100,101, 0,111,115, 97, 0,102,114,115,
+ 95,115,101, 99, 0,101,100,103,101,105,110,116, 0,115, 97,102,101,116,121, 0, 98,111,114,100,101,114, 0,100,105,115,112,114,
+101, 99,116, 0,108, 97,121,101,114,115, 0, 97, 99,116,108, 97,121, 0,109, 98,108,117,114, 95,115, 97,109,112,108,101,115, 0,
+120, 97,115,112, 0,121, 97,115,112, 0,102,114,115, 95,115,101, 99, 95, 98, 97,115,101, 0,103, 97,117,115,115, 0, 99,111,108,
+111,114, 95,109,103,116, 95,102,108, 97,103, 0,112,111,115,116,103, 97,109,109, 97, 0,112,111,115,116,104,117,101, 0,112,111,
+115,116,115, 97,116, 0,100,105,116,104,101,114, 95,105,110,116,101,110,115,105,116,121, 0, 98, 97,107,101, 95,111,115, 97, 0,
+ 98, 97,107,101, 95,102,105,108,116,101,114, 0, 98, 97,107,101, 95,109,111,100,101, 0, 98, 97,107,101, 95,102,108, 97,103, 0,
+ 98, 97,107,101, 95,110,111,114,109, 97,108, 95,115,112, 97, 99,101, 0, 98, 97,107,101, 95,113,117, 97,100, 95,115,112,108,105,
+116, 0, 98, 97,107,101, 95,109, 97,120,100,105,115,116, 0, 98, 97,107,101, 95, 98,105, 97,115,100,105,115,116, 0, 98, 97,107,
+101, 95,112, 97,100, 0,112,105, 99, 91, 49, 48, 50, 52, 93, 0,115,116, 97,109,112, 0,115,116, 97,109,112, 95,102,111,110,116,
+ 95,105,100, 0,115,116, 97,109,112, 95,117,100, 97,116, 97, 91, 55, 54, 56, 93, 0,102,103, 95,115,116, 97,109,112, 91, 52, 93,
+ 0, 98,103, 95,115,116, 97,109,112, 91, 52, 93, 0,115,101,113, 95,112,114,101,118, 95,116,121,112,101, 0,115,101,113, 95,114,
+101,110,100, 95,116,121,112,101, 0,115,101,113, 95,102,108, 97,103, 0,112, 97,100, 53, 91, 53, 93, 0,115,105,109,112,108,105,
+102,121, 95,102,108, 97,103, 0,115,105,109,112,108,105,102,121, 95,115,117, 98,115,117,114,102, 0,115,105,109,112,108,105,102,
+121, 95,115,104, 97,100,111,119,115, 97,109,112,108,101,115, 0,115,105,109,112,108,105,102,121, 95,112, 97,114,116,105, 99,108,
+101,115, 0,115,105,109,112,108,105,102,121, 95, 97,111,115,115,115, 0, 99,105,110,101,111,110,119,104,105,116,101, 0, 99,105,
+110,101,111,110, 98,108, 97, 99,107, 0, 99,105,110,101,111,110,103, 97,109,109, 97, 0,106,112, 50, 95,112,114,101,115,101,116,
+ 0,106,112, 50, 95,100,101,112,116,104, 0,114,112, 97,100, 51, 0,100,111,109,101,114,101,115, 0,100,111,109,101,109,111,100,
+101, 0,100,111,109,101, 97,110,103,108,101, 0,100,111,109,101,116,105,108,116, 0,100,111,109,101,114,101,115, 98,117,102, 0,
+ 42,100,111,109,101,116,101,120,116, 0,101,110,103,105,110,101, 91, 51, 50, 93, 0,110, 97,109,101, 91, 51, 50, 93, 0,112, 97,
+114,116,105, 99,108,101, 95,112,101,114, 99, 0,115,117, 98,115,117,114,102, 95,109, 97,120, 0,115,104, 97,100, 98,117,102,115,
+ 97,109,112,108,101, 95,109, 97,120, 0, 97,111, 95,101,114,114,111,114, 0,116,105,108,116, 0,114,101,115, 98,117,102, 0, 42,
+119, 97,114,112,116,101,120,116, 0, 99,111,108, 91, 51, 93, 0, 99,101,108,108,115,105,122,101, 0, 99,101,108,108,104,101,105,
+103,104,116, 0, 97,103,101,110,116,109, 97,120,115,108,111,112,101, 0, 97,103,101,110,116,109, 97,120, 99,108,105,109, 98, 0,
+ 97,103,101,110,116,104,101,105,103,104,116, 0, 97,103,101,110,116,114, 97,100,105,117,115, 0,101,100,103,101,109, 97,120,108,
+101,110, 0,101,100,103,101,109, 97,120,101,114,114,111,114, 0,114,101,103,105,111,110,109,105,110,115,105,122,101, 0,114,101,
+103,105,111,110,109,101,114,103,101,115,105,122,101, 0,118,101,114,116,115,112,101,114,112,111,108,121, 0,100,101,116, 97,105,
+108,115, 97,109,112,108,101,100,105,115,116, 0,100,101,116, 97,105,108,115, 97,109,112,108,101,109, 97,120,101,114,114,111,114,
+ 0,102,114, 97,109,105,110,103, 0,112,108, 97,121,101,114,102,108, 97,103, 0,114,116, 49, 0,114,116, 50, 0, 97, 97,115, 97,
+109,112,108,101,115, 0,112, 97,100, 52, 91, 51, 93, 0,100,111,109,101, 0,115,116,101,114,101,111,102,108, 97,103, 0,101,121,
+101,115,101,112, 97,114, 97,116,105,111,110, 0,114,101, 99, 97,115,116, 68, 97,116, 97, 0,109, 97,116,109,111,100,101, 0,101,
+120,105,116,107,101,121, 0,111, 98,115,116, 97, 99,108,101, 83,105,109,117,108, 97,116,105,111,110, 0,108,101,118,101,108, 72,
+101,105,103,104,116, 0, 42, 99, 97,109,101,114, 97, 0, 42,112, 97,105,110,116, 95, 99,117,114,115,111,114, 0,112, 97,105,110,
+116, 95, 99,117,114,115,111,114, 95, 99,111,108, 91, 52, 93, 0,112, 97,105,110,116, 0,115,101, 97,109, 95, 98,108,101,101,100,
+ 0,110,111,114,109, 97,108, 95, 97,110,103,108,101, 0,115, 99,114,101,101,110, 95,103,114, 97, 98, 95,115,105,122,101, 91, 50,
+ 93, 0, 42,112, 97,105,110,116, 99,117,114,115,111,114, 0,105,110,118,101,114,116, 0,116,111,116,114,101,107,101,121, 0,116,
+111,116, 97,100,100,107,101,121, 0, 98,114,117,115,104,116,121,112,101, 0, 98,114,117,115,104, 91, 55, 93, 0,101,109,105,116,
+116,101,114,100,105,115,116, 0,115,101,108,101, 99,116,109,111,100,101, 0,101,100,105,116,116,121,112,101, 0,100,114, 97,119,
+ 95,115,116,101,112, 0,102, 97,100,101, 95,102,114, 97,109,101,115, 0,114, 97,100,105, 97,108, 95,115,121,109,109, 91, 51, 93,
+ 0,108, 97,115,116, 95,120, 0,108, 97,115,116, 95,121, 0,108, 97,115,116, 95, 97,110,103,108,101, 0,100,114, 97,119, 95, 97,
+110, 99,104,111,114,101,100, 0, 97,110, 99,104,111,114,101,100, 95,115,105,122,101, 0, 97,110, 99,104,111,114,101,100, 95,108,
+111, 99, 97,116,105,111,110, 91, 51, 93, 0, 97,110, 99,104,111,114,101,100, 95,105,110,105,116,105, 97,108, 95,109,111,117,115,
+101, 91, 50, 93, 0,100,114, 97,119, 95,112,114,101,115,115,117,114,101, 0,112,114,101,115,115,117,114,101, 95,118, 97,108,117,
+101, 0,115,112,101, 99,105, 97,108, 95,114,111,116, 97,116,105,111,110, 0, 42,118,112, 97,105,110,116, 95,112,114,101,118, 0,
+ 42,119,112, 97,105,110,116, 95,112,114,101,118, 0,109, 97,116, 91, 51, 93, 91, 51, 93, 0,117,110,112,114,111,106,101, 99,116,
+101,100, 95,114, 97,100,105,117,115, 0, 42,118,112, 97,105,110,116, 0, 42,119,112, 97,105,110,116, 0, 42,117,118,115, 99,117,
+108,112,116, 0,118,103,114,111,117,112, 95,119,101,105,103,104,116, 0, 99,111,114,110,101,114,116,121,112,101, 0,101,100,105,
+116, 98,117,116,102,108, 97,103, 0,106,111,105,110,116,114,105,108,105,109,105,116, 0,100,101,103,114, 0,116,117,114,110, 0,
+101,120,116,114, 95,111,102,102,115, 0,100,111,117, 98,108,105,109,105,116, 0,110,111,114,109, 97,108,115,105,122,101, 0, 97,
+117,116,111,109,101,114,103,101, 0,115,101,103,109,101,110,116,115, 0,114,105,110,103,115, 0,118,101,114,116,105, 99,101,115,
+ 0,117,110,119,114, 97,112,112,101,114, 0,117,118, 99, 97,108, 99, 95,114, 97,100,105,117,115, 0,117,118, 99, 97,108, 99, 95,
+ 99,117, 98,101,115,105,122,101, 0,117,118, 99, 97,108, 99, 95,109, 97,114,103,105,110, 0,117,118, 99, 97,108, 99, 95,109, 97,
+112,100,105,114, 0,117,118, 99, 97,108, 99, 95,109, 97,112, 97,108,105,103,110, 0,117,118, 99, 97,108, 99, 95,102,108, 97,103,
+ 0,117,118, 95,102,108, 97,103, 0,117,118, 95,115,101,108,101, 99,116,109,111,100,101, 0,117,118, 95,115,117, 98,115,117,114,
+102, 95,108,101,118,101,108, 0,103,112,101,110, 99,105,108, 95,102,108, 97,103,115, 0, 97,117,116,111,105,107, 95, 99,104, 97,
+105,110,108,101,110, 0,105,109, 97,112, 97,105,110,116, 0,112, 97,114,116,105, 99,108,101, 0,112,114,111,112,111,114,116,105,
+111,110, 97,108, 95,115,105,122,101, 0,115,101,108,101, 99,116, 95,116,104,114,101,115,104, 0, 99,108,101, 97,110, 95,116,104,
+114,101,115,104, 0, 97,117,116,111,107,101,121, 95,109,111,100,101, 0, 97,117,116,111,107,101,121, 95,102,108, 97,103, 0,109,
+117,108,116,105,114,101,115, 95,115,117, 98,100,105,118, 95,116,121,112,101, 0,112, 97,100, 50, 91, 53, 93, 0,115,107,103,101,
+110, 95,114,101,115,111,108,117,116,105,111,110, 0,115,107,103,101,110, 95,116,104,114,101,115,104,111,108,100, 95,105,110,116,
+101,114,110, 97,108, 0,115,107,103,101,110, 95,116,104,114,101,115,104,111,108,100, 95,101,120,116,101,114,110, 97,108, 0,115,
+107,103,101,110, 95,108,101,110,103,116,104, 95,114, 97,116,105,111, 0,115,107,103,101,110, 95,108,101,110,103,116,104, 95,108,
+105,109,105,116, 0,115,107,103,101,110, 95, 97,110,103,108,101, 95,108,105,109,105,116, 0,115,107,103,101,110, 95, 99,111,114,
+114,101,108, 97,116,105,111,110, 95,108,105,109,105,116, 0,115,107,103,101,110, 95,115,121,109,109,101,116,114,121, 95,108,105,
+109,105,116, 0,115,107,103,101,110, 95,114,101,116, 97,114,103,101,116, 95, 97,110,103,108,101, 95,119,101,105,103,104,116, 0,
+115,107,103,101,110, 95,114,101,116, 97,114,103,101,116, 95,108,101,110,103,116,104, 95,119,101,105,103,104,116, 0,115,107,103,
+101,110, 95,114,101,116, 97,114,103,101,116, 95,100,105,115,116, 97,110, 99,101, 95,119,101,105,103,104,116, 0,115,107,103,101,
+110, 95,111,112,116,105,111,110,115, 0,115,107,103,101,110, 95,112,111,115,116,112,114,111, 0,115,107,103,101,110, 95,112,111,
+115,116,112,114,111, 95,112, 97,115,115,101,115, 0,115,107,103,101,110, 95,115,117, 98,100,105,118,105,115,105,111,110,115, 91,
+ 51, 93, 0,115,107,103,101,110, 95,109,117,108,116,105, 95,108,101,118,101,108, 0, 42,115,107,103,101,110, 95,116,101,109,112,
+108, 97,116,101, 0, 98,111,110,101, 95,115,107,101,116, 99,104,105,110,103, 0, 98,111,110,101, 95,115,107,101,116, 99,104,105,
+110,103, 95, 99,111,110,118,101,114,116, 0,115,107,103,101,110, 95,115,117, 98,100,105,118,105,115,105,111,110, 95,110,117,109,
+ 98,101,114, 0,115,107,103,101,110, 95,114,101,116, 97,114,103,101,116, 95,111,112,116,105,111,110,115, 0,115,107,103,101,110,
+ 95,114,101,116, 97,114,103,101,116, 95,114,111,108,108, 0,115,107,103,101,110, 95,115,105,100,101, 95,115,116,114,105,110,103,
+ 91, 56, 93, 0,115,107,103,101,110, 95,110,117,109, 95,115,116,114,105,110,103, 91, 56, 93, 0,101,100,103,101, 95,109,111,100,
+101, 0,101,100,103,101, 95,109,111,100,101, 95,108,105,118,101, 95,117,110,119,114, 97,112, 0,115,110, 97,112, 95,109,111,100,
+101, 0,115,110, 97,112, 95,102,108, 97,103, 0,115,110, 97,112, 95,116, 97,114,103,101,116, 0,112,114,111,112,111,114,116,105,
+111,110, 97,108, 0,112,114,111,112, 95,109,111,100,101, 0,112,114,111,112,111,114,116,105,111,110, 97,108, 95,111, 98,106,101,
+ 99,116,115, 0,112, 97,100, 91, 53, 93, 0, 97,117,116,111, 95,110,111,114,109, 97,108,105,122,101, 0,109,117,108,116,105,112,
+ 97,105,110,116, 0,117,115,101, 95,117,118, 95,115, 99,117,108,112,116, 0,117,118, 95,115, 99,117,108,112,116, 95,115,101,116,
+116,105,110,103,115, 0,117,118, 95,115, 99,117,108,112,116, 95,116,111,111,108, 0,117,118, 95,114,101,108, 97,120, 95,109,101,
+116,104,111,100, 0,115, 99,117,108,112,116, 95,112, 97,105,110,116, 95,115,101,116,116,105,110,103,115, 0,115, 99,117,108,112,
+116, 95,112, 97,105,110,116, 95,117,110,105,102,105,101,100, 95,115,105,122,101, 0,115, 99,117,108,112,116, 95,112, 97,105,110,
+116, 95,117,110,105,102,105,101,100, 95,117,110,112,114,111,106,101, 99,116,101,100, 95,114, 97,100,105,117,115, 0,115, 99,117,
+108,112,116, 95,112, 97,105,110,116, 95,117,110,105,102,105,101,100, 95, 97,108,112,104, 97, 0,117,110,105,102,105,101,100, 95,
+112, 97,105,110,116, 95,115,101,116,116,105,110,103,115, 0,116,111,116,111, 98,106, 0,116,111,116,108, 97,109,112, 0,116,111,
+116,111, 98,106,115,101,108, 0,116,111,116, 99,117,114,118,101, 0,116,111,116,109,101,115,104, 0,116,111,116, 97,114,109, 97,
+116,117,114,101, 0,115, 99, 97,108,101, 95,108,101,110,103,116,104, 0,115,121,115,116,101,109, 0,115,121,115,116,101,109, 95,
+114,111,116, 97,116,105,111,110, 0,103,114, 97,118,105,116,121, 91, 51, 93, 0,113,117,105, 99,107, 95, 99, 97, 99,104,101, 95,
+115,116,101,112, 0, 42,119,111,114,108,100, 0, 42,115,101,116, 0, 98, 97,115,101, 0, 42, 98, 97,115, 97, 99,116, 0, 42,111,
+ 98,101,100,105,116, 0, 99,117,114,115,111,114, 91, 51, 93, 0,116,119, 99,101,110,116, 91, 51, 93, 0,116,119,109,105,110, 91,
+ 51, 93, 0,116,119,109, 97,120, 91, 51, 93, 0,108, 97,121, 97, 99,116, 0,108, 97,121, 95,117,112,100, 97,116,101,100, 0, 42,
+101,100, 0, 42,116,111,111,108,115,101,116,116,105,110,103,115, 0, 42,115,116, 97,116,115, 0, 97,117,100,105,111, 0,116,114,
+ 97,110,115,102,111,114,109, 95,115,112, 97, 99,101,115, 0, 42,115,111,117,110,100, 95,115, 99,101,110,101, 0, 42,115,111,117,
+110,100, 95,115, 99,101,110,101, 95,104, 97,110,100,108,101, 0, 42,115,111,117,110,100, 95,115, 99,114,117, 98, 95,104, 97,110,
+100,108,101, 0, 42,115,112,101, 97,107,101,114, 95,104, 97,110,100,108,101,115, 0, 42,102,112,115, 95,105,110,102,111, 0, 42,
+116,104,101, 68, 97,103, 0,100, 97,103,105,115,118, 97,108,105,100, 0,100, 97,103,102,108, 97,103,115, 0, 97, 99,116,105,118,
+101, 95,107,101,121,105,110,103,115,101,116, 0,107,101,121,105,110,103,115,101,116,115, 0,103,109, 0,117,110,105,116, 0,112,
+104,121,115,105, 99,115, 95,115,101,116,116,105,110,103,115, 0, 42, 99,108,105,112, 0, 99,117,115,116,111,109,100, 97,116, 97,
+ 95,109, 97,115,107, 95,109,111,100, 97,108, 0, 99,117,115,101,114, 0, 98,108,101,110,100, 0,118,105,101,119, 0,119,105,110,
+109, 97,116, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,109, 97,116, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,105,110,118, 91,
+ 52, 93, 91, 52, 93, 0,112,101,114,115,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,105,110,118, 91, 52, 93, 91, 52,
+ 93, 0,118,105,101,119,109, 97,116,111, 98, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,109, 97,116,111, 98, 91, 52, 93, 91, 52,
+ 93, 0, 99,108,105,112, 91, 54, 93, 91, 52, 93, 0, 99,108,105,112, 95,108,111, 99, 97,108, 91, 54, 93, 91, 52, 93, 0, 42, 99,
+108,105,112, 98, 98, 0, 42,108,111, 99, 97,108,118,100, 0, 42,114,105, 0, 42,114,101,110,100,101,114, 95,101,110,103,105,110,
+101, 0, 42,100,101,112,116,104,115, 0, 42,115,109,115, 0, 42,115,109,111,111,116,104, 95,116,105,109,101,114, 0,116,119,109,
+ 97,116, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,113,117, 97,116, 91, 52, 93, 0,122,102, 97, 99, 0, 99, 97,109,100,120, 0,
+ 99, 97,109,100,121, 0,112,105,120,115,105,122,101, 0, 99, 97,109,122,111,111,109, 0,105,115, 95,112,101,114,115,112, 0,112,
+101,114,115,112, 0,118,105,101,119,108,111, 99,107, 0,116,119,100,114, 97,119,102,108, 97,103, 0,114,102,108, 97,103, 0,108,
+118,105,101,119,113,117, 97,116, 91, 52, 93, 0,108,112,101,114,115,112, 0,108,118,105,101,119, 0,103,114,105,100,118,105,101,
+119, 0,116,119, 97,110,103,108,101, 91, 51, 93, 0,114,111,116, 95, 97,110,103,108,101, 0,114,111,116, 95, 97,120,105,115, 91,
+ 51, 93, 0,114,101,103,105,111,110, 98, 97,115,101, 0,115,112, 97, 99,101,116,121,112,101, 0, 98,108,111, 99,107,115, 99, 97,
+108,101, 0, 98,108,111, 99,107,104, 97,110,100,108,101,114, 91, 56, 93, 0, 98,117,110,100,108,101, 95,115,105,122,101, 0, 98,
+117,110,100,108,101, 95,100,114, 97,119,116,121,112,101, 0,108, 97,121, 95,117,115,101,100, 0, 42,111, 98, 95, 99,101,110,116,
+114,101, 0, 98,103,112,105, 99, 98, 97,115,101, 0, 42, 98,103,112,105, 99, 0,111, 98, 95, 99,101,110,116,114,101, 95, 98,111,
+110,101, 91, 54, 52, 93, 0,100,114, 97,119,116,121,112,101, 0,111, 98, 95, 99,101,110,116,114,101, 95, 99,117,114,115,111,114,
+ 0,115, 99,101,110,101,108,111, 99,107, 0, 97,114,111,117,110,100, 0,103,114,105,100, 0,110,101, 97,114, 0,102, 97,114, 0,
+109,111,100,101,115,101,108,101, 99,116, 0,103,114,105,100,108,105,110,101,115, 0,103,114,105,100,115,117, 98,100,105,118, 0,
+103,114,105,100,102,108, 97,103, 0,116,119,116,121,112,101, 0,116,119,109,111,100,101, 0,116,119,102,108, 97,103, 0,112, 97,
+100, 50, 91, 50, 93, 0, 97,102,116,101,114,100,114, 97,119, 95,116,114, 97,110,115,112, 0, 97,102,116,101,114,100,114, 97,119,
+ 95,120,114, 97,121, 0, 97,102,116,101,114,100,114, 97,119, 95,120,114, 97,121,116,114, 97,110,115,112, 0,122, 98,117,102, 0,
+120,114, 97,121, 0,112, 97,100, 51, 91, 50, 93, 0, 42,112,114,111,112,101,114,116,105,101,115, 95,115,116,111,114, 97,103,101,
+ 0,118,101,114,116, 0,104,111,114, 0,109, 97,115,107, 0,109,105,110, 91, 50, 93, 0,109, 97,120, 91, 50, 93, 0,109,105,110,
+122,111,111,109, 0,109, 97,120,122,111,111,109, 0,115, 99,114,111,108,108, 0,115, 99,114,111,108,108, 95,117,105, 0,107,101,
+101,112,116,111,116, 0,107,101,101,112,122,111,111,109, 0,107,101,101,112,111,102,115, 0, 97,108,105,103,110, 0,119,105,110,
+120, 0,119,105,110,121, 0,111,108,100,119,105,110,120, 0,111,108,100,119,105,110,121, 0, 42,116, 97, 98, 95,111,102,102,115,
+101,116, 0,116, 97, 98, 95,110,117,109, 0,116, 97, 98, 95, 99,117,114, 0,114,112,116, 95,109, 97,115,107, 0,118, 50,100, 0,
+ 42, 97,100,115, 0,103,104,111,115,116, 67,117,114,118,101,115, 0, 97,117,116,111,115,110, 97,112, 0, 99,117,114,115,111,114,
+ 86, 97,108, 0,109, 97,105,110, 98, 0,109, 97,105,110, 98,111, 0,109, 97,105,110, 98,117,115,101,114, 0,114,101, 95, 97,108,
+105,103,110, 0,112,114,101,118,105,101,119, 0,116,101,120,116,117,114,101, 95, 99,111,110,116,101,120,116, 0,112, 97,116,104,
+102,108, 97,103, 0,100, 97,116, 97,105, 99,111,110, 0, 42,112,105,110,105,100, 0, 42,116,101,120,117,115,101,114, 0,114,101,
+110,100,101,114, 95,115,105,122,101, 0, 99,104, 97,110,115,104,111,119,110, 0,122,101, 98,114, 97, 0,122,111,111,109, 0,116,
+105,116,108,101, 91, 51, 50, 93, 0,100,105,114, 91, 49, 48, 53, 54, 93, 0,102,105,108,101, 91, 50, 53, 54, 93, 0,114,101,110,
+ 97,109,101,102,105,108,101, 91, 50, 53, 54, 93, 0,114,101,110, 97,109,101,101,100,105,116, 91, 50, 53, 54, 93, 0,102,105,108,
+116,101,114, 95,103,108,111, 98, 91, 54, 52, 93, 0, 97, 99,116,105,118,101, 95,102,105,108,101, 0,115,101,108, 95,102,105,114,
+115,116, 0,115,101,108, 95,108, 97,115,116, 0,115,111,114,116, 0,100,105,115,112,108, 97,121, 0,102, 95,102,112, 0,102,112,
+ 95,115,116,114, 91, 56, 93, 0,115, 99,114,111,108,108, 95,111,102,102,115,101,116, 0, 42,112, 97,114, 97,109,115, 0, 42,102,
+105,108,101,115, 0, 42,102,111,108,100,101,114,115, 95,112,114,101,118, 0, 42,102,111,108,100,101,114,115, 95,110,101,120,116,
+ 0, 42,111,112, 0, 42,115,109,111,111,116,104,115, 99,114,111,108,108, 95,116,105,109,101,114, 0, 42,108, 97,121,111,117,116,
+ 0,114,101, 99,101,110,116,110,114, 0, 98,111,111,107,109, 97,114,107,110,114, 0,115,121,115,116,101,109,110,114, 0,116,114,
+101,101, 0, 42,116,114,101,101,115,116,111,114,101, 0,115,101, 97,114, 99,104, 95,115,116,114,105,110,103, 91, 51, 50, 93, 0,
+115,101, 97,114, 99,104, 95,116,115,101, 0,111,117,116,108,105,110,101,118,105,115, 0,115,116,111,114,101,102,108, 97,103, 0,
+115,101, 97,114, 99,104, 95,102,108, 97,103,115, 0, 42, 99,117,109, 97,112, 0,115, 99,111,112,101,115, 0,115, 97,109,112,108,
+101, 95,108,105,110,101, 95,104,105,115,116, 0, 99,117,114,115,111,114, 91, 50, 93, 0, 99,101,110,116,120, 0, 99,101,110,116,
+121, 0, 99,117,114,116,105,108,101, 0,108,111, 99,107, 0,112,105,110, 0,100,116, 95,117,118, 0,115,116,105, 99,107,121, 0,
+100,116, 95,117,118,115,116,114,101,116, 99,104, 0, 42,116,101,120,116, 0,116,111,112, 0,118,105,101,119,108,105,110,101,115,
+ 0,109,101,110,117,110,114, 0,108,104,101,105,103,104,116, 0, 99,119,105,100,116,104, 0,108,105,110,101,110,114,115, 95,116,
+111,116, 0,108,101,102,116, 0,115,104,111,119,108,105,110,101,110,114,115, 0,116, 97, 98,110,117,109, 98,101,114, 0,115,104,
+111,119,115,121,110,116, 97,120, 0,108,105,110,101, 95,104,108,105,103,104,116, 0,111,118,101,114,119,114,105,116,101, 0,108,
+105,118,101, 95,101,100,105,116, 0,112,105,120, 95,112,101,114, 95,108,105,110,101, 0,116,120,116,115, 99,114,111,108,108, 0,
+116,120,116, 98, 97,114, 0,119,111,114,100,119,114, 97,112, 0,100,111,112,108,117,103,105,110,115, 0,102,105,110,100,115,116,
+114, 91, 50, 53, 54, 93, 0,114,101,112,108, 97, 99,101,115,116,114, 91, 50, 53, 54, 93, 0,109, 97,114,103,105,110, 95, 99,111,
+108,117,109,110, 0, 42,100,114, 97,119, 99, 97, 99,104,101, 0, 42,112,121, 95,100,114, 97,119, 0, 42,112,121, 95,101,118,101,
+110,116, 0, 42,112,121, 95, 98,117,116,116,111,110, 0, 42,112,121, 95, 98,114,111,119,115,101,114, 99, 97,108,108, 98, 97, 99,
+107, 0, 42,112,121, 95,103,108,111, 98, 97,108,100,105, 99,116, 0,108, 97,115,116,115,112, 97, 99,101, 0,115, 99,114,105,112,
+116,110, 97,109,101, 91, 49, 48, 50, 52, 93, 0,115, 99,114,105,112,116, 97,114,103, 91, 50, 53, 54, 93, 0, 42,115, 99,114,105,
+112,116, 0, 42, 98,117,116, 95,114,101,102,115, 0, 42, 97,114,114, 97,121, 0, 99, 97, 99,104,101,115, 0, 99, 97, 99,104,101,
+ 95,100,105,115,112,108, 97,121, 0, 42,105,100, 0, 97,115,112,101, 99,116, 0,112, 97,100,102, 0,109,120, 0,109,121, 0, 42,
+101,100,105,116,116,114,101,101, 0,116,114,101,101,116,121,112,101, 0,116,101,120,102,114,111,109, 0,115,104, 97,100,101,114,
+102,114,111,109, 0,108,105,110,107,100,114, 97,103, 0,108,101,110, 95, 97,108,108,111, 99, 0, 99,117,114,115,111,114, 0,115,
+ 99,114,111,108,108, 98, 97, 99,107, 0,104,105,115,116,111,114,121, 0,112,114,111,109,112,116, 91, 50, 53, 54, 93, 0,108, 97,
+110,103,117, 97,103,101, 91, 51, 50, 93, 0,115,101,108, 95,115,116, 97,114,116, 0,115,101,108, 95,101,110,100, 0,102,105,108,
+116,101,114, 91, 54, 52, 93, 0,120,108,111, 99,107,111,102, 0,121,108,111, 99,107,111,102, 0,117,115,101,114, 0,112, 97,116,
+104, 95,108,101,110,103,116,104, 0,108,111, 99, 91, 50, 93, 0,115,116, 97, 98,109, 97,116, 91, 52, 93, 91, 52, 93, 0,117,110,
+105,115,116, 97, 98,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,111,115,116,112,114,111, 99, 95,102,108, 97,103, 0,114,117,110,
+116,105,109,101, 95,102,108, 97,103, 0,102,105,108,101,110, 97,109,101, 91, 49, 48, 50, 52, 93, 0, 98,108,102, 95,105,100, 0,
+117,105,102,111,110,116, 95,105,100, 0,114, 95,116,111, 95,108, 0,112,111,105,110,116,115, 0,107,101,114,110,105,110,103, 0,
+105,116, 97,108,105, 99, 0, 98,111,108,100, 0,115,104, 97,100,111,119, 0,115,104, 97,100,120, 0,115,104, 97,100,121, 0,115,
+104, 97,100,111,119, 97,108,112,104, 97, 0,115,104, 97,100,111,119, 99,111,108,111,114, 0,112, 97,110,101,108,116,105,116,108,
+101, 0,103,114,111,117,112,108, 97, 98,101,108, 0,119,105,100,103,101,116,108, 97, 98,101,108, 0,119,105,100,103,101,116, 0,
+112, 97,110,101,108,122,111,111,109, 0,109,105,110,108, 97, 98,101,108, 99,104, 97,114,115, 0,109,105,110,119,105,100,103,101,
+116, 99,104, 97,114,115, 0, 99,111,108,117,109,110,115,112, 97, 99,101, 0,116,101,109,112,108, 97,116,101,115,112, 97, 99,101,
+ 0, 98,111,120,115,112, 97, 99,101, 0, 98,117,116,116,111,110,115,112, 97, 99,101,120, 0, 98,117,116,116,111,110,115,112, 97,
+ 99,101,121, 0,112, 97,110,101,108,115,112, 97, 99,101, 0,112, 97,110,101,108,111,117,116,101,114, 0,111,117,116,108,105,110,
+101, 91, 52, 93, 0,105,110,110,101,114, 91, 52, 93, 0,105,110,110,101,114, 95,115,101,108, 91, 52, 93, 0,105,116,101,109, 91,
+ 52, 93, 0,116,101,120,116, 91, 52, 93, 0,116,101,120,116, 95,115,101,108, 91, 52, 93, 0,115,104, 97,100,101,100, 0,115,104,
+ 97,100,101,116,111,112, 0,115,104, 97,100,101,100,111,119,110, 0, 97,108,112,104, 97, 95, 99,104,101, 99,107, 0,105,110,110,
+101,114, 95, 97,110,105,109, 91, 52, 93, 0,105,110,110,101,114, 95, 97,110,105,109, 95,115,101,108, 91, 52, 93, 0,105,110,110,
+101,114, 95,107,101,121, 91, 52, 93, 0,105,110,110,101,114, 95,107,101,121, 95,115,101,108, 91, 52, 93, 0,105,110,110,101,114,
+ 95,100,114,105,118,101,110, 91, 52, 93, 0,105,110,110,101,114, 95,100,114,105,118,101,110, 95,115,101,108, 91, 52, 93, 0,104,
+101, 97,100,101,114, 91, 52, 93, 0,115,104,111,119, 95,104,101, 97,100,101,114, 0,119, 99,111,108, 95,114,101,103,117,108, 97,
+114, 0,119, 99,111,108, 95,116,111,111,108, 0,119, 99,111,108, 95,116,101,120,116, 0,119, 99,111,108, 95,114, 97,100,105,111,
+ 0,119, 99,111,108, 95,111,112,116,105,111,110, 0,119, 99,111,108, 95,116,111,103,103,108,101, 0,119, 99,111,108, 95,110,117,
+109, 0,119, 99,111,108, 95,110,117,109,115,108,105,100,101,114, 0,119, 99,111,108, 95,109,101,110,117, 0,119, 99,111,108, 95,
+112,117,108,108,100,111,119,110, 0,119, 99,111,108, 95,109,101,110,117, 95, 98, 97, 99,107, 0,119, 99,111,108, 95,109,101,110,
+117, 95,105,116,101,109, 0,119, 99,111,108, 95,116,111,111,108,116,105,112, 0,119, 99,111,108, 95, 98,111,120, 0,119, 99,111,
+108, 95,115, 99,114,111,108,108, 0,119, 99,111,108, 95,112,114,111,103,114,101,115,115, 0,119, 99,111,108, 95,108,105,115,116,
+ 95,105,116,101,109, 0,119, 99,111,108, 95,115,116, 97,116,101, 0,112, 97,110,101,108, 0,105, 99,111,110,102,105,108,101, 91,
+ 50, 53, 54, 93, 0,105, 99,111,110, 95, 97,108,112,104, 97, 0, 98, 97, 99,107, 91, 52, 93, 0,116,105,116,108,101, 91, 52, 93,
+ 0,116,101,120,116, 95,104,105, 91, 52, 93, 0,104,101, 97,100,101,114, 95,116,105,116,108,101, 91, 52, 93, 0,104,101, 97,100,
+101,114, 95,116,101,120,116, 91, 52, 93, 0,104,101, 97,100,101,114, 95,116,101,120,116, 95,104,105, 91, 52, 93, 0, 98,117,116,
+116,111,110, 91, 52, 93, 0, 98,117,116,116,111,110, 95,116,105,116,108,101, 91, 52, 93, 0, 98,117,116,116,111,110, 95,116,101,
+120,116, 91, 52, 93, 0, 98,117,116,116,111,110, 95,116,101,120,116, 95,104,105, 91, 52, 93, 0,108,105,115,116, 91, 52, 93, 0,
+108,105,115,116, 95,116,105,116,108,101, 91, 52, 93, 0,108,105,115,116, 95,116,101,120,116, 91, 52, 93, 0,108,105,115,116, 95,
+116,101,120,116, 95,104,105, 91, 52, 93, 0,112, 97,110,101,108, 91, 52, 93, 0,112, 97,110,101,108, 95,116,105,116,108,101, 91,
+ 52, 93, 0,112, 97,110,101,108, 95,116,101,120,116, 91, 52, 93, 0,112, 97,110,101,108, 95,116,101,120,116, 95,104,105, 91, 52,
+ 93, 0,115,104, 97,100,101, 49, 91, 52, 93, 0,115,104, 97,100,101, 50, 91, 52, 93, 0,104,105,108,105,116,101, 91, 52, 93, 0,
+103,114,105,100, 91, 52, 93, 0,119,105,114,101, 91, 52, 93, 0,115,101,108,101, 99,116, 91, 52, 93, 0,108, 97,109,112, 91, 52,
+ 93, 0,115,112,101, 97,107,101,114, 91, 52, 93, 0,101,109,112,116,121, 91, 52, 93, 0, 99, 97,109,101,114, 97, 91, 52, 93, 0,
+112, 97,100, 91, 56, 93, 0, 97, 99,116,105,118,101, 91, 52, 93, 0,103,114,111,117,112, 91, 52, 93, 0,103,114,111,117,112, 95,
+ 97, 99,116,105,118,101, 91, 52, 93, 0,116,114, 97,110,115,102,111,114,109, 91, 52, 93, 0,118,101,114,116,101,120, 91, 52, 93,
+ 0,118,101,114,116,101,120, 95,115,101,108,101, 99,116, 91, 52, 93, 0,101,100,103,101, 91, 52, 93, 0,101,100,103,101, 95,115,
+101,108,101, 99,116, 91, 52, 93, 0,101,100,103,101, 95,115,101, 97,109, 91, 52, 93, 0,101,100,103,101, 95,115,104, 97,114,112,
+ 91, 52, 93, 0,101,100,103,101, 95,102, 97, 99,101,115,101,108, 91, 52, 93, 0,101,100,103,101, 95, 99,114,101, 97,115,101, 91,
+ 52, 93, 0,102, 97, 99,101, 91, 52, 93, 0,102, 97, 99,101, 95,115,101,108,101, 99,116, 91, 52, 93, 0,102, 97, 99,101, 95,100,
+111,116, 91, 52, 93, 0,101,120,116,114, 97, 95,101,100,103,101, 95,108,101,110, 91, 52, 93, 0,101,120,116,114, 97, 95,102, 97,
+ 99,101, 95, 97,110,103,108,101, 91, 52, 93, 0,101,120,116,114, 97, 95,102, 97, 99,101, 95, 97,114,101, 97, 91, 52, 93, 0,112,
+ 97,100, 51, 91, 52, 93, 0,110,111,114,109, 97,108, 91, 52, 93, 0,118,101,114,116,101,120, 95,110,111,114,109, 97,108, 91, 52,
+ 93, 0, 98,111,110,101, 95,115,111,108,105,100, 91, 52, 93, 0, 98,111,110,101, 95,112,111,115,101, 91, 52, 93, 0,115,116,114,
+105,112, 91, 52, 93, 0,115,116,114,105,112, 95,115,101,108,101, 99,116, 91, 52, 93, 0, 99,102,114, 97,109,101, 91, 52, 93, 0,
+110,117,114, 98, 95,117,108,105,110,101, 91, 52, 93, 0,110,117,114, 98, 95,118,108,105,110,101, 91, 52, 93, 0, 97, 99,116, 95,
+115,112,108,105,110,101, 91, 52, 93, 0,110,117,114, 98, 95,115,101,108, 95,117,108,105,110,101, 91, 52, 93, 0,110,117,114, 98,
+ 95,115,101,108, 95,118,108,105,110,101, 91, 52, 93, 0,108, 97,115,116,115,101,108, 95,112,111,105,110,116, 91, 52, 93, 0,104,
+ 97,110,100,108,101, 95,102,114,101,101, 91, 52, 93, 0,104, 97,110,100,108,101, 95, 97,117,116,111, 91, 52, 93, 0,104, 97,110,
+100,108,101, 95,118,101, 99,116, 91, 52, 93, 0,104, 97,110,100,108,101, 95, 97,108,105,103,110, 91, 52, 93, 0,104, 97,110,100,
+108,101, 95, 97,117,116,111, 95, 99,108, 97,109,112,101,100, 91, 52, 93, 0,104, 97,110,100,108,101, 95,115,101,108, 95,102,114,
+101,101, 91, 52, 93, 0,104, 97,110,100,108,101, 95,115,101,108, 95, 97,117,116,111, 91, 52, 93, 0,104, 97,110,100,108,101, 95,
+115,101,108, 95,118,101, 99,116, 91, 52, 93, 0,104, 97,110,100,108,101, 95,115,101,108, 95, 97,108,105,103,110, 91, 52, 93, 0,
+104, 97,110,100,108,101, 95,115,101,108, 95, 97,117,116,111, 95, 99,108, 97,109,112,101,100, 91, 52, 93, 0,100,115, 95, 99,104,
+ 97,110,110,101,108, 91, 52, 93, 0,100,115, 95,115,117, 98, 99,104, 97,110,110,101,108, 91, 52, 93, 0, 99,111,110,115,111,108,
+101, 95,111,117,116,112,117,116, 91, 52, 93, 0, 99,111,110,115,111,108,101, 95,105,110,112,117,116, 91, 52, 93, 0, 99,111,110,
+115,111,108,101, 95,105,110,102,111, 91, 52, 93, 0, 99,111,110,115,111,108,101, 95,101,114,114,111,114, 91, 52, 93, 0, 99,111,
+110,115,111,108,101, 95, 99,117,114,115,111,114, 91, 52, 93, 0,118,101,114,116,101,120, 95,115,105,122,101, 0,111,117,116,108,
+105,110,101, 95,119,105,100,116,104, 0,102, 97, 99,101,100,111,116, 95,115,105,122,101, 0,110,111,111,100,108,101, 95, 99,117,
+114,118,105,110,103, 0,115,121,110,116, 97,120,108, 91, 52, 93, 0,115,121,110,116, 97,120,110, 91, 52, 93, 0,115,121,110,116,
+ 97,120, 98, 91, 52, 93, 0,115,121,110,116, 97,120,118, 91, 52, 93, 0,115,121,110,116, 97,120, 99, 91, 52, 93, 0,109,111,118,
+105,101, 91, 52, 93, 0,109,111,118,105,101, 99,108,105,112, 91, 52, 93, 0,105,109, 97,103,101, 91, 52, 93, 0,115, 99,101,110,
+101, 91, 52, 93, 0, 97,117,100,105,111, 91, 52, 93, 0,101,102,102,101, 99,116, 91, 52, 93, 0,112,108,117,103,105,110, 91, 52,
+ 93, 0,116,114, 97,110,115,105,116,105,111,110, 91, 52, 93, 0,109,101,116, 97, 91, 52, 93, 0,101,100,105,116,109,101,115,104,
+ 95, 97, 99,116,105,118,101, 91, 52, 93, 0,104, 97,110,100,108,101, 95,118,101,114,116,101,120, 91, 52, 93, 0,104, 97,110,100,
+108,101, 95,118,101,114,116,101,120, 95,115,101,108,101, 99,116, 91, 52, 93, 0,104, 97,110,100,108,101, 95,118,101,114,116,101,
+120, 95,115,105,122,101, 0,109, 97,114,107,101,114, 95,111,117,116,108,105,110,101, 91, 52, 93, 0,109, 97,114,107,101,114, 91,
+ 52, 93, 0, 97, 99,116, 95,109, 97,114,107,101,114, 91, 52, 93, 0,115,101,108, 95,109, 97,114,107,101,114, 91, 52, 93, 0,100,
+105,115, 95,109, 97,114,107,101,114, 91, 52, 93, 0,108,111, 99,107, 95,109, 97,114,107,101,114, 91, 52, 93, 0, 98,117,110,100,
+108,101, 95,115,111,108,105,100, 91, 52, 93, 0,112, 97,116,104, 95, 98,101,102,111,114,101, 91, 52, 93, 0,112, 97,116,104, 95,
+ 97,102,116,101,114, 91, 52, 93, 0, 99, 97,109,101,114, 97, 95,112, 97,116,104, 91, 52, 93, 0,104,112, 97,100, 91, 55, 93, 0,
+112,114,101,118,105,101,119, 95, 98, 97, 99,107, 91, 52, 93, 0,112,114,101,118,105,101,119, 95,115,116,105,116, 99,104, 95,102,
+ 97, 99,101, 91, 52, 93, 0,112,114,101,118,105,101,119, 95,115,116,105,116, 99,104, 95,101,100,103,101, 91, 52, 93, 0,112,114,
+101,118,105,101,119, 95,115,116,105,116, 99,104, 95,118,101,114,116, 91, 52, 93, 0,112,114,101,118,105,101,119, 95,115,116,105,
+116, 99,104, 95,115,116,105,116, 99,104, 97, 98,108,101, 91, 52, 93, 0,112,114,101,118,105,101,119, 95,115,116,105,116, 99,104,
+ 95,117,110,115,116,105,116, 99,104, 97, 98,108,101, 91, 52, 93, 0,112,114,101,118,105,101,119, 95,115,116,105,116, 99,104, 95,
+ 97, 99,116,105,118,101, 91, 52, 93, 0,109, 97,116, 99,104, 91, 52, 93, 0,115,101,108,101, 99,116,101,100, 95,104,105,103,104,
+108,105,103,104,116, 91, 52, 93, 0,115,111,108,105,100, 91, 52, 93, 0,116,117,105, 0,116, 98,117,116,115, 0,116,118, 51,100,
+ 0,116,102,105,108,101, 0,116,105,112,111, 0,116,105,110,102,111, 0,116, 97, 99,116, 0,116,110,108, 97, 0,116,115,101,113,
+ 0,116,105,109, 97, 0,116,101,120,116, 0,116,111,111,112,115, 0,116,116,105,109,101, 0,116,110,111,100,101, 0,116,108,111,
+103,105, 99, 0,116,117,115,101,114,112,114,101,102, 0,116, 99,111,110,115,111,108,101, 0,116, 99,108,105,112, 0,116, 97,114,
+109, 91, 50, 48, 93, 0, 97, 99,116,105,118,101, 95,116,104,101,109,101, 95, 97,114,101, 97, 0,109,111,100,117,108,101, 91, 54,
+ 52, 93, 0,115,112,101, 99, 91, 52, 93, 0,100,117,112,102,108, 97,103, 0,115, 97,118,101,116,105,109,101, 0,116,101,109,112,
+100,105,114, 91, 55, 54, 56, 93, 0,102,111,110,116,100,105,114, 91, 55, 54, 56, 93, 0,114,101,110,100,101,114,100,105,114, 91,
+ 49, 48, 50, 52, 93, 0,116,101,120,116,117,100,105,114, 91, 55, 54, 56, 93, 0,112,108,117,103,116,101,120,100,105,114, 91, 55,
+ 54, 56, 93, 0,112,108,117,103,115,101,113,100,105,114, 91, 55, 54, 56, 93, 0,112,121,116,104,111,110,100,105,114, 91, 55, 54,
+ 56, 93, 0,115,111,117,110,100,100,105,114, 91, 55, 54, 56, 93, 0,105,109, 97,103,101, 95,101,100,105,116,111,114, 91, 49, 48,
+ 50, 52, 93, 0, 97,110,105,109, 95,112,108, 97,121,101,114, 91, 49, 48, 50, 52, 93, 0, 97,110,105,109, 95,112,108, 97,121,101,
+114, 95,112,114,101,115,101,116, 0,118, 50,100, 95,109,105,110, 95,103,114,105,100,115,105,122,101, 0,116,105,109,101, 99,111,
+100,101, 95,115,116,121,108,101, 0,118,101,114,115,105,111,110,115, 0,100, 98,108, 95, 99,108,105, 99,107, 95,116,105,109,101,
+ 0,103, 97,109,101,102,108, 97,103,115, 0,119,104,101,101,108,108,105,110,101,115, 99,114,111,108,108, 0,117,105,102,108, 97,
+103, 0,108, 97,110,103,117, 97,103,101, 0,117,115,101,114,112,114,101,102, 0,118,105,101,119,122,111,111,109, 0,109,105,120,
+ 98,117,102,115,105,122,101, 0, 97,117,100,105,111,100,101,118,105, 99,101, 0, 97,117,100,105,111,114, 97,116,101, 0, 97,117,
+100,105,111,102,111,114,109, 97,116, 0, 97,117,100,105,111, 99,104, 97,110,110,101,108,115, 0,100,112,105, 0,101,110, 99,111,
+100,105,110,103, 0,116,114, 97,110,115,111,112,116,115, 0,109,101,110,117,116,104,114,101,115,104,111,108,100, 49, 0,109,101,
+110,117,116,104,114,101,115,104,111,108,100, 50, 0,116,104,101,109,101,115, 0,117,105,102,111,110,116,115, 0,117,105,115,116,
+121,108,101,115, 0,107,101,121,109, 97,112,115, 0,117,115,101,114, 95,107,101,121,109, 97,112,115, 0, 97,100,100,111,110,115,
+ 0,107,101,121, 99,111,110,102,105,103,115,116,114, 91, 54, 52, 93, 0,117,110,100,111,115,116,101,112,115, 0,117,110,100,111,
+109,101,109,111,114,121, 0,103,112, 95,109, 97,110,104, 97,116,116,101,110,100,105,115,116, 0,103,112, 95,101,117, 99,108,105,
+100,101, 97,110,100,105,115,116, 0,103,112, 95,101,114, 97,115,101,114, 0,103,112, 95,115,101,116,116,105,110,103,115, 0,116,
+ 98, 95,108,101,102,116,109,111,117,115,101, 0,116, 98, 95,114,105,103,104,116,109,111,117,115,101, 0,108,105,103,104,116, 91,
+ 51, 93, 0,116,119, 95,104,111,116,115,112,111,116, 0,116,119, 95,102,108, 97,103, 0,116,119, 95,104, 97,110,100,108,101,115,
+105,122,101, 0,116,119, 95,115,105,122,101, 0,116,101,120,116,105,109,101,111,117,116, 0,116,101,120, 99,111,108,108,101, 99,
+116,114, 97,116,101, 0,119,109,100,114, 97,119,109,101,116,104,111,100, 0,100,114, 97,103,116,104,114,101,115,104,111,108,100,
+ 0,109,101,109, 99, 97, 99,104,101,108,105,109,105,116, 0,112,114,101,102,101,116, 99,104,102,114, 97,109,101,115, 0,102,114,
+ 97,109,101,115,101,114,118,101,114,112,111,114,116, 0,112, 97,100, 95,114,111,116, 95, 97,110,103,108,101, 0,111, 98, 99,101,
+110,116,101,114, 95,100,105, 97, 0,114,118,105,115,105,122,101, 0,114,118,105, 98,114,105,103,104,116, 0,114,101, 99,101,110,
+116, 95,102,105,108,101,115, 0,115,109,111,111,116,104, 95,118,105,101,119,116,120, 0,103,108,114,101,115,108,105,109,105,116,
+ 0, 99,117,114,115,115,105,122,101, 0, 99,111,108,111,114, 95,112,105, 99,107,101,114, 95,116,121,112,101, 0,105,112,111, 95,
+110,101,119, 0,107,101,121,104, 97,110,100,108,101,115, 95,110,101,119, 0,115, 99,114, 99, 97,115,116,102,112,115, 0,115, 99,
+114, 99, 97,115,116,119, 97,105,116, 0,119,105,100,103,101,116, 95,117,110,105,116, 0, 97,110,105,115,111,116,114,111,112,105,
+ 99, 95,102,105,108,116,101,114, 0,117,115,101, 95, 49, 54, 98,105,116, 95,116,101,120,116,117,114,101,115, 0,112, 97,100, 56,
+ 0,110,100,111,102, 95,115,101,110,115,105,116,105,118,105,116,121, 0,110,100,111,102, 95,102,108, 97,103, 0,103,108, 97,108,
+112,104, 97, 99,108,105,112, 0,116,101,120,116, 95,114,101,110,100,101,114, 0,112, 97,100, 57, 0, 99,111, 98, 97, 95,119,101,
+105,103,104,116, 0,115, 99,117,108,112,116, 95,112, 97,105,110,116, 95,111,118,101,114,108, 97,121, 95, 99,111,108, 91, 51, 93,
+ 0,116,119,101, 97,107, 95,116,104,114,101,115,104,111,108,100, 0, 97,117,116,104,111,114, 91, 56, 48, 93, 0, 99,111,109,112,
+117,116,101, 95,100,101,118,105, 99,101, 95,116,121,112,101, 0, 99,111,109,112,117,116,101, 95,100,101,118,105, 99,101, 95,105,
+100, 0,102, 99,117, 95,105,110, 97, 99,116,105,118,101, 95, 97,108,112,104, 97, 0,118,101,114,116, 98, 97,115,101, 0,101,100,
+103,101, 98, 97,115,101, 0, 97,114,101, 97, 98, 97,115,101, 0, 42,110,101,119,115, 99,101,110,101, 0,114,101,100,114, 97,119,
+115, 95,102,108, 97,103, 0,102,117,108,108, 0,116,101,109,112, 0,119,105,110,105,100, 0,100,111, 95,100,114, 97,119, 0,100,
+111, 95,114,101,102,114,101,115,104, 0,100,111, 95,100,114, 97,119, 95,103,101,115,116,117,114,101, 0,100,111, 95,100,114, 97,
+119, 95,112, 97,105,110,116, 99,117,114,115,111,114, 0,100,111, 95,100,114, 97,119, 95,100,114, 97,103, 0,115,119, 97,112, 0,
+109, 97,105,110,119,105,110, 0,115,117, 98,119,105,110, 97, 99,116,105,118,101, 0, 42, 97,110,105,109,116,105,109,101,114, 0,
+ 42, 99,111,110,116,101,120,116, 0,104, 97,110,100,108,101,114, 91, 56, 93, 0, 42,110,101,119,118, 0,118,101, 99, 0, 42,118,
+ 49, 0, 42,118, 50, 0, 42,116,121,112,101, 0,112, 97,110,101,108,110, 97,109,101, 91, 54, 52, 93, 0,116, 97, 98,110, 97,109,
+101, 91, 54, 52, 93, 0,100,114, 97,119,110, 97,109,101, 91, 54, 52, 93, 0,111,102,115,120, 0,111,102,115,121, 0,115,105,122,
+101,120, 0,115,105,122,101,121, 0,108, 97, 98,101,108,111,102,115, 0, 99,111,110,116,114,111,108, 0,115,110, 97,112, 0,115,
+111,114,116,111,114,100,101,114, 0, 42,112, 97,110,101,108,116, 97, 98, 0, 42, 97, 99,116,105,118,101,100, 97,116, 97, 0,108,
+105,115,116, 95,115, 99,114,111,108,108, 0,108,105,115,116, 95,115,105,122,101, 0,108,105,115,116, 95,108, 97,115,116, 95,108,
+101,110, 0,108,105,115,116, 95,103,114,105,112, 95,115,105,122,101, 0,108,105,115,116, 95,115,101, 97,114, 99,104, 91, 54, 52,
+ 93, 0, 42,118, 51, 0, 42,118, 52, 0, 42,102,117,108,108, 0, 98,117,116,115,112, 97, 99,101,116,121,112,101, 0,104,101, 97,
+100,101,114,116,121,112,101, 0,115,112, 97, 99,101,100, 97,116, 97, 0,104, 97,110,100,108,101,114,115, 0, 97, 99,116,105,111,
+110,122,111,110,101,115, 0,119,105,110,114, 99,116, 0,100,114, 97,119,114, 99,116, 0,115,119,105,110,105,100, 0,114,101,103,
+105,111,110,116,121,112,101, 0, 97,108,105,103,110,109,101,110,116, 0,100,111, 95,100,114, 97,119, 95,111,118,101,114,108, 97,
+121, 0,117,105, 98,108,111, 99,107,115, 0,112, 97,110,101,108,115, 0, 42,104,101, 97,100,101,114,115,116,114, 0, 42,114,101,
+103,105,111,110,100, 97,116, 97, 0,115,117, 98,118,115,116,114, 91, 52, 93, 0,115,117, 98,118,101,114,115,105,111,110, 0,112,
+ 97,100,115, 0,109,105,110,118,101,114,115,105,111,110, 0,109,105,110,115,117, 98,118,101,114,115,105,111,110, 0,119,105,110,
+112,111,115, 0, 42, 99,117,114,115, 99,114,101,101,110, 0, 42, 99,117,114,115, 99,101,110,101, 0,102,105,108,101,102,108, 97,
+103,115, 0,103,108,111, 98, 97,108,102, 0,114,101,118,105,115,105,111,110, 0,110, 97,109,101, 91, 50, 53, 54, 93, 0,111,114,
+105,103, 95,119,105,100,116,104, 0,111,114,105,103, 95,104,101,105,103,104,116, 0, 98,111,116,116,111,109, 0,114,105,103,104,
+116, 0,120,111,102,115, 0,121,111,102,115, 0,108,105,102,116, 91, 51, 93, 0,103, 97,109,109, 97, 91, 51, 93, 0,103, 97,105,
+110, 91, 51, 93, 0,100,105,114, 91, 55, 54, 56, 93, 0,116, 99, 0, 98,117,105,108,100, 95,115,105,122,101, 95,102,108, 97,103,
+115, 0, 98,117,105,108,100, 95,116, 99, 95,102,108, 97,103,115, 0,100,111,110,101, 0,115,116, 97,114,116,115,116,105,108,108,
+ 0,101,110,100,115,116,105,108,108, 0, 42,115,116,114,105,112,100, 97,116, 97, 0, 42, 99,114,111,112, 0, 42,116,114, 97,110,
+115,102,111,114,109, 0, 42, 99,111,108,111,114, 95, 98, 97,108, 97,110, 99,101, 0, 42,105,110,115,116, 97,110, 99,101, 95,112,
+114,105,118, 97,116,101, 95,100, 97,116, 97, 0, 42, 42, 99,117,114,114,101,110,116, 95,112,114,105,118, 97,116,101, 95,100, 97,
+116, 97, 0, 42,116,109,112, 0,115,116, 97,114,116,111,102,115, 0,101,110,100,111,102,115, 0,109, 97, 99,104,105,110,101, 0,
+115,116, 97,114,116,100,105,115,112, 0,101,110,100,100,105,115,112, 0,115, 97,116, 0,109,117,108, 0,104, 97,110,100,115,105,
+122,101, 0, 97,110,105,109, 95,112,114,101,115,101,101,107, 0,115,116,114,101, 97,109,105,110,100,101,120, 0,109,117,108,116,
+105, 99, 97,109, 95,115,111,117,114, 99,101, 0, 99,108,105,112, 95,102,108, 97,103, 0, 42,115,116,114,105,112, 0, 42,115, 99,
+101,110,101, 95, 99, 97,109,101,114, 97, 0,101,102,102,101, 99,116, 95,102, 97,100,101,114, 0,115,112,101,101,100, 95,102, 97,
+100,101,114, 0, 42,115,101,113, 49, 0, 42,115,101,113, 50, 0, 42,115,101,113, 51, 0,115,101,113, 98, 97,115,101, 0, 42,115,
+111,117,110,100, 0, 42,115, 99,101,110,101, 95,115,111,117,110,100, 0,112,105,116, 99,104, 0,112, 97,110, 0,115,116,114,111,
+ 98,101, 0, 42,101,102,102,101, 99,116,100, 97,116, 97, 0, 97,110,105,109, 95,115,116, 97,114,116,111,102,115, 0, 97,110,105,
+109, 95,101,110,100,111,102,115, 0, 98,108,101,110,100, 95,109,111,100,101, 0, 98,108,101,110,100, 95,111,112, 97, 99,105,116,
+121, 0, 42,111,108,100, 98, 97,115,101,112, 0, 42,112, 97,114,115,101,113, 0, 42,115,101,113, 98, 97,115,101,112, 0,109,101,
+116, 97,115,116, 97, 99,107, 0, 42, 97, 99,116, 95,115,101,113, 0, 97, 99,116, 95,105,109, 97,103,101,100,105,114, 91, 49, 48,
+ 50, 52, 93, 0, 97, 99,116, 95,115,111,117,110,100,100,105,114, 91, 49, 48, 50, 52, 93, 0,111,118,101,114, 95,111,102,115, 0,
+111,118,101,114, 95, 99,102,114, 97, 0,111,118,101,114, 95,102,108, 97,103, 0,111,118,101,114, 95, 98,111,114,100,101,114, 0,
+101,100,103,101, 87,105,100,116,104, 0,102,111,114,119, 97,114,100, 0,119,105,112,101,116,121,112,101, 0,102, 77,105,110,105,
+ 0,102, 67,108, 97,109,112, 0,102, 66,111,111,115,116, 0,100, 68,105,115,116, 0,100, 81,117, 97,108,105,116,121, 0, 98, 78,
+111, 67,111,109,112, 0, 83, 99, 97,108,101,120, 73,110,105, 0, 83, 99, 97,108,101,121, 73,110,105, 0,120, 73,110,105, 0,121,
+ 73,110,105, 0,114,111,116, 73,110,105, 0,105,110,116,101,114,112,111,108, 97,116,105,111,110, 0,117,110,105,102,111,114,109,
+ 95,115, 99, 97,108,101, 0, 42,102,114, 97,109,101, 77, 97,112, 0,103,108,111, 98, 97,108, 83,112,101,101,100, 0,108, 97,115,
+116, 86, 97,108,105,100, 70,114, 97,109,101, 0, 98,117,116,116,121,112,101, 0,117,115,101,114,106,105,116, 0,115,116, 97, 0,
+116,111,116,112, 97,114,116, 0,110,111,114,109,102, 97, 99, 0,111, 98,102, 97, 99, 0,114, 97,110,100,102, 97, 99, 0,116,101,
+120,102, 97, 99, 0,114, 97,110,100,108,105,102,101, 0,102,111,114, 99,101, 91, 51, 93, 0,118,101, 99,116,115,105,122,101, 0,
+109, 97,120,108,101,110, 0,100,101,102,118,101, 99, 91, 51, 93, 0,109,117,108,116, 91, 52, 93, 0,108,105,102,101, 91, 52, 93,
+ 0, 99,104,105,108,100, 91, 52, 93, 0,109, 97,116, 91, 52, 93, 0,116,101,120,109, 97,112, 0, 99,117,114,109,117,108,116, 0,
+115,116, 97,116,105, 99,115,116,101,112, 0,111,109, 97,116, 0,116,105,109,101,116,101,120, 0,115,112,101,101,100,116,101,120,
+ 0,102,108, 97,103, 50,110,101,103, 0,118,101,114,116,103,114,111,117,112, 95,118, 0,118,103,114,111,117,112,110, 97,109,101,
+ 91, 54, 52, 93, 0,118,103,114,111,117,112,110, 97,109,101, 95,118, 91, 54, 52, 93, 0, 42,107,101,121,115, 0,109,105,110,102,
+ 97, 99, 0,110,114, 0,117,115,101,100, 0,117,115,101,100,101,108,101,109, 0, 42,112,111,105,110, 0,114,101,115,101,116,100,
+105,115,116, 0,108, 97,115,116,118, 97,108, 0, 42,109, 97, 0,107,101,121, 0,113,117, 97,108, 0,113,117, 97,108, 50, 0,116,
+ 97,114,103,101,116, 78, 97,109,101, 91, 54, 52, 93, 0,116,111,103,103,108,101, 78, 97,109,101, 91, 54, 52, 93, 0,118, 97,108,
+117,101, 91, 54, 52, 93, 0,109, 97,120,118, 97,108,117,101, 91, 54, 52, 93, 0,100,101,108, 97,121, 0,100,117,114, 97,116,105,
+111,110, 0,109, 97,116,101,114,105, 97,108, 78, 97,109,101, 91, 54, 52, 93, 0,100, 97,109,112,116,105,109,101,114, 0,112,114,
+111,112,110, 97,109,101, 91, 54, 52, 93, 0,109, 97,116,110, 97,109,101, 91, 54, 52, 93, 0, 97,120,105,115,102,108, 97,103, 0,
+112,111,115,101, 99,104, 97,110,110,101,108, 91, 54, 52, 93, 0, 99,111,110,115,116,114, 97,105,110,116, 91, 54, 52, 93, 0, 42,
+102,114,111,109, 79, 98,106,101, 99,116, 0,115,117, 98,106,101, 99,116, 91, 54, 52, 93, 0, 98,111,100,121, 91, 54, 52, 93, 0,
+111,116,121,112,101, 0,112,117,108,115,101, 0,102,114,101,113, 0,116,111,116,108,105,110,107,115, 0, 42, 42,108,105,110,107,
+115, 0,116, 97,112, 0,106,111,121,105,110,100,101,120, 0, 97,120,105,115, 95,115,105,110,103,108,101, 0, 97,120,105,115,102,
+ 0, 98,117,116,116,111,110, 0,104, 97,116, 0,104, 97,116,102, 0,112,114,101, 99,105,115,105,111,110, 0,115,116,114, 91, 49,
+ 50, 56, 93, 0, 42,109,121,110,101,119, 0,105,110,112,117,116,115, 0,116,111,116,115,108,105,110,107,115, 0, 42, 42,115,108,
+105,110,107,115, 0,118, 97,108,111, 0,115,116, 97,116,101, 95,109, 97,115,107, 0, 42, 97, 99,116, 0,102,114, 97,109,101, 80,
+114,111,112, 91, 54, 52, 93, 0, 98,108,101,110,100,105,110, 0,112,114,105,111,114,105,116,121, 0,101,110,100, 95,114,101,115,
+101,116, 0,115,116,114,105,100,101, 97,120,105,115, 0,115,116,114,105,100,101,108,101,110,103,116,104, 0,108, 97,121,101,114,
+ 95,119,101,105,103,104,116, 0,109,105,110, 95,103, 97,105,110, 0,109, 97,120, 95,103, 97,105,110, 0,114,101,102,101,114,101,
+110, 99,101, 95,100,105,115,116, 97,110, 99,101, 0,109, 97,120, 95,100,105,115,116, 97,110, 99,101, 0,114,111,108,108,111,102,
+102, 95,102, 97, 99,116,111,114, 0, 99,111,110,101, 95,105,110,110,101,114, 95, 97,110,103,108,101, 0, 99,111,110,101, 95,111,
+117,116,101,114, 95, 97,110,103,108,101, 0, 99,111,110,101, 95,111,117,116,101,114, 95,103, 97,105,110, 0,115,110,100,110,114,
+ 0,115,111,117,110,100, 51, 68, 0,112, 97,100, 54, 91, 49, 93, 0, 42,109,101, 0,108,105,110, 86,101,108,111, 99,105,116,121,
+ 91, 51, 93, 0, 97,110,103, 86,101,108,111, 99,105,116,121, 91, 51, 93, 0,108,111, 99, 97,108,102,108, 97,103, 0,100,121,110,
+ 95,111,112,101,114, 97,116,105,111,110, 0,102,111,114, 99,101,108,111, 99, 91, 51, 93, 0,102,111,114, 99,101,114,111,116, 91,
+ 51, 93, 0,112, 97,100, 49, 91, 51, 93, 0,108,105,110,101, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, 97,110,103,
+117,108, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, 42,114,101,102,101,114,101,110, 99,101, 0,109,105,110, 0,109,
+ 97,120, 0,114,111,116,100, 97,109,112, 0,109,105,110,108,111, 99, 91, 51, 93, 0,109, 97,120,108,111, 99, 91, 51, 93, 0,109,
+105,110,114,111,116, 91, 51, 93, 0,109, 97,120,114,111,116, 91, 51, 93, 0,109, 97,116,112,114,111,112, 91, 54, 52, 93, 0, 98,
+117,116,115,116, 97, 0, 98,117,116,101,110,100, 0,100,105,115,116,114,105, 98,117,116,105,111,110, 0,105,110,116, 95, 97,114,
+103, 95, 49, 0,105,110,116, 95, 97,114,103, 95, 50, 0,102,108,111, 97,116, 95, 97,114,103, 95, 49, 0,102,108,111, 97,116, 95,
+ 97,114,103, 95, 50, 0,116,111, 80,114,111,112, 78, 97,109,101, 91, 54, 52, 93, 0, 42,116,111, 79, 98,106,101, 99,116, 0, 98,
+111,100,121, 84,121,112,101, 0,102,105,108,101,110, 97,109,101, 91, 54, 52, 93, 0,108,111, 97,100, 97,110,105,110, 97,109,101,
+ 91, 54, 52, 93, 0,105,110,116, 95, 97,114,103, 0,102,108,111, 97,116, 95, 97,114,103, 0,105,110,102,108,117,101,110, 99,101,
+ 0, 42,115,117, 98,116, 97,114,103,101,116, 0,102, 97, 99,105,110,103, 97,120,105,115, 0,118,101,108,111, 99,105,116,121, 0,
+ 97, 99, 99,101,108,101,114, 97,116,105,111,110, 0,116,117,114,110,115,112,101,101,100, 0,117,112,100, 97,116,101, 84,105,109,
+101, 0, 42,110, 97,118,109,101,115,104, 0,103,111, 0, 42,110,101,119,112, 97, 99,107,101,100,102,105,108,101, 0, 97,116,116,
+101,110,117, 97,116,105,111,110, 0,100,105,115,116, 97,110, 99,101, 0, 42, 99, 97, 99,104,101, 0, 42,119, 97,118,101,102,111,
+114,109, 0, 42,112,108, 97,121, 98, 97, 99,107, 95,104, 97,110,100,108,101, 0, 42,108, 97,109,112,114,101,110, 0,103,111, 98,
+106,101, 99,116, 0,100,117,112,108,105, 95,111,102,115, 91, 51, 93, 0, 42,112,114,111,112, 0, 99,104,105,108,100, 98, 97,115,
+101, 0,114,111,108,108, 0,104,101, 97,100, 91, 51, 93, 0,116, 97,105,108, 91, 51, 93, 0, 98,111,110,101, 95,109, 97,116, 91,
+ 51, 93, 91, 51, 93, 0, 97,114,109, 95,104,101, 97,100, 91, 51, 93, 0, 97,114,109, 95,116, 97,105,108, 91, 51, 93, 0, 97,114,
+109, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 97,114,109, 95,114,111,108,108, 0,120,119,105,100,116,104, 0,122,119,105,100,
+116,104, 0,101, 97,115,101, 49, 0,101, 97,115,101, 50, 0,114, 97,100, 95,104,101, 97,100, 0,114, 97,100, 95,116, 97,105,108,
+ 0,112, 97,100, 91, 49, 93, 0, 98,111,110,101, 98, 97,115,101, 0, 99,104, 97,105,110, 98, 97,115,101, 0, 42,101,100, 98,111,
+ 0, 42, 97, 99,116, 95, 98,111,110,101, 0, 42, 97, 99,116, 95,101,100, 98,111,110,101, 0, 42,115,107,101,116, 99,104, 0,103,
+101,118,101,114,116,100,101,102,111,114,109,101,114, 0,108, 97,121,101,114, 95,117,115,101,100, 0,108, 97,121,101,114, 95,112,
+114,111,116,101, 99,116,101,100, 0,103,104,111,115,116,101,112, 0,103,104,111,115,116,115,105,122,101, 0,103,104,111,115,116,
+116,121,112,101, 0,112, 97,116,104,115,105,122,101, 0,103,104,111,115,116,115,102, 0,103,104,111,115,116,101,102, 0,112, 97,
+116,104,115,102, 0,112, 97,116,104,101,102, 0,112, 97,116,104, 98, 99, 0,112, 97,116,104, 97, 99, 0, 42,112,111,105,110,116,
+115, 0,115,116, 97,114,116, 95,102,114, 97,109,101, 0,101,110,100, 95,102,114, 97,109,101, 0,103,104,111,115,116, 95,115,102,
+ 0,103,104,111,115,116, 95,101,102, 0,103,104,111,115,116, 95, 98, 99, 0,103,104,111,115,116, 95, 97, 99, 0,103,104,111,115,
+116, 95,116,121,112,101, 0,103,104,111,115,116, 95,115,116,101,112, 0,103,104,111,115,116, 95,102,108, 97,103, 0,112, 97,116,
+104, 95,116,121,112,101, 0,112, 97,116,104, 95,115,116,101,112, 0,112, 97,116,104, 95,118,105,101,119,102,108, 97,103, 0,112,
+ 97,116,104, 95, 98, 97,107,101,102,108, 97,103, 0,112, 97,116,104, 95,115,102, 0,112, 97,116,104, 95,101,102, 0,112, 97,116,
+104, 95, 98, 99, 0,112, 97,116,104, 95, 97, 99, 0,105,107,102,108, 97,103, 0, 97,103,114,112, 95,105,110,100,101,120, 0, 99,
+111,110,115,116,102,108, 97,103, 0,115,101,108,101, 99,116,102,108, 97,103, 0,112, 97,100, 48, 91, 54, 93, 0, 42, 98,111,110,
+101, 0, 42, 99,104,105,108,100, 0,105,107,116,114,101,101, 0,115,105,107,116,114,101,101, 0, 42, 99,117,115,116,111,109, 0,
+ 42, 99,117,115,116,111,109, 95,116,120, 0,101,117,108, 91, 51, 93, 0, 99,104, 97,110, 95,109, 97,116, 91, 52, 93, 91, 52, 93,
+ 0,112,111,115,101, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,111,115,101, 95,104,101, 97,100, 91, 51, 93, 0,112,111,115,
+101, 95,116, 97,105,108, 91, 51, 93, 0,108,105,109,105,116,109,105,110, 91, 51, 93, 0,108,105,109,105,116,109, 97,120, 91, 51,
+ 93, 0,115,116,105,102,102,110,101,115,115, 91, 51, 93, 0,105,107,115,116,114,101,116, 99,104, 0,105,107,114,111,116,119,101,
+105,103,104,116, 0,105,107,108,105,110,119,101,105,103,104,116, 0, 42,116,101,109,112, 0, 99,104, 97,110, 98, 97,115,101, 0,
+ 42, 99,104, 97,110,104, 97,115,104, 0,112,114,111,120,121, 95,108, 97,121,101,114, 0,115,116,114,105,100,101, 95,111,102,102,
+115,101,116, 91, 51, 93, 0, 99,121, 99,108,105, 99, 95,111,102,102,115,101,116, 91, 51, 93, 0, 97,103,114,111,117,112,115, 0,
+ 97, 99,116,105,118,101, 95,103,114,111,117,112, 0,105,107,115,111,108,118,101,114, 0, 42,105,107,100, 97,116, 97, 0, 42,105,
+107,112, 97,114, 97,109, 0,112,114,111,120,121, 95, 97, 99,116, 95, 98,111,110,101, 91, 54, 52, 93, 0,110,117,109,105,116,101,
+114, 0,110,117,109,115,116,101,112, 0,109,105,110,115,116,101,112, 0,109, 97,120,115,116,101,112, 0,115,111,108,118,101,114,
+ 0,102,101,101,100, 98, 97, 99,107, 0,109, 97,120,118,101,108, 0,100, 97,109,112,109, 97,120, 0,100, 97,109,112,101,112,115,
+ 0, 99,104, 97,110,110,101,108,115, 0, 99,117,115,116,111,109, 67,111,108, 0, 99,115, 0, 99,117,114,118,101,115, 0,103,114,
+111,117,112,115, 0, 97, 99,116,105,118,101, 95,109, 97,114,107,101,114, 0,105,100,114,111,111,116, 0, 42,115,111,117,114, 99,
+101, 0, 42,102,105,108,116,101,114, 95,103,114,112, 0,115,101, 97,114, 99,104,115,116,114, 91, 54, 52, 93, 0,102,105,108,116,
+101,114,102,108, 97,103, 0,114,101,110, 97,109,101, 73,110,100,101,120, 0, 97,100,115, 0,116,105,109,101,115,108,105,100,101,
+ 0, 42,103,114,112, 0,110, 97,109,101, 91, 51, 48, 93, 0,111,119,110,115,112, 97, 99,101, 0,116, 97,114,115,112, 97, 99,101,
+ 0,101,110,102,111,114, 99,101, 0,104,101, 97,100,116, 97,105,108, 0,108,105,110, 95,101,114,114,111,114, 0,114,111,116, 95,
+101,114,114,111,114, 0, 42,116, 97,114, 0,109, 97,116,114,105,120, 91, 52, 93, 91, 52, 93, 0,115,112, 97, 99,101, 0,114,111,
+116, 79,114,100,101,114, 0,116, 97,114,110,117,109, 0,116, 97,114,103,101,116,115, 0,105,116,101,114, 97,116,105,111,110,115,
+ 0,114,111,111,116, 98,111,110,101, 0,109, 97,120, 95,114,111,111,116, 98,111,110,101, 0, 42,112,111,108,101,116, 97,114, 0,
+112,111,108,101,115,117, 98,116, 97,114,103,101,116, 91, 54, 52, 93, 0,112,111,108,101, 97,110,103,108,101, 0,111,114,105,101,
+110,116,119,101,105,103,104,116, 0,103,114, 97, 98,116, 97,114,103,101,116, 91, 51, 93, 0,110,117,109,112,111,105,110,116,115,
+ 0, 99,104, 97,105,110,108,101,110, 0,120,122, 83, 99, 97,108,101, 77,111,100,101, 0,114,101,115,101,114,118,101,100, 49, 0,
+114,101,115,101,114,118,101,100, 50, 0,109,105,110,109, 97,120,102,108, 97,103, 0,115,116,117, 99,107, 0, 99, 97, 99,104,101,
+ 91, 51, 93, 0,108,111, 99,107,102,108, 97,103, 0,102,111,108,108,111,119,102,108, 97,103, 0,118,111,108,109,111,100,101, 0,
+112,108, 97,110,101, 0,111,114,103,108,101,110,103,116,104, 0, 98,117,108,103,101, 0,112,105,118, 88, 0,112,105,118, 89, 0,
+112,105,118, 90, 0, 97,120, 88, 0, 97,120, 89, 0, 97,120, 90, 0,109,105,110, 76,105,109,105,116, 91, 54, 93, 0,109, 97,120,
+ 76,105,109,105,116, 91, 54, 93, 0,101,120,116,114, 97, 70,122, 0,105,110,118,109, 97,116, 91, 52, 93, 91, 52, 93, 0,102,114,
+111,109, 0,116,111, 0,109, 97,112, 91, 51, 93, 0,101,120,112,111, 0,102,114,111,109, 95,109,105,110, 91, 51, 93, 0,102,114,
+111,109, 95,109, 97,120, 91, 51, 93, 0,116,111, 95,109,105,110, 91, 51, 93, 0,116,111, 95,109, 97,120, 91, 51, 93, 0,114,111,
+116, 65,120,105,115, 0,122,109,105,110, 0,122,109, 97,120, 0,112, 97,100, 91, 57, 93, 0,116,114, 97, 99,107, 91, 54, 52, 93,
+ 0,111, 98,106,101, 99,116, 91, 54, 52, 93, 0, 42,100,101,112,116,104, 95,111, 98, 0, 99,104, 97,110,110,101,108, 91, 51, 50,
+ 93, 0,110,111, 95,114,111,116, 95, 97,120,105,115, 0,115,116,114,105,100,101, 95, 97,120,105,115, 0, 99,117,114,109,111,100,
+ 0, 97, 99,116,115,116, 97,114,116, 0, 97, 99,116,101,110,100, 0, 97, 99,116,111,102,102,115, 0,115,116,114,105,100,101,108,
+101,110, 0, 98,108,101,110,100,111,117,116, 0,115,116,114,105,100,101, 99,104, 97,110,110,101,108, 91, 51, 50, 93, 0,111,102,
+102,115, 95, 98,111,110,101, 91, 51, 50, 93, 0,104, 97,115,105,110,112,117,116, 0,104, 97,115,111,117,116,112,117,116, 0,100,
+ 97,116, 97,116,121,112,101, 0,115,111, 99,107,101,116,116,121,112,101, 0,105,115, 95, 99,111,112,121, 0,101,120,116,101,114,
+110, 97,108, 0, 42,110,101,119, 95,115,111, 99,107, 0, 42,115,116,111,114, 97,103,101, 0,108,105,109,105,116, 0,115,116,114,
+117, 99,116, 95,116,121,112,101, 0,108,111, 99,120, 0,108,111, 99,121, 0, 42,100,101,102, 97,117,108,116, 95,118, 97,108,117,
+101, 0,115,116, 97, 99,107, 95,105,110,100,101,120, 0,115,116, 97, 99,107, 95,116,121,112,101, 0,111,119,110, 95,105,110,100,
+101,120, 0,116,111, 95,105,110,100,101,120, 0, 42,103,114,111,117,112,115,111, 99,107, 0, 42,108,105,110,107, 0,110,115, 0,
+ 42,114,101, 99,116, 0,120,115,105,122,101, 0,121,115,105,122,101, 0, 42,110,101,119, 95,110,111,100,101, 0,108, 97,115,116,
+121, 0,111,117,116,112,117,116,115, 0,109,105,110,105,119,105,100,116,104, 0,117,112,100, 97,116,101, 0,108, 97, 98,101,108,
+ 91, 54, 52, 93, 0, 99,117,115,116,111,109, 49, 0, 99,117,115,116,111,109, 50, 0, 99,117,115,116,111,109, 51, 0, 99,117,115,
+116,111,109, 52, 0,110,101,101,100, 95,101,120,101, 99, 0,101,120,101, 99, 0, 42,116,104,114,101, 97,100,100, 97,116, 97, 0,
+116,111,116,114, 0, 98,117,116,114, 0,112,114,118,114, 0, 42, 98,108,111, 99,107, 0, 42,116,121,112,101,105,110,102,111, 0,
+ 42,102,114,111,109,110,111,100,101, 0, 42,116,111,110,111,100,101, 0, 42,102,114,111,109,115,111, 99,107, 0, 42,116,111,115,
+111, 99,107, 0,110,111,100,101,115, 0,108,105,110,107,115, 0,105,110,105,116, 0, 99,117,114, 95,105,110,100,101,120, 0,110,
+111,100,101,116,121,112,101, 0, 42,101,120,101, 99,100, 97,116, 97, 0, 40, 42,112,114,111,103,114,101,115,115, 41, 40, 41, 0,
+ 40, 42,115,116, 97,116,115, 95,100,114, 97,119, 41, 40, 41, 0, 40, 42,116,101,115,116, 95, 98,114,101, 97,107, 41, 40, 41, 0,
+ 42,116, 98,104, 0, 42,112,114,104, 0, 42,115,100,104, 0,118, 97,108,117,101, 91, 51, 93, 0,118, 97,108,117,101, 91, 52, 93,
+ 0, 99,121, 99,108,105, 99, 0,109,111,118,105,101, 0,115, 97,109,112,108,101,115, 0,109, 97,120,115,112,101,101,100, 0,109,
+105,110,115,112,101,101,100, 0, 99,117,114,118,101,100, 0,112,101,114, 99,101,110,116,120, 0,112,101,114, 99,101,110,116,121,
+ 0, 98,111,107,101,104, 0,103, 97,109,109, 97, 0,105,109, 97,103,101, 95,105,110, 95,119,105,100,116,104, 0,105,109, 97,103,
+101, 95,105,110, 95,104,101,105,103,104,116, 0, 99,101,110,116,101,114, 95,120, 0, 99,101,110,116,101,114, 95,121, 0,115,112,
+105,110, 0,119,114, 97,112, 0,115,105,103,109, 97, 95, 99,111,108,111,114, 0,115,105,103,109, 97, 95,115,112, 97, 99,101, 0,
+104,117,101, 0, 98, 97,115,101, 95,112, 97,116,104, 91, 49, 48, 50, 52, 93, 0,102,111,114,109, 97,116, 0, 97, 99,116,105,118,
+101, 95,105,110,112,117,116, 0,117,115,101, 95,114,101,110,100,101,114, 95,102,111,114,109, 97,116, 0,117,115,101, 95,110,111,
+100,101, 95,102,111,114,109, 97,116, 0,116, 49, 0,116, 50, 0,116, 51, 0,102,115,116,114,101,110,103,116,104, 0,102, 97,108,
+112,104, 97, 0,107,101,121, 91, 52, 93, 0, 97,108,103,111,114,105,116,104,109, 0, 99,104, 97,110,110,101,108, 0,120, 49, 0,
+120, 50, 0,121, 49, 0,121, 50, 0,102, 97, 99, 95,120, 49, 0,102, 97, 99, 95,120, 50, 0,102, 97, 99, 95,121, 49, 0,102, 97,
+ 99, 95,121, 50, 0, 99,111,108,110, 97,109,101, 91, 54, 52, 93, 0, 98,107,116,121,112,101, 0,112, 97,100, 95, 99, 49, 0,103,
+ 97,109, 99,111, 0,110,111, 95,122, 98,117,102, 0,102,115,116,111,112, 0,109, 97,120, 98,108,117,114, 0, 98,116,104,114,101,
+115,104, 0,114,111,116, 97,116,105,111,110, 0,112, 97,100, 95,102, 49, 0, 42,100,105, 99,116, 0, 42,110,111,100,101, 0, 99,
+111,108,109,111,100, 0,109,105,120, 0,102, 97,100,101, 0, 97,110,103,108,101, 95,111,102,115, 0,109, 0, 99, 0,106,105,116,
+ 0,112,114,111,106, 0,102,105,116, 0,115,108,111,112,101, 91, 51, 93, 0,112,111,119,101,114, 91, 51, 93, 0,108,105,102,116,
+ 95,108,103,103, 91, 51, 93, 0,103, 97,109,109, 97, 95,105,110,118, 91, 51, 93, 0,108,105,109, 99,104, 97,110, 0,117,110,115,
+112,105,108,108, 0,108,105,109,115, 99, 97,108,101, 0,117,115,112,105,108,108,114, 0,117,115,112,105,108,108,103, 0,117,115,
+112,105,108,108, 98, 0,116,101,120, 95,109, 97,112,112,105,110,103, 0, 99,111,108,111,114, 95,109, 97,112,112,105,110,103, 0,
+115,117,110, 95,100,105,114,101, 99,116,105,111,110, 91, 51, 93, 0,116,117,114, 98,105,100,105,116,121, 0, 99,111,108,111,114,
+ 95,115,112, 97, 99,101, 0,112,114,111,106,101, 99,116,105,111,110, 0,103,114, 97,100,105,101,110,116, 95,116,121,112,101, 0,
+ 99,111,108,111,114,105,110,103, 0,109,117,115,103,114, 97,118,101, 95,116,121,112,101, 0,119, 97,118,101, 95,116,121,112,101,
+ 0,115,104,111,114,116,121, 0,109,105,110,116, 97, 98,108,101, 0,109, 97,120,116, 97, 98,108,101, 0,101,120,116, 95,105,110,
+ 91, 50, 93, 0,101,120,116, 95,111,117,116, 91, 50, 93, 0, 42, 99,117,114,118,101, 0, 42,116, 97, 98,108,101, 0, 42,112,114,
+101,109,117,108,116, 97, 98,108,101, 0,112,114,101,115,101,116, 0, 99,104, 97,110,103,101,100, 95,116,105,109,101,115,116, 97,
+109,112, 0, 99,117,114,114, 0, 99,108,105,112,114, 0, 99,109, 91, 52, 93, 0, 98,108, 97, 99,107, 91, 51, 93, 0,119,104,105,
+116,101, 91, 51, 93, 0, 98,119,109,117,108, 91, 51, 93, 0,115, 97,109,112,108,101, 91, 51, 93, 0,120, 95,114,101,115,111,108,
+117,116,105,111,110, 0,100, 97,116, 97, 95,114, 91, 50, 53, 54, 93, 0,100, 97,116, 97, 95,103, 91, 50, 53, 54, 93, 0,100, 97,
+116, 97, 95, 98, 91, 50, 53, 54, 93, 0,100, 97,116, 97, 95,108,117,109, 97, 91, 50, 53, 54, 93, 0,115, 97,109,112,108,101, 95,
+102,117,108,108, 0,115, 97,109,112,108,101, 95,108,105,110,101,115, 0, 97, 99, 99,117,114, 97, 99,121, 0,119, 97,118,101,102,
+114,109, 95,109,111,100,101, 0,119, 97,118,101,102,114,109, 95, 97,108,112,104, 97, 0,119, 97,118,101,102,114,109, 95,121,102,
+ 97, 99, 0,119, 97,118,101,102,114,109, 95,104,101,105,103,104,116, 0,118,101, 99,115, 99,111,112,101, 95, 97,108,112,104, 97,
+ 0,118,101, 99,115, 99,111,112,101, 95,104,101,105,103,104,116, 0,109,105,110,109, 97,120, 91, 51, 93, 91, 50, 93, 0,104,105,
+115,116, 0, 42,119, 97,118,101,102,111,114,109, 95, 49, 0, 42,119, 97,118,101,102,111,114,109, 95, 50, 0, 42,119, 97,118,101,
+102,111,114,109, 95, 51, 0, 42,118,101, 99,115, 99,111,112,101, 0,119, 97,118,101,102,111,114,109, 95,116,111,116, 0,111,102,
+102,115,101,116, 91, 50, 93, 0, 99,108,111,110,101, 0,109,116,101,120, 0, 42,105, 99,111,110, 95,105,109, 98,117,102, 0,105,
+ 99,111,110, 95,102,105,108,101,112, 97,116,104, 91, 49, 48, 50, 52, 93, 0,110,111,114,109, 97,108, 95,119,101,105,103,104,116,
+ 0,111, 98, 95,109,111,100,101, 0,106,105,116,116,101,114, 0,115,109,111,111,116,104, 95,115,116,114,111,107,101, 95,114, 97,
+100,105,117,115, 0,115,109,111,111,116,104, 95,115,116,114,111,107,101, 95,102, 97, 99,116,111,114, 0,114, 97,116,101, 0,114,
+103, 98, 91, 51, 93, 0,115, 99,117,108,112,116, 95,112,108, 97,110,101, 0,112,108, 97,110,101, 95,111,102,102,115,101,116, 0,
+115, 99,117,108,112,116, 95,116,111,111,108, 0,118,101,114,116,101,120,112, 97,105,110,116, 95,116,111,111,108, 0,105,109, 97,
+103,101,112, 97,105,110,116, 95,116,111,111,108, 0,112, 97,100, 51, 91, 53, 93, 0, 97,117,116,111,115,109,111,111,116,104, 95,
+102, 97, 99,116,111,114, 0, 99,114,101, 97,115,101, 95,112,105,110, 99,104, 95,102, 97, 99,116,111,114, 0,112,108, 97,110,101,
+ 95,116,114,105,109, 0,116,101,120,116,117,114,101, 95,115, 97,109,112,108,101, 95, 98,105, 97,115, 0,116,101,120,116,117,114,
+101, 95,111,118,101,114,108, 97,121, 95, 97,108,112,104, 97, 0, 97,100,100, 95, 99,111,108, 91, 51, 93, 0,115,117, 98, 95, 99,
+111,108, 91, 51, 93, 0, 97, 99,116,105,118,101, 95,114,110,100, 0, 97, 99,116,105,118,101, 95, 99,108,111,110,101, 0, 97, 99,
+116,105,118,101, 95,109, 97,115,107, 0, 42,108, 97,121,101,114,115, 0,116,121,112,101,109, 97,112, 91, 51, 52, 93, 0,116,111,
+116,108, 97,121,101,114, 0,109, 97,120,108, 97,121,101,114, 0,116,111,116,115,105,122,101, 0, 42,112,111,111,108, 0, 42,101,
+120,116,101,114,110, 97,108, 0,114,111,116, 91, 52, 93, 0, 97,118,101, 91, 51, 93, 0, 42,103,114,111,117,110,100, 0,119, 97,
+110,100,101,114, 91, 51, 93, 0,114,101,115,116, 95,108,101,110,103,116,104, 0,112, 97,114,116,105, 99,108,101, 95,105,110,100,
+101,120, 91, 50, 93, 0,100,101,108,101,116,101, 95,102,108, 97,103, 0,110,117,109, 0,112, 97,114,101,110,116, 0,112, 97, 91,
+ 52, 93, 0,119, 91, 52, 93, 0,102,117,118, 91, 52, 93, 0,102,111,102,102,115,101,116, 0,112,114,101,118, 95,115,116, 97,116,
+101, 0, 42,104, 97,105,114, 0, 42, 98,111,105,100, 0,100,105,101,116,105,109,101, 0,110,117,109, 95,100,109, 99, 97, 99,104,
+101, 0,104, 97,105,114, 95,105,110,100,101,120, 0, 97,108,105,118,101, 0,115,112,114,105,110,103, 95,107, 0,112,108, 97,115,
+116,105, 99,105,116,121, 95, 99,111,110,115,116, 97,110,116, 0,121,105,101,108,100, 95,114, 97,116,105,111, 0,112,108, 97,115,
+116,105, 99,105,116,121, 95, 98, 97,108, 97,110, 99,101, 0,121,105,101,108,100, 95, 98, 97,108, 97,110, 99,101, 0,118,105,115,
+ 99,111,115,105,116,121, 95,111,109,101,103, 97, 0,118,105,115, 99,111,115,105,116,121, 95, 98,101,116, 97, 0,115,116,105,102,
+102,110,101,115,115, 95,107, 0,115,116,105,102,102,110,101,115,115, 95,107,110,101, 97,114, 0,114,101,115,116, 95,100,101,110,
+115,105,116,121, 0, 98,117,111,121, 97,110, 99,121, 0,115,112,114,105,110,103, 95,102,114, 97,109,101,115, 0, 42, 98,111,105,
+100,115, 0, 42,102,108,117,105,100, 0,100,105,115,116,114, 0,112,104,121,115,116,121,112,101, 0, 97,118,101,109,111,100,101,
+ 0,114,101, 97, 99,116,101,118,101,110,116, 0,100,114, 97,119, 0,100,114, 97,119, 95, 97,115, 0,100,114, 97,119, 95,115,105,
+122,101, 0, 99,104,105,108,100,116,121,112,101, 0,114,101,110, 95, 97,115, 0,115,117, 98,102,114, 97,109,101,115, 0,100,114,
+ 97,119, 95, 99,111,108, 0,114,101,110, 95,115,116,101,112, 0,104, 97,105,114, 95,115,116,101,112, 0,107,101,121,115, 95,115,
+116,101,112, 0, 97,100, 97,112,116, 95, 97,110,103,108,101, 0, 97,100, 97,112,116, 95,112,105,120, 0,114,111,116,102,114,111,
+109, 0,105,110,116,101,103,114, 97,116,111,114, 0, 98, 98, 95, 97,108,105,103,110, 0, 98, 98, 95,117,118, 95,115,112,108,105,
+116, 0, 98, 98, 95, 97,110,105,109, 0, 98, 98, 95,115,112,108,105,116, 95,111,102,102,115,101,116, 0, 98, 98, 95,116,105,108,
+116, 0, 98, 98, 95,114, 97,110,100, 95,116,105,108,116, 0, 98, 98, 95,111,102,102,115,101,116, 91, 50, 93, 0, 98, 98, 95,115,
+105,122,101, 91, 50, 93, 0, 98, 98, 95,118,101,108, 95,104,101, 97,100, 0, 98, 98, 95,118,101,108, 95,116, 97,105,108, 0, 99,
+111,108,111,114, 95,118,101, 99, 95,109, 97,120, 0,115,105,109,112,108,105,102,121, 95,114,101,102,115,105,122,101, 0,115,105,
+109,112,108,105,102,121, 95,114, 97,116,101, 0,115,105,109,112,108,105,102,121, 95,116,114, 97,110,115,105,116,105,111,110, 0,
+115,105,109,112,108,105,102,121, 95,118,105,101,119,112,111,114,116, 0,116,105,109,101,116,119,101, 97,107, 0, 99,111,117,114,
+ 97,110,116, 95,116, 97,114,103,101,116, 0,106,105,116,102, 97, 99, 0,101,102,102, 95,104, 97,105,114, 0,103,114,105,100, 95,
+114, 97,110,100, 0,112,115, 95,111,102,102,115,101,116, 91, 49, 93, 0,103,114,105,100, 95,114,101,115, 0,101,102,102,101, 99,
+116,111,114, 95, 97,109,111,117,110,116, 0,116,105,109,101, 95,102,108, 97,103, 0,116,105,109,101, 95,112, 97,100, 91, 51, 93,
+ 0,112, 97,114,116,102, 97, 99, 0,116, 97,110,102, 97, 99, 0,116, 97,110,112,104, 97,115,101, 0,114,101, 97, 99,116,102, 97,
+ 99, 0,111, 98, 95,118,101,108, 91, 51, 93, 0, 97,118,101,102, 97, 99, 0,112,104, 97,115,101,102, 97, 99, 0,114, 97,110,100,
+114,111,116,102, 97, 99, 0,114, 97,110,100,112,104, 97,115,101,102, 97, 99, 0,114, 97,110,100,115,105,122,101, 0, 97, 99, 99,
+ 91, 51, 93, 0,100,114, 97,103,102, 97, 99, 0, 98,114,111,119,110,102, 97, 99, 0,114, 97,110,100,108,101,110,103,116,104, 0,
+ 99,104,105,108,100, 95,110, 98,114, 0,114,101,110, 95, 99,104,105,108,100, 95,110, 98,114, 0,112, 97,114,101,110,116,115, 0,
+ 99,104,105,108,100,115,105,122,101, 0, 99,104,105,108,100,114, 97,110,100,115,105,122,101, 0, 99,104,105,108,100,114, 97,100,
+ 0, 99,104,105,108,100,102,108, 97,116, 0, 99,108,117,109,112,112,111,119, 0,107,105,110,107, 95,102,108, 97,116, 0,107,105,
+110,107, 95, 97,109,112, 95, 99,108,117,109,112, 0,114,111,117,103,104, 49, 0,114,111,117,103,104, 49, 95,115,105,122,101, 0,
+114,111,117,103,104, 50, 0,114,111,117,103,104, 50, 95,115,105,122,101, 0,114,111,117,103,104, 50, 95,116,104,114,101,115, 0,
+114,111,117,103,104, 95,101,110,100, 0,114,111,117,103,104, 95,101,110,100, 95,115,104, 97,112,101, 0, 99,108,101,110,103,116,
+104, 0, 99,108,101,110,103,116,104, 95,116,104,114,101,115, 0,112, 97,114,116,105,110,103, 95,102, 97, 99, 0,112, 97,114,116,
+105,110,103, 95,109,105,110, 0,112, 97,114,116,105,110,103, 95,109, 97,120, 0, 98,114, 97,110, 99,104, 95,116,104,114,101,115,
+ 0,100,114, 97,119, 95,108,105,110,101, 91, 50, 93, 0,112, 97,116,104, 95,115,116, 97,114,116, 0,112, 97,116,104, 95,101,110,
+100, 0,116,114, 97,105,108, 95, 99,111,117,110,116, 0,107,101,121,101,100, 95,108,111,111,112,115, 0,100,117,112,108,105,119,
+101,105,103,104,116,115, 0, 42,101,102,102, 95,103,114,111,117,112, 0, 42,100,117,112, 95,111, 98, 0, 42, 98, 98, 95,111, 98,
+ 0, 42,112,100, 50, 0, 42,112, 97,114,116, 0, 42,112, 97,114,116,105, 99,108,101,115, 0, 42, 42,112, 97,116,104, 99, 97, 99,
+104,101, 0, 42, 42, 99,104,105,108,100, 99, 97, 99,104,101, 0,112, 97,116,104, 99, 97, 99,104,101, 98,117,102,115, 0, 99,104,
+105,108,100, 99, 97, 99,104,101, 98,117,102,115, 0, 42, 99,108,109,100, 0, 42,104, 97,105,114, 95,105,110, 95,100,109, 0, 42,
+104, 97,105,114, 95,111,117,116, 95,100,109, 0, 42,116, 97,114,103,101,116, 95,111, 98, 0, 42,108, 97,116,116,105, 99,101, 0,
+116,114,101,101, 95,102,114, 97,109,101, 0, 98,118,104,116,114,101,101, 95,102,114, 97,109,101, 0, 99,104,105,108,100, 95,115,
+101,101,100, 0,116,111,116,117,110,101,120,105,115,116, 0,116,111,116, 99,104,105,108,100, 0,116,111,116, 99, 97, 99,104,101,
+100, 0,116,111,116, 99,104,105,108,100, 99, 97, 99,104,101, 0,116, 97,114,103,101,116, 95,112,115,121,115, 0,116,111,116,107,
+101,121,101,100, 0, 98, 97,107,101,115,112, 97, 99,101, 0, 98, 98, 95,117,118,110, 97,109,101, 91, 51, 93, 91, 54, 52, 93, 0,
+118,103,114,111,117,112, 91, 49, 50, 93, 0,118,103, 95,110,101,103, 0,114,116, 51, 0, 42,114,101,110,100,101,114,100, 97,116,
+ 97, 0, 42,101,102,102,101, 99,116,111,114,115, 0, 42,102,108,117,105,100, 95,115,112,114,105,110,103,115, 0,116,111,116, 95,
+102,108,117,105,100,115,112,114,105,110,103,115, 0, 97,108,108,111, 99, 95,102,108,117,105,100,115,112,114,105,110,103,115, 0,
+ 42,116,114,101,101, 0, 42,112,100,100, 0, 42,102,114, 97,110,100, 0,100,116, 95,102,114, 97, 99, 0, 95,112, 97,100, 0, 67,
+100,105,115, 0, 67,118,105, 0,115,116,114,117, 99,116,117,114, 97,108, 0, 98,101,110,100,105,110,103, 0,109, 97,120, 95, 98,
+101,110,100, 0,109, 97,120, 95,115,116,114,117, 99,116, 0,109, 97,120, 95,115,104,101, 97,114, 0, 97,118,103, 95,115,112,114,
+105,110,103, 95,108,101,110, 0,116,105,109,101,115, 99, 97,108,101, 0,101,102,102, 95,102,111,114, 99,101, 95,115, 99, 97,108,
+101, 0,101,102,102, 95,119,105,110,100, 95,115, 99, 97,108,101, 0,115,105,109, 95,116,105,109,101, 95,111,108,100, 0,118,101,
+108,111, 99,105,116,121, 95,115,109,111,111,116,104, 0, 99,111,108,108,105,100,101,114, 95,102,114,105, 99,116,105,111,110, 0,
+118,101,108, 95,100, 97,109,112,105,110,103, 0,115,116,101,112,115, 80,101,114, 70,114, 97,109,101, 0,112,114,101,114,111,108,
+108, 0,109, 97,120,115,112,114,105,110,103,108,101,110, 0,115,111,108,118,101,114, 95,116,121,112,101, 0,118,103,114,111,117,
+112, 95, 98,101,110,100, 0,118,103,114,111,117,112, 95,109, 97,115,115, 0,118,103,114,111,117,112, 95,115,116,114,117, 99,116,
+ 0,115,104, 97,112,101,107,101,121, 95,114,101,115,116, 0,112,114,101,115,101,116,115, 0,114,101,115,101,116, 0, 42, 99,111,
+108,108,105,115,105,111,110, 95,108,105,115,116, 0,101,112,115,105,108,111,110, 0,115,101,108,102, 95,102,114,105, 99,116,105,
+111,110, 0,115,101,108,102,101,112,115,105,108,111,110, 0,114,101,112,101,108, 95,102,111,114, 99,101, 0,100,105,115,116, 97,
+110, 99,101, 95,114,101,112,101,108, 0,115,101,108,102, 95,108,111,111,112, 95, 99,111,117,110,116, 0,108,111,111,112, 95, 99,
+111,117,110,116, 0,112,114,101,115,115,117,114,101, 0,116,104,105, 99,107,110,101,115,115, 0,115,116,114,111,107,101,115, 0,
+102,114, 97,109,101,110,117,109, 0, 42, 97, 99,116,102,114, 97,109,101, 0,103,115,116,101,112, 0,105,110,102,111, 91, 49, 50,
+ 56, 93, 0,115, 98,117,102,102,101,114, 95,115,105,122,101, 0,115, 98,117,102,102,101,114, 95,115,102,108, 97,103, 0, 42,115,
+ 98,117,102,102,101,114, 0,108,105,115,116, 0,112,114,105,110,116,108,101,118,101,108, 0,115,116,111,114,101,108,101,118,101,
+108, 0, 42,114,101,112,111,114,116,116,105,109,101,114, 0, 42,119,105,110,100,114, 97,119, 97, 98,108,101, 0, 42,119,105,110,
+ 97, 99,116,105,118,101, 0,119,105,110,100,111,119,115, 0,105,110,105,116,105, 97,108,105,122,101,100, 0,102,105,108,101, 95,
+115, 97,118,101,100, 0,111,112, 95,117,110,100,111, 95,100,101,112,116,104, 0,111,112,101,114, 97,116,111,114,115, 0,113,117,
+101,117,101, 0,114,101,112,111,114,116,115, 0,106,111, 98,115, 0,112, 97,105,110,116, 99,117,114,115,111,114,115, 0,100,114,
+ 97,103,115, 0,107,101,121, 99,111,110,102,105,103,115, 0, 42,100,101,102, 97,117,108,116, 99,111,110,102, 0, 42, 97,100,100,
+111,110, 99,111,110,102, 0, 42,117,115,101,114, 99,111,110,102, 0,116,105,109,101,114,115, 0, 42, 97,117,116,111,115, 97,118,
+101,116,105,109,101,114, 0, 42,103,104,111,115,116,119,105,110, 0,103,114, 97, 98, 99,117,114,115,111,114, 0, 42,115, 99,114,
+101,101,110, 0, 42,110,101,119,115, 99,114,101,101,110, 0,115, 99,114,101,101,110,110, 97,109,101, 91, 54, 52, 93, 0,112,111,
+115,120, 0,112,111,115,121, 0,119,105,110,100,111,119,115,116, 97,116,101, 0,109,111,110,105,116,111,114, 0,108, 97,115,116,
+ 99,117,114,115,111,114, 0,109,111,100, 97,108, 99,117,114,115,111,114, 0, 97,100,100,109,111,117,115,101,109,111,118,101, 0,
+ 42,101,118,101,110,116,115,116, 97,116,101, 0, 42, 99,117,114,115,119,105,110, 0, 42,116,119,101, 97,107, 0,100,114, 97,119,
+109,101,116,104,111,100, 0,100,114, 97,119,102, 97,105,108, 0, 42,100,114, 97,119,100, 97,116, 97, 0,109,111,100, 97,108,104,
+ 97,110,100,108,101,114,115, 0,115,117, 98,119,105,110,100,111,119,115, 0,103,101,115,116,117,114,101, 0,105,100,110, 97,109,
+101, 91, 54, 52, 93, 0,112,114,111,112,118, 97,108,117,101, 0,115,104,105,102,116, 0, 99,116,114,108, 0, 97,108,116, 0,111,
+115,107,101,121, 0,107,101,121,109,111,100,105,102,105,101,114, 0,109, 97,112,116,121,112,101, 0, 42,112,116,114, 0, 42,114,
+101,109,111,118,101, 95,105,116,101,109, 0, 42, 97,100,100, 95,105,116,101,109, 0,105,116,101,109,115, 0,100,105,102,102, 95,
+105,116,101,109,115, 0,115,112, 97, 99,101,105,100, 0,114,101,103,105,111,110,105,100, 0,107,109,105, 95,105,100, 0, 40, 42,
+112,111,108,108, 41, 40, 41, 0, 42,109,111,100, 97,108, 95,105,116,101,109,115, 0, 98, 97,115,101,110, 97,109,101, 91, 54, 52,
+ 93, 0, 97, 99,116,107,101,121,109, 97,112, 0, 42, 99,117,115,116,111,109,100, 97,116, 97, 0, 42,112,121, 95,105,110,115,116,
+ 97,110, 99,101, 0, 42,114,101,112,111,114,116,115, 0,109, 97, 99,114,111, 0, 42,111,112,109, 0, 42,101,100, 97,116, 97, 0,
+ 42, 99,111,101,102,102,105, 99,105,101,110,116,115, 0, 97,114,114, 97,121,115,105,122,101, 0,112,111,108,121, 95,111,114,100,
+101,114, 0, 97,109,112,108,105,116,117,100,101, 0,112,104, 97,115,101, 95,109,117,108,116,105,112,108,105,101,114, 0,112,104,
+ 97,115,101, 95,111,102,102,115,101,116, 0,118, 97,108,117,101, 95,111,102,102,115,101,116, 0,109,105,100,118, 97,108, 0, 98,
+101,102,111,114,101, 95,109,111,100,101, 0, 97,102,116,101,114, 95,109,111,100,101, 0, 98,101,102,111,114,101, 95, 99,121, 99,
+108,101,115, 0, 97,102,116,101,114, 95, 99,121, 99,108,101,115, 0,114,101, 99,116, 0,112,104, 97,115,101, 0,109,111,100,105,
+102,105, 99, 97,116,105,111,110, 0,115,116,101,112, 95,115,105,122,101, 0, 42,114,110, 97, 95,112, 97,116,104, 0,112, 99,104,
+ 97,110, 95,110, 97,109,101, 91, 51, 50, 93, 0,116,114, 97,110,115, 67,104, 97,110, 0,105,100,116,121,112,101, 0,116, 97,114,
+103,101,116,115, 91, 56, 93, 0,110,117,109, 95,116, 97,114,103,101,116,115, 0,118, 97,114,105, 97, 98,108,101,115, 0,101,120,
+112,114,101,115,115,105,111,110, 91, 50, 53, 54, 93, 0, 42,101,120,112,114, 95, 99,111,109,112, 0,118,101, 99, 91, 50, 93, 0,
+ 42,102,112,116, 0, 97,114,114, 97,121, 95,105,110,100,101,120, 0, 99,111,108,111,114, 95,109,111,100,101, 0, 99,111,108,111,
+114, 91, 51, 93, 0,102,114,111,109, 91, 49, 50, 56, 93, 0,116,111, 91, 49, 50, 56, 93, 0,109, 97,112,112,105,110,103,115, 0,
+115,116,114,105,112,115, 0, 42,114,101,109, 97,112, 0,102, 99,117,114,118,101,115, 0,115,116,114,105,112, 95,116,105,109,101,
+ 0, 98,108,101,110,100,109,111,100,101, 0,101,120,116,101,110,100,109,111,100,101, 0, 42,115,112,101, 97,107,101,114, 95,104,
+ 97,110,100,108,101, 0,103,114,111,117,112, 91, 54, 52, 93, 0,103,114,111,117,112,109,111,100,101, 0,107,101,121,105,110,103,
+102,108, 97,103, 0,112, 97,116,104,115, 0,100,101,115, 99,114,105,112,116,105,111,110, 91, 50, 52, 48, 93, 0,116,121,112,101,
+105,110,102,111, 91, 54, 52, 93, 0, 97, 99,116,105,118,101, 95,112, 97,116,104, 0, 42,116,109,112, 97, 99,116, 0,110,108, 97,
+ 95,116,114, 97, 99,107,115, 0, 42, 97, 99,116,115,116,114,105,112, 0,100,114,105,118,101,114,115, 0,111,118,101,114,114,105,
+100,101,115, 0, 97, 99,116, 95, 98,108,101,110,100,109,111,100,101, 0, 97, 99,116, 95,101,120,116,101,110,100,109,111,100,101,
+ 0, 97, 99,116, 95,105,110,102,108,117,101,110, 99,101, 0,114,117,108,101, 0,111,112,116,105,111,110,115, 0,102,101, 97,114,
+ 95,102, 97, 99,116,111,114, 0,115,105,103,110, 97,108, 95,105,100, 0,108,111,111,107, 95, 97,104,101, 97,100, 0,111,108,111,
+ 99, 91, 51, 93, 0,113,117,101,117,101, 95,115,105,122,101, 0,119, 97,110,100,101,114, 0,102,108,101,101, 95,100,105,115,116,
+ 97,110, 99,101, 0,104,101, 97,108,116,104, 0,115,116, 97,116,101, 95,105,100, 0,114,117,108,101,115, 0, 99,111,110,100,105,
+116,105,111,110,115, 0, 97, 99,116,105,111,110,115, 0,114,117,108,101,115,101,116, 95,116,121,112,101, 0,114,117,108,101, 95,
+102,117,122,122,105,110,101,115,115, 0,108, 97,115,116, 95,115,116, 97,116,101, 95,105,100, 0,108, 97,110,100,105,110,103, 95,
+115,109,111,111,116,104,110,101,115,115, 0, 98, 97,110,107,105,110,103, 0, 97,103,103,114,101,115,115,105,111,110, 0, 97,105,
+114, 95,109,105,110, 95,115,112,101,101,100, 0, 97,105,114, 95,109, 97,120, 95,115,112,101,101,100, 0, 97,105,114, 95,109, 97,
+120, 95, 97, 99, 99, 0, 97,105,114, 95,109, 97,120, 95, 97,118,101, 0, 97,105,114, 95,112,101,114,115,111,110, 97,108, 95,115,
+112, 97, 99,101, 0,108, 97,110,100, 95,106,117,109,112, 95,115,112,101,101,100, 0,108, 97,110,100, 95,109, 97,120, 95,115,112,
+101,101,100, 0,108, 97,110,100, 95,109, 97,120, 95, 97, 99, 99, 0,108, 97,110,100, 95,109, 97,120, 95, 97,118,101, 0,108, 97,
+110,100, 95,112,101,114,115,111,110, 97,108, 95,115,112, 97, 99,101, 0,108, 97,110,100, 95,115,116,105, 99,107, 95,102,111,114,
+ 99,101, 0,115,116, 97,116,101,115, 0, 42,115,109,100, 0, 42,102,108,117,105,100, 95,103,114,111,117,112, 0, 42, 99,111,108,
+108, 95,103,114,111,117,112, 0, 42,119,116, 0, 42,116,101,120, 95,119,116, 0, 42,116,101,120, 95,115,104, 97,100,111,119, 0,
+ 42,115,104, 97,100,111,119, 0,112, 48, 91, 51, 93, 0,112, 49, 91, 51, 93, 0,100,120, 0,111,109,101,103, 97, 0,116,101,109,
+112, 65,109, 98, 0, 98,101,116, 97, 0,114,101,115, 91, 51, 93, 0, 97,109,112,108,105,102,121, 0,109, 97,120,114,101,115, 0,
+118,105,101,119,115,101,116,116,105,110,103,115, 0,110,111,105,115,101, 0,100,105,115,115, 95,112,101,114, 99,101,110,116, 0,
+100,105,115,115, 95,115,112,101,101,100, 0,114,101,115, 95,119,116, 91, 51, 93, 0,100,120, 95,119,116, 0,118, 51,100,110,117,
+109, 0, 99, 97, 99,104,101, 95, 99,111,109,112, 0, 99, 97, 99,104,101, 95,104,105,103,104, 95, 99,111,109,112, 0, 42,112,111,
+105,110,116, 95, 99, 97, 99,104,101, 91, 50, 93, 0,112,116, 99, 97, 99,104,101,115, 91, 50, 93, 0, 98,111,114,100,101,114, 95,
+ 99,111,108,108,105,115,105,111,110,115, 0,116,105,109,101, 95,115, 99, 97,108,101, 0,118,111,114,116,105, 99,105,116,121, 0,
+118,101,108,111, 99,105,116,121, 91, 50, 93, 0,118,101,108, 95,109,117,108,116,105, 0,118,103,114,112, 95,104,101, 97,116, 95,
+115, 99, 97,108,101, 91, 50, 93, 0,118,103,114,111,117,112, 95,102,108,111,119, 0,118,103,114,111,117,112, 95,100,101,110,115,
+105,116,121, 0,118,103,114,111,117,112, 95,104,101, 97,116, 0, 42,112,111,105,110,116,115, 95,111,108,100, 0, 42,118,101,108,
+ 0,109, 97,116, 95,111,108,100, 91, 52, 93, 91, 52, 93, 0,118,111,108,117,109,101, 95,109, 97,120, 0,118,111,108,117,109,101,
+ 95,109,105,110, 0,100,105,115,116, 97,110, 99,101, 95,109, 97,120, 0,100,105,115,116, 97,110, 99,101, 95,114,101,102,101,114,
+101,110, 99,101, 0, 99,111,110,101, 95, 97,110,103,108,101, 95,111,117,116,101,114, 0, 99,111,110,101, 95, 97,110,103,108,101,
+ 95,105,110,110,101,114, 0, 99,111,110,101, 95,118,111,108,117,109,101, 95,111,117,116,101,114, 0,114,101,110,100,101,114, 95,
+102,108, 97,103, 0, 98,117,105,108,100, 95,115,105,122,101, 95,102,108, 97,103, 0, 98,117,105,108,100, 95,116, 99, 95,102,108,
+ 97,103, 0,108, 97,115,116,115,105,122,101, 91, 50, 93, 0,116,114, 97, 99,107,105,110,103, 0, 42,116,114, 97, 99,107,105,110,
+103, 95, 99,111,110,116,101,120,116, 0,112,114,111,120,121, 0,116,114, 97, 99,107, 95,112,114,101,118,105,101,119, 95,104,101,
+105,103,104,116, 0, 42,116,114, 97, 99,107, 95,112,114,101,118,105,101,119, 0,116,114, 97, 99,107, 95,112,111,115, 91, 50, 93,
+ 0,116,114, 97, 99,107, 95,100,105,115, 97, 98,108,101,100, 0, 42,109, 97,114,107,101,114, 0,115,108,105,100,101, 95,115, 99,
+ 97,108,101, 91, 50, 93, 0,101,114,114,111,114, 0, 42,105,110,116,114,105,110,115,105, 99,115, 0,115,101,110,115,111,114, 95,
+119,105,100,116,104, 0,112,105,120,101,108, 95, 97,115,112,101, 99,116, 0,102,111, 99, 97,108, 0,117,110,105,116,115, 0,112,
+114,105,110, 99,105,112, 97,108, 91, 50, 93, 0,107, 49, 0,107, 50, 0,107, 51, 0,112,111,115, 91, 50, 93, 0,112, 97,116, 95,
+109,105,110, 91, 50, 93, 0,112, 97,116, 95,109, 97,120, 91, 50, 93, 0,115,101, 97,114, 99,104, 95,109,105,110, 91, 50, 93, 0,
+115,101, 97,114, 99,104, 95,109, 97,120, 91, 50, 93, 0,109, 97,114,107,101,114,115,110,114, 0,108, 97,115,116, 95,109, 97,114,
+107,101,114, 0, 42,109, 97,114,107,101,114,115, 0, 98,117,110,100,108,101, 95,112,111,115, 91, 51, 93, 0,112, 97,116, 95,102,
+108, 97,103, 0,115,101, 97,114, 99,104, 95,102,108, 97,103, 0,102,114, 97,109,101,115, 95,108,105,109,105,116, 0,112, 97,116,
+116,101,114,110, 95,109, 97,116, 99,104, 0,116,114, 97, 99,107,101,114, 0,112,121,114, 97,109,105,100, 95,108,101,118,101,108,
+115, 0,109,105,110,105,109,117,109, 95, 99,111,114,114,101,108, 97,116,105,111,110, 0,100,101,102, 97,117,108,116, 95,116,114,
+ 97, 99,107,101,114, 0,100,101,102, 97,117,108,116, 95,112,121,114, 97,109,105,100, 95,108,101,118,101,108,115, 0,100,101,102,
+ 97,117,108,116, 95,109,105,110,105,109,117,109, 95, 99,111,114,114,101,108, 97,116,105,111,110, 0,100,101,102, 97,117,108,116,
+ 95,112, 97,116,116,101,114,110, 95,115,105,122,101, 0,100,101,102, 97,117,108,116, 95,115,101, 97,114, 99,104, 95,115,105,122,
+101, 0,100,101,102, 97,117,108,116, 95,102,114, 97,109,101,115, 95,108,105,109,105,116, 0,100,101,102, 97,117,108,116, 95,109,
+ 97,114,103,105,110, 0,100,101,102, 97,117,108,116, 95,112, 97,116,116,101,114,110, 95,109, 97,116, 99,104, 0,100,101,102, 97,
+117,108,116, 95,102,108, 97,103, 0,112,111,100, 0,107,101,121,102,114, 97,109,101, 49, 0,107,101,121,102,114, 97,109,101, 50,
+ 0,114,101,102,105,110,101, 95, 99, 97,109,101,114, 97, 95,105,110,116,114,105,110,115,105, 99,115, 0,112, 97,100, 50, 51, 0,
+ 99,108,101, 97,110, 95,102,114, 97,109,101,115, 0, 99,108,101, 97,110, 95, 97, 99,116,105,111,110, 0, 99,108,101, 97,110, 95,
+101,114,114,111,114, 0,111, 98,106,101, 99,116, 95,100,105,115,116, 97,110, 99,101, 0,116,111,116, 95,116,114, 97, 99,107, 0,
+ 97, 99,116, 95,116,114, 97, 99,107, 0,109, 97,120,115, 99, 97,108,101, 0, 42,114,111,116, 95,116,114, 97, 99,107, 0,108,111,
+ 99,105,110,102, 0,115, 99, 97,108,101,105,110,102, 0,114,111,116,105,110,102, 0, 42,115, 99, 97,108,101,105, 98,117,102, 0,
+108, 97,115,116, 95, 99, 97,109,101,114, 97, 0, 99, 97,109,110,114, 0, 42, 99, 97,109,101,114, 97,115, 0,116,114, 97, 99,107,
+115, 0,114,101, 99,111,110,115,116,114,117, 99,116,105,111,110, 0,109,101,115,115, 97,103,101, 91, 50, 53, 54, 93, 0,115,101,
+116,116,105,110,103,115, 0, 99, 97,109,101,114, 97, 0,115,116, 97, 98,105,108,105,122, 97,116,105,111,110, 0, 42, 97, 99,116,
+ 95,116,114, 97, 99,107, 0,111, 98,106,101, 99,116,115, 0,111, 98,106,101, 99,116,110,114, 0,116,111,116, 95,111, 98,106,101,
+ 99,116, 0, 42, 98,114,117,115,104, 95,103,114,111,117,112, 0, 99,117,114,114,101,110,116, 95,102,114, 97,109,101, 0,100,105,
+115,112, 95,116,121,112,101, 0,105,109, 97,103,101, 95,102,105,108,101,102,111,114,109, 97,116, 0,101,102,102,101, 99,116, 95,
+117,105, 0,112,114,101,118,105,101,119, 95,105,100, 0,105,110,105,116, 95, 99,111,108,111,114, 95,116,121,112,101, 0,112, 97,
+100, 95,115, 0,105,109, 97,103,101, 95,114,101,115,111,108,117,116,105,111,110, 0,115,117, 98,115,116,101,112,115, 0,105,110,
+105,116, 95, 99,111,108,111,114, 91, 52, 93, 0, 42,105,110,105,116, 95,116,101,120,116,117,114,101, 0,105,110,105,116, 95,108,
+ 97,121,101,114,110, 97,109,101, 91, 54, 52, 93, 0,100,114,121, 95,115,112,101,101,100, 0, 99,111,108,111,114, 95,100,114,121,
+ 95,116,104,114,101,115,104,111,108,100, 0,100,101,112,116,104, 95, 99,108, 97,109,112, 0,100,105,115,112, 95,102, 97, 99,116,
+111,114, 0,115,112,114,101, 97,100, 95,115,112,101,101,100, 0, 99,111,108,111,114, 95,115,112,114,101, 97,100, 95,115,112,101,
+101,100, 0,115,104,114,105,110,107, 95,115,112,101,101,100, 0,100,114,105,112, 95,118,101,108, 0,100,114,105,112, 95, 97, 99,
+ 99, 0,105,110,102,108,117,101,110, 99,101, 95,115, 99, 97,108,101, 0,114, 97,100,105,117,115, 95,115, 99, 97,108,101, 0,119,
+ 97,118,101, 95,100, 97,109,112,105,110,103, 0,119, 97,118,101, 95,115,112,101,101,100, 0,119, 97,118,101, 95,116,105,109,101,
+115, 99, 97,108,101, 0,119, 97,118,101, 95,115,112,114,105,110,103, 0,105,109, 97,103,101, 95,111,117,116,112,117,116, 95,112,
+ 97,116,104, 91, 49, 48, 50, 52, 93, 0,111,117,116,112,117,116, 95,110, 97,109,101, 91, 54, 52, 93, 0,111,117,116,112,117,116,
+ 95,110, 97,109,101, 50, 91, 54, 52, 93, 0, 42,112,109,100, 0,115,117,114,102, 97, 99,101,115, 0, 97, 99,116,105,118,101, 95,
+115,117,114, 0,101,114,114,111,114, 91, 54, 52, 93, 0, 99,111,108,108,105,115,105,111,110, 0,119,101,116,110,101,115,115, 0,
+112, 97,114,116,105, 99,108,101, 95,114, 97,100,105,117,115, 0,112, 97,114,116,105, 99,108,101, 95,115,109,111,111,116,104, 0,
+112, 97,105,110,116, 95,100,105,115,116, 97,110, 99,101, 0, 42,112, 97,105,110,116, 95,114, 97,109,112, 0, 42,118,101,108, 95,
+114, 97,109,112, 0,112,114,111,120,105,109,105,116,121, 95,102, 97,108,108,111,102,102, 0,114, 97,121, 95,100,105,114, 0,119,
+ 97,118,101, 95,102, 97, 99,116,111,114, 0,119, 97,118,101, 95, 99,108, 97,109,112, 0,109, 97,120, 95,118,101,108,111, 99,105,
+116,121, 0,115,109,117,100,103,101, 95,115,116,114,101,110,103,116,104, 0, 0, 84, 89, 80, 69, 16, 2, 0, 0, 99,104, 97,114,
+ 0,117, 99,104, 97,114, 0,115,104,111,114,116, 0,117,115,104,111,114,116, 0,105,110,116, 0,108,111,110,103, 0,117,108,111,
+110,103, 0,102,108,111, 97,116, 0,100,111,117, 98,108,101, 0,105,110,116, 54, 52, 95,116, 0,117,105,110,116, 54, 52, 95,116,
+ 0,118,111,105,100, 0, 76,105,110,107, 0, 76,105,110,107, 68, 97,116, 97, 0, 76,105,115,116, 66, 97,115,101, 0,118,101, 99,
+ 50,115, 0,118,101, 99, 50,102, 0,118,101, 99, 51,102, 0,114, 99,116,105, 0,114, 99,116,102, 0, 73, 68, 80,114,111,112,101,
+114,116,121, 68, 97,116, 97, 0, 73, 68, 80,114,111,112,101,114,116,121, 0, 73, 68, 0, 76,105, 98,114, 97,114,121, 0, 70,105,
+108,101, 68, 97,116, 97, 0, 80,114,101,118,105,101,119, 73,109, 97,103,101, 0, 73,112,111, 68,114,105,118,101,114, 0, 79, 98,
+106,101, 99,116, 0, 73,112,111, 67,117,114,118,101, 0, 66, 80,111,105,110,116, 0, 66,101,122, 84,114,105,112,108,101, 0, 73,
+112,111, 0, 75,101,121, 66,108,111, 99,107, 0, 75,101,121, 0, 65,110,105,109, 68, 97,116, 97, 0, 84,101,120,116, 76,105,110,
+101, 0, 84,101,120,116, 77, 97,114,107,101,114, 0, 84,101,120,116, 0, 80, 97, 99,107,101,100, 70,105,108,101, 0, 67, 97,109,
+101,114, 97, 0, 73,109, 97,103,101, 85,115,101,114, 0, 83, 99,101,110,101, 0, 73,109, 97,103,101, 0, 71, 80, 85, 84,101,120,
+116,117,114,101, 0, 97,110,105,109, 0, 82,101,110,100,101,114, 82,101,115,117,108,116, 0, 77, 84,101,120, 0, 84,101,120, 0,
+ 80,108,117,103,105,110, 84,101,120, 0, 67, 66, 68, 97,116, 97, 0, 67,111,108,111,114, 66, 97,110,100, 0, 69,110,118, 77, 97,
+112, 0, 73,109, 66,117,102, 0, 80,111,105,110,116, 68,101,110,115,105,116,121, 0, 67,117,114,118,101, 77, 97,112,112,105,110,
+103, 0, 86,111,120,101,108, 68, 97,116, 97, 0, 79, 99,101, 97,110, 84,101,120, 0, 98, 78,111,100,101, 84,114,101,101, 0, 84,
+101,120, 77, 97,112,112,105,110,103, 0, 67,111,108,111,114, 77, 97,112,112,105,110,103, 0, 76, 97,109,112, 0, 86,111,108,117,
+109,101, 83,101,116,116,105,110,103,115, 0, 71, 97,109,101, 83,101,116,116,105,110,103,115, 0, 77, 97,116,101,114,105, 97,108,
+ 0, 71,114,111,117,112, 0, 86, 70,111,110,116, 0, 86, 70,111,110,116, 68, 97,116, 97, 0, 77,101,116, 97, 69,108,101,109, 0,
+ 66,111,117,110,100, 66,111,120, 0, 77,101,116, 97, 66, 97,108,108, 0, 78,117,114, 98, 0, 67,104, 97,114, 73,110,102,111, 0,
+ 84,101,120,116, 66,111,120, 0, 69,100,105,116, 78,117,114, 98, 0, 71, 72, 97,115,104, 0, 67,117,114,118,101, 0, 80, 97,116,
+104, 0, 83,101,108, 66,111,120, 0, 69,100,105,116, 70,111,110,116, 0, 77,101,115,104, 0, 77, 80,111,108,121, 0, 77, 84,101,
+120, 80,111,108,121, 0, 77, 76,111,111,112, 0, 77, 76,111,111,112, 85, 86, 0, 77, 76,111,111,112, 67,111,108, 0, 77, 70, 97,
+ 99,101, 0, 77, 84, 70, 97, 99,101, 0, 84, 70, 97, 99,101, 0, 77, 86,101,114,116, 0, 77, 69,100,103,101, 0, 77, 68,101,102,
+111,114,109, 86,101,114,116, 0, 77, 67,111,108, 0, 77, 83,116,105, 99,107,121, 0, 77, 83,101,108,101, 99,116, 0, 66, 77, 69,
+100,105,116, 77,101,115,104, 0, 67,117,115,116,111,109, 68, 97,116, 97, 0, 77,117,108,116,105,114,101,115, 0, 77, 68,101,102,
+111,114,109, 87,101,105,103,104,116, 0, 77, 70,108,111, 97,116, 80,114,111,112,101,114,116,121, 0, 77, 73,110,116, 80,114,111,
+112,101,114,116,121, 0, 77, 83,116,114,105,110,103, 80,114,111,112,101,114,116,121, 0, 79,114,105,103, 83,112, 97, 99,101, 70,
+ 97, 99,101, 0, 79,114,105,103, 83,112, 97, 99,101, 76,111,111,112, 0, 77, 68,105,115,112,115, 0, 77,117,108,116,105,114,101,
+115, 67,111,108, 0, 77,117,108,116,105,114,101,115, 67,111,108, 70, 97, 99,101, 0, 77,117,108,116,105,114,101,115, 70, 97, 99,
+101, 0, 77,117,108,116,105,114,101,115, 69,100,103,101, 0, 77,117,108,116,105,114,101,115, 76,101,118,101,108, 0, 77, 82,101,
+ 99, 97,115,116, 0, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77, 97,112,112,105,110,103, 73,110,102,111, 77,111,100,
+105,102,105,101,114, 68, 97,116, 97, 0, 83,117, 98,115,117,114,102, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 76, 97,
+116,116,105, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67,117,114,118,101, 77,111,100,105,102,105,101,114, 68,
+ 97,116, 97, 0, 66,117,105,108,100, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77, 97,115,107, 77,111,100,105,102,105,
+101,114, 68, 97,116, 97, 0, 65,114,114, 97,121, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77,105,114,114,111,114, 77,
+111,100,105,102,105,101,114, 68, 97,116, 97, 0, 69,100,103,101, 83,112,108,105,116, 77,111,100,105,102,105,101,114, 68, 97,116,
+ 97, 0, 66,101,118,101,108, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66, 77,101,115,104, 77,111,100,105,102,105,101,
+114, 68, 97,116, 97, 0, 83,109,111,107,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,109,111,107,101, 68,111,109,
+ 97,105,110, 83,101,116,116,105,110,103,115, 0, 83,109,111,107,101, 70,108,111,119, 83,101,116,116,105,110,103,115, 0, 83,109,
+111,107,101, 67,111,108,108, 83,101,116,116,105,110,103,115, 0, 68,105,115,112,108, 97, 99,101, 77,111,100,105,102,105,101,114,
+ 68, 97,116, 97, 0, 85, 86, 80,114,111,106,101, 99,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 68,101, 99,105,109,
+ 97,116,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,109,111,111,116,104, 77,111,100,105,102,105,101,114, 68, 97,
+116, 97, 0, 67, 97,115,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 87, 97,118,101, 77,111,100,105,102,105,101,114,
+ 68, 97,116, 97, 0, 65,114,109, 97,116,117,114,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 72,111,111,107, 77,111,
+100,105,102,105,101,114, 68, 97,116, 97, 0, 83,111,102,116, 98,111,100,121, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0,
+ 67,108,111,116,104, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67,108,111,116,104, 0, 67,108,111,116,104, 83,105,109,
+ 83,101,116,116,105,110,103,115, 0, 67,108,111,116,104, 67,111,108,108, 83,101,116,116,105,110,103,115, 0, 80,111,105,110,116,
+ 67, 97, 99,104,101, 0, 67,111,108,108,105,115,105,111,110, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66, 86, 72, 84,
+114,101,101, 0, 83,117,114,102, 97, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 68,101,114,105,118,101,100, 77,
+101,115,104, 0, 66, 86, 72, 84,114,101,101, 70,114,111,109, 77,101,115,104, 0, 66,111,111,108,101, 97,110, 77,111,100,105,102,
+105,101,114, 68, 97,116, 97, 0, 77, 68,101,102, 73,110,102,108,117,101,110, 99,101, 0, 77, 68,101,102, 67,101,108,108, 0, 77,
+101,115,104, 68,101,102,111,114,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108,101, 83,121,
+115,116,101,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108,101, 83,121,115,116,101,109, 0,
+ 80, 97,114,116,105, 99,108,101, 73,110,115,116, 97,110, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 69,120,112,
+108,111,100,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77,117,108,116,105,114,101,115, 77,111,100,105,102,105,101,
+114, 68, 97,116, 97, 0, 70,108,117,105,100,115,105,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 70,108,117,105,100,
+115,105,109, 83,101,116,116,105,110,103,115, 0, 83,104,114,105,110,107,119,114, 97,112, 77,111,100,105,102,105,101,114, 68, 97,
+116, 97, 0, 83,105,109,112,108,101, 68,101,102,111,114,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,104, 97,112,
+101, 75,101,121, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,111,108,105,100,105,102,121, 77,111,100,105,102,105,101,
+114, 68, 97,116, 97, 0, 83, 99,114,101,119, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 79, 99,101, 97,110, 77,111,100,
+105,102,105,101,114, 68, 97,116, 97, 0, 79, 99,101, 97,110, 0, 79, 99,101, 97,110, 67, 97, 99,104,101, 0, 87, 97,114,112, 77,
+111,100,105,102,105,101,114, 68, 97,116, 97, 0, 87,101,105,103,104,116, 86, 71, 69,100,105,116, 77,111,100,105,102,105,101,114,
+ 68, 97,116, 97, 0, 87,101,105,103,104,116, 86, 71, 77,105,120, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 87,101,105,
+103,104,116, 86, 71, 80,114,111,120,105,109,105,116,121, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 68,121,110, 97,109,
+105, 99, 80, 97,105,110,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 68,121,110, 97,109,105, 99, 80, 97,105,110,116,
+ 67, 97,110,118, 97,115, 83,101,116,116,105,110,103,115, 0, 68,121,110, 97,109,105, 99, 80, 97,105,110,116, 66,114,117,115,104,
+ 83,101,116,116,105,110,103,115, 0, 82,101,109,101,115,104, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 69,100,105,116,
+ 76, 97,116,116, 0, 76, 97,116,116,105, 99,101, 0, 98, 68,101,102,111,114,109, 71,114,111,117,112, 0, 83, 99,117,108,112,116,
+ 83,101,115,115,105,111,110, 0, 98, 65, 99,116,105,111,110, 0, 98, 80,111,115,101, 0, 98, 71, 80,100, 97,116, 97, 0, 98, 65,
+110,105,109, 86,105,122, 83,101,116,116,105,110,103,115, 0, 98, 77,111,116,105,111,110, 80, 97,116,104, 0, 66,117,108,108,101,
+116, 83,111,102,116, 66,111,100,121, 0, 80, 97,114,116, 68,101,102,108,101, 99,116, 0, 83,111,102,116, 66,111,100,121, 0, 79,
+ 98, 72,111,111,107, 0, 68,117,112,108,105, 79, 98,106,101, 99,116, 0, 82, 78, 71, 0, 69,102,102,101, 99,116,111,114, 87,101,
+105,103,104,116,115, 0, 80, 84, 67, 97, 99,104,101, 69,120,116,114, 97, 0, 80, 84, 67, 97, 99,104,101, 77,101,109, 0, 80, 84,
+ 67, 97, 99,104,101, 69,100,105,116, 0, 83, 66, 86,101,114,116,101,120, 0, 66,111,100,121, 80,111,105,110,116, 0, 66,111,100,
+121, 83,112,114,105,110,103, 0, 83, 66, 83, 99,114, 97,116, 99,104, 0, 70,108,117,105,100, 86,101,114,116,101,120, 86,101,108,
+111, 99,105,116,121, 0, 87,111,114,108,100, 0, 66, 97,115,101, 0, 65,118,105, 67,111,100,101, 99, 68, 97,116, 97, 0, 81,117,
+105, 99,107,116,105,109,101, 67,111,100,101, 99, 68, 97,116, 97, 0, 81,117,105, 99,107,116,105,109,101, 67,111,100,101, 99, 83,
+101,116,116,105,110,103,115, 0, 70, 70, 77,112,101,103, 67,111,100,101, 99, 68, 97,116, 97, 0, 65,117,100,105,111, 68, 97,116,
+ 97, 0, 83, 99,101,110,101, 82,101,110,100,101,114, 76, 97,121,101,114, 0, 73,109, 97,103,101, 70,111,114,109, 97,116, 68, 97,
+116, 97, 0, 82,101,110,100,101,114, 68, 97,116, 97, 0, 82,101,110,100,101,114, 80,114,111,102,105,108,101, 0, 71, 97,109,101,
+ 68,111,109,101, 0, 71, 97,109,101, 70,114, 97,109,105,110,103, 0, 82,101, 99, 97,115,116, 68, 97,116, 97, 0, 71, 97,109,101,
+ 68, 97,116, 97, 0, 84,105,109,101, 77, 97,114,107,101,114, 0, 80, 97,105,110,116, 0, 66,114,117,115,104, 0, 73,109, 97,103,
+101, 80, 97,105,110,116, 83,101,116,116,105,110,103,115, 0, 80, 97,114,116,105, 99,108,101, 66,114,117,115,104, 68, 97,116, 97,
+ 0, 80, 97,114,116,105, 99,108,101, 69,100,105,116, 83,101,116,116,105,110,103,115, 0, 83, 99,117,108,112,116, 0, 85,118, 83,
+ 99,117,108,112,116, 0, 86, 80, 97,105,110,116, 0, 84,114, 97,110,115,102,111,114,109, 79,114,105,101,110,116, 97,116,105,111,
+110, 0, 85,110,105,102,105,101,100, 80, 97,105,110,116, 83,101,116,116,105,110,103,115, 0, 84,111,111,108, 83,101,116,116,105,
+110,103,115, 0, 98, 83,116, 97,116,115, 0, 85,110,105,116, 83,101,116,116,105,110,103,115, 0, 80,104,121,115,105, 99,115, 83,
+101,116,116,105,110,103,115, 0, 69,100,105,116,105,110,103, 0, 83, 99,101,110,101, 83,116, 97,116,115, 0, 68, 97,103, 70,111,
+114,101,115,116, 0, 77,111,118,105,101, 67,108,105,112, 0, 66, 71,112,105, 99, 0, 77,111,118,105,101, 67,108,105,112, 85,115,
+101,114, 0, 82,101,103,105,111,110, 86,105,101,119, 51, 68, 0, 82,101,110,100,101,114, 73,110,102,111, 0, 82,101,110,100,101,
+114, 69,110,103,105,110,101, 0, 86,105,101,119, 68,101,112,116,104,115, 0, 83,109,111,111,116,104, 86,105,101,119, 83,116,111,
+114,101, 0,119,109, 84,105,109,101,114, 0, 86,105,101,119, 51, 68, 0, 83,112, 97, 99,101, 76,105,110,107, 0, 86,105,101,119,
+ 50, 68, 0, 83,112, 97, 99,101, 73,110,102,111, 0, 83,112, 97, 99,101, 73,112,111, 0, 98, 68,111,112,101, 83,104,101,101,116,
+ 0, 83,112, 97, 99,101, 66,117,116,115, 0, 83,112, 97, 99,101, 83,101,113, 0, 70,105,108,101, 83,101,108,101, 99,116, 80, 97,
+114, 97,109,115, 0, 83,112, 97, 99,101, 70,105,108,101, 0, 70,105,108,101, 76,105,115,116, 0,119,109, 79,112,101,114, 97,116,
+111,114, 0, 70,105,108,101, 76, 97,121,111,117,116, 0, 83,112, 97, 99,101, 79,111,112,115, 0, 84,114,101,101, 83,116,111,114,
+101, 0, 84,114,101,101, 83,116,111,114,101, 69,108,101,109, 0, 83,112, 97, 99,101, 73,109, 97,103,101, 0, 83, 99,111,112,101,
+115, 0, 72,105,115,116,111,103,114, 97,109, 0, 83,112, 97, 99,101, 78,108, 97, 0, 83,112, 97, 99,101, 84,101,120,116, 0, 83,
+ 99,114,105,112,116, 0, 83,112, 97, 99,101, 83, 99,114,105,112,116, 0, 83,112, 97, 99,101, 84,105,109,101, 67, 97, 99,104,101,
+ 0, 83,112, 97, 99,101, 84,105,109,101, 0, 83,112, 97, 99,101, 78,111,100,101, 0, 83,112, 97, 99,101, 76,111,103,105, 99, 0,
+ 67,111,110,115,111,108,101, 76,105,110,101, 0, 83,112, 97, 99,101, 67,111,110,115,111,108,101, 0, 83,112, 97, 99,101, 85,115,
+101,114, 80,114,101,102, 0, 83,112, 97, 99,101, 67,108,105,112, 0, 77,111,118,105,101, 67,108,105,112, 83, 99,111,112,101,115,
+ 0,117,105, 70,111,110,116, 0,117,105, 70,111,110,116, 83,116,121,108,101, 0,117,105, 83,116,121,108,101, 0,117,105, 87,105,
+100,103,101,116, 67,111,108,111,114,115, 0,117,105, 87,105,100,103,101,116, 83,116, 97,116,101, 67,111,108,111,114,115, 0,117,
+105, 80, 97,110,101,108, 67,111,108,111,114,115, 0, 84,104,101,109,101, 85, 73, 0, 84,104,101,109,101, 83,112, 97, 99,101, 0,
+ 84,104,101,109,101, 87,105,114,101, 67,111,108,111,114, 0, 98, 84,104,101,109,101, 0, 98, 65,100,100,111,110, 0, 83,111,108,
+105,100, 76,105,103,104,116, 0, 85,115,101,114, 68,101,102, 0, 98, 83, 99,114,101,101,110, 0, 83, 99,114, 86,101,114,116, 0,
+ 83, 99,114, 69,100,103,101, 0, 80, 97,110,101,108, 0, 80, 97,110,101,108, 84,121,112,101, 0,117,105, 76, 97,121,111,117,116,
+ 0, 83, 99,114, 65,114,101, 97, 0, 83,112, 97, 99,101, 84,121,112,101, 0, 65, 82,101,103,105,111,110, 0, 65, 82,101,103,105,
+111,110, 84,121,112,101, 0, 70,105,108,101, 71,108,111, 98, 97,108, 0, 83,116,114,105,112, 69,108,101,109, 0, 83,116,114,105,
+112, 67,114,111,112, 0, 83,116,114,105,112, 84,114, 97,110,115,102,111,114,109, 0, 83,116,114,105,112, 67,111,108,111,114, 66,
+ 97,108, 97,110, 99,101, 0, 83,116,114,105,112, 80,114,111,120,121, 0, 83,116,114,105,112, 0, 80,108,117,103,105,110, 83,101,
+113, 0, 83,101,113,117,101,110, 99,101, 0, 98, 83,111,117,110,100, 0, 77,101,116, 97, 83,116, 97, 99,107, 0, 87,105,112,101,
+ 86, 97,114,115, 0, 71,108,111,119, 86, 97,114,115, 0, 84,114, 97,110,115,102,111,114,109, 86, 97,114,115, 0, 83,111,108,105,
+100, 67,111,108,111,114, 86, 97,114,115, 0, 83,112,101,101,100, 67,111,110,116,114,111,108, 86, 97,114,115, 0, 69,102,102,101,
+ 99,116, 0, 66,117,105,108,100, 69,102,102, 0, 80, 97,114,116, 69,102,102, 0, 80, 97,114,116,105, 99,108,101, 0, 87, 97,118,
+101, 69,102,102, 0, 98, 80,114,111,112,101,114,116,121, 0, 98, 78,101, 97,114, 83,101,110,115,111,114, 0, 98, 77,111,117,115,
+101, 83,101,110,115,111,114, 0, 98, 84,111,117, 99,104, 83,101,110,115,111,114, 0, 98, 75,101,121, 98,111, 97,114,100, 83,101,
+110,115,111,114, 0, 98, 80,114,111,112,101,114,116,121, 83,101,110,115,111,114, 0, 98, 65, 99,116,117, 97,116,111,114, 83,101,
+110,115,111,114, 0, 98, 68,101,108, 97,121, 83,101,110,115,111,114, 0, 98, 67,111,108,108,105,115,105,111,110, 83,101,110,115,
+111,114, 0, 98, 82, 97,100, 97,114, 83,101,110,115,111,114, 0, 98, 82, 97,110,100,111,109, 83,101,110,115,111,114, 0, 98, 82,
+ 97,121, 83,101,110,115,111,114, 0, 98, 65,114,109, 97,116,117,114,101, 83,101,110,115,111,114, 0, 98, 77,101,115,115, 97,103,
+101, 83,101,110,115,111,114, 0, 98, 83,101,110,115,111,114, 0, 98, 67,111,110,116,114,111,108,108,101,114, 0, 98, 74,111,121,
+115,116,105, 99,107, 83,101,110,115,111,114, 0, 98, 69,120,112,114,101,115,115,105,111,110, 67,111,110,116, 0, 98, 80,121,116,
+104,111,110, 67,111,110,116, 0, 98, 65, 99,116,117, 97,116,111,114, 0, 98, 65,100,100, 79, 98,106,101, 99,116, 65, 99,116,117,
+ 97,116,111,114, 0, 98, 65, 99,116,105,111,110, 65, 99,116,117, 97,116,111,114, 0, 83,111,117,110,100, 51, 68, 0, 98, 83,111,
+117,110,100, 65, 99,116,117, 97,116,111,114, 0, 98, 69,100,105,116, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0,
+ 98, 83, 99,101,110,101, 65, 99,116,117, 97,116,111,114, 0, 98, 80,114,111,112,101,114,116,121, 65, 99,116,117, 97,116,111,114,
+ 0, 98, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 73,112,111, 65, 99,116,117, 97,116,111,114, 0, 98, 67,
+ 97,109,101,114, 97, 65, 99,116,117, 97,116,111,114, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 65, 99,116,117, 97,116,111,
+114, 0, 98, 71,114,111,117,112, 65, 99,116,117, 97,116,111,114, 0, 98, 82, 97,110,100,111,109, 65, 99,116,117, 97,116,111,114,
+ 0, 98, 77,101,115,115, 97,103,101, 65, 99,116,117, 97,116,111,114, 0, 98, 71, 97,109,101, 65, 99,116,117, 97,116,111,114, 0,
+ 98, 86,105,115,105, 98,105,108,105,116,121, 65, 99,116,117, 97,116,111,114, 0, 98, 84,119,111, 68, 70,105,108,116,101,114, 65,
+ 99,116,117, 97,116,111,114, 0, 98, 80, 97,114,101,110,116, 65, 99,116,117, 97,116,111,114, 0, 98, 83,116, 97,116,101, 65, 99,
+116,117, 97,116,111,114, 0, 98, 65,114,109, 97,116,117,114,101, 65, 99,116,117, 97,116,111,114, 0, 98, 83,116,101,101,114,105,
+110,103, 65, 99,116,117, 97,116,111,114, 0, 71,114,111,117,112, 79, 98,106,101, 99,116, 0, 66,111,110,101, 0, 98, 65,114,109,
+ 97,116,117,114,101, 0, 98, 77,111,116,105,111,110, 80, 97,116,104, 86,101,114,116, 0, 98, 80,111,115,101, 67,104, 97,110,110,
+101,108, 0, 98, 73, 75, 80, 97,114, 97,109, 0, 98, 73,116, 97,115, 99, 0, 98, 65, 99,116,105,111,110, 71,114,111,117,112, 0,
+ 83,112, 97, 99,101, 65, 99,116,105,111,110, 0, 98, 65, 99,116,105,111,110, 67,104, 97,110,110,101,108, 0, 98, 67,111,110,115,
+116,114, 97,105,110,116, 67,104, 97,110,110,101,108, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 67,111,110,115,116,
+114, 97,105,110,116, 84, 97,114,103,101,116, 0, 98, 80,121,116,104,111,110, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 75,
+105,110,101,109, 97,116,105, 99, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,112,108,105,110,101, 73, 75, 67,111,110,115,
+116,114, 97,105,110,116, 0, 98, 84,114, 97, 99,107, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 97,116,
+101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 76,111, 99, 97,116,101, 76,105,107,101, 67,111,110,115,116,
+114, 97,105,110,116, 0, 98, 83,105,122,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83, 97,109,101, 86,
+111,108,117,109,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 84,114, 97,110,115, 76,105,107,101, 67,111,110,115,116,114,
+ 97,105,110,116, 0, 98, 77,105,110, 77, 97,120, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,111,110, 67,111,
+110,115,116,114, 97,105,110,116, 0, 98, 76,111, 99,107, 84,114, 97, 99,107, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 68,
+ 97,109,112, 84,114, 97, 99,107, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 70,111,108,108,111,119, 80, 97,116,104, 67,111,
+110,115,116,114, 97,105,110,116, 0, 98, 83,116,114,101,116, 99,104, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,
+105,103,105,100, 66,111,100,121, 74,111,105,110,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 67,108, 97,109,112, 84,111,
+ 67,111,110,115,116,114, 97,105,110,116, 0, 98, 67,104,105,108,100, 79,102, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 84,
+114, 97,110,115,102,111,114,109, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 80,105,118,111,116, 67,111,110,115,116,114, 97,
+105,110,116, 0, 98, 76,111, 99, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 76,105,109,105,
+116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,105,122,101, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116,
+ 0, 98, 68,105,115,116, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,104,114,105,110,107,119,114, 97,
+112, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 70,111,108,108,111,119, 84,114, 97, 99,107, 67,111,110,115,116,114, 97,105,
+110,116, 0, 98, 67, 97,109,101,114, 97, 83,111,108,118,101,114, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 79, 98,106,101,
+ 99,116, 83,111,108,118,101,114, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,111,110, 77,111,100,105,102,105,
+101,114, 0, 98, 65, 99,116,105,111,110, 83,116,114,105,112, 0, 98, 78,111,100,101, 83,116, 97, 99,107, 0, 98, 78,111,100,101,
+ 83,111, 99,107,101,116, 0, 98, 78,111,100,101, 76,105,110,107, 0, 98, 78,111,100,101, 80,114,101,118,105,101,119, 0, 98, 78,
+111,100,101, 0,117,105, 66,108,111, 99,107, 0, 98, 78,111,100,101, 84,121,112,101, 0, 98, 78,111,100,101, 84,114,101,101, 69,
+120,101, 99, 0, 98, 78,111,100,101, 83,111, 99,107,101,116, 86, 97,108,117,101, 73,110,116, 0, 98, 78,111,100,101, 83,111, 99,
+107,101,116, 86, 97,108,117,101, 70,108,111, 97,116, 0, 98, 78,111,100,101, 83,111, 99,107,101,116, 86, 97,108,117,101, 66,111,
+111,108,101, 97,110, 0, 98, 78,111,100,101, 83,111, 99,107,101,116, 86, 97,108,117,101, 86,101, 99,116,111,114, 0, 98, 78,111,
+100,101, 83,111, 99,107,101,116, 86, 97,108,117,101, 82, 71, 66, 65, 0, 78,111,100,101, 73,109, 97,103,101, 65,110,105,109, 0,
+ 78,111,100,101, 66,108,117,114, 68, 97,116, 97, 0, 78,111,100,101, 68, 66,108,117,114, 68, 97,116, 97, 0, 78,111,100,101, 66,
+105,108, 97,116,101,114, 97,108, 66,108,117,114, 68, 97,116, 97, 0, 78,111,100,101, 72,117,101, 83, 97,116, 0, 78,111,100,101,
+ 73,109, 97,103,101, 70,105,108,101, 0, 78,111,100,101, 73,109, 97,103,101, 77,117,108,116,105, 70,105,108,101, 0, 78,111,100,
+101, 73,109, 97,103,101, 77,117,108,116,105, 70,105,108,101, 83,111, 99,107,101,116, 0, 78,111,100,101, 67,104,114,111,109, 97,
+ 0, 78,111,100,101, 84,119,111, 88, 89,115, 0, 78,111,100,101, 84,119,111, 70,108,111, 97,116,115, 0, 78,111,100,101, 71,101,
+111,109,101,116,114,121, 0, 78,111,100,101, 86,101,114,116,101,120, 67,111,108, 0, 78,111,100,101, 68,101,102,111, 99,117,115,
+ 0, 78,111,100,101, 83, 99,114,105,112,116, 68,105, 99,116, 0, 78,111,100,101, 71,108, 97,114,101, 0, 78,111,100,101, 84,111,
+110,101,109, 97,112, 0, 78,111,100,101, 76,101,110,115, 68,105,115,116, 0, 78,111,100,101, 67,111,108,111,114, 66, 97,108, 97,
+110, 99,101, 0, 78,111,100,101, 67,111,108,111,114,115,112,105,108,108, 0, 78,111,100,101, 84,101,120, 66, 97,115,101, 0, 78,
+111,100,101, 84,101,120, 83,107,121, 0, 78,111,100,101, 84,101,120, 73,109, 97,103,101, 0, 78,111,100,101, 84,101,120, 67,104,
+101, 99,107,101,114, 0, 78,111,100,101, 84,101,120, 69,110,118,105,114,111,110,109,101,110,116, 0, 78,111,100,101, 84,101,120,
+ 71,114, 97,100,105,101,110,116, 0, 78,111,100,101, 84,101,120, 78,111,105,115,101, 0, 78,111,100,101, 84,101,120, 86,111,114,
+111,110,111,105, 0, 78,111,100,101, 84,101,120, 77,117,115,103,114, 97,118,101, 0, 78,111,100,101, 84,101,120, 87, 97,118,101,
+ 0, 78,111,100,101, 84,101,120, 77, 97,103,105, 99, 0, 78,111,100,101, 83,104, 97,100,101,114, 65,116,116,114,105, 98,117,116,
+101, 0, 84,101,120, 78,111,100,101, 79,117,116,112,117,116, 0, 67,117,114,118,101, 77, 97,112, 80,111,105,110,116, 0, 67,117,
+114,118,101, 77, 97,112, 0, 66,114,117,115,104, 67,108,111,110,101, 0, 67,117,115,116,111,109, 68, 97,116, 97, 76, 97,121,101,
+114, 0, 67,117,115,116,111,109, 68, 97,116, 97, 69,120,116,101,114,110, 97,108, 0, 72, 97,105,114, 75,101,121, 0, 80, 97,114,
+116,105, 99,108,101, 75,101,121, 0, 66,111,105,100, 80, 97,114,116,105, 99,108,101, 0, 66,111,105,100, 68, 97,116, 97, 0, 80,
+ 97,114,116,105, 99,108,101, 83,112,114,105,110,103, 0, 67,104,105,108,100, 80, 97,114,116,105, 99,108,101, 0, 80, 97,114,116,
+105, 99,108,101, 84, 97,114,103,101,116, 0, 80, 97,114,116,105, 99,108,101, 68,117,112,108,105, 87,101,105,103,104,116, 0, 80,
+ 97,114,116,105, 99,108,101, 68, 97,116, 97, 0, 83, 80, 72, 70,108,117,105,100, 83,101,116,116,105,110,103,115, 0, 80, 97,114,
+116,105, 99,108,101, 83,101,116,116,105,110,103,115, 0, 66,111,105,100, 83,101,116,116,105,110,103,115, 0, 80, 97,114,116,105,
+ 99,108,101, 67, 97, 99,104,101, 75,101,121, 0, 75, 68, 84,114,101,101, 0, 80, 97,114,116,105, 99,108,101, 68,114, 97,119, 68,
+ 97,116, 97, 0, 76,105,110,107, 78,111,100,101, 0, 98, 71, 80, 68,115,112,111,105,110,116, 0, 98, 71, 80, 68,115,116,114,111,
+107,101, 0, 98, 71, 80, 68,102,114, 97,109,101, 0, 98, 71, 80, 68,108, 97,121,101,114, 0, 82,101,112,111,114,116, 76,105,115,
+116, 0,119,109, 87,105,110,100,111,119, 77, 97,110, 97,103,101,114, 0,119,109, 87,105,110,100,111,119, 0,119,109, 75,101,121,
+ 67,111,110,102,105,103, 0,119,109, 69,118,101,110,116, 0,119,109, 83,117, 98, 87,105,110,100,111,119, 0,119,109, 71,101,115,
+116,117,114,101, 0,119,109, 75,101,121, 77, 97,112, 73,116,101,109, 0, 80,111,105,110,116,101,114, 82, 78, 65, 0,119,109, 75,
+101,121, 77, 97,112, 68,105,102,102, 73,116,101,109, 0,119,109, 75,101,121, 77, 97,112, 0,119,109, 79,112,101,114, 97,116,111,
+114, 84,121,112,101, 0, 70, 77,111,100,105,102,105,101,114, 0, 70, 77,111,100, 95, 71,101,110,101,114, 97,116,111,114, 0, 70,
+ 77,111,100, 95, 70,117,110, 99,116,105,111,110, 71,101,110,101,114, 97,116,111,114, 0, 70, 67, 77, 95, 69,110,118,101,108,111,
+112,101, 68, 97,116, 97, 0, 70, 77,111,100, 95, 69,110,118,101,108,111,112,101, 0, 70, 77,111,100, 95, 67,121, 99,108,101,115,
+ 0, 70, 77,111,100, 95, 80,121,116,104,111,110, 0, 70, 77,111,100, 95, 76,105,109,105,116,115, 0, 70, 77,111,100, 95, 78,111,
+105,115,101, 0, 70, 77,111,100, 95, 83,116,101,112,112,101,100, 0, 68,114,105,118,101,114, 84, 97,114,103,101,116, 0, 68,114,
+105,118,101,114, 86, 97,114, 0, 67,104, 97,110,110,101,108, 68,114,105,118,101,114, 0, 70, 80,111,105,110,116, 0, 70, 67,117,
+114,118,101, 0, 65,110,105,109, 77, 97,112, 80, 97,105,114, 0, 65,110,105,109, 77, 97,112,112,101,114, 0, 78,108, 97, 83,116,
+114,105,112, 0, 78,108, 97, 84,114, 97, 99,107, 0, 75, 83, 95, 80, 97,116,104, 0, 75,101,121,105,110,103, 83,101,116, 0, 65,
+110,105,109, 79,118,101,114,114,105,100,101, 0, 73,100, 65,100,116, 84,101,109,112,108, 97,116,101, 0, 66,111,105,100, 82,117,
+108,101, 0, 66,111,105,100, 82,117,108,101, 71,111, 97,108, 65,118,111,105,100, 0, 66,111,105,100, 82,117,108,101, 65,118,111,
+105,100, 67,111,108,108,105,115,105,111,110, 0, 66,111,105,100, 82,117,108,101, 70,111,108,108,111,119, 76,101, 97,100,101,114,
+ 0, 66,111,105,100, 82,117,108,101, 65,118,101,114, 97,103,101, 83,112,101,101,100, 0, 66,111,105,100, 82,117,108,101, 70,105,
+103,104,116, 0, 66,111,105,100, 83,116, 97,116,101, 0, 70, 76, 85, 73, 68, 95, 51, 68, 0, 87, 84, 85, 82, 66, 85, 76, 69, 78,
+ 67, 69, 0, 83,112,101, 97,107,101,114, 0, 77,111,118,105,101, 67,108,105,112, 80,114,111,120,121, 0, 77,111,118,105,101, 67,
+108,105,112, 67, 97, 99,104,101, 0, 77,111,118,105,101, 84,114, 97, 99,107,105,110,103, 0, 77,111,118,105,101, 84,114, 97, 99,
+107,105,110,103, 84,114, 97, 99,107, 0, 77,111,118,105,101, 84,114, 97, 99,107,105,110,103, 77, 97,114,107,101,114, 0, 77,111,
+118,105,101, 82,101, 99,111,110,115,116,114,117, 99,116,101,100, 67, 97,109,101,114, 97, 0, 77,111,118,105,101, 84,114, 97, 99,
+107,105,110,103, 67, 97,109,101,114, 97, 0, 77,111,118,105,101, 84,114, 97, 99,107,105,110,103, 83,101,116,116,105,110,103,115,
+ 0, 77,111,118,105,101, 84,114, 97, 99,107,105,110,103, 83,116, 97, 98,105,108,105,122, 97,116,105,111,110, 0, 77,111,118,105,
+101, 84,114, 97, 99,107,105,110,103, 82,101, 99,111,110,115,116,114,117, 99,116,105,111,110, 0, 77,111,118,105,101, 84,114, 97,
+ 99,107,105,110,103, 79, 98,106,101, 99,116, 0, 77,111,118,105,101, 84,114, 97, 99,107,105,110,103, 83,116, 97,116,115, 0, 68,
+121,110, 97,109,105, 99, 80, 97,105,110,116, 83,117,114,102, 97, 99,101, 0, 80, 97,105,110,116, 83,117,114,102, 97, 99,101, 68,
+ 97,116, 97, 0, 84, 76, 69, 78, 1, 0, 1, 0, 2, 0, 2, 0, 4, 0, 4, 0, 4, 0, 4, 0, 8, 0, 8, 0, 8, 0, 0, 0,
+ 16, 0, 24, 0, 16, 0, 4, 0, 8, 0, 12, 0, 16, 0, 16, 0, 32, 0,128, 0,120, 0,152, 8, 0, 0, 40, 0,144, 0,112, 5,
+112, 0, 36, 0, 56, 0,160, 0,200, 0, 0, 1, 96, 0, 40, 0, 48, 0,224, 0, 16, 0,200, 0, 40, 0,216, 11, 48, 5, 0, 0,
+ 0, 0, 0, 0, 56, 1,168, 1,216, 4, 24, 0, 8, 3,200, 0, 0, 0,104, 0, 64, 1, 56, 4, 80, 0, 24, 1,144, 0, 56, 3,
+ 16, 2, 88, 0, 16, 0,128, 3,152, 0,136, 4, 0, 0,104, 0,104, 0, 0, 1, 80, 0, 8, 0, 16, 0, 32, 0, 0, 0, 8, 2,
+ 0, 0, 0, 0, 0, 0,232, 4, 12, 0, 16, 0, 8, 0, 12, 0, 4, 0, 20, 0, 48, 0, 64, 0, 20, 0, 12, 0, 16, 0, 4, 0,
+ 8, 0, 8, 0, 0, 0,176, 0,144, 1, 8, 0, 4, 0, 4, 0, 0, 1, 32, 0, 8, 0, 24, 0, 16, 0, 64, 0, 24, 0, 12, 0,
+ 64, 0, 4, 0,112, 0,200, 0,136, 0,192, 0,192, 0,128, 0,192, 0,192, 0,128, 0,120, 0,200, 0,120, 0,144, 0, 16, 1,
+ 56, 0,192, 0, 24, 1, 40, 1,120, 0,184, 0,200, 0, 64, 1,200, 0, 88, 1,112, 0,168, 0, 0, 0,152, 0, 48, 0, 40, 5,
+192, 0, 0, 0,152, 0, 0, 0, 0, 0,128, 0, 8, 0, 8, 0,112, 1,144, 0,152, 2,136, 0,192, 0,120, 0,128, 0,224, 4,
+208, 0,200, 0,112, 0,208, 0,144, 0, 16, 5, 0, 0, 0, 0, 48, 1,104, 1,160, 1,104, 1,136, 0,104, 0,112, 0,128, 0,
+ 16, 0, 96, 1, 88, 0, 0, 0,200, 0,216, 0,152, 0, 48, 0, 24, 0,120, 0,152, 0,216, 1, 0, 1,184, 0, 0, 0, 72, 0,
+ 32, 0,176, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 12, 0, 24, 2, 40, 0,184, 0,152, 0, 64, 0, 72, 0, 32, 0,120, 0,
+ 24, 0, 56, 9, 64, 0, 24, 0, 16, 0, 56, 0,168, 0, 96, 0, 24, 0, 88, 6, 48, 0, 16, 0,168, 0, 96, 0, 24, 0, 56, 0,
+120, 0, 16, 0,232, 1, 32, 0, 8, 0, 24, 0, 80, 8, 0, 0, 0, 0,192, 8,104, 0, 8, 0,112, 3, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 96, 1, 56, 0,144, 0, 64, 0,240, 0,112, 0,248, 0,240, 0,160, 7,104, 0, 0, 0,168, 0, 0, 0, 24, 1,
+ 16, 0, 16, 0, 40, 33,128, 16, 24, 16,216, 0,160, 2,168, 5, 64, 0, 24, 0,208, 0, 48, 1, 72, 0, 40, 0,136, 1,104, 0,
+ 40, 1, 56, 0, 24, 4, 32, 0,232, 0, 32, 0, 32, 0, 8, 0, 80, 3,224, 1, 16, 0,168, 36, 80, 0, 56, 0,112, 38, 8, 1,
+ 32, 0, 40, 0, 88, 1, 0, 0, 0, 0,160, 0, 0, 0, 40, 1, 0, 0, 48, 4, 8, 1, 16, 0, 8, 0, 44, 0, 16, 4, 72, 3,
+200, 4, 72, 1,208, 4, 32, 0, 12, 0, 24, 0, 32, 0, 16, 0, 24, 0, 24, 0, 32, 0,136, 1, 0, 0, 64, 0, 96, 0, 80, 0,
+ 8, 0, 80, 0,136, 0,200, 0, 72, 0, 8, 0,136, 0, 76, 0, 72, 0,204, 0,136, 0,136, 0,128, 0,136, 0, 92, 0,128, 0,
+ 80, 0,112, 0, 16, 0,168, 0, 32, 0, 72, 0,120, 0, 24, 0,144, 0,112, 0,148, 0, 32, 0,128, 0, 88, 0, 88, 0,208, 0,
+140, 0, 4, 0, 24, 0, 16, 0, 8, 0,160, 0, 48, 0, 40, 0, 72, 1, 0, 1, 16, 0, 32, 2, 4, 0, 40, 0,120, 0, 72, 1,
+120, 0, 56, 0,120, 0,160, 0,112, 0,184, 0, 24, 0, 88, 0, 80, 0, 80, 0, 80, 0, 8, 0, 72, 0,104, 0,104, 0, 80, 0,
+ 80, 0, 24, 0, 88, 0,104, 0, 16, 0,144, 0,128, 0, 88, 0, 28, 0, 28, 0, 28, 0, 88, 0, 24, 0,160, 0, 16, 0,152, 0,
+ 72, 0,168, 0, 48, 0,208, 0, 56, 0, 16, 0, 88, 1, 0, 0, 0, 0, 0, 0, 16, 0, 16, 0, 4, 0, 24, 0, 16, 0, 16, 0,
+ 40, 0, 28, 0, 12, 0, 12, 0, 32, 4, 40, 4, 32, 0, 44, 0, 24, 0, 8, 0,128, 0, 64, 0, 32, 0, 16, 0, 32, 0, 32, 0,
+ 8, 0, 96, 0, 20, 0,200, 3,216, 3,208, 3,200, 3,208, 3,208, 3,200, 3,208, 3,208, 3,208, 3,208, 3, 64, 0, 64, 0,
+ 12, 0, 56, 0, 24, 0,104, 0, 0, 4, 24, 0, 56, 0, 56, 0, 20, 0, 16, 0, 64, 0, 40, 0, 32, 0,192, 0, 60, 0, 16, 3,
+104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 32, 0, 40, 0,192, 0, 40, 0, 88, 1, 0, 1,168, 0, 0, 0, 0, 0, 0, 0,
+120, 0, 0, 0, 32, 0,136, 0, 0, 0,120, 0, 24, 0, 24, 0, 16, 0, 24, 0, 8, 0, 16, 0, 24, 0, 20, 0, 20, 0, 56, 0,
+ 24, 2, 40, 1, 16, 0,104, 0, 0, 1, 40, 0,208, 0,104, 0,112, 0,216, 1, 32, 0,128, 0, 56, 0, 80, 0, 64, 0,104, 0,
+ 72, 0, 64, 0,128, 0, 0, 0, 0, 0,184, 0, 8, 3, 0, 0,248, 0,192, 0, 16, 0, 72, 0, 48, 0, 64, 0, 56, 0, 24, 0,
+128, 0, 0, 1, 16, 6, 0, 0, 83, 84, 82, 67,207, 1, 0, 0, 12, 0, 2, 0, 12, 0, 0, 0, 12, 0, 1, 0, 13, 0, 3, 0,
13, 0, 0, 0, 13, 0, 1, 0, 11, 0, 2, 0, 14, 0, 2, 0, 11, 0, 3, 0, 11, 0, 4, 0, 15, 0, 2, 0, 2, 0, 5, 0,
2, 0, 6, 0, 16, 0, 2, 0, 7, 0, 5, 0, 7, 0, 6, 0, 17, 0, 3, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0,
18, 0, 4, 0, 4, 0, 8, 0, 4, 0, 9, 0, 4, 0, 10, 0, 4, 0, 11, 0, 19, 0, 4, 0, 7, 0, 8, 0, 7, 0, 9, 0,
@@ -10464,635 +10584,636 @@ char datatoc_startup_blend[]= {
2, 0,166, 2, 0, 0, 18, 0, 0, 0,161, 2, 91, 0, 4, 0, 0, 0,240, 0, 0, 0,185, 0, 0, 0,186, 0, 0, 0,187, 0,
80, 0, 5, 0, 4, 0,167, 2, 4, 0,141, 2, 2, 0, 47, 2, 0, 0, 18, 0, 0, 0, 27, 0, 82, 0, 2, 0, 4, 0,168, 2,
4, 0,169, 2, 81, 0, 6, 0, 42, 0,149, 2, 0, 0, 18, 0, 0, 0,152, 2, 2, 0, 87, 1, 2, 0,153, 2, 2, 0,154, 2,
- 83, 0, 2, 0, 7, 0,170, 2, 4, 0, 18, 0, 84, 0, 4, 0, 0, 0,240, 0, 0, 0,185, 0, 0, 0,186, 0, 0, 0,187, 0,
+ 83, 0, 2, 0, 7, 0,170, 2, 4, 0, 18, 0, 84, 0, 4, 0, 0, 0,185, 0, 0, 0,186, 0, 0, 0,187, 0, 0, 0,240, 0,
92, 0, 1, 0, 7, 0,171, 2, 93, 0, 2, 0, 4, 0, 13, 2, 4, 0, 16, 0, 86, 0, 7, 0, 7, 0,150, 2, 42, 0,149, 2,
0, 0, 18, 0, 0, 0,152, 2, 2, 0, 87, 1, 2, 0,153, 2, 2, 0,154, 2, 98, 0, 1, 0, 7, 0,172, 2, 99, 0, 1, 0,
- 4, 0,173, 2,100, 0, 1, 0, 0, 0,174, 2,101, 0, 1, 0, 7, 0,150, 2,102, 0, 1, 0, 7, 0,170, 2,103, 0, 3, 0,
- 4, 0,175, 2, 0, 0, 94, 0, 7, 0,176, 2,104, 0, 4, 0, 7, 0,240, 0, 7, 0,185, 0, 7, 0,186, 0, 7, 0,187, 0,
-105, 0, 1, 0,104, 0,151, 2,106, 0, 5, 0, 4, 0,177, 2, 4, 0,178, 2, 0, 0, 18, 0, 0, 0, 47, 2, 0, 0,179, 2,
-107, 0, 2, 0, 4, 0,180, 2, 4, 0,178, 2,108, 0, 10, 0,108, 0, 0, 0,108, 0, 1, 0,106, 0,181, 2,105, 0,182, 2,
-107, 0,183, 2, 4, 0, 53, 0, 4, 0,138, 2, 4, 0,137, 2, 4, 0, 27, 0, 88, 0,184, 2, 96, 0, 14, 0, 14, 0,185, 2,
- 88, 0,184, 2, 0, 0,186, 2, 0, 0,187, 2, 0, 0,188, 2, 0, 0,189, 2, 0, 0,190, 2, 0, 0,191, 2, 0, 0,192, 2,
- 0, 0, 18, 0, 95, 0,132, 2, 95, 0,134, 2, 2, 0,193, 2, 0, 0,194, 2,109, 0, 1, 0, 4, 0,173, 2,110, 0, 9, 0,
-110, 0, 0, 0,110, 0, 1, 0, 4, 0, 16, 0, 4, 0, 87, 1, 4, 0,195, 2, 4, 0, 27, 0, 0, 0, 19, 0, 41, 0,125, 0,
- 0, 0,196, 2,111, 0, 6, 0,110, 0,197, 2, 47, 0,198, 2, 27, 0,199, 2, 0, 0,200, 2, 4, 0,201, 2, 4, 0,202, 2,
-112, 0, 7, 0,110, 0,197, 2, 2, 0,203, 2, 2, 0,185, 2, 2, 0,204, 2, 2, 0, 92, 0, 11, 0,205, 2, 11, 0,206, 2,
-113, 0, 3, 0,110, 0,197, 2, 27, 0,168, 0, 0, 0, 19, 0,114, 0, 5, 0,110, 0,197, 2, 27, 0,168, 0, 0, 0, 19, 0,
- 2, 0,207, 2, 0, 0,208, 2,115, 0, 5, 0,110, 0,197, 2, 7, 0, 89, 0, 7, 0,209, 2, 4, 0,210, 2, 4, 0,211, 2,
-116, 0, 5, 0,110, 0,197, 2, 27, 0,212, 2, 0, 0, 70, 0, 4, 0, 87, 1, 4, 0, 18, 0,117, 0, 13, 0,110, 0,197, 2,
- 27, 0,213, 2, 27, 0,214, 2, 27, 0,215, 2, 27, 0,216, 2, 7, 0,217, 2, 7, 0,218, 2, 7, 0,209, 2, 7, 0,219, 2,
- 4, 0,220, 2, 4, 0,221, 2, 4, 0, 92, 0, 4, 0,222, 2,118, 0, 5, 0,110, 0,197, 2, 2, 0,223, 2, 2, 0, 18, 0,
- 7, 0,224, 2, 27, 0,225, 2,119, 0, 3, 0,110, 0,197, 2, 7, 0,226, 2, 4, 0, 92, 0,120, 0, 10, 0,110, 0,197, 2,
- 7, 0,227, 2, 4, 0,228, 2, 4, 0, 27, 0, 2, 0, 92, 0, 2, 0,229, 2, 2, 0,230, 2, 2, 0,231, 2, 7, 0,232, 2,
- 0, 0,233, 2,121, 0, 3, 0,110, 0,197, 2, 7, 0, 27, 0, 4, 0, 16, 0,122, 0, 6, 0,110, 0,197, 2,123, 0,234, 2,
-124, 0,235, 2,125, 0,236, 2, 7, 0,237, 2, 4, 0, 16, 0,126, 0, 11, 0,110, 0,197, 2, 47, 0,198, 2, 27, 0,199, 2,
- 0, 0,200, 2, 4, 0,201, 2, 4, 0,202, 2, 7, 0,238, 2, 4, 0,239, 2, 0, 0,233, 2, 7, 0,240, 2, 4, 0, 27, 0,
-127, 0, 12, 0,110, 0,197, 2, 27, 0,241, 2, 42, 0,242, 2, 4, 0, 92, 0, 4, 0,243, 2, 7, 0,244, 2, 7, 0,245, 2,
- 7, 0,246, 2, 7, 0,247, 2, 0, 0,200, 2, 4, 0,201, 2, 4, 0, 27, 0,128, 0, 3, 0,110, 0,197, 2, 7, 0,248, 2,
- 4, 0,249, 2,129, 0, 5, 0,110, 0,197, 2, 7, 0,250, 2, 0, 0,233, 2, 2, 0, 18, 0, 2, 0,251, 2,130, 0, 8, 0,
-110, 0,197, 2, 27, 0,168, 0, 7, 0,250, 2, 7, 0,255, 0, 7, 0,108, 0, 0, 0,233, 2, 2, 0, 18, 0, 2, 0, 16, 0,
-131, 0, 21, 0,110, 0,197, 2, 47, 0,198, 2, 27, 0,199, 2, 0, 0,200, 2, 4, 0,201, 2, 4, 0,202, 2, 27, 0,252, 2,
- 0, 0,233, 2, 2, 0, 18, 0, 2, 0, 27, 0, 7, 0,253, 2, 7, 0,254, 2, 7, 0,255, 2, 7, 0, 81, 2, 7, 0, 0, 3,
- 7, 0, 1, 3, 7, 0, 2, 3, 7, 0, 3, 3, 7, 0, 4, 3, 7, 0, 5, 3, 7, 0, 91, 0,132, 0, 7, 0,110, 0,197, 2,
- 2, 0, 6, 3, 2, 0, 7, 3, 4, 0, 30, 0, 27, 0,168, 0, 7, 0, 8, 3, 0, 0,233, 2,133, 0, 10, 0,110, 0,197, 2,
- 27, 0,168, 0, 0, 0, 9, 3, 7, 0, 10, 3, 7, 0, 11, 3, 7, 0, 3, 3, 4, 0, 12, 3, 4, 0, 13, 3, 7, 0, 14, 3,
- 0, 0, 19, 0,134, 0, 1, 0,110, 0,197, 2,135, 0, 7, 0,110, 0,197, 2, 41, 0,125, 0,136, 0, 15, 3,137, 0, 16, 3,
-138, 0, 17, 3,139, 0, 18, 3, 14, 0, 19, 3,140, 0, 13, 0,110, 0,197, 2, 88, 0, 20, 3, 88, 0, 21, 3, 88, 0, 22, 3,
- 88, 0, 23, 3, 88, 0, 24, 3, 88, 0, 25, 3, 85, 0, 26, 3, 4, 0, 27, 3, 4, 0, 28, 3, 7, 0, 29, 3, 7, 0, 30, 3,
-141, 0, 31, 3,142, 0, 7, 0,110, 0,197, 2, 88, 0, 20, 3, 88, 0, 32, 3,143, 0, 33, 3,144, 0, 31, 3, 4, 0, 34, 3,
- 4, 0, 27, 3,145, 0, 4, 0,110, 0,197, 2, 27, 0,168, 0, 4, 0, 35, 3, 4, 0, 27, 0,146, 0, 2, 0, 4, 0, 36, 3,
- 7, 0, 39, 2,147, 0, 2, 0, 4, 0,128, 0, 4, 0, 37, 3,148, 0, 24, 0,110, 0,197, 2, 27, 0,168, 0, 0, 0,233, 2,
- 2, 0, 38, 3, 2, 0, 18, 0, 2, 0, 87, 1, 2, 0, 27, 0,146, 0, 39, 3, 4, 0, 40, 3, 7, 0, 41, 3, 4, 0, 53, 0,
- 4, 0, 42, 3,147, 0, 43, 3,146, 0, 44, 3, 4, 0, 45, 3, 4, 0, 46, 3, 4, 0, 47, 3, 4, 0, 37, 3, 7, 0, 48, 3,
- 7, 0, 49, 3, 7, 0, 50, 3, 7, 0, 51, 3, 7, 0, 52, 3, 11, 0, 53, 3,149, 0, 8, 0,110, 0,197, 2,150, 0, 54, 3,
-143, 0, 33, 3, 4, 0, 55, 3, 4, 0, 56, 3, 4, 0, 57, 3, 2, 0, 18, 0, 2, 0, 56, 0,151, 0, 8, 0,110, 0,197, 2,
- 27, 0, 44, 0, 2, 0, 3, 1, 2, 0, 18, 0, 2, 0,223, 2, 2, 0, 56, 0, 7, 0, 58, 3, 7, 0, 59, 3,152, 0, 6, 0,
-110, 0,197, 2, 4, 0, 60, 3, 2, 0, 18, 0, 2, 0, 61, 3, 7, 0, 62, 3, 0, 0,170, 0,153, 0, 8, 0,110, 0,197, 2,
- 0, 0, 63, 3, 0, 0, 64, 3, 0, 0,191, 2, 0, 0, 65, 3, 0, 0, 66, 3, 0, 0, 92, 0, 0, 0,179, 2,154, 0, 3, 0,
-110, 0,197, 2,155, 0, 67, 3,139, 0, 18, 3,156, 0, 10, 0,110, 0,197, 2, 27, 0, 68, 3, 27, 0, 69, 3, 0, 0, 70, 3,
- 7, 0, 71, 3, 2, 0, 72, 3, 2, 0, 73, 3, 0, 0, 74, 3, 0, 0, 75, 3, 0, 0,208, 2,157, 0, 9, 0,110, 0,197, 2,
- 27, 0, 76, 3, 0, 0, 70, 3, 7, 0, 77, 3, 7, 0, 78, 3, 0, 0, 87, 1, 0, 0,223, 2, 0, 0, 79, 3, 0, 0, 27, 0,
-158, 0, 1, 0,110, 0,197, 2,159, 0, 11, 0,110, 0,197, 2, 0, 0,233, 2, 7, 0,128, 0, 7, 0, 80, 3, 7, 0, 81, 3,
- 7, 0, 82, 3, 7, 0, 83, 3, 7, 0, 84, 3, 4, 0, 18, 0, 2, 0, 85, 3, 2, 0, 86, 3,160, 0, 9, 0,110, 0,197, 2,
- 27, 0, 87, 3, 4, 0, 88, 3, 4, 0, 89, 3, 4, 0, 90, 3, 7, 0, 91, 3, 7, 0, 92, 3, 2, 0,223, 2, 2, 0, 18, 0,
-161, 0, 29, 0,110, 0,197, 2,162, 0, 93, 3,163, 0, 94, 3, 4, 0, 95, 3, 4, 0, 96, 3, 7, 0, 97, 3, 7, 0, 2, 3,
- 7, 0, 98, 3, 7, 0,250, 0, 7, 0, 99, 3, 7, 0,100, 3, 7, 0,101, 3, 7, 0,102, 3, 7, 0,103, 3, 7, 0,237, 2,
- 4, 0,104, 3, 4, 0,105, 3, 0, 0,106, 3, 0, 0,107, 3, 0, 0,108, 3, 0, 0,109, 3, 0, 0, 18, 0, 0, 0,110, 3,
- 2, 0,111, 3, 2, 0,112, 3, 4, 0,211, 2, 7, 0,108, 0, 7, 0,113, 3, 4, 0, 27, 0,164, 0, 3, 0,110, 0,197, 2,
- 4, 0, 95, 3, 4, 0,114, 3,165, 0, 15, 0,110, 0,197, 2, 47, 0,198, 2, 27, 0,199, 2, 0, 0,200, 2, 4, 0,201, 2,
- 4, 0,202, 2, 27, 0,115, 3, 27, 0,116, 3, 54, 0,100, 1, 0, 0,233, 2, 7, 0,238, 2, 7, 0,117, 3, 0, 0, 18, 0,
- 0, 0,253, 0, 0, 0,208, 2,166, 0, 16, 0,110, 0,197, 2, 0, 0,233, 2, 2, 0,118, 3, 2, 0,253, 0, 7, 0,119, 3,
- 54, 0,120, 3, 7, 0,121, 3, 7, 0,122, 3, 7, 0,123, 3, 0, 0,124, 3, 4, 0,125, 3, 47, 0,126, 3, 27, 0,127, 3,
- 4, 0,128, 3, 0, 0,129, 3, 4, 0,130, 3,167, 0, 16, 0,110, 0,197, 2, 0, 0,131, 3, 0, 0,132, 3, 7, 0,133, 3,
- 7, 0,134, 3, 0, 0,135, 3, 0, 0,136, 3, 0, 0,137, 3, 7, 0,123, 3, 0, 0,124, 3, 4, 0,125, 3, 47, 0,126, 3,
- 27, 0,127, 3, 4, 0,128, 3, 0, 0,129, 3, 4, 0,130, 3,168, 0, 16, 0,110, 0,197, 2, 0, 0,233, 2, 4, 0,138, 3,
- 4, 0,139, 3, 27, 0,140, 3, 7, 0,123, 3, 0, 0,124, 3, 4, 0,125, 3, 47, 0,126, 3, 27, 0,127, 3, 4, 0,128, 3,
- 0, 0,129, 3, 7, 0,141, 3, 7, 0,142, 3, 2, 0,253, 0, 2, 0,143, 3,169, 0, 5, 0,110, 0,197, 2,170, 0,144, 3,
-171, 0,145, 3, 4, 0, 16, 0, 4, 0, 27, 0,172, 0, 8, 0,110, 0,197, 2, 7, 0,146, 3, 7, 0,147, 3, 7, 0,148, 3,
- 0, 0,250, 0, 0, 0, 18, 0, 0, 0, 87, 1, 0, 0, 27, 0,173, 0, 3, 0,174, 0,149, 3, 4, 0, 66, 2, 0, 0, 94, 0,
-174, 0, 29, 0, 22, 0, 32, 0, 34, 0, 75, 0, 2, 0, 48, 2, 2, 0, 49, 2, 2, 0,150, 3, 2, 0, 18, 0, 2, 0,151, 3,
- 2, 0,152, 3, 2, 0,153, 3, 2, 0, 30, 0, 0, 0,154, 3, 0, 0,155, 3, 0, 0,156, 3, 0, 0, 74, 0, 4, 0, 27, 0,
- 7, 0,157, 3, 7, 0,158, 3, 7, 0,159, 3, 7, 0,160, 3, 7, 0,161, 3, 7, 0,162, 3, 29, 0,163, 3, 31, 0, 80, 0,
- 33, 0, 73, 2, 90, 0,126, 2, 0, 0, 70, 0, 7, 0,164, 3, 7, 0,165, 3,173, 0,166, 3,175, 0, 5, 0,175, 0, 0, 0,
-175, 0, 1, 0, 0, 0, 19, 0, 0, 0, 18, 0, 0, 0,124, 0, 68, 0, 3, 0, 7, 0,167, 3, 4, 0, 18, 0, 4, 0, 27, 0,
- 27, 0,128, 0, 22, 0, 32, 0, 34, 0, 75, 0,176, 0,168, 3, 2, 0, 16, 0, 2, 0,169, 3, 4, 0,170, 3, 4, 0,171, 3,
- 4, 0,172, 3, 0, 0,173, 3, 27, 0, 38, 0, 27, 0,174, 3, 27, 0,175, 3, 27, 0,176, 3, 27, 0,177, 3, 31, 0, 80, 0,
- 68, 0, 15, 2,177, 0,178, 3,177, 0,179, 3,178, 0,180, 3, 11, 0, 2, 0,179, 0,181, 3,180, 0,182, 3,181, 0,183, 3,
- 14, 0,184, 3, 14, 0,185, 3, 14, 0, 28, 2, 14, 0,186, 3, 14, 0,187, 3, 4, 0, 87, 1, 4, 0,188, 3, 63, 0, 30, 2,
- 0, 0,189, 3, 4, 0, 32, 2, 4, 0,190, 3, 7, 0, 77, 1, 7, 0,191, 3, 7, 0,192, 3, 7, 0,176, 0, 7, 0,193, 3,
- 7, 0,194, 3, 7, 0, 78, 1, 7, 0,195, 3, 7, 0, 18, 2, 7, 0,196, 3, 7, 0,197, 3, 7, 0,198, 3, 7, 0,199, 3,
- 7, 0,200, 3, 7, 0,201, 3, 7, 0, 10, 3, 7, 0,202, 3, 7, 0,244, 0, 7, 0,203, 3, 4, 0,204, 3, 4, 0,205, 3,
- 2, 0, 18, 0, 2, 0,206, 3, 2, 0,207, 3, 2, 0,208, 3, 2, 0,209, 3, 2, 0,210, 3, 2, 0,211, 3, 2, 0,212, 3,
- 2, 0,213, 3, 0, 0,214, 3, 0, 0,215, 3, 4, 0,216, 3, 4, 0,217, 3, 4, 0,218, 3, 4, 0,219, 3, 7, 0,220, 3,
- 7, 0,108, 2, 7, 0,221, 3, 7, 0,222, 3, 7, 0,223, 3, 7, 0,224, 3, 7, 0,225, 3, 7, 0,220, 0, 7, 0,226, 3,
- 7, 0,227, 3, 7, 0,228, 3, 7, 0,229, 3, 7, 0,230, 3, 2, 0,231, 3, 0, 0,232, 3, 0, 0,233, 3, 0, 0,234, 3,
- 0, 0,235, 3, 0, 0,110, 0, 0, 0,236, 3, 7, 0,237, 3, 7, 0,238, 3, 14, 0,239, 3, 14, 0,240, 3, 14, 0,241, 3,
- 14, 0,242, 3, 7, 0,243, 3, 2, 0, 13, 2, 2, 0,244, 3, 7, 0,151, 2, 4, 0,245, 3, 4, 0,246, 3,182, 0,247, 3,
- 2, 0,248, 3, 2, 0,251, 0, 7, 0,249, 3, 14, 0,250, 3, 14, 0,251, 3, 14, 0,252, 3, 14, 0,253, 3,183, 0, 73, 1,
-184, 0,254, 3, 64, 0,255, 3, 0, 0, 0, 4, 0, 0, 1, 4, 2, 0, 66, 2, 7, 0,143, 2,155, 0, 2, 4,143, 0, 3, 4,
-143, 0, 4, 4, 10, 0, 5, 4, 10, 0, 6, 4, 4, 0, 7, 4, 4, 0, 8, 4, 14, 0, 9, 4, 14, 0, 10, 4, 14, 0, 11, 4,
- 7, 0, 12, 4,185, 0, 14, 0,185, 0, 0, 0,185, 0, 1, 0, 27, 0, 38, 0, 7, 0, 10, 3, 7, 0, 79, 1, 7, 0, 11, 3,
- 7, 0, 3, 3, 0, 0, 19, 0, 4, 0, 12, 3, 4, 0, 13, 3, 4, 0, 13, 4, 2, 0, 16, 0, 2, 0, 14, 4, 7, 0, 14, 3,
-186, 0, 12, 0,186, 0, 0, 0,186, 0, 1, 0, 27, 0, 44, 0, 4, 0, 15, 4, 4, 0, 13, 2, 7, 0, 79, 1, 7, 0, 16, 4,
- 7, 0, 17, 4, 7, 0,170, 2, 2, 0, 16, 0, 0, 0, 18, 4, 0, 0, 19, 4,183, 0, 40, 0, 4, 0, 18, 0, 2, 0, 20, 4,
- 2, 0, 21, 4, 2, 0, 3, 3, 2, 0, 22, 4, 2, 0, 23, 4, 2, 0, 24, 4, 2, 0, 25, 4, 2, 0, 26, 4, 7, 0, 27, 4,
- 7, 0, 28, 4, 7, 0, 29, 4, 7, 0, 30, 4, 7, 0, 31, 4, 7, 0, 32, 4, 7, 0, 33, 4, 7, 0, 34, 4, 7, 0, 35, 4,
- 7, 0, 36, 4, 7, 0, 37, 4, 7, 0, 38, 4, 7, 0, 39, 4, 7, 0, 40, 4, 7, 0, 41, 4, 7, 0, 42, 4, 7, 0, 43, 4,
- 7, 0, 44, 4, 7, 0, 45, 4, 7, 0, 46, 4, 7, 0, 47, 4, 7, 0, 48, 4, 7, 0, 49, 4, 7, 0, 50, 4, 7, 0, 51, 4,
- 7, 0, 52, 4, 7, 0, 53, 4, 47, 0,169, 0,187, 0, 54, 4, 7, 0, 55, 4, 4, 0,211, 2,188, 0, 5, 0, 64, 0,249, 1,
- 7, 0, 56, 4, 7, 0, 57, 4, 2, 0, 18, 0, 2, 0, 58, 4,189, 0, 5, 0,189, 0, 0, 0,189, 0, 1, 0, 4, 0, 16, 0,
- 4, 0, 59, 4, 11, 0, 2, 0,190, 0, 9, 0,190, 0, 0, 0,190, 0, 1, 0, 4, 0, 60, 4, 4, 0, 61, 4, 4, 0, 62, 4,
- 4, 0, 18, 0, 11, 0, 63, 4, 11, 0, 64, 4, 14, 0, 65, 4,139, 0, 23, 0,139, 0, 0, 0,139, 0, 1, 0, 4, 0, 18, 0,
- 4, 0, 66, 4, 4, 0, 67, 4, 4, 0, 68, 4, 4, 0, 69, 4, 4, 0, 70, 4, 4, 0, 71, 4, 4, 0, 72, 4, 4, 0, 27, 0,
- 4, 0, 61, 4, 4, 0, 13, 2, 2, 0, 73, 4, 2, 0, 56, 0, 0, 0, 19, 0, 0, 0, 74, 4, 0, 0, 75, 4, 0, 0, 76, 4,
- 0, 0, 77, 4, 14, 0, 78, 4,191, 0, 79, 4, 11, 0, 80, 4,192, 0, 1, 0, 7, 0, 46, 2,182, 0, 30, 0, 4, 0, 18, 0,
- 7, 0, 81, 4, 7, 0, 82, 4, 7, 0, 83, 4, 4, 0, 84, 4, 4, 0, 85, 4, 4, 0, 86, 4, 4, 0, 87, 4, 7, 0, 88, 4,
- 7, 0, 89, 4, 7, 0, 90, 4, 7, 0, 91, 4, 7, 0, 92, 4, 7, 0, 93, 4, 7, 0, 94, 4, 7, 0, 95, 4, 7, 0, 96, 4,
- 7, 0, 97, 4, 7, 0, 98, 4, 7, 0, 99, 4, 7, 0,100, 4, 7, 0,101, 4, 7, 0,102, 4, 7, 0,103, 4, 7, 0,104, 4,
- 7, 0,105, 4, 4, 0,106, 4, 4, 0,107, 4, 7, 0,108, 4, 7, 0,226, 3,184, 0, 54, 0, 4, 0, 61, 4, 4, 0,109, 4,
-193, 0,110, 4,194, 0,111, 4, 0, 0, 27, 0, 0, 0,112, 4, 2, 0,113, 4, 7, 0,114, 4, 0, 0,115, 4, 7, 0,116, 4,
- 7, 0,117, 4, 7, 0,118, 4, 7, 0,119, 4, 7, 0,120, 4, 7, 0,121, 4, 7, 0,122, 4, 7, 0,123, 4, 7, 0,124, 4,
- 2, 0,125, 4, 0, 0,126, 4, 2, 0,127, 4, 7, 0,128, 4, 7, 0,129, 4, 0, 0,130, 4, 4, 0,129, 0, 4, 0,131, 4,
- 4, 0,132, 4, 2, 0,133, 4, 2, 0,134, 4,192, 0,135, 4, 4, 0,136, 4, 4, 0, 82, 0, 7, 0,137, 4, 7, 0,138, 4,
- 7, 0,139, 4, 7, 0,140, 4, 2, 0,141, 4, 2, 0,142, 4, 2, 0,143, 4, 2, 0,144, 4, 2, 0,145, 4, 2, 0,146, 4,
- 2, 0,147, 4, 2, 0,148, 4,195, 0,149, 4, 7, 0,150, 4, 7, 0,151, 4,139, 0,152, 4, 14, 0, 19, 3,188, 0,153, 4,
- 7, 0,154, 4, 7, 0,155, 4, 7, 0,156, 4, 4, 0,157, 4,196, 0, 1, 0, 7, 0,158, 4,155, 0, 52, 0,154, 0,159, 4,
- 2, 0, 16, 0, 2, 0,160, 4, 2, 0,161, 4, 2, 0,162, 4, 7, 0,163, 4, 2, 0,164, 4, 2, 0,165, 4, 7, 0,166, 4,
- 2, 0,167, 4, 2, 0,168, 4, 7, 0,169, 4, 7, 0,170, 4, 7, 0,171, 4, 4, 0,172, 4, 4, 0,173, 4, 4, 0,174, 4,
- 4, 0, 27, 0, 7, 0,175, 4, 4, 0,176, 4, 7, 0,177, 4, 7, 0,178, 4, 7, 0,179, 4, 79, 0,180, 4, 79, 0,181, 4,
- 0, 0,182, 4, 7, 0,183, 4, 7, 0,184, 4, 31, 0, 80, 0, 2, 0,185, 4, 0, 0,186, 4, 0, 0,187, 4, 7, 0,188, 4,
- 4, 0,189, 4, 7, 0,190, 4, 7, 0,191, 4, 4, 0,192, 4, 4, 0, 18, 0, 7, 0,193, 4, 7, 0,194, 4, 7, 0,195, 4,
-196, 0,196, 4, 4, 0, 53, 0, 7, 0,197, 4, 7, 0,198, 4, 7, 0,199, 4, 7, 0,200, 4, 7, 0,201, 4, 7, 0,202, 4,
- 7, 0,203, 4, 4, 0,204, 4, 7, 0,205, 4,197, 0, 78, 0, 22, 0, 32, 0, 34, 0, 75, 0, 2, 0,179, 0, 2, 0, 88, 1,
- 2, 0,122, 1, 2, 0,206, 4, 7, 0,207, 4, 7, 0,208, 4, 7, 0,209, 4, 7, 0,210, 4, 7, 0,211, 4, 7, 0,212, 4,
- 7, 0,170, 1, 7, 0,172, 1, 7, 0,171, 1, 7, 0, 30, 0, 4, 0,213, 4, 7, 0,214, 4, 7, 0,215, 4, 7, 0,216, 4,
- 7, 0,217, 4, 7, 0,218, 4, 7, 0,219, 4, 7, 0,220, 4, 2, 0,221, 4, 2, 0, 87, 1, 2, 0,222, 4, 2, 0,223, 4,
- 2, 0,224, 4, 2, 0,225, 4, 2, 0,226, 4, 2, 0,227, 4, 7, 0,228, 4, 7, 0,229, 4, 7, 0,230, 4, 7, 0,231, 4,
- 7, 0,232, 4, 7, 0,233, 4, 7, 0,234, 4, 7, 0,235, 4, 7, 0,236, 4, 7, 0,237, 4, 7, 0,238, 4, 7, 0,239, 4,
- 2, 0,240, 4, 2, 0,241, 4, 2, 0,242, 4, 2, 0,243, 4, 7, 0,244, 4, 7, 0,245, 4, 7, 0,246, 4, 7, 0,247, 4,
- 2, 0,248, 4, 2, 0,249, 4, 2, 0,250, 4, 2, 0,251, 4, 7, 0,252, 4, 7, 0,253, 4, 7, 0,254, 4, 7, 0,255, 4,
- 7, 0, 0, 5, 7, 0, 1, 5, 7, 0, 2, 5, 2, 0, 3, 5, 2, 0, 4, 5, 2, 0, 5, 5, 2, 0, 6, 5, 2, 0, 7, 5,
- 2, 0, 18, 0, 7, 0, 8, 5, 7, 0, 9, 5, 31, 0, 80, 0, 46, 0,140, 1, 2, 0,141, 1, 2, 0, 76, 1, 2, 0,179, 2,
- 25, 0,154, 0, 57, 0, 70, 1,198, 0, 8, 0,198, 0, 0, 0,198, 0, 1, 0, 4, 0,204, 3, 4, 0, 10, 5, 4, 0, 18, 0,
- 2, 0, 11, 5, 2, 0, 12, 5, 27, 0,168, 0,199, 0, 13, 0, 11, 0, 13, 5, 11, 0, 14, 5, 4, 0, 15, 5, 4, 0, 16, 5,
- 4, 0, 17, 5, 4, 0, 18, 5, 4, 0, 19, 5, 4, 0, 20, 5, 4, 0, 21, 5, 4, 0, 22, 5, 4, 0, 23, 5, 4, 0, 27, 0,
- 0, 0, 24, 5,200, 0, 5, 0, 11, 0, 25, 5, 11, 0, 26, 5, 4, 0, 27, 5, 4, 0, 30, 0, 0, 0, 28, 5,201, 0, 17, 0,
- 4, 0, 29, 5, 4, 0, 30, 5, 4, 0, 31, 5, 4, 0, 32, 5, 4, 0, 33, 5, 4, 0, 34, 5, 4, 0, 35, 5, 4, 0, 36, 5,
- 4, 0, 37, 5, 4, 0, 38, 5, 4, 0, 39, 5, 4, 0, 40, 5, 2, 0, 41, 5, 2, 0, 42, 5, 4, 0, 43, 5, 4, 0, 44, 5,
- 4, 0, 91, 0,202, 0, 17, 0, 4, 0, 16, 0, 4, 0, 31, 5, 4, 0, 45, 5, 4, 0, 46, 5, 4, 0, 47, 5, 4, 0, 48, 5,
- 4, 0, 49, 5, 4, 0, 50, 5, 7, 0, 51, 5, 4, 0, 52, 5, 4, 0, 92, 0, 4, 0, 53, 5, 4, 0, 54, 5, 4, 0, 55, 5,
- 4, 0, 56, 5, 4, 0, 57, 5, 21, 0, 31, 0,203, 0, 9, 0, 4, 0, 58, 5, 7, 0, 59, 5, 7, 0, 60, 5, 7, 0, 61, 5,
- 4, 0, 62, 5, 2, 0, 18, 0, 2, 0, 27, 0, 7, 0, 83, 4, 7, 0, 30, 0,204, 0, 11, 0,204, 0, 0, 0,204, 0, 1, 0,
- 0, 0, 19, 0, 63, 0, 63, 5, 64, 0, 64, 5, 4, 0,204, 3, 4, 0, 65, 5, 4, 0, 66, 5, 4, 0, 27, 0, 4, 0, 67, 5,
- 4, 0, 68, 5,205, 0, 13, 0, 0, 0, 69, 5, 0, 0,250, 0, 0, 0, 70, 5, 0, 0, 18, 0, 0, 0, 71, 5, 0, 0, 72, 5,
- 0, 0, 73, 5, 0, 0, 74, 5, 2, 0, 75, 5, 2, 0, 76, 5, 7, 0, 77, 5, 0, 0, 78, 5, 0, 0,124, 0,206, 0,106, 0,
-205, 0, 79, 5,199, 0, 80, 5,200, 0, 81, 5,201, 0, 82, 5,202, 0, 83, 5, 4, 0, 34, 3, 4, 0,129, 0, 4, 0,131, 4,
- 7, 0, 84, 5, 4, 0, 85, 5, 4, 0, 86, 5, 4, 0, 87, 5, 4, 0, 88, 5, 2, 0, 18, 0, 2, 0, 89, 5, 7, 0, 90, 5,
- 7, 0, 91, 5, 7, 0, 92, 5, 7, 0, 93, 5, 7, 0, 94, 5, 2, 0, 95, 5, 2, 0, 96, 5, 2, 0, 97, 5, 2, 0, 98, 5,
- 2, 0,250, 0, 2, 0, 99, 5, 4, 0,100, 5, 2, 0,101, 5, 2, 0,102, 5, 2, 0,109, 1, 2, 0,108, 0, 2, 0,103, 5,
- 2, 0,104, 5, 2, 0,105, 5, 2, 0,106, 5, 2, 0,107, 5, 2, 0, 70, 5, 2, 0, 69, 5, 2, 0,108, 5, 2, 0, 71, 5,
- 2, 0,109, 5, 4, 0,110, 5, 4, 0, 87, 1, 4, 0,111, 5, 2, 0,112, 5, 2, 0, 91, 0, 2, 0,113, 5, 2, 0,114, 5,
- 2, 0,115, 5, 2, 0,116, 5, 2, 0,117, 5, 2, 0,118, 5, 19, 0,119, 5, 19, 0,120, 5, 18, 0,121, 5, 14, 0,122, 5,
- 2, 0,123, 5, 2, 0,124, 5, 7, 0,125, 5, 7, 0,126, 5, 7, 0,127, 5, 7, 0,128, 5, 4, 0,129, 5, 7, 0,130, 5,
- 7, 0,131, 5, 7, 0,132, 5, 7, 0,133, 5, 2, 0,134, 5, 2, 0,135, 5, 2, 0,136, 5, 2, 0,137, 5, 2, 0,138, 5,
- 2, 0,139, 5, 7, 0,140, 5, 7, 0,141, 5, 7, 0,142, 5, 0, 0,143, 5, 4, 0,144, 5, 2, 0,145, 5, 2, 0, 74, 0,
- 0, 0,146, 5, 7, 0,147, 5, 7, 0,148, 5, 0, 0,149, 5, 0, 0,150, 5, 0, 0,151, 5, 0, 0,152, 5, 4, 0,153, 5,
- 2, 0,154, 5, 2, 0,155, 5, 7, 0,156, 5, 7, 0,157, 5, 2, 0,158, 5, 2, 0,159, 5, 7, 0,160, 5, 2, 0,161, 5,
- 2, 0,162, 5, 4, 0,163, 5, 2, 0,164, 5, 2, 0,165, 5, 2, 0,166, 5, 2, 0,167, 5, 7, 0,168, 5, 7, 0, 30, 0,
- 37, 0,169, 5, 0, 0,170, 5,207, 0, 9, 0,207, 0, 0, 0,207, 0, 1, 0, 0, 0,171, 5, 2, 0,172, 5, 2, 0,173, 5,
- 2, 0,174, 5, 2, 0, 91, 0, 7, 0,175, 5, 7, 0, 30, 0,208, 0, 7, 0, 2, 0,228, 2, 2, 0, 87, 1, 2, 0, 92, 3,
- 2, 0,176, 5, 7, 0,177, 5, 7, 0, 30, 0, 37, 0,178, 5,209, 0, 5, 0, 7, 0,179, 5, 0, 0, 16, 0, 0, 0, 91, 0,
- 0, 0, 30, 0, 0, 0, 74, 0,210, 0, 15, 0, 7, 0,180, 5, 7, 0,181, 5, 7, 0,182, 5, 7, 0,183, 5, 7, 0,184, 5,
- 7, 0,185, 5, 7, 0,186, 5, 7, 0,187, 5, 7, 0,188, 5, 7, 0,189, 5, 4, 0,190, 5, 7, 0,191, 5, 7, 0,192, 5,
- 2, 0, 91, 0, 2, 0, 30, 0,211, 0, 32, 0,209, 0,193, 5, 2, 0,194, 5, 2, 0, 96, 5, 2, 0, 97, 5, 2, 0, 98, 5,
- 2, 0,250, 0, 2, 0, 99, 5, 2, 0,195, 5, 2, 0,196, 5, 2, 0,197, 5, 2, 0,198, 5,208, 0,199, 5, 2, 0,200, 5,
- 2, 0,101, 5, 7, 0,201, 5,210, 0,202, 5, 7, 0,219, 4, 7, 0,220, 4, 4, 0, 18, 0, 2, 0, 87, 1, 2, 0,203, 5,
- 2, 0,222, 4, 2, 0,223, 4, 2, 0,204, 5, 2, 0, 27, 0, 2, 0,224, 4, 2, 0,225, 4, 2, 0,226, 4, 2, 0,227, 4,
- 2, 0,205, 5, 2, 0, 91, 0, 7, 0,206, 5,212, 0, 6, 0,212, 0, 0, 0,212, 0, 1, 0, 4, 0, 60, 4, 0, 0, 19, 0,
- 4, 0, 18, 0, 27, 0,207, 5,213, 0, 4, 0,214, 0,145, 3, 11, 0,208, 5, 0, 0,209, 5, 4, 0, 92, 0,215, 0, 8, 0,
-213, 0,210, 5, 2, 0, 18, 0, 2, 0, 27, 0, 2, 0,211, 5, 2, 0,212, 5, 2, 0,213, 5, 4, 0, 91, 0, 11, 0,214, 5,
-216, 0, 6, 0, 2, 0,108, 0, 2, 0, 66, 4, 2, 0,215, 5, 2, 0,222, 2, 4, 0, 18, 0, 7, 0,238, 2,217, 0, 14, 0,
- 2, 0, 18, 0, 2, 0,216, 5, 2, 0,217, 5, 2, 0,218, 5,216, 0,219, 5, 11, 0,214, 5, 7, 0,220, 5, 7, 0, 56, 0,
- 4, 0,221, 5, 4, 0,222, 5, 4, 0,223, 5, 4, 0,224, 5, 41, 0,125, 0, 27, 0,168, 0,218, 0, 14, 0,213, 0,210, 5,
- 4, 0, 92, 0, 4, 0,225, 5, 7, 0,226, 5, 7, 0,227, 5, 7, 0,228, 5, 4, 0,229, 5, 4, 0,230, 5, 7, 0,231, 5,
- 7, 0,232, 5, 4, 0,233, 5, 7, 0,234, 5, 7, 0,235, 5, 4, 0, 27, 0,219, 0, 1, 0,213, 0,210, 5,220, 0, 7, 0,
-213, 0,210, 5, 2, 0, 18, 0, 2, 0, 27, 0, 4, 0, 37, 0, 4, 0,236, 5, 90, 0,237, 5, 11, 0,214, 5,221, 0, 5, 0,
-221, 0, 0, 0,221, 0, 1, 0, 0, 0, 19, 0, 7, 0,238, 5, 4, 0, 27, 0,222, 0, 4, 0, 4, 0,108, 0, 7, 0,239, 5,
- 7, 0,178, 1, 4, 0, 18, 0,223, 0, 85, 0,220, 0,240, 5,220, 0,241, 5,218, 0,168, 3,219, 0,242, 5, 7, 0,243, 5,
- 2, 0,244, 5, 2, 0,245, 5, 7, 0,246, 5, 7, 0,247, 5, 2, 0, 66, 4, 2, 0,248, 5, 7, 0,249, 5, 7, 0,250, 5,
- 7, 0,251, 5, 2, 0,252, 5, 2, 0,221, 5, 2, 0,253, 5, 2, 0,254, 5, 2, 0,255, 5, 2, 0, 0, 6, 7, 0, 1, 6,
- 7, 0, 2, 6, 7, 0, 3, 6, 2, 0, 4, 6, 2, 0, 5, 6, 2, 0, 6, 6, 2, 0, 7, 6, 2, 0, 8, 6, 2, 0, 9, 6,
- 2, 0, 10, 6, 2, 0, 11, 6,215, 0, 12, 6,217, 0, 13, 6, 7, 0, 14, 6, 7, 0, 15, 6, 7, 0, 16, 6, 2, 0, 17, 6,
- 2, 0, 18, 6, 0, 0, 19, 6, 0, 0, 20, 6, 2, 0, 21, 6, 7, 0, 22, 6, 7, 0, 23, 6, 7, 0, 24, 6, 7, 0, 25, 6,
- 7, 0, 26, 6, 7, 0, 27, 6, 7, 0, 28, 6, 7, 0, 29, 6, 7, 0, 30, 6, 7, 0, 31, 6, 2, 0, 32, 6, 0, 0, 33, 6,
- 0, 0, 34, 6, 0, 0, 35, 6, 0, 0, 36, 6, 27, 0, 37, 6, 0, 0, 38, 6, 0, 0, 39, 6, 0, 0, 40, 6, 0, 0, 41, 6,
- 0, 0, 42, 6, 0, 0, 43, 6, 0, 0, 44, 6, 0, 0, 45, 6, 0, 0, 46, 6, 0, 0, 47, 6, 2, 0, 48, 6, 2, 0, 49, 6,
- 2, 0, 50, 6, 2, 0, 51, 6, 0, 0, 52, 6, 0, 0, 53, 6, 0, 0, 54, 6, 0, 0, 55, 6, 4, 0, 56, 6, 4, 0, 57, 6,
- 4, 0, 58, 6, 4, 0, 59, 6, 2, 0, 60, 6, 2, 0, 91, 0, 4, 0, 61, 6, 7, 0, 62, 6, 7, 0, 63, 6,222, 0, 64, 6,
-224, 0, 8, 0, 4, 0, 65, 6, 4, 0, 66, 6, 4, 0, 67, 6, 4, 0, 68, 6, 4, 0, 69, 6, 4, 0, 70, 6, 4, 0, 53, 0,
- 4, 0,138, 2,225, 0, 4, 0, 7, 0, 71, 6, 0, 0, 72, 6, 0, 0, 73, 6, 2, 0, 18, 0,226, 0, 4, 0, 7, 0, 74, 6,
- 4, 0, 18, 0, 4, 0, 75, 6, 4, 0, 56, 0, 41, 0, 46, 0, 22, 0, 32, 0, 34, 0, 75, 0, 27, 0,207, 5,197, 0, 76, 6,
- 41, 0, 77, 6, 14, 0, 78, 6,198, 0, 79, 6, 27, 0, 80, 6, 7, 0, 81, 6, 7, 0, 82, 6, 7, 0, 83, 6, 7, 0, 84, 6,
- 4, 0,204, 3, 4, 0, 85, 6, 4, 0, 86, 6, 2, 0, 18, 0, 2, 0, 76, 1, 57, 0, 70, 1,227, 0, 87, 6,223, 0, 88, 6,
-228, 0, 89, 6,206, 0,185, 0,203, 0, 90, 6, 14, 0,102, 0, 14, 0, 91, 6, 11, 0, 92, 6, 11, 0, 93, 6, 11, 0, 94, 6,
- 11, 0, 95, 6, 11, 0, 96, 6,229, 0, 97, 6, 2, 0, 98, 6, 2, 0, 99, 6, 2, 0,251, 0, 2, 0,205, 3, 4, 0,215, 3,
- 4, 0,100, 6, 14, 0,101, 6,209, 0,193, 5,211, 0,102, 6,225, 0,103, 6,179, 0,181, 3,226, 0,104, 6,230, 0,105, 6,
- 10, 0, 6, 4, 10, 0,106, 6,231, 0, 14, 0,231, 0, 0, 0,231, 0, 1, 0, 42, 0,242, 0, 40, 0, 69, 1,230, 0,105, 6,
-232, 0,107, 6, 7, 0, 96, 2, 7, 0, 97, 2, 7, 0,108, 0, 7, 0,108, 6, 2, 0,109, 6, 2, 0, 18, 0, 2, 0,143, 0,
- 2, 0, 27, 0,233, 0, 41, 0, 7, 0,110, 6, 7, 0,111, 6, 7, 0,112, 6, 7, 0,113, 6, 7, 0,114, 6, 7, 0,115, 6,
- 7, 0,116, 6, 7, 0,117, 6, 7, 0,118, 6, 7, 0, 94, 1, 7, 0,119, 6, 7, 0,120, 6, 7, 0,121, 6, 7, 0,122, 6,
- 7, 0,175, 0, 2, 0,123, 6, 2, 0,124, 6, 0, 0,125, 6, 0, 0, 86, 1, 2, 0,126, 6, 2, 0,127, 6, 2, 0,128, 6,
- 2, 0,109, 6, 7, 0,129, 6, 7, 0,130, 6, 68, 0,131, 6,179, 0,181, 3,233, 0,132, 6,234, 0,133, 6,235, 0,134, 6,
-236, 0,135, 6,237, 0,136, 6,238, 0,137, 6, 7, 0,138, 6, 2, 0,139, 6, 2, 0,140, 6, 7, 0,141, 6, 7, 0,142, 6,
- 7, 0,143, 6, 7, 0,144, 6, 0, 0,145, 6,239, 0, 51, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6,
- 7, 0,148, 6, 2, 0,149, 6, 7, 0,118, 6, 7, 0, 94, 1, 7, 0,150, 6, 2, 0,151, 6, 0, 0,208, 2, 4, 0,152, 6,
- 2, 0,128, 6, 2, 0,109, 6, 27, 0,207, 5, 27, 0,153, 6, 14, 0,154, 6,231, 0,155, 6,239, 0,132, 6, 0, 0,156, 6,
- 4, 0,204, 3, 4, 0, 85, 6, 2, 0,157, 6, 2, 0,158, 6, 2, 0,159, 6, 2, 0,160, 6, 2, 0, 18, 0, 2, 0, 31, 2,
- 7, 0,114, 0, 7, 0,161, 6, 7, 0,162, 6, 7, 0,163, 6, 7, 0,175, 0, 7, 0, 81, 6, 2, 0,164, 6, 2, 0,165, 6,
- 2, 0,166, 6, 0, 0,167, 6, 0, 0,168, 6, 0, 0,169, 6, 0, 0,170, 6, 0, 0,171, 6, 14, 0,172, 6, 14, 0,173, 6,
- 14, 0,174, 6, 2, 0,175, 6, 2, 0,152, 2, 2, 0,176, 6, 0, 0,177, 6, 11, 0,178, 6,179, 0,181, 3,241, 0, 24, 0,
- 19, 0, 37, 0, 19, 0, 63, 0, 18, 0,179, 6, 18, 0,180, 6, 18, 0,181, 6, 7, 0,182, 6, 7, 0,183, 6, 7, 0,184, 6,
- 7, 0,185, 6, 2, 0,186, 6, 2, 0,187, 6, 2, 0,188, 6, 2, 0,189, 6, 2, 0,190, 6, 2, 0, 18, 0, 2, 0,191, 6,
- 2, 0,192, 6, 2, 0,193, 6, 2, 0,194, 6, 2, 0,195, 6, 2, 0,160, 6, 7, 0,196, 6, 4, 0,197, 6, 4, 0,198, 6,
-240, 0, 6, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6,242, 0, 8, 0,
-240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6, 0, 0,199, 6, 0, 0,124, 0,
-243, 0, 14, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6,241, 0,200, 6,
-244, 0,201, 6, 14, 0,202, 6, 2, 0, 87, 1, 2, 0,203, 6, 4, 0, 18, 0, 7, 0,204, 6, 4, 0,160, 6,245, 0, 21, 0,
-240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6,241, 0,200, 6, 2, 0,205, 6,
- 2, 0,206, 6, 2, 0,207, 6, 2, 0,208, 6, 2, 0,191, 6, 2, 0,209, 6, 2, 0,210, 6, 0, 0, 18, 0, 0, 0, 27, 0,
- 11, 0, 72, 2, 4, 0,211, 6, 4, 0,212, 6, 22, 0,213, 6, 11, 0,214, 6,246, 0, 18, 0,240, 0, 0, 0,240, 0, 1, 0,
- 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6,241, 0,200, 6, 7, 0, 96, 2, 7, 0, 97, 2, 2, 0,205, 6,
- 2, 0,215, 6, 2, 0,216, 6, 2, 0,217, 6, 4, 0, 18, 0, 7, 0,218, 6, 4, 0,109, 6, 4, 0, 27, 0,179, 0,181, 3,
-247, 0, 16, 0, 0, 0,219, 6, 0, 0,220, 6, 0, 0,221, 6, 0, 0,222, 6, 0, 0,223, 6, 0, 0,224, 6, 4, 0,225, 6,
- 4, 0,226, 6, 4, 0,227, 6, 2, 0, 16, 0, 2, 0, 18, 0, 2, 0,228, 6, 2, 0,229, 6, 2, 0,190, 1, 2, 0,230, 6,
- 0, 0,231, 6,248, 0, 16, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 4, 0,232, 6,247, 0,233, 6,
-249, 0,234, 6, 14, 0,235, 6, 14, 0,236, 6,250, 0,237, 6,238, 0,238, 6,251, 0,239, 6, 2, 0,240, 6, 2, 0,241, 6,
- 2, 0,242, 6, 2, 0, 30, 0,252, 0, 15, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6,
- 2, 0,149, 6,241, 0,200, 6, 14, 0,243, 6,253, 0,244, 6, 0, 0,245, 6,254, 0,246, 6, 2, 0, 18, 0, 2, 0,247, 6,
- 2, 0,248, 6, 2, 0,249, 6,255, 0, 25, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 4, 0, 18, 0,
- 42, 0,242, 2, 40, 0, 69, 1, 54, 0,250, 6, 0, 1,251, 6, 1, 1,252, 6,179, 0,181, 3, 7, 0,253, 6, 7, 0, 96, 2,
- 7, 0, 97, 2, 7, 0,218, 6, 7, 0,254, 6, 7, 0,255, 6, 2, 0, 0, 7, 2, 0, 27, 0, 2, 0, 1, 7, 2, 0, 2, 7,
- 0, 0, 3, 7, 0, 0, 4, 7, 0, 0, 5, 7, 0, 0,160, 6, 2, 1, 11, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6,
- 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6, 2, 0,203, 6, 2, 0, 18, 0, 4, 0, 27, 0,244, 0,201, 6,241, 0,200, 6,
- 3, 1, 31, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6, 37, 0, 6, 7,
- 4, 0, 7, 7, 4, 0, 8, 7, 2, 0, 92, 0, 2, 0, 9, 7, 2, 0, 10, 7, 0, 0, 11, 7, 0, 0, 12, 7, 4, 0, 13, 7,
- 4, 0, 14, 7, 4, 0, 15, 7, 2, 0, 16, 7, 2, 0, 17, 7, 2, 0, 18, 7, 2, 0, 19, 7, 7, 0, 20, 7, 18, 0, 21, 7,
- 18, 0, 22, 7, 4, 0, 23, 7, 4, 0, 24, 7, 0, 0, 25, 7, 0, 0, 26, 7, 2, 0, 27, 7, 0, 0,208, 2, 11, 0, 28, 7,
- 4, 1, 10, 0, 22, 0, 32, 0, 11, 0, 29, 7, 11, 0, 30, 7, 11, 0, 31, 7, 11, 0, 32, 7, 11, 0, 33, 7, 4, 0, 92, 0,
- 4, 0, 34, 7, 0, 0, 35, 7, 0, 0, 36, 7, 5, 1, 10, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6,
- 7, 0,148, 6, 4, 1, 37, 7, 2, 0, 92, 0, 2, 0, 9, 7, 4, 0, 91, 0, 11, 0, 38, 7, 6, 1, 3, 0, 6, 1, 0, 0,
- 6, 1, 1, 0, 7, 0, 39, 7, 7, 1, 9, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6,
-241, 0,200, 6, 14, 0, 40, 7, 4, 0, 41, 7, 4, 0, 18, 0, 8, 1, 27, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6,
- 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6,241, 0,200, 6, 22, 0, 42, 7, 22, 0, 81, 0, 2, 0, 18, 0, 2, 0, 91, 0,
- 7, 0, 43, 7, 7, 0, 96, 2, 7, 0, 97, 2, 7, 0,218, 6, 7, 0, 44, 7, 7, 0, 45, 7, 7, 0, 46, 7, 57, 0, 70, 1,
- 57, 0, 47, 7, 4, 0, 48, 7, 2, 0, 49, 7, 2, 0, 50, 7, 2, 0,251, 0, 2, 0, 86, 1, 14, 0, 51, 7,179, 0,181, 3,
- 9, 1, 10, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6, 2, 0, 18, 0,
- 2, 0,213, 3, 4, 0, 27, 0,179, 0,181, 3, 10, 1, 7, 0, 10, 1, 0, 0, 10, 1, 1, 0, 4, 0, 52, 7, 4, 0, 22, 0,
- 0, 0, 85, 0, 4, 0, 53, 7, 4, 0, 16, 0, 11, 1, 14, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6,
- 7, 0,148, 6, 2, 0,149, 6, 4, 0, 10, 7, 4, 0, 27, 0, 14, 0, 54, 7, 14, 0, 55, 7, 0, 0, 56, 7, 0, 0, 57, 7,
- 4, 0, 58, 7, 4, 0, 59, 7, 12, 1, 6, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 4, 0, 27, 0,
- 0, 0, 60, 7, 13, 1, 24, 0,240, 0, 0, 0,240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0, 96, 2, 7, 0, 97, 2,
- 7, 0, 61, 7, 7, 0, 62, 7, 7, 0,218, 6,232, 0, 63, 7,230, 0,105, 6, 14, 1,251, 6, 4, 0, 18, 0, 2, 0, 87, 1,
- 2, 0,109, 6, 4, 0, 64, 7, 7, 0, 65, 7, 7, 0,147, 3, 7, 0, 92, 3, 4, 0, 27, 0, 7, 0, 66, 7, 7, 0, 67, 7,
- 4, 0, 68, 7, 4, 0, 69, 7, 15, 1, 7, 0, 15, 1, 0, 0, 15, 1, 1, 0, 0, 0, 70, 7, 2, 0, 71, 7, 2, 0, 72, 7,
- 2, 0, 73, 7, 2, 0, 27, 0, 16, 1, 12, 0, 2, 0, 72, 7, 2, 0, 74, 7, 2, 0, 75, 7, 0, 0,208, 2, 2, 0, 76, 7,
- 2, 0, 77, 7, 2, 0, 78, 7, 2, 0, 79, 7, 2, 0, 80, 7, 2, 0,191, 6, 7, 0, 81, 7, 7, 0, 82, 7, 17, 1, 18, 0,
- 17, 1, 0, 0, 17, 1, 1, 0, 0, 0, 19, 0, 16, 1, 83, 7, 16, 1, 84, 7, 16, 1, 85, 7, 16, 1, 86, 7, 7, 0, 87, 7,
- 2, 0, 88, 7, 2, 0, 89, 7, 2, 0, 90, 7, 2, 0, 91, 7, 2, 0, 92, 7, 2, 0, 93, 7, 2, 0, 94, 7, 2, 0, 95, 7,
- 2, 0, 96, 7, 2, 0, 27, 0, 18, 1, 10, 0, 0, 0, 97, 7, 0, 0, 98, 7, 0, 0, 99, 7, 0, 0,100, 7, 0, 0,101, 7,
- 0, 0,102, 7, 2, 0,103, 7, 2, 0,104, 7, 2, 0,105, 7, 2, 0,106, 7, 19, 1, 8, 0, 0, 0,107, 7, 0, 0,108, 7,
- 0, 0,109, 7, 0, 0,110, 7, 0, 0,111, 7, 0, 0,112, 7, 7, 0,108, 6, 7, 0, 27, 0, 20, 1, 3, 0, 0, 0,113, 7,
- 2, 0,114, 7, 2, 0, 27, 0, 21, 1, 21, 0, 18, 1,115, 7, 18, 1,116, 7, 18, 1,117, 7, 18, 1,118, 7, 18, 1,119, 7,
- 18, 1,120, 7, 18, 1,121, 7, 18, 1,122, 7, 18, 1,123, 7, 18, 1,124, 7, 18, 1,125, 7, 18, 1,126, 7, 18, 1,127, 7,
- 18, 1,128, 7, 18, 1,129, 7, 18, 1,130, 7, 19, 1,131, 7, 20, 1,132, 7, 0, 0,133, 7, 7, 0,134, 7, 7, 0, 27, 0,
- 22, 1,119, 0, 0, 0,135, 7, 0, 0,136, 7, 0, 0,101, 7, 0, 0,137, 7, 0, 0,113, 7, 0, 0,138, 7, 0, 0,139, 7,
- 0, 0,140, 7, 0, 0,141, 7, 0, 0,142, 7, 0, 0,143, 7, 0, 0,144, 7, 0, 0,145, 7, 0, 0,146, 7, 0, 0,147, 7,
- 0, 0,148, 7, 0, 0,149, 7, 0, 0,150, 7, 0, 0,151, 7, 0, 0,152, 7, 0, 0,153, 7, 0, 0,154, 7, 0, 0,155, 7,
- 0, 0,156, 7, 0, 0,157, 7, 0, 0,158, 7, 0, 0,159, 7, 0, 0,160, 7, 0, 0,145, 6, 0, 0,161, 7, 0, 0,162, 7,
- 0, 0,163, 7, 0, 0,164, 7, 0, 0,165, 7, 0, 0,166, 7, 0, 0,167, 7, 0, 0,168, 7, 0, 0,169, 7, 0, 0,170, 7,
- 0, 0,171, 7, 0, 0,172, 7, 0, 0,173, 7, 0, 0,174, 7, 0, 0,175, 7, 0, 0,176, 7, 0, 0,177, 7, 0, 0,178, 7,
- 0, 0,179, 7, 0, 0,180, 7, 0, 0,181, 7, 0, 0,182, 7, 0, 0,183, 7, 0, 0,184, 7, 0, 0,185, 7, 0, 0,186, 7,
- 0, 0,187, 7, 0, 0,188, 7, 0, 0,189, 7, 0, 0,190, 7, 0, 0,191, 7, 0, 0,192, 7, 0, 0,193, 7, 0, 0,194, 7,
- 0, 0,195, 7, 0, 0,196, 7, 0, 0,197, 7, 0, 0,198, 7, 0, 0,199, 7, 0, 0,200, 7, 0, 0,201, 7, 0, 0,202, 7,
- 0, 0,203, 7, 0, 0,204, 7, 0, 0,205, 7, 0, 0,206, 7, 0, 0,207, 7, 0, 0,208, 7, 0, 0,209, 7, 0, 0,210, 7,
- 0, 0,211, 7, 0, 0,212, 7, 0, 0,213, 7, 0, 0,214, 7, 0, 0,215, 7, 0, 0,216, 7, 0, 0,217, 7, 0, 0,218, 7,
- 0, 0,219, 7, 0, 0,220, 7, 0, 0,221, 7, 0, 0,222, 7, 0, 0,223, 7, 0, 0,224, 7, 0, 0,225, 7, 0, 0,226, 7,
- 0, 0,227, 7, 0, 0,228, 7, 0, 0,229, 7, 0, 0,230, 7, 0, 0,231, 7, 0, 0,232, 7, 0, 0,233, 7, 0, 0,234, 7,
- 0, 0,235, 7, 0, 0,236, 7, 0, 0,237, 7, 0, 0,238, 7, 0, 0,239, 7, 0, 0,240, 7, 0, 0,241, 7, 0, 0,242, 7,
- 0, 0,243, 7, 0, 0,244, 7, 0, 0,245, 7, 0, 0,246, 7, 0, 0,247, 7, 0, 0,248, 7, 0, 0,249, 7, 0, 0,250, 7,
- 23, 1, 5, 0, 0, 0,251, 7, 0, 0,158, 7, 0, 0,161, 7, 2, 0, 18, 0, 2, 0, 27, 0, 24, 1, 24, 0, 24, 1, 0, 0,
- 24, 1, 1, 0, 0, 0,171, 5, 21, 1,252, 7, 22, 1,253, 7, 22, 1,254, 7, 22, 1,255, 7, 22, 1, 0, 8, 22, 1, 1, 8,
- 22, 1, 2, 8, 22, 1, 3, 8, 22, 1, 4, 8, 22, 1, 5, 8, 22, 1, 6, 8, 22, 1, 7, 8, 22, 1, 8, 8, 22, 1, 9, 8,
- 22, 1, 10, 8, 22, 1, 11, 8, 22, 1, 12, 8, 22, 1, 13, 8, 23, 1, 14, 8, 4, 0, 15, 8, 4, 0, 27, 0, 25, 1, 3, 0,
- 25, 1, 0, 0, 25, 1, 1, 0, 0, 0, 16, 8, 26, 1, 5, 0, 4, 0, 18, 0, 4, 0, 27, 0, 7, 0,151, 2, 7, 0, 17, 8,
- 7, 0, 46, 2, 27, 1, 93, 0, 4, 0, 18, 0, 4, 0, 18, 8, 4, 0, 19, 8, 0, 0, 20, 8, 0, 0, 21, 8, 0, 0, 22, 8,
- 0, 0, 23, 8, 0, 0, 24, 8, 0, 0, 25, 8, 0, 0, 26, 8, 0, 0, 27, 8, 0, 0, 28, 8, 0, 0, 29, 8, 4, 0, 30, 8,
- 2, 0, 31, 8, 2, 0, 32, 8, 2, 0, 33, 8, 2, 0, 34, 8, 4, 0, 35, 8, 4, 0, 36, 8, 4, 0, 37, 8, 4, 0, 38, 8,
- 2, 0, 39, 8, 2, 0, 40, 8, 4, 0, 41, 8, 4, 0, 42, 8, 4, 0, 43, 8, 4, 0, 44, 8, 4, 0, 45, 8, 4, 0, 54, 7,
- 4, 0, 46, 8, 2, 0, 47, 8, 2, 0, 48, 8, 2, 0, 49, 8, 2, 0, 50, 8, 14, 0, 51, 8, 14, 0, 52, 8, 14, 0, 53, 8,
- 14, 0, 54, 8, 14, 0, 55, 8, 14, 0, 56, 8, 0, 0, 57, 8, 2, 0, 58, 8, 2, 0, 59, 8, 2, 0, 60, 8, 2, 0, 61, 8,
- 2, 0, 62, 8, 2, 0, 63, 8, 2, 0, 64, 8, 2, 0, 65, 8, 26, 1, 66, 8, 2, 0, 67, 8, 2, 0, 68, 8, 2, 0, 69, 8,
- 2, 0, 70, 8, 2, 0, 71, 8, 2, 0, 72, 8, 2, 0, 73, 8, 2, 0, 74, 8, 4, 0, 75, 8, 4, 0, 76, 8, 2, 0, 77, 8,
- 2, 0, 78, 8, 2, 0, 79, 8, 2, 0, 80, 8, 2, 0, 81, 8, 2, 0, 82, 8, 2, 0, 83, 8, 2, 0, 84, 8, 2, 0, 85, 8,
- 2, 0, 86, 8, 2, 0, 87, 8, 2, 0, 88, 8, 2, 0, 89, 8, 2, 0, 90, 8, 2, 0, 91, 8, 2, 0, 92, 8, 2, 0, 93, 8,
- 2, 0, 94, 8, 7, 0, 95, 8, 4, 0, 96, 8, 7, 0, 97, 8, 2, 0, 17, 6, 2, 0, 18, 6, 2, 0, 98, 8, 2, 0, 99, 8,
- 50, 0,100, 8, 7, 0,101, 8, 2, 0,102, 8, 2, 0, 74, 0, 0, 0,103, 8, 4, 0,104, 8, 4, 0,105, 8, 28, 1, 24, 0,
- 22, 0, 32, 0, 14, 0,106, 8, 14, 0,107, 8, 14, 0,108, 8, 14, 0,146, 6, 41, 0,125, 0, 41, 0,109, 8, 4, 0,110, 8,
- 4, 0, 91, 0, 2, 0,111, 8, 2, 0,112, 8, 2, 0,113, 8, 2, 0,114, 8, 2, 0,115, 8, 2, 0,116, 8, 2, 0,117, 8,
- 2, 0,118, 8, 2, 0,119, 8, 2, 0,120, 8, 2, 0,121, 8, 2, 0, 27, 0,238, 0,122, 8, 11, 0,123, 8, 2, 0,124, 8,
- 29, 1, 5, 0, 29, 1, 0, 0, 29, 1, 1, 0, 29, 1,125, 8, 15, 0,126, 8, 4, 0, 18, 0, 30, 1, 7, 0, 30, 1, 0, 0,
- 30, 1, 1, 0, 29, 1,127, 8, 29, 1,128, 8, 2, 0,120, 5, 2, 0, 18, 0, 4, 0, 27, 0, 31, 1, 25, 0, 31, 1, 0, 0,
- 31, 1, 1, 0, 32, 1,129, 8, 33, 1,239, 6, 0, 0,130, 8, 0, 0,131, 8, 0, 0,132, 8, 2, 0,133, 8, 2, 0,134, 8,
- 2, 0,135, 8, 2, 0,136, 8, 2, 0,137, 8, 2, 0, 27, 0, 2, 0, 18, 0, 2, 0, 69, 7, 2, 0,138, 8, 2, 0,139, 8,
- 4, 0,140, 8, 31, 1,141, 8, 11, 0,142, 8, 4, 0,143, 8, 4, 0,144, 8, 4, 0,145, 8, 4, 0,146, 8, 0, 0,147, 8,
- 34, 1, 22, 0, 34, 1, 0, 0, 34, 1, 1, 0, 29, 1,127, 8, 29, 1,128, 8, 29, 1,148, 8, 29, 1,149, 8, 28, 1,150, 8,
- 18, 0, 51, 0, 0, 0,147, 6, 0, 0,151, 8, 2, 0,192, 6, 2, 0,193, 6, 2, 0,152, 8, 2, 0, 27, 0, 2, 0,115, 8,
- 2, 0, 53, 7, 2, 0, 18, 0, 35, 1,129, 8, 14, 0,153, 8, 14, 0,146, 6, 14, 0,154, 8, 14, 0,155, 8, 36, 1, 24, 0,
- 36, 1, 0, 0, 36, 1, 1, 0,241, 0,200, 6, 18, 0,156, 8, 18, 0,157, 8, 2, 0,192, 6, 2, 0,193, 6, 2, 0,158, 8,
- 2, 0,159, 8, 2, 0,160, 8, 2, 0, 18, 0, 7, 0, 92, 2, 2, 0,135, 8, 2, 0,136, 8, 2, 0,114, 8, 2, 0,161, 8,
- 2, 0,119, 8, 2, 0, 86, 1, 37, 1,129, 8, 14, 0,162, 8, 14, 0,163, 8, 14, 0,154, 8, 0, 0,164, 8, 11, 0,165, 8,
- 38, 1, 14, 0, 0, 0,166, 8, 2, 0,167, 8, 2, 0,168, 8, 2, 0,169, 8, 2, 0,170, 8, 2, 0,109, 5, 2, 0,171, 8,
- 28, 1,172, 8, 41, 0,173, 8, 4, 0,174, 8, 4, 0,175, 8, 4, 0,176, 8, 4, 0, 27, 0, 0, 0, 70, 7, 39, 1, 3, 0,
- 0, 0,177, 8, 4, 0,178, 8, 4, 0,179, 8, 40, 1, 4, 0, 4, 0, 7, 7, 4, 0,180, 8, 4, 0, 13, 7, 4, 0,181, 8,
- 41, 1, 2, 0, 4, 0,182, 8, 4, 0,183, 8, 42, 1, 5, 0, 7, 0,184, 8, 7, 0,185, 8, 7, 0,186, 8, 4, 0, 18, 0,
- 4, 0, 27, 0, 43, 1, 7, 0, 0, 0,187, 8, 0, 0,221, 6, 44, 0,138, 0, 2, 0,188, 8, 2, 0, 71, 5, 2, 0,189, 8,
- 2, 0,190, 8, 44, 1, 14, 0, 44, 1, 0, 0, 44, 1, 1, 0, 4, 0, 56, 0, 4, 0, 22, 0, 4, 0, 28, 0, 4, 0,191, 8,
- 4, 0,192, 8, 4, 0,193, 8, 39, 1,194, 8, 0, 0,187, 8, 43, 1,175, 3, 40, 1,195, 8, 41, 1,196, 8, 42, 1,197, 8,
- 45, 1, 12, 0, 0, 0, 35, 0, 11, 0,227, 0, 0, 0,228, 0, 4, 0,231, 0, 4, 0,239, 0, 11, 0,232, 0, 7, 0,234, 0,
- 7, 0,235, 0, 11, 0,198, 8, 11, 0,199, 8, 11, 0,236, 0, 11, 0,238, 0, 46, 1, 48, 0, 46, 1, 0, 0, 46, 1, 1, 0,
- 11, 0,200, 8, 11, 0, 25, 0, 0, 0, 19, 0, 4, 0, 18, 0, 4, 0, 16, 0, 4, 0, 22, 0, 4, 0, 89, 0, 4, 0,201, 8,
- 4, 0,202, 8, 4, 0,192, 8, 4, 0,193, 8, 4, 0,203, 8, 4, 0,250, 0, 4, 0,204, 8, 4, 0,205, 8, 7, 0,206, 8,
- 7, 0,207, 8, 7, 0,208, 8, 4, 0,129, 0, 4, 0,209, 8, 4, 0,210, 8, 44, 1,211, 8, 31, 0, 80, 0, 41, 0,125, 0,
- 27, 0,212, 8, 44, 0,138, 0, 7, 0,213, 8, 7, 0,214, 8, 45, 1, 71, 1, 46, 1,215, 8, 46, 1,216, 8, 46, 1,217, 8,
- 14, 0,218, 8, 47, 1,219, 8, 11, 0,220, 8, 7, 0, 83, 4, 7, 0,221, 8, 7, 0,222, 8, 4, 0,223, 8, 4, 0,224, 8,
- 7, 0,225, 8, 11, 0,226, 8, 4, 0,227, 8, 4, 0,228, 8, 4, 0,229, 8, 7, 0,230, 8, 48, 1, 4, 0, 48, 1, 0, 0,
- 48, 1, 1, 0, 14, 0,231, 8, 46, 1,232, 8,227, 0, 11, 0, 14, 0,233, 8, 14, 0,218, 8, 14, 0,234, 8, 46, 1,235, 8,
- 0, 0,236, 8, 0, 0,237, 8, 4, 0,238, 8, 4, 0,239, 8, 4, 0,240, 8, 4, 0, 27, 0, 19, 0,241, 8, 49, 1, 4, 0,
- 7, 0,242, 8, 7, 0, 92, 3, 2, 0,243, 8, 2, 0,244, 8, 50, 1, 6, 0, 7, 0,245, 8, 7, 0,246, 8, 7, 0,247, 8,
- 7, 0,248, 8, 4, 0,249, 8, 4, 0,250, 8, 51, 1, 8, 0, 7, 0,251, 8, 7, 0,252, 8, 7, 0,253, 8, 7, 0,254, 8,
- 7, 0,255, 8, 4, 0,248, 2, 4, 0, 0, 9, 4, 0, 1, 9, 52, 1, 2, 0, 7, 0,179, 5, 7, 0, 27, 0, 53, 1, 5, 0,
- 7, 0, 2, 9, 7, 0, 3, 9, 4, 0, 92, 0, 4, 0,209, 2, 4, 0, 4, 9, 54, 1, 6, 0, 54, 1, 0, 0, 54, 1, 1, 0,
- 2, 0, 16, 0, 2, 0, 18, 0, 2, 0, 5, 9, 2, 0, 56, 0, 55, 1, 8, 0, 55, 1, 0, 0, 55, 1, 1, 0, 2, 0, 16, 0,
- 2, 0, 18, 0, 2, 0, 5, 9, 2, 0, 56, 0, 7, 0, 22, 0, 7, 0,129, 0, 56, 1, 45, 0, 56, 1, 0, 0, 56, 1, 1, 0,
- 2, 0, 16, 0, 2, 0, 18, 0, 2, 0, 5, 9, 2, 0,246, 0, 2, 0,125, 4, 2, 0, 6, 9, 7, 0, 7, 9, 7, 0, 90, 0,
- 7, 0, 5, 3, 4, 0, 8, 9, 4, 0, 82, 0, 4, 0,211, 2, 7, 0, 9, 9, 7, 0, 10, 9, 7, 0, 11, 9, 7, 0, 12, 9,
- 7, 0, 13, 9, 7, 0, 14, 9, 7, 0, 2, 3, 7, 0, 68, 1, 7, 0, 15, 9, 7, 0, 16, 9, 7, 0, 27, 0, 7, 0, 17, 9,
- 7, 0, 18, 9, 7, 0, 19, 9, 2, 0, 20, 9, 2, 0, 21, 9, 2, 0, 22, 9, 2, 0, 23, 9, 2, 0, 24, 9, 2, 0, 25, 9,
- 2, 0, 26, 9, 2, 0, 27, 9, 2, 0, 31, 2, 2, 0, 28, 9, 2, 0, 28, 2, 2, 0, 29, 9, 0, 0, 30, 9, 0, 0, 31, 9,
- 7, 0,244, 0, 57, 1, 32, 9, 64, 0,249, 1, 58, 1, 16, 0, 58, 1, 0, 0, 58, 1, 1, 0, 2, 0, 16, 0, 2, 0, 18, 0,
- 2, 0, 5, 9, 2, 0,246, 0, 7, 0,253, 2, 7, 0,254, 2, 7, 0,255, 2, 7, 0, 81, 2, 7, 0, 0, 3, 7, 0, 1, 3,
- 7, 0, 33, 9, 7, 0, 2, 3, 7, 0, 4, 3, 7, 0, 5, 3,254, 0, 5, 0, 2, 0, 16, 0, 2, 0, 34, 9, 2, 0, 18, 0,
- 2, 0, 35, 9, 22, 0, 42, 7,253, 0, 3, 0, 4, 0, 68, 0, 4, 0, 36, 9,254, 0, 2, 0, 59, 1, 7, 0, 59, 1, 0, 0,
- 59, 1, 1, 0, 0, 0, 19, 0, 2, 0, 16, 0, 2, 0, 18, 0, 4, 0, 21, 0, 11, 0, 37, 9, 60, 1, 5, 0, 0, 0, 19, 0,
- 7, 0, 94, 1, 7, 0, 38, 9, 4, 0, 39, 9, 4, 0, 27, 0, 61, 1, 4, 0, 2, 0, 16, 0, 2, 0, 18, 0, 2, 0, 91, 0,
- 2, 0, 30, 0, 62, 1, 4, 0, 0, 0, 19, 0, 63, 0, 40, 9, 7, 0, 94, 1, 7, 0, 27, 0, 63, 1, 6, 0, 2, 0, 41, 9,
- 2, 0, 42, 9, 2, 0, 16, 0, 2, 0, 43, 9, 0, 0, 44, 9, 0, 0, 45, 9, 64, 1, 5, 0, 4, 0, 16, 0, 4, 0, 27, 0,
- 0, 0, 19, 0, 0, 0, 46, 9, 0, 0, 47, 9, 65, 1, 3, 0, 4, 0, 16, 0, 4, 0, 27, 0, 0, 0, 19, 0, 66, 1, 4, 0,
- 2, 0, 48, 9, 2, 0, 49, 9, 2, 0, 18, 0, 2, 0, 27, 0, 67, 1, 6, 0, 0, 0, 19, 0, 0, 0, 50, 9, 2, 0, 51, 9,
- 2, 0, 2, 3, 2, 0, 87, 1, 2, 0, 30, 0, 68, 1, 5, 0, 0, 0, 19, 0, 7, 0, 92, 3, 7, 0,216, 4, 2, 0, 18, 0,
- 2, 0,223, 2, 69, 1, 3, 0, 0, 0, 19, 0, 4, 0,211, 2, 4, 0, 48, 9, 70, 1, 7, 0, 0, 0, 19, 0, 7, 0,216, 4,
- 0, 0, 52, 9, 0, 0, 53, 9, 2, 0, 87, 1, 2, 0, 91, 0, 4, 0, 54, 9, 71, 1, 4, 0, 0, 0, 55, 9, 0, 0, 56, 9,
- 4, 0, 16, 0, 7, 0,227, 2, 72, 1, 3, 0, 27, 0, 57, 9, 0, 0, 58, 9, 0, 0, 59, 9, 73, 1, 18, 0, 73, 1, 0, 0,
- 73, 1, 1, 0, 2, 0, 16, 0, 2, 0, 60, 9, 2, 0, 18, 0, 2, 0, 61, 9, 2, 0, 62, 9, 2, 0, 63, 9, 2, 0, 91, 0,
- 2, 0, 30, 0, 0, 0, 19, 0, 11, 0, 2, 0, 74, 1, 64, 9, 27, 0, 44, 0, 2, 0,215, 5, 2, 0, 65, 9, 2, 0, 66, 9,
- 2, 0, 27, 0, 75, 1, 11, 0, 0, 0, 19, 0, 0, 0, 16, 0, 0, 0, 67, 9, 2, 0, 18, 0, 2, 0,223, 2, 2, 0, 68, 9,
- 4, 0, 69, 9, 4, 0, 70, 9, 4, 0, 71, 9, 4, 0, 72, 9, 4, 0, 73, 9, 76, 1, 1, 0, 0, 0, 74, 9, 77, 1, 4, 0,
- 37, 0, 6, 7, 0, 0, 16, 8, 4, 0, 87, 1, 4, 0, 18, 0, 74, 1, 18, 0, 74, 1, 0, 0, 74, 1, 1, 0, 74, 1, 75, 9,
- 2, 0, 16, 0, 2, 0, 18, 0, 2, 0, 76, 9, 2, 0, 63, 9, 2, 0, 60, 9, 2, 0, 77, 9, 2, 0, 30, 0, 2, 0, 74, 0,
- 0, 0, 19, 0, 11, 0, 2, 0, 78, 1, 64, 9, 73, 1, 78, 9, 2, 0, 14, 0, 2, 0, 79, 9, 4, 0, 80, 9, 79, 1, 3, 0,
- 4, 0,237, 2, 4, 0, 27, 0, 27, 0, 44, 0, 80, 1, 15, 0,177, 0, 81, 9, 2, 0, 16, 0, 2, 0, 18, 0, 7, 0, 7, 9,
- 7, 0, 90, 0, 0, 0, 19, 0, 0, 0, 82, 9, 2, 0, 83, 9, 2, 0, 84, 9, 2, 0,134, 0, 2, 0, 85, 9, 2, 0, 86, 9,
- 2, 0, 27, 0, 7, 0, 87, 9, 7, 0, 88, 9, 81, 1, 8, 0, 7, 0, 89, 9, 7, 0, 90, 9, 7, 0, 91, 9, 7, 0, 92, 9,
- 7, 0, 93, 9, 7, 0, 94, 9, 7, 0, 95, 9, 7, 0, 96, 9, 82, 1, 13, 0, 2, 0, 18, 0, 2, 0, 97, 9, 4, 0, 91, 0,
- 4, 0, 30, 0, 2, 0,177, 6, 7, 0, 83, 4, 7, 0,221, 8, 47, 1,219, 8, 81, 1, 98, 9, 2, 0, 16, 0, 2, 0,114, 5,
- 2, 0,215, 3, 2, 0, 99, 9, 83, 1, 11, 0, 4, 0,237, 2, 2, 0, 16, 0, 2, 0, 18, 0, 27, 0, 44, 0, 79, 0,100, 9,
- 0, 0, 19, 0, 7, 0,101, 9, 7, 0,102, 9, 7, 0,221, 3, 2, 0,103, 9, 2, 0,104, 9, 84, 1, 5, 0, 2, 0, 16, 0,
- 2, 0, 91, 0, 4, 0, 27, 0, 41, 0,125, 0, 27, 0,207, 5, 85, 1, 5, 0, 4, 0, 27, 0, 4, 0, 16, 0, 0, 0, 19, 0,
- 0, 0, 46, 9, 27, 0, 44, 0, 86, 1, 13, 0, 2, 0, 18, 0, 2, 0, 16, 0, 2, 0, 60, 9, 2, 0,222, 3, 7, 0,105, 9,
- 7, 0,106, 9, 7, 0, 86, 1, 7, 0,107, 9, 7, 0,191, 3, 7, 0,195, 3, 7, 0,108, 9, 7, 0,109, 9, 27, 0,110, 9,
- 87, 1, 10, 0, 2, 0, 18, 0, 2, 0, 16, 0, 7, 0, 7, 9, 7, 0, 90, 0, 0, 0, 19, 0, 0, 0, 82, 9, 2, 0, 91, 0,
- 2, 0, 30, 0, 2, 0, 74, 0, 2, 0,114, 5, 88, 1, 8, 0, 27, 0, 44, 0, 7, 0,255, 2, 7, 0,111, 9, 7, 0,112, 9,
- 7, 0,222, 3, 2, 0, 91, 0, 2, 0,223, 2, 7, 0, 30, 0, 89, 1, 12, 0, 2, 0, 16, 0, 2, 0, 87, 1, 2, 0, 18, 0,
- 2, 0, 2, 3, 2, 0,237, 2, 2, 0,113, 9, 4, 0, 27, 0, 7, 0,114, 9, 7, 0,115, 9, 7, 0,116, 9, 7, 0,117, 9,
- 0, 0,118, 9, 90, 1, 9, 0, 2, 0, 18, 0, 2, 0, 16, 0, 4, 0, 7, 9, 4, 0, 90, 0, 0, 0, 19, 0, 2, 0, 86, 1,
- 2, 0, 63, 0, 2, 0,119, 9, 2, 0,120, 9, 91, 1, 7, 0, 4, 0,211, 2, 4, 0,121, 9, 4, 0,122, 9, 4, 0,123, 9,
- 7, 0,124, 9, 7, 0,125, 9, 0, 0, 52, 9, 92, 1, 7, 0, 0, 0,126, 9, 27, 0,127, 9, 0, 0, 58, 9, 2, 0,128, 9,
- 2, 0, 91, 0, 4, 0, 30, 0, 0, 0, 59, 9, 93, 1, 6, 0, 2, 0, 18, 0, 2, 0, 16, 0, 4, 0, 7, 9, 4, 0, 90, 0,
- 0, 0,129, 9, 0, 0,130, 9, 94, 1, 1, 0, 4, 0, 18, 0, 95, 1, 6, 0, 0, 0, 94, 0, 2, 0, 16, 0, 2, 0, 18, 0,
- 4, 0,131, 9, 7, 0,132, 9, 37, 0, 6, 7, 96, 1, 4, 0, 0, 0,179, 2, 2, 0, 18, 0, 4, 0, 16, 0, 27, 0, 44, 0,
- 97, 1, 2, 0, 4, 0, 16, 0, 4, 0,181, 6, 98, 1, 6, 0, 0, 0, 55, 9, 0, 0, 56, 9, 4, 0, 16, 0, 7, 0, 39, 2,
- 27, 0, 68, 3, 27, 0,133, 9, 99, 1, 11, 0, 0, 0, 53, 6, 0, 0, 18, 0, 2, 0,134, 9, 4, 0, 16, 0, 7, 0, 94, 1,
- 7, 0,135, 9, 7, 0,136, 9, 7, 0,137, 9, 4, 0,138, 9, 27, 0, 68, 3, 27, 0,139, 9, 78, 1, 10, 0, 78, 1, 0, 0,
- 78, 1, 1, 0, 78, 1, 75, 9, 2, 0, 16, 0, 2, 0, 18, 0, 2, 0, 60, 9, 2, 0,140, 9, 0, 0, 19, 0, 11, 0, 2, 0,
- 27, 0, 44, 0, 47, 1, 17, 0, 22, 0, 32, 0, 0, 0, 35, 0, 38, 0,153, 0, 11, 0,227, 0, 38, 0,141, 9, 31, 0, 80, 0,
- 7, 0, 83, 4, 7, 0,142, 9, 7, 0,221, 8, 7, 0, 89, 9, 7, 0, 90, 9, 7, 0,143, 9, 4, 0, 92, 0, 4, 0, 27, 0,
- 11, 0,144, 9, 11, 0,145, 9, 11, 0,146, 9,100, 1, 6, 0,100, 1, 0, 0,100, 1, 1, 0, 27, 0, 44, 0, 11, 0,147, 9,
- 2, 0,251, 0, 0, 0,208, 2, 64, 0, 4, 0, 22, 0, 32, 0, 14, 0,148, 9, 4, 0,134, 0, 7, 0,149, 9,101, 1, 28, 0,
-101, 1, 0, 0,101, 1, 1, 0, 21, 0,150, 9,101, 1, 38, 0, 14, 0,151, 9, 0, 0, 19, 0, 7, 0,152, 9, 7, 0,153, 9,
- 7, 0,154, 9, 7, 0,155, 9, 4, 0, 18, 0, 7, 0,156, 9, 7, 0,157, 9, 7, 0,158, 9, 7, 0,159, 9, 7, 0, 94, 1,
- 7, 0, 39, 2, 7, 0,160, 9, 7, 0,209, 2, 7, 0,161, 9, 7, 0,162, 9, 7, 0,163, 9, 7, 0,164, 9, 7, 0,165, 9,
- 7, 0,176, 0, 4, 0,134, 0, 2, 0,253, 5, 2, 0,166, 9,102, 1, 27, 0, 22, 0, 32, 0, 34, 0, 75, 0, 14, 0,167, 9,
- 14, 0,168, 9, 14, 0,169, 9,101, 1,170, 9, 11, 0,171, 9, 11, 0,172, 9, 4, 0, 18, 0, 4, 0,157, 6, 4, 0,173, 9,
- 4, 0, 27, 0, 2, 0, 6, 3, 2, 0,211, 6, 4, 0,174, 9, 4, 0,134, 0, 4, 0,175, 9, 2, 0,176, 9, 2, 0,177, 9,
- 2, 0,178, 9, 2, 0,179, 9, 4, 0,180, 9, 4, 0,181, 9, 4, 0,182, 9, 4, 0,183, 9, 4, 0,184, 9, 4, 0,185, 9,
-103, 1, 2, 0, 7, 0,165, 2, 4, 0, 18, 0,181, 0, 5, 0,103, 1,186, 9, 4, 0,209, 2, 4, 0,187, 9, 4, 0,188, 9,
- 4, 0, 18, 0,180, 0, 16, 0, 4, 0,189, 9, 4, 0,190, 9, 4, 0,191, 9, 4, 0,192, 9, 2, 0,193, 9, 2, 0,194, 9,
- 2, 0,195, 9, 2, 0,251, 0, 2, 0,196, 9, 2, 0,197, 9, 2, 0,198, 9, 2, 0,199, 9, 4, 0,200, 9, 4, 0,201, 9,
- 4, 0,202, 9, 4, 0,203, 9,104, 1, 40, 0,104, 1, 0, 0,104, 1, 1, 0, 21, 0,150, 9, 14, 0,250, 3, 0, 0, 19, 0,
- 2, 0, 18, 0, 2, 0,204, 9, 2, 0,208, 3, 2, 0,205, 9, 0, 0,206, 9, 0, 0,207, 9, 0, 0,208, 9,101, 1,209, 9,
-104, 1, 38, 0,104, 1,210, 9, 14, 0,211, 9, 14, 0,212, 9,181, 0,183, 3, 27, 0,213, 9,104, 1,214, 9, 7, 0, 77, 1,
- 7, 0,176, 0, 7, 0,215, 9, 7, 0, 18, 2, 7, 0,197, 3, 7, 0,199, 3, 2, 0,231, 3, 2, 0, 27, 0, 7, 0,216, 9,
- 7, 0,217, 9, 7, 0,202, 3, 7, 0,218, 9, 7, 0,219, 9, 7, 0,220, 9, 7, 0,221, 9, 7, 0,222, 9, 7, 0,223, 9,
- 7, 0,224, 9, 7, 0,225, 9, 11, 0,226, 9,178, 0, 16, 0, 14, 0,227, 9, 74, 0,228, 9, 2, 0, 18, 0, 2, 0, 27, 0,
- 4, 0,229, 9, 4, 0, 91, 0, 7, 0,108, 2, 7, 0,230, 9, 7, 0,231, 9, 14, 0,232, 9, 4, 0,233, 9, 4, 0,234, 9,
- 11, 0,235, 9, 11, 0,236, 9,180, 0,182, 3, 0, 0,237, 9,105, 1, 1, 0, 4, 0,234, 9,106, 1, 12, 0, 4, 0,234, 9,
- 7, 0, 73, 9, 2, 0,238, 9, 2, 0,239, 9, 7, 0,240, 9, 7, 0,241, 9, 2, 0,242, 9, 2, 0, 18, 0, 7, 0,243, 9,
- 7, 0,244, 9, 7, 0,245, 9, 7, 0,246, 9,107, 1, 7, 0,107, 1, 0, 0,107, 1, 1, 0, 14, 0,247, 9, 4, 0, 18, 0,
- 4, 0,248, 9, 0, 0, 19, 0, 23, 1,249, 9,177, 0, 9, 0, 22, 0, 32, 0, 14, 0,250, 9, 14, 0,227, 9, 14, 0,251, 9,
- 14, 0,102, 0, 4, 0, 18, 0, 4, 0,252, 9, 4, 0,253, 9, 4, 0, 27, 0,244, 0, 8, 0, 22, 0,254, 9, 14, 0,227, 9,
- 64, 0,255, 9, 0, 0, 0, 10, 4, 0, 1, 10, 4, 0, 18, 0, 4, 0, 2, 10, 4, 0, 27, 0,108, 1, 13, 0,240, 0, 0, 0,
-240, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6,241, 0,200, 6,177, 0,178, 3,244, 0, 3, 10,
- 0, 0, 87, 1, 0, 0,203, 6, 2, 0, 18, 0, 7, 0, 4, 10,109, 1, 8, 0,109, 1, 0, 0,109, 1, 1, 0,107, 1, 5, 10,
- 31, 0, 80, 0, 14, 0,184, 3, 4, 0, 18, 0, 0, 0, 19, 0, 4, 0,112, 8,110, 1, 5, 0,110, 1, 0, 0,110, 1, 1, 0,
- 31, 0, 80, 0, 2, 0, 18, 0, 0, 0, 6, 10,111, 1, 14, 0,111, 1, 0, 0,111, 1, 1, 0, 11, 0, 2, 0, 2, 0, 16, 0,
- 2, 0, 18, 0, 0, 0, 7, 10, 0, 0, 8, 10, 0, 0, 19, 0, 2, 0, 27, 0, 7, 0, 9, 10, 7, 0, 10, 10, 31, 0, 80, 0,
- 7, 0, 11, 10, 7, 0, 12, 10,112, 1, 9, 0,112, 1, 0, 0,112, 1, 1, 0, 27, 0, 13, 10, 0, 0, 9, 3, 7, 0, 14, 10,
- 2, 0, 15, 10, 2, 0, 18, 0, 2, 0, 16, 0, 2, 0, 16, 10,113, 1, 7, 0, 37, 0, 6, 7, 21, 0,150, 9, 4, 0, 18, 0,
- 4, 0, 17, 10, 14, 0, 18, 10, 27, 0, 13, 10, 0, 0, 9, 3,114, 1, 15, 0, 27, 0, 13, 10, 2, 0, 19, 10, 2, 0, 18, 0,
- 2, 0, 20, 10, 2, 0, 21, 10, 0, 0, 9, 3, 27, 0, 22, 10, 0, 0, 23, 10, 7, 0, 24, 10, 7, 0, 39, 2, 7, 0, 25, 10,
- 7, 0, 26, 10, 2, 0, 16, 0, 2, 0, 87, 1, 7, 0, 94, 1,115, 1, 6, 0, 27, 0, 13, 10, 7, 0,186, 9, 2, 0, 27, 10,
- 2, 0, 28, 10, 2, 0, 18, 0, 2, 0, 29, 10,116, 1, 6, 0, 27, 0, 13, 10, 4, 0, 30, 10, 4, 0, 31, 10, 4, 0, 92, 0,
- 4, 0, 27, 0, 0, 0, 9, 3,117, 1, 4, 0, 27, 0, 13, 10, 4, 0, 18, 0, 4, 0, 30, 10, 0, 0, 9, 3,118, 1, 4, 0,
- 27, 0, 13, 10, 4, 0, 18, 0, 4, 0, 30, 10, 0, 0, 9, 3,119, 1, 4, 0, 27, 0, 13, 10, 4, 0, 18, 0, 4, 0, 30, 10,
- 0, 0, 9, 3,120, 1, 2, 0, 4, 0, 18, 0, 7, 0, 83, 4,121, 1, 2, 0, 27, 0, 13, 10, 0, 0, 9, 3,122, 1, 10, 0,
- 27, 0, 13, 10, 4, 0, 32, 10, 7, 0,128, 0, 4, 0, 18, 0, 2, 0, 4, 7, 2, 0, 33, 10, 2, 0, 91, 0, 2, 0, 30, 0,
- 7, 0, 34, 10, 0, 0, 9, 3,123, 1, 10, 0, 27, 0, 13, 10, 2, 0, 16, 0, 2, 0,133, 4, 4, 0, 89, 0, 4, 0, 90, 0,
- 7, 0,111, 9, 7, 0,112, 9, 4, 0, 27, 0,177, 0, 81, 9, 0, 0, 9, 3,124, 1, 4, 0, 27, 0, 13, 10, 4, 0,209, 3,
- 4, 0, 35, 10, 0, 0, 9, 3,125, 1, 4, 0, 27, 0, 13, 10, 4, 0,209, 3, 4, 0, 27, 0, 0, 0, 9, 3,126, 1, 6, 0,
- 27, 0, 13, 10, 7, 0,128, 0, 7, 0, 80, 3, 4, 0, 36, 10, 2, 0,209, 3, 2, 0,210, 3,127, 1, 6, 0, 27, 0, 13, 10,
- 4, 0, 37, 10, 4, 0, 38, 10, 7, 0, 39, 10, 7, 0, 40, 10, 0, 0, 9, 3,128, 1, 16, 0, 27, 0, 13, 10, 27, 0,210, 9,
- 4, 0, 16, 0, 7, 0, 41, 10, 7, 0, 42, 10, 7, 0, 43, 10, 7, 0, 44, 10, 7, 0, 45, 10, 7, 0, 46, 10, 7, 0, 47, 10,
- 7, 0, 48, 10, 7, 0, 49, 10, 2, 0, 18, 0, 2, 0, 27, 0, 2, 0, 91, 0, 2, 0, 30, 0,129, 1, 3, 0, 27, 0, 13, 10,
- 4, 0, 18, 0, 4, 0, 31, 2,130, 1, 5, 0, 27, 0, 13, 10, 4, 0, 18, 0, 4, 0, 27, 0, 7, 0, 50, 10, 0, 0, 9, 3,
-131, 1, 10, 0, 27, 0, 13, 10, 0, 0, 9, 3, 2, 0, 51, 10, 2, 0, 52, 10, 0, 0, 53, 10, 0, 0, 54, 10, 7, 0, 55, 10,
- 7, 0, 56, 10, 7, 0, 57, 10, 7, 0, 58, 10,132, 1, 5, 0, 27, 0, 13, 10, 0, 0, 9, 3, 7, 0,217, 2, 2, 0, 59, 10,
- 2, 0, 18, 0,133, 1, 8, 0, 7, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 60, 10, 7, 0, 61, 10,
- 2, 0, 18, 0, 2, 0, 31, 2,134, 1, 8, 0, 7, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 60, 10,
- 7, 0, 61, 10, 2, 0, 18, 0, 2, 0, 31, 2,135, 1, 8, 0, 7, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0,
- 7, 0, 60, 10, 7, 0, 61, 10, 2, 0, 18, 0, 2, 0, 31, 2,136, 1, 7, 0, 27, 0, 13, 10, 0, 0, 9, 3, 7, 0, 94, 1,
- 7, 0,103, 1, 2, 0, 18, 0, 2, 0, 87, 1, 4, 0, 27, 0,137, 1, 5, 0, 27, 0, 68, 3, 7, 0, 94, 1, 2, 0, 72, 3,
- 0, 0, 74, 3, 0, 0, 62, 10,138, 1, 7, 0,230, 0,105, 6, 0, 0, 63, 10, 4, 0, 18, 0, 4, 0, 27, 0, 0, 0, 64, 10,
- 27, 0,207, 5, 27, 0, 65, 10,139, 1, 3, 0,230, 0,105, 6, 4, 0, 18, 0, 4, 0, 27, 0,140, 1, 6, 0,230, 0,105, 6,
- 4, 0, 18, 0, 4, 0, 27, 0, 0, 0, 64, 10, 7, 0, 50, 10, 27, 0,207, 5,141, 1, 10, 0,141, 1, 0, 0,141, 1, 1, 0,
- 2, 0, 16, 0, 2, 0, 18, 0, 0, 0, 66, 10, 7, 0, 31, 1, 7, 0, 32, 1, 2, 0,247, 9, 2, 0, 67, 10, 27, 0, 44, 0,
-142, 1, 22, 0,142, 1, 0, 0,142, 1, 1, 0, 2, 0, 18, 0, 2, 0, 87, 1, 2, 0, 68, 10, 2, 0, 69, 10, 31, 0, 80, 0,
-177, 0, 81, 9, 27, 0,168, 0, 7, 0, 89, 0, 7, 0, 90, 0, 7, 0, 70, 10, 7, 0, 71, 10, 7, 0, 72, 10, 7, 0, 73, 10,
- 7, 0,251, 2, 7, 0,147, 3, 7, 0, 83, 9, 7, 0, 74, 10, 0, 0, 75, 10, 0, 0, 76, 10, 14, 0,187, 3,143, 1, 11, 0,
- 7, 0, 46, 2, 7, 0,111, 9, 7, 0,112, 9, 11, 0, 2, 0, 2, 0, 77, 10, 2, 0, 78, 10, 2, 0, 79, 10, 2, 0, 80, 10,
- 2, 0, 81, 10, 2, 0, 82, 10, 2, 0,179, 2,144, 1, 21, 0,144, 1, 0, 0,144, 1, 1, 0,144, 1, 83, 10, 0, 0, 19, 0,
- 11, 0, 84, 10, 2, 0, 16, 0, 2, 0, 18, 0, 2, 0, 85, 10, 2, 0, 86, 10, 7, 0, 87, 10, 7, 0, 88, 10, 11, 0, 89, 10,
- 2, 0, 90, 10, 2, 0, 91, 10, 4, 0, 74, 0, 11, 0,144, 9, 4, 0, 92, 10, 4, 0, 93, 10,144, 1, 94, 10,145, 1, 95, 10,
-143, 1, 96, 10,146, 1, 4, 0, 0, 0, 97, 10, 2, 0, 98, 10, 2, 0, 99, 10, 4, 0, 27, 0,147, 1, 37, 0,147, 1, 0, 0,
-147, 1, 1, 0,147, 1,100, 10, 0, 0, 19, 0, 2, 0, 16, 0, 2, 0, 18, 0, 2, 0,191, 8, 2, 0, 65, 9, 2, 0,101, 10,
- 2, 0, 9, 7, 2, 0, 90, 10, 2, 0, 34, 9, 14, 0, 76, 9, 14, 0,102, 10,147, 1, 38, 0, 22, 0, 42, 7, 11, 0, 84, 10,
- 7, 0, 87, 10, 7, 0, 88, 10, 7, 0, 81, 2, 7, 0,255, 2, 7, 0,103, 10, 4, 0,104, 10, 0, 0,105, 10, 2, 0,106, 10,
- 2, 0,107, 10, 7, 0,108, 10, 7, 0,109, 10, 2, 0,110, 10, 2, 0,111, 10, 11, 0,112, 10, 19, 0,113, 10, 19, 0,114, 10,
- 19, 0,115, 10,146, 1,154, 0,148, 1,116, 10,149, 1,117, 10,145, 1, 8, 0,145, 1, 0, 0,145, 1, 1, 0,147, 1,118, 10,
-147, 1,119, 10,144, 1,120, 10,144, 1,121, 10, 4, 0, 18, 0, 4, 0, 27, 0, 57, 0, 20, 0, 22, 0, 32, 0, 34, 0, 75, 0,
-179, 0,181, 3, 14, 0,122, 10, 14, 0,123, 10, 4, 0, 16, 0, 4, 0,124, 10, 4, 0,125, 10, 4, 0, 18, 0, 4, 0,104, 10,
- 4, 0,126, 10, 14, 0, 76, 9, 14, 0,102, 10,150, 1,127, 10, 11, 0,128, 10, 11, 0,129, 10, 4, 0,130, 10, 11, 0,131, 10,
- 11, 0,132, 10, 11, 0,133, 10,151, 1, 4, 0, 4, 0, 17, 0, 4, 0,227, 2, 4, 0,111, 9, 4, 0,112, 9,152, 1, 4, 0,
- 4, 0, 17, 0, 7, 0,227, 2, 7, 0,111, 9, 7, 0,112, 9,153, 1, 2, 0, 0, 0,227, 2, 0, 0, 86, 1,154, 1, 4, 0,
- 4, 0, 17, 0, 7, 0,134, 10, 7, 0,111, 9, 7, 0,112, 9,155, 1, 1, 0, 7, 0,135, 10,156, 1, 6, 0, 4, 0,127, 0,
- 4, 0,129, 0, 4, 0, 34, 9, 0, 0,136, 10, 0, 0,137, 10, 2, 0, 27, 0,157, 1, 16, 0, 2, 0,135, 8, 2, 0,136, 8,
- 2, 0,138, 10, 2, 0,139, 10, 2, 0,140, 10, 2, 0, 67, 0, 2, 0, 43, 7, 2, 0,141, 10, 7, 0,250, 2, 7, 0,142, 10,
- 7, 0,143, 10, 2, 0,109, 1, 0, 0,144, 10, 0, 0,145, 10, 4, 0,146, 10, 4, 0,147, 10,158, 1, 9, 0, 7, 0,148, 10,
- 7, 0,149, 10, 7, 0,143, 9, 7, 0, 92, 3, 7, 0,150, 10, 7, 0,218, 6, 2, 0, 90, 3, 0, 0,151, 10, 0, 0, 27, 0,
-159, 1, 4, 0, 7, 0,152, 10, 7, 0,153, 10, 2, 0, 90, 3, 2, 0, 27, 0,160, 1, 3, 0, 7, 0,154, 10, 7, 0,206, 8,
- 7, 0, 14, 0,161, 1, 4, 0, 0, 0, 35, 0,205, 0, 79, 5, 4, 0,129, 0, 4, 0,131, 4,162, 1, 3, 0, 0, 0,155, 10,
- 4, 0,156, 10, 4, 0, 27, 0,163, 1, 4, 0, 2, 0,157, 10, 2, 0, 91, 0, 4, 0, 30, 0,205, 0,158, 10,164, 1, 9, 0,
- 7, 0,159, 10, 7, 0,160, 10, 7, 0,161, 10, 7, 0, 92, 2, 7, 0,162, 10, 7, 0,163, 10, 7, 0,164, 10, 2, 0,165, 10,
- 2, 0,166, 10,165, 1, 8, 0, 2, 0,167, 10, 2, 0,168, 10, 2, 0,169, 10, 2, 0,170, 10, 7, 0,171, 10, 7, 0,172, 10,
- 7, 0,173, 10, 7, 0,174, 10,166, 1, 2, 0, 7, 0, 5, 0, 7, 0, 6, 0,167, 1, 2, 0, 0, 0,170, 0, 0, 0,175, 10,
-168, 1, 1, 0, 0, 0, 19, 0,169, 1, 12, 0, 0, 0,176, 10, 0, 0,177, 10, 0, 0,209, 6, 0, 0,178, 10, 2, 0,138, 10,
- 2, 0,179, 10, 7, 0,180, 10, 7, 0,181, 10, 7, 0,182, 10, 7, 0,147, 3, 7, 0,183, 10, 7, 0,184, 10,170, 1, 2, 0,
- 11, 0,185, 10, 11, 0,186, 10,171, 1, 13, 0, 0, 0, 71, 5, 0, 0, 16, 0, 0, 0, 90, 3, 0, 0, 92, 3, 0, 0,177, 10,
- 0, 0,108, 0, 0, 0,179, 2, 7, 0,187, 10, 7, 0,188, 10, 7, 0,146, 3, 7, 0,189, 10, 7, 0,190, 10, 7, 0,184, 10,
-172, 1, 8, 0, 7, 0, 41, 9, 7, 0,128, 0, 7, 0,145, 10, 7, 0,172, 2, 7, 0,191, 10, 7, 0,240, 0, 7, 0,192, 10,
- 4, 0, 16, 0,173, 1, 4, 0, 2, 0,193, 10, 2, 0,194, 10, 2, 0,195, 10, 2, 0, 27, 0,174, 1, 8, 0, 7, 0,196, 10,
- 7, 0,217, 2, 7, 0,197, 10, 7, 0,184, 8, 7, 0,185, 8, 7, 0,186, 8, 7, 0,198, 10, 7, 0,199, 10,175, 1, 6, 0,
- 2, 0,200, 10, 2, 0,201, 10, 7, 0,202, 10, 7, 0,203, 10, 7, 0,204, 10, 7, 0,205, 10,176, 1, 2, 0, 58, 0,206, 10,
- 59, 0,207, 10,177, 1, 3, 0,176, 1, 78, 6, 7, 0,208, 10, 7, 0,209, 10,178, 1, 3, 0,176, 1, 78, 6, 4, 0,210, 10,
- 4, 0, 27, 0,179, 1, 1, 0,176, 1, 78, 6,180, 1, 3, 0,176, 1, 78, 6, 4, 0,210, 10, 4, 0, 27, 0,181, 1, 3, 0,
-176, 1, 78, 6, 4, 0,211, 10, 4, 0, 27, 0,182, 1, 1, 0,176, 1, 78, 6,183, 1, 3, 0,176, 1, 78, 6, 4, 0,212, 10,
- 4, 0, 27, 0,184, 1, 3, 0,176, 1, 78, 6, 4, 0,213, 10, 4, 0, 27, 0,185, 1, 3, 0,176, 1, 78, 6, 4, 0,214, 10,
- 4, 0, 27, 0,186, 1, 3, 0,176, 1, 78, 6, 4, 0,250, 0, 4, 0, 27, 0,187, 1, 1, 0, 0, 0, 19, 0,188, 1, 1, 0,
- 0, 0, 19, 0,189, 1, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 2, 0, 18, 0, 2, 0,215, 10,190, 1, 10, 0, 2, 0, 61, 4,
- 2, 0, 18, 0, 7, 0,216, 4, 7, 0,216, 10, 7, 0,217, 10, 7, 0,218, 10, 7, 0,219, 10,189, 1,220, 10,189, 1,221, 10,
-189, 1,222, 10, 54, 0, 11, 0, 4, 0, 18, 0, 4, 0, 63, 0, 4, 0,223, 10, 4, 0,224, 10, 19, 0,225, 10, 19, 0,226, 10,
-190, 1,227, 10, 7, 0,228, 10, 7, 0,229, 10, 7, 0,230, 10, 7, 0,231, 10, 1, 1, 10, 0, 4, 0,247, 9, 4, 0,232, 10,
- 7, 0,233, 10, 7, 0,234, 10, 7, 0,235, 10, 7, 0,236, 10, 7, 0, 9, 0, 7, 0, 11, 0, 4, 0, 87, 1, 4, 0,255, 2,
- 0, 1, 18, 0, 4, 0,132, 0, 4, 0,237, 10, 4, 0,238, 10, 7, 0,239, 10, 4, 0,240, 10, 7, 0,241, 10, 7, 0,242, 10,
- 4, 0,243, 10, 7, 0,244, 10, 4, 0,245, 10, 7, 0,246, 10, 1, 1,247, 10, 7, 0,248, 10, 7, 0,249, 10, 7, 0,250, 10,
- 7, 0,251, 10, 4, 0,252, 10, 4, 0, 27, 0,191, 1, 4, 0, 42, 0,242, 2, 7, 0,253, 10, 7, 0,178, 1, 7, 0, 27, 0,
-214, 0, 34, 0, 22, 0, 32, 0,191, 1,254, 10, 54, 0,220, 10, 46, 0,255, 10, 52, 0, 0, 11, 25, 0,154, 0, 0, 0, 1, 11,
- 7, 0, 2, 11, 2, 0,108, 6, 2, 0, 3, 11, 4, 0,108, 0, 4, 0, 18, 0, 7, 0, 4, 11, 4, 0, 89, 2, 4, 0, 5, 11,
- 7, 0, 6, 11, 7, 0, 7, 11, 7, 0, 8, 11, 7, 0,178, 1, 4, 0, 9, 11, 7, 0, 10, 11, 0, 0, 11, 11, 0, 0, 12, 11,
- 0, 0, 13, 11, 0, 0, 14, 11, 7, 0, 15, 11, 7, 0, 16, 11, 7, 0, 17, 11, 7, 0,255, 2, 7, 0, 18, 11, 4, 0, 19, 11,
- 7, 0,239, 5, 7, 0, 20, 11, 7, 0, 21, 11,192, 1, 10, 0, 4, 0, 16, 0, 4, 0,128, 0, 4, 0, 18, 0, 4, 0, 14, 4,
- 4, 0, 22, 11, 4, 0, 23, 11, 4, 0, 24, 11, 4, 0, 73, 0, 0, 0, 19, 0, 11, 0, 2, 0,193, 1, 1, 0, 0, 0, 70, 7,
- 95, 0, 8, 0,192, 1, 25, 11, 4, 0, 26, 11, 4, 0, 27, 11, 4, 0, 28, 11, 4, 0, 29, 11, 4, 0, 30, 0, 11, 0, 30, 11,
-193, 1, 31, 11,194, 1, 5, 0, 7, 0,165, 2, 7, 0,237, 2, 7, 0, 39, 2, 2, 0,147, 2, 2, 0, 27, 0,195, 1, 5, 0,
- 7, 0,165, 2, 7, 0,158, 4, 7, 0, 32, 11, 7, 0, 33, 11, 7, 0,237, 2,196, 1, 5, 0, 27, 0, 34, 11,197, 1, 21, 0,
- 7, 0, 74, 6, 7, 0, 35, 11, 7, 0, 56, 0,198, 1, 3, 0, 7, 0, 36, 11, 4, 0, 37, 11, 4, 0, 38, 11,199, 1, 7, 0,
- 4, 0, 39, 11, 4, 0, 40, 11, 4, 0, 41, 11, 7, 0, 42, 11, 7, 0, 43, 11, 7, 0, 44, 11, 7, 0, 56, 0,200, 1, 8, 0,
-200, 1, 0, 0,200, 1, 1, 0, 27, 0, 44, 0, 4, 0, 3, 1, 2, 0, 18, 0, 2, 0, 87, 1, 7, 0,237, 2, 7, 0, 49, 9,
-201, 1, 7, 0,201, 1, 0, 0,201, 1, 1, 0, 27, 0, 44, 0, 2, 0,222, 2, 2, 0, 18, 0, 2, 0, 13, 2, 2, 0, 56, 0,
-202, 1, 17, 0,195, 1, 7, 4,195, 1, 45, 11,194, 1, 46, 11,195, 1, 32, 9,196, 1, 47, 11, 4, 0, 82, 0, 7, 0,237, 2,
- 7, 0, 5, 3, 7, 0, 48, 11, 4, 0, 39, 11, 4, 0, 49, 11, 7, 0, 43, 11, 7, 0, 44, 11, 7, 0,108, 0, 4, 0, 50, 11,
- 2, 0, 18, 0, 2, 0, 51, 11,203, 1, 15, 0, 7, 0,255, 0, 7, 0, 52, 11, 7, 0, 36, 11, 7, 0, 53, 11, 7, 0, 54, 11,
- 7, 0, 55, 11, 7, 0, 56, 11, 7, 0, 57, 11, 7, 0, 58, 11, 7, 0, 59, 11, 7, 0, 60, 11, 7, 0, 61, 11, 7, 0, 62, 11,
- 4, 0, 18, 0, 4, 0, 63, 11,204, 1,128, 0, 22, 0, 32, 0, 34, 0, 75, 0,205, 1, 64, 11,203, 1, 65, 11,188, 0,153, 4,
- 4, 0, 18, 0, 4, 0, 56, 0, 2, 0, 16, 0, 2, 0, 51, 10, 2, 0, 66, 11, 2, 0,122, 1, 2, 0, 67, 11, 2, 0,231, 3,
- 2, 0, 68, 11, 2, 0, 69, 11, 2, 0, 70, 11, 2, 0, 71, 11, 2, 0, 72, 11, 2, 0, 73, 11, 2, 0, 74, 11, 2, 0, 75, 11,
- 2, 0, 76, 11, 2, 0,223, 5, 2, 0, 77, 11, 2, 0, 78, 11, 2, 0, 79, 11, 2, 0, 80, 11, 2, 0, 81, 11, 2, 0, 28, 2,
- 2, 0, 25, 9, 2, 0, 0, 9, 2, 0, 82, 11, 2, 0, 83, 11, 2, 0, 24, 4, 2, 0, 25, 4, 2, 0, 84, 11, 2, 0, 85, 11,
- 2, 0, 86, 11, 2, 0, 87, 11, 7, 0, 88, 11, 7, 0, 89, 11, 7, 0, 90, 11, 7, 0, 91, 11, 7, 0, 92, 11, 7, 0, 93, 11,
- 7, 0, 94, 11, 2, 0,153, 5, 2, 0, 95, 11, 7, 0, 96, 11, 7, 0, 97, 11, 7, 0, 98, 11, 7, 0, 7, 9, 7, 0, 90, 0,
- 7, 0, 5, 3, 7, 0, 13, 9, 7, 0, 99, 11, 7, 0,100, 11, 7, 0,101, 11, 7, 0,102, 11, 7, 0,103, 11, 7, 0,104, 11,
- 4, 0, 8, 9, 4, 0, 6, 9, 4, 0,105, 11, 4, 0,106, 11, 2, 0,107, 11, 2, 0,108, 11, 7, 0, 9, 9, 7, 0, 10, 9,
- 7, 0, 11, 9, 7, 0,109, 11, 7, 0,110, 11, 7, 0,111, 11, 7, 0,112, 11, 7, 0,113, 11, 7, 0,114, 11, 7, 0,115, 11,
- 7, 0,116, 11, 7, 0,117, 11, 7, 0,221, 3, 7, 0,108, 0, 7, 0,118, 11, 7, 0,119, 11, 7, 0,120, 11, 7, 0,121, 11,
- 7, 0,214, 0, 7, 0,122, 11, 4, 0,123, 11, 4, 0,124, 11, 7, 0,125, 11, 7, 0,126, 11, 7, 0,127, 11, 7, 0,128, 11,
- 7, 0,129, 11, 7, 0,213, 0, 7, 0,130, 11, 7, 0, 51, 4, 7, 0, 49, 4, 7, 0, 50, 4, 7, 0,131, 11, 7, 0,132, 11,
- 7, 0,133, 11, 7, 0,134, 11, 7, 0,135, 11, 7, 0,136, 11, 7, 0,137, 11, 7, 0,138, 11, 7, 0,139, 11, 7, 0,140, 11,
- 7, 0,141, 11, 7, 0,142, 11, 7, 0,143, 11, 7, 0,144, 11, 7, 0,145, 11, 7, 0,146, 11, 7, 0,147, 11, 7, 0,148, 11,
- 4, 0,149, 11, 4, 0,150, 11, 46, 0,140, 1, 64, 0,255, 3, 14, 0,151, 11, 64, 0,152, 11, 27, 0,153, 11, 27, 0,154, 11,
- 31, 0, 80, 0,183, 0, 73, 1,183, 0,155, 11,150, 0, 52, 0,150, 0, 0, 0,150, 0, 1, 0,204, 1,156, 11,202, 1,157, 11,
-199, 1,210, 9,191, 0, 79, 4, 11, 0, 80, 4,206, 1,158, 11,206, 1,159, 11, 14, 0,160, 11, 14, 0,161, 11,135, 0,162, 11,
-143, 0,163, 11,143, 0,164, 11, 27, 0,165, 11, 27, 0,166, 11, 27, 0, 38, 0, 14, 0, 18, 10, 0, 0, 19, 0, 7, 0,244, 0,
- 7, 0, 34, 3, 7, 0,167, 11, 7, 0,168, 11, 4, 0,211, 2, 4, 0,169, 11, 4, 0, 18, 0, 4, 0, 8, 9, 4, 0,170, 11,
- 4, 0,171, 11, 4, 0,172, 11, 4, 0,173, 11, 2, 0,251, 0, 2, 0,174, 11, 2, 0,175, 11, 2, 0,176, 11, 0, 0,177, 11,
- 2, 0,178, 11, 2, 0,179, 11, 2, 0,180, 11, 11, 0,181, 11,139, 0,152, 4, 14, 0, 19, 3, 14, 0,182, 11,198, 1,183, 11,
- 4, 0,184, 11, 4, 0,185, 11,207, 1,186, 11,141, 0, 31, 3,208, 1,187, 11, 7, 0,188, 11, 7, 0,189, 11, 7, 0,190, 11,
-137, 0, 38, 0,209, 1,144, 9, 7, 0,122, 4, 7, 0,191, 11, 7, 0,192, 11, 7, 0, 74, 6, 7, 0,235, 3, 7, 0,221, 3,
- 7, 0,193, 11, 7, 0, 91, 2, 7, 0,194, 11, 7, 0,195, 11, 7, 0,196, 11, 7, 0,197, 11, 7, 0,198, 11, 7, 0,199, 11,
- 7, 0,123, 4, 7, 0,200, 11, 7, 0,201, 11, 7, 0,202, 11, 7, 0,124, 4, 7, 0,120, 4, 7, 0,121, 4, 7, 0,203, 11,
- 7, 0,204, 11, 7, 0,205, 11, 4, 0,206, 11, 4, 0, 92, 0, 4, 0,207, 11, 4, 0,208, 11, 2, 0,209, 11, 2, 0,210, 11,
- 2, 0,211, 11, 2, 0,212, 11, 2, 0,213, 11, 2, 0,214, 11, 2, 0,215, 11, 2, 0, 27, 0,188, 0,153, 4,138, 0, 11, 0,
-209, 1,216, 11, 7, 0,217, 11, 7, 0,218, 11, 7, 0,250, 1, 7, 0,219, 11, 7, 0,220, 11, 7, 0,221, 11, 4, 0, 92, 0,
- 2, 0,222, 11, 2, 0,223, 11, 64, 0,249, 1,210, 1, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0, 7, 0,224, 11,
-211, 1, 6, 0,211, 1, 0, 0,211, 1, 1, 0,210, 1,186, 9, 4, 0, 1, 1, 2, 0,225, 11, 2, 0, 18, 0,212, 1, 5, 0,
-212, 1, 0, 0,212, 1, 1, 0, 14, 0,226, 11, 4, 0,227, 11, 4, 0, 18, 0,213, 1, 9, 0,213, 1, 0, 0,213, 1, 1, 0,
- 14, 0,127, 0,212, 1,228, 11, 4, 0, 18, 0, 2, 0,225, 11, 2, 0,229, 11, 7, 0, 93, 0, 0, 0,230, 11,179, 0, 6, 0,
- 22, 0, 32, 0, 14, 0,122, 5, 4, 0, 18, 0, 2, 0,231, 11, 2, 0,232, 11, 11, 0,233, 11,214, 1, 6, 0, 14, 0,234, 11,
- 4, 0,235, 11, 4, 0,236, 11, 4, 0, 18, 0, 4, 0, 27, 0,238, 0,237, 11,215, 1, 19, 0, 22, 0, 32, 0,216, 1,238, 11,
-216, 1,239, 11, 14, 0,240, 11, 4, 0,241, 11, 2, 0,242, 11, 2, 0,243, 11, 14, 0,244, 11, 14, 0,245, 11,214, 1,246, 11,
- 14, 0,247, 11, 14, 0,248, 11, 14, 0,249, 11, 14, 0,250, 11,217, 1,251, 11,217, 1,252, 11,217, 1,253, 11, 14, 0,254, 11,
-238, 0,255, 11,216, 1, 32, 0,216, 1, 0, 0,216, 1, 1, 0, 11, 0, 0, 12, 4, 0,113, 8, 2, 0, 1, 12, 2, 0, 27, 0,
- 28, 1, 2, 12, 28, 1, 3, 12, 0, 0, 4, 12, 2, 0, 5, 12, 2, 0, 6, 12, 2, 0,135, 8, 2, 0,136, 8, 2, 0, 7, 12,
- 2, 0, 8, 12, 2, 0, 14, 4, 2, 0, 53, 7, 2, 0, 9, 12, 2, 0, 10, 12, 2, 0, 11, 12, 2, 0, 30, 0,218, 1, 12, 12,
-219, 1, 13, 12,220, 1, 14, 12, 4, 0, 15, 12, 4, 0, 16, 12, 11, 0, 17, 12, 14, 0,245, 11, 14, 0,154, 8, 14, 0, 18, 12,
- 14, 0, 19, 12, 14, 0, 20, 12,221, 1, 17, 0,221, 1, 0, 0,221, 1, 1, 0, 0, 0, 21, 12, 21, 0, 31, 0, 2, 0, 22, 12,
- 2, 0, 16, 0, 2, 0, 14, 0, 2, 0, 23, 12, 2, 0, 24, 12, 2, 0, 25, 12, 2, 0, 26, 12, 2, 0, 27, 12, 2, 0, 18, 0,
- 2, 0, 28, 12, 2, 0, 32, 0, 2, 0, 27, 0,222, 1, 29, 12,223, 1, 4, 0,223, 1, 0, 0,223, 1, 1, 0,221, 1, 30, 12,
-221, 1, 31, 12,224, 1, 11, 0,224, 1, 0, 0,224, 1, 1, 0, 14, 0, 32, 12, 14, 0, 33, 12, 0, 0, 21, 12, 2, 0, 34, 12,
- 2, 0, 35, 12, 2, 0, 18, 0, 2, 0, 36, 12, 4, 0, 37, 12, 11, 0, 38, 12,217, 1, 7, 0,217, 1, 0, 0,217, 1, 1, 0,
- 0, 0, 21, 12, 0, 0, 39, 12, 14, 0, 54, 8, 4, 0, 40, 12, 4, 0, 18, 0,250, 0, 14, 0,250, 0, 0, 0,250, 0, 1, 0,
- 0, 0, 21, 12, 21, 0, 31, 0,225, 1,129, 8, 11, 0, 41, 12, 11, 0, 42, 12,222, 1, 29, 12,214, 1, 43, 12, 14, 0, 44, 12,
-250, 0, 45, 12, 33, 1,239, 6, 2, 0, 18, 0, 2, 0, 86, 1,226, 1, 12, 0,226, 1, 0, 0,226, 1, 1, 0, 11, 0, 2, 0,
- 11, 0, 46, 12, 0, 0, 19, 0, 2, 0, 16, 0, 2, 0, 18, 0, 7, 0, 47, 12, 7, 0,129, 0, 7, 0,131, 4, 7, 0, 83, 9,
- 7, 0, 74, 10,227, 1, 5, 0, 7, 0, 48, 12, 4, 0, 49, 12, 4, 0, 50, 12, 4, 0, 87, 1, 4, 0, 18, 0,228, 1, 6, 0,
- 7, 0, 51, 12, 7, 0, 52, 12, 7, 0, 53, 12, 7, 0, 54, 12, 4, 0, 16, 0, 4, 0, 18, 0,229, 1, 5, 0, 7, 0,111, 9,
- 7, 0,112, 9, 7, 0,237, 2, 2, 0, 42, 2, 2, 0, 43, 2,230, 1, 5, 0,229, 1, 2, 0, 4, 0, 53, 0, 7, 0, 55, 12,
- 7, 0,111, 9, 7, 0,112, 9,231, 1, 4, 0, 2, 0, 56, 12, 2, 0, 57, 12, 2, 0, 58, 12, 2, 0, 59, 12,232, 1, 2, 0,
- 37, 0, 37, 7, 21, 0,150, 9,233, 1, 3, 0, 19, 0, 60, 12, 4, 0, 18, 0, 4, 0, 27, 0,234, 1, 6, 0, 7, 0,108, 0,
- 7, 0,238, 2, 7, 0, 61, 12, 7, 0, 27, 0, 2, 0,250, 0, 2, 0, 62, 12,235, 1, 5, 0, 7, 0, 63, 12, 7, 0,128, 0,
- 7, 0,187, 9, 7, 0,188, 9, 4, 0, 18, 0,236, 1, 6, 0, 22, 0, 42, 7, 0, 0, 64, 12, 0, 0, 65, 12, 2, 0, 66, 12,
- 2, 0, 18, 0, 4, 0, 67, 12,237, 1, 7, 0,237, 1, 0, 0,237, 1, 1, 0, 0, 0, 19, 0,236, 1, 68, 12, 2, 0, 69, 12,
- 2, 0, 16, 0, 7, 0, 60, 0,238, 1, 7, 0, 14, 0, 70, 12, 0, 0, 71, 12, 11, 0, 72, 12, 7, 0, 60, 0, 7, 0, 47, 12,
- 4, 0, 16, 0, 4, 0, 18, 0,239, 1, 3, 0, 7, 0, 73, 12, 4, 0, 18, 0, 4, 0, 27, 0,240, 1, 15, 0,240, 1, 0, 0,
-240, 1, 1, 0,107, 1, 5, 10,238, 1, 61, 0, 14, 0,187, 3, 30, 0, 49, 0,239, 1, 74, 12, 4, 0, 53, 0, 7, 0, 60, 0,
- 2, 0, 18, 0, 2, 0, 22, 1, 4, 0, 75, 12, 0, 0, 64, 12, 4, 0, 76, 12, 7, 0, 77, 12,241, 1, 2, 0, 0, 0, 78, 12,
- 0, 0, 79, 12,242, 1, 4, 0,242, 1, 0, 0,242, 1, 1, 0,177, 0, 68, 3, 14, 0, 80, 12,243, 1, 25, 0,243, 1, 0, 0,
-243, 1, 1, 0, 14, 0, 81, 12,177, 0, 81, 9,242, 1, 82, 12, 14, 0, 83, 12, 14, 0,187, 3, 0, 0, 19, 0, 7, 0, 47, 12,
- 7, 0, 84, 12, 7, 0, 89, 0, 7, 0, 90, 0, 7, 0, 70, 10, 7, 0, 71, 10, 7, 0,251, 2, 7, 0,147, 3, 7, 0, 83, 9,
- 7, 0, 74, 10, 2, 0, 85, 12, 2, 0, 86, 12, 2, 0, 91, 0, 2, 0, 16, 0, 11, 0, 87, 12, 4, 0, 18, 0, 4, 0, 30, 0,
-244, 1, 6, 0,244, 1, 0, 0,244, 1, 1, 0, 14, 0, 81, 12, 4, 0, 18, 0, 4, 0, 13, 2, 0, 0, 19, 0,245, 1, 11, 0,
-245, 1, 0, 0,245, 1, 1, 0, 22, 0, 42, 7, 0, 0, 88, 12, 4, 0, 67, 12, 2, 0, 89, 12, 2, 0, 27, 0, 0, 0, 64, 12,
- 4, 0, 75, 12, 2, 0, 18, 0, 2, 0, 90, 12,246, 1, 8, 0,246, 1, 0, 0,246, 1, 1, 0, 14, 0, 91, 12, 0, 0, 19, 0,
- 0, 0, 92, 12, 2, 0, 18, 0, 2, 0, 90, 12, 4, 0, 93, 12,247, 1, 5, 0,247, 1, 0, 0,247, 1, 1, 0, 0, 0, 64, 12,
- 4, 0, 75, 12, 7, 0,227, 2, 34, 0, 12, 0,177, 0,178, 3,177, 0, 94, 12,242, 1, 82, 12, 14, 0, 95, 12,243, 1, 96, 12,
- 14, 0, 97, 12, 14, 0, 98, 12, 4, 0, 18, 0, 4, 0,251, 0, 2, 0, 99, 12, 2, 0,100, 12, 7, 0,101, 12,248, 1, 2, 0,
- 22, 0, 32, 0, 34, 0, 75, 0,249, 1, 5, 0,249, 1, 0, 0,249, 1, 1, 0, 4, 0, 16, 0, 4, 0, 18, 0, 0, 0,171, 5,
-250, 1, 6, 0,249, 1,102, 12, 27, 0, 44, 0, 4, 0,103, 12, 7, 0,104, 12, 4, 0,105, 12, 4, 0,247, 9,251, 1, 3, 0,
-249, 1,102, 12, 4, 0,103, 12, 7, 0,106, 12,252, 1, 8, 0,249, 1,102, 12, 27, 0, 44, 0, 7, 0, 77, 1, 7, 0,107, 12,
- 7, 0, 34, 3, 7, 0,143, 9, 4, 0,103, 12, 4, 0,108, 12,253, 1, 5, 0,249, 1,102, 12, 7, 0,109, 12, 7, 0, 65, 9,
- 7, 0, 1, 3, 7, 0, 56, 0,254, 1, 3, 0,249, 1,102, 12, 7, 0,143, 9, 7, 0,110, 12,197, 1, 4, 0, 7, 0,111, 12,
- 7, 0,119, 11, 2, 0,112, 12, 2, 0, 87, 1,255, 1, 14, 0,255, 1, 0, 0,255, 1, 1, 0, 14, 0,113, 12, 14, 0,114, 12,
- 14, 0,115, 12, 0, 0,171, 5, 4, 0, 32, 0, 4, 0, 18, 0, 4, 0,116, 12, 7, 0,117, 12, 4, 0,105, 12, 4, 0,247, 9,
- 7, 0, 83, 4, 7, 0, 3, 3,205, 1, 23, 0, 4, 0,103, 12, 4, 0,118, 12, 7, 0,119, 12, 7, 0,255, 2, 7, 0,120, 12,
- 7, 0,221, 8, 7, 0,111, 12, 7, 0,121, 12, 7, 0,238, 2, 7, 0,239, 10, 7, 0,216, 4, 7, 0,122, 12, 7, 0,123, 12,
- 7, 0,124, 12, 7, 0,125, 12, 7, 0,126, 12, 7, 0,127, 12, 7, 0,128, 12, 7, 0,129, 12, 7, 0,130, 12, 7, 0,131, 12,
- 7, 0,132, 12, 14, 0,133, 12,123, 0, 40, 0,122, 0,134, 12, 0, 2, 65, 11, 64, 0,135, 12, 64, 0,152, 11, 64, 0,136, 12,
- 1, 2,137, 12, 43, 0,169, 0, 43, 0,138, 12, 43, 0,139, 12, 7, 0,140, 12, 7, 0,141, 12, 7, 0,142, 12, 7, 0,143, 12,
- 7, 0,144, 12, 7, 0,112, 8, 7, 0,145, 12, 7, 0,178, 1, 7, 0,146, 12, 4, 0,147, 12, 4, 0,148, 12, 4, 0,149, 12,
- 4, 0, 92, 0, 4, 0, 27, 0, 4, 0,150, 12, 2, 0,151, 12, 2, 0,152, 12, 4, 0,153, 12, 7, 0,238, 2, 4, 0,154, 12,
- 7, 0,155, 12, 4, 0,156, 12, 4, 0,157, 12, 4, 0,158, 12,139, 0,159, 12, 14, 0,160, 12,188, 0,153, 4, 4, 0,161, 12,
- 7, 0,162, 12, 7, 0,163, 12, 4, 0, 30, 0,124, 0, 12, 0,122, 0,134, 12,150, 0, 54, 3, 7, 0,143, 1, 7, 0,112, 8,
- 7, 0,164, 12, 7, 0,165, 12, 7, 0,166, 12, 2, 0,167, 12, 2, 0,168, 12, 2, 0,169, 12, 2, 0, 16, 0, 4, 0, 92, 0,
-125, 0, 13, 0,122, 0,134, 12,141, 0, 31, 3,143, 0, 33, 3, 7, 0,186, 9, 7, 0,170, 12, 7, 0,171, 12, 7, 0, 79, 1,
- 7, 0,172, 12, 4, 0, 27, 10, 4, 0, 27, 3, 2, 0, 16, 0, 2, 0, 27, 0, 4, 0, 30, 0, 2, 2, 15, 0, 22, 0, 32, 0,
- 34, 0, 75, 0, 47, 1,219, 8, 7, 0,173, 12, 7, 0,174, 12, 7, 0,175, 12, 7, 0,176, 12, 7, 0,142, 9, 7, 0,177, 12,
- 7, 0,178, 12, 7, 0,179, 12, 7, 0, 83, 4, 7, 0,221, 8, 2, 0, 18, 0, 2, 0,107, 9,232, 0, 3, 0, 4, 0,126, 0,
- 2, 0,215, 6, 2, 0,180, 12, 3, 2, 5, 0, 0, 0,187, 8, 2, 0,188, 8, 2, 0, 71, 5, 2, 0,181, 12, 2, 0,182, 12,
-230, 0, 16, 0, 22, 0, 32, 0, 34, 0, 75, 0, 0, 0, 35, 0, 4, 0,143, 0, 4, 0,144, 0, 4, 0,183, 12, 7, 0,162, 0,
- 7, 0,163, 0, 44, 0,138, 0, 4, 2,144, 9,179, 0,181, 3, 5, 2,184, 12, 11, 0,185, 12, 3, 2,186, 12, 4, 0, 18, 0,
- 4, 0, 27, 0, 14, 1, 10, 0, 4, 0,132, 0, 4, 0,187, 12, 52, 0,188, 12, 7, 0,189, 12, 2, 0,190, 12, 0, 0,179, 2,
- 4, 0,126, 0, 6, 2,174, 3, 7, 2,191, 12, 7, 0,192, 12, 8, 2, 3, 0, 4, 0,126, 0, 7, 0,193, 12, 7, 0, 79, 1,
- 9, 2, 11, 0, 11, 0,194, 12, 7, 0,195, 12, 7, 0,196, 12, 7, 0, 27, 0, 7, 0,197, 12, 2, 0,198, 12, 2, 0, 91, 0,
- 7, 0,199, 12, 7, 0,200, 12, 7, 0,201, 12, 7, 0,202, 12, 7, 2, 3, 0, 7, 0,203, 12, 4, 0,126, 0, 4, 0, 18, 0,
- 6, 2, 24, 0, 6, 2, 0, 0, 6, 2, 1, 0, 0, 0, 19, 0, 7, 0,204, 12, 7, 0,205, 12, 7, 0,206, 12, 7, 0,207, 12,
- 7, 0,253, 10, 4, 0,208, 12, 4, 0,209, 12, 7, 2,210, 12, 7, 0,211, 12, 7, 0,193, 12, 4, 0, 18, 0, 4, 0,212, 12,
- 4, 0,213, 12, 7, 0, 77, 12, 2, 0,214, 12, 2, 0,226, 3, 2, 0,215, 12, 2, 0,216, 12, 2, 0,217, 12, 2, 0, 30, 0,
- 7, 0,218, 12, 10, 2, 22, 0, 4, 0, 18, 0, 2, 0,219, 12, 2, 0,220, 12, 7, 0,221, 12, 2, 0,222, 12, 2, 0,223, 12,
- 2, 0,224, 12, 2, 0,225, 12, 2, 0,226, 12, 2, 0,227, 12, 2, 0,228, 12, 2, 0, 1, 3, 4, 0,229, 12, 4, 0,230, 12,
- 2, 0,231, 12, 2, 0,232, 12, 7, 0, 94, 1, 4, 0,233, 12, 4, 0,234, 12, 7, 0,235, 12, 7, 0,236, 12, 4, 0, 74, 0,
- 11, 2, 12, 0, 4, 0, 18, 0, 4, 0,237, 12, 4, 0,238, 12, 7, 0,239, 12, 6, 2,240, 12, 7, 0,241, 12, 7, 0,242, 12,
- 7, 0,243, 12, 4, 0,190, 1, 4, 0,132, 0, 7, 0,147, 3, 52, 0,244, 12, 12, 2, 5, 0, 4, 0, 18, 0, 7, 0,193, 12,
- 4, 0,245, 12, 4, 0,246, 12, 8, 2,247, 12, 13, 2, 7, 0, 13, 2, 0, 0, 13, 2, 1, 0, 0, 0, 19, 0, 4, 0, 18, 0,
- 7, 0,147, 3, 14, 0,248, 12, 12, 2,249, 12, 14, 2, 1, 0, 0, 0,250, 12, 5, 2, 10, 0, 10, 2,251, 12, 9, 2,252, 12,
- 14, 0,248, 12, 12, 2,249, 12, 11, 2,253, 12, 6, 2,254, 12, 14, 0,255, 12, 4, 0, 0, 13, 4, 0, 1, 13, 14, 2, 89, 6,
- 15, 2, 48, 0, 15, 2, 0, 0, 15, 2, 1, 0,170, 0,144, 3, 16, 2, 2, 0, 64, 0, 2, 13,188, 0,153, 4,139, 0,152, 4,
- 14, 0, 19, 3, 4, 0, 3, 13, 0, 0, 19, 0, 2, 0,158, 10, 2, 0, 16, 0, 2, 0, 4, 13, 2, 0, 5, 13, 2, 0, 6, 13,
- 2, 0, 7, 13, 2, 0, 8, 13, 2, 0, 9, 13, 4, 0, 92, 0, 4, 0,185, 3, 4, 0, 10, 13, 4, 0, 11, 13, 4, 0,187, 9,
- 4, 0,188, 9, 4, 0, 27, 0, 7, 0, 12, 13, 47, 0, 13, 13, 0, 0, 14, 13, 4, 0, 15, 13, 4, 0,153, 12, 7, 0, 16, 13,
- 7, 0, 17, 13, 7, 0, 18, 13, 7, 0, 19, 13, 7, 0, 20, 13, 7, 0, 21, 13, 7, 0, 22, 13, 7, 0, 23, 13, 7, 0, 24, 13,
- 7, 0, 25, 13, 7, 0, 26, 13, 7, 0, 27, 13, 7, 0, 28, 13, 7, 0, 29, 13, 0, 0,200, 2, 0, 0, 30, 13, 0, 0, 31, 13,
- 0, 0, 32, 13,170, 0, 7, 0,169, 0, 33, 13,143, 0, 33, 3, 14, 0, 34, 13, 2, 0, 35, 13, 2, 0, 92, 0, 4, 0, 27, 0,
- 0, 0, 36, 13,171, 0, 24, 0,169, 0, 33, 13,143, 0, 33, 3,150, 0, 54, 3, 63, 0, 25, 2, 4, 0, 92, 0, 4, 0, 37, 13,
- 7, 0,185, 0, 7, 0,186, 0, 7, 0,187, 0, 7, 0,178, 1, 7, 0, 38, 13, 7, 0, 39, 13, 7, 0, 40, 13, 7, 0, 41, 13,
- 50, 0, 42, 13, 50, 0, 43, 13, 2, 0, 44, 13, 2, 0,214, 10, 2, 0, 45, 13, 2, 0, 27, 0, 7, 0, 46, 13, 7, 0, 47, 13,
- 7, 0, 48, 13, 7, 0, 49, 13, 69, 78, 68, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 4, 0,173, 2,100, 0, 1, 0, 0, 0,174, 2,101, 0, 1, 0, 7, 0,150, 2,102, 0, 1, 0, 7, 0,170, 2,103, 0, 4, 0,
+ 4, 0,175, 2, 4, 0,176, 2, 7, 0,177, 2, 4, 0,178, 2,104, 0, 4, 0, 7, 0,240, 0, 7, 0,185, 0, 7, 0,186, 0,
+ 7, 0,187, 0,105, 0, 1, 0,104, 0,151, 2,106, 0, 5, 0, 4, 0,179, 2, 4, 0,180, 2, 0, 0, 18, 0, 0, 0, 47, 2,
+ 0, 0,181, 2,107, 0, 2, 0, 4, 0,182, 2, 4, 0,180, 2,108, 0, 10, 0,108, 0, 0, 0,108, 0, 1, 0,106, 0,183, 2,
+105, 0,184, 2,107, 0,185, 2, 4, 0, 53, 0, 4, 0,138, 2, 4, 0,137, 2, 4, 0, 27, 0, 88, 0,186, 2, 96, 0, 14, 0,
+ 14, 0,187, 2, 88, 0,186, 2, 0, 0,188, 2, 0, 0,189, 2, 0, 0,190, 2, 0, 0,191, 2, 0, 0,192, 2, 0, 0,193, 2,
+ 0, 0,194, 2, 0, 0, 18, 0, 95, 0,132, 2, 95, 0,134, 2, 2, 0,195, 2, 0, 0,196, 2,109, 0, 1, 0, 4, 0,173, 2,
+110, 0, 9, 0,110, 0, 0, 0,110, 0, 1, 0, 4, 0, 16, 0, 4, 0, 87, 1, 4, 0,197, 2, 4, 0, 27, 0, 0, 0, 19, 0,
+ 41, 0,125, 0, 0, 0,198, 2,111, 0, 6, 0,110, 0,199, 2, 47, 0,200, 2, 27, 0,201, 2, 0, 0,202, 2, 4, 0,203, 2,
+ 4, 0,204, 2,112, 0, 7, 0,110, 0,199, 2, 2, 0,205, 2, 2, 0,187, 2, 2, 0,206, 2, 2, 0, 92, 0, 11, 0,207, 2,
+ 11, 0,208, 2,113, 0, 5, 0,110, 0,199, 2, 27, 0,168, 0, 0, 0, 19, 0, 7, 0,209, 2, 0, 0, 94, 0,114, 0, 5, 0,
+110, 0,199, 2, 27, 0,168, 0, 0, 0, 19, 0, 2, 0,210, 2, 0, 0,211, 2,115, 0, 5, 0,110, 0,199, 2, 7, 0, 89, 0,
+ 7, 0,212, 2, 4, 0,213, 2, 4, 0,214, 2,116, 0, 5, 0,110, 0,199, 2, 27, 0,215, 2, 0, 0, 70, 0, 4, 0, 87, 1,
+ 4, 0, 18, 0,117, 0, 13, 0,110, 0,199, 2, 27, 0,216, 2, 27, 0,217, 2, 27, 0,218, 2, 27, 0,219, 2, 7, 0,220, 2,
+ 7, 0,221, 2, 7, 0,212, 2, 7, 0,222, 2, 4, 0,223, 2, 4, 0,224, 2, 4, 0, 92, 0, 4, 0,225, 2,118, 0, 5, 0,
+110, 0,199, 2, 2, 0,226, 2, 2, 0, 18, 0, 7, 0,227, 2, 27, 0,228, 2,119, 0, 3, 0,110, 0,199, 2, 7, 0,229, 2,
+ 4, 0, 92, 0,120, 0, 10, 0,110, 0,199, 2, 7, 0,230, 2, 4, 0,231, 2, 4, 0, 27, 0, 2, 0, 92, 0, 2, 0,232, 2,
+ 2, 0,233, 2, 2, 0,234, 2, 7, 0,235, 2, 0, 0,236, 2,121, 0, 3, 0,110, 0,199, 2, 7, 0, 27, 0, 4, 0, 16, 0,
+122, 0, 6, 0,110, 0,199, 2,123, 0,237, 2,124, 0,238, 2,125, 0,239, 2, 7, 0,240, 2, 4, 0, 16, 0,126, 0, 11, 0,
+110, 0,199, 2, 47, 0,200, 2, 27, 0,201, 2, 0, 0,202, 2, 4, 0,203, 2, 4, 0,204, 2, 7, 0,209, 2, 4, 0,241, 2,
+ 0, 0,236, 2, 7, 0,242, 2, 4, 0, 27, 0,127, 0, 12, 0,110, 0,199, 2, 27, 0,243, 2, 42, 0,244, 2, 4, 0, 92, 0,
+ 4, 0,245, 2, 7, 0,246, 2, 7, 0,247, 2, 7, 0,248, 2, 7, 0,249, 2, 0, 0,202, 2, 4, 0,203, 2, 4, 0, 27, 0,
+128, 0, 3, 0,110, 0,199, 2, 7, 0,250, 2, 4, 0,251, 2,129, 0, 5, 0,110, 0,199, 2, 7, 0,252, 2, 0, 0,236, 2,
+ 2, 0, 18, 0, 2, 0,253, 2,130, 0, 8, 0,110, 0,199, 2, 27, 0,168, 0, 7, 0,252, 2, 7, 0,255, 0, 7, 0,108, 0,
+ 0, 0,236, 2, 2, 0, 18, 0, 2, 0, 16, 0,131, 0, 21, 0,110, 0,199, 2, 47, 0,200, 2, 27, 0,201, 2, 0, 0,202, 2,
+ 4, 0,203, 2, 4, 0,204, 2, 27, 0,254, 2, 0, 0,236, 2, 2, 0, 18, 0, 2, 0, 27, 0, 7, 0,255, 2, 7, 0, 0, 3,
+ 7, 0, 1, 3, 7, 0, 81, 2, 7, 0, 2, 3, 7, 0, 3, 3, 7, 0, 4, 3, 7, 0, 5, 3, 7, 0, 6, 3, 7, 0, 7, 3,
+ 7, 0, 91, 0,132, 0, 7, 0,110, 0,199, 2, 2, 0, 8, 3, 2, 0, 9, 3, 4, 0, 30, 0, 27, 0,168, 0, 7, 0, 10, 3,
+ 0, 0,236, 2,133, 0, 10, 0,110, 0,199, 2, 27, 0,168, 0, 0, 0, 11, 3, 7, 0, 12, 3, 7, 0, 13, 3, 7, 0, 5, 3,
+ 4, 0, 14, 3, 4, 0, 15, 3, 7, 0, 16, 3, 0, 0, 19, 0,134, 0, 1, 0,110, 0,199, 2,135, 0, 7, 0,110, 0,199, 2,
+ 41, 0,125, 0,136, 0, 17, 3,137, 0, 18, 3,138, 0, 19, 3,139, 0, 20, 3, 14, 0, 21, 3,140, 0, 13, 0,110, 0,199, 2,
+ 88, 0, 22, 3, 88, 0, 23, 3, 88, 0, 24, 3, 88, 0, 25, 3, 88, 0, 26, 3, 88, 0, 27, 3, 85, 0, 28, 3, 4, 0, 29, 3,
+ 4, 0, 30, 3, 7, 0, 31, 3, 7, 0, 32, 3,141, 0, 33, 3,142, 0, 7, 0,110, 0,199, 2, 88, 0, 22, 3, 88, 0, 34, 3,
+143, 0, 35, 3,144, 0, 33, 3, 4, 0, 36, 3, 4, 0, 29, 3,145, 0, 4, 0,110, 0,199, 2, 27, 0,168, 0, 4, 0, 37, 3,
+ 4, 0, 27, 0,146, 0, 2, 0, 4, 0, 38, 3, 7, 0, 39, 2,147, 0, 2, 0, 4, 0,128, 0, 4, 0, 39, 3,148, 0, 24, 0,
+110, 0,199, 2, 27, 0,168, 0, 0, 0,236, 2, 2, 0, 40, 3, 2, 0, 18, 0, 2, 0, 87, 1, 2, 0, 27, 0,146, 0, 41, 3,
+ 4, 0, 42, 3, 7, 0, 43, 3, 4, 0, 53, 0, 4, 0, 44, 3,147, 0, 45, 3,146, 0, 46, 3, 4, 0, 47, 3, 4, 0, 48, 3,
+ 4, 0, 49, 3, 4, 0, 39, 3, 7, 0, 50, 3, 7, 0, 51, 3, 7, 0, 52, 3, 7, 0, 53, 3, 7, 0, 54, 3, 11, 0, 55, 3,
+149, 0, 8, 0,110, 0,199, 2,150, 0, 56, 3,143, 0, 35, 3, 4, 0, 57, 3, 4, 0, 58, 3, 4, 0, 59, 3, 2, 0, 18, 0,
+ 2, 0, 56, 0,151, 0, 8, 0,110, 0,199, 2, 27, 0, 44, 0, 2, 0, 3, 1, 2, 0, 18, 0, 2, 0,226, 2, 2, 0, 56, 0,
+ 7, 0, 60, 3, 7, 0, 61, 3,152, 0, 6, 0,110, 0,199, 2, 4, 0, 62, 3, 2, 0, 18, 0, 2, 0, 63, 3, 7, 0, 64, 3,
+ 0, 0,170, 0,153, 0, 8, 0,110, 0,199, 2, 0, 0, 65, 3, 0, 0, 66, 3, 0, 0,193, 2, 0, 0, 67, 3, 0, 0, 68, 3,
+ 0, 0, 92, 0, 0, 0,181, 2,154, 0, 3, 0,110, 0,199, 2,155, 0, 69, 3,139, 0, 20, 3,156, 0, 10, 0,110, 0,199, 2,
+ 27, 0, 70, 3, 27, 0, 71, 3, 0, 0, 72, 3, 7, 0, 73, 3, 2, 0, 74, 3, 2, 0, 75, 3, 0, 0, 76, 3, 0, 0, 77, 3,
+ 0, 0,211, 2,157, 0, 9, 0,110, 0,199, 2, 27, 0, 78, 3, 0, 0, 72, 3, 7, 0, 79, 3, 7, 0, 80, 3, 0, 0, 87, 1,
+ 0, 0,226, 2, 0, 0, 81, 3, 0, 0, 27, 0,158, 0, 1, 0,110, 0,199, 2,159, 0, 11, 0,110, 0,199, 2, 0, 0,236, 2,
+ 7, 0,128, 0, 7, 0, 82, 3, 7, 0, 83, 3, 7, 0, 84, 3, 7, 0, 85, 3, 7, 0, 86, 3, 4, 0, 18, 0, 2, 0, 87, 3,
+ 2, 0, 88, 3,160, 0, 9, 0,110, 0,199, 2, 27, 0, 89, 3, 4, 0, 90, 3, 4, 0, 91, 3, 4, 0, 92, 3, 7, 0, 93, 3,
+ 7, 0, 94, 3, 2, 0,226, 2, 2, 0, 18, 0,161, 0, 29, 0,110, 0,199, 2,162, 0, 95, 3,163, 0, 96, 3, 4, 0, 97, 3,
+ 4, 0, 98, 3, 7, 0, 99, 3, 7, 0, 4, 3, 7, 0,100, 3, 7, 0,250, 0, 7, 0,101, 3, 7, 0,102, 3, 7, 0,103, 3,
+ 7, 0,104, 3, 7, 0,105, 3, 7, 0,240, 2, 4, 0,106, 3, 4, 0,107, 3, 0, 0,108, 3, 0, 0,109, 3, 0, 0,110, 3,
+ 0, 0,111, 3, 0, 0, 18, 0, 0, 0,112, 3, 2, 0,113, 3, 2, 0,114, 3, 4, 0,214, 2, 7, 0,108, 0, 7, 0,115, 3,
+ 4, 0, 27, 0,164, 0, 15, 0,110, 0,199, 2, 47, 0,200, 2, 27, 0,201, 2, 0, 0,202, 2, 4, 0,203, 2, 4, 0,204, 2,
+ 27, 0,116, 3, 27, 0,117, 3, 54, 0,100, 1, 0, 0,236, 2, 7, 0,209, 2, 7, 0,118, 3, 0, 0, 18, 0, 0, 0,253, 0,
+ 0, 0,211, 2,165, 0, 16, 0,110, 0,199, 2, 0, 0,236, 2, 2, 0,119, 3, 2, 0,253, 0, 7, 0,120, 3, 54, 0,121, 3,
+ 7, 0,122, 3, 7, 0,123, 3, 7, 0,124, 3, 0, 0,125, 3, 4, 0,126, 3, 47, 0,127, 3, 27, 0,128, 3, 4, 0,129, 3,
+ 0, 0,130, 3, 4, 0,131, 3,166, 0, 16, 0,110, 0,199, 2, 0, 0,132, 3, 0, 0,133, 3, 7, 0,134, 3, 7, 0,135, 3,
+ 0, 0,136, 3, 0, 0,137, 3, 0, 0,138, 3, 7, 0,124, 3, 0, 0,125, 3, 4, 0,126, 3, 47, 0,127, 3, 27, 0,128, 3,
+ 4, 0,129, 3, 0, 0,130, 3, 4, 0,131, 3,167, 0, 16, 0,110, 0,199, 2, 0, 0,236, 2, 4, 0,139, 3, 4, 0,140, 3,
+ 27, 0,141, 3, 7, 0,124, 3, 0, 0,125, 3, 4, 0,126, 3, 47, 0,127, 3, 27, 0,128, 3, 4, 0,129, 3, 0, 0,130, 3,
+ 7, 0,142, 3, 7, 0,143, 3, 2, 0,253, 0, 2, 0,144, 3,168, 0, 5, 0,110, 0,199, 2,169, 0,145, 3,170, 0,146, 3,
+ 4, 0, 16, 0, 4, 0, 27, 0,171, 0, 8, 0,110, 0,199, 2, 7, 0,147, 3, 7, 0,148, 3, 7, 0,149, 3, 0, 0,250, 0,
+ 0, 0, 18, 0, 0, 0, 87, 1, 0, 0, 27, 0,172, 0, 3, 0,173, 0,150, 3, 4, 0, 66, 2, 0, 0, 94, 0,173, 0, 29, 0,
+ 22, 0, 32, 0, 34, 0, 75, 0, 2, 0, 48, 2, 2, 0, 49, 2, 2, 0,151, 3, 2, 0, 18, 0, 2, 0,152, 3, 2, 0,153, 3,
+ 2, 0,154, 3, 2, 0, 30, 0, 0, 0,155, 3, 0, 0,156, 3, 0, 0,157, 3, 0, 0, 74, 0, 4, 0, 27, 0, 7, 0,158, 3,
+ 7, 0,159, 3, 7, 0,160, 3, 7, 0,161, 3, 7, 0,162, 3, 7, 0,163, 3, 29, 0,164, 3, 31, 0, 80, 0, 33, 0, 73, 2,
+ 90, 0,126, 2, 0, 0, 70, 0, 7, 0,165, 3, 7, 0,166, 3,172, 0,167, 3,174, 0, 5, 0,174, 0, 0, 0,174, 0, 1, 0,
+ 0, 0, 19, 0, 0, 0, 18, 0, 0, 0,124, 0, 68, 0, 3, 0, 7, 0,168, 3, 4, 0, 18, 0, 4, 0, 27, 0, 27, 0,128, 0,
+ 22, 0, 32, 0, 34, 0, 75, 0,175, 0,169, 3, 2, 0, 16, 0, 2, 0,170, 3, 4, 0,171, 3, 4, 0,172, 3, 4, 0,173, 3,
+ 0, 0,174, 3, 27, 0, 38, 0, 27, 0,175, 3, 27, 0,176, 3, 27, 0,177, 3, 27, 0,178, 3, 31, 0, 80, 0, 68, 0, 15, 2,
+176, 0,179, 3,176, 0,180, 3,177, 0,181, 3, 11, 0, 2, 0,178, 0,182, 3,179, 0,183, 3,180, 0,184, 3, 14, 0,185, 3,
+ 14, 0,186, 3, 14, 0, 28, 2, 14, 0,187, 3, 14, 0,188, 3, 4, 0, 87, 1, 4, 0,189, 3, 63, 0, 30, 2, 0, 0,190, 3,
+ 4, 0, 32, 2, 4, 0,191, 3, 7, 0, 77, 1, 7, 0,192, 3, 7, 0,193, 3, 7, 0,176, 0, 7, 0,194, 3, 7, 0,195, 3,
+ 7, 0, 78, 1, 7, 0,196, 3, 7, 0, 18, 2, 7, 0,197, 3, 7, 0,198, 3, 7, 0,199, 3, 7, 0,200, 3, 7, 0,201, 3,
+ 7, 0,202, 3, 7, 0, 12, 3, 7, 0,203, 3, 7, 0,244, 0, 7, 0,204, 3, 4, 0,205, 3, 4, 0,206, 3, 2, 0, 18, 0,
+ 2, 0,207, 3, 2, 0,208, 3, 2, 0,209, 3, 2, 0,210, 3, 2, 0,211, 3, 2, 0,212, 3, 2, 0,213, 3, 2, 0,214, 3,
+ 0, 0,215, 3, 0, 0,216, 3, 4, 0,217, 3, 4, 0,218, 3, 4, 0,219, 3, 4, 0,220, 3, 7, 0,221, 3, 7, 0,108, 2,
+ 7, 0,222, 3, 7, 0,223, 3, 7, 0,224, 3, 7, 0,225, 3, 7, 0,226, 3, 7, 0,220, 0, 7, 0,227, 3, 7, 0,228, 3,
+ 7, 0,229, 3, 7, 0,230, 3, 7, 0,231, 3, 2, 0,232, 3, 0, 0,233, 3, 0, 0,234, 3, 0, 0,235, 3, 0, 0,236, 3,
+ 0, 0,110, 0, 0, 0,237, 3, 7, 0,238, 3, 7, 0,239, 3, 14, 0,240, 3, 14, 0,241, 3, 14, 0,242, 3, 14, 0,243, 3,
+ 7, 0,244, 3, 2, 0, 13, 2, 2, 0,245, 3, 7, 0,151, 2, 4, 0,246, 3, 4, 0,247, 3,181, 0,248, 3, 2, 0,249, 3,
+ 2, 0,251, 0, 7, 0,250, 3, 14, 0,251, 3, 14, 0,252, 3, 14, 0,253, 3, 14, 0,254, 3,182, 0, 73, 1,183, 0,255, 3,
+ 64, 0, 0, 4, 0, 0, 1, 4, 0, 0, 2, 4, 2, 0, 66, 2, 7, 0,143, 2,155, 0, 3, 4,143, 0, 4, 4,143, 0, 5, 4,
+ 10, 0, 6, 4, 10, 0, 7, 4, 4, 0, 8, 4, 4, 0, 9, 4, 14, 0, 10, 4, 14, 0, 11, 4, 14, 0, 12, 4, 7, 0, 13, 4,
+184, 0, 14, 0,184, 0, 0, 0,184, 0, 1, 0, 27, 0, 38, 0, 7, 0, 12, 3, 7, 0, 79, 1, 7, 0, 13, 3, 7, 0, 5, 3,
+ 0, 0, 19, 0, 4, 0, 14, 3, 4, 0, 15, 3, 4, 0, 14, 4, 2, 0, 16, 0, 2, 0, 15, 4, 7, 0, 16, 3,185, 0, 12, 0,
+185, 0, 0, 0,185, 0, 1, 0, 27, 0, 44, 0, 4, 0, 16, 4, 4, 0, 13, 2, 7, 0, 79, 1, 7, 0, 17, 4, 7, 0, 18, 4,
+ 7, 0,170, 2, 2, 0, 16, 0, 0, 0, 19, 4, 0, 0, 20, 4,182, 0, 40, 0, 4, 0, 18, 0, 2, 0, 21, 4, 2, 0, 22, 4,
+ 2, 0, 5, 3, 2, 0, 23, 4, 2, 0, 24, 4, 2, 0, 25, 4, 2, 0, 26, 4, 2, 0, 27, 4, 7, 0, 28, 4, 7, 0, 29, 4,
+ 7, 0, 30, 4, 7, 0, 31, 4, 7, 0, 32, 4, 7, 0, 33, 4, 7, 0, 34, 4, 7, 0, 35, 4, 7, 0, 36, 4, 7, 0, 37, 4,
+ 7, 0, 38, 4, 7, 0, 39, 4, 7, 0, 40, 4, 7, 0, 41, 4, 7, 0, 42, 4, 7, 0, 43, 4, 7, 0, 44, 4, 7, 0, 45, 4,
+ 7, 0, 46, 4, 7, 0, 47, 4, 7, 0, 48, 4, 7, 0, 49, 4, 7, 0, 50, 4, 7, 0, 51, 4, 7, 0, 52, 4, 7, 0, 53, 4,
+ 7, 0, 54, 4, 47, 0,169, 0,186, 0, 55, 4, 7, 0, 56, 4, 4, 0,214, 2,187, 0, 5, 0, 64, 0,249, 1, 7, 0, 57, 4,
+ 7, 0, 58, 4, 2, 0, 18, 0, 2, 0, 59, 4,188, 0, 5, 0,188, 0, 0, 0,188, 0, 1, 0, 4, 0, 16, 0, 4, 0, 60, 4,
+ 11, 0, 2, 0,189, 0, 9, 0,189, 0, 0, 0,189, 0, 1, 0, 4, 0, 61, 4, 4, 0, 62, 4, 4, 0, 63, 4, 4, 0, 18, 0,
+ 11, 0, 64, 4, 11, 0, 65, 4, 14, 0, 66, 4,139, 0, 23, 0,139, 0, 0, 0,139, 0, 1, 0, 4, 0, 18, 0, 4, 0, 67, 4,
+ 4, 0, 68, 4, 4, 0, 69, 4, 4, 0, 70, 4, 4, 0, 71, 4, 4, 0, 72, 4, 4, 0, 73, 4, 4, 0, 27, 0, 4, 0, 62, 4,
+ 4, 0, 13, 2, 2, 0, 74, 4, 2, 0, 56, 0, 0, 0, 19, 0, 0, 0, 75, 4, 0, 0, 76, 4, 0, 0, 77, 4, 0, 0, 78, 4,
+ 14, 0, 79, 4,190, 0, 80, 4, 11, 0, 81, 4,191, 0, 1, 0, 7, 0, 46, 2,181, 0, 30, 0, 4, 0, 18, 0, 7, 0, 82, 4,
+ 7, 0, 83, 4, 7, 0, 84, 4, 4, 0, 85, 4, 4, 0, 86, 4, 4, 0, 87, 4, 4, 0, 88, 4, 7, 0, 89, 4, 7, 0, 90, 4,
+ 7, 0, 91, 4, 7, 0, 92, 4, 7, 0, 93, 4, 7, 0, 94, 4, 7, 0, 95, 4, 7, 0, 96, 4, 7, 0, 97, 4, 7, 0, 98, 4,
+ 7, 0, 99, 4, 7, 0,100, 4, 7, 0,101, 4, 7, 0,102, 4, 7, 0,103, 4, 7, 0,104, 4, 7, 0,105, 4, 7, 0,106, 4,
+ 4, 0,107, 4, 4, 0,108, 4, 7, 0,109, 4, 7, 0,227, 3,183, 0, 54, 0, 4, 0, 62, 4, 4, 0,110, 4,192, 0,111, 4,
+193, 0,112, 4, 0, 0, 27, 0, 0, 0,113, 4, 2, 0,114, 4, 7, 0,115, 4, 0, 0,116, 4, 7, 0,117, 4, 7, 0,118, 4,
+ 7, 0,119, 4, 7, 0,120, 4, 7, 0,121, 4, 7, 0,122, 4, 7, 0,123, 4, 7, 0,124, 4, 7, 0,125, 4, 2, 0,126, 4,
+ 0, 0,127, 4, 2, 0,128, 4, 7, 0,129, 4, 7, 0,130, 4, 0, 0,131, 4, 4, 0,129, 0, 4, 0,132, 4, 4, 0,133, 4,
+ 2, 0,134, 4, 2, 0,135, 4,191, 0,136, 4, 4, 0,137, 4, 4, 0, 82, 0, 7, 0,138, 4, 7, 0,139, 4, 7, 0,140, 4,
+ 7, 0,141, 4, 2, 0,142, 4, 2, 0,143, 4, 2, 0,144, 4, 2, 0,145, 4, 2, 0,146, 4, 2, 0,147, 4, 2, 0,148, 4,
+ 2, 0,149, 4,194, 0,150, 4, 7, 0,151, 4, 7, 0,152, 4,139, 0,153, 4, 14, 0, 21, 3,187, 0,154, 4, 7, 0,155, 4,
+ 7, 0,156, 4, 7, 0,157, 4, 4, 0,158, 4,195, 0, 1, 0, 7, 0,159, 4,155, 0, 52, 0,154, 0,160, 4, 2, 0, 16, 0,
+ 2, 0,161, 4, 2, 0,162, 4, 2, 0,163, 4, 7, 0,164, 4, 2, 0,165, 4, 2, 0,166, 4, 7, 0,167, 4, 2, 0,168, 4,
+ 2, 0,169, 4, 7, 0,170, 4, 7, 0,171, 4, 7, 0,172, 4, 4, 0,173, 4, 4, 0,174, 4, 4, 0,175, 4, 4, 0, 27, 0,
+ 7, 0,176, 4, 4, 0,177, 4, 7, 0,178, 4, 7, 0,179, 4, 7, 0,180, 4, 79, 0,181, 4, 79, 0,182, 4, 0, 0,183, 4,
+ 7, 0,184, 4, 7, 0,185, 4, 31, 0, 80, 0, 2, 0,186, 4, 0, 0,187, 4, 0, 0,188, 4, 7, 0,189, 4, 4, 0,190, 4,
+ 7, 0,191, 4, 7, 0,192, 4, 4, 0,193, 4, 4, 0, 18, 0, 7, 0,194, 4, 7, 0,195, 4, 7, 0,196, 4,195, 0,197, 4,
+ 4, 0, 53, 0, 7, 0,198, 4, 7, 0,199, 4, 7, 0,200, 4, 7, 0,201, 4, 7, 0,202, 4, 7, 0,203, 4, 7, 0,204, 4,
+ 4, 0,205, 4, 7, 0,206, 4,196, 0, 78, 0, 22, 0, 32, 0, 34, 0, 75, 0, 2, 0,179, 0, 2, 0, 88, 1, 2, 0,122, 1,
+ 2, 0,207, 4, 7, 0,208, 4, 7, 0,209, 4, 7, 0,210, 4, 7, 0,211, 4, 7, 0,212, 4, 7, 0,213, 4, 7, 0,170, 1,
+ 7, 0,172, 1, 7, 0,171, 1, 7, 0, 30, 0, 4, 0,214, 4, 7, 0,215, 4, 7, 0,216, 4, 7, 0,217, 4, 7, 0,218, 4,
+ 7, 0,219, 4, 7, 0,220, 4, 7, 0,221, 4, 2, 0,222, 4, 2, 0, 87, 1, 2, 0,223, 4, 2, 0,224, 4, 2, 0,225, 4,
+ 2, 0,226, 4, 2, 0,227, 4, 2, 0,228, 4, 7, 0,229, 4, 7, 0,230, 4, 7, 0,231, 4, 7, 0,232, 4, 7, 0,233, 4,
+ 7, 0,234, 4, 7, 0,235, 4, 7, 0,236, 4, 7, 0,237, 4, 7, 0,238, 4, 7, 0,239, 4, 7, 0,240, 4, 2, 0,241, 4,
+ 2, 0,242, 4, 2, 0,243, 4, 2, 0,244, 4, 7, 0,245, 4, 7, 0,246, 4, 7, 0,247, 4, 7, 0,248, 4, 2, 0,249, 4,
+ 2, 0,250, 4, 2, 0,251, 4, 2, 0,252, 4, 7, 0,253, 4, 7, 0,254, 4, 7, 0,255, 4, 7, 0, 0, 5, 7, 0, 1, 5,
+ 7, 0, 2, 5, 7, 0, 3, 5, 2, 0, 4, 5, 2, 0, 5, 5, 2, 0, 6, 5, 2, 0, 7, 5, 2, 0, 8, 5, 2, 0, 18, 0,
+ 7, 0, 9, 5, 7, 0, 10, 5, 31, 0, 80, 0, 46, 0,140, 1, 2, 0,141, 1, 2, 0, 76, 1, 2, 0,181, 2, 25, 0,154, 0,
+ 57, 0, 70, 1,197, 0, 8, 0,197, 0, 0, 0,197, 0, 1, 0, 4, 0,205, 3, 4, 0, 11, 5, 4, 0, 18, 0, 2, 0, 12, 5,
+ 2, 0, 13, 5, 27, 0,168, 0,198, 0, 13, 0, 11, 0, 14, 5, 11, 0, 15, 5, 4, 0, 16, 5, 4, 0, 17, 5, 4, 0, 18, 5,
+ 4, 0, 19, 5, 4, 0, 20, 5, 4, 0, 21, 5, 4, 0, 22, 5, 4, 0, 23, 5, 4, 0, 24, 5, 4, 0, 27, 0, 0, 0, 25, 5,
+199, 0, 5, 0, 11, 0, 26, 5, 11, 0, 27, 5, 4, 0, 28, 5, 4, 0, 30, 0, 0, 0, 29, 5,200, 0, 17, 0, 4, 0, 30, 5,
+ 4, 0, 31, 5, 4, 0, 32, 5, 4, 0, 33, 5, 4, 0, 34, 5, 4, 0, 35, 5, 4, 0, 36, 5, 4, 0, 37, 5, 4, 0, 38, 5,
+ 4, 0, 39, 5, 4, 0, 40, 5, 4, 0, 41, 5, 2, 0, 42, 5, 2, 0, 43, 5, 4, 0, 44, 5, 4, 0, 45, 5, 4, 0, 91, 0,
+201, 0, 17, 0, 4, 0, 16, 0, 4, 0, 32, 5, 4, 0, 46, 5, 4, 0, 47, 5, 4, 0, 48, 5, 4, 0, 49, 5, 4, 0, 50, 5,
+ 4, 0, 51, 5, 7, 0, 52, 5, 4, 0, 53, 5, 4, 0, 92, 0, 4, 0, 54, 5, 4, 0, 55, 5, 4, 0, 56, 5, 4, 0, 57, 5,
+ 4, 0, 58, 5, 21, 0, 31, 0,202, 0, 9, 0, 4, 0, 59, 5, 7, 0, 60, 5, 7, 0, 61, 5, 7, 0, 62, 5, 4, 0, 63, 5,
+ 2, 0, 18, 0, 2, 0, 27, 0, 7, 0, 84, 4, 7, 0, 30, 0,203, 0, 11, 0,203, 0, 0, 0,203, 0, 1, 0, 0, 0, 19, 0,
+ 63, 0, 64, 5, 64, 0, 65, 5, 4, 0,205, 3, 4, 0, 66, 5, 4, 0, 67, 5, 4, 0, 27, 0, 4, 0, 68, 5, 4, 0, 69, 5,
+204, 0, 13, 0, 0, 0, 70, 5, 0, 0,250, 0, 0, 0, 71, 5, 0, 0, 18, 0, 0, 0, 72, 5, 0, 0, 73, 5, 0, 0, 74, 5,
+ 0, 0, 75, 5, 2, 0, 76, 5, 2, 0, 77, 5, 7, 0, 78, 5, 0, 0, 79, 5, 0, 0,124, 0,205, 0,106, 0,204, 0, 80, 5,
+198, 0, 81, 5,199, 0, 82, 5,200, 0, 83, 5,201, 0, 84, 5, 4, 0, 36, 3, 4, 0,129, 0, 4, 0,132, 4, 7, 0, 85, 5,
+ 4, 0, 86, 5, 4, 0, 87, 5, 4, 0, 88, 5, 4, 0, 89, 5, 2, 0, 18, 0, 2, 0, 90, 5, 7, 0, 91, 5, 7, 0, 92, 5,
+ 7, 0, 93, 5, 7, 0, 94, 5, 7, 0, 95, 5, 2, 0, 96, 5, 2, 0, 97, 5, 2, 0, 98, 5, 2, 0, 99, 5, 2, 0,250, 0,
+ 2, 0,100, 5, 4, 0,101, 5, 2, 0,102, 5, 2, 0,103, 5, 2, 0,109, 1, 2, 0,108, 0, 2, 0,104, 5, 2, 0,105, 5,
+ 2, 0,106, 5, 2, 0,107, 5, 2, 0,108, 5, 2, 0, 71, 5, 2, 0, 70, 5, 2, 0,109, 5, 2, 0, 72, 5, 2, 0,110, 5,
+ 4, 0,111, 5, 4, 0, 87, 1, 4, 0,112, 5, 2, 0,113, 5, 2, 0, 91, 0, 2, 0,114, 5, 2, 0,115, 5, 2, 0,116, 5,
+ 2, 0,117, 5, 2, 0,118, 5, 2, 0,119, 5, 19, 0,120, 5, 19, 0,121, 5, 18, 0,122, 5, 14, 0,123, 5, 2, 0,124, 5,
+ 2, 0,125, 5, 7, 0,126, 5, 7, 0,127, 5, 7, 0,128, 5, 7, 0,129, 5, 4, 0,130, 5, 7, 0,131, 5, 7, 0,132, 5,
+ 7, 0,133, 5, 7, 0,134, 5, 2, 0,135, 5, 2, 0,136, 5, 2, 0,137, 5, 2, 0,138, 5, 2, 0,139, 5, 2, 0,140, 5,
+ 7, 0,141, 5, 7, 0,142, 5, 7, 0,143, 5, 0, 0,144, 5, 4, 0,145, 5, 2, 0,146, 5, 2, 0, 74, 0, 0, 0,147, 5,
+ 7, 0,148, 5, 7, 0,149, 5, 0, 0,150, 5, 0, 0,151, 5, 0, 0,152, 5, 0, 0,153, 5, 4, 0,154, 5, 2, 0,155, 5,
+ 2, 0,156, 5, 7, 0,157, 5, 7, 0,158, 5, 2, 0,159, 5, 2, 0,160, 5, 7, 0,161, 5, 2, 0,162, 5, 2, 0,163, 5,
+ 4, 0,164, 5, 2, 0,165, 5, 2, 0,166, 5, 2, 0,167, 5, 2, 0,168, 5, 7, 0,169, 5, 7, 0, 30, 0, 37, 0,170, 5,
+ 0, 0,171, 5,206, 0, 9, 0,206, 0, 0, 0,206, 0, 1, 0, 0, 0,172, 5, 2, 0,173, 5, 2, 0,174, 5, 2, 0,175, 5,
+ 2, 0, 91, 0, 7, 0,176, 5, 7, 0, 30, 0,207, 0, 7, 0, 2, 0,231, 2, 2, 0, 87, 1, 2, 0, 94, 3, 2, 0,177, 5,
+ 7, 0,178, 5, 7, 0, 30, 0, 37, 0,179, 5,208, 0, 5, 0, 7, 0,180, 5, 0, 0, 16, 0, 0, 0, 91, 0, 0, 0, 30, 0,
+ 0, 0, 74, 0,209, 0, 15, 0, 7, 0,181, 5, 7, 0,182, 5, 7, 0,183, 5, 7, 0,184, 5, 7, 0,185, 5, 7, 0,186, 5,
+ 7, 0,187, 5, 7, 0,188, 5, 7, 0,189, 5, 7, 0,190, 5, 4, 0,191, 5, 7, 0,192, 5, 7, 0,193, 5, 2, 0, 91, 0,
+ 2, 0, 30, 0,210, 0, 32, 0,208, 0,194, 5, 2, 0,195, 5, 2, 0, 97, 5, 2, 0, 98, 5, 2, 0, 99, 5, 2, 0,250, 0,
+ 2, 0,100, 5, 2, 0,196, 5, 2, 0,197, 5, 2, 0,198, 5, 2, 0,199, 5,207, 0,200, 5, 2, 0,201, 5, 2, 0,102, 5,
+ 7, 0,202, 5,209, 0,203, 5, 7, 0,220, 4, 7, 0,221, 4, 4, 0, 18, 0, 2, 0, 87, 1, 2, 0,204, 5, 2, 0,223, 4,
+ 2, 0,224, 4, 2, 0,205, 5, 2, 0, 27, 0, 2, 0,225, 4, 2, 0,226, 4, 2, 0,227, 4, 2, 0,228, 4, 2, 0,206, 5,
+ 2, 0, 91, 0, 7, 0,207, 5,211, 0, 6, 0,211, 0, 0, 0,211, 0, 1, 0, 4, 0, 61, 4, 0, 0, 19, 0, 4, 0, 18, 0,
+ 27, 0,208, 5,212, 0, 4, 0,213, 0,146, 3, 11, 0,209, 5, 0, 0,210, 5, 4, 0, 92, 0,214, 0, 8, 0,212, 0,211, 5,
+ 2, 0, 18, 0, 2, 0, 27, 0, 2, 0,212, 5, 2, 0,213, 5, 2, 0,214, 5, 4, 0, 91, 0, 11, 0,215, 5,215, 0, 6, 0,
+ 2, 0,108, 0, 2, 0, 67, 4, 2, 0,216, 5, 2, 0,225, 2, 4, 0, 18, 0, 7, 0,209, 2,216, 0, 14, 0, 2, 0, 18, 0,
+ 2, 0,217, 5, 2, 0,218, 5, 2, 0,219, 5,215, 0,220, 5, 11, 0,215, 5, 7, 0,221, 5, 7, 0, 56, 0, 4, 0,222, 5,
+ 4, 0,223, 5, 4, 0,224, 5, 4, 0,225, 5, 41, 0,125, 0, 27, 0,168, 0,217, 0, 14, 0,212, 0,211, 5, 4, 0, 92, 0,
+ 4, 0,226, 5, 7, 0,227, 5, 7, 0,228, 5, 7, 0,229, 5, 4, 0,230, 5, 4, 0,231, 5, 7, 0,232, 5, 7, 0,233, 5,
+ 4, 0,234, 5, 7, 0,235, 5, 7, 0,236, 5, 4, 0, 27, 0,218, 0, 1, 0,212, 0,211, 5,219, 0, 7, 0,212, 0,211, 5,
+ 2, 0, 18, 0, 2, 0, 27, 0, 4, 0, 37, 0, 4, 0,237, 5, 90, 0,238, 5, 11, 0,215, 5,220, 0, 5, 0,220, 0, 0, 0,
+220, 0, 1, 0, 0, 0, 19, 0, 7, 0,239, 5, 4, 0, 27, 0,221, 0, 4, 0, 4, 0,108, 0, 7, 0,240, 5, 7, 0,178, 1,
+ 4, 0, 18, 0,222, 0, 85, 0,219, 0,241, 5,219, 0,242, 5,217, 0,169, 3,218, 0,243, 5, 7, 0,244, 5, 2, 0,245, 5,
+ 2, 0,246, 5, 7, 0,247, 5, 7, 0,248, 5, 2, 0, 67, 4, 2, 0,249, 5, 7, 0,250, 5, 7, 0,251, 5, 7, 0,252, 5,
+ 2, 0,253, 5, 2, 0,222, 5, 2, 0,254, 5, 2, 0,255, 5, 2, 0, 0, 6, 2, 0, 1, 6, 7, 0, 2, 6, 7, 0, 3, 6,
+ 7, 0, 4, 6, 2, 0, 5, 6, 2, 0, 6, 6, 2, 0, 7, 6, 2, 0, 8, 6, 2, 0, 9, 6, 2, 0, 10, 6, 2, 0, 11, 6,
+ 2, 0, 12, 6,214, 0, 13, 6,216, 0, 14, 6, 7, 0, 15, 6, 7, 0, 16, 6, 7, 0, 17, 6, 2, 0, 18, 6, 2, 0, 19, 6,
+ 0, 0, 20, 6, 0, 0, 21, 6, 2, 0, 22, 6, 7, 0, 23, 6, 7, 0, 24, 6, 7, 0, 25, 6, 7, 0, 26, 6, 7, 0, 27, 6,
+ 7, 0, 28, 6, 7, 0, 29, 6, 7, 0, 30, 6, 7, 0, 31, 6, 7, 0, 32, 6, 2, 0, 33, 6, 0, 0, 34, 6, 0, 0, 35, 6,
+ 0, 0, 36, 6, 0, 0, 37, 6, 27, 0, 38, 6, 0, 0, 39, 6, 0, 0, 40, 6, 0, 0, 41, 6, 0, 0, 42, 6, 0, 0, 43, 6,
+ 0, 0, 44, 6, 0, 0, 45, 6, 0, 0, 46, 6, 0, 0, 47, 6, 0, 0, 48, 6, 2, 0, 49, 6, 2, 0, 50, 6, 2, 0, 51, 6,
+ 2, 0, 52, 6, 0, 0, 53, 6, 0, 0, 54, 6, 0, 0, 55, 6, 0, 0, 56, 6, 4, 0, 57, 6, 4, 0, 58, 6, 4, 0, 59, 6,
+ 4, 0, 60, 6, 2, 0, 61, 6, 2, 0, 91, 0, 4, 0, 62, 6, 7, 0, 63, 6, 7, 0, 64, 6,221, 0, 65, 6,223, 0, 8, 0,
+ 4, 0, 66, 6, 4, 0, 67, 6, 4, 0, 68, 6, 4, 0, 69, 6, 4, 0, 70, 6, 4, 0, 71, 6, 4, 0, 53, 0, 4, 0,138, 2,
+224, 0, 4, 0, 7, 0, 72, 6, 0, 0, 73, 6, 0, 0, 74, 6, 2, 0, 18, 0,225, 0, 4, 0, 7, 0, 75, 6, 4, 0, 18, 0,
+ 4, 0, 76, 6, 4, 0, 56, 0, 41, 0, 46, 0, 22, 0, 32, 0, 34, 0, 75, 0, 27, 0,208, 5,196, 0, 77, 6, 41, 0, 78, 6,
+ 14, 0, 79, 6,197, 0, 80, 6, 27, 0, 81, 6, 7, 0, 82, 6, 7, 0, 83, 6, 7, 0, 84, 6, 7, 0, 85, 6, 4, 0,205, 3,
+ 4, 0, 86, 6, 4, 0, 87, 6, 2, 0, 18, 0, 2, 0, 76, 1, 57, 0, 70, 1,226, 0, 88, 6,222, 0, 89, 6,227, 0, 90, 6,
+205, 0,185, 0,202, 0, 91, 6, 14, 0,102, 0, 14, 0, 92, 6, 11, 0, 93, 6, 11, 0, 94, 6, 11, 0, 95, 6, 11, 0, 96, 6,
+ 11, 0, 97, 6,228, 0, 98, 6, 2, 0, 99, 6, 2, 0,100, 6, 2, 0,251, 0, 2, 0,206, 3, 4, 0,216, 3, 4, 0,101, 6,
+ 14, 0,102, 6,208, 0,194, 5,210, 0,103, 6,224, 0,104, 6,178, 0,182, 3,225, 0,105, 6,229, 0,106, 6, 10, 0, 7, 4,
+ 10, 0,107, 6,230, 0, 14, 0,230, 0, 0, 0,230, 0, 1, 0, 42, 0,242, 0, 40, 0, 69, 1,229, 0,106, 6,231, 0,108, 6,
+ 7, 0, 96, 2, 7, 0, 97, 2, 7, 0,108, 0, 7, 0,109, 6, 2, 0,110, 6, 2, 0, 18, 0, 2, 0,143, 0, 2, 0, 27, 0,
+232, 0, 39, 0, 7, 0,111, 6, 7, 0,112, 6, 7, 0,113, 6, 7, 0,114, 6, 7, 0,115, 6, 7, 0,116, 6, 7, 0,117, 6,
+ 7, 0,118, 6, 7, 0,119, 6, 68, 0,120, 6,178, 0,182, 3,232, 0,121, 6,233, 0,122, 6,234, 0,123, 6,235, 0,124, 6,
+236, 0,125, 6,237, 0,126, 6, 7, 0,127, 6, 7, 0,128, 6, 7, 0, 94, 1, 7, 0,129, 6, 7, 0,130, 6, 7, 0,131, 6,
+ 7, 0,132, 6, 7, 0,175, 0, 7, 0,133, 6, 0, 0,134, 6, 0, 0,135, 6, 0, 0,110, 6, 0, 0,136, 6, 2, 0,137, 6,
+ 2, 0,138, 6, 7, 0,139, 6, 2, 0,140, 6, 2, 0,141, 6, 7, 0,142, 6, 7, 0,143, 6, 7, 0,144, 6, 7, 0,145, 6,
+238, 0, 51, 0,239, 0, 0, 0,239, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6, 7, 0,128, 6,
+ 7, 0, 94, 1, 7, 0,150, 6, 2, 0,151, 6, 0, 0,211, 2, 4, 0,152, 6, 2, 0,135, 6, 2, 0,110, 6, 27, 0,208, 5,
+ 27, 0,153, 6, 14, 0,154, 6,230, 0,155, 6,238, 0,121, 6, 0, 0,156, 6, 4, 0,205, 3, 4, 0, 86, 6, 2, 0,157, 6,
+ 2, 0,158, 6, 2, 0,159, 6, 2, 0,160, 6, 2, 0, 18, 0, 2, 0, 31, 2, 7, 0,114, 0, 7, 0,161, 6, 7, 0,162, 6,
+ 7, 0,163, 6, 7, 0,175, 0, 7, 0, 82, 6, 2, 0,164, 6, 2, 0,165, 6, 2, 0,166, 6, 0, 0,167, 6, 0, 0,168, 6,
+ 0, 0,169, 6, 0, 0,170, 6, 0, 0,171, 6, 14, 0,172, 6, 14, 0,173, 6, 14, 0,174, 6, 2, 0,175, 6, 2, 0,152, 2,
+ 2, 0,176, 6, 0, 0,177, 6, 11, 0,178, 6,178, 0,182, 3,240, 0, 24, 0, 19, 0, 37, 0, 19, 0, 63, 0, 18, 0,179, 6,
+ 18, 0,180, 6, 18, 0,181, 6, 7, 0,182, 6, 7, 0,183, 6, 7, 0,184, 6, 7, 0,185, 6, 2, 0,186, 6, 2, 0,187, 6,
+ 2, 0,188, 6, 2, 0,189, 6, 2, 0,190, 6, 2, 0, 18, 0, 2, 0,191, 6, 2, 0,192, 6, 2, 0,193, 6, 2, 0,194, 6,
+ 2, 0,195, 6, 2, 0,160, 6, 7, 0,196, 6, 4, 0,197, 6, 4, 0,198, 6,239, 0, 6, 0,239, 0, 0, 0,239, 0, 1, 0,
+ 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6,241, 0, 8, 0,239, 0, 0, 0,239, 0, 1, 0, 14, 0,146, 6,
+ 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6, 0, 0,199, 6, 0, 0,124, 0,242, 0, 14, 0,239, 0, 0, 0,239, 0, 1, 0,
+ 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6,240, 0,200, 6,243, 0,201, 6, 14, 0,202, 6, 2, 0, 87, 1,
+ 2, 0,203, 6, 4, 0, 18, 0, 7, 0,204, 6, 4, 0,160, 6,244, 0, 21, 0,239, 0, 0, 0,239, 0, 1, 0, 14, 0,146, 6,
+ 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6,240, 0,200, 6, 2, 0,205, 6, 2, 0,206, 6, 2, 0,207, 6, 2, 0,208, 6,
+ 2, 0,191, 6, 2, 0,209, 6, 2, 0,210, 6, 0, 0, 18, 0, 0, 0, 27, 0, 11, 0, 72, 2, 4, 0,211, 6, 4, 0,212, 6,
+ 22, 0,213, 6, 11, 0,214, 6,245, 0, 18, 0,239, 0, 0, 0,239, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6,
+ 2, 0,149, 6,240, 0,200, 6, 7, 0, 96, 2, 7, 0, 97, 2, 2, 0,205, 6, 2, 0,215, 6, 2, 0,216, 6, 2, 0,217, 6,
+ 4, 0, 18, 0, 7, 0,218, 6, 4, 0,110, 6, 4, 0, 27, 0,178, 0,182, 3,246, 0, 16, 0, 0, 0,219, 6, 0, 0,220, 6,
+ 0, 0,221, 6, 0, 0,222, 6, 0, 0,223, 6, 0, 0,224, 6, 4, 0,225, 6, 4, 0,226, 6, 4, 0,227, 6, 2, 0, 16, 0,
+ 2, 0, 18, 0, 2, 0,228, 6, 2, 0,229, 6, 2, 0,190, 1, 2, 0,230, 6, 0, 0,231, 6,247, 0, 16, 0,239, 0, 0, 0,
+239, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 4, 0,232, 6,246, 0,233, 6,248, 0,234, 6, 14, 0,235, 6, 14, 0,236, 6,
+249, 0,237, 6,237, 0,238, 6,250, 0,239, 6, 2, 0,240, 6, 2, 0,241, 6, 2, 0,242, 6, 2, 0, 30, 0,251, 0, 15, 0,
+239, 0, 0, 0,239, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6,240, 0,200, 6, 14, 0,243, 6,
+252, 0,244, 6, 0, 0,245, 6,253, 0,246, 6, 2, 0, 18, 0, 2, 0,247, 6, 2, 0,248, 6, 2, 0,249, 6,254, 0, 25, 0,
+239, 0, 0, 0,239, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 4, 0, 18, 0, 42, 0,244, 2, 40, 0, 69, 1, 54, 0,250, 6,
+255, 0,251, 6, 0, 1,252, 6,178, 0,182, 3, 7, 0,253, 6, 7, 0, 96, 2, 7, 0, 97, 2, 7, 0,218, 6, 7, 0,254, 6,
+ 7, 0,255, 6, 2, 0, 0, 7, 2, 0, 27, 0, 2, 0, 1, 7, 2, 0, 2, 7, 0, 0, 3, 7, 0, 0, 4, 7, 0, 0, 5, 7,
+ 0, 0,160, 6, 1, 1, 11, 0,239, 0, 0, 0,239, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6,
+ 2, 0,203, 6, 2, 0, 18, 0, 4, 0, 27, 0,243, 0,201, 6,240, 0,200, 6, 2, 1, 31, 0,239, 0, 0, 0,239, 0, 1, 0,
+ 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6, 37, 0, 6, 7, 4, 0, 7, 7, 4, 0, 8, 7, 2, 0, 92, 0,
+ 2, 0, 9, 7, 2, 0, 10, 7, 0, 0, 11, 7, 0, 0, 12, 7, 4, 0, 13, 7, 4, 0, 14, 7, 4, 0, 15, 7, 2, 0, 16, 7,
+ 2, 0, 17, 7, 2, 0, 18, 7, 2, 0, 19, 7, 7, 0, 20, 7, 18, 0, 21, 7, 18, 0, 22, 7, 4, 0, 23, 7, 4, 0, 24, 7,
+ 0, 0, 25, 7, 0, 0, 26, 7, 2, 0, 27, 7, 0, 0,211, 2, 11, 0, 28, 7, 3, 1, 10, 0, 22, 0, 32, 0, 11, 0, 29, 7,
+ 11, 0, 30, 7, 11, 0, 31, 7, 11, 0, 32, 7, 11, 0, 33, 7, 4, 0, 92, 0, 4, 0, 34, 7, 0, 0, 35, 7, 0, 0, 36, 7,
+ 4, 1, 10, 0,239, 0, 0, 0,239, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 3, 1, 37, 7, 2, 0, 92, 0,
+ 2, 0, 9, 7, 4, 0, 91, 0, 11, 0, 38, 7, 5, 1, 3, 0, 5, 1, 0, 0, 5, 1, 1, 0, 7, 0, 39, 7, 6, 1, 9, 0,
+239, 0, 0, 0,239, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6,240, 0,200, 6, 14, 0, 40, 7, 4, 0, 41, 7,
+ 4, 0, 18, 0, 7, 1, 27, 0,239, 0, 0, 0,239, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6,
+240, 0,200, 6, 22, 0, 42, 7, 22, 0, 81, 0, 2, 0, 18, 0, 2, 0, 91, 0, 7, 0, 43, 7, 7, 0, 96, 2, 7, 0, 97, 2,
+ 7, 0,218, 6, 7, 0, 44, 7, 7, 0, 45, 7, 7, 0, 46, 7, 57, 0, 70, 1, 57, 0, 47, 7, 4, 0, 48, 7, 2, 0, 49, 7,
+ 2, 0, 50, 7, 2, 0,251, 0, 2, 0, 86, 1, 14, 0, 51, 7,178, 0,182, 3, 8, 1, 10, 0,239, 0, 0, 0,239, 0, 1, 0,
+ 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6, 2, 0, 18, 0, 2, 0,214, 3, 4, 0, 27, 0,178, 0,182, 3,
+ 9, 1, 7, 0, 9, 1, 0, 0, 9, 1, 1, 0, 4, 0, 52, 7, 4, 0, 22, 0, 0, 0, 85, 0, 4, 0, 53, 7, 4, 0, 16, 0,
+ 10, 1, 14, 0,239, 0, 0, 0,239, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6, 4, 0, 10, 7,
+ 4, 0, 27, 0, 14, 0, 54, 7, 14, 0, 55, 7, 0, 0, 56, 7, 0, 0, 57, 7, 4, 0, 58, 7, 4, 0, 59, 7, 11, 1, 6, 0,
+239, 0, 0, 0,239, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 4, 0, 27, 0, 0, 0, 60, 7, 12, 1, 24, 0,239, 0, 0, 0,
+239, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0, 96, 2, 7, 0, 97, 2, 7, 0, 61, 7, 7, 0, 62, 7, 7, 0,218, 6,
+231, 0, 63, 7,229, 0,106, 6, 13, 1,251, 6, 4, 0, 18, 0, 2, 0, 87, 1, 2, 0,110, 6, 4, 0, 64, 7, 7, 0, 65, 7,
+ 7, 0,148, 3, 7, 0, 94, 3, 4, 0, 27, 0, 7, 0, 66, 7, 7, 0, 67, 7, 4, 0, 68, 7, 4, 0, 69, 7, 14, 1, 7, 0,
+ 14, 1, 0, 0, 14, 1, 1, 0, 0, 0, 70, 7, 2, 0, 71, 7, 2, 0, 72, 7, 2, 0, 73, 7, 2, 0, 27, 0, 15, 1, 12, 0,
+ 2, 0, 72, 7, 2, 0, 74, 7, 2, 0, 75, 7, 0, 0,211, 2, 2, 0, 76, 7, 2, 0, 77, 7, 2, 0, 78, 7, 2, 0, 79, 7,
+ 2, 0, 80, 7, 2, 0,191, 6, 7, 0, 81, 7, 7, 0, 82, 7, 16, 1, 18, 0, 16, 1, 0, 0, 16, 1, 1, 0, 0, 0, 19, 0,
+ 15, 1, 83, 7, 15, 1, 84, 7, 15, 1, 85, 7, 15, 1, 86, 7, 7, 0, 87, 7, 2, 0, 88, 7, 2, 0, 89, 7, 2, 0, 90, 7,
+ 2, 0, 91, 7, 2, 0, 92, 7, 2, 0, 93, 7, 2, 0, 94, 7, 2, 0, 95, 7, 2, 0, 96, 7, 2, 0, 27, 0, 17, 1, 10, 0,
+ 0, 0, 97, 7, 0, 0, 98, 7, 0, 0, 99, 7, 0, 0,100, 7, 0, 0,101, 7, 0, 0,102, 7, 2, 0,103, 7, 2, 0,104, 7,
+ 2, 0,105, 7, 2, 0,106, 7, 18, 1, 8, 0, 0, 0,107, 7, 0, 0,108, 7, 0, 0,109, 7, 0, 0,110, 7, 0, 0,111, 7,
+ 0, 0,112, 7, 7, 0,109, 6, 7, 0, 27, 0, 19, 1, 3, 0, 0, 0,113, 7, 2, 0,114, 7, 2, 0, 27, 0, 20, 1, 22, 0,
+ 17, 1,115, 7, 17, 1,116, 7, 17, 1,117, 7, 17, 1,118, 7, 17, 1,119, 7, 17, 1,120, 7, 17, 1,121, 7, 17, 1,122, 7,
+ 17, 1,123, 7, 17, 1,124, 7, 17, 1,125, 7, 17, 1,126, 7, 17, 1,127, 7, 17, 1,128, 7, 17, 1,129, 7, 17, 1,130, 7,
+ 17, 1,131, 7, 18, 1,132, 7, 19, 1,133, 7, 0, 0,134, 7, 7, 0,135, 7, 7, 0, 27, 0, 21, 1,122, 0, 0, 0,136, 7,
+ 0, 0,137, 7, 0, 0,101, 7, 0, 0,138, 7, 0, 0,113, 7, 0, 0,139, 7, 0, 0,140, 7, 0, 0,141, 7, 0, 0,142, 7,
+ 0, 0,143, 7, 0, 0,144, 7, 0, 0,145, 7, 0, 0,146, 7, 0, 0,147, 7, 0, 0,148, 7, 0, 0,149, 7, 0, 0,150, 7,
+ 0, 0,151, 7, 0, 0,152, 7, 0, 0,153, 7, 0, 0,154, 7, 0, 0,155, 7, 0, 0,156, 7, 0, 0,157, 7, 0, 0,158, 7,
+ 0, 0,159, 7, 0, 0,160, 7, 0, 0,161, 7, 0, 0,162, 7, 0, 0,163, 7, 0, 0,164, 7, 0, 0,165, 7, 0, 0,166, 7,
+ 0, 0,167, 7, 0, 0,168, 7, 0, 0,169, 7, 0, 0,170, 7, 0, 0,171, 7, 0, 0,172, 7, 0, 0,173, 7, 0, 0,174, 7,
+ 0, 0,175, 7, 0, 0,176, 7, 0, 0,177, 7, 0, 0,178, 7, 0, 0,179, 7, 0, 0,180, 7, 0, 0,181, 7, 0, 0,182, 7,
+ 0, 0,183, 7, 0, 0,184, 7, 0, 0,185, 7, 0, 0,186, 7, 0, 0,187, 7, 0, 0,188, 7, 0, 0,189, 7, 0, 0,190, 7,
+ 0, 0,191, 7, 0, 0,192, 7, 0, 0,193, 7, 0, 0,194, 7, 0, 0,195, 7, 0, 0,196, 7, 0, 0,197, 7, 0, 0,198, 7,
+ 0, 0,199, 7, 0, 0,200, 7, 0, 0,201, 7, 0, 0,202, 7, 0, 0,203, 7, 0, 0,204, 7, 0, 0,205, 7, 0, 0,206, 7,
+ 0, 0,207, 7, 0, 0,208, 7, 0, 0,209, 7, 0, 0,210, 7, 0, 0,211, 7, 0, 0,212, 7, 0, 0,213, 7, 0, 0,214, 7,
+ 0, 0,215, 7, 0, 0,216, 7, 0, 0,217, 7, 0, 0,218, 7, 0, 0,219, 7, 0, 0,220, 7, 0, 0,221, 7, 0, 0,222, 7,
+ 0, 0,223, 7, 0, 0,224, 7, 0, 0,225, 7, 0, 0,226, 7, 0, 0,227, 7, 0, 0,228, 7, 0, 0,229, 7, 0, 0,230, 7,
+ 0, 0,231, 7, 0, 0,232, 7, 0, 0,233, 7, 0, 0,234, 7, 0, 0,235, 7, 0, 0,236, 7, 0, 0,237, 7, 0, 0,238, 7,
+ 0, 0,239, 7, 0, 0,240, 7, 0, 0,241, 7, 0, 0,242, 7, 0, 0,243, 7, 0, 0,244, 7, 0, 0,245, 7, 0, 0,246, 7,
+ 0, 0,247, 7, 0, 0,248, 7, 0, 0,249, 7, 0, 0,250, 7, 0, 0,251, 7, 0, 0,252, 7, 0, 0,253, 7, 0, 0,254, 7,
+ 0, 0,255, 7, 22, 1, 5, 0, 0, 0, 0, 8, 0, 0,159, 7, 0, 0,165, 7, 2, 0, 18, 0, 2, 0, 27, 0, 23, 1, 24, 0,
+ 23, 1, 0, 0, 23, 1, 1, 0, 0, 0,172, 5, 20, 1, 1, 8, 21, 1, 2, 8, 21, 1, 3, 8, 21, 1, 4, 8, 21, 1, 5, 8,
+ 21, 1, 6, 8, 21, 1, 7, 8, 21, 1, 8, 8, 21, 1, 9, 8, 21, 1, 10, 8, 21, 1, 11, 8, 21, 1, 12, 8, 21, 1, 13, 8,
+ 21, 1, 14, 8, 21, 1, 15, 8, 21, 1, 16, 8, 21, 1, 17, 8, 21, 1, 18, 8, 22, 1, 19, 8, 4, 0, 20, 8, 4, 0, 27, 0,
+ 24, 1, 3, 0, 24, 1, 0, 0, 24, 1, 1, 0, 0, 0, 21, 8, 25, 1, 5, 0, 4, 0, 18, 0, 4, 0, 27, 0, 7, 0,151, 2,
+ 7, 0, 22, 8, 7, 0, 46, 2, 26, 1, 95, 0, 4, 0, 18, 0, 4, 0, 23, 8, 4, 0, 24, 8, 0, 0, 25, 8, 0, 0, 26, 8,
+ 0, 0, 27, 8, 0, 0, 28, 8, 0, 0, 29, 8, 0, 0, 30, 8, 0, 0, 31, 8, 0, 0, 32, 8, 0, 0, 33, 8, 0, 0, 34, 8,
+ 4, 0, 35, 8, 2, 0, 36, 8, 2, 0, 37, 8, 2, 0, 38, 8, 2, 0, 39, 8, 4, 0, 40, 8, 4, 0, 41, 8, 4, 0, 42, 8,
+ 4, 0, 43, 8, 2, 0, 44, 8, 2, 0, 45, 8, 4, 0, 46, 8, 4, 0, 47, 8, 4, 0, 48, 8, 4, 0, 49, 8, 4, 0, 50, 8,
+ 4, 0, 54, 7, 4, 0, 51, 8, 2, 0, 52, 8, 2, 0, 53, 8, 2, 0, 54, 8, 2, 0, 55, 8, 14, 0, 56, 8, 14, 0, 57, 8,
+ 14, 0, 58, 8, 14, 0, 59, 8, 14, 0, 60, 8, 14, 0, 61, 8, 0, 0, 62, 8, 2, 0, 63, 8, 2, 0, 64, 8, 2, 0, 65, 8,
+ 2, 0, 66, 8, 2, 0, 67, 8, 2, 0, 68, 8, 2, 0, 69, 8, 2, 0, 70, 8, 25, 1, 71, 8, 2, 0, 72, 8, 2, 0, 73, 8,
+ 2, 0, 74, 8, 2, 0, 75, 8, 2, 0, 76, 8, 2, 0, 77, 8, 2, 0, 78, 8, 2, 0, 79, 8, 4, 0, 80, 8, 4, 0, 81, 8,
+ 2, 0, 82, 8, 2, 0, 83, 8, 2, 0, 84, 8, 2, 0, 85, 8, 2, 0, 86, 8, 2, 0, 87, 8, 2, 0, 88, 8, 2, 0, 89, 8,
+ 2, 0, 90, 8, 2, 0, 91, 8, 2, 0, 92, 8, 2, 0, 93, 8, 2, 0, 94, 8, 2, 0, 95, 8, 2, 0, 96, 8, 2, 0, 97, 8,
+ 2, 0, 98, 8, 2, 0, 99, 8, 7, 0,100, 8, 4, 0,101, 8, 7, 0,102, 8, 2, 0, 18, 6, 2, 0, 19, 6, 2, 0,103, 8,
+ 2, 0,104, 8, 50, 0,105, 8, 7, 0,106, 8, 2, 0,107, 8, 2, 0, 74, 0, 0, 0,108, 8, 4, 0,109, 8, 4, 0,110, 8,
+ 7, 0,111, 8, 7, 0, 27, 0, 27, 1, 24, 0, 22, 0, 32, 0, 14, 0,112, 8, 14, 0,113, 8, 14, 0,114, 8, 14, 0,146, 6,
+ 41, 0,125, 0, 41, 0,115, 8, 4, 0,116, 8, 4, 0, 91, 0, 2, 0,117, 8, 2, 0,118, 8, 2, 0,119, 8, 2, 0,120, 8,
+ 2, 0,121, 8, 2, 0,122, 8, 2, 0,123, 8, 2, 0,124, 8, 2, 0,125, 8, 2, 0,126, 8, 2, 0,127, 8, 2, 0, 27, 0,
+237, 0,128, 8, 11, 0,129, 8, 2, 0,130, 8, 28, 1, 5, 0, 28, 1, 0, 0, 28, 1, 1, 0, 28, 1,131, 8, 15, 0,132, 8,
+ 4, 0, 18, 0, 29, 1, 7, 0, 29, 1, 0, 0, 29, 1, 1, 0, 28, 1,133, 8, 28, 1,134, 8, 2, 0,121, 5, 2, 0, 18, 0,
+ 4, 0, 27, 0, 30, 1, 25, 0, 30, 1, 0, 0, 30, 1, 1, 0, 31, 1,135, 8, 32, 1,239, 6, 0, 0,136, 8, 0, 0,137, 8,
+ 0, 0,138, 8, 2, 0,139, 8, 2, 0,140, 8, 2, 0,141, 8, 2, 0,142, 8, 2, 0,143, 8, 2, 0, 27, 0, 2, 0, 18, 0,
+ 2, 0, 69, 7, 2, 0,144, 8, 2, 0,145, 8, 4, 0,146, 8, 30, 1,147, 8, 11, 0,148, 8, 4, 0,149, 8, 4, 0,150, 8,
+ 4, 0,151, 8, 4, 0,152, 8, 0, 0,153, 8, 33, 1, 22, 0, 33, 1, 0, 0, 33, 1, 1, 0, 28, 1,133, 8, 28, 1,134, 8,
+ 28, 1,154, 8, 28, 1,155, 8, 27, 1,156, 8, 18, 0, 51, 0, 0, 0,147, 6, 0, 0,157, 8, 2, 0,192, 6, 2, 0,193, 6,
+ 2, 0,158, 8, 2, 0, 27, 0, 2, 0,121, 8, 2, 0, 53, 7, 2, 0, 18, 0, 34, 1,135, 8, 14, 0,159, 8, 14, 0,146, 6,
+ 14, 0,160, 8, 14, 0,161, 8, 35, 1, 24, 0, 35, 1, 0, 0, 35, 1, 1, 0,240, 0,200, 6, 18, 0,162, 8, 18, 0,163, 8,
+ 2, 0,192, 6, 2, 0,193, 6, 2, 0,164, 8, 2, 0,165, 8, 2, 0,166, 8, 2, 0, 18, 0, 7, 0, 92, 2, 2, 0,141, 8,
+ 2, 0,142, 8, 2, 0,120, 8, 2, 0,167, 8, 2, 0,125, 8, 2, 0, 86, 1, 36, 1,135, 8, 14, 0,168, 8, 14, 0,169, 8,
+ 14, 0,160, 8, 0, 0,170, 8, 11, 0,171, 8, 37, 1, 14, 0, 0, 0,172, 8, 2, 0,173, 8, 2, 0,174, 8, 2, 0,175, 8,
+ 2, 0,176, 8, 2, 0,110, 5, 2, 0,177, 8, 27, 1,178, 8, 41, 0,179, 8, 4, 0,180, 8, 4, 0,181, 8, 4, 0,182, 8,
+ 4, 0, 27, 0, 0, 0, 70, 7, 38, 1, 3, 0, 0, 0,183, 8, 4, 0,184, 8, 4, 0,185, 8, 39, 1, 4, 0, 4, 0, 7, 7,
+ 4, 0,186, 8, 4, 0, 13, 7, 4, 0,187, 8, 40, 1, 2, 0, 4, 0,188, 8, 4, 0,189, 8, 41, 1, 5, 0, 7, 0,190, 8,
+ 7, 0,191, 8, 7, 0,192, 8, 4, 0, 18, 0, 4, 0, 27, 0, 42, 1, 7, 0, 0, 0,193, 8, 0, 0,221, 6, 44, 0,138, 0,
+ 2, 0,194, 8, 2, 0, 72, 5, 2, 0,195, 8, 2, 0,196, 8, 43, 1, 12, 0, 43, 1, 0, 0, 43, 1, 1, 0, 4, 0, 28, 0,
+ 4, 0,197, 8, 4, 0,198, 8, 4, 0,199, 8, 38, 1,200, 8, 0, 0,193, 8, 42, 1,176, 3, 39, 1,201, 8, 40, 1,202, 8,
+ 41, 1,203, 8, 44, 1, 12, 0, 0, 0, 35, 0, 11, 0,227, 0, 0, 0,228, 0, 4, 0,231, 0, 4, 0,239, 0, 11, 0,232, 0,
+ 7, 0,234, 0, 7, 0,235, 0, 11, 0,204, 8, 11, 0,205, 8, 11, 0,236, 0, 11, 0,238, 0, 45, 1, 48, 0, 45, 1, 0, 0,
+ 45, 1, 1, 0, 11, 0,206, 8, 11, 0, 25, 0, 0, 0, 19, 0, 4, 0, 18, 0, 4, 0, 16, 0, 4, 0, 22, 0, 4, 0, 89, 0,
+ 4, 0,207, 8, 4, 0,208, 8, 4, 0,198, 8, 4, 0,199, 8, 4, 0,209, 8, 4, 0,250, 0, 4, 0,210, 8, 4, 0,211, 8,
+ 7, 0,212, 8, 7, 0,213, 8, 7, 0,214, 8, 2, 0,215, 8, 2, 0,216, 8, 4, 0,217, 8, 4, 0,218, 8, 43, 1,219, 8,
+ 31, 0, 80, 0, 41, 0,125, 0, 27, 0,220, 8, 44, 0,138, 0,229, 0,106, 6, 7, 0,221, 8, 7, 0,222, 8, 44, 1, 71, 1,
+ 45, 1,223, 8, 45, 1,224, 8, 45, 1,225, 8, 14, 0,226, 8, 46, 1,227, 8, 11, 0,228, 8, 7, 0, 84, 4, 7, 0,229, 8,
+ 7, 0,230, 8, 7, 0,231, 8, 11, 0,232, 8, 4, 0,233, 8, 4, 0,234, 8, 4, 0,235, 8, 7, 0,236, 8, 47, 1, 4, 0,
+ 47, 1, 0, 0, 47, 1, 1, 0, 14, 0,237, 8, 45, 1,238, 8,226, 0, 11, 0, 14, 0,239, 8, 14, 0,226, 8, 14, 0,240, 8,
+ 45, 1,241, 8, 0, 0,242, 8, 0, 0,243, 8, 4, 0,244, 8, 4, 0,245, 8, 4, 0,246, 8, 4, 0, 27, 0, 19, 0,247, 8,
+ 48, 1, 4, 0, 7, 0,248, 8, 7, 0, 94, 3, 2, 0,249, 8, 2, 0,250, 8, 49, 1, 6, 0, 7, 0,251, 8, 7, 0,252, 8,
+ 7, 0,253, 8, 7, 0,254, 8, 4, 0,255, 8, 4, 0, 0, 9, 50, 1, 8, 0, 7, 0, 1, 9, 7, 0, 2, 9, 7, 0, 3, 9,
+ 7, 0, 4, 9, 7, 0, 5, 9, 4, 0,250, 2, 4, 0, 6, 9, 4, 0, 7, 9, 51, 1, 2, 0, 7, 0,180, 5, 7, 0, 27, 0,
+ 52, 1, 5, 0, 7, 0, 8, 9, 7, 0, 9, 9, 4, 0, 92, 0, 4, 0,212, 2, 4, 0, 10, 9, 53, 1, 6, 0, 53, 1, 0, 0,
+ 53, 1, 1, 0, 2, 0, 16, 0, 2, 0, 18, 0, 2, 0, 11, 9, 2, 0, 56, 0, 54, 1, 8, 0, 54, 1, 0, 0, 54, 1, 1, 0,
+ 2, 0, 16, 0, 2, 0, 18, 0, 2, 0, 11, 9, 2, 0, 56, 0, 7, 0, 22, 0, 7, 0,129, 0, 55, 1, 45, 0, 55, 1, 0, 0,
+ 55, 1, 1, 0, 2, 0, 16, 0, 2, 0, 18, 0, 2, 0, 11, 9, 2, 0,246, 0, 2, 0,126, 4, 2, 0, 12, 9, 7, 0, 13, 9,
+ 7, 0, 90, 0, 7, 0, 7, 3, 4, 0, 14, 9, 4, 0, 82, 0, 4, 0,214, 2, 7, 0, 15, 9, 7, 0, 16, 9, 7, 0, 17, 9,
+ 7, 0, 18, 9, 7, 0, 19, 9, 7, 0, 20, 9, 7, 0, 4, 3, 7, 0, 68, 1, 7, 0, 21, 9, 7, 0, 22, 9, 7, 0, 27, 0,
+ 7, 0, 23, 9, 7, 0, 24, 9, 7, 0, 25, 9, 2, 0, 26, 9, 2, 0, 27, 9, 2, 0, 28, 9, 2, 0, 29, 9, 2, 0, 30, 9,
+ 2, 0, 31, 9, 2, 0, 32, 9, 2, 0, 33, 9, 2, 0, 31, 2, 2, 0, 34, 9, 2, 0, 28, 2, 2, 0, 35, 9, 0, 0, 36, 9,
+ 0, 0, 37, 9, 7, 0,244, 0, 56, 1, 38, 9, 64, 0,249, 1, 57, 1, 16, 0, 57, 1, 0, 0, 57, 1, 1, 0, 2, 0, 16, 0,
+ 2, 0, 18, 0, 2, 0, 11, 9, 2, 0,246, 0, 7, 0,255, 2, 7, 0, 0, 3, 7, 0, 1, 3, 7, 0, 81, 2, 7, 0, 2, 3,
+ 7, 0, 3, 3, 7, 0, 39, 9, 7, 0, 4, 3, 7, 0, 6, 3, 7, 0, 7, 3,253, 0, 5, 0, 2, 0, 16, 0, 2, 0, 40, 9,
+ 2, 0, 18, 0, 2, 0, 41, 9, 22, 0, 42, 7,252, 0, 3, 0, 4, 0, 68, 0, 4, 0, 42, 9,253, 0, 2, 0, 58, 1, 7, 0,
+ 58, 1, 0, 0, 58, 1, 1, 0, 0, 0, 19, 0, 2, 0, 16, 0, 2, 0, 18, 0, 4, 0, 21, 0, 11, 0, 43, 9, 59, 1, 5, 0,
+ 0, 0, 19, 0, 7, 0, 94, 1, 7, 0, 44, 9, 4, 0, 45, 9, 4, 0, 27, 0, 60, 1, 4, 0, 2, 0, 16, 0, 2, 0, 18, 0,
+ 2, 0, 91, 0, 2, 0, 30, 0, 61, 1, 4, 0, 0, 0, 19, 0, 63, 0, 46, 9, 7, 0, 94, 1, 7, 0, 27, 0, 62, 1, 6, 0,
+ 2, 0, 47, 9, 2, 0, 48, 9, 2, 0, 16, 0, 2, 0, 49, 9, 0, 0, 50, 9, 0, 0, 51, 9, 63, 1, 5, 0, 4, 0, 16, 0,
+ 4, 0, 27, 0, 0, 0, 19, 0, 0, 0, 52, 9, 0, 0, 53, 9, 64, 1, 3, 0, 4, 0, 16, 0, 4, 0, 27, 0, 0, 0, 19, 0,
+ 65, 1, 4, 0, 2, 0, 54, 9, 2, 0, 55, 9, 2, 0, 18, 0, 2, 0, 27, 0, 66, 1, 6, 0, 0, 0, 19, 0, 0, 0, 56, 9,
+ 2, 0, 57, 9, 2, 0, 4, 3, 2, 0, 87, 1, 2, 0, 30, 0, 67, 1, 5, 0, 0, 0, 19, 0, 7, 0, 94, 3, 7, 0,217, 4,
+ 2, 0, 18, 0, 2, 0,226, 2, 68, 1, 3, 0, 0, 0, 19, 0, 4, 0,214, 2, 4, 0, 54, 9, 69, 1, 7, 0, 0, 0, 19, 0,
+ 7, 0,217, 4, 0, 0, 58, 9, 0, 0, 59, 9, 2, 0, 87, 1, 2, 0, 91, 0, 4, 0, 60, 9, 70, 1, 4, 0, 0, 0, 61, 9,
+ 0, 0, 62, 9, 4, 0, 16, 0, 7, 0,230, 2, 71, 1, 3, 0, 27, 0, 63, 9, 0, 0, 64, 9, 0, 0, 65, 9, 72, 1, 18, 0,
+ 72, 1, 0, 0, 72, 1, 1, 0, 2, 0, 16, 0, 2, 0, 66, 9, 2, 0, 18, 0, 2, 0, 67, 9, 2, 0, 68, 9, 2, 0, 69, 9,
+ 2, 0, 91, 0, 2, 0, 30, 0, 0, 0, 19, 0, 11, 0, 2, 0, 73, 1, 70, 9, 27, 0, 44, 0, 2, 0,216, 5, 2, 0,176, 2,
+ 2, 0, 71, 9, 2, 0, 27, 0, 74, 1, 11, 0, 0, 0, 19, 0, 0, 0, 16, 0, 0, 0, 72, 9, 2, 0, 18, 0, 2, 0,226, 2,
+ 2, 0, 73, 9, 4, 0, 74, 9, 4, 0, 75, 9, 4, 0, 76, 9, 4, 0, 77, 9, 4, 0, 78, 9, 75, 1, 1, 0, 0, 0, 79, 9,
+ 76, 1, 4, 0, 37, 0, 6, 7, 0, 0, 21, 8, 4, 0, 87, 1, 4, 0, 18, 0, 73, 1, 18, 0, 73, 1, 0, 0, 73, 1, 1, 0,
+ 73, 1, 80, 9, 2, 0, 16, 0, 2, 0, 18, 0, 2, 0, 81, 9, 2, 0, 69, 9, 2, 0, 66, 9, 2, 0, 82, 9, 2, 0, 30, 0,
+ 2, 0, 74, 0, 0, 0, 19, 0, 11, 0, 2, 0, 77, 1, 70, 9, 72, 1, 83, 9, 2, 0, 14, 0, 2, 0, 84, 9, 4, 0, 85, 9,
+ 78, 1, 3, 0, 4, 0,240, 2, 4, 0, 27, 0, 27, 0, 44, 0, 79, 1, 15, 0,176, 0, 86, 9, 2, 0, 16, 0, 2, 0, 18, 0,
+ 7, 0, 13, 9, 7, 0, 90, 0, 0, 0, 19, 0, 0, 0, 87, 9, 2, 0, 88, 9, 2, 0, 89, 9, 2, 0,134, 0, 2, 0, 90, 9,
+ 2, 0, 91, 9, 2, 0, 27, 0, 7, 0, 92, 9, 7, 0, 93, 9, 80, 1, 8, 0, 7, 0, 94, 9, 7, 0, 95, 9, 7, 0, 96, 9,
+ 7, 0, 97, 9, 7, 0, 98, 9, 7, 0, 99, 9, 7, 0,100, 9, 7, 0,101, 9, 81, 1, 13, 0, 2, 0, 18, 0, 2, 0,102, 9,
+ 4, 0, 91, 0, 4, 0, 30, 0, 2, 0,177, 6, 7, 0, 84, 4, 7, 0,229, 8, 46, 1,227, 8, 80, 1,103, 9, 2, 0, 16, 0,
+ 2, 0,115, 5, 2, 0,216, 3, 2, 0,104, 9, 82, 1, 11, 0, 4, 0,240, 2, 2, 0, 16, 0, 2, 0, 18, 0, 27, 0, 44, 0,
+ 79, 0,105, 9, 0, 0, 19, 0, 7, 0,106, 9, 7, 0,107, 9, 7, 0,222, 3, 2, 0,108, 9, 2, 0,109, 9, 83, 1, 5, 0,
+ 2, 0, 16, 0, 2, 0, 91, 0, 4, 0, 27, 0, 41, 0,125, 0, 27, 0,208, 5, 84, 1, 5, 0, 4, 0, 27, 0, 4, 0, 16, 0,
+ 0, 0, 19, 0, 0, 0, 52, 9, 27, 0, 44, 0, 85, 1, 13, 0, 2, 0, 18, 0, 2, 0, 16, 0, 2, 0, 66, 9, 2, 0,223, 3,
+ 7, 0,110, 9, 7, 0,111, 9, 7, 0, 86, 1, 7, 0,112, 9, 7, 0,192, 3, 7, 0,196, 3, 7, 0,113, 9, 7, 0,114, 9,
+ 27, 0,115, 9, 86, 1, 10, 0, 2, 0, 18, 0, 2, 0, 16, 0, 7, 0, 13, 9, 7, 0, 90, 0, 0, 0, 19, 0, 0, 0, 87, 9,
+ 2, 0, 91, 0, 2, 0, 30, 0, 2, 0, 74, 0, 2, 0,115, 5, 87, 1, 8, 0, 27, 0, 44, 0, 7, 0, 1, 3, 7, 0,116, 9,
+ 7, 0,117, 9, 7, 0,223, 3, 2, 0, 91, 0, 2, 0,226, 2, 7, 0, 30, 0, 88, 1, 12, 0, 2, 0, 16, 0, 2, 0, 87, 1,
+ 2, 0, 18, 0, 2, 0, 4, 3, 2, 0,240, 2, 2, 0,118, 9, 4, 0, 27, 0, 7, 0,119, 9, 7, 0,120, 9, 7, 0,121, 9,
+ 7, 0,122, 9, 0, 0,123, 9, 89, 1, 9, 0, 2, 0, 18, 0, 2, 0, 16, 0, 4, 0, 13, 9, 4, 0, 90, 0, 0, 0, 19, 0,
+ 2, 0, 86, 1, 2, 0, 63, 0, 2, 0,124, 9, 2, 0,125, 9, 90, 1, 7, 0, 4, 0,214, 2, 4, 0,126, 9, 4, 0,127, 9,
+ 4, 0,128, 9, 7, 0,129, 9, 7, 0,130, 9, 0, 0, 58, 9, 91, 1, 7, 0, 0, 0,131, 9, 27, 0,132, 9, 0, 0, 64, 9,
+ 2, 0,133, 9, 2, 0, 91, 0, 4, 0, 30, 0, 0, 0, 65, 9, 92, 1, 6, 0, 2, 0, 18, 0, 2, 0, 16, 0, 4, 0, 13, 9,
+ 4, 0, 90, 0, 0, 0,134, 9, 0, 0,135, 9, 93, 1, 1, 0, 4, 0, 18, 0, 94, 1, 6, 0, 0, 0, 94, 0, 2, 0, 16, 0,
+ 2, 0, 18, 0, 4, 0,136, 9, 7, 0,137, 9, 37, 0, 6, 7, 95, 1, 4, 0, 0, 0,181, 2, 2, 0, 18, 0, 4, 0, 16, 0,
+ 27, 0, 44, 0, 96, 1, 2, 0, 4, 0, 16, 0, 4, 0,181, 6, 97, 1, 8, 0, 0, 0, 61, 9, 0, 0, 62, 9, 4, 0, 16, 0,
+ 7, 0, 39, 2, 7, 0,138, 9, 7, 0, 27, 0, 27, 0, 70, 3, 27, 0,139, 9, 98, 1, 11, 0, 0, 0, 54, 6, 0, 0, 18, 0,
+ 2, 0,140, 9, 4, 0, 16, 0, 7, 0, 94, 1, 7, 0,141, 9, 7, 0,142, 9, 7, 0,143, 9, 4, 0,144, 9, 27, 0, 70, 3,
+ 27, 0,145, 9, 77, 1, 10, 0, 77, 1, 0, 0, 77, 1, 1, 0, 77, 1, 80, 9, 2, 0, 16, 0, 2, 0, 18, 0, 2, 0, 66, 9,
+ 2, 0,146, 9, 0, 0, 19, 0, 11, 0, 2, 0, 27, 0, 44, 0, 46, 1, 17, 0, 22, 0, 32, 0, 0, 0, 35, 0, 38, 0,153, 0,
+ 11, 0,227, 0, 38, 0,147, 9, 31, 0, 80, 0, 7, 0, 84, 4, 7, 0,148, 9, 7, 0,229, 8, 7, 0, 94, 9, 7, 0, 95, 9,
+ 7, 0,149, 9, 4, 0, 92, 0, 4, 0, 27, 0, 11, 0,150, 9, 11, 0,151, 9, 11, 0,152, 9, 99, 1, 6, 0, 99, 1, 0, 0,
+ 99, 1, 1, 0, 27, 0, 44, 0, 11, 0,153, 9, 2, 0,251, 0, 0, 0,211, 2, 64, 0, 4, 0, 22, 0, 32, 0, 14, 0,154, 9,
+ 4, 0,134, 0, 7, 0,155, 9,100, 1, 28, 0,100, 1, 0, 0,100, 1, 1, 0, 21, 0,156, 9,100, 1, 38, 0, 14, 0,157, 9,
+ 0, 0, 19, 0, 7, 0,158, 9, 7, 0,159, 9, 7, 0,160, 9, 7, 0,161, 9, 4, 0, 18, 0, 7, 0,162, 9, 7, 0,163, 9,
+ 7, 0,164, 9, 7, 0,165, 9, 7, 0, 94, 1, 7, 0, 39, 2, 7, 0,166, 9, 7, 0,212, 2, 7, 0,167, 9, 7, 0,168, 9,
+ 7, 0,169, 9, 7, 0,170, 9, 7, 0,171, 9, 7, 0,176, 0, 4, 0,134, 0, 2, 0,254, 5, 2, 0,172, 9,101, 1, 27, 0,
+ 22, 0, 32, 0, 34, 0, 75, 0, 14, 0,173, 9, 14, 0,174, 9, 14, 0,175, 9,100, 1,176, 9, 11, 0,177, 9, 11, 0,178, 9,
+ 4, 0, 18, 0, 4, 0,157, 6, 4, 0,179, 9, 4, 0, 27, 0, 2, 0, 8, 3, 2, 0,211, 6, 4, 0,180, 9, 4, 0,134, 0,
+ 4, 0,181, 9, 2, 0,182, 9, 2, 0,183, 9, 2, 0,184, 9, 2, 0,185, 9, 4, 0,186, 9, 4, 0,187, 9, 4, 0,188, 9,
+ 4, 0,189, 9, 4, 0,190, 9, 4, 0,191, 9,102, 1, 2, 0, 7, 0,165, 2, 4, 0, 18, 0,180, 0, 5, 0,102, 1,192, 9,
+ 4, 0,212, 2, 4, 0,193, 9, 4, 0,194, 9, 4, 0, 18, 0,179, 0, 16, 0, 4, 0,195, 9, 4, 0,196, 9, 4, 0,197, 9,
+ 4, 0,198, 9, 2, 0,199, 9, 2, 0,200, 9, 2, 0,201, 9, 2, 0,251, 0, 2, 0,202, 9, 2, 0,203, 9, 2, 0,204, 9,
+ 2, 0,205, 9, 4, 0,206, 9, 4, 0,207, 9, 4, 0,208, 9, 4, 0,209, 9,103, 1, 40, 0,103, 1, 0, 0,103, 1, 1, 0,
+ 21, 0,156, 9, 14, 0,251, 3, 0, 0, 19, 0, 2, 0, 18, 0, 2, 0,210, 9, 2, 0,209, 3, 2, 0,211, 9, 0, 0,212, 9,
+ 0, 0,213, 9, 0, 0,214, 9,100, 1,215, 9,103, 1, 38, 0,103, 1,216, 9, 14, 0,217, 9, 14, 0,218, 9,180, 0,184, 3,
+ 27, 0,219, 9,103, 1,220, 9, 7, 0, 77, 1, 7, 0,176, 0, 7, 0,221, 9, 7, 0, 18, 2, 7, 0,198, 3, 7, 0,200, 3,
+ 2, 0,232, 3, 2, 0, 27, 0, 7, 0,222, 9, 7, 0,223, 9, 7, 0,203, 3, 7, 0,224, 9, 7, 0,225, 9, 7, 0,226, 9,
+ 7, 0,227, 9, 7, 0,228, 9, 7, 0,229, 9, 7, 0,230, 9, 7, 0,231, 9, 11, 0,232, 9,177, 0, 16, 0, 14, 0,233, 9,
+ 74, 0,234, 9, 2, 0, 18, 0, 2, 0, 27, 0, 4, 0,235, 9, 4, 0, 91, 0, 7, 0,108, 2, 7, 0,236, 9, 7, 0,237, 9,
+ 14, 0,238, 9, 4, 0,239, 9, 4, 0,240, 9, 11, 0,241, 9, 11, 0,242, 9,179, 0,183, 3, 0, 0,243, 9,104, 1, 1, 0,
+ 4, 0,240, 9,105, 1, 12, 0, 4, 0,240, 9, 7, 0, 78, 9, 2, 0,244, 9, 2, 0,245, 9, 7, 0,246, 9, 7, 0,247, 9,
+ 2, 0,248, 9, 2, 0, 18, 0, 7, 0,249, 9, 7, 0,250, 9, 7, 0,251, 9, 7, 0,252, 9,106, 1, 7, 0,106, 1, 0, 0,
+106, 1, 1, 0, 14, 0,253, 9, 4, 0, 18, 0, 4, 0,254, 9, 0, 0, 19, 0, 22, 1,255, 9,176, 0, 9, 0, 22, 0, 32, 0,
+ 14, 0, 0, 10, 14, 0,233, 9, 14, 0, 1, 10, 14, 0,102, 0, 4, 0, 18, 0, 4, 0, 2, 10, 4, 0, 3, 10, 4, 0, 27, 0,
+243, 0, 8, 0, 22, 0, 4, 10, 14, 0,233, 9, 64, 0, 5, 10, 0, 0, 6, 10, 4, 0, 7, 10, 4, 0, 18, 0, 4, 0, 8, 10,
+ 4, 0, 27, 0,107, 1, 13, 0,239, 0, 0, 0,239, 0, 1, 0, 14, 0,146, 6, 4, 0,147, 6, 7, 0,148, 6, 2, 0,149, 6,
+240, 0,200, 6,176, 0,179, 3,243, 0, 9, 10, 0, 0, 87, 1, 0, 0,203, 6, 2, 0, 18, 0, 7, 0, 10, 10,108, 1, 8, 0,
+108, 1, 0, 0,108, 1, 1, 0,106, 1, 11, 10, 31, 0, 80, 0, 14, 0,185, 3, 4, 0, 18, 0, 0, 0, 19, 0, 4, 0,118, 8,
+109, 1, 5, 0,109, 1, 0, 0,109, 1, 1, 0, 31, 0, 80, 0, 2, 0, 18, 0, 0, 0, 12, 10,110, 1, 14, 0,110, 1, 0, 0,
+110, 1, 1, 0, 11, 0, 2, 0, 2, 0, 16, 0, 2, 0, 18, 0, 0, 0, 13, 10, 0, 0, 14, 10, 0, 0, 19, 0, 2, 0, 27, 0,
+ 7, 0, 15, 10, 7, 0, 16, 10, 31, 0, 80, 0, 7, 0, 17, 10, 7, 0, 18, 10,111, 1, 9, 0,111, 1, 0, 0,111, 1, 1, 0,
+ 27, 0, 19, 10, 0, 0, 11, 3, 7, 0, 20, 10, 2, 0, 21, 10, 2, 0, 18, 0, 2, 0, 16, 0, 2, 0, 22, 10,112, 1, 7, 0,
+ 37, 0, 6, 7, 21, 0,156, 9, 4, 0, 18, 0, 4, 0, 23, 10, 14, 0, 24, 10, 27, 0, 19, 10, 0, 0, 11, 3,113, 1, 15, 0,
+ 27, 0, 19, 10, 2, 0, 25, 10, 2, 0, 18, 0, 2, 0, 26, 10, 2, 0, 27, 10, 0, 0, 11, 3, 27, 0, 28, 10, 0, 0, 29, 10,
+ 7, 0, 30, 10, 7, 0, 39, 2, 7, 0, 31, 10, 7, 0, 32, 10, 2, 0, 16, 0, 2, 0, 87, 1, 7, 0, 94, 1,114, 1, 6, 0,
+ 27, 0, 19, 10, 7, 0,192, 9, 2, 0, 33, 10, 2, 0, 34, 10, 2, 0, 18, 0, 2, 0, 35, 10,115, 1, 6, 0, 27, 0, 19, 10,
+ 4, 0, 36, 10, 4, 0, 37, 10, 4, 0, 92, 0, 4, 0, 27, 0, 0, 0, 11, 3,116, 1, 4, 0, 27, 0, 19, 10, 4, 0, 18, 0,
+ 4, 0, 36, 10, 0, 0, 11, 3,117, 1, 4, 0, 27, 0, 19, 10, 4, 0, 18, 0, 4, 0, 36, 10, 0, 0, 11, 3,118, 1, 4, 0,
+ 27, 0, 19, 10, 4, 0, 18, 0, 4, 0, 36, 10, 0, 0, 11, 3,119, 1, 2, 0, 4, 0, 18, 0, 7, 0, 84, 4,120, 1, 2, 0,
+ 27, 0, 19, 10, 0, 0, 11, 3,121, 1, 10, 0, 27, 0, 19, 10, 4, 0, 38, 10, 7, 0,128, 0, 4, 0, 18, 0, 2, 0, 4, 7,
+ 2, 0, 39, 10, 2, 0, 91, 0, 2, 0, 30, 0, 7, 0, 40, 10, 0, 0, 11, 3,122, 1, 10, 0, 27, 0, 19, 10, 2, 0, 16, 0,
+ 2, 0,134, 4, 4, 0, 89, 0, 4, 0, 90, 0, 7, 0,116, 9, 7, 0,117, 9, 4, 0, 27, 0,176, 0, 86, 9, 0, 0, 11, 3,
+123, 1, 4, 0, 27, 0, 19, 10, 4, 0,210, 3, 4, 0, 41, 10, 0, 0, 11, 3,124, 1, 4, 0, 27, 0, 19, 10, 4, 0,210, 3,
+ 4, 0, 27, 0, 0, 0, 11, 3,125, 1, 6, 0, 27, 0, 19, 10, 7, 0,128, 0, 7, 0, 82, 3, 4, 0, 42, 10, 2, 0,210, 3,
+ 2, 0,211, 3,126, 1, 6, 0, 27, 0, 19, 10, 4, 0, 43, 10, 4, 0, 44, 10, 7, 0, 45, 10, 7, 0, 46, 10, 0, 0, 11, 3,
+127, 1, 16, 0, 27, 0, 19, 10, 27, 0,216, 9, 4, 0, 16, 0, 7, 0, 47, 10, 7, 0, 48, 10, 7, 0, 49, 10, 7, 0, 50, 10,
+ 7, 0, 51, 10, 7, 0, 52, 10, 7, 0, 53, 10, 7, 0, 54, 10, 7, 0, 55, 10, 2, 0, 18, 0, 2, 0, 27, 0, 2, 0, 91, 0,
+ 2, 0, 30, 0,128, 1, 3, 0, 27, 0, 19, 10, 4, 0, 18, 0, 4, 0, 31, 2,129, 1, 5, 0, 27, 0, 19, 10, 4, 0, 18, 0,
+ 4, 0, 27, 0, 7, 0, 56, 10, 0, 0, 11, 3,130, 1, 10, 0, 27, 0, 19, 10, 0, 0, 11, 3, 2, 0, 57, 10, 2, 0, 58, 10,
+ 0, 0, 59, 10, 0, 0, 60, 10, 7, 0, 61, 10, 7, 0, 62, 10, 7, 0, 63, 10, 7, 0, 64, 10,131, 1, 5, 0, 27, 0, 19, 10,
+ 0, 0, 11, 3, 7, 0,220, 2, 2, 0, 65, 10, 2, 0, 18, 0,132, 1, 8, 0, 7, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0,
+ 7, 0, 11, 0, 7, 0, 66, 10, 7, 0, 67, 10, 2, 0, 18, 0, 2, 0, 31, 2,133, 1, 8, 0, 7, 0, 8, 0, 7, 0, 9, 0,
+ 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 66, 10, 7, 0, 67, 10, 2, 0, 18, 0, 2, 0, 31, 2,134, 1, 8, 0, 7, 0, 8, 0,
+ 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 66, 10, 7, 0, 67, 10, 2, 0, 18, 0, 2, 0, 31, 2,135, 1, 7, 0,
+ 27, 0, 19, 10, 0, 0, 11, 3, 7, 0, 94, 1, 7, 0,103, 1, 2, 0, 18, 0, 2, 0, 87, 1, 4, 0, 27, 0,136, 1, 5, 0,
+ 27, 0, 70, 3, 7, 0, 94, 1, 2, 0, 74, 3, 0, 0, 76, 3, 0, 0, 68, 10,137, 1, 7, 0,229, 0,106, 6, 0, 0, 69, 10,
+ 4, 0, 18, 0, 4, 0, 27, 0, 0, 0, 70, 10, 27, 0,208, 5, 27, 0, 71, 10,138, 1, 3, 0,229, 0,106, 6, 4, 0, 18, 0,
+ 4, 0, 27, 0,139, 1, 6, 0,229, 0,106, 6, 4, 0, 18, 0, 4, 0, 27, 0, 0, 0, 70, 10, 7, 0, 56, 10, 27, 0,208, 5,
+140, 1, 10, 0,140, 1, 0, 0,140, 1, 1, 0, 2, 0, 16, 0, 2, 0, 18, 0, 0, 0, 72, 10, 7, 0, 31, 1, 7, 0, 32, 1,
+ 2, 0,253, 9, 2, 0, 73, 10, 27, 0, 44, 0,141, 1, 22, 0,141, 1, 0, 0,141, 1, 1, 0, 2, 0, 18, 0, 2, 0, 87, 1,
+ 2, 0, 74, 10, 2, 0, 75, 10, 31, 0, 80, 0,176, 0, 86, 9, 27, 0,168, 0, 7, 0, 89, 0, 7, 0, 90, 0, 7, 0, 76, 10,
+ 7, 0, 77, 10, 7, 0, 78, 10, 7, 0, 79, 10, 7, 0,253, 2, 7, 0,148, 3, 7, 0, 88, 9, 7, 0, 80, 10, 0, 0, 81, 10,
+ 0, 0, 82, 10, 14, 0,188, 3,142, 1, 11, 0, 7, 0, 46, 2, 7, 0,116, 9, 7, 0,117, 9, 11, 0, 2, 0, 2, 0, 83, 10,
+ 2, 0, 84, 10, 2, 0, 85, 10, 2, 0, 86, 10, 2, 0, 87, 10, 2, 0, 88, 10, 2, 0,181, 2,143, 1, 21, 0,143, 1, 0, 0,
+143, 1, 1, 0,143, 1, 89, 10, 0, 0, 19, 0, 11, 0, 90, 10, 2, 0, 16, 0, 2, 0, 18, 0, 2, 0, 91, 10, 2, 0, 92, 10,
+ 7, 0, 93, 10, 7, 0, 94, 10, 11, 0, 95, 10, 2, 0, 96, 10, 2, 0, 97, 10, 4, 0, 74, 0, 11, 0,150, 9, 4, 0, 98, 10,
+ 4, 0, 99, 10,143, 1,100, 10,144, 1,101, 10,142, 1,102, 10,145, 1, 4, 0, 0, 0,103, 10, 2, 0,104, 10, 2, 0,105, 10,
+ 4, 0, 27, 0,146, 1, 37, 0,146, 1, 0, 0,146, 1, 1, 0,146, 1,106, 10, 0, 0, 19, 0, 2, 0, 16, 0, 2, 0, 18, 0,
+ 2, 0,197, 8, 2, 0,176, 2, 2, 0,107, 10, 2, 0, 9, 7, 2, 0, 96, 10, 2, 0, 40, 9, 14, 0, 81, 9, 14, 0,108, 10,
+146, 1, 38, 0, 22, 0, 42, 7, 11, 0, 90, 10, 7, 0, 93, 10, 7, 0, 94, 10, 7, 0, 81, 2, 7, 0, 1, 3, 7, 0,109, 10,
+ 4, 0,110, 10, 0, 0,111, 10, 2, 0,112, 10, 2, 0,113, 10, 7, 0,114, 10, 7, 0,115, 10, 2, 0,116, 10, 2, 0,117, 10,
+ 11, 0,118, 10, 19, 0,119, 10, 19, 0,120, 10, 19, 0,121, 10,145, 1,154, 0,147, 1,122, 10,148, 1,123, 10,144, 1, 8, 0,
+144, 1, 0, 0,144, 1, 1, 0,146, 1,124, 10,146, 1,125, 10,143, 1,126, 10,143, 1,127, 10, 4, 0, 18, 0, 4, 0, 27, 0,
+ 57, 0, 20, 0, 22, 0, 32, 0, 34, 0, 75, 0,178, 0,182, 3, 14, 0,128, 10, 14, 0,129, 10, 4, 0, 16, 0, 4, 0,130, 10,
+ 4, 0,131, 10, 4, 0, 18, 0, 4, 0,110, 10, 4, 0,132, 10, 14, 0, 81, 9, 14, 0,108, 10,149, 1,133, 10, 11, 0,134, 10,
+ 11, 0,135, 10, 4, 0,136, 10, 11, 0,137, 10, 11, 0,138, 10, 11, 0,139, 10,150, 1, 4, 0, 4, 0, 17, 0, 4, 0,230, 2,
+ 4, 0,116, 9, 4, 0,117, 9,151, 1, 4, 0, 4, 0, 17, 0, 7, 0,230, 2, 7, 0,116, 9, 7, 0,117, 9,152, 1, 2, 0,
+ 0, 0,230, 2, 0, 0, 86, 1,153, 1, 4, 0, 4, 0, 17, 0, 7, 0,140, 10, 7, 0,116, 9, 7, 0,117, 9,154, 1, 1, 0,
+ 7, 0,141, 10,155, 1, 6, 0, 4, 0,127, 0, 4, 0,129, 0, 4, 0, 40, 9, 0, 0,142, 10, 0, 0,143, 10, 2, 0, 27, 0,
+156, 1, 16, 0, 2, 0,141, 8, 2, 0,142, 8, 2, 0,144, 10, 2, 0,145, 10, 2, 0,146, 10, 2, 0, 67, 0, 2, 0, 43, 7,
+ 2, 0,147, 10, 7, 0,252, 2, 7, 0,148, 10, 7, 0,149, 10, 2, 0,109, 1, 0, 0,150, 10, 0, 0,151, 10, 4, 0,152, 10,
+ 4, 0,153, 10,157, 1, 9, 0, 7, 0,154, 10, 7, 0,155, 10, 7, 0,149, 9, 7, 0, 94, 3, 7, 0,156, 10, 7, 0,218, 6,
+ 2, 0, 92, 3, 0, 0,157, 10, 0, 0, 27, 0,158, 1, 4, 0, 7, 0,158, 10, 7, 0,159, 10, 2, 0, 92, 3, 2, 0, 27, 0,
+159, 1, 3, 0, 7, 0,160, 10, 7, 0,212, 8, 7, 0, 14, 0,160, 1, 4, 0, 0, 0, 35, 0,204, 0, 80, 5, 4, 0,129, 0,
+ 4, 0,132, 4,161, 1, 6, 0, 0, 0,161, 10,204, 0,162, 10, 4, 0,129, 0, 4, 0,132, 4, 4, 0,163, 10, 4, 0, 27, 0,
+162, 1, 4, 0, 2, 0,164, 10, 2, 0,165, 10, 4, 0, 30, 0,204, 0,162, 10,163, 1, 9, 0, 7, 0,166, 10, 7, 0,167, 10,
+ 7, 0,168, 10, 7, 0, 92, 2, 7, 0,169, 10, 7, 0,170, 10, 7, 0,171, 10, 2, 0,172, 10, 2, 0,173, 10,164, 1, 8, 0,
+ 2, 0,174, 10, 2, 0,175, 10, 2, 0,176, 10, 2, 0,177, 10, 7, 0,178, 10, 7, 0,179, 10, 7, 0,180, 10, 7, 0,181, 10,
+165, 1, 2, 0, 7, 0, 5, 0, 7, 0, 6, 0,166, 1, 2, 0, 0, 0,170, 0, 0, 0,182, 10,167, 1, 1, 0, 0, 0, 19, 0,
+168, 1, 12, 0, 0, 0,183, 10, 0, 0,184, 10, 0, 0,209, 6, 0, 0,185, 10, 2, 0,144, 10, 2, 0,186, 10, 7, 0,187, 10,
+ 7, 0,188, 10, 7, 0,189, 10, 7, 0,148, 3, 7, 0,190, 10, 7, 0,191, 10,169, 1, 2, 0, 11, 0,192, 10, 11, 0,193, 10,
+170, 1, 13, 0, 0, 0, 72, 5, 0, 0, 16, 0, 0, 0, 92, 3, 0, 0, 94, 3, 0, 0,184, 10, 0, 0,108, 0, 0, 0,181, 2,
+ 7, 0,194, 10, 7, 0,195, 10, 7, 0,147, 3, 7, 0,196, 10, 7, 0,197, 10, 7, 0,191, 10,171, 1, 8, 0, 7, 0, 47, 9,
+ 7, 0,128, 0, 7, 0,151, 10, 7, 0,172, 2, 7, 0,198, 10, 7, 0,240, 0, 7, 0,199, 10, 4, 0, 16, 0,172, 1, 4, 0,
+ 2, 0,200, 10, 2, 0,201, 10, 2, 0,202, 10, 2, 0, 27, 0,173, 1, 8, 0, 7, 0,203, 10, 7, 0,220, 2, 7, 0,204, 10,
+ 7, 0,190, 8, 7, 0,191, 8, 7, 0,192, 8, 7, 0,205, 10, 7, 0,206, 10,174, 1, 6, 0, 2, 0,207, 10, 2, 0,208, 10,
+ 7, 0,209, 10, 7, 0,210, 10, 7, 0,211, 10, 7, 0,212, 10,175, 1, 2, 0, 58, 0,213, 10, 59, 0,214, 10,176, 1, 3, 0,
+175, 1, 79, 6, 7, 0,215, 10, 7, 0,216, 10,177, 1, 3, 0,175, 1, 79, 6, 4, 0,217, 10, 4, 0, 27, 0,178, 1, 1, 0,
+175, 1, 79, 6,179, 1, 3, 0,175, 1, 79, 6, 4, 0,217, 10, 4, 0,218, 10,180, 1, 3, 0,175, 1, 79, 6, 4, 0,219, 10,
+ 4, 0, 27, 0,181, 1, 1, 0,175, 1, 79, 6,182, 1, 3, 0,175, 1, 79, 6, 4, 0,220, 10, 4, 0, 27, 0,183, 1, 3, 0,
+175, 1, 79, 6, 4, 0,221, 10, 4, 0, 27, 0,184, 1, 3, 0,175, 1, 79, 6, 4, 0,222, 10, 4, 0, 27, 0,185, 1, 3, 0,
+175, 1, 79, 6, 4, 0,250, 0, 4, 0, 27, 0,186, 1, 1, 0, 0, 0, 19, 0,187, 1, 1, 0, 0, 0, 19, 0,188, 1, 4, 0,
+ 7, 0, 5, 0, 7, 0, 6, 0, 2, 0, 18, 0, 2, 0,223, 10,189, 1, 10, 0, 2, 0, 62, 4, 2, 0, 18, 0, 7, 0,217, 4,
+ 7, 0,224, 10, 7, 0,225, 10, 7, 0,226, 10, 7, 0,227, 10,188, 1,228, 10,188, 1,229, 10,188, 1,230, 10, 54, 0, 11, 0,
+ 4, 0, 18, 0, 4, 0, 63, 0, 4, 0,231, 10, 4, 0,232, 10, 19, 0,233, 10, 19, 0,234, 10,189, 1,235, 10, 7, 0,236, 10,
+ 7, 0,237, 10, 7, 0,238, 10, 7, 0,239, 10, 0, 1, 10, 0, 4, 0,253, 9, 4, 0,240, 10, 7, 0,241, 10, 7, 0,242, 10,
+ 7, 0,243, 10, 7, 0,244, 10, 7, 0, 9, 0, 7, 0, 11, 0, 4, 0, 87, 1, 4, 0, 1, 3,255, 0, 18, 0, 4, 0,132, 0,
+ 4, 0,245, 10, 4, 0,246, 10, 7, 0,247, 10, 4, 0,248, 10, 7, 0,249, 10, 7, 0,250, 10, 4, 0,251, 10, 7, 0,252, 10,
+ 4, 0,253, 10, 7, 0,254, 10, 0, 1,255, 10, 7, 0, 0, 11, 7, 0, 1, 11, 7, 0, 2, 11, 7, 0, 3, 11, 4, 0, 4, 11,
+ 4, 0, 27, 0,190, 1, 4, 0, 42, 0,244, 2, 7, 0, 5, 11, 7, 0,178, 1, 7, 0, 27, 0,213, 0, 34, 0, 22, 0, 32, 0,
+190, 1, 6, 11, 54, 0,228, 10, 46, 0, 7, 11, 52, 0, 8, 11, 25, 0,154, 0, 0, 0, 9, 11, 7, 0, 10, 11, 2, 0,109, 6,
+ 2, 0, 11, 11, 4, 0,108, 0, 4, 0, 18, 0, 7, 0, 12, 11, 4, 0, 89, 2, 4, 0, 13, 11, 7, 0, 14, 11, 7, 0, 15, 11,
+ 7, 0, 16, 11, 7, 0,178, 1, 4, 0, 17, 11, 7, 0, 18, 11, 0, 0, 19, 11, 0, 0, 20, 11, 0, 0, 21, 11, 0, 0, 22, 11,
+ 7, 0, 23, 11, 7, 0, 24, 11, 7, 0, 25, 11, 7, 0, 1, 3, 7, 0, 26, 11, 4, 0, 27, 11, 7, 0,240, 5, 7, 0, 28, 11,
+ 7, 0, 29, 11,191, 1, 10, 0, 4, 0, 16, 0, 4, 0,128, 0, 4, 0, 18, 0, 4, 0, 15, 4, 4, 0, 30, 11, 4, 0, 31, 11,
+ 4, 0, 32, 11, 4, 0, 73, 0, 0, 0, 19, 0, 11, 0, 2, 0,192, 1, 1, 0, 0, 0, 70, 7, 95, 0, 8, 0,191, 1, 33, 11,
+ 4, 0, 34, 11, 4, 0, 35, 11, 4, 0, 36, 11, 4, 0, 37, 11, 4, 0, 30, 0, 11, 0, 38, 11,192, 1, 39, 11,193, 1, 5, 0,
+ 7, 0,165, 2, 7, 0,240, 2, 7, 0, 39, 2, 2, 0,147, 2, 2, 0, 27, 0,194, 1, 5, 0, 7, 0,165, 2, 7, 0,159, 4,
+ 7, 0, 40, 11, 7, 0, 41, 11, 7, 0,240, 2,195, 1, 5, 0, 27, 0, 42, 11,196, 1, 21, 0, 7, 0, 75, 6, 7, 0, 43, 11,
+ 7, 0, 56, 0,197, 1, 3, 0, 7, 0, 44, 11, 4, 0, 45, 11, 4, 0, 46, 11,198, 1, 7, 0, 4, 0, 47, 11, 4, 0, 48, 11,
+ 4, 0, 49, 11, 7, 0, 50, 11, 7, 0, 51, 11, 7, 0, 52, 11, 7, 0, 56, 0,199, 1, 8, 0,199, 1, 0, 0,199, 1, 1, 0,
+ 27, 0, 44, 0, 4, 0, 3, 1, 2, 0, 18, 0, 2, 0, 87, 1, 7, 0,240, 2, 7, 0, 55, 9,200, 1, 7, 0,200, 1, 0, 0,
+200, 1, 1, 0, 27, 0, 44, 0, 2, 0,225, 2, 2, 0, 18, 0, 2, 0, 13, 2, 2, 0, 56, 0,201, 1, 17, 0,194, 1, 8, 4,
+194, 1, 53, 11,193, 1, 54, 11,194, 1, 38, 9,195, 1, 55, 11, 4, 0, 82, 0, 7, 0,240, 2, 7, 0, 7, 3, 7, 0, 56, 11,
+ 4, 0, 47, 11, 4, 0, 57, 11, 7, 0, 51, 11, 7, 0, 52, 11, 7, 0,108, 0, 4, 0, 58, 11, 2, 0, 18, 0, 2, 0, 59, 11,
+202, 1, 15, 0, 7, 0,255, 0, 7, 0, 60, 11, 7, 0, 44, 11, 7, 0, 61, 11, 7, 0, 62, 11, 7, 0, 63, 11, 7, 0, 64, 11,
+ 7, 0, 65, 11, 7, 0, 66, 11, 7, 0, 67, 11, 7, 0, 68, 11, 7, 0, 69, 11, 7, 0, 70, 11, 4, 0, 18, 0, 4, 0, 71, 11,
+203, 1,128, 0, 22, 0, 32, 0, 34, 0, 75, 0,204, 1, 72, 11,202, 1, 73, 11,187, 0,154, 4, 4, 0, 18, 0, 4, 0, 56, 0,
+ 2, 0, 16, 0, 2, 0, 57, 10, 2, 0, 74, 11, 2, 0,122, 1, 2, 0, 75, 11, 2, 0,232, 3, 2, 0, 76, 11, 2, 0, 77, 11,
+ 2, 0, 78, 11, 2, 0, 79, 11, 2, 0, 80, 11, 2, 0, 81, 11, 2, 0, 82, 11, 2, 0, 83, 11, 2, 0, 84, 11, 2, 0,224, 5,
+ 2, 0, 85, 11, 2, 0, 86, 11, 2, 0, 87, 11, 2, 0, 88, 11, 2, 0, 89, 11, 2, 0, 28, 2, 2, 0, 31, 9, 2, 0, 6, 9,
+ 2, 0, 90, 11, 2, 0, 91, 11, 2, 0, 25, 4, 2, 0, 26, 4, 2, 0, 92, 11, 2, 0, 93, 11, 2, 0, 94, 11, 2, 0, 95, 11,
+ 7, 0, 96, 11, 7, 0, 97, 11, 7, 0, 98, 11, 7, 0, 99, 11, 7, 0,100, 11, 7, 0,101, 11, 7, 0,102, 11, 2, 0,154, 5,
+ 2, 0,103, 11, 7, 0,104, 11, 7, 0,105, 11, 7, 0,106, 11, 7, 0, 13, 9, 7, 0, 90, 0, 7, 0, 7, 3, 7, 0, 19, 9,
+ 7, 0,107, 11, 7, 0,108, 11, 7, 0,109, 11, 7, 0,110, 11, 7, 0,111, 11, 7, 0,112, 11, 4, 0, 14, 9, 4, 0, 12, 9,
+ 4, 0,113, 11, 4, 0,114, 11, 2, 0,115, 11, 2, 0,116, 11, 7, 0, 15, 9, 7, 0, 16, 9, 7, 0, 17, 9, 7, 0,117, 11,
+ 7, 0,118, 11, 7, 0,119, 11, 7, 0,120, 11, 7, 0,121, 11, 7, 0,122, 11, 7, 0,123, 11, 7, 0,124, 11, 7, 0,125, 11,
+ 7, 0,222, 3, 7, 0,108, 0, 7, 0,126, 11, 7, 0,127, 11, 7, 0,128, 11, 7, 0,129, 11, 7, 0,214, 0, 7, 0,130, 11,
+ 4, 0,131, 11, 4, 0,132, 11, 7, 0,133, 11, 7, 0,134, 11, 7, 0,135, 11, 7, 0,136, 11, 7, 0,137, 11, 7, 0,213, 0,
+ 7, 0,138, 11, 7, 0, 52, 4, 7, 0, 50, 4, 7, 0, 51, 4, 7, 0,139, 11, 7, 0,140, 11, 7, 0,141, 11, 7, 0,142, 11,
+ 7, 0,143, 11, 7, 0,144, 11, 7, 0,145, 11, 7, 0,146, 11, 7, 0,147, 11, 7, 0,148, 11, 7, 0,149, 11, 7, 0,150, 11,
+ 7, 0,151, 11, 7, 0,152, 11, 7, 0,153, 11, 7, 0,154, 11, 7, 0,155, 11, 7, 0,156, 11, 4, 0,157, 11, 4, 0,158, 11,
+ 46, 0,140, 1, 64, 0, 0, 4, 14, 0,159, 11, 64, 0,160, 11, 27, 0,161, 11, 27, 0,162, 11, 31, 0, 80, 0,182, 0, 73, 1,
+182, 0,163, 11,150, 0, 52, 0,150, 0, 0, 0,150, 0, 1, 0,203, 1,164, 11,201, 1,165, 11,198, 1,216, 9,190, 0, 80, 4,
+ 11, 0, 81, 4,205, 1,166, 11,205, 1,167, 11, 14, 0,168, 11, 14, 0,169, 11,135, 0,170, 11,143, 0,171, 11,143, 0,172, 11,
+ 27, 0,173, 11, 27, 0,174, 11, 27, 0, 38, 0, 14, 0, 24, 10, 0, 0, 19, 0, 7, 0,244, 0, 7, 0, 36, 3, 7, 0,175, 11,
+ 7, 0,176, 11, 4, 0,214, 2, 4, 0,177, 11, 4, 0, 18, 0, 4, 0, 14, 9, 4, 0,178, 11, 4, 0,179, 11, 4, 0,180, 11,
+ 4, 0,181, 11, 2, 0,251, 0, 2, 0,182, 11, 2, 0,183, 11, 2, 0,184, 11, 0, 0,185, 11, 2, 0,186, 11, 2, 0,187, 11,
+ 2, 0,188, 11, 11, 0,189, 11,139, 0,153, 4, 14, 0, 21, 3, 14, 0,190, 11,197, 1,191, 11, 4, 0,192, 11, 4, 0,193, 11,
+206, 1,194, 11,141, 0, 33, 3,207, 1,195, 11, 7, 0,196, 11, 7, 0,197, 11, 7, 0,198, 11,137, 0, 38, 0,208, 1,150, 9,
+ 7, 0,123, 4, 7, 0,199, 11, 7, 0,200, 11, 7, 0, 75, 6, 7, 0,236, 3, 7, 0,222, 3, 7, 0,201, 11, 7, 0, 91, 2,
+ 7, 0,202, 11, 7, 0,203, 11, 7, 0,204, 11, 7, 0,205, 11, 7, 0,206, 11, 7, 0,207, 11, 7, 0,124, 4, 7, 0,208, 11,
+ 7, 0,209, 11, 7, 0,210, 11, 7, 0,125, 4, 7, 0,121, 4, 7, 0,122, 4, 7, 0,211, 11, 7, 0,212, 11, 7, 0,213, 11,
+ 4, 0,214, 11, 4, 0, 92, 0, 4, 0,215, 11, 4, 0,216, 11, 2, 0,217, 11, 2, 0,218, 11, 2, 0,219, 11, 2, 0,220, 11,
+ 2, 0,221, 11, 2, 0,222, 11, 2, 0,223, 11, 2, 0, 27, 0,187, 0,154, 4,138, 0, 11, 0,208, 1,224, 11, 7, 0,225, 11,
+ 7, 0,226, 11, 7, 0,250, 1, 7, 0,227, 11, 7, 0,228, 11, 7, 0,229, 11, 4, 0, 92, 0, 2, 0,230, 11, 2, 0,231, 11,
+ 64, 0,249, 1,209, 1, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0, 7, 0,232, 11,210, 1, 6, 0,210, 1, 0, 0,
+210, 1, 1, 0,209, 1,192, 9, 4, 0, 1, 1, 2, 0,233, 11, 2, 0, 18, 0,211, 1, 5, 0,211, 1, 0, 0,211, 1, 1, 0,
+ 14, 0,234, 11, 4, 0,235, 11, 4, 0, 18, 0,212, 1, 9, 0,212, 1, 0, 0,212, 1, 1, 0, 14, 0,127, 0,211, 1,236, 11,
+ 4, 0, 18, 0, 2, 0,233, 11, 2, 0,237, 11, 7, 0, 93, 0, 0, 0,238, 11,178, 0, 6, 0, 22, 0, 32, 0, 14, 0,123, 5,
+ 4, 0, 18, 0, 2, 0,239, 11, 2, 0,240, 11, 11, 0,241, 11,213, 1, 6, 0, 14, 0,242, 11, 4, 0,243, 11, 4, 0,244, 11,
+ 4, 0, 18, 0, 4, 0, 27, 0,237, 0,245, 11,214, 1, 19, 0, 22, 0, 32, 0,215, 1,246, 11,215, 1,247, 11, 14, 0,248, 11,
+ 4, 0,249, 11, 2, 0,250, 11, 2, 0,251, 11, 14, 0,252, 11, 14, 0,253, 11,213, 1,254, 11, 14, 0,255, 11, 14, 0, 0, 12,
+ 14, 0, 1, 12, 14, 0, 2, 12,216, 1, 3, 12,216, 1, 4, 12,216, 1, 5, 12, 14, 0, 6, 12,237, 0, 7, 12,215, 1, 32, 0,
+215, 1, 0, 0,215, 1, 1, 0, 11, 0, 8, 12, 4, 0,119, 8, 2, 0, 9, 12, 2, 0, 27, 0, 27, 1, 10, 12, 27, 1, 11, 12,
+ 0, 0, 12, 12, 2, 0, 13, 12, 2, 0, 14, 12, 2, 0,141, 8, 2, 0,142, 8, 2, 0, 15, 12, 2, 0, 16, 12, 2, 0, 15, 4,
+ 2, 0, 53, 7, 2, 0, 17, 12, 2, 0, 18, 12, 2, 0, 19, 12, 2, 0, 30, 0,217, 1, 20, 12,218, 1, 21, 12,219, 1, 22, 12,
+ 4, 0, 23, 12, 4, 0, 24, 12, 11, 0, 25, 12, 14, 0,253, 11, 14, 0,160, 8, 14, 0, 26, 12, 14, 0, 27, 12, 14, 0, 28, 12,
+220, 1, 17, 0,220, 1, 0, 0,220, 1, 1, 0, 0, 0, 29, 12, 21, 0, 31, 0, 2, 0, 30, 12, 2, 0, 16, 0, 2, 0, 14, 0,
+ 2, 0, 31, 12, 2, 0, 32, 12, 2, 0, 33, 12, 2, 0, 34, 12, 2, 0, 35, 12, 2, 0, 18, 0, 2, 0, 36, 12, 2, 0, 32, 0,
+ 2, 0, 27, 0,221, 1, 37, 12,222, 1, 4, 0,222, 1, 0, 0,222, 1, 1, 0,220, 1, 38, 12,220, 1, 39, 12,223, 1, 11, 0,
+223, 1, 0, 0,223, 1, 1, 0, 14, 0, 40, 12, 14, 0, 41, 12, 0, 0, 29, 12, 2, 0, 42, 12, 2, 0, 43, 12, 2, 0, 18, 0,
+ 2, 0, 44, 12, 4, 0, 45, 12, 11, 0, 46, 12,216, 1, 7, 0,216, 1, 0, 0,216, 1, 1, 0, 0, 0, 29, 12, 0, 0, 47, 12,
+ 14, 0, 59, 8, 4, 0, 48, 12, 4, 0, 18, 0,249, 0, 14, 0,249, 0, 0, 0,249, 0, 1, 0, 0, 0, 29, 12, 21, 0, 31, 0,
+224, 1,135, 8, 11, 0, 49, 12, 11, 0, 50, 12,221, 1, 37, 12,213, 1, 51, 12, 14, 0, 52, 12,249, 0, 53, 12, 32, 1,239, 6,
+ 2, 0, 18, 0, 2, 0, 86, 1,225, 1, 12, 0,225, 1, 0, 0,225, 1, 1, 0, 11, 0, 2, 0, 11, 0, 54, 12, 0, 0, 19, 0,
+ 2, 0, 16, 0, 2, 0, 18, 0, 7, 0,138, 9, 7, 0,129, 0, 7, 0,132, 4, 7, 0, 88, 9, 7, 0, 80, 10,226, 1, 5, 0,
+ 7, 0, 55, 12, 4, 0, 56, 12, 4, 0, 57, 12, 4, 0, 87, 1, 4, 0, 18, 0,227, 1, 6, 0, 7, 0, 58, 12, 7, 0, 59, 12,
+ 7, 0, 60, 12, 7, 0, 61, 12, 4, 0, 16, 0, 4, 0, 18, 0,228, 1, 5, 0, 7, 0,116, 9, 7, 0,117, 9, 7, 0,240, 2,
+ 2, 0, 42, 2, 2, 0, 43, 2,229, 1, 5, 0,228, 1, 2, 0, 4, 0, 53, 0, 7, 0, 62, 12, 7, 0,116, 9, 7, 0,117, 9,
+230, 1, 4, 0, 2, 0, 63, 12, 2, 0, 64, 12, 2, 0, 65, 12, 2, 0, 66, 12,231, 1, 2, 0, 37, 0, 37, 7, 21, 0,156, 9,
+232, 1, 3, 0, 19, 0, 67, 12, 4, 0, 18, 0, 4, 0, 27, 0,233, 1, 6, 0, 7, 0,108, 0, 7, 0,209, 2, 7, 0, 68, 12,
+ 7, 0, 27, 0, 2, 0,250, 0, 2, 0, 69, 12,234, 1, 5, 0, 7, 0, 70, 12, 7, 0,128, 0, 7, 0,193, 9, 7, 0,194, 9,
+ 4, 0, 18, 0,235, 1, 6, 0, 22, 0, 42, 7, 0, 0, 71, 12, 0, 0, 72, 12, 2, 0, 73, 12, 2, 0, 18, 0, 4, 0, 74, 12,
+236, 1, 7, 0,236, 1, 0, 0,236, 1, 1, 0, 0, 0, 19, 0,235, 1, 75, 12, 2, 0, 76, 12, 2, 0, 16, 0, 7, 0, 60, 0,
+237, 1, 7, 0, 14, 0, 77, 12, 0, 0, 78, 12, 11, 0, 79, 12, 7, 0, 60, 0, 7, 0,138, 9, 4, 0, 16, 0, 4, 0, 18, 0,
+238, 1, 3, 0, 7, 0, 80, 12, 4, 0, 18, 0, 4, 0, 27, 0,239, 1, 15, 0,239, 1, 0, 0,239, 1, 1, 0,106, 1, 11, 10,
+237, 1, 61, 0, 14, 0,188, 3, 30, 0, 49, 0,238, 1, 81, 12, 4, 0, 53, 0, 7, 0, 60, 0, 2, 0, 18, 0, 2, 0, 22, 1,
+ 4, 0, 82, 12, 0, 0, 71, 12, 4, 0, 83, 12, 7, 0, 84, 12,240, 1, 2, 0, 0, 0, 85, 12, 0, 0, 86, 12,241, 1, 4, 0,
+241, 1, 0, 0,241, 1, 1, 0,176, 0, 70, 3, 14, 0, 87, 12,242, 1, 25, 0,242, 1, 0, 0,242, 1, 1, 0, 14, 0, 88, 12,
+176, 0, 86, 9,241, 1, 89, 12, 14, 0, 90, 12, 14, 0,188, 3, 0, 0, 19, 0, 7, 0,138, 9, 7, 0, 91, 12, 7, 0, 89, 0,
+ 7, 0, 90, 0, 7, 0, 76, 10, 7, 0, 77, 10, 7, 0,253, 2, 7, 0,148, 3, 7, 0, 88, 9, 7, 0, 80, 10, 2, 0, 92, 12,
+ 2, 0, 93, 12, 2, 0, 91, 0, 2, 0, 16, 0, 11, 0, 94, 12, 4, 0, 18, 0, 4, 0, 30, 0,243, 1, 6, 0,243, 1, 0, 0,
+243, 1, 1, 0, 14, 0, 88, 12, 4, 0, 18, 0, 4, 0, 13, 2, 0, 0, 19, 0,244, 1, 11, 0,244, 1, 0, 0,244, 1, 1, 0,
+ 22, 0, 42, 7, 0, 0, 95, 12, 4, 0, 74, 12, 2, 0, 96, 12, 2, 0, 27, 0, 0, 0, 71, 12, 4, 0, 82, 12, 2, 0, 18, 0,
+ 2, 0, 97, 12,245, 1, 10, 0,245, 1, 0, 0,245, 1, 1, 0, 14, 0, 98, 12, 0, 0, 29, 12, 0, 0, 19, 0, 0, 0, 99, 12,
+ 0, 0,100, 12, 2, 0, 18, 0, 2, 0, 97, 12, 4, 0,101, 12,246, 1, 5, 0,246, 1, 0, 0,246, 1, 1, 0, 0, 0, 71, 12,
+ 4, 0, 82, 12, 7, 0,230, 2, 34, 0, 12, 0,176, 0,179, 3,176, 0,102, 12,241, 1, 89, 12, 14, 0,103, 12,242, 1,104, 12,
+ 14, 0,105, 12, 14, 0,106, 12, 4, 0, 18, 0, 4, 0,251, 0, 2, 0,107, 12, 2, 0,108, 12, 7, 0,109, 12,247, 1, 2, 0,
+ 22, 0, 32, 0, 34, 0, 75, 0,248, 1, 5, 0,248, 1, 0, 0,248, 1, 1, 0, 4, 0, 16, 0, 4, 0, 18, 0, 0, 0,172, 5,
+249, 1, 6, 0,248, 1,110, 12, 27, 0, 44, 0, 4, 0,111, 12, 7, 0,112, 12, 4, 0,113, 12, 4, 0,253, 9,250, 1, 3, 0,
+248, 1,110, 12, 4, 0,111, 12, 7, 0,114, 12,251, 1, 8, 0,248, 1,110, 12, 27, 0, 44, 0, 7, 0, 77, 1, 7, 0,115, 12,
+ 7, 0, 36, 3, 7, 0,149, 9, 4, 0,111, 12, 4, 0,116, 12,252, 1, 5, 0,248, 1,110, 12, 7, 0,117, 12, 7, 0,176, 2,
+ 7, 0, 3, 3, 7, 0, 56, 0,253, 1, 3, 0,248, 1,110, 12, 7, 0,149, 9, 7, 0,118, 12,196, 1, 4, 0, 7, 0,119, 12,
+ 7, 0,127, 11, 2, 0,120, 12, 2, 0, 87, 1,254, 1, 14, 0,254, 1, 0, 0,254, 1, 1, 0, 14, 0,121, 12, 14, 0,122, 12,
+ 14, 0,123, 12, 0, 0,172, 5, 4, 0, 32, 0, 4, 0, 18, 0, 4, 0,124, 12, 7, 0,125, 12, 4, 0,113, 12, 4, 0,253, 9,
+ 7, 0, 84, 4, 7, 0, 5, 3,204, 1, 23, 0, 4, 0,111, 12, 4, 0,126, 12, 7, 0,127, 12, 7, 0, 1, 3, 7, 0,128, 12,
+ 7, 0,229, 8, 7, 0,119, 12, 7, 0,129, 12, 7, 0,209, 2, 7, 0,247, 10, 7, 0,217, 4, 7, 0,130, 12, 7, 0,131, 12,
+ 7, 0,132, 12, 7, 0,133, 12, 7, 0,134, 12, 7, 0,135, 12, 7, 0,136, 12, 7, 0,137, 12, 7, 0,138, 12, 7, 0,139, 12,
+ 7, 0,140, 12, 14, 0,141, 12,123, 0, 40, 0,122, 0,142, 12,255, 1, 73, 11, 64, 0,143, 12, 64, 0,160, 11, 64, 0,144, 12,
+ 0, 2,145, 12, 43, 0,169, 0, 43, 0,146, 12, 43, 0,147, 12, 7, 0,148, 12, 7, 0,149, 12, 7, 0,150, 12, 7, 0,151, 12,
+ 7, 0,152, 12, 7, 0,118, 8, 7, 0,153, 12, 7, 0,178, 1, 7, 0,154, 12, 4, 0,155, 12, 4, 0,156, 12, 4, 0,157, 12,
+ 4, 0, 92, 0, 4, 0, 27, 0, 4, 0,158, 12, 2, 0,159, 12, 2, 0,160, 12, 4, 0,161, 12, 7, 0,209, 2, 4, 0,162, 12,
+ 7, 0,163, 12, 4, 0,164, 12, 4, 0,165, 12, 4, 0,166, 12,139, 0,167, 12, 14, 0,168, 12,187, 0,154, 4, 4, 0,169, 12,
+ 7, 0,170, 12, 7, 0,171, 12, 4, 0, 30, 0,124, 0, 12, 0,122, 0,142, 12,150, 0, 56, 3, 7, 0,143, 1, 7, 0,118, 8,
+ 7, 0,172, 12, 7, 0,173, 12, 7, 0,174, 12, 2, 0,175, 12, 2, 0,176, 12, 2, 0,177, 12, 2, 0, 16, 0, 4, 0, 92, 0,
+125, 0, 13, 0,122, 0,142, 12,141, 0, 33, 3,143, 0, 35, 3, 7, 0,192, 9, 7, 0,178, 12, 7, 0,179, 12, 7, 0, 79, 1,
+ 7, 0,180, 12, 4, 0, 33, 10, 4, 0, 29, 3, 2, 0, 16, 0, 2, 0, 27, 0, 4, 0, 30, 0, 1, 2, 15, 0, 22, 0, 32, 0,
+ 34, 0, 75, 0, 46, 1,227, 8, 7, 0,181, 12, 7, 0,182, 12, 7, 0,183, 12, 7, 0,184, 12, 7, 0,148, 9, 7, 0,185, 12,
+ 7, 0,186, 12, 7, 0,187, 12, 7, 0, 84, 4, 7, 0,229, 8, 2, 0, 18, 0, 2, 0,112, 9,231, 0, 3, 0, 4, 0,126, 0,
+ 2, 0,215, 6, 2, 0,188, 12, 2, 2, 5, 0, 0, 0,193, 8, 2, 0,194, 8, 2, 0, 72, 5, 2, 0,189, 12, 2, 0,190, 12,
+229, 0, 16, 0, 22, 0, 32, 0, 34, 0, 75, 0, 0, 0, 35, 0, 4, 0,143, 0, 4, 0,144, 0, 4, 0,191, 12, 7, 0,162, 0,
+ 7, 0,163, 0, 44, 0,138, 0, 3, 2,150, 9,178, 0,182, 3, 4, 2,192, 12, 11, 0,193, 12, 2, 2,194, 12, 4, 0, 18, 0,
+ 4, 0, 22, 0, 13, 1, 10, 0, 4, 0,132, 0, 4, 0,195, 12, 52, 0,196, 12, 7, 0,197, 12, 2, 0,198, 12, 0, 0,181, 2,
+ 4, 0,126, 0, 5, 2,175, 3, 6, 2,199, 12, 7, 0,200, 12, 7, 2, 3, 0, 4, 0,126, 0, 7, 0,201, 12, 7, 0, 79, 1,
+ 8, 2, 11, 0, 11, 0,202, 12, 7, 0,203, 12, 7, 0,204, 12, 7, 0, 27, 0, 7, 0,205, 12, 2, 0,206, 12, 2, 0, 91, 0,
+ 7, 0,207, 12, 7, 0,208, 12, 7, 0,209, 12, 7, 0,210, 12, 6, 2, 3, 0, 7, 0,211, 12, 4, 0,126, 0, 4, 0, 18, 0,
+ 5, 2, 24, 0, 5, 2, 0, 0, 5, 2, 1, 0, 0, 0, 19, 0, 7, 0,212, 12, 7, 0,213, 12, 7, 0,214, 12, 7, 0,215, 12,
+ 7, 0, 5, 11, 4, 0,216, 12, 4, 0,217, 12, 6, 2,218, 12, 7, 0,219, 12, 7, 0,201, 12, 4, 0, 18, 0, 4, 0,220, 12,
+ 4, 0,221, 12, 7, 0, 84, 12, 2, 0,222, 12, 2, 0,227, 3, 2, 0,223, 12, 2, 0,224, 12, 2, 0,225, 12, 2, 0, 30, 0,
+ 7, 0,226, 12, 9, 2, 22, 0, 4, 0, 18, 0, 2, 0,227, 12, 2, 0,228, 12, 7, 0,229, 12, 2, 0,230, 12, 2, 0,231, 12,
+ 2, 0,232, 12, 2, 0,233, 12, 2, 0,234, 12, 2, 0,235, 12, 2, 0,236, 12, 2, 0, 3, 3, 4, 0,237, 12, 4, 0,238, 12,
+ 2, 0,239, 12, 2, 0,240, 12, 7, 0, 94, 1, 4, 0,241, 12, 4, 0,242, 12, 7, 0,243, 12, 7, 0,244, 12, 4, 0, 74, 0,
+ 10, 2, 12, 0, 4, 0, 18, 0, 4, 0,245, 12, 4, 0,246, 12, 7, 0,247, 12, 5, 2,248, 12, 7, 0,249, 12, 7, 0,250, 12,
+ 7, 0,251, 12, 4, 0,190, 1, 4, 0,132, 0, 7, 0,148, 3, 52, 0,252, 12, 11, 2, 5, 0, 4, 0, 18, 0, 7, 0,201, 12,
+ 4, 0,253, 12, 4, 0,254, 12, 7, 2,255, 12, 12, 2, 7, 0, 12, 2, 0, 0, 12, 2, 1, 0, 0, 0, 19, 0, 4, 0, 18, 0,
+ 7, 0,148, 3, 14, 0, 0, 13, 11, 2, 1, 13, 13, 2, 1, 0, 0, 0, 2, 13, 4, 2, 10, 0, 9, 2, 3, 13, 8, 2, 4, 13,
+ 14, 0, 0, 13, 11, 2, 1, 13, 10, 2, 5, 13, 5, 2, 6, 13, 14, 0, 7, 13, 4, 0, 8, 13, 4, 0, 9, 13, 13, 2, 90, 6,
+ 14, 2, 48, 0, 14, 2, 0, 0, 14, 2, 1, 0,169, 0,145, 3, 15, 2, 2, 0, 64, 0, 10, 13,187, 0,154, 4,139, 0,153, 4,
+ 14, 0, 21, 3, 4, 0, 11, 13, 0, 0, 19, 0, 2, 0,162, 10, 2, 0, 16, 0, 2, 0, 12, 13, 2, 0, 13, 13, 2, 0, 14, 13,
+ 2, 0, 15, 13, 2, 0, 16, 13, 2, 0, 17, 13, 4, 0, 92, 0, 4, 0,186, 3, 4, 0, 18, 13, 4, 0, 19, 13, 4, 0,193, 9,
+ 4, 0,194, 9, 4, 0, 27, 0, 7, 0, 20, 13, 47, 0, 21, 13, 0, 0, 22, 13, 4, 0, 23, 13, 4, 0,161, 12, 7, 0, 24, 13,
+ 7, 0, 25, 13, 7, 0, 26, 13, 7, 0, 27, 13, 7, 0, 28, 13, 7, 0, 29, 13, 7, 0, 30, 13, 7, 0, 31, 13, 7, 0, 32, 13,
+ 7, 0, 33, 13, 7, 0, 34, 13, 7, 0, 35, 13, 7, 0, 36, 13, 7, 0, 37, 13, 0, 0,202, 2, 0, 0, 38, 13, 0, 0, 39, 13,
+ 0, 0, 40, 13,169, 0, 7, 0,168, 0, 41, 13,143, 0, 35, 3, 14, 0, 42, 13, 2, 0, 43, 13, 2, 0, 92, 0, 4, 0, 27, 0,
+ 0, 0, 44, 13,170, 0, 24, 0,168, 0, 41, 13,143, 0, 35, 3,150, 0, 56, 3, 63, 0, 25, 2, 4, 0, 92, 0, 4, 0, 45, 13,
+ 7, 0,185, 0, 7, 0,186, 0, 7, 0,187, 0, 7, 0,178, 1, 7, 0, 46, 13, 7, 0, 47, 13, 7, 0, 48, 13, 7, 0, 49, 13,
+ 50, 0, 50, 13, 50, 0, 51, 13, 2, 0, 52, 13, 2, 0,222, 10, 2, 0, 53, 13, 2, 0, 27, 0, 7, 0, 54, 13, 7, 0, 55, 13,
+ 7, 0, 56, 13, 7, 0, 57, 13, 69, 78, 68, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0};
diff --git a/source/blender/editors/gpencil/CMakeLists.txt b/source/blender/editors/gpencil/CMakeLists.txt
index 15707bfc4d0..762db26bc4f 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
@@ -46,4 +47,8 @@ set(SRC
gpencil_intern.h
)
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_editor_gpencil "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/gpencil/SConscript b/source/blender/editors/gpencil/SConscript
index 6c23e77208a..9d92a238eb7 100644
--- a/source/blender/editors/gpencil/SConscript
+++ b/source/blender/editors/gpencil/SConscript
@@ -5,7 +5,12 @@ 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] )
+defs = []
+
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
+env.BlenderLib ( 'bf_editors_gpencil', sources, Split(incs), defs, libtype=['core'], priority=[45] )
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index cf3961e0820..8f0ea378a2a 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -79,7 +79,7 @@ typedef enum eDrawStrokeFlags {
GP_DRAWDATA_ONLYV2D = (1<<2), /* only draw 'canvas' strokes */
GP_DRAWDATA_ONLYI2D = (1<<3), /* only draw 'image' strokes */
GP_DRAWDATA_IEDITHACK = (1<<4), /* special hack for drawing strokes in Image Editor (weird coordinates) */
- GP_DRAWDATA_NO_XRAY = (1<<5), /* dont draw xray in 3D view (which is default) */
+ GP_DRAWDATA_NO_XRAY = (1<<5), /* don't draw xray in 3D view (which is default) */
} eDrawStrokeFlags;
@@ -117,7 +117,7 @@ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thick
float oldpressure = points[0].pressure;
/* draw stroke curve */
- if (G.f & G_DEBUG) setlinestyle(2);
+ if (G.debug & G_DEBUG) setlinestyle(2);
glLineWidth(oldpressure * thickness);
glBegin(GL_LINE_STRIP);
@@ -147,7 +147,7 @@ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thick
/* reset for predictable OpenGL context */
glLineWidth(1.0f);
- if (G.f & G_DEBUG) setlinestyle(0);
+ if (G.debug & G_DEBUG) setlinestyle(0);
}
}
@@ -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();
@@ -286,11 +285,10 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness_s
glEnd();
}
- /* tesselation code - draw stroke as series of connected quads with connection
+ /* tessellation code - draw stroke as series of connected quads with connection
* edges rotated to minimise shrinking artifacts, and rounded endcaps
*/
- else
- {
+ else {
bGPDspoint *pt1, *pt2;
float pm[2];
int i;
@@ -300,7 +298,7 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness_s
for (i=0, pt1=points, pt2=points+1; i < (totpoints-1); i++, pt1++, pt2++) {
float s0[2], s1[2]; /* segment 'center' points */
- float t0[2], t1[2]; /* tesselated coordinates */
+ float t0[2], t1[2]; /* tessellated coordinates */
float m1[2], m2[2]; /* gradient and normal */
float mt[2], sc[2]; /* gradient for thickness, point for end-cap */
float pthick; /* thickness at segment point */
@@ -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);
}
@@ -515,12 +513,12 @@ static void gp_draw_strokes (bGPDframe *gpf, int offsx, int offsy, int winx, int
glDepthMask(0);
glEnable(GL_DEPTH_TEST);
- /* first arg is normally rv3d->dist, but this isnt available here and seems to work quite well without */
+ /* first arg is normally rv3d->dist, but this isn't 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)
@@ -785,7 +783,7 @@ void draw_gpencil_view3d (Scene *scene, View3D *v3d, ARegion *ar, short only3d)
gpd= gpencil_data_get_active_v3d(scene); // XXX
if (gpd == NULL) return;
- /* when rendering to the offscreen buffer we dont want to
+ /* when rendering to the offscreen buffer we don't want to
* deal with the camera border, otherwise map the coords to the camera border. */
if ((rv3d->persp == RV3D_CAMOB) && !(G.f & G_RENDER_OGL)) {
rctf rectf;
@@ -793,10 +791,10 @@ void draw_gpencil_view3d (Scene *scene, View3D *v3d, ARegion *ar, short only3d)
BLI_copy_rcti_rctf(&rect, &rectf);
}
else {
- rect.xmin= 0;
- rect.ymin= 0;
- rect.xmax= ar->winx;
- rect.ymax= ar->winy;
+ rect.xmin = 0;
+ rect.ymin = 0;
+ rect.xmax = ar->winx;
+ rect.ymax = ar->winy;
}
/* draw it! */
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c
index 81a5f6777e7..3b0847c2e0f 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -561,7 +561,7 @@ static short mirror_gpf_xaxis (bGPDframe *gpf, Scene *scene)
static short mirror_gpf_marker (bGPDframe *gpf, Scene *scene)
{
static TimeMarker *marker;
- static short initialised = 0;
+ static short initialized = 0;
int diff;
/* In order for this mirror function to work without
@@ -580,17 +580,17 @@ static short mirror_gpf_marker (bGPDframe *gpf, Scene *scene)
}
}
else {
- /* initialisation time */
- if (initialised) {
+ /* initialization time */
+ if (initialized) {
/* reset everything for safety */
marker = NULL;
- initialised = 0;
+ initialized = 0;
}
else {
/* try to find a marker */
marker= ED_markers_get_first_selected(&scene->markers);
- if(marker) {
- initialised= 1;
+ if (marker) {
+ initialized= 1;
}
}
}
diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c
index 53ef16a70a0..263c842ed08 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,98 +177,97 @@ 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);
/* debugging options */
- if (G.f & G_DEBUG) {
+ if (G.debug & G_DEBUG) {
uiItemR(col, &ptr, "show_points", 0, NULL, ICON_NONE);
}
/* 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,19 +289,19 @@ 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 whereever Grease Pencil is used... */
+/* Standard panel to be included wherever Grease Pencil is used... */
void gpencil_panel_standard(const bContext *C, Panel *pa)
{
bGPdata **gpd_ptr = NULL;
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_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 9a492153b7f..d48cfaab63c 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -143,7 +143,7 @@ bGPdata **gpencil_data_get_pointers (bContext *C, PointerRNA *ptr)
SpaceClip *sc= (SpaceClip *)CTX_wm_space_data(C);
MovieClip *clip= ED_space_clip(sc);
- if(clip) {
+ if (clip) {
/* for now, as long as there's a clip, default to using that in Clip Editor */
if (ptr) RNA_id_pointer_create(&clip->id, ptr);
return &clip->gpd;
@@ -213,14 +213,14 @@ static int gp_data_add_exec (bContext *C, wmOperator *op)
void GPENCIL_OT_data_add (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Grease Pencil Add New";
- ot->idname= "GPENCIL_OT_data_add";
- ot->description= "Add new Grease Pencil datablock";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Grease Pencil Add New";
+ ot->idname = "GPENCIL_OT_data_add";
+ ot->description = "Add new Grease Pencil datablock";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* callbacks */
- ot->exec= gp_data_add_exec;
- ot->poll= gp_add_poll;
+ ot->exec = gp_data_add_exec;
+ ot->poll = gp_add_poll;
}
/* ******************* Unlink Data ************************ */
@@ -261,14 +261,14 @@ static int gp_data_unlink_exec (bContext *C, wmOperator *op)
void GPENCIL_OT_data_unlink (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Grease Pencil Unlink";
- ot->idname= "GPENCIL_OT_data_unlink";
- ot->description= "Unlink active Grease Pencil datablock";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Grease Pencil Unlink";
+ ot->idname = "GPENCIL_OT_data_unlink";
+ ot->description = "Unlink active Grease Pencil datablock";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* callbacks */
- ot->exec= gp_data_unlink_exec;
- ot->poll= gp_data_unlink_poll;
+ ot->exec = gp_data_unlink_exec;
+ ot->poll = gp_data_unlink_poll;
}
/* ******************* Add New Layer ************************ */
@@ -298,14 +298,14 @@ static int gp_layer_add_exec (bContext *C, wmOperator *op)
void GPENCIL_OT_layer_add (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add New Layer";
- ot->idname= "GPENCIL_OT_layer_add";
- ot->description= "Add new Grease Pencil layer for the active Grease Pencil datablock";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Add New Layer";
+ ot->idname = "GPENCIL_OT_layer_add";
+ ot->description = "Add new Grease Pencil layer for the active Grease Pencil datablock";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* callbacks */
- ot->exec= gp_layer_add_exec;
- ot->poll= gp_add_poll;
+ ot->exec = gp_layer_add_exec;
+ ot->poll = gp_add_poll;
}
/* ******************* Delete Active Frame ************************ */
@@ -332,7 +332,7 @@ static int gp_actframe_delete_exec (bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "No Grease Pencil data");
return OPERATOR_CANCELLED;
}
- if ELEM(NULL, gpl, gpf) {
+ if (ELEM(NULL, gpl, gpf)) {
BKE_report(op->reports, RPT_ERROR, "No active frame to delete");
return OPERATOR_CANCELLED;
}
@@ -349,14 +349,14 @@ static int gp_actframe_delete_exec (bContext *C, wmOperator *op)
void GPENCIL_OT_active_frame_delete (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Active Frame";
- ot->idname= "GPENCIL_OT_active_frame_delete";
- ot->description= "Delete the active frame for the active Grease Pencil datablock";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Delete Active Frame";
+ ot->idname = "GPENCIL_OT_active_frame_delete";
+ ot->description = "Delete the active frame for the active Grease Pencil datablock";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* callbacks */
- ot->exec= gp_actframe_delete_exec;
- ot->poll= gp_actframe_delete_poll;
+ ot->exec = gp_actframe_delete_exec;
+ ot->poll = gp_actframe_delete_poll;
}
/* ************************************************ */
@@ -402,7 +402,7 @@ static void gp_strokepoint_convertcoords (bContext *C, bGPDstroke *gps, bGPDspoi
VECCOPY2D(mvalf, mvali);
}
else {
- if(subrect) {
+ if (subrect) {
mvalf[0]= (((float)pt->x/100.0f) * (subrect->xmax - subrect->xmin)) + subrect->xmin;
mvalf[1]= (((float)pt->y/100.0f) * (subrect->ymax - subrect->ymin)) + subrect->ymin;
}
@@ -561,7 +561,7 @@ static void gp_layer_to_curve (bContext *C, bGPdata *gpd, bGPDlayer *gpl, short
return;
/* initialize camera framing */
- if(gp_camera_view_subrect(C, &subrect)) {
+ if (gp_camera_view_subrect(C, &subrect)) {
subrect_ptr= &subrect;
}
@@ -632,21 +632,21 @@ static int gp_convert_layer_exec (bContext *C, wmOperator *op)
void GPENCIL_OT_convert (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Convert Grease Pencil";
- ot->idname= "GPENCIL_OT_convert";
- ot->description= "Convert the active Grease Pencil layer to a new Object";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Convert Grease Pencil";
+ ot->idname = "GPENCIL_OT_convert";
+ ot->description = "Convert the active Grease Pencil layer to a new Object";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= gp_convert_layer_exec;
- ot->poll= gp_convert_poll;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = gp_convert_layer_exec;
+ ot->poll = gp_convert_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_gpencil_convertmodes, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_gpencil_convertmodes, 0, "Type", "");
}
/* ************************************************ */
diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c
index 954c79bb17d..0afe791029f 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -50,7 +50,7 @@
void ED_keymap_gpencil(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "Grease Pencil", 0, 0);
+ wmKeyMap *keymap = WM_keymap_find(keyconf, "Grease Pencil", 0, 0);
wmKeyMapItem *kmi;
/* Draw */
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 8d2454ffac4..c366de6fa43 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,14 +516,12 @@ 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];
- /* initialise values */
+ /* initialize values */
co[0]= 0;
co[1]= 0;
pressure = 0;
@@ -572,14 +569,14 @@ static void gp_stroke_newfrombuffer (tGPsdata *p)
/* exit with error if no valid points from this stroke */
if (totelem == 0) {
- if (G.f & G_DEBUG)
- printf("Error: No valid points in stroke buffer to convert (tot=%d) \n", gpd->sbuffer_size);
+ if (G.debug & G_DEBUG)
+ printf("Error: No valid points in stroke buffer to convert (tot=%d)\n", gpd->sbuffer_size);
return;
}
/* 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;
@@ -701,7 +698,7 @@ static void gp_stroke_newfrombuffer (tGPsdata *p)
pt= gps->points;
- /* convert all points (normal behaviour) */
+ /* convert all points (normal behavior) */
for (i=0, ptc=gpd->sbuffer; i < gpd->sbuffer_size && ptc; i++, ptc++, pt++) {
/* convert screen-coordinates to appropriate coordinates (and store them) */
gp_stroke_convertcoords(p, &ptc->x, &pt->x, depth_arr ? depth_arr+i:NULL);
@@ -802,7 +799,7 @@ static short gp_stroke_eraser_strokeinside (int mval[], int UNUSED(mvalo[]), sho
}
/* eraser tool - evaluation per stroke */
-// TODO: this could really do with some optimisation (KD-Tree/BVH?)
+// TODO: this could really do with some optimization (KD-Tree/BVH?)
static void gp_stroke_eraser_dostroke (tGPsdata *p, int mval[], int mvalo[], short rad, rcti *rect, bGPDframe *gpf, bGPDstroke *gps)
{
bGPDspoint *pt1, *pt2;
@@ -905,7 +902,7 @@ static void gp_stroke_eraser_dostroke (tGPsdata *p, int mval[], int mvalo[], sho
}
#endif
else {
- if(p->subrect == NULL) { /* normal 3D view */
+ if (p->subrect == NULL) { /* normal 3D view */
x0= (int)(pt1->x / 100 * p->ar->winx);
y0= (int)(pt1->y / 100 * p->ar->winy);
x1= (int)(pt2->x / 100 * p->ar->winx);
@@ -943,10 +940,10 @@ static void gp_stroke_doeraser (tGPsdata *p)
rcti rect;
/* rect is rectangle of eraser */
- rect.xmin= p->mval[0] - p->radius;
- rect.ymin= p->mval[1] - p->radius;
- rect.xmax= p->mval[0] + p->radius;
- rect.ymax= p->mval[1] + p->radius;
+ rect.xmin = p->mval[0] - p->radius;
+ rect.ymin = p->mval[1] - p->radius;
+ rect.xmax = p->mval[0] + p->radius;
+ rect.ymax = p->mval[1] + p->radius;
/* loop over strokes, checking segments for intersections */
for (gps= gpf->strokes.first; gps; gps= gpn) {
@@ -990,8 +987,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
/* make sure the active view (at the starting time) is a 3d-view */
if (curarea == NULL) {
p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: No active view for painting \n");
+ if (G.debug & G_DEBUG)
+ printf("Error: No active view for painting\n");
return 0;
}
@@ -1016,8 +1013,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
if (ar->regiondata == NULL) {
p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: 3D-View active region doesn't have any region data, so cannot be drawable \n");
+ if (G.debug & G_DEBUG)
+ printf("Error: 3D-View active region doesn't have any region data, so cannot be drawable\n");
return 0;
}
@@ -1025,8 +1022,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
/* check that gpencil data is allowed to be drawn */
if ((v3d->flag2 & V3D_DISPGP)==0) {
p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view, Grease Pencil not shown \n");
+ if (G.debug & G_DEBUG)
+ printf("Error: In active view, Grease Pencil not shown\n");
return 0;
}
#endif
@@ -1046,8 +1043,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
/* check that gpencil data is allowed to be drawn */
if ((snode->flag & SNODE_DISPGP)==0) {
p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view, Grease Pencil not shown \n");
+ if (G.debug & G_DEBUG)
+ printf("Error: In active view, Grease Pencil not shown\n");
return 0;
}
#endif
@@ -1066,14 +1063,14 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
/* check that gpencil data is allowed to be drawn */
if (sseq->mainb == SEQ_DRAW_SEQUENCE) {
p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view (sequencer), active mode doesn't support Grease Pencil \n");
+ if (G.debug & G_DEBUG)
+ printf("Error: In active view (sequencer), active mode doesn't support Grease Pencil\n");
return 0;
}
if ((sseq->flag & SEQ_DRAW_GPENCIL)==0) {
p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view, Grease Pencil not shown \n");
+ if (G.debug & G_DEBUG)
+ printf("Error: In active view, Grease Pencil not shown\n");
return 0;
}
}
@@ -1093,8 +1090,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
/* check that gpencil data is allowed to be drawn */
if ((sima->flag & SI_DISPGP)==0) {
p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view, Grease Pencil not shown \n");
+ if (G.debug & G_DEBUG)
+ printf("Error: In active view, Grease Pencil not shown\n");
return 0;
}
#endif
@@ -1124,8 +1121,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
default:
{
p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: Active view not appropriate for Grease Pencil drawing \n");
+ if (G.debug & G_DEBUG)
+ printf("Error: Active view not appropriate for Grease Pencil drawing\n");
return 0;
}
break;
@@ -1135,8 +1132,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
gpd_ptr= gpencil_data_get_pointers(C, &p->ownerPtr);
if (gpd_ptr == NULL) {
p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: Current context doesn't allow for any Grease Pencil data \n");
+ if (G.debug & G_DEBUG)
+ printf("Error: Current context doesn't allow for any Grease Pencil data\n");
return 0;
}
else {
@@ -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);
}
@@ -1207,13 +1204,13 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode)
if (p->gpl == NULL) {
p->gpl= gpencil_layer_addnew(p->gpd);
- if(p->custom_color[3])
+ if (p->custom_color[3])
copy_v3_v3(p->gpl->color, p->custom_color);
}
if (p->gpl->flag & GP_LAYER_LOCKED) {
p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: Cannot paint on locked layer \n");
+ if (G.debug & G_DEBUG)
+ printf("Error: Cannot paint on locked layer\n");
return;
}
@@ -1221,8 +1218,8 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode)
p->gpf= gpencil_layer_getframe(p->gpl, p->scene->r.cfra, 1);
if (p->gpf == NULL) {
p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: No frame created (gpencil_paint_init) \n");
+ if (G.debug & G_DEBUG)
+ printf("Error: No frame created (gpencil_paint_init)\n");
return;
}
else
@@ -1316,7 +1313,7 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode)
*
* Admittedly, this is a bit hacky, but it works much nicer from an ergonomic standpoint!
*/
- if ELEM(NULL, sima, sima->image) {
+ if (ELEM(NULL, sima, sima->image)) {
/* make strokes be drawn in screen space */
p->gpd->sbuffer_sflag &= ~GP_STROKE_2DSPACE;
p->gpd->flag &= ~GP_DATA_VIEWALIGN;
@@ -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);
@@ -1522,8 +1519,8 @@ static void gpencil_draw_apply (wmOperator *op, tGPsdata *p)
BKE_report(op->reports, RPT_ERROR, "Cannot paint stroke");
p->status = GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: Grease-Pencil Paint - Add Point Invalid \n");
+ if (G.debug & G_DEBUG)
+ printf("Error: Grease-Pencil Paint - Add Point Invalid\n");
return;
}
@@ -1598,27 +1595,26 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op)
{
tGPsdata *p = NULL;
- //printf("GPencil - Starting Re-Drawing \n");
+ //printf("GPencil - Starting Re-Drawing\n");
- /* try to initialise context data needed while drawing */
+ /* try to initialize context data needed while drawing */
if (!gpencil_draw_init(C, op)) {
if (op->customdata) MEM_freeN(op->customdata);
- //printf("\tGP - no valid data \n");
+ //printf("\tGP - no valid data\n");
return OPERATOR_CANCELLED;
}
else
p= op->customdata;
- //printf("\tGP - Start redrawing stroke \n");
+ //printf("\tGP - Start redrawing stroke\n");
/* loop over the stroke RNA elements recorded (i.e. progress of mouse movement),
* setting the relevant values in context at each step, then applying
*/
- RNA_BEGIN(op->ptr, itemptr, "stroke")
- {
+ RNA_BEGIN(op->ptr, itemptr, "stroke") {
float mousef[2];
- //printf("\t\tGP - stroke elem \n");
+ //printf("\t\tGP - stroke elem\n");
/* get relevant data for this point from stroke */
RNA_float_get_array(&itemptr, "mouse", mousef);
@@ -1651,7 +1647,7 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op)
}
RNA_END;
- //printf("\tGP - done \n");
+ //printf("\tGP - done\n");
/* cleanup */
gpencil_draw_exit(C, op);
@@ -1671,15 +1667,15 @@ static int gpencil_draw_invoke (bContext *C, wmOperator *op, wmEvent *event)
tGPsdata *p = NULL;
wmWindow *win= CTX_wm_window(C);
- if (G.f & G_DEBUG)
- printf("GPencil - Starting Drawing \n");
+ if (G.debug & G_DEBUG)
+ printf("GPencil - Starting Drawing\n");
- /* try to initialise context data needed while drawing */
+ /* try to initialize context data needed while drawing */
if (!gpencil_draw_init(C, op)) {
if (op->customdata)
MEM_freeN(op->customdata);
- if (G.f & G_DEBUG)
- printf("\tGP - no valid data \n");
+ if (G.debug & G_DEBUG)
+ printf("\tGP - no valid data\n");
return OPERATOR_CANCELLED;
}
else
@@ -1746,11 +1742,11 @@ static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op)
* otherwise we could crash (see bug #20586)
*/
if (CTX_wm_area(C) != p->sa) {
- printf("\t\t\tGP - wrong area execution abort! \n");
+ printf("\t\t\tGP - wrong area execution abort!\n");
p->status= GP_STATUS_ERROR;
}
- //printf("\t\tGP - start stroke \n");
+ //printf("\t\tGP - start stroke\n");
/* we may need to set up paint env again if we're resuming */
// XXX: watch it with the paintmode! in future, it'd be nice to allow changing paint-mode when in sketching-sessions
@@ -1759,7 +1755,7 @@ static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op)
if (gp_session_initdata(C, p))
gp_paint_initstroke(p, p->paintmode);
- if(p->status != GP_STATUS_ERROR)
+ if (p->status != GP_STATUS_ERROR)
p->status= GP_STATUS_PAINTING;
return op->customdata;
@@ -1855,15 +1851,14 @@ 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);
/* finish painting operation if anything went wrong just now */
if (p->status == GP_STATUS_ERROR) {
- printf("\t\t\t\tGP - add error done! \n");
+ printf("\t\t\t\tGP - add error done!\n");
estate = OPERATOR_CANCELLED;
}
else {
@@ -1923,22 +1918,22 @@ static EnumPropertyItem prop_gpencil_drawmodes[] = {
void GPENCIL_OT_draw (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Grease Pencil Draw";
- ot->idname= "GPENCIL_OT_draw";
- ot->description= "Make annotations on the active data";
+ ot->name = "Grease Pencil Draw";
+ ot->idname = "GPENCIL_OT_draw";
+ ot->description = "Make annotations on the active data";
/* api callbacks */
- ot->exec= gpencil_draw_exec;
- ot->invoke= gpencil_draw_invoke;
- ot->modal= gpencil_draw_modal;
- ot->cancel= gpencil_draw_cancel;
- ot->poll= gpencil_draw_poll;
+ ot->exec = gpencil_draw_exec;
+ ot->invoke = gpencil_draw_invoke;
+ ot->modal = gpencil_draw_modal;
+ ot->cancel = gpencil_draw_cancel;
+ ot->poll = gpencil_draw_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
/* settings for drawing */
- RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to intepret mouse movements");
+ RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to interpret mouse movements");
RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
}
diff --git a/source/blender/editors/gpencil/gpencil_undo.c b/source/blender/editors/gpencil/gpencil_undo.c
index 1ab00082043..36624b88a9f 100644
--- a/source/blender/editors/gpencil/gpencil_undo.c
+++ b/source/blender/editors/gpencil/gpencil_undo.c
@@ -69,10 +69,10 @@ int ED_undo_gpencil_step(bContext *C, int step, const char *name)
gpd_ptr= gpencil_data_get_pointers(C, NULL);
- if(step==1) { /* undo */
+ if (step==1) { /* undo */
//printf("\t\tGP - undo step\n");
- if(cur_node->prev) {
- if(!name || strcmp(cur_node->name, name) == 0) {
+ if (cur_node->prev) {
+ if (!name || strcmp(cur_node->name, name) == 0) {
cur_node= cur_node->prev;
new_gpd= cur_node->gpd;
}
@@ -80,17 +80,17 @@ int ED_undo_gpencil_step(bContext *C, int step, const char *name)
}
else if (step==-1) {
//printf("\t\tGP - redo step\n");
- if(cur_node->next) {
- if(!name || strcmp(cur_node->name, name) == 0) {
+ if (cur_node->next) {
+ if (!name || strcmp(cur_node->name, name) == 0) {
cur_node= cur_node->next;
new_gpd= cur_node->gpd;
}
}
}
- if(new_gpd) {
- if(gpd_ptr) {
- if(*gpd_ptr) {
+ if (new_gpd) {
+ if (gpd_ptr) {
+ if (*gpd_ptr) {
bGPdata *gpd= *gpd_ptr;
bGPDlayer *gpl, *gpld;
@@ -124,11 +124,11 @@ void gpencil_undo_push(bGPdata *gpd)
//printf("\t\tGP - undo push\n");
- if(cur_node) {
+ if (cur_node) {
/* remove all un-done nodes from stack */
undo_node= cur_node->next;
- while(undo_node) {
+ while (undo_node) {
bGPundonode *next_node= undo_node->next;
free_gpencil_data(undo_node->gpd);
@@ -153,7 +153,7 @@ void gpencil_undo_finish(void)
{
bGPundonode *undo_node= undo_nodes.first;
- while(undo_node) {
+ while (undo_node) {
free_gpencil_data(undo_node->gpd);
MEM_freeN(undo_node->gpd);
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 b5dbf906d84..ade34c43eec 100644
--- a/source/blender/editors/include/BIF_glutil.h
+++ b/source/blender/editors/include/BIF_glutil.h
@@ -47,6 +47,8 @@ void sdrawXORline4(int nr, int x0, int y0, int x1, int y1);
void fdrawXORellipse(float xofs, float yofs, float hw, float hh);
void fdrawXORcirc(float xofs, float yofs, float rad);
+void fdrawcheckerboard(float x1, float y1, float x2, float y2);
+
/* glStipple defines */
extern unsigned char stipple_halftone[128];
extern unsigned char stipple_quarttone[128];
@@ -55,27 +57,27 @@ extern unsigned char stipple_diag_stripes_neg[128];
/**
* Draw a lined (non-looping) arc with the given
- * @a radius, starting at angle @a start and arcing
- * through @a angle. The arc is centered at the origin
+ * \a radius, starting at angle \a start and arcing
+ * through \a angle. The arc is centered at the origin
* and drawn in the XY plane.
*
- * @param start The initial angle (in radians).
- * @param angle The length of the arc (in radians).
- * @param radius The arc radius.
- * @param nsegments The number of segments to use in drawing the arc.
+ * \param start The initial angle (in radians).
+ * \param angle The length of the arc (in radians).
+ * \param radius The arc radius.
+ * \param nsegments The number of segments to use in drawing the arc.
*/
void glutil_draw_lined_arc (float start, float angle, float radius, int nsegments);
/**
- * Draw a filled arc with the given @a radius,
- * starting at angle @a start and arcing through
- * @a angle. The arc is centered at the origin
+ * Draw a filled arc with the given \a radius,
+ * starting at angle \a start and arcing through
+ * \a angle. The arc is centered at the origin
* and drawn in the XY plane.
*
- * @param start The initial angle (in radians).
- * @param angle The length of the arc (in radians).
- * @param radius The arc radius.
- * @param nsegments The number of segments to use in drawing the arc.
+ * \param start The initial angle (in radians).
+ * \param angle The length of the arc (in radians).
+ * \param radius The arc radius.
+ * \param nsegments The number of segments to use in drawing the arc.
*/
void glutil_draw_filled_arc (float start, float angle, float radius, int nsegments);
@@ -93,11 +95,11 @@ float glaGetOneFloat (int param);
/**
* Functions like glRasterPos2i, except ensures that the resulting
- * raster position is valid. @a known_good_x and @a known_good_y
+ * raster position is valid. \a known_good_x and \a known_good_y
* should be coordinates of a point known to be within the current
* view frustum.
- * @attention This routine should be used when the distance of @a x
- * and @a y away from the known good point is small (ie. for small icons
+ * \attention This routine should be used when the distance of \a x
+ * and \a y away from the known good point is small (ie. for small icons
* and for bitmap characters), when drawing large+zoomed images it is
* possible for overflow to occur, the glaDrawPixelsSafe routine should
* be used instead.
@@ -106,20 +108,20 @@ void glaRasterPosSafe2f (float x, float y, float known_good_x, float known_good
/**
* Functions like a limited glDrawPixels, except ensures that
- * the image is displayed onscreen even if the @a x and @a y
+ * the image is displayed onscreen even if the \a x and \a y
* coordinates for would be clipped. The routine respects the
* glPixelZoom values, pixel unpacking parameters are _not_
* respected.
-
- * @attention This routine makes many assumptions: the rect data
+ *
+ * \attention This routine makes many assumptions: the rect data
* is expected to be in RGBA unsigned byte format, the coordinate
* (0.375, 0.375) is assumed to be within the view frustum, and the
* modelview and projection matrices are assumed to define a
* 1-to-1 mapping to screen space.
- * @attention Furthmore, in the case of zoomed or unpixel aligned
+ * \attention 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
+ * below of the given \a x and \a y coordinates. It is recommended
* to use the glScissor functionality if images are to be drawn
* with an inset view matrix.
*/
@@ -131,8 +133,8 @@ 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
+ *
+ * \attention This routine makes many assumptions: the rect data
* is expected to be in RGBA byte or float format, and the
* modelview and projection matrices are assumed to define a
* 1-to-1 mapping to screen space.
@@ -152,7 +154,7 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format,
* thus no reason to +-0.5 the coordinates or perform other silly
* tricks.
*
- * @param screen_rect The screen rectangle to be defined for 2D drawing.
+ * \param screen_rect The screen rectangle to be defined for 2D drawing.
*/
void glaDefine2DArea (struct rcti *screen_rect);
@@ -170,17 +172,17 @@ typedef struct gla2DDrawInfo gla2DDrawInfo;
* thus no reason to +-0.5 the coordinates or perform other silly
* tricks.
*
- * @param screen_rect The screen rectangle to be used for 2D drawing.
- * @param world_rect The world rectangle that the 2D area represented
- * by @a screen_rect is supposed to represent. If NULL it is assumed the
+ * \param screen_rect The screen rectangle to be used for 2D drawing.
+ * \param world_rect The world rectangle that the 2D area represented
+ * by \a screen_rect is supposed to represent. If NULL it is assumed the
* world has a 1 to 1 mapping to the screen.
*/
gla2DDrawInfo* glaBegin2DDraw (struct rcti *screen_rect, struct rctf *world_rect);
- /** Translate the (@a wo_x, @a wo_y) point from world coordinates into screen space. */
+ /** Translate the (\a wo_x, \a wo_y) point from world coordinates into screen space. */
void gla2DDrawTranslatePt (gla2DDrawInfo *di, float wo_x, float wo_y, int *sc_x_r, int *sc_y_r);
- /** Translate the @a world point from world coordiantes into screen space. */
+ /** Translate the \a world point from world coordiantes into screen space. */
void gla2DDrawTranslatePtv (gla2DDrawInfo *di, float world[2], int screen_r[2]);
/* Restores the previous OpenGL state and free's the auxilary
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index c75ec259504..a9affbcd342 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -339,7 +339,7 @@ short ANIM_animdata_context_getdata(bAnimContext *ac);
/* ------------------------ Drawing TypeInfo -------------------------- */
-/* flag-setting behaviour */
+/* flag-setting behavior */
typedef enum eAnimChannels_SetFlag {
ACHANNEL_SETFLAG_CLEAR = 0, /* turn off */
ACHANNEL_SETFLAG_ADD, /* turn on */
@@ -358,7 +358,7 @@ typedef enum eAnimChannel_Settings {
} eAnimChannel_Settings;
-/* Drawing, mouse handling, and flag setting behaviour... */
+/* Drawing, mouse handling, and flag setting behavior... */
typedef struct bAnimChannelType {
/* type data */
/* name of the channel type, for debugging */
@@ -427,7 +427,7 @@ void ANIM_channel_setting_set(bAnimContext *ac, bAnimListElem *ale, int setting,
* - anim_data: list of the all the anim channels that can be chosen
* -> filtered using ANIMFILTER_CHANNELS only, since if we took VISIBLE too,
* then the channels under closed expanders get ignored...
- * - ale_setting: the anim channel (not in the anim_data list directly, though occuring there)
+ * - ale_setting: the anim channel (not in the anim_data list directly, though occurring there)
* with the new state of the setting that we want flushed up/down the hierarchy
* - setting: type of setting to set
* - on: whether the visibility setting has been enabled or disabled
diff --git a/source/blender/editors/include/ED_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..9b20553e0cc 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[];
@@ -69,6 +69,9 @@ extern char datatoc_blur_png[];
extern int datatoc_clay_png_size;
extern char datatoc_clay_png[];
+extern int datatoc_claystrips_png_size;
+extern char datatoc_claystrips_png[];
+
extern int datatoc_clone_png_size;
extern char datatoc_clone_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 4b43233fe40..0ab9c5dd977 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -71,74 +71,52 @@ struct Material;
struct Object;
struct rcti;
-#define EM_FGON_DRAW 1 // face flag
-#define EM_FGON 2 // edge and face flag both
+#define EM_FGON_DRAW 1 // face flag
+#define EM_FGON 2 // edge and face flag both
/* editbutflag */
-#define B_CLOCKWISE 1
-#define B_KEEPORIG 2
-#define B_BEAUTY 4
-#define B_SMOOTH 8
-#define B_BEAUTY_SHORT 0x10
-#define B_AUTOFGON 0x20
-#define B_KNIFE 0x80
-#define B_PERCENTSUBD 0x40
+#define B_CLOCKWISE 1
+#define B_KEEPORIG 2
+#define B_BEAUTY 4
+#define B_SMOOTH 8
+#define B_BEAUTY_SHORT 0x10
+#define B_AUTOFGON 0x20
+#define B_KNIFE 0x80
+#define B_PERCENTSUBD 0x40
//#define B_MESH_X_MIRROR 0x100 // deprecated, use mesh
-#define B_JOINTRIA_UV 0x200
-#define B_JOINTRIA_VCOL 0X400
-#define B_JOINTRIA_SHARP 0X800
-#define B_JOINTRIA_MAT 0X1000
-#define B_FRACTAL 0x2000
-#define B_SPHERE 0x4000
+#define B_JOINTRIA_UV 0x200
+#define B_JOINTRIA_VCOL 0X400
+#define B_JOINTRIA_SHARP 0X800
+#define B_JOINTRIA_MAT 0X1000
+#define B_FRACTAL 0x2000
+#define B_SPHERE 0x4000
intptr_t mesh_octree_table(struct Object *ob, struct BMEditMesh *em, float *co, char mode);
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?
- */
-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.*/
-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);
-void EDBM_ApplyMirrorCache(struct BMEditMesh *em, const int sel_from, const int sel_to);
-
-void EDBM_RecalcNormals(struct BMEditMesh *em);
-
-void EDBM_MakeEditBMesh(struct ToolSettings *ts, struct Scene *scene, struct Object *ob);
-void EDBM_FreeEditBMesh(struct BMEditMesh *tm);
-void EDBM_LoadEditBMesh(struct Scene *scene, struct Object *ob);
-
-void EDBM_init_index_arrays(struct BMEditMesh *em, int forvert, int foredge, int forface);
-void EDBM_free_index_arrays(struct BMEditMesh *em);
-struct BMVert *EDBM_get_vert_for_index(struct BMEditMesh *em, int index);
-struct BMEdge *EDBM_get_edge_for_index(struct BMEditMesh *em, int index);
-struct BMFace *EDBM_get_face_for_index(struct BMEditMesh *em, int index);
-
-int EDBM_CallAndSelectOpf(struct BMEditMesh *em, struct wmOperator *op,
- const char *selectslot, const char *fmt, ...);
+
+/* retrieves mirrored cache vert, or NULL if there isn't one.
+ * note: calling this without ensuring the mirror cache state
+ * is bad.*/
+void EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, const short use_select); /* note, replaces EM_cache_x_mirror_vert in trunk */
+void EDBM_verts_mirror_apply(struct BMEditMesh *em, const int sel_from, const int sel_to);
+struct BMVert *EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v);
+void EDBM_verts_mirror_cache_clear(struct BMEditMesh *em, struct BMVert *v);
+void EDBM_verts_mirror_cache_end(struct BMEditMesh *em);
+
+void EDBM_mesh_normals_update(struct BMEditMesh *em);
+
+void EDBM_mesh_make(struct ToolSettings *ts, struct Scene *scene, struct Object *ob);
+void EDBM_mesh_free(struct BMEditMesh *tm);
+void EDBM_mesh_load(struct Object *ob);
+
+void EDBM_index_arrays_init(struct BMEditMesh *em, int forvert, int foredge, int forface);
+void EDBM_index_arrays_free(struct BMEditMesh *em);
+struct BMVert *EDBM_vert_at_index(struct BMEditMesh *em, int index);
+struct BMEdge *EDBM_edge_at_index(struct BMEditMesh *em, int index);
+struct BMFace *EDBM_face_at_index(struct BMEditMesh *em, int index);
/* flushes based on the current select mode. if in vertex select mode,
* verts select/deselect edges and faces, if in edge select mode,
@@ -147,8 +125,6 @@ int EDBM_CallAndSelectOpf(struct BMEditMesh *em, struct wmOperator *op,
void EDBM_select_more(struct BMEditMesh *em);
void EDBM_select_less(struct BMEditMesh *em);
-int EDBM_get_actSelection(struct BMEditMesh *em, struct BMEditSelection *ese);
-
void EDBM_selectmode_flush_ex(struct BMEditMesh *em, int selectmode);
void EDBM_selectmode_flush(struct BMEditMesh *em);
@@ -156,43 +132,47 @@ void EDBM_deselect_flush(struct BMEditMesh *em);
void EDBM_select_flush(struct BMEditMesh *em);
void EDBM_selectmode_set(struct BMEditMesh *em);
-void EDBM_convertsel(struct BMEditMesh *em, short oldmode, short selectmode);
-void undo_push_mesh(struct bContext *C, const char *name);
+void EDBM_selectmode_convert(struct BMEditMesh *em, short oldmode, short selectmode);
+void undo_push_mesh(struct bContext *C, const char *name);
+int EDBM_editselection_active_get(struct BMEditMesh *em, struct BMEditSelection *ese);
void EDBM_editselection_center(struct BMEditMesh *em, float *center, struct BMEditSelection *ese);
void EDBM_editselection_plane(struct BMEditMesh *em, float *plane, struct BMEditSelection *ese);
void EDBM_editselection_normal(float *normal, struct BMEditSelection *ese);
-int EDBM_vertColorCheck(struct BMEditMesh *em);
-void EDBM_validate_selections(struct BMEditMesh *em);
+int EDBM_vert_color_check(struct BMEditMesh *em);
+void EDBM_editselection_validate(struct BMEditMesh *em);
-void EDBM_hide_mesh(struct BMEditMesh *em, int swap);
-void EDBM_reveal_mesh(struct BMEditMesh *em);
+void EDBM_mesh_hide(struct BMEditMesh *em, int swap);
+void EDBM_mesh_reveal(struct BMEditMesh *em);
-int EDBM_check_backbuf(unsigned int index);
-int EDBM_mask_init_backbuf_border(struct ViewContext *vc, int mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax);
-void EDBM_free_backbuf(void);
-int EDBM_init_backbuf_border(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
-int EDBM_init_backbuf_circle(struct ViewContext *vc, short xs, short ys, short rads);
+void EDBM_update_generic(struct bContext *C, struct BMEditMesh *em, const short do_tessface);
+
+int EDBM_backbuf_check(unsigned int index);
+int EDBM_backbuf_border_mask_init(struct ViewContext *vc, int mcords[][2], short tot,
+ short xmin, short ymin, short xmax, short ymax);
+void EDBM_backbuf_free(void);
+int EDBM_backbuf_border_init(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
+int EDBM_backbuf_circle_init(struct ViewContext *vc, short xs, short ys, short rads);
void EDBM_deselect_by_material(struct BMEditMesh *em, const short index, const short select);
-int EDBM_select_interior_faces(struct BMEditMesh *em);
+struct UvElementMap *EDBM_uv_element_map_create(struct BMEditMesh *em, int selected, int doIslands);
+void EDBM_uv_element_map_free(struct UvElementMap *vmap);
-struct UvElementMap *EDBM_make_uv_element_map(struct BMEditMesh *em, int selected, int doIslands);
-void EDBM_free_uv_element_map(struct UvElementMap *vmap);
+int EDBM_mtexpoly_check(struct BMEditMesh *em);
+struct MTexPoly *EDBM_mtexpoly_active_get(struct BMEditMesh *em, struct BMFace **r_act_efa, int sloppy);
-void EDBM_select_swap(struct BMEditMesh *em); /* exported for UV */
+void EDBM_uv_vert_map_free(struct UvVertMap *vmap);
+struct UvMapVert *EDBM_uv_vert_map_at_index(struct UvVertMap *vmap, unsigned int v);
+struct UvVertMap *EDBM_uv_vert_map_create(struct BMEditMesh *em, int selected, int do_face_idx_array, float *limit);
-int EDBM_texFaceCheck(struct BMEditMesh *em);
-struct MTexPoly *EDBM_get_active_mtexpoly(struct BMEditMesh *em, struct BMFace **r_act_efa, int sloppy);
+void EDBM_data_layer_add(struct BMEditMesh *em, struct CustomData *data, int type, const char *name);
+void EDBM_data_layer_free(struct BMEditMesh *em, struct CustomData *data, int type);
-void EDBM_free_uv_vert_map(struct UvVertMap *vmap);
-struct UvMapVert *EDBM_get_uv_map_vert(struct UvVertMap *vmap, unsigned int v);
-struct UvVertMap *EDBM_make_uv_vert_map(struct BMEditMesh *em, int selected, int do_face_idx_array, float *limit);
-void EM_add_data_layer(struct BMEditMesh *em, struct CustomData *data, int type, const char *name);
-void EM_free_data_layer(struct BMEditMesh *em, struct CustomData *data, int type);
+void EDBM_select_toggle_all(struct BMEditMesh *em);
+void EDBM_select_swap(struct BMEditMesh *em); /* exported for UV */
+int EDBM_select_interior_faces(struct BMEditMesh *em);
-void EDBM_toggle_select_all(struct BMEditMesh *em);
void EDBM_flag_enable_all(struct BMEditMesh *em, const char hflag);
void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag);
void EDBM_select_mirrored(struct Object *obedit, struct BMEditMesh *em, int extend);
@@ -201,25 +181,25 @@ void EDBM_automerge(struct Scene *scene, struct Object *ob, int update);
/* editmesh_mods.c */
extern unsigned int bm_vertoffs, bm_solidoffs, bm_wireoffs;
-int mouse_mesh(struct bContext *C, const int mval[2], short extend);
+int mouse_mesh(struct bContext *C, const int mval[2], short extend);
-struct BMVert *editbmesh_get_x_mirror_vert(struct Object *ob, struct BMEditMesh *em, struct BMVert *eve, float *co, int index);
-int mesh_get_x_mirror_vert(struct Object *ob, int index);
-int *mesh_get_x_mirror_faces(struct Object *ob, struct BMEditMesh *em);
+struct BMVert *editbmesh_get_x_mirror_vert(struct Object *ob, struct BMEditMesh *em, struct BMVert *eve, float *co, int index);
+int mesh_get_x_mirror_vert(struct Object *ob, int index);
+int *mesh_get_x_mirror_faces(struct Object *ob, struct BMEditMesh *em);
-int join_mesh_exec(struct bContext *C, struct wmOperator *op);
-int join_mesh_shapes_exec(struct bContext *C, struct wmOperator *op);
+int join_mesh_exec(struct bContext *C, struct wmOperator *op);
+int join_mesh_shapes_exec(struct bContext *C, struct wmOperator *op);
/* mesh_ops.c */
-void ED_operatortypes_mesh(void);
-void ED_operatormacros_mesh(void);
-void ED_keymap_mesh(struct wmKeyConfig *keyconf);
+void ED_operatortypes_mesh(void);
+void ED_operatormacros_mesh(void);
+void ED_keymap_mesh(struct wmKeyConfig *keyconf);
/* editmesh.c */
-void ED_spacetypes_init(void);
-void ED_keymap_mesh(struct wmKeyConfig *keyconf);
+void ED_spacetypes_init(void);
+void ED_keymap_mesh(struct wmKeyConfig *keyconf);
/* bmesh_mods.c */
extern unsigned int bm_vertoffs, bm_solidoffs, bm_wireoffs;
@@ -239,7 +219,7 @@ void paintface_hide(struct Object *ob, const int unselected);
void paintface_reveal(struct Object *ob);
void paintvert_deselect_all_visible(struct Object *ob, int action, short flush_flags);
-void paintvert_flush_flags(struct Object *ob);
+void paintvert_flush_flags(struct Object *ob);
/* object_vgroup.c */
@@ -247,40 +227,30 @@ void paintvert_flush_flags(struct Object *ob);
#define WEIGHT_ADD 2
#define WEIGHT_SUBTRACT 3
-struct bDeformGroup *ED_vgroup_add(struct Object *ob);
-struct bDeformGroup *ED_vgroup_add_name(struct Object *ob, const char *name);
-void ED_vgroup_delete(struct Object *ob, struct bDeformGroup *defgroup);
-void ED_vgroup_clear(struct Object *ob);
-void ED_vgroup_select_by_name(struct Object *ob, const char *name);
-int ED_vgroup_data_create(struct ID *id);
-int ED_vgroup_give_array(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot);
-int ED_vgroup_copy_array(struct Object *ob, struct Object *ob_from);
-void ED_vgroup_mirror(struct Object *ob, const short mirror_weights, const short flip_vgroups, const short all_vgroups);
+struct bDeformGroup *ED_vgroup_add(struct Object *ob);
+struct bDeformGroup *ED_vgroup_add_name(struct Object *ob, const char *name);
+void ED_vgroup_delete(struct Object *ob, struct bDeformGroup *defgroup);
+void ED_vgroup_clear(struct Object *ob);
+void ED_vgroup_select_by_name(struct Object *ob, const char *name);
+int ED_vgroup_data_create(struct ID *id);
+int ED_vgroup_give_array(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot);
+int ED_vgroup_copy_array(struct Object *ob, struct Object *ob_from);
+void ED_vgroup_mirror(struct Object *ob, const short mirror_weights, const short flip_vgroups, const short all_vgroups);
-int ED_vgroup_object_is_edit_mode(struct Object *ob);
+int ED_vgroup_object_is_edit_mode(struct Object *ob);
-void ED_vgroup_vert_add(struct Object *ob, struct bDeformGroup *dg, int vertnum, float weight, int assignmode);
-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
- */
+void ED_vgroup_vert_add(struct Object *ob, struct bDeformGroup *dg, int vertnum, float weight, int assignmode);
+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);
-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);
+struct BMVert *EDBM_vert_find_nearest(struct ViewContext *vc, int *dist, short sel, short strict);
+struct BMEdge *EDBM_edge_find_nearest(struct ViewContext *vc, int *dist);
+struct BMFace *EDBM_face_find_nearest(struct ViewContext *vc, int *dist);
/* mesh_data.c */
// void ED_mesh_geometry_add(struct Mesh *mesh, struct ReportList *reports, int verts, int edges, int faces);
void ED_mesh_polys_add(struct Mesh *mesh, struct ReportList *reports, int count);
-void ED_mesh_faces_add(struct Mesh *mesh, struct ReportList *reports, int count);
+void ED_mesh_tessfaces_add(struct Mesh *mesh, struct ReportList *reports, int count);
void ED_mesh_edges_add(struct Mesh *mesh, struct ReportList *reports, int count);
void ED_mesh_loops_add(struct Mesh *mesh, struct ReportList *reports, int count);
void ED_mesh_vertices_add(struct Mesh *mesh, struct ReportList *reports, int count);
@@ -291,18 +261,20 @@ void ED_mesh_vertices_remove(struct Mesh *mesh, struct ReportList *reports, int
void ED_mesh_transform(struct Mesh *me, float *mat);
void ED_mesh_calc_normals(struct Mesh *me);
+void ED_mesh_calc_tessface(struct Mesh *mesh);
void ED_mesh_material_link(struct Mesh *me, struct Material *ma);
-void ED_mesh_update(struct Mesh *mesh, struct bContext *C, int calc_edges);
+void ED_mesh_update(struct Mesh *mesh, struct bContext *C, int calc_edges, int calc_tessface);
int ED_mesh_uv_texture_add(struct bContext *C, struct Mesh *me, const char *name, int active_set);
int ED_mesh_uv_texture_remove(struct bContext *C, struct Object *ob, struct Mesh *me);
int ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me);
+int ED_mesh_uv_loop_reset_ex(struct bContext *C, struct Mesh *me, const int layernum);
int ED_mesh_color_add(struct bContext *C, struct Scene *scene, struct Object *ob, struct Mesh *me, const char *name, int active_set);
int ED_mesh_color_remove(struct bContext *C, struct Object *ob, struct Mesh *me);
int ED_mesh_color_remove_named(struct bContext *C, struct Object *ob, struct Mesh *me, const char *name);
void EDBM_selectmode_to_scene(struct bContext *C);
-void EDBM_ClearMesh(struct BMEditMesh *em);
+void EDBM_mesh_clear(struct BMEditMesh *em);
#include "../mesh/editmesh_bvh.h"
@@ -310,9 +282,9 @@ void EDBM_ClearMesh(struct BMEditMesh *em);
/* mirrtopo */
typedef struct MirrTopoStore_t {
intptr_t *index_lookup;
- int prev_vert_tot;
- int prev_edge_tot;
- int prev_ob_mode;
+ int prev_vert_tot;
+ int prev_edge_tot;
+ int prev_ob_mode;
} MirrTopoStore_t;
int ED_mesh_mirrtopo_recalc_check(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store);
@@ -326,9 +298,9 @@ void ED_mesh_mirrtopo_free(MirrTopoStore_t *mesh_topo_store);
#define SUBDIV_SELECT_LOOPCUT 3
/* edge subdivide corner cut types */
-#define SUBDIV_CORNER_PATH 0
-#define SUBDIV_CORNER_INNERVERT 1
-#define SUBDIV_CORNER_FAN 2
+#define SUBDIV_CORNER_PATH 0
+#define SUBDIV_CORNER_INNERVERT 1
+#define SUBDIV_CORNER_FAN 2
#ifdef __cplusplus
}
diff --git a/source/blender/editors/include/ED_numinput.h b/source/blender/editors/include/ED_numinput.h
index 2b99e52057d..e723ff73532 100644
--- a/source/blender/editors/include/ED_numinput.h
+++ b/source/blender/editors/include/ED_numinput.h
@@ -28,6 +28,15 @@
#define __ED_NUMINPUT_H__
+/*
+ The ctrl value has different meaning:
+ 0 : No value has been typed
+
+ otherwise, |value| - 1 is where the cursor is located after the period
+ Positive : number is positive
+ Negative : number is negative
+*/
+
typedef struct NumInput {
short idx;
short idx_max;
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_screen_types.h b/source/blender/editors/include/ED_screen_types.h
index 51699d095ae..6f7d0c55b9a 100644
--- a/source/blender/editors/include/ED_screen_types.h
+++ b/source/blender/editors/include/ED_screen_types.h
@@ -41,6 +41,7 @@ typedef struct ScreenAnimData {
short flag; /* flags for playback */
int sfra; /* frame that playback was started from */
int nextfra; /* next frame to go to (when ANIMPLAY_FLAG_USE_NEXT_FRAME is set) */
+ double last_duration; /* used for frame dropping */
} ScreenAnimData;
/* for animplayer */
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_transform.h b/source/blender/editors/include/ED_transform.h
index 4532a351c7d..f6dee351c29 100644
--- a/source/blender/editors/include/ED_transform.h
+++ b/source/blender/editors/include/ED_transform.h
@@ -175,8 +175,8 @@ typedef enum SnapMode
#define SNAP_MIN_DISTANCE 30
-int peelObjectsTransForm(struct TransInfo *t, struct ListBase *depth_peels, const float mval[2]);
-int peelObjectsContext(struct bContext *C, struct ListBase *depth_peels, const float mval[2]);
+int peelObjectsTransForm(struct TransInfo *t, struct ListBase *depth_peels, const float mval[2], SnapMode mode);
+int peelObjectsContext(struct bContext *C, struct ListBase *depth_peels, const float mval[2], SnapMode mode);
int snapObjectsTransform(struct TransInfo *t, const float mval[2], int *r_dist, float r_loc[3], float r_no[3], SnapMode mode);
int snapObjectsContext(struct bContext *C, const float mval[2], int *r_dist, float r_loc[3], float r_no[3], SnapMode mode);
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 4c68b53d5cd..98220ff324e 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -91,10 +91,10 @@ int initgrabz(struct RegionView3D *rv3d, float x, float y, float z);
/**
* Calculate a 3d location from 2d window coordinates.
- * @param ar The region (used for the window width and height).
- * @param depth_pt The reference location used to calculate the Z depth.
- * @param mval The area relative location (such as event->mval converted to floats).
- * @param out The resulting world-space location.
+ * \param ar The region (used for the window width and height).
+ * \param depth_pt The reference location used to calculate the Z depth.
+ * \param mval The area relative location (such as event->mval converted to floats).
+ * \param out The resulting world-space location.
*/
void ED_view3d_win_to_3d(struct ARegion *ar, const float depth_pt[3], const float mval[2], float out[3]);
@@ -102,9 +102,9 @@ void ED_view3d_win_to_3d(struct ARegion *ar, const float depth_pt[3], const floa
* Calculate a 3d difference vector from 2d window offset.
* note that initgrabz() must be called first to determine
* the depth used to calculate the delta.
- * @param ar The region (used for the window width and height).
- * @param mval The area relative 2d difference (such as event->mval[0] - other_x).
- * @param out The resulting world-space delta.
+ * \param ar The region (used for the window width and height).
+ * \param mval The area relative 2d difference (such as event->mval[0] - other_x).
+ * \param out The resulting world-space delta.
*/
void ED_view3d_win_to_delta(struct ARegion *ar, const float mval[2], float out[3]);
@@ -112,9 +112,9 @@ void ED_view3d_win_to_delta(struct ARegion *ar, const float mval[2], float out[3
* Calculate a 3d direction vector from 2d window coordinates.
* This direction vector starts and the view in the direction of the 2d window coordinates.
* In orthographic view all window coordinates yield the same vector.
- * @param ar The region (used for the window width and height).
- * @param mval The area relative 2d location (such as event->mval converted to floats).
- * @param out The resulting normalized world-space direction vector.
+ * \param ar The region (used for the window width and height).
+ * \param mval The area relative 2d location (such as event->mval converted to floats).
+ * \param out The resulting normalized world-space direction vector.
*/
void ED_view3d_win_to_vector(struct ARegion *ar, const float mval[2], float out[3]);
@@ -124,11 +124,11 @@ void ED_view3d_win_to_vector(struct ARegion *ar, const float mval[2], float out[
* ray_start and ray_end are clipped by the view near and far limits
* so points along this line are always in view.
* In orthographic view all resulting segments will be parallel.
- * @param ar The region (used for the window width and height).
- * @param v3d The 3d viewport (used for near and far clipping range).
- * @param mval The area relative 2d location (such as event->mval, converted into float[2]).
- * @param ray_start The world-space starting point of the segment.
- * @param ray_end The world-space end point of the segment.
+ * \param ar The region (used for the window width and height).
+ * \param v3d The 3d viewport (used for near and far clipping range).
+ * \param mval The area relative 2d location (such as event->mval, converted into float[2]).
+ * \param ray_start The world-space starting point of the segment.
+ * \param ray_end The world-space end point of the segment.
*/
void ED_view3d_win_to_segment_clip(struct ARegion *ar, struct View3D *v3d, const float mval[2], float ray_start[3], float ray_end[3]);
@@ -137,58 +137,58 @@ void ED_view3d_win_to_segment_clip(struct ARegion *ar, struct View3D *v3d, const
* This ray_start is located at the viewpoint, ray_normal is the direction towards mval.
* ray_start is clipped by the view near limit so points in front of it are always in view.
* In orthographic view the resulting ray_normal will match the view vector.
- * @param ar The region (used for the window width and height).
- * @param v3d The 3d viewport (used for near clipping value).
- * @param mval The area relative 2d location (such as event->mval, converted into float[2]).
- * @param ray_start The world-space starting point of the segment.
- * @param ray_normal The normalized world-space direction of towards mval.
+ * \param ar The region (used for the window width and height).
+ * \param v3d The 3d viewport (used for near clipping value).
+ * \param mval The area relative 2d location (such as event->mval, converted into float[2]).
+ * \param ray_start The world-space starting point of the segment.
+ * \param ray_normal The normalized world-space direction of towards mval.
*/
void ED_view3d_win_to_ray(struct ARegion *ar, struct View3D *v3d, const float mval[2], float ray_start[3], float ray_normal[3]);
/**
* Calculate a normalized 3d direction vector from the viewpoint towards a global location.
* In orthographic view the resulting vector will match the view vector.
- * @param rv3d The region (used for the window width and height).
- * @param coord The world-space location.
- * @param vec The resulting normalized vector.
+ * \param rv3d The region (used for the window width and height).
+ * \param coord The world-space location.
+ * \param vec The resulting normalized vector.
*/
void ED_view3d_global_to_vector(struct RegionView3D *rv3d, const float coord[3], float vec[3]);
/**
* Calculate the view transformation matrix from RegionView3D input.
* The resulting matrix is equivalent to RegionView3D.viewinv
- * @param mat The view 4x4 transformation matrix to calculate.
- * @param ofs The view offset, normally from RegionView3D.ofs.
- * @param quat The view rotation, quaternion normally from RegionView3D.viewquat.
- * @param dist The view distance from ofs, normally from RegionView3D.dist.
+ * \param mat The view 4x4 transformation matrix to calculate.
+ * \param ofs The view offset, normally from RegionView3D.ofs.
+ * \param quat The view rotation, quaternion normally from RegionView3D.viewquat.
+ * \param dist The view distance from ofs, normally from RegionView3D.dist.
*/
void ED_view3d_to_m4(float mat[][4], const float ofs[3], const float quat[4], const float dist);
/**
* Set the view transformation from a 4x4 matrix.
- * @param mat The view 4x4 transformation matrix to assign.
- * @param ofs The view offset, normally from RegionView3D.ofs.
- * @param quat The view rotation, quaternion normally from RegionView3D.viewquat.
- * @param dist The view distance from ofs, normally from RegionView3D.dist.
+ * \param mat The view 4x4 transformation matrix to assign.
+ * \param ofs The view offset, normally from RegionView3D.ofs.
+ * \param quat The view rotation, quaternion normally from RegionView3D.viewquat.
+ * \param dist The view distance from ofs, normally from RegionView3D.dist.
*/
void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist);
/**
* Set the RegionView3D members from an objects transformation and optionally lens.
- * @param ob The object to set the view to.
- * @param ofs The view offset to be set, normally from RegionView3D.ofs.
- * @param quat The view rotation to be set, quaternion normally from RegionView3D.viewquat.
- * @param dist The view distance from ofs to be set, normally from RegionView3D.dist.
- * @param lens The view lens angle set for cameras and lamps, normally from View3D.lens.
+ * \param ob The object to set the view to.
+ * \param ofs The view offset to be set, normally from RegionView3D.ofs.
+ * \param quat The view rotation to be set, quaternion normally from RegionView3D.viewquat.
+ * \param dist The view distance from ofs to be set, normally from RegionView3D.dist.
+ * \param lens The view lens angle set for cameras and lamps, normally from View3D.lens.
*/
void ED_view3d_from_object(struct Object *ob, float ofs[3], float quat[4], float *dist, float *lens);
/**
* Set the object transformation from RegionView3D members.
- * @param ob The object which has the transformation assigned.
- * @param ofs The view offset, normally from RegionView3D.ofs.
- * @param quat The view rotation, quaternion normally from RegionView3D.viewquat.
- * @param dist The view distance from ofs, normally from RegionView3D.dist.
+ * \param ob The object which has the transformation assigned.
+ * \param ofs The view offset, normally from RegionView3D.ofs.
+ * \param quat The view rotation, quaternion normally from RegionView3D.viewquat.
+ * \param dist The view distance from ofs, normally from RegionView3D.dist.
*/
void ED_view3d_to_object(struct Object *ob, const float ofs[3], const float quat[4], const float dist);
@@ -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_icons.h b/source/blender/editors/include/UI_icons.h
index f35af356c94..c1fa45a10a1 100644
--- a/source/blender/editors/include/UI_icons.h
+++ b/source/blender/editors/include/UI_icons.h
@@ -843,17 +843,13 @@ DEF_ICON(LONGDISPLAY)
DEF_ICON(SHORTDISPLAY)
DEF_ICON(GHOST)
DEF_ICON(IMGDISPLAY)
-#ifndef DEF_ICON_BLANK_SKIP
- DEF_ICON(BLANK284)
- DEF_ICON(BLANK285)
-#endif
+DEF_ICON(SAVE_AS)
+DEF_ICON(SAVE_COPY)
DEF_ICON(BOOKMARKS)
DEF_ICON(FONTPREVIEW)
DEF_ICON(FILTER)
DEF_ICON(NEWFOLDER)
-#ifndef DEF_ICON_BLANK_SKIP
- DEF_ICON(BLANK285F)
-#endif
+DEF_ICON(OPEN_RECENT)
DEF_ICON(FILE_PARENT)
DEF_ICON(FILE_REFRESH)
DEF_ICON(FILE_FOLDER)
@@ -864,26 +860,26 @@ DEF_ICON(FILE_MOVIE)
DEF_ICON(FILE_SCRIPT)
DEF_ICON(FILE_SOUND)
DEF_ICON(FILE_FONT)
-#ifndef DEF_ICON_BLANK_SKIP
- DEF_ICON(BLANK291b)
+DEF_ICON(FILE_TEXT)
- /* available */
- DEF_ICON(BLANK292)
- DEF_ICON(BLANK293)
- DEF_ICON(BLANK294)
- DEF_ICON(BLANK295)
- DEF_ICON(BLANK296)
- DEF_ICON(BLANK297)
- DEF_ICON(BLANK298)
- DEF_ICON(BLANK299)
+ /* FILE SELECT */
+DEF_ICON(RECOVER_AUTO)
+DEF_ICON(SAVE_PREFS)
+DEF_ICON(LINK_BLEND)
+DEF_ICON(APPEND_BLEND)
+DEF_ICON(IMPORT)
+DEF_ICON(EXPORT)
+DEF_ICON(EXTERNAL_DATA)
+DEF_ICON(LOAD_FACTORY)
+#ifndef DEF_ICON_BLANK_SKIP
DEF_ICON(BLANK300)
DEF_ICON(BLANK301)
DEF_ICON(BLANK302)
DEF_ICON(BLANK303)
DEF_ICON(BLANK304)
- DEF_ICON(BLANK305)
- DEF_ICON(BLANK306)
#endif
+DEF_ICON(LOOP_BACK)
+DEF_ICON(LOOP_FORWARDS)
DEF_ICON(BACK)
DEF_ICON(FORWARD)
#ifndef DEF_ICON_BLANK_SKIP
@@ -968,6 +964,7 @@ DEF_ICON(BRUSH_ADD)
DEF_ICON(BRUSH_BLOB)
DEF_ICON(BRUSH_BLUR)
DEF_ICON(BRUSH_CLAY)
+DEF_ICON(BRUSH_CLAY_STRIPS)
DEF_ICON(BRUSH_CLONE)
DEF_ICON(BRUSH_CREASE)
DEF_ICON(BRUSH_DARKEN)
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 880c5c049ca..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
@@ -497,7 +497,7 @@ int uiButGetUnitType(uiBut *but);
/* Special Buttons
*
- * Butons with a more specific purpose:
+ * Buttons with a more specific purpose:
* - IDPoinBut: for creating buttons that work on a pointer to an ID block.
* - MenuBut: buttons that popup a menu (in headers usually).
* - PulldownBut: like MenuBut, but creating a uiBlock (for compatibility).
diff --git a/source/blender/editors/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/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index f676dcbdff2..1531ade5ba3 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -133,8 +133,9 @@ enum {
TH_STRIP_SELECT,
TH_LAMP,
-
TH_SPEAKER,
+ TH_CAMERA,
+ TH_EMPTY,
TH_NODE,
TH_NODE_IN_OUT,
@@ -149,6 +150,7 @@ enum {
TH_CONSOLE_CURSOR,
TH_SEQ_MOVIE,
+ TH_SEQ_MOVIECLIP,
TH_SEQ_IMAGE,
TH_SEQ_SCENE,
TH_SEQ_AUDIO,
@@ -156,6 +158,7 @@ enum {
TH_SEQ_PLUGIN,
TH_SEQ_TRANSITION,
TH_SEQ_META,
+ TH_SEQ_PREVIEW,
TH_EDGE_SHARP,
TH_EDITMESH_ACTIVE,
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 8bb9ceb121c..1cb51e8f6fa 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -72,16 +72,16 @@
#include "interface_intern.h"
-#define MENU_WIDTH 120
-#define MENU_ITEM_HEIGHT 20
-#define MENU_SEP_HEIGHT 6
+#define MENU_WIDTH 120
+#define MENU_ITEM_HEIGHT 20
+#define MENU_SEP_HEIGHT 6
#define PRECISION_FLOAT_MAX 6
#define PRECISION_FLOAT_MAX_POW 1000000 /* pow(10, PRECISION_FLOAT_MAX) */
/* avoid unneeded calls to ui_get_but_val */
#define UI_BUT_VALUE_UNSET DBL_MAX
-#define UI_GET_BUT_VALUE_INIT(_but, _value) if(_value == DBL_MAX) { (_value)= ui_get_but_val(_but); }
+#define UI_GET_BUT_VALUE_INIT(_but, _value) if (_value == DBL_MAX) { (_value) = ui_get_but_val(_but); }
/*
* a full doc with API notes can be found in bf-blender/trunk/blender/doc/guides/interface_API.txt
@@ -99,75 +99,75 @@ void ui_block_to_window_fl(const ARegion *ar, uiBlock *block, float *x, float *y
float gx, gy;
int sx, sy, getsizex, getsizey;
- getsizex= ar->winrct.xmax-ar->winrct.xmin+1;
- getsizey= ar->winrct.ymax-ar->winrct.ymin+1;
- sx= ar->winrct.xmin;
- sy= ar->winrct.ymin;
+ getsizex = ar->winrct.xmax - ar->winrct.xmin + 1;
+ getsizey = ar->winrct.ymax - ar->winrct.ymin + 1;
+ sx = ar->winrct.xmin;
+ sy = ar->winrct.ymin;
- gx= *x;
- gy= *y;
+ gx = *x;
+ gy = *y;
- if(block->panel) {
+ if (block->panel) {
gx += block->panel->ofsx;
gy += block->panel->ofsy;
}
- *x= ((float)sx) + ((float)getsizex)*(0.5f+ 0.5f*(gx*block->winmat[0][0]+ gy*block->winmat[1][0]+ block->winmat[3][0]));
- *y= ((float)sy) + ((float)getsizey)*(0.5f+ 0.5f*(gx*block->winmat[0][1]+ gy*block->winmat[1][1]+ block->winmat[3][1]));
+ *x = ((float)sx) + ((float)getsizex) * (0.5f + 0.5f * (gx * block->winmat[0][0] + gy * block->winmat[1][0] + block->winmat[3][0]));
+ *y = ((float)sy) + ((float)getsizey) * (0.5f + 0.5f * (gx * block->winmat[0][1] + gy * block->winmat[1][1] + block->winmat[3][1]));
}
void ui_block_to_window(const ARegion *ar, uiBlock *block, int *x, int *y)
{
float fx, fy;
- fx= *x;
- fy= *y;
+ fx = *x;
+ fy = *y;
ui_block_to_window_fl(ar, block, &fx, &fy);
- *x= (int)(fx+0.5f);
- *y= (int)(fy+0.5f);
+ *x = (int)(fx + 0.5f);
+ *y = (int)(fy + 0.5f);
}
void ui_block_to_window_rct(const ARegion *ar, uiBlock *block, rctf *graph, rcti *winr)
{
rctf tmpr;
- tmpr= *graph;
+ tmpr = *graph;
ui_block_to_window_fl(ar, block, &tmpr.xmin, &tmpr.ymin);
ui_block_to_window_fl(ar, block, &tmpr.xmax, &tmpr.ymax);
- winr->xmin= tmpr.xmin;
- winr->ymin= tmpr.ymin;
- winr->xmax= tmpr.xmax;
- winr->ymax= tmpr.ymax;
+ winr->xmin = tmpr.xmin;
+ winr->ymin = tmpr.ymin;
+ winr->xmax = tmpr.xmax;
+ winr->ymax = tmpr.ymax;
}
-void ui_window_to_block_fl(const ARegion *ar, uiBlock *block, float *x, float *y) /* for mouse cursor */
+void ui_window_to_block_fl(const ARegion *ar, uiBlock *block, float *x, float *y) /* for mouse cursor */
{
float a, b, c, d, e, f, px, py;
int sx, sy, getsizex, getsizey;
- getsizex= ar->winrct.xmax-ar->winrct.xmin+1;
- getsizey= ar->winrct.ymax-ar->winrct.ymin+1;
- sx= ar->winrct.xmin;
- sy= ar->winrct.ymin;
+ getsizex = ar->winrct.xmax - ar->winrct.xmin + 1;
+ getsizey = ar->winrct.ymax - ar->winrct.ymin + 1;
+ sx = ar->winrct.xmin;
+ sy = ar->winrct.ymin;
- a= 0.5f*((float)getsizex)*block->winmat[0][0];
- b= 0.5f*((float)getsizex)*block->winmat[1][0];
- c= 0.5f*((float)getsizex)*(1.0f+block->winmat[3][0]);
+ a = 0.5f * ((float)getsizex) * block->winmat[0][0];
+ b = 0.5f * ((float)getsizex) * block->winmat[1][0];
+ c = 0.5f * ((float)getsizex) * (1.0f + block->winmat[3][0]);
- d= 0.5f*((float)getsizey)*block->winmat[0][1];
- e= 0.5f*((float)getsizey)*block->winmat[1][1];
- f= 0.5f*((float)getsizey)*(1.0f+block->winmat[3][1]);
+ d = 0.5f * ((float)getsizey) * block->winmat[0][1];
+ e = 0.5f * ((float)getsizey) * block->winmat[1][1];
+ f = 0.5f * ((float)getsizey) * (1.0f + block->winmat[3][1]);
- px= *x - sx;
- py= *y - sy;
+ px = *x - sx;
+ py = *y - sy;
- *y= (a*(py-f) + d*(c-px))/(a*e-d*b);
- *x= (px- b*(*y)- c)/a;
+ *y = (a * (py - f) + d * (c - px)) / (a * e - d * b);
+ *x = (px - b * (*y) - c) / a;
- if(block->panel) {
+ if (block->panel) {
*x -= block->panel->ofsx;
*y -= block->panel->ofsy;
}
@@ -177,19 +177,19 @@ void ui_window_to_block(const ARegion *ar, uiBlock *block, int *x, int *y)
{
float fx, fy;
- fx= *x;
- fy= *y;
+ fx = *x;
+ fy = *y;
ui_window_to_block_fl(ar, block, &fx, &fy);
- *x= (int)(fx+0.5f);
- *y= (int)(fy+0.5f);
+ *x = (int)(fx + 0.5f);
+ *y = (int)(fy + 0.5f);
}
void ui_window_to_region(const ARegion *ar, int *x, int *y)
{
- *x-= ar->winrct.xmin;
- *y-= ar->winrct.ymin;
+ *x -= ar->winrct.xmin;
+ *y -= ar->winrct.ymin;
}
/* ******************* block calc ************************* */
@@ -198,7 +198,7 @@ void ui_block_translate(uiBlock *block, int x, int y)
{
uiBut *bt;
- for(bt= block->buttons.first; bt; bt=bt->next) {
+ for (bt = block->buttons.first; bt; bt = bt->next) {
bt->x1 += x;
bt->y1 += y;
bt->x2 += x;
@@ -213,45 +213,45 @@ void ui_block_translate(uiBlock *block, int x, int y)
static void ui_text_bounds_block(uiBlock *block, float offset)
{
- uiStyle *style=UI_GetStyle();
+ uiStyle *style = UI_GetStyle();
uiBut *bt;
- int i = 0, j, x1addval= offset, nextcol;
- int lastcol= 0, col= 0;
+ int i = 0, j, x1addval = offset, nextcol;
+ int lastcol = 0, col = 0;
uiStyleFontSet(&style->widget);
- for(bt= block->buttons.first; bt; bt= bt->next) {
- if(bt->type!=SEPR) {
- j= BLF_width(style->widget.uifont_id, bt->drawstr);
+ for (bt = block->buttons.first; bt; bt = bt->next) {
+ if (bt->type != SEPR) {
+ j = BLF_width(style->widget.uifont_id, bt->drawstr);
- if(j > i) i = j;
+ if (j > i) i = j;
}
- if(bt->next && bt->x1 < bt->next->x1)
+ if (bt->next && bt->x1 < bt->next->x1)
lastcol++;
}
/* cope with multi collumns */
- bt= block->buttons.first;
- while(bt) {
- if(bt->next && bt->x1 < bt->next->x1) {
- nextcol= 1;
+ bt = block->buttons.first;
+ while (bt) {
+ if (bt->next && bt->x1 < bt->next->x1) {
+ nextcol = 1;
col++;
}
- else nextcol= 0;
+ else nextcol = 0;
bt->x1 = x1addval;
bt->x2 = bt->x1 + i + block->bounds;
- if(col == lastcol)
- bt->x2= MAX2(bt->x2, offset + block->minbounds);
+ if (col == lastcol)
+ bt->x2 = MAX2(bt->x2, offset + block->minbounds);
- ui_check_but(bt); // clips text again
+ ui_check_but(bt); // clips text again
- if(nextcol)
- x1addval+= i + block->bounds;
+ if (nextcol)
+ x1addval += i + block->bounds;
- bt= bt->next;
+ bt = bt->next;
}
}
@@ -260,26 +260,26 @@ void ui_bounds_block(uiBlock *block)
uiBut *bt;
int xof;
- if(block->buttons.first==NULL) {
- if(block->panel) {
- block->minx= 0.0; block->maxx= block->panel->sizex;
- block->miny= 0.0; block->maxy= block->panel->sizey;
+ if (block->buttons.first == NULL) {
+ if (block->panel) {
+ block->minx = 0.0; block->maxx = block->panel->sizex;
+ block->miny = 0.0; block->maxy = block->panel->sizey;
}
}
else {
- block->minx= block->miny= 10000;
- block->maxx= block->maxy= -10000;
+ block->minx = block->miny = 10000;
+ block->maxx = block->maxy = -10000;
- bt= block->buttons.first;
- while(bt) {
- if(bt->x1 < block->minx) block->minx= bt->x1;
- if(bt->y1 < block->miny) block->miny= bt->y1;
+ bt = block->buttons.first;
+ while (bt) {
+ if (bt->x1 < block->minx) block->minx = bt->x1;
+ if (bt->y1 < block->miny) block->miny = bt->y1;
- if(bt->x2 > block->maxx) block->maxx= bt->x2;
- if(bt->y2 > block->maxy) block->maxy= bt->y2;
+ if (bt->x2 > block->maxx) block->maxx = bt->x2;
+ if (bt->y2 > block->maxy) block->maxy = bt->y2;
- bt= bt->next;
+ bt = bt->next;
}
block->minx -= block->bounds;
@@ -288,22 +288,22 @@ void ui_bounds_block(uiBlock *block)
block->maxy += block->bounds;
}
- block->maxx= block->minx + MAX2(block->maxx - block->minx, block->minbounds);
+ block->maxx = block->minx + MAX2(block->maxx - block->minx, block->minbounds);
/* hardcoded exception... but that one is annoying with larger safety */
- bt= block->buttons.first;
- if(bt && strncmp(bt->str, "ERROR", 5)==0) xof= 10;
- else xof= 40;
-
- block->safety.xmin= block->minx-xof;
- block->safety.ymin= block->miny-xof;
- block->safety.xmax= block->maxx+xof;
- block->safety.ymax= block->maxy+xof;
+ bt = block->buttons.first;
+ if (bt && strncmp(bt->str, "ERROR", 5) == 0) xof = 10;
+ else xof = 40;
+
+ block->safety.xmin = block->minx - xof;
+ block->safety.ymin = block->miny - xof;
+ block->safety.xmax = block->maxx + xof;
+ block->safety.ymax = block->maxy + xof;
}
static void ui_centered_bounds_block(const bContext *C, uiBlock *block)
{
- wmWindow *window= CTX_wm_window(C);
+ wmWindow *window = CTX_wm_window(C);
int xmax, ymax;
int startx, starty;
int width, height;
@@ -316,8 +316,8 @@ static void ui_centered_bounds_block(const bContext *C, uiBlock *block)
ui_bounds_block(block);
- width= block->maxx - block->minx;
- height= block->maxy - block->miny;
+ width = block->maxx - block->minx;
+ height = block->maxy - block->miny;
startx = (xmax * 0.5f) - (width * 0.5f);
starty = (ymax * 0.5f) - (height * 0.5f);
@@ -330,60 +330,60 @@ static void ui_centered_bounds_block(const bContext *C, uiBlock *block)
}
static void ui_popup_bounds_block(const bContext *C, uiBlock *block, int bounds_calc)
{
- wmWindow *window= CTX_wm_window(C);
+ wmWindow *window = CTX_wm_window(C);
int startx, starty, endx, endy, width, height, oldwidth, oldheight;
int oldbounds, xmax, ymax;
- oldbounds= block->bounds;
+ oldbounds = block->bounds;
/* compute mouse position with user defined offset */
ui_bounds_block(block);
wm_window_get_size(window, &xmax, &ymax);
- oldwidth= block->maxx - block->minx;
- oldheight= block->maxy - block->miny;
+ oldwidth = block->maxx - block->minx;
+ oldheight = block->maxy - block->miny;
/* first we ensure wide enough text bounds */
- if(bounds_calc==UI_BLOCK_BOUNDS_POPUP_MENU) {
- if(block->flag & UI_BLOCK_LOOP) {
- block->bounds= 50;
+ if (bounds_calc == UI_BLOCK_BOUNDS_POPUP_MENU) {
+ if (block->flag & UI_BLOCK_LOOP) {
+ block->bounds = 50;
ui_text_bounds_block(block, block->minx);
}
}
/* next we recompute bounds */
- block->bounds= oldbounds;
+ block->bounds = oldbounds;
ui_bounds_block(block);
/* and we adjust the position to fit within window */
- width= block->maxx - block->minx;
- height= block->maxy - block->miny;
+ width = block->maxx - block->minx;
+ height = block->maxy - block->miny;
/* avoid divide by zero below, caused by calling with no UI, but better not crash */
- oldwidth= oldwidth > 0 ? oldwidth : MAX2(1, width);
- oldheight= oldheight > 0 ? oldheight : MAX2(1, height);
+ oldwidth = oldwidth > 0 ? oldwidth : MAX2(1, width);
+ oldheight = oldheight > 0 ? oldheight : MAX2(1, height);
/* offset block based on mouse position, user offset is scaled
* along in case we resized the block in ui_text_bounds_block */
- startx= window->eventstate->x + block->minx + (block->mx*width)/oldwidth;
- starty= window->eventstate->y + block->miny + (block->my*height)/oldheight;
+ startx = window->eventstate->x + block->minx + (block->mx * width) / oldwidth;
+ starty = window->eventstate->y + block->miny + (block->my * height) / oldheight;
- if(startx<10)
- startx= 10;
- if(starty<10)
- starty= 10;
-
- endx= startx+width;
- endy= starty+height;
-
- if(endx>xmax) {
- endx= xmax-10;
- startx= endx-width;
+ if (startx < 10)
+ startx = 10;
+ if (starty < 10)
+ starty = 10;
+
+ endx = startx + width;
+ endy = starty + height;
+
+ if (endx > xmax) {
+ endx = xmax - 10;
+ startx = endx - width;
}
- if(endy>ymax-20) {
- endy= ymax-20;
- starty= endy-height;
+ if (endy > ymax - 20) {
+ endy = ymax - 20;
+ starty = endy - height;
}
ui_block_translate(block, startx - block->minx, starty - block->miny);
@@ -395,43 +395,43 @@ static void ui_popup_bounds_block(const bContext *C, uiBlock *block, int bounds_
/* used for various cases */
void uiBoundsBlock(uiBlock *block, int addval)
{
- if(block==NULL)
+ if (block == NULL)
return;
- block->bounds= addval;
- block->dobounds= UI_BLOCK_BOUNDS;
+ block->bounds = addval;
+ block->dobounds = UI_BLOCK_BOUNDS;
}
/* used for pulldowns */
void uiTextBoundsBlock(uiBlock *block, int addval)
{
- block->bounds= addval;
- block->dobounds= UI_BLOCK_BOUNDS_TEXT;
+ block->bounds = addval;
+ block->dobounds = UI_BLOCK_BOUNDS_TEXT;
}
/* used for block popups */
void uiPopupBoundsBlock(uiBlock *block, int addval, int mx, int my)
{
- block->bounds= addval;
- block->dobounds= UI_BLOCK_BOUNDS_POPUP_MOUSE;
- block->mx= mx;
- block->my= my;
+ block->bounds = addval;
+ block->dobounds = UI_BLOCK_BOUNDS_POPUP_MOUSE;
+ block->mx = mx;
+ block->my = my;
}
/* used for menu popups */
void uiMenuPopupBoundsBlock(uiBlock *block, int addval, int mx, int my)
{
- block->bounds= addval;
- block->dobounds= UI_BLOCK_BOUNDS_POPUP_MENU;
- block->mx= mx;
- block->my= my;
+ block->bounds = addval;
+ block->dobounds = UI_BLOCK_BOUNDS_POPUP_MENU;
+ block->mx = mx;
+ block->my = my;
}
/* used for centered popups, i.e. splash */
void uiCenteredBoundsBlock(uiBlock *block, int addval)
{
- block->bounds= addval;
- block->dobounds= UI_BLOCK_BOUNDS_POPUP_CENTER;
+ block->bounds = addval;
+ block->dobounds = UI_BLOCK_BOUNDS_POPUP_CENTER;
}
void uiExplicitBoundsBlock(uiBlock *block, int minx, int miny, int maxx, int maxy)
@@ -452,26 +452,26 @@ static int ui_but_float_precision(uiBut *but, double value)
int prec;
/* first check if prec is 0 and fallback to a simple default */
- if((prec= (int)but->a2) == 0) {
- prec= (but->hardmax < 10.001f) ? 3 : 2;
+ if ((prec = (int)but->a2) == 0) {
+ 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 */
- if(value != 0.0 && (value= ABS(value)) < 0.1) {
- int value_i= (int)((value * PRECISION_FLOAT_MAX_POW) + 0.5);
- if(value_i != 0) {
- const int prec_span= 3; /* show: 0.01001, 5 would allow 0.0100001 for eg. */
+ if (value != 0.0 && (value = ABS(value)) < 0.1) {
+ int value_i = (int)((value * PRECISION_FLOAT_MAX_POW) + 0.5);
+ if (value_i != 0) {
+ const int prec_span = 3; /* show: 0.01001, 5 would allow 0.0100001 for eg. */
int test_prec;
- int prec_min= -1;
- int dec_flag= 0;
- int i= PRECISION_FLOAT_MAX;
- while(i && value_i) {
- if(value_i % 10) {
- dec_flag |= 1<<i;
- prec_min= i;
+ int prec_min = -1;
+ int dec_flag = 0;
+ int i = PRECISION_FLOAT_MAX;
+ while (i && value_i) {
+ if (value_i % 10) {
+ dec_flag |= 1 << i;
+ prec_min = i;
}
value_i /= 10;
i--;
@@ -480,15 +480,15 @@ static int ui_but_float_precision(uiBut *but, double value)
/* even though its a small value, if the second last digit is not 0, use it */
test_prec = prec_min;
- dec_flag= (dec_flag >> (prec_min + 1)) & ((1 << prec_span) - 1);
+ dec_flag = (dec_flag >> (prec_min + 1)) & ((1 << prec_span) - 1);
- while(dec_flag) {
+ while (dec_flag) {
test_prec++;
dec_flag = dec_flag >> 1;
}
- if(test_prec > prec) {
- prec= test_prec;
+ if (test_prec > prec) {
+ prec = test_prec;
}
}
}
@@ -502,17 +502,17 @@ static void ui_draw_linkline(uiLinkLine *line)
{
rcti rect;
- if(line->from==NULL || line->to==NULL) return;
+ if (line->from == NULL || line->to == NULL) return;
- rect.xmin= (line->from->x1+line->from->x2)/2.0f;
- rect.ymin= (line->from->y1+line->from->y2)/2.0f;
- rect.xmax= (line->to->x1+line->to->x2)/2.0f;
- rect.ymax= (line->to->y1+line->to->y2)/2.0f;
+ rect.xmin = (line->from->x1 + line->from->x2) / 2.0f;
+ rect.ymin = (line->from->y1 + line->from->y2) / 2.0f;
+ rect.xmax = (line->to->x1 + line->to->x2) / 2.0f;
+ rect.ymax = (line->to->y1 + line->to->y2) / 2.0f;
- if(line->flag & UI_SELECT)
- glColor3ub(100,100,100);
+ if (line->flag & UI_SELECT)
+ glColor3ub(100, 100, 100);
else
- glColor3ub(0,0,0);
+ glColor3ub(0, 0, 0);
ui_draw_link_bezier(&rect);
}
@@ -522,16 +522,16 @@ static void ui_draw_links(uiBlock *block)
uiBut *but;
uiLinkLine *line;
- but= block->buttons.first;
- while(but) {
- if(but->type==LINK && but->link) {
- line= but->link->lines.first;
- while(line) {
+ but = block->buttons.first;
+ while (but) {
+ if (but->type == LINK && but->link) {
+ line = but->link->lines.first;
+ while (line) {
ui_draw_linkline(line);
- line= line->next;
+ line = line->next;
}
}
- but= but->next;
+ but = but->next;
}
}
@@ -542,16 +542,16 @@ static int ui_but_equals_old(uiBut *but, uiBut *oldbut)
{
/* various properties are being compared here, hopefully sufficient
* to catch all cases, but it is simple to add more checks later */
- if(but->retval != oldbut->retval) return 0;
- if(but->rnapoin.data != oldbut->rnapoin.data) return 0;
- if(but->rnaprop != oldbut->rnaprop)
- if(but->rnaindex != oldbut->rnaindex) return 0;
- if(but->func != oldbut->func) return 0;
- if(but->funcN != oldbut->funcN) return 0;
- if(oldbut->func_arg1 != oldbut && but->func_arg1 != oldbut->func_arg1) return 0;
- if(oldbut->func_arg2 != oldbut && but->func_arg2 != oldbut->func_arg2) return 0;
- if(!but->funcN && ((but->poin != oldbut->poin && (uiBut*)oldbut->poin != oldbut) || but->pointype != oldbut->pointype)) return 0;
- if(but->optype != oldbut->optype) return 0;
+ if (but->retval != oldbut->retval) return 0;
+ if (but->rnapoin.data != oldbut->rnapoin.data) return 0;
+ if (but->rnaprop != oldbut->rnaprop)
+ if (but->rnaindex != oldbut->rnaindex) return 0;
+ if (but->func != oldbut->func) return 0;
+ if (but->funcN != oldbut->funcN) return 0;
+ if (oldbut->func_arg1 != oldbut && but->func_arg1 != oldbut->func_arg1) return 0;
+ if (oldbut->func_arg2 != oldbut && but->func_arg2 != oldbut->func_arg2) return 0;
+ if (!but->funcN && ((but->poin != oldbut->poin && (uiBut *)oldbut->poin != oldbut) || but->pointype != oldbut->pointype)) return 0;
+ if (but->optype != oldbut->optype) return 0;
return 1;
}
@@ -563,26 +563,26 @@ static void ui_but_update_linklines(uiBlock *block, uiBut *oldbut, uiBut *newbut
uiBut *but;
/* if active button is LINK */
- if(newbut->type==LINK && newbut->link) {
+ if (newbut->type == LINK && newbut->link) {
SWAP(uiLink *, oldbut->link, newbut->link);
- for(line= oldbut->link->lines.first; line; line= line->next) {
- if(line->to==newbut)
- line->to= oldbut;
- if(line->from==newbut)
- line->from= oldbut;
+ for (line = oldbut->link->lines.first; line; line = line->next) {
+ if (line->to == newbut)
+ line->to = oldbut;
+ if (line->from == newbut)
+ line->from = oldbut;
}
}
/* check all other button links */
- for(but= block->buttons.first; but; but= but->next) {
- if(but!=newbut && but->type==LINK && but->link) {
- for(line= but->link->lines.first; line; line= line->next) {
- if(line->to==newbut)
- line->to= oldbut;
- if(line->from==newbut)
- line->from= oldbut;
+ for (but = block->buttons.first; but; but = but->next) {
+ if (but != newbut && but->type == LINK && but->link) {
+ for (line = but->link->lines.first; line; line = line->next) {
+ if (line->to == newbut)
+ line->to = oldbut;
+ if (line->from == newbut)
+ line->from = oldbut;
}
}
}
@@ -591,16 +591,16 @@ static void ui_but_update_linklines(uiBlock *block, uiBut *oldbut, uiBut *newbut
static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut **butpp)
{
uiBlock *oldblock;
- uiBut *oldbut, *but= *butpp;
- int found= 0;
+ uiBut *oldbut, *but = *butpp;
+ int found = 0;
- oldblock= block->oldblock;
- if(!oldblock)
+ oldblock = block->oldblock;
+ if (!oldblock)
return found;
- for(oldbut=oldblock->buttons.first; oldbut; oldbut=oldbut->next) {
- if(ui_but_equals_old(oldbut, but)) {
- if(oldbut->active) {
+ for (oldbut = oldblock->buttons.first; oldbut; oldbut = oldbut->next) {
+ if (ui_but_equals_old(oldbut, but)) {
+ if (oldbut->active) {
#if 0
// but->flag= oldbut->flag;
#else
@@ -622,31 +622,31 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
// but->softmax= oldbut->softmax;
// but->linkto[0]= oldbut->linkto[0];
// but->linkto[1]= oldbut->linkto[1];
- found= 1;
+ found = 1;
// oldbut->active= NULL;
/* move button over from oldblock to new block */
BLI_remlink(&oldblock->buttons, oldbut);
BLI_insertlink(&block->buttons, but, oldbut);
- oldbut->block= block;
- *butpp= oldbut;
+ oldbut->block = block;
+ *butpp = oldbut;
/* still stuff needs to be copied */
- oldbut->x1= but->x1; oldbut->y1= but->y1;
- oldbut->x2= but->x2; oldbut->y2= but->y2;
- oldbut->context= but->context; /* set by Layout */
+ oldbut->x1 = but->x1; oldbut->y1 = but->y1;
+ oldbut->x2 = but->x2; oldbut->y2 = but->y2;
+ oldbut->context = but->context; /* set by Layout */
/* typically the same pointers, but not on undo/redo */
/* XXX some menu buttons store button itself in but->poin. Ugly */
- if(oldbut->poin != (char *)oldbut) {
+ if (oldbut->poin != (char *)oldbut) {
SWAP(char *, oldbut->poin, but->poin)
SWAP(void *, oldbut->func_argN, but->func_argN)
}
/* copy hardmin for list rows to prevent 'sticking' highlight to mouse position
* when scrolling without moving mouse (see [#28432]) */
- if(ELEM(oldbut->type, ROW, LISTROW))
- oldbut->hardmax= but->hardmax;
+ if (ELEM(oldbut->type, ROW, LISTROW))
+ oldbut->hardmax = but->hardmax;
ui_but_update_linklines(block, oldbut, but);
@@ -669,34 +669,34 @@ 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)
{
uiBlock *oldblock;
uiBut *oldbut;
- int activate= 0, found= 0, isactive= 0;
+ int activate = 0, found = 0, isactive = 0;
- oldblock= block->oldblock;
- if(!oldblock)
- activate= 1;
+ oldblock = block->oldblock;
+ if (!oldblock)
+ activate = 1;
else {
- for(oldbut=oldblock->buttons.first; oldbut; oldbut=oldbut->next) {
- if(ui_but_equals_old(oldbut, but)) {
- found= 1;
+ for (oldbut = oldblock->buttons.first; oldbut; oldbut = oldbut->next) {
+ if (ui_but_equals_old(oldbut, but)) {
+ found = 1;
- if(oldbut->active)
- isactive= 1;
+ if (oldbut->active)
+ isactive = 1;
break;
}
}
}
- if(activate || found==0) {
+ if (activate || found == 0) {
ui_button_activate_do( (bContext *)C, CTX_wm_region(C), but);
}
- else if(found && isactive==0) {
+ else if (found && isactive == 0) {
BLI_remlink(&block->buttons, but);
ui_free_but(C, but);
@@ -706,17 +706,17 @@ int uiButActiveOnly(const bContext *C, uiBlock *block, uiBut *but)
return 1;
}
-/* use to check if we need to disable undo, but dont make any changes
+/* use to check if we need to disable undo, but don't make any changes
* returns FALSE if undo needs to be disabled. */
static int ui_but_is_rna_undo(uiBut *but)
{
- if(but->rnapoin.id.data) {
+ if (but->rnapoin.id.data) {
/* avoid undo push for buttons who's ID are screen or wm level
* we could disable undo for buttons with no ID too but may have
* unforeseen consequences, so best check for ID's we _know_ are not
* handled by undo - campbell */
- ID *id= but->rnapoin.id.data;
- if(ID_CHECK_UNDO(id) == FALSE) {
+ ID *id = but->rnapoin.id.data;
+ if (ID_CHECK_UNDO(id) == FALSE) {
return FALSE;
}
else {
@@ -736,39 +736,39 @@ static void ui_menu_block_set_keyaccels(uiBlock *block)
{
uiBut *but;
- unsigned int menu_key_mask= 0;
+ unsigned int menu_key_mask = 0;
unsigned char menu_key;
const char *str_pt;
int pass;
- int tot_missing= 0;
+ int tot_missing = 0;
/* only do it before bounding */
- if(block->minx != block->maxx)
+ if (block->minx != block->maxx)
return;
- for(pass=0; pass<2; pass++) {
+ for (pass = 0; pass < 2; pass++) {
/* 2 Passes, on for first letter only, second for any letter if first fails
* fun first pass on all buttons so first word chars always get first priority */
- for(but=block->buttons.first; but; but=but->next) {
- if(!ELEM4(but->type, BUT, MENU, BLOCK, PULLDOWN) || (but->flag & UI_HIDDEN)) {
+ for (but = block->buttons.first; but; but = but->next) {
+ if (!ELEM4(but->type, BUT, MENU, BLOCK, PULLDOWN) || (but->flag & UI_HIDDEN)) {
/* pass */
}
- else if(but->menu_key=='\0') {
- if(but->str) {
- for(str_pt= but->str; *str_pt; ) {
- menu_key= tolower(*str_pt);
- if((menu_key >= 'a' && menu_key <= 'z') && !(menu_key_mask & 1<<(menu_key-'a'))) {
- menu_key_mask |= 1<<(menu_key-'a');
+ else if (but->menu_key == '\0') {
+ if (but->str) {
+ for (str_pt = but->str; *str_pt; ) {
+ menu_key = tolower(*str_pt);
+ if ((menu_key >= 'a' && menu_key <= 'z') && !(menu_key_mask & 1 << (menu_key - 'a'))) {
+ menu_key_mask |= 1 << (menu_key - 'a');
break;
}
- if(pass==0) {
- /* Skip to next delimeter on first pass (be picky) */
- while(isalpha(*str_pt))
+ if (pass == 0) {
+ /* Skip to next delimiter on first pass (be picky) */
+ while (isalpha(*str_pt))
str_pt++;
- if(*str_pt)
+ if (*str_pt)
str_pt++;
}
else {
@@ -777,8 +777,8 @@ static void ui_menu_block_set_keyaccels(uiBlock *block)
}
}
- if(*str_pt) {
- but->menu_key= menu_key;
+ if (*str_pt) {
+ but->menu_key = menu_key;
}
else {
/* run second pass */
@@ -786,7 +786,7 @@ static void ui_menu_block_set_keyaccels(uiBlock *block)
}
/* if all keys have been used just exit, unlikely */
- if(menu_key_mask == (1<<26)-1) {
+ if (menu_key_mask == (1 << 26) - 1) {
return;
}
}
@@ -794,7 +794,7 @@ static void ui_menu_block_set_keyaccels(uiBlock *block)
}
/* check if second pass is needed */
- if(!tot_missing) {
+ if (!tot_missing) {
break;
}
}
@@ -807,9 +807,9 @@ void ui_but_add_shortcut(uiBut *but, const char *shortcut_str, const short do_st
{
if (do_strip) {
- char *cpoin= strchr(but->str, '|');
- if(cpoin) {
- *cpoin= '\0';
+ char *cpoin = strchr(but->str, '|');
+ if (cpoin) {
+ *cpoin = '\0';
}
}
@@ -840,36 +840,36 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
/* for menu's */
MenuType *mt;
- IDProperty *prop_menu= NULL;
- IDProperty *prop_menu_name= NULL;
+ IDProperty *prop_menu = NULL;
+ IDProperty *prop_menu_name = NULL;
/* only do it before bounding */
- if(block->minx != block->maxx)
+ if (block->minx != block->maxx)
return;
- for(but=block->buttons.first; but; but=but->next) {
- if(but->optype) {
- IDProperty *prop= (but->opptr)? but->opptr->data: NULL;
+ for (but = block->buttons.first; but; but = but->next) {
+ if (but->optype) {
+ IDProperty *prop = (but->opptr) ? but->opptr->data : NULL;
- if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE,
- buf, sizeof(buf)))
+ if (WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE,
+ buf, sizeof(buf)))
{
ui_but_add_shortcut(but, buf, FALSE);
}
}
- else if ((mt= uiButGetMenuType(but))) {
+ else if ((mt = uiButGetMenuType(but))) {
/* only allocate menu property once */
if (prop_menu == NULL) {
/* annoying, create a property */
IDPropertyTemplate val = {0};
- prop_menu= IDP_New(IDP_GROUP, &val, __func__); /* dummy, name is unimportant */
- IDP_AddToGroup(prop_menu, (prop_menu_name= IDP_NewString("", "name", sizeof(mt->idname))));
+ prop_menu = IDP_New(IDP_GROUP, &val, __func__); /* dummy, name is unimportant */
+ IDP_AddToGroup(prop_menu, (prop_menu_name = IDP_NewString("", "name", sizeof(mt->idname))));
}
IDP_AssignString(prop_menu_name, mt->idname, sizeof(mt->idname));
- if(WM_key_event_operator_string(C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, FALSE,
- buf, sizeof(buf)))
+ if (WM_key_event_operator_string(C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, FALSE,
+ buf, sizeof(buf)))
{
ui_but_add_shortcut(but, buf, FALSE);
}
@@ -888,78 +888,78 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
void uiEndBlock(const bContext *C, uiBlock *block)
{
uiBut *but;
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
/* inherit flags from 'old' buttons that was drawn here previous, based
* on matching buttons, we need this to make button event handling non
* blocking, while still allowing buttons to be remade each redraw as it
* is expected by blender code */
- for(but=block->buttons.first; but; but=but->next) {
- if(ui_but_update_from_old_block(C, block, &but))
+ for (but = block->buttons.first; but; but = but->next) {
+ if (ui_but_update_from_old_block(C, block, &but))
ui_check_but(but);
/* temp? Proper check for greying out */
- if(but->optype) {
- wmOperatorType *ot= but->optype;
+ if (but->optype) {
+ wmOperatorType *ot = but->optype;
- if(but->context)
- CTX_store_set((bContext*)C, but->context);
+ if (but->context)
+ CTX_store_set((bContext *)C, but->context);
- if(ot == NULL || WM_operator_poll_context((bContext*)C, ot, but->opcontext)==0) {
+ if (ot == NULL || WM_operator_poll_context((bContext *)C, ot, but->opcontext) == 0) {
but->flag |= UI_BUT_DISABLED;
but->lock = 1;
}
- if(but->context)
- CTX_store_set((bContext*)C, NULL);
+ if (but->context)
+ CTX_store_set((bContext *)C, NULL);
}
- ui_but_anim_flag(but, (scene)? scene->r.cfra: 0.0f);
+ ui_but_anim_flag(but, (scene) ? scene->r.cfra : 0.0f);
}
- if(block->oldblock) {
- block->auto_open= block->oldblock->auto_open;
- block->auto_open_last= block->oldblock->auto_open_last;
- block->tooltipdisabled= block->oldblock->tooltipdisabled;
+ if (block->oldblock) {
+ block->auto_open = block->oldblock->auto_open;
+ block->auto_open_last = block->oldblock->auto_open_last;
+ block->tooltipdisabled = block->oldblock->tooltipdisabled;
- block->oldblock= NULL;
+ block->oldblock = NULL;
}
/* handle pending stuff */
- if(block->layouts.first) uiBlockLayoutResolve(block, NULL, NULL);
+ if (block->layouts.first) uiBlockLayoutResolve(block, NULL, NULL);
ui_block_do_align(block);
- if((block->flag & UI_BLOCK_LOOP) && (block->flag & UI_BLOCK_NUMSELECT)) {
+ if ((block->flag & UI_BLOCK_LOOP) && (block->flag & UI_BLOCK_NUMSELECT)) {
ui_menu_block_set_keyaccels(block); /* could use a different flag to check */
}
- if(block->flag & UI_BLOCK_LOOP) ui_menu_block_set_keymaps(C, block);
+ if (block->flag & UI_BLOCK_LOOP) ui_menu_block_set_keymaps(C, block);
/* after keymaps! */
- if(block->dobounds == UI_BLOCK_BOUNDS) ui_bounds_block(block);
- else if(block->dobounds == UI_BLOCK_BOUNDS_TEXT) ui_text_bounds_block(block, 0.0f);
- else if(block->dobounds == UI_BLOCK_BOUNDS_POPUP_CENTER) ui_centered_bounds_block(C, block);
- else if(block->dobounds) ui_popup_bounds_block(C, block, block->dobounds);
+ if (block->dobounds == UI_BLOCK_BOUNDS) ui_bounds_block(block);
+ else if (block->dobounds == UI_BLOCK_BOUNDS_TEXT) ui_text_bounds_block(block, 0.0f);
+ else if (block->dobounds == UI_BLOCK_BOUNDS_POPUP_CENTER) ui_centered_bounds_block(C, block);
+ else if (block->dobounds) ui_popup_bounds_block(C, block, block->dobounds);
- if(block->minx==0.0f && block->maxx==0.0f) uiBoundsBlock(block, 0);
- if(block->flag & UI_BUT_ALIGN) uiBlockEndAlign(block);
+ if (block->minx == 0.0f && block->maxx == 0.0f) uiBoundsBlock(block, 0);
+ if (block->flag & UI_BUT_ALIGN) uiBlockEndAlign(block);
- block->endblock= 1;
+ block->endblock = 1;
}
/* ************** BLOCK DRAWING FUNCTION ************* */
void ui_fontscale(short *points, float aspect)
{
- if(aspect < 0.9f || aspect > 1.1f) {
- float pointsf= *points;
+ if (aspect < 0.9f || aspect > 1.1f) {
+ float pointsf = *points;
/* for some reason scaling fonts goes too fast compared to widget size */
- aspect= sqrt(aspect);
+ aspect = sqrt(aspect);
pointsf /= aspect;
- if(aspect > 1.0f)
- *points= ceilf(pointsf);
+ if (aspect > 1.0f)
+ *points = ceilf(pointsf);
else
- *points= floorf(pointsf);
+ *points = floorf(pointsf);
}
}
@@ -969,43 +969,43 @@ static void ui_but_to_pixelrect(rcti *rect, const ARegion *ar, uiBlock *block, u
float gx, gy;
float getsizex, getsizey;
- getsizex= ar->winx;
- getsizey= ar->winy;
+ getsizex = ar->winx;
+ getsizey = ar->winy;
- gx= (but?but->x1:block->minx) + (block->panel?block->panel->ofsx:0.0f);
- gy= (but?but->y1:block->miny) + (block->panel?block->panel->ofsy:0.0f);
+ gx = (but ? but->x1 : block->minx) + (block->panel ? block->panel->ofsx : 0.0f);
+ gy = (but ? but->y1 : block->miny) + (block->panel ? block->panel->ofsy : 0.0f);
- rect->xmin= floorf(getsizex*(0.5f+ 0.5f*(gx*block->winmat[0][0]+ gy*block->winmat[1][0]+ block->winmat[3][0])));
- rect->ymin= floorf(getsizey*(0.5f+ 0.5f*(gx*block->winmat[0][1]+ gy*block->winmat[1][1]+ block->winmat[3][1])));
+ rect->xmin = floorf(getsizex * (0.5f + 0.5f * (gx * block->winmat[0][0] + gy * block->winmat[1][0] + block->winmat[3][0])));
+ rect->ymin = floorf(getsizey * (0.5f + 0.5f * (gx * block->winmat[0][1] + gy * block->winmat[1][1] + block->winmat[3][1])));
- gx= (but?but->x2:block->maxx) + (block->panel?block->panel->ofsx:0.0f);
- gy= (but?but->y2:block->maxy) + (block->panel?block->panel->ofsy:0.0f);
+ gx = (but ? but->x2 : block->maxx) + (block->panel ? block->panel->ofsx : 0.0f);
+ gy = (but ? but->y2 : block->maxy) + (block->panel ? block->panel->ofsy : 0.0f);
- rect->xmax= floorf(getsizex*(0.5f+ 0.5f*(gx*block->winmat[0][0]+ gy*block->winmat[1][0]+ block->winmat[3][0])));
- rect->ymax= floorf(getsizey*(0.5f+ 0.5f*(gx*block->winmat[0][1]+ gy*block->winmat[1][1]+ block->winmat[3][1])));
+ rect->xmax = floorf(getsizex * (0.5f + 0.5f * (gx * block->winmat[0][0] + gy * block->winmat[1][0] + block->winmat[3][0])));
+ rect->ymax = floorf(getsizey * (0.5f + 0.5f * (gx * block->winmat[0][1] + gy * block->winmat[1][1] + block->winmat[3][1])));
}
/* uses local copy of style, to scale things down, and allow widgets to change stuff */
void uiDrawBlock(const bContext *C, uiBlock *block)
{
- uiStyle style= *UI_GetStyle(); // XXX pass on as arg
+ uiStyle style = *UI_GetStyle(); // XXX pass on as arg
ARegion *ar;
uiBut *but;
rcti rect;
int multisample_enabled;
/* get menu region or area region */
- ar= CTX_wm_menu(C);
- if(!ar)
- ar= CTX_wm_region(C);
+ ar = CTX_wm_menu(C);
+ if (!ar)
+ ar = CTX_wm_region(C);
- if(!block->endblock)
+ if (!block->endblock)
uiEndBlock(C, block);
/* disable AA, makes widgets too blurry */
- multisample_enabled= glIsEnabled(GL_MULTISAMPLE_ARB);
- if(multisample_enabled)
+ multisample_enabled = glIsEnabled(GL_MULTISAMPLE_ARB);
+ if (multisample_enabled)
glDisable(GL_MULTISAMPLE_ARB);
/* we set this only once */
@@ -1027,22 +1027,22 @@ void uiDrawBlock(const bContext *C, uiBlock *block)
glPushMatrix();
glLoadIdentity();
- wmOrtho2(-0.01f, ar->winx-0.01f, -0.01f, ar->winy-0.01f);
+ wmOrtho2(-0.01f, ar->winx - 0.01f, -0.01f, ar->winy - 0.01f);
/* back */
- if(block->flag & UI_BLOCK_LOOP)
+ if (block->flag & UI_BLOCK_LOOP)
ui_draw_menu_back(&style, block, &rect);
- else if(block->panel)
+ else if (block->panel)
ui_draw_aligned_panel(&style, block, &rect);
/* widgets */
- for(but= block->buttons.first; but; but= but->next) {
- if(!(but->flag & (UI_HIDDEN|UI_SCROLLED))) {
+ for (but = block->buttons.first; but; but = but->next) {
+ if (!(but->flag & (UI_HIDDEN | UI_SCROLLED))) {
ui_but_to_pixelrect(&rect, ar, block, but);
/* XXX: figure out why invalid coordinates happen when closing render window */
/* and material preview is redrawn in main window (temp fix for bug #23848) */
- if(rect.xmin < rect.xmax && rect.ymin < rect.ymax)
+ if (rect.xmin < rect.xmax && rect.ymin < rect.ymax)
ui_draw_but(C, ar, &style, but, &rect);
}
}
@@ -1053,7 +1053,7 @@ void uiDrawBlock(const bContext *C, uiBlock *block)
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
- if(multisample_enabled)
+ if (multisample_enabled)
glEnable(GL_MULTISAMPLE_ARB);
ui_draw_links(block);
@@ -1063,64 +1063,64 @@ void uiDrawBlock(const bContext *C, uiBlock *block)
static void ui_is_but_sel(uiBut *but, double *value)
{
- short is_push=0, is_true=1;
+ short is_push = 0, is_true = 1;
- if(ELEM3(but->type, TOGN, ICONTOGN, OPTIONN)) is_true= 0;
+ if (ELEM3(but->type, TOGN, ICONTOGN, OPTIONN)) is_true = 0;
- if( but->bit ) {
+ if (but->bit) {
int lvalue;
UI_GET_BUT_VALUE_INIT(but, *value)
- lvalue= (int)*value;
- if( BTST(lvalue, (but->bitnr)) ) is_push= is_true;
- else is_push= !is_true;
+ lvalue = (int)*value;
+ if (BTST(lvalue, (but->bitnr)) ) is_push = is_true;
+ else is_push = !is_true;
}
else {
- switch(but->type) {
- case BUT:
- is_push= 2;
- break;
- case HOTKEYEVT:
- case KEYEVT:
- is_push= 2;
- break;
- case TOGBUT:
- case TOG:
- case TOGR:
- case TOG3:
- case BUT_TOGDUAL:
- case ICONTOG:
- case OPTION:
- UI_GET_BUT_VALUE_INIT(but, *value)
- if(*value != (double)but->hardmin) is_push= 1;
- break;
- case ICONTOGN:
- case TOGN:
- case OPTIONN:
- UI_GET_BUT_VALUE_INIT(but, *value)
- if(*value==0.0) is_push= 1;
- break;
- case ROW:
- case LISTROW:
- UI_GET_BUT_VALUE_INIT(but, *value)
- /* support for rna enum buts */
- if(but->rnaprop && (RNA_property_flag(but->rnaprop) & PROP_ENUM_FLAG)) {
- if((int)*value & (int)but->hardmax) is_push= 1;
- }
- else {
- if(*value == (double)but->hardmax) is_push= 1;
- }
- break;
- case COL:
- is_push= 2;
- break;
- default:
- is_push= 2;
- break;
+ switch (but->type) {
+ case BUT:
+ is_push = 2;
+ break;
+ case HOTKEYEVT:
+ case KEYEVT:
+ is_push = 2;
+ break;
+ case TOGBUT:
+ case TOG:
+ case TOGR:
+ case TOG3:
+ case BUT_TOGDUAL:
+ case ICONTOG:
+ case OPTION:
+ UI_GET_BUT_VALUE_INIT(but, *value)
+ if (*value != (double)but->hardmin) is_push = 1;
+ break;
+ case ICONTOGN:
+ case TOGN:
+ case OPTIONN:
+ UI_GET_BUT_VALUE_INIT(but, *value)
+ if (*value == 0.0) is_push = 1;
+ break;
+ case ROW:
+ case LISTROW:
+ UI_GET_BUT_VALUE_INIT(but, *value)
+ /* support for rna enum buts */
+ if (but->rnaprop && (RNA_property_flag(but->rnaprop) & PROP_ENUM_FLAG)) {
+ if ((int)*value & (int)but->hardmax) is_push = 1;
+ }
+ else {
+ if (*value == (double)but->hardmax) is_push = 1;
+ }
+ break;
+ case COL:
+ is_push = 2;
+ break;
+ default:
+ is_push = 2;
+ break;
}
}
- if(is_push==2);
- else if(is_push==1) but->flag |= UI_SELECT;
+ if (is_push == 2) ;
+ else if (is_push == 1) but->flag |= UI_SELECT;
else but->flag &= ~UI_SELECT;
}
@@ -1128,12 +1128,12 @@ static uiBut *ui_find_inlink(uiBlock *block, void *poin)
{
uiBut *but;
- but= block->buttons.first;
- while(but) {
- if(but->type==INLINK) {
- if(but->poin == poin) return but;
+ but = block->buttons.first;
+ while (but) {
+ if (but->type == INLINK) {
+ if (but->poin == poin) return but;
}
- but= but->next;
+ but = but->next;
}
return NULL;
}
@@ -1142,10 +1142,10 @@ static void ui_add_link_line(ListBase *listb, uiBut *but, uiBut *bt)
{
uiLinkLine *line;
- line= MEM_callocN(sizeof(uiLinkLine), "linkline");
+ line = MEM_callocN(sizeof(uiLinkLine), "linkline");
BLI_addtail(listb, line);
- line->from= but;
- line->to= bt;
+ line->from = but;
+ line->to = bt;
}
uiBut *uiFindInlink(uiBlock *block, void *poin)
@@ -1160,31 +1160,31 @@ void uiComposeLinks(uiBlock *block)
void ***ppoin;
int a;
- but= block->buttons.first;
- while(but) {
- if(but->type==LINK) {
- link= but->link;
+ but = block->buttons.first;
+ while (but) {
+ if (but->type == LINK) {
+ link = but->link;
/* for all pointers in the array */
- if(link) {
- if(link->ppoin) {
- ppoin= link->ppoin;
- for(a=0; a < *(link->totlink); a++) {
- bt= ui_find_inlink(block, (*ppoin)[a] );
- if(bt) {
+ if (link) {
+ if (link->ppoin) {
+ ppoin = link->ppoin;
+ for (a = 0; a < *(link->totlink); a++) {
+ bt = ui_find_inlink(block, (*ppoin)[a]);
+ if (bt) {
ui_add_link_line(&link->lines, but, bt);
}
}
}
- else if(link->poin) {
- bt= ui_find_inlink(block, *(link->poin) );
- if(bt) {
+ else if (link->poin) {
+ bt = ui_find_inlink(block, *(link->poin) );
+ if (bt) {
ui_add_link_line(&link->lines, but, bt);
}
}
}
}
- but= but->next;
+ but = but->next;
}
}
@@ -1193,16 +1193,16 @@ void uiComposeLinks(uiBlock *block)
void uiBlockSetButLock(uiBlock *block, int val, const char *lockstr)
{
- if(val) {
- block->lock= val ? 1:0;
- block->lockstr= lockstr;
+ if (val) {
+ block->lock = val ? 1 : 0;
+ block->lockstr = lockstr;
}
}
void uiBlockClearButLock(uiBlock *block)
{
- block->lock= 0;
- block->lockstr= NULL;
+ block->lock = 0;
+ block->lockstr = NULL;
}
/* *************************************************************** */
@@ -1214,22 +1214,22 @@ void ui_delete_linkline(uiLinkLine *line, uiBut *but)
BLI_remlink(&but->link->lines, line);
- link= line->from->link;
+ link = line->from->link;
/* are there more pointers allowed? */
- if(link->ppoin) {
+ if (link->ppoin) {
- if(*(link->totlink)==1) {
- *(link->totlink)= 0;
+ if (*(link->totlink) == 1) {
+ *(link->totlink) = 0;
MEM_freeN(*(link->ppoin));
- *(link->ppoin)= NULL;
+ *(link->ppoin) = NULL;
}
else {
- b= 0;
- for(a=0; a< (*(link->totlink)); a++) {
+ b = 0;
+ for (a = 0; a < (*(link->totlink)); a++) {
- if( (*(link->ppoin))[a] != line->to->poin ) {
- (*(link->ppoin))[b]= (*(link->ppoin))[a];
+ if ( (*(link->ppoin))[a] != line->to->poin) {
+ (*(link->ppoin))[b] = (*(link->ppoin))[a];
b++;
}
}
@@ -1237,7 +1237,7 @@ void ui_delete_linkline(uiLinkLine *line, uiBut *but)
}
}
else {
- *(link->poin)= NULL;
+ *(link->poin) = NULL;
}
MEM_freeN(line);
@@ -1254,37 +1254,37 @@ void ui_get_but_vectorf(uiBut *but, float vec[3])
PropertyRNA *prop;
int a, tot;
- if(but->editvec) {
+ if (but->editvec) {
copy_v3_v3(vec, but->editvec);
}
- if(but->rnaprop) {
- prop= but->rnaprop;
+ if (but->rnaprop) {
+ prop = but->rnaprop;
- vec[0]= vec[1]= vec[2]= 0.0f;
+ vec[0] = vec[1] = vec[2] = 0.0f;
- if(RNA_property_type(prop) == PROP_FLOAT) {
- tot= RNA_property_array_length(&but->rnapoin, prop);
- tot= MIN2(tot, 3);
+ if (RNA_property_type(prop) == PROP_FLOAT) {
+ tot = RNA_property_array_length(&but->rnapoin, prop);
+ tot = MIN2(tot, 3);
- for(a=0; a<tot; a++)
- vec[a]= RNA_property_float_get_index(&but->rnapoin, prop, a);
+ for (a = 0; a < tot; a++)
+ vec[a] = RNA_property_float_get_index(&but->rnapoin, prop, a);
}
}
- else if(but->pointype == CHA) {
- char *cp= (char *)but->poin;
- vec[0]= ((float)cp[0])/255.0f;
- vec[1]= ((float)cp[1])/255.0f;
- vec[2]= ((float)cp[2])/255.0f;
+ else if (but->pointype == CHA) {
+ char *cp = (char *)but->poin;
+ vec[0] = ((float)cp[0]) / 255.0f;
+ vec[1] = ((float)cp[1]) / 255.0f;
+ vec[2] = ((float)cp[2]) / 255.0f;
}
- else if(but->pointype == FLO) {
- float *fp= (float *)but->poin;
+ else if (but->pointype == FLO) {
+ float *fp = (float *)but->poin;
copy_v3_v3(vec, fp);
}
else {
- if (but->editvec==NULL) {
+ if (but->editvec == NULL) {
fprintf(stderr, "ui_get_but_vectorf: can't get color, should never happen\n");
- vec[0]= vec[1]= vec[2]= 0.0f;
+ vec[0] = vec[1] = vec[2] = 0.0f;
}
}
@@ -1298,43 +1298,43 @@ void ui_set_but_vectorf(uiBut *but, const float vec[3])
{
PropertyRNA *prop;
- if(but->editvec) {
+ if (but->editvec) {
copy_v3_v3(but->editvec, vec);
}
- if(but->rnaprop) {
- prop= but->rnaprop;
+ if (but->rnaprop) {
+ prop = but->rnaprop;
- if(RNA_property_type(prop) == PROP_FLOAT) {
+ if (RNA_property_type(prop) == PROP_FLOAT) {
int tot;
int a;
- tot= RNA_property_array_length(&but->rnapoin, prop);
- tot= MIN2(tot, 3);
+ tot = RNA_property_array_length(&but->rnapoin, prop);
+ tot = MIN2(tot, 3);
- for (a=0; a<tot; a++) {
+ for (a = 0; a < tot; a++) {
RNA_property_float_set_index(&but->rnapoin, prop, a, vec[a]);
}
}
}
- else if(but->pointype == CHA) {
- char *cp= (char *)but->poin;
- cp[0]= (char)(0.5f + vec[0]*255.0f);
- cp[1]= (char)(0.5f + vec[1]*255.0f);
- cp[2]= (char)(0.5f + vec[2]*255.0f);
+ else if (but->pointype == CHA) {
+ char *cp = (char *)but->poin;
+ cp[0] = (char)(0.5f + vec[0] * 255.0f);
+ cp[1] = (char)(0.5f + vec[1] * 255.0f);
+ cp[2] = (char)(0.5f + vec[2] * 255.0f);
}
- else if(but->pointype == FLO) {
- float *fp= (float *)but->poin;
+ else if (but->pointype == FLO) {
+ float *fp = (float *)but->poin;
copy_v3_v3(fp, vec);
}
}
int ui_is_but_float(uiBut *but)
{
- if(but->pointype==FLO && but->poin)
+ if (but->pointype == FLO && but->poin)
return 1;
- if(but->rnaprop && RNA_property_type(but->rnaprop) == PROP_FLOAT)
+ if (but->rnaprop && RNA_property_type(but->rnaprop) == PROP_FLOAT)
return 1;
return 0;
@@ -1342,10 +1342,10 @@ int ui_is_but_float(uiBut *but)
int ui_is_but_unit(uiBut *but)
{
- UnitSettings *unit= but->block->unit;
- const int unit_type= uiButGetUnitType(but);
+ UnitSettings *unit = but->block->unit;
+ const int unit_type = uiButGetUnitType(but);
- if(unit_type == PROP_UNIT_NONE)
+ if (unit_type == PROP_UNIT_NONE)
return 0;
#if 1 // removed so angle buttons get correct snapping
@@ -1368,7 +1368,7 @@ int ui_is_but_unit(uiBut *but)
int ui_is_but_rna_valid(uiBut *but)
{
- if (but->rnaprop==NULL || RNA_struct_contains_property(&but->rnapoin, but->rnaprop)) {
+ if (but->rnaprop == NULL || RNA_struct_contains_property(&but->rnapoin, but->rnaprop)) {
return TRUE;
}
else {
@@ -1382,62 +1382,62 @@ double ui_get_but_val(uiBut *but)
PropertyRNA *prop;
double value = 0.0;
- if(but->editval) { return *(but->editval); }
- if(but->poin==NULL && but->rnapoin.data==NULL) return 0.0;
+ if (but->editval) { return *(but->editval); }
+ if (but->poin == NULL && but->rnapoin.data == NULL) return 0.0;
- if(but->rnaprop) {
- prop= but->rnaprop;
+ if (but->rnaprop) {
+ prop = but->rnaprop;
- switch(RNA_property_type(prop)) {
+ switch (RNA_property_type(prop)) {
case PROP_BOOLEAN:
- if(RNA_property_array_check(prop))
- value= RNA_property_boolean_get_index(&but->rnapoin, prop, but->rnaindex);
+ if (RNA_property_array_check(prop))
+ value = RNA_property_boolean_get_index(&but->rnapoin, prop, but->rnaindex);
else
- value= RNA_property_boolean_get(&but->rnapoin, prop);
+ value = RNA_property_boolean_get(&but->rnapoin, prop);
break;
case PROP_INT:
- if(RNA_property_array_check(prop))
- value= RNA_property_int_get_index(&but->rnapoin, prop, but->rnaindex);
+ if (RNA_property_array_check(prop))
+ value = RNA_property_int_get_index(&but->rnapoin, prop, but->rnaindex);
else
- value= RNA_property_int_get(&but->rnapoin, prop);
+ value = RNA_property_int_get(&but->rnapoin, prop);
break;
case PROP_FLOAT:
- if(RNA_property_array_check(prop))
- value= RNA_property_float_get_index(&but->rnapoin, prop, but->rnaindex);
+ if (RNA_property_array_check(prop))
+ value = RNA_property_float_get_index(&but->rnapoin, prop, but->rnaindex);
else
- value= RNA_property_float_get(&but->rnapoin, prop);
+ value = RNA_property_float_get(&but->rnapoin, prop);
break;
case PROP_ENUM:
- value= RNA_property_enum_get(&but->rnapoin, prop);
+ value = RNA_property_enum_get(&but->rnapoin, prop);
break;
default:
- value= 0.0;
+ value = 0.0;
break;
}
}
- else if(but->type== HSVSLI) {
+ else if (but->type == HSVSLI) {
float h, s, v, *fp;
- fp= (but->editvec)? but->editvec: (float *)but->poin;
+ fp = (but->editvec) ? but->editvec : (float *)but->poin;
rgb_to_hsv(fp[0], fp[1], fp[2], &h, &s, &v);
- switch(but->str[0]) {
- case 'H': value= h; break;
- case 'S': value= s; break;
- case 'V': value= v; break;
+ switch (but->str[0]) {
+ case 'H': value = h; break;
+ case 'S': value = s; break;
+ case 'V': value = v; break;
}
}
- else if( but->pointype == CHA ) {
- value= *(char *)but->poin;
+ else if (but->pointype == CHA) {
+ value = *(char *)but->poin;
}
- else if( but->pointype == SHO ) {
- value= *(short *)but->poin;
+ else if (but->pointype == SHO) {
+ value = *(short *)but->poin;
}
- else if( but->pointype == INT ) {
- value= *(int *)but->poin;
+ else if (but->pointype == INT) {
+ value = *(int *)but->poin;
}
- else if( but->pointype == FLO ) {
- value= *(float *)but->poin;
+ else if (but->pointype == FLO) {
+ value = *(float *)but->poin;
}
return value;
@@ -1448,32 +1448,32 @@ void ui_set_but_val(uiBut *but, double value)
PropertyRNA *prop;
/* value is a hsv value: convert to rgb */
- if(but->rnaprop) {
- prop= but->rnaprop;
+ if (but->rnaprop) {
+ prop = but->rnaprop;
- if(RNA_property_editable(&but->rnapoin, prop)) {
- switch(RNA_property_type(prop)) {
+ if (RNA_property_editable(&but->rnapoin, prop)) {
+ switch (RNA_property_type(prop)) {
case PROP_BOOLEAN:
- if(RNA_property_array_length(&but->rnapoin, prop))
+ if (RNA_property_array_length(&but->rnapoin, prop))
RNA_property_boolean_set_index(&but->rnapoin, prop, but->rnaindex, value);
else
RNA_property_boolean_set(&but->rnapoin, prop, value);
break;
case PROP_INT:
- if(RNA_property_array_length(&but->rnapoin, prop))
+ if (RNA_property_array_length(&but->rnapoin, prop))
RNA_property_int_set_index(&but->rnapoin, prop, but->rnaindex, (int)value);
else
RNA_property_int_set(&but->rnapoin, prop, (int)value);
break;
case PROP_FLOAT:
- if(RNA_property_array_length(&but->rnapoin, prop))
+ if (RNA_property_array_length(&but->rnapoin, prop))
RNA_property_float_set_index(&but->rnapoin, prop, but->rnaindex, value);
else
RNA_property_float_set(&but->rnapoin, prop, value);
break;
case PROP_ENUM:
- if(RNA_property_flag(prop) & PROP_ENUM_FLAG) {
- int ivalue= (int)value;
+ if (RNA_property_flag(prop) & PROP_ENUM_FLAG) {
+ int ivalue = (int)value;
ivalue ^= RNA_property_enum_get(&but->rnapoin, prop); /* toggle for enum/flag buttons */
RNA_property_enum_set(&but->rnapoin, prop, ivalue);
}
@@ -1488,56 +1488,56 @@ void ui_set_but_val(uiBut *but, double value)
/* we can't be sure what RNA set functions actually do,
* so leave this unset */
- value= UI_BUT_VALUE_UNSET;
+ value = UI_BUT_VALUE_UNSET;
}
- else if(but->pointype==0);
- else if(but->type==HSVSLI ) {
+ else if (but->pointype == 0) ;
+ else if (but->type == HSVSLI) {
float h, s, v, *fp;
- fp= (but->editvec)? but->editvec: (float *)but->poin;
+ fp = (but->editvec) ? but->editvec : (float *)but->poin;
rgb_to_hsv(fp[0], fp[1], fp[2], &h, &s, &v);
- switch(but->str[0]) {
- case 'H': h= value; break;
- case 'S': s= value; break;
- case 'V': v= value; break;
+ switch (but->str[0]) {
+ case 'H': h = value; break;
+ case 'S': s = value; break;
+ case 'V': v = value; break;
}
- hsv_to_rgb(h, s, v, fp, fp+1, fp+2);
+ hsv_to_rgb(h, s, v, fp, fp + 1, fp + 2);
}
else {
/* first do rounding */
- if(but->pointype==CHA)
- value= (char)floor(value+0.5);
- else if(but->pointype==SHO ) {
+ if (but->pointype == CHA)
+ value = (char)floor(value + 0.5);
+ else if (but->pointype == SHO) {
/* 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;
+ gcckludge = (int) floor(value + 0.5);
+ value = (short)gcckludge;
}
- else if(but->pointype==INT )
- value= (int)floor(value+0.5);
- else if(but->pointype==FLO ) {
- float fval= (float)value;
- if(fval>= -0.00001f && fval<= 0.00001f) fval= 0.0f; /* prevent negative zero */
- value= fval;
+ else if (but->pointype == INT)
+ value = (int)floor(value + 0.5);
+ else if (but->pointype == FLO) {
+ float fval = (float)value;
+ if (fval >= -0.00001f && fval <= 0.00001f) fval = 0.0f; /* prevent negative zero */
+ value = fval;
}
/* then set value with possible edit override */
- if(but->editval)
- value= *but->editval= value;
- else if(but->pointype==CHA)
- value= *((char *)but->poin)= (char)value;
- else if(but->pointype==SHO)
- value= *((short *)but->poin)= (short)value;
- else if(but->pointype==INT)
- value= *((int *)but->poin)= (int)value;
- else if(but->pointype==FLO)
- value= *((float *)but->poin)= (float)value;
+ if (but->editval)
+ value = *but->editval = value;
+ else if (but->pointype == CHA)
+ value = *((char *)but->poin) = (char)value;
+ else if (but->pointype == SHO)
+ value = *((short *)but->poin) = (short)value;
+ else if (but->pointype == INT)
+ value = *((int *)but->poin) = (int)value;
+ else if (but->pointype == FLO)
+ value = *((float *)but->poin) = (float)value;
}
/* update select flag */
@@ -1546,30 +1546,30 @@ void ui_set_but_val(uiBut *but, double value)
int ui_get_but_string_max_length(uiBut *but)
{
- if(ELEM(but->type, TEX, SEARCH_MENU))
+ if (ELEM(but->type, TEX, SEARCH_MENU))
return but->hardmax;
- else if(but->type == IDPOIN)
- return MAX_ID_NAME-2;
+ else if (but->type == IDPOIN)
+ return MAX_ID_NAME - 2;
else
return UI_MAX_DRAW_STR;
}
static double ui_get_but_scale_unit(uiBut *but, double value)
{
- UnitSettings *unit= but->block->unit;
- int unit_type= uiButGetUnitType(but);
+ UnitSettings *unit = but->block->unit;
+ int unit_type = uiButGetUnitType(but);
- if(unit_type == PROP_UNIT_LENGTH) {
+ if (unit_type == PROP_UNIT_LENGTH) {
return value * (double)unit->scale_length;
}
- else if(unit_type == PROP_UNIT_AREA) {
+ else if (unit_type == PROP_UNIT_AREA) {
return value * pow(unit->scale_length, 2);
}
- else if(unit_type == PROP_UNIT_VOLUME) {
+ else if (unit_type == PROP_UNIT_VOLUME) {
return value * pow(unit->scale_length, 3);
}
- else if(unit_type == PROP_UNIT_TIME) { /* WARNING - using evil_C :| */
- Scene *scene= CTX_data_scene(but->block->evil_C);
+ else if (unit_type == PROP_UNIT_TIME) { /* WARNING - using evil_C :| */
+ Scene *scene = CTX_data_scene(but->block->evil_C);
return FRA2TIME(value);
}
else {
@@ -1580,15 +1580,15 @@ static double ui_get_but_scale_unit(uiBut *but, double value)
/* str will be overwritten */
void ui_convert_to_unit_alt_name(uiBut *but, char *str, size_t maxlen)
{
- if(ui_is_but_unit(but)) {
- UnitSettings *unit= but->block->unit;
- int unit_type= uiButGetUnitType(but);
+ if (ui_is_but_unit(but)) {
+ UnitSettings *unit = but->block->unit;
+ int unit_type = uiButGetUnitType(but);
char *orig_str;
- orig_str= MEM_callocN(sizeof(char)*maxlen + 1, "textedit sub str");
+ orig_str = MEM_callocN(sizeof(char) * maxlen + 1, "textedit sub str");
memcpy(orig_str, str, maxlen);
- bUnit_ToUnitAltName(str, maxlen, orig_str, unit->system, unit_type>>16);
+ bUnit_ToUnitAltName(str, maxlen, orig_str, unit->system, unit_type >> 16);
MEM_freeN(orig_str);
}
@@ -1596,29 +1596,29 @@ void ui_convert_to_unit_alt_name(uiBut *but, char *str, size_t maxlen)
static void ui_get_but_string_unit(uiBut *but, char *str, int len_max, double value, int pad)
{
- UnitSettings *unit= but->block->unit;
- int do_split= unit->flag & USER_UNIT_OPT_SPLIT;
- int unit_type= uiButGetUnitType(but);
- int precision= but->a2;
+ UnitSettings *unit = but->block->unit;
+ int do_split = unit->flag & USER_UNIT_OPT_SPLIT;
+ int unit_type = uiButGetUnitType(but);
+ int precision = but->a2;
- if(unit->scale_length<0.0001f) unit->scale_length= 1.0f; // XXX do_versions
+ if (unit->scale_length < 0.0001f) unit->scale_length = 1.0f; // XXX do_versions
/* Sanity checks */
- if(precision > PRECISION_FLOAT_MAX) precision= PRECISION_FLOAT_MAX;
- else if(precision==0) precision= 2;
+ if (precision > PRECISION_FLOAT_MAX) precision = PRECISION_FLOAT_MAX;
+ else if (precision == 0) precision = 2;
- bUnit_AsString(str, len_max, ui_get_but_scale_unit(but, value), precision, unit->system, unit_type>>16, do_split, pad);
+ bUnit_AsString(str, len_max, ui_get_but_scale_unit(but, value), precision, unit->system, unit_type >> 16, do_split, pad);
}
static float ui_get_but_step_unit(uiBut *but, float step_default)
{
- int unit_type= uiButGetUnitType(but)>>16;
+ int unit_type = uiButGetUnitType(but) >> 16;
float step;
step = bUnit_ClosestScalar(ui_get_but_scale_unit(but, step_default), but->block->unit->system, unit_type);
- if(step > 0.0f) { /* -1 is an error value */
- return (float)((double)step/ui_get_but_scale_unit(but, 1.0))*100.0f;
+ if (step > 0.0f) { /* -1 is an error value */
+ return (float)((double)step / ui_get_but_scale_unit(but, 1.0)) * 100.0f;
}
else {
return step_default;
@@ -1628,68 +1628,68 @@ static float ui_get_but_step_unit(uiBut *but, float step_default)
void ui_get_but_string(uiBut *but, char *str, size_t maxlen)
{
- if(but->rnaprop && ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) {
+ if (but->rnaprop && ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) {
PropertyType type;
- char *buf= NULL;
+ char *buf = NULL;
int buf_len;
- type= RNA_property_type(but->rnaprop);
+ type = RNA_property_type(but->rnaprop);
- if(type == PROP_STRING) {
+ if (type == PROP_STRING) {
/* RNA string */
- buf= RNA_property_string_get_alloc(&but->rnapoin, but->rnaprop, str, maxlen, &buf_len);
+ buf = RNA_property_string_get_alloc(&but->rnapoin, but->rnaprop, str, maxlen, &buf_len);
}
- else if(type == PROP_POINTER) {
+ else if (type == PROP_POINTER) {
/* RNA pointer */
- PointerRNA ptr= RNA_property_pointer_get(&but->rnapoin, but->rnaprop);
- buf= RNA_struct_name_get_alloc(&ptr, str, maxlen, &buf_len);
+ PointerRNA ptr = RNA_property_pointer_get(&but->rnapoin, but->rnaprop);
+ buf = RNA_struct_name_get_alloc(&ptr, str, maxlen, &buf_len);
}
- if(!buf) {
+ if (!buf) {
str[0] = '\0';
}
- else if(buf && buf != str) {
+ else if (buf && buf != str) {
/* string was too long, we have to truncate */
- memcpy(str, buf, MIN2(maxlen, buf_len+1));
+ memcpy(str, buf, MIN2(maxlen, buf_len + 1));
MEM_freeN(buf);
}
}
- else if(but->type == IDPOIN) {
+ else if (but->type == IDPOIN) {
/* ID pointer */
- if(but->idpoin_idpp) { /* Can be NULL for ID properties by python */
- ID *id= *(but->idpoin_idpp);
- if(id) {
- BLI_strncpy(str, id->name+2, maxlen);
+ if (but->idpoin_idpp) { /* Can be NULL for ID properties by python */
+ ID *id = *(but->idpoin_idpp);
+ if (id) {
+ BLI_strncpy(str, id->name + 2, maxlen);
return;
}
}
str[0] = '\0';
return;
}
- else if(but->type == TEX) {
+ else if (but->type == TEX) {
/* string */
BLI_strncpy(str, but->poin, maxlen);
return;
}
- else if(but->type == SEARCH_MENU) {
+ else if (but->type == SEARCH_MENU) {
/* string */
BLI_strncpy(str, but->poin, maxlen);
return;
}
- else if(ui_but_anim_expression_get(but, str, maxlen))
- ; /* driver expression */
+ else if (ui_but_anim_expression_get(but, str, maxlen))
+ ; /* driver expression */
else {
/* number editing */
double value;
- value= ui_get_but_val(but);
+ value = ui_get_but_val(but);
- if(ui_is_but_float(but)) {
- if(ui_is_but_unit(but)) {
+ if (ui_is_but_float(but)) {
+ if (ui_is_but_unit(but)) {
ui_get_but_string_unit(but, str, maxlen, value, 0);
}
else {
- const int prec= ui_but_float_precision(but, value);
+ const int prec = ui_but_float_precision(but, value);
BLI_snprintf(str, maxlen, "%.*f", prec, value);
}
}
@@ -1703,12 +1703,12 @@ void ui_get_but_string(uiBut *but, char *str, size_t maxlen)
static int ui_set_but_string_eval_num_unit(bContext *C, uiBut *but, const char *str, double *value)
{
char str_unit_convert[256];
- const int unit_type= uiButGetUnitType(but);
+ const int unit_type = uiButGetUnitType(but);
BLI_strncpy(str_unit_convert, str, sizeof(str_unit_convert));
/* ugly, use the draw string to get the value, this could cause problems if it includes some text which resolves to a unit */
- bUnit_ReplaceString(str_unit_convert, sizeof(str_unit_convert), but->drawstr, ui_get_but_scale_unit(but, 1.0), but->block->unit->system, unit_type>>16);
+ bUnit_ReplaceString(str_unit_convert, sizeof(str_unit_convert), but->drawstr, ui_get_but_scale_unit(but, 1.0), but->block->unit->system, unit_type >> 16);
return (BPY_button_exec(C, str_unit_convert, value, TRUE) != -1);
}
@@ -1718,36 +1718,39 @@ static int ui_set_but_string_eval_num_unit(bContext *C, uiBut *but, const char *
int ui_set_but_string_eval_num(bContext *C, uiBut *but, const char *str, double *value)
{
- int ok= FALSE;
+ int ok = FALSE;
#ifdef WITH_PYTHON
- if(str[0] != '\0') {
- int is_unit_but= ui_is_but_unit(but);
+ if (str[0] != '\0') {
+ int is_unit_but = ui_is_but_unit(but);
/* only enable verbose if we won't run again with units */
- if(BPY_button_exec(C, str, value, is_unit_but==FALSE) != -1) {
+ if (BPY_button_exec(C, str, value, is_unit_but == FALSE) != -1) {
/* if the value parsed ok without unit conversion this button may still need a unit multiplier */
- if(is_unit_but) {
+ if (is_unit_but) {
char str_new[128];
BLI_snprintf(str_new, sizeof(str_new), "%f", *value);
- ok= ui_set_but_string_eval_num_unit(C, but, str_new, value);
+ ok = ui_set_but_string_eval_num_unit(C, but, str_new, value);
}
else {
- ok= TRUE; /* parse normal string via py (no unit conversion needed) */
+ ok = TRUE; /* parse normal string via py (no unit conversion needed) */
}
}
- else if(is_unit_but) {
+ else if (is_unit_but) {
/* parse failed, this is a unit but so run replacements and parse again */
- ok= ui_set_but_string_eval_num_unit(C, but, str, value);
+ ok = ui_set_but_string_eval_num_unit(C, but, str, value);
}
}
#else /* WITH_PYTHON */
- value= atof(str);
+ *value = atof(str);
ok = TRUE;
+ (void)C;
+ (void)but;
+
#endif /* WITH_PYTHON */
return ok;
@@ -1756,31 +1759,31 @@ int ui_set_but_string_eval_num(bContext *C, uiBut *but, const char *str, double
int ui_set_but_string(bContext *C, uiBut *but, const char *str)
{
- if(but->rnaprop && ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) {
- if(RNA_property_editable(&but->rnapoin, but->rnaprop)) {
+ if (but->rnaprop && ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) {
+ if (RNA_property_editable(&but->rnapoin, but->rnaprop)) {
PropertyType type;
- type= RNA_property_type(but->rnaprop);
+ type = RNA_property_type(but->rnaprop);
- if(type == PROP_STRING) {
+ if (type == PROP_STRING) {
/* RNA string */
RNA_property_string_set(&but->rnapoin, but->rnaprop, str);
return 1;
}
- else if(type == PROP_POINTER) {
+ else if (type == PROP_POINTER) {
/* RNA pointer */
PointerRNA ptr, rptr;
PropertyRNA *prop;
- if(str == NULL || str[0] == '\0') {
+ if (str == NULL || str[0] == '\0') {
RNA_property_pointer_set(&but->rnapoin, but->rnaprop, PointerRNA_NULL);
return 1;
}
else {
- ptr= but->rnasearchpoin;
- prop= but->rnasearchprop;
+ ptr = but->rnasearchpoin;
+ prop = but->rnasearchprop;
- if(prop && RNA_property_collection_lookup_string(&ptr, prop, str, &rptr))
+ if (prop && RNA_property_collection_lookup_string(&ptr, prop, str, &rptr))
RNA_property_pointer_set(&but->rnapoin, but->rnaprop, rptr);
return 1;
@@ -1790,45 +1793,45 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str)
}
}
}
- else if(but->type == IDPOIN) {
+ else if (but->type == IDPOIN) {
/* ID pointer */
but->idpoin_func(C, str, but->idpoin_idpp);
return 1;
}
- else if(but->type == TEX) {
+ else if (but->type == TEX) {
/* string */
- if(ui_is_but_utf8(but)) BLI_strncpy_utf8(but->poin, str, but->hardmax);
- else BLI_strncpy(but->poin, str, but->hardmax);
+ if (ui_is_but_utf8(but)) BLI_strncpy_utf8(but->poin, str, but->hardmax);
+ else BLI_strncpy(but->poin, str, but->hardmax);
return 1;
}
- else if(but->type == SEARCH_MENU) {
+ else if (but->type == SEARCH_MENU) {
/* string */
BLI_strncpy(but->poin, str, but->hardmax);
return 1;
}
- else if(ui_but_anim_expression_set(but, str)) {
+ else if (ui_but_anim_expression_set(but, str)) {
/* driver expression */
return 1;
}
- else if(str[0]=='#') {
+ else if (str[0] == '#') {
/* shortcut to create new driver expression (versus immediate Py-execution) */
- return ui_but_anim_expression_create(but, str+1);
+ return ui_but_anim_expression_create(but, str + 1);
}
else {
/* number editing */
double value;
- if(ui_set_but_string_eval_num(C, but, str, &value) == FALSE) {
+ if (ui_set_but_string_eval_num(C, but, str, &value) == FALSE) {
return 0;
}
- if(!ui_is_but_float(but)) value= (int)floor(value + 0.5);
- if(but->type==NUMABS) value= fabs(value);
+ if (!ui_is_but_float(but)) value = (int)floor(value + 0.5);
+ if (but->type == NUMABS) value = fabs(value);
/* not that we use hard limits here */
- if(value < (double)but->hardmin) value= but->hardmin;
- if(value > (double)but->hardmax) value= but->hardmax;
+ if (value < (double)but->hardmin) value = but->hardmin;
+ if (value > (double)but->hardmax) value = but->hardmax;
ui_set_but_val(but, value);
return 1;
@@ -1850,12 +1853,12 @@ void ui_set_but_default(bContext *C, short all)
static double soft_range_round_up(double value, double max)
{
/* round up to .., 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, .. */
- double newmax= pow(10.0, ceil(log(value)/M_LN10));
+ double newmax = pow(10.0, ceil(log(value) / M_LN10));
- if(newmax*0.2 >= max && newmax*0.2 >= value)
- return newmax*0.2;
- else if(newmax*0.5 >= max && newmax*0.5 >= value)
- return newmax*0.5;
+ if (newmax * 0.2 >= max && newmax * 0.2 >= value)
+ return newmax * 0.2;
+ else if (newmax * 0.5 >= max && newmax * 0.5 >= value)
+ return newmax * 0.5;
else
return newmax;
}
@@ -1863,89 +1866,89 @@ static double soft_range_round_up(double value, double max)
static double soft_range_round_down(double value, double max)
{
/* round down to .., 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, .. */
- double newmax= pow(10.0, floor(log(value)/M_LN10));
+ double newmax = pow(10.0, floor(log(value) / M_LN10));
- if(newmax*5.0 <= max && newmax*5.0 <= value)
- return newmax*5.0;
- else if(newmax*2.0 <= max && newmax*2.0 <= value)
- return newmax*2.0;
+ if (newmax * 5.0 <= max && newmax * 5.0 <= value)
+ return newmax * 5.0;
+ else if (newmax * 2.0 <= max && newmax * 2.0 <= value)
+ return newmax * 2.0;
else
return newmax;
}
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. */
+ * which isn't so bad. */
- if(but->rnaprop) {
- const PropertyType type= RNA_property_type(but->rnaprop);
+ if (but->rnaprop) {
+ const PropertyType type = RNA_property_type(but->rnaprop);
double softmin, softmax /*, step, precision*/;
- double value_min= value;
- double value_max= value;
+ double value_min = value;
+ double value_max = value;
/* clamp button range to something reasonable in case
* we get -inf/inf from RNA properties */
- if(type == PROP_INT) {
+ if (type == PROP_INT) {
int imin, imax, istep;
- const int array_len= RNA_property_array_length(&but->rnapoin, but->rnaprop);
+ const int array_len = RNA_property_array_length(&but->rnapoin, but->rnaprop);
RNA_property_int_ui_range(&but->rnapoin, but->rnaprop, &imin, &imax, &istep);
- softmin= (imin == INT_MIN)? -1e4: imin;
- softmax= (imin == INT_MAX)? 1e4: imax;
+ softmin = (imin == INT_MIN) ? -1e4 : imin;
+ softmax = (imin == INT_MAX) ? 1e4 : imax;
/*step= istep;*/ /*UNUSED*/
/*precision= 1;*/ /*UNUSED*/
- if(array_len >= 2) {
+ if (array_len >= 2) {
int value_range[2];
RNA_property_int_get_array_range(&but->rnapoin, but->rnaprop, value_range);
- value_min= (double)value_range[0];
- value_max= (double)value_range[1];
+ value_min = (double)value_range[0];
+ value_max = (double)value_range[1];
}
}
- else if(type == PROP_FLOAT) {
+ else if (type == PROP_FLOAT) {
float fmin, fmax, fstep, fprecision;
- const int array_len= RNA_property_array_length(&but->rnapoin, but->rnaprop);
+ const int array_len = RNA_property_array_length(&but->rnapoin, but->rnaprop);
RNA_property_float_ui_range(&but->rnapoin, but->rnaprop, &fmin, &fmax, &fstep, &fprecision);
- softmin= (fmin == -FLT_MAX)? (float)-1e4: fmin;
- softmax= (fmax == FLT_MAX)? (float)1e4: fmax;
+ softmin = (fmin == -FLT_MAX) ? (float)-1e4 : fmin;
+ softmax = (fmax == FLT_MAX) ? (float)1e4 : fmax;
/*step= fstep;*/ /*UNUSED*/
/*precision= fprecision;*/ /*UNUSED*/
- if(array_len >= 2) {
+ if (array_len >= 2) {
float value_range[2];
RNA_property_float_get_array_range(&but->rnapoin, but->rnaprop, value_range);
- value_min= (double)value_range[0];
- value_max= (double)value_range[1];
+ value_min = (double)value_range[0];
+ value_max = (double)value_range[1];
}
}
else
return;
/* if the value goes out of the soft/max range, adapt the range */
- if(value_min+1e-10 < softmin) {
- if(value_min < 0.0)
- softmin= -soft_range_round_up(-value_min, -softmin);
+ if (value_min + 1e-10 < softmin) {
+ if (value_min < 0.0)
+ softmin = -soft_range_round_up(-value_min, -softmin);
else
- softmin= soft_range_round_down(value_min, softmin);
+ softmin = soft_range_round_down(value_min, softmin);
- if(softmin < (double)but->hardmin)
- softmin= (double)but->hardmin;
+ if (softmin < (double)but->hardmin)
+ softmin = (double)but->hardmin;
}
- if(value_max-1e-10 > softmax) {
- if(value_max < 0.0)
- softmax= -soft_range_round_down(-value_max, -softmax);
+ if (value_max - 1e-10 > softmax) {
+ if (value_max < 0.0)
+ softmax = -soft_range_round_down(-value_max, -softmax);
else
- softmax= soft_range_round_up(value_max, softmax);
+ softmax = soft_range_round_up(value_max, softmax);
- if(softmax > (double)but->hardmax)
- softmax= but->hardmax;
+ if (softmax > (double)but->hardmax)
+ softmax = but->hardmax;
}
- but->softmin= softmin;
- but->softmax= softmax;
+ but->softmin = softmin;
+ but->softmax = softmax;
}
}
@@ -1953,7 +1956,7 @@ void ui_set_but_soft_range(uiBut *but, double value)
static void ui_free_link(uiLink *link)
{
- if(link) {
+ if (link) {
BLI_freelistN(&link->lines);
MEM_freeN(link);
}
@@ -1962,16 +1965,16 @@ static void ui_free_link(uiLink *link)
/* can be called with C==NULL */
static void ui_free_but(const bContext *C, uiBut *but)
{
- if(but->opptr) {
+ if (but->opptr) {
WM_operator_properties_free(but->opptr);
MEM_freeN(but->opptr);
}
- if(but->func_argN) {
+ if (but->func_argN) {
MEM_freeN(but->func_argN);
}
- if(but->active) {
+ if (but->active) {
/* XXX solve later, buttons should be free-able without context ideally,
* however they may have open tooltips or popup windows, which need to
* be closed using a context pointer */
@@ -1979,7 +1982,7 @@ static void ui_free_but(const bContext *C, uiBut *but)
ui_button_active_free(C, but);
}
else {
- if(but->active) {
+ if (but->active) {
MEM_freeN(but->active);
}
}
@@ -2001,7 +2004,7 @@ void uiFreeBlock(const bContext *C, uiBlock *block)
{
uiBut *but;
- while( (but= block->buttons.first) ) {
+ while ( (but = block->buttons.first) ) {
BLI_remlink(&block->buttons, but);
ui_free_but(C, but);
}
@@ -2026,7 +2029,7 @@ void uiFreeBlocks(const bContext *C, ListBase *lb)
{
uiBlock *block;
- while( (block= lb->first) ) {
+ while ( (block = lb->first) ) {
BLI_remlink(lb, block);
uiFreeBlock(C, block);
}
@@ -2036,40 +2039,40 @@ void uiFreeInactiveBlocks(const bContext *C, ListBase *lb)
{
uiBlock *block, *nextblock;
- for(block=lb->first; block; block=nextblock) {
- nextblock= block->next;
+ for (block = lb->first; block; block = nextblock) {
+ nextblock = block->next;
- if(!block->handle) {
- if(!block->active) {
+ if (!block->handle) {
+ if (!block->active) {
BLI_remlink(lb, block);
uiFreeBlock(C, block);
}
else
- block->active= 0;
+ block->active = 0;
}
}
}
void uiBlockSetRegion(uiBlock *block, ARegion *region)
{
- ListBase *lb= &region->uiblocks;
- uiBlock *oldblock= NULL;
+ ListBase *lb = &region->uiblocks;
+ uiBlock *oldblock = NULL;
/* each listbase only has one block with this name, free block
* if is already there so it can be rebuilt from scratch */
- if(lb) {
- oldblock= BLI_findstring(lb, block->name, offsetof(uiBlock, name));
+ if (lb) {
+ oldblock = BLI_findstring(lb, block->name, offsetof(uiBlock, name));
if (oldblock) {
- oldblock->active= 0;
- oldblock->panel= NULL;
+ oldblock->active = 0;
+ oldblock->panel = NULL;
}
/* at the beginning of the list! for dynamical menus/blocks */
BLI_addhead(lb, block);
}
- block->oldblock= oldblock;
+ block->oldblock = oldblock;
}
uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, short dt)
@@ -2079,35 +2082,35 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor
Scene *scn;
int getsizex, getsizey;
- window= CTX_wm_window(C);
+ window = CTX_wm_window(C);
scn = CTX_data_scene(C);
- block= MEM_callocN(sizeof(uiBlock), "uiBlock");
- block->active= 1;
- block->dt= dt;
- block->evil_C= (void*)C; // XXX
+ block = MEM_callocN(sizeof(uiBlock), "uiBlock");
+ block->active = 1;
+ block->dt = dt;
+ block->evil_C = (void *)C; // XXX
if (scn) {
- block->color_profile= (scn->r.color_mgt_flag & R_COLOR_MANAGEMENT);
+ block->color_profile = (scn->r.color_mgt_flag & R_COLOR_MANAGEMENT);
/* copy to avoid crash when scene gets deleted with ui still open */
- block->unit= MEM_mallocN(sizeof(scn->unit), "UI UnitSettings");
+ block->unit = MEM_mallocN(sizeof(scn->unit), "UI UnitSettings");
memcpy(block->unit, &scn->unit, sizeof(scn->unit));
}
BLI_strncpy(block->name, name, sizeof(block->name));
- if(region)
+ if (region)
uiBlockSetRegion(block, region);
/* window matrix and aspect */
- if(region && region->swinid) {
+ if (region && region->swinid) {
wm_subwindow_getmatrix(window, region->swinid, block->winmat);
wm_subwindow_getsize(window, region->swinid, &getsizex, &getsizey);
/* TODO - investigate why block->winmat[0][0] is negative
* in the image view when viewRedrawForce is called */
- block->aspect= 2.0/fabs( (getsizex)*block->winmat[0][0]);
+ block->aspect = 2.0 / fabs( (getsizex) * block->winmat[0][0]);
}
else {
/* no subwindow created yet, for menus for example, so we
@@ -2116,8 +2119,8 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor
wm_subwindow_getmatrix(window, window->screen->mainwin, block->winmat);
wm_subwindow_getsize(window, window->screen->mainwin, &getsizex, &getsizey);
- block->aspect= 2.0/fabs(getsizex*block->winmat[0][0]);
- block->auto_open= TRUE;
+ block->aspect = 2.0 / fabs(getsizex * block->winmat[0][0]);
+ block->auto_open = TRUE;
block->flag |= UI_BLOCK_LOOP; /* tag as menu */
}
@@ -2131,63 +2134,63 @@ uiBlock *uiGetBlock(const char *name, ARegion *ar)
void uiBlockSetEmboss(uiBlock *block, char dt)
{
- block->dt= dt;
+ block->dt = dt;
}
void ui_check_but(uiBut *but)
{
/* if something changed in the button */
- double value= UI_BUT_VALUE_UNSET;
+ double value = UI_BUT_VALUE_UNSET;
// float okwidth; // UNUSED
ui_is_but_sel(but, &value);
/* only update soft range while not editing */
- if(but->rnaprop && !(but->editval || but->editstr || but->editvec)) {
+ if (but->rnaprop && !(but->editval || but->editstr || but->editvec)) {
UI_GET_BUT_VALUE_INIT(but, value)
ui_set_but_soft_range(but, value);
}
/* test for min and max, icon sliders, etc */
- switch( but->type ) {
+ switch (but->type) {
case NUM:
case SLI:
case SCROLL:
case NUMSLI:
case HSVSLI:
UI_GET_BUT_VALUE_INIT(but, value)
- if(value < (double)but->hardmin) ui_set_but_val(but, but->hardmin);
- else if(value > (double)but->hardmax) ui_set_but_val(but, but->hardmax);
+ if (value < (double)but->hardmin) ui_set_but_val(but, but->hardmin);
+ else if (value > (double)but->hardmax) ui_set_but_val(but, but->hardmax);
break;
case NUMABS:
{
double value_abs;
UI_GET_BUT_VALUE_INIT(but, value)
- value_abs= fabs(value);
- if(value_abs < (double)but->hardmin) ui_set_but_val(but, but->hardmin);
- else if(value_abs > (double)but->hardmax) ui_set_but_val(but, but->hardmax);
+ value_abs = fabs(value);
+ if (value_abs < (double)but->hardmin) ui_set_but_val(but, but->hardmin);
+ else if (value_abs > (double)but->hardmax) ui_set_but_val(but, but->hardmax);
break;
}
case ICONTOG:
case ICONTOGN:
- if(!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) {
- if(but->flag & UI_SELECT) but->iconadd= 1;
- else but->iconadd= 0;
+ if (!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) {
+ if (but->flag & UI_SELECT) but->iconadd = 1;
+ else but->iconadd = 0;
}
break;
case ICONROW:
- if(!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) {
+ if (!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) {
UI_GET_BUT_VALUE_INIT(but, value)
- but->iconadd= (int)value- (int)(but->hardmin);
+ but->iconadd = (int)value - (int)(but->hardmin);
}
break;
case ICONTEXTROW:
- if(!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) {
+ if (!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) {
UI_GET_BUT_VALUE_INIT(but, value)
- but->iconadd= (int)value- (int)(but->hardmin);
+ but->iconadd = (int)value - (int)(but->hardmin);
}
break;
}
@@ -2197,130 +2200,130 @@ void ui_check_but(uiBut *but)
// okwidth= -4 + (but->x2 - but->x1); // UNUSED
/* name: */
- switch( but->type ) {
+ switch (but->type) {
- case MENU:
- case ICONTEXTROW:
+ case MENU:
+ case ICONTEXTROW:
- if(but->x2 - but->x1 > 24) {
- UI_GET_BUT_VALUE_INIT(but, value)
- ui_set_name_menu(but, (int)value);
- }
- break;
+ if (but->x2 - but->x1 > 24) {
+ UI_GET_BUT_VALUE_INIT(but, value)
+ ui_set_name_menu(but, (int)value);
+ }
+ break;
- case NUM:
- case NUMSLI:
- case HSVSLI:
- case NUMABS:
+ case NUM:
+ case NUMSLI:
+ case HSVSLI:
+ case NUMABS:
- UI_GET_BUT_VALUE_INIT(but, value)
+ UI_GET_BUT_VALUE_INIT(but, value)
- if(ui_is_but_float(but)) {
- if(value == (double) FLT_MAX) BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%sinf", but->str);
- else if(value == (double) -FLT_MAX) BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s-inf", but->str);
- /* support length type buttons */
- else if(ui_is_but_unit(but)) {
- char new_str[sizeof(but->drawstr)];
- ui_get_but_string_unit(but, new_str, sizeof(new_str), value, TRUE);
- BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%s", but->str, new_str);
+ if (ui_is_but_float(but)) {
+ if (value == (double) FLT_MAX) BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%sinf", but->str);
+ else if (value == (double) -FLT_MAX) BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s-inf", but->str);
+ /* support length type buttons */
+ else if (ui_is_but_unit(but)) {
+ char new_str[sizeof(but->drawstr)];
+ ui_get_but_string_unit(but, new_str, sizeof(new_str), value, TRUE);
+ BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%s", but->str, new_str);
+ }
+ else {
+ const int prec = ui_but_float_precision(but, value);
+ BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%.*f", but->str, prec, value);
+ }
}
else {
- const int prec= ui_but_float_precision(but, value);
- BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%.*f", but->str, prec, value);
+ BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%d", but->str, (int)value);
}
- }
- else {
- BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%d", but->str, (int)value);
- }
- if(but->rnaprop) {
- PropertySubType pstype = RNA_property_subtype(but->rnaprop);
+ if (but->rnaprop) {
+ PropertySubType pstype = RNA_property_subtype(but->rnaprop);
- if (pstype == PROP_PERCENTAGE)
- strcat(but->drawstr, "%");
- }
- break;
+ if (pstype == PROP_PERCENTAGE)
+ strcat(but->drawstr, "%");
+ }
+ break;
- case LABEL:
- if(ui_is_but_float(but)) {
- int prec;
- UI_GET_BUT_VALUE_INIT(but, value)
- prec= ui_but_float_precision(but, value);
- BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%.*f", but->str, prec, value);
- }
- else {
- BLI_strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
- }
+ case LABEL:
+ if (ui_is_but_float(but)) {
+ int prec;
+ UI_GET_BUT_VALUE_INIT(but, value)
+ prec = ui_but_float_precision(but, value);
+ BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%.*f", but->str, prec, value);
+ }
+ else {
+ BLI_strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
+ }
- break;
+ break;
- case IDPOIN:
- case TEX:
- case SEARCH_MENU:
- if(!but->editstr) {
- char str[UI_MAX_DRAW_STR];
+ case IDPOIN:
+ case TEX:
+ case SEARCH_MENU:
+ if (!but->editstr) {
+ char str[UI_MAX_DRAW_STR];
- ui_get_but_string(but, str, UI_MAX_DRAW_STR-strlen(but->str));
+ ui_get_but_string(but, str, UI_MAX_DRAW_STR - strlen(but->str));
- BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%s", but->str, str);
- }
- break;
+ BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%s", but->str, str);
+ }
+ break;
- case KEYEVT:
- BLI_strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
- if (but->flag & UI_SELECT) {
- strcat(but->drawstr, "Press a key");
- }
- else {
- UI_GET_BUT_VALUE_INIT(but, value)
- strcat(but->drawstr, WM_key_event_string((short)value));
- }
- break;
+ case KEYEVT:
+ BLI_strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
+ if (but->flag & UI_SELECT) {
+ strcat(but->drawstr, "Press a key");
+ }
+ else {
+ UI_GET_BUT_VALUE_INIT(but, value)
+ strcat(but->drawstr, WM_key_event_string((short)value));
+ }
+ break;
- case HOTKEYEVT:
- if (but->flag & UI_SELECT) {
- but->drawstr[0]= '\0';
-
- if(but->modifier_key) {
- char *str= but->drawstr;
-
- if(but->modifier_key & KM_SHIFT)
- str= strcat(str, "Shift ");
- if(but->modifier_key & KM_CTRL)
- str= strcat(str, "Ctrl ");
- if(but->modifier_key & KM_ALT)
- str= strcat(str, "Alt ");
- if(but->modifier_key & KM_OSKEY)
- str= strcat(str, "Cmd ");
-
- (void)str; /* UNUSED */
+ case HOTKEYEVT:
+ if (but->flag & UI_SELECT) {
+ but->drawstr[0] = '\0';
+
+ if (but->modifier_key) {
+ char *str = but->drawstr;
+
+ if (but->modifier_key & KM_SHIFT)
+ str = strcat(str, "Shift ");
+ if (but->modifier_key & KM_CTRL)
+ str = strcat(str, "Ctrl ");
+ if (but->modifier_key & KM_ALT)
+ str = strcat(str, "Alt ");
+ if (but->modifier_key & KM_OSKEY)
+ str = strcat(str, "Cmd ");
+
+ (void)str; /* UNUSED */
+ }
+ else
+ strcat(but->drawstr, "Press a key ");
}
else
- strcat(but->drawstr, "Press a key ");
- }
- else
- BLI_strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
+ BLI_strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
+
+ break;
- break;
+ case BUT_TOGDUAL:
+ /* trying to get the dual-icon to left of text... not very nice */
+ if (but->str[0]) {
+ BLI_strncpy(but->drawstr, " ", UI_MAX_DRAW_STR);
+ BLI_strncpy(but->drawstr + 2, but->str, UI_MAX_DRAW_STR - 2);
+ }
+ break;
- case BUT_TOGDUAL:
- /* trying to get the dual-icon to left of text... not very nice */
- if(but->str[0]) {
- BLI_strncpy(but->drawstr, " ", UI_MAX_DRAW_STR);
- BLI_strncpy(but->drawstr+2, but->str, UI_MAX_DRAW_STR-2);
- }
- break;
-
- case HSVCUBE:
- case HSVCIRCLE:
- break;
- default:
- BLI_strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
+ case HSVCUBE:
+ case HSVCIRCLE:
+ break;
+ default:
+ BLI_strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
}
/* if we are doing text editing, this will override the drawstr */
- if(but->editstr)
+ if (but->editstr)
BLI_strncpy(but->drawstr, but->editstr, UI_MAX_DRAW_STR);
/* text clipping moved to widget drawing code itself */
@@ -2330,7 +2333,7 @@ void ui_check_but(uiBut *but)
void uiBlockBeginAlign(uiBlock *block)
{
/* if other align was active, end it */
- if(block->flag & UI_BUT_ALIGN) uiBlockEndAlign(block);
+ if (block->flag & UI_BUT_ALIGN) uiBlockEndAlign(block);
block->flag |= UI_BUT_ALIGN_DOWN;
block->alignnr++;
@@ -2342,16 +2345,16 @@ static int buts_are_horiz(uiBut *but1, uiBut *but2)
{
float dx, dy;
- dx= fabs( but1->x2 - but2->x1);
- dy= fabs( but1->y1 - but2->y2);
+ dx = fabs(but1->x2 - but2->x1);
+ dy = fabs(but1->y1 - but2->y2);
- if(dx > dy) return 0;
+ if (dx > dy) return 0;
return 1;
}
void uiBlockEndAlign(uiBlock *block)
{
- block->flag &= ~UI_BUT_ALIGN; // all 4 flags
+ block->flag &= ~UI_BUT_ALIGN; // all 4 flags
}
int ui_but_can_align(uiBut *but)
@@ -2361,90 +2364,90 @@ int ui_but_can_align(uiBut *but)
static void ui_block_do_align_but(uiBut *first, short nr)
{
- uiBut *prev, *but=NULL, *next;
- int flag= 0, cols=0, rows=0;
+ uiBut *prev, *but = NULL, *next;
+ int flag = 0, cols = 0, rows = 0;
/* auto align */
- for(but=first; but && but->alignnr == nr; but=but->next) {
- if(but->next && but->next->alignnr == nr) {
- if(buts_are_horiz(but, but->next)) cols++;
+ for (but = first; but && but->alignnr == nr; but = but->next) {
+ if (but->next && but->next->alignnr == nr) {
+ if (buts_are_horiz(but, but->next)) cols++;
else rows++;
}
}
- /* 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) {
- next= but->next;
- if(next && next->alignnr != nr)
- next= NULL;
+ for (but = first, prev = NULL; but && but->alignnr == nr; prev = but, but = but->next) {
+ next = but->next;
+ if (next && next->alignnr != nr)
+ next = NULL;
/* clear old flag */
but->flag &= ~UI_BUT_ALIGN;
- if(flag==0) { /* first case */
- if(next) {
- if(buts_are_horiz(but, next)) {
- if(rows==0)
- flag= UI_BUT_ALIGN_RIGHT;
+ if (flag == 0) { /* first case */
+ if (next) {
+ if (buts_are_horiz(but, next)) {
+ if (rows == 0)
+ flag = UI_BUT_ALIGN_RIGHT;
else
- flag= UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_RIGHT;
+ flag = UI_BUT_ALIGN_DOWN | UI_BUT_ALIGN_RIGHT;
}
else {
- flag= UI_BUT_ALIGN_DOWN;
+ flag = UI_BUT_ALIGN_DOWN;
}
}
}
- else if(next==NULL) { /* last case */
- if(prev) {
- if(buts_are_horiz(prev, but)) {
- if(rows==0)
- flag= UI_BUT_ALIGN_LEFT;
+ else if (next == NULL) { /* last case */
+ if (prev) {
+ if (buts_are_horiz(prev, but)) {
+ if (rows == 0)
+ flag = UI_BUT_ALIGN_LEFT;
else
- flag= UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_LEFT;
+ flag = UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_LEFT;
}
- else flag= UI_BUT_ALIGN_TOP;
+ else flag = UI_BUT_ALIGN_TOP;
}
}
- else if(buts_are_horiz(but, next)) {
+ else if (buts_are_horiz(but, next)) {
/* check if this is already second row */
- if( prev && buts_are_horiz(prev, but)==0) {
+ if (prev && buts_are_horiz(prev, but) == 0) {
flag &= ~UI_BUT_ALIGN_LEFT;
flag |= UI_BUT_ALIGN_TOP;
/* exception case: bottom row */
- if(rows>0) {
- uiBut *bt= but;
- while(bt && bt->alignnr == nr) {
- if(bt->next && bt->next->alignnr == nr && buts_are_horiz(bt, bt->next)==0 ) break;
- bt= bt->next;
+ if (rows > 0) {
+ uiBut *bt = but;
+ while (bt && bt->alignnr == nr) {
+ if (bt->next && bt->next->alignnr == nr && buts_are_horiz(bt, bt->next) == 0) break;
+ bt = bt->next;
}
- if(bt==NULL || bt->alignnr != nr) flag= UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_RIGHT;
+ if (bt == NULL || bt->alignnr != nr) flag = UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_RIGHT;
}
}
else flag |= UI_BUT_ALIGN_LEFT;
}
else {
- if(cols==0) {
+ if (cols == 0) {
flag |= UI_BUT_ALIGN_TOP;
}
- else { /* next button switches to new row */
+ else { /* next button switches to new row */
- if(prev && buts_are_horiz(prev, but))
+ if (prev && buts_are_horiz(prev, but))
flag |= UI_BUT_ALIGN_LEFT;
else {
flag &= ~UI_BUT_ALIGN_LEFT;
flag |= UI_BUT_ALIGN_TOP;
}
- if( (flag & UI_BUT_ALIGN_TOP)==0) { /* stil top row */
- if(prev) {
- if(next && buts_are_horiz(but, next))
- flag = UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT|UI_BUT_ALIGN_RIGHT;
+ if ( (flag & UI_BUT_ALIGN_TOP) == 0) { /* stil top row */
+ if (prev) {
+ if (next && buts_are_horiz(but, next))
+ flag = UI_BUT_ALIGN_DOWN | UI_BUT_ALIGN_LEFT | UI_BUT_ALIGN_RIGHT;
else {
/* last button in top row */
- flag = UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT;
+ flag = UI_BUT_ALIGN_DOWN | UI_BUT_ALIGN_LEFT;
}
}
else
@@ -2458,35 +2461,35 @@ static void ui_block_do_align_but(uiBut *first, short nr)
but->flag |= flag;
/* merge coordinates */
- if(prev) {
+ if (prev) {
// simple cases
- if(rows==0) {
- but->x1= (prev->x2+but->x1)/2.0f;
- prev->x2= but->x1;
+ if (rows == 0) {
+ but->x1 = (prev->x2 + but->x1) / 2.0f;
+ prev->x2 = but->x1;
}
- else if(cols==0) {
- but->y2= (prev->y1+but->y2)/2.0f;
- prev->y1= but->y2;
+ else if (cols == 0) {
+ but->y2 = (prev->y1 + but->y2) / 2.0f;
+ prev->y1 = but->y2;
}
else {
- if(buts_are_horiz(prev, but)) {
- but->x1= (prev->x2+but->x1)/2.0f;
- prev->x2= but->x1;
+ if (buts_are_horiz(prev, but)) {
+ but->x1 = (prev->x2 + but->x1) / 2.0f;
+ prev->x2 = but->x1;
/* copy height too */
- but->y2= prev->y2;
+ but->y2 = prev->y2;
}
- else if(prev->prev && buts_are_horiz(prev->prev, prev)==0) {
+ else if (prev->prev && buts_are_horiz(prev->prev, prev) == 0) {
/* the previous button is a single one in its row */
- but->y2= (prev->y1+but->y2)/2.0f;
- prev->y1= but->y2;
+ but->y2 = (prev->y1 + but->y2) / 2.0f;
+ prev->y1 = but->y2;
- but->x1= prev->x1;
- if(next && buts_are_horiz(but, next)==0)
- but->x2= prev->x2;
+ but->x1 = prev->x1;
+ if (next && buts_are_horiz(but, next) == 0)
+ but->x2 = prev->x2;
}
else {
/* the previous button is not a single one in its row */
- but->y2= prev->y1;
+ but->y2 = prev->y1;
}
}
}
@@ -2499,105 +2502,105 @@ void ui_block_do_align(uiBlock *block)
short nr;
/* align buttons with same align nr */
- for(but=block->buttons.first; but;) {
- if(but->alignnr) {
- nr= but->alignnr;
+ for (but = block->buttons.first; but; ) {
+ if (but->alignnr) {
+ nr = but->alignnr;
ui_block_do_align_but(but, nr);
/* skip with same number */
- for(; but && but->alignnr == nr; but=but->next);
+ for (; but && but->alignnr == nr; but = but->next) ;
- if(!but)
+ if (!but)
break;
}
else
- but= but->next;
+ but = but->next;
}
}
-/*
- * 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)
{
uiBut *but;
int slen;
- if(type & BUTPOIN) { /* a pointer is required */
- if(poin==NULL)
+ if (type & BUTPOIN) { /* a pointer is required */
+ if (poin == NULL)
return NULL;
}
- but= MEM_callocN(sizeof(uiBut), "uiBut");
+ but = MEM_callocN(sizeof(uiBut), "uiBut");
- but->type= type & BUTTYPE;
- but->pointype= type & BUTPOIN;
- but->bit= type & BIT;
- but->bitnr= type & 31;
+ but->type = type & BUTTYPE;
+ but->pointype = type & BUTPOIN;
+ but->bit = type & BIT;
+ but->bitnr = type & 31;
but->icon = ICON_NONE;
- but->iconadd=0;
+ but->iconadd = 0;
- but->retval= retval;
+ but->retval = retval;
- slen= strlen(str);
- if(slen >= UI_MAX_NAME_STR-1) {
- but->str= MEM_mallocN(slen+2, "ui_def_but str"); /* why +2 ? */
+ slen = strlen(str);
+ if (slen >= UI_MAX_NAME_STR - 1) {
+ but->str = MEM_mallocN(slen + 2, "ui_def_but str"); /* why +2 ? */
}
else {
- but->str= but->strdata;
+ but->str = but->strdata;
}
- memcpy(but->str, str, slen+1);
+ memcpy(but->str, str, slen + 1);
- but->x1= x1;
- but->y1= y1;
- but->x2= (x1+x2);
- but->y2= (y1+y2);
-
- but->poin= poin;
- but->hardmin= but->softmin= min;
- but->hardmax= but->softmax= max;
- but->a1= a1;
- but->a2= a2;
- but->tip= tip;
-
- but->lock= block->lock;
- but->lockstr= block->lockstr;
- but->dt= block->dt;
+ but->x1 = x1;
+ but->y1 = y1;
+ but->x2 = (x1 + x2);
+ but->y2 = (y1 + y2);
- but->aspect= 1.0f; //XXX block->aspect;
- but->block= block; // pointer back, used for frontbuffer status, and picker
+ but->poin = poin;
+ but->hardmin = but->softmin = min;
+ but->hardmax = but->softmax = max;
+ but->a1 = a1;
+ but->a2 = a2;
+ but->tip = tip;
- if((block->flag & UI_BUT_ALIGN) && ui_but_can_align(but))
- but->alignnr= block->alignnr;
+ but->lock = block->lock;
+ but->lockstr = block->lockstr;
+ but->dt = block->dt;
- but->func= block->func;
- but->func_arg1= block->func_arg1;
- but->func_arg2= block->func_arg2;
+ but->aspect = 1.0f; //XXX block->aspect;
+ but->block = block; // pointer back, used for frontbuffer status, and picker
- but->funcN= block->funcN;
- if(block->func_argN)
- but->func_argN= MEM_dupallocN(block->func_argN);
+ if ((block->flag & UI_BUT_ALIGN) && ui_but_can_align(but))
+ but->alignnr = block->alignnr;
+
+ but->func = block->func;
+ but->func_arg1 = block->func_arg1;
+ but->func_arg2 = block->func_arg2;
+
+ but->funcN = block->funcN;
+ if (block->func_argN)
+ but->func_argN = MEM_dupallocN(block->func_argN);
- but->pos= -1; /* cursor invisible */
+ but->pos = -1; /* cursor invisible */
- if(ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI)) { /* add a space to name */
+ if (ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI)) { /* add a space to name */
/* slen remains unchanged from previous assignment, ensure this stays true */
- if(slen>0 && slen<UI_MAX_NAME_STR-2) {
- if(but->str[slen-1]!=' ') {
- but->str[slen]= ' ';
- but->str[slen+1]= 0;
+ if (slen > 0 && slen < UI_MAX_NAME_STR - 2) {
+ if (but->str[slen - 1] != ' ') {
+ but->str[slen] = ' ';
+ but->str[slen + 1] = 0;
}
}
}
- if((block->flag & UI_BLOCK_LOOP) || ELEM8(but->type, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM, SEARCH_MENU, PROGRESSBAR))
- but->flag |= (UI_TEXT_LEFT|UI_ICON_LEFT);
- else if(but->type==BUT_TOGDUAL)
+ if ((block->flag & UI_BLOCK_LOOP) || ELEM8(but->type, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM, SEARCH_MENU, PROGRESSBAR))
+ but->flag |= (UI_TEXT_LEFT | UI_ICON_LEFT);
+ else if (but->type == BUT_TOGDUAL)
but->flag |= UI_ICON_LEFT;
but->flag |= (block->flag & UI_BUT_ALIGN);
@@ -2609,14 +2612,14 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
}
/* keep track of UI_interface.h */
- if(ELEM7(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX, BUTM));
- else if(ELEM3(but->type, SCROLL, SEPR, FTPREVIEW));
- else if(but->type >= SEARCH_MENU);
+ if (ELEM7(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX, BUTM)) ;
+ else if (ELEM3(but->type, SCROLL, SEPR, FTPREVIEW)) ;
+ else if (but->type >= SEARCH_MENU) ;
else but->flag |= UI_BUT_UNDO;
BLI_addtail(&block->buttons, but);
- if(block->curlayout)
+ if (block->curlayout)
ui_layout_add_but(block->curlayout, but);
#ifdef WITH_PYTHON
@@ -2638,62 +2641,62 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
*/
#define UI_DEF_BUT_RNA_DISABLE(but) \
- but->flag |= UI_BUT_DISABLED; \
- but->lock = 1; \
- but->lockstr = ""
+ but->flag |= UI_BUT_DISABLED; \
+ but->lock = 1; \
+ but->lockstr = ""
static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, float a1, float a2, const char *tip)
{
- const PropertyType proptype= RNA_property_type(prop);
+ const PropertyType proptype = RNA_property_type(prop);
uiBut *but;
- int freestr= 0, icon= 0;
+ int freestr = 0, icon = 0;
/* use rna values if parameters are not specified */
- if(!str) {
- if(type == MENU && proptype == PROP_ENUM) {
+ if (!str) {
+ if (type == MENU && proptype == PROP_ENUM) {
EnumPropertyItem *item;
DynStr *dynstr;
int i, totitem, value, free;
RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free);
- value= RNA_property_enum_get(ptr, prop);
+ value = RNA_property_enum_get(ptr, prop);
- dynstr= BLI_dynstr_new();
+ dynstr = BLI_dynstr_new();
BLI_dynstr_appendf(dynstr, "%s%%t", RNA_property_ui_name(prop));
- for(i=0; i<totitem; i++) {
- if(!item[i].identifier[0]) {
- if(item[i].name)
+ for (i = 0; i < totitem; i++) {
+ if (!item[i].identifier[0]) {
+ if (item[i].name)
BLI_dynstr_appendf(dynstr, "|%s%%l", item[i].name);
else
BLI_dynstr_append(dynstr, "|%l");
}
- else if(item[i].icon)
+ else if (item[i].icon)
BLI_dynstr_appendf(dynstr, "|%s %%i%d %%x%d", item[i].name, item[i].icon, item[i].value);
else
BLI_dynstr_appendf(dynstr, "|%s %%x%d", item[i].name, item[i].value);
- if(value == item[i].value)
- icon= item[i].icon;
+ if (value == item[i].value)
+ icon = item[i].icon;
}
- str= BLI_dynstr_get_cstring(dynstr);
+ str = BLI_dynstr_get_cstring(dynstr);
BLI_dynstr_free(dynstr);
if (free) {
MEM_freeN(item);
}
- freestr= 1;
+ freestr = 1;
}
- else if(ELEM(type, ROW, LISTROW) && proptype == PROP_ENUM) {
+ else if (ELEM(type, ROW, LISTROW) && proptype == PROP_ENUM) {
EnumPropertyItem *item;
int i, totitem, free;
RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free);
- for(i=0; i<totitem; i++) {
- if(item[i].identifier[0] && item[i].value == (int)max) {
- str= item[i].name;
- icon= item[i].icon;
+ for (i = 0; i < totitem; i++) {
+ if (item[i].identifier[0] && item[i].value == (int)max) {
+ str = item[i].name;
+ icon = item[i].icon;
}
}
@@ -2705,68 +2708,68 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
}
}
else {
- str= RNA_property_ui_name(prop);
- icon= RNA_property_ui_icon(prop);
+ str = RNA_property_ui_name(prop);
+ icon = RNA_property_ui_icon(prop);
}
}
- if(!tip && proptype != PROP_ENUM)
- tip= RNA_property_ui_description(prop);
+ if (!tip && proptype != PROP_ENUM)
+ tip = RNA_property_ui_description(prop);
- if(min == max || a1 == -1 || a2 == -1) {
- if(proptype == PROP_INT) {
+ if (min == max || a1 == -1 || a2 == -1) {
+ if (proptype == PROP_INT) {
int hardmin, hardmax, softmin, softmax, step;
RNA_property_int_range(ptr, prop, &hardmin, &hardmax);
RNA_property_int_ui_range(ptr, prop, &softmin, &softmax, &step);
- if(!ELEM(type, ROW, LISTROW) && min == max) {
- min= hardmin;
- max= hardmax;
+ if (!ELEM(type, ROW, LISTROW) && min == max) {
+ min = hardmin;
+ max = hardmax;
}
- if(a1 == -1)
- a1= step;
- if(a2 == -1)
- a2= 0;
+ if (a1 == -1)
+ a1 = step;
+ if (a2 == -1)
+ a2 = 0;
}
- else if(proptype == PROP_FLOAT) {
+ else if (proptype == PROP_FLOAT) {
float hardmin, hardmax, softmin, softmax, step, precision;
RNA_property_float_range(ptr, prop, &hardmin, &hardmax);
RNA_property_float_ui_range(ptr, prop, &softmin, &softmax, &step, &precision);
- if(!ELEM(type, ROW, LISTROW) && min == max) {
- min= hardmin;
- max= hardmax;
+ if (!ELEM(type, ROW, LISTROW) && min == max) {
+ min = hardmin;
+ max = hardmax;
}
- if(a1 == -1)
- a1= step;
- if(a2 == -1)
- a2= precision;
+ if (a1 == -1)
+ a1 = step;
+ if (a2 == -1)
+ a2 = precision;
}
- else if(proptype == PROP_STRING) {
- min= 0;
- max= RNA_property_string_maxlength(prop);
- if(max == 0) /* interface code should ideally support unlimited length */
- max= UI_MAX_DRAW_STR;
+ else if (proptype == PROP_STRING) {
+ min = 0;
+ max = RNA_property_string_maxlength(prop);
+ if (max == 0) /* interface code should ideally support unlimited length */
+ max = UI_MAX_DRAW_STR;
}
}
/* now create button */
- but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, NULL, min, max, a1, a2, tip);
+ but = ui_def_but(block, type, retval, str, x1, y1, x2, y2, NULL, min, max, a1, a2, tip);
- but->rnapoin= *ptr;
- but->rnaprop= prop;
+ but->rnapoin = *ptr;
+ but->rnaprop = prop;
- if(RNA_property_array_length(&but->rnapoin, but->rnaprop))
- but->rnaindex= index;
+ if (RNA_property_array_length(&but->rnapoin, but->rnaprop))
+ but->rnaindex = index;
else
- but->rnaindex= 0;
+ but->rnaindex = 0;
- if(icon) {
- but->icon= (BIFIconID)icon;
+ if (icon) {
+ but->icon = (BIFIconID)icon;
but->flag |= UI_HAS_ICON;
- but->flag|= UI_ICON_LEFT;
+ but->flag |= UI_ICON_LEFT;
}
if (!RNA_property_editable(&but->rnapoin, prop)) {
@@ -2778,8 +2781,8 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
}
/* If this button uses units, calculate the step from this */
- if((proptype == PROP_FLOAT) && ui_is_but_unit(but)) {
- but->a1= ui_get_but_step_unit(but, but->a1);
+ if ((proptype == PROP_FLOAT) && ui_is_but_unit(but)) {
+ but->a1 = ui_get_but_step_unit(but, but->a1);
}
if (freestr) {
@@ -2791,14 +2794,14 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
static uiBut *ui_def_but_rna_propname(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
uiBut *but;
- if(prop) {
- but= ui_def_but_rna(block, type, retval, str, x1, y1, x2, y2, ptr, prop, index, min, max, a1, a2, tip);
+ if (prop) {
+ but = ui_def_but_rna(block, type, retval, str, x1, y1, x2, y2, ptr, prop, index, min, max, a1, a2, tip);
}
else {
- but= ui_def_but(block, type, retval, propname, x1, y1, x2, y2, NULL, min, max, a1, a2, tip);
+ but = ui_def_but(block, type, retval, propname, x1, y1, x2, y2, NULL, min, max, a1, a2, tip);
UI_DEF_BUT_RNA_DISABLE(but);
}
@@ -2810,22 +2813,23 @@ static uiBut *ui_def_but_operator_ptr(uiBlock *block, int type, wmOperatorType *
{
uiBut *but;
- if(!str) {
- if(ot) str = ot->name;
+ if (!str) {
+ if (ot && ot->srna)
+ str = RNA_struct_ui_name(ot->srna);
+ else
+ str = "";
}
-
- if ((!tip || tip[0]=='\0') && ot && ot->description) {
- tip= ot->description;
- tip = TIP_(tip);
+ if ((!tip || tip[0] == '\0') && ot && ot->srna) {
+ tip = RNA_struct_ui_description(ot->srna);
}
- but= ui_def_but(block, type, -1, str, x1, y1, x2, y2, NULL, 0, 0, 0, 0, tip);
- but->optype= ot;
- but->opcontext= opcontext;
+ but = ui_def_but(block, type, -1, str, x1, y1, x2, y2, NULL, 0, 0, 0, 0, tip);
+ but->optype = ot;
+ but->opcontext = opcontext;
but->flag &= ~UI_BUT_UNDO; /* no need for ui_but_is_undo(), we never need undo here */
- if(!ot) {
+ if (!ot) {
but->flag |= UI_BUT_DISABLED;
but->lock = 1;
but->lockstr = "";
@@ -2833,35 +2837,38 @@ static uiBut *ui_def_but_operator_ptr(uiBlock *block, int type, wmOperatorType *
return but;
}
-static uiBut *UNUSED_FUNCTION(ui_def_but_operator)(uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x1, int y1, short x2, short y2, const char *tip)
+
+#if 0 /* UNUSED */
+static uiBut *UNUSED_FUNCTION(ui_def_but_operator) (uiBlock * block, int type, const char *opname, int opcontext, const char *str, int x1, int y1, short x2, short y2, const char *tip)
{
wmOperatorType *ot = WM_operatortype_find(opname, 0);
if (str == NULL && ot == NULL) str = opname;
return ui_def_but_operator_ptr(block, type, ot, opcontext, str, x1, y1, x2, y2, tip);
}
+#endif
static uiBut *ui_def_but_operator_text(uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x1, int y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip)
{
uiBut *but;
wmOperatorType *ot;
- ot= WM_operatortype_find(opname, 0);
+ ot = WM_operatortype_find(opname, 0);
- if(!str) {
- if(ot) str= ot->name;
- else str= opname;
+ if (!str) {
+ if (ot) str = ot->name;
+ else str = opname;
}
- if ((!tip || tip[0]=='\0') && ot && ot->description) {
- tip= ot->description;
+ if ((!tip || tip[0] == '\0') && ot && ot->description) {
+ tip = ot->description;
}
- but= ui_def_but(block, type, -1, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
- but->optype= ot;
- but->opcontext= opcontext;
+ but = ui_def_but(block, type, -1, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
+ but->optype = ot;
+ but->opcontext = opcontext;
but->flag &= ~UI_BUT_UNDO; /* no need for ui_but_is_undo(), we never need undo here */
- if(!ot) {
+ if (!ot) {
but->flag |= UI_BUT_DISABLED;
but->lock = 1;
but->lockstr = "";
@@ -2872,29 +2879,30 @@ static uiBut *ui_def_but_operator_text(uiBlock *block, int type, const char *opn
uiBut *uiDefBut(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip)
{
- uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
+ uiBut *but = ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
ui_check_but(but);
return but;
}
- /* if _x_ is a power of two (only one bit) return the power,
- * otherwise return -1.
- * (1<<findBitIndex(x))==x for powers of two.
- */
+/* if _x_ is a power of two (only one bit) return the power,
+ * otherwise return -1.
+ * (1<<findBitIndex(x))==x for powers of two.
+ */
static int findBitIndex(unsigned int x)
{
if (!x || !is_power_of_2_i(x)) { /* is_power_of_2_i(x) strips lowest bit */
return -1;
- } else {
- int idx= 0;
+ }
+ else {
+ int idx = 0;
- if (x&0xFFFF0000) idx+=16, x>>=16;
- if (x&0xFF00) idx+=8, x>>=8;
- if (x&0xF0) idx+=4, x>>=4;
- if (x&0xC) idx+=2, x>>=2;
- if (x&0x2) idx+=1;
+ if (x & 0xFFFF0000) idx += 16, x >>= 16;
+ if (x & 0xFF00) idx += 8, x >>= 8;
+ if (x & 0xF0) idx += 4, x >>= 4;
+ if (x & 0xC) idx += 2, x >>= 2;
+ if (x & 0x2) idx += 1;
return idx;
}
@@ -2911,38 +2919,38 @@ AutoComplete *autocomplete_begin(const char *startname, size_t maxlen)
{
AutoComplete *autocpl;
- autocpl= MEM_callocN(sizeof(AutoComplete), "AutoComplete");
- autocpl->maxlen= maxlen;
- autocpl->truncate= MEM_callocN(sizeof(char)*maxlen, "AutoCompleteTruncate");
- autocpl->startname= startname;
+ autocpl = MEM_callocN(sizeof(AutoComplete), "AutoComplete");
+ autocpl->maxlen = maxlen;
+ autocpl->truncate = MEM_callocN(sizeof(char) * maxlen, "AutoCompleteTruncate");
+ autocpl->startname = startname;
return autocpl;
}
void autocomplete_do_name(AutoComplete *autocpl, const char *name)
{
- char *truncate= autocpl->truncate;
- const char *startname= autocpl->startname;
+ char *truncate = autocpl->truncate;
+ const char *startname = autocpl->startname;
int a;
- for(a=0; a<autocpl->maxlen-1; a++) {
- if(startname[a]==0 || startname[a]!=name[a])
+ for (a = 0; a < autocpl->maxlen - 1; a++) {
+ if (startname[a] == 0 || startname[a] != name[a])
break;
}
/* found a match */
- if(startname[a]==0) {
+ if (startname[a] == 0) {
/* first match */
- if(truncate[0]==0)
+ if (truncate[0] == 0)
BLI_strncpy(truncate, name, autocpl->maxlen);
else {
/* remove from truncate what is not in bone->name */
- for(a=0; a<autocpl->maxlen-1; a++) {
- if(name[a] == 0) {
- truncate[a]= 0;
+ for (a = 0; a < autocpl->maxlen - 1; a++) {
+ if (name[a] == 0) {
+ truncate[a] = 0;
break;
}
- else if(truncate[a]!=name[a])
- truncate[a]= 0;
+ else if (truncate[a] != name[a])
+ truncate[a] = 0;
}
}
}
@@ -2950,10 +2958,10 @@ void autocomplete_do_name(AutoComplete *autocpl, const char *name)
void autocomplete_end(AutoComplete *autocpl, char *autoname)
{
- if(autocpl->truncate[0])
+ if (autocpl->truncate[0])
BLI_strncpy(autoname, autocpl->truncate, autocpl->maxlen);
else {
- if (autoname != autocpl->startname) /* dont copy a string over its self */
+ if (autoname != autocpl->startname) /* don't copy a string over its self */
BLI_strncpy(autoname, autocpl->startname, autocpl->maxlen);
}
MEM_freeN(autocpl->truncate);
@@ -2963,18 +2971,18 @@ void autocomplete_end(AutoComplete *autocpl, char *autoname)
/* autocomplete callback for ID buttons */
static void autocomplete_id(bContext *C, char *str, void *arg_v)
{
- int blocktype= (intptr_t)arg_v;
- ListBase *listb= which_libbase(CTX_data_main(C), blocktype);
+ int blocktype = (intptr_t)arg_v;
+ ListBase *listb = which_libbase(CTX_data_main(C), blocktype);
- if(listb==NULL) return;
+ if (listb == NULL) return;
/* search if str matches the beginning of an ID struct */
- if(str[0]) {
- AutoComplete *autocpl= autocomplete_begin(str, MAX_ID_NAME-2);
+ if (str[0]) {
+ AutoComplete *autocpl = autocomplete_begin(str, MAX_ID_NAME - 2);
ID *id;
- for(id= listb->first; id; id= id->next)
- autocomplete_do_name(autocpl, id->name+2);
+ for (id = listb->first; id; id = id->next)
+ autocomplete_do_name(autocpl, id->name + 2);
autocomplete_end(autocpl, str);
}
@@ -2982,9 +2990,9 @@ static void autocomplete_id(bContext *C, char *str, void *arg_v)
static void ui_check_but_and_iconize(uiBut *but, int icon)
{
- if(icon) {
- but->icon= (BIFIconID) icon;
- but->flag|= UI_HAS_ICON;
+ if (icon) {
+ but->icon = (BIFIconID) icon;
+ but->flag |= UI_HAS_ICON;
}
ui_check_but(but);
@@ -2992,56 +3000,57 @@ static void ui_check_but_and_iconize(uiBut *but, int icon)
static uiBut *uiDefButBit(uiBlock *block, int type, int bit, 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)
{
- int bitIdx= findBitIndex(bit);
- if (bitIdx==-1) {
+ int bitIdx = findBitIndex(bit);
+ if (bitIdx == -1) {
return NULL;
- } else {
- return uiDefBut(block, type|BIT|bitIdx, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
+ }
+ else {
+ return uiDefBut(block, type | BIT | bitIdx, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
}
}
uiBut *uiDefButF(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefBut(block, type|FLO, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefBut(block, type | FLO, retval, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, const char *str, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefButBit(block, type|FLO, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefButBit(block, type | FLO, bit, retval, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefButI(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefBut(block, type|INT, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefBut(block, type | INT, retval, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, const char *str, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefButBit(block, type|INT, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefButBit(block, type | INT, bit, retval, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefButS(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefBut(block, type|SHO, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefBut(block, type | SHO, retval, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, const char *str, int x1, int y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefButBit(block, type|SHO, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefButBit(block, type | SHO, bit, retval, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefButC(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefBut(block, type|CHA, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefBut(block, type | CHA, retval, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, const char *str, int x1, int y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefButBit(block, type|CHA, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefButBit(block, type | CHA, bit, retval, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefButR(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip)
{
uiBut *but;
- but= ui_def_but_rna_propname(block, type, retval, str, x1, y1, x2, y2, ptr, propname, index, min, max, a1, a2, tip);
+ but = ui_def_but_rna_propname(block, type, retval, str, x1, y1, x2, y2, ptr, propname, index, min, max, a1, a2, tip);
ui_check_but(but);
return but;
}
uiBut *uiDefButR_prop(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, float a1, float a2, const char *tip)
{
uiBut *but;
- but= ui_def_but_rna(block, type, retval, str, x1, y1, x2, y2, ptr, prop, index, min, max, a1, a2, tip);
+ but = ui_def_but_rna(block, type, retval, str, x1, y1, x2, y2, ptr, prop, index, min, max, a1, a2, tip);
ui_check_but(but);
return but;
}
@@ -3049,7 +3058,7 @@ uiBut *uiDefButR_prop(uiBlock *block, int type, int retval, const char *str, int
uiBut *uiDefButO_ptr(uiBlock *block, int type, wmOperatorType *ot, int opcontext, const char *str, int x1, int y1, short x2, short y2, const char *tip)
{
uiBut *but;
- but= ui_def_but_operator_ptr(block, type, ot, opcontext, str, x1, y1, x2, y2, tip);
+ but = ui_def_but_operator_ptr(block, type, ot, opcontext, str, x1, y1, x2, y2, tip);
ui_check_but(but);
return but;
}
@@ -3062,7 +3071,7 @@ uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, co
uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x1, int y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip)
{
- uiBut *but= ui_def_but_operator_text(block, type, opname, opcontext, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
+ uiBut *but = ui_def_but_operator_text(block, type, opname, opcontext, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
ui_check_but(but);
return but;
}
@@ -3070,63 +3079,64 @@ uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext
/* if a1==1.0 then a2 is an extra icon blending factor (alpha 0.0 - 1.0) */
uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip)
{
- uiBut *but= ui_def_but(block, type, retval, "", x1, y1, x2, y2, poin, min, max, a1, a2, tip);
+ uiBut *but = ui_def_but(block, type, retval, "", x1, y1, x2, y2, poin, min, max, a1, a2, tip);
ui_check_but_and_iconize(but, icon);
return but;
}
static uiBut *uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int icon, int x1, int y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip)
{
- int bitIdx= findBitIndex(bit);
- if (bitIdx==-1) {
+ int bitIdx = findBitIndex(bit);
+ if (bitIdx == -1) {
return NULL;
- } else {
- return uiDefIconBut(block, type|BIT|bitIdx, retval, icon, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
+ }
+ else {
+ return uiDefIconBut(block, type | BIT | bitIdx, retval, icon, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
}
}
uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconBut(block, type|FLO, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconBut(block, type | FLO, retval, icon, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconButBit(block, type|FLO, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconButBit(block, type | FLO, bit, retval, icon, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconBut(block, type|INT, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconBut(block, type | INT, retval, icon, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconButBit(block, type|INT, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconButBit(block, type | INT, bit, retval, icon, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconBut(block, type|SHO, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconBut(block, type | SHO, retval, icon, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, int x1, int y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconButBit(block, type|SHO, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconButBit(block, type | SHO, bit, retval, icon, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconBut(block, type|CHA, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconBut(block, type | CHA, retval, icon, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, int x1, int y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconButBit(block, type|CHA, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconButBit(block, type | CHA, bit, retval, icon, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconButR(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip)
{
uiBut *but;
- but= ui_def_but_rna_propname(block, type, retval, "", x1, y1, x2, y2, ptr, propname, index, min, max, a1, a2, tip);
+ but = ui_def_but_rna_propname(block, type, retval, "", x1, y1, x2, y2, ptr, propname, index, min, max, a1, a2, tip);
ui_check_but_and_iconize(but, icon);
return but;
}
uiBut *uiDefIconButR_prop(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, float a1, float a2, const char *tip)
{
uiBut *but;
- but= ui_def_but_rna(block, type, retval, "", x1, y1, x2, y2, ptr, prop, index, min, max, a1, a2, tip);
+ but = ui_def_but_rna(block, type, retval, "", x1, y1, x2, y2, ptr, prop, index, min, max, a1, a2, tip);
ui_check_but_and_iconize(but, icon);
return but;
}
@@ -3134,7 +3144,7 @@ uiBut *uiDefIconButR_prop(uiBlock *block, int type, int retval, int icon, int x1
uiBut *uiDefIconButO_ptr(uiBlock *block, int type, wmOperatorType *ot, int opcontext, int icon, int x1, int y1, short x2, short y2, const char *tip)
{
uiBut *but;
- but= ui_def_but_operator_ptr(block, type, ot, opcontext, "", x1, y1, x2, y2, tip);
+ but = ui_def_but_operator_ptr(block, type, ot, opcontext, "", x1, y1, x2, y2, tip);
ui_check_but_and_iconize(but, icon);
return but;
}
@@ -3147,75 +3157,76 @@ uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext
/* Button containing both string label and icon */
uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip)
{
- uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
+ uiBut *but = ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
ui_check_but_and_iconize(but, icon);
- but->flag|= UI_ICON_LEFT;
+ but->flag |= UI_ICON_LEFT;
return but;
}
static uiBut *uiDefIconTextButBit(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip)
{
- int bitIdx= findBitIndex(bit);
- if (bitIdx==-1) {
+ int bitIdx = findBitIndex(bit);
+ if (bitIdx == -1) {
return NULL;
- } else {
- return uiDefIconTextBut(block, type|BIT|bitIdx, retval, icon, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
+ }
+ else {
+ return uiDefIconTextBut(block, type | BIT | bitIdx, retval, icon, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
}
}
uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconTextBut(block, type|FLO, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconTextBut(block, type | FLO, retval, icon, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconTextButBit(block, type|FLO, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconTextButBit(block, type | FLO, bit, retval, icon, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconTextBut(block, type|INT, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconTextBut(block, type | INT, retval, icon, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconTextButBit(block, type|INT, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconTextButBit(block, type | INT, bit, retval, icon, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconTextBut(block, type|SHO, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconTextBut(block, type | SHO, retval, icon, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconTextButBit(block, type|SHO, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconTextButBit(block, type | SHO, bit, retval, icon, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconTextBut(block, type|CHA, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconTextBut(block, type | CHA, retval, icon, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip)
{
- return uiDefIconTextButBit(block, type|CHA, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+ return uiDefIconTextButBit(block, type | CHA, bit, retval, icon, str, x1, y1, x2, y2, (void *) poin, min, max, a1, a2, tip);
}
uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip)
{
uiBut *but;
- but= ui_def_but_rna_propname(block, type, retval, str, x1, y1, x2, y2, ptr, propname, index, min, max, a1, a2, tip);
+ but = ui_def_but_rna_propname(block, type, retval, str, x1, y1, x2, y2, ptr, propname, index, min, max, a1, a2, tip);
ui_check_but_and_iconize(but, icon);
- but->flag|= UI_ICON_LEFT;
+ but->flag |= UI_ICON_LEFT;
return but;
}
uiBut *uiDefIconTextButR_prop(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, float a1, float a2, const char *tip)
{
uiBut *but;
- but= ui_def_but_rna(block, type, retval, str, x1, y1, x2, y2, ptr, prop, index, min, max, a1, a2, tip);
+ but = ui_def_but_rna(block, type, retval, str, x1, y1, x2, y2, ptr, prop, index, min, max, a1, a2, tip);
ui_check_but_and_iconize(but, icon);
- but->flag|= UI_ICON_LEFT;
+ but->flag |= UI_ICON_LEFT;
return but;
}
uiBut *uiDefIconTextButO_ptr(uiBlock *block, int type, wmOperatorType *ot, int opcontext, int icon, const char *str, int x1, int y1, short x2, short y2, const char *tip)
{
uiBut *but;
- but= ui_def_but_operator_ptr(block, type, ot, opcontext, str, x1, y1, x2, y2, tip);
+ but = ui_def_but_operator_ptr(block, type, ot, opcontext, str, x1, y1, x2, y2, tip);
ui_check_but_and_iconize(but, icon);
- but->flag|= UI_ICON_LEFT;
+ but->flag |= UI_ICON_LEFT;
return but;
}
uiBut *uiDefIconTextButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, const char *str, int x1, int y1, short x2, short y2, const char *tip)
@@ -3230,13 +3241,13 @@ void uiSetButLink(uiBut *but, void **poin, void ***ppoin, short *tot, int from,
{
uiLink *link;
- link= but->link= MEM_callocN(sizeof(uiLink), "new uilink");
+ link = but->link = MEM_callocN(sizeof(uiLink), "new uilink");
- link->poin= poin;
- link->ppoin= ppoin;
- link->totlink= tot;
- link->fromcode= from;
- link->tocode= to;
+ link->poin = poin;
+ link->ppoin = ppoin;
+ link->totlink = tot;
+ link->fromcode = from;
+ link->tocode = to;
}
/* cruft to make uiBlock and uiBut private */
@@ -3244,18 +3255,18 @@ void uiSetButLink(uiBut *but, void **poin, void ***ppoin, short *tot, int from,
int uiBlocksGetYMin(ListBase *lb)
{
uiBlock *block;
- int min= 0;
+ int min = 0;
- for (block= lb->first; block; block= block->next)
- if (block==lb->first || block->miny<min)
- min= block->miny;
+ for (block = lb->first; block; block = block->next)
+ if (block == lb->first || block->miny < min)
+ min = block->miny;
return min;
}
void uiBlockSetDirection(uiBlock *block, int direction)
{
- block->direction= direction;
+ block->direction = direction;
}
/* this call escapes if there's alignment flags */
@@ -3263,62 +3274,62 @@ void uiBlockFlipOrder(uiBlock *block)
{
ListBase lb;
uiBut *but, *next;
- float centy, miny=10000, maxy= -10000;
+ float centy, miny = 10000, maxy = -10000;
- if(U.uiflag & USER_MENUFIXEDORDER)
+ if (U.uiflag & USER_MENUFIXEDORDER)
return;
- else if(block->flag & UI_BLOCK_NO_FLIP)
+ else if (block->flag & UI_BLOCK_NO_FLIP)
return;
- for(but= block->buttons.first; but; but= but->next) {
- if(but->flag & UI_BUT_ALIGN) return;
- if(but->y1 < miny) miny= but->y1;
- if(but->y2 > maxy) maxy= but->y2;
+ for (but = block->buttons.first; but; but = but->next) {
+ if (but->flag & UI_BUT_ALIGN) return;
+ if (but->y1 < miny) miny = but->y1;
+ if (but->y2 > maxy) maxy = but->y2;
}
/* mirror trick */
- centy= (miny+maxy)/2.0f;
- for(but= block->buttons.first; but; but= but->next) {
- but->y1 = centy-(but->y1-centy);
- but->y2 = centy-(but->y2-centy);
+ centy = (miny + maxy) / 2.0f;
+ for (but = block->buttons.first; but; but = but->next) {
+ but->y1 = centy - (but->y1 - centy);
+ but->y2 = centy - (but->y2 - centy);
SWAP(float, but->y1, but->y2);
}
/* also flip order in block itself, for example for arrowkey */
- lb.first= lb.last= NULL;
- but= block->buttons.first;
- while(but) {
- next= but->next;
+ lb.first = lb.last = NULL;
+ but = block->buttons.first;
+ while (but) {
+ next = but->next;
BLI_remlink(&block->buttons, but);
BLI_addtail(&lb, but);
- but= next;
+ but = next;
}
- block->buttons= lb;
+ block->buttons = lb;
}
void uiBlockSetFlag(uiBlock *block, int flag)
{
- block->flag|= flag;
+ block->flag |= flag;
}
void uiBlockClearFlag(uiBlock *block, int flag)
{
- block->flag&= ~flag;
+ block->flag &= ~flag;
}
void uiBlockSetXOfs(uiBlock *block, int xofs)
{
- block->xofs= xofs;
+ block->xofs = xofs;
}
void uiButSetFlag(uiBut *but, int flag)
{
- but->flag|= flag;
+ but->flag |= flag;
}
void uiButClearFlag(uiBut *but, int flag)
{
- but->flag&= ~flag;
+ but->flag &= ~flag;
}
int uiButGetRetVal(uiBut *but)
@@ -3328,47 +3339,47 @@ int uiButGetRetVal(uiBut *but)
void uiButSetDragID(uiBut *but, ID *id)
{
- but->dragtype= WM_DRAG_ID;
- but->dragpoin= (void *)id;
+ but->dragtype = WM_DRAG_ID;
+ but->dragpoin = (void *)id;
}
void uiButSetDragRNA(uiBut *but, PointerRNA *ptr)
{
- but->dragtype= WM_DRAG_RNA;
- but->dragpoin= (void *)ptr;
+ but->dragtype = WM_DRAG_RNA;
+ but->dragpoin = (void *)ptr;
}
void uiButSetDragPath(uiBut *but, const char *path)
{
- but->dragtype= WM_DRAG_PATH;
- but->dragpoin= (void *)path;
+ but->dragtype = WM_DRAG_PATH;
+ but->dragpoin = (void *)path;
}
void uiButSetDragName(uiBut *but, const char *name)
{
- but->dragtype= WM_DRAG_NAME;
- but->dragpoin= (void *)name;
+ but->dragtype = WM_DRAG_NAME;
+ but->dragpoin = (void *)name;
}
/* value from button itself */
void uiButSetDragValue(uiBut *but)
{
- but->dragtype= WM_DRAG_VALUE;
+ but->dragtype = WM_DRAG_VALUE;
}
void uiButSetDragImage(uiBut *but, const char *path, int icon, struct ImBuf *imb, float scale)
{
- but->dragtype= WM_DRAG_PATH;
- but->icon= icon; /* no flag UI_HAS_ICON, so icon doesnt draw in button */
- but->dragpoin= (void *)path;
- but->imb= imb;
- but->imb_scale= scale;
+ but->dragtype = WM_DRAG_PATH;
+ but->icon = icon; /* no flag UI_HAS_ICON, so icon doesnt draw in button */
+ but->dragpoin = (void *)path;
+ but->imb = imb;
+ but->imb_scale = scale;
}
PointerRNA *uiButGetOperatorPtrRNA(uiBut *but)
{
- if(but->optype && !but->opptr) {
- but->opptr= MEM_callocN(sizeof(PointerRNA), "uiButOpPtr");
+ if (but->optype && !but->opptr) {
+ but->opptr = MEM_callocN(sizeof(PointerRNA), "uiButOpPtr");
WM_operator_properties_create_ptr(but->opptr, but->optype);
}
@@ -3377,14 +3388,14 @@ PointerRNA *uiButGetOperatorPtrRNA(uiBut *but)
void uiButSetUnitType(uiBut *but, const int unit_type)
{
- but->unit_type= (unsigned char)(unit_type>>16);
+ but->unit_type = (unsigned char)(unit_type >> 16);
}
int uiButGetUnitType(uiBut *but)
{
int ownUnit = (int)but->unit_type;
- /* own unit define always takes precidence over RNA provided, allowing for overriding
+ /* own unit define always takes precedence over RNA provided, allowing for overriding
* default value provided in RNA in a few special cases (i.e. Active Keyframe in Graph Edit)
*/
// XXX: this doesn't allow clearing unit completely, though the same could be said for icons
@@ -3398,21 +3409,21 @@ int uiButGetUnitType(uiBut *but)
void uiBlockSetHandleFunc(uiBlock *block, uiBlockHandleFunc func, void *arg)
{
- block->handle_func= func;
- block->handle_func_arg= arg;
+ block->handle_func = func;
+ block->handle_func_arg = arg;
}
void uiBlockSetButmFunc(uiBlock *block, uiMenuHandleFunc func, void *arg)
{
- block->butm_func= func;
- block->butm_func_arg= arg;
+ block->butm_func = func;
+ block->butm_func_arg = arg;
}
void uiBlockSetFunc(uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2)
{
- block->func= func;
- block->func_arg1= arg1;
- block->func_arg2= arg2;
+ block->func = func;
+ block->func_arg1 = arg1;
+ block->func_arg2 = arg2;
}
void uiBlockSetNFunc(uiBlock *block, uiButHandleFunc func, void *argN, void *arg2)
@@ -3421,29 +3432,29 @@ void uiBlockSetNFunc(uiBlock *block, uiButHandleFunc func, void *argN, void *arg
MEM_freeN(block->func_argN);
}
- block->funcN= func;
- block->func_argN= argN;
- block->func_arg2= arg2;
+ block->funcN = func;
+ block->func_argN = argN;
+ block->func_arg2 = arg2;
}
void uiButSetRenameFunc(uiBut *but, uiButHandleRenameFunc func, void *arg1)
{
- but->rename_func= func;
- but->rename_arg1= arg1;
+ but->rename_func = func;
+ but->rename_arg1 = arg1;
}
void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const bContext *C, void *idv, void *arg1, void *arg2, rcti *rect), void *arg1, void *arg2)
{
- block->drawextra= func;
- block->drawextra_arg1= arg1;
- block->drawextra_arg2= arg2;
+ block->drawextra = func;
+ block->drawextra_arg1 = arg1;
+ block->drawextra_arg2 = arg2;
}
void uiButSetFunc(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2)
{
- but->func= func;
- but->func_arg1= arg1;
- but->func_arg2= arg2;
+ but->func = func;
+ but->func_arg1 = arg1;
+ but->func_arg2 = arg2;
}
void uiButSetNFunc(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2)
@@ -3452,25 +3463,25 @@ void uiButSetNFunc(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2)
MEM_freeN(but->func_argN);
}
- but->funcN= funcN;
- but->func_argN= argN;
- but->func_arg2= arg2;
+ but->funcN = funcN;
+ but->func_argN = argN;
+ but->func_arg2 = arg2;
}
void uiButSetCompleteFunc(uiBut *but, uiButCompleteFunc func, void *arg)
{
- but->autocomplete_func= func;
- but->autofunc_arg= arg;
+ but->autocomplete_func = func;
+ but->autofunc_arg = arg;
}
uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, const char *str, int x1, int y1, short x2, short y2, void *idpp, const char *tip)
{
- uiBut *but= ui_def_but(block, IDPOIN, retval, str, x1, y1, x2, y2, NULL, 0.0, 0.0, 0.0, 0.0, tip);
- but->idpoin_func= func;
- but->idpoin_idpp= (ID**) idpp;
+ uiBut *but = ui_def_but(block, IDPOIN, retval, str, x1, y1, x2, y2, NULL, 0.0, 0.0, 0.0, 0.0, tip);
+ but->idpoin_func = func;
+ but->idpoin_idpp = (ID **) idpp;
ui_check_but(but);
- if(blocktype)
+ if (blocktype)
uiButSetCompleteFunc(but, autocomplete_id, (void *)(intptr_t)blocktype);
return but;
@@ -3478,20 +3489,20 @@ uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int
uiBut *uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, int x1, int y1, short x2, short y2, const char *tip)
{
- uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
- but->block_create_func= func;
+ uiBut *but = ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
+ but->block_create_func = func;
ui_check_but(but);
return but;
}
uiBut *uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, const char *str, int x1, int y1, short x2, short y2, const char *tip)
{
- uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, NULL, 0.0, 0.0, 0.0, 0.0, tip);
- but->block_create_func= func;
+ uiBut *but = ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, NULL, 0.0, 0.0, 0.0, 0.0, tip);
+ but->block_create_func = func;
if (but->func_argN) {
MEM_freeN(but->func_argN);
}
- but->func_argN= argN;
+ but->func_argN = argN;
ui_check_but(but);
return but;
}
@@ -3499,31 +3510,31 @@ uiBut *uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, const
uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, int x1, int y1, short x2, short y2, const char *tip)
{
- uiBut *but= ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
- but->block_create_func= func;
+ uiBut *but = ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
+ but->block_create_func = func;
ui_check_but(but);
return but;
}
uiBut *uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, const char *str, int x1, int y1, short x2, short y2, const char *tip)
{
- uiBut *but= ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
- but->menu_create_func= func;
+ uiBut *but = ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
+ but->menu_create_func = func;
ui_check_but(but);
return but;
}
uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, const char *str, int x1, int y1, short x2, short y2, const char *tip)
{
- uiBut *but= ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
+ uiBut *but = ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
- but->icon= (BIFIconID) icon;
- but->flag|= UI_HAS_ICON;
+ but->icon = (BIFIconID) icon;
+ but->flag |= UI_HAS_ICON;
- but->flag|= UI_ICON_LEFT;
- but->flag|= UI_ICON_SUBMENU;
+ but->flag |= UI_ICON_LEFT;
+ but->flag |= UI_ICON_SUBMENU;
- but->menu_create_func= func;
+ but->menu_create_func = func;
ui_check_but(but);
return but;
@@ -3531,13 +3542,13 @@ uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, in
uiBut *uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, int x1, int y1, short x2, short y2, const char *tip)
{
- uiBut *but= ui_def_but(block, PULLDOWN, 0, "", x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
+ uiBut *but = ui_def_but(block, PULLDOWN, 0, "", x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
- but->icon= (BIFIconID) icon;
+ but->icon = (BIFIconID) icon;
but->flag |= UI_HAS_ICON;
- but->flag &=~ UI_ICON_LEFT;
+ but->flag &= ~UI_ICON_LEFT;
- but->menu_create_func= func;
+ but->menu_create_func = func;
ui_check_but(but);
return but;
@@ -3546,17 +3557,17 @@ uiBut *uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int ic
/* Block button containing both string label and icon */
uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int icon, const char *str, int x1, int y1, short x2, short y2, const char *tip)
{
- uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
+ uiBut *but = ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
/* XXX temp, old menu calls pass on icon arrow, which is now UI_ICON_SUBMENU flag */
- if(icon!=ICON_RIGHTARROW_THIN) {
- but->icon= (BIFIconID) icon;
- but->flag|= UI_ICON_LEFT;
+ if (icon != ICON_RIGHTARROW_THIN) {
+ but->icon = (BIFIconID) icon;
+ but->flag |= UI_ICON_LEFT;
}
- but->flag|= UI_HAS_ICON;
- but->flag|= UI_ICON_SUBMENU;
+ but->flag |= UI_HAS_ICON;
+ but->flag |= UI_ICON_SUBMENU;
- but->block_create_func= func;
+ but->block_create_func = func;
ui_check_but(but);
return but;
@@ -3565,14 +3576,14 @@ uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg,
/* Block button containing icon */
uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int retval, int icon, int x1, int y1, short x2, short y2, const char *tip)
{
- uiBut *but= ui_def_but(block, BLOCK, retval, "", x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
+ uiBut *but = ui_def_but(block, BLOCK, retval, "", x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
- but->icon= (BIFIconID) icon;
- but->flag|= UI_HAS_ICON;
+ but->icon = (BIFIconID) icon;
+ but->flag |= UI_HAS_ICON;
- but->flag|= UI_ICON_LEFT;
+ but->flag |= UI_ICON_LEFT;
- but->block_create_func= func;
+ but->block_create_func = func;
ui_check_but(but);
return but;
@@ -3580,7 +3591,7 @@ uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int
uiBut *uiDefKeyevtButS(uiBlock *block, int retval, const char *str, int x1, int y1, short x2, short y2, short *spoin, const char *tip)
{
- uiBut *but= ui_def_but(block, KEYEVT|SHO, retval, str, x1, y1, x2, y2, spoin, 0.0, 0.0, 0.0, 0.0, tip);
+ uiBut *but = ui_def_but(block, KEYEVT | SHO, retval, str, x1, y1, x2, y2, spoin, 0.0, 0.0, 0.0, 0.0, tip);
ui_check_but(but);
return but;
}
@@ -3589,8 +3600,8 @@ uiBut *uiDefKeyevtButS(uiBlock *block, int retval, const char *str, int x1, int
/* modkeypoin will be set to KM_SHIFT, KM_ALT, KM_CTRL, KM_OSKEY bits */
uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, const char *str, int x1, int y1, short x2, short y2, short *keypoin, short *modkeypoin, const char *tip)
{
- uiBut *but= ui_def_but(block, HOTKEYEVT|SHO, retval, str, x1, y1, x2, y2, keypoin, 0.0, 0.0, 0.0, 0.0, tip);
- but->modifier_key= *modkeypoin;
+ uiBut *but = ui_def_but(block, HOTKEYEVT | SHO, retval, str, x1, y1, x2, y2, keypoin, 0.0, 0.0, 0.0, 0.0, tip);
+ but->modifier_key = *modkeypoin;
ui_check_but(but);
return but;
}
@@ -3600,12 +3611,12 @@ uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, const char *str, int x1, i
/* here a1 and a2, if set, control thumbnail preview rows/cols */
uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxlen, int x1, int y1, short x2, short y2, float a1, float a2, const char *tip)
{
- uiBut *but= ui_def_but(block, SEARCH_MENU, retval, "", x1, y1, x2, y2, arg, 0.0, maxlen, a1, a2, tip);
+ uiBut *but = ui_def_but(block, SEARCH_MENU, retval, "", x1, y1, x2, y2, arg, 0.0, maxlen, a1, a2, tip);
- but->icon= (BIFIconID) icon;
- but->flag|= UI_HAS_ICON;
+ but->icon = (BIFIconID) icon;
+ but->flag |= UI_HAS_ICON;
- but->flag|= UI_ICON_LEFT|UI_TEXT_LEFT;
+ but->flag |= UI_ICON_LEFT | UI_TEXT_LEFT;
ui_check_but(but);
@@ -3617,15 +3628,15 @@ uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxle
/* if active set, button opens with this item visible and selected */
void uiButSetSearchFunc(uiBut *but, uiButSearchFunc sfunc, void *arg, uiButHandleFunc bfunc, void *active)
{
- but->search_func= sfunc;
- but->search_arg= arg;
+ but->search_func = sfunc;
+ but->search_arg = arg;
uiButSetFunc(but, bfunc, arg, active);
/* search buttons show red-alert if item doesn't exist, not for menus */
- if(0==(but->block->flag & UI_BLOCK_LOOP)) {
+ if (0 == (but->block->flag & UI_BLOCK_LOOP)) {
/* skip empty buttons, not all buttons need input, we only show invalid */
- if(but->drawstr[0])
+ if (but->drawstr[0])
ui_but_search_test(but);
}
}
@@ -3637,11 +3648,11 @@ void uiButSetFocusOnEnter(wmWindow *win, uiBut *but)
{
wmEvent event;
- event= *(win->eventstate);
- event.type= EVT_BUT_OPEN;
- event.val= KM_PRESS;
- event.customdata= but;
- event.customdatafree= FALSE;
+ event = *(win->eventstate);
+ event.type = EVT_BUT_OPEN;
+ event.val = KM_PRESS;
+ event.customdata = but;
+ event.customdatafree = FALSE;
wm_event_add(win, &event);
}
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index 5e095bae922..c7f8ad521fa 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -65,15 +65,15 @@ void ui_but_anim_flag(uiBut *but, float cfra)
FCurve *fcu;
int driven;
- but->flag &= ~(UI_BUT_ANIMATED|UI_BUT_ANIMATED_KEY|UI_BUT_DRIVEN);
+ but->flag &= ~(UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN);
- fcu= ui_but_get_fcurve(but, NULL, &driven);
+ fcu = ui_but_get_fcurve(but, NULL, &driven);
- if(fcu) {
- if(!driven) {
+ if (fcu) {
+ if (!driven) {
but->flag |= UI_BUT_ANIMATED;
- if(fcurve_frame_has_keyframe(fcu, cfra, 0))
+ if (fcurve_frame_has_keyframe(fcu, cfra, 0))
but->flag |= UI_BUT_ANIMATED_KEY;
}
else {
@@ -88,12 +88,12 @@ int ui_but_anim_expression_get(uiBut *but, char *str, size_t maxlen)
ChannelDriver *driver;
int driven;
- fcu= ui_but_get_fcurve(but, NULL, &driven);
+ fcu = ui_but_get_fcurve(but, NULL, &driven);
- if(fcu && driven) {
- driver= fcu->driver;
+ if (fcu && driven) {
+ driver = fcu->driver;
- if(driver && driver->type == DRIVER_TYPE_PYTHON) {
+ if (driver && driver->type == DRIVER_TYPE_PYTHON) {
BLI_strncpy(str, driver->expression, maxlen);
return 1;
}
@@ -108,15 +108,15 @@ int ui_but_anim_expression_set(uiBut *but, const char *str)
ChannelDriver *driver;
int driven;
- fcu= ui_but_get_fcurve(but, NULL, &driven);
+ fcu = ui_but_get_fcurve(but, NULL, &driven);
- if(fcu && driven) {
- driver= fcu->driver;
+ if (fcu && driven) {
+ driver = fcu->driver;
- if(driver && driver->type == DRIVER_TYPE_PYTHON) {
+ if (driver && driver->type == DRIVER_TYPE_PYTHON) {
BLI_strncpy_utf8(driver->expression, str, sizeof(driver->expression));
driver->flag |= DRIVER_FLAG_RECOMPILE;
- WM_event_add_notifier(but->block->evil_C, NC_ANIMATION|ND_KEYFRAME, NULL);
+ WM_event_add_notifier(but->block->evil_C, NC_ANIMATION | ND_KEYFRAME, NULL);
return 1;
}
}
@@ -131,11 +131,11 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
ID *id;
FCurve *fcu;
char *path;
- short ok=0;
+ short ok = 0;
/* button must have RNA-pointer to a numeric-capable property */
if (ELEM(NULL, but->rnapoin.data, but->rnaprop)) {
- if (G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("ERROR: create expression failed - button has no RNA info attached\n");
return 0;
}
@@ -143,8 +143,8 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
/* make sure we have animdata for this */
// FIXME: until materials can be handled by depsgraph, don't allow drivers to be created for them
id = (ID *)but->rnapoin.id.data;
- if ((id == NULL) || (GS(id->name)==ID_MA) || (GS(id->name)==ID_TE)) {
- if (G.f & G_DEBUG)
+ if ((id == NULL) || (GS(id->name) == ID_MA) || (GS(id->name) == ID_TE)) {
+ if (G.debug & G_DEBUG)
printf("ERROR: create expression failed - invalid id-datablock for adding drivers (%p)\n", id);
return 0;
}
@@ -155,7 +155,7 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
/* create driver */
fcu = verify_driver_fcurve(id, path, but->rnaindex, 1);
if (fcu) {
- ChannelDriver *driver= fcu->driver;
+ ChannelDriver *driver = fcu->driver;
if (driver) {
/* set type of driver */
@@ -167,7 +167,7 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
/* updates */
driver->flag |= DRIVER_FLAG_RECOMPILE;
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME, NULL);
}
}
@@ -183,19 +183,19 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra)
FCurve *fcu;
int driven;
- fcu= ui_but_get_fcurve(but, &action, &driven);
+ fcu = ui_but_get_fcurve(but, &action, &driven);
- if(fcu && !driven) {
- id= but->rnapoin.id.data;
+ if (fcu && !driven) {
+ id = but->rnapoin.id.data;
// TODO: this should probably respect the keyingset only option for anim
- if(autokeyframe_cfra_can_key(scene, id)) {
+ if (autokeyframe_cfra_can_key(scene, id)) {
ReportList *reports = CTX_wm_reports(C);
short flag = ANIM_get_keyframing_flags(scene, 1);
fcu->flag &= ~FCURVE_SELECTED;
- insert_keyframe(reports, id, action, ((fcu->grp)?(fcu->grp->name):(NULL)), fcu->rna_path, fcu->array_index, cfra, flag);
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
+ insert_keyframe(reports, id, action, ((fcu->grp) ? (fcu->grp->name) : (NULL)), fcu->rna_path, fcu->array_index, cfra, flag);
+ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
}
}
}
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 93cb0f8ae97..91d3c890df3 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -58,16 +58,16 @@
/* own include */
#include "interface_intern.h"
-#define UI_DISABLED_ALPHA_OFFS -160
+#define UI_DISABLED_ALPHA_OFFS -160
-static int roundboxtype= UI_CNR_ALL;
+static int roundboxtype = UI_CNR_ALL;
void uiSetRoundBox(int type)
{
/* Not sure the roundbox function is the best place to change this
* if this is undone, its not that big a deal, only makes curves edges
* square for the */
- roundboxtype= type;
+ roundboxtype = type;
}
@@ -78,54 +78,54 @@ int uiGetRoundBox(void)
void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float rad)
{
- float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
- {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
+ float vec[7][2] = {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
+ {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
int a;
/* mult */
- for(a=0; a<7; a++) {
- vec[a][0]*= rad; vec[a][1]*= rad;
+ for (a = 0; a < 7; a++) {
+ vec[a][0] *= rad; vec[a][1] *= rad;
}
glBegin(mode);
/* start with corner right-bottom */
- if(roundboxtype & UI_CNR_BOTTOM_RIGHT) {
- glVertex2f(maxx-rad, miny);
- for(a=0; a<7; a++) {
- glVertex2f(maxx-rad+vec[a][0], miny+vec[a][1]);
+ if (roundboxtype & UI_CNR_BOTTOM_RIGHT) {
+ glVertex2f(maxx - rad, miny);
+ for (a = 0; a < 7; a++) {
+ glVertex2f(maxx - rad + vec[a][0], miny + vec[a][1]);
}
- glVertex2f(maxx, miny+rad);
+ glVertex2f(maxx, miny + rad);
}
else glVertex2f(maxx, miny);
/* corner right-top */
- if(roundboxtype & UI_CNR_TOP_RIGHT) {
- glVertex2f(maxx, maxy-rad);
- for(a=0; a<7; a++) {
- glVertex2f(maxx-vec[a][1], maxy-rad+vec[a][0]);
+ if (roundboxtype & UI_CNR_TOP_RIGHT) {
+ glVertex2f(maxx, maxy - rad);
+ for (a = 0; a < 7; a++) {
+ glVertex2f(maxx - vec[a][1], maxy - rad + vec[a][0]);
}
- glVertex2f(maxx-rad, maxy);
+ glVertex2f(maxx - rad, maxy);
}
else glVertex2f(maxx, maxy);
/* corner left-top */
- if(roundboxtype & UI_CNR_TOP_LEFT) {
- glVertex2f(minx+rad, maxy);
- for(a=0; a<7; a++) {
- glVertex2f(minx+rad-vec[a][0], maxy-vec[a][1]);
+ if (roundboxtype & UI_CNR_TOP_LEFT) {
+ glVertex2f(minx + rad, maxy);
+ for (a = 0; a < 7; a++) {
+ glVertex2f(minx + rad - vec[a][0], maxy - vec[a][1]);
}
- glVertex2f(minx, maxy-rad);
+ glVertex2f(minx, maxy - rad);
}
else glVertex2f(minx, maxy);
/* corner left-bottom */
- if(roundboxtype & UI_CNR_BOTTOM_LEFT) {
- glVertex2f(minx, miny+rad);
- for(a=0; a<7; a++) {
- glVertex2f(minx+vec[a][1], miny+rad-vec[a][0]);
+ if (roundboxtype & UI_CNR_BOTTOM_LEFT) {
+ glVertex2f(minx, miny + rad);
+ for (a = 0; a < 7; a++) {
+ glVertex2f(minx + vec[a][1], miny + rad - vec[a][0]);
}
- glVertex2f(minx+rad, miny);
+ glVertex2f(minx + rad, miny);
}
else glVertex2f(minx, miny);
@@ -136,9 +136,9 @@ static void round_box_shade_col(const float col1[3], float const col2[3], const
{
float col[3];
- col[0]= (fac*col1[0] + (1.0f-fac)*col2[0]);
- col[1]= (fac*col1[1] + (1.0f-fac)*col2[1]);
- col[2]= (fac*col1[2] + (1.0f-fac)*col2[2]);
+ col[0] = (fac * col1[0] + (1.0f - fac) * col2[0]);
+ col[1] = (fac * col1[1] + (1.0f - fac) * col2[1]);
+ col[2] = (fac * col1[2] + (1.0f - fac) * col2[2]);
glColor3fv(col);
}
@@ -146,44 +146,44 @@ static void round_box_shade_col(const float col1[3], float const col2[3], const
/* view2d scrollers use it */
void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown)
{
- float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
- {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
- const float div= maxy - miny;
- const float idiv= 1.0f / div;
+ float vec[7][2] = {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
+ {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
+ const float div = maxy - miny;
+ const float idiv = 1.0f / div;
float coltop[3], coldown[3], color[4];
int a;
/* mult */
- for(a=0; a<7; a++) {
- vec[a][0]*= rad; vec[a][1]*= rad;
+ for (a = 0; a < 7; a++) {
+ vec[a][0] *= rad; vec[a][1] *= rad;
}
/* get current color, needs to be outside of glBegin/End */
glGetFloatv(GL_CURRENT_COLOR, color);
/* 'shade' defines strength of shading */
- coltop[0]= color[0]+shadetop; if(coltop[0]>1.0f) coltop[0]= 1.0f;
- coltop[1]= color[1]+shadetop; if(coltop[1]>1.0f) coltop[1]= 1.0f;
- coltop[2]= color[2]+shadetop; if(coltop[2]>1.0f) coltop[2]= 1.0f;
- coldown[0]= color[0]+shadedown; if(coldown[0]<0.0f) coldown[0]= 0.0f;
- coldown[1]= color[1]+shadedown; if(coldown[1]<0.0f) coldown[1]= 0.0f;
- coldown[2]= color[2]+shadedown; if(coldown[2]<0.0f) coldown[2]= 0.0f;
+ coltop[0] = color[0] + shadetop; if (coltop[0] > 1.0f) coltop[0] = 1.0f;
+ coltop[1] = color[1] + shadetop; if (coltop[1] > 1.0f) coltop[1] = 1.0f;
+ coltop[2] = color[2] + shadetop; if (coltop[2] > 1.0f) coltop[2] = 1.0f;
+ coldown[0] = color[0] + shadedown; if (coldown[0] < 0.0f) coldown[0] = 0.0f;
+ coldown[1] = color[1] + shadedown; if (coldown[1] < 0.0f) coldown[1] = 0.0f;
+ coldown[2] = color[2] + shadedown; if (coldown[2] < 0.0f) coldown[2] = 0.0f;
glShadeModel(GL_SMOOTH);
glBegin(mode);
/* start with corner right-bottom */
- if(roundboxtype & UI_CNR_BOTTOM_RIGHT) {
+ if (roundboxtype & UI_CNR_BOTTOM_RIGHT) {
round_box_shade_col(coltop, coldown, 0.0);
- glVertex2f(maxx-rad, miny);
+ glVertex2f(maxx - rad, miny);
- for(a=0; a<7; a++) {
- round_box_shade_col(coltop, coldown, vec[a][1]*idiv);
- glVertex2f(maxx-rad+vec[a][0], miny+vec[a][1]);
+ for (a = 0; a < 7; a++) {
+ round_box_shade_col(coltop, coldown, vec[a][1] * idiv);
+ glVertex2f(maxx - rad + vec[a][0], miny + vec[a][1]);
}
- round_box_shade_col(coltop, coldown, rad*idiv);
- glVertex2f(maxx, miny+rad);
+ round_box_shade_col(coltop, coldown, rad * idiv);
+ glVertex2f(maxx, miny + rad);
}
else {
round_box_shade_col(coltop, coldown, 0.0);
@@ -191,17 +191,17 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
}
/* corner right-top */
- if(roundboxtype & UI_CNR_TOP_RIGHT) {
+ if (roundboxtype & UI_CNR_TOP_RIGHT) {
- round_box_shade_col(coltop, coldown, (div-rad)*idiv);
- glVertex2f(maxx, maxy-rad);
+ round_box_shade_col(coltop, coldown, (div - rad) * idiv);
+ glVertex2f(maxx, maxy - rad);
- for(a=0; a<7; a++) {
- round_box_shade_col(coltop, coldown, (div-rad+vec[a][1])*idiv);
- glVertex2f(maxx-vec[a][1], maxy-rad+vec[a][0]);
+ for (a = 0; a < 7; a++) {
+ round_box_shade_col(coltop, coldown, (div - rad + vec[a][1]) * idiv);
+ glVertex2f(maxx - vec[a][1], maxy - rad + vec[a][0]);
}
round_box_shade_col(coltop, coldown, 1.0);
- glVertex2f(maxx-rad, maxy);
+ glVertex2f(maxx - rad, maxy);
}
else {
round_box_shade_col(coltop, coldown, 1.0);
@@ -209,18 +209,18 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
}
/* corner left-top */
- if(roundboxtype & UI_CNR_TOP_LEFT) {
+ if (roundboxtype & UI_CNR_TOP_LEFT) {
round_box_shade_col(coltop, coldown, 1.0);
- glVertex2f(minx+rad, maxy);
+ glVertex2f(minx + rad, maxy);
- for(a=0; a<7; a++) {
- round_box_shade_col(coltop, coldown, (div-vec[a][1])*idiv);
- glVertex2f(minx+rad-vec[a][0], maxy-vec[a][1]);
+ for (a = 0; a < 7; a++) {
+ round_box_shade_col(coltop, coldown, (div - vec[a][1]) * idiv);
+ glVertex2f(minx + rad - vec[a][0], maxy - vec[a][1]);
}
- round_box_shade_col(coltop, coldown, (div-rad)*idiv);
- glVertex2f(minx, maxy-rad);
+ round_box_shade_col(coltop, coldown, (div - rad) * idiv);
+ glVertex2f(minx, maxy - rad);
}
else {
round_box_shade_col(coltop, coldown, 1.0);
@@ -228,18 +228,18 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
}
/* corner left-bottom */
- if(roundboxtype & UI_CNR_BOTTOM_LEFT) {
+ if (roundboxtype & UI_CNR_BOTTOM_LEFT) {
- round_box_shade_col(coltop, coldown, rad*idiv);
- glVertex2f(minx, miny+rad);
+ round_box_shade_col(coltop, coldown, rad * idiv);
+ glVertex2f(minx, miny + rad);
- for(a=0; a<7; a++) {
- round_box_shade_col(coltop, coldown, (rad-vec[a][1])*idiv);
- glVertex2f(minx+vec[a][1], miny+rad-vec[a][0]);
+ for (a = 0; a < 7; a++) {
+ round_box_shade_col(coltop, coldown, (rad - vec[a][1]) * idiv);
+ glVertex2f(minx + vec[a][1], miny + rad - vec[a][0]);
}
round_box_shade_col(coltop, coldown, 0.0);
- glVertex2f(minx+rad, miny);
+ glVertex2f(minx + rad, miny);
}
else {
round_box_shade_col(coltop, coldown, 0.0);
@@ -254,43 +254,43 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
/* view2d scrollers use it */
void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight)
{
- float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
- {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
- const float div= maxx - minx;
- const float idiv= 1.0f / div;
+ float vec[7][2] = {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
+ {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
+ const float div = maxx - minx;
+ const float idiv = 1.0f / div;
float colLeft[3], colRight[3], color[4];
int a;
/* mult */
- for(a=0; a<7; a++) {
- vec[a][0]*= rad; vec[a][1]*= rad;
+ for (a = 0; a < 7; a++) {
+ vec[a][0] *= rad; vec[a][1] *= rad;
}
/* get current color, needs to be outside of glBegin/End */
glGetFloatv(GL_CURRENT_COLOR, color);
/* 'shade' defines strength of shading */
- colLeft[0]= color[0]+shadeLeft; if(colLeft[0]>1.0f) colLeft[0]= 1.0f;
- colLeft[1]= color[1]+shadeLeft; if(colLeft[1]>1.0f) colLeft[1]= 1.0f;
- colLeft[2]= color[2]+shadeLeft; if(colLeft[2]>1.0f) colLeft[2]= 1.0f;
- colRight[0]= color[0]+shadeRight; if(colRight[0]<0.0f) colRight[0]= 0.0f;
- colRight[1]= color[1]+shadeRight; if(colRight[1]<0.0f) colRight[1]= 0.0f;
- colRight[2]= color[2]+shadeRight; if(colRight[2]<0.0f) colRight[2]= 0.0f;
+ colLeft[0] = color[0] + shadeLeft; if (colLeft[0] > 1.0f) colLeft[0] = 1.0f;
+ colLeft[1] = color[1] + shadeLeft; if (colLeft[1] > 1.0f) colLeft[1] = 1.0f;
+ colLeft[2] = color[2] + shadeLeft; if (colLeft[2] > 1.0f) colLeft[2] = 1.0f;
+ colRight[0] = color[0] + shadeRight; if (colRight[0] < 0.0f) colRight[0] = 0.0f;
+ colRight[1] = color[1] + shadeRight; if (colRight[1] < 0.0f) colRight[1] = 0.0f;
+ colRight[2] = color[2] + shadeRight; if (colRight[2] < 0.0f) colRight[2] = 0.0f;
glShadeModel(GL_SMOOTH);
glBegin(mode);
/* start with corner right-bottom */
- if(roundboxtype & UI_CNR_BOTTOM_RIGHT) {
+ if (roundboxtype & UI_CNR_BOTTOM_RIGHT) {
round_box_shade_col(colLeft, colRight, 0.0);
- glVertex2f(maxx-rad, miny);
+ glVertex2f(maxx - rad, miny);
- for(a=0; a<7; a++) {
- round_box_shade_col(colLeft, colRight, vec[a][0]*idiv);
- glVertex2f(maxx-rad+vec[a][0], miny+vec[a][1]);
+ for (a = 0; a < 7; a++) {
+ round_box_shade_col(colLeft, colRight, vec[a][0] * idiv);
+ glVertex2f(maxx - rad + vec[a][0], miny + vec[a][1]);
}
- round_box_shade_col(colLeft, colRight, rad*idiv);
- glVertex2f(maxx, miny+rad);
+ round_box_shade_col(colLeft, colRight, rad * idiv);
+ glVertex2f(maxx, miny + rad);
}
else {
round_box_shade_col(colLeft, colRight, 0.0);
@@ -298,17 +298,17 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float
}
/* corner right-top */
- if(roundboxtype & UI_CNR_TOP_RIGHT) {
+ if (roundboxtype & UI_CNR_TOP_RIGHT) {
round_box_shade_col(colLeft, colRight, 0.0);
- glVertex2f(maxx, maxy-rad);
+ glVertex2f(maxx, maxy - rad);
- for(a=0; a<7; a++) {
+ for (a = 0; a < 7; a++) {
- round_box_shade_col(colLeft, colRight, (div-rad-vec[a][0])*idiv);
- glVertex2f(maxx-vec[a][1], maxy-rad+vec[a][0]);
+ round_box_shade_col(colLeft, colRight, (div - rad - vec[a][0]) * idiv);
+ glVertex2f(maxx - vec[a][1], maxy - rad + vec[a][0]);
}
- round_box_shade_col(colLeft, colRight, (div-rad)*idiv);
- glVertex2f(maxx-rad, maxy);
+ round_box_shade_col(colLeft, colRight, (div - rad) * idiv);
+ glVertex2f(maxx - rad, maxy);
}
else {
round_box_shade_col(colLeft, colRight, 0.0);
@@ -316,17 +316,17 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float
}
/* corner left-top */
- if(roundboxtype & UI_CNR_TOP_LEFT) {
- round_box_shade_col(colLeft, colRight, (div-rad)*idiv);
- glVertex2f(minx+rad, maxy);
+ if (roundboxtype & UI_CNR_TOP_LEFT) {
+ round_box_shade_col(colLeft, colRight, (div - rad) * idiv);
+ glVertex2f(minx + rad, maxy);
- for(a=0; a<7; a++) {
- round_box_shade_col(colLeft, colRight, (div-rad+vec[a][0])*idiv);
- glVertex2f(minx+rad-vec[a][0], maxy-vec[a][1]);
+ for (a = 0; a < 7; a++) {
+ round_box_shade_col(colLeft, colRight, (div - rad + vec[a][0]) * idiv);
+ glVertex2f(minx + rad - vec[a][0], maxy - vec[a][1]);
}
round_box_shade_col(colLeft, colRight, 1.0);
- glVertex2f(minx, maxy-rad);
+ glVertex2f(minx, maxy - rad);
}
else {
round_box_shade_col(colLeft, colRight, 1.0);
@@ -334,17 +334,17 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float
}
/* corner left-bottom */
- if(roundboxtype & UI_CNR_BOTTOM_LEFT) {
+ if (roundboxtype & UI_CNR_BOTTOM_LEFT) {
round_box_shade_col(colLeft, colRight, 1.0);
- glVertex2f(minx, miny+rad);
+ glVertex2f(minx, miny + rad);
- for(a=0; a<7; a++) {
- round_box_shade_col(colLeft, colRight, (vec[a][0])*idiv);
- glVertex2f(minx+vec[a][1], miny+rad-vec[a][0]);
+ for (a = 0; a < 7; a++) {
+ round_box_shade_col(colLeft, colRight, (vec[a][0]) * idiv);
+ glVertex2f(minx + vec[a][1], miny + rad - vec[a][0]);
}
round_box_shade_col(colLeft, colRight, 1.0);
- glVertex2f(minx+rad, miny);
+ glVertex2f(minx + rad, miny);
}
else {
round_box_shade_col(colLeft, colRight, 1.0);
@@ -360,21 +360,21 @@ void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad)
{
float color[4];
- if(roundboxtype & UI_RB_ALPHA) {
+ if (roundboxtype & UI_RB_ALPHA) {
glGetFloatv(GL_CURRENT_COLOR, color);
- color[3]= 0.5;
+ color[3] = 0.5;
glColor4fv(color);
- glEnable( GL_BLEND );
+ glEnable(GL_BLEND);
}
/* set antialias line */
- glEnable( GL_LINE_SMOOTH );
- glEnable( GL_BLEND );
+ glEnable(GL_LINE_SMOOTH);
+ glEnable(GL_BLEND);
uiDrawBox(GL_LINE_LOOP, minx, miny, maxx, maxy, rad);
- glDisable( GL_BLEND );
- glDisable( GL_LINE_SMOOTH );
+ glDisable(GL_BLEND);
+ glDisable(GL_LINE_SMOOTH);
}
/* (old, used in outliner) plain antialiased filled box */
@@ -382,11 +382,11 @@ void uiRoundBox(float minx, float miny, float maxx, float maxy, float rad)
{
float color[4];
- if(roundboxtype & UI_RB_ALPHA) {
+ if (roundboxtype & UI_RB_ALPHA) {
glGetFloatv(GL_CURRENT_COLOR, color);
- color[3]= 0.5;
+ color[3] = 0.5;
glColor4fv(color);
- glEnable( GL_BLEND );
+ glEnable(GL_BLEND);
}
ui_draw_anti_roundbox(GL_POLYGON, minx, miny, maxx, maxy, rad);
@@ -401,16 +401,16 @@ void uiEmboss(float x1, float y1, float x2, float y2, int sel)
{
/* below */
- if(sel) glColor3ub(200,200,200);
- else glColor3ub(50,50,50);
+ if (sel) glColor3ub(200, 200, 200);
+ else glColor3ub(50, 50, 50);
fdrawline(x1, y1, x2, y1);
/* right */
fdrawline(x2, y1, x2, y2);
/* top */
- if(sel) glColor3ub(50,50,50);
- else glColor3ub(200,200,200);
+ if (sel) glColor3ub(50, 50, 50);
+ else glColor3ub(200, 200, 200);
fdrawline(x1, y2, x2, y2);
/* left */
@@ -426,13 +426,14 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUSED(w
(void)rect;
(void)but;
#else
- ImBuf *ibuf= (ImBuf *)but->poin;
+ ImBuf *ibuf = (ImBuf *)but->poin;
//GLint scissor[4];
//int w, h;
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
}
@@ -476,8 +477,8 @@ static void ui_draw_but_CHARTAB(uiBut *but)
int charmax = G.charmax;
/* FO_BUILTIN_NAME font in use. There are TTF FO_BUILTIN_NAME and non-TTF FO_BUILTIN_NAME fonts */
- if(!strcmp(G.selfont->name, FO_BUILTIN_NAME)) {
- if(G.ui_international == TRUE) {
+ if (!strcmp(G.selfont->name, FO_BUILTIN_NAME)) {
+ if (G.ui_international == TRUE) {
charmax = 0xff;
}
else {
@@ -486,7 +487,7 @@ static void ui_draw_but_CHARTAB(uiBut *but)
}
/* Category list exited without selecting the area */
- if(G.charmax == 0)
+ if (G.charmax == 0)
charmax = G.charmax = 0xffff;
/* Calculate the size of the button */
@@ -505,9 +506,9 @@ static void ui_draw_but_CHARTAB(uiBut *but)
cs = G.charstart;
/* Set the font, in case it is not FO_BUILTIN_NAME font */
- if(G.selfont && strcmp(G.selfont->name, FO_BUILTIN_NAME)) {
+ if (G.selfont && strcmp(G.selfont->name, FO_BUILTIN_NAME)) {
// Is the font file packed, if so then use the packed file
- if(G.selfont->packedfile) {
+ if (G.selfont->packedfile) {
pf = G.selfont->packedfile;
FTF_SetFont(pf->data, pf->size, 14.0);
}
@@ -521,7 +522,7 @@ static void ui_draw_but_CHARTAB(uiBut *but)
}
}
else {
- if(G.ui_international == TRUE) {
+ if (G.ui_international == TRUE) {
FTF_SetFont((unsigned char *) datatoc_bfont_ttf, datatoc_bfont_ttf_size, 14.0);
}
}
@@ -533,47 +534,44 @@ static void ui_draw_but_CHARTAB(uiBut *but)
glRectf((rect->xmin), (rect->ymin), (rect->xmax), (rect->ymax));
glColor3ub(0, 0, 0);
- for(y = 0; y < 6; y++) {
+ for (y = 0; y < 6; y++) {
// Do not draw more than the category allows
- if(cs > charmax) break;
+ if (cs > charmax) break;
- for(x = 0; x < 12; x++)
+ for (x = 0; x < 12; x++)
{
// Do not draw more than the category allows
- if(cs > charmax) break;
+ if (cs > charmax) break;
// Draw one grid cell
glBegin(GL_LINE_LOOP);
- glVertex2f(sx, sy);
- glVertex2f(ex, sy);
- glVertex2f(ex, ey);
- glVertex2f(sx, ey);
+ glVertex2f(sx, sy);
+ glVertex2f(ex, sy);
+ glVertex2f(ex, ey);
+ glVertex2f(sx, ey);
glEnd();
// Draw character inside the cell
- memset(wstr, 0, sizeof(wchar_t)*2);
+ memset(wstr, 0, sizeof(wchar_t) * 2);
memset(ustr, 0, 16);
// 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;
@@ -582,26 +580,25 @@ static void ui_draw_but_CHARTAB(uiBut *but)
// Calculate the position
wid = FTF_GetStringWidth((char *) ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
- FTF_GetBoundingBox((char *) ustr, &llx,&lly,&llz,&urx,&ury,&urz, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
- dx = urx-llx;
- dy = ury-lly;
+ FTF_GetBoundingBox((char *) ustr, &llx, &lly, &llz, &urx, &ury, &urz, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
+ dx = urx - llx;
+ dy = ury - lly;
// This isn't fully functional since the but->aspect isn't working like I suspected
- px = sx + ((butw/but->aspect)-dx)/2;
- py = sy + ((buth/but->aspect)-dy)/2;
+ px = sx + ((butw / but->aspect) - dx) / 2;
+ py = sy + ((buth / but->aspect) - dy) / 2;
// Set the position and draw the character
ui_rasterpos_safe(px, py, but->aspect);
FTF_DrawString((char *) ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
}
- else
- {
- ui_rasterpos_safe(sx + butw/2, sy + buth/2, but->aspect);
+ else {
+ ui_rasterpos_safe(sx + butw / 2, sy + buth / 2, but->aspect);
UI_DrawString(but->font, (char *) ustr, 0);
}
// Calculate the next position and character
- sx += butw; ex +=butw;
+ sx += butw; ex += butw;
cs++;
}
/* Add the y position and reset x position */
@@ -613,7 +610,7 @@ static void ui_draw_but_CHARTAB(uiBut *but)
glShadeModel(GL_FLAT);
/* Return Font Settings to original */
- if(U.fontsize && U.fontname[0]) {
+ if (U.fontsize && U.fontname[0]) {
result = FTF_SetFont((unsigned char *)U.fontname, 0, U.fontsize);
}
else if (U.fontsize) {
@@ -625,7 +622,7 @@ static void ui_draw_but_CHARTAB(uiBut *but)
}
/* resets the font size */
- if(G.ui_international == TRUE) {
+ if (G.ui_international == TRUE) {
// uiSetCurFont(but->block, UI_HELV);
}
}
@@ -640,23 +637,23 @@ static void draw_scope_end(rctf *rect, GLint *scissor)
/* restore scissortest */
glScissor(scissor[0], scissor[1], scissor[2], scissor[3]);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
/* scale widget */
- scaler_x1 = rect->xmin + (rect->xmax - rect->xmin)/2 - SCOPE_RESIZE_PAD;
- scaler_x2 = rect->xmin + (rect->xmax - rect->xmin)/2 + SCOPE_RESIZE_PAD;
+ scaler_x1 = rect->xmin + (rect->xmax - rect->xmin) / 2 - SCOPE_RESIZE_PAD;
+ scaler_x2 = rect->xmin + (rect->xmax - rect->xmin) / 2 + SCOPE_RESIZE_PAD;
glColor4f(0.f, 0.f, 0.f, 0.25f);
- fdrawline(scaler_x1, rect->ymin-4, scaler_x2, rect->ymin-4);
- fdrawline(scaler_x1, rect->ymin-7, scaler_x2, rect->ymin-7);
+ fdrawline(scaler_x1, rect->ymin - 4, scaler_x2, rect->ymin - 4);
+ fdrawline(scaler_x1, rect->ymin - 7, scaler_x2, rect->ymin - 7);
glColor4f(1.f, 1.f, 1.f, 0.25f);
- fdrawline(scaler_x1, rect->ymin-5, scaler_x2, rect->ymin-5);
- fdrawline(scaler_x1, rect->ymin-8, scaler_x2, rect->ymin-8);
+ fdrawline(scaler_x1, rect->ymin - 5, scaler_x2, rect->ymin - 5);
+ fdrawline(scaler_x1, rect->ymin - 8, scaler_x2, rect->ymin - 8);
/* outline */
glColor4f(0.f, 0.f, 0.f, 0.5f);
uiSetRoundBox(UI_CNR_ALL);
- uiDrawBox(GL_LINE_LOOP, rect->xmin-1, rect->ymin, rect->xmax+1, rect->ymax+1, 3.0f);
+ uiDrawBox(GL_LINE_LOOP, rect->xmin - 1, rect->ymin, rect->xmax + 1, rect->ymax + 1, 3.0f);
}
static void histogram_draw_one(float r, float g, float b, float alpha, float x, float y, float w, float h, float *data, int res)
@@ -670,10 +667,10 @@ static void histogram_draw_one(float r, float g, float b, float alpha, float x,
glShadeModel(GL_FLAT);
glBegin(GL_QUAD_STRIP);
glVertex2f(x, y);
- glVertex2f(x, y + (data[0]*h));
- for (i=1; i < res; i++) {
- float x2 = x + i * (w/(float)res);
- glVertex2f(x2, y + (data[i]*h));
+ glVertex2f(x, y + (data[0] * h));
+ for (i = 1; i < res; i++) {
+ float x2 = x + i * (w / (float)res);
+ glVertex2f(x2, y + (data[i] * h));
glVertex2f(x2, y);
}
glEnd();
@@ -684,9 +681,9 @@ static void histogram_draw_one(float r, float g, float b, float alpha, float x,
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_LINE_SMOOTH);
glBegin(GL_LINE_STRIP);
- for (i=0; i < res; i++) {
- float x2 = x + i * (w/(float)res);
- glVertex2f(x2, y + (data[i]*h));
+ for (i = 0; i < res; i++) {
+ float x2 = x + i * (w / (float)res);
+ glVertex2f(x2, y + (data[i] * h));
}
glEnd();
glDisable(GL_LINE_SMOOTH);
@@ -702,30 +699,30 @@ void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol)
//float alpha;
GLint scissor[4];
- rect.xmin = (float)recti->xmin+1;
- rect.xmax = (float)recti->xmax-1;
- rect.ymin = (float)recti->ymin+SCOPE_RESIZE_PAD+2;
- rect.ymax = (float)recti->ymax-1;
+ rect.xmin = (float)recti->xmin + 1;
+ rect.xmax = (float)recti->xmax - 1;
+ rect.ymin = (float)recti->ymin + SCOPE_RESIZE_PAD + 2;
+ rect.ymax = (float)recti->ymax - 1;
w = rect.xmax - rect.xmin;
h = (rect.ymax - rect.ymin) * hist->ymax;
glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(0.f, 0.f, 0.f, 0.3f);
uiSetRoundBox(UI_CNR_ALL);
- uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f);
+ uiDrawBox(GL_POLYGON, rect.xmin - 1, rect.ymin - 1, rect.xmax + 1, rect.ymax + 1, 3.0f);
/* need scissor test, histogram can draw outside of boundary */
glGetIntegerv(GL_VIEWPORT, scissor);
- glScissor(ar->winrct.xmin + (rect.xmin-1), ar->winrct.ymin+(rect.ymin-1), (rect.xmax+1)-(rect.xmin-1), (rect.ymax+1)-(rect.ymin-1));
+ glScissor(ar->winrct.xmin + (rect.xmin - 1), ar->winrct.ymin + (rect.ymin - 1), (rect.xmax + 1) - (rect.xmin - 1), (rect.ymax + 1) - (rect.ymin - 1));
glColor4f(1.f, 1.f, 1.f, 0.08f);
/* draw grid lines here */
- for (i=1; i<4; i++) {
- fdrawline(rect.xmin, rect.ymin+(i/4.f)*h, rect.xmax, rect.ymin+(i/4.f)*h);
- fdrawline(rect.xmin+(i/4.f)*w, rect.ymin, rect.xmin+(i/4.f)*w, rect.ymax);
+ for (i = 1; i < 4; i++) {
+ fdrawline(rect.xmin, rect.ymin + (i / 4.f) * h, rect.xmax, rect.ymin + (i / 4.f) * h);
+ fdrawline(rect.xmin + (i / 4.f) * w, rect.ymin, rect.xmin + (i / 4.f) * w, rect.ymax);
}
if (hist->mode == HISTO_MODE_LUMA)
@@ -750,88 +747,88 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol),
int i, c;
float w, w3, h, alpha, yofs;
GLint scissor[4];
- float colors[3][3]= MAT3_UNITY;
- float colorsycc[3][3] = {{1,0,1},{1,1,0},{0,1,1}};
+ float colors[3][3] = MAT3_UNITY;
+ float colorsycc[3][3] = {{1, 0, 1}, {1, 1, 0}, {0, 1, 1}};
float colors_alpha[3][3], colorsycc_alpha[3][3]; /* colors pre multiplied by alpha for speed up */
float min, max;
- if (scopes==NULL) return;
-
- rect.xmin = (float)recti->xmin+1;
- rect.xmax = (float)recti->xmax-1;
- rect.ymin = (float)recti->ymin+SCOPE_RESIZE_PAD+2;
- rect.ymax = (float)recti->ymax-1;
+ if (scopes == NULL) return;
- if (scopes->wavefrm_yfac < 0.5f )
- scopes->wavefrm_yfac =0.98f;
- w = rect.xmax - rect.xmin-7;
- h = (rect.ymax - rect.ymin)*scopes->wavefrm_yfac;
- yofs= rect.ymin + (rect.ymax - rect.ymin -h)/2.0f;
- w3=w/3.0f;
+ rect.xmin = (float)recti->xmin + 1;
+ rect.xmax = (float)recti->xmax - 1;
+ rect.ymin = (float)recti->ymin + SCOPE_RESIZE_PAD + 2;
+ rect.ymax = (float)recti->ymax - 1;
+
+ if (scopes->wavefrm_yfac < 0.5f)
+ scopes->wavefrm_yfac = 0.98f;
+ w = rect.xmax - rect.xmin - 7;
+ h = (rect.ymax - rect.ymin) * scopes->wavefrm_yfac;
+ yofs = rect.ymin + (rect.ymax - rect.ymin - h) / 2.0f;
+ w3 = w / 3.0f;
/* log scale for alpha */
- alpha = scopes->wavefrm_alpha*scopes->wavefrm_alpha;
+ alpha = scopes->wavefrm_alpha * scopes->wavefrm_alpha;
- for(c=0; c<3; c++) {
- for(i=0; i<3; i++) {
+ for (c = 0; c < 3; c++) {
+ for (i = 0; i < 3; i++) {
colors_alpha[c][i] = colors[c][i] * alpha;
colorsycc_alpha[c][i] = colorsycc[c][i] * alpha;
}
}
glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(0.f, 0.f, 0.f, 0.3f);
uiSetRoundBox(UI_CNR_ALL);
- uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f);
+ uiDrawBox(GL_POLYGON, rect.xmin - 1, rect.ymin - 1, rect.xmax + 1, rect.ymax + 1, 3.0f);
/* need scissor test, waveform can draw outside of boundary */
glGetIntegerv(GL_VIEWPORT, scissor);
- glScissor(ar->winrct.xmin + (rect.xmin-1), ar->winrct.ymin+(rect.ymin-1), (rect.xmax+1)-(rect.xmin-1), (rect.ymax+1)-(rect.ymin-1));
+ glScissor(ar->winrct.xmin + (rect.xmin - 1), ar->winrct.ymin + (rect.ymin - 1), (rect.xmax + 1) - (rect.xmin - 1), (rect.ymax + 1) - (rect.ymin - 1));
glColor4f(1.f, 1.f, 1.f, 0.08f);
/* draw grid lines here */
- for (i=0; i<6; i++) {
+ for (i = 0; i < 6; i++) {
char str[4];
- BLI_snprintf(str, sizeof(str), "%-3d",i*20);
- str[3]='\0';
- fdrawline(rect.xmin+22, yofs+(i/5.f)*h, rect.xmax+1, yofs+(i/5.f)*h);
- BLF_draw_default(rect.xmin+1, yofs-5+(i/5.f)*h, 0, str, sizeof(str)-1);
+ BLI_snprintf(str, sizeof(str), "%-3d", i * 20);
+ str[3] = '\0';
+ fdrawline(rect.xmin + 22, yofs + (i / 5.f) * h, rect.xmax + 1, yofs + (i / 5.f) * h);
+ BLF_draw_default(rect.xmin + 1, yofs - 5 + (i / 5.f) * h, 0, str, sizeof(str) - 1);
/* in the loop because blf_draw reset it */
glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
/* 3 vertical separation */
- if (scopes->wavefrm_mode!= SCOPES_WAVEFRM_LUMA) {
- for (i=1; i<3; i++) {
- fdrawline(rect.xmin+i*w3, rect.ymin, rect.xmin+i*w3, rect.ymax);
+ if (scopes->wavefrm_mode != SCOPES_WAVEFRM_LUMA) {
+ for (i = 1; i < 3; i++) {
+ fdrawline(rect.xmin + i * w3, rect.ymin, rect.xmin + i * w3, rect.ymax);
}
}
/* separate min max zone on the right */
- fdrawline(rect.xmin+w, rect.ymin, rect.xmin+w, rect.ymax);
+ fdrawline(rect.xmin + w, rect.ymin, rect.xmin + w, rect.ymax);
/* 16-235-240 level in case of ITU-R BT601/709 */
glColor4f(1.f, 0.4f, 0.f, 0.2f);
- if (ELEM(scopes->wavefrm_mode, SCOPES_WAVEFRM_YCC_601, SCOPES_WAVEFRM_YCC_709)){
- fdrawline(rect.xmin+22, yofs+h*16.0f/255.0f, rect.xmax+1, yofs+h*16.0f/255.0f);
- fdrawline(rect.xmin+22, yofs+h*235.0f/255.0f, rect.xmin+w3, yofs+h*235.0f/255.0f);
- fdrawline(rect.xmin+3*w3, yofs+h*235.0f/255.0f, rect.xmax+1, yofs+h*235.0f/255.0f);
- fdrawline(rect.xmin+w3, yofs+h*240.0f/255.0f, rect.xmax+1, yofs+h*240.0f/255.0f);
+ if (ELEM(scopes->wavefrm_mode, SCOPES_WAVEFRM_YCC_601, SCOPES_WAVEFRM_YCC_709)) {
+ fdrawline(rect.xmin + 22, yofs + h * 16.0f / 255.0f, rect.xmax + 1, yofs + h * 16.0f / 255.0f);
+ fdrawline(rect.xmin + 22, yofs + h * 235.0f / 255.0f, rect.xmin + w3, yofs + h * 235.0f / 255.0f);
+ fdrawline(rect.xmin + 3 * w3, yofs + h * 235.0f / 255.0f, rect.xmax + 1, yofs + h * 235.0f / 255.0f);
+ fdrawline(rect.xmin + w3, yofs + h * 240.0f / 255.0f, rect.xmax + 1, yofs + h * 240.0f / 255.0f);
}
/* 7.5 IRE black point level for NTSC */
- if (scopes->wavefrm_mode== SCOPES_WAVEFRM_LUMA)
- fdrawline(rect.xmin, yofs+h*0.075f, rect.xmax+1, yofs+h*0.075f);
+ if (scopes->wavefrm_mode == SCOPES_WAVEFRM_LUMA)
+ fdrawline(rect.xmin, yofs + h * 0.075f, rect.xmax + 1, yofs + h * 0.075f);
if (scopes->ok && scopes->waveform_1 != NULL) {
/* LUMA (1 channel) */
- glBlendFunc(GL_ONE,GL_ONE);
+ glBlendFunc(GL_ONE, GL_ONE);
glColor3f(alpha, alpha, alpha);
- if (scopes->wavefrm_mode == SCOPES_WAVEFRM_LUMA){
+ if (scopes->wavefrm_mode == SCOPES_WAVEFRM_LUMA) {
- glBlendFunc(GL_ONE,GL_ONE);
+ glBlendFunc(GL_ONE, GL_ONE);
glPushMatrix();
glEnableClientState(GL_VERTEX_ARRAY);
@@ -846,18 +843,18 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol),
/* min max */
glColor3f(.5f, .5f, .5f);
- min= yofs+scopes->minmax[0][0]*h;
- max= yofs+scopes->minmax[0][1]*h;
+ min = yofs + scopes->minmax[0][0] * h;
+ max = yofs + scopes->minmax[0][1] * h;
CLAMP(min, rect.ymin, rect.ymax);
CLAMP(max, rect.ymin, rect.ymax);
- fdrawline(rect.xmax-3,min,rect.xmax-3,max);
+ fdrawline(rect.xmax - 3, min, rect.xmax - 3, max);
}
/* RGB / YCC (3 channels) */
else if (ELEM4(scopes->wavefrm_mode, SCOPES_WAVEFRM_RGB, SCOPES_WAVEFRM_YCC_601, SCOPES_WAVEFRM_YCC_709, SCOPES_WAVEFRM_YCC_JPEG)) {
int rgb = (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB);
- glBlendFunc(GL_ONE,GL_ONE);
+ glBlendFunc(GL_ONE, GL_ONE);
glPushMatrix();
glEnableClientState(GL_VERTEX_ARRAY);
@@ -865,17 +862,17 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol),
glTranslatef(rect.xmin, yofs, 0.f);
glScalef(w3, h, 0.f);
- glColor3fv((rgb)?colors_alpha[0]:colorsycc_alpha[0]);
+ glColor3fv((rgb) ? colors_alpha[0] : colorsycc_alpha[0]);
glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_1);
glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
glTranslatef(1.f, 0.f, 0.f);
- glColor3fv((rgb)?colors_alpha[1]:colorsycc_alpha[1]);
+ glColor3fv((rgb) ? colors_alpha[1] : colorsycc_alpha[1]);
glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_2);
glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
glTranslatef(1.f, 0.f, 0.f);
- glColor3fv((rgb)?colors_alpha[2]:colorsycc_alpha[2]);
+ glColor3fv((rgb) ? colors_alpha[2] : colorsycc_alpha[2]);
glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_3);
glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
@@ -884,16 +881,16 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol),
/* min max */
- for (c=0; c<3; c++) {
+ for (c = 0; c < 3; c++) {
if (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB)
- glColor3f(colors[c][0]*0.75f, colors[c][1]*0.75f, colors[c][2]*0.75f);
+ glColor3f(colors[c][0] * 0.75f, colors[c][1] * 0.75f, colors[c][2] * 0.75f);
else
- glColor3f(colorsycc[c][0]*0.75f, colorsycc[c][1]*0.75f, colorsycc[c][2]*0.75f);
- min= yofs+scopes->minmax[c][0]*h;
- max= yofs+scopes->minmax[c][1]*h;
+ glColor3f(colorsycc[c][0] * 0.75f, colorsycc[c][1] * 0.75f, colorsycc[c][2] * 0.75f);
+ min = yofs + scopes->minmax[c][0] * h;
+ max = yofs + scopes->minmax[c][1] * h;
CLAMP(min, rect.ymin, rect.ymax);
CLAMP(max, rect.ymin, rect.ymax);
- fdrawline(rect.xmin+w+2+c*2,min,rect.xmin+w+2+c*2,max);
+ fdrawline(rect.xmin + w + 2 + c * 2, min, rect.xmin + w + 2 + c * 2, max);
}
}
@@ -905,128 +902,128 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol),
static float polar_to_x(float center, float diam, float ampli, float angle)
{
- return center + diam * ampli * cosf(angle);
+ return center + diam *ampli *cosf(angle);
}
static float polar_to_y(float center, float diam, float ampli, float angle)
{
- return center + diam * ampli * sinf(angle);
+ return center + diam *ampli *sinf(angle);
}
static void vectorscope_draw_target(float centerx, float centery, float diam, const float colf[3])
{
- float y,u,v;
- float tangle=0.f, tampli;
+ float y, u, v;
+ float tangle = 0.f, tampli;
float dangle, dampli, dangle2, dampli2;
rgb_to_yuv(colf[0], colf[1], colf[2], &y, &u, &v);
- if (u>0 && v>=0) tangle=atanf(v/u);
- else if (u>0 && v<0) tangle= atanf(v/u) + 2.0f * (float)M_PI;
- else if (u<0) tangle=atanf(v/u) + (float)M_PI;
- else if (u==0 && v > 0.0f) tangle= (float)M_PI/2.0f;
- else if (u==0 && v < 0.0f) tangle=-(float)M_PI/2.0f;
- tampli= sqrtf(u*u+v*v);
+ if (u > 0 && v >= 0) tangle = atanf(v / u);
+ else if (u > 0 && v < 0) tangle = atanf(v / u) + 2.0f * (float)M_PI;
+ else if (u < 0) tangle = atanf(v / u) + (float)M_PI;
+ else if (u == 0 && v > 0.0f) tangle = (float)M_PI / 2.0f;
+ else if (u == 0 && v < 0.0f) tangle = -(float)M_PI / 2.0f;
+ tampli = sqrtf(u * u + v * v);
/* small target vary by 2.5 degree and 2.5 IRE unit */
glColor4f(1.0f, 1.0f, 1.0, 0.12f);
- dangle= DEG2RADF(2.5f);
- dampli= 2.5f/200.0f;
+ dangle = DEG2RADF(2.5f);
+ dampli = 2.5f / 200.0f;
glBegin(GL_LINE_STRIP);
- glVertex2f(polar_to_x(centerx,diam,tampli+dampli,tangle+dangle), polar_to_y(centery,diam,tampli+dampli,tangle+dangle));
- glVertex2f(polar_to_x(centerx,diam,tampli-dampli,tangle+dangle), polar_to_y(centery,diam,tampli-dampli,tangle+dangle));
- glVertex2f(polar_to_x(centerx,diam,tampli-dampli,tangle-dangle), polar_to_y(centery,diam,tampli-dampli,tangle-dangle));
- glVertex2f(polar_to_x(centerx,diam,tampli+dampli,tangle-dangle), polar_to_y(centery,diam,tampli+dampli,tangle-dangle));
- glVertex2f(polar_to_x(centerx,diam,tampli+dampli,tangle+dangle), polar_to_y(centery,diam,tampli+dampli,tangle+dangle));
+ glVertex2f(polar_to_x(centerx, diam, tampli + dampli, tangle + dangle), polar_to_y(centery, diam, tampli + dampli, tangle + dangle));
+ glVertex2f(polar_to_x(centerx, diam, tampli - dampli, tangle + dangle), polar_to_y(centery, diam, tampli - dampli, tangle + dangle));
+ glVertex2f(polar_to_x(centerx, diam, tampli - dampli, tangle - dangle), polar_to_y(centery, diam, tampli - dampli, tangle - dangle));
+ glVertex2f(polar_to_x(centerx, diam, tampli + dampli, tangle - dangle), polar_to_y(centery, diam, tampli + dampli, tangle - dangle));
+ glVertex2f(polar_to_x(centerx, diam, tampli + dampli, tangle + dangle), polar_to_y(centery, diam, tampli + dampli, tangle + dangle));
glEnd();
/* big target vary by 10 degree and 20% amplitude */
glColor4f(1.0f, 1.0f, 1.0, 0.12f);
- dangle= DEG2RADF(10.0f);
- dampli= 0.2f*tampli;
- dangle2= DEG2RADF(5.0f);
- dampli2= 0.5f*dampli;
+ dangle = DEG2RADF(10.0f);
+ dampli = 0.2f * tampli;
+ dangle2 = DEG2RADF(5.0f);
+ dampli2 = 0.5f * dampli;
glBegin(GL_LINE_STRIP);
- glVertex2f(polar_to_x(centerx,diam,tampli+dampli-dampli2,tangle+dangle), polar_to_y(centery,diam,tampli+dampli-dampli2,tangle+dangle));
- glVertex2f(polar_to_x(centerx,diam,tampli+dampli,tangle+dangle), polar_to_y(centery,diam,tampli+dampli,tangle+dangle));
- glVertex2f(polar_to_x(centerx,diam,tampli+dampli,tangle+dangle-dangle2), polar_to_y(centery,diam,tampli+dampli,tangle+dangle-dangle2));
+ glVertex2f(polar_to_x(centerx, diam, tampli + dampli - dampli2, tangle + dangle), polar_to_y(centery, diam, tampli + dampli - dampli2, tangle + dangle));
+ glVertex2f(polar_to_x(centerx, diam, tampli + dampli, tangle + dangle), polar_to_y(centery, diam, tampli + dampli, tangle + dangle));
+ glVertex2f(polar_to_x(centerx, diam, tampli + dampli, tangle + dangle - dangle2), polar_to_y(centery, diam, tampli + dampli, tangle + dangle - dangle2));
glEnd();
glBegin(GL_LINE_STRIP);
- glVertex2f(polar_to_x(centerx,diam,tampli-dampli+dampli2,tangle+dangle), polar_to_y(centery ,diam,tampli-dampli+dampli2,tangle+dangle));
- glVertex2f(polar_to_x(centerx,diam,tampli-dampli,tangle+dangle), polar_to_y(centery,diam,tampli-dampli,tangle+dangle));
- glVertex2f(polar_to_x(centerx,diam,tampli-dampli,tangle+dangle-dangle2), polar_to_y(centery,diam,tampli-dampli,tangle+dangle-dangle2));
+ glVertex2f(polar_to_x(centerx, diam, tampli - dampli + dampli2, tangle + dangle), polar_to_y(centery, diam, tampli - dampli + dampli2, tangle + dangle));
+ glVertex2f(polar_to_x(centerx, diam, tampli - dampli, tangle + dangle), polar_to_y(centery, diam, tampli - dampli, tangle + dangle));
+ glVertex2f(polar_to_x(centerx, diam, tampli - dampli, tangle + dangle - dangle2), polar_to_y(centery, diam, tampli - dampli, tangle + dangle - dangle2));
glEnd();
glBegin(GL_LINE_STRIP);
- glVertex2f(polar_to_x(centerx,diam,tampli-dampli+dampli2,tangle-dangle), polar_to_y(centery,diam,tampli-dampli+dampli2,tangle-dangle));
- glVertex2f(polar_to_x(centerx,diam,tampli-dampli,tangle-dangle), polar_to_y(centery,diam,tampli-dampli,tangle-dangle));
- glVertex2f(polar_to_x(centerx,diam,tampli-dampli,tangle-dangle+dangle2), polar_to_y(centery,diam,tampli-dampli,tangle-dangle+dangle2));
+ glVertex2f(polar_to_x(centerx, diam, tampli - dampli + dampli2, tangle - dangle), polar_to_y(centery, diam, tampli - dampli + dampli2, tangle - dangle));
+ glVertex2f(polar_to_x(centerx, diam, tampli - dampli, tangle - dangle), polar_to_y(centery, diam, tampli - dampli, tangle - dangle));
+ glVertex2f(polar_to_x(centerx, diam, tampli - dampli, tangle - dangle + dangle2), polar_to_y(centery, diam, tampli - dampli, tangle - dangle + dangle2));
glEnd();
glBegin(GL_LINE_STRIP);
- glVertex2f(polar_to_x(centerx,diam,tampli+dampli-dampli2,tangle-dangle), polar_to_y(centery,diam,tampli+dampli-dampli2,tangle-dangle));
- glVertex2f(polar_to_x(centerx,diam,tampli+dampli,tangle-dangle), polar_to_y(centery,diam,tampli+dampli,tangle-dangle));
- glVertex2f(polar_to_x(centerx,diam,tampli+dampli,tangle-dangle+dangle2), polar_to_y(centery,diam,tampli+dampli,tangle-dangle+dangle2));
+ glVertex2f(polar_to_x(centerx, diam, tampli + dampli - dampli2, tangle - dangle), polar_to_y(centery, diam, tampli + dampli - dampli2, tangle - dangle));
+ glVertex2f(polar_to_x(centerx, diam, tampli + dampli, tangle - dangle), polar_to_y(centery, diam, tampli + dampli, tangle - dangle));
+ glVertex2f(polar_to_x(centerx, diam, tampli + dampli, tangle - dangle + dangle2), polar_to_y(centery, diam, tampli + dampli, tangle - dangle + dangle2));
glEnd();
}
void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *recti)
{
- const float skin_rad= DEG2RADF(123.0f); /* angle in radians of the skin tone line */
+ const float skin_rad = DEG2RADF(123.0f); /* angle in radians of the skin tone line */
Scopes *scopes = (Scopes *)but->poin;
rctf rect;
int i, j;
float w, h, centerx, centery, diam;
float alpha;
- const float colors[6][3]={{.75,0,0},{.75,.75,0},{0,.75,0},{0,.75,.75},{0,0,.75},{.75,0,.75}};
+ const float colors[6][3] = {{.75, 0, 0}, {.75, .75, 0}, {0, .75, 0}, {0, .75, .75}, {0, 0, .75}, {.75, 0, .75}};
GLint scissor[4];
- rect.xmin = (float)recti->xmin+1;
- rect.xmax = (float)recti->xmax-1;
- rect.ymin = (float)recti->ymin+SCOPE_RESIZE_PAD+2;
- rect.ymax = (float)recti->ymax-1;
+ rect.xmin = (float)recti->xmin + 1;
+ rect.xmax = (float)recti->xmax - 1;
+ rect.ymin = (float)recti->ymin + SCOPE_RESIZE_PAD + 2;
+ rect.ymax = (float)recti->ymax - 1;
w = rect.xmax - rect.xmin;
h = rect.ymax - rect.ymin;
- centerx = rect.xmin + w/2;
- centery = rect.ymin + h/2;
- diam= (w<h)?w:h;
+ centerx = rect.xmin + w / 2;
+ centery = rect.ymin + h / 2;
+ diam = (w < h) ? w : h;
- alpha = scopes->vecscope_alpha*scopes->vecscope_alpha*scopes->vecscope_alpha;
+ alpha = scopes->vecscope_alpha * scopes->vecscope_alpha * scopes->vecscope_alpha;
glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(0.f, 0.f, 0.f, 0.3f);
uiSetRoundBox(UI_CNR_ALL);
- uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f);
+ uiDrawBox(GL_POLYGON, rect.xmin - 1, rect.ymin - 1, rect.xmax + 1, rect.ymax + 1, 3.0f);
/* need scissor test, hvectorscope can draw outside of boundary */
glGetIntegerv(GL_VIEWPORT, scissor);
- glScissor(ar->winrct.xmin + (rect.xmin-1), ar->winrct.ymin+(rect.ymin-1), (rect.xmax+1)-(rect.xmin-1), (rect.ymax+1)-(rect.ymin-1));
+ glScissor(ar->winrct.xmin + (rect.xmin - 1), ar->winrct.ymin + (rect.ymin - 1), (rect.xmax + 1) - (rect.xmin - 1), (rect.ymax + 1) - (rect.ymin - 1));
glColor4f(1.f, 1.f, 1.f, 0.08f);
/* draw grid elements */
/* cross */
- fdrawline(centerx - (diam/2)-5, centery, centerx + (diam/2)+5, centery);
- fdrawline(centerx, centery - (diam/2)-5, centerx, centery + (diam/2)+5);
+ fdrawline(centerx - (diam / 2) - 5, centery, centerx + (diam / 2) + 5, centery);
+ fdrawline(centerx, centery - (diam / 2) - 5, centerx, centery + (diam / 2) + 5);
/* circles */
- for(j=0; j<5; j++) {
+ for (j = 0; j < 5; j++) {
glBegin(GL_LINE_STRIP);
- for(i=0; i<=360; i=i+15) {
- const float a= DEG2RADF((float)i);
- const float r= (j+1)/10.0f;
- glVertex2f(polar_to_x(centerx,diam,r,a), polar_to_y(centery,diam,r,a));
+ for (i = 0; i <= 360; i = i + 15) {
+ const float a = DEG2RADF((float)i);
+ const float r = (j + 1) / 10.0f;
+ glVertex2f(polar_to_x(centerx, diam, r, a), polar_to_y(centery, diam, r, a));
}
glEnd();
}
/* skin tone line */
glColor4f(1.f, 0.4f, 0.f, 0.2f);
- fdrawline(polar_to_x(centerx, diam, 0.5f, skin_rad), polar_to_y(centery,diam,0.5,skin_rad),
- polar_to_x(centerx, diam, 0.1f, skin_rad), polar_to_y(centery,diam,0.1,skin_rad));
+ fdrawline(polar_to_x(centerx, diam, 0.5f, skin_rad), polar_to_y(centery, diam, 0.5, skin_rad),
+ polar_to_x(centerx, diam, 0.1f, skin_rad), polar_to_y(centery, diam, 0.1, skin_rad));
/* saturation points */
- for(i=0; i<6; i++)
+ for (i = 0; i < 6; i++)
vectorscope_draw_target(centerx, centery, diam, colors[i]);
if (scopes->ok && scopes->vecscope != NULL) {
/* pixel point cloud */
- glBlendFunc(GL_ONE,GL_ONE);
+ glBlendFunc(GL_ONE, GL_ONE);
glColor3f(alpha, alpha, alpha);
glPushMatrix();
@@ -1055,49 +1052,49 @@ 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 isn't valid */
- coba= (ColorBand *)(but->editcoba? but->editcoba: but->poin);
- if(coba==NULL) return;
+ coba = (ColorBand *)(but->editcoba ? but->editcoba : but->poin);
+ if (coba == NULL) return;
- x1= rect->xmin;
- y1= rect->ymin;
- sizex= rect->xmax-x1;
- sizey= rect->ymax-y1;
+ x1 = rect->xmin;
+ y1 = rect->ymin;
+ sizex = rect->xmax - x1;
+ sizey = rect->ymax - y1;
/* first background, to show tranparency */
glColor4ub(UI_TRANSP_DARK, UI_TRANSP_DARK, UI_TRANSP_DARK, 255);
- glRectf(x1, y1, x1+sizex, y1+sizey);
+ glRectf(x1, y1, x1 + sizex, y1 + sizey);
glEnable(GL_POLYGON_STIPPLE);
glColor4ub(UI_TRANSP_LIGHT, UI_TRANSP_LIGHT, UI_TRANSP_LIGHT, 255);
glPolygonStipple(checker_stipple_sml);
- glRectf(x1, y1, x1+sizex, y1+sizey);
+ glRectf(x1, y1, x1 + sizex, y1 + sizey);
glDisable(GL_POLYGON_STIPPLE);
glShadeModel(GL_FLAT);
glEnable(GL_BLEND);
- cbd= coba->data;
+ cbd = coba->data;
- v1[0]= v2[0]= x1;
- v1[1]= y1;
- v2[1]= y1+sizey;
+ v1[0] = v2[0] = x1;
+ v1[1] = y1;
+ v2[1] = y1 + sizey;
glBegin(GL_QUAD_STRIP);
- glColor4fv( &cbd->r );
+ glColor4fv(&cbd->r);
glVertex2fv(v1); glVertex2fv(v2);
- for( a = 1; a <= sizex; a++ ) {
- pos = ((float)a) / (sizex-1);
- do_colorband( coba, pos, colf );
+ for (a = 1; a <= sizex; a++) {
+ pos = ((float)a) / (sizex - 1);
+ do_colorband(coba, pos, colf);
if (but->block->color_profile != BLI_PR_NONE)
linearrgb_to_srgb_v3_v3(colf, colf);
- v1[0]=v2[0]= x1 + a;
+ v1[0] = v2[0] = x1 + a;
- glColor4fv( colf );
+ glColor4fv(colf);
glVertex2fv(v1); glVertex2fv(v2);
}
@@ -1107,23 +1104,23 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect)
/* outline */
glColor4f(0.0, 0.0, 0.0, 1.0);
- fdrawbox(x1, y1, x1+sizex, y1+sizey);
+ fdrawbox(x1, y1, x1 + sizex, y1 + sizey);
/* help lines */
- v1[0]= v2[0]=v3[0]= x1;
- v1[1]= y1;
- v1a[1]= y1+0.25f*sizey;
- v2[1]= y1+0.5f*sizey;
- v2a[1]= y1+0.75f*sizey;
- v3[1]= y1+sizey;
+ v1[0] = v2[0] = v3[0] = x1;
+ v1[1] = y1;
+ v1a[1] = y1 + 0.25f * sizey;
+ v2[1] = y1 + 0.5f * sizey;
+ v2a[1] = y1 + 0.75f * sizey;
+ v3[1] = y1 + sizey;
- cbd= coba->data;
+ cbd = coba->data;
glBegin(GL_LINES);
- for(a=0; a<coba->tot; a++, cbd++) {
- v1[0]=v2[0]=v3[0]=v1a[0]=v2a[0]= x1+ cbd->pos*sizex;
+ for (a = 0; a < coba->tot; a++, cbd++) {
+ v1[0] = v2[0] = v3[0] = v1a[0] = v2a[0] = x1 + cbd->pos * sizex;
- if(a==coba->cur) {
+ if (a == coba->cur) {
glColor3ub(0, 0, 0);
glVertex2fv(v1);
glVertex2fv(v3);
@@ -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);
@@ -1168,17 +1166,17 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect)
void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect)
{
- static GLuint displist=0;
+ static GLuint displist = 0;
int a, old[8];
- GLfloat diff[4], diffn[4]={1.0f, 1.0f, 1.0f, 1.0f};
- float vec0[4]={0.0f, 0.0f, 0.0f, 0.0f};
+ GLfloat diff[4], diffn[4] = {1.0f, 1.0f, 1.0f, 1.0f};
+ float vec0[4] = {0.0f, 0.0f, 0.0f, 0.0f};
float dir[4], size;
/* store stuff */
glGetMaterialfv(GL_FRONT, GL_DIFFUSE, diff);
/* backdrop */
- glColor3ubv((unsigned char*)wcol->inner);
+ glColor3ubv((unsigned char *)wcol->inner);
uiSetRoundBox(UI_CNR_ALL);
uiDrawBox(GL_POLYGON, rect->xmin, rect->ymin, rect->xmax, rect->ymax, 5.0f);
@@ -1187,9 +1185,9 @@ void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect)
glCullFace(GL_BACK); glEnable(GL_CULL_FACE);
/* disable blender light */
- for(a=0; a<8; a++) {
- old[a]= glIsEnabled(GL_LIGHT0+a);
- glDisable(GL_LIGHT0+a);
+ for (a = 0; a < 8; a++) {
+ old[a] = glIsEnabled(GL_LIGHT0 + a);
+ glDisable(GL_LIGHT0 + a);
}
/* own light */
@@ -1198,7 +1196,7 @@ void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect)
ui_get_but_vectorf(but, dir);
- dir[3]= 0.0f; /* glLight needs 4 args, 0.0 is sun */
+ dir[3] = 0.0f; /* glLight needs 4 args, 0.0 is sun */
glLightfv(GL_LIGHT7, GL_POSITION, dir);
glLightfv(GL_LIGHT7, GL_DIFFUSE, diffn);
glLightfv(GL_LIGHT7, GL_SPECULAR, vec0);
@@ -1207,25 +1205,25 @@ void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect)
/* transform to button */
glPushMatrix();
- glTranslatef(rect->xmin + 0.5f*(rect->xmax-rect->xmin), rect->ymin+ 0.5f*(rect->ymax-rect->ymin), 0.0f);
+ glTranslatef(rect->xmin + 0.5f * (rect->xmax - rect->xmin), rect->ymin + 0.5f * (rect->ymax - rect->ymin), 0.0f);
- if( rect->xmax-rect->xmin < rect->ymax-rect->ymin)
- size= (rect->xmax-rect->xmin)/200.f;
+ if (rect->xmax - rect->xmin < rect->ymax - rect->ymin)
+ size = (rect->xmax - rect->xmin) / 200.f;
else
- size= (rect->ymax-rect->ymin)/200.f;
+ size = (rect->ymax - rect->ymin) / 200.f;
glScalef(size, size, size);
- if(displist==0) {
- GLUquadricObj *qobj;
+ if (displist == 0) {
+ GLUquadricObj *qobj;
- displist= glGenLists(1);
+ displist = glGenLists(1);
glNewList(displist, GL_COMPILE_AND_EXECUTE);
- qobj= gluNewQuadric();
+ qobj = gluNewQuadric();
gluQuadricDrawStyle(qobj, GLU_FILL);
glShadeModel(GL_SMOOTH);
- gluSphere( qobj, 100.0, 32, 24);
+ gluSphere(qobj, 100.0, 32, 24);
glShadeModel(GL_FLAT);
gluDeleteQuadric(qobj);
@@ -1241,19 +1239,19 @@ void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect)
/* AA circle */
glEnable(GL_BLEND);
- glEnable(GL_LINE_SMOOTH );
- glColor3ubv((unsigned char*)wcol->inner);
- glutil_draw_lined_arc(0.0f, M_PI*2.0, 100.0f, 32);
+ glEnable(GL_LINE_SMOOTH);
+ glColor3ubv((unsigned char *)wcol->inner);
+ glutil_draw_lined_arc(0.0f, M_PI * 2.0, 100.0f, 32);
glDisable(GL_BLEND);
- glDisable(GL_LINE_SMOOTH );
+ glDisable(GL_LINE_SMOOTH);
/* matrix after circle */
glPopMatrix();
/* enable blender light */
- for(a=0; a<8; a++) {
- if(old[a])
- glEnable(GL_LIGHT0+a);
+ for (a = 0; a < 8; a++) {
+ if (old[a])
+ glEnable(GL_LIGHT0 + a);
}
}
@@ -1262,22 +1260,22 @@ static void ui_draw_but_curve_grid(rcti *rect, float zoomx, float zoomy, float o
float dx, dy, fx, fy;
glBegin(GL_LINES);
- dx= step*zoomx;
- fx= rect->xmin + zoomx*(-offsx);
- if(fx > rect->xmin) fx -= dx*(floorf(fx-rect->xmin));
- while(fx < rect->xmax) {
+ dx = step * zoomx;
+ fx = rect->xmin + zoomx * (-offsx);
+ if (fx > rect->xmin) fx -= dx * (floorf(fx - rect->xmin));
+ while (fx < rect->xmax) {
glVertex2f(fx, rect->ymin);
glVertex2f(fx, rect->ymax);
- fx+= dx;
+ fx += dx;
}
- dy= step*zoomy;
- fy= rect->ymin + zoomy*(-offsy);
- if(fy > rect->ymin) fy -= dy*(floorf(fy-rect->ymin));
- while(fy < rect->ymax) {
+ dy = step * zoomy;
+ fy = rect->ymin + zoomy * (-offsy);
+ if (fy > rect->ymin) fy -= dy * (floorf(fy - rect->ymin));
+ while (fy < rect->ymax) {
glVertex2f(rect->xmin, fy);
glVertex2f(rect->xmax, fy);
- fy+= dy;
+ fy += dy;
}
glEnd();
@@ -1285,9 +1283,9 @@ static void ui_draw_but_curve_grid(rcti *rect, float zoomx, float zoomy, float o
static void glColor3ubvShade(unsigned char *col, int shade)
{
- glColor3ub(col[0]-shade>0?col[0]-shade:0,
- col[1]-shade>0?col[1]-shade:0,
- col[2]-shade>0?col[2]-shade:0);
+ glColor3ub(col[0] - shade > 0 ? col[0] - shade : 0,
+ col[1] - shade > 0 ? col[1] - shade : 0,
+ col[2] - shade > 0 ? col[2] - shade : 0);
}
void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect)
@@ -1300,36 +1298,36 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
rcti scissor_new;
int a;
- cumap= (CurveMapping *)(but->editcumap? but->editcumap: but->poin);
- cuma= cumap->cm+cumap->cur;
+ cumap = (CurveMapping *)(but->editcumap ? but->editcumap : but->poin);
+ cuma = cumap->cm + cumap->cur;
/* need scissor test, curve can draw outside of boundary */
glGetIntegerv(GL_VIEWPORT, scissor);
- scissor_new.xmin= ar->winrct.xmin + rect->xmin;
- scissor_new.ymin= ar->winrct.ymin + rect->ymin;
- scissor_new.xmax= ar->winrct.xmin + rect->xmax;
- scissor_new.ymax= ar->winrct.ymin + rect->ymax;
+ scissor_new.xmin = ar->winrct.xmin + rect->xmin;
+ scissor_new.ymin = ar->winrct.ymin + rect->ymin;
+ scissor_new.xmax = ar->winrct.xmin + rect->xmax;
+ scissor_new.ymax = ar->winrct.ymin + rect->ymax;
BLI_isect_rcti(&scissor_new, &ar->winrct, &scissor_new);
- glScissor(scissor_new.xmin, scissor_new.ymin, scissor_new.xmax-scissor_new.xmin, scissor_new.ymax-scissor_new.ymin);
+ glScissor(scissor_new.xmin, scissor_new.ymin, scissor_new.xmax - scissor_new.xmin, scissor_new.ymax - scissor_new.ymin);
/* calculate offset and zoom */
- zoomx= (rect->xmax-rect->xmin-2.0f*but->aspect)/(cumap->curr.xmax - cumap->curr.xmin);
- zoomy= (rect->ymax-rect->ymin-2.0f*but->aspect)/(cumap->curr.ymax - cumap->curr.ymin);
- offsx= cumap->curr.xmin-but->aspect/zoomx;
- offsy= cumap->curr.ymin-but->aspect/zoomy;
+ zoomx = (rect->xmax - rect->xmin - 2.0f * but->aspect) / (cumap->curr.xmax - cumap->curr.xmin);
+ zoomy = (rect->ymax - rect->ymin - 2.0f * but->aspect) / (cumap->curr.ymax - cumap->curr.ymin);
+ offsx = cumap->curr.xmin - but->aspect / zoomx;
+ offsy = cumap->curr.ymin - but->aspect / zoomy;
/* backdrop */
- if(cumap->flag & CUMA_DO_CLIP) {
+ if (cumap->flag & CUMA_DO_CLIP) {
glColor3ubvShade((unsigned char *)wcol->inner, -20);
glRectf(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
- glColor3ubv((unsigned char*)wcol->inner);
- glRectf(rect->xmin + zoomx*(cumap->clipr.xmin-offsx),
- rect->ymin + zoomy*(cumap->clipr.ymin-offsy),
- rect->xmin + zoomx*(cumap->clipr.xmax-offsx),
- rect->ymin + zoomy*(cumap->clipr.ymax-offsy));
+ glColor3ubv((unsigned char *)wcol->inner);
+ glRectf(rect->xmin + zoomx * (cumap->clipr.xmin - offsx),
+ rect->ymin + zoomy * (cumap->clipr.ymin - offsy),
+ rect->xmin + zoomx * (cumap->clipr.xmax - offsx),
+ rect->ymin + zoomy * (cumap->clipr.ymax - offsy));
}
else {
- glColor3ubv((unsigned char*)wcol->inner);
+ glColor3ubv((unsigned char *)wcol->inner);
glRectf(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
}
@@ -1342,22 +1340,22 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
/* axes */
glColor3ubvShade((unsigned char *)wcol->inner, -50);
glBegin(GL_LINES);
- glVertex2f(rect->xmin, rect->ymin + zoomy*(-offsy));
- glVertex2f(rect->xmax, rect->ymin + zoomy*(-offsy));
- glVertex2f(rect->xmin + zoomx*(-offsx), rect->ymin);
- glVertex2f(rect->xmin + zoomx*(-offsx), rect->ymax);
+ glVertex2f(rect->xmin, rect->ymin + zoomy * (-offsy));
+ glVertex2f(rect->xmax, rect->ymin + zoomy * (-offsy));
+ glVertex2f(rect->xmin + zoomx * (-offsx), rect->ymin);
+ glVertex2f(rect->xmin + zoomx * (-offsx), rect->ymax);
glEnd();
/* magic trigger for curve backgrounds */
if (but->a1 != -1) {
if (but->a1 == UI_GRAD_H) {
rcti grid;
- float col[3]= {0.0f, 0.0f, 0.0f}; /* dummy arg */
+ float col[3] = {0.0f, 0.0f, 0.0f}; /* dummy arg */
- grid.xmin = rect->xmin + zoomx*(-offsx);
- grid.xmax = rect->xmax + zoomx*(-offsx);
- grid.ymin = rect->ymin + zoomy*(-offsy);
- grid.ymax = rect->ymax + zoomy*(-offsy);
+ grid.xmin = rect->xmin + zoomx * (-offsx);
+ grid.xmax = rect->xmax + zoomx * (-offsx);
+ grid.ymin = rect->ymin + zoomy * (-offsy);
+ grid.ymax = rect->ymax + zoomy * (-offsy);
glEnable(GL_BLEND);
ui_draw_gradient(&grid, col, UI_GRAD_H, 0.5f);
@@ -1367,70 +1365,75 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
/* cfra option */
- /* XXX 2.48
- if(cumap->flag & CUMA_DRAW_CFRA) {
+ /* 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);
+ 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) {
- if(cumap->cur==3) {
- float lum= cumap->sample[0]*0.35f + cumap->sample[1]*0.45f + cumap->sample[2]*0.2f;
+
+ /* 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);
glBegin(GL_LINES);
- glVertex2f(rect->xmin + zoomx*(lum-offsx), rect->ymin);
- glVertex2f(rect->xmin + zoomx*(lum-offsx), rect->ymax);
+ glVertex2f(rect->xmin + zoomx * (lum - offsx), rect->ymin);
+ glVertex2f(rect->xmin + zoomx * (lum - offsx), rect->ymax);
glEnd();
}
else {
- if(cumap->cur==0)
+ if (cumap->cur == 0)
glColor3ub(240, 100, 100);
- else if(cumap->cur==1)
+ else if (cumap->cur == 1)
glColor3ub(100, 240, 100);
else
glColor3ub(100, 100, 240);
glBegin(GL_LINES);
- glVertex2f(rect->xmin + zoomx*(cumap->sample[cumap->cur]-offsx), rect->ymin);
- glVertex2f(rect->xmin + zoomx*(cumap->sample[cumap->cur]-offsx), rect->ymax);
+ glVertex2f(rect->xmin + zoomx * (cumap->sample[cumap->cur] - offsx), rect->ymin);
+ glVertex2f(rect->xmin + zoomx * (cumap->sample[cumap->cur] - offsx), rect->ymax);
glEnd();
}
- }*/
-
+ }
+#endif
+
/* the curve */
- glColor3ubv((unsigned char*)wcol->item);
+ glColor3ubv((unsigned char *)wcol->item);
glEnable(GL_LINE_SMOOTH);
glEnable(GL_BLEND);
glBegin(GL_LINE_STRIP);
- if(cuma->table==NULL)
- curvemapping_changed(cumap, 0); /* 0 = no remove doubles */
- cmp= cuma->table;
+ if (cuma->table == NULL)
+ curvemapping_changed(cumap, 0); /* 0 = no remove doubles */
+ cmp = cuma->table;
/* first point */
- if((cuma->flag & CUMA_EXTEND_EXTRAPOLATE)==0)
- glVertex2f(rect->xmin, rect->ymin + zoomy*(cmp[0].y-offsy));
+ if ((cuma->flag & CUMA_EXTEND_EXTRAPOLATE) == 0)
+ glVertex2f(rect->xmin, rect->ymin + zoomy * (cmp[0].y - offsy));
else {
- fx= rect->xmin + zoomx*(cmp[0].x-offsx + cuma->ext_in[0]);
- fy= rect->ymin + zoomy*(cmp[0].y-offsy + cuma->ext_in[1]);
+ fx = rect->xmin + zoomx * (cmp[0].x - offsx + cuma->ext_in[0]);
+ fy = rect->ymin + zoomy * (cmp[0].y - offsy + cuma->ext_in[1]);
glVertex2f(fx, fy);
}
- for(a=0; a<=CM_TABLE; a++) {
- fx= rect->xmin + zoomx*(cmp[a].x-offsx);
- fy= rect->ymin + zoomy*(cmp[a].y-offsy);
+ for (a = 0; a <= CM_TABLE; a++) {
+ fx = rect->xmin + zoomx * (cmp[a].x - offsx);
+ fy = rect->ymin + zoomy * (cmp[a].y - offsy);
glVertex2f(fx, fy);
}
/* last point */
- if((cuma->flag & CUMA_EXTEND_EXTRAPOLATE)==0)
- glVertex2f(rect->xmax, rect->ymin + zoomy*(cmp[CM_TABLE].y-offsy));
+ if ((cuma->flag & CUMA_EXTEND_EXTRAPOLATE) == 0)
+ glVertex2f(rect->xmax, rect->ymin + zoomy * (cmp[CM_TABLE].y - offsy));
else {
- fx= rect->xmin + zoomx*(cmp[CM_TABLE].x-offsx - cuma->ext_out[0]);
- fy= rect->ymin + zoomy*(cmp[CM_TABLE].y-offsy - cuma->ext_out[1]);
+ fx = rect->xmin + zoomx * (cmp[CM_TABLE].x - offsx - cuma->ext_out[0]);
+ fy = rect->ymin + zoomy * (cmp[CM_TABLE].y - offsy - cuma->ext_out[1]);
glVertex2f(fx, fy);
}
glEnd();
@@ -1438,16 +1441,16 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
glDisable(GL_BLEND);
/* the points, use aspect to make them visible on edges */
- cmp= cuma->curve;
+ cmp = cuma->curve;
glPointSize(3.0f);
bglBegin(GL_POINTS);
- for(a=0; a<cuma->totpoint; a++) {
- if(cmp[a].flag & SELECT)
+ for (a = 0; a < cuma->totpoint; a++) {
+ if (cmp[a].flag & SELECT)
UI_ThemeColor(TH_TEXT_HI);
else
UI_ThemeColor(TH_TEXT);
- fac[0]= rect->xmin + zoomx*(cmp[a].x-offsx);
- fac[1]= rect->ymin + zoomy*(cmp[a].y-offsy);
+ fac[0] = rect->xmin + zoomx * (cmp[a].x - offsx);
+ fac[1] = rect->ymin + zoomy * (cmp[a].y - offsy);
bglVertex2fv(fac);
}
bglEnd();
@@ -1457,25 +1460,25 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
glScissor(scissor[0], scissor[1], scissor[2], scissor[3]);
/* outline */
- glColor3ubv((unsigned char*)wcol->outline);
+ glColor3ubv((unsigned char *)wcol->outline);
fdrawbox(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
}
static ImBuf *scale_trackpreview_ibuf(ImBuf *ibuf, float track_pos[2], int width, float height, int margin)
{
ImBuf *scaleibuf;
- const float scalex= ((float)ibuf->x-2*margin) / width;
- const float scaley= ((float)ibuf->y-2*margin) / height;
- float off_x= (int)track_pos[0]-track_pos[0]+0.5f;
- float off_y= (int)track_pos[1]-track_pos[1]+0.5f;
+ const float scalex = ((float)ibuf->x - 2 * margin) / width;
+ const float scaley = ((float)ibuf->y - 2 * margin) / height;
+ float off_x = (int)track_pos[0] - track_pos[0] + 0.5f;
+ float off_y = (int)track_pos[1] - track_pos[1] + 0.5f;
int x, y;
- scaleibuf= IMB_allocImBuf(width, height, 32, IB_rect);
+ scaleibuf = IMB_allocImBuf(width, height, 32, IB_rect);
- for(y= 0; y<height; y++) {
- for (x= 0; x<width; x++) {
- float src_x= scalex*(x)+margin-off_x;
- float src_y= scaley*(y)+margin-off_y;
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ float src_x = scalex * (x) + margin - off_x;
+ float src_y = scaley * (y) + margin - off_y;
bicubic_interpolation(ibuf, scaleibuf, src_x, src_y, x, y);
}
@@ -1487,67 +1490,67 @@ static ImBuf *scale_trackpreview_ibuf(ImBuf *ibuf, float track_pos[2], int width
void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *recti)
{
rctf rect;
- int ok= 0;
+ int ok = 0;
GLint scissor[4];
MovieClipScopes *scopes = (MovieClipScopes *)but->poin;
- rect.xmin = (float)recti->xmin+1;
- rect.xmax = (float)recti->xmax-1;
- rect.ymin = (float)recti->ymin+SCOPE_RESIZE_PAD+2;
- rect.ymax = (float)recti->ymax-1;
+ rect.xmin = (float)recti->xmin + 1;
+ rect.xmax = (float)recti->xmax - 1;
+ rect.ymin = (float)recti->ymin + SCOPE_RESIZE_PAD + 2;
+ rect.ymax = (float)recti->ymax - 1;
glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
/* need scissor test, preview image can draw outside of boundary */
glGetIntegerv(GL_VIEWPORT, scissor);
- glScissor(ar->winrct.xmin + (rect.xmin-1), ar->winrct.ymin+(rect.ymin-1), (rect.xmax+1)-(rect.xmin-1), (rect.ymax+1)-(rect.ymin-1));
+ glScissor(ar->winrct.xmin + (rect.xmin - 1), ar->winrct.ymin + (rect.ymin - 1), (rect.xmax + 1) - (rect.xmin - 1), (rect.ymax + 1) - (rect.ymin - 1));
- if(scopes->track_disabled) {
+ if (scopes->track_disabled) {
glColor4f(0.7f, 0.3f, 0.3f, 0.3f);
uiSetRoundBox(15);
- uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin, rect.xmax+1, rect.ymax+1, 3.0f);
+ uiDrawBox(GL_POLYGON, rect.xmin - 1, rect.ymin, rect.xmax + 1, rect.ymax + 1, 3.0f);
- ok= 1;
+ ok = 1;
}
- else if(scopes->track_preview) {
+ else if (scopes->track_preview) {
/* additional margin around image */
/* NOTE: should be kept in sync with value from BKE_movieclip_update_scopes */
- const int margin= 3;
+ const int margin = 3;
float zoomx, zoomy, track_pos[2], off_x, off_y;
int a, width, height;
ImBuf *drawibuf;
glPushMatrix();
- track_pos[0]= scopes->track_pos[0]-margin;
- track_pos[1]= scopes->track_pos[1]-margin;
+ track_pos[0] = scopes->track_pos[0] - margin;
+ track_pos[1] = scopes->track_pos[1] - margin;
/* draw content of pattern area */
- glScissor(ar->winrct.xmin+rect.xmin, ar->winrct.ymin+rect.ymin, scissor[2], scissor[3]);
+ glScissor(ar->winrct.xmin + rect.xmin, ar->winrct.ymin + rect.ymin, scissor[2], scissor[3]);
- width= rect.xmax-rect.xmin+1;
- height = rect.ymax-rect.ymin;
+ width = rect.xmax - rect.xmin + 1;
+ height = rect.ymax - rect.ymin;
- if(width > 0 && height > 0) {
- zoomx= (float)width / (scopes->track_preview->x-2*margin);
- zoomy= (float)height / (scopes->track_preview->y-2*margin);
+ if (width > 0 && height > 0) {
+ zoomx = (float)width / (scopes->track_preview->x - 2 * margin);
+ zoomy = (float)height / (scopes->track_preview->y - 2 * margin);
- off_x= ((int)track_pos[0]-track_pos[0]+0.5f)*zoomx;
- off_y= ((int)track_pos[1]-track_pos[1]+0.5f)*zoomy;
+ off_x = ((int)track_pos[0] - track_pos[0] + 0.5f) * zoomx;
+ off_y = ((int)track_pos[1] - track_pos[1] + 0.5f) * zoomy;
- drawibuf= scale_trackpreview_ibuf(scopes->track_preview, track_pos, width, height, margin);
+ drawibuf = scale_trackpreview_ibuf(scopes->track_preview, track_pos, width, height, margin);
- glaDrawPixelsSafe(rect.xmin, rect.ymin+1, drawibuf->x, drawibuf->y,
+ glaDrawPixelsSafe(rect.xmin, rect.ymin + 1, drawibuf->x, drawibuf->y,
drawibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, drawibuf->rect);
IMB_freeImBuf(drawibuf);
/* draw cross for pizel position */
- glTranslatef(off_x+rect.xmin+track_pos[0]*zoomx, off_y+rect.ymin+track_pos[1]*zoomy, 0.f);
- glScissor(ar->winrct.xmin + rect.xmin, ar->winrct.ymin+rect.ymin, rect.xmax-rect.xmin, rect.ymax-rect.ymin);
+ glTranslatef(off_x + rect.xmin + track_pos[0] * zoomx, off_y + rect.ymin + track_pos[1] * zoomy, 0.f);
+ glScissor(ar->winrct.xmin + rect.xmin, ar->winrct.ymin + rect.ymin, rect.xmax - rect.xmin, rect.ymax - rect.ymin);
- for(a= 0; a< 2; a++) {
- if(a==1) {
+ for (a = 0; a < 2; a++) {
+ if (a == 1) {
glLineStipple(3, 0xaaaa);
glEnable(GL_LINE_STIPPLE);
UI_ThemeColor(TH_SEL_MARKER);
@@ -1557,24 +1560,24 @@ void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wc
}
glBegin(GL_LINES);
- glVertex2f(-10.0f, 0.0f);
- glVertex2f(10.0f, 0.0f);
- glVertex2f(0.0f, -10.0f);
- glVertex2f(0.0f, 10.0f);
- glEnd();
+ glVertex2f(-10.0f, 0.0f);
+ glVertex2f(10.0f, 0.0f);
+ glVertex2f(0.0f, -10.0f);
+ glVertex2f(0.0f, 10.0f);
+ glEnd();
}
}
glDisable(GL_LINE_STIPPLE);
glPopMatrix();
- ok= 1;
+ ok = 1;
}
- if(!ok) {
+ if (!ok) {
glColor4f(0.f, 0.f, 0.f, 0.3f);
uiSetRoundBox(15);
- uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin, rect.xmax+1, rect.ymax+1, 3.0f);
+ uiDrawBox(GL_POLYGON, rect.xmin - 1, rect.ymin, rect.xmax + 1, rect.ymax + 1, 3.0f);
}
/* outline, scale gripper */
@@ -1595,10 +1598,10 @@ static void ui_shadowbox(float minx, float miny, float maxx, float maxy, float s
glBegin(GL_POLYGON);
glColor4ub(0, 0, 0, alpha);
glVertex2f(maxx, miny);
- glVertex2f(maxx, maxy-0.3f*shadsize);
+ glVertex2f(maxx, maxy - 0.3f * shadsize);
glColor4ub(0, 0, 0, 0);
- glVertex2f(maxx+shadsize, maxy-0.75f*shadsize);
- glVertex2f(maxx+shadsize, miny);
+ glVertex2f(maxx + shadsize, maxy - 0.75f * shadsize);
+ glVertex2f(maxx + shadsize, miny);
glEnd();
/* corner shape */
@@ -1606,19 +1609,19 @@ static void ui_shadowbox(float minx, float miny, float maxx, float maxy, float s
glColor4ub(0, 0, 0, alpha);
glVertex2f(maxx, miny);
glColor4ub(0, 0, 0, 0);
- glVertex2f(maxx+shadsize, miny);
- glVertex2f(maxx+0.7f*shadsize, miny-0.7f*shadsize);
- glVertex2f(maxx, miny-shadsize);
+ glVertex2f(maxx + shadsize, miny);
+ glVertex2f(maxx + 0.7f * shadsize, miny - 0.7f * shadsize);
+ glVertex2f(maxx, miny - shadsize);
glEnd();
/* bottom quad */
glBegin(GL_POLYGON);
glColor4ub(0, 0, 0, alpha);
- glVertex2f(minx+0.3f*shadsize, miny);
+ glVertex2f(minx + 0.3f * shadsize, miny);
glVertex2f(maxx, miny);
glColor4ub(0, 0, 0, 0);
- glVertex2f(maxx, miny-shadsize);
- glVertex2f(minx+0.5f*shadsize, miny-shadsize);
+ glVertex2f(maxx, miny - shadsize);
+ glVertex2f(minx + 0.5f * shadsize, miny - shadsize);
glEnd();
glDisable(GL_BLEND);
@@ -1628,9 +1631,9 @@ static void ui_shadowbox(float minx, float miny, float maxx, float maxy, float s
void uiDrawBoxShadow(unsigned char alpha, float minx, float miny, float maxx, float maxy)
{
/* accumulated outline boxes to make shade not linear, is more pleasant */
- ui_shadowbox(minx, miny, maxx, maxy, 11.0, (20*alpha)>>8);
- ui_shadowbox(minx, miny, maxx, maxy, 7.0, (40*alpha)>>8);
- ui_shadowbox(minx, miny, maxx, maxy, 5.0, (80*alpha)>>8);
+ ui_shadowbox(minx, miny, maxx, maxy, 11.0, (20 * alpha) >> 8);
+ ui_shadowbox(minx, miny, maxx, maxy, 7.0, (40 * alpha) >> 8);
+ ui_shadowbox(minx, miny, maxx, maxy, 5.0, (80 * alpha) >> 8);
}
@@ -1640,39 +1643,39 @@ void ui_dropshadow(rctf *rct, float radius, float aspect, int UNUSED(select))
int i;
float rad;
float a;
- char alpha= 2;
+ char alpha = 2;
glEnable(GL_BLEND);
- if(radius > (rct->ymax-rct->ymin-10.0f)/2.0f)
- rad= (rct->ymax-rct->ymin-10.0f)/2.0f;
+ if (radius > (rct->ymax - rct->ymin - 10.0f) / 2.0f)
+ rad = (rct->ymax - rct->ymin - 10.0f) / 2.0f;
else
- rad= radius;
+ rad = radius;
- i= 12;
+ i = 12;
#if 0
- if(select) {
- a= i*aspect; /* same as below */
+ if (select) {
+ a = i * aspect; /* same as below */
}
else
#endif
{
- a= i*aspect;
+ a = i * aspect;
}
- for(; i--; a-=aspect) {
+ for (; i--; a -= aspect) {
/* alpha ranges from 2 to 20 or so */
glColor4ub(0, 0, 0, alpha);
- alpha+= 2;
+ alpha += 2;
- uiDrawBox(GL_POLYGON, rct->xmin - a, rct->ymin - a, rct->xmax + a, rct->ymax-10.0f + a, rad+a);
+ uiDrawBox(GL_POLYGON, rct->xmin - a, rct->ymin - a, rct->xmax + a, rct->ymax - 10.0f + a, rad + a);
}
/* outline emphasis */
- glEnable( GL_LINE_SMOOTH );
+ glEnable(GL_LINE_SMOOTH);
glColor4ub(0, 0, 0, 100);
- uiDrawBox(GL_LINE_LOOP, rct->xmin-0.5f, rct->ymin-0.5f, rct->xmax+0.5f, rct->ymax+0.5f, radius+0.5f);
- glDisable( GL_LINE_SMOOTH );
+ uiDrawBox(GL_LINE_LOOP, rct->xmin - 0.5f, rct->ymin - 0.5f, rct->xmax + 0.5f, rct->ymax + 0.5f, radius + 0.5f);
+ glDisable(GL_LINE_SMOOTH);
glDisable(GL_BLEND);
}
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 2e0d4323fa5..887ae250c1b 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"
@@ -80,11 +81,11 @@ static void ui_add_link(bContext *C, uiBut *from, uiBut *to);
/***************** structs and defines ****************/
-#define BUTTON_TOOLTIP_DELAY 0.500
-#define BUTTON_FLASH_DELAY 0.020
-#define MENU_SCROLL_INTERVAL 0.1
-#define BUTTON_AUTO_OPEN_THRESH 0.3
-#define BUTTON_MOUSE_TOWARDS_THRESH 1.0
+#define BUTTON_TOOLTIP_DELAY 0.500
+#define BUTTON_FLASH_DELAY 0.020
+#define MENU_SCROLL_INTERVAL 0.1
+#define BUTTON_AUTO_OPEN_THRESH 0.3
+#define BUTTON_MOUSE_TOWARDS_THRESH 1.0
typedef enum uiButtonActivateType {
BUTTON_ACTIVATE_OVER,
@@ -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;
@@ -228,18 +212,18 @@ static int ui_but_editable(uiBut *but)
static uiBut *ui_but_prev(uiBut *but)
{
- while(but->prev) {
- but= but->prev;
- if(!ui_but_editable(but)) return but;
+ while (but->prev) {
+ but = but->prev;
+ if (!ui_but_editable(but)) return but;
}
return NULL;
}
static uiBut *ui_but_next(uiBut *but)
{
- while(but->next) {
- but= but->next;
- if(!ui_but_editable(but)) return but;
+ while (but->next) {
+ but = but->next;
+ if (!ui_but_editable(but)) return but;
}
return NULL;
}
@@ -248,10 +232,10 @@ static uiBut *ui_but_first(uiBlock *block)
{
uiBut *but;
- but= block->buttons.first;
- while(but) {
- if(!ui_but_editable(but)) return but;
- but= but->next;
+ but = block->buttons.first;
+ while (but) {
+ if (!ui_but_editable(but)) return but;
+ but = but->next;
}
return NULL;
}
@@ -260,18 +244,18 @@ static uiBut *ui_but_last(uiBlock *block)
{
uiBut *but;
- but= block->buttons.last;
- while(but) {
- if(!ui_but_editable(but)) return but;
- but= but->prev;
+ but = block->buttons.last;
+ while (but) {
+ if (!ui_but_editable(but)) return but;
+ but = but->prev;
}
return NULL;
}
static int ui_is_a_warp_but(uiBut *but)
{
- if(U.uiflag & USER_CONTINUOUS_MOUSE)
- if(ELEM4(but->type, NUM, NUMABS, HSVCIRCLE, TRACKPREVIEW))
+ if (U.uiflag & USER_CONTINUOUS_MOUSE)
+ if (ELEM4(but->type, NUM, NUMABS, HSVCIRCLE, TRACKPREVIEW))
return TRUE;
return FALSE;
@@ -281,7 +265,7 @@ static int ui_is_a_warp_but(uiBut *but)
int ui_is_but_utf8(uiBut *but)
{
if (but->rnaprop) {
- const int subtype= RNA_property_subtype(but->rnaprop);
+ const int subtype = RNA_property_subtype(but->rnaprop);
return !(ELEM4(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME, PROP_BYTESTRING));
}
else {
@@ -296,56 +280,56 @@ static ListBase UIAfterFuncs = {NULL, NULL};
static void ui_apply_but_func(bContext *C, uiBut *but)
{
uiAfterFunc *after;
- uiBlock *block= but->block;
+ uiBlock *block = but->block;
/* these functions are postponed and only executed after all other
* handling is done, i.e. menus are closed, in order to avoid conflicts
* with these functions removing the buttons we are working with */
- if(but->func || but->funcN || block->handle_func || but->rename_func || (but->type == BUTM && block->butm_func) || but->optype || but->rnaprop) {
- after= MEM_callocN(sizeof(uiAfterFunc), "uiAfterFunc");
+ if (but->func || but->funcN || block->handle_func || but->rename_func || (but->type == BUTM && block->butm_func) || but->optype || but->rnaprop) {
+ after = MEM_callocN(sizeof(uiAfterFunc), "uiAfterFunc");
- if(but->func && ELEM(but, but->func_arg1, but->func_arg2)) {
+ if (but->func && ELEM(but, but->func_arg1, but->func_arg2)) {
/* exception, this will crash due to removed button otherwise */
but->func(C, but->func_arg1, but->func_arg2);
}
else
- after->func= but->func;
+ after->func = but->func;
- after->func_arg1= but->func_arg1;
- after->func_arg2= but->func_arg2;
- after->func_arg3= but->func_arg3;
+ after->func_arg1 = but->func_arg1;
+ after->func_arg2 = but->func_arg2;
+ after->func_arg3 = but->func_arg3;
- after->funcN= but->funcN;
- after->func_argN= MEM_dupallocN(but->func_argN);
+ after->funcN = but->funcN;
+ after->func_argN = MEM_dupallocN(but->func_argN);
- after->rename_func= but->rename_func;
- after->rename_arg1= but->rename_arg1;
- after->rename_orig= but->rename_orig; /* needs free! */
-
- after->handle_func= block->handle_func;
- after->handle_func_arg= block->handle_func_arg;
- after->retval= but->retval;
+ after->rename_func = but->rename_func;
+ after->rename_arg1 = but->rename_arg1;
+ after->rename_orig = but->rename_orig; /* needs free! */
- if(but->type == BUTM) {
- after->butm_func= block->butm_func;
- after->butm_func_arg= block->butm_func_arg;
- after->a2= but->a2;
+ after->handle_func = block->handle_func;
+ after->handle_func_arg = block->handle_func_arg;
+ after->retval = but->retval;
+
+ if (but->type == BUTM) {
+ after->butm_func = block->butm_func;
+ after->butm_func_arg = block->butm_func_arg;
+ after->a2 = but->a2;
}
- after->optype= but->optype;
- after->opcontext= but->opcontext;
- after->opptr= but->opptr;
+ after->optype = but->optype;
+ after->opcontext = but->opcontext;
+ after->opptr = but->opptr;
- after->rnapoin= but->rnapoin;
- after->rnaprop= but->rnaprop;
+ after->rnapoin = but->rnapoin;
+ after->rnaprop = but->rnaprop;
- if(but->context)
- after->context= CTX_store_copy(but->context);
+ if (but->context)
+ after->context = CTX_store_copy(but->context);
- but->optype= NULL;
- but->opcontext= 0;
- but->opptr= NULL;
+ but->optype = NULL;
+ but->opcontext = 0;
+ but->opptr = NULL;
BLI_addtail(&UIAfterFuncs, after);
}
@@ -353,25 +337,25 @@ static void ui_apply_but_func(bContext *C, uiBut *but)
static void ui_apply_autokey_undo(bContext *C, uiBut *but)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
uiAfterFunc *after;
- if(but->flag & UI_BUT_UNDO) {
- const char *str= NULL;
+ if (but->flag & UI_BUT_UNDO) {
+ const char *str = NULL;
/* define which string to use for undo */
- if ELEM(but->type, LINK, INLINK) str= "Add button link";
- else if ELEM(but->type, MENU, ICONTEXTROW) str= but->drawstr;
- else if(but->drawstr[0]) str= but->drawstr;
- else str= but->tip;
+ if (ELEM(but->type, LINK, INLINK)) str = "Add button link";
+ else if (ELEM(but->type, MENU, ICONTEXTROW)) str = but->drawstr;
+ else if (but->drawstr[0]) str = but->drawstr;
+ else str = but->tip;
- /* fallback, else we dont get an undo! */
- if(str == NULL || str[0] == '\0') {
- str= "Unknown Action";
+ /* fallback, else we don't get an undo! */
+ if (str == NULL || str[0] == '\0') {
+ str = "Unknown Action";
}
/* delayed, after all other funcs run, popups are closed, etc */
- after= MEM_callocN(sizeof(uiAfterFunc), "uiAfterFunc");
+ after = MEM_callocN(sizeof(uiAfterFunc), "uiAfterFunc");
BLI_strncpy(after->undostr, str, sizeof(after->undostr));
BLI_addtail(&UIAfterFuncs, after);
}
@@ -387,54 +371,54 @@ static void ui_apply_but_funcs_after(bContext *C)
ListBase funcs;
/* copy to avoid recursive calls */
- funcs= UIAfterFuncs;
- UIAfterFuncs.first= UIAfterFuncs.last= NULL;
+ funcs = UIAfterFuncs;
+ UIAfterFuncs.first = UIAfterFuncs.last = NULL;
- for(afterf=funcs.first; afterf; afterf=after.next) {
- after= *afterf; /* copy to avoid memleak on exit() */
+ for (afterf = funcs.first; afterf; afterf = after.next) {
+ after = *afterf; /* copy to avoid memleak on exit() */
BLI_freelinkN(&funcs, afterf);
- if(after.context)
+ if (after.context)
CTX_store_set(C, after.context);
- if(after.opptr) {
+ if (after.opptr) {
/* free in advance to avoid leak on exit */
- opptr= *after.opptr,
+ opptr = *after.opptr,
MEM_freeN(after.opptr);
}
- if(after.optype)
- WM_operator_name_call(C, after.optype->idname, after.opcontext, (after.opptr)? &opptr: NULL);
+ if (after.optype)
+ WM_operator_name_call(C, after.optype->idname, after.opcontext, (after.opptr) ? &opptr : NULL);
- if(after.opptr)
+ if (after.opptr)
WM_operator_properties_free(&opptr);
- if(after.rnapoin.data)
+ if (after.rnapoin.data)
RNA_property_update(C, &after.rnapoin, after.rnaprop);
- if(after.context) {
+ if (after.context) {
CTX_store_set(C, NULL);
CTX_store_free(after.context);
}
- if(after.func)
+ if (after.func)
after.func(C, after.func_arg1, after.func_arg2);
- if(after.funcN)
+ if (after.funcN)
after.funcN(C, after.func_argN, after.func_arg2);
- if(after.func_argN)
+ if (after.func_argN)
MEM_freeN(after.func_argN);
- if(after.handle_func)
+ if (after.handle_func)
after.handle_func(C, after.handle_func_arg, after.retval);
- if(after.butm_func)
+ if (after.butm_func)
after.butm_func(C, after.butm_func_arg, after.a2);
- if(after.rename_func)
+ if (after.rename_func)
after.rename_func(C, after.rename_arg1, after.rename_orig);
- if(after.rename_orig)
+ if (after.rename_orig)
MEM_freeN(after.rename_orig);
- if(after.undostr[0])
+ if (after.undostr[0])
ED_undo_push(C, after.undostr);
}
}
@@ -443,8 +427,8 @@ static void ui_apply_but_BUT(bContext *C, uiBut *but, uiHandleButtonData *data)
{
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
static void ui_apply_but_BUTM(bContext *C, uiBut *but, uiHandleButtonData *data)
@@ -452,19 +436,19 @@ static void ui_apply_but_BUTM(bContext *C, uiBut *but, uiHandleButtonData *data)
ui_set_but_val(but, but->hardmin);
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
static void ui_apply_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data)
{
- if(ELEM3(but->type, MENU, ICONROW, ICONTEXTROW))
+ if (ELEM3(but->type, MENU, ICONROW, ICONTEXTROW))
ui_set_but_val(but, data->value);
ui_check_but(but);
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
static void ui_apply_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data)
@@ -473,57 +457,57 @@ static void ui_apply_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data)
int w, lvalue, push;
/* local hack... */
- if(but->type==BUT_TOGDUAL && data->togdual) {
- if(but->pointype==SHO)
+ if (but->type == BUT_TOGDUAL && data->togdual) {
+ if (but->pointype == SHO)
but->poin += 2;
- else if(but->pointype==INT)
+ else if (but->pointype == INT)
but->poin += 4;
}
- value= ui_get_but_val(but);
- lvalue= (int)value;
+ value = ui_get_but_val(but);
+ lvalue = (int)value;
- if(but->bit) {
- w= BTST(lvalue, but->bitnr);
- if(w) lvalue = BCLR(lvalue, but->bitnr);
+ if (but->bit) {
+ w = BTST(lvalue, but->bitnr);
+ if (w) lvalue = BCLR(lvalue, but->bitnr);
else lvalue = BSET(lvalue, but->bitnr);
- if(but->type==TOGR) {
- if(!data->togonly) {
- lvalue= 1<<(but->bitnr);
+ if (but->type == TOGR) {
+ if (!data->togonly) {
+ lvalue = 1 << (but->bitnr);
ui_set_but_val(but, (double)lvalue);
}
else {
- if(lvalue==0) lvalue= 1<<(but->bitnr);
+ if (lvalue == 0) lvalue = 1 << (but->bitnr);
}
}
ui_set_but_val(but, (double)lvalue);
- if(but->type==ICONTOG || but->type==ICONTOGN) ui_check_but(but);
+ if (but->type == ICONTOG || but->type == ICONTOGN) ui_check_but(but);
}
else {
- if(value==0.0) push= 1;
- else push= 0;
+ if (value == 0.0) push = 1;
+ else push = 0;
- if(ELEM3(but->type, TOGN, ICONTOGN, OPTIONN)) push= !push;
+ if (ELEM3(but->type, TOGN, ICONTOGN, OPTIONN)) push = !push;
ui_set_but_val(but, (double)push);
- if(but->type==ICONTOG || but->type==ICONTOGN) ui_check_but(but);
+ if (but->type == ICONTOG || but->type == ICONTOGN) ui_check_but(but);
}
/* end local hack... */
- if(but->type==BUT_TOGDUAL && data->togdual) {
- if(but->pointype==SHO)
+ if (but->type == BUT_TOGDUAL && data->togdual) {
+ if (but->pointype == SHO)
but->poin -= 2;
- else if(but->pointype==INT)
+ else if (but->pointype == INT)
but->poin -= 4;
}
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
static void ui_apply_but_ROW(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data)
@@ -533,19 +517,19 @@ static void ui_apply_but_ROW(bContext *C, uiBlock *block, uiBut *but, uiHandleBu
ui_set_but_val(but, but->hardmax);
/* states of other row buttons */
- for(bt= block->buttons.first; bt; bt= bt->next)
- if(bt!=but && bt->poin==but->poin && ELEM(bt->type, ROW, LISTROW))
+ for (bt = block->buttons.first; bt; bt = bt->next)
+ if (bt != but && bt->poin == but->poin && ELEM(bt->type, ROW, LISTROW))
ui_check_but(bt);
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
static void ui_apply_but_TEX(bContext *C, uiBut *but, uiHandleButtonData *data)
{
- if(!data->str)
+ if (!data->str)
return;
ui_set_but_string(C, but, data->str);
@@ -554,22 +538,22 @@ static void ui_apply_but_TEX(bContext *C, uiBut *but, uiHandleButtonData *data)
/* give butfunc the original text too */
/* feature used for bone renaming, channels, etc */
/* afterfunc frees origstr */
- but->rename_orig= data->origstr;
- data->origstr= NULL;
+ but->rename_orig = data->origstr;
+ data->origstr = NULL;
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
static void ui_apply_but_NUM(bContext *C, uiBut *but, uiHandleButtonData *data)
{
- if(data->str) {
- if(ui_set_but_string(C, but, data->str)) {
- data->value= ui_get_but_val(but);
+ if (data->str) {
+ if (ui_set_but_string(C, but, data->str)) {
+ data->value = ui_get_but_val(but);
}
else {
- data->cancel= 1;
+ data->cancel = 1;
return;
}
}
@@ -579,41 +563,43 @@ static void ui_apply_but_NUM(bContext *C, uiBut *but, uiHandleButtonData *data)
ui_check_but(but);
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
static void ui_apply_but_TOG3(bContext *C, uiBut *but, uiHandleButtonData *data)
{
- if(but->pointype==SHO ) {
- short *sp= (short *)but->poin;
+ if (but->pointype == SHO) {
+ short *sp = (short *)but->poin;
- if( BTST(sp[1], but->bitnr)) {
- sp[1]= BCLR(sp[1], but->bitnr);
- sp[0]= BCLR(sp[0], but->bitnr);
+ if (BTST(sp[1], but->bitnr)) {
+ sp[1] = BCLR(sp[1], but->bitnr);
+ sp[0] = BCLR(sp[0], but->bitnr);
}
- else if( BTST(sp[0], but->bitnr)) {
- sp[1]= BSET(sp[1], but->bitnr);
- } else {
- sp[0]= BSET(sp[0], but->bitnr);
+ else if (BTST(sp[0], but->bitnr)) {
+ sp[1] = BSET(sp[1], but->bitnr);
+ }
+ else {
+ sp[0] = BSET(sp[0], but->bitnr);
}
}
else {
- if( BTST(*(but->poin+2), but->bitnr)) {
- *(but->poin+2)= BCLR(*(but->poin+2), but->bitnr);
- *(but->poin)= BCLR(*(but->poin), but->bitnr);
+ if (BTST(*(but->poin + 2), but->bitnr)) {
+ *(but->poin + 2) = BCLR(*(but->poin + 2), but->bitnr);
+ *(but->poin) = BCLR(*(but->poin), but->bitnr);
+ }
+ else if (BTST(*(but->poin), but->bitnr)) {
+ *(but->poin + 2) = BSET(*(but->poin + 2), but->bitnr);
}
- else if( BTST(*(but->poin), but->bitnr)) {
- *(but->poin+2)= BSET(*(but->poin+2), but->bitnr);
- } else {
- *(but->poin)= BSET(*(but->poin), but->bitnr);
+ else {
+ *(but->poin) = BSET(*(but->poin), but->bitnr);
}
}
ui_check_but(but);
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
static void ui_apply_but_VEC(bContext *C, uiBut *but, uiHandleButtonData *data)
@@ -622,22 +608,22 @@ static void ui_apply_but_VEC(bContext *C, uiBut *but, uiHandleButtonData *data)
ui_check_but(but);
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
static void ui_apply_but_COLORBAND(bContext *C, uiBut *but, uiHandleButtonData *data)
{
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
static void ui_apply_but_CURVE(bContext *C, uiBut *but, uiHandleButtonData *data)
{
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
static void ui_apply_but_IDPOIN(bContext *C, uiBut *but, uiHandleButtonData *data)
@@ -645,16 +631,16 @@ static void ui_apply_but_IDPOIN(bContext *C, uiBut *but, uiHandleButtonData *dat
ui_set_but_string(C, but, data->str);
ui_check_but(but);
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
#ifdef WITH_INTERNATIONAL
static void ui_apply_but_CHARTAB(bContext *C, uiBut *but, uiHandleButtonData *data)
{
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
#endif
@@ -663,21 +649,21 @@ static void ui_apply_but_CHARTAB(bContext *C, uiBut *but, uiHandleButtonData *da
static int ui_but_mouse_inside_icon(uiBut *but, ARegion *ar, wmEvent *event)
{
rcti rect;
- int x= event->x, y= event->y;
+ int x = event->x, y = event->y;
ui_window_to_block(ar, but->block, &x, &y);
- rect.xmin= but->x1; rect.xmax= but->x2;
- rect.ymin= but->y1; rect.ymax= but->y2;
+ rect.xmin = but->x1; rect.xmax = but->x2;
+ rect.ymin = but->y1; rect.ymax = but->y2;
- if(but->imb); /* use button size itself */
- else if(but->flag & UI_ICON_LEFT) {
- rect.xmax= rect.xmin + (rect.ymax-rect.ymin);
+ if (but->imb) ; /* use button size itself */
+ else if (but->flag & UI_ICON_LEFT) {
+ rect.xmax = rect.xmin + (rect.ymax - rect.ymin);
}
else {
- int delta= (rect.xmax-rect.xmin) - (rect.ymax-rect.ymin);
- rect.xmin += delta/2;
- rect.xmax -= delta/2;
+ int delta = (rect.xmax - rect.xmin) - (rect.ymax - rect.ymin);
+ rect.xmin += delta / 2;
+ rect.xmax -= delta / 2;
}
return BLI_in_rcti(&rect, x, y);
@@ -688,15 +674,15 @@ static int ui_but_start_drag(bContext *C, uiBut *but, uiHandleButtonData *data,
/* prevent other WM gestures to start while we try to drag */
WM_gestures_remove(C);
- if( ABS(data->dragstartx - event->x) + ABS(data->dragstarty - event->y) > U.dragthreshold ) {
+ if (ABS(data->dragstartx - event->x) + ABS(data->dragstarty - event->y) > U.dragthreshold) {
wmDrag *drag;
button_activate_state(C, but, BUTTON_STATE_EXIT);
- data->cancel= 1;
+ data->cancel = 1;
- drag= WM_event_start_drag(C, but->icon, but->dragtype, but->dragpoin, ui_get_but_val(but));
- if(but->imb)
- WM_event_drag_image(drag, but->imb, but->imb_scale, but->x2-but->x1, but->y2-but->y1);
+ drag = WM_event_start_drag(C, but->icon, but->dragtype, but->dragpoin, ui_get_but_val(but));
+ if (but->imb)
+ WM_event_drag_image(drag, but->imb, but->imb_scale, but->x2 - but->x1, but->y2 - but->y1);
return 1;
}
@@ -712,33 +698,33 @@ static void ui_delete_active_linkline(uiBlock *block)
uiLinkLine *line, *nline;
int a, b;
- but= block->buttons.first;
- while(but) {
- if(but->type==LINK && but->link) {
- line= but->link->lines.first;
- while(line) {
+ but = block->buttons.first;
+ while (but) {
+ if (but->type == LINK && but->link) {
+ line = but->link->lines.first;
+ while (line) {
- nline= line->next;
+ nline = line->next;
- if(line->flag & UI_SELECT) {
+ if (line->flag & UI_SELECT) {
BLI_remlink(&but->link->lines, line);
- link= line->from->link;
+ link = line->from->link;
/* are there more pointers allowed? */
- if(link->ppoin) {
+ if (link->ppoin) {
- if(*(link->totlink)==1) {
- *(link->totlink)= 0;
+ if (*(link->totlink) == 1) {
+ *(link->totlink) = 0;
MEM_freeN(*(link->ppoin));
- *(link->ppoin)= NULL;
+ *(link->ppoin) = NULL;
}
else {
- b= 0;
- for(a=0; a< (*(link->totlink)); a++) {
+ b = 0;
+ for (a = 0; a < (*(link->totlink)); a++) {
- if( (*(link->ppoin))[a] != line->to->poin ) {
- (*(link->ppoin))[b]= (*(link->ppoin))[a];
+ if ( (*(link->ppoin))[a] != line->to->poin) {
+ (*(link->ppoin))[b] = (*(link->ppoin))[a];
b++;
}
}
@@ -746,15 +732,15 @@ static void ui_delete_active_linkline(uiBlock *block)
}
}
else {
- *(link->poin)= NULL;
+ *(link->poin) = NULL;
}
MEM_freeN(line);
}
- line= nline;
+ line = nline;
}
}
- but= but->next;
+ but = but->next;
}
}
@@ -764,12 +750,12 @@ static uiLinkLine *ui_is_a_link(uiBut *from, uiBut *to)
uiLinkLine *line;
uiLink *link;
- link= from->link;
- if(link) {
- line= link->lines.first;
- while(line) {
- if(line->from==from && line->to==to) return line;
- line= line->next;
+ link = from->link;
+ if (link) {
+ line = link->lines.first;
+ while (line) {
+ if (line->from == from && line->to == to) return line;
+ line = line->next;
}
}
return NULL;
@@ -779,43 +765,43 @@ static uiLinkLine *ui_is_a_link(uiBut *from, uiBut *to)
/* Try to add an AND Controller between the sensor and the actuator logic bricks and to connect them all */
static void ui_add_smart_controller(bContext *C, uiBut *from, uiBut *to)
{
- Object *ob= NULL;
+ Object *ob = NULL;
bSensor *sens_iter;
bActuator *act_to, *act_iter;
bController *cont;
bController ***sens_from_links;
uiBut *tmp_but;
- uiLink *link= from->link;
+ uiLink *link = from->link;
- if(link->ppoin)
- sens_from_links= (bController ***)(link->ppoin);
+ if (link->ppoin)
+ sens_from_links = (bController ***)(link->ppoin);
else return;
act_to = (bActuator *)(to->poin);
/* (1) get the object */
- CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
- for (sens_iter= ob_iter->sensors.first; sens_iter; sens_iter= sens_iter->next)
+ CTX_DATA_BEGIN(C, Object *, ob_iter, selected_editable_objects) {
+ for (sens_iter = ob_iter->sensors.first; sens_iter; sens_iter = sens_iter->next)
{
if (&(sens_iter->links) == sens_from_links) {
- ob= ob_iter;
+ ob = ob_iter;
break;
}
}
if (ob) break;
} CTX_DATA_END;
- if(!ob) return;
+ if (!ob) return;
/* (2) check if the sensor and the actuator are from the same object */
- for (act_iter= ob->actuators.first; act_iter; act_iter= (bActuator *)act_iter->next) {
+ for (act_iter = ob->actuators.first; act_iter; act_iter = (bActuator *)act_iter->next) {
if (act_iter == act_to)
break;
}
// only works if the sensor and the actuator are from the same object
- if(!act_iter) return;
+ if (!act_iter) return;
/* (3) add a new controller */
if (WM_operator_name_call(C, "LOGIC_OT_controller_add", WM_OP_EXEC_DEFAULT, NULL) & OPERATOR_FINISHED) {
@@ -824,13 +810,13 @@ static void ui_add_smart_controller(bContext *C, uiBut *from, uiBut *to)
/* (4) link the sensor->controller->actuator */
tmp_but = MEM_callocN(sizeof(uiBut), "uiBut");
uiSetButLink(tmp_but, (void **)&cont, (void ***)&(cont->links), &(cont->totlinks), from->link->tocode, (int)to->hardmin);
- tmp_but->hardmin= from->link->tocode;
- tmp_but->poin= (char *)cont;
+ tmp_but->hardmin = from->link->tocode;
+ tmp_but->poin = (char *)cont;
- tmp_but->type= INLINK;
+ tmp_but->type = INLINK;
ui_add_link(C, from, tmp_but);
- tmp_but->type= LINK;
+ tmp_but->type = LINK;
ui_add_link(C, tmp_but, to);
/* (5) garbage collection */
@@ -847,45 +833,45 @@ static void ui_add_link(bContext *C, uiBut *from, uiBut *to)
void **oldppoin;
int a;
- if( (line= ui_is_a_link(from, to)) ) {
+ if ( (line = ui_is_a_link(from, to)) ) {
line->flag |= UI_SELECT;
ui_delete_active_linkline(from->block);
return;
}
- if (from->type==INLINK && to->type==INLINK) {
+ if (from->type == INLINK && to->type == INLINK) {
return;
}
- else if (from->type==LINK && to->type==INLINK) {
- if( from->link->tocode != (int)to->hardmin ) {
+ else if (from->type == LINK && to->type == INLINK) {
+ if (from->link->tocode != (int)to->hardmin) {
ui_add_smart_controller(C, from, to);
return;
}
}
- else if(from->type==INLINK && to->type==LINK) {
- if( to->link->tocode == (int)from->hardmin ) {
+ else if (from->type == INLINK && to->type == LINK) {
+ if (to->link->tocode == (int)from->hardmin) {
return;
}
}
- link= from->link;
+ link = from->link;
/* are there more pointers allowed? */
- if(link->ppoin) {
- oldppoin= *(link->ppoin);
+ if (link->ppoin) {
+ oldppoin = *(link->ppoin);
(*(link->totlink))++;
- *(link->ppoin)= MEM_callocN( *(link->totlink)*sizeof(void *), "new link");
+ *(link->ppoin) = MEM_callocN(*(link->totlink) * sizeof(void *), "new link");
- for(a=0; a< (*(link->totlink))-1; a++) {
- (*(link->ppoin))[a]= oldppoin[a];
+ for (a = 0; a < (*(link->totlink)) - 1; a++) {
+ (*(link->ppoin))[a] = oldppoin[a];
}
- (*(link->ppoin))[a]= to->poin;
+ (*(link->ppoin))[a] = to->poin;
- if(oldppoin) MEM_freeN(oldppoin);
+ if (oldppoin) MEM_freeN(oldppoin);
}
else {
- *(link->poin)= to->poin;
+ *(link->poin) = to->poin;
}
}
@@ -893,52 +879,52 @@ static void ui_add_link(bContext *C, uiBut *from, uiBut *to)
static void ui_apply_but_LINK(bContext *C, uiBut *but, uiHandleButtonData *data)
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
uiBut *bt;
- for(bt= but->block->buttons.first; bt; bt= bt->next) {
- if( ui_mouse_inside_button(ar, bt, but->linkto[0]+ar->winrct.xmin, but->linkto[1]+ar->winrct.ymin) )
+ for (bt = but->block->buttons.first; bt; bt = bt->next) {
+ if (ui_mouse_inside_button(ar, bt, but->linkto[0] + ar->winrct.xmin, but->linkto[1] + ar->winrct.ymin) )
break;
}
- if(bt && bt!=but) {
+ if (bt && bt != but) {
if (!ELEM(bt->type, LINK, INLINK) || !ELEM(but->type, LINK, INLINK))
return;
- if(but->type==LINK) ui_add_link(C, but, bt);
+ if (but->type == LINK) ui_add_link(C, but, bt);
else ui_add_link(C, bt, but);
ui_apply_but_func(C, but);
- data->retval= but->retval;
+ data->retval = but->retval;
}
- data->applied= 1;
+ data->applied = 1;
}
static void ui_apply_but_IMAGE(bContext *C, uiBut *but, uiHandleButtonData *data)
{
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
static void ui_apply_but_HISTOGRAM(bContext *C, uiBut *but, uiHandleButtonData *data)
{
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
static void ui_apply_but_WAVEFORM(bContext *C, uiBut *but, uiHandleButtonData *data)
{
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
static void ui_apply_but_TRACKPREVIEW(bContext *C, uiBut *but, uiHandleButtonData *data)
{
ui_apply_but_func(C, but);
- data->retval= but->retval;
- data->applied= 1;
+ data->retval = but->retval;
+ data->applied = 1;
}
@@ -950,45 +936,45 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
ColorBand *editcoba;
CurveMapping *editcumap;
- data->retval= 0;
+ data->retval = 0;
/* if we cancel and have not applied yet, there is nothing to do,
* otherwise we have to restore the original value again */
- if(data->cancel) {
- if(!data->applied)
+ if (data->cancel) {
+ if (!data->applied)
return;
- if(data->str) MEM_freeN(data->str);
- data->str= data->origstr;
- data->origstr= NULL;
- data->value= data->origvalue;
- data->origvalue= 0.0;
+ if (data->str) MEM_freeN(data->str);
+ data->str = data->origstr;
+ data->origstr = NULL;
+ data->value = data->origvalue;
+ data->origvalue = 0.0;
copy_v3_v3(data->vec, data->origvec);
- data->origvec[0]= data->origvec[1]= data->origvec[2]= 0.0f;
+ data->origvec[0] = data->origvec[1] = data->origvec[2] = 0.0f;
}
else {
/* we avoid applying interactive edits a second time
* at the end with the appliedinteractive flag */
- if(interactive)
- data->appliedinteractive= 1;
- else if(data->appliedinteractive)
+ if (interactive)
+ data->appliedinteractive = 1;
+ else if (data->appliedinteractive)
return;
}
/* ensures we are writing actual values */
- editstr= but->editstr;
- editval= but->editval;
- editvec= but->editvec;
- editcoba= but->editcoba;
- editcumap= but->editcumap;
- but->editstr= NULL;
- but->editval= NULL;
- but->editvec= NULL;
- but->editcoba= NULL;
- but->editcumap= NULL;
+ editstr = but->editstr;
+ editval = but->editval;
+ editvec = but->editvec;
+ editcoba = but->editcoba;
+ editcumap = but->editcumap;
+ but->editstr = NULL;
+ but->editval = NULL;
+ but->editvec = NULL;
+ but->editcoba = NULL;
+ but->editcumap = NULL;
/* handle different types */
- switch(but->type) {
+ switch (but->type) {
case BUT:
ui_apply_but_BUT(C, but, data);
break;
@@ -1028,9 +1014,14 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
case ICONTEXTROW:
case BLOCK:
case PULLDOWN:
- case COL:
ui_apply_but_BLOCK(C, but, data);
break;
+ case COL:
+ if(data->cancel)
+ ui_apply_but_VEC(C, but, data);
+ else
+ ui_apply_but_BLOCK(C, but, data);
+ break;
case BUTM:
ui_apply_but_BUTM(C, but, data);
break;
@@ -1077,11 +1068,11 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
break;
}
- but->editstr= editstr;
- but->editval= editval;
- but->editvec= editvec;
- but->editcoba= editcoba;
- but->editcumap= editcumap;
+ but->editstr = editstr;
+ but->editval = editval;
+ but->editvec = editvec;
+ but->editcoba = editcoba;
+ but->editcumap = editcumap;
}
/* ******************* drop event ******************** */
@@ -1090,17 +1081,17 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
static void ui_but_drop(bContext *C, wmEvent *event, uiBut *but, uiHandleButtonData *data)
{
wmDrag *wmd;
- ListBase *drags= event->customdata; /* drop event type has listbase customdata by default */
+ ListBase *drags = event->customdata; /* drop event type has listbase customdata by default */
- for(wmd= drags->first; wmd; wmd= wmd->next) {
- if(wmd->type==WM_DRAG_ID) {
+ for (wmd = drags->first; wmd; wmd = wmd->next) {
+ if (wmd->type == WM_DRAG_ID) {
/* align these types with UI_but_active_drop_name */
- if(ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) {
- ID *id= (ID *)wmd->poin;
+ if (ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) {
+ ID *id = (ID *)wmd->poin;
- if(but->poin==NULL && but->rnapoin.data==NULL) {}
+ if (but->poin == NULL && but->rnapoin.data == NULL) {}
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
- BLI_strncpy(data->str, id->name+2, data->maxlen);
+ BLI_strncpy(data->str, id->name + 2, data->maxlen);
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
}
@@ -1114,31 +1105,31 @@ static void ui_but_drop(bContext *C, wmEvent *event, uiBut *but, uiHandleButtonD
static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data, char mode)
{
static ColorBand but_copypaste_coba = {0};
- char buf[UI_MAX_DRAW_STR+1]= {0};
+ char buf[UI_MAX_DRAW_STR + 1] = {0};
- if(mode=='v' && but->lock)
+ if (mode == 'v' && but->lock)
return;
- if(mode=='v') {
+ if (mode == 'v') {
/* extract first line from clipboard in case of multi-line copies */
- char *p, *pbuf= WM_clipboard_text_get(0);
- p= pbuf;
- if(p) {
+ char *p, *pbuf = WM_clipboard_text_get(0);
+ p = pbuf;
+ if (p) {
int i = 0;
- while (*p && *p!='\r' && *p!='\n' && i<UI_MAX_DRAW_STR) {
- buf[i++]=*p;
+ while (*p && *p != '\r' && *p != '\n' && i < UI_MAX_DRAW_STR) {
+ buf[i++] = *p;
p++;
}
- buf[i]= 0;
+ buf[i] = 0;
MEM_freeN(pbuf);
}
}
/* numeric value */
- if ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI) {
+ if (ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI)) {
- if(but->poin==NULL && but->rnapoin.data==NULL);
- else if(mode=='c') {
+ if (but->poin == NULL && but->rnapoin.data == NULL) ;
+ else if (mode == 'c') {
ui_get_but_string(but, buf, sizeof(buf));
WM_clipboard_text_set(buf, 0);
}
@@ -1147,7 +1138,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
if (ui_set_but_string_eval_num(C, but, buf, &val)) {
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
- data->value= val;
+ data->value = val;
ui_set_but_string(C, but, buf);
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
@@ -1155,11 +1146,11 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
}
/* RGB triple */
- else if(but->type==COL) {
+ else if (but->type == COL) {
float rgb[3];
- if(but->poin==NULL && but->rnapoin.data==NULL);
- else if(mode=='c') {
+ if (but->poin == NULL && but->rnapoin.data == NULL) ;
+ else if (mode == 'c') {
ui_get_but_vectorf(but, rgb);
BLI_snprintf(buf, sizeof(buf), "[%f, %f, %f]", rgb[0], rgb[1], rgb[2]);
@@ -1176,24 +1167,24 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
}
/* text/string and ID data */
- else if(ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) {
- uiHandleButtonData *active_data= but->active;
+ else if (ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) {
+ uiHandleButtonData *active_data = but->active;
- if(but->poin==NULL && but->rnapoin.data==NULL);
- else if(mode=='c') {
+ if (but->poin == NULL && but->rnapoin.data == NULL) ;
+ else if (mode == 'c') {
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
BLI_strncpy(buf, active_data->str, UI_MAX_DRAW_STR);
WM_clipboard_text_set(active_data->str, 0);
- active_data->cancel= 1;
+ active_data->cancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
else {
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
- if(ui_is_but_utf8(but)) BLI_strncpy_utf8(active_data->str, buf, active_data->maxlen);
- else BLI_strncpy(active_data->str, buf, active_data->maxlen);
+ if (ui_is_but_utf8(but)) BLI_strncpy_utf8(active_data->str, buf, active_data->maxlen);
+ else BLI_strncpy(active_data->str, buf, active_data->maxlen);
- if(but->type == SEARCH_MENU) {
+ if (but->type == SEARCH_MENU) {
/* else uiSearchboxData.active member is not updated [#26856] */
ui_searchbox_update(C, data->searchbox, but, 1);
}
@@ -1201,19 +1192,19 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
}
}
/* colorband (not supported by system clipboard) */
- else if(but->type==BUT_COLORBAND) {
- if(mode=='c') {
- if(but->poin==NULL)
+ else if (but->type == BUT_COLORBAND) {
+ if (mode == 'c') {
+ if (but->poin == NULL)
return;
memcpy(&but_copypaste_coba, but->poin, sizeof(ColorBand));
}
else {
- if(but_copypaste_coba.tot==0)
+ if (but_copypaste_coba.tot == 0)
return;
- if(!but->poin)
- but->poin= MEM_callocN(sizeof(ColorBand), "colorband");
+ if (!but->poin)
+ but->poin = MEM_callocN(sizeof(ColorBand), "colorband");
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
memcpy(data->coba, &but_copypaste_coba, sizeof(ColorBand) );
@@ -1222,12 +1213,12 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
}
/* operator button (any type) */
else if (but->optype) {
- if(mode=='c') {
+ if (mode == 'c') {
PointerRNA *opptr;
char *str;
- opptr= uiButGetOperatorPtrRNA(but); /* allocated when needed, the button owns it */
+ opptr = uiButGetOperatorPtrRNA(but); /* allocated when needed, the button owns it */
- str= WM_operator_pystring(C, but->optype, opptr, 0);
+ str = WM_operator_pystring(C, but->optype, opptr, 0);
WM_clipboard_text_set(str, 0);
@@ -1238,153 +1229,15 @@ 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)
{
- char *str= data->str;
- int len= strlen(str);
- int change= 0;
- if(but->selsta != but->selend && len) {
- memmove( str+but->selsta, str+but->selend, (len - but->selend) + 1 );
- change= 1;
+ char *str = data->str;
+ int len = strlen(str);
+ int change = 0;
+ if (but->selsta != but->selend && len) {
+ memmove(str + but->selsta, str + but->selend, (len - but->selend) + 1);
+ change = 1;
}
but->pos = but->selend = but->selsta;
@@ -1394,24 +1247,24 @@ static int ui_textedit_delete_selection(uiBut *but, uiHandleButtonData *data)
/* note, but->block->aspect is used here, when drawing button style is getting scaled too */
static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, short x)
{
- uiStyle *style= UI_GetStyle(); // XXX pass on as arg
+ uiStyle *style = UI_GetStyle(); // XXX pass on as arg
uiFontStyle *fstyle = &style->widget;
- int startx= but->x1;
+ int startx = but->x1;
char *origstr;
uiStyleFontSet(fstyle);
- if (fstyle->kerning==1) /* for BLF_width */
+ if (fstyle->kerning == 1) /* for BLF_width */
BLF_enable(fstyle->uifont_id, BLF_KERNING_DEFAULT);
- origstr= MEM_callocN(sizeof(char)*data->maxlen, "ui_textedit origstr");
+ origstr = MEM_callocN(sizeof(char) * data->maxlen, "ui_textedit origstr");
BLI_strncpy(origstr, but->drawstr, data->maxlen);
/* XXX solve generic */
- if(but->type==NUM || but->type==NUMSLI)
- startx += (int)(0.5f*(but->y2 - but->y1));
- else if(ELEM(but->type, TEX, SEARCH_MENU)) {
+ if (but->type == NUM || but->type == NUMSLI)
+ startx += (int)(0.5f * (but->y2 - but->y1));
+ else if (ELEM(but->type, TEX, SEARCH_MENU)) {
startx += 5;
if (but->flag & UI_HAS_ICON)
startx += UI_DPI_ICON_SIZE;
@@ -1419,13 +1272,13 @@ 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 (BLF_width(fstyle->uifont_id, origstr+i) > (startx - x)*0.25f) break; // 0.25 == scale factor for less sensitivity
+ 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 {
break; /* unlikely but possible */
@@ -1436,22 +1289,44 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho
}
/* mouse inside the widget */
else if (x >= startx) {
- const float aspect_sqrt= sqrtf(but->block->aspect);
-
- but->pos= strlen(origstr)-but->ofs;
+ 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);
- /* 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 */
}
}
but->pos += but->ofs;
- if(but->pos<0) but->pos= 0;
+ if (but->pos < 0) but->pos = 0;
}
if (fstyle->kerning == 1)
@@ -1474,31 +1349,31 @@ static void ui_textedit_set_cursor_select(uiBut *but, uiHandleButtonData *data,
}
/* this is used for both utf8 and ascii, its meant to be used for single keys,
- * notie the buffer is either copied or not, so its not suitable for pasting in
+ * notice the buffer is either copied or not, so its not suitable for pasting in
* - campbell */
static int ui_textedit_type_buf(uiBut *but, uiHandleButtonData *data,
const char *utf8_buf, int utf8_buf_len)
{
char *str;
- int len, changed= 0;
+ int len, changed = 0;
- str= data->str;
- len= strlen(str);
+ str = data->str;
+ len = strlen(str);
- if(len-(but->selend - but->selsta)+1 <= data->maxlen) {
- int step= utf8_buf_len;
+ if (len - (but->selend - but->selsta) + 1 <= data->maxlen) {
+ int step = utf8_buf_len;
/* type over the current selection */
if ((but->selend - but->selsta) > 0) {
- changed= ui_textedit_delete_selection(but, data);
- len= strlen(str);
+ changed = ui_textedit_delete_selection(but, data);
+ len = strlen(str);
}
- if(len + step < data->maxlen) {
+ if (len + step < data->maxlen) {
memmove(&str[but->pos + step], &str[but->pos], (len + 1) - but->pos);
memcpy(&str[but->pos], utf8_buf, step * sizeof(char));
but->pos += step;
- changed= 1;
+ changed = 1;
}
}
@@ -1507,7 +1382,7 @@ static int ui_textedit_type_buf(uiBut *but, uiHandleButtonData *data,
static int ui_textedit_type_ascii(uiBut *but, uiHandleButtonData *data, char ascii)
{
- char buf[2]= {ascii, '\0'};
+ char buf[2] = {ascii, '\0'};
if (ui_is_but_utf8(but) && (BLI_str_utf8_size(buf) == -1)) {
printf("%s: entering invalid ascii char into an ascii key (%d)\n",
@@ -1520,19 +1395,19 @@ 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);
- const int pos_prev= but->pos;
- const int has_sel= (but->selend - but->selsta) > 0;
+ const char *str = data->str;
+ const int len = strlen(str);
+ const int pos_prev = but->pos;
+ const int has_sel = (but->selend - but->selsta) > 0;
ui_check_but(but);
/* special case, quit selection and set cursor */
if (has_sel && !select) {
- if (jump == BUTTON_EDIT_JUMP_ALL) {
- but->selsta = but->selend= but->pos = direction ? len : 0;
+ if (jump == STRCUR_JUMP_ALL) {
+ but->selsta = but->selend = but->pos = direction ? len : 0;
}
else {
if (direction) {
@@ -1545,94 +1420,96 @@ 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) {
+ if (select) {
/* existing selection */
if (has_sel) {
- if(data->selextend == 0) {
- data->selextend= EXTEND_RIGHT;
+ if (data->selextend == 0) {
+ data->selextend = EXTEND_RIGHT;
}
if (direction) {
if (data->selextend == EXTEND_RIGHT) {
- but->selend= but->pos;
+ but->selend = but->pos;
}
else {
- but->selsta= but->pos;
+ but->selsta = but->pos;
}
}
else {
if (data->selextend == EXTEND_LEFT) {
- but->selsta= but->pos;
+ but->selsta = but->pos;
}
else {
- but->selend= but->pos;
+ but->selend = but->pos;
}
}
if (but->selend < but->selsta) {
SWAP(short, but->selsta, but->selend);
- data->selextend= (data->selextend == EXTEND_RIGHT) ? EXTEND_LEFT : EXTEND_RIGHT;
+ data->selextend = (data->selextend == EXTEND_RIGHT) ? EXTEND_LEFT : EXTEND_RIGHT;
}
} /* new selection */
else {
if (direction) {
- data->selextend= EXTEND_RIGHT;
- but->selend= but->pos;
- but->selsta= pos_prev;
+ data->selextend = EXTEND_RIGHT;
+ but->selend = but->pos;
+ but->selsta = pos_prev;
}
else {
- data->selextend= EXTEND_LEFT;
- but->selend= pos_prev;
- but->selsta= but->pos;
+ data->selextend = EXTEND_LEFT;
+ but->selend = pos_prev;
+ but->selsta = but->pos;
}
}
}
}
}
-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);
+ char *str = data->str;
+ const int len = strlen(str);
- int changed= 0;
+ int changed = 0;
- if(jump == BUTTON_EDIT_JUMP_ALL) {
- if(len) changed=1;
- str[0]= '\0';
- but->pos= 0;
+ if (jump == STRCUR_JUMP_ALL) {
+ if (len) changed = 1;
+ str[0] = '\0';
+ but->pos = 0;
}
- else if(direction) { /* delete */
+ else if (direction) { /* delete */
if ((but->selend - but->selsta) > 0) {
- changed= ui_textedit_delete_selection(but, data);
+ changed = ui_textedit_delete_selection(but, data);
}
- else if (but->pos>=0 && but->pos<len) {
- short pos= but->pos;
+ else if (but->pos >= 0 && but->pos < len) {
+ 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;
+ changed = 1;
}
}
else { /* backspace */
if (len != 0) {
if ((but->selend - but->selsta) > 0) {
- changed= ui_textedit_delete_selection(but, data);
+ changed = ui_textedit_delete_selection(but, data);
}
- else if(but->pos>0) {
- short pos= but->pos;
+ else if (but->pos > 0) {
+ int pos = but->pos;
int step;
- ui_textedit_step_utf8(str, len, &pos, direction, jump);
- step= but->pos - pos;
+ 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;
- changed= 1;
+ changed = 1;
}
}
}
@@ -1643,64 +1520,64 @@ static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int directio
static int ui_textedit_autocomplete(bContext *C, uiBut *but, uiHandleButtonData *data)
{
char *str;
- int changed= 1;
+ int changed = 1;
- str= data->str;
+ str = data->str;
- if(data->searchbox)
+ if (data->searchbox)
ui_searchbox_autocomplete(C, data->searchbox, but, data->str);
else
but->autocomplete_func(C, str, but->autofunc_arg);
- but->pos= strlen(str);
- but->selsta= but->selend= but->pos;
+ but->pos = strlen(str);
+ but->selsta = but->selend = but->pos;
return changed;
}
static int ui_textedit_copypaste(uiBut *but, uiHandleButtonData *data, int paste, int copy, int cut)
{
- char buf[UI_MAX_DRAW_STR]={0};
+ char buf[UI_MAX_DRAW_STR] = {0};
char *str, *p, *pbuf;
- int len, x, i, changed= 0;
+ int len, x, i, changed = 0;
- str= data->str;
- len= strlen(str);
+ str = data->str;
+ len = strlen(str);
/* paste */
if (paste) {
/* extract the first line from the clipboard */
- p = pbuf= WM_clipboard_text_get(0);
+ p = pbuf = WM_clipboard_text_get(0);
- if(p && p[0]) {
+ if (p && p[0]) {
unsigned int y;
- i= 0;
- while (*p && *p!='\r' && *p!='\n' && i<UI_MAX_DRAW_STR-1) {
- buf[i++]=*p;
+ i = 0;
+ while (*p && *p != '\r' && *p != '\n' && i < UI_MAX_DRAW_STR - 1) {
+ buf[i++] = *p;
p++;
}
- buf[i]= 0;
+ buf[i] = 0;
/* paste over the current selection */
if ((but->selend - but->selsta) > 0) {
ui_textedit_delete_selection(but, data);
- len= strlen(str);
+ len = strlen(str);
}
- for (y=0; y<strlen(buf); y++)
+ for (y = 0; y < strlen(buf); y++)
{
/* add contents of buffer */
- if(len+1 < data->maxlen) {
- for(x= data->maxlen; x>but->pos; x--)
- str[x]= str[x-1];
- str[but->pos]= buf[y];
+ if (len + 1 < data->maxlen) {
+ for (x = data->maxlen; x > but->pos; x--)
+ str[x] = str[x - 1];
+ str[but->pos] = buf[y];
but->pos++;
len++;
- str[len]= '\0';
+ str[len] = '\0';
}
}
- changed= 1;
+ changed = 1;
}
if (pbuf) {
@@ -1710,8 +1587,8 @@ static int ui_textedit_copypaste(uiBut *but, uiHandleButtonData *data, int paste
/* cut & copy */
else if (copy || cut) {
/* copy the contents to the copypaste buffer */
- for(x= but->selsta; x <= but->selend; x++) {
- if (x==but->selend)
+ for (x = but->selsta; x <= but->selend; x++) {
+ if (x == but->selend)
buf[x] = '\0';
else
buf[(x - but->selsta)] = str[x];
@@ -1720,9 +1597,9 @@ static int ui_textedit_copypaste(uiBut *but, uiHandleButtonData *data, int paste
WM_clipboard_text_set(buf, 0);
/* for cut only, delete the selection afterwards */
- if(cut)
- if((but->selend - but->selsta) > 0)
- changed= ui_textedit_delete_selection(but, data);
+ if (cut)
+ if ((but->selend - but->selsta) > 0)
+ changed = ui_textedit_delete_selection(but, data);
}
return changed;
@@ -1730,33 +1607,38 @@ static int ui_textedit_copypaste(uiBut *but, uiHandleButtonData *data, int paste
static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
{
- if(data->str) {
+ int len;
+
+ if (data->str) {
MEM_freeN(data->str);
- data->str= NULL;
+ data->str = NULL;
}
/* retrieve string */
- data->maxlen= ui_get_but_string_max_length(but);
- data->str= MEM_callocN(sizeof(char)*data->maxlen + 1, "textedit str");
+ data->maxlen = ui_get_but_string_max_length(but);
+ data->str = MEM_callocN(sizeof(char) * data->maxlen + 1, "textedit str");
ui_get_but_string(but, data->str, data->maxlen);
- if(ELEM3(but->type, NUM, NUMABS, NUMSLI)) {
+ if (ELEM3(but->type, NUM, NUMABS, NUMSLI)) {
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) {
- data->searchbox= ui_searchbox_create(C, data->region, but);
+ if (but->type == SEARCH_MENU) {
+ data->searchbox = ui_searchbox_create(C, data->region, but);
ui_searchbox_update(C, data->searchbox, but, 1); /* 1= reset */
}
@@ -1767,26 +1649,26 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
static void ui_textedit_end(bContext *C, uiBut *but, uiHandleButtonData *data)
{
- if(but) {
- if(ui_is_but_utf8(but)) {
- int strip= BLI_utf8_invalid_strip(but->editstr, strlen(but->editstr));
+ if (but) {
+ if (ui_is_but_utf8(but)) {
+ int strip = BLI_utf8_invalid_strip(but->editstr, strlen(but->editstr));
/* not a file?, strip non utf-8 chars */
- if(strip) {
- /* wont happen often so isnt that annoying to keep it here for a while */
+ if (strip) {
+ /* wont happen often so isn't that annoying to keep it here for a while */
printf("%s: invalid utf8 - stripped chars %d\n", __func__, strip);
}
}
- if(data->searchbox) {
- if(data->cancel==0)
+ if (data->searchbox) {
+ if (data->cancel == 0)
ui_searchbox_apply(but, data->searchbox);
ui_searchbox_free(C, data->searchbox);
- data->searchbox= NULL;
+ data->searchbox = NULL;
}
- but->editstr= NULL;
- but->pos= -1;
+ but->editstr = NULL;
+ but->pos = -1;
}
WM_cursor_restore(CTX_wm_window(C));
@@ -1797,23 +1679,23 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
uiBut *but;
/* label and roundbox can overlap real buttons (backdrops...) */
- if(ELEM4(actbut->type, LABEL, SEPR, ROUNDBOX, LISTBOX))
+ if (ELEM4(actbut->type, LABEL, SEPR, ROUNDBOX, LISTBOX))
return;
- for(but= actbut->next; but; but= but->next) {
- if(ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) {
- if(!(but->flag & UI_BUT_DISABLED)) {
- data->postbut= but;
- data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
+ for (but = actbut->next; but; but = but->next) {
+ if (ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) {
+ if (!(but->flag & UI_BUT_DISABLED)) {
+ data->postbut = but;
+ data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
return;
}
}
}
- for(but= block->buttons.first; but!=actbut; but= but->next) {
- if(ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) {
- if(!(but->flag & UI_BUT_DISABLED)) {
- data->postbut= but;
- data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
+ for (but = block->buttons.first; but != actbut; but = but->next) {
+ if (ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) {
+ if (!(but->flag & UI_BUT_DISABLED)) {
+ data->postbut = but;
+ data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
return;
}
}
@@ -1825,23 +1707,23 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
uiBut *but;
/* label and roundbox can overlap real buttons (backdrops...) */
- if(ELEM4(actbut->type, LABEL, SEPR, ROUNDBOX, LISTBOX))
+ if (ELEM4(actbut->type, LABEL, SEPR, ROUNDBOX, LISTBOX))
return;
- for(but= actbut->prev; but; but= but->prev) {
- if(ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) {
- if(!(but->flag & UI_BUT_DISABLED)) {
- data->postbut= but;
- data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
+ for (but = actbut->prev; but; but = but->prev) {
+ if (ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) {
+ if (!(but->flag & UI_BUT_DISABLED)) {
+ data->postbut = but;
+ data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
return;
}
}
}
- for(but= block->buttons.last; but!=actbut; but= but->prev) {
- if(ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) {
- if(!(but->flag & UI_BUT_DISABLED)) {
- data->postbut= but;
- data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
+ for (but = block->buttons.last; but != actbut; but = but->prev) {
+ if (ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) {
+ if (!(but->flag & UI_BUT_DISABLED)) {
+ data->postbut = but;
+ data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
return;
}
}
@@ -1851,125 +1733,125 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
- int mx, my, changed= 0, inbox=0, update= 0, retval= WM_UI_HANDLER_CONTINUE;
+ int mx, my, changed = 0, inbox = 0, update = 0, retval = WM_UI_HANDLER_CONTINUE;
- switch(event->type) {
+ switch (event->type) {
case WHEELUPMOUSE:
case WHEELDOWNMOUSE:
case MOUSEMOVE:
- if(data->searchbox)
+ if (data->searchbox)
ui_searchbox_event(C, data->searchbox, but, event);
break;
case RIGHTMOUSE:
case ESCKEY:
- data->cancel= 1;
- data->escapecancel= 1;
+ data->cancel = 1;
+ data->escapecancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
break;
case LEFTMOUSE: {
/* exit on LMB only on RELEASE for searchbox, to mimic other popups, and allow multiple menu levels */
- if(data->searchbox)
- inbox= ui_searchbox_inside(data->searchbox, event->x, event->y);
+ if (data->searchbox)
+ inbox = ui_searchbox_inside(data->searchbox, event->x, event->y);
- if(event->val==KM_PRESS) {
- mx= event->x;
- my= event->y;
+ if (event->val == KM_PRESS) {
+ mx = event->x;
+ my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
if (ui_but_contains_pt(but, mx, my)) {
ui_textedit_set_cursor_pos(but, data, mx);
but->selsta = but->selend = but->pos;
- data->selstartx= mx;
+ data->selstartx = mx;
button_activate_state(C, but, BUTTON_STATE_TEXT_SELECTING);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
- else if(inbox==0) {
+ else if (inbox == 0) {
/* if searchbox, click outside will cancel */
- if(data->searchbox)
- data->cancel= data->escapecancel= 1;
+ if (data->searchbox)
+ data->cancel = data->escapecancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
}
- else if(inbox) {
+ else if (inbox) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
break;
}
}
- if(event->val==KM_PRESS) {
+ if (event->val == KM_PRESS) {
switch (event->type) {
case VKEY:
case XKEY:
case CKEY:
- if(event->ctrl || event->oskey) {
- if(event->type == VKEY)
- changed= ui_textedit_copypaste(but, data, 1, 0, 0);
- else if(event->type == CKEY)
- changed= ui_textedit_copypaste(but, data, 0, 1, 0);
- else if(event->type == XKEY)
- changed= ui_textedit_copypaste(but, data, 0, 0, 1);
-
- retval= WM_UI_HANDLER_BREAK;
+ if (event->ctrl || event->oskey) {
+ if (event->type == VKEY)
+ changed = ui_textedit_copypaste(but, data, 1, 0, 0);
+ else if (event->type == CKEY)
+ changed = ui_textedit_copypaste(but, data, 0, 1, 0);
+ else if (event->type == XKEY)
+ changed = ui_textedit_copypaste(but, data, 0, 0, 1);
+
+ retval = WM_UI_HANDLER_BREAK;
}
break;
case RIGHTARROWKEY:
- ui_textedit_move(but, data, 1, event->shift, event->ctrl ? BUTTON_EDIT_JUMP_DELIM : BUTTON_EDIT_JUMP_NONE);
- retval= WM_UI_HANDLER_BREAK;
+ 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);
- retval= WM_UI_HANDLER_BREAK;
+ 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:
- if(data->searchbox) {
+ if (data->searchbox) {
ui_searchbox_event(C, data->searchbox, but, event);
break;
}
- /* pass on purposedly */
+ /* pass on purposedly */
case ENDKEY:
- ui_textedit_move(but, data, 1, event->shift, BUTTON_EDIT_JUMP_ALL);
- retval= WM_UI_HANDLER_BREAK;
+ ui_textedit_move(but, data, STRCUR_DIR_NEXT, event->shift, STRCUR_JUMP_ALL);
+ retval = WM_UI_HANDLER_BREAK;
break;
case UPARROWKEY:
- if(data->searchbox) {
+ if (data->searchbox) {
ui_searchbox_event(C, data->searchbox, but, event);
break;
}
- /* pass on purposedly */
+ /* pass on purposedly */
case HOMEKEY:
- ui_textedit_move(but, data, 0, event->shift, BUTTON_EDIT_JUMP_ALL);
- retval= WM_UI_HANDLER_BREAK;
+ ui_textedit_move(but, data, STRCUR_DIR_PREV, event->shift, STRCUR_JUMP_ALL);
+ retval = WM_UI_HANDLER_BREAK;
break;
case PADENTER:
case RETKEY:
button_activate_state(C, but, BUTTON_STATE_EXIT);
- retval= WM_UI_HANDLER_BREAK;
+ 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);
- retval= WM_UI_HANDLER_BREAK;
+ 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));
- retval= WM_UI_HANDLER_BREAK;
+ 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;
case TABKEY:
/* there is a key conflict here, we can't tab with autocomplete */
- if(but->autocomplete_func || data->searchbox) {
- changed= ui_textedit_autocomplete(C, but, data);
- update= 1; /* do live update for tab key */
+ if (but->autocomplete_func || data->searchbox) {
+ changed = ui_textedit_autocomplete(C, but, data);
+ update = 1; /* do live update for tab key */
}
/* the hotkey here is not well defined, was G.qual so we check all */
- else if(event->shift || event->ctrl || event->alt || event->oskey) {
+ else if (event->shift || event->ctrl || event->alt || event->oskey) {
ui_textedit_prev_but(block, but, data);
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
@@ -1977,81 +1859,81 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
ui_textedit_next_but(block, but, data);
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
break;
}
- if((event->ascii || event->utf8_buf[0]) && (retval == WM_UI_HANDLER_CONTINUE)) {
+ if ((event->ascii || event->utf8_buf[0]) && (retval == WM_UI_HANDLER_CONTINUE)) {
char ascii = event->ascii;
- const char *utf8_buf= event->utf8_buf;
+ const char *utf8_buf = event->utf8_buf;
/* exception that's useful for number buttons, some keyboard
- numpads have a comma instead of a period */
- if(ELEM3(but->type, NUM, NUMABS, NUMSLI)) { /* could use data->min*/
- if(event->type == PADPERIOD && ascii == ',') {
+ * 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 = '.';
- utf8_buf= NULL; /* force ascii fallback */
+ utf8_buf = NULL; /* force ascii fallback */
}
}
- if(utf8_buf && utf8_buf[0]) {
- int utf8_buf_len= BLI_str_utf8_size(utf8_buf);
+ if (utf8_buf && utf8_buf[0]) {
+ int utf8_buf_len = BLI_str_utf8_size(utf8_buf);
/* keep this printf until utf8 is well tested */
if (utf8_buf_len != 1) {
printf("%s: utf8 char '%.*s'\n", __func__, utf8_buf_len, utf8_buf);
}
// strcpy(utf8_buf, "12345");
- changed= ui_textedit_type_buf(but, data, event->utf8_buf, utf8_buf_len);
+ changed = ui_textedit_type_buf(but, data, event->utf8_buf, utf8_buf_len);
}
else {
- changed= ui_textedit_type_ascii(but, data, ascii);
+ changed = ui_textedit_type_ascii(but, data, ascii);
}
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
/* textbutton with magnifier icon: do live update for search button */
- if(but->icon==ICON_VIEWZOOM)
- update= 1;
+ if (but->icon == ICON_VIEWZOOM)
+ update = 1;
}
- if(changed) {
+ if (changed) {
/* only update when typing for TAB key */
- if(update && data->interactive) ui_apply_button(C, block, but, data, 1);
+ if (update && data->interactive) ui_apply_button(C, block, but, data, 1);
else ui_check_but(but);
- but->changed= TRUE;
+ but->changed = TRUE;
- if(data->searchbox)
- ui_searchbox_update(C, data->searchbox, but, 1); /* 1 = reset */
+ if (data->searchbox)
+ ui_searchbox_update(C, data->searchbox, but, 1); /* 1 = reset */
}
- if(changed || (retval == WM_UI_HANDLER_BREAK))
+ if (changed || (retval == WM_UI_HANDLER_BREAK))
ED_region_tag_redraw(data->region);
}
static void ui_do_but_textedit_select(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
- int mx, my, retval= WM_UI_HANDLER_CONTINUE;
+ int mx, my, retval = WM_UI_HANDLER_CONTINUE;
- switch(event->type) {
+ switch (event->type) {
case MOUSEMOVE: {
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
ui_textedit_set_cursor_select(but, data, mx);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
break;
}
case LEFTMOUSE:
- if(event->val == KM_RELEASE)
+ if (event->val == KM_RELEASE)
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
break;
}
- if(retval == WM_UI_HANDLER_BREAK) {
+ if (retval == WM_UI_HANDLER_BREAK) {
ui_check_but(but);
ED_region_tag_redraw(data->region);
}
@@ -2061,55 +1943,55 @@ static void ui_do_but_textedit_select(bContext *C, uiBlock *block, uiBut *but, u
static void ui_numedit_begin(uiBut *but, uiHandleButtonData *data)
{
- if(but->type == BUT_CURVE) {
- but->editcumap= (CurveMapping*)but->poin;
+ if (but->type == BUT_CURVE) {
+ but->editcumap = (CurveMapping *)but->poin;
}
- else if(but->type == BUT_COLORBAND) {
- data->coba= (ColorBand*)but->poin;
- but->editcoba= data->coba;
+ else if (but->type == BUT_COLORBAND) {
+ data->coba = (ColorBand *)but->poin;
+ but->editcoba = data->coba;
}
- else if(ELEM3(but->type, BUT_NORMAL, HSVCUBE, HSVCIRCLE)) {
+ else if (ELEM3(but->type, BUT_NORMAL, HSVCUBE, HSVCIRCLE)) {
ui_get_but_vectorf(but, data->origvec);
copy_v3_v3(data->vec, data->origvec);
- but->editvec= data->vec;
+ but->editvec = data->vec;
}
else {
float softrange, softmin, softmax;
- data->startvalue= ui_get_but_val(but);
- data->origvalue= data->startvalue;
- data->value= data->origvalue;
- but->editval= &data->value;
+ data->startvalue = ui_get_but_val(but);
+ data->origvalue = data->startvalue;
+ data->value = data->origvalue;
+ but->editval = &data->value;
- softmin= but->softmin;
- softmax= but->softmax;
- softrange= softmax - softmin;
+ softmin = but->softmin;
+ softmax = but->softmax;
+ softrange = softmax - softmin;
- data->dragfstart= (softrange == 0.0f)? 0.0f: ((float)data->value - softmin)/softrange;
- data->dragf= data->dragfstart;
+ data->dragfstart = (softrange == 0.0f) ? 0.0f : ((float)data->value - softmin) / softrange;
+ data->dragf = data->dragfstart;
}
- data->dragchange= 0;
- data->draglock= 1;
+ data->dragchange = 0;
+ data->draglock = 1;
}
static void ui_numedit_end(uiBut *but, uiHandleButtonData *data)
{
- but->editval= NULL;
- but->editvec= NULL;
- but->editcoba= NULL;
- but->editcumap= NULL;
+ but->editval = NULL;
+ but->editvec = NULL;
+ but->editcoba = NULL;
+ but->editcumap = NULL;
- data->dragstartx= 0;
- data->draglastx= 0;
- data->dragchange= 0;
- data->dragcbd= NULL;
- data->dragsel= 0;
+ data->dragstartx = 0;
+ data->draglastx = 0;
+ data->dragchange = 0;
+ data->dragcbd = NULL;
+ data->dragsel = 0;
}
static void ui_numedit_apply(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data)
{
- if(data->interactive) ui_apply_button(C, block, but, data, 1);
+ if (data->interactive) ui_apply_button(C, block, but, data, 1);
else ui_check_but(but);
ED_region_tag_redraw(data->region);
@@ -2119,64 +2001,64 @@ static void ui_numedit_apply(bContext *C, uiBlock *block, uiBut *but, uiHandleBu
static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
{
- uiBlockCreateFunc func= NULL;
- uiBlockHandleCreateFunc handlefunc= NULL;
- uiMenuCreateFunc menufunc= NULL;
- char *menustr= NULL;
- void *arg= NULL;
+ uiBlockCreateFunc func = NULL;
+ uiBlockHandleCreateFunc handlefunc = NULL;
+ uiMenuCreateFunc menufunc = NULL;
+ char *menustr = NULL;
+ void *arg = NULL;
- switch(but->type) {
+ switch (but->type) {
case BLOCK:
case PULLDOWN:
- if(but->menu_create_func) {
- menufunc= but->menu_create_func;
- arg= but->poin;
+ if (but->menu_create_func) {
+ menufunc = but->menu_create_func;
+ arg = but->poin;
}
else {
- func= but->block_create_func;
- arg= but->poin?but->poin:but->func_argN;
+ func = but->block_create_func;
+ arg = but->poin ? but->poin : but->func_argN;
}
break;
case MENU:
- if(but->menu_create_func) {
- menufunc= but->menu_create_func;
- arg= but->poin;
+ if (but->menu_create_func) {
+ menufunc = but->menu_create_func;
+ arg = but->poin;
}
else {
- data->origvalue= ui_get_but_val(but);
- data->value= data->origvalue;
- but->editval= &data->value;
+ data->origvalue = ui_get_but_val(but);
+ data->value = data->origvalue;
+ but->editval = &data->value;
- menustr= but->str;
+ menustr = but->str;
}
break;
case ICONROW:
- menufunc= ui_block_func_ICONROW;
- arg= but;
+ menufunc = ui_block_func_ICONROW;
+ arg = but;
break;
case ICONTEXTROW:
- menufunc= ui_block_func_ICONTEXTROW;
- arg= but;
+ menufunc = ui_block_func_ICONTEXTROW;
+ arg = but;
break;
case COL:
ui_get_but_vectorf(but, data->origvec);
copy_v3_v3(data->vec, data->origvec);
- but->editvec= data->vec;
+ but->editvec = data->vec;
- handlefunc= ui_block_func_COL;
- arg= but;
+ handlefunc = ui_block_func_COL;
+ arg = but;
break;
}
- if(func || handlefunc) {
- data->menu= ui_popup_block_create(C, data->region, but, func, handlefunc, arg);
- if(but->block->handle)
- data->menu->popup= but->block->handle->popup;
+ if (func || handlefunc) {
+ data->menu = ui_popup_block_create(C, data->region, but, func, handlefunc, arg);
+ if (but->block->handle)
+ data->menu->popup = but->block->handle->popup;
}
- else if(menufunc || menustr) {
- data->menu= ui_popup_menu_create(C, data->region, but, menufunc, arg, menustr);
- if(but->block->handle)
- data->menu->popup= but->block->handle->popup;
+ else if (menufunc || menustr) {
+ data->menu = ui_popup_menu_create(C, data->region, but, menufunc, arg, menustr);
+ if (but->block->handle)
+ data->menu->popup = but->block->handle->popup;
}
/* this makes adjacent blocks auto open from now on */
@@ -2185,16 +2067,16 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data
static void ui_blockopen_end(bContext *C, uiBut *but, uiHandleButtonData *data)
{
- if(but) {
- but->editval= NULL;
- but->editvec= NULL;
+ if (but) {
+ but->editval = NULL;
+ but->editvec = NULL;
- but->block->auto_open_last= PIL_check_seconds_timer();
+ but->block->auto_open_last = PIL_check_seconds_timer();
}
- if(data->menu) {
+ if (data->menu) {
ui_popup_block_free(C, data->menu);
- data->menu= NULL;
+ data->menu = NULL;
}
}
@@ -2202,24 +2084,24 @@ static void ui_blockopen_end(bContext *C, uiBut *but, uiHandleButtonData *data)
static int ui_do_but_BUT(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(event->type == LEFTMOUSE && event->val==KM_PRESS) {
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_WAIT_RELEASE);
return WM_UI_HANDLER_BREAK;
}
- else if(event->type == LEFTMOUSE && but->block->handle) {
+ else if (event->type == LEFTMOUSE && but->block->handle) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
}
- else if(ELEM(event->type, PADENTER, RETKEY) && event->val==KM_PRESS) {
+ else if (ELEM(event->type, PADENTER, RETKEY) && event->val == KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_WAIT_FLASH);
return WM_UI_HANDLER_BREAK;
}
}
- else if(data->state == BUTTON_STATE_WAIT_RELEASE) {
- if(event->type == LEFTMOUSE && event->val!=KM_PRESS) {
- if(!(but->flag & UI_SELECT))
- data->cancel= 1;
+ else if (data->state == BUTTON_STATE_WAIT_RELEASE) {
+ if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+ if (!(but->flag & UI_SELECT))
+ data->cancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
}
@@ -2230,27 +2112,27 @@ static int ui_do_but_BUT(bContext *C, uiBut *but, uiHandleButtonData *data, wmEv
static int ui_do_but_HOTKEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val==KM_PRESS) {
- but->drawstr[0]= 0;
- but->modifier_key= 0;
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
+ but->drawstr[0] = 0;
+ but->modifier_key = 0;
button_activate_state(C, but, BUTTON_STATE_WAIT_KEY_EVENT);
return WM_UI_HANDLER_BREAK;
}
}
- else if(data->state == BUTTON_STATE_WAIT_KEY_EVENT) {
+ else if (data->state == BUTTON_STATE_WAIT_KEY_EVENT) {
- if(event->type == MOUSEMOVE)
+ if (event->type == MOUSEMOVE)
return WM_UI_HANDLER_CONTINUE;
- if(event->type == LEFTMOUSE && event->val==KM_PRESS) {
+ if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
/* only cancel if click outside the button */
- if(ui_mouse_inside_button(but->active->region, but, event->x, event->y) == 0) {
+ if (ui_mouse_inside_button(but->active->region, but, event->x, event->y) == 0) {
/* data->cancel doesnt work, this button opens immediate */
- if(but->flag & UI_BUT_IMMEDIATE)
+ if (but->flag & UI_BUT_IMMEDIATE)
ui_set_but_val(but, 0);
else
- data->cancel= 1;
+ data->cancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
}
@@ -2258,28 +2140,28 @@ static int ui_do_but_HOTKEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data
/* always set */
but->modifier_key = 0;
- if(event->shift) but->modifier_key |= KM_SHIFT;
- if(event->alt) but->modifier_key |= KM_ALT;
- if(event->ctrl) but->modifier_key |= KM_CTRL;
- if(event->oskey) but->modifier_key |= KM_OSKEY;
+ if (event->shift) but->modifier_key |= KM_SHIFT;
+ if (event->alt) but->modifier_key |= KM_ALT;
+ if (event->ctrl) but->modifier_key |= KM_CTRL;
+ if (event->oskey) but->modifier_key |= KM_OSKEY;
ui_check_but(but);
ED_region_tag_redraw(data->region);
- if(event->val==KM_PRESS) {
- if(ISHOTKEY(event->type)) {
+ if (event->val == KM_PRESS) {
+ if (ISHOTKEY(event->type)) {
- if(WM_key_event_string(event->type)[0])
+ if (WM_key_event_string(event->type)[0])
ui_set_but_val(but, event->type);
else
- data->cancel= 1;
+ data->cancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
}
- else if(event->type == ESCKEY) {
- data->cancel= 1;
- data->escapecancel= 1;
+ else if (event->type == ESCKEY) {
+ data->cancel = 1;
+ data->escapecancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
@@ -2291,21 +2173,21 @@ static int ui_do_but_HOTKEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data
static int ui_do_but_KEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val==KM_PRESS) {
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_WAIT_KEY_EVENT);
return WM_UI_HANDLER_BREAK;
}
}
- else if(data->state == BUTTON_STATE_WAIT_KEY_EVENT) {
- if(event->type == MOUSEMOVE)
+ else if (data->state == BUTTON_STATE_WAIT_KEY_EVENT) {
+ if (event->type == MOUSEMOVE)
return WM_UI_HANDLER_CONTINUE;
- if(event->val==KM_PRESS) {
- if(WM_key_event_string(event->type)[0])
+ if (event->val == KM_PRESS) {
+ if (WM_key_event_string(event->type)[0])
ui_set_but_val(but, event->type);
else
- data->cancel= 1;
+ data->cancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
@@ -2316,20 +2198,20 @@ static int ui_do_but_KEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, w
static int ui_do_but_TEX(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN) && event->val==KM_PRESS) {
- if(but->dt == UI_EMBOSSN && !event->ctrl);
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN) && event->val == KM_PRESS) {
+ if (but->dt == UI_EMBOSSN && !event->ctrl) ;
else {
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
return WM_UI_HANDLER_BREAK;
}
}
}
- else if(data->state == BUTTON_STATE_TEXT_EDITING) {
+ else if (data->state == BUTTON_STATE_TEXT_EDITING) {
ui_do_but_textedit(C, block, but, data, event);
return WM_UI_HANDLER_BREAK;
}
- else if(data->state == BUTTON_STATE_TEXT_SELECTING) {
+ else if (data->state == BUTTON_STATE_TEXT_SELECTING) {
ui_do_but_textedit_select(C, block, but, data, event);
return WM_UI_HANDLER_BREAK;
}
@@ -2339,10 +2221,10 @@ static int ui_do_but_TEX(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
static int ui_do_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val==KM_PRESS) {
- data->togdual= event->ctrl;
- data->togonly= !event->shift;
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
+ data->togdual = event->ctrl;
+ data->togonly = !event->shift;
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
}
@@ -2353,42 +2235,42 @@ static int ui_do_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data, wmEv
static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
/* first handle click on icondrag type button */
- if(event->type==LEFTMOUSE && but->dragpoin) {
- if(ui_but_mouse_inside_icon(but, data->region, event)) {
+ if (event->type == LEFTMOUSE && but->dragpoin) {
+ if (ui_but_mouse_inside_icon(but, data->region, event)) {
/* tell the button to wait and keep checking further events to
* see if it should start dragging */
button_activate_state(C, but, BUTTON_STATE_WAIT_DRAG);
- data->dragstartx= event->x;
- data->dragstarty= event->y;
+ data->dragstartx = event->x;
+ data->dragstarty = event->y;
return WM_UI_HANDLER_CONTINUE;
}
}
- if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val==KM_PRESS) {
+ if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
int ret = WM_UI_HANDLER_BREAK;
/* XXX (a bit ugly) Special case handling for filebrowser drag button */
- if(but->dragpoin && but->imb && ui_but_mouse_inside_icon(but, data->region, event)) {
+ if (but->dragpoin && but->imb && ui_but_mouse_inside_icon(but, data->region, event)) {
ret = WM_UI_HANDLER_CONTINUE;
}
button_activate_state(C, but, BUTTON_STATE_EXIT);
return ret;
}
}
- else if(data->state == BUTTON_STATE_WAIT_DRAG) {
+ else if (data->state == BUTTON_STATE_WAIT_DRAG) {
/* this function also ends state */
- if(ui_but_start_drag(C, but, data, event)) {
+ if (ui_but_start_drag(C, but, data, event)) {
return WM_UI_HANDLER_BREAK;
}
/* If the mouse has been pressed and released, getting to
* this point without triggering a drag, then clear the
* drag state for this button and continue to pass on the event */
- if(event->type==LEFTMOUSE && event->val==KM_RELEASE) {
+ if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_CONTINUE;
}
@@ -2404,25 +2286,25 @@ static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, wmE
/* var names match ui_numedit_but_NUM */
static float ui_numedit_apply_snapf(uiBut *but, float tempf, float softmin, float softmax, float softrange, int snap)
{
- if(tempf==softmin || tempf==softmax || snap==0) {
+ if (tempf == softmin || tempf == softmax || snap == 0) {
/* pass */
}
else {
- float fac= 1.0f;
+ float fac = 1.0f;
- if(ui_is_but_unit(but)) {
- UnitSettings *unit= but->block->unit;
- int unit_type= uiButGetUnitType(but)>>16;
+ if (ui_is_but_unit(but)) {
+ UnitSettings *unit = but->block->unit;
+ int unit_type = uiButGetUnitType(but) >> 16;
- if(bUnit_IsValid(unit->system, unit_type)) {
- fac= (float)bUnit_BaseScalar(unit->system, unit_type);
- if(ELEM3(unit_type, B_UNIT_LENGTH, B_UNIT_AREA, B_UNIT_VOLUME)) {
+ if (bUnit_IsValid(unit->system, unit_type)) {
+ fac = (float)bUnit_BaseScalar(unit->system, unit_type);
+ if (ELEM3(unit_type, B_UNIT_LENGTH, B_UNIT_AREA, B_UNIT_VOLUME)) {
fac /= unit->scale_length;
}
}
}
- if(fac != 1.0f) {
+ if (fac != 1.0f) {
/* snap in unit-space */
tempf /= fac;
/* softmin /= fac; */ /* UNUSED */
@@ -2430,18 +2312,18 @@ static float ui_numedit_apply_snapf(uiBut *but, float tempf, float softmin, floa
softrange /= fac;
}
- if(snap==1) {
- if(softrange < 2.10f) tempf= 0.1f*floorf(10.0f*tempf);
- else if(softrange < 21.0f) tempf= floorf(tempf);
- else tempf= 10.0f*floorf(tempf/10.0f);
+ if (snap == 1) {
+ if (softrange < 2.10f) tempf = 0.1f * floorf(10.0f * tempf);
+ else if (softrange < 21.0f) tempf = floorf(tempf);
+ else tempf = 10.0f * floorf(tempf / 10.0f);
}
- else if(snap==2) {
- if(softrange < 2.10f) tempf= 0.01f*floorf(100.0f*tempf);
- else if(softrange < 21.0f) tempf= 0.1f*floorf(10.0f*tempf);
- else tempf= floor(tempf);
+ else if (snap == 2) {
+ if (softrange < 2.10f) tempf = 0.01f * floorf(100.0f * tempf);
+ else if (softrange < 21.0f) tempf = 0.1f * floorf(10.0f * tempf);
+ else tempf = floor(tempf);
}
- if(fac != 1.0f)
+ if (fac != 1.0f)
tempf *= fac;
}
@@ -2450,18 +2332,18 @@ static float ui_numedit_apply_snapf(uiBut *but, float tempf, float softmin, floa
static float ui_numedit_apply_snap(int temp, float softmin, float softmax, int snap)
{
- if(temp==softmin || temp==softmax)
+ if (temp == softmin || temp == softmax)
return temp;
- switch(snap) {
- case 0:
- break;
- case 1:
- temp= 10*(temp/10);
- break;
- case 2:
- temp= 100*(temp/100);
- break;
+ switch (snap) {
+ case 0:
+ break;
+ case 1:
+ temp = 10 * (temp / 10);
+ break;
+ case 2:
+ temp = 100 * (temp / 100);
+ break;
}
return temp;
@@ -2470,132 +2352,136 @@ static float ui_numedit_apply_snap(int temp, float softmin, float softmax, int s
static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, int snap, int mx)
{
float deler, tempf, softmin, softmax, softrange;
- int lvalue, temp, changed= 0;
+ int lvalue, temp, changed = 0;
- if(mx == data->draglastx)
+ if (mx == data->draglastx)
return changed;
/* drag-lock - prevent unwanted scroll adjustments */
/* change value (now 3) to adjust threshold in pixels */
- if(data->draglock) {
- if(abs(mx-data->dragstartx) <= 3)
+ if (data->draglock) {
+ if (abs(mx - data->dragstartx) <= 3)
return changed;
- data->draglock= 0;
- data->dragstartx= mx; /* ignore mouse movement within drag-lock */
+ data->draglock = 0;
+ data->dragstartx = mx; /* ignore mouse movement within drag-lock */
}
- softmin= but->softmin;
- softmax= but->softmax;
- softrange= softmax - softmin;
+ softmin = but->softmin;
+ softmax = but->softmax;
+ softrange = softmax - softmin;
- if(ui_is_a_warp_but(but)) {
+ if (ui_is_a_warp_but(but)) {
/* Mouse location isn't screen clamped to the screen so use a linear mapping
* 2px == 1-int, or 1px == 1-ClickStep */
- if(ui_is_but_float(but)) {
- fac *= 0.01f*but->a1;
+ if (ui_is_but_float(but)) {
+ fac *= 0.01f * but->a1;
tempf = (float)data->startvalue + ((float)(mx - data->dragstartx) * fac);
- tempf= ui_numedit_apply_snapf(but, tempf, softmin, softmax, softrange, snap);
-
-#if 1 /* fake moving the click start, nicer for dragging back after passing the limit */
- if(tempf < softmin) {
- data->dragstartx -= (softmin-tempf) / fac;
- tempf= softmin;
- } else if (tempf > softmax) {
- data->dragstartx += (tempf-softmax) / fac;
- tempf= softmax;
+ tempf = ui_numedit_apply_snapf(but, tempf, softmin, softmax, softrange, snap);
+
+#if 1 /* fake moving the click start, nicer for dragging back after passing the limit */
+ if (tempf < softmin) {
+ data->dragstartx -= (softmin - tempf) / fac;
+ tempf = softmin;
+ }
+ else if (tempf > softmax) {
+ data->dragstartx += (tempf - softmax) / fac;
+ tempf = softmax;
}
#else
CLAMP(tempf, softmin, softmax);
#endif
- if(tempf != (float)data->value) {
- data->dragchange= 1;
- data->value= tempf;
- changed= 1;
+ if (tempf != (float)data->value) {
+ data->dragchange = 1;
+ data->value = tempf;
+ changed = 1;
}
}
else {
- if(softrange > 256) fac= 1.0; /* 1px == 1 */
- else if(softrange > 32) fac= 1.0/2.0; /* 2px == 1 */
- else fac= 1.0/16.0; /* 16px == 1? */
-
- temp= data->startvalue + (((double)mx - data->dragstartx) * (double)fac);
- temp= ui_numedit_apply_snap(temp, softmin, softmax, snap);
-
-#if 1 /* fake moving the click start, nicer for dragging back after passing the limit */
- if(temp < softmin) {
- data->dragstartx -= (softmin-temp) / fac;
- temp= softmin;
- } else if (temp > softmax) {
- data->dragstartx += (temp-softmax) / fac;
- temp= softmax;
+ if (softrange > 256) fac = 1.0; /* 1px == 1 */
+ else if (softrange > 32) fac = 1.0 / 2.0; /* 2px == 1 */
+ else fac = 1.0 / 16.0; /* 16px == 1? */
+
+ temp = data->startvalue + (((double)mx - data->dragstartx) * (double)fac);
+ temp = ui_numedit_apply_snap(temp, softmin, softmax, snap);
+
+#if 1 /* fake moving the click start, nicer for dragging back after passing the limit */
+ if (temp < softmin) {
+ data->dragstartx -= (softmin - temp) / fac;
+ temp = softmin;
+ }
+ else if (temp > softmax) {
+ data->dragstartx += (temp - softmax) / fac;
+ temp = softmax;
}
#else
CLAMP(temp, softmin, softmax);
#endif
- if(temp != data->value) {
- data->dragchange= 1;
- data->value= temp;
- changed= 1;
+ if (temp != data->value) {
+ data->dragchange = 1;
+ data->value = temp;
+ changed = 1;
}
}
- data->draglastx= mx;
+ data->draglastx = mx;
}
else {
/* Use a non-linear mapping of the mouse drag especially for large floats (normal behavior) */
- deler= 500;
- if(!ui_is_but_float(but)) {
+ deler = 500;
+ if (!ui_is_but_float(but)) {
/* prevent large ranges from getting too out of control */
if (softrange > 600) deler = powf(softrange, 0.75);
- if (softrange < 100) deler= 200.0;
- if (softrange < 25) deler= 50.0;
+ if (softrange < 100) deler = 200.0;
+ if (softrange < 25) deler = 50.0;
}
deler /= fac;
- if(softrange > 11) {
+ if (softrange > 11) {
/* non linear change in mouse input- good for high precicsion */
- data->dragf+= (((float)(mx-data->draglastx))/deler) * (fabsf(data->dragstartx-mx)*0.002f);
- } else if (softrange > 129) { /* only scale large int buttons */
+ data->dragf += (((float)(mx - data->draglastx)) / deler) * (fabsf(data->dragstartx - mx) * 0.002f);
+ }
+ else if (softrange > 129) { /* only scale large int buttons */
/* non linear change in mouse input- good for high precicsionm ints need less fine tuning */
- data->dragf+= (((float)(mx-data->draglastx))/deler) * (fabsf(data->dragstartx-mx)*0.004f);
- } else {
+ data->dragf += (((float)(mx - data->draglastx)) / deler) * (fabsf(data->dragstartx - mx) * 0.004f);
+ }
+ else {
/*no scaling */
data->dragf += ((float)(mx - data->draglastx)) / deler;
}
CLAMP(data->dragf, 0.0f, 1.0f);
- data->draglastx= mx;
- tempf= (softmin + data->dragf*softrange);
+ data->draglastx = mx;
+ tempf = (softmin + data->dragf * softrange);
- if(!ui_is_but_float(but)) {
- temp= floorf(tempf + 0.5f);
+ if (!ui_is_but_float(but)) {
+ temp = floorf(tempf + 0.5f);
- temp= ui_numedit_apply_snap(temp, softmin, softmax, snap);
+ temp = ui_numedit_apply_snap(temp, softmin, softmax, snap);
CLAMP(temp, softmin, softmax);
- lvalue= (int)data->value;
+ lvalue = (int)data->value;
- if(temp != lvalue) {
- data->dragchange= 1;
- data->value= (double)temp;
- changed= 1;
+ if (temp != lvalue) {
+ data->dragchange = 1;
+ data->value = (double)temp;
+ changed = 1;
}
}
else {
- temp= 0;
- tempf= ui_numedit_apply_snapf(but, tempf, softmin, softmax, softrange, snap);
+ temp = 0;
+ tempf = ui_numedit_apply_snapf(but, tempf, softmin, softmax, softrange, snap);
CLAMP(tempf, softmin, softmax);
- if(tempf != (float)data->value) {
- data->dragchange= 1;
- data->value= tempf;
- changed= 1;
+ if (tempf != (float)data->value) {
+ data->dragchange = 1;
+ data->value = tempf;
+ changed = 1;
}
}
}
@@ -2606,112 +2492,112 @@ static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, i
static int ui_do_but_NUM(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
- int mx, my; /* mouse location scaled to fit the UI */
+ int mx, my; /* mouse location scaled to fit the UI */
int screen_mx, screen_my; /* mouse location kept at screen pixel coords */
- int click= 0;
- int retval= WM_UI_HANDLER_CONTINUE;
+ int click = 0;
+ int retval = WM_UI_HANDLER_CONTINUE;
- mx= screen_mx= event->x;
- my= screen_my= event->y;
+ mx = screen_mx = event->x;
+ my = screen_my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
/* XXX hardcoded keymap check.... */
- if(event->type == WHEELDOWNMOUSE && event->alt) {
- mx= but->x1;
- click= 1;
+ if (event->type == WHEELDOWNMOUSE && event->alt) {
+ mx = but->x1;
+ click = 1;
}
- else if(event->type == WHEELUPMOUSE && event->alt) {
- mx= but->x2;
- click= 1;
+ else if (event->type == WHEELUPMOUSE && event->alt) {
+ mx = but->x2;
+ click = 1;
}
- else if(event->val==KM_PRESS) {
- if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->ctrl) {
+ else if (event->val == KM_PRESS) {
+ if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->ctrl) {
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
- else if(event->type == LEFTMOUSE) {
- data->dragstartx= data->draglastx= ui_is_a_warp_but(but) ? screen_mx:mx;
+ else if (event->type == LEFTMOUSE) {
+ data->dragstartx = data->draglastx = ui_is_a_warp_but(but) ? screen_mx : mx;
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
- else if(ELEM(event->type, PADENTER, RETKEY) && event->val==KM_PRESS)
- click= 1;
- else if (event->type == MINUSKEY && event->val==KM_PRESS) {
+ else if (ELEM(event->type, PADENTER, RETKEY) && event->val == KM_PRESS)
+ click = 1;
+ else if (event->type == MINUSKEY && event->val == KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
data->value = -data->value;
button_activate_state(C, but, BUTTON_STATE_EXIT);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
}
}
- else if(data->state == BUTTON_STATE_NUM_EDITING) {
- if(event->type == ESCKEY) {
- data->cancel= 1;
- data->escapecancel= 1;
+ else if (data->state == BUTTON_STATE_NUM_EDITING) {
+ if (event->type == ESCKEY) {
+ data->cancel = 1;
+ data->escapecancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- else if(event->type == LEFTMOUSE && event->val!=KM_PRESS) {
- if(data->dragchange)
+ else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+ if (data->dragchange)
button_activate_state(C, but, BUTTON_STATE_EXIT);
else
- click= 1;
+ click = 1;
}
- else if(event->type == MOUSEMOVE) {
+ else if (event->type == MOUSEMOVE) {
float fac;
int snap;
- fac= 1.0f;
- if(event->shift) fac /= 10.0f;
- if(event->alt) fac /= 20.0f;
+ fac = 1.0f;
+ if (event->shift) fac /= 10.0f;
+ if (event->alt) fac /= 20.0f;
- snap= (event->ctrl)? (event->shift)? 2: 1: 0;
+ snap = (event->ctrl) ? (event->shift) ? 2 : 1 : 0;
- if(ui_numedit_but_NUM(but, data, fac, snap, (ui_is_a_warp_but(but) ? screen_mx:mx)))
+ if (ui_numedit_but_NUM(but, data, fac, snap, (ui_is_a_warp_but(but) ? screen_mx : mx)))
ui_numedit_apply(C, block, but, data);
}
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
- else if(data->state == BUTTON_STATE_TEXT_EDITING) {
+ else if (data->state == BUTTON_STATE_TEXT_EDITING) {
ui_do_but_textedit(C, block, but, data, event);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
- else if(data->state == BUTTON_STATE_TEXT_SELECTING) {
+ else if (data->state == BUTTON_STATE_TEXT_SELECTING) {
ui_do_but_textedit_select(C, block, but, data, event);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
- if(click) {
+ if (click) {
/* we can click on the side arrows to increment/decrement,
* or click inside to edit the value directly */
float tempf, softmin, softmax;
int temp;
- softmin= but->softmin;
- softmax= but->softmax;
+ softmin = but->softmin;
+ softmax = but->softmax;
- if(!ui_is_but_float(but)) {
- if(mx < (but->x1 + (but->x2 - but->x1)/3 - 3)) {
+ if (!ui_is_but_float(but)) {
+ if (mx < (but->x1 + (but->x2 - but->x1) / 3 - 3)) {
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
- temp= (int)data->value - 1;
- if(temp>=softmin && temp<=softmax)
- data->value= (double)temp;
+ temp = (int)data->value - 1;
+ if (temp >= softmin && temp <= softmax)
+ data->value = (double)temp;
else
- data->cancel= 1;
+ data->cancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- else if(mx > (but->x1 + (2*(but->x2 - but->x1)/3) + 3)) {
+ else if (mx > (but->x1 + (2 * (but->x2 - but->x1) / 3) + 3)) {
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
- temp= (int)data->value + 1;
- if(temp>=softmin && temp<=softmax)
- data->value= (double)temp;
+ temp = (int)data->value + 1;
+ if (temp >= softmin && temp <= softmax)
+ data->value = (double)temp;
else
- data->cancel= 1;
+ data->cancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
@@ -2719,21 +2605,21 @@ static int ui_do_but_NUM(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
}
else {
- if(mx < (but->x1 + (but->x2 - but->x1)/3 - 3)) {
+ if (mx < (but->x1 + (but->x2 - but->x1) / 3 - 3)) {
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
- tempf= (float)data->value - 0.01f * but->a1;
+ tempf = (float)data->value - 0.01f * but->a1;
if (tempf < softmin) tempf = softmin;
- data->value= tempf;
+ data->value = tempf;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- else if(mx > but->x1 + (2*((but->x2 - but->x1)/3) + 3)) {
+ else if (mx > but->x1 + (2 * ((but->x2 - but->x1) / 3) + 3)) {
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
- tempf= (float)data->value + 0.01f * but->a1;
+ tempf = (float)data->value + 0.01f * but->a1;
if (tempf > softmax) tempf = softmax;
- data->value= tempf;
+ data->value = tempf;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
@@ -2741,7 +2627,7 @@ static int ui_do_but_NUM(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
}
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
return retval;
@@ -2750,70 +2636,70 @@ static int ui_do_but_NUM(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
static int ui_numedit_but_SLI(uiBut *but, uiHandleButtonData *data, int shift, int ctrl, int mx)
{
float deler, f, tempf, softmin, softmax, softrange;
- int temp, lvalue, changed= 0;
+ int temp, lvalue, changed = 0;
- softmin= but->softmin;
- softmax= but->softmax;
- softrange= softmax - softmin;
+ softmin = but->softmin;
+ softmax = but->softmax;
+ softrange = softmax - softmin;
- if(but->type==NUMSLI) deler= ((but->x2-but->x1) - 5.0f*but->aspect);
- else if(but->type==HSVSLI) deler= ((but->x2-but->x1)/2.0f - 5.0f*but->aspect);
- else if(but->type==SCROLL) {
- int horizontal= (but->x2 - but->x1 > but->y2 - but->y1);
- float size= (horizontal)? (but->x2-but->x1): -(but->y2-but->y1);
- deler= size*(but->softmax - but->softmin)/(but->softmax - but->softmin + but->a1);
+ if (but->type == NUMSLI) deler = ((but->x2 - but->x1) - 5.0f * but->aspect);
+ else if (but->type == HSVSLI) deler = ((but->x2 - but->x1) / 2.0f - 5.0f * but->aspect);
+ else if (but->type == SCROLL) {
+ int horizontal = (but->x2 - but->x1 > but->y2 - but->y1);
+ float size = (horizontal) ? (but->x2 - but->x1) : -(but->y2 - but->y1);
+ deler = size * (but->softmax - but->softmin) / (but->softmax - but->softmin + but->a1);
}
- else deler= (but->x2-but->x1- 5.0f*but->aspect);
+ else deler = (but->x2 - but->x1 - 5.0f * but->aspect);
- f= (float)(mx-data->dragstartx)/deler + data->dragfstart;
+ f = (float)(mx - data->dragstartx) / deler + data->dragfstart;
- if(shift)
- f= (f-data->dragfstart)/10.0f + data->dragfstart;
+ if (shift)
+ f = (f - data->dragfstart) / 10.0f + data->dragfstart;
CLAMP(f, 0.0f, 1.0f);
- tempf= softmin + f*softrange;
- temp= floorf(tempf+0.5f);
-
- if(ctrl) {
- if(tempf==softmin || tempf==softmax);
- else if(ui_is_but_float(but)) {
-
- if(shift) {
- if(tempf==softmin || tempf==softmax);
- else if(softmax-softmin < 2.10f) tempf= 0.01f * floorf(100.0f*tempf);
- else if(softmax-softmin < 21.0f) tempf= 0.1f * floorf(10.0f*tempf);
- else tempf= floorf(tempf);
+ tempf = softmin + f * softrange;
+ temp = floorf(tempf + 0.5f);
+
+ if (ctrl) {
+ if (tempf == softmin || tempf == softmax) ;
+ else if (ui_is_but_float(but)) {
+
+ if (shift) {
+ if (tempf == softmin || tempf == softmax) ;
+ else if (softmax - softmin < 2.10f) tempf = 0.01f * floorf(100.0f * tempf);
+ else if (softmax - softmin < 21.0f) tempf = 0.1f * floorf(10.0f * tempf);
+ else tempf = floorf(tempf);
}
else {
- if(softmax-softmin < 2.10f) tempf= 0.1f * floorf(10.0f*tempf);
- else if(softmax-softmin < 21.0f) tempf= floorf(tempf);
- else tempf= 10.0f*floorf(tempf/10.0f);
+ if (softmax - softmin < 2.10f) tempf = 0.1f * floorf(10.0f * tempf);
+ else if (softmax - softmin < 21.0f) tempf = floorf(tempf);
+ else tempf = 10.0f * floorf(tempf / 10.0f);
}
}
else {
- temp= 10*(temp/10);
- tempf= temp;
+ temp = 10 * (temp / 10);
+ tempf = temp;
}
}
- if(!ui_is_but_float(but)) {
- lvalue= floor(data->value+0.5);
+ if (!ui_is_but_float(but)) {
+ lvalue = floor(data->value + 0.5);
CLAMP(temp, softmin, softmax);
- if(temp != lvalue) {
- data->value= temp;
- data->dragchange= 1;
- changed= 1;
+ if (temp != lvalue) {
+ data->value = temp;
+ data->dragchange = 1;
+ changed = 1;
}
}
else {
CLAMP(tempf, softmin, softmax);
- if(tempf != (float)data->value) {
- data->value= tempf;
- data->dragchange= 1;
- changed= 1;
+ if (tempf != (float)data->value) {
+ data->value = tempf;
+ data->dragchange = 1;
+ changed = 1;
}
}
@@ -2822,30 +2708,30 @@ static int ui_numedit_but_SLI(uiBut *but, uiHandleButtonData *data, int shift, i
static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
- int mx, my, click= 0;
- int retval= WM_UI_HANDLER_CONTINUE;
+ int mx, my, click = 0;
+ int retval = WM_UI_HANDLER_CONTINUE;
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
/* XXX hardcoded keymap check.... */
- if(event->type == WHEELDOWNMOUSE && event->alt) {
- mx= but->x1;
- click= 2;
+ if (event->type == WHEELDOWNMOUSE && event->alt) {
+ mx = but->x1;
+ click = 2;
}
- else if(event->type == WHEELUPMOUSE && event->alt) {
- mx= but->x2;
- click= 2;
+ else if (event->type == WHEELUPMOUSE && event->alt) {
+ mx = but->x2;
+ click = 2;
}
- else if(event->val==KM_PRESS) {
- if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->ctrl) {
+ else if (event->val == KM_PRESS) {
+ if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->ctrl) {
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
/* alt-click on sides to get "arrows" like in NUM buttons, and match wheel usage above */
- else if(event->type == LEFTMOUSE && event->alt) {
+ else if (event->type == LEFTMOUSE && event->alt) {
int halfpos = (but->x1 + but->x2) / 2;
click = 2;
if (mx < halfpos)
@@ -2853,102 +2739,102 @@ static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
else
mx = but->x2;
}
- else if(event->type == LEFTMOUSE) {
- data->dragstartx= mx;
- data->draglastx= mx;
+ else if (event->type == LEFTMOUSE) {
+ data->dragstartx = mx;
+ data->draglastx = mx;
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
- else if(ELEM(event->type, PADENTER, RETKEY) && event->val==KM_PRESS)
- click= 1;
- else if (event->type == MINUSKEY && event->val==KM_PRESS) {
+ else if (ELEM(event->type, PADENTER, RETKEY) && event->val == KM_PRESS)
+ click = 1;
+ else if (event->type == MINUSKEY && event->val == KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
data->value = -data->value;
button_activate_state(C, but, BUTTON_STATE_EXIT);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
}
}
- else if(data->state == BUTTON_STATE_NUM_EDITING) {
- if(event->type == ESCKEY) {
- data->cancel= 1;
- data->escapecancel= 1;
+ else if (data->state == BUTTON_STATE_NUM_EDITING) {
+ if (event->type == ESCKEY) {
+ data->cancel = 1;
+ data->escapecancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- else if(event->type == LEFTMOUSE && event->val!=KM_PRESS) {
- if(data->dragchange)
+ else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+ if (data->dragchange)
button_activate_state(C, but, BUTTON_STATE_EXIT);
else
- click= 1;
+ click = 1;
}
- else if(event->type == MOUSEMOVE) {
- if(ui_numedit_but_SLI(but, data, event->shift, event->ctrl, mx))
+ else if (event->type == MOUSEMOVE) {
+ if (ui_numedit_but_SLI(but, data, event->shift, event->ctrl, mx))
ui_numedit_apply(C, block, but, data);
}
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
- else if(data->state == BUTTON_STATE_TEXT_EDITING) {
+ else if (data->state == BUTTON_STATE_TEXT_EDITING) {
ui_do_but_textedit(C, block, but, data, event);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
- else if(data->state == BUTTON_STATE_TEXT_SELECTING) {
+ else if (data->state == BUTTON_STATE_TEXT_SELECTING) {
ui_do_but_textedit_select(C, block, but, data, event);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
- if(click) {
- if (click==2) {
+ if (click) {
+ if (click == 2) {
/* nudge slider to the left or right */
float f, tempf, softmin, softmax, softrange;
int temp;
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
- softmin= but->softmin;
- softmax= but->softmax;
- softrange= softmax - softmin;
+ softmin = but->softmin;
+ softmax = but->softmax;
+ softrange = softmax - softmin;
- tempf= data->value;
- temp= (int)data->value;
+ tempf = data->value;
+ temp = (int)data->value;
#if 0
- if(but->type==SLI) {
- f= (float)(mx-but->x1)/(but->x2-but->x1); /* same as below */
+ if (but->type == SLI) {
+ f = (float)(mx - but->x1) / (but->x2 - but->x1); /* same as below */
}
else
#endif
{
- f= (float)(mx- but->x1)/(but->x2-but->x1);
+ f = (float)(mx - but->x1) / (but->x2 - but->x1);
}
- f= softmin + f*softrange;
+ f = softmin + f * softrange;
- if(!ui_is_but_float(but)) {
- if(f<temp) temp--;
+ if (!ui_is_but_float(but)) {
+ if (f < temp) temp--;
else temp++;
- if(temp>=softmin && temp<=softmax)
- data->value= temp;
+ if (temp >= softmin && temp <= softmax)
+ data->value = temp;
else
- data->cancel= 1;
+ data->cancel = 1;
}
else {
- if(f<tempf) tempf -= 0.01f;
+ if (f < tempf) tempf -= 0.01f;
else tempf += 0.01f;
- if(tempf>=softmin && tempf<=softmax)
- data->value= tempf;
+ if (tempf >= softmin && tempf <= softmax)
+ data->value = tempf;
else
- data->cancel= 1;
+ data->cancel = 1;
}
button_activate_state(C, but, BUTTON_STATE_EXIT);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
else {
/* edit the value directly */
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
}
@@ -2958,48 +2844,49 @@ static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
static int ui_do_but_SCROLL(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
int mx, my /*, click= 0 */;
- int retval= WM_UI_HANDLER_CONTINUE;
- int horizontal= (but->x2 - but->x1 > but->y2 - but->y1);
+ int retval = WM_UI_HANDLER_CONTINUE;
+ int horizontal = (but->x2 - but->x1 > but->y2 - but->y1);
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(event->val==KM_PRESS) {
- if(event->type == LEFTMOUSE) {
- if(horizontal) {
- data->dragstartx= mx;
- data->draglastx= mx;
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (event->val == KM_PRESS) {
+ if (event->type == LEFTMOUSE) {
+ if (horizontal) {
+ data->dragstartx = mx;
+ data->draglastx = mx;
}
else {
- data->dragstartx= my;
- data->draglastx= my;
+ data->dragstartx = my;
+ data->draglastx = my;
}
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
- retval= WM_UI_HANDLER_BREAK;
+ 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)
- click= 1;
- */
+#if 0
+ else if (ELEM(event->type, PADENTER, RETKEY) && event->val == KM_PRESS)
+ click = 1;
+#endif
}
}
- else if(data->state == BUTTON_STATE_NUM_EDITING) {
- if(event->type == ESCKEY) {
- data->cancel= 1;
- data->escapecancel= 1;
+ else if (data->state == BUTTON_STATE_NUM_EDITING) {
+ if (event->type == ESCKEY) {
+ data->cancel = 1;
+ data->escapecancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- else if(event->type == LEFTMOUSE && event->val!=KM_PRESS) {
+ else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- else if(event->type == MOUSEMOVE) {
- if(ui_numedit_but_SLI(but, data, 0, 0, (horizontal)? mx: my))
+ else if (event->type == MOUSEMOVE) {
+ if (ui_numedit_but_SLI(but, data, 0, 0, (horizontal) ? mx : my))
ui_numedit_apply(C, block, but, data);
}
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
return retval;
@@ -3009,68 +2896,68 @@ static int ui_do_but_SCROLL(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
/* first handle click on icondrag type button */
- if(event->type==LEFTMOUSE && but->dragpoin && event->val==KM_PRESS) {
- if(ui_but_mouse_inside_icon(but, data->region, event)) {
+ if (event->type == LEFTMOUSE && but->dragpoin && event->val == KM_PRESS) {
+ if (ui_but_mouse_inside_icon(but, data->region, event)) {
button_activate_state(C, but, BUTTON_STATE_WAIT_DRAG);
- data->dragstartx= event->x;
- data->dragstarty= event->y;
+ data->dragstartx = event->x;
+ data->dragstarty = event->y;
return WM_UI_HANDLER_BREAK;
}
}
/* regular open menu */
- if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val==KM_PRESS) {
+ if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_MENU_OPEN);
return WM_UI_HANDLER_BREAK;
}
- else if(ELEM3(but->type, MENU, ICONROW, ICONTEXTROW)) {
+ else if (ELEM3(but->type, MENU, ICONROW, ICONTEXTROW)) {
- if(event->type == WHEELDOWNMOUSE && event->alt) {
- data->value= ui_step_name_menu(but, -1);
+ if (event->type == WHEELDOWNMOUSE && event->alt) {
+ data->value = ui_step_name_menu(but, -1);
button_activate_state(C, but, BUTTON_STATE_EXIT);
ui_apply_button(C, but->block, but, data, 1);
/* button's state need to be changed to EXIT so moving mouse away from this mouse wouldn't lead
- * to cancel changes made to this button, but shanging state to EXIT also makes no button active for
+ * to cancel changes made to this button, but changing state to EXIT also makes no button active for
* a while which leads to triggering operator when doing fast scrolling mouse wheel.
* using post activate stuff from button allows to make button be active again after checking for all
- * all that mouse leave and cancel stuff, so wuick scrool wouldnt't be an issue anumore.
+ * 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;
- data->posttype= BUTTON_ACTIVATE_OVER;
+ data->postbut = but;
+ data->posttype = BUTTON_ACTIVATE_OVER;
return WM_UI_HANDLER_BREAK;
}
- else if(event->type == WHEELUPMOUSE && event->alt) {
- data->value= ui_step_name_menu(but, 1);
+ else if (event->type == WHEELUPMOUSE && event->alt) {
+ data->value = ui_step_name_menu(but, 1);
button_activate_state(C, but, BUTTON_STATE_EXIT);
ui_apply_button(C, but->block, but, data, 1);
/* why this is needed described above */
- data->postbut= but;
- data->posttype= BUTTON_ACTIVATE_OVER;
+ data->postbut = but;
+ data->posttype = BUTTON_ACTIVATE_OVER;
return WM_UI_HANDLER_BREAK;
}
}
- else if(but->type==COL) {
- if( ELEM(event->type, WHEELDOWNMOUSE, WHEELUPMOUSE) && event->alt) {
- float *hsv= ui_block_hsv_get(but->block);
+ else if (but->type == COL) {
+ if (ELEM(event->type, WHEELDOWNMOUSE, WHEELUPMOUSE) && event->alt) {
+ float *hsv = ui_block_hsv_get(but->block);
float col[3];
ui_get_but_vectorf(but, col);
- rgb_to_hsv_compat(col[0], col[1], col[2], hsv, hsv+1, hsv+2);
+ rgb_to_hsv_compat(col[0], col[1], col[2], hsv, hsv + 1, hsv + 2);
- if(event->type==WHEELDOWNMOUSE)
- hsv[2]= CLAMPIS(hsv[2]-0.05f, 0.0f, 1.0f);
+ if (event->type == WHEELDOWNMOUSE)
+ hsv[2] = CLAMPIS(hsv[2] - 0.05f, 0.0f, 1.0f);
else
- hsv[2]= CLAMPIS(hsv[2]+0.05f, 0.0f, 1.0f);
+ hsv[2] = CLAMPIS(hsv[2] + 0.05f, 0.0f, 1.0f);
- hsv_to_rgb(hsv[0], hsv[1], hsv[2], data->vec, data->vec+1, data->vec+2);
+ hsv_to_rgb(hsv[0], hsv[1], hsv[2], data->vec, data->vec + 1, data->vec + 2);
ui_set_but_vectorf(but, data->vec);
button_activate_state(C, but, BUTTON_STATE_EXIT);
@@ -3079,21 +2966,21 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wm
}
}
}
- else if(data->state == BUTTON_STATE_WAIT_DRAG) {
+ else if (data->state == BUTTON_STATE_WAIT_DRAG) {
/* this function also ends state */
- if(ui_but_start_drag(C, but, data, event)) {
+ if (ui_but_start_drag(C, but, data, event)) {
return WM_UI_HANDLER_BREAK;
}
/* outside icon quit, not needed if drag activated */
- if(0==ui_but_mouse_inside_icon(but, data->region, event)) {
+ if (0 == ui_but_mouse_inside_icon(but, data->region, event)) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
- data->cancel= 1;
+ data->cancel = 1;
return WM_UI_HANDLER_BREAK;
}
- if(event->type==LEFTMOUSE && event->val==KM_RELEASE) {
+ if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
button_activate_state(C, but, BUTTON_STATE_MENU_OPEN);
return WM_UI_HANDLER_BREAK;
}
@@ -3106,58 +2993,58 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wm
static int ui_numedit_but_NORMAL(uiBut *but, uiHandleButtonData *data, int mx, int my)
{
float dx, dy, rad, radsq, mrad, *fp;
- int mdx, mdy, changed= 1;
+ int mdx, mdy, changed = 1;
/* button is presumed square */
/* 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);
- radsq= rad*rad;
+ fp = data->origvec;
+ rad = (but->x2 - but->x1);
+ radsq = rad * rad;
- if(fp[2]>0.0f) {
- mdx= (rad*fp[0]);
- mdy= (rad*fp[1]);
+ if (fp[2] > 0.0f) {
+ mdx = (rad * fp[0]);
+ mdy = (rad * fp[1]);
}
- else if(fp[2]> -1.0f) {
- mrad= rad/sqrtf(fp[0]*fp[0] + fp[1]*fp[1]);
+ else if (fp[2] > -1.0f) {
+ mrad = rad / sqrtf(fp[0] * fp[0] + fp[1] * fp[1]);
- mdx= 2.0f*mrad*fp[0] - (rad*fp[0]);
- mdy= 2.0f*mrad*fp[1] - (rad*fp[1]);
+ mdx = 2.0f * mrad * fp[0] - (rad * fp[0]);
+ mdy = 2.0f * mrad * fp[1] - (rad * fp[1]);
}
- else mdx= mdy= 0;
+ else mdx = mdy = 0;
- dx= (float)(mx+mdx-data->dragstartx);
- dy= (float)(my+mdy-data->dragstarty);
+ dx = (float)(mx + mdx - data->dragstartx);
+ dy = (float)(my + mdy - data->dragstarty);
- fp= data->vec;
- mrad= dx*dx+dy*dy;
- if(mrad < radsq) { /* inner circle */
- fp[0]= dx;
- fp[1]= dy;
- fp[2]= sqrt( radsq-dx*dx-dy*dy );
+ fp = data->vec;
+ mrad = dx * dx + dy * dy;
+ if (mrad < radsq) { /* inner circle */
+ fp[0] = dx;
+ fp[1] = dy;
+ fp[2] = sqrt(radsq - dx * dx - dy * dy);
}
- else { /* outer circle */
+ else { /* outer circle */
- mrad= rad/sqrtf(mrad); // veclen
+ mrad = rad / sqrtf(mrad); // veclen
- dx*= (2.0f*mrad - 1.0f);
- dy*= (2.0f*mrad - 1.0f);
+ dx *= (2.0f * mrad - 1.0f);
+ dy *= (2.0f * mrad - 1.0f);
- mrad= dx*dx+dy*dy;
- if(mrad < radsq) {
- fp[0]= dx;
- fp[1]= dy;
- fp[2]= -sqrt( radsq-dx*dx-dy*dy );
+ mrad = dx * dx + dy * dy;
+ if (mrad < radsq) {
+ fp[0] = dx;
+ fp[1] = dy;
+ fp[2] = -sqrt(radsq - dx * dx - dy * dy);
}
}
normalize_v3(fp);
- data->draglastx= mx;
- data->draglasty= my;
+ data->draglastx = mx;
+ data->draglasty = my;
return changed;
}
@@ -3166,33 +3053,33 @@ static int ui_do_but_NORMAL(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
{
int mx, my;
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(event->type==LEFTMOUSE && event->val==KM_PRESS) {
- data->dragstartx= mx;
- data->dragstarty= my;
- data->draglastx= mx;
- data->draglasty= my;
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
+ data->dragstartx = mx;
+ data->dragstarty = my;
+ data->draglastx = mx;
+ data->draglasty = my;
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
/* also do drag the first time */
- if(ui_numedit_but_NORMAL(but, data, mx, my))
+ if (ui_numedit_but_NORMAL(but, data, mx, my))
ui_numedit_apply(C, block, but, data);
return WM_UI_HANDLER_BREAK;
}
}
- else if(data->state == BUTTON_STATE_NUM_EDITING) {
- if(event->type == MOUSEMOVE) {
- if(mx!=data->draglastx || my!=data->draglasty) {
- if(ui_numedit_but_NORMAL(but, data, mx, my))
+ else if (data->state == BUTTON_STATE_NUM_EDITING) {
+ if (event->type == MOUSEMOVE) {
+ if (mx != data->draglastx || my != data->draglasty) {
+ if (ui_numedit_but_NORMAL(but, data, mx, my))
ui_numedit_apply(C, block, but, data);
}
}
- else if(event->type==LEFTMOUSE && event->val!=KM_PRESS)
+ else if (event->type == LEFTMOUSE && event->val != KM_PRESS)
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
@@ -3204,9 +3091,9 @@ static int ui_do_but_NORMAL(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx, int my)
{
float rgb[3];
- float *hsv= ui_block_hsv_get(but->block);
+ float *hsv = ui_block_hsv_get(but->block);
float x, y;
- int changed= 1;
+ int changed = 1;
int color_profile = but->block->color_profile;
if (but->rnaprop) {
@@ -3216,64 +3103,64 @@ static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx,
ui_get_but_vectorf(but, rgb);
- rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+ rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2);
/* relative position within box */
- x= ((float)mx-but->x1)/(but->x2-but->x1);
- y= ((float)my-but->y1)/(but->y2-but->y1);
+ x = ((float)mx - but->x1) / (but->x2 - but->x1);
+ y = ((float)my - but->y1) / (but->y2 - but->y1);
CLAMP(x, 0.0f, 1.0f);
CLAMP(y, 0.0f, 1.0f);
- switch((int)but->a1) {
- case UI_GRAD_SV:
- hsv[2]= x;
- hsv[1]= y;
- break;
- case UI_GRAD_HV:
- hsv[0]= x;
- hsv[2]= y;
- break;
- case UI_GRAD_HS:
- hsv[0]= x;
- hsv[1]= y;
- break;
- case UI_GRAD_H:
- hsv[0]= x;
- break;
- case UI_GRAD_S:
- hsv[1]= x;
- break;
- case UI_GRAD_V:
- hsv[2]= x;
- break;
- case UI_GRAD_V_ALT:
- /* vertical 'value' strip */
-
- /* exception only for value strip - use the range set in but->min/max */
- hsv[2] = y * (but->softmax - but->softmin) + but->softmin;
-
- if (color_profile)
- hsv[2] = srgb_to_linearrgb(hsv[2]);
-
- if (hsv[2] > but->softmax)
- hsv[2] = but->softmax;
- break;
- default:
- assert(!"invalid hsv type");
+ switch ((int)but->a1) {
+ case UI_GRAD_SV:
+ hsv[2] = x;
+ hsv[1] = y;
+ break;
+ case UI_GRAD_HV:
+ hsv[0] = x;
+ hsv[2] = y;
+ break;
+ case UI_GRAD_HS:
+ hsv[0] = x;
+ hsv[1] = y;
+ break;
+ case UI_GRAD_H:
+ hsv[0] = x;
+ break;
+ case UI_GRAD_S:
+ hsv[1] = x;
+ break;
+ case UI_GRAD_V:
+ hsv[2] = x;
+ break;
+ case UI_GRAD_V_ALT:
+ /* vertical 'value' strip */
+
+ /* exception only for value strip - use the range set in but->min/max */
+ hsv[2] = y * (but->softmax - but->softmin) + but->softmin;
+
+ if (color_profile)
+ hsv[2] = srgb_to_linearrgb(hsv[2]);
+
+ if (hsv[2] > but->softmax)
+ hsv[2] = but->softmax;
+ break;
+ default:
+ assert(!"invalid hsv type");
}
- hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2);
+ hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb + 1, rgb + 2);
copy_v3_v3(data->vec, rgb);
- data->draglastx= mx;
- data->draglasty= my;
+ data->draglastx = mx;
+ data->draglasty = my;
return changed;
}
static void ui_ndofedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, wmNDOFMotionData *ndof, int shift)
{
- float *hsv= ui_block_hsv_get(but->block);
+ float *hsv = ui_block_hsv_get(but->block);
float rgb[3];
float sensitivity = (shift ? 0.15f : 0.3f) * ndof->dt;
@@ -3285,9 +3172,9 @@ static void ui_ndofedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, wmNDOF
}
ui_get_but_vectorf(but, rgb);
- rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+ rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2);
- switch((int)but->a1) {
+ switch ((int)but->a1) {
case UI_GRAD_SV:
hsv[2] += ndof->ry * sensitivity;
hsv[1] += ndof->rx * sensitivity;
@@ -3323,7 +3210,7 @@ static void ui_ndofedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, wmNDOF
assert(!"invalid hsv type");
}
- hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2);
+ hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb + 1, rgb + 2);
copy_v3_v3(data->vec, rgb);
ui_set_but_vectorf(but, data->vec);
}
@@ -3332,26 +3219,26 @@ static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleBu
{
int mx, my;
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(event->type==LEFTMOUSE && event->val==KM_PRESS) {
- data->dragstartx= mx;
- data->dragstarty= my;
- data->draglastx= mx;
- data->draglasty= my;
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
+ data->dragstartx = mx;
+ data->dragstarty = my;
+ data->draglastx = mx;
+ data->draglasty = my;
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
/* also do drag the first time */
- if(ui_numedit_but_HSVCUBE(but, data, mx, my))
+ if (ui_numedit_but_HSVCUBE(but, data, mx, my))
ui_numedit_apply(C, block, but, data);
return WM_UI_HANDLER_BREAK;
}
else if (event->type == NDOF_MOTION) {
- wmNDOFMotionData *ndof = (wmNDOFMotionData*) event->customdata;
+ wmNDOFMotionData *ndof = (wmNDOFMotionData *) event->customdata;
ui_ndofedit_but_HSVCUBE(but, data, ndof, event->shift);
@@ -3361,26 +3248,26 @@ static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleBu
return WM_UI_HANDLER_BREAK;
}
/* XXX hardcoded keymap check.... */
- else if (event->type == DELKEY && event->val == KM_PRESS) {
- if (but->a1==UI_GRAD_V_ALT){
+ else if (event->type == BACKSPACEKEY && event->val == KM_PRESS) {
+ if (but->a1 == UI_GRAD_V_ALT) {
int len;
/* reset only value */
- len= RNA_property_array_length(&but->rnapoin, but->rnaprop);
+ len = RNA_property_array_length(&but->rnapoin, but->rnaprop);
if (len >= 3) {
float rgb[3], def_hsv[3];
float *def;
- float *hsv= ui_block_hsv_get(but->block);
- def= MEM_callocN(sizeof(float)*len, "reset_defaults - float");
+ float *hsv = ui_block_hsv_get(but->block);
+ def = MEM_callocN(sizeof(float) * len, "reset_defaults - float");
RNA_property_float_get_default_array(&but->rnapoin, but->rnaprop, def);
- rgb_to_hsv(def[0], def[1], def[2], def_hsv, def_hsv+1, def_hsv+2);
+ rgb_to_hsv(def[0], def[1], def[2], def_hsv, def_hsv + 1, def_hsv + 2);
ui_get_but_vectorf(but, rgb);
- rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+ rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2);
- hsv_to_rgb(hsv[0], hsv[1], def_hsv[2], rgb, rgb+1, rgb+2);
+ hsv_to_rgb(hsv[0], hsv[1], def_hsv[2], rgb, rgb + 1, rgb + 2);
ui_set_but_vectorf(but, rgb);
RNA_property_update(C, &but->rnapoin, but->rnaprop);
@@ -3391,19 +3278,19 @@ static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleBu
}
}
}
- else if(data->state == BUTTON_STATE_NUM_EDITING) {
- if(event->type == ESCKEY) {
- data->cancel= 1;
- data->escapecancel= 1;
+ else if (data->state == BUTTON_STATE_NUM_EDITING) {
+ if (event->type == ESCKEY) {
+ data->cancel = 1;
+ data->escapecancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- else if(event->type == MOUSEMOVE) {
- if(mx!=data->draglastx || my!=data->draglasty) {
- if(ui_numedit_but_HSVCUBE(but, data, mx, my))
+ else if (event->type == MOUSEMOVE) {
+ if (mx != data->draglastx || my != data->draglasty) {
+ if (ui_numedit_but_HSVCUBE(but, data, mx, my))
ui_numedit_apply(C, block, but, data);
}
}
- else if(event->type==LEFTMOUSE && event->val!=KM_PRESS)
+ else if (event->type == LEFTMOUSE && event->val != KM_PRESS)
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
@@ -3415,16 +3302,16 @@ static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleBu
static int ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, int mx, int my, int shift)
{
rcti rect;
- int changed= 1;
+ int changed = 1;
float rgb[3];
float hsv[3];
- rect.xmin= but->x1; rect.xmax= but->x2;
- rect.ymin= but->y1; rect.ymax= but->y2;
+ rect.xmin = but->x1; rect.xmax = but->x2;
+ rect.ymin = but->y1; rect.ymax = but->y2;
ui_get_but_vectorf(but, rgb);
copy_v3_v3(hsv, ui_block_hsv_get(but->block));
- rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+ rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2);
/* exception, when using color wheel in 'locked' value state:
* allow choosing a hue for black values, by giving a tiny increment */
@@ -3432,42 +3319,42 @@ static int ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, int mx
if (hsv[2] == 0.f) hsv[2] = 0.0001f;
}
- if(U.uiflag & USER_CONTINUOUS_MOUSE) {
- float fac= shift ? 0.05f : 1.0f;
+ if (U.uiflag & USER_CONTINUOUS_MOUSE) {
+ float fac = shift ? 0.05f : 1.0f;
/* slow down the mouse, this is fairly picky */
- mx = (data->dragstartx*(1.0f-fac) + mx*fac);
- my = (data->dragstarty*(1.0f-fac) + my*fac);
+ mx = (data->dragstartx * (1.0f - fac) + mx * fac);
+ my = (data->dragstarty * (1.0f - fac) + my * fac);
}
- ui_hsvcircle_vals_from_pos(hsv, hsv+1, &rect, (float)mx, (float)my);
+ ui_hsvcircle_vals_from_pos(hsv, hsv + 1, &rect, (float)mx, (float)my);
- if(but->flag & UI_BUT_COLOR_CUBIC)
- hsv[1]= 1.0f - sqrt3f(1.0f - hsv[1]);
+ if (but->flag & UI_BUT_COLOR_CUBIC)
+ hsv[1] = 1.0f - sqrt3f(1.0f - hsv[1]);
- hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2);
+ hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb + 1, rgb + 2);
- if((but->flag & UI_BUT_VEC_SIZE_LOCK) && (rgb[0] || rgb[1] || rgb[2])) {
+ if ((but->flag & UI_BUT_VEC_SIZE_LOCK) && (rgb[0] || rgb[1] || rgb[2])) {
normalize_v3(rgb);
mul_v3_fl(rgb, but->a2);
}
ui_set_but_vectorf(but, rgb);
- data->draglastx= mx;
- data->draglasty= my;
+ data->draglastx = mx;
+ data->draglasty = my;
return changed;
}
static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmNDOFMotionData *ndof, int shift)
{
- float *hsv= ui_block_hsv_get(but->block);
+ float *hsv = ui_block_hsv_get(but->block);
float rgb[3];
float phi, r /*, sqr */ /* UNUSED */, v[2];
float sensitivity = (shift ? 0.15f : 0.3f) * ndof->dt;
ui_get_but_vectorf(but, rgb);
- rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+ rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2);
/* Convert current colour on hue/sat disc to circular coordinates phi, r */
phi = fmodf(hsv[0] + 0.25f, 1.0f) * -2.0f * (float)M_PI;
@@ -3483,7 +3370,7 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmND
v[1] += ndof->rx * sensitivity;
/* convert back to polar coords on circle */
- phi = atan2f(v[0], v[1])/(2.0f*(float)M_PI) + 0.5f;
+ phi = atan2f(v[0], v[1]) / (2.0f * (float)M_PI) + 0.5f;
/* use ndof z rotation to additionally rotate hue */
phi -= ndof->rz * sensitivity * 0.5f;
@@ -3501,9 +3388,9 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmND
if (hsv[2] == 0.0f) hsv[2] = 0.0001f;
}
- hsv_to_rgb(hsv[0], hsv[1], hsv[2], data->vec, data->vec+1, data->vec+2);
+ hsv_to_rgb(hsv[0], hsv[1], hsv[2], data->vec, data->vec + 1, data->vec + 2);
- if((but->flag & UI_BUT_VEC_SIZE_LOCK) && (data->vec[0] || data->vec[1] || data->vec[2])) {
+ if ((but->flag & UI_BUT_VEC_SIZE_LOCK) && (data->vec[0] || data->vec[1] || data->vec[2])) {
normalize_v3(data->vec);
mul_v3_fl(data->vec, but->a2);
}
@@ -3515,26 +3402,26 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmND
static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
int mx, my;
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(event->type==LEFTMOUSE && event->val==KM_PRESS) {
- data->dragstartx= mx;
- data->dragstarty= my;
- data->draglastx= mx;
- data->draglasty= my;
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
+ data->dragstartx = mx;
+ data->dragstarty = my;
+ data->draglastx = mx;
+ data->draglasty = my;
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
/* also do drag the first time */
- if(ui_numedit_but_HSVCIRCLE(but, data, mx, my, event->shift))
+ if (ui_numedit_but_HSVCIRCLE(but, data, mx, my, event->shift))
ui_numedit_apply(C, block, but, data);
return WM_UI_HANDLER_BREAK;
}
else if (event->type == NDOF_MOTION) {
- wmNDOFMotionData *ndof = (wmNDOFMotionData*) event->customdata;
+ wmNDOFMotionData *ndof = (wmNDOFMotionData *) event->customdata;
ui_ndofedit_but_HSVCIRCLE(but, data, ndof, event->shift);
@@ -3544,25 +3431,25 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle
return WM_UI_HANDLER_BREAK;
}
/* XXX hardcoded keymap check.... */
- else if (event->type == DELKEY && event->val == KM_PRESS) {
+ else if (event->type == BACKSPACEKEY && event->val == KM_PRESS) {
int len;
/* reset only saturation */
- len= RNA_property_array_length(&but->rnapoin, but->rnaprop);
+ len = RNA_property_array_length(&but->rnapoin, but->rnaprop);
if (len >= 3) {
float rgb[3], def_hsv[3];
float *def;
- float *hsv= ui_block_hsv_get(but->block);
- def= MEM_callocN(sizeof(float)*len, "reset_defaults - float");
+ float *hsv = ui_block_hsv_get(but->block);
+ def = MEM_callocN(sizeof(float) * len, "reset_defaults - float");
RNA_property_float_get_default_array(&but->rnapoin, but->rnaprop, def);
- rgb_to_hsv(def[0], def[1], def[2], def_hsv, def_hsv+1, def_hsv+2);
+ rgb_to_hsv(def[0], def[1], def[2], def_hsv, def_hsv + 1, def_hsv + 2);
ui_get_but_vectorf(but, rgb);
- rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+ rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2);
- hsv_to_rgb(hsv[0], def_hsv[1], hsv[2], rgb, rgb+1, rgb+2);
+ hsv_to_rgb(hsv[0], def_hsv[1], hsv[2], rgb, rgb + 1, rgb + 2);
ui_set_but_vectorf(but, rgb);
RNA_property_update(C, &but->rnapoin, but->rnaprop);
@@ -3572,32 +3459,32 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle
return WM_UI_HANDLER_BREAK;
}
}
- else if(data->state == BUTTON_STATE_NUM_EDITING) {
- if(event->type == ESCKEY) {
- data->cancel= 1;
- data->escapecancel= 1;
+ else if (data->state == BUTTON_STATE_NUM_EDITING) {
+ if (event->type == ESCKEY) {
+ data->cancel = 1;
+ data->escapecancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
/* XXX hardcoded keymap check.... */
- else if(event->type == WHEELDOWNMOUSE) {
- float *hsv= ui_block_hsv_get(but->block);
- hsv[2]= CLAMPIS(hsv[2]-0.05f, 0.0f, 1.0f);
- ui_set_but_hsv(but); // converts to rgb
+ else if (event->type == WHEELDOWNMOUSE) {
+ float *hsv = ui_block_hsv_get(but->block);
+ hsv[2] = CLAMPIS(hsv[2] - 0.05f, 0.0f, 1.0f);
+ ui_set_but_hsv(but); // converts to rgb
ui_numedit_apply(C, block, but, data);
}
- else if(event->type == WHEELUPMOUSE) {
- float *hsv= ui_block_hsv_get(but->block);
- hsv[2]= CLAMPIS(hsv[2]+0.05f, 0.0f, 1.0f);
- ui_set_but_hsv(but); // converts to rgb
+ else if (event->type == WHEELUPMOUSE) {
+ float *hsv = ui_block_hsv_get(but->block);
+ hsv[2] = CLAMPIS(hsv[2] + 0.05f, 0.0f, 1.0f);
+ ui_set_but_hsv(but); // converts to rgb
ui_numedit_apply(C, block, but, data);
}
- else if(event->type == MOUSEMOVE) {
- if(mx!=data->draglastx || my!=data->draglasty) {
- if(ui_numedit_but_HSVCIRCLE(but, data, mx, my, event->shift))
+ else if (event->type == MOUSEMOVE) {
+ if (mx != data->draglastx || my != data->draglasty) {
+ if (ui_numedit_but_HSVCIRCLE(but, data, mx, my, event->shift))
ui_numedit_apply(C, block, but, data);
}
}
- else if(event->type==LEFTMOUSE && event->val!=KM_PRESS) {
+ else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
return WM_UI_HANDLER_BREAK;
@@ -3610,20 +3497,20 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle
static int ui_numedit_but_COLORBAND(uiBut *but, uiHandleButtonData *data, int mx)
{
float dx;
- int changed= 0;
+ int changed = 0;
- if(data->draglastx == mx)
+ if (data->draglastx == mx)
return changed;
- dx= ((float)(mx - data->draglastx))/(but->x2-but->x1);
+ dx = ((float)(mx - data->draglastx)) / (but->x2 - but->x1);
data->dragcbd->pos += dx;
CLAMP(data->dragcbd->pos, 0.0f, 1.0f);
colorband_update_sort(data->coba);
- data->dragcbd= data->coba->data + data->coba->cur; /* because qsort */
+ data->dragcbd = data->coba->data + data->coba->cur; /* because qsort */
- data->draglastx= mx;
- changed= 1;
+ data->draglastx = mx;
+ changed = 1;
return changed;
}
@@ -3632,54 +3519,54 @@ static int ui_do_but_COLORBAND(bContext *C, uiBlock *block, uiBut *but, uiHandle
{
ColorBand *coba;
CBData *cbd;
- int mx, my, a, xco, mindist= 12;
+ int mx, my, a, xco, mindist = 12;
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(event->type==LEFTMOUSE && event->val==KM_PRESS) {
- coba= (ColorBand*)but->poin;
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
+ coba = (ColorBand *)but->poin;
- if(event->ctrl) {
+ if (event->ctrl) {
/* insert new key on mouse location */
- float pos= ((float)(mx - but->x1))/(but->x2-but->x1);
+ float pos = ((float)(mx - but->x1)) / (but->x2 - but->x1);
colorband_element_add(coba, pos);
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
else {
- data->dragstartx= mx;
- data->dragstarty= my;
- data->draglastx= mx;
- data->draglasty= my;
+ data->dragstartx = mx;
+ data->dragstarty = my;
+ data->draglastx = mx;
+ data->draglasty = my;
/* activate new key when mouse is close */
- for(a=0, cbd= coba->data; a<coba->tot; a++, cbd++) {
- xco= but->x1 + (cbd->pos*(but->x2-but->x1));
- xco= ABS(xco-mx);
- if(a==coba->cur) xco+= 5; // selected one disadvantage
- if(xco<mindist) {
- coba->cur= a;
- mindist= xco;
+ for (a = 0, cbd = coba->data; a < coba->tot; a++, cbd++) {
+ xco = but->x1 + (cbd->pos * (but->x2 - but->x1));
+ xco = ABS(xco - mx);
+ if (a == coba->cur) xco += 5; // selected one disadvantage
+ if (xco < mindist) {
+ coba->cur = a;
+ mindist = xco;
}
}
- data->dragcbd= coba->data + coba->cur;
+ data->dragcbd = coba->data + coba->cur;
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
}
return WM_UI_HANDLER_BREAK;
}
}
- else if(data->state == BUTTON_STATE_NUM_EDITING) {
- if(event->type == MOUSEMOVE) {
- if(mx!=data->draglastx || my!=data->draglasty) {
- if(ui_numedit_but_COLORBAND(but, data, mx))
+ else if (data->state == BUTTON_STATE_NUM_EDITING) {
+ if (event->type == MOUSEMOVE) {
+ if (mx != data->draglastx || my != data->draglasty) {
+ if (ui_numedit_but_COLORBAND(but, data, mx))
ui_numedit_apply(C, block, but, data);
}
}
- else if(event->type==LEFTMOUSE && event->val!=KM_PRESS)
+ else if (event->type == LEFTMOUSE && event->val != KM_PRESS)
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
@@ -3690,81 +3577,81 @@ static int ui_do_but_COLORBAND(bContext *C, uiBlock *block, uiBut *but, uiHandle
static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap, int mx, int my)
{
- CurveMapping *cumap= (CurveMapping*)but->poin;
- CurveMap *cuma= cumap->cm+cumap->cur;
- CurveMapPoint *cmp= cuma->curve;
+ CurveMapping *cumap = (CurveMapping *)but->poin;
+ CurveMap *cuma = cumap->cm + cumap->cur;
+ CurveMapPoint *cmp = cuma->curve;
float fx, fy, zoomx, zoomy /*, offsx, offsy */ /* UNUSED */;
- int a, changed= 0;
+ int a, changed = 0;
- zoomx= (but->x2-but->x1)/(cumap->curr.xmax-cumap->curr.xmin);
- zoomy= (but->y2-but->y1)/(cumap->curr.ymax-cumap->curr.ymin);
+ zoomx = (but->x2 - but->x1) / (cumap->curr.xmax - cumap->curr.xmin);
+ zoomy = (but->y2 - but->y1) / (cumap->curr.ymax - cumap->curr.ymin);
/* offsx= cumap->curr.xmin; */
/* offsy= cumap->curr.ymin; */
- if(snap) {
+ if (snap) {
float d[2];
- d[0]= mx - data->dragstartx;
- d[1]= my - data->dragstarty;
+ d[0] = mx - data->dragstartx;
+ d[1] = my - data->dragstarty;
- if(len_v2(d) < 3.0f)
- snap= 0;
+ if (len_v2(d) < 3.0f)
+ snap = 0;
}
- if(data->dragsel != -1) {
- int moved_point= 0; /* for ctrl grid, can't use orig coords because of sorting */
+ if (data->dragsel != -1) {
+ int moved_point = 0; /* for ctrl grid, can't use orig coords because of sorting */
- fx= (mx-data->draglastx)/zoomx;
- fy= (my-data->draglasty)/zoomy;
- for(a=0; a<cuma->totpoint; a++) {
- if(cmp[a].flag & SELECT) {
- float origx= cmp[a].x, origy= cmp[a].y;
- cmp[a].x+= fx;
- cmp[a].y+= fy;
- if(snap) {
- cmp[a].x= 0.125f*floorf(0.5f + 8.0f*cmp[a].x);
- cmp[a].y= 0.125f*floorf(0.5f + 8.0f*cmp[a].y);
+ fx = (mx - data->draglastx) / zoomx;
+ fy = (my - data->draglasty) / zoomy;
+ for (a = 0; a < cuma->totpoint; a++) {
+ if (cmp[a].flag & SELECT) {
+ float origx = cmp[a].x, origy = cmp[a].y;
+ cmp[a].x += fx;
+ cmp[a].y += fy;
+ if (snap) {
+ cmp[a].x = 0.125f * floorf(0.5f + 8.0f * cmp[a].x);
+ cmp[a].y = 0.125f * floorf(0.5f + 8.0f * cmp[a].y);
}
- if(cmp[a].x!=origx || cmp[a].y!=origy)
- moved_point= 1;
+ if (cmp[a].x != origx || cmp[a].y != origy)
+ moved_point = 1;
}
}
- curvemapping_changed(cumap, 0); /* no remove doubles */
+ curvemapping_changed(cumap, 0); /* no remove doubles */
- if(moved_point) {
- data->draglastx= mx;
- data->draglasty= my;
- changed= 1;
+ if (moved_point) {
+ data->draglastx = mx;
+ data->draglasty = my;
+ changed = 1;
}
- data->dragchange= 1; /* mark for selection */
+ data->dragchange = 1; /* mark for selection */
}
else {
- fx= (mx-data->draglastx)/zoomx;
- fy= (my-data->draglasty)/zoomy;
+ fx = (mx - data->draglastx) / zoomx;
+ fy = (my - data->draglasty) / zoomy;
/* clamp for clip */
- if(cumap->flag & CUMA_DO_CLIP) {
- if(cumap->curr.xmin-fx < cumap->clipr.xmin)
- fx= cumap->curr.xmin - cumap->clipr.xmin;
- else if(cumap->curr.xmax-fx > cumap->clipr.xmax)
- fx= cumap->curr.xmax - cumap->clipr.xmax;
- if(cumap->curr.ymin-fy < cumap->clipr.ymin)
- fy= cumap->curr.ymin - cumap->clipr.ymin;
- else if(cumap->curr.ymax-fy > cumap->clipr.ymax)
- fy= cumap->curr.ymax - cumap->clipr.ymax;
- }
-
- cumap->curr.xmin-=fx;
- cumap->curr.ymin-=fy;
- cumap->curr.xmax-=fx;
- cumap->curr.ymax-=fy;
+ if (cumap->flag & CUMA_DO_CLIP) {
+ if (cumap->curr.xmin - fx < cumap->clipr.xmin)
+ fx = cumap->curr.xmin - cumap->clipr.xmin;
+ else if (cumap->curr.xmax - fx > cumap->clipr.xmax)
+ fx = cumap->curr.xmax - cumap->clipr.xmax;
+ if (cumap->curr.ymin - fy < cumap->clipr.ymin)
+ fy = cumap->curr.ymin - cumap->clipr.ymin;
+ else if (cumap->curr.ymax - fy > cumap->clipr.ymax)
+ fy = cumap->curr.ymax - cumap->clipr.ymax;
+ }
+
+ cumap->curr.xmin -= fx;
+ cumap->curr.ymin -= fy;
+ cumap->curr.xmax -= fx;
+ cumap->curr.ymax -= fy;
- data->draglastx= mx;
- data->draglasty= my;
+ data->draglastx = mx;
+ data->draglasty = my;
- changed= 1;
+ changed = 1;
}
return changed;
@@ -3772,44 +3659,44 @@ static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap,
static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
- int mx, my, a, changed= 0;
+ int mx, my, a, changed = 0;
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(event->type==LEFTMOUSE && event->val==KM_PRESS) {
- CurveMapping *cumap= (CurveMapping*)but->poin;
- CurveMap *cuma= cumap->cm+cumap->cur;
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
+ CurveMapping *cumap = (CurveMapping *)but->poin;
+ CurveMap *cuma = cumap->cm + cumap->cur;
CurveMapPoint *cmp;
float fx, fy, zoomx, zoomy, offsx, offsy;
- float dist, mindist= 200.0f; // 14 pixels radius
- int sel= -1;
+ float dist, mindist = 200.0f; // 14 pixels radius
+ int sel = -1;
- zoomx= (but->x2-but->x1)/(cumap->curr.xmax-cumap->curr.xmin);
- zoomy= (but->y2-but->y1)/(cumap->curr.ymax-cumap->curr.ymin);
- offsx= cumap->curr.xmin;
- offsy= cumap->curr.ymin;
+ zoomx = (but->x2 - but->x1) / (cumap->curr.xmax - cumap->curr.xmin);
+ zoomy = (but->y2 - but->y1) / (cumap->curr.ymax - cumap->curr.ymin);
+ offsx = cumap->curr.xmin;
+ offsy = cumap->curr.ymin;
- if(event->ctrl) {
- fx= ((float)my - but->x1)/zoomx + offsx;
- fy= ((float)my - but->y1)/zoomy + offsy;
+ if (event->ctrl) {
+ fx = ((float)my - but->x1) / zoomx + offsx;
+ fy = ((float)my - but->y1) / zoomy + offsy;
curvemap_insert(cuma, fx, fy);
curvemapping_changed(cumap, 0);
- changed= 1;
+ changed = 1;
}
/* check for selecting of a point */
- cmp= cuma->curve; /* ctrl adds point, new malloc */
- for(a=0; a<cuma->totpoint; a++) {
- fx= but->x1 + zoomx*(cmp[a].x-offsx);
- fy= but->y1 + zoomy*(cmp[a].y-offsy);
- dist= (fx-mx)*(fx-mx) + (fy-my)*(fy-my);
- if(dist < mindist) {
- sel= a;
- mindist= dist;
+ cmp = cuma->curve; /* ctrl adds point, new malloc */
+ for (a = 0; a < cuma->totpoint; a++) {
+ fx = but->x1 + zoomx * (cmp[a].x - offsx);
+ fy = but->y1 + zoomy * (cmp[a].y - offsy);
+ dist = (fx - mx) * (fx - mx) + (fy - my) * (fy - my);
+ if (dist < mindist) {
+ sel = a;
+ mindist = dist;
}
}
@@ -3818,14 +3705,14 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt
/* if the click didn't select anything, check if it's clicked on the
* curve itself, and if so, add a point */
- fx= ((float)mx - but->x1)/zoomx + offsx;
- fy= ((float)my - but->y1)/zoomy + offsy;
+ fx = ((float)mx - but->x1) / zoomx + offsx;
+ fy = ((float)my - but->y1) / zoomy + offsy;
- cmp= cuma->table;
+ cmp = cuma->table;
/* loop through the curve segment table and find what's near the mouse.
* 0.05 is kinda arbitrary, but seems to be what works nicely. */
- for(i=0; i<=CM_TABLE; i++) {
+ for (i = 0; i <= CM_TABLE; i++) {
if ( (fabsf(fx - cmp[i].x) < 0.05f) &&
(fabsf(fy - cmp[i].y) < 0.05f))
{
@@ -3833,14 +3720,14 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt
curvemap_insert(cuma, fx, fy);
curvemapping_changed(cumap, 0);
- changed= 1;
+ changed = 1;
/* reset cmp back to the curve points again, rather than drawing segments */
- cmp= cuma->curve;
+ cmp = cuma->curve;
/* find newly added point and make it 'sel' */
- for(a=0; a<cuma->totpoint; a++)
- if(cmp[a].x == fx)
+ for (a = 0; a < cuma->totpoint; a++)
+ if (cmp[a].x == fx)
sel = a;
break;
@@ -3848,11 +3735,11 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt
}
}
- if(sel!= -1) {
+ if (sel != -1) {
/* ok, we move a point */
/* deselect all if this one is deselect. except if we hold shift */
- if(event->shift == FALSE) {
- for(a=0; a<cuma->totpoint; a++)
+ if (event->shift == FALSE) {
+ for (a = 0; a < cuma->totpoint; a++)
cmp[a].flag &= ~SELECT;
cmp[sel].flag |= SELECT;
}
@@ -3861,43 +3748,43 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt
}
else {
/* move the view */
- data->cancel= 1;
+ data->cancel = 1;
}
- data->dragsel= sel;
+ data->dragsel = sel;
- data->dragstartx= mx;
- data->dragstarty= my;
- data->draglastx= mx;
- data->draglasty= my;
+ data->dragstartx = mx;
+ data->dragstarty = my;
+ data->draglastx = mx;
+ data->draglasty = my;
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
return WM_UI_HANDLER_BREAK;
}
}
- else if(data->state == BUTTON_STATE_NUM_EDITING) {
- if(event->type == MOUSEMOVE) {
- if(mx!=data->draglastx || my!=data->draglasty) {
- if(ui_numedit_but_CURVE(but, data, event->ctrl, mx, my))
+ else if (data->state == BUTTON_STATE_NUM_EDITING) {
+ if (event->type == MOUSEMOVE) {
+ if (mx != data->draglastx || my != data->draglasty) {
+ if (ui_numedit_but_CURVE(but, data, event->ctrl, mx, my))
ui_numedit_apply(C, block, but, data);
}
}
- else if(event->type==LEFTMOUSE && event->val!=KM_PRESS) {
- if(data->dragsel != -1) {
- CurveMapping *cumap= (CurveMapping*)but->poin;
- CurveMap *cuma= cumap->cm+cumap->cur;
- CurveMapPoint *cmp= cuma->curve;
+ else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+ if (data->dragsel != -1) {
+ CurveMapping *cumap = (CurveMapping *)but->poin;
+ CurveMap *cuma = cumap->cm + cumap->cur;
+ CurveMapPoint *cmp = cuma->curve;
- if(!data->dragchange) {
+ if (!data->dragchange) {
/* deselect all, select one */
- if(event->shift == FALSE) {
- for(a=0; a<cuma->totpoint; a++)
+ if (event->shift == FALSE) {
+ for (a = 0; a < cuma->totpoint; a++)
cmp[a].flag &= ~SELECT;
cmp[data->dragsel].flag |= SELECT;
}
}
else
- curvemapping_changed(cumap, 1); /* remove doubles */
+ curvemapping_changed(cumap, 1); /* remove doubles */
}
button_activate_state(C, but, BUTTON_STATE_EXIT);
@@ -3922,20 +3809,21 @@ static int ui_numedit_but_HISTOGRAM(uiBut *but, uiHandleButtonData *data, int mx
{
Histogram *hist = (Histogram *)but->poin;
/* rcti rect; */
- int changed= 1;
- float /* dx, */ dy, yfac=1.f; /* UNUSED */
+ int changed = 1;
+ float /* dx, */ dy, yfac = 1.f; /* UNUSED */
- /* rect.xmin= but->x1; rect.xmax= but->x2; */
- /* rect.ymin= but->y1; rect.ymax= but->y2; */
+ /* rect.xmin = but->x1; rect.xmax = but->x2; */
+ /* rect.ymin = but->y1; rect.ymax = but->y2; */
/* dx = mx - data->draglastx; */ /* UNUSED */
dy = my - data->draglasty;
if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) {
- /* resize histogram widget itself */
+ /* resize histogram widget itself */
hist->height = (but->y2 - but->y1) + (data->dragstarty - my);
- } else {
+ }
+ else {
/* scale histogram values */
yfac = MIN2(powf(hist->ymax, 2.f), 1.f) * 0.5f;
hist->ymax += dy * yfac;
@@ -3943,8 +3831,8 @@ static int ui_numedit_but_HISTOGRAM(uiBut *but, uiHandleButtonData *data, int mx
CLAMP(hist->ymax, 1.f, 100.f);
}
- data->draglastx= mx;
- data->draglasty= my;
+ data->draglastx = mx;
+ data->draglasty = my;
return changed;
}
@@ -3953,26 +3841,26 @@ static int ui_do_but_HISTOGRAM(bContext *C, uiBlock *block, uiBut *but, uiHandle
{
int mx, my;
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(event->type==LEFTMOUSE && event->val==KM_PRESS) {
- data->dragstartx= mx;
- data->dragstarty= my;
- data->draglastx= mx;
- data->draglasty= my;
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
+ data->dragstartx = mx;
+ data->dragstarty = my;
+ data->draglastx = mx;
+ data->draglasty = my;
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
/* also do drag the first time */
- if(ui_numedit_but_HISTOGRAM(but, data, mx, my))
+ if (ui_numedit_but_HISTOGRAM(but, data, mx, my))
ui_numedit_apply(C, block, but, data);
return WM_UI_HANDLER_BREAK;
}
/* XXX hardcoded keymap check.... */
- else if (event->type == DELKEY && event->val == KM_PRESS) {
+ else if (event->type == BACKSPACEKEY && event->val == KM_PRESS) {
Histogram *hist = (Histogram *)but->poin;
hist->ymax = 1.f;
@@ -3980,19 +3868,19 @@ static int ui_do_but_HISTOGRAM(bContext *C, uiBlock *block, uiBut *but, uiHandle
return WM_UI_HANDLER_BREAK;
}
}
- else if(data->state == BUTTON_STATE_NUM_EDITING) {
- if(event->type == ESCKEY) {
- data->cancel= 1;
- data->escapecancel= 1;
+ else if (data->state == BUTTON_STATE_NUM_EDITING) {
+ if (event->type == ESCKEY) {
+ data->cancel = 1;
+ data->escapecancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- else if(event->type == MOUSEMOVE) {
- if(mx!=data->draglastx || my!=data->draglasty) {
- if(ui_numedit_but_HISTOGRAM(but, data, mx, my))
+ else if (event->type == MOUSEMOVE) {
+ if (mx != data->draglastx || my != data->draglasty) {
+ if (ui_numedit_but_HISTOGRAM(but, data, mx, my))
ui_numedit_apply(C, block, but, data);
}
}
- else if(event->type==LEFTMOUSE && event->val!=KM_PRESS) {
+ else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
return WM_UI_HANDLER_BREAK;
@@ -4005,29 +3893,30 @@ static int ui_numedit_but_WAVEFORM(uiBut *but, uiHandleButtonData *data, int mx,
{
Scopes *scopes = (Scopes *)but->poin;
/* rcti rect; */
- int changed= 1;
+ int changed = 1;
float /* dx, */ dy /* , yfac=1.f */; /* UNUSED */
- /* rect.xmin= but->x1; rect.xmax= but->x2; */
- /* rect.ymin= but->y1; rect.ymax= but->y2; */
+ /* rect.xmin = but->x1; rect.xmax = but->x2; */
+ /* rect.ymin = but->y1; rect.ymax = but->y2; */
/* dx = mx - data->draglastx; */ /* UNUSED */
dy = my - data->draglasty;
if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) {
- /* resize waveform widget itself */
+ /* resize waveform widget itself */
scopes->wavefrm_height = (but->y2 - but->y1) + (data->dragstarty - my);
- } else {
+ }
+ else {
/* scale waveform values */
/* yfac = scopes->wavefrm_yfac; */ /* UNUSED */
- scopes->wavefrm_yfac += dy/200.0f;
+ scopes->wavefrm_yfac += dy / 200.0f;
CLAMP(scopes->wavefrm_yfac, 0.5f, 2.f);
}
- data->draglastx= mx;
- data->draglasty= my;
+ data->draglastx = mx;
+ data->draglasty = my;
return changed;
}
@@ -4036,26 +3925,26 @@ static int ui_do_but_WAVEFORM(bContext *C, uiBlock *block, uiBut *but, uiHandleB
{
int mx, my;
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(event->type==LEFTMOUSE && event->val==KM_PRESS) {
- data->dragstartx= mx;
- data->dragstarty= my;
- data->draglastx= mx;
- data->draglasty= my;
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
+ data->dragstartx = mx;
+ data->dragstarty = my;
+ data->draglastx = mx;
+ data->draglasty = my;
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
/* also do drag the first time */
- if(ui_numedit_but_WAVEFORM(but, data, mx, my))
+ if (ui_numedit_but_WAVEFORM(but, data, mx, my))
ui_numedit_apply(C, block, but, data);
return WM_UI_HANDLER_BREAK;
}
/* XXX hardcoded keymap check.... */
- else if (event->type == DELKEY && event->val == KM_PRESS) {
+ else if (event->type == BACKSPACEKEY && event->val == KM_PRESS) {
Scopes *scopes = (Scopes *)but->poin;
scopes->wavefrm_yfac = 1.f;
@@ -4063,19 +3952,19 @@ static int ui_do_but_WAVEFORM(bContext *C, uiBlock *block, uiBut *but, uiHandleB
return WM_UI_HANDLER_BREAK;
}
}
- else if(data->state == BUTTON_STATE_NUM_EDITING) {
- if(event->type == ESCKEY) {
- data->cancel= 1;
- data->escapecancel= 1;
+ else if (data->state == BUTTON_STATE_NUM_EDITING) {
+ if (event->type == ESCKEY) {
+ data->cancel = 1;
+ data->escapecancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- else if(event->type == MOUSEMOVE) {
- if(mx!=data->draglastx || my!=data->draglasty) {
- if(ui_numedit_but_WAVEFORM(but, data, mx, my))
+ else if (event->type == MOUSEMOVE) {
+ if (mx != data->draglastx || my != data->draglasty) {
+ if (ui_numedit_but_WAVEFORM(but, data, mx, my))
ui_numedit_apply(C, block, but, data);
}
}
- else if(event->type==LEFTMOUSE && event->val!=KM_PRESS) {
+ else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
return WM_UI_HANDLER_BREAK;
@@ -4088,22 +3977,22 @@ static int ui_numedit_but_VECTORSCOPE(uiBut *but, uiHandleButtonData *data, int
{
Scopes *scopes = (Scopes *)but->poin;
/* rcti rect; */
- int changed= 1;
+ int changed = 1;
/* float dx, dy; */
- /* rect.xmin= but->x1; rect.xmax= but->x2; */
- /* rect.ymin= but->y1; rect.ymax= but->y2; */
+ /* rect.xmin = but->x1; rect.xmax = but->x2; */
+ /* rect.ymin = but->y1; rect.ymax = but->y2; */
/* dx = mx - data->draglastx; */
/* dy = my - data->draglasty; */
if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) {
- /* resize vectorscope widget itself */
+ /* resize vectorscope widget itself */
scopes->vecscope_height = (but->y2 - but->y1) + (data->dragstarty - my);
}
- data->draglastx= mx;
- data->draglasty= my;
+ data->draglastx = mx;
+ data->draglasty = my;
return changed;
}
@@ -4112,38 +4001,38 @@ static int ui_do_but_VECTORSCOPE(bContext *C, uiBlock *block, uiBut *but, uiHand
{
int mx, my;
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(event->type==LEFTMOUSE && event->val==KM_PRESS) {
- data->dragstartx= mx;
- data->dragstarty= my;
- data->draglastx= mx;
- data->draglasty= my;
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
+ data->dragstartx = mx;
+ data->dragstarty = my;
+ data->draglastx = mx;
+ data->draglasty = my;
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
/* also do drag the first time */
- if(ui_numedit_but_VECTORSCOPE(but, data, mx, my))
+ if (ui_numedit_but_VECTORSCOPE(but, data, mx, my))
ui_numedit_apply(C, block, but, data);
return WM_UI_HANDLER_BREAK;
}
}
- else if(data->state == BUTTON_STATE_NUM_EDITING) {
- if(event->type == ESCKEY) {
- data->cancel= 1;
- data->escapecancel= 1;
+ else if (data->state == BUTTON_STATE_NUM_EDITING) {
+ if (event->type == ESCKEY) {
+ data->cancel = 1;
+ data->escapecancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- else if(event->type == MOUSEMOVE) {
- if(mx!=data->draglastx || my!=data->draglasty) {
- if(ui_numedit_but_VECTORSCOPE(but, data, mx, my))
+ else if (event->type == MOUSEMOVE) {
+ if (mx != data->draglastx || my != data->draglasty) {
+ if (ui_numedit_but_VECTORSCOPE(but, data, mx, my))
ui_numedit_apply(C, block, but, data);
}
}
- else if(event->type==LEFTMOUSE && event->val!=KM_PRESS) {
+ else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
return WM_UI_HANDLER_BREAK;
@@ -4162,12 +4051,12 @@ static int ui_do_but_CHARTAB(bContext *UNUSED(C), uiBlock *UNUSED(block), uiBut
float butw, buth;
int mx, my, x, y, cs, che;
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val==KM_PRESS) {
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
/* Calculate the size of the button */
width = abs(but->x2 - but->x1);
height = abs(but->y2 - but->y1);
@@ -4187,66 +4076,63 @@ static int ui_do_but_CHARTAB(bContext *UNUSED(C), uiBlock *UNUSED(block), uiBut
x = (int) ((mx / butw) - 0.5);
y = (int) (6 - ((my / buth) - 0.5));
- che = cs + (y*12) + x;
+ che = cs + (y * 12) + x;
- if(che > G.charmax)
+ if (che > G.charmax)
che = 0;
- if(G.obedit)
- {
- do_textedit(0,0,che);
+ if (G.obedit) {
+ do_textedit(0, 0, che);
}
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
}
- else if(ELEM(event->type, WHEELUPMOUSE, PAGEUPKEY)) {
- for(but= block->buttons.first; but; but= but->next) {
- if(but->type == CHARTAB) {
- G.charstart = G.charstart - (12*6);
- if(G.charstart < 0)
+ else if (ELEM(event->type, WHEELUPMOUSE, PAGEUPKEY)) {
+ for (but = block->buttons.first; but; but = but->next) {
+ if (but->type == CHARTAB) {
+ G.charstart = G.charstart - (12 * 6);
+ if (G.charstart < 0)
G.charstart = 0;
- if(G.charstart < G.charmin)
+ if (G.charstart < G.charmin)
G.charstart = G.charmin;
ui_draw_but(but);
//Really nasty... to update the num button from the same butblock
- for(bt= block->buttons.first; bt; bt= bt->next)
+ for (bt = block->buttons.first; bt; bt = bt->next)
{
- if(ELEM(bt->type, NUM, NUMABS)) {
+ if (ELEM(bt->type, NUM, NUMABS)) {
ui_check_but(bt);
ui_draw_but(bt);
}
}
- retval=UI_CONT;
+ retval = UI_CONT;
break;
}
}
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)
- {
- G.charstart = G.charstart + (12*6);
- if(G.charstart > (0xffff - 12*6))
- G.charstart = 0xffff - (12*6);
- if(G.charstart > G.charmax - 12*6)
- G.charstart = G.charmax - 12*6;
+ else if (ELEM(event->type, WHEELDOWNMOUSE, PAGEDOWNKEY)) {
+ 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);
+ if (G.charstart > G.charmax - 12 * 6)
+ G.charstart = G.charmax - 12 * 6;
ui_draw_but(but);
- for(bt= block->buttons.first; bt; bt= bt->next)
+ for (bt = block->buttons.first; bt; bt = bt->next)
{
- if(ELEM(bt->type, NUM, NUMABS)) {
+ if (ELEM(bt->type, NUM, NUMABS)) {
ui_check_but(bt);
ui_draw_but(bt);
}
}
but->flag |= UI_ACTIVE;
- retval=UI_RETURN_OK;
+ retval = UI_RETURN_OK;
break;
}
}
@@ -4265,21 +4151,21 @@ static int ui_do_but_LINK(bContext *C, uiBut *but, uiHandleButtonData *data, wmE
{
VECCOPY2D(but->linkto, event->mval);
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(event->type == LEFTMOUSE && event->val==KM_PRESS) {
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_WAIT_RELEASE);
return WM_UI_HANDLER_BREAK;
}
- else if(event->type == LEFTMOUSE && but->block->handle) {
+ else if (event->type == LEFTMOUSE && but->block->handle) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
}
}
- else if(data->state == BUTTON_STATE_WAIT_RELEASE) {
+ else if (data->state == BUTTON_STATE_WAIT_RELEASE) {
- if(event->type == LEFTMOUSE && event->val!=KM_PRESS) {
- if(!(but->flag & UI_SELECT))
- data->cancel= 1;
+ if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+ if (!(but->flag & UI_SELECT))
+ data->cancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
}
@@ -4291,37 +4177,38 @@ static int ui_do_but_LINK(bContext *C, uiBut *but, uiHandleButtonData *data, wmE
static int ui_numedit_but_TRACKPREVIEW(bContext *C, uiBut *but, uiHandleButtonData *data, int mx, int my, int shift)
{
MovieClipScopes *scopes = (MovieClipScopes *)but->poin;
- int changed= 1;
+ int changed = 1;
float dx, dy;
dx = mx - data->draglastx;
dy = my - data->draglasty;
- if(shift) {
+ if (shift) {
dx /= 5.0f;
dy /= 5.0f;
}
if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) {
- /* resize preview widget itself */
+ /* resize preview widget itself */
scopes->track_preview_height = (but->y2 - but->y1) + (data->dragstarty - my);
- } else {
- if(scopes->marker) {
- if(scopes->marker->framenr!=scopes->framenr)
- scopes->marker= BKE_tracking_ensure_marker(scopes->track, scopes->framenr);
+ }
+ else {
+ if (scopes->marker) {
+ if (scopes->marker->framenr != scopes->framenr)
+ scopes->marker = BKE_tracking_ensure_marker(scopes->track, scopes->framenr);
- scopes->marker->flag&= ~(MARKER_DISABLED|MARKER_TRACKED);
- scopes->marker->pos[0]+= -dx*scopes->slide_scale[0] / (but->block->maxx-but->block->minx);
- scopes->marker->pos[1]+= -dy*scopes->slide_scale[1] / (but->block->maxy-but->block->miny);
+ scopes->marker->flag &= ~(MARKER_DISABLED | MARKER_TRACKED);
+ scopes->marker->pos[0] += -dx * scopes->slide_scale[0] / (but->block->maxx - but->block->minx);
+ scopes->marker->pos[1] += -dy * scopes->slide_scale[1] / (but->block->maxy - but->block->miny);
- WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, NULL);
}
- scopes->ok= 0;
+ scopes->ok = 0;
}
- data->draglastx= mx;
- data->draglasty= my;
+ data->draglastx = mx;
+ data->draglasty = my;
return changed;
}
@@ -4330,38 +4217,38 @@ static int ui_do_but_TRACKPREVIEW(bContext *C, uiBlock *block, uiBut *but, uiHan
{
int mx, my;
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(data->region, block, &mx, &my);
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- if(event->type==LEFTMOUSE && event->val==KM_PRESS) {
- data->dragstartx= mx;
- data->dragstarty= my;
- data->draglastx= mx;
- data->draglasty= my;
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
+ data->dragstartx = mx;
+ data->dragstarty = my;
+ data->draglastx = mx;
+ data->draglasty = my;
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
/* also do drag the first time */
- if(ui_numedit_but_TRACKPREVIEW(C, but, data, mx, my, event->shift))
+ if (ui_numedit_but_TRACKPREVIEW(C, but, data, mx, my, event->shift))
ui_numedit_apply(C, block, but, data);
return WM_UI_HANDLER_BREAK;
}
}
- else if(data->state == BUTTON_STATE_NUM_EDITING) {
- if(event->type == ESCKEY) {
- data->cancel= 1;
- data->escapecancel= 1;
+ else if (data->state == BUTTON_STATE_NUM_EDITING) {
+ if (event->type == ESCKEY) {
+ data->cancel = 1;
+ data->escapecancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- else if(event->type == MOUSEMOVE) {
- if(mx!=data->draglastx || my!=data->draglasty) {
- if(ui_numedit_but_TRACKPREVIEW(C, but, data, mx, my, event->shift))
+ else if (event->type == MOUSEMOVE) {
+ if (mx != data->draglastx || my != data->draglasty) {
+ if (ui_numedit_but_TRACKPREVIEW(C, but, data, mx, my, event->shift))
ui_numedit_apply(C, block, but, data);
}
}
- else if(event->type==LEFTMOUSE && event->val!=KM_PRESS) {
+ else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
return WM_UI_HANDLER_BREAK;
@@ -4377,11 +4264,11 @@ static void but_shortcut_name_func(bContext *C, void *arg1, int UNUSED(event))
if (but->optype) {
char shortcut_str[128];
- IDProperty *prop= (but->opptr)? but->opptr->data: NULL;
+ IDProperty *prop = (but->opptr) ? but->opptr->data : NULL;
/* complex code to change name of button */
- if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE,
- shortcut_str, sizeof(shortcut_str)))
+ if (WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE,
+ shortcut_str, sizeof(shortcut_str)))
{
ui_but_add_shortcut(but, shortcut_str, TRUE);
}
@@ -4394,29 +4281,29 @@ static void but_shortcut_name_func(bContext *C, void *arg1, int UNUSED(event))
static uiBlock *menu_change_shortcut(bContext *C, ARegion *ar, void *arg)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
uiBlock *block;
uiBut *but = (uiBut *)arg;
wmKeyMap *km;
wmKeyMapItem *kmi;
PointerRNA ptr;
uiLayout *layout;
- uiStyle *style= UI_GetStyle();
- IDProperty *prop= (but->opptr)? but->opptr->data: NULL;
+ uiStyle *style = UI_GetStyle();
+ IDProperty *prop = (but->opptr) ? but->opptr->data : NULL;
int kmi_id = WM_key_event_operator_id(C, but->optype->idname, but->opcontext, prop, 1, &km);
kmi = WM_keymap_item_find_id(km, kmi_id);
RNA_pointer_create(&wm->id, &RNA_KeyMapItem, kmi, &ptr);
- block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
+ block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
uiBlockSetHandleFunc(block, but_shortcut_name_func, but);
uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
uiBlockSetDirection(block, UI_CENTER);
- layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, style);
+ layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, style);
- uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT|UI_ITEM_R_IMMEDIATE, "", ICON_NONE);
+ uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT | UI_ITEM_R_IMMEDIATE, "", ICON_NONE);
uiPopupBoundsBlock(block, 6, -50, 26);
uiEndBlock(C, block);
@@ -4426,15 +4313,15 @@ static uiBlock *menu_change_shortcut(bContext *C, ARegion *ar, void *arg)
static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
uiBlock *block;
uiBut *but = (uiBut *)arg;
wmKeyMap *km;
wmKeyMapItem *kmi;
PointerRNA ptr;
uiLayout *layout;
- uiStyle *style= UI_GetStyle();
- IDProperty *prop= (but->opptr)? but->opptr->data: NULL;
+ uiStyle *style = UI_GetStyle();
+ IDProperty *prop = (but->opptr) ? but->opptr->data : NULL;
int kmi_id;
/* XXX this guess_opname can potentially return a different keymap than being found on adding later... */
@@ -4443,8 +4330,8 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg)
kmi_id = kmi->id;
/* copy properties, prop can be NULL for reset */
- if(prop)
- prop= IDP_CopyProperty(prop);
+ if (prop)
+ prop = IDP_CopyProperty(prop);
WM_keymap_properties_reset(kmi, prop);
/* update and get pointers again */
@@ -4455,14 +4342,14 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg)
RNA_pointer_create(&wm->id, &RNA_KeyMapItem, kmi, &ptr);
- block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
+ block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
uiBlockSetHandleFunc(block, but_shortcut_name_func, but);
uiBlockSetFlag(block, UI_BLOCK_RET_1);
uiBlockSetDirection(block, UI_CENTER);
- layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, style);
+ layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, style);
- uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT|UI_ITEM_R_IMMEDIATE, "", ICON_NONE);
+ uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT | UI_ITEM_R_IMMEDIATE, "", ICON_NONE);
uiPopupBoundsBlock(block, 6, -50, 26);
uiEndBlock(C, block);
@@ -4482,7 +4369,7 @@ static void remove_shortcut_func(bContext *C, void *arg1, void *UNUSED(arg2))
uiBut *but = (uiBut *)arg1;
wmKeyMap *km;
wmKeyMapItem *kmi;
- IDProperty *prop= (but->opptr)? but->opptr->data: NULL;
+ IDProperty *prop = (but->opptr) ? but->opptr->data : NULL;
int kmi_id = WM_key_event_operator_id(C, but->optype->idname, but->opcontext, prop, 1, &km);
kmi = WM_keymap_item_find_id(km, kmi_id);
@@ -4506,36 +4393,36 @@ static int ui_but_menu(bContext *C, uiBut *but)
int length;
const char *name;
- if((but->rnapoin.data && but->rnaprop)==0 && but->optype==NULL)
+ if ((but->rnapoin.data && but->rnaprop) == 0 && but->optype == NULL)
return 0;
button_timers_tooltip_remove(C, but);
- if(but->rnaprop)
- name= RNA_property_ui_name(but->rnaprop);
+ if (but->rnaprop)
+ name = RNA_property_ui_name(but->rnaprop);
else if (but->optype)
- name= but->optype->name;
+ name = but->optype->name;
else
- name= "<needs_name>"; // XXX - should never happen.
+ name = "<needs_name>"; // XXX - should never happen.
- pup= uiPupMenuBegin(C, name, ICON_NONE);
- layout= uiPupMenuLayout(pup);
+ pup = uiPupMenuBegin(C, name, ICON_NONE);
+ layout = uiPupMenuLayout(pup);
uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_DEFAULT);
- if(but->rnapoin.data && but->rnaprop) {
- short is_anim= RNA_property_animateable(&but->rnapoin, but->rnaprop);
+ if (but->rnapoin.data && but->rnaprop) {
+ short is_anim = RNA_property_animateable(&but->rnapoin, but->rnaprop);
/* second slower test, saved people finding keyframe items in menus when its not possible */
- if(is_anim)
- is_anim= RNA_property_path_from_ID_check(&but->rnapoin, but->rnaprop);
+ if (is_anim)
+ is_anim = RNA_property_path_from_ID_check(&but->rnapoin, but->rnaprop);
- length= RNA_property_array_length(&but->rnapoin, but->rnaprop);
+ length = RNA_property_array_length(&but->rnapoin, but->rnaprop);
/* Keyframes */
- if(but->flag & UI_BUT_ANIMATED_KEY) {
+ if (but->flag & UI_BUT_ANIMATED_KEY) {
/* replace/delete keyfraemes */
- if(length) {
+ if (length) {
uiItemBooleanO(layout, "Replace Keyframes", ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 1);
uiItemBooleanO(layout, "Replace Single Keyframe", ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 0);
uiItemBooleanO(layout, "Delete Keyframes", ICON_NONE, "ANIM_OT_keyframe_delete_button", "all", 1);
@@ -4551,9 +4438,9 @@ static int ui_but_menu(bContext *C, uiBut *but)
}
- else if(but->flag & UI_BUT_DRIVEN);
- else if(is_anim) {
- if(length) {
+ else if (but->flag & UI_BUT_DRIVEN) ;
+ else if (is_anim) {
+ if (length) {
uiItemBooleanO(layout, "Insert Keyframes", ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 1);
uiItemBooleanO(layout, "Insert Single Keyframe", ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 0);
}
@@ -4562,10 +4449,10 @@ static int ui_but_menu(bContext *C, uiBut *but)
}
/* Drivers */
- if(but->flag & UI_BUT_DRIVEN) {
+ if (but->flag & UI_BUT_DRIVEN) {
uiItemS(layout);
- if(length) {
+ if (length) {
uiItemBooleanO(layout, "Delete Drivers", ICON_NONE, "ANIM_OT_driver_button_remove", "all", 1);
uiItemBooleanO(layout, "Delete Single Driver", ICON_NONE, "ANIM_OT_driver_button_remove", "all", 0);
}
@@ -4576,11 +4463,11 @@ static int ui_but_menu(bContext *C, uiBut *but)
if (ANIM_driver_can_paste())
uiItemO(layout, "Paste Driver", ICON_NONE, "ANIM_OT_paste_driver_button");
}
- else if(but->flag & (UI_BUT_ANIMATED_KEY|UI_BUT_ANIMATED));
- else if(is_anim) {
+ else if (but->flag & (UI_BUT_ANIMATED_KEY | UI_BUT_ANIMATED)) ;
+ else if (is_anim) {
uiItemS(layout);
- if(length) {
+ if (length) {
uiItemBooleanO(layout, "Add Drivers", ICON_NONE, "ANIM_OT_driver_button_add", "all", 1);
uiItemBooleanO(layout, "Add Single Driver", ICON_NONE, "ANIM_OT_driver_button_add", "all", 0);
}
@@ -4593,10 +4480,10 @@ static int ui_but_menu(bContext *C, uiBut *but)
/* Keying Sets */
// TODO: check on modifyability of Keying Set when doing this
- if(is_anim) {
+ if (is_anim) {
uiItemS(layout);
- if(length) {
+ if (length) {
uiItemBooleanO(layout, "Add All to Keying Set", ICON_NONE, "ANIM_OT_keyingset_button_add", "all", 1);
uiItemBooleanO(layout, "Add Single to Keying Set", ICON_NONE, "ANIM_OT_keyingset_button_add", "all", 0);
uiItemO(layout, "Remove from Keying Set", ICON_NONE, "ANIM_OT_keyingset_button_remove");
@@ -4614,7 +4501,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
//Copy Property Value
//Paste Property Value
- if(length) {
+ if (length) {
uiItemBooleanO(layout, "Reset All to Default Values", ICON_NONE, "UI_OT_reset_default_button", "all", 1);
uiItemBooleanO(layout, "Reset Single to Default Value", ICON_NONE, "UI_OT_reset_default_button", "all", 0);
}
@@ -4628,17 +4515,17 @@ static int ui_but_menu(bContext *C, uiBut *but)
}
/* Operator buttons */
- if(but->optype) {
+ if (but->optype) {
uiBlock *block = uiLayoutGetBlock(layout);
uiBut *but2;
- IDProperty *prop= (but->opptr)? but->opptr->data: NULL;
+ IDProperty *prop = (but->opptr) ? but->opptr->data : NULL;
int w = uiLayoutGetWidth(layout);
wmKeyMap *km;
- wmKeyMapItem *kmi= NULL;
- int kmi_id= WM_key_event_operator_id(C, but->optype->idname, but->opcontext, prop, 1, &km);
+ wmKeyMapItem *kmi = NULL;
+ int kmi_id = WM_key_event_operator_id(C, but->optype->idname, but->opcontext, prop, 1, &km);
if (kmi_id)
- kmi= WM_keymap_item_find_id(km, kmi_id);
+ kmi = WM_keymap_item_find_id(km, kmi_id);
/* keyboard shortcuts */
if ((kmi) && ISKEYBOARD(kmi->type)) {
@@ -4662,11 +4549,11 @@ static int ui_but_menu(bContext *C, uiBut *but)
}
- { /* Docs */
+ { /* Docs */
char buf[512];
PointerRNA ptr_props;
- if(but->rnapoin.data && but->rnaprop) {
+ if (but->rnapoin.data && but->rnaprop) {
BLI_snprintf(buf, sizeof(buf), "%s.%s", RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop));
WM_operator_properties_create(&ptr_props, "WM_OT_doc_view");
@@ -4674,12 +4561,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);
@@ -4697,7 +4585,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
}
}
- /* perhaps we should move this into (G.f & G_DEBUG) - campbell */
+ /* perhaps we should move this into (G.debug & G_DEBUG) - campbell */
uiItemFullO(layout, "UI_OT_editsource", "Edit Source", ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0);
uiPupMenuEnd(C, pup);
@@ -4711,30 +4599,30 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
uiHandleButtonData *data;
int retval;
- data= but->active;
- retval= WM_UI_HANDLER_CONTINUE;
+ data = but->active;
+ retval = WM_UI_HANDLER_CONTINUE;
- if(but->flag & UI_BUT_DISABLED)
+ if (but->flag & UI_BUT_DISABLED)
return WM_UI_HANDLER_CONTINUE;
- if( (data->state == BUTTON_STATE_HIGHLIGHT) &&
- /* check prevval because of modal operators [#24016],
- * modifier check is to allow Ctrl+C for copy.
- * if this causes other problems, remove this check and suffer the bug :) - campbell */
- ((event->prevval != KM_PRESS) || (ISKEYMODIFIER(event->prevtype)) || (event->type == EVT_DROP))
- ) {
+ if ((data->state == BUTTON_STATE_HIGHLIGHT) &&
+ /* check prevval because of modal operators [#24016],
+ * modifier check is to allow Ctrl+C for copy.
+ * if this causes other problems, remove this check and suffer the bug :) - campbell */
+ ((event->prevval != KM_PRESS) || (ISKEYMODIFIER(event->prevtype)) || (event->type == EVT_DROP)))
+ {
/* handle copy-paste */
- if(ELEM(event->type, CKEY, VKEY) && event->val==KM_PRESS && (event->ctrl || event->oskey)) {
- ui_but_copy_paste(C, but, data, (event->type == CKEY)? 'c': 'v');
+ if (ELEM(event->type, CKEY, VKEY) && event->val == KM_PRESS && (event->ctrl || event->oskey)) {
+ ui_but_copy_paste(C, but, data, (event->type == CKEY) ? 'c' : 'v');
return WM_UI_HANDLER_BREAK;
}
/* handle drop */
- else if(event->type == EVT_DROP) {
- ui_but_drop (C, event, but, data);
+ else if (event->type == EVT_DROP) {
+ ui_but_drop(C, event, but, data);
}
/* handle keyframing */
- else if(event->type == IKEY && !ELEM3(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift) && event->val == KM_PRESS) {
- if(event->alt)
+ else if (event->type == IKEY && !ELEM3(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift) && event->val == KM_PRESS) {
+ if (event->alt)
ui_but_anim_delete_keyframe(C);
else
ui_but_anim_insert_keyframe(C);
@@ -4744,8 +4632,8 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
return WM_UI_HANDLER_BREAK;
}
/* handle drivers */
- else if(event->type == DKEY && !ELEM3(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift) && event->val == KM_PRESS) {
- if(event->alt)
+ else if (event->type == DKEY && !ELEM3(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift) && event->val == KM_PRESS) {
+ if (event->alt)
ui_but_anim_remove_driver(C);
else
ui_but_anim_add_driver(C);
@@ -4755,8 +4643,8 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
return WM_UI_HANDLER_BREAK;
}
/* handle keyingsets */
- else if(event->type == KKEY && !ELEM3(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift) && event->val == KM_PRESS) {
- if(event->alt)
+ else if (event->type == KKEY && !ELEM3(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift) && event->val == KM_PRESS) {
+ if (event->alt)
ui_but_anim_remove_keyingset(C);
else
ui_but_anim_add_keyingset(C);
@@ -4767,13 +4655,13 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
}
/* reset to default */
/* XXX hardcoded keymap check.... */
- else if(event->type == BACKSPACEKEY && event->val == KM_PRESS) {
+ else if (event->type == BACKSPACEKEY && event->val == KM_PRESS) {
/* ctrl+backspace = reset active button; backspace = reset a whole array*/
if (!(ELEM3(but->type, HSVCIRCLE, HSVCUBE, HISTOGRAM)))
ui_set_but_default(C, !event->ctrl);
}
/* handle menu */
- else if(event->type == RIGHTMOUSE && event->val == KM_PRESS) {
+ else if (event->type == RIGHTMOUSE && event->val == KM_PRESS) {
/* RMB has two options now */
if (ui_but_menu(C, but)) {
return WM_UI_HANDLER_BREAK;
@@ -4782,16 +4670,16 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
}
/* verify if we can edit this button */
- if(ELEM(event->type, LEFTMOUSE, RETKEY)) {
+ if (ELEM(event->type, LEFTMOUSE, RETKEY)) {
/* this should become disabled button .. */
- if(but->lock) {
- if(but->lockstr) {
+ if (but->lock) {
+ if (but->lockstr) {
BKE_report(NULL, RPT_WARNING, but->lockstr);
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
}
}
- else if(but->pointype && but->poin==NULL) {
+ else if (but->pointype && but->poin == NULL) {
/* there's a pointer needed */
BKE_reportf(NULL, RPT_WARNING, "DoButton pointer error: %s", but->str);
button_activate_state(C, but, BUTTON_STATE_EXIT);
@@ -4799,107 +4687,107 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
}
}
- switch(but->type) {
- case BUT:
- retval= ui_do_but_BUT(C, but, data, event);
- break;
- case KEYEVT:
- retval= ui_do_but_KEYEVT(C, but, data, event);
- break;
- case HOTKEYEVT:
- retval= ui_do_but_HOTKEYEVT(C, but, data, event);
- break;
- case TOGBUT:
- case TOG:
- case TOGR:
- case ICONTOG:
- case ICONTOGN:
- case TOGN:
- case BUT_TOGDUAL:
- case OPTION:
- case OPTIONN:
- retval= ui_do_but_TOG(C, but, data, event);
- break;
- case SCROLL:
- retval= ui_do_but_SCROLL(C, block, but, data, event);
- break;
- case NUM:
- case NUMABS:
- retval= ui_do_but_NUM(C, block, but, data, event);
- break;
- case SLI:
- case NUMSLI:
- case HSVSLI:
- retval= ui_do_but_SLI(C, block, but, data, event);
- break;
- case ROUNDBOX:
- case LISTBOX:
- case LABEL:
- case TOG3:
- case ROW:
- case LISTROW:
- case BUT_IMAGE:
- case PROGRESSBAR:
- retval= ui_do_but_EXIT(C, but, data, event);
- break;
- case HISTOGRAM:
- retval= ui_do_but_HISTOGRAM(C, block, but, data, event);
- break;
- case WAVEFORM:
- retval= ui_do_but_WAVEFORM(C, block, but, data, event);
- break;
- case VECTORSCOPE:
- retval= ui_do_but_VECTORSCOPE(C, block, but, data, event);
- break;
- case TEX:
- case IDPOIN:
- case SEARCH_MENU:
- retval= ui_do_but_TEX(C, block, but, data, event);
- break;
- case MENU:
- case ICONROW:
- case ICONTEXTROW:
- case BLOCK:
- case PULLDOWN:
- retval= ui_do_but_BLOCK(C, but, data, event);
- break;
- case BUTM:
- retval= ui_do_but_BUT(C, but, data, event);
- break;
- case COL:
- if(but->a1 == UI_GRAD_V_ALT) // signal to prevent calling up color picker
- retval= ui_do_but_EXIT(C, but, data, event);
- else
- retval= ui_do_but_BLOCK(C, but, data, event);
- break;
- case BUT_NORMAL:
- retval= ui_do_but_NORMAL(C, block, but, data, event);
- break;
- case BUT_COLORBAND:
- retval= ui_do_but_COLORBAND(C, block, but, data, event);
- break;
- case BUT_CURVE:
- retval= ui_do_but_CURVE(C, block, but, data, event);
- break;
- case HSVCUBE:
- retval= ui_do_but_HSVCUBE(C, block, but, data, event);
- break;
- case HSVCIRCLE:
- retval= ui_do_but_HSVCIRCLE(C, block, but, data, event);
- break;
+ switch (but->type) {
+ case BUT:
+ retval = ui_do_but_BUT(C, but, data, event);
+ break;
+ case KEYEVT:
+ retval = ui_do_but_KEYEVT(C, but, data, event);
+ break;
+ case HOTKEYEVT:
+ retval = ui_do_but_HOTKEYEVT(C, but, data, event);
+ break;
+ case TOGBUT:
+ case TOG:
+ case TOGR:
+ case ICONTOG:
+ case ICONTOGN:
+ case TOGN:
+ case BUT_TOGDUAL:
+ case OPTION:
+ case OPTIONN:
+ retval = ui_do_but_TOG(C, but, data, event);
+ break;
+ case SCROLL:
+ retval = ui_do_but_SCROLL(C, block, but, data, event);
+ break;
+ case NUM:
+ case NUMABS:
+ retval = ui_do_but_NUM(C, block, but, data, event);
+ break;
+ case SLI:
+ case NUMSLI:
+ case HSVSLI:
+ retval = ui_do_but_SLI(C, block, but, data, event);
+ break;
+ case ROUNDBOX:
+ case LISTBOX:
+ case LABEL:
+ case TOG3:
+ case ROW:
+ case LISTROW:
+ case BUT_IMAGE:
+ case PROGRESSBAR:
+ retval = ui_do_but_EXIT(C, but, data, event);
+ break;
+ case HISTOGRAM:
+ retval = ui_do_but_HISTOGRAM(C, block, but, data, event);
+ break;
+ case WAVEFORM:
+ retval = ui_do_but_WAVEFORM(C, block, but, data, event);
+ break;
+ case VECTORSCOPE:
+ retval = ui_do_but_VECTORSCOPE(C, block, but, data, event);
+ break;
+ case TEX:
+ case IDPOIN:
+ case SEARCH_MENU:
+ retval = ui_do_but_TEX(C, block, but, data, event);
+ break;
+ case MENU:
+ case ICONROW:
+ case ICONTEXTROW:
+ case BLOCK:
+ case PULLDOWN:
+ retval = ui_do_but_BLOCK(C, but, data, event);
+ break;
+ case BUTM:
+ retval = ui_do_but_BUT(C, but, data, event);
+ break;
+ case COL:
+ if (but->a1 == UI_GRAD_V_ALT) // signal to prevent calling up color picker
+ retval = ui_do_but_EXIT(C, but, data, event);
+ else
+ retval = ui_do_but_BLOCK(C, but, data, event);
+ break;
+ case BUT_NORMAL:
+ retval = ui_do_but_NORMAL(C, block, but, data, event);
+ break;
+ case BUT_COLORBAND:
+ retval = ui_do_but_COLORBAND(C, block, but, data, event);
+ break;
+ case BUT_CURVE:
+ retval = ui_do_but_CURVE(C, block, but, data, event);
+ break;
+ case HSVCUBE:
+ retval = ui_do_but_HSVCUBE(C, block, but, data, event);
+ break;
+ case HSVCIRCLE:
+ retval = ui_do_but_HSVCIRCLE(C, block, but, data, event);
+ break;
#ifdef WITH_INTERNATIONAL
- case CHARTAB:
- retval= ui_do_but_CHARTAB(C, block, but, data, event);
- break;
+ case CHARTAB:
+ retval = ui_do_but_CHARTAB(C, block, but, data, event);
+ break;
#endif
- case LINK:
- case INLINK:
- retval= ui_do_but_LINK(C, but, data, event);
- break;
- case TRACKPREVIEW:
- retval= ui_do_but_TRACKPREVIEW(C, block, but, data, event);
- break;
+ case LINK:
+ case INLINK:
+ retval = ui_do_but_LINK(C, but, data, event);
+ break;
+ case TRACKPREVIEW:
+ retval = ui_do_but_TRACKPREVIEW(C, block, but, data, event);
+ break;
}
return retval;
@@ -4909,7 +4797,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
static int ui_but_contains_pt(uiBut *but, int mx, int my)
{
- return ((but->x1<mx && but->x2>=mx) && (but->y1<my && but->y2>=my));
+ return ((but->x1 < mx && but->x2 >= mx) && (but->y1 < my && but->y2 >= my));
}
static uiBut *ui_but_find_activated(ARegion *ar)
@@ -4917,9 +4805,9 @@ static uiBut *ui_but_find_activated(ARegion *ar)
uiBlock *block;
uiBut *but;
- for(block=ar->uiblocks.first; block; block=block->next)
- for(but=block->buttons.first; but; but= but->next)
- if(but->active)
+ for (block = ar->uiblocks.first; block; block = block->next)
+ for (but = block->buttons.first; but; but = but->next)
+ if (but->active)
return but;
return NULL;
@@ -4933,17 +4821,17 @@ int ui_button_is_active(ARegion *ar)
/* is called by notifier */
void uiFreeActiveButtons(const bContext *C, bScreen *screen)
{
- ScrArea *sa= screen->areabase.first;
+ ScrArea *sa = screen->areabase.first;
- for(;sa; sa= sa->next) {
- ARegion *ar= sa->regionbase.first;
- for(;ar; ar= ar->next) {
- uiBut *but= ui_but_find_activated(ar);
- if(but) {
- uiHandleButtonData *data= but->active;
+ for (; sa; sa = sa->next) {
+ ARegion *ar = sa->regionbase.first;
+ for (; ar; ar = ar->next) {
+ uiBut *but = ui_but_find_activated(ar);
+ if (but) {
+ uiHandleButtonData *data = but->active;
- if(data->menu==NULL && data->searchbox==NULL)
- if(data->state == BUTTON_STATE_HIGHLIGHT)
+ if (data->menu == NULL && data->searchbox == NULL)
+ if (data->state == BUTTON_STATE_HIGHLIGHT)
ui_button_active_free(C, but);
}
}
@@ -4956,11 +4844,11 @@ void uiFreeActiveButtons(const bContext *C, bScreen *screen)
/* called in region context */
int UI_but_active_drop_name(bContext *C)
{
- ARegion *ar= CTX_wm_region(C);
- uiBut *but= ui_but_find_activated(ar);
+ ARegion *ar = CTX_wm_region(C);
+ uiBut *but = ui_but_find_activated(ar);
- if(but) {
- if(ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU))
+ if (but) {
+ if (ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU))
return 1;
}
@@ -4971,13 +4859,13 @@ static void ui_blocks_set_tooltips(ARegion *ar, int enable)
{
uiBlock *block;
- if(!ar)
+ if (!ar)
return;
/* we disabled buttons when when they were already shown, and
* re-enable them on mouse move */
- for(block=ar->uiblocks.first; block; block=block->next)
- block->tooltipdisabled= !enable;
+ for (block = ar->uiblocks.first; block; block = block->next)
+ block->tooltipdisabled = !enable;
}
static int ui_mouse_inside_region(ARegion *ar, int x, int y)
@@ -4985,9 +4873,9 @@ static int ui_mouse_inside_region(ARegion *ar, int x, int y)
uiBlock *block;
/* check if the mouse is in the region */
- if(!BLI_in_rcti(&ar->winrct, x, y)) {
- for(block=ar->uiblocks.first; block; block=block->next)
- block->auto_open= FALSE;
+ if (!BLI_in_rcti(&ar->winrct, x, y)) {
+ for (block = ar->uiblocks.first; block; block = block->next)
+ block->auto_open = FALSE;
return 0;
}
@@ -4997,37 +4885,37 @@ static int ui_mouse_inside_region(ARegion *ar, int x, int y)
* even when they are not visible, so we need to make a copy of the mask to
* use to check
*/
- if(ar->v2d.mask.xmin!=ar->v2d.mask.xmax) {
- View2D *v2d= &ar->v2d;
+ if (ar->v2d.mask.xmin != ar->v2d.mask.xmax) {
+ View2D *v2d = &ar->v2d;
rcti mask_rct;
int mx, my;
/* convert window coordinates to region coordinates */
- mx= x;
- my= y;
+ mx = x;
+ my = y;
ui_window_to_region(ar, &mx, &my);
/* make a copy of the mask rect, and tweak accordingly for hidden scrollbars */
- mask_rct.xmin= v2d->mask.xmin;
- mask_rct.xmax= v2d->mask.xmax;
- mask_rct.ymin= v2d->mask.ymin;
- mask_rct.ymax= v2d->mask.ymax;
+ mask_rct.xmin = v2d->mask.xmin;
+ mask_rct.xmax = v2d->mask.xmax;
+ mask_rct.ymin = v2d->mask.ymin;
+ mask_rct.ymax = v2d->mask.ymax;
- if (v2d->scroll & (V2D_SCROLL_VERTICAL_HIDE|V2D_SCROLL_VERTICAL_FULLR)) {
+ if (v2d->scroll & (V2D_SCROLL_VERTICAL_HIDE | V2D_SCROLL_VERTICAL_FULLR)) {
if (v2d->scroll & V2D_SCROLL_LEFT)
- mask_rct.xmin= v2d->vert.xmin;
+ mask_rct.xmin = v2d->vert.xmin;
else if (v2d->scroll & V2D_SCROLL_RIGHT)
- mask_rct.xmax= v2d->vert.xmax;
+ mask_rct.xmax = v2d->vert.xmax;
}
- if (v2d->scroll & (V2D_SCROLL_HORIZONTAL_HIDE|V2D_SCROLL_HORIZONTAL_FULLR)) {
- if (v2d->scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O))
- mask_rct.ymin= v2d->hor.ymin;
+ if (v2d->scroll & (V2D_SCROLL_HORIZONTAL_HIDE | V2D_SCROLL_HORIZONTAL_FULLR)) {
+ if (v2d->scroll & (V2D_SCROLL_BOTTOM | V2D_SCROLL_BOTTOM_O))
+ mask_rct.ymin = v2d->hor.ymin;
else if (v2d->scroll & V2D_SCROLL_TOP)
- mask_rct.ymax= v2d->hor.ymax;
+ mask_rct.ymax = v2d->hor.ymax;
}
/* check if in the rect */
- if(!BLI_in_rcti(&mask_rct, mx, my))
+ if (!BLI_in_rcti(&mask_rct, mx, my))
return 0;
}
@@ -5036,12 +4924,12 @@ static int ui_mouse_inside_region(ARegion *ar, int x, int y)
static int ui_mouse_inside_button(ARegion *ar, uiBut *but, int x, int y)
{
- if(!ui_mouse_inside_region(ar, x, y))
+ if (!ui_mouse_inside_region(ar, x, y))
return 0;
ui_window_to_block(ar, but->block, &x, &y);
- if(!ui_but_contains_pt(but, x, y))
+ if (!ui_but_contains_pt(but, x, y))
return 0;
return 1;
@@ -5050,39 +4938,41 @@ static int ui_mouse_inside_button(ARegion *ar, uiBut *but, int x, int y)
static uiBut *ui_but_find_mouse_over(ARegion *ar, int x, int y)
{
uiBlock *block;
- uiBut *but, *butover= NULL;
+ uiBut *but, *butover = NULL;
int mx, my;
-// if(!win->active)
+// if (!win->active)
// return NULL;
- if(!ui_mouse_inside_region(ar, x, y))
+ if (!ui_mouse_inside_region(ar, x, y))
return NULL;
- for(block=ar->uiblocks.first; block; block=block->next) {
- mx= x;
- my= y;
+ for (block = ar->uiblocks.first; block; block = block->next) {
+ mx = x;
+ my = y;
ui_window_to_block(ar, block, &mx, &my);
- for(but=block->buttons.first; but; but= but->next) {
+ for (but = block->buttons.first; but; but = but->next) {
/* note, LABEL is included for hilights, this allows drags */
- if(but->type==LABEL && but->dragpoin==NULL)
+ if (but->type == LABEL && but->dragpoin == NULL)
continue;
- if(ELEM3(but->type, ROUNDBOX, SEPR, LISTBOX))
+ if (ELEM3(but->type, ROUNDBOX, SEPR, LISTBOX))
continue;
- if(but->flag & UI_HIDDEN)
+ if (but->flag & UI_HIDDEN)
continue;
- if(but->flag & UI_SCROLLED)
+ if (but->flag & UI_SCROLLED)
continue;
- if(ui_but_contains_pt(but, mx, my))
- butover= but;
+ if (ui_but_contains_pt(but, mx, my))
+ butover = but;
}
/* CLIP_EVENTS prevents the event from reaching other blocks */
if (block->flag & UI_BLOCK_CLIP_EVENTS) {
/* check if mouse is inside block */
- if(block->minx <= mx && block->maxx >= mx &&
- block->miny <= my && block->maxy >= my)
+ if (block->minx <= mx && block->maxx >= mx &&
+ block->miny <= my && block->maxy >= my)
+ {
break;
+ }
}
}
@@ -5095,18 +4985,18 @@ static uiBut *ui_list_find_mouse_over(ARegion *ar, int x, int y)
uiBut *but;
int mx, my;
-// if(!win->active)
+// if (!win->active)
// return NULL;
- if(!ui_mouse_inside_region(ar, x, y))
+ if (!ui_mouse_inside_region(ar, x, y))
return NULL;
- for(block=ar->uiblocks.first; block; block=block->next) {
- mx= x;
- my= y;
+ for (block = ar->uiblocks.first; block; block = block->next) {
+ mx = x;
+ my = y;
ui_window_to_block(ar, block, &mx, &my);
- for(but=block->buttons.last; but; but= but->prev)
- if(but->type == LISTBOX && ui_but_contains_pt(but, mx, my))
+ for (but = block->buttons.last; but; but = but->prev)
+ if (but->type == LISTBOX && ui_but_contains_pt(but, mx, my))
return but;
}
@@ -5118,77 +5008,77 @@ static uiBut *ui_list_find_mouse_over(ARegion *ar, int x, int y)
static int button_modal_state(uiHandleButtonState state)
{
return ELEM6(state, BUTTON_STATE_WAIT_RELEASE, BUTTON_STATE_WAIT_KEY_EVENT,
- BUTTON_STATE_NUM_EDITING, BUTTON_STATE_TEXT_EDITING,
- BUTTON_STATE_TEXT_SELECTING, BUTTON_STATE_MENU_OPEN);
+ BUTTON_STATE_NUM_EDITING, BUTTON_STATE_TEXT_EDITING,
+ BUTTON_STATE_TEXT_SELECTING, BUTTON_STATE_MENU_OPEN);
}
static void button_timers_tooltip_remove(bContext *C, uiBut *but)
{
uiHandleButtonData *data;
- data= but->active;
- if(data) {
+ data = but->active;
+ if (data) {
- if(data->tooltiptimer) {
+ if (data->tooltiptimer) {
WM_event_remove_timer(data->wm, data->window, data->tooltiptimer);
- data->tooltiptimer= NULL;
+ data->tooltiptimer = NULL;
}
- if(data->tooltip) {
+ if (data->tooltip) {
ui_tooltip_free(C, data->tooltip);
- data->tooltip= NULL;
+ data->tooltip = NULL;
}
- if(data->autoopentimer) {
+ if (data->autoopentimer) {
WM_event_remove_timer(data->wm, data->window, data->autoopentimer);
- data->autoopentimer= NULL;
+ data->autoopentimer = NULL;
}
}
}
static void button_tooltip_timer_reset(bContext *C, uiBut *but)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
uiHandleButtonData *data;
- data= but->active;
+ data = but->active;
- if(data->tooltiptimer) {
+ if (data->tooltiptimer) {
WM_event_remove_timer(data->wm, data->window, data->tooltiptimer);
- data->tooltiptimer= NULL;
+ data->tooltiptimer = NULL;
}
- if(U.flag & USER_TOOLTIPS)
- if(!but->block->tooltipdisabled)
- if(!wm->drags.first)
- data->tooltiptimer= WM_event_add_timer(data->wm, data->window, TIMER, BUTTON_TOOLTIP_DELAY);
+ if (U.flag & USER_TOOLTIPS)
+ if (!but->block->tooltipdisabled)
+ if (!wm->drags.first)
+ data->tooltiptimer = WM_event_add_timer(data->wm, data->window, TIMER, BUTTON_TOOLTIP_DELAY);
}
static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState state)
{
uiHandleButtonData *data;
- data= but->active;
- if(data->state == state)
+ data = but->active;
+ if (data->state == state)
return;
/* highlight has timers for tooltips and auto open */
- if(state == BUTTON_STATE_HIGHLIGHT) {
+ if (state == BUTTON_STATE_HIGHLIGHT) {
but->flag &= ~UI_SELECT;
button_tooltip_timer_reset(C, but);
/* automatic open pulldown block timer */
- if(ELEM3(but->type, BLOCK, PULLDOWN, ICONTEXTROW)) {
- if(data->used_mouse && !data->autoopentimer) {
+ if (ELEM3(but->type, BLOCK, PULLDOWN, ICONTEXTROW)) {
+ if (data->used_mouse && !data->autoopentimer) {
int time;
- if(but->block->auto_open==TRUE) time= 1; // test for toolbox
- else if((but->block->flag & UI_BLOCK_LOOP && but->type != BLOCK) || but->block->auto_open==TRUE) time= 5*U.menuthreshold2;
- else if(U.uiflag & USER_MENUOPENAUTO) time= 5*U.menuthreshold1;
- else time= -1;
+ if (but->block->auto_open == TRUE) time = 1; // test for toolbox
+ else if ((but->block->flag & UI_BLOCK_LOOP && but->type != BLOCK) || but->block->auto_open == TRUE) time = 5 * U.menuthreshold2;
+ else if (U.uiflag & USER_MENUOPENAUTO) time = 5 * U.menuthreshold1;
+ else time = -1;
- if(time >= 0)
- data->autoopentimer= WM_event_add_timer(data->wm, data->window, TIMER, 0.02*(double)time);
+ if (time >= 0)
+ data->autoopentimer = WM_event_add_timer(data->wm, data->window, TIMER, 0.02 * (double)time);
}
}
}
@@ -5198,65 +5088,66 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
}
/* text editing */
- if(state == BUTTON_STATE_TEXT_EDITING && data->state != BUTTON_STATE_TEXT_SELECTING)
+ if (state == BUTTON_STATE_TEXT_EDITING && data->state != BUTTON_STATE_TEXT_SELECTING)
ui_textedit_begin(C, but, data);
- else if(data->state == BUTTON_STATE_TEXT_EDITING && state != BUTTON_STATE_TEXT_SELECTING)
+ else if (data->state == BUTTON_STATE_TEXT_EDITING && state != BUTTON_STATE_TEXT_SELECTING)
ui_textedit_end(C, but, data);
- else if(data->state == BUTTON_STATE_TEXT_SELECTING && state != BUTTON_STATE_TEXT_EDITING)
+ else if (data->state == BUTTON_STATE_TEXT_SELECTING && state != BUTTON_STATE_TEXT_EDITING)
ui_textedit_end(C, but, data);
/* number editing */
- if(state == BUTTON_STATE_NUM_EDITING) {
- if(ui_is_a_warp_but(but))
+ if (state == BUTTON_STATE_NUM_EDITING) {
+ if (ui_is_a_warp_but(but))
WM_cursor_grab(CTX_wm_window(C), TRUE, TRUE, NULL);
ui_numedit_begin(but, data);
- } else if(data->state == BUTTON_STATE_NUM_EDITING) {
+ }
+ else if (data->state == BUTTON_STATE_NUM_EDITING) {
ui_numedit_end(but, data);
- if(ui_is_a_warp_but(but))
+ if (ui_is_a_warp_but(but))
WM_cursor_ungrab(CTX_wm_window(C));
}
/* menu open */
- if(state == BUTTON_STATE_MENU_OPEN)
+ if (state == BUTTON_STATE_MENU_OPEN)
ui_blockopen_begin(C, but, data);
- else if(data->state == BUTTON_STATE_MENU_OPEN)
+ else if (data->state == BUTTON_STATE_MENU_OPEN)
ui_blockopen_end(C, but, data);
/* add a short delay before exiting, to ensure there is some feedback */
- if(state == BUTTON_STATE_WAIT_FLASH) {
- data->flashtimer= WM_event_add_timer(data->wm, data->window, TIMER, BUTTON_FLASH_DELAY);
+ if (state == BUTTON_STATE_WAIT_FLASH) {
+ data->flashtimer = WM_event_add_timer(data->wm, data->window, TIMER, BUTTON_FLASH_DELAY);
}
- else if(data->flashtimer) {
+ else if (data->flashtimer) {
WM_event_remove_timer(data->wm, data->window, data->flashtimer);
- data->flashtimer= NULL;
+ data->flashtimer = NULL;
}
/* add a blocking ui handler at the window handler for blocking, modal states
* but not for popups, because we already have a window level handler*/
- if(!(but->block->handle && but->block->handle->popup)) {
- if(button_modal_state(state)) {
- if(!button_modal_state(data->state))
+ if (!(but->block->handle && but->block->handle->popup)) {
+ if (button_modal_state(state)) {
+ if (!button_modal_state(data->state))
WM_event_add_ui_handler(C, &data->window->modalhandlers, ui_handler_region_menu, NULL, data);
}
else {
- if(button_modal_state(data->state))
- WM_event_remove_ui_handler(&data->window->modalhandlers, ui_handler_region_menu, NULL, data, 1); /* 1 = postpone free */
+ if (button_modal_state(data->state))
+ WM_event_remove_ui_handler(&data->window->modalhandlers, ui_handler_region_menu, NULL, data, 1); /* 1 = postpone free */
}
}
/* wait for mousemove to enable drag */
- if(state == BUTTON_STATE_WAIT_DRAG) {
+ if (state == BUTTON_STATE_WAIT_DRAG) {
but->flag &= ~UI_SELECT;
}
- data->state= state;
+ data->state = state;
- if(state != BUTTON_STATE_EXIT) {
+ 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... */
- if(state != BUTTON_STATE_HIGHLIGHT || (but->block->flag & UI_BLOCK_LOOP))
+ * 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);
}
@@ -5269,110 +5160,110 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA
uiHandleButtonData *data;
/* setup struct */
- data= MEM_callocN(sizeof(uiHandleButtonData), "uiHandleButtonData");
- data->wm= CTX_wm_manager(C);
- data->window= CTX_wm_window(C);
- data->region= ar;
- if( ELEM(but->type, BUT_CURVE, SEARCH_MENU) ); // XXX curve is temp
- else data->interactive= 1;
+ data = MEM_callocN(sizeof(uiHandleButtonData), "uiHandleButtonData");
+ data->wm = CTX_wm_manager(C);
+ data->window = CTX_wm_window(C);
+ data->region = ar;
+ if (ELEM(but->type, BUT_CURVE, SEARCH_MENU) ) ; // XXX curve is temp
+ else data->interactive = 1;
data->state = BUTTON_STATE_INIT;
/* activate button */
but->flag |= UI_ACTIVE;
- but->active= data;
+ but->active = data;
/* we disable auto_open in the block after a threshold, because we still
* want to allow auto opening adjacent menus even if no button is activated
* in between going over to the other button, but only for a short while */
- if(type == BUTTON_ACTIVATE_OVER && but->block->auto_open==TRUE)
- if(but->block->auto_open_last+BUTTON_AUTO_OPEN_THRESH < PIL_check_seconds_timer())
- but->block->auto_open= FALSE;
+ if (type == BUTTON_ACTIVATE_OVER && but->block->auto_open == TRUE)
+ if (but->block->auto_open_last + BUTTON_AUTO_OPEN_THRESH < PIL_check_seconds_timer())
+ but->block->auto_open = FALSE;
- if(type == BUTTON_ACTIVATE_OVER) {
- data->used_mouse= 1;
+ if (type == BUTTON_ACTIVATE_OVER) {
+ data->used_mouse = 1;
}
button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT);
/* activate right away */
- if(but->flag & UI_BUT_IMMEDIATE) {
- if(but->type==HOTKEYEVT)
+ if (but->flag & UI_BUT_IMMEDIATE) {
+ if (but->type == HOTKEYEVT)
button_activate_state(C, but, BUTTON_STATE_WAIT_KEY_EVENT);
/* .. more to be added here */
}
- if(type == BUTTON_ACTIVATE_OPEN) {
+ if (type == BUTTON_ACTIVATE_OPEN) {
button_activate_state(C, but, BUTTON_STATE_MENU_OPEN);
/* activate first button in submenu */
- if(data->menu && data->menu->region) {
- ARegion *subar= data->menu->region;
- uiBlock *subblock= subar->uiblocks.first;
+ if (data->menu && data->menu->region) {
+ ARegion *subar = data->menu->region;
+ uiBlock *subblock = subar->uiblocks.first;
uiBut *subbut;
- if(subblock) {
- subbut= ui_but_first(subblock);
+ if (subblock) {
+ subbut = ui_but_first(subblock);
- if(subbut)
+ if (subbut)
ui_handle_button_activate(C, subar, subbut, BUTTON_ACTIVATE);
}
}
}
- else if(type == BUTTON_ACTIVATE_TEXT_EDITING)
+ else if (type == BUTTON_ACTIVATE_TEXT_EDITING)
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
- else if(type == BUTTON_ACTIVATE_APPLY)
+ else if (type == BUTTON_ACTIVATE_APPLY)
button_activate_state(C, but, BUTTON_STATE_WAIT_FLASH);
}
static void button_activate_exit(bContext *C, uiHandleButtonData *data, uiBut *but, int mousemove, int onfree)
{
- uiBlock *block= but->block;
+ uiBlock *block = but->block;
uiBut *bt;
/* ensure we are in the exit state */
- if(data->state != BUTTON_STATE_EXIT)
+ if (data->state != BUTTON_STATE_EXIT)
button_activate_state(C, but, BUTTON_STATE_EXIT);
/* apply the button action or value */
- if(!onfree)
+ if (!onfree)
ui_apply_button(C, block, but, data, 0);
/* if this button is in a menu, this will set the button return
* value to the button value and the menu return value to ok, the
* menu return value will be picked up and the menu will close */
- if(block->handle && !(block->flag & UI_BLOCK_KEEP_OPEN)) {
- if(!data->cancel || data->escapecancel) {
+ if (block->handle && !(block->flag & UI_BLOCK_KEEP_OPEN)) {
+ if (!data->cancel || data->escapecancel) {
uiPopupBlockHandle *menu;
- menu= block->handle;
- menu->butretval= data->retval;
- menu->menuretval= (data->cancel)? UI_RETURN_CANCEL: UI_RETURN_OK;
+ menu = block->handle;
+ menu->butretval = data->retval;
+ menu->menuretval = (data->cancel) ? UI_RETURN_CANCEL : UI_RETURN_OK;
}
}
- if(!onfree && !data->cancel) {
+ if (!onfree && !data->cancel) {
/* autokey & undo push */
ui_apply_autokey_undo(C, but);
/* popup menu memory */
- if(block->flag & UI_BLOCK_POPUP_MEMORY)
+ if (block->flag & UI_BLOCK_POPUP_MEMORY)
ui_popup_menu_memory(block, but);
}
/* disable tooltips until mousemove + last active flag */
- for(block=data->region->uiblocks.first; block; block=block->next) {
- for(bt=block->buttons.first; bt; bt=bt->next)
+ for (block = data->region->uiblocks.first; block; block = block->next) {
+ for (bt = block->buttons.first; bt; bt = bt->next)
bt->flag &= ~UI_BUT_LAST_ACTIVE;
- block->tooltipdisabled= 1;
+ block->tooltipdisabled = 1;
}
ui_blocks_set_tooltips(data->region, 0);
/* clean up */
- if(data->str)
+ if (data->str)
MEM_freeN(data->str);
- if(data->origstr)
+ if (data->origstr)
MEM_freeN(data->origstr);
/* redraw (data is but->active!) */
@@ -5380,16 +5271,16 @@ static void button_activate_exit(bContext *C, uiHandleButtonData *data, uiBut *b
/* clean up button */
MEM_freeN(but->active);
- but->active= NULL;
- but->flag &= ~(UI_ACTIVE|UI_SELECT);
+ but->active = NULL;
+ but->flag &= ~(UI_ACTIVE | UI_SELECT);
but->flag |= UI_BUT_LAST_ACTIVE;
- if(!onfree)
+ if (!onfree)
ui_check_but(but);
/* adds empty mousemove in queue for re-init handler, in case mouse is
* still over a button. we cannot just check for this ourselfs because
* at this point the mouse may be over a button in another region */
- if(mousemove)
+ if (mousemove)
WM_event_add_mousemove(C);
}
@@ -5400,41 +5291,41 @@ void ui_button_active_free(const bContext *C, uiBut *but)
/* this gets called when the button somehow disappears while it is still
* active, this is bad for user interaction, but we need to handle this
* case cleanly anyway in case it happens */
- if(but->active) {
- data= but->active;
- data->cancel= 1;
- button_activate_exit((bContext*)C, data, but, 0, 1);
+ if (but->active) {
+ data = but->active;
+ data->cancel = 1;
+ button_activate_exit((bContext *)C, data, but, 0, 1);
}
}
/* returns the active button with an optional checking function */
static uiBut *ui_context_button_active(const bContext *C, int (*but_check_cb)(uiBut *))
{
- uiBut *but_found= NULL;
+ uiBut *but_found = NULL;
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
- while(ar) {
+ while (ar) {
uiBlock *block;
- uiBut *but, *activebut= NULL;
+ uiBut *but, *activebut = NULL;
/* find active button */
- for(block=ar->uiblocks.first; block; block=block->next) {
- for(but=block->buttons.first; but; but= but->next) {
- if(but->active)
- activebut= but;
- else if(!activebut && (but->flag & UI_BUT_LAST_ACTIVE))
- activebut= but;
+ for (block = ar->uiblocks.first; block; block = block->next) {
+ for (but = block->buttons.first; but; but = but->next) {
+ if (but->active)
+ activebut = but;
+ else if (!activebut && (but->flag & UI_BUT_LAST_ACTIVE))
+ activebut = but;
}
}
- if(activebut && (but_check_cb == NULL || but_check_cb(activebut))) {
- uiHandleButtonData *data= activebut->active;
+ if (activebut && (but_check_cb == NULL || but_check_cb(activebut))) {
+ uiHandleButtonData *data = activebut->active;
- but_found= activebut;
+ but_found = activebut;
/* recurse into opened menu, like colorpicker case */
- if(data && data->menu && (ar != data->menu->region)) {
+ if (data && data->menu && (ar != data->menu->region)) {
ar = data->menu->region;
}
else {
@@ -5467,29 +5358,29 @@ uiBut *uiContextActiveButton(const struct bContext *C)
/* helper function for insert keyframe, reset to default, etc operators */
void uiContextActiveProperty(const bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop, int *index)
{
- uiBut *activebut= ui_context_rna_button_active(C);
+ uiBut *activebut = ui_context_rna_button_active(C);
memset(ptr, 0, sizeof(*ptr));
- if(activebut && activebut->rnapoin.data) {
- *ptr= activebut->rnapoin;
- *prop= activebut->rnaprop;
- *index= activebut->rnaindex;
+ if (activebut && activebut->rnapoin.data) {
+ *ptr = activebut->rnapoin;
+ *prop = activebut->rnaprop;
+ *index = activebut->rnaindex;
}
else {
- *prop= NULL;
- *index= 0;
+ *prop = NULL;
+ *index = 0;
}
}
void uiContextActivePropertyHandle(bContext *C)
{
- uiBut *activebut= ui_context_rna_button_active(C);
- if(activebut) {
+ uiBut *activebut = ui_context_rna_button_active(C);
+ if (activebut) {
/* TODO, look into a better way to handle the button change
* currently this is mainly so reset defaults works for the
* operator redo panel - campbell */
- uiBlock *block= activebut->block;
+ uiBlock *block = activebut->block;
if (block->handle_func) {
block->handle_func(C, block->handle_func_arg, 0);
}
@@ -5498,7 +5389,7 @@ void uiContextActivePropertyHandle(bContext *C)
wmOperator *uiContextActiveOperator(const struct bContext *C)
{
- ARegion *ar_ctx= CTX_wm_region(C);
+ ARegion *ar_ctx = CTX_wm_region(C);
uiBlock *block;
/* background mode */
@@ -5507,7 +5398,7 @@ wmOperator *uiContextActiveOperator(const struct bContext *C)
}
/* scan active regions ui */
- for(block=ar_ctx->uiblocks.first; block; block=block->next) {
+ for (block = ar_ctx->uiblocks.first; block; block = block->next) {
if (block->ui_operator) {
return block->ui_operator;
}
@@ -5515,14 +5406,14 @@ wmOperator *uiContextActiveOperator(const struct bContext *C)
/* scan popups */
{
- bScreen *sc= CTX_wm_screen(C);
+ bScreen *sc = CTX_wm_screen(C);
ARegion *ar;
- for (ar= sc->regionbase.first; ar; ar= ar->next) {
+ for (ar = sc->regionbase.first; ar; ar = ar->next) {
if (ar == ar_ctx) {
continue;
}
- for(block=ar->uiblocks.first; block; block=block->next) {
+ for (block = ar->uiblocks.first; block; block = block->next) {
if (block->ui_operator) {
return block->ui_operator;
}
@@ -5536,31 +5427,31 @@ wmOperator *uiContextActiveOperator(const struct bContext *C)
/* helper function for insert keyframe, reset to default, etc operators */
void uiContextAnimUpdate(const bContext *C)
{
- Scene *scene= CTX_data_scene(C);
- ARegion *ar= CTX_wm_region(C);
+ Scene *scene = CTX_data_scene(C);
+ ARegion *ar = CTX_wm_region(C);
uiBlock *block;
uiBut *but, *activebut;
- while(ar) {
+ while (ar) {
/* find active button */
- activebut= NULL;
+ activebut = NULL;
- for(block=ar->uiblocks.first; block; block=block->next) {
- for(but=block->buttons.first; but; but= but->next) {
- ui_but_anim_flag(but, (scene)? scene->r.cfra: 0.0f);
+ for (block = ar->uiblocks.first; block; block = block->next) {
+ for (but = block->buttons.first; but; but = but->next) {
+ ui_but_anim_flag(but, (scene) ? scene->r.cfra : 0.0f);
ED_region_tag_redraw(ar);
- if(but->active)
- activebut= but;
- else if(!activebut && (but->flag & UI_BUT_LAST_ACTIVE))
- activebut= but;
+ if (but->active)
+ activebut = but;
+ else if (!activebut && (but->flag & UI_BUT_LAST_ACTIVE))
+ activebut = but;
}
}
- if(activebut) {
+ if (activebut) {
/* always recurse into opened menu, so all buttons update (like colorpicker) */
- uiHandleButtonData *data= activebut->active;
- if(data && data->menu)
+ uiHandleButtonData *data = activebut->active;
+ if (data && data->menu)
ar = data->menu->region;
else
return;
@@ -5579,9 +5470,9 @@ static uiBut *uit_but_find_open_event(ARegion *ar, wmEvent *event)
uiBlock *block;
uiBut *but;
- for(block=ar->uiblocks.first; block; block=block->next) {
- for(but=block->buttons.first; but; but= but->next)
- if(but==event->customdata)
+ for (block = ar->uiblocks.first; block; block = block->next) {
+ for (but = block->buttons.first; but; but = but->next)
+ if (but == event->customdata)
return but;
}
return NULL;
@@ -5591,14 +5482,14 @@ static int ui_handle_button_over(bContext *C, wmEvent *event, ARegion *ar)
{
uiBut *but;
- if(event->type == MOUSEMOVE) {
- but= ui_but_find_mouse_over(ar, event->x, event->y);
- if(but)
+ if (event->type == MOUSEMOVE) {
+ but = ui_but_find_mouse_over(ar, event->x, event->y);
+ if (but)
button_activate_init(C, ar, but, BUTTON_ACTIVATE_OVER);
}
- else if(event->type == EVT_BUT_OPEN) {
- but= uit_but_find_open_event(ar, event);
- if(but) {
+ else if (event->type == EVT_BUT_OPEN) {
+ but = uit_but_find_open_event(ar, event);
+ if (but) {
button_activate_init(C, ar, but, BUTTON_ACTIVATE_OVER);
ui_do_button(C, but->block, but, event);
}
@@ -5610,16 +5501,16 @@ static int ui_handle_button_over(bContext *C, wmEvent *event, ARegion *ar)
/* exported to interface.c: uiButActiveOnly() */
void ui_button_activate_do(bContext *C, ARegion *ar, uiBut *but)
{
- wmWindow *win= CTX_wm_window(C);
+ wmWindow *win = CTX_wm_window(C);
wmEvent event;
button_activate_init(C, ar, but, BUTTON_ACTIVATE_OVER);
- event= *(win->eventstate); /* XXX huh huh? make api call */
- event.type= EVT_BUT_OPEN;
- event.val= KM_PRESS;
- event.customdata= but;
- event.customdatafree= FALSE;
+ event = *(win->eventstate); /* XXX huh huh? make api call */
+ event.type = EVT_BUT_OPEN;
+ event.val = KM_PRESS;
+ event.customdata = but;
+ event.customdatafree = FALSE;
ui_do_button(C, but->block, but, &event);
}
@@ -5629,10 +5520,10 @@ static void ui_handle_button_activate(bContext *C, ARegion *ar, uiBut *but, uiBu
uiBut *oldbut;
uiHandleButtonData *data;
- oldbut= ui_but_find_activated(ar);
- if(oldbut) {
- data= oldbut->active;
- data->cancel= 1;
+ oldbut = ui_but_find_activated(ar);
+ if (oldbut) {
+ data = oldbut->active;
+ data->cancel = 1;
button_activate_exit(C, data, oldbut, 0, 0);
}
@@ -5650,31 +5541,31 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
uiButtonActivateType posttype;
int retval;
- data= but->active;
- block= but->block;
- ar= data->region;
+ data = but->active;
+ block = but->block;
+ ar = data->region;
- retval= WM_UI_HANDLER_CONTINUE;
+ retval = WM_UI_HANDLER_CONTINUE;
- if(data->state == BUTTON_STATE_HIGHLIGHT) {
- switch(event->type) {
+ if (data->state == BUTTON_STATE_HIGHLIGHT) {
+ switch (event->type) {
case WINDEACTIVATE:
case EVT_BUT_CANCEL:
- data->cancel= 1;
+ data->cancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
- retval= WM_UI_HANDLER_CONTINUE;
+ retval = WM_UI_HANDLER_CONTINUE;
break;
case MOUSEMOVE:
/* verify if we are still over the button, if not exit */
- if(!ui_mouse_inside_button(ar, but, event->x, event->y)) {
- data->cancel= 1;
+ if (!ui_mouse_inside_button(ar, but, event->x, event->y)) {
+ data->cancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- else if(ui_but_find_mouse_over(ar, event->x, event->y) != but) {
- data->cancel= 1;
+ else if (ui_but_find_mouse_over(ar, event->x, event->y) != but) {
+ data->cancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- else if(event->x!=event->prevx || event->y!=event->prevy) {
+ else if (event->x != event->prevx || event->y != event->prevy) {
/* re-enable tooltip on mouse move */
ui_blocks_set_tooltips(ar, 1);
button_tooltip_timer_reset(C, but);
@@ -5683,48 +5574,48 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
break;
case TIMER: {
/* handle tooltip timer */
- if(event->customdata == data->tooltiptimer) {
+ if (event->customdata == data->tooltiptimer) {
WM_event_remove_timer(data->wm, data->window, data->tooltiptimer);
- data->tooltiptimer= NULL;
+ data->tooltiptimer = NULL;
- if(!data->tooltip)
- data->tooltip= ui_tooltip_create(C, data->region, but);
+ if (!data->tooltip)
+ data->tooltip = ui_tooltip_create(C, data->region, but);
}
/* handle menu auto open timer */
- else if(event->customdata == data->autoopentimer) {
+ else if (event->customdata == data->autoopentimer) {
WM_event_remove_timer(data->wm, data->window, data->autoopentimer);
- data->autoopentimer= NULL;
+ data->autoopentimer = NULL;
- if(ui_mouse_inside_button(ar, but, event->x, event->y))
+ if (ui_mouse_inside_button(ar, but, event->x, event->y))
button_activate_state(C, but, BUTTON_STATE_MENU_OPEN);
}
- retval= WM_UI_HANDLER_CONTINUE;
+ retval = WM_UI_HANDLER_CONTINUE;
break;
- case WHEELUPMOUSE:
- case WHEELDOWNMOUSE:
- case MIDDLEMOUSE:
- /* XXX hardcoded keymap check... but anyway, while view changes, tooltips should be removed */
- if(data->tooltiptimer) {
- WM_event_remove_timer(data->wm, data->window, data->tooltiptimer);
- data->tooltiptimer= NULL;
- }
+ case WHEELUPMOUSE:
+ case WHEELDOWNMOUSE:
+ case MIDDLEMOUSE:
+ /* XXX hardcoded keymap check... but anyway, while view changes, tooltips should be removed */
+ if (data->tooltiptimer) {
+ WM_event_remove_timer(data->wm, data->window, data->tooltiptimer);
+ data->tooltiptimer = NULL;
+ }
/* pass on purposedly */
- default:
- /* handle button type specific events */
- retval= ui_do_button(C, block, but, event);
+ default:
+ /* handle button type specific events */
+ retval = ui_do_button(C, block, but, event);
}
}
}
- else if(data->state == BUTTON_STATE_WAIT_RELEASE) {
- switch(event->type) {
+ else if (data->state == BUTTON_STATE_WAIT_RELEASE) {
+ switch (event->type) {
case WINDEACTIVATE:
- data->cancel= 1;
+ data->cancel = 1;
button_activate_state(C, but, BUTTON_STATE_EXIT);
break;
case MOUSEMOVE:
- if(ELEM(but->type,LINK, INLINK)) {
+ if (ELEM(but->type, LINK, INLINK)) {
but->flag |= UI_SELECT;
ui_do_button(C, block, but, event);
ED_region_tag_redraw(data->region);
@@ -5732,17 +5623,17 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
else {
/* deselect the button when moving the mouse away */
/* also de-activate for buttons that only show higlights */
- if(ui_mouse_inside_button(ar, but, event->x, event->y)) {
- if(!(but->flag & UI_SELECT)) {
- but->flag |= (UI_SELECT|UI_ACTIVE);
- data->cancel= 0;
+ if (ui_mouse_inside_button(ar, but, event->x, event->y)) {
+ if (!(but->flag & UI_SELECT)) {
+ but->flag |= (UI_SELECT | UI_ACTIVE);
+ data->cancel = 0;
ED_region_tag_redraw(data->region);
}
}
else {
- if(but->flag & UI_SELECT) {
- but->flag &= ~(UI_SELECT|UI_ACTIVE);
- data->cancel= 1;
+ if (but->flag & UI_SELECT) {
+ but->flag &= ~(UI_SELECT | UI_ACTIVE);
+ data->cancel = 1;
ED_region_tag_redraw(data->region);
}
}
@@ -5754,55 +5645,55 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
break;
}
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
- else if(data->state == BUTTON_STATE_WAIT_FLASH) {
- switch(event->type) {
+ else if (data->state == BUTTON_STATE_WAIT_FLASH) {
+ switch (event->type) {
case TIMER: {
- if(event->customdata == data->flashtimer)
+ if (event->customdata == data->flashtimer)
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
}
- retval= WM_UI_HANDLER_CONTINUE;
+ retval = WM_UI_HANDLER_CONTINUE;
}
- else if(data->state == BUTTON_STATE_MENU_OPEN) {
+ else if (data->state == BUTTON_STATE_MENU_OPEN) {
/* check for exit because of mouse-over another button */
- switch(event->type) {
+ switch (event->type) {
case MOUSEMOVE:
- if(data->menu && data->menu->region)
- if(ui_mouse_inside_region(data->menu->region, event->x, event->y))
+ if (data->menu && data->menu->region)
+ if (ui_mouse_inside_region(data->menu->region, event->x, event->y))
break;
- {
- uiBut *bt= ui_but_find_mouse_over(ar, event->x, event->y);
+ {
+ uiBut *bt = ui_but_find_mouse_over(ar, event->x, event->y);
- if(bt && bt->active != data) {
- if(but->type != COL) /* exception */
- data->cancel= 1;
- button_activate_state(C, but, BUTTON_STATE_EXIT);
+ if (bt && bt->active != data) {
+ if (but->type != COL) /* exception */
+ data->cancel = 1;
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ break;
}
- break;
- }
}
ui_do_button(C, block, but, event);
- retval= WM_UI_HANDLER_CONTINUE;
+ retval = WM_UI_HANDLER_CONTINUE;
}
else {
- retval= ui_do_button(C, block, but, event);
+ retval = ui_do_button(C, block, but, event);
// retval= WM_UI_HANDLER_BREAK; XXX why ?
}
- if(data->state == BUTTON_STATE_EXIT) {
- postbut= data->postbut;
- posttype= data->posttype;
+ if (data->state == BUTTON_STATE_EXIT) {
+ postbut = data->postbut;
+ posttype = data->posttype;
button_activate_exit(C, data, but, (postbut == NULL), 0);
/* for jumping to the next button with tab while text editing */
- if(postbut)
+ if (postbut)
button_activate_init(C, ar, postbut, posttype);
}
@@ -5811,64 +5702,64 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
static int ui_handle_list_event(bContext *C, wmEvent *event, ARegion *ar)
{
- uiBut *but= ui_list_find_mouse_over(ar, event->x, event->y);
- int retval= WM_UI_HANDLER_CONTINUE;
+ uiBut *but = ui_list_find_mouse_over(ar, event->x, event->y);
+ int retval = WM_UI_HANDLER_CONTINUE;
int value, min, max;
- if(but && (event->val == KM_PRESS)) {
- Panel *pa= but->block->panel;
+ if (but && (event->val == KM_PRESS)) {
+ Panel *pa = but->block->panel;
- if(ELEM(event->type, UPARROWKEY, DOWNARROWKEY) ||
- ((ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE) && event->alt))) {
+ if (ELEM(event->type, UPARROWKEY, DOWNARROWKEY) ||
+ ((ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE) && event->alt))) {
/* activate up/down the list */
- value= RNA_property_int_get(&but->rnapoin, but->rnaprop);
+ value = RNA_property_int_get(&but->rnapoin, but->rnaprop);
- if(ELEM(event->type, UPARROWKEY, WHEELUPMOUSE))
+ if (ELEM(event->type, UPARROWKEY, WHEELUPMOUSE))
value--;
else
value++;
- if(value < pa->list_scroll)
- pa->list_scroll= value;
- else if(value >= pa->list_scroll+pa->list_size)
- pa->list_scroll= value - pa->list_size + 1;
+ if (value < pa->list_scroll)
+ pa->list_scroll = value;
+ else if (value >= pa->list_scroll + pa->list_size)
+ pa->list_scroll = value - pa->list_size + 1;
RNA_property_int_range(&but->rnapoin, but->rnaprop, &min, &max);
- value= CLAMPIS(value, min, max);
+ value = CLAMPIS(value, min, max);
RNA_property_int_set(&but->rnapoin, but->rnaprop, value);
RNA_property_update(C, &but->rnapoin, but->rnaprop);
ED_region_tag_redraw(ar);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
- else if(ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE) && event->shift) {
+ else if (ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE) && event->shift) {
/* silly replacement for proper grip */
- if(pa->list_grip_size == 0)
- pa->list_grip_size= pa->list_size;
+ if (pa->list_grip_size == 0)
+ pa->list_grip_size = pa->list_size;
- if(event->type == WHEELUPMOUSE)
+ if (event->type == WHEELUPMOUSE)
pa->list_grip_size--;
else
pa->list_grip_size++;
- pa->list_grip_size= MAX2(pa->list_grip_size, 1);
+ pa->list_grip_size = MAX2(pa->list_grip_size, 1);
ED_region_tag_redraw(ar);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
- else if(ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE)) {
- if(pa->list_last_len > pa->list_size) {
+ else if (ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE)) {
+ if (pa->list_last_len > pa->list_size) {
/* list template will clamp */
- if(event->type == WHEELUPMOUSE)
+ if (event->type == WHEELUPMOUSE)
pa->list_scroll--;
else
pa->list_scroll++;
ED_region_tag_redraw(ar);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
}
}
@@ -5881,43 +5772,43 @@ static void ui_handle_button_return_submenu(bContext *C, wmEvent *event, uiBut *
uiHandleButtonData *data;
uiPopupBlockHandle *menu;
- data= but->active;
- menu= data->menu;
+ data = but->active;
+ menu = data->menu;
/* copy over return values from the closing menu */
- if((menu->menuretval & UI_RETURN_OK) || (menu->menuretval & UI_RETURN_UPDATE)) {
- if(but->type == COL)
+ if ((menu->menuretval & UI_RETURN_OK) || (menu->menuretval & UI_RETURN_UPDATE)) {
+ if (but->type == COL)
copy_v3_v3(data->vec, menu->retvec);
- else if(ELEM3(but->type, MENU, ICONROW, ICONTEXTROW))
- data->value= menu->retvalue;
+ else if (ELEM3(but->type, MENU, ICONROW, ICONTEXTROW))
+ data->value = menu->retvalue;
}
- if(menu->menuretval & UI_RETURN_UPDATE) {
- if(data->interactive) ui_apply_button(C, but->block, but, data, 1);
+ if (menu->menuretval & UI_RETURN_UPDATE) {
+ if (data->interactive) ui_apply_button(C, but->block, but, data, 1);
else ui_check_but(but);
- menu->menuretval= 0;
+ menu->menuretval = 0;
}
/* now change button state or exit, which will close the submenu */
- if((menu->menuretval & UI_RETURN_OK) || (menu->menuretval & UI_RETURN_CANCEL)) {
- if(menu->menuretval != UI_RETURN_OK)
- data->cancel= 1;
+ if ((menu->menuretval & UI_RETURN_OK) || (menu->menuretval & UI_RETURN_CANCEL)) {
+ if (menu->menuretval != UI_RETURN_OK)
+ data->cancel = 1;
button_activate_exit(C, data, but, 1, 0);
}
- else if(menu->menuretval & UI_RETURN_OUT) {
- if(event->type==MOUSEMOVE && ui_mouse_inside_button(data->region, but, event->x, event->y)) {
+ else if (menu->menuretval & UI_RETURN_OUT) {
+ if (event->type == MOUSEMOVE && ui_mouse_inside_button(data->region, but, event->x, event->y)) {
button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT);
}
else {
if (ISKEYBOARD(event->type)) {
/* keyboard menu hierarchy navigation, going back to previous level */
- but->active->used_mouse= 0;
+ but->active->used_mouse = 0;
button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT);
}
else {
- data->cancel= 1;
+ data->cancel = 1;
button_activate_exit(C, data, but, 1, 0);
}
}
@@ -5937,15 +5828,15 @@ static void ui_handle_button_return_submenu(bContext *C, wmEvent *event, uiBut *
static void ui_mouse_motion_towards_init(uiPopupBlockHandle *menu, int mx, int my, int force)
{
- if(!menu->dotowards || force) {
- menu->dotowards= 1;
- menu->towardsx= mx;
- menu->towardsy= my;
+ if (!menu->dotowards || force) {
+ menu->dotowards = 1;
+ menu->towardsx = mx;
+ menu->towardsy = my;
- if(force)
- menu->towardstime= DBL_MAX; /* unlimited time */
+ if (force)
+ menu->towardstime = DBL_MAX; /* unlimited time */
else
- menu->towardstime= PIL_check_seconds_timer();
+ menu->towardstime = PIL_check_seconds_timer();
}
}
@@ -5954,56 +5845,56 @@ static int ui_mouse_motion_towards_check(uiBlock *block, uiPopupBlockHandle *men
float p1[2], p2[2], p3[2], p4[2], oldp[2], newp[2];
int closer;
- if(!menu->dotowards) return 0;
+ if (!menu->dotowards) return 0;
/* verify that we are moving towards one of the edges of the
* menu block, in other words, in the triangle formed by the
* initial mouse location and two edge points. */
- p1[0]= block->minx-20;
- p1[1]= block->miny-20;
+ p1[0] = block->minx - 20;
+ p1[1] = block->miny - 20;
- p2[0]= block->maxx+20;
- p2[1]= block->miny-20;
+ p2[0] = block->maxx + 20;
+ p2[1] = block->miny - 20;
- p3[0]= block->maxx+20;
- p3[1]= block->maxy+20;
+ p3[0] = block->maxx + 20;
+ p3[1] = block->maxy + 20;
- p4[0]= block->minx-20;
- p4[1]= block->maxy+20;
+ p4[0] = block->minx - 20;
+ p4[1] = block->maxy + 20;
- oldp[0]= menu->towardsx;
- oldp[1]= menu->towardsy;
+ oldp[0] = menu->towardsx;
+ oldp[1] = menu->towardsy;
- newp[0]= mx;
- newp[1]= my;
+ newp[0] = mx;
+ newp[1] = my;
- if(len_v2v2(oldp, newp) < 4.0f)
+ if (len_v2v2(oldp, newp) < 4.0f)
return menu->dotowards;
- closer= 0;
+ closer = 0;
closer |= isect_point_tri_v2(newp, oldp, p1, p2);
closer |= isect_point_tri_v2(newp, oldp, p2, p3);
closer |= isect_point_tri_v2(newp, oldp, p3, p4);
closer |= isect_point_tri_v2(newp, oldp, p4, p1);
- if(!closer)
- menu->dotowards= 0;
+ if (!closer)
+ menu->dotowards = 0;
/* 1 second timer */
- if(PIL_check_seconds_timer() - menu->towardstime > BUTTON_MOUSE_TOWARDS_THRESH)
- menu->dotowards= 0;
+ if (PIL_check_seconds_timer() - menu->towardstime > BUTTON_MOUSE_TOWARDS_THRESH)
+ menu->dotowards = 0;
return menu->dotowards;
}
static char ui_menu_scroll_test(uiBlock *block, int my)
{
- if(block->flag & (UI_BLOCK_CLIPTOP|UI_BLOCK_CLIPBOTTOM)) {
- if(block->flag & UI_BLOCK_CLIPTOP)
- if(my > block->maxy-14)
+ if (block->flag & (UI_BLOCK_CLIPTOP | UI_BLOCK_CLIPBOTTOM)) {
+ if (block->flag & UI_BLOCK_CLIPTOP)
+ if (my > block->maxy - 14)
return 't';
- if(block->flag & UI_BLOCK_CLIPBOTTOM)
- if(my < block->miny+14)
+ if (block->flag & UI_BLOCK_CLIPBOTTOM)
+ if (my < block->miny + 14)
return 'b';
}
return 0;
@@ -6011,46 +5902,46 @@ static char ui_menu_scroll_test(uiBlock *block, int my)
static int ui_menu_scroll(ARegion *ar, uiBlock *block, int my)
{
- char test= ui_menu_scroll_test(block, my);
+ char test = ui_menu_scroll_test(block, my);
- if(test) {
- uiBut *b1= block->buttons.first;
- uiBut *b2= block->buttons.last;
+ if (test) {
+ uiBut *b1 = block->buttons.first;
+ uiBut *b2 = block->buttons.last;
uiBut *bnext;
uiBut *bprev;
- int dy= 0;
+ int dy = 0;
/* get first and last visible buttons */
- while(b1 && ui_but_next(b1) && (b1->flag & UI_SCROLLED))
- b1= ui_but_next(b1);
- while(b2 && ui_but_prev(b2) && (b2->flag & UI_SCROLLED))
- b2= ui_but_prev(b2);
+ while (b1 && ui_but_next(b1) && (b1->flag & UI_SCROLLED))
+ b1 = ui_but_next(b1);
+ while (b2 && ui_but_prev(b2) && (b2->flag & UI_SCROLLED))
+ b2 = ui_but_prev(b2);
/* skips separators */
- bnext= ui_but_next(b1);
- bprev= ui_but_prev(b2);
+ bnext = ui_but_next(b1);
+ bprev = ui_but_prev(b2);
- if(bnext==NULL || bprev==NULL)
+ if (bnext == NULL || bprev == NULL)
return 0;
- if(test=='t') {
+ if (test == 't') {
/* bottom button is first button */
- if(b1->y1 < b2->y1)
- dy= bnext->y1 - b1->y1;
+ if (b1->y1 < b2->y1)
+ dy = bnext->y1 - b1->y1;
/* bottom button is last button */
else
- dy= bprev->y1 - b2->y1;
+ dy = bprev->y1 - b2->y1;
}
- else if(test=='b') {
+ else if (test == 'b') {
/* bottom button is first button */
- if(b1->y1 < b2->y1)
- dy= b1->y1 - bnext->y1;
+ if (b1->y1 < b2->y1)
+ dy = b1->y1 - bnext->y1;
/* bottom button is last button */
else
- dy= b2->y1 - bprev->y1;
+ dy = b2->y1 - bprev->y1;
}
- if(dy) {
+ if (dy) {
- for(b1= block->buttons.first; b1; b1= b1->next) {
+ for (b1 = block->buttons.first; b1; b1 = b1->next) {
b1->y1 -= dy;
b1->y2 -= dy;
}
@@ -6073,76 +5964,76 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
uiBut *but, *bt;
int inside, act, count, mx, my, retval;
- ar= menu->region;
- block= ar->uiblocks.first;
+ ar = menu->region;
+ block = ar->uiblocks.first;
- act= 0;
- retval= WM_UI_HANDLER_CONTINUE;
+ act = 0;
+ retval = WM_UI_HANDLER_CONTINUE;
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(ar, block, &mx, &my);
/* check if mouse is inside block */
- inside= 0;
- if(block->minx <= mx && block->maxx >= mx)
- if(block->miny <= my && block->maxy >= my)
- inside= 1;
+ inside = 0;
+ if (block->minx <= mx && block->maxx >= mx)
+ if (block->miny <= my && block->maxy >= my)
+ inside = 1;
/* if there's an active modal button, don't check events or outside, except for search menu */
- but= ui_but_find_activated(ar);
- if(but && button_modal_state(but->active->state) && but->type!=SEARCH_MENU) {
+ but = ui_but_find_activated(ar);
+ if (but && button_modal_state(but->active->state) && but->type != SEARCH_MENU) {
/* if a button is activated modal, always reset the start mouse
* position of the towards mechanism to avoid loosing focus,
* and don't handle events */
ui_mouse_motion_towards_init(menu, mx, my, 1);
}
- else if(event->type == TIMER) {
- if(event->customdata == menu->scrolltimer)
+ else if (event->type == TIMER) {
+ if (event->customdata == menu->scrolltimer)
ui_menu_scroll(ar, block, my);
}
else {
/* for ui_mouse_motion_towards_block */
- if(event->type == MOUSEMOVE) {
+ if (event->type == MOUSEMOVE) {
ui_mouse_motion_towards_init(menu, mx, my, 0);
/* add menu scroll timer, if needed */
- if(ui_menu_scroll_test(block, my))
- if(menu->scrolltimer==NULL)
- menu->scrolltimer=
- WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, MENU_SCROLL_INTERVAL);
+ if (ui_menu_scroll_test(block, my))
+ if (menu->scrolltimer == NULL)
+ menu->scrolltimer =
+ WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, MENU_SCROLL_INTERVAL);
}
/* first block own event func */
- if(block->block_event_func && block->block_event_func(C, block, event));
+ if (block->block_event_func && block->block_event_func(C, block, event)) ;
/* events not for active search menu button */
- else if(but==NULL || but->type!=SEARCH_MENU) {
- switch(event->type) {
+ else if (but == NULL || but->type != SEARCH_MENU) {
+ switch (event->type) {
/* closing sublevels of pulldowns */
case LEFTARROWKEY:
- if(event->val==KM_PRESS && (block->flag & UI_BLOCK_LOOP))
- if(block->saferct.first)
- menu->menuretval= UI_RETURN_OUT;
+ if (event->val == KM_PRESS && (block->flag & UI_BLOCK_LOOP))
+ if (block->saferct.first)
+ menu->menuretval = UI_RETURN_OUT;
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
break;
/* opening sublevels of pulldowns */
case RIGHTARROWKEY:
- if(event->val==KM_PRESS && (block->flag & UI_BLOCK_LOOP)) {
- but= ui_but_find_activated(ar);
+ if (event->val == KM_PRESS && (block->flag & UI_BLOCK_LOOP)) {
+ but = ui_but_find_activated(ar);
- if(!but) {
+ if (!but) {
/* no item active, we make first active */
- if(block->direction & UI_TOP) but= ui_but_last(block);
- else but= ui_but_first(block);
+ if (block->direction & UI_TOP) but = ui_but_last(block);
+ else but = ui_but_first(block);
}
- if(but && ELEM(but->type, BLOCK, PULLDOWN))
+ if (but && ELEM(but->type, BLOCK, PULLDOWN))
ui_handle_button_activate(C, ar, but, BUTTON_ACTIVATE_OPEN);
}
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
break;
case UPARROWKEY:
@@ -6150,118 +6041,118 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
case WHEELUPMOUSE:
case WHEELDOWNMOUSE:
/* arrowkeys: only handle for block_loop blocks */
- if(event->alt || event->shift || event->ctrl || event->oskey);
- else if(inside || (block->flag & UI_BLOCK_LOOP)) {
- if(event->val==KM_PRESS) {
- but= ui_but_find_activated(ar);
- if(but) {
+ if (event->alt || event->shift || event->ctrl || event->oskey) ;
+ else if (inside || (block->flag & UI_BLOCK_LOOP)) {
+ if (event->val == KM_PRESS) {
+ but = ui_but_find_activated(ar);
+ if (but) {
/* is there a situation where UI_LEFT or UI_RIGHT would also change navigation direction? */
- if( ((ELEM(event->type, DOWNARROWKEY, WHEELDOWNMOUSE)) && (block->direction & UI_DOWN)) ||
- ((ELEM(event->type, DOWNARROWKEY, WHEELDOWNMOUSE)) && (block->direction & UI_RIGHT)) ||
- ((ELEM(event->type, UPARROWKEY, WHEELUPMOUSE)) && (block->direction & UI_TOP))
- ) {
+ if (((ELEM(event->type, DOWNARROWKEY, WHEELDOWNMOUSE)) && (block->direction & UI_DOWN)) ||
+ ((ELEM(event->type, DOWNARROWKEY, WHEELDOWNMOUSE)) && (block->direction & UI_RIGHT)) ||
+ ((ELEM(event->type, UPARROWKEY, WHEELUPMOUSE)) && (block->direction & UI_TOP)))
+ {
/* the following is just a hack - uiBut->type set to BUT and BUTM have there menus built
* opposite ways - this should be changed so that all popup-menus use the same uiBlock->direction */
- if(but->type & BUT)
- but= ui_but_next(but);
+ if (but->type & BUT)
+ but = ui_but_next(but);
else
- but= ui_but_prev(but);
+ but = ui_but_prev(but);
}
else {
- if(but->type & BUT)
- but= ui_but_prev(but);
+ if (but->type & BUT)
+ but = ui_but_prev(but);
else
- but= ui_but_next(but);
+ but = ui_but_next(but);
}
- if(but)
+ if (but)
ui_handle_button_activate(C, ar, but, BUTTON_ACTIVATE);
}
- if(!but) {
- if( ((ELEM(event->type, UPARROWKEY, WHEELUPMOUSE)) && (block->direction & UI_DOWN)) ||
- ((ELEM(event->type, UPARROWKEY, WHEELUPMOUSE)) && (block->direction & UI_RIGHT)) ||
- ((ELEM(event->type, DOWNARROWKEY, WHEELDOWNMOUSE)) && (block->direction & UI_TOP))
- ) {
- if((bt= ui_but_first(block)) && (bt->type & BUT)) {
- bt= ui_but_last(block);
+ if (!but) {
+ if (((ELEM(event->type, UPARROWKEY, WHEELUPMOUSE)) && (block->direction & UI_DOWN)) ||
+ ((ELEM(event->type, UPARROWKEY, WHEELUPMOUSE)) && (block->direction & UI_RIGHT)) ||
+ ((ELEM(event->type, DOWNARROWKEY, WHEELDOWNMOUSE)) && (block->direction & UI_TOP)))
+ {
+ if ((bt = ui_but_first(block)) && (bt->type & BUT)) {
+ bt = ui_but_last(block);
}
else {
/* keep ui_but_first() */
}
}
else {
- if((bt= ui_but_first(block)) && (bt->type & BUT)) {
+ if ((bt = ui_but_first(block)) && (bt->type & BUT)) {
/* keep ui_but_first() */
}
else {
- bt= ui_but_last(block);
+ bt = ui_but_last(block);
}
}
- if(bt)
+ if (bt)
ui_handle_button_activate(C, ar, bt, BUTTON_ACTIVATE);
}
}
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
break;
- case ONEKEY: case PAD1:
- act= 1;
- case TWOKEY: case PAD2:
- if(act==0) act= 2;
- case THREEKEY: case PAD3:
- if(act==0) act= 3;
- case FOURKEY: case PAD4:
- if(act==0) act= 4;
- case FIVEKEY: case PAD5:
- if(act==0) act= 5;
- case SIXKEY: case PAD6:
- if(act==0) act= 6;
- case SEVENKEY: case PAD7:
- if(act==0) act= 7;
- case EIGHTKEY: case PAD8:
- if(act==0) act= 8;
- case NINEKEY: case PAD9:
- if(act==0) act= 9;
- case ZEROKEY: case PAD0:
- if(act==0) act= 10;
-
- if((block->flag & UI_BLOCK_NUMSELECT) && event->val==KM_PRESS) {
- if(event->alt) act+= 10;
-
- count= 0;
- for(but= block->buttons.first; but; but= but->next) {
- int doit= 0;
+ case ONEKEY: case PAD1:
+ act = 1;
+ case TWOKEY: case PAD2:
+ if (act == 0) act = 2;
+ case THREEKEY: case PAD3:
+ if (act == 0) act = 3;
+ case FOURKEY: case PAD4:
+ if (act == 0) act = 4;
+ case FIVEKEY: case PAD5:
+ if (act == 0) act = 5;
+ case SIXKEY: case PAD6:
+ if (act == 0) act = 6;
+ case SEVENKEY: case PAD7:
+ if (act == 0) act = 7;
+ case EIGHTKEY: case PAD8:
+ if (act == 0) act = 8;
+ case NINEKEY: case PAD9:
+ if (act == 0) act = 9;
+ case ZEROKEY: case PAD0:
+ if (act == 0) act = 10;
+
+ if ((block->flag & UI_BLOCK_NUMSELECT) && event->val == KM_PRESS) {
+ if (event->alt) act += 10;
+
+ count = 0;
+ for (but = block->buttons.first; but; but = but->next) {
+ int doit = 0;
- if(but->type!=LABEL && but->type!=SEPR)
+ if (but->type != LABEL && but->type != SEPR)
count++;
/* exception for rna layer buts */
- if(but->rnapoin.data && but->rnaprop) {
+ if (but->rnapoin.data && but->rnaprop) {
if (ELEM(RNA_property_subtype(but->rnaprop), PROP_LAYER, PROP_LAYER_MEMBER)) {
- if (but->rnaindex== act-1)
- doit=1;
+ if (but->rnaindex == act - 1)
+ doit = 1;
}
}
/* exception for menus like layer buts, with button aligning they're not drawn in order */
- else if(but->type==TOGR) {
- if(but->bitnr==act-1)
- doit= 1;
+ else if (but->type == TOGR) {
+ if (but->bitnr == act - 1)
+ doit = 1;
}
- else if(count==act)
- doit=1;
+ else if (count == act)
+ doit = 1;
- if(doit) {
+ if (doit) {
ui_handle_button_activate(C, ar, but, BUTTON_ACTIVATE_APPLY);
break;
}
}
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
break;
@@ -6293,19 +6184,19 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
case YKEY:
case ZKEY:
{
- if( (event->val == KM_PRESS) &&
+ if ((event->val == KM_PRESS) &&
(event->shift == FALSE) &&
(event->ctrl == FALSE) &&
- (event->oskey == FALSE)
- ) {
- for(but= block->buttons.first; but; but= but->next) {
+ (event->oskey == FALSE))
+ {
+ for (but = block->buttons.first; but; but = but->next) {
- if(but->menu_key==event->type) {
- if(but->type == BUT) {
+ if (but->menu_key == event->type) {
+ if (but->type == BUT) {
/* mainly for operator buttons */
ui_handle_button_activate(C, ar, but, BUTTON_ACTIVATE_APPLY);
}
- else if(ELEM(but->type, BLOCK, PULLDOWN)) {
+ else if (ELEM(but->type, BLOCK, PULLDOWN)) {
/* open submenus (like right arrow key) */
ui_handle_button_activate(C, ar, but, BUTTON_ACTIVATE_OPEN);
}
@@ -6321,7 +6212,7 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
}
}
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
break;
}
@@ -6329,62 +6220,62 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
}
/* here we check return conditions for menus */
- if(block->flag & UI_BLOCK_LOOP) {
+ if (block->flag & UI_BLOCK_LOOP) {
/* if we click outside the block, verify if we clicked on the
* button that opened us, otherwise we need to close */
- if(inside==0) {
- uiSafetyRct *saferct= block->saferct.first;
+ if (inside == 0) {
+ uiSafetyRct *saferct = block->saferct.first;
- if(ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) && event->val==KM_PRESS) {
- if(saferct && !BLI_in_rctf(&saferct->parent, event->x, event->y)) {
- if(block->flag & (UI_BLOCK_OUT_1))
- menu->menuretval= UI_RETURN_OK;
+ if (ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) && event->val == KM_PRESS) {
+ if (saferct && !BLI_in_rctf(&saferct->parent, event->x, event->y)) {
+ if (block->flag & (UI_BLOCK_OUT_1))
+ menu->menuretval = UI_RETURN_OK;
else
- menu->menuretval= UI_RETURN_OUT;
+ menu->menuretval = UI_RETURN_OUT;
}
}
}
- if(menu->menuretval);
- else if(event->type==ESCKEY && event->val==KM_PRESS) {
+ if (menu->menuretval) ;
+ else if (event->type == ESCKEY && event->val == KM_PRESS) {
/* esc cancels this and all preceding menus */
- menu->menuretval= UI_RETURN_CANCEL;
+ menu->menuretval = UI_RETURN_CANCEL;
}
- else if(ELEM(event->type, RETKEY, PADENTER) && event->val==KM_PRESS) {
+ else if (ELEM(event->type, RETKEY, PADENTER) && event->val == KM_PRESS) {
/* enter will always close this block, we let the event
* get handled by the button if it is activated, otherwise we cancel */
- if(!ui_but_find_activated(ar))
- menu->menuretval= UI_RETURN_CANCEL | UI_RETURN_POPUP_OK;
+ if (!ui_but_find_activated(ar))
+ menu->menuretval = UI_RETURN_CANCEL | UI_RETURN_POPUP_OK;
}
else {
ui_mouse_motion_towards_check(block, menu, mx, my);
/* check mouse moving outside of the menu */
- if(inside==0 && (block->flag & UI_BLOCK_MOVEMOUSE_QUIT)) {
+ if (inside == 0 && (block->flag & UI_BLOCK_MOVEMOUSE_QUIT)) {
uiSafetyRct *saferct;
/* check for all parent rects, enables arrowkeys to be used */
- for(saferct=block->saferct.first; saferct; saferct= saferct->next) {
+ for (saferct = block->saferct.first; saferct; saferct = saferct->next) {
/* for mouse move we only check our own rect, for other
* events we check all preceding block rects too to make
* arrow keys navigation work */
- if(event->type!=MOUSEMOVE || saferct==block->saferct.first) {
- if(BLI_in_rctf(&saferct->parent, (float)event->x, (float)event->y))
+ if (event->type != MOUSEMOVE || saferct == block->saferct.first) {
+ if (BLI_in_rctf(&saferct->parent, (float)event->x, (float)event->y))
break;
- if(BLI_in_rctf(&saferct->safety, (float)event->x, (float)event->y))
+ if (BLI_in_rctf(&saferct->safety, (float)event->x, (float)event->y))
break;
}
}
/* strict check, and include the parent rect */
- if(!menu->dotowards && !saferct) {
- if(block->flag & (UI_BLOCK_OUT_1))
- menu->menuretval= UI_RETURN_OK;
+ if (!menu->dotowards && !saferct) {
+ if (block->flag & (UI_BLOCK_OUT_1))
+ menu->menuretval = UI_RETURN_OK;
else
- menu->menuretval= UI_RETURN_OUT;
+ menu->menuretval = UI_RETURN_OUT;
}
- else if(menu->dotowards && event->type==MOUSEMOVE)
- retval= WM_UI_HANDLER_BREAK;
+ else if (menu->dotowards && event->type == MOUSEMOVE)
+ retval = WM_UI_HANDLER_BREAK;
}
}
}
@@ -6394,31 +6285,31 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
* buttons inside this region. disabled inside check .. not sure
* anymore why it was there? but it meant enter didn't work
* for example when mouse was not over submenu */
- if((/*inside &&*/ (!menu->menuretval || (menu->menuretval & UI_RETURN_UPDATE)) && retval == WM_UI_HANDLER_CONTINUE) || event->type == TIMER) {
- but= ui_but_find_activated(ar);
+ if ((/*inside &&*/ (!menu->menuretval || (menu->menuretval & UI_RETURN_UPDATE)) && retval == WM_UI_HANDLER_CONTINUE) || event->type == TIMER) {
+ but = ui_but_find_activated(ar);
- if(but) {
- ScrArea *ctx_area= CTX_wm_area(C);
- ARegion *ctx_region= CTX_wm_region(C);
+ if (but) {
+ ScrArea *ctx_area = CTX_wm_area(C);
+ ARegion *ctx_region = CTX_wm_region(C);
- if(menu->ctx_area) CTX_wm_area_set(C, menu->ctx_area);
- if(menu->ctx_region) CTX_wm_region_set(C, menu->ctx_region);
+ if (menu->ctx_area) CTX_wm_area_set(C, menu->ctx_area);
+ if (menu->ctx_region) CTX_wm_region_set(C, menu->ctx_region);
- retval= ui_handle_button_event(C, event, but);
+ retval = ui_handle_button_event(C, event, but);
- if(menu->ctx_area) CTX_wm_area_set(C, ctx_area);
- if(menu->ctx_region) CTX_wm_region_set(C, ctx_region);
+ if (menu->ctx_area) CTX_wm_area_set(C, ctx_area);
+ if (menu->ctx_region) CTX_wm_region_set(C, ctx_region);
}
else
- retval= ui_handle_button_over(C, event, ar);
+ retval = ui_handle_button_over(C, event, ar);
}
/* if we set a menu return value, ensure we continue passing this on to
* lower menus and buttons, so always set continue then, and if we are
* inside the region otherwise, ensure we swallow the event */
- if(menu->menuretval)
+ if (menu->menuretval)
return WM_UI_HANDLER_CONTINUE;
- else if(inside)
+ else if (inside)
return WM_UI_HANDLER_BREAK;
else
return retval;
@@ -6433,41 +6324,41 @@ static int ui_handle_menu_return_submenu(bContext *C, wmEvent *event, uiPopupBlo
uiPopupBlockHandle *submenu;
int mx, my, update;
- ar= menu->region;
- block= ar->uiblocks.first;
+ ar = menu->region;
+ block = ar->uiblocks.first;
- but= ui_but_find_activated(ar);
- data= but->active;
- submenu= data->menu;
+ but = ui_but_find_activated(ar);
+ data = but->active;
+ submenu = data->menu;
- if(submenu->menuretval) {
+ if (submenu->menuretval) {
/* first decide if we want to close our own menu cascading, if
* so pass on the sub menu return value to our own menu handle */
- if((submenu->menuretval & UI_RETURN_OK) || (submenu->menuretval & UI_RETURN_CANCEL)) {
- if(!(block->flag & UI_BLOCK_KEEP_OPEN)) {
- menu->menuretval= submenu->menuretval;
- menu->butretval= data->retval;
+ if ((submenu->menuretval & UI_RETURN_OK) || (submenu->menuretval & UI_RETURN_CANCEL)) {
+ if (!(block->flag & UI_BLOCK_KEEP_OPEN)) {
+ menu->menuretval = submenu->menuretval;
+ menu->butretval = data->retval;
}
}
- update= (submenu->menuretval & UI_RETURN_UPDATE);
+ update = (submenu->menuretval & UI_RETURN_UPDATE);
/* now let activated button in this menu exit, which
* will actually close the submenu too */
ui_handle_button_return_submenu(C, event, but);
- if(update)
+ if (update)
submenu->menuretval = 0;
}
/* for cases where close does not cascade, allow the user to
* move the mouse back towards the menu without closing */
- mx= event->x;
- my= event->y;
+ mx = event->x;
+ my = event->y;
ui_window_to_block(ar, block, &mx, &my);
ui_mouse_motion_towards_init(menu, mx, my, 1);
- if(menu->menuretval)
+ if (menu->menuretval)
return WM_UI_HANDLER_CONTINUE;
else
return WM_UI_HANDLER_BREAK;
@@ -6478,22 +6369,22 @@ static int ui_handle_menus_recursive(bContext *C, wmEvent *event, uiPopupBlockHa
uiBut *but;
uiHandleButtonData *data;
uiPopupBlockHandle *submenu;
- int retval= WM_UI_HANDLER_CONTINUE;
+ int retval = WM_UI_HANDLER_CONTINUE;
/* check if we have a submenu, and handle events for it first */
- but= ui_but_find_activated(menu->region);
- data= (but)? but->active: NULL;
- submenu= (data)? data->menu: NULL;
+ but = ui_but_find_activated(menu->region);
+ data = (but) ? but->active : NULL;
+ submenu = (data) ? data->menu : NULL;
- if(submenu)
- retval= ui_handle_menus_recursive(C, event, submenu);
+ if (submenu)
+ retval = ui_handle_menus_recursive(C, event, submenu);
/* now handle events for our own menu */
- if(retval == WM_UI_HANDLER_CONTINUE || event->type == TIMER) {
- if(submenu && submenu->menuretval)
- retval= ui_handle_menu_return_submenu(C, event, menu);
+ if (retval == WM_UI_HANDLER_CONTINUE || event->type == TIMER) {
+ if (submenu && submenu->menuretval)
+ retval = ui_handle_menu_return_submenu(C, event, menu);
else
- retval= ui_handle_menu_event(C, event, menu, (submenu == NULL));
+ retval = ui_handle_menu_event(C, event, menu, (submenu == NULL));
}
return retval;
@@ -6508,29 +6399,29 @@ static int ui_handler_region(bContext *C, wmEvent *event, void *UNUSED(userdata)
int retval;
/* here we handle buttons at the region level, non-modal */
- ar= CTX_wm_region(C);
- retval= WM_UI_HANDLER_CONTINUE;
+ ar = CTX_wm_region(C);
+ retval = WM_UI_HANDLER_CONTINUE;
- if(ar==NULL) return retval;
- if(ar->uiblocks.first==NULL) return retval;
+ if (ar == NULL) return retval;
+ if (ar->uiblocks.first == NULL) return retval;
/* either handle events for already activated button or try to activate */
- but= ui_but_find_activated(ar);
+ but = ui_but_find_activated(ar);
- retval= ui_handler_panel_region(C, event);
+ retval = ui_handler_panel_region(C, event);
- if(retval == WM_UI_HANDLER_CONTINUE)
- retval= ui_handle_list_event(C, event, ar);
+ if (retval == WM_UI_HANDLER_CONTINUE)
+ retval = ui_handle_list_event(C, event, ar);
- if(retval == WM_UI_HANDLER_CONTINUE) {
- if(but)
- retval= ui_handle_button_event(C, event, but);
+ if (retval == WM_UI_HANDLER_CONTINUE) {
+ if (but)
+ retval = ui_handle_button_event(C, event, but);
else
- retval= ui_handle_button_over(C, event, ar);
+ retval = ui_handle_button_over(C, event, ar);
}
/* re-enable tooltips */
- if(event->type == MOUSEMOVE && (event->x!=event->prevx || event->y!=event->prevy))
+ if (event->type == MOUSEMOVE && (event->x != event->prevx || event->y != event->prevy))
ui_blocks_set_tooltips(ar, 1);
/* delayed apply callbacks */
@@ -6544,18 +6435,18 @@ static void ui_handler_remove_region(bContext *C, void *UNUSED(userdata))
bScreen *sc;
ARegion *ar;
- ar= CTX_wm_region(C);
- if(ar == NULL) return;
+ ar = CTX_wm_region(C);
+ if (ar == NULL) return;
uiFreeBlocks(C, &ar->uiblocks);
- sc= CTX_wm_screen(C);
- if(sc == NULL) return;
+ sc = CTX_wm_screen(C);
+ if (sc == NULL) return;
/* delayed apply callbacks, but not for screen level regions, those
* we rather do at the very end after closing them all, which will
* be done in ui_handler_region/window */
- if(BLI_findindex(&sc->regionbase, ar) == -1)
+ if (BLI_findindex(&sc->regionbase, ar) == -1)
ui_apply_but_funcs_after(C);
}
@@ -6568,24 +6459,24 @@ static int ui_handler_region_menu(bContext *C, wmEvent *event, void *UNUSED(user
/* here we handle buttons at the window level, modal, for example
* while number sliding, text editing, or when a menu block is open */
- ar= CTX_wm_menu(C);
- if(!ar)
- ar= CTX_wm_region(C);
+ ar = CTX_wm_menu(C);
+ if (!ar)
+ ar = CTX_wm_region(C);
- but= ui_but_find_activated(ar);
+ but = ui_but_find_activated(ar);
- if(but) {
+ if (but) {
/* handle activated button events */
- data= but->active;
+ data = but->active;
- if(data->state == BUTTON_STATE_MENU_OPEN) {
+ if (data->state == BUTTON_STATE_MENU_OPEN) {
/* handle events for menus and their buttons recursively,
* this will handle events from the top to the bottom menu */
- retval= ui_handle_menus_recursive(C, event, data->menu);
+ retval = ui_handle_menus_recursive(C, event, data->menu);
/* handle events for the activated button */
- if(retval == WM_UI_HANDLER_CONTINUE || event->type == TIMER) {
- if(data->menu->menuretval)
+ if (retval == WM_UI_HANDLER_CONTINUE || event->type == TIMER) {
+ if (data->menu->menuretval)
ui_handle_button_return_submenu(C, event, but);
else
ui_handle_button_event(C, event, but);
@@ -6598,7 +6489,7 @@ static int ui_handler_region_menu(bContext *C, wmEvent *event, void *UNUSED(user
}
/* re-enable tooltips */
- if(event->type == MOUSEMOVE && (event->x!=event->prevx || event->y!=event->prevy))
+ if (event->type == MOUSEMOVE && (event->x != event->prevx || event->y != event->prevy))
ui_blocks_set_tooltips(ar, 1);
/* delayed apply callbacks */
@@ -6611,30 +6502,30 @@ static int ui_handler_region_menu(bContext *C, wmEvent *event, void *UNUSED(user
/* two types of popups, one with operator + enum, other with regular callbacks */
static int ui_handler_popup(bContext *C, wmEvent *event, void *userdata)
{
- uiPopupBlockHandle *menu= userdata;
+ uiPopupBlockHandle *menu = userdata;
ui_handle_menus_recursive(C, event, menu);
/* free if done, does not free handle itself */
- if(menu->menuretval) {
+ if (menu->menuretval) {
/* copy values, we have to free first (closes region) */
- uiPopupBlockHandle temp= *menu;
+ uiPopupBlockHandle temp = *menu;
ui_popup_block_free(C, menu);
UI_remove_popup_handlers(&CTX_wm_window(C)->modalhandlers, menu);
- if((temp.menuretval & UI_RETURN_OK) || (temp.menuretval & UI_RETURN_POPUP_OK)) {
- if(temp.popup_func)
+ if ((temp.menuretval & UI_RETURN_OK) || (temp.menuretval & UI_RETURN_POPUP_OK)) {
+ if (temp.popup_func)
temp.popup_func(C, temp.popup_arg, temp.retvalue);
- if(temp.optype)
+ if (temp.optype)
WM_operator_name_call(C, temp.optype->idname, temp.opcontext, NULL);
}
- else if(temp.cancel_func)
+ else if (temp.cancel_func)
temp.cancel_func(temp.popup_arg);
}
else {
/* re-enable tooltips */
- if(event->type == MOUSEMOVE && (event->x!=event->prevx || event->y!=event->prevy))
+ if (event->type == MOUSEMOVE && (event->x != event->prevx || event->y != event->prevy))
ui_blocks_set_tooltips(menu->region, 1);
}
@@ -6647,7 +6538,7 @@ static int ui_handler_popup(bContext *C, wmEvent *event, void *userdata)
static void ui_handler_remove_popup(bContext *C, void *userdata)
{
- uiPopupBlockHandle *menu= userdata;
+ uiPopupBlockHandle *menu = userdata;
/* free menu block if window is closed for some reason */
ui_popup_block_free(C, menu);
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 3e6d4f31479..d028fcd93ae 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -75,15 +75,15 @@
#include "interface_intern.h"
-#define ICON_IMAGE_W 600
-#define ICON_IMAGE_H 640
+#define ICON_IMAGE_W 600
+#define ICON_IMAGE_H 640
-#define ICON_GRID_COLS 26
-#define ICON_GRID_ROWS 30
+#define ICON_GRID_COLS 26
+#define ICON_GRID_ROWS 30
-#define ICON_GRID_MARGIN 5
-#define ICON_GRID_W 16
-#define ICON_GRID_H 16
+#define ICON_GRID_MARGIN 5
+#define ICON_GRID_W 16
+#define ICON_GRID_H 16
typedef struct IconImage {
int w;
@@ -93,10 +93,10 @@ typedef struct IconImage {
typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha);
-#define ICON_TYPE_PREVIEW 0
-#define ICON_TYPE_TEXTURE 1
-#define ICON_TYPE_BUFFER 2
-#define ICON_TYPE_VECTOR 3
+#define ICON_TYPE_PREVIEW 0
+#define ICON_TYPE_TEXTURE 1
+#define ICON_TYPE_BUFFER 2
+#define ICON_TYPE_VECTOR 3
typedef struct DrawInfo {
int type;
@@ -107,7 +107,7 @@ typedef struct DrawInfo {
VectorDrawFunc func;
} vector;
struct {
- IconImage* image;
+ IconImage *image;
} buffer;
struct {
int x, y, w, h;
@@ -145,24 +145,24 @@ static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs, int
new_icon->type = 0;
di = MEM_callocN(sizeof(DrawInfo), "drawinfo");
- di->type= type;
+ di->type = type;
- if(type == ICON_TYPE_TEXTURE) {
- di->data.texture.x= xofs;
- di->data.texture.y= yofs;
- di->data.texture.w= size;
- di->data.texture.h= size;
+ if (type == ICON_TYPE_TEXTURE) {
+ di->data.texture.x = xofs;
+ di->data.texture.y = yofs;
+ di->data.texture.w = size;
+ di->data.texture.h = size;
}
- else if(type == ICON_TYPE_BUFFER) {
+ else if (type == ICON_TYPE_BUFFER) {
iimg = MEM_mallocN(sizeof(IconImage), "icon_img");
- iimg->rect = MEM_mallocN(size*size*sizeof(unsigned int), "icon_rect");
+ iimg->rect = MEM_mallocN(size * size * sizeof(unsigned int), "icon_rect");
iimg->w = size;
iimg->h = size;
/* Here we store the rect in the icon - same as before */
imgsize = bbuf->x;
- for (y=0; y<size; y++) {
- memcpy(&iimg->rect[y*size], &bbuf->rect[(y+yofs)*imgsize+xofs], size*sizeof(int));
+ for (y = 0; y < size; y++) {
+ memcpy(&iimg->rect[y * size], &bbuf->rect[(y + yofs) * imgsize + xofs], size * sizeof(int));
}
di->data.buffer.image = iimg;
@@ -174,10 +174,10 @@ static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs, int
BKE_icon_set(icon_id, new_icon);
}
-static void def_internal_vicon( int icon_id, VectorDrawFunc drawFunc)
+static void def_internal_vicon(int icon_id, VectorDrawFunc drawFunc)
{
Icon *new_icon = NULL;
- DrawInfo* di;
+ DrawInfo *di;
new_icon = MEM_callocN(sizeof(Icon), "texicon");
@@ -185,7 +185,7 @@ static void def_internal_vicon( int icon_id, VectorDrawFunc drawFunc)
new_icon->type = 0;
di = MEM_callocN(sizeof(DrawInfo), "drawinfo");
- di->type= ICON_TYPE_VECTOR;
+ di->type = ICON_TYPE_VECTOR;
di->data.vector.func = drawFunc;
new_icon->drawinfo_free = NULL;
@@ -196,7 +196,7 @@ static void def_internal_vicon( int icon_id, VectorDrawFunc drawFunc)
/* Vector Icon Drawing Routines */
- /* Utilities */
+/* Utilities */
static void viconutil_set_point(GLint pt[2], int x, int y)
{
@@ -204,7 +204,7 @@ static void viconutil_set_point(GLint pt[2], int x, int y)
pt[1] = y;
}
-static void viconutil_draw_tri(GLint (*pts)[2])
+static void viconutil_draw_tri(GLint(*pts)[2])
{
glBegin(GL_TRIANGLES);
glVertex2iv(pts[0]);
@@ -213,41 +213,41 @@ static void viconutil_draw_tri(GLint (*pts)[2])
glEnd();
}
-static void viconutil_draw_lineloop(GLint (*pts)[2], int numPoints)
+static void viconutil_draw_lineloop(GLint(*pts)[2], int numPoints)
{
int i;
glBegin(GL_LINE_LOOP);
- for (i=0; i<numPoints; i++) {
+ for (i = 0; i < numPoints; i++) {
glVertex2iv(pts[i]);
}
glEnd();
}
-static void viconutil_draw_lineloop_smooth(GLint (*pts)[2], int numPoints)
+static void viconutil_draw_lineloop_smooth(GLint(*pts)[2], int numPoints)
{
glEnable(GL_LINE_SMOOTH);
viconutil_draw_lineloop(pts, numPoints);
glDisable(GL_LINE_SMOOTH);
}
-static void viconutil_draw_points(GLint (*pts)[2], int numPoints, int pointSize)
+static void viconutil_draw_points(GLint(*pts)[2], int numPoints, int pointSize)
{
int i;
glBegin(GL_QUADS);
- for (i=0; i<numPoints; i++) {
+ for (i = 0; i < numPoints; i++) {
int x = pts[i][0], y = pts[i][1];
- glVertex2i(x-pointSize,y-pointSize);
- glVertex2i(x+pointSize,y-pointSize);
- glVertex2i(x+pointSize,y+pointSize);
- glVertex2i(x-pointSize,y+pointSize);
+ glVertex2i(x - pointSize, y - pointSize);
+ glVertex2i(x + pointSize, y - pointSize);
+ glVertex2i(x + pointSize, y + pointSize);
+ glVertex2i(x - pointSize, y + pointSize);
}
glEnd();
}
- /* Drawing functions */
+/* Drawing functions */
static void vicon_x_draw(int x, int y, int w, int h, float alpha)
{
@@ -256,48 +256,48 @@ static void vicon_x_draw(int x, int y, int w, int h, float alpha)
w -= 6;
h -= 6;
- glEnable( GL_LINE_SMOOTH );
+ glEnable(GL_LINE_SMOOTH);
glLineWidth(2.5);
glColor4f(0.0, 0.0, 0.0, alpha);
glBegin(GL_LINES);
- glVertex2i(x ,y );
- glVertex2i(x+w,y+h);
- glVertex2i(x+w,y );
- glVertex2i(x ,y+h);
+ glVertex2i(x, y);
+ glVertex2i(x + w, y + h);
+ glVertex2i(x + w, y);
+ glVertex2i(x, y + h);
glEnd();
glLineWidth(1.0);
- glDisable( GL_LINE_SMOOTH );
+ glDisable(GL_LINE_SMOOTH);
}
static void vicon_view3d_draw(int x, int y, int w, int h, float alpha)
{
- int cx = x + w/2;
- int cy = y + h/2;
- int d = MAX2(2, h/3);
+ int cx = x + w / 2;
+ int cy = y + h / 2;
+ int d = MAX2(2, h / 3);
glColor4f(0.5, 0.5, 0.5, alpha);
glBegin(GL_LINES);
- glVertex2i(x , cy-d);
- glVertex2i(x+w, cy-d);
- glVertex2i(x , cy+d);
- glVertex2i(x+w, cy+d);
-
- glVertex2i(cx-d, y );
- glVertex2i(cx-d, y+h);
- glVertex2i(cx+d, y );
- glVertex2i(cx+d, y+h);
+ glVertex2i(x, cy - d);
+ glVertex2i(x + w, cy - d);
+ glVertex2i(x, cy + d);
+ glVertex2i(x + w, cy + d);
+
+ glVertex2i(cx - d, y);
+ glVertex2i(cx - d, y + h);
+ glVertex2i(cx + d, y);
+ glVertex2i(cx + d, y + h);
glEnd();
glColor4f(0.0, 0.0, 0.0, alpha);
glBegin(GL_LINES);
- glVertex2i(x , cy);
- glVertex2i(x+w, cy);
- glVertex2i(cx, y );
- glVertex2i(cx, y+h);
+ glVertex2i(x, cy);
+ glVertex2i(x + w, cy);
+ glVertex2i(cx, y);
+ glVertex2i(cx, y + h);
glEnd();
}
@@ -305,10 +305,10 @@ static void vicon_edit_draw(int x, int y, int w, int h, float alpha)
{
GLint pts[4][2];
- viconutil_set_point(pts[0], x+3 , y+3 );
- viconutil_set_point(pts[1], x+w-3, y+3 );
- viconutil_set_point(pts[2], x+w-3, y+h-3);
- viconutil_set_point(pts[3], x+3 , y+h-3);
+ viconutil_set_point(pts[0], x + 3, y + 3);
+ viconutil_set_point(pts[1], x + w - 3, y + 3);
+ viconutil_set_point(pts[2], x + w - 3, y + h - 3);
+ viconutil_set_point(pts[3], x + 3, y + h - 3);
glColor4f(0.0, 0.0, 0.0, alpha);
viconutil_draw_lineloop(pts, 4);
@@ -321,9 +321,9 @@ static void vicon_editmode_hlt_draw(int x, int y, int w, int h, float alpha)
{
GLint pts[3][2];
- viconutil_set_point(pts[0], x+w/2, y+h-2);
- viconutil_set_point(pts[1], x+3, y+4);
- viconutil_set_point(pts[2], x+w-3, y+4);
+ viconutil_set_point(pts[0], x + w / 2, y + h - 2);
+ viconutil_set_point(pts[1], x + 3, y + 4);
+ viconutil_set_point(pts[2], x + w - 3, y + 4);
glColor4f(0.5, 0.5, 0.5, alpha);
viconutil_draw_tri(pts);
@@ -339,9 +339,9 @@ static void vicon_editmode_dehlt_draw(int x, int y, int w, int h, float UNUSED(a
{
GLint pts[3][2];
- viconutil_set_point(pts[0], x+w/2, y+h-2);
- viconutil_set_point(pts[1], x+3, y+4);
- viconutil_set_point(pts[2], x+w-3, y+4);
+ viconutil_set_point(pts[0], x + w / 2, y + h - 2);
+ viconutil_set_point(pts[1], x + 3, y + 4);
+ viconutil_set_point(pts[2], x + w - 3, y + 4);
glColor4f(0.0f, 0.0f, 0.0f, 1);
viconutil_draw_lineloop_smooth(pts, 3);
@@ -353,13 +353,13 @@ static void vicon_editmode_dehlt_draw(int x, int y, int w, int h, float UNUSED(a
static void vicon_disclosure_tri_right_draw(int x, int y, int w, int UNUSED(h), float alpha)
{
GLint pts[3][2];
- int cx = x+w/2;
- int cy = y+w/2;
- int d = w/3, d2 = w/5;
+ int cx = x + w / 2;
+ int cy = y + w / 2;
+ int d = w / 3, d2 = w / 5;
- viconutil_set_point(pts[0], cx-d2, cy+d);
- viconutil_set_point(pts[1], cx-d2, cy-d);
- viconutil_set_point(pts[2], cx+d2, cy);
+ viconutil_set_point(pts[0], cx - d2, cy + d);
+ viconutil_set_point(pts[1], cx - d2, cy - d);
+ viconutil_set_point(pts[2], cx + d2, cy);
glShadeModel(GL_SMOOTH);
glBegin(GL_TRIANGLES);
@@ -378,13 +378,13 @@ static void vicon_disclosure_tri_right_draw(int x, int y, int w, int UNUSED(h),
static void vicon_small_tri_right_draw(int x, int y, int w, int UNUSED(h), float alpha)
{
GLint pts[3][2];
- int cx = x+w/2-4;
- int cy = y+w/2;
- int d = w/5, d2 = w/7;
+ int cx = x + w / 2 - 4;
+ int cy = y + w / 2;
+ int d = w / 5, d2 = w / 7;
- viconutil_set_point(pts[0], cx-d2, cy+d);
- viconutil_set_point(pts[1], cx-d2, cy-d);
- viconutil_set_point(pts[2], cx+d2, cy);
+ viconutil_set_point(pts[0], cx - d2, cy + d);
+ viconutil_set_point(pts[1], cx - d2, cy - d);
+ viconutil_set_point(pts[2], cx + d2, cy);
glColor4f(0.2f, 0.2f, 0.2f, alpha);
@@ -400,13 +400,13 @@ static void vicon_small_tri_right_draw(int x, int y, int w, int UNUSED(h), float
static void vicon_disclosure_tri_down_draw(int x, int y, int w, int UNUSED(h), float alpha)
{
GLint pts[3][2];
- int cx = x+w/2;
- int cy = y+w/2;
- int d = w/3, d2 = w/5;
+ int cx = x + w / 2;
+ int cy = y + w / 2;
+ int d = w / 3, d2 = w / 5;
- viconutil_set_point(pts[0], cx+d, cy+d2);
- viconutil_set_point(pts[1], cx-d, cy+d2);
- viconutil_set_point(pts[2], cx, cy-d2);
+ viconutil_set_point(pts[0], cx + d, cy + d2);
+ viconutil_set_point(pts[1], cx - d, cy + d2);
+ viconutil_set_point(pts[2], cx, cy - d2);
glShadeModel(GL_SMOOTH);
glBegin(GL_TRIANGLES);
@@ -424,16 +424,16 @@ static void vicon_disclosure_tri_down_draw(int x, int y, int w, int UNUSED(h), f
static void vicon_move_up_draw(int x, int y, int w, int h, float UNUSED(alpha))
{
- int d=-2;
+ int d = -2;
glEnable(GL_LINE_SMOOTH);
glLineWidth(1);
glColor3f(0.0, 0.0, 0.0);
glBegin(GL_LINE_STRIP);
- glVertex2i(x+w/2-d*2, y+h/2+d);
- glVertex2i(x+w/2, y+h/2-d + 1);
- glVertex2i(x+w/2+d*2, y+h/2+d);
+ glVertex2i(x + w / 2 - d * 2, y + h / 2 + d);
+ glVertex2i(x + w / 2, y + h / 2 - d + 1);
+ glVertex2i(x + w / 2 + d * 2, y + h / 2 + d);
glEnd();
glLineWidth(1.0);
@@ -442,16 +442,16 @@ static void vicon_move_up_draw(int x, int y, int w, int h, float UNUSED(alpha))
static void vicon_move_down_draw(int x, int y, int w, int h, float UNUSED(alpha))
{
- int d=2;
+ int d = 2;
glEnable(GL_LINE_SMOOTH);
glLineWidth(1);
glColor3f(0.0, 0.0, 0.0);
glBegin(GL_LINE_STRIP);
- glVertex2i(x+w/2-d*2, y+h/2+d);
- glVertex2i(x+w/2, y+h/2-d - 1);
- glVertex2i(x+w/2+d*2, y+h/2+d);
+ glVertex2i(x + w / 2 - d * 2, y + h / 2 + d);
+ glVertex2i(x + w / 2, y + h / 2 - d - 1);
+ glVertex2i(x + w / 2 + d * 2, y + h / 2 + d);
glEnd();
glLineWidth(1.0);
@@ -462,12 +462,15 @@ static void vicon_move_down_draw(int x, int y, int w, int h, float UNUSED(alpha)
static void init_brush_icons(void)
{
-#define INIT_BRUSH_ICON(icon_id, name) \
- bbuf = IMB_ibImageFromMemory((unsigned char*)datatoc_ ##name## _png, \
- datatoc_ ##name## _png_size, IB_rect, "<brush icon>"); \
- def_internal_icon(bbuf, icon_id, 0, 0, w, ICON_TYPE_BUFFER); \
- IMB_freeImBuf(bbuf);
- // end INIT_BRUSH_ICON
+#define INIT_BRUSH_ICON(icon_id, name) \
+ { \
+ bbuf = IMB_ibImageFromMemory((unsigned char *)datatoc_ ##name## _png, \
+ datatoc_ ##name## _png_size, \
+ IB_rect, "<brush icon>"); \
+ def_internal_icon(bbuf, icon_id, 0, 0, w, ICON_TYPE_BUFFER); \
+ IMB_freeImBuf(bbuf); \
+ } (void)0
+ /* end INIT_BRUSH_ICON */
ImBuf *bbuf;
const int w = 96;
@@ -476,6 +479,7 @@ static void init_brush_icons(void)
INIT_BRUSH_ICON(ICON_BRUSH_BLOB, blob);
INIT_BRUSH_ICON(ICON_BRUSH_BLUR, blur);
INIT_BRUSH_ICON(ICON_BRUSH_CLAY, clay);
+ INIT_BRUSH_ICON(ICON_BRUSH_CLAY_STRIPS, claystrips);
INIT_BRUSH_ICON(ICON_BRUSH_CLONE, clone);
INIT_BRUSH_ICON(ICON_BRUSH_CREASE, crease);
INIT_BRUSH_ICON(ICON_BRUSH_DARKEN, darken);
@@ -506,45 +510,45 @@ static void init_brush_icons(void)
static void init_internal_icons(void)
{
- bTheme *btheme= UI_GetTheme();
- ImBuf *bbuf= NULL;
+ bTheme *btheme = UI_GetTheme();
+ ImBuf *bbuf = NULL;
int x, y, icontype;
char iconfilestr[FILE_MAX];
- if ((btheme!=NULL) && btheme->tui.iconfile[0]) {
- char *icondir= BLI_get_folder(BLENDER_DATAFILES, "icons");
+ if ((btheme != NULL) && btheme->tui.iconfile[0]) {
+ char *icondir = BLI_get_folder(BLENDER_DATAFILES, "icons");
if (icondir) {
BLI_join_dirfile(iconfilestr, sizeof(iconfilestr), icondir, btheme->tui.iconfile);
bbuf = IMB_loadiffname(iconfilestr, IB_rect); /* if the image is missing bbuf will just be NULL */
- if(bbuf && (bbuf->x < ICON_IMAGE_W || bbuf->y < ICON_IMAGE_H)) {
+ if (bbuf && (bbuf->x < ICON_IMAGE_W || bbuf->y < ICON_IMAGE_H)) {
printf("\n***WARNING***\nIcons file %s too small.\nUsing built-in Icons instead\n", iconfilestr);
IMB_freeImBuf(bbuf);
- bbuf= NULL;
+ bbuf = NULL;
}
}
else {
printf("%s: 'icons' data path not found, continuing\n", __func__);
}
}
- if(bbuf==NULL)
- bbuf = IMB_ibImageFromMemory((unsigned char*)datatoc_blender_icons_png, datatoc_blender_icons_png_size, IB_rect, "<blender icons>");
+ if (bbuf == NULL)
+ bbuf = IMB_ibImageFromMemory((unsigned char *)datatoc_blender_icons_png, datatoc_blender_icons_png_size, IB_rect, "<blender icons>");
- if(bbuf) {
+ if (bbuf) {
/* free existing texture if any */
- if(icongltex.id) {
+ if (icongltex.id) {
glDeleteTextures(1, &icongltex.id);
- icongltex.id= 0;
+ icongltex.id = 0;
}
/* we only use a texture for cards with non-power of two */
- if(GPU_non_power_of_two_support()) {
+ if (GPU_non_power_of_two_support()) {
glGenTextures(1, &icongltex.id);
- if(icongltex.id) {
+ if (icongltex.id) {
icongltex.w = bbuf->x;
icongltex.h = bbuf->y;
- icongltex.invw = 1.0f/bbuf->x;
- icongltex.invh = 1.0f/bbuf->y;
+ icongltex.invw = 1.0f / bbuf->x;
+ icongltex.invh = 1.0f / bbuf->y;
glBindTexture(GL_TEXTURE_2D, icongltex.id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bbuf->x, bbuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, bbuf->rect);
@@ -552,26 +556,26 @@ static void init_internal_icons(void)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glBindTexture(GL_TEXTURE_2D, 0);
- if(glGetError() == GL_OUT_OF_MEMORY) {
+ if (glGetError() == GL_OUT_OF_MEMORY) {
glDeleteTextures(1, &icongltex.id);
- icongltex.id= 0;
+ icongltex.id = 0;
}
}
}
}
- if(icongltex.id)
- icontype= ICON_TYPE_TEXTURE;
+ if (icongltex.id)
+ icontype = ICON_TYPE_TEXTURE;
else
- icontype= ICON_TYPE_BUFFER;
+ icontype = ICON_TYPE_BUFFER;
- if(bbuf) {
- for (y=0; y<ICON_GRID_ROWS; y++) {
- for (x=0; x<ICON_GRID_COLS; x++) {
- def_internal_icon(bbuf, BIFICONID_FIRST + y*ICON_GRID_COLS + x,
- x*(ICON_GRID_W+ICON_GRID_MARGIN)+ICON_GRID_MARGIN,
- y*(ICON_GRID_H+ICON_GRID_MARGIN)+ICON_GRID_MARGIN, ICON_GRID_W,
- icontype);
+ if (bbuf) {
+ for (y = 0; y < ICON_GRID_ROWS; y++) {
+ for (x = 0; x < ICON_GRID_COLS; x++) {
+ def_internal_icon(bbuf, BIFICONID_FIRST + y * ICON_GRID_COLS + x,
+ x * (ICON_GRID_W + ICON_GRID_MARGIN) + ICON_GRID_MARGIN,
+ y * (ICON_GRID_H + ICON_GRID_MARGIN) + ICON_GRID_MARGIN, ICON_GRID_W,
+ icontype);
}
}
}
@@ -596,47 +600,47 @@ static void init_iconfile_list(struct ListBase *list)
IconFile *ifile;
struct direntry *dir;
int restoredir = 1; /* restore to current directory */
- int totfile, i, index=1;
+ int totfile, i, index = 1;
const char *icondir;
char olddir[FILE_MAX];
list->first = list->last = NULL;
icondir = BLI_get_folder(BLENDER_DATAFILES, "icons");
- if(icondir==NULL)
+ if (icondir == NULL)
return;
/* since BLI_dir_contents changes the current working directory, restore it
- back to old value afterwards */
- if(!BLI_current_working_dir(olddir, sizeof(olddir)))
+ * back to old value afterwards */
+ if (!BLI_current_working_dir(olddir, sizeof(olddir)))
restoredir = 0;
totfile = BLI_dir_contents(icondir, &dir);
if (restoredir && !chdir(olddir)) {} /* fix warning about checking return value */
- for(i=0; i<totfile; i++) {
- if( (dir[i].type & S_IFREG) ) {
+ for (i = 0; i < totfile; i++) {
+ if ( (dir[i].type & S_IFREG) ) {
char *filename = dir[i].relname;
- if(BLI_testextensie(filename, ".png")) {
+ if (BLI_testextensie(filename, ".png")) {
/* loading all icons on file start is overkill & slows startup
* its possible they change size after blender load anyway. */
#if 0
int ifilex, ifiley;
- char iconfilestr[FILE_MAX+16]; /* allow 256 chars for file+dir */
- ImBuf *bbuf= NULL;
+ char iconfilestr[FILE_MAX + 16]; /* allow 256 chars for file+dir */
+ 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);
+ bbuf = IMB_loadiffname(iconfilestr, IB_rect);
- if(bbuf) {
+ if (bbuf) {
ifilex = bbuf->x;
ifiley = bbuf->y;
IMB_freeImBuf(bbuf);
}
else {
- ifilex= ifiley= 0;
+ ifilex = ifiley = 0;
}
/* bad size or failed to load */
@@ -644,7 +648,7 @@ static void init_iconfile_list(struct ListBase *list)
printf("icon '%s' is wrong size %dx%d\n", iconfilestr, ifilex, ifiley);
continue;
}
-#endif /* removed */
+#endif /* removed */
/* found a potential icon file, so make an entry for it in the cache list */
ifile = MEM_callocN(sizeof(IconFile), "IconFile");
@@ -660,9 +664,9 @@ static void init_iconfile_list(struct ListBase *list)
}
/* free temporary direntry structure that's been created by BLI_dir_contents() */
- i= totfile-1;
+ i = totfile - 1;
- for (; i>=0; i--) {
+ for (; i >= 0; i--) {
MEM_freeN(dir[i].relname);
MEM_freeN(dir[i].path);
if (dir[i].string) {
@@ -670,14 +674,14 @@ static void init_iconfile_list(struct ListBase *list)
}
}
free(dir);
- dir= NULL;
+ dir = NULL;
}
static void free_iconfile_list(struct ListBase *list)
{
- IconFile *ifile=NULL, *next_ifile=NULL;
+ IconFile *ifile = NULL, *next_ifile = NULL;
- for(ifile=list->first; ifile; ifile=next_ifile) {
+ for (ifile = list->first; ifile; ifile = next_ifile) {
next_ifile = ifile->next;
BLI_freelinkN(list, ifile);
}
@@ -686,9 +690,9 @@ static void free_iconfile_list(struct ListBase *list)
int UI_iconfile_get_index(const char *filename)
{
IconFile *ifile;
- ListBase *list=&(iconfilelist);
+ ListBase *list = &(iconfilelist);
- for(ifile=list->first; ifile; ifile=ifile->next) {
+ for (ifile = list->first; ifile; ifile = ifile->next) {
if (BLI_path_cmp(filename, ifile->filename) == 0) {
return ifile->index;
}
@@ -699,7 +703,7 @@ int UI_iconfile_get_index(const char *filename)
ListBase *UI_iconfile_list(void)
{
- ListBase *list=&(iconfilelist);
+ ListBase *list = &(iconfilelist);
return list;
}
@@ -708,9 +712,9 @@ ListBase *UI_iconfile_list(void)
void UI_icons_free(void)
{
#ifndef WITH_HEADLESS
- if(icongltex.id) {
+ if (icongltex.id) {
glDeleteTextures(1, &icongltex.id);
- icongltex.id= 0;
+ icongltex.id = 0;
}
free_iconfile_list(&iconfilelist);
@@ -722,9 +726,9 @@ void UI_icons_free_drawinfo(void *drawinfo)
{
DrawInfo *di = drawinfo;
- if(di) {
- if(di->type == ICON_TYPE_BUFFER) {
- if(di->data.buffer.image) {
+ if (di) {
+ if (di->type == ICON_TYPE_BUFFER) {
+ if (di->data.buffer.image) {
MEM_freeN(di->data.buffer.image->rect);
MEM_freeN(di->data.buffer.image);
}
@@ -739,7 +743,7 @@ static DrawInfo *icon_create_drawinfo(void)
DrawInfo *di = NULL;
di = MEM_callocN(sizeof(DrawInfo), "di_icon");
- di->type= ICON_TYPE_PREVIEW;
+ di->type = ICON_TYPE_PREVIEW;
return di;
}
@@ -752,8 +756,8 @@ int UI_icon_get_width(int icon_id)
icon = BKE_icon_get(icon_id);
- if (icon==NULL) {
- if (G.f & G_DEBUG)
+ if (icon == NULL) {
+ if (G.debug & G_DEBUG)
printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
return 0;
}
@@ -777,13 +781,13 @@ int UI_icon_get_height(int icon_id)
icon = BKE_icon_get(icon_id);
- if (icon==NULL) {
- if (G.f & G_DEBUG)
+ if (icon == NULL) {
+ if (G.debug & G_DEBUG)
printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
return 0;
}
- di = (DrawInfo*)icon->drawinfo;
+ di = (DrawInfo *)icon->drawinfo;
if (!di) {
di = icon_create_drawinfo();
@@ -813,7 +817,7 @@ void UI_icons_init(int first_dyn_id)
static int preview_render_size(enum eIconSizes size)
{
switch (size) {
- case ICON_SIZE_ICON: return 32;
+ case ICON_SIZE_ICON: return 32;
case ICON_SIZE_PREVIEW: return PREVIEW_DEFAULT_HEIGHT;
}
return 0;
@@ -821,12 +825,12 @@ static int preview_render_size(enum eIconSizes size)
/* Create rect for the icon
*/
-static void icon_create_rect(struct PreviewImage* prv_img, enum eIconSizes size)
+static void icon_create_rect(struct PreviewImage *prv_img, enum eIconSizes size)
{
unsigned int render_size = preview_render_size(size);
if (!prv_img) {
- if (G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("%s, error: requested preview image does not exist", __func__);
}
if (!prv_img->rect[size]) {
@@ -834,16 +838,16 @@ static void icon_create_rect(struct PreviewImage* prv_img, enum eIconSizes size)
prv_img->h[size] = render_size;
prv_img->changed[size] = 1;
prv_img->changed_timestamp[size] = 0;
- prv_img->rect[size] = MEM_callocN(render_size*render_size*sizeof(unsigned int), "prv_rect");
+ prv_img->rect[size] = MEM_callocN(render_size * render_size * sizeof(unsigned int), "prv_rect");
}
}
/* only called when icon has changed */
/* only call with valid pointer from UI_icon_draw */
-static void icon_set_image(bContext *C, ID *id, PreviewImage* prv_img, enum eIconSizes size)
+static void icon_set_image(bContext *C, ID *id, PreviewImage *prv_img, enum eIconSizes size)
{
if (!prv_img) {
- if (G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("%s: no preview image for this ID: %s\n", __func__, id->name);
return;
}
@@ -851,41 +855,41 @@ static void icon_set_image(bContext *C, ID *id, PreviewImage* prv_img, enum eIco
icon_create_rect(prv_img, size);
ED_preview_icon_job(C, prv_img, id, prv_img->rect[size],
- prv_img->w[size], prv_img->h[size]);
+ prv_img->w[size], prv_img->h[size]);
}
static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), int rw, int rh, unsigned int *rect, float alpha, float *rgb, short is_preview)
{
- ImBuf *ima= NULL;
+ ImBuf *ima = NULL;
/* sanity check */
- if(w<=0 || h<=0 || w>2000 || h>2000) {
+ if (w <= 0 || h <= 0 || w > 2000 || h > 2000) {
printf("%s: icons are %i x %i pixels?\n", __func__, w, h);
BLI_assert(!"invalid icon size");
return;
}
/* modulate color */
- if(alpha != 1.0f)
+ if (alpha != 1.0f)
glPixelTransferf(GL_ALPHA_SCALE, alpha);
- if(rgb) {
+ if (rgb) {
glPixelTransferf(GL_RED_SCALE, rgb[0]);
glPixelTransferf(GL_GREEN_SCALE, rgb[1]);
glPixelTransferf(GL_BLUE_SCALE, rgb[2]);
}
/* rect contains image in 'rendersize', we only scale if needed */
- if(rw!=w && rh!=h) {
+ if (rw != w && rh != h) {
/* first allocate imbuf for scaling and copy preview into it */
ima = IMB_allocImBuf(rw, rh, 32, IB_rect);
- memcpy(ima->rect, rect, rw*rh*sizeof(unsigned int));
+ memcpy(ima->rect, rect, rw * rh * sizeof(unsigned int));
IMB_scaleImBuf(ima, w, h); /* scale it */
- rect= ima->rect;
+ rect = ima->rect;
}
/* draw */
- if(is_preview) {
+ if (is_preview) {
glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, rect);
}
else {
@@ -893,14 +897,14 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect),
glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, rect);
}
- if(ima)
+ if (ima)
IMB_freeImBuf(ima);
/* restore color */
- if(alpha != 0.0f)
+ if (alpha != 0.0f)
glPixelTransferf(GL_ALPHA_SCALE, 1.0f);
- if(rgb) {
+ if (rgb) {
glPixelTransferf(GL_RED_SCALE, 1.0f);
glPixelTransferf(GL_GREEN_SCALE, 1.0f);
glPixelTransferf(GL_BLUE_SCALE, 1.0f);
@@ -911,13 +915,13 @@ static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy
{
float x1, x2, y1, y2;
- if(rgb) glColor4f(rgb[0], rgb[1], rgb[2], alpha);
+ if (rgb) glColor4f(rgb[0], rgb[1], rgb[2], alpha);
else glColor4f(1.0f, 1.0f, 1.0f, alpha);
- x1= ix*icongltex.invw;
- x2= (ix + ih)*icongltex.invw;
- y1= iy*icongltex.invh;
- y2= (iy + ih)*icongltex.invh;
+ x1 = ix * icongltex.invw;
+ x2 = (ix + ih) * icongltex.invw;
+ y1 = iy * icongltex.invh;
+ y2 = (iy + ih) * icongltex.invh;
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, icongltex.id);
@@ -927,13 +931,13 @@ static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy
glVertex2f(x, y);
glTexCoord2f(x2, y1);
- glVertex2f(x+w, y);
+ glVertex2f(x + w, y);
glTexCoord2f(x2, y2);
- glVertex2f(x+w, y+h);
+ glVertex2f(x + w, y + h);
glTexCoord2f(x1, y2);
- glVertex2f(x, y+h);
+ glVertex2f(x, y + h);
glEnd();
glBindTexture(GL_TEXTURE_2D, 0);
@@ -952,23 +956,23 @@ static int get_draw_size(enum eIconSizes size)
static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, float *rgb, enum eIconSizes size, int draw_size, int UNUSED(nocreate), short is_preview)
{
- bTheme *btheme= UI_GetTheme();
+ bTheme *btheme = UI_GetTheme();
Icon *icon = NULL;
DrawInfo *di = NULL;
IconImage *iimg;
- float fdraw_size= is_preview ? draw_size : (draw_size * UI_DPI_ICON_FAC);
+ float fdraw_size = is_preview ? draw_size : (draw_size * UI_DPI_ICON_FAC);
int w, h;
icon = BKE_icon_get(icon_id);
alpha *= btheme->tui.icon_alpha;
- if (icon==NULL) {
- if (G.f & G_DEBUG)
+ if (icon == NULL) {
+ if (G.debug & G_DEBUG)
printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
return;
}
- di = (DrawInfo*)icon->drawinfo;
+ di = (DrawInfo *)icon->drawinfo;
if (!di) {
di = icon_create_drawinfo();
@@ -978,32 +982,32 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
}
/* scale width and height according to aspect */
- w = (int)(fdraw_size/aspect + 0.5f);
- h = (int)(fdraw_size/aspect + 0.5f);
+ w = (int)(fdraw_size / aspect + 0.5f);
+ h = (int)(fdraw_size / aspect + 0.5f);
- if(di->type == ICON_TYPE_VECTOR) {
+ 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) {
+ else if (di->type == ICON_TYPE_TEXTURE) {
icon_draw_texture(x, y, (float)w, (float)h, di->data.texture.x, di->data.texture.y,
- di->data.texture.w, di->data.texture.h, alpha, rgb);
+ di->data.texture.w, di->data.texture.h, alpha, rgb);
}
- else if(di->type == ICON_TYPE_BUFFER) {
+ else if (di->type == ICON_TYPE_BUFFER) {
/* it is a builtin icon */
- iimg= di->data.buffer.image;
+ iimg = di->data.buffer.image;
- if(!iimg->rect) return; /* something has gone wrong! */
+ if (!iimg->rect) return; /* something has gone wrong! */
icon_draw_rect(x, y, w, h, aspect, iimg->w, iimg->h, iimg->rect, alpha, rgb, is_preview);
}
- else if(di->type == ICON_TYPE_PREVIEW) {
- PreviewImage* pi = BKE_previewimg_get((ID*)icon->obj);
+ else if (di->type == ICON_TYPE_PREVIEW) {
+ PreviewImage *pi = BKE_previewimg_get((ID *)icon->obj);
- if(pi) {
+ if (pi) {
/* no create icon on this level in code */
- if(!pi->rect[size]) return; /* something has gone wrong! */
+ if (!pi->rect[size]) return; /* something has gone wrong! */
/* preview images use premul alpha ... */
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
@@ -1015,8 +1019,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);
@@ -1030,9 +1033,9 @@ static void ui_id_icon_render(bContext *C, ID *id, int big)
if (pi) {
if (big)
- ui_id_preview_image_render_size(C, id, pi, ICON_SIZE_PREVIEW); /* bigger preview size */
+ ui_id_preview_image_render_size(C, id, pi, ICON_SIZE_PREVIEW); /* bigger preview size */
else
- ui_id_preview_image_render_size(C, id, pi, ICON_SIZE_ICON); /* icon size */
+ ui_id_preview_image_render_size(C, id, pi, ICON_SIZE_ICON); /* icon size */
}
}
@@ -1041,13 +1044,13 @@ static void ui_id_brush_render(bContext *C, ID *id)
PreviewImage *pi = BKE_previewimg_get(id);
enum eIconSizes i;
- if(!pi)
+ if (!pi)
return;
- for(i = 0; i < NUM_ICON_SIZES; i++) {
+ for (i = 0; i < NUM_ICON_SIZES; i++) {
/* check if rect needs to be created; changed
- only set by dynamic icons */
- if((pi->changed[i] || !pi->rect[i])) {
+ * only set by dynamic icons */
+ if ((pi->changed[i] || !pi->rect[i])) {
icon_set_image(C, id, pi, i);
pi->changed[i] = 0;
}
@@ -1057,9 +1060,9 @@ static void ui_id_brush_render(bContext *C, ID *id)
static int ui_id_brush_get_icon(bContext *C, ID *id)
{
- Brush *br = (Brush*)id;
+ Brush *br = (Brush *)id;
- if(br->flag & BRUSH_CUSTOM_ICON) {
+ if (br->flag & BRUSH_CUSTOM_ICON) {
BKE_icon_getid(id);
ui_id_brush_render(C, id);
}
@@ -1070,37 +1073,38 @@ 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)
+ if (CTX_wm_view3d(C) && ob) {
+ if (ob->mode & OB_MODE_SCULPT)
mode = OB_MODE_SCULPT;
- else if(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT))
+ else if (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT))
mode = OB_MODE_VERTEX_PAINT;
- else if(ob->mode & OB_MODE_TEXTURE_PAINT)
+ else if (ob->mode & OB_MODE_TEXTURE_PAINT)
mode = OB_MODE_TEXTURE_PAINT;
}
- else if((sima = CTX_wm_space_image(C)) &&
- (sima->flag & SI_DRAWTOOL)) {
+ else if ((sima = CTX_wm_space_image(C)) &&
+ (sima->flag & SI_DRAWTOOL))
+ {
mode = OB_MODE_TEXTURE_PAINT;
}
/* reset the icon */
- if(mode == OB_MODE_SCULPT) {
+ if (mode == OB_MODE_SCULPT) {
items = brush_sculpt_tool_items;
tool = br->sculpt_tool;
}
- else if(mode == OB_MODE_VERTEX_PAINT) {
+ else if (mode == OB_MODE_VERTEX_PAINT) {
items = brush_vertex_tool_items;
tool = br->vertexpaint_tool;
}
- else if(mode == OB_MODE_TEXTURE_PAINT) {
+ else if (mode == OB_MODE_TEXTURE_PAINT) {
items = brush_image_tool_items;
tool = br->imagepaint_tool;
}
- if(!items || !RNA_enum_icon_from_value(items, tool, &id->icon_id))
+ if (!items || !RNA_enum_icon_from_value(items, tool, &id->icon_id))
id->icon_id = 0;
}
@@ -1109,19 +1113,19 @@ static int ui_id_brush_get_icon(bContext *C, ID *id)
int ui_id_icon_get(bContext *C, ID *id, int big)
{
- int iconid= 0;
+ int iconid = 0;
/* icon */
- switch(GS(id->name)) {
+ switch (GS(id->name)) {
case ID_BR:
- iconid= ui_id_brush_get_icon(C, id);
+ iconid = ui_id_brush_get_icon(C, id);
break;
case ID_MA: /* fall through */
case ID_TE: /* fall through */
case ID_IM: /* fall through */
case ID_WO: /* fall through */
case ID_LA: /* fall through */
- iconid= BKE_icon_getid(id);
+ iconid = BKE_icon_getid(id);
/* checks if not exists, or changed */
ui_id_icon_render(C, id, big);
break;
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index d324018e4ba..a0935e7abdd 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -68,6 +68,7 @@ typedef enum {
UI_WTYPE_NUMBER,
UI_WTYPE_SLIDER,
UI_WTYPE_EXEC,
+ UI_WTYPE_TOOLTIP,
/* strings */
UI_WTYPE_NAME,
@@ -84,7 +85,7 @@ typedef enum {
UI_WTYPE_PULLDOWN,
UI_WTYPE_MENU_ITEM,
UI_WTYPE_MENU_BACK,
-
+
/* specials */
UI_WTYPE_ICON,
UI_WTYPE_SWATCH,
@@ -176,10 +177,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;
@@ -465,6 +466,8 @@ extern int ui_button_is_active(struct ARegion *ar);
void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3);
void ui_draw_anti_roundbox(int mode, float minx, float miny, float maxx, float maxy, float rad);
void ui_draw_menu_back(struct uiStyle *style, uiBlock *block, rcti *rect);
+uiWidgetColors* ui_tooltip_get_theme(void);
+void ui_draw_tooltip_background(uiStyle *UNUSED(style), uiBlock *block, rcti *rect);
void ui_draw_search_back(struct uiStyle *style, uiBlock *block, rcti *rect);
int ui_link_bezier_points(rcti *rect, float coord_array[][2], int resol);
void ui_draw_link_bezier(rcti *rect);
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index b3b187f92a2..91e38e7d914 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -60,11 +60,11 @@
/************************ Structs and Defines *************************/
-#define RNA_NO_INDEX -1
-#define RNA_ENUM_VALUE -2
+#define RNA_NO_INDEX -1
+#define RNA_ENUM_VALUE -2
-#define EM_SEPR_X 6
-#define EM_SEPR_Y 6
+#define EM_SEPR_X 6
+#define EM_SEPR_Y 6
#define UI_OPERATOR_ERROR_RET(_ot, _opname, return_statement) \
if (ot == NULL) { \
@@ -170,12 +170,12 @@ typedef struct uiLayoutItemRoot {
static const char *ui_item_name_add_colon(const char *name, char namestr[UI_MAX_NAME_STR])
{
- int len= strlen(name);
+ int len = strlen(name);
- if(len != 0 && len+1 < UI_MAX_NAME_STR) {
+ if (len != 0 && len + 1 < UI_MAX_NAME_STR) {
BLI_strncpy(namestr, name, UI_MAX_NAME_STR);
- namestr[len]= ':';
- namestr[len+1]= '\0';
+ namestr[len] = ':';
+ namestr[len + 1] = '\0';
return namestr;
}
@@ -185,26 +185,26 @@ static const char *ui_item_name_add_colon(const char *name, char namestr[UI_MAX_
static int ui_item_fit(int item, int pos, int all, int available, int last, int alignment, int *offset)
{
/* available == 0 is unlimited */
- if(available == 0)
+ if (available == 0)
return item;
- if(offset)
- *offset= 0;
+ if (offset)
+ *offset = 0;
- if(all > available) {
+ if (all > available) {
/* contents is bigger than available space */
- if(last)
- return available-pos;
+ if (last)
+ return available - pos;
else
- return (item*available)/all;
+ return (item * available) / all;
}
else {
/* contents is smaller or equal to available space */
- if(alignment == UI_LAYOUT_ALIGN_EXPAND) {
- if(last)
- return available-pos;
+ if (alignment == UI_LAYOUT_ALIGN_EXPAND) {
+ if (last)
+ return available - pos;
else
- return (item*available)/all;
+ return (item * available) / all;
}
else
return item;
@@ -212,12 +212,12 @@ static int ui_item_fit(int item, int pos, int all, int available, int last, int
}
/* variable button size in which direction? */
-#define UI_ITEM_VARY_X 1
-#define UI_ITEM_VARY_Y 2
+#define UI_ITEM_VARY_X 1
+#define UI_ITEM_VARY_Y 2
static int ui_layout_vary_direction(uiLayout *layout)
{
- return (layout->root->type == UI_LAYOUT_HEADER || layout->alignment != UI_LAYOUT_ALIGN_EXPAND)? UI_ITEM_VARY_X: UI_ITEM_VARY_Y;
+ return (layout->root->type == UI_LAYOUT_HEADER || layout->alignment != UI_LAYOUT_ALIGN_EXPAND) ? UI_ITEM_VARY_X : UI_ITEM_VARY_Y;
}
/* estimated size of text + icon */
@@ -225,63 +225,63 @@ static int ui_text_icon_width(uiLayout *layout, const char *name, int icon, int
{
int variable = ui_layout_vary_direction(layout) == UI_ITEM_VARY_X;
- if(icon && !name[0])
- return UI_UNIT_X; /* icon only */
- else if(icon)
- return (variable)? UI_GetStringWidth(name) + (compact? 5: 10) + UI_UNIT_X: 10*UI_UNIT_X; /* icon + text */
+ if (icon && !name[0])
+ return UI_UNIT_X; /* icon only */
+ else if (icon)
+ return (variable) ? UI_GetStringWidth(name) + (compact ? 5 : 10) + UI_UNIT_X : 10 * UI_UNIT_X; /* icon + text */
else
- return (variable)? UI_GetStringWidth(name) + (compact? 5: 10) + UI_UNIT_X: 10*UI_UNIT_X; /* text only */
+ return (variable) ? UI_GetStringWidth(name) + (compact ? 5 : 10) + UI_UNIT_X : 10 * UI_UNIT_X; /* text only */
}
static void ui_item_size(uiItem *item, int *r_w, int *r_h)
{
- if(item->type == ITEM_BUTTON) {
- uiButtonItem *bitem= (uiButtonItem*)item;
+ if (item->type == ITEM_BUTTON) {
+ uiButtonItem *bitem = (uiButtonItem *)item;
- if(r_w) *r_w= bitem->but->x2 - bitem->but->x1;
- if(r_h) *r_h= bitem->but->y2 - bitem->but->y1;
+ if (r_w) *r_w = bitem->but->x2 - bitem->but->x1;
+ if (r_h) *r_h = bitem->but->y2 - bitem->but->y1;
}
else {
- uiLayout *litem= (uiLayout*)item;
+ uiLayout *litem = (uiLayout *)item;
- if(r_w) *r_w= litem->w;
- if(r_h) *r_h= litem->h;
+ if (r_w) *r_w = litem->w;
+ if (r_h) *r_h = litem->h;
}
}
static void ui_item_offset(uiItem *item, int *r_x, int *r_y)
{
- if(item->type == ITEM_BUTTON) {
- uiButtonItem *bitem= (uiButtonItem*)item;
+ if (item->type == ITEM_BUTTON) {
+ uiButtonItem *bitem = (uiButtonItem *)item;
- if(r_x) *r_x= bitem->but->x1;
- if(r_y) *r_y= bitem->but->y1;
+ if (r_x) *r_x = bitem->but->x1;
+ if (r_y) *r_y = bitem->but->y1;
}
else {
- if(r_x) *r_x= 0;
- if(r_y) *r_y= 0;
+ if (r_x) *r_x = 0;
+ if (r_y) *r_y = 0;
}
}
static void ui_item_position(uiItem *item, int x, int y, int w, int h)
{
- if(item->type == ITEM_BUTTON) {
- uiButtonItem *bitem= (uiButtonItem*)item;
+ if (item->type == ITEM_BUTTON) {
+ uiButtonItem *bitem = (uiButtonItem *)item;
- bitem->but->x1= x;
- bitem->but->y1= y;
- bitem->but->x2= x+w;
- bitem->but->y2= y+h;
+ bitem->but->x1 = x;
+ bitem->but->y1 = y;
+ bitem->but->x2 = x + w;
+ bitem->but->y2 = y + h;
ui_check_but(bitem->but); /* for strlen */
}
else {
- uiLayout *litem= (uiLayout*)item;
+ uiLayout *litem = (uiLayout *)item;
- litem->x= x;
- litem->y= y+h;
- litem->w= w;
- litem->h= h;
+ litem->x = x;
+ litem->y = y + h;
+ litem->w = w;
+ litem->h = h;
}
}
@@ -289,7 +289,7 @@ static void ui_item_position(uiItem *item, int x, int y, int w, int h)
static int ui_layout_local_dir(uiLayout *layout)
{
- switch(layout->item.type) {
+ switch (layout->item.type) {
case ITEM_LAYOUT_ROW:
case ITEM_LAYOUT_ROOT:
case ITEM_LAYOUT_OVERLAP:
@@ -308,35 +308,35 @@ static uiLayout *ui_item_local_sublayout(uiLayout *test, uiLayout *layout, int a
{
uiLayout *sub;
- if(ui_layout_local_dir(test) == UI_LAYOUT_HORIZONTAL)
- sub= uiLayoutRow(layout, align);
+ if (ui_layout_local_dir(test) == UI_LAYOUT_HORIZONTAL)
+ sub = uiLayoutRow(layout, align);
else
- sub= uiLayoutColumn(layout, align);
+ sub = uiLayoutColumn(layout, align);
- sub->space= 0;
+ sub->space = 0;
return sub;
}
static void ui_layer_but_cb(bContext *C, void *arg_but, void *arg_index)
{
- wmWindow *win= CTX_wm_window(C);
- uiBut *but= arg_but, *cbut;
- PointerRNA *ptr= &but->rnapoin;
- PropertyRNA *prop= but->rnaprop;
- int i, index= GET_INT_FROM_POINTER(arg_index);
- int shift= win->eventstate->shift;
- int len= RNA_property_array_length(ptr, prop);
+ wmWindow *win = CTX_wm_window(C);
+ uiBut *but = arg_but, *cbut;
+ PointerRNA *ptr = &but->rnapoin;
+ PropertyRNA *prop = but->rnaprop;
+ int i, index = GET_INT_FROM_POINTER(arg_index);
+ int shift = win->eventstate->shift;
+ int len = RNA_property_array_length(ptr, prop);
- if(!shift) {
+ if (!shift) {
RNA_property_boolean_set_index(ptr, prop, index, TRUE);
- for(i=0; i<len; i++)
- if(i != index)
+ for (i = 0; i < len; i++)
+ if (i != index)
RNA_property_boolean_set_index(ptr, prop, i, 0);
RNA_property_update(C, ptr, prop);
- for(cbut=but->block->buttons.first; cbut; cbut=cbut->next)
+ for (cbut = but->block->buttons.first; cbut; cbut = cbut->next)
ui_check_but(cbut);
}
}
@@ -344,7 +344,7 @@ static void ui_layer_but_cb(bContext *C, void *arg_but, void *arg_index)
/* create buttons for an item with an RNA array */
static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int len, int x, int y, int w, int UNUSED(h), int expand, int slider, int toggle, int icon_only)
{
- uiStyle *style= layout->root->style;
+ uiStyle *style = layout->root->style;
uiBut *but;
PropertyType type;
PropertySubType subtype;
@@ -352,122 +352,122 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in
int a, b;
/* retrieve type and subtype */
- type= RNA_property_type(prop);
- subtype= RNA_property_subtype(prop);
+ type = RNA_property_type(prop);
+ subtype = RNA_property_subtype(prop);
- sub= ui_item_local_sublayout(layout, layout, 1);
+ sub = ui_item_local_sublayout(layout, layout, 1);
uiBlockSetCurLayout(block, sub);
/* create label */
- if(name[0])
+ if (name[0])
uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
/* create buttons */
- if(type == PROP_BOOLEAN && ELEM(subtype, PROP_LAYER, PROP_LAYER_MEMBER)) {
+ if (type == PROP_BOOLEAN && ELEM(subtype, PROP_LAYER, PROP_LAYER_MEMBER)) {
/* special check for layer layout */
int butw, buth, unit;
- int cols= (len >= 20)? 2: 1;
- int colbuts= len/(2*cols);
- int layer_used= 0;
+ int cols = (len >= 20) ? 2 : 1;
+ int colbuts = len / (2 * cols);
+ int layer_used = 0;
uiBlockSetCurLayout(block, uiLayoutAbsolute(layout, 0));
- unit= UI_UNIT_X*0.75;
- butw= unit;
- buth= unit;
+ unit = UI_UNIT_X * 0.75;
+ butw = unit;
+ buth = unit;
- if(ptr->type == &RNA_Armature) {
- bArmature *arm= (bArmature *)ptr->data;
- layer_used= arm->layer_used;
+ if (ptr->type == &RNA_Armature) {
+ bArmature *arm = (bArmature *)ptr->data;
+ layer_used = arm->layer_used;
}
- for(b=0; b<cols; b++) {
+ for (b = 0; b < cols; b++) {
uiBlockBeginAlign(block);
- for(a=0; a<colbuts; a++) {
- if(layer_used & (1<<(a+b*colbuts))) icon= ICON_LAYER_USED;
- else icon= ICON_BLANK1;
+ for (a = 0; a < colbuts; a++) {
+ if (layer_used & (1 << (a + b * colbuts))) icon = ICON_LAYER_USED;
+ else icon = ICON_BLANK1;
- but= uiDefAutoButR(block, ptr, prop, a+b*colbuts, "", icon, x + butw*a, y+buth, butw, buth);
- if(subtype == PROP_LAYER_MEMBER)
- uiButSetFunc(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(a+b*colbuts));
+ but = uiDefAutoButR(block, ptr, prop, a + b * colbuts, "", icon, x + butw * a, y + buth, butw, buth);
+ if (subtype == PROP_LAYER_MEMBER)
+ uiButSetFunc(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(a + b * colbuts));
}
- for(a=0; a<colbuts; a++) {
- if(layer_used & (1<<(a+len/2+b*colbuts))) icon= ICON_LAYER_USED;
- else icon= ICON_BLANK1;
+ for (a = 0; a < colbuts; a++) {
+ if (layer_used & (1 << (a + len / 2 + b * colbuts))) icon = ICON_LAYER_USED;
+ else icon = ICON_BLANK1;
- but= uiDefAutoButR(block, ptr, prop, a+len/2+b*colbuts, "", icon, x + butw*a, y, butw, buth);
- if(subtype == PROP_LAYER_MEMBER)
- uiButSetFunc(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(a+len/2+b*colbuts));
+ but = uiDefAutoButR(block, ptr, prop, a + len / 2 + b * colbuts, "", icon, x + butw * a, y, butw, buth);
+ if (subtype == PROP_LAYER_MEMBER)
+ uiButSetFunc(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(a + len / 2 + b * colbuts));
}
uiBlockEndAlign(block);
- x += colbuts*butw + style->buttonspacex;
+ x += colbuts * butw + style->buttonspacex;
}
}
- else if(subtype == PROP_MATRIX) {
- int totdim, dim_size[3]; /* 3 == RNA_MAX_ARRAY_DIMENSION */
+ else if (subtype == PROP_MATRIX) {
+ int totdim, dim_size[3]; /* 3 == RNA_MAX_ARRAY_DIMENSION */
int row, col;
uiBlockSetCurLayout(block, uiLayoutAbsolute(layout, 1));
- totdim= RNA_property_array_dimension(ptr, prop, dim_size);
- if (totdim != 2) return; /* only 2D matrices supported in UI so far */
+ totdim = RNA_property_array_dimension(ptr, prop, dim_size);
+ if (totdim != 2) return; /* only 2D matrices supported in UI so far */
w /= dim_size[0];
/* h /= dim_size[1]; */ /* UNUSED */
- for(a=0; a<len; a++) {
- col= a % dim_size[0];
- row= a / dim_size[0];
-
- but= uiDefAutoButR(block, ptr, prop, a, "", ICON_NONE, x + w*col, y+(dim_size[1]*UI_UNIT_Y)-(row*UI_UNIT_Y), w, UI_UNIT_Y);
- if(slider && but->type==NUM)
- but->type= NUMSLI;
+ for (a = 0; a < len; a++) {
+ col = a % dim_size[0];
+ row = a / dim_size[0];
+
+ but = uiDefAutoButR(block, ptr, prop, a, "", ICON_NONE, x + w * col, y + (dim_size[1] * UI_UNIT_Y) - (row * UI_UNIT_Y), w, UI_UNIT_Y);
+ if (slider && but->type == NUM)
+ but->type = NUMSLI;
}
}
- else if(subtype == PROP_DIRECTION) {
- uiDefButR_prop(block, BUT_NORMAL, 0, name, x, y, UI_UNIT_X*3, UI_UNIT_Y*3, ptr, prop, 0, 0, 0, -1, -1, NULL);
+ else if (subtype == PROP_DIRECTION) {
+ uiDefButR_prop(block, BUT_NORMAL, 0, name, x, y, UI_UNIT_X * 3, UI_UNIT_Y * 3, ptr, prop, 0, 0, 0, -1, -1, NULL);
}
else {
/* note, this block of code is a bit arbitrary and has just been made
* to work with common cases, but may need to be re-worked */
/* special case, boolean array in a menu, this could be used in a more generic way too */
- if(ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA) && !expand) {
+ if (ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA) && !expand) {
uiDefAutoButR(block, ptr, prop, -1, "", ICON_NONE, 0, 0, w, UI_UNIT_Y);
}
else {
- int *boolarr= NULL;
+ int *boolarr = NULL;
/* even if 'expand' is fale, expanding anyway */
/* layout for known array subtypes */
- char str[3]= {'\0'};
+ char str[3] = {'\0'};
- if(!icon_only) {
- if(type != PROP_BOOLEAN) {
- str[1]= ':';
+ if (!icon_only) {
+ if (type != PROP_BOOLEAN) {
+ str[1] = ':';
}
}
/* show checkboxes for rna on a non-emboss block (menu for eg) */
- if(type == PROP_BOOLEAN && ELEM(layout->root->block->dt, UI_EMBOSSN, UI_EMBOSSP)) {
- boolarr= MEM_callocN(sizeof(int)*len, "ui_item_array");
+ if (type == PROP_BOOLEAN && ELEM(layout->root->block->dt, UI_EMBOSSN, UI_EMBOSSP)) {
+ boolarr = MEM_callocN(sizeof(int) * len, "ui_item_array");
RNA_property_boolean_get_array(ptr, prop, boolarr);
}
- for(a=0; a<len; a++) {
- if(!icon_only) str[0]= RNA_property_array_item_char(prop, a);
- if(boolarr) icon= boolarr[a] ? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT;
- but= uiDefAutoButR(block, ptr, prop, a, str, icon, 0, 0, w, UI_UNIT_Y);
- if(slider && but->type==NUM)
- but->type= NUMSLI;
- if(toggle && but->type==OPTION)
- but->type= TOG;
+ for (a = 0; a < len; a++) {
+ if (!icon_only) str[0] = RNA_property_array_item_char(prop, a);
+ if (boolarr) icon = boolarr[a] ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT;
+ but = uiDefAutoButR(block, ptr, prop, a, str, icon, 0, 0, w, UI_UNIT_Y);
+ if (slider && but->type == NUM)
+ but->type = NUMSLI;
+ if (toggle && but->type == OPTION)
+ but->type = TOG;
}
- if(boolarr) {
+ if (boolarr) {
MEM_freeN(boolarr);
}
}
@@ -486,23 +486,23 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt
RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free);
uiBlockSetCurLayout(block, ui_item_local_sublayout(layout, layout, 1));
- for(a=0; a<totitem; a++) {
- if(!item[a].identifier[0])
+ for (a = 0; a < totitem; a++) {
+ if (!item[a].identifier[0])
continue;
- name= (!uiname || uiname[0])? item[a].name: "";
- icon= item[a].icon;
- value= item[a].value;
- itemw= ui_text_icon_width(block->curlayout, name, icon, 0);
+ name = (!uiname || uiname[0]) ? item[a].name : "";
+ icon = item[a].icon;
+ value = item[a].value;
+ itemw = ui_text_icon_width(block->curlayout, name, icon, 0);
- if(icon && name[0] && !icon_only)
- but= uiDefIconTextButR_prop(block, ROW, 0, icon, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
- else if(icon)
- but= uiDefIconButR_prop(block, ROW, 0, icon, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
+ if (icon && name[0] && !icon_only)
+ but = uiDefIconTextButR_prop(block, ROW, 0, icon, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
+ else if (icon)
+ but = uiDefIconButR_prop(block, ROW, 0, icon, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
else
- but= uiDefButR_prop(block, ROW, 0, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
+ but = uiDefButR_prop(block, ROW, 0, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
- if(ui_layout_local_dir(layout) != UI_LAYOUT_HORIZONTAL)
+ if (ui_layout_local_dir(layout) != UI_LAYOUT_HORIZONTAL)
but->flag |= UI_TEXT_LEFT;
}
uiBlockSetCurLayout(block, layout);
@@ -515,7 +515,7 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt
/* callback for keymap item change button */
static void ui_keymap_but_cb(bContext *UNUSED(C), void *but_v, void *UNUSED(key_v))
{
- uiBut *but= but_v;
+ uiBut *but = but_v;
RNA_boolean_set(&but->rnapoin, "shift", (but->modifier_key & KM_SHIFT) != 0);
RNA_boolean_set(&but->rnapoin, "ctrl", (but->modifier_key & KM_CTRL) != 0);
@@ -527,53 +527,55 @@ static void ui_keymap_but_cb(bContext *UNUSED(C), void *but_v, void *UNUSED(key_
static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, const char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int x, int y, int w, int h, int flag)
{
uiLayout *sub;
- uiBut *but=NULL;
+ uiBut *but = NULL;
PropertyType type;
PropertySubType subtype;
int labelw;
- sub= uiLayoutRow(layout, 0);
+ sub = uiLayoutRow(layout, 0);
uiBlockSetCurLayout(block, sub);
- if(name[0]) {
- /* XXX UI_GetStringWidth is not accurate
- labelw= UI_GetStringWidth(name);
- CLAMP(labelw, w/4, 3*w/4);*/
- labelw= w/3;
+ if (name[0]) {
+ /* 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;
+ w = w - labelw;
}
- type= RNA_property_type(prop);
- subtype= RNA_property_subtype(prop);
+ type = RNA_property_type(prop);
+ subtype = RNA_property_subtype(prop);
- if(subtype == PROP_FILEPATH || subtype == PROP_DIRPATH) {
+ if (subtype == PROP_FILEPATH || subtype == PROP_DIRPATH) {
uiBlockSetCurLayout(block, uiLayoutRow(sub, 1));
- uiDefAutoButR(block, ptr, prop, index, "", icon, x, y, w-UI_UNIT_X, h);
+ uiDefAutoButR(block, ptr, prop, index, "", icon, x, y, w - UI_UNIT_X, h);
/* BUTTONS_OT_file_browse calls uiFileBrowseContextProperty */
- but= uiDefIconButO(block, BUT, subtype==PROP_DIRPATH ?
- "BUTTONS_OT_directory_browse" :
- "BUTTONS_OT_file_browse",
- WM_OP_INVOKE_DEFAULT, ICON_FILESEL, x, y, UI_UNIT_X, h, NULL);
+ but = uiDefIconButO(block, BUT, subtype == PROP_DIRPATH ?
+ "BUTTONS_OT_directory_browse" :
+ "BUTTONS_OT_file_browse",
+ WM_OP_INVOKE_DEFAULT, ICON_FILESEL, x, y, UI_UNIT_X, h, NULL);
}
- else if(flag & UI_ITEM_R_EVENT) {
+ else if (flag & UI_ITEM_R_EVENT) {
uiDefButR_prop(block, KEYEVT, 0, name, x, y, w, h, ptr, prop, index, 0, 0, -1, -1, NULL);
}
- else if(flag & UI_ITEM_R_FULL_EVENT) {
- if(RNA_struct_is_a(ptr->type, &RNA_KeyMapItem)) {
+ else if (flag & UI_ITEM_R_FULL_EVENT) {
+ if (RNA_struct_is_a(ptr->type, &RNA_KeyMapItem)) {
char buf[128];
WM_keymap_item_to_string(ptr->data, buf, sizeof(buf));
- but= uiDefButR_prop(block, HOTKEYEVT, 0, buf, x, y, w, h, ptr, prop, 0, 0, 0, -1, -1, NULL);
+ but = uiDefButR_prop(block, HOTKEYEVT, 0, buf, x, y, w, h, ptr, prop, 0, 0, 0, -1, -1, NULL);
uiButSetFunc(but, ui_keymap_but_cb, but, NULL);
if (flag & UI_ITEM_R_IMMEDIATE)
uiButSetFlag(but, UI_BUT_IMMEDIATE);
}
}
else
- but= uiDefAutoButR(block, ptr, prop, index, (type == PROP_ENUM && !(flag & UI_ITEM_R_ICON_ONLY))? NULL: "", icon, x, y, w, h);
+ but = uiDefAutoButR(block, ptr, prop, index, (type == PROP_ENUM && !(flag & UI_ITEM_R_ICON_ONLY)) ? NULL : "", icon, x, y, w, h);
uiBlockSetCurLayout(block, layout);
return but;
@@ -581,25 +583,25 @@ static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, const char *n
void uiFileBrowseContextProperty(const bContext *C, PointerRNA *ptr, PropertyRNA **prop)
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
uiBlock *block;
uiBut *but, *prevbut;
memset(ptr, 0, sizeof(*ptr));
- *prop= NULL;
+ *prop = NULL;
- if(!ar)
+ if (!ar)
return;
- for(block=ar->uiblocks.first; block; block=block->next) {
- for(but=block->buttons.first; but; but= but->next) {
- prevbut= but->prev;
+ for (block = ar->uiblocks.first; block; block = block->next) {
+ for (but = block->buttons.first; but; but = but->next) {
+ prevbut = but->prev;
/* find the button before the active one */
- if((but->flag & UI_BUT_LAST_ACTIVE) && prevbut && prevbut->rnapoin.data) {
- if(RNA_property_type(prevbut->rnaprop) == PROP_STRING) {
- *ptr= prevbut->rnapoin;
- *prop= prevbut->rnaprop;
+ if ((but->flag & UI_BUT_LAST_ACTIVE) && prevbut && prevbut->rnapoin.data) {
+ if (RNA_property_type(prevbut->rnaprop) == PROP_STRING) {
+ *ptr = prevbut->rnapoin;
+ *prop = prevbut->rnaprop;
return;
}
}
@@ -612,18 +614,18 @@ void uiFileBrowseContextProperty(const bContext *C, PointerRNA *ptr, PropertyRNA
/* disabled item */
static void ui_item_disabled(uiLayout *layout, const char *name)
{
- uiBlock *block= layout->root->block;
+ uiBlock *block = layout->root->block;
uiBut *but;
int w;
uiBlockSetCurLayout(block, layout);
- if(!name)
- name= "";
+ if (!name)
+ name = "";
- w= ui_text_icon_width(layout, name, 0, 0);
+ w = ui_text_icon_width(layout, name, 0, 0);
- but= uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ but = uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
but->flag |= UI_BUT_DISABLED;
but->lock = 1;
but->lockstr = "";
@@ -632,27 +634,30 @@ static void ui_item_disabled(uiLayout *layout, const char *name)
/* operator items */
PointerRNA uiItemFullO_ptr(uiLayout *layout, wmOperatorType *ot, const char *name, int icon, IDProperty *properties, int context, int flag)
{
- uiBlock *block= layout->root->block;
+ uiBlock *block = layout->root->block;
uiBut *but;
int w;
- if(!name) {
- name= IFACE_(ot->name);
+ if (!name) {
+ if (ot && ot->srna)
+ name = RNA_struct_ui_name(ot->srna);
+ else
+ name = "";
}
- if(layout->root->type == UI_LAYOUT_MENU && !icon)
- icon= ICON_BLANK1;
+ if (layout->root->type == UI_LAYOUT_MENU && !icon)
+ icon = ICON_BLANK1;
/* create button */
uiBlockSetCurLayout(block, layout);
- w= ui_text_icon_width(layout, name, icon, 0);
+ w = ui_text_icon_width(layout, name, icon, 0);
if (flag & UI_ITEM_R_NO_BG)
uiBlockSetEmboss(block, UI_EMBOSSN);
/* create the button */
- if(icon) {
+ if (icon) {
if (name[0]) {
but = uiDefIconTextButO_ptr(block, BUT, ot, context, icon, name, 0, 0, w, UI_UNIT_Y, NULL);
}
@@ -661,31 +666,31 @@ PointerRNA uiItemFullO_ptr(uiLayout *layout, wmOperatorType *ot, const char *nam
}
}
else {
- but= uiDefButO_ptr(block, BUT, ot, context, name, 0, 0, w, UI_UNIT_Y, NULL);
+ but = uiDefButO_ptr(block, BUT, ot, context, name, 0, 0, w, UI_UNIT_Y, NULL);
}
assert(but->optype != NULL);
/* text alignment for toolbar buttons */
- if((layout->root->type == UI_LAYOUT_TOOLBAR) && !icon)
+ if ((layout->root->type == UI_LAYOUT_TOOLBAR) && !icon)
but->flag |= UI_TEXT_LEFT;
if (flag & UI_ITEM_R_NO_BG)
uiBlockSetEmboss(block, UI_EMBOSS);
- if(layout->redalert)
+ if (layout->redalert)
uiButSetFlag(but, UI_BUT_REDALERT);
/* assign properties */
- if(properties || (flag & UI_ITEM_O_RETURN_PROPS)) {
- PointerRNA *opptr= uiButGetOperatorPtrRNA(but);
+ if (properties || (flag & UI_ITEM_O_RETURN_PROPS)) {
+ PointerRNA *opptr = uiButGetOperatorPtrRNA(but);
- if(properties) {
- opptr->data= properties;
+ if (properties) {
+ opptr->data = properties;
}
else {
IDPropertyTemplate val = {0};
- opptr->data= IDP_New(IDP_GROUP, &val, "wmOperatorProperties");
+ opptr->data = IDP_New(IDP_GROUP, &val, "wmOperatorProperties");
}
return *opptr;
@@ -728,7 +733,7 @@ static void uiItemEnumO_ptr__internal(uiLayout *layout, wmOperatorType *ot, cons
WM_operator_properties_create_ptr(&ptr, ot);
RNA_property_enum_set(&ptr, prop, value);
- if(!name)
+ if (!name)
name = ui_menu_enumpropname(layout, &ptr, prop, value);
uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0);
@@ -750,7 +755,7 @@ void uiItemEnumO_ptr(uiLayout *layout, wmOperatorType *ot, const char *name, int
RNA_property_enum_set(&ptr, prop, value);
- if(!name)
+ if (!name)
name = ui_menu_enumpropname(layout, &ptr, prop, value);
uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0);
@@ -759,7 +764,7 @@ void uiItemEnumO(uiLayout *layout, const char *opname, const char *name, int ico
{
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
- if(ot) {
+ if (ot) {
uiItemEnumO_ptr(layout, ot, name, icon, propname, value);
}
else {
@@ -776,9 +781,9 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname
PointerRNA ptr;
PropertyRNA *prop;
uiBut *bt;
- uiBlock *block= layout->root->block;
+ uiBlock *block = layout->root->block;
- if(!ot || !ot->srna) {
+ if (!ot || !ot->srna) {
ui_item_disabled(layout, opname);
RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
return;
@@ -790,25 +795,25 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname
/* don't let bad properties slip through */
BLI_assert((prop == NULL) || (RNA_property_type(prop) == PROP_ENUM));
- if(prop && RNA_property_type(prop) == PROP_ENUM) {
+ if (prop && RNA_property_type(prop) == PROP_ENUM) {
EnumPropertyItem *item;
int totitem, i, free;
- uiLayout *split= uiLayoutSplit(layout, 0, 0);
- uiLayout *column= uiLayoutColumn(split, 0);
+ uiLayout *split = uiLayoutSplit(layout, 0, 0);
+ uiLayout *column = uiLayoutColumn(split, 0);
RNA_property_enum_items_gettexted(block->evil_C, &ptr, prop, &item, &totitem, &free);
- for(i=0; i<totitem; i++) {
- if(item[i].identifier[0]) {
- if(properties) {
+ for (i = 0; i < totitem; i++) {
+ if (item[i].identifier[0]) {
+ if (properties) {
PointerRNA tptr;
WM_operator_properties_create_ptr(&tptr, ot);
- if(tptr.data) {
+ if (tptr.data) {
IDP_FreeProperty(tptr.data);
MEM_freeN(tptr.data);
}
- tptr.data= IDP_CopyProperty(properties);
+ tptr.data = IDP_CopyProperty(properties);
RNA_property_enum_set(&tptr, prop, item[i].value);
uiItemFullO_ptr(column, ot, item[i].name, item[i].icon, tptr.data, context, flag);
@@ -818,16 +823,16 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname
}
}
else {
- if(item[i].name) {
- if(i != 0) {
- column= uiLayoutColumn(split, 0);
+ if (item[i].name) {
+ if (i != 0) {
+ column = uiLayoutColumn(split, 0);
/* inconsistent, but menus with labels do not look good flipped */
block->flag |= UI_BLOCK_NO_FLIP;
}
uiItemL(column, item[i].name, ICON_NONE);
- bt= block->buttons.last;
- bt->flag= UI_TEXT_LEFT;
+ bt = block->buttons.last;
+ bt->flag = UI_TEXT_LEFT;
}
else /* XXX bug here, collums draw bottom item badly */
uiItemS(column);
@@ -852,7 +857,7 @@ void uiItemEnumO_value(uiLayout *layout, const char *name, int icon, const char
PointerRNA ptr;
PropertyRNA *prop;
- UI_OPERATOR_ERROR_RET(ot, opname, return);
+ UI_OPERATOR_ERROR_RET(ot, opname, return );
WM_operator_properties_create_ptr(&ptr, ot);
@@ -868,7 +873,7 @@ void uiItemEnumO_value(uiLayout *layout, const char *name, int icon, const char
RNA_property_enum_set(&ptr, prop, value);
/* same as uiItemEnumO */
- if(!name)
+ if (!name)
name = ui_menu_enumpropname(layout, &ptr, prop, value);
uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0);
@@ -883,15 +888,15 @@ void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char
EnumPropertyItem *item;
int value, free;
- UI_OPERATOR_ERROR_RET(ot, opname, return);
+ UI_OPERATOR_ERROR_RET(ot, opname, return );
WM_operator_properties_create_ptr(&ptr, ot);
/* enum lookup */
- if((prop= RNA_struct_find_property(&ptr, propname))) {
+ if ((prop = RNA_struct_find_property(&ptr, propname))) {
RNA_property_enum_items_gettexted(layout->root->block->evil_C, &ptr, prop, &item, NULL, &free);
- if(item==NULL || RNA_enum_value_from_id(item, value_str, &value)==0) {
- if(free) {
+ if (item == NULL || RNA_enum_value_from_id(item, value_str, &value) == 0) {
+ if (free) {
MEM_freeN(item);
}
RNA_warning("%s.%s, enum %s not found", RNA_struct_identifier(ptr.type), propname, value_str);
@@ -910,7 +915,7 @@ void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char
RNA_property_enum_set(&ptr, prop, value);
/* same as uiItemEnumO */
- if(!name)
+ if (!name)
name = ui_menu_enumpropname(layout, &ptr, prop, value);
uiItemFullO_ptr(layout, ot, name, icon, ptr.data, layout->root->opcontext, 0);
@@ -921,7 +926,7 @@ void uiItemBooleanO(uiLayout *layout, const char *name, int icon, const char *op
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
PointerRNA ptr;
- UI_OPERATOR_ERROR_RET(ot, opname, return);
+ UI_OPERATOR_ERROR_RET(ot, opname, return );
WM_operator_properties_create_ptr(&ptr, ot);
RNA_boolean_set(&ptr, propname, value);
@@ -934,7 +939,7 @@ void uiItemIntO(uiLayout *layout, const char *name, int icon, const char *opname
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
PointerRNA ptr;
- UI_OPERATOR_ERROR_RET(ot, opname, return);
+ UI_OPERATOR_ERROR_RET(ot, opname, return );
WM_operator_properties_create_ptr(&ptr, ot);
RNA_int_set(&ptr, propname, value);
@@ -947,7 +952,7 @@ void uiItemFloatO(uiLayout *layout, const char *name, int icon, const char *opna
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
PointerRNA ptr;
- UI_OPERATOR_ERROR_RET(ot, opname, return);
+ UI_OPERATOR_ERROR_RET(ot, opname, return );
WM_operator_properties_create_ptr(&ptr, ot);
RNA_float_set(&ptr, propname, value);
@@ -960,7 +965,7 @@ void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opn
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
PointerRNA ptr;
- UI_OPERATOR_ERROR_RET(ot, opname, return);
+ UI_OPERATOR_ERROR_RET(ot, opname, return );
WM_operator_properties_create_ptr(&ptr, ot);
RNA_string_set(&ptr, propname, value);
@@ -982,46 +987,46 @@ static void ui_item_rna_size(uiLayout *layout, const char *name, int icon, Point
int len, w, h;
/* arbitrary extended width by type */
- type= RNA_property_type(prop);
- subtype= RNA_property_subtype(prop);
- len= RNA_property_array_length(ptr, prop);
+ type = RNA_property_type(prop);
+ subtype = RNA_property_subtype(prop);
+ len = RNA_property_array_length(ptr, prop);
- if(ELEM3(type, PROP_STRING, PROP_POINTER, PROP_ENUM) && !name[0] && !icon_only)
- name= "non-empty text";
- else if(type == PROP_BOOLEAN && !name[0] && !icon_only)
- icon= ICON_DOT;
+ if (ELEM3(type, PROP_STRING, PROP_POINTER, PROP_ENUM) && !name[0] && !icon_only)
+ name = "non-empty text";
+ else if (type == PROP_BOOLEAN && !name[0] && !icon_only)
+ icon = ICON_DOT;
- w= ui_text_icon_width(layout, name, icon, 0);
- h= UI_UNIT_Y;
+ w = ui_text_icon_width(layout, name, icon, 0);
+ h = UI_UNIT_Y;
/* increase height for arrays */
- if(index == RNA_NO_INDEX && len > 0) {
- if(!name[0] && icon == ICON_NONE)
- h= 0;
-
- if(ELEM(subtype, PROP_LAYER, PROP_LAYER_MEMBER))
- h += 2*UI_UNIT_Y;
- else if(subtype == PROP_MATRIX)
- h += ceil(sqrt(len))*UI_UNIT_Y;
+ if (index == RNA_NO_INDEX && len > 0) {
+ if (!name[0] && icon == ICON_NONE)
+ h = 0;
+
+ if (ELEM(subtype, PROP_LAYER, PROP_LAYER_MEMBER))
+ h += 2 * UI_UNIT_Y;
+ else if (subtype == PROP_MATRIX)
+ h += ceil(sqrt(len)) * UI_UNIT_Y;
else
- h += len*UI_UNIT_Y;
+ h += len * UI_UNIT_Y;
}
- else if(ui_layout_vary_direction(layout) == UI_ITEM_VARY_X) {
- if(type == PROP_BOOLEAN && name[0])
- w += UI_UNIT_X/5;
- else if(type == PROP_ENUM)
- w += UI_UNIT_X/4;
- else if(type == PROP_FLOAT || type == PROP_INT)
- w += UI_UNIT_X*3;
+ else if (ui_layout_vary_direction(layout) == UI_ITEM_VARY_X) {
+ if (type == PROP_BOOLEAN && name[0])
+ w += UI_UNIT_X / 5;
+ else if (type == PROP_ENUM)
+ w += UI_UNIT_X / 4;
+ else if (type == PROP_FLOAT || type == PROP_INT)
+ w += UI_UNIT_X * 3;
}
- *r_w= w;
- *r_h= h;
+ *r_w = w;
+ *r_h = h;
}
void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index, int value, int flag, const char *name, int icon)
{
- uiBlock *block= layout->root->block;
+ uiBlock *block = layout->root->block;
uiBut *but;
PropertyType type;
char namestr[UI_MAX_NAME_STR];
@@ -1030,44 +1035,44 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
uiBlockSetCurLayout(block, layout);
/* retrieve info */
- type= RNA_property_type(prop);
- is_array= RNA_property_array_check(prop);
- len= (is_array) ? RNA_property_array_length(ptr, prop) : 0;
+ type = RNA_property_type(prop);
+ is_array = RNA_property_array_check(prop);
+ len = (is_array) ? RNA_property_array_length(ptr, prop) : 0;
/* set name and icon */
- if(!name)
- name= RNA_property_ui_name(prop);
- if(icon == ICON_NONE)
- icon= RNA_property_ui_icon(prop);
+ if (!name)
+ name = RNA_property_ui_name(prop);
+ if (icon == ICON_NONE)
+ icon = RNA_property_ui_icon(prop);
- if(ELEM4(type, PROP_INT, PROP_FLOAT, PROP_STRING, PROP_POINTER))
- name= ui_item_name_add_colon(name, namestr);
- else if(type == PROP_BOOLEAN && is_array && index == RNA_NO_INDEX)
- name= ui_item_name_add_colon(name, namestr);
- else if(type == PROP_ENUM && index != RNA_ENUM_VALUE)
- name= ui_item_name_add_colon(name, namestr);
-
- if(layout->root->type == UI_LAYOUT_MENU) {
- if(type == PROP_BOOLEAN && ((is_array == FALSE) || (index != RNA_NO_INDEX))) {
- if(is_array) icon= (RNA_property_boolean_get_index(ptr, prop, index)) ? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT;
- else icon= (RNA_property_boolean_get(ptr, prop)) ? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT;
+ if (ELEM4(type, PROP_INT, PROP_FLOAT, PROP_STRING, PROP_POINTER))
+ name = ui_item_name_add_colon(name, namestr);
+ else if (type == PROP_BOOLEAN && is_array && index == RNA_NO_INDEX)
+ name = ui_item_name_add_colon(name, namestr);
+ else if (type == PROP_ENUM && index != RNA_ENUM_VALUE)
+ name = ui_item_name_add_colon(name, namestr);
+
+ if (layout->root->type == UI_LAYOUT_MENU) {
+ if (type == PROP_BOOLEAN && ((is_array == FALSE) || (index != RNA_NO_INDEX))) {
+ if (is_array) icon = (RNA_property_boolean_get_index(ptr, prop, index)) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT;
+ else icon = (RNA_property_boolean_get(ptr, prop)) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT;
}
- else if(type == PROP_ENUM && index == RNA_ENUM_VALUE) {
- int enum_value= RNA_property_enum_get(ptr, prop);
- if(RNA_property_flag(prop) & PROP_ENUM_FLAG) {
- icon= (enum_value & value)? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT;
+ else if (type == PROP_ENUM && index == RNA_ENUM_VALUE) {
+ int enum_value = RNA_property_enum_get(ptr, prop);
+ if (RNA_property_flag(prop) & PROP_ENUM_FLAG) {
+ icon = (enum_value & value) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT;
}
else {
- icon= (enum_value == value)? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT;
+ icon = (enum_value == value) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT;
}
}
}
- slider= (flag & UI_ITEM_R_SLIDER);
- toggle= (flag & UI_ITEM_R_TOGGLE);
- expand= (flag & UI_ITEM_R_EXPAND);
- icon_only= (flag & UI_ITEM_R_ICON_ONLY);
- no_bg= (flag & UI_ITEM_R_NO_BG);
+ slider = (flag & UI_ITEM_R_SLIDER);
+ toggle = (flag & UI_ITEM_R_TOGGLE);
+ expand = (flag & UI_ITEM_R_EXPAND);
+ icon_only = (flag & UI_ITEM_R_ICON_ONLY);
+ no_bg = (flag & UI_ITEM_R_NO_BG);
/* get size */
ui_item_rna_size(layout, name, icon, ptr, prop, index, icon_only, &w, &h);
@@ -1076,39 +1081,39 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
uiBlockSetEmboss(block, UI_EMBOSSN);
/* array property */
- if(index == RNA_NO_INDEX && is_array)
+ if (index == RNA_NO_INDEX && is_array)
ui_item_array(layout, block, name, icon, ptr, prop, len, 0, 0, w, h, expand, slider, toggle, icon_only);
/* enum item */
- else if(type == PROP_ENUM && index == RNA_ENUM_VALUE) {
- if(icon && name[0] && !icon_only)
+ else if (type == PROP_ENUM && index == RNA_ENUM_VALUE) {
+ if (icon && name[0] && !icon_only)
uiDefIconTextButR_prop(block, ROW, 0, icon, name, 0, 0, w, h, ptr, prop, -1, 0, value, -1, -1, NULL);
- else if(icon)
+ else if (icon)
uiDefIconButR_prop(block, ROW, 0, icon, 0, 0, w, h, ptr, prop, -1, 0, value, -1, -1, NULL);
else
uiDefButR_prop(block, ROW, 0, name, 0, 0, w, h, ptr, prop, -1, 0, value, -1, -1, NULL);
}
/* expanded enum */
- else if(type == PROP_ENUM && (expand || RNA_property_flag(prop) & PROP_ENUM_FLAG))
+ else if (type == PROP_ENUM && (expand || RNA_property_flag(prop) & PROP_ENUM_FLAG))
ui_item_enum_expand(layout, block, ptr, prop, name, h, icon_only);
/* property with separate label */
- else if(type == PROP_ENUM || type == PROP_STRING || type == PROP_POINTER) {
- but= ui_item_with_label(layout, block, name, icon, ptr, prop, index, 0, 0, w, h, flag);
+ else if (type == PROP_ENUM || type == PROP_STRING || type == PROP_POINTER) {
+ but = ui_item_with_label(layout, block, name, icon, ptr, prop, index, 0, 0, w, h, flag);
ui_but_add_search(but, ptr, prop, NULL, NULL);
- if(layout->redalert)
+ if (layout->redalert)
uiButSetFlag(but, UI_BUT_REDALERT);
}
/* single button */
else {
- but= uiDefAutoButR(block, ptr, prop, index, name, icon, 0, 0, w, h);
+ but = uiDefAutoButR(block, ptr, prop, index, name, icon, 0, 0, w, h);
- if(slider && but->type==NUM)
- but->type= NUMSLI;
+ if (slider && but->type == NUM)
+ but->type = NUMSLI;
- if(toggle && but->type==OPTION)
- but->type= TOG;
+ if (toggle && but->type == OPTION)
+ but->type = TOG;
- if(layout->redalert)
+ if (layout->redalert)
uiButSetFlag(but, UI_BUT_REDALERT);
}
@@ -1118,9 +1123,9 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
- if(!prop) {
+ if (!prop) {
ui_item_disabled(layout, propname);
RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
return;
@@ -1131,9 +1136,9 @@ void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, int flag,
void uiItemEnumR(uiLayout *layout, const char *name, int icon, struct PointerRNA *ptr, const char *propname, int value)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
- if(!prop || RNA_property_type(prop) != PROP_ENUM) {
+ if (!prop || RNA_property_type(prop) != PROP_ENUM) {
ui_item_disabled(layout, propname);
RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
return;
@@ -1144,11 +1149,11 @@ void uiItemEnumR(uiLayout *layout, const char *name, int icon, struct PointerRNA
void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *value, const char *name, int icon)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
EnumPropertyItem *item;
int ivalue, a, free;
- if(!prop || RNA_property_type(prop) != PROP_ENUM) {
+ if (!prop || RNA_property_type(prop) != PROP_ENUM) {
ui_item_disabled(layout, propname);
RNA_warning("enum property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
return;
@@ -1156,7 +1161,7 @@ void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *pr
RNA_property_enum_items_gettexted(layout->root->block->evil_C, ptr, prop, &item, NULL, &free);
- if(!RNA_enum_value_from_id(item, value, &ivalue)) {
+ if (!RNA_enum_value_from_id(item, value, &ivalue)) {
if (free) {
MEM_freeN(item);
}
@@ -1165,8 +1170,8 @@ void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *pr
return;
}
- for(a=0; item[a].identifier; a++) {
- if(item[a].value == ivalue) {
+ for (a = 0; item[a].identifier; a++) {
+ if (item[a].value == ivalue) {
uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, ivalue, 0, name ? name : item[a].name, icon ? icon : item[a].icon);
break;
}
@@ -1180,44 +1185,44 @@ void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *pr
void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname)
{
PropertyRNA *prop;
- uiBlock *block= layout->root->block;
+ uiBlock *block = layout->root->block;
uiBut *bt;
- prop= RNA_struct_find_property(ptr, propname);
+ prop = RNA_struct_find_property(ptr, propname);
- if(!prop) {
+ if (!prop) {
ui_item_disabled(layout, propname);
RNA_warning("enum property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
return;
}
- if(RNA_property_type(prop) != PROP_ENUM) {
+ if (RNA_property_type(prop) != PROP_ENUM) {
RNA_warning("not an enum property: %s.%s", RNA_struct_identifier(ptr->type), propname);
return;
}
else {
EnumPropertyItem *item;
int totitem, i, free;
- uiLayout *split= uiLayoutSplit(layout, 0, 0);
- uiLayout *column= uiLayoutColumn(split, 0);
+ uiLayout *split = uiLayoutSplit(layout, 0, 0);
+ uiLayout *column = uiLayoutColumn(split, 0);
RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free);
- for(i=0; i<totitem; i++) {
- if(item[i].identifier[0]) {
+ for (i = 0; i < totitem; i++) {
+ if (item[i].identifier[0]) {
uiItemEnumR(column, item[i].name, ICON_NONE, ptr, propname, item[i].value);
}
else {
- if(item[i].name) {
- if(i != 0) {
- column= uiLayoutColumn(split, 0);
+ if (item[i].name) {
+ if (i != 0) {
+ column = uiLayoutColumn(split, 0);
/* inconsistent, but menus with labels do not look good flipped */
block->flag |= UI_BLOCK_NO_FLIP;
}
uiItemL(column, item[i].name, ICON_NONE);
- bt= block->buttons.last;
- bt->flag= UI_TEXT_LEFT;
+ bt = block->buttons.last;
+ bt->flag = UI_TEXT_LEFT;
}
else
uiItemS(column);
@@ -1244,7 +1249,7 @@ static int sort_search_items_list(void *a, void *b)
CollItemSearch *cis1 = (CollItemSearch *)a;
CollItemSearch *cis2 = (CollItemSearch *)b;
- if (BLI_strcasecmp(cis1->name, cis2->name)>0)
+ if (BLI_strcasecmp(cis1->name, cis2->name) > 0)
return 1;
else
return 0;
@@ -1252,44 +1257,44 @@ static int sort_search_items_list(void *a, void *b)
static void rna_search_cb(const struct bContext *C, void *arg_but, const char *str, uiSearchItems *items)
{
- uiBut *but= arg_but;
+ uiBut *but = arg_but;
char *name;
- int i=0, iconid=0, flag= RNA_property_flag(but->rnaprop);
- ListBase *items_list= MEM_callocN(sizeof(ListBase), "items_list");
+ int i = 0, iconid = 0, flag = RNA_property_flag(but->rnaprop);
+ ListBase *items_list = MEM_callocN(sizeof(ListBase), "items_list");
CollItemSearch *cis;
- const int skip_filter= !but->changed;
+ const int skip_filter = !but->changed;
/* build a temporary list of relevant items first */
RNA_PROP_BEGIN(&but->rnasearchpoin, itemptr, but->rnasearchprop) {
- if(flag & PROP_ID_SELF_CHECK)
- if(itemptr.data == but->rnapoin.id.data)
+ if (flag & PROP_ID_SELF_CHECK)
+ if (itemptr.data == but->rnapoin.id.data)
continue;
/* use filter */
- if(RNA_property_type(but->rnaprop)==PROP_POINTER) {
- if(RNA_property_pointer_poll(&but->rnapoin, but->rnaprop, &itemptr)==0)
+ if (RNA_property_type(but->rnaprop) == PROP_POINTER) {
+ if (RNA_property_pointer_poll(&but->rnapoin, but->rnaprop, &itemptr) == 0)
continue;
}
- if(itemptr.type && RNA_struct_is_ID(itemptr.type)) {
- ID *id= itemptr.data;
+ if (itemptr.type && RNA_struct_is_ID(itemptr.type)) {
+ ID *id = itemptr.data;
char name_ui[MAX_ID_NAME];
-#if 0 /* this name is used for a string comparison and can't be modified, TODO */
+#if 0 /* this name is used for a string comparison and can't be modified, TODO */
name_uiprefix_id(name_ui, id);
#else
- BLI_strncpy(name_ui, id->name+2, sizeof(name_ui));
+ BLI_strncpy(name_ui, id->name + 2, sizeof(name_ui));
#endif
- name= BLI_strdup(name_ui);
- iconid= ui_id_icon_get((bContext*)C, id, 0);
+ name = BLI_strdup(name_ui);
+ iconid = ui_id_icon_get((bContext *)C, id, 0);
}
else {
- name= RNA_struct_name_get_alloc(&itemptr, NULL, 0, NULL); /* could use the string length here */
+ name = RNA_struct_name_get_alloc(&itemptr, NULL, 0, NULL); /* could use the string length here */
iconid = 0;
}
- if(name) {
- if(skip_filter || BLI_strcasestr(name, str)) {
+ if (name) {
+ if (skip_filter || BLI_strcasestr(name, str)) {
cis = MEM_callocN(sizeof(CollItemSearch), "CollectionItemSearch");
cis->name = MEM_dupallocN(name);
cis->index = i;
@@ -1306,13 +1311,13 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, const char *s
BLI_sortlist(items_list, sort_search_items_list);
/* add search items from temporary list */
- for (cis=items_list->first; cis; cis=cis->next) {
+ for (cis = items_list->first; cis; cis = cis->next) {
if (!uiSearchItemAdd(items, cis->name, SET_INT_IN_POINTER(cis->index), cis->iconid)) {
break;
}
}
- for (cis=items_list->first; cis; cis=cis->next) {
+ for (cis = items_list->first; cis; cis = cis->next) {
MEM_freeN(cis->name);
}
BLI_freelistN(items_list);
@@ -1326,15 +1331,15 @@ static void search_id_collection(StructRNA *ptype, PointerRNA *ptr, PropertyRNA
/* look for collection property in Main */
RNA_main_pointer_create(G.main, ptr);
- *prop= NULL;
+ *prop = NULL;
RNA_STRUCT_BEGIN(ptr, iprop) {
/* if it's a collection and has same pointer type, we've got it */
- if(RNA_property_type(iprop) == PROP_COLLECTION) {
- srna= RNA_property_pointer_type(ptr, iprop);
+ if (RNA_property_type(iprop) == PROP_COLLECTION) {
+ srna = RNA_property_pointer_type(ptr, iprop);
- if(ptype == srna) {
- *prop= iprop;
+ if (ptype == srna) {
+ *prop = iprop;
break;
}
}
@@ -1348,21 +1353,21 @@ void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRN
PointerRNA sptr;
/* for ID's we do automatic lookup */
- if(!searchprop) {
- if(RNA_property_type(prop) == PROP_POINTER) {
- ptype= RNA_property_pointer_type(ptr, prop);
+ if (!searchprop) {
+ if (RNA_property_type(prop) == PROP_POINTER) {
+ ptype = RNA_property_pointer_type(ptr, prop);
search_id_collection(ptype, &sptr, &searchprop);
- searchptr= &sptr;
+ searchptr = &sptr;
}
}
/* turn button into search button */
- if(searchprop) {
- but->type= SEARCH_MENU;
- but->hardmax= MAX2(but->hardmax, 256);
- but->rnasearchpoin= *searchptr;
- but->rnasearchprop= searchprop;
- but->flag |= UI_ICON_LEFT|UI_TEXT_LEFT;
+ if (searchprop) {
+ but->type = SEARCH_MENU;
+ but->hardmax = MAX2(but->hardmax, 256);
+ but->rnasearchpoin = *searchptr;
+ but->rnasearchprop = searchprop;
+ but->flag |= UI_ICON_LEFT | UI_TEXT_LEFT;
uiButSetSearchFunc(but, rna_search_cb, but, NULL, NULL);
}
@@ -1378,23 +1383,23 @@ void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propna
int w, h;
/* validate arguments */
- prop= RNA_struct_find_property(ptr, propname);
+ prop = RNA_struct_find_property(ptr, propname);
- if(!prop) {
+ if (!prop) {
RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
return;
}
- type= RNA_property_type(prop);
- if(!ELEM(type, PROP_POINTER, PROP_STRING)) {
+ type = RNA_property_type(prop);
+ if (!ELEM(type, PROP_POINTER, PROP_STRING)) {
RNA_warning("Property %s must be a pointer or string", propname);
return;
}
- searchprop= RNA_struct_find_property(searchptr, searchpropname);
+ searchprop = RNA_struct_find_property(searchptr, searchpropname);
- if(!searchprop) {
+ if (!searchprop) {
RNA_warning("search collection property not found: %s.%s", RNA_struct_identifier(ptr->type), searchpropname);
return;
}
@@ -1404,22 +1409,22 @@ void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propna
}
/* get icon & name */
- if(icon==ICON_NONE) {
- if(type == PROP_POINTER)
- icontype= RNA_property_pointer_type(ptr, prop);
+ if (icon == ICON_NONE) {
+ if (type == PROP_POINTER)
+ icontype = RNA_property_pointer_type(ptr, prop);
else
- icontype= RNA_property_pointer_type(searchptr, searchprop);
+ icontype = RNA_property_pointer_type(searchptr, searchprop);
- icon= RNA_struct_ui_icon(icontype);
+ icon = RNA_struct_ui_icon(icontype);
}
- if(!name)
- name= RNA_property_ui_name(prop);
+ if (!name)
+ name = RNA_property_ui_name(prop);
/* create button */
- block= uiLayoutGetBlock(layout);
+ block = uiLayoutGetBlock(layout);
ui_item_rna_size(layout, name, icon, ptr, prop, 0, 0, &w, &h);
- but= ui_item_with_label(layout, block, name, icon, ptr, prop, 0, 0, 0, w, h, 0);
+ but = ui_item_with_label(layout, block, name, icon, ptr, prop, 0, 0, 0, w, h, 0);
ui_but_add_search(but, ptr, prop, searchptr, searchprop);
}
@@ -1427,52 +1432,52 @@ void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propna
/* menu item */
static void ui_item_menutype_func(bContext *C, uiLayout *layout, void *arg_mt)
{
- MenuType *mt= (MenuType*)arg_mt;
+ MenuType *mt = (MenuType *)arg_mt;
Menu menu = {NULL};
- menu.type= mt;
- menu.layout= layout;
+ menu.type = mt;
+ menu.layout = layout;
mt->draw(C, &menu);
}
static void ui_item_menu(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg, void *argN, const char *tip)
{
- uiBlock *block= layout->root->block;
+ uiBlock *block = layout->root->block;
uiBut *but;
int w, h;
uiBlockSetCurLayout(block, layout);
- if(layout->root->type == UI_LAYOUT_HEADER)
+ if (layout->root->type == UI_LAYOUT_HEADER)
uiBlockSetEmboss(block, UI_EMBOSS);
- if(!name)
- name= "";
- if(layout->root->type == UI_LAYOUT_MENU && !icon)
- icon= ICON_BLANK1;
+ if (!name)
+ name = "";
+ if (layout->root->type == UI_LAYOUT_MENU && !icon)
+ icon = ICON_BLANK1;
- w= ui_text_icon_width(layout, name, icon, 1);
- h= UI_UNIT_Y;
+ w = ui_text_icon_width(layout, name, icon, 1);
+ h = UI_UNIT_Y;
- if(layout->root->type == UI_LAYOUT_HEADER) /* ugly .. */
+ if (layout->root->type == UI_LAYOUT_HEADER) /* ugly .. */
w -= 10;
- if(name[0] && icon)
- but= uiDefIconTextMenuBut(block, func, arg, icon, name, 0, 0, w, h, tip);
- else if(icon)
- but= uiDefIconMenuBut(block, func, arg, icon, 0, 0, w, h, tip);
+ if (name[0] && icon)
+ but = uiDefIconTextMenuBut(block, func, arg, icon, name, 0, 0, w, h, tip);
+ else if (icon)
+ but = uiDefIconMenuBut(block, func, arg, icon, 0, 0, w, h, tip);
else
- but= uiDefMenuBut(block, func, arg, name, 0, 0, w, h, tip);
+ but = uiDefMenuBut(block, func, arg, name, 0, 0, w, h, tip);
- if(argN) { /* ugly .. */
- but->poin= (char*)but;
- but->func_argN= argN;
+ if (argN) { /* ugly .. */
+ but->poin = (char *)but;
+ but->func_argN = argN;
}
- if(layout->root->type == UI_LAYOUT_HEADER)
+ if (layout->root->type == UI_LAYOUT_HEADER)
uiBlockSetEmboss(block, UI_EMBOSS);
- else if(ELEM(layout->root->type, UI_LAYOUT_PANEL, UI_LAYOUT_TOOLBAR)) {
- but->type= MENU;
+ else if (ELEM(layout->root->type, UI_LAYOUT_PANEL, UI_LAYOUT_TOOLBAR)) {
+ but->type = MENU;
but->flag |= UI_TEXT_LEFT;
}
}
@@ -1481,19 +1486,19 @@ void uiItemM(uiLayout *layout, bContext *UNUSED(C), const char *menuname, const
{
MenuType *mt;
- mt= WM_menutype_find(menuname, FALSE);
+ mt = WM_menutype_find(menuname, FALSE);
- if(mt==NULL) {
+ if (mt == NULL) {
RNA_warning("not found %s", menuname);
return;
}
- if(!name) {
- name= IFACE_(mt->label);
+ if (!name) {
+ name = IFACE_(mt->label);
}
- if(layout->root->type == UI_LAYOUT_MENU && !icon)
- icon= ICON_BLANK1;
+ if (layout->root->type == UI_LAYOUT_MENU && !icon)
+ icon = ICON_BLANK1;
ui_item_menu(layout, name, icon, ui_item_menutype_func, mt, NULL, mt->description);
}
@@ -1501,25 +1506,25 @@ void uiItemM(uiLayout *layout, bContext *UNUSED(C), const char *menuname, const
/* label item */
static uiBut *uiItemL_(uiLayout *layout, const char *name, int icon)
{
- uiBlock *block= layout->root->block;
+ uiBlock *block = layout->root->block;
uiBut *but;
int w;
uiBlockSetCurLayout(block, layout);
- if(!name)
- name= "";
- if(layout->root->type == UI_LAYOUT_MENU && !icon)
- icon= ICON_BLANK1;
+ if (!name)
+ name = "";
+ if (layout->root->type == UI_LAYOUT_MENU && !icon)
+ icon = ICON_BLANK1;
- w= ui_text_icon_width(layout, name, icon, 0);
+ w = ui_text_icon_width(layout, name, icon, 0);
- if(icon && name[0])
- but= uiDefIconTextBut(block, LABEL, 0, icon, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
- else if(icon)
- but= uiDefIconBut(block, LABEL, 0, icon, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ if (icon && name[0])
+ but = uiDefIconTextBut(block, LABEL, 0, icon, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ else if (icon)
+ but = uiDefIconBut(block, LABEL, 0, icon, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
else
- but= uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ but = uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
return but;
}
@@ -1531,10 +1536,10 @@ void uiItemL(uiLayout *layout, const char *name, int icon)
void uiItemLDrag(uiLayout *layout, PointerRNA *ptr, const char *name, int icon)
{
- uiBut *but= uiItemL_(layout, name, icon);
+ uiBut *but = uiItemL_(layout, name, icon);
- if(ptr && ptr->type)
- if(RNA_struct_is_ID(ptr->type))
+ if (ptr && ptr->type)
+ if (RNA_struct_is_ID(ptr->type))
uiButSetDragID(but, ptr->id.data);
}
@@ -1543,22 +1548,22 @@ void uiItemLDrag(uiLayout *layout, PointerRNA *ptr, const char *name, int icon)
void uiItemV(uiLayout *layout, const char *name, int icon, int argval)
{
/* label */
- uiBlock *block= layout->root->block;
- float *retvalue= (block->handle)? &block->handle->retvalue: NULL;
+ uiBlock *block = layout->root->block;
+ float *retvalue = (block->handle) ? &block->handle->retvalue : NULL;
int w;
uiBlockSetCurLayout(block, layout);
- if(!name)
- name= "";
- if(layout->root->type == UI_LAYOUT_MENU && !icon)
- icon= ICON_BLANK1;
+ if (!name)
+ name = "";
+ if (layout->root->type == UI_LAYOUT_MENU && !icon)
+ icon = ICON_BLANK1;
- w= ui_text_icon_width(layout, name, icon, 0);
+ w = ui_text_icon_width(layout, name, icon, 0);
- if(icon && name[0])
+ if (icon && name[0])
uiDefIconTextButF(block, BUT, argval, icon, name, 0, 0, w, UI_UNIT_Y, retvalue, 0.0, 0.0, 0, 0, "");
- else if(icon)
+ else if (icon)
uiDefIconButF(block, BUT, argval, icon, 0, 0, w, UI_UNIT_Y, retvalue, 0.0, 0.0, 0, 0, "");
else
uiDefButF(block, BUT, argval, name, 0, 0, w, UI_UNIT_Y, retvalue, 0.0, 0.0, 0, 0, "");
@@ -1567,7 +1572,7 @@ void uiItemV(uiLayout *layout, const char *name, int icon, int argval)
/* separator item */
void uiItemS(uiLayout *layout)
{
- uiBlock *block= layout->root->block;
+ uiBlock *block = layout->root->block;
uiBlockSetCurLayout(block, layout);
uiDefBut(block, SEPR, 0, "", 0, 0, EM_SEPR_X, EM_SEPR_Y, NULL, 0.0, 0.0, 0, 0, "");
@@ -1576,7 +1581,7 @@ void uiItemS(uiLayout *layout)
/* level items */
void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg)
{
- if(!func)
+ if (!func)
return;
ui_item_menu(layout, name, icon, func, arg, NULL, "");
@@ -1584,7 +1589,7 @@ void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc
typedef struct MenuItemLevel {
int opcontext;
- /* dont use pointers to the strings because python can dynamically
+ /* don't use pointers to the strings because python can dynamically
* allocate strings and free before the menu draws, see [#27304] */
char opname[OP_MAX_TYPENAME];
char propname[MAX_IDPROP_NAME];
@@ -1593,7 +1598,7 @@ typedef struct MenuItemLevel {
static void menu_item_enum_opname_menu(bContext *UNUSED(C), uiLayout *layout, void *arg)
{
- MenuItemLevel *lvl= (MenuItemLevel*)(((uiBut*)arg)->func_argN);
+ MenuItemLevel *lvl = (MenuItemLevel *)(((uiBut *)arg)->func_argN);
uiLayoutSetOperatorContext(layout, lvl->opcontext);
uiItemsEnumO(layout, lvl->opname, lvl->propname);
@@ -1604,30 +1609,30 @@ void uiItemMenuEnumO(uiLayout *layout, const char *opname, const char *propname,
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
MenuItemLevel *lvl;
- UI_OPERATOR_ERROR_RET(ot, opname, return);
+ UI_OPERATOR_ERROR_RET(ot, opname, return );
- if(!ot->srna) {
+ if (!ot->srna) {
ui_item_disabled(layout, opname);
RNA_warning("operator missing srna '%s'", opname);
return;
}
- if(!name)
- name= ot->name;
- if(layout->root->type == UI_LAYOUT_MENU && !icon)
- icon= ICON_BLANK1;
+ if (!name)
+ name = ot->name;
+ if (layout->root->type == UI_LAYOUT_MENU && !icon)
+ icon = ICON_BLANK1;
- lvl= MEM_callocN(sizeof(MenuItemLevel), "MenuItemLevel");
+ lvl = MEM_callocN(sizeof(MenuItemLevel), "MenuItemLevel");
BLI_strncpy(lvl->opname, opname, sizeof(lvl->opname));
BLI_strncpy(lvl->propname, propname, sizeof(lvl->propname));
- lvl->opcontext= layout->root->opcontext;
+ lvl->opcontext = layout->root->opcontext;
ui_item_menu(layout, name, icon, menu_item_enum_opname_menu, NULL, lvl, ot->description);
}
static void menu_item_enum_rna_menu(bContext *UNUSED(C), uiLayout *layout, void *arg)
{
- MenuItemLevel *lvl= (MenuItemLevel*)(((uiBut*)arg)->func_argN);
+ MenuItemLevel *lvl = (MenuItemLevel *)(((uiBut *)arg)->func_argN);
uiLayoutSetOperatorContext(layout, lvl->opcontext);
uiItemsEnumR(layout, &lvl->rnapoin, lvl->propname);
@@ -1638,22 +1643,22 @@ void uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propn
MenuItemLevel *lvl;
PropertyRNA *prop;
- prop= RNA_struct_find_property(ptr, propname);
- if(!prop) {
+ prop = RNA_struct_find_property(ptr, propname);
+ if (!prop) {
ui_item_disabled(layout, propname);
RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
return;
}
- if(!name)
- name= RNA_property_ui_name(prop);
- if(layout->root->type == UI_LAYOUT_MENU && !icon)
- icon= ICON_BLANK1;
+ if (!name)
+ name = RNA_property_ui_name(prop);
+ if (layout->root->type == UI_LAYOUT_MENU && !icon)
+ icon = ICON_BLANK1;
- lvl= MEM_callocN(sizeof(MenuItemLevel), "MenuItemLevel");
- lvl->rnapoin= *ptr;
+ lvl = MEM_callocN(sizeof(MenuItemLevel), "MenuItemLevel");
+ lvl->rnapoin = *ptr;
BLI_strncpy(lvl->propname, propname, sizeof(lvl->propname));
- lvl->opcontext= layout->root->opcontext;
+ lvl->opcontext = layout->root->opcontext;
ui_item_menu(layout, name, icon, menu_item_enum_rna_menu, NULL, lvl, RNA_property_description(prop));
}
@@ -1666,129 +1671,129 @@ static void ui_litem_estimate_row(uiLayout *litem)
uiItem *item;
int itemw, itemh;
- litem->w= 0;
- litem->h= 0;
+ litem->w = 0;
+ litem->h = 0;
- for(item=litem->items.first; item; item=item->next) {
+ for (item = litem->items.first; item; item = item->next) {
ui_item_size(item, &itemw, &itemh);
litem->w += itemw;
- litem->h= MAX2(itemh, litem->h);
+ litem->h = MAX2(itemh, litem->h);
- if(item->next)
+ if (item->next)
litem->w += litem->space;
}
}
static int ui_litem_min_width(int itemw)
{
- return MIN2(2*UI_UNIT_X, itemw);
+ return MIN2(2 * UI_UNIT_X, itemw);
}
static void ui_litem_layout_row(uiLayout *litem)
{
uiItem *item;
int x, y, w, tot, totw, neww, itemw, minw, itemh, offset;
- int fixedw, freew, fixedx, freex, flag= 0, lastw= 0;
+ int fixedw, freew, fixedx, freex, flag = 0, lastw = 0;
/* x= litem->x; */ /* UNUSED */
- y= litem->y;
- w= litem->w;
- totw= 0;
- tot= 0;
+ y = litem->y;
+ w = litem->w;
+ totw = 0;
+ tot = 0;
- for(item=litem->items.first; item; item=item->next) {
+ for (item = litem->items.first; item; item = item->next) {
ui_item_size(item, &itemw, &itemh);
totw += itemw;
tot++;
}
- if(totw == 0)
+ if (totw == 0)
return;
- if(w != 0)
- w -= (tot-1)*litem->space;
- fixedw= 0;
+ if (w != 0)
+ w -= (tot - 1) * litem->space;
+ fixedw = 0;
/* keep clamping items to fixed minimum size until all are done */
do {
- freew= 0;
- x= 0;
- flag= 0;
+ freew = 0;
+ x = 0;
+ flag = 0;
- for(item=litem->items.first; item; item=item->next) {
- if(item->flag)
+ for (item = litem->items.first; item; item = item->next) {
+ if (item->flag)
continue;
ui_item_size(item, &itemw, &itemh);
- minw= ui_litem_min_width(itemw);
+ minw = ui_litem_min_width(itemw);
- if(w - lastw > 0)
- neww= ui_item_fit(itemw, x, totw, w-lastw, !item->next, litem->alignment, NULL);
+ if (w - lastw > 0)
+ neww = ui_item_fit(itemw, x, totw, w - lastw, !item->next, litem->alignment, NULL);
else
- neww= 0; /* no space left, all will need clamping to minimum size */
+ neww = 0; /* no space left, all will need clamping to minimum size */
x += neww;
- if((neww < minw || itemw == minw) && w != 0) {
+ if ((neww < minw || itemw == minw) && w != 0) {
/* fixed size */
- item->flag= 1;
+ item->flag = 1;
fixedw += minw;
- flag= 1;
+ flag = 1;
totw -= itemw;
}
else {
/* keep free size */
- item->flag= 0;
+ item->flag = 0;
freew += itemw;
}
}
- lastw= fixedw;
- } while(flag);
+ lastw = fixedw;
+ } while (flag);
- freex= 0;
- fixedx= 0;
- x= litem->x;
+ freex = 0;
+ fixedx = 0;
+ x = litem->x;
- for(item=litem->items.first; item; item=item->next) {
+ for (item = litem->items.first; item; item = item->next) {
ui_item_size(item, &itemw, &itemh);
- minw= ui_litem_min_width(itemw);
+ minw = ui_litem_min_width(itemw);
- if(item->flag) {
+ if (item->flag) {
/* fixed minimum size items */
- itemw= ui_item_fit(minw, fixedx, fixedw, MIN2(w, fixedw), !item->next, litem->alignment, NULL);
+ itemw = ui_item_fit(minw, fixedx, fixedw, MIN2(w, fixedw), !item->next, litem->alignment, NULL);
fixedx += itemw;
}
else {
/* free size item */
- itemw= ui_item_fit(itemw, freex, freew, w-fixedw, !item->next, litem->alignment, NULL);
+ itemw = ui_item_fit(itemw, freex, freew, w - fixedw, !item->next, litem->alignment, NULL);
freex += itemw;
}
/* align right/center */
- offset= 0;
- if(litem->alignment == UI_LAYOUT_ALIGN_RIGHT) {
- if(freew > 0 && freew < w-fixedw)
- offset= (w - fixedw) - freew;
+ offset = 0;
+ if (litem->alignment == UI_LAYOUT_ALIGN_RIGHT) {
+ if (freew > 0 && freew < w - fixedw)
+ offset = (w - fixedw) - freew;
}
- else if(litem->alignment == UI_LAYOUT_ALIGN_CENTER) {
- if(freew > 0 && freew < w-fixedw)
- offset= ((w - fixedw) - freew)/2;
+ else if (litem->alignment == UI_LAYOUT_ALIGN_CENTER) {
+ if (freew > 0 && freew < w - fixedw)
+ offset = ((w - fixedw) - freew) / 2;
}
/* position item */
- ui_item_position(item, x+offset, y-itemh, itemw, itemh);
+ ui_item_position(item, x + offset, y - itemh, itemw, itemh);
x += itemw;
- if(item->next)
+ if (item->next)
x += litem->space;
}
- litem->w= x - litem->x;
- litem->h= litem->y - y;
- litem->x= x;
- litem->y= y;
+ litem->w = x - litem->x;
+ litem->h = litem->y - y;
+ litem->x = x;
+ litem->y = y;
}
/* single-column layout */
@@ -1797,16 +1802,16 @@ static void ui_litem_estimate_column(uiLayout *litem)
uiItem *item;
int itemw, itemh;
- litem->w= 0;
- litem->h= 0;
+ litem->w = 0;
+ litem->h = 0;
- for(item=litem->items.first; item; item=item->next) {
+ for (item = litem->items.first; item; item = item->next) {
ui_item_size(item, &itemw, &itemh);
- litem->w= MAX2(litem->w, itemw);
+ litem->w = MAX2(litem->w, itemw);
litem->h += itemh;
- if(item->next)
+ if (item->next)
litem->h += litem->space;
}
}
@@ -1816,22 +1821,22 @@ static void ui_litem_layout_column(uiLayout *litem)
uiItem *item;
int itemh, x, y;
- x= litem->x;
- y= litem->y;
+ x = litem->x;
+ y = litem->y;
- for(item=litem->items.first; item; item=item->next) {
+ for (item = litem->items.first; item; item = item->next) {
ui_item_size(item, NULL, &itemh);
y -= itemh;
ui_item_position(item, x, y, litem->w, itemh);
- if(item->next)
+ if (item->next)
y -= litem->space;
}
- litem->h= litem->y - y;
- litem->x= x;
- litem->y= y;
+ litem->h = litem->y - y;
+ litem->x = x;
+ litem->y = y;
}
/* root layout */
@@ -1842,7 +1847,7 @@ static void ui_litem_estimate_root(uiLayout *UNUSED(litem))
static void ui_litem_layout_root(uiLayout *litem)
{
- if(litem->root->type == UI_LAYOUT_HEADER)
+ if (litem->root->type == UI_LAYOUT_HEADER)
ui_litem_layout_row(litem);
else
ui_litem_layout_column(litem);
@@ -1851,157 +1856,157 @@ static void ui_litem_layout_root(uiLayout *litem)
/* box layout */
static void ui_litem_estimate_box(uiLayout *litem)
{
- uiStyle *style= litem->root->style;
+ uiStyle *style = litem->root->style;
ui_litem_estimate_column(litem);
- litem->w += 2*style->boxspace;
+ litem->w += 2 * style->boxspace;
litem->h += style->boxspace;
}
static void ui_litem_layout_box(uiLayout *litem)
{
- uiLayoutItemBx *box= (uiLayoutItemBx*)litem;
- uiStyle *style= litem->root->style;
+ uiLayoutItemBx *box = (uiLayoutItemBx *)litem;
+ uiStyle *style = litem->root->style;
uiBut *but;
int w, h;
- w= litem->w;
- h= litem->h;
+ w = litem->w;
+ h = litem->h;
litem->x += style->boxspace;
- if(w != 0) litem->w -= 2*style->boxspace;
- if(h != 0) litem->h -= 2*style->boxspace;
+ if (w != 0) litem->w -= 2 * style->boxspace;
+ if (h != 0) litem->h -= 2 * style->boxspace;
ui_litem_layout_column(litem);
litem->x -= style->boxspace;
litem->y -= style->boxspace;
- if(w != 0) litem->w += 2*style->boxspace;
- if(h != 0) litem->h += style->boxspace;
+ if (w != 0) litem->w += 2 * style->boxspace;
+ if (h != 0) litem->h += style->boxspace;
/* roundbox around the sublayout */
- but= box->roundbox;
- but->x1= litem->x;
- but->y1= litem->y;
- but->x2= litem->x+litem->w;
- but->y2= litem->y+litem->h;
+ but = box->roundbox;
+ but->x1 = litem->x;
+ but->y1 = litem->y;
+ but->x2 = litem->x + litem->w;
+ but->y2 = litem->y + litem->h;
}
/* multi-column layout, automatically flowing to the next */
static void ui_litem_estimate_column_flow(uiLayout *litem)
{
- uiStyle *style= litem->root->style;
- uiLayoutItemFlow *flow= (uiLayoutItemFlow*)litem;
+ uiStyle *style = litem->root->style;
+ uiLayoutItemFlow *flow = (uiLayoutItemFlow *)litem;
uiItem *item;
- int col, x, y, emh, emy, miny, itemw, itemh, maxw=0;
+ int col, x, y, emh, emy, miny, itemw, itemh, maxw = 0;
int toth, totitem;
/* compute max needed width and total height */
- toth= 0;
- totitem= 0;
- for(item=litem->items.first; item; item=item->next) {
+ toth = 0;
+ totitem = 0;
+ for (item = litem->items.first; item; item = item->next) {
ui_item_size(item, &itemw, &itemh);
- maxw= MAX2(maxw, itemw);
+ maxw = MAX2(maxw, itemw);
toth += itemh;
totitem++;
}
- if(flow->number <= 0) {
+ if (flow->number <= 0) {
/* auto compute number of columns, not very good */
- if(maxw == 0) {
- flow->totcol= 1;
+ if (maxw == 0) {
+ flow->totcol = 1;
return;
}
- flow->totcol= MAX2(litem->root->emw/maxw, 1);
- flow->totcol= MIN2(flow->totcol, totitem);
+ flow->totcol = MAX2(litem->root->emw / maxw, 1);
+ flow->totcol = MIN2(flow->totcol, totitem);
}
else
- flow->totcol= flow->number;
+ flow->totcol = flow->number;
/* compute sizes */
- x= 0;
- y= 0;
- emy= 0;
- miny= 0;
+ x = 0;
+ y = 0;
+ emy = 0;
+ miny = 0;
- maxw= 0;
- emh= toth/flow->totcol;
+ maxw = 0;
+ emh = toth / flow->totcol;
/* create column per column */
- col= 0;
- for(item=litem->items.first; item; item=item->next) {
+ col = 0;
+ for (item = litem->items.first; item; item = item->next) {
ui_item_size(item, &itemw, &itemh);
y -= itemh + style->buttonspacey;
- miny= MIN2(miny, y);
+ miny = MIN2(miny, y);
emy -= itemh;
- maxw= MAX2(itemw, maxw);
+ maxw = MAX2(itemw, maxw);
/* decide to go to next one */
- if(col < flow->totcol-1 && emy <= -emh) {
+ if (col < flow->totcol - 1 && emy <= -emh) {
x += maxw + litem->space;
- maxw= 0;
- y= 0;
+ maxw = 0;
+ y = 0;
col++;
}
}
- litem->w= x;
- litem->h= litem->y - miny;
+ litem->w = x;
+ litem->h = litem->y - miny;
}
static void ui_litem_layout_column_flow(uiLayout *litem)
{
- uiStyle *style= litem->root->style;
- uiLayoutItemFlow *flow= (uiLayoutItemFlow*)litem;
+ uiStyle *style = litem->root->style;
+ uiLayoutItemFlow *flow = (uiLayoutItemFlow *)litem;
uiItem *item;
int col, x, y, w, emh, emy, miny, itemw, itemh;
int toth, totitem, offset;
/* compute max needed width and total height */
- toth= 0;
- totitem= 0;
- for(item=litem->items.first; item; item=item->next) {
+ toth = 0;
+ totitem = 0;
+ for (item = litem->items.first; item; item = item->next) {
ui_item_size(item, &itemw, &itemh);
toth += itemh;
totitem++;
}
/* compute sizes */
- x= litem->x;
- y= litem->y;
- emy= 0;
- miny= 0;
+ x = litem->x;
+ y = litem->y;
+ emy = 0;
+ miny = 0;
- w= litem->w - (flow->totcol-1)*style->columnspace;
- emh= toth/flow->totcol;
+ w = litem->w - (flow->totcol - 1) * style->columnspace;
+ emh = toth / flow->totcol;
/* create column per column */
- col= 0;
- for(item=litem->items.first; item; item=item->next) {
+ col = 0;
+ for (item = litem->items.first; item; item = item->next) {
ui_item_size(item, NULL, &itemh);
- itemw= ui_item_fit(1, x-litem->x, flow->totcol, w, col == flow->totcol-1, litem->alignment, &offset);
+ itemw = ui_item_fit(1, x - litem->x, flow->totcol, w, col == flow->totcol - 1, litem->alignment, &offset);
y -= itemh;
emy -= itemh;
- ui_item_position(item, x+offset, y, itemw, itemh);
+ ui_item_position(item, x + offset, y, itemw, itemh);
y -= style->buttonspacey;
- miny= MIN2(miny, y);
+ miny = MIN2(miny, y);
/* decide to go to next one */
- if(col < flow->totcol-1 && emy <= -emh) {
+ if (col < flow->totcol - 1 && emy <= -emh) {
x += itemw + style->columnspace;
- y= litem->y;
+ y = litem->y;
col++;
}
}
- litem->h= litem->y - miny;
- litem->x= x;
- litem->y= miny;
+ litem->h = litem->y - miny;
+ litem->x = x;
+ litem->y = miny;
}
/* free layout */
@@ -2010,20 +2015,20 @@ static void ui_litem_estimate_absolute(uiLayout *litem)
uiItem *item;
int itemx, itemy, itemw, itemh, minx, miny;
- minx= 1e6;
- miny= 1e6;
- litem->w= 0;
- litem->h= 0;
+ minx = 1e6;
+ miny = 1e6;
+ litem->w = 0;
+ litem->h = 0;
- for(item=litem->items.first; item; item=item->next) {
+ for (item = litem->items.first; item; item = item->next) {
ui_item_offset(item, &itemx, &itemy);
ui_item_size(item, &itemw, &itemh);
- minx= MIN2(minx, itemx);
- miny= MIN2(miny, itemy);
+ minx = MIN2(minx, itemx);
+ miny = MIN2(miny, itemy);
- litem->w= MAX2(litem->w, itemx+itemw);
- litem->h= MAX2(litem->h, itemy+itemh);
+ litem->w = MAX2(litem->w, itemx + itemw);
+ litem->h = MAX2(litem->h, itemy + itemh);
}
litem->w -= minx;
@@ -2033,59 +2038,59 @@ static void ui_litem_estimate_absolute(uiLayout *litem)
static void ui_litem_layout_absolute(uiLayout *litem)
{
uiItem *item;
- float scalex=1.0f, scaley=1.0f;
+ float scalex = 1.0f, scaley = 1.0f;
int x, y, newx, newy, itemx, itemy, itemh, itemw, minx, miny, totw, toth;
- minx= 1e6;
- miny= 1e6;
- totw= 0;
- toth= 0;
+ minx = 1e6;
+ miny = 1e6;
+ totw = 0;
+ toth = 0;
- for(item=litem->items.first; item; item=item->next) {
+ for (item = litem->items.first; item; item = item->next) {
ui_item_offset(item, &itemx, &itemy);
ui_item_size(item, &itemw, &itemh);
- minx= MIN2(minx, itemx);
- miny= MIN2(miny, itemy);
+ minx = MIN2(minx, itemx);
+ miny = MIN2(miny, itemy);
- totw= MAX2(totw, itemx+itemw);
- toth= MAX2(toth, itemy+itemh);
+ totw = MAX2(totw, itemx + itemw);
+ toth = MAX2(toth, itemy + itemh);
}
totw -= minx;
toth -= miny;
- if(litem->w && totw > 0)
- scalex= (float)litem->w/(float)totw;
- if(litem->h && toth > 0)
- scaley= (float)litem->h/(float)toth;
+ if (litem->w && totw > 0)
+ scalex = (float)litem->w / (float)totw;
+ if (litem->h && toth > 0)
+ scaley = (float)litem->h / (float)toth;
- x= litem->x;
- y= litem->y - scaley*toth;
+ x = litem->x;
+ y = litem->y - scaley * toth;
- for(item=litem->items.first; item; item=item->next) {
+ for (item = litem->items.first; item; item = item->next) {
ui_item_offset(item, &itemx, &itemy);
ui_item_size(item, &itemw, &itemh);
- if(scalex != 1.0f) {
- newx= (itemx - minx)*scalex;
- itemw= (itemx - minx + itemw)*scalex - newx;
- itemx= minx + newx;
+ if (scalex != 1.0f) {
+ newx = (itemx - minx) * scalex;
+ itemw = (itemx - minx + itemw) * scalex - newx;
+ itemx = minx + newx;
}
- if(scaley != 1.0f) {
- newy= (itemy - miny)*scaley;
- itemh= (itemy - miny + itemh)*scaley - newy;
- itemy= miny + newy;
+ if (scaley != 1.0f) {
+ newy = (itemy - miny) * scaley;
+ itemh = (itemy - miny + itemh) * scaley - newy;
+ itemy = miny + newy;
}
- ui_item_position(item, x+itemx-minx, y+itemy-miny, itemw, itemh);
+ ui_item_position(item, x + itemx - minx, y + itemy - miny, itemw, itemh);
}
- litem->w= scalex*totw;
- litem->h= litem->y - y;
- litem->x= x + litem->w;
- litem->y= y;
+ litem->w = scalex * totw;
+ litem->h = litem->y - y;
+ litem->x = x + litem->w;
+ litem->y = y;
}
/* split layout */
@@ -2096,42 +2101,42 @@ static void ui_litem_estimate_split(uiLayout *litem)
static void ui_litem_layout_split(uiLayout *litem)
{
- uiLayoutItemSplit *split= (uiLayoutItemSplit*)litem;
+ uiLayoutItemSplit *split = (uiLayoutItemSplit *)litem;
uiItem *item;
float percentage;
- const int tot= BLI_countlist(&litem->items);
- int itemh, x, y, w, colw=0;
+ const int tot = BLI_countlist(&litem->items);
+ int itemh, x, y, w, colw = 0;
- if(tot == 0)
+ if (tot == 0)
return;
- x= litem->x;
- y= litem->y;
+ x = litem->x;
+ y = litem->y;
- percentage= (split->percentage == 0.0f)? 1.0f/(float)tot: split->percentage;
+ percentage = (split->percentage == 0.0f) ? 1.0f / (float)tot : split->percentage;
- w= (litem->w - (tot-1)*litem->space);
- colw= w*percentage;
- colw= MAX2(colw, 0);
+ w = (litem->w - (tot - 1) * litem->space);
+ colw = w * percentage;
+ colw = MAX2(colw, 0);
- for(item=litem->items.first; item; item=item->next) {
+ for (item = litem->items.first; item; item = item->next) {
ui_item_size(item, NULL, &itemh);
- ui_item_position(item, x, y-itemh, colw, itemh);
+ ui_item_position(item, x, y - itemh, colw, itemh);
x += colw;
- if(item->next) {
- colw= (w - (int)(w*percentage))/(tot-1);
- colw= MAX2(colw, 0);
+ if (item->next) {
+ colw = (w - (int)(w * percentage)) / (tot - 1);
+ colw = MAX2(colw, 0);
x += litem->space;
}
}
- litem->w= x - litem->x;
- litem->h= litem->y - y;
- litem->x= x;
- litem->y= y;
+ litem->w = x - litem->x;
+ litem->h = litem->y - y;
+ litem->x = x;
+ litem->y = y;
}
/* overlap layout */
@@ -2140,14 +2145,14 @@ static void ui_litem_estimate_overlap(uiLayout *litem)
uiItem *item;
int itemw, itemh;
- litem->w= 0;
- litem->h= 0;
+ litem->w = 0;
+ litem->h = 0;
- for(item=litem->items.first; item; item=item->next) {
+ for (item = litem->items.first; item; item = item->next) {
ui_item_size(item, &itemw, &itemh);
- litem->w= MAX2(itemw, litem->w);
- litem->h= MAX2(itemh, litem->h);
+ litem->w = MAX2(itemw, litem->w);
+ litem->h = MAX2(itemh, litem->h);
}
}
@@ -2156,18 +2161,18 @@ static void ui_litem_layout_overlap(uiLayout *litem)
uiItem *item;
int itemw, itemh, x, y;
- x= litem->x;
- y= litem->y;
+ x = litem->x;
+ y = litem->y;
- for(item=litem->items.first; item; item=item->next) {
+ for (item = litem->items.first; item; item = item->next) {
ui_item_size(item, &itemw, &itemh);
- ui_item_position(item, x, y-itemh, litem->w, itemh);
+ ui_item_position(item, x, y - itemh, litem->w, itemh);
- litem->h= MAX2(litem->h, itemh);
+ litem->h = MAX2(litem->h, itemh);
}
- litem->x= x;
- litem->y= y - litem->h;
+ litem->x = x;
+ litem->y = y - litem->h;
}
/* layout create functions */
@@ -2175,14 +2180,14 @@ uiLayout *uiLayoutRow(uiLayout *layout, int align)
{
uiLayout *litem;
- litem= MEM_callocN(sizeof(uiLayout), "uiLayoutRow");
- litem->item.type= ITEM_LAYOUT_ROW;
- litem->root= layout->root;
- litem->align= align;
- litem->active= 1;
- litem->enabled= 1;
- litem->context= layout->context;
- litem->space= (align)? 0: layout->root->style->buttonspacex;
+ litem = MEM_callocN(sizeof(uiLayout), "uiLayoutRow");
+ litem->item.type = ITEM_LAYOUT_ROW;
+ litem->root = layout->root;
+ litem->align = align;
+ litem->active = 1;
+ litem->enabled = 1;
+ litem->context = layout->context;
+ litem->space = (align) ? 0 : layout->root->style->buttonspacex;
litem->w = layout->w;
BLI_addtail(&layout->items, litem);
@@ -2195,14 +2200,14 @@ uiLayout *uiLayoutColumn(uiLayout *layout, int align)
{
uiLayout *litem;
- litem= MEM_callocN(sizeof(uiLayout), "uiLayoutColumn");
- litem->item.type= ITEM_LAYOUT_COLUMN;
- litem->root= layout->root;
- litem->align= align;
- litem->active= 1;
- litem->enabled= 1;
- litem->context= layout->context;
- litem->space= (litem->align)? 0: layout->root->style->buttonspacey;
+ litem = MEM_callocN(sizeof(uiLayout), "uiLayoutColumn");
+ litem->item.type = ITEM_LAYOUT_COLUMN;
+ litem->root = layout->root;
+ litem->align = align;
+ litem->active = 1;
+ litem->enabled = 1;
+ litem->context = layout->context;
+ litem->space = (litem->align) ? 0 : layout->root->style->buttonspacey;
litem->w = layout->w;
BLI_addtail(&layout->items, litem);
@@ -2215,16 +2220,16 @@ uiLayout *uiLayoutColumnFlow(uiLayout *layout, int number, int align)
{
uiLayoutItemFlow *flow;
- flow= MEM_callocN(sizeof(uiLayoutItemFlow), "uiLayoutItemFlow");
- flow->litem.item.type= ITEM_LAYOUT_COLUMN_FLOW;
- flow->litem.root= layout->root;
- flow->litem.align= align;
- flow->litem.active= 1;
- flow->litem.enabled= 1;
- flow->litem.context= layout->context;
- flow->litem.space= (flow->litem.align)? 0: layout->root->style->columnspace;
+ flow = MEM_callocN(sizeof(uiLayoutItemFlow), "uiLayoutItemFlow");
+ flow->litem.item.type = ITEM_LAYOUT_COLUMN_FLOW;
+ flow->litem.root = layout->root;
+ flow->litem.align = align;
+ flow->litem.active = 1;
+ flow->litem.enabled = 1;
+ flow->litem.context = layout->context;
+ flow->litem.space = (flow->litem.align) ? 0 : layout->root->style->columnspace;
flow->litem.w = layout->w;
- flow->number= number;
+ flow->number = number;
BLI_addtail(&layout->items, flow);
uiBlockSetCurLayout(layout->root->block, &flow->litem);
@@ -2236,52 +2241,52 @@ static uiLayoutItemBx *ui_layout_box(uiLayout *layout, int type)
{
uiLayoutItemBx *box;
- box= MEM_callocN(sizeof(uiLayoutItemBx), "uiLayoutItemBx");
- box->litem.item.type= ITEM_LAYOUT_BOX;
- box->litem.root= layout->root;
- box->litem.active= 1;
- box->litem.enabled= 1;
- box->litem.context= layout->context;
- box->litem.space= layout->root->style->columnspace;
+ box = MEM_callocN(sizeof(uiLayoutItemBx), "uiLayoutItemBx");
+ box->litem.item.type = ITEM_LAYOUT_BOX;
+ box->litem.root = layout->root;
+ box->litem.active = 1;
+ box->litem.enabled = 1;
+ box->litem.context = layout->context;
+ box->litem.space = layout->root->style->columnspace;
box->litem.w = layout->w;
BLI_addtail(&layout->items, box);
uiBlockSetCurLayout(layout->root->block, &box->litem);
- box->roundbox= uiDefBut(layout->root->block, type, 0, "", 0, 0, 0, 0, NULL, 0.0, 0.0, 0, 0, "");
+ box->roundbox = uiDefBut(layout->root->block, type, 0, "", 0, 0, 0, 0, NULL, 0.0, 0.0, 0, 0, "");
return box;
}
uiLayout *uiLayoutBox(uiLayout *layout)
{
- return (uiLayout*)ui_layout_box(layout, ROUNDBOX);
+ return (uiLayout *)ui_layout_box(layout, ROUNDBOX);
}
uiLayout *uiLayoutListBox(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *actptr, PropertyRNA *actprop)
{
- uiLayoutItemBx *box= ui_layout_box(layout, LISTBOX);
- uiBut *but= box->roundbox;
+ uiLayoutItemBx *box = ui_layout_box(layout, LISTBOX);
+ uiBut *but = box->roundbox;
- but->rnasearchpoin= *ptr;
- but->rnasearchprop= prop;
- but->rnapoin= *actptr;
- but->rnaprop= actprop;
+ but->rnasearchpoin = *ptr;
+ but->rnasearchprop = prop;
+ but->rnapoin = *actptr;
+ but->rnaprop = actprop;
- return (uiLayout*)box;
+ return (uiLayout *)box;
}
uiLayout *uiLayoutAbsolute(uiLayout *layout, int align)
{
uiLayout *litem;
- litem= MEM_callocN(sizeof(uiLayout), "uiLayoutAbsolute");
- litem->item.type= ITEM_LAYOUT_ABSOLUTE;
- litem->root= layout->root;
- litem->align= align;
- litem->active= 1;
- litem->enabled= 1;
- litem->context= layout->context;
+ litem = MEM_callocN(sizeof(uiLayout), "uiLayoutAbsolute");
+ litem->item.type = ITEM_LAYOUT_ABSOLUTE;
+ litem->root = layout->root;
+ litem->align = align;
+ litem->active = 1;
+ litem->enabled = 1;
+ litem->context = layout->context;
BLI_addtail(&layout->items, litem);
uiBlockSetCurLayout(layout->root->block, litem);
@@ -2293,7 +2298,7 @@ uiBlock *uiLayoutAbsoluteBlock(uiLayout *layout)
{
uiBlock *block;
- block= uiLayoutGetBlock(layout);
+ block = uiLayoutGetBlock(layout);
uiLayoutAbsolute(layout, 0);
return block;
@@ -2303,12 +2308,12 @@ uiLayout *uiLayoutOverlap(uiLayout *layout)
{
uiLayout *litem;
- litem= MEM_callocN(sizeof(uiLayout), "uiLayoutOverlap");
- litem->item.type= ITEM_LAYOUT_OVERLAP;
- litem->root= layout->root;
- litem->active= 1;
- litem->enabled= 1;
- litem->context= layout->context;
+ litem = MEM_callocN(sizeof(uiLayout), "uiLayoutOverlap");
+ litem->item.type = ITEM_LAYOUT_OVERLAP;
+ litem->root = layout->root;
+ litem->active = 1;
+ litem->enabled = 1;
+ litem->context = layout->context;
BLI_addtail(&layout->items, litem);
uiBlockSetCurLayout(layout->root->block, litem);
@@ -2320,16 +2325,16 @@ uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, int align)
{
uiLayoutItemSplit *split;
- split= MEM_callocN(sizeof(uiLayoutItemSplit), "uiLayoutItemSplit");
- split->litem.item.type= ITEM_LAYOUT_SPLIT;
- split->litem.root= layout->root;
- split->litem.align= align;
- split->litem.active= 1;
- split->litem.enabled= 1;
- split->litem.context= layout->context;
- split->litem.space= layout->root->style->columnspace;
- split->litem.w= layout->w;
- split->percentage= percentage;
+ split = MEM_callocN(sizeof(uiLayoutItemSplit), "uiLayoutItemSplit");
+ split->litem.item.type = ITEM_LAYOUT_SPLIT;
+ split->litem.root = layout->root;
+ split->litem.align = align;
+ split->litem.active = 1;
+ split->litem.enabled = 1;
+ split->litem.context = layout->context;
+ split->litem.space = layout->root->style->columnspace;
+ split->litem.w = layout->w;
+ split->percentage = percentage;
BLI_addtail(&layout->items, split);
uiBlockSetCurLayout(layout->root->block, &split->litem);
@@ -2339,37 +2344,37 @@ uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, int align)
void uiLayoutSetActive(uiLayout *layout, int active)
{
- layout->active= active;
+ layout->active = active;
}
void uiLayoutSetEnabled(uiLayout *layout, int enabled)
{
- layout->enabled= enabled;
+ layout->enabled = enabled;
}
void uiLayoutSetRedAlert(uiLayout *layout, int redalert)
{
- layout->redalert= redalert;
+ layout->redalert = redalert;
}
void uiLayoutSetKeepAspect(uiLayout *layout, int keepaspect)
{
- layout->keepaspect= keepaspect;
+ layout->keepaspect = keepaspect;
}
void uiLayoutSetAlignment(uiLayout *layout, int alignment)
{
- layout->alignment= alignment;
+ layout->alignment = alignment;
}
void uiLayoutSetScaleX(uiLayout *layout, float scale)
{
- layout->scale[0]= scale;
+ layout->scale[0] = scale;
}
void uiLayoutSetScaleY(uiLayout *layout, float scale)
{
- layout->scale[1]= scale;
+ layout->scale[1] = scale;
}
int uiLayoutGetActive(uiLayout *layout)
@@ -2419,16 +2424,16 @@ static void ui_item_scale(uiLayout *litem, float scale[2])
uiItem *item;
int x, y, w, h;
- for(item=litem->items.last; item; item=item->prev) {
+ for (item = litem->items.last; item; item = item->prev) {
ui_item_size(item, &w, &h);
ui_item_offset(item, &x, &y);
- if(scale[0] != 0.0f) {
+ if (scale[0] != 0.0f) {
x *= scale[0];
w *= scale[0];
}
- if(scale[1] != 0.0f) {
+ if (scale[1] != 0.0f) {
y *= scale[1];
h *= scale[1];
}
@@ -2441,19 +2446,19 @@ static void ui_item_estimate(uiItem *item)
{
uiItem *subitem;
- if(item->type != ITEM_BUTTON) {
- uiLayout *litem= (uiLayout*)item;
+ if (item->type != ITEM_BUTTON) {
+ uiLayout *litem = (uiLayout *)item;
- for(subitem=litem->items.first; subitem; subitem=subitem->next)
+ for (subitem = litem->items.first; subitem; subitem = subitem->next)
ui_item_estimate(subitem);
- if(litem->items.first == NULL)
+ if (litem->items.first == NULL)
return;
- if(litem->scale[0] != 0.0f || litem->scale[1] != 0.0f)
+ if (litem->scale[0] != 0.0f || litem->scale[1] != 0.0f)
ui_item_scale(litem, litem->scale);
- switch(litem->item.type) {
+ switch (litem->item.type) {
case ITEM_LAYOUT_COLUMN:
ui_litem_estimate_column(litem);
break;
@@ -2490,23 +2495,23 @@ static void ui_item_align(uiLayout *litem, short nr)
uiButtonItem *bitem;
uiLayoutItemBx *box;
- for(item=litem->items.last; item; item=item->prev) {
- if(item->type == ITEM_BUTTON) {
- bitem= (uiButtonItem*)item;
- if(ui_but_can_align(bitem->but))
- if(!bitem->but->alignnr)
- bitem->but->alignnr= nr;
+ for (item = litem->items.last; item; item = item->prev) {
+ if (item->type == ITEM_BUTTON) {
+ bitem = (uiButtonItem *)item;
+ if (ui_but_can_align(bitem->but))
+ if (!bitem->but->alignnr)
+ bitem->but->alignnr = nr;
}
- else if(item->type == ITEM_LAYOUT_ABSOLUTE);
- else if(item->type == ITEM_LAYOUT_OVERLAP);
- else if(item->type == ITEM_LAYOUT_BOX) {
- box= (uiLayoutItemBx*)item;
- box->roundbox->alignnr= nr;
+ else if (item->type == ITEM_LAYOUT_ABSOLUTE) ;
+ else if (item->type == ITEM_LAYOUT_OVERLAP) ;
+ else if (item->type == ITEM_LAYOUT_BOX) {
+ box = (uiLayoutItemBx *)item;
+ box->roundbox->alignnr = nr;
BLI_remlink(&litem->root->block->buttons, box->roundbox);
BLI_addhead(&litem->root->block->buttons, box->roundbox);
}
else
- ui_item_align((uiLayout*)item, nr);
+ ui_item_align((uiLayout *)item, nr);
}
}
@@ -2515,13 +2520,13 @@ static void ui_item_flag(uiLayout *litem, int flag)
uiItem *item;
uiButtonItem *bitem;
- for(item=litem->items.last; item; item=item->prev) {
- if(item->type == ITEM_BUTTON) {
- bitem= (uiButtonItem*)item;
+ for (item = litem->items.last; item; item = item->prev) {
+ if (item->type == ITEM_BUTTON) {
+ bitem = (uiButtonItem *)item;
bitem->but->flag |= flag;
}
else
- ui_item_flag((uiLayout*)item, flag);
+ ui_item_flag((uiLayout *)item, flag);
}
}
@@ -2529,20 +2534,20 @@ static void ui_item_layout(uiItem *item)
{
uiItem *subitem;
- if(item->type != ITEM_BUTTON) {
- uiLayout *litem= (uiLayout*)item;
+ if (item->type != ITEM_BUTTON) {
+ uiLayout *litem = (uiLayout *)item;
- if(litem->items.first == NULL)
+ if (litem->items.first == NULL)
return;
- if(litem->align)
+ if (litem->align)
ui_item_align(litem, ++litem->root->block->alignnr);
- if(!litem->active)
+ if (!litem->active)
ui_item_flag(litem, UI_BUT_INACTIVE);
- if(!litem->enabled)
+ if (!litem->enabled)
ui_item_flag(litem, UI_BUT_DISABLED);
- switch(litem->item.type) {
+ switch (litem->item.type) {
case ITEM_LAYOUT_COLUMN:
ui_litem_layout_column(litem);
break;
@@ -2571,34 +2576,34 @@ static void ui_item_layout(uiItem *item)
break;
}
- for(subitem=litem->items.first; subitem; subitem=subitem->next)
+ for (subitem = litem->items.first; subitem; subitem = subitem->next)
ui_item_layout(subitem);
}
}
static void ui_layout_end(uiBlock *block, uiLayout *layout, int *x, int *y)
{
- if(layout->root->handlefunc)
+ if (layout->root->handlefunc)
uiBlockSetHandleFunc(block, layout->root->handlefunc, layout->root->argv);
ui_item_estimate(&layout->item);
ui_item_layout(&layout->item);
- if(x) *x= layout->x;
- if(y) *y= layout->y;
+ if (x) *x = layout->x;
+ if (y) *y = layout->y;
}
static void ui_layout_free(uiLayout *layout)
{
uiItem *item, *next;
- for(item=layout->items.first; item; item=next) {
- next= item->next;
+ for (item = layout->items.first; item; item = next) {
+ next = item->next;
- if(item->type == ITEM_BUTTON)
+ if (item->type == ITEM_BUTTON)
MEM_freeN(item);
else
- ui_layout_free((uiLayout*)item);
+ ui_layout_free((uiLayout *)item);
}
MEM_freeN(layout);
@@ -2609,37 +2614,37 @@ uiLayout *uiBlockLayout(uiBlock *block, int dir, int type, int x, int y, int siz
uiLayout *layout;
uiLayoutRoot *root;
- root= MEM_callocN(sizeof(uiLayoutRoot), "uiLayoutRoot");
- root->type= type;
- root->style= style;
- root->block= block;
- root->opcontext= WM_OP_INVOKE_REGION_WIN;
+ root = MEM_callocN(sizeof(uiLayoutRoot), "uiLayoutRoot");
+ root->type = type;
+ root->style = style;
+ root->block = block;
+ root->opcontext = WM_OP_INVOKE_REGION_WIN;
- layout= MEM_callocN(sizeof(uiLayout), "uiLayout");
- layout->item.type= ITEM_LAYOUT_ROOT;
+ layout = MEM_callocN(sizeof(uiLayout), "uiLayout");
+ layout->item.type = ITEM_LAYOUT_ROOT;
- layout->x= x;
- layout->y= y;
- layout->root= root;
- layout->space= style->templatespace;
- layout->active= 1;
- layout->enabled= 1;
- layout->context= NULL;
+ layout->x = x;
+ layout->y = y;
+ layout->root = root;
+ layout->space = style->templatespace;
+ layout->active = 1;
+ layout->enabled = 1;
+ layout->context = NULL;
- if(type == UI_LAYOUT_MENU)
- layout->space= 0;
+ if (type == UI_LAYOUT_MENU)
+ layout->space = 0;
- if(dir == UI_LAYOUT_HORIZONTAL) {
- layout->h= size;
- layout->root->emh= em*UI_UNIT_Y;
+ if (dir == UI_LAYOUT_HORIZONTAL) {
+ layout->h = size;
+ layout->root->emh = em * UI_UNIT_Y;
}
else {
- layout->w= size;
- layout->root->emw= em*UI_UNIT_X;
+ layout->w = size;
+ layout->root->emw = em * UI_UNIT_X;
}
- block->curlayout= layout;
- root->layout= layout;
+ block->curlayout = layout;
+ root->layout = layout;
BLI_addtail(&block->layouts, root);
return layout;
@@ -2658,45 +2663,45 @@ int uiLayoutGetOperatorContext(uiLayout *layout)
void uiBlockSetCurLayout(uiBlock *block, uiLayout *layout)
{
- block->curlayout= layout;
+ block->curlayout = layout;
}
void ui_layout_add_but(uiLayout *layout, uiBut *but)
{
uiButtonItem *bitem;
- bitem= MEM_callocN(sizeof(uiButtonItem), "uiButtonItem");
- bitem->item.type= ITEM_BUTTON;
- bitem->but= but;
+ bitem = MEM_callocN(sizeof(uiButtonItem), "uiButtonItem");
+ bitem->item.type = ITEM_BUTTON;
+ bitem->but = but;
BLI_addtail(&layout->items, bitem);
- if(layout->context) {
- but->context= layout->context;
- but->context->used= 1;
+ if (layout->context) {
+ but->context = layout->context;
+ but->context->used = 1;
}
}
void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext)
{
- layout->root->opcontext= opcontext;
+ layout->root->opcontext = opcontext;
}
void uiLayoutSetFunc(uiLayout *layout, uiMenuHandleFunc handlefunc, void *argv)
{
- layout->root->handlefunc= handlefunc;
- layout->root->argv= argv;
+ layout->root->handlefunc = handlefunc;
+ layout->root->argv = argv;
}
void uiBlockLayoutResolve(uiBlock *block, int *x, int *y)
{
uiLayoutRoot *root;
- if(x) *x= 0;
- if(y) *y= 0;
+ if (x) *x = 0;
+ if (y) *y = 0;
- block->curlayout= NULL;
+ block->curlayout = NULL;
- for(root=block->layouts.first; root; root=root->next) {
+ for (root = block->layouts.first; root; root = root->next) {
/* NULL in advance so we don't interfere when adding button */
ui_layout_end(block, root->layout, x, y);
ui_layout_free(root->layout);
@@ -2713,8 +2718,8 @@ void uiBlockLayoutResolve(uiBlock *block, int *x, int *y)
void uiLayoutSetContextPointer(uiLayout *layout, const char *name, PointerRNA *ptr)
{
- uiBlock *block= layout->root->block;
- layout->context= CTX_store_add(&block->contexts, name, ptr);
+ uiBlock *block = layout->root->block;
+ layout->context = CTX_store_add(&block->contexts, name, ptr);
}
@@ -2728,13 +2733,13 @@ static void ui_intro_button(DynStr *ds, uiButtonItem *bitem)
BLI_dynstr_appendf(ds, "'draw_string':'''%s''', ", but->drawstr);
BLI_dynstr_appendf(ds, "'tip':'''%s''', ", but->tip ? but->tip : ""); // not exactly needed, rna has this
- if(but->optype) {
+ if (but->optype) {
char *opstr = WM_operator_pystring(but->block->evil_C, but->optype, but->opptr, 0);
BLI_dynstr_appendf(ds, "'operator':'''%s''', ", opstr ? opstr : "");
MEM_freeN(opstr);
}
- if(but->rnaprop) {
+ if (but->rnaprop) {
BLI_dynstr_appendf(ds, "'rna':'%s.%s[%d]', ", RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop), but->rnaindex);
}
@@ -2746,38 +2751,38 @@ static void ui_intro_items(DynStr *ds, ListBase *lb)
BLI_dynstr_append(ds, "[");
- for(item=lb->first; item; item=item->next) {
+ for (item = lb->first; item; item = item->next) {
BLI_dynstr_append(ds, "{");
/* could also use the INT but this is nicer*/
- switch(item->type) {
- case ITEM_BUTTON: BLI_dynstr_append(ds, "'type':'BUTTON', ");break;
- case ITEM_LAYOUT_ROW: BLI_dynstr_append(ds, "'type':'ROW', "); break;
- case ITEM_LAYOUT_COLUMN: BLI_dynstr_append(ds, "'type':'COLUMN', "); break;
- case ITEM_LAYOUT_COLUMN_FLOW:BLI_dynstr_append(ds, "'type':'COLUMN_FLOW', "); break;
- case ITEM_LAYOUT_ROW_FLOW: BLI_dynstr_append(ds, "'type':'ROW_FLOW', "); break;
- case ITEM_LAYOUT_BOX: BLI_dynstr_append(ds, "'type':'BOX', "); break;
- case ITEM_LAYOUT_ABSOLUTE: BLI_dynstr_append(ds, "'type':'ABSOLUTE', "); break;
- case ITEM_LAYOUT_SPLIT: BLI_dynstr_append(ds, "'type':'SPLIT', "); break;
- case ITEM_LAYOUT_OVERLAP: BLI_dynstr_append(ds, "'type':'OVERLAP', "); break;
- case ITEM_LAYOUT_ROOT: BLI_dynstr_append(ds, "'type':'ROOT', "); break;
- default: BLI_dynstr_append(ds, "'type':'UNKNOWN', "); break;
+ switch (item->type) {
+ case ITEM_BUTTON: BLI_dynstr_append(ds, "'type':'BUTTON', "); break;
+ case ITEM_LAYOUT_ROW: BLI_dynstr_append(ds, "'type':'ROW', "); break;
+ case ITEM_LAYOUT_COLUMN: BLI_dynstr_append(ds, "'type':'COLUMN', "); break;
+ case ITEM_LAYOUT_COLUMN_FLOW: BLI_dynstr_append(ds, "'type':'COLUMN_FLOW', "); break;
+ case ITEM_LAYOUT_ROW_FLOW: BLI_dynstr_append(ds, "'type':'ROW_FLOW', "); break;
+ case ITEM_LAYOUT_BOX: BLI_dynstr_append(ds, "'type':'BOX', "); break;
+ case ITEM_LAYOUT_ABSOLUTE: BLI_dynstr_append(ds, "'type':'ABSOLUTE', "); break;
+ case ITEM_LAYOUT_SPLIT: BLI_dynstr_append(ds, "'type':'SPLIT', "); break;
+ case ITEM_LAYOUT_OVERLAP: BLI_dynstr_append(ds, "'type':'OVERLAP', "); break;
+ case ITEM_LAYOUT_ROOT: BLI_dynstr_append(ds, "'type':'ROOT', "); break;
+ default: BLI_dynstr_append(ds, "'type':'UNKNOWN', "); break;
}
- switch(item->type) {
- case ITEM_BUTTON:
- ui_intro_button(ds, (uiButtonItem *)item);
- break;
- default:
- BLI_dynstr_append(ds, "'items':");
- ui_intro_items(ds, &((uiLayout*)item)->items);
- break;
+ switch (item->type) {
+ case ITEM_BUTTON:
+ ui_intro_button(ds, (uiButtonItem *)item);
+ break;
+ default:
+ BLI_dynstr_append(ds, "'items':");
+ ui_intro_items(ds, &((uiLayout *)item)->items);
+ break;
}
BLI_dynstr_append(ds, "}");
- if(item != lb->last)
+ if (item != lb->last)
BLI_dynstr_append(ds, ", ");
}
BLI_dynstr_append(ds, "], ");
@@ -2791,7 +2796,7 @@ static void ui_intro_uiLayout(DynStr *ds, uiLayout *layout)
static char *str = NULL; // XXX, constant re-freeing, far from ideal.
const char *uiLayoutIntrospect(uiLayout *layout)
{
- DynStr *ds= BLI_dynstr_new();
+ DynStr *ds = BLI_dynstr_new();
if (str) {
MEM_freeN(str);
@@ -2811,63 +2816,63 @@ static void ui_layout_operator_buts__reset_cb(bContext *UNUSED(C), void *op_pt,
}
/* this function does not initialize the layout, functions can be called on the layout before and after */
-void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,int (*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char label_align, const short flag)
+void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op, int (*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char label_align, const short flag)
{
- if(!op->properties) {
+ if (!op->properties) {
IDPropertyTemplate val = {0};
- op->properties= IDP_New(IDP_GROUP, &val, "wmOperatorProperties");
+ op->properties = IDP_New(IDP_GROUP, &val, "wmOperatorProperties");
}
- if(flag & UI_LAYOUT_OP_SHOW_TITLE) {
+ if (flag & UI_LAYOUT_OP_SHOW_TITLE) {
uiItemL(layout, op->type->name, ICON_NONE);
}
/* poll() on this operator may still fail, at the moment there is no nice feedback when this happens
* just fails silently */
- if(!WM_operator_repeat_check(C, op)) {
+ if (!WM_operator_repeat_check(C, op)) {
uiBlockSetButLock(uiLayoutGetBlock(layout), TRUE, "Operator cannot redo");
uiItemL(layout, "* Redo Unsupported *", ICON_NONE); // XXX, could give some nicer feedback or not show redo panel at all?
}
/* menu */
- if(op->type->flag & OPTYPE_PRESET) {
+ if (op->type->flag & OPTYPE_PRESET) {
/* XXX, no simple way to get WM_MT_operator_presets.bl_label from python! Label remains the same always! */
PointerRNA op_ptr;
uiLayout *row;
- uiLayoutGetBlock(layout)->ui_operator= op;
+ uiLayoutGetBlock(layout)->ui_operator = op;
- row= uiLayoutRow(layout, TRUE);
+ row = uiLayoutRow(layout, TRUE);
uiItemM(row, (bContext *)C, "WM_MT_operator_presets", NULL, ICON_NONE);
WM_operator_properties_create(&op_ptr, "WM_OT_operator_preset_add");
RNA_string_set(&op_ptr, "operator", op->type->idname);
- op_ptr= uiItemFullO(row, "WM_OT_operator_preset_add", "", ICON_ZOOMIN, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
+ op_ptr = uiItemFullO(row, "WM_OT_operator_preset_add", "", ICON_ZOOMIN, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
WM_operator_properties_create(&op_ptr, "WM_OT_operator_preset_add");
RNA_string_set(&op_ptr, "operator", op->type->idname);
RNA_boolean_set(&op_ptr, "remove_active", TRUE);
- op_ptr= uiItemFullO(row, "WM_OT_operator_preset_add", "", ICON_ZOOMOUT, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
+ op_ptr = uiItemFullO(row, "WM_OT_operator_preset_add", "", ICON_ZOOMOUT, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
}
- if(op->type->ui) {
- op->layout= layout;
- op->type->ui((bContext*)C, op);
- op->layout= NULL;
+ if (op->type->ui) {
+ op->layout = layout;
+ op->type->ui((bContext *)C, op);
+ op->layout = NULL;
/* UI_LAYOUT_OP_SHOW_EMPTY ignored */
}
else {
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
PointerRNA ptr;
int empty;
RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
/* main draw call */
- empty= uiDefAutoButsRNA(layout, &ptr, check_prop, label_align) == 0;
+ empty = uiDefAutoButsRNA(layout, &ptr, check_prop, label_align) == 0;
- if(empty && (flag & UI_LAYOUT_OP_SHOW_EMPTY)) {
+ if (empty && (flag & UI_LAYOUT_OP_SHOW_EMPTY)) {
uiItemL(layout, IFACE_("No Properties"), ICON_NONE);
}
}
@@ -2880,10 +2885,10 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,in
uiBut *but;
uiLayout *col; /* needed to avoid alignment errors with previous buttons */
- 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");
+ col = uiLayoutColumn(layout, 0);
+ block = uiLayoutGetBlock(col);
+ 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);
}
@@ -2891,7 +2896,7 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,in
{
uiBut *but;
- for(but= uiLayoutGetBlock(layout)->buttons.first; but; but= but->next) {
+ for (but = uiLayoutGetBlock(layout)->buttons.first; but; but = but->next) {
/* no undo for buttons for operator redo panels */
uiButClearFlag(but, UI_BUT_UNDO);
@@ -2908,7 +2913,7 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,in
/* this is a bit of a hack but best keep it in one place at least */
MenuType *uiButGetMenuType(uiBut *but)
{
- if(but->menu_create_func == ui_item_menutype_func) {
+ if (but->menu_create_func == ui_item_menutype_func) {
return (MenuType *)but->poin;
}
else {
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index 0521ecbf0d0..ebaef26082f 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -78,7 +78,7 @@ static int eyedropper_init(bContext *C, wmOperator *op)
{
Eyedropper *eye;
- op->customdata= eye= MEM_callocN(sizeof(Eyedropper), "Eyedropper");
+ op->customdata = eye = MEM_callocN(sizeof(Eyedropper), "Eyedropper");
uiContextActiveProperty(C, &eye->ptr, &eye->prop, &eye->index);
@@ -89,9 +89,9 @@ static void eyedropper_exit(bContext *C, wmOperator *op)
{
WM_cursor_restore(CTX_wm_window(C));
- if(op->customdata)
+ if (op->customdata)
MEM_freeN(op->customdata);
- op->customdata= NULL;
+ op->customdata = NULL;
}
static int eyedropper_cancel(bContext *C, wmOperator *op)
@@ -102,7 +102,7 @@ static int eyedropper_cancel(bContext *C, wmOperator *op)
static void eyedropper_sample(bContext *C, Eyedropper *eye, int mx, int my)
{
- if(RNA_property_type(eye->prop) == PROP_FLOAT) {
+ if (RNA_property_type(eye->prop) == PROP_FLOAT) {
Scene *scene = CTX_data_scene(C);
const int color_manage = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT;
float col[4];
@@ -130,12 +130,12 @@ static int eyedropper_modal(bContext *C, wmOperator *op, wmEvent *event)
{
Eyedropper *eye = (Eyedropper *)op->customdata;
- switch(event->type) {
+ switch (event->type) {
case ESCKEY:
case RIGHTMOUSE:
return eyedropper_cancel(C, op);
case LEFTMOUSE:
- if(event->val==KM_RELEASE) {
+ if (event->val == KM_RELEASE) {
eyedropper_sample(C, eye, event->x, event->y);
eyedropper_exit(C, op);
return OPERATOR_FINISHED;
@@ -157,14 +157,15 @@ static int eyedropper_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
WM_event_add_modal_handler(C, op);
return OPERATOR_RUNNING_MODAL;
- } else {
+ }
+ else {
eyedropper_exit(C, op);
return OPERATOR_CANCELLED;
}
}
/* Repeat operator */
-static int eyedropper_exec (bContext *C, wmOperator *op)
+static int eyedropper_exec(bContext *C, wmOperator *op)
{
/* init */
if (eyedropper_init(C, op)) {
@@ -175,7 +176,8 @@ static int eyedropper_exec (bContext *C, wmOperator *op)
eyedropper_exit(C, op);
return OPERATOR_FINISHED;
- } else {
+ }
+ else {
return OPERATOR_CANCELLED;
}
}
@@ -189,19 +191,19 @@ static int eyedropper_poll(bContext *C)
static void UI_OT_eyedropper(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Eyedropper";
- ot->idname= "UI_OT_eyedropper";
- ot->description= "Sample a color from the Blender Window to store in a property";
+ ot->name = "Eyedropper";
+ ot->idname = "UI_OT_eyedropper";
+ ot->description = "Sample a color from the Blender Window to store in a property";
/* api callbacks */
- ot->invoke= eyedropper_invoke;
- ot->modal= eyedropper_modal;
- ot->cancel= eyedropper_cancel;
- ot->exec= eyedropper_exec;
- ot->poll= eyedropper_poll;
+ ot->invoke = eyedropper_invoke;
+ ot->modal = eyedropper_modal;
+ ot->cancel = eyedropper_cancel;
+ ot->exec = eyedropper_exec;
+ ot->poll = eyedropper_poll;
/* flags */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
/* properties */
}
@@ -219,15 +221,15 @@ static int reset_default_theme_exec(bContext *C, wmOperator *UNUSED(op))
static void UI_OT_reset_default_theme(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reset to Default Theme";
- ot->idname= "UI_OT_reset_default_theme";
- ot->description= "Reset to the default theme colors";
+ ot->name = "Reset to Default Theme";
+ ot->idname = "UI_OT_reset_default_theme";
+ ot->description = "Reset to the default theme colors";
/* callbacks */
- ot->exec= reset_default_theme_exec;
+ ot->exec = reset_default_theme_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
}
/* Copy Data Path Operator ------------------------ */
@@ -237,14 +239,14 @@ static int copy_data_path_button_exec(bContext *C, wmOperator *UNUSED(op))
PointerRNA ptr;
PropertyRNA *prop;
char *path;
- int success= 0;
+ int success = 0;
int index;
/* try to create driver using property retrieved from UI */
uiContextActiveProperty(C, &ptr, &prop, &index);
if (ptr.id.data && ptr.data && prop) {
- path= RNA_path_from_ID_to_property(&ptr, prop);
+ path = RNA_path_from_ID_to_property(&ptr, prop);
if (path) {
WM_clipboard_text_set(path, FALSE);
@@ -253,22 +255,22 @@ static int copy_data_path_button_exec(bContext *C, wmOperator *UNUSED(op))
}
/* since we're just copying, we don't really need to do anything else...*/
- return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED;
+ return (success) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}
static void UI_OT_copy_data_path_button(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Data Path";
- ot->idname= "UI_OT_copy_data_path_button";
- ot->description= "Copy the RNA data path for this property to the clipboard";
+ ot->name = "Copy Data Path";
+ ot->idname = "UI_OT_copy_data_path_button";
+ ot->description = "Copy the RNA data path for this property to the clipboard";
/* callbacks */
- ot->exec= copy_data_path_button_exec;
+ ot->exec = copy_data_path_button_exec;
//op->poll= ??? // TODO: need to have some valid property before this can be done
/* flags */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
}
/* Reset to Default Values Button Operator ------------------------ */
@@ -288,7 +290,7 @@ static int reset_default_button_exec(bContext *C, wmOperator *op)
{
PointerRNA ptr;
PropertyRNA *prop;
- int success= 0;
+ int success = 0;
int index, all = RNA_boolean_get(op->ptr, "all");
/* try to reset the nominated setting to its default value */
@@ -296,23 +298,23 @@ static int reset_default_button_exec(bContext *C, wmOperator *op)
/* if there is a valid property that is editable... */
if (ptr.data && prop && RNA_property_editable(&ptr, prop)) {
- if(RNA_property_reset(&ptr, prop, (all)? -1: index)) {
+ if (RNA_property_reset(&ptr, prop, (all) ? -1 : index)) {
/* perform updates required for this property */
RNA_property_update(C, &ptr, prop);
/* as if we pressed the button */
uiContextActivePropertyHandle(C);
- success= 1;
+ success = 1;
}
}
- /* Since we dont want to undo _all_ edits to settings, eg window
+ /* Since we don't want to undo _all_ edits to settings, eg window
* edits on the screen or on operator settings.
* it might be better to move undo's inline - campbell */
- if(success) {
- ID *id= ptr.id.data;
- if(id && ID_CHECK_UNDO(id)) {
+ if (success) {
+ ID *id = ptr.id.data;
+ if (id && ID_CHECK_UNDO(id)) {
/* do nothing, go ahead with undo */
}
else {
@@ -321,22 +323,22 @@ static int reset_default_button_exec(bContext *C, wmOperator *op)
}
/* end hack */
- return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED;
+ return (success) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}
static void UI_OT_reset_default_button(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reset to Default Value";
- ot->idname= "UI_OT_reset_default_button";
- ot->description= "Reset this property's value to its default value";
+ ot->name = "Reset to Default Value";
+ ot->idname = "UI_OT_reset_default_button";
+ ot->description = "Reset this property's value to its default value";
/* callbacks */
- ot->poll= reset_default_button_poll;
- ot->exec= reset_default_button_exec;
+ ot->poll = reset_default_button_poll;
+ ot->exec = reset_default_button_exec;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "all", 1, "All", "Reset to default values all elements of the array");
@@ -346,13 +348,13 @@ static void UI_OT_reset_default_button(wmOperatorType *ot)
static int copy_to_selected_list(bContext *C, PointerRNA *ptr, ListBase *lb)
{
- if(RNA_struct_is_a(ptr->type, &RNA_Object))
+ if (RNA_struct_is_a(ptr->type, &RNA_Object))
*lb = CTX_data_collection_get(C, "selected_editable_objects");
- else if(RNA_struct_is_a(ptr->type, &RNA_EditBone))
+ else if (RNA_struct_is_a(ptr->type, &RNA_EditBone))
*lb = CTX_data_collection_get(C, "selected_editable_bones");
- else if(RNA_struct_is_a(ptr->type, &RNA_PoseBone))
+ else if (RNA_struct_is_a(ptr->type, &RNA_PoseBone))
*lb = CTX_data_collection_get(C, "selected_pose_bones");
- else if(RNA_struct_is_a(ptr->type, &RNA_Sequence))
+ else if (RNA_struct_is_a(ptr->type, &RNA_Sequence))
*lb = CTX_data_collection_get(C, "selected_editable_sequences");
else
return 0;
@@ -364,7 +366,7 @@ static int copy_to_selected_button_poll(bContext *C)
{
PointerRNA ptr;
PropertyRNA *prop;
- int index, success= 0;
+ int index, success = 0;
uiContextActiveProperty(C, &ptr, &prop, &index);
@@ -372,10 +374,10 @@ static int copy_to_selected_button_poll(bContext *C)
CollectionPointerLink *link;
ListBase lb;
- if(copy_to_selected_list(C, &ptr, &lb)) {
- for(link= lb.first; link; link=link->next)
- if(link->ptr.data != ptr.data && RNA_property_editable(&link->ptr, prop))
- success= 1;
+ if (copy_to_selected_list(C, &ptr, &lb)) {
+ for (link = lb.first; link; link = link->next)
+ if (link->ptr.data != ptr.data && RNA_property_editable(&link->ptr, prop))
+ success = 1;
BLI_freelistN(&lb);
}
@@ -388,7 +390,7 @@ static int copy_to_selected_button_exec(bContext *C, wmOperator *op)
{
PointerRNA ptr;
PropertyRNA *prop;
- int success= 0;
+ int success = 0;
int index, all = RNA_boolean_get(op->ptr, "all");
/* try to reset the nominated setting to its default value */
@@ -399,12 +401,12 @@ static int copy_to_selected_button_exec(bContext *C, wmOperator *op)
CollectionPointerLink *link;
ListBase lb;
- if(copy_to_selected_list(C, &ptr, &lb)) {
- for(link= lb.first; link; link=link->next) {
- if(link->ptr.data != ptr.data && RNA_property_editable(&link->ptr, prop)) {
- if(RNA_property_copy(&link->ptr, &ptr, prop, (all)? -1: index)) {
+ if (copy_to_selected_list(C, &ptr, &lb)) {
+ for (link = lb.first; link; link = link->next) {
+ if (link->ptr.data != ptr.data && RNA_property_editable(&link->ptr, prop)) {
+ if (RNA_property_copy(&link->ptr, &ptr, prop, (all) ? -1 : index)) {
RNA_property_update(C, &link->ptr, prop);
- success= 1;
+ success = 1;
}
}
}
@@ -413,22 +415,22 @@ static int copy_to_selected_button_exec(bContext *C, wmOperator *op)
}
}
- return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED;
+ return (success) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}
static void UI_OT_copy_to_selected_button(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy To Selected";
- ot->idname= "UI_OT_copy_to_selected_button";
- ot->description= "Copy property from this object to selected objects or bones";
+ ot->name = "Copy To Selected";
+ ot->idname = "UI_OT_copy_to_selected_button";
+ ot->description = "Copy property from this object to selected objects or bones";
/* callbacks */
- ot->poll= copy_to_selected_button_poll;
- ot->exec= copy_to_selected_button_exec;
+ ot->poll = copy_to_selected_button_poll;
+ ot->exec = copy_to_selected_button_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "all", 1, "All", "Reset to default values all elements of the array");
@@ -458,7 +460,7 @@ static int reports_to_text_exec(bContext *C, wmOperator *UNUSED(op))
* - if commandline debug option enabled, show debug reports too
* - otherwise, up to info (which is what users normally see)
*/
- str = BKE_reports_string(reports, (G.f & G_DEBUG)? RPT_DEBUG : RPT_INFO);
+ str = BKE_reports_string(reports, (G.debug & G_DEBUG) ? RPT_DEBUG : RPT_INFO);
if (str) {
write_text(txt, str);
@@ -474,20 +476,20 @@ static int reports_to_text_exec(bContext *C, wmOperator *UNUSED(op))
static void UI_OT_reports_to_textblock(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reports to Text Block";
- ot->idname= "UI_OT_reports_to_textblock";
- ot->description= "Write the reports ";
+ ot->name = "Reports to Text Block";
+ ot->idname = "UI_OT_reports_to_textblock";
+ ot->description = "Write the reports ";
/* callbacks */
- ot->poll= reports_to_text_poll;
- ot->exec= reports_to_text_exec;
+ ot->poll = reports_to_text_poll;
+ ot->exec = reports_to_text_exec;
}
#ifdef WITH_PYTHON
/* ------------------------------------------------------------------------- */
/* 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;
@@ -500,7 +502,7 @@ struct uiEditSourceButStore {
} uiEditSourceButStore;
/* should only ever be set while the edit source operator is running */
-static struct uiEditSourceStore *ui_editsource_info= NULL;
+static struct uiEditSourceStore *ui_editsource_info = NULL;
int UI_editsource_enable_check(void)
{
@@ -511,7 +513,7 @@ static void ui_editsource_active_but_set(uiBut *but)
{
BLI_assert(ui_editsource_info == NULL);
- ui_editsource_info= MEM_callocN(sizeof(uiEditSourceStore), __func__);
+ ui_editsource_info = MEM_callocN(sizeof(uiEditSourceStore), __func__);
memcpy(&ui_editsource_info->but_orig, but, sizeof(uiBut));
ui_editsource_info->hash = BLI_ghash_new(BLI_ghashutil_ptrhash,
@@ -523,7 +525,7 @@ static void ui_editsource_active_but_clear(void)
{
BLI_ghash_free(ui_editsource_info->hash, NULL, (GHashValFreeFP)MEM_freeN);
MEM_freeN(ui_editsource_info);
- ui_editsource_info= NULL;
+ ui_editsource_info = NULL;
}
static int ui_editsource_uibut_match(uiBut *but_a, uiBut *but_b)
@@ -536,16 +538,16 @@ static int ui_editsource_uibut_match(uiBut *but_a, uiBut *but_b)
/* this just needs to be a 'good-enough' comparison so we can know beyond
* reasonable doubt that these buttons are the same between redraws.
* if this fails it only means edit-source fails - campbell */
- if( (but_a->x1 == but_b->x1) &&
- (but_a->x2 == but_b->x2) &&
- (but_a->y1 == but_b->y1) &&
- (but_a->y2 == but_b->y2) &&
- (but_a->type == but_b->type) &&
- (but_a->rnaprop == but_b->rnaprop) &&
- (but_a->optype == but_b->optype) &&
- (but_a->unit_type == but_b->unit_type) &&
- strncmp(but_a->drawstr, but_b->drawstr, UI_MAX_DRAW_STR) == 0
- ) {
+ if ((but_a->x1 == but_b->x1) &&
+ (but_a->x2 == but_b->x2) &&
+ (but_a->y1 == but_b->y1) &&
+ (but_a->y2 == but_b->y2) &&
+ (but_a->type == but_b->type) &&
+ (but_a->rnaprop == but_b->rnaprop) &&
+ (but_a->optype == but_b->optype) &&
+ (but_a->unit_type == but_b->unit_type) &&
+ (strncmp(but_a->drawstr, but_b->drawstr, UI_MAX_DRAW_STR) == 0))
+ {
return TRUE;
}
else {
@@ -557,10 +559,10 @@ void UI_editsource_active_but_test(uiBut *but)
{
extern void PyC_FileAndNum_Safe(const char **filename, int *lineno);
- struct uiEditSourceButStore *but_store= MEM_callocN(sizeof(uiEditSourceButStore), __func__);
+ struct uiEditSourceButStore *but_store = MEM_callocN(sizeof(uiEditSourceButStore), __func__);
const char *fn;
- int lineno= -1;
+ int lineno = -1;
#if 0
printf("comparing buttons: '%s' == '%s'\n",
@@ -571,12 +573,12 @@ void UI_editsource_active_but_test(uiBut *but)
if (lineno != -1) {
BLI_strncpy(but_store->py_dbg_fn, fn,
- sizeof(but_store->py_dbg_fn));
- but_store->py_dbg_ln= lineno;
+ sizeof(but_store->py_dbg_fn));
+ but_store->py_dbg_ln = lineno;
}
else {
- but_store->py_dbg_fn[0]= '\0';
- but_store->py_dbg_ln= -1;
+ but_store->py_dbg_fn[0] = '\0';
+ but_store->py_dbg_ln = -1;
}
BLI_ghash_insert(ui_editsource_info->hash, but, but_store);
@@ -587,17 +589,17 @@ void UI_editsource_active_but_test(uiBut *but)
static int editsource_text_edit(bContext *C, wmOperator *op,
char filepath[FILE_MAX], int line)
{
- struct Main *bmain= CTX_data_main(C);
+ struct Main *bmain = CTX_data_main(C);
Text *text;
- for (text=bmain->text.first; text; text=text->id.next) {
+ for (text = bmain->text.first; text; text = text->id.next) {
if (text->name && BLI_path_cmp(text->name, filepath) == 0) {
break;
}
}
if (text == NULL) {
- text= add_text(filepath, bmain->name);
+ text = add_text(filepath, bmain->name);
}
if (text == NULL) {
@@ -608,10 +610,10 @@ static int editsource_text_edit(bContext *C, wmOperator *op,
else {
/* naughty!, find text area to set, not good behavior
* but since this is a dev tool lets allow it - campbell */
- ScrArea *sa= BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_TEXT, 0);
- if(sa) {
- SpaceText *st= sa->spacedata.first;
- st->text= text;
+ ScrArea *sa = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_TEXT, 0);
+ if (sa) {
+ SpaceText *st = sa->spacedata.first;
+ st->text = text;
}
else {
BKE_reportf(op->reports, RPT_INFO,
@@ -619,7 +621,7 @@ static int editsource_text_edit(bContext *C, wmOperator *op,
}
txt_move_toline(text, line - 1, FALSE);
- WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text);
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, text);
}
return OPERATOR_FINISHED;
@@ -627,13 +629,13 @@ static int editsource_text_edit(bContext *C, wmOperator *op,
static int editsource_exec(bContext *C, wmOperator *op)
{
- uiBut *but= uiContextActiveButton(C);
+ uiBut *but = uiContextActiveButton(C);
if (but) {
GHashIterator ghi;
- struct uiEditSourceButStore *but_store= NULL;
+ struct uiEditSourceButStore *but_store = NULL;
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
int ret;
/* needed else the active button does not get tested */
@@ -647,13 +649,13 @@ static int editsource_exec(bContext *C, wmOperator *op)
/* redraw and get active button python info */
ED_region_do_draw(C, ar);
- for(BLI_ghashIterator_init(&ghi, ui_editsource_info->hash);
- !BLI_ghashIterator_isDone(&ghi);
- BLI_ghashIterator_step(&ghi))
+ for (BLI_ghashIterator_init(&ghi, ui_editsource_info->hash);
+ !BLI_ghashIterator_isDone(&ghi);
+ BLI_ghashIterator_step(&ghi))
{
- uiBut *but= BLI_ghashIterator_getKey(&ghi);
+ uiBut *but = BLI_ghashIterator_getKey(&ghi);
if (but && ui_editsource_uibut_match(&ui_editsource_info->but_orig, but)) {
- but_store= BLI_ghashIterator_getValue(&ghi);
+ but_store = BLI_ghashIterator_getValue(&ghi);
break;
}
@@ -661,20 +663,20 @@ static int editsource_exec(bContext *C, wmOperator *op)
if (but_store) {
if (but_store->py_dbg_ln != -1) {
- ret= editsource_text_edit(C, op,
- but_store->py_dbg_fn,
- but_store->py_dbg_ln);
+ ret = editsource_text_edit(C, op,
+ but_store->py_dbg_fn,
+ but_store->py_dbg_ln);
}
else {
BKE_report(op->reports, RPT_ERROR,
- "Active button isn't from a script, cant edit source.");
- ret= OPERATOR_CANCELLED;
+ "Active button isn't from a script, cant edit source.");
+ ret = OPERATOR_CANCELLED;
}
}
else {
BKE_report(op->reports, RPT_ERROR,
- "Active button match can't be found.");
- ret= OPERATOR_CANCELLED;
+ "Active button match can't be found.");
+ ret = OPERATOR_CANCELLED;
}
@@ -693,12 +695,12 @@ static int editsource_exec(bContext *C, wmOperator *op)
static void UI_OT_editsource(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reports to Text Block";
- ot->idname= "UI_OT_editsource";
- ot->description= "Edit source code for a button";
+ ot->name = "Reports to Text Block";
+ ot->idname = "UI_OT_editsource";
+ ot->description = "Edit source code for a button";
/* callbacks */
- ot->exec= editsource_exec;
+ ot->exec = editsource_exec;
}
#endif /* WITH_PYTHON */
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index d802c8640b8..0be1761eaf5 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -65,15 +65,15 @@
/*********************** defines and structs ************************/
-#define ANIMATION_TIME 0.30
-#define ANIMATION_INTERVAL 0.02
+#define ANIMATION_TIME 0.30
+#define ANIMATION_INTERVAL 0.02
-#define PNL_LAST_ADDED 1
-#define PNL_ACTIVE 2
-#define PNL_WAS_ACTIVE 4
-#define PNL_ANIM_ALIGN 8
-#define PNL_NEW_ADDED 16
-#define PNL_FIRST 32
+#define PNL_LAST_ADDED 1
+#define PNL_ACTIVE 2
+#define PNL_WAS_ACTIVE 4
+#define PNL_ANIM_ALIGN 8
+#define PNL_NEW_ADDED 16
+#define PNL_FIRST 32
typedef enum uiHandlePanelState {
PANEL_STATE_DRAG,
@@ -103,17 +103,17 @@ static void panel_activate_state(const bContext *C, Panel *pa, uiHandlePanelStat
static int panel_aligned(ScrArea *sa, ARegion *ar)
{
- if(sa->spacetype==SPACE_BUTS && ar->regiontype == RGN_TYPE_WINDOW) {
- SpaceButs *sbuts= sa->spacedata.first;
+ if (sa->spacetype == SPACE_BUTS && ar->regiontype == RGN_TYPE_WINDOW) {
+ SpaceButs *sbuts = sa->spacedata.first;
return sbuts->align;
}
- else if(sa->spacetype==SPACE_USERPREF && ar->regiontype == RGN_TYPE_WINDOW)
+ else if (sa->spacetype == SPACE_USERPREF && ar->regiontype == RGN_TYPE_WINDOW)
return BUT_VERTICAL;
- else if(sa->spacetype==SPACE_FILE && ar->regiontype == RGN_TYPE_CHANNELS)
+ else if (sa->spacetype == SPACE_FILE && ar->regiontype == RGN_TYPE_CHANNELS)
return BUT_VERTICAL;
- else if(sa->spacetype==SPACE_IMAGE && ar->regiontype == RGN_TYPE_PREVIEW)
+ else if (sa->spacetype == SPACE_IMAGE && ar->regiontype == RGN_TYPE_PREVIEW)
return BUT_VERTICAL;
- else if(ELEM3(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS))
+ else if (ELEM3(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS))
return BUT_VERTICAL;
return 0;
@@ -122,39 +122,39 @@ static int panel_aligned(ScrArea *sa, ARegion *ar)
static int panels_re_align(ScrArea *sa, ARegion *ar, Panel **r_pa)
{
Panel *pa;
- int active= 0;
+ int active = 0;
- *r_pa= NULL;
+ *r_pa = NULL;
- if(sa->spacetype==SPACE_BUTS && ar->regiontype == RGN_TYPE_WINDOW) {
- SpaceButs *sbuts= sa->spacedata.first;
+ if (sa->spacetype == SPACE_BUTS && ar->regiontype == RGN_TYPE_WINDOW) {
+ SpaceButs *sbuts = sa->spacedata.first;
- if(sbuts->align)
- if(sbuts->re_align || sbuts->mainbo!=sbuts->mainb)
+ if (sbuts->align)
+ if (sbuts->re_align || sbuts->mainbo != sbuts->mainb)
return 1;
}
- else if(ar->regiontype==RGN_TYPE_UI)
+ else if (ar->regiontype == RGN_TYPE_UI)
return 1;
- else if(sa->spacetype==SPACE_IMAGE && ar->regiontype == RGN_TYPE_PREVIEW)
+ else if (sa->spacetype == SPACE_IMAGE && ar->regiontype == RGN_TYPE_PREVIEW)
return 1;
- else if(sa->spacetype==SPACE_FILE && ar->regiontype == RGN_TYPE_CHANNELS)
+ else if (sa->spacetype == SPACE_FILE && ar->regiontype == RGN_TYPE_CHANNELS)
return 1;
/* in case panel is added or disappears */
- for(pa=ar->panels.first; pa; pa=pa->next) {
- if((pa->runtime_flag & PNL_WAS_ACTIVE) && !(pa->runtime_flag & PNL_ACTIVE))
+ for (pa = ar->panels.first; pa; pa = pa->next) {
+ if ((pa->runtime_flag & PNL_WAS_ACTIVE) && !(pa->runtime_flag & PNL_ACTIVE))
return 1;
- if(!(pa->runtime_flag & PNL_WAS_ACTIVE) && (pa->runtime_flag & PNL_ACTIVE))
+ if (!(pa->runtime_flag & PNL_WAS_ACTIVE) && (pa->runtime_flag & PNL_ACTIVE))
return 1;
- if(pa->activedata)
- active= 1;
+ if (pa->activedata)
+ active = 1;
}
/* in case we need to do an animation (size changes) */
- for(pa=ar->panels.first; pa; pa=pa->next) {
- if(pa->runtime_flag & PNL_ANIM_ALIGN) {
- if(!active)
- *r_pa= pa;
+ for (pa = ar->panels.first; pa; pa = pa->next) {
+ if (pa->runtime_flag & PNL_ANIM_ALIGN) {
+ if (!active)
+ *r_pa = pa;
return 1;
}
}
@@ -168,60 +168,60 @@ static void ui_panel_copy_offset(Panel *pa, Panel *papar)
{
/* with respect to sizes... papar is parent */
- pa->ofsx= papar->ofsx;
- pa->ofsy= papar->ofsy + papar->sizey-pa->sizey;
+ pa->ofsx = papar->ofsx;
+ pa->ofsy = papar->ofsy + papar->sizey - pa->sizey;
}
Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, int *open)
{
Panel *pa, *patab, *palast, *panext;
- char *drawname= pt->label;
- char *idname= pt->idname;
- char *tabname= pt->idname;
- char *hookname= NULL;
+ char *drawname = pt->label;
+ char *idname = pt->idname;
+ char *tabname = pt->idname;
+ char *hookname = NULL;
int newpanel;
- int align= panel_aligned(sa, ar);
+ int align = panel_aligned(sa, ar);
/* check if Panel exists, then use that one */
- for(pa=ar->panels.first; pa; pa=pa->next)
- if(strncmp(pa->panelname, idname, UI_MAX_NAME_STR)==0)
- if(strncmp(pa->tabname, tabname, UI_MAX_NAME_STR)==0)
+ for (pa = ar->panels.first; pa; pa = pa->next)
+ if (strncmp(pa->panelname, idname, UI_MAX_NAME_STR) == 0)
+ if (strncmp(pa->tabname, tabname, UI_MAX_NAME_STR) == 0)
break;
- newpanel= (pa == NULL);
+ newpanel = (pa == NULL);
- if(!newpanel) {
- pa->type= pt;
+ if (!newpanel) {
+ pa->type = pt;
}
else {
/* new panel */
- pa= MEM_callocN(sizeof(Panel), "new panel");
- pa->type= pt;
+ pa = MEM_callocN(sizeof(Panel), "new panel");
+ pa->type = pt;
BLI_strncpy(pa->panelname, idname, UI_MAX_NAME_STR);
BLI_strncpy(pa->tabname, tabname, UI_MAX_NAME_STR);
- if(pt->flag & PNL_DEFAULT_CLOSED) {
- if(align == BUT_VERTICAL)
+ if (pt->flag & PNL_DEFAULT_CLOSED) {
+ if (align == BUT_VERTICAL)
pa->flag |= PNL_CLOSEDY;
else
pa->flag |= PNL_CLOSEDX;
}
- pa->ofsx= 0;
- pa->ofsy= 0;
- pa->sizex= 0;
- pa->sizey= 0;
+ pa->ofsx = 0;
+ pa->ofsy = 0;
+ pa->sizex = 0;
+ pa->sizey = 0;
pa->runtime_flag |= PNL_NEW_ADDED;
BLI_addtail(&ar->panels, pa);
/* make new Panel tabbed? */
- if(hookname) {
- for(patab= ar->panels.first; patab; patab= patab->next) {
- if((patab->runtime_flag & PNL_ACTIVE) && patab->paneltab==NULL) {
- if(strncmp(hookname, patab->panelname, UI_MAX_NAME_STR)==0) {
- if(strncmp(tabname, patab->tabname, UI_MAX_NAME_STR)==0) {
- pa->paneltab= patab;
+ if (hookname) {
+ for (patab = ar->panels.first; patab; patab = patab->next) {
+ if ((patab->runtime_flag & PNL_ACTIVE) && patab->paneltab == NULL) {
+ if (strncmp(hookname, patab->panelname, UI_MAX_NAME_STR) == 0) {
+ if (strncmp(tabname, patab->tabname, UI_MAX_NAME_STR) == 0) {
+ pa->paneltab = patab;
ui_panel_copy_offset(pa, patab);
break;
}
@@ -236,79 +236,79 @@ Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, int
/* if a new panel is added, we insert it right after the panel
* that was last added. this way new panels are inserted in the
* right place between versions */
- for(palast=ar->panels.first; palast; palast=palast->next)
- if(palast->runtime_flag & PNL_LAST_ADDED)
+ for (palast = ar->panels.first; palast; palast = palast->next)
+ if (palast->runtime_flag & PNL_LAST_ADDED)
break;
- if(newpanel) {
- pa->sortorder= (palast)? palast->sortorder+1: 0;
+ if (newpanel) {
+ pa->sortorder = (palast) ? palast->sortorder + 1 : 0;
- for(panext=ar->panels.first; panext; panext=panext->next)
- if(panext != pa && panext->sortorder >= pa->sortorder)
+ for (panext = ar->panels.first; panext; panext = panext->next)
+ if (panext != pa && panext->sortorder >= pa->sortorder)
panext->sortorder++;
}
- if(palast)
+ if (palast)
palast->runtime_flag &= ~PNL_LAST_ADDED;
/* assign to block */
- block->panel= pa;
- pa->runtime_flag |= PNL_ACTIVE|PNL_LAST_ADDED;
+ block->panel = pa;
+ pa->runtime_flag |= PNL_ACTIVE | PNL_LAST_ADDED;
- *open= 0;
+ *open = 0;
- if(pa->paneltab) return pa;
- if(pa->flag & PNL_CLOSED) return pa;
+ if (pa->paneltab) return pa;
+ if (pa->flag & PNL_CLOSED) return pa;
- *open= 1;
+ *open = 1;
return pa;
}
void uiEndPanel(uiBlock *block, int width, int height)
{
- Panel *pa= block->panel;
+ Panel *pa = block->panel;
- if(pa->runtime_flag & PNL_NEW_ADDED) {
+ if (pa->runtime_flag & PNL_NEW_ADDED) {
pa->runtime_flag &= ~PNL_NEW_ADDED;
- pa->sizex= width;
- pa->sizey= height;
+ pa->sizex = width;
+ pa->sizey = height;
}
else {
/* check if we need to do an animation */
- if(!ELEM(width, 0, pa->sizex) || !ELEM(height, 0, pa->sizey)) {
+ if (!ELEM(width, 0, pa->sizex) || !ELEM(height, 0, pa->sizey)) {
pa->runtime_flag |= PNL_ANIM_ALIGN;
- if(height != 0)
- pa->ofsy += pa->sizey-height;
+ if (height != 0)
+ pa->ofsy += pa->sizey - height;
}
/* update width/height if non-zero */
- if(width != 0)
- pa->sizex= width;
- if(height != 0)
- pa->sizey= height;
+ if (width != 0)
+ pa->sizex = width;
+ if (height != 0)
+ pa->sizey = height;
}
}
static void ui_offset_panel_block(uiBlock *block)
{
- uiStyle *style= UI_GetStyle();
+ uiStyle *style = UI_GetStyle();
uiBut *but;
int ofsy;
/* compute bounds and offset */
ui_bounds_block(block);
- ofsy= block->panel->sizey - style->panelspace;
+ ofsy = block->panel->sizey - style->panelspace;
- for(but= block->buttons.first; but; but=but->next) {
+ for (but = block->buttons.first; but; but = but->next) {
but->y1 += ofsy;
but->y2 += ofsy;
}
- block->maxx= block->panel->sizex;
- block->maxy= block->panel->sizey;
- block->minx= block->miny= 0.0;
+ block->maxx = block->panel->sizex;
+ block->maxy = block->panel->sizey;
+ block->minx = block->miny = 0.0;
}
/**************************** drawing *******************************/
@@ -319,7 +319,7 @@ static void uiPanelPush(uiBlock *block)
{
glPushMatrix();
- if(block->panel)
+ if (block->panel)
glTranslatef((float)block->panel->ofsx, (float)block->panel->ofsy, 0.0);
}
@@ -332,27 +332,27 @@ static void uiPanelPop(uiBlock *UNUSED(block))
/* triangle 'icon' for panel header */
void UI_DrawTriIcon(float x, float y, char dir)
{
- if(dir=='h') {
- ui_draw_anti_tria( x-3, y-5, x-3, y+5, x+7,y );
+ if (dir == 'h') {
+ ui_draw_anti_tria(x - 3, y - 5, x - 3, y + 5, x + 7, y);
}
- else if(dir=='t') {
- ui_draw_anti_tria( x-5, y-7, x+5, y-7, x, y+3);
+ else if (dir == 't') {
+ ui_draw_anti_tria(x - 5, y - 7, x + 5, y - 7, x, y + 3);
}
else { /* 'v' = vertical, down */
- ui_draw_anti_tria( x-5, y+3, x+5, y+3, x, y-7);
+ ui_draw_anti_tria(x - 5, y + 3, x + 5, y + 3, x, y - 7);
}
}
/* triangle 'icon' inside rect */
static void ui_draw_tria_rect(rctf *rect, char dir)
{
- if(dir=='h') {
- float half= 0.5f*(rect->ymax - rect->ymin);
- ui_draw_anti_tria(rect->xmin, rect->ymin, rect->xmin, rect->ymax, rect->xmax, rect->ymin+half);
+ if (dir == 'h') {
+ float half = 0.5f * (rect->ymax - rect->ymin);
+ ui_draw_anti_tria(rect->xmin, rect->ymin, rect->xmin, rect->ymax, rect->xmax, rect->ymin + half);
}
else {
- float half= 0.5f*(rect->xmax - rect->xmin);
- ui_draw_anti_tria(rect->xmin, rect->ymax, rect->xmax, rect->ymax, rect->xmin+half, rect->ymin);
+ float half = 0.5f * (rect->xmax - rect->xmin);
+ ui_draw_anti_tria(rect->xmin, rect->ymax, rect->xmax, rect->ymax, rect->xmin + half, rect->ymin);
}
}
@@ -379,33 +379,33 @@ static void ui_draw_anti_x(float x1, float y1, float x2, float y2)
static void ui_draw_x_icon(float x, float y)
{
- ui_draw_anti_x(x, y, x+9.375f, y+9.375f);
+ ui_draw_anti_x(x, y, x + 9.375f, y + 9.375f);
}
-#define PNL_ICON UI_UNIT_X /* could be UI_UNIT_Y too */
+#define PNL_ICON UI_UNIT_X /* could be UI_UNIT_Y too */
static void ui_draw_panel_scalewidget(rcti *rect)
{
float xmin, xmax, dx;
float ymin, ymax, dy;
- xmin= rect->xmax-PNL_HEADER+2;
- xmax= rect->xmax-3;
- ymin= rect->ymin+3;
- ymax= rect->ymin+PNL_HEADER-2;
+ xmin = rect->xmax - PNL_HEADER + 2;
+ xmax = rect->xmax - 3;
+ ymin = rect->ymin + 3;
+ ymax = rect->ymin + PNL_HEADER - 2;
- dx= 0.5f*(xmax-xmin);
- dy= 0.5f*(ymax-ymin);
+ dx = 0.5f * (xmax - xmin);
+ dy = 0.5f * (ymax - ymin);
glEnable(GL_BLEND);
glColor4ub(255, 255, 255, 50);
fdrawline(xmin, ymin, xmax, ymax);
- fdrawline(xmin+dx, ymin, xmax, ymax-dy);
+ fdrawline(xmin + dx, ymin, xmax, ymax - dy);
glColor4ub(0, 0, 0, 50);
- fdrawline(xmin, ymin+1, xmax, ymax+1);
- fdrawline(xmin+dx, ymin+1, xmax, ymax-dy+1);
+ fdrawline(xmin, ymin + 1, xmax, ymax + 1);
+ fdrawline(xmin + dx, ymin + 1, xmax, ymax - dy + 1);
glDisable(GL_BLEND);
}
@@ -414,114 +414,114 @@ static void ui_draw_panel_dragwidget(rctf *rect)
float xmin, xmax, dx;
float ymin, ymax, dy;
- xmin= rect->xmin;
- xmax= rect->xmax;
- ymin= rect->ymin;
- ymax= rect->ymax;
+ xmin = rect->xmin;
+ xmax = rect->xmax;
+ ymin = rect->ymin;
+ ymax = rect->ymax;
- dx= 0.333f*(xmax-xmin);
- dy= 0.333f*(ymax-ymin);
+ dx = 0.333f * (xmax - xmin);
+ dy = 0.333f * (ymax - ymin);
glEnable(GL_BLEND);
glColor4ub(255, 255, 255, 50);
fdrawline(xmin, ymax, xmax, ymin);
- fdrawline(xmin+dx, ymax, xmax, ymin+dy);
- fdrawline(xmin+2*dx, ymax, xmax, ymin+2*dy);
+ fdrawline(xmin + dx, ymax, xmax, ymin + dy);
+ fdrawline(xmin + 2 * dx, ymax, xmax, ymin + 2 * dy);
glColor4ub(0, 0, 0, 50);
- fdrawline(xmin, ymax+1, xmax, ymin+1);
- fdrawline(xmin+dx, ymax+1, xmax, ymin+dy+1);
- fdrawline(xmin+2*dx, ymax+1, xmax, ymin+2*dy+1);
+ fdrawline(xmin, ymax + 1, xmax, ymin + 1);
+ fdrawline(xmin + dx, ymax + 1, xmax, ymin + dy + 1);
+ fdrawline(xmin + 2 * dx, ymax + 1, xmax, ymin + 2 * dy + 1);
glDisable(GL_BLEND);
}
static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *rect, char dir)
{
- Panel *panel= block->panel;
+ Panel *panel = block->panel;
rcti hrect;
- int pnl_icons;
- const char *activename= IFACE_(panel->drawname[0] ? panel->drawname : panel->panelname);
+ int pnl_icons;
+ const char *activename = IFACE_(panel->drawname[0] ? panel->drawname : panel->panelname);
/* + 0.001f to avoid flirting with float inaccuracy */
- if(panel->control & UI_PNL_CLOSE) pnl_icons=(panel->labelofs+2*PNL_ICON+5)/block->aspect + 0.001f;
- else pnl_icons= (panel->labelofs+PNL_ICON+5)/block->aspect + 0.001f;
+ if (panel->control & UI_PNL_CLOSE) pnl_icons = (panel->labelofs + 2 * PNL_ICON + 5) / block->aspect + 0.001f;
+ else pnl_icons = (panel->labelofs + PNL_ICON + 5) / block->aspect + 0.001f;
/* active tab */
/* draw text label */
UI_ThemeColor(TH_TITLE);
- hrect= *rect;
- if(dir == 'h') {
- hrect.xmin= rect->xmin+pnl_icons;
- hrect.ymin += 2.0f/block->aspect;
+ hrect = *rect;
+ if (dir == 'h') {
+ hrect.xmin = rect->xmin + pnl_icons;
+ hrect.ymin += 2.0f / block->aspect;
uiStyleFontDraw(&style->paneltitle, &hrect, activename);
}
else {
/* ignore 'pnl_icons', otherwise the text gets offset horizontally
* + 0.001f to avoid flirting with float inaccuracy
*/
- hrect.xmin= rect->xmin + (PNL_ICON+5)/block->aspect + 0.001f;
+ hrect.xmin = rect->xmin + (PNL_ICON + 5) / block->aspect + 0.001f;
uiStyleFontDrawRotated(&style->paneltitle, &hrect, activename);
}
}
static void rectf_scale(rctf *rect, float scale)
{
- float centx= 0.5f*(rect->xmin+rect->xmax);
- float centy= 0.5f*(rect->ymin+rect->ymax);
- float sizex= 0.5f*scale*(rect->xmax - rect->xmin);
- float sizey= 0.5f*scale*(rect->ymax - rect->ymin);
+ float centx = 0.5f * (rect->xmin + rect->xmax);
+ float centy = 0.5f * (rect->ymin + rect->ymax);
+ float sizex = 0.5f * scale * (rect->xmax - rect->xmin);
+ float sizey = 0.5f * scale * (rect->ymax - rect->ymin);
- rect->xmin= centx - sizex;
- rect->xmax= centx + sizex;
- rect->ymin= centy - sizey;
- rect->ymax= centy + sizey;
+ rect->xmin = centx - sizex;
+ rect->xmax = centx + sizex;
+ rect->ymin = centy - sizey;
+ rect->ymax = centy + sizey;
}
/* panel integrated in buttonswindow, tool/property lists etc */
void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
{
- bTheme *btheme= UI_GetTheme();
- Panel *panel= block->panel;
+ bTheme *btheme = UI_GetTheme();
+ Panel *panel = block->panel;
rcti headrect;
rctf itemrect;
int ofsx;
- if(panel->paneltab) return;
- if(panel->type && (panel->type->flag & PNL_NO_HEADER)) return;
+ if (panel->paneltab) return;
+ if (panel->type && (panel->type->flag & PNL_NO_HEADER)) return;
/* calculate header rect */
/* + 0.001f to prevent flicker due to float inaccuracy */
- headrect= *rect;
- headrect.ymin= headrect.ymax;
- headrect.ymax= headrect.ymin + floor(PNL_HEADER/block->aspect + 0.001f);
+ headrect = *rect;
+ headrect.ymin = headrect.ymax;
+ headrect.ymax = headrect.ymin + floor(PNL_HEADER / block->aspect + 0.001f);
{
- float minx= rect->xmin;
- float maxx= rect->xmax;
- float y= headrect.ymax;
+ float minx = rect->xmin;
+ float maxx = rect->xmax;
+ float y = headrect.ymax;
glEnable(GL_BLEND);
- if(btheme->tui.panel.show_header) {
+ if (btheme->tui.panel.show_header) {
/* draw with background color */
glEnable(GL_BLEND);
- glColor4ubv((unsigned char*)btheme->tui.panel.header);
- glRectf(minx, headrect.ymin+1, maxx, y);
+ glColor4ubv((unsigned char *)btheme->tui.panel.header);
+ glRectf(minx, headrect.ymin + 1, maxx, y);
fdrawline(minx, y, maxx, y);
fdrawline(minx, y, maxx, y);
}
- else if(!(panel->runtime_flag & PNL_FIRST)) {
+ else if (!(panel->runtime_flag & PNL_FIRST)) {
/* draw embossed separator */
- minx += 5.0f/block->aspect;
- maxx -= 5.0f/block->aspect;
+ minx += 5.0f / block->aspect;
+ maxx -= 5.0f / block->aspect;
glColor4f(0.0f, 0.0f, 0.0f, 0.5f);
fdrawline(minx, y, maxx, y);
glColor4f(1.0f, 1.0f, 1.0f, 0.25f);
- fdrawline(minx, y-1, maxx, y-1);
+ fdrawline(minx, y - 1, maxx, y - 1);
glDisable(GL_BLEND);
}
@@ -529,26 +529,26 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
}
/* horizontal title */
- if(!(panel->flag & PNL_CLOSEDX)) {
+ if (!(panel->flag & PNL_CLOSEDX)) {
ui_draw_aligned_panel_header(style, block, &headrect, 'h');
/* itemrect smaller */
- itemrect.xmax= headrect.xmax - 5.0f/block->aspect;
- itemrect.xmin= itemrect.xmax - (headrect.ymax-headrect.ymin);
- itemrect.ymin= headrect.ymin;
- itemrect.ymax= headrect.ymax;
+ itemrect.xmax = headrect.xmax - 5.0f / block->aspect;
+ itemrect.xmin = itemrect.xmax - (headrect.ymax - headrect.ymin);
+ itemrect.ymin = headrect.ymin;
+ itemrect.ymax = headrect.ymax;
rectf_scale(&itemrect, 0.7f);
ui_draw_panel_dragwidget(&itemrect);
}
/* if the panel is minimized vertically:
- * (------)
- */
- if(panel->flag & PNL_CLOSEDY) {
+ * (------)
+ */
+ if (panel->flag & PNL_CLOSEDY) {
}
- else if(panel->flag & PNL_CLOSEDX) {
+ else if (panel->flag & PNL_CLOSEDX) {
/* draw vertical title */
ui_draw_aligned_panel_header(style, block, &headrect, 'v');
}
@@ -556,42 +556,42 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
else {
/* in some occasions, draw a border */
- if(panel->flag & PNL_SELECT) {
- if(panel->control & UI_PNL_SOLID) uiSetRoundBox(UI_CNR_ALL);
+ if (panel->flag & PNL_SELECT) {
+ if (panel->control & UI_PNL_SOLID) uiSetRoundBox(UI_CNR_ALL);
else uiSetRoundBox(UI_CNR_NONE);
UI_ThemeColorShade(TH_BACK, -120);
- uiRoundRect(0.5f + rect->xmin, 0.5f + rect->ymin, 0.5f + rect->xmax, 0.5f + headrect.ymax+1, 8);
+ uiRoundRect(0.5f + rect->xmin, 0.5f + rect->ymin, 0.5f + rect->xmax, 0.5f + headrect.ymax + 1, 8);
}
- if(panel->control & UI_PNL_SCALE)
+ if (panel->control & UI_PNL_SCALE)
ui_draw_panel_scalewidget(rect);
}
/* draw optional close icon */
- ofsx= 6;
- if(panel->control & UI_PNL_CLOSE) {
+ ofsx = 6;
+ if (panel->control & UI_PNL_CLOSE) {
UI_ThemeColor(TH_TEXT);
- ui_draw_x_icon(rect->xmin+2+ofsx, rect->ymax+2);
- ofsx= 22;
+ ui_draw_x_icon(rect->xmin + 2 + ofsx, rect->ymax + 2);
+ ofsx = 22;
}
/* draw collapse icon */
UI_ThemeColor(TH_TEXT);
/* itemrect smaller */
- itemrect.xmin= headrect.xmin + 5.0f/block->aspect;
- itemrect.xmax= itemrect.xmin + (headrect.ymax-headrect.ymin);
- itemrect.ymin= headrect.ymin;
- itemrect.ymax= headrect.ymax;
+ itemrect.xmin = headrect.xmin + 5.0f / block->aspect;
+ itemrect.xmax = itemrect.xmin + (headrect.ymax - headrect.ymin);
+ itemrect.ymin = headrect.ymin;
+ itemrect.ymax = headrect.ymax;
rectf_scale(&itemrect, 0.35f);
- if(panel->flag & PNL_CLOSEDY)
+ if (panel->flag & PNL_CLOSEDY)
ui_draw_tria_rect(&itemrect, 'h');
- else if(panel->flag & PNL_CLOSEDX)
+ else if (panel->flag & PNL_CLOSEDX)
ui_draw_tria_rect(&itemrect, 'h');
else
ui_draw_tria_rect(&itemrect, 'v');
@@ -603,7 +603,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
static int get_panel_header(Panel *pa)
{
- if(pa->type && (pa->type->flag & PNL_NO_HEADER))
+ if (pa->type && (pa->type->flag & PNL_NO_HEADER))
return 0;
return PNL_HEADER;
@@ -611,27 +611,27 @@ static int get_panel_header(Panel *pa)
static int get_panel_size_y(Panel *pa)
{
- if(pa->type && (pa->type->flag & PNL_NO_HEADER))
+ if (pa->type && (pa->type->flag & PNL_NO_HEADER))
return pa->sizey;
return PNL_HEADER + pa->sizey;
}
-/* this function is needed because uiBlock and Panel itself dont
-change sizey or location when closed */
+/* this function is needed because uiBlock and Panel itself don't
+ * change sizey or location when closed */
static int get_panel_real_ofsy(Panel *pa)
{
- if(pa->flag & PNL_CLOSEDY) return pa->ofsy+pa->sizey;
- else if(pa->paneltab && (pa->paneltab->flag & PNL_CLOSEDY)) return pa->ofsy+pa->sizey;
- else if(pa->paneltab) return pa->paneltab->ofsy;
+ if (pa->flag & PNL_CLOSEDY) return pa->ofsy + pa->sizey;
+ else if (pa->paneltab && (pa->paneltab->flag & PNL_CLOSEDY)) return pa->ofsy + pa->sizey;
+ else if (pa->paneltab) return pa->paneltab->ofsy;
else return pa->ofsy;
}
static int get_panel_real_ofsx(Panel *pa)
{
- if(pa->flag & PNL_CLOSEDX) return pa->ofsx+get_panel_header(pa);
- else if(pa->paneltab && (pa->paneltab->flag & PNL_CLOSEDX)) return pa->ofsx+get_panel_header(pa);
- else return pa->ofsx+pa->sizex;
+ if (pa->flag & PNL_CLOSEDX) return pa->ofsx + get_panel_header(pa);
+ else if (pa->paneltab && (pa->paneltab->flag & PNL_CLOSEDX)) return pa->ofsx + get_panel_header(pa);
+ else return pa->ofsx + pa->sizex;
}
typedef struct PanelSort {
@@ -639,19 +639,19 @@ 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)
{
- const PanelSort *ps1=a1, *ps2=a2;
+ const PanelSort *ps1 = a1, *ps2 = a2;
- if(ps1->pa->ofsx > ps2->pa->ofsx) return 1;
- else if(ps1->pa->ofsx < ps2->pa->ofsx) return -1;
- else if(ps1->pa->sortorder > ps2->pa->sortorder) return 1;
- else if(ps1->pa->sortorder < ps2->pa->sortorder) return -1;
+ if (ps1->pa->ofsx > ps2->pa->ofsx) return 1;
+ else if (ps1->pa->ofsx < ps2->pa->ofsx) return -1;
+ else if (ps1->pa->sortorder > ps2->pa->sortorder) return 1;
+ else if (ps1->pa->sortorder < ps2->pa->sortorder) return -1;
return 0;
}
@@ -659,26 +659,26 @@ static int find_leftmost_panel(const void *a1, const void *a2)
static int find_highest_panel(const void *a1, const void *a2)
{
- const PanelSort *ps1=a1, *ps2=a2;
+ const PanelSort *ps1 = a1, *ps2 = a2;
/* stick uppermost header-less panels to the top of the region -
* prevent them from being sorted */
if (ps1->pa->sortorder < ps2->pa->sortorder && ps1->pa->type->flag & PNL_NO_HEADER) return -1;
- if(ps1->pa->ofsy+ps1->pa->sizey < ps2->pa->ofsy+ps2->pa->sizey) return 1;
- else if(ps1->pa->ofsy+ps1->pa->sizey > ps2->pa->ofsy+ps2->pa->sizey) return -1;
- else if(ps1->pa->sortorder > ps2->pa->sortorder) return 1;
- else if(ps1->pa->sortorder < ps2->pa->sortorder) return -1;
+ if (ps1->pa->ofsy + ps1->pa->sizey < ps2->pa->ofsy + ps2->pa->sizey) return 1;
+ else if (ps1->pa->ofsy + ps1->pa->sizey > ps2->pa->ofsy + ps2->pa->sizey) return -1;
+ else if (ps1->pa->sortorder > ps2->pa->sortorder) return 1;
+ else if (ps1->pa->sortorder < ps2->pa->sortorder) return -1;
return 0;
}
static int compare_panel(const void *a1, const void *a2)
{
- const PanelSort *ps1=a1, *ps2=a2;
+ const PanelSort *ps1 = a1, *ps2 = a2;
- if(ps1->pa->sortorder > ps2->pa->sortorder) return 1;
- else if(ps1->pa->sortorder < ps2->pa->sortorder) return -1;
+ if (ps1->pa->sortorder > ps2->pa->sortorder) return 1;
+ else if (ps1->pa->sortorder < ps2->pa->sortorder) return -1;
return 0;
}
@@ -689,86 +689,86 @@ static int uiAlignPanelStep(ScrArea *sa, ARegion *ar, float fac, int drag)
{
Panel *pa;
PanelSort *ps, *panelsort, *psnext;
- int a, tot=0, done;
- int align= panel_aligned(sa, ar);
+ int a, tot = 0, done;
+ int align = panel_aligned(sa, ar);
/* count active, not tabbed panels */
- for(pa= ar->panels.first; pa; pa= pa->next)
- if((pa->runtime_flag & PNL_ACTIVE) && pa->paneltab==NULL)
+ for (pa = ar->panels.first; pa; pa = pa->next)
+ if ((pa->runtime_flag & PNL_ACTIVE) && pa->paneltab == NULL)
tot++;
- if(tot==0) return 0;
+ if (tot == 0) return 0;
/* extra; change close direction? */
- for(pa= ar->panels.first; pa; pa= pa->next) {
- if((pa->runtime_flag & PNL_ACTIVE) && pa->paneltab==NULL) {
- if((pa->flag & PNL_CLOSEDX) && (align==BUT_VERTICAL))
+ for (pa = ar->panels.first; pa; pa = pa->next) {
+ if ((pa->runtime_flag & PNL_ACTIVE) && pa->paneltab == NULL) {
+ if ((pa->flag & PNL_CLOSEDX) && (align == BUT_VERTICAL))
pa->flag ^= PNL_CLOSED;
- else if((pa->flag & PNL_CLOSEDY) && (align==BUT_HORIZONTAL))
+ else if ((pa->flag & PNL_CLOSEDY) && (align == BUT_HORIZONTAL))
pa->flag ^= PNL_CLOSED;
}
}
/* sort panels */
- panelsort= MEM_callocN(tot*sizeof(PanelSort), "panelsort");
+ panelsort = MEM_callocN(tot * sizeof(PanelSort), "panelsort");
- ps= panelsort;
- for(pa= ar->panels.first; pa; pa= pa->next) {
- if((pa->runtime_flag & PNL_ACTIVE) && pa->paneltab==NULL) {
- ps->pa= MEM_dupallocN(pa);
- ps->orig= pa;
+ ps = panelsort;
+ for (pa = ar->panels.first; pa; pa = pa->next) {
+ if ((pa->runtime_flag & PNL_ACTIVE) && pa->paneltab == NULL) {
+ ps->pa = MEM_dupallocN(pa);
+ ps->orig = pa;
ps++;
}
}
- if(drag) {
+ if (drag) {
/* while we are dragging, we sort on location and update sortorder */
- if(align==BUT_VERTICAL)
+ if (align == BUT_VERTICAL)
qsort(panelsort, tot, sizeof(PanelSort), find_highest_panel);
else
qsort(panelsort, tot, sizeof(PanelSort), find_leftmost_panel);
- for(ps=panelsort, a=0; a<tot; a++, ps++)
- ps->orig->sortorder= a;
+ for (ps = panelsort, a = 0; a < tot; a++, ps++)
+ ps->orig->sortorder = a;
}
else
/* otherwise use sortorder */
qsort(panelsort, tot, sizeof(PanelSort), compare_panel);
/* no smart other default start loc! this keeps switching f5/f6/etc compatible */
- ps= panelsort;
- ps->pa->ofsx= 0;
- ps->pa->ofsy= -get_panel_size_y(ps->pa);
+ ps = panelsort;
+ ps->pa->ofsx = 0;
+ ps->pa->ofsy = -get_panel_size_y(ps->pa);
- for(a=0; a<tot-1; a++, ps++) {
- psnext= ps+1;
-
- if(align==BUT_VERTICAL) {
- psnext->pa->ofsx= ps->pa->ofsx;
- psnext->pa->ofsy= get_panel_real_ofsy(ps->pa) - get_panel_size_y(psnext->pa);
+ for (a = 0; a < tot - 1; a++, ps++) {
+ psnext = ps + 1;
+
+ if (align == BUT_VERTICAL) {
+ psnext->pa->ofsx = ps->pa->ofsx;
+ psnext->pa->ofsy = get_panel_real_ofsy(ps->pa) - get_panel_size_y(psnext->pa);
}
else {
- psnext->pa->ofsx= get_panel_real_ofsx(ps->pa);
- psnext->pa->ofsy= ps->pa->ofsy + get_panel_size_y(ps->pa) - get_panel_size_y(psnext->pa);
+ psnext->pa->ofsx = get_panel_real_ofsx(ps->pa);
+ psnext->pa->ofsy = ps->pa->ofsy + get_panel_size_y(ps->pa) - get_panel_size_y(psnext->pa);
}
}
/* we interpolate */
- done= 0;
- ps= panelsort;
- for(a=0; a<tot; a++, ps++) {
- if((ps->pa->flag & PNL_SELECT)==0) {
- if((ps->orig->ofsx != ps->pa->ofsx) || (ps->orig->ofsy != ps->pa->ofsy)) {
- ps->orig->ofsx= floorf(0.5f + fac*(float)ps->pa->ofsx + (1.0f-fac)*(float)ps->orig->ofsx);
- ps->orig->ofsy= floorf(0.5f + fac*(float)ps->pa->ofsy + (1.0f-fac)*(float)ps->orig->ofsy);
- done= 1;
+ done = 0;
+ ps = panelsort;
+ for (a = 0; a < tot; a++, ps++) {
+ if ((ps->pa->flag & PNL_SELECT) == 0) {
+ if ((ps->orig->ofsx != ps->pa->ofsx) || (ps->orig->ofsy != ps->pa->ofsy)) {
+ ps->orig->ofsx = floorf(0.5f + fac * (float)ps->pa->ofsx + (1.0f - fac) * (float)ps->orig->ofsx);
+ ps->orig->ofsy = floorf(0.5f + fac * (float)ps->pa->ofsy + (1.0f - fac) * (float)ps->orig->ofsy);
+ done = 1;
}
}
}
/* copy locations to tabs */
- for(pa= ar->panels.first; pa; pa= pa->next)
- if(pa->paneltab && (pa->runtime_flag & PNL_ACTIVE))
+ for (pa = ar->panels.first; pa; pa = pa->next)
+ if (pa->paneltab && (pa->runtime_flag & PNL_ACTIVE))
ui_panel_copy_offset(pa, pa->paneltab);
/* free panelsort array */
@@ -783,51 +783,51 @@ static int uiAlignPanelStep(ScrArea *sa, ARegion *ar, float fac, int drag)
static void ui_panels_size(ScrArea *sa, ARegion *ar, int *x, int *y)
{
Panel *pa;
- int align= panel_aligned(sa, ar);
+ int align = panel_aligned(sa, ar);
int sizex = UI_PANEL_WIDTH;
int sizey = UI_PANEL_WIDTH;
/* compute size taken up by panels, for setting in view2d */
- for(pa= ar->panels.first; pa; pa= pa->next) {
- if(pa->runtime_flag & PNL_ACTIVE) {
+ for (pa = ar->panels.first; pa; pa = pa->next) {
+ if (pa->runtime_flag & PNL_ACTIVE) {
int pa_sizex, pa_sizey;
- if(align==BUT_VERTICAL) {
- pa_sizex= pa->ofsx + pa->sizex;
- pa_sizey= get_panel_real_ofsy(pa);
+ if (align == BUT_VERTICAL) {
+ pa_sizex = pa->ofsx + pa->sizex;
+ pa_sizey = get_panel_real_ofsy(pa);
}
else {
- pa_sizex= get_panel_real_ofsx(pa) + pa->sizex;
- pa_sizey= pa->ofsy + get_panel_size_y(pa);
+ pa_sizex = get_panel_real_ofsx(pa) + pa->sizex;
+ pa_sizey = pa->ofsy + get_panel_size_y(pa);
}
- sizex= MAX2(sizex, pa_sizex);
- sizey= MIN2(sizey, pa_sizey);
+ sizex = MAX2(sizex, pa_sizex);
+ sizey = MIN2(sizey, pa_sizey);
}
}
- *x= sizex;
- *y= sizey;
+ *x = sizex;
+ *y = sizey;
}
static void ui_do_animate(const bContext *C, Panel *panel)
{
- uiHandlePanelData *data= panel->activedata;
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= CTX_wm_region(C);
+ uiHandlePanelData *data = panel->activedata;
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = CTX_wm_region(C);
float fac;
- fac= (PIL_check_seconds_timer()-data->starttime)/ANIMATION_TIME;
- fac= sqrt(fac);
- fac= MIN2(fac, 1.0f);
+ fac = (PIL_check_seconds_timer() - data->starttime) / ANIMATION_TIME;
+ fac = sqrt(fac);
+ fac = MIN2(fac, 1.0f);
/* for max 1 second, interpolate positions */
- if(uiAlignPanelStep(sa, ar, fac, 0))
+ if (uiAlignPanelStep(sa, ar, fac, 0))
ED_region_tag_redraw(ar);
else
- fac= 1.0f;
+ fac = 1.0f;
- if(fac >= 1.0f) {
+ if (fac >= 1.0f) {
panel_activate_state(C, panel, PANEL_STATE_EXIT);
return;
}
@@ -837,69 +837,69 @@ 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)
- pa->runtime_flag= PNL_WAS_ACTIVE;
+ for (pa = ar->panels.first; pa; pa = pa->next) {
+ if (pa->runtime_flag & PNL_ACTIVE)
+ pa->runtime_flag = PNL_WAS_ACTIVE;
else
- pa->runtime_flag= 0;
+ pa->runtime_flag = 0;
}
}
/* only draws blocks with panels */
void uiEndPanels(const bContext *C, ARegion *ar, int *x, int *y)
{
- ScrArea *sa= CTX_wm_area(C);
+ ScrArea *sa = CTX_wm_area(C);
uiBlock *block;
Panel *panot, *panew, *patest, *pa, *firstpa;
/* offset contents */
- for(block= ar->uiblocks.first; block; block= block->next)
- if(block->active && block->panel)
+ for (block = ar->uiblocks.first; block; block = block->next)
+ if (block->active && block->panel)
ui_offset_panel_block(block);
/* consistency; are panels not made, whilst they have tabs */
- for(panot= ar->panels.first; panot; panot= panot->next) {
- if((panot->runtime_flag & PNL_ACTIVE)==0) { // not made
+ for (panot = ar->panels.first; panot; panot = panot->next) {
+ if ((panot->runtime_flag & PNL_ACTIVE) == 0) { // not made
- for(panew= ar->panels.first; panew; panew= panew->next) {
- if((panew->runtime_flag & PNL_ACTIVE)) {
- if(panew->paneltab==panot) { // panew is tab in notmade pa
+ for (panew = ar->panels.first; panew; panew = panew->next) {
+ if ((panew->runtime_flag & PNL_ACTIVE)) {
+ if (panew->paneltab == panot) { // panew is tab in notmade pa
break;
}
}
}
/* now panew can become the new parent, check all other tabs */
- if(panew) {
- for(patest= ar->panels.first; patest; patest= patest->next) {
- if(patest->paneltab == panot) {
- patest->paneltab= panew;
+ if (panew) {
+ for (patest = ar->panels.first; patest; patest = patest->next) {
+ if (patest->paneltab == panot) {
+ patest->paneltab = panew;
}
}
- panot->paneltab= panew;
- panew->paneltab= NULL;
+ panot->paneltab = panew;
+ panew->paneltab = NULL;
ED_region_tag_redraw(ar); // the buttons panew were not made
}
}
}
/* re-align, possibly with animation */
- if(panels_re_align(sa, ar, &pa)) {
- if(pa)
+ if (panels_re_align(sa, ar, &pa)) {
+ if (pa)
panel_activate_state(C, pa, PANEL_STATE_ANIMATION);
else
uiAlignPanelStep(sa, ar, 1.0, 0);
}
/* tag first panel */
- firstpa= NULL;
- for(block= ar->uiblocks.first; block; block=block->next)
- if(block->active && block->panel)
- if(!firstpa || block->panel->sortorder < firstpa->sortorder)
- firstpa= block->panel;
+ firstpa = NULL;
+ for (block = ar->uiblocks.first; block; block = block->next)
+ if (block->active && block->panel)
+ if (!firstpa || block->panel->sortorder < firstpa->sortorder)
+ firstpa = block->panel;
- if(firstpa)
+ if (firstpa)
firstpa->runtime_flag |= PNL_FIRST;
/* compute size taken up by panel */
@@ -913,14 +913,14 @@ void uiDrawPanels(const bContext *C, ARegion *ar)
UI_ThemeClearColor(TH_BACK);
/* draw panels, selected on top */
- for(block= ar->uiblocks.first; block; block=block->next) {
- if(block->active && block->panel && !(block->panel->flag & PNL_SELECT)) {
+ for (block = ar->uiblocks.first; block; block = block->next) {
+ if (block->active && block->panel && !(block->panel->flag & PNL_SELECT)) {
uiDrawBlock(C, block);
}
}
- for(block= ar->uiblocks.first; block; block=block->next) {
- if(block->active && block->panel && (block->panel->flag & PNL_SELECT)) {
+ for (block = ar->uiblocks.first; block; block = block->next) {
+ if (block->active && block->panel && (block->panel->flag & PNL_SELECT)) {
uiDrawBlock(C, block);
}
}
@@ -934,22 +934,22 @@ static void check_panel_overlap(ARegion *ar, Panel *panel)
/* also called with panel==NULL for clear */
- for(pa=ar->panels.first; pa; pa=pa->next) {
+ for (pa = ar->panels.first; pa; pa = pa->next) {
pa->flag &= ~PNL_OVERLAP;
- if(panel && (pa != panel)) {
- if(pa->paneltab==NULL && (pa->runtime_flag & PNL_ACTIVE)) {
- float safex= 0.2, safey= 0.2;
-
- if(pa->flag & PNL_CLOSEDX) safex= 0.05;
- else if(pa->flag & PNL_CLOSEDY) safey= 0.05;
- else if(panel->flag & PNL_CLOSEDX) safex= 0.05;
- else if(panel->flag & PNL_CLOSEDY) safey= 0.05;
+ if (panel && (pa != panel)) {
+ if (pa->paneltab == NULL && (pa->runtime_flag & PNL_ACTIVE)) {
+ float safex = 0.2, safey = 0.2;
- if(pa->ofsx > panel->ofsx- safex*panel->sizex)
- if(pa->ofsx+pa->sizex < panel->ofsx+ (1.0f+safex)*panel->sizex)
- if(pa->ofsy > panel->ofsy- safey*panel->sizey)
- if(pa->ofsy+pa->sizey < panel->ofsy+ (1.0f+safey)*panel->sizey)
- pa->flag |= PNL_OVERLAP;
+ if (pa->flag & PNL_CLOSEDX) safex = 0.05;
+ else if (pa->flag & PNL_CLOSEDY) safey = 0.05;
+ else if (panel->flag & PNL_CLOSEDX) safex = 0.05;
+ else if (panel->flag & PNL_CLOSEDY) safey = 0.05;
+
+ if (pa->ofsx > panel->ofsx - safex * panel->sizex)
+ if (pa->ofsx + pa->sizex < panel->ofsx + (1.0f + safex) * panel->sizex)
+ if (pa->ofsy > panel->ofsy - safey * panel->sizey)
+ if (pa->ofsy + pa->sizey < panel->ofsy + (1.0f + safey) * panel->sizey)
+ pa->flag |= PNL_OVERLAP;
}
}
}
@@ -959,39 +959,39 @@ static void check_panel_overlap(ARegion *ar, Panel *panel)
static void ui_do_drag(const bContext *C, wmEvent *event, Panel *panel)
{
- uiHandlePanelData *data= panel->activedata;
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= CTX_wm_region(C);
- short align= panel_aligned(sa, ar), dx=0, dy=0;
+ uiHandlePanelData *data = panel->activedata;
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = CTX_wm_region(C);
+ short align = panel_aligned(sa, ar), dx = 0, dy = 0;
/* first clip for window, no dragging outside */
- if(!BLI_in_rcti(&ar->winrct, event->x, event->y))
+ if (!BLI_in_rcti(&ar->winrct, event->x, event->y))
return;
- dx= (event->x-data->startx) & ~(PNL_GRID-1);
- dy= (event->y-data->starty) & ~(PNL_GRID-1);
+ dx = (event->x - data->startx) & ~(PNL_GRID - 1);
+ dy = (event->y - data->starty) & ~(PNL_GRID - 1);
- dx *= (float)(ar->v2d.cur.xmax - ar->v2d.cur.xmin)/(float)(ar->winrct.xmax - ar->winrct.xmin);
- dy *= (float)(ar->v2d.cur.ymax - ar->v2d.cur.ymin)/(float)(ar->winrct.ymax - ar->winrct.ymin);
+ dx *= (float)(ar->v2d.cur.xmax - ar->v2d.cur.xmin) / (float)(ar->winrct.xmax - ar->winrct.xmin);
+ dy *= (float)(ar->v2d.cur.ymax - ar->v2d.cur.ymin) / (float)(ar->winrct.ymax - ar->winrct.ymin);
- if(data->state == PANEL_STATE_DRAG_SCALE) {
- panel->sizex = MAX2(data->startsizex+dx, UI_PANEL_MINX);
+ if (data->state == PANEL_STATE_DRAG_SCALE) {
+ panel->sizex = MAX2(data->startsizex + dx, UI_PANEL_MINX);
- if(data->startsizey-dy < UI_PANEL_MINY)
- dy= -UI_PANEL_MINY+data->startsizey;
+ if (data->startsizey - dy < UI_PANEL_MINY)
+ dy = -UI_PANEL_MINY + data->startsizey;
- panel->sizey= data->startsizey-dy;
- panel->ofsy= data->startofsy+dy;
+ panel->sizey = data->startsizey - dy;
+ panel->ofsy = data->startofsy + dy;
}
else {
/* reset the panel snapping, to allow dragging away from snapped edges */
panel->snap = PNL_SNAP_NONE;
- panel->ofsx = data->startofsx+dx;
- panel->ofsy = data->startofsy+dy;
+ panel->ofsx = data->startofsx + dx;
+ panel->ofsy = data->startofsy + dy;
check_panel_overlap(ar, panel);
- if(align) uiAlignPanelStep(sa, ar, 0.2, 1);
+ if (align) uiAlignPanelStep(sa, ar, 0.2, 1);
}
ED_region_tag_redraw(ar);
@@ -1001,70 +1001,70 @@ static void ui_do_drag(const bContext *C, wmEvent *event, Panel *panel)
/* this function is supposed to call general window drawing too */
-/* also it supposes a block has panel, and isnt a menu */
+/* also it supposes a block has panel, and isn't a menu */
static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, int my, int event)
{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= CTX_wm_region(C);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = CTX_wm_region(C);
Panel *pa;
- int align= panel_aligned(sa, ar), button= 0;
+ int align = panel_aligned(sa, ar), button = 0;
/* mouse coordinates in panel space! */
/* XXX weak code, currently it assumes layout style for location of widgets */
/* check open/collapsed button */
- if(event==RETKEY)
- button= 1;
- else if(event==AKEY)
- button= 1;
- else if(block->panel->flag & PNL_CLOSEDX) {
- if(my >= block->maxy) button= 1;
+ if (event == RETKEY)
+ button = 1;
+ else if (event == AKEY)
+ button = 1;
+ else if (block->panel->flag & PNL_CLOSEDX) {
+ if (my >= block->maxy) button = 1;
}
- else if(block->panel->control & UI_PNL_CLOSE) {
+ else if (block->panel->control & UI_PNL_CLOSE) {
/* whole of header can be used to collapse panel (except top-right corner) */
- if(mx <= block->maxx-8-PNL_ICON) button= 2;
- //else if(mx <= block->minx+10+2*PNL_ICON+2) button= 1;
+ if (mx <= block->maxx - 8 - PNL_ICON) button = 2;
+ //else if (mx <= block->minx+10+2*PNL_ICON+2) button= 1;
}
- else if(mx <= block->maxx-PNL_ICON-12) {
- button= 1;
+ else if (mx <= block->maxx - PNL_ICON - 12) {
+ button = 1;
}
- if(button) {
- if(button==2) { // close
+ if (button) {
+ if (button == 2) { // close
ED_region_tag_redraw(ar);
}
- else { // collapse
- if(block->panel->flag & PNL_CLOSED) {
+ else { // collapse
+ if (block->panel->flag & PNL_CLOSED) {
block->panel->flag &= ~PNL_CLOSED;
/* snap back up so full panel aligns with screen edge */
if (block->panel->snap & PNL_SNAP_BOTTOM)
- block->panel->ofsy= 0;
+ block->panel->ofsy = 0;
}
- else if(align==BUT_HORIZONTAL) {
+ else if (align == BUT_HORIZONTAL) {
block->panel->flag |= PNL_CLOSEDX;
}
else {
/* snap down to bottom screen edge*/
block->panel->flag |= PNL_CLOSEDY;
if (block->panel->snap & PNL_SNAP_BOTTOM)
- block->panel->ofsy= -block->panel->sizey;
+ block->panel->ofsy = -block->panel->sizey;
}
- for(pa= ar->panels.first; pa; pa= pa->next) {
- if(pa->paneltab==block->panel) {
- if(block->panel->flag & PNL_CLOSED) pa->flag |= PNL_CLOSED;
+ for (pa = ar->panels.first; pa; pa = pa->next) {
+ if (pa->paneltab == block->panel) {
+ if (block->panel->flag & PNL_CLOSED) pa->flag |= PNL_CLOSED;
else pa->flag &= ~PNL_CLOSED;
}
}
}
- if(align)
+ if (align)
panel_activate_state(C, block->panel, PANEL_STATE_ANIMATION);
else
ED_region_tag_redraw(ar);
}
- else if(mx <= (block->maxx-PNL_ICON-12)+PNL_ICON+2) {
+ else if (mx <= (block->maxx - PNL_ICON - 12) + PNL_ICON + 2) {
panel_activate_state(C, block->panel, PANEL_STATE_DRAG);
}
}
@@ -1074,35 +1074,35 @@ static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, in
int ui_handler_panel_region(bContext *C, wmEvent *event)
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
uiBlock *block;
Panel *pa;
- int retval, mx, my, inside_header= 0, inside_scale= 0, inside;
+ int retval, mx, my, inside_header = 0, inside_scale = 0, inside;
- retval= WM_UI_HANDLER_CONTINUE;
- for(block=ar->uiblocks.last; block; block=block->prev) {
- mx= event->x;
- my= event->y;
+ retval = WM_UI_HANDLER_CONTINUE;
+ for (block = ar->uiblocks.last; block; block = block->prev) {
+ mx = event->x;
+ my = event->y;
ui_window_to_block(ar, block, &mx, &my);
/* check if inside boundbox */
- inside= 0;
- pa= block->panel;
+ inside = 0;
+ pa = block->panel;
- if(!pa || pa->paneltab!=NULL)
+ if (!pa || pa->paneltab != NULL)
continue;
- if(pa->type && pa->type->flag & PNL_NO_HEADER) // XXX - accessed freed panels when scripts reload, need to fix.
+ if (pa->type && pa->type->flag & PNL_NO_HEADER) // XXX - accessed freed panels when scripts reload, need to fix.
continue;
- if(block->minx <= mx && block->maxx >= mx)
- if(block->miny <= my && block->maxy+PNL_HEADER >= my)
- inside= 1;
+ if (block->minx <= mx && block->maxx >= mx)
+ if (block->miny <= my && block->maxy + PNL_HEADER >= my)
+ inside = 1;
- if(inside && event->val==KM_PRESS) {
- if(event->type == AKEY && !ELEM4(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift, event->alt)) {
+ if (inside && event->val == KM_PRESS) {
+ if (event->type == AKEY && !ELEM4(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift, event->alt)) {
- if(pa->flag & PNL_CLOSEDY) {
- if((block->maxy <= my) && (block->maxy+PNL_HEADER >= my))
+ if (pa->flag & PNL_CLOSEDY) {
+ if ((block->maxy <= my) && (block->maxy + PNL_HEADER >= my))
ui_handle_panel_header(C, block, mx, my, event->type);
}
else
@@ -1113,73 +1113,76 @@ int ui_handler_panel_region(bContext *C, wmEvent *event)
}
/* on active button, do not handle panels */
- if(ui_button_is_active(ar))
+ if (ui_button_is_active(ar))
continue;
- if(inside) {
+ if (inside) {
/* clicked at panel header? */
- if(pa->flag & PNL_CLOSEDX) {
- if(block->minx <= mx && block->minx+PNL_HEADER >= mx)
- inside_header= 1;
+ if (pa->flag & PNL_CLOSEDX) {
+ if (block->minx <= mx && block->minx + PNL_HEADER >= mx)
+ inside_header = 1;
}
- else if((block->maxy <= my) && (block->maxy+PNL_HEADER >= my)) {
- inside_header= 1;
+ else if ((block->maxy <= my) && (block->maxy + PNL_HEADER >= my)) {
+ inside_header = 1;
}
- else if(pa->control & UI_PNL_SCALE) {
- if(block->maxx-PNL_HEADER <= mx)
- if(block->miny+PNL_HEADER >= my)
- inside_scale= 1;
+ else if (pa->control & UI_PNL_SCALE) {
+ if (block->maxx - PNL_HEADER <= mx)
+ if (block->miny + PNL_HEADER >= my)
+ inside_scale = 1;
}
- if(event->val==KM_PRESS) {
+ if (event->val == KM_PRESS) {
/* open close on header */
- if(ELEM(event->type, RETKEY, PADENTER)) {
- if(inside_header) {
+ if (ELEM(event->type, RETKEY, PADENTER)) {
+ if (inside_header) {
ui_handle_panel_header(C, block, mx, my, RETKEY);
break;
}
}
- else if(event->type == LEFTMOUSE) {
- if(inside_header) {
+ else if (event->type == LEFTMOUSE) {
+ if (inside_header) {
ui_handle_panel_header(C, block, mx, my, 0);
break;
}
- else if(inside_scale && !(pa->flag & PNL_CLOSED)) {
+ else if (inside_scale && !(pa->flag & PNL_CLOSED)) {
panel_activate_state(C, pa, PANEL_STATE_DRAG_SCALE);
break;
}
}
- else if(event->type == ESCKEY) {
- /*XXX 2.50 if(block->handler) {
+ else if (event->type == ESCKEY) {
+ /*XXX 2.50*/
+#if 0
+ if (block->handler) {
rem_blockhandler(sa, block->handler);
ED_region_tag_redraw(ar);
- retval= WM_UI_HANDLER_BREAK;
- }*/
+ retval = WM_UI_HANDLER_BREAK;
+ }
+#endif
}
- else if(event->type==PADPLUSKEY || event->type==PADMINUS) {
+ else if (event->type == PADPLUSKEY || event->type == PADMINUS) {
#if 0 // XXX make float panel exception?
- int zoom=0;
+ int zoom = 0;
/* if panel is closed, only zoom if mouse is over the header */
- if (pa->flag & (PNL_CLOSEDX|PNL_CLOSEDY)) {
+ if (pa->flag & (PNL_CLOSEDX | PNL_CLOSEDY)) {
if (inside_header)
- zoom=1;
+ zoom = 1;
}
else
- zoom=1;
+ zoom = 1;
- if(zoom) {
- ScrArea *sa= CTX_wm_area(C);
- SpaceLink *sl= sa->spacedata.first;
+ if (zoom) {
+ ScrArea *sa = CTX_wm_area(C);
+ SpaceLink *sl = sa->spacedata.first;
- if(sa->spacetype!=SPACE_BUTS) {
- if(!(pa->control & UI_PNL_SCALE)) {
- if(event->type==PADPLUSKEY) sl->blockscale+= 0.1;
- else sl->blockscale-= 0.1;
+ if (sa->spacetype != SPACE_BUTS) {
+ if (!(pa->control & UI_PNL_SCALE)) {
+ if (event->type == PADPLUSKEY) sl->blockscale += 0.1;
+ else sl->blockscale -= 0.1;
CLAMP(sl->blockscale, 0.6, 1.0);
ED_region_tag_redraw(ar);
- retval= WM_UI_HANDLER_BREAK;
+ retval = WM_UI_HANDLER_BREAK;
}
}
}
@@ -1197,34 +1200,34 @@ int ui_handler_panel_region(bContext *C, wmEvent *event)
/* note, this is modal handler and should not swallow events for animation */
static int ui_handler_panel(bContext *C, wmEvent *event, void *userdata)
{
- Panel *panel= userdata;
- uiHandlePanelData *data= panel->activedata;
+ Panel *panel = userdata;
+ uiHandlePanelData *data = panel->activedata;
/* verify if we can stop */
- if(event->type == LEFTMOUSE && event->val!=KM_PRESS) {
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= CTX_wm_region(C);
- int align= panel_aligned(sa, ar);
+ if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = CTX_wm_region(C);
+ int align = panel_aligned(sa, ar);
- if(align)
+ if (align)
panel_activate_state(C, panel, PANEL_STATE_ANIMATION);
else
panel_activate_state(C, panel, PANEL_STATE_EXIT);
}
- else if(event->type == MOUSEMOVE) {
- if(data->state == PANEL_STATE_DRAG)
+ else if (event->type == MOUSEMOVE) {
+ if (data->state == PANEL_STATE_DRAG)
ui_do_drag(C, event, panel);
}
- else if(event->type == TIMER && event->customdata == data->animtimer) {
- if(data->state == PANEL_STATE_ANIMATION)
+ else if (event->type == TIMER && event->customdata == data->animtimer) {
+ if (data->state == PANEL_STATE_ANIMATION)
ui_do_animate(C, panel);
- else if(data->state == PANEL_STATE_DRAG)
+ else if (data->state == PANEL_STATE_DRAG)
ui_do_drag(C, event, panel);
}
- data= panel->activedata;
+ data = panel->activedata;
- if(data && data->state == PANEL_STATE_ANIMATION)
+ if (data && data->state == PANEL_STATE_ANIMATION)
return WM_UI_HANDLER_CONTINUE;
else
return WM_UI_HANDLER_BREAK;
@@ -1232,22 +1235,22 @@ static int ui_handler_panel(bContext *C, wmEvent *event, void *userdata)
static void ui_handler_remove_panel(bContext *C, void *userdata)
{
- Panel *pa= userdata;
+ Panel *pa = userdata;
panel_activate_state(C, pa, PANEL_STATE_EXIT);
}
static void panel_activate_state(const bContext *C, Panel *pa, uiHandlePanelState state)
{
- uiHandlePanelData *data= pa->activedata;
- wmWindow *win= CTX_wm_window(C);
- ARegion *ar= CTX_wm_region(C);
+ uiHandlePanelData *data = pa->activedata;
+ wmWindow *win = CTX_wm_window(C);
+ ARegion *ar = CTX_wm_region(C);
- if(data && data->state == state)
+ if (data && data->state == state)
return;
- if(state == PANEL_STATE_EXIT || state == PANEL_STATE_ANIMATION) {
- if(data && data->state != PANEL_STATE_ANIMATION) {
+ if (state == PANEL_STATE_EXIT || state == PANEL_STATE_ANIMATION) {
+ if (data && data->state != PANEL_STATE_ANIMATION) {
/* XXX:
* - the panel tabbing function call below (test_add_new_tabs()) has been commented out
* "It is too easy to do by accident when reordering panels, is very hard to control and use, and has no real benefit." - BillRey
@@ -1262,48 +1265,52 @@ static void panel_activate_state(const bContext *C, Panel *pa, uiHandlePanelStat
else
pa->flag |= PNL_SELECT;
- if(data && data->animtimer) {
+ if (data && data->animtimer) {
WM_event_remove_timer(CTX_wm_manager(C), win, data->animtimer);
- data->animtimer= NULL;
+ data->animtimer = NULL;
}
- if(state == PANEL_STATE_EXIT) {
+ if (state == PANEL_STATE_EXIT) {
MEM_freeN(data);
- pa->activedata= NULL;
+ pa->activedata = NULL;
WM_event_remove_ui_handler(&win->modalhandlers, ui_handler_panel, ui_handler_remove_panel, pa, 0);
}
else {
- if(!data) {
- data= MEM_callocN(sizeof(uiHandlePanelData), "uiHandlePanelData");
- pa->activedata= data;
+ if (!data) {
+ data = MEM_callocN(sizeof(uiHandlePanelData), "uiHandlePanelData");
+ pa->activedata = data;
WM_event_add_ui_handler(C, &win->modalhandlers, ui_handler_panel, ui_handler_remove_panel, pa);
}
- if(ELEM(state, PANEL_STATE_ANIMATION, PANEL_STATE_DRAG))
- data->animtimer= WM_event_add_timer(CTX_wm_manager(C), win, TIMER, ANIMATION_INTERVAL);
-
- data->state= state;
- data->startx= win->eventstate->x;
- data->starty= win->eventstate->y;
- data->startofsx= pa->ofsx;
- data->startofsy= pa->ofsy;
- data->startsizex= pa->sizex;
- data->startsizey= pa->sizey;
- data->starttime= PIL_check_seconds_timer();
+ if (ELEM(state, PANEL_STATE_ANIMATION, PANEL_STATE_DRAG))
+ data->animtimer = WM_event_add_timer(CTX_wm_manager(C), win, TIMER, ANIMATION_INTERVAL);
+
+ data->state = state;
+ data->startx = win->eventstate->x;
+ data->starty = win->eventstate->y;
+ data->startofsx = pa->ofsx;
+ data->startofsy = pa->ofsy;
+ data->startsizex = pa->sizex;
+ data->startsizey = pa->sizey;
+ data->starttime = PIL_check_seconds_timer();
}
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); */
+ else if (strcmp(block->name, "image_panel_preview") == 0)
+ image_preview_event(2);
+#endif
}
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index c912bce1c77..1c37fcdd488 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -68,11 +68,11 @@
#include "interface_intern.h"
-#define MENU_SEPR_HEIGHT 6
-#define B_NOP -1
-#define MENU_SHADOW_SIDE 8
-#define MENU_SHADOW_BOTTOM 10
-#define MENU_TOP 8
+#define MENU_SEPR_HEIGHT 6
+#define B_NOP -1
+#define MENU_SHADOW_SIDE 8
+#define MENU_SHADOW_BOTTOM 10
+#define MENU_TOP 8
/*********************** Menu Data Parsing ********************* */
@@ -94,13 +94,13 @@ typedef struct MenuData {
static MenuData *menudata_new(const char *instr)
{
- MenuData *md= MEM_mallocN(sizeof(*md), "MenuData");
+ MenuData *md = MEM_mallocN(sizeof(*md), "MenuData");
- md->instr= instr;
- md->title= NULL;
- md->titleicon= 0;
- md->items= NULL;
- md->nitems= md->itemssize= 0;
+ md->instr = instr;
+ md->title = NULL;
+ md->titleicon = 0;
+ md->items = NULL;
+ md->nitems = md->itemssize = 0;
return md;
}
@@ -108,30 +108,30 @@ static MenuData *menudata_new(const char *instr)
static void menudata_set_title(MenuData *md, const char *title, int titleicon)
{
if (!md->title)
- md->title= title;
+ md->title = title;
if (!md->titleicon)
- md->titleicon= titleicon;
+ md->titleicon = titleicon;
}
static void menudata_add_item(MenuData *md, const char *str, int retval, int icon, int sepr)
{
- if (md->nitems==md->itemssize) {
- int nsize= md->itemssize?(md->itemssize<<1):1;
- MenuEntry *oitems= md->items;
+ if (md->nitems == md->itemssize) {
+ int nsize = md->itemssize ? (md->itemssize << 1) : 1;
+ MenuEntry *oitems = md->items;
- md->items= MEM_mallocN(nsize*sizeof(*md->items), "md->items");
+ md->items = MEM_mallocN(nsize * sizeof(*md->items), "md->items");
if (oitems) {
- memcpy(md->items, oitems, md->nitems*sizeof(*md->items));
+ memcpy(md->items, oitems, md->nitems * sizeof(*md->items));
MEM_freeN(oitems);
}
- md->itemssize= nsize;
+ md->itemssize = nsize;
}
- md->items[md->nitems].str= str;
- md->items[md->nitems].retval= retval;
- md->items[md->nitems].icon= icon;
- md->items[md->nitems].sepr= sepr;
+ md->items[md->nitems].str = str;
+ md->items[md->nitems].retval = retval;
+ md->items[md->nitems].icon = icon;
+ md->items[md->nitems].sepr = sepr;
md->nitems++;
}
@@ -144,81 +144,86 @@ static void menudata_free(MenuData *md)
MEM_freeN(md);
}
- /**
- * Parse menu description strings, string is of the
- * form "[sss%t|]{(sss[%xNN]|), (%l|), (sss%l|)}", ssss%t indicates the
- * menu title, sss or sss%xNN indicates an option,
- * if %xNN is given then NN is the return value if
- * that option is selected otherwise the return value
- * is the index of the option (starting with 1). %l
- * indicates a seperator, sss%l indicates a label and
- * new column.
- *
- * @param str String to be parsed.
- * @retval new menudata structure, free with menudata_free()
- */
+/**
+ * Parse menu description strings, string is of the
+ * form "[sss%t|]{(sss[%xNN]|), (%l|), (sss%l|)}", ssss%t indicates the
+ * menu title, sss or sss%xNN indicates an option,
+ * if %xNN is given then NN is the return value if
+ * that option is selected otherwise the return value
+ * is the index of the option (starting with 1). %l
+ * indicates a seperator, sss%l indicates a label and
+ * new column.
+ *
+ * \param str String to be parsed.
+ * \retval new menudata structure, free with menudata_free()
+ */
static MenuData *decompose_menu_string(const char *str)
{
- char *instr= BLI_strdup(str);
- MenuData *md= menudata_new(instr);
- const char *nitem= NULL;
- char *s= instr;
- int nicon=0, nretval= 1, nitem_is_title= 0, nitem_is_sepr= 0;
+ char *instr = BLI_strdup(str);
+ MenuData *md = menudata_new(instr);
+ const char *nitem = NULL;
+ char *s = instr;
+ int nicon = 0, nretval = 1, nitem_is_title = 0, nitem_is_sepr = 0;
while (1) {
- char c= *s;
+ char c = *s;
- if (c=='%') {
- if (s[1]=='x') {
- nretval= atoi(s+2);
+ if (c == '%') {
+ if (s[1] == 'x') {
+ nretval = atoi(s + 2);
- *s= '\0';
+ *s = '\0';
s++;
- } else if (s[1]=='t') {
- nitem_is_title= (s != instr); /* check for empty title */
+ }
+ else if (s[1] == 't') {
+ nitem_is_title = (s != instr); /* check for empty title */
- *s= '\0';
+ *s = '\0';
s++;
- } else if (s[1]=='l') {
- nitem_is_sepr= 1;
- if(!nitem) nitem= "";
+ }
+ else if (s[1] == 'l') {
+ nitem_is_sepr = 1;
+ if (!nitem) nitem = "";
- *s= '\0';
+ *s = '\0';
s++;
- } else if (s[1]=='i') {
- nicon= atoi(s+2);
+ }
+ else if (s[1] == 'i') {
+ nicon = atoi(s + 2);
- *s= '\0';
+ *s = '\0';
s++;
}
- } else if (c=='|' || c == '\n' || c=='\0') {
+ }
+ else if (c == '|' || c == '\n' || c == '\0') {
if (nitem) {
- *s= '\0';
+ *s = '\0';
- if(nitem_is_title) {
+ if (nitem_is_title) {
menudata_set_title(md, nitem, nicon);
- nitem_is_title= 0;
+ nitem_is_title = 0;
}
- else if(nitem_is_sepr) {
+ else if (nitem_is_sepr) {
/* prevent separator to get a value */
menudata_add_item(md, nitem, -1, nicon, 1);
- nretval= md->nitems+1;
- nitem_is_sepr= 0;
+ nretval = md->nitems + 1;
+ nitem_is_sepr = 0;
}
else {
menudata_add_item(md, nitem, nretval, nicon, 0);
- nretval= md->nitems+1;
+ nretval = md->nitems + 1;
}
- nitem= NULL;
- nicon= 0;
+ nitem = NULL;
+ nicon = 0;
}
- if (c=='\0') {
+ if (c == '\0') {
break;
}
- } else if (!nitem) {
- nitem= s;
+ }
+ else if (!nitem) {
+ nitem = s;
}
s++;
@@ -232,9 +237,9 @@ void ui_set_name_menu(uiBut *but, int value)
MenuData *md;
int i;
- md= decompose_menu_string(but->str);
- for (i=0; i<md->nitems; i++) {
- if (md->items[i].retval==value) {
+ md = decompose_menu_string(but->str);
+ for (i = 0; i < md->nitems; i++) {
+ if (md->items[i].retval == value) {
BLI_strncpy(but->drawstr, md->items[i].str, sizeof(but->drawstr));
break;
}
@@ -246,29 +251,29 @@ void ui_set_name_menu(uiBut *but, int value)
int ui_step_name_menu(uiBut *but, int step)
{
MenuData *md;
- int value= ui_get_but_val(but);
+ int value = ui_get_but_val(but);
int i;
- md= decompose_menu_string(but->str);
- for (i=0; i<md->nitems; i++)
- if (md->items[i].retval==value)
+ md = decompose_menu_string(but->str);
+ for (i = 0; i < md->nitems; i++)
+ if (md->items[i].retval == value)
break;
- if(step==1) {
+ if (step == 1) {
/* skip separators */
- for(; i<md->nitems-1; i++) {
- if(md->items[i+1].retval != -1) {
- value= md->items[i+1].retval;
+ for (; i < md->nitems - 1; i++) {
+ if (md->items[i + 1].retval != -1) {
+ value = md->items[i + 1].retval;
break;
}
}
}
else {
- if(i>0) {
+ if (i > 0) {
/* skip separators */
- for(; i>0; i--) {
- if(md->items[i-1].retval != -1) {
- value= md->items[i-1].retval;
+ for (; i > 0; i--) {
+ if (md->items[i - 1].retval != -1) {
+ value = md->items[i - 1].retval;
break;
}
}
@@ -287,55 +292,111 @@ static ARegion *ui_add_temporary_region(bScreen *sc)
{
ARegion *ar;
- ar= MEM_callocN(sizeof(ARegion), "area region");
+ ar = MEM_callocN(sizeof(ARegion), "area region");
BLI_addtail(&sc->regionbase, ar);
- ar->regiontype= RGN_TYPE_TEMPORARY;
- ar->alignment= RGN_ALIGN_FLOAT;
+ ar->regiontype = RGN_TYPE_TEMPORARY;
+ ar->alignment = RGN_ALIGN_FLOAT;
return ar;
}
static void ui_remove_temporary_region(bContext *C, bScreen *sc, ARegion *ar)
{
- if(CTX_wm_window(C))
+ if (CTX_wm_window(C))
wm_draw_region_clear(CTX_wm_window(C), ar);
ED_region_exit(C, ar);
- BKE_area_region_free(NULL, ar); /* NULL: no spacetype */
+ BKE_area_region_free(NULL, ar); /* NULL: no spacetype */
BLI_freelinkN(&sc->regionbase, ar);
}
/************************* Creating Tooltips **********************/
-#define MAX_TOOLTIP_LINES 8
+typedef enum {
+ UI_TIP_LC_MAIN,
+ UI_TIP_LC_NORMAL,
+ UI_TIP_LC_PYTHON,
+ UI_TIP_LC_ALERT,
+ UI_TIP_LC_SUBMENU
+} uiTooltipLineColor;
+#define UI_TIP_LC_MAX 5
+#define MAX_TOOLTIP_LINES 8
typedef struct uiTooltipData {
rcti bbox;
uiFontStyle fstyle;
char lines[MAX_TOOLTIP_LINES][512];
- unsigned int color[MAX_TOOLTIP_LINES];
+ uiTooltipLineColor color_id[MAX_TOOLTIP_LINES];
int totline;
int toth, spaceh, lineh;
} uiTooltipData;
+static void rgb_tint(float col[3],
+ float h, float h_strength,
+ float v, float v_strength)
+{
+ float col_hsv_from[3];
+ float col_hsv_to[3];
+
+ rgb_to_hsv(col[0], col[1], col[2], col_hsv_from + 0, col_hsv_from + 1, col_hsv_from + 2);
+
+ col_hsv_to[0] = h;
+ col_hsv_to[1] = h_strength;
+ col_hsv_to[2] = (col_hsv_from[2] * (1.0f - v_strength)) + (v * v_strength);
+
+ hsv_to_rgb(col_hsv_to[0], col_hsv_to[1], col_hsv_to[2], col + 0, col + 1, col + 2);
+}
+
static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
{
- uiTooltipData *data= ar->regiondata;
- rcti bbox= data->bbox;
- int a;
-
- ui_draw_menu_back(UI_GetStyle(), NULL, &data->bbox);
+ uiTooltipData *data = ar->regiondata;
+ uiWidgetColors *theme = ui_tooltip_get_theme();
+ rcti bbox = data->bbox;
+ float tip_colors[UI_TIP_LC_MAX][3];
+
+ float *main_color = tip_colors[UI_TIP_LC_MAIN]; /* the color from the theme */
+ float *normal_color = tip_colors[UI_TIP_LC_NORMAL];
+ float *python_color = tip_colors[UI_TIP_LC_PYTHON];
+ float *alert_color = tip_colors[UI_TIP_LC_ALERT];
+ float *submenu_color = tip_colors[UI_TIP_LC_SUBMENU];
+
+ float background_color[3];
+ float tone_bg;
+ int i;
+
+ /* draw background */
+ ui_draw_tooltip_background(UI_GetStyle(), NULL, &bbox);
+
+ /* set background_color */
+ rgb_uchar_to_float(background_color, (const unsigned char *)theme->inner);
+
+ /* calculate normal_color */
+ rgb_uchar_to_float(main_color, (const unsigned char *)theme->text);
+ copy_v3_v3(normal_color, main_color);
+ copy_v3_v3(python_color, main_color);
+ copy_v3_v3(alert_color, main_color);
+ copy_v3_v3(submenu_color, main_color);
+
+ /* find the brightness difference between background and text colors */
+ tone_bg = rgb_to_grayscale(background_color);
+ /* tone_fg = rgb_to_grayscale(main_color); */
+
+ rgb_tint(normal_color, 0.0f, 0.0f, tone_bg, 0.3f); /* a shade darker (to bg) */
+ rgb_tint(python_color, 0.666f, 0.25f, tone_bg, 0.3f); /* blue */
+ rgb_tint(alert_color, 0.0f, 0.8f, tone_bg, 0.1f); /* bright red */
+ rgb_tint(submenu_color, 0.0f, 0.0f, tone_bg, 0.3f); /* a shade darker (to bg) */
+
/* draw text */
uiStyleFontSet(&data->fstyle);
- bbox.ymax= bbox.ymax - 0.5f*((bbox.ymax - bbox.ymin) - data->toth);
- bbox.ymin= bbox.ymax - data->lineh;
+ bbox.ymax = bbox.ymax - 0.5f * ((bbox.ymax - bbox.ymin) - data->toth);
+ bbox.ymin = bbox.ymax - data->lineh;
- for(a=0; a<data->totline; a++) {
- cpack(data->color[a]);
- uiStyleFontDraw(&data->fstyle, &bbox, data->lines[a]);
+ for (i = 0; i < data->totline; i++) {
+ glColor3fv(tip_colors[data->color_id[i]]);
+ uiStyleFontDraw(&data->fstyle, &bbox, data->lines[i]);
bbox.ymin -= data->lineh + data->spaceh;
bbox.ymax -= data->lineh + data->spaceh;
}
@@ -345,50 +406,50 @@ static void ui_tooltip_region_free_cb(ARegion *ar)
{
uiTooltipData *data;
- data= ar->regiondata;
+ data = ar->regiondata;
MEM_freeN(data);
- ar->regiondata= NULL;
+ ar->regiondata = NULL;
}
ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
{
- uiStyle *style= UI_GetStyle();
+ uiStyle *style = UI_GetStyle();
static ARegionType type;
ARegion *ar;
uiTooltipData *data;
IDProperty *prop;
char buf[512];
- float fonth, fontw, aspect= but->block->aspect;
+ float fonth, fontw, aspect = but->block->aspect;
float x1f, x2f, y1f, y2f;
int x1, x2, y1, y2, winx, winy, ofsx, ofsy, w, h, a;
- if(but->flag & UI_BUT_NO_TOOLTIP)
+ if (but->flag & UI_BUT_NO_TOOLTIP)
return NULL;
/* create tooltip data */
- data= MEM_callocN(sizeof(uiTooltipData), "uiTooltipData");
+ data = MEM_callocN(sizeof(uiTooltipData), "uiTooltipData");
/* special case, enum rna buttons only have enum item description, use general enum description too before the specific one */
- if(but->rnaprop && RNA_property_type(but->rnaprop) == PROP_ENUM) {
- const char *descr= RNA_property_description(but->rnaprop);
- if(descr && descr[0]) {
+ if (but->rnaprop && RNA_property_type(but->rnaprop) == PROP_ENUM) {
+ const char *descr = RNA_property_description(but->rnaprop);
+ if (descr && descr[0]) {
BLI_strncpy(data->lines[data->totline], descr, sizeof(data->lines[0]));
- data->color[data->totline]= 0xFFFFFF;
+ data->color_id[data->totline] = UI_TIP_LC_MAIN;
data->totline++;
}
- if(ELEM(but->type, ROW, MENU)) {
+ if (ELEM(but->type, ROW, MENU)) {
EnumPropertyItem *item;
int i, totitem, free;
- int value = (but->type == ROW)? but->hardmax: ui_get_but_val(but);
+ int value = (but->type == ROW) ? but->hardmax : ui_get_but_val(but);
RNA_property_enum_items_gettexted(C, &but->rnapoin, but->rnaprop, &item, &totitem, &free);
- for(i=0; i<totitem; i++) {
- if(item[i].identifier[0] && item[i].value == value) {
- if(item[i].description && item[i].description[0]) {
+ for (i = 0; i < totitem; i++) {
+ if (item[i].identifier[0] && item[i].value == value) {
+ if (item[i].description && item[i].description[0]) {
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "%s: %s", item[i].name, item[i].description);
- data->color[data->totline]= 0xDDDDDD;
+ data->color_id[data->totline] = UI_TIP_LC_SUBMENU;
data->totline++;
}
break;
@@ -401,52 +462,52 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
}
}
- if(but->tip && but->tip[0] != '\0') {
+ if (but->tip && but->tip[0] != '\0') {
BLI_strncpy(data->lines[data->totline], but->tip, sizeof(data->lines[0]));
- data->color[data->totline]= 0xFFFFFF;
+ data->color_id[data->totline] = UI_TIP_LC_MAIN;
data->totline++;
}
- if(but->optype && !(but->block->flag & UI_BLOCK_LOOP)) {
+ if (but->optype && !(but->block->flag & UI_BLOCK_LOOP)) {
/* operator keymap (not menus, they already have it) */
- prop= (but->opptr)? but->opptr->data: NULL;
+ prop = (but->opptr) ? but->opptr->data : NULL;
- if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE,
- buf, sizeof(buf)))
+ if (WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE,
+ buf, sizeof(buf)))
{
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Shortcut: %s"), buf);
- data->color[data->totline]= 0x888888;
+ data->color_id[data->totline] = UI_TIP_LC_NORMAL;
data->totline++;
}
}
- if(ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) {
+ if (ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) {
/* full string */
ui_get_but_string(but, buf, sizeof(buf));
- if(buf[0]) {
+ if (buf[0]) {
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Value: %s"), buf);
- data->color[data->totline]= 0x888888;
+ data->color_id[data->totline] = UI_TIP_LC_NORMAL;
data->totline++;
}
}
- if(but->rnaprop) {
- int unit_type= uiButGetUnitType(but);
+ if (but->rnaprop) {
+ int unit_type = uiButGetUnitType(but);
if (unit_type == PROP_UNIT_ROTATION) {
if (RNA_property_type(but->rnaprop) == PROP_FLOAT) {
- float value= RNA_property_array_check(but->rnaprop) ? RNA_property_float_get_index(&but->rnapoin, but->rnaprop, but->rnaindex) : RNA_property_float_get(&but->rnapoin, but->rnaprop);
+ float value = RNA_property_array_check(but->rnaprop) ? RNA_property_float_get_index(&but->rnapoin, but->rnaprop, but->rnaindex) : RNA_property_float_get(&but->rnapoin, but->rnaprop);
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Radians: %f"), value);
- data->color[data->totline]= 0x888888;
+ data->color_id[data->totline] = UI_TIP_LC_NORMAL;
data->totline++;
}
}
- if(but->flag & UI_BUT_DRIVEN) {
- if(ui_but_anim_expression_get(but, buf, sizeof(buf))) {
+ if (but->flag & UI_BUT_DRIVEN) {
+ if (ui_but_anim_expression_get(but, buf, sizeof(buf))) {
/* expression */
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Expression: %s"), buf);
- data->color[data->totline]= 0x888888;
+ data->color_id[data->totline] = UI_TIP_LC_NORMAL;
data->totline++;
}
}
@@ -454,15 +515,15 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
/* rna info */
if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) {
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Python: %s.%s"), RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop));
- data->color[data->totline]= 0x888888;
+ data->color_id[data->totline] = UI_TIP_LC_PYTHON;
data->totline++;
}
- if(but->rnapoin.id.data) {
- ID *id= but->rnapoin.id.data;
- if(id->lib && id->lib->name) {
+ if (but->rnapoin.id.data) {
+ ID *id = but->rnapoin.id.data;
+ if (id->lib && id->lib->name) {
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Library: %s"), id->lib->name);
- data->color[data->totline]= 0x888888;
+ data->color_id[data->totline] = UI_TIP_LC_NORMAL;
data->totline++;
}
}
@@ -470,38 +531,38 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
else if (but->optype) {
PointerRNA *opptr;
char *str;
- opptr= uiButGetOperatorPtrRNA(but); /* allocated when needed, the button owns it */
+ opptr = uiButGetOperatorPtrRNA(but); /* allocated when needed, the button owns it */
- str= WM_operator_pystring(C, but->optype, opptr, 0);
+ str = WM_operator_pystring(C, but->optype, opptr, 0);
/* operator info */
if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) {
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Python: %s"), str);
- data->color[data->totline]= 0x888888;
+ data->color_id[data->totline] = UI_TIP_LC_PYTHON;
data->totline++;
}
MEM_freeN(str);
/* second check if we are disabled - why */
- if(but->flag & UI_BUT_DISABLED) {
+ if (but->flag & UI_BUT_DISABLED) {
const char *poll_msg;
CTX_wm_operator_poll_msg_set(C, NULL);
WM_operator_poll_context(C, but->optype, but->opcontext);
- poll_msg= CTX_wm_operator_poll_msg_get(C);
- if(poll_msg) {
+ poll_msg = CTX_wm_operator_poll_msg_get(C);
+ if (poll_msg) {
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Disabled: %s"), poll_msg);
- data->color[data->totline]= 0x6666ff; /* alert */
+ data->color_id[data->totline] = UI_TIP_LC_ALERT; /* alert */
data->totline++;
}
}
}
else if (ELEM(but->type, MENU, PULLDOWN)) {
if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) {
- MenuType *mt= uiButGetMenuType(but);
+ MenuType *mt = uiButGetMenuType(but);
if (mt) {
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Python: %s"), mt->idname);
- data->color[data->totline]= 0x888888;
+ data->color_id[data->totline] = UI_TIP_LC_PYTHON;
data->totline++;
}
}
@@ -510,22 +571,22 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
assert(data->totline < MAX_TOOLTIP_LINES);
- if(data->totline == 0) {
+ if (data->totline == 0) {
MEM_freeN(data);
return NULL;
}
/* create area region */
- ar= ui_add_temporary_region(CTX_wm_screen(C));
+ ar = ui_add_temporary_region(CTX_wm_screen(C));
memset(&type, 0, sizeof(ARegionType));
- type.draw= ui_tooltip_region_draw_cb;
- type.free= ui_tooltip_region_free_cb;
- ar->type= &type;
+ type.draw = ui_tooltip_region_draw_cb;
+ type.free = ui_tooltip_region_free_cb;
+ ar->type = &type;
/* set font, get bb */
- data->fstyle= style->widget; /* copy struct */
- data->fstyle.align= UI_STYLE_TEXT_CENTER;
+ data->fstyle = style->widget; /* copy struct */
+ data->fstyle.align = UI_STYLE_TEXT_CENTER;
uiStyleFontSet(&data->fstyle);
/* these defines may need to be tweaked depending on font */
@@ -533,42 +594,42 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
#define TIP_BORDER_X 16.0f
#define TIP_BORDER_Y 6.0f
- h= BLF_height_max(data->fstyle.uifont_id);
+ h = BLF_height_max(data->fstyle.uifont_id);
- for(a=0, fontw=0, fonth=0; a<data->totline; a++) {
- w= BLF_width(data->fstyle.uifont_id, data->lines[a]);
- fontw= MAX2(fontw, w);
- fonth += (a == 0)? h: h+TIP_MARGIN_Y;
+ for (a = 0, fontw = 0, fonth = 0; a < data->totline; a++) {
+ w = BLF_width(data->fstyle.uifont_id, data->lines[a]);
+ fontw = MAX2(fontw, w);
+ fonth += (a == 0) ? h : h + TIP_MARGIN_Y;
}
fontw *= aspect;
- ar->regiondata= data;
+ ar->regiondata = data;
- data->toth= fonth;
- data->lineh= h;
- data->spaceh= TIP_MARGIN_Y;
+ data->toth = fonth;
+ data->lineh = h;
+ data->spaceh = TIP_MARGIN_Y;
/* compute position */
- ofsx= (but->block->panel)? but->block->panel->ofsx: 0;
- ofsy= (but->block->panel)? but->block->panel->ofsy: 0;
+ ofsx = (but->block->panel) ? but->block->panel->ofsx : 0;
+ ofsy = (but->block->panel) ? but->block->panel->ofsy : 0;
- x1f= (but->x1 + but->x2) * 0.5f + ofsx - (TIP_BORDER_X * aspect);
- x2f= x1f + fontw + (TIP_BORDER_X * aspect);
- y2f= but->y1 + ofsy - (TIP_BORDER_Y * aspect);
- y1f= y2f - fonth*aspect - (TIP_BORDER_Y * aspect);
+ x1f = (but->x1 + but->x2) * 0.5f + ofsx - (TIP_BORDER_X * aspect);
+ x2f = x1f + fontw + (TIP_BORDER_X * aspect);
+ y2f = but->y1 + ofsy - (TIP_BORDER_Y * aspect);
+ y1f = y2f - fonth * aspect - (TIP_BORDER_Y * aspect);
#undef TIP_MARGIN_Y
#undef TIP_BORDER_X
#undef TIP_BORDER_Y
/* copy to int, gets projected if possible too */
- x1= x1f; y1= y1f; x2= x2f; y2= y2f;
+ x1 = x1f; y1 = y1f; x2 = x2f; y2 = y2f;
- if(butregion) {
+ if (butregion) {
/* XXX temp, region v2ds can be empty still */
- if(butregion->v2d.cur.xmin != butregion->v2d.cur.xmax) {
+ if (butregion->v2d.cur.xmin != butregion->v2d.cur.xmax) {
UI_view2d_to_region_no_clip(&butregion->v2d, x1f, y1f, &x1, &y1);
UI_view2d_to_region_no_clip(&butregion->v2d, x2f, y2f, &x2, &y2);
}
@@ -581,35 +642,35 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
wm_window_get_size(CTX_wm_window(C), &winx, &winy);
- if(x2 > winx) {
+ if (x2 > winx) {
/* super size */
- if(x2 > winx + x1) {
- x2= winx;
- x1= 0;
+ if (x2 > winx + x1) {
+ x2 = winx;
+ x1 = 0;
}
else {
- x1 -= x2-winx;
- x2= winx;
+ x1 -= x2 - winx;
+ x2 = winx;
}
}
/* ensure at least 5 px above screen bounds
* 25 is just a guess to be above the menu item */
- if(y1 < 5) {
+ if (y1 < 5) {
y2 += (-y1) + 30;
y1 = 30;
}
/* widget rect, in region coords */
- data->bbox.xmin= MENU_SHADOW_SIDE;
- data->bbox.xmax= x2-x1 + MENU_SHADOW_SIDE;
- data->bbox.ymin= MENU_SHADOW_BOTTOM;
- data->bbox.ymax= y2-y1 + MENU_SHADOW_BOTTOM;
+ data->bbox.xmin = MENU_SHADOW_SIDE;
+ data->bbox.xmax = x2 - x1 + MENU_SHADOW_SIDE;
+ data->bbox.ymin = MENU_SHADOW_BOTTOM;
+ data->bbox.ymax = y2 - y1 + MENU_SHADOW_BOTTOM;
/* region bigger for shadow */
- ar->winrct.xmin= x1 - MENU_SHADOW_SIDE;
- ar->winrct.xmax= x2 + MENU_SHADOW_SIDE;
- ar->winrct.ymin= y1 - MENU_SHADOW_BOTTOM;
- ar->winrct.ymax= y2 + MENU_TOP;
+ ar->winrct.xmin = x1 - MENU_SHADOW_SIDE;
+ ar->winrct.xmax = x2 + MENU_SHADOW_SIDE;
+ ar->winrct.ymin = y1 - MENU_SHADOW_BOTTOM;
+ ar->winrct.ymax = y2 + MENU_TOP;
/* adds subwindow */
ED_region_init(C, ar);
@@ -646,49 +707,49 @@ typedef struct uiSearchboxData {
rcti bbox;
uiFontStyle fstyle;
uiSearchItems items;
- int active; /* index in items array */
- int noback; /* when menu opened with enough space for this */
- int preview; /* draw thumbnail previews, rather than list */
+ int active; /* index in items array */
+ int noback; /* when menu opened with enough space for this */
+ int preview; /* draw thumbnail previews, rather than list */
int prv_rows, prv_cols;
} uiSearchboxData;
-#define SEARCH_ITEMS 10
+#define SEARCH_ITEMS 10
/* exported for use by search callbacks */
/* returns zero if nothing to add */
int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int iconid)
{
/* hijack for autocomplete */
- if(items->autocpl) {
+ if (items->autocpl) {
autocomplete_do_name(items->autocpl, name);
return 1;
}
/* hijack for finding active item */
- if(items->active) {
- if(poin==items->active)
- items->offset_i= items->totitem;
+ if (items->active) {
+ if (poin == items->active)
+ items->offset_i = items->totitem;
items->totitem++;
return 1;
}
- if(items->totitem>=items->maxitem) {
- items->more= 1;
+ if (items->totitem >= items->maxitem) {
+ items->more = 1;
return 0;
}
/* skip first items in list */
- if(items->offset_i > 0) {
+ if (items->offset_i > 0) {
items->offset_i--;
return 1;
}
- if(items->names)
+ if (items->names)
BLI_strncpy(items->names[items->totitem], name, items->maxstrlen);
- if(items->pointers)
- items->pointers[items->totitem]= poin;
- if(items->icons)
- items->icons[items->totitem]= iconid;
+ if (items->pointers)
+ items->pointers[items->totitem] = poin;
+ if (items->icons)
+ items->icons[items->totitem] = iconid;
items->totitem++;
@@ -697,36 +758,36 @@ int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int icon
int uiSearchBoxhHeight(void)
{
- return SEARCH_ITEMS*UI_UNIT_Y + 2*MENU_TOP;
+ return SEARCH_ITEMS * UI_UNIT_Y + 2 * MENU_TOP;
}
/* ar is the search box itself */
static void ui_searchbox_select(bContext *C, ARegion *ar, uiBut *but, int step)
{
- uiSearchboxData *data= ar->regiondata;
+ uiSearchboxData *data = ar->regiondata;
/* apply step */
- data->active+= step;
+ data->active += step;
- if(data->items.totitem==0)
- data->active= 0;
- else if(data->active > data->items.totitem) {
- if(data->items.more) {
+ if (data->items.totitem == 0)
+ data->active = 0;
+ else if (data->active > data->items.totitem) {
+ if (data->items.more) {
data->items.offset++;
- data->active= data->items.totitem;
+ data->active = data->items.totitem;
ui_searchbox_update(C, ar, but, 0);
}
else
- data->active= data->items.totitem;
+ data->active = data->items.totitem;
}
- else if(data->active < 1) {
- if(data->items.offset) {
+ else if (data->active < 1) {
+ if (data->items.offset) {
data->items.offset--;
- data->active= 1;
+ data->active = 1;
ui_searchbox_update(C, ar, but, 0);
}
- else if(data->active < 0)
- data->active= 0;
+ else if (data->active < 0)
+ data->active = 0;
}
ED_region_tag_redraw(ar);
@@ -736,11 +797,11 @@ static void ui_searchbox_butrect(rcti *rect, uiSearchboxData *data, int itemnr)
{
/* thumbnail preview */
if (data->preview) {
- int buth = (data->bbox.ymax - data->bbox.ymin - 2*MENU_TOP) / data->prv_rows;
+ int buth = (data->bbox.ymax - data->bbox.ymin - 2 * MENU_TOP) / data->prv_rows;
int butw = (data->bbox.xmax - data->bbox.xmin) / data->prv_cols;
int row, col;
- *rect= data->bbox;
+ *rect = data->bbox;
col = itemnr % data->prv_cols;
row = itemnr / data->prv_cols;
@@ -753,14 +814,14 @@ static void ui_searchbox_butrect(rcti *rect, uiSearchboxData *data, int itemnr)
}
/* list view */
else {
- int buth= (data->bbox.ymax-data->bbox.ymin - 2*MENU_TOP)/SEARCH_ITEMS;
+ int buth = (data->bbox.ymax - data->bbox.ymin - 2 * MENU_TOP) / SEARCH_ITEMS;
- *rect= data->bbox;
- rect->xmin= data->bbox.xmin + 3.0f;
- rect->xmax= data->bbox.xmax - 3.0f;
+ *rect = data->bbox;
+ rect->xmin = data->bbox.xmin + 3.0f;
+ rect->xmax = data->bbox.xmax - 3.0f;
- rect->ymax= data->bbox.ymax - MENU_TOP - itemnr*buth;
- rect->ymin= rect->ymax - buth;
+ rect->ymax = data->bbox.ymax - MENU_TOP - itemnr * buth;
+ rect->ymin = rect->ymax - buth;
}
}
@@ -768,35 +829,35 @@ static void ui_searchbox_butrect(rcti *rect, uiSearchboxData *data, int itemnr)
/* x and y in screencoords */
int ui_searchbox_inside(ARegion *ar, int x, int y)
{
- uiSearchboxData *data= ar->regiondata;
+ uiSearchboxData *data = ar->regiondata;
- return(BLI_in_rcti(&data->bbox, x-ar->winrct.xmin, y-ar->winrct.ymin));
+ return(BLI_in_rcti(&data->bbox, x - ar->winrct.xmin, y - ar->winrct.ymin));
}
/* string validated to be of correct length (but->hardmax) */
void ui_searchbox_apply(uiBut *but, ARegion *ar)
{
- uiSearchboxData *data= ar->regiondata;
+ uiSearchboxData *data = ar->regiondata;
- but->func_arg2= NULL;
+ but->func_arg2 = NULL;
- if(data->active) {
- char *name= data->items.names[data->active-1];
- char *cpoin= strchr(name, '|');
+ if (data->active) {
+ char *name = data->items.names[data->active - 1];
+ char *cpoin = strchr(name, '|');
- if(cpoin) cpoin[0]= 0;
+ if (cpoin) cpoin[0] = 0;
BLI_strncpy(but->editstr, name, data->items.maxstrlen);
- if(cpoin) cpoin[0]= '|';
+ if (cpoin) cpoin[0] = '|';
- but->func_arg2= data->items.pointers[data->active-1];
+ but->func_arg2 = data->items.pointers[data->active - 1];
}
}
void ui_searchbox_event(bContext *C, ARegion *ar, uiBut *but, wmEvent *event)
{
- uiSearchboxData *data= ar->regiondata;
+ uiSearchboxData *data = ar->regiondata;
- switch(event->type) {
+ switch (event->type) {
case WHEELUPMOUSE:
case UPARROWKEY:
ui_searchbox_select(C, ar, but, -1);
@@ -806,15 +867,15 @@ void ui_searchbox_event(bContext *C, ARegion *ar, uiBut *but, wmEvent *event)
ui_searchbox_select(C, ar, but, 1);
break;
case MOUSEMOVE:
- if(BLI_in_rcti(&ar->winrct, event->x, event->y)) {
+ if (BLI_in_rcti(&ar->winrct, event->x, event->y)) {
rcti rect;
int a;
- for(a=0; a<data->items.totitem; a++) {
+ for (a = 0; a < data->items.totitem; a++) {
ui_searchbox_butrect(&rect, data, a);
- if(BLI_in_rcti(&rect, event->x - ar->winrct.xmin, event->y - ar->winrct.ymin)) {
- if( data->active!= a+1) {
- data->active= a+1;
+ if (BLI_in_rcti(&rect, event->x - ar->winrct.xmin, event->y - ar->winrct.ymin)) {
+ if (data->active != a + 1) {
+ data->active = a + 1;
ui_searchbox_select(C, ar, but, 0);
break;
}
@@ -828,67 +889,67 @@ void ui_searchbox_event(bContext *C, ARegion *ar, uiBut *but, wmEvent *event)
/* ar is the search box itself */
void ui_searchbox_update(bContext *C, ARegion *ar, uiBut *but, int reset)
{
- uiSearchboxData *data= ar->regiondata;
+ uiSearchboxData *data = ar->regiondata;
/* reset vars */
- data->items.totitem= 0;
- data->items.more= 0;
- if(reset==0) {
- data->items.offset_i= data->items.offset;
+ data->items.totitem = 0;
+ data->items.more = 0;
+ if (reset == 0) {
+ data->items.offset_i = data->items.offset;
}
else {
- data->items.offset_i= data->items.offset= 0;
- data->active= 0;
+ data->items.offset_i = data->items.offset = 0;
+ data->active = 0;
/* handle active */
- if(but->search_func && but->func_arg2) {
- data->items.active= but->func_arg2;
+ if (but->search_func && but->func_arg2) {
+ data->items.active = but->func_arg2;
but->search_func(C, but->search_arg, but->editstr, &data->items);
- data->items.active= NULL;
+ data->items.active = NULL;
/* found active item, calculate real offset by centering it */
- if(data->items.totitem) {
+ if (data->items.totitem) {
/* first case, begin of list */
- if(data->items.offset_i < data->items.maxitem) {
- data->active= data->items.offset_i+1;
- data->items.offset_i= 0;
+ if (data->items.offset_i < data->items.maxitem) {
+ data->active = data->items.offset_i + 1;
+ data->items.offset_i = 0;
}
else {
/* second case, end of list */
- if(data->items.totitem - data->items.offset_i <= data->items.maxitem) {
- data->active= 1 + data->items.offset_i - data->items.totitem + data->items.maxitem;
- data->items.offset_i= data->items.totitem - data->items.maxitem;
+ if (data->items.totitem - data->items.offset_i <= data->items.maxitem) {
+ data->active = 1 + data->items.offset_i - data->items.totitem + data->items.maxitem;
+ data->items.offset_i = data->items.totitem - data->items.maxitem;
}
else {
/* center active item */
- data->items.offset_i -= data->items.maxitem/2;
- data->active= 1 + data->items.maxitem/2;
+ data->items.offset_i -= data->items.maxitem / 2;
+ data->active = 1 + data->items.maxitem / 2;
}
}
}
- data->items.offset= data->items.offset_i;
- data->items.totitem= 0;
+ data->items.offset = data->items.offset_i;
+ data->items.totitem = 0;
}
}
/* callback */
- if(but->search_func)
+ if (but->search_func)
but->search_func(C, but->search_arg, but->editstr, &data->items);
/* handle case where editstr is equal to one of items */
- if(reset && data->active==0) {
+ if (reset && data->active == 0) {
int a;
- for(a=0; a<data->items.totitem; a++) {
- char *cpoin= strchr(data->items.names[a], '|');
+ for (a = 0; a < data->items.totitem; a++) {
+ char *cpoin = strchr(data->items.names[a], '|');
- if(cpoin) cpoin[0]= 0;
- if(0==strcmp(but->editstr, data->items.names[a]))
- data->active= a+1;
- if(cpoin) cpoin[0]= '|';
+ if (cpoin) cpoin[0] = 0;
+ if (0 == strcmp(but->editstr, data->items.names[a]))
+ data->active = a + 1;
+ if (cpoin) cpoin[0] = '|';
}
- if(data->items.totitem==1 && but->editstr[0])
- data->active= 1;
+ if (data->items.totitem == 1 && but->editstr[0])
+ data->active = 1;
}
/* validate selected item */
@@ -899,79 +960,80 @@ void ui_searchbox_update(bContext *C, ARegion *ar, uiBut *but, int reset)
void ui_searchbox_autocomplete(bContext *C, ARegion *ar, uiBut *but, char *str)
{
- uiSearchboxData *data= ar->regiondata;
+ uiSearchboxData *data = ar->regiondata;
- if(str[0]) {
- data->items.autocpl= autocomplete_begin(str, ui_get_but_string_max_length(but));
+ if (str[0]) {
+ data->items.autocpl = autocomplete_begin(str, ui_get_but_string_max_length(but));
but->search_func(C, but->search_arg, but->editstr, &data->items);
autocomplete_end(data->items.autocpl, str);
- data->items.autocpl= NULL;
+ data->items.autocpl = NULL;
}
}
static void ui_searchbox_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
{
- uiSearchboxData *data= ar->regiondata;
+ uiSearchboxData *data = ar->regiondata;
/* pixel space */
- wmOrtho2(-0.01f, ar->winx-0.01f, -0.01f, ar->winy-0.01f);
+ wmOrtho2(-0.01f, ar->winx - 0.01f, -0.01f, ar->winy - 0.01f);
- if(!data->noback)
- ui_draw_search_back(NULL, NULL, &data->bbox); /* style not used yet */
+ if (!data->noback)
+ ui_draw_search_back(NULL, NULL, &data->bbox); /* style not used yet */
/* draw text */
- if(data->items.totitem) {
+ if (data->items.totitem) {
rcti rect;
int a;
if (data->preview) {
/* draw items */
- for(a=0; a<data->items.totitem; a++) {
+ for (a = 0; a < data->items.totitem; a++) {
ui_searchbox_butrect(&rect, data, a);
/* widget itself */
if (data->preview)
- ui_draw_preview_item(&data->fstyle, &rect, data->items.names[a], data->items.icons[a], (a+1)==data->active?UI_ACTIVE:0);
+ ui_draw_preview_item(&data->fstyle, &rect, data->items.names[a], data->items.icons[a], (a + 1) == data->active ? UI_ACTIVE : 0);
else
- ui_draw_menu_item(&data->fstyle, &rect, data->items.names[a], data->items.icons[a], (a+1)==data->active?UI_ACTIVE:0);
+ ui_draw_menu_item(&data->fstyle, &rect, data->items.names[a], data->items.icons[a], (a + 1) == data->active ? UI_ACTIVE : 0);
}
/* indicate more */
- if(data->items.more) {
- ui_searchbox_butrect(&rect, data, data->items.maxitem-1);
+ if (data->items.more) {
+ ui_searchbox_butrect(&rect, data, data->items.maxitem - 1);
glEnable(GL_BLEND);
- UI_icon_draw(rect.xmax-18, rect.ymin-7, ICON_TRIA_DOWN);
+ UI_icon_draw(rect.xmax - 18, rect.ymin - 7, ICON_TRIA_DOWN);
glDisable(GL_BLEND);
}
- if(data->items.offset) {
+ if (data->items.offset) {
ui_searchbox_butrect(&rect, data, 0);
glEnable(GL_BLEND);
- UI_icon_draw(rect.xmin, rect.ymax-9, ICON_TRIA_UP);
+ UI_icon_draw(rect.xmin, rect.ymax - 9, ICON_TRIA_UP);
glDisable(GL_BLEND);
}
- } else {
+ }
+ else {
/* draw items */
- for(a=0; a<data->items.totitem; a++) {
+ for (a = 0; a < data->items.totitem; a++) {
ui_searchbox_butrect(&rect, data, a);
/* widget itself */
- ui_draw_menu_item(&data->fstyle, &rect, data->items.names[a], data->items.icons[a], (a+1)==data->active?UI_ACTIVE:0);
+ ui_draw_menu_item(&data->fstyle, &rect, data->items.names[a], data->items.icons[a], (a + 1) == data->active ? UI_ACTIVE : 0);
}
/* indicate more */
- if(data->items.more) {
- ui_searchbox_butrect(&rect, data, data->items.maxitem-1);
+ if (data->items.more) {
+ ui_searchbox_butrect(&rect, data, data->items.maxitem - 1);
glEnable(GL_BLEND);
- UI_icon_draw((rect.xmax-rect.xmin)/2, rect.ymin-9, ICON_TRIA_DOWN);
+ UI_icon_draw((rect.xmax - rect.xmin) / 2, rect.ymin - 9, ICON_TRIA_DOWN);
glDisable(GL_BLEND);
}
- if(data->items.offset) {
+ if (data->items.offset) {
ui_searchbox_butrect(&rect, data, 0);
glEnable(GL_BLEND);
- UI_icon_draw((rect.xmax-rect.xmin)/2, rect.ymax-7, ICON_TRIA_UP);
+ UI_icon_draw((rect.xmax - rect.xmin) / 2, rect.ymax - 7, ICON_TRIA_UP);
glDisable(GL_BLEND);
}
}
@@ -980,7 +1042,7 @@ static void ui_searchbox_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
static void ui_searchbox_region_free_cb(ARegion *ar)
{
- uiSearchboxData *data= ar->regiondata;
+ uiSearchboxData *data = ar->regiondata;
int a;
/* free search data */
@@ -992,42 +1054,42 @@ static void ui_searchbox_region_free_cb(ARegion *ar)
MEM_freeN(data->items.icons);
MEM_freeN(data);
- ar->regiondata= NULL;
+ ar->regiondata = NULL;
}
ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
{
- uiStyle *style= UI_GetStyle();
+ uiStyle *style = UI_GetStyle();
static ARegionType type;
ARegion *ar;
uiSearchboxData *data;
- float aspect= but->block->aspect;
+ float aspect = but->block->aspect;
float x1f, x2f, y1f, y2f;
int x1, x2, y1, y2, winx, winy, ofsx, ofsy;
/* create area region */
- ar= ui_add_temporary_region(CTX_wm_screen(C));
+ ar = ui_add_temporary_region(CTX_wm_screen(C));
memset(&type, 0, sizeof(ARegionType));
- type.draw= ui_searchbox_region_draw_cb;
- type.free= ui_searchbox_region_free_cb;
- ar->type= &type;
+ type.draw = ui_searchbox_region_draw_cb;
+ type.free = ui_searchbox_region_free_cb;
+ ar->type = &type;
/* create searchbox data */
- data= MEM_callocN(sizeof(uiSearchboxData), "uiSearchboxData");
+ data = MEM_callocN(sizeof(uiSearchboxData), "uiSearchboxData");
/* set font, get bb */
- data->fstyle= style->widget; /* copy struct */
- data->fstyle.align= UI_STYLE_TEXT_CENTER;
+ data->fstyle = style->widget; /* copy struct */
+ data->fstyle.align = UI_STYLE_TEXT_CENTER;
ui_fontscale(&data->fstyle.points, aspect);
uiStyleFontSet(&data->fstyle);
- ar->regiondata= data;
+ ar->regiondata = data;
/* special case, hardcoded feature, not draw backdrop when called from menus,
- assume for design that popup already added it */
- if(but->block->flag & UI_BLOCK_LOOP)
- data->noback= 1;
+ * assume for design that popup already added it */
+ if (but->block->flag & UI_BLOCK_LOOP)
+ data->noback = 1;
if (but->a1 > 0 && but->a2 > 0) {
data->preview = 1;
@@ -1036,34 +1098,34 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
}
/* compute position */
- if(but->block->flag & UI_BLOCK_LOOP) {
+ if (but->block->flag & UI_BLOCK_LOOP) {
/* this case is search menu inside other menu */
/* we copy region size */
- ar->winrct= butregion->winrct;
+ ar->winrct = butregion->winrct;
/* widget rect, in region coords */
- data->bbox.xmin= MENU_SHADOW_SIDE;
- data->bbox.xmax= (ar->winrct.xmax-ar->winrct.xmin) - MENU_SHADOW_SIDE;
- data->bbox.ymin= MENU_SHADOW_BOTTOM;
- data->bbox.ymax= (ar->winrct.ymax-ar->winrct.ymin) - MENU_SHADOW_BOTTOM;
+ data->bbox.xmin = MENU_SHADOW_SIDE;
+ data->bbox.xmax = (ar->winrct.xmax - ar->winrct.xmin) - MENU_SHADOW_SIDE;
+ data->bbox.ymin = MENU_SHADOW_BOTTOM;
+ data->bbox.ymax = (ar->winrct.ymax - ar->winrct.ymin) - MENU_SHADOW_BOTTOM;
/* check if button is lower half */
- if( but->y2 < (but->block->miny+but->block->maxy)/2 ) {
- data->bbox.ymin += (but->y2-but->y1);
+ if (but->y2 < (but->block->miny + but->block->maxy) / 2) {
+ data->bbox.ymin += (but->y2 - but->y1);
}
else {
- data->bbox.ymax -= (but->y2-but->y1);
+ data->bbox.ymax -= (but->y2 - but->y1);
}
}
else {
- x1f= but->x1 - 5; /* align text with button */
- x2f= but->x2 + 5; /* symmetrical */
- y2f= but->y1;
- y1f= y2f - uiSearchBoxhHeight();
+ x1f = but->x1 - 5; /* align text with button */
+ x2f = but->x2 + 5; /* symmetrical */
+ y2f = but->y1;
+ y1f = y2f - uiSearchBoxhHeight();
- ofsx= (but->block->panel)? but->block->panel->ofsx: 0;
- ofsy= (but->block->panel)? but->block->panel->ofsy: 0;
+ ofsx = (but->block->panel) ? but->block->panel->ofsx : 0;
+ ofsy = (but->block->panel) ? but->block->panel->ofsy : 0;
x1f += ofsx;
x2f += ofsx;
@@ -1071,12 +1133,12 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
y2f += ofsy;
/* minimal width */
- if(x2f - x1f < 150) x2f= x1f+150; // XXX arbitrary
+ if (x2f - x1f < 150) x2f = x1f + 150; // XXX arbitrary
/* copy to int, gets projected if possible too */
- x1= x1f; y1= y1f; x2= x2f; y2= y2f;
+ x1 = x1f; y1 = y1f; x2 = x2f; y2 = y2f;
- if(butregion->v2d.cur.xmin != butregion->v2d.cur.xmax) {
+ if (butregion->v2d.cur.xmin != butregion->v2d.cur.xmax) {
UI_view2d_to_region_no_clip(&butregion->v2d, x1f, y1f, &x1, &y1);
UI_view2d_to_region_no_clip(&butregion->v2d, x2f, y2f, &x2, &y2);
}
@@ -1088,38 +1150,38 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
wm_window_get_size(CTX_wm_window(C), &winx, &winy);
- if(x2 > winx) {
+ if (x2 > winx) {
/* super size */
- if(x2 > winx + x1) {
- x2= winx;
- x1= 0;
+ if (x2 > winx + x1) {
+ x2 = winx;
+ x1 = 0;
}
else {
- x1 -= x2-winx;
- x2= winx;
+ x1 -= x2 - winx;
+ x2 = winx;
}
}
- if(y1 < 0) {
+ if (y1 < 0) {
int newy1;
UI_view2d_to_region_no_clip(&butregion->v2d, 0, but->y2 + ofsy, NULL, &newy1);
newy1 += butregion->winrct.ymin;
- y2= y2-y1 + newy1;
- y1= newy1;
+ y2 = y2 - y1 + newy1;
+ y1 = newy1;
}
/* widget rect, in region coords */
- data->bbox.xmin= MENU_SHADOW_SIDE;
- data->bbox.xmax= x2-x1 + MENU_SHADOW_SIDE;
- data->bbox.ymin= MENU_SHADOW_BOTTOM;
- data->bbox.ymax= y2-y1 + MENU_SHADOW_BOTTOM;
+ data->bbox.xmin = MENU_SHADOW_SIDE;
+ data->bbox.xmax = x2 - x1 + MENU_SHADOW_SIDE;
+ data->bbox.ymin = MENU_SHADOW_BOTTOM;
+ data->bbox.ymax = y2 - y1 + MENU_SHADOW_BOTTOM;
/* region bigger for shadow */
- ar->winrct.xmin= x1 - MENU_SHADOW_SIDE;
- ar->winrct.xmax= x2 + MENU_SHADOW_SIDE;
- ar->winrct.ymin= y1 - MENU_SHADOW_BOTTOM;
- ar->winrct.ymax= y2;
+ ar->winrct.xmin = x1 - MENU_SHADOW_SIDE;
+ ar->winrct.xmax = x2 + MENU_SHADOW_SIDE;
+ ar->winrct.ymin = y1 - MENU_SHADOW_BOTTOM;
+ ar->winrct.ymax = y2;
}
/* adds subwindow */
@@ -1130,17 +1192,18 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
/* prepare search data */
if (data->preview) {
- data->items.maxitem= data->prv_rows * data->prv_cols;
- } else {
- data->items.maxitem= SEARCH_ITEMS;
- }
- data->items.maxstrlen= but->hardmax;
- data->items.totitem= 0;
- data->items.names= MEM_callocN(data->items.maxitem*sizeof(void *), "search names");
- data->items.pointers= MEM_callocN(data->items.maxitem*sizeof(void *), "search pointers");
- data->items.icons= MEM_callocN(data->items.maxitem*sizeof(int), "search icons");
- for(x1=0; x1<data->items.maxitem; x1++)
- data->items.names[x1]= MEM_callocN(but->hardmax+1, "search pointers");
+ data->items.maxitem = data->prv_rows * data->prv_cols;
+ }
+ else {
+ data->items.maxitem = SEARCH_ITEMS;
+ }
+ data->items.maxstrlen = but->hardmax;
+ data->items.totitem = 0;
+ data->items.names = MEM_callocN(data->items.maxitem * sizeof(void *), "search names");
+ data->items.pointers = MEM_callocN(data->items.maxitem * sizeof(void *), "search pointers");
+ data->items.icons = MEM_callocN(data->items.maxitem * sizeof(int), "search icons");
+ for (x1 = 0; x1 < data->items.maxitem; x1++)
+ data->items.names[x1] = MEM_callocN(but->hardmax + 1, "search pointers");
return ar;
}
@@ -1159,29 +1222,29 @@ void ui_but_search_test(uiBut *but)
/* possibly very large lists (such as ID datablocks) only
* only validate string RNA buts (not pointers) */
- if(but->rnaprop && RNA_property_type(but->rnaprop) != PROP_STRING) {
+ if (but->rnaprop && RNA_property_type(but->rnaprop) != PROP_STRING) {
return;
}
- items= MEM_callocN(sizeof(uiSearchItems), "search items");
+ items = MEM_callocN(sizeof(uiSearchItems), "search items");
/* setup search struct */
- items->maxitem= 10;
- items->maxstrlen= 256;
- items->names= MEM_callocN(items->maxitem*sizeof(void *), "search names");
- for(x1=0; x1<items->maxitem; x1++)
- items->names[x1]= MEM_callocN(but->hardmax+1, "search names");
+ items->maxitem = 10;
+ items->maxstrlen = 256;
+ items->names = MEM_callocN(items->maxitem * sizeof(void *), "search names");
+ for (x1 = 0; x1 < items->maxitem; x1++)
+ items->names[x1] = MEM_callocN(but->hardmax + 1, "search names");
but->search_func(but->block->evil_C, but->search_arg, but->drawstr, items);
/* only redalert when we are sure of it, this can miss cases when >10 matches */
- if(items->totitem==0)
+ if (items->totitem == 0)
uiButSetFlag(but, UI_BUT_REDALERT);
- else if(items->more==0) {
- for(x1= 0; x1<items->totitem; x1++)
- if(strcmp(but->drawstr, items->names[x1])==0)
+ else if (items->more == 0) {
+ for (x1 = 0; x1 < items->totitem; x1++)
+ if (strcmp(but->drawstr, items->names[x1]) == 0)
break;
- if(x1==items->totitem)
+ if (x1 == items->totitem)
uiButSetFlag(but, UI_BUT_REDALERT);
}
@@ -1202,37 +1265,37 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
uiSafetyRct *saferct;
rctf butrct;
/*float aspect;*/ /*UNUSED*/
- int xsize, ysize, xof=0, yof=0, center;
- short dir1= 0, dir2=0;
+ int xsize, ysize, xof = 0, yof = 0, center;
+ short dir1 = 0, dir2 = 0;
/* transform to window coordinates, using the source button region/block */
- butrct.xmin= but->x1; butrct.xmax= but->x2;
- butrct.ymin= but->y1; butrct.ymax= but->y2;
+ butrct.xmin = but->x1; butrct.xmax = but->x2;
+ butrct.ymin = but->y1; butrct.ymax = but->y2;
ui_block_to_window_fl(butregion, but->block, &butrct.xmin, &butrct.ymin);
ui_block_to_window_fl(butregion, but->block, &butrct.xmax, &butrct.ymax);
/* calc block rect */
- if(block->minx == 0.0f && block->maxx == 0.0f) {
- if(block->buttons.first) {
- block->minx= block->miny= 10000;
- block->maxx= block->maxy= -10000;
+ if (block->minx == 0.0f && block->maxx == 0.0f) {
+ if (block->buttons.first) {
+ block->minx = block->miny = 10000;
+ block->maxx = block->maxy = -10000;
- bt= block->buttons.first;
- while(bt) {
- if(bt->x1 < block->minx) block->minx= bt->x1;
- if(bt->y1 < block->miny) block->miny= bt->y1;
+ bt = block->buttons.first;
+ while (bt) {
+ if (bt->x1 < block->minx) block->minx = bt->x1;
+ if (bt->y1 < block->miny) block->miny = bt->y1;
- if(bt->x2 > block->maxx) block->maxx= bt->x2;
- if(bt->y2 > block->maxy) block->maxy= bt->y2;
+ if (bt->x2 > block->maxx) block->maxx = bt->x2;
+ if (bt->y2 > block->maxy) block->maxy = bt->y2;
- bt= bt->next;
+ bt = bt->next;
}
}
else {
/* we're nice and allow empty blocks too */
- block->minx= block->miny= 0;
- block->maxx= block->maxy= 20;
+ block->minx = block->miny = 0;
+ block->maxx = block->maxy = 20;
}
}
@@ -1243,124 +1306,124 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
//block->minx-= 2.0; block->miny-= 2.0;
//block->maxx+= 2.0; block->maxy+= 2.0;
- xsize= block->maxx - block->minx+4; // 4 for shadow
- ysize= block->maxy - block->miny+4;
+ xsize = block->maxx - block->minx + 4; // 4 for shadow
+ ysize = block->maxy - block->miny + 4;
/*aspect/= (float)xsize;*/ /*UNUSED*/
{
- int left=0, right=0, top=0, down=0;
+ int left = 0, right = 0, top = 0, down = 0;
int winx, winy;
// int offscreen;
wm_window_get_size(window, &winx, &winy);
- if(block->direction & UI_CENTER) center= ysize/2;
- else center= 0;
+ if (block->direction & UI_CENTER) center = ysize / 2;
+ else center = 0;
/* check if there's space at all */
- if( butrct.xmin-xsize > 0.0f) left= 1;
- if( butrct.xmax+xsize < winx) right= 1;
- if( butrct.ymin-ysize+center > 0.0f) down= 1;
- if( butrct.ymax+ysize-center < winy) top= 1;
-
- if(top==0 && down==0) {
- if (butrct.ymin-ysize < winy-butrct.ymax-ysize)
- top= 1;
+ if (butrct.xmin - xsize > 0.0f) left = 1;
+ if (butrct.xmax + xsize < winx) right = 1;
+ if (butrct.ymin - ysize + center > 0.0f) down = 1;
+ if (butrct.ymax + ysize - center < winy) top = 1;
+
+ if (top == 0 && down == 0) {
+ if (butrct.ymin - ysize < winy - butrct.ymax - ysize)
+ top = 1;
else
- down= 1;
+ down = 1;
}
- dir1= block->direction & UI_DIRECTION;
+ dir1 = block->direction & UI_DIRECTION;
/* secundary directions */
- if(dir1 & (UI_TOP|UI_DOWN)) {
- if(dir1 & UI_LEFT) dir2= UI_LEFT;
- else if(dir1 & UI_RIGHT) dir2= UI_RIGHT;
- dir1 &= (UI_TOP|UI_DOWN);
+ if (dir1 & (UI_TOP | UI_DOWN)) {
+ if (dir1 & UI_LEFT) dir2 = UI_LEFT;
+ else if (dir1 & UI_RIGHT) dir2 = UI_RIGHT;
+ dir1 &= (UI_TOP | UI_DOWN);
}
- if(dir2==0) if(dir1==UI_LEFT || dir1==UI_RIGHT) dir2= UI_DOWN;
- if(dir2==0) if(dir1==UI_TOP || dir1==UI_DOWN) dir2= UI_LEFT;
+ if (dir2 == 0) if (dir1 == UI_LEFT || dir1 == UI_RIGHT) dir2 = UI_DOWN;
+ if (dir2 == 0) if (dir1 == UI_TOP || dir1 == UI_DOWN) dir2 = UI_LEFT;
- /* no space at all? dont change */
- if(left || right) {
- if(dir1==UI_LEFT && left==0) dir1= UI_RIGHT;
- if(dir1==UI_RIGHT && right==0) dir1= UI_LEFT;
+ /* no space at all? don't change */
+ if (left || right) {
+ if (dir1 == UI_LEFT && left == 0) dir1 = UI_RIGHT;
+ if (dir1 == UI_RIGHT && right == 0) dir1 = UI_LEFT;
/* this is aligning, not append! */
- if(dir2==UI_LEFT && right==0) dir2= UI_RIGHT;
- if(dir2==UI_RIGHT && left==0) dir2= UI_LEFT;
- }
- if(down || top) {
- if(dir1==UI_TOP && top==0) dir1= UI_DOWN;
- if(dir1==UI_DOWN && down==0) dir1= UI_TOP;
- if(dir2==UI_TOP && top==0) dir2= UI_DOWN;
- if(dir2==UI_DOWN && down==0) dir2= UI_TOP;
- }
-
- if(dir1==UI_LEFT) {
- xof= butrct.xmin - block->maxx;
- if(dir2==UI_TOP) yof= butrct.ymin - block->miny-center;
- else yof= butrct.ymax - block->maxy+center;
- }
- else if(dir1==UI_RIGHT) {
- xof= butrct.xmax - block->minx;
- if(dir2==UI_TOP) yof= butrct.ymin - block->miny-center;
- else yof= butrct.ymax - block->maxy+center;
- }
- else if(dir1==UI_TOP) {
- yof= butrct.ymax - block->miny;
- if(dir2==UI_RIGHT) xof= butrct.xmax - block->maxx;
- else xof= butrct.xmin - block->minx;
+ if (dir2 == UI_LEFT && right == 0) dir2 = UI_RIGHT;
+ if (dir2 == UI_RIGHT && left == 0) dir2 = UI_LEFT;
+ }
+ if (down || top) {
+ if (dir1 == UI_TOP && top == 0) dir1 = UI_DOWN;
+ if (dir1 == UI_DOWN && down == 0) dir1 = UI_TOP;
+ if (dir2 == UI_TOP && top == 0) dir2 = UI_DOWN;
+ if (dir2 == UI_DOWN && down == 0) dir2 = UI_TOP;
+ }
+
+ if (dir1 == UI_LEFT) {
+ xof = butrct.xmin - block->maxx;
+ if (dir2 == UI_TOP) yof = butrct.ymin - block->miny - center;
+ else yof = butrct.ymax - block->maxy + center;
+ }
+ else if (dir1 == UI_RIGHT) {
+ xof = butrct.xmax - block->minx;
+ if (dir2 == UI_TOP) yof = butrct.ymin - block->miny - center;
+ else yof = butrct.ymax - block->maxy + center;
+ }
+ else if (dir1 == UI_TOP) {
+ yof = butrct.ymax - block->miny;
+ if (dir2 == UI_RIGHT) xof = butrct.xmax - block->maxx;
+ else xof = butrct.xmin - block->minx;
// changed direction?
- if((dir1 & block->direction)==0) {
- if(block->direction & UI_SHIFT_FLIPPED)
- xof+= dir2==UI_LEFT?25:-25;
+ if ((dir1 & block->direction) == 0) {
+ if (block->direction & UI_SHIFT_FLIPPED)
+ xof += dir2 == UI_LEFT ? 25 : -25;
uiBlockFlipOrder(block);
}
}
- else if(dir1==UI_DOWN) {
- yof= butrct.ymin - block->maxy;
- if(dir2==UI_RIGHT) xof= butrct.xmax - block->maxx;
- else xof= butrct.xmin - block->minx;
+ else if (dir1 == UI_DOWN) {
+ yof = butrct.ymin - block->maxy;
+ if (dir2 == UI_RIGHT) xof = butrct.xmax - block->maxx;
+ else xof = butrct.xmin - block->minx;
// changed direction?
- if((dir1 & block->direction)==0) {
- if(block->direction & UI_SHIFT_FLIPPED)
- xof+= dir2==UI_LEFT?25:-25;
+ if ((dir1 & block->direction) == 0) {
+ if (block->direction & UI_SHIFT_FLIPPED)
+ xof += dir2 == UI_LEFT ? 25 : -25;
uiBlockFlipOrder(block);
}
}
/* and now we handle the exception; no space below or to top */
- if(top==0 && down==0) {
- if(dir1==UI_LEFT || dir1==UI_RIGHT) {
+ if (top == 0 && down == 0) {
+ if (dir1 == UI_LEFT || dir1 == UI_RIGHT) {
// align with bottom of screen
// yof= ysize; (not with menu scrolls)
}
}
/* or no space left or right */
- if(left==0 && right==0) {
- if(dir1==UI_TOP || dir1==UI_DOWN) {
+ if (left == 0 && right == 0) {
+ if (dir1 == UI_TOP || dir1 == UI_DOWN) {
// align with left size of screen
- xof= -block->minx+5;
+ xof = -block->minx + 5;
}
}
// apply requested offset in the block
- xof += block->xofs/block->aspect;
- yof += block->yofs/block->aspect;
+ xof += block->xofs / block->aspect;
+ yof += block->yofs / block->aspect;
#if 0
/* clamp to window bounds, could be made into an option if its ever annoying */
- if( (offscreen= (block->miny+yof)) < 0) yof -= offscreen; /* bottom */
- else if((offscreen= (block->maxy+yof)-winy) > 0) yof -= offscreen; /* top */
- if( (offscreen= (block->minx+xof)) < 0) xof -= offscreen; /* left */
- else if((offscreen= (block->maxx+xof)-winx) > 0) xof -= offscreen; /* right */
+ if ( (offscreen = (block->miny + yof)) < 0) yof -= offscreen; /* bottom */
+ else if ((offscreen = (block->maxy + yof) - winy) > 0) yof -= offscreen; /* top */
+ if ( (offscreen = (block->minx + xof)) < 0) xof -= offscreen; /* left */
+ else if ((offscreen = (block->maxx + xof) - winx) > 0) xof -= offscreen; /* right */
#endif
}
/* apply offset, buttons in window coords */
- for(bt= block->buttons.first; bt; bt= bt->next) {
+ for (bt = block->buttons.first; bt; bt = bt->next) {
ui_block_to_window_fl(butregion, but->block, &bt->x1, &bt->y1);
ui_block_to_window_fl(butregion, but->block, &bt->x2, &bt->y2);
@@ -1369,7 +1432,7 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
bt->y1 += yof;
bt->y2 += yof;
- bt->aspect= 1.0;
+ bt->aspect = 1.0;
// ui_check_but recalculates drawstring size in pixels
ui_check_but(bt);
}
@@ -1380,46 +1443,46 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
block->maxy += yof;
/* safety calculus */
- if(but) {
- float midx= (butrct.xmin+butrct.xmax)/2.0f;
- float midy= (butrct.ymin+butrct.ymax)/2.0f;
+ if (but) {
+ float midx = (butrct.xmin + butrct.xmax) / 2.0f;
+ float midy = (butrct.ymin + butrct.ymax) / 2.0f;
/* when you are outside parent button, safety there should be smaller */
// parent button to left
- if( midx < block->minx ) block->safety.xmin= block->minx-3;
- else block->safety.xmin= block->minx-40;
+ if (midx < block->minx) block->safety.xmin = block->minx - 3;
+ else block->safety.xmin = block->minx - 40;
// parent button to right
- if( midx > block->maxx ) block->safety.xmax= block->maxx+3;
- else block->safety.xmax= block->maxx+40;
+ if (midx > block->maxx) block->safety.xmax = block->maxx + 3;
+ else block->safety.xmax = block->maxx + 40;
// parent button on bottom
- if( midy < block->miny ) block->safety.ymin= block->miny-3;
- else block->safety.ymin= block->miny-40;
+ if (midy < block->miny) block->safety.ymin = block->miny - 3;
+ else block->safety.ymin = block->miny - 40;
// parent button on top
- if( midy > block->maxy ) block->safety.ymax= block->maxy+3;
- else block->safety.ymax= block->maxy+40;
+ if (midy > block->maxy) block->safety.ymax = block->maxy + 3;
+ else block->safety.ymax = block->maxy + 40;
// exception for switched pulldowns...
- if(dir1 && (dir1 & block->direction)==0) {
- if(dir2==UI_RIGHT) block->safety.xmax= block->maxx+3;
- if(dir2==UI_LEFT) block->safety.xmin= block->minx-3;
+ if (dir1 && (dir1 & block->direction) == 0) {
+ if (dir2 == UI_RIGHT) block->safety.xmax = block->maxx + 3;
+ if (dir2 == UI_LEFT) block->safety.xmin = block->minx - 3;
}
- block->direction= dir1;
+ block->direction = dir1;
}
else {
- block->safety.xmin= block->minx-40;
- block->safety.ymin= block->miny-40;
- block->safety.xmax= block->maxx+40;
- block->safety.ymax= block->maxy+40;
+ block->safety.xmin = block->minx - 40;
+ block->safety.ymin = block->miny - 40;
+ block->safety.xmax = block->maxx + 40;
+ block->safety.ymax = block->maxy + 40;
}
/* keep a list of these, needed for pulldown menus */
- saferct= MEM_callocN(sizeof(uiSafetyRct), "uiSafetyRct");
- saferct->parent= butrct;
- saferct->safety= block->safety;
+ saferct = MEM_callocN(sizeof(uiSafetyRct), "uiSafetyRct");
+ saferct->parent = butrct;
+ saferct->safety = block->safety;
BLI_freelistN(&block->saferct);
- if(but)
+ if (but)
BLI_duplicatelist(&block->saferct, &but->block->saferct);
BLI_addhead(&block->saferct, saferct);
}
@@ -1428,7 +1491,7 @@ static void ui_block_region_draw(const bContext *C, ARegion *ar)
{
uiBlock *block;
- for(block=ar->uiblocks.first; block; block=block->next)
+ for (block = ar->uiblocks.first; block; block = block->next)
uiDrawBlock(C, block);
}
@@ -1438,15 +1501,15 @@ static void ui_popup_block_clip(wmWindow *window, uiBlock *block)
wm_window_get_size(window, &winx, &winy);
- if(block->minx < MENU_SHADOW_SIDE)
- block->minx= MENU_SHADOW_SIDE;
- if(block->maxx > winx-MENU_SHADOW_SIDE)
- block->maxx= winx-MENU_SHADOW_SIDE;
+ if (block->minx < MENU_SHADOW_SIDE)
+ block->minx = MENU_SHADOW_SIDE;
+ if (block->maxx > winx - MENU_SHADOW_SIDE)
+ block->maxx = winx - MENU_SHADOW_SIDE;
- if(block->miny < MENU_SHADOW_BOTTOM)
- block->miny= MENU_SHADOW_BOTTOM;
- if(block->maxy > winy-MENU_TOP)
- block->maxy= winy-MENU_TOP;
+ if (block->miny < MENU_SHADOW_BOTTOM)
+ block->miny = MENU_SHADOW_BOTTOM;
+ if (block->maxy > winy - MENU_TOP)
+ block->maxy = winy - MENU_TOP;
}
void ui_popup_block_scrolltest(uiBlock *block)
@@ -1455,35 +1518,35 @@ void ui_popup_block_scrolltest(uiBlock *block)
/* Knowing direction is necessary for multi-column menus... */
int is_flip = (block->direction & UI_TOP) && !(block->flag & UI_BLOCK_NO_FLIP);
- block->flag &= ~(UI_BLOCK_CLIPBOTTOM|UI_BLOCK_CLIPTOP);
+ block->flag &= ~(UI_BLOCK_CLIPBOTTOM | UI_BLOCK_CLIPTOP);
- for(bt= block->buttons.first; bt; bt= bt->next)
+ for (bt = block->buttons.first; bt; bt = bt->next)
bt->flag &= ~UI_SCROLLED;
- if(block->buttons.first==block->buttons.last)
+ if (block->buttons.first == block->buttons.last)
return;
/* mark buttons that are outside boundary and the ones next to it for arrow(s) */
- for(bt= block->buttons.first; bt; bt= bt->next) {
- if(bt->y1 < block->miny) {
+ for (bt = block->buttons.first; bt; bt = bt->next) {
+ if (bt->y1 < block->miny) {
bt->flag |= UI_SCROLLED;
block->flag |= UI_BLOCK_CLIPBOTTOM;
/* make space for arrow */
- if(bt->y2 < block->miny +10) {
- if(is_flip && bt->next && bt->next->y1 > bt->y1)
+ if (bt->y2 < block->miny + 10) {
+ if (is_flip && bt->next && bt->next->y1 > bt->y1)
bt->next->flag |= UI_SCROLLED;
- else if(!is_flip && bt->prev && bt->prev->y1 > bt->y1)
+ else if (!is_flip && bt->prev && bt->prev->y1 > bt->y1)
bt->prev->flag |= UI_SCROLLED;
}
}
- if(bt->y2 > block->maxy) {
+ if (bt->y2 > block->maxy) {
bt->flag |= UI_SCROLLED;
block->flag |= UI_BLOCK_CLIPTOP;
/* make space for arrow */
- if(bt->y1 > block->maxy -10) {
- if(!is_flip && bt->next && bt->next->y2 < bt->y2)
+ if (bt->y1 > block->maxy - 10) {
+ if (!is_flip && bt->next && bt->next->y2 < bt->y2)
bt->next->flag |= UI_SCROLLED;
- else if(is_flip && bt->prev && bt->prev->y2 < bt->y2)
+ else if (is_flip && bt->prev && bt->prev->y2 < bt->y2)
bt->prev->flag |= UI_SCROLLED;
}
}
@@ -1492,7 +1555,7 @@ void ui_popup_block_scrolltest(uiBlock *block)
uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut *but, uiBlockCreateFunc create_func, uiBlockHandleCreateFunc handle_create_func, void *arg)
{
- wmWindow *window= CTX_wm_window(C);
+ wmWindow *window = CTX_wm_window(C);
static ARegionType type;
ARegion *ar;
uiBlock *block;
@@ -1501,45 +1564,45 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut
uiSafetyRct *saferct;
/* create handle */
- handle= MEM_callocN(sizeof(uiPopupBlockHandle), "uiPopupBlockHandle");
+ handle = MEM_callocN(sizeof(uiPopupBlockHandle), "uiPopupBlockHandle");
/* store context for operator */
- handle->ctx_area= CTX_wm_area(C);
- handle->ctx_region= CTX_wm_region(C);
+ handle->ctx_area = CTX_wm_area(C);
+ handle->ctx_region = CTX_wm_region(C);
/* create area region */
- ar= ui_add_temporary_region(CTX_wm_screen(C));
- handle->region= ar;
+ ar = ui_add_temporary_region(CTX_wm_screen(C));
+ handle->region = ar;
memset(&type, 0, sizeof(ARegionType));
- type.draw= ui_block_region_draw;
- ar->type= &type;
+ type.draw = ui_block_region_draw;
+ ar->type = &type;
UI_add_region_handlers(&ar->handlers);
/* create ui block */
- if(create_func)
- block= create_func(C, handle->region, arg);
+ if (create_func)
+ block = create_func(C, handle->region, arg);
else
- block= handle_create_func(C, handle, arg);
+ block = handle_create_func(C, handle, arg);
- if(block->handle) {
+ if (block->handle) {
memcpy(block->handle, handle, sizeof(uiPopupBlockHandle));
MEM_freeN(handle);
- handle= block->handle;
+ handle = block->handle;
}
else
- block->handle= handle;
+ block->handle = handle;
- ar->regiondata= handle;
+ ar->regiondata = handle;
- if(!block->endblock)
+ if (!block->endblock)
uiEndBlock(C, block);
/* if this is being created from a button */
- if(but) {
- if(ELEM(but->type, BLOCK, PULLDOWN))
- block->xofs = -2; /* for proper alignment */
+ if (but) {
+ if (ELEM(but->type, BLOCK, PULLDOWN))
+ block->xofs = -2; /* for proper alignment */
block->aspect = but->block->aspect;
@@ -1547,10 +1610,10 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut
}
else {
/* keep a list of these, needed for pulldown menus */
- saferct= MEM_callocN(sizeof(uiSafetyRct), "uiSafetyRct");
- saferct->safety= block->safety;
+ saferct = MEM_callocN(sizeof(uiSafetyRct), "uiSafetyRct");
+ saferct->safety = block->safety;
BLI_addhead(&block->saferct, saferct);
- block->flag |= UI_BLOCK_POPUP|UI_BLOCK_NUMSELECT;
+ block->flag |= UI_BLOCK_POPUP | UI_BLOCK_NUMSELECT;
}
/* clip block with window boundary */
@@ -1559,17 +1622,17 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut
/* the block and buttons were positioned in window space as in 2.4x, now
* these menu blocks are regions so we bring it back to region space.
* additionally we add some padding for the menu shadow or rounded menus */
- ar->winrct.xmin= block->minx - MENU_SHADOW_SIDE;
- ar->winrct.xmax= block->maxx + MENU_SHADOW_SIDE;
- ar->winrct.ymin= block->miny - MENU_SHADOW_BOTTOM;
- ar->winrct.ymax= block->maxy + MENU_TOP;
+ ar->winrct.xmin = block->minx - MENU_SHADOW_SIDE;
+ ar->winrct.xmax = block->maxx + MENU_SHADOW_SIDE;
+ ar->winrct.ymin = block->miny - MENU_SHADOW_BOTTOM;
+ ar->winrct.ymax = block->maxy + MENU_TOP;
block->minx -= ar->winrct.xmin;
block->maxx -= ar->winrct.xmin;
block->miny -= ar->winrct.ymin;
block->maxy -= ar->winrct.ymin;
- for(bt= block->buttons.first; bt; bt= bt->next) {
+ for (bt = block->buttons.first; bt; bt = bt->next) {
bt->x1 -= ar->winrct.xmin;
bt->x2 -= ar->winrct.xmin;
bt->y1 -= ar->winrct.ymin;
@@ -1599,7 +1662,7 @@ void ui_popup_block_free(bContext *C, uiPopupBlockHandle *handle)
{
ui_remove_temporary_region(C, CTX_wm_screen(C), handle->region);
- if(handle->scrolltimer)
+ if (handle->scrolltimer)
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), handle->scrolltimer);
MEM_freeN(handle);
@@ -1609,95 +1672,95 @@ void ui_popup_block_free(bContext *C, uiPopupBlockHandle *handle)
static void ui_block_func_MENUSTR(bContext *UNUSED(C), uiLayout *layout, void *arg_str)
{
- uiBlock *block= uiLayoutGetBlock(layout);
- uiPopupBlockHandle *handle= block->handle;
- uiLayout *split, *column=NULL;
+ uiBlock *block = uiLayoutGetBlock(layout);
+ uiPopupBlockHandle *handle = block->handle;
+ uiLayout *split, *column = NULL;
uiBut *bt;
MenuData *md;
MenuEntry *entry;
- const char *instr= arg_str;
+ const char *instr = arg_str;
int columns, rows, a, b;
- int column_start= 0, column_end= 0;
+ int column_start = 0, column_end = 0;
uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
/* compute menu data */
- md= decompose_menu_string(instr);
+ md = decompose_menu_string(instr);
/* columns and row estimation */
- columns= (md->nitems+20)/20;
- if(columns<1)
- columns= 1;
- if(columns>8)
- columns= (md->nitems+25)/25;
-
- rows= md->nitems/columns;
- if(rows<1)
- rows= 1;
- while(rows*columns<md->nitems)
+ columns = (md->nitems + 20) / 20;
+ if (columns < 1)
+ columns = 1;
+ if (columns > 8)
+ columns = (md->nitems + 25) / 25;
+
+ rows = md->nitems / columns;
+ if (rows < 1)
+ rows = 1;
+ while (rows * columns < md->nitems)
rows++;
/* create title */
- if(md->title) {
- if(md->titleicon) {
+ if (md->title) {
+ if (md->titleicon) {
uiItemL(layout, md->title, md->titleicon);
}
else {
uiItemL(layout, md->title, ICON_NONE);
- bt= block->buttons.last;
- bt->flag= UI_TEXT_LEFT;
+ bt = block->buttons.last;
+ bt->flag = UI_TEXT_LEFT;
}
}
/* inconsistent, but menus with labels do not look good flipped */
- entry= md->items;
- for(a=0; a<md->nitems; a++, entry++) {
- if(entry->sepr && entry->str[0]) {
+ entry = md->items;
+ for (a = 0; a < md->nitems; a++, entry++) {
+ if (entry->sepr && entry->str[0]) {
block->flag |= UI_BLOCK_NO_FLIP;
break;
}
}
/* create items */
- split= uiLayoutSplit(layout, 0, 0);
+ split = uiLayoutSplit(layout, 0, 0);
- for(a=0; a<md->nitems; a++) {
- if(a == column_end) {
+ 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 */
- column_start= a;
- column_end= md->nitems;
+ * can flip the order of items properly per column */
+ column_start = a;
+ column_end = md->nitems;
- for(b=a+1; b<md->nitems; b++) {
- entry= &md->items[b];
+ for (b = a + 1; b < md->nitems; b++) {
+ entry = &md->items[b];
/* new column on N rows or on separation label */
- if(((b-a) % rows == 0) || (entry->sepr && entry->str[0])) {
+ if (((b - a) % rows == 0) || (entry->sepr && entry->str[0])) {
column_end = b;
break;
}
}
- column= uiLayoutColumn(split, 0);
+ column = uiLayoutColumn(split, 0);
}
- if(block->flag & UI_BLOCK_NO_FLIP)
- entry= &md->items[a];
+ if (block->flag & UI_BLOCK_NO_FLIP)
+ entry = &md->items[a];
else
- entry= &md->items[column_start + column_end-1-a];
+ entry = &md->items[column_start + column_end - 1 - a];
- if(entry->sepr) {
+ if (entry->sepr) {
uiItemL(column, entry->str, entry->icon);
- bt= block->buttons.last;
- bt->flag= UI_TEXT_LEFT;
+ bt = block->buttons.last;
+ bt->flag = UI_TEXT_LEFT;
}
- else if(entry->icon) {
- uiDefIconTextButF(block, BUTM|FLO, B_NOP, entry->icon, entry->str, 0, 0,
- UI_UNIT_X*5, UI_UNIT_Y, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
+ else if (entry->icon) {
+ uiDefIconTextButF(block, BUTM | FLO, B_NOP, entry->icon, entry->str, 0, 0,
+ UI_UNIT_X * 5, UI_UNIT_Y, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
}
else {
- uiDefButF(block, BUTM|FLO, B_NOP, entry->str, 0, 0,
- UI_UNIT_X*5, UI_UNIT_X, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
+ uiDefButF(block, BUTM | FLO, B_NOP, entry->str, 0, 0,
+ UI_UNIT_X * 5, UI_UNIT_X, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
}
}
@@ -1706,46 +1769,46 @@ static void ui_block_func_MENUSTR(bContext *UNUSED(C), uiLayout *layout, void *a
void ui_block_func_ICONROW(bContext *UNUSED(C), uiLayout *layout, void *arg_but)
{
- uiBlock *block= uiLayoutGetBlock(layout);
- uiPopupBlockHandle *handle= block->handle;
- uiBut *but= arg_but;
+ uiBlock *block = uiLayoutGetBlock(layout);
+ uiPopupBlockHandle *handle = block->handle;
+ uiBut *but = arg_but;
int a;
uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
- for(a=(int)but->hardmin; a<=(int)but->hardmax; a++)
- uiDefIconButF(block, BUTM|FLO, B_NOP, but->icon+(a-but->hardmin), 0, 0, UI_UNIT_X*5, UI_UNIT_Y,
- &handle->retvalue, (float)a, 0.0, 0, 0, "");
+ for (a = (int)but->hardmin; a <= (int)but->hardmax; a++)
+ uiDefIconButF(block, BUTM | FLO, B_NOP, but->icon + (a - but->hardmin), 0, 0, UI_UNIT_X * 5, UI_UNIT_Y,
+ &handle->retvalue, (float)a, 0.0, 0, 0, "");
}
void ui_block_func_ICONTEXTROW(bContext *UNUSED(C), uiLayout *layout, void *arg_but)
{
- uiBlock *block= uiLayoutGetBlock(layout);
- uiPopupBlockHandle *handle= block->handle;
- uiBut *but= arg_but, *bt;
+ uiBlock *block = uiLayoutGetBlock(layout);
+ uiPopupBlockHandle *handle = block->handle;
+ uiBut *but = arg_but, *bt;
MenuData *md;
MenuEntry *entry;
int a;
uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
- md= decompose_menu_string(but->str);
+ md = decompose_menu_string(but->str);
/* title */
- if(md->title) {
- bt= uiDefBut(block, LABEL, 0, md->title, 0, 0, UI_UNIT_X*5, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
- bt->flag= UI_TEXT_LEFT;
+ if (md->title) {
+ bt = uiDefBut(block, LABEL, 0, md->title, 0, 0, UI_UNIT_X * 5, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ bt->flag = UI_TEXT_LEFT;
}
/* loop through the menu options and draw them out with icons & text labels */
- for(a=0; a<md->nitems; a++) {
- entry= &md->items[md->nitems-a-1];
+ for (a = 0; a < md->nitems; a++) {
+ entry = &md->items[md->nitems - a - 1];
- if(entry->sepr)
+ if (entry->sepr)
uiItemS(layout);
else
- uiDefIconTextButF(block, BUTM|FLO, B_NOP, (short)((but->icon)+(entry->retval-but->hardmin)), entry->str,
- 0, 0, UI_UNIT_X*5, UI_UNIT_Y, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
+ uiDefIconTextButF(block, BUTM | FLO, B_NOP, (short)((but->icon) + (entry->retval - but->hardmin)), entry->str,
+ 0, 0, UI_UNIT_X * 5, UI_UNIT_Y, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
}
menudata_free(md);
@@ -1755,29 +1818,29 @@ 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
/********************* Color Button ****************/
/* picker sizes S hsize, F full size, D spacer, B button/pallette height */
-#define SPICK 110.0
-#define FPICK 180.0
-#define DPICK 6.0
-#define BPICK 24.0
+#define SPICK 110.0
+#define FPICK 180.0
+#define DPICK 6.0
+#define BPICK 24.0
/* for picker, while editing hsv */
void ui_set_but_hsv(uiBut *but)
{
float col[3];
- float *hsv= ui_block_hsv_get(but->block);
+ float *hsv = ui_block_hsv_get(but->block);
- hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
+ hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col + 1, col + 2);
ui_set_but_vectorf(but, col);
}
@@ -1785,21 +1848,21 @@ void ui_set_but_hsv(uiBut *but)
static void ui_update_block_buts_rgb(uiBlock *block, float *rgb)
{
uiBut *bt;
- float *hsv= ui_block_hsv_get(block);
+ float *hsv = ui_block_hsv_get(block);
/* this is to keep the H and S value when V is equal to zero
* and we are working in HSV mode, of course!
*/
- rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+ rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2);
// this updates button strings, is hackish... but button pointers are on stack of caller function
- for(bt= block->buttons.first; bt; bt= bt->next) {
+ for (bt = block->buttons.first; bt; bt = bt->next) {
if (bt->rnaprop) {
ui_set_but_vectorf(bt, rgb);
}
- else if(strcmp(bt->str, "Hex: ")==0) {
+ else if (strcmp(bt->str, "Hex: ") == 0) {
float rgb_gamma[3];
double intpart;
char col[16];
@@ -1808,7 +1871,8 @@ static void ui_update_block_buts_rgb(uiBlock *block, float *rgb)
if (block->color_profile == BLI_PR_NONE) {
copy_v3_v3(rgb_gamma, rgb);
- } else {
+ }
+ else {
/* make an sRGB version, for Hex code */
linearrgb_to_srgb_v3_v3(rgb_gamma, rgb);
}
@@ -1821,23 +1885,23 @@ static void ui_update_block_buts_rgb(uiBlock *block, float *rgb)
strcpy(bt->poin, col);
}
- else if(bt->str[1]==' ') {
- if(bt->str[0]=='R') {
+ else if (bt->str[1] == ' ') {
+ if (bt->str[0] == 'R') {
ui_set_but_val(bt, rgb[0]);
}
- else if(bt->str[0]=='G') {
+ else if (bt->str[0] == 'G') {
ui_set_but_val(bt, rgb[1]);
}
- else if(bt->str[0]=='B') {
+ else if (bt->str[0] == 'B') {
ui_set_but_val(bt, rgb[2]);
}
- else if(bt->str[0]=='H') {
+ else if (bt->str[0] == 'H') {
ui_set_but_val(bt, hsv[0]);
}
- else if(bt->str[0]=='S') {
+ else if (bt->str[0] == 'S') {
ui_set_but_val(bt, hsv[1]);
}
- else if(bt->str[0]=='V') {
+ else if (bt->str[0] == 'V') {
ui_set_but_val(bt, hsv[2]);
}
}
@@ -1848,8 +1912,8 @@ static void ui_update_block_buts_rgb(uiBlock *block, float *rgb)
static void do_picker_rna_cb(bContext *UNUSED(C), void *bt1, void *UNUSED(arg))
{
- uiBut *but= (uiBut *)bt1;
- uiPopupBlockHandle *popup= but->block->handle;
+ uiBut *but = (uiBut *)bt1;
+ uiPopupBlockHandle *popup = but->block->handle;
PropertyRNA *prop = but->rnaprop;
PointerRNA ptr = but->rnapoin;
float rgb[4];
@@ -1859,33 +1923,33 @@ static void do_picker_rna_cb(bContext *UNUSED(C), void *bt1, void *UNUSED(arg))
ui_update_block_buts_rgb(but->block, rgb);
}
- if(popup)
- popup->menuretval= UI_RETURN_UPDATE;
+ if (popup)
+ popup->menuretval = UI_RETURN_UPDATE;
}
static void do_hsv_rna_cb(bContext *UNUSED(C), void *bt1, void *UNUSED(arg))
{
- uiBut *but= (uiBut *)bt1;
- uiPopupBlockHandle *popup= but->block->handle;
+ uiBut *but = (uiBut *)bt1;
+ uiPopupBlockHandle *popup = but->block->handle;
float rgb[3];
- float *hsv= ui_block_hsv_get(but->block);
+ float *hsv = ui_block_hsv_get(but->block);
- hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2);
+ hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb + 1, rgb + 2);
ui_update_block_buts_rgb(but->block, rgb);
- if(popup)
- popup->menuretval= UI_RETURN_UPDATE;
+ if (popup)
+ popup->menuretval = UI_RETURN_UPDATE;
}
static void do_hex_rna_cb(bContext *UNUSED(C), void *bt1, void *hexcl)
{
- uiBut *but= (uiBut *)bt1;
- uiPopupBlockHandle *popup= but->block->handle;
- char *hexcol= (char *)hexcl;
+ uiBut *but = (uiBut *)bt1;
+ uiPopupBlockHandle *popup = but->block->handle;
+ char *hexcol = (char *)hexcl;
float rgb[3];
- hex_to_rgb(hexcol, rgb, rgb+1, rgb+2);
+ hex_to_rgb(hexcol, rgb, rgb + 1, rgb + 2);
/* Hex code is assumed to be in sRGB space (coming from other applications, web, etc) */
if (but->block->color_profile != BLI_PR_NONE) {
@@ -1895,17 +1959,17 @@ static void do_hex_rna_cb(bContext *UNUSED(C), void *bt1, void *hexcl)
ui_update_block_buts_rgb(but->block, rgb);
- if(popup)
- popup->menuretval= UI_RETURN_UPDATE;
+ if (popup)
+ popup->menuretval = UI_RETURN_UPDATE;
}
static void close_popup_cb(bContext *UNUSED(C), void *bt1, void *UNUSED(arg))
{
- uiBut *but= (uiBut *)bt1;
- uiPopupBlockHandle *popup= but->block->handle;
+ uiBut *but = (uiBut *)bt1;
+ uiPopupBlockHandle *popup = but->block->handle;
- if(popup)
- popup->menuretval= UI_RETURN_OK;
+ if (popup)
+ popup->menuretval = UI_RETURN_OK;
}
static void picker_new_hide_reveal(uiBlock *block, short colormode)
@@ -1913,26 +1977,26 @@ static void picker_new_hide_reveal(uiBlock *block, short colormode)
uiBut *bt;
/* tag buttons */
- for(bt= block->buttons.first; bt; bt= bt->next) {
+ for (bt = block->buttons.first; bt; bt = bt->next) {
if (bt->type == LABEL) {
- if( bt->str[1]=='G') {
- if(colormode==2) bt->flag &= ~UI_HIDDEN;
+ if (bt->str[1] == 'G') {
+ if (colormode == 2) bt->flag &= ~UI_HIDDEN;
else bt->flag |= UI_HIDDEN;
}
}
- if(bt->type==NUMSLI || bt->type==TEX) {
- if( bt->str[1]=='e') {
- if(colormode==2) bt->flag &= ~UI_HIDDEN;
+ if (bt->type == NUMSLI || bt->type == TEX) {
+ if (bt->str[1] == 'e') {
+ if (colormode == 2) bt->flag &= ~UI_HIDDEN;
else bt->flag |= UI_HIDDEN;
}
- else if( ELEM3(bt->str[0], 'R', 'G', 'B')) {
- if(colormode==0) bt->flag &= ~UI_HIDDEN;
+ else if (ELEM3(bt->str[0], 'R', 'G', 'B')) {
+ if (colormode == 0) bt->flag &= ~UI_HIDDEN;
else bt->flag |= UI_HIDDEN;
}
- else if( ELEM3(bt->str[0], 'H', 'S', 'V')) {
- if(colormode==1) bt->flag &= ~UI_HIDDEN;
+ else if (ELEM3(bt->str[0], 'H', 'S', 'V')) {
+ if (colormode == 1) bt->flag &= ~UI_HIDDEN;
else bt->flag |= UI_HIDDEN;
}
}
@@ -1941,32 +2005,32 @@ static void picker_new_hide_reveal(uiBlock *block, short colormode)
static void do_picker_new_mode_cb(bContext *UNUSED(C), void *bt1, void *UNUSED(arg))
{
- uiBut *bt= bt1;
- short colormode= ui_get_but_val(bt);
+ uiBut *bt = bt1;
+ short colormode = ui_get_but_val(bt);
picker_new_hide_reveal(bt->block, colormode);
}
/* picker sizes S hsize, F full size, D spacer, B button/pallette height */
-#define SPICK1 150.0
-#define DPICK1 6.0
+#define SPICK1 150.0
+#define DPICK1 6.0
-#define PICKER_H 150
-#define PICKER_W 150
-#define PICKER_SPACE 6
-#define PICKER_BAR 14
+#define PICKER_H 150
+#define PICKER_W 150
+#define PICKER_SPACE 6
+#define PICKER_BAR 14
-#define PICKER_TOTAL_W (PICKER_W+PICKER_SPACE+PICKER_BAR)
+#define PICKER_TOTAL_W (PICKER_W + PICKER_SPACE + PICKER_BAR)
static void circle_picker(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop)
{
uiBut *bt;
/* HS circle */
- bt= uiDefButR_prop(block, HSVCIRCLE, 0, "", 0, 0, PICKER_H, PICKER_W, ptr, prop, 0, 0.0, 0.0, 0, 0, "Color");
+ bt = uiDefButR_prop(block, HSVCIRCLE, 0, "", 0, 0, PICKER_H, PICKER_W, ptr, prop, 0, 0.0, 0.0, 0, 0, "Color");
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
/* value */
- bt= uiDefButR_prop(block, HSVCUBE, 0, "", PICKER_W+PICKER_SPACE,0,PICKER_BAR,PICKER_H, ptr, prop, 0, 0.0, 0.0, UI_GRAD_V_ALT, 0, "Value");
+ bt = uiDefButR_prop(block, HSVCUBE, 0, "", PICKER_W + PICKER_SPACE, 0, PICKER_BAR, PICKER_H, ptr, prop, 0, 0.0, 0.0, UI_GRAD_V_ALT, 0, "Value");
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
}
@@ -1977,11 +2041,11 @@ static void square_picker(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, in
int bartype = type + 3;
/* HS square */
- bt= uiDefButR_prop(block, HSVCUBE, 0, "", 0, PICKER_BAR+PICKER_SPACE, PICKER_TOTAL_W, PICKER_H, ptr, prop, 0, 0.0, 0.0, type, 0, "Color");
+ bt = uiDefButR_prop(block, HSVCUBE, 0, "", 0, PICKER_BAR + PICKER_SPACE, PICKER_TOTAL_W, PICKER_H, ptr, prop, 0, 0.0, 0.0, type, 0, "Color");
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
/* value */
- bt= uiDefButR_prop(block, HSVCUBE, 0, "", 0, 0, PICKER_TOTAL_W, PICKER_BAR, ptr, prop, 0, 0.0, 0.0, bartype, 0, "Value");
+ bt = uiDefButR_prop(block, HSVCUBE, 0, "", 0, 0, PICKER_TOTAL_W, PICKER_BAR, ptr, prop, 0, 0.0, 0.0, bartype, 0, "Value");
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
}
@@ -1989,32 +2053,33 @@ static void square_picker(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, in
/* a HS circle, V slider, rgb/hsv/hex sliders */
static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyRNA *prop)
{
- static short colormode= 0; /* temp? 0=rgb, 1=hsv, 2=hex */
+ static short colormode = 0; /* temp? 0=rgb, 1=hsv, 2=hex */
uiBut *bt;
int width, butwidth;
static char tip[50];
static char hexcol[128];
float rgb_gamma[3];
float min, max, step, precision;
- float *hsv= ui_block_hsv_get(block);
+ float *hsv = ui_block_hsv_get(block);
ui_block_hsv_get(block);
- width= PICKER_TOTAL_W;
+ width = PICKER_TOTAL_W;
butwidth = width - UI_UNIT_X - 10;
/* existence of profile means storage is in linear color space, with display correction */
if (block->color_profile == BLI_PR_NONE) {
BLI_strncpy(tip, "Value in Display Color Space", sizeof(tip));
copy_v3_v3(rgb_gamma, rgb);
- } else {
+ }
+ else {
BLI_strncpy(tip, "Value in Linear RGB Color Space", sizeof(tip));
/* make an sRGB version, for Hex code */
linearrgb_to_srgb_v3_v3(rgb_gamma, rgb);
}
/* sneaky way to check for alpha */
- rgb[3]= FLT_MAX;
+ rgb[3] = FLT_MAX;
RNA_property_float_ui_range(ptr, prop, &min, &max, &step, &precision);
RNA_property_float_get_array(ptr, prop, rgb);
@@ -2036,24 +2101,24 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR
/* mode */
uiBlockBeginAlign(block);
- bt= uiDefButS(block, ROW, 0, "RGB", 0, -30, width/3, UI_UNIT_Y, &colormode, 0.0, 0.0, 0, 0, "");
+ bt = uiDefButS(block, ROW, 0, "RGB", 0, -30, width / 3, UI_UNIT_Y, &colormode, 0.0, 0.0, 0, 0, "");
uiButSetFunc(bt, do_picker_new_mode_cb, bt, NULL);
- bt= uiDefButS(block, ROW, 0, "HSV", width/3, -30, width/3, UI_UNIT_Y, &colormode, 0.0, 1.0, 0, 0, "");
+ bt = uiDefButS(block, ROW, 0, "HSV", width / 3, -30, width / 3, UI_UNIT_Y, &colormode, 0.0, 1.0, 0, 0, "");
uiButSetFunc(bt, do_picker_new_mode_cb, bt, NULL);
- bt= uiDefButS(block, ROW, 0, "Hex", 2*width/3, -30, width/3, UI_UNIT_Y, &colormode, 0.0, 2.0, 0, 0, "");
+ bt = uiDefButS(block, ROW, 0, "Hex", 2 * width / 3, -30, width / 3, UI_UNIT_Y, &colormode, 0.0, 2.0, 0, 0, "");
uiButSetFunc(bt, do_picker_new_mode_cb, bt, NULL);
uiBlockEndAlign(block);
- bt= uiDefIconButO(block, BUT, "UI_OT_eyedropper", WM_OP_INVOKE_DEFAULT, ICON_EYEDROPPER, butwidth+10, -60, UI_UNIT_X, UI_UNIT_Y, NULL);
+ bt = uiDefIconButO(block, BUT, "UI_OT_eyedropper", WM_OP_INVOKE_DEFAULT, ICON_EYEDROPPER, butwidth + 10, -60, UI_UNIT_X, UI_UNIT_Y, NULL);
uiButSetFunc(bt, close_popup_cb, bt, NULL);
/* RGB values */
uiBlockBeginAlign(block);
- bt= uiDefButR_prop(block, NUMSLI, 0, "R ", 0, -60, butwidth, UI_UNIT_Y, ptr, prop, 0, 0.0, 0.0, 0, 3, "Red");
+ bt = uiDefButR_prop(block, NUMSLI, 0, "R ", 0, -60, butwidth, UI_UNIT_Y, ptr, prop, 0, 0.0, 0.0, 0, 3, "Red");
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
- bt= uiDefButR_prop(block, NUMSLI, 0, "G ", 0, -80, butwidth, UI_UNIT_Y, ptr, prop, 1, 0.0, 0.0, 0, 3, "Green");
+ bt = uiDefButR_prop(block, NUMSLI, 0, "G ", 0, -80, butwidth, UI_UNIT_Y, ptr, prop, 1, 0.0, 0.0, 0, 3, "Green");
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
- bt= uiDefButR_prop(block, NUMSLI, 0, "B ", 0, -100, butwidth, UI_UNIT_Y, ptr, prop, 2, 0.0, 0.0, 0, 3, "Blue");
+ bt = uiDefButR_prop(block, NUMSLI, 0, "B ", 0, -100, butwidth, UI_UNIT_Y, ptr, prop, 2, 0.0, 0.0, 0, 3, "Blue");
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
// could use uiItemFullR(col, ptr, prop, -1, 0, UI_ITEM_R_EXPAND|UI_ITEM_R_SLIDER, "", ICON_NONE);
@@ -2061,29 +2126,29 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR
/* HSV values */
uiBlockBeginAlign(block);
- bt= uiDefButF(block, NUMSLI, 0, "H ", 0, -60, butwidth, UI_UNIT_Y, hsv, 0.0, 1.0, 10, 3, "Hue");
+ bt = uiDefButF(block, NUMSLI, 0, "H ", 0, -60, butwidth, UI_UNIT_Y, hsv, 0.0, 1.0, 10, 3, "Hue");
uiButSetFunc(bt, do_hsv_rna_cb, bt, hsv);
- bt= uiDefButF(block, NUMSLI, 0, "S ", 0, -80, butwidth, UI_UNIT_Y, hsv+1, 0.0, 1.0, 10, 3, "Saturation");
+ bt = uiDefButF(block, NUMSLI, 0, "S ", 0, -80, butwidth, UI_UNIT_Y, hsv + 1, 0.0, 1.0, 10, 3, "Saturation");
uiButSetFunc(bt, do_hsv_rna_cb, bt, hsv);
- bt= uiDefButF(block, NUMSLI, 0, "V ", 0, -100, butwidth, UI_UNIT_Y, hsv+2, 0.0, max, 10, 3, "Value");
+ bt = uiDefButF(block, NUMSLI, 0, "V ", 0, -100, butwidth, UI_UNIT_Y, hsv + 2, 0.0, max, 10, 3, "Value");
uiButSetFunc(bt, do_hsv_rna_cb, bt, hsv);
uiBlockEndAlign(block);
- if(rgb[3] != FLT_MAX) {
- bt= uiDefButR_prop(block, NUMSLI, 0, "A ", 0, -120, butwidth, UI_UNIT_Y, ptr, prop, 3, 0.0, 0.0, 0, 0, "Alpha");
+ if (rgb[3] != FLT_MAX) {
+ bt = uiDefButR_prop(block, NUMSLI, 0, "A ", 0, -120, butwidth, UI_UNIT_Y, ptr, prop, 3, 0.0, 0.0, 0, 0, "Alpha");
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
}
else {
- rgb[3]= 1.0f;
+ rgb[3] = 1.0f;
}
BLI_snprintf(hexcol, sizeof(hexcol), "%02X%02X%02X", FTOCHAR(rgb_gamma[0]), FTOCHAR(rgb_gamma[1]), FTOCHAR(rgb_gamma[2]));
- bt= uiDefBut(block, TEX, 0, "Hex: ", 0, -60, butwidth, UI_UNIT_Y, hexcol, 0, 8, 0, 0, "Hex triplet for color (#RRGGBB)");
+ bt = uiDefBut(block, TEX, 0, "Hex: ", 0, -60, butwidth, UI_UNIT_Y, hexcol, 0, 8, 0, 0, "Hex triplet for color (#RRGGBB)");
uiButSetFunc(bt, do_hex_rna_cb, bt, hexcol);
uiDefBut(block, LABEL, 0, "(Gamma Corrected)", 0, -80, butwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
- rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+ rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2);
picker_new_hide_reveal(block, colormode);
}
@@ -2091,33 +2156,33 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR
static int ui_picker_small_wheel_cb(const bContext *UNUSED(C), uiBlock *block, wmEvent *event)
{
- float add= 0.0f;
+ float add = 0.0f;
- if(event->type==WHEELUPMOUSE)
- add= 0.05f;
- else if(event->type==WHEELDOWNMOUSE)
- add= -0.05f;
+ if (event->type == WHEELUPMOUSE)
+ add = 0.05f;
+ else if (event->type == WHEELDOWNMOUSE)
+ add = -0.05f;
- if(add!=0.0f) {
+ if (add != 0.0f) {
uiBut *but;
- for(but= block->buttons.first; but; but= but->next) {
- if(but->type==HSVCUBE && but->active==NULL) {
- uiPopupBlockHandle *popup= block->handle;
+ for (but = block->buttons.first; but; but = but->next) {
+ if (but->type == HSVCUBE && but->active == NULL) {
+ uiPopupBlockHandle *popup = block->handle;
float col[3];
- float *hsv= ui_block_hsv_get(block);
+ float *hsv = ui_block_hsv_get(block);
ui_get_but_vectorf(but, col);
- rgb_to_hsv_compat(col[0], col[1], col[2], hsv, hsv+1, hsv+2);
- hsv[2]= CLAMPIS(hsv[2]+add, 0.0f, 1.0f);
- hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
+ rgb_to_hsv_compat(col[0], col[1], col[2], hsv, hsv + 1, hsv + 2);
+ hsv[2] = CLAMPIS(hsv[2] + add, 0.0f, 1.0f);
+ hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col + 1, col + 2);
ui_set_but_vectorf(but, col);
ui_update_block_buts_rgb(block, col);
- if(popup)
- popup->menuretval= UI_RETURN_UPDATE;
+ if (popup)
+ popup->menuretval = UI_RETURN_UPDATE;
return 1;
}
@@ -2128,10 +2193,10 @@ static int ui_picker_small_wheel_cb(const bContext *UNUSED(C), uiBlock *block, w
uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_but)
{
- uiBut *but= arg_but;
+ uiBut *but = arg_but;
uiBlock *block;
- block= uiBeginBlock(C, handle->region, __func__, UI_EMBOSS);
+ block = uiBeginBlock(C, handle->region, __func__, UI_EMBOSS);
if (but->rnaprop) {
if (RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) {
@@ -2145,13 +2210,13 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu
uiBlockPicker(block, handle->retvec, &but->rnapoin, but->rnaprop);
- block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_KEEP_OPEN|UI_BLOCK_OUT_1;
+ block->flag = UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_KEEP_OPEN | UI_BLOCK_OUT_1;
uiBoundsBlock(block, 10);
- block->block_event_func= ui_picker_small_wheel_cb;
+ block->block_event_func = ui_picker_small_wheel_cb;
/* and lets go */
- block->direction= UI_TOP;
+ block->direction = UI_TOP;
return block;
}
@@ -2162,11 +2227,11 @@ static int ui_popup_string_hash(char *str)
{
/* sometimes button contains hotkey, sometimes not, strip for proper compare */
int hash;
- char *delimit= strchr(str, '|');
+ char *delimit = strchr(str, '|');
- if(delimit) *delimit= 0;
- hash= BLI_ghashutil_strhash(str);
- if(delimit) *delimit= '|';
+ if (delimit) *delimit = 0;
+ hash = BLI_ghashutil_strhash(str);
+ if (delimit) *delimit = '|';
return hash;
}
@@ -2179,24 +2244,24 @@ static int ui_popup_menu_hash(const char *str)
/* but == NULL read, otherwise set */
uiBut *ui_popup_menu_memory(uiBlock *block, uiBut *but)
{
- static int mem[256], first=1;
- int hash= block->puphash;
+ static int mem[256], first = 1;
+ int hash = block->puphash;
- if(first) {
+ if (first) {
/* init */
memset(mem, -1, sizeof(mem));
- first= 0;
+ first = 0;
}
- if(but) {
+ if (but) {
/* set */
- mem[hash & 255 ]= ui_popup_string_hash(but->str);
+ mem[hash & 255] = ui_popup_string_hash(but->str);
return NULL;
}
else {
/* get */
- for(but=block->buttons.first; but; but=but->next)
- if(ui_popup_string_hash(but->str) == mem[hash & 255])
+ for (but = block->buttons.first; but; but = but->next)
+ if (ui_popup_string_hash(but->str) == mem[hash & 255])
return but;
return NULL;
@@ -2221,93 +2286,94 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
{
uiBlock *block;
uiBut *bt;
- uiPopupMenu *pup= arg_pup;
+ uiPopupMenu *pup = arg_pup;
int offset[2], direction, minwidth, width, height, flip;
- if(pup->menu_func) {
- pup->block->handle= handle;
+ if (pup->menu_func) {
+ pup->block->handle = handle;
pup->menu_func(C, pup->layout, pup->menu_arg);
- pup->block->handle= NULL;
+ pup->block->handle = NULL;
}
- if(pup->but) {
+ if (pup->but) {
/* minimum width to enforece */
- minwidth= pup->but->x2 - pup->but->x1;
+ minwidth = pup->but->x2 - pup->but->x1;
- if(pup->but->type == PULLDOWN || pup->but->menu_create_func) {
- direction= UI_DOWN;
- flip= 1;
+ if (pup->but->type == PULLDOWN || pup->but->menu_create_func) {
+ direction = UI_DOWN;
+ flip = 1;
}
else {
- direction= UI_TOP;
- flip= 0;
+ direction = UI_TOP;
+ flip = 0;
}
}
else {
- minwidth= 50;
- direction= UI_DOWN;
- flip= 1;
+ minwidth = 50;
+ direction = UI_DOWN;
+ flip = 1;
}
- block= pup->block;
+ block = pup->block;
/* in some cases we create the block before the region,
- so we set it delayed here if necessary */
- if(BLI_findindex(&handle->region->uiblocks, block) == -1)
+ * so we set it delayed here if necessary */
+ if (BLI_findindex(&handle->region->uiblocks, block) == -1)
uiBlockSetRegion(block, handle->region);
- block->direction= direction;
+ block->direction = direction;
uiBlockLayoutResolve(block, &width, &height);
uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
- if(pup->popup) {
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT|UI_BLOCK_RET_1);
+ if (pup->popup) {
+ uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_NUMSELECT | UI_BLOCK_RET_1);
uiBlockSetDirection(block, direction);
/* offset the mouse position, possibly based on earlier selection */
- if((block->flag & UI_BLOCK_POPUP_MEMORY) &&
- (bt= ui_popup_menu_memory(block, NULL))) {
+ 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 */
- offset[0]= -(bt->x1 + 0.8f*(bt->x2 - bt->x1));
- offset[1]= -(bt->y1 + 0.5f*UI_UNIT_Y);
+ * 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 */
- 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)));
+ * 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)));
- offset[1]= 1.5*UI_UNIT_Y;
+ offset[1] = 1.5 * UI_UNIT_Y;
}
- block->minbounds= minwidth;
+ block->minbounds = minwidth;
uiMenuPopupBoundsBlock(block, 1, offset[0], offset[1]);
}
else {
/* for a header menu we set the direction automatic */
- if(!pup->slideout && flip) {
- ScrArea *sa= CTX_wm_area(C);
- if(sa && sa->headertype==HEADERDOWN) {
- ARegion *ar= CTX_wm_region(C);
- if(ar && ar->regiontype == RGN_TYPE_HEADER) {
+ if (!pup->slideout && flip) {
+ ScrArea *sa = CTX_wm_area(C);
+ if (sa && sa->headertype == HEADERDOWN) {
+ ARegion *ar = CTX_wm_region(C);
+ if (ar && ar->regiontype == RGN_TYPE_HEADER) {
uiBlockSetDirection(block, UI_TOP);
uiBlockFlipOrder(block);
}
}
}
- block->minbounds= minwidth;
+ block->minbounds = minwidth;
uiTextBoundsBlock(block, 50);
}
/* if menu slides out of other menu, override direction */
- if(pup->slideout)
+ if (pup->slideout)
uiBlockSetDirection(block, UI_RIGHT);
uiEndBlock(C, block);
@@ -2317,22 +2383,22 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut *but, uiMenuCreateFunc menu_func, void *arg, char *str)
{
- wmWindow *window= CTX_wm_window(C);
- uiStyle *style= UI_GetStyle();
+ wmWindow *window = CTX_wm_window(C);
+ uiStyle *style = UI_GetStyle();
uiPopupBlockHandle *handle;
uiPopupMenu *pup;
- pup= MEM_callocN(sizeof(uiPopupMenu), __func__);
- pup->block= uiBeginBlock(C, NULL, __func__, UI_EMBOSSP);
- pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style);
- pup->slideout= (but && (but->block->flag & UI_BLOCK_LOOP));
- pup->but= but;
+ pup = MEM_callocN(sizeof(uiPopupMenu), __func__);
+ pup->block = uiBeginBlock(C, NULL, __func__, UI_EMBOSSP);
+ pup->layout = uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style);
+ pup->slideout = (but && (but->block->flag & UI_BLOCK_LOOP));
+ pup->but = but;
uiLayoutSetOperatorContext(pup->layout, WM_OP_INVOKE_REGION_WIN);
- if(!but) {
+ if (!but) {
/* no button to start from, means we are a popup */
- pup->mx= window->eventstate->x;
- pup->my= window->eventstate->y;
- pup->popup= 1;
+ pup->mx = window->eventstate->x;
+ pup->my = window->eventstate->y;
+ pup->popup = 1;
pup->block->flag |= UI_BLOCK_NO_FLIP;
}
/* some enums reversing is strange, currently we have no good way to
@@ -2343,27 +2409,27 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut
/* if this is an rna button then we can assume its an enum
* flipping enums is generally not good since the order can be
* important [#28786] */
- if(but->rnaprop && RNA_property_type(but->rnaprop) == PROP_ENUM) {
+ if (but->rnaprop && RNA_property_type(but->rnaprop) == PROP_ENUM) {
pup->block->flag |= UI_BLOCK_NO_FLIP;
}
}
#endif
- if(str) {
+ if (str) {
/* menu is created from a string */
- pup->menu_func= ui_block_func_MENUSTR;
- pup->menu_arg= str;
+ pup->menu_func = ui_block_func_MENUSTR;
+ pup->menu_arg = str;
}
else {
/* menu is created from a callback */
- pup->menu_func= menu_func;
- pup->menu_arg= arg;
+ pup->menu_func = menu_func;
+ pup->menu_arg = arg;
}
- handle= ui_popup_block_create(C, butregion, but, NULL, ui_block_func_POPUP, pup);
+ handle = ui_popup_block_create(C, butregion, but, NULL, ui_block_func_POPUP, pup);
- if(!but) {
- handle->popup= 1;
+ if (!but) {
+ handle->popup = 1;
UI_add_popup_handlers(C, &window->modalhandlers, handle);
WM_event_add_mousemove(C);
@@ -2379,30 +2445,30 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut
/* only return handler, and set optional title */
uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon)
{
- uiStyle *style= UI_GetStyle();
- uiPopupMenu *pup= MEM_callocN(sizeof(uiPopupMenu), "popup menu");
+ uiStyle *style = UI_GetStyle();
+ uiPopupMenu *pup = MEM_callocN(sizeof(uiPopupMenu), "popup menu");
uiBut *but;
- pup->block= uiBeginBlock(C, NULL, __func__, UI_EMBOSSP);
+ pup->block = uiBeginBlock(C, NULL, __func__, UI_EMBOSSP);
pup->block->flag |= UI_BLOCK_POPUP_MEMORY;
- pup->block->puphash= ui_popup_menu_hash(title);
- pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style);
+ pup->block->puphash = ui_popup_menu_hash(title);
+ pup->layout = uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style);
uiLayoutSetOperatorContext(pup->layout, WM_OP_EXEC_REGION_WIN);
/* create in advance so we can let buttons point to retval already */
- pup->block->handle= MEM_callocN(sizeof(uiPopupBlockHandle), "uiPopupBlockHandle");
+ pup->block->handle = MEM_callocN(sizeof(uiPopupBlockHandle), "uiPopupBlockHandle");
/* create title button */
- if(title && title[0]) {
+ if (title && title[0]) {
char titlestr[256];
- if(icon) {
+ if (icon) {
BLI_snprintf(titlestr, sizeof(titlestr), " %s", title);
uiDefIconTextBut(pup->block, LABEL, 0, icon, titlestr, 0, 0, 200, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
}
else {
- but= uiDefBut(pup->block, LABEL, 0, title, 0, 0, 200, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
- but->flag= UI_TEXT_LEFT;
+ but = uiDefBut(pup->block, LABEL, 0, title, 0, 0, 200, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ but->flag = UI_TEXT_LEFT;
}
}
@@ -2412,15 +2478,15 @@ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon)
/* set the whole structure to work */
void uiPupMenuEnd(bContext *C, uiPopupMenu *pup)
{
- wmWindow *window= CTX_wm_window(C);
+ wmWindow *window = CTX_wm_window(C);
uiPopupBlockHandle *menu;
- pup->popup= 1;
- pup->mx= window->eventstate->x;
- pup->my= window->eventstate->y;
+ pup->popup = 1;
+ pup->mx = window->eventstate->x;
+ pup->my = window->eventstate->y;
- menu= ui_popup_block_create(C, NULL, NULL, NULL, ui_block_func_POPUP, pup);
- menu->popup= 1;
+ menu = ui_popup_block_create(C, NULL, NULL, NULL, ui_block_func_POPUP, pup);
+ menu->popup = 1;
UI_add_popup_handlers(C, &window->modalhandlers, menu);
WM_event_add_mousemove(C);
@@ -2437,17 +2503,17 @@ uiLayout *uiPupMenuLayout(uiPopupMenu *pup)
static void operator_name_cb(bContext *C, void *arg, int retval)
{
- const char *opname= arg;
+ const char *opname = arg;
- if(opname && retval > 0)
+ if (opname && retval > 0)
WM_operator_name_call(C, opname, WM_OP_EXEC_DEFAULT, NULL);
}
static void operator_cb(bContext *C, void *arg, int retval)
{
- wmOperator *op= arg;
+ wmOperator *op = arg;
- if(op && retval > 0)
+ if (op && retval > 0)
WM_operator_call(C, op);
else
WM_operator_free(op);
@@ -2463,15 +2529,15 @@ static void vconfirm_opname(bContext *C, const char *opname, const char *title,
uiPopupBlockHandle *handle;
char *s, buf[512];
- s= buf;
- if (title) s+= sprintf(s, "%s%%t|", title);
+ s = buf;
+ if (title) s += sprintf(s, "%s%%t|", title);
vsnprintf(s, sizeof(buf) - (s - buf), itemfmt, ap);
- buf[sizeof(buf) - 1]= '\0';
+ buf[sizeof(buf) - 1] = '\0';
- handle= ui_popup_menu_create(C, NULL, NULL, NULL, NULL, buf);
+ handle = ui_popup_menu_create(C, NULL, NULL, NULL, NULL, buf);
- handle->popup_func= operator_name_cb;
- handle->popup_arg= (void *)opname;
+ handle->popup_func = operator_name_cb;
+ handle->popup_arg = (void *)opname;
}
static void confirm_operator(bContext *C, wmOperator *op, const char *title, const char *item)
@@ -2479,15 +2545,15 @@ static void confirm_operator(bContext *C, wmOperator *op, const char *title, con
uiPopupBlockHandle *handle;
char *s, buf[512];
- s= buf;
- if (title) s+= BLI_snprintf(s, sizeof(buf), "%s%%t|%s", title, item);
+ s = buf;
+ if (title) s += BLI_snprintf(s, sizeof(buf), "%s%%t|%s", title, item);
(void)s;
- handle= ui_popup_menu_create(C, NULL, NULL, NULL, NULL, buf);
+ handle = ui_popup_menu_create(C, NULL, NULL, NULL, NULL, buf);
- handle->popup_func= operator_cb;
- handle->popup_arg= op;
- handle->cancel_func= confirm_cancel_operator;
+ handle->popup_func = operator_cb;
+ handle->popup_arg = op;
+ handle->cancel_func = confirm_cancel_operator;
}
void uiPupMenuOkee(bContext *C, const char *opname, const char *str, ...)
@@ -2542,26 +2608,26 @@ void uiPupMenuReports(bContext *C, ReportList *reports)
DynStr *ds;
char *str;
- if(!reports || !reports->list.first)
+ if (!reports || !reports->list.first)
return;
- if(!CTX_wm_window(C))
+ if (!CTX_wm_window(C))
return;
- ds= BLI_dynstr_new();
+ ds = BLI_dynstr_new();
- for(report=reports->list.first; report; report=report->next) {
- if(report->type < reports->printlevel)
- ; /* pass */
- else if(report->type >= RPT_ERROR)
+ for (report = reports->list.first; report; report = report->next) {
+ if (report->type < reports->printlevel)
+ ; /* pass */
+ else if (report->type >= RPT_ERROR)
BLI_dynstr_appendf(ds, "Error %%i%d%%t|%s", ICON_ERROR, report->message);
- else if(report->type >= RPT_WARNING)
+ else if (report->type >= RPT_WARNING)
BLI_dynstr_appendf(ds, "Warning %%i%d%%t|%s", ICON_ERROR, report->message);
- else if(report->type >= RPT_INFO)
+ else if (report->type >= RPT_INFO)
BLI_dynstr_appendf(ds, "Info %%i%d%%t|%s", ICON_INFO, report->message);
}
- str= BLI_dynstr_get_cstring(ds);
- if(str[0] != '\0')
+ str = BLI_dynstr_get_cstring(ds);
+ if (str[0] != '\0')
ui_popup_menu_create(C, NULL, NULL, NULL, NULL, str);
MEM_freeN(str);
@@ -2573,21 +2639,21 @@ void uiPupMenuInvoke(bContext *C, const char *idname)
uiPopupMenu *pup;
uiLayout *layout;
Menu menu;
- MenuType *mt= WM_menutype_find(idname, TRUE);
+ MenuType *mt = WM_menutype_find(idname, TRUE);
- if(mt==NULL) {
+ if (mt == NULL) {
printf("%s: named menu \"%s\" not found\n", __func__, idname);
return;
}
- if(mt->poll && mt->poll(C, mt)==0)
+ if (mt->poll && mt->poll(C, mt) == 0)
return;
- pup= uiPupMenuBegin(C, mt->label, ICON_NONE);
- layout= uiPupMenuLayout(pup);
+ pup = uiPupMenuBegin(C, mt->label, ICON_NONE);
+ layout = uiPupMenuLayout(pup);
- menu.layout= layout;
- menu.type= mt;
+ menu.layout = layout;
+ menu.type = mt;
mt->draw(C, &menu);
@@ -2599,13 +2665,13 @@ void uiPupMenuInvoke(bContext *C, const char *idname)
void uiPupBlockO(bContext *C, uiBlockCreateFunc func, void *arg, const char *opname, int opcontext)
{
- wmWindow *window= CTX_wm_window(C);
+ wmWindow *window = CTX_wm_window(C);
uiPopupBlockHandle *handle;
- handle= ui_popup_block_create(C, NULL, NULL, func, NULL, arg);
- handle->popup= 1;
- handle->optype= (opname)? WM_operatortype_find(opname, 0): NULL;
- handle->opcontext= opcontext;
+ handle = ui_popup_block_create(C, NULL, NULL, func, NULL, arg);
+ handle->popup = 1;
+ handle->optype = (opname) ? WM_operatortype_find(opname, 0) : NULL;
+ handle->opcontext = opcontext;
UI_add_popup_handlers(C, &window->modalhandlers, handle);
WM_event_add_mousemove(C);
@@ -2618,16 +2684,16 @@ void uiPupBlock(bContext *C, uiBlockCreateFunc func, void *arg)
void uiPupBlockEx(bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_func, uiBlockCancelFunc cancel_func, void *arg)
{
- wmWindow *window= CTX_wm_window(C);
+ wmWindow *window = CTX_wm_window(C);
uiPopupBlockHandle *handle;
- handle= ui_popup_block_create(C, NULL, NULL, func, NULL, arg);
- handle->popup= 1;
- handle->retvalue= 1;
+ handle = ui_popup_block_create(C, NULL, NULL, func, NULL, arg);
+ handle->popup = 1;
+ handle->retvalue = 1;
- handle->popup_arg= arg;
- handle->popup_func= popup_func;
- handle->cancel_func= cancel_func;
+ handle->popup_arg = arg;
+ handle->popup_func = popup_func;
+ handle->cancel_func = cancel_func;
// handle->opcontext= opcontext;
UI_add_popup_handlers(C, &window->modalhandlers, handle);
@@ -2637,17 +2703,17 @@ void uiPupBlockEx(bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_f
#if 0 /* UNUSED */
void uiPupBlockOperator(bContext *C, uiBlockCreateFunc func, wmOperator *op, int opcontext)
{
- wmWindow *window= CTX_wm_window(C);
+ wmWindow *window = CTX_wm_window(C);
uiPopupBlockHandle *handle;
- handle= ui_popup_block_create(C, NULL, NULL, func, NULL, op);
- handle->popup= 1;
- handle->retvalue= 1;
+ handle = ui_popup_block_create(C, NULL, NULL, func, NULL, op);
+ handle->popup = 1;
+ handle->retvalue = 1;
- handle->popup_arg= op;
- handle->popup_func= operator_cb;
- handle->cancel_func= confirm_cancel_operator;
- handle->opcontext= opcontext;
+ handle->popup_arg = op;
+ handle->popup_func = operator_cb;
+ handle->cancel_func = confirm_cancel_operator;
+ handle->opcontext = opcontext;
UI_add_popup_handlers(C, &window->modalhandlers, handle);
WM_event_add_mousemove(C);
@@ -2656,11 +2722,11 @@ void uiPupBlockOperator(bContext *C, uiBlockCreateFunc func, wmOperator *op, int
void uiPupBlockClose(bContext *C, uiBlock *block)
{
- if(block->handle) {
+ if (block->handle) {
wmWindow *win = CTX_wm_window(C);
/* if loading new .blend while popup is open, window will be NULL */
- if(win) {
+ if (win) {
UI_remove_popup_handlers(&win->modalhandlers, block->handle);
ui_popup_block_free(C, block->handle);
}
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 16b543737d0..5d527667170 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -60,81 +60,80 @@
/* 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.
+ */
/* ********************************************** */
static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id)
{
- uiStyle *style= MEM_callocN(sizeof(uiStyle), "new style");
+ uiStyle *style = MEM_callocN(sizeof(uiStyle), "new style");
BLI_addtail(styles, style);
BLI_strncpy(style->name, name, MAX_STYLE_NAME);
- style->panelzoom= 1.0; /* unused */
-
- style->paneltitle.uifont_id= uifont_id;
- style->paneltitle.points= 12;
- style->paneltitle.kerning= 1;
- style->paneltitle.shadow= 1;
- style->paneltitle.shadx= 0;
- style->paneltitle.shady= -1;
- style->paneltitle.shadowalpha= 0.15f;
- style->paneltitle.shadowcolor= 1.0f;
-
- style->grouplabel.uifont_id= uifont_id;
- style->grouplabel.points= 12;
- style->grouplabel.kerning= 1;
- style->grouplabel.shadow= 3;
- style->grouplabel.shadx= 0;
- style->grouplabel.shady= -1;
- style->grouplabel.shadowalpha= 0.25f;
-
- style->widgetlabel.uifont_id= uifont_id;
- style->widgetlabel.points= 11;
- style->widgetlabel.kerning= 1;
- style->widgetlabel.shadow= 3;
- style->widgetlabel.shadx= 0;
- style->widgetlabel.shady= -1;
- style->widgetlabel.shadowalpha= 0.15f;
- style->widgetlabel.shadowcolor= 1.0f;
-
- style->widget.uifont_id= uifont_id;
- style->widget.points= 11;
- style->widget.kerning= 1;
- style->widget.shadowalpha= 0.25f;
-
- style->columnspace= 8;
- style->templatespace= 5;
- style->boxspace= 5;
- style->buttonspacex= 8;
- style->buttonspacey= 2;
- style->panelspace= 8;
- style->panelouter= 4;
+ style->panelzoom = 1.0; /* unused */
+
+ style->paneltitle.uifont_id = uifont_id;
+ style->paneltitle.points = 12;
+ style->paneltitle.kerning = 1;
+ style->paneltitle.shadow = 1;
+ style->paneltitle.shadx = 0;
+ style->paneltitle.shady = -1;
+ style->paneltitle.shadowalpha = 0.15f;
+ style->paneltitle.shadowcolor = 1.0f;
+
+ style->grouplabel.uifont_id = uifont_id;
+ style->grouplabel.points = 12;
+ style->grouplabel.kerning = 1;
+ style->grouplabel.shadow = 3;
+ style->grouplabel.shadx = 0;
+ style->grouplabel.shady = -1;
+ style->grouplabel.shadowalpha = 0.25f;
+
+ style->widgetlabel.uifont_id = uifont_id;
+ style->widgetlabel.points = 11;
+ style->widgetlabel.kerning = 1;
+ style->widgetlabel.shadow = 3;
+ style->widgetlabel.shadx = 0;
+ style->widgetlabel.shady = -1;
+ style->widgetlabel.shadowalpha = 0.15f;
+ style->widgetlabel.shadowcolor = 1.0f;
+
+ style->widget.uifont_id = uifont_id;
+ style->widget.points = 11;
+ style->widget.kerning = 1;
+ style->widget.shadowalpha = 0.25f;
+
+ style->columnspace = 8;
+ style->templatespace = 5;
+ style->boxspace = 5;
+ style->buttonspacex = 8;
+ style->buttonspacey = 2;
+ style->panelspace = 8;
+ style->panelouter = 4;
return style;
}
static uiFont *uifont_to_blfont(int id)
{
- uiFont *font= U.uifonts.first;
+ uiFont *font = U.uifonts.first;
- for(; font; font= font->next) {
- if(font->uifont_id==id) {
+ for (; font; font = font->next) {
+ if (font->uifont_id == id) {
return font;
}
}
@@ -145,31 +144,31 @@ static uiFont *uifont_to_blfont(int id)
void uiStyleFontDrawExt(uiFontStyle *fs, rcti *rect, const char *str,
- float *r_xofs, float *r_yofs)
+ float *r_xofs, float *r_yofs)
{
float height;
- int xofs=0, yofs;
+ int xofs = 0, yofs;
uiStyleFontSet(fs);
- height= BLF_ascender(fs->uifont_id);
- yofs= ceil( 0.5f*(rect->ymax - rect->ymin - height));
+ height = BLF_ascender(fs->uifont_id);
+ yofs = ceil(0.5f * (rect->ymax - rect->ymin - height));
- if(fs->align==UI_STYLE_TEXT_CENTER) {
- xofs= floor( 0.5f*(rect->xmax - rect->xmin - BLF_width(fs->uifont_id, str)));
+ if (fs->align == UI_STYLE_TEXT_CENTER) {
+ xofs = floor(0.5f * (rect->xmax - rect->xmin - BLF_width(fs->uifont_id, str)));
/* don't center text if it chops off the start of the text, 2 gives some margin */
- if(xofs < 2) {
- xofs= 2;
+ if (xofs < 2) {
+ xofs = 2;
}
}
- else if(fs->align==UI_STYLE_TEXT_RIGHT) {
- xofs= rect->xmax - rect->xmin - BLF_width(fs->uifont_id, str) - 1;
+ else if (fs->align == UI_STYLE_TEXT_RIGHT) {
+ xofs = rect->xmax - rect->xmin - BLF_width(fs->uifont_id, str) - 1;
}
/* clip is very strict, so we give it some space */
- BLF_clipping(fs->uifont_id, rect->xmin-1, rect->ymin-4, rect->xmax+1, rect->ymax+4);
+ BLF_clipping(fs->uifont_id, rect->xmin - 1, rect->ymin - 4, rect->xmax + 1, rect->ymax + 4);
BLF_enable(fs->uifont_id, BLF_CLIPPING);
- BLF_position(fs->uifont_id, rect->xmin+xofs, rect->ymin+yofs, 0.0f);
+ BLF_position(fs->uifont_id, rect->xmin + xofs, rect->ymin + yofs, 0.0f);
if (fs->shadow) {
BLF_enable(fs->uifont_id, BLF_SHADOW);
@@ -187,15 +186,15 @@ void uiStyleFontDrawExt(uiFontStyle *fs, rcti *rect, const char *str,
if (fs->kerning == 1)
BLF_disable(fs->uifont_id, BLF_KERNING_DEFAULT);
- *r_xofs= xofs;
- *r_yofs= yofs;
+ *r_xofs = xofs;
+ *r_yofs = yofs;
}
void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, const char *str)
{
float xofs, yofs;
uiStyleFontDrawExt(fs, rect, str,
- &xofs, &yofs);
+ &xofs, &yofs);
}
/* drawn same as above, but at 90 degree angle */
@@ -208,28 +207,28 @@ void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, const char *str)
uiStyleFontSet(fs);
- height= BLF_ascender(fs->uifont_id);
+ height = BLF_ascender(fs->uifont_id);
/* becomes x-offset when rotated */
- xofs= ceil( 0.5f*(rect->ymax - rect->ymin - height));
+ xofs = ceil(0.5f * (rect->ymax - rect->ymin - height));
/* ignore UI_STYLE, always aligned to top */
/* rotate counter-clockwise for now (assumes left-to-right language)*/
- xofs+= height;
- yofs= BLF_width(fs->uifont_id, str) + 5;
- angle= 90.0f;
+ xofs += height;
+ yofs = BLF_width(fs->uifont_id, str) + 5;
+ angle = 90.0f;
/* translate rect to vertical */
- txtrect.xmin= rect->xmin - (rect->ymax - rect->ymin);
- txtrect.ymin= rect->ymin - (rect->xmax - rect->xmin);
- txtrect.xmax= rect->xmin;
- txtrect.ymax= rect->ymin;
+ txtrect.xmin = rect->xmin - (rect->ymax - rect->ymin);
+ txtrect.ymin = rect->ymin - (rect->xmax - rect->xmin);
+ txtrect.xmax = rect->xmin;
+ txtrect.ymax = rect->ymin;
/* clip is very strict, so we give it some space */
/* clipping is done without rotation, so make rect big enough to contain both positions */
- BLF_clipping(fs->uifont_id, txtrect.xmin-1, txtrect.ymin-yofs-xofs-4, rect->xmax+1, rect->ymax+4);
+ BLF_clipping(fs->uifont_id, txtrect.xmin - 1, txtrect.ymin - yofs - xofs - 4, rect->xmax + 1, rect->ymax + 4);
BLF_enable(fs->uifont_id, BLF_CLIPPING);
- BLF_position(fs->uifont_id, txtrect.xmin+xofs, txtrect.ymax-yofs, 0.0f);
+ BLF_position(fs->uifont_id, txtrect.xmin + xofs, txtrect.ymax - yofs, 0.0f);
BLF_enable(fs->uifont_id, BLF_ROTATION);
BLF_rotation(fs->uifont_id, angle);
@@ -254,7 +253,7 @@ void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, const char *str)
/* ************** helpers ************************ */
/* XXX: read a style configure */
-uiStyle* UI_GetStyle(void)
+uiStyle *UI_GetStyle(void)
{
uiStyle *style = NULL;
/* offset is two struct uiStyle pointers */
@@ -265,17 +264,17 @@ uiStyle* UI_GetStyle(void)
/* temporarily, does widget font */
int UI_GetStringWidth(const char *str)
{
- uiStyle *style= UI_GetStyle();
- uiFontStyle *fstyle= &style->widget;
+ uiStyle *style = UI_GetStyle();
+ uiFontStyle *fstyle = &style->widget;
int width;
- if (fstyle->kerning==1) /* for BLF_width */
+ if (fstyle->kerning == 1) /* for BLF_width */
BLF_enable(fstyle->uifont_id, BLF_KERNING_DEFAULT);
uiStyleFontSet(fstyle);
- width= BLF_width(fstyle->uifont_id, str);
+ width = BLF_width(fstyle->uifont_id, str);
- if (fstyle->kerning==1)
+ if (fstyle->kerning == 1)
BLF_disable(fstyle->uifont_id, BLF_KERNING_DEFAULT);
return width;
@@ -284,7 +283,7 @@ int UI_GetStringWidth(const char *str)
/* temporarily, does widget font */
void UI_DrawString(float x, float y, const char *str)
{
- uiStyle *style= UI_GetStyle();
+ uiStyle *style = UI_GetStyle();
if (style->widget.kerning == 1)
BLF_enable(style->widget.uifont_id, BLF_KERNING_DEFAULT);
@@ -303,61 +302,61 @@ void UI_DrawString(float x, float y, const char *str)
/* reading without uifont will create one */
void uiStyleInit(void)
{
- uiFont *font= U.uifonts.first;
- uiStyle *style= U.uistyles.first;
+ uiFont *font = U.uifonts.first;
+ uiStyle *style = U.uistyles.first;
/* recover from uninitialized dpi */
- if(U.dpi == 0)
- U.dpi= 72;
+ if (U.dpi == 0)
+ U.dpi = 72;
CLAMP(U.dpi, 48, 128);
/* default builtin */
- if(font==NULL) {
- font= MEM_callocN(sizeof(uiFont), "ui font");
+ if (font == NULL) {
+ font = MEM_callocN(sizeof(uiFont), "ui font");
BLI_addtail(&U.uifonts, font);
BLI_strncpy(font->filename, "default", sizeof(font->filename));
- font->uifont_id= UIFONT_DEFAULT;
+ font->uifont_id = UIFONT_DEFAULT;
}
- for(font= U.uifonts.first; font; font= font->next) {
+ for (font = U.uifonts.first; font; font = font->next) {
- if(font->uifont_id==UIFONT_DEFAULT) {
+ if (font->uifont_id == UIFONT_DEFAULT) {
#ifdef WITH_INTERNATIONAL
- int font_size= datatoc_bfont_ttf_size;
- unsigned char *font_ttf= (unsigned char*)datatoc_bfont_ttf;
+ int font_size = datatoc_bfont_ttf_size;
+ unsigned char *font_ttf = (unsigned char *)datatoc_bfont_ttf;
static int last_font_size = 0;
/* use unicode font for translation */
- if(U.transopts & USER_DOTRANSLATE) {
- font_ttf= BLF_get_unifont(&font_size);
+ if (U.transopts & USER_DOTRANSLATE) {
+ font_ttf = BLF_get_unifont(&font_size);
- if(!font_ttf) {
+ if (!font_ttf) {
/* fall back if not found */
- font_size= datatoc_bfont_ttf_size;
- font_ttf= (unsigned char*)datatoc_bfont_ttf;
+ font_size = datatoc_bfont_ttf_size;
+ font_ttf = (unsigned char *)datatoc_bfont_ttf;
}
}
/* relload only if needed */
- if(last_font_size != font_size) {
+ if (last_font_size != font_size) {
BLF_unload("default");
last_font_size = font_size;
}
- font->blf_id= BLF_load_mem("default", font_ttf, font_size);
+ font->blf_id = BLF_load_mem("default", font_ttf, font_size);
#else
- font->blf_id= BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
+ font->blf_id = BLF_load_mem("default", (unsigned char *)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
#endif
}
else {
- font->blf_id= BLF_load(font->filename);
- if(font->blf_id == -1)
- font->blf_id= BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
+ font->blf_id = BLF_load(font->filename);
+ if (font->blf_id == -1)
+ font->blf_id = BLF_load_mem("default", (unsigned char *)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
}
if (font->blf_id == -1) {
- if (G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("%s: error, no fonts available\n", __func__);
}
else {
@@ -371,26 +370,26 @@ void uiStyleInit(void)
}
}
- if(style==NULL) {
- ui_style_new(&U.uistyles, "Default Style", UIFONT_DEFAULT );
+ if (style == NULL) {
+ ui_style_new(&U.uistyles, "Default Style", UIFONT_DEFAULT);
}
// XXX, this should be moved into a style, but for now best only load the monospaced font once.
if (blf_mono_font == -1)
- blf_mono_font= BLF_load_mem_unique("monospace", (unsigned char *)datatoc_bmonofont_ttf, datatoc_bmonofont_ttf_size);
+ blf_mono_font = BLF_load_mem_unique("monospace", (unsigned char *)datatoc_bmonofont_ttf, datatoc_bmonofont_ttf_size);
BLF_size(blf_mono_font, 12, 72);
/* second for rendering else we get threading problems */
if (blf_mono_font_render == -1)
- blf_mono_font_render= BLF_load_mem_unique("monospace", (unsigned char *)datatoc_bmonofont_ttf, datatoc_bmonofont_ttf_size);
+ blf_mono_font_render = BLF_load_mem_unique("monospace", (unsigned char *)datatoc_bmonofont_ttf, datatoc_bmonofont_ttf_size);
BLF_size(blf_mono_font_render, 12, 72);
}
void uiStyleFontSet(uiFontStyle *fs)
{
- uiFont *font= uifont_to_blfont(fs->uifont_id);
+ uiFont *font = uifont_to_blfont(fs->uifont_id);
BLF_size(font->blf_id, fs->points, U.dpi);
}
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 0b10ab1c92f..81db18aa0f8 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -83,8 +83,8 @@ void uiTemplateHeader(uiLayout *layout, bContext *C, int menus)
{
uiBlock *block;
- block= uiLayoutAbsoluteBlock(layout);
- if(menus) ED_area_header_standardbuttons(C, block, 0);
+ block = uiLayoutAbsoluteBlock(layout);
+ if (menus) ED_area_header_standardbuttons(C, block, 0);
else ED_area_header_switchbutton(C, block, 0);
}
@@ -102,10 +102,10 @@ typedef struct TemplateID {
/* Search browse menu, assign */
static void id_search_call_cb(bContext *C, void *arg_template, void *item)
{
- TemplateID *template= (TemplateID*)arg_template;
+ TemplateID *template = (TemplateID *)arg_template;
/* ID */
- if(item) {
+ if (item) {
PointerRNA idptr;
RNA_id_pointer_create(item, &idptr);
@@ -117,36 +117,36 @@ static void id_search_call_cb(bContext *C, void *arg_template, void *item)
/* ID Search browse menu, do the search */
static void id_search_cb(const bContext *C, void *arg_template, const char *str, uiSearchItems *items)
{
- TemplateID *template= (TemplateID*)arg_template;
- ListBase *lb= template->idlb;
- ID *id, *id_from= template->ptr.id.data;
+ TemplateID *template = (TemplateID *)arg_template;
+ ListBase *lb = template->idlb;
+ ID *id, *id_from = template->ptr.id.data;
int iconid;
- int flag= RNA_property_flag(template->prop);
+ int flag = RNA_property_flag(template->prop);
/* ID listbase */
- for(id= lb->first; id; id= id->next) {
- if(!((flag & PROP_ID_SELF_CHECK) && id == id_from)) {
+ for (id = lb->first; id; id = id->next) {
+ if (!((flag & PROP_ID_SELF_CHECK) && id == id_from)) {
/* use filter */
- if(RNA_property_type(template->prop)==PROP_POINTER) {
+ if (RNA_property_type(template->prop) == PROP_POINTER) {
PointerRNA ptr;
RNA_id_pointer_create(id, &ptr);
- if(RNA_property_pointer_poll(&template->ptr, template->prop, &ptr)==0)
+ if (RNA_property_pointer_poll(&template->ptr, template->prop, &ptr) == 0)
continue;
}
/* hide dot-datablocks, but only if filter does not force it visible */
- if(U.uiflag & USER_HIDE_DOT)
- if ((id->name[2]=='.') && (str[0] != '.'))
+ if (U.uiflag & USER_HIDE_DOT)
+ if ((id->name[2] == '.') && (str[0] != '.'))
continue;
- if(BLI_strcasestr(id->name+2, str)) {
+ if (BLI_strcasestr(id->name + 2, str)) {
char name_ui[MAX_ID_NAME];
name_uiprefix_id(name_ui, id);
- iconid= ui_id_icon_get((bContext*)C, id, template->preview);
+ iconid = ui_id_icon_get((bContext *)C, id, template->preview);
- if(!uiSearchItemAdd(items, name_ui, id, iconid))
+ if (!uiSearchItemAdd(items, name_ui, id, iconid))
break;
}
}
@@ -159,20 +159,20 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
static char search[256];
static TemplateID template;
PointerRNA idptr;
- wmWindow *win= CTX_wm_window(C);
+ wmWindow *win = CTX_wm_window(C);
uiBlock *block;
uiBut *but;
/* clear initial search string, then all items show */
- search[0]= 0;
+ search[0] = 0;
/* arg_litem is malloced, can be freed by parent button */
- template= *((TemplateID*)arg_litem);
+ template = *((TemplateID *)arg_litem);
/* get active id for showing first item */
- idptr= RNA_property_pointer_get(&template.ptr, template.prop);
+ idptr = RNA_property_pointer_get(&template.ptr, template.prop);
- block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1);
+ block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
+ uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_RET_1);
/* preview thumbnails */
if (template.prv_rows > 0 && template.prv_cols > 0) {
@@ -182,7 +182,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
/* fake button, it holds space for search items */
uiDefBut(block, LABEL, 0, "", 10, 15, w, h, NULL, 0, 0, 0, 0, NULL);
- but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, w, 19, template.prv_rows, template.prv_cols, "");
+ but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, w, 19, template.prv_rows, template.prv_cols, "");
uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data);
}
/* list view */
@@ -190,7 +190,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
/* fake button, it holds space for search items */
uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
- but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, "");
+ but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, "");
uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data);
}
@@ -214,24 +214,24 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
void uiIDContextProperty(bContext *C, PointerRNA *ptr, PropertyRNA **prop)
{
TemplateID *template;
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
uiBlock *block;
uiBut *but;
memset(ptr, 0, sizeof(*ptr));
- *prop= NULL;
+ *prop = NULL;
- if(!ar)
+ if (!ar)
return;
- for(block=ar->uiblocks.first; block; block=block->next) {
- for(but=block->buttons.first; but; but= but->next) {
+ for (block = ar->uiblocks.first; block; block = block->next) {
+ for (but = block->buttons.first; but; but = but->next) {
/* find the button before the active one */
- if((but->flag & (UI_BUT_LAST_ACTIVE|UI_ACTIVE))) {
- if(but->func_argN) {
- template= but->func_argN;
- *ptr= template->ptr;
- *prop= template->prop;
+ if ((but->flag & (UI_BUT_LAST_ACTIVE | UI_ACTIVE))) {
+ if (but->func_argN) {
+ template = but->func_argN;
+ *ptr = template->ptr;
+ *prop = template->prop;
return;
}
}
@@ -242,12 +242,12 @@ void uiIDContextProperty(bContext *C, PointerRNA *ptr, PropertyRNA **prop)
static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
{
- TemplateID *template= (TemplateID*)arg_litem;
- PointerRNA idptr= RNA_property_pointer_get(&template->ptr, template->prop);
- ID *id= idptr.data;
- int event= GET_INT_FROM_POINTER(arg_event);
+ TemplateID *template = (TemplateID *)arg_litem;
+ PointerRNA idptr = RNA_property_pointer_get(&template->ptr, template->prop);
+ ID *id = idptr.data;
+ int event = GET_INT_FROM_POINTER(arg_event);
- switch(event) {
+ switch (event) {
case UI_ID_BROWSE:
case UI_ID_PIN:
RNA_warning("warning, id event %d shouldnt come here", event);
@@ -261,40 +261,40 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
RNA_property_pointer_set(&template->ptr, template->prop, idptr);
RNA_property_update(C, &template->ptr, template->prop);
- if(id && CTX_wm_window(C)->eventstate->shift) /* useful hidden functionality, */
- id->us= 0;
+ if (id && CTX_wm_window(C)->eventstate->shift) /* useful hidden functionality, */
+ id->us = 0;
break;
case UI_ID_FAKE_USER:
- if(id) {
- if(id->flag & LIB_FAKEUSER) id_us_plus(id);
+ if (id) {
+ if (id->flag & LIB_FAKEUSER) id_us_plus(id);
else id_us_min(id);
}
else return;
break;
case UI_ID_LOCAL:
- if(id) {
- if(id_make_local(id, 0)) {
+ if (id) {
+ if (id_make_local(id, 0)) {
/* reassign to get get proper updates/notifiers */
- idptr= RNA_property_pointer_get(&template->ptr, template->prop);
+ idptr = RNA_property_pointer_get(&template->ptr, template->prop);
RNA_property_pointer_set(&template->ptr, template->prop, idptr);
RNA_property_update(C, &template->ptr, template->prop);
}
}
break;
case UI_ID_ALONE:
- if(id) {
- const int do_scene_obj= (GS(id->name) == ID_OB) &&
- (template->ptr.type == &RNA_SceneObjects);
+ if (id) {
+ const int do_scene_obj = (GS(id->name) == ID_OB) &&
+ (template->ptr.type == &RNA_SceneObjects);
/* make copy */
- if(do_scene_obj) {
- Scene *scene= CTX_data_scene(C);
+ if (do_scene_obj) {
+ Scene *scene = CTX_data_scene(C);
ED_object_single_user(scene, (struct Object *)id);
- WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
}
else {
- if(id) {
+ if (id) {
id_single_user(C, id, &template->ptr, template->prop);
}
}
@@ -309,13 +309,13 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
static const char *template_id_browse_tip(StructRNA *type)
{
- if(type) {
- switch(RNA_type_to_ID_code(type)) {
+ if (type) {
+ switch (RNA_type_to_ID_code(type)) {
case ID_SCE: return N_("Browse Scene to be linked");
case ID_OB: return N_("Browse Object to be linked");
case ID_ME: return N_("Browse Mesh Data to be linked");
case ID_CU: return N_("Browse Curve Data to be linked");
- case ID_MB: return N_("Browse MetaBall Data to be linked");
+ case ID_MB: return N_("Browse Metaball Data to be linked");
case ID_MA: return N_("Browse Material to be linked");
case ID_TE: return N_("Browse Texture to be linked");
case ID_IM: return N_("Browse Image to be linked");
@@ -345,148 +345,148 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
PointerRNA idptr;
// ListBase *lb; // UNUSED
ID *id, *idfrom;
- int editable= RNA_property_editable(&template->ptr, template->prop);
+ int editable = RNA_property_editable(&template->ptr, template->prop);
- idptr= RNA_property_pointer_get(&template->ptr, template->prop);
- id= idptr.data;
- idfrom= template->ptr.id.data;
+ idptr = RNA_property_pointer_get(&template->ptr, template->prop);
+ id = idptr.data;
+ idfrom = template->ptr.id.data;
// lb= template->idlb;
- block= uiLayoutGetBlock(layout);
+ block = uiLayoutGetBlock(layout);
uiBlockBeginAlign(block);
- if(idptr.type)
- type= idptr.type;
+ if (idptr.type)
+ type = idptr.type;
- if(flag & UI_ID_PREVIEWS) {
+ if (flag & UI_ID_PREVIEWS) {
- but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*6, UI_UNIT_Y*6,
- TIP_(template_id_browse_tip(type)));
- if(type) {
- but->icon= RNA_struct_ui_icon(type);
+ but = uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X * 6, UI_UNIT_Y * 6,
+ TIP_(template_id_browse_tip(type)));
+ if (type) {
+ but->icon = RNA_struct_ui_icon(type);
if (id) but->icon = ui_id_icon_get(C, id, 1);
- uiButSetFlag(but, UI_HAS_ICON|UI_ICON_PREVIEW);
+ uiButSetFlag(but, UI_HAS_ICON | UI_ICON_PREVIEW);
}
- if((idfrom && idfrom->lib) || !editable)
+ if ((idfrom && idfrom->lib) || !editable)
uiButSetFlag(but, UI_BUT_DISABLED);
uiLayoutRow(layout, 1);
- template->preview= 1;
+ template->preview = 1;
}
- else if(flag & UI_ID_BROWSE) {
- but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*1.6, UI_UNIT_Y,
- TIP_(template_id_browse_tip(type)));
- if(type) {
- but->icon= RNA_struct_ui_icon(type);
+ else if (flag & UI_ID_BROWSE) {
+ but = uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X * 1.6, UI_UNIT_Y,
+ TIP_(template_id_browse_tip(type)));
+ if (type) {
+ but->icon = RNA_struct_ui_icon(type);
/* default dragging of icon for id browse buttons */
uiButSetDragID(but, id);
- uiButSetFlag(but, UI_HAS_ICON|UI_ICON_LEFT);
+ uiButSetFlag(but, UI_HAS_ICON | UI_ICON_LEFT);
}
- if((idfrom && idfrom->lib) || !editable)
+ if ((idfrom && idfrom->lib) || !editable)
uiButSetFlag(but, UI_BUT_DISABLED);
}
/* text button with name */
- if(id) {
+ if (id) {
char name[UI_MAX_NAME_STR];
- const short user_alert= (id->us <= 0);
+ const short user_alert = (id->us <= 0);
//text_idbutton(id, name);
- name[0]= '\0';
- but= uiDefButR(block, TEX, 0, name, 0, 0, UI_UNIT_X*6, UI_UNIT_Y, &idptr, "name", -1, 0, 0, -1, -1, NULL);
+ name[0] = '\0';
+ but = uiDefButR(block, TEX, 0, name, 0, 0, UI_UNIT_X * 6, UI_UNIT_Y, &idptr, "name", -1, 0, 0, -1, -1, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_RENAME));
- if(user_alert) uiButSetFlag(but, UI_BUT_REDALERT);
+ if (user_alert) uiButSetFlag(but, UI_BUT_REDALERT);
- if(id->lib) {
- if(id->flag & LIB_INDIRECT) {
- but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0,
- TIP_("Indirect library datablock, cannot change"));
+ if (id->lib) {
+ if (id->flag & LIB_INDIRECT) {
+ but = uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0,
+ TIP_("Indirect library datablock, cannot change"));
uiButSetFlag(but, UI_BUT_DISABLED);
}
else {
- but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0,
- TIP_("Direct linked library datablock, click to make local"));
- if(!id_make_local(id, 1 /* test */) || (idfrom && idfrom->lib))
+ but = uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0,
+ TIP_("Direct linked library datablock, click to make local"));
+ if (!id_make_local(id, 1 /* test */) || (idfrom && idfrom->lib))
uiButSetFlag(but, UI_BUT_DISABLED);
}
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_LOCAL));
}
- if(id->us > 1) {
+ if (id->us > 1) {
char numstr[32];
BLI_snprintf(numstr, sizeof(numstr), "%d", id->us);
- but= uiDefBut(block, BUT, 0, numstr, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0,
- TIP_("Display number of users of this data (click to make a single-user copy)"));
+ but = uiDefBut(block, BUT, 0, numstr, 0, 0, UI_UNIT_X + ((id->us < 10) ? 0 : 10), UI_UNIT_Y, NULL, 0, 0, 0, 0,
+ TIP_("Display number of users of this data (click to make a single-user copy)"));
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE));
- if(!id_copy(id, NULL, 1 /* test only */) || (idfrom && idfrom->lib) || !editable)
+ if (!id_copy(id, NULL, 1 /* test only */) || (idfrom && idfrom->lib) || !editable)
uiButSetFlag(but, UI_BUT_DISABLED);
}
- if(user_alert) uiButSetFlag(but, UI_BUT_REDALERT);
+ if (user_alert) uiButSetFlag(but, UI_BUT_REDALERT);
- if(id->lib == NULL && !(ELEM5(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_TXT, ID_OB))) {
+ if (id->lib == NULL && !(ELEM5(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_TXT, ID_OB))) {
uiDefButR(block, TOG, 0, "F", 0, 0, UI_UNIT_X, UI_UNIT_Y, &idptr, "use_fake_user", -1, 0, 0, -1, -1, NULL);
}
}
- if(flag & UI_ID_ADD_NEW) {
- int w= id?UI_UNIT_X: (flag & UI_ID_OPEN)? UI_UNIT_X*3: UI_UNIT_X*6;
+ if (flag & UI_ID_ADD_NEW) {
+ int w = id ? UI_UNIT_X : (flag & UI_ID_OPEN) ? UI_UNIT_X * 3 : UI_UNIT_X * 6;
- if(newop) {
- but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id)? "": IFACE_("New"), 0, 0, w, UI_UNIT_Y, NULL);
+ if (newop) {
+ but = uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id) ? "" : IFACE_("New"), 0, 0, w, UI_UNIT_Y, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
}
else {
- but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (id)? "": IFACE_("New"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
+ but = uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (id) ? "" : IFACE_("New"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
}
- if((idfrom && idfrom->lib) || !editable)
+ if ((idfrom && idfrom->lib) || !editable)
uiButSetFlag(but, UI_BUT_DISABLED);
}
- if(flag & UI_ID_OPEN) {
- int w= id?UI_UNIT_X: (flag & UI_ID_ADD_NEW)? UI_UNIT_X*3: UI_UNIT_X*6;
+ if (flag & UI_ID_OPEN) {
+ int w = id ? UI_UNIT_X : (flag & UI_ID_ADD_NEW) ? UI_UNIT_X * 3 : UI_UNIT_X * 6;
- if(openop) {
- but= uiDefIconTextButO(block, BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id)? "": IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL);
+ if (openop) {
+ but = uiDefIconTextButO(block, BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id) ? "" : IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN));
}
else {
- but= uiDefIconTextBut(block, BUT, 0, ICON_FILESEL, (id)? "": IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
+ but = uiDefIconTextBut(block, BUT, 0, ICON_FILESEL, (id) ? "" : IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN));
}
- if((idfrom && idfrom->lib) || !editable)
+ if ((idfrom && idfrom->lib) || !editable)
uiButSetFlag(but, UI_BUT_DISABLED);
}
/* delete button */
- if(id && (flag & UI_ID_DELETE) && (RNA_property_flag(template->prop) & PROP_NEVER_UNLINK)==0) {
- if(unlinkop) {
- but= uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL);
+ if (id && (flag & UI_ID_DELETE) && (RNA_property_flag(template->prop) & PROP_NEVER_UNLINK) == 0) {
+ if (unlinkop) {
+ but = uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL);
/* so we can access the template from operators, font unlinking needs this */
uiButSetNFunc(but, NULL, MEM_dupallocN(template), NULL);
}
else {
- but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0,
- TIP_("Unlink datablock. Shift + Click to set users to zero, data will then not be saved"));
+ but = uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0,
+ TIP_("Unlink datablock. Shift + Click to set users to zero, data will then not be saved"));
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_DELETE));
- if(RNA_property_flag(template->prop) & PROP_NEVER_NULL)
+ if (RNA_property_flag(template->prop) & PROP_NEVER_NULL)
uiButSetFlag(but, UI_BUT_DISABLED);
}
- if((idfrom && idfrom->lib) || !editable)
+ if ((idfrom && idfrom->lib) || !editable)
uiButSetFlag(but, UI_BUT_DISABLED);
}
- if(idcode == ID_TE)
+ if (idcode == ID_TE)
uiTemplateTextureShow(layout, C, &template->ptr, template->prop);
uiBlockEndAlign(block);
@@ -499,32 +499,32 @@ static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, const
StructRNA *type;
short idcode;
- prop= RNA_struct_find_property(ptr, propname);
+ prop = RNA_struct_find_property(ptr, propname);
- if(!prop || RNA_property_type(prop) != PROP_POINTER) {
+ if (!prop || RNA_property_type(prop) != PROP_POINTER) {
RNA_warning("pointer property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
return;
}
- template= MEM_callocN(sizeof(TemplateID), "TemplateID");
- template->ptr= *ptr;
- template->prop= prop;
+ template = MEM_callocN(sizeof(TemplateID), "TemplateID");
+ template->ptr = *ptr;
+ template->prop = prop;
template->prv_rows = prv_rows;
template->prv_cols = prv_cols;
- if(newop)
+ if (newop)
flag |= UI_ID_ADD_NEW;
- if(openop)
+ if (openop)
flag |= UI_ID_OPEN;
- type= RNA_property_pointer_type(ptr, prop);
- idcode= RNA_type_to_ID_code(type);
- template->idlb= which_libbase(CTX_data_main(C), idcode);
+ type = RNA_property_pointer_type(ptr, prop);
+ idcode = RNA_type_to_ID_code(type);
+ template->idlb = which_libbase(CTX_data_main(C), idcode);
/* create UI elements for this template
* - template_ID makes a copy of the template data and assigns it to the relevant buttons
*/
- if(template->idlb) {
+ if (template->idlb) {
uiLayoutRow(layout, 1);
template_ID(C, layout, template, type, idcode, flag, newop, openop, unlinkop);
}
@@ -534,17 +534,17 @@ static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, const
void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop)
{
- ui_template_id(layout, C, ptr, propname, newop, openop, unlinkop, UI_ID_BROWSE|UI_ID_RENAME|UI_ID_DELETE, 0, 0);
+ ui_template_id(layout, C, ptr, propname, newop, openop, unlinkop, UI_ID_BROWSE | UI_ID_RENAME | UI_ID_DELETE, 0, 0);
}
void uiTemplateIDBrowse(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop)
{
- ui_template_id(layout, C, ptr, propname, newop, openop, unlinkop, UI_ID_BROWSE|UI_ID_RENAME, 0, 0);
+ ui_template_id(layout, C, ptr, propname, newop, openop, unlinkop, UI_ID_BROWSE | UI_ID_RENAME, 0, 0);
}
void uiTemplateIDPreview(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, int rows, int cols)
{
- ui_template_id(layout, C, ptr, propname, newop, openop, unlinkop, UI_ID_BROWSE|UI_ID_RENAME|UI_ID_DELETE|UI_ID_PREVIEWS, rows, cols);
+ ui_template_id(layout, C, ptr, propname, newop, openop, unlinkop, UI_ID_BROWSE | UI_ID_RENAME | UI_ID_DELETE | UI_ID_PREVIEWS, rows, cols);
}
/************************ ID Chooser Template ***************************/
@@ -560,8 +560,8 @@ void uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, const char *propname, co
uiLayout *row;
/* get properties... */
- propID= RNA_struct_find_property(ptr, propname);
- propType= RNA_struct_find_property(ptr, proptypename);
+ propID = RNA_struct_find_property(ptr, propname);
+ propType = RNA_struct_find_property(ptr, proptypename);
if (!propID || RNA_property_type(propID) != PROP_POINTER) {
RNA_warning("pointer property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
@@ -573,7 +573,7 @@ void uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, const char *propname, co
}
/* Start drawing UI Elements using standard defines */
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
/* Label - either use the provided text, or will become "ID-Block:" */
if (text)
@@ -605,14 +605,14 @@ void uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, const char *propna
uiLayout *row;
/* check that properties are valid */
- propPath= RNA_struct_find_property(ptr, propname);
+ propPath = RNA_struct_find_property(ptr, propname);
if (!propPath || RNA_property_type(propPath) != PROP_STRING) {
RNA_warning("path property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
return;
}
/* Start drawing UI Elements using standard defines */
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
/* Path (existing string) Widget */
uiItemR(row, ptr, propname, 0, text, ICON_RNA);
@@ -643,21 +643,21 @@ static void modifiers_setOnCage(bContext *C, void *ob_v, void *md_v)
{
Scene *scene = CTX_data_scene(C);
Object *ob = ob_v;
- ModifierData *md= md_v;
+ ModifierData *md = md_v;
int i, cageIndex = modifiers_getCageIndex(scene, ob, NULL, 0);
/* undo button operation */
md->mode ^= eModifierMode_OnCage;
- for(i = 0, md=ob->modifiers.first; md; ++i, md=md->next) {
- if(md == md_v) {
- if(i >= cageIndex)
+ for (i = 0, md = ob->modifiers.first; md; ++i, md = md->next) {
+ if (md == md_v) {
+ if (i >= cageIndex)
md->mode ^= eModifierMode_OnCage;
break;
}
}
- WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
+ WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
@@ -676,7 +676,7 @@ static void modifiers_convertToReal(bContext *C, void *ob_v, void *md_v)
ob->partype = PAROBJECT;
- WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
+ WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
ED_undo_push(C, "Modifier convert to real");
@@ -685,8 +685,8 @@ static void modifiers_convertToReal(bContext *C, void *ob_v, void *md_v)
static int modifier_can_delete(ModifierData *md)
{
/* fluid particle modifier can't be deleted here */
- if(md->type == eModifierType_ParticleSystem)
- if(((ParticleSystemModifierData *)md)->psys->part->type == PART_FLUID)
+ if (md->type == eModifierType_ParticleSystem)
+ if (((ParticleSystemModifierData *)md)->psys->part->type == PART_FLUID)
return 0;
return 1;
@@ -697,7 +697,7 @@ static int modifier_is_simulation(ModifierData *md)
{
/* Physic Tab */
if (ELEM7(md->type, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim, eModifierType_Smoke,
- eModifierType_Softbody, eModifierType_Surface, eModifierType_DynamicPaint))
+ eModifierType_Softbody, eModifierType_Surface, eModifierType_DynamicPaint))
{
return 1;
}
@@ -718,30 +718,30 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
uiBut *but;
uiBlock *block;
uiLayout *box, *column, *row;
- uiLayout *result= NULL;
+ uiLayout *result = NULL;
int isVirtual = (md->mode & eModifierMode_Virtual);
char str[128];
/* create RNA pointer */
RNA_pointer_create(&ob->id, &RNA_Modifier, md, &ptr);
- column= uiLayoutColumn(layout, 1);
+ column = uiLayoutColumn(layout, 1);
uiLayoutSetContextPointer(column, "modifier", &ptr);
/* rounded header ------------------------------------------------------------------- */
- box= uiLayoutBox(column);
+ box = uiLayoutBox(column);
if (isVirtual) {
- row= uiLayoutRow(box, 0);
+ row = uiLayoutRow(box, 0);
uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_EXPAND);
- block= uiLayoutGetBlock(row);
+ block = uiLayoutGetBlock(row);
/* VIRTUAL MODIFIER */
// XXX this is not used now, since these cannot be accessed via RNA
BLI_snprintf(str, sizeof(str), "%s parent deform", md->name);
uiDefBut(block, LABEL, 0, str, 0, 0, 185, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Modifier name");
but = uiDefBut(block, BUT, 0, IFACE_("Make Real"), 0, 0, 80, 16, NULL, 0.0, 0.0, 0.0, 0.0,
- TIP_("Convert virtual modifier to a real modifier"));
+ TIP_("Convert virtual modifier to a real modifier"));
uiButSetFunc(but, modifiers_convertToReal, ob, md);
}
else {
@@ -763,8 +763,8 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
/* mode enabling buttons */
uiBlockBeginAlign(block);
/* Softbody not allowed in this situation, enforce! */
- if ( ((md->type!=eModifierType_Softbody && md->type!=eModifierType_Collision) || !(ob->pd && ob->pd->deflect))
- && (md->type!=eModifierType_Surface) )
+ if ( ((md->type != eModifierType_Softbody && md->type != eModifierType_Collision) || !(ob->pd && ob->pd->deflect))
+ && (md->type != eModifierType_Surface) )
{
uiItemR(row, &ptr, "show_render", 0, "", ICON_NONE);
uiItemR(row, &ptr, "show_viewport", 0, "", ICON_NONE);
@@ -773,12 +773,11 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
uiItemR(row, &ptr, "show_in_editmode", 0, "", ICON_NONE);
}
- if (ob->type==OB_MESH) {
- if (modifier_couldBeCage(scene, md) && (index <= lastCageIndex))
- {
+ if (ob->type == OB_MESH) {
+ 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"));
+ 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"));
if (index < cageIndex)
uiButSetFlag(but, UI_BUT_DISABLED);
uiButSetFunc(but, modifiers_setOnCage, ob, md);
@@ -788,21 +787,22 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
/* place holder button */
uiBlockSetEmboss(block, UI_EMBOSSN);
- but= uiDefIconBut(block, BUT, 0, ICON_NONE, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, NULL);
+ but = uiDefIconBut(block, BUT, 0, ICON_NONE, 0, 0, UI_UNIT_X - 2, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, NULL);
uiButSetFlag(but, UI_BUT_DISABLED);
uiBlockSetEmboss(block, UI_EMBOSS);
}
- } /* tesselation point for curve-typed objects */
+ } /* tessellation point for curve-typed objects */
else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
- /* some modifiers could work with pre-tesselated curves only */
+ /* some modifiers could work with pre-tessellated 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 */
- 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"));
+ /* add disabled pre-tessellated button, so users could have
+ * 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 */
+ }
+ else if (mti->type != eModifierTypeType_Constructive) {
+ /* constructive modifiers tessellates curve before applying */
uiItemR(row, &ptr, "use_apply_on_spline", 0, "", ICON_NONE);
}
}
@@ -830,20 +830,20 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
/* modifier settings (under the header) --------------------------------------------------- */
if (!isVirtual && (md->mode & eModifierMode_Expanded)) {
/* apply/convert/copy */
- box= uiLayoutBox(column);
- row= uiLayoutRow(box, 0);
+ box = uiLayoutBox(column);
+ row = uiLayoutRow(box, 0);
if (!ELEM(md->type, eModifierType_Collision, eModifierType_Surface)) {
/* only here obdata, the rest of modifiers is ob level */
uiBlockSetButLock(block, object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
- if (md->type==eModifierType_ParticleSystem) {
- ParticleSystem *psys= ((ParticleSystemModifierData *)md)->psys;
+ if (md->type == eModifierType_ParticleSystem) {
+ ParticleSystem *psys = ((ParticleSystemModifierData *)md)->psys;
if (!(ob->mode & OB_MODE_PARTICLE_EDIT) && psys->pathcache) {
- if(ELEM(psys->part->ren_as, PART_DRAW_GR, PART_DRAW_OB))
+ if (ELEM(psys->part->ren_as, PART_DRAW_GR, PART_DRAW_OB))
uiItemO(row, "Convert", ICON_NONE, "OBJECT_OT_duplicates_make_real");
- else if(psys->part->ren_as == PART_DRAW_PATH)
+ else if (psys->part->ren_as == PART_DRAW_PATH)
uiItemO(row, "Convert", ICON_NONE, "OBJECT_OT_modifier_convert");
}
}
@@ -863,12 +863,12 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
}
/* result is the layout block inside the box, that we return so that modifier settings can be drawn */
- result= uiLayoutColumn(box, 0);
- block= uiLayoutAbsoluteBlock(box);
+ result = uiLayoutColumn(box, 0);
+ block = uiLayoutAbsoluteBlock(box);
}
/* error messages */
- if(md->error) {
+ if (md->error) {
box = uiLayoutBox(column);
row = uiLayoutRow(box, 0);
uiItemL(row, md->error, ICON_ERROR);
@@ -885,15 +885,15 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr)
int i, lastCageIndex, cageIndex;
/* verify we have valid data */
- if(!RNA_struct_is_a(ptr->type, &RNA_Modifier)) {
+ if (!RNA_struct_is_a(ptr->type, &RNA_Modifier)) {
RNA_warning("Expected modifier on object");
return NULL;
}
- ob= ptr->id.data;
- md= ptr->data;
+ ob = ptr->id.data;
+ md = ptr->data;
- if(!ob || !(GS(ob->id.name) == ID_OB)) {
+ if (!ob || !(GS(ob->id.name) == ID_OB)) {
RNA_warning("Expected modifier on object");
return NULL;
}
@@ -906,10 +906,10 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr)
// XXX virtual modifiers are not accesible for python
vmd = modifiers_getVirtualModifierList(ob);
- for(i=0; vmd; i++, vmd=vmd->next) {
- if(md == vmd)
+ for (i = 0; vmd; i++, vmd = vmd->next) {
+ if (md == vmd)
return draw_modifier(layout, scene, ob, md, i, cageIndex, lastCageIndex);
- else if(vmd->mode & eModifierMode_Virtual)
+ else if (vmd->mode & eModifierMode_Virtual)
i--;
}
@@ -923,42 +923,42 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr)
#include "BKE_action.h"
#include "BKE_constraint.h"
-#define REDRAWIPO 1
-#define REDRAWNLA 2
-#define REDRAWBUTSOBJECT 3
-#define REDRAWACTION 4
-#define B_CONSTRAINT_TEST 5
-#define B_CONSTRAINT_CHANGETARGET 6
-#define REMAKEIPO 8
-#define B_DIFF 9
+#define REDRAWIPO 1
+#define REDRAWNLA 2
+#define REDRAWBUTSOBJECT 3
+#define REDRAWACTION 4
+#define B_CONSTRAINT_TEST 5
+#define B_CONSTRAINT_CHANGETARGET 6
+#define REMAKEIPO 8
+#define B_DIFF 9
static void do_constraint_panels(bContext *C, void *ob_pt, int event)
{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
- Object *ob= (Object *)ob_pt;
-
- switch(event) {
- case B_CONSTRAINT_TEST:
- break; // no handling
- case B_CONSTRAINT_CHANGETARGET:
- if (ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels
- DAG_scene_sort(bmain, scene);
- break;
- default:
- break;
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = (Object *)ob_pt;
+
+ switch (event) {
+ case B_CONSTRAINT_TEST:
+ break; // no handling
+ case B_CONSTRAINT_CHANGETARGET:
+ if (ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels
+ DAG_scene_sort(bmain, scene);
+ break;
+ default:
+ break;
}
// note: RNA updates now call this, commenting else it gets called twice.
// if there are problems because of this, then rna needs changed update functions.
//
// object_test_constraints(ob);
- // if(ob->pose) update_pose_constraint_flags(ob->pose);
+ // if (ob->pose) update_pose_constraint_flags(ob->pose);
- if(ob->type==OB_ARMATURE) DAG_id_tag_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB);
+ if (ob->type == OB_ARMATURE) DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
else DAG_id_tag_update(&ob->id, OB_RECALC_OB);
- WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, ob);
+ WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT, ob);
}
static void constraint_active_func(bContext *UNUSED(C), void *ob_v, void *con_v)
@@ -969,17 +969,17 @@ static void constraint_active_func(bContext *UNUSED(C), void *ob_v, void *con_v)
/* draw panel showing settings for a constraint */
static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
{
- bPoseChannel *pchan= get_active_posechannel(ob);
+ bPoseChannel *pchan = get_active_posechannel(ob);
bConstraintTypeInfo *cti;
uiBlock *block;
- uiLayout *result= NULL, *col, *box, *row;
+ uiLayout *result = NULL, *col, *box, *row;
PointerRNA ptr;
char typestr[32];
- short proxy_protected, xco=0, yco=0;
+ short proxy_protected, xco = 0, yco = 0;
// int rb_col; // UNUSED
/* get constraint typeinfo */
- cti= constraint_get_typeinfo(con);
+ cti = constraint_get_typeinfo(con);
if (cti == NULL) {
/* exception for 'Null' constraint - it doesn't have constraint typeinfo! */
BLI_strncpy(typestr, (con->type == CONSTRAINT_TYPE_NULL) ? "Null" : "Unknown", sizeof(typestr));
@@ -989,23 +989,23 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
/* determine whether constraint is proxy protected or not */
if (proxylocked_constraints_owner(ob, pchan))
- proxy_protected= (con->flag & CONSTRAINT_PROXY_LOCAL)==0;
+ proxy_protected = (con->flag & CONSTRAINT_PROXY_LOCAL) == 0;
else
- proxy_protected= 0;
+ proxy_protected = 0;
/* unless button has own callback, it adds this callback to button */
- block= uiLayoutGetBlock(layout);
+ block = uiLayoutGetBlock(layout);
uiBlockSetHandleFunc(block, do_constraint_panels, ob);
uiBlockSetFunc(block, constraint_active_func, ob, con);
RNA_pointer_create(&ob->id, &RNA_Constraint, con, &ptr);
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
uiLayoutSetContextPointer(col, "constraint", &ptr);
- box= uiLayoutBox(col);
+ box = uiLayoutBox(col);
row = uiLayoutRow(box, 0);
- block= uiLayoutGetBlock(box);
+ block = uiLayoutGetBlock(box);
/* Draw constraint header */
@@ -1015,12 +1015,12 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
uiBlockSetEmboss(block, UI_EMBOSS);
/* name */
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco+10, yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
+ uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco + 10, yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
if (con->flag & CONSTRAINT_DISABLE)
uiLayoutSetRedAlert(row, 1);
- if(proxy_protected == 0) {
+ if (proxy_protected == 0) {
uiItemR(row, &ptr, "name", 0, "", ICON_NONE);
}
else
@@ -1033,8 +1033,8 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
uiBlockSetEmboss(block, UI_EMBOSSN);
/* draw a ghost icon (for proxy) and also a lock beside it, to show that constraint is "proxy locked" */
- uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_GHOST, xco+244, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Proxy Protected"));
- uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_LOCKED, xco+262, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Proxy Protected"));
+ uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_GHOST, xco + 244, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Proxy Protected"));
+ uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_LOCKED, xco + 262, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Proxy Protected"));
uiBlockSetEmboss(block, UI_EMBOSS);
}
@@ -1046,20 +1046,20 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
* as that poses problems when restoring them, so disable the "up" button where
* it may cause this situation.
*
- * Up/Down buttons should only be shown (or not greyed - todo) if they serve some purpose.
+ * Up/Down buttons should only be shown (or not greyed - todo) if they serve some purpose.
*/
if (proxylocked_constraints_owner(ob, pchan)) {
if (con->prev) {
- prev_proxylock= (con->prev->flag & CONSTRAINT_PROXY_LOCAL) ? 0 : 1;
+ prev_proxylock = (con->prev->flag & CONSTRAINT_PROXY_LOCAL) ? 0 : 1;
}
else
- prev_proxylock= 0;
+ prev_proxylock = 0;
}
else
- prev_proxylock= 0;
+ prev_proxylock = 0;
- show_upbut= ((prev_proxylock == 0) && (con->prev));
- show_downbut= (con->next) ? 1 : 0;
+ show_upbut = ((prev_proxylock == 0) && (con->prev));
+ show_downbut = (con->next) ? 1 : 0;
/* enabled */
uiBlockSetEmboss(block, UI_EMBOSSN);
@@ -1094,9 +1094,9 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
(yco) -= 21;
}
else {
- box= uiLayoutBox(col);
- block= uiLayoutAbsoluteBlock(box);
- result= box;
+ box = uiLayoutBox(col);
+ block = uiLayoutAbsoluteBlock(box);
+ result = box;
}
/* clear any locks set up for proxies/lib-linking */
@@ -1111,15 +1111,15 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr)
bConstraint *con;
/* verify we have valid data */
- if(!RNA_struct_is_a(ptr->type, &RNA_Constraint)) {
+ if (!RNA_struct_is_a(ptr->type, &RNA_Constraint)) {
RNA_warning("Expected constraint on object");
return NULL;
}
- ob= ptr->id.data;
- con= ptr->data;
+ ob = ptr->id.data;
+ con = ptr->data;
- if(!ob || !(GS(ob->id.name) == ID_OB)) {
+ if (!ob || !(GS(ob->id.name) == ID_OB)) {
RNA_warning("Expected constraint on object");
return NULL;
}
@@ -1127,9 +1127,9 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr)
uiBlockSetButLock(uiLayoutGetBlock(layout), (ob && ob->id.lib), ERROR_LIBDATA_MESSAGE);
/* hrms, the temporal constraint should not draw! */
- if(con->type==CONSTRAINT_TYPE_KINEMATIC) {
- bKinematicConstraint *data= con->data;
- if(data->flag & CONSTRAINT_IK_TEMP)
+ if (con->type == CONSTRAINT_TYPE_KINEMATIC) {
+ bKinematicConstraint *data = con->data;
+ if (data->flag & CONSTRAINT_IK_TEMP)
return NULL;
}
@@ -1147,9 +1147,9 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr)
static void do_preview_buttons(bContext *C, void *arg, int event)
{
- switch(event) {
+ switch (event) {
case B_MATPRV:
- WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING, arg);
+ WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING, arg);
break;
}
}
@@ -1158,54 +1158,54 @@ void uiTemplatePreview(uiLayout *layout, ID *id, int show_buttons, ID *parent, M
{
uiLayout *row, *col;
uiBlock *block;
- Material *ma= NULL;
- Tex *tex = (Tex*)id;
+ Material *ma = NULL;
+ Tex *tex = (Tex *)id;
ID *pid, *pparent;
- short *pr_texture= NULL;
+ short *pr_texture = NULL;
PointerRNA material_ptr;
PointerRNA texture_ptr;
- if(id && !ELEM4(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA)) {
+ if (id && !ELEM4(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA)) {
RNA_warning("Expected ID of type material, texture, lamp or world");
return;
}
/* decide what to render */
- pid= id;
- pparent= NULL;
-
- if(id && (GS(id->name) == ID_TE)) {
- if(parent && (GS(parent->name) == ID_MA))
- pr_texture= &((Material*)parent)->pr_texture;
- else if(parent && (GS(parent->name) == ID_WO))
- pr_texture= &((World*)parent)->pr_texture;
- else if(parent && (GS(parent->name) == ID_LA))
- pr_texture= &((Lamp*)parent)->pr_texture;
-
- if(pr_texture) {
- if(*pr_texture == TEX_PR_OTHER)
- pid= parent;
- else if(*pr_texture == TEX_PR_BOTH)
- pparent= parent;
+ pid = id;
+ pparent = NULL;
+
+ if (id && (GS(id->name) == ID_TE)) {
+ if (parent && (GS(parent->name) == ID_MA))
+ pr_texture = &((Material *)parent)->pr_texture;
+ else if (parent && (GS(parent->name) == ID_WO))
+ pr_texture = &((World *)parent)->pr_texture;
+ else if (parent && (GS(parent->name) == ID_LA))
+ pr_texture = &((Lamp *)parent)->pr_texture;
+
+ if (pr_texture) {
+ if (*pr_texture == TEX_PR_OTHER)
+ pid = parent;
+ else if (*pr_texture == TEX_PR_BOTH)
+ pparent = parent;
}
}
/* layout */
- block= uiLayoutGetBlock(layout);
- row= uiLayoutRow(layout, 0);
- col= uiLayoutColumn(row, 0);
+ block = uiLayoutGetBlock(layout);
+ row = uiLayoutRow(layout, 0);
+ col = uiLayoutColumn(row, 0);
uiLayoutSetKeepAspect(col, 1);
/* add preview */
- uiDefBut(block, BUT_EXTRA, 0, "", 0, 0, UI_UNIT_X*6, UI_UNIT_Y*6, pid, 0.0, 0.0, 0, 0, "");
+ uiDefBut(block, BUT_EXTRA, 0, "", 0, 0, UI_UNIT_X * 6, UI_UNIT_Y * 6, pid, 0.0, 0.0, 0, 0, "");
uiBlockSetDrawExtraFunc(block, ED_preview_draw, pparent, slot);
uiBlockSetHandleFunc(block, do_preview_buttons, NULL);
/* add buttons */
if (pid && show_buttons) {
- if(GS(pid->name) == ID_MA || (pparent && GS(pparent->name) == ID_MA)) {
- if(GS(pid->name) == ID_MA) ma= (Material*)pid;
- else ma= (Material*)pparent;
+ if (GS(pid->name) == ID_MA || (pparent && GS(pparent->name) == ID_MA)) {
+ if (GS(pid->name) == ID_MA) ma = (Material *)pid;
+ else ma = (Material *)pparent;
/* Create RNA Pointer */
RNA_pointer_create(id, &RNA_Material, ma, &material_ptr);
@@ -1215,22 +1215,22 @@ void uiTemplatePreview(uiLayout *layout, ID *id, int show_buttons, ID *parent, M
uiItemR(col, &material_ptr, "preview_render_type", UI_ITEM_R_EXPAND, "", ICON_NONE);
}
- if(pr_texture) {
+ if (pr_texture) {
/* Create RNA Pointer */
RNA_pointer_create(id, &RNA_Texture, tex, &texture_ptr);
uiLayoutRow(layout, 1);
- uiDefButS(block, ROW, B_MATPRV, IFACE_("Texture"), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_TEXTURE, 0, 0, "");
- if(GS(parent->name) == ID_MA)
- uiDefButS(block, ROW, B_MATPRV, IFACE_("Material"), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, "");
- else if(GS(parent->name) == ID_LA)
- uiDefButS(block, ROW, B_MATPRV, IFACE_("Lamp"), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, "");
- else if(GS(parent->name) == ID_WO)
- uiDefButS(block, ROW, B_MATPRV, IFACE_("World"), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, "");
- uiDefButS(block, ROW, B_MATPRV, IFACE_("Both"), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_BOTH, 0, 0, "");
+ uiDefButS(block, ROW, B_MATPRV, IFACE_("Texture"), 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, pr_texture, 10, TEX_PR_TEXTURE, 0, 0, "");
+ if (GS(parent->name) == ID_MA)
+ uiDefButS(block, ROW, B_MATPRV, IFACE_("Material"), 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, "");
+ else if (GS(parent->name) == ID_LA)
+ uiDefButS(block, ROW, B_MATPRV, IFACE_("Lamp"), 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, "");
+ else if (GS(parent->name) == ID_WO)
+ uiDefButS(block, ROW, B_MATPRV, IFACE_("World"), 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, "");
+ uiDefButS(block, ROW, B_MATPRV, IFACE_("Both"), 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, pr_texture, 10, TEX_PR_BOTH, 0, 0, "");
/* Alpha button for texture preview */
- if(*pr_texture!=TEX_PR_OTHER) {
+ if (*pr_texture != TEX_PR_OTHER) {
row = uiLayoutRow(layout, 0);
uiItemR(row, &texture_ptr, "use_preview_alpha", 0, NULL, ICON_NONE);
}
@@ -1248,11 +1248,11 @@ typedef struct RNAUpdateCb {
static void rna_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg))
{
- RNAUpdateCb *cb= (RNAUpdateCb*)arg_cb;
+ 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);
}
@@ -1260,15 +1260,15 @@ static void rna_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg))
static void colorband_add_cb(bContext *C, void *cb_v, void *coba_v)
{
- ColorBand *coba= coba_v;
- float pos= 0.5f;
+ ColorBand *coba = coba_v;
+ float pos = 0.5f;
- if(coba->tot > 1) {
- if(coba->cur > 0) pos= (coba->data[coba->cur-1].pos + coba->data[coba->cur].pos) * 0.5f;
- else pos= (coba->data[coba->cur+1].pos + coba->data[coba->cur].pos) * 0.5f;
+ if (coba->tot > 1) {
+ if (coba->cur > 0) pos = (coba->data[coba->cur - 1].pos + coba->data[coba->cur].pos) * 0.5f;
+ else pos = (coba->data[coba->cur + 1].pos + coba->data[coba->cur].pos) * 0.5f;
}
- if(colorband_element_add(coba, pos)) {
+ if (colorband_element_add(coba, pos)) {
rna_update_cb(C, cb_v, NULL);
ED_undo_push(C, "Add colorband");
}
@@ -1276,9 +1276,9 @@ static void colorband_add_cb(bContext *C, void *cb_v, void *coba_v)
static void colorband_del_cb(bContext *C, void *cb_v, void *coba_v)
{
- ColorBand *coba= coba_v;
+ ColorBand *coba = coba_v;
- if(colorband_element_remove(coba, coba->cur)) {
+ if (colorband_element_remove(coba, coba->cur)) {
ED_undo_push(C, "Delete colorband");
rna_update_cb(C, cb_v, NULL);
}
@@ -1288,19 +1288,19 @@ static void colorband_flip_cb(bContext *C, void *cb_v, void *coba_v)
{
CBData data_tmp[MAXCOLORBAND];
- ColorBand *coba= coba_v;
+ ColorBand *coba = coba_v;
int a;
- for(a=0; a<coba->tot; a++) {
- data_tmp[a]= coba->data[coba->tot - (a + 1)];
+ for (a = 0; a < coba->tot; a++) {
+ data_tmp[a] = coba->data[coba->tot - (a + 1)];
}
- for(a=0; a<coba->tot; a++) {
+ for (a = 0; a < coba->tot; a++) {
data_tmp[a].pos = 1.0f - data_tmp[a].pos;
- coba->data[a]= data_tmp[a];
+ coba->data[a] = data_tmp[a];
}
/* may as well flip the cur*/
- coba->cur= coba->tot - (coba->cur + 1);
+ coba->cur = coba->tot - (coba->cur + 1);
ED_undo_push(C, "Flip colorband");
@@ -1309,11 +1309,11 @@ static void colorband_flip_cb(bContext *C, void *cb_v, void *coba_v)
static void colorband_update_cb(bContext *UNUSED(C), void *bt_v, void *coba_v)
{
- uiBut *bt= bt_v;
- ColorBand *coba= coba_v;
+ uiBut *bt = bt_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;
}
@@ -1323,46 +1323,46 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand
{
uiBut *bt;
uiLayout *row;
- const int line1_y= yoffs + 65 + UI_UNIT_Y + 2; /* 2 for some space between the buttons */
- const int line2_y= yoffs + 65;
+ const int line1_y = yoffs + 65 + UI_UNIT_Y + 2; /* 2 for some space between the buttons */
+ const int line2_y = yoffs + 65;
- if(coba==NULL) return;
+ if (coba == NULL) return;
- bt= uiDefBut(block, BUT, 0, IFACE_("Add"), 0+xoffs,line1_y,40,UI_UNIT_Y, NULL, 0, 0, 0, 0,
- TIP_("Add a new color stop to the colorband"));
+ bt = uiDefBut(block, BUT, 0, IFACE_("Add"), 0 + xoffs, line1_y, 40, UI_UNIT_Y, NULL, 0, 0, 0, 0,
+ TIP_("Add a new color stop to the colorband"));
uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba);
- bt= uiDefBut(block, BUT, 0, IFACE_("Delete"), 45+xoffs,line1_y,45,UI_UNIT_Y, NULL, 0, 0, 0, 0,
- TIP_("Delete the active position"));
+ bt = uiDefBut(block, BUT, 0, IFACE_("Delete"), 45 + xoffs, line1_y, 45, UI_UNIT_Y, NULL, 0, 0, 0, 0,
+ TIP_("Delete the active position"));
uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba);
/* XXX, todo for later - convert to operator - campbell */
- bt= uiDefBut(block, BUT, 0, "F", 95+xoffs,line1_y,20,UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Flip colorband"));
+ bt = uiDefBut(block, BUT, 0, "F", 95 + xoffs, line1_y, 20, UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Flip colorband"));
uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba);
- uiDefButS(block, NUM, 0, "", 120+xoffs,line1_y,80, UI_UNIT_Y, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, TIP_("Choose active color stop"));
+ uiDefButS(block, NUM, 0, "", 120 + xoffs, line1_y, 80, UI_UNIT_Y, &coba->cur, 0.0, (float)(MAX2(0, coba->tot - 1)), 0, 0, TIP_("Choose active color stop"));
- bt= uiDefButS(block, MENU, 0, IFACE_("Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4"),
- 210+xoffs, line1_y, 90, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, TIP_("Set interpolation between color stops"));
+ bt = uiDefButS(block, MENU, 0, IFACE_("Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4"),
+ 210 + xoffs, line1_y, 90, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, TIP_("Set interpolation between color stops"));
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
uiBlockEndAlign(block);
- bt= uiDefBut(block, BUT_COLORBAND, 0, "", xoffs,line2_y,300,UI_UNIT_Y, coba, 0, 0, 0, 0, "");
+ bt = uiDefBut(block, BUT_COLORBAND, 0, "", xoffs, line2_y, 300, UI_UNIT_Y, coba, 0, 0, 0, 0, "");
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
- if(coba->tot) {
- CBData *cbd= coba->data + coba->cur;
+ if (coba->tot) {
+ CBData *cbd = coba->data + coba->cur;
/* better to use rna so we can animate them */
PointerRNA ptr;
RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr);
- row= uiLayoutRow(layout, 0);
+ row = uiLayoutRow(layout, 0);
uiItemR(row, &ptr, "position", 0, "Pos", ICON_NONE);
- bt= block->buttons.last;
+ bt = block->buttons.last;
uiButSetFunc(bt, colorband_update_cb, bt, coba);
uiItemR(row, &ptr, "color", 0, "", ICON_NONE);
@@ -1373,33 +1373,33 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand
static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand *coba, rctf *butr, RNAUpdateCb *cb)
{
uiBut *bt;
- float unit= (butr->xmax-butr->xmin)/14.0f;
- float xs= butr->xmin;
+ float unit = (butr->xmax - butr->xmin) / 14.0f;
+ float xs = butr->xmin;
uiBlockBeginAlign(block);
- bt= uiDefBut(block, BUT, 0, IFACE_("Add"), xs,butr->ymin+UI_UNIT_Y,2.0f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0,
- TIP_("Add a new color stop to the colorband"));
+ bt = uiDefBut(block, BUT, 0, IFACE_("Add"), xs, butr->ymin + UI_UNIT_Y, 2.0f * unit, UI_UNIT_Y, NULL, 0, 0, 0, 0,
+ TIP_("Add a new color stop to the colorband"));
uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba);
- bt= uiDefBut(block, BUT, 0, IFACE_("Delete"), xs+2.0f*unit,butr->ymin+UI_UNIT_Y,1.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0,
- TIP_("Delete the active position"));
+ bt = uiDefBut(block, BUT, 0, IFACE_("Delete"), xs + 2.0f * unit, butr->ymin + UI_UNIT_Y, 1.5f * unit, UI_UNIT_Y, NULL, 0, 0, 0, 0,
+ TIP_("Delete the active position"));
uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba);
- bt= uiDefBut(block, BUT, 0, "F", xs+3.5f*unit,butr->ymin+UI_UNIT_Y,0.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Flip the color ramp"));
+ bt = uiDefBut(block, BUT, 0, "F", xs + 3.5f * unit, butr->ymin + UI_UNIT_Y, 0.5f * unit, UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Flip the color ramp"));
uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba);
uiBlockEndAlign(block);
- if(coba->tot) {
- CBData *cbd= coba->data + coba->cur;
+ if (coba->tot) {
+ CBData *cbd = coba->data + coba->cur;
PointerRNA ptr;
RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr);
uiItemR(layout, &ptr, "color", 0, "", ICON_NONE);
}
- bt= uiDefButS(block, MENU, 0, TIP_("Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4"),
- xs+10.0f*unit, butr->ymin+UI_UNIT_Y, unit*4, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0,
- TIP_("Set interpolation between color stops"));
+ bt = uiDefButS(block, MENU, 0, TIP_("Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4"),
+ xs + 10.0f * unit, butr->ymin + UI_UNIT_Y, unit * 4, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0,
+ TIP_("Set interpolation between color stops"));
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
- bt= uiDefBut(block, BUT_COLORBAND, 0, "", xs,butr->ymin,butr->xmax-butr->xmin,UI_UNIT_Y, coba, 0, 0, 0, 0, "");
+ bt = uiDefBut(block, BUT_COLORBAND, 0, "", xs, butr->ymin, butr->xmax - butr->xmin, UI_UNIT_Y, coba, 0, 0, 0, 0, "");
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
uiBlockEndAlign(block);
@@ -1407,7 +1407,7 @@ static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand
static void colorband_buttons_layout(uiLayout *layout, uiBlock *block, ColorBand *coba, rctf *butr, int small, RNAUpdateCb *cb)
{
- if(small)
+ if (small)
colorband_buttons_small(layout, block, coba, butr, cb);
else
colorband_buttons_large(layout, block, coba, 0, 0, cb);
@@ -1415,27 +1415,27 @@ static void colorband_buttons_layout(uiLayout *layout, uiBlock *block, ColorBand
void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, const char *propname, int expand)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
PointerRNA cptr;
RNAUpdateCb *cb;
uiBlock *block;
rctf rect;
- if(!prop || RNA_property_type(prop) != PROP_POINTER)
+ if (!prop || RNA_property_type(prop) != PROP_POINTER)
return;
- cptr= RNA_property_pointer_get(ptr, prop);
- if(!cptr.data || !RNA_struct_is_a(cptr.type, &RNA_ColorRamp))
+ cptr = RNA_property_pointer_get(ptr, prop);
+ if (!cptr.data || !RNA_struct_is_a(cptr.type, &RNA_ColorRamp))
return;
- cb= MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb");
- cb->ptr= *ptr;
- cb->prop= prop;
+ cb = MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb");
+ cb->ptr = *ptr;
+ cb->prop = prop;
- rect.xmin= 0; rect.xmax= 200;
- rect.ymin= 0; rect.ymax= 190;
+ rect.xmin = 0; rect.xmax = 200;
+ rect.ymin = 0; rect.ymax = 190;
- block= uiLayoutAbsoluteBlock(layout);
+ block = uiLayoutAbsoluteBlock(layout);
colorband_buttons_layout(layout, block, cptr.data, &rect, !expand, cb);
MEM_freeN(cb);
@@ -1445,7 +1445,7 @@ void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, const char *propname
void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
PointerRNA cptr;
RNAUpdateCb *cb;
uiBlock *block;
@@ -1453,28 +1453,28 @@ void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname
Histogram *hist;
rctf rect;
- if(!prop || RNA_property_type(prop) != PROP_POINTER)
+ if (!prop || RNA_property_type(prop) != PROP_POINTER)
return;
- cptr= RNA_property_pointer_get(ptr, prop);
- if(!cptr.data || !RNA_struct_is_a(cptr.type, &RNA_Histogram))
+ cptr = RNA_property_pointer_get(ptr, prop);
+ if (!cptr.data || !RNA_struct_is_a(cptr.type, &RNA_Histogram))
return;
- cb= MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb");
- cb->ptr= *ptr;
- cb->prop= prop;
+ cb = MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb");
+ cb->ptr = *ptr;
+ cb->prop = prop;
- rect.xmin= 0; rect.xmax= 200;
- rect.ymin= 0; rect.ymax= 190;
+ rect.xmin = 0; rect.xmax = 200;
+ rect.ymin = 0; rect.ymax = 190;
- block= uiLayoutAbsoluteBlock(layout);
+ block = uiLayoutAbsoluteBlock(layout);
//colorband_buttons_layout(layout, block, cptr.data, &rect, !expand, cb);
hist = (Histogram *)cptr.data;
- hist->height= (hist->height<=UI_UNIT_Y)?UI_UNIT_Y:hist->height;
+ hist->height = (hist->height <= UI_UNIT_Y) ? UI_UNIT_Y : hist->height;
- bt= uiDefBut(block, HISTOGRAM, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, hist->height, hist, 0, 0, 0, 0, "");
+ bt = uiDefBut(block, HISTOGRAM, 0, "", rect.xmin, rect.ymin, rect.xmax - rect.xmin, hist->height, hist, 0, 0, 0, 0, "");
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
MEM_freeN(cb);
@@ -1484,7 +1484,7 @@ void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname
void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
PointerRNA cptr;
RNAUpdateCb *cb;
uiBlock *block;
@@ -1492,26 +1492,26 @@ void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname)
Scopes *scopes;
rctf rect;
- if(!prop || RNA_property_type(prop) != PROP_POINTER)
+ if (!prop || RNA_property_type(prop) != PROP_POINTER)
return;
- cptr= RNA_property_pointer_get(ptr, prop);
- if(!cptr.data || !RNA_struct_is_a(cptr.type, &RNA_Scopes))
+ cptr = RNA_property_pointer_get(ptr, prop);
+ if (!cptr.data || !RNA_struct_is_a(cptr.type, &RNA_Scopes))
return;
scopes = (Scopes *)cptr.data;
- cb= MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb");
- cb->ptr= *ptr;
- cb->prop= prop;
+ cb = MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb");
+ cb->ptr = *ptr;
+ cb->prop = prop;
- rect.xmin= 0; rect.xmax= 200;
- rect.ymin= 0; rect.ymax= 190;
+ rect.xmin = 0; rect.xmax = 200;
+ rect.ymin = 0; rect.ymax = 190;
- block= uiLayoutAbsoluteBlock(layout);
+ block = uiLayoutAbsoluteBlock(layout);
- scopes->wavefrm_height= (scopes->wavefrm_height<=UI_UNIT_Y)?UI_UNIT_Y:scopes->wavefrm_height;
+ scopes->wavefrm_height = (scopes->wavefrm_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->wavefrm_height;
- bt= uiDefBut(block, WAVEFORM, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, scopes->wavefrm_height, scopes, 0, 0, 0, 0, "");
+ bt = uiDefBut(block, WAVEFORM, 0, "", rect.xmin, rect.ymin, rect.xmax - rect.xmin, scopes->wavefrm_height, scopes, 0, 0, 0, 0, "");
(void)bt; // UNUSED
MEM_freeN(cb);
@@ -1521,7 +1521,7 @@ void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname)
void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propname)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
PointerRNA cptr;
RNAUpdateCb *cb;
uiBlock *block;
@@ -1529,26 +1529,26 @@ void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propna
Scopes *scopes;
rctf rect;
- if(!prop || RNA_property_type(prop) != PROP_POINTER)
+ if (!prop || RNA_property_type(prop) != PROP_POINTER)
return;
- cptr= RNA_property_pointer_get(ptr, prop);
- if(!cptr.data || !RNA_struct_is_a(cptr.type, &RNA_Scopes))
+ cptr = RNA_property_pointer_get(ptr, prop);
+ if (!cptr.data || !RNA_struct_is_a(cptr.type, &RNA_Scopes))
return;
scopes = (Scopes *)cptr.data;
- cb= MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb");
- cb->ptr= *ptr;
- cb->prop= prop;
+ cb = MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb");
+ cb->ptr = *ptr;
+ cb->prop = prop;
- rect.xmin= 0; rect.xmax= 200;
- rect.ymin= 0; rect.ymax= 190;
+ rect.xmin = 0; rect.xmax = 200;
+ rect.ymin = 0; rect.ymax = 190;
- block= uiLayoutAbsoluteBlock(layout);
+ block = uiLayoutAbsoluteBlock(layout);
- scopes->vecscope_height= (scopes->vecscope_height<=UI_UNIT_Y)?UI_UNIT_Y:scopes->vecscope_height;
+ scopes->vecscope_height = (scopes->vecscope_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->vecscope_height;
- bt= uiDefBut(block, VECTORSCOPE, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, scopes->vecscope_height, scopes, 0, 0, 0, 0, "");
+ bt = uiDefBut(block, VECTORSCOPE, 0, "", rect.xmin, rect.ymin, rect.xmax - rect.xmin, scopes->vecscope_height, scopes, 0, 0, 0, 0, "");
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
MEM_freeN(cb);
@@ -1563,13 +1563,13 @@ static void curvemap_buttons_zoom_in(bContext *C, void *cumap_v, void *UNUSED(ar
float d;
/* we allow 20 times zoom */
- if( (cumap->curr.xmax - cumap->curr.xmin) > 0.04f*(cumap->clipr.xmax - cumap->clipr.xmin) ) {
- d= 0.1154f*(cumap->curr.xmax - cumap->curr.xmin);
- cumap->curr.xmin+= d;
- cumap->curr.xmax-= d;
- d= 0.1154f*(cumap->curr.ymax - cumap->curr.ymin);
- cumap->curr.ymin+= d;
- cumap->curr.ymax-= d;
+ if ( (cumap->curr.xmax - cumap->curr.xmin) > 0.04f * (cumap->clipr.xmax - cumap->clipr.xmin) ) {
+ d = 0.1154f * (cumap->curr.xmax - cumap->curr.xmin);
+ cumap->curr.xmin += d;
+ cumap->curr.xmax -= d;
+ d = 0.1154f * (cumap->curr.ymax - cumap->curr.ymin);
+ cumap->curr.ymin += d;
+ cumap->curr.ymax -= d;
}
ED_region_tag_redraw(CTX_wm_region(C));
@@ -1580,33 +1580,33 @@ static void curvemap_buttons_zoom_out(bContext *C, void *cumap_v, void *UNUSED(u
CurveMapping *cumap = cumap_v;
float d, d1;
- /* we allow 20 times zoom, but dont view outside clip */
- if( (cumap->curr.xmax - cumap->curr.xmin) < 20.0f*(cumap->clipr.xmax - cumap->clipr.xmin) ) {
- d= d1= 0.15f*(cumap->curr.xmax - cumap->curr.xmin);
+ /* we allow 20 times zoom, but don't view outside clip */
+ if ( (cumap->curr.xmax - cumap->curr.xmin) < 20.0f * (cumap->clipr.xmax - cumap->clipr.xmin) ) {
+ d = d1 = 0.15f * (cumap->curr.xmax - cumap->curr.xmin);
- if(cumap->flag & CUMA_DO_CLIP)
- if(cumap->curr.xmin-d < cumap->clipr.xmin)
- d1= cumap->curr.xmin - cumap->clipr.xmin;
- cumap->curr.xmin-= d1;
+ if (cumap->flag & CUMA_DO_CLIP)
+ if (cumap->curr.xmin - d < cumap->clipr.xmin)
+ d1 = cumap->curr.xmin - cumap->clipr.xmin;
+ cumap->curr.xmin -= d1;
- d1= d;
- if(cumap->flag & CUMA_DO_CLIP)
- if(cumap->curr.xmax+d > cumap->clipr.xmax)
- d1= -cumap->curr.xmax + cumap->clipr.xmax;
- cumap->curr.xmax+= d1;
+ d1 = d;
+ if (cumap->flag & CUMA_DO_CLIP)
+ if (cumap->curr.xmax + d > cumap->clipr.xmax)
+ d1 = -cumap->curr.xmax + cumap->clipr.xmax;
+ cumap->curr.xmax += d1;
- d= d1= 0.15f*(cumap->curr.ymax - cumap->curr.ymin);
+ d = d1 = 0.15f * (cumap->curr.ymax - cumap->curr.ymin);
- if(cumap->flag & CUMA_DO_CLIP)
- if(cumap->curr.ymin-d < cumap->clipr.ymin)
- d1= cumap->curr.ymin - cumap->clipr.ymin;
- cumap->curr.ymin-= d1;
+ if (cumap->flag & CUMA_DO_CLIP)
+ if (cumap->curr.ymin - d < cumap->clipr.ymin)
+ d1 = cumap->curr.ymin - cumap->clipr.ymin;
+ cumap->curr.ymin -= d1;
- d1= d;
- if(cumap->flag & CUMA_DO_CLIP)
- if(cumap->curr.ymax+d > cumap->clipr.ymax)
- d1= -cumap->curr.ymax + cumap->clipr.ymax;
- cumap->curr.ymax+= d1;
+ d1 = d;
+ if (cumap->flag & CUMA_DO_CLIP)
+ if (cumap->curr.ymax + d > cumap->clipr.ymax)
+ d1 = -cumap->curr.ymax + cumap->clipr.ymax;
+ cumap->curr.ymax += d1;
}
ED_region_tag_redraw(CTX_wm_region(C));
@@ -1623,7 +1623,7 @@ static void curvemap_buttons_delete(bContext *C, void *cb_v, void *cumap_v)
{
CurveMapping *cumap = cumap_v;
- curvemap_remove(cumap->cm+cumap->cur, SELECT);
+ curvemap_remove(cumap->cm + cumap->cur, SELECT);
curvemapping_changed(cumap, 0);
rna_update_cb(C, cb_v, NULL);
@@ -1635,22 +1635,22 @@ static uiBlock *curvemap_clipping_func(bContext *C, struct ARegion *ar, void *cu
CurveMapping *cumap = cumap_v;
uiBlock *block;
uiBut *bt;
- float width= 8*UI_UNIT_X;
+ float width = 8 * UI_UNIT_X;
block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);
/* use this for a fake extra empy space around the buttons */
- uiDefBut(block, LABEL, 0, "", -4, 16, width+8, 6*UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, "", -4, 16, width + 8, 6 * UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
- bt= uiDefButBitI(block, TOG, CUMA_DO_CLIP, 1, "Use Clipping",
- 0,5*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->flag, 0.0, 0.0, 10, 0, "");
+ bt = uiDefButBitI(block, TOG, CUMA_DO_CLIP, 1, "Use Clipping",
+ 0, 5 * UI_UNIT_Y, width, UI_UNIT_Y, &cumap->flag, 0.0, 0.0, 10, 0, "");
uiButSetFunc(bt, curvemap_buttons_setclip, cumap, NULL);
uiBlockBeginAlign(block);
- uiDefButF(block, NUM, 0, IFACE_("Min X "), 0,4*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmin, -100.0, cumap->clipr.xmax, 10, 0, "");
- uiDefButF(block, NUM, 0, IFACE_("Min Y "), 0,3*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymin, -100.0, cumap->clipr.ymax, 10, 0, "");
- uiDefButF(block, NUM, 0, IFACE_("Max X "), 0,2*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmax, cumap->clipr.xmin, 100.0, 10, 0, "");
- uiDefButF(block, NUM, 0, IFACE_("Max Y "), 0,UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymax, cumap->clipr.ymin, 100.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, IFACE_("Min X "), 0, 4 * UI_UNIT_Y, width, UI_UNIT_Y, &cumap->clipr.xmin, -100.0, cumap->clipr.xmax, 10, 0, "");
+ uiDefButF(block, NUM, 0, IFACE_("Min Y "), 0, 3 * UI_UNIT_Y, width, UI_UNIT_Y, &cumap->clipr.ymin, -100.0, cumap->clipr.ymax, 10, 0, "");
+ uiDefButF(block, NUM, 0, IFACE_("Max X "), 0, 2 * UI_UNIT_Y, width, UI_UNIT_Y, &cumap->clipr.xmax, cumap->clipr.xmin, 100.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, IFACE_("Max Y "), 0, UI_UNIT_Y, width, UI_UNIT_Y, &cumap->clipr.ymax, cumap->clipr.ymin, 100.0, 10, 0, "");
uiBlockSetDirection(block, UI_RIGHT);
@@ -1661,17 +1661,17 @@ static uiBlock *curvemap_clipping_func(bContext *C, struct ARegion *ar, void *cu
static void curvemap_tools_dofunc(bContext *C, void *cumap_v, int event)
{
CurveMapping *cumap = cumap_v;
- CurveMap *cuma= cumap->cm+cumap->cur;
+ CurveMap *cuma = cumap->cm + cumap->cur;
- switch(event) {
+ switch (event) {
case 0: /* reset */
- curvemap_reset(cuma, &cumap->clipr, cumap->preset, CURVEMAP_SLOPE_POSITIVE);
+ curvemap_reset(cuma, &cumap->clipr, cumap->preset, CURVEMAP_SLOPE_POSITIVE);
curvemapping_changed(cumap, 0);
break;
case 1:
- cumap->curr= cumap->clipr;
+ cumap->curr = cumap->clipr;
break;
- case 2: /* set vector */
+ case 2: /* set vector */
curvemap_sethandle(cuma, 1);
curvemapping_changed(cumap, 0);
break;
@@ -1694,17 +1694,17 @@ static void curvemap_tools_dofunc(bContext *C, void *cumap_v, int event)
static uiBlock *curvemap_tools_func(bContext *C, struct ARegion *ar, void *cumap_v)
{
uiBlock *block;
- short yco= 0, menuwidth=10*UI_UNIT_X;
+ short yco = 0, menuwidth = 10 * UI_UNIT_X;
- block= uiBeginBlock(C, ar, __func__, UI_EMBOSS);
+ block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);
uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v);
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset View"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Vector Handle"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Auto Handle"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Extend Horizontal"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Extend Extrapolated"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset Curve"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset View"), 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Vector Handle"), 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Auto Handle"), 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Extend Horizontal"), 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 4, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Extend Extrapolated"), 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 5, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset Curve"), 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 50);
@@ -1716,15 +1716,15 @@ static uiBlock *curvemap_tools_func(bContext *C, struct ARegion *ar, void *cumap
static uiBlock *curvemap_brush_tools_func(bContext *C, struct ARegion *ar, void *cumap_v)
{
uiBlock *block;
- short yco= 0, menuwidth=10*UI_UNIT_X;
+ short yco = 0, menuwidth = 10 * UI_UNIT_X;
- block= uiBeginBlock(C, ar, __func__, UI_EMBOSS);
+ block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);
uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v);
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset View"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Vector Handle"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Auto Handle"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset Curve"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset View"), 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Vector Handle"), 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Auto Handle"), 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset Curve"), 0, yco -= UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 50);
@@ -1744,11 +1744,11 @@ static void curvemap_buttons_reset(bContext *C, void *cb_v, void *cumap_v)
int a;
cumap->preset = CURVE_PRESET_LINE;
- for(a=0; a<CM_TOT; a++)
- curvemap_reset(cumap->cm+a, &cumap->clipr, cumap->preset, CURVEMAP_SLOPE_POSITIVE);
+ for (a = 0; a < CM_TOT; a++)
+ curvemap_reset(cumap->cm + a, &cumap->clipr, cumap->preset, CURVEMAP_SLOPE_POSITIVE);
- cumap->black[0]=cumap->black[1]=cumap->black[2]= 0.0f;
- cumap->white[0]=cumap->white[1]=cumap->white[2]= 1.0f;
+ cumap->black[0] = cumap->black[1] = cumap->black[2] = 0.0f;
+ cumap->white[0] = cumap->white[1] = cumap->white[2] = 1.0f;
curvemapping_set_black_white(cumap, NULL, NULL);
curvemapping_changed(cumap, 0);
@@ -1759,106 +1759,106 @@ static void curvemap_buttons_reset(bContext *C, void *cb_v, void *cumap_v)
/* still unsure how this call evolves... we use labeltype for defining what curve-channels to show */
static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labeltype, int levels, int brush, RNAUpdateCb *cb)
{
- CurveMapping *cumap= ptr->data;
+ CurveMapping *cumap = ptr->data;
uiLayout *row, *sub, *split;
uiBlock *block;
uiBut *bt;
- float dx= UI_UNIT_X;
+ float dx = UI_UNIT_X;
int icon, size;
- int bg=-1;
+ int bg = -1;
- block= uiLayoutGetBlock(layout);
+ block = uiLayoutGetBlock(layout);
/* curve chooser */
- row= uiLayoutRow(layout, 0);
+ row = uiLayoutRow(layout, 0);
- if(labeltype=='v') {
+ if (labeltype == 'v') {
/* vector */
- sub= uiLayoutRow(row, 1);
+ sub = uiLayoutRow(row, 1);
uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT);
- if(cumap->cm[0].curve) {
- bt= uiDefButI(block, ROW, 0, "X", 0, 0, dx, dx, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
+ if (cumap->cm[0].curve) {
+ bt = uiDefButI(block, ROW, 0, "X", 0, 0, dx, dx, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
}
- if(cumap->cm[1].curve) {
- bt= uiDefButI(block, ROW, 0, "Y", 0, 0, dx, dx, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
+ if (cumap->cm[1].curve) {
+ bt = uiDefButI(block, ROW, 0, "Y", 0, 0, dx, dx, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
}
- if(cumap->cm[2].curve) {
- bt= uiDefButI(block, ROW, 0, "Z", 0, 0, dx, dx, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
+ if (cumap->cm[2].curve) {
+ bt = uiDefButI(block, ROW, 0, "Z", 0, 0, dx, dx, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
}
}
- else if(labeltype=='c') {
+ else if (labeltype == 'c') {
/* color */
- sub= uiLayoutRow(row, 1);
+ sub = uiLayoutRow(row, 1);
uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT);
- if(cumap->cm[3].curve) {
- bt= uiDefButI(block, ROW, 0, "C", 0, 0, dx, dx, &cumap->cur, 0.0, 3.0, 0.0, 0.0, "");
+ if (cumap->cm[3].curve) {
+ bt = uiDefButI(block, ROW, 0, "C", 0, 0, dx, dx, &cumap->cur, 0.0, 3.0, 0.0, 0.0, "");
uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
}
- if(cumap->cm[0].curve) {
- bt= uiDefButI(block, ROW, 0, "R", 0, 0, dx, dx, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
+ if (cumap->cm[0].curve) {
+ bt = uiDefButI(block, ROW, 0, "R", 0, 0, dx, dx, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
}
- if(cumap->cm[1].curve) {
- bt= uiDefButI(block, ROW, 0, "G", 0, 0, dx, dx, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
+ if (cumap->cm[1].curve) {
+ bt = uiDefButI(block, ROW, 0, "G", 0, 0, dx, dx, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
}
- if(cumap->cm[2].curve) {
- bt= uiDefButI(block, ROW, 0, "B", 0, 0, dx, dx, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
+ if (cumap->cm[2].curve) {
+ bt = uiDefButI(block, ROW, 0, "B", 0, 0, dx, dx, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
}
}
else if (labeltype == 'h') {
/* HSV */
- sub= uiLayoutRow(row, 1);
+ sub = uiLayoutRow(row, 1);
uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT);
- if(cumap->cm[0].curve) {
- bt= uiDefButI(block, ROW, 0, "H", 0, 0, dx, dx, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
+ if (cumap->cm[0].curve) {
+ bt = uiDefButI(block, ROW, 0, "H", 0, 0, dx, dx, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
}
- if(cumap->cm[1].curve) {
- bt= uiDefButI(block, ROW, 0, "S", 0, 0, dx, dx, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
+ if (cumap->cm[1].curve) {
+ bt = uiDefButI(block, ROW, 0, "S", 0, 0, dx, dx, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
}
- if(cumap->cm[2].curve) {
- bt= uiDefButI(block, ROW, 0, "V", 0, 0, dx, dx, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
+ if (cumap->cm[2].curve) {
+ bt = uiDefButI(block, ROW, 0, "V", 0, 0, dx, dx, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
}
}
else
uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_RIGHT);
- if (labeltype=='h')
+ if (labeltype == 'h')
bg = UI_GRAD_H;
/* operation buttons */
- sub= uiLayoutRow(row, 1);
+ sub = uiLayoutRow(row, 1);
uiBlockSetEmboss(block, UI_EMBOSSN);
- bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMIN, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Zoom in"));
+ bt = uiDefIconBut(block, BUT, 0, ICON_ZOOMIN, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Zoom in"));
uiButSetFunc(bt, curvemap_buttons_zoom_in, cumap, NULL);
- bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMOUT, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Zoom out"));
+ bt = uiDefIconBut(block, BUT, 0, ICON_ZOOMOUT, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Zoom out"));
uiButSetFunc(bt, curvemap_buttons_zoom_out, cumap, NULL);
- if(brush)
- bt= uiDefIconBlockBut(block, curvemap_brush_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, TIP_("Tools"));
+ if (brush)
+ bt = uiDefIconBlockBut(block, curvemap_brush_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, TIP_("Tools"));
else
- bt= uiDefIconBlockBut(block, curvemap_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, TIP_("Tools"));
+ bt = uiDefIconBlockBut(block, curvemap_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, TIP_("Tools"));
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
- if(cumap->flag & CUMA_DO_CLIP) icon= ICON_CLIPUV_HLT; else icon= ICON_CLIPUV_DEHLT;
- bt= uiDefIconBlockBut(block, curvemap_clipping_func, cumap, 0, icon, 0, 0, dx, dx, TIP_("Clipping Options"));
+ if (cumap->flag & CUMA_DO_CLIP) icon = ICON_CLIPUV_HLT; else icon = ICON_CLIPUV_DEHLT;
+ bt = uiDefIconBlockBut(block, curvemap_clipping_func, cumap, 0, icon, 0, 0, dx, dx, TIP_("Clipping Options"));
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
- bt= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete points"));
+ bt = uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete points"));
uiButSetNFunc(bt, curvemap_buttons_delete, MEM_dupallocN(cb), cumap);
uiBlockSetEmboss(block, UI_EMBOSS);
@@ -1866,19 +1866,19 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe
uiBlockSetNFunc(block, rna_update_cb, MEM_dupallocN(cb), NULL);
/* curve itself */
- size= uiLayoutGetWidth(layout);
- row= uiLayoutRow(layout, 0);
+ size = uiLayoutGetWidth(layout);
+ row = uiLayoutRow(layout, 0);
uiDefBut(block, BUT_CURVE, 0, "", 0, 0, size, MIN2(size, 200), cumap, 0.0f, 1.0f, bg, 0, "");
/* black/white levels */
- if(levels) {
- split= uiLayoutSplit(layout, 0, 0);
+ if (levels) {
+ split = uiLayoutSplit(layout, 0, 0);
uiItemR(uiLayoutColumn(split, 0), ptr, "black_level", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
uiItemR(uiLayoutColumn(split, 0), ptr, "white_level", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
uiLayoutRow(layout, 0);
- bt=uiDefBut(block, BUT, 0, IFACE_("Reset"), 0, 0, UI_UNIT_X*10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0,
- TIP_("Reset Black/White point and curves"));
+ bt = uiDefBut(block, BUT, 0, IFACE_("Reset"), 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0,
+ TIP_("Reset Black/White point and curves"));
uiButSetNFunc(bt, curvemap_buttons_reset, MEM_dupallocN(cb), cumap);
}
@@ -1888,28 +1888,28 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe
void uiTemplateCurveMapping(uiLayout *layout, PointerRNA *ptr, const char *propname, int type, int levels, int brush)
{
RNAUpdateCb *cb;
- PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
PointerRNA cptr;
- if(!prop) {
+ if (!prop) {
RNA_warning("curve property not found: %s.%s",
RNA_struct_identifier(ptr->type), propname);
return;
}
- if(RNA_property_type(prop) != PROP_POINTER) {
+ if (RNA_property_type(prop) != PROP_POINTER) {
RNA_warning("curve is not a pointer: %s.%s",
RNA_struct_identifier(ptr->type), propname);
return;
}
- cptr= RNA_property_pointer_get(ptr, prop);
- if(!cptr.data || !RNA_struct_is_a(cptr.type, &RNA_CurveMapping))
+ cptr = RNA_property_pointer_get(ptr, prop);
+ if (!cptr.data || !RNA_struct_is_a(cptr.type, &RNA_CurveMapping))
return;
- cb= MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb");
- cb->ptr= *ptr;
- cb->prop= prop;
+ cb = MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb");
+ cb->ptr = *ptr;
+ cb->prop = prop;
curvemap_buttons_layout(layout, &cptr, type, levels, brush, cb);
@@ -1918,12 +1918,12 @@ void uiTemplateCurveMapping(uiLayout *layout, PointerRNA *ptr, const char *propn
/********************* ColorWheel Template ************************/
-#define WHEEL_SIZE 100
+#define WHEEL_SIZE 100
void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, const char *propname, int value_slider, int lock, int lock_luminosity, int cubic)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
- uiBlock *block= uiLayoutGetBlock(layout);
+ PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
+ uiBlock *block = uiLayoutGetBlock(layout);
uiLayout *col, *row;
uiBut *but;
float softmin, softmax, step, precision;
@@ -1936,28 +1936,28 @@ void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, const char *propnam
RNA_property_float_ui_range(ptr, prop, &softmin, &softmax, &step, &precision);
col = uiLayoutColumn(layout, 0);
- row= uiLayoutRow(col, 1);
+ row = uiLayoutRow(col, 1);
- but= uiDefButR_prop(block, HSVCIRCLE, 0, "", 0, 0, WHEEL_SIZE, WHEEL_SIZE, ptr, prop, -1, 0.0, 0.0, 0, 0, "");
+ but = uiDefButR_prop(block, HSVCIRCLE, 0, "", 0, 0, WHEEL_SIZE, WHEEL_SIZE, ptr, prop, -1, 0.0, 0.0, 0, 0, "");
- if(lock) {
+ if (lock) {
but->flag |= UI_BUT_COLOR_LOCK;
}
- if(lock_luminosity) {
- float color[4]; /* incase of alpha */
+ if (lock_luminosity) {
+ 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);
+ but->a2 = len_v3(color);
}
- if(cubic)
+ if (cubic)
but->flag |= UI_BUT_COLOR_CUBIC;
uiItemS(row);
if (value_slider)
- uiDefButR_prop(block, HSVCUBE, 0, "", WHEEL_SIZE+6, 0, 14, WHEEL_SIZE, ptr, prop, -1, softmin, softmax, UI_GRAD_V_ALT, 0, "");
+ uiDefButR_prop(block, HSVCUBE, 0, "", WHEEL_SIZE + 6, 0, 14, WHEEL_SIZE, ptr, prop, -1, softmin, softmax, UI_GRAD_V_ALT, 0, "");
}
/********************* Layer Buttons Template ************************/
@@ -1966,16 +1966,16 @@ static void handle_layer_buttons(bContext *C, void *arg1, void *arg2)
{
uiBut *but = arg1;
int cur = GET_INT_FROM_POINTER(arg2);
- wmWindow *win= CTX_wm_window(C);
- int i, tot, shift= win->eventstate->shift;
+ wmWindow *win = CTX_wm_window(C);
+ int i, tot, shift = win->eventstate->shift;
- if(!shift) {
- tot= RNA_property_array_length(&but->rnapoin, but->rnaprop);
+ if (!shift) {
+ tot = RNA_property_array_length(&but->rnapoin, but->rnaprop);
/* Normally clicking only selects one layer */
RNA_property_boolean_set_index(&but->rnapoin, but->rnaprop, cur, TRUE);
- for(i = 0; i < tot; ++i) {
- if(i != cur)
+ for (i = 0; i < tot; ++i) {
+ if (i != cur)
RNA_property_boolean_set_index(&but->rnapoin, but->rnaprop, i, FALSE);
}
}
@@ -1989,15 +1989,15 @@ static void handle_layer_buttons(bContext *C, void *arg1, void *arg2)
// the array of layer bitflags
void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname,
- PointerRNA *used_ptr, const char *used_propname, int active_layer)
+ PointerRNA *used_ptr, const char *used_propname, int active_layer)
{
uiLayout *uRow, *uCol;
- PropertyRNA *prop, *used_prop= NULL;
+ PropertyRNA *prop, *used_prop = NULL;
int groups, cols, layers;
int group, col, layer, row;
int cols_per_group = 5;
- prop= RNA_struct_find_property(ptr, propname);
+ prop = RNA_struct_find_property(ptr, propname);
if (!prop) {
RNA_warning("layers property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
return;
@@ -2009,47 +2009,47 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname,
* the 'remainder' is added to this, as it will be ok to have first row slightly wider if need be
* - for now, only split into groups if group will have at least 5 items
*/
- layers= RNA_property_array_length(ptr, prop);
- cols= (layers / 2) + (layers % 2);
- groups= ((cols / 2) < cols_per_group) ? (1) : (cols / cols_per_group);
+ layers = RNA_property_array_length(ptr, prop);
+ cols = (layers / 2) + (layers % 2);
+ groups = ((cols / 2) < cols_per_group) ? (1) : (cols / cols_per_group);
- if(used_ptr && used_propname) {
- used_prop= RNA_struct_find_property(used_ptr, used_propname);
+ if (used_ptr && used_propname) {
+ used_prop = RNA_struct_find_property(used_ptr, used_propname);
if (!used_prop) {
RNA_warning("used layers property not found: %s.%s", RNA_struct_identifier(ptr->type), used_propname);
return;
}
- if(RNA_property_array_length(used_ptr, used_prop) < layers)
+ if (RNA_property_array_length(used_ptr, used_prop) < layers)
used_prop = NULL;
}
/* layers are laid out going across rows, with the columns being divided into groups */
- for (group= 0; group < groups; group++) {
- uCol= uiLayoutColumn(layout, 1);
+ for (group = 0; group < groups; group++) {
+ uCol = uiLayoutColumn(layout, 1);
- for (row= 0; row < 2; row++) {
+ for (row = 0; row < 2; row++) {
uiBlock *block;
uiBut *but;
- uRow= uiLayoutRow(uCol, 1);
- block= uiLayoutGetBlock(uRow);
- layer= groups*cols_per_group*row + cols_per_group*group;
+ uRow = uiLayoutRow(uCol, 1);
+ block = uiLayoutGetBlock(uRow);
+ layer = groups * cols_per_group * row + cols_per_group * group;
/* add layers as toggle buts */
- for (col= 0; (col < cols_per_group) && (layer < layers); col++, layer++) {
+ for (col = 0; (col < cols_per_group) && (layer < layers); col++, layer++) {
int icon = 0;
int butlay = 1 << layer;
- if(active_layer & butlay)
+ if (active_layer & butlay)
icon = ICON_LAYER_ACTIVE;
- else if(used_prop && RNA_property_boolean_get_index(used_ptr, used_prop, layer))
+ else if (used_prop && RNA_property_boolean_get_index(used_ptr, used_prop, layer))
icon = ICON_LAYER_USED;
- but= uiDefAutoButR(block, ptr, prop, layer, "", icon, 0, 0, UI_UNIT_X/2, UI_UNIT_Y/2);
+ but = uiDefAutoButR(block, ptr, prop, layer, "", icon, 0, 0, UI_UNIT_X / 2, UI_UNIT_Y / 2);
uiButSetFunc(but, handle_layer_buttons, but, SET_INT_IN_POINTER(layer));
- but->type= TOG;
+ but->type = TOG;
}
}
}
@@ -2060,24 +2060,24 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname,
static int list_item_icon_get(bContext *C, PointerRNA *itemptr, int rnaicon, int big)
{
- ID *id= NULL;
+ ID *id = NULL;
int icon;
- if(!itemptr->data)
+ if (!itemptr->data)
return rnaicon;
/* try ID, material or texture slot */
- if(RNA_struct_is_ID(itemptr->type)) {
- id= itemptr->id.data;
+ if (RNA_struct_is_ID(itemptr->type)) {
+ id = itemptr->id.data;
}
- else if(RNA_struct_is_a(itemptr->type, &RNA_MaterialSlot)) {
- id= RNA_pointer_get(itemptr, "material").data;
+ else if (RNA_struct_is_a(itemptr->type, &RNA_MaterialSlot)) {
+ id = RNA_pointer_get(itemptr, "material").data;
}
- else if(RNA_struct_is_a(itemptr->type, &RNA_TextureSlot)) {
- id= RNA_pointer_get(itemptr, "texture").data;
+ else if (RNA_struct_is_a(itemptr->type, &RNA_TextureSlot)) {
+ id = RNA_pointer_get(itemptr, "texture").data;
}
- else if(RNA_struct_is_a(itemptr->type, &RNA_DynamicPaintSurface)) {
- DynamicPaintSurface *surface= (DynamicPaintSurface*)itemptr->data;
+ else if (RNA_struct_is_a(itemptr->type, &RNA_DynamicPaintSurface)) {
+ DynamicPaintSurface *surface = (DynamicPaintSurface *)itemptr->data;
if (surface->format == MOD_DPAINT_SURFACE_F_PTEX) return ICON_TEXTURE_SHADED;
else if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) return ICON_OUTLINER_DATA_MESH;
@@ -2085,10 +2085,10 @@ static int list_item_icon_get(bContext *C, PointerRNA *itemptr, int rnaicon, int
}
/* get icon from ID */
- if(id) {
- icon= ui_id_icon_get(C, id, big);
+ if (id) {
+ icon = ui_id_icon_get(C, id, big);
- if(icon)
+ if (icon)
return icon;
}
@@ -2097,94 +2097,94 @@ static int list_item_icon_get(bContext *C, PointerRNA *itemptr, int rnaicon, int
static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *itemptr, int i, int rnaicon, PointerRNA *activeptr, PropertyRNA *activeprop, const char *prop_list_id)
{
- uiBlock *block= uiLayoutGetBlock(layout);
+ uiBlock *block = uiLayoutGetBlock(layout);
uiBut *but;
uiLayout *split, *overlap, *sub, *row;
char *namebuf;
const char *name;
int icon;
- overlap= uiLayoutOverlap(layout);
+ overlap = uiLayoutOverlap(layout);
/* list item behind label & other buttons */
- sub= uiLayoutRow(overlap, 0);
+ sub = uiLayoutRow(overlap, 0);
- but= uiDefButR_prop(block, LISTROW, 0, "", 0,0, UI_UNIT_X*10,UI_UNIT_Y, activeptr, activeprop, 0, 0, i, 0, 0, "");
+ but = uiDefButR_prop(block, LISTROW, 0, "", 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, activeptr, activeprop, 0, 0, i, 0, 0, "");
uiButSetFlag(but, UI_BUT_NO_TOOLTIP);
- sub= uiLayoutRow(overlap, 0);
+ sub = uiLayoutRow(overlap, 0);
/* retrieve icon and name */
- icon= list_item_icon_get(C, itemptr, rnaicon, 0);
- if(icon == ICON_NONE || icon == ICON_DOT)
- icon= 0;
+ icon = list_item_icon_get(C, itemptr, rnaicon, 0);
+ if (icon == ICON_NONE || icon == ICON_DOT)
+ icon = 0;
- namebuf= RNA_struct_name_get_alloc(itemptr, NULL, 0, NULL);
- name= (namebuf)? namebuf: "";
+ namebuf = RNA_struct_name_get_alloc(itemptr, NULL, 0, NULL);
+ name = (namebuf) ? namebuf : "";
/* hardcoded types */
- if(itemptr->type == &RNA_MeshTexturePolyLayer || itemptr->type == &RNA_MeshLoopColorLayer) {
+ if (itemptr->type == &RNA_MeshTexturePolyLayer || itemptr->type == &RNA_MeshLoopColorLayer) {
uiItemL(sub, name, icon);
uiBlockSetEmboss(block, UI_EMBOSSN);
uiDefIconButR(block, TOG, 0, ICON_SCENE, 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "active_render", 0, 0, 0, 0, 0, NULL);
uiBlockSetEmboss(block, UI_EMBOSS);
}
- else if(RNA_struct_is_a(itemptr->type, &RNA_MaterialTextureSlot)) {
+ else if (RNA_struct_is_a(itemptr->type, &RNA_MaterialTextureSlot)) {
uiItemL(sub, name, icon);
uiBlockSetEmboss(block, UI_EMBOSS);
uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, ptr, "use_textures", i, 0, 0, 0, 0, NULL);
}
- else if(RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer)) {
+ else if (RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer)) {
uiItemL(sub, name, icon);
uiBlockSetEmboss(block, UI_EMBOSS);
uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "use", 0, 0, 0, 0, 0, NULL);
}
- else if(RNA_struct_is_a(itemptr->type, &RNA_MaterialSlot)) {
+ else if (RNA_struct_is_a(itemptr->type, &RNA_MaterialSlot)) {
/* provision to draw active node name */
Material *ma, *manode;
- Scene *scene= CTX_data_scene(C);
- Object *ob= (Object*)ptr->id.data;
- int index= (Material**)itemptr->data - ob->mat;
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = (Object *)ptr->id.data;
+ int index = (Material **)itemptr->data - ob->mat;
/* default item with material base name */
uiItemL(sub, name, icon);
- ma= give_current_material(ob, index+1);
- if (ma && !scene_use_new_shading_nodes(scene)){
- manode= give_node_material(ma);
- if(manode) {
+ ma = give_current_material(ob, index + 1);
+ if (ma && !scene_use_new_shading_nodes(scene)) {
+ manode = give_node_material(ma);
+ if (manode) {
char str[MAX_ID_NAME + 12];
- BLI_snprintf(str, sizeof(str), "Node %s", manode->id.name+2);
+ BLI_snprintf(str, sizeof(str), "Node %s", manode->id.name + 2);
uiItemL(sub, str, ui_id_icon_get(C, &manode->id, 1));
}
- else if(ma->use_nodes) {
+ else if (ma->use_nodes) {
uiItemL(sub, "Node <none>", ICON_NONE);
}
}
}
- else if(itemptr->type == &RNA_ShapeKey) {
- Object *ob= (Object*)activeptr->data;
- Key *key= (Key*)itemptr->id.data;
+ else if (itemptr->type == &RNA_ShapeKey) {
+ Object *ob = (Object *)activeptr->data;
+ Key *key = (Key *)itemptr->id.data;
- split= uiLayoutSplit(sub, 0.66f, 0);
+ split = uiLayoutSplit(sub, 0.66f, 0);
uiItemL(split, name, icon);
uiBlockSetEmboss(block, UI_EMBOSSN);
- row= uiLayoutRow(split, 1);
- if(i == 0 || (key->type != KEY_RELATIVE)) uiItemL(row, "", ICON_NONE);
+ row = uiLayoutRow(split, 1);
+ if (i == 0 || (key->type != KEY_RELATIVE)) uiItemL(row, "", ICON_NONE);
else uiItemR(row, itemptr, "value", 0, "", ICON_NONE);
uiItemR(row, itemptr, "mute", 0, "", 0);
- if( (key->flag & KEYBLOCK_MUTE) ||
- (ob->mode == OB_MODE_EDIT && !((ob->shapeflag & OB_SHAPE_EDIT_MODE) && ob->type == OB_MESH)) )
+ if ( (key->flag & KEYBLOCK_MUTE) ||
+ (ob->mode == OB_MODE_EDIT && !((ob->shapeflag & OB_SHAPE_EDIT_MODE) && ob->type == OB_MESH)) )
{
uiLayoutSetActive(row, 0);
}
uiBlockSetEmboss(block, UI_EMBOSS);
}
- else if(itemptr->type == &RNA_VertexGroup) {
- bDeformGroup *dg= (bDeformGroup *)itemptr->data;
+ else if (itemptr->type == &RNA_VertexGroup) {
+ bDeformGroup *dg = (bDeformGroup *)itemptr->data;
uiItemL(sub, name, icon);
/* RNA does not allow nice lock icons, use lower level buttons */
#if 0
@@ -2195,8 +2195,8 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
uiBlockSetEmboss(block, UI_EMBOSS);
#endif
}
- else if(itemptr->type == &RNA_KeyingSetPath) {
- KS_Path *ksp = (KS_Path*)itemptr->data;
+ else if (itemptr->type == &RNA_KeyingSetPath) {
+ KS_Path *ksp = (KS_Path *)itemptr->data;
/* icon needs to be the type of ID which is currently active */
RNA_enum_icon_from_value(id_type_items, ksp->idtype, &icon);
@@ -2204,29 +2204,29 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
/* nothing else special to do... */
uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */
}
- else if(itemptr->type == &RNA_DynamicPaintSurface) {
+ else if (itemptr->type == &RNA_DynamicPaintSurface) {
char name_final[96];
const char *enum_name;
PropertyRNA *prop = RNA_struct_find_property(itemptr, "surface_type");
- DynamicPaintSurface *surface= (DynamicPaintSurface*)itemptr->data;
+ DynamicPaintSurface *surface = (DynamicPaintSurface *)itemptr->data;
RNA_property_enum_name(C, itemptr, prop, RNA_property_enum_get(itemptr, prop), &enum_name);
- BLI_snprintf(name_final, sizeof(name_final), "%s (%s)",name,enum_name);
+ BLI_snprintf(name_final, sizeof(name_final), "%s (%s)", name, enum_name);
uiItemL(sub, name_final, icon);
if (dynamicPaint_surfaceHasColorPreview(surface)) {
uiBlockSetEmboss(block, UI_EMBOSSN);
uiDefIconButR(block, OPTION, 0, (surface->flags & MOD_DPAINT_PREVIEW) ? ICON_RESTRICT_VIEW_OFF : ICON_RESTRICT_VIEW_ON,
- 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "show_preview", 0, 0, 0, 0, 0, NULL);
+ 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "show_preview", 0, 0, 0, 0, 0, NULL);
uiBlockSetEmboss(block, UI_EMBOSS);
}
uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "is_active", i, 0, 0, 0, 0, NULL);
}
- else if(itemptr->type == &RNA_MovieTrackingObject) {
- MovieTrackingObject *tracking_object= (MovieTrackingObject*)itemptr->data;
+ else if (itemptr->type == &RNA_MovieTrackingObject) {
+ MovieTrackingObject *tracking_object = (MovieTrackingObject *)itemptr->data;
- split= uiLayoutSplit(sub, 0.75f, 0);
- if(tracking_object->flag&TRACKING_OBJECT_CAMERA) {
+ split = uiLayoutSplit(sub, 0.75f, 0);
+ if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
uiItemL(split, name, ICON_CAMERA_DATA);
}
else {
@@ -2247,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) {
@@ -2260,22 +2260,22 @@ 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… */
- PropertyRNA *prop_list= RNA_struct_find_property(itemptr, prop_list_id);
+ /* 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) {
+ if (prop_list && RNA_property_type(prop_list) == PROP_STRING) {
int prop_names_len;
char *prop_names = RNA_property_string_get_alloc(itemptr, prop_list, NULL, 0, &prop_names_len);
- char *prop_names_end= prop_names + prop_names_len;
- char *id= prop_names;
+ char *prop_names_end = prop_names + prop_names_len;
+ char *id = prop_names;
char *id_next;
while (id < prop_names_end) {
- if ((id_next= strchr(id, ':'))) *id_next++= '\0';
- else id_next= prop_names_end;
+ if ((id_next = strchr(id, ':'))) *id_next++ = '\0';
+ else id_next = prop_names_end;
uiItemR(row, itemptr, id, 0, NULL, 0);
- id= id_next;
+ id = id_next;
}
MEM_freeN(prop_names);
}
@@ -2283,7 +2283,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
}
else
- uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */
+ uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */
/* free name */
if (namebuf) {
@@ -2294,7 +2294,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, PointerRNA *activeptr, const char *activepropname, const char *prop_list, int rows, int maxrows, int listtype)
{
//Scene *scene= CTX_data_scene(C);
- PropertyRNA *prop= NULL, *activeprop;
+ PropertyRNA *prop = NULL, *activeprop;
PropertyType type, activetype;
StructRNA *ptype;
uiLayout *box, *row, *col;
@@ -2303,71 +2303,71 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
Panel *pa;
const char *name;
char numstr[32];
- int rnaicon=0, icon=0, i= 0, activei= 0, len= 0, items, found, min, max;
+ int rnaicon = 0, icon = 0, i = 0, activei = 0, len = 0, items, found, min, max;
/* validate arguments */
- block= uiLayoutGetBlock(layout);
- pa= block->panel;
+ block = uiLayoutGetBlock(layout);
+ pa = block->panel;
- if(!pa) {
+ if (!pa) {
RNA_warning("Only works inside a panel");
return;
}
- if(!activeptr->data)
+ if (!activeptr->data)
return;
- if(ptr->data) {
- prop= RNA_struct_find_property(ptr, propname);
- if(!prop) {
+ if (ptr->data) {
+ prop = RNA_struct_find_property(ptr, propname);
+ if (!prop) {
RNA_warning("Property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
return;
}
}
- activeprop= RNA_struct_find_property(activeptr, activepropname);
- if(!activeprop) {
+ activeprop = RNA_struct_find_property(activeptr, activepropname);
+ if (!activeprop) {
RNA_warning("Property not found: %s.%s", RNA_struct_identifier(ptr->type), activepropname);
return;
}
- if(prop) {
- type= RNA_property_type(prop);
- if(type != PROP_COLLECTION) {
+ if (prop) {
+ type = RNA_property_type(prop);
+ if (type != PROP_COLLECTION) {
RNA_warning("uiExpected collection property");
return;
}
}
- activetype= RNA_property_type(activeprop);
- if(activetype != PROP_INT) {
+ activetype = RNA_property_type(activeprop);
+ if (activetype != PROP_INT) {
RNA_warning("Expected integer property");
return;
}
/* get icon */
- if(ptr->data && prop) {
- ptype= RNA_property_pointer_type(ptr, prop);
- rnaicon= RNA_struct_ui_icon(ptype);
+ if (ptr->data && prop) {
+ ptype = RNA_property_pointer_type(ptr, prop);
+ rnaicon = RNA_struct_ui_icon(ptype);
}
/* get active data */
- activei= RNA_property_int_get(activeptr, activeprop);
+ activei = RNA_property_int_get(activeptr, activeprop);
- if(listtype == 'i') {
- box= uiLayoutListBox(layout, ptr, prop, activeptr, activeprop);
- col= uiLayoutColumn(box, 1);
- row= uiLayoutRow(col, 0);
+ if (listtype == 'i') {
+ box = uiLayoutListBox(layout, ptr, prop, activeptr, activeprop);
+ col = uiLayoutColumn(box, 1);
+ row = uiLayoutRow(col, 0);
- if(ptr->data && prop) {
+ if (ptr->data && prop) {
/* create list items */
RNA_PROP_BEGIN(ptr, itemptr, prop) {
/* create button */
- if(!(i % 9))
- row= uiLayoutRow(col, 0);
+ if (!(i % 9))
+ row = uiLayoutRow(col, 0);
- icon= list_item_icon_get(C, &itemptr, rnaicon, 1);
- but= uiDefIconButR_prop(block, LISTROW, 0, icon, 0,0,UI_UNIT_X*10,UI_UNIT_Y, activeptr, activeprop, 0, 0, i, 0, 0, "");
+ icon = list_item_icon_get(C, &itemptr, rnaicon, 1);
+ but = uiDefIconButR_prop(block, LISTROW, 0, icon, 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, activeptr, activeprop, 0, 0, i, 0, 0, "");
uiButSetFlag(but, UI_BUT_NO_TOOLTIP);
@@ -2376,21 +2376,21 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
RNA_PROP_END;
}
}
- else if(listtype == 'c') {
+ else if (listtype == 'c') {
/* compact layout */
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
- if(ptr->data && prop) {
+ if (ptr->data && prop) {
/* create list items */
RNA_PROP_BEGIN(ptr, itemptr, prop) {
- found= (activei == i);
+ found = (activei == i);
- if(found) {
+ if (found) {
/* create button */
- name= RNA_struct_name_get_alloc(&itemptr, NULL, 0, NULL);
- icon= list_item_icon_get(C, &itemptr, rnaicon, 0);
- uiItemL(row, (name)? name: "", icon);
+ name = RNA_struct_name_get_alloc(&itemptr, NULL, 0, NULL);
+ icon = list_item_icon_get(C, &itemptr, rnaicon, 0);
+ uiItemL(row, (name) ? name : "", icon);
if (name) {
MEM_freeN((void *)name);
@@ -2403,50 +2403,50 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
}
/* if not found, add in dummy button */
- if(i == 0)
+ if (i == 0)
uiItemL(row, "", ICON_NONE);
/* next/prev button */
BLI_snprintf(numstr, sizeof(numstr), "%d :", i);
- but= uiDefIconTextButR_prop(block, NUM, 0, 0, numstr, 0,0,UI_UNIT_X*5,UI_UNIT_Y, activeptr, activeprop, 0, 0, 0, 0, 0, "");
- if(i == 0)
+ but = uiDefIconTextButR_prop(block, NUM, 0, 0, numstr, 0, 0, UI_UNIT_X * 5, UI_UNIT_Y, activeptr, activeprop, 0, 0, 0, 0, 0, "");
+ if (i == 0)
uiButSetFlag(but, UI_BUT_DISABLED);
}
else {
/* default rows */
- if(rows == 0)
- rows= 5;
+ if (rows == 0)
+ rows = 5;
if (maxrows == 0)
maxrows = 5;
- if(pa->list_grip_size != 0)
- rows= pa->list_grip_size;
+ if (pa->list_grip_size != 0)
+ rows = pa->list_grip_size;
/* layout */
- box= uiLayoutListBox(layout, ptr, prop, activeptr, activeprop);
- row= uiLayoutRow(box, 0);
+ box = uiLayoutListBox(layout, ptr, prop, activeptr, activeprop);
+ row = uiLayoutRow(box, 0);
col = uiLayoutColumn(row, 1);
/* init numbers */
RNA_property_int_range(activeptr, activeprop, &min, &max);
- if(prop)
- len= RNA_property_collection_length(ptr, prop);
- items= CLAMPIS(len, rows, MAX2(rows, maxrows));
+ if (prop)
+ len = RNA_property_collection_length(ptr, prop);
+ items = CLAMPIS(len, rows, MAX2(rows, maxrows));
/* if list length changes and active is out of view, scroll to it */
- if(pa->list_last_len != len)
- if((activei < pa->list_scroll || activei >= pa->list_scroll+items))
- pa->list_scroll= activei;
+ if (pa->list_last_len != len)
+ if ((activei < pa->list_scroll || activei >= pa->list_scroll + items))
+ pa->list_scroll = activei;
- pa->list_scroll= MIN2(pa->list_scroll, len-items);
- pa->list_scroll= MAX2(pa->list_scroll, 0);
- pa->list_size= items;
- pa->list_last_len= len;
+ pa->list_scroll = MIN2(pa->list_scroll, len - items);
+ pa->list_scroll = MAX2(pa->list_scroll, 0);
+ pa->list_size = items;
+ pa->list_last_len = len;
- if(ptr->data && prop) {
+ if (ptr->data && prop) {
/* create list items */
RNA_PROP_BEGIN(ptr, itemptr, prop) {
- if(i >= pa->list_scroll && i<pa->list_scroll+items)
+ if (i >= pa->list_scroll && i < pa->list_scroll + items)
list_item_row(C, col, ptr, &itemptr, i, rnaicon, activeptr, activeprop, prop_list);
i++;
@@ -2455,16 +2455,16 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
}
/* add dummy buttons to fill space */
- while(i < pa->list_scroll+items) {
- if(i >= pa->list_scroll)
+ while (i < pa->list_scroll + items) {
+ if (i >= pa->list_scroll)
uiItemL(col, "", ICON_NONE);
i++;
}
/* add scrollbar */
- if(len > items) {
- col= uiLayoutColumn(row, 0);
- uiDefButI(block, SCROLL, 0, "", 0,0,UI_UNIT_X*0.75,UI_UNIT_Y*items, &pa->list_scroll, 0, len-items, items, 0, "");
+ if (len > items) {
+ col = uiLayoutColumn(row, 0);
+ uiDefButI(block, SCROLL, 0, "", 0, 0, UI_UNIT_X * 0.75, UI_UNIT_Y * items, &pa->list_scroll, 0, len - items, items, 0, "");
}
}
}
@@ -2473,37 +2473,37 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
static void operator_call_cb(bContext *C, void *UNUSED(arg1), void *arg2)
{
- wmOperatorType *ot= arg2;
+ wmOperatorType *ot = arg2;
- if(ot)
+ if (ot)
WM_operator_name_call(C, ot->idname, WM_OP_INVOKE_DEFAULT, NULL);
}
static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items)
{
- GHashIterator *iter= WM_operatortype_iter();
+ GHashIterator *iter = WM_operatortype_iter();
- for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
- wmOperatorType *ot= BLI_ghashIterator_getValue(iter);
+ for (; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+ wmOperatorType *ot = BLI_ghashIterator_getValue(iter);
- if(BLI_strcasestr(ot->name, str)) {
- if(WM_operator_poll((bContext*)C, ot)) {
+ if (BLI_strcasestr(ot->name, str)) {
+ if (WM_operator_poll((bContext *)C, ot)) {
char name[256];
- int len= strlen(ot->name);
+ int len = strlen(ot->name);
/* display name for menu, can hold hotkey */
BLI_strncpy(name, ot->name, sizeof(name));
/* check for hotkey */
- if(len < sizeof(name)-6) {
+ if (len < sizeof(name) - 6) {
if (WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, TRUE,
- &name[len+1], sizeof(name)-len-1))
+ &name[len + 1], sizeof(name) - len - 1))
{
- name[len]= '|';
+ name[len] = '|';
}
}
- if(0==uiSearchItemAdd(items, name, ot, 0))
+ if (0 == uiSearchItemAdd(items, name, ot, 0))
break;
}
}
@@ -2515,29 +2515,29 @@ void uiTemplateOperatorSearch(uiLayout *layout)
{
uiBlock *block;
uiBut *but;
- static char search[256]= "";
+ static char search[256] = "";
- block= uiLayoutGetBlock(layout);
+ block = uiLayoutGetBlock(layout);
uiBlockSetCurLayout(block, layout);
- but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 0, 0, UI_UNIT_X*6, UI_UNIT_Y, 0, 0, "");
+ but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 0, 0, UI_UNIT_X * 6, UI_UNIT_Y, 0, 0, "");
uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL);
}
/************************* Running Jobs Template **************************/
-#define B_STOPRENDER 1
-#define B_STOPCAST 2
-#define B_STOPANIM 3
-#define B_STOPCOMPO 4
-#define B_STOPSEQ 5
-#define B_STOPCLIP 6
+#define B_STOPRENDER 1
+#define B_STOPCAST 2
+#define B_STOPANIM 3
+#define B_STOPCOMPO 4
+#define B_STOPSEQ 5
+#define B_STOPCLIP 6
static void do_running_jobs(bContext *C, void *UNUSED(arg), int event)
{
- switch(event) {
+ switch (event) {
case B_STOPRENDER:
- G.afbreek= 1;
+ G.afbreek = 1;
break;
case B_STOPCAST:
WM_jobs_stop(CTX_wm_manager(C), CTX_wm_screen(C), NULL);
@@ -2559,59 +2559,62 @@ static void do_running_jobs(bContext *C, void *UNUSED(arg), int event)
void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
{
- bScreen *screen= CTX_wm_screen(C);
- wmWindowManager *wm= CTX_wm_manager(C);
- ScrArea *sa= CTX_wm_area(C);
+ bScreen *screen = CTX_wm_screen(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
+ ScrArea *sa = CTX_wm_area(C);
uiBlock *block;
- void *owner= NULL;
+ void *owner = NULL;
int handle_event;
- block= uiLayoutGetBlock(layout);
+ block = uiLayoutGetBlock(layout);
uiBlockSetCurLayout(block, layout);
uiBlockSetHandleFunc(block, do_running_jobs, NULL);
- if(sa->spacetype==SPACE_NODE) {
- if(WM_jobs_test(wm, sa))
- owner = sa;
- handle_event= B_STOPCOMPO;
- } else if (sa->spacetype==SPACE_SEQ) {
- if(WM_jobs_test(wm, sa))
+ if (sa->spacetype == SPACE_NODE) {
+ if (WM_jobs_test(wm, sa))
+ owner = sa;
+ handle_event = B_STOPCOMPO;
+ }
+ else if (sa->spacetype == SPACE_SEQ) {
+ if (WM_jobs_test(wm, sa))
owner = sa;
handle_event = B_STOPSEQ;
- } else if(sa->spacetype==SPACE_CLIP) {
- if(WM_jobs_test(wm, sa))
- owner = sa;
- handle_event= B_STOPCLIP;
- } else {
+ }
+ else if (sa->spacetype == SPACE_CLIP) {
+ if (WM_jobs_test(wm, sa))
+ owner = sa;
+ handle_event = B_STOPCLIP;
+ }
+ else {
Scene *scene;
/* another scene can be rendering too, for example via compositor */
- for(scene= CTX_data_main(C)->scene.first; scene; scene= scene->id.next)
- if(WM_jobs_test(wm, scene))
+ for (scene = CTX_data_main(C)->scene.first; scene; scene = scene->id.next)
+ if (WM_jobs_test(wm, scene))
break;
owner = scene;
- handle_event= B_STOPRENDER;
+ handle_event = B_STOPRENDER;
}
- if(owner) {
+ if (owner) {
uiLayout *ui_abs;
- ui_abs= uiLayoutAbsolute(layout, 0);
+ ui_abs = uiLayoutAbsolute(layout, 0);
(void)ui_abs; // UNUSED
uiDefIconBut(block, BUT, handle_event, ICON_PANEL_CLOSE,
- 0, UI_UNIT_Y*0.1, UI_UNIT_X*0.8, UI_UNIT_Y*0.8, NULL, 0.0f, 0.0f, 0, 0, TIP_("Stop this job"));
+ 0, UI_UNIT_Y * 0.1, UI_UNIT_X * 0.8, UI_UNIT_Y * 0.8, NULL, 0.0f, 0.0f, 0, 0, TIP_("Stop this job"));
uiDefBut(block, PROGRESSBAR, 0, WM_jobs_name(wm, owner),
- UI_UNIT_X, 0, 100, UI_UNIT_Y, NULL, 0.0f, 0.0f, WM_jobs_progress(wm, owner), 0, TIP_("Progress"));
+ UI_UNIT_X, 0, 100, UI_UNIT_Y, NULL, 0.0f, 0.0f, WM_jobs_progress(wm, owner), 0, TIP_("Progress"));
uiLayoutRow(layout, 0);
}
- if(WM_jobs_test(wm, screen))
- uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_CANCEL, IFACE_("Capture"), 0,0,85,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0,
- TIP_("Stop screencast"));
- if(screen->animtimer)
- uiDefIconTextBut(block, BUT, B_STOPANIM, ICON_CANCEL, TIP_("Anim Player"), 0,0,100,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0,
- TIP_("Stop animation playback"));
+ if (WM_jobs_test(wm, screen))
+ uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_CANCEL, IFACE_("Capture"), 0, 0, 85, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0,
+ TIP_("Stop screencast"));
+ if (screen->animtimer)
+ uiDefIconTextBut(block, BUT, B_STOPANIM, ICON_CANCEL, TIP_("Anim Player"), 0, 0, 100, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0,
+ TIP_("Stop animation playback"));
}
/************************* Reports for Last Operator Template **************************/
@@ -2619,50 +2622,50 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
{
ReportList *reports = CTX_wm_reports(C);
- Report *report= BKE_reports_last_displayable(reports);
+ Report *report = BKE_reports_last_displayable(reports);
ReportTimerInfo *rti;
uiLayout *ui_abs;
uiBlock *block;
uiBut *but;
- uiStyle *style= UI_GetStyle();
+ uiStyle *style = UI_GetStyle();
int width;
- int icon=0;
+ int icon = 0;
/* if the report display has timed out, don't show */
if (!reports->reporttimer) return;
- rti= (ReportTimerInfo *)reports->reporttimer->customdata;
+ rti = (ReportTimerInfo *)reports->reporttimer->customdata;
- if (!rti || rti->widthfac==0.0f || !report) return;
+ if (!rti || rti->widthfac == 0.0f || !report) return;
- ui_abs= uiLayoutAbsolute(layout, 0);
- block= uiLayoutGetBlock(ui_abs);
+ ui_abs = uiLayoutAbsolute(layout, 0);
+ block = uiLayoutGetBlock(ui_abs);
width = BLF_width(style->widget.uifont_id, report->message);
- width = MIN2(rti->widthfac*width, width);
+ width = MIN2(rti->widthfac * width, width);
width = MAX2(width, 10);
/* make a box around the report to make it stand out */
uiBlockBeginAlign(block);
- but= uiDefBut(block, ROUNDBOX, 0, "", 0, 0, UI_UNIT_X+10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
+ but = uiDefBut(block, ROUNDBOX, 0, "", 0, 0, UI_UNIT_X + 10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
/* set the report's bg color in but->col - ROUNDBOX feature */
rgb_float_to_uchar(but->col, rti->col);
- but->col[3]= 255;
+ but->col[3] = 255;
- but= uiDefBut(block, ROUNDBOX, 0, "", UI_UNIT_X+10, 0, UI_UNIT_X+width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
- but->col[0]= but->col[1]= but->col[2]= FTOCHAR(rti->greyscale);
- but->col[3]= 255;
+ but = uiDefBut(block, ROUNDBOX, 0, "", UI_UNIT_X + 10, 0, UI_UNIT_X + width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
+ but->col[0] = but->col[1] = but->col[2] = FTOCHAR(rti->greyscale);
+ but->col[3] = 255;
uiBlockEndAlign(block);
/* icon and report message on top */
- if(report->type & RPT_ERROR_ALL)
+ if (report->type & RPT_ERROR_ALL)
icon = ICON_ERROR;
- else if(report->type & RPT_WARNING_ALL)
+ else if (report->type & RPT_WARNING_ALL)
icon = ICON_ERROR;
- else if(report->type & RPT_INFO_ALL)
+ else if (report->type & RPT_INFO_ALL)
icon = ICON_INFO;
/* XXX: temporary operator to dump all reports to a text block, but only if more than 1 report
@@ -2677,14 +2680,14 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
uiBlockSetEmboss(block, UI_EMBOSS);
- uiDefBut(block, LABEL, 0, report->message, UI_UNIT_X+10, 0, UI_UNIT_X+width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
+ uiDefBut(block, LABEL, 0, report->message, UI_UNIT_X + 10, 0, UI_UNIT_X + width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
}
/********************************* Keymap *************************************/
static void keymap_item_modified(bContext *UNUSED(C), void *kmi_p, void *UNUSED(unused))
{
- wmKeyMapItem *kmi= (wmKeyMapItem*)kmi_p;
+ wmKeyMapItem *kmi = (wmKeyMapItem *)kmi_p;
WM_keyconfig_update_tag(NULL, kmi);
}
@@ -2694,23 +2697,23 @@ static void template_keymap_item_properties(uiLayout *layout, const char *title,
uiItemS(layout);
- if(title)
+ if (title)
uiItemL(layout, title, ICON_NONE);
- flow= uiLayoutColumnFlow(layout, 2, 0);
+ flow = uiLayoutColumnFlow(layout, 2, 0);
RNA_STRUCT_BEGIN(ptr, prop) {
- int flag= RNA_property_flag(prop);
+ int flag = RNA_property_flag(prop);
- if(flag & PROP_HIDDEN)
+ if (flag & PROP_HIDDEN)
continue;
/* recurse for nested properties */
- if(RNA_property_type(prop) == PROP_POINTER) {
- PointerRNA propptr= RNA_property_pointer_get(ptr, prop);
- const char *name= RNA_property_ui_name(prop);
+ if (RNA_property_type(prop) == PROP_POINTER) {
+ PointerRNA propptr = RNA_property_pointer_get(ptr, prop);
+ const char *name = RNA_property_ui_name(prop);
- if(propptr.data && RNA_struct_is_a(propptr.type, &RNA_OperatorProperties)) {
+ if (propptr.data && RNA_struct_is_a(propptr.type, &RNA_OperatorProperties)) {
template_keymap_item_properties(layout, name, &propptr);
continue;
}
@@ -2724,16 +2727,16 @@ static void template_keymap_item_properties(uiLayout *layout, const char *title,
void uiTemplateKeymapItemProperties(uiLayout *layout, PointerRNA *ptr)
{
- PointerRNA propptr= RNA_pointer_get(ptr, "properties");
+ PointerRNA propptr = RNA_pointer_get(ptr, "properties");
- if(propptr.data) {
- uiBut *but= uiLayoutGetBlock(layout)->buttons.last;
+ if (propptr.data) {
+ uiBut *but = uiLayoutGetBlock(layout)->buttons.last;
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 */
- for(; but; but=but->next)
+ * 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..2f1075bde19 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -53,77 +53,77 @@
uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int index, const char *name, int icon, int x1, int y1, int x2, int y2)
{
- uiBut *but=NULL;
+ uiBut *but = NULL;
- switch(RNA_property_type(prop)) {
+ switch (RNA_property_type(prop)) {
case PROP_BOOLEAN:
{
- int arraylen= RNA_property_array_length(ptr, prop);
+ int arraylen = RNA_property_array_length(ptr, prop);
- if(arraylen && index == -1)
+ if (arraylen && index == -1)
return NULL;
- if(icon && name && name[0] == '\0')
- but= uiDefIconButR_prop(block, ICONTOG, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
- else if(icon)
- but= uiDefIconTextButR_prop(block, ICONTOG, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+ if (icon && name && name[0] == '\0')
+ but = uiDefIconButR_prop(block, ICONTOG, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+ else if (icon)
+ but = uiDefIconTextButR_prop(block, ICONTOG, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
else
- but= uiDefButR_prop(block, OPTION, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+ but = uiDefButR_prop(block, OPTION, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
break;
}
case PROP_INT:
case PROP_FLOAT:
{
- int arraylen= RNA_property_array_length(ptr, prop);
+ int arraylen = RNA_property_array_length(ptr, prop);
- if(arraylen && index == -1) {
- if(ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA))
- but= uiDefButR_prop(block, COL, 0, name, x1, y1, x2, y2, ptr, prop, 0, 0, 0, -1, -1, NULL);
+ if (arraylen && index == -1) {
+ if (ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA))
+ but = uiDefButR_prop(block, COL, 0, name, x1, y1, x2, y2, ptr, prop, 0, 0, 0, -1, -1, NULL);
}
- else if(RNA_property_subtype(prop) == PROP_PERCENTAGE || RNA_property_subtype(prop) == PROP_FACTOR)
- but= uiDefButR_prop(block, NUMSLI, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+ else if (RNA_property_subtype(prop) == PROP_PERCENTAGE || RNA_property_subtype(prop) == PROP_FACTOR)
+ but = uiDefButR_prop(block, NUMSLI, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
else
- but= uiDefButR_prop(block, NUM, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+ but = uiDefButR_prop(block, NUM, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
break;
}
case PROP_ENUM:
- if(icon && name && name[0] == '\0')
- but= uiDefIconButR_prop(block, MENU, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
- else if(icon)
- but= uiDefIconTextButR_prop(block, MENU, 0, icon, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+ if (icon && name && name[0] == '\0')
+ but = uiDefIconButR_prop(block, MENU, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+ else if (icon)
+ but = uiDefIconTextButR_prop(block, MENU, 0, icon, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
else
- but= uiDefButR_prop(block, MENU, 0, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+ but = uiDefButR_prop(block, MENU, 0, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
break;
case PROP_STRING:
- if(icon && name && name[0] == '\0')
- but= uiDefIconButR_prop(block, TEX, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
- else if(icon)
- but= uiDefIconTextButR_prop(block, TEX, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+ if (icon && name && name[0] == '\0')
+ but = uiDefIconButR_prop(block, TEX, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+ else if (icon)
+ but = uiDefIconTextButR_prop(block, TEX, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
else
- but= uiDefButR_prop(block, TEX, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+ but = uiDefButR_prop(block, TEX, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
break;
case PROP_POINTER: {
PointerRNA pptr;
- pptr= RNA_property_pointer_get(ptr, prop);
- if(!pptr.type)
- pptr.type= RNA_property_pointer_type(ptr, prop);
- icon= RNA_struct_ui_icon(pptr.type);
- if(icon == ICON_DOT)
- icon= 0;
+ pptr = RNA_property_pointer_get(ptr, prop);
+ if (!pptr.type)
+ pptr.type = RNA_property_pointer_type(ptr, prop);
+ icon = RNA_struct_ui_icon(pptr.type);
+ if (icon == ICON_DOT)
+ icon = 0;
- but= uiDefIconTextButR_prop(block, IDPOIN, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+ but = uiDefIconTextButR_prop(block, IDPOIN, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
break;
}
case PROP_COLLECTION: {
char text[256];
BLI_snprintf(text, sizeof(text), IFACE_("%d items"), RNA_property_collection_length(ptr, prop));
- but= uiDefBut(block, LABEL, 0, text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, NULL);
+ but = uiDefBut(block, LABEL, 0, text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, NULL);
uiButSetFlag(but, UI_BUT_DISABLED);
break;
}
default:
- but= NULL;
+ but = NULL;
break;
}
@@ -135,47 +135,47 @@ int uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr, int (*check_prop)(Pointe
uiLayout *split, *col;
int flag;
const char *name;
- int tot= 0;
+ int tot = 0;
assert(ELEM3(label_align, '\0', 'H', 'V'));
RNA_STRUCT_BEGIN(ptr, prop) {
- flag= RNA_property_flag(prop);
- if(flag & PROP_HIDDEN || (check_prop && check_prop(ptr, prop)==FALSE))
+ flag = RNA_property_flag(prop);
+ if (flag & PROP_HIDDEN || (check_prop && check_prop(ptr, prop) == FALSE))
continue;
- if(label_align != '\0') {
+ if (label_align != '\0') {
PropertyType type = RNA_property_type(prop);
int is_boolean = (type == PROP_BOOLEAN && !RNA_property_array_check(prop));
- name= RNA_property_ui_name(prop);
+ name = RNA_property_ui_name(prop);
- if(label_align=='V') {
- col= uiLayoutColumn(layout, 1);
+ if (label_align == 'V') {
+ col = uiLayoutColumn(layout, 1);
- if(!is_boolean)
+ if (!is_boolean)
uiItemL(col, name, ICON_NONE);
}
- else if(label_align=='H') {
+ else if (label_align == 'H') {
split = uiLayoutSplit(layout, 0.5f, 0);
- col= uiLayoutColumn(split, 0);
- uiItemL(col, (is_boolean)? "": name, ICON_NONE);
- col= uiLayoutColumn(split, 0);
+ col = uiLayoutColumn(split, 0);
+ uiItemL(col, (is_boolean) ? "" : name, ICON_NONE);
+ col = uiLayoutColumn(split, 0);
}
else {
- col= NULL;
+ col = NULL;
}
/* may meed to add more cases here.
- * don't override enum flag names */
+ * don't override enum flag names */
/* name is shown above, empty name for button below */
- name= (flag & PROP_ENUM_FLAG || is_boolean)? NULL: "";
+ name = (flag & PROP_ENUM_FLAG || is_boolean) ? NULL : "";
}
else {
- col= layout;
- name= NULL; /* no smart label alignment, show default name with button */
+ col = layout;
+ name = NULL; /* no smart label alignment, show default name with button */
}
uiItemFullR(col, ptr, prop, -1, 0, 0, name, ICON_NONE);
@@ -194,24 +194,24 @@ int uiIconFromID(ID *id)
PointerRNA ptr;
short idcode;
- if(id==NULL)
+ if (id == NULL)
return ICON_NONE;
- idcode= GS(id->name);
+ idcode = GS(id->name);
/* exception for objects */
- if(idcode == ID_OB) {
- ob= (Object*)id;
+ if (idcode == ID_OB) {
+ ob = (Object *)id;
- if(ob->type == OB_EMPTY)
+ if (ob->type == OB_EMPTY)
return ICON_EMPTY_DATA;
else
return uiIconFromID(ob->data);
}
/* 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;
+ 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..4ecd85f62e7 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -41,6 +41,7 @@
#include "BLI_listbase.h"
#include "BLI_rect.h"
#include "BLI_string.h"
+#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
@@ -62,17 +63,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 */
@@ -88,7 +88,7 @@ typedef struct uiWidgetTrias {
/* max as used by round_box__edges */
#define WIDGET_CURVE_RESOLU 9
-#define WIDGET_SIZE_MAX (WIDGET_CURVE_RESOLU*4)
+#define WIDGET_SIZE_MAX (WIDGET_CURVE_RESOLU * 4)
typedef struct uiWidgetBase {
@@ -106,8 +106,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 */
@@ -127,62 +127,70 @@ typedef struct uiWidgetType {
/* *********************** draw data ************************** */
-static float cornervec[WIDGET_CURVE_RESOLU][2]= {{0.0, 0.0}, {0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169},
-{0.707, 0.293}, {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}, {1.0, 1.0}};
+static float cornervec[WIDGET_CURVE_RESOLU][2] = {{0.0, 0.0}, {0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169},
+ {0.707, 0.293}, {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}, {1.0, 1.0}};
#define WIDGET_AA_JITTER 8
-static float jit[WIDGET_AA_JITTER][2]= {
- { 0.468813 , -0.481430}, {-0.155755 , -0.352820},
- { 0.219306 , -0.238501}, {-0.393286 , -0.110949},
- {-0.024699 , 0.013908}, { 0.343805 , 0.147431},
- {-0.272855 , 0.269918}, { 0.095909 , 0.388710}};
-
-static float num_tria_vert[3][2]= {
-{-0.352077, 0.532607}, {-0.352077, -0.549313}, {0.330000, -0.008353}};
-
-static unsigned int num_tria_face[1][3]= {
-{0, 1, 2}};
-
-static float scroll_circle_vert[16][2]= {
-{0.382684, 0.923879}, {0.000001, 1.000000}, {-0.382683, 0.923880}, {-0.707107, 0.707107},
-{-0.923879, 0.382684}, {-1.000000, 0.000000}, {-0.923880, -0.382684}, {-0.707107, -0.707107},
-{-0.382683, -0.923880}, {0.000000, -1.000000}, {0.382684, -0.923880}, {0.707107, -0.707107},
-{0.923880, -0.382684}, {1.000000, -0.000000}, {0.923880, 0.382683}, {0.707107, 0.707107}};
-
-static unsigned int scroll_circle_face[14][3]= {
-{0, 1, 2}, {2, 0, 3}, {3, 0, 15}, {3, 15, 4}, {4, 15, 14}, {4, 14, 5}, {5, 14, 13}, {5, 13, 6},
-{6, 13, 12}, {6, 12, 7}, {7, 12, 11}, {7, 11, 8}, {8, 11, 10}, {8, 10, 9}};
-
-static float menu_tria_vert[6][2]= {
-{-0.41, 0.16}, {0.41, 0.16}, {0, 0.82},
-{0, -0.82}, {-0.41, -0.16}, {0.41, -0.16}};
-
-static unsigned int menu_tria_face[2][3]= {{2, 0, 1}, {3, 5, 4}};
-
-static float check_tria_vert[6][2]= {
-{-0.578579, 0.253369}, {-0.392773, 0.412794}, {-0.004241, -0.328551},
-{-0.003001, 0.034320}, {1.055313, 0.864744}, {0.866408, 1.026895}};
-
-static unsigned int check_tria_face[4][3]= {
-{3, 2, 4}, {3, 4, 5}, {1, 0, 3}, {0, 2, 3}};
-
-GLubyte checker_stipple_sml[32*32/8] =
-{
- 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
- 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
- 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
- 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
- 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
- 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
- 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
- 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
+static float jit[WIDGET_AA_JITTER][2] = {
+ { 0.468813, -0.481430}, {-0.155755, -0.352820},
+ { 0.219306, -0.238501}, {-0.393286, -0.110949},
+ {-0.024699, 0.013908}, { 0.343805, 0.147431},
+ {-0.272855, 0.269918}, { 0.095909, 0.388710}
+};
+
+static float num_tria_vert[3][2] = {
+ {-0.352077, 0.532607}, {-0.352077, -0.549313}, {0.330000, -0.008353}
+};
+
+static unsigned int num_tria_face[1][3] = {
+ {0, 1, 2}
+};
+
+static float scroll_circle_vert[16][2] = {
+ {0.382684, 0.923879}, {0.000001, 1.000000}, {-0.382683, 0.923880}, {-0.707107, 0.707107},
+ {-0.923879, 0.382684}, {-1.000000, 0.000000}, {-0.923880, -0.382684}, {-0.707107, -0.707107},
+ {-0.382683, -0.923880}, {0.000000, -1.000000}, {0.382684, -0.923880}, {0.707107, -0.707107},
+ {0.923880, -0.382684}, {1.000000, -0.000000}, {0.923880, 0.382683}, {0.707107, 0.707107}
+};
+
+static unsigned int scroll_circle_face[14][3] = {
+ {0, 1, 2}, {2, 0, 3}, {3, 0, 15}, {3, 15, 4}, {4, 15, 14}, {4, 14, 5}, {5, 14, 13}, {5, 13, 6},
+ {6, 13, 12}, {6, 12, 7}, {7, 12, 11}, {7, 11, 8}, {8, 11, 10}, {8, 10, 9}
+};
+
+static float menu_tria_vert[6][2] = {
+ {-0.41, 0.16}, {0.41, 0.16}, {0, 0.82},
+ {0, -0.82}, {-0.41, -0.16}, {0.41, -0.16}
+};
+
+static unsigned int menu_tria_face[2][3] = {{2, 0, 1}, {3, 5, 4}};
+
+static float check_tria_vert[6][2] = {
+ {-0.578579, 0.253369}, {-0.392773, 0.412794}, {-0.004241, -0.328551},
+ {-0.003001, 0.034320}, {1.055313, 0.864744}, {0.866408, 1.026895}
+};
+
+static unsigned int check_tria_face[4][3] = {
+ {3, 2, 4}, {3, 4, 5}, {1, 0, 3}, {0, 2, 3}
+};
+
+GLubyte checker_stipple_sml[32 * 32 / 8] =
+{
+ 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0,
+ 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0,
+ 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255,
+ 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255,
+ 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0,
+ 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0,
+ 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255,
+ 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255,
};
/* ************************************************* */
void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3)
{
- float tri_arr[3][2]= {{x1, y1}, {x2, y2}, {x3, y3}};
+ float tri_arr[3][2] = {{x1, y1}, {x2, y2}, {x3, y3}};
float color[4];
int j;
@@ -215,7 +223,7 @@ void ui_draw_anti_roundbox(int mode, float minx, float miny, float maxx, float m
color[3] *= 0.125f;
glColor4fv(color);
- for (j = 0; j < WIDGET_AA_JITTER; j++) {
+ for (j = 0; j < WIDGET_AA_JITTER; j++) {
glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f);
uiDrawBox(mode, minx, miny, maxx, maxy, rad);
glTranslatef(-1.0f * jit[j][0], -1.0f * jit[j][1], 0.0f);
@@ -226,14 +234,14 @@ void ui_draw_anti_roundbox(int mode, float minx, float miny, float maxx, float m
static void widget_init(uiWidgetBase *wtb)
{
- wtb->totvert= wtb->halfwayvert= 0;
- wtb->tria1.tot= 0;
- wtb->tria2.tot= 0;
-
- wtb->inner= 1;
- wtb->outline= 1;
- wtb->emboss= 1;
- wtb->shadedir= 1;
+ wtb->totvert = wtb->halfwayvert = 0;
+ wtb->tria1.tot = 0;
+ wtb->tria2.tot = 0;
+
+ wtb->inner = 1;
+ wtb->outline = 1;
+ wtb->emboss = 1;
+ wtb->shadedir = 1;
}
/* helper call, makes shadow rect, with 'sun' above menu, so only shadow to left/right/bottom */
@@ -242,74 +250,74 @@ static int round_box_shadow_edges(float (*vert)[2], rcti *rect, float rad, int r
{
float vec[WIDGET_CURVE_RESOLU][2];
float minx, miny, maxx, maxy;
- int a, tot= 0;
+ int a, tot = 0;
- rad+= step;
+ rad += step;
- if(2.0f*rad > rect->ymax-rect->ymin)
- rad= 0.5f*(rect->ymax-rect->ymin);
+ if (2.0f * rad > rect->ymax - rect->ymin)
+ rad = 0.5f * (rect->ymax - rect->ymin);
- minx= rect->xmin-step;
- miny= rect->ymin-step;
- maxx= rect->xmax+step;
- maxy= rect->ymax+step;
+ minx = rect->xmin - step;
+ miny = rect->ymin - step;
+ maxx = rect->xmax + step;
+ maxy = rect->ymax + step;
/* mult */
- for(a=0; a < WIDGET_CURVE_RESOLU; a++) {
- vec[a][0]= rad*cornervec[a][0];
- vec[a][1]= rad*cornervec[a][1];
+ for (a = 0; a < WIDGET_CURVE_RESOLU; a++) {
+ vec[a][0] = rad * cornervec[a][0];
+ vec[a][1] = rad * cornervec[a][1];
}
/* start with left-top, anti clockwise */
- if(roundboxalign & UI_CNR_TOP_LEFT) {
- for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
- vert[tot][0]= minx+rad-vec[a][0];
- vert[tot][1]= maxy-vec[a][1];
+ if (roundboxalign & UI_CNR_TOP_LEFT) {
+ for (a = 0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
+ vert[tot][0] = minx + rad - vec[a][0];
+ vert[tot][1] = maxy - vec[a][1];
}
}
else {
- for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
- vert[tot][0]= minx;
- vert[tot][1]= maxy;
+ for (a = 0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
+ vert[tot][0] = minx;
+ vert[tot][1] = maxy;
}
}
- if(roundboxalign & UI_CNR_BOTTOM_LEFT) {
- for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
- vert[tot][0]= minx+vec[a][1];
- vert[tot][1]= miny+rad-vec[a][0];
+ if (roundboxalign & UI_CNR_BOTTOM_LEFT) {
+ for (a = 0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
+ vert[tot][0] = minx + vec[a][1];
+ vert[tot][1] = miny + rad - vec[a][0];
}
}
else {
- for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
- vert[tot][0]= minx;
- vert[tot][1]= miny;
+ for (a = 0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
+ vert[tot][0] = minx;
+ vert[tot][1] = miny;
}
}
- if(roundboxalign & UI_CNR_BOTTOM_RIGHT) {
- for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
- vert[tot][0]= maxx-rad+vec[a][0];
- vert[tot][1]= miny+vec[a][1];
+ if (roundboxalign & UI_CNR_BOTTOM_RIGHT) {
+ for (a = 0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
+ vert[tot][0] = maxx - rad + vec[a][0];
+ vert[tot][1] = miny + vec[a][1];
}
}
else {
- for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
- vert[tot][0]= maxx;
- vert[tot][1]= miny;
+ for (a = 0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
+ vert[tot][0] = maxx;
+ vert[tot][1] = miny;
}
}
- if(roundboxalign & UI_CNR_TOP_RIGHT) {
- for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
- vert[tot][0]= maxx-vec[a][1];
- vert[tot][1]= maxy-rad+vec[a][0];
+ if (roundboxalign & UI_CNR_TOP_RIGHT) {
+ for (a = 0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
+ vert[tot][0] = maxx - vec[a][1];
+ vert[tot][1] = maxy - rad + vec[a][0];
}
}
else {
- for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
- vert[tot][0]= maxx;
- vert[tot][1]= maxy;
+ for (a = 0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
+ vert[tot][0] = maxx;
+ vert[tot][1] = maxy;
}
}
return tot;
@@ -319,155 +327,155 @@ static int round_box_shadow_edges(float (*vert)[2], rcti *rect, float rad, int r
static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, float rad, float radi)
{
float vec[WIDGET_CURVE_RESOLU][2], veci[WIDGET_CURVE_RESOLU][2];
- float minx= rect->xmin, miny= rect->ymin, maxx= rect->xmax, maxy= rect->ymax;
- float minxi= minx + 1.0f; /* boundbox inner */
- float maxxi= maxx - 1.0f;
- float minyi= miny + 1.0f;
- float maxyi= maxy - 1.0f;
- float facxi= (maxxi!=minxi) ? 1.0f/(maxxi-minxi) : 0.0f; /* for uv, can divide by zero */
- float facyi= (maxyi!=minyi) ? 1.0f/(maxyi-minyi) : 0.0f;
- int a, tot= 0, minsize;
- const int hnum= ((roundboxalign & (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT))==(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT) ||
- (roundboxalign & (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT))==(UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT)) ? 1 : 2;
- const int vnum= ((roundboxalign & (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT))==(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT) ||
- (roundboxalign & (UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT))==(UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT)) ? 1 : 2;
-
- minsize= MIN2((rect->xmax-rect->xmin)*hnum, (rect->ymax-rect->ymin)*vnum);
-
- if(2.0f*rad > minsize)
- rad= 0.5f*minsize;
-
- if(2.0f*(radi+1.0f) > minsize)
- radi= 0.5f*minsize - 1.0f;
+ float minx = rect->xmin, miny = rect->ymin, maxx = rect->xmax, maxy = rect->ymax;
+ float minxi = minx + 1.0f; /* boundbox inner */
+ float maxxi = maxx - 1.0f;
+ float minyi = miny + 1.0f;
+ float maxyi = maxy - 1.0f;
+ float facxi = (maxxi != minxi) ? 1.0f / (maxxi - minxi) : 0.0f; /* for uv, can divide by zero */
+ float facyi = (maxyi != minyi) ? 1.0f / (maxyi - minyi) : 0.0f;
+ int a, tot = 0, minsize;
+ const int hnum = ((roundboxalign & (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT)) == (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT) ||
+ (roundboxalign & (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT)) == (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT)) ? 1 : 2;
+ const int vnum = ((roundboxalign & (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT)) == (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT) ||
+ (roundboxalign & (UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT)) == (UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT)) ? 1 : 2;
+
+ minsize = MIN2((rect->xmax - rect->xmin) * hnum, (rect->ymax - rect->ymin) * vnum);
+
+ if (2.0f * rad > minsize)
+ rad = 0.5f * minsize;
+
+ if (2.0f * (radi + 1.0f) > minsize)
+ radi = 0.5f * minsize - 1.0f;
/* mult */
- for(a=0; a < WIDGET_CURVE_RESOLU; a++) {
- veci[a][0]= radi*cornervec[a][0];
- veci[a][1]= radi*cornervec[a][1];
- vec[a][0]= rad*cornervec[a][0];
- vec[a][1]= rad*cornervec[a][1];
+ for (a = 0; a < WIDGET_CURVE_RESOLU; a++) {
+ veci[a][0] = radi * cornervec[a][0];
+ veci[a][1] = radi * cornervec[a][1];
+ vec[a][0] = rad * cornervec[a][0];
+ vec[a][1] = rad * cornervec[a][1];
}
/* corner left-bottom */
- if(roundboxalign & UI_CNR_BOTTOM_LEFT) {
+ if (roundboxalign & UI_CNR_BOTTOM_LEFT) {
- for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
- wt->inner_v[tot][0]= minxi+veci[a][1];
- wt->inner_v[tot][1]= minyi+radi-veci[a][0];
+ for (a = 0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
+ wt->inner_v[tot][0] = minxi + veci[a][1];
+ wt->inner_v[tot][1] = minyi + radi - veci[a][0];
- wt->outer_v[tot][0]= minx+vec[a][1];
- wt->outer_v[tot][1]= miny+rad-vec[a][0];
+ wt->outer_v[tot][0] = minx + vec[a][1];
+ wt->outer_v[tot][1] = miny + rad - vec[a][0];
- wt->inner_uv[tot][0]= facxi*(wt->inner_v[tot][0] - minxi);
- wt->inner_uv[tot][1]= facyi*(wt->inner_v[tot][1] - minyi);
+ wt->inner_uv[tot][0] = facxi * (wt->inner_v[tot][0] - minxi);
+ wt->inner_uv[tot][1] = facyi * (wt->inner_v[tot][1] - minyi);
}
}
else {
- wt->inner_v[tot][0]= minxi;
- wt->inner_v[tot][1]= minyi;
+ wt->inner_v[tot][0] = minxi;
+ wt->inner_v[tot][1] = minyi;
- wt->outer_v[tot][0]= minx;
- wt->outer_v[tot][1]= miny;
+ wt->outer_v[tot][0] = minx;
+ wt->outer_v[tot][1] = miny;
- wt->inner_uv[tot][0]= 0.0f;
- wt->inner_uv[tot][1]= 0.0f;
+ wt->inner_uv[tot][0] = 0.0f;
+ wt->inner_uv[tot][1] = 0.0f;
tot++;
}
/* corner right-bottom */
- if(roundboxalign & UI_CNR_BOTTOM_RIGHT) {
+ if (roundboxalign & UI_CNR_BOTTOM_RIGHT) {
- for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
- wt->inner_v[tot][0]= maxxi-radi+veci[a][0];
- wt->inner_v[tot][1]= minyi+veci[a][1];
+ for (a = 0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
+ wt->inner_v[tot][0] = maxxi - radi + veci[a][0];
+ wt->inner_v[tot][1] = minyi + veci[a][1];
- wt->outer_v[tot][0]= maxx-rad+vec[a][0];
- wt->outer_v[tot][1]= miny+vec[a][1];
+ wt->outer_v[tot][0] = maxx - rad + vec[a][0];
+ wt->outer_v[tot][1] = miny + vec[a][1];
- wt->inner_uv[tot][0]= facxi*(wt->inner_v[tot][0] - minxi);
- wt->inner_uv[tot][1]= facyi*(wt->inner_v[tot][1] - minyi);
+ wt->inner_uv[tot][0] = facxi * (wt->inner_v[tot][0] - minxi);
+ wt->inner_uv[tot][1] = facyi * (wt->inner_v[tot][1] - minyi);
}
}
else {
- wt->inner_v[tot][0]= maxxi;
- wt->inner_v[tot][1]= minyi;
+ wt->inner_v[tot][0] = maxxi;
+ wt->inner_v[tot][1] = minyi;
- wt->outer_v[tot][0]= maxx;
- wt->outer_v[tot][1]= miny;
+ wt->outer_v[tot][0] = maxx;
+ wt->outer_v[tot][1] = miny;
- wt->inner_uv[tot][0]= 1.0f;
- wt->inner_uv[tot][1]= 0.0f;
+ wt->inner_uv[tot][0] = 1.0f;
+ wt->inner_uv[tot][1] = 0.0f;
tot++;
}
- wt->halfwayvert= tot;
+ wt->halfwayvert = tot;
/* corner right-top */
- if(roundboxalign & UI_CNR_TOP_RIGHT) {
+ if (roundboxalign & UI_CNR_TOP_RIGHT) {
- for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
- wt->inner_v[tot][0]= maxxi-veci[a][1];
- wt->inner_v[tot][1]= maxyi-radi+veci[a][0];
+ for (a = 0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
+ wt->inner_v[tot][0] = maxxi - veci[a][1];
+ wt->inner_v[tot][1] = maxyi - radi + veci[a][0];
- wt->outer_v[tot][0]= maxx-vec[a][1];
- wt->outer_v[tot][1]= maxy-rad+vec[a][0];
+ wt->outer_v[tot][0] = maxx - vec[a][1];
+ wt->outer_v[tot][1] = maxy - rad + vec[a][0];
- wt->inner_uv[tot][0]= facxi*(wt->inner_v[tot][0] - minxi);
- wt->inner_uv[tot][1]= facyi*(wt->inner_v[tot][1] - minyi);
+ wt->inner_uv[tot][0] = facxi * (wt->inner_v[tot][0] - minxi);
+ wt->inner_uv[tot][1] = facyi * (wt->inner_v[tot][1] - minyi);
}
}
else {
- wt->inner_v[tot][0]= maxxi;
- wt->inner_v[tot][1]= maxyi;
+ wt->inner_v[tot][0] = maxxi;
+ wt->inner_v[tot][1] = maxyi;
- wt->outer_v[tot][0]= maxx;
- wt->outer_v[tot][1]= maxy;
+ wt->outer_v[tot][0] = maxx;
+ wt->outer_v[tot][1] = maxy;
- wt->inner_uv[tot][0]= 1.0f;
- wt->inner_uv[tot][1]= 1.0f;
+ wt->inner_uv[tot][0] = 1.0f;
+ wt->inner_uv[tot][1] = 1.0f;
tot++;
}
/* corner left-top */
- if(roundboxalign & UI_CNR_TOP_LEFT) {
+ if (roundboxalign & UI_CNR_TOP_LEFT) {
- for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
- wt->inner_v[tot][0]= minxi+radi-veci[a][0];
- wt->inner_v[tot][1]= maxyi-veci[a][1];
+ for (a = 0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
+ wt->inner_v[tot][0] = minxi + radi - veci[a][0];
+ wt->inner_v[tot][1] = maxyi - veci[a][1];
- wt->outer_v[tot][0]= minx+rad-vec[a][0];
- wt->outer_v[tot][1]= maxy-vec[a][1];
+ wt->outer_v[tot][0] = minx + rad - vec[a][0];
+ wt->outer_v[tot][1] = maxy - vec[a][1];
- wt->inner_uv[tot][0]= facxi*(wt->inner_v[tot][0] - minxi);
- wt->inner_uv[tot][1]= facyi*(wt->inner_v[tot][1] - minyi);
+ wt->inner_uv[tot][0] = facxi * (wt->inner_v[tot][0] - minxi);
+ wt->inner_uv[tot][1] = facyi * (wt->inner_v[tot][1] - minyi);
}
}
else {
- wt->inner_v[tot][0]= minxi;
- wt->inner_v[tot][1]= maxyi;
+ wt->inner_v[tot][0] = minxi;
+ wt->inner_v[tot][1] = maxyi;
- wt->outer_v[tot][0]= minx;
- wt->outer_v[tot][1]= maxy;
+ wt->outer_v[tot][0] = minx;
+ wt->outer_v[tot][1] = maxy;
- wt->inner_uv[tot][0]= 0.0f;
- wt->inner_uv[tot][1]= 1.0f;
+ wt->inner_uv[tot][0] = 0.0f;
+ wt->inner_uv[tot][1] = 1.0f;
tot++;
}
BLI_assert(tot <= WIDGET_SIZE_MAX);
- wt->totvert= tot;
+ wt->totvert = tot;
}
static void round_box_edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, float rad)
{
- round_box__edges(wt, roundboxalign, rect, rad, rad-1.0f);
+ round_box__edges(wt, roundboxalign, rect, rad, rad - 1.0f);
}
@@ -475,78 +483,78 @@ static void round_box_edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, flo
static void widget_num_tria(uiWidgetTrias *tria, rcti *rect, float triasize, char where)
{
float centx, centy, sizex, sizey, minsize;
- int a, i1=0, i2=1;
+ int a, i1 = 0, i2 = 1;
- minsize= MIN2(rect->xmax-rect->xmin, rect->ymax-rect->ymin);
+ minsize = MIN2(rect->xmax - rect->xmin, rect->ymax - rect->ymin);
/* center position and size */
- centx= (float)rect->xmin + 0.5f*minsize;
- centy= (float)rect->ymin + 0.5f*minsize;
- sizex= sizey= -0.5f*triasize*minsize;
+ centx = (float)rect->xmin + 0.5f * minsize;
+ centy = (float)rect->ymin + 0.5f * minsize;
+ sizex = sizey = -0.5f * triasize * minsize;
- if(where=='r') {
- centx= (float)rect->xmax - 0.5f*minsize;
- sizex= -sizex;
+ if (where == 'r') {
+ centx = (float)rect->xmax - 0.5f * minsize;
+ sizex = -sizex;
}
- else if(where=='t') {
- centy= (float)rect->ymax - 0.5f*minsize;
- sizey= -sizey;
- i2=0; i1= 1;
+ else if (where == 't') {
+ centy = (float)rect->ymax - 0.5f * minsize;
+ sizey = -sizey;
+ i2 = 0; i1 = 1;
}
- else if(where=='b') {
- sizex= -sizex;
- i2=0; i1= 1;
+ else if (where == 'b') {
+ sizex = -sizex;
+ i2 = 0; i1 = 1;
}
- for(a=0; a<3; a++) {
- tria->vec[a][0]= sizex*num_tria_vert[a][i1] + centx;
- tria->vec[a][1]= sizey*num_tria_vert[a][i2] + centy;
+ for (a = 0; a < 3; a++) {
+ tria->vec[a][0] = sizex * num_tria_vert[a][i1] + centx;
+ tria->vec[a][1] = sizey * num_tria_vert[a][i2] + centy;
}
- tria->tot= 1;
- tria->index= num_tria_face;
+ tria->tot = 1;
+ tria->index = num_tria_face;
}
static void widget_scroll_circle(uiWidgetTrias *tria, rcti *rect, float triasize, char where)
{
float centx, centy, sizex, sizey, minsize;
- int a, i1=0, i2=1;
+ int a, i1 = 0, i2 = 1;
- minsize= MIN2(rect->xmax-rect->xmin, rect->ymax-rect->ymin);
+ minsize = MIN2(rect->xmax - rect->xmin, rect->ymax - rect->ymin);
/* center position and size */
- centx= (float)rect->xmin + 0.5f*minsize;
- centy= (float)rect->ymin + 0.5f*minsize;
- sizex= sizey= -0.5f*triasize*minsize;
+ centx = (float)rect->xmin + 0.5f * minsize;
+ centy = (float)rect->ymin + 0.5f * minsize;
+ sizex = sizey = -0.5f * triasize * minsize;
- if(where=='r') {
- centx= (float)rect->xmax - 0.5f*minsize;
- sizex= -sizex;
+ if (where == 'r') {
+ centx = (float)rect->xmax - 0.5f * minsize;
+ sizex = -sizex;
}
- else if(where=='t') {
- centy= (float)rect->ymax - 0.5f*minsize;
- sizey= -sizey;
- i2=0; i1= 1;
+ else if (where == 't') {
+ centy = (float)rect->ymax - 0.5f * minsize;
+ sizey = -sizey;
+ i2 = 0; i1 = 1;
}
- else if(where=='b') {
- sizex= -sizex;
- i2=0; i1= 1;
+ else if (where == 'b') {
+ sizex = -sizex;
+ i2 = 0; i1 = 1;
}
- for(a=0; a<16; a++) {
- tria->vec[a][0]= sizex*scroll_circle_vert[a][i1] + centx;
- tria->vec[a][1]= sizey*scroll_circle_vert[a][i2] + centy;
+ for (a = 0; a < 16; a++) {
+ tria->vec[a][0] = sizex * scroll_circle_vert[a][i1] + centx;
+ tria->vec[a][1] = sizey * scroll_circle_vert[a][i2] + centy;
}
- tria->tot= 14;
- tria->index= scroll_circle_face;
+ tria->tot = 14;
+ tria->index = scroll_circle_face;
}
static void widget_trias_draw(uiWidgetTrias *tria)
{
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_FLOAT, 0, tria->vec);
- glDrawElements(GL_TRIANGLES, tria->tot*3, GL_UNSIGNED_INT, tria->index);
+ glDrawElements(GL_TRIANGLES, tria->tot * 3, GL_UNSIGNED_INT, tria->index);
glDisableClientState(GL_VERTEX_ARRAY);
}
@@ -556,22 +564,22 @@ static void widget_menu_trias(uiWidgetTrias *tria, rcti *rect)
int a;
/* center position and size */
- centx= rect->xmax - 0.5f*(rect->ymax-rect->ymin);
- centy= rect->ymin + 0.5f*(rect->ymax-rect->ymin);
- size= 0.4f*(rect->ymax-rect->ymin);
+ centx = rect->xmax - 0.5f * (rect->ymax - rect->ymin);
+ centy = rect->ymin + 0.5f * (rect->ymax - rect->ymin);
+ size = 0.4f * (rect->ymax - rect->ymin);
/* XXX exception */
- asp= ((float)rect->xmax-rect->xmin)/((float)rect->ymax-rect->ymin);
- if(asp > 1.2f && asp < 2.6f)
- centx= rect->xmax - 0.3f*(rect->ymax-rect->ymin);
+ asp = ((float)rect->xmax - rect->xmin) / ((float)rect->ymax - rect->ymin);
+ if (asp > 1.2f && asp < 2.6f)
+ centx = rect->xmax - 0.3f * (rect->ymax - rect->ymin);
- for(a=0; a<6; a++) {
- tria->vec[a][0]= size*menu_tria_vert[a][0] + centx;
- tria->vec[a][1]= size*menu_tria_vert[a][1] + centy;
+ for (a = 0; a < 6; a++) {
+ tria->vec[a][0] = size * menu_tria_vert[a][0] + centx;
+ tria->vec[a][1] = size * menu_tria_vert[a][1] + centy;
}
- tria->tot= 2;
- tria->index= menu_tria_face;
+ tria->tot = 2;
+ tria->index = menu_tria_face;
}
static void widget_check_trias(uiWidgetTrias *tria, rcti *rect)
@@ -580,17 +588,17 @@ static void widget_check_trias(uiWidgetTrias *tria, rcti *rect)
int a;
/* center position and size */
- centx= rect->xmin + 0.5f*(rect->ymax-rect->ymin);
- centy= rect->ymin + 0.5f*(rect->ymax-rect->ymin);
- size= 0.5f*(rect->ymax-rect->ymin);
+ centx = rect->xmin + 0.5f * (rect->ymax - rect->ymin);
+ centy = rect->ymin + 0.5f * (rect->ymax - rect->ymin);
+ size = 0.5f * (rect->ymax - rect->ymin);
- for(a=0; a<6; a++) {
- tria->vec[a][0]= size*check_tria_vert[a][0] + centx;
- tria->vec[a][1]= size*check_tria_vert[a][1] + centy;
+ for (a = 0; a < 6; a++) {
+ tria->vec[a][0] = size * check_tria_vert[a][0] + centx;
+ tria->vec[a][1] = size * check_tria_vert[a][1] + centy;
}
- tria->tot= 4;
- tria->index= check_tria_face;
+ tria->tot = 4;
+ tria->index = check_tria_face;
}
@@ -598,58 +606,58 @@ static void widget_check_trias(uiWidgetTrias *tria, rcti *rect)
static void shadecolors4(char coltop[4], char *coldown, const char *color, short shadetop, short shadedown)
{
- coltop[0]= CLAMPIS(color[0]+shadetop, 0, 255);
- coltop[1]= CLAMPIS(color[1]+shadetop, 0, 255);
- coltop[2]= CLAMPIS(color[2]+shadetop, 0, 255);
- coltop[3]= color[3];
+ coltop[0] = CLAMPIS(color[0] + shadetop, 0, 255);
+ coltop[1] = CLAMPIS(color[1] + shadetop, 0, 255);
+ coltop[2] = CLAMPIS(color[2] + shadetop, 0, 255);
+ coltop[3] = color[3];
- coldown[0]= CLAMPIS(color[0]+shadedown, 0, 255);
- coldown[1]= CLAMPIS(color[1]+shadedown, 0, 255);
- coldown[2]= CLAMPIS(color[2]+shadedown, 0, 255);
- coldown[3]= color[3];
+ coldown[0] = CLAMPIS(color[0] + shadedown, 0, 255);
+ coldown[1] = CLAMPIS(color[1] + shadedown, 0, 255);
+ coldown[2] = CLAMPIS(color[2] + shadedown, 0, 255);
+ coldown[3] = color[3];
}
static void round_box_shade_col4_r(unsigned char col_r[4], const char col1[4], const char col2[4], const float fac)
{
- const int faci= FTOCHAR(fac);
- const int facm= 255-faci;
+ const int faci = FTOCHAR(fac);
+ const int facm = 255 - faci;
- col_r[0]= (faci*col1[0] + facm*col2[0])>>8;
- col_r[1]= (faci*col1[1] + facm*col2[1])>>8;
- col_r[2]= (faci*col1[2] + facm*col2[2])>>8;
- col_r[3]= (faci*col1[3] + facm*col2[3])>>8;
+ col_r[0] = (faci * col1[0] + facm * col2[0]) >> 8;
+ col_r[1] = (faci * col1[1] + facm * col2[1]) >> 8;
+ col_r[2] = (faci * col1[2] + facm * col2[2]) >> 8;
+ col_r[3] = (faci * col1[3] + facm * col2[3]) >> 8;
}
-static void widget_verts_to_quad_strip(uiWidgetBase *wtb, const int totvert, float quad_strip[WIDGET_SIZE_MAX*2+2][2])
+static void widget_verts_to_quad_strip(uiWidgetBase *wtb, const int totvert, float quad_strip[WIDGET_SIZE_MAX * 2 + 2][2])
{
int a;
- for(a=0; a<totvert; a++) {
- copy_v2_v2(quad_strip[a*2], wtb->outer_v[a]);
- copy_v2_v2(quad_strip[a*2+1], wtb->inner_v[a]);
+ for (a = 0; a < totvert; a++) {
+ copy_v2_v2(quad_strip[a * 2], wtb->outer_v[a]);
+ copy_v2_v2(quad_strip[a * 2 + 1], wtb->inner_v[a]);
}
- copy_v2_v2(quad_strip[a*2], wtb->outer_v[0]);
- copy_v2_v2(quad_strip[a*2+1], wtb->inner_v[0]);
+ copy_v2_v2(quad_strip[a * 2], wtb->outer_v[0]);
+ copy_v2_v2(quad_strip[a * 2 + 1], wtb->inner_v[0]);
}
-static void widget_verts_to_quad_strip_open(uiWidgetBase *wtb, const int totvert, float quad_strip[WIDGET_SIZE_MAX*2][2])
+static void widget_verts_to_quad_strip_open(uiWidgetBase *wtb, const int totvert, float quad_strip[WIDGET_SIZE_MAX * 2][2])
{
int a;
- for(a=0; a<totvert; a++) {
- quad_strip[a*2][0]= wtb->outer_v[a][0];
- quad_strip[a*2][1]= wtb->outer_v[a][1];
- quad_strip[a*2+1][0]= wtb->outer_v[a][0];
- quad_strip[a*2+1][1]= wtb->outer_v[a][1] - 1.0f;
+ for (a = 0; a < totvert; a++) {
+ quad_strip[a * 2][0] = wtb->outer_v[a][0];
+ quad_strip[a * 2][1] = wtb->outer_v[a][1];
+ quad_strip[a * 2 + 1][0] = wtb->outer_v[a][0];
+ quad_strip[a * 2 + 1][1] = wtb->outer_v[a][1] - 1.0f;
}
}
static void widgetbase_outline(uiWidgetBase *wtb)
{
- float quad_strip[WIDGET_SIZE_MAX*2+2][2]; /* + 2 because the last pair is wrapped */
+ float quad_strip[WIDGET_SIZE_MAX * 2 + 2][2]; /* + 2 because the last pair is wrapped */
widget_verts_to_quad_strip(wtb, wtb->totvert, quad_strip);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_FLOAT, 0, quad_strip);
- glDrawArrays(GL_QUAD_STRIP, 0, wtb->totvert*2 + 2);
+ glDrawArrays(GL_QUAD_STRIP, 0, wtb->totvert * 2 + 2);
glDisableClientState(GL_VERTEX_ARRAY);
}
@@ -660,11 +668,11 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
glEnable(GL_BLEND);
/* backdrop non AA */
- if(wtb->inner) {
- if(wcol->shaded==0) {
+ if (wtb->inner) {
+ if (wcol->shaded == 0) {
if (wcol->alpha_check) {
float inner_v_half[WIDGET_SIZE_MAX][2];
- float x_mid= 0.0f; /* used for dumb clamping of values */
+ float x_mid = 0.0f; /* used for dumb clamping of values */
/* dark checkers */
glColor4ub(UI_TRANSP_DARK, UI_TRANSP_DARK, UI_TRANSP_DARK, 255);
@@ -688,10 +696,10 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
/* alpha fill */
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glColor4ubv((unsigned char*)wcol->inner);
+ glColor4ubv((unsigned char *)wcol->inner);
glEnableClientState(GL_VERTEX_ARRAY);
- for(a=0; a<wtb->totvert; a++) {
+ for (a = 0; a < wtb->totvert; a++) {
x_mid += wtb->inner_v[a][0];
}
x_mid /= wtb->totvert;
@@ -703,9 +711,9 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
/* 1/2 solid color */
glColor4ub(wcol->inner[0], wcol->inner[1], wcol->inner[2], 255);
- for(a=0; a<wtb->totvert; a++) {
- inner_v_half[a][0]= MIN2(wtb->inner_v[a][0], x_mid);
- inner_v_half[a][1]= wtb->inner_v[a][1];
+ for (a = 0; a < wtb->totvert; a++) {
+ inner_v_half[a][0] = MIN2(wtb->inner_v[a][0], x_mid);
+ inner_v_half[a][1] = wtb->inner_v[a][1];
}
glEnableClientState(GL_VERTEX_ARRAY);
@@ -715,7 +723,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
}
else {
/* simple fill */
- glColor4ubv((unsigned char*)wcol->inner);
+ glColor4ubv((unsigned char *)wcol->inner);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_FLOAT, 0, wtb->inner_v);
@@ -726,12 +734,12 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
else {
char col1[4], col2[4];
unsigned char col_array[WIDGET_SIZE_MAX * 4];
- unsigned char *col_pt= col_array;
+ unsigned char *col_pt = col_array;
shadecolors4(col1, col2, wcol->inner, wcol->shadetop, wcol->shadedown);
glShadeModel(GL_SMOOTH);
- for(a=0; a<wtb->totvert; a++, col_pt += 4) {
+ for (a = 0; a < wtb->totvert; a++, col_pt += 4) {
round_box_shade_col4_r(col_pt, col1, col2, wtb->inner_uv[a][wtb->shadedir]);
}
@@ -748,9 +756,9 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
}
/* for each AA step */
- if(wtb->outline) {
- float quad_strip[WIDGET_SIZE_MAX*2+2][2]; /* + 2 because the last pair is wrapped */
- float quad_strip_emboss[WIDGET_SIZE_MAX*2][2]; /* only for emboss */
+ if (wtb->outline) {
+ float quad_strip[WIDGET_SIZE_MAX * 2 + 2][2]; /* + 2 because the last pair is wrapped */
+ float quad_strip_emboss[WIDGET_SIZE_MAX * 2][2]; /* only for emboss */
const unsigned char tcol[4] = {wcol->outline[0],
wcol->outline[1],
@@ -759,7 +767,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
widget_verts_to_quad_strip(wtb, wtb->totvert, quad_strip);
- if(wtb->emboss) {
+ if (wtb->emboss) {
widget_verts_to_quad_strip_open(wtb, wtb->halfwayvert, quad_strip_emboss);
}
@@ -772,14 +780,14 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
glColor4ubv(tcol);
glVertexPointer(2, GL_FLOAT, 0, quad_strip);
- glDrawArrays(GL_QUAD_STRIP, 0, wtb->totvert*2 + 2);
+ glDrawArrays(GL_QUAD_STRIP, 0, wtb->totvert * 2 + 2);
/* emboss bottom shadow */
- if(wtb->emboss) {
+ if (wtb->emboss) {
glColor4f(1.0f, 1.0f, 1.0f, 0.02f);
glVertexPointer(2, GL_FLOAT, 0, quad_strip_emboss);
- glDrawArrays(GL_QUAD_STRIP, 0, wtb->halfwayvert*2);
+ glDrawArrays(GL_QUAD_STRIP, 0, wtb->halfwayvert * 2);
}
glTranslatef(-1.0f * jit[j][0], -1.0f * jit[j][1], 0.0f);
@@ -789,7 +797,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
}
/* decoration */
- if(wtb->tria1.tot || wtb->tria2.tot) {
+ if (wtb->tria1.tot || wtb->tria2.tot) {
const unsigned char tcol[4] = {wcol->item[0],
wcol->item[1],
wcol->item[2],
@@ -798,11 +806,11 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
for (j = 0; j < WIDGET_AA_JITTER; j++) {
glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f);
- if(wtb->tria1.tot) {
+ if (wtb->tria1.tot) {
glColor4ubv(tcol);
widget_trias_draw(&wtb->tria1);
}
- if(wtb->tria2.tot) {
+ if (wtb->tria2.tot) {
glColor4ubv(tcol);
widget_trias_draw(&wtb->tria2);
}
@@ -817,23 +825,23 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
/* *********************** text/icon ************************************** */
-#define PREVIEW_PAD 4
+#define PREVIEW_PAD 4
static void widget_draw_preview(BIFIconID icon, float UNUSED(alpha), rcti *rect)
{
int w, h, size;
- if(icon==ICON_NONE)
+ if (icon == ICON_NONE)
return;
w = rect->xmax - rect->xmin;
h = rect->ymax - rect->ymin;
size = MIN2(w, h);
- size -= PREVIEW_PAD*2; /* padding */
+ size -= PREVIEW_PAD * 2; /* padding */
- if(size > 0) {
- int x = rect->xmin + w/2 - size/2;
- int y = rect->ymin + h/2 - size/2;
+ if (size > 0) {
+ int x = rect->xmin + w / 2 - size / 2;
+ int y = rect->ymin + h / 2 - size / 2;
UI_icon_draw_preview_aspect_size(x, y, icon, 1.0f, size);
}
@@ -849,7 +857,7 @@ static int ui_but_draw_menu_icon(uiBut *but)
static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, rcti *rect)
{
- int xs=0, ys=0;
+ int xs = 0, ys = 0;
float aspect, height;
if (but->flag & UI_ICON_PREVIEW) {
@@ -858,66 +866,67 @@ static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, rcti *rect
}
/* this icon doesn't need draw... */
- if(icon==ICON_BLANK1 && (but->flag & UI_ICON_SUBMENU)==0) return;
+ if (icon == ICON_BLANK1 && (but->flag & UI_ICON_SUBMENU) == 0) return;
/* we need aspect from block, for menus... these buttons are scaled in uiPositionBlock() */
- aspect= but->block->aspect;
- if(aspect != but->aspect) {
+ aspect = but->block->aspect;
+ if (aspect != but->aspect) {
/* prevent scaling up icon in pupmenu */
if (aspect < 1.0f) {
- height= UI_DPI_ICON_SIZE;
+ height = UI_DPI_ICON_SIZE;
aspect = 1.0f;
}
else
- height= UI_DPI_ICON_SIZE/aspect;
+ height = UI_DPI_ICON_SIZE / aspect;
}
else
- height= UI_DPI_ICON_SIZE;
+ height = UI_DPI_ICON_SIZE;
/* calculate blend color */
- if ELEM4(but->type, TOG, ROW, TOGN, LISTROW) {
- if(but->flag & UI_SELECT);
- else if(but->flag & UI_ACTIVE);
- else alpha= 0.5f;
+ if (ELEM4(but->type, TOG, ROW, TOGN, LISTROW)) {
+ if (but->flag & UI_SELECT) ;
+ else if (but->flag & UI_ACTIVE) ;
+ else alpha = 0.5f;
}
/* extra feature allows more alpha blending */
- if(but->type==LABEL && but->a1==1.0f) alpha *= but->a2;
+ if (but->type == LABEL && but->a1 == 1.0f) alpha *= but->a2;
glEnable(GL_BLEND);
- if(icon && icon!=ICON_BLANK1) {
- if(but->flag & UI_ICON_LEFT) {
- if (but->type==BUT_TOGDUAL) {
+ if (icon && icon != ICON_BLANK1) {
+ if (but->flag & UI_ICON_LEFT) {
+ if (but->type == BUT_TOGDUAL) {
if (but->drawstr[0]) {
- xs= rect->xmin-1;
- } else {
- xs= (rect->xmin+rect->xmax- height)/2;
+ xs = rect->xmin - 1;
+ }
+ else {
+ xs = (rect->xmin + rect->xmax - height) / 2;
}
}
else if (but->block->flag & UI_BLOCK_LOOP) {
- if(but->type==SEARCH_MENU)
- xs= rect->xmin+4;
+ if (but->type == SEARCH_MENU)
+ xs = rect->xmin + 4;
else
- xs= rect->xmin+1;
+ xs = rect->xmin + 1;
}
- else if ((but->type==ICONROW) || (but->type==ICONTEXTROW)) {
- xs= rect->xmin+3;
+ else if ((but->type == ICONROW) || (but->type == ICONTEXTROW)) {
+ xs = rect->xmin + 3;
}
else {
- xs= rect->xmin+4;
+ xs = rect->xmin + 4;
}
- ys= (rect->ymin+rect->ymax- height)/2;
+ ys = (rect->ymin + rect->ymax - height) / 2;
}
else {
- xs= (rect->xmin+rect->xmax- height)/2;
- ys= (rect->ymin+rect->ymax- height)/2;
+ xs = (rect->xmin + rect->xmax - height) / 2;
+ ys = (rect->ymin + rect->ymax - height) / 2;
}
/* to indicate draggable */
- if(but->dragpoin && (but->flag & UI_ACTIVE)) {
- float rgb[3]= {1.25f, 1.25f, 1.25f};
+ if (but->dragpoin && (but->flag & UI_ACTIVE)) {
+ float rgb[3] = {1.25f, 1.25f, 1.25f};
UI_icon_draw_aspect_color(xs, ys, icon, aspect, rgb);
}
else
@@ -925,8 +934,8 @@ static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, rcti *rect
}
if (ui_but_draw_menu_icon(but)) {
- xs= rect->xmax-17;
- ys= (rect->ymin+rect->ymax- height)/2;
+ xs = rect->xmax - 17;
+ ys = (rect->ymin + rect->ymax - height) / 2;
UI_icon_draw_aspect(xs, ys, ICON_RIGHTARROW_THIN, aspect, alpha);
}
@@ -934,122 +943,147 @@ static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, rcti *rect
glDisable(GL_BLEND);
}
+static void ui_text_clip_give_prev_off(uiBut *but)
+{
+ char *prev_utf8 = BLI_str_find_prev_char_utf8(but->drawstr, but->drawstr + but->ofs);
+ int bytes = but->drawstr + but->ofs - prev_utf8;
+
+ but->ofs -= bytes;
+}
+
+static void ui_text_clip_give_next_off(uiBut *but)
+{
+ char *next_utf8 = BLI_str_find_next_char_utf8(but->drawstr + but->ofs, NULL);
+ int bytes = next_utf8 - (but->drawstr + but->ofs);
+
+ but->ofs += bytes;
+}
+
/* sets but->ofs to make sure text is correctly visible */
static void ui_text_leftclip(uiFontStyle *fstyle, uiBut *but, rcti *rect)
{
- int border= (but->flag & UI_BUT_ALIGN_RIGHT)? 8: 10;
- int okwidth= rect->xmax-rect->xmin - border;
+ int border = (but->flag & UI_BUT_ALIGN_RIGHT) ? 8 : 10;
+ int okwidth = rect->xmax - rect->xmin - border;
if (but->flag & UI_HAS_ICON) okwidth -= UI_DPI_ICON_SIZE;
/* need to set this first */
uiStyleFontSet(fstyle);
- if (fstyle->kerning==1) /* for BLF_width */
+ if (fstyle->kerning == 1) /* for BLF_width */
BLF_enable(fstyle->uifont_id, BLF_KERNING_DEFAULT);
/* if text editing we define ofs dynamically */
- if(but->editstr && but->pos >= 0) {
- if(but->ofs > but->pos)
- but->ofs= but->pos;
+ if (but->editstr && but->pos >= 0) {
+ if (but->ofs > but->pos)
+ but->ofs = but->pos;
- if(BLF_width(fstyle->uifont_id, but->drawstr) <= okwidth)
+ if (BLF_width(fstyle->uifont_id, but->drawstr) <= okwidth)
but->ofs = 0;
}
- else but->ofs= 0;
+ else but->ofs = 0;
- but->strwidth= BLF_width(fstyle->uifont_id, but->drawstr + but->ofs);
+ but->strwidth = BLF_width(fstyle->uifont_id, but->drawstr + but->ofs);
- while(but->strwidth > okwidth) {
+ while (but->strwidth > okwidth) {
/* textbut exception, clip right when... */
- if(but->editstr && but->pos >= 0) {
+ if (but->editstr && but->pos >= 0) {
float width;
char buf[UI_MAX_DRAW_STR];
/* copy draw string */
- BLI_strncpy(buf, but->drawstr, sizeof(buf));
+ BLI_strncpy_utf8(buf, but->drawstr, sizeof(buf));
/* string position of cursor */
- buf[but->pos]= 0;
- width= BLF_width(fstyle->uifont_id, buf+but->ofs);
+ buf[but->pos] = 0;
+ width = BLF_width(fstyle->uifont_id, buf + but->ofs);
/* if cursor is at 20 pixels of right side button we clip left */
- if(width > okwidth-20)
- but->ofs++;
+ if (width > okwidth - 20)
+ ui_text_clip_give_next_off(but);
else {
+ int len, bytes;
/* shift string to the left */
- if(width < 20 && but->ofs > 0)
- but->ofs--;
- but->drawstr[ strlen(but->drawstr)-1 ]= 0;
+ if (width < 20 && but->ofs > 0)
+ ui_text_clip_give_prev_off(but);
+ len = strlen(but->drawstr);
+ bytes = BLI_str_utf8_size(BLI_str_find_prev_char_utf8(but->drawstr, but->drawstr + len));
+ but->drawstr[len - bytes] = 0;
}
}
else
- but->ofs++;
+ ui_text_clip_give_next_off(but);
- but->strwidth= BLF_width(fstyle->uifont_id, but->drawstr+but->ofs);
+ but->strwidth = BLF_width(fstyle->uifont_id, but->drawstr + but->ofs);
- if(but->strwidth < 10) break;
+ if (but->strwidth < 10) break;
}
- if (fstyle->kerning==1)
+ if (fstyle->kerning == 1)
BLF_disable(fstyle->uifont_id, BLF_KERNING_DEFAULT);
}
static void ui_text_label_rightclip(uiFontStyle *fstyle, uiBut *but, rcti *rect)
{
- int border= (but->flag & UI_BUT_ALIGN_RIGHT)? 8: 10;
- int okwidth= rect->xmax-rect->xmin - border;
- char *cpoin=NULL;
+ int border = (but->flag & UI_BUT_ALIGN_RIGHT) ? 8 : 10;
+ int okwidth = rect->xmax - rect->xmin - border;
+ char *cpoin = NULL;
char *cpend = but->drawstr + strlen(but->drawstr);
/* need to set this first */
uiStyleFontSet(fstyle);
- if (fstyle->kerning==1) /* for BLF_width */
+ if (fstyle->kerning == 1) /* for BLF_width */
BLF_enable(fstyle->uifont_id, BLF_KERNING_DEFAULT);
- but->strwidth= BLF_width(fstyle->uifont_id, but->drawstr);
- but->ofs= 0;
+ but->strwidth = BLF_width(fstyle->uifont_id, but->drawstr);
+ but->ofs = 0;
/* find the space after ':' separator */
- cpoin= strrchr(but->drawstr, ':');
+ cpoin = strrchr(but->drawstr, ':');
- if (cpoin && (cpoin < cpend-2)) {
+ if (cpoin && (cpoin < cpend - 2)) {
char *cp2 = cpoin;
/* chop off the leading text, starting from the right */
while (but->strwidth > okwidth && cp2 > but->drawstr) {
+ int bytes = BLI_str_utf8_size(cp2);
+ if (bytes < 0)
+ bytes = 1;
+
/* shift the text after and including cp2 back by 1 char, +1 to include null terminator */
- memmove(cp2-1, cp2, strlen(cp2)+1);
- cp2--;
+ memmove(cp2 - bytes, cp2, strlen(cp2) + 1);
+ cp2 -= bytes;
- but->strwidth= BLF_width(fstyle->uifont_id, but->drawstr+but->ofs);
- if(but->strwidth < 10) break;
+ but->strwidth = BLF_width(fstyle->uifont_id, but->drawstr + but->ofs);
+ if (but->strwidth < 10) break;
}
/* after the leading text is gone, chop off the : and following space, with ofs */
while ((but->strwidth > okwidth) && (but->ofs < 2))
{
- but->ofs++;
- but->strwidth= BLF_width(fstyle->uifont_id, but->drawstr+but->ofs);
- if(but->strwidth < 10) break;
+ ui_text_clip_give_next_off(but);
+ but->strwidth = BLF_width(fstyle->uifont_id, but->drawstr + but->ofs);
+ if (but->strwidth < 10) break;
}
}
/* once the label's gone, chop off the least significant digits */
- while(but->strwidth > okwidth ) {
- int pos= strlen(but->drawstr);
-
- but->drawstr[ pos-1 ] = 0;
- pos--;
+ while (but->strwidth > okwidth) {
+ int len = strlen(but->drawstr);
+ int bytes = BLI_str_utf8_size(BLI_str_find_prev_char_utf8(but->drawstr, but->drawstr + len));
+ if (bytes < 0)
+ bytes = 1;
+
+ but->drawstr[len - bytes] = 0;
- but->strwidth= BLF_width(fstyle->uifont_id, but->drawstr+but->ofs);
- if(but->strwidth < 10) break;
+ but->strwidth = BLF_width(fstyle->uifont_id, but->drawstr + but->ofs);
+ if (but->strwidth < 10) break;
}
- if (fstyle->kerning==1)
+ if (fstyle->kerning == 1)
BLF_disable(fstyle->uifont_id, BLF_KERNING_DEFAULT);
}
@@ -1064,17 +1098,17 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
uiStyleFontSet(fstyle);
- if(but->editstr || (but->flag & UI_TEXT_LEFT))
- fstyle->align= UI_STYLE_TEXT_LEFT;
+ if (but->editstr || (but->flag & UI_TEXT_LEFT))
+ fstyle->align = UI_STYLE_TEXT_LEFT;
else
- fstyle->align= UI_STYLE_TEXT_CENTER;
+ fstyle->align = UI_STYLE_TEXT_CENTER;
- if (fstyle->kerning==1) /* for BLF_width */
+ if (fstyle->kerning == 1) /* for BLF_width */
BLF_enable(fstyle->uifont_id, BLF_KERNING_DEFAULT);
/* text button selection and cursor */
- if(but->editstr && but->pos != -1) {
- short t=0, pos=0, ch;
+ if (but->editstr && but->pos != -1) {
+ short t = 0, pos = 0, ch;
short selsta_tmp, selend_tmp, selsta_draw, selwidth_draw;
if ((but->selend - but->selsta) > 0) {
@@ -1082,43 +1116,46 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
selsta_tmp = but->selsta;
selend_tmp = but->selend;
- if(but->drawstr[0]!=0) {
+ if (but->drawstr[0] != 0) {
if (but->selsta >= but->ofs) {
- ch= but->drawstr[selsta_tmp];
- but->drawstr[selsta_tmp]= 0;
+ ch = but->drawstr[selsta_tmp];
+ but->drawstr[selsta_tmp] = 0;
- selsta_draw = BLF_width(fstyle->uifont_id, but->drawstr+but->ofs);
+ selsta_draw = BLF_width(fstyle->uifont_id, but->drawstr + but->ofs);
- but->drawstr[selsta_tmp]= ch;
- } else
+ but->drawstr[selsta_tmp] = ch;
+ }
+ else {
selsta_draw = 0;
+ }
- ch= but->drawstr[selend_tmp];
- but->drawstr[selend_tmp]= 0;
+ ch = but->drawstr[selend_tmp];
+ but->drawstr[selend_tmp] = 0;
- selwidth_draw = BLF_width(fstyle->uifont_id, but->drawstr+but->ofs);
+ selwidth_draw = BLF_width(fstyle->uifont_id, but->drawstr + but->ofs);
- but->drawstr[selend_tmp]= ch;
+ but->drawstr[selend_tmp] = ch;
- glColor3ubv((unsigned char*)wcol->item);
- glRects(rect->xmin+selsta_draw, rect->ymin+2, rect->xmin+selwidth_draw, rect->ymax-2);
+ glColor3ubv((unsigned char *)wcol->item);
+ glRects(rect->xmin + selsta_draw, rect->ymin + 2, rect->xmin + selwidth_draw, rect->ymax - 2);
}
- } else {
+ }
+ else {
/* text cursor */
- pos= but->pos;
- if(pos >= but->ofs) {
- if(but->drawstr[0]!=0) {
- ch= but->drawstr[pos];
- but->drawstr[pos]= 0;
+ pos = but->pos;
+ if (pos >= but->ofs) {
+ if (but->drawstr[0] != 0) {
+ ch = but->drawstr[pos];
+ but->drawstr[pos] = 0;
- t= BLF_width(fstyle->uifont_id, but->drawstr+but->ofs) / but->aspect;
+ t = BLF_width(fstyle->uifont_id, but->drawstr + but->ofs) / but->aspect;
- but->drawstr[pos]= ch;
+ but->drawstr[pos] = ch;
}
glColor3f(0.20, 0.6, 0.9);
- glRects(rect->xmin+t, rect->ymin+2, rect->xmin+t+2, rect->ymax-2);
+ glRects(rect->xmin + t, rect->ymin + 2, rect->xmin + t + 2, rect->ymax - 2);
}
}
}
@@ -1127,45 +1164,45 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
BLF_disable(fstyle->uifont_id, BLF_KERNING_DEFAULT);
// ui_rasterpos_safe(x, y, but->aspect);
-// if(but->type==IDPOIN) transopts= 0; // no translation, of course!
+// if (but->type==IDPOIN) transopts= 0; // no translation, of course!
// else transopts= ui_translate_buttons();
/* cut string in 2 parts - only for menu entries */
- if((but->block->flag & UI_BLOCK_LOOP)) {
- if(ELEM5(but->type, SLI, NUM, TEX, NUMSLI, NUMABS)==0) {
- cpoin= strchr(but->drawstr, '|');
- if(cpoin) *cpoin= 0;
+ if ((but->block->flag & UI_BLOCK_LOOP)) {
+ if (ELEM5(but->type, SLI, NUM, TEX, NUMSLI, NUMABS) == 0) {
+ cpoin = strchr(but->drawstr, '|');
+ if (cpoin) *cpoin = 0;
}
}
- glColor3ubv((unsigned char*)wcol->text);
+ glColor3ubv((unsigned char *)wcol->text);
- uiStyleFontDrawExt(fstyle, rect, but->drawstr+but->ofs, &font_xofs, &font_yofs);
+ uiStyleFontDrawExt(fstyle, rect, but->drawstr + but->ofs, &font_xofs, &font_yofs);
- if(but->menu_key != '\0') {
+ if (but->menu_key != '\0') {
char fixedbuf[128];
char *str;
BLI_strncpy(fixedbuf, but->drawstr + but->ofs, sizeof(fixedbuf));
- str= strchr(fixedbuf, but->menu_key-32); /* upper case */
- if(str==NULL)
- str= strchr(fixedbuf, but->menu_key);
+ str = strchr(fixedbuf, but->menu_key - 32); /* upper case */
+ if (str == NULL)
+ str = strchr(fixedbuf, but->menu_key);
- if(str) {
- int ul_index= -1;
+ if (str) {
+ int ul_index = -1;
float ul_advance;
- ul_index= (int)(str - fixedbuf);
+ ul_index = (int)(str - fixedbuf);
if (fstyle->kerning == 1) {
BLF_enable(fstyle->uifont_id, BLF_KERNING_DEFAULT);
}
- fixedbuf[ul_index]= '\0';
- ul_advance= BLF_width(fstyle->uifont_id, fixedbuf);
+ fixedbuf[ul_index] = '\0';
+ ul_advance = BLF_width(fstyle->uifont_id, fixedbuf);
- BLF_position(fstyle->uifont_id, rect->xmin+font_xofs + ul_advance, rect->ymin+font_yofs, 0.0f);
+ BLF_position(fstyle->uifont_id, rect->xmin + font_xofs + ul_advance, rect->ymin + font_yofs, 0.0f);
BLF_draw(fstyle->uifont_id, "_", 2);
if (fstyle->kerning == 1) {
@@ -1175,11 +1212,11 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
}
/* part text right aligned */
- if(cpoin) {
- fstyle->align= UI_STYLE_TEXT_RIGHT;
+ if (cpoin) {
+ fstyle->align = UI_STYLE_TEXT_RIGHT;
rect->xmax -= ui_but_draw_menu_icon(but) ? UI_DPI_ICON_SIZE : 5;
- uiStyleFontDraw(fstyle, rect, cpoin+1);
- *cpoin= '|';
+ uiStyleFontDraw(fstyle, rect, cpoin + 1);
+ *cpoin = '|';
}
}
@@ -1187,7 +1224,7 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *but, rcti *rect)
{
- if(but==NULL) return;
+ if (but == NULL) return;
/* clip but->drawstr to fit in available space */
if (but->editstr && but->pos >= 0) {
@@ -1202,24 +1239,24 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
else if ((but->block->flag & UI_BLOCK_LOOP) && (but->type == BUT)) {
ui_text_leftclip(fstyle, but, rect);
}
- else but->ofs= 0;
+ else but->ofs = 0;
/* check for button text label */
if (but->type == ICONTEXTROW) {
- widget_draw_icon(but, (BIFIconID) (but->icon+but->iconadd), 1.0f, rect);
+ widget_draw_icon(but, (BIFIconID) (but->icon + but->iconadd), 1.0f, rect);
}
else {
- if(but->type==BUT_TOGDUAL) {
- int dualset= 0;
- if(but->pointype==SHO)
- dualset= BTST( *(((short *)but->poin)+1), but->bitnr);
- else if(but->pointype==INT)
- dualset= BTST( *(((int *)but->poin)+1), but->bitnr);
+ if (but->type == BUT_TOGDUAL) {
+ int dualset = 0;
+ if (but->pointype == SHO)
+ dualset = BTST(*(((short *)but->poin) + 1), but->bitnr);
+ else if (but->pointype == INT)
+ dualset = BTST(*(((int *)but->poin) + 1), but->bitnr);
- widget_draw_icon(but, ICON_DOT, dualset?1.0f:0.25f, rect);
+ widget_draw_icon(but, ICON_DOT, dualset ? 1.0f : 0.25f, rect);
}
- else if(but->type==MENU && (but->flag & UI_BUT_NODE_LINK)) {
+ else if (but->type == MENU && (but->flag & UI_BUT_NODE_LINK)) {
int tmp = rect->xmin;
rect->xmin = rect->xmax - (rect->ymax - rect->ymin) - 1;
widget_draw_icon(but, ICON_LAYER_USED, 1.0f, rect);
@@ -1227,17 +1264,17 @@ 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);
+ widget_draw_icon(but, but->icon + but->iconadd, 1.0f, rect);
- rect->xmin += (int)((float)UI_icon_get_width(but->icon+but->iconadd) * UI_DPI_ICON_FAC);
+ rect->xmin += (int)((float)UI_icon_get_width(but->icon + but->iconadd) * UI_DPI_ICON_FAC);
- if(but->editstr || (but->flag & UI_TEXT_LEFT))
+ if (but->editstr || (but->flag & UI_TEXT_LEFT))
rect->xmin += 5;
}
- else if((but->flag & UI_TEXT_LEFT))
+ else if ((but->flag & UI_TEXT_LEFT))
rect->xmin += 5;
/* always draw text for textbutton cursor */
@@ -1251,18 +1288,17 @@ 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= {
+static struct uiWidgetStateColors wcol_state_colors = {
{115, 190, 76, 255},
{90, 166, 51, 255},
{240, 235, 100, 255},
@@ -1272,19 +1308,19 @@ 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= {
+static struct uiWidgetColors wcol_num = {
{25, 25, 25, 255},
{180, 180, 180, 255},
{153, 153, 153, 255},
@@ -1297,7 +1333,7 @@ static struct uiWidgetColors wcol_num= {
-20, 0
};
-static struct uiWidgetColors wcol_numslider= {
+static struct uiWidgetColors wcol_numslider = {
{25, 25, 25, 255},
{180, 180, 180, 255},
{153, 153, 153, 255},
@@ -1310,7 +1346,7 @@ static struct uiWidgetColors wcol_numslider= {
-20, 0
};
-static struct uiWidgetColors wcol_text= {
+static struct uiWidgetColors wcol_text = {
{25, 25, 25, 255},
{153, 153, 153, 255},
{153, 153, 153, 255},
@@ -1323,7 +1359,7 @@ static struct uiWidgetColors wcol_text= {
0, 25
};
-static struct uiWidgetColors wcol_option= {
+static struct uiWidgetColors wcol_option = {
{0, 0, 0, 255},
{70, 70, 70, 255},
{70, 70, 70, 255},
@@ -1337,7 +1373,7 @@ static struct uiWidgetColors wcol_option= {
};
/* button that shows popup */
-static struct uiWidgetColors wcol_menu= {
+static struct uiWidgetColors wcol_menu = {
{0, 0, 0, 255},
{70, 70, 70, 255},
{70, 70, 70, 255},
@@ -1351,7 +1387,7 @@ static struct uiWidgetColors wcol_menu= {
};
/* button that starts pulldown */
-static struct uiWidgetColors wcol_pulldown= {
+static struct uiWidgetColors wcol_pulldown = {
{0, 0, 0, 255},
{63, 63, 63, 255},
{86, 128, 194, 255},
@@ -1365,11 +1401,11 @@ static struct uiWidgetColors wcol_pulldown= {
};
/* button inside menu */
-static struct uiWidgetColors wcol_menu_item= {
+static struct uiWidgetColors wcol_menu_item = {
{0, 0, 0, 255},
{0, 0, 0, 0},
{86, 128, 194, 255},
- {255, 255, 255, 255},
+ {172, 172, 172, 128},
{255, 255, 255, 255},
{0, 0, 0, 255},
@@ -1379,7 +1415,7 @@ static struct uiWidgetColors wcol_menu_item= {
};
/* backdrop menu + title text color */
-static struct uiWidgetColors wcol_menu_back= {
+static struct uiWidgetColors wcol_menu_back = {
{0, 0, 0, 255},
{25, 25, 25, 230},
{45, 45, 45, 230},
@@ -1392,8 +1428,21 @@ static struct uiWidgetColors wcol_menu_back= {
25, -20
};
+/* tooltip colour */
+static struct uiWidgetColors wcol_tooltip = {
+ {0, 0, 0, 255},
+ {25, 25, 25, 230},
+ {45, 45, 45, 230},
+ {100, 100, 100, 255},
+
+ {160, 160, 160, 255},
+ {255, 255, 255, 255},
-static struct uiWidgetColors wcol_radio= {
+ 0,
+ 25, -20
+};
+
+static struct uiWidgetColors wcol_radio = {
{0, 0, 0, 255},
{70, 70, 70, 255},
{86, 128, 194, 255},
@@ -1406,7 +1455,7 @@ static struct uiWidgetColors wcol_radio= {
15, -15
};
-static struct uiWidgetColors wcol_regular= {
+static struct uiWidgetColors wcol_regular = {
{25, 25, 25, 255},
{153, 153, 153, 255},
{100, 100, 100, 255},
@@ -1419,7 +1468,7 @@ static struct uiWidgetColors wcol_regular= {
0, 0
};
-static struct uiWidgetColors wcol_tool= {
+static struct uiWidgetColors wcol_tool = {
{25, 25, 25, 255},
{153, 153, 153, 255},
{100, 100, 100, 255},
@@ -1432,7 +1481,7 @@ static struct uiWidgetColors wcol_tool= {
15, -15
};
-static struct uiWidgetColors wcol_box= {
+static struct uiWidgetColors wcol_box = {
{25, 25, 25, 255},
{128, 128, 128, 255},
{100, 100, 100, 255},
@@ -1445,7 +1494,7 @@ static struct uiWidgetColors wcol_box= {
0, 0
};
-static struct uiWidgetColors wcol_toggle= {
+static struct uiWidgetColors wcol_toggle = {
{25, 25, 25, 255},
{153, 153, 153, 255},
{100, 100, 100, 255},
@@ -1458,7 +1507,7 @@ static struct uiWidgetColors wcol_toggle= {
0, 0
};
-static struct uiWidgetColors wcol_scroll= {
+static struct uiWidgetColors wcol_scroll = {
{50, 50, 50, 180},
{80, 80, 80, 180},
{100, 100, 100, 180},
@@ -1471,7 +1520,7 @@ static struct uiWidgetColors wcol_scroll= {
5, -5
};
-static struct uiWidgetColors wcol_progress= {
+static struct uiWidgetColors wcol_progress = {
{0, 0, 0, 255},
{190, 190, 190, 255},
{100, 100, 100, 180},
@@ -1484,7 +1533,7 @@ static struct uiWidgetColors wcol_progress= {
0, 0
};
-static struct uiWidgetColors wcol_list_item= {
+static struct uiWidgetColors wcol_list_item = {
{0, 0, 0, 255},
{0, 0, 0, 0},
{86, 128, 194, 255},
@@ -1498,7 +1547,7 @@ static struct uiWidgetColors wcol_list_item= {
};
/* free wcol struct to play with */
-static struct uiWidgetColors wcol_tmp= {
+static struct uiWidgetColors wcol_tmp = {
{0, 0, 0, 255},
{128, 128, 128, 255},
{100, 100, 100, 255},
@@ -1515,80 +1564,81 @@ static struct uiWidgetColors wcol_tmp= {
/* called for theme init (new theme) and versions */
void ui_widget_color_init(ThemeUI *tui)
{
- tui->wcol_regular= wcol_regular;
- tui->wcol_tool= wcol_tool;
- tui->wcol_text= wcol_text;
- tui->wcol_radio= wcol_radio;
- tui->wcol_option= wcol_option;
- tui->wcol_toggle= wcol_toggle;
- tui->wcol_num= wcol_num;
- tui->wcol_numslider= wcol_numslider;
- tui->wcol_menu= wcol_menu;
- tui->wcol_pulldown= wcol_pulldown;
- tui->wcol_menu_back= wcol_menu_back;
- tui->wcol_menu_item= wcol_menu_item;
- tui->wcol_box= wcol_box;
- tui->wcol_scroll= wcol_scroll;
- tui->wcol_list_item= wcol_list_item;
- tui->wcol_progress= wcol_progress;
-
- tui->wcol_state= wcol_state_colors;
+ tui->wcol_regular = wcol_regular;
+ tui->wcol_tool = wcol_tool;
+ tui->wcol_text = wcol_text;
+ tui->wcol_radio = wcol_radio;
+ tui->wcol_option = wcol_option;
+ tui->wcol_toggle = wcol_toggle;
+ tui->wcol_num = wcol_num;
+ tui->wcol_numslider = wcol_numslider;
+ tui->wcol_menu = wcol_menu;
+ tui->wcol_pulldown = wcol_pulldown;
+ tui->wcol_menu_back = wcol_menu_back;
+ tui->wcol_tooltip = wcol_tooltip;
+ tui->wcol_menu_item = wcol_menu_item;
+ tui->wcol_box = wcol_box;
+ tui->wcol_scroll = wcol_scroll;
+ tui->wcol_list_item = wcol_list_item;
+ tui->wcol_progress = wcol_progress;
+
+ tui->wcol_state = wcol_state_colors;
}
/* ************ button callbacks, state ***************** */
static void widget_state_blend(char cp[3], const char cpstate[3], const float fac)
{
- if(fac != 0.0f) {
- cp[0]= (int)((1.0f-fac)*cp[0] + fac*cpstate[0]);
- cp[1]= (int)((1.0f-fac)*cp[1] + fac*cpstate[1]);
- cp[2]= (int)((1.0f-fac)*cp[2] + fac*cpstate[2]);
+ if (fac != 0.0f) {
+ cp[0] = (int)((1.0f - fac) * cp[0] + fac * cpstate[0]);
+ cp[1] = (int)((1.0f - fac) * cp[1] + fac * cpstate[1]);
+ cp[2] = (int)((1.0f - fac) * cp[2] + fac * cpstate[2]);
}
}
/* copy colors from theme, and set changes in it based on state */
static void widget_state(uiWidgetType *wt, int state)
{
- uiWidgetStateColors *wcol_state= wt->wcol_state;
+ uiWidgetStateColors *wcol_state = wt->wcol_state;
- wt->wcol= *(wt->wcol_theme);
+ wt->wcol = *(wt->wcol_theme);
- if(state & UI_SELECT) {
+ if (state & UI_SELECT) {
copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel);
- if(state & UI_BUT_ANIMATED_KEY)
+ if (state & UI_BUT_ANIMATED_KEY)
widget_state_blend(wt->wcol.inner, wcol_state->inner_key_sel, wcol_state->blend);
- else if(state & UI_BUT_ANIMATED)
+ else if (state & UI_BUT_ANIMATED)
widget_state_blend(wt->wcol.inner, wcol_state->inner_anim_sel, wcol_state->blend);
- else if(state & UI_BUT_DRIVEN)
+ else if (state & UI_BUT_DRIVEN)
widget_state_blend(wt->wcol.inner, wcol_state->inner_driven_sel, wcol_state->blend);
copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel);
- if(state & UI_SELECT)
+ if (state & UI_SELECT)
SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown);
}
else {
- if(state & UI_BUT_ANIMATED_KEY)
+ if (state & UI_BUT_ANIMATED_KEY)
widget_state_blend(wt->wcol.inner, wcol_state->inner_key, wcol_state->blend);
- else if(state & UI_BUT_ANIMATED)
+ else if (state & UI_BUT_ANIMATED)
widget_state_blend(wt->wcol.inner, wcol_state->inner_anim, wcol_state->blend);
- else if(state & UI_BUT_DRIVEN)
+ else if (state & UI_BUT_DRIVEN)
widget_state_blend(wt->wcol.inner, wcol_state->inner_driven, wcol_state->blend);
- if(state & UI_ACTIVE) { /* mouse over? */
- wt->wcol.inner[0]= wt->wcol.inner[0]>=240? 255 : wt->wcol.inner[0]+15;
- wt->wcol.inner[1]= wt->wcol.inner[1]>=240? 255 : wt->wcol.inner[1]+15;
- wt->wcol.inner[2]= wt->wcol.inner[2]>=240? 255 : wt->wcol.inner[2]+15;
+ if (state & UI_ACTIVE) { /* mouse over? */
+ wt->wcol.inner[0] = wt->wcol.inner[0] >= 240 ? 255 : wt->wcol.inner[0] + 15;
+ wt->wcol.inner[1] = wt->wcol.inner[1] >= 240 ? 255 : wt->wcol.inner[1] + 15;
+ wt->wcol.inner[2] = wt->wcol.inner[2] >= 240 ? 255 : wt->wcol.inner[2] + 15;
}
}
- if(state & UI_BUT_REDALERT) {
- char red[4]= {255, 0, 0};
+ if (state & UI_BUT_REDALERT) {
+ char red[4] = {255, 0, 0};
widget_state_blend(wt->wcol.inner, red, 0.4f);
}
- if(state & UI_BUT_NODE_ACTIVE) {
- char blue[4]= {86, 128, 194};
+ if (state & UI_BUT_NODE_ACTIVE) {
+ char blue[4] = {86, 128, 194};
widget_state_blend(wt->wcol.inner, blue, 0.3f);
}
}
@@ -1596,32 +1646,32 @@ static void widget_state(uiWidgetType *wt, int state)
/* sliders use special hack which sets 'item' as inner when drawing filling */
static void widget_state_numslider(uiWidgetType *wt, int state)
{
- uiWidgetStateColors *wcol_state= wt->wcol_state;
- float blend= wcol_state->blend - 0.2f; // XXX special tweak to make sure that bar will still be visible
+ uiWidgetStateColors *wcol_state = wt->wcol_state;
+ float blend = wcol_state->blend - 0.2f; // XXX special tweak to make sure that bar will still be visible
/* call this for option button */
widget_state(wt, state);
/* now, set the inner-part so that it reflects state settings too */
// TODO: maybe we should have separate settings for the blending colors used for this case?
- if(state & UI_SELECT) {
+ if (state & UI_SELECT) {
- if(state & UI_BUT_ANIMATED_KEY)
+ if (state & UI_BUT_ANIMATED_KEY)
widget_state_blend(wt->wcol.item, wcol_state->inner_key_sel, blend);
- else if(state & UI_BUT_ANIMATED)
+ else if (state & UI_BUT_ANIMATED)
widget_state_blend(wt->wcol.item, wcol_state->inner_anim_sel, blend);
- else if(state & UI_BUT_DRIVEN)
+ else if (state & UI_BUT_DRIVEN)
widget_state_blend(wt->wcol.item, wcol_state->inner_driven_sel, blend);
- if(state & UI_SELECT)
+ if (state & UI_SELECT)
SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown);
}
else {
- if(state & UI_BUT_ANIMATED_KEY)
+ if (state & UI_BUT_ANIMATED_KEY)
widget_state_blend(wt->wcol.item, wcol_state->inner_key, blend);
- else if(state & UI_BUT_ANIMATED)
+ else if (state & UI_BUT_ANIMATED)
widget_state_blend(wt->wcol.item, wcol_state->inner_anim, blend);
- else if(state & UI_BUT_DRIVEN)
+ else if (state & UI_BUT_DRIVEN)
widget_state_blend(wt->wcol.item, wcol_state->inner_driven, blend);
}
}
@@ -1632,7 +1682,7 @@ static void widget_state_label(uiWidgetType *wt, int state)
/* call this for option button */
widget_state(wt, state);
- if(state & UI_SELECT)
+ if (state & UI_SELECT)
UI_GetThemeColor4ubv(TH_TEXT_HI, (unsigned char *)wt->wcol.text);
else
UI_GetThemeColor4ubv(TH_TEXT, (unsigned char *)wt->wcol.text);
@@ -1647,10 +1697,10 @@ static void widget_state_option_menu(uiWidgetType *wt, int state)
widget_state(wt, state);
/* if not selected we get theme from menu back */
- if(state & UI_SELECT)
+ if (state & UI_SELECT)
UI_GetThemeColor4ubv(TH_TEXT_HI, (unsigned char *)wt->wcol.text);
else {
- bTheme *btheme= UI_GetTheme(); /* XXX */
+ bTheme *btheme = UI_GetTheme(); /* XXX */
copy_v3_v3_char(wt->wcol.text, btheme->tui.wcol_menu_back.text);
}
@@ -1659,32 +1709,32 @@ static void widget_state_option_menu(uiWidgetType *wt, int state)
static void widget_state_nothing(uiWidgetType *wt, int UNUSED(state))
{
- wt->wcol= *(wt->wcol_theme);
+ wt->wcol = *(wt->wcol_theme);
}
/* special case, button that calls pulldown */
static void widget_state_pulldown(uiWidgetType *wt, int state)
{
- wt->wcol= *(wt->wcol_theme);
+ wt->wcol = *(wt->wcol_theme);
copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel);
copy_v3_v3_char(wt->wcol.outline, wt->wcol.inner);
- if(state & UI_ACTIVE)
+ if (state & UI_ACTIVE)
copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel);
}
/* special case, menu items */
static void widget_state_menu_item(uiWidgetType *wt, int state)
{
- wt->wcol= *(wt->wcol_theme);
+ wt->wcol = *(wt->wcol_theme);
- if(state & (UI_BUT_DISABLED|UI_BUT_INACTIVE)) {
- wt->wcol.text[0]= 0.5f*(wt->wcol.text[0]+wt->wcol.text_sel[0]);
- wt->wcol.text[1]= 0.5f*(wt->wcol.text[1]+wt->wcol.text_sel[1]);
- wt->wcol.text[2]= 0.5f*(wt->wcol.text[2]+wt->wcol.text_sel[2]);
+ if (state & (UI_BUT_DISABLED | UI_BUT_INACTIVE)) {
+ wt->wcol.text[0] = 0.5f * (wt->wcol.text[0] + wt->wcol.text_sel[0]);
+ wt->wcol.text[1] = 0.5f * (wt->wcol.text[1] + wt->wcol.text_sel[1]);
+ wt->wcol.text[2] = 0.5f * (wt->wcol.text[2] + wt->wcol.text_sel[2]);
}
- else if(state & UI_ACTIVE) {
+ else if (state & UI_ACTIVE) {
copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel);
copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel);
}
@@ -1697,27 +1747,27 @@ static void widget_state_menu_item(uiWidgetType *wt, int state)
static void widget_softshadow(rcti *rect, int roundboxalign, float radin, float radout)
{
uiWidgetBase wtb;
- rcti rect1= *rect;
+ rcti rect1 = *rect;
float alpha, alphastep;
int step, totvert;
- float quad_strip[WIDGET_SIZE_MAX*2][2];
+ float quad_strip[WIDGET_SIZE_MAX * 2][2];
/* prevent tooltips to not show round shadow */
- if( 2.0f*radout > 0.2f*(rect1.ymax-rect1.ymin) )
- rect1.ymax -= 0.2f*(rect1.ymax-rect1.ymin);
+ if (2.0f * radout > 0.2f * (rect1.ymax - rect1.ymin) )
+ rect1.ymax -= 0.2f * (rect1.ymax - rect1.ymin);
else
- rect1.ymax -= 2.0f*radout;
+ rect1.ymax -= 2.0f * radout;
/* inner part */
- totvert= round_box_shadow_edges(wtb.inner_v, &rect1, radin, roundboxalign & (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT), 0.0f);
+ totvert = round_box_shadow_edges(wtb.inner_v, &rect1, radin, roundboxalign & (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT), 0.0f);
/* inverse linear shadow alpha */
- alpha= 0.15;
- alphastep= 0.67;
+ alpha = 0.15;
+ alphastep = 0.67;
glEnableClientState(GL_VERTEX_ARRAY);
- for(step= 1; step<=radout; step++, alpha*=alphastep) {
+ for (step = 1; step <= radout; step++, alpha *= alphastep) {
round_box_shadow_edges(wtb.outer_v, &rect1, radin, UI_CNR_ALL, (float)step);
glColor4f(0.0f, 0.0f, 0.0f, alpha);
@@ -1725,7 +1775,7 @@ static void widget_softshadow(rcti *rect, int roundboxalign, float radin, float
widget_verts_to_quad_strip_open(&wtb, totvert, quad_strip);
glVertexPointer(2, GL_FLOAT, 0, quad_strip);
- glDrawArrays(GL_QUAD_STRIP, 0, totvert*2);
+ glDrawArrays(GL_QUAD_STRIP, 0, totvert * 2);
}
glDisableClientState(GL_VERTEX_ARRAY);
@@ -1734,7 +1784,7 @@ static void widget_softshadow(rcti *rect, int roundboxalign, float radin, float
static void widget_menu_back(uiWidgetColors *wcol, rcti *rect, int flag, int direction)
{
uiWidgetBase wtb;
- int roundboxalign= UI_CNR_ALL;
+ int roundboxalign = UI_CNR_ALL;
widget_init(&wtb);
@@ -1744,11 +1794,11 @@ static void widget_menu_back(uiWidgetColors *wcol, rcti *rect, int flag, int dir
//rect->ymax += 4.0;
}
else if (direction == UI_DOWN) {
- roundboxalign= (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT);
+ roundboxalign = (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT);
rect->ymin -= 4.0;
}
else if (direction == UI_TOP) {
- roundboxalign= UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT;
+ roundboxalign = UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT;
rect->ymax += 4.0;
}
@@ -1756,7 +1806,7 @@ static void widget_menu_back(uiWidgetColors *wcol, rcti *rect, int flag, int dir
widget_softshadow(rect, roundboxalign, 5.0f, 8.0f);
round_box_edges(&wtb, roundboxalign, rect, 5.0f);
- wtb.emboss= 0;
+ wtb.emboss = 0;
widgetbase_draw(&wtb, wcol);
glDisable(GL_BLEND);
@@ -1770,14 +1820,14 @@ static void ui_hsv_cursor(float x, float y)
glTranslatef(x, y, 0.0f);
glColor3f(1.0f, 1.0f, 1.0f);
- glutil_draw_filled_arc(0.0f, M_PI*2.0, 3.0f, 8);
+ glutil_draw_filled_arc(0.0f, M_PI * 2.0, 3.0f, 8);
glEnable(GL_BLEND);
- glEnable(GL_LINE_SMOOTH );
+ glEnable(GL_LINE_SMOOTH);
glColor3f(0.0f, 0.0f, 0.0f);
- glutil_draw_lined_arc(0.0f, M_PI*2.0, 3.0f, 12);
+ glutil_draw_lined_arc(0.0f, M_PI * 2.0, 3.0f, 12);
glDisable(GL_BLEND);
- glDisable(GL_LINE_SMOOTH );
+ glDisable(GL_LINE_SMOOTH);
glPopMatrix();
@@ -1786,51 +1836,51 @@ static void ui_hsv_cursor(float x, float y)
void ui_hsvcircle_vals_from_pos(float *valrad, float *valdist, rcti *rect, float mx, float my)
{
/* duplication of code... well, simple is better now */
- float centx= (float)(rect->xmin + rect->xmax)/2;
- float centy= (float)(rect->ymin + rect->ymax)/2;
+ float centx = (float)(rect->xmin + rect->xmax) / 2;
+ float centy = (float)(rect->ymin + rect->ymax) / 2;
float radius, dist;
- if( rect->xmax-rect->xmin > rect->ymax-rect->ymin )
- radius= (float)(rect->ymax - rect->ymin)/2;
+ if (rect->xmax - rect->xmin > rect->ymax - rect->ymin)
+ radius = (float)(rect->ymax - rect->ymin) / 2;
else
- radius= (float)(rect->xmax - rect->xmin)/2;
+ radius = (float)(rect->xmax - rect->xmin) / 2;
- mx-= centx;
- my-= centy;
- dist= sqrt( mx*mx + my*my);
- if(dist < radius)
- *valdist= dist/radius;
+ mx -= centx;
+ my -= centy;
+ dist = sqrt(mx * mx + my * my);
+ if (dist < radius)
+ *valdist = dist / radius;
else
- *valdist= 1.0f;
+ *valdist = 1.0f;
- *valrad= atan2f(mx, my)/(2.0f*(float)M_PI) + 0.5f;
+ *valrad = atan2f(mx, my) / (2.0f * (float)M_PI) + 0.5f;
}
static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect)
{
/* gouraud triangle fan */
- float radstep, ang= 0.0f;
+ float radstep, ang = 0.0f;
float centx, centy, radius, cursor_radius;
float rgb[3], hsvo[3], hsv[3], col[3], colcent[3];
- int a, tot= 32;
+ int a, tot = 32;
int color_profile = but->block->color_profile;
if (but->rnaprop && RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA)
color_profile = BLI_PR_NONE;
- radstep= 2.0f*(float)M_PI/(float)tot;
- centx= (float)(rect->xmin + rect->xmax)/2;
- centy= (float)(rect->ymin + rect->ymax)/2;
+ radstep = 2.0f * (float)M_PI / (float)tot;
+ centx = (float)(rect->xmin + rect->xmax) / 2;
+ centy = (float)(rect->ymin + rect->ymax) / 2;
- if( rect->xmax-rect->xmin > rect->ymax-rect->ymin )
- radius= (float)(rect->ymax - rect->ymin)/2;
+ if (rect->xmax - rect->xmin > rect->ymax - rect->ymin)
+ radius = (float)(rect->ymax - rect->ymin) / 2;
else
- radius= (float)(rect->xmax - rect->xmin)/2;
+ radius = (float)(rect->xmax - rect->xmin) / 2;
/* color */
ui_get_but_vectorf(but, rgb);
copy_v3_v3(hsv, ui_block_hsv_get(but->block));
- rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+ rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2);
copy_v3_v3(hsvo, hsv);
/* exception: if 'lock' is set
@@ -1841,24 +1891,24 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect)
else if (color_profile)
hsv[2] = linearrgb_to_srgb(hsv[2]);
- hsv_to_rgb(0.f, 0.f, hsv[2], colcent, colcent+1, colcent+2);
+ hsv_to_rgb(0.f, 0.f, hsv[2], colcent, colcent + 1, colcent + 2);
glShadeModel(GL_SMOOTH);
glBegin(GL_TRIANGLE_FAN);
glColor3fv(colcent);
- glVertex2f( centx, centy);
+ glVertex2f(centx, centy);
- for(a=0; a<=tot; a++, ang+=radstep) {
- float si= sin(ang);
- float co= cos(ang);
+ for (a = 0; a <= tot; a++, ang += radstep) {
+ float si = sin(ang);
+ float co = cos(ang);
- ui_hsvcircle_vals_from_pos(hsv, hsv+1, rect, centx + co*radius, centy + si*radius);
+ ui_hsvcircle_vals_from_pos(hsv, hsv + 1, rect, centx + co * radius, centy + si * radius);
CLAMP(hsv[2], 0.0f, 1.0f); /* for display only */
- hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
+ hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col + 1, col + 2);
glColor3fv(col);
- glVertex2f( centx + co*radius, centy + si*radius);
+ glVertex2f(centx + co * radius, centy + si * radius);
}
glEnd();
@@ -1868,23 +1918,23 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect)
glPushMatrix();
glTranslatef(centx, centy, 0.0f);
glEnable(GL_BLEND);
- glEnable(GL_LINE_SMOOTH );
- glColor3ubv((unsigned char*)wcol->outline);
- glutil_draw_lined_arc(0.0f, M_PI*2.0, radius, tot + 1);
+ glEnable(GL_LINE_SMOOTH);
+ glColor3ubv((unsigned char *)wcol->outline);
+ glutil_draw_lined_arc(0.0f, M_PI * 2.0, radius, tot + 1);
glDisable(GL_BLEND);
- glDisable(GL_LINE_SMOOTH );
+ glDisable(GL_LINE_SMOOTH);
glPopMatrix();
/* cursor */
- ang= 2.0f*(float)M_PI*hsvo[0] + 0.5f*(float)M_PI;
+ ang = 2.0f * (float)M_PI * hsvo[0] + 0.5f * (float)M_PI;
- if(but->flag & UI_BUT_COLOR_CUBIC)
+ if (but->flag & UI_BUT_COLOR_CUBIC)
cursor_radius = (1.0f - powf(1.0f - hsvo[1], 3.0f));
else
cursor_radius = hsvo[1];
- radius= CLAMPIS(cursor_radius, 0.0f, 1.0f) * radius;
- ui_hsv_cursor(centx + cosf(-ang)*radius, centy + sinf(-ang)*radius);
+ radius = CLAMPIS(cursor_radius, 0.0f, 1.0f) * radius;
+ ui_hsv_cursor(centx + cosf(-ang) * radius, centy + sinf(-ang) * radius);
}
/* ************ custom buttons, old stuff ************** */
@@ -1893,15 +1943,15 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect)
void ui_draw_gradient(rcti *rect, const float hsv[3], int type, float alpha)
{
int a;
- float h= hsv[0], s= hsv[1], v= hsv[2];
+ float h = hsv[0], s = hsv[1], v = hsv[2];
float dx, dy, sx1, sx2, sy;
- float col0[4][3]; // left half, rect bottom to top
- float col1[4][3]; // right half, rect bottom to top
+ float col0[4][3]; // left half, rect bottom to top
+ float col1[4][3]; // right half, rect bottom to top
/* draw series of gouraud rects */
glShadeModel(GL_SMOOTH);
- switch(type) {
+ switch (type) {
case UI_GRAD_SV:
hsv_to_rgb(h, 0.0, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
hsv_to_rgb(h, 0.333, 0.0, &col1[1][0], &col1[1][1], &col1[1][2]);
@@ -1948,7 +1998,7 @@ void ui_draw_gradient(rcti *rect, const float hsv[3], int type, float alpha)
/* old below */
- for(dx=0.0f; dx<1.0f; dx+= 0.05f) {
+ for (dx = 0.0f; dx < 1.0f; dx += 0.05f) {
// previous color
copy_v3_v3(col0[0], col1[0]);
copy_v3_v3(col0[1], col1[1]);
@@ -1956,7 +2006,7 @@ void ui_draw_gradient(rcti *rect, const float hsv[3], int type, float alpha)
copy_v3_v3(col0[3], col1[3]);
// new color
- switch(type) {
+ switch (type) {
case UI_GRAD_SV:
hsv_to_rgb(h, 0.0, dx, &col1[0][0], &col1[0][1], &col1[0][2]);
hsv_to_rgb(h, 0.333, dx, &col1[1][0], &col1[1][1], &col1[1][2]);
@@ -1996,24 +2046,24 @@ void ui_draw_gradient(rcti *rect, const float hsv[3], int type, float alpha)
}
// rect
- sx1= rect->xmin + dx*(rect->xmax-rect->xmin);
- sx2= rect->xmin + (dx+0.05f)*(rect->xmax-rect->xmin);
- sy= rect->ymin;
- dy= (rect->ymax-rect->ymin)/3.0;
+ sx1 = rect->xmin + dx * (rect->xmax - rect->xmin);
+ sx2 = rect->xmin + (dx + 0.05f) * (rect->xmax - rect->xmin);
+ sy = rect->ymin;
+ dy = (rect->ymax - rect->ymin) / 3.0;
glBegin(GL_QUADS);
- for(a=0; a<3; a++, sy+=dy) {
+ for (a = 0; a < 3; a++, sy += dy) {
glColor4f(col0[a][0], col0[a][1], col0[a][2], alpha);
glVertex2f(sx1, sy);
glColor4f(col1[a][0], col1[a][1], col1[a][2], alpha);
glVertex2f(sx2, sy);
- glColor4f(col1[a+1][0], col1[a+1][1], col1[a+1][2], alpha);
- glVertex2f(sx2, sy+dy);
+ glColor4f(col1[a + 1][0], col1[a + 1][1], col1[a + 1][2], alpha);
+ glVertex2f(sx2, sy + dy);
- glColor4f(col0[a+1][0], col0[a+1][1], col0[a+1][2], alpha);
- glVertex2f(sx1, sy+dy);
+ glColor4f(col0[a + 1][0], col0[a + 1][1], col0[a + 1][2], alpha);
+ glVertex2f(sx1, sy + dy);
}
glEnd();
}
@@ -2026,44 +2076,44 @@ void ui_draw_gradient(rcti *rect, const float hsv[3], int type, float alpha)
static void ui_draw_but_HSVCUBE(uiBut *but, rcti *rect)
{
- float rgb[3], h,s,v;
- float x=0.0f, y=0.0f;
- float *hsv= ui_block_hsv_get(but->block);
+ float rgb[3], h, s, v;
+ float x = 0.0f, y = 0.0f;
+ float *hsv = ui_block_hsv_get(but->block);
float hsvn[3];
- h= hsv[0];
- s= hsv[1];
- v= hsv[2];
+ h = hsv[0];
+ s = hsv[1];
+ v = hsv[2];
ui_get_but_vectorf(but, rgb);
rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], &h, &s, &v);
- hsvn[0]= h;
- hsvn[1]= s;
- hsvn[2]= v;
+ hsvn[0] = h;
+ hsvn[1] = s;
+ hsvn[2] = v;
ui_draw_gradient(rect, hsvn, but->a1, 1.f);
- switch((int)but->a1) {
+ switch ((int)but->a1) {
case UI_GRAD_SV:
- x= v; y= s; break;
+ x = v; y = s; break;
case UI_GRAD_HV:
- x= h; y= v; break;
+ x = h; y = v; break;
case UI_GRAD_HS:
- x= h; y= s; break;
+ x = h; y = s; break;
case UI_GRAD_H:
- x= h; y= 0.5; break;
+ x = h; y = 0.5; break;
case UI_GRAD_S:
- x= s; y= 0.5; break;
+ x = s; y = 0.5; break;
case UI_GRAD_V:
- x= v; y= 0.5; break;
+ x = v; y = 0.5; break;
}
/* cursor */
- x= rect->xmin + x*(rect->xmax-rect->xmin);
- y= rect->ymin + y*(rect->ymax-rect->ymin);
- CLAMP(x, rect->xmin+3.0f, rect->xmax-3.0f);
- CLAMP(y, rect->ymin+3.0f, rect->ymax-3.0f);
+ x = rect->xmin + x * (rect->xmax - rect->xmin);
+ y = rect->ymin + y * (rect->ymax - rect->ymin);
+ CLAMP(x, rect->xmin + 3.0f, rect->xmax - 3.0f);
+ CLAMP(y, rect->ymin + 3.0f, rect->ymax - 3.0f);
ui_hsv_cursor(x, y);
@@ -2076,7 +2126,7 @@ static void ui_draw_but_HSVCUBE(uiBut *but, rcti *rect)
static void ui_draw_but_HSV_v(uiBut *but, rcti *rect)
{
uiWidgetBase wtb;
- float rad= 0.5f*(rect->xmax - rect->xmin);
+ float rad = 0.5f * (rect->xmax - rect->xmin);
float x, y;
float rgb[3], hsv[3], v, range;
int color_profile = but->block->color_profile;
@@ -2085,7 +2135,7 @@ static void ui_draw_but_HSV_v(uiBut *but, rcti *rect)
color_profile = BLI_PR_NONE;
ui_get_but_vectorf(but, rgb);
- rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+ rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv + 1, hsv + 2);
v = hsv[2];
if (color_profile)
@@ -2093,7 +2143,7 @@ static void ui_draw_but_HSV_v(uiBut *but, rcti *rect)
/* map v from property range to [0,1] */
range = but->softmax - but->softmin;
- v = (v - but->softmin)/range;
+ v = (v - but->softmin) / range;
widget_init(&wtb);
@@ -2101,18 +2151,18 @@ static void ui_draw_but_HSV_v(uiBut *but, rcti *rect)
round_box_edges(&wtb, UI_CNR_ALL, rect, rad);
/* setup temp colors */
- wcol_tmp.outline[0]= wcol_tmp.outline[1]= wcol_tmp.outline[2]= 0;
- wcol_tmp.inner[0]= wcol_tmp.inner[1]= wcol_tmp.inner[2]= 128;
- wcol_tmp.shadetop= 127;
- wcol_tmp.shadedown= -128;
- wcol_tmp.shaded= 1;
+ wcol_tmp.outline[0] = wcol_tmp.outline[1] = wcol_tmp.outline[2] = 0;
+ wcol_tmp.inner[0] = wcol_tmp.inner[1] = wcol_tmp.inner[2] = 128;
+ wcol_tmp.shadetop = 127;
+ wcol_tmp.shadedown = -128;
+ wcol_tmp.shaded = 1;
widgetbase_draw(&wtb, &wcol_tmp);
/* cursor */
- x= rect->xmin + 0.5f * (rect->xmax-rect->xmin);
- y= rect->ymin + v * (rect->ymax-rect->ymin);
- CLAMP(y, rect->ymin+3.0f, rect->ymax-3.0f);
+ x = rect->xmin + 0.5f * (rect->xmax - rect->xmin);
+ y = rect->ymin + v * (rect->ymax - rect->ymin);
+ CLAMP(y, rect->ymin + 3.0f, rect->ymax - 3.0f);
ui_hsv_cursor(x, y);
@@ -2122,7 +2172,7 @@ static void ui_draw_but_HSV_v(uiBut *but, rcti *rect)
/* ************ separator, for menus etc ***************** */
static void ui_draw_separator(rcti *rect, uiWidgetColors *wcol)
{
- int y = rect->ymin + (rect->ymax - rect->ymin)/2 - 1;
+ int y = rect->ymin + (rect->ymax - rect->ymin) / 2 - 1;
unsigned char col[4];
col[0] = wcol->text[0];
@@ -2141,10 +2191,10 @@ static void ui_draw_separator(rcti *rect, uiWidgetColors *wcol)
static void widget_numbut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign)
{
uiWidgetBase wtb;
- float rad= 0.5f*(rect->ymax - rect->ymin);
- float textofs = rad*0.75f;
+ float rad = 0.5f * (rect->ymax - rect->ymin);
+ float textofs = rad * 0.75f;
- if(state & UI_SELECT)
+ if (state & UI_SELECT)
SWAP(short, wcol->shadetop, wcol->shadedown);
widget_init(&wtb);
@@ -2153,7 +2203,7 @@ static void widget_numbut(uiWidgetColors *wcol, rcti *rect, int state, int round
round_box_edges(&wtb, roundboxalign, rect, rad);
/* decoration */
- if(!(state & UI_TEXTINPUT)) {
+ if (!(state & UI_TEXTINPUT)) {
widget_num_tria(&wtb.tria1, rect, 0.6f, 'l');
widget_num_tria(&wtb.tria2, rect, 0.6f, 'r');
}
@@ -2170,31 +2220,31 @@ int ui_link_bezier_points(rcti *rect, float coord_array[][2], int resol)
{
float dist, vec[4][2];
- vec[0][0]= rect->xmin;
- vec[0][1]= rect->ymin;
- vec[3][0]= rect->xmax;
- vec[3][1]= rect->ymax;
+ vec[0][0] = rect->xmin;
+ vec[0][1] = rect->ymin;
+ vec[3][0] = rect->xmax;
+ vec[3][1] = rect->ymax;
- dist= 0.5f*ABS(vec[0][0] - vec[3][0]);
+ dist = 0.5f * ABS(vec[0][0] - vec[3][0]);
- vec[1][0]= vec[0][0]+dist;
- vec[1][1]= vec[0][1];
+ vec[1][0] = vec[0][0] + dist;
+ vec[1][1] = vec[0][1];
- vec[2][0]= vec[3][0]-dist;
- vec[2][1]= vec[3][1];
+ vec[2][0] = vec[3][0] - dist;
+ vec[2][1] = vec[3][1];
- forward_diff_bezier(vec[0][0], vec[1][0], vec[2][0], vec[3][0], coord_array[0], resol, sizeof(float)*2);
- forward_diff_bezier(vec[0][1], vec[1][1], vec[2][1], vec[3][1], coord_array[0]+1, resol, sizeof(float)*2);
+ forward_diff_bezier(vec[0][0], vec[1][0], vec[2][0], vec[3][0], coord_array[0], resol, sizeof(float) * 2);
+ forward_diff_bezier(vec[0][1], vec[1][1], vec[2][1], vec[3][1], coord_array[0] + 1, resol, sizeof(float) * 2);
return 1;
}
-#define LINK_RESOL 24
+#define LINK_RESOL 24
void ui_draw_link_bezier(rcti *rect)
{
- float coord_array[LINK_RESOL+1][2];
+ float coord_array[LINK_RESOL + 1][2];
- if(ui_link_bezier_points(rect, coord_array, LINK_RESOL)) {
+ if (ui_link_bezier_points(rect, coord_array, LINK_RESOL)) {
/* we can reuse the dist variable here to increment the GL curve eval amount*/
// const float dist= 1.0f/(float)LINK_RESOL; // UNUSED
@@ -2218,47 +2268,47 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int stat
uiWidgetBase wtb;
float rad;
int horizontal;
- short outline=0;
+ short outline = 0;
widget_init(&wtb);
/* determine horizontal/vertical */
- horizontal= (rect->xmax - rect->xmin > rect->ymax - rect->ymin);
+ horizontal = (rect->xmax - rect->xmin > rect->ymax - rect->ymin);
- if(horizontal)
- rad= 0.5f*(rect->ymax - rect->ymin);
+ if (horizontal)
+ rad = 0.5f * (rect->ymax - rect->ymin);
else
- rad= 0.5f*(rect->xmax - rect->xmin);
+ rad = 0.5f * (rect->xmax - rect->xmin);
- wtb.shadedir= (horizontal)? 1: 0;
+ wtb.shadedir = (horizontal) ? 1 : 0;
/* draw back part, colors swapped and shading inverted */
- if(horizontal)
+ if (horizontal)
SWAP(short, wcol->shadetop, wcol->shadedown);
round_box_edges(&wtb, UI_CNR_ALL, rect, rad);
widgetbase_draw(&wtb, wcol);
/* slider */
- if(slider->xmax-slider->xmin<2 || slider->ymax-slider->ymin<2);
+ if (slider->xmax - slider->xmin < 2 || slider->ymax - slider->ymin < 2) ;
else {
SWAP(short, wcol->shadetop, wcol->shadedown);
copy_v4_v4_char(wcol->inner, wcol->item);
- if(wcol->shadetop>wcol->shadedown)
- wcol->shadetop+= 20; /* XXX violates themes... */
- else wcol->shadedown+= 20;
+ if (wcol->shadetop > wcol->shadedown)
+ wcol->shadetop += 20; /* XXX violates themes... */
+ else wcol->shadedown += 20;
- if(state & UI_SCROLL_PRESSED) {
- wcol->inner[0]= wcol->inner[0]>=250? 255 : wcol->inner[0]+5;
- wcol->inner[1]= wcol->inner[1]>=250? 255 : wcol->inner[1]+5;
- wcol->inner[2]= wcol->inner[2]>=250? 255 : wcol->inner[2]+5;
+ if (state & UI_SCROLL_PRESSED) {
+ wcol->inner[0] = wcol->inner[0] >= 250 ? 255 : wcol->inner[0] + 5;
+ wcol->inner[1] = wcol->inner[1] >= 250 ? 255 : wcol->inner[1] + 5;
+ wcol->inner[2] = wcol->inner[2] >= 250 ? 255 : wcol->inner[2] + 5;
}
/* draw */
- wtb.emboss= 0; /* only emboss once */
+ wtb.emboss = 0; /* only emboss once */
/* exception for progress bar */
if (state & UI_SCROLL_NO_OUTLINE)
@@ -2266,13 +2316,13 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int stat
round_box_edges(&wtb, UI_CNR_ALL, slider, rad);
- if(state & UI_SCROLL_ARROWS) {
- if(wcol->item[0] > 48) wcol->item[0]-= 48;
- if(wcol->item[1] > 48) wcol->item[1]-= 48;
- if(wcol->item[2] > 48) wcol->item[2]-= 48;
- wcol->item[3]= 255;
+ if (state & UI_SCROLL_ARROWS) {
+ if (wcol->item[0] > 48) wcol->item[0] -= 48;
+ if (wcol->item[1] > 48) wcol->item[1] -= 48;
+ if (wcol->item[2] > 48) wcol->item[2] -= 48;
+ wcol->item[3] = 255;
- if(horizontal) {
+ if (horizontal) {
widget_scroll_circle(&wtb.tria1, slider, 0.6f, 'l');
widget_scroll_circle(&wtb.tria2, slider, 0.6f, 'r');
}
@@ -2296,56 +2346,56 @@ static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
int horizontal;
/* calculate slider part */
- value= ui_get_but_val(but);
+ value = ui_get_but_val(but);
- size= (but->softmax + but->a1 - but->softmin);
- size= MAX2(size, 2);
+ size = (but->softmax + but->a1 - but->softmin);
+ size = MAX2(size, 2);
/* position */
- rect1= *rect;
+ rect1 = *rect;
/* determine horizontal/vertical */
- horizontal= (rect->xmax - rect->xmin > rect->ymax - rect->ymin);
+ horizontal = (rect->xmax - rect->xmin > rect->ymax - rect->ymin);
- if(horizontal) {
- fac= (rect->xmax - rect->xmin)/(size);
- rect1.xmin= rect1.xmin + ceilf(fac*((float)value - but->softmin));
- rect1.xmax= rect1.xmin + ceilf(fac*(but->a1 - but->softmin));
+ if (horizontal) {
+ fac = (rect->xmax - rect->xmin) / (size);
+ rect1.xmin = rect1.xmin + ceilf(fac * ((float)value - but->softmin));
+ rect1.xmax = rect1.xmin + ceilf(fac * (but->a1 - but->softmin));
/* ensure minimium size */
- min= rect->ymax - rect->ymin;
+ min = rect->ymax - rect->ymin;
- if(rect1.xmax - rect1.xmin < min) {
- rect1.xmax= rect1.xmin + min;
+ if (rect1.xmax - rect1.xmin < min) {
+ rect1.xmax = rect1.xmin + min;
- if(rect1.xmax > rect->xmax) {
- rect1.xmax= rect->xmax;
- rect1.xmin= MAX2(rect1.xmax - min, rect->xmin);
+ if (rect1.xmax > rect->xmax) {
+ rect1.xmax = rect->xmax;
+ rect1.xmin = MAX2(rect1.xmax - min, rect->xmin);
}
}
}
else {
- fac= (rect->ymax - rect->ymin)/(size);
- rect1.ymax= rect1.ymax - ceilf(fac*((float)value - but->softmin));
- rect1.ymin= rect1.ymax - ceilf(fac*(but->a1 - but->softmin));
+ fac = (rect->ymax - rect->ymin) / (size);
+ rect1.ymax = rect1.ymax - ceilf(fac * ((float)value - but->softmin));
+ rect1.ymin = rect1.ymax - ceilf(fac * (but->a1 - but->softmin));
/* ensure minimium size */
- min= rect->xmax - rect->xmin;
+ min = rect->xmax - rect->xmin;
- if(rect1.ymax - rect1.ymin < min) {
- rect1.ymax= rect1.ymin + min;
+ if (rect1.ymax - rect1.ymin < min) {
+ rect1.ymax = rect1.ymin + min;
- if(rect1.ymax > rect->ymax) {
- rect1.ymax= rect->ymax;
- rect1.ymin= MAX2(rect1.ymax - min, rect->ymin);
+ if (rect1.ymax > rect->ymax) {
+ rect1.ymax = rect->ymax;
+ rect1.ymin = MAX2(rect1.ymax - min, rect->ymin);
}
}
}
- if(state & UI_SELECT)
- state= UI_SCROLL_PRESSED;
+ if (state & UI_SELECT)
+ state = UI_SCROLL_PRESSED;
else
- state= 0;
+ state = 0;
uiWidgetScrollDraw(wcol, rect, &rect1, state);
}
@@ -2363,7 +2413,7 @@ static void widget_progressbar(uiBut *but, uiWidgetColors *wcol, rcti *rect, int
w = value * (rect_prog.xmax - rect_prog.xmin);
/* ensure minimium size */
- min= rect_prog.ymax - rect_prog.ymin;
+ min = rect_prog.ymax - rect_prog.ymin;
w = MAX2(w, min);
rect_bar.xmax = rect_bar.xmin + w;
@@ -2378,15 +2428,15 @@ static void widget_progressbar(uiBut *but, uiWidgetColors *wcol, rcti *rect, int
static void widget_link(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect, int UNUSED(state), int UNUSED(roundboxalign))
{
- if(but->flag & UI_SELECT) {
+ if (but->flag & UI_SELECT) {
rcti rectlink;
UI_ThemeColor(TH_TEXT_HI);
- rectlink.xmin= (rect->xmin+rect->xmax)/2;
- rectlink.ymin= (rect->ymin+rect->ymax)/2;
- rectlink.xmax= but->linkto[0];
- rectlink.ymax= but->linkto[1];
+ rectlink.xmin = (rect->xmin + rect->xmax) / 2;
+ rectlink.ymin = (rect->ymin + rect->ymax) / 2;
+ rectlink.xmax = but->linkto[0];
+ rectlink.ymax = but->linkto[1];
ui_draw_link_bezier(&rectlink);
}
@@ -2406,54 +2456,54 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
/* backdrop first */
/* fully rounded */
- offs= 0.5f*(rect->ymax - rect->ymin);
- toffs = offs*0.75f;
+ offs = 0.5f * (rect->ymax - rect->ymin);
+ toffs = offs * 0.75f;
round_box_edges(&wtb, roundboxalign, rect, offs);
- wtb.outline= 0;
+ wtb.outline = 0;
widgetbase_draw(&wtb, wcol);
/* draw left/right parts only when not in text editing */
- if(!(state & UI_TEXTINPUT)) {
+ if (!(state & UI_TEXTINPUT)) {
- /* slider part */
+ /* slider part */
copy_v3_v3_char(outline, wcol->outline);
copy_v3_v3_char(wcol->outline, wcol->item);
copy_v3_v3_char(wcol->inner, wcol->item);
- if(!(state & UI_SELECT))
+ if (!(state & UI_SELECT))
SWAP(short, wcol->shadetop, wcol->shadedown);
- rect1= *rect;
+ rect1 = *rect;
- value= ui_get_but_val(but);
- fac= ((float)value-but->softmin)*(rect1.xmax - rect1.xmin - offs)/(but->softmax - but->softmin);
+ value = ui_get_but_val(but);
+ fac = ((float)value - but->softmin) * (rect1.xmax - rect1.xmin - offs) / (but->softmax - but->softmin);
/* left part of slider, always rounded */
- rect1.xmax= rect1.xmin + ceil(offs+1.0f);
+ rect1.xmax = rect1.xmin + ceil(offs + 1.0f);
round_box_edges(&wtb1, roundboxalign & ~(UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT), &rect1, offs);
- wtb1.outline= 0;
+ wtb1.outline = 0;
widgetbase_draw(&wtb1, wcol);
/* right part of slider, interpolate roundness */
- rect1.xmax= rect1.xmin + fac + offs;
- rect1.xmin+= floor(offs-1.0f);
- if(rect1.xmax + offs > rect->xmax)
- offs*= (rect1.xmax + offs - rect->xmax)/offs;
+ rect1.xmax = rect1.xmin + fac + offs;
+ rect1.xmin += floor(offs - 1.0f);
+ if (rect1.xmax + offs > rect->xmax)
+ offs *= (rect1.xmax + offs - rect->xmax) / offs;
else
- offs= 0.0f;
+ offs = 0.0f;
round_box_edges(&wtb1, roundboxalign & ~(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT), &rect1, offs);
widgetbase_draw(&wtb1, wcol);
copy_v3_v3_char(wcol->outline, outline);
- if(!(state & UI_SELECT))
+ if (!(state & UI_SELECT))
SWAP(short, wcol->shadetop, wcol->shadedown);
}
/* outline */
- wtb.outline= 1;
- wtb.inner= 0;
+ wtb.outline = 1;
+ wtb.inner = 0;
widgetbase_draw(&wtb, wcol);
/* text space */
@@ -2470,14 +2520,14 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
float col[4];
int color_profile = but->block->color_profile;
- col[3]= 1.0f;
+ col[3] = 1.0f;
if (but->rnaprop) {
if (RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA)
color_profile = BLI_PR_NONE;
- if(RNA_property_array_length(&but->rnapoin, but->rnaprop)==4) {
- col[3]= RNA_property_float_get_index(&but->rnapoin, but->rnaprop, 3);
+ if (RNA_property_array_length(&but->rnapoin, but->rnaprop) == 4) {
+ col[3] = RNA_property_float_get_index(&but->rnapoin, but->rnaprop, 3);
}
}
@@ -2488,15 +2538,15 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
ui_get_but_vectorf(but, col);
- if(state & (UI_BUT_ANIMATED|UI_BUT_ANIMATED_KEY|UI_BUT_DRIVEN|UI_BUT_REDALERT)) {
+ if (state & (UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN | UI_BUT_REDALERT)) {
// draw based on state - color for keyed etc
widgetbase_draw(&wtb, wcol);
// inset to draw swatch color
- rect->xmin+= SWATCH_KEYED_BORDER;
- rect->xmax-= SWATCH_KEYED_BORDER;
- rect->ymin+= SWATCH_KEYED_BORDER;
- rect->ymax-= SWATCH_KEYED_BORDER;
+ rect->xmin += SWATCH_KEYED_BORDER;
+ rect->xmax -= SWATCH_KEYED_BORDER;
+ rect->ymin += SWATCH_KEYED_BORDER;
+ rect->ymax -= SWATCH_KEYED_BORDER;
round_box_edges(&wtb, roundboxalign, rect, 5.0f);
}
@@ -2515,11 +2565,11 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
static void widget_icon_has_anim(uiBut *UNUSED(but), uiWidgetColors *wcol, rcti *rect, int state, int UNUSED(roundboxalign))
{
- if(state & (UI_BUT_ANIMATED|UI_BUT_ANIMATED_KEY|UI_BUT_DRIVEN|UI_BUT_REDALERT)) {
+ if (state & (UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN | UI_BUT_REDALERT)) {
uiWidgetBase wtb;
widget_init(&wtb);
- wtb.outline= 0;
+ wtb.outline = 0;
/* rounded */
round_box_edges(&wtb, UI_CNR_ALL, rect, 10.0f);
@@ -2532,7 +2582,7 @@ static void widget_textbut(uiWidgetColors *wcol, rcti *rect, int state, int roun
{
uiWidgetBase wtb;
- if(state & UI_SELECT)
+ if (state & UI_SELECT)
SWAP(short, wcol->shadetop, wcol->shadedown);
widget_init(&wtb);
@@ -2560,7 +2610,7 @@ static void widget_menubut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state),
widgetbase_draw(&wtb, wcol);
/* text space */
- rect->xmax -= (rect->ymax-rect->ymin);
+ rect->xmax -= (rect->ymax - rect->ymin);
}
static void widget_menuiconbut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign)
@@ -2580,7 +2630,7 @@ static void widget_menunodebut(uiWidgetColors *wcol, rcti *rect, int UNUSED(stat
{
/* silly node link button hacks */
uiWidgetBase wtb;
- uiWidgetColors wcol_backup= *wcol;
+ uiWidgetColors wcol_backup = *wcol;
widget_init(&wtb);
@@ -2596,14 +2646,14 @@ static void widget_menunodebut(uiWidgetColors *wcol, rcti *rect, int UNUSED(stat
/* decoration */
widgetbase_draw(&wtb, wcol);
- *wcol= wcol_backup;
+ *wcol = wcol_backup;
}
static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int UNUSED(roundboxalign))
{
- if(state & UI_ACTIVE) {
+ if (state & UI_ACTIVE) {
uiWidgetBase wtb;
- float rad= 0.5f*(rect->ymax - rect->ymin); // 4.0f
+ float rad = 0.5f * (rect->ymax - rect->ymin); // 4.0f
widget_init(&wtb);
@@ -2621,7 +2671,7 @@ static void widget_menu_itembut(uiWidgetColors *wcol, rcti *rect, int UNUSED(sta
widget_init(&wtb);
/* not rounded, no outline */
- wtb.outline= 0;
+ wtb.outline = 0;
round_box_edges(&wtb, 0, rect, 0.0f);
widgetbase_draw(&wtb, wcol);
@@ -2634,7 +2684,7 @@ static void widget_list_itembut(uiWidgetColors *wcol, rcti *rect, int UNUSED(sta
widget_init(&wtb);
/* rounded, but no outline */
- wtb.outline= 0;
+ wtb.outline = 0;
round_box_edges(&wtb, UI_CNR_ALL, rect, 4.0f);
widgetbase_draw(&wtb, wcol);
@@ -2643,33 +2693,33 @@ static void widget_list_itembut(uiWidgetColors *wcol, rcti *rect, int UNUSED(sta
static void widget_optionbut(uiWidgetColors *wcol, rcti *rect, int state, int UNUSED(roundboxalign))
{
uiWidgetBase wtb;
- rcti recttemp= *rect;
+ rcti recttemp = *rect;
int delta;
widget_init(&wtb);
/* square */
- recttemp.xmax= recttemp.xmin + (recttemp.ymax-recttemp.ymin);
+ recttemp.xmax = recttemp.xmin + (recttemp.ymax - recttemp.ymin);
/* smaller */
- delta= 1 + (recttemp.ymax-recttemp.ymin)/8;
- recttemp.xmin+= delta;
- recttemp.ymin+= delta;
- recttemp.xmax-= delta;
- recttemp.ymax-= delta;
+ delta = 1 + (recttemp.ymax - recttemp.ymin) / 8;
+ recttemp.xmin += delta;
+ recttemp.ymin += delta;
+ recttemp.xmax -= delta;
+ recttemp.ymax -= delta;
/* half rounded */
round_box_edges(&wtb, UI_CNR_ALL, &recttemp, 4.0f);
/* decoration */
- if(state & UI_SELECT) {
+ if (state & UI_SELECT) {
widget_check_trias(&wtb.tria1, &recttemp);
}
widgetbase_draw(&wtb, wcol);
/* text space */
- rect->xmin += (rect->ymax-rect->ymin)*0.7 + delta;
+ rect->xmin += (rect->ymax - rect->ymin) * 0.7 + delta;
}
@@ -2710,7 +2760,7 @@ static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED(
/* store the box bg as gl clearcolor, to retrieve later when drawing semi-transparent rects
* over the top to indicate disabled buttons */
/* XXX, this doesnt work right since the color applies to buttons outside the box too. */
- glClearColor(wcol->inner[0]/255.0, wcol->inner[1]/255.0, wcol->inner[2]/255.0, 1.0);
+ glClearColor(wcol->inner[0] / 255.0, wcol->inner[1] / 255.0, wcol->inner[2] / 255.0, 1.0);
copy_v3_v3_char(wcol->inner, old_col);
}
@@ -2731,7 +2781,7 @@ static void widget_but(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int
static void widget_roundbut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign)
{
uiWidgetBase wtb;
- float rad= 5.0f; //0.5f*(rect->ymax - rect->ymin);
+ float rad = 5.0f; //0.5f*(rect->ymax - rect->ymin);
widget_init(&wtb);
@@ -2747,11 +2797,11 @@ static void widget_draw_extra_mask(const bContext *C, uiBut *but, uiWidgetType *
unsigned char col[4];
/* state copy! */
- wt->wcol= *(wt->wcol_theme);
+ wt->wcol = *(wt->wcol_theme);
widget_init(&wtb);
- if(but->block->drawextra) {
+ if (but->block->drawextra) {
/* note: drawextra can change rect +1 or -1, to match round errors of existing previews */
but->block->drawextra(C, but->poin, but->block->drawextra_arg1, but->block->drawextra_arg2, rect);
@@ -2765,8 +2815,8 @@ static void widget_draw_extra_mask(const bContext *C, uiBut *but, uiWidgetType *
/* outline */
round_box_edges(&wtb, UI_CNR_ALL, rect, 5.0f);
- wtb.outline= 1;
- wtb.inner= 0;
+ wtb.outline = 1;
+ wtb.inner = 0;
widgetbase_draw(&wtb, &wt->wcol);
}
@@ -2784,68 +2834,73 @@ static void widget_disabled(rcti *rect)
/* need -1 and +1 to make it work right for aligned buttons,
* but problem may be somewhere else? */
- glRectf(rect->xmin-1, rect->ymin-1, rect->xmax, rect->ymax+1);
+ glRectf(rect->xmin - 1, rect->ymin - 1, rect->xmax, rect->ymax + 1);
glDisable(GL_BLEND);
}
static uiWidgetType *widget_type(uiWidgetTypeEnum type)
{
- bTheme *btheme= UI_GetTheme();
+ bTheme *btheme = UI_GetTheme();
static uiWidgetType wt;
/* defaults */
- wt.wcol_theme= &btheme->tui.wcol_regular;
- wt.wcol_state= &btheme->tui.wcol_state;
- wt.state= widget_state;
- wt.draw= widget_but;
- wt.custom= NULL;
- wt.text= widget_draw_text_icon;
-
- switch(type) {
+ wt.wcol_theme = &btheme->tui.wcol_regular;
+ wt.wcol_state = &btheme->tui.wcol_state;
+ wt.state = widget_state;
+ wt.draw = widget_but;
+ wt.custom = NULL;
+ wt.text = widget_draw_text_icon;
+
+ switch (type) {
case UI_WTYPE_REGULAR:
break;
case UI_WTYPE_LABEL:
- wt.draw= NULL;
- wt.state= widget_state_label;
+ wt.draw = NULL;
+ wt.state = widget_state_label;
break;
case UI_WTYPE_TOGGLE:
- wt.wcol_theme= &btheme->tui.wcol_toggle;
+ wt.wcol_theme = &btheme->tui.wcol_toggle;
break;
case UI_WTYPE_OPTION:
- wt.wcol_theme= &btheme->tui.wcol_option;
- wt.draw= widget_optionbut;
+ wt.wcol_theme = &btheme->tui.wcol_option;
+ wt.draw = widget_optionbut;
break;
case UI_WTYPE_RADIO:
- wt.wcol_theme= &btheme->tui.wcol_radio;
- wt.draw= widget_radiobut;
+ wt.wcol_theme = &btheme->tui.wcol_radio;
+ wt.draw = widget_radiobut;
break;
case UI_WTYPE_NUMBER:
- wt.wcol_theme= &btheme->tui.wcol_num;
- wt.draw= widget_numbut;
+ wt.wcol_theme = &btheme->tui.wcol_num;
+ wt.draw = widget_numbut;
break;
case UI_WTYPE_SLIDER:
- wt.wcol_theme= &btheme->tui.wcol_numslider;
- wt.custom= widget_numslider;
- wt.state= widget_state_numslider;
+ wt.wcol_theme = &btheme->tui.wcol_numslider;
+ wt.custom = widget_numslider;
+ wt.state = widget_state_numslider;
break;
case UI_WTYPE_EXEC:
- wt.wcol_theme= &btheme->tui.wcol_tool;
- wt.draw= widget_roundbut;
+ wt.wcol_theme = &btheme->tui.wcol_tool;
+ wt.draw = widget_roundbut;
+ break;
+
+ case UI_WTYPE_TOOLTIP:
+ wt.wcol_theme = &btheme->tui.wcol_tooltip;
+ wt.draw = widget_menu_back;
break;
- /* strings */
+ /* strings */
case UI_WTYPE_NAME:
- wt.wcol_theme= &btheme->tui.wcol_text;
- wt.draw= widget_textbut;
+ wt.wcol_theme = &btheme->tui.wcol_text;
+ wt.draw = widget_textbut;
break;
case UI_WTYPE_NAME_LINK:
@@ -2858,57 +2913,57 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type)
break;
- /* start menus */
+ /* start menus */
case UI_WTYPE_MENU_RADIO:
- wt.wcol_theme= &btheme->tui.wcol_menu;
- wt.draw= widget_menubut;
+ wt.wcol_theme = &btheme->tui.wcol_menu;
+ wt.draw = widget_menubut;
break;
case UI_WTYPE_MENU_ICON_RADIO:
- wt.wcol_theme= &btheme->tui.wcol_menu;
- wt.draw= widget_menuiconbut;
+ wt.wcol_theme = &btheme->tui.wcol_menu;
+ wt.draw = widget_menuiconbut;
break;
case UI_WTYPE_MENU_POINTER_LINK:
- wt.wcol_theme= &btheme->tui.wcol_menu;
- wt.draw= widget_menubut;
+ wt.wcol_theme = &btheme->tui.wcol_menu;
+ wt.draw = widget_menubut;
break;
case UI_WTYPE_MENU_NODE_LINK:
- wt.wcol_theme= &btheme->tui.wcol_menu;
- wt.draw= widget_menunodebut;
+ wt.wcol_theme = &btheme->tui.wcol_menu;
+ wt.draw = widget_menunodebut;
break;
case UI_WTYPE_PULLDOWN:
- wt.wcol_theme= &btheme->tui.wcol_pulldown;
- wt.draw= widget_pulldownbut;
- wt.state= widget_state_pulldown;
+ wt.wcol_theme = &btheme->tui.wcol_pulldown;
+ wt.draw = widget_pulldownbut;
+ wt.state = widget_state_pulldown;
break;
- /* in menus */
+ /* in menus */
case UI_WTYPE_MENU_ITEM:
- wt.wcol_theme= &btheme->tui.wcol_menu_item;
- wt.draw= widget_menu_itembut;
- wt.state= widget_state_menu_item;
+ wt.wcol_theme = &btheme->tui.wcol_menu_item;
+ wt.draw = widget_menu_itembut;
+ wt.state = widget_state_menu_item;
break;
case UI_WTYPE_MENU_BACK:
- wt.wcol_theme= &btheme->tui.wcol_menu_back;
- wt.draw= widget_menu_back;
+ wt.wcol_theme = &btheme->tui.wcol_menu_back;
+ wt.draw = widget_menu_back;
break;
- /* specials */
+ /* specials */
case UI_WTYPE_ICON:
- wt.custom= widget_icon_has_anim;
+ wt.custom = widget_icon_has_anim;
break;
case UI_WTYPE_SWATCH:
- wt.custom= widget_swatch;
+ wt.custom = widget_swatch;
break;
case UI_WTYPE_BOX:
- wt.custom= widget_box;
- wt.wcol_theme= &btheme->tui.wcol_box;
+ wt.custom = widget_box;
+ wt.wcol_theme = &btheme->tui.wcol_box;
break;
case UI_WTYPE_RGB_PICKER:
@@ -2918,19 +2973,19 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type)
break;
case UI_WTYPE_SCROLL:
- wt.wcol_theme= &btheme->tui.wcol_scroll;
- wt.state= widget_state_nothing;
- wt.custom= widget_scroll;
+ wt.wcol_theme = &btheme->tui.wcol_scroll;
+ wt.state = widget_state_nothing;
+ wt.custom = widget_scroll;
break;
case UI_WTYPE_LISTITEM:
- wt.wcol_theme= &btheme->tui.wcol_list_item;
- wt.draw= widget_list_itembut;
+ wt.wcol_theme = &btheme->tui.wcol_list_item;
+ wt.draw = widget_list_itembut;
break;
case UI_WTYPE_PROGRESSBAR:
- wt.wcol_theme= &btheme->tui.wcol_progress;
- wt.custom= widget_progressbar;
+ wt.wcol_theme = &btheme->tui.wcol_progress;
+ wt.custom = widget_progressbar;
break;
}
@@ -2941,14 +2996,14 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type)
static int widget_roundbox_set(uiBut *but, rcti *rect)
{
/* alignment */
- if(but->flag & UI_BUT_ALIGN) {
+ if (but->flag & UI_BUT_ALIGN) {
- if(but->flag & UI_BUT_ALIGN_TOP)
- rect->ymax+= 1;
- if(but->flag & UI_BUT_ALIGN_LEFT)
- rect->xmin-= 1;
+ if (but->flag & UI_BUT_ALIGN_TOP)
+ rect->ymax += 1;
+ if (but->flag & UI_BUT_ALIGN_LEFT)
+ rect->xmin -= 1;
- switch(but->flag & UI_BUT_ALIGN) {
+ switch (but->flag & UI_BUT_ALIGN) {
case UI_BUT_ALIGN_TOP:
return UI_CNR_BOTTOM_LEFT | UI_CNR_BOTTOM_RIGHT;
case UI_BUT_ALIGN_DOWN:
@@ -2976,13 +3031,13 @@ static int widget_roundbox_set(uiBut *but, rcti *rect)
/* conversion from old to new buttons, so still messy */
void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rcti *rect)
{
- bTheme *btheme= UI_GetTheme();
- ThemeUI *tui= &btheme->tui;
- uiFontStyle *fstyle= &style->widget;
- uiWidgetType *wt= NULL;
+ bTheme *btheme = UI_GetTheme();
+ ThemeUI *tui = &btheme->tui;
+ uiFontStyle *fstyle = &style->widget;
+ uiWidgetType *wt = NULL;
/* handle menus separately */
- if(but->dt==UI_EMBOSSP) {
+ if (but->dt == UI_EMBOSSP) {
switch (but->type) {
case LABEL:
widget_draw_text_icon(&style->widgetlabel, &tui->wcol_menu_back, but, rect);
@@ -2992,22 +3047,22 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
break;
default:
- wt= widget_type(UI_WTYPE_MENU_ITEM);
+ wt = widget_type(UI_WTYPE_MENU_ITEM);
}
}
- else if(but->dt==UI_EMBOSSN) {
+ else if (but->dt == UI_EMBOSSN) {
/* "nothing" */
- wt= widget_type(UI_WTYPE_ICON);
+ wt = widget_type(UI_WTYPE_ICON);
}
else {
switch (but->type) {
case LABEL:
- if(but->block->flag & UI_BLOCK_LOOP)
+ if (but->block->flag & UI_BLOCK_LOOP)
widget_draw_text_icon(&style->widgetlabel, &tui->wcol_menu_back, but, rect);
else {
- wt= widget_type(UI_WTYPE_LABEL);
- fstyle= &style->widgetlabel;
+ wt = widget_type(UI_WTYPE_LABEL);
+ fstyle = &style->widgetlabel;
}
break;
@@ -3015,90 +3070,90 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
break;
case BUT:
- wt= widget_type(UI_WTYPE_EXEC);
+ wt = widget_type(UI_WTYPE_EXEC);
break;
case NUM:
- wt= widget_type(UI_WTYPE_NUMBER);
+ wt = widget_type(UI_WTYPE_NUMBER);
break;
case NUMSLI:
case HSVSLI:
- wt= widget_type(UI_WTYPE_SLIDER);
+ wt = widget_type(UI_WTYPE_SLIDER);
break;
case ROW:
- wt= widget_type(UI_WTYPE_RADIO);
+ wt = widget_type(UI_WTYPE_RADIO);
break;
case LISTROW:
- wt= widget_type(UI_WTYPE_LISTITEM);
+ wt = widget_type(UI_WTYPE_LISTITEM);
break;
case TEX:
- wt= widget_type(UI_WTYPE_NAME);
+ wt = widget_type(UI_WTYPE_NAME);
break;
case SEARCH_MENU:
- wt= widget_type(UI_WTYPE_NAME);
- if(but->block->flag & UI_BLOCK_LOOP)
- wt->wcol_theme= &btheme->tui.wcol_menu_back;
+ wt = widget_type(UI_WTYPE_NAME);
+ if (but->block->flag & UI_BLOCK_LOOP)
+ wt->wcol_theme = &btheme->tui.wcol_menu_back;
break;
case TOGBUT:
case TOG:
case TOGN:
case TOG3:
- wt= widget_type(UI_WTYPE_TOGGLE);
+ wt = widget_type(UI_WTYPE_TOGGLE);
break;
case OPTION:
case OPTIONN:
if (!(but->flag & UI_HAS_ICON)) {
- wt= widget_type(UI_WTYPE_OPTION);
+ wt = widget_type(UI_WTYPE_OPTION);
but->flag |= UI_TEXT_LEFT;
}
else
- wt= widget_type(UI_WTYPE_TOGGLE);
+ wt = widget_type(UI_WTYPE_TOGGLE);
/* option buttons have strings outside, on menus use different colors */
- if(but->block->flag & UI_BLOCK_LOOP)
- wt->state= widget_state_option_menu;
+ if (but->block->flag & UI_BLOCK_LOOP)
+ wt->state = widget_state_option_menu;
break;
case MENU:
case BLOCK:
case ICONTEXTROW:
- if(but->flag & UI_BUT_NODE_LINK)
- wt= widget_type(UI_WTYPE_MENU_NODE_LINK);
- else if(!but->str[0] && but->icon)
- wt= widget_type(UI_WTYPE_MENU_ICON_RADIO);
+ if (but->flag & UI_BUT_NODE_LINK)
+ wt = widget_type(UI_WTYPE_MENU_NODE_LINK);
+ else if (!but->str[0] && but->icon)
+ wt = widget_type(UI_WTYPE_MENU_ICON_RADIO);
else
- wt= widget_type(UI_WTYPE_MENU_RADIO);
+ wt = widget_type(UI_WTYPE_MENU_RADIO);
break;
case PULLDOWN:
- wt= widget_type(UI_WTYPE_PULLDOWN);
+ wt = widget_type(UI_WTYPE_PULLDOWN);
break;
case BUTM:
- wt= widget_type(UI_WTYPE_MENU_ITEM);
+ wt = widget_type(UI_WTYPE_MENU_ITEM);
break;
case COL:
- wt= widget_type(UI_WTYPE_SWATCH);
+ wt = widget_type(UI_WTYPE_SWATCH);
break;
case ROUNDBOX:
case LISTBOX:
- wt= widget_type(UI_WTYPE_BOX);
+ wt = widget_type(UI_WTYPE_BOX);
break;
case LINK:
case INLINK:
- wt= widget_type(UI_WTYPE_ICON);
- wt->custom= widget_link;
+ wt = widget_type(UI_WTYPE_ICON);
+ wt->custom = widget_link;
break;
@@ -3107,7 +3162,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
break;
case HSVCUBE:
- if(but->a1 == UI_GRAD_V_ALT) // vertical V slider, uses new widget draw now
+ if (but->a1 == UI_GRAD_V_ALT) // vertical V slider, uses new widget draw now
ui_draw_but_HSV_v(but, rect);
else // other HSV pickers...
ui_draw_but_HSVCUBE(but, rect);
@@ -3146,12 +3201,12 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
break;
case PROGRESSBAR:
- wt= widget_type(UI_WTYPE_PROGRESSBAR);
- fstyle= &style->widgetlabel;
+ wt = widget_type(UI_WTYPE_PROGRESSBAR);
+ fstyle = &style->widgetlabel;
break;
case SCROLL:
- wt= widget_type(UI_WTYPE_SCROLL);
+ wt = widget_type(UI_WTYPE_SCROLL);
break;
case TRACKPREVIEW:
@@ -3159,66 +3214,79 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
break;
default:
- wt= widget_type(UI_WTYPE_REGULAR);
+ wt = widget_type(UI_WTYPE_REGULAR);
}
}
- if(wt) {
- rcti disablerect= *rect; /* rect gets clipped smaller for text */
+ if (wt) {
+ rcti disablerect = *rect; /* rect gets clipped smaller for text */
int roundboxalign, state;
- roundboxalign= widget_roundbox_set(but, rect);
+ roundboxalign = widget_roundbox_set(but, rect);
- state= but->flag;
- if(but->editstr) state |= UI_TEXTINPUT;
+ state = but->flag;
+ if (but->editstr) state |= UI_TEXTINPUT;
wt->state(wt, state);
- if(wt->custom)
+ if (wt->custom)
wt->custom(but, &wt->wcol, rect, state, roundboxalign);
- else if(wt->draw)
+ else if (wt->draw)
wt->draw(&wt->wcol, rect, state, roundboxalign);
wt->text(fstyle, &wt->wcol, but, rect);
- if(state & (UI_BUT_DISABLED|UI_BUT_INACTIVE))
- if(but->dt!=UI_EMBOSSP)
+ if (state & (UI_BUT_DISABLED | UI_BUT_INACTIVE))
+ if (but->dt != UI_EMBOSSP)
widget_disabled(&disablerect);
}
}
void ui_draw_menu_back(uiStyle *UNUSED(style), uiBlock *block, rcti *rect)
{
- uiWidgetType *wt= widget_type(UI_WTYPE_MENU_BACK);
+ uiWidgetType *wt = widget_type(UI_WTYPE_MENU_BACK);
wt->state(wt, 0);
- if(block)
+ if (block)
wt->draw(&wt->wcol, rect, block->flag, block->direction);
else
wt->draw(&wt->wcol, rect, 0, 0);
- if(block) {
- if(block->flag & UI_BLOCK_CLIPTOP) {
+ if (block) {
+ if (block->flag & UI_BLOCK_CLIPTOP) {
/* XXX no scaling for UI here yet */
- glColor3ubv((unsigned char*)wt->wcol.text);
- UI_DrawTriIcon((rect->xmax+rect->xmin)/2, rect->ymax-8, 't');
+ glColor3ubv((unsigned char *)wt->wcol.text);
+ UI_DrawTriIcon((rect->xmax + rect->xmin) / 2, rect->ymax - 8, 't');
}
- if(block->flag & UI_BLOCK_CLIPBOTTOM) {
+ if (block->flag & UI_BLOCK_CLIPBOTTOM) {
/* XXX no scaling for UI here yet */
- glColor3ubv((unsigned char*)wt->wcol.text);
- UI_DrawTriIcon((rect->xmax+rect->xmin)/2, rect->ymin+10, 'v');
+ glColor3ubv((unsigned char *)wt->wcol.text);
+ UI_DrawTriIcon((rect->xmax + rect->xmin) / 2, rect->ymin + 10, 'v');
}
}
}
+uiWidgetColors *ui_tooltip_get_theme(void) {
+ uiWidgetType *wt = widget_type(UI_WTYPE_TOOLTIP);
+ return wt->wcol_theme;
+}
+
+void ui_draw_tooltip_background(uiStyle *UNUSED(style), uiBlock *UNUSED(block), rcti *rect)
+{
+ uiWidgetType *wt = widget_type(UI_WTYPE_TOOLTIP);
+ wt->state(wt, 0);
+ /* wt->draw ends up using same function to draw the tooltip as menu_back */
+ wt->draw(&wt->wcol, rect, 0, 0);
+}
+
void ui_draw_search_back(uiStyle *UNUSED(style), uiBlock *block, rcti *rect)
{
- uiWidgetType *wt= widget_type(UI_WTYPE_BOX);
+ uiWidgetType *wt = widget_type(UI_WTYPE_BOX);
glEnable(GL_BLEND);
widget_softshadow(rect, UI_CNR_ALL, 5.0f, 8.0f);
glDisable(GL_BLEND);
wt->state(wt, 0);
- if(block)
+ if (block)
wt->draw(&wt->wcol, rect, block->flag, UI_CNR_ALL);
else
wt->draw(&wt->wcol, rect, 0, UI_CNR_ALL);
@@ -3230,44 +3298,44 @@ void ui_draw_search_back(uiStyle *UNUSED(style), uiBlock *block, rcti *rect)
/* state: UI_ACTIVE or 0 */
void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, const char *name, int iconid, int state)
{
- uiWidgetType *wt= widget_type(UI_WTYPE_MENU_ITEM);
- rcti _rect= *rect;
+ uiWidgetType *wt = widget_type(UI_WTYPE_MENU_ITEM);
+ rcti _rect = *rect;
char *cpoin;
wt->state(wt, state);
wt->draw(&wt->wcol, rect, 0, 0);
uiStyleFontSet(fstyle);
- fstyle->align= UI_STYLE_TEXT_LEFT;
+ fstyle->align = UI_STYLE_TEXT_LEFT;
/* text location offset */
- rect->xmin+=5;
- if(iconid) rect->xmin+= UI_DPI_ICON_SIZE;
+ rect->xmin += 5;
+ if (iconid) rect->xmin += UI_DPI_ICON_SIZE;
/* cut string in 2 parts? */
- cpoin= strchr(name, '|');
- if(cpoin) {
- *cpoin= 0;
- rect->xmax -= BLF_width(fstyle->uifont_id, cpoin+1) + 10;
+ cpoin = strchr(name, '|');
+ if (cpoin) {
+ *cpoin = 0;
+ rect->xmax -= BLF_width(fstyle->uifont_id, cpoin + 1) + 10;
}
- glColor3ubv((unsigned char*)wt->wcol.text);
+ glColor3ubv((unsigned char *)wt->wcol.text);
uiStyleFontDraw(fstyle, rect, name);
/* part text right aligned */
- if(cpoin) {
- fstyle->align= UI_STYLE_TEXT_RIGHT;
- rect->xmax= _rect.xmax - 5;
- uiStyleFontDraw(fstyle, rect, cpoin+1);
- *cpoin= '|';
+ if (cpoin) {
+ fstyle->align = UI_STYLE_TEXT_RIGHT;
+ rect->xmax = _rect.xmax - 5;
+ uiStyleFontDraw(fstyle, rect, cpoin + 1);
+ *cpoin = '|';
}
/* restore rect, was messed with */
- *rect= _rect;
+ *rect = _rect;
- if(iconid) {
- int xs= rect->xmin+4;
- int ys= 1 + (rect->ymin+rect->ymax- UI_DPI_ICON_SIZE)/2;
+ if (iconid) {
+ int xs = rect->xmin + 4;
+ int ys = 1 + (rect->ymin + rect->ymax - UI_DPI_ICON_SIZE) / 2;
glEnable(GL_BLEND);
UI_icon_draw_aspect(xs, ys, iconid, 1.2f, 0.5f); /* XXX scale weak get from fstyle? */
glDisable(GL_BLEND);
@@ -3278,7 +3346,7 @@ void ui_draw_preview_item(uiFontStyle *fstyle, rcti *rect, const char *name, int
{
rcti trect = *rect, bg_rect;
float font_dims[2] = {0.0f, 0.0f};
- uiWidgetType *wt= widget_type(UI_WTYPE_MENU_ITEM);
+ uiWidgetType *wt = widget_type(UI_WTYPE_MENU_ITEM);
unsigned char bg_col[3];
wt->state(wt, state);
@@ -3293,26 +3361,28 @@ void ui_draw_preview_item(uiFontStyle *fstyle, rcti *rect, const char *name, int
trect.xmax = trect.xmin + font_dims[0] + 10;
trect.ymin += 10;
trect.ymax = trect.ymin + font_dims[1];
- if(trect.xmax > rect->xmax - PREVIEW_PAD)
+ if (trect.xmax > rect->xmax - PREVIEW_PAD)
trect.xmax = rect->xmax - PREVIEW_PAD;
bg_rect = trect;
bg_rect.xmin = rect->xmin + PREVIEW_PAD;
bg_rect.ymin = rect->ymin + PREVIEW_PAD;
- bg_rect.xmax += PREVIEW_PAD / 2;
+ bg_rect.xmax = rect->xmax - PREVIEW_PAD;
bg_rect.ymax += PREVIEW_PAD / 2;
- if(bg_rect.xmax > rect->xmax - PREVIEW_PAD)
+ if (bg_rect.xmax > rect->xmax - PREVIEW_PAD)
bg_rect.xmax = rect->xmax - PREVIEW_PAD;
UI_GetThemeColor3ubv(TH_BUTBACK, bg_col);
- glColor3ubv(bg_col);
+ glColor4ubv((unsigned char *)wt->wcol.item);
+ glEnable(GL_BLEND);
glRecti(bg_rect.xmin, bg_rect.ymin, bg_rect.xmax, bg_rect.ymax);
+ glDisable(GL_BLEND);
if (state == UI_ACTIVE)
- glColor3ubv((unsigned char*)wt->wcol.text);
+ glColor3ubv((unsigned char *)wt->wcol.text);
else
- glColor3ubv((unsigned char*)wt->wcol.text_sel);
+ glColor3ubv((unsigned char *)wt->wcol.text_sel);
uiStyleFontDraw(fstyle, &trect, name);
}
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 3dadd69c9f4..9f4a351c66d 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -43,6 +43,7 @@
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
+#include "BLI_math.h"
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
@@ -60,9 +61,9 @@
/* global for themes */
typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha);
-static bTheme *theme_active=NULL;
-static int theme_spacetype= SPACE_VIEW3D;
-static int theme_regionid= RGN_TYPE_WINDOW;
+static bTheme *theme_active = NULL;
+static int theme_spacetype = SPACE_VIEW3D;
+static int theme_regionid = RGN_TYPE_WINDOW;
void ui_resources_init(void)
{
@@ -81,385 +82,393 @@ void ui_resources_free(void)
const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
{
- ThemeSpace *ts= NULL;
- static char error[4]={240, 0, 240, 255};
- static char alert[4]={240, 60, 60, 255};
- static char headerdesel[4]={0,0,0,255};
+ ThemeSpace *ts = NULL;
+ static char error[4] = {240, 0, 240, 255};
+ static char alert[4] = {240, 60, 60, 255};
+ static char headerdesel[4] = {0, 0, 0, 255};
- const char *cp= error;
+ const char *cp = error;
- if(btheme) {
+ if (btheme) {
// first check for ui buttons theme
- if(colorid < TH_THEMEUI) {
+ if (colorid < TH_THEMEUI) {
- switch(colorid) {
+ switch (colorid) {
- case TH_REDALERT:
- cp= alert; break;
+ case TH_REDALERT:
+ cp = alert; break;
}
}
else {
- switch(spacetype) {
- case SPACE_BUTS:
- ts= &btheme->tbuts;
- break;
- case SPACE_VIEW3D:
- ts= &btheme->tv3d;
- break;
- case SPACE_IPO:
- ts= &btheme->tipo;
- break;
- case SPACE_FILE:
- ts= &btheme->tfile;
- break;
- case SPACE_NLA:
- ts= &btheme->tnla;
- break;
- case SPACE_ACTION:
- ts= &btheme->tact;
- break;
- case SPACE_SEQ:
- ts= &btheme->tseq;
- break;
- case SPACE_IMAGE:
- ts= &btheme->tima;
- break;
- case SPACE_TEXT:
- ts= &btheme->text;
- break;
- case SPACE_OUTLINER:
- ts= &btheme->toops;
- break;
- case SPACE_INFO:
- ts= &btheme->tinfo;
- break;
- case SPACE_USERPREF:
- ts= &btheme->tuserpref;
- break;
- case SPACE_CONSOLE:
- ts= &btheme->tconsole;
- break;
- case SPACE_TIME:
- ts= &btheme->ttime;
- break;
- case SPACE_NODE:
- ts= &btheme->tnode;
- break;
- case SPACE_LOGIC:
- ts= &btheme->tlogic;
- break;
- case SPACE_CLIP:
- ts= &btheme->tclip;
- break;
- default:
- ts= &btheme->tv3d;
- break;
+ switch (spacetype) {
+ case SPACE_BUTS:
+ ts = &btheme->tbuts;
+ break;
+ case SPACE_VIEW3D:
+ ts = &btheme->tv3d;
+ break;
+ case SPACE_IPO:
+ ts = &btheme->tipo;
+ break;
+ case SPACE_FILE:
+ ts = &btheme->tfile;
+ break;
+ case SPACE_NLA:
+ ts = &btheme->tnla;
+ break;
+ case SPACE_ACTION:
+ ts = &btheme->tact;
+ break;
+ case SPACE_SEQ:
+ ts = &btheme->tseq;
+ break;
+ case SPACE_IMAGE:
+ ts = &btheme->tima;
+ break;
+ case SPACE_TEXT:
+ ts = &btheme->text;
+ break;
+ case SPACE_OUTLINER:
+ ts = &btheme->toops;
+ break;
+ case SPACE_INFO:
+ ts = &btheme->tinfo;
+ break;
+ case SPACE_USERPREF:
+ ts = &btheme->tuserpref;
+ break;
+ case SPACE_CONSOLE:
+ ts = &btheme->tconsole;
+ break;
+ case SPACE_TIME:
+ ts = &btheme->ttime;
+ break;
+ case SPACE_NODE:
+ ts = &btheme->tnode;
+ break;
+ case SPACE_LOGIC:
+ ts = &btheme->tlogic;
+ break;
+ case SPACE_CLIP:
+ ts = &btheme->tclip;
+ break;
+ default:
+ ts = &btheme->tv3d;
+ break;
}
-
- switch(colorid) {
- case TH_BACK:
- if(theme_regionid==RGN_TYPE_WINDOW)
- cp= ts->back;
- else if(theme_regionid==RGN_TYPE_CHANNELS)
- cp= ts->list;
- else if(theme_regionid==RGN_TYPE_HEADER)
- cp= ts->header;
- else
- cp= ts->button;
- break;
- case TH_TEXT:
- if(theme_regionid==RGN_TYPE_WINDOW)
- cp= ts->text;
- else if(theme_regionid==RGN_TYPE_CHANNELS)
- cp= ts->list_text;
- else if(theme_regionid==RGN_TYPE_HEADER)
- cp= ts->header_text;
- else
- cp= ts->button_text;
- break;
- case TH_TEXT_HI:
- if(theme_regionid==RGN_TYPE_WINDOW)
- cp= ts->text_hi;
- else if(theme_regionid==RGN_TYPE_CHANNELS)
- cp= ts->list_text_hi;
- else if(theme_regionid==RGN_TYPE_HEADER)
- cp= ts->header_text_hi;
- else
- cp= ts->button_text_hi;
- break;
- case TH_TITLE:
- if(theme_regionid==RGN_TYPE_WINDOW)
- cp= ts->title;
- else if(theme_regionid==RGN_TYPE_CHANNELS)
- cp= ts->list_title;
- else if(theme_regionid==RGN_TYPE_HEADER)
- cp= ts->header_title;
- else
- cp= ts->button_title;
- break;
-
- case TH_HEADER:
- cp= ts->header; break;
- case TH_HEADERDESEL:
- /* we calculate a dynamic builtin header deselect color, also for pulldowns... */
- cp= ts->header;
- headerdesel[0]= cp[0]>10?cp[0]-10:0;
- headerdesel[1]= cp[1]>10?cp[1]-10:0;
- headerdesel[2]= cp[2]>10?cp[2]-10:0;
- cp= headerdesel;
- break;
- case TH_HEADER_TEXT:
- cp= ts->header_text; break;
- case TH_HEADER_TEXT_HI:
- cp= ts->header_text_hi; break;
-
- case TH_PANEL:
- cp= ts->panel; break;
- case TH_PANEL_TEXT:
- cp= ts->panel_text; break;
- case TH_PANEL_TEXT_HI:
- cp= ts->panel_text_hi; break;
-
- case TH_BUTBACK:
- cp= ts->button; break;
- case TH_BUTBACK_TEXT:
- cp= ts->button_text; break;
- case TH_BUTBACK_TEXT_HI:
- cp= ts->button_text_hi; break;
-
- case TH_SHADE1:
- cp= ts->shade1; break;
- case TH_SHADE2:
- cp= ts->shade2; break;
- case TH_HILITE:
- cp= ts->hilite; break;
-
- case TH_GRID:
- cp= ts->grid; break;
- case TH_WIRE:
- cp= ts->wire; break;
- case TH_LAMP:
- cp= ts->lamp; break;
- case TH_SPEAKER:
- cp= ts->speaker; break;
- case TH_SELECT:
- cp= ts->select; break;
- case TH_ACTIVE:
- cp= ts->active; break;
- case TH_GROUP:
- cp= ts->group; break;
- case TH_GROUP_ACTIVE:
- cp= ts->group_active; break;
- case TH_TRANSFORM:
- cp= ts->transform; break;
- case TH_VERTEX:
- cp= ts->vertex; break;
- case TH_VERTEX_SELECT:
- cp= ts->vertex_select; break;
- case TH_VERTEX_SIZE:
- cp= &ts->vertex_size; break;
- case TH_OUTLINE_WIDTH:
- cp= &ts->outline_width; break;
- case TH_EDGE:
- cp= ts->edge; break;
- case TH_EDGE_SELECT:
- cp= ts->edge_select; break;
- case TH_EDGE_SEAM:
- cp= ts->edge_seam; break;
- case TH_EDGE_SHARP:
- cp= ts->edge_sharp; break;
- case TH_EDGE_CREASE:
- cp= ts->edge_crease; break;
- case TH_EDITMESH_ACTIVE:
- cp= ts->editmesh_active; break;
- case TH_EDGE_FACESEL:
- cp= ts->edge_facesel; break;
- case TH_FACE:
- cp= ts->face; break;
- case TH_FACE_SELECT:
- cp= ts->face_select; break;
- case TH_FACE_DOT:
- cp= ts->face_dot; break;
- case TH_FACEDOT_SIZE:
- cp= &ts->facedot_size; break;
- case TH_DRAWEXTRA_EDGELEN:
- cp= ts->extra_edge_len; break;
- case TH_DRAWEXTRA_FACEAREA:
- cp= ts->extra_face_area; break;
- case TH_DRAWEXTRA_FACEANG:
- cp= ts->extra_face_angle; break;
- case TH_NORMAL:
- cp= ts->normal; break;
- case TH_VNORMAL:
- cp= ts->vertex_normal; break;
- case TH_BONE_SOLID:
- cp= ts->bone_solid; break;
- case TH_BONE_POSE:
- cp= ts->bone_pose; break;
- case TH_STRIP:
- cp= ts->strip; break;
- case TH_STRIP_SELECT:
- cp= ts->strip_select; break;
- case TH_CFRAME:
- cp= ts->cframe; break;
- case TH_NURB_ULINE:
- cp= ts->nurb_uline; break;
- case TH_NURB_VLINE:
- cp= ts->nurb_vline; break;
- case TH_NURB_SEL_ULINE:
- cp= ts->nurb_sel_uline; break;
- case TH_NURB_SEL_VLINE:
- cp= ts->nurb_sel_vline; break;
- case TH_ACTIVE_SPLINE:
- cp= ts->act_spline; break;
- case TH_LASTSEL_POINT:
- cp= ts->lastsel_point; break;
- case TH_HANDLE_FREE:
- cp= ts->handle_free; break;
- case TH_HANDLE_AUTO:
- cp= ts->handle_auto; break;
- case TH_HANDLE_AUTOCLAMP:
- cp= ts->handle_auto_clamped; break;
- case TH_HANDLE_VECT:
- cp= ts->handle_vect; break;
- case TH_HANDLE_ALIGN:
- cp= ts->handle_align; break;
- case TH_HANDLE_SEL_FREE:
- cp= ts->handle_sel_free; break;
- case TH_HANDLE_SEL_AUTO:
- cp= ts->handle_sel_auto; break;
- case TH_HANDLE_SEL_AUTOCLAMP:
- cp= ts->handle_sel_auto_clamped; break;
- case TH_HANDLE_SEL_VECT:
- cp= ts->handle_sel_vect; break;
- case TH_HANDLE_SEL_ALIGN:
- cp= ts->handle_sel_align; break;
-
- case TH_SYNTAX_B:
- cp= ts->syntaxb; break;
- case TH_SYNTAX_V:
- cp= ts->syntaxv; break;
- case TH_SYNTAX_C:
- cp= ts->syntaxc; break;
- case TH_SYNTAX_L:
- cp= ts->syntaxl; break;
- case TH_SYNTAX_N:
- cp= ts->syntaxn; break;
-
- case TH_NODE:
- cp= ts->syntaxl; break;
- case TH_NODE_IN_OUT:
- cp= ts->syntaxn; break;
- case TH_NODE_OPERATOR:
- cp= ts->syntaxb; break;
- case TH_NODE_CONVERTOR:
- cp= ts->syntaxv; break;
- case TH_NODE_GROUP:
- cp= ts->syntaxc; break;
- case TH_NODE_CURVING:
- cp= &ts->noodle_curving; break;
-
- case TH_SEQ_MOVIE:
- cp= ts->movie; break;
- case TH_SEQ_IMAGE:
- cp= ts->image; break;
- case TH_SEQ_SCENE:
- cp= ts->scene; break;
- case TH_SEQ_AUDIO:
- cp= ts->audio; break;
- case TH_SEQ_EFFECT:
- cp= ts->effect; break;
- case TH_SEQ_PLUGIN:
- cp= ts->plugin; break;
- case TH_SEQ_TRANSITION:
- cp= ts->transition; break;
- case TH_SEQ_META:
- cp= ts->meta; break;
-
- case TH_CONSOLE_OUTPUT:
- cp= ts->console_output; break;
- case TH_CONSOLE_INPUT:
- cp= ts-> console_input; break;
- case TH_CONSOLE_INFO:
- cp= ts->console_info; break;
- case TH_CONSOLE_ERROR:
- cp= ts->console_error; break;
- case TH_CONSOLE_CURSOR:
- cp= ts->console_cursor; break;
-
- case TH_HANDLE_VERTEX:
- cp= ts->handle_vertex;
- break;
- case TH_HANDLE_VERTEX_SELECT:
- cp= ts->handle_vertex_select;
- break;
- case TH_HANDLE_VERTEX_SIZE:
- cp= &ts->handle_vertex_size;
- break;
-
- case TH_DOPESHEET_CHANNELOB:
- cp= ts->ds_channel;
- break;
- case TH_DOPESHEET_CHANNELSUBOB:
- cp= ts->ds_subchannel;
- break;
-
- case TH_PREVIEW_BACK:
- cp= ts->preview_back;
- break;
-
- case TH_STITCH_PREVIEW_FACE:
- cp = ts->preview_stitch_face;
- break;
-
- case TH_STITCH_PREVIEW_EDGE:
- cp = ts->preview_stitch_edge;
- break;
-
- case TH_STITCH_PREVIEW_VERT:
- cp = ts->preview_stitch_vert;
- break;
-
- case TH_STITCH_PREVIEW_STITCHABLE:
- cp = ts->preview_stitch_stitchable;
- break;
-
- case TH_STITCH_PREVIEW_UNSTITCHABLE:
- cp = ts->preview_stitch_unstitchable;
- break;
- case TH_STITCH_PREVIEW_ACTIVE:
- cp = ts->preview_stitch_active;
- break;
- case TH_MARKER_OUTLINE:
- cp= ts->marker_outline; break;
- case TH_MARKER:
- cp= ts->marker; break;
- case TH_ACT_MARKER:
- cp= ts->act_marker; break;
- case TH_SEL_MARKER:
- cp= ts->sel_marker; break;
- case TH_BUNDLE_SOLID:
- cp= ts->bundle_solid; break;
- case TH_DIS_MARKER:
- cp= ts->dis_marker; break;
- case TH_PATH_BEFORE:
- cp= ts->path_before; break;
- case TH_PATH_AFTER:
- cp= ts->path_after; break;
- case TH_CAMERA_PATH:
- cp= ts->camera_path; break;
- case TH_LOCK_MARKER:
- cp= ts->lock_marker; break;
-
- case TH_MATCH:
- cp= ts->match;
- break;
-
- case TH_SELECT_HIGHLIGHT:
- cp= ts->selected_highlight;
- break;
+
+ switch (colorid) {
+ case TH_BACK:
+ if (theme_regionid == RGN_TYPE_WINDOW)
+ cp = ts->back;
+ else if (theme_regionid == RGN_TYPE_CHANNELS)
+ cp = ts->list;
+ else if (theme_regionid == RGN_TYPE_HEADER)
+ cp = ts->header;
+ else
+ cp = ts->button;
+ break;
+ case TH_TEXT:
+ if (theme_regionid == RGN_TYPE_WINDOW)
+ cp = ts->text;
+ else if (theme_regionid == RGN_TYPE_CHANNELS)
+ cp = ts->list_text;
+ else if (theme_regionid == RGN_TYPE_HEADER)
+ cp = ts->header_text;
+ else
+ cp = ts->button_text;
+ break;
+ case TH_TEXT_HI:
+ if (theme_regionid == RGN_TYPE_WINDOW)
+ cp = ts->text_hi;
+ else if (theme_regionid == RGN_TYPE_CHANNELS)
+ cp = ts->list_text_hi;
+ else if (theme_regionid == RGN_TYPE_HEADER)
+ cp = ts->header_text_hi;
+ else
+ cp = ts->button_text_hi;
+ break;
+ case TH_TITLE:
+ if (theme_regionid == RGN_TYPE_WINDOW)
+ cp = ts->title;
+ else if (theme_regionid == RGN_TYPE_CHANNELS)
+ cp = ts->list_title;
+ else if (theme_regionid == RGN_TYPE_HEADER)
+ cp = ts->header_title;
+ else
+ cp = ts->button_title;
+ break;
+
+ case TH_HEADER:
+ cp = ts->header; break;
+ case TH_HEADERDESEL:
+ /* we calculate a dynamic builtin header deselect color, also for pulldowns... */
+ cp = ts->header;
+ headerdesel[0] = cp[0] > 10 ? cp[0] - 10 : 0;
+ headerdesel[1] = cp[1] > 10 ? cp[1] - 10 : 0;
+ headerdesel[2] = cp[2] > 10 ? cp[2] - 10 : 0;
+ cp = headerdesel;
+ break;
+ case TH_HEADER_TEXT:
+ cp = ts->header_text; break;
+ case TH_HEADER_TEXT_HI:
+ cp = ts->header_text_hi; break;
+
+ case TH_PANEL:
+ cp = ts->panel; break;
+ case TH_PANEL_TEXT:
+ cp = ts->panel_text; break;
+ case TH_PANEL_TEXT_HI:
+ cp = ts->panel_text_hi; break;
+
+ case TH_BUTBACK:
+ cp = ts->button; break;
+ case TH_BUTBACK_TEXT:
+ cp = ts->button_text; break;
+ case TH_BUTBACK_TEXT_HI:
+ cp = ts->button_text_hi; break;
+
+ case TH_SHADE1:
+ cp = ts->shade1; break;
+ case TH_SHADE2:
+ cp = ts->shade2; break;
+ case TH_HILITE:
+ cp = ts->hilite; break;
+
+ case TH_GRID:
+ cp = ts->grid; break;
+ case TH_WIRE:
+ cp = ts->wire; break;
+ case TH_LAMP:
+ cp = ts->lamp; break;
+ case TH_SPEAKER:
+ cp = ts->speaker; break;
+ case TH_CAMERA:
+ cp = ts->camera; break;
+ case TH_EMPTY:
+ cp = ts->empty; break;
+ case TH_SELECT:
+ cp = ts->select; break;
+ case TH_ACTIVE:
+ cp = ts->active; break;
+ case TH_GROUP:
+ cp = ts->group; break;
+ case TH_GROUP_ACTIVE:
+ cp = ts->group_active; break;
+ case TH_TRANSFORM:
+ cp = ts->transform; break;
+ case TH_VERTEX:
+ cp = ts->vertex; break;
+ case TH_VERTEX_SELECT:
+ cp = ts->vertex_select; break;
+ case TH_VERTEX_SIZE:
+ cp = &ts->vertex_size; break;
+ case TH_OUTLINE_WIDTH:
+ cp = &ts->outline_width; break;
+ case TH_EDGE:
+ cp = ts->edge; break;
+ case TH_EDGE_SELECT:
+ cp = ts->edge_select; break;
+ case TH_EDGE_SEAM:
+ cp = ts->edge_seam; break;
+ case TH_EDGE_SHARP:
+ cp = ts->edge_sharp; break;
+ case TH_EDGE_CREASE:
+ cp = ts->edge_crease; break;
+ case TH_EDITMESH_ACTIVE:
+ cp = ts->editmesh_active; break;
+ case TH_EDGE_FACESEL:
+ cp = ts->edge_facesel; break;
+ case TH_FACE:
+ cp = ts->face; break;
+ case TH_FACE_SELECT:
+ cp = ts->face_select; break;
+ case TH_FACE_DOT:
+ cp = ts->face_dot; break;
+ case TH_FACEDOT_SIZE:
+ cp = &ts->facedot_size; break;
+ case TH_DRAWEXTRA_EDGELEN:
+ cp = ts->extra_edge_len; break;
+ case TH_DRAWEXTRA_FACEAREA:
+ cp = ts->extra_face_area; break;
+ case TH_DRAWEXTRA_FACEANG:
+ cp = ts->extra_face_angle; break;
+ case TH_NORMAL:
+ cp = ts->normal; break;
+ case TH_VNORMAL:
+ cp = ts->vertex_normal; break;
+ case TH_BONE_SOLID:
+ cp = ts->bone_solid; break;
+ case TH_BONE_POSE:
+ cp = ts->bone_pose; break;
+ case TH_STRIP:
+ cp = ts->strip; break;
+ case TH_STRIP_SELECT:
+ cp = ts->strip_select; break;
+ case TH_CFRAME:
+ cp = ts->cframe; break;
+ case TH_NURB_ULINE:
+ cp = ts->nurb_uline; break;
+ case TH_NURB_VLINE:
+ cp = ts->nurb_vline; break;
+ case TH_NURB_SEL_ULINE:
+ cp = ts->nurb_sel_uline; break;
+ case TH_NURB_SEL_VLINE:
+ cp = ts->nurb_sel_vline; break;
+ case TH_ACTIVE_SPLINE:
+ cp = ts->act_spline; break;
+ case TH_LASTSEL_POINT:
+ cp = ts->lastsel_point; break;
+ case TH_HANDLE_FREE:
+ cp = ts->handle_free; break;
+ case TH_HANDLE_AUTO:
+ cp = ts->handle_auto; break;
+ case TH_HANDLE_AUTOCLAMP:
+ cp = ts->handle_auto_clamped; break;
+ case TH_HANDLE_VECT:
+ cp = ts->handle_vect; break;
+ case TH_HANDLE_ALIGN:
+ cp = ts->handle_align; break;
+ case TH_HANDLE_SEL_FREE:
+ cp = ts->handle_sel_free; break;
+ case TH_HANDLE_SEL_AUTO:
+ cp = ts->handle_sel_auto; break;
+ case TH_HANDLE_SEL_AUTOCLAMP:
+ cp = ts->handle_sel_auto_clamped; break;
+ case TH_HANDLE_SEL_VECT:
+ cp = ts->handle_sel_vect; break;
+ case TH_HANDLE_SEL_ALIGN:
+ cp = ts->handle_sel_align; break;
+
+ case TH_SYNTAX_B:
+ cp = ts->syntaxb; break;
+ case TH_SYNTAX_V:
+ cp = ts->syntaxv; break;
+ case TH_SYNTAX_C:
+ cp = ts->syntaxc; break;
+ case TH_SYNTAX_L:
+ cp = ts->syntaxl; break;
+ case TH_SYNTAX_N:
+ cp = ts->syntaxn; break;
+
+ case TH_NODE:
+ cp = ts->syntaxl; break;
+ case TH_NODE_IN_OUT:
+ cp = ts->syntaxn; break;
+ case TH_NODE_OPERATOR:
+ cp = ts->syntaxb; break;
+ case TH_NODE_CONVERTOR:
+ cp = ts->syntaxv; break;
+ case TH_NODE_GROUP:
+ cp = ts->syntaxc; break;
+ case TH_NODE_CURVING:
+ cp = &ts->noodle_curving; break;
+
+ case TH_SEQ_MOVIE:
+ cp = ts->movie; break;
+ case TH_SEQ_MOVIECLIP:
+ cp = ts->movieclip; break;
+ case TH_SEQ_IMAGE:
+ cp = ts->image; break;
+ case TH_SEQ_SCENE:
+ cp = ts->scene; break;
+ case TH_SEQ_AUDIO:
+ cp = ts->audio; break;
+ case TH_SEQ_EFFECT:
+ cp = ts->effect; break;
+ case TH_SEQ_PLUGIN:
+ cp = ts->plugin; break;
+ case TH_SEQ_TRANSITION:
+ cp = ts->transition; break;
+ case TH_SEQ_META:
+ cp = ts->meta; break;
+ case TH_SEQ_PREVIEW:
+ cp = ts->preview_back; break;
+
+ case TH_CONSOLE_OUTPUT:
+ cp = ts->console_output; break;
+ case TH_CONSOLE_INPUT:
+ cp = ts->console_input; break;
+ case TH_CONSOLE_INFO:
+ cp = ts->console_info; break;
+ case TH_CONSOLE_ERROR:
+ cp = ts->console_error; break;
+ case TH_CONSOLE_CURSOR:
+ cp = ts->console_cursor; break;
+
+ case TH_HANDLE_VERTEX:
+ cp = ts->handle_vertex;
+ break;
+ case TH_HANDLE_VERTEX_SELECT:
+ cp = ts->handle_vertex_select;
+ break;
+ case TH_HANDLE_VERTEX_SIZE:
+ cp = &ts->handle_vertex_size;
+ break;
+
+ case TH_DOPESHEET_CHANNELOB:
+ cp = ts->ds_channel;
+ break;
+ case TH_DOPESHEET_CHANNELSUBOB:
+ cp = ts->ds_subchannel;
+ break;
+
+ case TH_PREVIEW_BACK:
+ cp = ts->preview_back;
+ break;
+
+ case TH_STITCH_PREVIEW_FACE:
+ cp = ts->preview_stitch_face;
+ break;
+
+ case TH_STITCH_PREVIEW_EDGE:
+ cp = ts->preview_stitch_edge;
+ break;
+
+ case TH_STITCH_PREVIEW_VERT:
+ cp = ts->preview_stitch_vert;
+ break;
+
+ case TH_STITCH_PREVIEW_STITCHABLE:
+ cp = ts->preview_stitch_stitchable;
+ break;
+
+ case TH_STITCH_PREVIEW_UNSTITCHABLE:
+ cp = ts->preview_stitch_unstitchable;
+ break;
+ case TH_STITCH_PREVIEW_ACTIVE:
+ cp = ts->preview_stitch_active;
+ break;
+ case TH_MARKER_OUTLINE:
+ cp = ts->marker_outline; break;
+ case TH_MARKER:
+ cp = ts->marker; break;
+ case TH_ACT_MARKER:
+ cp = ts->act_marker; break;
+ case TH_SEL_MARKER:
+ cp = ts->sel_marker; break;
+ case TH_BUNDLE_SOLID:
+ cp = ts->bundle_solid; break;
+ case TH_DIS_MARKER:
+ cp = ts->dis_marker; break;
+ case TH_PATH_BEFORE:
+ cp = ts->path_before; break;
+ case TH_PATH_AFTER:
+ cp = ts->path_after; break;
+ case TH_CAMERA_PATH:
+ cp = ts->camera_path; break;
+ case TH_LOCK_MARKER:
+ cp = ts->lock_marker; break;
+
+ case TH_MATCH:
+ cp = ts->match;
+ break;
+
+ case TH_SELECT_HIGHLIGHT:
+ cp = ts->selected_highlight;
+ break;
}
}
}
@@ -467,77 +476,72 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
return (unsigned char *)cp;
}
-
-#define SETCOL(col, r, g, b, a) col[0]=r; col[1]=g; col[2]= b; col[3]= a;
-#define SETCOLF(col, r, g, b, a) col[0]=r*255; col[1]=g*255; col[2]= b*255; col[3]= a*255;
-#define SETCOLTEST(col, r, g, b, a) if(col[3]==0) {col[0]=r; col[1]=g; col[2]= b; col[3]= a;}
-
/* use this call to init new bone color sets in Theme */
static void ui_theme_init_boneColorSets(bTheme *btheme)
{
int i;
/* define default color sets - currently we only define 15 of these, though that should be ample */
- /* set 1 */
- SETCOL(btheme->tarm[0].solid, 0x9a, 0x00, 0x00, 255);
- SETCOL(btheme->tarm[0].select, 0xbd, 0x11, 0x11, 255);
- SETCOL(btheme->tarm[0].active, 0xf7, 0x0a, 0x0a, 255);
- /* set 2 */
- SETCOL(btheme->tarm[1].solid, 0xf7, 0x40, 0x18, 255);
- SETCOL(btheme->tarm[1].select, 0xf6, 0x69, 0x13, 255);
- SETCOL(btheme->tarm[1].active, 0xfa, 0x99, 0x00, 255);
- /* set 3 */
- SETCOL(btheme->tarm[2].solid, 0x1e, 0x91, 0x09, 255);
- SETCOL(btheme->tarm[2].select, 0x59, 0xb7, 0x0b, 255);
- SETCOL(btheme->tarm[2].active, 0x83, 0xef, 0x1d, 255);
- /* set 4 */
- SETCOL(btheme->tarm[3].solid, 0x0a, 0x36, 0x94, 255);
- SETCOL(btheme->tarm[3].select, 0x36, 0x67, 0xdf, 255);
- SETCOL(btheme->tarm[3].active, 0x5e, 0xc1, 0xef, 255);
- /* set 5 */
- SETCOL(btheme->tarm[4].solid, 0xa9, 0x29, 0x4e, 255);
- SETCOL(btheme->tarm[4].select, 0xc1, 0x41, 0x6a, 255);
- SETCOL(btheme->tarm[4].active, 0xf0, 0x5d, 0x91, 255);
- /* set 6 */
- SETCOL(btheme->tarm[5].solid, 0x43, 0x0c, 0x78, 255);
- SETCOL(btheme->tarm[5].select, 0x54, 0x3a, 0xa3, 255);
- SETCOL(btheme->tarm[5].active, 0x87, 0x64, 0xd5, 255);
- /* set 7 */
- SETCOL(btheme->tarm[6].solid, 0x24, 0x78, 0x5a, 255);
- SETCOL(btheme->tarm[6].select, 0x3c, 0x95, 0x79, 255);
- SETCOL(btheme->tarm[6].active, 0x6f, 0xb6, 0xab, 255);
- /* set 8 */
- SETCOL(btheme->tarm[7].solid, 0x4b, 0x70, 0x7c, 255);
- SETCOL(btheme->tarm[7].select, 0x6a, 0x86, 0x91, 255);
- SETCOL(btheme->tarm[7].active, 0x9b, 0xc2, 0xcd, 255);
- /* set 9 */
- SETCOL(btheme->tarm[8].solid, 0xf4, 0xc9, 0x0c, 255);
- SETCOL(btheme->tarm[8].select, 0xee, 0xc2, 0x36, 255);
- SETCOL(btheme->tarm[8].active, 0xf3, 0xff, 0x00, 255);
- /* set 10 */
- SETCOL(btheme->tarm[9].solid, 0x1e, 0x20, 0x24, 255);
- SETCOL(btheme->tarm[9].select, 0x48, 0x4c, 0x56, 255);
- SETCOL(btheme->tarm[9].active, 0xff, 0xff, 0xff, 255);
- /* set 11 */
- SETCOL(btheme->tarm[10].solid, 0x6f, 0x2f, 0x6a, 255);
- SETCOL(btheme->tarm[10].select, 0x98, 0x45, 0xbe, 255);
- SETCOL(btheme->tarm[10].active, 0xd3, 0x30, 0xd6, 255);
- /* set 12 */
- SETCOL(btheme->tarm[11].solid, 0x6c, 0x8e, 0x22, 255);
- SETCOL(btheme->tarm[11].select, 0x7f, 0xb0, 0x22, 255);
- SETCOL(btheme->tarm[11].active, 0xbb, 0xef, 0x5b, 255);
- /* set 13 */
- SETCOL(btheme->tarm[12].solid, 0x8d, 0x8d, 0x8d, 255);
- SETCOL(btheme->tarm[12].select, 0xb0, 0xb0, 0xb0, 255);
- SETCOL(btheme->tarm[12].active, 0xde, 0xde, 0xde, 255);
- /* set 14 */
- SETCOL(btheme->tarm[13].solid, 0x83, 0x43, 0x26, 255);
- SETCOL(btheme->tarm[13].select, 0x8b, 0x58, 0x11, 255);
- SETCOL(btheme->tarm[13].active, 0xbd, 0x6a, 0x11, 255);
- /* set 15 */
- SETCOL(btheme->tarm[14].solid, 0x08, 0x31, 0x0e, 255);
- SETCOL(btheme->tarm[14].select, 0x1c, 0x43, 0x0b, 255);
- SETCOL(btheme->tarm[14].active, 0x34, 0x62, 0x2b, 255);
+ /* set 1 */
+ rgba_char_args_set(btheme->tarm[0].solid, 0x9a, 0x00, 0x00, 255);
+ rgba_char_args_set(btheme->tarm[0].select, 0xbd, 0x11, 0x11, 255);
+ rgba_char_args_set(btheme->tarm[0].active, 0xf7, 0x0a, 0x0a, 255);
+ /* set 2 */
+ rgba_char_args_set(btheme->tarm[1].solid, 0xf7, 0x40, 0x18, 255);
+ rgba_char_args_set(btheme->tarm[1].select, 0xf6, 0x69, 0x13, 255);
+ rgba_char_args_set(btheme->tarm[1].active, 0xfa, 0x99, 0x00, 255);
+ /* set 3 */
+ rgba_char_args_set(btheme->tarm[2].solid, 0x1e, 0x91, 0x09, 255);
+ rgba_char_args_set(btheme->tarm[2].select, 0x59, 0xb7, 0x0b, 255);
+ rgba_char_args_set(btheme->tarm[2].active, 0x83, 0xef, 0x1d, 255);
+ /* set 4 */
+ rgba_char_args_set(btheme->tarm[3].solid, 0x0a, 0x36, 0x94, 255);
+ rgba_char_args_set(btheme->tarm[3].select, 0x36, 0x67, 0xdf, 255);
+ rgba_char_args_set(btheme->tarm[3].active, 0x5e, 0xc1, 0xef, 255);
+ /* set 5 */
+ rgba_char_args_set(btheme->tarm[4].solid, 0xa9, 0x29, 0x4e, 255);
+ rgba_char_args_set(btheme->tarm[4].select, 0xc1, 0x41, 0x6a, 255);
+ rgba_char_args_set(btheme->tarm[4].active, 0xf0, 0x5d, 0x91, 255);
+ /* set 6 */
+ rgba_char_args_set(btheme->tarm[5].solid, 0x43, 0x0c, 0x78, 255);
+ rgba_char_args_set(btheme->tarm[5].select, 0x54, 0x3a, 0xa3, 255);
+ rgba_char_args_set(btheme->tarm[5].active, 0x87, 0x64, 0xd5, 255);
+ /* set 7 */
+ rgba_char_args_set(btheme->tarm[6].solid, 0x24, 0x78, 0x5a, 255);
+ rgba_char_args_set(btheme->tarm[6].select, 0x3c, 0x95, 0x79, 255);
+ rgba_char_args_set(btheme->tarm[6].active, 0x6f, 0xb6, 0xab, 255);
+ /* set 8 */
+ rgba_char_args_set(btheme->tarm[7].solid, 0x4b, 0x70, 0x7c, 255);
+ rgba_char_args_set(btheme->tarm[7].select, 0x6a, 0x86, 0x91, 255);
+ rgba_char_args_set(btheme->tarm[7].active, 0x9b, 0xc2, 0xcd, 255);
+ /* set 9 */
+ rgba_char_args_set(btheme->tarm[8].solid, 0xf4, 0xc9, 0x0c, 255);
+ rgba_char_args_set(btheme->tarm[8].select, 0xee, 0xc2, 0x36, 255);
+ rgba_char_args_set(btheme->tarm[8].active, 0xf3, 0xff, 0x00, 255);
+ /* set 10 */
+ rgba_char_args_set(btheme->tarm[9].solid, 0x1e, 0x20, 0x24, 255);
+ rgba_char_args_set(btheme->tarm[9].select, 0x48, 0x4c, 0x56, 255);
+ rgba_char_args_set(btheme->tarm[9].active, 0xff, 0xff, 0xff, 255);
+ /* set 11 */
+ rgba_char_args_set(btheme->tarm[10].solid, 0x6f, 0x2f, 0x6a, 255);
+ rgba_char_args_set(btheme->tarm[10].select, 0x98, 0x45, 0xbe, 255);
+ rgba_char_args_set(btheme->tarm[10].active, 0xd3, 0x30, 0xd6, 255);
+ /* set 12 */
+ rgba_char_args_set(btheme->tarm[11].solid, 0x6c, 0x8e, 0x22, 255);
+ rgba_char_args_set(btheme->tarm[11].select, 0x7f, 0xb0, 0x22, 255);
+ rgba_char_args_set(btheme->tarm[11].active, 0xbb, 0xef, 0x5b, 255);
+ /* set 13 */
+ rgba_char_args_set(btheme->tarm[12].solid, 0x8d, 0x8d, 0x8d, 255);
+ rgba_char_args_set(btheme->tarm[12].select, 0xb0, 0xb0, 0xb0, 255);
+ rgba_char_args_set(btheme->tarm[12].active, 0xde, 0xde, 0xde, 255);
+ /* set 14 */
+ rgba_char_args_set(btheme->tarm[13].solid, 0x83, 0x43, 0x26, 255);
+ rgba_char_args_set(btheme->tarm[13].select, 0x8b, 0x58, 0x11, 255);
+ rgba_char_args_set(btheme->tarm[13].active, 0xbd, 0x6a, 0x11, 255);
+ /* set 15 */
+ rgba_char_args_set(btheme->tarm[14].solid, 0x08, 0x31, 0x0e, 255);
+ rgba_char_args_set(btheme->tarm[14].select, 0x1c, 0x43, 0x0b, 255);
+ rgba_char_args_set(btheme->tarm[14].active, 0x34, 0x62, 0x2b, 255);
/* reset flags too */
for (i = 0; i < 20; i++)
@@ -547,23 +551,23 @@ static void ui_theme_init_boneColorSets(bTheme *btheme)
/* use this call to init new variables in themespace, if they're same for all */
static void ui_theme_init_new_do(ThemeSpace *ts)
{
- SETCOLTEST(ts->header_text, 0, 0, 0, 255);
- SETCOLTEST(ts->header_title, 0, 0, 0, 255);
- SETCOLTEST(ts->header_text_hi, 255, 255, 255, 255);
-
- SETCOLTEST(ts->panel_text, 0, 0, 0, 255);
- SETCOLTEST(ts->panel_title, 0, 0, 0, 255);
- SETCOLTEST(ts->panel_text_hi, 255, 255, 255, 255);
-
- SETCOLTEST(ts->button, 145, 145, 145, 245);
- SETCOLTEST(ts->button_title, 0, 0, 0, 255);
- SETCOLTEST(ts->button_text, 0, 0, 0, 255);
- SETCOLTEST(ts->button_text_hi, 255, 255, 255, 255);
-
- SETCOLTEST(ts->list, 165, 165, 165, 255);
- SETCOLTEST(ts->list_title, 0, 0, 0, 255);
- SETCOLTEST(ts->list_text, 0, 0, 0, 255);
- SETCOLTEST(ts->list_text_hi, 255, 255, 255, 255);
+ rgba_char_args_test_set(ts->header_text, 0, 0, 0, 255);
+ rgba_char_args_test_set(ts->header_title, 0, 0, 0, 255);
+ rgba_char_args_test_set(ts->header_text_hi, 255, 255, 255, 255);
+
+ rgba_char_args_test_set(ts->panel_text, 0, 0, 0, 255);
+ rgba_char_args_test_set(ts->panel_title, 0, 0, 0, 255);
+ rgba_char_args_test_set(ts->panel_text_hi, 255, 255, 255, 255);
+
+ rgba_char_args_test_set(ts->button, 145, 145, 145, 245);
+ rgba_char_args_test_set(ts->button_title, 0, 0, 0, 255);
+ rgba_char_args_test_set(ts->button_text, 0, 0, 0, 255);
+ rgba_char_args_test_set(ts->button_text_hi, 255, 255, 255, 255);
+
+ rgba_char_args_test_set(ts->list, 165, 165, 165, 255);
+ rgba_char_args_test_set(ts->list_title, 0, 0, 0, 255);
+ rgba_char_args_test_set(ts->list_text, 0, 0, 0, 255);
+ rgba_char_args_test_set(ts->list_text_hi, 255, 255, 255, 255);
}
static void ui_theme_init_new(bTheme *btheme)
@@ -598,23 +602,23 @@ void ui_theme_init_default(void)
bTheme *btheme;
/* we search for the theme with name Default */
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
- if(strcmp("Default", btheme->name)==0) break;
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ if (strcmp("Default", btheme->name) == 0) break;
}
- if(btheme==NULL) {
- btheme= MEM_callocN(sizeof(bTheme), "theme");
+ if (btheme == NULL) {
+ btheme = MEM_callocN(sizeof(bTheme), "theme");
BLI_addtail(&U.themes, btheme);
strcpy(btheme->name, "Default");
}
- UI_SetTheme(0, 0); // make sure the global used in this file is set
+ UI_SetTheme(0, 0); // make sure the global used in this file is set
/* UI buttons */
ui_widget_color_init(&btheme->tui);
- btheme->tui.iconfile[0]= 0;
+ btheme->tui.iconfile[0] = 0;
btheme->tui.panel.show_header = FALSE;
- SETCOL(btheme->tui.panel.header, 0, 0, 0, 25);
+ rgba_char_args_set(btheme->tui.panel.header, 0, 0, 0, 25);
/* Bone Color Sets */
ui_theme_init_boneColorSets(btheme);
@@ -623,256 +627,259 @@ void ui_theme_init_default(void)
ui_theme_init_new(btheme);
/* space view3d */
- SETCOLF(btheme->tv3d.back, 0.225, 0.225, 0.225, 1.0);
- SETCOL(btheme->tv3d.text, 0, 0, 0, 255);
- SETCOL(btheme->tv3d.text_hi, 255, 255, 255, 255);
+ rgba_char_args_set_fl(btheme->tv3d.back, 0.225, 0.225, 0.225, 1.0);
+ rgba_char_args_set(btheme->tv3d.text, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tv3d.text_hi, 255, 255, 255, 255);
- SETCOLF(btheme->tv3d.header, 0.45, 0.45, 0.45, 1.0);
- SETCOLF(btheme->tv3d.button, 0.45, 0.45, 0.45, 1.0);
- SETCOL(btheme->tv3d.panel, 165, 165, 165, 127);
+ rgba_char_args_set_fl(btheme->tv3d.header, 0.45, 0.45, 0.45, 1.0);
+ rgba_char_args_set_fl(btheme->tv3d.button, 0.45, 0.45, 0.45, 1.0);
+ rgba_char_args_set(btheme->tv3d.panel, 165, 165, 165, 127);
- SETCOL(btheme->tv3d.shade1, 160, 160, 160, 100);
- SETCOL(btheme->tv3d.shade2, 0x7f, 0x70, 0x70, 100);
-
- SETCOLF(btheme->tv3d.grid, 0.251, 0.251, 0.251, 1.0);
- SETCOL(btheme->tv3d.wire, 0x0, 0x0, 0x0, 255);
- SETCOL(btheme->tv3d.lamp, 0, 0, 0, 40);
- SETCOL(btheme->tv3d.speaker, 0, 0, 0, 255);
- SETCOL(btheme->tv3d.select, 241, 88, 0, 255);
- SETCOL(btheme->tv3d.active, 255, 170, 64, 255);
- SETCOL(btheme->tv3d.group, 8, 48, 8, 255);
- SETCOL(btheme->tv3d.group_active, 85, 187, 85, 255);
- SETCOL(btheme->tv3d.transform, 0xff, 0xff, 0xff, 255);
- SETCOL(btheme->tv3d.vertex, 0, 0, 0, 255);
- SETCOL(btheme->tv3d.vertex_select, 255, 133, 0, 255);
- btheme->tv3d.vertex_size= 3;
- btheme->tv3d.outline_width= 1;
- SETCOL(btheme->tv3d.edge, 0x0, 0x0, 0x0, 255);
- SETCOL(btheme->tv3d.edge_select, 255, 160, 0, 255);
- SETCOL(btheme->tv3d.edge_seam, 219, 37, 18, 255);
- SETCOL(btheme->tv3d.edge_facesel, 75, 75, 75, 255);
- SETCOL(btheme->tv3d.face, 0, 0, 0, 18);
- SETCOL(btheme->tv3d.face_select, 255, 133, 0, 60);
- SETCOL(btheme->tv3d.normal, 0x22, 0xDD, 0xDD, 255);
- SETCOL(btheme->tv3d.vertex_normal, 0x23, 0x61, 0xDD, 255);
- SETCOL(btheme->tv3d.face_dot, 255, 133, 0, 255);
- SETCOL(btheme->tv3d.editmesh_active, 255, 255, 255, 128);
- SETCOLF(btheme->tv3d.edge_crease, 0.8, 0, 0.6, 1.0);
- SETCOL(btheme->tv3d.edge_sharp, 0, 255, 255, 255);
- SETCOL(btheme->tv3d.header_text, 0, 0, 0, 255);
- SETCOL(btheme->tv3d.header_text_hi, 255, 255, 255, 255);
- SETCOL(btheme->tv3d.button_text, 0, 0, 0, 255);
- SETCOL(btheme->tv3d.button_text_hi, 255, 255, 255, 255);
- SETCOL(btheme->tv3d.button_title, 0, 0, 0, 255);
- SETCOL(btheme->tv3d.title, 0, 0, 0, 255);
-
- btheme->tv3d.facedot_size= 4;
-
- SETCOL(btheme->tv3d.extra_edge_len, 32, 0, 0, 255);
- SETCOL(btheme->tv3d.extra_face_area, 0, 32, 0, 255);
- SETCOL(btheme->tv3d.extra_face_angle, 0, 0, 128, 255);
-
- SETCOL(btheme->tv3d.cframe, 0x60, 0xc0, 0x40, 255);
-
- SETCOL(btheme->tv3d.nurb_uline, 0x90, 0x90, 0x00, 255);
- SETCOL(btheme->tv3d.nurb_vline, 0x80, 0x30, 0x60, 255);
- SETCOL(btheme->tv3d.nurb_sel_uline, 0xf0, 0xff, 0x40, 255);
- SETCOL(btheme->tv3d.nurb_sel_vline, 0xf0, 0x90, 0xa0, 255);
-
- SETCOL(btheme->tv3d.handle_free, 0, 0, 0, 255);
- SETCOL(btheme->tv3d.handle_auto, 0x90, 0x90, 0x00, 255);
- SETCOL(btheme->tv3d.handle_vect, 0x40, 0x90, 0x30, 255);
- SETCOL(btheme->tv3d.handle_align, 0x80, 0x30, 0x60, 255);
- SETCOL(btheme->tv3d.handle_sel_free, 0, 0, 0, 255);
- SETCOL(btheme->tv3d.handle_sel_auto, 0xf0, 0xff, 0x40, 255);
- SETCOL(btheme->tv3d.handle_sel_vect, 0x40, 0xc0, 0x30, 255);
- SETCOL(btheme->tv3d.handle_sel_align, 0xf0, 0x90, 0xa0, 255);
-
- SETCOL(btheme->tv3d.act_spline, 0xdb, 0x25, 0x12, 255);
- SETCOL(btheme->tv3d.lastsel_point, 0xff, 0xff, 0xff, 255);
-
- SETCOL(btheme->tv3d.bone_solid, 200, 200, 200, 255);
- SETCOL(btheme->tv3d.bone_pose, 80, 200, 255, 80); // alpha 80 is not meant editable, used for wire+action draw
-
- SETCOL(btheme->tv3d.bundle_solid, 200, 200, 200, 255);
- SETCOL(btheme->tv3d.camera_path, 0x00, 0x00, 0x00, 255);
+ rgba_char_args_set(btheme->tv3d.shade1, 160, 160, 160, 100);
+ rgba_char_args_set(btheme->tv3d.shade2, 0x7f, 0x70, 0x70, 100);
+
+ rgba_char_args_set_fl(btheme->tv3d.grid, 0.251, 0.251, 0.251, 1.0);
+ rgba_char_args_set(btheme->tv3d.wire, 0x0, 0x0, 0x0, 255);
+ rgba_char_args_set(btheme->tv3d.lamp, 0, 0, 0, 40);
+ rgba_char_args_set(btheme->tv3d.speaker, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tv3d.camera, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tv3d.empty, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tv3d.select, 241, 88, 0, 255);
+ rgba_char_args_set(btheme->tv3d.active, 255, 170, 64, 255);
+ rgba_char_args_set(btheme->tv3d.group, 8, 48, 8, 255);
+ rgba_char_args_set(btheme->tv3d.group_active, 85, 187, 85, 255);
+ rgba_char_args_set(btheme->tv3d.transform, 0xff, 0xff, 0xff, 255);
+ rgba_char_args_set(btheme->tv3d.vertex, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tv3d.vertex_select, 255, 133, 0, 255);
+ btheme->tv3d.vertex_size = 3;
+ btheme->tv3d.outline_width = 1;
+ rgba_char_args_set(btheme->tv3d.edge, 0x0, 0x0, 0x0, 255);
+ rgba_char_args_set(btheme->tv3d.edge_select, 255, 160, 0, 255);
+ rgba_char_args_set(btheme->tv3d.edge_seam, 219, 37, 18, 255);
+ rgba_char_args_set(btheme->tv3d.edge_facesel, 75, 75, 75, 255);
+ rgba_char_args_set(btheme->tv3d.face, 0, 0, 0, 18);
+ rgba_char_args_set(btheme->tv3d.face_select, 255, 133, 0, 60);
+ rgba_char_args_set(btheme->tv3d.normal, 0x22, 0xDD, 0xDD, 255);
+ rgba_char_args_set(btheme->tv3d.vertex_normal, 0x23, 0x61, 0xDD, 255);
+ rgba_char_args_set(btheme->tv3d.face_dot, 255, 133, 0, 255);
+ rgba_char_args_set(btheme->tv3d.editmesh_active, 255, 255, 255, 128);
+ rgba_char_args_set_fl(btheme->tv3d.edge_crease, 0.8, 0, 0.6, 1.0);
+ rgba_char_args_set(btheme->tv3d.edge_sharp, 0, 255, 255, 255);
+ rgba_char_args_set(btheme->tv3d.header_text, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tv3d.header_text_hi, 255, 255, 255, 255);
+ rgba_char_args_set(btheme->tv3d.button_text, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tv3d.button_text_hi, 255, 255, 255, 255);
+ rgba_char_args_set(btheme->tv3d.button_title, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tv3d.title, 0, 0, 0, 255);
+
+ btheme->tv3d.facedot_size = 4;
+
+ rgba_char_args_set(btheme->tv3d.extra_edge_len, 32, 0, 0, 255);
+ rgba_char_args_set(btheme->tv3d.extra_face_area, 0, 32, 0, 255);
+ rgba_char_args_set(btheme->tv3d.extra_face_angle, 0, 0, 128, 255);
+
+ rgba_char_args_set(btheme->tv3d.cframe, 0x60, 0xc0, 0x40, 255);
+
+ rgba_char_args_set(btheme->tv3d.nurb_uline, 0x90, 0x90, 0x00, 255);
+ rgba_char_args_set(btheme->tv3d.nurb_vline, 0x80, 0x30, 0x60, 255);
+ rgba_char_args_set(btheme->tv3d.nurb_sel_uline, 0xf0, 0xff, 0x40, 255);
+ rgba_char_args_set(btheme->tv3d.nurb_sel_vline, 0xf0, 0x90, 0xa0, 255);
+
+ rgba_char_args_set(btheme->tv3d.handle_free, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tv3d.handle_auto, 0x90, 0x90, 0x00, 255);
+ rgba_char_args_set(btheme->tv3d.handle_vect, 0x40, 0x90, 0x30, 255);
+ rgba_char_args_set(btheme->tv3d.handle_align, 0x80, 0x30, 0x60, 255);
+ rgba_char_args_set(btheme->tv3d.handle_sel_free, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tv3d.handle_sel_auto, 0xf0, 0xff, 0x40, 255);
+ rgba_char_args_set(btheme->tv3d.handle_sel_vect, 0x40, 0xc0, 0x30, 255);
+ rgba_char_args_set(btheme->tv3d.handle_sel_align, 0xf0, 0x90, 0xa0, 255);
+
+ rgba_char_args_set(btheme->tv3d.act_spline, 0xdb, 0x25, 0x12, 255);
+ rgba_char_args_set(btheme->tv3d.lastsel_point, 0xff, 0xff, 0xff, 255);
+
+ rgba_char_args_set(btheme->tv3d.bone_solid, 200, 200, 200, 255);
+ rgba_char_args_set(btheme->tv3d.bone_pose, 80, 200, 255, 80); // alpha 80 is not meant editable, used for wire+action draw
+
+ rgba_char_args_set(btheme->tv3d.bundle_solid, 200, 200, 200, 255);
+ rgba_char_args_set(btheme->tv3d.camera_path, 0x00, 0x00, 0x00, 255);
/* space buttons */
/* to have something initialized */
- btheme->tbuts= btheme->tv3d;
+ btheme->tbuts = btheme->tv3d;
- SETCOLF(btheme->tbuts.back, 0.45, 0.45, 0.45, 1.0);
- SETCOL(btheme->tbuts.panel, 0x82, 0x82, 0x82, 255);
+ rgba_char_args_set_fl(btheme->tbuts.back, 0.45, 0.45, 0.45, 1.0);
+ rgba_char_args_set(btheme->tbuts.panel, 0x82, 0x82, 0x82, 255);
/* graph editor */
- btheme->tipo= btheme->tv3d;
- SETCOLF(btheme->tipo.back, 0.42, 0.42, 0.42, 1.0);
- SETCOLF(btheme->tipo.list, 0.4, 0.4, 0.4, 1.0);
- SETCOL(btheme->tipo.grid, 94, 94, 94, 255);
- SETCOL(btheme->tipo.panel, 255, 255, 255, 150);
- SETCOL(btheme->tipo.shade1, 150, 150, 150, 100); /* scrollbars */
- SETCOL(btheme->tipo.shade2, 0x70, 0x70, 0x70, 100);
- SETCOL(btheme->tipo.vertex, 0, 0, 0, 255);
- SETCOL(btheme->tipo.vertex_select, 255, 133, 0, 255);
- SETCOL(btheme->tipo.hilite, 0x60, 0xc0, 0x40, 255);
- btheme->tipo.vertex_size= 3;
-
- SETCOL(btheme->tipo.handle_vertex, 0, 0, 0, 255);
- SETCOL(btheme->tipo.handle_vertex_select, 255, 133, 0, 255);
- SETCOL(btheme->tipo.handle_auto_clamped, 0x99, 0x40, 0x30, 255);
- SETCOL(btheme->tipo.handle_sel_auto_clamped, 0xf0, 0xaf, 0x90, 255);
- btheme->tipo.handle_vertex_size= 4;
+ btheme->tipo = btheme->tv3d;
+ rgba_char_args_set_fl(btheme->tipo.back, 0.42, 0.42, 0.42, 1.0);
+ rgba_char_args_set_fl(btheme->tipo.list, 0.4, 0.4, 0.4, 1.0);
+ rgba_char_args_set(btheme->tipo.grid, 94, 94, 94, 255);
+ rgba_char_args_set(btheme->tipo.panel, 255, 255, 255, 150);
+ rgba_char_args_set(btheme->tipo.shade1, 150, 150, 150, 100); /* scrollbars */
+ rgba_char_args_set(btheme->tipo.shade2, 0x70, 0x70, 0x70, 100);
+ rgba_char_args_set(btheme->tipo.vertex, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tipo.vertex_select, 255, 133, 0, 255);
+ rgba_char_args_set(btheme->tipo.hilite, 0x60, 0xc0, 0x40, 255);
+ btheme->tipo.vertex_size = 3;
+
+ rgba_char_args_set(btheme->tipo.handle_vertex, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tipo.handle_vertex_select, 255, 133, 0, 255);
+ rgba_char_args_set(btheme->tipo.handle_auto_clamped, 0x99, 0x40, 0x30, 255);
+ rgba_char_args_set(btheme->tipo.handle_sel_auto_clamped, 0xf0, 0xaf, 0x90, 255);
+ btheme->tipo.handle_vertex_size = 4;
- SETCOL(btheme->tipo.ds_channel, 82, 96, 110, 255);
- SETCOL(btheme->tipo.ds_subchannel, 124, 137, 150, 255);
- SETCOL(btheme->tipo.group, 79, 101, 73, 255);
- SETCOL(btheme->tipo.group_active, 135, 177, 125, 255);
+ rgba_char_args_set(btheme->tipo.ds_channel, 82, 96, 110, 255);
+ rgba_char_args_set(btheme->tipo.ds_subchannel, 124, 137, 150, 255);
+ rgba_char_args_set(btheme->tipo.group, 79, 101, 73, 255);
+ rgba_char_args_set(btheme->tipo.group_active, 135, 177, 125, 255);
/* dopesheet */
- btheme->tact= btheme->tipo;
- SETCOL(btheme->tact.strip, 12, 10, 10, 128);
- SETCOL(btheme->tact.strip_select, 255, 140, 0, 255);
+ btheme->tact = btheme->tipo;
+ rgba_char_args_set(btheme->tact.strip, 12, 10, 10, 128);
+ rgba_char_args_set(btheme->tact.strip_select, 255, 140, 0, 255);
/* space nla */
- btheme->tnla= btheme->tact;
+ btheme->tnla = btheme->tact;
/* space file */
/* to have something initialized */
- btheme->tfile= btheme->tv3d;
- SETCOLF(btheme->tfile.back, 0.3, 0.3, 0.3, 1);
- SETCOLF(btheme->tfile.panel, 0.3, 0.3, 0.3, 1);
- SETCOLF(btheme->tfile.list, 0.4, 0.4, 0.4, 1);
- SETCOL(btheme->tfile.text, 250, 250, 250, 255);
- SETCOL(btheme->tfile.text_hi, 15, 15, 15, 255);
- SETCOL(btheme->tfile.panel, 145, 145, 145, 255); // bookmark/ui regions
- SETCOL(btheme->tfile.active, 130, 130, 130, 255); // selected files
- SETCOL(btheme->tfile.hilite, 255, 140, 25, 255); // selected files
+ btheme->tfile = btheme->tv3d;
+ rgba_char_args_set_fl(btheme->tfile.back, 0.3, 0.3, 0.3, 1);
+ rgba_char_args_set_fl(btheme->tfile.panel, 0.3, 0.3, 0.3, 1);
+ rgba_char_args_set_fl(btheme->tfile.list, 0.4, 0.4, 0.4, 1);
+ rgba_char_args_set(btheme->tfile.text, 250, 250, 250, 255);
+ rgba_char_args_set(btheme->tfile.text_hi, 15, 15, 15, 255);
+ rgba_char_args_set(btheme->tfile.panel, 145, 145, 145, 255); // bookmark/ui regions
+ rgba_char_args_set(btheme->tfile.active, 130, 130, 130, 255); // selected files
+ rgba_char_args_set(btheme->tfile.hilite, 255, 140, 25, 255); // selected files
- SETCOL(btheme->tfile.grid, 250, 250, 250, 255);
- SETCOL(btheme->tfile.image, 250, 250, 250, 255);
- SETCOL(btheme->tfile.movie, 250, 250, 250, 255);
- SETCOL(btheme->tfile.scene, 250, 250, 250, 255);
+ rgba_char_args_set(btheme->tfile.grid, 250, 250, 250, 255);
+ rgba_char_args_set(btheme->tfile.image, 250, 250, 250, 255);
+ rgba_char_args_set(btheme->tfile.movie, 250, 250, 250, 255);
+ rgba_char_args_set(btheme->tfile.scene, 250, 250, 250, 255);
/* space seq */
- btheme->tseq= btheme->tv3d;
- SETCOL(btheme->tseq.back, 116, 116, 116, 255);
- SETCOL(btheme->tseq.movie, 81, 105, 135, 255);
- SETCOL(btheme->tseq.image, 109, 88, 129, 255);
- SETCOL(btheme->tseq.scene, 78, 152, 62, 255);
- SETCOL(btheme->tseq.audio, 46, 143, 143, 255);
- SETCOL(btheme->tseq.effect, 169, 84, 124, 255);
- SETCOL(btheme->tseq.plugin, 126, 126, 80, 255);
- SETCOL(btheme->tseq.transition, 162, 95, 111, 255);
- SETCOL(btheme->tseq.meta, 109, 145, 131, 255);
-
+ btheme->tseq = btheme->tv3d;
+ rgba_char_args_set(btheme->tseq.back, 116, 116, 116, 255);
+ rgba_char_args_set(btheme->tseq.movie, 81, 105, 135, 255);
+ rgba_char_args_set(btheme->tseq.movieclip, 32, 32, 143, 255);
+ rgba_char_args_set(btheme->tseq.image, 109, 88, 129, 255);
+ rgba_char_args_set(btheme->tseq.scene, 78, 152, 62, 255);
+ rgba_char_args_set(btheme->tseq.audio, 46, 143, 143, 255);
+ rgba_char_args_set(btheme->tseq.effect, 169, 84, 124, 255);
+ rgba_char_args_set(btheme->tseq.plugin, 126, 126, 80, 255);
+ rgba_char_args_set(btheme->tseq.transition, 162, 95, 111, 255);
+ rgba_char_args_set(btheme->tseq.meta, 109, 145, 131, 255);
+ rgba_char_args_set(btheme->tseq.preview_back, 0, 0, 0, 255);
/* space image */
- btheme->tima= btheme->tv3d;
- SETCOL(btheme->tima.back, 53, 53, 53, 255);
- SETCOL(btheme->tima.vertex, 0, 0, 0, 255);
- SETCOL(btheme->tima.vertex_select, 255, 133, 0, 255);
- btheme->tima.vertex_size= 3;
- btheme->tima.facedot_size= 3;
- SETCOL(btheme->tima.face, 255, 255, 255, 10);
- SETCOL(btheme->tima.face_select, 255, 133, 0, 60);
- SETCOL(btheme->tima.editmesh_active, 255, 255, 255, 128);
- SETCOLF(btheme->tima.preview_back, 0.45, 0.45, 0.45, 1.0);
- SETCOLF(btheme->tima.preview_stitch_face, 0.5, 0.5, 0.0, 0.2);
- SETCOLF(btheme->tima.preview_stitch_edge, 1.0, 0.0, 1.0, 0.2);
- SETCOLF(btheme->tima.preview_stitch_vert, 0.0, 0.0, 1.0, 0.2);
- SETCOLF(btheme->tima.preview_stitch_stitchable, 0.0, 1.0, 0.0, 1.0);
- SETCOLF(btheme->tima.preview_stitch_unstitchable, 1.0, 0.0, 0.0, 1.0);
+ btheme->tima = btheme->tv3d;
+ rgba_char_args_set(btheme->tima.back, 53, 53, 53, 255);
+ rgba_char_args_set(btheme->tima.vertex, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tima.vertex_select, 255, 133, 0, 255);
+ btheme->tima.vertex_size = 3;
+ btheme->tima.facedot_size = 3;
+ rgba_char_args_set(btheme->tima.face, 255, 255, 255, 10);
+ rgba_char_args_set(btheme->tima.face_select, 255, 133, 0, 60);
+ rgba_char_args_set(btheme->tima.editmesh_active, 255, 255, 255, 128);
+ rgba_char_args_set_fl(btheme->tima.preview_back, 0.45, 0.45, 0.45, 1.0);
+ rgba_char_args_set_fl(btheme->tima.preview_stitch_face, 0.5, 0.5, 0.0, 0.2);
+ rgba_char_args_set_fl(btheme->tima.preview_stitch_edge, 1.0, 0.0, 1.0, 0.2);
+ rgba_char_args_set_fl(btheme->tima.preview_stitch_vert, 0.0, 0.0, 1.0, 0.2);
+ rgba_char_args_set_fl(btheme->tima.preview_stitch_stitchable, 0.0, 1.0, 0.0, 1.0);
+ rgba_char_args_set_fl(btheme->tima.preview_stitch_unstitchable, 1.0, 0.0, 0.0, 1.0);
/* space text */
- btheme->text= btheme->tv3d;
- SETCOL(btheme->text.back, 153, 153, 153, 255);
- SETCOL(btheme->text.shade1, 143, 143, 143, 255);
- SETCOL(btheme->text.shade2, 0xc6, 0x77, 0x77, 255);
- SETCOL(btheme->text.hilite, 255, 0, 0, 255);
+ btheme->text = btheme->tv3d;
+ rgba_char_args_set(btheme->text.back, 153, 153, 153, 255);
+ rgba_char_args_set(btheme->text.shade1, 143, 143, 143, 255);
+ rgba_char_args_set(btheme->text.shade2, 0xc6, 0x77, 0x77, 255);
+ rgba_char_args_set(btheme->text.hilite, 255, 0, 0, 255);
/* syntax highlighting */
- SETCOL(btheme->text.syntaxn, 0, 0, 200, 255); /* Numbers Blue*/
- SETCOL(btheme->text.syntaxl, 100, 0, 0, 255); /* Strings red */
- SETCOL(btheme->text.syntaxc, 0, 100, 50, 255); /* Comments greenish */
- SETCOL(btheme->text.syntaxv, 95, 95, 0, 255); /* Special */
- SETCOL(btheme->text.syntaxb, 128, 0, 80, 255); /* Builtin, red-purple */
+ rgba_char_args_set(btheme->text.syntaxn, 0, 0, 200, 255); /* Numbers Blue*/
+ rgba_char_args_set(btheme->text.syntaxl, 100, 0, 0, 255); /* Strings red */
+ rgba_char_args_set(btheme->text.syntaxc, 0, 100, 50, 255); /* Comments greenish */
+ rgba_char_args_set(btheme->text.syntaxv, 95, 95, 0, 255); /* Special */
+ rgba_char_args_set(btheme->text.syntaxb, 128, 0, 80, 255); /* Builtin, red-purple */
/* space oops */
- btheme->toops= btheme->tv3d;
- SETCOLF(btheme->toops.back, 0.45, 0.45, 0.45, 1.0);
+ btheme->toops = btheme->tv3d;
+ rgba_char_args_set_fl(btheme->toops.back, 0.45, 0.45, 0.45, 1.0);
- SETCOLF(btheme->toops.match, 0.2, 0.5, 0.2, 0.3); /* highlighting search match - soft green*/
- SETCOLF(btheme->toops.selected_highlight, 0.51, 0.53, 0.55, 0.3);
+ rgba_char_args_set_fl(btheme->toops.match, 0.2, 0.5, 0.2, 0.3); /* highlighting search match - soft green*/
+ rgba_char_args_set_fl(btheme->toops.selected_highlight, 0.51, 0.53, 0.55, 0.3);
/* space info */
- btheme->tinfo= btheme->tv3d;
- SETCOLF(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0);
+ btheme->tinfo = btheme->tv3d;
+ rgba_char_args_set_fl(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0);
/* space user preferences */
- btheme->tuserpref= btheme->tv3d;
- SETCOLF(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0);
+ btheme->tuserpref = btheme->tv3d;
+ rgba_char_args_set_fl(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0);
/* space console */
- btheme->tconsole= btheme->tv3d;
- SETCOL(btheme->tconsole.back, 0, 0, 0, 255);
- SETCOL(btheme->tconsole.console_output, 96, 128, 255, 255);
- SETCOL(btheme->tconsole.console_input, 255, 255, 255, 255);
- SETCOL(btheme->tconsole.console_info, 0, 170, 0, 255);
- SETCOL(btheme->tconsole.console_error, 220, 96, 96, 255);
- SETCOL(btheme->tconsole.console_cursor, 220, 96, 96, 255);
+ btheme->tconsole = btheme->tv3d;
+ rgba_char_args_set(btheme->tconsole.back, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tconsole.console_output, 96, 128, 255, 255);
+ rgba_char_args_set(btheme->tconsole.console_input, 255, 255, 255, 255);
+ rgba_char_args_set(btheme->tconsole.console_info, 0, 170, 0, 255);
+ rgba_char_args_set(btheme->tconsole.console_error, 220, 96, 96, 255);
+ rgba_char_args_set(btheme->tconsole.console_cursor, 220, 96, 96, 255);
/* space time */
- btheme->ttime= btheme->tv3d;
- SETCOLF(btheme->ttime.back, 0.45, 0.45, 0.45, 1.0);
- SETCOLF(btheme->ttime.grid, 0.36, 0.36, 0.36, 1.0);
- SETCOL(btheme->ttime.shade1, 173, 173, 173, 255); // sliders
+ btheme->ttime = btheme->tv3d;
+ rgba_char_args_set_fl(btheme->ttime.back, 0.45, 0.45, 0.45, 1.0);
+ rgba_char_args_set_fl(btheme->ttime.grid, 0.36, 0.36, 0.36, 1.0);
+ rgba_char_args_set(btheme->ttime.shade1, 173, 173, 173, 255); // sliders
/* space node, re-uses syntax color storage */
- btheme->tnode= btheme->tv3d;
- SETCOL(btheme->tnode.edge_select, 255, 255, 255, 255);
- SETCOL(btheme->tnode.syntaxl, 155, 155, 155, 160); /* TH_NODE, backdrop */
- SETCOL(btheme->tnode.syntaxn, 100, 100, 100, 255); /* in/output */
- SETCOL(btheme->tnode.syntaxb, 108, 105, 111, 255); /* operator */
- SETCOL(btheme->tnode.syntaxv, 104, 106, 117, 255); /* generator */
- SETCOL(btheme->tnode.syntaxc, 105, 117, 110, 255); /* group */
+ btheme->tnode = btheme->tv3d;
+ rgba_char_args_set(btheme->tnode.edge_select, 255, 255, 255, 255);
+ rgba_char_args_set(btheme->tnode.syntaxl, 155, 155, 155, 160); /* TH_NODE, backdrop */
+ rgba_char_args_set(btheme->tnode.syntaxn, 100, 100, 100, 255); /* in/output */
+ rgba_char_args_set(btheme->tnode.syntaxb, 108, 105, 111, 255); /* operator */
+ rgba_char_args_set(btheme->tnode.syntaxv, 104, 106, 117, 255); /* generator */
+ rgba_char_args_set(btheme->tnode.syntaxc, 105, 117, 110, 255); /* group */
btheme->tnode.noodle_curving = 5;
/* space logic */
- btheme->tlogic= btheme->tv3d;
- SETCOL(btheme->tlogic.back, 100, 100, 100, 255);
+ btheme->tlogic = btheme->tv3d;
+ rgba_char_args_set(btheme->tlogic.back, 100, 100, 100, 255);
/* space clip */
- btheme->tclip= btheme->tv3d;
-
- SETCOL(btheme->tclip.marker_outline, 0x00, 0x00, 0x00, 255);
- SETCOL(btheme->tclip.marker, 0x7f, 0x7f, 0x00, 255);
- SETCOL(btheme->tclip.act_marker, 0xff, 0xff, 0xff, 255);
- SETCOL(btheme->tclip.sel_marker, 0xff, 0xff, 0x00, 255);
- SETCOL(btheme->tclip.dis_marker, 0x7f, 0x00, 0x00, 255);
- SETCOL(btheme->tclip.lock_marker, 0x7f, 0x7f, 0x7f, 255);
- SETCOL(btheme->tclip.path_before, 0xff, 0x00, 0x00, 255);
- SETCOL(btheme->tclip.path_after, 0x00, 0x00, 0xff, 255);
- SETCOL(btheme->tclip.grid, 0x5e, 0x5e, 0x5e, 255);
- SETCOL(btheme->tclip.cframe, 0x60, 0xc0, 0x40, 255);
- SETCOL(btheme->tclip.handle_vertex, 0x00, 0x00, 0x00, 0xff);
- SETCOL(btheme->tclip.handle_vertex_select, 0xff, 0xff, 0, 0xff);
- btheme->tclip.handle_vertex_size= 4;
+ btheme->tclip = btheme->tv3d;
+
+ rgba_char_args_set(btheme->tclip.marker_outline, 0x00, 0x00, 0x00, 255);
+ rgba_char_args_set(btheme->tclip.marker, 0x7f, 0x7f, 0x00, 255);
+ rgba_char_args_set(btheme->tclip.act_marker, 0xff, 0xff, 0xff, 255);
+ rgba_char_args_set(btheme->tclip.sel_marker, 0xff, 0xff, 0x00, 255);
+ rgba_char_args_set(btheme->tclip.dis_marker, 0x7f, 0x00, 0x00, 255);
+ rgba_char_args_set(btheme->tclip.lock_marker, 0x7f, 0x7f, 0x7f, 255);
+ rgba_char_args_set(btheme->tclip.path_before, 0xff, 0x00, 0x00, 255);
+ rgba_char_args_set(btheme->tclip.path_after, 0x00, 0x00, 0xff, 255);
+ rgba_char_args_set(btheme->tclip.grid, 0x5e, 0x5e, 0x5e, 255);
+ rgba_char_args_set(btheme->tclip.cframe, 0x60, 0xc0, 0x40, 255);
+ rgba_char_args_set(btheme->tclip.handle_vertex, 0x00, 0x00, 0x00, 0xff);
+ rgba_char_args_set(btheme->tclip.handle_vertex_select, 0xff, 0xff, 0, 0xff);
+ btheme->tclip.handle_vertex_size = 4;
}
void UI_SetTheme(int spacetype, int regionid)
{
- if(spacetype==0) { // called for safety, when delete themes
- theme_active= U.themes.first;
- theme_spacetype= SPACE_VIEW3D;
- theme_regionid= RGN_TYPE_WINDOW;
+ if (spacetype == 0) { // called for safety, when delete themes
+ theme_active = U.themes.first;
+ theme_spacetype = SPACE_VIEW3D;
+ theme_regionid = RGN_TYPE_WINDOW;
}
else {
// later on, a local theme can be found too
- theme_active= U.themes.first;
- theme_spacetype= spacetype;
- theme_regionid= regionid;
+ theme_active = U.themes.first;
+ theme_spacetype = spacetype;
+ theme_regionid = regionid;
}
}
@@ -886,7 +893,7 @@ void UI_ThemeColor(int colorid)
{
const unsigned char *cp;
- cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
glColor3ubv(cp);
}
@@ -896,7 +903,7 @@ void UI_ThemeColor4(int colorid)
{
const unsigned char *cp;
- cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
glColor4ubv(cp);
}
@@ -907,12 +914,12 @@ void UI_ThemeColorShade(int colorid, int offset)
int r, g, b;
const unsigned char *cp;
- cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
- r= offset + (int) cp[0];
+ cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ r = offset + (int) cp[0];
CLAMP(r, 0, 255);
- g= offset + (int) cp[1];
+ g = offset + (int) cp[1];
CLAMP(g, 0, 255);
- b= offset + (int) cp[2];
+ b = offset + (int) cp[2];
CLAMP(b, 0, 255);
//glColor3ub(r, g, b);
glColor4ub(r, g, b, cp[3]);
@@ -922,14 +929,14 @@ void UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset)
int r, g, b, a;
const unsigned char *cp;
- cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
- r= coloffset + (int) cp[0];
+ cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ r = coloffset + (int) cp[0];
CLAMP(r, 0, 255);
- g= coloffset + (int) cp[1];
+ g = coloffset + (int) cp[1];
CLAMP(g, 0, 255);
- b= coloffset + (int) cp[2];
+ b = coloffset + (int) cp[2];
CLAMP(b, 0, 255);
- a= alphaoffset + (int) cp[3];
+ a = alphaoffset + (int) cp[3];
CLAMP(a, 0, 255);
glColor4ub(r, g, b, a);
}
@@ -940,13 +947,13 @@ void UI_ThemeColorBlend(int colorid1, int colorid2, float fac)
int r, g, b;
const unsigned char *cp1, *cp2;
- cp1= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
- cp2= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
+ cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
+ cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
CLAMP(fac, 0.0f, 1.0f);
- r= floorf((1.0f-fac)*cp1[0] + fac*cp2[0]);
- g= floorf((1.0f-fac)*cp1[1] + fac*cp2[1]);
- b= floorf((1.0f-fac)*cp1[2] + fac*cp2[2]);
+ r = floorf((1.0f - fac) * cp1[0] + fac * cp2[0]);
+ g = floorf((1.0f - fac) * cp1[1] + fac * cp2[1]);
+ b = floorf((1.0f - fac) * cp1[2] + fac * cp2[2]);
glColor3ub(r, g, b);
}
@@ -957,13 +964,13 @@ void UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset)
int r, g, b;
const unsigned char *cp1, *cp2;
- cp1= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
- cp2= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
+ cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
+ cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
CLAMP(fac, 0.0f, 1.0f);
- r= offset+floorf((1.0f-fac)*cp1[0] + fac*cp2[0]);
- g= offset+floorf((1.0f-fac)*cp1[1] + fac*cp2[1]);
- b= offset+floorf((1.0f-fac)*cp1[2] + fac*cp2[2]);
+ r = offset + floorf((1.0f - fac) * cp1[0] + fac * cp2[0]);
+ g = offset + floorf((1.0f - fac) * cp1[1] + fac * cp2[1]);
+ b = offset + floorf((1.0f - fac) * cp1[2] + fac * cp2[2]);
CLAMP(r, 0, 255);
CLAMP(g, 0, 255);
@@ -978,14 +985,14 @@ void UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int off
int r, g, b, a;
const unsigned char *cp1, *cp2;
- cp1= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
- cp2= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
+ cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
+ cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
CLAMP(fac, 0.0f, 1.0f);
- r= offset+floorf((1.0f-fac)*cp1[0] + fac*cp2[0]);
- g= offset+floorf((1.0f-fac)*cp1[1] + fac*cp2[1]);
- b= offset+floorf((1.0f-fac)*cp1[2] + fac*cp2[2]);
- a= alphaoffset + floorf((1.0f-fac)*cp1[3] + fac*cp2[3]);
+ r = offset + floorf((1.0f - fac) * cp1[0] + fac * cp2[0]);
+ g = offset + floorf((1.0f - fac) * cp1[1] + fac * cp2[1]);
+ b = offset + floorf((1.0f - fac) * cp1[2] + fac * cp2[2]);
+ a = alphaoffset + floorf((1.0f - fac) * cp1[3] + fac * cp2[3]);
CLAMP(r, 0, 255);
CLAMP(g, 0, 255);
@@ -1001,7 +1008,7 @@ float UI_GetThemeValuef(int colorid)
{
const unsigned char *cp;
- cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
return ((float)cp[0]);
}
@@ -1011,7 +1018,7 @@ int UI_GetThemeValue(int colorid)
{
const unsigned char *cp;
- cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
return ((int) cp[0]);
}
@@ -1022,10 +1029,10 @@ void UI_GetThemeColor3fv(int colorid, float *col)
{
const unsigned char *cp;
- cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
- col[0]= ((float)cp[0])/255.0f;
- col[1]= ((float)cp[1])/255.0f;
- col[2]= ((float)cp[2])/255.0f;
+ cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ col[0] = ((float)cp[0]) / 255.0f;
+ col[1] = ((float)cp[1]) / 255.0f;
+ col[2] = ((float)cp[2]) / 255.0f;
}
// get the color, range 0.0-1.0, complete with shading offset
@@ -1034,18 +1041,18 @@ void UI_GetThemeColorShade3fv(int colorid, int offset, float *col)
int r, g, b;
const unsigned char *cp;
- cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
- r= offset + (int) cp[0];
+ r = offset + (int) cp[0];
CLAMP(r, 0, 255);
- g= offset + (int) cp[1];
+ g = offset + (int) cp[1];
CLAMP(g, 0, 255);
- b= offset + (int) cp[2];
+ b = offset + (int) cp[2];
CLAMP(b, 0, 255);
- col[0]= ((float)r)/255.0f;
- col[1]= ((float)g)/255.0f;
- col[2]= ((float)b)/255.0f;
+ col[0] = ((float)r) / 255.0f;
+ col[1] = ((float)g) / 255.0f;
+ col[2] = ((float)b) / 255.0f;
}
// get the color, in char pointer
@@ -1053,10 +1060,10 @@ void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
{
const unsigned char *cp;
- cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
- col[0]= cp[0];
- col[1]= cp[1];
- col[2]= cp[2];
+ cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ col[0] = cp[0];
+ col[1] = cp[1];
+ col[2] = cp[2];
}
// get the color, in char pointer
@@ -1064,22 +1071,22 @@ void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
{
const unsigned char *cp;
- cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
- col[0]= cp[0];
- col[1]= cp[1];
- col[2]= cp[2];
- col[3]= cp[3];
+ cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ col[0] = cp[0];
+ col[1] = cp[1];
+ col[2] = cp[2];
+ col[3] = cp[3];
}
void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4])
{
const unsigned char *cp;
- cp= UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
- col[0]= cp[0];
- col[1]= cp[1];
- col[2]= cp[2];
- col[3]= cp[3];
+ cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
+ col[0] = cp[0];
+ col[1] = cp[1];
+ col[2] = cp[2];
+ col[3] = cp[3];
}
// blends and shades between two char color pointers
@@ -1087,13 +1094,13 @@ void UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char c
{
int r, g, b;
CLAMP(fac, 0.0f, 1.0f);
- r= offset+floorf((1.0f-fac)*cp1[0] + fac*cp2[0]);
- g= offset+floorf((1.0f-fac)*cp1[1] + fac*cp2[1]);
- b= offset+floorf((1.0f-fac)*cp1[2] + fac*cp2[2]);
-
- r= r<0?0:(r>255?255:r);
- g= g<0?0:(g>255?255:g);
- b= b<0?0:(b>255?255:b);
+ r = offset + floorf((1.0f - fac) * cp1[0] + fac * cp2[0]);
+ g = offset + floorf((1.0f - fac) * cp1[1] + fac * cp2[1]);
+ b = offset + floorf((1.0f - fac) * cp1[2] + fac * cp2[2]);
+
+ r = r < 0 ? 0 : (r > 255 ? 255 : r);
+ g = g < 0 ? 0 : (g > 255 ? 255 : g);
+ b = b < 0 ? 0 : (b > 255 ? 255 : b);
glColor3ub(r, g, b);
}
@@ -1102,9 +1109,9 @@ void UI_GetColorPtrShade3ubv(const unsigned char cp[3], unsigned char col[3], in
{
int r, g, b;
- r= offset+(int)cp[0];
- g= offset+(int)cp[1];
- b= offset+(int)cp[2];
+ r = offset + (int)cp[0];
+ g = offset + (int)cp[1];
+ b = offset + (int)cp[2];
CLAMP(r, 0, 255);
CLAMP(g, 0, 255);
@@ -1121,9 +1128,9 @@ void UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned cha
int r, g, b;
CLAMP(fac, 0.0f, 1.0f);
- r= offset+floor((1.0f-fac)*cp1[0] + fac*cp2[0]);
- g= offset+floor((1.0f-fac)*cp1[1] + fac*cp2[1]);
- b= offset+floor((1.0f-fac)*cp1[2] + fac*cp2[2]);
+ r = offset + floor((1.0f - fac) * cp1[0] + fac * cp2[0]);
+ g = offset + floor((1.0f - fac) * cp1[1] + fac * cp2[1]);
+ b = offset + floor((1.0f - fac) * cp1[2] + fac * cp2[2]);
CLAMP(r, 0, 255);
CLAMP(g, 0, 255);
@@ -1144,22 +1151,22 @@ void UI_ThemeClearColor(int colorid)
void UI_make_axis_color(const unsigned char src_col[3], unsigned char dst_col[3], const char axis)
{
- switch(axis)
+ switch (axis)
{
case 'X':
- dst_col[0]= src_col[0]>219?255:src_col[0]+36;
- dst_col[1]= src_col[1]<26?0:src_col[1]-26;
- dst_col[2]= src_col[2]<26?0:src_col[2]-26;
+ dst_col[0] = src_col[0] > 219 ? 255 : src_col[0] + 36;
+ dst_col[1] = src_col[1] < 26 ? 0 : src_col[1] - 26;
+ dst_col[2] = src_col[2] < 26 ? 0 : src_col[2] - 26;
break;
case 'Y':
- dst_col[0]= src_col[0]<46?0:src_col[0]-36;
- dst_col[1]= src_col[1]>189?255:src_col[1]+66;
- dst_col[2]= src_col[2]<46?0:src_col[2]-36;
+ dst_col[0] = src_col[0] < 46 ? 0 : src_col[0] - 36;
+ dst_col[1] = src_col[1] > 189 ? 255 : src_col[1] + 66;
+ dst_col[2] = src_col[2] < 46 ? 0 : src_col[2] - 36;
break;
case 'Z':
- dst_col[0]= src_col[0]<26?0:src_col[0]-26;
- dst_col[1]= src_col[1]<26?0:src_col[1]-26;
- dst_col[2]= src_col[2]>209?255:src_col[2]+46;
+ dst_col[0] = src_col[0] < 26 ? 0 : src_col[0] - 26;
+ dst_col[1] = src_col[1] < 26 ? 0 : src_col[1] - 26;
+ dst_col[2] = src_col[2] > 209 ? 255 : src_col[2] + 46;
break;
default:
BLI_assert(!"invalid axis arg");
@@ -1171,20 +1178,20 @@ void UI_make_axis_color(const unsigned char src_col[3], unsigned char dst_col[3]
/* patching UserDef struct and Themes */
void init_userdef_do_versions(void)
{
- Main *bmain= G.main;
+ Main *bmain = G.main;
// countall();
/* the UserDef struct is not corrected with do_versions() .... ugh! */
- if(U.wheellinescroll == 0) U.wheellinescroll = 3;
- if(U.menuthreshold1==0) {
- U.menuthreshold1= 5;
- U.menuthreshold2= 2;
+ if (U.wheellinescroll == 0) U.wheellinescroll = 3;
+ if (U.menuthreshold1 == 0) {
+ U.menuthreshold1 = 5;
+ U.menuthreshold2 = 2;
}
- if(U.tb_leftmouse==0) {
- U.tb_leftmouse= 5;
- U.tb_rightmouse= 5;
+ if (U.tb_leftmouse == 0) {
+ U.tb_leftmouse = 5;
+ U.tb_rightmouse = 5;
}
- if(U.mixbufsize==0) U.mixbufsize= 2048;
+ if (U.mixbufsize == 0) U.mixbufsize = 2048;
if (strcmp(U.tempdir, "/") == 0) {
BLI_system_temporary_dir(U.tempdir);
}
@@ -1197,17 +1204,21 @@ void init_userdef_do_versions(void)
// XXX error(STRINGIFY(BLENDER_STARTUP_FILE)" is buggy, please consider removing it.\n");
}
/* transform widget settings */
- if(U.tw_hotspot==0) {
- U.tw_hotspot= 14;
- U.tw_size= 20; // percentage of window size
- U.tw_handlesize= 16; // percentage of widget radius
+ if (U.tw_hotspot == 0) {
+ U.tw_hotspot = 14;
+ U.tw_size = 20; // percentage of window size
+ U.tw_handlesize = 16; // percentage of widget radius
}
- if(U.pad_rot_angle==0)
- U.pad_rot_angle= 15;
-
+ if (U.pad_rot_angle == 0)
+ U.pad_rot_angle = 15;
+ /* graph editor - unselected F-Curve visibility */
+ if (U.fcu_inactive_alpha == 0) {
+ U.fcu_inactive_alpha = 0.25f;
+ }
+
/* signal for derivedmesh to use colorband */
- /* run incase this was on and is now off in the user prefs [#28096] */
- vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
+ /* 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) {
BLI_strncpy(U.plugtexdir, U.textudir, sizeof(U.plugtexdir));
@@ -1224,22 +1235,22 @@ void init_userdef_do_versions(void)
bTheme *btheme;
U.uiflag |= USER_GLOBALUNDO;
- if (U.undosteps==0) U.undosteps=32;
+ if (U.undosteps == 0) U.undosteps = 32;
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
/* check for alpha==0 is safe, then color was never set */
- if(btheme->tv3d.edge_seam[3]==0) {
- SETCOL(btheme->tv3d.edge_seam, 230, 150, 50, 255);
+ if (btheme->tv3d.edge_seam[3] == 0) {
+ rgba_char_args_set(btheme->tv3d.edge_seam, 230, 150, 50, 255);
}
- if(btheme->tv3d.normal[3]==0) {
- SETCOL(btheme->tv3d.normal, 0x22, 0xDD, 0xDD, 255);
+ if (btheme->tv3d.normal[3] == 0) {
+ rgba_char_args_set(btheme->tv3d.normal, 0x22, 0xDD, 0xDD, 255);
}
- if(btheme->tv3d.vertex_normal[3]==0) {
- SETCOL(btheme->tv3d.vertex_normal, 0x23, 0x61, 0xDD, 255);
+ if (btheme->tv3d.vertex_normal[3] == 0) {
+ rgba_char_args_set(btheme->tv3d.vertex_normal, 0x23, 0x61, 0xDD, 255);
}
- if(btheme->tv3d.face_dot[3]==0) {
- SETCOL(btheme->tv3d.face_dot, 255, 138, 48, 255);
- btheme->tv3d.facedot_size= 4;
+ if (btheme->tv3d.face_dot[3] == 0) {
+ rgba_char_args_set(btheme->tv3d.face_dot, 255, 138, 48, 255);
+ btheme->tv3d.facedot_size = 4;
}
}
}
@@ -1251,89 +1262,89 @@ void init_userdef_do_versions(void)
if (bmain->versionfile <= 236) {
bTheme *btheme;
/* new space type */
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
/* check for alpha==0 is safe, then color was never set */
- if(btheme->ttime.back[3]==0) {
+ if (btheme->ttime.back[3] == 0) {
// copied from ui_theme_init_default
- btheme->ttime= btheme->tv3d;
- SETCOLF(btheme->ttime.back, 0.45, 0.45, 0.45, 1.0);
- SETCOLF(btheme->ttime.grid, 0.36, 0.36, 0.36, 1.0);
- SETCOL(btheme->ttime.shade1, 173, 173, 173, 255); // sliders
+ btheme->ttime = btheme->tv3d;
+ rgba_char_args_set_fl(btheme->ttime.back, 0.45, 0.45, 0.45, 1.0);
+ rgba_char_args_set_fl(btheme->ttime.grid, 0.36, 0.36, 0.36, 1.0);
+ rgba_char_args_set(btheme->ttime.shade1, 173, 173, 173, 255); // sliders
}
- if(btheme->text.syntaxn[3]==0) {
- SETCOL(btheme->text.syntaxn, 0, 0, 200, 255); /* Numbers Blue*/
- SETCOL(btheme->text.syntaxl, 100, 0, 0, 255); /* Strings red */
- SETCOL(btheme->text.syntaxc, 0, 100, 50, 255); /* Comments greenish */
- SETCOL(btheme->text.syntaxv, 95, 95, 0, 255); /* Special */
- SETCOL(btheme->text.syntaxb, 128, 0, 80, 255); /* Builtin, red-purple */
+ if (btheme->text.syntaxn[3] == 0) {
+ rgba_char_args_set(btheme->text.syntaxn, 0, 0, 200, 255); /* Numbers Blue*/
+ rgba_char_args_set(btheme->text.syntaxl, 100, 0, 0, 255); /* Strings red */
+ rgba_char_args_set(btheme->text.syntaxc, 0, 100, 50, 255); /* Comments greenish */
+ rgba_char_args_set(btheme->text.syntaxv, 95, 95, 0, 255); /* Special */
+ rgba_char_args_set(btheme->text.syntaxb, 128, 0, 80, 255); /* Builtin, red-purple */
}
}
}
if (bmain->versionfile <= 237) {
bTheme *btheme;
/* bone colors */
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
/* check for alpha==0 is safe, then color was never set */
- if(btheme->tv3d.bone_solid[3]==0) {
- SETCOL(btheme->tv3d.bone_solid, 200, 200, 200, 255);
- SETCOL(btheme->tv3d.bone_pose, 80, 200, 255, 80);
+ if (btheme->tv3d.bone_solid[3] == 0) {
+ rgba_char_args_set(btheme->tv3d.bone_solid, 200, 200, 200, 255);
+ rgba_char_args_set(btheme->tv3d.bone_pose, 80, 200, 255, 80);
}
}
}
if (bmain->versionfile <= 238) {
bTheme *btheme;
/* bone colors */
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
/* check for alpha==0 is safe, then color was never set */
- if(btheme->tnla.strip[3]==0) {
- SETCOL(btheme->tnla.strip_select, 0xff, 0xff, 0xaa, 255);
- SETCOL(btheme->tnla.strip, 0xe4, 0x9c, 0xc6, 255);
+ if (btheme->tnla.strip[3] == 0) {
+ rgba_char_args_set(btheme->tnla.strip_select, 0xff, 0xff, 0xaa, 255);
+ rgba_char_args_set(btheme->tnla.strip, 0xe4, 0x9c, 0xc6, 255);
}
}
}
if (bmain->versionfile <= 239) {
bTheme *btheme;
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
/* Lamp theme, check for alpha==0 is safe, then color was never set */
- if(btheme->tv3d.lamp[3]==0) {
- SETCOL(btheme->tv3d.lamp, 0, 0, 0, 40);
+ if (btheme->tv3d.lamp[3] == 0) {
+ rgba_char_args_set(btheme->tv3d.lamp, 0, 0, 0, 40);
/* TEMPORAL, remove me! (ton) */
U.uiflag |= USER_PLAINMENUS;
}
}
- if(U.obcenter_dia==0) U.obcenter_dia= 6;
+ if (U.obcenter_dia == 0) U.obcenter_dia = 6;
}
if (bmain->versionfile <= 241) {
bTheme *btheme;
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
/* Node editor theme, check for alpha==0 is safe, then color was never set */
- if(btheme->tnode.syntaxn[3]==0) {
+ if (btheme->tnode.syntaxn[3] == 0) {
/* re-uses syntax color storage */
- btheme->tnode= btheme->tv3d;
- SETCOL(btheme->tnode.edge_select, 255, 255, 255, 255);
- SETCOL(btheme->tnode.syntaxl, 150, 150, 150, 255); /* TH_NODE, backdrop */
- SETCOL(btheme->tnode.syntaxn, 129, 131, 144, 255); /* in/output */
- SETCOL(btheme->tnode.syntaxb, 127,127,127, 255); /* operator */
- SETCOL(btheme->tnode.syntaxv, 142, 138, 145, 255); /* generator */
- SETCOL(btheme->tnode.syntaxc, 120, 145, 120, 255); /* group */
+ btheme->tnode = btheme->tv3d;
+ rgba_char_args_set(btheme->tnode.edge_select, 255, 255, 255, 255);
+ rgba_char_args_set(btheme->tnode.syntaxl, 150, 150, 150, 255); /* TH_NODE, backdrop */
+ rgba_char_args_set(btheme->tnode.syntaxn, 129, 131, 144, 255); /* in/output */
+ rgba_char_args_set(btheme->tnode.syntaxb, 127, 127, 127, 255); /* operator */
+ rgba_char_args_set(btheme->tnode.syntaxv, 142, 138, 145, 255); /* generator */
+ rgba_char_args_set(btheme->tnode.syntaxc, 120, 145, 120, 255); /* group */
}
/* Group theme colors */
- if(btheme->tv3d.group[3]==0) {
- SETCOL(btheme->tv3d.group, 0x0C, 0x30, 0x0C, 255);
- SETCOL(btheme->tv3d.group_active, 0x66, 0xFF, 0x66, 255);
+ if (btheme->tv3d.group[3] == 0) {
+ rgba_char_args_set(btheme->tv3d.group, 0x0C, 0x30, 0x0C, 255);
+ rgba_char_args_set(btheme->tv3d.group_active, 0x66, 0xFF, 0x66, 255);
}
/* Sequence editor theme*/
- if(btheme->tseq.movie[3]==0) {
- SETCOL(btheme->tseq.movie, 81, 105, 135, 255);
- SETCOL(btheme->tseq.image, 109, 88, 129, 255);
- SETCOL(btheme->tseq.scene, 78, 152, 62, 255);
- SETCOL(btheme->tseq.audio, 46, 143, 143, 255);
- SETCOL(btheme->tseq.effect, 169, 84, 124, 255);
- SETCOL(btheme->tseq.plugin, 126, 126, 80, 255);
- SETCOL(btheme->tseq.transition, 162, 95, 111, 255);
- SETCOL(btheme->tseq.meta, 109, 145, 131, 255);
+ if (btheme->tseq.movie[3] == 0) {
+ rgba_char_args_set(btheme->tseq.movie, 81, 105, 135, 255);
+ rgba_char_args_set(btheme->tseq.image, 109, 88, 129, 255);
+ rgba_char_args_set(btheme->tseq.scene, 78, 152, 62, 255);
+ rgba_char_args_set(btheme->tseq.audio, 46, 143, 143, 255);
+ rgba_char_args_set(btheme->tseq.effect, 169, 84, 124, 255);
+ rgba_char_args_set(btheme->tseq.plugin, 126, 126, 80, 255);
+ rgba_char_args_set(btheme->tseq.transition, 162, 95, 111, 255);
+ rgba_char_args_set(btheme->tseq.meta, 109, 145, 131, 255);
}
}
@@ -1349,18 +1360,18 @@ void init_userdef_do_versions(void)
if (bmain->versionfile <= 242) {
bTheme *btheme;
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
/* long keyframe color */
/* check for alpha==0 is safe, then color was never set */
- if(btheme->tact.strip[3]==0) {
- SETCOL(btheme->tv3d.edge_sharp, 255, 32, 32, 255);
- SETCOL(btheme->tact.strip_select, 0xff, 0xff, 0xaa, 204);
- SETCOL(btheme->tact.strip, 0xe4, 0x9c, 0xc6, 204);
+ if (btheme->tact.strip[3] == 0) {
+ rgba_char_args_set(btheme->tv3d.edge_sharp, 255, 32, 32, 255);
+ rgba_char_args_set(btheme->tact.strip_select, 0xff, 0xff, 0xaa, 204);
+ rgba_char_args_set(btheme->tact.strip, 0xe4, 0x9c, 0xc6, 204);
}
/* IPO-Editor - Vertex Size*/
- if(btheme->tipo.vertex_size == 0) {
- btheme->tipo.vertex_size= 3;
+ if (btheme->tipo.vertex_size == 0) {
+ btheme->tipo.vertex_size = 3;
}
}
}
@@ -1370,31 +1381,31 @@ void init_userdef_do_versions(void)
}
if (bmain->versionfile < 245 || (bmain->versionfile == 245 && bmain->subversionfile < 3)) {
bTheme *btheme;
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
- SETCOL(btheme->tv3d.editmesh_active, 255, 255, 255, 128);
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ rgba_char_args_set(btheme->tv3d.editmesh_active, 255, 255, 255, 128);
}
- if(U.coba_weight.tot==0)
+ if (U.coba_weight.tot == 0)
init_colorband(&U.coba_weight, 1);
}
if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 11)) {
bTheme *btheme;
- for (btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
/* these should all use the same color */
- SETCOL(btheme->tv3d.cframe, 0x60, 0xc0, 0x40, 255);
- SETCOL(btheme->tipo.cframe, 0x60, 0xc0, 0x40, 255);
- SETCOL(btheme->tact.cframe, 0x60, 0xc0, 0x40, 255);
- SETCOL(btheme->tnla.cframe, 0x60, 0xc0, 0x40, 255);
- SETCOL(btheme->tseq.cframe, 0x60, 0xc0, 0x40, 255);
- //SETCOL(btheme->tsnd.cframe, 0x60, 0xc0, 0x40, 255); Not needed anymore
- SETCOL(btheme->ttime.cframe, 0x60, 0xc0, 0x40, 255);
+ rgba_char_args_set(btheme->tv3d.cframe, 0x60, 0xc0, 0x40, 255);
+ rgba_char_args_set(btheme->tipo.cframe, 0x60, 0xc0, 0x40, 255);
+ rgba_char_args_set(btheme->tact.cframe, 0x60, 0xc0, 0x40, 255);
+ rgba_char_args_set(btheme->tnla.cframe, 0x60, 0xc0, 0x40, 255);
+ rgba_char_args_set(btheme->tseq.cframe, 0x60, 0xc0, 0x40, 255);
+ //rgba_char_args_set(btheme->tsnd.cframe, 0x60, 0xc0, 0x40, 255); Not needed anymore
+ rgba_char_args_set(btheme->ttime.cframe, 0x60, 0xc0, 0x40, 255);
}
}
if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 13)) {
bTheme *btheme;
- for (btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
/* action channel groups (recolor anyway) */
- SETCOL(btheme->tact.group, 0x39, 0x7d, 0x1b, 255);
- SETCOL(btheme->tact.group_active, 0x7d, 0xe9, 0x60, 255);
+ rgba_char_args_set(btheme->tact.group, 0x39, 0x7d, 0x1b, 255);
+ rgba_char_args_set(btheme->tact.group_active, 0x7d, 0xe9, 0x60, 255);
/* bone custom-color sets */
if (btheme->tarm[0].solid[3] == 0)
@@ -1402,99 +1413,99 @@ void init_userdef_do_versions(void)
}
}
if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 16)) {
- U.flag |= USER_ADD_VIEWALIGNED|USER_ADD_EDITMODE;
+ U.flag |= USER_ADD_VIEWALIGNED | USER_ADD_EDITMODE;
}
if ((bmain->versionfile < 247) || (bmain->versionfile == 247 && bmain->subversionfile <= 2)) {
bTheme *btheme;
/* adjust themes */
- for (btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
char *col;
/* IPO Editor: Handles/Vertices */
col = btheme->tipo.vertex;
- SETCOL(btheme->tipo.handle_vertex, col[0], col[1], col[2], 255);
+ rgba_char_args_set(btheme->tipo.handle_vertex, col[0], col[1], col[2], 255);
col = btheme->tipo.vertex_select;
- SETCOL(btheme->tipo.handle_vertex_select, col[0], col[1], col[2], 255);
- btheme->tipo.handle_vertex_size= btheme->tipo.vertex_size;
+ rgba_char_args_set(btheme->tipo.handle_vertex_select, col[0], col[1], col[2], 255);
+ btheme->tipo.handle_vertex_size = btheme->tipo.vertex_size;
/* Sequence/Image Editor: colors for GPencil text */
col = btheme->tv3d.bone_pose;
- SETCOL(btheme->tseq.bone_pose, col[0], col[1], col[2], 255);
- SETCOL(btheme->tima.bone_pose, col[0], col[1], col[2], 255);
+ rgba_char_args_set(btheme->tseq.bone_pose, col[0], col[1], col[2], 255);
+ rgba_char_args_set(btheme->tima.bone_pose, col[0], col[1], col[2], 255);
col = btheme->tv3d.vertex_select;
- SETCOL(btheme->tseq.vertex_select, col[0], col[1], col[2], 255);
+ rgba_char_args_set(btheme->tseq.vertex_select, col[0], col[1], col[2], 255);
}
}
if (bmain->versionfile < 250) {
bTheme *btheme;
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
/* this was not properly initialized in 2.45 */
- if(btheme->tima.face_dot[3]==0) {
- SETCOL(btheme->tima.editmesh_active, 255, 255, 255, 128);
- SETCOL(btheme->tima.face_dot, 255, 133, 0, 255);
- btheme->tima.facedot_size= 2;
+ if (btheme->tima.face_dot[3] == 0) {
+ rgba_char_args_set(btheme->tima.editmesh_active, 255, 255, 255, 128);
+ rgba_char_args_set(btheme->tima.face_dot, 255, 133, 0, 255);
+ btheme->tima.facedot_size = 2;
}
/* DopeSheet - (Object) Channel color */
- SETCOL(btheme->tact.ds_channel, 82, 96, 110, 255);
- SETCOL(btheme->tact.ds_subchannel, 124, 137, 150, 255);
+ rgba_char_args_set(btheme->tact.ds_channel, 82, 96, 110, 255);
+ rgba_char_args_set(btheme->tact.ds_subchannel, 124, 137, 150, 255);
/* DopeSheet - Group Channel color (saner version) */
- SETCOL(btheme->tact.group, 79, 101, 73, 255);
- SETCOL(btheme->tact.group_active, 135, 177, 125, 255);
+ rgba_char_args_set(btheme->tact.group, 79, 101, 73, 255);
+ rgba_char_args_set(btheme->tact.group_active, 135, 177, 125, 255);
/* Graph Editor - (Object) Channel color */
- SETCOL(btheme->tipo.ds_channel, 82, 96, 110, 255);
- SETCOL(btheme->tipo.ds_subchannel, 124, 137, 150, 255);
+ rgba_char_args_set(btheme->tipo.ds_channel, 82, 96, 110, 255);
+ rgba_char_args_set(btheme->tipo.ds_subchannel, 124, 137, 150, 255);
/* Graph Editor - Group Channel color */
- SETCOL(btheme->tipo.group, 79, 101, 73, 255);
- SETCOL(btheme->tipo.group_active, 135, 177, 125, 255);
+ rgba_char_args_set(btheme->tipo.group, 79, 101, 73, 255);
+ rgba_char_args_set(btheme->tipo.group_active, 135, 177, 125, 255);
/* Nla Editor - (Object) Channel color */
- SETCOL(btheme->tnla.ds_channel, 82, 96, 110, 255);
- SETCOL(btheme->tnla.ds_subchannel, 124, 137, 150, 255);
+ rgba_char_args_set(btheme->tnla.ds_channel, 82, 96, 110, 255);
+ rgba_char_args_set(btheme->tnla.ds_subchannel, 124, 137, 150, 255);
/* NLA Editor - New Strip colors */
- SETCOL(btheme->tnla.strip, 12, 10, 10, 128);
- SETCOL(btheme->tnla.strip_select, 255, 140, 0, 255);
+ rgba_char_args_set(btheme->tnla.strip, 12, 10, 10, 128);
+ rgba_char_args_set(btheme->tnla.strip_select, 255, 140, 0, 255);
}
/* adjust grease-pencil distances */
- U.gp_manhattendist= 1;
- U.gp_euclideandist= 2;
+ U.gp_manhattendist = 1;
+ U.gp_euclideandist = 2;
/* adjust default interpolation for new IPO-curves */
- U.ipo_new= BEZT_IPO_BEZ;
+ U.ipo_new = BEZT_IPO_BEZ;
}
if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 1)) {
bTheme *btheme;
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
/* common (new) variables, it checks for alpha==0 */
ui_theme_init_new(btheme);
- if(btheme->tui.wcol_num.outline[3]==0)
+ if (btheme->tui.wcol_num.outline[3] == 0)
ui_widget_color_init(&btheme->tui);
/* Logic editor theme, check for alpha==0 is safe, then color was never set */
- if(btheme->tlogic.syntaxn[3]==0) {
+ if (btheme->tlogic.syntaxn[3] == 0) {
/* re-uses syntax color storage */
- btheme->tlogic= btheme->tv3d;
- SETCOL(btheme->tlogic.back, 100, 100, 100, 255);
+ btheme->tlogic = btheme->tv3d;
+ rgba_char_args_set(btheme->tlogic.back, 100, 100, 100, 255);
}
- SETCOLF(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0);
- SETCOLF(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0);
+ rgba_char_args_set_fl(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0);
+ rgba_char_args_set_fl(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0);
}
}
if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 3)) {
/* new audio system */
- if(U.audiochannels == 0)
+ if (U.audiochannels == 0)
U.audiochannels = 2;
- if(U.audiodevice == 0) {
+ if (U.audiodevice == 0) {
#ifdef WITH_OPENAL
U.audiodevice = 2;
#endif
@@ -1502,9 +1513,9 @@ void init_userdef_do_versions(void)
U.audiodevice = 1;
#endif
}
- if(U.audioformat == 0)
+ if (U.audioformat == 0)
U.audioformat = 0x24;
- if(U.audiorate == 0)
+ if (U.audiorate == 0)
U.audiorate = 44100;
}
@@ -1514,45 +1525,45 @@ void init_userdef_do_versions(void)
if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 8)) {
wmKeyMap *km;
- for(km=U.user_keymaps.first; km; km=km->next) {
- if (strcmp(km->idname, "Armature_Sketch")==0)
+ for (km = U.user_keymaps.first; km; km = km->next) {
+ if (strcmp(km->idname, "Armature_Sketch") == 0)
strcpy(km->idname, "Armature Sketch");
- else if (strcmp(km->idname, "View3D")==0)
+ else if (strcmp(km->idname, "View3D") == 0)
strcpy(km->idname, "3D View");
- else if (strcmp(km->idname, "View3D Generic")==0)
+ else if (strcmp(km->idname, "View3D Generic") == 0)
strcpy(km->idname, "3D View Generic");
- else if (strcmp(km->idname, "EditMesh")==0)
+ else if (strcmp(km->idname, "EditMesh") == 0)
strcpy(km->idname, "Mesh");
- else if (strcmp(km->idname, "TimeLine")==0)
+ else if (strcmp(km->idname, "TimeLine") == 0)
strcpy(km->idname, "Timeline");
- else if (strcmp(km->idname, "UVEdit")==0)
+ else if (strcmp(km->idname, "UVEdit") == 0)
strcpy(km->idname, "UV Editor");
- else if (strcmp(km->idname, "Animation_Channels")==0)
+ else if (strcmp(km->idname, "Animation_Channels") == 0)
strcpy(km->idname, "Animation Channels");
- else if (strcmp(km->idname, "GraphEdit Keys")==0)
+ else if (strcmp(km->idname, "GraphEdit Keys") == 0)
strcpy(km->idname, "Graph Editor");
- else if (strcmp(km->idname, "GraphEdit Generic")==0)
+ else if (strcmp(km->idname, "GraphEdit Generic") == 0)
strcpy(km->idname, "Graph Editor Generic");
- else if (strcmp(km->idname, "Action_Keys")==0)
+ else if (strcmp(km->idname, "Action_Keys") == 0)
strcpy(km->idname, "Dopesheet");
- else if (strcmp(km->idname, "NLA Data")==0)
+ else if (strcmp(km->idname, "NLA Data") == 0)
strcpy(km->idname, "NLA Editor");
- else if (strcmp(km->idname, "Node Generic")==0)
+ else if (strcmp(km->idname, "Node Generic") == 0)
strcpy(km->idname, "Node Editor");
- else if (strcmp(km->idname, "Logic Generic")==0)
+ else if (strcmp(km->idname, "Logic Generic") == 0)
strcpy(km->idname, "Logic Editor");
- else if (strcmp(km->idname, "File")==0)
+ else if (strcmp(km->idname, "File") == 0)
strcpy(km->idname, "File Browser");
- else if (strcmp(km->idname, "FileMain")==0)
+ else if (strcmp(km->idname, "FileMain") == 0)
strcpy(km->idname, "File Browser Main");
- else if (strcmp(km->idname, "FileButtons")==0)
+ else if (strcmp(km->idname, "FileButtons") == 0)
strcpy(km->idname, "File Browser Buttons");
- else if (strcmp(km->idname, "Buttons Generic")==0)
+ else if (strcmp(km->idname, "Buttons Generic") == 0)
strcpy(km->idname, "Property Editor");
}
}
if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 16)) {
- if(U.wmdrawmethod == USER_DRAW_TRIPLE)
+ if (U.wmdrawmethod == USER_DRAW_TRIPLE)
U.wmdrawmethod = USER_DRAW_AUTOMATIC;
}
@@ -1567,46 +1578,46 @@ void init_userdef_do_versions(void)
U.keyhandles_new = HD_AUTO;
/* init new curve colors */
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
/* init colors used for handles in 3D-View */
- SETCOL(btheme->tv3d.handle_free, 0, 0, 0, 255);
- SETCOL(btheme->tv3d.handle_auto, 0x90, 0x90, 0x00, 255);
- SETCOL(btheme->tv3d.handle_vect, 0x40, 0x90, 0x30, 255);
- SETCOL(btheme->tv3d.handle_align, 0x80, 0x30, 0x60, 255);
- SETCOL(btheme->tv3d.handle_sel_free, 0, 0, 0, 255);
- SETCOL(btheme->tv3d.handle_sel_auto, 0xf0, 0xff, 0x40, 255);
- SETCOL(btheme->tv3d.handle_sel_vect, 0x40, 0xc0, 0x30, 255);
- SETCOL(btheme->tv3d.handle_sel_align, 0xf0, 0x90, 0xa0, 255);
- SETCOL(btheme->tv3d.act_spline, 0xdb, 0x25, 0x12, 255);
+ rgba_char_args_set(btheme->tv3d.handle_free, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tv3d.handle_auto, 0x90, 0x90, 0x00, 255);
+ rgba_char_args_set(btheme->tv3d.handle_vect, 0x40, 0x90, 0x30, 255);
+ rgba_char_args_set(btheme->tv3d.handle_align, 0x80, 0x30, 0x60, 255);
+ rgba_char_args_set(btheme->tv3d.handle_sel_free, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tv3d.handle_sel_auto, 0xf0, 0xff, 0x40, 255);
+ rgba_char_args_set(btheme->tv3d.handle_sel_vect, 0x40, 0xc0, 0x30, 255);
+ rgba_char_args_set(btheme->tv3d.handle_sel_align, 0xf0, 0x90, 0xa0, 255);
+ rgba_char_args_set(btheme->tv3d.act_spline, 0xdb, 0x25, 0x12, 255);
/* same colors again for Graph Editor... */
- SETCOL(btheme->tipo.handle_free, 0, 0, 0, 255);
- SETCOL(btheme->tipo.handle_auto, 0x90, 0x90, 0x00, 255);
- SETCOL(btheme->tipo.handle_vect, 0x40, 0x90, 0x30, 255);
- SETCOL(btheme->tipo.handle_align, 0x80, 0x30, 0x60, 255);
- SETCOL(btheme->tipo.handle_sel_free, 0, 0, 0, 255);
- SETCOL(btheme->tipo.handle_sel_auto, 0xf0, 0xff, 0x40, 255);
- SETCOL(btheme->tipo.handle_sel_vect, 0x40, 0xc0, 0x30, 255);
- SETCOL(btheme->tipo.handle_sel_align, 0xf0, 0x90, 0xa0, 255);
+ rgba_char_args_set(btheme->tipo.handle_free, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tipo.handle_auto, 0x90, 0x90, 0x00, 255);
+ rgba_char_args_set(btheme->tipo.handle_vect, 0x40, 0x90, 0x30, 255);
+ rgba_char_args_set(btheme->tipo.handle_align, 0x80, 0x30, 0x60, 255);
+ rgba_char_args_set(btheme->tipo.handle_sel_free, 0, 0, 0, 255);
+ rgba_char_args_set(btheme->tipo.handle_sel_auto, 0xf0, 0xff, 0x40, 255);
+ rgba_char_args_set(btheme->tipo.handle_sel_vect, 0x40, 0xc0, 0x30, 255);
+ rgba_char_args_set(btheme->tipo.handle_sel_align, 0xf0, 0x90, 0xa0, 255);
/* edge crease */
- SETCOLF(btheme->tv3d.edge_crease, 0.8, 0, 0.6, 1.0);
+ rgba_char_args_set_fl(btheme->tv3d.edge_crease, 0.8, 0, 0.6, 1.0);
}
}
if (bmain->versionfile <= 252) {
bTheme *btheme;
/* init new curve colors */
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
if (btheme->tv3d.lastsel_point[3] == 0)
- SETCOL(btheme->tv3d.lastsel_point, 0xff, 0xff, 0xff, 255);
+ rgba_char_args_set(btheme->tv3d.lastsel_point, 0xff, 0xff, 0xff, 255);
}
}
if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 5)) {
bTheme *btheme;
/* interface_widgets.c */
- struct uiWidgetColors wcol_progress= {
+ struct uiWidgetColors wcol_progress = {
{0, 0, 0, 255},
{190, 190, 190, 255},
{100, 100, 100, 180},
@@ -1619,25 +1630,25 @@ void init_userdef_do_versions(void)
5, -5
};
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
/* init progress bar theme */
- btheme->tui.wcol_progress= wcol_progress;
+ btheme->tui.wcol_progress = wcol_progress;
}
}
if (bmain->versionfile < 255 || (bmain->versionfile == 255 && bmain->subversionfile < 2)) {
bTheme *btheme;
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
- SETCOL(btheme->tv3d.extra_edge_len, 32, 0, 0, 255);
- SETCOL(btheme->tv3d.extra_face_angle, 0, 32, 0, 255);
- SETCOL(btheme->tv3d.extra_face_area, 0, 0, 128, 255);
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ rgba_char_args_set(btheme->tv3d.extra_edge_len, 32, 0, 0, 255);
+ rgba_char_args_set(btheme->tv3d.extra_face_angle, 0, 32, 0, 255);
+ rgba_char_args_set(btheme->tv3d.extra_face_area, 0, 0, 128, 255);
}
}
if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 4)) {
bTheme *btheme;
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
- if((btheme->tv3d.outline_width) == 0) btheme->tv3d.outline_width= 1;
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ if ((btheme->tv3d.outline_width) == 0) btheme->tv3d.outline_width = 1;
}
}
@@ -1648,7 +1659,7 @@ void init_userdef_do_versions(void)
if (bmain->versionfile < 258 || (bmain->versionfile == 258 && bmain->subversionfile < 2)) {
bTheme *btheme;
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
btheme->tnode.noodle_curving = 5;
}
}
@@ -1656,7 +1667,7 @@ void init_userdef_do_versions(void)
if (bmain->versionfile < 259 || (bmain->versionfile == 259 && bmain->subversionfile < 1)) {
bTheme *btheme;
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
btheme->tv3d.speaker[3] = 255;
}
}
@@ -1670,41 +1681,41 @@ void init_userdef_do_versions(void)
if (U.keyhandles_new == HD_AUTO)
U.keyhandles_new = HD_AUTO_ANIM;
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
- if(btheme->tv3d.bundle_solid[3] == 0)
- SETCOL(btheme->tv3d.bundle_solid, 200, 200, 200, 255);
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ if (btheme->tv3d.bundle_solid[3] == 0)
+ rgba_char_args_set(btheme->tv3d.bundle_solid, 200, 200, 200, 255);
- if(btheme->tv3d.camera_path[3] == 0)
- SETCOL(btheme->tv3d.camera_path, 0x00, 0x00, 0x00, 255);
+ if (btheme->tv3d.camera_path[3] == 0)
+ rgba_char_args_set(btheme->tv3d.camera_path, 0x00, 0x00, 0x00, 255);
- if((btheme->tclip.back[3]) == 0) {
- btheme->tclip= btheme->tv3d;
+ if ((btheme->tclip.back[3]) == 0) {
+ btheme->tclip = btheme->tv3d;
- SETCOL(btheme->tclip.marker_outline, 0x00, 0x00, 0x00, 255);
- SETCOL(btheme->tclip.marker, 0x7f, 0x7f, 0x00, 255);
- SETCOL(btheme->tclip.act_marker, 0xff, 0xff, 0xff, 255);
- SETCOL(btheme->tclip.sel_marker, 0xff, 0xff, 0x00, 255);
- SETCOL(btheme->tclip.dis_marker, 0x7f, 0x00, 0x00, 255);
- SETCOL(btheme->tclip.lock_marker, 0x7f, 0x7f, 0x7f, 255);
- SETCOL(btheme->tclip.path_before, 0xff, 0x00, 0x00, 255);
- SETCOL(btheme->tclip.path_after, 0x00, 0x00, 0xff, 255);
- SETCOL(btheme->tclip.grid, 0x5e, 0x5e, 0x5e, 255);
- SETCOL(btheme->tclip.cframe, 0x60, 0xc0, 0x40, 255);
- SETCOL(btheme->tclip.handle_vertex, 0x00, 0x00, 0x00, 0xff);
- SETCOL(btheme->tclip.handle_vertex_select, 0xff, 0xff, 0, 0xff);
- btheme->tclip.handle_vertex_size= 4;
+ rgba_char_args_set(btheme->tclip.marker_outline, 0x00, 0x00, 0x00, 255);
+ rgba_char_args_set(btheme->tclip.marker, 0x7f, 0x7f, 0x00, 255);
+ rgba_char_args_set(btheme->tclip.act_marker, 0xff, 0xff, 0xff, 255);
+ rgba_char_args_set(btheme->tclip.sel_marker, 0xff, 0xff, 0x00, 255);
+ rgba_char_args_set(btheme->tclip.dis_marker, 0x7f, 0x00, 0x00, 255);
+ rgba_char_args_set(btheme->tclip.lock_marker, 0x7f, 0x7f, 0x7f, 255);
+ rgba_char_args_set(btheme->tclip.path_before, 0xff, 0x00, 0x00, 255);
+ rgba_char_args_set(btheme->tclip.path_after, 0x00, 0x00, 0xff, 255);
+ rgba_char_args_set(btheme->tclip.grid, 0x5e, 0x5e, 0x5e, 255);
+ rgba_char_args_set(btheme->tclip.cframe, 0x60, 0xc0, 0x40, 255);
+ rgba_char_args_set(btheme->tclip.handle_vertex, 0x00, 0x00, 0x00, 0xff);
+ rgba_char_args_set(btheme->tclip.handle_vertex_select, 0xff, 0xff, 0, 0xff);
+ btheme->tclip.handle_vertex_size = 4;
}
/* auto-clamped handles -> based on auto */
- if(btheme->tipo.handle_auto_clamped[3] == 0)
- SETCOL(btheme->tipo.handle_auto_clamped, 0x99, 0x40, 0x30, 255);
- if(btheme->tipo.handle_sel_auto_clamped[3] == 0)
- SETCOL(btheme->tipo.handle_sel_auto_clamped, 0xf0, 0xaf, 0x90, 255);
+ if (btheme->tipo.handle_auto_clamped[3] == 0)
+ rgba_char_args_set(btheme->tipo.handle_auto_clamped, 0x99, 0x40, 0x30, 255);
+ if (btheme->tipo.handle_sel_auto_clamped[3] == 0)
+ rgba_char_args_set(btheme->tipo.handle_sel_auto_clamped, 0xf0, 0xaf, 0x90, 255);
}
/* enable (Cycles) addon by default */
- if(!BLI_findstring(&U.addons, "cycles", offsetof(bAddon, module))) {
- bAddon *baddon= MEM_callocN(sizeof(bAddon), "bAddon");
+ if (!BLI_findstring(&U.addons, "cycles", offsetof(bAddon, module))) {
+ bAddon *baddon = MEM_callocN(sizeof(bAddon), "bAddon");
BLI_strncpy(baddon->module, "cycles", sizeof(baddon->module));
BLI_addtail(&U.addons, baddon);
}
@@ -1713,29 +1724,58 @@ void init_userdef_do_versions(void)
if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 5)) {
bTheme *btheme;
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
- SETCOL(btheme->tui.panel.header, 0, 0, 0, 25);
- btheme->tui.icon_alpha= 1.0;
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ rgba_char_args_set(btheme->tui.panel.header, 0, 0, 0, 25);
+ btheme->tui.icon_alpha = 1.0;
}
}
if (bmain->versionfile < 261 || (bmain->versionfile == 261 && bmain->subversionfile < 4)) {
bTheme *btheme;
- for(btheme= U.themes.first; btheme; btheme= btheme->next) {
- SETCOLF(btheme->tima.preview_stitch_face, 0.071, 0.259, 0.694, 0.150);
- SETCOLF(btheme->tima.preview_stitch_edge, 1.0, 0.522, 0.0, 0.7);
- SETCOLF(btheme->tima.preview_stitch_vert, 1.0, 0.522, 0.0, 0.5);
- SETCOLF(btheme->tima.preview_stitch_stitchable, 0.0, 1.0, 0.0, 1.0);
- SETCOLF(btheme->tima.preview_stitch_unstitchable, 1.0, 0.0, 0.0, 1.0);
- SETCOLF(btheme->tima.preview_stitch_active, 0.886, 0.824, 0.765, 0.140);
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ rgba_char_args_set_fl(btheme->tima.preview_stitch_face, 0.071, 0.259, 0.694, 0.150);
+ rgba_char_args_set_fl(btheme->tima.preview_stitch_edge, 1.0, 0.522, 0.0, 0.7);
+ rgba_char_args_set_fl(btheme->tima.preview_stitch_vert, 1.0, 0.522, 0.0, 0.5);
+ rgba_char_args_set_fl(btheme->tima.preview_stitch_stitchable, 0.0, 1.0, 0.0, 1.0);
+ rgba_char_args_set_fl(btheme->tima.preview_stitch_unstitchable, 1.0, 0.0, 0.0, 1.0);
+ rgba_char_args_set_fl(btheme->tima.preview_stitch_active, 0.886, 0.824, 0.765, 0.140);
- SETCOLF(btheme->toops.match, 0.2, 0.5, 0.2, 0.3);
- SETCOLF(btheme->toops.selected_highlight, 0.51, 0.53, 0.55, 0.3);
+ rgba_char_args_set_fl(btheme->toops.match, 0.2, 0.5, 0.2, 0.3);
+ rgba_char_args_set_fl(btheme->toops.selected_highlight, 0.51, 0.53, 0.55, 0.3);
}
U.use_16bit_textures = 1;
}
+ if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 2)) {
+ bTheme *btheme;
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ if (btheme->tui.wcol_menu_item.item[3] == 255)
+ rgba_char_args_set(btheme->tui.wcol_menu_item.item, 172, 172, 172, 128);
+ }
+ }
+
+ if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 3)) {
+ bTheme *btheme;
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ if (btheme->tui.wcol_tooltip.inner[3] == 0) {
+ btheme->tui.wcol_tooltip = btheme->tui.wcol_menu_back;
+ }
+ if (btheme->tui.wcol_tooltip.text[0] == 160) { /* hrmf */
+ rgba_char_args_set(btheme->tui.wcol_tooltip.text, 255, 255, 255, 255);
+ }
+ }
+ }
+
+ if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 4)) {
+ bTheme *btheme;
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ if (btheme->tseq.movieclip[0] == 0) {
+ rgba_char_args_set(btheme->tseq.movieclip, 32, 32, 143, 255);
+ }
+ }
+ }
+
/* GL Texture Garbage Collection (variable abused above!) */
if (U.textimeout == 0) {
U.texcollectrate = 60;
@@ -1758,22 +1798,22 @@ void init_userdef_do_versions(void)
U.scrcastwait = 50;
}
if (U.v2d_min_gridsize == 0) {
- U.v2d_min_gridsize= 35;
+ U.v2d_min_gridsize = 35;
}
- if (U.dragthreshold == 0 )
- U.dragthreshold= 5;
- if (U.widget_unit==0)
- U.widget_unit= (U.dpi * 20 + 36)/72;
+ if (U.dragthreshold == 0)
+ U.dragthreshold = 5;
+ if (U.widget_unit == 0)
+ U.widget_unit = (U.dpi * 20 + 36) / 72;
if (U.anisotropic_filter <= 0)
U.anisotropic_filter = 1;
if (U.ndof_sensitivity == 0.0f) {
U.ndof_sensitivity = 1.0f;
U.ndof_flag = NDOF_LOCK_HORIZON |
- NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | NDOF_SHOULD_ROTATE;
+ NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | NDOF_SHOULD_ROTATE;
}
- if (U.tweak_threshold == 0 )
- U.tweak_threshold= 10;
+ if (U.tweak_threshold == 0)
+ U.tweak_threshold = 10;
/* funny name, but it is GE stuff, moves userdef stuff to engine */
// XXX space_set_commmandline_options();
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 4d2a1b69293..7eac3050b97 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -66,16 +66,16 @@
/* XXX there's V2D_SCROLL_HORIZONTAL_HIDE and V2D_SCROLL_HORIZONTAL_FULLR ... */
/* helper to allow scrollbars to dynamically hide
- * - returns a copy of the scrollbar settings with the flags to display
+ * - returns a copy of the scrollbar settings with the flags to display
* horizontal/vertical scrollbars removed
* - input scroll value is the v2d->scroll var
* - hide flags are set per region at drawtime
*/
static int view2d_scroll_mapped(int scroll)
{
- if(scroll & V2D_SCROLL_HORIZONTAL_HIDE)
+ if (scroll & V2D_SCROLL_HORIZONTAL_HIDE)
scroll &= ~(V2D_SCROLL_HORIZONTAL);
- if(scroll & V2D_SCROLL_VERTICAL_HIDE)
+ if (scroll & V2D_SCROLL_VERTICAL_HIDE)
scroll &= ~(V2D_SCROLL_VERTICAL);
return scroll;
}
@@ -86,24 +86,24 @@ static void view2d_masks(View2D *v2d)
int scroll;
/* mask - view frame */
- v2d->mask.xmin= v2d->mask.ymin= 0;
- v2d->mask.xmax= v2d->winx - 1; /* -1 yes! masks are pixels */
- v2d->mask.ymax= v2d->winy - 1;
+ v2d->mask.xmin = v2d->mask.ymin = 0;
+ v2d->mask.xmax = v2d->winx - 1; /* -1 yes! masks are pixels */
+ v2d->mask.ymax = v2d->winy - 1;
#if 0
// XXX see above
- v2d->scroll &= ~(V2D_SCROLL_HORIZONTAL_HIDE|V2D_SCROLL_VERTICAL_HIDE);
+ v2d->scroll &= ~(V2D_SCROLL_HORIZONTAL_HIDE | V2D_SCROLL_VERTICAL_HIDE);
/* check size if: */
if (v2d->scroll & V2D_SCROLL_HORIZONTAL)
- if(!(v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL))
- if (v2d->tot.xmax-v2d->tot.xmin <= v2d->cur.xmax-v2d->cur.xmin)
+ if (!(v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL))
+ if (v2d->tot.xmax - v2d->tot.xmin <= v2d->cur.xmax - v2d->cur.xmin)
v2d->scroll |= V2D_SCROLL_HORIZONTAL_HIDE;
if (v2d->scroll & V2D_SCROLL_VERTICAL)
- if(!(v2d->scroll & V2D_SCROLL_SCALE_VERTICAL))
- if (v2d->tot.ymax-v2d->tot.ymin <= v2d->cur.ymax-v2d->cur.ymin)
+ if (!(v2d->scroll & V2D_SCROLL_SCALE_VERTICAL))
+ if (v2d->tot.ymax - v2d->tot.ymin <= v2d->cur.ymax - v2d->cur.ymin)
v2d->scroll |= V2D_SCROLL_VERTICAL_HIDE;
#endif
- scroll= view2d_scroll_mapped(v2d->scroll);
+ scroll = view2d_scroll_mapped(v2d->scroll);
/* scrollers shrink mask area, but should be based off regionsize
* - they can only be on one to two edges of the region they define
@@ -113,42 +113,42 @@ static void view2d_masks(View2D *v2d)
/* vertical scroller */
if (scroll & V2D_SCROLL_LEFT) {
/* on left-hand edge of region */
- v2d->vert= v2d->mask;
- v2d->vert.xmax= V2D_SCROLL_WIDTH;
- v2d->mask.xmin= v2d->vert.xmax + 1;
+ v2d->vert = v2d->mask;
+ v2d->vert.xmax = V2D_SCROLL_WIDTH;
+ v2d->mask.xmin = v2d->vert.xmax + 1;
}
else if (scroll & V2D_SCROLL_RIGHT) {
/* on right-hand edge of region */
- v2d->vert= v2d->mask;
+ v2d->vert = v2d->mask;
v2d->vert.xmax++; /* one pixel extra... was leaving a minor gap... */
- v2d->vert.xmin= v2d->vert.xmax - V2D_SCROLL_WIDTH;
- v2d->mask.xmax= v2d->vert.xmin - 1;
+ v2d->vert.xmin = v2d->vert.xmax - V2D_SCROLL_WIDTH;
+ v2d->mask.xmax = v2d->vert.xmin - 1;
}
/* horizontal scroller */
- if (scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)) {
+ if (scroll & (V2D_SCROLL_BOTTOM | V2D_SCROLL_BOTTOM_O)) {
/* on bottom edge of region (V2D_SCROLL_BOTTOM_O is outliner, the other is for standard) */
- v2d->hor= v2d->mask;
- v2d->hor.ymax= V2D_SCROLL_HEIGHT;
- v2d->mask.ymin= v2d->hor.ymax + 1;
+ v2d->hor = v2d->mask;
+ v2d->hor.ymax = V2D_SCROLL_HEIGHT;
+ v2d->mask.ymin = v2d->hor.ymax + 1;
}
else if (scroll & V2D_SCROLL_TOP) {
/* on upper edge of region */
- v2d->hor= v2d->mask;
- v2d->hor.ymin= v2d->hor.ymax - V2D_SCROLL_HEIGHT;
- v2d->mask.ymax= v2d->hor.ymin - 1;
+ v2d->hor = v2d->mask;
+ v2d->hor.ymin = v2d->hor.ymax - V2D_SCROLL_HEIGHT;
+ v2d->mask.ymax = v2d->hor.ymin - 1;
}
/* adjust vertical scroller if there's a horizontal scroller, to leave corner free */
if (scroll & V2D_SCROLL_VERTICAL) {
/* just set y min/max for vertical scroller to y min/max of mask as appropriate */
- if (scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)) {
+ if (scroll & (V2D_SCROLL_BOTTOM | V2D_SCROLL_BOTTOM_O)) {
/* on bottom edge of region (V2D_SCROLL_BOTTOM_O is outliner, the other is for standard) */
- v2d->vert.ymin= v2d->mask.ymin;
+ v2d->vert.ymin = v2d->mask.ymin;
}
else if (scroll & V2D_SCROLL_TOP) {
/* on upper edge of region */
- v2d->vert.ymax= v2d->mask.ymax;
+ v2d->vert.ymax = v2d->mask.ymax;
}
}
}
@@ -157,146 +157,146 @@ static void view2d_masks(View2D *v2d)
/* Refresh and Validation */
-/* Initialise all relevant View2D data (including view rects if first time) and/or refresh mask sizes after view resize
+/* Initialize all relevant View2D data (including view rects if first time) and/or refresh mask sizes after view resize
* - for some of these presets, it is expected that the region will have defined some
- * additional settings necessary for the customisation of the 2D viewport to its requirements
+ * additional settings necessary for the customisation of the 2D viewport to its requirements
* - this function should only be called from region init() callbacks, where it is expected that
- * this is called before UI_view2d_size_update(), as this one checks that the rects are properly initialised.
+ * this is called before UI_view2d_size_update(), as this one checks that the rects are properly initialized.
*/
void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
{
- short tot_changed= 0, init= 0;
- uiStyle *style= UI_GetStyle();
+ short tot_changed = 0, init = 0;
+ uiStyle *style = UI_GetStyle();
- /* initialise data if there is a need for such */
+ /* initialize data if there is a need for such */
if ((v2d->flag & V2D_IS_INITIALISED) == 0) {
- /* set initialised flag so that View2D doesn't get reinitialised next time again */
+ /* set initialized flag so that View2D doesn't get reinitialised next time again */
v2d->flag |= V2D_IS_INITIALISED;
- init= 1;
+ init = 1;
/* see eView2D_CommonViewTypes in UI_view2d.h for available view presets */
switch (type) {
- /* 'standard view' - optimum setup for 'standard' view behaviour,
+ /* 'standard view' - optimum setup for 'standard' view behavior,
* that should be used new views as basis for their
- * own unique View2D settings, which should be used instead of this in most cases...
+ * own unique View2D settings, which should be used instead of this in most cases...
*/
case V2D_COMMONVIEW_STANDARD:
{
/* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */
- v2d->keepzoom= (V2D_KEEPASPECT|V2D_LIMITZOOM);
- v2d->minzoom= 0.01f;
- v2d->maxzoom= 1000.0f;
+ v2d->keepzoom = (V2D_KEEPASPECT | V2D_LIMITZOOM);
+ v2d->minzoom = 0.01f;
+ v2d->maxzoom = 1000.0f;
/* tot rect and cur should be same size, and aligned using 'standard' OpenGL coordinates for now
* - region can resize 'tot' later to fit other data
* - keeptot is only within bounds, as strict locking is not that critical
* - view is aligned for (0,0) -> (winx-1, winy-1) setup
*/
- v2d->align= (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y);
- v2d->keeptot= V2D_KEEPTOT_BOUNDS;
+ v2d->align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_NEG_Y);
+ v2d->keeptot = V2D_KEEPTOT_BOUNDS;
- v2d->tot.xmin= v2d->tot.ymin= 0.0f;
- v2d->tot.xmax= (float)(winx - 1);
- v2d->tot.ymax= (float)(winy - 1);
+ v2d->tot.xmin = v2d->tot.ymin = 0.0f;
+ v2d->tot.xmax = (float)(winx - 1);
+ v2d->tot.ymax = (float)(winy - 1);
- v2d->cur= v2d->tot;
+ v2d->cur = v2d->tot;
/* scrollers - should we have these by default? */
// XXX for now, we don't override this, or set it either!
}
- break;
+ break;
/* 'list/channel view' - zoom, aspect ratio, and alignment restrictions are set here */
case V2D_COMMONVIEW_LIST:
{
/* zoom + aspect ratio are locked */
- v2d->keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT);
- v2d->minzoom= v2d->maxzoom= 1.0f;
+ v2d->keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT);
+ v2d->minzoom = v2d->maxzoom = 1.0f;
/* tot rect has strictly regulated placement, and must only occur in +/- quadrant */
- v2d->align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
+ v2d->align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y);
v2d->keeptot = V2D_KEEPTOT_STRICT;
- tot_changed= 1;
+ tot_changed = 1;
/* scroller settings are currently not set here... that is left for regions... */
}
- break;
+ break;
/* 'stack view' - practically the same as list/channel view, except is located in the pos y half instead.
- * zoom, aspect ratio, and alignment restrictions are set here */
+ * zoom, aspect ratio, and alignment restrictions are set here */
case V2D_COMMONVIEW_STACK:
{
/* zoom + aspect ratio are locked */
- v2d->keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT);
- v2d->minzoom= v2d->maxzoom= 1.0f;
+ v2d->keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT);
+ v2d->minzoom = v2d->maxzoom = 1.0f;
/* tot rect has strictly regulated placement, and must only occur in +/+ quadrant */
- v2d->align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y);
+ v2d->align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_NEG_Y);
v2d->keeptot = V2D_KEEPTOT_STRICT;
- tot_changed= 1;
+ tot_changed = 1;
/* scroller settings are currently not set here... that is left for regions... */
}
- break;
+ break;
/* 'header' regions - zoom, aspect ratio, alignment, and panning restrictions are set here */
case V2D_COMMONVIEW_HEADER:
{
/* zoom + aspect ratio are locked */
- v2d->keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT);
- v2d->minzoom= v2d->maxzoom= 1.0f;
- v2d->min[0]= v2d->max[0]= (float)(winx-1);
- v2d->min[1]= v2d->max[1]= (float)(winy-1);
+ v2d->keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT);
+ v2d->minzoom = v2d->maxzoom = 1.0f;
+ v2d->min[0] = v2d->max[0] = (float)(winx - 1);
+ v2d->min[1] = v2d->max[1] = (float)(winy - 1);
/* tot rect has strictly regulated placement, and must only occur in +/+ quadrant */
- v2d->align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y);
+ v2d->align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_NEG_Y);
v2d->keeptot = V2D_KEEPTOT_STRICT;
- tot_changed= 1;
+ tot_changed = 1;
/* panning in y-axis is prohibited */
- v2d->keepofs= V2D_LOCKOFS_Y;
+ v2d->keepofs = V2D_LOCKOFS_Y;
/* absolutely no scrollers allowed */
- v2d->scroll= 0;
+ v2d->scroll = 0;
}
- break;
+ break;
/* panels view, with horizontal/vertical align */
case V2D_COMMONVIEW_PANELS_UI:
{
- float panelzoom= (style) ? style->panelzoom : 1.0f;
+ float panelzoom = (style) ? style->panelzoom : 1.0f;
/* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */
- v2d->keepzoom= (V2D_KEEPASPECT|V2D_LIMITZOOM|V2D_KEEPZOOM);
- v2d->minzoom= 0.5f;
- v2d->maxzoom= 2.0f;
+ v2d->keepzoom = (V2D_KEEPASPECT | V2D_LIMITZOOM | V2D_KEEPZOOM);
+ v2d->minzoom = 0.5f;
+ v2d->maxzoom = 2.0f;
//tot_changed= 1;
- v2d->align= (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
- v2d->keeptot= V2D_KEEPTOT_BOUNDS;
+ v2d->align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y);
+ v2d->keeptot = V2D_KEEPTOT_BOUNDS;
- v2d->scroll |= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
+ v2d->scroll |= (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM);
v2d->scroll |= V2D_SCROLL_HORIZONTAL_HIDE;
v2d->scroll &= ~V2D_SCROLL_VERTICAL_HIDE;
- v2d->tot.xmin= 0.0f;
- v2d->tot.xmax= winx;
+ v2d->tot.xmin = 0.0f;
+ v2d->tot.xmax = winx;
- v2d->tot.ymax= 0.0f;
- v2d->tot.ymin= -winy;
+ v2d->tot.ymax = 0.0f;
+ v2d->tot.ymin = -winy;
- v2d->cur.xmin= 0.0f;
+ v2d->cur.xmin = 0.0f;
/* bad workaround for keeping zoom level with scrollers */
- v2d->cur.xmax= (winx - V2D_SCROLL_WIDTH)*panelzoom;
+ v2d->cur.xmax = (winx - V2D_SCROLL_WIDTH) * panelzoom;
- v2d->cur.ymax= 0.0f;
- v2d->cur.ymin= (-winy)*panelzoom;
+ v2d->cur.ymax = 0.0f;
+ v2d->cur.ymin = (-winy) * panelzoom;
}
- break;
+ break;
- /* other view types are completely defined using their own settings already */
+ /* other view types are completely defined using their own settings already */
default:
/* we don't do anything here, as settings should be fine, but just make sure that rect */
break;
@@ -304,8 +304,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
}
/* store view size */
- v2d->winx= winx;
- v2d->winy= winy;
+ v2d->winx = winx;
+ v2d->winy = winy;
/* set masks */
view2d_masks(v2d);
@@ -328,12 +328,12 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
rctf *cur, *tot;
/* use mask as size of region that View2D resides in, as it takes into account scrollbars already */
- winx= (float)(v2d->mask.xmax - v2d->mask.xmin + 1);
- winy= (float)(v2d->mask.ymax - v2d->mask.ymin + 1);
+ winx = (float)(v2d->mask.xmax - v2d->mask.xmin + 1);
+ winy = (float)(v2d->mask.ymax - v2d->mask.ymin + 1);
/* get pointers to rcts for less typing */
- cur= &v2d->cur;
- tot= &v2d->tot;
+ cur = &v2d->cur;
+ tot = &v2d->tot;
/* we must satisfy the following constraints (in decreasing order of importance):
* - alignment restrictions are respected
@@ -347,44 +347,44 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
* - firstly, we calculate the sizes of the rects
* - curwidth and curheight are saved as reference... modify width and height values here
*/
- totwidth= tot->xmax - tot->xmin;
- totheight= tot->ymax - tot->ymin;
- curwidth= width= cur->xmax - cur->xmin;
- curheight= height= cur->ymax - cur->ymin;
+ totwidth = tot->xmax - tot->xmin;
+ totheight = tot->ymax - tot->ymin;
+ curwidth = width = cur->xmax - cur->xmin;
+ curheight = height = cur->ymax - cur->ymin;
/* if zoom is locked, size on the appropriate axis is reset to mask size */
if (v2d->keepzoom & V2D_LOCKZOOM_X)
- width= winx;
+ width = winx;
if (v2d->keepzoom & V2D_LOCKZOOM_Y)
- height= winy;
+ height = winy;
/* values used to divide, so make it safe
* NOTE: width and height must use FLT_MIN instead of 1, otherwise it is impossible to
- * get enough resolution in Graph Editor for editing some curves
+ * get enough resolution in Graph Editor for editing some curves
*/
- if(width < FLT_MIN) width= 1;
- if(height < FLT_MIN) height= 1;
- if(winx < 1) winx= 1;
- if(winy < 1) winy= 1;
+ if (width < FLT_MIN) width = 1;
+ if (height < FLT_MIN) height = 1;
+ if (winx < 1) winx = 1;
+ if (winy < 1) winy = 1;
/* V2D_LIMITZOOM indicates that zoom level should be preserved when the window size changes */
if (resize && (v2d->keepzoom & V2D_KEEPZOOM)) {
float zoom, oldzoom;
- if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0) {
- zoom= winx / width;
- oldzoom= v2d->oldwinx / curwidth;
+ if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0) {
+ zoom = winx / width;
+ oldzoom = v2d->oldwinx / curwidth;
- if(oldzoom != zoom)
- width *= zoom/oldzoom;
+ if (oldzoom != zoom)
+ width *= zoom / oldzoom;
}
- if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0) {
- zoom= winy / height;
- oldzoom= v2d->oldwiny / curheight;
+ if ((v2d->keepzoom & V2D_LOCKZOOM_Y) == 0) {
+ zoom = winy / height;
+ oldzoom = v2d->oldwiny / curheight;
- if(oldzoom != zoom)
- height *= zoom/oldzoom;
+ if (oldzoom != zoom)
+ height *= zoom / oldzoom;
}
}
/* keepzoom (V2D_LIMITZOOM set), indicates that zoom level on each axis must not exceed limits
@@ -394,19 +394,19 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
float zoom, fac;
/* check if excessive zoom on x-axis */
- if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0) {
- zoom= winx / width;
+ if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0) {
+ zoom = winx / width;
if ((zoom < v2d->minzoom) || (zoom > v2d->maxzoom)) {
- fac= (zoom < v2d->minzoom) ? (zoom / v2d->minzoom) : (zoom / v2d->maxzoom);
+ fac = (zoom < v2d->minzoom) ? (zoom / v2d->minzoom) : (zoom / v2d->maxzoom);
width *= fac;
}
}
/* check if excessive zoom on y-axis */
- if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0) {
- zoom= winy / height;
+ if ((v2d->keepzoom & V2D_LOCKZOOM_Y) == 0) {
+ zoom = winy / height;
if ((zoom < v2d->minzoom) || (zoom > v2d->maxzoom)) {
- fac= (zoom < v2d->minzoom) ? (zoom / v2d->minzoom) : (zoom / v2d->maxzoom);
+ fac = (zoom < v2d->minzoom) ? (zoom / v2d->minzoom) : (zoom / v2d->maxzoom);
height *= fac;
}
}
@@ -419,35 +419,35 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
/* check if we should restore aspect ratio (if view size changed) */
if (v2d->keepzoom & V2D_KEEPASPECT) {
- short do_x=0, do_y=0, do_cur /* , do_win */ /* UNUSED */;
+ short do_x = 0, do_y = 0, do_cur /* , do_win */ /* UNUSED */;
float /* curRatio, */ /* UNUSED */ winRatio;
/* when a window edge changes, the aspect ratio can't be used to
* find which is the best new 'cur' rect. thats why it stores 'old'
*/
- if (winx != v2d->oldwinx) do_x= 1;
- if (winy != v2d->oldwiny) do_y= 1;
+ if (winx != v2d->oldwinx) do_x = 1;
+ if (winy != v2d->oldwiny) do_y = 1;
/* curRatio= height / width; */ /* UNUSED */
- winRatio= winy / winx;
+ winRatio = winy / winx;
/* both sizes change (area/region maximised) */
if (do_x == do_y) {
if (do_x && do_y) {
/* here is 1,1 case, so all others must be 0,0 */
- if (ABS(winx - v2d->oldwinx) > ABS(winy - v2d->oldwiny)) do_y= 0;
- else do_x= 0;
+ if (ABS(winx - v2d->oldwinx) > ABS(winy - v2d->oldwiny)) do_y = 0;
+ else do_x = 0;
}
- else if (winRatio > 1.0f) do_x= 0;
- else do_x= 1;
+ else if (winRatio > 1.0f) do_x = 0;
+ else do_x = 1;
}
- do_cur= do_x;
+ do_cur = do_x;
/* do_win= do_y; */ /* UNUSED */
if (do_cur) {
if ((v2d->keeptot == V2D_KEEPTOT_STRICT) && (winx != v2d->oldwinx)) {
/* special exception for Outliner (and later channel-lists):
- * - The view may be moved left to avoid contents being pushed out of view when view shrinks.
+ * - The view may be moved left to avoid contents being pushed out of view when view shrinks.
* - The keeptot code will make sure cur->xmin will not be less than tot->xmin (which cannot be allowed)
* - width is not adjusted for changed ratios here...
*/
@@ -464,7 +464,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
}
else {
/* portrait window: correct for x */
- width= height / winRatio;
+ width = height / winRatio;
}
}
else {
@@ -488,8 +488,8 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
}
/* store region size for next time */
- v2d->oldwinx= (short)winx;
- v2d->oldwiny= (short)winy;
+ v2d->oldwinx = (short)winx;
+ v2d->oldwiny = (short)winy;
}
/* Step 2: apply new sizes to cur rect, but need to take into account alignment settings here... */
@@ -502,14 +502,14 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
cur->xmax += width - (cur->xmax - cur->xmin);
}
else if (v2d->keepofs & V2D_KEEPOFS_X) {
- if(v2d->align & V2D_ALIGN_NO_POS_X)
+ if (v2d->align & V2D_ALIGN_NO_POS_X)
cur->xmin -= width - (cur->xmax - cur->xmin);
else
cur->xmax += width - (cur->xmax - cur->xmin);
}
else {
- temp= (cur->xmax + cur->xmin) * 0.5f;
- dh= width * 0.5f;
+ temp = (cur->xmax + cur->xmin) * 0.5f;
+ dh = width * 0.5f;
cur->xmin = temp - dh;
cur->xmax = temp + dh;
@@ -520,14 +520,14 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
cur->ymax += height - (cur->ymax - cur->ymin);
}
else if (v2d->keepofs & V2D_KEEPOFS_Y) {
- if(v2d->align & V2D_ALIGN_NO_POS_Y)
+ if (v2d->align & V2D_ALIGN_NO_POS_Y)
cur->ymin -= height - (cur->ymax - cur->ymin);
else
cur->ymax += height - (cur->ymax - cur->ymin);
}
else {
- temp= (cur->ymax + cur->ymin) * 0.5f;
- dh= height * 0.5f;
+ temp = (cur->ymax + cur->ymin) * 0.5f;
+ dh = height * 0.5f;
cur->ymin = temp - dh;
cur->ymax = temp + dh;
@@ -540,14 +540,14 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
float temp, diff;
/* recalculate extents of cur */
- curwidth= cur->xmax - cur->xmin;
- curheight= cur->ymax - cur->ymin;
+ curwidth = cur->xmax - cur->xmin;
+ curheight = cur->ymax - cur->ymin;
/* width */
- if ( (curwidth > totwidth) && !(v2d->keepzoom & (V2D_KEEPZOOM|V2D_LOCKZOOM_X|V2D_LIMITZOOM)) ) {
+ if ( (curwidth > totwidth) && !(v2d->keepzoom & (V2D_KEEPZOOM | V2D_LOCKZOOM_X | V2D_LIMITZOOM)) ) {
/* if zoom doesn't have to be maintained, just clamp edges */
- if (cur->xmin < tot->xmin) cur->xmin= tot->xmin;
- if (cur->xmax > tot->xmax) cur->xmax= tot->xmax;
+ if (cur->xmin < tot->xmin) cur->xmin = tot->xmin;
+ if (cur->xmax > tot->xmax) cur->xmax = tot->xmax;
}
else if (v2d->keeptot == V2D_KEEPTOT_STRICT) {
/* This is an exception for the outliner (and later channel-lists, headers)
@@ -556,21 +556,21 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
*/
if (cur->xmin < tot->xmin) {
/* move cur across so that it sits at minimum of tot */
- temp= tot->xmin - cur->xmin;
+ temp = tot->xmin - cur->xmin;
cur->xmin += temp;
cur->xmax += temp;
}
else if (cur->xmax > tot->xmax) {
/* - only offset by difference of cur-xmax and tot-xmax if that would not move
- * cur-xmin to lie past tot-xmin
+ * cur-xmin to lie past tot-xmin
* - otherwise, simply shift to tot-xmin???
*/
- temp= cur->xmax - tot->xmax;
+ temp = cur->xmax - tot->xmax;
if ((cur->xmin - temp) < tot->xmin) {
/* only offset by difference from cur-min and tot-min */
- temp= cur->xmin - tot->xmin;
+ temp = cur->xmin - tot->xmin;
cur->xmin -= temp;
cur->xmax -= temp;
@@ -583,38 +583,38 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
}
else {
/* This here occurs when:
- * - width too big, but maintaining zoom (i.e. widths cannot be changed)
+ * - width too big, but maintaining zoom (i.e. widths cannot be changed)
* - width is OK, but need to check if outside of boundaries
*
* So, resolution is to just shift view by the gap between the extremities.
* We favour moving the 'minimum' across, as that's origin for most things
- * (XXX - in the past, max was favoured... if there are bugs, swap!)
+ * (XXX - in the past, max was favored... if there are bugs, swap!)
*/
if ((cur->xmin < tot->xmin) && (cur->xmax > tot->xmax)) {
/* outside boundaries on both sides, so take middle-point of tot, and place in balanced way */
- temp= (tot->xmax + tot->xmin) * 0.5f;
- diff= curheight * 0.5f;
+ temp = (tot->xmax + tot->xmin) * 0.5f;
+ diff = curheight * 0.5f;
- cur->xmin= temp - diff;
- cur->xmax= temp + diff;
+ cur->xmin = temp - diff;
+ cur->xmax = temp + diff;
}
else if (cur->xmin < tot->xmin) {
/* move cur across so that it sits at minimum of tot */
- temp= tot->xmin - cur->xmin;
+ temp = tot->xmin - cur->xmin;
cur->xmin += temp;
cur->xmax += temp;
}
else if (cur->xmax > tot->xmax) {
/* - only offset by difference of cur-xmax and tot-xmax if that would not move
- * cur-xmin to lie past tot-xmin
+ * cur-xmin to lie past tot-xmin
* - otherwise, simply shift to tot-xmin???
*/
- temp= cur->xmax - tot->xmax;
+ temp = cur->xmax - tot->xmax;
if ((cur->xmin - temp) < tot->xmin) {
/* only offset by difference from cur-min and tot-min */
- temp= cur->xmin - tot->xmin;
+ temp = cur->xmin - tot->xmin;
cur->xmin -= temp;
cur->xmax -= temp;
@@ -627,14 +627,14 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
}
/* height */
- if ( (curheight > totheight) && !(v2d->keepzoom & (V2D_KEEPZOOM|V2D_LOCKZOOM_Y|V2D_LIMITZOOM)) ) {
+ if ( (curheight > totheight) && !(v2d->keepzoom & (V2D_KEEPZOOM | V2D_LOCKZOOM_Y | V2D_LIMITZOOM)) ) {
/* if zoom doesn't have to be maintained, just clamp edges */
- if (cur->ymin < tot->ymin) cur->ymin= tot->ymin;
- if (cur->ymax > tot->ymax) cur->ymax= tot->ymax;
+ if (cur->ymin < tot->ymin) cur->ymin = tot->ymin;
+ if (cur->ymax > tot->ymax) cur->ymax = tot->ymax;
}
else {
/* This here occurs when:
- * - height too big, but maintaining zoom (i.e. heights cannot be changed)
+ * - height too big, but maintaining zoom (i.e. heights cannot be changed)
* - height is OK, but need to check if outside of boundaries
*
* So, resolution is to just shift view by the gap between the extremities.
@@ -642,22 +642,22 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
*/
if ((cur->ymin < tot->ymin) && (cur->ymax > tot->ymax)) {
/* outside boundaries on both sides, so take middle-point of tot, and place in balanced way */
- temp= (tot->ymax + tot->ymin) * 0.5f;
- diff= curheight * 0.5f;
+ temp = (tot->ymax + tot->ymin) * 0.5f;
+ diff = curheight * 0.5f;
- cur->ymin= temp - diff;
- cur->ymax= temp + diff;
+ cur->ymin = temp - diff;
+ cur->ymax = temp + diff;
}
else if (cur->ymin < tot->ymin) {
/* there's still space remaining, so shift up */
- temp= tot->ymin - cur->ymin;
+ temp = tot->ymin - cur->ymin;
cur->ymin += temp;
cur->ymax += temp;
}
else if (cur->ymax > tot->ymax) {
/* there's still space remaining, so shift down */
- temp= cur->ymax - tot->ymax;
+ temp = cur->ymax - tot->ymax;
cur->ymin -= temp;
cur->ymax -= temp;
@@ -680,7 +680,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
/* width is in negative-x half */
if (v2d->cur.xmax > 0) {
v2d->cur.xmin -= v2d->cur.xmax;
- v2d->cur.xmax= 0.0f;
+ v2d->cur.xmax = 0.0f;
}
}
else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) {
@@ -726,25 +726,25 @@ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
ARegion *ar;
/* don't continue if no view syncing to be done */
- if ((v2dcur->flag & (V2D_VIEWSYNC_SCREEN_TIME|V2D_VIEWSYNC_AREA_VERTICAL)) == 0)
+ if ((v2dcur->flag & (V2D_VIEWSYNC_SCREEN_TIME | V2D_VIEWSYNC_AREA_VERTICAL)) == 0)
return;
/* check if doing within area syncing (i.e. channels/vertical) */
if ((v2dcur->flag & V2D_VIEWSYNC_AREA_VERTICAL) && (area)) {
- for (ar= area->regionbase.first; ar; ar= ar->next) {
+ for (ar = area->regionbase.first; ar; ar = ar->next) {
/* don't operate on self */
if (v2dcur != &ar->v2d) {
/* only if view has vertical locks enabled */
if (ar->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) {
if (flag == V2D_LOCK_COPY) {
/* other views with locks on must copy active */
- ar->v2d.cur.ymin= v2dcur->cur.ymin;
- ar->v2d.cur.ymax= v2dcur->cur.ymax;
+ ar->v2d.cur.ymin = v2dcur->cur.ymin;
+ ar->v2d.cur.ymax = v2dcur->cur.ymax;
}
else { /* V2D_LOCK_SET */
- /* active must copy others */
- v2dcur->cur.ymin= ar->v2d.cur.ymin;
- v2dcur->cur.ymax= ar->v2d.cur.ymax;
+ /* active must copy others */
+ v2dcur->cur.ymin = ar->v2d.cur.ymin;
+ v2dcur->cur.ymax = ar->v2d.cur.ymax;
}
/* region possibly changed, so refresh */
@@ -756,21 +756,21 @@ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
/* check if doing whole screen syncing (i.e. time/horizontal) */
if ((v2dcur->flag & V2D_VIEWSYNC_SCREEN_TIME) && (screen)) {
- for (sa= screen->areabase.first; sa; sa= sa->next) {
- for (ar= sa->regionbase.first; ar; ar= ar->next) {
+ for (sa = screen->areabase.first; sa; sa = sa->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
/* don't operate on self */
if (v2dcur != &ar->v2d) {
/* only if view has horizontal locks enabled */
if (ar->v2d.flag & V2D_VIEWSYNC_SCREEN_TIME) {
if (flag == V2D_LOCK_COPY) {
/* other views with locks on must copy active */
- ar->v2d.cur.xmin= v2dcur->cur.xmin;
- ar->v2d.cur.xmax= v2dcur->cur.xmax;
+ ar->v2d.cur.xmin = v2dcur->cur.xmin;
+ ar->v2d.cur.xmax = v2dcur->cur.xmax;
}
else { /* V2D_LOCK_SET */
- /* active must copy others */
- v2dcur->cur.xmin= ar->v2d.cur.xmin;
- v2dcur->cur.xmax= ar->v2d.cur.xmax;
+ /* active must copy others */
+ v2dcur->cur.xmin = ar->v2d.cur.xmin;
+ v2dcur->cur.xmax = ar->v2d.cur.xmax;
}
/* region possibly changed, so refresh */
@@ -786,113 +786,113 @@ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
/* Restore 'cur' rect to standard orientation (i.e. optimal maximum view of tot)
* This does not take into account if zooming the view on an axis will improve the view (if allowed)
*/
-void UI_view2d_curRect_reset (View2D *v2d)
+void UI_view2d_curRect_reset(View2D *v2d)
{
float width, height;
/* assume width and height of 'cur' rect by default, should be same size as mask */
- width= (float)(v2d->mask.xmax - v2d->mask.xmin + 1);
- height= (float)(v2d->mask.ymax - v2d->mask.ymin + 1);
+ width = (float)(v2d->mask.xmax - v2d->mask.xmin + 1);
+ height = (float)(v2d->mask.ymax - v2d->mask.ymin + 1);
/* handle width - posx and negx flags are mutually exclusive, so watch out */
if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) {
/* width is in negative-x half */
- v2d->cur.xmin= (float)-width;
- v2d->cur.xmax= 0.0f;
+ v2d->cur.xmin = (float)-width;
+ v2d->cur.xmax = 0.0f;
}
else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) {
/* width is in positive-x half */
- v2d->cur.xmin= 0.0f;
- v2d->cur.xmax= (float)width;
+ v2d->cur.xmin = 0.0f;
+ v2d->cur.xmax = (float)width;
}
else {
/* width is centered around x==0 */
- const float dx= (float)width / 2.0f;
+ const float dx = (float)width / 2.0f;
- v2d->cur.xmin= -dx;
- v2d->cur.xmax= dx;
+ v2d->cur.xmin = -dx;
+ v2d->cur.xmax = dx;
}
/* handle height - posx and negx flags are mutually exclusive, so watch out */
if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) {
/* height is in negative-y half */
- v2d->cur.ymin= (float)-height;
- v2d->cur.ymax= 0.0f;
+ v2d->cur.ymin = (float)-height;
+ v2d->cur.ymax = 0.0f;
}
else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) {
/* height is in positive-y half */
- v2d->cur.ymin= 0.0f;
- v2d->cur.ymax= (float)height;
+ v2d->cur.ymin = 0.0f;
+ v2d->cur.ymax = (float)height;
}
else {
/* height is centered around y==0 */
- const float dy= (float)height / 2.0f;
+ const float dy = (float)height / 2.0f;
- v2d->cur.ymin= -dy;
- v2d->cur.ymax= dy;
+ v2d->cur.ymin = -dy;
+ v2d->cur.ymax = dy;
}
}
/* ------------------ */
/* Change the size of the maximum viewable area (i.e. 'tot' rect) */
-void UI_view2d_totRect_set_resize (View2D *v2d, int width, int height, int resize)
+void UI_view2d_totRect_set_resize(View2D *v2d, int width, int height, int resize)
{
- int scroll= view2d_scroll_mapped(v2d->scroll);
+ int scroll = view2d_scroll_mapped(v2d->scroll);
/* don't do anything if either value is 0 */
- width= abs(width);
- height= abs(height);
+ width = abs(width);
+ height = abs(height);
/* hrumf! */
/* XXX: there are work arounds for this in the panel and file browse code. */
- if(scroll & V2D_SCROLL_HORIZONTAL)
+ if (scroll & V2D_SCROLL_HORIZONTAL)
width -= V2D_SCROLL_WIDTH;
- if(scroll & V2D_SCROLL_VERTICAL)
+ if (scroll & V2D_SCROLL_VERTICAL)
height -= V2D_SCROLL_HEIGHT;
if (ELEM3(0, v2d, width, height)) {
- if (G.f & G_DEBUG)
- printf("Error: View2D totRect set exiting: v2d=%p width=%d height=%d \n", (void *)v2d, width, height); // XXX temp debug info
+ if (G.debug & G_DEBUG)
+ printf("Error: View2D totRect set exiting: v2d=%p width=%d height=%d\n", (void *)v2d, width, height); // XXX temp debug info
return;
}
/* handle width - posx and negx flags are mutually exclusive, so watch out */
if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) {
/* width is in negative-x half */
- v2d->tot.xmin= (float)-width;
- v2d->tot.xmax= 0.0f;
+ v2d->tot.xmin = (float)-width;
+ v2d->tot.xmax = 0.0f;
}
else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) {
/* width is in positive-x half */
- v2d->tot.xmin= 0.0f;
- v2d->tot.xmax= (float)width;
+ v2d->tot.xmin = 0.0f;
+ v2d->tot.xmax = (float)width;
}
else {
/* width is centered around x==0 */
- const float dx= (float)width / 2.0f;
+ const float dx = (float)width / 2.0f;
- v2d->tot.xmin= -dx;
- v2d->tot.xmax= dx;
+ v2d->tot.xmin = -dx;
+ v2d->tot.xmax = dx;
}
/* handle height - posx and negx flags are mutually exclusive, so watch out */
if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) {
/* height is in negative-y half */
- v2d->tot.ymin= (float)-height;
- v2d->tot.ymax= 0.0f;
+ v2d->tot.ymin = (float)-height;
+ v2d->tot.ymax = 0.0f;
}
else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) {
/* height is in positive-y half */
- v2d->tot.ymin= 0.0f;
- v2d->tot.ymax= (float)height;
+ v2d->tot.ymin = 0.0f;
+ v2d->tot.ymax = (float)height;
}
else {
/* height is centered around y==0 */
- const float dy= (float)height / 2.0f;
+ const float dy = (float)height / 2.0f;
- v2d->tot.ymin= -dy;
- v2d->tot.ymax= dy;
+ v2d->tot.ymin = -dy;
+ v2d->tot.ymax = dy;
}
/* make sure that 'cur' rect is in a valid state as a result of these changes */
@@ -906,45 +906,45 @@ void UI_view2d_totRect_set(View2D *v2d, int width, int height)
int UI_view2d_tab_set(View2D *v2d, int tab)
{
- float default_offset[2]= {0.0f, 0.0f};
+ float default_offset[2] = {0.0f, 0.0f};
float *offset, *new_offset;
- int changed= 0;
+ int changed = 0;
/* if tab changed, change offset */
- if(tab != v2d->tab_cur && v2d->tab_offset) {
- if(tab < v2d->tab_num)
- offset= &v2d->tab_offset[tab*2];
+ if (tab != v2d->tab_cur && v2d->tab_offset) {
+ if (tab < v2d->tab_num)
+ offset = &v2d->tab_offset[tab * 2];
else
- offset= default_offset;
+ offset = default_offset;
v2d->cur.xmax += offset[0] - v2d->cur.xmin;
- v2d->cur.xmin= offset[0];
+ v2d->cur.xmin = offset[0];
v2d->cur.ymin += offset[1] - v2d->cur.ymax;
- v2d->cur.ymax= offset[1];
+ v2d->cur.ymax = offset[1];
/* validation should happen in subsequent totRect_set */
- changed= 1;
+ changed = 1;
}
/* resize array if needed */
- if(tab >= v2d->tab_num) {
- new_offset= MEM_callocN(sizeof(float)*(tab+1)*2, "view2d tab offset");
+ if (tab >= v2d->tab_num) {
+ new_offset = MEM_callocN(sizeof(float) * (tab + 1) * 2, "view2d tab offset");
- if(v2d->tab_offset) {
- memcpy(new_offset, v2d->tab_offset, sizeof(float)*v2d->tab_num*2);
+ if (v2d->tab_offset) {
+ memcpy(new_offset, v2d->tab_offset, sizeof(float) * v2d->tab_num * 2);
MEM_freeN(v2d->tab_offset);
}
- v2d->tab_offset= new_offset;
- v2d->tab_num= tab+1;
+ v2d->tab_offset = new_offset;
+ v2d->tab_num = tab + 1;
}
/* set current tab and offset */
- v2d->tab_cur= tab;
- v2d->tab_offset[2*tab+0]= v2d->cur.xmin;
- v2d->tab_offset[2*tab+1]= v2d->cur.ymax;
+ v2d->tab_cur = tab;
+ v2d->tab_offset[2 * tab + 0] = v2d->cur.xmin;
+ v2d->tab_offset[2 * tab + 1] = v2d->cur.ymax;
return changed;
}
@@ -955,21 +955,21 @@ int UI_view2d_tab_set(View2D *v2d, int tab)
/* mapping function to ensure 'cur' draws extended over the area where sliders are */
static void view2d_map_cur_using_mask(View2D *v2d, rctf *curmasked)
{
- *curmasked= v2d->cur;
+ *curmasked = v2d->cur;
if (view2d_scroll_mapped(v2d->scroll)) {
- float dx= (v2d->cur.xmax-v2d->cur.xmin)/((float)(v2d->mask.xmax-v2d->mask.xmin+1));
- float dy= (v2d->cur.ymax-v2d->cur.ymin)/((float)(v2d->mask.ymax-v2d->mask.ymin+1));
+ float dx = (v2d->cur.xmax - v2d->cur.xmin) / ((float)(v2d->mask.xmax - v2d->mask.xmin + 1));
+ float dy = (v2d->cur.ymax - v2d->cur.ymin) / ((float)(v2d->mask.ymax - v2d->mask.ymin + 1));
if (v2d->mask.xmin != 0)
- curmasked->xmin -= dx*(float)v2d->mask.xmin;
- if (v2d->mask.xmax+1 != v2d->winx)
- curmasked->xmax += dx*(float)(v2d->winx - v2d->mask.xmax-1);
+ curmasked->xmin -= dx * (float)v2d->mask.xmin;
+ if (v2d->mask.xmax + 1 != v2d->winx)
+ curmasked->xmax += dx * (float)(v2d->winx - v2d->mask.xmax - 1);
if (v2d->mask.ymin != 0)
- curmasked->ymin -= dy*(float)v2d->mask.ymin;
- if (v2d->mask.ymax+1 != v2d->winy)
- curmasked->ymax += dy*(float)(v2d->winy - v2d->mask.ymax-1);
+ curmasked->ymin -= dy * (float)v2d->mask.ymin;
+ if (v2d->mask.ymax + 1 != v2d->winy)
+ curmasked->ymax += dy * (float)(v2d->winy - v2d->mask.ymax - 1);
}
}
@@ -980,60 +980,60 @@ void UI_view2d_view_ortho(View2D *v2d)
rctf curmasked;
float xofs, yofs;
- /* pixel offsets (-0.375f) are needed to get 1:1 correspondance with pixels for smooth UI drawing,
- * but only applied where requsted
+ /* pixel offsets (-0.375f) are needed to get 1:1 correspondence with pixels for smooth UI drawing,
+ * 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 */
- xofs= 0.001f*(v2d->cur.xmax - v2d->cur.xmin)/(v2d->mask.xmax - v2d->mask.xmin);
- yofs= 0.001f*(v2d->cur.ymax - v2d->cur.ymin)/(v2d->mask.ymax - v2d->mask.ymin);
+ xofs = 0.001f * (v2d->cur.xmax - v2d->cur.xmin) / (v2d->mask.xmax - v2d->mask.xmin);
+ yofs = 0.001f * (v2d->cur.ymax - v2d->cur.ymin) / (v2d->mask.ymax - v2d->mask.ymin);
/* apply mask-based adjustments to cur rect (due to scrollers), to eliminate scaling artifacts */
view2d_map_cur_using_mask(v2d, &curmasked);
- curmasked.xmin-= xofs; curmasked.xmax-=xofs;
- curmasked.ymin-= yofs; curmasked.ymax-=yofs;
+ curmasked.xmin -= xofs; curmasked.xmax -= xofs;
+ curmasked.ymin -= yofs; curmasked.ymax -= yofs;
/* XXX ton: this flag set by outliner, for icons */
- if(v2d->flag & V2D_PIXELOFS_X) {
- curmasked.xmin= floorf(curmasked.xmin) - 0.001f;
- curmasked.xmax= floorf(curmasked.xmax) - 0.001f;
+ if (v2d->flag & V2D_PIXELOFS_X) {
+ curmasked.xmin = floorf(curmasked.xmin) - 0.001f;
+ curmasked.xmax = floorf(curmasked.xmax) - 0.001f;
}
- if(v2d->flag & V2D_PIXELOFS_Y) {
- curmasked.ymin= floorf(curmasked.ymin) - 0.001f;
- curmasked.ymax= floorf(curmasked.ymax) - 0.001f;
+ if (v2d->flag & V2D_PIXELOFS_Y) {
+ curmasked.ymin = floorf(curmasked.ymin) - 0.001f;
+ curmasked.ymax = floorf(curmasked.ymax) - 0.001f;
}
/* set matrix on all appropriate axes */
- wmOrtho2(curmasked.xmin-xofs, curmasked.xmax-xofs, curmasked.ymin-yofs, curmasked.ymax-yofs);
+ wmOrtho2(curmasked.xmin - xofs, curmasked.xmax - xofs, curmasked.ymin - yofs, curmasked.ymax - yofs);
/* XXX is this necessary? */
glLoadIdentity();
}
/* Set view matrices to only use one axis of 'cur' only
- * - xaxis = if non-zero, only use cur x-axis, otherwise use cur-yaxis (mostly this will be used for x)
+ * - xaxis = if non-zero, only use cur x-axis, otherwise use cur-yaxis (mostly this will be used for x)
*/
void UI_view2d_view_orthoSpecial(ARegion *ar, View2D *v2d, short xaxis)
{
rctf curmasked;
float xofs, yofs;
- /* pixel offsets (-0.375f) are needed to get 1:1 correspondance with pixels for smooth UI drawing,
- * but only applied where requsted
+ /* pixel offsets (-0.375f) are needed to get 1:1 correspondence with pixels for smooth UI drawing,
+ * but only applied where requested
*/
/* XXX temp (ton) */
- xofs= 0.0f; // (v2d->flag & V2D_PIXELOFS_X) ? 0.375f : 0.0f;
- yofs= 0.0f; // (v2d->flag & V2D_PIXELOFS_Y) ? 0.375f : 0.0f;
+ xofs = 0.0f; // (v2d->flag & V2D_PIXELOFS_X) ? 0.375f : 0.0f;
+ yofs = 0.0f; // (v2d->flag & V2D_PIXELOFS_Y) ? 0.375f : 0.0f;
/* apply mask-based adjustments to cur rect (due to scrollers), to eliminate scaling artifacts */
view2d_map_cur_using_mask(v2d, &curmasked);
/* only set matrix with 'cur' coordinates on relevant axes */
if (xaxis)
- wmOrtho2(curmasked.xmin-xofs, curmasked.xmax-xofs, -yofs, ar->winy-yofs);
+ wmOrtho2(curmasked.xmin - xofs, curmasked.xmax - xofs, -yofs, ar->winy - yofs);
else
- wmOrtho2(-xofs, ar->winx-xofs, curmasked.ymin-yofs, curmasked.ymax-yofs);
+ wmOrtho2(-xofs, ar->winx - xofs, curmasked.ymin - yofs, curmasked.ymax - yofs);
/* XXX is this necessary? */
glLoadIdentity();
@@ -1043,9 +1043,9 @@ void UI_view2d_view_orthoSpecial(ARegion *ar, View2D *v2d, short xaxis)
/* Restore view matrices after drawing */
void UI_view2d_view_restore(const bContext *C)
{
- ARegion *ar= CTX_wm_region(C);
- int width= ar->winrct.xmax-ar->winrct.xmin+1;
- int height= ar->winrct.ymax-ar->winrct.ymin+1;
+ ARegion *ar = CTX_wm_region(C);
+ int width = ar->winrct.xmax - ar->winrct.xmin + 1;
+ int height = ar->winrct.ymax - ar->winrct.ymin + 1;
wmOrtho2(0.0f, (float)width, 0.0f, (float)height);
glLoadIdentity();
@@ -1058,9 +1058,9 @@ void UI_view2d_view_restore(const bContext *C)
/* View2DGrid is typedef'd in UI_view2d.h */
struct View2DGrid {
- float dx, dy; /* stepsize (in pixels) between gridlines */
- float startx, starty; /* initial coordinates to start drawing grid from */
- int powerx, powery; /* step as power of 10 */
+ float dx, dy; /* stepsize (in pixels) between gridlines */
+ float startx, starty; /* initial coordinates to start drawing grid from */
+ int powerx, powery; /* step as power of 10 */
};
/* --------------- */
@@ -1068,20 +1068,20 @@ struct View2DGrid {
/* try to write step as a power of 10 */
static void step_to_grid(float *step, int *power, int unit)
{
- const float loga= (float)log10(*step);
+ const float loga = (float)log10(*step);
float rem;
- *power= (int)(loga);
+ *power = (int)(loga);
- rem= loga - (*power);
- rem= (float)pow(10.0, rem);
+ rem = loga - (*power);
+ rem = (float)pow(10.0, rem);
if (loga < 0.0f) {
- if (rem < 0.2f) rem= 0.2f;
- else if(rem < 0.5f) rem= 0.5f;
- else rem= 1.0f;
+ if (rem < 0.2f) rem = 0.2f;
+ else if (rem < 0.5f) rem = 0.5f;
+ else rem = 1.0f;
- *step= rem * (float)pow(10.0, (*power));
+ *step = rem * (float)pow(10.0, (*power));
/* for frames, we want 1.0 frame intervals only */
if (unit == V2D_UNIT_FRAMES) {
@@ -1093,11 +1093,11 @@ static void step_to_grid(float *step, int *power, int unit)
if (rem == 1.0f) (*power)++;
}
else {
- if (rem < 2.0f) rem= 2.0f;
- else if(rem < 5.0f) rem= 5.0f;
- else rem= 10.0f;
+ if (rem < 2.0f) rem = 2.0f;
+ else if (rem < 5.0f) rem = 5.0f;
+ else rem = 10.0f;
- *step= rem * (float)pow(10.0, (*power));
+ *step = rem * (float)pow(10.0, (*power));
(*power)++;
/* prevents printing 1.0, 2.0, 3.0, etc. */
@@ -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)
@@ -1128,62 +1128,62 @@ View2DGrid *UI_view2d_grid_calc(Scene *scene, View2D *v2d, short xunits, short x
return NULL;
/* grid here is allocated... */
- grid= MEM_callocN(sizeof(View2DGrid), "View2DGrid");
+ grid = MEM_callocN(sizeof(View2DGrid), "View2DGrid");
/* rule: gridstep is minimal GRIDSTEP pixels */
if (xunits == V2D_UNIT_SECONDS) {
- seconddiv= (float)(0.01 * FPS);
+ seconddiv = (float)(0.01 * FPS);
}
else {
- seconddiv= 1.0f;
+ seconddiv = 1.0f;
}
/* calculate x-axis grid scale (only if both args are valid) */
if (ELEM(V2D_ARG_DUMMY, xunits, xclamp) == 0) {
- space= v2d->cur.xmax - v2d->cur.xmin;
- pixels= (float)(v2d->mask.xmax - v2d->mask.xmin);
+ space = v2d->cur.xmax - v2d->cur.xmin;
+ pixels = (float)(v2d->mask.xmax - v2d->mask.xmin);
- if(pixels!=0.0f) {
- grid->dx= (U.v2d_min_gridsize * space) / (seconddiv * pixels);
+ if (pixels != 0.0f) {
+ grid->dx = (U.v2d_min_gridsize * space) / (seconddiv * pixels);
step_to_grid(&grid->dx, &grid->powerx, xunits);
grid->dx *= seconddiv;
}
if (xclamp == V2D_GRID_CLAMP) {
- if (grid->dx < 0.1f) grid->dx= 0.1f;
- grid->powerx-= 2;
- if (grid->powerx < -2) grid->powerx= -2;
+ if (grid->dx < 0.1f) grid->dx = 0.1f;
+ grid->powerx -= 2;
+ if (grid->powerx < -2) grid->powerx = -2;
}
}
/* calculate y-axis grid scale (only if both args are valid) */
if (ELEM(V2D_ARG_DUMMY, yunits, yclamp) == 0) {
- space= v2d->cur.ymax - v2d->cur.ymin;
- pixels= (float)winy;
+ space = v2d->cur.ymax - v2d->cur.ymin;
+ pixels = (float)winy;
- grid->dy= U.v2d_min_gridsize * space / pixels;
+ grid->dy = U.v2d_min_gridsize * space / pixels;
step_to_grid(&grid->dy, &grid->powery, yunits);
if (yclamp == V2D_GRID_CLAMP) {
- if (grid->dy < 1.0f) grid->dy= 1.0f;
- if (grid->powery < 1) grid->powery= 1;
+ if (grid->dy < 1.0f) grid->dy = 1.0f;
+ if (grid->powery < 1) grid->powery = 1;
}
}
/* calculate start position */
if (ELEM(V2D_ARG_DUMMY, xunits, xclamp) == 0) {
- grid->startx= seconddiv*(v2d->cur.xmin/seconddiv - (float)fmod(v2d->cur.xmin/seconddiv, grid->dx/seconddiv));
- if (v2d->cur.xmin < 0.0f) grid->startx-= grid->dx;
+ grid->startx = seconddiv * (v2d->cur.xmin / seconddiv - (float)fmod(v2d->cur.xmin / seconddiv, grid->dx / seconddiv));
+ if (v2d->cur.xmin < 0.0f) grid->startx -= grid->dx;
}
else
- grid->startx= v2d->cur.xmin;
+ grid->startx = v2d->cur.xmin;
if (ELEM(V2D_ARG_DUMMY, yunits, yclamp) == 0) {
- grid->starty= (v2d->cur.ymin - (float)fmod(v2d->cur.ymin, grid->dy));
- if (v2d->cur.ymin < 0.0f) grid->starty-= grid->dy;
+ grid->starty = (v2d->cur.ymin - (float)fmod(v2d->cur.ymin, grid->dy));
+ if (v2d->cur.ymin < 0.0f) grid->starty -= grid->dy;
}
else
- grid->starty= v2d->cur.ymin;
+ grid->starty = v2d->cur.ymin;
return grid;
}
@@ -1200,71 +1200,71 @@ void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag)
/* vertical lines */
if (flag & V2D_VERTICAL_LINES) {
- /* initialise initial settings */
- vec1[0]= vec2[0]= grid->startx;
- vec1[1]= grid->starty;
- vec2[1]= v2d->cur.ymax;
+ /* initialize initial settings */
+ vec1[0] = vec2[0] = grid->startx;
+ vec1[1] = grid->starty;
+ vec2[1] = v2d->cur.ymax;
/* minor gridlines */
- step= (v2d->mask.xmax - v2d->mask.xmin + 1) / U.v2d_min_gridsize;
+ step = (v2d->mask.xmax - v2d->mask.xmin + 1) / U.v2d_min_gridsize;
UI_ThemeColor(TH_GRID);
- for (a=0; a<step; a++) {
+ for (a = 0; a < step; a++) {
glBegin(GL_LINE_STRIP);
- glVertex2fv(vec1);
- glVertex2fv(vec2);
+ glVertex2fv(vec1);
+ glVertex2fv(vec2);
glEnd();
- vec2[0]= vec1[0]+= grid->dx;
+ vec2[0] = vec1[0] += grid->dx;
}
/* major gridlines */
- vec2[0]= vec1[0]-= 0.5f*grid->dx;
+ vec2[0] = vec1[0] -= 0.5f * grid->dx;
UI_ThemeColorShade(TH_GRID, 16);
step++;
- for (a=0; a<=step; a++) {
+ for (a = 0; a <= step; a++) {
glBegin(GL_LINE_STRIP);
- glVertex2fv(vec1);
- glVertex2fv(vec2);
+ glVertex2fv(vec1);
+ glVertex2fv(vec2);
glEnd();
- vec2[0]= vec1[0]-= grid->dx;
+ vec2[0] = vec1[0] -= grid->dx;
}
}
/* horizontal lines */
if (flag & V2D_HORIZONTAL_LINES) {
/* only major gridlines */
- vec1[1]= vec2[1]= grid->starty;
- vec1[0]= grid->startx;
- vec2[0]= v2d->cur.xmax;
+ vec1[1] = vec2[1] = grid->starty;
+ vec1[0] = grid->startx;
+ vec2[0] = v2d->cur.xmax;
- step= (v2d->mask.ymax - v2d->mask.ymin + 1) / U.v2d_min_gridsize;
+ step = (v2d->mask.ymax - v2d->mask.ymin + 1) / U.v2d_min_gridsize;
UI_ThemeColor(TH_GRID);
- for (a=0; a<=step; a++) {
+ for (a = 0; a <= step; a++) {
glBegin(GL_LINE_STRIP);
- glVertex2fv(vec1);
- glVertex2fv(vec2);
+ glVertex2fv(vec1);
+ glVertex2fv(vec2);
glEnd();
- vec2[1]= vec1[1]+= grid->dy;
+ vec2[1] = vec1[1] += grid->dy;
}
/* fine grid lines */
- vec2[1]= vec1[1]-= 0.5f*grid->dy;
+ vec2[1] = vec1[1] -= 0.5f * grid->dy;
step++;
if (flag & V2D_HORIZONTAL_FINELINES) {
UI_ThemeColorShade(TH_GRID, 16);
- for (a=0; a<step; a++) {
+ for (a = 0; a < step; a++) {
glBegin(GL_LINE_STRIP);
- glVertex2fv(vec1);
- glVertex2fv(vec2);
+ glVertex2fv(vec1);
+ glVertex2fv(vec2);
glEnd();
- vec2[1]= vec1[1]-= grid->dy;
+ vec2[1] = vec1[1] -= grid->dy;
}
}
}
@@ -1274,25 +1274,25 @@ void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag)
/* horizontal axis */
if (flag & V2D_HORIZONTAL_AXIS) {
- vec1[0]= v2d->cur.xmin;
- vec2[0]= v2d->cur.xmax;
- vec1[1]= vec2[1]= 0.0f;
+ vec1[0] = v2d->cur.xmin;
+ vec2[0] = v2d->cur.xmax;
+ vec1[1] = vec2[1] = 0.0f;
glBegin(GL_LINE_STRIP);
- glVertex2fv(vec1);
- glVertex2fv(vec2);
+ glVertex2fv(vec1);
+ glVertex2fv(vec2);
glEnd();
}
/* vertical axis */
if (flag & V2D_VERTICAL_AXIS) {
- vec1[1]= v2d->cur.ymin;
- vec2[1]= v2d->cur.ymax;
- vec1[0]= vec2[0]= 0.0f;
+ vec1[1] = v2d->cur.ymin;
+ vec2[1] = v2d->cur.ymax;
+ vec1[0] = vec2[0] = 0.0f;
glBegin(GL_LINE_STRIP);
- glVertex2fv(vec1);
- glVertex2fv(vec2);
+ glVertex2fv(vec1);
+ glVertex2fv(vec2);
glEnd();
}
}
@@ -1300,20 +1300,20 @@ void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag)
/* Draw a constant grid in given 2d-region */
void UI_view2d_constant_grid_draw(View2D *v2d)
{
- float start, step= 25.0f;
+ float start, step = 25.0f;
UI_ThemeColorShade(TH_BACK, -10);
- start= v2d->cur.xmin - (float)fmod(v2d->cur.xmin, step);
+ start = v2d->cur.xmin - (float)fmod(v2d->cur.xmin, step);
glBegin(GL_LINES);
- for(; start<v2d->cur.xmax; start+=step) {
+ for (; start < v2d->cur.xmax; start += step) {
glVertex2f(start, v2d->cur.ymin);
glVertex2f(start, v2d->cur.ymax);
}
- start= v2d->cur.ymin - (float)fmod(v2d->cur.ymin, step);
- for(; start<v2d->cur.ymax; start+=step) {
+ start = v2d->cur.ymin - (float)fmod(v2d->cur.ymin, step);
+ for (; start < v2d->cur.ymax; start += step) {
glVertex2f(v2d->cur.xmin, start);
glVertex2f(v2d->cur.xmax, start);
}
@@ -1331,8 +1331,8 @@ void UI_view2d_constant_grid_draw(View2D *v2d)
/* the price we pay for not exposting structs :( */
void UI_view2d_grid_size(View2DGrid *grid, float *r_dx, float *r_dy)
{
- *r_dx= grid->dx;
- *r_dy= grid->dy;
+ *r_dx = grid->dx;
+ *r_dy = grid->dy;
}
/* free temporary memory used for drawing grid */
@@ -1349,20 +1349,20 @@ void UI_view2d_grid_free(View2DGrid *grid)
/* View2DScrollers is typedef'd in UI_view2d.h
* WARNING: the start of this struct must not change, as view2d_ops.c uses this too.
- * For now, we don't need to have a separate (internal) header for structs like this...
+ * For now, we don't need to have a separate (internal) header for structs like this...
*/
struct View2DScrollers {
- /* focus bubbles */
- int vert_min, vert_max; /* vertical scrollbar */
- int hor_min, hor_max; /* horizontal scrollbar */
+ /* focus bubbles */
+ int vert_min, vert_max; /* vertical scrollbar */
+ int hor_min, hor_max; /* horizontal scrollbar */
- rcti hor, vert; /* exact size of slider backdrop */
- int horfull, vertfull; /* set if sliders are full, we don't draw them */
+ rcti hor, vert; /* exact size of slider backdrop */
+ int horfull, vertfull; /* set if sliders are full, we don't draw them */
/* scales */
- View2DGrid *grid; /* grid for coordinate drawing */
- short xunits, xclamp; /* units and clamping options for x-axis */
- short yunits, yclamp; /* units and clamping options for y-axis */
+ View2DGrid *grid; /* grid for coordinate drawing */
+ short xunits, xclamp; /* units and clamping options for x-axis */
+ short yunits, yclamp; /* units and clamping options for y-axis */
};
/* Calculate relevant scroller properties */
@@ -1371,35 +1371,35 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short
View2DScrollers *scrollers;
rcti vert, hor;
float fac1, fac2, totsize, scrollsize;
- int scroll= view2d_scroll_mapped(v2d->scroll);
+ int scroll = view2d_scroll_mapped(v2d->scroll);
/* scrollers is allocated here... */
- scrollers= MEM_callocN(sizeof(View2DScrollers), "View2DScrollers");
+ scrollers = MEM_callocN(sizeof(View2DScrollers), "View2DScrollers");
- vert= v2d->vert;
- hor= v2d->hor;
+ vert = v2d->vert;
+ hor = v2d->hor;
/* slider rects need to be smaller than region */
- hor.xmin+=4;
- hor.xmax-=4;
+ hor.xmin += 4;
+ hor.xmax -= 4;
if (scroll & V2D_SCROLL_BOTTOM)
- hor.ymin+=4;
+ hor.ymin += 4;
else
- hor.ymax-=4;
+ hor.ymax -= 4;
if (scroll & V2D_SCROLL_LEFT)
- vert.xmin+=4;
+ vert.xmin += 4;
else
- vert.xmax-=4;
- vert.ymin+=4;
- vert.ymax-=4;
+ vert.xmax -= 4;
+ vert.ymin += 4;
+ vert.ymax -= 4;
- CLAMP(vert.ymin, vert.ymin, vert.ymax-V2D_SCROLLER_HANDLE_SIZE);
- CLAMP(hor.xmin, hor.xmin, hor.xmax-V2D_SCROLLER_HANDLE_SIZE);
+ CLAMP(vert.ymin, vert.ymin, vert.ymax - V2D_SCROLLER_HANDLE_SIZE);
+ CLAMP(hor.xmin, hor.xmin, hor.xmax - V2D_SCROLLER_HANDLE_SIZE);
/* store in scrollers, used for drawing */
- scrollers->vert= vert;
- scrollers->hor= hor;
+ scrollers->vert = vert;
+ scrollers->hor = hor;
/* scroller 'buttons':
* - These should always remain within the visible region of the scrollbar
@@ -1409,38 +1409,38 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short
/* horizontal scrollers */
if (scroll & V2D_SCROLL_HORIZONTAL) {
/* scroller 'button' extents */
- totsize= v2d->tot.xmax - v2d->tot.xmin;
- scrollsize= (float)(hor.xmax - hor.xmin);
- if(totsize==0.0f) totsize = 1.0f; /* avoid divide by zero */
-
- fac1= (v2d->cur.xmin - v2d->tot.xmin) / totsize;
- if(fac1<=0.0f)
- scrollers->hor_min= hor.xmin;
+ totsize = v2d->tot.xmax - v2d->tot.xmin;
+ scrollsize = (float)(hor.xmax - hor.xmin);
+ if (totsize == 0.0f) totsize = 1.0f; /* avoid divide by zero */
+
+ fac1 = (v2d->cur.xmin - v2d->tot.xmin) / totsize;
+ if (fac1 <= 0.0f)
+ scrollers->hor_min = hor.xmin;
else
- scrollers->hor_min= (int)(hor.xmin + (fac1 * scrollsize));
+ scrollers->hor_min = (int)(hor.xmin + (fac1 * scrollsize));
- fac2= (v2d->cur.xmax - v2d->tot.xmin) / totsize;
- if(fac2>=1.0f)
- scrollers->hor_max= hor.xmax;
+ fac2 = (v2d->cur.xmax - v2d->tot.xmin) / totsize;
+ if (fac2 >= 1.0f)
+ scrollers->hor_max = hor.xmax;
else
- scrollers->hor_max= (int)(hor.xmin + (fac2 * scrollsize));
+ scrollers->hor_max = (int)(hor.xmin + (fac2 * scrollsize));
/* prevent inverted sliders */
if (scrollers->hor_min > scrollers->hor_max)
- scrollers->hor_min= scrollers->hor_max;
+ scrollers->hor_min = scrollers->hor_max;
/* prevent sliders from being too small, and disappearing */
if ((scrollers->hor_max - scrollers->hor_min) < V2D_SCROLLER_HANDLE_SIZE) {
- scrollers->hor_max= scrollers->hor_min + V2D_SCROLLER_HANDLE_SIZE;
+ scrollers->hor_max = scrollers->hor_min + V2D_SCROLLER_HANDLE_SIZE;
- CLAMP(scrollers->hor_max, hor.xmin+V2D_SCROLLER_HANDLE_SIZE, hor.xmax);
- CLAMP(scrollers->hor_min, hor.xmin, hor.xmax-V2D_SCROLLER_HANDLE_SIZE);
+ CLAMP(scrollers->hor_max, hor.xmin + V2D_SCROLLER_HANDLE_SIZE, hor.xmax);
+ CLAMP(scrollers->hor_min, hor.xmin, hor.xmax - V2D_SCROLLER_HANDLE_SIZE);
}
/* check whether sliders can disappear due to the full-range being used */
- if(v2d->keeptot) {
+ if (v2d->keeptot) {
if ((fac1 <= 0.0f) && (fac2 >= 1.0f)) {
v2d->scroll |= V2D_SCROLL_HORIZONTAL_FULLR;
- scrollers->horfull= 1;
+ scrollers->horfull = 1;
}
else
v2d->scroll &= ~V2D_SCROLL_HORIZONTAL_FULLR;
@@ -1450,39 +1450,39 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short
/* vertical scrollers */
if (scroll & V2D_SCROLL_VERTICAL) {
/* scroller 'button' extents */
- totsize= v2d->tot.ymax - v2d->tot.ymin;
- scrollsize= (float)(vert.ymax - vert.ymin);
- if(totsize==0.0f) totsize = 1.0f; /* avoid divide by zero */
-
- fac1= (v2d->cur.ymin- v2d->tot.ymin) / totsize;
- if(fac1<=0.0f)
- scrollers->vert_min= vert.ymin;
+ totsize = v2d->tot.ymax - v2d->tot.ymin;
+ scrollsize = (float)(vert.ymax - vert.ymin);
+ if (totsize == 0.0f) totsize = 1.0f; /* avoid divide by zero */
+
+ fac1 = (v2d->cur.ymin - v2d->tot.ymin) / totsize;
+ if (fac1 <= 0.0f)
+ scrollers->vert_min = vert.ymin;
else
- scrollers->vert_min= (int)(vert.ymin + (fac1 * scrollsize));
+ scrollers->vert_min = (int)(vert.ymin + (fac1 * scrollsize));
- fac2= (v2d->cur.ymax - v2d->tot.ymin) / totsize;
- if(fac2>=1.0f)
- scrollers->vert_max= vert.ymax;
+ fac2 = (v2d->cur.ymax - v2d->tot.ymin) / totsize;
+ if (fac2 >= 1.0f)
+ scrollers->vert_max = vert.ymax;
else
- scrollers->vert_max= (int)(vert.ymin + (fac2 * scrollsize));
+ scrollers->vert_max = (int)(vert.ymin + (fac2 * scrollsize));
/* prevent inverted sliders */
if (scrollers->vert_min > scrollers->vert_max)
- scrollers->vert_min= scrollers->vert_max;
+ scrollers->vert_min = scrollers->vert_max;
/* prevent sliders from being too small, and disappearing */
if ((scrollers->vert_max - scrollers->vert_min) < V2D_SCROLLER_HANDLE_SIZE) {
- scrollers->vert_max= scrollers->vert_min + V2D_SCROLLER_HANDLE_SIZE;
+ scrollers->vert_max = scrollers->vert_min + V2D_SCROLLER_HANDLE_SIZE;
- CLAMP(scrollers->vert_max, vert.ymin+V2D_SCROLLER_HANDLE_SIZE, vert.ymax);
- CLAMP(scrollers->vert_min, vert.ymin, vert.ymax-V2D_SCROLLER_HANDLE_SIZE);
+ CLAMP(scrollers->vert_max, vert.ymin + V2D_SCROLLER_HANDLE_SIZE, vert.ymax);
+ CLAMP(scrollers->vert_min, vert.ymin, vert.ymax - V2D_SCROLLER_HANDLE_SIZE);
}
/* check whether sliders can disappear due to the full-range being used */
- if(v2d->keeptot) {
+ if (v2d->keeptot) {
if ((fac1 <= 0.0f) && (fac2 >= 1.0f)) {
v2d->scroll |= V2D_SCROLL_VERTICAL_FULLR;
- scrollers->vertfull= 1;
+ scrollers->vertfull = 1;
}
else
v2d->scroll &= ~V2D_SCROLL_VERTICAL_FULLR;
@@ -1490,14 +1490,14 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short
}
/* grid markings on scrollbars */
- if (scroll & (V2D_SCROLL_SCALE_HORIZONTAL|V2D_SCROLL_SCALE_VERTICAL)) {
+ if (scroll & (V2D_SCROLL_SCALE_HORIZONTAL | V2D_SCROLL_SCALE_VERTICAL)) {
/* store clamping */
- scrollers->xclamp= xclamp;
- scrollers->xunits= xunits;
- scrollers->yclamp= yclamp;
- scrollers->yunits= yunits;
+ scrollers->xclamp = xclamp;
+ scrollers->xunits = xunits;
+ scrollers->yclamp = yclamp;
+ scrollers->yunits = yunits;
- scrollers->grid= UI_view2d_grid_calc(CTX_data_scene(C), v2d, xunits, xclamp, yunits, yclamp, (hor.xmax - hor.xmin), (vert.ymax - vert.ymin));
+ scrollers->grid = UI_view2d_grid_calc(CTX_data_scene(C), v2d, xunits, xclamp, yunits, yclamp, (hor.xmax - hor.xmin), (vert.ymax - vert.ymin));
}
/* return scrollers */
@@ -1526,19 +1526,19 @@ static void scroll_printstr(Scene *scene, float x, float y, float val, int power
ANIM_timecode_string_from_frame(timecode_str, scene, power, (unit == V2D_UNIT_SECONDS), val);
/* get length of string, and adjust printing location to fit it into the horizontal scrollbar */
- len= strlen(timecode_str);
+ len = strlen(timecode_str);
if (dir == 'h') {
/* seconds/timecode display has slightly longer strings... */
if (unit == V2D_UNIT_SECONDS)
- x-= 3*len;
+ x -= 3 * len;
else
- x-= 4*len;
+ x -= 4 * len;
}
/* Add degree sympbol to end of string for vertical scrollbar? */
if ((dir == 'v') && (unit == V2D_UNIT_DEGREES)) {
- timecode_str[len]= 186;
- timecode_str[len+1]= 0;
+ timecode_str[len] = 186;
+ timecode_str[len + 1] = 0;
}
/* draw it */
@@ -1548,29 +1548,29 @@ static void scroll_printstr(Scene *scene, float x, float y, float val, int power
/* Draw scrollbars in the given 2d-region */
void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *vs)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
rcti vert, hor;
- int scroll= view2d_scroll_mapped(v2d->scroll);
+ int scroll = view2d_scroll_mapped(v2d->scroll);
/* make copies of rects for less typing */
- vert= vs->vert;
- hor= vs->hor;
+ vert = vs->vert;
+ hor = vs->hor;
/* horizontal scrollbar */
if (scroll & V2D_SCROLL_HORIZONTAL) {
/* only draw scrollbar when it doesn't fill the entire space */
- if(vs->horfull==0) {
- bTheme *btheme= UI_GetTheme();
- uiWidgetColors wcol= btheme->tui.wcol_scroll;
+ if (vs->horfull == 0) {
+ bTheme *btheme = UI_GetTheme();
+ uiWidgetColors wcol = btheme->tui.wcol_scroll;
rcti slider;
int state;
- slider.xmin= vs->hor_min;
- slider.xmax= vs->hor_max;
- slider.ymin= hor.ymin;
- slider.ymax= hor.ymax;
+ slider.xmin = vs->hor_min;
+ slider.xmax = vs->hor_max;
+ slider.ymin = hor.ymin;
+ slider.ymax = hor.ymax;
- state= (v2d->scroll_ui & V2D_SCROLL_H_ACTIVE)?UI_SCROLL_PRESSED:0;
+ state = (v2d->scroll_ui & V2D_SCROLL_H_ACTIVE) ? UI_SCROLL_PRESSED : 0;
/* show zoom handles if:
* - zooming on x-axis is allowed (no scroll otherwise)
@@ -1579,9 +1579,9 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
* (workaround to make sure that button windows don't show these,
* and only the time-grids with their zoomability can do so)
*/
- if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0 &&
- (v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL) &&
- (slider.xmax - slider.xmin > V2D_SCROLLER_HANDLE_SIZE))
+ if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0 &&
+ (v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL) &&
+ (slider.xmax - slider.xmin > V2D_SCROLLER_HANDLE_SIZE))
{
state |= UI_SCROLL_ARROWS;
}
@@ -1594,22 +1594,22 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
/* scale indicators */
if ((scroll & V2D_SCROLL_SCALE_HORIZONTAL) && (vs->grid)) {
- View2DGrid *grid= vs->grid;
+ View2DGrid *grid = vs->grid;
float fac, dfac, fac2, val;
/* the numbers: convert grid->startx and -dx to scroll coordinates
* - fac is x-coordinate to draw to
* - dfac is gap between scale markings
*/
- fac= (grid->startx - v2d->cur.xmin) / (v2d->cur.xmax - v2d->cur.xmin);
- fac= (float)hor.xmin + fac*(hor.xmax - hor.xmin);
+ fac = (grid->startx - v2d->cur.xmin) / (v2d->cur.xmax - v2d->cur.xmin);
+ fac = (float)hor.xmin + fac * (hor.xmax - hor.xmin);
- dfac= (grid->dx) / (v2d->cur.xmax - v2d->cur.xmin);
- dfac= dfac * (hor.xmax - hor.xmin);
+ dfac = (grid->dx) / (v2d->cur.xmax - v2d->cur.xmin);
+ dfac = dfac * (hor.xmax - hor.xmin);
/* set starting value, and text color */
UI_ThemeColor(TH_TEXT);
- val= grid->startx;
+ val = grid->startx;
/* if we're clamping to whole numbers only, make sure entries won't be repeated */
if (vs->xclamp == V2D_GRID_CLAMP) {
@@ -1619,45 +1619,45 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
}
}
if (vs->xunits == V2D_UNIT_FRAMES)
- grid->powerx= 1;
+ grid->powerx = 1;
/* draw numbers in the appropriate range */
if (dfac > 0.0f) {
- float h= 2.0f+(float)(hor.ymin);
+ float h = 2.0f + (float)(hor.ymin);
- for (; fac < hor.xmax-10; fac+=dfac, val+=grid->dx) {
+ for (; fac < hor.xmax - 10; fac += dfac, val += grid->dx) {
/* make prints look nicer for scrollers */
- if(fac < hor.xmin+10)
+ if (fac < hor.xmin + 10)
continue;
switch (vs->xunits) {
- case V2D_UNIT_FRAMES: /* frames (as whole numbers)*/
+ case V2D_UNIT_FRAMES: /* frames (as whole numbers)*/
scroll_printstr(scene, fac, h, val, grid->powerx, V2D_UNIT_FRAMES, 'h');
break;
- case V2D_UNIT_FRAMESCALE: /* frames (not always as whole numbers) */
+ case V2D_UNIT_FRAMESCALE: /* frames (not always as whole numbers) */
scroll_printstr(scene, fac, h, val, grid->powerx, V2D_UNIT_FRAMESCALE, 'h');
break;
- case V2D_UNIT_SECONDS: /* seconds */
- fac2= val/(float)FPS;
+ case V2D_UNIT_SECONDS: /* seconds */
+ fac2 = val / (float)FPS;
scroll_printstr(scene, fac, h, fac2, grid->powerx, V2D_UNIT_SECONDS, 'h');
break;
- case V2D_UNIT_SECONDSSEQ: /* seconds with special calculations (only used for sequencer only) */
+ case V2D_UNIT_SECONDSSEQ: /* seconds with special calculations (only used for sequencer only) */
{
float time;
- fac2= val/(float)FPS;
- time= (float)floor(fac2);
- fac2= fac2-time;
+ fac2 = val / (float)FPS;
+ time = (float)floor(fac2);
+ fac2 = fac2 - time;
- scroll_printstr(scene, fac, h, time+(float)FPS*fac2/100.0f, grid->powerx, V2D_UNIT_SECONDSSEQ, 'h');
+ scroll_printstr(scene, fac, h, time + (float)FPS * fac2 / 100.0f, grid->powerx, V2D_UNIT_SECONDSSEQ, 'h');
}
- break;
+ break;
- case V2D_UNIT_DEGREES: /* Graph Editor for rotation Drivers */
+ case V2D_UNIT_DEGREES: /* Graph Editor for rotation Drivers */
/* HACK: although we're drawing horizontal, we make this draw as 'vertical', just to get degree signs */
scroll_printstr(scene, fac, h, val, grid->powerx, V2D_UNIT_DEGREES, 'v');
break;
@@ -1670,18 +1670,18 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
/* vertical scrollbar */
if (scroll & V2D_SCROLL_VERTICAL) {
/* only draw scrollbar when it doesn't fill the entire space */
- if(vs->vertfull==0) {
- bTheme *btheme= UI_GetTheme();
- uiWidgetColors wcol= btheme->tui.wcol_scroll;
+ if (vs->vertfull == 0) {
+ bTheme *btheme = UI_GetTheme();
+ uiWidgetColors wcol = btheme->tui.wcol_scroll;
rcti slider;
int state;
- slider.xmin= vert.xmin;
- slider.xmax= vert.xmax;
- slider.ymin= vs->vert_min;
- slider.ymax= vs->vert_max;
+ slider.xmin = vert.xmin;
+ slider.xmax = vert.xmax;
+ slider.ymin = vs->vert_min;
+ slider.ymax = vs->vert_max;
- state= (v2d->scroll_ui & V2D_SCROLL_V_ACTIVE)?UI_SCROLL_PRESSED:0;
+ state = (v2d->scroll_ui & V2D_SCROLL_V_ACTIVE) ? UI_SCROLL_PRESSED : 0;
/* show zoom handles if:
* - zooming on y-axis is allowed (no scroll otherwise)
@@ -1690,9 +1690,9 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
* (workaround to make sure that button windows don't show these,
* and only the time-grids with their zoomability can do so)
*/
- if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0 &&
- (v2d->scroll & V2D_SCROLL_SCALE_VERTICAL) &&
- (slider.ymax - slider.ymin > V2D_SCROLLER_HANDLE_SIZE))
+ if ((v2d->keepzoom & V2D_LOCKZOOM_Y) == 0 &&
+ (v2d->scroll & V2D_SCROLL_SCALE_VERTICAL) &&
+ (slider.ymax - slider.ymin > V2D_SCROLLER_HANDLE_SIZE))
{
state |= UI_SCROLL_ARROWS;
}
@@ -1706,7 +1706,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
/* scale indiators */
if ((scroll & V2D_SCROLL_SCALE_VERTICAL) && (vs->grid)) {
- View2DGrid *grid= vs->grid;
+ View2DGrid *grid = vs->grid;
float fac, dfac, val;
/* the numbers: convert grid->starty and dy to scroll coordinates
@@ -1715,15 +1715,15 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
* - these involve a correction for horizontal scrollbar
* NOTE: it's assumed that that scrollbar is there if this is involved!
*/
- fac= (grid->starty- v2d->cur.ymin) / (v2d->cur.ymax - v2d->cur.ymin);
- fac= vert.ymin + fac*(vert.ymax - vert.ymin);
+ fac = (grid->starty - v2d->cur.ymin) / (v2d->cur.ymax - v2d->cur.ymin);
+ fac = vert.ymin + fac * (vert.ymax - vert.ymin);
- dfac= (grid->dy) / (v2d->cur.ymax - v2d->cur.ymin);
- dfac= dfac * (vert.ymax - vert.ymin);
+ dfac = (grid->dy) / (v2d->cur.ymax - v2d->cur.ymin);
+ dfac = dfac * (vert.ymax - vert.ymin);
/* set starting value, and text color */
UI_ThemeColor(TH_TEXT);
- val= grid->starty;
+ val = grid->starty;
/* if vertical clamping (to whole numbers) is used (i.e. in Sequencer), apply correction */
if (vs->yclamp == V2D_GRID_CLAMP)
@@ -1735,13 +1735,13 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
BLF_rotation_default(90.0f);
BLF_enable_default(BLF_ROTATION);
- for (; fac < vert.ymax-10; fac+= dfac, val += grid->dy) {
+ for (; fac < vert.ymax - 10; fac += dfac, val += grid->dy) {
/* make prints look nicer for scrollers */
- if(fac < vert.ymin+10)
+ if (fac < vert.ymin + 10)
continue;
- scroll_printstr(scene, (float)(vert.xmax)-2.0f, fac, val, grid->powery, vs->yunits, 'v');
+ scroll_printstr(scene, (float)(vert.xmax) - 2.0f, fac, val, grid->powery, vs->yunits, 'v');
}
BLF_disable_default(BLF_ROTATION);
@@ -1776,17 +1776,19 @@ void UI_view2d_scrollers_free(View2DScrollers *scrollers)
void UI_view2d_listview_cell_to_view(View2D *v2d, short columnwidth, short rowheight, float startx, float starty, int column, int row, rctf *rect)
{
/* sanity checks */
- if ELEM(NULL, v2d, rect)
+ if (ELEM(NULL, v2d, rect)) {
return;
+ }
+
if ((columnwidth <= 0) && (rowheight <= 0)) {
- rect->xmin= rect->xmax= 0.0f;
- rect->ymin= rect->ymax= 0.0f;
+ rect->xmin = rect->xmax = 0.0f;
+ rect->ymin = rect->ymax = 0.0f;
return;
}
/* x-coordinates */
- rect->xmin= startx + (float)(columnwidth * column);
- rect->xmax= startx + (float)(columnwidth * (column + 1));
+ rect->xmin = startx + (float)(columnwidth * column);
+ rect->xmax = startx + (float)(columnwidth * (column + 1));
if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) {
/* simply negate the values for the coordinates if in negative half */
@@ -1795,8 +1797,8 @@ void UI_view2d_listview_cell_to_view(View2D *v2d, short columnwidth, short rowhe
}
/* y-coordinates */
- rect->ymin= starty + (float)(rowheight * row);
- rect->ymax= starty + (float)(rowheight * (row + 1));
+ rect->ymin = starty + (float)(rowheight * row);
+ rect->ymax = starty + (float)(rowheight * (row + 1));
if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) {
/* simply negate the values for the coordinates if in negative half */
@@ -1815,31 +1817,31 @@ void UI_view2d_listview_cell_to_view(View2D *v2d, short columnwidth, short rowhe
* - column, row = the 'coordinates' of the relevant 'cell'
*/
void UI_view2d_listview_view_to_cell(View2D *v2d, short columnwidth, short rowheight, float startx, float starty,
- float viewx, float viewy, int *column, int *row)
+ float viewx, float viewy, int *column, int *row)
{
/* adjust view coordinates to be all positive ints, corrected for the start offset */
- const int x= (int)(floorf(fabsf(viewx) + 0.5f) - startx);
- const int y= (int)(floorf(fabsf(viewy) + 0.5f) - starty);
+ const int x = (int)(floorf(fabsf(viewx) + 0.5f) - startx);
+ const int y = (int)(floorf(fabsf(viewy) + 0.5f) - starty);
/* sizes must not be negative */
if ( (v2d == NULL) || ((columnwidth <= 0) && (rowheight <= 0)) ) {
- if (column) *column= 0;
- if (row) *row= 0;
+ if (column) *column = 0;
+ if (row) *row = 0;
return;
}
/* get column */
if ((column) && (columnwidth > 0))
- *column= x / columnwidth;
+ *column = x / columnwidth;
else if (column)
- *column= 0;
+ *column = 0;
/* get row */
if ((row) && (rowheight > 0))
- *row= y / rowheight;
+ *row = y / rowheight;
else if (row)
- *row= 0;
+ *row = 0;
}
/* Get the 'extreme' (min/max) column and row indices which are visible within the 'cur' rect
@@ -1848,17 +1850,17 @@ void UI_view2d_listview_view_to_cell(View2D *v2d, short columnwidth, short rowhe
* - column/row_min/max = the starting and ending column/row indices
*/
void UI_view2d_listview_visible_cells(View2D *v2d, short columnwidth, short rowheight, float startx, float starty,
- int *column_min, int *column_max, int *row_min, int *row_max)
+ int *column_min, int *column_max, int *row_min, int *row_max)
{
/* using 'cur' rect coordinates, call the cell-getting function to get the cells for this */
if (v2d) {
/* min */
UI_view2d_listview_view_to_cell(v2d, columnwidth, rowheight, startx, starty,
- v2d->cur.xmin, v2d->cur.ymin, column_min, row_min);
+ v2d->cur.xmin, v2d->cur.ymin, column_min, row_min);
/* max*/
UI_view2d_listview_view_to_cell(v2d, columnwidth, rowheight, startx, starty,
- v2d->cur.xmax, v2d->cur.ymax, column_max, row_max);
+ v2d->cur.xmax, v2d->cur.ymax, column_max, row_max);
}
}
@@ -1867,7 +1869,7 @@ void UI_view2d_listview_visible_cells(View2D *v2d, short columnwidth, short rowh
/* Convert from screen/region space to 2d-View space
*
- * - x,y = coordinates to convert
+ * - x,y = coordinates to convert
* - viewx,viewy = resultant coordinates
*/
void UI_view2d_region_to_view(View2D *v2d, int x, int y, float *r_viewx, float *r_viewy)
@@ -1875,73 +1877,73 @@ void UI_view2d_region_to_view(View2D *v2d, int x, int y, float *r_viewx, float *
float div, ofs;
if (r_viewx) {
- div= (float)(v2d->mask.xmax - v2d->mask.xmin);
- ofs= (float)v2d->mask.xmin;
+ div = (float)(v2d->mask.xmax - v2d->mask.xmin);
+ ofs = (float)v2d->mask.xmin;
- *r_viewx= v2d->cur.xmin + (v2d->cur.xmax-v2d->cur.xmin) * ((float)x - ofs) / div;
+ *r_viewx = v2d->cur.xmin + (v2d->cur.xmax - v2d->cur.xmin) * ((float)x - ofs) / div;
}
if (r_viewy) {
- div= (float)(v2d->mask.ymax - v2d->mask.ymin);
- ofs= (float)v2d->mask.ymin;
+ div = (float)(v2d->mask.ymax - v2d->mask.ymin);
+ ofs = (float)v2d->mask.ymin;
- *r_viewy= v2d->cur.ymin + (v2d->cur.ymax - v2d->cur.ymin) * ((float)y - ofs) / div;
+ *r_viewy = v2d->cur.ymin + (v2d->cur.ymax - v2d->cur.ymin) * ((float)y - ofs) / div;
}
}
/* Convert from 2d-View space to screen/region space
* - Coordinates are clamped to lie within bounds of region
*
- * - x,y = coordinates to convert
- * - regionx,regiony = resultant coordinates
+ * - x,y = coordinates to convert
+ * - regionx,regiony = resultant coordinates
*/
void UI_view2d_view_to_region(View2D *v2d, float x, float y, int *regionx, int *regiony)
{
/* set initial value in case coordinate lies outside of bounds */
if (regionx)
- *regionx= V2D_IS_CLIPPED;
+ *regionx = V2D_IS_CLIPPED;
if (regiony)
- *regiony= V2D_IS_CLIPPED;
+ *regiony = V2D_IS_CLIPPED;
/* express given coordinates as proportional values */
- x= (x - v2d->cur.xmin) / (v2d->cur.xmax - v2d->cur.xmin);
- y= (y - v2d->cur.ymin) / (v2d->cur.ymax - v2d->cur.ymin);
+ x = (x - v2d->cur.xmin) / (v2d->cur.xmax - v2d->cur.xmin);
+ y = (y - v2d->cur.ymin) / (v2d->cur.ymax - v2d->cur.ymin);
/* check if values are within bounds */
- if ((x>=0.0f) && (x<=1.0f) && (y>=0.0f) && (y<=1.0f)) {
+ if ((x >= 0.0f) && (x <= 1.0f) && (y >= 0.0f) && (y <= 1.0f)) {
if (regionx)
- *regionx= (int)(v2d->mask.xmin + x*(v2d->mask.xmax-v2d->mask.xmin));
+ *regionx = (int)(v2d->mask.xmin + x * (v2d->mask.xmax - v2d->mask.xmin));
if (regiony)
- *regiony= (int)(v2d->mask.ymin + y*(v2d->mask.ymax-v2d->mask.ymin));
+ *regiony = (int)(v2d->mask.ymin + y * (v2d->mask.ymax - v2d->mask.ymin));
}
}
/* Convert from 2d-view space to screen/region space
* - Coordinates are NOT clamped to lie within bounds of region
*
- * - x,y = coordinates to convert
- * - regionx,regiony = resultant coordinates
+ * - x,y = coordinates to convert
+ * - regionx,regiony = resultant coordinates
*/
void UI_view2d_to_region_no_clip(View2D *v2d, float x, float y, int *regionx, int *regiony)
{
/* step 1: express given coordinates as proportional values */
- x= (x - v2d->cur.xmin) / (v2d->cur.xmax - v2d->cur.xmin);
- y= (y - v2d->cur.ymin) / (v2d->cur.ymax - v2d->cur.ymin);
+ x = (x - v2d->cur.xmin) / (v2d->cur.xmax - v2d->cur.xmin);
+ y = (y - v2d->cur.ymin) / (v2d->cur.ymax - v2d->cur.ymin);
/* step 2: convert proportional distances to screen coordinates */
- x= v2d->mask.xmin + x*(v2d->mask.xmax - v2d->mask.xmin);
- y= v2d->mask.ymin + y*(v2d->mask.ymax - v2d->mask.ymin);
+ x = v2d->mask.xmin + x * (v2d->mask.xmax - v2d->mask.xmin);
+ y = v2d->mask.ymin + y * (v2d->mask.ymax - v2d->mask.ymin);
/* although we don't clamp to lie within region bounds, we must avoid exceeding size of ints */
if (regionx) {
- if (x < INT_MIN) *regionx= INT_MIN;
- else if(x > INT_MAX) *regionx= INT_MAX;
- else *regionx= (int)x;
+ if (x < INT_MIN) *regionx = INT_MIN;
+ else if (x > INT_MAX) *regionx = INT_MAX;
+ else *regionx = (int)x;
}
if (regiony) {
- if (y < INT_MIN) *regiony= INT_MIN;
- else if(y > INT_MAX) *regiony= INT_MAX;
- else *regiony= (int)y;
+ if (y < INT_MIN) *regiony = INT_MIN;
+ else if (y > INT_MAX) *regiony = INT_MAX;
+ else *regiony = (int)y;
}
}
@@ -1951,8 +1953,8 @@ void UI_view2d_to_region_no_clip(View2D *v2d, float x, float y, int *regionx, in
/* View2D data by default resides in region, so get from region stored in context */
View2D *UI_view2d_fromcontext(const bContext *C)
{
- ScrArea *area= CTX_wm_area(C);
- ARegion *region= CTX_wm_region(C);
+ ScrArea *area = CTX_wm_area(C);
+ ARegion *region = CTX_wm_region(C);
if (area == NULL) return NULL;
if (region == NULL) return NULL;
@@ -1962,13 +1964,13 @@ View2D *UI_view2d_fromcontext(const bContext *C)
/* same as above, but it returns regionwindow. Utility for pulldowns or buttons */
View2D *UI_view2d_fromcontext_rwin(const bContext *C)
{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *region= CTX_wm_region(C);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *region = CTX_wm_region(C);
if (sa == NULL) return NULL;
if (region == NULL) return NULL;
- if (region->regiontype!=RGN_TYPE_WINDOW) {
- ARegion *ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+ if (region->regiontype != RGN_TYPE_WINDOW) {
+ ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
return ar ? &(ar->v2d) : NULL;
}
return &(region->v2d);
@@ -1995,15 +1997,15 @@ void UI_view2d_getscale(View2D *v2d, float *x, float *y)
*
* - x,y = mouse coordinates in screen (not region) space
*/
-short UI_view2d_mouse_in_scrollers (const bContext *C, View2D *v2d, int x, int y)
+short UI_view2d_mouse_in_scrollers(const bContext *C, View2D *v2d, int x, int y)
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
int co[2];
- int scroll= view2d_scroll_mapped(v2d->scroll);
+ int scroll = view2d_scroll_mapped(v2d->scroll);
/* clamp x,y to region-coordinates first */
- co[0]= x - ar->winrct.xmin;
- co[1]= y - ar->winrct.ymin;
+ co[0] = x - ar->winrct.xmin;
+ co[1] = y - ar->winrct.ymin;
/* check if within scrollbars */
if (scroll & V2D_SCROLL_HORIZONTAL) {
@@ -2020,7 +2022,7 @@ short UI_view2d_mouse_in_scrollers (const bContext *C, View2D *v2d, int x, int y
/* ******************* view2d text drawing cache ******************** */
/* assumes caches are used correctly, so for time being no local storage in v2d */
-static ListBase strings= {NULL, NULL};
+static ListBase strings = {NULL, NULL};
typedef struct View2DString {
struct View2DString *next, *prev;
@@ -2037,36 +2039,36 @@ void UI_view2d_text_cache_add(View2D *v2d, float x, float y, const char *str, co
{
int mval[2];
- UI_view2d_view_to_region(v2d, x, y, mval, mval+1);
+ UI_view2d_view_to_region(v2d, x, y, mval, mval + 1);
- if(mval[0]!=V2D_IS_CLIPPED && mval[1]!=V2D_IS_CLIPPED) {
- int len= strlen(str)+1;
+ if (mval[0] != V2D_IS_CLIPPED && mval[1] != V2D_IS_CLIPPED) {
+ int len = strlen(str) + 1;
/* use calloc, rect has to be zeroe'd */
- View2DString *v2s= MEM_callocN(sizeof(View2DString)+len, "View2DString");
- char *v2s_str= (char *)(v2s+1);
+ View2DString *v2s = MEM_callocN(sizeof(View2DString) + len, "View2DString");
+ char *v2s_str = (char *)(v2s + 1);
memcpy(v2s_str, str, len);
BLI_addtail(&strings, v2s);
- v2s->col.pack= *((int *)col);
- v2s->mval[0]= mval[0];
- v2s->mval[1]= mval[1];
+ v2s->col.pack = *((int *)col);
+ v2s->mval[0] = mval[0];
+ v2s->mval[1] = mval[1];
}
}
/* no clip (yet) */
void UI_view2d_text_cache_rectf(View2D *v2d, rctf *rect, const char *str, const char col[4])
{
- int len= strlen(str)+1;
- View2DString *v2s= MEM_callocN(sizeof(View2DString)+len, "View2DString");
- char *v2s_str= (char *)(v2s+1);
+ int len = strlen(str) + 1;
+ View2DString *v2s = MEM_callocN(sizeof(View2DString) + len, "View2DString");
+ char *v2s_str = (char *)(v2s + 1);
memcpy(v2s_str, str, len);
UI_view2d_to_region_no_clip(v2d, rect->xmin, rect->ymin, &v2s->rect.xmin, &v2s->rect.ymin);
UI_view2d_to_region_no_clip(v2d, rect->xmax, rect->ymax, &v2s->rect.xmax, &v2s->rect.ymax);
- v2s->col.pack= *((int *)col);
- v2s->mval[0]= v2s->rect.xmin;
- v2s->mval[1]= v2s->rect.ymin;
+ v2s->col.pack = *((int *)col);
+ v2s->mval[0] = v2s->rect.xmin;
+ v2s->mval[1] = v2s->rect.ymin;
BLI_addtail(&strings, v2s);
}
@@ -2075,7 +2077,7 @@ void UI_view2d_text_cache_rectf(View2D *v2d, rctf *rect, const char *str, const
void UI_view2d_text_cache_draw(ARegion *ar)
{
View2DString *v2s;
- int col_pack_prev= 0;
+ int col_pack_prev = 0;
// glMatrixMode(GL_PROJECTION);
// glPushMatrix();
@@ -2083,24 +2085,24 @@ void UI_view2d_text_cache_draw(ARegion *ar)
// glPushMatrix();
ED_region_pixelspace(ar);
- for(v2s= strings.first; v2s; v2s= v2s->next) {
- const char *str= (const char *)(v2s+1);
- int xofs=0, yofs;
+ for (v2s = strings.first; v2s; v2s = v2s->next) {
+ const char *str = (const char *)(v2s + 1);
+ int xofs = 0, yofs;
- yofs= ceil( 0.5f*(v2s->rect.ymax - v2s->rect.ymin - BLF_height_default("28")));
- if(yofs<1) yofs= 1;
+ yofs = ceil(0.5f * (v2s->rect.ymax - v2s->rect.ymin - BLF_height_default("28")));
+ if (yofs < 1) yofs = 1;
- if(col_pack_prev != v2s->col.pack) {
+ if (col_pack_prev != v2s->col.pack) {
glColor3ubv(v2s->col.ub);
- col_pack_prev= v2s->col.pack;
+ col_pack_prev = v2s->col.pack;
}
- if(v2s->rect.xmin >= v2s->rect.xmax)
- BLF_draw_default((float)v2s->mval[0]+xofs, (float)v2s->mval[1]+yofs, 0.0, str, BLF_DRAW_STR_DUMMY_MAX);
+ if (v2s->rect.xmin >= v2s->rect.xmax)
+ BLF_draw_default((float)v2s->mval[0] + xofs, (float)v2s->mval[1] + yofs, 0.0, str, BLF_DRAW_STR_DUMMY_MAX);
else {
- BLF_clipping_default(v2s->rect.xmin-4, v2s->rect.ymin-4, v2s->rect.xmax+4, v2s->rect.ymax+4);
+ BLF_clipping_default(v2s->rect.xmin - 4, v2s->rect.ymin - 4, v2s->rect.xmax + 4, v2s->rect.ymax + 4);
BLF_enable_default(BLF_CLIPPING);
- BLF_draw_default(v2s->rect.xmin+xofs, v2s->rect.ymin+yofs, 0.0f, str, BLF_DRAW_STR_DUMMY_MAX);
+ BLF_draw_default(v2s->rect.xmin + xofs, v2s->rect.ymin + yofs, 0.0f, str, BLF_DRAW_STR_DUMMY_MAX);
BLF_disable_default(BLF_CLIPPING);
}
}
@@ -2110,7 +2112,7 @@ void UI_view2d_text_cache_draw(ARegion *ar)
// glMatrixMode(GL_MODELVIEW);
// glPopMatrix();
- if(strings.first)
+ if (strings.first)
BLI_freelistN(&strings);
}
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 234b2733bd3..129a47c7063 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -55,7 +55,7 @@
static int view2d_poll(bContext *C)
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
return (ar != NULL) && (ar->v2d.flag & V2D_IS_INITIALISED);
}
@@ -63,37 +63,37 @@ static int view2d_poll(bContext *C)
/* ********************************************************* */
/* VIEW PANNING OPERATOR */
-/* This group of operators come in several forms:
+/* This group of operators come in several forms:
* 1) Modal 'dragging' with MMB - where movement of mouse dictates amount to pan view by
* 2) Scrollwheel 'steps' - rolling mousewheel by one step moves view by predefined amount
*
* In order to make sure this works, each operator must define the following RNA-Operator Props:
- * deltax, deltay - define how much to move view by (relative to zoom-correction factor)
+ * deltax, deltay - define how much to move view by (relative to zoom-correction factor)
*/
/* ------------------ Shared 'core' stuff ---------------------- */
/* temp customdata for operator */
typedef struct v2dViewPanData {
- bScreen *sc; /* screen where view pan was initiated */
- ScrArea *sa; /* area where view pan was initiated */
- ARegion *ar; /* region where view pan was initiated */
- View2D *v2d; /* view2d we're operating in */
-
- float facx, facy; /* amount to move view relative to zoom */
-
- /* options for version 1 */
- int startx, starty; /* mouse x/y values in window when operator was initiated */
- int lastx, lasty; /* previous x/y values of mouse in window */
- int invoke_event; /* event starting pan, for modal exit */
+ bScreen *sc; /* screen where view pan was initiated */
+ ScrArea *sa; /* area where view pan was initiated */
+ ARegion *ar; /* region where view pan was initiated */
+ View2D *v2d; /* view2d we're operating in */
+
+ float facx, facy; /* amount to move view relative to zoom */
+
+ /* options for version 1 */
+ int startx, starty; /* mouse x/y values in window when operator was initiated */
+ int lastx, lasty; /* previous x/y values of mouse in window */
+ int invoke_event; /* event starting pan, for modal exit */
- short in_scroller; /* for MMB in scrollers (old feature in past, but now not that useful) */
+ short in_scroller; /* for MMB in scrollers (old feature in past, but now not that useful) */
} v2dViewPanData;
-/* initialise panning customdata */
+/* initialize panning customdata */
static int view_pan_init(bContext *C, wmOperator *op)
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
v2dViewPanData *vpd;
View2D *v2d;
float winx, winy;
@@ -103,25 +103,25 @@ static int view_pan_init(bContext *C, wmOperator *op)
return 0;
/* check if panning is allowed at all */
- v2d= &ar->v2d;
+ v2d = &ar->v2d;
if ((v2d->keepofs & V2D_LOCKOFS_X) && (v2d->keepofs & V2D_LOCKOFS_Y))
return 0;
/* set custom-data for operator */
- vpd= MEM_callocN(sizeof(v2dViewPanData), "v2dViewPanData");
- op->customdata= vpd;
+ vpd = MEM_callocN(sizeof(v2dViewPanData), "v2dViewPanData");
+ op->customdata = vpd;
/* set pointers to owners */
- vpd->sc= CTX_wm_screen(C);
- vpd->sa= CTX_wm_area(C);
- vpd->v2d= v2d;
+ vpd->sc = CTX_wm_screen(C);
+ vpd->sa = CTX_wm_area(C);
+ vpd->v2d = v2d;
vpd->ar = ar;
/* calculate translation factor - based on size of view */
- winx= (float)(ar->winrct.xmax - ar->winrct.xmin + 1);
- winy= (float)(ar->winrct.ymax - ar->winrct.ymin + 1);
- vpd->facx= (v2d->cur.xmax - v2d->cur.xmin) / winx;
- vpd->facy= (v2d->cur.ymax - v2d->cur.ymin) / winy;
+ winx = (float)(ar->winrct.xmax - ar->winrct.xmin + 1);
+ winy = (float)(ar->winrct.ymax - ar->winrct.ymin + 1);
+ vpd->facx = (v2d->cur.xmax - v2d->cur.xmin) / winx;
+ vpd->facy = (v2d->cur.ymax - v2d->cur.ymin) / winy;
return 1;
}
@@ -129,20 +129,20 @@ static int view_pan_init(bContext *C, wmOperator *op)
/* apply transform to view (i.e. adjust 'cur' rect) */
static void view_pan_apply(wmOperator *op)
{
- v2dViewPanData *vpd= op->customdata;
- View2D *v2d= vpd->v2d;
+ v2dViewPanData *vpd = op->customdata;
+ View2D *v2d = vpd->v2d;
float dx, dy;
/* calculate amount to move view by */
- dx= vpd->facx * (float)RNA_int_get(op->ptr, "deltax");
- dy= vpd->facy * (float)RNA_int_get(op->ptr, "deltay");
+ dx = vpd->facx * (float)RNA_int_get(op->ptr, "deltax");
+ dy = vpd->facy * (float)RNA_int_get(op->ptr, "deltay");
/* only move view on an axis if change is allowed */
- if ((v2d->keepofs & V2D_LOCKOFS_X)==0) {
+ if ((v2d->keepofs & V2D_LOCKOFS_X) == 0) {
v2d->cur.xmin += dx;
v2d->cur.xmax += dx;
}
- if ((v2d->keepofs & V2D_LOCKOFS_Y)==0) {
+ if ((v2d->keepofs & V2D_LOCKOFS_Y) == 0) {
v2d->cur.ymin += dy;
v2d->cur.ymax += dy;
}
@@ -156,9 +156,9 @@ static void view_pan_apply(wmOperator *op)
UI_view2d_sync(vpd->sc, vpd->sa, v2d, V2D_LOCK_COPY);
/* exceptions */
- if (vpd->sa->spacetype==SPACE_OUTLINER) {
+ if (vpd->sa->spacetype == SPACE_OUTLINER) {
/* don't rebuild full tree, since we're just changing our view */
- SpaceOops *soops= vpd->sa->spacedata.first;
+ SpaceOops *soops = vpd->sa->spacedata.first;
soops->storeflag |= SO_TREESTORE_REDRAW;
}
}
@@ -168,7 +168,7 @@ static void view_pan_exit(wmOperator *op)
{
if (op->customdata) {
MEM_freeN(op->customdata);
- op->customdata= NULL;
+ op->customdata = NULL;
}
}
@@ -188,7 +188,7 @@ static int view_pan_exec(bContext *C, wmOperator *op)
/* set up modal operator and relevant settings */
static int view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- wmWindow *window= CTX_wm_window(C);
+ wmWindow *window = CTX_wm_window(C);
v2dViewPanData *vpd;
View2D *v2d;
@@ -196,13 +196,13 @@ static int view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event)
if (!view_pan_init(C, op))
return OPERATOR_PASS_THROUGH;
- vpd= op->customdata;
- v2d= vpd->v2d;
+ vpd = op->customdata;
+ v2d = vpd->v2d;
/* set initial settings */
- vpd->startx= vpd->lastx= event->x;
- vpd->starty= vpd->lasty= event->y;
- vpd->invoke_event= event->type;
+ vpd->startx = vpd->lastx = event->x;
+ vpd->starty = vpd->lasty = event->y;
+ vpd->invoke_event = event->type;
if (event->type == MOUSEPAN) {
RNA_int_set(op->ptr, "deltax", event->prevx - event->x);
@@ -232,7 +232,7 @@ static int view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* handle user input - calculations of mouse-movement need to be done here, not in the apply callback! */
static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- v2dViewPanData *vpd= op->customdata;
+ v2dViewPanData *vpd = op->customdata;
/* execute the events */
switch (event->type) {
@@ -242,17 +242,18 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event)
RNA_int_set(op->ptr, "deltax", (vpd->lastx - event->x));
RNA_int_set(op->ptr, "deltay", (vpd->lasty - event->y));
- vpd->lastx= event->x;
- vpd->lasty= event->y;
+ vpd->lastx = event->x;
+ vpd->lasty = event->y;
view_pan_apply(op);
}
- break;
- /* XXX - Mode switching isn't implemented. See comments in 36818.
- * switch to zoom *
+ break;
+ /* XXX - Mode switching isn't implemented. See comments in 36818.
+ * switch to zoom */
+#if 0
case LEFTMOUSE:
- if (event->val==KM_PRESS) {
- * calculate overall delta mouse-movement for redo *
+ if (event->val == KM_PRESS) {
+ /* calculate overall delta mouse-movement for redo */
RNA_int_set(op->ptr, "deltax", (vpd->startx - vpd->lastx));
RNA_int_set(op->ptr, "deltay", (vpd->starty - vpd->lasty));
@@ -260,11 +261,11 @@ 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) {
+ if (event->type == vpd->invoke_event || event->type == ESCKEY) {
+ if (event->val == KM_RELEASE) {
/* calculate overall delta mouse-movement for redo */
RNA_int_set(op->ptr, "deltax", (vpd->startx - vpd->lastx));
RNA_int_set(op->ptr, "deltay", (vpd->starty - vpd->lasty));
@@ -290,18 +291,18 @@ static int view_pan_cancel(bContext *UNUSED(C), wmOperator *op)
static void VIEW2D_OT_pan(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Pan View";
- ot->description= "Pan the view";
- ot->idname= "VIEW2D_OT_pan";
+ ot->name = "Pan View";
+ ot->description = "Pan the view";
+ ot->idname = "VIEW2D_OT_pan";
/* api callbacks */
- ot->exec= view_pan_exec;
- ot->invoke= view_pan_invoke;
- ot->modal= view_pan_modal;
- ot->cancel= view_pan_cancel;
+ ot->exec = view_pan_exec;
+ ot->invoke = view_pan_invoke;
+ ot->modal = view_pan_modal;
+ ot->cancel = view_pan_cancel;
/* operator is modal */
- ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
+ ot->flag = OPTYPE_BLOCKING | OPTYPE_GRAB_POINTER;
/* rna - must keep these in sync with the other operators */
RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX);
@@ -315,12 +316,12 @@ static int view_scrollright_exec(bContext *C, wmOperator *op)
{
v2dViewPanData *vpd;
- /* initialise default settings (and validate if ok to run) */
+ /* initialize default settings (and validate if ok to run) */
if (!view_pan_init(C, op))
return OPERATOR_PASS_THROUGH;
/* also, check if can pan in horizontal axis */
- vpd= op->customdata;
+ vpd = op->customdata;
if (vpd->v2d->keepofs & V2D_LOCKOFS_X) {
view_pan_exit(op);
return OPERATOR_PASS_THROUGH;
@@ -340,12 +341,12 @@ static int view_scrollright_exec(bContext *C, wmOperator *op)
static void VIEW2D_OT_scroll_right(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Scroll Right";
- ot->description= "Scroll the view right";
- ot->idname= "VIEW2D_OT_scroll_right";
+ ot->name = "Scroll Right";
+ ot->description = "Scroll the view right";
+ ot->idname = "VIEW2D_OT_scroll_right";
/* api callbacks */
- ot->exec= view_scrollright_exec;
+ ot->exec = view_scrollright_exec;
/* rna - must keep these in sync with the other operators */
RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX);
@@ -359,12 +360,12 @@ static int view_scrollleft_exec(bContext *C, wmOperator *op)
{
v2dViewPanData *vpd;
- /* initialise default settings (and validate if ok to run) */
+ /* initialize default settings (and validate if ok to run) */
if (!view_pan_init(C, op))
return OPERATOR_PASS_THROUGH;
/* also, check if can pan in horizontal axis */
- vpd= op->customdata;
+ vpd = op->customdata;
if (vpd->v2d->keepofs & V2D_LOCKOFS_X) {
view_pan_exit(op);
return OPERATOR_PASS_THROUGH;
@@ -384,12 +385,12 @@ static int view_scrollleft_exec(bContext *C, wmOperator *op)
static void VIEW2D_OT_scroll_left(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Scroll Left";
- ot->description= "Scroll the view left";
- ot->idname= "VIEW2D_OT_scroll_left";
+ ot->name = "Scroll Left";
+ ot->description = "Scroll the view left";
+ ot->idname = "VIEW2D_OT_scroll_left";
/* api callbacks */
- ot->exec= view_scrollleft_exec;
+ ot->exec = view_scrollleft_exec;
/* rna - must keep these in sync with the other operators */
RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX);
@@ -402,12 +403,12 @@ static int view_scrolldown_exec(bContext *C, wmOperator *op)
{
v2dViewPanData *vpd;
- /* initialise default settings (and validate if ok to run) */
+ /* initialize default settings (and validate if ok to run) */
if (!view_pan_init(C, op))
return OPERATOR_PASS_THROUGH;
/* also, check if can pan in vertical axis */
- vpd= op->customdata;
+ vpd = op->customdata;
if (vpd->v2d->keepofs & V2D_LOCKOFS_Y) {
view_pan_exit(op);
return OPERATOR_PASS_THROUGH;
@@ -417,8 +418,8 @@ static int view_scrolldown_exec(bContext *C, wmOperator *op)
RNA_int_set(op->ptr, "deltax", 0);
RNA_int_set(op->ptr, "deltay", -40);
- if(RNA_boolean_get(op->ptr, "page")) {
- ARegion *ar= CTX_wm_region(C);
+ if (RNA_boolean_get(op->ptr, "page")) {
+ ARegion *ar = CTX_wm_region(C);
RNA_int_set(op->ptr, "deltay", ar->v2d.mask.ymin - ar->v2d.mask.ymax);
}
@@ -432,12 +433,12 @@ static int view_scrolldown_exec(bContext *C, wmOperator *op)
static void VIEW2D_OT_scroll_down(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Scroll Down";
- ot->description= "Scroll the view down";
- ot->idname= "VIEW2D_OT_scroll_down";
+ ot->name = "Scroll Down";
+ ot->description = "Scroll the view down";
+ ot->idname = "VIEW2D_OT_scroll_down";
/* api callbacks */
- ot->exec= view_scrolldown_exec;
+ ot->exec = view_scrolldown_exec;
/* rna - must keep these in sync with the other operators */
RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX);
@@ -452,12 +453,12 @@ static int view_scrollup_exec(bContext *C, wmOperator *op)
{
v2dViewPanData *vpd;
- /* initialise default settings (and validate if ok to run) */
+ /* initialize default settings (and validate if ok to run) */
if (!view_pan_init(C, op))
return OPERATOR_PASS_THROUGH;
/* also, check if can pan in vertical axis */
- vpd= op->customdata;
+ vpd = op->customdata;
if (vpd->v2d->keepofs & V2D_LOCKOFS_Y) {
view_pan_exit(op);
return OPERATOR_PASS_THROUGH;
@@ -467,8 +468,8 @@ static int view_scrollup_exec(bContext *C, wmOperator *op)
RNA_int_set(op->ptr, "deltax", 0);
RNA_int_set(op->ptr, "deltay", 40);
- if(RNA_boolean_get(op->ptr, "page")) {
- ARegion *ar= CTX_wm_region(C);
+ if (RNA_boolean_get(op->ptr, "page")) {
+ ARegion *ar = CTX_wm_region(C);
RNA_int_set(op->ptr, "deltay", ar->v2d.mask.ymax - ar->v2d.mask.ymin);
}
@@ -482,12 +483,12 @@ static int view_scrollup_exec(bContext *C, wmOperator *op)
static void VIEW2D_OT_scroll_up(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Scroll Up";
- ot->description= "Scroll the view up";
- ot->idname= "VIEW2D_OT_scroll_up";
+ ot->name = "Scroll Up";
+ ot->description = "Scroll the view up";
+ ot->idname = "VIEW2D_OT_scroll_up";
/* api callbacks */
- ot->exec= view_scrollup_exec;
+ ot->exec = view_scrollup_exec;
/* rna - must keep these in sync with the other operators */
RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX);
@@ -498,7 +499,7 @@ static void VIEW2D_OT_scroll_up(wmOperatorType *ot)
/* ********************************************************* */
/* SINGLE-STEP VIEW ZOOMING OPERATOR */
-/* This group of operators come in several forms:
+/* This group of operators come in several forms:
* 1) Scrollwheel 'steps' - rolling mousewheel by one step zooms view by predefined amount
* 2) Scrollwheel 'steps' + alt + ctrl/shift - zooms view on one axis only (ctrl=x, shift=y) // XXX this could be implemented...
* 3) Pad +/- Keys - pressing each key moves the zooms the view by a predefined amount
@@ -513,42 +514,42 @@ static void VIEW2D_OT_scroll_up(wmOperatorType *ot)
/* temp customdata for operator */
typedef struct v2dViewZoomData {
- View2D *v2d; /* view2d we're operating in */
+ View2D *v2d; /* view2d we're operating in */
ARegion *ar;
/* needed for continuous zoom */
wmTimer *timer;
double timer_lastdraw;
- int lastx, lasty; /* previous x/y values of mouse in window */
- int invoke_event; /* event type that invoked, for modal exits */
- float dx, dy; /* running tally of previous delta values (for obtaining final zoom) */
- float mx_2d, my_2d; /* initial mouse location in v2d coords */
+ int lastx, lasty; /* previous x/y values of mouse in window */
+ int invoke_event; /* event type that invoked, for modal exits */
+ float dx, dy; /* running tally of previous delta values (for obtaining final zoom) */
+ float mx_2d, my_2d; /* initial mouse location in v2d coords */
} v2dViewZoomData;
-/* initialise panning customdata */
+/* initialize panning customdata */
static int view_zoomdrag_init(bContext *C, wmOperator *op)
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
v2dViewZoomData *vzd;
View2D *v2d;
/* regions now have v2d-data by default, so check for region */
if (ar == NULL)
return 0;
- v2d= &ar->v2d;
+ v2d = &ar->v2d;
/* check that 2d-view is zoomable */
if ((v2d->keepzoom & V2D_LOCKZOOM_X) && (v2d->keepzoom & V2D_LOCKZOOM_Y))
return 0;
/* set custom-data for operator */
- vzd= MEM_callocN(sizeof(v2dViewZoomData), "v2dViewZoomData");
- op->customdata= vzd;
+ vzd = MEM_callocN(sizeof(v2dViewZoomData), "v2dViewZoomData");
+ op->customdata = vzd;
/* set pointers to owners */
- vzd->v2d= v2d;
+ vzd->v2d = v2d;
vzd->ar = ar;
return 1;
@@ -557,13 +558,13 @@ static int view_zoomdrag_init(bContext *C, wmOperator *op)
/* check if step-zoom can be applied */
static int view_zoom_poll(bContext *C)
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
View2D *v2d;
/* check if there's a region in context to work with */
if (ar == NULL)
return 0;
- v2d= &ar->v2d;
+ v2d = &ar->v2d;
/* check that 2d-view is zoomable */
if ((v2d->keepzoom & V2D_LOCKZOOM_X) && (v2d->keepzoom & V2D_LOCKZOOM_Y))
@@ -576,42 +577,42 @@ static int view_zoom_poll(bContext *C)
/* apply transform to view (i.e. adjust 'cur' rect) */
static void view_zoomstep_apply(bContext *C, wmOperator *op)
{
- v2dViewZoomData *vzd= op->customdata;
- ARegion *ar= CTX_wm_region(C);
- View2D *v2d= &ar->v2d;
+ v2dViewZoomData *vzd = op->customdata;
+ ARegion *ar = CTX_wm_region(C);
+ View2D *v2d = &ar->v2d;
float dx, dy, facx, facy;
/* calculate amount to move view by, ensuring symmetry so the
* old zoom level is restored after zooming back the same amount
*/
- facx= RNA_float_get(op->ptr, "zoomfacx");
- facy= RNA_float_get(op->ptr, "zoomfacy");
+ facx = RNA_float_get(op->ptr, "zoomfacx");
+ facy = RNA_float_get(op->ptr, "zoomfacy");
if (facx >= 0.0f) {
- dx= (v2d->cur.xmax - v2d->cur.xmin) * facx;
- dy= (v2d->cur.ymax - v2d->cur.ymin) * facy;
+ dx = (v2d->cur.xmax - v2d->cur.xmin) * facx;
+ dy = (v2d->cur.ymax - v2d->cur.ymin) * facy;
}
else {
- dx= ((v2d->cur.xmax - v2d->cur.xmin)/(1.0f + 2.0f*facx)) * facx;
- dy= ((v2d->cur.ymax - v2d->cur.ymin)/(1.0f + 2.0f*facy)) * facy;
+ dx = ((v2d->cur.xmax - v2d->cur.xmin) / (1.0f + 2.0f * facx)) * facx;
+ dy = ((v2d->cur.ymax - v2d->cur.ymin) / (1.0f + 2.0f * facy)) * facy;
}
/* only resize view on an axis if change is allowed */
- if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0) {
+ if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0) {
if (v2d->keepofs & V2D_LOCKOFS_X) {
- v2d->cur.xmax -= 2*dx;
+ v2d->cur.xmax -= 2 * dx;
}
else if (v2d->keepofs & V2D_KEEPOFS_X) {
if (v2d->align & V2D_ALIGN_NO_POS_X)
- v2d->cur.xmin += 2*dx;
+ v2d->cur.xmin += 2 * dx;
else
- v2d->cur.xmax -= 2*dx;
+ v2d->cur.xmax -= 2 * dx;
}
else {
if (U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
- float mval_fac = (vzd->mx_2d - v2d->cur.xmin) / (v2d->cur.xmax-v2d->cur.xmin);
+ float mval_fac = (vzd->mx_2d - v2d->cur.xmin) / (v2d->cur.xmax - v2d->cur.xmin);
float mval_faci = 1.0f - mval_fac;
- float ofs= (mval_fac * dx) - (mval_faci * dx);
+ float ofs = (mval_fac * dx) - (mval_faci * dx);
v2d->cur.xmin += ofs + dx;
v2d->cur.xmax += ofs - dx;
@@ -622,21 +623,21 @@ static void view_zoomstep_apply(bContext *C, wmOperator *op)
}
}
}
- if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0) {
+ if ((v2d->keepzoom & V2D_LOCKZOOM_Y) == 0) {
if (v2d->keepofs & V2D_LOCKOFS_Y) {
- v2d->cur.ymax -= 2*dy;
+ v2d->cur.ymax -= 2 * dy;
}
else if (v2d->keepofs & V2D_KEEPOFS_Y) {
if (v2d->align & V2D_ALIGN_NO_POS_Y)
- v2d->cur.ymin += 2*dy;
+ v2d->cur.ymin += 2 * dy;
else
- v2d->cur.ymax -= 2*dy;
+ v2d->cur.ymax -= 2 * dy;
}
else {
if (U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
- float mval_fac = (vzd->my_2d - v2d->cur.ymin) / (v2d->cur.ymax-v2d->cur.ymin);
+ float mval_fac = (vzd->my_2d - v2d->cur.ymin) / (v2d->cur.ymax - v2d->cur.ymin);
float mval_faci = 1.0f - mval_fac;
- float ofs= (mval_fac * dy) - (mval_faci * dy);
+ float ofs = (mval_fac * dy) - (mval_faci * dy);
v2d->cur.ymin += ofs + dy;
v2d->cur.ymax += ofs - dy;
@@ -663,7 +664,7 @@ static void view_zoomstep_exit(wmOperator *op)
{
if (op->customdata) {
MEM_freeN(op->customdata);
- op->customdata= NULL;
+ op->customdata = NULL;
}
}
@@ -693,15 +694,15 @@ static int view_zoomin_invoke(bContext *C, wmOperator *op, wmEvent *event)
if (!view_zoomdrag_init(C, op))
return OPERATOR_PASS_THROUGH;
- vzd= op->customdata;
+ vzd = op->customdata;
if (U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
/* store initial mouse position (in view space) */
UI_view2d_region_to_view(&ar->v2d,
- event->mval[0], event->mval[1],
- &vzd->mx_2d, &vzd->my_2d);
+ event->mval[0], event->mval[1],
+ &vzd->mx_2d, &vzd->my_2d);
}
return view_zoomin_exec(C, op);
@@ -710,14 +711,14 @@ static int view_zoomin_invoke(bContext *C, wmOperator *op, wmEvent *event)
static void VIEW2D_OT_zoom_in(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Zoom In";
- ot->description= "Zoom in the view";
- ot->idname= "VIEW2D_OT_zoom_in";
+ ot->name = "Zoom In";
+ ot->description = "Zoom in the view";
+ ot->idname = "VIEW2D_OT_zoom_in";
/* api callbacks */
- ot->invoke= view_zoomin_invoke;
-// ot->exec= view_zoomin_exec; // XXX, needs view_zoomdrag_init called first.
- ot->poll= view_zoom_poll;
+ ot->invoke = view_zoomin_invoke;
+// ot->exec = view_zoomin_exec; // XXX, needs view_zoomdrag_init called first.
+ ot->poll = view_zoom_poll;
/* rna - must keep these in sync with the other operators */
RNA_def_float(ot->srna, "zoomfacx", 0, -FLT_MAX, FLT_MAX, "Zoom Factor X", "", -FLT_MAX, FLT_MAX);
@@ -750,15 +751,15 @@ static int view_zoomout_invoke(bContext *C, wmOperator *op, wmEvent *event)
if (!view_zoomdrag_init(C, op))
return OPERATOR_PASS_THROUGH;
- vzd= op->customdata;
+ vzd = op->customdata;
- if(U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
- ARegion *ar= CTX_wm_region(C);
+ if (U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
+ ARegion *ar = CTX_wm_region(C);
/* store initial mouse position (in view space) */
UI_view2d_region_to_view(&ar->v2d,
- event->mval[0], event->mval[1],
- &vzd->mx_2d, &vzd->my_2d);
+ event->mval[0], event->mval[1],
+ &vzd->mx_2d, &vzd->my_2d);
}
return view_zoomout_exec(C, op);
@@ -767,14 +768,14 @@ static int view_zoomout_invoke(bContext *C, wmOperator *op, wmEvent *event)
static void VIEW2D_OT_zoom_out(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Zoom Out";
- ot->description= "Zoom out the view";
- ot->idname= "VIEW2D_OT_zoom_out";
+ ot->name = "Zoom Out";
+ ot->description = "Zoom out the view";
+ ot->idname = "VIEW2D_OT_zoom_out";
/* api callbacks */
- ot->invoke= view_zoomout_invoke;
-// ot->exec= view_zoomout_exec; // XXX, needs view_zoomdrag_init called first.
- ot->poll= view_zoom_poll;
+ ot->invoke = view_zoomout_invoke;
+// ot->exec = view_zoomout_exec; // XXX, needs view_zoomdrag_init called first.
+ ot->poll = view_zoom_poll;
/* rna - must keep these in sync with the other operators */
RNA_def_float(ot->srna, "zoomfacx", 0, -FLT_MAX, FLT_MAX, "Zoom Factor X", "", -FLT_MAX, FLT_MAX);
@@ -784,7 +785,7 @@ static void VIEW2D_OT_zoom_out(wmOperatorType *ot)
/* ********************************************************* */
/* DRAG-ZOOM OPERATOR */
-/* MMB Drag - allows non-uniform scaling by dragging mouse
+/* MMB Drag - allows non-uniform scaling by dragging mouse
*
* In order to make sure this works, each operator must define the following RNA-Operator Props:
* deltax, deltay - amounts to add to each side of the 'cur' rect
@@ -793,35 +794,35 @@ static void VIEW2D_OT_zoom_out(wmOperatorType *ot)
/* apply transform to view (i.e. adjust 'cur' rect) */
static void view_zoomdrag_apply(bContext *C, wmOperator *op)
{
- v2dViewZoomData *vzd= op->customdata;
- View2D *v2d= vzd->v2d;
+ v2dViewZoomData *vzd = op->customdata;
+ View2D *v2d = vzd->v2d;
float dx, dy;
/* get amount to move view by */
- dx= RNA_float_get(op->ptr, "deltax");
- dy= RNA_float_get(op->ptr, "deltay");
+ 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);
+ double time = PIL_check_seconds_timer();
+ float time_step = (float)(time - vzd->timer_lastdraw);
dx *= time_step * 0.5f;
dy *= time_step * 0.5f;
- vzd->timer_lastdraw= time;
+ vzd->timer_lastdraw = time;
}
/* only move view on an axis if change is allowed */
- if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0) {
+ if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0) {
if (v2d->keepofs & V2D_LOCKOFS_X) {
- v2d->cur.xmax -= 2*dx;
+ v2d->cur.xmax -= 2 * dx;
}
else {
if (U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
- float mval_fac = (vzd->mx_2d - v2d->cur.xmin) / (v2d->cur.xmax-v2d->cur.xmin);
+ float mval_fac = (vzd->mx_2d - v2d->cur.xmin) / (v2d->cur.xmax - v2d->cur.xmin);
float mval_faci = 1.0f - mval_fac;
- float ofs= (mval_fac * dx) - (mval_faci * dx);
+ float ofs = (mval_fac * dx) - (mval_faci * dx);
v2d->cur.xmin += ofs + dx;
v2d->cur.xmax += ofs - dx;
@@ -832,15 +833,15 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op)
}
}
}
- if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0) {
+ if ((v2d->keepzoom & V2D_LOCKZOOM_Y) == 0) {
if (v2d->keepofs & V2D_LOCKOFS_Y) {
- v2d->cur.ymax -= 2*dy;
+ v2d->cur.ymax -= 2 * dy;
}
else {
if (U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
- float mval_fac = (vzd->my_2d - v2d->cur.ymin) / (v2d->cur.ymax-v2d->cur.ymin);
+ float mval_fac = (vzd->my_2d - v2d->cur.ymin) / (v2d->cur.ymax - v2d->cur.ymin);
float mval_faci = 1.0f - mval_fac;
- float ofs= (mval_fac * dy) - (mval_faci * dy);
+ float ofs = (mval_fac * dy) - (mval_faci * dy);
v2d->cur.ymin += ofs + dy;
v2d->cur.ymax += ofs - dy;
@@ -864,13 +865,13 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op)
static void view_zoomdrag_exit(bContext *C, wmOperator *op)
{
if (op->customdata) {
- v2dViewZoomData *vzd= op->customdata;
+ v2dViewZoomData *vzd = op->customdata;
- if(vzd->timer)
+ if (vzd->timer)
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), vzd->timer);
MEM_freeN(op->customdata);
- op->customdata= NULL;
+ op->customdata = NULL;
}
}
@@ -895,7 +896,7 @@ static int view_zoomdrag_exec(bContext *C, wmOperator *op)
/* set up modal operator and relevant settings */
static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- wmWindow *window= CTX_wm_window(C);
+ wmWindow *window = CTX_wm_window(C);
v2dViewZoomData *vzd;
View2D *v2d;
@@ -903,21 +904,21 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event)
if (!view_zoomdrag_init(C, op))
return OPERATOR_PASS_THROUGH;
- vzd= op->customdata;
- v2d= vzd->v2d;
+ vzd = op->customdata;
+ v2d = vzd->v2d;
if (event->type == MOUSEZOOM) {
float dx, dy, fac;
- vzd->lastx= event->prevx;
- vzd->lasty= event->prevy;
+ vzd->lastx = event->prevx;
+ vzd->lasty = event->prevy;
/* As we have only 1D information (magnify value), feed both axes
* with magnify information that is stored in x axis
*/
- fac= 0.01f * (event->x - event->prevx);
- dx= fac * (v2d->cur.xmax - v2d->cur.xmin) / 10.0f;
- dy= fac * (v2d->cur.ymax - v2d->cur.ymin) / 10.0f;
+ fac = 0.01f * (event->x - event->prevx);
+ dx = fac * (v2d->cur.xmax - v2d->cur.xmin) / 10.0f;
+ dy = fac * (v2d->cur.ymax - v2d->cur.ymin) / 10.0f;
RNA_float_set(op->ptr, "deltax", dx);
RNA_float_set(op->ptr, "deltay", dy);
@@ -928,21 +929,21 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
/* set initial settings */
- vzd->lastx= event->x;
- vzd->lasty= event->y;
+ vzd->lastx = event->x;
+ vzd->lasty = event->y;
RNA_float_set(op->ptr, "deltax", 0);
RNA_float_set(op->ptr, "deltay", 0);
/* for modal exit test */
- vzd->invoke_event= event->type;
+ vzd->invoke_event = event->type;
if (U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
/* store initial mouse position (in view space) */
UI_view2d_region_to_view(&ar->v2d,
- event->mval[0], event->mval[1],
- &vzd->mx_2d, &vzd->my_2d);
+ event->mval[0], event->mval[1],
+ &vzd->mx_2d, &vzd->my_2d);
}
if (v2d->keepofs & V2D_LOCKOFS_X)
@@ -957,8 +958,8 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event)
if (U.viewzoom == USER_ZOOM_CONT) {
/* needs a timer to continue redrawing */
- vzd->timer= WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f);
- vzd->timer_lastdraw= PIL_check_seconds_timer();
+ vzd->timer = WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f);
+ vzd->timer_lastdraw = PIL_check_seconds_timer();
}
return OPERATOR_RUNNING_MODAL;
@@ -967,14 +968,14 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* handle user input - calculations of mouse-movement need to be done here, not in the apply callback! */
static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- v2dViewZoomData *vzd= op->customdata;
- View2D *v2d= vzd->v2d;
+ v2dViewZoomData *vzd = op->customdata;
+ View2D *v2d = vzd->v2d;
/* execute the events */
if (event->type == TIMER && event->customdata == vzd->timer) {
view_zoomdrag_apply(C, op);
}
- else if(event->type == MOUSEMOVE) {
+ else if (event->type == MOUSEMOVE) {
float dx, dy;
/* calculate new delta transform, based on zooming mode */
@@ -984,35 +985,35 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event)
/* x-axis transform */
dist = (v2d->mask.xmax - v2d->mask.xmin) / 2.0f;
- dx= 1.0f - (fabsf(vzd->lastx - dist) + 2.0f) / (fabsf(event->x - dist) + 2.0f);
- dx*= 0.5f * (v2d->cur.xmax - v2d->cur.xmin);
+ dx = 1.0f - (fabsf(vzd->lastx - dist) + 2.0f) / (fabsf(event->x - dist) + 2.0f);
+ dx *= 0.5f * (v2d->cur.xmax - v2d->cur.xmin);
/* y-axis transform */
dist = (v2d->mask.ymax - v2d->mask.ymin) / 2.0f;
- dy= 1.0f - (fabsf(vzd->lasty - dist) + 2.0f) / (fabsf(event->y - dist) + 2.0f);
- dy*= 0.5f * (v2d->cur.ymax - v2d->cur.ymin);
+ dy = 1.0f - (fabsf(vzd->lasty - dist) + 2.0f) / (fabsf(event->y - dist) + 2.0f);
+ dy *= 0.5f * (v2d->cur.ymax - v2d->cur.ymin);
}
else {
/* 'continuous' or 'dolly' */
float fac;
/* x-axis transform */
- fac= 0.01f * (event->x - vzd->lastx);
- dx= fac * (v2d->cur.xmax - v2d->cur.xmin);
+ fac = 0.01f * (event->x - vzd->lastx);
+ dx = fac * (v2d->cur.xmax - v2d->cur.xmin);
/* y-axis transform */
- fac= 0.01f * (event->y - vzd->lasty);
- dy= fac * (v2d->cur.ymax - v2d->cur.ymin);
+ 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);
+ double time = PIL_check_seconds_timer();
+ float time_step = (float)(time - vzd->timer_lastdraw);
dx /= (0.1f / time_step);
dy /= (0.1f / time_step);
- vzd->timer_lastdraw= time;
+ vzd->timer_lastdraw = time;
}
#endif
}
@@ -1027,23 +1028,23 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event)
* - continuous zoom only depends on distance of mouse to starting point to determine rate of change
*/
if (U.viewzoom != USER_ZOOM_CONT) { // XXX store this setting as RNA prop?
- vzd->lastx= event->x;
- vzd->lasty= event->y;
+ vzd->lastx = event->x;
+ vzd->lasty = event->y;
}
/* apply zooming */
view_zoomdrag_apply(C, op);
}
- else if (event->type == vzd->invoke_event || event->type==ESCKEY) {
+ else if (event->type == vzd->invoke_event || event->type == ESCKEY) {
if (event->val == KM_RELEASE) {
/* for redo, store the overall deltas - need to respect zoom-locks here... */
- if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0)
+ if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0)
RNA_float_set(op->ptr, "deltax", vzd->dx);
else
RNA_float_set(op->ptr, "deltax", 0);
- if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0)
+ if ((v2d->keepzoom & V2D_LOCKZOOM_Y) == 0)
RNA_float_set(op->ptr, "deltay", vzd->dy);
else
RNA_float_set(op->ptr, "deltay", 0);
@@ -1062,20 +1063,20 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event)
static void VIEW2D_OT_zoom(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Zoom 2D View";
- ot->description= "Zoom in/out the view";
- ot->idname= "VIEW2D_OT_zoom";
+ ot->name = "Zoom 2D View";
+ ot->description = "Zoom in/out the view";
+ ot->idname = "VIEW2D_OT_zoom";
/* api callbacks */
- ot->exec= view_zoomdrag_exec;
- ot->invoke= view_zoomdrag_invoke;
- ot->modal= view_zoomdrag_modal;
- ot->cancel= view_zoomdrag_cancel;
+ ot->exec = view_zoomdrag_exec;
+ ot->invoke = view_zoomdrag_invoke;
+ ot->modal = view_zoomdrag_modal;
+ ot->cancel = view_zoomdrag_cancel;
- ot->poll= view_zoom_poll;
+ ot->poll = view_zoom_poll;
/* operator is repeatable */
- // ot->flag= OPTYPE_BLOCKING;
+ // ot->flag = OPTYPE_BLOCKING;
/* rna - must keep these in sync with the other operators */
RNA_def_float(ot->srna, "deltax", 0, -FLT_MAX, FLT_MAX, "Delta X", "", -FLT_MAX, FLT_MAX);
@@ -1096,8 +1097,8 @@ static void VIEW2D_OT_zoom(wmOperatorType *ot)
static int view_borderzoom_exec(bContext *C, wmOperator *op)
{
- ARegion *ar= CTX_wm_region(C);
- View2D *v2d= &ar->v2d;
+ ARegion *ar = CTX_wm_region(C);
+ View2D *v2d = &ar->v2d;
rctf rect;
int gesture_mode;
@@ -1106,7 +1107,7 @@ static int view_borderzoom_exec(bContext *C, wmOperator *op)
UI_view2d_region_to_view(v2d, RNA_int_get(op->ptr, "xmax"), RNA_int_get(op->ptr, "ymax"), &rect.xmax, &rect.ymax);
/* check if zooming in/out view */
- gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
+ gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
if (gesture_mode == GESTURE_MODAL_IN) {
/* zoom in:
@@ -1114,39 +1115,40 @@ static int view_borderzoom_exec(bContext *C, wmOperator *op)
* - just set the 'cur' rect to have the same coordinates as the border region
* if zoom is allowed to be changed
*/
- if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0) {
- v2d->cur.xmin= rect.xmin;
- v2d->cur.xmax= rect.xmax;
+ if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0) {
+ v2d->cur.xmin = rect.xmin;
+ v2d->cur.xmax = rect.xmax;
}
- if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0) {
- v2d->cur.ymin= rect.ymin;
- v2d->cur.ymax= rect.ymax;
+ if ((v2d->keepzoom & V2D_LOCKZOOM_Y) == 0) {
+ v2d->cur.ymin = rect.ymin;
+ v2d->cur.ymax = rect.ymax;
}
}
- else /* if (gesture_mode == GESTURE_MODAL_OUT) */ {
+ 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
*/
float zoom, center, size;
// TODO: is this zoom factor calculation valid? It seems to produce same results everytime...
- if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0) {
- size= (v2d->cur.xmax - v2d->cur.xmin);
- zoom= size / (rect.xmax - rect.xmin);
- center= (v2d->cur.xmax + v2d->cur.xmin) * 0.5f;
+ if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0) {
+ size = (v2d->cur.xmax - v2d->cur.xmin);
+ zoom = size / (rect.xmax - rect.xmin);
+ center = (v2d->cur.xmax + v2d->cur.xmin) * 0.5f;
- v2d->cur.xmin= center - (size * zoom);
- v2d->cur.xmax= center + (size * zoom);
+ v2d->cur.xmin = center - (size * zoom);
+ v2d->cur.xmax = center + (size * zoom);
}
- if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0) {
- size= (v2d->cur.ymax - v2d->cur.ymin);
- zoom= size / (rect.ymax - rect.ymin);
- center= (v2d->cur.ymax + v2d->cur.ymin) * 0.5f;
+ if ((v2d->keepzoom & V2D_LOCKZOOM_Y) == 0) {
+ size = (v2d->cur.ymax - v2d->cur.ymin);
+ zoom = size / (rect.ymax - rect.ymin);
+ center = (v2d->cur.ymax + v2d->cur.ymin) * 0.5f;
- v2d->cur.ymin= center - (size * zoom);
- v2d->cur.ymax= center + (size * zoom);
+ v2d->cur.ymin = center - (size * zoom);
+ v2d->cur.ymax = center + (size * zoom);
}
}
@@ -1163,17 +1165,17 @@ static int view_borderzoom_exec(bContext *C, wmOperator *op)
static void VIEW2D_OT_zoom_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Zoom to Border";
- ot->description= "Zoom in the view to the nearest item contained in the border";
- ot->idname= "VIEW2D_OT_zoom_border";
+ ot->name = "Zoom to Border";
+ ot->description = "Zoom in the view to the nearest item contained in the border";
+ ot->idname = "VIEW2D_OT_zoom_border";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= view_borderzoom_exec;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = view_borderzoom_exec;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= view_zoom_poll;
+ ot->poll = view_zoom_poll;
/* rna */
RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX);
@@ -1186,47 +1188,47 @@ static void VIEW2D_OT_zoom_border(wmOperatorType *ot)
/* ********************************************************* */
/* SCROLLERS */
-/* Scrollers should behave in the following ways, when clicked on with LMB (and dragged):
+/* Scrollers should behave in the following ways, when clicked on with LMB (and dragged):
* 1) 'Handles' on end of 'bubble' - when the axis that the scroller represents is zoomable,
* enlarge 'cur' rect on the relevant side
* 2) 'Bubble'/'bar' - just drag, and bar should move with mouse (view pans opposite)
*
* In order to make sure this works, each operator must define the following RNA-Operator Props:
- * deltax, deltay - define how much to move view by (relative to zoom-correction factor)
+ * deltax, deltay - define how much to move view by (relative to zoom-correction factor)
*/
/* customdata for scroller-invoke data */
typedef struct v2dScrollerMove {
- View2D *v2d; /* View2D data that this operation affects */
- ARegion *ar; /* region that the scroller is in */
+ View2D *v2d; /* View2D data that this operation affects */
+ ARegion *ar; /* region that the scroller is in */
- short scroller; /* scroller that mouse is in ('h' or 'v') */
- short zone; /* -1 is min zoomer, 0 is bar, 1 is max zoomer */ // XXX find some way to provide visual feedback of this (active color?)
+ short scroller; /* scroller that mouse is in ('h' or 'v') */
+ short zone; /* -1 is min zoomer, 0 is bar, 1 is max zoomer */ // XXX find some way to provide visual feedback of this (active color?)
- float fac; /* view adjustment factor, based on size of region */
- float delta; /* amount moved by mouse on axis of interest */
+ float fac; /* view adjustment factor, based on size of region */
+ float delta; /* amount moved by mouse on axis of interest */
- float scrollbarwidth; /* width of the scrollbar itself, used for page up/down clicks */
+ float scrollbarwidth; /* width of the scrollbar itself, used for page up/down clicks */
int scrollbar_orig; /* initial location of scrollbar x/y, mouse relative */
- int lastx, lasty; /* previous mouse coordinates (in screen coordinates) for determining movement */
+ int lastx, lasty; /* previous mouse coordinates (in screen coordinates) for determining movement */
} v2dScrollerMove;
/* View2DScrollers is typedef'd in UI_view2d.h
* This is a CUT DOWN VERSION of the 'real' version, which is defined in view2d.c, as we only need focus bubble info
* WARNING: the start of this struct must not change, so that it stays in sync with the 'real' version
- * For now, we don't need to have a separate (internal) header for structs like this...
+ * For now, we don't need to have a separate (internal) header for structs like this...
*/
struct View2DScrollers {
- /* focus bubbles */
- int vert_min, vert_max; /* vertical scrollbar */
- int hor_min, hor_max; /* horizontal scrollbar */
+ /* focus bubbles */
+ int vert_min, vert_max; /* vertical scrollbar */
+ int hor_min, hor_max; /* horizontal scrollbar */
};
/* quick enum for vsm->zone (scroller handles) */
enum {
- SCROLLHANDLE_MIN= -1,
+ SCROLLHANDLE_MIN = -1,
SCROLLHANDLE_BAR,
SCROLLHANDLE_MAX,
SCROLLHANDLE_MIN_OUTSIDE,
@@ -1236,26 +1238,26 @@ enum {
/* ------------------------ */
/* check if mouse is within scroller handle
- * - mouse = relevant mouse coordinate in region space
- * - sc_min, sc_max = extents of scroller 'groove' (potential available space for scroller)
- * - sh_min, sh_max = positions of scrollbar handles
+ * - mouse = relevant mouse coordinate in region space
+ * - sc_min, sc_max = extents of scroller 'groove' (potential available space for scroller)
+ * - sh_min, sh_max = positions of scrollbar handles
*/
static short mouse_in_scroller_handle(int mouse, int sc_min, int sc_max, int sh_min, int sh_max)
{
- short in_min, in_max, in_bar, out_min, out_max, in_view=1;
+ short in_min, in_max, in_bar, out_min, out_max, in_view = 1;
/* firstly, check if
* - 'bubble' fills entire scroller
* - 'bubble' completely out of view on either side
*/
- if ((sh_min <= sc_min) && (sh_max >= sc_max)) in_view= 0;
+ if ((sh_min <= sc_min) && (sh_max >= sc_max)) in_view = 0;
if (sh_min == sh_max) {
- if (sh_min <= sc_min) in_view= 0;
- if (sh_max >= sc_max) in_view= 0;
+ if (sh_min <= sc_min) in_view = 0;
+ if (sh_max >= sc_max) in_view = 0;
}
else {
- if (sh_max <= sc_min) in_view= 0;
- if (sh_min >= sc_max) in_view= 0;
+ if (sh_max <= sc_min) in_view = 0;
+ if (sh_min >= sc_max) in_view = 0;
}
@@ -1265,11 +1267,11 @@ static short mouse_in_scroller_handle(int mouse, int sc_min, int sc_max, int sh_
/* check if mouse is in or past either handle */
// TODO: check if these extents are still valid or not
- in_max= ( (mouse >= (sh_max - V2D_SCROLLER_HANDLE_SIZE)) && (mouse <= (sh_max + V2D_SCROLLER_HANDLE_SIZE)) );
- in_min= ( (mouse <= (sh_min + V2D_SCROLLER_HANDLE_SIZE)) && (mouse >= (sh_min - V2D_SCROLLER_HANDLE_SIZE)) );
- in_bar= ( (mouse < (sh_max - V2D_SCROLLER_HANDLE_SIZE)) && (mouse > (sh_min + V2D_SCROLLER_HANDLE_SIZE)) );
- out_min= mouse < (sh_min - V2D_SCROLLER_HANDLE_SIZE);
- out_max= mouse > (sh_max + V2D_SCROLLER_HANDLE_SIZE);
+ in_max = ( (mouse >= (sh_max - V2D_SCROLLER_HANDLE_SIZE)) && (mouse <= (sh_max + V2D_SCROLLER_HANDLE_SIZE)) );
+ in_min = ( (mouse <= (sh_min + V2D_SCROLLER_HANDLE_SIZE)) && (mouse >= (sh_min - V2D_SCROLLER_HANDLE_SIZE)) );
+ in_bar = ( (mouse < (sh_max - V2D_SCROLLER_HANDLE_SIZE)) && (mouse > (sh_min + V2D_SCROLLER_HANDLE_SIZE)) );
+ out_min = mouse < (sh_min - V2D_SCROLLER_HANDLE_SIZE);
+ out_max = mouse > (sh_max + V2D_SCROLLER_HANDLE_SIZE);
if (in_bar)
return SCROLLHANDLE_BAR;
@@ -1286,23 +1288,23 @@ static short mouse_in_scroller_handle(int mouse, int sc_min, int sc_max, int sh_
return SCROLLHANDLE_BAR;
}
-/* initialise customdata for scroller manipulation operator */
+/* initialize customdata for scroller manipulation operator */
static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event, short in_scroller)
{
v2dScrollerMove *vsm;
View2DScrollers *scrollers;
- ARegion *ar= CTX_wm_region(C);
- View2D *v2d= &ar->v2d;
+ ARegion *ar = CTX_wm_region(C);
+ View2D *v2d = &ar->v2d;
float mask_size;
/* set custom-data for operator */
- vsm= MEM_callocN(sizeof(v2dScrollerMove), "v2dScrollerMove");
- op->customdata= vsm;
+ vsm = MEM_callocN(sizeof(v2dScrollerMove), "v2dScrollerMove");
+ op->customdata = vsm;
/* set general data */
- vsm->v2d= v2d;
- vsm->ar= ar;
- vsm->scroller= in_scroller;
+ vsm->v2d = v2d;
+ vsm->ar = ar;
+ vsm->scroller = in_scroller;
/* store mouse-coordinates, and convert mouse/screen coordinates to region coordinates */
vsm->lastx = event->x;
@@ -1310,20 +1312,20 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event,
/* 'zone' depends on where mouse is relative to bubble
* - zooming must be allowed on this axis, otherwise, default to pan
*/
- scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
+ scrollers = UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
if (in_scroller == 'h') {
/* horizontal scroller - calculate adjustment factor first */
- mask_size= (float)(v2d->hor.xmax - v2d->hor.xmin);
- vsm->fac= (v2d->tot.xmax - v2d->tot.xmin) / mask_size;
+ mask_size = (float)(v2d->hor.xmax - v2d->hor.xmin);
+ vsm->fac = (v2d->tot.xmax - v2d->tot.xmin) / mask_size;
/* get 'zone' (i.e. which part of scroller is activated) */
- vsm->zone= mouse_in_scroller_handle(event->mval[0], v2d->hor.xmin, v2d->hor.xmax, scrollers->hor_min, scrollers->hor_max);
+ vsm->zone = mouse_in_scroller_handle(event->mval[0], v2d->hor.xmin, v2d->hor.xmax, scrollers->hor_min, scrollers->hor_max);
if ((v2d->keepzoom & V2D_LOCKZOOM_X) && ELEM(vsm->zone, SCROLLHANDLE_MIN, SCROLLHANDLE_MAX)) {
/* default to scroll, as handles not usable */
- vsm->zone= SCROLLHANDLE_BAR;
+ vsm->zone = SCROLLHANDLE_BAR;
}
vsm->scrollbarwidth = scrollers->hor_max - scrollers->hor_min;
@@ -1331,19 +1333,19 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event,
}
else {
/* vertical scroller - calculate adjustment factor first */
- mask_size= (float)(v2d->vert.ymax - v2d->vert.ymin);
- vsm->fac= (v2d->tot.ymax - v2d->tot.ymin) / mask_size;
+ mask_size = (float)(v2d->vert.ymax - v2d->vert.ymin);
+ vsm->fac = (v2d->tot.ymax - v2d->tot.ymin) / mask_size;
/* get 'zone' (i.e. which part of scroller is activated) */
- vsm->zone= mouse_in_scroller_handle(event->mval[1], v2d->vert.ymin, v2d->vert.ymax, scrollers->vert_min, scrollers->vert_max);
+ vsm->zone = mouse_in_scroller_handle(event->mval[1], v2d->vert.ymin, v2d->vert.ymax, scrollers->vert_min, scrollers->vert_max);
if ((v2d->keepzoom & V2D_LOCKZOOM_Y) && ELEM(vsm->zone, SCROLLHANDLE_MIN, SCROLLHANDLE_MAX)) {
/* default to scroll, as handles not usable */
- vsm->zone= SCROLLHANDLE_BAR;
+ vsm->zone = SCROLLHANDLE_BAR;
}
vsm->scrollbarwidth = scrollers->vert_max - scrollers->vert_min;
- vsm->scrollbar_orig = ((scrollers->vert_max + scrollers->vert_min) / 2) + + ar->winrct.ymin;
+ vsm->scrollbar_orig = ((scrollers->vert_max + scrollers->vert_min) / 2) + +ar->winrct.ymin;
}
UI_view2d_scrollers_free(scrollers);
@@ -1354,12 +1356,12 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event,
static void scroller_activate_exit(bContext *C, wmOperator *op)
{
if (op->customdata) {
- v2dScrollerMove *vsm= op->customdata;
+ v2dScrollerMove *vsm = op->customdata;
- vsm->v2d->scroll_ui &= ~(V2D_SCROLL_H_ACTIVE|V2D_SCROLL_V_ACTIVE);
+ vsm->v2d->scroll_ui &= ~(V2D_SCROLL_H_ACTIVE | V2D_SCROLL_V_ACTIVE);
MEM_freeN(op->customdata);
- op->customdata= NULL;
+ op->customdata = NULL;
ED_region_tag_redraw(CTX_wm_region(C));
}
@@ -1375,12 +1377,12 @@ static int scroller_activate_cancel(bContext *C, wmOperator *op)
/* apply transform to view (i.e. adjust 'cur' rect) */
static void scroller_activate_apply(bContext *C, wmOperator *op)
{
- v2dScrollerMove *vsm= op->customdata;
- View2D *v2d= vsm->v2d;
+ v2dScrollerMove *vsm = op->customdata;
+ View2D *v2d = vsm->v2d;
float temp;
/* calculate amount to move view by */
- temp= vsm->fac * vsm->delta;
+ temp = vsm->fac * vsm->delta;
/* type of movement */
switch (vsm->zone) {
@@ -1429,7 +1431,7 @@ static void scroller_activate_apply(bContext *C, wmOperator *op)
/* handle user input for scrollers - calculations of mouse-movement need to be done here, not in the apply callback! */
static int scroller_activate_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- v2dScrollerMove *vsm= op->customdata;
+ v2dScrollerMove *vsm = op->customdata;
/* execute the events */
switch (event->type) {
@@ -1440,10 +1442,10 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, wmEvent *event)
/* if using bar (i.e. 'panning') or 'max' zoom widget */
switch (vsm->scroller) {
case 'h': /* horizontal scroller - so only horizontal movement ('cur' moves opposite to mouse) */
- vsm->delta= (float)(event->x - vsm->lastx);
+ vsm->delta = (float)(event->x - vsm->lastx);
break;
case 'v': /* vertical scroller - so only vertical movement ('cur' moves opposite to mouse) */
- vsm->delta= (float)(event->y - vsm->lasty);
+ vsm->delta = (float)(event->y - vsm->lasty);
break;
}
}
@@ -1451,25 +1453,25 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, wmEvent *event)
/* using 'min' zoom widget */
switch (vsm->scroller) {
case 'h': /* horizontal scroller - so only horizontal movement ('cur' moves with mouse) */
- vsm->delta= (float)(vsm->lastx - event->x);
+ vsm->delta = (float)(vsm->lastx - event->x);
break;
case 'v': /* vertical scroller - so only vertical movement ('cur' moves with to mouse) */
- vsm->delta= (float)(vsm->lasty - event->y);
+ vsm->delta = (float)(vsm->lasty - event->y);
break;
}
}
/* store previous coordinates */
- vsm->lastx= event->x;
- vsm->lasty= event->y;
+ vsm->lastx = event->x;
+ vsm->lasty = event->y;
scroller_activate_apply(C, op);
}
- break;
+ break;
case LEFTMOUSE:
case MIDDLEMOUSE:
- if (event->val==KM_RELEASE) {
+ if (event->val == KM_RELEASE) {
/* single-click was in empty space outside bubble, so scroll by 1 'page' */
if (ELEM(vsm->zone, SCROLLHANDLE_MIN_OUTSIDE, SCROLLHANDLE_MAX_OUTSIDE)) {
if (vsm->zone == SCROLLHANDLE_MIN_OUTSIDE)
@@ -1499,54 +1501,54 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, wmEvent *event)
/* a click (or click drag in progress) should have occurred, so check if it happened in scrollbar */
static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- ARegion *ar= CTX_wm_region(C);
- View2D *v2d= &ar->v2d;
- short in_scroller= 0;
+ ARegion *ar = CTX_wm_region(C);
+ View2D *v2d = &ar->v2d;
+ short in_scroller = 0;
/* check if mouse in scrollbars, if they're enabled */
- in_scroller= UI_view2d_mouse_in_scrollers(C, v2d, event->x, event->y);
+ in_scroller = UI_view2d_mouse_in_scrollers(C, v2d, event->x, event->y);
/* if in a scroller, init customdata then set modal handler which will catch mousedown to start doing useful stuff */
if (in_scroller) {
v2dScrollerMove *vsm;
- /* initialise customdata */
+ /* initialize customdata */
scroller_activate_init(C, op, event, in_scroller);
- vsm= (v2dScrollerMove *)op->customdata;
+ vsm = (v2dScrollerMove *)op->customdata;
/* support for quick jump to location - gtk and qt do this on linux */
if (event->type == MIDDLEMOUSE) {
switch (vsm->scroller) {
case 'h': /* horizontal scroller - so only horizontal movement ('cur' moves opposite to mouse) */
- vsm->delta= (float)(event->x - vsm->scrollbar_orig);
+ vsm->delta = (float)(event->x - vsm->scrollbar_orig);
break;
case 'v': /* vertical scroller - so only vertical movement ('cur' moves opposite to mouse) */
- vsm->delta= (float)(event->y - vsm->scrollbar_orig);
+ vsm->delta = (float)(event->y - vsm->scrollbar_orig);
break;
}
scroller_activate_apply(C, op);
- vsm->zone= SCROLLHANDLE_BAR;
+ vsm->zone = SCROLLHANDLE_BAR;
}
/* check if zoom zones are inappropriate (i.e. zoom widgets not shown), so cannot continue
* NOTE: see view2d.c for latest conditions, and keep this in sync with that
*/
if (ELEM(vsm->zone, SCROLLHANDLE_MIN, SCROLLHANDLE_MAX)) {
- if ( ((vsm->scroller=='h') && (v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL)==0) ||
- ((vsm->scroller=='v') && (v2d->scroll & V2D_SCROLL_SCALE_VERTICAL)==0) )
+ if ( ((vsm->scroller == 'h') && (v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL) == 0) ||
+ ((vsm->scroller == 'v') && (v2d->scroll & V2D_SCROLL_SCALE_VERTICAL) == 0) )
{
/* switch to bar (i.e. no scaling gets handled) */
- vsm->zone= SCROLLHANDLE_BAR;
+ vsm->zone = SCROLLHANDLE_BAR;
}
}
/* check if zone is inappropriate (i.e. 'bar' but panning is banned), so cannot continue */
if (vsm->zone == SCROLLHANDLE_BAR) {
- if ( ((vsm->scroller=='h') && (v2d->keepofs & V2D_LOCKOFS_X)) ||
- ((vsm->scroller=='v') && (v2d->keepofs & V2D_LOCKOFS_Y)) )
+ if ( ((vsm->scroller == 'h') && (v2d->keepofs & V2D_LOCKOFS_X)) ||
+ ((vsm->scroller == 'v') && (v2d->keepofs & V2D_LOCKOFS_Y)) )
{
- /* free customdata initialised */
+ /* free customdata initialized */
scroller_activate_exit(C, op);
/* can't catch this event for ourselves, so let it go to someone else? */
@@ -1555,10 +1557,10 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
/* zone is also inappropriate if scroller is not visible... */
- if ( ((vsm->scroller=='h') && (v2d->scroll & (V2D_SCROLL_HORIZONTAL_HIDE|V2D_SCROLL_HORIZONTAL_FULLR))) ||
- ((vsm->scroller=='v') && (v2d->scroll & (V2D_SCROLL_VERTICAL_HIDE|V2D_SCROLL_VERTICAL_FULLR))) )
+ if ( ((vsm->scroller == 'h') && (v2d->scroll & (V2D_SCROLL_HORIZONTAL_HIDE | V2D_SCROLL_HORIZONTAL_FULLR))) ||
+ ((vsm->scroller == 'v') && (v2d->scroll & (V2D_SCROLL_VERTICAL_HIDE | V2D_SCROLL_VERTICAL_FULLR))) )
{
- /* free customdata initialised */
+ /* free customdata initialized */
scroller_activate_exit(C, op);
/* can't catch this event for ourselves, so let it go to someone else? */
@@ -1567,7 +1569,7 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
/* activate the scroller */
- if (vsm->scroller=='h')
+ if (vsm->scroller == 'h')
v2d->scroll_ui |= V2D_SCROLL_H_ACTIVE;
else
v2d->scroll_ui |= V2D_SCROLL_V_ACTIVE;
@@ -1586,19 +1588,19 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event)
static void VIEW2D_OT_scroller_activate(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Scroller Activate";
- ot->description= "Scroll view by mouse click and drag";
- ot->idname= "VIEW2D_OT_scroller_activate";
+ ot->name = "Scroller Activate";
+ ot->description = "Scroll view by mouse click and drag";
+ ot->idname = "VIEW2D_OT_scroller_activate";
/* flags */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
/* api callbacks */
- ot->invoke= scroller_activate_invoke;
- ot->modal= scroller_activate_modal;
- ot->cancel= scroller_activate_cancel;
+ ot->invoke = scroller_activate_invoke;
+ ot->modal = scroller_activate_modal;
+ ot->cancel = scroller_activate_cancel;
- ot->poll= view2d_poll;
+ ot->poll = view2d_poll;
}
/* ********************************************************* */
@@ -1606,38 +1608,38 @@ static void VIEW2D_OT_scroller_activate(wmOperatorType *ot)
static int reset_exec(bContext *C, wmOperator *UNUSED(op))
{
- uiStyle *style= UI_GetStyle();
- ARegion *ar= CTX_wm_region(C);
- View2D *v2d= &ar->v2d;
+ uiStyle *style = UI_GetStyle();
+ ARegion *ar = CTX_wm_region(C);
+ View2D *v2d = &ar->v2d;
int winx, winy;
/* zoom 1.0 */
- winx= (float)(v2d->mask.xmax - v2d->mask.xmin + 1);
- winy= (float)(v2d->mask.ymax - v2d->mask.ymin + 1);
+ winx = (float)(v2d->mask.xmax - v2d->mask.xmin + 1);
+ winy = (float)(v2d->mask.ymax - v2d->mask.ymin + 1);
- v2d->cur.xmax= v2d->cur.xmin + winx;
- v2d->cur.ymax= v2d->cur.ymin + winy;
+ v2d->cur.xmax = v2d->cur.xmin + winx;
+ v2d->cur.ymax = v2d->cur.ymin + winy;
/* align */
if (v2d->align) {
/* posx and negx flags are mutually exclusive, so watch out */
if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) {
- v2d->cur.xmax= 0.0f;
- v2d->cur.xmin= -winx*style->panelzoom;
+ v2d->cur.xmax = 0.0f;
+ v2d->cur.xmin = -winx * style->panelzoom;
}
else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) {
- v2d->cur.xmax= winx*style->panelzoom;
- v2d->cur.xmin= 0.0f;
+ v2d->cur.xmax = winx * style->panelzoom;
+ v2d->cur.xmin = 0.0f;
}
/* - posx and negx flags are mutually exclusive, so watch out */
if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) {
- v2d->cur.ymax= 0.0f;
- v2d->cur.ymin= -winy*style->panelzoom;
+ v2d->cur.ymax = 0.0f;
+ v2d->cur.ymin = -winy * style->panelzoom;
}
else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) {
- v2d->cur.ymax= winy*style->panelzoom;
- v2d->cur.ymin= 0.0f;
+ v2d->cur.ymax = winy * style->panelzoom;
+ v2d->cur.ymin = 0.0f;
}
}
@@ -1654,13 +1656,13 @@ static int reset_exec(bContext *C, wmOperator *UNUSED(op))
static void VIEW2D_OT_reset(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reset View";
- ot->description= "Reset the view";
- ot->idname= "VIEW2D_OT_reset";
+ ot->name = "Reset View";
+ ot->description = "Reset the view";
+ ot->idname = "VIEW2D_OT_reset";
/* api callbacks */
- ot->exec= reset_exec;
- ot->poll= view2d_poll;
+ ot->exec = reset_exec;
+ ot->poll = view2d_poll;
}
/* ********************************************************* */
@@ -1688,7 +1690,7 @@ void UI_view2d_operatortypes(void)
void UI_view2d_keymap(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "View2D", 0, 0);
+ wmKeyMap *keymap = WM_keymap_find(keyconf, "View2D", 0, 0);
wmKeyMapItem *kmi;
/* scrollers */
@@ -1714,21 +1716,21 @@ void UI_view2d_keymap(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_in", PADPLUSKEY, KM_PRESS, 0, 0);
/* scroll up/down - no modifiers, only when zoom fails */
- /* these may fail if zoom is disallowed, in which case they should pass on event */
+ /* these may fail if zoom is disallowed, in which case they should pass on event */
WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_down", WHEELDOWNMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_up", WHEELUPMOUSE, KM_PRESS, 0, 0);
- /* these may be necessary if vertical scroll is disallowed */
+ /* these may be necessary if vertical scroll is disallowed */
WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_right", WHEELDOWNMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_left", WHEELUPMOUSE, KM_PRESS, 0, 0);
/* alternatives for page up/down to scroll */
#if 0 // XXX disabled, since this causes conflicts with hotkeys in animation editors
- /* scroll up/down may fall through to left/right */
+ /* scroll up/down may fall through to left/right */
WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_down", PAGEDOWNKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_up", PAGEUPKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_right", PAGEDOWNKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_left", PAGEUPKEY, KM_PRESS, 0, 0);
- /* shift for moving view left/right with page up/down */
+ /* shift for moving view left/right with page up/down */
WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_right", PAGEDOWNKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_left", PAGEUPKEY, KM_PRESS, KM_SHIFT, 0);
#endif
@@ -1741,7 +1743,7 @@ void UI_view2d_keymap(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_border", BKEY, KM_PRESS, KM_SHIFT, 0);
/* Alternative keymap for buttons listview */
- keymap= WM_keymap_find(keyconf, "View2D Buttons List", 0, 0);
+ keymap = WM_keymap_find(keyconf, "View2D Buttons List", 0, 0);
WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", MIDDLEMOUSE, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/mesh/CMakeLists.txt b/source/blender/editors/mesh/CMakeLists.txt
index 9d2229b52f4..de9443d1eb4 100644
--- a/source/blender/editors/mesh/CMakeLists.txt
+++ b/source/blender/editors/mesh/CMakeLists.txt
@@ -38,15 +38,14 @@ set(INC_SYS
)
set(SRC
- bmesh_select.c
- bmesh_selecthistory.c
- bmesh_tools.c
- bmesh_utils.c
editface.c
editmesh_add.c
editmesh_bvh.c
- knifetool.c
- loopcut.c
+ editmesh_knife.c
+ editmesh_loopcut.c
+ editmesh_select.c
+ editmesh_tools.c
+ editmesh_utils.c
mesh_data.c
mesh_ops.c
meshtools.c
diff --git a/source/blender/editors/mesh/bmesh_selecthistory.c b/source/blender/editors/mesh/bmesh_selecthistory.c
deleted file mode 100644
index f0c00d0ff07..00000000000
--- a/source/blender/editors/mesh/bmesh_selecthistory.c
+++ /dev/null
@@ -1,69 +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.
- *
- * The Original Code is Copyright (C) 2004 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/* ********* Selection History ************ */
-
-#include "BKE_tessmesh.h"
-
-
-/* these wrap equivalent bmesh functions. I'm in two minds of it we should
- * just use the bm functions directly; on the one hand, there's no real
- * need (at the moment) to wrap them, but on the other hand having these
- * wrapped avoids a confusing mess of mixing BM_ and EDBM_ namespaces. */
-
-void EDBM_editselection_center(BMEditMesh *em, float *center, BMEditSelection *ese)
-{
- BM_editselection_center(em->bm, center, ese);
-}
-
-void EDBM_editselection_normal(float *normal, BMEditSelection *ese)
-{
- BM_editselection_normal(normal, 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.*/
-void EDBM_editselection_plane(BMEditMesh *em, float *plane, BMEditSelection *ese)
-{
- BM_editselection_plane(em->bm, plane, ese);
-}
-
-void EDBM_remove_selection(BMEditMesh *em, BMElem *ele)
-{
- BM_select_history_remove(em->bm, ele);
-}
-
-void EDBM_store_selection(BMEditMesh *em, BMElem *ele)
-{
- BM_select_history_store(em->bm, ele);
-}
-
-void EDBM_validate_selections(BMEditMesh *em)
-{
- BM_select_history_validate(em->bm);
-}
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index 58b5154cdff..d2446d1ad0e 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -27,8 +27,6 @@
* \ingroup edmesh
*/
-
-
#include <math.h>
#include <string.h>
@@ -77,7 +75,7 @@ void paintface_flush_flags(Object *ob)
int totface, totpoly;
int i;
- if(me==NULL || dm==NULL)
+ if (me == NULL || dm == NULL)
return;
/*
@@ -92,7 +90,7 @@ void paintface_flush_flags(Object *ob)
totface = me->totface;
/* loop over tessfaces */
- for (i= 0; i<totface; i++) {
+ for (i = 0; i < totface; i++) {
/* Copy flags onto the original tessface from its original poly */
mp_orig = me->mpoly + index_array[i];
faces[i].flag = mp_orig->flag;
@@ -104,7 +102,7 @@ void paintface_flush_flags(Object *ob)
totpoly = dm->getNumPolys(dm);
/* loop over final derived polys */
- for (i= 0; i<totpoly; i++) {
+ for (i = 0; i < totpoly; i++) {
/* Copy flags onto the final derived poly from the original mesh poly */
mp_orig = me->mpoly + index_array[i];
polys[i].flag = mp_orig->flag;
@@ -117,7 +115,7 @@ void paintface_flush_flags(Object *ob)
totface = dm->getNumTessFaces(dm);
/* loop over tessfaces */
- for (i= 0; i<totface; i++) {
+ for (i = 0; i < totface; i++) {
/* Copy flags onto the final tessface from its final poly */
mp_orig = polys + index_array[i];
faces[i].flag = mp_orig->flag;
@@ -132,29 +130,29 @@ static int facesel_face_pick(struct bContext *C, Mesh *me, Object *ob, const int
ViewContext vc;
view3d_set_viewcontext(C, &vc);
- if (!me || me->totpoly==0)
+ if (!me || me->totpoly == 0)
return 0;
makeDerivedMesh(scene, ob, NULL, CD_MASK_BAREMESH, 0);
- // XXX if (v3d->flag & V3D_INVALID_BACKBUF) {
+ // XXX if (v3d->flag & V3D_INVALID_BACKBUF) {
// XXX drawview.c! check_backbuf();
// XXX persp(PERSP_VIEW);
-// XXX }
+// XXX }
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);
+ *index = view3d_sample_backbuf_rect(&vc, mval, 3, 1, me->totpoly + 1, &dist, 0, NULL, NULL);
}
else {
/* sample only on the exact position */
*index = view3d_sample_backbuf(&vc, mval[0], mval[1]);
}
- if ((*index)<=0 || (*index)>(unsigned int)me->totpoly)
+ if ((*index) <= 0 || (*index) > (unsigned int)me->totpoly)
return 0;
(*index)--;
@@ -168,21 +166,21 @@ void paintface_hide(Object *ob, const int unselected)
MPoly *mface;
int a;
- me= get_mesh(ob);
- if(me==NULL || me->totpoly==0) return;
-
- mface= me->mpoly;
- a= me->totpoly;
- while(a--) {
- if((mface->flag & ME_HIDE) == 0) {
- if(unselected) {
- if( (mface->flag & ME_FACE_SEL)==0) mface->flag |= ME_HIDE;
+ me = get_mesh(ob);
+ if (me == NULL || me->totpoly == 0) return;
+
+ mface = me->mpoly;
+ a = me->totpoly;
+ while (a--) {
+ if ((mface->flag & ME_HIDE) == 0) {
+ if (unselected) {
+ if ( (mface->flag & ME_FACE_SEL) == 0) mface->flag |= ME_HIDE;
}
else {
- if( (mface->flag & ME_FACE_SEL)) mface->flag |= ME_HIDE;
+ if ( (mface->flag & ME_FACE_SEL)) mface->flag |= ME_HIDE;
}
}
- if(mface->flag & ME_HIDE) mface->flag &= ~ME_FACE_SEL;
+ if (mface->flag & ME_HIDE) mface->flag &= ~ME_FACE_SEL;
mface++;
}
@@ -197,13 +195,13 @@ void paintface_reveal(Object *ob)
MPoly *mface;
int a;
- me= get_mesh(ob);
- if(me==NULL || me->totpoly==0) return;
+ me = get_mesh(ob);
+ if (me == NULL || me->totpoly == 0) return;
- mface= me->mpoly;
- a= me->totpoly;
- while(a--) {
- if(mface->flag & ME_HIDE) {
+ mface = me->mpoly;
+ a = me->totpoly;
+ while (a--) {
+ if (mface->flag & ME_HIDE) {
mface->flag |= ME_FACE_SEL;
mface->flag -= ME_HIDE;
}
@@ -220,7 +218,7 @@ static void hash_add_face(EdgeHash *ehash, MPoly *mp, MLoop *mloop)
MLoop *ml;
int i;
- for (i=0, ml=mloop; i<mp->totloop; i++, ml++) {
+ for (i = 0, ml = mloop; i < mp->totloop; i++, ml++) {
BLI_edgehash_insert(ehash, ml->v, ME_POLY_LOOP_NEXT(mloop, mp, i)->v, NULL);
}
}
@@ -233,59 +231,59 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind
MLoop *ml;
MEdge *med;
char *linkflag;
- int a, b, doit=1, mark=0;
+ int a, b, doit = 1, mark = 0;
- ehash= BLI_edgehash_new();
+ ehash = BLI_edgehash_new();
seamhash = BLI_edgehash_new();
- linkflag= MEM_callocN(sizeof(char)*me->totpoly, "linkflaguv");
+ linkflag = MEM_callocN(sizeof(char) * me->totpoly, "linkflaguv");
- for(med=me->medge, a=0; a < me->totedge; a++, med++)
- if(med->flag & ME_SEAM)
+ for (med = me->medge, a = 0; a < me->totedge; a++, med++)
+ if (med->flag & ME_SEAM)
BLI_edgehash_insert(seamhash, med->v1, med->v2, NULL);
- if (mode==0 || mode==1) {
+ if (mode == 0 || mode == 1) {
/* only put face under cursor in array */
- mf= ((MPoly*)me->mpoly) + index;
+ mf = ((MPoly *)me->mpoly) + index;
hash_add_face(ehash, mf, me->mloop + mf->loopstart);
- linkflag[index]= 1;
+ linkflag[index] = 1;
}
else {
/* fill array by selection */
- mf= me->mpoly;
- for(a=0; a<me->totpoly; a++, mf++) {
- if(mf->flag & ME_HIDE);
- else if(mf->flag & ME_FACE_SEL) {
+ mf = me->mpoly;
+ for (a = 0; a < me->totpoly; a++, mf++) {
+ if (mf->flag & ME_HIDE) ;
+ else if (mf->flag & ME_FACE_SEL) {
hash_add_face(ehash, mf, me->mloop + mf->loopstart);
- linkflag[a]= 1;
+ linkflag[a] = 1;
}
}
}
- while(doit) {
- doit= 0;
+ while (doit) {
+ doit = 0;
/* expand selection */
- mf= me->mpoly;
- for(a=0; a<me->totpoly; a++, mf++) {
- if(mf->flag & ME_HIDE)
+ mf = me->mpoly;
+ for (a = 0; a < me->totpoly; a++, mf++) {
+ if (mf->flag & ME_HIDE)
continue;
- if(!linkflag[a]) {
+ if (!linkflag[a]) {
MLoop *mnextl;
- mark= 0;
+ mark = 0;
ml = me->mloop + mf->loopstart;
- for (b=0; b<mf->totloop; b++, ml++) {
- mnextl = b < mf->totloop-1 ? ml - 1 : me->mloop + mf->loopstart;
+ for (b = 0; b < mf->totloop; b++, ml++) {
+ mnextl = b < mf->totloop - 1 ? ml - 1 : me->mloop + mf->loopstart;
if (!BLI_edgehash_haskey(seamhash, ml->v, mnextl->v))
if (!BLI_edgehash_haskey(ehash, ml->v, mnextl->v))
mark = 1;
}
- if(mark) {
- linkflag[a]= 1;
+ if (mark) {
+ linkflag[a] = 1;
hash_add_face(ehash, mf, me->mloop + mf->loopstart);
- doit= 1;
+ doit = 1;
}
}
}
@@ -295,26 +293,26 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind
BLI_edgehash_free(ehash, NULL);
BLI_edgehash_free(seamhash, NULL);
- if(mode==0 || mode==2) {
- for(a=0, mf=me->mpoly; a<me->totpoly; a++, mf++)
- if(linkflag[a])
+ if (mode == 0 || mode == 2) {
+ for (a = 0, mf = me->mpoly; a < me->totpoly; a++, mf++)
+ if (linkflag[a])
mf->flag |= ME_FACE_SEL;
else
mf->flag &= ~ME_FACE_SEL;
}
- else if(mode==1) {
- for(a=0, mf=me->mpoly; a<me->totpoly; a++, mf++)
- if(linkflag[a] && (mf->flag & ME_FACE_SEL))
+ else if (mode == 1) {
+ for (a = 0, mf = me->mpoly; a < me->totpoly; a++, mf++)
+ if (linkflag[a] && (mf->flag & ME_FACE_SEL))
break;
- if (a<me->totpoly) {
- for(a=0, mf=me->mpoly; a<me->totpoly; a++, mf++)
- if(linkflag[a])
+ if (a < me->totpoly) {
+ for (a = 0, mf = me->mpoly; a < me->totpoly; a++, mf++)
+ if (linkflag[a])
mf->flag &= ~ME_FACE_SEL;
}
else {
- for(a=0, mf=me->mpoly; a<me->totpoly; a++, mf++)
- if(linkflag[a])
+ for (a = 0, mf = me->mpoly; a < me->totpoly; a++, mf++)
+ if (linkflag[a])
mf->flag |= ME_FACE_SEL;
}
}
@@ -325,17 +323,17 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind
void paintface_select_linked(bContext *UNUSED(C), Object *ob, int UNUSED(mval[2]), int mode)
{
Mesh *me;
- unsigned int index=0;
+ unsigned int index = 0;
me = get_mesh(ob);
- if(me==NULL || me->totpoly==0) return;
+ if (me == NULL || me->totpoly == 0) return;
- if (mode==0 || mode==1) {
+ 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);
@@ -349,14 +347,14 @@ void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
MPoly *mface;
int a;
- me= get_mesh(ob);
- if(me==NULL) return;
+ me = get_mesh(ob);
+ if (me == NULL) return;
- if(action == SEL_INVERT) {
- mface= me->mpoly;
- a= me->totpoly;
- while(a--) {
- if((mface->flag & ME_HIDE) == 0) {
+ if (action == SEL_INVERT) {
+ mface = me->mpoly;
+ a = me->totpoly;
+ while (a--) {
+ if ((mface->flag & ME_HIDE) == 0) {
mface->flag ^= ME_FACE_SEL;
}
mface++;
@@ -366,10 +364,10 @@ void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
if (action == SEL_TOGGLE) {
action = SEL_SELECT;
- mface= me->mpoly;
- a= me->totpoly;
- while(a--) {
- if((mface->flag & ME_HIDE) == 0 && mface->flag & ME_FACE_SEL) {
+ mface = me->mpoly;
+ a = me->totpoly;
+ while (a--) {
+ if ((mface->flag & ME_HIDE) == 0 && mface->flag & ME_FACE_SEL) {
action = SEL_DESELECT;
break;
}
@@ -377,27 +375,27 @@ void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
}
}
- mface= me->mpoly;
- a= me->totpoly;
- while(a--) {
- if((mface->flag & ME_HIDE) == 0) {
+ mface = me->mpoly;
+ a = me->totpoly;
+ while (a--) {
+ if ((mface->flag & ME_HIDE) == 0) {
switch (action) {
- case SEL_SELECT:
- mface->flag |= ME_FACE_SEL;
- break;
- case SEL_DESELECT:
- mface->flag &= ~ME_FACE_SEL;
- break;
- case SEL_INVERT:
- mface->flag ^= ME_FACE_SEL;
- break;
+ case SEL_SELECT:
+ mface->flag |= ME_FACE_SEL;
+ break;
+ case SEL_DESELECT:
+ mface->flag &= ~ME_FACE_SEL;
+ break;
+ case SEL_INVERT:
+ mface->flag ^= ME_FACE_SEL;
+ break;
}
}
mface++;
}
}
- if(flush_flags) {
+ if (flush_flags) {
paintface_flush_flags(ob);
}
}
@@ -409,30 +407,30 @@ int paintface_minmax(Object *ob, float *min, float *max)
MTexPoly *tf;
MLoop *ml;
MVert *mvert;
- int a, b, ok=0;
+ int a, b, ok = 0;
float vec[3], bmat[3][3];
- me= get_mesh(ob);
- if(!me || !me->mtpoly) return ok;
+ me = get_mesh(ob);
+ if (!me || !me->mtpoly) return ok;
copy_m3_m4(bmat, ob->obmat);
- mvert= me->mvert;
- mf= me->mpoly;
- tf= me->mtpoly;
- for (a=me->totpoly; a>0; a--, mf++, tf++) {
+ mvert = me->mvert;
+ mf = me->mpoly;
+ tf = me->mtpoly;
+ for (a = me->totpoly; a > 0; a--, mf++, tf++) {
if (mf->flag & ME_HIDE || !(mf->flag & ME_FACE_SEL))
continue;
ml = me->mloop + mf->totloop;
- for (b=0; b<mf->totloop; b++, ml++) {
+ for (b = 0; b < mf->totloop; b++, ml++) {
copy_v3_v3(vec, (mvert[ml->v].co));
mul_m3_v3(bmat, vec);
add_v3_v3v3(vec, vec, ob->obmat[3]);
DO_MINMAX(vec, min, max);
}
- ok= 1;
+ ok = 1;
}
return ok;
@@ -445,9 +443,9 @@ static void seam_edgehash_insert_face(EdgeHash *ehash, MPoly *mf, MLoop *loopsta
MLoop *ml1, *ml2;
int a;
- for (a=0; a<mf->totloop; a++) {
+ for (a = 0; a < mf->totloop; a++) {
ml1 = loopstart + a;
- ml2 = loopstart + (a+1) % mf->totloop;
+ ml2 = loopstart + (a + 1) % mf->totloop;
BLI_edgehash_insert(ehash, ml1->v, ml2->v, NULL);
}
@@ -461,8 +459,8 @@ void seam_mark_clear_tface(Scene *scene, short mode)
MEdge *med;
int a, b;
- me= get_mesh(OBACT);
- if(me==0 || me->totpoly==0) return;
+ me = get_mesh(OBACT);
+ if (me == 0 || me->totpoly == 0) return;
if (mode == 0)
mode = pupmenu("Seams%t|Mark Border Seam %x1|Clear Seam %x2");
@@ -473,11 +471,11 @@ void seam_mark_clear_tface(Scene *scene, short mode)
if (mode == 2) {
EdgeHash *ehash = BLI_edgehash_new();
- for (a=0, mf=me->mpoly; a<me->totpoly; a++, mf++)
+ for (a = 0, mf = me->mpoly; a < me->totpoly; a++, mf++)
if (!(mf->flag & ME_HIDE) && (mf->flag & ME_FACE_SEL))
seam_edgehash_insert_face(ehash, mf, me->mloop + mf->loopstart);
- for (a=0, med=me->medge; a<me->totedge; a++, med++)
+ for (a = 0, med = me->medge; a < me->totedge; a++, med++)
if (BLI_edgehash_haskey(ehash, med->v1, med->v2))
med->flag &= ~ME_SEAM;
@@ -488,16 +486,16 @@ void seam_mark_clear_tface(Scene *scene, short mode)
EdgeHash *ehash1 = BLI_edgehash_new();
EdgeHash *ehash2 = BLI_edgehash_new();
- for (a=0, mf=me->mpoly; a<me->totpoly; a++, mf++) {
+ for (a = 0, mf = me->mpoly; a < me->totpoly; a++, mf++) {
if ((mf->flag & ME_HIDE) || !(mf->flag & ME_FACE_SEL))
seam_edgehash_insert_face(ehash1, mf, me->mloop + mf->loopstart);
else
seam_edgehash_insert_face(ehash2, mf, me->mloop + mf->loopstart);
}
- for (a=0, med=me->medge; a<me->totedge; a++, med++)
+ for (a = 0, med = me->medge; a < me->totedge; a++, med++)
if (BLI_edgehash_haskey(ehash1, med->v1, med->v2) &&
- BLI_edgehash_haskey(ehash2, med->v1, med->v2))
+ BLI_edgehash_haskey(ehash2, med->v1, med->v2))
med->flag |= ME_SEAM;
BLI_edgehash_free(ehash1, NULL);
@@ -526,7 +524,7 @@ int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], in
if (index >= me->totpoly || index < 0)
return 0;
- msel= me->mpoly + index;
+ msel = me->mpoly + index;
if (msel->flag & ME_HIDE) return 0;
/* clear flags */
@@ -552,7 +550,7 @@ int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], in
/* image window redraw */
paintface_flush_flags(ob);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, ob->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data);
ED_region_tag_redraw(CTX_wm_region(C)); // XXX - should redraw all 3D views
return 1;
}
@@ -566,49 +564,48 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend)
unsigned int *rt;
char *selar;
int a, index;
- int sx= rect->xmax-rect->xmin+1;
- int sy= rect->ymax-rect->ymin+1;
+ int sx = rect->xmax - rect->xmin + 1;
+ int sy = rect->ymax - rect->ymin + 1;
- me= get_mesh(ob);
+ me = get_mesh(ob);
- if(me==NULL || me->totpoly==0 || sx*sy <= 0)
+ if (me == NULL || me->totpoly == 0 || sx * sy <= 0)
return OPERATOR_CANCELLED;
- selar= MEM_callocN(me->totpoly+1, "selar");
+ 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)
+ mface = me->mpoly;
+ for (a = 1; a <= me->totpoly; a++, mface++) {
+ if ((mface->flag & ME_HIDE) == 0)
mface->flag &= ~ME_FACE_SEL;
}
}
view3d_validate_backbuf(vc);
- ibuf = IMB_allocImBuf(sx,sy,32,IB_rect);
+ ibuf = IMB_allocImBuf(sx, sy, 32, IB_rect);
rt = ibuf->rect;
- glReadPixels(rect->xmin+vc->ar->winrct.xmin, rect->ymin+vc->ar->winrct.ymin, sx, sy, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
- if(ENDIAN_ORDER==B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf);
+ glReadPixels(rect->xmin + vc->ar->winrct.xmin, rect->ymin + vc->ar->winrct.ymin, sx, sy, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
+ if (ENDIAN_ORDER == B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf);
- a= sx*sy;
- while(a--) {
- if(*rt) {
- index= WM_framebuffer_to_index(*rt);
- if(index<=me->totpoly) selar[index]= 1;
+ a = sx * sy;
+ while (a--) {
+ if (*rt) {
+ index = WM_framebuffer_to_index(*rt);
+ if (index <= me->totpoly) selar[index] = 1;
}
rt++;
}
- mface= me->mpoly;
- for(a=1; a<=me->totpoly; a++, mface++) {
- if(selar[a]) {
- if(mface->flag & ME_HIDE);
+ mface = me->mpoly;
+ for (a = 1; a <= me->totpoly; a++, mface++) {
+ if (selar[a]) {
+ if (mface->flag & ME_HIDE) ;
else {
- if(select) mface->flag |= ME_FACE_SEL;
+ if (select) mface->flag |= ME_FACE_SEL;
else mface->flag &= ~ME_FACE_SEL;
}
}
@@ -632,14 +629,14 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend)
* use in object mode when selecting vertices (while painting) */
void paintvert_flush_flags(Object *ob)
{
- Mesh *me= get_mesh(ob);
- DerivedMesh *dm= ob->derivedFinal;
+ Mesh *me = get_mesh(ob);
+ DerivedMesh *dm = ob->derivedFinal;
MVert *dm_mvert, *dm_mv;
int *index_array = NULL;
int totvert;
int i;
- if(me==NULL || dm==NULL)
+ if (me == NULL || dm == NULL)
return;
index_array = dm->getVertDataArray(dm, CD_ORIGINDEX);
@@ -647,20 +644,20 @@ void paintvert_flush_flags(Object *ob)
dm_mvert = dm->getVertArray(dm);
totvert = dm->getNumVerts(dm);
- dm_mv= dm_mvert;
+ dm_mv = dm_mvert;
- if(index_array) {
+ if (index_array) {
int orig_index;
- for (i= 0; i<totvert; i++, dm_mv++) {
- orig_index= index_array[i];
- if(orig_index != ORIGINDEX_NONE) {
- dm_mv->flag= me->mvert[index_array[i]].flag;
+ for (i = 0; i < totvert; i++, dm_mv++) {
+ orig_index = index_array[i];
+ if (orig_index != ORIGINDEX_NONE) {
+ dm_mv->flag = me->mvert[index_array[i]].flag;
}
}
}
else {
- for (i= 0; i<totvert; i++, dm_mv++) {
- dm_mv->flag= me->mvert[i].flag;
+ for (i = 0; i < totvert; i++, dm_mv++) {
+ dm_mv->flag = me->mvert[i].flag;
}
}
}
@@ -671,14 +668,14 @@ void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags)
MVert *mvert;
int a;
- me= get_mesh(ob);
- if(me==NULL) return;
+ me = get_mesh(ob);
+ if (me == NULL) return;
- if(action == SEL_INVERT) {
- mvert= me->mvert;
- a= me->totvert;
- while(a--) {
- if((mvert->flag & ME_HIDE) == 0) {
+ if (action == SEL_INVERT) {
+ mvert = me->mvert;
+ a = me->totvert;
+ while (a--) {
+ if ((mvert->flag & ME_HIDE) == 0) {
mvert->flag ^= SELECT;
}
mvert++;
@@ -688,10 +685,10 @@ void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags)
if (action == SEL_TOGGLE) {
action = SEL_SELECT;
- mvert= me->mvert;
- a= me->totvert;
- while(a--) {
- if((mvert->flag & ME_HIDE) == 0 && mvert->flag & SELECT) {
+ mvert = me->mvert;
+ a = me->totvert;
+ while (a--) {
+ if ((mvert->flag & ME_HIDE) == 0 && mvert->flag & SELECT) {
action = SEL_DESELECT;
break;
}
@@ -699,27 +696,27 @@ void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags)
}
}
- mvert= me->mvert;
- a= me->totvert;
- while(a--) {
- if((mvert->flag & ME_HIDE) == 0) {
+ mvert = me->mvert;
+ a = me->totvert;
+ while (a--) {
+ if ((mvert->flag & ME_HIDE) == 0) {
switch (action) {
- case SEL_SELECT:
- mvert->flag |= SELECT;
- break;
- case SEL_DESELECT:
- mvert->flag &= ~SELECT;
- break;
- case SEL_INVERT:
- mvert->flag ^= SELECT;
- break;
+ case SEL_SELECT:
+ mvert->flag |= SELECT;
+ break;
+ case SEL_DESELECT:
+ mvert->flag &= ~SELECT;
+ break;
+ case SEL_INVERT:
+ mvert->flag ^= SELECT;
+ break;
}
}
mvert++;
}
}
- if(flush_flags) {
+ if (flush_flags) {
paintvert_flush_flags(ob);
}
}
@@ -732,21 +729,21 @@ void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags)
typedef int MirrTopoHash_t;
typedef struct MirrTopoVert_t {
- MirrTopoHash_t hash;
- int v_index;
+ MirrTopoHash_t hash;
+ int v_index;
} MirrTopoVert_t;
static int mirrtopo_hash_sort(const void *l1, const void *l2)
{
- if ((MirrTopoHash_t)(intptr_t)l1 > (MirrTopoHash_t)(intptr_t)l2 ) return 1;
- else if ((MirrTopoHash_t)(intptr_t)l1 < (MirrTopoHash_t)(intptr_t)l2 ) return -1;
+ if ((MirrTopoHash_t)(intptr_t)l1 > (MirrTopoHash_t)(intptr_t)l2) return 1;
+ else if ((MirrTopoHash_t)(intptr_t)l1 < (MirrTopoHash_t)(intptr_t)l2) return -1;
return 0;
}
static int mirrtopo_vert_sort(const void *v1, const void *v2)
{
- if (((MirrTopoVert_t *)v1)->hash > ((MirrTopoVert_t *)v2)->hash ) return 1;
- else if (((MirrTopoVert_t *)v1)->hash < ((MirrTopoVert_t *)v2)->hash ) return -1;
+ if (((MirrTopoVert_t *)v1)->hash > ((MirrTopoVert_t *)v2)->hash) return 1;
+ else if (((MirrTopoVert_t *)v1)->hash < ((MirrTopoVert_t *)v2)->hash) return -1;
return 0;
}
@@ -764,10 +761,10 @@ int ED_mesh_mirrtopo_recalc_check(Mesh *me, const int ob_mode, MirrTopoStore_t *
totedge = me->totedge;
}
- if( (mesh_topo_store->index_lookup==NULL) ||
- (mesh_topo_store->prev_ob_mode != ob_mode) ||
- (totvert != mesh_topo_store->prev_vert_tot) ||
- (totedge != mesh_topo_store->prev_edge_tot))
+ if ((mesh_topo_store->index_lookup == NULL) ||
+ (mesh_topo_store->prev_ob_mode != ob_mode) ||
+ (totvert != mesh_topo_store->prev_vert_tot) ||
+ (totedge != mesh_topo_store->prev_edge_tot))
{
return TRUE;
}
@@ -802,7 +799,7 @@ void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_to
mesh_topo_store->prev_ob_mode = ob_mode;
- if(em) {
+ if (em) {
BM_mesh_elem_index_ensure(em->bm, BM_VERT);
totvert = em->bm->totvert;
@@ -814,7 +811,7 @@ void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_to
topo_hash = MEM_callocN(totvert * sizeof(MirrTopoHash_t), "TopoMirr");
/* Initialize the vert-edge-user counts used to detect unique topology */
- if(em) {
+ if (em) {
totedge = me->edit_btmesh->bm->totedge;
BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
@@ -825,7 +822,7 @@ void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_to
else {
totedge = me->totedge;
- for(a=0, medge=me->medge; a < me->totedge; a++, medge++) {
+ for (a = 0, medge = me->medge; a < me->totedge; a++, medge++) {
topo_hash[medge->v1]++;
topo_hash[medge->v2]++;
}
@@ -834,17 +831,17 @@ void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_to
topo_hash_prev = MEM_dupallocN(topo_hash);
tot_unique_prev = -1;
- while(1) {
+ while (1) {
/* use the number of edges per vert to give verts unique topology IDs */
- if(em) {
+ if (em) {
BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
topo_hash[BM_elem_index_get(eed->v1)] += topo_hash_prev[BM_elem_index_get(eed->v2)];
topo_hash[BM_elem_index_get(eed->v2)] += topo_hash_prev[BM_elem_index_get(eed->v1)];
}
}
else {
- for(a=0, medge=me->medge; a<me->totedge; a++, medge++) {
+ for (a = 0, medge = me->medge; a < me->totedge; a++, medge++) {
/* This can make really big numbers, wrapping around here is fine */
topo_hash[medge->v1] += topo_hash_prev[medge->v2];
topo_hash[medge->v2] += topo_hash_prev[medge->v1];
@@ -856,8 +853,8 @@ void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_to
qsort(topo_hash_prev, totvert, sizeof(MirrTopoHash_t), mirrtopo_hash_sort);
tot_unique = 1; /* account for skiping the first value */
- for(a=1; a<totvert; a++) {
- if (topo_hash_prev[a-1] != topo_hash_prev[a]) {
+ for (a = 1; a < totvert; a++) {
+ if (topo_hash_prev[a - 1] != topo_hash_prev[a]) {
tot_unique++;
}
}
@@ -875,19 +872,19 @@ void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_to
}
/* Hash/Index pairs are needed for sorting to find index pairs */
- topo_pairs = MEM_callocN( sizeof(MirrTopoVert_t) * totvert, "MirrTopoPairs");
+ topo_pairs = MEM_callocN(sizeof(MirrTopoVert_t) * totvert, "MirrTopoPairs");
/* since we are looping through verts, initialize these values here too */
index_lookup = MEM_mallocN(totvert * sizeof(*index_lookup), "mesh_topo_lookup");
- if(em) {
+ if (em) {
if (skip_em_vert_array_init == FALSE) {
- EDBM_init_index_arrays(em,1, 0, 0);
+ EDBM_index_arrays_init(em, 1, 0, 0);
}
}
- for(a=0; a<totvert; a++) {
+ for (a = 0; a < totvert; a++) {
topo_pairs[a].hash = topo_hash[a];
topo_pairs[a].v_index = a;
@@ -902,25 +899,25 @@ void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_to
/* Get the pairs out of the sorted hashes, note, totvert+1 means we can use the previous 2,
* but you cant ever access the last 'a' index of MirrTopoPairs */
- for(a=2; a <= totvert; a++) {
+ for (a = 2; a <= totvert; a++) {
/* printf("I %d %ld %d\n", (a-last), MirrTopoPairs[a ].hash, MirrTopoPairs[a ].v_index ); */
- if ((a==totvert) || (topo_pairs[a-1].hash != topo_pairs[a].hash)) {
- if (a-last==2) {
- if(em) {
- index_lookup[topo_pairs[a-1].v_index] = (intptr_t)EDBM_get_vert_for_index(em, topo_pairs[a-2].v_index);
- index_lookup[topo_pairs[a-2].v_index] = (intptr_t)EDBM_get_vert_for_index(em, topo_pairs[a-1].v_index);
+ if ((a == totvert) || (topo_pairs[a - 1].hash != topo_pairs[a].hash)) {
+ if (a - last == 2) {
+ if (em) {
+ index_lookup[topo_pairs[a - 1].v_index] = (intptr_t)EDBM_vert_at_index(em, topo_pairs[a - 2].v_index);
+ index_lookup[topo_pairs[a - 2].v_index] = (intptr_t)EDBM_vert_at_index(em, topo_pairs[a - 1].v_index);
}
else {
- index_lookup[topo_pairs[a-1].v_index] = topo_pairs[a-2].v_index;
- index_lookup[topo_pairs[a-2].v_index] = topo_pairs[a-1].v_index;
+ index_lookup[topo_pairs[a - 1].v_index] = topo_pairs[a - 2].v_index;
+ index_lookup[topo_pairs[a - 2].v_index] = topo_pairs[a - 1].v_index;
}
}
last = a;
}
}
- if(em) {
+ if (em) {
if (skip_em_vert_array_init == FALSE) {
- EDBM_free_index_arrays(em);
+ EDBM_index_arrays_free(em);
}
}
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c
index f13f15a2cc3..c2a97b3ea70 100644
--- a/source/blender/editors/mesh/editmesh_add.c
+++ b/source/blender/editors/mesh/editmesh_add.c
@@ -51,11 +51,13 @@
#include "ED_screen.h"
#include "ED_object.h"
+#include "mesh_intern.h"
+
/* uses context to figure out transform for primitive */
/* returns standard diameter */
static float new_primitive_matrix(bContext *C, float *loc, float *rot, float primmat[][4])
{
- Object *obedit= CTX_data_edit_object(C);
+ Object *obedit = CTX_data_edit_object(C);
View3D *v3d = CTX_wm_view3d(C);
float mat[3][3], rmat[3][3], cmat[3][3], imat[3][3];
@@ -85,46 +87,39 @@ static void make_prim_init(bContext *C, const char *idname,
float *dia, float mat[][4],
int *state, float *loc, float *rot, unsigned int layer)
{
- Object *obedit= CTX_data_edit_object(C);
+ Object *obedit = CTX_data_edit_object(C);
*state = 0;
- if(obedit==NULL || obedit->type!=OB_MESH) {
- obedit= ED_object_add_type(C, OB_MESH, loc, rot, FALSE, layer);
+ if (obedit == NULL || obedit->type != OB_MESH) {
+ obedit = ED_object_add_type(C, OB_MESH, loc, rot, FALSE, layer);
rename_id((ID *)obedit, idname);
rename_id((ID *)obedit->data, idname);
/* create editmode */
- ED_object_enter_editmode(C, EM_DO_UNDO|EM_IGNORE_LAYER); /* rare cases the active layer is messed up */
+ ED_object_enter_editmode(C, EM_DO_UNDO | EM_IGNORE_LAYER); /* rare cases the active layer is messed up */
*state = 1;
}
- else DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
- *dia *= new_primitive_matrix(C, loc, rot, mat);
+ *dia = new_primitive_matrix(C, loc, rot, mat);
}
static void make_prim_finish(bContext *C, int *state, int enter_editmode)
{
- Object *obedit;
- Mesh *me;
- BMEditMesh *em;
-
- obedit = CTX_data_edit_object(C);
- me = obedit->data;
- em = me->edit_btmesh;
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
/* Primitive has all verts selected, use vert select flush
* to push this up to edges & faces. */
EDBM_selectmode_flush_ex(em, SCE_SELECT_VERTEX);
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
/* userdef */
if (*state && !enter_editmode) {
ED_object_exit_editmode(C, EM_FREEDATA); /* adding EM_DO_UNDO messes up operator redo */
}
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit);
+ WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, obedit);
}
static int add_primitive_plane_exec(bContext *C, wmOperator *op)
@@ -132,7 +127,7 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op)
Object *obedit;
Mesh *me;
BMEditMesh *em;
- float loc[3], rot[3], mat[4][4], dia = 1.0f;
+ float loc[3], rot[3], mat[4][4], dia;
int enter_editmode;
int state;
unsigned int layer;
@@ -144,31 +139,31 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op)
me = obedit->data;
em = me->edit_btmesh;
- if (!EDBM_CallAndSelectOpf(em, op, "vertout",
- "create_grid xsegments=%i ysegments=%i size=%f mat=%m4", 1, 1, dia, mat))
+ if (!EDBM_op_call_and_selectf(em, op, "vertout",
+ "create_grid xsegments=%i ysegments=%i size=%f mat=%m4", 1, 1, dia, mat))
{
return OPERATOR_CANCELLED;
}
make_prim_finish(C, &state, enter_editmode);
- return OPERATOR_FINISHED;
+ return OPERATOR_FINISHED;
}
void MESH_OT_primitive_plane_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Plane";
- ot->description= "Construct a filled planar mesh with 4 vertices";
- ot->idname= "MESH_OT_primitive_plane_add";
+ ot->name = "Add Plane";
+ ot->description = "Construct a filled planar mesh with 4 vertices";
+ ot->idname = "MESH_OT_primitive_plane_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_plane_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_plane_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -186,11 +181,11 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op)
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
make_prim_init(C, "Cube", &dia, mat, &state, loc, rot, layer);
- obedit= CTX_data_edit_object(C);
+ obedit = CTX_data_edit_object(C);
me = obedit->data;
em = me->edit_btmesh;
- if (!EDBM_CallAndSelectOpf(em, op, "vertout", "create_cube mat=%m4 size=%f", mat, 2.0f)) {
+ if (!EDBM_op_call_and_selectf(em, op, "vertout", "create_cube mat=%m4 size=%f", mat, dia * 2.0f)) {
return OPERATOR_CANCELLED;
}
@@ -203,22 +198,22 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op)
void MESH_OT_primitive_cube_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Cube";
- ot->description= "Construct a cube mesh";
- ot->idname= "MESH_OT_primitive_cube_add";
+ ot->name = "Add Cube";
+ ot->description = "Construct a cube mesh";
+ ot->idname = "MESH_OT_primitive_cube_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_cube_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_cube_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
-static const EnumPropertyItem fill_type_items[]= {
+static const EnumPropertyItem fill_type_items[] = {
{0, "NOTHING", 0, "Nothing", "Don't fill at all"},
{1, "NGON", 0, "Ngon", "Use ngons"},
{2, "TRIFAN", 0, "Triangle Fan", "Use triangle fans"},
@@ -235,7 +230,7 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op)
unsigned int layer;
cap_end = RNA_enum_get(op->ptr, "fill_type");
- cap_tri = cap_end==2;
+ cap_tri = (cap_end == 2);
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
make_prim_init(C, "Circle", &dia, mat, &state, loc, rot, layer);
@@ -244,10 +239,10 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op)
me = obedit->data;
em = me->edit_btmesh;
- if (!EDBM_CallAndSelectOpf(em, op, "vertout",
- "create_circle segments=%i diameter=%f cap_ends=%b cap_tris=%b mat=%m4",
- RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius"),
- cap_end, cap_tri, mat))
+ if (!EDBM_op_call_and_selectf(em, op, "vertout",
+ "create_circle segments=%i diameter=%f cap_ends=%b cap_tris=%b mat=%m4",
+ RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius"),
+ cap_end, cap_tri, mat))
{
return OPERATOR_CANCELLED;
}
@@ -262,17 +257,17 @@ void MESH_OT_primitive_circle_add(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Add Circle";
- ot->description= "Construct a circle mesh";
- ot->idname= "MESH_OT_primitive_circle_add";
+ ot->name = "Add Circle";
+ ot->description = "Construct a circle mesh";
+ ot->idname = "MESH_OT_primitive_circle_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_circle_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_circle_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_int(ot->srna, "vertices", 32, 3, INT_MAX, "Vertices", "", 3, 500);
@@ -294,7 +289,7 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
unsigned int layer;
cap_end = RNA_enum_get(op->ptr, "end_fill_type");
- cap_tri = cap_end==2;
+ cap_tri = (cap_end == 2);
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
make_prim_init(C, "Cylinder", &dia, mat, &state, loc, rot, layer);
@@ -303,7 +298,7 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
me = obedit->data;
em = me->edit_btmesh;
- if (!EDBM_CallAndSelectOpf(
+ if (!EDBM_op_call_and_selectf(
em, op, "vertout",
"create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%b cap_tris=%b depth=%f mat=%m4",
RNA_int_get(op->ptr, "vertices"),
@@ -325,20 +320,20 @@ void MESH_OT_primitive_cylinder_add(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Add Cylinder";
- ot->description= "Construct a cylinder mesh";
- ot->idname= "MESH_OT_primitive_cylinder_add";
+ ot->name = "Add Cylinder";
+ ot->description = "Construct a cylinder mesh";
+ ot->idname = "MESH_OT_primitive_cylinder_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_cylinder_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_cylinder_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
- RNA_def_int(ot->srna, "vertices", 32, 2, INT_MAX, "Vertices", "", 2, 500);
+ RNA_def_int(ot->srna, "vertices", 32, 3, INT_MAX, "Vertices", "", 3, 500);
prop = RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
RNA_def_property_subtype(prop, PROP_DISTANCE);
prop = RNA_def_float(ot->srna, "depth", 2.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00);
@@ -359,7 +354,7 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op)
unsigned int layer;
cap_end = RNA_enum_get(op->ptr, "end_fill_type");
- cap_tri = cap_end==2;
+ cap_tri = (cap_end == 2);
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
make_prim_init(C, "Cone", &dia, mat, &state, loc, rot, layer);
@@ -368,7 +363,7 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op)
me = obedit->data;
em = me->edit_btmesh;
- if (!EDBM_CallAndSelectOpf(
+ if (!EDBM_op_call_and_selectf(
em, op, "vertout",
"create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%b cap_tris=%b depth=%f mat=%m4",
RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius1"),
@@ -379,7 +374,7 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op)
make_prim_finish(C, &state, enter_editmode);
- return OPERATOR_FINISHED;
+ return OPERATOR_FINISHED;
}
void MESH_OT_primitive_cone_add(wmOperatorType *ot)
@@ -387,20 +382,20 @@ void MESH_OT_primitive_cone_add(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Add Cone";
- ot->description= "Construct a conic mesh (ends filled)";
- ot->idname= "MESH_OT_primitive_cone_add";
+ ot->name = "Add Cone";
+ ot->description = "Construct a conic mesh";
+ ot->idname = "MESH_OT_primitive_cone_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_cone_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_cone_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
- RNA_def_int(ot->srna, "vertices", 32, 2, INT_MAX, "Vertices", "", 2, 500);
+ RNA_def_int(ot->srna, "vertices", 32, 3, INT_MAX, "Vertices", "", 3, 500);
prop = RNA_def_float(ot->srna, "radius1", 1.0f, 0.0, FLT_MAX, "Radius 1", "", 0.001, 100.00);
RNA_def_property_subtype(prop, PROP_DISTANCE);
prop = RNA_def_float(ot->srna, "radius2", 0.0f, 0.0, FLT_MAX, "Radius 2", "", 0.001, 100.00);
@@ -417,7 +412,7 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op)
Object *obedit;
Mesh *me;
BMEditMesh *em;
- float loc[3], rot[3], mat[4][4], dia = 1.0f;
+ float loc[3], rot[3], mat[4][4], dia;
int enter_editmode;
int state;
unsigned int layer;
@@ -429,11 +424,11 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op)
me = obedit->data;
em = me->edit_btmesh;
- if (!EDBM_CallAndSelectOpf(em, op, "vertout",
- "create_grid xsegments=%i ysegments=%i size=%f mat=%m4",
- RNA_int_get(op->ptr, "x_subdivisions"),
- RNA_int_get(op->ptr, "y_subdivisions"),
- RNA_float_get(op->ptr, "size") * dia, mat))
+ if (!EDBM_op_call_and_selectf(em, op, "vertout",
+ "create_grid xsegments=%i ysegments=%i size=%f mat=%m4",
+ RNA_int_get(op->ptr, "x_subdivisions"),
+ RNA_int_get(op->ptr, "y_subdivisions"),
+ RNA_float_get(op->ptr, "size") * dia, mat))
{
return OPERATOR_CANCELLED;
}
@@ -447,17 +442,17 @@ void MESH_OT_primitive_grid_add(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Add Grid";
- ot->description= "Construct a grid mesh";
- ot->idname= "MESH_OT_primitive_grid_add";
+ ot->name = "Add Grid";
+ ot->description = "Construct a grid mesh";
+ ot->idname = "MESH_OT_primitive_grid_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_grid_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_grid_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_int(ot->srna, "x_subdivisions", 10, 3, INT_MAX, "X Subdivisions", "", 3, 1000);
@@ -480,7 +475,7 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op)
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, &view_aligned);
if (!view_aligned)
- rot[0] += M_PI/2.0f;
+ rot[0] += M_PI / 2.0f;
make_prim_init(C, "Monkey", &dia, mat, &state, loc, rot, layer);
@@ -488,7 +483,7 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op)
me = obedit->data;
em = me->edit_btmesh;
- if (!EDBM_CallAndSelectOpf(em, op, "vertout", "create_monkey mat=%m4", mat)) {
+ if (!EDBM_op_call_and_selectf(em, op, "vertout", "create_monkey mat=%m4", mat)) {
return OPERATOR_CANCELLED;
}
@@ -499,17 +494,17 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op)
void MESH_OT_primitive_monkey_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Monkey";
- ot->description= "Construct a Suzanne mesh";
- ot->idname= "MESH_OT_primitive_monkey_add";
+ ot->name = "Add Monkey";
+ ot->description = "Construct a Suzanne mesh";
+ ot->idname = "MESH_OT_primitive_monkey_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_monkey_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_monkey_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -531,10 +526,10 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op)
me = obedit->data;
em = me->edit_btmesh;
- if (!EDBM_CallAndSelectOpf(em, op, "vertout",
- "create_uvsphere segments=%i revolutions=%i diameter=%f mat=%m4",
- RNA_int_get(op->ptr, "segments"), RNA_int_get(op->ptr, "ring_count"),
- RNA_float_get(op->ptr,"size"), mat))
+ if (!EDBM_op_call_and_selectf(em, op, "vertout",
+ "create_uvsphere segments=%i revolutions=%i diameter=%f mat=%m4",
+ RNA_int_get(op->ptr, "segments"), RNA_int_get(op->ptr, "ring_count"),
+ RNA_float_get(op->ptr, "size"), mat))
{
return OPERATOR_CANCELLED;
}
@@ -549,17 +544,17 @@ void MESH_OT_primitive_uv_sphere_add(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Add UV Sphere";
- ot->description= "Construct a UV sphere mesh";
- ot->idname= "MESH_OT_primitive_uv_sphere_add";
+ ot->name = "Add UV Sphere";
+ ot->description = "Construct a UV sphere mesh";
+ ot->idname = "MESH_OT_primitive_uv_sphere_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_uvsphere_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_uvsphere_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_int(ot->srna, "segments", 32, 3, INT_MAX, "Segments", "", 3, 500);
@@ -587,7 +582,7 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op)
me = obedit->data;
em = me->edit_btmesh;
- if (!EDBM_CallAndSelectOpf(
+ if (!EDBM_op_call_and_selectf(
em, op, "vertout",
"create_icosphere subdivisions=%i diameter=%f mat=%m4",
RNA_int_get(op->ptr, "subdivisions"),
@@ -606,17 +601,17 @@ void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Add Ico Sphere";
- ot->description= "Construct an Icosphere mesh";
- ot->idname= "MESH_OT_primitive_ico_sphere_add";
+ ot->name = "Add Ico Sphere";
+ ot->description = "Construct an Icosphere mesh";
+ ot->idname = "MESH_OT_primitive_ico_sphere_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= add_primitive_icosphere_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = add_primitive_icosphere_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_int(ot->srna, "subdivisions", 2, 1, INT_MAX, "Subdivisions", "", 1, 8);
diff --git a/source/blender/editors/mesh/editmesh_bvh.c b/source/blender/editors/mesh/editmesh_bvh.c
index cc1f89e2c8b..37c4897cede 100644
--- a/source/blender/editors/mesh/editmesh_bvh.c
+++ b/source/blender/editors/mesh/editmesh_bvh.c
@@ -24,6 +24,11 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
+
+/** \file blender/editors/mesh/editmesh_bvh.c
+ * \ingroup edmesh
+ */
+
#define IN_EDITMESHBVH
@@ -53,7 +58,7 @@ typedef struct BMBVHTree {
float maxdist; //for nearest point search
float uv[2];
- /*stuff for topological vert search*/
+ /* stuff for topological vert search */
BMVert *v, *curv;
GHash *gh;
float curw, curd;
@@ -65,7 +70,7 @@ typedef struct BMBVHTree {
} BMBVHTree;
static void cage_mapped_verts_callback(void *userData, int index, float *co,
- float *UNUSED(no_f), short *UNUSED(no_s))
+ float *UNUSED(no_f), short *UNUSED(no_s))
{
void **data = userData;
BMEditMesh *em = data[0];
@@ -86,17 +91,17 @@ 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_RecalcTesselation(em);
+ BMEdit_RecalcTessellation(em);
tree->ob = obedit;
tree->scene = scene;
tree->em = em;
tree->bm = em->bm;
- tree->epsilon = FLT_EPSILON*2.0f;
+ tree->epsilon = FLT_EPSILON * 2.0f;
tree->flag = flag;
tree->tree = BLI_bvhtree_new(em->tottri, tree->epsilon, 8, 8);
@@ -106,7 +111,7 @@ BMBVHTree *BMBVH_NewBVH(BMEditMesh *em, int flag, Scene *scene, Object *obedit)
BMVert *v;
void *data[3];
- tree->cos = MEM_callocN(sizeof(float)*3*em->bm->totvert, "bmbvh cos");
+ tree->cos = MEM_callocN(sizeof(float) * 3 * em->bm->totvert, "bmbvh cos");
BM_ITER_INDEX(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL, i) {
BM_elem_index_set(v, i); /* set_inline */
copy_v3_v3(tree->cos[i], v->co);
@@ -115,7 +120,7 @@ BMBVHTree *BMBVH_NewBVH(BMEditMesh *em, int flag, Scene *scene, Object *obedit)
cage = editbmesh_get_derived_cage_and_final(scene, obedit, em, &final, CD_MASK_DERIVEDMESH);
- cagecos = MEM_callocN(sizeof(float)*3*em->bm->totvert, "bmbvh cagecos");
+ cagecos = MEM_callocN(sizeof(float) * 3 * em->bm->totvert, "bmbvh cagecos");
data[0] = em;
data[1] = cagecos;
@@ -126,18 +131,19 @@ BMBVHTree *BMBVH_NewBVH(BMEditMesh *em, int flag, Scene *scene, Object *obedit)
tree->cagecos = cagecos;
- for (i=0; i<em->tottri; i++) {
+ for (i = 0; i < em->tottri; i++) {
if (flag & BMBVH_USE_CAGE) {
copy_v3_v3(cos[0], cagecos[BM_elem_index_get(em->looptris[i][0]->v)]);
copy_v3_v3(cos[1], cagecos[BM_elem_index_get(em->looptris[i][1]->v)]);
copy_v3_v3(cos[2], cagecos[BM_elem_index_get(em->looptris[i][2]->v)]);
- } else {
+ }
+ else {
copy_v3_v3(cos[0], em->looptris[i][0]->v->co);
copy_v3_v3(cos[1], em->looptris[i][1]->v->co);
copy_v3_v3(cos[2], em->looptris[i][2]->v->co);
}
- BLI_bvhtree_insert(tree->tree, i, (float*)cos, 3);
+ BLI_bvhtree_insert(tree->tree, i, (float *)cos, 3);
}
BLI_bvhtree_balance(tree->tree);
@@ -158,14 +164,15 @@ void BMBVH_FreeBVH(BMBVHTree *tree)
MEM_freeN(tree);
}
-/*taken from bvhutils.c*/
+/* taken from bvhutils.c */
static float ray_tri_intersection(const BVHTreeRay *ray, const float UNUSED(m_dist), float *v0,
- float *v1, float *v2, float *uv, float UNUSED(e))
+ float *v1, float *v2, float *uv, float UNUSED(e))
{
float dist;
- if(isect_ray_tri_v3((float*)ray->origin, (float*)ray->direction, v0, v1, v2, &dist, uv))
+ if (isect_ray_tri_v3((float *)ray->origin, (float *)ray->direction, v0, v1, v2, &dist, uv)) {
return dist;
+ }
return FLT_MAX;
}
@@ -217,11 +224,13 @@ BMFace *BMBVH_RayCast(BMBVHTree *tree, float *co, float *dir, float *hitout, flo
v2 = tree->em->looptris[hit.index][1]->v;
v3 = tree->em->looptris[hit.index][2]->v;
- for (i=0; i<3; i++) {
- co[i] = v1->co[i] + (v2->co[i] - v1->co[i])*tree->uv[0] + (v3->co[i]-v1->co[i])*tree->uv[1];
+ for (i = 0; i < 3; i++) {
+ co[i] = v1->co[i] + ((v2->co[i] - v1->co[i]) * tree->uv[0]) +
+ ((v3->co[i] - v1->co[i]) * tree->uv[1]);
}
copy_v3_v3(hitout, co);
- } else {
+ }
+ else {
copy_v3_v3(hitout, hit.co);
}
@@ -249,10 +258,10 @@ static void vertsearchcallback(void *userdata, int index, const float *UNUSED(co
maxdist = tree->maxdist;
- for (i=0; i<3; i++) {
+ for (i = 0; i < 3; i++) {
sub_v3_v3v3(v, hit->co, ls[i]->v->co);
- dist = sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
+ dist = len_v3(v);
if (dist < hit->dist && dist < maxdist) {
copy_v3_v3(hit->co, ls[i]->v->co);
copy_v3_v3(hit->no, ls[i]->v->no);
@@ -267,7 +276,7 @@ BMVert *BMBVH_FindClosestVert(BMBVHTree *tree, float *co, float maxdist)
BVHTreeNearest hit;
copy_v3_v3(hit.co, co);
- hit.dist = maxdist*5;
+ hit.dist = maxdist * 5;
hit.index = -1;
tree->maxdist = maxdist;
@@ -276,14 +285,14 @@ BMVert *BMBVH_FindClosestVert(BMBVHTree *tree, float *co, float maxdist)
if (hit.dist != FLT_MAX && hit.index != -1) {
BMLoop **ls = tree->em->looptris[hit.index];
float dist, curdist = tree->maxdist, v[3];
- int cur=0, i;
+ int cur = 0, i;
maxdist = tree->maxdist;
- for (i=0; i<3; i++) {
+ for (i = 0; i < 3; i++) {
sub_v3_v3v3(v, hit.co, ls[i]->v->co);
- dist = sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
+ dist = len_v3(v);
if (dist < curdist) {
cur = i;
curdist = dist;
@@ -303,7 +312,7 @@ typedef struct walklist {
float w, r;
int totwalked;
- /*state data*/
+ /* state data */
BMVert *lastv;
BMLoop *curl, *firstl;
BMEdge *cure;
@@ -312,17 +321,19 @@ typedef struct walklist {
/* UNUSED */
#if 0
static short winding(float *v1, float *v2, float *v3)
-/* is v3 to the right of v1-v2 ? With exception: v3==v1 || v3==v2 */
+/* is v3 to the right of (v1 - v2) ? With exception: v3 == v1 || v3 == v2 */
{
double inp;
- //inp= (v2[cox]-v1[cox])*(v1[coy]-v3[coy]) +(v1[coy]-v2[coy])*(v1[cox]-v3[cox]);
- inp= (v2[0]-v1[0])*(v1[1]-v3[1]) +(v1[1]-v2[1])*(v1[0]-v3[0]);
+ //inp = (v2[cox] - v1[cox]) * (v1[coy] - v3[coy]) + (v1[coy] - v2[coy]) * (v1[cox] - v3[cox]);
+ inp = (v2[0] - v1[0]) * (v1[1] - v3[1]) + (v1[1] - v2[1]) * (v1[0] - v3[0]);
- if(inp<0.0) return 0;
- else if(inp==0) {
- if(v1[0]==v3[0] && v1[1]==v3[1]) return 0;
- if(v2[0]==v3[0] && v2[1]==v3[1]) return 0;
+ if (inp < 0.0) {
+ return 0;
+ }
+ else if (inp == 0) {
+ if (v1[0] == v3[0] && v1[1] == v3[1]) return 0;
+ if (v2[0] == v3[0] && v2[1] == v3[1]) return 0;
}
return 1;
}
@@ -366,8 +377,8 @@ int BMBVH_EdgeVisible(BMBVHTree *tree, BMEdge *e, ARegion *ar, View3D *v3d, Obje
return 0;
}
- mval_f[0] = ar->winx/2.0;
- mval_f[1] = ar->winy/2.0;
+ mval_f[0] = ar->winx / 2.0f;
+ mval_f[1] = ar->winy / 2.0f;
ED_view3d_win_to_segment_clip(ar, v3d, mval_f, origin, end);
invert_m4_m4(invmat, obedit->obmat);
@@ -381,8 +392,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 +406,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);
@@ -405,7 +416,7 @@ int BMBVH_EdgeVisible(BMBVHTree *tree, BMEdge *e, ARegion *ar, View3D *v3d, Obje
normalize_v3(dir2);
normalize_v3(dir3);
- /*do three samplings: left, middle, right*/
+ /* do three samplings: left, middle, right */
f = edge_ray_cast(tree, co1, dir1, NULL, e);
if (f && !edge_ray_cast(tree, co2, dir2, NULL, e))
return 1;
diff --git a/source/blender/editors/mesh/knifetool.c b/source/blender/editors/mesh/editmesh_knife.c
index fe1cc18086f..0ef6e2b81a8 100644
--- a/source/blender/editors/mesh/knifetool.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -19,23 +19,27 @@
* All rights reserved.
*
*
- * Contributor(s): Joseph Eagar, Joshua Leung
+ * Contributor(s): Joseph Eagar, Joshua Leung, Howard Trickey,
+ * Campbell Barton
*
* ***** END GPL LICENSE BLOCK *****
*/
-#define _USE_MATH_DEFINES
+/** \file blender/editors/mesh/editmesh_knife.c
+ * \ingroup edmesh
+ */
+#define _USE_MATH_DEFINES
#include "MEM_guardedalloc.h"
-
#include "BLI_blenlib.h"
#include "BLI_array.h"
#include "BLI_math.h"
#include "BLI_rand.h"
#include "BLI_smallhash.h"
#include "BLI_scanfill.h"
+#include "BLI_memarena.h"
#include "BKE_DerivedMesh.h"
#include "BKE_context.h"
@@ -44,7 +48,6 @@
#include "BIF_gl.h"
#include "BIF_glutil.h" /* for paint cursor */
-
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_view3d.h"
@@ -62,8 +65,7 @@
/* this code here is kindof messy. . .I might need to eventually rework it - joeedh */
-#define MAXGROUP 30
-#define KMAXDIST 10 /* max mouse distance from edge before not detecting it */
+#define KMAXDIST 10 /* max mouse distance from edge before not detecting it */
/* knifetool operator */
typedef struct KnifeVert {
@@ -84,7 +86,7 @@ typedef struct KnifeEdge {
BMFace *basef; /* face to restrict face fill to */
ListBase faces;
int draw;
-
+
BMEdge *e, *oe; /* non-NULL if this is an original edge */
} KnifeEdge;
@@ -99,65 +101,72 @@ typedef struct BMEdgeHit {
BMFace *f;
} BMEdgeHit;
+typedef struct KnifePosData {
+ float co[3];
+ float cage[3];
+
+ /* At most one of vert, edge, or bmface should be non-NULL,
+ * saying whether the point is snapped to a vertex, edge, or in a face.
+ * If none are set, this point is in space and is_space should be true. */
+ KnifeVert *vert;
+ KnifeEdge *edge;
+ BMFace *bmface;
+ int is_space;
+
+ int mval[2]; /* mouse screen position */
+} KnifePosData;
+
/* struct for properties used while drawing */
typedef struct knifetool_opdata {
- ARegion *ar; /* region that knifetool was activated in */
- void *draw_handle; /* for drawing preview loop */
+ ARegion *ar; /* region that knifetool was activated in */
+ void *draw_handle; /* for drawing preview loop */
ViewContext vc;
bContext *C;
-
+
Object *ob;
BMEditMesh *em;
-
+
MemArena *arena;
GHash *origvertmap;
GHash *origedgemap;
-
+
GHash *kedgefacemap;
-
+
BMBVHTree *bmbvh;
BLI_mempool *kverts;
BLI_mempool *kedges;
-
+
float vthresh;
float ethresh;
-
- float vertco[3], vertcage[3];
- float prevco[3], prevcage[3];
-
+
/* used for drag-cutting */
BMEdgeHit *linehits;
int totlinehit;
-
- /* if curedge is NULL, attach to curvert;
- * if curvert is NULL, attach to curbmface,
- * otherwise create null vert */
- KnifeEdge *curedge, *prevedge;
- KnifeVert *curvert, *prevvert;
- BMFace *curbmface, *prevbmface;
-
- int totkedge, totkvert, cutnr;
-
+
+ /* Data for mouse-position-derived data (cur) and previous click (prev) */
+ KnifePosData cur, prev;
+
+ int totkedge, totkvert;
+
BLI_mempool *refs;
-
+
float projmat[4][4];
int is_ortho;
int cut_through;
float clipsta, clipend;
-
+
enum {
MODE_IDLE,
MODE_DRAGGING,
MODE_CONNECT,
MODE_PANNING
} mode;
-
+
int snap_midpoints, prevmode, extend;
int ignore_edge_snapping, ignore_vert_snapping;
- int prevmval[2];
-
+
enum {
ANGLE_FREE,
ANGLE_0,
@@ -166,7 +175,6 @@ typedef struct knifetool_opdata {
ANGLE_135
} angle_snapping;
- int is_space, prev_is_space; /*1 if current cut location, vertco, isn't on the mesh */
float (*cagecos)[3];
} knifetool_opdata;
@@ -177,7 +185,18 @@ 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 void knife_pos_data_clear(KnifePosData *kpd)
+{
+ zero_v3(kpd->co);
+ zero_v3(kpd->cage);
+ kpd->vert = NULL;
+ kpd->edge = NULL;
+ kpd->bmface = NULL;
+ kpd->mval[0] = 0;
+ kpd->mval[1] = 0;
}
static ListBase *knife_empty_list(knifetool_opdata *kcd)
@@ -198,13 +217,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 +244,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 +260,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,88 +277,69 @@ 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);
kfe->v2 = get_bm_knife_vert(kcd, e->v2);
knife_add_to_vert_edges(kcd, kfe);
-
+
BLI_ghash_insert(kcd->origedgemap, e, kfe);
-
+
BM_ITER(f, &iter, kcd->em->bm, BM_FACES_OF_EDGE, e) {
knife_append_list(kcd, &kfe->faces, f);
-
+
/* ensures the kedges lst for this f is initialized,
* it automatically adds kfe by itself */
knife_get_face_kedges(kcd, f);
}
}
-
+
return kfe;
}
+/* User has just clicked for first time or first time after a restart (E key).
+ * Copy the current position data into prev. */
static void knife_start_cut(knifetool_opdata *kcd)
{
- kcd->prevedge = kcd->curedge;
- kcd->prevvert = kcd->curvert;
- kcd->prevbmface = kcd->curbmface;
- kcd->cutnr++;
- kcd->prev_is_space = kcd->is_space;
- 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);
-
- if (kcd->prevvert == NULL && kcd->prevedge == NULL && is_zero_v3(kcd->prevcage)) {
+ kcd->prev = kcd->cur;
+ kcd->cur.is_space = 0; /*TODO: why do we do this? */
+
+ if (kcd->prev.vert == NULL && kcd->prev.edge == NULL && is_zero_v3(kcd->prev.cage)) {
/* Make prevcage a point on the view ray to mouse closest to a point on model: choose vertex 0 */
float origin[3], ray[3], co[3];
BMVert *v0;
- knife_input_ray_cast(kcd, kcd->vc.mval, origin, ray);
+ knife_input_ray_cast(kcd, kcd->cur.mval, origin, ray);
add_v3_v3v3(co, origin, ray);
v0 = BM_vert_at_index(kcd->em->bm, 0);
if (v0) {
- closest_to_line_v3(kcd->prevcage, v0->co, co, origin);
- copy_v3_v3(kcd->prevco, kcd->prevcage);
- copy_v3_v3(kcd->vertcage, kcd->prevcage);
- copy_v3_v3(kcd->vertco, kcd->prevco);
+ closest_to_line_v3(kcd->prev.cage, v0->co, co, origin);
+ copy_v3_v3(kcd->prev.co, kcd->prev.cage); /*TODO: do we need this? */
+ copy_v3_v3(kcd->cur.cage, kcd->prev.cage);
+ copy_v3_v3(kcd->cur.co, kcd->prev.co);
}
}
}
-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,12 +348,12 @@ 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;
- else
- kfe->basef = kcd->prevbmface;
+ kfe->basef = kcd->cur.bmface;
+ else
+ kfe->basef = kcd->prev.bmface;
}
else {
for (r1 = kfe->v1->edges.first; r1 && !kfe->basef; r1 = r1->next) {
@@ -349,12 +361,12 @@ static void knife_find_basef(knifetool_opdata *kcd, KnifeEdge *kfe)
for (r2 = ke1->faces.first; r2 && !kfe->basef; r2 = r2->next) {
for (r3 = kfe->v2->edges.first; r3 && !kfe->basef; r3 = r3->next) {
KnifeEdge *ke2 = r3->ref;
-
+
for (r4 = ke2->faces.first; r4 && !kfe->basef; r4 = r4->next) {
if (r2->ref == r4->ref) {
kfe->basef = r2->ref;
}
- }
+ }
}
}
}
@@ -373,122 +385,121 @@ 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;
}
+/* Make a single KnifeEdge for cut from kcd->prev to kcd->cur.
+ * and move cur data to prev. */
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)
+
+ if (kcd->prev.vert && kcd->prev.vert == kcd->cur.vert)
return;
- if (kcd->prevedge && kcd->prevedge == kcd->curedge)
+ if (kcd->prev.edge && kcd->prev.edge == kcd->cur.edge)
return;
-
+
kfe->draw = 1;
- if (kcd->prevvert) {
- kfe->v1 = kcd->prevvert;
+ if (kcd->prev.vert) {
+ kfe->v1 = kcd->prev.vert;
}
- else if (kcd->prevedge) {
- kfe->v1 = knife_split_edge(kcd, kcd->prevedge, kcd->prevco, &kfe2);
+ else if (kcd->prev.edge) {
+ kfe->v1 = knife_split_edge(kcd, kcd->prev.edge, kcd->prev.co, &kfe2);
}
else {
- kfe->v1 = new_knife_vert(kcd, kcd->prevco, kcd->prevco);
- kfe->v1->draw = kfe->draw = !kcd->prev_is_space;
- kfe->v1->inspace = kcd->prev_is_space;
- kfe->draw = !kcd->prev_is_space;
+ kfe->v1 = new_knife_vert(kcd, kcd->prev.co, kcd->prev.co);
+ kfe->v1->draw = kfe->draw = !kcd->prev.is_space;
+ kfe->v1->inspace = kcd->prev.is_space;
+ kfe->draw = !kcd->prev.is_space;
kfe->v1->isface = 1;
}
-
- if (kcd->curvert) {
- kfe->v2 = kcd->curvert;
+
+ if (kcd->cur.vert) {
+ kfe->v2 = kcd->cur.vert;
}
- else if (kcd->curedge) {
- kfe->v2 = knife_split_edge(kcd, kcd->curedge, kcd->vertco, &kfe3);
-
- kcd->curvert = kfe->v2;
+ else if (kcd->cur.edge) {
+ kfe->v2 = knife_split_edge(kcd, kcd->cur.edge, kcd->cur.co, &kfe3);
+ kcd->cur.vert = kfe->v2;
}
else {
- kfe->v2 = new_knife_vert(kcd, kcd->vertco, kcd->vertco);
- kfe->v2->draw = !kcd->is_space;
+ kfe->v2 = new_knife_vert(kcd, kcd->cur.co, kcd->cur.co);
+ kfe->v2->draw = !kcd->cur.is_space;
kfe->v2->isface = 1;
- kfe->v2->inspace = kcd->is_space;
-
- if (kcd->is_space)
+ kfe->v2->inspace = kcd->cur.is_space;
+
+ if (kcd->cur.is_space)
kfe->draw = 0;
- kcd->curvert = kfe->v2;
+ kcd->cur.vert = 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);
/* sanity check to make sure we're in the right edge/face lists */
- if (kcd->curbmface) {
- if (!find_ref(&kfe->faces, kcd->curbmface)) {
- knife_edge_append_face(kcd, kfe, kcd->curbmface);
+ if (kcd->cur.bmface) {
+ if (!find_ref(&kfe->faces, kcd->cur.bmface)) {
+ knife_edge_append_face(kcd, kfe, kcd->cur.bmface);
}
- if (kcd->prevbmface && kcd->prevbmface != kcd->curbmface) {
- if (!find_ref(&kfe->faces, kcd->prevbmface)) {
- knife_edge_append_face(kcd, kfe, kcd->prevbmface);
+ if (kcd->prev.bmface && kcd->prev.bmface != kcd->cur.bmface) {
+ if (!find_ref(&kfe->faces, kcd->prev.bmface)) {
+ knife_edge_append_face(kcd, kfe, kcd->prev.bmface);
}
}
}
-
+
/* set up for next cut */
- kcd->prevbmface = kcd->curbmface;
- kcd->prevvert = kcd->curvert;
- kcd->prevedge = kcd->curedge;
- copy_v3_v3(kcd->prevco, kcd->vertco);
- copy_v3_v3(kcd->prevcage, kcd->vertcage);
- kcd->prev_is_space = kcd->is_space;
- kcd->prevmval[0] = kcd->vc.mval[0];
- kcd->prevmval[1] = kcd->vc.mval[1];
+ kcd->prev = kcd->cur;
}
static int verge_linehit(const void *vlh1, const void *vlh2)
{
const BMEdgeHit *lh1 = vlh1, *lh2 = vlh2;
- if (lh1->l < lh2->l) return -1;
- else if (lh1->l > lh2->l) return 1;
+ if (lh1->l < lh2->l) return -1;
+ else if (lh1->l > lh2->l) return 1;
else return 0;
}
-static void knife_add_single_cut_through(knifetool_opdata *kcd,
- KnifeVert *v1, KnifeVert *v2, BMFace *f)
+static void knife_add_single_cut_through(knifetool_opdata *kcd, KnifeVert *v1, KnifeVert *v2, BMFace *f)
{
KnifeEdge *kfenew;
@@ -505,7 +516,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 +532,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;
@@ -543,7 +554,7 @@ static void knife_cut_through(knifetool_opdata *kcd)
BMFace *f;
KnifeEdge *kfe, *kfe2, *kfe3;
KnifeVert *v1, *v2, *firstv = NULL, *lastv = NULL;
- ListBase firstfaces = {NULL, NULL}, lastfaces = { NULL, NULL};
+ ListBase firstfaces = {NULL, NULL}, lastfaces = {NULL, NULL};
Ref *r, *r2;
KnifeEdge **splitkfe;
int i, j, found;
@@ -557,32 +568,32 @@ static void knife_cut_through(knifetool_opdata *kcd)
qsort(kcd->linehits, kcd->totlinehit, sizeof(BMEdgeHit), verge_linehit);
splitkfe = MEM_callocN(kcd->totlinehit * sizeof(KnifeEdge *), "knife_cut_through");
- if (kcd->prevvert) {
- if (kcd->prevvert == kcd->curvert)
+ if (kcd->prev.vert) {
+ if (kcd->prev.vert == kcd->cur.vert)
return;
- firstv = kcd->prevvert;
- knife_get_vert_faces(kcd, firstv, kcd->prevbmface, &firstfaces);
+ firstv = kcd->prev.vert;
+ knife_get_vert_faces(kcd, firstv, kcd->prev.bmface, &firstfaces);
}
- else if (kcd->prevedge) {
- if (kcd->prevedge == kcd->curedge)
+ else if (kcd->prev.edge) {
+ if (kcd->prev.edge == kcd->cur.edge)
return;
- firstv = knife_split_edge(kcd, kcd->prevedge, kcd->prevco, &kfe3);
- knife_get_edge_faces(kcd, kcd->prevedge, &firstfaces);
+ firstv = knife_split_edge(kcd, kcd->prev.edge, kcd->prev.co, &kfe3);
+ knife_get_edge_faces(kcd, kcd->prev.edge, &firstfaces);
}
- if (kcd->curvert) {
- lastv = kcd->curvert;
- knife_get_vert_faces(kcd, lastv, kcd->curbmface, &lastfaces);
+ if (kcd->cur.vert) {
+ lastv = kcd->cur.vert;
+ knife_get_vert_faces(kcd, lastv, kcd->cur.bmface, &lastfaces);
}
- else if (kcd->curedge) {
- lastv = knife_split_edge(kcd, kcd->curedge, kcd->vertco, &kfe3);
- knife_get_edge_faces(kcd, kcd->curedge, &lastfaces);
+ else if (kcd->cur.edge) {
+ lastv = knife_split_edge(kcd, kcd->cur.edge, kcd->cur.co, &kfe3);
+ knife_get_edge_faces(kcd, kcd->cur.edge, &lastfaces);
}
if (firstv) {
/* For each face incident to firstv,
* find the first following linehit (if any) sharing that face and connect */
- for (r = firstfaces.first; r; r = r->next ) {
+ for (r = firstfaces.first; r; r = r->next) {
f = r->ref;
found = 0;
for (j = 0, lh2 = kcd->linehits; j < kcd->totlinehit; j++, lh2++) {
@@ -619,8 +630,8 @@ static void knife_cut_through(knifetool_opdata *kcd)
kfe2 = lh2->kfe;
for (r2 = kfe2->faces.first; r2; r2 = r2->next) {
if (r2->ref == f) {
- v1 = splitkfe[i]? kfe->v1 : knife_split_edge(kcd, kfe, lh->hit, &splitkfe[i]);
- v2 = splitkfe[j]? kfe2->v1 : knife_split_edge(kcd, kfe2, lh2->hit, &splitkfe[j]);
+ v1 = splitkfe[i] ? kfe->v1 : knife_split_edge(kcd, kfe, lh->hit, &splitkfe[i]);
+ v2 = splitkfe[j] ? kfe2->v1 : knife_split_edge(kcd, kfe2, lh2->hit, &splitkfe[j]);
knife_add_single_cut_through(kcd, v1, v2, f);
found = 1;
break;
@@ -630,7 +641,7 @@ static void knife_cut_through(knifetool_opdata *kcd)
if (!found && lastv) {
for (r2 = lastfaces.first; r2; r2 = r2->next) {
if (r2->ref == f) {
- v1 = splitkfe[i]? kfe->v1 : knife_split_edge(kcd, kfe, lh->hit, &splitkfe[i]);
+ v1 = splitkfe[i] ? kfe->v1 : knife_split_edge(kcd, kfe, lh->hit, &splitkfe[i]);
knife_add_single_cut_through(kcd, v1, lastv, f);
break;
}
@@ -645,35 +656,30 @@ static void knife_cut_through(knifetool_opdata *kcd)
kcd->totlinehit = 0;
/* set up for next cut */
- kcd->prevbmface = kcd->curbmface;
- kcd->prevvert = kcd->curvert;
- kcd->prevedge = kcd->curedge;
- copy_v3_v3(kcd->prevco, kcd->vertco);
- copy_v3_v3(kcd->prevcage, kcd->vertcage);
- kcd->prev_is_space = kcd->is_space;
- kcd->prevmval[0] = kcd->vc.mval[0];
- kcd->prevmval[1] = kcd->vc.mval[1];
+ kcd->prev = kcd->cur;
}
+/* User has just left-clicked after the first time.
+ * Add all knife cuts implied by line from prev to cur.
+ * If that line crossed edges then kcd->linehits will be non-NULL. */
static void knife_add_cut(knifetool_opdata *kcd)
{
- /* BMEditMesh *em = kcd->em;*/ /* UNUSED */
- knifetool_opdata oldkcd = *kcd;
-
+ KnifePosData savcur = kcd->cur;
+
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;
@@ -682,49 +688,50 @@ static void knife_add_cut(knifetool_opdata *kcd)
else if (lastlh && firstlh) {
if (firstlh->v || lastlh->v) {
KnifeVert *kfv = firstlh->v ? firstlh->v : lastlh->v;
-
- kcd->prevvert = kfv;
- copy_v3_v3(kcd->prevco, firstlh->hit);
- copy_v3_v3(kcd->prevcage, firstlh->cagehit);
- kcd->prevedge = NULL;
- kcd->prevbmface = f;
+
+ kcd->prev.vert = kfv;
+ copy_v3_v3(kcd->prev.co, firstlh->hit);
+ copy_v3_v3(kcd->prev.cage, firstlh->cagehit);
+ kcd->prev.edge = NULL;
+ kcd->prev.bmface = f;
+ /* TODO: should we set prev.in_space = 0 ? */
}
lastlh = firstlh = NULL;
}
-
- if (len_v3v3(kcd->prevcage, lh->realhit) < FLT_EPSILON * 80)
+
+ if (len_v3v3(kcd->prev.cage, lh->realhit) < FLT_EPSILON * 80)
continue;
- if (len_v3v3(kcd->vertcage, lh->realhit) < FLT_EPSILON * 80)
+ if (len_v3v3(kcd->cur.cage, lh->realhit) < FLT_EPSILON * 80)
continue;
-
- if (kcd->prev_is_space || kcd->is_space) {
- kcd->prev_is_space = kcd->is_space = 0;
- copy_v3_v3(kcd->prevco, lh->hit);
- copy_v3_v3(kcd->prevcage, lh->cagehit);
- kcd->prevedge = lh->kfe;
- kcd->curbmface = lh->f;
+
+ if (kcd->prev.is_space) {
+ kcd->prev.is_space = 0;
+ copy_v3_v3(kcd->prev.co, lh->hit);
+ copy_v3_v3(kcd->prev.cage, lh->cagehit);
+ kcd->prev.vert = NULL;
+ kcd->prev.edge = lh->kfe;
+ kcd->prev.bmface = lh->f;
continue;
- }
-
- kcd->is_space = 0;
- kcd->curedge = lh->kfe;
- kcd->curbmface = lh->f;
- kcd->curvert = lh->v;
- copy_v3_v3(kcd->vertco, lh->hit);
- copy_v3_v3(kcd->vertcage, lh->cagehit);
+ }
+
+ kcd->cur.is_space = 0;
+ kcd->cur.edge = lh->kfe;
+ kcd->cur.bmface = lh->f;
+ kcd->cur.vert = lh->v;
+ copy_v3_v3(kcd->cur.co, lh->hit);
+ copy_v3_v3(kcd->cur.cage, lh->cagehit);
knife_add_single_cut(kcd);
}
-
- 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);
-
+
+ if (savcur.is_space) {
+ kcd->prev = savcur;
+ }
+ else {
+ kcd->cur = savcur;
+ knife_add_single_cut(kcd);
+ }
+
MEM_freeN(kcd->linehits);
kcd->linehits = NULL;
kcd->totlinehit = 0;
@@ -747,9 +754,9 @@ 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]);
+ gluProject(kcd->prev.cage[0], kcd->prev.cage[1], kcd->prev.cage[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 +829,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);
@@ -840,65 +847,65 @@ static void knifetool_draw_angle_snapping(knifetool_opdata *kcd)
static void knifetool_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *arg)
{
knifetool_opdata *kcd = arg;
-
+
glDisable(GL_DEPTH_TEST);
-
+
glPolygonOffset(1.0f, 1.0f);
-
+
glPushMatrix();
glMultMatrixf(kcd->ob->obmat);
-
+
if (kcd->mode == MODE_DRAGGING) {
if (kcd->angle_snapping != ANGLE_FREE)
knifetool_draw_angle_snapping(kcd);
glColor3f(0.1, 0.1, 0.1);
glLineWidth(2.0);
-
+
glBegin(GL_LINES);
- glVertex3fv(kcd->prevcage);
- glVertex3fv(kcd->vertcage);
+ glVertex3fv(kcd->prev.cage);
+ glVertex3fv(kcd->cur.cage);
glEnd();
-
+
glLineWidth(1.0);
}
-
- if (kcd->curedge) {
+
+ if (kcd->cur.edge) {
glColor3f(0.5, 0.3, 0.15);
glLineWidth(2.0);
-
+
glBegin(GL_LINES);
- glVertex3fv(kcd->curedge->v1->cageco);
- glVertex3fv(kcd->curedge->v2->cageco);
+ glVertex3fv(kcd->cur.edge->v1->cageco);
+ glVertex3fv(kcd->cur.edge->v2->cageco);
glEnd();
-
+
glLineWidth(1.0);
}
- else if (kcd->curvert) {
+ else if (kcd->cur.vert) {
glColor3f(0.8, 0.2, 0.1);
glPointSize(11);
-
+
glBegin(GL_POINTS);
- glVertex3fv(kcd->vertcage);
+ glVertex3fv(kcd->cur.cage);
glEnd();
}
-
- if (kcd->curbmface) {
+
+ if (kcd->cur.bmface) {
glColor3f(0.1, 0.8, 0.05);
glPointSize(9);
-
+
glBegin(GL_POINTS);
- glVertex3fv(kcd->vertcage);
+ glVertex3fv(kcd->cur.cage);
glEnd();
}
-
+
if (kcd->totlinehit > 0) {
BMEdgeHit *lh;
int i;
-
+
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
+
/* draw any snapped verts first */
glColor4f(0.8, 0.2, 0.1, 0.4);
glPointSize(11);
@@ -906,11 +913,11 @@ static void knifetool_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void
lh = kcd->linehits;
for (i = 0; i < kcd->totlinehit; i++, lh++) {
float sv1[3], sv2[3];
-
+
knife_project_v3(kcd, lh->kfe->v1->cageco, sv1);
knife_project_v3(kcd, lh->kfe->v2->cageco, sv2);
knife_project_v3(kcd, lh->cagehit, lh->schit);
-
+
if (len_v2v2(lh->schit, sv1) < kcd->vthresh / 4.0f) {
copy_v3_v3(lh->cagehit, lh->kfe->v1->cageco);
glVertex3fv(lh->cagehit);
@@ -923,7 +930,7 @@ static void knifetool_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void
}
}
glEnd();
-
+
/* now draw the rest */
glColor4f(0.1, 0.8, 0.05, 0.4);
glPointSize(7);
@@ -935,11 +942,11 @@ static void knifetool_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void
glEnd();
glDisable(GL_BLEND);
}
-
+
if (kcd->totkedge > 0) {
BLI_mempool_iter iter;
KnifeEdge *kfe;
-
+
glLineWidth(1.0);
glBegin(GL_LINES);
@@ -947,13 +954,13 @@ static void knifetool_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void
for (kfe = BLI_mempool_iterstep(&iter); kfe; kfe = BLI_mempool_iterstep(&iter)) {
if (!kfe->draw)
continue;
-
+
glColor3f(0.2, 0.2, 0.2);
-
+
glVertex3fv(kfe->v1->cageco);
glVertex3fv(kfe->v2->cageco);
}
-
+
glEnd();
glLineWidth(1.0);
}
@@ -961,20 +968,20 @@ static void knifetool_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void
if (kcd->totkvert > 0) {
BLI_mempool_iter iter;
KnifeVert *kfv;
-
+
glPointSize(5.0);
-
+
glBegin(GL_POINTS);
BLI_mempool_iternew(kcd->kverts, &iter);
for (kfv = BLI_mempool_iterstep(&iter); kfv; kfv = BLI_mempool_iterstep(&iter)) {
if (!kfv->draw)
continue;
-
+
glColor3f(0.6, 0.1, 0.2);
-
+
glVertex3fv(kfv->cageco);
}
-
+
glEnd();
}
@@ -982,30 +989,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);
@@ -1027,10 +1010,10 @@ static BMEdgeHit *knife_edge_tri_isect(knifetool_opdata *kcd, BMBVHTree *bmtree,
float cos[9], uv[3], lambda;
unsigned int tot = 0;
int i, j;
-
+
/* for comparing distances, error of intersection depends on triangle scale.
* need to scale down before squaring for accurate comparison */
- const float depsilon = 50 * FLT_EPSILON * len_v3_tri_side_max(v1, v2, v3);
+ const float depsilon = 50 * FLT_EPSILON *len_v3_tri_side_max(v1, v2, v3);
const float depsilon_squared = depsilon * depsilon;
copy_v3_v3(cos + 0, v1);
@@ -1039,37 +1022,37 @@ static BMEdgeHit *knife_edge_tri_isect(knifetool_opdata *kcd, BMBVHTree *bmtree,
BLI_bvhtree_insert(tree2, 0, cos, 3);
BLI_bvhtree_balance(tree2);
-
+
result = results = BLI_bvhtree_overlap(tree, tree2, &tot);
-
+
for (i = 0; i < tot; i++, result++) {
float p[3];
-
+
ls = (BMLoop **)kcd->em->looptris[result->indexA];
-
+
for (j = 0; j < 3; j++) {
BMLoop *l1 = ls[j];
BMFace *hitf;
ListBase *lst = knife_get_face_kedges(kcd, l1->f);
Ref *ref;
-
+
for (ref = lst->first; ref; ref = ref->next) {
KnifeEdge *kfe = ref->ref;
-
- //if (kfe == kcd->curedge || kfe == kcd->prevedge)
+
+ //if (kfe == kcd->cur.edge || kfe == kcd->prev.edge)
// continue;
-
+
if (isect_line_tri_v3(kfe->v1->cageco, kfe->v2->cageco, v1, v2, v3, &lambda, uv)) {
float no[3], view[3], sp[3];
-
+
interp_v3_v3v3(p, kfe->v1->cageco, kfe->v2->cageco, lambda);
-
- if (kcd->curvert && len_squared_v3v3(kcd->curvert->cageco, p) < depsilon_squared)
+
+ if (kcd->cur.vert && len_squared_v3v3(kcd->cur.vert->cageco, p) < depsilon_squared)
continue;
- if (kcd->prevvert && len_squared_v3v3(kcd->prevvert->cageco, p) < depsilon_squared)
+ if (kcd->prev.vert && len_squared_v3v3(kcd->prev.vert->cageco, p) < depsilon_squared)
continue;
- if ( len_squared_v3v3(kcd->prevcage, p) < depsilon_squared ||
- len_squared_v3v3(kcd->vertcage, p) < depsilon_squared)
+ if (len_squared_v3v3(kcd->prev.cage, p) < depsilon_squared ||
+ len_squared_v3v3(kcd->cur.cage, p) < depsilon_squared)
{
continue;
}
@@ -1095,28 +1078,28 @@ static BMEdgeHit *knife_edge_tri_isect(knifetool_opdata *kcd, BMBVHTree *bmtree,
/* ray cast */
hitf = BMBVH_RayCast(bmtree, p, no, NULL, NULL);
}
-
+
/* ok, if visible add the new point */
if (!hitf && !BLI_smallhash_haskey(ehash, (intptr_t)kfe)) {
BMEdgeHit hit;
- if ( len_squared_v3v3(p, kcd->vertco) < depsilon_squared ||
- len_squared_v3v3(p, kcd->prevco) < depsilon_squared)
+ if (len_squared_v3v3(p, kcd->cur.co) < depsilon_squared ||
+ len_squared_v3v3(p, kcd->prev.co) < depsilon_squared)
{
continue;
}
-
+
hit.kfe = kfe;
hit.v = NULL;
-
+
knife_find_basef(kcd, kfe);
hit.f = kfe->basef;
hit.perc = len_v3v3(p, kfe->v1->cageco) / len_v3v3(kfe->v1->cageco, kfe->v2->cageco);
copy_v3_v3(hit.cagehit, p);
-
+
interp_v3_v3v3(p, kfe->v1->co, kfe->v2->co, hit.perc);
copy_v3_v3(hit.realhit, p);
-
+
/* BMESH_TODO: should also snap to vertices */
if (kcd->snap_midpoints) {
float perc = hit.perc;
@@ -1131,7 +1114,7 @@ static BMEdgeHit *knife_edge_tri_isect(knifetool_opdata *kcd, BMBVHTree *bmtree,
else {
perc = 1.0f;
}
-
+
interp_v3_v3v3(hit.hit, kfe->v1->co, kfe->v2->co, perc);
interp_v3_v3v3(hit.cagehit, kfe->v1->cageco, kfe->v2->cageco, perc);
}
@@ -1139,7 +1122,7 @@ static BMEdgeHit *knife_edge_tri_isect(knifetool_opdata *kcd, BMBVHTree *bmtree,
copy_v3_v3(hit.hit, p);
}
knife_project_v3(kcd, hit.cagehit, hit.schit);
-
+
BLI_array_append(edges, hit);
BLI_smallhash_insert(ehash, (intptr_t)kfe, NULL);
}
@@ -1147,13 +1130,13 @@ static BMEdgeHit *knife_edge_tri_isect(knifetool_opdata *kcd, BMBVHTree *bmtree,
}
}
}
-
+
if (results)
MEM_freeN(results);
-
+
BLI_bvhtree_free(tree2);
*count = BLI_array_count(edges);
-
+
return edges;
}
@@ -1172,36 +1155,46 @@ 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);
-
+
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);
-
+
+ copy_v3_v3(v1, kcd->prev.cage);
+ copy_v3_v3(v2, kcd->cur.cage);
+
/* 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);
-
+
+ /* numeric error, 'v1' -> 'v2', 'v2' -> 'v4' can end up being ~2000 units apart in otho mode
+ * (from ED_view3d_win_to_segment_clip() above)
+ * this gives precision error in 'knife_edge_tri_isect', rather then solving properly
+ * (which may involve using doubles everywhere!),
+ * limit the distance between these points */
+ if (kcd->is_ortho) {
+ limit_dist_v3(v1, v3, 200.0f);
+ limit_dist_v3(v2, v4, 200.0f);
+ }
+
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 +1206,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);
}
@@ -1258,33 +1251,32 @@ static void knife_input_ray_cast(knifetool_opdata *kcd, const int mval_i[2],
mul_m3_v3(imat, r_ray);
}
-
static BMFace *knife_find_closest_face(knifetool_opdata *kcd, float co[3], float cageco[3], int *is_space)
{
BMFace *f;
int dist = KMAXDIST;
float origin[3];
float ray[3];
-
+
/* unproject to find view ray */
knife_input_ray_cast(kcd, kcd->vc.mval, origin, ray);
add_v3_v3v3(co, origin, ray);
f = BMBVH_RayCast(kcd->bmbvh, origin, ray, co, cageco);
-
+
if (is_space)
*is_space = !f;
-
+
if (!f) {
/* try to use backbuffer selection method if ray casting failed */
- f = EDBM_findnearestface(&kcd->vc, &dist);
-
+ f = EDBM_face_find_nearest(&kcd->vc, &dist);
+
/* cheat for now; just put in the origin instead
* of a true coordinate on the face.
* This just puts a point 1.0f infront of the view. */
add_v3_v3v3(co, origin, ray);
}
-
+
return f;
}
@@ -1295,35 +1287,35 @@ static int knife_sample_screen_density(knifetool_opdata *kcd, float radius)
BMFace *f;
int is_space;
float co[3], cageco[3], sco[3];
-
+
f = knife_find_closest_face(kcd, co, cageco, &is_space);
-
+
if (f && !is_space) {
ListBase *lst;
Ref *ref;
float dis;
int c = 0;
-
+
knife_project_v3(kcd, cageco, sco);
-
+
lst = knife_get_face_kedges(kcd, f);
for (ref = lst->first; ref; ref = ref->next) {
KnifeEdge *kfe = ref->ref;
int i;
-
+
for (i = 0; i < 2; i++) {
KnifeVert *kfv = i ? kfe->v2 : kfe->v1;
-
+
knife_project_v3(kcd, kfv->cageco, kfv->sco);
-
+
dis = len_v2v2(kfv->sco, sco);
if (dis < radius) {
if (kcd->vc.rv3d->rflag & RV3D_CLIPPING) {
float vec[3];
-
+
copy_v3_v3(vec, kfv->cageco);
mul_m4_v3(kcd->vc.obedit->obmat, vec);
-
+
if (ED_view3d_clipping_test(kcd->vc.rv3d, vec, TRUE) == 0) {
c++;
}
@@ -1334,10 +1326,10 @@ static int knife_sample_screen_density(knifetool_opdata *kcd, float radius)
}
}
}
-
+
return c;
}
-
+
return 0;
}
@@ -1346,9 +1338,9 @@ static int knife_sample_screen_density(knifetool_opdata *kcd, float radius)
static float knife_snap_size(knifetool_opdata *kcd, float maxsize)
{
float density = (float)knife_sample_screen_density(kcd, maxsize * 2.0f);
-
+
density = MAX2(density, 1);
-
+
return MIN2(maxsize / (density * 0.5f), maxsize);
}
@@ -1357,32 +1349,32 @@ static KnifeEdge *knife_find_closest_edge(knifetool_opdata *kcd, float p[3], flo
{
BMFace *f;
float co[3], cageco[3], sco[3], maxdist = knife_snap_size(kcd, kcd->ethresh);
-
+
if (kcd->ignore_vert_snapping)
maxdist *= 0.5;
f = knife_find_closest_face(kcd, co, cageco, NULL);
*is_space = !f;
-
+
/* set p to co, in case we don't find anything, means a face cut */
copy_v3_v3(p, co);
copy_v3_v3(cagep, cageco);
-
- kcd->curbmface = f;
-
+
+ kcd->cur.bmface = f;
+
if (f) {
KnifeEdge *cure = NULL;
ListBase *lst;
Ref *ref;
float dis, curdis = FLT_MAX;
-
+
knife_project_v3(kcd, cageco, sco);
-
+
/* look through all edges associated with this face */
lst = knife_get_face_kedges(kcd, f);
for (ref = lst->first; ref; ref = ref->next) {
KnifeEdge *kfe = ref->ref;
-
+
/* project edge vertices into screen space */
knife_project_v3(kcd, kfe->v1->cageco, kfe->v1->sco);
knife_project_v3(kcd, kfe->v2->cageco, kfe->v2->sco);
@@ -1392,12 +1384,12 @@ static KnifeEdge *knife_find_closest_edge(knifetool_opdata *kcd, float p[3], flo
if (kcd->vc.rv3d->rflag & RV3D_CLIPPING) {
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) {
cure = kfe;
curdis = dis;
@@ -1409,10 +1401,10 @@ static KnifeEdge *knife_find_closest_edge(knifetool_opdata *kcd, float p[3], flo
}
}
}
-
+
if (fptr)
*fptr = f;
-
+
if (cure && p) {
if (!kcd->ignore_edge_snapping || !(cure->e)) {
if (kcd->snap_midpoints) {
@@ -1421,7 +1413,7 @@ static KnifeEdge *knife_find_closest_edge(knifetool_opdata *kcd, float p[3], flo
}
else {
float d;
-
+
closest_to_line_segment_v3(cagep, cageco, cure->v1->cageco, cure->v2->cageco);
d = len_v3v3(cagep, cure->v1->cageco) / len_v3v3(cure->v1->cageco, cure->v2->cageco);
interp_v3_v3v3(p, cure->v1->co, cure->v2->co, d);
@@ -1431,58 +1423,59 @@ static KnifeEdge *knife_find_closest_edge(knifetool_opdata *kcd, float p[3], flo
return NULL;
}
}
-
+
return cure;
}
-
+
if (fptr)
*fptr = NULL;
-
+
return NULL;
}
/* find a vertex near the mouse cursor, if it exists */
-static KnifeVert *knife_find_closest_vert(knifetool_opdata *kcd, float p[3], float cagep[3], BMFace **fptr, int *is_space)
+static KnifeVert *knife_find_closest_vert(knifetool_opdata *kcd, float p[3], float cagep[3], BMFace **fptr,
+ int *is_space)
{
BMFace *f;
float co[3], cageco[3], sco[3], maxdist = knife_snap_size(kcd, kcd->vthresh);
-
+
if (kcd->ignore_vert_snapping)
maxdist *= 0.5;
-
+
f = knife_find_closest_face(kcd, co, cageco, is_space);
-
+
/* set p to co, in case we don't find anything, means a face cut */
copy_v3_v3(p, co);
copy_v3_v3(cagep, p);
- kcd->curbmface = f;
-
+ kcd->cur.bmface = f;
+
if (f) {
ListBase *lst;
Ref *ref;
KnifeVert *curv = NULL;
float dis, curdis = FLT_MAX;
-
+
knife_project_v3(kcd, cageco, sco);
-
+
lst = knife_get_face_kedges(kcd, f);
for (ref = lst->first; ref; ref = ref->next) {
KnifeEdge *kfe = ref->ref;
int i;
-
+
for (i = 0; i < 2; i++) {
KnifeVert *kfv = i ? kfe->v2 : kfe->v1;
-
+
knife_project_v3(kcd, kfv->cageco, kfv->sco);
-
+
dis = len_v2v2(kfv->sco, sco);
if (dis < curdis && dis < maxdist) {
if (kcd->vc.rv3d->rflag & RV3D_CLIPPING) {
float vec[3];
-
+
copy_v3_v3(vec, kfv->cageco);
mul_m4_v3(kcd->vc.obedit->obmat, vec);
-
+
if (ED_view3d_clipping_test(kcd->vc.rv3d, vec, TRUE) == 0) {
curv = kfv;
curdis = dis;
@@ -1495,29 +1488,29 @@ static KnifeVert *knife_find_closest_vert(knifetool_opdata *kcd, float p[3], flo
}
}
}
-
+
if (!kcd->ignore_vert_snapping || !(curv && curv->v)) {
if (fptr)
*fptr = f;
-
+
if (curv && p) {
copy_v3_v3(p, curv->co);
copy_v3_v3(cagep, curv->cageco);
}
-
+
return curv;
}
else {
if (fptr)
*fptr = f;
-
+
return NULL;
}
}
-
+
if (fptr)
*fptr = NULL;
-
+
return NULL;
}
@@ -1526,30 +1519,30 @@ static void knife_snap_angle(knifetool_opdata *kcd)
int dx, dy;
float w, abs_tan;
- dx = kcd->vc.mval[0] - kcd->prevmval[0];
- dy = kcd->vc.mval[1] - kcd->prevmval[1];
+ dx = kcd->vc.mval[0] - kcd->prev.mval[0];
+ dy = kcd->vc.mval[1] - kcd->prev.mval[1];
if (dx == 0 || dy == 0)
return;
w = (float)dy / (float)dx;
abs_tan = fabsf(w);
- if (abs_tan <= 0.4142f) { /* tan(22.5 degrees) = 0.4142 */
+ if (abs_tan <= 0.4142f) { /* tan(22.5 degrees) = 0.4142 */
kcd->angle_snapping = ANGLE_0;
- kcd->vc.mval[1] = kcd->prevmval[1];
+ kcd->vc.mval[1] = kcd->prev.mval[1];
}
else if (abs_tan < 2.4142f) { /* tan(67.5 degrees) = 2.4142 */
if (w > 0) {
kcd->angle_snapping = ANGLE_45;
- kcd->vc.mval[1] = kcd->prevmval[1] + dx;
+ kcd->vc.mval[1] = kcd->prev.mval[1] + dx;
}
else {
kcd->angle_snapping = ANGLE_135;
- kcd->vc.mval[1] = kcd->prevmval[1] - dx;
+ kcd->vc.mval[1] = kcd->prev.mval[1] - dx;
}
}
else {
kcd->angle_snapping = ANGLE_90;
- kcd->vc.mval[0] = kcd->prevmval[0];
+ kcd->vc.mval[0] = kcd->prev.mval[0];
}
}
@@ -1559,24 +1552,26 @@ static int knife_update_active(knifetool_opdata *kcd)
if (kcd->angle_snapping != ANGLE_FREE && kcd->mode == MODE_DRAGGING)
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);
+ knife_pos_data_clear(&kcd->cur);
+ kcd->cur.mval[0] = kcd->vc.mval[0];
+ kcd->cur.mval[1] = kcd->vc.mval[1];
+
+ kcd->cur.vert = knife_find_closest_vert(kcd, kcd->cur.co, kcd->cur.cage, &kcd->cur.bmface, &kcd->cur.is_space);
+ if (!kcd->cur.vert) {
+ kcd->cur.edge = knife_find_closest_edge(kcd, kcd->cur.co, kcd->cur.cage, &kcd->cur.bmface, &kcd->cur.is_space);
}
-
- /* if no hits are found this would normally default to (0,0,0) so instead
+
+ /* 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 */
- if (kcd->curvert == NULL && kcd->curedge == NULL) {
- float origin[3], ray[3], co[3];
+ * but theres no guarantee (0, 0, 0) has any geometry either - campbell */
+ if (kcd->cur.vert == NULL && kcd->cur.edge == NULL) {
+ float origin[3], ray[3], co[3];
- knife_input_ray_cast(kcd, kcd->vc.mval, origin, ray);
- add_v3_v3v3(co, origin, ray);
+ knife_input_ray_cast(kcd, kcd->vc.mval, origin, ray);
+ add_v3_v3v3(co, origin, ray);
- closest_to_line_v3(kcd->vertcage, kcd->prevcage, co, origin);
+ closest_to_line_v3(kcd->cur.cage, kcd->prev.cage, co, origin);
}
if (kcd->mode == MODE_DRAGGING) {
@@ -1585,13 +1580,16 @@ static int knife_update_active(knifetool_opdata *kcd)
return 1;
}
-#define MARK 4
-#define DEL 8
-#define VERT_ON_EDGE 16
-#define VERT_ORIG 32
-#define FACE_FLIP 64
-#define BOUNDARY 128
-#define FACE_NEW 256
+#define MARK 4
+#define DEL 8
+#define VERT_ON_EDGE 16
+#define VERT_ORIG 32
+#define FACE_FLIP 64
+#define BOUNDARY 128
+#define FACE_NEW 256
+
+#define SCANFILL_CUTS 0
+#if SCANFILL_CUTS
typedef struct facenet_entry {
struct facenet_entry *next, *prev;
@@ -1601,9 +1599,9 @@ typedef struct facenet_entry {
static void rnd_offset_co(float co[3], float scale)
{
int i;
-
+
for (i = 0; i < 3; i++) {
- co[i] += (BLI_drand()-0.5)*scale;
+ co[i] += (BLI_drand() - 0.5) * scale;
}
}
@@ -1619,66 +1617,66 @@ static void remerge_faces(knifetool_opdata *kcd)
BLI_array_declare(faces);
BMOperator bmop;
int idx;
-
+
BMO_op_initf(bm, &bmop, "beautify_fill faces=%ff constrain_edges=%fe", FACE_NEW, BOUNDARY);
-
+
BMO_op_exec(bm, &bmop);
- BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", FACE_NEW, BM_FACE);
-
+ BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", BM_FACE, FACE_NEW);
+
BMO_op_finish(bm, &bmop);
-
+
BLI_smallhash_init(visit);
BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
BMIter eiter;
BMEdge *e;
BMFace *f2;
-
+
if (!BMO_elem_flag_test(bm, f, FACE_NEW))
continue;
-
+
if (BLI_smallhash_haskey(visit, (intptr_t)f))
continue;
-
+
BLI_array_empty(stack);
BLI_array_empty(faces);
BLI_array_append(stack, f);
BLI_smallhash_insert(visit, (intptr_t)f, NULL);
-
+
do {
f2 = BLI_array_pop(stack);
-
+
BLI_array_append(faces, f2);
-
+
BM_ITER(e, &eiter, bm, BM_EDGES_OF_FACE, f2) {
BMIter fiter;
BMFace *f3;
-
+
if (BMO_elem_flag_test(bm, e, BOUNDARY))
continue;
-
+
BM_ITER(f3, &fiter, bm, BM_FACES_OF_EDGE, e) {
if (!BMO_elem_flag_test(bm, f3, FACE_NEW))
continue;
if (BLI_smallhash_haskey(visit, (intptr_t)f3))
continue;
-
+
BLI_smallhash_insert(visit, (intptr_t)f3, NULL);
BLI_array_append(stack, f3);
}
- }
+ }
} while (BLI_array_count(stack) > 0);
-
+
if (BLI_array_count(faces) > 0) {
idx = BM_elem_index_get(faces[0]);
-
+
f2 = BM_faces_join(bm, faces, BLI_array_count(faces));
if (f2) {
BMO_elem_flag_enable(bm, f2, FACE_NEW);
- BM_elem_index_set(f2, idx); /* set_dirty! */ /* BMESH_TODO, check if this is valid or not */
+ BM_elem_index_set(f2, idx); /* set_dirty! *//* BMESH_TODO, check if this is valid or not */
}
}
}
- /* BMESH_TODO, check if the code above validates the indicies */
+ /* BMESH_TODO, check if the code above validates the indices */
/* bm->elem_index_dirty &= ~BM_FACE; */
bm->elem_index_dirty |= BM_FACE;
@@ -1704,7 +1702,7 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
MemArena *arena = BLI_memarena_new(1 << 16, "knifenet_fill_faces");
SmallHash shash;
int i, j, k = 0, totface = bm->totface;
-
+
BMO_push(bm, NULL);
bmesh_edit_begin(bm, BMO_OP_FLAG_UNTAN_MULTIRES);
@@ -1716,12 +1714,12 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
i++;
}
bm->elem_index_dirty &= ~BM_FACE;
-
+
BM_ITER(e, &bmiter, bm, BM_EDGES_OF_MESH, NULL) {
BMO_elem_flag_enable(bm, e, BOUNDARY);
}
- /* turn knife verts into real verts, as necassary */
+ /* turn knife verts into real verts, as necessary */
BLI_mempool_iternew(kcd->kverts, &iter);
for (kfv = BLI_mempool_iterstep(&iter); kfv; kfv = BLI_mempool_iterstep(&iter)) {
if (!kfv->v) {
@@ -1737,9 +1735,9 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
BMO_elem_flag_enable(bm, kfv->v, MARK);
}
-
+
/* we want to only do changed faces. first, go over new edges and add to
- * face net lists.*/
+ * face net lists.*/
i = j = k = 0;
BLI_mempool_iternew(kcd->kedges, &iter);
for (kfe = BLI_mempool_iterstep(&iter); kfe; kfe = BLI_mempool_iterstep(&iter)) {
@@ -1753,9 +1751,9 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
kfe->oe = kfe->e;
continue;
}
-
+
j++;
-
+
if (kfe->e) {
kfe->oe = kfe->e;
@@ -1763,37 +1761,37 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
BMO_elem_flag_disable(bm, kfe->e, BOUNDARY);
kfe->e = NULL;
}
-
+
kfe->e = BM_edge_create(bm, kfe->v1->v, kfe->v2->v, NULL, TRUE);
BMO_elem_flag_enable(bm, kfe->e, BOUNDARY);
-
+
for (ref = kfe->faces.first; ref; ref = ref->next) {
f = ref->ref;
-
+
entry = BLI_memarena_alloc(arena, sizeof(*entry));
entry->kfe = kfe;
BLI_addtail(face_nets + BM_elem_index_get(f), entry);
}
}
-
+
/* go over original edges, and add to faces with new geometry */
BLI_mempool_iternew(kcd->kedges, &iter);
for (kfe = BLI_mempool_iterstep(&iter); kfe; kfe = BLI_mempool_iterstep(&iter)) {
Ref *ref;
-
+
if (!kfe->v1 || !kfe->v2 || kfe->v1->inspace || kfe->v2->inspace)
continue;
if (!(kfe->oe && kfe->v1->v == kfe->oe->v1 && kfe->v2->v == kfe->oe->v2))
continue;
-
+
k++;
-
+
BMO_elem_flag_enable(bm, kfe->e, BOUNDARY);
kfe->oe = kfe->e;
-
+
for (ref = kfe->faces.first; ref; ref = ref->next) {
f = ref->ref;
-
+
if (face_nets[BM_elem_index_get(f)].first) {
entry = BLI_memarena_alloc(arena, sizeof(*entry));
entry->kfe = kfe;
@@ -1801,22 +1799,22 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
}
}
}
-
+
for (i = 0; i < totface; i++) {
SmallHash *hash = &shash;
ScanFillFace *efa;
ScanFillVert *eve, *lasteve;
int j;
float rndscale = FLT_EPSILON * 25;
-
+
f = faces[i];
BLI_smallhash_init(hash);
-
+
if (face_nets[i].first)
BMO_elem_flag_enable(bm, f, DEL);
-
+
BLI_begin_edgefill();
-
+
for (entry = face_nets[i].first; entry; entry = entry->next) {
if (!BLI_smallhash_haskey(hash, (intptr_t)entry->kfe->v1)) {
eve = BLI_addfillvert(entry->kfe->v1->v->co);
@@ -1832,27 +1830,27 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
rnd_offset_co(eve->co, rndscale);
eve->tmp.p = entry->kfe->v2->v;
BLI_smallhash_insert(hash, (intptr_t)entry->kfe->v2, eve);
- }
+ }
}
-
+
for (j = 0, entry = face_nets[i].first; entry; entry = entry->next, j++) {
lasteve = BLI_smallhash_lookup(hash, (intptr_t)entry->kfe->v1);
eve = BLI_smallhash_lookup(hash, (intptr_t)entry->kfe->v2);
-
+
eve->poly_nr++;
lasteve->poly_nr++;
}
-
+
for (j = 0, entry = face_nets[i].first; entry; entry = entry->next, j++) {
lasteve = BLI_smallhash_lookup(hash, (intptr_t)entry->kfe->v1);
eve = BLI_smallhash_lookup(hash, (intptr_t)entry->kfe->v2);
-
+
if (eve->poly_nr > 1 && lasteve->poly_nr > 1) {
ScanFillEdge *eed;
eed = BLI_addfilledge(lasteve, eve);
if (entry->kfe->oe)
eed->f = FILLBOUNDARY; /* mark as original boundary edge */
-
+
BMO_elem_flag_disable(bm, entry->kfe->e->v1, DEL);
BMO_elem_flag_disable(bm, entry->kfe->e->v2, DEL);
}
@@ -1863,45 +1861,45 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
BLI_remlink(&fillvertbase, eve);
}
}
-
+
BLI_edgefill(0);
-
+
for (efa = fillfacebase.first; efa; efa = efa->next) {
BMVert *v1 = efa->v3->tmp.p, *v2 = efa->v2->tmp.p, *v3 = efa->v1->tmp.p;
BMFace *f2;
BMLoop *l_iter;
BMVert *verts[3] = {v1, v2, v3};
-
+
if (v1 == v2 || v2 == v3 || v1 == v3)
continue;
if (BM_face_exists(bm, verts, 3, &f2))
continue;
-
+
f2 = BM_face_create_quad_tri(bm,
- v1, v2, v3, NULL,
- NULL, FALSE);
+ v1, v2, v3, NULL,
+ NULL, FALSE);
BMO_elem_flag_enable(bm, f2, FACE_NEW);
-
+
l_iter = BM_FACE_FIRST_LOOP(f2);
do {
BMO_elem_flag_disable(bm, l_iter->e, DEL);
} while ((l_iter = l_iter->next) != BM_FACE_FIRST_LOOP(f2));
-
+
BMO_elem_flag_disable(bm, f2, DEL);
- BM_elem_index_set(f2, i); /* set_dirty! */ /* note, not 100% sure this is dirty? need to check */
+ BM_elem_index_set(f2, i); /* set_dirty! *//* note, not 100% sure this is dirty? need to check */
BM_face_normal_update(bm, f2);
if (dot_v3v3(f->no, f2->no) < 0.0f) {
BM_face_normal_flip(bm, f2);
}
}
-
+
BLI_end_edgefill();
BLI_smallhash_release(hash);
}
bm->elem_index_dirty |= BM_FACE;
-
+
/* interpolate customdata */
BM_ITER(f, &bmiter, bm, BM_FACES_OF_MESH, NULL) {
BMLoop *l1;
@@ -1910,14 +1908,14 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
if (!BMO_elem_flag_test(bm, f, FACE_NEW))
continue;
-
+
f2 = faces[BM_elem_index_get(f)];
if (BM_elem_index_get(f) < 0 || BM_elem_index_get(f) >= totface) {
fprintf(stderr, "%s: face index out of range! (bmesh internal error)\n", __func__);
}
BM_elem_attrs_copy(bm, bm, f2, f);
-
+
BM_ITER(l1, &liter1, bm, BM_LOOPS_OF_FACE, f) {
BM_loop_interp_from_face(bm, l1, f2, TRUE, TRUE);
}
@@ -1936,22 +1934,674 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
if (faces)
MEM_freeN(faces);
BLI_memarena_free(arena);
-
+
BMO_error_clear(bm); /* remerge_faces sometimes raises errors, so make sure to clear them */
bmesh_edit_end(bm, BMO_OP_FLAG_UNTAN_MULTIRES);
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;
+ if (kfe->v1->v || kfe->v2->v)
+ 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, *kfvother;
+ 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;
+ kfvother = NULL;
+ for (r = hole->first; r; r = r->next) {
+ kfe = r->ref;
+ he[i] = kfe;
+ if (kfvother == NULL) {
+ kfv = kfe->v1;
+ }
+ else {
+ kfv = kfvother;
+ BLI_assert(kfv == kfe->v1 || kfv == kfe->v2);
+ }
+ 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;
+ kfvother = (kfe->v1 == kfv) ? kfe->v2 : kfe->v1;
+ 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 not to the same vertex as the first diagonal. */
+ 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++) {
+ if (m == 1 && j == bestj[0])
+ continue;
+ 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) {
+ BLI_assert(besti[0] != besti[1] && bestj[0] != bestj[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;
+ float mid[3];
+ BMIter iter;
+ int v1inside, v2inside;
+
+ if (!f)
+ return FALSE;
+
+ 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,
+ * but it is expensive and maybe a bit buggy, so use a simple
+ * "is the midpoint in the face" test */
+ mid_v3_v3v3(mid, kfe->v1->co, kfe->v2->co);
+ return BM_face_point_inside_test(bm, f, mid);
+ }
+ 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);
+ lnew = NULL;
+ if (nco == 0) {
+ *newface = BM_face_split(bm, f, v1, v2, &lnew, NULL, TRUE);
+ }
+ else {
+ fnew = BM_face_split_n(bm, f, v1, v2, cos, nco, &lnew, NULL);
+ *newface = fnew;
+
+ if (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);
+ if (!fnew) {
+ BLI_assert("!knife failed chain cut");
+ return;
+ }
+
+ /* 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);
+ if (!fnew) {
+ BLI_assert(!"knife failed hole cut");
+ return;
+ }
+ 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 except in funny edge cases */
+ return;
+ }
+ 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);
-
- DAG_id_tag_update(kcd->ob->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, kcd->ob->data);
+#else
+ knife_make_cuts(kcd);
+#endif
+
+ EDBM_update_generic(C, kcd->em, TRUE);
}
/* copied from paint_image.c */
@@ -1971,29 +2621,29 @@ static int project_knife_view_clip(View3D *v3d, RegionView3D *rv3d, float *clips
static void knife_recalc_projmat(knifetool_opdata *kcd)
{
ARegion *ar = CTX_wm_region(kcd->C);
-
+
if (!ar)
return;
-
+
invert_m4_m4(kcd->ob->imat, kcd->ob->obmat);
ED_view3d_ob_project_mat_get(ar->regiondata, kcd->ob, kcd->projmat);
//mult_m4_m4m4(kcd->projmat, kcd->vc.rv3d->winmat, kcd->vc.rv3d->viewmat);
-
+
kcd->is_ortho = project_knife_view_clip(kcd->vc.v3d, kcd->vc.rv3d,
&kcd->clipsta, &kcd->clipend);
}
/* called when modal loop selection is done... */
-static void knifetool_exit (bContext *UNUSED(C), wmOperator *op)
+static void knifetool_exit(bContext *UNUSED(C), wmOperator *op)
{
knifetool_opdata *kcd = op->customdata;
-
+
if (!kcd)
return;
-
+
/* deactivate the extra drawing stuff in 3D-View */
ED_region_draw_cb_exit(kcd->ar->type, kcd->draw_handle);
-
+
/* free the custom data */
BLI_mempool_destroy(kcd->refs);
BLI_mempool_destroy(kcd->kverts);
@@ -2002,10 +2652,10 @@ static void knifetool_exit (bContext *UNUSED(C), wmOperator *op)
BLI_ghash_free(kcd->origedgemap, NULL, NULL);
BLI_ghash_free(kcd->origvertmap, NULL, NULL);
BLI_ghash_free(kcd->kedgefacemap, NULL, NULL);
-
+
BMBVH_FreeBVH(kcd->bmbvh);
BLI_memarena_free(kcd->arena);
-
+
/* tag for redraw */
ED_region_tag_redraw(kcd->ar);
@@ -2017,14 +2667,13 @@ static void knifetool_exit (bContext *UNUSED(C), wmOperator *op)
op->customdata = NULL;
}
-static void cage_mapped_verts_callback(void *userData, int index, float *co,
- float *UNUSED(no_f), short *UNUSED(no_s))
+static void cage_mapped_verts_callback(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
{
void **data = userData;
BMEditMesh *em = data[0];
float (*cagecos)[3] = data[1];
SmallHash *hash = data[2];
-
+
if (index >= 0 && index < em->bm->totvert && !BLI_smallhash_haskey(hash, index)) {
BLI_smallhash_insert(hash, index, NULL);
copy_v3_v3(cagecos[index], co);
@@ -2040,10 +2689,10 @@ static int knifetool_init(bContext *C, wmOperator *op, int UNUSED(do_cut))
DerivedMesh *cage, *final;
SmallHash shash;
void *data[3];
-
+
/* alloc new customdata */
kcd = op->customdata = MEM_callocN(sizeof(knifetool_opdata), "knifetool Modal Op Data");
-
+
/* assign the drawing handle for drawing preview line... */
kcd->ob = obedit;
kcd->ar = CTX_wm_region(C);
@@ -2051,7 +2700,7 @@ static int knifetool_init(bContext *C, wmOperator *op, int UNUSED(do_cut))
kcd->draw_handle = ED_region_draw_cb_activate(kcd->ar->type, knifetool_draw, kcd, REGION_DRAW_POST_VIEW);
em_setup_viewcontext(C, &kcd->vc);
- kcd->em = ((Mesh *)kcd->ob->data)->edit_btmesh;
+ kcd->em = BMEdit_FromObject(kcd->ob);
BM_mesh_elem_index_ensure(kcd->em->bm, BM_VERT);
@@ -2060,26 +2709,26 @@ static int knifetool_init(bContext *C, wmOperator *op, int UNUSED(do_cut))
data[0] = kcd->em;
data[1] = kcd->cagecos;
data[2] = &shash;
-
+
BLI_smallhash_init(&shash);
cage->foreachMappedVert(cage, cage_mapped_verts_callback, data);
BLI_smallhash_release(&shash);
-
- kcd->bmbvh = BMBVH_NewBVH(kcd->em, BMBVH_USE_CAGE|BMBVH_RETURN_ORIG, scene, obedit);
+
+ kcd->bmbvh = BMBVH_NewBVH(kcd->em, BMBVH_USE_CAGE | BMBVH_RETURN_ORIG, scene, obedit);
kcd->arena = BLI_memarena_new(1 << 15, "knife");
kcd->vthresh = KMAXDIST - 1;
kcd->ethresh = KMAXDIST;
-
+
kcd->extend = 1;
-
+
knife_recalc_projmat(kcd);
-
+
ED_region_tag_redraw(kcd->ar);
-
- kcd->refs = BLI_mempool_create(sizeof(Ref), 1, 2048, FALSE, FALSE);
- kcd->kverts = BLI_mempool_create(sizeof(KnifeVert), 1, 512, FALSE, TRUE);
- kcd->kedges = BLI_mempool_create(sizeof(KnifeEdge), 1, 512, FALSE, TRUE);
-
+
+ kcd->refs = BLI_mempool_create(sizeof(Ref), 1, 2048, 0);
+ kcd->kverts = BLI_mempool_create(sizeof(KnifeVert), 1, 512, BLI_MEMPOOL_ALLOW_ITER);
+ kcd->kedges = BLI_mempool_create(sizeof(KnifeEdge), 1, 512, BLI_MEMPOOL_ALLOW_ITER);
+
kcd->origedgemap = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "knife origedgemap");
kcd->origvertmap = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "knife origvertmap");
kcd->kedgefacemap = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "knife origvertmap");
@@ -2087,17 +2736,20 @@ static int knifetool_init(bContext *C, wmOperator *op, int UNUSED(do_cut))
/* cut all the way through the mesh if use_occlude_geometry button not pushed */
kcd->cut_through = !(kcd->vc.v3d->flag & V3D_ZBUF_SELECT);
+ knife_pos_data_clear(&kcd->cur);
+ knife_pos_data_clear(&kcd->prev);
+
return 1;
}
-static int knifetool_cancel (bContext *C, wmOperator *op)
+static int knifetool_cancel(bContext *C, wmOperator *op)
{
/* this is just a wrapper around exit() */
knifetool_exit(C, op);
return OPERATOR_CANCELLED;
}
-static int knifetool_invoke (bContext *C, wmOperator *op, wmEvent *evt)
+static int knifetool_invoke(bContext *C, wmOperator *op, wmEvent *evt)
{
knifetool_opdata *kcd;
@@ -2105,14 +2757,18 @@ static int knifetool_invoke (bContext *C, wmOperator *op, wmEvent *evt)
if (!knifetool_init(C, op, 0))
return OPERATOR_CANCELLED;
-
+
/* add a modal handler for this operator - handles loop selection */
WM_event_add_modal_handler(C, op);
kcd = op->customdata;
kcd->vc.mval[0] = evt->mval[0];
kcd->vc.mval[1] = evt->mval[1];
-
+
+ ED_area_headerprint(CTX_wm_area(C),
+ "LMB: define cut lines, Return or RMB: confirm, E: new cut, Ctrl: midpoint snap, "
+ "Shift: ignore snap, C: angle constrain, Turn off limit selection to visibile: cut through");
+
return OPERATOR_RUNNING_MODAL;
}
@@ -2128,30 +2784,30 @@ 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", ""},
- {KNF_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
- {KNF_MODAL_MIDPOINT_ON, "SNAP_MIDPOINTS_ON", 0, "Snap To Midpoints On", ""},
- {KNF_MODAL_MIDPOINT_OFF, "SNAP_MIDPOINTS_OFF", 0, "Snap To Midpoints Off", ""},
- {KNF_MODEL_IGNORE_SNAP_ON, "IGNORE_SNAP_ON", 0, "Ignore Snapping On", ""},
- {KNF_MODEL_IGNORE_SNAP_OFF, "IGNORE_SNAP_OFF", 0, "Ignore Snapping Off", ""},
- {KNF_MODAL_ANGLE_SNAP_TOGGLE, "ANGLE_SNAP_TOGGLE", 0, "Toggle Angle Snapping", ""},
- {KNF_MODAL_NEW_CUT, "NEW_CUT", 0, "End Current Cut", ""},
- {KNF_MODAL_ADD_CUT, "ADD_CUT", 0, "Add Cut", ""},
-
- {0, NULL, 0, NULL, NULL}};
-
+ {KNF_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
+ {KNF_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
+ {KNF_MODAL_MIDPOINT_ON, "SNAP_MIDPOINTS_ON", 0, "Snap To Midpoints On", ""},
+ {KNF_MODAL_MIDPOINT_OFF, "SNAP_MIDPOINTS_OFF", 0, "Snap To Midpoints Off", ""},
+ {KNF_MODEL_IGNORE_SNAP_ON, "IGNORE_SNAP_ON", 0, "Ignore Snapping On", ""},
+ {KNF_MODEL_IGNORE_SNAP_OFF, "IGNORE_SNAP_OFF", 0, "Ignore Snapping Off", ""},
+ {KNF_MODAL_ANGLE_SNAP_TOGGLE, "ANGLE_SNAP_TOGGLE", 0, "Toggle Angle Snapping", ""},
+ {KNF_MODAL_NEW_CUT, "NEW_CUT", 0, "End Current Cut", ""},
+ {KNF_MODAL_ADD_CUT, "ADD_CUT", 0, "Add Cut", ""},
+ {0, NULL, 0, NULL, NULL}};
+
wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "Knife Tool Modal Map");
-
+
/* this function is called for each spacetype, only needs to add map once */
- if (keymap) return NULL;
-
+ if (keymap)
+ return NULL;
+
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);
@@ -2167,51 +2823,54 @@ wmKeyMap* knifetool_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_add_item(keymap, LEFTSHIFTKEY, KM_RELEASE, KM_ANY, 0, KNF_MODEL_IGNORE_SNAP_OFF);
WM_modalkeymap_add_item(keymap, RIGHTSHIFTKEY, KM_PRESS, KM_ANY, 0, KNF_MODEL_IGNORE_SNAP_ON);
WM_modalkeymap_add_item(keymap, RIGHTSHIFTKEY, KM_RELEASE, KM_ANY, 0, KNF_MODEL_IGNORE_SNAP_OFF);
-
+
WM_modalkeymap_add_item(keymap, CKEY, KM_PRESS, 0, 0, KNF_MODAL_ANGLE_SNAP_TOGGLE);
WM_modalkeymap_assign(keymap, "MESH_OT_knifetool");
-
+
return keymap;
}
-static int knifetool_modal (bContext *C, wmOperator *op, wmEvent *event)
+static int knifetool_modal(bContext *C, wmOperator *op, wmEvent *event)
{
Object *obedit;
knifetool_opdata *kcd = op->customdata;
-
+
if (!C) {
return OPERATOR_FINISHED;
}
-
+
obedit = CTX_data_edit_object(C);
- if (!obedit || obedit->type != OB_MESH || ((Mesh *)obedit->data)->edit_btmesh != kcd->em) {
+ if (!obedit || obedit->type != OB_MESH || BMEdit_FromObject(obedit) != kcd->em) {
knifetool_exit(C, op);
+ ED_area_headerprint(CTX_wm_area(C), NULL);
return OPERATOR_FINISHED;
}
view3d_operator_needs_opengl(C);
-
+
if (kcd->mode == MODE_PANNING)
kcd->mode = kcd->prevmode;
-
+
/* handle modal keymap */
if (event->type == EVT_MODAL_MAP) {
switch (event->val) {
case KNF_MODAL_CANCEL:
/* finish */
ED_region_tag_redraw(kcd->ar);
-
+
knifetool_exit(C, op);
-
+ ED_area_headerprint(CTX_wm_area(C), NULL);
+
return OPERATOR_CANCELLED;
case KNF_MODAL_CONFIRM:
/* finish */
ED_region_tag_redraw(kcd->ar);
-
+
knifetool_finish(C, op);
knifetool_exit(C, op);
-
+ ED_area_headerprint(CTX_wm_area(C), NULL);
+
return OPERATOR_FINISHED;
case KNF_MODAL_MIDPOINT_ON:
kcd->snap_midpoints = 1;
@@ -2257,10 +2916,10 @@ static int knifetool_modal (bContext *C, wmOperator *op, wmEvent *event)
knife_start_cut(kcd);
kcd->mode = MODE_DRAGGING;
}
-
+
ED_region_tag_redraw(kcd->ar);
break;
- }
+ }
}
else { /* non-modal-mapped events */
switch (event->type) {
@@ -2276,41 +2935,41 @@ static int knifetool_modal (bContext *C, wmOperator *op, wmEvent *event)
else {
kcd->mode = kcd->prevmode;
}
-
+
ED_region_tag_redraw(kcd->ar);
return OPERATOR_PASS_THROUGH;
-
- case MOUSEMOVE: /* mouse moved somewhere to select another loop */
+
+ case MOUSEMOVE: /* mouse moved somewhere to select another loop */
if (kcd->mode != MODE_PANNING) {
knife_recalc_projmat(kcd);
kcd->vc.mval[0] = event->mval[0];
kcd->vc.mval[1] = event->mval[1];
-
- if (knife_update_active(kcd))
+
+ if (knife_update_active(kcd))
ED_region_tag_redraw(kcd->ar);
}
-
+
break;
}
}
-
+
/* keep going until the user confirms */
return OPERATOR_RUNNING_MODAL;
}
-void MESH_OT_knifetool (wmOperatorType *ot)
+void MESH_OT_knifetool(wmOperatorType *ot)
{
/* description */
ot->name = "Knife Topology Tool";
ot->idname = "MESH_OT_knifetool";
ot->description = "Cut new topology";
-
+
/* callbacks */
ot->invoke = knifetool_invoke;
ot->modal = knifetool_modal;
ot->cancel = knifetool_cancel;
ot->poll = ED_operator_editmesh_view3d;
-
+
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
}
diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c
index 30dedf10618..90698a79c25 100644
--- a/source/blender/editors/mesh/loopcut.c
+++ b/source/blender/editors/mesh/editmesh_loopcut.c
@@ -24,11 +24,10 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/editors/mesh/loopcut.c
+/** \file blender/editors/mesh/editmesh_loopcut.c
* \ingroup edmesh
*/
-
#include <float.h>
#define _USE_MATH_DEFINES
#include <math.h>
@@ -88,8 +87,8 @@
/* struct for properties used while drawing */
typedef struct tringselOpData {
- ARegion *ar; /* region that ringsel was activated in */
- void *draw_handle; /* for drawing preview loop */
+ ARegion *ar; /* region that ringsel was activated in */
+ void *draw_handle; /* for drawing preview loop */
float (*edges)[2][3];
int totedge;
@@ -113,7 +112,7 @@ static void ringsel_draw(const bContext *C, ARegion *UNUSED(ar), void *arg)
int i;
if (lcd->totedge > 0) {
- if(v3d && v3d->zbuf)
+ if (v3d && v3d->zbuf)
glDisable(GL_DEPTH_TEST);
glPushMatrix();
@@ -121,20 +120,20 @@ static void ringsel_draw(const bContext *C, ARegion *UNUSED(ar), void *arg)
glColor3ub(255, 0, 255);
glBegin(GL_LINES);
- for (i=0; i<lcd->totedge; i++) {
+ for (i = 0; i < lcd->totedge; i++) {
glVertex3fv(lcd->edges[i][0]);
glVertex3fv(lcd->edges[i][1]);
}
glEnd();
glPopMatrix();
- if(v3d && v3d->zbuf)
+ if (v3d && v3d->zbuf)
glEnable(GL_DEPTH_TEST);
}
}
-/*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])
{
@@ -144,7 +143,7 @@ static void edgering_find_order(BMEditMesh *em, BMEdge *lasteed, BMEdge *eed,
l = eed->l;
- /*find correct order for v[1]*/
+ /* find correct order for v[1] */
if (!(BM_edge_in_face(l->f, eed) && BM_edge_in_face(l->f, lasteed))) {
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_LOOP, l) {
if (BM_edge_in_face(l->f, eed) && BM_edge_in_face(l->f, lasteed))
@@ -152,7 +151,7 @@ static void edgering_find_order(BMEditMesh *em, BMEdge *lasteed, BMEdge *eed,
}
}
- /*this should never happen*/
+ /* this should never happen */
if (!l) {
v[0][0] = eed->v1;
v[0][1] = eed->v2;
@@ -161,7 +160,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;
@@ -170,7 +169,8 @@ static void edgering_find_order(BMEditMesh *em, BMEdge *lasteed, BMEdge *eed,
if (l2->v == lastv1) {
v[0][0] = eed->v1;
v[0][1] = eed->v2;
- } else {
+ }
+ else {
v[0][0] = eed->v2;
v[0][1] = eed->v1;
}
@@ -186,7 +186,7 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select)
float (*edges)[2][3] = NULL;
BLI_array_declare(edges);
float co[2][3];
- int i, tot=0;
+ int i, tot = 0;
memset(v, 0, sizeof(v));
@@ -205,11 +205,12 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select)
if (select) {
BMW_init(&walker, em->bm, BMW_EDGERING,
- BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_FLAG_TEST_HIDDEN,
BMW_NIL_LAY);
eed = BMW_begin(&walker, startedge);
- for (; eed; eed=BMW_step(&walker)) {
+ for ( ; eed; eed = BMW_step(&walker)) {
BM_elem_select_set(em->bm, eed, TRUE);
}
BMW_end(&walker);
@@ -218,17 +219,19 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select)
}
BMW_init(&walker, em->bm, BMW_EDGERING,
- BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_FLAG_TEST_HIDDEN,
BMW_NIL_LAY);
eed = startedge = BMW_begin(&walker, startedge);
lastv1 = NULL;
- for (lasteed=NULL; eed; eed=BMW_step(&walker)) {
+ for (lasteed = NULL; eed; eed = BMW_step(&walker)) {
if (lasteed) {
if (lastv1) {
v[1][0] = v[0][0];
v[1][1] = v[0][1];
- } else {
+ }
+ else {
v[1][0] = lasteed->v1;
v[1][1] = lasteed->v2;
lastv1 = lasteed->v1;
@@ -237,16 +240,17 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select)
edgering_find_order(em, lasteed, eed, lastv1, v);
lastv1 = v[0][0];
- for(i=1;i<=previewlines;i++){
- co[0][0] = (v[0][1]->co[0] - v[0][0]->co[0])*(i/((float)previewlines+1))+v[0][0]->co[0];
- co[0][1] = (v[0][1]->co[1] - v[0][0]->co[1])*(i/((float)previewlines+1))+v[0][0]->co[1];
- co[0][2] = (v[0][1]->co[2] - v[0][0]->co[2])*(i/((float)previewlines+1))+v[0][0]->co[2];
+ BLI_array_growitems(edges, previewlines);
- co[1][0] = (v[1][1]->co[0] - v[1][0]->co[0])*(i/((float)previewlines+1))+v[1][0]->co[0];
- co[1][1] = (v[1][1]->co[1] - v[1][0]->co[1])*(i/((float)previewlines+1))+v[1][0]->co[1];
- co[1][2] = (v[1][1]->co[2] - v[1][0]->co[2])*(i/((float)previewlines+1))+v[1][0]->co[2];
+ for (i = 1; i <= previewlines; i++) {
+ co[0][0] = (v[0][1]->co[0] - v[0][0]->co[0]) * (i / ((float)previewlines + 1)) + v[0][0]->co[0];
+ co[0][1] = (v[0][1]->co[1] - v[0][0]->co[1]) * (i / ((float)previewlines + 1)) + v[0][0]->co[1];
+ co[0][2] = (v[0][1]->co[2] - v[0][0]->co[2]) * (i / ((float)previewlines + 1)) + v[0][0]->co[2];
+
+ co[1][0] = (v[1][1]->co[0] - v[1][0]->co[0]) * (i / ((float)previewlines + 1)) + v[1][0]->co[0];
+ co[1][1] = (v[1][1]->co[1] - v[1][0]->co[1]) * (i / ((float)previewlines + 1)) + v[1][0]->co[1];
+ co[1][2] = (v[1][1]->co[2] - v[1][0]->co[2]) * (i / ((float)previewlines + 1)) + v[1][0]->co[2];
- BLI_array_growone(edges);
copy_v3_v3(edges[tot][0], co[0]);
copy_v3_v3(edges[tot][1], co[1]);
tot++;
@@ -261,19 +265,20 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select)
edgering_find_order(em, lasteed, startedge, lastv1, v);
- for(i=1;i<=previewlines;i++){
+ BLI_array_growitems(edges, previewlines);
+
+ for (i = 1; i <= previewlines; i++) {
if (!v[0][0] || !v[0][1] || !v[1][0] || !v[1][1])
continue;
- co[0][0] = (v[0][1]->co[0] - v[0][0]->co[0])*(i/((float)previewlines+1))+v[0][0]->co[0];
- co[0][1] = (v[0][1]->co[1] - v[0][0]->co[1])*(i/((float)previewlines+1))+v[0][0]->co[1];
- co[0][2] = (v[0][1]->co[2] - v[0][0]->co[2])*(i/((float)previewlines+1))+v[0][0]->co[2];
+ co[0][0] = (v[0][1]->co[0] - v[0][0]->co[0]) * (i / ((float)previewlines + 1)) + v[0][0]->co[0];
+ co[0][1] = (v[0][1]->co[1] - v[0][0]->co[1]) * (i / ((float)previewlines + 1)) + v[0][0]->co[1];
+ co[0][2] = (v[0][1]->co[2] - v[0][0]->co[2]) * (i / ((float)previewlines + 1)) + v[0][0]->co[2];
- co[1][0] = (v[1][1]->co[0] - v[1][0]->co[0])*(i/((float)previewlines+1))+v[1][0]->co[0];
- co[1][1] = (v[1][1]->co[1] - v[1][0]->co[1])*(i/((float)previewlines+1))+v[1][0]->co[1];
- co[1][2] = (v[1][1]->co[2] - v[1][0]->co[2])*(i/((float)previewlines+1))+v[1][0]->co[2];
+ co[1][0] = (v[1][1]->co[0] - v[1][0]->co[0]) * (i / ((float)previewlines + 1)) + v[1][0]->co[0];
+ co[1][1] = (v[1][1]->co[1] - v[1][0]->co[1]) * (i / ((float)previewlines + 1)) + v[1][0]->co[1];
+ co[1][2] = (v[1][1]->co[2] - v[1][0]->co[2]) * (i / ((float)previewlines + 1)) + v[1][0]->co[2];
- BLI_array_growone(edges);
copy_v3_v3(edges[tot][0], co[0]);
copy_v3_v3(edges[tot][1], co[1]);
tot++;
@@ -289,9 +294,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;
}
@@ -299,8 +304,8 @@ static void ringsel_find_edge(tringselOpData *lcd, int cuts)
static void ringsel_finish(bContext *C, wmOperator *op)
{
- tringselOpData *lcd= op->customdata;
- int cuts= RNA_int_get(op->ptr, "number_cuts");
+ tringselOpData *lcd = op->customdata;
+ int cuts = RNA_int_get(op->ptr, "number_cuts");
if (lcd->eed) {
BMEditMesh *em = lcd->em;
@@ -318,27 +323,27 @@ static void ringsel_finish(bContext *C, wmOperator *op)
em->selectmode = SCE_SELECT_EDGE;
else
em->selectmode &= ~SCE_SELECT_FACE;
- CTX_data_tool_settings(C)->selectmode= em->selectmode;
+ CTX_data_tool_settings(C)->selectmode = em->selectmode;
EDBM_selectmode_set(em);
- WM_event_add_notifier(C, NC_SCENE|ND_TOOLSETTINGS, CTX_data_scene(C));
+ WM_event_add_notifier(C, NC_SCENE | ND_TOOLSETTINGS, CTX_data_scene(C));
- WM_event_add_notifier(C, NC_SCENE|ND_TOOLSETTINGS, CTX_data_scene(C));
+ WM_event_add_notifier(C, NC_SCENE | ND_TOOLSETTINGS, CTX_data_scene(C));
}
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT|ND_DATA, lcd->ob->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT | ND_DATA, lcd->ob->data);
DAG_id_tag_update(lcd->ob->data, 0);
}
else {
/* sets as active, useful for other tools */
- if(em->selectmode & SCE_SELECT_VERTEX)
- EDBM_store_selection(em, lcd->eed->v1); /* low priority TODO, get vertrex close to mouse */
- if(em->selectmode & SCE_SELECT_EDGE)
- EDBM_store_selection(em, lcd->eed);
+ if (em->selectmode & SCE_SELECT_VERTEX)
+ EDBM_editselection_store(em, &lcd->eed->v1->head); /* low priority TODO, get vertrex close to mouse */
+ if (em->selectmode & SCE_SELECT_EDGE)
+ EDBM_editselection_store(em, &lcd->eed->head);
EDBM_selectmode_flush(lcd->em);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, lcd->ob->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, lcd->ob->data);
}
}
}
@@ -346,7 +351,7 @@ static void ringsel_finish(bContext *C, wmOperator *op)
/* called when modal loop selection is done... */
static void ringsel_exit(bContext *UNUSED(C), wmOperator *op)
{
- tringselOpData *lcd= op->customdata;
+ tringselOpData *lcd = op->customdata;
/* deactivate the extra drawing stuff in 3D-View */
ED_region_draw_cb_exit(lcd->ar->type, lcd->draw_handle);
@@ -358,22 +363,22 @@ static void ringsel_exit(bContext *UNUSED(C), wmOperator *op)
/* free the custom data */
MEM_freeN(lcd);
- op->customdata= NULL;
+ op->customdata = NULL;
}
/* called when modal loop selection gets set up... */
-static int ringsel_init (bContext *C, wmOperator *op, int do_cut)
+static int ringsel_init(bContext *C, wmOperator *op, int do_cut)
{
tringselOpData *lcd;
/* alloc new customdata */
- lcd= op->customdata= MEM_callocN(sizeof(tringselOpData), "ringsel Modal Op Data");
+ lcd = op->customdata = MEM_callocN(sizeof(tringselOpData), "ringsel Modal Op Data");
/* assign the drawing handle for drawing preview line... */
- lcd->ar= CTX_wm_region(C);
- lcd->draw_handle= ED_region_draw_cb_activate(lcd->ar->type, ringsel_draw, lcd, REGION_DRAW_POST_VIEW);
+ lcd->ar = CTX_wm_region(C);
+ lcd->draw_handle = ED_region_draw_cb_activate(lcd->ar->type, ringsel_draw, lcd, REGION_DRAW_POST_VIEW);
lcd->ob = CTX_data_edit_object(C);
- lcd->em= ((Mesh *)lcd->ob->data)->edit_btmesh;
+ lcd->em = BMEdit_FromObject(lcd->ob);
lcd->extend = do_cut ? 0 : RNA_boolean_get(op->ptr, "extend");
lcd->do_cut = do_cut;
@@ -388,21 +393,21 @@ static int ringsel_init (bContext *C, wmOperator *op, int do_cut)
return 1;
}
-static int ringcut_cancel (bContext *C, wmOperator *op)
+static int ringcut_cancel(bContext *C, wmOperator *op)
{
/* this is just a wrapper around exit() */
ringsel_exit(C, op);
return OPERATOR_CANCELLED;
}
-static int ringcut_invoke (bContext *C, wmOperator *op, wmEvent *evt)
+static int ringcut_invoke(bContext *C, wmOperator *op, wmEvent *evt)
{
- Object *obedit= CTX_data_edit_object(C);
+ Object *obedit = CTX_data_edit_object(C);
tringselOpData *lcd;
BMEdge *edge;
int dist = 75;
- if(modifiers_isDeformedByLattice(obedit) || modifiers_isDeformedByArmature(obedit))
+ if (modifiers_isDeformedByLattice(obedit) || modifiers_isDeformedByArmature(obedit))
BKE_report(op->reports, RPT_WARNING, "Loop cut doesn't work well on deformed edit mesh display");
view3d_operator_needs_opengl(C);
@@ -417,7 +422,7 @@ static int ringcut_invoke (bContext *C, wmOperator *op, wmEvent *evt)
lcd->vc.mval[0] = evt->mval[0];
lcd->vc.mval[1] = evt->mval[1];
- edge = EDBM_findnearestedge(&lcd->vc, &dist);
+ edge = EDBM_edge_find_nearest(&lcd->vc, &dist);
if (edge != lcd->eed) {
lcd->eed = edge;
ringsel_find_edge(lcd, 1);
@@ -427,10 +432,11 @@ static int ringcut_invoke (bContext *C, wmOperator *op, wmEvent *evt)
return OPERATOR_RUNNING_MODAL;
}
-static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
+static int loopcut_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- int cuts= RNA_int_get(op->ptr,"number_cuts");
- tringselOpData *lcd= op->customdata;
+ int cuts = RNA_int_get(op->ptr, "number_cuts");
+ tringselOpData *lcd = op->customdata;
+ int show_cuts = 0;
view3d_operator_needs_opengl(C);
@@ -475,8 +481,9 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
break;
cuts++;
- RNA_int_set(op->ptr,"number_cuts",cuts);
+ RNA_int_set(op->ptr, "number_cuts", cuts);
ringsel_find_edge(lcd, cuts);
+ show_cuts = TRUE;
ED_region_tag_redraw(lcd->ar);
break;
@@ -486,9 +493,10 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
if (event->val == KM_RELEASE)
break;
- cuts=MAX2(cuts-1,1);
- RNA_int_set(op->ptr,"number_cuts",cuts);
+ 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;
@@ -498,7 +506,7 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
lcd->vc.mval[0] = event->mval[0];
lcd->vc.mval[1] = event->mval[1];
- edge = EDBM_findnearestedge(&lcd->vc, &dist);
+ edge = EDBM_edge_find_nearest(&lcd->vc, &dist);
if (edge != lcd->eed) {
lcd->eed = edge;
@@ -511,22 +519,28 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
}
/* using the keyboard to input the number of cuts */
- if (event->val==KM_PRESS) {
+ 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);
+ 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;
}
@@ -534,41 +548,45 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
/* for bmesh this tool is in bmesh_select.c */
#if 0
-void MESH_OT_edgering_select (wmOperatorType *ot)
+void MESH_OT_edgering_select(wmOperatorType *ot)
{
/* description */
- ot->name= "Edge Ring Select";
- ot->idname= "MESH_OT_edgering_select";
- ot->description= "Select an edge ring";
+ ot->name = "Edge Ring Select";
+ ot->idname = "MESH_OT_edgering_select";
+ ot->description = "Select an edge ring";
/* callbacks */
- ot->invoke= ringsel_invoke;
- ot->poll= ED_operator_editmesh_region_view3d;
+ ot->invoke = ringsel_invoke;
+ ot->poll = ED_operator_editmesh_region_view3d;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection");
}
#endif
-void MESH_OT_loopcut (wmOperatorType *ot)
+void MESH_OT_loopcut(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* description */
- ot->name= "Loop Cut";
- ot->idname= "MESH_OT_loopcut";
- ot->description= "Add a new loop between existing loops";
+ ot->name = "Loop Cut";
+ ot->idname = "MESH_OT_loopcut";
+ ot->description = "Add a new loop between existing loops";
/* callbacks */
- ot->invoke= ringcut_invoke;
- ot->modal= loopcut_modal;
- ot->cancel= ringcut_cancel;
- ot->poll= ED_operator_editmesh_region_view3d;
+ ot->invoke = ringcut_invoke;
+ ot->modal = loopcut_modal;
+ ot->cancel = ringcut_cancel;
+ ot->poll = ED_operator_editmesh_region_view3d;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
/* properties */
- RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of Cuts", "", 1, 10);
+ prop = RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of Cuts", "", 1, 10);
+ /* avoid re-using last var because it can cause _very_ high poly meshes and annoy users (or worse crash) */
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
diff --git a/source/blender/editors/mesh/bmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index fd881919519..355d64a9fe1 100644
--- a/source/blender/editors/mesh/bmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -25,6 +25,10 @@
* ***** END GPL LICENSE BLOCK *****
*/
+/** \file blender/editors/mesh/editmesh_select.c
+ * \ingroup edmesh
+ */
+
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
@@ -79,7 +83,7 @@ void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, int extend)
}
}
- EDBM_CacheMirrorVerts(em, TRUE);
+ EDBM_verts_mirror_cache_begin(em, TRUE);
if (!extend)
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
@@ -88,13 +92,13 @@ void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, int extend)
if (!BM_elem_flag_test(v1, BM_ELEM_TAG) || BM_elem_flag_test(v1, BM_ELEM_HIDDEN))
continue;
- v2 = EDBM_GetMirrorVert(em, v1);
+ v2 = EDBM_verts_mirror_get(em, v1);
if (v2 && !BM_elem_flag_test(v2, BM_ELEM_HIDDEN)) {
BM_elem_select_set(em->bm, v2, TRUE);
}
}
- EDBM_EndMirrorCache(em);
+ EDBM_verts_mirror_cache_end(em);
}
void EDBM_automerge(Scene *scene, Object *obedit, int update)
@@ -104,20 +108,21 @@ void EDBM_automerge(Scene *scene, Object *obedit, int update)
if ((scene->toolsettings->automerge) &&
(obedit && obedit->type == OB_MESH))
{
- em = ((Mesh *)obedit->data)->edit_btmesh;
+ em = BMEdit_FromObject(obedit);
if (!em)
return;
BMO_op_callf(em->bm, "automerge verts=%hv dist=%f", BM_ELEM_SELECT, scene->toolsettings->doublimit);
if (update) {
DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
+ BMEdit_RecalcTessellation(em);
}
}
}
/* ****************************** SELECTION ROUTINES **************** */
-unsigned int bm_solidoffs = 0, bm_wireoffs = 0, bm_vertoffs = 0; /* set in drawobject.c ... for colorindices */
+unsigned int bm_solidoffs = 0, bm_wireoffs = 0, bm_vertoffs = 0; /* set in drawobject.c ... for colorindices */
/* facilities for border select and circle select */
static char *selbuf = NULL;
@@ -170,7 +175,7 @@ static void draw_triangulated(int mcords[][2], short tot)
/* reads rect, and builds selection array for quick lookup */
/* returns if all is OK */
-int EDBM_init_backbuf_border(ViewContext *vc, short xmin, short ymin, short xmax, short ymax)
+int EDBM_backbuf_border_init(ViewContext *vc, short xmin, short ymin, short xmax, short ymax)
{
struct ImBuf *buf;
unsigned int *dr;
@@ -189,7 +194,7 @@ int EDBM_init_backbuf_border(ViewContext *vc, short xmin, short ymin, short xmax
/* build selection lookup */
selbuf = MEM_callocN(bm_vertoffs + 1, "selbuf");
- a = (xmax - xmin + 1) * (ymax-ymin + 1);
+ a = (xmax - xmin + 1) * (ymax - ymin + 1);
while (a--) {
if (*dr > 0 && *dr <= bm_vertoffs)
selbuf[*dr] = 1;
@@ -199,7 +204,7 @@ int EDBM_init_backbuf_border(ViewContext *vc, short xmin, short ymin, short xmax
return 1;
}
-int EDBM_check_backbuf(unsigned int index)
+int EDBM_backbuf_check(unsigned int index)
{
if (selbuf == NULL) return 1;
if (index > 0 && index <= bm_vertoffs)
@@ -207,19 +212,19 @@ int EDBM_check_backbuf(unsigned int index)
return 0;
}
-void EDBM_free_backbuf(void)
+void EDBM_backbuf_free(void)
{
if (selbuf) MEM_freeN(selbuf);
selbuf = NULL;
}
/* mcords is a polygon mask
- - 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)
+ * - grab backbuffer,
+ * - draw with black in backbuffer,
+ * - grab again and compare
+ * returns 'OK'
+ */
+int EDBM_backbuf_border_mask_init(ViewContext *vc, int mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax)
{
unsigned int *dr, *drm;
struct ImBuf *buf, *bufmask;
@@ -227,9 +232,9 @@ int EDBM_mask_init_backbuf_border(ViewContext *vc, int mcords[][2], short tot, s
/* method in use for face selecting too */
if (vc->obedit == NULL) {
- if (paint_facesel_test(vc->obact));
- else if (paint_vertsel_test(vc->obact));
- else return 0;
+ if (!(paint_facesel_test(vc->obact) || paint_vertsel_test(vc->obact))) {
+ return 0;
+ }
}
else if (vc->v3d->drawtype < OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT) == 0) {
return 0;
@@ -256,7 +261,7 @@ int EDBM_mask_init_backbuf_border(ViewContext *vc, int mcords[][2], short tot, s
}
glEnd();
- glFinish(); /* to be sure readpixels sees mask */
+ glFinish(); /* to be sure readpixels sees mask */
/* grab mask */
bufmask = view3d_read_backbuf(vc, xmin, ymin, xmax, ymax);
@@ -280,7 +285,7 @@ int EDBM_mask_init_backbuf_border(ViewContext *vc, int mcords[][2], short tot, s
}
/* circle shaped sample area */
-int EDBM_init_backbuf_circle(ViewContext *vc, short xs, short ys, short rads)
+int EDBM_backbuf_circle_init(ViewContext *vc, short xs, short ys, short rads)
{
struct ImBuf *buf;
unsigned int *dr;
@@ -289,9 +294,9 @@ int EDBM_init_backbuf_circle(ViewContext *vc, short xs, short ys, short rads)
/* method in use for face selecting too */
if (vc->obedit == NULL) {
- if (paint_facesel_test(vc->obact));
- else if (paint_vertsel_test(vc->obact));
- else return 0;
+ if (!(paint_facesel_test(vc->obact) || paint_vertsel_test(vc->obact))) {
+ return 0;
+ }
}
else if (vc->v3d->drawtype < OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT) == 0) return 0;
@@ -333,12 +338,14 @@ 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);
+ 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,11 +372,11 @@ 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 0, unselected vertice are given the bias
+ * 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
*/
-BMVert *EDBM_findnearestvert(ViewContext *vc, int *dist, short sel, short strict)
+BMVert *EDBM_vert_find_nearest(ViewContext *vc, int *dist, short sel, short strict)
{
if (vc->v3d->drawtype > OB_WIRE && (vc->v3d->flag & V3D_ZBUF_SELECT)) {
int distance;
@@ -487,7 +494,7 @@ static void findnearestedge__doClosest(void *userData, BMEdge *eed, int x0, int
}
}
}
-BMEdge *EDBM_findnearestedge(ViewContext *vc, int *dist)
+BMEdge *EDBM_edge_find_nearest(ViewContext *vc, int *dist)
{
if (vc->v3d->drawtype > OB_WIRE && (vc->v3d->flag & V3D_ZBUF_SELECT)) {
@@ -497,7 +504,7 @@ BMEdge *EDBM_findnearestedge(ViewContext *vc, int *dist)
view3d_validate_backbuf(vc);
- index = view3d_sample_backbuf_rect(vc, vc->mval, 50, bm_solidoffs, bm_wireoffs, &distance,0, NULL, NULL);
+ index = view3d_sample_backbuf_rect(vc, vc->mval, 50, bm_solidoffs, bm_wireoffs, &distance, 0, NULL, NULL);
eed = BM_edge_at_index(vc->em->bm, index - 1);
if (eed && distance < *dist) {
@@ -560,7 +567,7 @@ static void findnearestface__doClosest(void *userData, BMFace *efa, int x, int y
}
}
-BMFace *EDBM_findnearestface(ViewContext *vc, int *dist)
+BMFace *EDBM_face_find_nearest(ViewContext *vc, int *dist)
{
if (vc->v3d->drawtype > OB_WIRE && (vc->v3d->flag & V3D_ZBUF_SELECT)) {
@@ -577,12 +584,12 @@ BMFace *EDBM_findnearestface(ViewContext *vc, int *dist)
data.mval[0] = vc->mval[0];
data.mval[1] = vc->mval[1];
- data.dist = 0x7FFF; /* largest short */
+ data.dist = 0x7FFF; /* largest short */
data.toFace = efa;
mesh_foreachScreenFace(vc, findnearestface__getDistance, &data);
- if (vc->em->selectmode == SCE_SELECT_FACE || data.dist < *dist) { /* only faces, no dist check */
+ if (vc->em->selectmode == SCE_SELECT_FACE || data.dist < *dist) { /* only faces, no dist check */
*dist = data.dist;
return efa;
}
@@ -626,10 +633,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;
@@ -643,13 +650,13 @@ static int unified_findnearest(ViewContext *vc, BMVert **r_eve, BMEdge **r_eed,
view3d_validate_backbuf(vc);
if (em->selectmode & SCE_SELECT_VERTEX)
- *r_eve = EDBM_findnearestvert(vc, &dist, BM_ELEM_SELECT, 0);
+ *r_eve = EDBM_vert_find_nearest(vc, &dist, BM_ELEM_SELECT, 0);
if (em->selectmode & SCE_SELECT_FACE)
- *r_efa = EDBM_findnearestface(vc, &dist);
+ *r_efa = EDBM_face_find_nearest(vc, &dist);
- dist-= 20; /* since edges select lines, we give dots advantage of 20 pix */
+ dist -= 20; /* since edges select lines, we give dots advantage of 20 pix */
if (em->selectmode & SCE_SELECT_EDGE)
- *r_eed = EDBM_findnearestedge(vc, &dist);
+ *r_eed = EDBM_edge_find_nearest(vc, &dist);
/* return only one of 3 pointers, for frontbuffer redraws */
if (*r_eed) {
@@ -692,16 +699,15 @@ static EnumPropertyItem prop_similar_types[] = {
static int similar_face_select_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(ob);
BMOperator bmop;
/* get the type from RNA */
int type = RNA_enum_get(op->ptr, "type");
-
- float thresh = CTX_data_tool_settings(C)->select_thresh;
+ float thresh = RNA_float_get(op->ptr, "threshold");
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
- EDBM_InitOpf(em, &bmop, op, "similarfaces faces=%hf type=%i thresh=%f", BM_ELEM_SELECT, type, thresh);
+ EDBM_op_init(em, &bmop, op, "similarfaces faces=%hf type=%i thresh=%f", BM_ELEM_SELECT, type, thresh);
/* execute the operator */
BMO_op_exec(em->bm, &bmop);
@@ -710,16 +716,14 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
/* select the output */
- BMO_slot_buffer_hflag_enable(em->bm, &bmop, "faceout", BM_ELEM_SELECT, BM_ALL, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, &bmop, "faceout", BM_ALL, BM_ELEM_SELECT, TRUE);
/* finish the operator */
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
- /* dependencies graph and notification stuff */
- DAG_id_tag_update(ob->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, ob->data);
+ EDBM_update_generic(C, em, FALSE);
/* we succeeded */
return OPERATOR_FINISHED;
@@ -733,16 +737,15 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
static int similar_edge_select_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(ob);
BMOperator bmop;
/* get the type from RNA */
int type = RNA_enum_get(op->ptr, "type");
-
- float thresh = CTX_data_tool_settings(C)->select_thresh;
+ float thresh = RNA_float_get(op->ptr, "threshold");
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
- EDBM_InitOpf(em, &bmop, op, "similaredges edges=%he type=%i thresh=%f", BM_ELEM_SELECT, type, thresh);
+ EDBM_op_init(em, &bmop, op, "similaredges edges=%he type=%i thresh=%f", BM_ELEM_SELECT, type, thresh);
/* execute the operator */
BMO_op_exec(em->bm, &bmop);
@@ -751,17 +754,15 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
/* select the output */
- BMO_slot_buffer_hflag_enable(em->bm, &bmop, "edgeout", BM_ELEM_SELECT, BM_ALL, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, &bmop, "edgeout", BM_ALL, BM_ELEM_SELECT, TRUE);
EDBM_selectmode_flush(em);
/* finish the operator */
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
- /* dependencies graph and notification stuff */
- DAG_id_tag_update(ob->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, ob->data);
+ EDBM_update_generic(C, em, FALSE);
/* we succeeded */
return OPERATOR_FINISHED;
@@ -770,24 +771,22 @@ 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);
- BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(ob);
BMOperator bmop;
/* get the type from RNA */
int type = RNA_enum_get(op->ptr, "type");
- float thresh = CTX_data_tool_settings(C)->select_thresh;
+ float thresh = RNA_float_get(op->ptr, "threshold");
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
- EDBM_InitOpf(em, &bmop, op, "similarverts verts=%hv type=%i thresh=%f", BM_ELEM_SELECT, type, thresh);
+ EDBM_op_init(em, &bmop, op, "similarverts verts=%hv type=%i thresh=%f", BM_ELEM_SELECT, type, thresh);
/* execute the operator */
BMO_op_exec(em->bm, &bmop);
@@ -796,33 +795,38 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
/* select the output */
- BMO_slot_buffer_hflag_enable(em->bm, &bmop, "vertout", BM_ELEM_SELECT, BM_ALL, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, &bmop, "vertout", BM_ALL, BM_ELEM_SELECT, TRUE);
/* finish the operator */
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
EDBM_selectmode_flush(em);
- /* dependencies graph and notification stuff */
- DAG_id_tag_update(ob->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, ob->data);
+ EDBM_update_generic(C, em, FALSE);
/* we succeeded */
return OPERATOR_FINISHED;
}
-static int select_similar_exec(bContext *C, wmOperator *op)
+static int edbm_select_similar_exec(bContext *C, wmOperator *op)
{
+ ToolSettings *ts = CTX_data_tool_settings(C);
+ PropertyRNA *prop = RNA_struct_find_property(op->ptr, "threshold");
+
int type = RNA_enum_get(op->ptr, "type");
- if (type < 100)
- return similar_vert_select_exec(C, op);
- else if (type < 200)
- return similar_edge_select_exec(C, op);
- else
- return similar_face_select_exec(C, op);
+ if (!RNA_property_is_set(op->ptr, prop)) {
+ RNA_property_float_set(op->ptr, prop, ts->select_thresh);
+ }
+ else {
+ ts->select_thresh = RNA_property_float_get(op->ptr, prop);
+ }
+
+ if (type < 100) return similar_vert_select_exec(C, op);
+ else if (type < 200) return similar_edge_select_exec(C, op);
+ else return similar_face_select_exec(C, op);
}
static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop),
@@ -833,7 +837,7 @@ static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *UNUS
if (obedit && obedit->type == OB_MESH) {
EnumPropertyItem *item = NULL;
int a, totitem = 0;
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
if (em->selectmode & SCE_SELECT_VERTEX) {
for (a = SIMVERT_NORMAL; a < SIMEDGE_LENGTH; a++) {
@@ -870,16 +874,18 @@ void MESH_OT_select_similar(wmOperatorType *ot)
/* api callbacks */
ot->invoke = WM_menu_invoke;
- ot->exec = select_similar_exec;
+ ot->exec = edbm_select_similar_exec;
ot->poll = ED_operator_editmesh;
ot->description = "Select similar vertices, edges or faces by property types";
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
prop = ot->prop = RNA_def_enum(ot->srna, "type", prop_similar_types, SIMVERT_NORMAL, "Type", "");
RNA_def_enum_funcs(prop, select_similar_type_itemf);
+
+ RNA_def_float(ot->srna, "threshold", 0.0, 0.0, 1.0, "Threshold", "", 0.01, 1.0);
}
/* ***************************************************** */
@@ -893,10 +899,11 @@ static void walker_select(BMEditMesh *em, int walkercode, void *start, int selec
BMWalker walker;
BMW_init(&walker, bm, walkercode,
- BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_FLAG_TEST_HIDDEN,
BMW_NIL_LAY);
ele = BMW_begin(&walker, start);
- for ( ; ele; ele = BMW_step(&walker)) {
+ for (; ele; ele = BMW_step(&walker)) {
if (!select) {
BM_select_history_remove(bm, ele);
}
@@ -905,10 +912,10 @@ static void walker_select(BMEditMesh *em, int walkercode, void *start, int selec
BMW_end(&walker);
}
-static int loop_multiselect(bContext *C, wmOperator *op)
+static int edbm_loop_multiselect_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMEdge *eed;
BMEdge **edarray;
int edindex;
@@ -918,7 +925,7 @@ static int loop_multiselect(bContext *C, wmOperator *op)
int totedgesel = 0;
for (eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
- eed; eed = BM_iter_step(&iter)) {
+ eed; eed = BM_iter_step(&iter)) {
if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
totedgesel++;
@@ -926,7 +933,7 @@ static int loop_multiselect(bContext *C, wmOperator *op)
}
- edarray = MEM_mallocN(sizeof(BMEdge *)*totedgesel,"edge array");
+ edarray = MEM_mallocN(sizeof(BMEdge *) * totedgesel, "edge array");
edindex = 0;
for (eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
@@ -957,7 +964,7 @@ static int loop_multiselect(bContext *C, wmOperator *op)
MEM_freeN(edarray);
// if (EM_texFaceCheck())
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
return OPERATOR_FINISHED;
}
@@ -969,12 +976,12 @@ void MESH_OT_loop_multi_select(wmOperatorType *ot)
ot->idname = "MESH_OT_loop_multi_select";
/* api callbacks */
- ot->exec = loop_multiselect;
+ ot->exec = edbm_loop_multiselect_exec;
ot->poll = ED_operator_editmesh;
ot->description = "Select a loop of connected edges by connection type";
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "ring", 0, "Ring", "");
@@ -1002,7 +1009,7 @@ static void mouse_mesh_loop(bContext *C, int mval[2], short extend, short ring)
/* no afterqueue (yet), so we check it now, otherwise the bm_xxxofs indices are bad */
view3d_validate_backbuf(&vc);
- eed = EDBM_findnearestedge(&vc, &dist);
+ eed = EDBM_edge_find_nearest(&vc, &dist);
if (eed) {
if (extend == 0) {
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
@@ -1041,27 +1048,27 @@ static void mouse_mesh_loop(bContext *C, int mval[2], short extend, short ring)
/* TODO: would be nice if the edge vertex chosen here
* was the one closer to the selection pointer, instead
* of arbitrarily selecting the first one */
- EDBM_store_selection(em, eed->v1);
+ EDBM_editselection_store(em, &eed->v1->head);
}
else if (em->selectmode & SCE_SELECT_EDGE) {
- EDBM_store_selection(em, eed);
+ EDBM_editselection_store(em, &eed->head);
}
/* TODO: would be nice if the nearest face that
* belongs to the selected edge could be set to
* active here in face select mode */
}
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, vc.obedit);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit);
}
}
-static int mesh_select_loop_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int edbm_select_loop_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
view3d_operator_needs_opengl(C);
mouse_mesh_loop(C, event->mval, RNA_boolean_get(op->ptr, "extend"),
- RNA_boolean_get(op->ptr, "ring"));
+ RNA_boolean_get(op->ptr, "ring"));
/* cannot do tweaks for as long this keymap is after transform map */
return OPERATOR_FINISHED;
@@ -1075,7 +1082,7 @@ void MESH_OT_loop_select(wmOperatorType *ot)
ot->description = "Select a loop";
/* api callbacks */
- ot->invoke = mesh_select_loop_invoke;
+ ot->invoke = edbm_select_loop_invoke;
ot->poll = ED_operator_editmesh_region_view3d;
ot->description = "Select a loop of connected edges";
@@ -1087,7 +1094,7 @@ void MESH_OT_loop_select(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "ring", 0, "Select Ring", "Select ring");
}
-void MESH_OT_edgering_select (wmOperatorType *ot)
+void MESH_OT_edgering_select(wmOperatorType *ot)
{
/* description */
ot->name = "Edge Ring Select";
@@ -1095,7 +1102,7 @@ void MESH_OT_edgering_select (wmOperatorType *ot)
ot->description = "Select an edge ring";
/* callbacks */
- ot->invoke = mesh_select_loop_invoke;
+ ot->invoke = edbm_select_loop_invoke;
ot->poll = ED_operator_editmesh_region_view3d;
/* flags */
@@ -1128,15 +1135,15 @@ static float edgetag_cut_cost(BMEditMesh *UNUSED(em), BMEdge *e1, BMEdge *e2, BM
}
static void edgetag_add_adjacent(BMEditMesh *em, SmallHash *visithash, Heap *heap, int mednum, int vertnum,
- int *nedges, int *edges, int *prevedge, float *cost)
+ int *nedges, int *edges, int *prevedge, float *cost)
{
- BMEdge *e1 = EDBM_get_edge_for_index(em, mednum);
- BMVert *v = EDBM_get_vert_for_index(em, vertnum);
+ BMEdge *e1 = EDBM_edge_at_index(em, mednum);
+ BMVert *v = EDBM_vert_at_index(em, vertnum);
int startadj, endadj = nedges[vertnum + 1];
for (startadj = nedges[vertnum]; startadj < endadj; startadj++) {
int adjnum = edges[startadj];
- BMEdge *e2 = EDBM_get_edge_for_index(em, adjnum);
+ BMEdge *e2 = EDBM_edge_at_index(em, adjnum);
float newcost;
float cutcost;
@@ -1158,47 +1165,43 @@ static void edgetag_context_set(BMEditMesh *em, Scene *scene, BMEdge *e, int val
{
switch (scene->toolsettings->edge_mode) {
- case EDGE_MODE_SELECT:
- BM_elem_select_set(em->bm, e, val);
- break;
- case EDGE_MODE_TAG_SEAM:
- BM_elem_flag_set(e, BM_ELEM_SEAM, val);
- break;
- case EDGE_MODE_TAG_SHARP:
- BM_elem_flag_set(e, BM_ELEM_SMOOTH, !val);
- break;
- case EDGE_MODE_TAG_CREASE:
- {
- float *crease = CustomData_bmesh_get(&em->bm->edata, e->head.data, CD_CREASE);
-
- if (val) *crease = 1.0f;
- else *crease = 0.0f;
- break;
- }
- case EDGE_MODE_TAG_BEVEL:
- {
- float *bweight = CustomData_bmesh_get(&em->bm->edata, e->head.data, CD_BWEIGHT);
-
- if (val) *bweight = 1.0f;
- else *bweight = 0.0f;
- break;
- }
+ case EDGE_MODE_SELECT:
+ BM_elem_select_set(em->bm, e, val);
+ break;
+ case EDGE_MODE_TAG_SEAM:
+ BM_elem_flag_set(e, BM_ELEM_SEAM, val);
+ break;
+ case EDGE_MODE_TAG_SHARP:
+ BM_elem_flag_set(e, BM_ELEM_SMOOTH, !val);
+ break;
+ case EDGE_MODE_TAG_CREASE:
+ {
+ float *crease = CustomData_bmesh_get(&em->bm->edata, e->head.data, CD_CREASE);
+ *crease = (val) ? 1.0f : 0.0f;
+ break;
+ }
+ case EDGE_MODE_TAG_BEVEL:
+ {
+ float *bweight = CustomData_bmesh_get(&em->bm->edata, e->head.data, CD_BWEIGHT);
+ *bweight = (val) ? 1.0f : 0.0f;
+ break;
+ }
}
}
static int edgetag_context_check(Scene *scene, BMEditMesh *em, BMEdge *e)
{
switch (scene->toolsettings->edge_mode) {
- case EDGE_MODE_SELECT:
- return BM_elem_flag_test(e, BM_ELEM_SELECT) ? 1 : 0;
- case EDGE_MODE_TAG_SEAM:
- return BM_elem_flag_test(e, BM_ELEM_SEAM);
- case EDGE_MODE_TAG_SHARP:
- return !BM_elem_flag_test(e, BM_ELEM_SMOOTH);
- case EDGE_MODE_TAG_CREASE:
- return BM_elem_float_data_get(&em->bm->edata, e, CD_CREASE) ? 1 : 0;
- case EDGE_MODE_TAG_BEVEL:
- return BM_elem_float_data_get(&em->bm->edata, e, CD_BWEIGHT) ? 1 : 0;
+ case EDGE_MODE_SELECT:
+ return BM_elem_flag_test(e, BM_ELEM_SELECT) ? 1 : 0;
+ case EDGE_MODE_TAG_SEAM:
+ return BM_elem_flag_test(e, BM_ELEM_SEAM);
+ case EDGE_MODE_TAG_SHARP:
+ return !BM_elem_flag_test(e, BM_ELEM_SMOOTH);
+ case EDGE_MODE_TAG_CREASE:
+ return BM_elem_float_data_get(&em->bm->edata, e, CD_CREASE) ? 1 : 0;
+ case EDGE_MODE_TAG_BEVEL:
+ return BM_elem_float_data_get(&em->bm->edata, e, CD_BWEIGHT) ? 1 : 0;
}
return 0;
}
@@ -1218,7 +1221,8 @@ static int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, B
/* note, would pass BM_EDGE except we are looping over all edges anyway */
BM_mesh_elem_index_ensure(em->bm, BM_VERT /* | BM_EDGE */);
- BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
+ BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL)
+ {
e->oflags[0].f = 0; /* XXX, whats this for, BMESH_TODO, double check if this is needed */
if (BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
BLI_smallhash_insert(&visithash, (uintptr_t)e, NULL);
@@ -1262,7 +1266,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
@@ -1271,13 +1275,13 @@ 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++) {
int start = nedges[i], end = nedges[i + 1], cur;
for (cur = start; cur < end; cur++) {
- BMEdge *e = EDBM_get_edge_for_index(em, edges[cur]);
+ BMEdge *e = EDBM_edge_at_index(em, edges[cur]);
}
}
#endif
@@ -1286,12 +1290,12 @@ static int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, B
heap = BLI_heap_new();
BLI_heap_insert(heap, 0.0f, SET_INT_IN_POINTER(BM_elem_index_get(source)));
cost[BM_elem_index_get(source)] = 0.0f;
- EDBM_init_index_arrays(em, 1, 1, 0);
+ EDBM_index_arrays_init(em, 1, 1, 0);
targetnum = BM_elem_index_get(target);
while (!BLI_heap_empty(heap)) {
mednum = GET_INT_FROM_POINTER(BLI_heap_popmin(heap));
- e = EDBM_get_edge_for_index(em, mednum);
+ e = EDBM_edge_at_index(em, mednum);
if (mednum == targetnum)
break;
@@ -1312,7 +1316,7 @@ static int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, B
* if it is, the tags will be cleared instead of set. */
mednum = targetnum;
do {
- e = EDBM_get_edge_for_index(em, mednum);
+ e = EDBM_edge_at_index(em, mednum);
if (!edgetag_context_check(scene, em, e)) {
allseams = 0;
break;
@@ -1323,7 +1327,7 @@ static int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, B
/* Follow path back and source and add or remove tags */
mednum = targetnum;
do {
- e = EDBM_get_edge_for_index(em, mednum);
+ e = EDBM_edge_at_index(em, mednum);
if (allseams)
edgetag_context_set(em, scene, e, 0);
else
@@ -1332,7 +1336,7 @@ static int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, B
} while (mednum != -1);
}
- EDBM_free_index_arrays(em);
+ EDBM_index_arrays_free(em);
MEM_freeN(nedges);
MEM_freeN(edges);
MEM_freeN(prevedge);
@@ -1348,7 +1352,6 @@ static int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, B
/* since you want to create paths with multiple selects, it doesn't have extend option */
static void mouse_mesh_shortest_path(bContext *C, int mval[2])
{
- Object *ob = CTX_data_edit_object(C);
ViewContext vc;
BMEditMesh *em;
BMEdge *e;
@@ -1359,7 +1362,7 @@ static void mouse_mesh_shortest_path(bContext *C, int mval[2])
vc.mval[1] = mval[1];
em = vc.em;
- e = EDBM_findnearestedge(&vc, &dist);
+ e = EDBM_edge_find_nearest(&vc, &dist);
if (e) {
Mesh *me = vc.obedit->data;
int path = 0;
@@ -1372,7 +1375,7 @@ static void mouse_mesh_shortest_path(bContext *C, int mval[2])
e_act = (BMEdge *)ese->ele;
if (e_act != e) {
if (edgetag_shortest_path(vc.scene, em, e_act, e)) {
- EDBM_remove_selection(em, e_act);
+ EDBM_editselection_remove(em, &e_act->head);
path = 1;
}
}
@@ -1387,9 +1390,9 @@ static void mouse_mesh_shortest_path(bContext *C, int mval[2])
/* even if this is selected it may not be in the selection list */
if (edgetag_context_check(vc.scene, em, e) == 0)
- EDBM_remove_selection(em, e);
+ EDBM_editselection_remove(em, &e->head);
else
- EDBM_store_selection(em, e);
+ EDBM_editselection_store(em, &e->head);
/* force drawmode for mesh */
switch (CTX_data_tool_settings(C)->edge_mode) {
@@ -1408,13 +1411,12 @@ static void mouse_mesh_shortest_path(bContext *C, int mval[2])
break;
}
- DAG_id_tag_update(ob->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, ob->data);
+ EDBM_update_generic(C, em, FALSE);
}
}
-static int mesh_shortest_path_select_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
+static int edbm_shortest_path_select_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
view3d_operator_needs_opengl(C);
@@ -1431,12 +1433,12 @@ void MESH_OT_select_shortest_path(wmOperatorType *ot)
ot->idname = "MESH_OT_select_shortest_path";
/* api callbacks */
- ot->invoke = mesh_shortest_path_select_invoke;
+ ot->invoke = edbm_shortest_path_select_invoke;
ot->poll = ED_operator_editmesh;
ot->description = "Select shortest path between two selections";
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", "");
@@ -1466,53 +1468,54 @@ int mouse_mesh(bContext *C, const int mval[2], short extend)
BM_active_face_set(vc.em->bm, efa);
if (!BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
- EDBM_store_selection(vc.em, efa);
+ EDBM_editselection_store(vc.em, &efa->head);
BM_elem_select_set(vc.em->bm, efa, TRUE);
}
else if (extend) {
- EDBM_remove_selection(vc.em, efa);
+ EDBM_editselection_remove(vc.em, &efa->head);
BM_elem_select_set(vc.em->bm, efa, FALSE);
}
}
else if (eed) {
if (!BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
- EDBM_store_selection(vc.em, eed);
+ EDBM_editselection_store(vc.em, &eed->head);
BM_elem_select_set(vc.em->bm, eed, TRUE);
}
else if (extend) {
- EDBM_remove_selection(vc.em, eed);
+ EDBM_editselection_remove(vc.em, &eed->head);
BM_elem_select_set(vc.em->bm, eed, FALSE);
}
}
else if (eve) {
if (!BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
- EDBM_store_selection(vc.em, eve);
+ EDBM_editselection_store(vc.em, &eve->head);
BM_elem_select_set(vc.em->bm, eve, TRUE);
}
else if (extend) {
- EDBM_remove_selection(vc.em, eve);
+ EDBM_editselection_remove(vc.em, &eve->head);
BM_elem_select_set(vc.em->bm, eve, FALSE);
}
}
EDBM_selectmode_flush(vc.em);
-// if (EM_texFaceCheck()) {
-
+ /* change active material on object */
if (efa && efa->mat_nr != vc.obedit->actcol - 1) {
vc.obedit->actcol = efa->mat_nr + 1;
vc.em->mat_nr = efa->mat_nr;
-// BIF_preview_changed(ID_MA);
+
+ WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING, NULL);
+
}
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, vc.obedit);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit);
return 1;
}
return 0;
}
-static void EDBM_strip_selections(BMEditMesh *em)
+static void edbm_strip_selections(BMEditMesh *em)
{
BMEditSelection *ese, *nextese;
@@ -1542,7 +1545,7 @@ static void EDBM_strip_selections(BMEditMesh *em)
}
}
-/* when switching select mode, makes sure selection is consistant for editing */
+/* when switching select mode, makes sure selection is consistent for editing */
/* also for paranoia checks to make sure edge or face mode works */
void EDBM_selectmode_set(BMEditMesh *em)
{
@@ -1553,7 +1556,7 @@ void EDBM_selectmode_set(BMEditMesh *em)
em->bm->selectmode = em->selectmode;
- EDBM_strip_selections(em); /* strip BMEditSelections from em->selected that are not relevant to new mode */
+ edbm_strip_selections(em); /* strip BMEditSelections from em->selected that are not relevant to new mode */
if (em->selectmode & SCE_SELECT_VERTEX) {
EDBM_select_flush(em);
@@ -1561,10 +1564,10 @@ void EDBM_selectmode_set(BMEditMesh *em)
else if (em->selectmode & SCE_SELECT_EDGE) {
/* deselect vertices, and select again based on edge select */
eve = BM_iter_new(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
- for ( ; eve; eve = BM_iter_step(&iter)) BM_elem_select_set(em->bm, eve, FALSE);
+ for (; eve; eve = BM_iter_step(&iter)) BM_elem_select_set(em->bm, eve, FALSE);
eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
- for ( ; eed; eed = BM_iter_step(&iter)) {
+ for (; eed; eed = BM_iter_step(&iter)) {
if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
BM_elem_select_set(em->bm, eed, TRUE);
}
@@ -1576,10 +1579,10 @@ void EDBM_selectmode_set(BMEditMesh *em)
else if (em->selectmode & SCE_SELECT_FACE) {
/* deselect eges, and select again based on face select */
eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
- for ( ; eed; eed = BM_iter_step(&iter)) BM_elem_select_set(em->bm, eed, FALSE);
+ for (; eed; eed = BM_iter_step(&iter)) BM_elem_select_set(em->bm, eed, FALSE);
efa = BM_iter_new(&iter, em->bm, BM_FACES_OF_MESH, NULL);
- for ( ; efa; efa = BM_iter_step(&iter)) {
+ for (; efa; efa = BM_iter_step(&iter)) {
if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
BM_elem_select_set(em->bm, efa, TRUE);
}
@@ -1587,7 +1590,7 @@ void EDBM_selectmode_set(BMEditMesh *em)
}
}
-void EDBM_convertsel(BMEditMesh *em, short oldmode, short selectmode)
+void EDBM_selectmode_convert(BMEditMesh *em, short oldmode, short selectmode)
{
BMEdge *eed;
BMFace *efa;
@@ -1598,9 +1601,9 @@ void EDBM_convertsel(BMEditMesh *em, short oldmode, short selectmode)
if (selectmode == SCE_SELECT_EDGE) {
/* select all edges associated with every selected vertex */
eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
- for ( ; eed; eed = BM_iter_step(&iter)) {
- if ( (BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) ||
- BM_elem_flag_test(eed->v2, BM_ELEM_SELECT)))
+ for (; eed; eed = BM_iter_step(&iter)) {
+ if ((BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) ||
+ BM_elem_flag_test(eed->v2, BM_ELEM_SELECT)))
{
BM_elem_select_set(em->bm, eed, TRUE);
}
@@ -1612,7 +1615,7 @@ void EDBM_convertsel(BMEditMesh *em, short oldmode, short selectmode)
/* select all faces associated with every selected vertex */
efa = BM_iter_new(&iter, em->bm, BM_FACES_OF_MESH, NULL);
- for ( ; efa; efa = BM_iter_step(&iter)) {
+ for (; efa; efa = BM_iter_step(&iter)) {
l = BM_iter_new(&liter, em->bm, BM_LOOPS_OF_FACE, efa);
for (; l; l = BM_iter_step(&liter)) {
if (BM_elem_flag_test(l->v, BM_ELEM_SELECT)) {
@@ -1631,7 +1634,7 @@ void EDBM_convertsel(BMEditMesh *em, short oldmode, short selectmode)
/* select all faces associated with every selected vertex */
efa = BM_iter_new(&iter, em->bm, BM_FACES_OF_MESH, NULL);
- for ( ; efa; efa = BM_iter_step(&iter)) {
+ for (; efa; efa = BM_iter_step(&iter)) {
l = BM_iter_new(&liter, em->bm, BM_LOOPS_OF_FACE, efa);
for (; l; l = BM_iter_step(&liter)) {
if (BM_elem_flag_test(l->v, BM_ELEM_SELECT)) {
@@ -1659,6 +1662,13 @@ void EDBM_deselect_by_material(BMEditMesh *em, const short index, const short se
}
}
+void EDBM_select_toggle_all(BMEditMesh *em) /* exported for UV */
+{
+ if (em->bm->totvertsel || em->bm->totedgesel || em->bm->totfacesel)
+ EDBM_flag_disable_all(em, BM_ELEM_SELECT);
+ else
+ EDBM_flag_enable_all(em, BM_ELEM_SELECT);
+}
void EDBM_select_swap(BMEditMesh *em) /* exported for UV */
{
@@ -1728,7 +1738,7 @@ static void linked_limit_default(bContext *C, wmOperator *op)
{
if (!RNA_struct_property_is_set(op->ptr, "limit")) {
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
if (em->selectmode == SCE_SELECT_FACE)
RNA_boolean_set(op->ptr, "limit", TRUE);
else
@@ -1736,7 +1746,7 @@ static void linked_limit_default(bContext *C, wmOperator *op)
}
}
-static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
Object *obedit = CTX_data_edit_object(C);
ViewContext vc;
@@ -1772,7 +1782,7 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
/* return warning! */
if (unified_findnearest(&vc, &eve, &eed, &efa) == 0) {
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
return OPERATOR_CANCELLED;
}
@@ -1793,7 +1803,8 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
/* walk */
BMW_init(&walker, bm, BMW_ISLAND,
- BMW_MASK_NOP, limit ? BM_ELEM_SELECT : BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_MASK_NOP, limit ? BM_ELEM_SELECT : BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_FLAG_TEST_HIDDEN,
BMW_NIL_LAY);
e = BMW_begin(&walker, efa);
@@ -1814,17 +1825,20 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
}
BMW_init(&walker, bm, BMW_SHELL,
- BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_FLAG_TEST_HIDDEN,
BMW_NIL_LAY);
e = BMW_begin(&walker, eed->v1);
- for ( ; e; e = BMW_step(&walker)) {
+ for (; e; e = BMW_step(&walker)) {
BM_elem_select_set(bm, e, sel);
}
BMW_end(&walker);
+
+ BM_mesh_select_mode_flush(bm);
}
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
return OPERATOR_FINISHED;
}
@@ -1835,22 +1849,22 @@ void MESH_OT_select_linked_pick(wmOperatorType *ot)
ot->idname = "MESH_OT_select_linked_pick";
/* api callbacks */
- ot->invoke = select_linked_pick_invoke;
+ ot->invoke = edbm_select_linked_pick_invoke;
ot->poll = ED_operator_editmesh;
ot->description = "(De)select all vertices linked to the edge under the mouse cursor";
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "");
RNA_def_boolean(ot->srna, "limit", 0, "Limit by Seams", "");
}
-static int select_linked_exec(bContext *C, wmOperator *op)
+static int edbm_select_linked_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMesh *bm = em->bm;
BMIter iter;
BMVert *v;
@@ -1879,7 +1893,8 @@ static int select_linked_exec(bContext *C, wmOperator *op)
}
BMW_init(&walker, bm, BMW_ISLAND,
- BMW_MASK_NOP, limit ? BM_ELEM_SELECT : BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_MASK_NOP, limit ? BM_ELEM_SELECT : BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_FLAG_NOP, /* BMESH_TODO - should be BMW_FLAG_TEST_HIDDEN ? */
BMW_NIL_LAY);
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
@@ -1894,7 +1909,7 @@ static int select_linked_exec(bContext *C, wmOperator *op)
}
else {
BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
- if (BM_elem_flag_test(v, BM_ELEM_SELECT) && !BM_elem_flag_test(v, BM_ELEM_HIDDEN)) {
+ if (BM_elem_flag_test(v, BM_ELEM_SELECT)) {
BM_elem_flag_enable(v, BM_ELEM_TAG);
}
else {
@@ -1903,8 +1918,10 @@ static int select_linked_exec(bContext *C, wmOperator *op)
}
BMW_init(&walker, em->bm, BMW_SHELL,
- BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_FLAG_TEST_HIDDEN,
BMW_NIL_LAY);
+
BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
if (BM_elem_flag_test(v, BM_ELEM_TAG)) {
e = BMW_begin(&walker, v);
@@ -1918,7 +1935,7 @@ static int select_linked_exec(bContext *C, wmOperator *op)
}
EDBM_selectmode_flush_ex(em, SCE_SELECT_VERTEX);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
return OPERATOR_FINISHED;
}
@@ -1930,26 +1947,26 @@ void MESH_OT_select_linked(wmOperatorType *ot)
ot->idname = "MESH_OT_select_linked";
/* api callbacks */
- ot->exec = select_linked_exec;
+ ot->exec = edbm_select_linked_exec;
ot->poll = ED_operator_editmesh;
ot->description = "Select all vertices linked to the active mesh";
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "limit", 0, "Limit by Seams", "");
}
/* ******************** **************** */
-static int select_more(bContext *C, wmOperator *UNUSED(op))
+static int edbm_select_more_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
EDBM_select_more(em);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
return OPERATOR_FINISHED;
}
@@ -1961,21 +1978,21 @@ void MESH_OT_select_more(wmOperatorType *ot)
ot->description = "Select more vertices, edges or faces connected to initial selection";
/* api callbacks */
- ot->exec = select_more;
+ ot->exec = edbm_select_more_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int select_less(bContext *C, wmOperator *UNUSED(op))
+static int edbm_select_less_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
EDBM_select_less(em);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
return OPERATOR_FINISHED;
}
@@ -1987,16 +2004,16 @@ void MESH_OT_select_less(wmOperatorType *ot)
ot->description = "Deselect vertices, edges or faces at the boundary of each selection region";
/* api callbacks */
- ot->exec = select_less;
+ ot->exec = edbm_select_less_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* 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;
@@ -2004,7 +2021,7 @@ static void walker_deselect_nth(BMEditMesh *em, int nth, int offset, BMHeader *h
BMWalker walker;
BMIter iter;
int walktype = 0, itertype = 0, flushtype = 0;
- short mask_vert = 0, mask_edge = 0, mask_loop = 0, mask_face = 0;
+ short mask_vert = 0, mask_edge = 0, mask_face = 0;
/* No active element from which to start - nothing to do */
if (h_act == NULL) {
@@ -2014,30 +2031,31 @@ static void walker_deselect_nth(BMEditMesh *em, int nth, int offset, BMHeader *h
/* Determine which type of iter, walker, and select flush to use
* based on type of the elements being deselected */
switch (h_act->htype) {
- case BM_VERT:
- itertype = BM_VERTS_OF_MESH;
- walktype = BMW_CONNECTED_VERTEX;
- flushtype = SCE_SELECT_VERTEX;
- mask_vert = BM_ELEM_SELECT;
- break;
- case BM_EDGE:
- itertype = BM_EDGES_OF_MESH;
- walktype = BMW_SHELL;
- flushtype = SCE_SELECT_EDGE;
- mask_edge = BM_ELEM_SELECT;
- break;
- case BM_FACE:
- itertype = BM_FACES_OF_MESH;
- walktype = BMW_ISLAND;
- flushtype = SCE_SELECT_FACE;
- mask_face = BM_ELEM_SELECT;
- break;
+ case BM_VERT:
+ itertype = BM_VERTS_OF_MESH;
+ walktype = BMW_CONNECTED_VERTEX;
+ flushtype = SCE_SELECT_VERTEX;
+ mask_vert = BM_ELEM_SELECT;
+ break;
+ case BM_EDGE:
+ itertype = BM_EDGES_OF_MESH;
+ walktype = BMW_SHELL;
+ flushtype = SCE_SELECT_EDGE;
+ mask_edge = BM_ELEM_SELECT;
+ break;
+ case BM_FACE:
+ itertype = BM_FACES_OF_MESH;
+ walktype = BMW_ISLAND;
+ flushtype = SCE_SELECT_FACE;
+ mask_face = BM_ELEM_SELECT;
+ break;
}
/* Walker restrictions uses BMO flags, not header flags,
* so transfer BM_ELEM_SELECT from HFlags onto a BMO flag layer. */
BMO_push(bm, NULL);
- BM_ITER(ele, &iter, bm, itertype, NULL) {
+ BM_ITER(ele, &iter, bm, itertype, NULL)
+ {
if (BM_elem_flag_test(ele, BM_ELEM_SELECT)) {
/* BMESH_TODO, don't use 'BM_ELEM_SELECT' here, its a HFLAG only! */
BMO_elem_flag_enable(bm, (BMElemF *)ele, BM_ELEM_SELECT);
@@ -2046,7 +2064,8 @@ static void walker_deselect_nth(BMEditMesh *em, int nth, int offset, BMHeader *h
/* Walk over selected elements starting at active */
BMW_init(&walker, bm, walktype,
- mask_vert, mask_edge, mask_loop, mask_face,
+ mask_vert, mask_edge, mask_face,
+ BMW_FLAG_NOP, /* BMESH_TODO - should be BMW_FLAG_TEST_HIDDEN ? */
BMW_NIL_LAY);
BLI_assert(walker.order == BMW_BREADTH_FIRST);
@@ -2080,16 +2099,16 @@ static void deselect_nth_active(BMEditMesh *em, BMVert **r_eve, BMEdge **r_eed,
ese = (BMEditSelection *)em->bm->selected.last;
if (ese) {
- switch(ese->htype) {
- case BM_VERT:
- *r_eve = (BMVert *)ese->ele;
- return;
- case BM_EDGE:
- *r_eed = (BMEdge *)ese->ele;
- return;
- case BM_FACE:
- *r_efa = (BMFace *)ese->ele;
- return;
+ switch (ese->htype) {
+ case BM_VERT:
+ *r_eve = (BMVert *)ese->ele;
+ return;
+ case BM_EDGE:
+ *r_eed = (BMEdge *)ese->ele;
+ return;
+ case BM_FACE:
+ *r_efa = (BMFace *)ese->ele;
+ return;
}
}
@@ -2118,7 +2137,7 @@ static void deselect_nth_active(BMEditMesh *em, BMVert **r_eve, BMEdge **r_eed,
}
}
-static int EM_deselect_nth(BMEditMesh *em, int nth, int offset)
+static int edbm_deselect_nth(BMEditMesh *em, int nth, int offset)
{
BMVert *v;
BMEdge *e;
@@ -2142,22 +2161,21 @@ static int EM_deselect_nth(BMEditMesh *em, int nth, int offset)
return 0;
}
-static int mesh_select_nth_exec(bContext *C, wmOperator *op)
+static int edbm_select_nth_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
int nth = RNA_int_get(op->ptr, "nth");
int offset = RNA_int_get(op->ptr, "offset");
offset = MIN2(nth, offset);
- if (EM_deselect_nth(em, nth, offset) == 0) {
+ if (edbm_deselect_nth(em, nth, offset) == 0) {
BKE_report(op->reports, RPT_ERROR, "Mesh has no active vert/edge/face");
return OPERATOR_CANCELLED;
}
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, FALSE);
return OPERATOR_FINISHED;
}
@@ -2171,11 +2189,11 @@ void MESH_OT_select_nth(wmOperatorType *ot)
ot->idname = "MESH_OT_select_nth";
/* api callbacks */
- ot->exec = mesh_select_nth_exec;
+ ot->exec = edbm_select_nth_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_int(ot->srna, "nth", 2, 2, 100, "Nth Selection", "", 1, INT_MAX);
RNA_def_int(ot->srna, "offset", 0, 0, 100, "Offset", "", 0, INT_MAX);
@@ -2196,18 +2214,19 @@ int EM_view3d_poll(bContext *C)
{
if (ED_operator_editmesh(C) && ED_operator_view3d_active(C))
return 1;
+
return 0;
}
-static int select_sharp_edges_exec(bContext *C, wmOperator *op)
+static int edbm_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 = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMIter iter;
BMEdge *e;
BMLoop *l1, *l2;
@@ -2234,7 +2253,7 @@ static int select_sharp_edges_exec(bContext *C, wmOperator *op)
}
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
}
@@ -2247,20 +2266,20 @@ void MESH_OT_edges_select_sharp(wmOperatorType *ot)
ot->idname = "MESH_OT_edges_select_sharp";
/* api callbacks */
- ot->exec = select_sharp_edges_exec;
+ ot->exec = edbm_select_sharp_edges_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_float(ot->srna, "sharpness", 1.0f, 0.01f, FLT_MAX, "sharpness", "", 1.0f, 180.0f);
}
-static int select_linked_flat_faces_exec(bContext *C, wmOperator *op)
+static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMIter iter, liter, liter2;
BMFace *f, **stack = NULL;
BLI_array_declare(stack);
@@ -2315,7 +2334,7 @@ static int select_linked_flat_faces_exec(bContext *C, wmOperator *op)
BLI_array_free(stack);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
}
@@ -2328,20 +2347,20 @@ void MESH_OT_faces_select_linked_flat(wmOperatorType *ot)
ot->idname = "MESH_OT_faces_select_linked_flat";
/* api callbacks */
- ot->exec = select_linked_flat_faces_exec;
+ ot->exec = edbm_select_linked_flat_faces_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_float(ot->srna, "sharpness", 1.0f, 0.01f, FLT_MAX, "sharpness", "", 1.0f, 180.0f);
}
-static int select_non_manifold_exec(bContext *C, wmOperator *op)
+static int edbm_select_non_manifold_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMVert *v;
BMEdge *e;
BMIter iter;
@@ -2356,7 +2375,7 @@ static int select_non_manifold_exec(bContext *C, wmOperator *op)
}
BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
- if (!BM_elem_flag_test(v, BM_ELEM_HIDDEN) && !BM_vert_is_manifold(em->bm, v)) {
+ if (!BM_elem_flag_test(v, BM_ELEM_HIDDEN) && !BM_vert_is_manifold(v)) {
BM_elem_select_set(em->bm, v, TRUE);
}
}
@@ -2367,7 +2386,7 @@ static int select_non_manifold_exec(bContext *C, wmOperator *op)
}
}
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
}
@@ -2380,22 +2399,22 @@ void MESH_OT_select_non_manifold(wmOperatorType *ot)
ot->idname = "MESH_OT_select_non_manifold";
/* api callbacks */
- ot->exec = select_non_manifold_exec;
+ ot->exec = edbm_select_non_manifold_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int mesh_select_random_exec(bContext *C, wmOperator *op)
+static int edbm_select_random_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMVert *eve;
BMEdge *eed;
BMFace *efa;
BMIter iter;
- float randfac = RNA_float_get(op->ptr, "percent")/100.0f;
+ float randfac = RNA_float_get(op->ptr, "percent") / 100.0f;
BLI_srand(BLI_rand()); /* random seed */
@@ -2427,7 +2446,7 @@ static int mesh_select_random_exec(bContext *C, wmOperator *op)
EDBM_selectmode_flush(em);
}
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
}
@@ -2440,11 +2459,11 @@ void MESH_OT_select_random(wmOperatorType *ot)
ot->idname = "MESH_OT_select_random";
/* api callbacks */
- ot->exec = mesh_select_random_exec;
+ ot->exec = edbm_select_random_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f,
@@ -2453,10 +2472,10 @@ void MESH_OT_select_random(wmOperatorType *ot)
"Extend Selection", "Extend selection instead of deselecting everything first");
}
-static int select_next_loop(bContext *C, wmOperator *UNUSED(op))
+static int edbm_select_next_loop_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *f;
BMVert *v;
BMIter iter;
@@ -2470,7 +2489,7 @@ static int select_next_loop(bContext *C, wmOperator *UNUSED(op))
BMIter liter;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, f) {
- if (BM_elem_flag_test(l->v, BM_ELEM_SELECT) && !BM_elem_flag_test(l->v, BM_ELEM_HIDDEN)) {
+ if (BM_elem_flag_test(l->v, BM_ELEM_SELECT)) {
BM_elem_flag_enable(l->next->v, BM_ELEM_TAG);
BM_elem_select_set(em->bm, l->v, FALSE);
}
@@ -2483,7 +2502,7 @@ static int select_next_loop(bContext *C, wmOperator *UNUSED(op))
}
}
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
return OPERATOR_FINISHED;
}
@@ -2495,18 +2514,18 @@ void MESH_OT_select_next_loop(wmOperatorType *ot)
ot->description = "";
/* api callbacks */
- ot->exec = select_next_loop;
+ ot->exec = edbm_select_next_loop_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int region_to_loop(bContext *C, wmOperator *UNUSED(op))
+static int edbm_region_to_loop_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *f;
BMEdge *e;
BMIter iter;
@@ -2543,14 +2562,14 @@ 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);
EDBM_selectmode_to_scene(C);
}
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
}
@@ -2562,11 +2581,11 @@ void MESH_OT_region_to_loop(wmOperatorType *ot)
ot->idname = "MESH_OT_region_to_loop";
/* api callbacks */
- ot->exec = region_to_loop;
+ ot->exec = edbm_region_to_loop_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int loop_find_region(BMEditMesh *em, BMLoop *l, int flag,
@@ -2707,10 +2726,10 @@ static int loop_find_regions(BMEditMesh *em, int selbigger)
return count;
}
-static int loop_to_region(bContext *C, wmOperator *op)
+static int edbm_loop_to_region_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMIter iter;
BMFace *f;
int selbigger = RNA_boolean_get(op->ptr, "select_bigger");
@@ -2732,7 +2751,7 @@ static int loop_to_region(bContext *C, wmOperator *op)
}
}
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
}
@@ -2743,11 +2762,11 @@ void MESH_OT_loop_to_region(wmOperatorType *ot)
ot->idname = "MESH_OT_loop_to_region";
/* api callbacks */
- ot->exec = loop_to_region;
+ ot->exec = edbm_loop_to_region_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "select_bigger", 0, "Select Bigger", "Select bigger regions instead of smaller ones");
}
diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index b6abfe79b70..4fc637a3505 100644
--- a/source/blender/editors/mesh/bmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -25,6 +25,10 @@
* ***** END GPL LICENSE BLOCK *****
*/
+/** \file blender/editors/mesh/editmesh_tools.c
+ * \ingroup edmesh
+ */
+
#include "MEM_guardedalloc.h"
#include "DNA_material_types.h"
@@ -63,24 +67,26 @@
#include "mesh_intern.h"
-
+/* allow accumulated normals to form a new direction but don't
+ * accept direct opposite directions else they will cancel each other out */
static void add_normal_aligned(float nor[3], const float add[3])
{
- if (dot_v3v3(nor, add) < -0.9999f)
- sub_v3_v3(nor, add);
- else
+ if (dot_v3v3(nor, add) < -0.9999f) {
sub_v3_v3(nor, add);
+ }
+ else {
+ add_v3_v3(nor, add);
+ }
}
-
-static int subdivide_exec(bContext *C, wmOperator *op)
+static int edbm_subdivide_exec(bContext *C, wmOperator *op)
{
ToolSettings *ts = CTX_data_tool_settings(C);
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
- int cuts = RNA_int_get(op->ptr,"number_cuts");
+ BMEditMesh *em = BMEdit_FromObject(obedit);
+ int cuts = RNA_int_get(op->ptr, "number_cuts");
float smooth = 0.292f * RNA_float_get(op->ptr, "smoothness");
- float fractal = RNA_float_get(op->ptr, "fractal")/2.5;
+ float fractal = RNA_float_get(op->ptr, "fractal") / 2.5f;
int flag = 0;
if (smooth != 0.0f)
@@ -96,13 +102,12 @@ static int subdivide_exec(bContext *C, wmOperator *op)
BM_mesh_esubdivideflag(obedit, em->bm, BM_ELEM_SELECT,
smooth, fractal,
- ts->editbutflag|flag,
+ ts->editbutflag | flag,
cuts, 0, RNA_enum_get(op->ptr, "quadcorner"),
RNA_boolean_get(op->ptr, "quadtri"),
TRUE, RNA_int_get(op->ptr, "seed"));
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -118,26 +123,31 @@ static EnumPropertyItem prop_mesh_cornervert_types[] = {
void MESH_OT_subdivide(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
ot->name = "Subdivide";
ot->description = "Subdivide selected edges";
ot->idname = "MESH_OT_subdivide";
/* api callbacks */
- ot->exec = subdivide_exec;
+ ot->exec = edbm_subdivide_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
- RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of Cuts", "", 1, 10);
+ prop = RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of Cuts", "", 1, 10);
+ /* avoid re-using last var because it can cause _very_ high poly meshes and annoy users (or worse crash) */
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+
/* BMESH_TODO, this currently does nothing, just add to stop UI from erroring out! */
RNA_def_float(ot->srna, "smoothness", 0.0f, 0.0f, FLT_MAX, "Smoothness", "Smoothness factor (BMESH TODO)", 0.0f, 1.0f);
RNA_def_boolean(ot->srna, "quadtri", 0, "Quad/Tri Mode", "Tries to prevent ngons");
RNA_def_enum(ot->srna, "quadcorner", prop_mesh_cornervert_types, SUBD_STRAIGHT_CUT,
- "Quad Corner Type", "How to subdivide quad corners (anything other then Straight Cut will prevent ngons)");
+ "Quad Corner Type", "How to subdivide quad corners (anything other than Straight Cut will prevent ngons)");
RNA_def_float(ot->srna, "fractal", 0.0f, 0.0f, FLT_MAX, "Fractal", "Fractal randomness factor", 0.0f, 1000.0f);
RNA_def_int(ot->srna, "seed", 0, 0, 10000, "Random Seed", "Seed for the random number generator", 0, 50);
@@ -149,7 +159,7 @@ void EMBM_project_snap_verts(bContext *C, ARegion *ar, Object *obedit, BMEditMes
BMIter iter;
BMVert *eve;
- BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
+ BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
float mval[2], vec[3], no_dummy[3];
int dist_dummy;
@@ -165,7 +175,7 @@ void EMBM_project_snap_verts(bContext *C, ARegion *ar, Object *obedit, BMEditMes
/* individual face extrude */
/* will use vertex normals for extrusion directions, so *nor is unaffected */
-static short EDBM_Extrude_face_indiv(BMEditMesh *em, wmOperator *op, const char hflag, float *UNUSED(nor))
+static short edbm_extrude_face_indiv(BMEditMesh *em, wmOperator *op, const char hflag, float *UNUSED(nor))
{
BMOIter siter;
BMIter liter;
@@ -173,7 +183,7 @@ static short EDBM_Extrude_face_indiv(BMEditMesh *em, wmOperator *op, const char
BMLoop *l;
BMOperator bmop;
- EDBM_InitOpf(em, &bmop, op, "extrude_face_indiv faces=%hf", hflag);
+ EDBM_op_init(em, &bmop, op, "extrude_face_indiv faces=%hf", hflag);
/* deselect original verts */
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
@@ -189,7 +199,7 @@ static short EDBM_Extrude_face_indiv(BMEditMesh *em, wmOperator *op, const char
}
}
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return 0;
}
@@ -197,19 +207,19 @@ static short EDBM_Extrude_face_indiv(BMEditMesh *em, wmOperator *op, const char
}
/* extrudes individual edges */
-static short EDBM_Extrude_edges_indiv(BMEditMesh *em, wmOperator *op, const char hflag, float *UNUSED(nor))
+static short edbm_extrude_edges_indiv(BMEditMesh *em, wmOperator *op, const char hflag, float *UNUSED(nor))
{
BMOperator bmop;
- EDBM_InitOpf(em, &bmop, op, "extrude_edge_only edges=%he", hflag);
+ EDBM_op_init(em, &bmop, op, "extrude_edge_only edges=%he", hflag);
/* deselect original verts */
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
BMO_op_exec(em->bm, &bmop);
- BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_VERT|BM_EDGE, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_VERT | BM_EDGE, BM_ELEM_SELECT, TRUE);
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return 0;
}
@@ -217,26 +227,26 @@ static short EDBM_Extrude_edges_indiv(BMEditMesh *em, wmOperator *op, const char
}
/* extrudes individual vertices */
-static short EDBM_Extrude_verts_indiv(BMEditMesh *em, wmOperator *op, const char hflag, float *UNUSED(nor))
+static short edbm_extrude_verts_indiv(BMEditMesh *em, wmOperator *op, const char hflag, float *UNUSED(nor))
{
BMOperator bmop;
- EDBM_InitOpf(em, &bmop, op, "extrude_vert_indiv verts=%hv", hflag);
+ EDBM_op_init(em, &bmop, op, "extrude_vert_indiv verts=%hv", hflag);
/* deselect original verts */
- BMO_slot_buffer_hflag_disable(em->bm, &bmop, "verts", BM_ELEM_SELECT, BM_VERT, TRUE);
+ BMO_slot_buffer_hflag_disable(em->bm, &bmop, "verts", BM_VERT, BM_ELEM_SELECT, TRUE);
BMO_op_exec(em->bm, &bmop);
- BMO_slot_buffer_hflag_enable(em->bm, &bmop, "vertout", BM_ELEM_SELECT, BM_VERT, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, &bmop, "vertout", BM_VERT, BM_ELEM_SELECT, TRUE);
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return 0;
}
return 'g'; // g is grab
}
-static short EDBM_Extrude_edge(Object *obedit, BMEditMesh *em, const char hflag, float nor[3])
+static short edbm_extrude_edge(Object *obedit, BMEditMesh *em, const char hflag, float nor[3])
{
BMesh *bm = em->bm;
BMIter iter;
@@ -248,8 +258,7 @@ static short EDBM_Extrude_edge(Object *obedit, BMEditMesh *em, const char hflag,
BMElem *ele;
BMO_op_init(bm, &extop, "extrude_face_region");
- BMO_slot_from_hflag(bm, &extop, "edgefacein",
- hflag, BM_VERT|BM_EDGE|BM_FACE);
+ BMO_slot_buffer_from_enabled_hflag(bm, &extop, "edgefacein", BM_VERT | BM_EDGE | BM_FACE, hflag);
/* If a mirror modifier with clipping is on, we need to adjust some
* of the cases above to handle edges on the line of symmetry.
@@ -271,7 +280,10 @@ static short EDBM_Extrude_edge(Object *obedit, BMEditMesh *em, const char hflag,
edge;
edge = BM_iter_step(&iter))
{
- if (BM_elem_flag_test(edge, hflag)) {
+ if (BM_elem_flag_test(edge, hflag) &&
+ BM_edge_is_boundary(edge) &&
+ BM_elem_flag_test(edge->l->f, hflag))
+ {
float co1[3], co2[3];
copy_v3_v3(co1, edge->v1->co);
@@ -284,21 +296,21 @@ static short EDBM_Extrude_edge(Object *obedit, BMEditMesh *em, const char hflag,
if (mmd->flag & MOD_MIR_AXIS_X) {
if ((fabsf(co1[0]) < mmd->tolerance) &&
- (fabsf(co2[0]) < mmd->tolerance))
+ (fabsf(co2[0]) < mmd->tolerance))
{
BMO_slot_map_ptr_insert(bm, &extop, "exclude", edge, NULL);
}
}
if (mmd->flag & MOD_MIR_AXIS_Y) {
if ((fabsf(co1[1]) < mmd->tolerance) &&
- (fabsf(co2[1]) < mmd->tolerance))
+ (fabsf(co2[1]) < mmd->tolerance))
{
BMO_slot_map_ptr_insert(bm, &extop, "exclude", edge, NULL);
}
}
if (mmd->flag & MOD_MIR_AXIS_Z) {
if ((fabsf(co1[2]) < mmd->tolerance) &&
- (fabsf(co2[2]) < mmd->tolerance))
+ (fabsf(co2[2]) < mmd->tolerance))
{
BMO_slot_map_ptr_insert(bm, &extop, "exclude", edge, NULL);
}
@@ -313,7 +325,7 @@ static short EDBM_Extrude_edge(Object *obedit, BMEditMesh *em, const char hflag,
BMO_op_exec(bm, &extop);
- nor[0] = nor[1] = nor[2] = 0.0f;
+ zero_v3(nor);
BMO_ITER(ele, &siter, bm, &extop, "geomout", BM_ALL) {
BM_elem_select_set(bm, ele, TRUE);
@@ -328,11 +340,11 @@ static short EDBM_Extrude_edge(Object *obedit, BMEditMesh *em, const char hflag,
BMO_op_finish(bm, &extop);
- if (nor[0] == 0.0f && nor[1] == 0.0f && nor[2] == 0.0f) return 'g'; // grab
- return 'n'; // normal constraint
-
+ /* grab / normal constraint */
+ return is_zero_v3(nor) ? 'g' : 'n';
}
-static short EDBM_Extrude_vert(Object *obedit, BMEditMesh *em, const char hflag, float *nor)
+
+static short edbm_extrude_vert(Object *obedit, BMEditMesh *em, const char hflag, float nor[3])
{
BMIter iter;
BMEdge *eed;
@@ -360,18 +372,18 @@ static short EDBM_Extrude_vert(Object *obedit, BMEditMesh *em, const char hflag,
}
}
- return EDBM_Extrude_edge(obedit, em, hflag, nor);
+ return edbm_extrude_edge(obedit, em, hflag, nor);
}
-static int extrude_repeat_mesh(bContext *C, wmOperator *op)
+static int edbm_extrude_repeat_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
RegionView3D *rv3d = CTX_wm_region_view3d(C);
- int steps = RNA_int_get(op->ptr,"steps");
+ int steps = RNA_int_get(op->ptr, "steps");
- float offs = RNA_float_get(op->ptr,"offset");
+ float offs = RNA_float_get(op->ptr, "offset");
float dvec[3], tmat[3][3], bmat[3][3], nor[3] = {0.0, 0.0, 0.0};
short a;
@@ -385,17 +397,16 @@ static int extrude_repeat_mesh(bContext *C, wmOperator *op)
mul_m3_v3(tmat, dvec);
for (a = 0; a < steps; a++) {
- EDBM_Extrude_edge(obedit, em, BM_ELEM_SELECT, nor);
+ edbm_extrude_edge(obedit, em, BM_ELEM_SELECT, nor);
//BMO_op_callf(em->bm, "extrude_face_region edgefacein=%hef", BM_ELEM_SELECT);
BMO_op_callf(em->bm, "translate vec=%v verts=%hv", (float *)dvec, BM_ELEM_SELECT);
//extrudeflag(obedit, em, SELECT, nor);
//translateflag(em, SELECT, dvec);
}
- EDBM_RecalcNormals(em);
+ EDBM_mesh_normals_update(em);
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -408,11 +419,11 @@ void MESH_OT_extrude_repeat(wmOperatorType *ot)
ot->idname = "MESH_OT_extrude_repeat";
/* api callbacks */
- ot->exec = extrude_repeat_mesh;
- ot->poll = ED_operator_editmesh;
+ ot->exec = edbm_extrude_repeat_exec;
+ ot->poll = ED_operator_editmesh_view3d;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_float(ot->srna, "offset", 2.0f, 0.0f, 100.0f, "Offset", "", 0.0f, FLT_MAX);
@@ -420,64 +431,65 @@ void MESH_OT_extrude_repeat(wmOperatorType *ot)
}
/* generic extern called extruder */
-static int EDBM_Extrude_Mesh(Scene *scene, Object *obedit, BMEditMesh *em, wmOperator *op, float *norin)
+static int edbm_extrude_mesh(Scene *scene, Object *obedit, BMEditMesh *em, wmOperator *op, float *norin)
{
short nr, transmode = 0;
float stacknor[3] = {0.0f, 0.0f, 0.0f};
float *nor = norin ? norin : stacknor;
- nor[0] = nor[1] = nor[2] = 0.0f;
+ zero_v3(nor);
if (em->selectmode & SCE_SELECT_VERTEX) {
if (em->bm->totvertsel == 0) nr = 0;
else if (em->bm->totvertsel == 1) nr = 4;
else if (em->bm->totedgesel == 0) nr = 4;
else if (em->bm->totfacesel == 0)
- nr = 3; // pupmenu("Extrude %t|Only Edges%x3|Only Vertices%x4");
+ nr = 3; // pupmenu("Extrude %t|Only Edges%x3|Only Vertices%x4");
else if (em->bm->totfacesel == 1)
- nr = 1; // pupmenu("Extrude %t|Region %x1|Only Edges%x3|Only Vertices%x4");
+ nr = 1; // pupmenu("Extrude %t|Region %x1|Only Edges%x3|Only Vertices%x4");
else
- nr = 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3|Only Vertices%x4");
+ nr = 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3|Only Vertices%x4");
}
else if (em->selectmode & SCE_SELECT_EDGE) {
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");
+ nr = 1; // pupmenu("Extrude %t|Region %x1|Only Edges%x3");
else
- nr = 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3");
- */
+ nr = 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3");
+#endif
}
else {
if (em->bm->totfacesel == 0) nr = 0;
else if (em->bm->totfacesel == 1) nr = 1;
else
- nr = 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2");
+ nr = 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2");
}
if (nr < 1) return 'g';
- if (nr == 1 && em->selectmode & SCE_SELECT_VERTEX)
- transmode = EDBM_Extrude_vert(obedit, em, BM_ELEM_SELECT, nor);
- else if (nr == 1) transmode = EDBM_Extrude_edge(obedit, em, BM_ELEM_SELECT, nor);
- else if (nr == 4) transmode = EDBM_Extrude_verts_indiv(em, op, BM_ELEM_SELECT, nor);
- else if (nr == 3) transmode = EDBM_Extrude_edges_indiv(em, op, BM_ELEM_SELECT, nor);
- else transmode = EDBM_Extrude_face_indiv(em, op, BM_ELEM_SELECT, nor);
+ if (nr == 1 && (em->selectmode & SCE_SELECT_VERTEX))
+ transmode = edbm_extrude_vert(obedit, em, BM_ELEM_SELECT, nor);
+ else if (nr == 1) transmode = edbm_extrude_edge(obedit, em, BM_ELEM_SELECT, nor);
+ else if (nr == 4) transmode = edbm_extrude_verts_indiv(em, op, BM_ELEM_SELECT, nor);
+ else if (nr == 3) transmode = edbm_extrude_edges_indiv(em, op, BM_ELEM_SELECT, nor);
+ else transmode = edbm_extrude_face_indiv(em, op, BM_ELEM_SELECT, nor);
if (transmode == 0) {
BKE_report(op->reports, RPT_ERROR, "Not a valid selection for extrude");
}
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.
- */
+ /* 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.
+ */
// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
object_handle_update(scene, obedit);
@@ -502,21 +514,20 @@ static int EDBM_Extrude_Mesh(Scene *scene, Object *obedit, BMEditMesh *em, wmOpe
}
/* extrude without transform */
-static int mesh_extrude_region_exec(bContext *C, wmOperator *op)
+static int edbm_extrude_region_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
- EDBM_Extrude_Mesh(scene, obedit, em, op, NULL);
+ edbm_extrude_mesh(scene, obedit, em, op, NULL);
/* This normally happens when pushing undo but modal operators
* like this one don't push undo data until after modal mode is
* done.*/
- EDBM_RecalcNormals(em);
- BMEdit_RecalcTesselation(em);
+ EDBM_mesh_normals_update(em);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -529,24 +540,24 @@ void MESH_OT_extrude_region(wmOperatorType *ot)
/* api callbacks */
//ot->invoke = mesh_extrude_region_invoke;
- ot->exec = mesh_extrude_region_exec;
+ ot->exec = edbm_extrude_region_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
}
-static int mesh_extrude_verts_exec(bContext *C, wmOperator *op)
+static int edbm_extrude_verts_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
float nor[3];
- EDBM_Extrude_verts_indiv(em, op, BM_ELEM_SELECT, nor);
+ edbm_extrude_verts_indiv(em, op, BM_ELEM_SELECT, nor);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
return OPERATOR_FINISHED;
}
@@ -558,25 +569,25 @@ void MESH_OT_extrude_verts_indiv(wmOperatorType *ot)
ot->idname = "MESH_OT_extrude_verts_indiv";
/* api callbacks */
- ot->exec = mesh_extrude_verts_exec;
+ ot->exec = edbm_extrude_verts_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* to give to transform */
RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
}
-static int mesh_extrude_edges_exec(bContext *C, wmOperator *op)
+static int edbm_extrude_edges_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
float nor[3];
- EDBM_Extrude_edges_indiv(em, op, BM_ELEM_SELECT, nor);
+ edbm_extrude_edges_indiv(em, op, BM_ELEM_SELECT, nor);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
return OPERATOR_FINISHED;
}
@@ -588,25 +599,25 @@ void MESH_OT_extrude_edges_indiv(wmOperatorType *ot)
ot->idname = "MESH_OT_extrude_edges_indiv";
/* api callbacks */
- ot->exec = mesh_extrude_edges_exec;
+ ot->exec = edbm_extrude_edges_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* to give to transform */
RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
}
-static int mesh_extrude_faces_exec(bContext *C, wmOperator *op)
+static int edbm_extrude_faces_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
float nor[3];
- EDBM_Extrude_face_indiv(em, op, BM_ELEM_SELECT, nor);
+ edbm_extrude_face_indiv(em, op, BM_ELEM_SELECT, nor);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
return OPERATOR_FINISHED;
}
@@ -618,47 +629,40 @@ void MESH_OT_extrude_faces_indiv(wmOperatorType *ot)
ot->idname = "MESH_OT_extrude_faces_indiv";
/* api callbacks */
- ot->exec = mesh_extrude_faces_exec;
+ ot->exec = edbm_extrude_faces_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
}
/* ******************** (de)select all operator **************** */
-void EDBM_toggle_select_all(BMEditMesh *em) /* exported for UV */
-{
- if (em->bm->totvertsel || em->bm->totedgesel || em->bm->totfacesel)
- EDBM_flag_disable_all(em, BM_ELEM_SELECT);
- else
- EDBM_flag_enable_all(em, BM_ELEM_SELECT);
-}
-
-static int mesh_select_all_exec(bContext *C, wmOperator *op)
+static int edbm_select_all_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
int action = RNA_enum_get(op->ptr, "action");
switch (action) {
- case SEL_TOGGLE:
- EDBM_toggle_select_all(em);
- break;
- case SEL_SELECT:
- EDBM_flag_enable_all(em, BM_ELEM_SELECT);
- break;
- case SEL_DESELECT:
- EDBM_flag_disable_all(em, BM_ELEM_SELECT);
- break;
- case SEL_INVERT:
- EDBM_select_swap(em);
- break;
+ case SEL_TOGGLE:
+ EDBM_select_toggle_all(em);
+ break;
+ case SEL_SELECT:
+ EDBM_flag_enable_all(em, BM_ELEM_SELECT);
+ break;
+ case SEL_DESELECT:
+ EDBM_flag_disable_all(em, BM_ELEM_SELECT);
+ break;
+ case SEL_INVERT:
+ EDBM_select_swap(em);
+ EDBM_selectmode_flush(em);
+ break;
}
-
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
+
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
return OPERATOR_FINISHED;
}
@@ -666,27 +670,27 @@ static int mesh_select_all_exec(bContext *C, wmOperator *op)
void MESH_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name = "Select/Deselect All";
+ ot->name = "(De)select All";
ot->idname = "MESH_OT_select_all";
ot->description = "(De)select all vertices, edges or faces";
/* api callbacks */
- ot->exec = mesh_select_all_exec;
+ ot->exec = edbm_select_all_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
WM_operator_properties_select_all(ot);
}
-static int mesh_faces_select_interior_exec(bContext *C, wmOperator *UNUSED(op))
+static int edbm_faces_select_interior_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
if (EDBM_select_interior_faces(em)) {
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
return OPERATOR_FINISHED;
}
@@ -704,16 +708,15 @@ void MESH_OT_select_interior_faces(wmOperatorType *ot)
ot->description = "Select faces where all edges have more than 2 face users";
/* api callbacks */
- ot->exec = mesh_faces_select_interior_exec;
+ ot->exec = edbm_faces_select_interior_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* *************** add-click-mesh (extrude) operator ************** */
-/* in trunk see: 'editmesh_add.c' */
-static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event)
+static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
ViewContext vc;
BMVert *v1;
@@ -724,7 +727,7 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event)
em_setup_viewcontext(C, &vc);
- use_proj = (vc.scene->toolsettings->snap_flag & SCE_SNAP) && (vc.scene->toolsettings->snap_mode == SCE_SNAP_MODE_FACE);
+ use_proj = (vc.scene->toolsettings->snap_flag & SCE_SNAP) && (vc.scene->toolsettings->snap_mode == SCE_SNAP_MODE_FACE);
INIT_MINMAX(min, max);
@@ -794,7 +797,7 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event)
mid_v3_v3v3(cent, min, max);
copy_v3_v3(min, cent);
- mul_m4_v3(vc.obedit->obmat, min); // view space
+ mul_m4_v3(vc.obedit->obmat, min); /* view space */
view3d_get_view_aligned_coordinate(&vc, min, event->mval, TRUE);
mul_m4_v3(vc.obedit->imat, min); // back in object space
@@ -803,46 +806,40 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event)
/* calculate rotation */
unit_m3(mat);
if (done) {
- float dot;
+ float angle;
+
+ normalize_v3_v3(vec, min);
- copy_v3_v3(vec, min);
- normalize_v3(vec);
- dot = dot_v3v3(vec, nor);
+ angle = angle_normalized_v3v3(vec, nor);
- if (fabsf(dot) < 0.999f) {
- float cross[3], si, q1[4];
+ if (angle != 0.0f) {
+ float axis[3];
- cross_v3_v3v3(cross, nor, vec);
- normalize_v3(cross);
- dot = 0.5f * saacos(dot);
+ cross_v3_v3v3(axis, nor, vec);
/* halve the rotation if its applied twice */
- if (rot_src) dot *= 0.5f;
-
- si = sinf(dot);
- q1[0] = cosf(dot);
- q1[1] = cross[0] * si;
- q1[2] = cross[1] * si;
- q1[3] = cross[2] * si;
- normalize_qt(q1);
- quat_to_mat3(mat, q1);
+ if (rot_src) {
+ angle *= 0.5f;
+ }
+
+ axis_angle_to_mat3(mat, axis, angle);
}
}
if (rot_src) {
- EDBM_CallOpf(vc.em, op, "rotate verts=%hv cent=%v mat=%m3",
- BM_ELEM_SELECT, cent, mat);
+ EDBM_op_callf(vc.em, op, "rotate verts=%hv cent=%v mat=%m3",
+ BM_ELEM_SELECT, cent, mat);
/* also project the source, for retopo workflow */
if (use_proj)
EMBM_project_snap_verts(C, vc.ar, vc.obedit, vc.em);
}
- EDBM_Extrude_edge(vc.obedit, vc.em, BM_ELEM_SELECT, nor);
- EDBM_CallOpf(vc.em, op, "rotate verts=%hv cent=%v mat=%m3",
- BM_ELEM_SELECT, cent, mat);
- EDBM_CallOpf(vc.em, op, "translate verts=%hv vec=%v",
- BM_ELEM_SELECT, min);
+ edbm_extrude_edge(vc.obedit, vc.em, BM_ELEM_SELECT, nor);
+ EDBM_op_callf(vc.em, op, "rotate verts=%hv cent=%v mat=%m3",
+ BM_ELEM_SELECT, cent, mat);
+ EDBM_op_callf(vc.em, op, "translate verts=%hv vec=%v",
+ BM_ELEM_SELECT, min);
}
else {
float *curs = give_cursor(vc.scene, vc.v3d);
@@ -855,14 +852,14 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event)
invert_m4_m4(vc.obedit->imat, vc.obedit->obmat);
mul_m4_v3(vc.obedit->imat, min); // back in object space
- EDBM_InitOpf(vc.em, &bmop, op, "makevert co=%v", min);
+ EDBM_op_init(vc.em, &bmop, op, "makevert co=%v", min);
BMO_op_exec(vc.em->bm, &bmop);
BMO_ITER(v1, &oiter, vc.em->bm, &bmop, "newvertout", BM_VERT) {
BM_elem_select_set(vc.em->bm, v1, TRUE);
}
- if (!EDBM_FinishOp(vc.em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(vc.em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
}
@@ -873,12 +870,10 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event)
/* This normally happens when pushing undo but modal operators
* like this one don't push undo data until after modal mode is
* done. */
- EDBM_RecalcNormals(vc.em);
- BMEdit_RecalcTesselation(vc.em);
+ EDBM_mesh_normals_update(vc.em);
+
+ EDBM_update_generic(C, vc.em, TRUE);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, vc.obedit->data);
- DAG_id_tag_update(vc.obedit->data, OB_RECALC_DATA);
-
return OPERATOR_FINISHED;
}
@@ -889,109 +884,58 @@ void MESH_OT_dupli_extrude_cursor(wmOperatorType *ot)
ot->idname = "MESH_OT_dupli_extrude_cursor";
/* api callbacks */
- ot->invoke = dupli_extrude_cursor;
+ ot->invoke = edbm_dupli_extrude_cursor_invoke;
ot->description = "Duplicate and extrude selected vertices, edges or faces towards the mouse cursor";
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "rotate_source", 1, "Rotate Source", "Rotate initial selection giving better shape");
}
-static int delete_mesh(bContext *C, Object *obedit, wmOperator *op, int event, Scene *UNUSED(scene))
-{
- BMEditMesh *bem = ((Mesh *)obedit->data)->edit_btmesh;
-
- if (event < 1) return OPERATOR_CANCELLED;
+/* Note, these values must match delete_mesh() event values */
+static EnumPropertyItem prop_mesh_delete_types[] = {
+ {0, "VERT", 0, "Vertices", ""},
+ {1, "EDGE", 0, "Edges", ""},
+ {2, "FACE", 0, "Faces", ""},
+ {3, "EDGE_FACE", 0, "Edges & Faces", ""},
+ {4, "ONLY_FACE", 0, "Only Faces", ""},
+ {0, NULL, 0, NULL, NULL}
+};
- if (event == 10) {
- //"Erase Vertices";
+static int edbm_delete_exec(bContext *C, wmOperator *op)
+{
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
+ int type = RNA_enum_get(op->ptr, "type");
- if (!EDBM_CallOpf(bem, op, "del geom=%hv context=%i", BM_ELEM_SELECT, DEL_VERTS))
- return OPERATOR_CANCELLED;
- }
- else if (event == 11) {
- //"Edge Loop"
- if (!EDBM_CallOpf(bem, op, "dissolve_edge_loop edges=%he", BM_ELEM_SELECT))
+ if (type == 0) {
+ if (!EDBM_op_callf(em, op, "del geom=%hv context=%i", BM_ELEM_SELECT, DEL_VERTS)) /* Erase Vertices */
return OPERATOR_CANCELLED;
}
- else if (event == 7) {
- int use_verts = RNA_boolean_get(op->ptr, "use_verts");
- //"Dissolve"
- if (bem->selectmode & SCE_SELECT_FACE) {
- if (!EDBM_CallOpf(bem, op, "dissolve_faces faces=%hf use_verts=%b", BM_ELEM_SELECT, use_verts))
- return OPERATOR_CANCELLED;
- }
- else if (bem->selectmode & SCE_SELECT_EDGE) {
- if (!EDBM_CallOpf(bem, op, "dissolve_edges edges=%he use_verts=%b", BM_ELEM_SELECT, use_verts))
- return OPERATOR_CANCELLED;
- }
- else if (bem->selectmode & SCE_SELECT_VERTEX) {
- if (!EDBM_CallOpf(bem, op, "dissolve_verts verts=%hv", BM_ELEM_SELECT))
- return OPERATOR_CANCELLED;
- }
- }
- else if (event == 4) {
- //Edges and Faces
- if (!EDBM_CallOpf(bem, op, "del geom=%hef context=%i", BM_ELEM_SELECT, DEL_EDGESFACES))
+ else if (type == 1) {
+ if (!EDBM_op_callf(em, op, "del geom=%he context=%i", BM_ELEM_SELECT, DEL_EDGES)) /* Erase Edges */
return OPERATOR_CANCELLED;
- }
- else if (event == 1) {
- //"Erase Edges"
- if (!EDBM_CallOpf(bem, op, "del geom=%he context=%i", BM_ELEM_SELECT, DEL_EDGES))
+ }
+ else if (type == 2) {
+ if (!EDBM_op_callf(em, op, "del geom=%hf context=%i", BM_ELEM_SELECT, DEL_FACES)) /* Erase Faces */
return OPERATOR_CANCELLED;
}
- else if (event == 2) {
- //"Erase Faces";
- if (!EDBM_CallOpf(bem, op, "del geom=%hf context=%i", BM_ELEM_SELECT, DEL_FACES))
+ else if (type == 3) {
+ if (!EDBM_op_callf(em, op, "del geom=%hef context=%i", BM_ELEM_SELECT, DEL_EDGESFACES)) /* Edges and Faces */
return OPERATOR_CANCELLED;
}
- else if (event == 5) {
+ else if (type == 4) {
//"Erase Only Faces";
- if (!EDBM_CallOpf(bem, op, "del geom=%hf context=%i",
- BM_ELEM_SELECT, DEL_ONLYFACES))
+ if (!EDBM_op_callf(em, op, "del geom=%hf context=%i",
+ BM_ELEM_SELECT, DEL_ONLYFACES))
return OPERATOR_CANCELLED;
}
-
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
- return OPERATOR_FINISHED;
-}
-
-/* Note, these values must match delete_mesh() event values */
-static EnumPropertyItem prop_mesh_delete_types[] = {
- {7, "DISSOLVE", 0, "Dissolve", ""},
- {12, "COLLAPSE", 0, "Collapse", ""},
- {10,"VERT", 0, "Vertices", ""},
- {1, "EDGE", 0, "Edges", ""},
- {2, "FACE", 0, "Faces", ""},
- {11, "EDGE_LOOP", 0, "Edge Loop", ""},
- {4, "EDGE_FACE", 0, "Edges & Faces", ""},
- {5, "ONLY_FACE", 0, "Only Faces", ""},
- {0, NULL, 0, NULL, NULL}
-};
-
-static int delete_mesh_exec(bContext *C, wmOperator *op)
-{
- Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
- Scene *scene = CTX_data_scene(C);
- int type = RNA_enum_get(op->ptr, "type");
-
- if (type != 12) {
- if (delete_mesh(C, obedit, op, type, scene) == OPERATOR_CANCELLED)
- return OPERATOR_CANCELLED;
- EDBM_flag_disable_all(em, BM_ELEM_SELECT);
- }
- else {
- if (!EDBM_CallOpf(em, op, "collapse edges=%he", BM_ELEM_SELECT))
- return OPERATOR_CANCELLED;
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- }
+ EDBM_flag_disable_all(em, BM_ELEM_SELECT);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA|ND_SELECT, obedit);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -1005,40 +949,90 @@ void MESH_OT_delete(wmOperatorType *ot)
/* api callbacks */
ot->invoke = WM_menu_invoke;
- ot->exec = delete_mesh_exec;
+ ot->exec = edbm_delete_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
- ot->prop = RNA_def_enum(ot->srna, "type", prop_mesh_delete_types, 10, "Type", "Method used for deleting mesh data");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_mesh_delete_types, 0, "Type", "Method used for deleting mesh data");
+}
- /* TODO, move dissolve into its own operator so this doesnt confuse non-dissolve options */
- RNA_def_boolean(ot->srna, "use_verts", 0, "Dissolve Verts",
- "When dissolving faces/edges, also dissolve remaining vertices");
+static int edbm_collapse_edge_exec(bContext *C, wmOperator *op)
+{
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
+
+ if (!EDBM_op_callf(em, op, "collapse edges=%he", BM_ELEM_SELECT))
+ return OPERATOR_CANCELLED;
+
+ EDBM_update_generic(C, em, TRUE);
+
+ return OPERATOR_FINISHED;
}
+void MESH_OT_edge_collapse(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Edge Collapse";
+ ot->description = "Collapse selected edges";
+ ot->idname = "MESH_OT_edge_collapse";
+
+ /* api callbacks */
+ ot->exec = edbm_collapse_edge_exec;
+ ot->poll = ED_operator_editmesh;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}
-static int addedgeface_mesh_exec(bContext *C, wmOperator *op)
+static int edbm_collapse_edge_loop_exec(bContext *C, wmOperator *op)
+{
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
+
+ if (!EDBM_op_callf(em, op, "dissolve_edge_loop edges=%he", BM_ELEM_SELECT))
+ return OPERATOR_CANCELLED;
+
+ EDBM_update_generic(C, em, TRUE);
+
+ return OPERATOR_FINISHED;
+}
+
+void MESH_OT_edge_collapse_loop(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Edge Collapse Loop";
+ ot->description = "Collapse selected edge loops";
+ ot->idname = "MESH_OT_edge_collapse_loop";
+
+ /* api callbacks */
+ ot->exec = edbm_collapse_edge_loop_exec;
+ ot->poll = ED_operator_editmesh;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}
+
+static int edbm_add_edge_face_exec(bContext *C, wmOperator *op)
{
BMOperator bmop;
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
- if (!EDBM_InitOpf(em, &bmop, op, "contextual_create geom=%hfev", BM_ELEM_SELECT))
+ if (!EDBM_op_init(em, &bmop, op, "contextual_create geom=%hfev", BM_ELEM_SELECT))
return OPERATOR_CANCELLED;
BMO_op_exec(em->bm, &bmop);
- BMO_slot_buffer_hflag_enable(em->bm, &bmop, "faceout", BM_ELEM_SELECT, BM_FACE, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, &bmop, "faceout", BM_FACE, BM_ELEM_SELECT, TRUE);
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit);
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -1051,20 +1045,20 @@ void MESH_OT_edge_face_add(wmOperatorType *ot)
ot->idname = "MESH_OT_edge_face_add";
/* api callbacks */
- ot->exec = addedgeface_mesh_exec;
+ ot->exec = edbm_add_edge_face_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* ************************* SEAMS AND EDGES **************** */
-static int editbmesh_mark_seam(bContext *C, wmOperator *op)
+static int edbm_mark_seam(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
Mesh *me = ((Mesh *)obedit->data);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMesh *bm = em->bm;
BMEdge *eed;
BMIter iter;
@@ -1091,8 +1085,7 @@ static int editbmesh_mark_seam(bContext *C, wmOperator *op)
}
}
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -1105,20 +1098,20 @@ void MESH_OT_mark_seam(wmOperatorType *ot)
ot->description = "(un)mark selected edges as a seam";
/* api callbacks */
- ot->exec = editbmesh_mark_seam;
+ ot->exec = edbm_mark_seam;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "clear", 0, "Clear", "");
}
-static int editbmesh_mark_sharp(bContext *C, wmOperator *op)
+static int edbm_mark_sharp(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
Mesh *me = ((Mesh *)obedit->data);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMesh *bm = em->bm;
BMEdge *eed;
BMIter iter;
@@ -1146,9 +1139,7 @@ static int editbmesh_mark_sharp(bContext *C, wmOperator *op)
}
}
-
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -1161,35 +1152,34 @@ void MESH_OT_mark_sharp(wmOperatorType *ot)
ot->description = "(un)mark selected edges as sharp";
/* api callbacks */
- ot->exec = editbmesh_mark_sharp;
+ ot->exec = edbm_mark_sharp;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "clear", 0, "Clear", "");
}
-static int editbmesh_vert_connect(bContext *C, wmOperator *op)
+static int edbm_vert_connect(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMesh *bm = em->bm;
BMOperator bmop;
int len = 0;
- if (!EDBM_InitOpf(em, &bmop, op, "connectverts verts=%hv", BM_ELEM_SELECT)) {
+ if (!EDBM_op_init(em, &bmop, op, "connectverts verts=%hv", BM_ELEM_SELECT)) {
return OPERATOR_CANCELLED;
}
BMO_op_exec(bm, &bmop);
len = BMO_slot_get(&bmop, "edgeout")->len;
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return len ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}
@@ -1201,34 +1191,31 @@ void MESH_OT_vert_connect(wmOperatorType *ot)
ot->idname = "MESH_OT_vert_connect";
/* api callbacks */
- ot->exec = editbmesh_vert_connect;
+ ot->exec = edbm_vert_connect;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int editbmesh_edge_split(bContext *C, wmOperator *op)
+static int edbm_edge_split_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMesh *bm = em->bm;
BMOperator bmop;
int len = 0;
- if (!EDBM_InitOpf(em, &bmop, op, "edgesplit edges=%he numcuts=%i",
- BM_ELEM_SELECT, RNA_int_get(op->ptr,"number_cuts")))
- {
+ if (!EDBM_op_init(em, &bmop, op, "edgesplit edges=%he", BM_ELEM_SELECT)) {
return OPERATOR_CANCELLED;
}
BMO_op_exec(bm, &bmop);
- len = BMO_slot_get(&bmop, "outsplit")->len;
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ len = BMO_slot_get(&bmop, "edgeout")->len;
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return len ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}
@@ -1240,44 +1227,41 @@ void MESH_OT_edge_split(wmOperatorType *ot)
ot->idname = "MESH_OT_edge_split";
/* api callbacks */
- ot->exec = editbmesh_edge_split;
+ ot->exec = edbm_edge_split_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
-
- RNA_def_int(ot->srna, "number_cuts", 1, 1, 10, "Number of Cuts", "", 1, INT_MAX);
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/****************** add duplicate operator ***************/
-static int mesh_duplicate_exec(bContext *C, wmOperator *op)
+static int edbm_duplicate_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(ob);
BMOperator bmop;
- EDBM_InitOpf(em, &bmop, op, "dupe geom=%hvef", BM_ELEM_SELECT);
+ EDBM_op_init(em, &bmop, op, "dupe geom=%hvef", BM_ELEM_SELECT);
BMO_op_exec(em->bm, &bmop);
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
- BMO_slot_buffer_hflag_enable(em->bm, &bmop, "newout", BM_ELEM_SELECT, BM_ALL, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, &bmop, "newout", BM_ALL, BM_ELEM_SELECT, TRUE);
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
- DAG_id_tag_update(ob->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
-static int mesh_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+static int edbm_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
WM_cursor_wait(1);
- mesh_duplicate_exec(C, op);
+ edbm_duplicate_exec(C, op);
WM_cursor_wait(0);
return OPERATOR_FINISHED;
@@ -1291,8 +1275,8 @@ void MESH_OT_duplicate(wmOperatorType *ot)
ot->idname = "MESH_OT_duplicate";
/* api callbacks */
- ot->invoke = mesh_duplicate_invoke;
- ot->exec = mesh_duplicate_exec;
+ ot->invoke = edbm_duplicate_invoke;
+ ot->exec = edbm_duplicate_exec;
ot->poll = ED_operator_editmesh;
@@ -1300,16 +1284,15 @@ void MESH_OT_duplicate(wmOperatorType *ot)
RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX);
}
-static int flip_normals(bContext *C, wmOperator *op)
+static int edbm_flip_normals_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
- if (!EDBM_CallOpf(em, op, "reversefaces faces=%hf", BM_ELEM_SELECT))
+ if (!EDBM_op_callf(em, op, "reversefaces faces=%hf", BM_ELEM_SELECT))
return OPERATOR_CANCELLED;
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -1322,11 +1305,11 @@ void MESH_OT_flip_normals(wmOperatorType *ot)
ot->idname = "MESH_OT_flip_normals";
/* api callbacks */
- ot->exec = flip_normals;
+ ot->exec = edbm_flip_normals_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static const EnumPropertyItem direction_items[] = {
@@ -1335,69 +1318,61 @@ static const EnumPropertyItem direction_items[] = {
{0, NULL, 0, NULL, NULL}};
/* only accepts 1 selected edge, or 2 selected faces */
-static int edge_rotate_selected(bContext *C, wmOperator *op)
+static int edbm_edge_rotate_selected_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMOperator bmop;
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) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
- /* 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);
+ EDBM_op_init(em, &bmop, op, "edgerotate edges=%he ccw=%b", BM_ELEM_TAG, 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);
+ /* avoids leaving old verts selected which can be a problem running multiple times,
+ * since this means the edges become selected around the face which then attempt to rotate */
+ BMO_slot_buffer_hflag_disable(em->bm, &bmop, "edges", BM_EDGE, BM_ELEM_SELECT, TRUE);
BMO_op_exec(em->bm, &bmop);
- BMO_slot_buffer_hflag_enable(em->bm, &bmop, "edgeout", BM_ELEM_SELECT, BM_EDGE, TRUE);
+ /* edges may rotate into hidden vertices, if this does _not_ run we get an ilogical state */
+ BMO_slot_buffer_hflag_disable(em->bm, &bmop, "edgeout", BM_EDGE, BM_ELEM_HIDDEN, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, &bmop, "edgeout", BM_EDGE, BM_ELEM_SELECT, TRUE);
+ EDBM_selectmode_flush(em);
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -1410,58 +1385,25 @@ void MESH_OT_edge_rotate(wmOperatorType *ot)
ot->idname = "MESH_OT_edge_rotate";
/* api callbacks */
- ot->exec = edge_rotate_selected;
+ ot->exec = edbm_edge_rotate_selected_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate edge around");
}
-/* swap is 0 or 1, if 1 it hides not selected */
-void EDBM_hide_mesh(BMEditMesh *em, int swap)
-{
- BMIter iter;
- BMElem *ele;
- int itermode;
-
- if (em == NULL) return;
-
- if (em->selectmode & SCE_SELECT_VERTEX)
- itermode = BM_VERTS_OF_MESH;
- else if (em->selectmode & SCE_SELECT_EDGE)
- itermode = BM_EDGES_OF_MESH;
- else
- itermode = BM_FACES_OF_MESH;
-
- BM_ITER(ele, &iter, em->bm, itermode, NULL) {
- if (BM_elem_flag_test(ele, BM_ELEM_SELECT) ^ swap)
- BM_elem_hide_set(em->bm, ele, TRUE);
- }
-
- EDBM_selectmode_flush(em);
-
- /* 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
- */
-
-}
-static int hide_mesh_exec(bContext *C, wmOperator *op)
+static int edbm_hide_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
- EDBM_hide_mesh(em, RNA_boolean_get(op->ptr, "unselected"));
-
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_mesh_hide(em, RNA_boolean_get(op->ptr, "unselected"));
+
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -1473,69 +1415,25 @@ void MESH_OT_hide(wmOperatorType *ot)
ot->idname = "MESH_OT_hide";
/* api callbacks */
- ot->exec = hide_mesh_exec;
+ ot->exec = edbm_hide_exec;
ot->poll = ED_operator_editmesh;
- ot->description = "Hide (un)selected vertices, edges or faces";
+ ot->description = "Hide (un)selected vertices, edges or faces";
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected");
}
-
-void EDBM_reveal_mesh(BMEditMesh *em)
-{
- const char iter_types[3] = {BM_VERTS_OF_MESH,
- BM_EDGES_OF_MESH,
- BM_FACES_OF_MESH};
-
- int sels[3] = {(em->selectmode & SCE_SELECT_VERTEX),
- (em->selectmode & SCE_SELECT_EDGE),
- (em->selectmode & SCE_SELECT_FACE),
- };
-
- BMIter iter;
- BMElem *ele;
- int i;
-
- /* Use tag flag to remember what was hidden before all is revealed.
- * BM_ELEM_HIDDEN --> BM_ELEM_TAG */
- for (i = 0; i < 3; i++) {
- BM_ITER(ele, &iter, em->bm, iter_types[i], NULL) {
- BM_elem_flag_set(ele, BM_ELEM_TAG, BM_elem_flag_test(ele, BM_ELEM_HIDDEN));
- }
- }
-
- /* Reveal everything */
- EDBM_flag_disable_all(em, BM_ELEM_HIDDEN);
-
- /* Select relevant just-revealed elements */
- for (i = 0; i < 3; i++) {
- if (!sels[i]) {
- continue;
- }
-
- BM_ITER(ele, &iter, em->bm, iter_types[i], NULL) {
- if (BM_elem_flag_test(ele, BM_ELEM_TAG)) {
- BM_elem_select_set(em->bm, ele, TRUE);
- }
- }
- }
-
- EDBM_selectmode_flush(em);
-}
-
-static int reveal_mesh_exec(bContext *C, wmOperator *UNUSED(op))
+static int edbm_reveal_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
- EDBM_reveal_mesh(em);
+ EDBM_mesh_reveal(em);
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -1548,28 +1446,27 @@ void MESH_OT_reveal(wmOperatorType *ot)
ot->description = "Reveal all hidden vertices, edges and faces";
/* api callbacks */
- ot->exec = reveal_mesh_exec;
+ ot->exec = edbm_reveal_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int normals_make_consistent_exec(bContext *C, wmOperator *op)
+static int edbm_normals_make_consistent_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
/* doflip has to do with bmesh_rationalize_normals, it's an internal
* thing */
- if (!EDBM_CallOpf(em, op, "righthandfaces faces=%hf do_flip=%b", BM_ELEM_SELECT, TRUE))
+ if (!EDBM_op_callf(em, op, "righthandfaces faces=%hf do_flip=%b", BM_ELEM_SELECT, TRUE))
return OPERATOR_CANCELLED;
if (RNA_boolean_get(op->ptr, "inside"))
- EDBM_CallOpf(em, op, "reversefaces faces=%hf", BM_ELEM_SELECT);
+ EDBM_op_callf(em, op, "reversefaces faces=%hf", BM_ELEM_SELECT);
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -1582,21 +1479,21 @@ void MESH_OT_normals_make_consistent(wmOperatorType *ot)
ot->idname = "MESH_OT_normals_make_consistent";
/* api callbacks */
- ot->exec = normals_make_consistent_exec;
+ ot->exec = edbm_normals_make_consistent_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "inside", 0, "Inside", "");
}
-static int do_smooth_vertex(bContext *C, wmOperator *op)
+static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
ModifierData *md;
int mirrx = FALSE, mirry = FALSE, mirrz = FALSE;
int i, repeat;
@@ -1604,7 +1501,7 @@ static int do_smooth_vertex(bContext *C, wmOperator *op)
/* mirror before smooth */
if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) {
- EDBM_CacheMirrorVerts(em, TRUE);
+ EDBM_verts_mirror_cache_begin(em, TRUE);
}
/* if there is a mirror modifier with clipping, flag the verts that
@@ -1627,14 +1524,14 @@ static int do_smooth_vertex(bContext *C, wmOperator *op)
}
}
- repeat = RNA_int_get(op->ptr,"repeat");
+ repeat = RNA_int_get(op->ptr, "repeat");
if (!repeat)
repeat = 1;
for (i = 0; i < repeat; i++) {
- if (!EDBM_CallOpf(em, op,
- "vertexsmooth verts=%hv mirror_clip_x=%b mirror_clip_y=%b mirror_clip_z=%b clipdist=%f",
- BM_ELEM_SELECT, mirrx, mirry, mirrz, clipdist))
+ if (!EDBM_op_callf(em, op,
+ "vertexsmooth verts=%hv mirror_clip_x=%b mirror_clip_y=%b mirror_clip_z=%b clipdist=%f",
+ BM_ELEM_SELECT, mirrx, mirry, mirrz, clipdist))
{
return OPERATOR_CANCELLED;
}
@@ -1642,12 +1539,11 @@ static int do_smooth_vertex(bContext *C, wmOperator *op)
/* apply mirror */
if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) {
- EDBM_ApplyMirrorCache(em, BM_ELEM_SELECT, 0);
- EDBM_EndMirrorCache(em);
+ EDBM_verts_mirror_apply(em, BM_ELEM_SELECT, 0);
+ EDBM_verts_mirror_cache_end(em);
}
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -1660,90 +1556,15 @@ void MESH_OT_vertices_smooth(wmOperatorType *ot)
ot->idname = "MESH_OT_vertices_smooth";
/* api callbacks */
- ot->exec = do_smooth_vertex;
+ ot->exec = edbm_do_smooth_vertex_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Number of times to smooth the mesh", "", 1, INT_MAX);
}
-
-static int bm_test_exec(bContext *C, wmOperator *UNUSED(op))
-{
- Object *obedit = CTX_data_edit_object(C);
- ARegion *ar = CTX_wm_region(C);
- View3D *v3d = CTX_wm_view3d(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
- BMBVHTree *tree = BMBVH_NewBVH(em, 0, NULL, NULL);
- BMIter iter;
- BMEdge *e;
-
- /* hide all back edges */
- BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
- if (!BM_elem_flag_test(e, BM_ELEM_SELECT))
- continue;
-
- if (!BMBVH_EdgeVisible(tree, e, ar, v3d, obedit))
- BM_elem_select_set(em->bm, e, FALSE);
- }
-
- BMBVH_FreeBVH(tree);
-
-#if 0 //uv island walker test
- BMIter iter, liter;
- BMFace *f;
- BMLoop *l, *l2;
- MLoopUV *luv;
- BMWalker walker;
- int i = 0;
-
- BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, f) {
- luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- }
- }
-
- BMW_init(&walker, em->bm, BMW_UVISLAND, BMW_NIL_LAY);
-
- BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, f) {
- luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- if (luv->flag & MLOOPUV_VERTSEL) {
- l2 = BMW_begin(&walker, l);
- for (; l2; l2 = BMW_step(&walker)) {
- luv = CustomData_bmesh_get(&em->bm->ldata, l2->head.data, CD_MLOOPUV);
- luv->flag |= MLOOPUV_VERTSEL;
- }
- }
- }
- }
-
- BMW_end(&walker);
-#endif
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
-
- return OPERATOR_FINISHED;
-}
-
-void MESH_OT_bm_test(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name = "BMesh Test Operator";
- ot->idname = "MESH_OT_bm_test";
-
- /* api callbacks */
- ot->exec = bm_test_exec;
- ot->poll = ED_operator_editmesh;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
-
- //RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Number of times to smooth the mesh", "", 1, INT_MAX);
-}
-
/********************** Smooth/Solid Operators *************************/
static void mesh_set_smooth_faces(BMEditMesh *em, short smooth)
@@ -1760,15 +1581,14 @@ static void mesh_set_smooth_faces(BMEditMesh *em, short smooth)
}
}
-static int mesh_faces_shade_smooth_exec(bContext *C, wmOperator *UNUSED(op))
+static int edbm_faces_shade_smooth_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
mesh_set_smooth_faces(em, 1);
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, FALSE);
return OPERATOR_FINISHED;
}
@@ -1777,26 +1597,25 @@ void MESH_OT_faces_shade_smooth(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Shade Smooth";
- ot->description = "Display faces smooth (using vertex normals)";
+ ot->description = "Display faces smooth (using vertex normals)";
ot->idname = "MESH_OT_faces_shade_smooth";
/* api callbacks */
- ot->exec = mesh_faces_shade_smooth_exec;
+ ot->exec = edbm_faces_shade_smooth_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int mesh_faces_shade_flat_exec(bContext *C, wmOperator *UNUSED(op))
+static int edbm_faces_shade_flat_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
mesh_set_smooth_faces(em, 0);
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, FALSE);
return OPERATOR_FINISHED;
}
@@ -1809,125 +1628,111 @@ void MESH_OT_faces_shade_flat(wmOperatorType *ot)
ot->idname = "MESH_OT_faces_shade_flat";
/* api callbacks */
- ot->exec = mesh_faces_shade_flat_exec;
+ ot->exec = edbm_faces_shade_flat_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/********************** UV/Color Operators *************************/
-
-static const EnumPropertyItem axis_items[] = {
- {OPUVC_AXIS_X, "X", 0, "X", ""},
- {OPUVC_AXIS_Y, "Y", 0, "Y", ""},
- {0, NULL, 0, NULL, NULL}};
-
-static int mesh_rotate_uvs(bContext *C, wmOperator *op)
+static int edbm_rotate_uvs_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(ob);
BMOperator bmop;
/* get the direction from RNA */
int dir = RNA_enum_get(op->ptr, "direction");
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
- EDBM_InitOpf(em, &bmop, op, "face_rotateuvs faces=%hf dir=%i", BM_ELEM_SELECT, dir);
+ EDBM_op_init(em, &bmop, op, "face_rotateuvs faces=%hf dir=%i", BM_ELEM_SELECT, dir);
/* execute the operator */
BMO_op_exec(em->bm, &bmop);
/* finish the operator */
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
- /* 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);
+ EDBM_update_generic(C, em, FALSE);
/* we succeeded */
return OPERATOR_FINISHED;
}
-static int mesh_reverse_uvs(bContext *C, wmOperator *op)
+static int edbm_reverse_uvs_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(ob);
BMOperator bmop;
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
- EDBM_InitOpf(em, &bmop, op, "face_reverseuvs faces=%hf", BM_ELEM_SELECT);
+ EDBM_op_init(em, &bmop, op, "face_reverseuvs faces=%hf", BM_ELEM_SELECT);
/* execute the operator */
BMO_op_exec(em->bm, &bmop);
/* finish the operator */
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
- /* 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);
+ EDBM_update_generic(C, em, FALSE);
/* we succeeded */
return OPERATOR_FINISHED;
}
-static int mesh_rotate_colors(bContext *C, wmOperator *op)
+static int edbm_rotate_colors_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(ob);
BMOperator bmop;
/* get the direction from RNA */
int dir = RNA_enum_get(op->ptr, "direction");
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
- EDBM_InitOpf(em, &bmop, op, "face_rotatecolors faces=%hf dir=%i", BM_ELEM_SELECT, dir);
+ EDBM_op_init(em, &bmop, op, "face_rotatecolors faces=%hf dir=%i", BM_ELEM_SELECT, dir);
/* execute the operator */
BMO_op_exec(em->bm, &bmop);
/* finish the operator */
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
/* 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);
-*/
+ EDBM_update_generic(C, em, FALSE);
+
/* we succeeded */
return OPERATOR_FINISHED;
}
-static int mesh_reverse_colors(bContext *C, wmOperator *op)
+static int edbm_reverse_colors_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(ob);
BMOperator bmop;
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
- EDBM_InitOpf(em, &bmop, op, "face_reversecolors faces=%hf", BM_ELEM_SELECT);
+ EDBM_op_init(em, &bmop, op, "face_reversecolors faces=%hf", BM_ELEM_SELECT);
/* execute the operator */
BMO_op_exec(em->bm, &bmop);
/* finish the operator */
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
- DAG_id_tag_update(ob->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
+ EDBM_update_generic(C, em, FALSE);
/* we succeeded */
return OPERATOR_FINISHED;
@@ -1940,11 +1745,11 @@ void MESH_OT_uvs_rotate(wmOperatorType *ot)
ot->idname = "MESH_OT_uvs_rotate";
/* api callbacks */
- ot->exec = mesh_rotate_uvs;
+ ot->exec = edbm_rotate_uvs_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate UVs around");
@@ -1958,11 +1763,11 @@ void MESH_OT_uvs_reverse(wmOperatorType *ot)
ot->idname = "MESH_OT_uvs_reverse";
/* api callbacks */
- ot->exec = mesh_reverse_uvs;
+ ot->exec = edbm_reverse_uvs_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
//RNA_def_enum(ot->srna, "axis", axis_items, DIRECTION_CW, "Axis", "Axis to mirror UVs around");
@@ -1975,11 +1780,11 @@ void MESH_OT_colors_rotate(wmOperatorType *ot)
ot->idname = "MESH_OT_colors_rotate";
/* api callbacks */
- ot->exec = mesh_rotate_colors;
+ ot->exec = edbm_rotate_colors_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CCW, "Direction", "Direction to rotate edge around");
@@ -1992,11 +1797,11 @@ void MESH_OT_colors_reverse(wmOperatorType *ot)
ot->idname = "MESH_OT_colors_reverse";
/* api callbacks */
- ot->exec = mesh_reverse_colors;
+ ot->exec = edbm_reverse_colors_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
//RNA_def_enum(ot->srna, "axis", axis_items, DIRECTION_CW, "Axis", "Axis to mirror colors around");
@@ -2022,11 +1827,11 @@ static int merge_firstlast(BMEditMesh *em, int first, int uvmerge, wmOperator *w
return OPERATOR_CANCELLED;
if (uvmerge) {
- if (!EDBM_CallOpf(em, wmop, "pointmerge_facedata verts=%hv snapv=%e", BM_ELEM_SELECT, mergevert))
+ if (!EDBM_op_callf(em, wmop, "pointmerge_facedata verts=%hv snapv=%e", BM_ELEM_SELECT, mergevert))
return OPERATOR_CANCELLED;
}
- if (!EDBM_CallOpf(em, wmop, "pointmerge verts=%hv mergeco=%v", BM_ELEM_SELECT, mergevert->co))
+ if (!EDBM_op_callf(em, wmop, "pointmerge verts=%hv mergeco=%v", BM_ELEM_SELECT, mergevert->co))
return OPERATOR_CANCELLED;
return OPERATOR_FINISHED;
@@ -2067,25 +1872,25 @@ static int merge_target(BMEditMesh *em, Scene *scene, View3D *v3d, Object *ob,
return OPERATOR_CANCELLED;
if (uvmerge) {
- if (!EDBM_CallOpf(em, wmop, "vert_average_facedata verts=%hv", BM_ELEM_SELECT))
+ if (!EDBM_op_callf(em, wmop, "vert_average_facedata verts=%hv", BM_ELEM_SELECT))
return OPERATOR_CANCELLED;
}
- if (!EDBM_CallOpf(em, wmop, "pointmerge verts=%hv mergeco=%v", BM_ELEM_SELECT, co))
+ if (!EDBM_op_callf(em, wmop, "pointmerge verts=%hv mergeco=%v", BM_ELEM_SELECT, co))
return OPERATOR_CANCELLED;
return OPERATOR_FINISHED;
}
-static int merge_exec(bContext *C, wmOperator *op)
+static int edbm_merge_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
View3D *v3d = CTX_wm_view3d(C);
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
int status = 0, uvs = RNA_boolean_get(op->ptr, "uvs");
- switch(RNA_enum_get(op->ptr, "type")) {
+ switch (RNA_enum_get(op->ptr, "type")) {
case 3:
status = merge_target(em, scene, v3d, obedit, 0, uvs, op);
break;
@@ -2100,7 +1905,7 @@ static int merge_exec(bContext *C, wmOperator *op)
break;
case 5:
status = 1;
- if (!EDBM_CallOpf(em, op, "collapse edges=%he", BM_ELEM_SELECT))
+ if (!EDBM_op_callf(em, op, "collapse edges=%he", BM_ELEM_SELECT))
status = 0;
break;
}
@@ -2108,8 +1913,7 @@ static int merge_exec(bContext *C, wmOperator *op)
if (!status)
return OPERATOR_CANCELLED;
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -2133,7 +1937,7 @@ static EnumPropertyItem *merge_type_itemf(bContext *C, PointerRNA *UNUSED(ptr),
obedit = CTX_data_edit_object(C);
if (obedit && obedit->type == OB_MESH) {
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
if (em->selectmode & SCE_SELECT_VERTEX) {
if (em->bm->selected.first && em->bm->selected.last &&
@@ -2168,15 +1972,16 @@ void MESH_OT_merge(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Merge";
+ ot->description = "Merge selected vertices";
ot->idname = "MESH_OT_merge";
/* api callbacks */
- ot->exec = merge_exec;
+ ot->exec = edbm_merge_exec;
ot->invoke = WM_menu_invoke;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
ot->prop = RNA_def_enum(ot->srna, "type", merge_type_items, 3, "Type", "Merge method to use");
@@ -2185,32 +1990,30 @@ void MESH_OT_merge(wmOperatorType *ot)
}
-static int removedoublesflag_exec(bContext *C, wmOperator *op)
+static int edbm_remove_doubles_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMOperator bmop;
int count;
- EDBM_InitOpf(em, &bmop, op, "finddoubles verts=%hv dist=%f", BM_ELEM_SELECT, RNA_float_get(op->ptr, "mergedist"));
+ EDBM_op_init(em, &bmop, op, "finddoubles verts=%hv dist=%f", BM_ELEM_SELECT, RNA_float_get(op->ptr, "mergedist"));
BMO_op_exec(em->bm, &bmop);
count = BMO_slot_map_count(em->bm, &bmop, "targetmapout");
- if (!EDBM_CallOpf(em, op, "weldverts targetmap=%s", &bmop, "targetmapout")) {
+ if (!EDBM_op_callf(em, op, "weldverts targetmap=%s", &bmop, "targetmapout")) {
BMO_op_finish(em->bm, &bmop);
return OPERATOR_CANCELLED;
}
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
- BKE_reportf(op->reports, RPT_INFO, "Removed %d vert%s", count, (count==1)?"ex":"ices");
-
+ BKE_reportf(op->reports, RPT_INFO, "Removed %d vert%s", count, (count == 1) ? "ex" : "ices");
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -2219,18 +2022,19 @@ void MESH_OT_remove_doubles(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Remove Doubles";
+ ot->description= "Remove duplicate vertices";
ot->idname = "MESH_OT_remove_doubles";
/* api callbacks */
- ot->exec = removedoublesflag_exec;
+ ot->exec = edbm_remove_doubles_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_float(ot->srna, "mergedist", 0.0001f, 0.000001f, 50.0f,
- "Merge Distance",
- "Minimum distance between elements to merge", 0.00001, 10.0);
+ "Merge Distance",
+ "Minimum distance between elements to merge", 0.00001, 10.0);
}
/************************ Vertex Path Operator *************************/
@@ -2249,10 +2053,10 @@ typedef struct PathEdge {
-static int select_vertex_path_exec(bContext *C, wmOperator *op)
+static int edbm_select_vertex_path_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(ob);
BMOperator bmop;
BMEditSelection *sv, *ev;
@@ -2270,7 +2074,7 @@ static int select_vertex_path_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
- EDBM_InitOpf(em, &bmop, op, "vertexshortestpath startv=%e endv=%e type=%i", sv->ele, ev->ele, type);
+ EDBM_op_init(em, &bmop, op, "vertexshortestpath startv=%e endv=%e type=%i", sv->ele, ev->ele, type);
/* execute the operator */
BMO_op_exec(em->bm, &bmop);
@@ -2279,22 +2083,16 @@ static int select_vertex_path_exec(bContext *C, wmOperator *op)
/* EDBM_flag_disable_all(em, BM_ELEM_SELECT); */
/* select the output */
- BMO_slot_buffer_hflag_enable(em->bm, &bmop, "vertout", BM_ELEM_SELECT, BM_ALL, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, &bmop, "vertout", BM_ALL, BM_ELEM_SELECT, TRUE);
/* finish the operator */
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
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_id_tag_update(ob->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
-
+ EDBM_update_generic(C, em, FALSE);
/* we succeeded */
return OPERATOR_FINISHED;
@@ -2305,18 +2103,19 @@ void MESH_OT_select_vertex_path(wmOperatorType *ot)
static const EnumPropertyItem type_items[] = {
{VPATH_SELECT_EDGE_LENGTH, "EDGE_LENGTH", 0, "Edge Length", NULL},
{VPATH_SELECT_TOPOLOGICAL, "TOPOLOGICAL", 0, "Topological", NULL},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}
+ };
/* identifiers */
ot->name = "Select Vertex Path";
ot->idname = "MESH_OT_select_vertex_path";
/* api callbacks */
- ot->exec = select_vertex_path_exec;
+ ot->exec = edbm_select_vertex_path_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "type", type_items, VPATH_SELECT_EDGE_LENGTH, "Type", "Method to compute distance");
@@ -2324,37 +2123,47 @@ 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);
}
+
+
/* based on mouse cursor position, it defines how is being ripped */
-static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int edbm_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 = ((Mesh *)obedit->data)->edit_btmesh;
+ 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;
+ const int totedge_orig = bm->totedge;
+
+ /* 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);
@@ -2367,40 +2176,126 @@ 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;
+ int totboundary_edge = 0;
+ 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_editselection_active_get(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 */
if (!v)
return OPERATOR_CANCELLED;
- if (!v->e || !v->e->l) {
- BKE_report(op->reports, RPT_ERROR, "Selected vertex has no faces");
- return OPERATOR_CANCELLED;
+ e2 = NULL;
+
+ if (v->e) {
+ /* find closest edge to mouse cursor */
+ BM_ITER(e, &iter, bm, BM_EDGES_OF_VERT, v) {
+ int is_boundary = BM_edge_is_boundary(e);
+ /* consider wire as boundary for this purpose,
+ * otherwise we can't a face away from a wire edge */
+ totboundary_edge += (is_boundary != 0 || BM_edge_is_wire(e));
+ if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
+ if (is_boundary == FALSE && BM_edge_face_count(e) == 2) {
+ d = mesh_rip_edgedist(ar, projectMat, e->v1->co, e->v2->co, fmval);
+ if (d < dist) {
+ dist = d;
+ e2 = e;
+ }
+ }
+ }
+ }
+
}
- /* 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);
- if (d < dist) {
- dist = d;
- e2 = e;
+ /* should we go ahead with edge rip or do we need to do special case, split off vertex?:
+ * split off vertex if...
+ * - we cant find an edge - this means we are ripping a faces vert that is connected to other
+ * geometry only at the vertex.
+ * - the boundary edge total is greater then 2,
+ * in this case edge split _can_ work but we get far nicer results if we use this special case. */
+ if (totboundary_edge > 2) {
+ BMVert **vout;
+ int vout_len;
+
+ BM_elem_select_set(bm, v, FALSE);
+ bmesh_vert_separate(bm, v, &vout, &vout_len);
+
+ if (vout_len < 2) {
+ /* should never happen */
+ BKE_report(op->reports, RPT_ERROR, "Error ripping vertex from faces");
+ return OPERATOR_CANCELLED;
+ }
+ else {
+ int vi_best = 0;
+
+ dist = FLT_MAX;
+
+ for (i = 0; i < vout_len; i++) {
+ BM_ITER(l, &iter, bm, BM_LOOPS_OF_VERT, vout[i]) {
+ if (!BM_elem_flag_test(l->f, BM_ELEM_HIDDEN)) {
+ float l_mid_co[3];
+ BM_loop_face_tangent(l, l_mid_co);
+
+ /* scale to average of surrounding edge size, only needs to be approx */
+ mul_v3_fl(l_mid_co, (BM_edge_length_calc(l->e) + BM_edge_length_calc(l->prev->e)) / 2.0f);
+ add_v3_v3(l_mid_co, v->co);
+
+ d = mesh_rip_edgedist(ar, projectMat, v->co, l_mid_co, fmval);
+
+ if (d < dist) {
+ dist = d;
+ vi_best = i;
+ }
+ }
+ }
+ }
+
+ /* select the vert from the best region */
+ v = vout[vi_best];
+ BM_elem_select_set(bm, v, TRUE);
+
+ /* splice all others back together */
+ if (vout_len > 2) {
+
+ /* vout[0] == best
+ * vout[1] == glue
+ * vout[2+] == splice with glue
+ */
+ if (vi_best != 0) {
+ SWAP(BMVert *, vout[0], vout[vi_best]);
+ vi_best = 0;
+ }
+
+ for (i = 2; i < vout_len; i++) {
+ BM_vert_splice(bm, vout[i], vout[1]);
+ }
+ }
+
+ MEM_freeN(vout);
+
+ return OPERATOR_FINISHED;
}
}
- if (!e2)
+ if (!e2) {
+ BKE_report(op->reports, RPT_ERROR, "Selected vertex has no edge/face pairs attached");
return OPERATOR_CANCELLED;
+ }
/* 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) {
@@ -2409,14 +2304,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;
@@ -2427,115 +2320,141 @@ 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_op_init(em, &bmop, op, "edgesplit edges=%he verts=%hv use_verts=%b",
+ BM_ELEM_TAG, BM_ELEM_SELECT, TRUE)) {
return OPERATOR_CANCELLED;
}
BMO_op_exec(bm, &bmop);
- /* build bvh tree for edge visibility tests */
- bvhtree = BMBVH_NewBVH(em, 0, NULL, NULL);
+ if (totedge_orig == bm->totedge) {
+ EDBM_op_finish(em, &bmop, op, TRUE);
- 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];
+ BKE_report(op->reports, RPT_ERROR, "No edges could be ripped");
+ return OPERATOR_CANCELLED;
+ }
- if (!BMBVH_EdgeVisible(bvhtree, e, ar, v3d, obedit) || !e->l)
- continue;
+ BMO_ITER(e, &siter, bm, &bmop, "edgeout", BM_EDGE) {
+ float cent[3] = {0, 0, 0}, mid[3];
- /* 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);
+ float vec[2];
+ float fmval_tweak[2];
+ float e_v1_co[2], e_v2_co[2];
- 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);
+ BMVert *v1_other;
+ BMVert *v2_other;
- /* yay we have our comparison point, now project it */
- ED_view3d_project_float(ar, mid, mid, projectMat);
+ /* 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. */
- d = len_squared_v2v2(fmval, mid);
+ /* 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);
- if (d < dist) {
- side = i;
- closest = e;
- dist = d;
- }
+ ED_view3d_project_float_v2(ar, cent, cent, projectMat);
+ ED_view3d_project_float_v2(ar, mid, mid, projectMat);
+
+ 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);
+
+ 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);
BLI_assert(singlesel ? (bm->totvertsel > 0) : (bm->totedgesel > 0));
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
if (bm->totvertsel == 0) {
return OPERATOR_CANCELLED;
}
-
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -2547,11 +2466,11 @@ void MESH_OT_rip(wmOperatorType *ot)
ot->idname = "MESH_OT_rip";
/* api callbacks */
- ot->invoke = mesh_rip_invoke;
+ ot->invoke = edbm_rip_invoke;
ot->poll = EM_view3d_poll;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* to give to transform */
Transform_Properties(ot, P_PROPORTIONAL);
@@ -2561,7 +2480,7 @@ void MESH_OT_rip(wmOperatorType *ot)
/************************ Shape Operators *************************/
/* BMESH_TODO this should be properly encapsulated in a bmop. but later.*/
-static void shape_propagate(Object *obedit, BMEditMesh *em, wmOperator *op)
+static void shape_propagate(BMEditMesh *em, wmOperator *op)
{
BMIter iter;
BMVert *eve = NULL;
@@ -2591,21 +2510,18 @@ static void shape_propagate(Object *obedit, BMEditMesh *em, wmOperator *op)
}
}
#endif
-
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
}
-static int shape_propagate_to_all_exec(bContext *C, wmOperator *op)
+static int edbm_shape_propagate_to_all_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
Mesh *me = obedit->data;
BMEditMesh *em = me->edit_btmesh;
- shape_propagate(obedit, em, op);
+ shape_propagate(em, op);
- DAG_id_tag_update(&me->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
+ EDBM_update_generic(C, em, FALSE);
return OPERATOR_FINISHED;
}
@@ -2619,15 +2535,15 @@ void MESH_OT_shape_propagate_to_all(wmOperatorType *ot)
ot->idname = "MESH_OT_shape_propagate_to_all";
/* api callbacks */
- ot->exec = shape_propagate_to_all_exec;
+ ot->exec = edbm_shape_propagate_to_all_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* BMESH_TODO this should be properly encapsulated in a bmop. but later.*/
-static int blend_from_shape_exec(bContext *C, wmOperator *op)
+static int edbm_blend_from_shape_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
Mesh *me = obedit->data;
@@ -2657,14 +2573,14 @@ 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);
}
- DAG_id_tag_update(&me->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -2672,12 +2588,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;
@@ -2688,9 +2606,8 @@ static EnumPropertyItem *shape_itemf(bContext *C, PointerRNA *UNUSED(ptr), Prop
tmp.value = totitem;
tmp.identifier = em->bm->vdata.layers[a].name;
tmp.name = em->bm->vdata.layers[a].name;
+ /* RNA_enum_item_add sets totitem itself! */
RNA_enum_item_add(&item, &totitem, &tmp);
-
- totitem++;
}
}
@@ -2711,12 +2628,12 @@ void MESH_OT_blend_from_shape(wmOperatorType *ot)
ot->idname = "MESH_OT_blend_from_shape";
/* api callbacks */
- ot->exec = blend_from_shape_exec;
+ ot->exec = edbm_blend_from_shape_exec;
ot->invoke = WM_operator_props_popup;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
prop = RNA_def_enum(ot->srna, "shape", shape_items, 0, "Shape", "Shape key to use for blending");
@@ -2726,10 +2643,10 @@ void MESH_OT_blend_from_shape(wmOperatorType *ot)
}
/* BMESH_TODO - some way to select on an arbitrary axis */
-static int select_axis_exec(bContext *C, wmOperator *op)
+static int edbm_select_axis_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMEditSelection *ese = em->bm->selected.last;
int axis = RNA_enum_get(op->ptr, "axis");
int mode = RNA_enum_get(op->ptr, "mode"); /* -1 == aligned, 0 == neg, 1 == pos */
@@ -2751,26 +2668,26 @@ static int select_axis_exec(bContext *C, wmOperator *op)
BM_ITER(ev, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
if (!BM_elem_flag_test(ev, BM_ELEM_HIDDEN)) {
- switch(mode) {
- case -1: /* aligned */
- if (fabs(ev->co[axis] - value) < limit)
- BM_elem_select_set(em->bm, ev, TRUE);
- break;
- case 0: /* neg */
- if (ev->co[axis] > value)
- BM_elem_select_set(em->bm, ev, TRUE);
- break;
- case 1: /* pos */
- if (ev->co[axis] < value)
- BM_elem_select_set(em->bm, ev, TRUE);
- break;
+ switch (mode) {
+ case -1: /* aligned */
+ if (fabs(ev->co[axis] - value) < limit)
+ BM_elem_select_set(em->bm, ev, TRUE);
+ break;
+ case 0: /* neg */
+ if (ev->co[axis] > value)
+ BM_elem_select_set(em->bm, ev, TRUE);
+ break;
+ case 1: /* pos */
+ if (ev->co[axis] < value)
+ BM_elem_select_set(em->bm, ev, TRUE);
+ break;
}
}
}
}
EDBM_selectmode_flush(em);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
return OPERATOR_FINISHED;
}
@@ -2795,18 +2712,18 @@ void MESH_OT_select_axis(wmOperatorType *ot)
ot->idname = "MESH_OT_select_axis";
/* api callbacks */
- ot->exec = select_axis_exec;
+ ot->exec = edbm_select_axis_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "mode", axis_mode_items, 0, "Axis Mode", "Axis side to use when selecting");
RNA_def_enum(ot->srna, "axis", axis_items_xyz, 0, "Axis", "Select the axis to compare each vertex on");
}
-static int solidify_exec(bContext *C, wmOperator *op)
+static int edbm_solidify_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
Mesh *me = obedit->data;
@@ -2816,27 +2733,26 @@ static int solidify_exec(bContext *C, wmOperator *op)
float thickness = RNA_float_get(op->ptr, "thickness");
- if (!EDBM_InitOpf(em, &bmop, op, "solidify geom=%hf thickness=%f", BM_ELEM_SELECT, thickness)) {
+ if (!EDBM_op_init(em, &bmop, op, "solidify geom=%hf thickness=%f", BM_ELEM_SELECT, thickness)) {
return OPERATOR_CANCELLED;
}
/* 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) */
- BMO_slot_buffer_hflag_disable(bm, &bmop, "geom", BM_ELEM_SELECT, BM_FACE, TRUE);
+ * edges and loose verts selected, as there will be no corresponding
+ * geometry selected below) */
+ BMO_slot_buffer_hflag_disable(bm, &bmop, "geom", BM_FACE, BM_ELEM_SELECT, TRUE);
/* run the solidify operator */
BMO_op_exec(bm, &bmop);
/* select the newly generated faces */
- BMO_slot_buffer_hflag_enable(bm, &bmop, "geomout", BM_ELEM_SELECT, BM_FACE, TRUE);
+ BMO_slot_buffer_hflag_enable(bm, &bmop, "geomout", BM_FACE, BM_ELEM_SELECT, TRUE);
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -2851,11 +2767,11 @@ void MESH_OT_solidify(wmOperatorType *ot)
ot->idname = "MESH_OT_solidify";
/* api callbacks */
- ot->exec = solidify_exec;
+ ot->exec = edbm_solidify_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
prop = RNA_def_float(ot->srna, "thickness", 0.01f, -FLT_MAX, FLT_MAX, "thickness", "", -10.0f, 10.0f);
RNA_def_property_ui_range(prop, -10, 10, 0.1, 4);
@@ -2865,11 +2781,11 @@ void MESH_OT_solidify(wmOperatorType *ot)
#define TRAIL_FREEHAND 2
#define TRAIL_MIXED 3 /* (1|2) */
#define TRAIL_AUTO 4
-#define TRAIL_MIDPOINTS 8
+#define TRAIL_MIDPOINTS 8
typedef struct CutCurve {
- float x;
- float y;
+ float x;
+ float y;
} CutCurve;
/* ******************************************************************** */
@@ -2892,9 +2808,9 @@ typedef struct CutCurve {
* bmesh port version
*/
-#define KNIFE_EXACT 1
-#define KNIFE_MIDPOINT 2
-#define KNIFE_MULTICUT 3
+#define KNIFE_EXACT 1
+#define KNIFE_MIDPOINT 2
+#define KNIFE_MULTICUT 3
static EnumPropertyItem knife_items[] = {
{KNIFE_EXACT, "EXACT", 0, "Exact", ""},
@@ -2909,16 +2825,16 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode,
struct GHash *gh, int *isected)
{
#define MAXSLOPE 100000
- float x11, y11, x12 = 0, y12 = 0, x2max, x2min, y2max;
- float y2min, dist, lastdist = 0, xdiff2, xdiff1;
- float m1, b1, m2, b2, x21, x22, y21, y22, xi;
- float yi, x1min, x1max, y1max, y1min, perc = 0;
+ float x11, y11, x12 = 0, y12 = 0, x2max, x2min, y2max;
+ float y2min, dist, lastdist = 0, xdiff2, xdiff1;
+ float m1, b1, m2, b2, x21, x22, y21, y22, xi;
+ float yi, x1min, x1max, y1max, y1min, perc = 0;
float *scr;
- float threshold = 0.0;
- int i;
+ float threshold = 0.0;
+ int i;
//threshold = 0.000001; /* tolerance for vertex intersection */
- // XXX threshold = scene->toolsettings->select_thresh / 100;
+ // XXX threshold = scene->toolsettings->select_thresh / 100;
/* Get screen coords of verts */
scr = BLI_ghash_lookup(gh, e->v1);
@@ -2941,7 +2857,7 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode,
*isected = 0;
- /* check for *exact* vertex intersection first */
+ /* check for _exact_ vertex intersection first */
if (mode != KNIFE_MULTICUT) {
for (i = 0; i < len; i++) {
if (i > 0) {
@@ -2970,7 +2886,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;
@@ -2984,8 +2900,8 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode,
y12 = c[i].y;
/* Perp. Distance from point to line */
- if (m2 != MAXSLOPE) dist = (y12 - m2 * x12 - b2);/* /sqrt(m2 * m2 + 1); Only looking for */
- /* change in sign. Skip extra math */
+ if (m2 != MAXSLOPE) dist = (y12 - m2 * x12 - b2); /* /sqrt(m2 * m2 + 1); Only looking for */
+ /* change in sign. Skip extra math */
else dist = x22 - x12;
if (i == 0) lastdist = dist;
@@ -3050,7 +2966,7 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode,
}
}
if ((m2 <= 1.0f) && (m2 >= -1.0f)) perc = (xi - x21) / (x22 - x21);
- else perc = (yi - y21) / (y22 - y21); /* lower slope more accurate */
+ else perc = (yi - y21) / (y22 - y21); /* lower slope more accurate */
//isect = 32768.0 * (perc + 0.0000153); /* Percentage in 1 / 32768ths */
break;
@@ -3058,15 +2974,15 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode,
}
lastdist = dist;
}
- return(perc);
+ return perc;
}
#define MAX_CUTS 2048
-static int knife_cut_exec(bContext *C, wmOperator *op)
+static int edbm_knife_cut_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMesh *bm = em->bm;
ARegion *ar = CTX_wm_region(C);
BMVert *bv;
@@ -3091,10 +3007,11 @@ static int knife_cut_exec(bContext *C, wmOperator *op)
/* get the cut curve */
RNA_BEGIN(op->ptr, itemptr, "path") {
-
RNA_float_get_array(&itemptr, "loc", (float *)&curve[len]);
len++;
- if (len >= MAX_CUTS) break;
+ if (len >= MAX_CUTS) {
+ break;
+ }
}
RNA_END;
@@ -3113,7 +3030,7 @@ static int knife_cut_exec(bContext *C, wmOperator *op)
BLI_ghash_insert(gh, bv, scr);
}
- if (!EDBM_InitOpf(em, &bmop, op, "esubd")) {
+ if (!EDBM_op_init(em, &bmop, op, "esubd")) {
return OPERATOR_CANCELLED;
}
@@ -3125,8 +3042,8 @@ static int knife_cut_exec(bContext *C, wmOperator *op)
if (isect != 0.0f) {
if (mode != KNIFE_MULTICUT && mode != KNIFE_MIDPOINT) {
BMO_slot_map_float_insert(bm, &bmop,
- "edgepercents",
- be, isect);
+ "edgepercents",
+ be, isect);
}
BMO_elem_flag_enable(bm, be, 1);
@@ -3140,7 +3057,7 @@ static int knife_cut_exec(bContext *C, wmOperator *op)
}
}
- BMO_slot_from_flag(bm, &bmop, "edges", 1, BM_EDGE);
+ BMO_slot_buffer_from_enabled_flag(bm, &bmop, "edges", BM_EDGE, 1);
if (mode == KNIFE_MIDPOINT) numcuts = 1;
BMO_slot_int_set(&bmop, "numcuts", numcuts);
@@ -3153,14 +3070,13 @@ static int knife_cut_exec(bContext *C, wmOperator *op)
BMO_slot_float_set(&bmop, "radius", 0);
BMO_op_exec(bm, &bmop);
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
BLI_ghash_free(gh, NULL, (GHashValFreeFP)MEM_freeN);
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -3175,12 +3091,12 @@ void MESH_OT_knife_cut(wmOperatorType *ot)
ot->invoke = WM_gesture_lines_invoke;
ot->modal = WM_gesture_lines_modal;
- ot->exec = knife_cut_exec;
+ ot->exec = edbm_knife_cut_exec;
ot->poll = EM_view3d_poll;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_enum(ot->srna, "type", knife_items, KNIFE_EXACT, "Type", "");
prop = RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
@@ -3199,29 +3115,29 @@ static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase, wmO
Object *obedit = editbase->object;
Mesh *me = obedit->data;
BMEditMesh *em = me->edit_btmesh;
- BMesh *bmnew;
+ BMesh *bm_new;
if (!em)
return OPERATOR_CANCELLED;
- bmnew = BM_mesh_create(obedit, bm_mesh_allocsize_default);
- CustomData_copy(&em->bm->vdata, &bmnew->vdata, CD_MASK_BMESH, CD_CALLOC, 0);
- CustomData_copy(&em->bm->edata, &bmnew->edata, CD_MASK_BMESH, CD_CALLOC, 0);
- CustomData_copy(&em->bm->ldata, &bmnew->ldata, CD_MASK_BMESH, CD_CALLOC, 0);
- CustomData_copy(&em->bm->pdata, &bmnew->pdata, CD_MASK_BMESH, CD_CALLOC, 0);
-
- CustomData_bmesh_init_pool(&bmnew->vdata, bm_mesh_allocsize_default[0]);
- CustomData_bmesh_init_pool(&bmnew->edata, bm_mesh_allocsize_default[1]);
- CustomData_bmesh_init_pool(&bmnew->ldata, bm_mesh_allocsize_default[2]);
- CustomData_bmesh_init_pool(&bmnew->pdata, bm_mesh_allocsize_default[3]);
+ bm_new = BM_mesh_create(&bm_mesh_allocsize_default);
+ CustomData_copy(&em->bm->vdata, &bm_new->vdata, CD_MASK_BMESH, CD_CALLOC, 0);
+ CustomData_copy(&em->bm->edata, &bm_new->edata, CD_MASK_BMESH, CD_CALLOC, 0);
+ CustomData_copy(&em->bm->ldata, &bm_new->ldata, CD_MASK_BMESH, CD_CALLOC, 0);
+ CustomData_copy(&em->bm->pdata, &bm_new->pdata, CD_MASK_BMESH, CD_CALLOC, 0);
+
+ CustomData_bmesh_init_pool(&bm_new->vdata, bm_mesh_allocsize_default.totvert, BM_VERT);
+ CustomData_bmesh_init_pool(&bm_new->edata, bm_mesh_allocsize_default.totedge, BM_EDGE);
+ CustomData_bmesh_init_pool(&bm_new->ldata, bm_mesh_allocsize_default.totloop, BM_LOOP);
+ CustomData_bmesh_init_pool(&bm_new->pdata, bm_mesh_allocsize_default.totface, BM_FACE);
- basenew = ED_object_add_duplicate(bmain, scene, editbase, USER_DUP_MESH); /* 0 = fully linked */
+ basenew = ED_object_add_duplicate(bmain, scene, editbase, USER_DUP_MESH); /* 0 = fully linked */
assign_matarar(basenew->object, give_matarar(obedit), *give_totcolp(obedit)); /* new in 2.5 */
ED_base_object_select(basenew, BA_DESELECT);
- EDBM_CallOpf(em, wmop, "dupe geom=%hvef dest=%p", BM_ELEM_SELECT, bmnew);
- EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_FACES);
+ EDBM_op_callf(em, wmop, "dupe geom=%hvef dest=%p", BM_ELEM_SELECT, bm_new);
+ EDBM_op_callf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_FACES);
/* clean up any loose edges */
BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
@@ -3232,7 +3148,7 @@ static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase, wmO
BM_elem_select_set(em->bm, e, FALSE);
}
}
- EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_EDGES);
+ EDBM_op_callf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_EDGES);
/* clean up any loose verts */
BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
@@ -3244,13 +3160,13 @@ static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase, wmO
}
}
- EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_VERTS);
+ EDBM_op_callf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_VERTS);
+
+ BM_mesh_normals_update(bm_new, TRUE);
- BM_mesh_normals_update(bmnew, TRUE);
- BMO_op_callf(bmnew, "bmesh_to_mesh mesh=%p object=%p notesselation=%b",
- basenew->object->data, basenew->object, TRUE);
+ BM_mesh_bm_to_me(bm_new, basenew->object->data, FALSE);
- BM_mesh_free(bmnew);
+ BM_mesh_free(bm_new);
((Mesh *)basenew->object->data)->edit_btmesh = NULL;
return 1;
@@ -3310,7 +3226,8 @@ static int mesh_separate_loose(Main *bmain, Scene *scene, Base *editbase, wmOper
/* Walk from the single vertex, selecting everything connected
* to it */
BMW_init(&walker, bm, BMW_SHELL,
- BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
+ BMW_FLAG_NOP, /* BMESH_TODO - should be BMW_FLAG_TEST_HIDDEN ? */
BMW_NIL_LAY);
e = BMW_begin(&walker, v_seed);
@@ -3336,7 +3253,7 @@ static int mesh_separate_loose(Main *bmain, Scene *scene, Base *editbase, wmOper
return result;
}
-static int mesh_separate_exec(bContext *C, wmOperator *op)
+static int edbm_separate_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
@@ -3346,13 +3263,14 @@ static int mesh_separate_exec(bContext *C, wmOperator *op)
if (type == 0)
retval = mesh_separate_selected(bmain, scene, base, op);
else if (type == 1)
- retval = mesh_separate_material (bmain, scene, base, op);
+ retval = mesh_separate_material(bmain, scene, base, op);
else if (type == 2)
retval = mesh_separate_loose(bmain, scene, base, op);
-
+
if (retval) {
- DAG_id_tag_update(base->object->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, base->object->data);
+ BMEditMesh *em = BMEdit_FromObject(base->object);
+ EDBM_update_generic(C, em, TRUE);
+
return OPERATOR_FINISHED;
}
@@ -3377,7 +3295,7 @@ void MESH_OT_separate(wmOperatorType *ot)
/* api callbacks */
ot->invoke = WM_menu_invoke;
- ot->exec = mesh_separate_exec;
+ ot->exec = edbm_separate_exec;
ot->poll = ED_operator_editmesh;
/* flags */
@@ -3387,27 +3305,26 @@ void MESH_OT_separate(wmOperatorType *ot)
}
-static int fill_mesh_exec(bContext *C, wmOperator *op)
+static int edbm_fill_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMOperator bmop;
- if (!EDBM_InitOpf(em, &bmop, op, "triangle_fill edges=%he", BM_ELEM_SELECT)) {
+ if (!EDBM_op_init(em, &bmop, op, "triangle_fill edges=%he", BM_ELEM_SELECT)) {
return OPERATOR_CANCELLED;
}
BMO_op_exec(em->bm, &bmop);
/* select new geometry */
- BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_FACE|BM_EDGE, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_FACE | BM_EDGE, BM_ELEM_SELECT, TRUE);
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
-
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
@@ -3420,23 +3337,22 @@ void MESH_OT_fill(wmOperatorType *ot)
ot->idname = "MESH_OT_fill";
/* api callbacks */
- ot->exec = fill_mesh_exec;
+ ot->exec = edbm_fill_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int beautify_fill_exec(bContext *C, wmOperator *op)
+static int edbm_beautify_fill_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
- if (!EDBM_CallOpf(em, op, "beautify_fill faces=%hf", BM_ELEM_SELECT))
+ if (!EDBM_op_callf(em, op, "beautify_fill faces=%hf", BM_ELEM_SELECT))
return OPERATOR_CANCELLED;
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -3448,25 +3364,25 @@ void MESH_OT_beautify_fill(wmOperatorType *ot)
ot->idname = "MESH_OT_beautify_fill";
/* api callbacks */
- ot->exec = beautify_fill_exec;
+ ot->exec = edbm_beautify_fill_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/********************** Quad/Tri Operators *************************/
-static int quads_convert_to_tris_exec(bContext *C, wmOperator *op)
+static int edbm_quads_convert_to_tris_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
+ int use_beauty = RNA_boolean_get(op->ptr, "use_beauty");
- if (!EDBM_CallOpf(em, op, "triangulate faces=%hf", BM_ELEM_SELECT))
+ if (!EDBM_op_callf(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);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -3478,17 +3394,19 @@ void MESH_OT_quads_convert_to_tris(wmOperatorType *ot)
ot->idname = "MESH_OT_quads_convert_to_tris";
/* api callbacks */
- ot->exec = quads_convert_to_tris_exec;
+ ot->exec = edbm_quads_convert_to_tris_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ 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)
+static int edbm_tris_convert_to_quads_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
int dosharp, douvs, dovcols, domaterials;
float limit = RNA_float_get(op->ptr, "limit");
@@ -3497,15 +3415,14 @@ static int tris_convert_to_quads_exec(bContext *C, wmOperator *op)
dovcols = RNA_boolean_get(op->ptr, "vcols");
domaterials = RNA_boolean_get(op->ptr, "materials");
- if (!EDBM_CallOpf(em, op,
- "join_triangles faces=%hf limit=%f cmp_sharp=%b cmp_uvs=%b cmp_vcols=%b cmp_materials=%b",
- BM_ELEM_SELECT, limit, dosharp, douvs, dovcols, domaterials))
+ if (!EDBM_op_callf(em, op,
+ "join_triangles faces=%hf limit=%f cmp_sharp=%b cmp_uvs=%b cmp_vcols=%b cmp_materials=%b",
+ BM_ELEM_SELECT, limit, dosharp, douvs, dovcols, domaterials))
{
return OPERATOR_CANCELLED;
}
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -3519,11 +3436,11 @@ void MESH_OT_tris_convert_to_quads(wmOperatorType *ot)
ot->idname = "MESH_OT_tris_convert_to_quads";
/* api callbacks */
- ot->exec = tris_convert_to_quads_exec;
+ ot->exec = edbm_tris_convert_to_quads_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
prop = RNA_def_float_rotation(ot->srna, "limit", 0, NULL, 0.0f, DEG2RADF(180.0f),
"Max Angle", "Angle Limit", 0.0f, DEG2RADF(180.0f));
@@ -3535,21 +3452,64 @@ void MESH_OT_tris_convert_to_quads(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "materials", 0, "Compare Materials", "");
}
-static int dissolve_limited_exec(bContext *C, wmOperator *op)
+static int edbm_dissolve_exec(bContext *C, wmOperator *op)
+{
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
+
+ int use_verts = RNA_boolean_get(op->ptr, "use_verts");
+
+ if (em->selectmode & SCE_SELECT_FACE) {
+ if (!EDBM_op_callf(em, op, "dissolve_faces faces=%hf use_verts=%b", BM_ELEM_SELECT, use_verts))
+ return OPERATOR_CANCELLED;
+ }
+ else if (em->selectmode & SCE_SELECT_EDGE) {
+ if (!EDBM_op_callf(em, op, "dissolve_edges edges=%he use_verts=%b", BM_ELEM_SELECT, use_verts))
+ return OPERATOR_CANCELLED;
+ }
+ else if (em->selectmode & SCE_SELECT_VERTEX) {
+ if (!EDBM_op_callf(em, op, "dissolve_verts verts=%hv", BM_ELEM_SELECT))
+ return OPERATOR_CANCELLED;
+ }
+
+ EDBM_update_generic(C, em, TRUE);
+
+ return OPERATOR_FINISHED;
+}
+
+void MESH_OT_dissolve(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Dissolve";
+ ot->description = "Dissolve geometry";
+ ot->idname = "MESH_OT_dissolve";
+
+ /* api callbacks */
+ ot->exec = edbm_dissolve_exec;
+ ot->poll = ED_operator_editmesh;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+ /* TODO, move dissolve into its own operator so this doesnt confuse non-dissolve options */
+ RNA_def_boolean(ot->srna, "use_verts", 0, "Dissolve Verts",
+ "When dissolving faces/edges, also dissolve remaining vertices");
+}
+
+static int edbm_dissolve_limited_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
float angle_limit = RNA_float_get(op->ptr, "angle_limit");
- if (!EDBM_CallOpf(em, op,
- "dissolve_limit edges=%he verts=%hv angle_limit=%f",
- BM_ELEM_SELECT, BM_ELEM_SELECT, angle_limit))
+ if (!EDBM_op_callf(em, op,
+ "dissolve_limit edges=%he verts=%hv angle_limit=%f",
+ BM_ELEM_SELECT, BM_ELEM_SELECT, angle_limit))
{
return OPERATOR_CANCELLED;
}
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -3564,37 +3524,35 @@ void MESH_OT_dissolve_limited(wmOperatorType *ot)
ot->description = "Dissolve selected edges and verts, limited by the angle of surrounding geometry";
/* api callbacks */
- ot->exec = dissolve_limited_exec;
+ ot->exec = edbm_dissolve_limited_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
prop = RNA_def_float_rotation(ot->srna, "angle_limit", 0, NULL, 0.0f, DEG2RADF(180.0f),
"Max Angle", "Angle Limit in Degrees", 0.0f, DEG2RADF(180.0f));
RNA_def_property_float_default(prop, DEG2RADF(15.0f));
}
-static int split_mesh_exec(bContext *C, wmOperator *op)
+static int edbm_split_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)ob->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(ob);
BMOperator bmop;
- EDBM_InitOpf(em, &bmop, op, "split geom=%hvef use_only_faces=%b", BM_ELEM_SELECT, FALSE);
+ EDBM_op_init(em, &bmop, op, "split geom=%hvef use_only_faces=%b", BM_ELEM_SELECT, FALSE);
BMO_op_exec(em->bm, &bmop);
- BM_mesh_elem_flag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT);
- BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL, TRUE);
- if (!EDBM_FinishOp(em, &bmop, op, TRUE)) {
+ BM_mesh_elem_flag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE);
+ BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ALL, BM_ELEM_SELECT, TRUE);
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
/* Geometry has changed, need to recalc normals and looptris */
- BMEdit_RecalcTesselation(em);
- EDBM_RecalcNormals(em);
+ EDBM_mesh_normals_update(em);
- DAG_id_tag_update(ob->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -3606,19 +3564,19 @@ void MESH_OT_split(wmOperatorType *ot)
ot->idname = "MESH_OT_split";
/* api callbacks */
- ot->exec = split_mesh_exec;
+ ot->exec = edbm_split_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int spin_mesh_exec(bContext *C, wmOperator *op)
+static int edbm_spin_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
ToolSettings *ts = CTX_data_tool_settings(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMesh *bm = em->bm;
BMOperator spinop;
float cent[3], axis[3], imat[3][3];
@@ -3639,7 +3597,7 @@ static int spin_mesh_exec(bContext *C, wmOperator *op)
mul_m3_v3(imat, cent);
mul_m3_v3(imat, axis);
- if (!EDBM_InitOpf(em, &spinop, op,
+ if (!EDBM_op_init(em, &spinop, op,
"spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i ang=%f do_dupli=%b",
BM_ELEM_SELECT, cent, axis, d, steps, degr, dupli))
{
@@ -3647,19 +3605,18 @@ static int spin_mesh_exec(bContext *C, wmOperator *op)
}
BMO_op_exec(bm, &spinop);
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
- BMO_slot_buffer_hflag_enable(bm, &spinop, "lastout", BM_ELEM_SELECT, BM_ALL, TRUE);
- if (!EDBM_FinishOp(em, &spinop, op, TRUE)) {
+ BMO_slot_buffer_hflag_enable(bm, &spinop, "lastout", BM_ALL, BM_ELEM_SELECT, TRUE);
+ if (!EDBM_op_finish(em, &spinop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
/* get center and axis, in global coords */
-static int spin_mesh_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+static int edbm_spin_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
Scene *scene = CTX_data_scene(C);
View3D *v3d = CTX_wm_view3d(C);
@@ -3668,22 +3625,23 @@ static int spin_mesh_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
RNA_float_set_array(op->ptr, "center", give_cursor(scene, v3d));
RNA_float_set_array(op->ptr, "axis", rv3d->viewinv[2]);
- return spin_mesh_exec(C, op);
+ return edbm_spin_exec(C, op);
}
void MESH_OT_spin(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Spin";
+ ot->description = "Extrude selected vertices in a circle around the cursor in indicated viewport";
ot->idname = "MESH_OT_spin";
/* api callbacks */
- ot->invoke = spin_mesh_invoke;
- ot->exec = spin_mesh_exec;
+ ot->invoke = edbm_spin_invoke;
+ ot->exec = edbm_spin_exec;
ot->poll = EM_view3d_poll;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_int(ot->srna, "steps", 9, 0, INT_MAX, "Steps", "Steps", 0, INT_MAX);
@@ -3695,10 +3653,10 @@ void MESH_OT_spin(wmOperatorType *ot)
}
-static int screw_mesh_exec(bContext *C, wmOperator *op)
+static int edbm_screw_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMesh *bm = em->bm;
BMEdge *eed;
BMVert *eve, *v1, *v2;
@@ -3725,13 +3683,11 @@ static int screw_mesh_exec(bContext *C, wmOperator *op)
/* find two vertices with valence count == 1, more or less is wrong */
v1 = NULL;
v2 = NULL;
- for (eve = BM_iter_new(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
- eve; eve = BM_iter_step(&iter)) {
+ for (eve = BM_iter_new(&iter, em->bm, BM_VERTS_OF_MESH, NULL); eve; eve = BM_iter_step(&iter)) {
valence = 0;
- for (eed = BM_iter_new(&eiter, em->bm, BM_EDGES_OF_VERT, eve);
- eed; eed = BM_iter_step(&eiter)) {
+ for (eed = BM_iter_new(&eiter, em->bm, BM_EDGES_OF_VERT, eve); eed; eed = BM_iter_step(&eiter)) {
if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
valence++;
@@ -3765,7 +3721,7 @@ static int screw_mesh_exec(bContext *C, wmOperator *op)
if (dot_v3v3(nor, dvec) > 0.000f)
negate_v3(dvec);
- if (!EDBM_InitOpf(em, &spinop, op,
+ if (!EDBM_op_init(em, &spinop, op,
"spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i ang=%f do_dupli=%b",
BM_ELEM_SELECT, cent, axis, dvec, turns * steps, 360.0f * turns, FALSE))
{
@@ -3773,19 +3729,18 @@ static int screw_mesh_exec(bContext *C, wmOperator *op)
}
BMO_op_exec(bm, &spinop);
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
- BMO_slot_buffer_hflag_enable(bm, &spinop, "lastout", BM_ELEM_SELECT, BM_ALL, TRUE);
- if (!EDBM_FinishOp(em, &spinop, op, TRUE)) {
+ BMO_slot_buffer_hflag_enable(bm, &spinop, "lastout", BM_ALL, BM_ELEM_SELECT, TRUE);
+ if (!EDBM_op_finish(em, &spinop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
/* get center and axis, in global coords */
-static int screw_mesh_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+static int edbm_screw_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
Scene *scene = CTX_data_scene(C);
View3D *v3d = CTX_wm_view3d(C);
@@ -3794,22 +3749,23 @@ static int screw_mesh_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
RNA_float_set_array(op->ptr, "center", give_cursor(scene, v3d));
RNA_float_set_array(op->ptr, "axis", rv3d->viewinv[1]);
- return screw_mesh_exec(C, op);
+ return edbm_screw_exec(C, op);
}
void MESH_OT_screw(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Screw";
+ ot->description = "Extrude selected vertices in screw-shaped rotation around the cursor in indicated viewport";
ot->idname = "MESH_OT_screw";
/* api callbacks */
- ot->invoke = screw_mesh_invoke;
- ot->exec = screw_mesh_exec;
+ ot->invoke = edbm_screw_invoke;
+ ot->exec = edbm_screw_exec;
ot->poll = EM_view3d_poll;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_int(ot->srna, "steps", 9, 0, INT_MAX, "Steps", "Steps", 0, 256);
@@ -3821,25 +3777,30 @@ void MESH_OT_screw(wmOperatorType *ot)
"Axis", "Axis in global view space", -FLT_MAX, FLT_MAX);
}
-static int select_by_number_vertices_exec(bContext *C, wmOperator *op)
+static int edbm_select_by_number_vertices_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMIter iter;
int numverts = RNA_int_get(op->ptr, "number");
int type = RNA_enum_get(op->ptr, "type");
for (efa = BM_iter_new(&iter, em->bm, BM_FACES_OF_MESH, NULL);
- efa; efa = BM_iter_step(&iter)) {
+ efa; efa = BM_iter_step(&iter)) {
int select = 0;
if (type == 0 && efa->len < numverts) {
select = 1;
- }else if (type == 1 && efa->len == numverts) {
+ }
+ else if (type == 1 && efa->len == numverts) {
select = 1;
- }else if (type == 2 && efa->len > numverts) {
+ }
+ else if (type == 2 && efa->len > numverts) {
+ select = 1;
+ }
+ else if (type == 3 && efa->len != numverts) {
select = 1;
}
@@ -3850,18 +3811,18 @@ static int select_by_number_vertices_exec(bContext *C, wmOperator *op)
EDBM_selectmode_flush(em);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
}
void MESH_OT_select_by_number_vertices(wmOperatorType *ot)
{
static const EnumPropertyItem type_items[] = {
- {0, "LESS", 0, "Less Than", ""},
- {1, "EQUAL", 0, "Equal To", ""},
- {2, "GREATER", 0, "Greater Than", ""},
- {0, NULL, 0, NULL, NULL}
- };
+ {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}};
/* identifiers */
ot->name = "Select by Number of Vertices";
@@ -3869,27 +3830,27 @@ void MESH_OT_select_by_number_vertices(wmOperatorType *ot)
ot->idname = "MESH_OT_select_by_number_vertices";
/* api callbacks */
- ot->exec = select_by_number_vertices_exec;
+ ot->exec = edbm_select_by_number_vertices_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_int(ot->srna, "number", 4, 3, INT_MAX, "Number of Vertices", "", 3, INT_MAX);
RNA_def_enum(ot->srna, "type", type_items, 1, "Type", "Type of comparison to make");
}
-static int select_loose_verts_exec(bContext *C, wmOperator *UNUSED(op))
+static int edbm_select_loose_verts_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMVert *eve;
BMEdge *eed;
BMIter iter;
for (eve = BM_iter_new(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
- eve; eve = BM_iter_step(&iter)) {
+ eve; eve = BM_iter_step(&iter)) {
if (!eve->e) {
BM_elem_select_set(em->bm, eve, TRUE);
@@ -3897,7 +3858,7 @@ static int select_loose_verts_exec(bContext *C, wmOperator *UNUSED(op))
}
for (eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
- eed; eed = BM_iter_step(&iter)) {
+ eed; eed = BM_iter_step(&iter)) {
if (!eed->l) {
BM_elem_select_set(em->bm, eed, TRUE);
@@ -3906,7 +3867,7 @@ static int select_loose_verts_exec(bContext *C, wmOperator *UNUSED(op))
EDBM_selectmode_flush(em);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
}
@@ -3918,22 +3879,22 @@ void MESH_OT_select_loose_verts(wmOperatorType *ot)
ot->idname = "MESH_OT_select_loose_verts";
/* api callbacks */
- ot->exec = select_loose_verts_exec;
+ ot->exec = edbm_select_loose_verts_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int select_mirror_exec(bContext *C, wmOperator *op)
+static int edbm_select_mirror_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
int extend = RNA_boolean_get(op->ptr, "extend");
EDBM_select_mirrored(obedit, em, extend);
EDBM_selectmode_flush(em);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
}
@@ -3946,21 +3907,21 @@ void MESH_OT_select_mirror(wmOperatorType *ot)
ot->idname = "MESH_OT_select_mirror";
/* api callbacks */
- ot->exec = select_mirror_exec;
+ ot->exec = edbm_select_mirror_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the existing selection");
}
#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;
@@ -3972,8 +3933,8 @@ static int vergxco(const void *v1, const void *v2)
{
const xvertsort *x1 = v1, *x2 = v2;
- if (x1->x > x2->x) return 1;
- else if (x1->x < x2->x) return -1;
+ if (x1->x > x2->x) return 1;
+ else if (x1->x < x2->x) return -1;
return 0;
}
@@ -3986,8 +3947,8 @@ static int vergface(const void *v1, const void *v2)
{
const struct facesort *x1 = v1, *x2 = v2;
- if (x1->x > x2->x) return 1;
- else if (x1->x < x2->x) return -1;
+ if (x1->x > x2->x) return 1;
+ else if (x1->x < x2->x) return -1;
return 0;
}
#endif
@@ -4020,8 +3981,9 @@ static void xsortvert_flag(bContext *UNUSED(C), int UNUSED(flag))
em = vc.em;
amount = em->bm->totvert;
- sortblock = MEM_callocN(sizeof(xvertsort) * amount,"xsort");
- BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
+ sortblock = MEM_callocN(sizeof(xvertsort) * amount, "xsort");
+ BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL)
+ {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT))
sortblock[i].v1 = eve;
}
@@ -4031,7 +3993,7 @@ static void xsortvert_flag(bContext *UNUSED(C), int UNUSED(flag))
qsort(sortblock, amount, sizeof(xvertsort), vergxco);
- /* make temporal listbase */
+ /* make temporal listbase */
tbase.first = tbase.last = 0;
for (i = 0; i < amount; i++) {
eve = sortblock[i].v1;
@@ -4049,7 +4011,7 @@ static void xsortvert_flag(bContext *UNUSED(C), int UNUSED(flag))
}
-static int mesh_vertices_sort_exec(bContext *C, wmOperator *UNUSED(op))
+static int edbm_vertices_sort_exec(bContext *C, wmOperator *UNUSED(op))
{
xsortvert_flag(C, SELECT);
return OPERATOR_FINISHED;
@@ -4063,12 +4025,12 @@ void MESH_OT_vertices_sort(wmOperatorType *ot)
ot->idname = "MESH_OT_vertices_sort";
/* api callbacks */
- ot->exec = mesh_vertices_sort_exec;
+ ot->exec = edbm_vertices_sort_exec;
ot->poll = EM_view3d_poll; /* uses view relative X axis to sort verts */
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* ********************** SORT FACES ******************* */
@@ -4104,7 +4066,7 @@ static int float_sort(const void *v1, const void *v2)
return 0;
}
-static int sort_faces_exec(bContext *C, wmOperator *op)
+static int edbm_sort_faces_exec(bContext *C, wmOperator *op)
{
RegionView3D *rv3d = ED_view3d_context_rv3d(C);
View3D *v3d = CTX_wm_view3d(C);
@@ -4164,7 +4126,7 @@ static int sort_faces_exec(bContext *C, wmOperator *op)
float cur[3];
if (event == 1)
- mult_m4_m4m4(mat, rv3d->viewmat, OBACT->obmat); /* apply the view matrix to the object matrix */
+ mult_m4_m4m4(mat, rv3d->viewmat, OBACT->obmat); /* apply the view matrix to the object matrix */
else if (event == 2) { /* sort from cursor */
if (v3d && v3d->localvd) {
copy_v3_v3(cur, v3d->cursor);
@@ -4180,7 +4142,7 @@ static int sort_faces_exec(bContext *C, wmOperator *op)
for (i = 0; i < me->totpoly; i++, mp++) {
if (event == 3) {
- face_sort_floats[i] = ((float)mp->mat_nr)*reverse;
+ face_sort_floats[i] = ((float)mp->mat_nr) * reverse;
}
else if (event == 4) {
/* selected first */
@@ -4243,11 +4205,11 @@ void MESH_OT_sort_faces(wmOperatorType *ot)
/* api callbacks */
ot->invoke = WM_menu_invoke;
- ot->exec = sort_faces_exec;
+ ot->exec = edbm_sort_faces_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
ot->prop = RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "");
@@ -4273,7 +4235,7 @@ static void hashvert_flag(EditMesh *em, int flag)
if (amount == 0) return;
/* allocate memory */
- sb = sortblock = (struct xvertsort *)MEM_mallocN(sizeof(struct xvertsort)*amount,"sortremovedoub");
+ sb = sortblock = (struct xvertsort *)MEM_mallocN(sizeof(struct xvertsort) * amount, "sortremovedoub");
eve = em->verts.first;
while (eve) {
if (eve->f & flag) {
@@ -4313,10 +4275,10 @@ static void hashvert_flag(EditMesh *em, int flag)
}
#endif
-static int mesh_vertices_randomize_exec(bContext *C, wmOperator *UNUSED(op))
+static int edbm_vertices_randomize_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
#if 1 /* BMESH TODO */
(void)em;
#else
@@ -4333,41 +4295,43 @@ void MESH_OT_vertices_randomize(wmOperatorType *ot)
ot->idname = "MESH_OT_vertices_randomize";
/* api callbacks */
- ot->exec = mesh_vertices_randomize_exec;
+ ot->exec = edbm_vertices_randomize_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/******end of qsort stuff ****/
-static int mesh_noise_exec(bContext *C, wmOperator *op)
+static int edbm_noise_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
Material *ma;
Tex *tex;
BMVert *eve;
BMIter iter;
float fac = RNA_float_get(op->ptr, "factor");
- if (em == NULL) return OPERATOR_FINISHED;
+ if (em == NULL) {
+ return OPERATOR_FINISHED;
+ }
- ma = give_current_material(obedit, obedit->actcol);
- if (ma == 0 || ma->mtex[0] == 0 || ma->mtex[0]->tex == 0) {
+ if ((ma = give_current_material(obedit, obedit->actcol)) == NULL ||
+ (tex = give_current_material_texture(ma)) == NULL)
+ {
BKE_report(op->reports, RPT_WARNING, "Mesh has no material or texture assigned");
return OPERATOR_FINISHED;
}
- tex = give_current_material_texture(ma);
if (tex->type == TEX_STUCCI) {
float b2, vec[3];
float ofs = tex->turbul / 200.0;
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
- if (BM_elem_flag_test(eve, BM_ELEM_SELECT) && !BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
+ if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
b2 = BLI_hnoise(tex->noisesize, eve->co[0], eve->co[1], eve->co[2]);
if (tex->stype) ofs *= (b2 * b2);
vec[0] = fac * (b2 - BLI_hnoise(tex->noisesize, eve->co[0] + ofs, eve->co[1], eve->co[2]));
@@ -4380,7 +4344,7 @@ static int mesh_noise_exec(bContext *C, wmOperator *op)
}
else {
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
- if (BM_elem_flag_test(eve, BM_ELEM_SELECT) && !BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
+ if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
float tin, dum;
externtex(ma->mtex[0], eve->co, &tin, &dum, &dum, &dum, &dum, 0);
eve->co[2] += fac * tin;
@@ -4388,10 +4352,9 @@ static int mesh_noise_exec(bContext *C, wmOperator *op)
}
}
- EDBM_RecalcNormals(em);
+ EDBM_mesh_normals_update(em);
- DAG_id_tag_update(obedit->data, 0);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -4404,24 +4367,24 @@ void MESH_OT_noise(wmOperatorType *ot)
ot->idname = "MESH_OT_noise";
/* api callbacks */
- ot->exec = mesh_noise_exec;
+ ot->exec = edbm_noise_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_float(ot->srna, "factor", 0.1f, -FLT_MAX, FLT_MAX, "Factor", "", 0.0f, 1.0f);
}
/* bevel! yay!!*/
-static int mesh_bevel_exec(bContext *C, wmOperator *op)
+static int edbm_bevel_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = (((Mesh *)obedit->data))->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMIter iter;
BMEdge *eed;
BMOperator bmop;
- float factor = RNA_float_get(op->ptr, "percent"), fac = factor /*, dfac */ /* UNUSED */, df, s;
+ float factor = RNA_float_get(op->ptr, "percent") /*, dfac */ /* UNUSED */, df, s;
int i, recursion = RNA_int_get(op->ptr, "recursion");
const int use_even = RNA_boolean_get(op->ptr, "use_even");
const int use_dist = RNA_boolean_get(op->ptr, "use_dist");
@@ -4458,11 +4421,10 @@ static int mesh_bevel_exec(bContext *C, wmOperator *op)
mul_vn_fl(w, recursion, 1.0f / (float)ftot);
- fac = factor;
for (i = 0; i < recursion; i++) {
- fac = w[recursion - i - 1] * factor;
+ float fac = w[recursion - i - 1] * factor;
- if (!EDBM_InitOpf(em, &bmop, op,
+ if (!EDBM_op_init(em, &bmop, op,
"bevel geom=%hev percent=%f lengthlayer=%i use_lengths=%b use_even=%b use_dist=%b",
BM_ELEM_SELECT, fac, li, TRUE, use_even, use_dist))
{
@@ -4470,7 +4432,7 @@ static int mesh_bevel_exec(bContext *C, wmOperator *op)
}
BMO_op_exec(em->bm, &bmop);
- if (!EDBM_FinishOp(em, &bmop, op, TRUE))
+ if (!EDBM_op_finish(em, &bmop, op, TRUE))
return OPERATOR_CANCELLED;
}
@@ -4478,10 +4440,9 @@ static int mesh_bevel_exec(bContext *C, wmOperator *op)
MEM_freeN(w);
- EDBM_RecalcNormals(em);
+ EDBM_mesh_normals_update(em);
- DAG_id_tag_update(obedit->data, 0);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -4494,11 +4455,11 @@ void MESH_OT_bevel(wmOperatorType *ot)
ot->idname = "MESH_OT_bevel";
/* api callbacks */
- ot->exec = mesh_bevel_exec;
+ ot->exec = edbm_bevel_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_float(ot->srna, "percent", 0.5f, -FLT_MAX, FLT_MAX, "Percentage", "", 0.0f, 1.0f);
RNA_def_int(ot->srna, "recursion", 1, 1, 50, "Recursion Level", "Recursion Level", 1, 8);
@@ -4508,16 +4469,15 @@ void MESH_OT_bevel(wmOperatorType *ot)
}
-static int bridge_edge_loops(bContext *C, wmOperator *op)
+static int edbm_bridge_edge_loops_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
- if (!EDBM_CallOpf(em, op, "bridge_loops edges=%he", BM_ELEM_SELECT))
+ if (!EDBM_op_callf(em, op, "bridge_loops edges=%he", BM_ELEM_SELECT))
return OPERATOR_CANCELLED;
- DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
@@ -4525,16 +4485,77 @@ static int bridge_edge_loops(bContext *C, wmOperator *op)
void MESH_OT_bridge_edge_loops(wmOperatorType *ot)
{
/* identifiers */
- ot->name = "Bridge edge loops";
+ ot->name = "Bridge Two Edge Loops";
ot->description = "Make faces between two edge loops";
ot->idname = "MESH_OT_bridge_edge_loops";
/* api callbacks */
- ot->exec = bridge_edge_loops;
+ ot->exec = edbm_bridge_edge_loops_exec;
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "inside", 0, "Inside", "");
}
+
+
+
+static int edbm_inset_exec(bContext *C, wmOperator *op)
+{
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
+ BMOperator bmop;
+ const int use_boundary = RNA_boolean_get(op->ptr, "use_boundary");
+ const int use_even_offset = RNA_boolean_get(op->ptr, "use_even_offset");
+ const int use_relative_offset = RNA_boolean_get(op->ptr, "use_relative_offset");
+ const float thickness = RNA_float_get(op->ptr, "thickness");
+ const int use_outset = RNA_boolean_get(op->ptr, "use_outset");
+
+ EDBM_op_init(em, &bmop, op,
+ "inset faces=%hf use_boundary=%b use_even_offset=%b use_relative_offset=%b thickness=%f use_outset=%b",
+ BM_ELEM_SELECT, use_boundary, use_even_offset, use_relative_offset, thickness, use_outset);
+
+ BMO_op_exec(em->bm, &bmop);
+
+ /* deselect original verts */
+ EDBM_flag_disable_all(em, BM_ELEM_SELECT);
+
+ BMO_slot_buffer_hflag_enable(em->bm, &bmop, "faceout", BM_FACE, BM_ELEM_SELECT, TRUE);
+
+ if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
+ return OPERATOR_CANCELLED;
+ }
+ else {
+ EDBM_update_generic(C, em, TRUE);
+ return OPERATOR_FINISHED;
+ }
+}
+
+void MESH_OT_inset(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name = "Inset Faces";
+ ot->idname = "MESH_OT_inset";
+
+ /* api callbacks */
+ ot->exec = edbm_inset_exec;
+ ot->poll = ED_operator_editmesh;
+ ot->description = "";
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+ /* properties */
+ RNA_def_boolean(ot->srna, "use_boundary", TRUE, "Boundary", "Inset face boundries");
+ RNA_def_boolean(ot->srna, "use_even_offset", TRUE, "Offset Even", "Scale the offset to give more even thickness");
+ RNA_def_boolean(ot->srna, "use_relative_offset", FALSE, "Offset Relative", "Scale the offset by surrounding geometry");
+
+ prop = RNA_def_float(ot->srna, "thickness", 0.01f, 0.0f, FLT_MAX, "thickness", "", 0.0f, 10.0f);
+ /* use 1 rather then 10 for max else dragging the button moves too far */
+ RNA_def_property_ui_range(prop, 0.0, 1.0, 0.01, 4);
+
+ RNA_def_boolean(ot->srna, "use_outset", FALSE, "Outset", "Outset rather than inset");
+}
diff --git a/source/blender/editors/mesh/bmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index e5c79150dab..11f58303215 100644
--- a/source/blender/editors/mesh/bmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -25,6 +25,10 @@
* ***** END GPL LICENSE BLOCK *****
*/
+/** \file blender/editors/mesh/editmesh_utils.c
+ * \ingroup edmesh
+ */
+
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
@@ -37,6 +41,7 @@
#include "BKE_DerivedMesh.h"
#include "BKE_bmesh.h"
#include "BKE_context.h"
+#include "BKE_depsgraph.h"
#include "BKE_key.h"
#include "BKE_library.h"
#include "BKE_mesh.h"
@@ -51,12 +56,14 @@
#include "bmesh.h"
-void EDBM_RecalcNormals(BMEditMesh *em)
+#include "mesh_intern.h"
+
+void EDBM_mesh_normals_update(BMEditMesh *em)
{
BM_mesh_normals_update(em->bm, TRUE);
}
-void EDBM_ClearMesh(BMEditMesh *em)
+void EDBM_mesh_clear(BMEditMesh *em)
{
/* clear bmesh */
BM_mesh_clear(em->bm);
@@ -73,7 +80,7 @@ void EDBM_ClearMesh(BMEditMesh *em)
em->derivedCage = em->derivedFinal = NULL;
- /* free tesselation data */
+ /* free tessellation data */
em->tottri = 0;
if (em->looptris)
MEM_freeN(em->looptris);
@@ -106,7 +113,7 @@ void EDBM_stats_update(BMEditMesh *em)
}
}
-int EDBM_InitOpf(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *fmt, ...)
+int EDBM_op_init(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *fmt, ...)
{
BMesh *bm = em->bm;
va_list list;
@@ -130,7 +137,7 @@ int EDBM_InitOpf(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *f
/* returns 0 on error, 1 on success. executes and finishes a bmesh operator */
-int EDBM_FinishOp(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const int report)
+int EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const int report)
{
const char *errmsg;
@@ -139,16 +146,24 @@ int EDBM_FinishOp(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const int re
if (BMO_error_get(em->bm, &errmsg, NULL)) {
BMEditMesh *emcopy = em->emcopy;
- if (report) BKE_report(op->reports, RPT_ERROR, errmsg);
+ if (report) {
+ BKE_report(op->reports, RPT_ERROR, errmsg);
+ }
BMEdit_Free(em);
*em = *emcopy;
- BMEdit_RecalcTesselation(em);
MEM_freeN(emcopy);
em->emcopyusers = 0;
em->emcopy = NULL;
- return 0;
+
+ /* when copying, tessellation isn't to for faster copying,
+ * but means we need to re-tessellate here */
+ if (em->looptris == NULL) {
+ BMEdit_RecalcTessellation(em);
+ }
+
+ return FALSE;
}
else {
em->emcopyusers--;
@@ -161,12 +176,12 @@ int EDBM_FinishOp(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const int re
MEM_freeN(em->emcopy);
em->emcopy = NULL;
}
- }
- return 1;
+ return TRUE;
+ }
}
-int EDBM_CallOpf(BMEditMesh *em, wmOperator *op, const char *fmt, ...)
+int EDBM_op_callf(BMEditMesh *em, wmOperator *op, const char *fmt, ...)
{
BMesh *bm = em->bm;
BMOperator bmop;
@@ -187,10 +202,10 @@ int EDBM_CallOpf(BMEditMesh *em, wmOperator *op, const char *fmt, ...)
BMO_op_exec(bm, &bmop);
va_end(list);
- return EDBM_FinishOp(em, &bmop, op, TRUE);
+ return EDBM_op_finish(em, &bmop, op, TRUE);
}
-int EDBM_CallAndSelectOpf(BMEditMesh *em, wmOperator *op, const char *selectslot, const char *fmt, ...)
+int EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *selectslot, const char *fmt, ...)
{
BMesh *bm = em->bm;
BMOperator bmop;
@@ -210,15 +225,15 @@ int EDBM_CallAndSelectOpf(BMEditMesh *em, wmOperator *op, const char *selectslot
BMO_op_exec(bm, &bmop);
- BM_mesh_elem_flag_disable_all(em->bm, BM_VERT|BM_EDGE|BM_FACE, BM_ELEM_SELECT);
+ BM_mesh_elem_flag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE);
- BMO_slot_buffer_hflag_enable(em->bm, &bmop, selectslot, BM_ELEM_SELECT, BM_ALL, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, &bmop, selectslot, BM_ALL, BM_ELEM_SELECT, TRUE);
va_end(list);
- return EDBM_FinishOp(em, &bmop, op, TRUE);
+ return EDBM_op_finish(em, &bmop, op, TRUE);
}
-int EDBM_CallOpfSilent(BMEditMesh *em, const char *fmt, ...)
+int EDBM_op_call_silentf(BMEditMesh *em, const char *fmt, ...)
{
BMesh *bm = em->bm;
BMOperator bmop;
@@ -238,14 +253,14 @@ int EDBM_CallOpfSilent(BMEditMesh *em, const char *fmt, ...)
BMO_op_exec(bm, &bmop);
va_end(list);
- return EDBM_FinishOp(em, &bmop, NULL, FALSE);
+ return EDBM_op_finish(em, &bmop, NULL, FALSE);
}
void EDBM_selectmode_to_scene(bContext *C)
{
Scene *scene = CTX_data_scene(C);
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
if (!em)
return;
@@ -253,31 +268,27 @@ void EDBM_selectmode_to_scene(bContext *C)
scene->toolsettings->selectmode = em->selectmode;
/* Request redraw of header buttons (to show new select mode) */
- WM_event_add_notifier(C, NC_SCENE|ND_TOOLSETTINGS, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_TOOLSETTINGS, scene);
}
-void EDBM_MakeEditBMesh(ToolSettings *ts, Scene *UNUSED(scene), Object *ob)
+void EDBM_mesh_make(ToolSettings *ts, Scene *UNUSED(scene), Object *ob)
{
Mesh *me = ob->data;
BMesh *bm;
- if (!me->mpoly && me->totface) {
- fprintf(stderr, "%s: bmesh conversion issue! may lose lots of geometry! (bmesh internal error)\n", __func__);
-
- /* BMESH_TODO need to write smarter code here */
- bm = BKE_mesh_to_bmesh(me, ob);
- }
- else {
- bm = BKE_mesh_to_bmesh(me, ob);
+ if (UNLIKELY(!me->mpoly && me->totface)) {
+ BKE_mesh_convert_mfaces_to_mpolys(me);
}
+ bm = BKE_mesh_to_bmesh(me, ob);
+
if (me->edit_btmesh) {
/* this happens when switching shape keys */
BMEdit_Free(me->edit_btmesh);
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);
@@ -290,12 +301,12 @@ void EDBM_MakeEditBMesh(ToolSettings *ts, Scene *UNUSED(scene), Object *ob)
me->edit_btmesh->ob = ob;
}
-void EDBM_LoadEditBMesh(Scene *scene, Object *ob)
+void EDBM_mesh_load(Object *ob)
{
Mesh *me = ob->data;
BMesh *bm = me->edit_btmesh->bm;
- BMO_op_callf(bm, "object_load_bmesh scene=%p object=%p", scene, ob);
+ BM_mesh_bm_to_me(bm, me, FALSE);
#ifdef USE_TESSFACE_DEFAULT
BKE_mesh_tessface_calc(me);
@@ -303,14 +314,14 @@ void EDBM_LoadEditBMesh(Scene *scene, Object *ob)
}
-void EDBM_FreeEditBMesh(BMEditMesh *tm)
+void EDBM_mesh_free(BMEditMesh *tm)
{
BMEdit_Free(tm);
}
-void EDBM_init_index_arrays(BMEditMesh *tm, int forvert, int foredge, int forface)
+void EDBM_index_arrays_init(BMEditMesh *tm, int forvert, int foredge, int forface)
{
- EDBM_free_index_arrays(tm);
+ EDBM_index_arrays_free(tm);
if (forvert) {
BMIter iter;
@@ -352,7 +363,7 @@ void EDBM_init_index_arrays(BMEditMesh *tm, int forvert, int foredge, int forfac
}
}
-void EDBM_free_index_arrays(BMEditMesh *tm)
+void EDBM_index_arrays_free(BMEditMesh *tm)
{
if (tm->vert_index) {
MEM_freeN(tm->vert_index);
@@ -370,17 +381,17 @@ void EDBM_free_index_arrays(BMEditMesh *tm)
}
}
-BMVert *EDBM_get_vert_for_index(BMEditMesh *tm, int index)
+BMVert *EDBM_vert_at_index(BMEditMesh *tm, int index)
{
- return tm->vert_index && index < tm->bm->totvert ?tm->vert_index[index]:NULL;
+ return tm->vert_index && index < tm->bm->totvert ? tm->vert_index[index] : NULL;
}
-BMEdge *EDBM_get_edge_for_index(BMEditMesh *tm, int index)
+BMEdge *EDBM_edge_at_index(BMEditMesh *tm, int index)
{
- return tm->edge_index && index < tm->bm->totedge ?tm->edge_index[index]:NULL;
+ return tm->edge_index && index < tm->bm->totedge ? tm->edge_index[index] : NULL;
}
-BMFace *EDBM_get_face_for_index(BMEditMesh *tm, int index)
+BMFace *EDBM_face_at_index(BMEditMesh *tm, int index)
{
return (tm->face_index && index < tm->bm->totface && index >= 0) ? tm->face_index[index] : NULL;
}
@@ -415,14 +426,14 @@ void EDBM_select_flush(BMEditMesh *em)
void EDBM_select_more(BMEditMesh *em)
{
BMOperator bmop;
- int use_faces = em->selectmode > SCE_SELECT_EDGE;
+ int use_faces = em->selectmode == SCE_SELECT_FACE;
BMO_op_initf(em->bm, &bmop,
"regionextend geom=%hvef constrict=%b use_faces=%b",
BM_ELEM_SELECT, FALSE, use_faces);
BMO_op_exec(em->bm, &bmop);
- /* dont flush selection in edge/vertex mode */
- BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL, use_faces ? TRUE : FALSE);
+ /* don't flush selection in edge/vertex mode */
+ BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ALL, BM_ELEM_SELECT, use_faces ? TRUE : FALSE);
BMO_op_finish(em->bm, &bmop);
EDBM_select_flush(em);
@@ -431,20 +442,20 @@ void EDBM_select_more(BMEditMesh *em)
void EDBM_select_less(BMEditMesh *em)
{
BMOperator bmop;
- int use_faces = em->selectmode > SCE_SELECT_EDGE;
+ int use_faces = em->selectmode == SCE_SELECT_FACE;
BMO_op_initf(em->bm, &bmop,
"regionextend geom=%hvef constrict=%b use_faces=%b",
BM_ELEM_SELECT, TRUE, use_faces);
BMO_op_exec(em->bm, &bmop);
- /* dont flush selection in edge/vertex mode */
- BMO_slot_buffer_hflag_disable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL, use_faces ? TRUE : FALSE);
+ /* don't flush selection in edge/vertex mode */
+ BMO_slot_buffer_hflag_disable(em->bm, &bmop, "geomout", BM_ALL, BM_ELEM_SELECT, use_faces ? TRUE : FALSE);
BMO_op_finish(em->bm, &bmop);
EDBM_selectmode_flush(em);
}
-int EDBM_get_actSelection(BMEditMesh *em, BMEditSelection *ese)
+int EDBM_editselection_active_get(BMEditMesh *em, BMEditSelection *ese)
{
BMEditSelection *ese_last = em->bm->selected.last;
BMFace *efa = BM_active_face_get(em->bm, FALSE);
@@ -479,12 +490,12 @@ int EDBM_get_actSelection(BMEditMesh *em, BMEditSelection *ese)
void EDBM_flag_disable_all(BMEditMesh *em, const char hflag)
{
- BM_mesh_elem_flag_disable_all(em->bm, BM_VERT|BM_EDGE|BM_FACE, hflag);
+ BM_mesh_elem_flag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, hflag, FALSE);
}
void EDBM_flag_enable_all(BMEditMesh *em, const char hflag)
{
- BM_mesh_elem_flag_enable_all(em->bm, BM_VERT|BM_EDGE|BM_FACE, hflag);
+ BM_mesh_elem_flag_enable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, hflag, TRUE);
}
/**************-------------- Undo ------------*****************/
@@ -501,11 +512,11 @@ static void *getEditMesh(bContext *C)
return NULL;
}
-typedef struct undomesh {
+typedef struct UndoMesh {
Mesh me;
int selectmode;
char obname[MAX_ID_NAME - 2];
-} undomesh;
+} UndoMesh;
/* undo simply makes copies of a bmesh */
static void *editbtMesh_to_undoMesh(void *emv, void *obdata)
@@ -513,31 +524,26 @@ static void *editbtMesh_to_undoMesh(void *emv, void *obdata)
BMEditMesh *em = emv;
Mesh *obme = obdata;
- undomesh *um = MEM_callocN(sizeof(undomesh), "undo Mesh");
- BLI_strncpy(um->obname, em->bm->ob->id.name + 2, sizeof(um->obname));
+ UndoMesh *um = MEM_callocN(sizeof(UndoMesh), "undo Mesh");
+ BLI_strncpy(um->obname, em->ob->id.name + 2, sizeof(um->obname));
/* make sure shape keys work */
um->me.key = obme->key ? copy_key_nolib(obme->key) : NULL;
-#ifdef BMESH_EM_UNDO_RECALC_TESSFACE_WORKAROUND
+ /* BM_mesh_validate(em->bm); */ /* for troubleshooting */
- /* we recalc the tesselation here, to avoid seeding calls to
- * BMEdit_RecalcTesselation throughout the code. */
- BMEdit_RecalcTesselation(em);
-
-#endif
+ BM_mesh_bm_to_me(em->bm, &um->me, FALSE);
- BMO_op_callf(em->bm, "bmesh_to_mesh mesh=%p notesselation=%b", &um->me, TRUE);
um->selectmode = em->selectmode;
return um;
}
-static void undoMesh_to_editbtMesh(void *umv, void *emv, void *UNUSED(obdata))
+static void undoMesh_to_editbtMesh(void *umv, void *em_v, void *UNUSED(obdata))
{
- BMEditMesh *em = emv, *em2;
+ BMEditMesh *em = em_v, *em_tmp;
Object *ob;
- undomesh *um = umv;
+ UndoMesh *um = umv;
BMesh *bm;
/* BMESH_TODO - its possible the name wont be found right?, should fallback */
@@ -546,37 +552,49 @@ static void undoMesh_to_editbtMesh(void *umv, void *emv, void *UNUSED(obdata))
BMEdit_Free(em);
- bm = BM_mesh_create(ob, bm_mesh_allocsize_default);
- BMO_op_callf(bm, "mesh_to_bmesh mesh=%p object=%p set_shapekey=%b", &um->me, ob, FALSE);
+ bm = BM_mesh_create(&bm_mesh_allocsize_default);
- em2 = BMEdit_Create(bm, TRUE);
- *em = *em2;
+ BM_mesh_bm_from_me(bm, &um->me, FALSE, ob->shapenr);
+
+ /* face normals need recalculation since we are not calling through an operator */
+ BM_mesh_normals_update(bm, TRUE);
+
+ em_tmp = BMEdit_Create(bm, TRUE);
+ *em = *em_tmp;
em->selectmode = um->selectmode;
+ em->ob = ob;
- MEM_freeN(em2);
+ MEM_freeN(em_tmp);
}
-
-static void free_undo(void *umv)
+static void free_undo(void *me_v)
{
- if (((Mesh *)umv)->key) {
- free_key(((Mesh *)umv)->key);
- MEM_freeN(((Mesh *)umv)->key);
+ Mesh *me = me_v;
+ if (me->key) {
+ free_key(me->key);
+ MEM_freeN(me->key);
}
-
- free_mesh(umv, 0);
- MEM_freeN(umv);
+
+ free_mesh(me, FALSE);
+ MEM_freeN(me);
}
/* and this is all the undo system needs to know */
void undo_push_mesh(bContext *C, const char *name)
{
+ /* em->ob gets out of date and crashes on mesh undo,
+ * this is an easy way to ensure its OK
+ * though we could investigate the matter further. */
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
+ em->ob = obedit;
+
undo_editmode_push(C, name, getEditMesh, free_undo, undoMesh_to_editbtMesh, editbtMesh_to_undoMesh, NULL);
}
/* write comment here */
-UvVertMap *EDBM_make_uv_vert_map(BMEditMesh *em, int selected, int do_face_idx_array, float *limit)
+UvVertMap *EDBM_uv_vert_map_create(BMEditMesh *em, int selected, int do_face_idx_array, float *limit)
{
BMVert *ev;
BMFace *efa;
@@ -591,7 +609,7 @@ UvVertMap *EDBM_make_uv_vert_map(BMEditMesh *em, int selected, int do_face_idx_a
int totverts, i, totuv;
if (do_face_idx_array)
- EDBM_init_index_arrays(em, 0, 0, 1);
+ EDBM_index_arrays_init(em, 0, 0, 1);
BM_mesh_elem_index_ensure(em->bm, BM_VERT);
@@ -606,23 +624,23 @@ UvVertMap *EDBM_make_uv_vert_map(BMEditMesh *em, int selected, int do_face_idx_a
if (totuv == 0) {
if (do_face_idx_array)
- EDBM_free_index_arrays(em);
+ EDBM_index_arrays_free(em);
return NULL;
}
vmap = (UvVertMap *)MEM_callocN(sizeof(*vmap), "UvVertMap");
if (!vmap) {
if (do_face_idx_array)
- EDBM_free_index_arrays(em);
+ EDBM_index_arrays_free(em);
return NULL;
}
- vmap->vert = (UvMapVert **)MEM_callocN(sizeof(*vmap->vert)*totverts, "UvMapVert_pt");
- buf = vmap->buf = (UvMapVert *)MEM_callocN(sizeof(*vmap->buf)*totuv, "UvMapVert");
+ vmap->vert = (UvMapVert **)MEM_callocN(sizeof(*vmap->vert) * totverts, "UvMapVert_pt");
+ buf = vmap->buf = (UvMapVert *)MEM_callocN(sizeof(*vmap->buf) * totuv, "UvMapVert");
if (!vmap->vert || !vmap->buf) {
free_uv_vert_map(vmap);
if (do_face_idx_array)
- EDBM_free_index_arrays(em);
+ EDBM_index_arrays_free(em);
return NULL;
}
@@ -659,7 +677,7 @@ UvVertMap *EDBM_make_uv_vert_map(BMEditMesh *em, int selected, int do_face_idx_a
v->next = newvlist;
newvlist = v;
- efa = EDBM_get_face_for_index(em, v->f);
+ efa = EDBM_face_at_index(em, v->f);
/* tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */
l = BM_iter_at_index(em->bm, BM_LOOPS_OF_FACE, efa, v->tfindex);
@@ -671,7 +689,7 @@ UvVertMap *EDBM_make_uv_vert_map(BMEditMesh *em, int selected, int do_face_idx_a
while (iterv) {
next = iterv->next;
- efa = EDBM_get_face_for_index(em, iterv->f);
+ efa = EDBM_face_at_index(em, iterv->f);
/* tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */
l = BM_iter_at_index(em->bm, BM_LOOPS_OF_FACE, efa, iterv->tfindex);
@@ -686,8 +704,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;
}
@@ -700,13 +719,13 @@ UvVertMap *EDBM_make_uv_vert_map(BMEditMesh *em, int selected, int do_face_idx_a
}
if (do_face_idx_array)
- EDBM_free_index_arrays(em);
+ EDBM_index_arrays_free(em);
return vmap;
}
-UvMapVert *EDBM_get_uv_map_vert(UvVertMap *vmap, unsigned int v)
+UvMapVert *EDBM_uv_vert_map_at_index(UvVertMap *vmap, unsigned int v)
{
return vmap->vert[v];
}
@@ -715,7 +734,7 @@ UvMapVert *EDBM_get_uv_map_vert(UvVertMap *vmap, unsigned int v)
/* A specialized vert map used by stitch operator */
-UvElementMap *EDBM_make_uv_element_map(BMEditMesh *em, int selected, int do_islands)
+UvElementMap *EDBM_uv_element_map_create(BMEditMesh *em, int selected, int do_islands)
{
BMVert *ev;
BMFace *efa;
@@ -740,7 +759,7 @@ UvElementMap *EDBM_make_uv_element_map(BMEditMesh *em, int selected, int do_isla
totverts = em->bm->totvert;
totuv = 0;
- island_number = MEM_mallocN(sizeof(*stack)*em->bm->totface, "uv_island_number_face");
+ island_number = MEM_mallocN(sizeof(*stack) * em->bm->totface, "uv_island_number_face");
if (!island_number) {
return NULL;
}
@@ -765,7 +784,7 @@ UvElementMap *EDBM_make_uv_element_map(BMEditMesh *em, int selected, int do_isla
buf = element_map->buf = (UvElement *)MEM_callocN(sizeof(*element_map->buf) * totuv, "UvElement");
if (!element_map->vert || !element_map->buf) {
- EDBM_free_uv_element_map(element_map);
+ EDBM_uv_element_map_free(element_map);
MEM_freeN(island_number);
return NULL;
}
@@ -840,9 +859,9 @@ UvElementMap *EDBM_make_uv_element_map(BMEditMesh *em, int selected, int do_isla
if (do_islands) {
/* map holds the map from current vmap->buf to the new, sorted map */
- map = MEM_mallocN(sizeof(*map)*totuv, "uvelement_remap");
- stack = MEM_mallocN(sizeof(*stack)*em->bm->totface, "uv_island_face_stack");
- islandbuf = MEM_callocN(sizeof(*islandbuf)*totuv, "uvelement_island_buffer");
+ map = MEM_mallocN(sizeof(*map) * totuv, "uvelement_remap");
+ stack = MEM_mallocN(sizeof(*stack) * em->bm->totface, "uv_island_face_stack");
+ islandbuf = MEM_callocN(sizeof(*islandbuf) * totuv, "uvelement_island_buffer");
/* at this point, every UvElement in vert points to a UvElement sharing the same vertex. Now we should sort uv's in islands. */
for (i = 0; i < totuv; i++) {
@@ -899,12 +918,12 @@ UvElementMap *EDBM_make_uv_element_map(BMEditMesh *em, int selected, int do_isla
element_map->vert[i] = &islandbuf[map[element_map->vert[i] - element_map->buf]];
}
- element_map->islandIndices = MEM_callocN(sizeof(*element_map->islandIndices)*nislands,"UvElementMap_island_indices");
+ element_map->islandIndices = MEM_callocN(sizeof(*element_map->islandIndices) * nislands, "UvElementMap_island_indices");
if (!element_map->islandIndices) {
MEM_freeN(islandbuf);
MEM_freeN(stack);
MEM_freeN(map);
- EDBM_free_uv_element_map(element_map);
+ EDBM_uv_element_map_free(element_map);
MEM_freeN(island_number);
}
@@ -934,13 +953,7 @@ UvElementMap *EDBM_make_uv_element_map(BMEditMesh *em, int selected, int do_isla
return element_map;
}
-
-UvMapVert *EM_get_uv_map_vert(UvVertMap *vmap, unsigned int v)
-{
- return vmap->vert[v];
-}
-
-void EDBM_free_uv_vert_map(UvVertMap *vmap)
+void EDBM_uv_vert_map_free(UvVertMap *vmap)
{
if (vmap) {
if (vmap->vert) MEM_freeN(vmap->vert);
@@ -949,7 +962,7 @@ void EDBM_free_uv_vert_map(UvVertMap *vmap)
}
}
-void EDBM_free_uv_element_map(UvElementMap *element_map)
+void EDBM_uv_element_map_free(UvElementMap *element_map)
{
if (element_map) {
if (element_map->vert) MEM_freeN(element_map->vert);
@@ -960,12 +973,12 @@ 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 */
-MTexPoly *EDBM_get_active_mtexpoly(BMEditMesh *em, BMFace **r_act_efa, int sloppy)
+ * at the moment, last_sel is mainly useful for making sure the space image dosnt flicker */
+MTexPoly *EDBM_mtexpoly_active_get(BMEditMesh *em, BMFace **r_act_efa, int sloppy)
{
BMFace *efa = NULL;
- if (!EDBM_texFaceCheck(em))
+ if (!EDBM_mtexpoly_check(em))
return NULL;
efa = BM_active_face_get(em->bm, sloppy);
@@ -980,14 +993,14 @@ MTexPoly *EDBM_get_active_mtexpoly(BMEditMesh *em, BMFace **r_act_efa, int slopp
}
/* can we edit UV's for this mesh?*/
-int EDBM_texFaceCheck(BMEditMesh *em)
+int EDBM_mtexpoly_check(BMEditMesh *em)
{
/* some of these checks could be a touch overkill */
return em && em->bm->totface && CustomData_has_layer(&em->bm->pdata, CD_MTEXPOLY) &&
- CustomData_has_layer(&em->bm->ldata, CD_MLOOPUV);
+ CustomData_has_layer(&em->bm->ldata, CD_MLOOPUV);
}
-int EDBM_vertColorCheck(BMEditMesh *em)
+int EDBM_vert_color_check(BMEditMesh *em)
{
/* some of these checks could be a touch overkill */
return em && em->bm->totface && CustomData_has_layer(&em->bm->ldata, CD_MLOOPCOL);
@@ -999,11 +1012,31 @@ static BMVert *cache_mirr_intptr_as_bmvert(intptr_t *index_lookup, int index)
return (eve_i == -1) ? NULL : (BMVert *)eve_i;
}
+/**
+ * [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_verts_mirror_cache_begin(em);
+ * ...
+ * ...
+ * BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
+ * mirrorv = EDBM_verts_mirror_get(em, v);
+ * }
+ * ...
+ * ...
+ * EDBM_verts_mirror_cache_end(em);
+ *
+ * \note why do we only allow x axis mirror editing?
+ */
+
/* BM_SEARCH_MAXDIST is too big, copied from 2.6x MOC_THRESH, should become a
* preference */
#define BM_SEARCH_MAXDIST_MIRR 0.00002f
#define BM_CD_LAYER_ID "__mirror_index"
-void EDBM_CacheMirrorVerts(BMEditMesh *em, const short use_select)
+void EDBM_verts_mirror_cache_begin(BMEditMesh *em, const short use_select)
{
Mesh *me = em->me;
BMesh *bm = em->bm;
@@ -1020,7 +1053,7 @@ void EDBM_CacheMirrorVerts(BMEditMesh *em, const short use_select)
}
if (!em->vert_index) {
- EDBM_init_index_arrays(em, 1, 0, 0);
+ EDBM_index_arrays_init(em, 1, 0, 0);
em->mirr_free_arrays = 1;
}
@@ -1038,7 +1071,7 @@ void EDBM_CacheMirrorVerts(BMEditMesh *em, const short use_select)
ED_mesh_mirrtopo_init(me, -1, &mesh_topo_store, TRUE);
}
else {
- tree = BMBVH_NewBVH(em, 0, NULL, NULL);
+ tree = BMBVH_NewBVH(em, 0, NULL, NULL);
}
BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
@@ -1082,7 +1115,7 @@ void EDBM_CacheMirrorVerts(BMEditMesh *em, const short use_select)
em->mirror_cdlayer = li;
}
-BMVert *EDBM_GetMirrorVert(BMEditMesh *em, BMVert *v)
+BMVert *EDBM_verts_mirror_get(BMEditMesh *em, BMVert *v)
{
int *mirr = CustomData_bmesh_get_layer_n(&em->bm->vdata, v->head.data, em->mirror_cdlayer);
@@ -1091,7 +1124,7 @@ BMVert *EDBM_GetMirrorVert(BMEditMesh *em, BMVert *v)
if (mirr && *mirr >= 0 && *mirr < em->bm->totvert) {
if (!em->vert_index) {
printf("err: should only be called between "
- "EDBM_CacheMirrorVerts and EDBM_EndMirrorCache");
+ "EDBM_verts_mirror_cache_begin and EDBM_verts_mirror_cache_end");
return NULL;
}
@@ -1101,7 +1134,7 @@ BMVert *EDBM_GetMirrorVert(BMEditMesh *em, BMVert *v)
return NULL;
}
-void EDBM_ClearMirrorVert(BMEditMesh *em, BMVert *v)
+void EDBM_verts_mirror_cache_clear(BMEditMesh *em, BMVert *v)
{
int *mirr = CustomData_bmesh_get_layer_n(&em->bm->vdata, v->head.data, em->mirror_cdlayer);
@@ -1112,7 +1145,7 @@ void EDBM_ClearMirrorVert(BMEditMesh *em, BMVert *v)
}
}
-void EDBM_EndMirrorCache(BMEditMesh *em)
+void EDBM_verts_mirror_cache_end(BMEditMesh *em)
{
if (em->mirr_free_arrays) {
MEM_freeN(em->vert_index);
@@ -1122,7 +1155,7 @@ void EDBM_EndMirrorCache(BMEditMesh *em)
em->mirror_cdlayer = -1;
}
-void EDBM_ApplyMirrorCache(BMEditMesh *em, const int sel_from, const int sel_to)
+void EDBM_verts_mirror_apply(BMEditMesh *em, const int sel_from, const int sel_to)
{
BMIter iter;
BMVert *v;
@@ -1131,7 +1164,7 @@ void EDBM_ApplyMirrorCache(BMEditMesh *em, const int sel_from, const int sel_to)
BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
if (BM_elem_flag_test(v, BM_ELEM_SELECT) == sel_from) {
- BMVert *mirr = EDBM_GetMirrorVert(em, v);
+ BMVert *mirr = EDBM_verts_mirror_get(em, v);
if (mirr) {
if (BM_elem_flag_test(mirr, BM_ELEM_SELECT) == sel_to) {
copy_v3_v3(mirr->co, v->co);
@@ -1141,3 +1174,135 @@ void EDBM_ApplyMirrorCache(BMEditMesh *em, const int sel_from, const int sel_to)
}
}
}
+
+
+/* swap is 0 or 1, if 1 it hides not selected */
+void EDBM_mesh_hide(BMEditMesh *em, int swap)
+{
+ BMIter iter;
+ BMElem *ele;
+ int itermode;
+
+ if (em == NULL) return;
+
+ if (em->selectmode & SCE_SELECT_VERTEX)
+ itermode = BM_VERTS_OF_MESH;
+ else if (em->selectmode & SCE_SELECT_EDGE)
+ itermode = BM_EDGES_OF_MESH;
+ else
+ itermode = BM_FACES_OF_MESH;
+
+ BM_ITER(ele, &iter, em->bm, itermode, NULL) {
+ if (BM_elem_flag_test(ele, BM_ELEM_SELECT) ^ swap)
+ BM_elem_hide_set(em->bm, ele, TRUE);
+ }
+
+ EDBM_selectmode_flush(em);
+
+ /* 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
+ */
+}
+
+
+void EDBM_mesh_reveal(BMEditMesh *em)
+{
+ const char iter_types[3] = {BM_VERTS_OF_MESH,
+ BM_EDGES_OF_MESH,
+ BM_FACES_OF_MESH};
+
+ int sels[3] = {(em->selectmode & SCE_SELECT_VERTEX),
+ (em->selectmode & SCE_SELECT_EDGE),
+ (em->selectmode & SCE_SELECT_FACE), };
+
+ BMIter iter;
+ BMElem *ele;
+ int i;
+
+ /* Use tag flag to remember what was hidden before all is revealed.
+ * BM_ELEM_HIDDEN --> BM_ELEM_TAG */
+ for (i = 0; i < 3; i++) {
+ BM_ITER(ele, &iter, em->bm, iter_types[i], NULL) {
+ BM_elem_flag_set(ele, BM_ELEM_TAG, BM_elem_flag_test(ele, BM_ELEM_HIDDEN));
+ }
+ }
+
+ /* Reveal everything */
+ EDBM_flag_disable_all(em, BM_ELEM_HIDDEN);
+
+ /* Select relevant just-revealed elements */
+ for (i = 0; i < 3; i++) {
+ if (!sels[i]) {
+ continue;
+ }
+
+ BM_ITER(ele, &iter, em->bm, iter_types[i], NULL) {
+ if (BM_elem_flag_test(ele, BM_ELEM_TAG)) {
+ BM_elem_select_set(em->bm, ele, TRUE);
+ }
+ }
+ }
+
+ EDBM_selectmode_flush(em);
+
+ /* hidden faces can have invalid normals */
+ EDBM_mesh_normals_update(em);
+}
+
+/* so many tools call these that we better make it a generic function.
+ */
+void EDBM_update_generic(bContext *C, BMEditMesh *em, const short do_tessface)
+{
+ Object *ob = em->ob;
+ /* order of calling isn't important */
+ DAG_id_tag_update(ob->data, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data);
+
+ if (do_tessface) {
+ BMEdit_RecalcTessellation(em);
+ }
+}
+
+/* * Selection History ***************************************************** */
+/* these wrap equivalent bmesh functions. I'm in two minds of it we should
+ * just use the bm functions directly; on the one hand, there's no real
+ * need (at the moment) to wrap them, but on the other hand having these
+ * wrapped avoids a confusing mess of mixing BM_ and EDBM_ namespaces. */
+
+void EDBM_editselection_center(BMEditMesh *em, float *center, BMEditSelection *ese)
+{
+ BM_editselection_center(em->bm, center, ese);
+}
+
+void EDBM_editselection_normal(float *normal, BMEditSelection *ese)
+{
+ BM_editselection_normal(normal, 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. */
+void EDBM_editselection_plane(BMEditMesh *em, float *plane, BMEditSelection *ese)
+{
+ BM_editselection_plane(em->bm, plane, ese);
+}
+
+void EDBM_editselection_remove(BMEditMesh *em, BMHeader *ele)
+{
+ BM_select_history_remove(em->bm, (BMElem *)ele);
+}
+
+void EDBM_editselection_store(BMEditMesh *em, BMHeader *ele)
+{
+ BM_select_history_store(em->bm, (BMElem *)ele);
+}
+
+void EDBM_editselection_validate(BMEditMesh *em)
+{
+ BM_select_history_validate(em->bm);
+}
+/* end select history */
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index 2be66ca5310..69aeee48a4b 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -79,36 +79,48 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
{
Mesh *me = ob->data;
CustomData *data;
- void *actlayerdata, *rndlayerdata, *clonelayerdata, *stencillayerdata, *layerdata=layer->data;
- int type= layer->type;
+ void *actlayerdata, *rndlayerdata, *clonelayerdata, *stencillayerdata, *layerdata = layer->data;
+ int type = layer->type;
int index;
int i, actindex, rndindex, cloneindex, stencilindex, tot;
-
+
if (layer->type == CD_MLOOPCOL || layer->type == CD_MLOOPUV) {
- data = (me->edit_btmesh)? &me->edit_btmesh->bm->ldata: &me->ldata;
- tot = me->totloop;
- } else {
- data = (me->edit_btmesh)? &me->edit_btmesh->bm->pdata: &me->pdata;
- tot = me->totpoly;
+ if (me->edit_btmesh) {
+ data = &me->edit_btmesh->bm->ldata;
+ tot = me->edit_btmesh->bm->totloop;
+ }
+ else {
+ data = &me->ldata;
+ tot = me->totloop;
+ }
+ }
+ else {
+ if (me->edit_btmesh) {
+ data = &me->edit_btmesh->bm->pdata;
+ tot = me->edit_btmesh->bm->totface;
+ }
+ else {
+ data = &me->pdata;
+ tot = me->totpoly;
+ }
}
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 necassary 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;
stencillayerdata = data->layers[CustomData_get_stencil_layer_index(data, type)].data;
CustomData_set_layer_active(data, type, layer - &data->layers[index]);
- if(me->edit_btmesh) {
+ if (me->edit_btmesh) {
BM_data_layer_free(me->edit_btmesh->bm, data, type);
}
else {
@@ -116,14 +128,14 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
mesh_update_customdata_pointers(me, TRUE);
}
- if(!CustomData_has_layer(data, type) && (type == CD_MLOOPCOL && (ob->mode & OB_MODE_VERTEX_PAINT)))
+ if (!CustomData_has_layer(data, type) && (type == CD_MLOOPCOL && (ob->mode & OB_MODE_VERTEX_PAINT)))
ED_object_toggle_modes(C, OB_MODE_VERTEX_PAINT);
/* reconstruct active layer */
if (actlayerdata != layerdata) {
/* find index */
actindex = CustomData_get_layer_index(data, type);
- for (i=actindex; i<data->totlayer; i++) {
+ for (i = actindex; i < data->totlayer; i++) {
if (data->layers[i].data == actlayerdata) {
actindex = i - actindex;
break;
@@ -137,7 +149,7 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
if (rndlayerdata != layerdata) {
/* find index */
rndindex = CustomData_get_layer_index(data, type);
- for (i=rndindex; i<data->totlayer; i++) {
+ for (i = rndindex; i < data->totlayer; i++) {
if (data->layers[i].data == rndlayerdata) {
rndindex = i - rndindex;
break;
@@ -151,7 +163,7 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
if (clonelayerdata != layerdata) {
/* find index */
cloneindex = CustomData_get_layer_index(data, type);
- for (i=cloneindex; i<data->totlayer; i++) {
+ for (i = cloneindex; i < data->totlayer; i++) {
if (data->layers[i].data == clonelayerdata) {
cloneindex = i - cloneindex;
break;
@@ -165,7 +177,7 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
if (stencillayerdata != layerdata) {
/* find index */
stencilindex = CustomData_get_layer_index(data, type);
- for (i=stencilindex; i<data->totlayer; i++) {
+ for (i = stencilindex; i < data->totlayer; i++) {
if (data->layers[i].data == stencillayerdata) {
stencilindex = i - stencilindex;
break;
@@ -177,26 +189,45 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
}
}
-static void copy_editface_active_customdata(BMEditMesh *em, int type, int index)
+/* copies from active to 'index' */
+static void editmesh_face_copy_customdata(BMEditMesh *em, int type, int index)
{
-#if 1 /*BMESH_TODO*/
- (void)em;
- (void)type;
- (void)index;
-#else
- EditFace *efa;
- int n= CustomData_get_active_layer(&em->fdata, type);
+ BMesh *bm = em->bm;
+ CustomData *pdata = &bm->pdata;
+ BMIter iter;
+ BMFace *efa;
+ const int n = CustomData_get_active_layer(pdata, type);
+
+ /* ensure all current elements follow new customdata layout */
+ BM_ITER(efa, &iter, bm, BM_FACES_OF_MESH, NULL) {
+ void *data = CustomData_bmesh_get_n(pdata, efa->head.data, type, n);
+ CustomData_bmesh_set_n(pdata, efa->head.data, type, index, data);
+ }
+}
- for(efa= em->faces.first; efa; efa= efa->next) {
- void *data= CustomData_em_get_n(&em->fdata, efa->data, type, n);
- CustomData_em_set_n(&em->fdata, efa->data, type, index, data);
+/* copies from active to 'index' */
+static void editmesh_loop_copy_customdata(BMEditMesh *em, int type, int index)
+{
+ BMesh *bm = em->bm;
+ CustomData *ldata = &bm->ldata;
+ BMIter iter;
+ BMIter liter;
+ BMFace *efa;
+ BMLoop *loop;
+ const int n = CustomData_get_active_layer(ldata, type);
+
+ /* ensure all current elements follow new customdata layout */
+ BM_ITER(efa, &iter, bm, BM_FACES_OF_MESH, NULL) {
+ BM_ITER(loop, &liter, bm, BM_LOOPS_OF_FACE, efa) {
+ void *data = CustomData_bmesh_get_n(ldata, loop->head.data, type, n);
+ CustomData_bmesh_set_n(ldata, loop->head.data, type, index, data);
+ }
}
-#endif
}
-int ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me)
+int ED_mesh_uv_loop_reset_ex(struct bContext *C, struct Mesh *me, const int layernum)
{
- BMEditMesh *em= me->edit_btmesh;
+ BMEditMesh *em = me->edit_btmesh;
MLoopUV *luv;
BLI_array_declare(polylengths);
int *polylengths = NULL;
@@ -220,7 +251,7 @@ int ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me)
i = 0;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
- luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+ luv = CustomData_bmesh_get_n(&em->bm->ldata, l->head.data, CD_MLOOPUV, layernum);
BLI_array_append(uvs, luv->uv);
i++;
}
@@ -232,14 +263,16 @@ int ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me)
/* Collect Mesh UVs */
MPoly *mp;
+ MLoopUV *mloouv;
BLI_assert(CustomData_has_layer(&me->ldata, CD_MLOOPUV));
+ mloouv = CustomData_get_layer_n(&me->ldata, CD_MLOOPUV, layernum);
for (j = 0; j < me->totpoly; j++) {
mp = &me->mpoly[j];
for (i = 0; i < mp->totloop; i++) {
- luv = &me->mloopuv[mp->loopstart + i];
+ luv = &mloouv[mp->loopstart + i];
BLI_array_append(uvs, luv->uv);
}
@@ -260,7 +293,8 @@ int ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me)
fuvs[2][0] = 1.0;
fuvs[2][1] = 1.0;
- } else if (len == 4) {
+ }
+ else if (len == 4) {
fuvs[0][0] = 0.0;
fuvs[0][1] = 0.0;
@@ -272,11 +306,12 @@ int ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me)
fuvs[3][0] = 0.0;
fuvs[3][1] = 1.0;
- /*make sure we ignore 2-sided faces*/
- } else if (len > 2) {
+ /*make sure we ignore 2-sided faces*/
+ }
+ else if (len > 2) {
float fac = 0.0f, dfac = 1.0f / (float)len;
- dfac *= M_PI*2;
+ dfac *= M_PI * 2;
for (i = 0; i < len; i++) {
fuvs[i][0] = 0.5f * sin(fac) + 0.5f;
@@ -289,46 +324,56 @@ int ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me)
fuvs += len;
}
- /* BMESH_TODO: Copy poly UVs onto CD_MTFACE layer for tesselated faces */
-
BLI_array_free(uvs);
BLI_array_free(polylengths);
DAG_id_tag_update(&me->id, 0);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, me);
return 1;
}
+int ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me)
+{
+ /* could be ldata or pdata */
+ CustomData *pdata = GET_CD_DATA(me, pdata);
+ const int layernum = CustomData_get_active_layer_index(pdata, CD_MTEXPOLY);
+ return ED_mesh_uv_loop_reset_ex(C, me, layernum);
+}
+
+/* note: keep in sync with ED_mesh_color_add */
int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_set)
{
BMEditMesh *em;
int layernum;
+ short is_init = FALSE;
+
if (me->edit_btmesh) {
- em= me->edit_btmesh;
+ em = me->edit_btmesh;
layernum = CustomData_number_of_layers(&em->bm->pdata, CD_MTEXPOLY);
if (layernum >= MAX_MTFACE)
return -1;
- BM_data_layer_add(em->bm, &em->bm->pdata, CD_MTEXPOLY);
- CustomData_set_layer_active(&em->bm->pdata, CD_MTEXPOLY, layernum);
- CustomData_set_layer_name(&em->bm->pdata, CD_MTEXPOLY, layernum, name);
-
+ /* CD_MTEXPOLY */
+ BM_data_layer_add_named(em->bm, &em->bm->pdata, CD_MTEXPOLY, name);
/* copy data from active UV */
- if (layernum)
- copy_editface_active_customdata(em, CD_MTFACE, layernum);
-
+ if (layernum) {
+ editmesh_face_copy_customdata(em, CD_MTEXPOLY, layernum);
+ }
if (active_set || layernum == 0) {
CustomData_set_layer_active(&em->bm->pdata, CD_MTEXPOLY, layernum);
}
- BM_data_layer_add(em->bm, &em->bm->ldata, CD_MLOOPUV);
- CustomData_set_layer_name(&em->bm->ldata, CD_MLOOPUV, layernum, name);
-
- CustomData_set_layer_active(&em->bm->ldata, CD_MLOOPUV, layernum);
- if(active_set || layernum == 0) {
+ /* CD_MLOOPUV */
+ BM_data_layer_add_named(em->bm, &em->bm->ldata, CD_MLOOPUV, name);
+ /* copy data from active UV */
+ if (layernum) {
+ editmesh_loop_copy_customdata(em, CD_MLOOPUV, layernum);
+ is_init = TRUE;
+ }
+ if (active_set || layernum == 0) {
CustomData_set_layer_active(&em->bm->ldata, CD_MLOOPUV, layernum);
}
}
@@ -341,7 +386,9 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s
CustomData_add_layer_named(&me->pdata, CD_MTEXPOLY, CD_DUPLICATE, me->mtpoly, me->totpoly, name);
CustomData_add_layer_named(&me->ldata, CD_MLOOPUV, CD_DUPLICATE, me->mloopuv, me->totloop, name);
CustomData_add_layer_named(&me->fdata, CD_MTFACE, CD_DUPLICATE, me->mtface, me->totface, name);
- } else {
+ is_init = TRUE;
+ }
+ else {
CustomData_add_layer_named(&me->pdata, CD_MTEXPOLY, CD_DEFAULT, NULL, me->totpoly, name);
CustomData_add_layer_named(&me->ldata, CD_MLOOPUV, CD_DEFAULT, NULL, me->totloop, name);
CustomData_add_layer_named(&me->fdata, CD_MTFACE, CD_DEFAULT, NULL, me->totface, name);
@@ -357,10 +404,13 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s
mesh_update_customdata_pointers(me, TRUE);
}
- ED_mesh_uv_loop_reset(C, me);
+ /* don't overwrite our copied coords */
+ if (is_init == FALSE) {
+ ED_mesh_uv_loop_reset_ex(C, me, layernum);
+ }
DAG_id_tag_update(&me->id, 0);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, me);
return layernum;
}
@@ -371,11 +421,11 @@ int ED_mesh_uv_texture_remove(bContext *C, Object *ob, Mesh *me)
CustomDataLayer *cdlp, *cdlu;
int index;
- index= CustomData_get_active_layer_index(pdata, CD_MTEXPOLY);
- cdlp= (index == -1)? NULL: &pdata->layers[index];
+ index = CustomData_get_active_layer_index(pdata, CD_MTEXPOLY);
+ cdlp = (index == -1) ? NULL : &pdata->layers[index];
- index= CustomData_get_active_layer_index(ldata, CD_MLOOPUV);
- cdlu= (index == -1)? NULL: &ldata->layers[index];
+ index = CustomData_get_active_layer_index(ldata, CD_MLOOPUV);
+ cdlu = (index == -1) ? NULL : &ldata->layers[index];
if (!cdlp || !cdlu)
return 0;
@@ -384,52 +434,51 @@ int ED_mesh_uv_texture_remove(bContext *C, Object *ob, Mesh *me)
delete_customdata_layer(C, ob, cdlu);
DAG_id_tag_update(&me->id, 0);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, me);
return 1;
}
+/* note: keep in sync with ED_mesh_uv_texture_add */
int ED_mesh_color_add(bContext *C, Scene *UNUSED(scene), Object *UNUSED(ob), Mesh *me, const char *name, int active_set)
{
BMEditMesh *em;
int layernum;
if (me->edit_btmesh) {
- em= me->edit_btmesh;
+ em = me->edit_btmesh;
- layernum= CustomData_number_of_layers(&em->bm->ldata, CD_MLOOPCOL);
+ layernum = CustomData_number_of_layers(&em->bm->ldata, CD_MLOOPCOL);
if (layernum >= MAX_MCOL) {
return -1;
}
- BM_data_layer_add(em->bm, &em->bm->pdata, CD_MLOOPCOL);
- CustomData_set_layer_active(&em->bm->ldata, CD_MLOOPCOL, layernum);
-
+ /* CD_MLOOPCOL */
+ BM_data_layer_add_named(em->bm, &em->bm->ldata, CD_MLOOPCOL, name);
/* copy data from active vertex color layer */
if (layernum) {
- copy_editface_active_customdata(em, CD_MCOL, layernum);
+ editmesh_loop_copy_customdata(em, CD_MLOOPCOL, layernum);
}
-
if (active_set || layernum == 0) {
CustomData_set_layer_active(&em->bm->ldata, CD_MLOOPCOL, layernum);
}
}
else {
- layernum= CustomData_number_of_layers(&me->ldata, CD_MLOOPCOL);
+ layernum = CustomData_number_of_layers(&me->ldata, CD_MLOOPCOL);
if (layernum >= CD_MLOOPCOL) {
return -1;
}
- if(me->mloopcol) {
+ if (me->mloopcol) {
CustomData_add_layer_named(&me->ldata, CD_MLOOPCOL, CD_DUPLICATE, me->mloopcol, me->totloop, name);
- CustomData_add_layer_named(&me->fdata, CD_MCOL, CD_DUPLICATE, me->mloopcol, me->totface, name);
+ CustomData_add_layer_named(&me->fdata, CD_MCOL, CD_DUPLICATE, me->mcol, me->totface, name);
}
else {
CustomData_add_layer_named(&me->ldata, CD_MLOOPCOL, CD_DEFAULT, NULL, me->totloop, name);
CustomData_add_layer_named(&me->fdata, CD_MCOL, CD_DEFAULT, NULL, me->totface, name);
}
- if(active_set || layernum==0) {
+ if (active_set || layernum == 0) {
CustomData_set_layer_active(&me->ldata, CD_MLOOPCOL, layernum);
CustomData_set_layer_active(&me->fdata, CD_MCOL, layernum);
}
@@ -438,43 +487,45 @@ int ED_mesh_color_add(bContext *C, Scene *UNUSED(scene), Object *UNUSED(ob), Mes
}
DAG_id_tag_update(&me->id, 0);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, me);
return layernum;
}
int ED_mesh_color_remove(bContext *C, Object *ob, Mesh *me)
{
+ CustomData *ldata = GET_CD_DATA(me, ldata);
CustomDataLayer *cdl;
int index;
- index= CustomData_get_active_layer_index(&me->ldata, CD_MLOOPCOL);
- cdl= (index == -1)? NULL: &me->ldata.layers[index];
+ index = CustomData_get_active_layer_index(ldata, CD_MLOOPCOL);
+ cdl = (index == -1) ? NULL : &ldata->layers[index];
- if(!cdl)
+ if (!cdl)
return 0;
delete_customdata_layer(C, ob, cdl);
DAG_id_tag_update(&me->id, 0);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, me);
return 1;
}
int ED_mesh_color_remove_named(bContext *C, Object *ob, Mesh *me, const char *name)
{
+ CustomData *ldata = GET_CD_DATA(me, ldata);
CustomDataLayer *cdl;
int index;
- index= CustomData_get_named_layer_index(&me->ldata, CD_MLOOPCOL, name);
- cdl= (index == -1)? NULL: &me->ldata.layers[index];
+ index = CustomData_get_named_layer_index(ldata, CD_MLOOPCOL, name);
+ cdl = (index == -1) ? NULL : &ldata->layers[index];
- if(!cdl)
+ if (!cdl)
return 0;
delete_customdata_layer(C, ob, cdl);
DAG_id_tag_update(&me->id, 0);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, me);
return 1;
}
@@ -483,17 +534,17 @@ int ED_mesh_color_remove_named(bContext *C, Object *ob, Mesh *me, const char *na
static int layers_poll(bContext *C)
{
- Object *ob= ED_object_context(C);
- ID *data= (ob)? ob->data: NULL;
- return (ob && !ob->id.lib && ob->type==OB_MESH && data && !data->lib);
+ Object *ob = ED_object_context(C);
+ ID *data = (ob) ? ob->data : NULL;
+ return (ob && !ob->id.lib && ob->type == OB_MESH && data && !data->lib);
}
-static int uv_texture_add_exec(bContext *C, wmOperator *UNUSED(op))
+static int mesh_uv_texture_add_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= ED_object_context(C);
- Mesh *me= ob->data;
+ Object *ob = ED_object_context(C);
+ Mesh *me = ob->data;
- if(ED_mesh_uv_texture_add(C, me, NULL, TRUE) == -1)
+ if (ED_mesh_uv_texture_add(C, me, NULL, TRUE) == -1)
return OPERATOR_CANCELLED;
return OPERATOR_FINISHED;
@@ -502,71 +553,71 @@ static int uv_texture_add_exec(bContext *C, wmOperator *UNUSED(op))
void MESH_OT_uv_texture_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add UV Map";
- ot->description= "Add UV Map";
- ot->idname= "MESH_OT_uv_texture_add";
+ ot->name = "Add UV Map";
+ ot->description = "Add UV Map";
+ ot->idname = "MESH_OT_uv_texture_add";
/* api callbacks */
- ot->poll= layers_poll;
- ot->exec= uv_texture_add_exec;
+ ot->poll = layers_poll;
+ ot->exec = mesh_uv_texture_add_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
- View3D *v3d= CTX_wm_view3d(C);
- Base *base= ED_view3d_give_base_under_cursor(C, event->mval);
- Image *ima= NULL;
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
+ View3D *v3d = CTX_wm_view3d(C);
+ Base *base = ED_view3d_give_base_under_cursor(C, event->mval);
+ Image *ima = NULL;
Mesh *me;
Object *obedit;
- int exitmode= 0;
- char name[MAX_ID_NAME-2];
+ int exitmode = 0;
+ char name[MAX_ID_NAME - 2];
/* Check context */
- if(base==NULL || base->object->type!=OB_MESH) {
+ if (base == NULL || base->object->type != OB_MESH) {
BKE_report(op->reports, RPT_ERROR, "Not an Object or Mesh");
return OPERATOR_CANCELLED;
}
/* 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);
- ima= BKE_add_image_file(path);
+ ima = BKE_add_image_file(path);
}
else {
RNA_string_get(op->ptr, "name", name);
- ima= (Image *)find_id("IM", name);
+ ima = (Image *)find_id("IM", name);
}
- if(!ima) {
+ if (!ima) {
BKE_report(op->reports, RPT_ERROR, "Not an Image");
return OPERATOR_CANCELLED;
}
/* put mesh in editmode */
- obedit= base->object;
- me= obedit->data;
- if(me->edit_btmesh==NULL) {
- EDBM_MakeEditBMesh(scene->toolsettings, scene, obedit);
- exitmode= 1;
+ obedit = base->object;
+ me = obedit->data;
+ if (me->edit_btmesh == NULL) {
+ EDBM_mesh_make(scene->toolsettings, scene, obedit);
+ exitmode = 1;
}
- if(me->edit_btmesh==NULL)
+ if (me->edit_btmesh == NULL)
return OPERATOR_CANCELLED;
ED_uvedit_assign_image(bmain, scene, obedit, ima, NULL);
- if(exitmode) {
- EDBM_LoadEditBMesh(scene, obedit);
- EDBM_FreeEditBMesh(me->edit_btmesh);
+ if (exitmode) {
+ EDBM_mesh_load(obedit);
+ EDBM_mesh_free(me->edit_btmesh);
MEM_freeN(me->edit_btmesh);
- me->edit_btmesh= NULL;
+ me->edit_btmesh = NULL;
/* load_editMesh free's pointers used by CustomData layers which might be used by DerivedMesh too,
* so signal to re-create DerivedMesh here (sergey) */
@@ -574,10 +625,10 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
/* dummie drop support; ensure view shows a result :) */
- if(v3d)
+ if (v3d)
v3d->flag2 |= V3D_SOLID_TEX;
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
return OPERATOR_FINISHED;
}
@@ -585,28 +636,28 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
void MESH_OT_drop_named_image(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Assign Image to UV Map";
- ot->description= "Assign Image to active UV Map, or create an UV Map";
- ot->idname= "MESH_OT_drop_named_image";
+ ot->name = "Assign Image to UV Map";
+ ot->description = "Assign Image to active UV Map, or create an UV Map";
+ ot->idname = "MESH_OT_drop_named_image";
/* api callbacks */
- ot->poll= layers_poll;
- ot->invoke= drop_named_image_invoke;
+ ot->poll = layers_poll;
+ ot->invoke = drop_named_image_invoke;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* properties */
- RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME-2, "Name", "Image name to assign");
+ RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME - 2, "Name", "Image name to assign");
RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file");
}
-static int uv_texture_remove_exec(bContext *C, wmOperator *UNUSED(op))
+static int mesh_uv_texture_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= ED_object_context(C);
- Mesh *me= ob->data;
+ Object *ob = ED_object_context(C);
+ Mesh *me = ob->data;
- if(!ED_mesh_uv_texture_remove(C, ob, me))
+ if (!ED_mesh_uv_texture_remove(C, ob, me))
return OPERATOR_CANCELLED;
return OPERATOR_FINISHED;
@@ -615,27 +666,27 @@ static int uv_texture_remove_exec(bContext *C, wmOperator *UNUSED(op))
void MESH_OT_uv_texture_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove UV Map";
- ot->description= "Remove UV Map";
- ot->idname= "MESH_OT_uv_texture_remove";
+ ot->name = "Remove UV Map";
+ ot->description = "Remove UV Map";
+ ot->idname = "MESH_OT_uv_texture_remove";
/* api callbacks */
- ot->poll= layers_poll;
- ot->exec= uv_texture_remove_exec;
+ ot->poll = layers_poll;
+ ot->exec = mesh_uv_texture_remove_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/*********************** vertex color operators ************************/
-static int vertex_color_add_exec(bContext *C, wmOperator *UNUSED(op))
+static int mesh_vertex_color_add_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= ED_object_context(C);
- Mesh *me= ob->data;
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = ED_object_context(C);
+ Mesh *me = ob->data;
- if(ED_mesh_color_add(C, scene, ob, me, NULL, TRUE) == -1)
+ if (ED_mesh_color_add(C, scene, ob, me, NULL, TRUE) == -1)
return OPERATOR_CANCELLED;
return OPERATOR_FINISHED;
@@ -644,24 +695,24 @@ static int vertex_color_add_exec(bContext *C, wmOperator *UNUSED(op))
void MESH_OT_vertex_color_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Vertex Color";
- ot->description= "Add vertex color layer";
- ot->idname= "MESH_OT_vertex_color_add";
+ ot->name = "Add Vertex Color";
+ ot->description = "Add vertex color layer";
+ ot->idname = "MESH_OT_vertex_color_add";
/* api callbacks */
- ot->poll= layers_poll;
- ot->exec= vertex_color_add_exec;
+ ot->poll = layers_poll;
+ ot->exec = mesh_vertex_color_add_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int vertex_color_remove_exec(bContext *C, wmOperator *UNUSED(op))
+static int mesh_vertex_color_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= ED_object_context(C);
- Mesh *me= ob->data;
+ Object *ob = ED_object_context(C);
+ Mesh *me = ob->data;
- if(!ED_mesh_color_remove(C, ob, me))
+ if (!ED_mesh_color_remove(C, ob, me))
return OPERATOR_CANCELLED;
return OPERATOR_FINISHED;
@@ -670,34 +721,37 @@ static int vertex_color_remove_exec(bContext *C, wmOperator *UNUSED(op))
void MESH_OT_vertex_color_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Vertex Color";
- ot->description= "Remove vertex color layer";
- ot->idname= "MESH_OT_vertex_color_remove";
+ ot->name = "Remove Vertex Color";
+ ot->description = "Remove vertex color layer";
+ ot->idname = "MESH_OT_vertex_color_remove";
/* api callbacks */
- ot->exec= vertex_color_remove_exec;
- ot->poll= layers_poll;
+ ot->exec = mesh_vertex_color_remove_exec;
+ ot->poll = layers_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/*********************** sticky operators ************************/
-static int sticky_add_exec(bContext *C, wmOperator *UNUSED(op))
+static int mesh_sticky_add_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- View3D *v3d= CTX_wm_view3d(C);
- Object *ob= ED_object_context(C);
- Mesh *me= ob->data;
+ Scene *scene = CTX_data_scene(C);
+ View3D *v3d = CTX_wm_view3d(C);
+ 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);
DAG_id_tag_update(&me->id, 0);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, me);
return OPERATOR_FINISHED;
}
@@ -705,31 +759,31 @@ static int sticky_add_exec(bContext *C, wmOperator *UNUSED(op))
void MESH_OT_sticky_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Sticky";
- ot->description= "Add sticky UV texture layer";
- ot->idname= "MESH_OT_sticky_add";
+ ot->name = "Add Sticky";
+ ot->description = "Add sticky UV texture layer";
+ ot->idname = "MESH_OT_sticky_add";
/* api callbacks */
- ot->poll= layers_poll;
- ot->exec= sticky_add_exec;
+ ot->poll = layers_poll;
+ ot->exec = mesh_sticky_add_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int sticky_remove_exec(bContext *C, wmOperator *UNUSED(op))
+static int mesh_sticky_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= ED_object_context(C);
- Mesh *me= ob->data;
+ Object *ob = ED_object_context(C);
+ Mesh *me = ob->data;
- if(!me->msticky)
+ if (!me->msticky)
return OPERATOR_CANCELLED;
CustomData_free_layer_active(&me->vdata, CD_MSTICKY, me->totvert);
- me->msticky= NULL;
+ me->msticky = NULL;
DAG_id_tag_update(&me->id, 0);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, me);
return OPERATOR_FINISHED;
}
@@ -737,54 +791,74 @@ static int sticky_remove_exec(bContext *C, wmOperator *UNUSED(op))
void MESH_OT_sticky_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Sticky";
- ot->description= "Remove sticky UV texture layer";
- ot->idname= "MESH_OT_sticky_remove";
+ ot->name = "Remove Sticky";
+ ot->description = "Remove sticky UV texture layer";
+ ot->idname = "MESH_OT_sticky_remove";
/* api callbacks */
- ot->poll= layers_poll;
- ot->exec= sticky_remove_exec;
+ ot->poll = layers_poll;
+ ot->exec = mesh_sticky_remove_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/************************** Add Geometry Layers *************************/
-void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges)
+void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges, int calc_tessface)
{
int *polyindex = NULL;
float (*face_nors)[3];
+ int tessface_input = FALSE;
- if(mesh->totface > 0 && mesh->totpoly == 0)
- convert_mfaces_to_mpolys(mesh);
+ if (mesh->totface > 0 && mesh->totpoly == 0) {
+ BKE_mesh_convert_mfaces_to_mpolys(mesh);
- if(calc_edges || (mesh->totpoly && mesh->totedge == 0))
+ /* would only be converting back again, don't bother */
+ tessface_input = TRUE;
+
+ /* it also happens that converting the faces calculates edges, skip this */
+ calc_edges = FALSE;
+ }
+
+ if (calc_edges || (mesh->totpoly && mesh->totedge == 0))
BKE_mesh_calc_edges(mesh, calc_edges);
- /* TODO, make this optional, we dont always want this! */
- BKE_mesh_tessface_calc(mesh);
+ if (calc_tessface) {
+ if (tessface_input == FALSE) {
+ 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. */
+ /* add a normals layer for tessellated faces, a tessface normal will
+ * contain the normal of the poly the face was tessellated 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);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, mesh);
}
static void mesh_add_verts(Mesh *mesh, int len)
@@ -793,36 +867,36 @@ static void mesh_add_verts(Mesh *mesh, int len)
MVert *mvert;
int i, totvert;
- if(len == 0)
+ if (len == 0)
return;
- totvert= mesh->totvert + len;
+ totvert = mesh->totvert + len;
CustomData_copy(&mesh->vdata, &vdata, CD_MASK_MESH, CD_DEFAULT, totvert);
CustomData_copy_data(&mesh->vdata, &vdata, 0, 0, mesh->totvert);
- if(!CustomData_has_layer(&vdata, CD_MVERT))
+ if (!CustomData_has_layer(&vdata, CD_MVERT))
CustomData_add_layer(&vdata, CD_MVERT, CD_CALLOC, NULL, totvert);
CustomData_free(&mesh->vdata, mesh->totvert);
- mesh->vdata= vdata;
+ mesh->vdata = vdata;
mesh_update_customdata_pointers(mesh, FALSE);
/* scan the input list and insert the new vertices */
- mvert= &mesh->mvert[mesh->totvert];
- for(i=0; i<len; i++, mvert++)
+ mvert = &mesh->mvert[mesh->totvert];
+ for (i = 0; i < len; i++, mvert++)
mvert->flag |= SELECT;
/* set final vertex list size */
- mesh->totvert= totvert;
+ mesh->totvert = totvert;
}
void ED_mesh_transform(Mesh *me, float *mat)
{
int i;
- MVert *mvert= me->mvert;
+ MVert *mvert = me->mvert;
- for(i= 0; i < me->totvert; i++, mvert++)
+ for (i = 0; i < me->totvert; i++, mvert++)
mul_m4_v3((float (*)[4])mat, mvert->co);
mesh_calc_normals_mapping(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL, NULL, 0, NULL, NULL);
@@ -834,58 +908,58 @@ static void mesh_add_edges(Mesh *mesh, int len)
MEdge *medge;
int i, totedge;
- if(len == 0)
+ if (len == 0)
return;
- totedge= mesh->totedge+len;
+ totedge = mesh->totedge + len;
/* update customdata */
CustomData_copy(&mesh->edata, &edata, CD_MASK_MESH, CD_DEFAULT, totedge);
CustomData_copy_data(&mesh->edata, &edata, 0, 0, mesh->totedge);
- if(!CustomData_has_layer(&edata, CD_MEDGE))
+ if (!CustomData_has_layer(&edata, CD_MEDGE))
CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge);
CustomData_free(&mesh->edata, mesh->totedge);
- mesh->edata= edata;
- mesh_update_customdata_pointers(mesh, FALSE); /* new edges dont change tessellation */
+ mesh->edata = edata;
+ mesh_update_customdata_pointers(mesh, FALSE); /* new edges don't change tessellation */
/* set default flags */
- medge= &mesh->medge[mesh->totedge];
- for(i=0; i<len; i++, medge++)
- medge->flag= ME_EDGEDRAW|ME_EDGERENDER|SELECT;
+ medge = &mesh->medge[mesh->totedge];
+ for (i = 0; i < len; i++, medge++)
+ medge->flag = ME_EDGEDRAW | ME_EDGERENDER | SELECT;
- mesh->totedge= totedge;
+ mesh->totedge = totedge;
}
-static void mesh_add_faces(Mesh *mesh, int len)
+static void mesh_add_tessfaces(Mesh *mesh, int len)
{
CustomData fdata;
MFace *mface;
int i, totface;
- if(len == 0)
+ if (len == 0)
return;
- totface= mesh->totface + len; /* new face count */
+ totface = mesh->totface + len; /* new face count */
/* update customdata */
CustomData_copy(&mesh->fdata, &fdata, CD_MASK_MESH, CD_DEFAULT, totface);
CustomData_copy_data(&mesh->fdata, &fdata, 0, 0, mesh->totface);
- if(!CustomData_has_layer(&fdata, CD_MFACE))
+ if (!CustomData_has_layer(&fdata, CD_MFACE))
CustomData_add_layer(&fdata, CD_MFACE, CD_CALLOC, NULL, totface);
CustomData_free(&mesh->fdata, mesh->totface);
- mesh->fdata= fdata;
+ mesh->fdata = fdata;
mesh_update_customdata_pointers(mesh, TRUE);
/* set default flags */
- mface= &mesh->mface[mesh->totface];
- for(i=0; i<len; i++, mface++)
- mface->flag= ME_FACE_SEL;
+ mface = &mesh->mface[mesh->totface];
+ for (i = 0; i < len; i++, mface++)
+ mface->flag = ME_FACE_SEL;
- mesh->totface= totface;
+ mesh->totface = totface;
}
static void mesh_add_loops(Mesh *mesh, int len)
@@ -893,23 +967,23 @@ static void mesh_add_loops(Mesh *mesh, int len)
CustomData ldata;
int totloop;
- if(len == 0)
+ if (len == 0)
return;
- totloop= mesh->totloop + len; /* new face count */
+ totloop = mesh->totloop + len; /* new face count */
/* update customdata */
CustomData_copy(&mesh->ldata, &ldata, CD_MASK_MESH, CD_DEFAULT, totloop);
CustomData_copy_data(&mesh->ldata, &ldata, 0, 0, mesh->totloop);
- if(!CustomData_has_layer(&ldata, CD_MLOOP))
+ if (!CustomData_has_layer(&ldata, CD_MLOOP))
CustomData_add_layer(&ldata, CD_MLOOP, CD_CALLOC, NULL, totloop);
CustomData_free(&mesh->ldata, mesh->totloop);
- mesh->ldata= ldata;
+ mesh->ldata = ldata;
mesh_update_customdata_pointers(mesh, TRUE);
- mesh->totloop= totloop;
+ mesh->totloop = totloop;
}
static void mesh_add_polys(Mesh *mesh, int len)
@@ -918,102 +992,107 @@ static void mesh_add_polys(Mesh *mesh, int len)
MPoly *mpoly;
int i, totpoly;
- if(len == 0)
+ if (len == 0)
return;
- totpoly= mesh->totpoly + len; /* new face count */
+ totpoly = mesh->totpoly + len; /* new face count */
/* update customdata */
CustomData_copy(&mesh->pdata, &pdata, CD_MASK_MESH, CD_DEFAULT, totpoly);
CustomData_copy_data(&mesh->pdata, &pdata, 0, 0, mesh->totpoly);
- if(!CustomData_has_layer(&pdata, CD_MPOLY))
+ if (!CustomData_has_layer(&pdata, CD_MPOLY))
CustomData_add_layer(&pdata, CD_MPOLY, CD_CALLOC, NULL, totpoly);
CustomData_free(&mesh->pdata, mesh->totpoly);
- mesh->pdata= pdata;
+ mesh->pdata = pdata;
mesh_update_customdata_pointers(mesh, TRUE);
/* set default flags */
- mpoly= &mesh->mpoly[mesh->totpoly];
- for(i=0; i<len; i++, mpoly++)
- mpoly->flag= ME_FACE_SEL;
+ mpoly = &mesh->mpoly[mesh->totpoly];
+ for (i = 0; i < len; i++, mpoly++)
+ mpoly->flag = ME_FACE_SEL;
- mesh->totpoly= totpoly;
+ mesh->totpoly = totpoly;
}
static void mesh_remove_verts(Mesh *mesh, int len)
{
int totvert;
- if(len == 0)
+ if (len == 0)
return;
- totvert= mesh->totvert - len;
+ totvert = mesh->totvert - len;
CustomData_free_elem(&mesh->vdata, totvert, len);
/* set final vertex list size */
- mesh->totvert= totvert;
+ mesh->totvert = totvert;
}
static void mesh_remove_edges(Mesh *mesh, int len)
{
int totedge;
- if(len == 0)
+ if (len == 0)
return;
- totedge= mesh->totedge - len;
+ totedge = mesh->totedge - len;
CustomData_free_elem(&mesh->edata, totedge, len);
- mesh->totedge= totedge;
+ mesh->totedge = totedge;
}
static void mesh_remove_faces(Mesh *mesh, int len)
{
int totface;
- if(len == 0)
+ if (len == 0)
return;
- totface= mesh->totface - len; /* new face count */
+ totface = mesh->totface - len; /* new face count */
CustomData_free_elem(&mesh->fdata, totface, len);
- mesh->totface= totface;
+ mesh->totface = totface;
}
-/*
+#if 0
void ED_mesh_geometry_add(Mesh *mesh, ReportList *reports, int verts, int edges, int faces)
{
- if(mesh->edit_btmesh) {
+ if (mesh->edit_btmesh) {
BKE_report(reports, RPT_ERROR, "Can't add geometry in edit mode");
return;
}
- if(verts)
+ if (verts)
mesh_add_verts(mesh, verts);
- if(edges)
+ if (edges)
mesh_add_edges(mesh, edges);
- if(faces)
+ if (faces)
mesh_add_faces(mesh, faces);
}
-*/
+#endif
-void ED_mesh_faces_add(Mesh *mesh, ReportList *reports, int count)
+void ED_mesh_tessfaces_add(Mesh *mesh, ReportList *reports, int count)
{
- if(mesh->edit_btmesh) {
- BKE_report(reports, RPT_ERROR, "Can't add faces in edit mode");
+ if (mesh->edit_btmesh) {
+ BKE_report(reports, RPT_ERROR, "Can't add tessfaces in edit mode");
return;
}
- mesh_add_faces(mesh, count);
+ if (mesh->mpoly) {
+ BKE_report(reports, RPT_ERROR, "Can't add tessfaces to a mesh that already has polygons");
+ return;
+ }
+
+ mesh_add_tessfaces(mesh, count);
}
void ED_mesh_edges_add(Mesh *mesh, ReportList *reports, int count)
{
- if(mesh->edit_btmesh) {
+ if (mesh->edit_btmesh) {
BKE_report(reports, RPT_ERROR, "Can't add edges in edit mode");
- return;
+ return;
}
mesh_add_edges(mesh, count);
@@ -1021,7 +1100,7 @@ void ED_mesh_edges_add(Mesh *mesh, ReportList *reports, int count)
void ED_mesh_vertices_add(Mesh *mesh, ReportList *reports, int count)
{
- if(mesh->edit_btmesh) {
+ if (mesh->edit_btmesh) {
BKE_report(reports, RPT_ERROR, "Can't add vertices in edit mode");
return;
}
@@ -1031,11 +1110,11 @@ void ED_mesh_vertices_add(Mesh *mesh, ReportList *reports, int count)
void ED_mesh_faces_remove(Mesh *mesh, ReportList *reports, int count)
{
- if(mesh->edit_btmesh) {
+ if (mesh->edit_btmesh) {
BKE_report(reports, RPT_ERROR, "Can't remove faces in edit mode");
return;
}
- else if(count > mesh->totface) {
+ else if (count > mesh->totface) {
BKE_report(reports, RPT_ERROR, "Can't remove more faces than the mesh contains");
return;
}
@@ -1045,11 +1124,11 @@ void ED_mesh_faces_remove(Mesh *mesh, ReportList *reports, int count)
void ED_mesh_edges_remove(Mesh *mesh, ReportList *reports, int count)
{
- if(mesh->edit_btmesh) {
+ if (mesh->edit_btmesh) {
BKE_report(reports, RPT_ERROR, "Can't remove edges in edit mode");
return;
}
- else if(count > mesh->totedge) {
+ else if (count > mesh->totedge) {
BKE_report(reports, RPT_ERROR, "Can't remove more edges than the mesh contains");
return;
}
@@ -1059,11 +1138,11 @@ void ED_mesh_edges_remove(Mesh *mesh, ReportList *reports, int count)
void ED_mesh_vertices_remove(Mesh *mesh, ReportList *reports, int count)
{
- if(mesh->edit_btmesh) {
+ if (mesh->edit_btmesh) {
BKE_report(reports, RPT_ERROR, "Can't remove vertices in edit mode");
return;
}
- else if(count > mesh->totvert) {
+ else if (count > mesh->totvert) {
BKE_report(reports, RPT_ERROR, "Can't remove more vertices than the mesh contains");
return;
}
@@ -1073,9 +1152,9 @@ void ED_mesh_vertices_remove(Mesh *mesh, ReportList *reports, int count)
void ED_mesh_loops_add(Mesh *mesh, ReportList *reports, int count)
{
- if(mesh->edit_btmesh) {
+ if (mesh->edit_btmesh) {
BKE_report(reports, RPT_ERROR, "Can't add loops in edit mode.");
- return;
+ return;
}
mesh_add_loops(mesh, count);
@@ -1083,7 +1162,7 @@ void ED_mesh_loops_add(Mesh *mesh, ReportList *reports, int count)
void ED_mesh_polys_add(Mesh *mesh, ReportList *reports, int count)
{
- if(mesh->edit_btmesh) {
+ if (mesh->edit_btmesh) {
BKE_report(reports, RPT_ERROR, "Can't add polys in edit mode.");
return;
}
@@ -1093,5 +1172,23 @@ 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
+}
+
+void ED_mesh_calc_tessface(Mesh *mesh)
+{
+ if (mesh->edit_btmesh) {
+ BMEdit_RecalcTessellation(mesh->edit_btmesh);
+ }
+ else {
+ BKE_mesh_tessface_calc(mesh);
+ }
}
diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h
index b1c95da1731..2140bc4308b 100644
--- a/source/blender/editors/mesh/mesh_intern.h
+++ b/source/blender/editors/mesh/mesh_intern.h
@@ -35,48 +35,52 @@
#ifndef __MESH_INTERN_H__
#define __MESH_INTERN_H__
-struct bContext;
-struct wmOperatorType;
-struct ViewContext;
-struct BMEditMesh;
-struct BMesh;
struct BMEdge;
+struct BMEditMesh;
struct BMFace;
+struct BMHeader;
struct BMOperator;
-struct wmOperator;
-struct wmKeyMap;
-struct wmKeyConfig;
+struct BMesh;
struct EnumPropertyItem;
+struct ViewContext;
+struct bContext;
+struct wmKeyConfig;
+struct wmKeyMap;
+struct wmOperator;
+struct wmOperatorType;
/* ******************** 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, ...);
+int EDBM_op_callf(struct BMEditMesh *em, struct wmOperator *op, const char *fmt, ...);
-/*same as above, but doesn't report errors.*/
-int EDBM_CallOpfSilent(struct BMEditMesh *em, const char *fmt, ...);
+int EDBM_op_call_and_selectf(struct BMEditMesh *em, struct wmOperator *op,
+ const char *selectslot, 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*/
-int EDBM_InitOpf(struct BMEditMesh *em, struct BMOperator *bmop,
+/* same as above, but doesn't report errors.*/
+int EDBM_op_call_silentf(struct BMEditMesh *em, const char *fmt, ...);
+
+/* these next two functions are the split version of EDBM_op_callf, 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_op_init(struct BMEditMesh *em, struct BMOperator *bmop,
struct wmOperator *op, const char *fmt, ...);
/*cleans up after a bmesh operator*/
-int EDBM_FinishOp(struct BMEditMesh *em, struct BMOperator *bmop,
- struct wmOperator *op, const int report);
+int EDBM_op_finish(struct BMEditMesh *em, struct BMOperator *bmop,
+ struct wmOperator *op, const int report);
void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag);
-void EDBM_store_selection(struct BMEditMesh *em, void *data);
-void EDBM_validate_selections(struct BMEditMesh *em);
-void EDBM_remove_selection(struct BMEditMesh *em, void *data);
+void EDBM_editselection_store(struct BMEditMesh *em, struct BMHeader *ele);
+void EDBM_editselection_validate(struct BMEditMesh *em);
+void EDBM_editselection_remove(struct BMEditMesh *em, struct BMHeader *ele);
void EDBM_stats_update(struct BMEditMesh *em);
/* TODO, move to math_geometry.c */
@@ -155,6 +159,7 @@ void MESH_OT_fill(struct wmOperatorType *ot);
void MESH_OT_beautify_fill(struct wmOperatorType *ot);
void MESH_OT_quads_convert_to_tris(struct wmOperatorType *ot);
void MESH_OT_tris_convert_to_quads(struct wmOperatorType *ot);
+void MESH_OT_dissolve(struct wmOperatorType *ot);
void MESH_OT_dissolve_limited(struct wmOperatorType *ot);
void MESH_OT_faces_shade_smooth(struct wmOperatorType *ot);
void MESH_OT_faces_shade_flat(struct wmOperatorType *ot);
@@ -175,6 +180,8 @@ void MESH_OT_colors_rotate(struct wmOperatorType *ot);
void MESH_OT_colors_reverse(struct wmOperatorType *ot);
void MESH_OT_delete(struct wmOperatorType *ot);
+void MESH_OT_edge_collapse(struct wmOperatorType *ot);
+void MESH_OT_edge_collapse_loop(struct wmOperatorType *ot);
void MESH_OT_rip(struct wmOperatorType *ot);
void MESH_OT_shape_propagate_to_all(struct wmOperatorType *ot);
@@ -198,7 +205,6 @@ void MESH_OT_extrude_region(struct wmOperatorType *ot);
void MESH_OT_extrude_verts_indiv(struct wmOperatorType *ot);
void MESH_OT_extrude_edges_indiv(struct wmOperatorType *ot);
void MESH_OT_extrude_faces_indiv(struct wmOperatorType *ot);
-void MESH_OT_bm_test(struct wmOperatorType *ot);
void MESH_OT_edgering_select(struct wmOperatorType *ot);
void MESH_OT_loopcut(struct wmOperatorType *ot);
@@ -207,6 +213,7 @@ void MESH_OT_knifetool(struct wmOperatorType *ot);
void MESH_OT_bevel(struct wmOperatorType *ot);
void MESH_OT_bridge_edge_loops(struct wmOperatorType *ot);
+void MESH_OT_inset(struct wmOperatorType *ot);
/* ******************* mesh_navmesh.c */
void MESH_OT_navmesh_make(struct wmOperatorType *ot);
diff --git a/source/blender/editors/mesh/mesh_navmesh.c b/source/blender/editors/mesh/mesh_navmesh.c
index 374fbca0659..f1b0a82b654 100644
--- a/source/blender/editors/mesh/mesh_navmesh.c
+++ b/source/blender/editors/mesh/mesh_navmesh.c
@@ -37,6 +37,11 @@
#include "DNA_modifier_types.h"
#include "DNA_ID.h"
+#include "BLI_listbase.h"
+#include "BLI_utildefines.h"
+#include "BLI_math_vector.h"
+#include "BLI_linklist.h"
+
#include "BKE_library.h"
#include "BKE_depsgraph.h"
#include "BKE_context.h"
@@ -49,11 +54,6 @@
#include "BKE_report.h"
#include "BKE_tessmesh.h"
-#include "BLI_listbase.h"
-#include "BLI_utildefines.h"
-#include "BLI_math_vector.h"
-#include "BLI_linklist.h"
-
#include "ED_object.h"
#include "ED_mesh.h"
#include "ED_screen.h"
@@ -66,113 +66,114 @@
#include "mesh_intern.h"
#include "recast-capi.h"
-static void createVertsTrisData(bContext *C, LinkNode* obs, int *nverts_r, float **verts_r, int *ntris_r, int **tris_r)
+static void createVertsTrisData(bContext *C, LinkNode *obs, int *nverts_r, float **verts_r, int *ntris_r, int **tris_r)
{
MVert *mvert;
- int nfaces= 0, *tri, i, curnverts, basenverts, curnfaces;
+ int nfaces = 0, *tri, i, curnverts, basenverts, curnfaces;
MFace *mface;
float co[3], wco[3];
Object *ob;
LinkNode *oblink, *dmlink;
DerivedMesh *dm;
- Scene* scene= CTX_data_scene(C);
- LinkNode* dms= NULL;
+ Scene *scene = CTX_data_scene(C);
+ LinkNode *dms = NULL;
int nverts, ntris, *tris;
float *verts;
- nverts= 0;
- ntris= 0;
+ nverts = 0;
+ ntris = 0;
/* calculate number of verts and tris */
- for(oblink= obs; oblink; oblink= oblink->next) {
- ob= (Object*) oblink->link;
- dm= mesh_create_derived_no_virtual(scene, ob, NULL, CD_MASK_MESH);
- BLI_linklist_append(&dms, (void*)dm);
+ for (oblink = obs; oblink; oblink = oblink->next) {
+ ob = (Object *) oblink->link;
+ dm = mesh_create_derived_no_virtual(scene, ob, NULL, CD_MASK_MESH);
+ BLI_linklist_append(&dms, (void *)dm);
- nverts+= dm->getNumVerts(dm);
- nfaces= dm->getNumTessFaces(dm);
- ntris+= nfaces;
+ nverts += dm->getNumVerts(dm);
+ nfaces = dm->getNumTessFaces(dm);
+ ntris += nfaces;
/* resolve quad faces */
- mface= dm->getTessFaceArray(dm);
- for(i= 0; i<nfaces; i++) {
- MFace* mf= &mface[i];
- if(mf->v4)
- ntris+=1;
+ mface = dm->getTessFaceArray(dm);
+ for (i = 0; i < nfaces; i++) {
+ MFace *mf = &mface[i];
+ if (mf->v4)
+ ntris += 1;
}
}
/* create data */
- verts= MEM_mallocN(sizeof(float)*3*nverts, "createVertsTrisData verts");
- tris= MEM_mallocN(sizeof(int)*3*ntris, "createVertsTrisData faces");
+ verts = MEM_mallocN(sizeof(float) * 3 * nverts, "createVertsTrisData verts");
+ tris = MEM_mallocN(sizeof(int) * 3 * ntris, "createVertsTrisData faces");
- basenverts= 0;
- tri= tris;
- for(oblink= obs, dmlink= dms; oblink && dmlink;
- oblink= oblink->next, dmlink= dmlink->next) {
- ob= (Object*) oblink->link;
- dm= (DerivedMesh*) dmlink->link;
+ basenverts = 0;
+ tri = tris;
+ for (oblink = obs, dmlink = dms; oblink && dmlink;
+ oblink = oblink->next, dmlink = dmlink->next)
+ {
+ ob = (Object *) oblink->link;
+ dm = (DerivedMesh *) dmlink->link;
- curnverts= dm->getNumVerts(dm);
- mvert= dm->getVertArray(dm);
+ curnverts = dm->getNumVerts(dm);
+ mvert = dm->getVertArray(dm);
/* copy verts */
- for(i= 0; i<curnverts; i++) {
- MVert *v= &mvert[i];
+ for (i = 0; i < curnverts; i++) {
+ MVert *v = &mvert[i];
copy_v3_v3(co, v->co);
mul_v3_m4v3(wco, ob->obmat, co);
- verts[3*(basenverts+i)+0]= wco[0];
- verts[3*(basenverts+i)+1]= wco[2];
- verts[3*(basenverts+i)+2]= wco[1];
+ verts[3 * (basenverts + i) + 0] = wco[0];
+ verts[3 * (basenverts + i) + 1] = wco[2];
+ verts[3 * (basenverts + i) + 2] = wco[1];
}
/* create tris */
- curnfaces= dm->getNumTessFaces(dm);
- mface= dm->getTessFaceArray(dm);
+ curnfaces = dm->getNumTessFaces(dm);
+ mface = dm->getTessFaceArray(dm);
- for(i= 0; i<curnfaces; i++) {
- MFace* mf= &mface[i];
+ for (i = 0; i < curnfaces; i++) {
+ MFace *mf = &mface[i];
- tri[0]= basenverts + mf->v1;
- tri[1]= basenverts + mf->v3;
- tri[2]= basenverts + mf->v2;
+ tri[0] = basenverts + mf->v1;
+ tri[1] = basenverts + mf->v3;
+ tri[2] = basenverts + mf->v2;
tri += 3;
- if(mf->v4) {
- tri[0]= basenverts + mf->v1;
- tri[1]= basenverts + mf->v4;
- tri[2]= basenverts + mf->v3;
+ if (mf->v4) {
+ tri[0] = basenverts + mf->v1;
+ tri[1] = basenverts + mf->v4;
+ tri[2] = basenverts + mf->v3;
tri += 3;
}
}
- basenverts+= curnverts;
+ basenverts += curnverts;
}
/* release derived mesh */
- for(dmlink= dms; dmlink; dmlink= dmlink->next) {
- dm= (DerivedMesh*) dmlink->link;
+ for (dmlink = dms; dmlink; dmlink = dmlink->next) {
+ dm = (DerivedMesh *) dmlink->link;
dm->release(dm);
}
BLI_linklist_free(dms, NULL);
- *nverts_r= nverts;
- *verts_r= verts;
- *ntris_r= ntris;
- *tris_r= tris;
+ *nverts_r = nverts;
+ *verts_r = verts;
+ *ntris_r = ntris;
+ *tris_r = tris;
}
static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts, int ntris, int *tris,
- struct recast_polyMesh **pmesh, struct recast_polyMeshDetail **dmesh)
+ struct recast_polyMesh **pmesh, struct recast_polyMeshDetail **dmesh)
{
float bmin[3], bmax[3];
struct recast_heightfield *solid;
unsigned char *triflags;
- struct recast_compactHeightfield* chf;
+ struct recast_compactHeightfield *chf;
struct recast_contourSet *cset;
int width, height, walkableHeight, walkableClimb, walkableRadius;
int minRegionArea, mergeRegionArea, maxEdgeLen;
@@ -181,31 +182,31 @@ static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts
recast_calcBounds(verts, nverts, bmin, bmax);
/* ** Step 1. Initialize build config ** */
- walkableHeight= (int)ceilf(recastParams->agentheight/ recastParams->cellheight);
- walkableClimb= (int)floorf(recastParams->agentmaxclimb / recastParams->cellheight);
- walkableRadius= (int)ceilf(recastParams->agentradius / recastParams->cellsize);
- minRegionArea= (int)(recastParams->regionminsize * recastParams->regionminsize);
- mergeRegionArea= (int)(recastParams->regionmergesize * recastParams->regionmergesize);
- maxEdgeLen= (int)(recastParams->edgemaxlen/recastParams->cellsize);
- detailSampleDist= recastParams->detailsampledist< 0.9f ? 0 :
- recastParams->cellsize * recastParams->detailsampledist;
- detailSampleMaxError= recastParams->cellheight * recastParams->detailsamplemaxerror;
+ walkableHeight = (int)ceilf(recastParams->agentheight / recastParams->cellheight);
+ walkableClimb = (int)floorf(recastParams->agentmaxclimb / recastParams->cellheight);
+ walkableRadius = (int)ceilf(recastParams->agentradius / recastParams->cellsize);
+ minRegionArea = (int)(recastParams->regionminsize * recastParams->regionminsize);
+ mergeRegionArea = (int)(recastParams->regionmergesize * recastParams->regionmergesize);
+ maxEdgeLen = (int)(recastParams->edgemaxlen / recastParams->cellsize);
+ detailSampleDist = recastParams->detailsampledist < 0.9f ? 0 :
+ recastParams->cellsize * recastParams->detailsampledist;
+ detailSampleMaxError = recastParams->cellheight * recastParams->detailsamplemaxerror;
/* Set the area where the navigation will be build. */
recast_calcGridSize(bmin, bmax, recastParams->cellsize, &width, &height);
/* ** Step 2: Rasterize input polygon soup ** */
/* Allocate voxel heightfield where we rasterize our input data to */
- solid= recast_newHeightfield();
+ solid = recast_newHeightfield();
- if(!recast_createHeightfield(solid, width, height, bmin, bmax, recastParams->cellsize, recastParams->cellheight)) {
+ if (!recast_createHeightfield(solid, width, height, bmin, bmax, recastParams->cellsize, recastParams->cellheight)) {
recast_destroyHeightfield(solid);
return 0;
}
/* Allocate array that can hold triangle flags */
- triflags= MEM_callocN(sizeof(unsigned char)*ntris, "buildNavMesh triflags");
+ triflags = MEM_callocN(sizeof(unsigned char) * ntris, "buildNavMesh triflags");
/* Find triangles which are walkable based on their slope and rasterize them */
recast_markWalkableTriangles(RAD2DEG(recastParams->agentmaxslope), verts, nverts, tris, ntris, triflags);
@@ -219,8 +220,8 @@ static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts
/* ** Step 4: Partition walkable surface to simple regions ** */
- chf= recast_newCompactHeightfield();
- if(!recast_buildCompactHeightfield(walkableHeight, walkableClimb, solid, chf)) {
+ chf = recast_newCompactHeightfield();
+ if (!recast_buildCompactHeightfield(walkableHeight, walkableClimb, solid, chf)) {
recast_destroyHeightfield(solid);
recast_destroyCompactHeightfield(chf);
@@ -237,14 +238,14 @@ static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts
}
/* Prepare for region partitioning, by calculating distance field along the walkable surface */
- if(!recast_buildDistanceField(chf)) {
+ if (!recast_buildDistanceField(chf)) {
recast_destroyCompactHeightfield(chf);
return 0;
}
/* Partition the walkable surface into simple regions without holes */
- if(!recast_buildRegions(chf, 0, minRegionArea, mergeRegionArea)) {
+ if (!recast_buildRegions(chf, 0, minRegionArea, mergeRegionArea)) {
recast_destroyCompactHeightfield(chf);
return 0;
@@ -252,9 +253,9 @@ static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts
/* ** Step 5: Trace and simplify region contours ** */
/* Create contours */
- cset= recast_newContourSet();
+ cset = recast_newContourSet();
- if(!recast_buildContours(chf, recastParams->edgemaxerror, maxEdgeLen, cset)) {
+ if (!recast_buildContours(chf, recastParams->edgemaxerror, maxEdgeLen, cset)) {
recast_destroyCompactHeightfield(chf);
recast_destroyContourSet(cset);
@@ -262,8 +263,8 @@ static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts
}
/* ** Step 6: Build polygons mesh from contours ** */
- *pmesh= recast_newPolyMesh();
- if(!recast_buildPolyMesh(cset, recastParams->vertsperpoly, *pmesh)) {
+ *pmesh = recast_newPolyMesh();
+ if (!recast_buildPolyMesh(cset, recastParams->vertsperpoly, *pmesh)) {
recast_destroyCompactHeightfield(chf);
recast_destroyContourSet(cset);
recast_destroyPolyMesh(*pmesh);
@@ -274,8 +275,8 @@ static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts
/* ** Step 7: Create detail mesh which allows to access approximate height on each polygon ** */
- *dmesh= recast_newPolyMeshDetail();
- if(!recast_buildPolyMeshDetail(*pmesh, chf, detailSampleDist, detailSampleMaxError, *dmesh)) {
+ *dmesh = recast_newPolyMeshDetail();
+ if (!recast_buildPolyMeshDetail(*pmesh, chf, detailSampleDist, detailSampleMaxError, *dmesh)) {
recast_destroyCompactHeightfield(chf);
recast_destroyContourSet(cset);
recast_destroyPolyMesh(*pmesh);
@@ -290,16 +291,16 @@ static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts
return 1;
}
-static Object* createRepresentation(bContext *C, struct recast_polyMesh *pmesh, struct recast_polyMeshDetail *dmesh, Base* base)
+static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh, struct recast_polyMeshDetail *dmesh, Base *base)
{
float co[3], rot[3];
BMEditMesh *em;
- int i,j, k;
- unsigned short* v;
+ int i, j, k;
+ unsigned short *v;
int face[3];
- Scene *scene= CTX_data_scene(C);
- Object* obedit;
- int createob= base==NULL;
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit;
+ int createob = base == NULL;
int nverts, nmeshes, nvp;
unsigned short *verts, *polys;
unsigned int *meshes;
@@ -309,35 +310,35 @@ static Object* createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
zero_v3(co);
zero_v3(rot);
- if(createob) {
+ if (createob) {
/* create new object */
- obedit= ED_object_add_type(C, OB_MESH, co, rot, FALSE, 1);
+ obedit = ED_object_add_type(C, OB_MESH, co, rot, FALSE, 1);
}
else {
- obedit= base->object;
+ obedit = base->object;
scene_select_base(scene, base);
copy_v3_v3(obedit->loc, co);
copy_v3_v3(obedit->rot, rot);
}
- ED_object_enter_editmode(C, EM_DO_UNDO|EM_IGNORE_LAYER);
- em= (((Mesh *)obedit->data))->edit_btmesh;
+ ED_object_enter_editmode(C, EM_DO_UNDO | EM_IGNORE_LAYER);
+ em = BMEdit_FromObject(obedit);
- if(!createob) {
+ if (!createob) {
/* clear */
- EDBM_ClearMesh(em);
+ EDBM_mesh_clear(em);
}
/* create verts for polygon mesh */
- verts= recast_polyMeshGetVerts(pmesh, &nverts);
+ verts = recast_polyMeshGetVerts(pmesh, &nverts);
recast_polyMeshGetBoundbox(pmesh, bmin, NULL);
recast_polyMeshGetCell(pmesh, &cs, &ch);
- for(i= 0; i<nverts; i++) {
- v= &verts[3*i];
- co[0]= bmin[0] + v[0]*cs;
- co[1]= bmin[1] + v[1]*ch;
- co[2]= bmin[2] + v[2]*cs;
+ for (i = 0; i < nverts; i++) {
+ v = &verts[3 * i];
+ co[0] = bmin[0] + v[0] * cs;
+ co[1] = bmin[1] + v[1] * ch;
+ co[2] = bmin[2] + v[2] * cs;
SWAP(float, co[1], co[2]);
BM_vert_create(em->bm, co, NULL);
}
@@ -346,74 +347,74 @@ static Object* createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
CustomData_add_layer_named(&em->bm->pdata, CD_RECAST, CD_CALLOC, NULL, 0, "createRepresentation recastData");
/* create verts and faces for detailed mesh */
- meshes= recast_polyMeshDetailGetMeshes(dmesh, &nmeshes);
- polys= recast_polyMeshGetPolys(pmesh, NULL, &nvp);
- dverts= recast_polyMeshDetailGetVerts(dmesh, NULL);
- tris= recast_polyMeshDetailGetTris(dmesh, NULL);
-
- for(i= 0; i<nmeshes; i++) {
- int uniquevbase= em->bm->totvert;
- unsigned int vbase= meshes[4*i+0];
- unsigned short ndv= meshes[4*i+1];
- unsigned short tribase= meshes[4*i+2];
- unsigned short trinum= meshes[4*i+3];
- const unsigned short* p= &polys[i*nvp*2];
- int nv= 0;
-
- for(j= 0; j < nvp; ++j) {
- if(p[j]==0xffff) break;
+ meshes = recast_polyMeshDetailGetMeshes(dmesh, &nmeshes);
+ polys = recast_polyMeshGetPolys(pmesh, NULL, &nvp);
+ dverts = recast_polyMeshDetailGetVerts(dmesh, NULL);
+ tris = recast_polyMeshDetailGetTris(dmesh, NULL);
+
+ for (i = 0; i < nmeshes; i++) {
+ int uniquevbase = em->bm->totvert;
+ unsigned int vbase = meshes[4 * i + 0];
+ unsigned short ndv = meshes[4 * i + 1];
+ unsigned short tribase = meshes[4 * i + 2];
+ unsigned short trinum = meshes[4 * i + 3];
+ const unsigned short *p = &polys[i * nvp * 2];
+ int nv = 0;
+
+ for (j = 0; j < nvp; ++j) {
+ if (p[j] == 0xffff) break;
nv++;
}
/* create unique verts */
- for(j= nv; j<ndv; j++) {
- copy_v3_v3(co, &dverts[3*(vbase + j)]);
+ for (j = nv; j < ndv; j++) {
+ copy_v3_v3(co, &dverts[3 * (vbase + j)]);
SWAP(float, co[1], co[2]);
BM_vert_create(em->bm, co, NULL);
}
- EDBM_init_index_arrays(em, 1, 0, 0);
+ EDBM_index_arrays_init(em, 1, 0, 0);
/* create faces */
- for(j= 0; j<trinum; j++) {
- unsigned char* tri= &tris[4*(tribase+j)];
- BMFace* newFace;
- int* polygonIdx;
-
- for(k= 0; k<3; k++) {
- if(tri[k]<nv)
- face[k] = p[tri[k]]; /* shared vertex */
+ for (j = 0; j < trinum; j++) {
+ unsigned char *tri = &tris[4 * (tribase + j)];
+ BMFace *newFace;
+ int *polygonIdx;
+
+ for (k = 0; k < 3; k++) {
+ if (tri[k] < nv)
+ face[k] = p[tri[k]]; /* shared vertex */
else
- face[k] = uniquevbase+tri[k]-nv; /* unique vertex */
+ face[k] = uniquevbase + tri[k] - nv; /* unique vertex */
}
- newFace= BM_face_create_quad_tri(em->bm,
- EDBM_get_vert_for_index(em, face[0]),
- EDBM_get_vert_for_index(em, face[2]),
- EDBM_get_vert_for_index(em, face[1]), NULL,
- NULL, FALSE);
+ newFace = BM_face_create_quad_tri(em->bm,
+ EDBM_vert_at_index(em, face[0]),
+ EDBM_vert_at_index(em, face[2]),
+ EDBM_vert_at_index(em, face[1]), NULL,
+ NULL, FALSE);
/* set navigation polygon idx to the custom layer */
- polygonIdx= (int*)CustomData_bmesh_get(&em->bm->pdata, newFace->head.data, CD_RECAST);
- *polygonIdx= i+1; /* add 1 to avoid zero idx */
+ polygonIdx = (int *)CustomData_bmesh_get(&em->bm->pdata, newFace->head.data, CD_RECAST);
+ *polygonIdx = i + 1; /* add 1 to avoid zero idx */
}
- EDBM_free_index_arrays(em);
+ EDBM_index_arrays_free(em);
}
recast_destroyPolyMesh(pmesh);
recast_destroyPolyMeshDetail(dmesh);
- DAG_id_tag_update((ID*)obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ DAG_id_tag_update((ID *)obedit->data, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
ED_object_exit_editmode(C, EM_FREEDATA);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit);
+ WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, obedit);
- if(createob) {
- obedit->gameflag&= ~OB_COLLISION;
- obedit->gameflag|= OB_NAVMESH;
- obedit->body_type= OB_BODY_TYPE_NAVMESH;
+ if (createob) {
+ obedit->gameflag &= ~OB_COLLISION;
+ obedit->gameflag |= OB_NAVMESH;
+ obedit->body_type = OB_BODY_TYPE_NAVMESH;
rename_id((ID *)obedit, "Navmesh");
}
@@ -422,33 +423,33 @@ static Object* createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
return obedit;
}
-static int create_navmesh_exec(bContext *C, wmOperator *op)
+static int navmesh_create_exec(bContext *C, wmOperator *op)
{
- Scene* scene= CTX_data_scene(C);
- LinkNode* obs= NULL;
- Base* navmeshBase= NULL;
+ Scene *scene = CTX_data_scene(C);
+ LinkNode *obs = NULL;
+ Base *navmeshBase = NULL;
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
if (base->object->type == OB_MESH) {
- if (base->object->body_type==OB_BODY_TYPE_NAVMESH) {
+ if (base->object->body_type == OB_BODY_TYPE_NAVMESH) {
if (!navmeshBase || base == scene->basact) {
- navmeshBase= base;
+ navmeshBase = base;
}
}
else {
- BLI_linklist_append(&obs, (void*)base->object);
+ BLI_linklist_append(&obs, (void *)base->object);
}
}
}
CTX_DATA_END;
if (obs) {
- struct recast_polyMesh *pmesh= NULL;
- struct recast_polyMeshDetail *dmesh= NULL;
+ struct recast_polyMesh *pmesh = NULL;
+ struct recast_polyMeshDetail *dmesh = NULL;
- int nverts= 0, ntris= 0;
- int *tris= 0;
- float *verts= NULL;
+ int nverts = 0, ntris = 0;
+ int *tris = 0;
+ float *verts = NULL;
createVertsTrisData(C, obs, &nverts, &verts, &ntris, &tris);
BLI_linklist_free(obs, NULL);
@@ -470,38 +471,38 @@ static int create_navmesh_exec(bContext *C, wmOperator *op)
void MESH_OT_navmesh_make(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Create navigation mesh";
- ot->description= "Create navigation mesh for selected objects";
- ot->idname= "MESH_OT_navmesh_make";
+ ot->name = "Create navigation mesh";
+ ot->description = "Create navigation mesh for selected objects";
+ ot->idname = "MESH_OT_navmesh_make";
/* api callbacks */
- ot->exec= create_navmesh_exec;
+ ot->exec = navmesh_create_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int navmesh_face_copy_exec(bContext *C, wmOperator *op)
{
- Object *obedit= CTX_data_edit_object(C);
- BMEditMesh *em= ((Mesh *)obedit->data)->edit_btmesh;
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
/* do work here */
- BMFace *efa_act= BM_active_face_get(em->bm, FALSE);
+ BMFace *efa_act = BM_active_face_get(em->bm, FALSE);
- if(efa_act) {
- if(CustomData_has_layer(&em->bm->pdata, CD_RECAST)) {
+ if (efa_act) {
+ if (CustomData_has_layer(&em->bm->pdata, CD_RECAST)) {
BMFace *efa;
BMIter iter;
- int targetPolyIdx= *(int*)CustomData_bmesh_get(&em->bm->pdata, efa_act->head.data, CD_RECAST);
- targetPolyIdx= targetPolyIdx>=0? targetPolyIdx : -targetPolyIdx;
+ int targetPolyIdx = *(int *)CustomData_bmesh_get(&em->bm->pdata, efa_act->head.data, CD_RECAST);
+ targetPolyIdx = targetPolyIdx >= 0 ? targetPolyIdx : -targetPolyIdx;
- if(targetPolyIdx > 0) {
+ if (targetPolyIdx > 0) {
/* set target poly idx to other selected faces */
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- if(BM_elem_flag_test(efa, BM_ELEM_SELECT) && efa != efa_act) {
- int* recastDataBlock= (int*)CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_RECAST);
- *recastDataBlock= targetPolyIdx;
+ if (BM_elem_flag_test(efa, BM_ELEM_SELECT) && efa != efa_act) {
+ int *recastDataBlock = (int *)CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_RECAST);
+ *recastDataBlock = targetPolyIdx;
}
}
}
@@ -511,8 +512,8 @@ static int navmesh_face_copy_exec(bContext *C, wmOperator *op)
}
}
- DAG_id_tag_update((ID*)obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ DAG_id_tag_update((ID *)obedit->data, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
return OPERATOR_FINISHED;
}
@@ -520,47 +521,47 @@ static int navmesh_face_copy_exec(bContext *C, wmOperator *op)
void MESH_OT_navmesh_face_copy(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "NavMesh Copy Face Index";
- ot->description= "Copy the index from the active face";
- ot->idname= "MESH_OT_navmesh_face_copy";
+ ot->name = "NavMesh Copy Face Index";
+ ot->description = "Copy the index from the active face";
+ ot->idname = "MESH_OT_navmesh_face_copy";
/* api callbacks */
- ot->poll= ED_operator_editmesh;
- ot->exec= navmesh_face_copy_exec;
+ ot->poll = ED_operator_editmesh;
+ ot->exec = navmesh_face_copy_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int compare(const void * a, const void * b)
+static int compare(const void *a, const void *b)
{
- return ( *(int*)a - *(int*)b );
+ return (*(int *)a - *(int *)b);
}
-static int findFreeNavPolyIndex(BMEditMesh* em)
+static int findFreeNavPolyIndex(BMEditMesh *em)
{
/* construct vector of indices */
- int numfaces= em->bm->totface;
- int* indices= MEM_callocN(sizeof(int)*numfaces, "findFreeNavPolyIndex(indices)");
- BMFace* ef;
+ int numfaces = em->bm->totface;
+ int *indices = MEM_callocN(sizeof(int) * numfaces, "findFreeNavPolyIndex(indices)");
+ BMFace *ef;
BMIter iter;
- int i, idx= em->bm->totface-1, freeIdx= 1;
+ int i, idx = em->bm->totface - 1, freeIdx = 1;
/*XXX this originally went last to first, but that isn't possible anymore*/
BM_ITER(ef, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- int polyIdx= *(int*)CustomData_bmesh_get(&em->bm->pdata, ef->head.data, CD_RECAST);
- indices[idx]= polyIdx;
+ int polyIdx = *(int *)CustomData_bmesh_get(&em->bm->pdata, ef->head.data, CD_RECAST);
+ indices[idx] = polyIdx;
idx--;
}
qsort(indices, numfaces, sizeof(int), compare);
/* search first free index */
- freeIdx= 1;
- for(i= 0; i<numfaces; i++) {
- if(indices[i]==freeIdx)
+ freeIdx = 1;
+ for (i = 0; i < numfaces; i++) {
+ if (indices[i] == freeIdx)
freeIdx++;
- else if(indices[i]>freeIdx)
+ else if (indices[i] > freeIdx)
break;
}
@@ -571,29 +572,29 @@ static int findFreeNavPolyIndex(BMEditMesh* em)
static int navmesh_face_add_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *obedit= CTX_data_edit_object(C);
- BMEditMesh *em= ((Mesh *)obedit->data)->edit_btmesh;
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *ef;
BMIter iter;
- if(CustomData_has_layer(&em->bm->pdata, CD_RECAST)) {
- int targetPolyIdx= findFreeNavPolyIndex(em);
+ if (CustomData_has_layer(&em->bm->pdata, CD_RECAST)) {
+ int targetPolyIdx = findFreeNavPolyIndex(em);
- if(targetPolyIdx>0) {
+ if (targetPolyIdx > 0) {
/* set target poly idx to selected faces */
/*XXX this originally went last to first, but that isn't possible anymore*/
BM_ITER(ef, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- if(BM_elem_flag_test(ef, BM_ELEM_SELECT)) {
- int *recastDataBlock= (int*)CustomData_bmesh_get(&em->bm->pdata, ef->head.data, CD_RECAST);
- *recastDataBlock= targetPolyIdx;
+ if (BM_elem_flag_test(ef, BM_ELEM_SELECT)) {
+ int *recastDataBlock = (int *)CustomData_bmesh_get(&em->bm->pdata, ef->head.data, CD_RECAST);
+ *recastDataBlock = targetPolyIdx;
}
}
}
}
- DAG_id_tag_update((ID*)obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ DAG_id_tag_update((ID *)obedit->data, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
return OPERATOR_FINISHED;
}
@@ -601,23 +602,23 @@ static int navmesh_face_add_exec(bContext *C, wmOperator *UNUSED(op))
void MESH_OT_navmesh_face_add(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "NavMesh New Face Index";
- ot->description= "Add a new index and assign it to selected faces";
- ot->idname= "MESH_OT_navmesh_face_add";
+ ot->name = "NavMesh New Face Index";
+ ot->description = "Add a new index and assign it to selected faces";
+ ot->idname = "MESH_OT_navmesh_face_add";
/* api callbacks */
- ot->poll= ED_operator_editmesh;
- ot->exec= navmesh_face_add_exec;
+ ot->poll = ED_operator_editmesh;
+ ot->exec = navmesh_face_add_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int navmesh_obmode_data_poll(bContext *C)
{
Object *ob = ED_object_active_context(C);
if (ob && (ob->mode == OB_MODE_OBJECT) && (ob->type == OB_MESH)) {
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
return CustomData_has_layer(&me->pdata, CD_RECAST);
}
return FALSE;
@@ -635,14 +636,14 @@ static int navmesh_obmode_poll(bContext *C)
static int navmesh_reset_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob = ED_object_active_context(C);
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
CustomData_free_layers(&me->pdata, CD_RECAST, me->totpoly);
BKE_mesh_ensure_navmesh(me);
DAG_id_tag_update(&me->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, &me->id);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, &me->id);
return OPERATOR_FINISHED;
}
@@ -650,27 +651,27 @@ static int navmesh_reset_exec(bContext *C, wmOperator *UNUSED(op))
void MESH_OT_navmesh_reset(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "NavMesh Reset Index Values";
- ot->description= "Assign a new index to every face";
- ot->idname= "MESH_OT_navmesh_reset";
+ ot->name = "NavMesh Reset Index Values";
+ ot->description = "Assign a new index to every face";
+ ot->idname = "MESH_OT_navmesh_reset";
/* api callbacks */
- ot->poll= navmesh_obmode_poll;
- ot->exec= navmesh_reset_exec;
+ ot->poll = navmesh_obmode_poll;
+ ot->exec = navmesh_reset_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int navmesh_clear_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob = ED_object_active_context(C);
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
CustomData_free_layers(&me->pdata, CD_RECAST, me->totpoly);
DAG_id_tag_update(&me->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, &me->id);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, &me->id);
return OPERATOR_FINISHED;
}
@@ -678,14 +679,14 @@ static int navmesh_clear_exec(bContext *C, wmOperator *UNUSED(op))
void MESH_OT_navmesh_clear(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "NavMesh Clear Data";
- ot->description= "Remove navmesh data from this mesh";
- ot->idname= "MESH_OT_navmesh_clear";
+ ot->name = "NavMesh Clear Data";
+ ot->description = "Remove navmesh data from this mesh";
+ ot->idname = "MESH_OT_navmesh_clear";
/* api callbacks */
- ot->poll= navmesh_obmode_data_poll;
- ot->exec= navmesh_clear_exec;
+ ot->poll = navmesh_obmode_data_poll;
+ ot->exec = navmesh_clear_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c
index 4b4083751e7..f44d287e9f3 100644
--- a/source/blender/editors/mesh/mesh_ops.c
+++ b/source/blender/editors/mesh/mesh_ops.c
@@ -114,12 +114,15 @@ void ED_operatortypes_mesh(void)
WM_operatortype_append(MESH_OT_beautify_fill);
WM_operatortype_append(MESH_OT_quads_convert_to_tris);
WM_operatortype_append(MESH_OT_tris_convert_to_quads);
+ WM_operatortype_append(MESH_OT_dissolve);
WM_operatortype_append(MESH_OT_dissolve_limited);
WM_operatortype_append(MESH_OT_faces_shade_smooth);
WM_operatortype_append(MESH_OT_faces_shade_flat);
WM_operatortype_append(MESH_OT_sort_faces);
WM_operatortype_append(MESH_OT_delete);
+ WM_operatortype_append(MESH_OT_edge_collapse);
+ WM_operatortype_append(MESH_OT_edge_collapse_loop);
WM_operatortype_append(MESH_OT_separate);
WM_operatortype_append(MESH_OT_dupli_extrude_cursor);
@@ -159,6 +162,8 @@ void ED_operatortypes_mesh(void)
WM_operatortype_append(MESH_OT_select_next_loop);
WM_operatortype_append(MESH_OT_bridge_edge_loops);
+ WM_operatortype_append(MESH_OT_inset);
+ WM_operatortype_append(MESH_OT_edge_split);
#ifdef WITH_GAMEENGINE
WM_operatortype_append(MESH_OT_navmesh_make);
@@ -172,9 +177,9 @@ void ED_operatortypes_mesh(void)
#if 0 /* UNUSED, remove? */
static int ED_operator_editmesh_face_select(bContext *C)
{
- Object *obedit= CTX_data_edit_object(C);
- if(obedit && obedit->type==OB_MESH) {
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ Object *obedit = CTX_data_edit_object(C);
+ if (obedit && obedit->type == OB_MESH) {
+ BMEditMesh *em = BMEdit_FromObject(obedit);
if (em && em->selectmode & SCE_SELECT_FACE) {
return 1;
}
@@ -188,51 +193,51 @@ void ED_operatormacros_mesh(void)
wmOperatorType *ot;
wmOperatorTypeMacro *otmacro;
- ot= WM_operatortype_append_macro("MESH_OT_loopcut_slide", "Loop Cut and Slide", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("MESH_OT_loopcut_slide", "Loop Cut and Slide", OPTYPE_UNDO | OPTYPE_REGISTER);
ot->description = "Cut mesh loop and slide it";
WM_operatortype_macro_define(ot, "MESH_OT_loopcut");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_edge_slide");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_edge_slide");
RNA_struct_idprops_unset(otmacro->ptr, "release_confirm");
- ot= WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO | OPTYPE_REGISTER);
ot->description = "Duplicate mesh and move";
WM_operatortype_macro_define(ot, "MESH_OT_duplicate");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_enum_set(otmacro->ptr, "proportional", 0);
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
- ot= WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", OPTYPE_UNDO | OPTYPE_REGISTER);
ot->description = "Rip polygons and move the result";
WM_operatortype_macro_define(ot, "MESH_OT_rip");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_enum_set(otmacro->ptr, "proportional", 0);
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
- ot= WM_operatortype_append_macro("MESH_OT_extrude_region_move", "Extrude Region and Move", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("MESH_OT_extrude_region_move", "Extrude Region and Move", OPTYPE_UNDO | OPTYPE_REGISTER);
ot->description = "Extrude region and move result";
- otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude_region");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_region");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_enum_set(otmacro->ptr, "proportional", 0);
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
- ot= WM_operatortype_append_macro("MESH_OT_extrude_faces_move", "Extrude Individual Faces and Move", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("MESH_OT_extrude_faces_move", "Extrude Individual Faces and Move", OPTYPE_UNDO | OPTYPE_REGISTER);
ot->description = "Extrude faces and move result";
- otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude_faces_indiv");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten");
+ otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_faces_indiv");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten");
RNA_enum_set(otmacro->ptr, "proportional", 0);
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
- ot= WM_operatortype_append_macro("MESH_OT_extrude_edges_move", "Extrude Only Edges and Move", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("MESH_OT_extrude_edges_move", "Extrude Only Edges and Move", OPTYPE_UNDO | OPTYPE_REGISTER);
ot->description = "Extrude edges and move result";
- otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude_edges_indiv");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_edges_indiv");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_enum_set(otmacro->ptr, "proportional", 0);
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
- ot= WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", "Extrude Only Vertices and Move", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", "Extrude Only Vertices and Move", OPTYPE_UNDO | OPTYPE_REGISTER);
ot->description = "Extrude vertices and move result";
- otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude_verts_indiv");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_verts_indiv");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_enum_set(otmacro->ptr, "proportional", 0);
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
}
@@ -244,8 +249,8 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
int i;
- keymap= WM_keymap_find(keyconf, "Mesh", 0, 0);
- keymap->poll= ED_operator_editmesh;
+ keymap = WM_keymap_find(keyconf, "Mesh", 0, 0);
+ keymap->poll = ED_operator_editmesh;
WM_keymap_add_item(keymap, "MESH_OT_loopcut_slide", RKEY, KM_PRESS, KM_CTRL, 0);
@@ -253,12 +258,12 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
/* standard mouse selection goes via space_view3d */
kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
- kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_SHIFT | KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
- kmi = WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_ALT | KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
- kmi = WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT|KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_SHIFT | KM_ALT | KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
WM_keymap_add_item(keymap, "MESH_OT_select_shortest_path", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
@@ -270,7 +275,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "MESH_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "MESH_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
- WM_keymap_add_item(keymap, "MESH_OT_select_non_manifold", MKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0);
+ WM_keymap_add_item(keymap, "MESH_OT_select_non_manifold", MKEY, KM_PRESS, (KM_CTRL | KM_SHIFT | KM_ALT), 0);
WM_keymap_add_item(keymap, "MESH_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
kmi = WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, 0, 0);
@@ -278,7 +283,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
kmi = WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "deselect", TRUE);
- WM_keymap_add_item(keymap, "MESH_OT_faces_select_linked_flat", FKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0);
+ WM_keymap_add_item(keymap, "MESH_OT_faces_select_linked_flat", FKEY, KM_PRESS, (KM_CTRL | KM_SHIFT | KM_ALT), 0);
WM_keymap_add_item(keymap, "MESH_OT_select_similar", GKEY, KM_PRESS, KM_SHIFT, 0);
@@ -295,7 +300,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
/* tools */
kmi = WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "inside", FALSE);
- kmi = WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "inside", TRUE);
WM_keymap_add_item(keymap, "VIEW3D_OT_edit_mesh_extrude_move_normal", EKEY, KM_PRESS, 0, 0); /* python operator */
@@ -306,12 +311,15 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "MESH_OT_spin", RKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "MESH_OT_fill", FKEY, KM_PRESS, KM_ALT, 0);
- WM_keymap_add_item(keymap, "MESH_OT_beautify_fill", FKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
+ 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);
+ WM_keymap_add_item(keymap, "MESH_OT_rip_move", VKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "MESH_OT_merge", MKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "TRANSFORM_OT_shrink_fatten", SKEY, KM_PRESS, KM_ALT, 0);
@@ -330,11 +338,11 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
/* use KM_CLICK because same key is used for tweaks */
kmi = WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "rotate_source", TRUE);
- kmi = WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_SHIFT|KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_SHIFT | KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "rotate_source", FALSE);
- WM_keymap_add_item(keymap, "MESH_OT_delete", XKEY, KM_PRESS, 0, 0);
- WM_keymap_add_item(keymap, "MESH_OT_delete", DELKEY, KM_PRESS, 0, 0);
+ WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_delete", XKEY, KM_PRESS, 0, 0);
+ WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_delete", DELKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "MESH_OT_knifetool", KKEY, KM_PRESS, 0, 0);
//RNA_enum_set(WM_keymap_add_item(keymap, "MESH_OT_knife_cut", LEFTMOUSE, KM_PRESS, KM_SHIFT, KKEY)->ptr, "type", 2/*KNIFE_MIDPOINT*/);
@@ -351,8 +359,8 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
WM_keymap_add_menu(keymap, "VIEW3D_MT_vertex_group", GKEY, KM_PRESS, KM_CTRL, 0);
/* useful stuff from object-mode */
- for (i=0; i<=5; i++) {
- kmi = WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", ZEROKEY+i, KM_PRESS, KM_CTRL, 0);
+ for (i = 0; i <= 5; i++) {
+ kmi = WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", ZEROKEY + i, KM_PRESS, KM_CTRL, 0);
RNA_int_set(kmi->ptr, "level", i);
}
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index bad0718c613..37922b6e693 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,186 +87,187 @@
/*********************** 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)
{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_active_object(C);
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = CTX_data_active_object(C);
Material **matar, *ma;
Mesh *me;
MVert *mvert, *mv;
MEdge *medge = NULL;
MPoly *mpoly = NULL;
MLoop *mloop = NULL;
- Key *key, *nkey=NULL;
+ Key *key, *nkey = NULL;
KeyBlock *kb, *okb, *kbn;
float imat[4][4], cmat[4][4], *fp1, *fp2, curpos;
- int a, b, totcol, totmat=0, totedge=0, totvert=0, ok=0;
- int totloop=0, totpoly=0, vertofs, *matmap=NULL;
- int i, j, index, haskey=0, edgeofs, loopofs, polyofs;
+ int a, b, totcol, totmat = 0, totedge = 0, totvert = 0, ok = 0;
+ int totloop = 0, totpoly = 0, vertofs, *matmap = NULL;
+ int i, j, index, haskey = 0, edgeofs, loopofs, polyofs;
bDeformGroup *dg, *odg;
MDeformVert *dvert;
CustomData vdata, edata, fdata, ldata, pdata;
- if(scene->obedit) {
+ if (scene->obedit) {
BKE_report(op->reports, RPT_WARNING, "Cant join while in editmode");
return OPERATOR_CANCELLED;
}
/* ob is the object we are adding geometry to */
- if(!ob || ob->type!=OB_MESH) {
+ if (!ob || ob->type != OB_MESH) {
BKE_report(op->reports, RPT_WARNING, "Active object is not a mesh");
return OPERATOR_CANCELLED;
}
/* count & check */
- CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
- if(base->object->type==OB_MESH) {
- me= base->object->data;
-
- totvert+= me->totvert;
- totedge+= me->totedge;
- totloop+= me->totloop;
- totpoly+= me->totpoly;
- totmat+= base->object->totcol;
+ CTX_DATA_BEGIN(C, Base *, base, selected_editable_bases) {
+ if (base->object->type == OB_MESH) {
+ me = base->object->data;
+
+ totvert += me->totvert;
+ totedge += me->totedge;
+ totloop += me->totloop;
+ totpoly += me->totpoly;
+ totmat += base->object->totcol;
- if(base->object == ob)
- ok= 1;
+ if (base->object == ob)
+ ok = 1;
/* check for shapekeys */
- if(me->key)
+ if (me->key)
haskey++;
}
}
CTX_DATA_END;
/* that way the active object is always selected */
- if(ok==0) {
+ if (ok == 0) {
BKE_report(op->reports, RPT_WARNING, "Active object is not a selected mesh");
return OPERATOR_CANCELLED;
}
/* only join meshes if there are verts to join, there aren't too many, and we only had one mesh selected */
- me= (Mesh *)ob->data;
- key= me->key;
+ me = (Mesh *)ob->data;
+ key = me->key;
- if(totvert==0 || totvert==me->totvert) {
+ if (totvert == 0 || totvert == me->totvert) {
BKE_report(op->reports, RPT_WARNING, "No mesh data to join");
return OPERATOR_CANCELLED;
}
- if(totvert > MESH_MAX_VERTS) {
+ if (totvert > MESH_MAX_VERTS) {
BKE_reportf(op->reports, RPT_WARNING, "Joining results in %d vertices, limit is " STRINGIFY(MESH_MAX_VERTS), totvert);
return OPERATOR_CANCELLED;
}
/* new material indices and material array */
- matar= MEM_callocN(sizeof(void*)*totmat, "join_mesh matar");
- if (totmat) matmap= MEM_callocN(sizeof(int)*totmat, "join_mesh matmap");
- totcol= ob->totcol;
+ matar = MEM_callocN(sizeof(void *) * totmat, "join_mesh matar");
+ if (totmat) matmap = MEM_callocN(sizeof(int) * totmat, "join_mesh matmap");
+ totcol = ob->totcol;
/* obact materials in new main array, is nicer start! */
- for(a=0; a<ob->totcol; a++) {
- matar[a]= give_current_material(ob, a+1);
+ for (a = 0; a < ob->totcol; a++) {
+ matar[a] = give_current_material(ob, a + 1);
id_us_plus((ID *)matar[a]);
/* increase id->us : will be lowered later */
}
/* - if destination mesh had shapekeys, move them somewhere safe, and set up placeholders
- * with arrays that are large enough to hold shapekey data for all meshes
+ * with arrays that are large enough to hold shapekey data for all meshes
* - if destination mesh didn't have shapekeys, but we encountered some in the meshes we're
* joining, set up a new keyblock and assign to the mesh
*/
- if(key) {
+ if (key) {
/* make a duplicate copy that will only be used here... (must remember to free it!) */
- nkey= copy_key(key);
+ nkey = copy_key(key);
/* for all keys in old block, clear data-arrays */
- for(kb= key->block.first; kb; kb= kb->next) {
- if(kb->data) MEM_freeN(kb->data);
- kb->data= MEM_callocN(sizeof(float)*3*totvert, "join_shapekey");
- kb->totelem= totvert;
- kb->weights= NULL;
+ for (kb = key->block.first; kb; kb = kb->next) {
+ if (kb->data) MEM_freeN(kb->data);
+ kb->data = MEM_callocN(sizeof(float) * 3 * totvert, "join_shapekey");
+ kb->totelem = totvert;
+ kb->weights = NULL;
}
}
- else if(haskey) {
+ else if (haskey) {
/* add a new key-block and add to the mesh */
- key= me->key= add_key((ID *)me);
+ key = me->key = add_key((ID *)me);
key->type = KEY_RELATIVE;
}
/* first pass over objects - copying materials and vertexgroups across */
- CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
+ CTX_DATA_BEGIN(C, Base *, base, selected_editable_bases)
+ {
/* only act if a mesh, and not the one we're joining to */
- if((ob!=base->object) && (base->object->type==OB_MESH)) {
- me= base->object->data;
+ if ((ob != base->object) && (base->object->type == OB_MESH)) {
+ me = base->object->data;
/* Join this object's vertex groups to the base one's */
- for(dg=base->object->defbase.first; dg; dg=dg->next) {
+ for (dg = base->object->defbase.first; dg; dg = dg->next) {
/* See if this group exists in the object (if it doesn't, add it to the end) */
- if(!defgroup_find_name(ob, dg->name)) {
+ if (!defgroup_find_name(ob, dg->name)) {
odg = MEM_callocN(sizeof(bDeformGroup), "join deformGroup");
memcpy(odg, dg, sizeof(bDeformGroup));
BLI_addtail(&ob->defbase, odg);
}
}
- if(ob->defbase.first && ob->actdef==0)
- ob->actdef=1;
+ if (ob->defbase.first && ob->actdef == 0)
+ ob->actdef = 1;
- if(me->totvert) {
+ if (me->totvert) {
/* Add this object's materials to the base one's if they don't exist already (but only if limits not exceeded yet) */
- if(totcol < MAXMAT) {
- for(a=1; a<=base->object->totcol; a++) {
- ma= give_current_material(base->object, a);
+ if (totcol < MAXMAT) {
+ for (a = 1; a <= base->object->totcol; a++) {
+ ma = give_current_material(base->object, a);
- for(b=0; b<totcol; b++) {
- if(ma == matar[b]) break;
+ for (b = 0; b < totcol; b++) {
+ if (ma == matar[b]) break;
}
- if(b==totcol) {
- matar[b]= ma;
- if(ma) {
+ if (b == totcol) {
+ matar[b] = ma;
+ if (ma) {
id_us_plus(&ma->id);
}
totcol++;
}
- if(totcol >= MAXMAT)
+ if (totcol >= MAXMAT)
break;
}
}
/* if this mesh has shapekeys, check if destination mesh already has matching entries too */
- if(me->key && key) {
- for(kb= me->key->block.first; kb; kb= kb->next) {
+ if (me->key && key) {
+ for (kb = me->key->block.first; kb; kb = kb->next) {
/* if key doesn't exist in destination mesh, add it */
- if(key_get_named_keyblock(key, kb->name) == NULL) {
+ if (key_get_named_keyblock(key, kb->name) == NULL) {
/* copy this existing one over to the new shapekey block */
- kbn= MEM_dupallocN(kb);
- kbn->prev= kbn->next= NULL;
+ kbn = MEM_dupallocN(kb);
+ kbn->prev = kbn->next = NULL;
/* adjust adrcode and other settings to fit (allocate a new data-array) */
- kbn->data= MEM_callocN(sizeof(float)*3*totvert, "joined_shapekey");
- kbn->totelem= totvert;
- kbn->weights= NULL;
+ kbn->data = MEM_callocN(sizeof(float) * 3 * totvert, "joined_shapekey");
+ kbn->totelem = totvert;
+ kbn->weights = NULL;
- okb= key->block.last;
- curpos= (okb) ? okb->pos : -0.1f;
- if(key->type == KEY_RELATIVE)
- kbn->pos= curpos + 0.1f;
+ okb = key->block.last;
+ curpos = (okb) ? okb->pos : -0.1f;
+ if (key->type == KEY_RELATIVE)
+ kbn->pos = curpos + 0.1f;
else
- kbn->pos= curpos;
+ kbn->pos = curpos;
BLI_addtail(&key->block, kbn);
- kbn->adrcode= key->totkey;
+ kbn->adrcode = key->totkey;
key->totkey++;
- if(key->totkey==1) key->refkey= kbn;
+ if (key->totkey == 1) key->refkey = kbn;
// XXX 2.5 Animato
#if 0
/* also, copy corresponding ipo-curve to ipo-block if applicable */
- if(me->key->ipo && key->ipo) {
+ if (me->key->ipo && key->ipo) {
// FIXME... this is a luxury item!
puts("FIXME: ignoring IPO's when joining shapekeys on Meshes for now...");
}
@@ -286,42 +287,43 @@ int join_mesh_exec(bContext *C, wmOperator *op)
memset(&ldata, 0, sizeof(ldata));
memset(&pdata, 0, sizeof(pdata));
- mvert= CustomData_add_layer(&vdata, CD_MVERT, CD_CALLOC, NULL, totvert);
- medge= CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge);
- mloop= CustomData_add_layer(&ldata, CD_MLOOP, CD_CALLOC, NULL, totloop);
- mpoly= CustomData_add_layer(&pdata, CD_MPOLY, CD_CALLOC, NULL, totpoly);
-
- vertofs= 0;
- edgeofs= 0;
- loopofs= 0;
- polyofs= 0;
+ mvert = CustomData_add_layer(&vdata, CD_MVERT, CD_CALLOC, NULL, totvert);
+ medge = CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge);
+ mloop = CustomData_add_layer(&ldata, CD_MLOOP, CD_CALLOC, NULL, totloop);
+ mpoly = CustomData_add_layer(&pdata, CD_MPOLY, CD_CALLOC, NULL, totpoly);
+
+ vertofs = 0;
+ edgeofs = 0;
+ loopofs = 0;
+ polyofs = 0;
/* inverse transform for all selected meshes in this object */
invert_m4_m4(imat, ob->obmat);
- CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
+ CTX_DATA_BEGIN(C, Base *, base, selected_editable_bases)
+ {
/* only join if this is a mesh */
- if(base->object->type==OB_MESH) {
- me= base->object->data;
+ if (base->object->type == OB_MESH) {
+ me = base->object->data;
- if(me->totvert) {
+ if (me->totvert) {
/* standard data */
CustomData_merge(&me->vdata, &vdata, CD_MASK_MESH, CD_DEFAULT, totvert);
CustomData_copy_data(&me->vdata, &vdata, 0, vertofs, me->totvert);
/* vertex groups */
- dvert= CustomData_get(&vdata, vertofs, CD_MDEFORMVERT);
+ dvert = CustomData_get(&vdata, vertofs, CD_MDEFORMVERT);
/* NB: vertex groups here are new version */
- if(dvert) {
- for(i=0; i<me->totvert; i++) {
- for(j=0; j<dvert[i].totweight; j++) {
+ if (dvert) {
+ for (i = 0; i < me->totvert; i++) {
+ for (j = 0; j < dvert[i].totweight; j++) {
/* Find the old vertex group */
odg = BLI_findlink(&base->object->defbase, dvert[i].dw[j].def_nr);
- if(odg) {
+ if (odg) {
/* Search for a match in the new object, and set new index */
- for(dg=ob->defbase.first, index=0; dg; dg=dg->next, index++) {
- if(!strcmp(dg->name, odg->name)) {
+ for (dg = ob->defbase.first, index = 0; dg; dg = dg->next, index++) {
+ if (!strcmp(dg->name, odg->name)) {
dvert[i].dw[j].def_nr = index;
break;
}
@@ -332,12 +334,12 @@ int join_mesh_exec(bContext *C, wmOperator *op)
}
/* if this is the object we're merging into, no need to do anything */
- if(base->object != ob) {
+ if (base->object != ob) {
/* watch this: switch matmul order really goes wrong */
mult_m4_m4m4(cmat, imat, base->object->obmat);
/* transform vertex coordinates into new space */
- for(a=0, mv=mvert; a < me->totvert; a++, mv++) {
+ for (a = 0, mv = mvert; a < me->totvert; a++, mv++) {
mul_m4_v3(cmat, mv->co);
}
@@ -345,27 +347,27 @@ int join_mesh_exec(bContext *C, wmOperator *op)
* - if there's a matching one, copy it across (will need to transform vertices into new space...)
* - otherwise, just copy own coordinates of mesh (no need to transform vertex coordinates into new space)
*/
- if(key) {
+ if (key) {
/* if this mesh has any shapekeys, check first, otherwise just copy coordinates */
- for(kb= key->block.first; kb; kb= kb->next) {
+ for (kb = key->block.first; kb; kb = kb->next) {
/* get pointer to where to write data for this mesh in shapekey's data array */
- fp1= ((float *)kb->data) + (vertofs*3);
+ fp1 = ((float *)kb->data) + (vertofs * 3);
/* check if this mesh has such a shapekey */
- okb= key_get_named_keyblock(me->key, kb->name);
- if(okb) {
+ okb = key_get_named_keyblock(me->key, kb->name);
+ if (okb) {
/* 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);
+ fp2 = ((float *)(okb->data));
+ for (a = 0; a < me->totvert; a++, fp1 += 3, fp2 += 3) {
+ copy_v3_v3(fp1, fp2);
mul_m4_v3(cmat, fp1);
}
}
else {
/* 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);
+ mv = mvert;
+ for (a = 0; a < me->totvert; a++, fp1 += 3, mv++) {
+ copy_v3_v3(fp1, mv->co);
}
}
}
@@ -376,25 +378,25 @@ int join_mesh_exec(bContext *C, wmOperator *op)
* - if it was an 'original', copy the appropriate data from nkey
* - otherwise, copy across plain coordinates (no need to transform coordinates)
*/
- if(key) {
- for(kb= key->block.first; kb; kb= kb->next) {
+ if (key) {
+ for (kb = key->block.first; kb; kb = kb->next) {
/* get pointer to where to write data for this mesh in shapekey's data array */
- fp1= ((float *)kb->data) + (vertofs*3);
+ fp1 = ((float *)kb->data) + (vertofs * 3);
/* check if this was one of the original shapekeys */
- okb= key_get_named_keyblock(nkey, kb->name);
- if(okb) {
+ okb = key_get_named_keyblock(nkey, kb->name);
+ if (okb) {
/* 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);
+ fp2 = ((float *)(okb->data));
+ for (a = 0; a < me->totvert; a++, fp1 += 3, fp2 += 3) {
+ 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);
+ mv = mvert;
+ for (a = 0; a < me->totvert; a++, fp1 += 3, mv++) {
+ copy_v3_v3(fp1, mv->co);
}
}
}
@@ -402,40 +404,40 @@ int join_mesh_exec(bContext *C, wmOperator *op)
}
/* advance mvert pointer to end of base mesh's data */
- mvert+= me->totvert;
+ mvert += me->totvert;
}
- if(me->totedge) {
+ if (me->totedge) {
CustomData_merge(&me->edata, &edata, CD_MASK_MESH, CD_DEFAULT, totedge);
CustomData_copy_data(&me->edata, &edata, 0, edgeofs, me->totedge);
- for(a=0; a<me->totedge; a++, medge++) {
- medge->v1+= vertofs;
- medge->v2+= vertofs;
+ for (a = 0; a < me->totedge; a++, medge++) {
+ medge->v1 += vertofs;
+ medge->v2 += vertofs;
}
}
if (me->totloop) {
- if(base->object!=ob)
+ if (base->object != ob)
multiresModifier_prepare_join(scene, base->object, ob);
CustomData_merge(&me->ldata, &ldata, CD_MASK_MESH, CD_DEFAULT, totloop);
CustomData_copy_data(&me->ldata, &ldata, 0, loopofs, me->totloop);
- for(a=0; a<me->totloop; a++, mloop++) {
+ for (a = 0; a < me->totloop; a++, mloop++) {
mloop->v += vertofs;
mloop->e += edgeofs;
}
}
- if(me->totpoly) {
+ if (me->totpoly) {
/* make mapping for materials */
- for(a=1; a<=base->object->totcol; a++) {
- ma= give_current_material(base->object, a);
+ for (a = 1; a <= base->object->totcol; a++) {
+ ma = give_current_material(base->object, a);
- for(b=0; b<totcol; b++) {
- if(ma == matar[b]) {
- matmap[a-1]= b;
+ for (b = 0; b < totcol; b++) {
+ if (ma == matar[b]) {
+ matmap[a - 1] = b;
break;
}
}
@@ -444,9 +446,9 @@ int join_mesh_exec(bContext *C, wmOperator *op)
CustomData_merge(&me->pdata, &pdata, CD_MASK_MESH, CD_DEFAULT, totpoly);
CustomData_copy_data(&me->pdata, &pdata, 0, polyofs, me->totpoly);
- for(a=0; a<me->totpoly; a++, mpoly++) {
+ for (a = 0; a < me->totpoly; a++, mpoly++) {
mpoly->loopstart += loopofs;
- mpoly->mat_nr= matmap ? matmap[(int)mpoly->mat_nr] : 0;
+ mpoly->mat_nr = matmap ? matmap[(int)mpoly->mat_nr] : 0;
}
polyofs += me->totpoly;
@@ -460,56 +462,56 @@ int join_mesh_exec(bContext *C, wmOperator *op)
loopofs += me->totloop;
/* free base, now that data is merged */
- if(base->object != ob)
+ if (base->object != ob)
ED_base_object_free_and_unlink(bmain, scene, base);
}
}
CTX_DATA_END;
/* return to mesh we're merging to */
- me= ob->data;
+ me = ob->data;
CustomData_free(&me->vdata, me->totvert);
CustomData_free(&me->edata, me->totedge);
CustomData_free(&me->ldata, me->totloop);
CustomData_free(&me->pdata, me->totpoly);
- me->totvert= totvert;
- me->totedge= totedge;
- me->totloop= totloop;
- me->totpoly= totpoly;
-
- me->vdata= vdata;
- me->edata= edata;
- me->ldata= ldata;
- me->pdata= pdata;
+ me->totvert = totvert;
+ me->totedge = totedge;
+ me->totloop = totloop;
+ me->totpoly = totpoly;
+
+ me->vdata = vdata;
+ me->edata = edata;
+ me->ldata = ldata;
+ me->pdata = pdata;
mesh_update_customdata_pointers(me, TRUE); /* BMESH_TODO, check if this arg can be failse, non urgent - campbell */
/* old material array */
- for(a=1; a<=ob->totcol; a++) {
- ma= ob->mat[a-1];
- if(ma) ma->id.us--;
+ for (a = 1; a <= ob->totcol; a++) {
+ ma = ob->mat[a - 1];
+ if (ma) ma->id.us--;
}
- for(a=1; a<=me->totcol; a++) {
- ma= me->mat[a-1];
- if(ma) ma->id.us--;
+ for (a = 1; a <= me->totcol; a++) {
+ ma = me->mat[a - 1];
+ if (ma) ma->id.us--;
}
- if(ob->mat) MEM_freeN(ob->mat);
- if(ob->matbits) MEM_freeN(ob->matbits);
- if(me->mat) MEM_freeN(me->mat);
- ob->mat= me->mat= NULL;
- ob->matbits= NULL;
+ if (ob->mat) MEM_freeN(ob->mat);
+ if (ob->matbits) MEM_freeN(ob->matbits);
+ if (me->mat) MEM_freeN(me->mat);
+ ob->mat = me->mat = NULL;
+ ob->matbits = NULL;
- if(totcol) {
- me->mat= matar;
- ob->mat= MEM_callocN(sizeof(void *)*totcol, "join obmatar");
- ob->matbits= MEM_callocN(sizeof(char)*totcol, "join obmatbits");
+ if (totcol) {
+ me->mat = matar;
+ ob->mat = MEM_callocN(sizeof(void *) * totcol, "join obmatar");
+ ob->matbits = MEM_callocN(sizeof(char) * totcol, "join obmatbits");
}
else
MEM_freeN(matar);
- ob->totcol= me->totcol= totcol;
+ ob->totcol = me->totcol = totcol;
if (matmap) MEM_freeN(matmap);
@@ -517,11 +519,11 @@ int join_mesh_exec(bContext *C, wmOperator *op)
test_object_materials((ID *)me);
/* free temp copy of destination shapekeys (if applicable) */
- if(nkey) {
+ if (nkey) {
// XXX 2.5 Animato
#if 0
/* free it's ipo too - both are not actually freed from memory yet as ID-blocks */
- if(nkey->ipo) {
+ if (nkey->ipo) {
free_ipo(nkey->ipo);
BLI_remlink(&bmain->ipo, nkey->ipo);
MEM_freeN(nkey->ipo);
@@ -533,21 +535,21 @@ int join_mesh_exec(bContext *C, wmOperator *op)
MEM_freeN(nkey);
}
- DAG_scene_sort(bmain, scene); // removed objects, need to rebuild dag before editmode call
+ DAG_scene_sort(bmain, scene); // removed objects, need to rebuild dag before editmode call
#if 0
ED_object_enter_editmode(C, EM_WAITCURSOR);
- ED_object_exit_editmode(C, EM_FREEDATA|EM_WAITCURSOR|EM_DO_UNDO);
+ ED_object_exit_editmode(C, EM_FREEDATA | EM_WAITCURSOR | EM_DO_UNDO);
#else
/* toggle editmode using lower level functions so this can be called from python */
- EDBM_MakeEditBMesh(scene->toolsettings, scene, ob);
- EDBM_LoadEditBMesh(scene, ob);
- EDBM_FreeEditBMesh(me->edit_btmesh);
+ EDBM_mesh_make(scene->toolsettings, scene, ob);
+ EDBM_mesh_load(ob);
+ EDBM_mesh_free(me->edit_btmesh);
MEM_freeN(me->edit_btmesh);
- me->edit_btmesh= NULL;
- DAG_id_tag_update(&ob->id, OB_RECALC_OB|OB_RECALC_DATA);
+ me->edit_btmesh = NULL;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA);
#endif
- WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
return OPERATOR_FINISHED;
}
@@ -555,29 +557,29 @@ 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)
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_active_object(C);
- Mesh *me= (Mesh *)ob->data;
- Mesh *selme=NULL;
- DerivedMesh *dm=NULL;
- Key *key=me->key;
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = CTX_data_active_object(C);
+ Mesh *me = (Mesh *)ob->data;
+ Mesh *selme = NULL;
+ DerivedMesh *dm = NULL;
+ Key *key = me->key;
KeyBlock *kb;
- int ok=0, nonequal_verts=0;
+ int ok = 0, nonequal_verts = 0;
- CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
+ CTX_DATA_BEGIN(C, Base *, base, selected_editable_bases) {
if (base->object == ob) continue;
- if (base->object->type==OB_MESH) {
+ if (base->object->type == OB_MESH) {
selme = (Mesh *)base->object->data;
- if (selme->totvert==me->totvert)
+ if (selme->totvert == me->totvert)
ok++;
else
- nonequal_verts=1;
+ nonequal_verts = 1;
}
}
CTX_DATA_END;
@@ -590,28 +592,29 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- if(key == NULL) {
- key= me->key= add_key((ID *)me);
- key->type= KEY_RELATIVE;
+ if (key == NULL) {
+ key = me->key = add_key((ID *)me);
+ key->type = KEY_RELATIVE;
- /* first key added, so it was the basis. initialise it with the existing mesh */
- kb= add_keyblock(key, NULL);
+ /* first key added, so it was the basis. initialize it with the existing mesh */
+ kb = add_keyblock(key, NULL);
mesh_to_key(me, kb);
}
/* now ready to add new keys from selected meshes */
- CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
+ CTX_DATA_BEGIN(C, Base *, base, selected_editable_bases)
+ {
if (base->object == ob) continue;
- if(base->object->type==OB_MESH) {
+ if (base->object->type == OB_MESH) {
selme = (Mesh *)base->object->data;
- if (selme->totvert==me->totvert) {
+ if (selme->totvert == me->totvert) {
dm = mesh_get_derived_deform(scene, base->object, CD_MASK_BAREMESH);
if (!dm) continue;
- kb= add_keyblock(key, base->object->id.name+2);
+ kb = add_keyblock(key, base->object->id.name + 2);
DM_to_meshkey(dm, me, kb);
@@ -621,7 +624,7 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
- WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
return OPERATOR_FINISHED;
}
@@ -630,9 +633,9 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op)
/* important note; this is unfinished, needs better API for editmode, and custom threshold */
-#define MOC_RES 8
-#define MOC_NODE_RES 8
-#define MOC_THRESH 0.00002f
+#define MOC_RES 8
+#define MOC_NODE_RES 8
+#define MOC_THRESH 0.00002f
typedef struct MocNode {
struct MocNode *next;
@@ -643,30 +646,30 @@ static int mesh_octree_get_base_offs(float *co, float *offs, float *div)
{
int vx, vy, vz;
- vx= floor( (co[0]-offs[0])/div[0] );
- vy= floor( (co[1]-offs[1])/div[1] );
- vz= floor( (co[2]-offs[2])/div[2] );
-
- CLAMP(vx, 0, MOC_RES-1);
- CLAMP(vy, 0, MOC_RES-1);
- CLAMP(vz, 0, MOC_RES-1);
+ vx = floor( (co[0] - offs[0]) / div[0]);
+ vy = floor( (co[1] - offs[1]) / div[1]);
+ vz = floor( (co[2] - offs[2]) / div[2]);
- return (vx*MOC_RES*MOC_RES) + vy*MOC_RES + vz;
+ CLAMP(vx, 0, MOC_RES - 1);
+ CLAMP(vy, 0, MOC_RES - 1);
+ CLAMP(vz, 0, MOC_RES - 1);
+
+ return (vx * MOC_RES * MOC_RES) + vy * MOC_RES + vz;
}
static void mesh_octree_add_node(MocNode **bt, intptr_t index)
{
- if(*bt==NULL) {
- *bt= MEM_callocN(sizeof(MocNode), "MocNode");
- (*bt)->index[0]= index;
+ if (*bt == NULL) {
+ *bt = MEM_callocN(sizeof(MocNode), "MocNode");
+ (*bt)->index[0] = index;
}
else {
int a;
- for(a=0; a<MOC_NODE_RES; a++) {
- if((*bt)->index[a]==index)
+ for (a = 0; a < MOC_NODE_RES; a++) {
+ if ((*bt)->index[a] == index)
return;
- else if((*bt)->index[a]==0) {
- (*bt)->index[a]= index;
+ else if ((*bt)->index[a] == 0) {
+ (*bt)->index[a] = index;
return;
}
}
@@ -676,7 +679,7 @@ static void mesh_octree_add_node(MocNode **bt, intptr_t index)
static void mesh_octree_free_node(MocNode **bt)
{
- if( (*bt)->next ) {
+ if ( (*bt)->next) {
mesh_octree_free_node(&(*bt)->next);
}
MEM_freeN(*bt);
@@ -684,52 +687,52 @@ static void mesh_octree_free_node(MocNode **bt)
/* temporal define, just to make nicer code below */
-#define MOC_INDEX(vx, vy, vz) (((vx)*MOC_RES*MOC_RES) + (vy)*MOC_RES + (vz))
+#define MOC_INDEX(vx, vy, vz) (((vx) * MOC_RES * MOC_RES) + (vy) * MOC_RES + (vz))
static void mesh_octree_add_nodes(MocNode **basetable, float *co, float *offs, float *div, intptr_t index)
{
float fx, fy, fz;
int vx, vy, vz;
- if ( !finite(co[0]) ||
- !finite(co[1]) ||
- !finite(co[2]))
+ if (!finite(co[0]) ||
+ !finite(co[1]) ||
+ !finite(co[2]))
{
return;
}
- fx= (co[0]-offs[0])/div[0];
- fy= (co[1]-offs[1])/div[1];
- fz= (co[2]-offs[2])/div[2];
- CLAMP(fx, 0.0f, MOC_RES-MOC_THRESH);
- CLAMP(fy, 0.0f, MOC_RES-MOC_THRESH);
- CLAMP(fz, 0.0f, MOC_RES-MOC_THRESH);
-
- vx= (int)floorf(fx);
- vy= (int)floorf(fy);
- vz= (int)floorf(fz);
+ fx = (co[0] - offs[0]) / div[0];
+ fy = (co[1] - offs[1]) / div[1];
+ fz = (co[2] - offs[2]) / div[2];
+ CLAMP(fx, 0.0f, MOC_RES - MOC_THRESH);
+ CLAMP(fy, 0.0f, MOC_RES - MOC_THRESH);
+ CLAMP(fz, 0.0f, MOC_RES - MOC_THRESH);
+
+ vx = (int)floorf(fx);
+ vy = (int)floorf(fy);
+ vz = (int)floorf(fz);
mesh_octree_add_node(basetable + MOC_INDEX(vx, vy, vz), index);
if (vx > 0)
- if (fx-((float)vx)-MOC_THRESH < 0.0f)
+ if (fx - ((float)vx) - MOC_THRESH < 0.0f)
mesh_octree_add_node(basetable + MOC_INDEX(vx - 1, vy, vz), index);
if (vx < MOC_RES - 2)
- if (fx-((float)vx)+MOC_THRESH > 1.0f)
+ if (fx - ((float)vx) + MOC_THRESH > 1.0f)
mesh_octree_add_node(basetable + MOC_INDEX(vx + 1, vy, vz), index);
if (vy > 0)
- if (fy-((float)vy)-MOC_THRESH < 0.0f)
+ if (fy - ((float)vy) - MOC_THRESH < 0.0f)
mesh_octree_add_node(basetable + MOC_INDEX(vx, vy - 1, vz), index);
if (vy < MOC_RES - 2)
- if (fy-((float)vy)+MOC_THRESH > 1.0f)
+ if (fy - ((float)vy) + MOC_THRESH > 1.0f)
mesh_octree_add_node(basetable + MOC_INDEX(vx, vy + 1, vz), index);
if (vz > 0)
- if (fz-((float)vz)-MOC_THRESH < 0.0f)
+ if (fz - ((float)vz) - MOC_THRESH < 0.0f)
mesh_octree_add_node(basetable + MOC_INDEX(vx, vy, vz - 1), index);
- if (vz <MOC_RES - 2)
- if (fz-((float)vz)+MOC_THRESH > 1.0f)
+ if (vz < MOC_RES - 2)
+ if (fz - ((float)vz) + MOC_THRESH > 1.0f)
mesh_octree_add_node(basetable + MOC_INDEX(vx, vy, vz + 1), index);
}
@@ -739,26 +742,26 @@ static intptr_t mesh_octree_find_index(MocNode **bt, MVert *mvert, float *co)
float *vec;
int a;
- if(*bt==NULL)
+ if (*bt == NULL)
return -1;
- for(a=0; a<MOC_NODE_RES; a++) {
- if((*bt)->index[a]) {
+ for (a = 0; a < MOC_NODE_RES; a++) {
+ if ((*bt)->index[a]) {
/* does mesh verts and editmode, code looks potential dangerous, octree should really be filled OK! */
- if(mvert) {
- vec= (mvert+(*bt)->index[a]-1)->co;
- if(compare_v3v3(vec, co, MOC_THRESH))
- return (*bt)->index[a]-1;
+ if (mvert) {
+ vec = (mvert + (*bt)->index[a] - 1)->co;
+ if (compare_v3v3(vec, co, MOC_THRESH))
+ return (*bt)->index[a] - 1;
}
else {
- BMVert *eve= (BMVert *)((*bt)->index[a]);
- if(compare_v3v3(eve->co, co, MOC_THRESH))
+ BMVert *eve = (BMVert *)((*bt)->index[a]);
+ if (compare_v3v3(eve->co, co, MOC_THRESH))
return (*bt)->index[a];
}
}
else return -1;
}
- if( (*bt)->next)
+ if ( (*bt)->next)
return mesh_octree_find_index(&(*bt)->next, mvert, co);
return -1;
@@ -775,69 +778,72 @@ intptr_t mesh_octree_table(Object *ob, BMEditMesh *em, float *co, char mode)
{
MocNode **bt;
- if(mode=='u') { /* use table */
- if(MeshOctree.table==NULL)
+ if (mode == 'u') { /* use table */
+ if (MeshOctree.table == NULL)
mesh_octree_table(ob, em, NULL, 's');
- if(MeshOctree.table) {
- Mesh *me= ob->data;
- bt= MeshOctree.table + mesh_octree_get_base_offs(co, MeshOctree.offs, MeshOctree.div);
- if(em)
+ if (MeshOctree.table) {
+ Mesh *me = ob->data;
+ bt = MeshOctree.table + mesh_octree_get_base_offs(co, MeshOctree.offs, MeshOctree.div);
+ if (em)
return mesh_octree_find_index(bt, NULL, co);
else
return mesh_octree_find_index(bt, me->mvert, co);
}
return -1;
}
- else if(mode=='s') { /* start table */
- Mesh *me= ob->data;
+ else if (mode == 's') { /* start table */
+ Mesh *me = ob->data;
float min[3], max[3];
/* we compute own bounding box and don't reuse ob->bb because
* we are using the undeformed coordinates*/
INIT_MINMAX(min, max);
- if(em && me->edit_btmesh==em) {
+ if (em && me->edit_btmesh == em) {
BMIter iter;
BMVert *eve;
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL)
- DO_MINMAX(eve->co, min, max)
+ {
+ DO_MINMAX(eve->co, min, max);
+ }
}
else {
MVert *mvert;
int a;
- for(a=0, mvert= me->mvert; a<me->totvert; a++, mvert++)
+ for (a = 0, mvert = me->mvert; a < me->totvert; a++, mvert++)
DO_MINMAX(mvert->co, min, max);
}
/* for quick unit coordinate calculus */
- VECCOPY(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;
+ 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;
sub_v3_v3v3(MeshOctree.div, max, min);
- MeshOctree.div[0]+= 2*MOC_THRESH; /* and divide with 2 threshold unit more extra (try 8x8 unit grid on paint) */
- MeshOctree.div[1]+= 2*MOC_THRESH;
- MeshOctree.div[2]+= 2*MOC_THRESH;
-
- mul_v3_fl(MeshOctree.div, 1.0f/MOC_RES);
- if(MeshOctree.div[0]==0.0f) MeshOctree.div[0]= 1.0f;
- if(MeshOctree.div[1]==0.0f) MeshOctree.div[1]= 1.0f;
- if(MeshOctree.div[2]==0.0f) MeshOctree.div[2]= 1.0f;
+ MeshOctree.div[0] += 2 * MOC_THRESH; /* and divide with 2 threshold unit more extra (try 8x8 unit grid on paint) */
+ MeshOctree.div[1] += 2 * MOC_THRESH;
+ MeshOctree.div[2] += 2 * MOC_THRESH;
+
+ mul_v3_fl(MeshOctree.div, 1.0f / MOC_RES);
+ if (MeshOctree.div[0] == 0.0f) MeshOctree.div[0] = 1.0f;
+ if (MeshOctree.div[1] == 0.0f) MeshOctree.div[1] = 1.0f;
+ if (MeshOctree.div[2] == 0.0f) MeshOctree.div[2] = 1.0f;
- if(MeshOctree.table) /* happens when entering this call without ending it */
+ if (MeshOctree.table) /* happens when entering this call without ending it */
mesh_octree_table(ob, em, co, 'e');
- MeshOctree.table= MEM_callocN(MOC_RES*MOC_RES*MOC_RES*sizeof(void *), "sym table");
+ MeshOctree.table = MEM_callocN(MOC_RES * MOC_RES * MOC_RES * sizeof(void *), "sym table");
- if(em && me->edit_btmesh==em) {
+ if (em && me->edit_btmesh == em) {
BMVert *eve;
BMIter iter;
- BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
+ BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL)
+ {
mesh_octree_add_nodes(MeshOctree.table, eve->co, MeshOctree.offs, MeshOctree.div, (intptr_t)(eve));
}
}
@@ -845,40 +851,40 @@ intptr_t mesh_octree_table(Object *ob, BMEditMesh *em, float *co, char mode)
MVert *mvert;
int a;
- for(a=0, mvert= me->mvert; a<me->totvert; a++, mvert++)
- mesh_octree_add_nodes(MeshOctree.table, mvert->co, MeshOctree.offs, MeshOctree.div, a+1);
+ for (a = 0, mvert = me->mvert; a < me->totvert; a++, mvert++)
+ mesh_octree_add_nodes(MeshOctree.table, mvert->co, MeshOctree.offs, MeshOctree.div, a + 1);
}
}
- else if(mode=='e') { /* end table */
- if(MeshOctree.table) {
+ else if (mode == 'e') { /* end table */
+ if (MeshOctree.table) {
int a;
- for(a=0, bt=MeshOctree.table; a<MOC_RES*MOC_RES*MOC_RES; a++, bt++) {
- if(*bt) mesh_octree_free_node(bt);
+ for (a = 0, bt = MeshOctree.table; a < MOC_RES * MOC_RES * MOC_RES; a++, bt++) {
+ if (*bt) mesh_octree_free_node(bt);
}
MEM_freeN(MeshOctree.table);
- MeshOctree.table= NULL;
+ MeshOctree.table = NULL;
}
}
return 0;
}
-MirrTopoStore_t mesh_topo_store= {NULL, -1. -1, -1};
+MirrTopoStore_t mesh_topo_store = {NULL, -1. - 1, -1};
/* mode is 's' start, or 'e' end, or 'u' use */
/* if end, ob can be NULL */
/* note, is supposed return -1 on error, which callers are currently checking for, but is not used so far */
int mesh_mirrtopo_table(Object *ob, char mode)
{
- if(mode=='u') { /* use table */
+ if (mode == 'u') { /* use table */
if (ED_mesh_mirrtopo_recalc_check(ob->data, ob->mode, &mesh_topo_store)) {
mesh_mirrtopo_table(ob, 's');
}
}
- else if(mode=='s') { /* start table */
+ else if (mode == 's') { /* start table */
ED_mesh_mirrtopo_init(ob->data, ob->mode, &mesh_topo_store, FALSE);
}
- else if(mode=='e') { /* end table */
+ else if (mode == 'e') { /* end table */
ED_mesh_mirrtopo_free(&mesh_topo_store);
}
return 0;
@@ -886,21 +892,21 @@ int mesh_mirrtopo_table(Object *ob, char mode)
static int mesh_get_x_mirror_vert_spacial(Object *ob, int index)
{
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
MVert *mvert;
float vec[3];
- mvert= me->mvert+index;
- vec[0]= -mvert->co[0];
- vec[1]= mvert->co[1];
- vec[2]= mvert->co[2];
+ mvert = me->mvert + index;
+ vec[0] = -mvert->co[0];
+ vec[1] = mvert->co[1];
+ vec[2] = mvert->co[2];
return mesh_octree_table(ob, NULL, vec, 'u');
}
static int mesh_get_x_mirror_vert_topo(Object *ob, int index)
{
- if (mesh_mirrtopo_table(ob, 'u')==-1)
+ if (mesh_mirrtopo_table(ob, 'u') == -1)
return -1;
return mesh_topo_store.index_lookup[index];
@@ -910,7 +916,8 @@ int mesh_get_x_mirror_vert(Object *ob, int index)
{
if (((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_TOPO) {
return mesh_get_x_mirror_vert_topo(ob, index);
- } else {
+ }
+ else {
return mesh_get_x_mirror_vert_spacial(ob, index);
}
return 0;
@@ -923,17 +930,17 @@ static BMVert *editbmesh_get_x_mirror_vert_spacial(Object *ob, BMEditMesh *em, f
/* ignore nan verts */
if (!finite(co[0]) ||
- !finite(co[1]) ||
- !finite(co[2])
- )
+ !finite(co[1]) ||
+ !finite(co[2])
+ )
return NULL;
- vec[0]= -co[0];
- vec[1]= co[1];
- vec[2]= co[2];
+ vec[0] = -co[0];
+ vec[1] = co[1];
+ vec[2] = co[2];
- poinval= mesh_octree_table(ob, em, vec, 'u');
- if(poinval != -1)
+ poinval = mesh_octree_table(ob, em, vec, 'u');
+ if (poinval != -1)
return (BMVert *)(poinval);
return NULL;
}
@@ -941,7 +948,7 @@ static BMVert *editbmesh_get_x_mirror_vert_spacial(Object *ob, BMEditMesh *em, f
static BMVert *editbmesh_get_x_mirror_vert_topo(Object *ob, struct BMEditMesh *em, BMVert *eve, int index)
{
intptr_t poinval;
- if (mesh_mirrtopo_table(ob, 'u')==-1)
+ if (mesh_mirrtopo_table(ob, 'u') == -1)
return NULL;
if (index == -1) {
@@ -949,7 +956,8 @@ static BMVert *editbmesh_get_x_mirror_vert_topo(Object *ob, struct BMEditMesh *e
BMVert *v;
index = 0;
- BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
+ BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL)
+ {
if (v == eve)
break;
index++;
@@ -960,9 +968,9 @@ static BMVert *editbmesh_get_x_mirror_vert_topo(Object *ob, struct BMEditMesh *e
}
}
- poinval= mesh_topo_store.index_lookup[index];
+ poinval = mesh_topo_store.index_lookup[index];
- if(poinval != -1)
+ if (poinval != -1)
return (BMVert *)(poinval);
return NULL;
}
@@ -987,21 +995,22 @@ static float *editmesh_get_mirror_uv(BMEditMesh *em, int axis, float *uv, float
/* ignore nan verts */
if (isnan(uv[0]) || !finite(uv[0]) ||
- isnan(uv[1]) || !finite(uv[1])
- )
+ isnan(uv[1]) || !finite(uv[1])
+ )
return NULL;
if (axis) {
- vec[0]= uv[0];
- vec[1]= -((uv[1])-mirrCent[1]) + mirrCent[1];
+ vec[0] = uv[0];
+ vec[1] = -((uv[1]) - mirrCent[1]) + mirrCent[1];
cent_vec[0] = face_cent[0];
- cent_vec[1]= -((face_cent[1])-mirrCent[1]) + mirrCent[1];
- } else {
- vec[0]= -((uv[0])-mirrCent[0]) + mirrCent[0];
- vec[1]= uv[1];
+ cent_vec[1] = -((face_cent[1]) - mirrCent[1]) + mirrCent[1];
+ }
+ else {
+ vec[0] = -((uv[0]) - mirrCent[0]) + mirrCent[0];
+ vec[1] = uv[1];
- cent_vec[0]= -((face_cent[0])-mirrCent[0]) + mirrCent[0];
+ cent_vec[0] = -((face_cent[0]) - mirrCent[0]) + mirrCent[0];
cent_vec[1] = face_cent[1];
}
@@ -1010,23 +1019,25 @@ static float *editmesh_get_mirror_uv(BMEditMesh *em, int axis, float *uv, float
BMIter iter;
BMFace *efa;
- BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
+ BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL)
+ {
poly_uv_center(em, efa, cent);
if ( (fabs(cent[0] - cent_vec[0]) < 0.001) && (fabs(cent[1] - cent_vec[1]) < 0.001) ) {
BMIter liter;
BMLoop *l;
- BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
+ BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa)
+ {
MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
if ( (fabs(luv->uv[0] - vec[0]) < 0.001) && (fabs(luv->uv[1] - vec[1]) < 0.001) ) {
return luv->uv;
+ }
}
}
}
}
- }
return NULL;
}
@@ -1035,39 +1046,39 @@ static float *editmesh_get_mirror_uv(BMEditMesh *em, int axis, float *uv, float
static unsigned int mirror_facehash(const void *ptr)
{
- const MFace *mf= ptr;
+ const MFace *mf = ptr;
int v0, v1;
- if(mf->v4) {
- v0= MIN4(mf->v1, mf->v2, mf->v3, mf->v4);
- v1= MAX4(mf->v1, mf->v2, mf->v3, mf->v4);
+ if (mf->v4) {
+ v0 = MIN4(mf->v1, mf->v2, mf->v3, mf->v4);
+ v1 = MAX4(mf->v1, mf->v2, mf->v3, mf->v4);
}
else {
- v0= MIN3(mf->v1, mf->v2, mf->v3);
- v1= MAX3(mf->v1, mf->v2, mf->v3);
+ v0 = MIN3(mf->v1, mf->v2, mf->v3);
+ v1 = MAX3(mf->v1, mf->v2, mf->v3);
}
- return ((v0*39)^(v1*31));
+ return ((v0 * 39) ^ (v1 * 31));
}
static int mirror_facerotation(MFace *a, MFace *b)
{
- if(b->v4) {
- if(a->v1==b->v1 && a->v2==b->v2 && a->v3==b->v3 && a->v4==b->v4)
+ if (b->v4) {
+ if (a->v1 == b->v1 && a->v2 == b->v2 && a->v3 == b->v3 && a->v4 == b->v4)
return 0;
- else if(a->v4==b->v1 && a->v1==b->v2 && a->v2==b->v3 && a->v3==b->v4)
+ else if (a->v4 == b->v1 && a->v1 == b->v2 && a->v2 == b->v3 && a->v3 == b->v4)
return 1;
- else if(a->v3==b->v1 && a->v4==b->v2 && a->v1==b->v3 && a->v2==b->v4)
+ else if (a->v3 == b->v1 && a->v4 == b->v2 && a->v1 == b->v3 && a->v2 == b->v4)
return 2;
- else if(a->v2==b->v1 && a->v3==b->v2 && a->v4==b->v3 && a->v1==b->v4)
+ else if (a->v2 == b->v1 && a->v3 == b->v2 && a->v4 == b->v3 && a->v1 == b->v4)
return 3;
}
else {
- if(a->v1==b->v1 && a->v2==b->v2 && a->v3==b->v3)
+ if (a->v1 == b->v1 && a->v2 == b->v2 && a->v3 == b->v3)
return 0;
- else if(a->v3==b->v1 && a->v1==b->v2 && a->v2==b->v3)
+ else if (a->v3 == b->v1 && a->v1 == b->v2 && a->v2 == b->v3)
return 1;
- else if(a->v2==b->v1 && a->v3==b->v2 && a->v1==b->v3)
+ else if (a->v2 == b->v1 && a->v3 == b->v2 && a->v1 == b->v3)
return 2;
}
@@ -1076,52 +1087,52 @@ static int mirror_facerotation(MFace *a, MFace *b)
static int mirror_facecmp(const void *a, const void *b)
{
- return (mirror_facerotation((MFace*)a, (MFace*)b) == -1);
+ return (mirror_facerotation((MFace *)a, (MFace *)b) == -1);
}
/* BMESH_TODO, convert to MPoly (functions above also) */
int *mesh_get_x_mirror_faces(Object *ob, BMEditMesh *em)
{
- Mesh *me= ob->data;
- MVert *mv, *mvert= me->mvert;
- MFace mirrormf, *mf, *hashmf, *mface= me->mface;
+ Mesh *me = ob->data;
+ MVert *mv, *mvert = me->mvert;
+ MFace mirrormf, *mf, *hashmf, *mface = me->mface;
GHash *fhash;
int *mirrorverts, *mirrorfaces;
int a;
- mirrorverts= MEM_callocN(sizeof(int)*me->totvert, "MirrorVerts");
- mirrorfaces= MEM_callocN(sizeof(int)*2*me->totface, "MirrorFaces");
+ mirrorverts = MEM_callocN(sizeof(int) * me->totvert, "MirrorVerts");
+ mirrorfaces = MEM_callocN(sizeof(int) * 2 * me->totface, "MirrorFaces");
mesh_octree_table(ob, em, NULL, 's');
- for(a=0, mv=mvert; a<me->totvert; a++, mv++)
- mirrorverts[a]= mesh_get_x_mirror_vert(ob, a);
+ for (a = 0, mv = mvert; a < me->totvert; a++, mv++)
+ mirrorverts[a] = mesh_get_x_mirror_vert(ob, a);
mesh_octree_table(ob, em, NULL, 'e');
- fhash= BLI_ghash_new(mirror_facehash, mirror_facecmp, "mirror_facehash gh");
- for(a=0, mf=mface; a<me->totface; a++, mf++)
+ fhash = BLI_ghash_new(mirror_facehash, mirror_facecmp, "mirror_facehash gh");
+ for (a = 0, mf = mface; a < me->totface; a++, mf++)
BLI_ghash_insert(fhash, mf, mf);
- for(a=0, mf=mface; a<me->totface; a++, mf++) {
- mirrormf.v1= mirrorverts[mf->v3];
- mirrormf.v2= mirrorverts[mf->v2];
- mirrormf.v3= mirrorverts[mf->v1];
- mirrormf.v4= (mf->v4)? mirrorverts[mf->v4]: 0;
+ for (a = 0, mf = mface; a < me->totface; a++, mf++) {
+ mirrormf.v1 = mirrorverts[mf->v3];
+ mirrormf.v2 = mirrorverts[mf->v2];
+ mirrormf.v3 = mirrorverts[mf->v1];
+ mirrormf.v4 = (mf->v4) ? mirrorverts[mf->v4] : 0;
/* make sure v4 is not 0 if a quad */
- if(mf->v4 && mirrormf.v4==0) {
+ if (mf->v4 && mirrormf.v4 == 0) {
SWAP(unsigned int, mirrormf.v1, mirrormf.v3);
SWAP(unsigned int, mirrormf.v2, mirrormf.v4);
}
- hashmf= BLI_ghash_lookup(fhash, &mirrormf);
- if(hashmf) {
- mirrorfaces[a*2]= hashmf - mface;
- mirrorfaces[a*2+1]= mirror_facerotation(&mirrormf, hashmf);
+ hashmf = BLI_ghash_lookup(fhash, &mirrormf);
+ if (hashmf) {
+ mirrorfaces[a * 2] = hashmf - mface;
+ mirrorfaces[a * 2 + 1] = mirror_facerotation(&mirrormf, hashmf);
}
else
- mirrorfaces[a*2]= -1;
+ mirrorfaces[a * 2] = -1;
}
BLI_ghash_free(fhash, NULL, NULL);
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c
index e9c1bd4047e..713009d2a19 100644
--- a/source/blender/editors/metaball/mball_edit.c
+++ b/source/blender/editors/metaball/mball_edit.c
@@ -82,8 +82,8 @@ void make_editMball(Object *obedit)
ml= mb->elems.first;
- while(ml) {
- if(ml->flag & SELECT) mb->lastelem = ml;
+ while (ml) {
+ if (ml->flag & SELECT) mb->lastelem = ml;
ml= ml->next;
}
@@ -106,7 +106,7 @@ MetaElem *add_metaball_primitive(bContext *C, float mat[4][4], int type, int UNU
/* Deselect all existing metaelems */
ml= mball->editelems->first;
- while(ml) {
+ while (ml) {
ml->flag &= ~SELECT;
ml= ml->next;
}
@@ -131,11 +131,11 @@ static int mball_select_all_exec(bContext *C, wmOperator *op)
int action = RNA_enum_get(op->ptr, "action");
ml= mb->editelems->first;
- if(ml) {
+ if (ml) {
if (action == SEL_TOGGLE) {
action = SEL_SELECT;
- while(ml) {
- if(ml->flag & SELECT) {
+ while (ml) {
+ if (ml->flag & SELECT) {
action = SEL_DESELECT;
break;
}
@@ -144,7 +144,7 @@ static int mball_select_all_exec(bContext *C, wmOperator *op)
}
ml= mb->editelems->first;
- while(ml) {
+ while (ml) {
switch (action) {
case SEL_SELECT:
ml->flag |= SELECT;
@@ -167,16 +167,16 @@ static int mball_select_all_exec(bContext *C, wmOperator *op)
void MBALL_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select or Deselect All";
- ot->description= "Change selection of all meta elements";
- ot->idname= "MBALL_OT_select_all";
+ ot->name = "(De)select All";
+ ot->description = "Change selection of all meta elements";
+ ot->idname = "MBALL_OT_select_all";
/* callback functions */
- ot->exec= mball_select_all_exec;
- ot->poll= ED_operator_editmball;
+ ot->exec = mball_select_all_exec;
+ ot->poll = ED_operator_editmball;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
WM_operator_properties_select_all(ot);
}
@@ -191,15 +191,15 @@ static int select_random_metaelems_exec(bContext *C, wmOperator *op)
MetaElem *ml;
float percent= RNA_float_get(op->ptr, "percent");
- if(percent == 0.0f)
+ if (percent == 0.0f)
return OPERATOR_CANCELLED;
ml= mb->editelems->first;
BLI_srand( BLI_rand() ); /* Random seed */
/* Stupid version of random selection. Should be improved. */
- while(ml) {
- if(BLI_frand() < percent)
+ while (ml) {
+ if (BLI_frand() < percent)
ml->flag |= SELECT;
else
ml->flag &= ~SELECT;
@@ -215,17 +215,17 @@ static int select_random_metaelems_exec(bContext *C, wmOperator *op)
void MBALL_OT_select_random_metaelems(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Random...";
- ot->description= "Randomly select metaelements";
- ot->idname= "MBALL_OT_select_random_metaelems";
+ ot->name = "Random...";
+ ot->description = "Randomly select metaelements";
+ ot->idname = "MBALL_OT_select_random_metaelems";
/* callback functions */
- ot->exec= select_random_metaelems_exec;
- ot->invoke= WM_operator_props_popup;
- ot->poll= ED_operator_editmball;
+ ot->exec = select_random_metaelems_exec;
+ ot->invoke = WM_operator_props_popup;
+ ot->poll = ED_operator_editmball;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_float_percentage(ot->srna, "percent", 0.5f, 0.0f, 1.0f, "Percent", "Percentage of metaelems to select randomly", 0.0001f, 1.0f);
@@ -241,9 +241,9 @@ static int duplicate_metaelems_exec(bContext *C, wmOperator *UNUSED(op))
MetaElem *ml, *newml;
ml= mb->editelems->last;
- if(ml) {
- while(ml) {
- if(ml->flag & SELECT) {
+ if (ml) {
+ while (ml) {
+ if (ml->flag & SELECT) {
newml= MEM_dupallocN(ml);
BLI_addtail(mb->editelems, newml);
mb->lastelem= newml;
@@ -274,17 +274,17 @@ static int duplicate_metaelems_invoke(bContext *C, wmOperator *op, wmEvent *UNUS
void MBALL_OT_duplicate_metaelems(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Duplicate Metaelements";
- ot->description= "Delete selected metaelement(s)";
- ot->idname= "MBALL_OT_duplicate_metaelems";
+ ot->name = "Duplicate Metaelements";
+ ot->description = "Delete selected metaelement(s)";
+ ot->idname = "MBALL_OT_duplicate_metaelems";
/* callback functions */
- ot->exec= duplicate_metaelems_exec;
- ot->invoke= duplicate_metaelems_invoke;
- ot->poll= ED_operator_editmball;
+ ot->exec = duplicate_metaelems_exec;
+ ot->invoke = duplicate_metaelems_invoke;
+ ot->poll = ED_operator_editmball;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* to give to transform */
RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", "");
@@ -300,11 +300,11 @@ static int delete_metaelems_exec(bContext *C, wmOperator *UNUSED(op))
MetaElem *ml, *next;
ml= mb->editelems->first;
- if(ml) {
- while(ml) {
+ if (ml) {
+ while (ml) {
next= ml->next;
- if(ml->flag & SELECT) {
- if(mb->lastelem==ml) mb->lastelem= NULL;
+ if (ml->flag & SELECT) {
+ if (mb->lastelem==ml) mb->lastelem= NULL;
BLI_remlink(mb->editelems, ml);
MEM_freeN(ml);
}
@@ -320,16 +320,16 @@ static int delete_metaelems_exec(bContext *C, wmOperator *UNUSED(op))
void MBALL_OT_delete_metaelems(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete";
- ot->description= "Delete selected metaelement(s)";
- ot->idname= "MBALL_OT_delete_metaelems";
+ ot->name = "Delete";
+ ot->description = "Delete selected metaelement(s)";
+ ot->idname = "MBALL_OT_delete_metaelems";
/* callback functions */
- ot->exec= delete_metaelems_exec;
- ot->poll= ED_operator_editmball;
+ ot->exec = delete_metaelems_exec;
+ ot->poll = ED_operator_editmball;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/***************************** Hide operator *****************************/
@@ -344,9 +344,9 @@ static int hide_metaelems_exec(bContext *C, wmOperator *op)
ml= mb->editelems->first;
- if(ml) {
- while(ml) {
- if((ml->flag & SELECT) != invert)
+ if (ml) {
+ while (ml) {
+ if ((ml->flag & SELECT) != invert)
ml->flag |= MB_HIDE;
ml= ml->next;
}
@@ -360,16 +360,16 @@ static int hide_metaelems_exec(bContext *C, wmOperator *op)
void MBALL_OT_hide_metaelems(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Hide";
- ot->description= "Hide (un)selected metaelement(s)";
- ot->idname= "MBALL_OT_hide_metaelems";
+ ot->name = "Hide";
+ ot->description = "Hide (un)selected metaelement(s)";
+ ot->idname = "MBALL_OT_hide_metaelems";
/* callback functions */
- ot->exec= hide_metaelems_exec;
- ot->poll= ED_operator_editmball;
+ ot->exec = hide_metaelems_exec;
+ ot->poll = ED_operator_editmball;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected");
@@ -386,8 +386,8 @@ static int reveal_metaelems_exec(bContext *C, wmOperator *UNUSED(op))
ml= mb->editelems->first;
- if(ml) {
- while(ml) {
+ if (ml) {
+ while (ml) {
ml->flag &= ~MB_HIDE;
ml= ml->next;
}
@@ -401,16 +401,16 @@ static int reveal_metaelems_exec(bContext *C, wmOperator *UNUSED(op))
void MBALL_OT_reveal_metaelems(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reveal";
- ot->description= "Reveal all hidden metaelements";
- ot->idname= "MBALL_OT_reveal_metaelems";
+ ot->name = "Reveal";
+ ot->description = "Reveal all hidden metaelements";
+ ot->idname = "MBALL_OT_reveal_metaelems";
/* callback functions */
- ot->exec= reveal_metaelems_exec;
- ot->poll= ED_operator_editmball;
+ ot->exec = reveal_metaelems_exec;
+ ot->poll = ED_operator_editmball;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* Select MetaElement with mouse click (user can select radius circle or
@@ -428,49 +428,49 @@ int mouse_mball(bContext *C, const int mval[2], int extend)
view3d_set_viewcontext(C, &vc);
- rect.xmin= mval[0]-12;
- rect.xmax= mval[0]+12;
- rect.ymin= mval[1]-12;
- rect.ymax= mval[1]+12;
+ rect.xmin = mval[0]-12;
+ rect.xmax = mval[0]+12;
+ rect.ymin = mval[1]-12;
+ rect.ymax = mval[1]+12;
hits= view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect);
/* does startelem exist? */
ml= mb->editelems->first;
- while(ml) {
- if(ml==startelem) break;
+ while (ml) {
+ if (ml==startelem) break;
ml= ml->next;
}
- if(ml==NULL) startelem= mb->editelems->first;
+ if (ml==NULL) startelem= mb->editelems->first;
- if(hits>0) {
+ if (hits>0) {
ml= startelem;
- while(ml) {
- for(a=0; a<hits; a++) {
+ while (ml) {
+ for (a=0; a<hits; a++) {
/* index converted for gl stuff */
- if(ml->selcol1==buffer[ 4 * a + 3 ]) {
+ if (ml->selcol1==buffer[ 4 * a + 3 ]) {
ml->flag |= MB_SCALE_RAD;
act= ml;
}
- if(ml->selcol2==buffer[ 4 * a + 3 ]) {
+ if (ml->selcol2==buffer[ 4 * a + 3 ]) {
ml->flag &= ~MB_SCALE_RAD;
act= ml;
}
}
- if(act) break;
+ if (act) break;
ml= ml->next;
- if(ml==NULL) ml= mb->editelems->first;
- if(ml==startelem) break;
+ if (ml==NULL) ml= mb->editelems->first;
+ if (ml==startelem) break;
}
/* When some metaelem was found, then it is necessary to select or
- * deselet it. */
- if(act) {
- if(extend==0) {
+ * deselect it. */
+ if (act) {
+ if (extend==0) {
/* Deselect all existing metaelems */
ml= mb->editelems->first;
- while(ml) {
+ while (ml) {
ml->flag &= ~SELECT;
ml= ml->next;
}
@@ -478,7 +478,7 @@ int mouse_mball(bContext *C, const int mval[2], int extend)
act->flag |= SELECT;
}
else {
- if(act->flag & SELECT)
+ if (act->flag & SELECT)
act->flag &= ~SELECT;
else
act->flag |= SELECT;
@@ -502,10 +502,10 @@ static void freeMetaElemlist(ListBase *lb)
{
MetaElem *ml, *next;
- if(lb==NULL) return;
+ if (lb==NULL) return;
ml= lb->first;
- while(ml) {
+ while (ml) {
next= ml->next;
BLI_remlink(lb, ml);
MEM_freeN(ml);
@@ -526,7 +526,7 @@ static void undoMball_to_editMball(void *lbu, void *lbe, void *UNUSED(obe))
/* copy 'undo' MetaElems to 'edit' MetaElems */
ml= lb->first;
- while(ml) {
+ while (ml) {
newml= MEM_dupallocN(ml);
BLI_addtail(editelems, newml);
ml= ml->next;
@@ -546,7 +546,7 @@ static void *editMball_to_undoMball(void *lbe, void *UNUSED(obe))
/* copy contents of current ListBase to the undo ListBase */
ml= editelems->first;
- while(ml) {
+ while (ml) {
newml= MEM_dupallocN(ml);
BLI_addtail(lb, newml);
ml= ml->next;
@@ -566,7 +566,7 @@ static void free_undoMball(void *lbv)
static ListBase *metaball_get_editelems(Object *ob)
{
- if(ob && ob->type==OB_MBALL) {
+ if (ob && ob->type==OB_MBALL) {
struct MetaBall *mb= (struct MetaBall*)ob->data;
return mb->editelems;
}
diff --git a/source/blender/editors/metaball/mball_ops.c b/source/blender/editors/metaball/mball_ops.c
index f689fb049fe..5d019cc49d9 100644
--- a/source/blender/editors/metaball/mball_ops.c
+++ b/source/blender/editors/metaball/mball_ops.c
@@ -59,8 +59,8 @@ void ED_keymap_metaball(wmKeyConfig *keyconf)
wmKeyMap *keymap;
wmKeyMapItem *kmi;
- keymap= WM_keymap_find(keyconf, "Metaball", 0, 0);
- keymap->poll= ED_operator_editmball;
+ keymap = WM_keymap_find(keyconf, "Metaball", 0, 0);
+ keymap->poll = ED_operator_editmball;
WM_keymap_add_item(keymap, "OBJECT_OT_metaball_add", AKEY, KM_PRESS, KM_SHIFT, 0);
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 27ed9f5b46e..3717591e412 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -123,7 +123,7 @@ void ED_object_location_from_view(bContext *C, float *loc)
void ED_object_rotation_from_view(bContext *C, float *rot)
{
RegionView3D *rv3d= CTX_wm_region_view3d(C);
- if(rv3d) {
+ if (rv3d) {
float quat[4];
copy_qt_qt(quat, rv3d->viewquat);
quat[0]= -quat[0];
@@ -174,7 +174,7 @@ float ED_object_new_primitive_matrix(bContext *C, Object *obedit, float *loc, fl
invert_m3_m3(imat, mat);
mul_m3_v3(imat, primmat[3]);
- if(v3d) return v3d->grid;
+ if (v3d) return v3d->grid;
return 1.0f;
}
@@ -193,7 +193,7 @@ void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode)
prop = RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view");
RNA_def_property_update_runtime(prop, view_align_update);
- if(do_editmode) {
+ if (do_editmode) {
prop = RNA_def_boolean(ot->srna, "enter_editmode", 0, "Enter Editmode",
"Enter editmode when adding this object");
RNA_def_property_flag(prop, PROP_HIDDEN|PROP_SKIP_SAVE);
@@ -212,23 +212,23 @@ void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode)
static void object_add_generic_invoke_options(bContext *C, wmOperator *op)
{
- if(RNA_struct_find_property(op->ptr, "enter_editmode")) /* optional */
+ if (RNA_struct_find_property(op->ptr, "enter_editmode")) /* optional */
if (!RNA_struct_property_is_set(op->ptr, "enter_editmode"))
RNA_boolean_set(op->ptr, "enter_editmode", U.flag & USER_ADD_EDITMODE);
- if(!RNA_struct_property_is_set(op->ptr, "location")) {
+ if (!RNA_struct_property_is_set(op->ptr, "location")) {
float loc[3];
ED_object_location_from_view(C, loc);
RNA_float_set_array(op->ptr, "location", loc);
}
- if(!RNA_struct_property_is_set(op->ptr, "layers")) {
+ if (!RNA_struct_property_is_set(op->ptr, "layers")) {
View3D *v3d = CTX_wm_view3d(C);
Scene *scene = CTX_data_scene(C);
int a, values[20], layer;
- if(v3d) {
+ if (v3d) {
layer = (v3d->scenelock && !v3d->localvd)? scene->layact: v3d->layact;
}
else {
@@ -257,15 +257,15 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc,
int view_align;
*enter_editmode = FALSE;
- if(RNA_struct_find_property(op->ptr, "enter_editmode") && RNA_boolean_get(op->ptr, "enter_editmode")) {
+ if (RNA_struct_find_property(op->ptr, "enter_editmode") && RNA_boolean_get(op->ptr, "enter_editmode")) {
*enter_editmode = TRUE;
}
- if(RNA_struct_property_is_set(op->ptr, "layers")) {
+ if (RNA_struct_property_is_set(op->ptr, "layers")) {
RNA_boolean_get_array(op->ptr, "layers", layer_values);
*layer= 0;
- for(a=0; a<20; a++) {
- if(layer_values[a])
+ for (a=0; a<20; a++) {
+ if (layer_values[a])
*layer |= (1 << a);
else
*layer &= ~(1 << a);
@@ -278,11 +278,11 @@ 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 */
- if(v3d && v3d->localvd)
+ * not part of operator properties */
+ if (v3d && v3d->localvd)
*layer |= v3d->lay;
- if(RNA_struct_property_is_set(op->ptr, "rotation"))
+ if (RNA_struct_property_is_set(op->ptr, "rotation"))
view_align = FALSE;
else if (RNA_struct_property_is_set(op->ptr, "view_align"))
view_align = RNA_boolean_get(op->ptr, "view_align");
@@ -303,7 +303,7 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc,
RNA_float_get_array(op->ptr, "location", loc);
- if(*layer == 0) {
+ if (*layer == 0) {
BKE_report(op->reports, RPT_ERROR, "Property 'layer' has no values set");
return 0;
}
@@ -339,7 +339,7 @@ Object *ED_object_add_type(bContext *C, int type, float *loc, float *rot,
ED_render_id_flush_update(bmain, ob->data);
}
- if(enter_editmode)
+ if (enter_editmode)
ED_object_enter_editmode(C, EM_IGNORE_LAYER);
WM_event_add_notifier(C, NC_SCENE|ND_LAYER_CONTENT, scene);
@@ -354,7 +354,7 @@ static int object_add_exec(bContext *C, wmOperator *op)
unsigned int layer;
float loc[3], rot[3];
- if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
+ if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
ED_object_add_type(C, RNA_enum_get(op->ptr, "type"), loc, rot, enter_editmode, layer);
@@ -365,18 +365,18 @@ static int object_add_exec(bContext *C, wmOperator *op)
void OBJECT_OT_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Object";
+ ot->name = "Add Object";
ot->description = "Add an object to the scene";
- ot->idname= "OBJECT_OT_add";
+ ot->idname = "OBJECT_OT_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= object_add_exec;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = object_add_exec;
- ot->poll= ED_operator_objectmode;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "type", object_type_items, 0, "Type", "");
@@ -411,10 +411,10 @@ static Object *effector_add_type(bContext *C, wmOperator *op, int type)
object_add_generic_invoke_options(C, op);
- if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
+ if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return NULL;
- if(type==PFIELD_GUIDE) {
+ if (type==PFIELD_GUIDE) {
ob= ED_object_add_type(C, OB_CURVE, loc, rot, FALSE, layer);
rename_id(&ob->id, "CurveGuide");
@@ -423,7 +423,7 @@ static Object *effector_add_type(bContext *C, wmOperator *op, int type)
ED_object_new_primitive_matrix(C, ob, loc, rot, mat);
BLI_addtail(object_editcurve_get(ob), add_nurbs_primitive(C, mat, CU_NURBS|CU_PRIM_PATH, 1));
- if(!enter_editmode)
+ if (!enter_editmode)
ED_object_exit_editmode(C, EM_FREEDATA);
}
else {
@@ -448,7 +448,7 @@ static Object *effector_add_type(bContext *C, wmOperator *op, int type)
/* for object add operator */
static int effector_add_exec(bContext *C, wmOperator *op)
{
- if(effector_add_type(C, op, RNA_enum_get(op->ptr, "type")) == NULL)
+ if (effector_add_type(C, op, RNA_enum_get(op->ptr, "type")) == NULL)
return OPERATOR_CANCELLED;
return OPERATOR_FINISHED;
@@ -457,20 +457,20 @@ static int effector_add_exec(bContext *C, wmOperator *op)
void OBJECT_OT_effector_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Effector";
+ ot->name = "Add Effector";
ot->description = "Add an empty object with a physics effector to the scene";
- ot->idname= "OBJECT_OT_effector_add";
+ ot->idname = "OBJECT_OT_effector_add";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= effector_add_exec;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = effector_add_exec;
- ot->poll= ED_operator_objectmode;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
- ot->prop= RNA_def_enum(ot->srna, "type", field_type_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", field_type_items, 0, "Type", "");
ED_object_add_generic_props(ot, TRUE);
}
@@ -491,7 +491,7 @@ static int object_camera_add_exec(bContext *C, wmOperator *op)
object_add_generic_invoke_options(C, op);
- if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
+ if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
ob= ED_object_add_type(C, OB_CAMERA, loc, rot, FALSE, layer);
@@ -512,16 +512,16 @@ void OBJECT_OT_camera_add(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Add Camera";
+ ot->name = "Add Camera";
ot->description = "Add a camera object to the scene";
- ot->idname= "OBJECT_OT_camera_add";
+ ot->idname = "OBJECT_OT_camera_add";
/* api callbacks */
- ot->exec= object_camera_add_exec;
- ot->poll= ED_operator_objectmode;
+ ot->exec = object_camera_add_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
@@ -545,10 +545,10 @@ static int object_metaball_add_exec(bContext *C, wmOperator *op)
object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called
- if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
+ if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
- if(obedit==NULL || obedit->type!=OB_MBALL) {
+ if (obedit==NULL || obedit->type!=OB_MBALL) {
obedit= ED_object_add_type(C, OB_MBALL, loc, rot, TRUE, layer);
newob = 1;
}
@@ -578,7 +578,7 @@ static int object_metaball_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUS
pup= uiPupMenuBegin(C, op->type->name, ICON_NONE);
layout= uiPupMenuLayout(pup);
- if(!obedit || obedit->type == OB_MBALL)
+ if (!obedit || obedit->type == OB_MBALL)
uiItemsEnumO(layout, op->type->idname, "type");
else
uiItemsEnumO(layout, "OBJECT_OT_metaball_add", "type");
@@ -590,17 +590,17 @@ static int object_metaball_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUS
void OBJECT_OT_metaball_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Metaball";
- ot->description= "Add an metaball object to the scene";
- ot->idname= "OBJECT_OT_metaball_add";
+ ot->name = "Add Metaball";
+ ot->description = "Add an metaball object to the scene";
+ ot->idname = "OBJECT_OT_metaball_add";
/* api callbacks */
- ot->invoke= object_metaball_add_invoke;
- ot->exec= object_metaball_add_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->invoke = object_metaball_add_invoke;
+ ot->exec = object_metaball_add_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "type", metaelem_type_items, 0, "Primitive", "");
ED_object_add_generic_props(ot, TRUE);
@@ -614,10 +614,10 @@ static int object_add_text_exec(bContext *C, wmOperator *op)
float loc[3], rot[3];
object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called
- if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
+ if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
- if(obedit && obedit->type==OB_FONT)
+ if (obedit && obedit->type==OB_FONT)
return OPERATOR_CANCELLED;
obedit= ED_object_add_type(C, OB_FONT, loc, rot, enter_editmode, layer);
@@ -630,17 +630,17 @@ static int object_add_text_exec(bContext *C, wmOperator *op)
void OBJECT_OT_text_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Text";
+ ot->name = "Add Text";
ot->description = "Add a text object to the scene";
- ot->idname= "OBJECT_OT_text_add";
+ ot->idname = "OBJECT_OT_text_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= object_add_text_exec;
- ot->poll= ED_operator_objectmode;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = object_add_text_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -655,7 +655,7 @@ static int object_armature_add_exec(bContext *C, wmOperator *op)
float loc[3], rot[3];
object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called
- if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
+ if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
if ((obedit==NULL) || (obedit->type != OB_ARMATURE)) {
@@ -665,7 +665,7 @@ static int object_armature_add_exec(bContext *C, wmOperator *op)
}
else DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
- if(obedit==NULL) {
+ if (obedit==NULL) {
BKE_report(op->reports, RPT_ERROR, "Cannot create editmode armature");
return OPERATOR_CANCELLED;
}
@@ -685,17 +685,17 @@ static int object_armature_add_exec(bContext *C, wmOperator *op)
void OBJECT_OT_armature_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Armature";
+ ot->name = "Add Armature";
ot->description = "Add an armature object to the scene";
- ot->idname= "OBJECT_OT_armature_add";
+ ot->idname = "OBJECT_OT_armature_add";
/* api callbacks */
- ot->invoke= ED_object_add_generic_invoke;
- ot->exec= object_armature_add_exec;
- ot->poll= ED_operator_objectmode;
+ ot->invoke = ED_object_add_generic_invoke;
+ ot->exec = object_armature_add_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -723,7 +723,7 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op)
float loc[3], rot[3];
object_add_generic_invoke_options(C, op);
- if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
+ if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
ob= ED_object_add_type(C, OB_LAMP, loc, rot, FALSE, layer);
@@ -733,7 +733,7 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op)
rename_id(&ob->id, get_lamp_defname(type));
rename_id(&la->id, get_lamp_defname(type));
- if(scene_use_new_shading_nodes(scene)) {
+ if (scene_use_new_shading_nodes(scene)) {
ED_node_shader_default(scene, &la->id);
la->use_nodes= 1;
}
@@ -752,20 +752,20 @@ void OBJECT_OT_lamp_add(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Add Lamp";
+ ot->name = "Add Lamp";
ot->description = "Add a lamp object to the scene";
- ot->idname= "OBJECT_OT_lamp_add";
+ ot->idname = "OBJECT_OT_lamp_add";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= object_lamp_add_exec;
- ot->poll= ED_operator_objectmode;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = object_lamp_add_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", lamp_type_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", lamp_type_items, 0, "Type", "");
ED_object_add_generic_props(ot, FALSE);
}
@@ -779,10 +779,10 @@ static int group_instance_add_exec(bContext *C, wmOperator *op)
float loc[3], rot[3];
object_add_generic_invoke_options(C, op);
- if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
+ if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
- if(group) {
+ if (group) {
Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
Object *ob= ED_object_add_type(C, OB_EMPTY, loc, rot, FALSE, layer);
@@ -811,7 +811,7 @@ static int object_speaker_add_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
object_add_generic_invoke_options(C, op);
- if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
+ if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
ob= ED_object_add_type(C, OB_SPEAKER, loc, rot, FALSE, layer);
@@ -843,16 +843,16 @@ static int object_speaker_add_exec(bContext *C, wmOperator *op)
void OBJECT_OT_speaker_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Speaker";
+ ot->name = "Add Speaker";
ot->description = "Add a speaker object to the scene";
- ot->idname= "OBJECT_OT_speaker_add";
+ ot->idname = "OBJECT_OT_speaker_add";
/* api callbacks */
- ot->exec= object_speaker_add_exec;
- ot->poll= ED_operator_objectmode;
+ ot->exec = object_speaker_add_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
@@ -863,23 +863,23 @@ void OBJECT_OT_group_instance_add(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Add Group Instance";
+ ot->name = "Add Group Instance";
ot->description = "Add a dupligroup instance";
- ot->idname= "OBJECT_OT_group_instance_add";
+ ot->idname = "OBJECT_OT_group_instance_add";
/* api callbacks */
- ot->invoke= WM_enum_search_invoke;
- ot->exec= group_instance_add_exec;
+ ot->invoke = WM_enum_search_invoke;
+ ot->exec = group_instance_add_exec;
- ot->poll= ED_operator_objectmode;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
prop= RNA_def_enum(ot->srna, "group", DummyRNA_NULL_items, 0, "Group", "");
RNA_def_enum_funcs(prop, RNA_group_itemf);
- ot->prop= prop;
+ ot->prop = prop;
ED_object_add_generic_props(ot, FALSE);
}
@@ -892,7 +892,7 @@ void ED_base_object_free_and_unlink(Main *bmain, Scene *scene, Base *base)
DAG_id_type_tag(bmain, ID_OB);
BLI_remlink(&scene->base, base);
free_libblock_us(&bmain->object, base->object);
- if(scene->basact==base) scene->basact= NULL;
+ if (scene->basact==base) scene->basact= NULL;
MEM_freeN(base);
}
@@ -903,12 +903,12 @@ static int object_delete_exec(bContext *C, wmOperator *op)
const short use_global= RNA_boolean_get(op->ptr, "use_global");
/* int islamp= 0; */ /* UNUSED */
- if(CTX_data_edit_object(C))
+ if (CTX_data_edit_object(C))
return OPERATOR_CANCELLED;
CTX_DATA_BEGIN(C, Base*, base, selected_bases) {
- /* if(base->object->type==OB_LAMP) islamp= 1; */
+ /* if (base->object->type==OB_LAMP) islamp= 1; */
/* deselect object -- it could be used in other scenes */
base->object->flag &= ~SELECT;
@@ -946,17 +946,17 @@ static int object_delete_exec(bContext *C, wmOperator *op)
void OBJECT_OT_delete(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete";
+ ot->name = "Delete";
ot->description = "Delete selected objects";
- ot->idname= "OBJECT_OT_delete";
+ ot->idname = "OBJECT_OT_delete";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= object_delete_exec;
- ot->poll= ED_operator_objectmode;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = object_delete_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "use_global", 0, "Delete Globally", "Remove object from all scenes");
}
@@ -978,18 +978,18 @@ static void copy_object_set_idnew(bContext *C, int dupflag)
CTX_DATA_END;
/* materials */
- if( dupflag & USER_DUP_MAT) {
+ if ( dupflag & USER_DUP_MAT) {
mao= bmain->mat.first;
- while(mao) {
- if(mao->id.newid) {
+ while (mao) {
+ if (mao->id.newid) {
ma= (Material *)mao->id.newid;
- if(dupflag & USER_DUP_TEX) {
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a]) {
+ if (dupflag & USER_DUP_TEX) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (ma->mtex[a]) {
id= (ID *)ma->mtex[a]->tex;
- if(id) {
+ if (id) {
ID_NEW_US(ma->mtex[a]->tex)
else ma->mtex[a]->tex= copy_texture(ma->mtex[a]->tex);
id->us--;
@@ -999,7 +999,7 @@ static void copy_object_set_idnew(bContext *C, int dupflag)
}
#if 0 // XXX old animation system
id= (ID *)ma->ipo;
- if(id) {
+ if (id) {
ID_NEW_US(ma->ipo)
else ma->ipo= copy_ipo(ma->ipo);
id->us--;
@@ -1012,13 +1012,13 @@ static void copy_object_set_idnew(bContext *C, int dupflag)
#if 0 // XXX old animation system
/* lamps */
- if( dupflag & USER_DUP_IPO) {
+ if ( dupflag & USER_DUP_IPO) {
Lamp *la= bmain->lamp.first;
- while(la) {
- if(la->id.newid) {
+ while (la) {
+ if (la->id.newid) {
Lamp *lan= (Lamp *)la->id.newid;
id= (ID *)lan->ipo;
- if(id) {
+ if (id) {
ID_NEW_US(lan->ipo)
else lan->ipo= copy_ipo(lan->ipo);
id->us--;
@@ -1030,12 +1030,12 @@ static void copy_object_set_idnew(bContext *C, int dupflag)
/* ipos */
ipo= bmain->ipo.first;
- while(ipo) {
- if(ipo->id.lib==NULL && ipo->id.newid) {
+ while (ipo) {
+ if (ipo->id.lib==NULL && ipo->id.newid) {
Ipo *ipon= (Ipo *)ipo->id.newid;
IpoCurve *icu;
- for(icu= ipon->curve.first; icu; icu= icu->next) {
- if(icu->driver) {
+ for (icu= ipon->curve.first; icu; icu= icu->next) {
+ if (icu->driver) {
ID_NEW(icu->driver->ob);
}
}
@@ -1059,23 +1059,23 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
DupliObject *dob;
GHash *dupli_gh= NULL, *parent_gh= NULL;
- if(!(base->object->transflag & OB_DUPLI))
+ if (!(base->object->transflag & OB_DUPLI))
return;
lb= object_duplilist(scene, base->object);
- if(use_hierarchy || use_base_parent) {
+ if (use_hierarchy || use_base_parent) {
dupli_gh= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "make_object_duplilist_real dupli_gh");
parent_gh= BLI_ghash_new(BLI_ghashutil_pairhash, BLI_ghashutil_paircmp, "make_object_duplilist_real parent_gh");
}
- for(dob= lb->first; dob; dob= dob->next) {
+ for (dob= lb->first; dob; dob= dob->next) {
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...
- */
- if(ob->mat==NULL) ob->totcol= 0;
+ * should be implemented better...
+ */
+ if (ob->mat==NULL) ob->totcol= 0;
basen= MEM_dupallocN(base);
basen->flag &= ~(OB_FROMDUPLI|OB_FROMGROUP);
@@ -1097,14 +1097,14 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
copy_m4_m4(ob->obmat, dob->mat);
object_apply_mat4(ob, ob->obmat, FALSE, FALSE);
- if(dupli_gh)
+ if (dupli_gh)
BLI_ghash_insert(dupli_gh, dob, ob);
- if(parent_gh)
+ if (parent_gh)
BLI_ghash_insert(parent_gh, BLI_ghashutil_pairalloc(dob->ob, dob->index), ob);
}
if (use_hierarchy) {
- for(dob= lb->first; dob; dob= dob->next) {
+ for (dob= lb->first; dob; dob= dob->next) {
/* original parents */
Object *ob_src= dob->ob;
Object *ob_src_par= ob_src->parent;
@@ -1113,7 +1113,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
Object *ob_dst_par= NULL;
/* find parent that was also made real */
- if(ob_src_par) {
+ if (ob_src_par) {
GHashPair *pair = BLI_ghashutil_pairalloc(ob_src_par, dob->index);
ob_dst_par = BLI_ghash_lookup(parent_gh, pair);
BLI_ghashutil_pairfree(pair);
@@ -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);
}
}
@@ -1151,7 +1151,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
else if (use_base_parent) {
/* since we are ignoring the internal hierarchy - parent all to the
* base object */
- for(dob= lb->first; dob; dob= dob->next) {
+ for (dob= lb->first; dob; dob= dob->next) {
/* original parents */
Object *ob_dst= BLI_ghash_lookup(dupli_gh, dob);
@@ -1167,9 +1167,9 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
}
}
- if(dupli_gh)
+ if (dupli_gh)
BLI_ghash_free(dupli_gh, NULL, NULL);
- if(parent_gh)
+ if (parent_gh)
BLI_ghash_free(parent_gh, BLI_ghashutil_pairfree, NULL);
copy_object_set_idnew(C, 0);
@@ -1209,17 +1209,17 @@ void OBJECT_OT_duplicates_make_real(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Make Duplicates Real";
+ ot->name = "Make Duplicates Real";
ot->description = "Make dupli objects attached to this object real";
- ot->idname= "OBJECT_OT_duplicates_make_real";
+ ot->idname = "OBJECT_OT_duplicates_make_real";
/* api callbacks */
- ot->exec= object_duplicates_make_real_exec;
+ ot->exec = object_duplicates_make_real_exec;
- ot->poll= ED_operator_objectmode;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "use_base_parent", 0, "Parent", "Parent newly created objects to the original duplicator");
RNA_def_boolean(ot->srna, "use_hierarchy", 0, "Keep Hierarchy", "Maintain parent child relationships");
@@ -1234,12 +1234,12 @@ static EnumPropertyItem convert_target_items[]= {
static void curvetomesh(Scene *scene, Object *ob)
{
- if(ob->disp.first == NULL)
+ if (ob->disp.first == NULL)
makeDispListCurveTypes(scene, ob, 0); /* force creation */
nurbs_to_mesh(ob); /* also does users */
- if(ob->type == OB_MESH)
+ if (ob->type == OB_MESH)
object_free_modifiers(ob);
}
@@ -1299,7 +1299,7 @@ static int convert_exec(bContext *C, wmOperator *op)
ob->flag &= ~OB_DONE;
/* flag data thats not been edited (only needed for !keep_original) */
- if(ob->data) {
+ if (ob->data) {
((ID *)ob->data)->flag |= LIB_DOIT;
}
}
@@ -1308,17 +1308,17 @@ static int convert_exec(bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
ob= base->object;
- if(ob->flag & OB_DONE || !IS_TAGGED(ob->data)) {
+ if (ob->flag & OB_DONE || !IS_TAGGED(ob->data)) {
if (ob->type != target) {
base->flag &= ~SELECT;
ob->flag &= ~SELECT;
}
/* obdata already modified */
- if(!IS_TAGGED(ob->data)) {
+ if (!IS_TAGGED(ob->data)) {
/* When 2 objects with linked data are selected, converting both
* would keep modifiers on all but the converted object [#26003] */
- if(ob->type == OB_MESH) {
+ if (ob->type == OB_MESH) {
object_free_modifiers(ob); /* after derivedmesh calls! */
}
}
@@ -1336,16 +1336,17 @@ static int convert_exec(bContext *C, wmOperator *op)
/* make a new copy of the mesh */
newob->data= copy_mesh(me);
- } else {
+ }
+ else {
newob = ob;
}
mesh_to_curve(scene, newob);
- if(newob->type==OB_CURVE)
+ if (newob->type==OB_CURVE)
object_free_modifiers(newob); /* after derivedmesh calls! */
}
- else if(ob->type==OB_MESH && ob->modifiers.first) { /* converting a mesh with no modifiers causes a segfault */
+ else if (ob->type==OB_MESH && ob->modifiers.first) { /* converting a mesh with no modifiers causes a segfault */
ob->flag |= OB_DONE;
if (keep_original) {
@@ -1358,7 +1359,8 @@ static int convert_exec(bContext *C, wmOperator *op)
/* make a new copy of the mesh */
newob->data= copy_mesh(me);
- } else {
+ }
+ else {
newob = ob;
ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
}
@@ -1372,12 +1374,12 @@ static int convert_exec(bContext *C, wmOperator *op)
DM_to_mesh(dm, newob->data, newob);
- /* re-tesselation is called by DM_to_mesh */
+ /* re-tessellation is called by DM_to_mesh */
dm->release(dm);
object_free_modifiers(newob); /* after derivedmesh calls! */
}
- else if(ob->type==OB_FONT) {
+ else if (ob->type==OB_FONT) {
ob->flag |= OB_DONE;
if (keep_original) {
@@ -1389,7 +1391,8 @@ static int convert_exec(bContext *C, wmOperator *op)
/* make a new copy of the curve */
newob->data= copy_curve(ob->data);
- } else {
+ }
+ else {
newob= ob;
}
@@ -1401,28 +1404,28 @@ static int convert_exec(bContext *C, wmOperator *op)
newob->type= OB_CURVE;
cu->type= OB_CURVE;
- if(cu->vfont) {
+ if (cu->vfont) {
cu->vfont->id.us--;
cu->vfont= NULL;
}
- if(cu->vfontb) {
+ if (cu->vfontb) {
cu->vfontb->id.us--;
cu->vfontb= NULL;
}
- if(cu->vfonti) {
+ if (cu->vfonti) {
cu->vfonti->id.us--;
cu->vfonti= NULL;
}
- if(cu->vfontbi) {
+ if (cu->vfontbi) {
cu->vfontbi->id.us--;
cu->vfontbi= NULL;
}
if (!keep_original) {
/* other users */
- if(cu->id.us>1) {
- for(ob1= bmain->object.first; ob1; ob1=ob1->id.next) {
- if(ob1->data==ob->data) {
+ if (cu->id.us>1) {
+ for (ob1= bmain->object.first; ob1; ob1=ob1->id.next) {
+ if (ob1->data==ob->data) {
ob1->type= OB_CURVE;
ob1->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
}
@@ -1430,20 +1433,20 @@ static int convert_exec(bContext *C, wmOperator *op)
}
}
- for(nu=cu->nurb.first; nu; nu=nu->next)
+ for (nu=cu->nurb.first; nu; nu=nu->next)
nu->charidx= 0;
- if(target == OB_MESH) {
+ if (target == OB_MESH) {
curvetomesh(scene, newob);
/* meshes doesn't use displist */
freedisplist(&newob->disp);
}
}
- else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
ob->flag |= OB_DONE;
- if(target == OB_MESH) {
+ if (target == OB_MESH) {
if (keep_original) {
basen= duplibase_for_convert(scene, base, NULL);
newob= basen->object;
@@ -1453,7 +1456,8 @@ static int convert_exec(bContext *C, wmOperator *op)
/* make a new copy of the curve */
newob->data= copy_curve(ob->data);
- } else {
+ }
+ else {
newob= ob;
/* meshes doesn't use displist */
@@ -1463,7 +1467,7 @@ static int convert_exec(bContext *C, wmOperator *op)
curvetomesh(scene, newob);
}
}
- else if(ob->type==OB_MBALL && target == OB_MESH) {
+ else if (ob->type==OB_MBALL && target == OB_MESH) {
Object *baseob;
base->flag &= ~SELECT;
@@ -1480,7 +1484,7 @@ static int convert_exec(bContext *C, wmOperator *op)
makeDispListMBall(scene, baseob);
}
- if(!(baseob->flag & OB_DONE)) {
+ if (!(baseob->flag & OB_DONE)) {
baseob->flag |= OB_DONE;
basen= duplibase_for_convert(scene, base, baseob);
@@ -1494,9 +1498,9 @@ static int convert_exec(bContext *C, wmOperator *op)
me= newob->data;
me->totcol= mb->totcol;
- if(newob->totcol) {
+ if (newob->totcol) {
me->mat= MEM_dupallocN(mb->mat);
- for(a=0; a<newob->totcol; a++) id_us_plus((ID *)me->mat[a]);
+ for (a=0; a<newob->totcol; a++) id_us_plus((ID *)me->mat[a]);
}
mball_to_mesh(&baseob->disp, newob->data);
@@ -1515,8 +1519,8 @@ static int convert_exec(bContext *C, wmOperator *op)
/* tag obdata if it was been changed */
/* If the original object is active then make this object active */
- if(basen) {
- if(ob == obact) {
+ if (basen) {
+ if (ob == obact) {
/* store new active base to update BASACT */
basact= basen;
}
@@ -1530,8 +1534,8 @@ static int convert_exec(bContext *C, wmOperator *op)
}
/* delete original if needed */
- if(basedel) {
- if(!keep_original)
+ if (basedel) {
+ if (!keep_original)
ED_base_object_free_and_unlink(bmain, scene, basedel);
basedel = NULL;
@@ -1539,7 +1543,7 @@ static int convert_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
- if(!keep_original) {
+ if (!keep_original) {
if (mballConverted) {
Base *base= scene->base.first, *tmpbase;
while (base) {
@@ -1564,7 +1568,8 @@ static int convert_exec(bContext *C, wmOperator *op)
/* active base was changed */
ED_base_object_activate(C, basact);
BASACT= basact;
- } else if (BASACT->object->flag & OB_DONE) {
+ }
+ else if (BASACT->object->flag & OB_DONE) {
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, BASACT->object);
WM_event_add_notifier(C, NC_OBJECT|ND_DATA, BASACT->object);
}
@@ -1580,30 +1585,30 @@ static int convert_exec(bContext *C, wmOperator *op)
void OBJECT_OT_convert(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Convert to";
+ ot->name = "Convert to";
ot->description = "Convert selected objects to another type";
- ot->idname= "OBJECT_OT_convert";
+ ot->idname = "OBJECT_OT_convert";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= convert_exec;
- ot->poll= convert_poll;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = convert_exec;
+ ot->poll = convert_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "target", convert_target_items, OB_MESH, "Target", "Type of object to convert to");
+ ot->prop = RNA_def_enum(ot->srna, "target", convert_target_items, OB_MESH, "Target", "Type of object to convert to");
RNA_def_boolean(ot->srna, "keep_original", 0, "Keep Original", "Keep original objects instead of replacing them");
}
/**************************** 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 */
@@ -1616,7 +1621,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
int a, didit;
ob= base->object;
- if(ob->mode & OB_MODE_POSE) {
+ if (ob->mode & OB_MODE_POSE) {
; /* nothing? */
}
else {
@@ -1628,42 +1633,42 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
BLI_addhead(&scene->base, basen); /* addhead: prevent eternal loop */
basen->object= obn;
- if(basen->flag & OB_FROMGROUP) {
+ if (basen->flag & OB_FROMGROUP) {
Group *group;
- for(group= bmain->group.first; group; group= group->id.next) {
- if(object_in_group(ob, group))
+ for (group= bmain->group.first; group; group= group->id.next) {
+ if (object_in_group(ob, group))
add_to_group(group, obn, scene, basen);
}
}
/* duplicates using userflags */
- if(dupflag & USER_DUP_ACT) {
+ if (dupflag & USER_DUP_ACT) {
BKE_copy_animdata_id_action(&obn->id);
}
- if(dupflag & USER_DUP_MAT) {
- for(a=0; a<obn->totcol; a++) {
+ if (dupflag & USER_DUP_MAT) {
+ for (a=0; a<obn->totcol; a++) {
id= (ID *)obn->mat[a];
- if(id) {
+ if (id) {
ID_NEW_US(obn->mat[a])
else obn->mat[a]= copy_material(obn->mat[a]);
id->us--;
- if(dupflag & USER_DUP_ACT) {
+ if (dupflag & USER_DUP_ACT) {
BKE_copy_animdata_id_action(&obn->mat[a]->id);
}
}
}
}
- if(dupflag & USER_DUP_PSYS) {
+ if (dupflag & USER_DUP_PSYS) {
ParticleSystem *psys;
- for(psys=obn->particlesystem.first; psys; psys=psys->next) {
+ for (psys=obn->particlesystem.first; psys; psys=psys->next) {
id= (ID*) psys->part;
- if(id) {
+ if (id) {
ID_NEW_US(psys->part)
else psys->part= psys_copy_settings(psys->part);
- if(dupflag & USER_DUP_ACT) {
+ if (dupflag & USER_DUP_ACT) {
BKE_copy_animdata_id_action(&psys->part->id);
}
@@ -1677,12 +1682,12 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
switch(obn->type) {
case OB_MESH:
- if(dupflag & USER_DUP_MESH) {
+ if (dupflag & USER_DUP_MESH) {
ID_NEW_US2( obn->data )
else {
obn->data= copy_mesh(obn->data);
- if(obn->fluidsimSettings) {
+ if (obn->fluidsimSettings) {
obn->fluidsimSettings->orgMesh = (Mesh *)obn->data;
}
@@ -1692,7 +1697,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
}
break;
case OB_CURVE:
- if(dupflag & USER_DUP_CURVE) {
+ if (dupflag & USER_DUP_CURVE) {
ID_NEW_US2(obn->data )
else {
obn->data= copy_curve(obn->data);
@@ -1702,7 +1707,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
}
break;
case OB_SURF:
- if(dupflag & USER_DUP_SURF) {
+ if (dupflag & USER_DUP_SURF) {
ID_NEW_US2( obn->data )
else {
obn->data= copy_curve(obn->data);
@@ -1712,7 +1717,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
}
break;
case OB_FONT:
- if(dupflag & USER_DUP_FONT) {
+ if (dupflag & USER_DUP_FONT) {
ID_NEW_US2( obn->data )
else {
obn->data= copy_curve(obn->data);
@@ -1722,7 +1727,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
}
break;
case OB_MBALL:
- if(dupflag & USER_DUP_MBALL) {
+ if (dupflag & USER_DUP_MBALL) {
ID_NEW_US2(obn->data )
else {
obn->data= copy_mball(obn->data);
@@ -1732,7 +1737,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
}
break;
case OB_LAMP:
- if(dupflag & USER_DUP_LAMP) {
+ if (dupflag & USER_DUP_LAMP) {
ID_NEW_US2(obn->data )
else {
obn->data= copy_lamp(obn->data);
@@ -1744,9 +1749,9 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
case OB_ARMATURE:
obn->recalc |= OB_RECALC_DATA;
- if(obn->pose) obn->pose->flag |= POSE_RECALC;
+ if (obn->pose) obn->pose->flag |= POSE_RECALC;
- if(dupflag & USER_DUP_ARM) {
+ if (dupflag & USER_DUP_ARM) {
ID_NEW_US2(obn->data )
else {
obn->data= copy_armature(obn->data);
@@ -1759,7 +1764,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
break;
case OB_LATTICE:
- if(dupflag!=0) {
+ if (dupflag!=0) {
ID_NEW_US2(obn->data )
else {
obn->data= copy_lattice(obn->data);
@@ -1769,7 +1774,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
}
break;
case OB_CAMERA:
- if(dupflag!=0) {
+ if (dupflag!=0) {
ID_NEW_US2(obn->data )
else {
obn->data= copy_camera(obn->data);
@@ -1779,7 +1784,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
}
break;
case OB_SPEAKER:
- if(dupflag!=0) {
+ if (dupflag!=0) {
ID_NEW_US2(obn->data )
else {
obn->data= copy_speaker(obn->data);
@@ -1792,34 +1797,34 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
}
/* check if obdata is copied */
- if(didit) {
+ if (didit) {
Key *key = ob_get_key(obn);
- if(dupflag & USER_DUP_ACT) {
+ if (dupflag & USER_DUP_ACT) {
bActuator *act;
BKE_copy_animdata_id_action((ID *)obn->data);
- if(key) {
+ if (key) {
BKE_copy_animdata_id_action((ID*)key);
}
/* Update the duplicated action in the action actuators */
for (act = obn->actuators.first; act; act = act->next) {
- if(act->type == ACT_ACTION) {
+ if (act->type == ACT_ACTION) {
bActionActuator* actact = (bActionActuator*) act->data;
- if(ob->adt && actact->act == ob->adt->action) {
+ if (ob->adt && actact->act == ob->adt->action) {
actact->act = obn->adt->action;
}
}
}
}
- if(dupflag & USER_DUP_MAT) {
+ if (dupflag & USER_DUP_MAT) {
matarar= give_matarar(obn);
- if(matarar) {
- for(a=0; a<obn->totcol; a++) {
+ if (matarar) {
+ for (a=0; a<obn->totcol; a++) {
id= (ID *)(*matarar)[a];
- if(id) {
+ if (id) {
ID_NEW_US( (*matarar)[a] )
else (*matarar)[a]= copy_material((*matarar)[a]);
@@ -1878,7 +1883,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) {
@@ -1886,10 +1891,10 @@ static int duplicate_exec(bContext *C, wmOperator *op)
}
/* new object becomes active */
- if(BASACT==base)
+ if (BASACT==base)
ED_base_object_activate(C, basen);
- if(basen->object->data) {
+ if (basen->object->data) {
DAG_id_tag_update(basen->object->data, 0);
}
}
@@ -1910,16 +1915,16 @@ void OBJECT_OT_duplicate(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Duplicate Objects";
+ ot->name = "Duplicate Objects";
ot->description = "Duplicate selected objects";
- ot->idname= "OBJECT_OT_duplicate";
+ ot->idname = "OBJECT_OT_duplicate";
/* api callbacks */
- ot->exec= duplicate_exec;
- ot->poll= ED_operator_objectmode;
+ ot->exec = duplicate_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* to give to transform */
RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data");
@@ -1943,7 +1948,7 @@ static int add_named_exec(bContext *C, wmOperator *op)
/* find object, create fake base */
RNA_string_get(op->ptr, "name", name);
ob= (Object *)find_id("OB", name);
- if(ob==NULL)
+ if (ob==NULL)
return OPERATOR_CANCELLED;
base= MEM_callocN(sizeof(Base), "duplibase");
@@ -1981,16 +1986,16 @@ static int add_named_exec(bContext *C, wmOperator *op)
void OBJECT_OT_add_named(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Named Object";
+ ot->name = "Add Named Object";
ot->description = "Add named object";
- ot->idname= "OBJECT_OT_add_named";
+ ot->idname = "OBJECT_OT_add_named";
/* api callbacks */
- ot->exec= add_named_exec;
- ot->poll= ED_operator_objectmode;
+ ot->exec = add_named_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data");
RNA_def_string(ot->srna, "name", "Cube", MAX_ID_NAME-2, "Name", "Object name to add");
@@ -2017,20 +2022,20 @@ static int join_exec(bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- if(scene->obedit) {
+ if (scene->obedit) {
BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode");
return OPERATOR_CANCELLED;
}
- else if(object_data_is_libdata(ob)) {
+ else if (object_data_is_libdata(ob)) {
BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata");
return OPERATOR_CANCELLED;
}
- if(ob->type == OB_MESH)
+ if (ob->type == OB_MESH)
return join_mesh_exec(C, op);
- else if(ELEM(ob->type, OB_CURVE, OB_SURF))
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF))
return join_curve_exec(C, op);
- else if(ob->type == OB_ARMATURE)
+ else if (ob->type == OB_ARMATURE)
return join_armature_exec(C, op);
return OPERATOR_CANCELLED;
@@ -2039,16 +2044,16 @@ static int join_exec(bContext *C, wmOperator *op)
void OBJECT_OT_join(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Join";
+ ot->name = "Join";
ot->description = "Join selected objects into active object";
- ot->idname= "OBJECT_OT_join";
+ ot->idname = "OBJECT_OT_join";
/* api callbacks */
- ot->exec= join_exec;
- ot->poll= join_poll;
+ ot->exec = join_exec;
+ ot->poll = join_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/**************************** Join as Shape Key*************************/
@@ -2070,16 +2075,16 @@ static int join_shapes_exec(bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- if(scene->obedit) {
+ if (scene->obedit) {
BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode");
return OPERATOR_CANCELLED;
}
- else if(object_data_is_libdata(ob)) {
+ else if (object_data_is_libdata(ob)) {
BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata");
return OPERATOR_CANCELLED;
}
- if(ob->type == OB_MESH)
+ if (ob->type == OB_MESH)
return join_mesh_shapes_exec(C, op);
return OPERATOR_CANCELLED;
@@ -2088,14 +2093,14 @@ static int join_shapes_exec(bContext *C, wmOperator *op)
void OBJECT_OT_join_shapes(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Join as Shapes";
+ ot->name = "Join as Shapes";
ot->description = "Merge selected objects to shapes of active object";
- ot->idname= "OBJECT_OT_join_shapes";
+ ot->idname = "OBJECT_OT_join_shapes";
/* api callbacks */
- ot->exec= join_shapes_exec;
- ot->poll= join_shapes_poll;
+ ot->exec = join_shapes_exec;
+ ot->poll = join_shapes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index 340a6df8bf6..deefcfd6989 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;
@@ -166,10 +161,11 @@ static void multiresbake_get_normal(const MResolvePixelData *data, float norm[],
data->mface[face_num].v3, data->mface[face_num].v4};
const int smoothnormal= (data->mface[face_num].flag & ME_SMOOTH);
- if(!smoothnormal) { /* flat */
- if(data->precomputed_normals) {
+ if (!smoothnormal) { /* flat */
+ if (data->precomputed_normals) {
copy_v3_v3(norm, &data->precomputed_normals[3*face_num]);
- } else {
+ }
+ else {
float nor[3];
float *p0, *p1, *p2;
const int iGetNrVerts= data->mface[face_num].v4!=0 ? 4 : 3;
@@ -178,16 +174,18 @@ static void multiresbake_get_normal(const MResolvePixelData *data, float norm[],
p1= data->mvert[indices[1]].co;
p2= data->mvert[indices[2]].co;
- if(iGetNrVerts==4) {
+ if (iGetNrVerts==4) {
float *p3= data->mvert[indices[3]].co;
normal_quad_v3(nor, p0, p1, p2, p3);
- } else {
+ }
+ else {
normal_tri_v3(nor, p0, p1, p2);
}
copy_v3_v3(norm, nor);
}
- } else {
+ }
+ else {
short *no= data->mvert[indices[vert_index]].no;
normal_short_to_float_v3(norm, no);
@@ -239,12 +237,12 @@ 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. */
- for(r= 0; r<3; r++) {
+ * 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;
}
@@ -263,8 +261,8 @@ static void set_rast_triangle(const MBakeRast *bake_rast, const int x, const int
const int w= bake_rast->w;
const int h= bake_rast->h;
- if(x>=0 && x<w && y>=0 && y<h) {
- if((bake_rast->texels[y*w+x])==0) {
+ if (x>=0 && x<w && y>=0 && y<h) {
+ if ((bake_rast->texels[y*w+x])==0) {
flush_pixel(bake_rast->data, x, y);
bake_rast->texels[y*w+x]= FILTER_MASK_USED;
}
@@ -282,29 +280,29 @@ static void rasterize_half(const MBakeRast *bake_rast,
const int h= bake_rast->h;
int y, y0, y1;
- if(y1_in<=0 || y0_in>=h)
+ if (y1_in<=0 || y0_in>=h)
return;
y0= y0_in<0 ? 0 : y0_in;
y1= y1_in>=h ? h : y1_in;
- for(y= y0; y<y1; y++) {
+ for (y= y0; y<y1; y++) {
/*-b(x-x0) + a(y-y0) = 0 */
int iXl, iXr, x;
float x_l= s_stable!=0 ? (s0_s + (((s1_s-s0_s)*(y-t0_s))/(t1_s-t0_s))) : s0_s;
float x_r= l_stable!=0 ? (s0_l + (((s1_l-s0_l)*(y-t0_l))/(t1_l-t0_l))) : s0_l;
- if(is_mid_right!=0)
+ if (is_mid_right!=0)
SWAP(float, x_l, x_r);
iXl= (int)ceilf(x_l);
iXr= (int)ceilf(x_r);
- if(iXr>0 && iXl<w) {
+ if (iXr>0 && iXl<w) {
iXl= iXl<0?0:iXl;
iXr= iXr>=w?w:iXr;
- for(x= iXl; x<iXr; x++)
+ for (x= iXl; x<iXr; x++)
set_rast_triangle(bake_rast, x, y);
}
}
@@ -323,19 +321,20 @@ static void bake_rasterize(const MBakeRast *bake_rast, const float st0_in[2], co
int is_mid_right= 0, ylo, yhi, yhi_beg;
/* skip degenerates */
- if((slo==smi && tlo==tmi) || (slo==shi && tlo==thi) || (smi==shi && tmi==thi))
+ if ((slo==smi && tlo==tmi) || (slo==shi && tlo==thi) || (smi==shi && tmi==thi))
return;
/* sort by T */
- if(tlo>tmi && tlo>thi) {
+ if (tlo>tmi && tlo>thi) {
SWAP(float, shi, slo);
SWAP(float, thi, tlo);
- } else if(tmi>thi) {
+ }
+ else if (tmi>thi) {
SWAP(float, shi, smi);
SWAP(float, thi, tmi);
}
- if(tlo>tmi) {
+ if (tlo>tmi) {
SWAP(float, slo, smi);
SWAP(float, tlo, tmi);
}
@@ -353,7 +352,7 @@ static void bake_rasterize(const MBakeRast *bake_rast, const float st0_in[2], co
static int multiresbake_test_break(MultiresBakeRender *bkr)
{
- if(!bkr->stop) {
+ if (!bkr->stop) {
/* this means baker is executed outside from job system */
return 0;
}
@@ -373,12 +372,12 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image* ima, MPassKnownData
MTFace *mtface= dm->getTessFaceDataArray(dm, CD_MTFACE);
float *pvtangent= NULL;
- if(CustomData_get_layer_index(&dm->faceData, CD_TANGENT) == -1)
+ if (CustomData_get_layer_index(&dm->faceData, CD_TANGENT) == -1)
DM_add_tangent_layer(dm);
pvtangent= DM_get_tessface_data_layer(dm, CD_TANGENT);
- if(tot_face > 0) { /* sanity check */
+ if (tot_face > 0) { /* sanity check */
int f= 0;
MBakeRast bake_rast;
MResolvePixelData data={NULL};
@@ -395,25 +394,25 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image* ima, MPassKnownData
data.lvl= lvl;
data.pass_data= passKnownData;
- if(initBakeData)
+ if (initBakeData)
data.bake_data= initBakeData(bkr, ima);
init_bake_rast(&bake_rast, ibuf, &data, flush_pixel);
- for(f= 0; f<tot_face; f++) {
+ for (f= 0; f<tot_face; f++) {
MTFace *mtfate= &mtface[f];
int verts[3][2], nr_tris, t;
- if(multiresbake_test_break(bkr))
+ if (multiresbake_test_break(bkr))
break;
- if(mtfate->tpage!=ima)
+ if (mtfate->tpage!=ima)
continue;
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;
@@ -423,7 +422,7 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image* ima, MPassKnownData
verts[2][1]=3;
nr_tris= mface[f].v4!=0 ? 2 : 1;
- for(t= 0; t<nr_tris; t++) {
+ for (t= 0; t<nr_tris; t++) {
data.i0 = verts[0][t];
data.i1 = verts[1][t];
data.i2 = verts[2][t];
@@ -433,17 +432,17 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image* ima, MPassKnownData
bkr->baked_faces++;
- if(bkr->do_update)
+ if (bkr->do_update)
*bkr->do_update= 1;
- if(bkr->progress)
+ if (bkr->progress)
*bkr->progress= ((float)bkr->baked_objects + (float)bkr->baked_faces / tot_face) / bkr->tot_obj;
}
- if(applyBakeData)
+ if (applyBakeData)
applyBakeData(data.bake_data);
- if(freeBakeData)
+ if (freeBakeData)
freeBakeData(data.bake_data);
}
}
@@ -475,7 +474,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;
@@ -491,12 +490,13 @@ static void interp_bilinear_grid(DMGridData *grid, int grid_size, float crn_x, f
u= crn_x-x0;
v= crn_y-y0;
- if(mode == 0) {
+ if (mode == 0) {
copy_v3_v3(data[0], grid[y0 * grid_size + x0].no);
copy_v3_v3(data[1], grid[y0 * grid_size + x1].no);
copy_v3_v3(data[2], grid[y1 * grid_size + x1].no);
copy_v3_v3(data[3], grid[y1 * grid_size + x0].no);
- } else {
+ }
+ else {
copy_v3_v3(data[0], grid[y0 * grid_size + x0].co);
copy_v3_v3(data[1], grid[y0 * grid_size + x1].co);
copy_v3_v3(data[2], grid[y1 * grid_size + x1].co);
@@ -522,10 +522,11 @@ static void get_ccgdm_data(DerivedMesh *lodm, DerivedMesh *hidm, const int *orig
face_side= (grid_size<<1)-1;
- if(lvl==0) {
+ if (lvl==0) {
g_index= grid_offset[face_index];
S= mdisp_rot_face_to_crn(mface.v4 ? 4 : 3, face_side, u*(face_side-1), v*(face_side-1), &crn_x, &crn_y);
- } else {
+ }
+ else {
int side= (1 << (lvl-1)) + 1;
int grid_index= origindex[face_index];
int loc_offs= face_index % (1<<(2*lvl));
@@ -544,25 +545,26 @@ static void get_ccgdm_data(DerivedMesh *lodm, DerivedMesh *hidm, const int *orig
CLAMP(crn_x, 0.0f, grid_size);
CLAMP(crn_y, 0.0f, grid_size);
- if(n != NULL)
+ if (n != NULL)
interp_bilinear_grid(grid_data[g_index + S], grid_size, crn_x, crn_y, 0, n);
- if(co != NULL)
+ if (co != NULL)
interp_bilinear_grid(grid_data[g_index + S], grid_size, crn_x, crn_y, 1, co);
}
/* 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];
- if(mode == 0) {
+ if (mode == 0) {
dm->getVertNo(dm, mface->v1, data[0]);
dm->getVertNo(dm, mface->v2, data[1]);
dm->getVertNo(dm, mface->v3, data[2]);
dm->getVertNo(dm, mface->v4, data[3]);
- } else {
+ }
+ else {
dm->getVertCo(dm, mface->v1, data[0]);
dm->getVertCo(dm, mface->v2, data[1]);
dm->getVertCo(dm, mface->v3, data[2]);
@@ -573,16 +575,17 @@ 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];
- if(mode == 0) {
+ if (mode == 0) {
dm->getVertNo(dm, mface->v1, data[0]);
dm->getVertNo(dm, mface->v2, data[1]);
dm->getVertNo(dm, mface->v3, data[2]);
- } else {
+ }
+ else {
dm->getVertCo(dm, mface->v1, data[0]);
dm->getVertCo(dm, mface->v2, data[1]);
dm->getVertCo(dm, mface->v3, data[2]);
@@ -604,7 +607,7 @@ static void *init_heights_data(MultiresBakeRender *bkr, Image *ima)
height_data->height_max= -FLT_MAX;
height_data->height_min= FLT_MAX;
- if(!bkr->use_lores_mesh) {
+ if (!bkr->use_lores_mesh) {
SubsurfModifierData smd= {{NULL}};
int ss_lvl= bkr->tot_lvl - bkr->lvl;
@@ -613,7 +616,7 @@ static void *init_heights_data(MultiresBakeRender *bkr, Image *ima)
smd.levels= smd.renderLevels= ss_lvl;
smd.flags|= eSubsurfModifierFlag_SubsurfUv;
- if(bkr->simple)
+ if (bkr->simple)
smd.subdivType= ME_SIMPLE_SUBSURF;
height_data->ssdm= subsurf_make_derived_from_derived(bkr->lores_dm, &smd, 0, NULL, 0, 0, 0);
@@ -651,24 +654,25 @@ static void apply_heights_data(void *bake_data)
float height, *heights= height_data->heights;
float min= height_data->height_min, max= height_data->height_max;
- for(x= 0; x<ibuf->x; x++) {
- for(y =0; y<ibuf->y; y++) {
+ for (x= 0; x<ibuf->x; x++) {
+ for (y =0; y<ibuf->y; y++) {
i= ibuf->x*y + x;
- if(((char*)ibuf->userdata)[i] != FILTER_MASK_USED)
+ if (((char*)ibuf->userdata)[i] != FILTER_MASK_USED)
continue;
- if(ibuf->rect_float) {
+ if (ibuf->rect_float) {
float *rrgbf= ibuf->rect_float + i*4;
- if(max-min > 1e-5f) height= (heights[i]-min)/(max-min);
+ if (max-min > 1e-5f) height= (heights[i]-min)/(max-min);
else height= 0;
rrgbf[0]=rrgbf[1]=rrgbf[2]= height;
- } else {
+ }
+ else {
char *rrgb= (char*)ibuf->rect + i*4;
- if(max-min > 1e-5f) height= (heights[i]-min)/(max-min);
+ if (max-min > 1e-5f) height= (heights[i]-min)/(max-min);
else height= 0;
rrgb[0]=rrgb[1]=rrgb[2]= FTOCHAR(height);
@@ -683,7 +687,7 @@ static void free_heights_data(void *bake_data)
{
MHeightBakeData *height_data= (MHeightBakeData*)bake_data;
- if(height_data->ssdm)
+ if (height_data->ssdm)
height_data->ssdm->release(height_data->ssdm);
MEM_freeN(height_data->heights);
@@ -691,11 +695,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)
@@ -715,10 +719,11 @@ static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
st1= mtface[face_index].uv[1];
st2= mtface[face_index].uv[2];
- if(mface.v4) {
+ if (mface.v4) {
st3= mtface[face_index].uv[3];
resolve_quad_uv(uv, st, st0, st1, st2, st3);
- } else
+ }
+ else
resolve_tri_uv(uv, st, st0, st1, st2);
CLAMP(uv[0], 0.0f, 1.0f);
@@ -726,15 +731,17 @@ static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
get_ccgdm_data(lores_dm, hires_dm, height_data->origindex, lvl, face_index, uv[0], uv[1], p1, 0);
- if(height_data->ssdm) {
+ if (height_data->ssdm) {
get_ccgdm_data(lores_dm, height_data->ssdm, height_data->origindex, 0, face_index, uv[0], uv[1], p0, n);
- } else {
+ }
+ else {
lores_dm->getTessFace(lores_dm, face_index, &mface);
- if(mface.v4) {
+ if (mface.v4) {
interp_bilinear_mface(lores_dm, &mface, uv[0], uv[1], 1, p0);
interp_bilinear_mface(lores_dm, &mface, uv[0], uv[1], 0, n);
- } else {
+ }
+ else {
interp_barycentric_mface(lores_dm, &mface, uv[0], uv[1], 1, p0);
interp_barycentric_mface(lores_dm, &mface, uv[0], uv[1], 0, n);
}
@@ -744,25 +751,26 @@ static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
len= dot_v3v3(n, vec);
height_data->heights[pixel]= len;
- if(len<height_data->height_min) height_data->height_min= len;
- if(len>height_data->height_max) height_data->height_max= len;
+ if (len<height_data->height_min) height_data->height_min= len;
+ if (len>height_data->height_max) height_data->height_max= len;
- if(ibuf->rect_float) {
+ if (ibuf->rect_float) {
float *rrgbf= ibuf->rect_float + pixel*4;
rrgbf[3]= 1.0f;
ibuf->userflags= IB_RECT_INVALID;
- } else {
+ }
+ else {
char *rrgb= (char*)ibuf->rect + pixel*4;
rrgb[3]= 255;
}
}
/* 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)
@@ -782,10 +790,11 @@ static void apply_tangmat_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
st1= mtface[face_index].uv[1];
st2= mtface[face_index].uv[2];
- if(mface.v4) {
+ if (mface.v4) {
st3= mtface[face_index].uv[3];
resolve_quad_uv(uv, st, st0, st1, st2, st3);
- } else
+ }
+ else
resolve_tri_uv(uv, st, st0, st1, st2);
CLAMP(uv[0], 0.0f, 1.0f);
@@ -798,7 +807,7 @@ static void apply_tangmat_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
mul_v3_fl(vec, 0.5);
add_v3_v3(vec, tmp);
- if(ibuf->rect_float) {
+ if (ibuf->rect_float) {
float *rrgbf= ibuf->rect_float + pixel*4;
rrgbf[0]= vec[0];
rrgbf[1]= vec[1];
@@ -806,7 +815,8 @@ static void apply_tangmat_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
rrgbf[3]= 1.0f;
ibuf->userflags= IB_RECT_INVALID;
- } else {
+ }
+ else {
unsigned char *rrgb= (unsigned char *)ibuf->rect + pixel*4;
rgb_float_to_uchar(rrgb, vec);
rrgb[3]= 255;
@@ -824,12 +834,12 @@ static void count_images(MultiresBakeRender *bkr)
totface= dm->getNumTessFaces(dm);
- for(a= 0; a<totface; a++)
+ for (a= 0; a<totface; a++)
mtface[a].tpage->id.flag&= ~LIB_DOIT;
- for(a= 0; a<totface; a++) {
+ for (a= 0; a<totface; a++) {
Image *ima= mtface[a].tpage;
- if((ima->id.flag&LIB_DOIT)==0) {
+ if ((ima->id.flag&LIB_DOIT)==0) {
LinkData *data= BLI_genericNodeN(ima);
BLI_addtail(&bkr->image, data);
bkr->tot_image++;
@@ -837,7 +847,7 @@ static void count_images(MultiresBakeRender *bkr)
}
}
- for(a= 0; a<totface; a++)
+ for (a= 0; a<totface; a++)
mtface[a].tpage->id.flag&= ~LIB_DOIT;
}
@@ -845,11 +855,11 @@ static void bake_images(MultiresBakeRender *bkr)
{
LinkData *link;
- for(link= bkr->image.first; link; link= link->next) {
+ for (link= bkr->image.first; link; link= link->next) {
Image *ima= (Image*)link->data;
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
- if(ibuf->x>0 && ibuf->y>0) {
+ if (ibuf->x>0 && ibuf->y>0) {
ibuf->userdata= MEM_callocN(ibuf->y*ibuf->x, "MultiresBake imbuf mask");
switch(bkr->mode) {
@@ -871,26 +881,26 @@ static void finish_images(MultiresBakeRender *bkr)
{
LinkData *link;
- for(link= bkr->image.first; link; link= link->next) {
+ for (link= bkr->image.first; link; link= link->next) {
Image *ima= (Image*)link->data;
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
- if(ibuf->x<=0 || ibuf->y<=0)
+ if (ibuf->x<=0 || ibuf->y<=0)
continue;
RE_bake_ibuf_filter(ibuf, (char *)ibuf->userdata, bkr->bake_filter);
ibuf->userflags|= IB_BITMAPDIRTY;
- if(ibuf->rect_float)
+ if (ibuf->rect_float)
ibuf->userflags|= IB_RECT_INVALID;
- if(ibuf->mipmap[0]) {
+ if (ibuf->mipmap[0]) {
ibuf->userflags|= IB_MIPMAP_INVALID;
imb_freemipmapImBuf(ibuf);
}
- if(ibuf->userdata) {
+ if (ibuf->userdata) {
MEM_freeN(ibuf->userdata);
ibuf->userdata= NULL;
}
@@ -915,7 +925,7 @@ static int multiresbake_check(bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
ob= base->object;
- if(ob->type != OB_MESH) {
+ if (ob->type != OB_MESH) {
BKE_report(op->reports, RPT_ERROR, "Basking of multires data only works with active object which is a mesh");
ok= 0;
@@ -926,25 +936,26 @@ static int multiresbake_check(bContext *C, wmOperator *op)
mmd= get_multires_modifier(scene, ob, 0);
/* Multi-resolution should be and be last in the stack */
- if(ok && mmd) {
+ if (ok && mmd) {
ModifierData *md;
ok= mmd->totlvl>0;
- for(md = (ModifierData*)mmd->modifier.next; md && ok; md = md->next) {
+ for (md = (ModifierData*)mmd->modifier.next; md && ok; md = md->next) {
if (modifier_isEnabled(scene, md, eModifierMode_Realtime)) {
ok= 0;
}
}
- } else ok= 0;
+ }
+ else ok= 0;
- if(!ok) {
+ if (!ok) {
BKE_report(op->reports, RPT_ERROR, "Multires data baking requires multi-resolution object");
break;
}
- if(!me->mtpoly) {
+ if (!me->mtpoly) {
BKE_report(op->reports, RPT_ERROR, "Mesh should be unwrapped before multires data baking");
ok= 0;
@@ -954,7 +965,7 @@ static int multiresbake_check(bContext *C, wmOperator *op)
while (ok && a--) {
Image *ima = me->mtpoly[a].tpage;
- if(!ima) {
+ if (!ima) {
BKE_report(op->reports, RPT_ERROR, "You should have active texture to use multires baker");
ok= 0;
@@ -962,25 +973,26 @@ static int multiresbake_check(bContext *C, wmOperator *op)
else {
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
- if(!ibuf) {
+ if (!ibuf) {
BKE_report(op->reports, RPT_ERROR, "Baking should happend to image with image buffer");
ok= 0;
- } else {
- if(ibuf->rect==NULL && ibuf->rect_float==NULL)
+ }
+ else {
+ if (ibuf->rect==NULL && ibuf->rect_float==NULL)
ok= 0;
- if(ibuf->rect_float && !(ibuf->channels==0 || ibuf->channels==4))
+ if (ibuf->rect_float && !(ibuf->channels==0 || ibuf->channels==4))
ok= 0;
- if(!ok)
+ if (!ok)
BKE_report(op->reports, RPT_ERROR, "Baking to unsupported image type");
}
}
}
}
- if(!ok)
+ if (!ok)
break;
}
CTX_DATA_END;
@@ -996,17 +1008,18 @@ static DerivedMesh *multiresbake_create_loresdm(Scene *scene, Object *ob, int *l
*lvl= mmd->lvl;
- if(*lvl==0) {
+ if (*lvl==0) {
DerivedMesh *tmp_dm= CDDM_from_mesh(me, ob);
dm= CDDM_copy(tmp_dm);
tmp_dm->release(tmp_dm);
- } else {
+ }
+ else {
MultiresModifierData tmp_mmd= *mmd;
DerivedMesh *cddm= CDDM_from_mesh(me, ob);
tmp_mmd.lvl= *lvl;
tmp_mmd.sculptlvl= *lvl;
- dm= multires_dm_create_from_derived(&tmp_mmd, 1, cddm, ob, 0, 0);
+ dm= multires_dm_create_from_derived(&tmp_mmd, 1, cddm, ob, 0);
cddm->release(cddm);
}
@@ -1026,7 +1039,7 @@ static DerivedMesh *multiresbake_create_hiresdm(Scene *scene, Object *ob, int *l
tmp_mmd.lvl= mmd->totlvl;
tmp_mmd.sculptlvl= mmd->totlvl;
- dm= multires_dm_create_from_derived(&tmp_mmd, 1, cddm, ob, 0, 0);
+ dm= multires_dm_create_from_derived(&tmp_mmd, 1, cddm, ob, 0);
cddm->release(cddm);
return dm;
@@ -1038,13 +1051,13 @@ static void clear_images(MTFace *mtface, int totface)
const float vec_alpha[4]= {0.0f, 0.0f, 0.0f, 0.0f};
const float vec_solid[4]= {0.0f, 0.0f, 0.0f, 1.0f};
- for(a= 0; a<totface; a++)
+ for (a= 0; a<totface; a++)
mtface[a].tpage->id.flag&= ~LIB_DOIT;
- for(a= 0; a<totface; a++) {
+ for (a= 0; a<totface; a++) {
Image *ima= mtface[a].tpage;
- if((ima->id.flag&LIB_DOIT)==0) {
+ if ((ima->id.flag&LIB_DOIT)==0) {
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? vec_alpha : vec_solid);
@@ -1052,7 +1065,7 @@ static void clear_images(MTFace *mtface, int totface)
}
}
- for(a= 0; a<totface; a++)
+ for (a= 0; a<totface; a++)
mtface[a].tpage->id.flag&= ~LIB_DOIT;
}
@@ -1062,10 +1075,10 @@ static int multiresbake_image_exec_locked(bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C);
int objects_baked= 0;
- if(!multiresbake_check(C, op))
+ if (!multiresbake_check(C, op))
return OPERATOR_CANCELLED;
- if(scene->r.bake_flag&R_BAKE_CLEAR) { /* clear images */
+ if (scene->r.bake_flag&R_BAKE_CLEAR) { /* clear images */
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
Mesh *me;
@@ -1092,7 +1105,7 @@ static int multiresbake_image_exec_locked(bContext *C, wmOperator *op)
/* create low-resolution DM (to bake to) and hi-resolution DM (to bake from) */
bkr.lores_dm= multiresbake_create_loresdm(scene, ob, &bkr.lvl);
- if(!bkr.lores_dm)
+ if (!bkr.lores_dm)
continue;
bkr.hires_dm= multiresbake_create_hiresdm(scene, ob, &bkr.tot_lvl, &bkr.simple);
@@ -1108,7 +1121,7 @@ static int multiresbake_image_exec_locked(bContext *C, wmOperator *op)
}
CTX_DATA_END;
- if(!objects_baked)
+ if (!objects_baked)
BKE_report(op->reports, RPT_ERROR, "No objects found to bake from");
return OPERATOR_FINISHED;
@@ -1135,7 +1148,7 @@ static void init_multiresbake_job(bContext *C, MultiresBakeJob *bkj)
multires_force_update(ob);
lores_dm = multiresbake_create_loresdm(scene, ob, &lvl);
- if(!lores_dm)
+ if (!lores_dm)
continue;
data= MEM_callocN(sizeof(MultiresBakerJobData), "multiresBaker derivedMesh_data");
@@ -1156,8 +1169,8 @@ static void multiresbake_startjob(void *bkv, short *stop, short *do_update, floa
tot_obj= BLI_countlist(&bkj->data);
- if(bkj->bake_clear) { /* clear images */
- for(data= bkj->data.first; data; data= data->next) {
+ if (bkj->bake_clear) { /* clear images */
+ for (data= bkj->data.first; data; data= data->next) {
DerivedMesh *dm= data->lores_dm;
MTFace *mtface= CustomData_get_layer(&dm->faceData, CD_MTFACE);
@@ -1165,7 +1178,7 @@ static void multiresbake_startjob(void *bkv, short *stop, short *do_update, floa
}
}
- for(data= bkj->data.first; data; data= data->next) {
+ for (data= bkj->data.first; data; data= data->next) {
MultiresBakeRender bkr= {0};
/* copy data stored in job descriptor */
@@ -1219,13 +1232,13 @@ static int multiresbake_image_exec(bContext *C, wmOperator *op)
MultiresBakeJob *bkr;
wmJob *steve;
- if(!multiresbake_check(C, op))
+ if (!multiresbake_check(C, op))
return OPERATOR_CANCELLED;
bkr= MEM_callocN(sizeof(MultiresBakeJob), "MultiresBakeJob data");
init_multiresbake_job(C, bkr);
- if(!bkr->data.first) {
+ if (!bkr->data.first) {
BKE_report(op->reports, RPT_ERROR, "No objects found to bake from");
return OPERATOR_CANCELLED;
}
@@ -1283,10 +1296,10 @@ static int test_bake_internal(bContext *C, ReportList *reports)
{
Scene *scene= CTX_data_scene(C);
- if((scene->r.bake_flag & R_BAKE_TO_ACTIVE) && CTX_data_active_object(C)==NULL) {
+ if ((scene->r.bake_flag & R_BAKE_TO_ACTIVE) && CTX_data_active_object(C)==NULL) {
BKE_report(reports, RPT_ERROR, "No active object");
}
- else if(scene->r.bake_mode==RE_BAKE_AO && scene->world==NULL) {
+ else if (scene->r.bake_mode==RE_BAKE_AO && scene->world==NULL) {
BKE_report(reports, RPT_ERROR, "No world set up");
}
else {
@@ -1309,12 +1322,12 @@ static void init_bake_internal(BakeRender *bkr, bContext *C)
bkr->actob= (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT : NULL;
bkr->re= RE_NewRender("_Bake View_");
- if(scene->r.bake_mode==RE_BAKE_AO) {
+ if (scene->r.bake_mode==RE_BAKE_AO) {
/* If raytracing or AO is disabled, switch it on temporarily for baking. */
bkr->prev_wo_amb_occ = (scene->world->mode & WO_AMB_OCC) != 0;
scene->world->mode |= WO_AMB_OCC;
}
- if(scene->r.bake_mode==RE_BAKE_AO || bkr->actob) {
+ if (scene->r.bake_mode==RE_BAKE_AO || bkr->actob) {
bkr->prev_r_raytrace = (scene->r.mode & R_RAYTRACE) != 0;
scene->r.mode |= R_RAYTRACE;
}
@@ -1325,22 +1338,22 @@ static void finish_bake_internal(BakeRender *bkr)
RE_Database_Free(bkr->re);
/* restore raytrace and AO */
- if(bkr->scene->r.bake_mode==RE_BAKE_AO)
- if(bkr->prev_wo_amb_occ == 0)
+ if (bkr->scene->r.bake_mode==RE_BAKE_AO)
+ if (bkr->prev_wo_amb_occ == 0)
bkr->scene->world->mode &= ~WO_AMB_OCC;
- if(bkr->scene->r.bake_mode==RE_BAKE_AO || bkr->actob)
- if(bkr->prev_r_raytrace == 0)
+ if (bkr->scene->r.bake_mode==RE_BAKE_AO || bkr->actob)
+ if (bkr->prev_r_raytrace == 0)
bkr->scene->r.mode &= ~R_RAYTRACE;
- if(bkr->result==BAKE_RESULT_OK) {
+ if (bkr->result==BAKE_RESULT_OK) {
Image *ima;
/* force OpenGL reload and mipmap recalc */
- for(ima= G.main->image.first; ima; ima= ima->id.next) {
- if(ima->ok==IMA_OK_LOADED) {
+ for (ima= G.main->image.first; ima; ima= ima->id.next) {
+ if (ima->ok==IMA_OK_LOADED) {
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
- if(ibuf) {
- if(ibuf->userflags & IB_BITMAPDIRTY) {
+ if (ibuf) {
+ if (ibuf->userflags & IB_BITMAPDIRTY) {
GPU_free_image(ima);
imb_freemipmapImBuf(ibuf);
}
@@ -1389,9 +1402,9 @@ 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)
+ if (sima)
sima->image= RE_bake_shade_get_image();
}
}
@@ -1401,9 +1414,9 @@ static void bake_freejob(void *bkv)
BakeRender *bkr= bkv;
finish_bake_internal(bkr);
- if(bkr->result==BAKE_RESULT_NO_OBJECTS)
+ if (bkr->result==BAKE_RESULT_NO_OBJECTS)
BKE_report(bkr->reports, RPT_ERROR, "No objects or images found to bake to");
- else if(bkr->result==BAKE_RESULT_FEEDBACK_LOOP)
+ else if (bkr->result==BAKE_RESULT_FEEDBACK_LOOP)
BKE_report(bkr->reports, RPT_WARNING, "Feedback loop detected");
MEM_freeN(bkr);
@@ -1414,7 +1427,7 @@ static void bake_freejob(void *bkv)
static int objects_bake_render_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
/* no running blender, remove handler and pass through */
- if(0==WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C)))
+ if (0==WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C)))
return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
/* running render */
@@ -1439,14 +1452,15 @@ static int objects_bake_render_invoke(bContext *C, wmOperator *op, wmEvent *UNUS
Scene *scene= CTX_data_scene(C);
int result= OPERATOR_CANCELLED;
- if(is_multires_bake(scene)) {
+ if (is_multires_bake(scene)) {
result= multiresbake_image_exec(C, op);
- } else {
+ }
+ else {
/* only one render job at a time */
- if(WM_jobs_test(CTX_wm_manager(C), scene))
+ if (WM_jobs_test(CTX_wm_manager(C), scene))
return OPERATOR_CANCELLED;
- if(test_bake_internal(C, op->reports)==0) {
+ if (test_bake_internal(C, op->reports)==0) {
return OPERATOR_CANCELLED;
}
else {
@@ -1488,10 +1502,11 @@ static int bake_image_exec(bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C);
int result= OPERATOR_CANCELLED;
- if(is_multires_bake(scene)) {
+ if (is_multires_bake(scene)) {
result= multiresbake_image_exec_locked(C, op);
- } else {
- if(test_bake_internal(C, op->reports)==0) {
+ }
+ else {
+ if (test_bake_internal(C, op->reports)==0) {
return OPERATOR_CANCELLED;
}
else {
@@ -1511,9 +1526,9 @@ static int bake_image_exec(bContext *C, wmOperator *op)
bkr.ready= 0;
BLI_insert_thread(&threads, &bkr);
- while(bkr.ready==0) {
+ while (bkr.ready==0) {
PIL_sleep_ms(50);
- if(bkr.ready)
+ if (bkr.ready)
break;
/* used to redraw in 2.4x but this is just for exec in 2.5 */
@@ -1522,9 +1537,9 @@ static int bake_image_exec(bContext *C, wmOperator *op)
}
BLI_end_threads(&threads);
- if(bkr.result==BAKE_RESULT_NO_OBJECTS)
+ if (bkr.result==BAKE_RESULT_NO_OBJECTS)
BKE_report(op->reports, RPT_ERROR, "No valid images found to bake to");
- else if(bkr.result==BAKE_RESULT_FEEDBACK_LOOP)
+ else if (bkr.result==BAKE_RESULT_FEEDBACK_LOOP)
BKE_report(op->reports, RPT_ERROR, "Feedback loop detected");
finish_bake_internal(&bkr);
@@ -1541,12 +1556,12 @@ static int bake_image_exec(bContext *C, wmOperator *op)
void OBJECT_OT_bake_image(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Bake";
- ot->description= "Bake image textures of selected objects";
- ot->idname= "OBJECT_OT_bake_image";
+ ot->name = "Bake";
+ ot->description = "Bake image textures of selected objects";
+ ot->idname = "OBJECT_OT_bake_image";
/* api callbacks */
- ot->exec= bake_image_exec;
- ot->invoke= objects_bake_render_invoke;
- ot->modal= objects_bake_render_modal;
+ ot->exec = bake_image_exec;
+ ot->invoke = objects_bake_render_invoke;
+ ot->modal = objects_bake_render_modal;
}
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index a90edb29c29..ec3567454df 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -142,6 +142,7 @@ bConstraint *get_active_constraint (Object *ob)
}
/* -------------- Constraint Management (Add New, Remove, Rename) -------------------- */
+#ifdef WITH_PYTHON
/* ------------- PyConstraints ------------------ */
/* this callback sets the text-file to be used for selected menu item */
@@ -160,7 +161,6 @@ static void validate_pyconstraint_cb (void *arg1, void *arg2)
data->text = text;
}
-#ifdef WITH_PYTHON
/* this returns a string for the list of usable pyconstraint script names */
static char *buildmenu_pyconstraints (Text *con_text, int *pyconindex)
{
@@ -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);
@@ -406,17 +405,17 @@ static void test_constraints (Object *owner, bPoseChannel *pchan)
else if (curcon->type == CONSTRAINT_TYPE_FOLLOWTRACK) {
bFollowTrackConstraint *data = curcon->data;
- if((data->flag&CAMERASOLVER_ACTIVECLIP)==0) {
- if(data->clip != NULL && data->track[0]) {
+ if ((data->flag&CAMERASOLVER_ACTIVECLIP)==0) {
+ if (data->clip != NULL && data->track[0]) {
MovieTracking *tracking= &data->clip->tracking;
MovieTrackingObject *tracking_object;
- if(data->object[0])
+ if (data->object[0])
tracking_object= BKE_tracking_named_object(tracking, data->object);
else
tracking_object= BKE_tracking_get_camera_object(tracking);
- if(!tracking_object) {
+ if (!tracking_object) {
curcon->flag |= CONSTRAINT_DISABLE;
}
else {
@@ -430,13 +429,13 @@ static void test_constraints (Object *owner, bPoseChannel *pchan)
else if (curcon->type == CONSTRAINT_TYPE_CAMERASOLVER) {
bCameraSolverConstraint *data = curcon->data;
- if((data->flag&CAMERASOLVER_ACTIVECLIP)==0 && data->clip == NULL)
+ if ((data->flag&CAMERASOLVER_ACTIVECLIP)==0 && data->clip == NULL)
curcon->flag |= CONSTRAINT_DISABLE;
}
else if (curcon->type == CONSTRAINT_TYPE_OBJECTSOLVER) {
bObjectSolverConstraint *data = curcon->data;
- if((data->flag&CAMERASOLVER_ACTIVECLIP)==0 && data->clip == NULL)
+ if ((data->flag&CAMERASOLVER_ACTIVECLIP)==0 && data->clip == NULL)
curcon->flag |= CONSTRAINT_DISABLE;
}
@@ -590,19 +589,19 @@ static bConstraint *edit_constraint_property_get(wmOperator *op, Object *ob, int
if (pchan)
list = &pchan->constraints;
else {
- //if (G.f & G_DEBUG)
+ //if (G.debug & G_DEBUG)
//printf("edit_constraint_property_get: No active bone for object '%s'\n", (ob)? ob->id.name+2 : "<None>");
return NULL;
}
}
else {
- //if (G.f & G_DEBUG)
+ //if (G.debug & G_DEBUG)
//printf("edit_constraint_property_get: defaulting to getting list in the standard way\n");
list = get_active_constraints(ob);
}
con = constraints_findByName(list, constraint_name);
- //if (G.f & G_DEBUG)
+ //if (G.debug & G_DEBUG)
//printf("constraint found = %p, %s\n", (void *)con, (con)?con->name:"<Not found>");
if (con && (type != 0) && (con->type != type))
@@ -645,16 +644,16 @@ static int stretchto_reset_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(e
void CONSTRAINT_OT_stretchto_reset (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reset Original Length";
- ot->idname= "CONSTRAINT_OT_stretchto_reset";
- ot->description= "Reset original length of bone for Stretch To Constraint";
+ ot->name = "Reset Original Length";
+ ot->idname = "CONSTRAINT_OT_stretchto_reset";
+ ot->description = "Reset original length of bone for Stretch To Constraint";
- ot->exec= stretchto_reset_exec;
- ot->invoke= stretchto_reset_invoke;
- ot->poll= edit_constraint_poll;
+ ot->exec = stretchto_reset_exec;
+ ot->invoke = stretchto_reset_invoke;
+ ot->poll = edit_constraint_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_constraint_properties(ot);
}
@@ -688,16 +687,16 @@ static int limitdistance_reset_invoke(bContext *C, wmOperator *op, wmEvent *UNUS
void CONSTRAINT_OT_limitdistance_reset (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reset Distance";
- ot->idname= "CONSTRAINT_OT_limitdistance_reset";
- ot->description= "Reset limiting distance for Limit Distance Constraint";
+ ot->name = "Reset Distance";
+ ot->idname = "CONSTRAINT_OT_limitdistance_reset";
+ ot->description = "Reset limiting distance for Limit Distance Constraint";
- ot->exec= limitdistance_reset_exec;
- ot->invoke= limitdistance_reset_invoke;
- ot->poll= edit_constraint_poll;
+ ot->exec = limitdistance_reset_exec;
+ ot->invoke = limitdistance_reset_invoke;
+ ot->poll = edit_constraint_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_constraint_properties(ot);
}
@@ -814,16 +813,16 @@ static int childof_set_inverse_invoke(bContext *C, wmOperator *op, wmEvent *UNUS
void CONSTRAINT_OT_childof_set_inverse (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Inverse";
- ot->idname= "CONSTRAINT_OT_childof_set_inverse";
- ot->description= "Set inverse correction for ChildOf constraint";
+ ot->name = "Set Inverse";
+ ot->idname = "CONSTRAINT_OT_childof_set_inverse";
+ ot->description = "Set inverse correction for ChildOf constraint";
- ot->exec= childof_set_inverse_exec;
- ot->invoke= childof_set_inverse_invoke;
- ot->poll= edit_constraint_poll;
+ ot->exec = childof_set_inverse_exec;
+ ot->invoke = childof_set_inverse_invoke;
+ ot->poll = edit_constraint_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_constraint_properties(ot);
}
@@ -834,7 +833,7 @@ static int childof_clear_inverse_exec (bContext *C, wmOperator *op)
bConstraint *con = edit_constraint_property_get(op, ob, CONSTRAINT_TYPE_CHILDOF);
bChildOfConstraint *data= (con) ? (bChildOfConstraint *)con->data : NULL;
- if(data==NULL) {
+ if (data==NULL) {
BKE_report(op->reports, RPT_ERROR, "Childof constraint not found");
return OPERATOR_CANCELLED;
}
@@ -858,16 +857,16 @@ static int childof_clear_inverse_invoke(bContext *C, wmOperator *op, wmEvent *UN
void CONSTRAINT_OT_childof_clear_inverse (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Inverse";
- ot->idname= "CONSTRAINT_OT_childof_clear_inverse";
- ot->description= "Clear inverse correction for ChildOf constraint";
+ ot->name = "Clear Inverse";
+ ot->idname = "CONSTRAINT_OT_childof_clear_inverse";
+ ot->description = "Clear inverse correction for ChildOf constraint";
- ot->exec= childof_clear_inverse_exec;
- ot->invoke= childof_clear_inverse_invoke;
- ot->poll= edit_constraint_poll;
+ ot->exec = childof_clear_inverse_exec;
+ ot->invoke = childof_clear_inverse_invoke;
+ ot->poll = edit_constraint_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_constraint_properties(ot);
}
@@ -905,16 +904,16 @@ static int objectsolver_set_inverse_invoke(bContext *C, wmOperator *op, wmEvent
void CONSTRAINT_OT_objectsolver_set_inverse (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Inverse";
- ot->idname= "CONSTRAINT_OT_objectsolver_set_inverse";
- ot->description= "Set inverse correction for ObjectSolver constraint";
+ ot->name = "Set Inverse";
+ ot->idname = "CONSTRAINT_OT_objectsolver_set_inverse";
+ ot->description = "Set inverse correction for ObjectSolver constraint";
- ot->exec= objectsolver_set_inverse_exec;
- ot->invoke= objectsolver_set_inverse_invoke;
- ot->poll= edit_constraint_poll;
+ ot->exec = objectsolver_set_inverse_exec;
+ ot->invoke = objectsolver_set_inverse_invoke;
+ ot->poll = edit_constraint_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_constraint_properties(ot);
}
@@ -924,7 +923,7 @@ static int objectsolver_clear_inverse_exec (bContext *C, wmOperator *op)
bConstraint *con = edit_constraint_property_get(op, ob, CONSTRAINT_TYPE_OBJECTSOLVER);
bObjectSolverConstraint *data= (con) ? (bObjectSolverConstraint *)con->data : NULL;
- if(data==NULL) {
+ if (data==NULL) {
BKE_report(op->reports, RPT_ERROR, "Childof constraint not found");
return OPERATOR_CANCELLED;
}
@@ -948,16 +947,16 @@ static int objectsolver_clear_inverse_invoke(bContext *C, wmOperator *op, wmEven
void CONSTRAINT_OT_objectsolver_clear_inverse (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Inverse";
- ot->idname= "CONSTRAINT_OT_objectsolver_clear_inverse";
- ot->description= "Clear inverse correction for ObjectSolver constraint";
+ ot->name = "Clear Inverse";
+ ot->idname = "CONSTRAINT_OT_objectsolver_clear_inverse";
+ ot->description = "Clear inverse correction for ObjectSolver constraint";
- ot->exec= objectsolver_clear_inverse_exec;
- ot->invoke= objectsolver_clear_inverse_invoke;
- ot->poll= edit_constraint_poll;
+ ot->exec = objectsolver_clear_inverse_exec;
+ ot->invoke = objectsolver_clear_inverse_invoke;
+ ot->poll = edit_constraint_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_constraint_properties(ot);
}
@@ -978,11 +977,11 @@ void ED_object_constraint_set_active(Object *ob, bConstraint *con)
void ED_object_constraint_update(Object *ob)
{
- if(ob->pose) update_pose_constraint_flags(ob->pose);
+ if (ob->pose) update_pose_constraint_flags(ob->pose);
object_test_constraints(ob);
- if(ob->type==OB_ARMATURE) DAG_id_tag_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB);
+ if (ob->type==OB_ARMATURE) DAG_id_tag_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB);
else DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
@@ -990,7 +989,7 @@ void ED_object_constraint_dependency_update(Main *bmain, Scene *scene, Object *o
{
ED_object_constraint_update(ob);
- if(ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels
+ if (ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels
DAG_scene_sort(bmain, scene);
}
@@ -1016,7 +1015,7 @@ static int constraint_delete_exec (bContext *C, wmOperator *UNUSED(op))
ED_object_constraint_update(ob); /* needed to set the flags on posebones correctly */
/* ITASC needs to be rebuilt once a constraint is removed [#26920] */
- if(is_ik) {
+ if (is_ik) {
BIK_clear_data(ob->pose);
}
@@ -1034,16 +1033,16 @@ static int constraint_delete_exec (bContext *C, wmOperator *UNUSED(op))
void CONSTRAINT_OT_delete (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Constraint";
- ot->idname= "CONSTRAINT_OT_delete";
- ot->description= "Remove constraint from constraint stack";
+ ot->name = "Delete Constraint";
+ ot->idname = "CONSTRAINT_OT_delete";
+ ot->description = "Remove constraint from constraint stack";
/* callbacks */
- ot->exec= constraint_delete_exec;
- ot->poll= constraint_poll;
+ ot->exec = constraint_delete_exec;
+ ot->poll = constraint_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int constraint_move_down_exec (bContext *C, wmOperator *op)
@@ -1079,17 +1078,17 @@ static int constraint_move_down_invoke(bContext *C, wmOperator *op, wmEvent *UNU
void CONSTRAINT_OT_move_down (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move Constraint Down";
- ot->idname= "CONSTRAINT_OT_move_down";
- ot->description= "Move constraint down in constraint stack";
+ ot->name = "Move Constraint Down";
+ ot->idname = "CONSTRAINT_OT_move_down";
+ ot->description = "Move constraint down in constraint stack";
/* callbacks */
- ot->exec= constraint_move_down_exec;
- ot->invoke= constraint_move_down_invoke;
- ot->poll= edit_constraint_poll;
+ ot->exec = constraint_move_down_exec;
+ ot->invoke = constraint_move_down_invoke;
+ ot->poll = edit_constraint_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_constraint_properties(ot);
}
@@ -1126,17 +1125,17 @@ static int constraint_move_up_invoke(bContext *C, wmOperator *op, wmEvent *UNUSE
void CONSTRAINT_OT_move_up (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move Constraint Up";
- ot->idname= "CONSTRAINT_OT_move_up";
- ot->description= "Move constraint up in constraint stack";
+ ot->name = "Move Constraint Up";
+ ot->idname = "CONSTRAINT_OT_move_up";
+ ot->description = "Move constraint up in constraint stack";
/* callbacks */
- ot->exec= constraint_move_up_exec;
- ot->invoke= constraint_move_up_invoke;
- ot->poll= edit_constraint_poll;
+ ot->exec = constraint_move_up_exec;
+ ot->invoke = constraint_move_up_invoke;
+ ot->poll = edit_constraint_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_constraint_properties(ot);
}
@@ -1161,7 +1160,7 @@ static int pose_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op))
/* force depsgraph to get recalculated since relationships removed */
DAG_scene_sort(bmain, scene); /* sort order of objects */
- /* note, calling BIK_clear_data() isnt needed here */
+ /* note, calling BIK_clear_data() isn't needed here */
/* do updates */
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -1174,12 +1173,12 @@ void POSE_OT_constraints_clear(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Clear Pose Constraints";
- ot->idname= "POSE_OT_constraints_clear";
- ot->description= "Clear all the constraints for the selected bones";
+ ot->idname = "POSE_OT_constraints_clear";
+ ot->description = "Clear all the constraints for the selected bones";
/* callbacks */
- ot->exec= pose_constraints_clear_exec;
- ot->poll= ED_operator_posemode; // XXX - do we want to ensure there are selected bones too?
+ ot->exec = pose_constraints_clear_exec;
+ ot->poll = ED_operator_posemode; // XXX - do we want to ensure there are selected bones too?
}
@@ -1209,12 +1208,12 @@ void OBJECT_OT_constraints_clear(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Clear Object Constraints";
- ot->idname= "OBJECT_OT_constraints_clear";
- ot->description= "Clear all the constraints for the active Object only";
+ ot->idname = "OBJECT_OT_constraints_clear";
+ ot->description = "Clear all the constraints for the active Object only";
/* callbacks */
- ot->exec= object_constraints_clear_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = object_constraints_clear_exec;
+ ot->poll = ED_operator_object_active_editable;
}
/************************ copy all constraints operators *********************/
@@ -1254,16 +1253,16 @@ static int pose_constraint_copy_exec(bContext *C, wmOperator *op)
void POSE_OT_constraints_copy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Constraints to Selected";
- ot->idname= "POSE_OT_constraints_copy";
+ ot->name = "Copy Constraints to Selected";
+ ot->idname = "POSE_OT_constraints_copy";
ot->description = "Copy constraints to other selected bones";
/* api callbacks */
- ot->exec= pose_constraint_copy_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_constraint_copy_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int object_constraint_copy_exec(bContext *C, wmOperator *UNUSED(op))
@@ -1295,16 +1294,16 @@ static int object_constraint_copy_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_constraints_copy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Constraints to Selected";
- ot->idname= "OBJECT_OT_constraints_copy";
+ ot->name = "Copy Constraints to Selected";
+ ot->idname = "OBJECT_OT_constraints_copy";
ot->description = "Copy constraints to other selected objects";
/* api callbacks */
- ot->exec= object_constraint_copy_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = object_constraint_copy_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ add constraint operators *********************/
@@ -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);
@@ -1610,77 +1609,77 @@ static int pose_constraint_add_exec(bContext *C, wmOperator *op)
void OBJECT_OT_constraint_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Constraint";
+ ot->name = "Add Constraint";
ot->description = "Add a constraint to the active object";
- ot->idname= "OBJECT_OT_constraint_add";
+ ot->idname = "OBJECT_OT_constraint_add";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= object_constraint_add_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = object_constraint_add_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", "");
}
void OBJECT_OT_constraint_add_with_targets(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Constraint (with Targets)";
+ ot->name = "Add Constraint (with Targets)";
ot->description = "Add a constraint to the active object, with target (where applicable) set to the selected Objects/Bones";
- ot->idname= "OBJECT_OT_constraint_add_with_targets";
+ ot->idname = "OBJECT_OT_constraint_add_with_targets";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= object_constraint_add_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = object_constraint_add_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", "");
}
void POSE_OT_constraint_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Constraint";
+ ot->name = "Add Constraint";
ot->description = "Add a constraint to the active bone";
- ot->idname= "POSE_OT_constraint_add";
+ ot->idname = "POSE_OT_constraint_add";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= pose_constraint_add_exec;
- ot->poll= ED_operator_posemode;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = pose_constraint_add_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", "");
}
void POSE_OT_constraint_add_with_targets(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Constraint (with Targets)";
+ ot->name = "Add Constraint (with Targets)";
ot->description = "Add a constraint to the active bone, with target (where applicable) set to the selected Objects/Bones";
- ot->idname= "POSE_OT_constraint_add_with_targets";
+ ot->idname = "POSE_OT_constraint_add_with_targets";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= pose_constraint_add_exec;
- ot->poll= ED_operator_posemode;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = pose_constraint_add_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", "");
}
/************************ IK Constraint operators *********************/
@@ -1753,17 +1752,17 @@ static int pose_ik_add_exec(bContext *C, wmOperator *op)
void POSE_OT_ik_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add IK to Bone";
- ot->description= "Add IK Constraint to the active Bone";
- ot->idname= "POSE_OT_ik_add";
+ ot->name = "Add IK to Bone";
+ ot->description = "Add IK Constraint to the active Bone";
+ ot->idname = "POSE_OT_ik_add";
/* api callbacks */
- ot->invoke= pose_ik_add_invoke;
- ot->exec= pose_ik_add_exec;
- ot->poll= ED_operator_posemode;
+ ot->invoke = pose_ik_add_invoke;
+ ot->exec = pose_ik_add_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "with_targets", 1, "With Targets", "Assign IK Constraint with targets derived from the select bones/objects");
@@ -1804,15 +1803,15 @@ static int pose_ik_clear_exec(bContext *C, wmOperator *UNUSED(op))
void POSE_OT_ik_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove IK";
- ot->description= "Remove all IK Constraints from selected bones";
- ot->idname= "POSE_OT_ik_clear";
+ ot->name = "Remove IK";
+ ot->description = "Remove all IK Constraints from selected bones";
+ ot->idname = "POSE_OT_ik_clear";
/* api callbacks */
- ot->exec= pose_ik_clear_exec;
- ot->poll= ED_operator_posemode;
+ ot->exec = pose_ik_clear_exec;
+ ot->poll = ED_operator_posemode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 11ceda8a61f..2fbc2966bc8 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -121,7 +121,7 @@ Object *ED_object_context(bContext *C)
Object *ED_object_active_context(bContext *C)
{
Object *ob= NULL;
- if(C) {
+ if (C) {
ob= ED_object_context(C);
if (!ob) ob= CTX_data_active_object(C);
}
@@ -140,8 +140,8 @@ static int object_hide_view_clear_exec(bContext *C, wmOperator *UNUSED(op))
int changed = 0;
/* XXX need a context loop to handle such cases */
- for(base = FIRSTBASE; base; base=base->next) {
- if((base->lay & v3d->lay) && base->object->restrictflag & OB_RESTRICT_VIEW) {
+ for (base = FIRSTBASE; base; base=base->next) {
+ if ((base->lay & v3d->lay) && base->object->restrictflag & OB_RESTRICT_VIEW) {
base->flag |= SELECT;
base->object->flag = base->flag;
base->object->restrictflag &= ~OB_RESTRICT_VIEW;
@@ -161,16 +161,16 @@ void OBJECT_OT_hide_view_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Restrict View";
+ ot->name = "Clear Restrict View";
ot->description = "Reveal the object by setting the hide flag";
- ot->idname= "OBJECT_OT_hide_view_clear";
+ ot->idname = "OBJECT_OT_hide_view_clear";
/* api callbacks */
- ot->exec= object_hide_view_clear_exec;
- ot->poll= ED_operator_view3d_active;
+ ot->exec = object_hide_view_clear_exec;
+ ot->poll = ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int object_hide_view_set_exec(bContext *C, wmOperator *op)
@@ -181,7 +181,7 @@ static int object_hide_view_set_exec(bContext *C, wmOperator *op)
const int unselected= RNA_boolean_get(op->ptr, "unselected");
CTX_DATA_BEGIN(C, Base*, base, visible_bases) {
- if(!unselected) {
+ if (!unselected) {
if (base->flag & SELECT) {
base->flag &= ~SELECT;
base->object->flag = base->flag;
@@ -215,16 +215,16 @@ static int object_hide_view_set_exec(bContext *C, wmOperator *op)
void OBJECT_OT_hide_view_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Restrict View";
+ ot->name = "Set Restrict View";
ot->description = "Hide the object by setting the hide flag";
- ot->idname= "OBJECT_OT_hide_view_set";
+ ot->idname = "OBJECT_OT_hide_view_set";
/* api callbacks */
- ot->exec= object_hide_view_set_exec;
- ot->poll= ED_operator_view3d_active;
+ ot->exec = object_hide_view_set_exec;
+ ot->poll = ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects");
@@ -237,14 +237,14 @@ static int object_hide_render_clear_exec(bContext *C, wmOperator *UNUSED(op))
/* XXX need a context loop to handle such cases */
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
- if(ob->restrictflag & OB_RESTRICT_RENDER) {
+ if (ob->restrictflag & OB_RESTRICT_RENDER) {
ob->restrictflag &= ~OB_RESTRICT_RENDER;
changed= 1;
}
}
CTX_DATA_END;
- if(changed)
+ if (changed)
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_OUTLINER, NULL);
return OPERATOR_FINISHED;
@@ -254,16 +254,16 @@ void OBJECT_OT_hide_render_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Restrict Render";
+ ot->name = "Clear Restrict Render";
ot->description = "Reveal the render object by setting the hide render flag";
- ot->idname= "OBJECT_OT_hide_render_clear";
+ ot->idname = "OBJECT_OT_hide_render_clear";
/* api callbacks */
- ot->exec= object_hide_render_clear_exec;
- ot->poll= ED_operator_view3d_active;
+ ot->exec = object_hide_render_clear_exec;
+ ot->poll = ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int object_hide_render_set_exec(bContext *C, wmOperator *op)
@@ -271,7 +271,7 @@ static int object_hide_render_set_exec(bContext *C, wmOperator *op)
const int unselected= RNA_boolean_get(op->ptr, "unselected");
CTX_DATA_BEGIN(C, Base*, base, visible_bases) {
- if(!unselected) {
+ if (!unselected) {
if (base->flag & SELECT) {
base->object->restrictflag |= OB_RESTRICT_RENDER;
}
@@ -290,16 +290,16 @@ static int object_hide_render_set_exec(bContext *C, wmOperator *op)
void OBJECT_OT_hide_render_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Restrict Render";
+ ot->name = "Set Restrict Render";
ot->description = "Hide the render object by setting the hide render flag";
- ot->idname= "OBJECT_OT_hide_render_set";
+ ot->idname = "OBJECT_OT_hide_render_set";
/* api callbacks */
- ot->exec= object_hide_render_set_exec;
- ot->poll= ED_operator_view3d_active;
+ ot->exec = object_hide_render_set_exec;
+ ot->poll = ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects");
}
@@ -314,55 +314,55 @@ void ED_object_exit_editmode(bContext *C, int flag)
Object *obedit= CTX_data_edit_object(C);
int freedata = flag & EM_FREEDATA;
- if(obedit==NULL) return;
+ if (obedit==NULL) return;
- if(flag & EM_WAITCURSOR) waitcursor(1);
- if(obedit->type==OB_MESH) {
+ if (flag & EM_WAITCURSOR) waitcursor(1);
+ if (obedit->type==OB_MESH) {
Mesh *me= obedit->data;
-// if(EM_texFaceCheck())
+// if (EM_texFaceCheck())
- if(me->edit_btmesh->bm->totvert>MESH_MAX_VERTS) {
+ if (me->edit_btmesh->bm->totvert>MESH_MAX_VERTS) {
error("Too many vertices");
return;
}
- EDBM_LoadEditBMesh(scene, obedit);
+ EDBM_mesh_load(obedit);
- if(freedata) {
- EDBM_FreeEditBMesh(me->edit_btmesh);
+ if (freedata) {
+ EDBM_mesh_free(me->edit_btmesh);
MEM_freeN(me->edit_btmesh);
me->edit_btmesh= NULL;
}
- if(obedit->restore_mode & OB_MODE_WEIGHT_PAINT) {
+ if (obedit->restore_mode & OB_MODE_WEIGHT_PAINT) {
mesh_octree_table(NULL, NULL, NULL, 'e');
mesh_mirrtopo_table(NULL, 'e');
}
}
else if (obedit->type==OB_ARMATURE) {
ED_armature_from_edit(obedit);
- if(freedata)
+ if (freedata)
ED_armature_edit_free(obedit);
}
- else if(ELEM(obedit->type, OB_CURVE, OB_SURF)) {
+ else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
load_editNurb(obedit);
- if(freedata) free_editNurb(obedit);
+ if (freedata) free_editNurb(obedit);
}
- else if(obedit->type==OB_FONT && freedata) {
+ else if (obedit->type==OB_FONT && freedata) {
load_editText(obedit);
- if(freedata) free_editText(obedit);
+ if (freedata) free_editText(obedit);
}
- else if(obedit->type==OB_LATTICE) {
+ else if (obedit->type==OB_LATTICE) {
load_editLatt(obedit);
- if(freedata) free_editLatt(obedit);
+ if (freedata) free_editLatt(obedit);
}
- else if(obedit->type==OB_MBALL) {
+ else if (obedit->type==OB_MBALL) {
load_editMball(obedit);
- if(freedata) free_editMball(obedit);
+ if (freedata) free_editMball(obedit);
}
/* freedata only 0 now on file saves and render */
- if(freedata) {
+ if (freedata) {
ListBase pidlist;
PTCacheID *pid;
@@ -371,8 +371,8 @@ void ED_object_exit_editmode(bContext *C, int flag)
/* flag object caches as outdated */
BKE_ptcache_ids_from_object(&pidlist, obedit, NULL, 0);
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->type != PTCACHE_TYPE_PARTICLES) /* particles don't need reset on geometry change */
+ for (pid=pidlist.first; pid; pid=pid->next) {
+ if (pid->type != PTCACHE_TYPE_PARTICLES) /* particles don't need reset on geometry change */
pid->cache->flag |= PTCACHE_OUTDATED;
}
BLI_freelistN(&pidlist);
@@ -382,10 +382,10 @@ void ED_object_exit_editmode(bContext *C, int flag)
/* also flush ob recalc, doesn't take much overhead, but used for particles */
DAG_id_tag_update(&obedit->id, OB_RECALC_OB|OB_RECALC_DATA);
- if(flag & EM_DO_UNDO)
+ if (flag & EM_DO_UNDO)
ED_undo_push(C, "Editmode");
- if(flag & EM_WAITCURSOR) waitcursor(0);
+ if (flag & EM_WAITCURSOR) waitcursor(0);
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, scene);
@@ -403,17 +403,17 @@ void ED_object_enter_editmode(bContext *C, int flag)
View3D *v3d= NULL;
int ok= 0;
- if(scene->id.lib) return;
+ if (scene->id.lib) return;
- if(sa && sa->spacetype==SPACE_VIEW3D)
+ if (sa && sa->spacetype==SPACE_VIEW3D)
v3d= sa->spacedata.first;
- if((flag & EM_IGNORE_LAYER)==0) {
+ if ((flag & EM_IGNORE_LAYER)==0) {
base= CTX_data_active_base(C); /* active layer checked here for view3d */
- if(base==NULL) return;
- else if(v3d && (base->lay & v3d->lay)==0) return;
- else if(!v3d && (base->lay & scene->lay)==0) return;
+ if (base==NULL) return;
+ else if (v3d && (base->lay & v3d->lay)==0) return;
+ else if (!v3d && (base->lay & scene->lay)==0) return;
}
else {
base= scene->basact;
@@ -428,22 +428,32 @@ void ED_object_enter_editmode(bContext *C, int flag)
return;
}
- if(flag & EM_WAITCURSOR) waitcursor(1);
+ if (flag & EM_WAITCURSOR) waitcursor(1);
ob->restore_mode = ob->mode;
/* note, when switching scenes the object can have editmode data but
* not be scene->obedit: bug 22954, this avoids calling self eternally */
- if((ob->restore_mode & OB_MODE_EDIT)==0)
+ if ((ob->restore_mode & OB_MODE_EDIT)==0)
ED_object_toggle_modes(C, ob->mode);
ob->mode= OB_MODE_EDIT;
- if(ob->type==OB_MESH) {
+ if (ob->type==OB_MESH) {
+ BMEditMesh *em;
ok= 1;
- scene->obedit= ob; // context sees this
-
- EDBM_MakeEditBMesh(CTX_data_tool_settings(C), scene, ob);
+ scene->obedit = ob; /* context sees this */
+
+ EDBM_mesh_make(CTX_data_tool_settings(C), scene, ob);
+
+ em = BMEdit_FromObject(ob);
+ if (LIKELY(em)) {
+ /* order doesn't matter */
+ EDBM_mesh_normals_update(em);
+ BMEdit_RecalcTessellation(em);
+
+ BM_mesh_select_mode_flush(em->bm);
+ }
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_EDITMODE_MESH, scene);
}
@@ -453,12 +463,12 @@ 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.
*/
- if(arm->id.lib) {
+ if (arm->id.lib) {
error_libdata();
return;
}
@@ -470,28 +480,28 @@ void ED_object_enter_editmode(bContext *C, int flag)
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_EDITMODE_ARMATURE, scene);
}
- else if(ob->type==OB_FONT) {
+ else if (ob->type==OB_FONT) {
scene->obedit= ob; // XXX for context
ok= 1;
make_editText(ob);
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_EDITMODE_TEXT, scene);
}
- else if(ob->type==OB_MBALL) {
+ else if (ob->type==OB_MBALL) {
scene->obedit= ob; // XXX for context
ok= 1;
make_editMball(ob);
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_EDITMODE_MBALL, scene);
}
- else if(ob->type==OB_LATTICE) {
+ else if (ob->type==OB_LATTICE) {
scene->obedit= ob; // XXX for context
ok= 1;
make_editLatt(ob);
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_EDITMODE_LATTICE, scene);
}
- else if(ob->type==OB_SURF || ob->type==OB_CURVE) {
+ else if (ob->type==OB_SURF || ob->type==OB_CURVE) {
ok= 1;
scene->obedit= ob; // XXX for context
make_editNurb(ob);
@@ -499,7 +509,7 @@ void ED_object_enter_editmode(bContext *C, int flag)
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_EDITMODE_CURVE, scene);
}
- if(ok) {
+ if (ok) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
else {
@@ -508,15 +518,15 @@ void ED_object_enter_editmode(bContext *C, int flag)
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, scene);
}
- if(flag & EM_DO_UNDO) ED_undo_push(C, "Enter Editmode");
- if(flag & EM_WAITCURSOR) waitcursor(0);
+ if (flag & EM_DO_UNDO) ED_undo_push(C, "Enter Editmode");
+ if (flag & EM_WAITCURSOR) waitcursor(0);
}
static int editmode_toggle_exec(bContext *C, wmOperator *UNUSED(op))
{
ToolSettings *toolsettings = CTX_data_tool_settings(C);
- if(!CTX_data_edit_object(C))
+ if (!CTX_data_edit_object(C))
ED_object_enter_editmode(C, EM_WAITCURSOR);
else
ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* had EM_DO_UNDO but op flag calls undo too [#24685] */
@@ -531,7 +541,7 @@ static int editmode_toggle_poll(bContext *C)
Object *ob = CTX_data_active_object(C);
/* covers proxies too */
- if(ELEM(NULL, ob, ob->data) || ((ID *)ob->data)->lib)
+ if (ELEM(NULL, ob, ob->data) || ((ID *)ob->data)->lib)
return 0;
if (ob->restrictflag & OB_RESTRICT_VIEW)
@@ -547,17 +557,17 @@ void OBJECT_OT_editmode_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Editmode";
+ ot->name = "Toggle Editmode";
ot->description = "Toggle object's editmode";
- ot->idname= "OBJECT_OT_editmode_toggle";
+ ot->idname = "OBJECT_OT_editmode_toggle";
/* api callbacks */
- ot->exec= editmode_toggle_exec;
+ ot->exec = editmode_toggle_exec;
- ot->poll= editmode_toggle_poll;
+ ot->poll = editmode_toggle_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* *************************** */
@@ -566,12 +576,12 @@ static int posemode_exec(bContext *C, wmOperator *UNUSED(op))
{
Base *base= CTX_data_active_base(C);
- if(base->object->type==OB_ARMATURE) {
- if(base->object==CTX_data_edit_object(C)) {
+ if (base->object->type==OB_ARMATURE) {
+ if (base->object==CTX_data_edit_object(C)) {
ED_object_exit_editmode(C, EM_FREEDATA|EM_DO_UNDO);
ED_armature_enter_posemode(C, base);
}
- else if(base->object->mode & OB_MODE_POSE)
+ else if (base->object->mode & OB_MODE_POSE)
ED_armature_exit_posemode(C, base);
else
ED_armature_enter_posemode(C, base);
@@ -585,16 +595,16 @@ static int posemode_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_posemode_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Pose Mode";
- ot->idname= "OBJECT_OT_posemode_toggle";
- ot->description= "Enable or disable posing/selecting bones";
+ ot->name = "Toggle Pose Mode";
+ ot->idname = "OBJECT_OT_posemode_toggle";
+ ot->description = "Enable or disable posing/selecting bones";
/* api callbacks */
- ot->exec= posemode_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = posemode_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flag */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob)
@@ -606,7 +616,7 @@ static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob)
char *str;
prop= ob->prop.first;
- while(prop) {
+ while (prop) {
tot++;
prop= prop->next;
}
@@ -620,7 +630,7 @@ static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob)
tot= 0;
prop= ob->prop.first;
- while(prop) {
+ while (prop) {
tot++;
strcat(str, "|");
strcat(str, prop->name);
@@ -630,23 +640,25 @@ static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob)
nr= pupmenu(str);
if ( nr==1 || nr==2 ) {
- for(base= FIRSTBASE; base; base= base->next) {
- if((base != BASACT) &&(TESTBASELIB(v3d, base))) {
+ for (base= FIRSTBASE; base; base= base->next) {
+ if ((base != BASACT) &&(TESTBASELIB(v3d, base))) {
if (nr==1) { /* replace */
copy_properties( &base->object->prop, &ob->prop );
- } else {
- for(prop = ob->prop.first; prop; prop= prop->next ) {
+ }
+ else {
+ for (prop = ob->prop.first; prop; prop= prop->next ) {
set_ob_property(base->object, prop);
}
}
}
}
- } else if(nr>0) {
+ }
+ else if (nr>0) {
prop = BLI_findlink(&ob->prop, nr-4); /* account for first 3 menu items & menu index starting at 1*/
- if(prop) {
- for(base= FIRSTBASE; base; base= base->next) {
- if((base != BASACT) &&(TESTBASELIB(v3d, base))) {
+ if (prop) {
+ for (base= FIRSTBASE; base; base= base->next) {
+ if ((base != BASACT) &&(TESTBASELIB(v3d, base))) {
set_ob_property(base->object, prop);
}
}
@@ -661,9 +673,9 @@ static void copymenu_logicbricks(Scene *scene, View3D *v3d, Object *ob)
//XXX no longer used - to be removed - replaced by logicbricks_copy_exec
Base *base;
- for(base= FIRSTBASE; base; base= base->next) {
- if(base->object != ob) {
- if(TESTBASELIB(v3d, base)) {
+ for (base= FIRSTBASE; base; base= base->next) {
+ if (base->object != ob) {
+ if (TESTBASELIB(v3d, base)) {
/* first: free all logic */
free_sensors(&base->object->sensors);
@@ -697,7 +709,7 @@ static void copy_texture_space(Object *to, Object *ob)
float *poin1= NULL, *poin2= NULL;
short texflag= 0;
- if(ob->type==OB_MESH) {
+ if (ob->type==OB_MESH) {
texflag= ((Mesh *)ob->data)->texflag;
poin2= ((Mesh *)ob->data)->loc;
}
@@ -705,14 +717,14 @@ static void copy_texture_space(Object *to, Object *ob)
texflag= ((Curve *)ob->data)->texflag;
poin2= ((Curve *)ob->data)->loc;
}
- else if(ob->type==OB_MBALL) {
+ else if (ob->type==OB_MBALL) {
texflag= ((MetaBall *)ob->data)->texflag;
poin2= ((MetaBall *)ob->data)->loc;
}
else
return;
- if(to->type==OB_MESH) {
+ if (to->type==OB_MESH) {
((Mesh *)to->data)->texflag= texflag;
poin1= ((Mesh *)to->data)->loc;
}
@@ -720,7 +732,7 @@ static void copy_texture_space(Object *to, Object *ob)
((Curve *)to->data)->texflag= texflag;
poin1= ((Curve *)to->data)->loc;
}
- else if(to->type==OB_MBALL) {
+ else if (to->type==OB_MBALL) {
((MetaBall *)to->data)->texflag= texflag;
poin1= ((MetaBall *)to->data)->loc;
}
@@ -729,7 +741,7 @@ static void copy_texture_space(Object *to, Object *ob)
memcpy(poin1, poin2, 9*sizeof(float)); /* this was noted in DNA_mesh, curve, mball */
- if(to->type==OB_MESH) {
+ if (to->type==OB_MESH) {
/* pass */
}
else if (to->type == OB_MBALL) {
@@ -741,7 +753,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;
@@ -750,58 +762,58 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
Nurb *nu;
int do_scene_sort= 0;
- if(scene->id.lib) return;
+ if (scene->id.lib) return;
- if(!(ob=OBACT)) return;
+ if (!(ob=OBACT)) return;
- if(scene->obedit) { // XXX get from context
+ if (scene->obedit) { // XXX get from context
/* obedit_copymenu(); */
return;
}
- if(event==9) {
+ if (event==9) {
copymenu_properties(scene, v3d, ob);
return;
}
- else if(event==10) {
+ else if (event==10) {
copymenu_logicbricks(scene, v3d, ob);
return;
}
- else if(event==24) {
+ else if (event==24) {
/* moved to object_link_modifiers */
/* copymenu_modifiers(bmain, scene, v3d, ob); */
return;
}
- for(base= FIRSTBASE; base; base= base->next) {
- if(base != BASACT) {
- if(TESTBASELIB(v3d, base)) {
+ for (base= FIRSTBASE; base; base= base->next) {
+ if (base != BASACT) {
+ if (TESTBASELIB(v3d, base)) {
base->object->recalc |= OB_RECALC_OB;
- if(event==1) { /* loc */
+ if (event==1) { /* loc */
copy_v3_v3(base->object->loc, ob->loc);
copy_v3_v3(base->object->dloc, ob->dloc);
}
- else if(event==2) { /* rot */
+ else if (event==2) { /* rot */
copy_v3_v3(base->object->rot, ob->rot);
copy_v3_v3(base->object->drot, ob->drot);
copy_qt_qt(base->object->quat, ob->quat);
copy_qt_qt(base->object->dquat, ob->dquat);
}
- else if(event==3) { /* size */
+ else if (event==3) { /* size */
copy_v3_v3(base->object->size, ob->size);
copy_v3_v3(base->object->dscale, ob->dscale);
}
- else if(event==4) { /* drawtype */
+ else if (event==4) { /* drawtype */
base->object->dt= ob->dt;
base->object->dtx= ob->dtx;
base->object->empty_drawtype= ob->empty_drawtype;
base->object->empty_drawsize= ob->empty_drawsize;
}
- else if(event==5) { /* time offs */
+ else if (event==5) { /* time offs */
base->object->sf= ob->sf;
}
- else if(event==6) { /* dupli */
+ else if (event==6) { /* dupli */
base->object->dupon= ob->dupon;
base->object->dupoff= ob->dupoff;
base->object->dupsta= ob->dupsta;
@@ -811,17 +823,17 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
base->object->transflag |= (ob->transflag & OB_DUPLI);
base->object->dup_group= ob->dup_group;
- if(ob->dup_group)
+ if (ob->dup_group)
id_lib_extern(&ob->dup_group->id);
}
- else if(event==7) { /* mass */
+ else if (event==7) { /* mass */
base->object->mass= ob->mass;
}
- else if(event==8) { /* damping */
+ else if (event==8) { /* damping */
base->object->damping= ob->damping;
base->object->rdamping= ob->rdamping;
}
- else if(event==11) { /* all physical attributes */
+ else if (event==11) { /* all physical attributes */
base->object->gameflag = ob->gameflag;
base->object->inertia = ob->inertia;
base->object->formfactor = ob->formfactor;
@@ -836,12 +848,12 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
base->object->bsoft= copy_bulletsoftbody(ob->bsoft);
}
- else if(event==17) { /* tex space */
+ else if (event==17) { /* tex space */
copy_texture_space(base->object, ob);
}
- else if(event==18) { /* font settings */
+ else if (event==18) { /* font settings */
- if(base->object->type==ob->type) {
+ if (base->object->type==ob->type) {
cu= ob->data;
cu1= base->object->data;
@@ -856,16 +868,16 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
cu1->wordspace= cu->wordspace;
cu1->ulpos= cu->ulpos;
cu1->ulheight= cu->ulheight;
- if(cu1->vfont) cu1->vfont->id.us--;
+ if (cu1->vfont) cu1->vfont->id.us--;
cu1->vfont= cu->vfont;
id_us_plus((ID *)cu1->vfont);
- if(cu1->vfontb) cu1->vfontb->id.us--;
+ if (cu1->vfontb) cu1->vfontb->id.us--;
cu1->vfontb= cu->vfontb;
id_us_plus((ID *)cu1->vfontb);
- if(cu1->vfonti) cu1->vfonti->id.us--;
+ if (cu1->vfonti) cu1->vfonti->id.us--;
cu1->vfonti= cu->vfonti;
id_us_plus((ID *)cu1->vfonti);
- if(cu1->vfontbi) cu1->vfontbi->id.us--;
+ if (cu1->vfontbi) cu1->vfontbi->id.us--;
cu1->vfontbi= cu->vfontbi;
id_us_plus((ID *)cu1->vfontbi);
@@ -877,9 +889,9 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
base->object->recalc |= OB_RECALC_DATA;
}
}
- else if(event==19) { /* bevel settings */
+ else if (event==19) { /* bevel settings */
- if(ELEM(base->object->type, OB_CURVE, OB_FONT)) {
+ if (ELEM(base->object->type, OB_CURVE, OB_FONT)) {
cu= ob->data;
cu1= base->object->data;
@@ -893,9 +905,9 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
base->object->recalc |= OB_RECALC_DATA;
}
}
- else if(event==25) { /* curve resolution */
+ else if (event==25) { /* curve resolution */
- if(ELEM(base->object->type, OB_CURVE, OB_FONT)) {
+ if (ELEM(base->object->type, OB_CURVE, OB_FONT)) {
cu= ob->data;
cu1= base->object->data;
@@ -904,7 +916,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
nu= cu1->nurb.first;
- while(nu) {
+ while (nu) {
nu->resolu= cu1->resolu;
nu= nu->next;
}
@@ -912,7 +924,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
base->object->recalc |= OB_RECALC_DATA;
}
}
- else if(event==21) {
+ else if (event==21) {
if (base->object->type==OB_MESH) {
ModifierData *md = modifiers_findByType(ob, eModifierType_Subsurf);
@@ -929,15 +941,15 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
}
}
}
- else if(event==22) {
+ else if (event==22) {
/* Copy the constraint channels over */
copy_constraints(&base->object->constraints, &ob->constraints, TRUE);
do_scene_sort= 1;
}
- else if(event==23) {
+ else if (event==23) {
base->object->softflag= ob->softflag;
- if(base->object->soft) sbFree(base->object->soft);
+ if (base->object->soft) sbFree(base->object->soft);
base->object->soft= copy_softbody(ob->soft);
@@ -945,47 +957,47 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
BLI_addhead(&base->object->modifiers, modifier_new(eModifierType_Softbody));
}
}
- else if(event==26) {
+ else if (event==26) {
#if 0 // XXX old animation system
copy_nlastrips(&base->object->nlastrips, &ob->nlastrips);
#endif // XXX old animation system
}
- else if(event==27) { /* autosmooth */
+ else if (event==27) { /* autosmooth */
if (base->object->type==OB_MESH) {
Mesh *me= ob->data;
Mesh *cme= base->object->data;
cme->smoothresh= me->smoothresh;
- if(me->flag & ME_AUTOSMOOTH)
+ if (me->flag & ME_AUTOSMOOTH)
cme->flag |= ME_AUTOSMOOTH;
else
cme->flag &= ~ME_AUTOSMOOTH;
}
}
- else if(event==28) { /* UV orco */
- if(ELEM(base->object->type, OB_CURVE, OB_SURF)) {
+ else if (event==28) { /* UV orco */
+ if (ELEM(base->object->type, OB_CURVE, OB_SURF)) {
cu= ob->data;
cu1= base->object->data;
- if(cu->flag & CU_UV_ORCO)
+ if (cu->flag & CU_UV_ORCO)
cu1->flag |= CU_UV_ORCO;
else
cu1->flag &= ~CU_UV_ORCO;
}
}
- else if(event==29) { /* protected bits */
+ else if (event==29) { /* protected bits */
base->object->protectflag= ob->protectflag;
}
- else if(event==30) { /* index object */
+ else if (event==30) { /* index object */
base->object->index= ob->index;
}
- else if(event==31) { /* object color */
+ else if (event==31) { /* object color */
copy_v4_v4(base->object->col, ob->col);
}
}
}
}
- if(do_scene_sort)
+ if (do_scene_sort)
DAG_scene_sort(bmain, scene);
DAG_ids_flush_update(bmain, 0);
@@ -997,7 +1009,7 @@ static void UNUSED_FUNCTION(copy_attr_menu)(Main *bmain, Scene *scene, View3D *v
short event;
char str[512];
- if(!(ob=OBACT)) return;
+ if (!(ob=OBACT)) return;
if (scene->obedit) { // XXX get from context
// if (ob->type == OB_MESH)
@@ -1023,27 +1035,27 @@ static void UNUSED_FUNCTION(copy_attr_menu)(Main *bmain, Scene *scene, View3D *v
// strcat(str, "|Texture Space%x17");
// }
- if(ob->type == OB_FONT) strcat(str, "|Font Settings%x18|Bevel Settings%x19");
- if(ob->type == OB_CURVE) strcat(str, "|Bevel Settings%x19|UV Orco%x28");
+ if (ob->type == OB_FONT) strcat(str, "|Font Settings%x18|Bevel Settings%x19");
+ if (ob->type == OB_CURVE) strcat(str, "|Bevel Settings%x19|UV Orco%x28");
- if((ob->type == OB_FONT) || (ob->type == OB_CURVE)) {
+ if ((ob->type == OB_FONT) || (ob->type == OB_CURVE)) {
strcat(str, "|Curve Resolution%x25");
}
- if(ob->type==OB_MESH) {
+ if (ob->type==OB_MESH) {
strcat(str, "|Subsurf Settings%x21|AutoSmooth%x27");
}
- if(ob->soft) strcat(str, "|Soft Body Settings%x23");
+ if (ob->soft) strcat(str, "|Soft Body Settings%x23");
strcat(str, "|Pass Index%x30");
- if(ob->type==OB_MESH || ob->type==OB_CURVE || ob->type==OB_LATTICE || ob->type==OB_SURF) {
+ if (ob->type==OB_MESH || ob->type==OB_CURVE || ob->type==OB_LATTICE || ob->type==OB_SURF) {
strcat(str, "|Modifiers ...%x24");
}
event= pupmenu(str);
- if(event<= 0) return;
+ if (event<= 0) return;
copy_attr(bmain, scene, v3d, event);
}
@@ -1054,10 +1066,10 @@ static int forcefield_toggle_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob = CTX_data_active_object(C);
- if(ob->pd == NULL)
+ if (ob->pd == NULL)
ob->pd = object_add_collision_fields(PFIELD_FORCE);
- if(ob->pd->forcefield == 0)
+ if (ob->pd->forcefield == 0)
ob->pd->forcefield = PFIELD_FORCE;
else
ob->pd->forcefield = 0;
@@ -1071,16 +1083,16 @@ void OBJECT_OT_forcefield_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Force Field";
+ ot->name = "Toggle Force Field";
ot->description = "Toggle object's force field";
- ot->idname= "OBJECT_OT_forcefield_toggle";
+ ot->idname = "OBJECT_OT_forcefield_toggle";
/* api callbacks */
- ot->exec= forcefield_toggle_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = forcefield_toggle_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ********************************************** */
@@ -1137,16 +1149,16 @@ static int object_calculate_paths_exec (bContext *C, wmOperator *op)
void OBJECT_OT_paths_calculate (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Calculate Object Paths";
- ot->idname= "OBJECT_OT_paths_calculate";
- ot->description= "Calculate paths for the selected bones";
+ ot->name = "Calculate Object Paths";
+ ot->idname = "OBJECT_OT_paths_calculate";
+ ot->description = "Calculate paths for the selected bones";
/* api callbacks */
- ot->exec= object_calculate_paths_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = object_calculate_paths_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* --------- */
@@ -1181,13 +1193,13 @@ static int object_clear_paths_exec (bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_paths_clear (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Object Paths";
- ot->idname= "OBJECT_OT_paths_clear";
- ot->description= "Clear path caches for selected bones";
+ ot->name = "Clear Object Paths";
+ ot->idname = "OBJECT_OT_paths_clear";
+ ot->description = "Clear path caches for selected bones";
/* api callbacks */
- ot->exec= object_clear_paths_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = object_clear_paths_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1205,7 +1217,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
- if(ob->type==OB_MESH) {
+ if (ob->type==OB_MESH) {
mesh_set_smooth_flag(ob, !clear);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -1213,11 +1225,11 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
done= 1;
}
- else if ELEM(ob->type, OB_SURF, OB_CURVE) {
+ else if (ELEM(ob->type, OB_SURF, OB_CURVE)) {
cu= ob->data;
- for(nu=cu->nurb.first; nu; nu=nu->next) {
- if(!clear) nu->flag |= ME_SMOOTH;
+ for (nu=cu->nurb.first; nu; nu=nu->next) {
+ if (!clear) nu->flag |= ME_SMOOTH;
else nu->flag &= ~ME_SMOOTH;
}
@@ -1240,31 +1252,31 @@ static int shade_poll(bContext *C)
void OBJECT_OT_shade_flat(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Shade Flat";
- ot->description= "Display faces 'flat'";
- ot->idname= "OBJECT_OT_shade_flat";
+ ot->name = "Shade Flat";
+ ot->description = "Display faces 'flat'";
+ ot->idname = "OBJECT_OT_shade_flat";
/* api callbacks */
- ot->poll= shade_poll;
- ot->exec= shade_smooth_exec;
+ ot->poll = shade_poll;
+ ot->exec = shade_smooth_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
void OBJECT_OT_shade_smooth(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Shade Smooth";
- ot->description= "Display faces 'smooth' (using vertex normals)";
- ot->idname= "OBJECT_OT_shade_smooth";
+ ot->name = "Shade Smooth";
+ ot->description = "Display faces 'smooth' (using vertex normals)";
+ ot->idname = "OBJECT_OT_shade_smooth";
/* api callbacks */
- ot->poll= shade_poll;
- ot->exec= shade_smooth_exec;
+ ot->poll = shade_poll;
+ ot->exec = shade_smooth_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ********************** */
@@ -1279,31 +1291,31 @@ static void UNUSED_FUNCTION(image_aspect)(Scene *scene, View3D *v3d)
float x, y, space;
int a, b, done;
- if(scene->obedit) return; // XXX get from context
- if(scene->id.lib) return;
+ if (scene->obedit) return; // XXX get from context
+ if (scene->id.lib) return;
- for(base= FIRSTBASE; base; base= base->next) {
- if(TESTBASELIB(v3d, base)) {
+ for (base= FIRSTBASE; base; base= base->next) {
+ if (TESTBASELIB(v3d, base)) {
ob= base->object;
done= 0;
- for(a=1; a<=ob->totcol; a++) {
+ for (a=1; a<=ob->totcol; a++) {
ma= give_current_material(ob, a);
- if(ma) {
- for(b=0; b<MAX_MTEX; b++) {
- if(ma->mtex[b] && ma->mtex[b]->tex) {
+ if (ma) {
+ for (b=0; b<MAX_MTEX; b++) {
+ if (ma->mtex[b] && ma->mtex[b]->tex) {
tex= ma->mtex[b]->tex;
- if(tex->type==TEX_IMAGE && tex->ima) {
+ if (tex->type==TEX_IMAGE && tex->ima) {
ImBuf *ibuf= BKE_image_get_ibuf(tex->ima, NULL);
/* texturespace */
space= 1.0;
- if(ob->type==OB_MESH) {
+ if (ob->type==OB_MESH) {
float size[3];
mesh_get_texspace(ob->data, NULL, NULL, size);
space= size[0]/size[1];
}
- else if(ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
+ else if (ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
Curve *cu= ob->data;
space= cu->size[0]/cu->size[1];
}
@@ -1311,17 +1323,17 @@ static void UNUSED_FUNCTION(image_aspect)(Scene *scene, View3D *v3d)
x= ibuf->x/space;
y= ibuf->y;
- if(x>y) ob->size[0]= ob->size[1]*x/y;
+ if (x>y) ob->size[0]= ob->size[1]*x/y;
else ob->size[1]= ob->size[0]*y/x;
done= 1;
DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
}
- if(done) break;
+ if (done) break;
}
}
- if(done) break;
+ if (done) break;
}
}
}
@@ -1336,12 +1348,12 @@ static EnumPropertyItem *object_mode_set_itemsf(bContext *C, PointerRNA *UNUSED(
Object *ob;
int totitem= 0;
- if(!C) /* needed for docs */
+ if (!C) /* needed for docs */
return object_mode_items;
ob = CTX_data_active_object(C);
- while(ob && input->identifier) {
- if((input->value == OB_MODE_EDIT && ((ob->type == OB_MESH) || (ob->type == OB_ARMATURE) ||
+ while (ob && input->identifier) {
+ if ((input->value == OB_MODE_EDIT && ((ob->type == OB_MESH) || (ob->type == OB_ARMATURE) ||
(ob->type == OB_CURVE) || (ob->type == OB_SURF) ||
(ob->type == OB_FONT) || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) ||
(input->value == OB_MODE_POSE && (ob->type == OB_ARMATURE)) ||
@@ -1362,19 +1374,19 @@ static EnumPropertyItem *object_mode_set_itemsf(bContext *C, PointerRNA *UNUSED(
static const char *object_mode_op_string(int mode)
{
- if(mode & OB_MODE_EDIT)
+ if (mode & OB_MODE_EDIT)
return "OBJECT_OT_editmode_toggle";
- if(mode == OB_MODE_SCULPT)
+ if (mode == OB_MODE_SCULPT)
return "SCULPT_OT_sculptmode_toggle";
- if(mode == OB_MODE_VERTEX_PAINT)
+ if (mode == OB_MODE_VERTEX_PAINT)
return "PAINT_OT_vertex_paint_toggle";
- if(mode == OB_MODE_WEIGHT_PAINT)
+ if (mode == OB_MODE_WEIGHT_PAINT)
return "PAINT_OT_weight_paint_toggle";
- if(mode == OB_MODE_TEXTURE_PAINT)
+ if (mode == OB_MODE_TEXTURE_PAINT)
return "PAINT_OT_texture_paint_toggle";
- if(mode == OB_MODE_PARTICLE_EDIT)
+ if (mode == OB_MODE_PARTICLE_EDIT)
return "PARTICLE_OT_particle_edit_toggle";
- if(mode == OB_MODE_POSE)
+ if (mode == OB_MODE_POSE)
return "OBJECT_OT_posemode_toggle";
return NULL;
}
@@ -1385,27 +1397,27 @@ static int object_mode_set_compat(bContext *UNUSED(C), wmOperator *op, Object *o
{
ObjectMode mode = RNA_enum_get(op->ptr, "mode");
- if(ob) {
- if(mode == OB_MODE_OBJECT)
+ if (ob) {
+ if (mode == OB_MODE_OBJECT)
return 1;
switch(ob->type) {
case OB_MESH:
- if(mode & (OB_MODE_EDIT|OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT|OB_MODE_PARTICLE_EDIT))
+ if (mode & (OB_MODE_EDIT|OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT|OB_MODE_PARTICLE_EDIT))
return 1;
return 0;
case OB_CURVE:
case OB_SURF:
case OB_FONT:
case OB_MBALL:
- if(mode & (OB_MODE_EDIT))
+ if (mode & (OB_MODE_EDIT))
return 1;
return 0;
case OB_LATTICE:
- if(mode & (OB_MODE_EDIT|OB_MODE_WEIGHT_PAINT))
+ if (mode & (OB_MODE_EDIT|OB_MODE_WEIGHT_PAINT))
return 1;
case OB_ARMATURE:
- if(mode & (OB_MODE_EDIT|OB_MODE_POSE))
+ if (mode & (OB_MODE_EDIT|OB_MODE_POSE))
return 1;
}
}
@@ -1420,23 +1432,23 @@ static int object_mode_set_exec(bContext *C, wmOperator *op)
ObjectMode restore_mode = (ob) ? ob->mode : OB_MODE_OBJECT;
int toggle = RNA_boolean_get(op->ptr, "toggle");
- if(!ob || !object_mode_set_compat(C, op, ob))
+ if (!ob || !object_mode_set_compat(C, op, ob))
return OPERATOR_PASS_THROUGH;
/* Exit current mode if it's not the mode we're setting */
- if(ob->mode != OB_MODE_OBJECT && ob->mode != mode)
+ if (ob->mode != OB_MODE_OBJECT && ob->mode != mode)
WM_operator_name_call(C, object_mode_op_string(ob->mode), WM_OP_EXEC_REGION_WIN, NULL);
- if(mode != OB_MODE_OBJECT) {
+ if (mode != OB_MODE_OBJECT) {
/* Enter new mode */
- if(ob->mode != mode || toggle)
+ if (ob->mode != mode || toggle)
WM_operator_name_call(C, object_mode_op_string(mode), WM_OP_EXEC_REGION_WIN, NULL);
- if(toggle) {
- if(ob->mode == mode)
+ if (toggle) {
+ if (ob->mode == mode)
/* For toggling, store old mode so we know what to go back to */
ob->restore_mode = restore_mode;
- else if(ob->restore_mode != OB_MODE_OBJECT && ob->restore_mode != mode) {
+ else if (ob->restore_mode != OB_MODE_OBJECT && ob->restore_mode != mode) {
WM_operator_name_call(C, object_mode_op_string(ob->restore_mode), WM_OP_EXEC_REGION_WIN, NULL);
}
}
@@ -1450,17 +1462,17 @@ void OBJECT_OT_mode_set(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Set Object Mode";
+ ot->name = "Set Object Mode";
ot->description = "Sets the object interaction mode";
- ot->idname= "OBJECT_OT_mode_set";
+ ot->idname = "OBJECT_OT_mode_set";
/* api callbacks */
- ot->exec= object_mode_set_exec;
+ ot->exec = object_mode_set_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= 0; /* no register/undo here, leave it to operators being called */
+ ot->flag = 0; /* no register/undo here, leave it to operators being called */
prop= RNA_def_enum(ot->srna, "mode", object_mode_items, OB_MODE_OBJECT, "Mode", "");
RNA_def_enum_funcs(prop, object_mode_set_itemsf);
@@ -1472,19 +1484,19 @@ void OBJECT_OT_mode_set(wmOperatorType *ot)
void ED_object_toggle_modes(bContext *C, int mode)
{
- if(mode & OB_MODE_SCULPT)
+ if (mode & OB_MODE_SCULPT)
WM_operator_name_call(C, "SCULPT_OT_sculptmode_toggle", WM_OP_EXEC_REGION_WIN, NULL);
- if(mode & OB_MODE_VERTEX_PAINT)
+ if (mode & OB_MODE_VERTEX_PAINT)
WM_operator_name_call(C, "PAINT_OT_vertex_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
- if(mode & OB_MODE_WEIGHT_PAINT)
+ if (mode & OB_MODE_WEIGHT_PAINT)
WM_operator_name_call(C, "PAINT_OT_weight_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
- if(mode & OB_MODE_TEXTURE_PAINT)
+ if (mode & OB_MODE_TEXTURE_PAINT)
WM_operator_name_call(C, "PAINT_OT_texture_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
- if(mode & OB_MODE_PARTICLE_EDIT)
+ if (mode & OB_MODE_PARTICLE_EDIT)
WM_operator_name_call(C, "PARTICLE_OT_particle_edit_toggle", WM_OP_EXEC_REGION_WIN, NULL);
- if(mode & OB_MODE_POSE)
+ if (mode & OB_MODE_POSE)
WM_operator_name_call(C, "OBJECT_OT_posemode_toggle", WM_OP_EXEC_REGION_WIN, NULL);
- if(mode & OB_MODE_EDIT)
+ if (mode & OB_MODE_EDIT)
WM_operator_name_call(C, "OBJECT_OT_editmode_toggle", WM_OP_EXEC_REGION_WIN, NULL);
}
@@ -1515,16 +1527,16 @@ static int game_property_new(bContext *C, wmOperator *op)
void OBJECT_OT_game_property_new(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "New Game Property";
- ot->description= "Create a new property available to the game engine";
- ot->idname= "OBJECT_OT_game_property_new";
+ ot->name = "New Game Property";
+ ot->description = "Create a new property available to the game engine";
+ ot->idname = "OBJECT_OT_game_property_new";
/* api callbacks */
- ot->exec= game_property_new;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = game_property_new;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "type", gameproperty_type_items, GPROP_FLOAT, "Type", "Type of game property to add");
RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the game property to add");
@@ -1536,12 +1548,12 @@ static int game_property_remove(bContext *C, wmOperator *op)
bProperty *prop;
int index= RNA_int_get(op->ptr, "index");
- if(!ob)
+ if (!ob)
return OPERATOR_CANCELLED;
prop= BLI_findlink(&ob->prop, index);
- if(prop) {
+ if (prop) {
BLI_remlink(&ob->prop, prop);
free_property(prop);
@@ -1556,16 +1568,16 @@ static int game_property_remove(bContext *C, wmOperator *op)
void OBJECT_OT_game_property_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Game Property";
- ot->description= "Remove game property";
- ot->idname= "OBJECT_OT_game_property_remove";
+ ot->name = "Remove Game Property";
+ ot->description = "Remove game property";
+ ot->idname = "OBJECT_OT_game_property_remove";
/* api callbacks */
- ot->exec= game_property_remove;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = game_property_remove;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "Property index to remove ", 0, INT_MAX);
}
@@ -1591,10 +1603,10 @@ static EnumPropertyItem *gameprops_itemf(bContext *C, PointerRNA *UNUSED(ptr), P
bProperty *prop;
int a, totitem= 0;
- if(!ob)
+ if (!ob)
return gameprops_items;
- for(a=1, prop= ob->prop.first; prop; prop=prop->next, a++) {
+ for (a=1, prop= ob->prop.first; prop; prop=prop->next, a++) {
tmp.value= a;
tmp.identifier= prop->name;
tmp.name= prop->name;
@@ -1614,10 +1626,10 @@ static int game_property_copy_exec(bContext *C, wmOperator *op)
int type = RNA_enum_get(op->ptr, "operation");
int propid= RNA_enum_get(op->ptr, "property");
- if(propid > 0) { /* copy */
+ if (propid > 0) { /* copy */
prop = BLI_findlink(&ob->prop, propid-1);
- if(prop) {
+ if (prop) {
CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
if (ob != ob_iter)
set_ob_property(ob_iter, prop);
@@ -1633,7 +1645,7 @@ static int game_property_copy_exec(bContext *C, wmOperator *op)
/* merge - the default when calling with no argument */
else
- for(prop = ob->prop.first; prop; prop= prop->next)
+ for (prop = ob->prop.first; prop; prop= prop->next)
set_ob_property(ob_iter, prop);
}
}
@@ -1647,20 +1659,20 @@ void OBJECT_OT_game_property_copy(wmOperatorType *ot)
{
PropertyRNA *prop;
/* identifiers */
- ot->name= "Copy Game Property";
- ot->idname= "OBJECT_OT_game_property_copy";
+ ot->name = "Copy Game Property";
+ ot->idname = "OBJECT_OT_game_property_copy";
/* api callbacks */
- ot->exec= game_property_copy_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = game_property_copy_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "operation", game_properties_copy_operations, 3, "Operation", "");
prop=RNA_def_enum(ot->srna, "property", gameprops_items, 0, "Property", "Properties to copy");
RNA_def_enum_funcs(prop, gameprops_itemf);
- ot->prop=prop;
+ ot->prop = prop;
}
static int game_property_clear_exec(bContext *C, wmOperator *UNUSED(op))
@@ -1676,15 +1688,15 @@ static int game_property_clear_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_game_property_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Game Property";
- ot->idname= "OBJECT_OT_game_property_clear";
+ ot->name = "Clear Game Property";
+ ot->idname = "OBJECT_OT_game_property_clear";
/* api callbacks */
- ot->exec= game_property_clear_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = game_property_clear_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ Copy Logic Bricks ***********************/
@@ -1694,7 +1706,7 @@ static int logicbricks_copy_exec(bContext *C, wmOperator *UNUSED(op))
Object *ob=ED_object_active_context(C);
CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
- if(ob != ob_iter) {
+ if (ob != ob_iter) {
/* first: free all logic */
free_sensors(&ob_iter->sensors);
unlink_controllers(&ob_iter->controllers);
@@ -1717,7 +1729,7 @@ static int logicbricks_copy_exec(bContext *C, wmOperator *UNUSED(op))
ob_iter->state= ob->state;
ob_iter->init_state= ob->init_state;
- if(ob_iter->totcol==ob->totcol) {
+ if (ob_iter->totcol==ob->totcol) {
ob_iter->actcol= ob->actcol;
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob_iter);
}
@@ -1733,16 +1745,16 @@ static int logicbricks_copy_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_logic_bricks_copy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Logic Bricks to Selected";
+ ot->name = "Copy Logic Bricks to Selected";
ot->description = "Copy logic bricks to other selected objects";
- ot->idname= "OBJECT_OT_logic_bricks_copy";
+ ot->idname = "OBJECT_OT_logic_bricks_copy";
/* api callbacks */
- ot->exec= logicbricks_copy_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = logicbricks_copy_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int game_physics_copy_exec(bContext *C, wmOperator *UNUSED(op))
@@ -1750,7 +1762,7 @@ static int game_physics_copy_exec(bContext *C, wmOperator *UNUSED(op))
Object *ob=ED_object_active_context(C);
CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
- if(ob != ob_iter) {
+ if (ob != ob_iter) {
ob_iter->gameflag = ob->gameflag;
ob_iter->gameflag2 = ob->gameflag2;
ob_iter->inertia = ob->inertia;
@@ -1767,7 +1779,7 @@ static int game_physics_copy_exec(bContext *C, wmOperator *UNUSED(op))
ob_iter->collision_boundtype = ob->collision_boundtype;
ob_iter->margin = ob->margin;
ob_iter->bsoft = copy_bulletsoftbody(ob->bsoft);
- if(ob->restrictflag & OB_RESTRICT_RENDER)
+ if (ob->restrictflag & OB_RESTRICT_RENDER)
ob_iter->restrictflag |= OB_RESTRICT_RENDER;
else
ob_iter->restrictflag &= ~OB_RESTRICT_RENDER;
@@ -1781,14 +1793,14 @@ static int game_physics_copy_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_game_physics_copy(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Game Physics Properties to Selected";
+ ot->name = "Copy Game Physics Properties to Selected";
ot->description = "Copy game physics properties to other selected objects";
- ot->idname= "OBJECT_OT_game_physics_copy";
+ ot->idname = "OBJECT_OT_game_physics_copy";
/* api callbacks */
- ot->exec= game_physics_copy_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = game_physics_copy_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c
index 1b8c0fd0840..34410b87e79 100644
--- a/source/blender/editors/object/object_group.c
+++ b/source/blender/editors/object/object_group.c
@@ -67,13 +67,13 @@ static int objects_add_active_exec(bContext *C, wmOperator *op)
Group *group;
int ok = 0;
- if(!ob) return OPERATOR_CANCELLED;
+ 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)) {
+ for (group= bmain->group.first; group; group=group->id.next) {
+ if (object_in_group(ob, group)) {
/* Assign groups to selected objects */
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
add_to_group(group, base->object, scene, base);
@@ -83,7 +83,7 @@ static int objects_add_active_exec(bContext *C, wmOperator *op)
}
}
- if(!ok) BKE_report(op->reports, RPT_ERROR, "Active Object contains no groups");
+ if (!ok) BKE_report(op->reports, RPT_ERROR, "Active Object contains no groups");
DAG_scene_sort(bmain, scene);
WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL);
@@ -94,16 +94,16 @@ static int objects_add_active_exec(bContext *C, wmOperator *op)
void GROUP_OT_objects_add_active(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Selected To Active Group";
+ ot->name = "Add Selected To Active Group";
ot->description = "Add the object to an object group that contains the active object";
- ot->idname= "GROUP_OT_objects_add_active";
+ ot->idname = "GROUP_OT_objects_add_active";
/* api callbacks */
- ot->exec= objects_add_active_exec;
- ot->poll= ED_operator_objectmode;
+ ot->exec = objects_add_active_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int objects_remove_active_exec(bContext *C, wmOperator *op)
@@ -114,13 +114,13 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op)
Group *group;
int ok = 0;
- if(!ob) return OPERATOR_CANCELLED;
+ 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)) {
+ for (group= bmain->group.first; group; group=group->id.next) {
+ if (object_in_group(ob, group)) {
/* Assign groups to selected objects */
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
rem_from_group(group, base->object, scene, base);
@@ -130,7 +130,7 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op)
}
}
- if(!ok) BKE_report(op->reports, RPT_ERROR, "Active Object contains no groups");
+ if (!ok) BKE_report(op->reports, RPT_ERROR, "Active Object contains no groups");
DAG_scene_sort(bmain, scene);
WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL);
@@ -141,16 +141,16 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op)
void GROUP_OT_objects_remove_active(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Selected From Active Group";
+ ot->name = "Remove Selected From Active Group";
ot->description = "Remove the object from an object group that contains the active object";
- ot->idname= "GROUP_OT_objects_remove_active";
+ ot->idname = "GROUP_OT_objects_remove_active";
/* api callbacks */
- ot->exec= objects_remove_active_exec;
- ot->poll= ED_operator_objectmode;
+ ot->exec = objects_remove_active_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int group_objects_remove_exec(bContext *C, wmOperator *UNUSED(op))
@@ -161,7 +161,7 @@ static int group_objects_remove_exec(bContext *C, wmOperator *UNUSED(op))
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
group = NULL;
- while((group = find_group(base->object, group)))
+ while ((group = find_group(base->object, group)))
rem_from_group(group, base->object, scene, base);
}
CTX_DATA_END;
@@ -175,16 +175,16 @@ static int group_objects_remove_exec(bContext *C, wmOperator *UNUSED(op))
void GROUP_OT_objects_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove From Groups";
+ ot->name = "Remove From Groups";
ot->description = "Remove selected objects from all groups";
- ot->idname= "GROUP_OT_objects_remove";
+ ot->idname = "GROUP_OT_objects_remove";
/* api callbacks */
- ot->exec= group_objects_remove_exec;
- ot->poll= ED_operator_objectmode;
+ ot->exec = group_objects_remove_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int group_create_exec(bContext *C, wmOperator *op)
@@ -212,16 +212,16 @@ static int group_create_exec(bContext *C, wmOperator *op)
void GROUP_OT_create(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Create New Group";
+ ot->name = "Create New Group";
ot->description = "Create an object group from selected objects";
- ot->idname= "GROUP_OT_create";
+ ot->idname = "GROUP_OT_create";
/* api callbacks */
- ot->exec= group_create_exec;
- ot->poll= ED_operator_objectmode;
+ ot->exec = group_create_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_string(ot->srna, "name", "Group", MAX_ID_NAME-2, "Name", "Name of the new group");
}
@@ -234,7 +234,7 @@ static int group_add_exec(bContext *C, wmOperator *UNUSED(op))
Object *ob= ED_object_context(C);
Group *group;
- if(ob == NULL)
+ if (ob == NULL)
return OPERATOR_CANCELLED;
group= add_group("Group");
@@ -248,15 +248,15 @@ static int group_add_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_group_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add to Group";
- ot->idname= "OBJECT_OT_group_add";
+ ot->name = "Add to Group";
+ ot->idname = "OBJECT_OT_group_add";
ot->description = "Add an object to a new group";
/* api callbacks */
- ot->exec= group_add_exec;
+ ot->exec = group_add_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int group_link_exec(bContext *C, wmOperator *op)
@@ -265,7 +265,7 @@ static int group_link_exec(bContext *C, wmOperator *op)
Object *ob= ED_object_context(C);
Group *group= BLI_findlink(&CTX_data_main(C)->group, RNA_enum_get(op->ptr, "group"));
- if(ELEM(NULL, ob, group))
+ if (ELEM(NULL, ob, group))
return OPERATOR_CANCELLED;
add_to_group(group, ob, scene, NULL);
@@ -280,21 +280,21 @@ void OBJECT_OT_group_link(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Link to Group";
- ot->idname= "OBJECT_OT_group_link";
+ ot->name = "Link to Group";
+ ot->idname = "OBJECT_OT_group_link";
ot->description = "Add an object to an existing group";
/* api callbacks */
- ot->exec= group_link_exec;
- ot->invoke= WM_enum_search_invoke;
+ ot->exec = group_link_exec;
+ ot->invoke = WM_enum_search_invoke;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
prop= RNA_def_enum(ot->srna, "group", DummyRNA_NULL_items, 0, "Group", "");
RNA_def_enum_funcs(prop, RNA_group_local_itemf);
- ot->prop= prop;
+ ot->prop = prop;
}
static int group_remove_exec(bContext *C, wmOperator *UNUSED(op))
@@ -303,7 +303,7 @@ static int group_remove_exec(bContext *C, wmOperator *UNUSED(op))
Object *ob= ED_object_context(C);
Group *group= CTX_data_pointer_get_type(C, "group", &RNA_Group).data;
- if(!ob || !group)
+ if (!ob || !group)
return OPERATOR_CANCELLED;
rem_from_group(group, ob, scene, NULL); /* base will be used if found */
@@ -316,13 +316,13 @@ static int group_remove_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_group_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Group";
- ot->idname= "OBJECT_OT_group_remove";
+ ot->name = "Remove Group";
+ ot->idname = "OBJECT_OT_group_remove";
/* api callbacks */
- ot->exec= group_remove_exec;
+ ot->exec = group_remove_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index 8b5a9ae6c9b..4e967b6791b 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -79,9 +79,9 @@ static int return_editmesh_indexar(BMEditMesh *em, int *tot, int **indexar, floa
int *index, nr, totvert=0;
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
- if(BM_elem_flag_test(eve, BM_ELEM_SELECT)) totvert++;
+ if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) totvert++;
}
- if(totvert==0) return 0;
+ if (totvert==0) return 0;
*indexar= index= MEM_mallocN(4*totvert, "hook indexar");
*tot= totvert;
@@ -89,7 +89,7 @@ static int return_editmesh_indexar(BMEditMesh *em, int *tot, int **indexar, floa
zero_v3(cent);
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
- if(BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
+ if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
*index= nr; index++;
add_v3_v3(cent, eve->co);
}
@@ -105,7 +105,7 @@ static int return_editmesh_vgroup(Object *obedit, BMEditMesh *em, char *name, fl
{
zero_v3(cent);
- if(obedit->actdef) {
+ if (obedit->actdef) {
const int defgrp_index= obedit->actdef-1;
int totvert=0;
@@ -117,14 +117,14 @@ static int return_editmesh_vgroup(Object *obedit, BMEditMesh *em, char *name, fl
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
dvert= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
- if(dvert) {
- if(defvert_find_weight(dvert, defgrp_index) > 0.0f) {
+ if (dvert) {
+ if (defvert_find_weight(dvert, defgrp_index) > 0.0f) {
add_v3_v3(cent, eve->co);
totvert++;
}
}
}
- if(totvert) {
+ if (totvert) {
bDeformGroup *dg = BLI_findlink(&obedit->defbase, defgrp_index);
BLI_strncpy(name, dg->name, sizeof(dg->name));
mul_v3_fl(cent, 1.0f/(float)totvert);
@@ -147,9 +147,9 @@ static void select_editbmesh_hook(Object *ob, HookModifierData *hmd)
return;
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
- if(nr==hmd->indexar[index]) {
+ if (nr==hmd->indexar[index]) {
BM_elem_select_set(em->bm, eve, TRUE);
- if(index < hmd->totindex-1) index++;
+ if (index < hmd->totindex-1) index++;
}
nr++;
@@ -166,25 +166,25 @@ static int return_editlattice_indexar(Lattice *editlatt, int *tot, int **indexar
/* count */
a= editlatt->pntsu*editlatt->pntsv*editlatt->pntsw;
bp= editlatt->def;
- while(a--) {
- if(bp->f1 & SELECT) {
- if(bp->hide==0) totvert++;
+ while (a--) {
+ if (bp->f1 & SELECT) {
+ if (bp->hide==0) totvert++;
}
bp++;
}
- if(totvert==0) return 0;
+ if (totvert==0) return 0;
*indexar= index= MEM_mallocN(4*totvert, "hook indexar");
*tot= totvert;
nr= 0;
- cent[0]= cent[1]= cent[2]= 0.0;
+ zero_v3(cent);
a= editlatt->pntsu*editlatt->pntsv*editlatt->pntsw;
bp= editlatt->def;
- while(a--) {
- if(bp->f1 & SELECT) {
- if(bp->hide==0) {
+ while (a--) {
+ if (bp->f1 & SELECT) {
+ if (bp->hide==0) {
*index= nr; index++;
add_v3_v3(cent, bp->vec);
}
@@ -208,10 +208,10 @@ static void select_editlattice_hook(Object *obedit, HookModifierData *hmd)
/* count */
a= editlt->pntsu*editlt->pntsv*editlt->pntsw;
bp= editlt->def;
- while(a--) {
- if(hmd->indexar[index]==nr) {
+ while (a--) {
+ if (hmd->indexar[index]==nr) {
bp->f1 |= SELECT;
- if(index < hmd->totindex-1) index++;
+ if (index < hmd->totindex-1) index++;
}
nr++;
bp++;
@@ -226,49 +226,49 @@ static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, flo
BezTriple *bezt;
int *index, a, nr, totvert=0;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
- if(bezt->f1 & SELECT) totvert++;
- if(bezt->f2 & SELECT) totvert++;
- if(bezt->f3 & SELECT) totvert++;
+ while (a--) {
+ if (bezt->f1 & SELECT) totvert++;
+ if (bezt->f2 & SELECT) totvert++;
+ if (bezt->f3 & SELECT) totvert++;
bezt++;
}
}
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->f1 & SELECT) totvert++;
+ while (a--) {
+ if (bp->f1 & SELECT) totvert++;
bp++;
}
}
}
- if(totvert==0) return 0;
+ if (totvert==0) return 0;
*indexar= index= MEM_mallocN(4*totvert, "hook indexar");
*tot= totvert;
nr= 0;
- cent[0]= cent[1]= cent[2]= 0.0;
+ zero_v3(cent);
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
- if(bezt->f1 & SELECT) {
+ while (a--) {
+ if (bezt->f1 & SELECT) {
*index= nr; index++;
add_v3_v3(cent, bezt->vec[0]);
}
nr++;
- if(bezt->f2 & SELECT) {
+ if (bezt->f2 & SELECT) {
*index= nr; index++;
add_v3_v3(cent, bezt->vec[1]);
}
nr++;
- if(bezt->f3 & SELECT) {
+ if (bezt->f3 & SELECT) {
*index= nr; index++;
add_v3_v3(cent, bezt->vec[2]);
}
@@ -279,8 +279,8 @@ static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, flo
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->f1 & SELECT) {
+ while (a--) {
+ if (bp->f1 & SELECT) {
*index= nr; index++;
add_v3_v3(cent, bp->vec);
}
@@ -308,15 +308,16 @@ static int object_hook_index_array(Scene *scene, Object *obedit, int *tot, int *
BMEditMesh *em;
- EDBM_LoadEditBMesh(scene, obedit);
- EDBM_MakeEditBMesh(scene->toolsettings, scene, obedit);
+ EDBM_mesh_load(obedit);
+ EDBM_mesh_make(scene->toolsettings, scene, obedit);
em = me->edit_btmesh;
/* check selected vertices first */
- if( return_editmesh_indexar(em, tot, indexar, cent_r)) {
+ if ( return_editmesh_indexar(em, tot, indexar, cent_r)) {
return 1;
- } else {
+ }
+ else {
int ret = return_editmesh_vgroup(obedit, em, name, cent_r);
return ret;
}
@@ -342,24 +343,24 @@ static void select_editcurve_hook(Object *obedit, HookModifierData *hmd)
BezTriple *bezt;
int index=0, a, nr=0;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu= editnurb->first; nu; nu= nu->next) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
- if(nr == hmd->indexar[index]) {
+ while (a--) {
+ if (nr == hmd->indexar[index]) {
bezt->f1 |= SELECT;
- if(index<hmd->totindex-1) index++;
+ if (index<hmd->totindex-1) index++;
}
nr++;
- if(nr == hmd->indexar[index]) {
+ if (nr == hmd->indexar[index]) {
bezt->f2 |= SELECT;
- if(index<hmd->totindex-1) index++;
+ if (index<hmd->totindex-1) index++;
}
nr++;
- if(nr == hmd->indexar[index]) {
+ if (nr == hmd->indexar[index]) {
bezt->f3 |= SELECT;
- if(index<hmd->totindex-1) index++;
+ if (index<hmd->totindex-1) index++;
}
nr++;
@@ -369,10 +370,10 @@ static void select_editcurve_hook(Object *obedit, HookModifierData *hmd)
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(nr == hmd->indexar[index]) {
+ while (a--) {
+ if (nr == hmd->indexar[index]) {
bp->f1 |= SELECT;
- if(index<hmd->totindex-1) index++;
+ if (index<hmd->totindex-1) index++;
}
nr++;
bp++;
@@ -386,10 +387,10 @@ static void object_hook_select(Object *ob, HookModifierData *hmd)
if (hmd->indexar == NULL)
return;
- if(ob->type==OB_MESH) select_editbmesh_hook(ob, hmd);
- else if(ob->type==OB_LATTICE) select_editlattice_hook(ob, hmd);
- else if(ob->type==OB_CURVE) select_editcurve_hook(ob, hmd);
- else if(ob->type==OB_SURF) select_editcurve_hook(ob, hmd);
+ if (ob->type==OB_MESH) select_editbmesh_hook(ob, hmd);
+ else if (ob->type==OB_LATTICE) select_editlattice_hook(ob, hmd);
+ else if (ob->type==OB_CURVE) select_editcurve_hook(ob, hmd);
+ else if (ob->type==OB_SURF) select_editcurve_hook(ob, hmd);
}
/* special poll operators for hook operators */
@@ -505,16 +506,16 @@ static int object_add_hook_selob_exec(bContext *C, wmOperator *op)
void OBJECT_OT_hook_add_selobj(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Hook to Selected Object";
- ot->description= "Hook selected vertices to the first selected Object";
- ot->idname= "OBJECT_OT_hook_add_selob";
+ ot->name = "Hook to Selected Object";
+ ot->description = "Hook selected vertices to the first selected Object";
+ ot->idname = "OBJECT_OT_hook_add_selob";
/* api callbacks */
- ot->exec= object_add_hook_selob_exec;
- ot->poll= hook_op_edit_poll;
+ ot->exec = object_add_hook_selob_exec;
+ ot->poll = hook_op_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int object_add_hook_newob_exec(bContext *C, wmOperator *UNUSED(op))
@@ -533,16 +534,16 @@ static int object_add_hook_newob_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_hook_add_newobj(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Hook to New Object";
- ot->description= "Hook selected vertices to the first selected Object";
- ot->idname= "OBJECT_OT_hook_add_newob";
+ ot->name = "Hook to New Object";
+ ot->description = "Hook selected vertices to the first selected Object";
+ ot->idname = "OBJECT_OT_hook_add_newob";
/* api callbacks */
- ot->exec= object_add_hook_newob_exec;
- ot->poll= hook_op_edit_poll;
+ ot->exec = object_add_hook_newob_exec;
+ ot->poll = hook_op_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int object_hook_remove_exec(bContext *C, wmOperator *op)
@@ -578,10 +579,10 @@ static EnumPropertyItem *hook_mod_itemf(bContext *C, PointerRNA *UNUSED(ptr), Pr
ModifierData *md = NULL;
int a, totitem= 0;
- if(!ob)
+ if (!ob)
return DummyRNA_NULL_items;
- for(a=0, md=ob->modifiers.first; md; md= md->next, a++) {
+ for (a=0, md=ob->modifiers.first; md; md= md->next, a++) {
if (md->type==eModifierType_Hook) {
tmp.value= a;
tmp.icon = ICON_HOOK;
@@ -602,24 +603,24 @@ void OBJECT_OT_hook_remove(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Remove Hook";
- ot->idname= "OBJECT_OT_hook_remove";
- ot->description= "Remove a hook from the active object";
+ ot->name = "Remove Hook";
+ ot->idname = "OBJECT_OT_hook_remove";
+ ot->description = "Remove a hook from the active object";
/* api callbacks */
- ot->exec= object_hook_remove_exec;
- ot->invoke= WM_menu_invoke;
- ot->poll= hook_op_edit_poll;
+ ot->exec = object_hook_remove_exec;
+ ot->invoke = WM_menu_invoke;
+ ot->poll = hook_op_edit_poll;
/* flags */
/* this operator removes modifier which isn't stored in local undo stack,
- so redoing it from redo panel gives totally weird results */
- ot->flag= /*OPTYPE_REGISTER|*/OPTYPE_UNDO;
+ * so redoing it from redo panel gives totally weird results */
+ ot->flag = /*OPTYPE_REGISTER|*/OPTYPE_UNDO;
/* properties */
prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove");
RNA_def_enum_funcs(prop, hook_mod_itemf);
- ot->prop= prop;
+ ot->prop = prop;
}
static int object_hook_reset_exec(bContext *C, wmOperator *op)
@@ -643,10 +644,10 @@ static int object_hook_reset_exec(bContext *C, wmOperator *op)
}
/* reset functionality */
- if(hmd->object) {
+ if (hmd->object) {
bPoseChannel *pchan= get_pose_channel(hmd->object->pose, hmd->subtarget);
- if(hmd->subtarget[0] && pchan) {
+ if (hmd->subtarget[0] && pchan) {
float imat[4][4], mat[4][4];
/* calculate the world-space matrix for the pose-channel target first, then carry on as usual */
@@ -672,16 +673,16 @@ void OBJECT_OT_hook_reset(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Reset Hook";
- ot->description= "Recalculate and clear offset transformation";
- ot->idname= "OBJECT_OT_hook_reset";
+ ot->name = "Reset Hook";
+ ot->description = "Recalculate and clear offset transformation";
+ ot->idname = "OBJECT_OT_hook_reset";
/* callbacks */
- ot->exec= object_hook_reset_exec;
- ot->poll= hook_op_edit_poll;
+ ot->exec = object_hook_reset_exec;
+ ot->poll = hook_op_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to");
@@ -728,16 +729,16 @@ void OBJECT_OT_hook_recenter(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Recenter Hook";
- ot->description= "Set hook center to cursor position";
- ot->idname= "OBJECT_OT_hook_recenter";
+ ot->name = "Recenter Hook";
+ ot->description = "Set hook center to cursor position";
+ ot->idname = "OBJECT_OT_hook_recenter";
/* callbacks */
- ot->exec= object_hook_recenter_exec;
- ot->poll= hook_op_edit_poll;
+ ot->exec = object_hook_recenter_exec;
+ ot->poll = hook_op_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to");
@@ -770,11 +771,11 @@ static int object_hook_assign_exec(bContext *C, wmOperator *op)
/* assign functionality */
- if(!object_hook_index_array(scene, ob, &tot, &indexar, name, cent)) {
+ if (!object_hook_index_array(scene, ob, &tot, &indexar, name, cent)) {
BKE_report(op->reports, RPT_WARNING, "Requires selected vertices or active vertex group");
return OPERATOR_CANCELLED;
}
- if(hmd->indexar)
+ if (hmd->indexar)
MEM_freeN(hmd->indexar);
copy_v3_v3(hmd->cent, cent);
@@ -792,18 +793,18 @@ void OBJECT_OT_hook_assign(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Assign to Hook";
- ot->description= "Assign the selected vertices to a hook";
- ot->idname= "OBJECT_OT_hook_assign";
+ ot->name = "Assign to Hook";
+ ot->description = "Assign the selected vertices to a hook";
+ ot->idname = "OBJECT_OT_hook_assign";
/* callbacks */
- ot->exec= object_hook_assign_exec;
- ot->poll= hook_op_edit_poll;
+ ot->exec = object_hook_assign_exec;
+ ot->poll = hook_op_edit_poll;
/* 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 */
- ot->flag= /*OPTYPE_REGISTER|*/OPTYPE_UNDO;
+ * so redoing it from redo panel gives totally weird results */
+ ot->flag = /*OPTYPE_REGISTER|*/OPTYPE_UNDO;
/* properties */
prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to");
@@ -843,16 +844,16 @@ void OBJECT_OT_hook_select(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Select Hook";
- ot->description= "Select affected vertices on mesh";
- ot->idname= "OBJECT_OT_hook_select";
+ ot->name = "Select Hook";
+ ot->description = "Select affected vertices on mesh";
+ ot->idname = "OBJECT_OT_hook_select";
/* callbacks */
- ot->exec= object_hook_select_exec;
- ot->poll= hook_op_edit_poll;
+ ot->exec = object_hook_select_exec;
+ ot->poll = hook_op_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove");
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index 651272323f3..19eb3575241 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_lattice.c b/source/blender/editors/object/object_lattice.c
index 9f3bc9bbf37..4ba62541c60 100644
--- a/source/blender/editors/object/object_lattice.c
+++ b/source/blender/editors/object/object_lattice.c
@@ -70,12 +70,12 @@ void free_editLatt(Object *ob)
{
Lattice *lt= ob->data;
- if(lt->editlatt) {
+ if (lt->editlatt) {
Lattice *editlt= lt->editlatt->latt;
- if(editlt->def)
+ if (editlt->def)
MEM_freeN(editlt->def);
- if(editlt->dvert)
+ if (editlt->dvert)
free_dverts(editlt->dvert, editlt->pntsu*editlt->pntsv*editlt->pntsw);
MEM_freeN(editlt);
@@ -93,20 +93,20 @@ void make_editLatt(Object *obedit)
free_editLatt(obedit);
actkey= ob_get_keyblock(obedit);
- if(actkey)
+ if (actkey)
key_to_latt(actkey, lt);
lt->editlatt= MEM_callocN(sizeof(EditLatt), "editlatt");
lt->editlatt->latt= MEM_dupallocN(lt);
lt->editlatt->latt->def= MEM_dupallocN(lt->def);
- if(lt->dvert) {
+ if (lt->dvert) {
int tot= lt->pntsu*lt->pntsv*lt->pntsw;
lt->editlatt->latt->dvert = MEM_mallocN (sizeof (MDeformVert)*tot, "Lattice MDeformVert");
copy_dverts(lt->editlatt->latt->dvert, lt->dvert, tot);
}
- if(lt->key) lt->editlatt->shapenr= obedit->shapenr;
+ if (lt->key) lt->editlatt->shapenr= obedit->shapenr;
}
void load_editLatt(Object *obedit)
@@ -120,19 +120,19 @@ void load_editLatt(Object *obedit)
lt= obedit->data;
editlt= lt->editlatt->latt;
- if(lt->editlatt->shapenr) {
+ if (lt->editlatt->shapenr) {
actkey= BLI_findlink(&lt->key->block, lt->editlatt->shapenr-1);
/* active key: vertices */
tot= editlt->pntsu*editlt->pntsv*editlt->pntsw;
- if(actkey->data) MEM_freeN(actkey->data);
+ if (actkey->data) MEM_freeN(actkey->data);
fp=actkey->data= MEM_callocN(lt->key->elemsize*tot, "actkey->data");
actkey->totelem= tot;
bp= editlt->def;
- while(tot--) {
+ while (tot--) {
copy_v3_v3(fp, bp->vec);
fp+= 3;
bp++;
@@ -154,12 +154,12 @@ void load_editLatt(Object *obedit)
lt->typew= editlt->typew;
}
- if(lt->dvert) {
+ if (lt->dvert) {
free_dverts(lt->dvert, lt->pntsu*lt->pntsv*lt->pntsw);
lt->dvert= NULL;
}
- if(editlt->dvert) {
+ if (editlt->dvert) {
tot= lt->pntsu*lt->pntsv*lt->pntsw;
lt->dvert = MEM_mallocN (sizeof (MDeformVert)*tot, "Lattice MDeformVert");
@@ -179,8 +179,8 @@ void ED_setflagsLatt(Object *obedit, int flag)
a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
- while(a--) {
- if(bp->hide==0) {
+ while (a--) {
+ if (bp->hide==0) {
bp->f1= flag;
}
bp++;
@@ -201,9 +201,9 @@ static int lattice_select_all_exec(bContext *C, wmOperator *op)
bp= lt->editlatt->latt->def;
a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
- while(a--) {
- if(bp->hide==0) {
- if(bp->f1) {
+ while (a--) {
+ if (bp->hide==0) {
+ if (bp->f1) {
action = SEL_DESELECT;
break;
}
@@ -223,8 +223,8 @@ static int lattice_select_all_exec(bContext *C, wmOperator *op)
bp= lt->editlatt->latt->def;
a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
- while(a--) {
- if(bp->hide==0) {
+ while (a--) {
+ if (bp->hide==0) {
bp->f1 ^= 1;
}
bp++;
@@ -240,16 +240,16 @@ static int lattice_select_all_exec(bContext *C, wmOperator *op)
void LATTICE_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select or Deselect All";
- ot->description= "Change selection of all UVW control points";
- ot->idname= "LATTICE_OT_select_all";
+ ot->name = "(De)select All";
+ ot->description = "Change selection of all UVW control points";
+ ot->idname = "LATTICE_OT_select_all";
/* api callbacks */
- ot->exec= lattice_select_all_exec;
- ot->poll= ED_operator_editlattice;
+ ot->exec = lattice_select_all_exec;
+ ot->poll = ED_operator_editlattice;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
WM_operator_properties_select_all(ot);
}
@@ -258,7 +258,7 @@ static int make_regular_poll(bContext *C)
{
Object *ob;
- if(ED_operator_editlattice(C)) return 1;
+ if (ED_operator_editlattice(C)) return 1;
ob= CTX_data_active_object(C);
return (ob && ob->type==OB_LATTICE);
@@ -269,7 +269,7 @@ static int make_regular_exec(bContext *C, wmOperator *UNUSED(op))
Object *ob= CTX_data_edit_object(C);
Lattice *lt;
- if(ob) {
+ if (ob) {
lt= ob->data;
resizelattice(lt->editlatt->latt, lt->pntsu, lt->pntsv, lt->pntsw, NULL);
}
@@ -288,16 +288,16 @@ static int make_regular_exec(bContext *C, wmOperator *UNUSED(op))
void LATTICE_OT_make_regular(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Make Regular";
- ot->description= "Set UVW control points a uniform distance apart";
- ot->idname= "LATTICE_OT_make_regular";
+ ot->name = "Make Regular";
+ ot->description = "Set UVW control points a uniform distance apart";
+ ot->idname = "LATTICE_OT_make_regular";
/* api callbacks */
- ot->exec= make_regular_exec;
- ot->poll= make_regular_poll;
+ ot->exec = make_regular_exec;
+ ot->poll = make_regular_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/****************************** Mouse Selection *************************/
@@ -307,10 +307,10 @@ static void findnearestLattvert__doClosest(void *userData, BPoint *bp, int x, in
struct { BPoint *bp; short dist, select; int mval[2]; } *data = userData;
float temp = abs(data->mval[0]-x) + abs(data->mval[1]-y);
- if((bp->f1 & SELECT)==data->select)
+ if ((bp->f1 & SELECT)==data->select)
temp += 5;
- if(temp<data->dist) {
+ if (temp<data->dist) {
data->dist = temp;
data->bp = bp;
@@ -343,8 +343,8 @@ int mouse_lattice(bContext *C, const int mval[2], int extend)
view3d_set_viewcontext(C, &vc);
bp= findnearestLattvert(&vc, mval, 1);
- if(bp) {
- if(extend==0) {
+ if (bp) {
+ if (extend==0) {
ED_setflagsLatt(vc.obedit, 0);
bp->f1 |= SELECT;
}
@@ -392,7 +392,7 @@ static void free_undoLatt(void *data)
{
UndoLattice *ult= (UndoLattice*)data;
- if(ult->def) MEM_freeN(ult->def);
+ if (ult->def) MEM_freeN(ult->def);
MEM_freeN(ult);
}
@@ -410,7 +410,7 @@ static void *get_editlatt(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
- if(obedit && obedit->type==OB_LATTICE) {
+ if (obedit && obedit->type==OB_LATTICE) {
Lattice *lt= obedit->data;
return lt->editlatt;
}
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 55dbbb50958..cd2fa4f93b6 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -91,19 +91,19 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc
ModifierTypeInfo *mti = modifierType_getInfo(type);
/* only geometry objects should be able to get modifiers [#25291] */
- 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)) {
BKE_reportf(reports, RPT_WARNING, "Modifiers cannot be added to Object '%s'", ob->id.name+2);
return NULL;
}
- if(mti->flags&eModifierTypeFlag_Single) {
- if(modifiers_findByType(ob, type)) {
+ if (mti->flags&eModifierTypeFlag_Single) {
+ if (modifiers_findByType(ob, type)) {
BKE_report(reports, RPT_WARNING, "Only one modifier of this type allowed");
return NULL;
}
}
- if(type == eModifierType_ParticleSystem) {
+ if (type == eModifierType_ParticleSystem) {
/* don't need to worry about the new modifier's name, since that is set to the number
* of particle systems which shouldn't have too many duplicates
*/
@@ -113,10 +113,10 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc
/* get new modifier data to add */
new_md= modifier_new(type);
- if(mti->flags&eModifierTypeFlag_RequiresOriginalData) {
+ if (mti->flags&eModifierTypeFlag_RequiresOriginalData) {
md = ob->modifiers.first;
- while(md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform)
+ while (md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform)
md = md->next;
BLI_insertlinkbefore(&ob->modifiers, md, new_md);
@@ -124,7 +124,7 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc
else
BLI_addtail(&ob->modifiers, new_md);
- if(name)
+ if (name)
BLI_strncpy(new_md->name, name, sizeof(new_md->name));
/* make sure modifier data has unique name */
@@ -132,22 +132,22 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc
modifier_unique_name(&ob->modifiers, new_md);
/* special cases */
- if(type == eModifierType_Softbody) {
- if(!ob->soft) {
+ if (type == eModifierType_Softbody) {
+ if (!ob->soft) {
ob->soft= sbNew(scene);
ob->softflag |= OB_SB_GOAL|OB_SB_EDGES;
}
}
- else if(type == eModifierType_Collision) {
- if(!ob->pd)
+ else if (type == eModifierType_Collision) {
+ if (!ob->pd)
ob->pd= object_add_collision_fields(0);
ob->pd->deflect= 1;
DAG_scene_sort(bmain, scene);
}
- else if(type == eModifierType_Surface)
+ else if (type == eModifierType_Surface)
DAG_scene_sort(bmain, scene);
- else if(type == eModifierType_Multires)
+ else if (type == eModifierType_Multires)
/* set totlvl from existing MDISPS layer if object already had it */
multiresModifier_set_levels_from_disps((MultiresModifierData *)new_md, ob);
}
@@ -164,70 +164,60 @@ static int object_modifier_remove(Object *ob, ModifierData *md, int *sort_depsgr
/* It seems on rapid delete it is possible to
* get called twice on same modifier, so make
* sure it is in list. */
- for(obmd=ob->modifiers.first; obmd; obmd=obmd->next)
- if(obmd==md)
+ for (obmd=ob->modifiers.first; obmd; obmd=obmd->next)
+ if (obmd==md)
break;
- if(!obmd)
+ if (!obmd)
return 0;
/* special cases */
- if(md->type == eModifierType_ParticleSystem) {
+ if (md->type == eModifierType_ParticleSystem) {
ParticleSystemModifierData *psmd=(ParticleSystemModifierData*)md;
BLI_remlink(&ob->particlesystem, psmd->psys);
psys_free(ob, psmd->psys);
psmd->psys= NULL;
}
- else if(md->type == eModifierType_Softbody) {
- if(ob->soft) {
+ else if (md->type == eModifierType_Softbody) {
+ if (ob->soft) {
sbFree(ob->soft);
ob->soft= NULL;
ob->softflag= 0;
}
}
- else if(md->type == eModifierType_Collision) {
- if(ob->pd)
+ else if (md->type == eModifierType_Collision) {
+ if (ob->pd)
ob->pd->deflect= 0;
*sort_depsgraph = 1;
}
- else if(md->type == eModifierType_Surface) {
- if(ob->pd && ob->pd->shape == PFIELD_SHAPE_SURFACE)
+ else if (md->type == eModifierType_Surface) {
+ if (ob->pd && ob->pd->shape == PFIELD_SHAPE_SURFACE)
ob->pd->shape = PFIELD_SHAPE_PLANE;
*sort_depsgraph = 1;
}
- else if(md->type == eModifierType_Smoke) {
+ else if (md->type == eModifierType_Smoke) {
ob->dt = OB_TEXTURE;
}
- else if(md->type == eModifierType_Multires) {
+ else if (md->type == eModifierType_Multires) {
int ok= 1;
- Mesh *me= ob->data;
ModifierData *tmpmd;
- /* ensure MDISPS CustomData layer is't used by another multires modifiers */
- for(tmpmd= ob->modifiers.first; tmpmd; tmpmd= tmpmd->next)
- if(tmpmd!=md && tmpmd->type == eModifierType_Multires) {
+ /* ensure MDISPS CustomData layer isn't used by another multires modifiers */
+ for (tmpmd= ob->modifiers.first; tmpmd; tmpmd= tmpmd->next)
+ if (tmpmd!=md && tmpmd->type == eModifierType_Multires) {
ok= 0;
break;
}
- if(ok) {
- 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 */
- CustomData_external_remove(&em->bm->ldata, &me->id, CD_MDISPS, 0);
- BM_data_layer_free(em->bm, &em->bm->ldata, CD_MDISPS);
- } else {
- CustomData_external_remove(&me->ldata, &me->id, CD_MDISPS, me->totloop);
- CustomData_free_layer_active(&me->ldata, CD_MDISPS, me->totloop);
- }
+ if (ok) {
+ multires_customdata_delete(ob->data);
}
}
- if(ELEM(md->type, eModifierType_Softbody, eModifierType_Cloth) &&
+ if (ELEM(md->type, eModifierType_Softbody, eModifierType_Cloth) &&
ob->particlesystem.first == NULL) {
ob->mode &= ~OB_MODE_PARTICLE_EDIT;
}
@@ -245,7 +235,7 @@ int ED_object_modifier_remove(ReportList *reports, Main *bmain, Scene *scene, Ob
ok= object_modifier_remove(ob, md, &sort_depsgraph);
- if(!ok) {
+ if (!ok) {
BKE_reportf(reports, RPT_ERROR, "Modifier '%s' not in object '%s'", ob->id.name, md->name);
return 0;
}
@@ -253,7 +243,7 @@ int ED_object_modifier_remove(ReportList *reports, Main *bmain, Scene *scene, Ob
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
/* sorting has to be done after the update so that dynamic systems can react properly */
- if(sort_depsgraph)
+ if (sort_depsgraph)
DAG_scene_sort(bmain, scene);
return 1;
@@ -264,10 +254,10 @@ void ED_object_modifier_clear(Main *bmain, Scene *scene, Object *ob)
ModifierData *md = ob->modifiers.first;
int sort_depsgraph = 0;
- if(!md)
+ if (!md)
return;
- while(md) {
+ while (md) {
ModifierData *next_md;
next_md= md->next;
@@ -280,19 +270,19 @@ void ED_object_modifier_clear(Main *bmain, Scene *scene, Object *ob)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
/* sorting has to be done after the update so that dynamic systems can react properly */
- if(sort_depsgraph)
+ if (sort_depsgraph)
DAG_scene_sort(bmain, scene);
}
int ED_object_modifier_move_up(ReportList *reports, Object *ob, ModifierData *md)
{
- if(md->prev) {
+ if (md->prev) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
- if(mti->type!=eModifierTypeType_OnlyDeform) {
+ if (mti->type!=eModifierTypeType_OnlyDeform) {
ModifierTypeInfo *nmti = modifierType_getInfo(md->prev->type);
- if(nmti->flags&eModifierTypeFlag_RequiresOriginalData) {
+ if (nmti->flags&eModifierTypeFlag_RequiresOriginalData) {
BKE_report(reports, RPT_WARNING, "Cannot move above a modifier requiring original data");
return 0;
}
@@ -307,13 +297,13 @@ int ED_object_modifier_move_up(ReportList *reports, Object *ob, ModifierData *md
int ED_object_modifier_move_down(ReportList *reports, Object *ob, ModifierData *md)
{
- if(md->next) {
+ if (md->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
- if(mti->flags&eModifierTypeFlag_RequiresOriginalData) {
+ if (mti->flags&eModifierTypeFlag_RequiresOriginalData) {
ModifierTypeInfo *nmti = modifierType_getInfo(md->next->type);
- if(nmti->type!=eModifierTypeType_OnlyDeform) {
+ if (nmti->type!=eModifierTypeType_OnlyDeform) {
BKE_report(reports, RPT_WARNING, "Cannot move beyond a non-deforming modifier");
return 0;
}
@@ -339,43 +329,43 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *
int totvert=0, totedge=0, cvert=0;
int totpart=0, totchild=0;
- if(md->type != eModifierType_ParticleSystem) return 0;
- if(ob && ob->mode & OB_MODE_PARTICLE_EDIT) return 0;
+ if (md->type != eModifierType_ParticleSystem) return 0;
+ if (ob && ob->mode & OB_MODE_PARTICLE_EDIT) return 0;
psys=((ParticleSystemModifierData *)md)->psys;
part= psys->part;
- if(part->ren_as != PART_DRAW_PATH || psys->pathcache == NULL)
+ if (part->ren_as != PART_DRAW_PATH || psys->pathcache == NULL)
return 0;
totpart= psys->totcached;
totchild= psys->totchildcache;
- if(totchild && (part->draw&PART_DRAW_PARENT)==0)
+ if (totchild && (part->draw&PART_DRAW_PARENT)==0)
totpart= 0;
/* count */
cache= psys->pathcache;
- for(a=0; a<totpart; a++) {
+ for (a=0; a<totpart; a++) {
key= cache[a];
- if(key->steps > 0) {
+ if (key->steps > 0) {
totvert+= key->steps+1;
totedge+= key->steps;
}
}
cache= psys->childcache;
- for(a=0; a<totchild; a++) {
+ for (a=0; a<totchild; a++) {
key= cache[a];
- if(key->steps > 0) {
+ if (key->steps > 0) {
totvert+= key->steps+1;
totedge+= key->steps;
}
}
- if(totvert==0) return 0;
+ if (totvert==0) return 0;
/* add new mesh */
obn= add_object(scene, OB_MESH);
@@ -393,12 +383,12 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *
/* copy coordinates */
cache= psys->pathcache;
- for(a=0; a<totpart; a++) {
+ for (a=0; a<totpart; a++) {
key= cache[a];
kmax= key->steps;
- for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
+ for (k=0; k<=kmax; k++,key++,cvert++,mvert++) {
copy_v3_v3(mvert->co,key->co);
- if(k) {
+ if (k) {
medge->v1= cvert-1;
medge->v2= cvert;
medge->flag= ME_EDGEDRAW|ME_EDGERENDER|ME_LOOSEEDGE;
@@ -412,12 +402,12 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *
}
cache=psys->childcache;
- for(a=0; a<totchild; a++) {
+ for (a=0; a<totchild; a++) {
key=cache[a];
kmax=key->steps;
- for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
+ for (k=0; k<=kmax; k++,key++,cvert++,mvert++) {
copy_v3_v3(mvert->co,key->co);
- if(k) {
+ if (k) {
medge->v1=cvert-1;
medge->v2=cvert;
medge->flag= ME_EDGEDRAW|ME_EDGERENDER|ME_LOOSEEDGE;
@@ -447,15 +437,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;
@@ -463,7 +453,7 @@ static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, M
Key *key=me->key;
KeyBlock *kb;
- if(!modifier_sameTopology(md) || mti->type == eModifierTypeType_NonGeometrical) {
+ if (!modifier_sameTopology(md) || mti->type == eModifierTypeType_NonGeometrical) {
BKE_report(reports, RPT_ERROR, "Only deforming modifiers can be applied to Shapes");
return 0;
}
@@ -474,11 +464,11 @@ static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, M
return 0;
}
- if(key == NULL) {
+ if (key == NULL) {
key= me->key= add_key((ID *)me);
key->type= KEY_RELATIVE;
/* if that was the first key block added, then it was the basis.
- * Initialise it with the mesh, and add another for the modifier */
+ * Initialize it with the mesh, and add another for the modifier */
kb= add_keyblock(key, NULL);
mesh_to_key(me, kb);
}
@@ -511,21 +501,22 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob,
Mesh *me = ob->data;
MultiresModifierData *mmd= find_multires_modifier_before(scene, md);
- if(me->key && mti->type != eModifierTypeType_NonGeometrical) {
+ if (me->key && mti->type != eModifierTypeType_NonGeometrical) {
BKE_report(reports, RPT_ERROR, "Modifier cannot be applied to Mesh with Shape Keys");
return 0;
}
/* Multires: ensure that recent sculpting is applied */
- if(md->type == eModifierType_Multires)
+ if (md->type == eModifierType_Multires)
multires_force_update(ob);
if (mmd && mmd->totlvl && mti->type==eModifierTypeType_OnlyDeform) {
- if(!multiresModifier_reshapeFromDeformMod (scene, mmd, ob, md)) {
+ if (!multiresModifier_reshapeFromDeformMod (scene, mmd, ob, md)) {
BKE_report(reports, RPT_ERROR, "Multires modifier returned error, skipping apply");
return 0;
}
- } else {
+ }
+ else {
dm = mesh_create_derived_for_modifier(scene, ob, md, 1);
if (!dm) {
BKE_report(reports, RPT_ERROR, "Modifier returned error, skipping apply");
@@ -536,10 +527,8 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob,
dm->release(dm);
- if(md->type == eModifierType_Multires) {
- CustomData_external_remove(&me->ldata, &me->id, CD_MDISPS, me->totloop);
- CustomData_free_layer_active(&me->ldata, CD_MDISPS, me->totloop);
- }
+ if (md->type == eModifierType_Multires)
+ multires_customdata_delete(me);
}
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
@@ -553,7 +542,7 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob,
}
cu = ob->data;
- BKE_report(reports, RPT_INFO, "Applied modifier only changed CV points, not tesselated/bevel vertices");
+ BKE_report(reports, RPT_INFO, "Applied modifier only changed CV points, not tessellated/bevel vertices");
vertexCos = curve_getVertexCos(cu, &cu->nurb, &numVerts);
mti->deformVerts(md, ob, NULL, vertexCos, numVerts, 0, 0);
@@ -569,13 +558,13 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob,
}
/* lattice modifier can be applied to particle system too */
- if(ob->particlesystem.first) {
+ if (ob->particlesystem.first) {
ParticleSystem *psys = ob->particlesystem.first;
- for(; psys; psys=psys->next) {
+ for (; psys; psys=psys->next) {
- if(psys->part->type != PART_HAIR)
+ if (psys->part->type != PART_HAIR)
continue;
psys_apply_hair_lattice(scene, ob, psys);
@@ -592,7 +581,8 @@ int ED_object_modifier_apply(ReportList *reports, Scene *scene, Object *ob, Modi
if (scene->obedit) {
BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied in editmode");
return 0;
- } else if (((ID*) ob->data)->us>1) {
+ }
+ else if (((ID*) ob->data)->us>1) {
BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied to multi-user data");
return 0;
}
@@ -609,7 +599,8 @@ int ED_object_modifier_apply(ReportList *reports, Scene *scene, Object *ob, Modi
md->mode= prev_mode;
return 0;
}
- } else {
+ }
+ else {
if (!modifier_apply_obdata(reports, scene, ob, md)) {
md->mode= prev_mode;
return 0;
@@ -643,7 +634,7 @@ static int modifier_add_exec(bContext *C, wmOperator *op)
Object *ob = ED_object_active_context(C);
int type= RNA_enum_get(op->ptr, "type");
- if(!ED_object_modifier_add(op->reports, bmain, scene, ob, NULL, type))
+ if (!ED_object_modifier_add(op->reports, bmain, scene, ob, NULL, type))
return OPERATOR_CANCELLED;
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
@@ -658,20 +649,19 @@ static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *UNUSED(ptr)
ModifierTypeInfo *mti;
int totitem= 0, a;
- if(!ob)
+ if (!ob)
return modifier_type_items;
- for(a=0; modifier_type_items[a].identifier; a++) {
+ for (a=0; modifier_type_items[a].identifier; a++) {
md_item= &modifier_type_items[a];
- if(md_item->identifier[0]) {
+ if (md_item->identifier[0]) {
mti= modifierType_getInfo(md_item->value);
- if(mti->flags & eModifierTypeFlag_NoUserAdd)
+ if (mti->flags & eModifierTypeFlag_NoUserAdd)
continue;
- if(!((mti->flags & eModifierTypeFlag_AcceptsCVs) ||
- (ob->type==OB_MESH && (mti->flags & eModifierTypeFlag_AcceptsMesh))))
+ if (!object_support_modifier_type(ob, md_item->value))
continue;
}
else {
@@ -681,7 +671,7 @@ static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *UNUSED(ptr)
continue;
}
- if(group_item) {
+ if (group_item) {
RNA_enum_item_add(&item, &totitem, group_item);
group_item= NULL;
}
@@ -700,22 +690,22 @@ void OBJECT_OT_modifier_add(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Add Modifier";
+ ot->name = "Add Modifier";
ot->description = "Add a modifier to the active object";
- ot->idname= "OBJECT_OT_modifier_add";
+ ot->idname = "OBJECT_OT_modifier_add";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= modifier_add_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = modifier_add_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
prop= RNA_def_enum(ot->srna, "type", modifier_type_items, eModifierType_Subsurf, "Type", "");
RNA_def_enum_funcs(prop, modifier_add_itemf);
- ot->prop= prop;
+ ot->prop = prop;
}
/************************ generic functions for operators using mod names and data context *********************/
@@ -783,15 +773,15 @@ static int modifier_remove_exec(bContext *C, wmOperator *op)
ModifierData *md = edit_modifier_property_get(op, ob, 0);
int mode_orig = ob ? ob->mode : 0;
- if(!ob || !md || !ED_object_modifier_remove(op->reports, bmain, scene, ob, md))
+ if (!ob || !md || !ED_object_modifier_remove(op->reports, bmain, scene, ob, md))
return OPERATOR_CANCELLED;
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
/* if cloth/softbody was removed, particle mode could be cleared */
- if(mode_orig & OB_MODE_PARTICLE_EDIT)
- if((ob->mode & OB_MODE_PARTICLE_EDIT)==0)
- if(scene->basact && scene->basact->object==ob)
+ if (mode_orig & OB_MODE_PARTICLE_EDIT)
+ if ((ob->mode & OB_MODE_PARTICLE_EDIT)==0)
+ if (scene->basact && scene->basact->object==ob)
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, NULL);
return OPERATOR_FINISHED;
@@ -807,16 +797,16 @@ static int modifier_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(e
void OBJECT_OT_modifier_remove(wmOperatorType *ot)
{
- ot->name= "Remove Modifier";
- ot->description= "Remove a modifier from the active object";
- ot->idname= "OBJECT_OT_modifier_remove";
+ ot->name = "Remove Modifier";
+ ot->description = "Remove a modifier from the active object";
+ ot->idname = "OBJECT_OT_modifier_remove";
- ot->invoke= modifier_remove_invoke;
- ot->exec= modifier_remove_exec;
- ot->poll= edit_modifier_poll;
+ ot->invoke = modifier_remove_invoke;
+ ot->exec = modifier_remove_exec;
+ ot->poll = edit_modifier_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_modifier_properties(ot);
}
@@ -827,7 +817,7 @@ static int modifier_move_up_exec(bContext *C, wmOperator *op)
Object *ob = ED_object_active_context(C);
ModifierData *md = edit_modifier_property_get(op, ob, 0);
- if(!ob || !md || !ED_object_modifier_move_up(op->reports, ob, md))
+ if (!ob || !md || !ED_object_modifier_move_up(op->reports, ob, md))
return OPERATOR_CANCELLED;
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -846,16 +836,16 @@ static int modifier_move_up_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(
void OBJECT_OT_modifier_move_up(wmOperatorType *ot)
{
- ot->name= "Move Up Modifier";
- ot->description= "Move modifier up in the stack";
- ot->idname= "OBJECT_OT_modifier_move_up";
+ ot->name = "Move Up Modifier";
+ ot->description = "Move modifier up in the stack";
+ ot->idname = "OBJECT_OT_modifier_move_up";
- ot->invoke= modifier_move_up_invoke;
- ot->exec= modifier_move_up_exec;
- ot->poll= edit_modifier_poll;
+ ot->invoke = modifier_move_up_invoke;
+ ot->exec = modifier_move_up_exec;
+ ot->poll = edit_modifier_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_modifier_properties(ot);
}
@@ -866,7 +856,7 @@ static int modifier_move_down_exec(bContext *C, wmOperator *op)
Object *ob = ED_object_active_context(C);
ModifierData *md = edit_modifier_property_get(op, ob, 0);
- if(!ob || !md || !ED_object_modifier_move_down(op->reports, ob, md))
+ if (!ob || !md || !ED_object_modifier_move_down(op->reports, ob, md))
return OPERATOR_CANCELLED;
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -885,16 +875,16 @@ static int modifier_move_down_invoke(bContext *C, wmOperator *op, wmEvent *UNUSE
void OBJECT_OT_modifier_move_down(wmOperatorType *ot)
{
- ot->name= "Move Down Modifier";
- ot->description= "Move modifier down in the stack";
- ot->idname= "OBJECT_OT_modifier_move_down";
+ ot->name = "Move Down Modifier";
+ ot->description = "Move modifier down in the stack";
+ ot->idname = "OBJECT_OT_modifier_move_down";
- ot->invoke= modifier_move_down_invoke;
- ot->exec= modifier_move_down_exec;
- ot->poll= edit_modifier_poll;
+ ot->invoke = modifier_move_down_invoke;
+ ot->exec = modifier_move_down_exec;
+ ot->poll = edit_modifier_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_modifier_properties(ot);
}
@@ -907,7 +897,7 @@ static int modifier_apply_exec(bContext *C, wmOperator *op)
ModifierData *md = edit_modifier_property_get(op, ob, 0);
int apply_as= RNA_enum_get(op->ptr, "apply_as");
- if(!ob || !md || !ED_object_modifier_apply(op->reports, scene, ob, md, apply_as)) {
+ if (!ob || !md || !ED_object_modifier_apply(op->reports, scene, ob, md, apply_as)) {
return OPERATOR_CANCELLED;
}
@@ -932,16 +922,16 @@ static EnumPropertyItem modifier_apply_as_items[] = {
void OBJECT_OT_modifier_apply(wmOperatorType *ot)
{
- ot->name= "Apply Modifier";
- ot->description= "Apply modifier and remove from the stack";
- ot->idname= "OBJECT_OT_modifier_apply";
+ ot->name = "Apply Modifier";
+ ot->description = "Apply modifier and remove from the stack";
+ ot->idname = "OBJECT_OT_modifier_apply";
- ot->invoke= modifier_apply_invoke;
- ot->exec= modifier_apply_exec;
- ot->poll= edit_modifier_poll;
+ ot->invoke = modifier_apply_invoke;
+ ot->exec = modifier_apply_exec;
+ ot->poll = edit_modifier_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "apply_as", modifier_apply_as_items, MODIFIER_APPLY_DATA, "Apply as", "How to apply the modifier to the geometry");
edit_modifier_properties(ot);
@@ -956,7 +946,7 @@ static int modifier_convert_exec(bContext *C, wmOperator *op)
Object *ob = ED_object_active_context(C);
ModifierData *md = edit_modifier_property_get(op, ob, 0);
- if(!ob || !md || !ED_object_modifier_convert(op->reports, bmain, scene, ob, md))
+ if (!ob || !md || !ED_object_modifier_convert(op->reports, bmain, scene, ob, md))
return OPERATOR_CANCELLED;
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -975,16 +965,16 @@ static int modifier_convert_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(
void OBJECT_OT_modifier_convert(wmOperatorType *ot)
{
- ot->name= "Convert Modifier";
- ot->description= "Convert particles to a mesh object";
- ot->idname= "OBJECT_OT_modifier_convert";
+ ot->name = "Convert Modifier";
+ ot->description = "Convert particles to a mesh object";
+ ot->idname = "OBJECT_OT_modifier_convert";
- ot->invoke= modifier_convert_invoke;
- ot->exec= modifier_convert_exec;
- ot->poll= edit_modifier_poll;
+ ot->invoke = modifier_convert_invoke;
+ ot->exec = modifier_convert_exec;
+ ot->poll = edit_modifier_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_modifier_properties(ot);
}
@@ -995,7 +985,7 @@ static int modifier_copy_exec(bContext *C, wmOperator *op)
Object *ob = ED_object_active_context(C);
ModifierData *md = edit_modifier_property_get(op, ob, 0);
- if(!ob || !md || !ED_object_modifier_copy(op->reports, ob, md))
+ if (!ob || !md || !ED_object_modifier_copy(op->reports, ob, md))
return OPERATOR_CANCELLED;
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -1014,16 +1004,16 @@ static int modifier_copy_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
void OBJECT_OT_modifier_copy(wmOperatorType *ot)
{
- ot->name= "Copy Modifier";
- ot->description= "Duplicate modifier at the same position in the stack";
- ot->idname= "OBJECT_OT_modifier_copy";
+ ot->name = "Copy Modifier";
+ ot->description = "Duplicate modifier at the same position in the stack";
+ ot->idname = "OBJECT_OT_modifier_copy";
- ot->invoke= modifier_copy_invoke;
- ot->exec= modifier_copy_exec;
- ot->poll= edit_modifier_poll;
+ ot->invoke = modifier_copy_invoke;
+ ot->exec = modifier_copy_exec;
+ ot->poll = edit_modifier_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_modifier_properties(ot);
}
@@ -1059,16 +1049,16 @@ static int multires_higher_levels_delete_invoke(bContext *C, wmOperator *op, wmE
void OBJECT_OT_multires_higher_levels_delete(wmOperatorType *ot)
{
- ot->name= "Delete Higher Levels";
- ot->description= "Deletes the higher resolution mesh, potential loss of detail";
- ot->idname= "OBJECT_OT_multires_higher_levels_delete";
+ ot->name = "Delete Higher Levels";
+ ot->description = "Deletes the higher resolution mesh, potential loss of detail";
+ ot->idname = "OBJECT_OT_multires_higher_levels_delete";
- ot->poll= multires_poll;
- ot->invoke= multires_higher_levels_delete_invoke;
- ot->exec= multires_higher_levels_delete_exec;
+ ot->poll = multires_poll;
+ ot->invoke = multires_higher_levels_delete_invoke;
+ ot->exec = multires_higher_levels_delete_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_modifier_properties(ot);
}
@@ -1100,16 +1090,16 @@ static int multires_subdivide_invoke(bContext *C, wmOperator *op, wmEvent *UNUSE
void OBJECT_OT_multires_subdivide(wmOperatorType *ot)
{
- ot->name= "Multires Subdivide";
- ot->description= "Add a new level of subdivision";
- ot->idname= "OBJECT_OT_multires_subdivide";
+ ot->name = "Multires Subdivide";
+ ot->description = "Add a new level of subdivision";
+ ot->idname = "OBJECT_OT_multires_subdivide";
- ot->poll= multires_poll;
- ot->invoke= multires_subdivide_invoke;
- ot->exec= multires_subdivide_exec;
+ ot->poll = multires_poll;
+ ot->invoke = multires_subdivide_invoke;
+ ot->exec = multires_subdivide_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_modifier_properties(ot);
}
@@ -1124,25 +1114,25 @@ static int multires_reshape_exec(bContext *C, wmOperator *op)
if (!mmd)
return OPERATOR_CANCELLED;
- if(mmd->lvl==0) {
+ if (mmd->lvl==0) {
BKE_report(op->reports, RPT_ERROR, "Reshape can work only with higher levels of subdivisions");
return OPERATOR_CANCELLED;
}
CTX_DATA_BEGIN(C, Object*, selob, selected_editable_objects) {
- if(selob->type == OB_MESH && selob != ob) {
+ if (selob->type == OB_MESH && selob != ob) {
secondob= selob;
break;
}
}
CTX_DATA_END;
- if(!secondob) {
+ if (!secondob) {
BKE_report(op->reports, RPT_ERROR, "Second selected mesh object require to copy shape from");
return OPERATOR_CANCELLED;
}
- if(!multiresModifier_reshape(scene, mmd, ob, secondob)) {
+ if (!multiresModifier_reshape(scene, mmd, ob, secondob)) {
BKE_report(op->reports, RPT_ERROR, "Objects do not have the same number of vertices");
return OPERATOR_CANCELLED;
}
@@ -1163,77 +1153,19 @@ static int multires_reshape_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(
void OBJECT_OT_multires_reshape(wmOperatorType *ot)
{
- ot->name= "Multires Reshape";
- ot->description= "Copy vertex coordinates from other object";
- ot->idname= "OBJECT_OT_multires_reshape";
+ ot->name = "Multires Reshape";
+ ot->description = "Copy vertex coordinates from other object";
+ ot->idname = "OBJECT_OT_multires_reshape";
- ot->poll= multires_poll;
- ot->invoke= multires_reshape_invoke;
- ot->exec= multires_reshape_exec;
+ ot->poll = multires_poll;
+ ot->invoke = multires_reshape_invoke;
+ ot->exec = multires_reshape_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
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 *********************/
@@ -1245,15 +1177,15 @@ static int multires_external_save_exec(bContext *C, wmOperator *op)
char path[FILE_MAX];
int relative= RNA_boolean_get(op->ptr, "relative_path");
- if(!me)
+ if (!me)
return OPERATOR_CANCELLED;
- if(CustomData_external_test(&me->ldata, CD_MDISPS))
+ if (CustomData_external_test(&me->ldata, CD_MDISPS))
return OPERATOR_CANCELLED;
RNA_string_get(op->ptr, "filepath", path);
- if(relative)
+ if (relative)
BLI_path_rel(path, G.main->name);
CustomData_external_add(&me->ldata, &me->id, CD_MDISPS, me->totloop, path);
@@ -1277,10 +1209,10 @@ static int multires_external_save_invoke(bContext *C, wmOperator *op, wmEvent *U
if (!mmd)
return OPERATOR_CANCELLED;
- if(CustomData_external_test(&me->ldata, CD_MDISPS))
+ if (CustomData_external_test(&me->ldata, CD_MDISPS))
return OPERATOR_CANCELLED;
- if(RNA_struct_property_is_set(op->ptr, "filepath"))
+ if (RNA_struct_property_is_set(op->ptr, "filepath"))
return multires_external_save_exec(C, op);
op->customdata= me;
@@ -1295,17 +1227,17 @@ static int multires_external_save_invoke(bContext *C, wmOperator *op, wmEvent *U
void OBJECT_OT_multires_external_save(wmOperatorType *ot)
{
- ot->name= "Multires Save External";
- ot->description= "Save displacements to an external file";
- ot->idname= "OBJECT_OT_multires_external_save";
+ ot->name = "Multires Save External";
+ ot->description = "Save displacements to an external file";
+ ot->idname = "OBJECT_OT_multires_external_save";
- // XXX modifier no longer in context after file browser .. ot->poll= multires_poll;
- ot->exec= multires_external_save_exec;
- ot->invoke= multires_external_save_invoke;
- ot->poll= multires_poll;
+ // XXX modifier no longer in context after file browser .. ot->poll = multires_poll;
+ ot->exec = multires_external_save_exec;
+ ot->invoke = multires_external_save_invoke;
+ ot->poll = multires_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
WM_operator_properties_filesel(ot, FOLDERFILE|BTXFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
edit_modifier_properties(ot);
@@ -1318,7 +1250,7 @@ static int multires_external_pack_exec(bContext *C, wmOperator *UNUSED(op))
Object *ob = ED_object_active_context(C);
Mesh *me= ob->data;
- if(!CustomData_external_test(&me->ldata, CD_MDISPS))
+ if (!CustomData_external_test(&me->ldata, CD_MDISPS))
return OPERATOR_CANCELLED;
// XXX don't remove..
@@ -1329,15 +1261,15 @@ static int multires_external_pack_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_multires_external_pack(wmOperatorType *ot)
{
- ot->name= "Multires Pack External";
- ot->description= "Pack displacements from an external file";
- ot->idname= "OBJECT_OT_multires_external_pack";
+ ot->name = "Multires Pack External";
+ ot->description = "Pack displacements from an external file";
+ ot->idname = "OBJECT_OT_multires_external_pack";
- ot->poll= multires_poll;
- ot->exec= multires_external_pack_exec;
+ ot->poll = multires_poll;
+ ot->exec = multires_external_pack_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************* multires apply base ***********************/
@@ -1368,16 +1300,16 @@ static int multires_base_apply_invoke(bContext *C, wmOperator *op, wmEvent *UNUS
void OBJECT_OT_multires_base_apply(wmOperatorType *ot)
{
- ot->name= "Multires Apply Base";
- ot->description= "Modify the base mesh to conform to the displaced mesh";
- ot->idname= "OBJECT_OT_multires_base_apply";
+ ot->name = "Multires Apply Base";
+ ot->description = "Modify the base mesh to conform to the displaced mesh";
+ ot->idname = "OBJECT_OT_multires_base_apply";
- ot->poll= multires_poll;
- ot->invoke= multires_base_apply_invoke;
- ot->exec= multires_base_apply_exec;
+ ot->poll = multires_poll;
+ ot->invoke = multires_base_apply_invoke;
+ ot->exec = multires_base_apply_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_modifier_properties(ot);
}
@@ -1398,15 +1330,15 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op)
if (!mmd)
return OPERATOR_CANCELLED;
- if(mmd->bindcagecos) {
+ if (mmd->bindcagecos) {
MEM_freeN(mmd->bindcagecos);
- if(mmd->dyngrid) MEM_freeN(mmd->dyngrid);
- if(mmd->dyninfluences) MEM_freeN(mmd->dyninfluences);
- if(mmd->bindinfluences) MEM_freeN(mmd->bindinfluences);
- if(mmd->bindoffsets) MEM_freeN(mmd->bindoffsets);
- if(mmd->dynverts) MEM_freeN(mmd->dynverts);
- if(mmd->bindweights) MEM_freeN(mmd->bindweights); /* deprecated */
- if(mmd->bindcos) MEM_freeN(mmd->bindcos); /* deprecated */
+ if (mmd->dyngrid) MEM_freeN(mmd->dyngrid);
+ if (mmd->dyninfluences) MEM_freeN(mmd->dyninfluences);
+ if (mmd->bindinfluences) MEM_freeN(mmd->bindinfluences);
+ if (mmd->bindoffsets) MEM_freeN(mmd->bindoffsets);
+ if (mmd->dynverts) MEM_freeN(mmd->dynverts);
+ if (mmd->bindweights) MEM_freeN(mmd->bindweights); /* deprecated */
+ if (mmd->bindcos) MEM_freeN(mmd->bindcos); /* deprecated */
mmd->bindcagecos= NULL;
mmd->dyngrid= NULL;
@@ -1430,17 +1362,17 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op)
mmd->bindfunc= mesh_deform_bind;
mmd->modifier.mode |= eModifierMode_Realtime;
- if(ob->type == OB_MESH) {
+ if (ob->type == OB_MESH) {
dm= mesh_create_derived_view(scene, ob, 0);
dm->release(dm);
}
- else if(ob->type == OB_LATTICE) {
+ else if (ob->type == OB_LATTICE) {
lattice_calc_modifiers(scene, ob);
}
- else if(ob->type==OB_MBALL) {
+ else if (ob->type==OB_MBALL) {
makeDispListMBall(scene, ob);
}
- else if(ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
+ else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
makeDispListCurveTypes(scene, ob, 0);
}
@@ -1462,17 +1394,17 @@ static int meshdeform_bind_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(e
void OBJECT_OT_meshdeform_bind(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mesh Deform Bind";
+ ot->name = "Mesh Deform Bind";
ot->description = "Bind mesh to cage in mesh deform modifier";
- ot->idname= "OBJECT_OT_meshdeform_bind";
+ ot->idname = "OBJECT_OT_meshdeform_bind";
/* api callbacks */
- ot->poll= meshdeform_poll;
- ot->invoke= meshdeform_bind_invoke;
- ot->exec= meshdeform_bind_exec;
+ ot->poll = meshdeform_poll;
+ ot->invoke = meshdeform_bind_invoke;
+ ot->exec = meshdeform_bind_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_modifier_properties(ot);
}
@@ -1510,16 +1442,16 @@ static int explode_refresh_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(e
void OBJECT_OT_explode_refresh(wmOperatorType *ot)
{
- ot->name= "Explode Refresh";
- ot->description= "Refresh data in the Explode modifier";
- ot->idname= "OBJECT_OT_explode_refresh";
+ ot->name = "Explode Refresh";
+ ot->description = "Refresh data in the Explode modifier";
+ ot->idname = "OBJECT_OT_explode_refresh";
- ot->poll= explode_poll;
- ot->invoke= explode_refresh_invoke;
- ot->exec= explode_refresh_exec;
+ ot->poll = explode_poll;
+ ot->invoke = explode_refresh_invoke;
+ ot->exec = explode_refresh_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_modifier_properties(ot);
}
@@ -1654,8 +1586,8 @@ 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 optimisation that ignores recalc object animation,
+ *
+ * XXX: This can't be used due to an anim sys optimization that ignores recalc object animation,
* leaving it for the depgraph (this ignores object animation such as modifier properties though... :/ )
* --> BKE_animsys_evaluate_all_animation(G.main, eval_time);
* This doesn't work with drivers:
@@ -1680,7 +1612,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 +1622,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 */
@@ -1725,16 +1657,16 @@ static int ocean_bake_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
void OBJECT_OT_ocean_bake(wmOperatorType *ot)
{
- ot->name= "Bake Ocean";
- ot->description= "Bake an image sequence of ocean data";
- ot->idname= "OBJECT_OT_ocean_bake";
+ ot->name = "Bake Ocean";
+ ot->description = "Bake an image sequence of ocean data";
+ ot->idname = "OBJECT_OT_ocean_bake";
- ot->poll= ocean_bake_poll;
- ot->invoke= ocean_bake_invoke;
- ot->exec= ocean_bake_exec;
+ ot->poll = ocean_bake_poll;
+ ot->invoke = ocean_bake_invoke;
+ ot->exec = ocean_bake_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_modifier_properties(ot);
RNA_def_boolean(ot->srna, "free", FALSE, "Free", "Free the bake, rather than generating it");
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index 4307bd71c1b..115d452fd4e 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -215,8 +215,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)
@@ -224,27 +222,27 @@ void ED_operatormacros_object(void)
wmOperatorType *ot;
wmOperatorTypeMacro *otmacro;
- ot= WM_operatortype_append_macro("OBJECT_OT_duplicate_move", "Duplicate Objects", OPTYPE_UNDO|OPTYPE_REGISTER);
- if(ot) {
+ ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move", "Duplicate Objects", OPTYPE_UNDO|OPTYPE_REGISTER);
+ if (ot) {
ot->description = "Duplicate selected objects and move them";
WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_enum_set(otmacro->ptr, "proportional", PROP_EDIT_OFF);
}
/* grr, should be able to pass options on... */
- ot= WM_operatortype_append_macro("OBJECT_OT_duplicate_move_linked", "Duplicate Linked", OPTYPE_UNDO|OPTYPE_REGISTER);
- if(ot) {
+ ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move_linked", "Duplicate Linked", OPTYPE_UNDO|OPTYPE_REGISTER);
+ if (ot) {
ot->description = "Duplicate selected objects and move them";
- otmacro= WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate");
+ otmacro = WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate");
RNA_boolean_set(otmacro->ptr, "linked", TRUE);
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_enum_set(otmacro->ptr, "proportional", PROP_EDIT_OFF);
}
/* XXX */
- ot= WM_operatortype_append_macro("OBJECT_OT_add_named_cursor", "Add named object at cursor", OPTYPE_UNDO|OPTYPE_REGISTER);
- if(ot) {
+ ot = WM_operatortype_append_macro("OBJECT_OT_add_named_cursor", "Add named object at cursor", OPTYPE_UNDO|OPTYPE_REGISTER);
+ if (ot) {
ot->description = "Add named object at cursor";
RNA_def_string(ot->srna, "name", "Cube", MAX_ID_NAME-2, "Name", "Object name to add");
@@ -266,7 +264,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
int i;
/* Objects, Regardless of Mode -------------------------------------------------- */
- keymap= WM_keymap_find(keyconf, "Object Non-modal", 0, 0);
+ keymap = WM_keymap_find(keyconf, "Object Non-modal", 0, 0);
/* Note: this keymap works disregarding mode */
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0);
@@ -289,8 +287,8 @@ void ED_keymap_object(wmKeyConfig *keyconf)
/* Object Mode ---------------------------------------------------------------- */
/* Note: this keymap gets disabled in non-objectmode, */
- keymap= WM_keymap_find(keyconf, "Object Mode", 0, 0);
- keymap->poll= object_mode_poll;
+ keymap = WM_keymap_find(keyconf, "Object Mode", 0, 0);
+ keymap->poll = object_mode_poll;
/* object mode supports PET now */
ED_object_generic_keymap(keyconf, keymap, 1);
@@ -394,7 +392,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
WM_keymap_add_menu(keymap, "VIEW3D_MT_object_specials", WKEY, KM_PRESS, 0, 0);
- for(i=0; i<=5; i++) {
+ for (i=0; i<=5; i++) {
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", ZEROKEY+i, KM_PRESS, KM_CTRL, 0);
RNA_int_set(kmi->ptr, "level", i);
}
@@ -403,11 +401,14 @@ void ED_keymap_object(wmKeyConfig *keyconf)
/* ################################ LATTICE ################################### */
/* ############################################################################ */
- keymap= WM_keymap_find(keyconf, "Lattice", 0, 0);
- keymap->poll= ED_operator_editlattice;
+ keymap = WM_keymap_find(keyconf, "Lattice", 0, 0);
+ keymap->poll = ED_operator_editlattice;
+
+ kmi = WM_keymap_add_item(keymap, "LATTICE_OT_select_all", AKEY, KM_PRESS, 0, 0);
+ RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
+ kmi = WM_keymap_add_item(keymap, "LATTICE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
+ RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
- WM_keymap_add_item(keymap, "LATTICE_OT_select_all", AKEY, KM_PRESS, 0, 0);
-
WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
/* menus */
@@ -421,7 +422,7 @@ void ED_object_generic_keymap(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyM
wmKeyMapItem *kmi;
/* used by mesh, curve & lattice only */
- if(do_pet) {
+ if (do_pet) {
/* context ops */
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_enum", OKEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit_falloff");
@@ -432,7 +433,8 @@ void ED_object_generic_keymap(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyM
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", OKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_proportional_edit_objects");
- } else { // Edit mode
+ }
+ else { // Edit mode
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit");
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 1e075fd4d43..57d0de522a1 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -124,46 +124,46 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
/* we need 1 to 3 selected vertices */
- if(obedit->type==OB_MESH) {
+ if (obedit->type==OB_MESH) {
Mesh *me= obedit->data;
BMEditMesh *em;
- EDBM_LoadEditBMesh(scene, obedit);
- EDBM_MakeEditBMesh(scene->toolsettings, scene, obedit);
+ EDBM_mesh_load(obedit);
+ EDBM_mesh_make(scene->toolsettings, scene, obedit);
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) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
- if(v1==0) v1= nr;
- else if(v2==0) v2= nr;
- else if(v3==0) v3= nr;
- else if(v4==0) v4= nr;
+ if (v1==0) v1= nr;
+ else if (v2==0) v2= nr;
+ else if (v3==0) v3= nr;
+ else if (v4==0) v4= nr;
else break;
}
nr++;
}
}
- else if(ELEM(obedit->type, OB_SURF, OB_CURVE)) {
+ else if (ELEM(obedit->type, OB_SURF, OB_CURVE)) {
ListBase *editnurb= object_editcurve_get(obedit);
cu= obedit->data;
nu= editnurb->first;
- while(nu) {
- if(nu->type == CU_BEZIER) {
+ while (nu) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
- if(BEZSELECTED_HIDDENHANDLES(cu, bezt)) {
- if(v1==0) v1= nr;
- else if(v2==0) v2= nr;
- else if(v3==0) v3= nr;
- else if(v4==0) v4= nr;
+ while (a--) {
+ if (BEZSELECTED_HIDDENHANDLES(cu, bezt)) {
+ if (v1==0) v1= nr;
+ else if (v2==0) v2= nr;
+ else if (v3==0) v3= nr;
+ else if (v4==0) v4= nr;
else break;
}
nr++;
@@ -173,12 +173,12 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->f1 & SELECT) {
- if(v1==0) v1= nr;
- else if(v2==0) v2= nr;
- else if(v3==0) v3= nr;
- else if(v4==0) v4= nr;
+ while (a--) {
+ if (bp->f1 & SELECT) {
+ if (v1==0) v1= nr;
+ else if (v2==0) v2= nr;
+ else if (v3==0) v3= nr;
+ else if (v4==0) v4= nr;
else break;
}
nr++;
@@ -188,17 +188,17 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
nu= nu->next;
}
}
- else if(obedit->type==OB_LATTICE) {
+ else if (obedit->type==OB_LATTICE) {
Lattice *lt= obedit->data;
a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
bp= lt->editlatt->latt->def;
- while(a--) {
- if(bp->f1 & SELECT) {
- if(v1==0) v1= nr;
- else if(v2==0) v2= nr;
- else if(v3==0) v3= nr;
- else if(v4==0) v4= nr;
+ while (a--) {
+ if (bp->f1 & SELECT) {
+ if (v1==0) v1= nr;
+ else if (v2==0) v2= nr;
+ else if (v3==0) v3= nr;
+ else if (v4==0) v4= nr;
else break;
}
nr++;
@@ -206,28 +206,28 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
}
}
- if(v4 || !((v1 && v2==0 && v3==0) || (v1 && v2 && v3)) ) {
+ if (v4 || !((v1 && v2==0 && v3==0) || (v1 && v2 && v3)) ) {
BKE_report(op->reports, RPT_ERROR, "Select either 1 or 3 vertices to parent to");
return OPERATOR_CANCELLED;
}
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
- if(ob != obedit) {
+ if (ob != obedit) {
ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
par= obedit->parent;
- while(par) {
- if(par==ob) break;
+ while (par) {
+ if (par==ob) break;
par= par->parent;
}
- if(par) {
+ if (par) {
BKE_report(op->reports, RPT_ERROR, "Loop in parents");
}
else {
Object workob;
ob->parent= BASACT->object;
- if(v3) {
+ if (v3) {
ob->partype= PARVERT3;
ob->par1= v1-1;
ob->par2= v2-1;
@@ -260,17 +260,17 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_parent_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Make Vertex Parent";
+ ot->name = "Make Vertex Parent";
ot->description = "Parent selected objects to the selected vertices";
- ot->idname= "OBJECT_OT_vertex_parent_set";
+ ot->idname = "OBJECT_OT_vertex_parent_set";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->poll= vertex_parent_set_poll;
- ot->exec= vertex_parent_set_exec;
+ ot->invoke = WM_operator_confirm;
+ ot->poll = vertex_parent_set_poll;
+ ot->exec = vertex_parent_set_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** Make Proxy Operator *************************/
@@ -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;
}
@@ -377,7 +375,7 @@ static EnumPropertyItem *proxy_group_object_itemf(bContext *C, PointerRNA *UNUSE
Object *ob= ED_object_active_context(C);
GroupObject *go;
- if(!ob || !ob->dup_group)
+ if (!ob || !ob->dup_group)
return DummyRNA_DEFAULT_items;
/* find the object to affect */
@@ -398,22 +396,22 @@ void OBJECT_OT_proxy_make (wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Make Proxy";
- ot->idname= "OBJECT_OT_proxy_make";
- ot->description= "Add empty object to become local replacement data of a library-linked object";
+ ot->name = "Make Proxy";
+ ot->idname = "OBJECT_OT_proxy_make";
+ ot->description = "Add empty object to become local replacement data of a library-linked object";
/* callbacks */
- ot->invoke= make_proxy_invoke;
- ot->exec= make_proxy_exec;
- ot->poll= ED_operator_object_active;
+ ot->invoke = make_proxy_invoke;
+ ot->exec = make_proxy_exec;
+ ot->poll = ED_operator_object_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
prop= RNA_def_enum(ot->srna, "object", DummyRNA_DEFAULT_items, 0, "Proxy Object", "Name of lib-linked/grouped object to make a proxy for"); /* XXX, relies on hard coded ID at the moment */
RNA_def_enum_funcs(prop, proxy_group_object_itemf);
- ot->prop= prop;
+ ot->prop = prop;
}
/********************** Clear Parent Operator ******************* */
@@ -432,17 +430,17 @@ void ED_object_parent_clear(bContext *C, int type)
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects)
{
- if(ob->parent == NULL)
+ if (ob->parent == NULL)
continue;
- if(type == 0) {
+ if (type == 0) {
ob->parent= NULL;
}
- else if(type == 1) {
+ else if (type == 1) {
ob->parent= NULL;
object_apply_mat4(ob, ob->obmat, TRUE, FALSE);
}
- else if(type == 2)
+ else if (type == 2)
unit_m4(ob->parentinv);
ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
@@ -466,20 +464,20 @@ static int parent_clear_exec(bContext *C, wmOperator *op)
void OBJECT_OT_parent_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Parent";
+ ot->name = "Clear Parent";
ot->description = "Clear the object's parenting";
- ot->idname= "OBJECT_OT_parent_clear";
+ ot->idname = "OBJECT_OT_parent_clear";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= parent_clear_exec;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = parent_clear_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
- ot->prop= RNA_def_enum(ot->srna, "type", prop_clear_parent_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_clear_parent_types, 0, "Type", "");
}
/* ******************** Make Parent Operator *********************** */
@@ -526,38 +524,38 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
par->recalc |= OB_RECALC_OB;
/* preconditions */
- if(partype==PAR_FOLLOW || partype==PAR_PATH_CONST) {
- if(par->type!=OB_CURVE)
+ if (partype==PAR_FOLLOW || partype==PAR_PATH_CONST) {
+ if (par->type!=OB_CURVE)
return 0;
else {
Curve *cu= par->data;
- if((cu->flag & CU_PATH)==0) {
+ if ((cu->flag & CU_PATH)==0) {
cu->flag |= CU_PATH|CU_FOLLOW;
makeDispListCurveTypes(scene, par, 0); /* force creation of path data */
}
else cu->flag |= CU_FOLLOW;
/* if follow, add F-Curve for ctime (i.e. "eval_time") so that path-follow works */
- if(partype == PAR_FOLLOW) {
+ if (partype == PAR_FOLLOW) {
/* get or create F-Curve */
bAction *act = verify_adt_action(&cu->id, 1);
FCurve *fcu = verify_fcurve(act, NULL, "eval_time", 0, 1);
- /* setup dummy 'generator' modifier here to get 1-1 correspondance still working */
+ /* setup dummy 'generator' modifier here to get 1-1 correspondence still working */
if (!fcu->bezt && !fcu->fpt && !fcu->modifiers.first)
add_fmodifier(&fcu->modifiers, FMODIFIER_TYPE_GENERATOR);
}
/* fall back on regular parenting now (for follow only) */
- if(partype == PAR_FOLLOW)
+ if (partype == PAR_FOLLOW)
partype= PAR_OBJECT;
}
}
- else if(partype==PAR_BONE) {
+ else if (partype==PAR_BONE) {
pchan= get_active_posechannel(par);
- if(pchan==NULL) {
+ if (pchan==NULL) {
BKE_report(reports, RPT_ERROR, "No active Bone");
return 0;
}
@@ -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) {
@@ -624,7 +620,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
ob->partype= PAROBJECT; /* note, dna define, not operator property */
/* constraint */
- if(partype == PAR_PATH_CONST) {
+ if (partype == PAR_PATH_CONST) {
bConstraint *con;
bFollowPathConstraint *data;
float cmat[4][4], vec[3];
@@ -641,12 +637,12 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
ob->loc[1] = vec[1];
ob->loc[2] = vec[2];
}
- else if(pararm && ob->type==OB_MESH && par->type == OB_ARMATURE) {
- if(partype == PAR_ARMATURE_NAME)
+ else if (pararm && ob->type==OB_MESH && par->type == OB_ARMATURE) {
+ if (partype == PAR_ARMATURE_NAME)
create_vgroups_from_armature(reports, scene, ob, par, ARM_GROUPS_NAME, 0);
- else if(partype == PAR_ARMATURE_ENVELOPE)
+ else if (partype == PAR_ARMATURE_ENVELOPE)
create_vgroups_from_armature(reports, scene, ob, par, ARM_GROUPS_ENVELOPE, 0);
- else if(partype == PAR_ARMATURE_AUTO) {
+ else if (partype == PAR_ARMATURE_AUTO) {
WM_cursor_wait(1);
create_vgroups_from_armature(reports, scene, ob, par, ARM_GROUPS_AUTO, 0);
WM_cursor_wait(0);
@@ -709,19 +705,19 @@ static int parent_set_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSE
uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_OBJECT);
/* ob becomes parent, make the associated menus */
- if(ob->type==OB_ARMATURE) {
+ if (ob->type==OB_ARMATURE) {
uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_ARMATURE);
uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_ARMATURE_NAME);
uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_ARMATURE_ENVELOPE);
uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_ARMATURE_AUTO);
uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_BONE);
}
- else if(ob->type==OB_CURVE) {
+ else if (ob->type==OB_CURVE) {
uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_CURVE);
uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_FOLLOW);
uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_PATH_CONST);
}
- else if(ob->type == OB_LATTICE) {
+ else if (ob->type == OB_LATTICE) {
uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_LATTICE);
}
@@ -734,18 +730,18 @@ static int parent_set_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSE
void OBJECT_OT_parent_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Make Parent";
+ ot->name = "Make Parent";
ot->description = "Set the object's parenting";
- ot->idname= "OBJECT_OT_parent_set";
+ ot->idname = "OBJECT_OT_parent_set";
/* api callbacks */
- ot->invoke= parent_set_invoke;
- ot->exec= parent_set_exec;
+ ot->invoke = parent_set_invoke;
+ ot->exec = parent_set_exec;
- ot->poll= ED_operator_object_active;
+ ot->poll = ED_operator_object_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "type", prop_make_parent_types, 0, "Type", "");
}
@@ -791,17 +787,17 @@ static int parent_noinv_set_exec(bContext *C, wmOperator *op)
void OBJECT_OT_parent_no_inverse_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Make Parent without Inverse";
+ ot->name = "Make Parent without Inverse";
ot->description = "Set the object's parenting without setting the inverse parent correction";
- ot->idname= "OBJECT_OT_parent_no_inverse_set";
+ ot->idname = "OBJECT_OT_parent_no_inverse_set";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= parent_noinv_set_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = parent_noinv_set_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ Clear Slow Parent Operator *********************/
@@ -812,8 +808,8 @@ static int object_slow_parent_clear_exec(bContext *C, wmOperator *UNUSED(op))
Scene *scene= CTX_data_scene(C);
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
- if(ob->parent) {
- if(ob->partype & PARSLOW) {
+ if (ob->parent) {
+ if (ob->partype & PARSLOW) {
ob->partype -= PARSLOW;
where_is_object(scene, ob);
ob->partype |= PARSLOW;
@@ -833,17 +829,17 @@ void OBJECT_OT_slow_parent_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Slow Parent";
+ ot->name = "Clear Slow Parent";
ot->description = "Clear the object's slow parent";
- ot->idname= "OBJECT_OT_slow_parent_clear";
+ ot->idname = "OBJECT_OT_slow_parent_clear";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= object_slow_parent_clear_exec;
- ot->poll= ED_operator_view3d_active;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = object_slow_parent_clear_exec;
+ ot->poll = ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** Make Slow Parent Operator *********************/
@@ -854,7 +850,7 @@ static int object_slow_parent_set_exec(bContext *C, wmOperator *UNUSED(op))
Scene *scene= CTX_data_scene(C);
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
- if(ob->parent)
+ if (ob->parent)
ob->partype |= PARSLOW;
ob->recalc |= OB_RECALC_OB;
@@ -872,17 +868,17 @@ void OBJECT_OT_slow_parent_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Slow Parent";
+ ot->name = "Set Slow Parent";
ot->description = "Set the object's slow parent";
- ot->idname= "OBJECT_OT_slow_parent_set";
+ ot->idname = "OBJECT_OT_slow_parent_set";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= object_slow_parent_set_exec;
- ot->poll= ED_operator_view3d_active;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = object_slow_parent_set_exec;
+ ot->poll = ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Clear Track Operator ******************* */
@@ -900,7 +896,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C);
int type= RNA_enum_get(op->ptr, "type");
- if(CTX_data_edit_object(C)) {
+ if (CTX_data_edit_object(C)) {
BKE_report(op->reports, RPT_ERROR, "Operation cannot be performed in EditMode");
return OPERATOR_CANCELLED;
}
@@ -918,7 +914,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op)
remove_constraint(&ob->constraints, con);
}
- if(type == 1)
+ if (type == 1)
object_apply_mat4(ob, ob->obmat, TRUE, TRUE);
}
CTX_DATA_END;
@@ -933,20 +929,20 @@ static int object_track_clear_exec(bContext *C, wmOperator *op)
void OBJECT_OT_track_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear track";
+ ot->name = "Clear track";
ot->description = "Clear tracking constraint or flag from object";
- ot->idname= "OBJECT_OT_track_clear";
+ ot->idname = "OBJECT_OT_track_clear";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= object_track_clear_exec;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = object_track_clear_exec;
- ot->poll= ED_operator_objectmode;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
- ot->prop= RNA_def_enum(ot->srna, "type", prop_clear_track_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_clear_track_types, 0, "Type", "");
}
/************************** Make Track Operator *****************************/
@@ -966,12 +962,12 @@ static int track_set_exec(bContext *C, wmOperator *op)
int type= RNA_enum_get(op->ptr, "type");
- if(type == 1) {
+ if (type == 1) {
bConstraint *con;
bDampTrackConstraint *data;
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
- if(ob!=obact) {
+ if (ob!=obact) {
con = add_ob_constraint(ob, "AutoTrack", CONSTRAINT_TYPE_DAMPTRACK);
data = con->data;
@@ -985,12 +981,12 @@ static int track_set_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
}
- else if(type == 2) {
+ else if (type == 2) {
bConstraint *con;
bTrackToConstraint *data;
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
- if(ob!=obact) {
+ if (ob!=obact) {
con = add_ob_constraint(ob, "AutoTrack", CONSTRAINT_TYPE_TRACKTO);
data = con->data;
@@ -1006,12 +1002,12 @@ static int track_set_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
}
- else if(type == 3) {
+ else if (type == 3) {
bConstraint *con;
bLockTrackConstraint *data;
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
- if(ob!=obact) {
+ if (ob!=obact) {
con = add_ob_constraint(ob, "AutoTrack", CONSTRAINT_TYPE_LOCKTRACK);
data = con->data;
@@ -1038,21 +1034,21 @@ static int track_set_exec(bContext *C, wmOperator *op)
void OBJECT_OT_track_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Make Track";
+ ot->name = "Make Track";
ot->description = "Make the object track another object, either by constraint or old way or locked track";
- ot->idname= "OBJECT_OT_track_set";
+ ot->idname = "OBJECT_OT_track_set";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= track_set_exec;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = track_set_exec;
- ot->poll= ED_operator_objectmode;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_make_track_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_make_track_types, 0, "Type", "");
}
/************************** Move to Layer Operator *****************************/
@@ -1062,14 +1058,14 @@ static unsigned int move_to_layer_init(bContext *C, wmOperator *op)
int values[20], a;
unsigned int lay= 0;
- if(!RNA_struct_property_is_set(op->ptr, "layers")) {
+ if (!RNA_struct_property_is_set(op->ptr, "layers")) {
/* note: layers are set in bases, library objects work for this */
CTX_DATA_BEGIN(C, Base*, base, selected_bases) {
lay |= base->lay;
}
CTX_DATA_END;
- for(a=0; a<20; a++)
+ for (a=0; a<20; a++)
values[a]= (lay & (1<<a));
RNA_boolean_set_array(op->ptr, "layers", values);
@@ -1077,8 +1073,8 @@ static unsigned int move_to_layer_init(bContext *C, wmOperator *op)
else {
RNA_boolean_get_array(op->ptr, "layers", values);
- for(a=0; a<20; a++)
- if(values[a])
+ for (a=0; a<20; a++)
+ if (values[a])
lay |= (1 << a);
}
@@ -1088,7 +1084,7 @@ static unsigned int move_to_layer_init(bContext *C, wmOperator *op)
static int move_to_layer_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
View3D *v3d= CTX_wm_view3d(C);
- if(v3d && v3d->localvd) {
+ if (v3d && v3d->localvd) {
return WM_operator_confirm_message(C, op, "Move from localview");
}
else {
@@ -1108,9 +1104,9 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
lay= move_to_layer_init(C, op);
lay &= 0xFFFFFF;
- if(lay==0) return OPERATOR_CANCELLED;
+ if (lay==0) return OPERATOR_CANCELLED;
- if(v3d && v3d->localvd) {
+ if (v3d && v3d->localvd) {
/* now we can move out of localview. */
/* note: layers are set in bases, library objects work for this */
CTX_DATA_BEGIN(C, Base*, base, selected_bases) {
@@ -1119,7 +1115,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
base->object->lay= lay;
base->object->flag &= ~SELECT;
base->flag &= ~SELECT;
- /* if(base->object->type==OB_LAMP) islamp= 1; */
+ /* if (base->object->type==OB_LAMP) islamp= 1; */
}
CTX_DATA_END;
}
@@ -1131,7 +1127,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
local= base->lay & 0xFF000000;
base->lay= lay + local;
base->object->lay= lay;
- /* if(base->object->type==OB_LAMP) islamp= 1; */
+ /* if (base->object->type==OB_LAMP) islamp= 1; */
}
CTX_DATA_END;
}
@@ -1149,17 +1145,17 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
void OBJECT_OT_move_to_layer(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move to Layer";
+ ot->name = "Move to Layer";
ot->description = "Move the object to different layers";
- ot->idname= "OBJECT_OT_move_to_layer";
+ ot->idname = "OBJECT_OT_move_to_layer";
/* api callbacks */
- ot->invoke= move_to_layer_invoke;
- ot->exec= move_to_layer_exec;
- ot->poll= ED_operator_objectmode;
+ ot->invoke = move_to_layer_invoke;
+ ot->exec = move_to_layer_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean_layer_member(ot->srna, "layers", 20, NULL, "Layer", "");
@@ -1173,11 +1169,11 @@ static void link_to_scene(Main *UNUSED(bmain), unsigned short UNUSED(nr))
Scene *sce= (Scene*) BLI_findlink(&bmain->scene, G.curscreen->scenenr-1);
Base *base, *nbase;
- if(sce==0) return;
- if(sce->id.lib) return;
+ if (sce==0) return;
+ if (sce->id.lib) return;
- for(base= FIRSTBASE; base; base= base->next) {
- if(TESTBASE(v3d, base)) {
+ for (base= FIRSTBASE; base; base= base->next) {
+ if (TESTBASE(v3d, base)) {
nbase= MEM_mallocN( sizeof(Base), "newbase");
*nbase= *base;
@@ -1193,24 +1189,24 @@ static int make_links_scene_exec(bContext *C, wmOperator *op)
Main *bmain= CTX_data_main(C);
Scene *scene_to= BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "scene"));
- if(scene_to==NULL) {
+ if (scene_to==NULL) {
BKE_report(op->reports, RPT_ERROR, "Scene not found");
return OPERATOR_CANCELLED;
}
- if(scene_to == CTX_data_scene(C)) {
+ if (scene_to == CTX_data_scene(C)) {
BKE_report(op->reports, RPT_ERROR, "Can't link objects into the same scene");
return OPERATOR_CANCELLED;
}
- if(scene_to->id.lib) {
+ if (scene_to->id.lib) {
BKE_report(op->reports, RPT_ERROR, "Can't link objects into a linked scene");
return OPERATOR_CANCELLED;
}
CTX_DATA_BEGIN(C, Base*, base, selected_bases)
{
- if(!object_in_scene(base->object, scene_to)) {
+ if (!object_in_scene(base->object, scene_to)) {
Base *nbase= MEM_mallocN( sizeof(Base), "newbase");
*nbase= *base;
BLI_addhead( &(scene_to->base), nbase);
@@ -1270,7 +1266,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
ob= ED_object_active_context(C);
CTX_DATA_BEGIN(C, Object*, obt, selected_editable_objects) {
- if(ob != obt) {
+ if (ob != obt) {
if (allow_make_links_data(event, ob, obt)) {
switch(event) {
case MAKE_LINKS_OBDATA: /* obdata */
@@ -1288,7 +1284,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
break;
case MAKE_LINKS_MATERIALS:
/* new approach, using functions from kernel */
- for(a=0; a<ob->totcol; a++) {
+ for (a=0; a<ob->totcol; a++) {
Material *ma= give_current_material(ob, a+1);
assign_material(obt, ma, a+1); /* also works with ma==NULL */
}
@@ -1299,7 +1295,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
break;
case MAKE_LINKS_DUPLIGROUP:
obt->dup_group= ob->dup_group;
- if(obt->dup_group) {
+ if (obt->dup_group) {
id_lib_extern(&obt->dup_group->id);
obt->transflag |= OB_DUPLIGROUP;
}
@@ -1327,22 +1323,22 @@ void OBJECT_OT_make_links_scene(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Link Objects to Scene";
+ ot->name = "Link Objects to Scene";
ot->description = "Link selection to another scene";
- ot->idname= "OBJECT_OT_make_links_scene";
+ ot->idname = "OBJECT_OT_make_links_scene";
/* api callbacks */
- ot->invoke= WM_enum_search_invoke;
- ot->exec= make_links_scene_exec;
+ ot->invoke = WM_enum_search_invoke;
+ ot->exec = make_links_scene_exec;
/* better not run the poll check */
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
prop= RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", "");
RNA_def_enum_funcs(prop, RNA_scene_local_itemf);
- ot->prop= prop;
+ ot->prop = prop;
}
void OBJECT_OT_make_links_data(wmOperatorType *ot)
@@ -1356,19 +1352,19 @@ void OBJECT_OT_make_links_data(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Link Data";
+ ot->name = "Link Data";
ot->description = "Make links from the active object to other selected objects";
- ot->idname= "OBJECT_OT_make_links_data";
+ ot->idname = "OBJECT_OT_make_links_data";
/* api callbacks */
- ot->exec= make_links_data_exec;
- ot->poll= ED_operator_object_active;
+ ot->exec = make_links_data_exec;
+ ot->poll = ED_operator_object_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", make_links_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", make_links_items, 0, "Type", "");
}
@@ -1382,7 +1378,7 @@ static void single_object_users(Scene *scene, View3D *v3d, int flag)
clear_sca_new_poins(); /* sensor/contr/act */
/* duplicate (must set newid) */
- for(base= FIRSTBASE; base; base= base->next) {
+ for (base= FIRSTBASE; base; base= base->next) {
ob= base->object;
/* newid may still have some trash from Outliner tree building,
@@ -1390,8 +1386,8 @@ static void single_object_users(Scene *scene, View3D *v3d, int flag)
*/
ob->id.newid = NULL;
- if( (base->flag & flag)==flag ) {
- if(ob->id.lib==NULL && ob->id.us>1) {
+ if ( (base->flag & flag)==flag ) {
+ if (ob->id.lib==NULL && ob->id.us>1) {
/* base gets copy of object */
obn= copy_object(ob);
base->object= obn;
@@ -1401,10 +1397,10 @@ static void single_object_users(Scene *scene, View3D *v3d, int flag)
}
ID_NEW(scene->camera);
- if(v3d) ID_NEW(v3d->camera);
+ if (v3d) ID_NEW(v3d->camera);
/* object pointers */
- for(base= FIRSTBASE; base; base= base->next) {
+ for (base= FIRSTBASE; base; base= base->next) {
object_relink(base->object);
}
@@ -1417,8 +1413,8 @@ void ED_object_single_user(Scene *scene, Object *ob)
{
Base *base;
- for(base= FIRSTBASE; base; base= base->next) {
- if(base->object == ob) base->flag |= OB_DONE;
+ for (base= FIRSTBASE; base; base= base->next) {
+ if (base->object == ob) base->flag |= OB_DONE;
else base->flag &= ~OB_DONE;
}
@@ -1430,15 +1426,15 @@ static void new_id_matar(Material **matar, int totcol)
ID *id;
int a;
- for(a=0; a<totcol; a++) {
+ for (a=0; a<totcol; a++) {
id= (ID *)matar[a];
- if(id && id->lib == NULL) {
- if(id->newid) {
+ if (id && id->lib == NULL) {
+ if (id->newid) {
matar[a]= (Material *)id->newid;
id_us_plus(id->newid);
id->us--;
}
- else if(id->us>1) {
+ else if (id->us>1) {
matar[a]= copy_material(matar[a]);
id->us--;
id->newid= (ID *)matar[a];
@@ -1458,12 +1454,12 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag)
ID *id;
int a;
- for(base= FIRSTBASE; base; base= base->next) {
+ for (base= FIRSTBASE; base; base= base->next) {
ob= base->object;
- if(ob->id.lib==NULL && (base->flag & flag)==flag ) {
+ if (ob->id.lib==NULL && (base->flag & flag)==flag ) {
id= ob->data;
- if(id && id->us>1 && id->lib==NULL) {
+ if (id && id->us>1 && id->lib==NULL) {
ob->recalc= OB_RECALC_DATA;
BKE_copy_animdata_id_action(id);
@@ -1471,8 +1467,8 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag)
switch(ob->type) {
case OB_LAMP:
ob->data= la= copy_lamp(ob->data);
- for(a=0; a<MAX_MTEX; a++) {
- if(la->mtex[a]) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (la->mtex[a]) {
ID_NEW(la->mtex[a]->object);
}
}
@@ -1508,8 +1504,8 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag)
ob->data= copy_speaker(ob->data);
break;
default:
- if (G.f & G_DEBUG)
- printf("ERROR single_obdata_users: can't copy %s\n", id->name);
+ if (G.debug & G_DEBUG)
+ printf("ERROR %s: can't copy %s\n", __func__, id->name);
return;
}
@@ -1522,7 +1518,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag)
}
me= bmain->mesh.first;
- while(me) {
+ while (me) {
ID_NEW(me->texcomesh);
me= me->id.next;
}
@@ -1533,9 +1529,9 @@ static void single_object_action_users(Scene *scene, int flag)
Object *ob;
Base *base;
- for(base= FIRSTBASE; base; base= base->next) {
+ for (base= FIRSTBASE; base; base= base->next) {
ob= base->object;
- if(ob->id.lib==NULL && (flag==0 || (base->flag & SELECT)) ) {
+ if (ob->id.lib==NULL && (flag==0 || (base->flag & SELECT)) ) {
ob->recalc= OB_RECALC_DATA;
BKE_copy_animdata_id_action(&ob->id);
}
@@ -1550,26 +1546,26 @@ static void single_mat_users(Scene *scene, int flag, int do_textures)
Tex *tex;
int a, b;
- for(base= FIRSTBASE; base; base= base->next) {
+ for (base= FIRSTBASE; base; base= base->next) {
ob= base->object;
- if(ob->id.lib==NULL && (flag==0 || (base->flag & SELECT)) ) {
+ if (ob->id.lib==NULL && (flag==0 || (base->flag & SELECT)) ) {
- for(a=1; a<=ob->totcol; a++) {
+ for (a=1; a<=ob->totcol; a++) {
ma= give_current_material(ob, a);
- if(ma) {
+ if (ma) {
/* do not test for LIB_NEW: this functions guaranteed delivers single_users! */
- if(ma->id.us>1) {
+ if (ma->id.us>1) {
man= copy_material(ma);
BKE_copy_animdata_id_action(&man->id);
man->id.us= 0;
assign_material(ob, man, a);
- if(do_textures) {
- for(b=0; b<MAX_MTEX; b++) {
- if(ma->mtex[b] && (tex= ma->mtex[b]->tex)) {
- if(tex->id.us>1) {
+ if (do_textures) {
+ for (b=0; b<MAX_MTEX; b++) {
+ if (ma->mtex[b] && (tex= ma->mtex[b]->tex)) {
+ if (tex->id.us>1) {
tex->id.us--;
tex= copy_texture(tex);
BKE_copy_animdata_id_action(&tex->id);
@@ -1590,14 +1586,14 @@ static void do_single_tex_user(Tex **from)
Tex *tex, *texn;
tex= *from;
- if(tex==NULL) return;
+ if (tex==NULL) return;
- if(tex->id.newid) {
+ if (tex->id.newid) {
*from= (Tex *)tex->id.newid;
id_us_plus(tex->id.newid);
tex->id.us--;
}
- else if(tex->id.us>1) {
+ else if (tex->id.us>1) {
texn= copy_texture(tex);
BKE_copy_animdata_id_action(&texn->id);
tex->id.newid= (ID *)texn;
@@ -1614,30 +1610,30 @@ static void single_tex_users_expand(Main *bmain)
World *wo;
int b;
- for(ma= bmain->mat.first; ma; ma=ma->id.next) {
- if(ma->id.flag & LIB_NEW) {
- for(b=0; b<MAX_MTEX; b++) {
- if(ma->mtex[b] && ma->mtex[b]->tex) {
+ for (ma= bmain->mat.first; ma; ma=ma->id.next) {
+ if (ma->id.flag & LIB_NEW) {
+ for (b=0; b<MAX_MTEX; b++) {
+ if (ma->mtex[b] && ma->mtex[b]->tex) {
do_single_tex_user( &(ma->mtex[b]->tex) );
}
}
}
}
- for(la= bmain->lamp.first; la; la=la->id.next) {
- if(la->id.flag & LIB_NEW) {
- for(b=0; b<MAX_MTEX; b++) {
- if(la->mtex[b] && la->mtex[b]->tex) {
+ for (la= bmain->lamp.first; la; la=la->id.next) {
+ if (la->id.flag & LIB_NEW) {
+ for (b=0; b<MAX_MTEX; b++) {
+ if (la->mtex[b] && la->mtex[b]->tex) {
do_single_tex_user( &(la->mtex[b]->tex) );
}
}
}
}
- for(wo= bmain->world.first; wo; wo=wo->id.next) {
- if(wo->id.flag & LIB_NEW) {
- for(b=0; b<MAX_MTEX; b++) {
- if(wo->mtex[b] && wo->mtex[b]->tex) {
+ for (wo= bmain->world.first; wo; wo=wo->id.next) {
+ if (wo->id.flag & LIB_NEW) {
+ for (b=0; b<MAX_MTEX; b++) {
+ if (wo->mtex[b] && wo->mtex[b]->tex) {
do_single_tex_user( &(wo->mtex[b]->tex) );
}
}
@@ -1655,27 +1651,27 @@ static void single_mat_users_expand(Main *bmain)
Material *ma;
int a;
- for(ob=bmain->object.first; ob; ob=ob->id.next)
- if(ob->id.flag & LIB_NEW)
+ for (ob=bmain->object.first; ob; ob=ob->id.next)
+ if (ob->id.flag & LIB_NEW)
new_id_matar(ob->mat, ob->totcol);
- for(me=bmain->mesh.first; me; me=me->id.next)
- if(me->id.flag & LIB_NEW)
+ for (me=bmain->mesh.first; me; me=me->id.next)
+ if (me->id.flag & LIB_NEW)
new_id_matar(me->mat, me->totcol);
- for(cu=bmain->curve.first; cu; cu=cu->id.next)
- if(cu->id.flag & LIB_NEW)
+ for (cu=bmain->curve.first; cu; cu=cu->id.next)
+ if (cu->id.flag & LIB_NEW)
new_id_matar(cu->mat, cu->totcol);
- for(mb=bmain->mball.first; mb; mb=mb->id.next)
- if(mb->id.flag & LIB_NEW)
+ for (mb=bmain->mball.first; mb; mb=mb->id.next)
+ if (mb->id.flag & LIB_NEW)
new_id_matar(mb->mat, mb->totcol);
/* material imats */
- for(ma=bmain->mat.first; ma; ma=ma->id.next)
- if(ma->id.flag & LIB_NEW)
- for(a=0; a<MAX_MTEX; a++)
- if(ma->mtex[a])
+ for (ma=bmain->mat.first; ma; ma=ma->id.next)
+ if (ma->id.flag & LIB_NEW)
+ for (a=0; a<MAX_MTEX; a++)
+ if (ma->mtex[a])
ID_NEW(ma->mtex[a]->object);
}
@@ -1684,7 +1680,7 @@ void ED_object_single_users(Main *bmain, Scene *scene, int full)
{
single_object_users(scene, NULL, 0);
- if(full) {
+ if (full) {
single_obdata_users(bmain, scene, 0);
single_object_action_users(scene, 0);
single_mat_users_expand(bmain);
@@ -1704,12 +1700,12 @@ static void make_local_makelocalmaterial(Material *ma)
id_make_local(&ma->id, 0);
- for(b=0; b<MAX_MTEX; b++)
- if(ma->mtex[b] && ma->mtex[b]->tex)
+ for (b=0; b<MAX_MTEX; b++)
+ if (ma->mtex[b] && ma->mtex[b]->tex)
id_make_local(&ma->mtex[b]->tex->id, 0);
adt= BKE_animdata_from_id(&ma->id);
- if(adt) BKE_animdata_make_local(adt);
+ if (adt) BKE_animdata_make_local(adt);
/* nodetree? XXX */
}
@@ -1724,7 +1720,7 @@ static int make_local_exec(bContext *C, wmOperator *op)
ID *id;
int a, b, mode= RNA_enum_get(op->ptr, "type");
- if(mode==3) {
+ if (mode==3) {
BKE_library_make_local(bmain, NULL, 0); /* NULL is all libs */
WM_event_add_notifier(C, NC_WINDOW, NULL);
return OPERATOR_FINISHED;
@@ -1733,14 +1729,14 @@ static int make_local_exec(bContext *C, wmOperator *op)
clear_id_newpoins();
CTX_DATA_BEGIN(C, Object*, ob, selected_objects) {
- if(ob->id.lib)
+ if (ob->id.lib)
id_make_local(&ob->id, 0);
}
CTX_DATA_END;
/* maybe object pointers */
CTX_DATA_BEGIN(C, Object*, ob, selected_objects) {
- if(ob->id.lib==NULL) {
+ if (ob->id.lib==NULL) {
ID_NEW(ob->parent);
}
}
@@ -1749,51 +1745,51 @@ static int make_local_exec(bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, Object*, ob, selected_objects) {
id= ob->data;
- if(id && mode>1) {
+ if (id && mode>1) {
id_make_local(id, 0);
adt= BKE_animdata_from_id(id);
- if(adt) BKE_animdata_make_local(adt);
+ if (adt) BKE_animdata_make_local(adt);
/* tag indirect data direct */
matarar= (Material ***)give_matarar(ob);
- if(matarar) {
- for(a=0; a<ob->totcol; a++) {
+ if (matarar) {
+ for (a=0; a<ob->totcol; a++) {
ma= (*matarar)[a];
- if(ma)
+ if (ma)
id_lib_extern(&ma->id);
}
}
}
- for(psys=ob->particlesystem.first; psys; psys=psys->next)
+ for (psys=ob->particlesystem.first; psys; psys=psys->next)
id_make_local(&psys->part->id, 0);
adt= BKE_animdata_from_id(&ob->id);
- if(adt) BKE_animdata_make_local(adt);
+ if (adt) BKE_animdata_make_local(adt);
}
CTX_DATA_END;
- if(mode>1) {
+ if (mode>1) {
CTX_DATA_BEGIN(C, Object*, ob, selected_objects) {
- if(ob->type==OB_LAMP) {
+ if (ob->type==OB_LAMP) {
la= ob->data;
- for(b=0; b<MAX_MTEX; b++)
- if(la->mtex[b] && la->mtex[b]->tex)
+ for (b=0; b<MAX_MTEX; b++)
+ if (la->mtex[b] && la->mtex[b]->tex)
id_make_local(&la->mtex[b]->tex->id, 0);
}
else {
- for(a=0; a<ob->totcol; a++) {
+ for (a=0; a<ob->totcol; a++) {
ma= ob->mat[a];
- if(ma)
+ if (ma)
make_local_makelocalmaterial(ma);
}
matarar= (Material ***)give_matarar(ob);
- if(matarar) {
- for(a=0; a<ob->totcol; a++) {
+ if (matarar) {
+ for (a=0; a<ob->totcol; a++) {
ma= (*matarar)[a];
- if(ma)
+ if (ma)
make_local_makelocalmaterial(ma);
}
}
@@ -1816,20 +1812,20 @@ void OBJECT_OT_make_local(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Make Local";
+ ot->name = "Make Local";
ot->description = "Make library linked datablocks local to this file";
- ot->idname= "OBJECT_OT_make_local";
+ ot->idname = "OBJECT_OT_make_local";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= make_local_exec;
- ot->poll= ED_operator_objectmode;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = make_local_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "");
}
static int make_single_user_exec(bContext *C, wmOperator *op)
@@ -1839,20 +1835,20 @@ static int make_single_user_exec(bContext *C, wmOperator *op)
View3D *v3d= CTX_wm_view3d(C); /* ok if this is NULL */
int flag= RNA_enum_get(op->ptr, "type"); /* 0==ALL, SELECTED==selected objecs */
- if(RNA_boolean_get(op->ptr, "object"))
+ if (RNA_boolean_get(op->ptr, "object"))
single_object_users(scene, v3d, flag);
- if(RNA_boolean_get(op->ptr, "obdata"))
+ if (RNA_boolean_get(op->ptr, "obdata"))
single_obdata_users(bmain, scene, flag);
- if(RNA_boolean_get(op->ptr, "material"))
+ if (RNA_boolean_get(op->ptr, "material"))
single_mat_users(scene, flag, RNA_boolean_get(op->ptr, "texture"));
#if 0 /* can't do this separate from materials */
- if(RNA_boolean_get(op->ptr, "texture"))
+ if (RNA_boolean_get(op->ptr, "texture"))
single_mat_users(scene, flag, TRUE);
#endif
- if(RNA_boolean_get(op->ptr, "animation"))
+ if (RNA_boolean_get(op->ptr, "animation"))
single_object_action_users(scene, flag);
clear_id_newpoins();
@@ -1869,20 +1865,20 @@ void OBJECT_OT_make_single_user(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Make Single User";
+ ot->name = "Make Single User";
ot->description = "Make linked data local to each object";
- ot->idname= "OBJECT_OT_make_single_user";
+ ot->idname = "OBJECT_OT_make_single_user";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= make_single_user_exec;
- ot->poll= ED_operator_objectmode;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = make_single_user_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", type_items, SELECT, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", type_items, SELECT, "Type", "");
RNA_def_boolean(ot->srna, "object", 0, "Object", "Make single user objects");
RNA_def_boolean(ot->srna, "obdata", 0, "Object Data", "Make single user object data");
@@ -1900,7 +1896,7 @@ static int drop_named_material_invoke(bContext *C, wmOperator *op, wmEvent *even
RNA_string_get(op->ptr, "name", name);
ma= (Material *)find_id("MA", name);
- if(base==NULL || ma==NULL)
+ if (base==NULL || ma==NULL)
return OPERATOR_CANCELLED;
assign_material(base->object, ma, 1);
@@ -1917,16 +1913,16 @@ void OBJECT_OT_drop_named_material(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Drop Named Material on Object";
+ ot->name = "Drop Named Material on Object";
ot->description = "";
- ot->idname= "OBJECT_OT_drop_named_material";
+ ot->idname = "OBJECT_OT_drop_named_material";
/* api callbacks */
- ot->invoke= drop_named_material_invoke;
- ot->poll= ED_operator_objectmode;
+ ot->invoke = drop_named_material_invoke;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* properties */
RNA_def_string(ot->srna, "name", "Material", MAX_ID_NAME-2, "Name", "Material name to assign");
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c
index 69372ac1a90..53726d70cf9 100644
--- a/source/blender/editors/object/object_select.c
+++ b/source/blender/editors/object/object_select.c
@@ -107,7 +107,7 @@ void ED_base_object_activate(bContext *C, Base *base)
/* sets scene->basact */
BASACT= base;
- if(base) {
+ if (base) {
/* XXX old signals, remember to handle notifiers now! */
// select_actionchannel_by_name(base->object->action, "Object", 1);
@@ -123,12 +123,12 @@ 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))
+ if (CTX_data_edit_object(C))
return 0;
- if(obact && obact->mode)
+ if (obact && obact->mode)
return 0;
return 1;
@@ -151,7 +151,7 @@ static int object_select_by_type_exec(bContext *C, wmOperator *op)
}
CTX_DATA_BEGIN(C, Base*, base, visible_bases) {
- if(base->object->type==obtype) {
+ if (base->object->type==obtype) {
ED_base_object_select(base, BA_SELECT);
}
}
@@ -165,21 +165,21 @@ static int object_select_by_type_exec(bContext *C, wmOperator *op)
void OBJECT_OT_select_by_type(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select By Type";
+ ot->name = "Select By Type";
ot->description = "Select all visible objects that are of a type";
- ot->idname= "OBJECT_OT_select_by_type";
+ ot->idname = "OBJECT_OT_select_by_type";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= object_select_by_type_exec;
- ot->poll= objects_selectable_poll;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = object_select_by_type_exec;
+ ot->poll = objects_selectable_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
- ot->prop= RNA_def_enum(ot->srna, "type", object_type_items, 1, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", object_type_items, 1, "Type", "");
}
/*********************** Selection by Links *********************/
@@ -225,67 +225,67 @@ static int object_select_linked_exec(bContext *C, wmOperator *op)
}
ob= OBACT;
- if(ob==NULL){
+ if (ob==NULL) {
BKE_report(op->reports, RPT_ERROR, "No Active Object");
return OPERATOR_CANCELLED;
}
- if(nr==1) {
+ if (nr==1) {
// XXX old animation system
//ipo= ob->ipo;
//if(ipo==0) return OPERATOR_CANCELLED;
return OPERATOR_CANCELLED;
}
- else if(nr==2) {
- if(ob->data==NULL) return OPERATOR_CANCELLED;
+ else if (nr==2) {
+ if (ob->data==NULL) return OPERATOR_CANCELLED;
obdata= ob->data;
}
- else if(nr==3 || nr==4) {
+ else if (nr==3 || nr==4) {
mat= give_current_material(ob, ob->actcol);
- if(mat==NULL) return OPERATOR_CANCELLED;
- if(nr==4) {
- if(mat->mtex[ (int)mat->texact ]) tex= mat->mtex[ (int)mat->texact ]->tex;
- if(tex==NULL) return OPERATOR_CANCELLED;
+ if (mat==NULL) return OPERATOR_CANCELLED;
+ if (nr==4) {
+ if (mat->mtex[ (int)mat->texact ]) tex= mat->mtex[ (int)mat->texact ]->tex;
+ if (tex==NULL) return OPERATOR_CANCELLED;
}
}
- else if(nr==5) {
- if(ob->dup_group==NULL) return OPERATOR_CANCELLED;
+ else if (nr==5) {
+ if (ob->dup_group==NULL) return OPERATOR_CANCELLED;
}
- else if(nr==6) {
- if(ob->particlesystem.first==NULL) return OPERATOR_CANCELLED;
+ else if (nr==6) {
+ if (ob->particlesystem.first==NULL) return OPERATOR_CANCELLED;
}
- else if(nr==7) {
+ else if (nr==7) {
/* do nothing */
}
- else if(nr==8) {
- if(ob->data==NULL) return OPERATOR_CANCELLED;
+ else if (nr==8) {
+ if (ob->data==NULL) return OPERATOR_CANCELLED;
}
else
return OPERATOR_CANCELLED;
CTX_DATA_BEGIN(C, Base*, base, visible_bases) {
- if(nr==1) {
+ if (nr==1) {
// XXX old animation system
//if(base->object->ipo==ipo) base->flag |= SELECT;
//changed = 1;
}
- else if(nr==2) {
- if(base->object->data==obdata) base->flag |= SELECT;
+ else if (nr==2) {
+ if (base->object->data==obdata) base->flag |= SELECT;
changed = 1;
}
- else if(nr==3 || nr==4) {
+ else if (nr==3 || nr==4) {
ob= base->object;
- for(a=1; a<=ob->totcol; a++) {
+ for (a=1; a<=ob->totcol; a++) {
mat1= give_current_material(ob, a);
- if(nr==3) {
- if(mat1==mat) base->flag |= SELECT;
+ if (nr==3) {
+ if (mat1==mat) base->flag |= SELECT;
changed = 1;
}
- else if(mat1 && nr==4) {
- for(b=0; b<MAX_MTEX; b++) {
- if(mat1->mtex[b]) {
- if(tex==mat1->mtex[b]->tex) {
+ else if (mat1 && nr==4) {
+ for (b=0; b<MAX_MTEX; b++) {
+ if (mat1->mtex[b]) {
+ if (tex==mat1->mtex[b]->tex) {
base->flag |= SELECT;
changed = 1;
break;
@@ -295,19 +295,19 @@ static int object_select_linked_exec(bContext *C, wmOperator *op)
}
}
}
- else if(nr==5) {
- if(base->object->dup_group==ob->dup_group) {
+ else if (nr==5) {
+ if (base->object->dup_group==ob->dup_group) {
base->flag |= SELECT;
changed = 1;
}
}
- else if(nr==6) {
+ else if (nr==6) {
/* loop through other, then actives particles*/
ParticleSystem *psys;
ParticleSystem *psys_act;
- for(psys=base->object->particlesystem.first; psys; psys=psys->next) {
- for(psys_act=ob->particlesystem.first; psys_act; psys_act=psys_act->next) {
+ for (psys=base->object->particlesystem.first; psys; psys=psys->next) {
+ for (psys_act=ob->particlesystem.first; psys_act; psys_act=psys_act->next) {
if (psys->part == psys_act->part) {
base->flag |= SELECT;
changed = 1;
@@ -320,14 +320,14 @@ static int object_select_linked_exec(bContext *C, wmOperator *op)
}
}
}
- else if(nr==7) {
- if(ob->id.lib == base->object->id.lib) {
+ else if (nr==7) {
+ if (ob->id.lib == base->object->id.lib) {
base->flag |= SELECT;
changed= 1;
}
}
- else if(nr==8) {
- if(base->object->data && ((ID *)ob->data)->lib == ((ID *)base->object->data)->lib) {
+ else if (nr==8) {
+ if (base->object->data && ((ID *)ob->data)->lib == ((ID *)base->object->data)->lib) {
base->flag |= SELECT;
changed= 1;
}
@@ -347,21 +347,21 @@ static int object_select_linked_exec(bContext *C, wmOperator *op)
void OBJECT_OT_select_linked(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Linked";
+ ot->name = "Select Linked";
ot->description = "Select all visible objects that are linked";
- ot->idname= "OBJECT_OT_select_linked";
+ ot->idname = "OBJECT_OT_select_linked";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= object_select_linked_exec;
- ot->poll= objects_selectable_poll;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = object_select_linked_exec;
+ ot->poll = objects_selectable_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
- ot->prop= RNA_def_enum(ot->srna, "type", prop_select_linked_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_select_linked_types, 0, "Type", "");
}
/*********************** Selected Grouped ********************/
@@ -414,7 +414,7 @@ static short select_grouped_parent(bContext *C) /* Makes parent active and de-se
baspar= object_in_scene(basact->object->parent, scene);
/* can be NULL if parent in other scene */
- if(baspar && BASE_SELECTABLE(v3d, baspar)) {
+ if (baspar && BASE_SELECTABLE(v3d, baspar)) {
ED_base_object_select(basact, BA_DESELECT);
ED_base_object_select(baspar, BA_SELECT);
ED_base_object_activate(C, baspar);
@@ -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)
{
@@ -569,7 +569,7 @@ static short objects_share_gameprop(Object *a, Object *b)
bProperty *prop;
/*make a copy of all its properties*/
- for( prop= a->prop.first; prop; prop = prop->next ) {
+ for ( prop= a->prop.first; prop; prop = prop->next ) {
if ( get_ob_property(b, prop->name) )
return 1;
}
@@ -644,23 +644,23 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op)
}
ob= OBACT;
- if(ob==NULL) {
+ if (ob==NULL) {
BKE_report(op->reports, RPT_ERROR, "No Active Object");
return OPERATOR_CANCELLED;
}
- if(nr==1) changed |= select_grouped_children(C, ob, 1);
- else if(nr==2) changed |= select_grouped_children(C, ob, 0);
- else if(nr==3) changed |= select_grouped_parent(C);
- else if(nr==4) changed |= select_grouped_siblings(C, ob);
- else if(nr==5) changed |= select_grouped_type(C, ob);
- else if(nr==6) changed |= select_grouped_layer(C, ob);
- else if(nr==7) changed |= select_grouped_group(C, ob);
- else if(nr==8) changed |= select_grouped_object_hooks(C, ob);
- else if(nr==9) changed |= select_grouped_index_object(C, ob);
- else if(nr==10) changed |= select_grouped_color(C, ob);
- else if(nr==11) changed |= select_grouped_gameprops(C, ob);
- else if(nr==12) changed |= select_grouped_keyingset(C, ob);
+ if (nr==1) changed |= select_grouped_children(C, ob, 1);
+ else if (nr==2) changed |= select_grouped_children(C, ob, 0);
+ else if (nr==3) changed |= select_grouped_parent(C);
+ else if (nr==4) changed |= select_grouped_siblings(C, ob);
+ else if (nr==5) changed |= select_grouped_type(C, ob);
+ else if (nr==6) changed |= select_grouped_layer(C, ob);
+ else if (nr==7) changed |= select_grouped_group(C, ob);
+ else if (nr==8) changed |= select_grouped_object_hooks(C, ob);
+ else if (nr==9) changed |= select_grouped_index_object(C, ob);
+ else if (nr==10) changed |= select_grouped_color(C, ob);
+ else if (nr==11) changed |= select_grouped_gameprops(C, ob);
+ else if (nr==12) changed |= select_grouped_keyingset(C, ob);
if (changed) {
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
@@ -673,21 +673,21 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op)
void OBJECT_OT_select_grouped(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Grouped";
+ ot->name = "Select Grouped";
ot->description = "Select all visible objects grouped by various properties";
- ot->idname= "OBJECT_OT_select_grouped";
+ ot->idname = "OBJECT_OT_select_grouped";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= object_select_grouped_exec;
- ot->poll= objects_selectable_poll;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = object_select_grouped_exec;
+ ot->poll = objects_selectable_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
- ot->prop= RNA_def_enum(ot->srna, "type", prop_select_grouped_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_select_grouped_types, 0, "Type", "");
}
/************************* Select by Layer **********************/
@@ -708,7 +708,7 @@ static int object_select_by_layer_exec(bContext *C, wmOperator *op)
}
CTX_DATA_BEGIN(C, Base*, base, visible_bases) {
- if(base->lay == (1<< (layernum -1)))
+ if (base->lay == (1<< (layernum -1)))
ED_base_object_select(base, BA_SELECT);
}
CTX_DATA_END;
@@ -722,17 +722,17 @@ static int object_select_by_layer_exec(bContext *C, wmOperator *op)
void OBJECT_OT_select_by_layer(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select by Layer";
+ ot->name = "Select by Layer";
ot->description = "Select all visible objects on a layer";
- ot->idname= "OBJECT_OT_select_by_layer";
+ ot->idname = "OBJECT_OT_select_by_layer";
/* api callbacks */
/*ot->invoke = XXX - need a int grid popup*/
- ot->exec= object_select_by_layer_exec;
- ot->poll= objects_selectable_poll;
+ ot->exec = object_select_by_layer_exec;
+ ot->poll = objects_selectable_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
@@ -770,7 +770,8 @@ static int object_select_all_exec(bContext *C, wmOperator *op)
case SEL_INVERT:
if (base->flag & SELECT) {
ED_base_object_select(base, BA_DESELECT);
- } else {
+ }
+ else {
ED_base_object_select(base, BA_SELECT);
}
break;
@@ -787,16 +788,16 @@ void OBJECT_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select or Deselect All";
+ ot->name = "(De)select All";
ot->description = "Change selection of all visible objects in scene";
- ot->idname= "OBJECT_OT_select_all";
+ ot->idname = "OBJECT_OT_select_all";
/* api callbacks */
- ot->exec= object_select_all_exec;
- ot->poll= objects_selectable_poll;
+ ot->exec = object_select_all_exec;
+ ot->poll = objects_selectable_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
WM_operator_properties_select_all(ot);
}
@@ -836,16 +837,16 @@ void OBJECT_OT_select_same_group(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Same Group";
+ ot->name = "Select Same Group";
ot->description = "Select object in the same group";
- ot->idname= "OBJECT_OT_select_same_group";
+ ot->idname = "OBJECT_OT_select_same_group";
/* api callbacks */
- ot->exec= object_select_same_group_exec;
- ot->poll= objects_selectable_poll;
+ ot->exec = object_select_same_group_exec;
+ ot->poll = objects_selectable_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_string(ot->srna, "group", "", MAX_ID_NAME, "Group", "Name of the group to select");
}
@@ -863,12 +864,12 @@ static int object_select_mirror_exec(bContext *C, wmOperator *op)
flip_side_name(tmpname, primbase->object->id.name+2, TRUE);
- if(strcmp(tmpname, primbase->object->id.name+2)!=0) { /* names differ */
+ if (strcmp(tmpname, primbase->object->id.name+2)!=0) { /* names differ */
Object *ob= (Object *)find_id("OB", tmpname);
- if(ob) {
+ if (ob) {
Base *secbase= object_in_scene(ob, scene);
- if(secbase) {
+ if (secbase) {
ED_base_object_select(secbase, BA_SELECT);
}
}
@@ -889,16 +890,16 @@ void OBJECT_OT_select_mirror(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Mirror";
+ ot->name = "Select Mirror";
ot->description = "Select the Mirror objects of the selected object eg. L.sword -> R.sword";
- ot->idname= "OBJECT_OT_select_mirror";
+ ot->idname = "OBJECT_OT_select_mirror";
/* api callbacks */
- ot->exec= object_select_mirror_exec;
- ot->poll= objects_selectable_poll;
+ ot->exec = object_select_mirror_exec;
+ ot->poll = objects_selectable_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first");
}
@@ -936,17 +937,17 @@ static int object_select_random_exec(bContext *C, wmOperator *op)
void OBJECT_OT_select_random(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Random";
+ ot->name = "Select Random";
ot->description = "Set select on random visible objects";
- ot->idname= "OBJECT_OT_select_random";
+ ot->idname = "OBJECT_OT_select_random";
/* api callbacks */
- /*ot->invoke= object_select_random_invoke XXX - need a number popup ;*/
+ /*ot->invoke = object_select_random_invoke XXX - need a number popup ;*/
ot->exec = object_select_random_exec;
- ot->poll= objects_selectable_poll;
+ ot->poll = objects_selectable_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of objects to select randomly", 0.f, 100.0f);
diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c
index b186f788bbf..959bda22263 100644
--- a/source/blender/editors/object/object_shapekey.c
+++ b/source/blender/editors/object/object_shapekey.c
@@ -76,7 +76,7 @@
static void ED_object_shape_key_add(bContext *C, Scene *scene, Object *ob, int from_mix)
{
- if(object_insert_shape_key(scene, ob, NULL, from_mix)) {
+ if (object_insert_shape_key(scene, ob, NULL, from_mix)) {
Key *key= ob_get_key(ob);
ob->shapenr= BLI_countlist(&key->block);
@@ -94,22 +94,22 @@ static int ED_object_shape_key_remove(bContext *C, Object *ob)
//IpoCurve *icu;
key= ob_get_key(ob);
- if(key==NULL)
+ if (key==NULL)
return 0;
kb= BLI_findlink(&key->block, ob->shapenr-1);
- if(kb) {
- for(rkb= key->block.first; rkb; rkb= rkb->next)
- if(rkb->relative == ob->shapenr-1)
+ if (kb) {
+ for (rkb= key->block.first; rkb; rkb= rkb->next)
+ if (rkb->relative == ob->shapenr-1)
rkb->relative= 0;
BLI_remlink(&key->block, kb);
key->totkey--;
- if(key->refkey== kb) {
+ if (key->refkey== kb) {
key->refkey= key->block.first;
- if(key->refkey) {
+ if (key->refkey) {
/* apply new basis key on original data */
switch(ob->type) {
case OB_MESH:
@@ -126,36 +126,36 @@ static int ED_object_shape_key_remove(bContext *C, Object *ob)
}
}
- if(kb->data) MEM_freeN(kb->data);
+ if (kb->data) MEM_freeN(kb->data);
MEM_freeN(kb);
- for(kb= key->block.first; kb; kb= kb->next)
- if(kb->adrcode>=ob->shapenr)
+ for (kb= key->block.first; kb; kb= kb->next)
+ if (kb->adrcode>=ob->shapenr)
kb->adrcode--;
#if 0 // XXX old animation system
- if(key->ipo) {
+ if (key->ipo) {
- for(icu= key->ipo->curve.first; icu; icu= icu->next) {
- if(icu->adrcode==ob->shapenr-1) {
+ for (icu= key->ipo->curve.first; icu; icu= icu->next) {
+ if (icu->adrcode==ob->shapenr-1) {
BLI_remlink(&key->ipo->curve, icu);
free_ipo_curve(icu);
break;
}
}
- for(icu= key->ipo->curve.first; icu; icu= icu->next)
- if(icu->adrcode>=ob->shapenr)
+ for (icu= key->ipo->curve.first; icu; icu= icu->next)
+ if (icu->adrcode>=ob->shapenr)
icu->adrcode--;
}
#endif // XXX old animation system
- if(ob->shapenr>1) ob->shapenr--;
+ if (ob->shapenr>1) ob->shapenr--;
}
- if(key->totkey==0) {
- if(GS(key->from->name)==ID_ME) ((Mesh *)key->from)->key= NULL;
- else if(GS(key->from->name)==ID_CU) ((Curve *)key->from)->key= NULL;
- else if(GS(key->from->name)==ID_LT) ((Lattice *)key->from)->key= NULL;
+ if (key->totkey==0) {
+ if (GS(key->from->name)==ID_ME) ((Mesh *)key->from)->key= NULL;
+ else if (GS(key->from->name)==ID_CU) ((Curve *)key->from)->key= NULL;
+ else if (GS(key->from->name)==ID_LT) ((Lattice *)key->from)->key= NULL;
free_libblock_us(&(bmain->key), key);
}
@@ -172,33 +172,33 @@ static int object_shape_key_mirror(bContext *C, Object *ob)
Key *key;
key= ob_get_key(ob);
- if(key==NULL)
+ if (key==NULL)
return 0;
kb= BLI_findlink(&key->block, ob->shapenr-1);
- if(kb) {
+ if (kb) {
int i1, i2;
float *fp1, *fp2;
float tvec[3];
char *tag_elem= MEM_callocN(sizeof(char) * kb->totelem, "shape_key_mirror");
- if(ob->type==OB_MESH) {
+ if (ob->type==OB_MESH) {
Mesh *me= ob->data;
MVert *mv;
mesh_octree_table(ob, NULL, NULL, 's');
- for(i1=0, mv=me->mvert; i1<me->totvert; i1++, mv++) {
+ for (i1=0, mv=me->mvert; i1<me->totvert; i1++, mv++) {
i2= mesh_get_x_mirror_vert(ob, i1);
- if(i2==i1) {
+ if (i2==i1) {
fp1= ((float *)kb->data) + i1*3;
fp1[0] = -fp1[0];
tag_elem[i1]= 1;
}
- else if(i2 != -1) {
- if(tag_elem[i1]==0 && tag_elem[i2]==0) {
+ else if (i2 != -1) {
+ if (tag_elem[i1]==0 && tag_elem[i2]==0) {
fp1= ((float *)kb->data) + i1*3;
fp2= ((float *)kb->data) + i2*3;
@@ -224,17 +224,17 @@ static int object_shape_key_mirror(bContext *C, Object *ob)
/* half but found up odd value */
const int pntsu_half = (lt->pntsu / 2) + (lt->pntsu % 2);
- /* currently editmode isnt supported by mesh so
+ /* currently editmode isn't supported by mesh so
* ignore here for now too */
- /* if(lt->editlatt) lt= lt->editlatt->latt; */
+ /* if (lt->editlatt) lt= lt->editlatt->latt; */
- for(w=0; w<lt->pntsw; w++) {
- for(v=0; v<lt->pntsv; v++) {
- for(u=0; u<pntsu_half; u++) {
+ for (w=0; w<lt->pntsw; w++) {
+ for (v=0; v<lt->pntsv; v++) {
+ for (u=0; u<pntsu_half; u++) {
int u_inv= (lt->pntsu - 1) - u;
float tvec[3];
- if(u == u_inv) {
+ if (u == u_inv) {
i1= LT_INDEX(lt, u, v, w);
fp1= ((float *)kb->data) + i1*3;
fp1[0]= -fp1[0];
@@ -296,16 +296,16 @@ static int shape_key_add_exec(bContext *C, wmOperator *op)
void OBJECT_OT_shape_key_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Shape Key";
- ot->idname= "OBJECT_OT_shape_key_add";
- ot->description= "Add shape key to the object";
+ ot->name = "Add Shape Key";
+ ot->idname = "OBJECT_OT_shape_key_add";
+ ot->description = "Add shape key to the object";
/* api callbacks */
- ot->poll= shape_key_mode_poll;
- ot->exec= shape_key_add_exec;
+ ot->poll = shape_key_mode_poll;
+ ot->exec = shape_key_add_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "from_mix", 1, "From Mix", "Create the new shape key from the existing mix of keys");
@@ -315,7 +315,7 @@ static int shape_key_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob= ED_object_context(C);
- if(!ED_object_shape_key_remove(C, ob))
+ if (!ED_object_shape_key_remove(C, ob))
return OPERATOR_CANCELLED;
return OPERATOR_FINISHED;
@@ -324,16 +324,16 @@ static int shape_key_remove_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_shape_key_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Shape Key";
- ot->idname= "OBJECT_OT_shape_key_remove";
- ot->description= "Remove shape key from the object";
+ ot->name = "Remove Shape Key";
+ ot->idname = "OBJECT_OT_shape_key_remove";
+ ot->description = "Remove shape key from the object";
/* api callbacks */
- ot->poll= shape_key_mode_poll;
- ot->exec= shape_key_remove_exec;
+ ot->poll = shape_key_mode_poll;
+ ot->exec = shape_key_remove_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int shape_key_clear_exec(bContext *C, wmOperator *UNUSED(op))
@@ -342,10 +342,10 @@ static int shape_key_clear_exec(bContext *C, wmOperator *UNUSED(op))
Key *key= ob_get_key(ob);
KeyBlock *kb= ob_get_keyblock(ob);
- if(!key || !kb)
+ if (!key || !kb)
return OPERATOR_CANCELLED;
- for(kb=key->block.first; kb; kb=kb->next)
+ for (kb=key->block.first; kb; kb=kb->next)
kb->curval= 0.0f;
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -357,23 +357,23 @@ static int shape_key_clear_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_shape_key_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Shape Keys";
- ot->description= "Clear weights for all shape keys";
- ot->idname= "OBJECT_OT_shape_key_clear";
+ ot->name = "Clear Shape Keys";
+ ot->description = "Clear weights for all shape keys";
+ ot->idname = "OBJECT_OT_shape_key_clear";
/* api callbacks */
- ot->poll= shape_key_poll;
- ot->exec= shape_key_clear_exec;
+ ot->poll = shape_key_poll;
+ ot->exec = shape_key_clear_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int shape_key_mirror_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob= ED_object_context(C);
- if(!object_shape_key_mirror(C, ob))
+ if (!object_shape_key_mirror(C, ob))
return OPERATOR_CANCELLED;
return OPERATOR_FINISHED;
@@ -382,15 +382,15 @@ static int shape_key_mirror_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_shape_key_mirror(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mirror Shape Key";
- ot->idname= "OBJECT_OT_shape_key_mirror";
+ ot->name = "Mirror Shape Key";
+ ot->idname = "OBJECT_OT_shape_key_mirror";
/* api callbacks */
- ot->poll= shape_key_mode_poll;
- ot->exec= shape_key_mirror_exec;
+ ot->poll = shape_key_mode_poll;
+ ot->exec = shape_key_mirror_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -401,26 +401,26 @@ static int shape_key_move_exec(bContext *C, wmOperator *op)
int type= RNA_enum_get(op->ptr, "type");
Key *key= ob_get_key(ob);
- if(key) {
+ if (key) {
KeyBlock *kb, *kb_other;
int shapenr_act= ob->shapenr-1;
int shapenr_swap= shapenr_act + type;
kb= BLI_findlink(&key->block, shapenr_act);
- if((type==-1 && kb->prev==NULL) || (type==1 && kb->next==NULL)) {
+ if ((type==-1 && kb->prev==NULL) || (type==1 && kb->next==NULL)) {
return OPERATOR_CANCELLED;
}
- for(kb_other= key->block.first; kb_other; kb_other= kb_other->next) {
- if(kb_other->relative == shapenr_act) {
+ for (kb_other= key->block.first; kb_other; kb_other= kb_other->next) {
+ if (kb_other->relative == shapenr_act) {
kb_other->relative += type;
}
- else if(kb_other->relative == shapenr_swap) {
+ else if (kb_other->relative == shapenr_swap) {
kb_other->relative -= type;
}
}
- if(type==-1) {
+ if (type==-1) {
/* move back */
kb_other= kb->prev;
BLI_remlink(&key->block, kb);
@@ -451,15 +451,15 @@ void OBJECT_OT_shape_key_move(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Move Shape Key";
- ot->idname= "OBJECT_OT_shape_key_move";
+ ot->name = "Move Shape Key";
+ ot->idname = "OBJECT_OT_shape_key_move";
/* api callbacks */
- ot->poll= shape_key_mode_poll;
- ot->exec= shape_key_move_exec;
+ ot->poll = shape_key_mode_poll;
+ ot->exec = shape_key_move_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "type", slot_move, 0, "Type", "");
}
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 45db21749a5..474d10ffbd8 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -40,6 +40,7 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_group_types.h"
+#include "DNA_lattice_types.h"
#include "BLI_math.h"
#include "BLI_listbase.h"
@@ -118,7 +119,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... */
@@ -215,7 +216,7 @@ static int object_clear_transform_generic_exec(bContext *C, wmOperator *op,
KeyingSet *ks;
/* sanity checks */
- if ELEM(NULL, clear_func, default_ksName) {
+ if (ELEM(NULL, clear_func, default_ksName)) {
BKE_report(op->reports, RPT_ERROR, "Programming error: missing clear transform func or Keying Set Name");
return OPERATOR_CANCELLED;
}
@@ -259,16 +260,16 @@ static int object_location_clear_exec(bContext *C, wmOperator *op)
void OBJECT_OT_location_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Location";
+ ot->name = "Clear Location";
ot->description = "Clear the object's location";
- ot->idname= "OBJECT_OT_location_clear";
+ ot->idname = "OBJECT_OT_location_clear";
/* api callbacks */
- ot->exec= object_location_clear_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->exec = object_location_clear_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int object_rotation_clear_exec(bContext *C, wmOperator *op)
@@ -279,16 +280,16 @@ static int object_rotation_clear_exec(bContext *C, wmOperator *op)
void OBJECT_OT_rotation_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Rotation";
+ ot->name = "Clear Rotation";
ot->description = "Clear the object's rotation";
- ot->idname= "OBJECT_OT_rotation_clear";
+ ot->idname = "OBJECT_OT_rotation_clear";
/* api callbacks */
- ot->exec= object_rotation_clear_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->exec = object_rotation_clear_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int object_scale_clear_exec(bContext *C, wmOperator *op)
@@ -299,16 +300,16 @@ static int object_scale_clear_exec(bContext *C, wmOperator *op)
void OBJECT_OT_scale_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Scale";
+ ot->name = "Clear Scale";
ot->description = "Clear the object's scale";
- ot->idname= "OBJECT_OT_scale_clear";
+ ot->idname = "OBJECT_OT_scale_clear";
/* api callbacks */
- ot->exec= object_scale_clear_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->exec = object_scale_clear_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* --------------- */
@@ -345,16 +346,16 @@ static int object_origin_clear_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_origin_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Origin";
+ ot->name = "Clear Origin";
ot->description = "Clear the object's origin";
- ot->idname= "OBJECT_OT_origin_clear";
+ ot->idname = "OBJECT_OT_origin_clear";
/* api callbacks */
- ot->exec= object_origin_clear_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->exec = object_origin_clear_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/*************************** Apply Transformation ****************************/
@@ -367,8 +368,8 @@ static void ignore_parent_tx(Main *bmain, Scene *scene, Object *ob )
Object *ob_child;
/* a change was made, adjust the children to compensate */
- for(ob_child=bmain->object.first; ob_child; ob_child=ob_child->id.next) {
- if(ob_child->parent == ob) {
+ for (ob_child=bmain->object.first; ob_child; ob_child=ob_child->id.next) {
+ if (ob_child->parent == ob) {
object_apply_mat4(ob_child, ob_child->obmat, TRUE, FALSE);
what_does_parent(scene, ob_child, &workob);
invert_m4_m4(ob_child->parentinv, workob.obmat);
@@ -386,33 +387,39 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
/* first check if we can execute */
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
- if(ob->type==OB_MESH) {
- if(ID_REAL_USERS(ob->data) > 1) {
+ if (ob->type==OB_MESH) {
+ if (ID_REAL_USERS(ob->data) > 1) {
BKE_report(reports, RPT_ERROR, "Can't apply to a multi user mesh, doing nothing");
return OPERATOR_CANCELLED;
}
}
- else if(ob->type==OB_ARMATURE) {
- if(ID_REAL_USERS(ob->data) > 1) {
+ else if (ob->type==OB_ARMATURE) {
+ if (ID_REAL_USERS(ob->data) > 1) {
BKE_report(reports, RPT_ERROR, "Can't apply to a multi user armature, doing nothing");
return OPERATOR_CANCELLED;
}
}
- else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ else if (ob->type == OB_LATTICE) {
+ if (ID_REAL_USERS(ob->data) > 1) {
+ BKE_report(reports, RPT_ERROR, "Can't apply to a multi user lattice, doing nothing");
+ return OPERATOR_CANCELLED;
+ }
+ }
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu;
- if(ID_REAL_USERS(ob->data) > 1) {
+ if (ID_REAL_USERS(ob->data) > 1) {
BKE_report(reports, RPT_ERROR, "Can't apply to a multi user curve, doing nothing");
return OPERATOR_CANCELLED;
}
cu= ob->data;
- if(!(cu->flag & CU_3D) && (apply_rot || apply_loc)) {
+ if (!(cu->flag & CU_3D) && (apply_rot || apply_loc)) {
BKE_report(reports, RPT_ERROR, "Neither rotation nor location could be applied to a 2d curve, doing nothing");
return OPERATOR_CANCELLED;
}
- if(cu->key) {
+ if (cu->key) {
BKE_report(reports, RPT_ERROR, "Can't apply to a curve with vertex keys, doing nothing");
return OPERATOR_CANCELLED;
}
@@ -424,11 +431,11 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
/* calculate rotation/scale matrix */
- if(apply_scale && apply_rot)
+ if (apply_scale && apply_rot)
object_to_mat3(ob, rsmat);
- else if(apply_scale)
+ else if (apply_scale)
object_scale_to_mat3(ob, rsmat);
- else if(apply_rot) {
+ else if (apply_rot) {
float tmat[3][3], timat[3][3];
/* simple rotation matrix */
@@ -446,10 +453,10 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
copy_m4_m3(mat, rsmat);
/* calculate translation */
- if(apply_loc) {
+ if (apply_loc) {
copy_v3_v3(mat[3], ob->loc);
- if(!(apply_scale && apply_rot)) {
+ if (!(apply_scale && apply_rot)) {
/* correct for scale and rotation that is still applied */
object_to_mat3(ob, obmat);
invert_m3_m3(iobmat, obmat);
@@ -459,7 +466,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
}
/* apply to object data */
- if(ob->type==OB_MESH) {
+ if (ob->type==OB_MESH) {
Mesh *me= ob->data;
MVert *mvert;
@@ -467,16 +474,16 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
/* adjust data */
mvert= me->mvert;
- for(a=0; a<me->totvert; a++, mvert++)
+ for (a=0; a<me->totvert; a++, mvert++)
mul_m4_v3(mat, mvert->co);
- if(me->key) {
+ if (me->key) {
KeyBlock *kb;
- for(kb=me->key->block.first; kb; kb=kb->next) {
+ for (kb=me->key->block.first; kb; kb=kb->next) {
float *fp= kb->data;
- for(a=0; a<kb->totelem; a++, fp+=3)
+ for (a=0; a<kb->totelem; a++, fp+=3)
mul_m4_v3(mat, fp);
}
}
@@ -487,7 +494,17 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
else if (ob->type==OB_ARMATURE) {
ED_armature_apply_transform(ob, mat);
}
- else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ else if (ob->type == OB_LATTICE) {
+ Lattice *lt = ob->data;
+ BPoint *bp = lt->def;
+ int a = lt->pntsu * lt->pntsv * lt->pntsw;
+
+ while (a--) {
+ mul_m4_v3(mat, bp->vec);
+ bp++;
+ }
+ }
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu= ob->data;
Nurb *nu;
@@ -496,10 +513,10 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
scale = mat3_to_scale(rsmat);
- for(nu=cu->nurb.first; nu; nu=nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu=cu->nurb.first; nu; nu=nu->next) {
+ if (nu->type == CU_BEZIER) {
a= nu->pntsu;
- for(bezt= nu->bezt; a--; bezt++) {
+ for (bezt= nu->bezt; a--; bezt++) {
mul_m4_v3(mat, bezt->vec[0]);
mul_m4_v3(mat, bezt->vec[1]);
mul_m4_v3(mat, bezt->vec[2]);
@@ -509,7 +526,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
}
else {
a= nu->pntsu*nu->pntsv;
- for(bp= nu->bp; a--; bp++)
+ for (bp= nu->bp; a--; bp++)
mul_m4_v3(mat, bp->vec);
}
}
@@ -517,18 +534,18 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
else
continue;
- if(apply_loc)
+ if (apply_loc)
zero_v3(ob->loc);
- if(apply_scale)
+ if (apply_scale)
ob->size[0]= ob->size[1]= ob->size[2]= 1.0f;
- if(apply_rot) {
+ if (apply_rot) {
zero_v3(ob->rot);
unit_qt(ob->quat);
unit_axis_angle(ob->rotAxis, &ob->rotAngle);
}
where_is_object(scene, ob);
- if(ob->type==OB_ARMATURE) {
+ if (ob->type==OB_ARMATURE) {
where_is_pose(scene, ob); /* needed for bone parents */
}
@@ -540,7 +557,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
}
CTX_DATA_END;
- if(!change)
+ if (!change)
return OPERATOR_CANCELLED;
WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
@@ -564,7 +581,7 @@ static int visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op))
}
CTX_DATA_END;
- if(!change)
+ if (!change)
return OPERATOR_CANCELLED;
WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
@@ -574,16 +591,16 @@ static int visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_visual_transform_apply(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Apply Visual Transform";
+ ot->name = "Apply Visual Transform";
ot->description = "Apply the object's visual transformation to its data";
- ot->idname= "OBJECT_OT_visual_transform_apply";
+ ot->idname = "OBJECT_OT_visual_transform_apply";
/* api callbacks */
- ot->exec= visual_transform_apply_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->exec = visual_transform_apply_exec;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int object_transform_apply_exec(bContext *C, wmOperator *op)
@@ -592,7 +609,7 @@ static int object_transform_apply_exec(bContext *C, wmOperator *op)
const int rot= RNA_boolean_get(op->ptr, "rotation");
const int sca= RNA_boolean_get(op->ptr, "scale");
- if(loc || rot || sca) {
+ if (loc || rot || sca) {
return apply_objects_internal(C, op->reports, loc, rot, sca);
}
else {
@@ -603,16 +620,16 @@ static int object_transform_apply_exec(bContext *C, wmOperator *op)
void OBJECT_OT_transform_apply(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Apply Object Transform";
+ ot->name = "Apply Object Transform";
ot->description = "Apply the object's transformation to its data";
- ot->idname= "OBJECT_OT_transform_apply";
+ ot->idname = "OBJECT_OT_transform_apply";
/* api callbacks */
- ot->exec= object_transform_apply_exec;
- ot->poll= ED_operator_objectmode;
+ ot->exec = object_transform_apply_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "location", 0, "Location", "");
RNA_def_boolean(ot->srna, "rotation", 0, "Rotation", "");
@@ -645,32 +662,33 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
else {
- /* get the view settings if 'around' isnt set and the view is available */
+ /* get the view settings if 'around' isn't set and the view is available */
View3D *v3d= CTX_wm_view3d(C);
copy_v3_v3(cursor, give_cursor(scene, v3d));
- if(v3d && !RNA_struct_property_is_set(op->ptr, "center"))
+ if (v3d && !RNA_struct_property_is_set(op->ptr, "center"))
around= v3d->around;
}
zero_v3(cent);
- if(obedit) {
+ if (obedit) {
INIT_MINMAX(min, max);
- if(obedit->type==OB_MESH) {
+ if (obedit->type==OB_MESH) {
Mesh *me= obedit->data;
BMEditMesh *em = me->edit_btmesh;
BMVert *eve;
BMIter iter;
int total = 0;
- if(centermode == ORIGIN_TO_CURSOR) {
+ if (centermode == ORIGIN_TO_CURSOR) {
copy_v3_v3(cent, cursor);
invert_m4_m4(obedit->imat, obedit->obmat);
mul_m4_v3(obedit->imat, cent);
- } else {
+ }
+ else {
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
- if(around==V3D_CENTROID) {
+ if (around==V3D_CENTROID) {
total++;
add_v3_v3(cent, eve->co);
mul_v3_fl(cent, 1.0f/(float)total);
@@ -686,7 +704,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
sub_v3_v3(eve->co, cent);
}
- EDBM_RecalcNormals(em);
+ EDBM_mesh_normals_update(em);
tot_change++;
DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
}
@@ -699,31 +717,31 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
CTX_DATA_END;
for (tob= bmain->object.first; tob; tob= tob->id.next) {
- if(tob->data)
+ if (tob->data)
((ID *)tob->data)->flag &= ~LIB_DOIT;
- if(tob->dup_group)
+ if (tob->dup_group)
((ID *)tob->dup_group)->flag &= ~LIB_DOIT;
}
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
- if((ob->flag & OB_DONE)==0) {
+ if ((ob->flag & OB_DONE)==0) {
int do_inverse_offset = FALSE;
ob->flag |= OB_DONE;
- if(centermode == ORIGIN_TO_CURSOR) {
+ if (centermode == ORIGIN_TO_CURSOR) {
copy_v3_v3(cent, cursor);
invert_m4_m4(ob->imat, ob->obmat);
mul_m4_v3(ob->imat, cent);
}
- if(ob->data == NULL) {
+ if (ob->data == NULL) {
/* special support for dupligroups */
- if((ob->transflag & OB_DUPLIGROUP) && ob->dup_group && (ob->dup_group->id.flag & LIB_DOIT)==0) {
- if(ob->dup_group->id.lib) {
+ if ((ob->transflag & OB_DUPLIGROUP) && ob->dup_group && (ob->dup_group->id.flag & LIB_DOIT)==0) {
+ if (ob->dup_group->id.lib) {
tot_lib_error++;
}
else {
- if(centermode == ORIGIN_TO_CURSOR) { /* done */ }
+ if (centermode == ORIGIN_TO_CURSOR) { /* done */ }
else {
/* only bounds support */
INIT_MINMAX(min, max);
@@ -745,11 +763,11 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
tot_lib_error++;
}
- if(obedit==NULL && ob->type==OB_MESH) {
+ if (obedit==NULL && ob->type==OB_MESH) {
Mesh *me= ob->data;
- if(centermode == ORIGIN_TO_CURSOR) { /* done */ }
- else if(around==V3D_CENTROID) { mesh_center_median(me, cent); }
+ if (centermode == ORIGIN_TO_CURSOR) { /* done */ }
+ else if (around==V3D_CENTROID) { mesh_center_median(me, cent); }
else { mesh_center_bounds(me, cent); }
negate_v3_v3(cent_neg, cent);
@@ -762,12 +780,12 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu= ob->data;
- if(centermode == ORIGIN_TO_CURSOR) { /* done */ }
- else if(around==V3D_CENTROID) { curve_center_median(cu, cent); }
+ if (centermode == ORIGIN_TO_CURSOR) { /* done */ }
+ else if (around==V3D_CENTROID) { curve_center_median(cu, cent); }
else { curve_center_bounds(cu, cent); }
/* don't allow Z change if curve is 2D */
- if((ob->type == OB_CURVE) && !(cu->flag & CU_3D))
+ if ((ob->type == OB_CURVE) && !(cu->flag & CU_3D))
cent[2] = 0.0;
negate_v3_v3(cent_neg, cent);
@@ -777,23 +795,23 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
cu->id.flag |= LIB_DOIT;
do_inverse_offset= TRUE;
- if(obedit) {
+ if (obedit) {
if (centermode == GEOMETRY_TO_ORIGIN) {
DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
}
break;
}
}
- else if(ob->type==OB_FONT) {
+ else if (ob->type==OB_FONT) {
/* get from bb */
Curve *cu= ob->data;
- if(cu->bb==NULL && (centermode != ORIGIN_TO_CURSOR)) {
+ if (cu->bb==NULL && (centermode != ORIGIN_TO_CURSOR)) {
/* do nothing*/
}
else {
- if(centermode == ORIGIN_TO_CURSOR) {
+ if (centermode == ORIGIN_TO_CURSOR) {
/* done */
}
else {
@@ -811,12 +829,14 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
do_inverse_offset= TRUE;
}
}
- else if(ob->type==OB_ARMATURE) {
+ else if (ob->type==OB_ARMATURE) {
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 (ID_REAL_USERS(arm) > 1) {
+#if 0
+ BKE_report(op->reports, RPT_ERROR, "Can't apply to a multi user armature");
+ return;
+#endif
tot_multiuser_arm_error++;
}
else {
@@ -834,15 +854,15 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
ignore_parent_tx(bmain, scene, ob);
- if(obedit)
+ if (obedit)
break;
}
}
else if (ob->type == OB_MBALL) {
MetaBall *mb = ob->data;
- if(centermode == ORIGIN_TO_CURSOR) { /* done */ }
- else if(around==V3D_CENTROID) { BKE_metaball_center_median(mb, cent); }
+ if (centermode == ORIGIN_TO_CURSOR) { /* done */ }
+ else if (around==V3D_CENTROID) { BKE_metaball_center_median(mb, cent); }
else { BKE_metaball_center_bounds(mb, cent); }
negate_v3_v3(cent_neg, cent);
@@ -852,7 +872,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
mb->id.flag |= LIB_DOIT;
do_inverse_offset= TRUE;
- if(obedit) {
+ if (obedit) {
if (centermode == GEOMETRY_TO_ORIGIN) {
DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
}
@@ -861,7 +881,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
}
/* offset other selected objects */
- if(do_inverse_offset && (centermode != GEOMETRY_TO_ORIGIN)) {
+ if (do_inverse_offset && (centermode != GEOMETRY_TO_ORIGIN)) {
/* was the object data modified
* note: the functions above must set 'cent' */
copy_v3_v3(centn, cent);
@@ -869,7 +889,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
add_v3_v3(ob->loc, centn);
where_is_object(scene, ob);
- if(ob->type==OB_ARMATURE) {
+ if (ob->type==OB_ARMATURE) {
where_is_pose(scene, ob); /* needed for bone parents */
}
@@ -877,7 +897,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
/* other users? */
CTX_DATA_BEGIN(C, Object*, ob_other, selected_editable_objects) {
- if( (ob_other->flag & OB_DONE)==0 &&
+ if ( (ob_other->flag & OB_DONE)==0 &&
( (ob->data && (ob->data == ob_other->data)) ||
(ob->dup_group==ob_other->dup_group && (ob->transflag|ob_other->transflag) & OB_DUPLIGROUP) )
) {
@@ -889,7 +909,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
add_v3_v3(ob_other->loc, centn);
where_is_object(scene, ob_other);
- if(ob_other->type==OB_ARMATURE) {
+ if (ob_other->type==OB_ARMATURE) {
where_is_pose(scene, ob_other); /* needed for bone parents */
}
ignore_parent_tx(bmain, scene, ob_other);
@@ -902,7 +922,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
CTX_DATA_END;
for (tob= bmain->object.first; tob; tob= tob->id.next)
- if(tob->data && (((ID *)tob->data)->flag & LIB_DOIT))
+ if (tob->data && (((ID *)tob->data)->flag & LIB_DOIT))
DAG_id_tag_update(&tob->id, OB_RECALC_OB|OB_RECALC_DATA);
if (tot_change) {
@@ -938,20 +958,20 @@ void OBJECT_OT_origin_set(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Set Origin";
+ ot->name = "Set Origin";
ot->description = "Set the object's origin, by either moving the data, or set to center of data, or use 3d cursor";
- ot->idname= "OBJECT_OT_origin_set";
+ ot->idname = "OBJECT_OT_origin_set";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= object_origin_set_exec;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = object_origin_set_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
- ot->prop= RNA_def_enum(ot->srna, "type", prop_set_center_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_set_center_types, 0, "Type", "");
RNA_def_enum(ot->srna, "center", prop_set_bounds_types, V3D_CENTROID, "Center", "");
}
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index dcf3a400470..c0150d6e3b0 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -92,9 +92,9 @@ static Lattice *vgroup_edit_lattice(Object *ob)
int ED_vgroup_object_is_edit_mode(Object *ob)
{
- if(ob->type == OB_MESH)
- return (((Mesh*)ob->data)->edit_btmesh != NULL);
- else if(ob->type == OB_LATTICE)
+ if (ob->type == OB_MESH)
+ return (BMEdit_FromObject(ob) != NULL);
+ else if (ob->type == OB_LATTICE)
return (((Lattice*)ob->data)->editlatt != NULL);
return 0;
@@ -104,7 +104,7 @@ bDeformGroup *ED_vgroup_add_name(Object *ob, const char *name)
{
bDeformGroup *defgroup;
- if(!ob || !OB_TYPE_SUPPORT_VGROUP(ob->type))
+ if (!ob || !OB_TYPE_SUPPORT_VGROUP(ob->type))
return NULL;
defgroup = MEM_callocN(sizeof(bDeformGroup), "add deformGroup");
@@ -137,7 +137,7 @@ void ED_vgroup_delete(Object *ob, bDeformGroup *defgroup)
if (dg == NULL)
return;
- if(ED_vgroup_object_is_edit_mode(ob))
+ if (ED_vgroup_object_is_edit_mode(ob))
vgroup_delete_edit_mode(ob, dg);
else
vgroup_delete_object_mode(ob, dg);
@@ -151,7 +151,7 @@ void ED_vgroup_clear(Object *ob)
while (dg) {
bDeformGroup *next_dg= dg->next;
- if(edit_mode)
+ if (edit_mode)
vgroup_delete_edit_mode(ob, dg);
else
vgroup_delete_object_mode(ob, dg);
@@ -164,12 +164,12 @@ int ED_vgroup_data_create(ID *id)
{
/* create deform verts */
- if(GS(id->name)==ID_ME) {
+ if (GS(id->name)==ID_ME) {
Mesh *me= (Mesh *)id;
me->dvert= CustomData_add_layer(&me->vdata, CD_MDEFORMVERT, CD_CALLOC, NULL, me->totvert);
return TRUE;
}
- else if(GS(id->name)==ID_LT) {
+ else if (GS(id->name)==ID_LT) {
Lattice *lt= (Lattice *)id;
lt->dvert= MEM_callocN(sizeof(MDeformVert)*lt->pntsu*lt->pntsv*lt->pntsw, "lattice deformVert");
return TRUE;
@@ -184,13 +184,13 @@ static int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_to
*dvert_tot = 0;
*dvert_arr = NULL;
- if(id) {
+ if (id) {
switch(GS(id->name)) {
case ID_ME:
{
Mesh *me = (Mesh *)id;
- if(me->edit_btmesh) {
+ if (me->edit_btmesh) {
BMEditMesh *em = me->edit_btmesh;
BMIter iter;
BMVert *eve;
@@ -222,7 +222,7 @@ static int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_to
return 1;
}
- else if(me->dvert) {
+ else if (me->dvert) {
MVert *mvert= me->mvert;
MDeformVert *dvert= me->dvert;
int i;
@@ -255,7 +255,7 @@ static int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_to
Lattice *lt= (Lattice *)id;
lt= (lt->editlatt)? lt->editlatt->latt: lt;
- if(lt->dvert) {
+ if (lt->dvert) {
BPoint *def= lt->def;
*dvert_tot= lt->pntsu*lt->pntsv*lt->pntsw;
*dvert_arr= MEM_mallocN(sizeof(void*)*(*dvert_tot), "vgroup parray from me");
@@ -287,7 +287,7 @@ static int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_to
/* returns true if the id type supports weights */
int ED_vgroup_give_array(ID *id, MDeformVert **dvert_arr, int *dvert_tot)
{
- if(id) {
+ if (id) {
switch(GS(id->name)) {
case ID_ME:
{
@@ -327,16 +327,16 @@ int ED_vgroup_copy_array(Object *ob, Object *ob_from)
ED_vgroup_give_parray(ob_from->data, &dvert_array_from, &dvert_tot_from, FALSE);
ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot, FALSE);
- if((dvert_array == NULL) && (dvert_array_from != NULL) && ED_vgroup_data_create(ob->data)) {
+ if ((dvert_array == NULL) && (dvert_array_from != NULL) && ED_vgroup_data_create(ob->data)) {
ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot, FALSE);
new_vgroup= TRUE;
}
- if(ob==ob_from || dvert_tot==0 || (dvert_tot != dvert_tot_from) || dvert_array_from==NULL || dvert_array==NULL) {
+ if (ob==ob_from || dvert_tot==0 || (dvert_tot != dvert_tot_from) || dvert_array_from==NULL || dvert_array==NULL) {
if (dvert_array) MEM_freeN(dvert_array);
if (dvert_array_from) MEM_freeN(dvert_array_from);
- if(new_vgroup == TRUE) {
+ if (new_vgroup == TRUE) {
/* free the newly added vgroup since it wasn't compatible */
vgroup_delete_all(ob);
}
@@ -348,11 +348,11 @@ int ED_vgroup_copy_array(Object *ob, Object *ob_from)
BLI_duplicatelist(&ob->defbase, &ob_from->defbase);
ob->actdef= ob_from->actdef;
- if(defbase_tot_from < defbase_tot) {
+ if (defbase_tot_from < defbase_tot) {
/* correct vgroup indices because the number of vgroups is being reduced. */
int *remap= MEM_mallocN(sizeof(int) * (defbase_tot + 1), __func__);
- for(i=0; i<=defbase_tot_from; i++) remap[i]= i;
- for(; i<=defbase_tot; i++) remap[i]= 0; /* can't use these, so disable */
+ for (i=0; i<=defbase_tot_from; i++) remap[i]= i;
+ for (; i<=defbase_tot; i++) remap[i]= 0; /* can't use these, so disable */
vgroup_remap_update_users(ob, remap);
MEM_freeN(remap);
@@ -361,13 +361,13 @@ int ED_vgroup_copy_array(Object *ob, Object *ob_from)
dvf= dvert_array_from;
dv= dvert_array;
- for(i=0; i<dvert_tot; i++, dvf++, dv++) {
- if((*dv)->dw)
+ for (i=0; i<dvert_tot; i++, dvf++, dv++) {
+ if ((*dv)->dw)
MEM_freeN((*dv)->dw);
*(*dv)= *(*dvf);
- if((*dv)->dw)
+ if ((*dv)->dw)
(*dv)->dw= MEM_dupallocN((*dv)->dw);
}
@@ -430,7 +430,7 @@ static void ED_vgroup_nr_vert_add(Object *ob,
/* get the vert */
ED_vgroup_give_array(ob->data, &dvert, &tot);
- if(dvert==NULL)
+ if (dvert==NULL)
return;
/* check that vertnum is valid before trying to get the relevant dvert */
@@ -456,7 +456,7 @@ static void ED_vgroup_nr_vert_add(Object *ob,
break;
case WEIGHT_ADD:
dw->weight += weight;
- if(dw->weight >= 1.0f)
+ if (dw->weight >= 1.0f)
dw->weight = 1.0f;
break;
case WEIGHT_SUBTRACT:
@@ -464,7 +464,7 @@ static void ED_vgroup_nr_vert_add(Object *ob,
/* if the weight is zero or less then
* remove the vert from the deform group
*/
- if(dw->weight <= 0.0f) {
+ if (dw->weight <= 0.0f) {
defvert_remove_group(dv, dw);
}
break;
@@ -509,11 +509,11 @@ void ED_vgroup_vert_add(Object *ob, bDeformGroup *dg, int vertnum, float weight,
/* get the deform group number, exit if
* it can't be found
*/
- if(def_nr < 0) return;
+ if (def_nr < 0) return;
/* if there's no deform verts then create some,
*/
- if(ED_vgroup_give_array(ob->data, &dv, &tot) && dv==NULL)
+ if (ED_vgroup_give_array(ob->data, &dv, &tot) && dv==NULL)
ED_vgroup_data_create(ob->data);
/* call another function to do the work
@@ -531,7 +531,7 @@ void ED_vgroup_vert_remove(Object *ob, bDeformGroup *dg, int vertnum)
/* TODO, this is slow in a loop, better pass def_nr directly, but leave for later... - campbell */
const int def_nr= BLI_findindex(&ob->defbase, dg);
- if(def_nr != -1) {
+ if (def_nr != -1) {
MDeformVert *dvert= NULL;
int tot;
@@ -540,7 +540,7 @@ void ED_vgroup_vert_remove(Object *ob, bDeformGroup *dg, int vertnum)
*/
ED_vgroup_give_array(ob->data, &dvert, &tot);
- if(dvert) {
+ if (dvert) {
MDeformVert *dv= &dvert[vertnum];
MDeformWeight *dw;
@@ -557,28 +557,28 @@ static float get_vert_def_nr(Object *ob, const int def_nr, const int vertnum)
Mesh *me;
/* get the deform vertices corresponding to the vertnum */
- if(ob->type==OB_MESH) {
+ if (ob->type==OB_MESH) {
me= ob->data;
- if(me->edit_btmesh) {
+ if (me->edit_btmesh) {
eve= BM_vert_at_index(me->edit_btmesh->bm, vertnum);
- if(!eve) {
+ if (!eve) {
return 0.0f;
}
dv= CustomData_bmesh_get(&me->edit_btmesh->bm->vdata, eve->head.data, CD_MDEFORMVERT);
}
else {
- if(vertnum >= me->totvert) {
+ if (vertnum >= me->totvert) {
return 0.0f;
}
dv = &me->dvert[vertnum];
}
}
- else if(ob->type==OB_LATTICE) {
+ else if (ob->type==OB_LATTICE) {
Lattice *lt= vgroup_edit_lattice(ob);
- if(lt->dvert) {
- if(vertnum >= lt->pntsu*lt->pntsv*lt->pntsw) {
+ if (lt->dvert) {
+ if (vertnum >= lt->pntsu*lt->pntsv*lt->pntsw) {
return 0.0f;
}
dv = &lt->dvert[vertnum];
@@ -599,7 +599,7 @@ float ED_vgroup_vert_weight(Object *ob, bDeformGroup *dg, int vertnum)
{
const int def_nr= BLI_findindex(&ob->defbase, dg);
- if(def_nr == -1) {
+ if (def_nr == -1) {
return -1;
}
@@ -623,7 +623,7 @@ static void vgroup_select_verts(Object *ob, int select)
return;
}
- if(ob->type == OB_MESH) {
+ if (ob->type == OB_MESH) {
Mesh *me= ob->data;
if (me->edit_btmesh) {
@@ -641,7 +641,7 @@ static void vgroup_select_verts(Object *ob, int select)
}
/* this has to be called, because this function operates on vertices only */
- if(select) EDBM_select_flush(em); // vertices to edges/faces
+ if (select) EDBM_select_flush(em); // vertices to edges/faces
else EDBM_deselect_flush(em);
}
else {
@@ -666,17 +666,17 @@ static void vgroup_select_verts(Object *ob, int select)
}
}
}
- else if(ob->type == OB_LATTICE) {
+ else if (ob->type == OB_LATTICE) {
Lattice *lt= vgroup_edit_lattice(ob);
- if(lt->dvert) {
+ if (lt->dvert) {
BPoint *bp;
int a, tot;
dv= lt->dvert;
tot= lt->pntsu*lt->pntsv*lt->pntsw;
- for(a=0, bp= lt->def; a<tot; a++, bp++, dv++) {
+ for (a=0, bp= lt->def; a<tot; a++, bp++, dv++) {
if (defvert_find_index(dv, def_nr)) {
if (select) bp->f1 |= SELECT;
else bp->f1 &= ~SELECT;
@@ -695,10 +695,10 @@ static void vgroup_duplicate(Object *ob)
int i, idg, icdg, dvert_tot=0;
dg = BLI_findlink(&ob->defbase, (ob->actdef-1));
- if(!dg)
+ if (!dg)
return;
- if(!strstr(dg->name, "_copy")) {
+ if (!strstr(dg->name, "_copy")) {
BLI_snprintf(name, sizeof(name), "%s_copy", dg->name);
}
else {
@@ -719,10 +719,10 @@ static void vgroup_duplicate(Object *ob)
ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot, FALSE);
if (dvert_array) {
- for(i = 0; i < dvert_tot; i++) {
+ for (i = 0; i < dvert_tot; i++) {
MDeformVert *dv= dvert_array[i];
dw_org = defvert_find_index(dv, idg);
- if(dw_org) {
+ if (dw_org) {
/* defvert_verify_index re-allocs org so need to store the weight first */
dw_cpy = defvert_verify_index(dv, icdg);
dw_cpy->weight = dw_org->weight;
@@ -740,8 +740,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;
@@ -752,32 +751,32 @@ static void vgroup_normalize(Object *ob)
if (dvert_array) {
float weight_max = 0.0f;
- for(i = 0; i < dvert_tot; i++) {
+ for (i = 0; i < dvert_tot; i++) {
- /* incase its not selected */
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
dw = defvert_find_index(dv, def_nr);
- if(dw) {
+ if (dw) {
weight_max = MAX2(dw->weight, weight_max);
}
}
- if(weight_max > 0.0f) {
- for(i = 0; i < dvert_tot; i++) {
+ 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;
}
dw = defvert_find_index(dv, def_nr);
- if(dw) {
+ 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);
}
}
@@ -801,21 +800,21 @@ static int* getSurroundingVerts(Mesh *me, int vert, int *count)
BLI_array_declare(verts);
BLI_array_reserve(verts, 8);
- while(i--) {
+ while (i--) {
int j = mp->totloop;
int first_l = mp->totloop - 1;
MLoop *ml = &me->mloop[mp->loopstart];
- while(j--) {
+ while (j--) {
/* XXX This assume a vert can only be once in a poly, even though
- * it seems logical to me, not totaly sure of that. */
+ * it seems logical to me, not totally sure of that. */
if (ml->v == vert) {
int a, b, k;
- if(j == first_l) {
+ if (j == first_l) {
/* We are on the first corner. */
a = ml[1].v;
b = ml[j].v;
}
- else if(!j) {
+ else if (!j) {
/* We are on the last corner. */
a = (ml-1)->v;
b = me->mloop[mp->loopstart].v;
@@ -828,15 +827,15 @@ static int* getSurroundingVerts(Mesh *me, int vert, int *count)
/* Append a and b verts to array, if not yet present. */
k = BLI_array_count(verts);
/* XXX Maybe a == b is enough? */
- while(k-- && !(a == b && a == -1)) {
- if(verts[k] == a)
+ while (k-- && !(a == b && a == -1)) {
+ if (verts[k] == a)
a = -1;
- else if(verts[k] == b)
+ else if (verts[k] == b)
b = -1;
}
- if(a != -1)
+ if (a != -1)
BLI_array_append(verts, a);
- if(b != -1)
+ if (b != -1)
BLI_array_append(verts, b);
/* Vert found in this poly, we can go to next one! */
@@ -853,22 +852,22 @@ 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;
zero_v3(coord);
- for(i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
add_v3_v3(coord, points[i].co);
}
mul_v3_fl(coord, 1.0f/count);
}
/* 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)
@@ -892,32 +891,32 @@ static void getVerticalAndHorizontalChange(const float norm[3], float d, const f
// I need the derived mesh to be forgotten so the positions are recalculated with weight changes (see dm_deform_recalc)
static void dm_deform_clear(DerivedMesh *dm, Object *ob)
{
- if(ob->derivedDeform && (ob->derivedDeform)==dm) {
+ if (ob->derivedDeform && (ob->derivedDeform)==dm) {
ob->derivedDeform->needsFree = 1;
ob->derivedDeform->release(ob->derivedDeform);
ob->derivedDeform = NULL;
}
- else if(dm) {
+ else if (dm) {
dm->needsFree = 1;
dm->release(dm);
}
}
-// 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)
{
@@ -950,56 +949,59 @@ static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, in
copy_v3_v3(oldPos, m.co);
distToStart = dot_v3v3(norm, oldPos) + d;
- if(distToBe == originalDistToBe) {
+ if (distToBe == originalDistToBe) {
distToBe += distToStart - distToStart*strength;
}
- for(i = 0; i < totweight; i++) {
+ for (i = 0; i < totweight; i++) {
dwIndices[i] = i;
dw = (dvert->dw+i);
vc = hc = 0;
- if(!dw->weight) {
+ if (!dw->weight) {
changes[i][0] = 0;
changes[i][1] = 0;
dists[i] = distToStart;
continue;
}
- for(k = 0; k < 2; k++) {
- if(dm) {
+ for (k = 0; k < 2; k++) {
+ if (dm) {
dm_deform_clear(dm, ob); dm = NULL;
}
oldw = dw->weight;
- if(k) {
+ if (k) {
dw->weight *= 1+cp;
- } else {
+ }
+ else {
dw->weight /= 1+cp;
}
- if(dw->weight == oldw) {
+ if (dw->weight == oldw) {
changes[i][0] = 0;
changes[i][1] = 0;
dists[i] = distToStart;
break;
}
- if(dw->weight > 1) {
+ if (dw->weight > 1) {
dw->weight = 1;
}
dm = dm_deform_recalc(scene, ob);
dm->getVert(dm, index, &m);
getVerticalAndHorizontalChange(norm, d, coord, oldPos, distToStart, m.co, changes, dists, i);
dw->weight = oldw;
- if(!k) {
+ if (!k) {
vc = changes[i][0];
hc = changes[i][1];
dist = dists[i];
- } else {
- if(fabs(dist - distToBe) < fabs(dists[i] - distToBe)) {
+ }
+ else {
+ if (fabs(dist - distToBe) < fabs(dists[i] - distToBe)) {
upDown[i] = 0;
changes[i][0] = vc;
changes[i][1] = hc;
dists[i] = dist;
- } else {
+ }
+ else {
upDown[i] = 1;
}
- if(fabs(dists[i] - distToBe) > fabs(distToStart - distToBe)) {
+ if (fabs(dists[i] - distToBe) > fabs(distToStart - distToBe)) {
changes[i][0] = 0;
changes[i][1] = 0;
dists[i] = distToStart;
@@ -1008,19 +1010,19 @@ static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, in
}
}
// sort the changes by the vertical change
- for(k = 0; k < totweight; k++) {
+ for (k = 0; k < totweight; k++) {
float tf;
int ti;
bestIndex = k;
- for(i = k+1; i < totweight; i++) {
+ for (i = k+1; i < totweight; i++) {
dist = dists[i];
- if(fabs(dist) > fabs(dists[i])) {
+ if (fabs(dist) > fabs(dists[i])) {
bestIndex = i;
}
}
// switch with k
- if(bestIndex != k) {
+ if (bestIndex != k) {
ti = upDown[k];
upDown[k] = upDown[bestIndex];
upDown[bestIndex] = ti;
@@ -1044,18 +1046,18 @@ static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, in
}
bestIndex = -1;
// find the best change with an acceptable horizontal change
- for(i = 0; i < totweight; i++) {
- if(fabs(changes[i][0]) > fabs(changes[i][1]*2.0f)) {
+ for (i = 0; i < totweight; i++) {
+ if (fabs(changes[i][0]) > fabs(changes[i][1]*2.0f)) {
bestIndex = i;
break;
}
}
- if(bestIndex != -1) {
+ if (bestIndex != -1) {
wasChange = TRUE;
// it is a good place to stop if it tries to move the opposite direction
// (relative to the plane) of last time
- if(lastIndex != -1) {
- if(wasUp != upDown[bestIndex]) {
+ if (lastIndex != -1) {
+ if (wasUp != upDown[bestIndex]) {
wasChange = FALSE;
}
}
@@ -1063,22 +1065,23 @@ static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, in
wasUp = upDown[bestIndex];
dw = (dvert->dw+dwIndices[bestIndex]);
oldw = dw->weight;
- if(upDown[bestIndex]) {
+ if (upDown[bestIndex]) {
dw->weight *= 1+cp;
- } else {
+ }
+ else {
dw->weight /= 1+cp;
}
- if(dw->weight > 1) {
+ if (dw->weight > 1) {
dw->weight = 1;
}
- if(oldw == dw->weight) {
+ if (oldw == dw->weight) {
wasChange = FALSE;
}
- if(dm) {
+ if (dm) {
dm_deform_clear(dm, ob); dm = NULL;
}
}
- } while(wasChange && (distToStart-distToBe)/fabsf(distToStart-distToBe) ==
+ } while (wasChange && (distToStart-distToBe)/fabsf(distToStart-distToBe) ==
(dists[bestIndex]-distToBe)/fabsf(dists[bestIndex]-distToBe));
MEM_freeN(upDown);
MEM_freeN(changes);
@@ -1087,7 +1090,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;
@@ -1095,24 +1098,24 @@ static void vgroup_fix(Scene *scene, Object *ob, float distToBe, float strength,
Mesh *me = ob->data;
MVert *mvert = me->mvert;
int *verts = NULL;
- if(!(me->editflag & ME_EDIT_VERT_SEL))
+ if (!(me->editflag & ME_EDIT_VERT_SEL))
return;
- for(i = 0; i < me->totvert && mvert; i++, mvert++) {
- if(mvert->flag & SELECT) {
+ for (i = 0; i < me->totvert && mvert; i++, mvert++) {
+ if (mvert->flag & SELECT) {
int count=0;
- if((verts = getSurroundingVerts(me, i, &count))) {
+ if ((verts = getSurroundingVerts(me, i, &count))) {
MVert m;
MVert *p = MEM_callocN(sizeof(MVert)*(count), "deformedPoints");
int k;
DerivedMesh *dm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
k = count;
- while(k--) {
+ while (k--) {
dm->getVert(dm, verts[k], &m);
p[k] = m;
}
- if(count >= 3) {
+ if (count >= 3) {
float d /*, dist */ /* UNUSED */, mag;
float coord[3];
float norm[3];
@@ -1120,7 +1123,7 @@ static void vgroup_fix(Scene *scene, Object *ob, float distToBe, float strength,
dm->getVert(dm, i, &m);
sub_v3_v3v3(norm, m.co, coord);
mag= normalize_v3(norm);
- if(mag) { /* zeros fix */
+ if (mag) { /* zeros fix */
d = -dot_v3v3(norm, coord);
/* dist = (dot_v3v3(norm, m.co) + d); */ /* UNUSED */
moveCloserToDistanceFromPlane(scene, ob, me, i, norm, coord, d, distToBe, strength, cp);
@@ -1141,8 +1144,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;
@@ -1151,15 +1153,15 @@ static void vgroup_levels(Object *ob, float offset, float gain)
ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot, use_vert_sel);
if (dvert_array) {
- for(i = 0; i < dvert_tot; i++) {
+ for (i = 0; i < dvert_tot; i++) {
- /* incase its not selected */
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
dw = defvert_find_index(dv, def_nr);
- if(dw) {
+ if (dw) {
dw->weight = gain * (dw->weight + offset);
CLAMP(dw->weight, 0.0f, 1.0f);
@@ -1177,8 +1179,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;
@@ -1187,10 +1188,10 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot, use_vert_sel);
if (dvert_array) {
- if(lock_active) {
+ if (lock_active) {
- for(i = 0; i < dvert_tot; i++) {
- /* incase its not selected */
+ for (i = 0; i < dvert_tot; i++) {
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
@@ -1199,9 +1200,9 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
}
}
else {
- for(i = 0; i < dvert_tot; i++) {
+ for (i = 0; i < dvert_tot; i++) {
- /* incase its not selected */
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
@@ -1218,17 +1219,17 @@ static void vgroup_lock_all(Object *ob, int action)
{
bDeformGroup *dg;
- if(action == SEL_TOGGLE) {
+ if (action == SEL_TOGGLE) {
action= SEL_SELECT;
- for(dg= ob->defbase.first; dg; dg= dg->next) {
- if(dg->flag & DG_LOCK_WEIGHT) {
+ for (dg= ob->defbase.first; dg; dg= dg->next) {
+ if (dg->flag & DG_LOCK_WEIGHT) {
action= SEL_DESELECT;
break;
}
}
}
- for(dg= ob->defbase.first; dg; dg= dg->next) {
+ for (dg= ob->defbase.first; dg; dg= dg->next) {
switch(action) {
case SEL_SELECT:
dg->flag |= DG_LOCK_WEIGHT;
@@ -1249,9 +1250,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;
@@ -1260,9 +1259,9 @@ static void vgroup_invert(Object *ob, const short auto_assign, const short auto_
ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot, use_vert_sel);
if (dvert_array) {
- for(i = 0; i < dvert_tot; i++) {
+ for (i = 0; i < dvert_tot; i++) {
- /* incase its not selected */
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
@@ -1274,10 +1273,10 @@ static void vgroup_invert(Object *ob, const short auto_assign, const short auto_
dw= defvert_find_index(dv, def_nr);
}
- if(dw) {
+ if (dw) {
dw->weight = 1.0f - dw->weight;
- if(auto_remove && dw->weight <= 0.0f) {
+ if (auto_remove && dw->weight <= 0.0f) {
defvert_remove_group(dv, dw);
}
}
@@ -1287,84 +1286,132 @@ static void vgroup_invert(Object *ob, const short auto_assign, const short auto_
}
}
-static void vgroup_blend(Object *ob)
+static void vgroup_blend(Object *ob, const float fac)
{
+ MDeformVert *dv;
MDeformWeight *dw;
- MDeformVert *dvert_array=NULL, *dvert;
int i, dvert_tot=0;
- const int def_nr= ob->actdef-1;
+ const int def_nr= ob->actdef - 1;
- BMEditMesh *em= ((Mesh *)ob->data)->edit_btmesh;
- // ED_vgroup_give_array(ob->data, &dvert_array, &dvert_tot);
+ BLI_assert(fac >= 0.0 && fac <= 1.0f);
- if (em==NULL)
+ if (ob->type != OB_MESH) {
return;
+ }
if (BLI_findlink(&ob->defbase, def_nr)) {
+ const float ifac = 1.0f - fac;
+ int i1, i2;
+
+ BMEditMesh *em = BMEdit_FromObject(ob);
+ BMesh *bm = em ? em->bm : NULL;
+ Mesh *me = em ? NULL : ob->data;
+
+ /* bmesh only*/
BMEdge *eed;
BMVert *eve;
BMIter iter;
- int i1, i2;
+ /* mesh only */
+ MDeformVert *dvert_array = NULL;
+
float *vg_weights;
float *vg_users;
int sel1, sel2;
- BM_mesh_elem_index_ensure(em->bm, BM_VERT);
+ if (bm) {
+ BM_mesh_elem_index_ensure(bm, BM_VERT);
+ dvert_tot = bm->totvert;
+ }
+ else {
+ dvert_tot = me->totvert;
+ dvert_array = me->dvert;
+ }
- dvert_tot= em->bm->totvert;
+ vg_weights = MEM_callocN(sizeof(float) * dvert_tot, "vgroup_blend_f");
+ vg_users = MEM_callocN(sizeof(int) * dvert_tot, "vgroup_blend_i");
- vg_weights= MEM_callocN(sizeof(float)*dvert_tot, "vgroup_blend_f");
- vg_users= MEM_callocN(sizeof(int)*dvert_tot, "vgroup_blend_i");
+ if (bm) {
+ BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ sel1 = BM_elem_flag_test(eed->v1, BM_ELEM_SELECT);
+ sel2 = BM_elem_flag_test(eed->v2, BM_ELEM_SELECT);
- BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
- sel1= BM_elem_flag_test(eed->v1, BM_ELEM_SELECT);
- sel2= BM_elem_flag_test(eed->v2, BM_ELEM_SELECT);
+ if (sel1 != sel2) {
+ /* i1 is always the selected one */
+ if (sel1) {
+ i1= BM_elem_index_get(eed->v1);
+ i2= BM_elem_index_get(eed->v2);
+ eve= eed->v2;
+ }
+ else {
+ i2= BM_elem_index_get(eed->v1);
+ i1= BM_elem_index_get(eed->v2);
+ eve= eed->v1;
+ }
- if(sel1 != sel2) {
- /* i1 is always the selected one */
- if(sel1==TRUE && sel2==FALSE) {
- i1= BM_elem_index_get(eed->v1);
- i2= BM_elem_index_get(eed->v2);
- eve= eed->v2;
- }
- else {
- i2= BM_elem_index_get(eed->v1);
- i1= BM_elem_index_get(eed->v2);
- eve= eed->v1;
+ dv = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_MDEFORMVERT);
+ dw = defvert_find_index(dv, def_nr);
+ if (dw) {
+ vg_weights[i1] += dw->weight;
+ }
+ vg_users[i1]++;
}
+ }
- 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;
-
- dw= defvert_find_index(dvert, def_nr);
+ BM_ITER_INDEX(eve, &iter, bm, BM_VERTS_OF_MESH, NULL, i) {
+ if (BM_elem_flag_test(eve, BM_ELEM_SELECT) && vg_users[i] > 0) {
+ dv = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_MDEFORMVERT);
- if(dw) {
- vg_weights[i1] += dw->weight;
+ dw = defvert_verify_index(dv, def_nr);
+ dw->weight = (fac * (vg_weights[i] / (float)vg_users[i])) + (ifac * dw->weight);
+ /* in case of division errors */
+ CLAMP(dw->weight, 0.0f, 1.0f);
}
}
}
+ else {
+ MEdge *ed = me->medge;
+ MVert *mv;
- i= 0;
- BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
- if(BM_elem_flag_test(eve, BM_ELEM_SELECT) && vg_users[i] > 0) {
- /* 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+i;
+ for (i = 0; i < me->totedge; i++, ed++) {
+ sel1 = me->mvert[ed->v1].flag & SELECT;
+ sel2 = me->mvert[ed->v2].flag & SELECT;
- dw= defvert_verify_index(dvert, def_nr);
- dw->weight= vg_weights[i] / (float)vg_users[i];
+ if (sel1 != sel2) {
+ /* i1 is always the selected one */
+ if (sel1) {
+ i1 = ed->v1;
+ i2 = ed->v2;
+ }
+ else {
+ i2 = ed->v1;
+ i1 = ed->v2;
+ }
- /* incase of division errors */
- CLAMP(dw->weight, 0.0f, 1.0f);
+ dv = &dvert_array[i2];
+ dw = defvert_find_index(dv, def_nr);
+ if (dw) {
+ vg_weights[i1] += dw->weight;
+ }
+ vg_users[i1]++;
+ }
}
- i++;
+ mv = me->mvert;
+ dv = dvert_array;
+
+ for (i = 0; i < dvert_tot; i++, mv++, dv++) {
+ if ((mv->flag & SELECT) && (vg_users[i] > 0)) {
+ dw = defvert_verify_index(dv, def_nr);
+ dw->weight = (fac * (vg_weights[i] / (float)vg_users[i])) + (ifac * dw->weight);
+
+ /* in case of division errors */
+ CLAMP(dw->weight, 0.0f, 1.0f);
+ }
+ }
}
+
MEM_freeN(vg_weights);
MEM_freeN(vg_users);
}
@@ -1376,9 +1423,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;
@@ -1388,9 +1433,9 @@ static void vgroup_clean(Object *ob, const float epsilon, int keep_single)
if (dvert_array) {
/* only the active group */
- for(i = 0; i < dvert_tot; i++) {
+ for (i = 0; i < dvert_tot; i++) {
- /* incase its not selected */
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
@@ -1399,7 +1444,7 @@ static void vgroup_clean(Object *ob, const float epsilon, int keep_single)
if (dw) {
if (dw->weight <= epsilon) {
- if(keep_single==FALSE || dv->totweight > 1) {
+ if (keep_single==FALSE || dv->totweight > 1) {
defvert_remove_group(dv, dw); /* dw can be NULL */
}
}
@@ -1413,10 +1458,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);
@@ -1424,24 +1467,24 @@ static void vgroup_clean_all(Object *ob, const float epsilon, const int keep_sin
MDeformVert *dv;
MDeformWeight *dw;
- for(i = 0; i < dvert_tot; i++) {
+ for (i = 0; i < dvert_tot; i++) {
int j;
- /* incase its not selected */
+ /* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
}
j= dv->totweight;
- while(j--) {
+ while (j--) {
- if(keep_single && dv->totweight == 1)
+ if (keep_single && dv->totweight == 1)
break;
dw= dv->dw + j;
- if(dw->weight <= epsilon) {
+ if (dw->weight <= epsilon) {
defvert_remove_group(dv, dw);
}
}
@@ -1460,9 +1503,9 @@ static void dvert_mirror_op(MDeformVert *dvert, MDeformVert *dvert_mirr,
{
BLI_assert(sel || sel_mirr);
- if(sel_mirr && sel) {
+ if (sel_mirr && sel) {
/* swap */
- if(mirror_weights) {
+ if (mirror_weights) {
if (all_vgroups) {
SWAP(MDeformVert, *dvert, *dvert_mirr);
}
@@ -1481,18 +1524,18 @@ static void dvert_mirror_op(MDeformVert *dvert, MDeformVert *dvert_mirr,
}
}
- if(flip_vgroups) {
+ if (flip_vgroups) {
defvert_flip(dvert, flip_map, flip_map_len);
defvert_flip(dvert_mirr, flip_map, flip_map_len);
}
}
else {
/* dvert should always be the target, only swaps pointer */
- if(sel_mirr) {
+ if (sel_mirr) {
SWAP(MDeformVert *, dvert, dvert_mirr);
}
- if(mirror_weights) {
+ if (mirror_weights) {
if (all_vgroups) {
defvert_copy(dvert, dvert_mirr);
}
@@ -1502,7 +1545,7 @@ static void dvert_mirror_op(MDeformVert *dvert, MDeformVert *dvert_mirr,
}
/* flip map already modified for 'all_vgroups' */
- if(flip_vgroups) {
+ if (flip_vgroups) {
defvert_flip(dvert, flip_map, flip_map_len);
}
}
@@ -1551,45 +1594,45 @@ void ED_vgroup_mirror(Object *ob, const short mirror_weights, const short flip_v
}
/* only the active group */
- if(ob->type == OB_MESH) {
+ if (ob->type == OB_MESH) {
Mesh *me= ob->data;
BMEditMesh *em = me->edit_btmesh;
if (em) {
BMIter iter;
- if(!CustomData_has_layer(&em->bm->vdata, CD_MDEFORMVERT)) {
+ if (!CustomData_has_layer(&em->bm->vdata, CD_MDEFORMVERT)) {
goto cleanup;
}
- EDBM_CacheMirrorVerts(em, FALSE);
+ EDBM_verts_mirror_cache_begin(em, FALSE);
/* Go through the list of editverts and assign them */
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
- if((eve_mirr= EDBM_GetMirrorVert(em, eve))) {
+ if ((eve_mirr= EDBM_verts_mirror_get(em, eve))) {
sel= BM_elem_flag_test(eve, BM_ELEM_SELECT);
sel_mirr= BM_elem_flag_test(eve_mirr, BM_ELEM_SELECT);
- if((sel || sel_mirr) && (eve != eve_mirr)) {
+ if ((sel || sel_mirr) && (eve != eve_mirr)) {
dvert= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
dvert_mirr= CustomData_bmesh_get(&em->bm->vdata, eve_mirr->head.data, CD_MDEFORMVERT);
- if(dvert && dvert_mirr) {
+ if (dvert && dvert_mirr) {
VGROUP_MIRR_OP;
}
}
/* don't use these again */
- EDBM_ClearMirrorVert(em, eve);
- EDBM_ClearMirrorVert(em, eve_mirr);
+ EDBM_verts_mirror_cache_clear(em, eve);
+ EDBM_verts_mirror_cache_clear(em, eve_mirr);
}
}
- EDBM_EndMirrorCache(em);
+ EDBM_verts_mirror_cache_end(em);
}
else {
/* 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;
@@ -1600,11 +1643,11 @@ void ED_vgroup_mirror(Object *ob, const short mirror_weights, const short flip_v
}
/* tag verts we have used */
- for(vidx= 0, mv= me->mvert; vidx < me->totvert; vidx++, mv++) {
+ for (vidx= 0, mv= me->mvert; vidx < me->totvert; vidx++, mv++) {
mv->flag &= ~ME_VERT_TMP_TAG;
}
- for(vidx= 0, mv= me->mvert; vidx < me->totvert; vidx++, mv++) {
+ for (vidx= 0, mv= me->mvert; vidx < me->totvert; vidx++, mv++) {
if ( ((mv->flag & ME_VERT_TMP_TAG) == 0) &&
((vidx_mirr= mesh_get_x_mirror_vert(ob, vidx)) != -1) &&
(vidx != vidx_mirr) &&
@@ -1636,20 +1679,20 @@ void ED_vgroup_mirror(Object *ob, const short mirror_weights, const short flip_v
int pntsu_half;
/* half but found up odd value */
- if(lt->pntsu == 1 || lt->dvert == NULL) {
+ if (lt->pntsu == 1 || lt->dvert == NULL) {
goto cleanup;
}
- /* unlike editmesh we know that by only looping over the first hald of
- * the 'u' indicies it will cover all points except the middle which is
+ /* 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;
- for(w=0; w<lt->pntsw; w++) {
- for(v=0; v<lt->pntsv; v++) {
- for(u=0; u<pntsu_half; u++) {
+ for (w=0; w<lt->pntsw; w++) {
+ for (v=0; v<lt->pntsv; v++) {
+ for (u=0; u<pntsu_half; u++) {
int u_inv= (lt->pntsu - 1) - u;
- if(u != u_inv) {
+ if (u != u_inv) {
BPoint *bp, *bp_mirr;
i1= LT_INDEX(lt, u, v, w);
@@ -1661,7 +1704,7 @@ void ED_vgroup_mirror(Object *ob, const short mirror_weights, const short flip_v
sel= bp->f1 & SELECT;
sel_mirr= bp_mirr->f1 & SELECT;
- if(sel || sel_mirr) {
+ if (sel || sel_mirr) {
dvert= &lt->dvert[i1];
dvert_mirr= &lt->dvert[i2];
@@ -1692,19 +1735,19 @@ static void vgroup_remap_update_users(Object *ob, int *map)
/* these cases don't use names to refer to vertex groups, so when
* they get deleted the numbers get out of sync, this corrects that */
- if(ob->soft)
+ if (ob->soft)
ob->soft->vertgroup= map[ob->soft->vertgroup];
- for(md=ob->modifiers.first; md; md=md->next) {
- if(md->type == eModifierType_Explode) {
+ for (md=ob->modifiers.first; md; md=md->next) {
+ if (md->type == eModifierType_Explode) {
emd= (ExplodeModifierData*)md;
emd->vgroup= map[emd->vgroup];
}
- else if(md->type == eModifierType_Cloth) {
+ else if (md->type == eModifierType_Cloth) {
clmd= (ClothModifierData*)md;
clsim= clmd->sim_parms;
- if(clsim) {
+ if (clsim) {
clsim->vgroup_mass= map[clsim->vgroup_mass];
clsim->vgroup_bend= map[clsim->vgroup_bend];
clsim->vgroup_struct= map[clsim->vgroup_struct];
@@ -1712,8 +1755,8 @@ static void vgroup_remap_update_users(Object *ob, int *map)
}
}
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- for(a=0; a<PSYS_TOT_VG; a++)
+ for (psys=ob->particlesystem.first; psys; psys=psys->next) {
+ for (a=0; a<PSYS_TOT_VG; a++)
psys->vgroup[a]= map[psys->vgroup[a]];
}
}
@@ -1725,8 +1768,8 @@ static void vgroup_delete_update_users(Object *ob, int id)
int *map= MEM_mallocN(sizeof(int) * defbase_tot, "vgroup del");
map[id]= map[0]= 0;
- for(i=1; i<id; i++) map[i]=i;
- for(i=id+1; i<defbase_tot; i++) map[i]=i-1;
+ for (i=1; i<id; i++) map[i]=i;
+ for (i=id+1; i<defbase_tot; i++) map[i]=i-1;
vgroup_remap_update_users(ob, map);
MEM_freeN(map);
@@ -1743,18 +1786,18 @@ static void vgroup_delete_object_mode(Object *ob, bDeformGroup *dg)
ED_vgroup_give_array(ob->data, &dvert_array, &dvert_tot);
- if(dvert_array) {
+ if (dvert_array) {
int i, j;
MDeformVert *dv;
- for(i= 0, dv= dvert_array; i < dvert_tot; i++, dv++) {
+ for (i= 0, dv= dvert_array; i < dvert_tot; i++, dv++) {
MDeformWeight *dw;
dw= defvert_find_index(dv, def_nr);
defvert_remove_group(dv, dw); /* dw can be NULL */
/* inline, make into a function if anything else needs to do this */
- for(j = 0; j < dv->totweight; j++) {
- if(dv->dw[j].def_nr > def_nr) {
+ for (j = 0; j < dv->totweight; j++) {
+ if (dv->dw[j].def_nr > def_nr) {
dv->dw[j].def_nr--;
}
}
@@ -1768,9 +1811,9 @@ static void vgroup_delete_object_mode(Object *ob, bDeformGroup *dg)
BLI_freelinkN(&ob->defbase, dg);
/* Update the active deform index if necessary */
- if(ob->actdef > def_nr)
+ if (ob->actdef > def_nr)
ob->actdef--;
- if(ob->actdef < 1 && ob->defbase.first)
+ if (ob->actdef < 1 && ob->defbase.first)
ob->actdef= 1;
}
@@ -1782,7 +1825,7 @@ static void vgroup_active_remove_verts(Object *ob, const int allverts, bDeformGr
MDeformVert *dv;
const int def_nr= BLI_findindex(&ob->defbase, dg);
- if(ob->type == OB_MESH) {
+ if (ob->type == OB_MESH) {
Mesh *me= ob->data;
if (me->edit_btmesh) {
@@ -1793,7 +1836,7 @@ static void vgroup_active_remove_verts(Object *ob, const int allverts, bDeformGr
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
dv= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
- if(dv && dv->dw && (allverts || BM_elem_flag_test(eve, BM_ELEM_SELECT))) {
+ if (dv && dv->dw && (allverts || BM_elem_flag_test(eve, BM_ELEM_SELECT))) {
MDeformWeight *dw = defvert_find_index(dv, def_nr);
defvert_remove_group(dv, dw); /* dw can be NULL */
}
@@ -1821,15 +1864,15 @@ static void vgroup_active_remove_verts(Object *ob, const int allverts, bDeformGr
}
}
}
- else if(ob->type == OB_LATTICE) {
+ else if (ob->type == OB_LATTICE) {
Lattice *lt= vgroup_edit_lattice(ob);
- if(lt->dvert) {
+ if (lt->dvert) {
BPoint *bp;
int i, tot= lt->pntsu*lt->pntsv*lt->pntsw;
- for(i=0, bp= lt->def; i<tot; i++, bp++) {
- if(allverts || (bp->f1 & SELECT)) {
+ for (i=0, bp= lt->def; i<tot; i++, bp++) {
+ if (allverts || (bp->f1 & SELECT)) {
MDeformWeight *dw;
dv= &lt->dvert[i];
@@ -1853,7 +1896,7 @@ static void vgroup_delete_edit_mode(Object *ob, bDeformGroup *dg)
vgroup_active_remove_verts(ob, TRUE, dg);
/* Make sure that any verts with higher indices are adjusted accordingly */
- if(ob->type==OB_MESH) {
+ if (ob->type==OB_MESH) {
Mesh *me= ob->data;
BMEditMesh *em = me->edit_btmesh;
BMIter iter;
@@ -1863,23 +1906,23 @@ static void vgroup_delete_edit_mode(Object *ob, bDeformGroup *dg)
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
dvert= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
- if(dvert)
- for(i=0; i<dvert->totweight; i++)
- if(dvert->dw[i].def_nr > dg_index)
+ if (dvert)
+ for (i=0; i<dvert->totweight; i++)
+ if (dvert->dw[i].def_nr > dg_index)
dvert->dw[i].def_nr--;
}
}
- else if(ob->type==OB_LATTICE) {
+ else if (ob->type==OB_LATTICE) {
Lattice *lt= vgroup_edit_lattice(ob);
BPoint *bp;
MDeformVert *dvert= lt->dvert;
int a, tot;
- if(dvert) {
+ if (dvert) {
tot= lt->pntsu*lt->pntsv*lt->pntsw;
- for(a=0, bp= lt->def; a<tot; a++, bp++, dvert++) {
- for(i=0; i<dvert->totweight; i++){
- if(dvert->dw[i].def_nr > dg_index)
+ for (a=0, bp= lt->def; a<tot; a++, bp++, dvert++) {
+ for (i=0; i<dvert->totweight; i++) {
+ if (dvert->dw[i].def_nr > dg_index)
dvert->dw[i].def_nr--;
}
}
@@ -1892,21 +1935,21 @@ static void vgroup_delete_edit_mode(Object *ob, bDeformGroup *dg)
BLI_freelinkN (&ob->defbase, dg);
/* Update the active deform index if necessary */
- if(ob->actdef > dg_index)
+ if (ob->actdef > dg_index)
ob->actdef--;
- if(ob->actdef < 1 && ob->defbase.first)
+ if (ob->actdef < 1 && ob->defbase.first)
ob->actdef= 1;
/* remove all dverts */
- if(ob->defbase.first == NULL) {
- if(ob->type==OB_MESH) {
+ if (ob->defbase.first == NULL) {
+ if (ob->type==OB_MESH) {
Mesh *me= ob->data;
CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert);
me->dvert= NULL;
}
- else if(ob->type==OB_LATTICE) {
+ else if (ob->type==OB_LATTICE) {
Lattice *lt= vgroup_edit_lattice(ob);
- if(lt->dvert) {
+ if (lt->dvert) {
MEM_freeN(lt->dvert);
lt->dvert= NULL;
}
@@ -1916,9 +1959,9 @@ static void vgroup_delete_edit_mode(Object *ob, bDeformGroup *dg)
static int vgroup_object_in_edit_mode(Object *ob)
{
- if(ob->type == OB_MESH)
- return (((Mesh*)ob->data)->edit_btmesh != NULL);
- else if(ob->type == OB_LATTICE)
+ if (ob->type == OB_MESH)
+ return (BMEdit_FromObject(ob) != NULL);
+ else if (ob->type == OB_LATTICE)
return (((Lattice*)ob->data)->editlatt != NULL);
return 0;
@@ -1939,10 +1982,10 @@ static int vgroup_object_in_wpaint_vert_select(Object *ob)
static void vgroup_delete(Object *ob)
{
bDeformGroup *dg = BLI_findlink(&ob->defbase, ob->actdef-1);
- if(!dg)
+ if (!dg)
return;
- if(vgroup_object_in_edit_mode(ob))
+ if (vgroup_object_in_edit_mode(ob))
vgroup_delete_edit_mode(ob, dg);
else
vgroup_delete_object_mode(ob, dg);
@@ -1951,14 +1994,14 @@ static void vgroup_delete(Object *ob)
static void vgroup_delete_all(Object *ob)
{
/* Remove all DVerts */
- if(ob->type==OB_MESH) {
+ if (ob->type==OB_MESH) {
Mesh *me= ob->data;
CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert);
me->dvert= NULL;
}
- else if(ob->type==OB_LATTICE) {
+ else if (ob->type==OB_LATTICE) {
Lattice *lt= vgroup_edit_lattice(ob);
- if(lt->dvert) {
+ if (lt->dvert) {
MEM_freeN(lt->dvert);
lt->dvert= NULL;
}
@@ -1977,10 +2020,10 @@ static void vgroup_assign_verts(Object *ob, const float weight)
MDeformVert *dv;
const int def_nr= ob->actdef-1;
- if(!BLI_findlink(&ob->defbase, def_nr))
+ if (!BLI_findlink(&ob->defbase, def_nr))
return;
- if(ob->type == OB_MESH) {
+ if (ob->type == OB_MESH) {
Mesh *me= ob->data;
if (me->edit_btmesh) {
@@ -1988,7 +2031,7 @@ static void vgroup_assign_verts(Object *ob, const float weight)
BMIter iter;
BMVert *eve;
- if(!CustomData_has_layer(&em->bm->vdata, CD_MDEFORMVERT))
+ if (!CustomData_has_layer(&em->bm->vdata, CD_MDEFORMVERT))
BM_data_layer_add(em->bm, &em->bm->vdata, CD_MDEFORMVERT);
/* Go through the list of editverts and assign them */
@@ -2026,19 +2069,19 @@ static void vgroup_assign_verts(Object *ob, const float weight)
}
}
}
- else if(ob->type == OB_LATTICE) {
+ else if (ob->type == OB_LATTICE) {
Lattice *lt= vgroup_edit_lattice(ob);
BPoint *bp;
int a, tot;
- if(lt->dvert==NULL)
+ if (lt->dvert==NULL)
ED_vgroup_data_create(&lt->id);
dv= lt->dvert;
tot= lt->pntsu*lt->pntsv*lt->pntsw;
- for(a=0, bp= lt->def; a<tot; a++, bp++, dv++) {
- if(bp->f1 & SELECT) {
+ for (a=0, bp= lt->def; a<tot; a++, bp++, dv++) {
+ if (bp->f1 & SELECT) {
MDeformWeight *dw;
dw= defvert_verify_index(dv, def_nr);
@@ -2059,7 +2102,7 @@ static void vgroup_remove_verts(Object *ob, int allverts)
* active group index
*/
bDeformGroup *dg;
- for(dg= ob->defbase.first; dg; dg= dg->next) {
+ for (dg= ob->defbase.first; dg; dg= dg->next) {
vgroup_active_remove_verts(ob, allverts, dg);
}
}
@@ -2073,12 +2116,12 @@ 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;
- if(!(ob && !ob->id.lib && data && !data->lib))
+ if (!(ob && !ob->id.lib && data && !data->lib))
return 0;
return vgroup_object_in_edit_mode(ob);
@@ -2090,7 +2133,7 @@ static int vertex_group_poll_edit_or_wpaint_vert_select(bContext *C)
Object *ob= ED_object_context(C);
ID *data= (ob)? ob->data: NULL;
- if(!(ob && !ob->id.lib && data && !data->lib))
+ if (!(ob && !ob->id.lib && data && !data->lib))
return 0;
return ( vgroup_object_in_edit_mode(ob) ||
@@ -2112,22 +2155,22 @@ static int vertex_group_add_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Vertex Group";
- ot->idname= "OBJECT_OT_vertex_group_add";
+ ot->name = "Add Vertex Group";
+ ot->idname = "OBJECT_OT_vertex_group_add";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_add_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vertex_group_add_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int vertex_group_remove_exec(bContext *C, wmOperator *op)
{
Object *ob= ED_object_context(C);
- if(RNA_boolean_get(op->ptr, "all"))
+ if (RNA_boolean_get(op->ptr, "all"))
vgroup_delete_all(ob);
else
vgroup_delete(ob);
@@ -2142,18 +2185,18 @@ static int vertex_group_remove_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Vertex Group";
- ot->idname= "OBJECT_OT_vertex_group_remove";
+ ot->name = "Remove Vertex Group";
+ ot->idname = "OBJECT_OT_vertex_group_remove";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_remove_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vertex_group_remove_exec;
/* 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) */
- ot->flag= /*OPTYPE_REGISTER|*/OPTYPE_UNDO;
+ * 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 */
RNA_def_boolean(ot->srna, "all", 0, "All", "Remove from all vertex groups");
@@ -2164,7 +2207,7 @@ static int vertex_group_assign_exec(bContext *C, wmOperator *op)
ToolSettings *ts= CTX_data_tool_settings(C);
Object *ob= ED_object_context(C);
- if(RNA_boolean_get(op->ptr, "new"))
+ if (RNA_boolean_get(op->ptr, "new"))
ED_vgroup_add(ob);
vgroup_assign_verts(ob, ts->vgroup_weight);
@@ -2177,18 +2220,18 @@ static int vertex_group_assign_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_assign(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Assign Vertex Group";
- ot->idname= "OBJECT_OT_vertex_group_assign";
+ ot->name = "Assign Vertex Group";
+ ot->idname = "OBJECT_OT_vertex_group_assign";
/* api callbacks */
- ot->poll= vertex_group_poll_edit_or_wpaint_vert_select;
- ot->exec= vertex_group_assign_exec;
+ ot->poll = vertex_group_poll_edit_or_wpaint_vert_select;
+ ot->exec = vertex_group_assign_exec;
/* 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) */
- ot->flag= /*OPTYPE_REGISTER|*/OPTYPE_UNDO;
+ * 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 */
RNA_def_boolean(ot->srna, "new", 0, "New", "Assign vertex to new vertex group");
@@ -2198,12 +2241,12 @@ static int vertex_group_remove_from_exec(bContext *C, wmOperator *op)
{
Object *ob= ED_object_context(C);
- if(RNA_boolean_get(op->ptr, "all"))
+ if (RNA_boolean_get(op->ptr, "all"))
vgroup_remove_verts(ob, 0);
else {
bDeformGroup *dg= BLI_findlink(&ob->defbase, ob->actdef - 1);
- if(dg == NULL) {
+ if (dg == NULL) {
return OPERATOR_CANCELLED;
}
@@ -2219,18 +2262,18 @@ static int vertex_group_remove_from_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove from Vertex Group";
- ot->idname= "OBJECT_OT_vertex_group_remove_from";
+ ot->name = "Remove from Vertex Group";
+ ot->idname = "OBJECT_OT_vertex_group_remove_from";
/* api callbacks */
- ot->poll= vertex_group_poll_edit_or_wpaint_vert_select;
- ot->exec= vertex_group_remove_from_exec;
+ ot->poll = vertex_group_poll_edit_or_wpaint_vert_select;
+ 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) */
- ot->flag= /*OPTYPE_REGISTER|*/OPTYPE_UNDO;
+ /* 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 */
RNA_def_boolean(ot->srna, "all", 0, "All", "Remove from all vertex groups");
@@ -2240,7 +2283,7 @@ static int vertex_group_select_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob= ED_object_context(C);
- if(!ob || ob->id.lib)
+ if (!ob || ob->id.lib)
return OPERATOR_CANCELLED;
vgroup_select_verts(ob, 1);
@@ -2252,15 +2295,15 @@ static int vertex_group_select_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Vertex Group";
- ot->idname= "OBJECT_OT_vertex_group_select";
+ ot->name = "Select Vertex Group";
+ ot->idname = "OBJECT_OT_vertex_group_select";
/* api callbacks */
- ot->poll= vertex_group_poll_edit_or_wpaint_vert_select;
- ot->exec= vertex_group_select_exec;
+ ot->poll = vertex_group_poll_edit_or_wpaint_vert_select;
+ ot->exec = vertex_group_select_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int vertex_group_deselect_exec(bContext *C, wmOperator *UNUSED(op))
@@ -2276,15 +2319,15 @@ static int vertex_group_deselect_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_deselect(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Deselect Vertex Group";
- ot->idname= "OBJECT_OT_vertex_group_deselect";
+ ot->name = "Deselect Vertex Group";
+ ot->idname = "OBJECT_OT_vertex_group_deselect";
/* api callbacks */
- ot->poll= vertex_group_poll_edit_or_wpaint_vert_select;
- ot->exec= vertex_group_deselect_exec;
+ ot->poll = vertex_group_poll_edit_or_wpaint_vert_select;
+ ot->exec = vertex_group_deselect_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/*Adds a copy of selected vertex group from source object to source object*/
@@ -2303,15 +2346,15 @@ static int vertex_group_copy_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_copy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Vertex Group";
- ot->idname= "OBJECT_OT_vertex_group_copy";
+ ot->name = "Copy Vertex Group";
+ ot->idname = "OBJECT_OT_vertex_group_copy";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_copy_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vertex_group_copy_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int vertex_group_levels_exec(bContext *C, wmOperator *op)
@@ -2333,15 +2376,15 @@ static int vertex_group_levels_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_levels(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Vertex Group Levels";
- ot->idname= "OBJECT_OT_vertex_group_levels";
+ ot->name = "Vertex Group Levels";
+ ot->idname = "OBJECT_OT_vertex_group_levels";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_levels_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vertex_group_levels_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_float(ot->srna, "offset", 0.f, -1.0, 1.0, "Offset", "Value to add to weights", -1.0f, 1.f);
RNA_def_float(ot->srna, "gain", 1.f, 0.f, FLT_MAX, "Gain", "Value to multiply weights by", 0.0f, 10.f);
@@ -2363,15 +2406,15 @@ static int vertex_group_normalize_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_normalize(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Normalize Vertex Group";
- ot->idname= "OBJECT_OT_vertex_group_normalize";
+ ot->name = "Normalize Vertex Group";
+ ot->idname = "OBJECT_OT_vertex_group_normalize";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_normalize_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vertex_group_normalize_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int vertex_group_normalize_all_exec(bContext *C, wmOperator *op)
@@ -2391,15 +2434,15 @@ static int vertex_group_normalize_all_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_normalize_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Normalize All Vertex Groups";
- ot->idname= "OBJECT_OT_vertex_group_normalize_all";
+ ot->name = "Normalize All Vertex Groups";
+ ot->idname = "OBJECT_OT_vertex_group_normalize_all";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_normalize_all_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vertex_group_normalize_all_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "lock_active", TRUE, "Lock Active",
"Keep the values of the active group while normalizing others");
@@ -2415,14 +2458,14 @@ static int vertex_group_fix_exec(bContext *C, wmOperator *op)
float cp= RNA_float_get(op->ptr, "accuracy");
ModifierData *md= ob->modifiers.first;
- while(md) {
- if(md->type == eModifierType_Mirror && (md->mode&eModifierMode_Realtime)) {
+ while (md) {
+ if (md->type == eModifierType_Mirror && (md->mode&eModifierMode_Realtime)) {
break;
}
md = md->next;
}
- if(md && md->type == eModifierType_Mirror) {
+ if (md && md->type == eModifierType_Mirror) {
BKE_report(op->reports, RPT_ERROR_INVALID_CONTEXT, "This operator does not support an active mirror modifier");
return OPERATOR_CANCELLED;
}
@@ -2438,17 +2481,17 @@ static int vertex_group_fix_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_fix(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Fix Vertex Group Deform";
- ot->idname= "OBJECT_OT_vertex_group_fix";
- ot->description= "Modify the position of selected vertices by changing only their respective "
+ ot->name = "Fix Vertex Group Deform";
+ ot->idname = "OBJECT_OT_vertex_group_fix";
+ ot->description = "Modify the position of selected vertices by changing only their respective "
"groups' weights (this tool may be slow for many vertices)";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_fix_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vertex_group_fix_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_float(ot->srna, "dist", 0.0f, -FLT_MAX, FLT_MAX, "Distance", "The distance to move to", -10.0f, 10.0f);
RNA_def_float(ot->srna, "strength", 1.f, -2.0f, FLT_MAX, "Strength",
"The distance moved can be changed by this multiplier", -2.0f, 2.0f);
@@ -2471,15 +2514,15 @@ static int vertex_group_lock_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_lock(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Change the Lock On Vertex Groups";
- ot->idname= "OBJECT_OT_vertex_group_lock";
+ ot->name = "Change the Lock On Vertex Groups";
+ ot->idname = "OBJECT_OT_vertex_group_lock";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_lock_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vertex_group_lock_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
WM_operator_properties_select_all(ot);
}
@@ -2501,15 +2544,15 @@ static int vertex_group_invert_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_invert(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Invert Vertex Group";
- ot->idname= "OBJECT_OT_vertex_group_invert";
+ ot->name = "Invert Vertex Group";
+ ot->idname = "OBJECT_OT_vertex_group_invert";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_invert_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vertex_group_invert_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "auto_assign", TRUE, "Add Weights",
"Add verts from groups that have zero weight before inverting");
@@ -2518,11 +2561,12 @@ void OBJECT_OT_vertex_group_invert(wmOperatorType *ot)
}
-static int vertex_group_blend_exec(bContext *C, wmOperator *UNUSED(op))
+static int vertex_group_blend_exec(bContext *C, wmOperator *op)
{
- Object *ob= ED_object_context(C);
+ Object *ob = ED_object_context(C);
+ float fac = RNA_float_get(op->ptr, "factor");
- vgroup_blend(ob);
+ vgroup_blend(ob, fac);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
@@ -2531,19 +2575,53 @@ static int vertex_group_blend_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
+/* check we have a vertex selection, either in weight paint or editmode */
+static int vertex_group_blend_poll(bContext *C)
+{
+ Object *ob = ED_object_context(C);
+ ID *data = (ob) ? ob->data: NULL;
+
+ if (!(ob && !ob->id.lib && data && !data->lib))
+ return FALSE;
+
+ if (vgroup_object_in_edit_mode(ob)) {
+ return TRUE;
+ }
+ else if ((ob->type == OB_MESH) && (ob->mode & OB_MODE_WEIGHT_PAINT)) {
+ if (ME_EDIT_PAINT_SEL_MODE(((Mesh *)data)) == SCE_SELECT_VERTEX) {
+ return TRUE;
+ }
+ else {
+ CTX_wm_operator_poll_msg_set(C, "Vertex select needs to be enabled in weight paint mode");
+ return FALSE;
+ }
+
+ }
+ else {
+ return FALSE;
+ }
+}
+
void OBJECT_OT_vertex_group_blend(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
- ot->name= "Blend Vertex Group";
- ot->idname= "OBJECT_OT_vertex_group_blend";
- ot->description= "";
+ ot->name = "Blend Vertex Group";
+ ot->idname = "OBJECT_OT_vertex_group_blend";
+ ot->description = "Blend selected vertex weights with unselected for the active group";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_blend_exec;
+ ot->poll = vertex_group_blend_poll;
+ ot->exec = vertex_group_blend_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ prop = RNA_def_property(ot->srna, "factor", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_ui_text(prop, "Factor", "");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_float_default(prop, 1.0f);
}
@@ -2555,7 +2633,7 @@ static int vertex_group_clean_exec(bContext *C, wmOperator *op)
int all_groups= RNA_boolean_get(op->ptr,"all_groups");
int keep_single= RNA_boolean_get(op->ptr,"keep_single");
- if(all_groups) vgroup_clean_all(ob, limit, keep_single);
+ if (all_groups) vgroup_clean_all(ob, limit, keep_single);
else vgroup_clean(ob, limit, keep_single);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -2568,16 +2646,16 @@ static int vertex_group_clean_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_clean(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clean Vertex Group";
- ot->idname= "OBJECT_OT_vertex_group_clean";
- ot->description= "Remove Vertex Group assignments which aren't required";
+ ot->name = "Clean Vertex Group";
+ ot->idname = "OBJECT_OT_vertex_group_clean";
+ ot->description = "Remove Vertex Group assignments which aren't required";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_clean_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vertex_group_clean_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, 1.0, "Limit", "Remove weights under this limit", 0.001f, 0.99f);
RNA_def_boolean(ot->srna, "all_groups", FALSE, "All Groups", "Clean all vertex groups");
@@ -2605,17 +2683,17 @@ static int vertex_group_mirror_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_mirror(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mirror Vertex Group";
- ot->idname= "OBJECT_OT_vertex_group_mirror";
- ot->description= "Mirror all vertex groups, flip weights and/or names, editing only selected vertices, "
+ ot->name = "Mirror Vertex Group";
+ ot->idname = "OBJECT_OT_vertex_group_mirror";
+ ot->description = "Mirror all vertex groups, flip weights and/or names, editing only selected vertices, "
"flipping when both sides are selected otherwise copy from unselected";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_mirror_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vertex_group_mirror_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "mirror_weights", TRUE, "Mirror Weights", "Mirror weights");
@@ -2631,9 +2709,9 @@ static int vertex_group_copy_to_linked_exec(bContext *C, wmOperator *UNUSED(op))
Base *base;
int retval= OPERATOR_CANCELLED;
- for(base=scene->base.first; base; base= base->next) {
- if(base->object->type==ob->type) {
- if(base->object!=ob && base->object->data==ob->data) {
+ for (base=scene->base.first; base; base= base->next) {
+ if (base->object->type==ob->type) {
+ if (base->object!=ob && base->object->data==ob->data) {
BLI_freelistN(&base->object->defbase);
BLI_duplicatelist(&base->object->defbase, &ob->defbase);
base->object->actdef= ob->actdef;
@@ -2653,16 +2731,16 @@ static int vertex_group_copy_to_linked_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_copy_to_linked(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Vertex Groups to Linked";
- ot->idname= "OBJECT_OT_vertex_group_copy_to_linked";
- ot->description= "Copy Vertex Groups to all users of the same Geometry data";
+ ot->name = "Copy Vertex Groups to Linked";
+ ot->idname = "OBJECT_OT_vertex_group_copy_to_linked";
+ ot->description = "Copy Vertex Groups to all users of the same Geometry data";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_copy_to_linked_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vertex_group_copy_to_linked_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/*Copy vertex groups from source to target*/ /*warning! overwrites list*/
@@ -2674,16 +2752,16 @@ static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects)
{
- if(obact != ob) {
- if(ED_vgroup_copy_array(ob, obact)) change++;
+ if (obact != ob) {
+ if (ED_vgroup_copy_array(ob, obact)) change++;
else fail++;
}
}
CTX_DATA_END;
- if((change == 0 && fail == 0) || fail) {
+ if ((change == 0 && fail == 0) || fail) {
BKE_reportf(op->reports, RPT_ERROR,
- "Copy to VGroups to Selected warning done %d, failed %d, object data must have matching indicies",
+ "Copy to VGroups to Selected warning done %d, failed %d, object data must have matching indices",
change, fail);
}
@@ -2694,16 +2772,16 @@ static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_copy_to_selected(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Vertex Group to Selected";
- ot->idname= "OBJECT_OT_vertex_group_copy_to_selected";
- ot->description= "Copy Vertex Groups to other selected objects with matching indices";
+ ot->name = "Copy Vertex Group to Selected";
+ ot->idname = "OBJECT_OT_vertex_group_copy_to_selected";
+ ot->description = "Copy Vertex Groups to other selected objects with matching indices";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_copy_to_selected_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vertex_group_copy_to_selected_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int vertex_group_copy_to_selected_single_exec(bContext *C, wmOperator *op)
@@ -2775,10 +2853,10 @@ static EnumPropertyItem *vgroup_itemf(bContext *C, PointerRNA *UNUSED(ptr), Prop
bDeformGroup *def;
int a, totitem= 0;
- if(!ob)
+ if (!ob)
return vgroup_items;
- for(a=0, def=ob->defbase.first; def; def=def->next, a++) {
+ for (a=0, def=ob->defbase.first; def; def=def->next, a++) {
tmp.value= a;
tmp.icon= ICON_GROUP_VERTEX;
tmp.identifier= def->name;
@@ -2797,26 +2875,26 @@ void OBJECT_OT_vertex_group_set_active(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Set Active Vertex Group";
- ot->idname= "OBJECT_OT_vertex_group_set_active";
- ot->description= "Set the active vertex group";
+ ot->name = "Set Active Vertex Group";
+ ot->idname = "OBJECT_OT_vertex_group_set_active";
+ ot->description = "Set the active vertex group";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= set_active_group_exec;
- ot->invoke= WM_menu_invoke;
+ ot->poll = vertex_group_poll;
+ ot->exec = set_active_group_exec;
+ ot->invoke = WM_menu_invoke;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
prop= RNA_def_enum(ot->srna, "group", vgroup_items, 0, "Group", "Vertex group to set as active");
RNA_def_enum_funcs(prop, vgroup_itemf);
- ot->prop= prop;
+ 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;
@@ -2825,7 +2903,7 @@ static char *vgroup_init_remap(Object *ob)
char *name;
name= name_array;
- for(def = ob->defbase.first; def; def=def->next) {
+ for (def = ob->defbase.first; def; def=def->next) {
BLI_strncpy(name, def->name, MAX_VGROUP_NAME);
name += MAX_VGROUP_NAME;
}
@@ -2847,28 +2925,28 @@ static int vgroup_do_remap(Object *ob, char *name_array, wmOperator *op)
int i;
name= name_array;
- for(def= ob->defbase.first, i=0; def; def=def->next, i++){
+ for (def= ob->defbase.first, i=0; def; def=def->next, i++) {
sort_map[i]= BLI_findstringindex(&ob->defbase, name, offsetof(bDeformGroup, name));
name += MAX_VGROUP_NAME;
BLI_assert(sort_map[i] != -1);
}
- if(ob->mode == OB_MODE_EDIT) {
- if(ob->type==OB_MESH) {
- BMEditMesh *em = ((Mesh*)ob->data)->edit_btmesh;
+ if (ob->mode == OB_MODE_EDIT) {
+ if (ob->type==OB_MESH) {
+ BMEditMesh *em = BMEdit_FromObject(ob);
BMIter iter;
BMVert *eve;
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
dvert= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
- if(dvert && dvert->totweight){
+ if (dvert && dvert->totweight) {
defvert_remap(dvert, sort_map, defbase_tot);
}
}
}
else {
- BKE_report(op->reports, RPT_ERROR, "Editmode lattice isnt supported yet");
+ BKE_report(op->reports, RPT_ERROR, "Editmode lattice isn't supported yet");
MEM_freeN(sort_map_update);
return OPERATOR_CANCELLED;
}
@@ -2878,16 +2956,16 @@ static int vgroup_do_remap(Object *ob, char *name_array, wmOperator *op)
ED_vgroup_give_array(ob->data, &dvert, &dvert_tot);
- /*create as necassary*/
- while(dvert && dvert_tot--) {
- if(dvert->totweight)
+ /*create as necessary*/
+ while (dvert && dvert_tot--) {
+ if (dvert->totweight)
defvert_remap(dvert, sort_map, defbase_tot);
dvert++;
}
}
/* update users */
- for(i=0; i<defbase_tot; i++)
+ for (i=0; i<defbase_tot; i++)
sort_map[i]++;
sort_map_update[0]= 0;
@@ -2936,16 +3014,16 @@ static int vertex_group_sort_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_sort(wmOperatorType *ot)
{
- ot->name= "Sort Vertex Groups";
- ot->idname= "OBJECT_OT_vertex_group_sort";
- ot->description= "Sorts vertex groups alphabetically";
+ ot->name = "Sort Vertex Groups";
+ ot->idname = "OBJECT_OT_vertex_group_sort";
+ ot->description = "Sorts vertex groups alphabetically";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vertex_group_sort_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vertex_group_sort_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int vgroup_move_exec(bContext *C, wmOperator *op)
@@ -2967,7 +3045,8 @@ static int vgroup_move_exec(bContext *C, wmOperator *op)
BLI_remlink(&ob->defbase, def);
BLI_insertlinkbefore(&ob->defbase, prev, def);
- } else { /*down*/
+ }
+ else { /*down*/
void *next = def->next;
BLI_remlink(&ob->defbase, def);
@@ -2995,15 +3074,15 @@ void OBJECT_OT_vertex_group_move(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Move Vertex Group";
- ot->idname= "OBJECT_OT_vertex_group_move";
+ ot->name = "Move Vertex Group";
+ ot->idname = "OBJECT_OT_vertex_group_move";
/* api callbacks */
- ot->poll= vertex_group_poll;
- ot->exec= vgroup_move_exec;
+ ot->poll = vertex_group_poll;
+ ot->exec = vgroup_move_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "direction", vgroup_slot_move, 0, "Direction", "Direction to move, UP or DOWN");
}
diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c
index cdcaae91070..417cddb74fe 100644
--- a/source/blender/editors/physics/dynamicpaint_ops.c
+++ b/source/blender/editors/physics/dynamicpaint_ops.c
@@ -48,7 +48,6 @@
#include "RNA_define.h"
#include "RNA_enum_types.h"
-/* Platform independend time */
#include "PIL_time.h"
#include "WM_types.h"
@@ -74,7 +73,7 @@ static int surface_slot_add_exec(bContext *C, wmOperator *UNUSED(op))
/* set preview for this surface only and set active */
canvas->active_sur = 0;
- for(surface=surface->prev; surface; surface=surface->prev) {
+ for (surface=surface->prev; surface; surface=surface->prev) {
surface->flags &= ~MOD_DPAINT_PREVIEW;
canvas->active_sur++;
}
@@ -86,16 +85,16 @@ static int surface_slot_add_exec(bContext *C, wmOperator *UNUSED(op))
void DPAINT_OT_surface_slot_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Surface Slot";
- ot->idname= "DPAINT_OT_surface_slot_add";
- ot->description="Add a new Dynamic Paint surface slot";
+ ot->name = "Add Surface Slot";
+ ot->idname = "DPAINT_OT_surface_slot_add";
+ ot->description = "Add a new Dynamic Paint surface slot";
/* api callbacks */
- ot->exec= surface_slot_add_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = surface_slot_add_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int surface_slot_remove_exec(bContext *C, wmOperator *UNUSED(op))
@@ -114,8 +113,8 @@ static int surface_slot_remove_exec(bContext *C, wmOperator *UNUSED(op))
surface = canvas->surfaces.first;
/* find active surface and remove it */
- for(; surface; surface=surface->next) {
- if(id == canvas->active_sur) {
+ for (; surface; surface=surface->next) {
+ if (id == canvas->active_sur) {
canvas->active_sur -= 1;
dynamicPaint_freeSurface(surface);
break;
@@ -134,16 +133,16 @@ static int surface_slot_remove_exec(bContext *C, wmOperator *UNUSED(op))
void DPAINT_OT_surface_slot_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Surface Slot";
- ot->idname= "DPAINT_OT_surface_slot_remove";
- ot->description="Remove the selected surface slot";
+ ot->name = "Remove Surface Slot";
+ ot->idname = "DPAINT_OT_surface_slot_remove";
+ ot->description = "Remove the selected surface slot";
/* api callbacks */
- ot->exec= surface_slot_remove_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = surface_slot_remove_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int type_toggle_exec(bContext *C, wmOperator *op)
@@ -169,7 +168,7 @@ static int type_toggle_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- /* update dependancy */
+ /* update dependency */
DAG_id_tag_update(&cObject->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, cObject);
DAG_scene_sort(CTX_data_main(C), scene);
@@ -182,20 +181,20 @@ void DPAINT_OT_type_toggle(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Toggle Type Active";
- ot->idname= "DPAINT_OT_type_toggle";
+ ot->name = "Toggle Type Active";
+ ot->idname = "DPAINT_OT_type_toggle";
ot->description = "Toggle whether given type is active or not";
/* api callbacks */
- ot->exec= type_toggle_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = type_toggle_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
prop= RNA_def_enum(ot->srna, "type", prop_dynamicpaint_type_items, MOD_DYNAMICPAINT_TYPE_CANVAS, "Type", "");
- ot->prop= prop;
+ ot->prop = prop;
}
static int output_toggle_exec(bContext *C, wmOperator *op)
@@ -250,28 +249,28 @@ void DPAINT_OT_output_toggle(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Toggle Output Layer";
- ot->idname= "DPAINT_OT_output_toggle";
+ ot->name = "Toggle Output Layer";
+ ot->idname = "DPAINT_OT_output_toggle";
ot->description = "Add or remove Dynamic Paint output data layer";
/* api callbacks */
- ot->exec= output_toggle_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = output_toggle_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "output", prop_output_toggle_types, 0, "Output Toggle", "");
+ ot->prop = RNA_def_enum(ot->srna, "output", prop_output_toggle_types, 0, "Output Toggle", "");
}
/***************************** 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;
@@ -309,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];
@@ -352,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.");
@@ -381,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];
@@ -397,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);
}
@@ -409,7 +408,7 @@ static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
static int dynamicpaint_bake_exec(bContext *C, wmOperator *op)
{
/* Bake dynamic paint */
- if(!dynamicPaint_initBake(C, op)) {
+ if (!dynamicPaint_initBake(C, op)) {
return OPERATOR_CANCELLED;}
return OPERATOR_FINISHED;
@@ -418,11 +417,11 @@ static int dynamicpaint_bake_exec(bContext *C, wmOperator *op)
void DPAINT_OT_bake(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Dynamic Paint Bake";
- ot->description= "Bake dynamic paint image sequence surface";
- ot->idname= "DPAINT_OT_bake";
+ ot->name = "Dynamic Paint Bake";
+ ot->description = "Bake dynamic paint image sequence surface";
+ ot->idname = "DPAINT_OT_bake";
/* api callbacks */
- ot->exec= dynamicpaint_bake_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = dynamicpaint_bake_exec;
+ ot->poll = ED_operator_object_active_editable;
}
diff --git a/source/blender/editors/physics/particle_boids.c b/source/blender/editors/physics/particle_boids.c
index 54bd19164e0..7a7c16b23ff 100644
--- a/source/blender/editors/physics/particle_boids.c
+++ b/source/blender/editors/physics/particle_boids.c
@@ -65,7 +65,7 @@ static int rule_add_exec(bContext *C, wmOperator *op)
BoidRule *rule;
BoidState *state;
- if(!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
+ if (!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
return OPERATOR_CANCELLED;
part = psys->part;
@@ -73,7 +73,7 @@ static int rule_add_exec(bContext *C, wmOperator *op)
state = boid_get_current_state(part->boids);
- for(rule=state->rules.first; rule; rule=rule->next)
+ for (rule=state->rules.first; rule; rule=rule->next)
rule->flag &= ~BOIDRULE_CURRENT;
rule = boid_new_rule(type);
@@ -90,18 +90,18 @@ static int rule_add_exec(bContext *C, wmOperator *op)
void BOID_OT_rule_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Boid Rule";
+ ot->name = "Add Boid Rule";
ot->description = "Add a boid rule to the current boid state";
- ot->idname= "BOID_OT_rule_add";
+ ot->idname = "BOID_OT_rule_add";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= rule_add_exec;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = rule_add_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
- ot->prop= RNA_def_enum(ot->srna, "type", boidrule_type_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", boidrule_type_items, 0, "Type", "");
}
static int rule_del_exec(bContext *C, wmOperator *UNUSED(op))
{
@@ -113,14 +113,14 @@ static int rule_del_exec(bContext *C, wmOperator *UNUSED(op))
BoidRule *rule;
BoidState *state;
- if(!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
+ if (!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
return OPERATOR_CANCELLED;
state = boid_get_current_state(psys->part->boids);
- for(rule=state->rules.first; rule; rule=rule->next) {
- if(rule->flag & BOIDRULE_CURRENT) {
+ for (rule=state->rules.first; rule; rule=rule->next) {
+ if (rule->flag & BOIDRULE_CURRENT) {
BLI_remlink(&state->rules, rule);
MEM_freeN(rule);
break;
@@ -129,7 +129,7 @@ static int rule_del_exec(bContext *C, wmOperator *UNUSED(op))
}
rule = state->rules.first;
- if(rule)
+ if (rule)
rule->flag |= BOIDRULE_CURRENT;
DAG_scene_sort(bmain, scene);
@@ -143,14 +143,14 @@ static int rule_del_exec(bContext *C, wmOperator *UNUSED(op))
void BOID_OT_rule_del(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Boid Rule";
- ot->idname= "BOID_OT_rule_del";
+ ot->name = "Remove Boid Rule";
+ ot->idname = "BOID_OT_rule_del";
/* api callbacks */
- ot->exec= rule_del_exec;
+ ot->exec = rule_del_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ move up/down boid rule operators *********************/
@@ -162,12 +162,12 @@ static int rule_move_up_exec(bContext *C, wmOperator *UNUSED(op))
BoidRule *rule;
BoidState *state;
- if(!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
+ if (!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
return OPERATOR_CANCELLED;
state = boid_get_current_state(psys->part->boids);
- for(rule = state->rules.first; rule; rule=rule->next) {
- if(rule->flag & BOIDRULE_CURRENT && rule->prev) {
+ for (rule = state->rules.first; rule; rule=rule->next) {
+ if (rule->flag & BOIDRULE_CURRENT && rule->prev) {
BLI_remlink(&state->rules, rule);
BLI_insertlink(&state->rules, rule->prev->prev, rule);
@@ -182,14 +182,14 @@ static int rule_move_up_exec(bContext *C, wmOperator *UNUSED(op))
void BOID_OT_rule_move_up(wmOperatorType *ot)
{
- ot->name= "Move Up Boid Rule";
- ot->description= "Move boid rule up in the list";
- ot->idname= "BOID_OT_rule_move_up";
+ ot->name = "Move Up Boid Rule";
+ ot->description = "Move boid rule up in the list";
+ ot->idname = "BOID_OT_rule_move_up";
- ot->exec= rule_move_up_exec;
+ ot->exec = rule_move_up_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int rule_move_down_exec(bContext *C, wmOperator *UNUSED(op))
@@ -200,12 +200,12 @@ static int rule_move_down_exec(bContext *C, wmOperator *UNUSED(op))
BoidRule *rule;
BoidState *state;
- if(!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
+ if (!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
return OPERATOR_CANCELLED;
state = boid_get_current_state(psys->part->boids);
- for(rule = state->rules.first; rule; rule=rule->next) {
- if(rule->flag & BOIDRULE_CURRENT && rule->next) {
+ for (rule = state->rules.first; rule; rule=rule->next) {
+ if (rule->flag & BOIDRULE_CURRENT && rule->next) {
BLI_remlink(&state->rules, rule);
BLI_insertlink(&state->rules, rule->next, rule);
@@ -220,14 +220,14 @@ static int rule_move_down_exec(bContext *C, wmOperator *UNUSED(op))
void BOID_OT_rule_move_down(wmOperatorType *ot)
{
- ot->name= "Move Down Boid Rule";
- ot->description= "Move boid rule down in the list";
- ot->idname= "BOID_OT_rule_move_down";
+ ot->name = "Move Down Boid Rule";
+ ot->description = "Move boid rule down in the list";
+ ot->idname = "BOID_OT_rule_move_down";
- ot->exec= rule_move_down_exec;
+ ot->exec = rule_move_down_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -240,12 +240,12 @@ static int state_add_exec(bContext *C, wmOperator *UNUSED(op))
ParticleSettings *part;
BoidState *state;
- if(!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
+ if (!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
return OPERATOR_CANCELLED;
part = psys->part;
- for(state=part->boids->states.first; state; state=state->next)
+ for (state=part->boids->states.first; state; state=state->next)
state->flag &= ~BOIDSTATE_CURRENT;
state = boid_new_state(part->boids);
@@ -261,15 +261,15 @@ static int state_add_exec(bContext *C, wmOperator *UNUSED(op))
void BOID_OT_state_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Boid State";
+ ot->name = "Add Boid State";
ot->description = "Add a boid state to the particle system";
- ot->idname= "BOID_OT_state_add";
+ ot->idname = "BOID_OT_state_add";
/* api callbacks */
- ot->exec= state_add_exec;
+ ot->exec = state_add_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int state_del_exec(bContext *C, wmOperator *UNUSED(op))
{
@@ -281,13 +281,13 @@ static int state_del_exec(bContext *C, wmOperator *UNUSED(op))
ParticleSettings *part;
BoidState *state;
- if(!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
+ if (!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
return OPERATOR_CANCELLED;
part = psys->part;
- for(state=part->boids->states.first; state; state=state->next) {
- if(state->flag & BOIDSTATE_CURRENT) {
+ for (state=part->boids->states.first; state; state=state->next) {
+ if (state->flag & BOIDSTATE_CURRENT) {
BLI_remlink(&part->boids->states, state);
MEM_freeN(state);
break;
@@ -296,7 +296,7 @@ static int state_del_exec(bContext *C, wmOperator *UNUSED(op))
}
/* there must be at least one state */
- if(!part->boids->states.first) {
+ if (!part->boids->states.first) {
state = boid_new_state(part->boids);
BLI_addtail(&part->boids->states, state);
}
@@ -316,14 +316,14 @@ static int state_del_exec(bContext *C, wmOperator *UNUSED(op))
void BOID_OT_state_del(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Boid State";
- ot->idname= "BOID_OT_state_del";
+ ot->name = "Remove Boid State";
+ ot->idname = "BOID_OT_state_del";
/* api callbacks */
- ot->exec= state_del_exec;
+ ot->exec = state_del_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ move up/down boid state operators *********************/
@@ -335,13 +335,13 @@ static int state_move_up_exec(bContext *C, wmOperator *UNUSED(op))
BoidSettings *boids;
BoidState *state;
- if(!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
+ if (!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
return OPERATOR_CANCELLED;
boids = psys->part->boids;
- for(state = boids->states.first; state; state=state->next) {
- if(state->flag & BOIDSTATE_CURRENT && state->prev) {
+ for (state = boids->states.first; state; state=state->next) {
+ if (state->flag & BOIDSTATE_CURRENT && state->prev) {
BLI_remlink(&boids->states, state);
BLI_insertlink(&boids->states, state->prev->prev, state);
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
@@ -354,14 +354,14 @@ static int state_move_up_exec(bContext *C, wmOperator *UNUSED(op))
void BOID_OT_state_move_up(wmOperatorType *ot)
{
- ot->name= "Move Up Boid State";
- ot->description= "Move boid state up in the list";
- ot->idname= "BOID_OT_state_move_up";
+ ot->name = "Move Up Boid State";
+ ot->description = "Move boid state up in the list";
+ ot->idname = "BOID_OT_state_move_up";
- ot->exec= state_move_up_exec;
+ ot->exec = state_move_up_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int state_move_down_exec(bContext *C, wmOperator *UNUSED(op))
@@ -371,13 +371,13 @@ static int state_move_down_exec(bContext *C, wmOperator *UNUSED(op))
BoidSettings *boids;
BoidState *state;
- if(!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
+ if (!psys || !psys->part || psys->part->phystype != PART_PHYS_BOIDS)
return OPERATOR_CANCELLED;
boids = psys->part->boids;
- for(state = boids->states.first; state; state=state->next) {
- if(state->flag & BOIDSTATE_CURRENT && state->next) {
+ for (state = boids->states.first; state; state=state->next) {
+ if (state->flag & BOIDSTATE_CURRENT && state->next) {
BLI_remlink(&boids->states, state);
BLI_insertlink(&boids->states, state->next, state);
DAG_id_tag_update(&psys->part->id, OB_RECALC_DATA|PSYS_RECALC_RESET);
@@ -390,13 +390,13 @@ static int state_move_down_exec(bContext *C, wmOperator *UNUSED(op))
void BOID_OT_state_move_down(wmOperatorType *ot)
{
- ot->name= "Move Down Boid State";
- ot->description= "Move boid state down in the list";
- ot->idname= "BOID_OT_state_move_down";
+ ot->name = "Move Down Boid State";
+ ot->description = "Move boid state down in the list";
+ ot->idname = "BOID_OT_state_move_down";
- ot->exec= state_move_down_exec;
+ ot->exec = state_move_down_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 5648bc69099..53e0e2b4056 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -89,16 +89,16 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys);
#define KEY_K PTCacheEditKey *key; int k
#define POINT_P PTCacheEditPoint *point; int p
-#define LOOP_POINTS for(p=0, point=edit->points; p<edit->totpoint; p++, point++)
-#define LOOP_VISIBLE_POINTS for(p=0, point=edit->points; p<edit->totpoint; p++, point++) if(!(point->flag & PEP_HIDE))
-#define LOOP_SELECTED_POINTS for(p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point_is_selected(point))
-#define LOOP_UNSELECTED_POINTS for(p=0, point=edit->points; p<edit->totpoint; p++, point++) if(!point_is_selected(point))
-#define LOOP_EDITED_POINTS for(p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point->flag & PEP_EDIT_RECALC)
-#define LOOP_TAGGED_POINTS for(p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point->flag & PEP_TAG)
-#define LOOP_KEYS for(k=0, key=point->keys; k<point->totkey; k++, key++)
-#define LOOP_VISIBLE_KEYS for(k=0, key=point->keys; k<point->totkey; k++, key++) if(!(key->flag & PEK_HIDE))
-#define LOOP_SELECTED_KEYS for(k=0, key=point->keys; k<point->totkey; k++, key++) if((key->flag & PEK_SELECT) && !(key->flag & PEK_HIDE))
-#define LOOP_TAGGED_KEYS for(k=0, key=point->keys; k<point->totkey; k++, key++) if(key->flag & PEK_TAG)
+#define LOOP_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++)
+#define LOOP_VISIBLE_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (!(point->flag & PEP_HIDE))
+#define LOOP_SELECTED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (point_is_selected(point))
+#define LOOP_UNSELECTED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (!point_is_selected(point))
+#define LOOP_EDITED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (point->flag & PEP_EDIT_RECALC)
+#define LOOP_TAGGED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (point->flag & PEP_TAG)
+#define LOOP_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++)
+#define LOOP_VISIBLE_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if (!(key->flag & PEK_HIDE))
+#define LOOP_SELECTED_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if ((key->flag & PEK_SELECT) && !(key->flag & PEK_HIDE))
+#define LOOP_TAGGED_KEYS for (k=0, key=point->keys; k<point->totkey; k++, key++) if (key->flag & PEK_TAG)
#define KEY_WCO (key->flag & PEK_USE_WCO ? key->world_co : key->co)
@@ -109,7 +109,7 @@ int PE_poll(bContext *C)
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- if(!scene || !ob || !(ob->mode & OB_MODE_PARTICLE_EDIT))
+ if (!scene || !ob || !(ob->mode & OB_MODE_PARTICLE_EDIT))
return 0;
return (PE_get_current(scene, ob) != NULL);
@@ -121,7 +121,7 @@ int PE_hair_poll(bContext *C)
Object *ob= CTX_data_active_object(C);
PTCacheEdit *edit;
- if(!scene || !ob || !(ob->mode & OB_MODE_PARTICLE_EDIT))
+ if (!scene || !ob || !(ob->mode & OB_MODE_PARTICLE_EDIT))
return 0;
edit= PE_get_current(scene, ob);
@@ -139,28 +139,28 @@ void PE_free_ptcache_edit(PTCacheEdit *edit)
{
POINT_P;
- if(edit==0) return;
+ if (edit==0) return;
PTCacheUndo_clear(edit);
- if(edit->points) {
+ if (edit->points) {
LOOP_POINTS {
- if(point->keys)
+ if (point->keys)
MEM_freeN(point->keys);
}
MEM_freeN(edit->points);
}
- if(edit->mirror_cache)
+ if (edit->mirror_cache)
MEM_freeN(edit->mirror_cache);
- if(edit->emitter_cosnos) {
+ if (edit->emitter_cosnos) {
MEM_freeN(edit->emitter_cosnos);
edit->emitter_cosnos= 0;
}
- if(edit->emitter_field) {
+ if (edit->emitter_field) {
BLI_kdtree_free(edit->emitter_field);
edit->emitter_field= 0;
}
@@ -176,9 +176,9 @@ void PE_free_ptcache_edit(PTCacheEdit *edit)
int PE_start_edit(PTCacheEdit *edit)
{
- if(edit) {
+ if (edit) {
edit->edited = 1;
- if(edit->psys)
+ if (edit->psys)
edit->psys->flag |= PSYS_EDITED;
return 1;
}
@@ -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! */
@@ -202,7 +202,7 @@ static PTCacheEdit *pe_get_current(Scene *scene, Object *ob, int create)
ListBase pidlist;
PTCacheID *pid;
- if(pset==NULL || ob==NULL)
+ if (pset==NULL || ob==NULL)
return NULL;
pset->scene = scene;
@@ -211,7 +211,7 @@ static PTCacheEdit *pe_get_current(Scene *scene, Object *ob, int create)
BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
/* in the case of only one editable thing, set pset->edittype accordingly */
- if(pidlist.first && pidlist.first == pidlist.last) {
+ if (pidlist.first && pidlist.first == pidlist.last) {
pid = pidlist.first;
switch(pid->type) {
case PTCACHE_TYPE_PARTICLES:
@@ -226,25 +226,25 @@ static PTCacheEdit *pe_get_current(Scene *scene, Object *ob, int create)
}
}
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pset->edittype == PE_TYPE_PARTICLES && pid->type == PTCACHE_TYPE_PARTICLES) {
+ for (pid=pidlist.first; pid; pid=pid->next) {
+ if (pset->edittype == PE_TYPE_PARTICLES && pid->type == PTCACHE_TYPE_PARTICLES) {
ParticleSystem *psys = pid->calldata;
- if(psys->flag & PSYS_CURRENT) {
- if(psys->part && psys->part->type == PART_HAIR) {
- if(psys->flag & PSYS_HAIR_DYNAMICS && psys->pointcache->flag & PTCACHE_BAKED) {
- if(create && !psys->pointcache->edit)
+ if (psys->flag & PSYS_CURRENT) {
+ if (psys->part && psys->part->type == PART_HAIR) {
+ if (psys->flag & PSYS_HAIR_DYNAMICS && psys->pointcache->flag & PTCACHE_BAKED) {
+ if (create && !psys->pointcache->edit)
PE_create_particle_edit(scene, ob, pid->cache, NULL);
edit = pid->cache->edit;
}
else {
- if(create && !psys->edit && psys->flag & PSYS_HAIR_DONE)
+ if (create && !psys->edit && psys->flag & PSYS_HAIR_DONE)
PE_create_particle_edit(scene, ob, NULL, psys);
edit = psys->edit;
}
}
else {
- if(create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit)
+ if (create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit)
PE_create_particle_edit(scene, ob, pid->cache, psys);
edit = pid->cache->edit;
}
@@ -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);
@@ -274,7 +272,7 @@ static PTCacheEdit *pe_get_current(Scene *scene, Object *ob, int create)
}
}
- if(edit)
+ if (edit)
edit->pid = *pid;
BLI_freelistN(&pidlist);
@@ -294,7 +292,7 @@ PTCacheEdit *PE_create_current(Scene *scene, Object *ob)
void PE_current_changed(Scene *scene, Object *ob)
{
- if(ob->mode == OB_MODE_PARTICLE_EDIT)
+ if (ob->mode == OB_MODE_PARTICLE_EDIT)
PE_create_current(scene, ob);
}
@@ -304,10 +302,10 @@ void PE_hide_keys_time(Scene *scene, PTCacheEdit *edit, float cfra)
POINT_P; KEY_K;
- if(pset->flag & PE_FADE_TIME && pset->selectmode==SCE_SELECT_POINT) {
+ if (pset->flag & PE_FADE_TIME && pset->selectmode==SCE_SELECT_POINT) {
LOOP_POINTS {
LOOP_KEYS {
- if(fabs(cfra-*key->time) < pset->fade_frames)
+ if (fabs(cfra-*key->time) < pset->fade_frames)
key->flag &= ~PEK_HIDE;
else {
key->flag |= PEK_HIDE;
@@ -327,7 +325,7 @@ void PE_hide_keys_time(Scene *scene, PTCacheEdit *edit, float cfra)
static int pe_x_mirror(Object *ob)
{
- if(ob->type == OB_MESH)
+ if (ob->type == OB_MESH)
return (((Mesh*)ob->data)->editflag & ME_EDIT_MIRROR_X);
return 0;
@@ -382,8 +380,8 @@ static void PE_set_view3d_data(bContext *C, PEData *data)
/* note, the object argument means the modelview matrix does not account for the objects matrix, use viewmat rather than (obmat * viewmat) */
view3d_get_transformation(data->vc.ar, data->vc.rv3d, NULL, &data->mats);
- if((data->vc.v3d->drawtype>OB_WIRE) && (data->vc.v3d->flag & V3D_ZBUF_SELECT)) {
- if(data->vc.v3d->flag & V3D_INVALID_BACKBUF) {
+ if ((data->vc.v3d->drawtype>OB_WIRE) && (data->vc.v3d->flag & V3D_ZBUF_SELECT)) {
+ if (data->vc.v3d->flag & V3D_INVALID_BACKBUF) {
/* needed or else the draw matrix can be incorrect */
view3d_operator_needs_opengl(C);
@@ -406,12 +404,12 @@ static int key_test_depth(PEData *data, const float co[3])
short wco[3], x,y;
/* nothing to do */
- if((v3d->drawtype<=OB_WIRE) || (v3d->flag & V3D_ZBUF_SELECT)==0)
+ if ((v3d->drawtype<=OB_WIRE) || (v3d->flag & V3D_ZBUF_SELECT)==0)
return 1;
project_short(data->vc.ar, co, wco);
- if(wco[0] == IS_CLIPPED)
+ if (wco[0] == IS_CLIPPED)
return 0;
gluProject(co[0],co[1],co[2], data->mats.modelview, data->mats.projection,
@@ -436,7 +434,7 @@ static int key_test_depth(PEData *data, const float co[3])
}
#endif
- if((float)uz - 0.00001f > depth)
+ if ((float)uz - 0.00001f > depth)
return 0;
else
return 1;
@@ -449,18 +447,18 @@ static int key_inside_circle(PEData *data, float rad, const float co[3], float *
project_int(data->vc.ar, co, sco);
- if(sco[0] == IS_CLIPPED)
+ if (sco[0] == IS_CLIPPED)
return 0;
dx= data->mval[0] - sco[0];
dy= data->mval[1] - sco[1];
dist= sqrt(dx*dx + dy*dy);
- if(dist > rad)
+ if (dist > rad)
return 0;
- if(key_test_depth(data, co)) {
- if(distance)
+ if (key_test_depth(data, co)) {
+ if (distance)
*distance=dist;
return 1;
@@ -475,10 +473,10 @@ static int key_inside_rect(PEData *data, const float co[3])
project_int(data->vc.ar, co,sco);
- if(sco[0] == IS_CLIPPED)
+ if (sco[0] == IS_CLIPPED)
return 0;
- if(sco[0] > data->rect->xmin && sco[0] < data->rect->xmax &&
+ if (sco[0] > data->rect->xmin && sco[0] < data->rect->xmax &&
sco[1] > data->rect->ymin && sco[1] < data->rect->ymax)
return key_test_depth(data, co);
@@ -487,7 +485,7 @@ static int key_inside_rect(PEData *data, const float co[3])
static int key_inside_test(PEData *data, const float co[3])
{
- if(data->mval)
+ if (data->mval)
return key_inside_circle(data, data->rad, co, NULL);
else
return key_inside_rect(data, co);
@@ -497,7 +495,7 @@ static int point_is_selected(PTCacheEditPoint *point)
{
KEY_K;
- if(point->flag & PEP_HIDE)
+ if (point->flag & PEP_HIDE)
return 0;
LOOP_SELECTED_KEYS {
@@ -522,43 +520,43 @@ static void for_mouse_hit_keys(PEData *data, ForKeyFunc func, int nearest)
float dist= data->rad;
/* in path select mode we have no keys */
- if(pset->selectmode==SCE_SELECT_PATH)
+ if (pset->selectmode==SCE_SELECT_PATH)
return;
nearest_point= -1;
nearest_key= -1;
LOOP_VISIBLE_POINTS {
- if(pset->selectmode == SCE_SELECT_END) {
+ if (pset->selectmode == SCE_SELECT_END) {
/* only do end keys */
key= point->keys + point->totkey-1;
- if(nearest) {
- if(key_inside_circle(data, dist, KEY_WCO, &dist)) {
+ if (nearest) {
+ if (key_inside_circle(data, dist, KEY_WCO, &dist)) {
nearest_point= p;
nearest_key= point->totkey-1;
}
}
- else if(key_inside_test(data, KEY_WCO))
+ else if (key_inside_test(data, KEY_WCO))
func(data, p, point->totkey-1);
}
else {
/* do all keys */
LOOP_VISIBLE_KEYS {
- if(nearest) {
- if(key_inside_circle(data, dist, KEY_WCO, &dist)) {
+ if (nearest) {
+ if (key_inside_circle(data, dist, KEY_WCO, &dist)) {
nearest_point= p;
nearest_key= k;
}
}
- else if(key_inside_test(data, KEY_WCO))
+ else if (key_inside_test(data, KEY_WCO))
func(data, p, k);
}
}
}
/* do nearest only */
- if(nearest && nearest_point > -1)
+ if (nearest && nearest_point > -1)
func(data, nearest_point, nearest_key);
}
@@ -569,23 +567,23 @@ static void foreach_mouse_hit_point(PEData *data, ForPointFunc func, int selecte
POINT_P; KEY_K;
/* all is selected in path mode */
- if(pset->selectmode==SCE_SELECT_PATH)
+ if (pset->selectmode==SCE_SELECT_PATH)
selected=0;
LOOP_VISIBLE_POINTS {
- if(pset->selectmode==SCE_SELECT_END) {
+ if (pset->selectmode==SCE_SELECT_END) {
/* only do end keys */
key= point->keys + point->totkey - 1;
- if(selected==0 || key->flag & PEK_SELECT)
- if(key_inside_circle(data, data->rad, KEY_WCO, &data->dist))
+ if (selected==0 || key->flag & PEK_SELECT)
+ if (key_inside_circle(data, data->rad, KEY_WCO, &data->dist))
func(data, p);
}
else {
/* do all keys */
LOOP_VISIBLE_KEYS {
- if(selected==0 || key->flag & PEK_SELECT) {
- if(key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) {
+ if (selected==0 || key->flag & PEK_SELECT) {
+ if (key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) {
func(data, p);
break;
}
@@ -604,21 +602,21 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected
POINT_P; KEY_K;
float mat[4][4]= MAT4_UNITY, imat[4][4]= MAT4_UNITY;
- if(edit->psys)
+ if (edit->psys)
psmd= psys_get_modifier(data->ob, edit->psys);
/* all is selected in path mode */
- if(pset->selectmode==SCE_SELECT_PATH)
+ if (pset->selectmode==SCE_SELECT_PATH)
selected= 0;
LOOP_VISIBLE_POINTS {
- if(pset->selectmode==SCE_SELECT_END) {
+ if (pset->selectmode==SCE_SELECT_END) {
/* only do end keys */
key= point->keys + point->totkey-1;
- if(selected==0 || key->flag & PEK_SELECT) {
- if(key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) {
- if(edit->psys && !(edit->psys->flag & PSYS_GLOBAL_HAIR)) {
+ if (selected==0 || key->flag & PEK_SELECT) {
+ if (key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) {
+ if (edit->psys && !(edit->psys->flag & PSYS_GLOBAL_HAIR)) {
psys_mat_hair_to_global(data->ob, psmd->dm, psys->part->from, psys->particles + p, mat);
invert_m4_m4(imat,mat);
}
@@ -630,9 +628,9 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected
else {
/* do all keys */
LOOP_VISIBLE_KEYS {
- if(selected==0 || key->flag & PEK_SELECT) {
- if(key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) {
- if(edit->psys && !(edit->psys->flag & PSYS_GLOBAL_HAIR)) {
+ if (selected==0 || key->flag & PEK_SELECT) {
+ if (key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) {
+ if (edit->psys && !(edit->psys->flag & PSYS_GLOBAL_HAIR)) {
psys_mat_hair_to_global(data->ob, psmd->dm, psys->part->from, psys->particles + p, mat);
invert_m4_m4(imat,mat);
}
@@ -684,14 +682,14 @@ static int count_selected_keys(Scene *scene, PTCacheEdit *edit)
int sel= 0;
LOOP_VISIBLE_POINTS {
- if(pset->selectmode==SCE_SELECT_POINT) {
+ if (pset->selectmode==SCE_SELECT_POINT) {
LOOP_SELECTED_KEYS {
sel++;
}
}
- else if(pset->selectmode==SCE_SELECT_END) {
+ else if (pset->selectmode==SCE_SELECT_END) {
key = point->keys + point->totkey - 1;
- if(key->flag & PEK_SELECT)
+ if (key->flag & PEK_SELECT)
sel++;
}
}
@@ -718,7 +716,7 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys)
psmd= psys_get_modifier(ob, psys);
totpart= psys->totpart;
- if(!psmd->dm)
+ if (!psmd->dm)
return;
tree= BLI_kdtree_new(totpart);
@@ -735,7 +733,7 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys)
BLI_kdtree_balance(tree);
/* lookup particles and set in mirror cache */
- if(!edit->mirror_cache)
+ if (!edit->mirror_cache)
edit->mirror_cache= MEM_callocN(sizeof(int)*totpart, "PE mirror cache");
LOOP_PARTICLES {
@@ -748,7 +746,7 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys)
index= BLI_kdtree_find_nearest(tree, co, NULL, &nearest);
/* this needs a custom threshold still, duplicated for editmode mirror */
- if(index != -1 && index != p && (nearest.dist <= 0.0002f))
+ if (index != -1 && index != p && (nearest.dist <= 0.0002f))
edit->mirror_cache[p]= index;
else
edit->mirror_cache[p]= -1;
@@ -756,9 +754,9 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys)
/* make sure mirrors are in two directions */
LOOP_PARTICLES {
- if(edit->mirror_cache[p]) {
+ if (edit->mirror_cache[p]) {
index= edit->mirror_cache[p];
- if(edit->mirror_cache[index] != p)
+ if (edit->mirror_cache[index] != p)
edit->mirror_cache[p]= -1;
}
}
@@ -779,15 +777,15 @@ static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys
i= pa - psys->particles;
/* find mirrored particle if needed */
- if(!mpa) {
- if(!edit->mirror_cache)
+ if (!mpa) {
+ if (!edit->mirror_cache)
PE_update_mirror_cache(ob, psys);
- if(!edit->mirror_cache)
+ if (!edit->mirror_cache)
return; /* something went wrong! */
mi= edit->mirror_cache[i];
- if(mi == -1)
+ if (mi == -1)
return;
mpa= psys->particles + mi;
}
@@ -798,9 +796,9 @@ static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys
mpoint = edit->points + mi;
/* make sure they have the same amount of keys */
- if(pa->totkey != mpa->totkey) {
- if(mpa->hair) MEM_freeN(mpa->hair);
- if(mpoint->keys) MEM_freeN(mpoint->keys);
+ if (pa->totkey != mpa->totkey) {
+ if (mpa->hair) MEM_freeN(mpa->hair);
+ if (mpoint->keys) MEM_freeN(mpoint->keys);
mpa->hair= MEM_dupallocN(pa->hair);
mpa->totkey= pa->totkey;
@@ -809,7 +807,7 @@ static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys
mhkey= mpa->hair;
mkey= mpoint->keys;
- for(k=0; k<mpa->totkey; k++, mkey++, mhkey++) {
+ for (k=0; k<mpa->totkey; k++, mkey++, mhkey++) {
mkey->co= mhkey->co;
mkey->time= &mhkey->time;
mkey->flag &= ~PEK_SELECT;
@@ -825,21 +823,21 @@ static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys
mhkey=mpa->hair;
key= point->keys;
mkey= mpoint->keys;
- for(k=0; k<pa->totkey; k++, hkey++, mhkey++, key++, mkey++) {
+ for (k=0; k<pa->totkey; k++, hkey++, mhkey++, key++, mkey++) {
copy_v3_v3(mhkey->co, hkey->co);
mul_m4_v3(mat, mhkey->co);
mhkey->co[0]= -mhkey->co[0];
mul_m4_v3(immat, mhkey->co);
- if(key->flag & PEK_TAG)
+ if (key->flag & PEK_TAG)
mkey->flag |= PEK_TAG;
mkey->length = key->length;
}
- if(point->flag & PEP_TAG)
+ if (point->flag & PEP_TAG)
mpoint->flag |= PEP_TAG;
- if(point->flag & PEP_EDIT_RECALC)
+ if (point->flag & PEP_EDIT_RECALC)
mpoint->flag |= PEP_EDIT_RECALC;
}
@@ -849,35 +847,35 @@ static void PE_apply_mirror(Object *ob, ParticleSystem *psys)
ParticleSystemModifierData *psmd;
POINT_P;
- if(!psys)
+ if (!psys)
return;
edit= psys->edit;
psmd= psys_get_modifier(ob, psys);
- if(!psmd->dm)
+ if (!psmd->dm)
return;
- if(!edit->mirror_cache)
+ if (!edit->mirror_cache)
PE_update_mirror_cache(ob, psys);
- if(!edit->mirror_cache)
+ if (!edit->mirror_cache)
return; /* something went wrong */
/* we delay settings the PARS_EDIT_RECALC for mirrored particles
* to avoid doing mirror twice */
LOOP_POINTS {
- if(point->flag & PEP_EDIT_RECALC) {
+ if (point->flag & PEP_EDIT_RECALC) {
PE_mirror_particle(ob, psmd->dm, psys, psys->particles + p, NULL);
- if(edit->mirror_cache[p] != -1)
+ if (edit->mirror_cache[p] != -1)
edit->points[edit->mirror_cache[p]].flag &= ~PEP_EDIT_RECALC;
}
}
LOOP_POINTS {
- if(point->flag & PEP_EDIT_RECALC)
- if(edit->mirror_cache[p] != -1)
+ if (point->flag & PEP_EDIT_RECALC)
+ if (edit->mirror_cache[p] != -1)
edit->points[edit->mirror_cache[p]].flag |= PEP_EDIT_RECALC;
}
}
@@ -896,13 +894,13 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit)
float *vec, *nor, dvec[3], dot, dist_1st=0.0f;
float hairimat[4][4], hairmat[4][4];
- if(edit==NULL || edit->psys==NULL || (pset->flag & PE_DEFLECT_EMITTER)==0 || (edit->psys->flag & PSYS_GLOBAL_HAIR))
+ if (edit==NULL || edit->psys==NULL || (pset->flag & PE_DEFLECT_EMITTER)==0 || (edit->psys->flag & PSYS_GLOBAL_HAIR))
return;
psys = edit->psys;
psmd = psys_get_modifier(ob,psys);
- if(!psmd->dm)
+ if (!psmd->dm)
return;
LOOP_EDITED_POINTS {
@@ -913,7 +911,7 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit)
}
LOOP_KEYS {
- if(k==0) {
+ if (k==0) {
dist_1st = len_v3v3((key+1)->co, key->co);
dist_1st *= 0.75f * pset->emitterdist;
}
@@ -928,8 +926,8 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit)
dot=dot_v3v3(dvec,nor);
copy_v3_v3(dvec,nor);
- if(dot>0.0f) {
- if(dot<dist_1st) {
+ if (dot>0.0f) {
+ if (dot<dist_1st) {
normalize_v3(dvec);
mul_v3_fl(dvec,dist_1st-dot);
add_v3_v3(key->co, dvec);
@@ -940,7 +938,7 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit)
mul_v3_fl(dvec,dist_1st-dot);
add_v3_v3(key->co, dvec);
}
- if(k==1)
+ if (k==1)
dist_1st*=1.3333f;
}
}
@@ -952,7 +950,7 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit)
}
}
}
-/* force set distances between neighbouring keys */
+/* force set distances between neighboring keys */
static void PE_apply_lengths(Scene *scene, PTCacheEdit *edit)
{
@@ -960,15 +958,15 @@ static void PE_apply_lengths(Scene *scene, PTCacheEdit *edit)
POINT_P; KEY_K;
float dv1[3];
- if(edit==0 || (pset->flag & PE_KEEP_LENGTHS)==0)
+ if (edit==0 || (pset->flag & PE_KEEP_LENGTHS)==0)
return;
- if(edit->psys && edit->psys->flag & PSYS_GLOBAL_HAIR)
+ if (edit->psys && edit->psys->flag & PSYS_GLOBAL_HAIR)
return;
LOOP_EDITED_POINTS {
LOOP_KEYS {
- if(k) {
+ if (k) {
sub_v3_v3v3(dv1, key->co, (key - 1)->co);
normalize_v3(dv1);
mul_v3_fl(dv1, (key - 1)->length);
@@ -977,7 +975,7 @@ static void PE_apply_lengths(Scene *scene, PTCacheEdit *edit)
}
}
}
-/* try to find a nice solution to keep distances between neighbouring keys */
+/* try to find a nice solution to keep distances between neighboring keys */
static void pe_iterate_lengths(Scene *scene, PTCacheEdit *edit)
{
ParticleEditSettings *pset=PE_settings(scene);
@@ -989,17 +987,17 @@ static void pe_iterate_lengths(Scene *scene, PTCacheEdit *edit)
float dv1[3]= {0.0f, 0.0f, 0.0f};
float dv2[3]= {0.0f, 0.0f, 0.0f};
- if(edit==0 || (pset->flag & PE_KEEP_LENGTHS)==0)
+ if (edit==0 || (pset->flag & PE_KEEP_LENGTHS)==0)
return;
- if(edit->psys && edit->psys->flag & PSYS_GLOBAL_HAIR)
+ if (edit->psys && edit->psys->flag & PSYS_GLOBAL_HAIR)
return;
LOOP_EDITED_POINTS {
- for(j=1; j<point->totkey; j++) {
+ for (j=1; j<point->totkey; j++) {
float mul= 1.0f / (float)point->totkey;
- if(pset->flag & PE_LOCK_FIRST) {
+ if (pset->flag & PE_LOCK_FIRST) {
key= point->keys + 1;
k= 1;
dv1[0]= dv1[1]= dv1[2]= 0.0;
@@ -1010,20 +1008,20 @@ static void pe_iterate_lengths(Scene *scene, PTCacheEdit *edit)
dv0[0]= dv0[1]= dv0[2]= 0.0;
}
- for(; k<point->totkey; k++, key++) {
- if(k) {
+ for (; k<point->totkey; k++, key++) {
+ if (k) {
sub_v3_v3v3(dv0, (key - 1)->co, key->co);
tlen= normalize_v3(dv0);
mul_v3_fl(dv0, (mul * (tlen - (key - 1)->length)));
}
- if(k < point->totkey - 1) {
+ if (k < point->totkey - 1) {
sub_v3_v3v3(dv2, (key + 1)->co, key->co);
tlen= normalize_v3(dv2);
mul_v3_fl(dv2, mul * (tlen - key->length));
}
- if(k) {
+ if (k) {
add_v3_v3((key-1)->co, dv1);
}
@@ -1037,12 +1035,12 @@ static void recalc_lengths(PTCacheEdit *edit)
{
POINT_P; KEY_K;
- if(edit==0)
+ if (edit==0)
return;
LOOP_EDITED_POINTS {
key= point->keys;
- for(k=0; k<point->totkey-1; k++, key++) {
+ for (k=0; k<point->totkey-1; k++, key++) {
key->length= len_v3v3(key->co, (key + 1)->co);
}
}
@@ -1056,10 +1054,10 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
float *vec, *nor;
int i, totface /*, totvert*/;
- if(!dm)
+ if (!dm)
return;
- if(edit->emitter_cosnos)
+ if (edit->emitter_cosnos)
MEM_freeN(edit->emitter_cosnos);
BLI_kdtree_free(edit->emitter_field);
@@ -1074,7 +1072,7 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
vec=edit->emitter_cosnos;
nor=vec+3;
- for(i=0; i<totface; i++, vec+=6, nor+=6) {
+ for (i=0; i<totface; i++, vec+=6, nor+=6) {
MFace *mface=dm->getTessFaceData(dm,i,CD_MFACE);
MVert *mvert;
@@ -1090,7 +1088,7 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
add_v3_v3v3(vec,vec,mvert->co);
VECADD(nor,nor,mvert->no);
- if(mface->v4) {
+ if (mface->v4) {
mvert=dm->getVertData(dm,mface->v4,CD_MVERT);
add_v3_v3v3(vec,vec,mvert->co);
VECADD(nor,nor,mvert->no);
@@ -1115,13 +1113,13 @@ static void PE_update_selection(Scene *scene, Object *ob, int useflag)
POINT_P; KEY_K;
/* flag all particles to be updated if not using flag */
- if(!useflag)
+ if (!useflag)
LOOP_POINTS
point->flag |= PEP_EDIT_RECALC;
/* flush edit key flag to hair key flag to preserve selection
* on save */
- if(edit->psys) LOOP_POINTS {
+ if (edit->psys) LOOP_POINTS {
hkey = edit->psys->particles[p].hair;
LOOP_KEYS {
hkey->editflag= key->flag;
@@ -1144,16 +1142,16 @@ static void update_world_cos(Object *ob, PTCacheEdit *edit)
POINT_P; KEY_K;
float hairmat[4][4];
- if(psys==0 || psys->edit==0 || psmd->dm==NULL)
+ if (psys==0 || psys->edit==0 || psmd->dm==NULL)
return;
LOOP_POINTS {
- if(!(psys->flag & PSYS_GLOBAL_HAIR))
+ if (!(psys->flag & PSYS_GLOBAL_HAIR))
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles+p, hairmat);
LOOP_KEYS {
copy_v3_v3(key->world_co,key->co);
- if(!(psys->flag & PSYS_GLOBAL_HAIR))
+ if (!(psys->flag & PSYS_GLOBAL_HAIR))
mul_m4_v3(hairmat, key->world_co);
}
}
@@ -1165,37 +1163,37 @@ static void update_velocities(PTCacheEdit *edit)
POINT_P; KEY_K;
/* hair doesn't use velocities */
- if(edit->psys || !edit->points || !edit->points->keys->vel)
+ if (edit->psys || !edit->points || !edit->points->keys->vel)
return;
frs_sec = edit->pid.flag & PTCACHE_VEL_PER_SEC ? 25.0f : 1.0f;
LOOP_EDITED_POINTS {
LOOP_KEYS {
- if(k==0) {
+ if (k==0) {
dfra = *(key+1)->time - *key->time;
- if(dfra <= 0.0f)
+ if (dfra <= 0.0f)
continue;
sub_v3_v3v3(key->vel, (key+1)->co, key->co);
- if(point->totkey>2) {
+ if (point->totkey>2) {
sub_v3_v3v3(vec1, (key+1)->co, (key+2)->co);
project_v3_v3v3(vec2, vec1, key->vel);
sub_v3_v3v3(vec2, vec1, vec2);
madd_v3_v3fl(key->vel, vec2, 0.5f);
}
}
- else if(k==point->totkey-1) {
+ else if (k==point->totkey-1) {
dfra = *key->time - *(key-1)->time;
- if(dfra <= 0.0f)
+ if (dfra <= 0.0f)
continue;
sub_v3_v3v3(key->vel, key->co, (key-1)->co);
- if(point->totkey>2) {
+ if (point->totkey>2) {
sub_v3_v3v3(vec1, (key-2)->co, (key-1)->co);
project_v3_v3v3(vec2, vec1, key->vel);
sub_v3_v3v3(vec2, vec1, vec2);
@@ -1205,7 +1203,7 @@ static void update_velocities(PTCacheEdit *edit)
else {
dfra = *(key+1)->time - *(key-1)->time;
- if(dfra <= 0.0f)
+ if (dfra <= 0.0f)
continue;
sub_v3_v3v3(key->vel, (key+1)->co, (key-1)->co);
@@ -1218,16 +1216,16 @@ 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;
- if(!edit)
+ if (!edit)
return;
/* flag all particles to be updated if not using flag */
- if(!useflag)
+ if (!useflag)
LOOP_POINTS {
point->flag |= PEP_EDIT_RECALC;
}
@@ -1236,11 +1234,11 @@ void PE_update_object(Scene *scene, Object *ob, int useflag)
pe_iterate_lengths(scene, edit);
pe_deflect_emitter(scene, ob, edit);
PE_apply_lengths(scene, edit);
- if(pe_x_mirror(ob))
+ if (pe_x_mirror(ob))
PE_apply_mirror(ob,edit->psys);
- if(edit->psys)
+ if (edit->psys)
update_world_cos(ob, edit);
- if(pset->flag & PE_AUTO_VELOCITY)
+ if (pset->flag & PE_AUTO_VELOCITY)
update_velocities(edit);
PE_hide_keys_time(scene, edit, CFRA);
@@ -1252,7 +1250,7 @@ void PE_update_object(Scene *scene, Object *ob, int useflag)
point->flag &= ~PEP_EDIT_RECALC;
}
- if(edit->psys)
+ if (edit->psys)
edit->psys->flag &= ~PSYS_HAIR_UPDATED;
}
@@ -1268,7 +1266,7 @@ static void select_key(PEData *data, int point_index, int key_index)
PTCacheEditPoint *point = edit->points + point_index;
PTCacheEditKey *key = point->keys + key_index;
- if(data->select)
+ if (data->select)
key->flag |= PEK_SELECT;
else
key->flag &= ~PEK_SELECT;
@@ -1283,7 +1281,7 @@ static void select_keys(PEData *data, int point_index, int UNUSED(key_index))
KEY_K;
LOOP_KEYS {
- if(data->select)
+ if (data->select)
key->flag |= PEK_SELECT;
else
key->flag &= ~PEK_SELECT;
@@ -1344,7 +1342,8 @@ static int pe_select_all_exec(bContext *C, wmOperator *op)
if ((key->flag & PEK_SELECT) == 0) {
key->flag |= PEK_SELECT;
point->flag |= PEP_EDIT_RECALC;
- } else {
+ }
+ else {
key->flag &= ~PEK_SELECT;
point->flag |= PEP_EDIT_RECALC;
}
@@ -1362,15 +1361,15 @@ static int pe_select_all_exec(bContext *C, wmOperator *op)
void PARTICLE_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Selection of all particles";
- ot->idname= "PARTICLE_OT_select_all";
+ ot->name = "(De)select All";
+ ot->idname = "PARTICLE_OT_select_all";
/* api callbacks */
- ot->exec= pe_select_all_exec;
- ot->poll= PE_poll;
+ ot->exec = pe_select_all_exec;
+ ot->poll = PE_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
WM_operator_properties_select_all(ot);
}
@@ -1385,10 +1384,10 @@ int PE_mouse_particles(bContext *C, const int mval[2], int extend)
PTCacheEdit *edit= PE_get_current(scene, ob);
POINT_P; KEY_K;
- if(!PE_start_edit(edit))
+ if (!PE_start_edit(edit))
return OPERATOR_CANCELLED;
- if(!extend) {
+ if (!extend) {
LOOP_VISIBLE_POINTS {
LOOP_SELECTED_KEYS {
key->flag &= ~PEK_SELECT;
@@ -1436,15 +1435,15 @@ static int select_roots_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_select_roots(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Roots";
- ot->idname= "PARTICLE_OT_select_roots";
+ ot->name = "Select Roots";
+ ot->idname = "PARTICLE_OT_select_roots";
/* api callbacks */
- ot->exec= select_roots_exec;
- ot->poll= PE_poll;
+ ot->exec = select_roots_exec;
+ ot->poll = PE_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ select last operator ************************/
@@ -1476,15 +1475,15 @@ static int select_tips_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_select_tips(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Tips";
- ot->idname= "PARTICLE_OT_select_tips";
+ ot->name = "Select Tips";
+ ot->idname = "PARTICLE_OT_select_tips";
/* api callbacks */
- ot->exec= select_tips_exec;
- ot->poll= PE_poll;
+ ot->exec = select_tips_exec;
+ ot->poll = PE_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ select linked operator ************************/
@@ -1520,16 +1519,16 @@ static int select_linked_invoke(bContext *C, wmOperator *op, wmEvent *event)
void PARTICLE_OT_select_linked(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Linked";
- ot->idname= "PARTICLE_OT_select_linked";
+ ot->name = "Select Linked";
+ ot->idname = "PARTICLE_OT_select_linked";
/* api callbacks */
- ot->exec= select_linked_exec;
- ot->invoke= select_linked_invoke;
- ot->poll= PE_poll_view3d;
+ ot->exec = select_linked_exec;
+ ot->invoke = select_linked_invoke;
+ ot->poll = PE_poll_view3d;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect linked keys rather than selecting them");
@@ -1556,7 +1555,7 @@ int PE_border_select(bContext *C, rcti *rect, int select, int extend)
PTCacheEdit *edit= PE_get_current(scene, ob);
PEData data;
- if(!PE_start_edit(edit))
+ if (!PE_start_edit(edit))
return OPERATOR_CANCELLED;
if (extend == 0 && select)
@@ -1583,7 +1582,7 @@ int PE_circle_select(bContext *C, int selecting, const int mval[2], float rad)
PTCacheEdit *edit= PE_get_current(scene, ob);
PEData data;
- if(!PE_start_edit(edit))
+ if (!PE_start_edit(edit))
return OPERATOR_FINISHED;
PE_set_view3d_data(C, &data);
@@ -1616,7 +1615,7 @@ int PE_lasso_select(bContext *C, int mcords[][2], short moves, short extend, sho
PEData data;
- if(!PE_start_edit(edit))
+ if (!PE_start_edit(edit))
return OPERATOR_CANCELLED;
if (extend == 0 && select)
@@ -1626,38 +1625,38 @@ int PE_lasso_select(bContext *C, int mcords[][2], short moves, short extend, sho
PE_set_view3d_data(C, &data);
LOOP_VISIBLE_POINTS {
- if(edit->psys && !(psys->flag & PSYS_GLOBAL_HAIR))
+ if (edit->psys && !(psys->flag & PSYS_GLOBAL_HAIR))
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + p, mat);
- if(pset->selectmode==SCE_SELECT_POINT) {
+ if (pset->selectmode==SCE_SELECT_POINT) {
LOOP_KEYS {
copy_v3_v3(co, key->co);
mul_m4_v3(mat, co);
project_int(ar, co, vertco);
- if((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1]) && key_test_depth(&data, co)) {
- if(select && !(key->flag & PEK_SELECT)) {
+ if ((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1]) && key_test_depth(&data, co)) {
+ if (select && !(key->flag & PEK_SELECT)) {
key->flag |= PEK_SELECT;
point->flag |= PEP_EDIT_RECALC;
}
- else if(key->flag & PEK_SELECT) {
+ else if (key->flag & PEK_SELECT) {
key->flag &= ~PEK_SELECT;
point->flag |= PEP_EDIT_RECALC;
}
}
}
}
- else if(pset->selectmode==SCE_SELECT_END) {
+ else if (pset->selectmode==SCE_SELECT_END) {
key= point->keys + point->totkey - 1;
copy_v3_v3(co, key->co);
mul_m4_v3(mat, co);
project_int(ar, co,vertco);
- if((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1]) && key_test_depth(&data, co)) {
- if(select && !(key->flag & PEK_SELECT)) {
+ if ((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1]) && key_test_depth(&data, co)) {
+ if (select && !(key->flag & PEK_SELECT)) {
key->flag |= PEK_SELECT;
point->flag |= PEP_EDIT_RECALC;
}
- else if(key->flag & PEK_SELECT) {
+ else if (key->flag & PEK_SELECT) {
key->flag &= ~PEK_SELECT;
point->flag |= PEP_EDIT_RECALC;
}
@@ -1680,7 +1679,7 @@ static int hide_exec(bContext *C, wmOperator *op)
PTCacheEdit *edit= PE_get_current(scene, ob);
POINT_P; KEY_K;
- if(RNA_enum_get(op->ptr, "unselected")) {
+ if (RNA_enum_get(op->ptr, "unselected")) {
LOOP_UNSELECTED_POINTS {
point->flag |= PEP_HIDE;
point->flag |= PEP_EDIT_RECALC;
@@ -1708,15 +1707,15 @@ static int hide_exec(bContext *C, wmOperator *op)
void PARTICLE_OT_hide(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Hide Selected";
- ot->idname= "PARTICLE_OT_hide";
+ ot->name = "Hide Selected";
+ ot->idname = "PARTICLE_OT_hide";
/* api callbacks */
- ot->exec= hide_exec;
- ot->poll= PE_poll;
+ ot->exec = hide_exec;
+ ot->poll = PE_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected");
@@ -1732,7 +1731,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
POINT_P; KEY_K;
LOOP_POINTS {
- if(point->flag & PEP_HIDE) {
+ if (point->flag & PEP_HIDE) {
point->flag &= ~PEP_HIDE;
point->flag |= PEP_EDIT_RECALC;
@@ -1750,15 +1749,15 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_reveal(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reveal";
- ot->idname= "PARTICLE_OT_reveal";
+ ot->name = "Reveal";
+ ot->idname = "PARTICLE_OT_reveal";
/* api callbacks */
- ot->exec= reveal_exec;
- ot->poll= PE_poll;
+ ot->exec = reveal_exec;
+ ot->poll = PE_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ select less operator ************************/
@@ -1770,22 +1769,22 @@ static void select_less_keys(PEData *data, int point_index)
KEY_K;
LOOP_SELECTED_KEYS {
- if(k==0) {
- if(((key+1)->flag&PEK_SELECT)==0)
+ if (k==0) {
+ if (((key+1)->flag&PEK_SELECT)==0)
key->flag |= PEK_TAG;
}
- else if(k==point->totkey-1) {
- if(((key-1)->flag&PEK_SELECT)==0)
+ else if (k==point->totkey-1) {
+ if (((key-1)->flag&PEK_SELECT)==0)
key->flag |= PEK_TAG;
}
else {
- if((((key-1)->flag & (key+1)->flag) & PEK_SELECT)==0)
+ if ((((key-1)->flag & (key+1)->flag) & PEK_SELECT)==0)
key->flag |= PEK_TAG;
}
}
LOOP_KEYS {
- if(key->flag&PEK_TAG) {
+ if (key->flag&PEK_TAG) {
key->flag &= ~(PEK_TAG|PEK_SELECT);
point->flag |= PEP_EDIT_RECALC; /* redraw selection only */
}
@@ -1808,15 +1807,15 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_select_less(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Less";
- ot->idname= "PARTICLE_OT_select_less";
+ ot->name = "Select Less";
+ ot->idname = "PARTICLE_OT_select_less";
/* api callbacks */
- ot->exec= select_less_exec;
- ot->poll= PE_poll;
+ ot->exec = select_less_exec;
+ ot->poll = PE_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ select more operator ************************/
@@ -1828,24 +1827,24 @@ static void select_more_keys(PEData *data, int point_index)
KEY_K;
LOOP_KEYS {
- if(key->flag & PEK_SELECT) continue;
+ if (key->flag & PEK_SELECT) continue;
- if(k==0) {
- if((key+1)->flag&PEK_SELECT)
+ if (k==0) {
+ if ((key+1)->flag&PEK_SELECT)
key->flag |= PEK_TAG;
}
- else if(k==point->totkey-1) {
- if((key-1)->flag&PEK_SELECT)
+ else if (k==point->totkey-1) {
+ if ((key-1)->flag&PEK_SELECT)
key->flag |= PEK_TAG;
}
else {
- if(((key-1)->flag | (key+1)->flag) & PEK_SELECT)
+ if (((key-1)->flag | (key+1)->flag) & PEK_SELECT)
key->flag |= PEK_TAG;
}
}
LOOP_KEYS {
- if(key->flag&PEK_TAG) {
+ if (key->flag&PEK_TAG) {
key->flag &= ~PEK_TAG;
key->flag |= PEK_SELECT;
point->flag |= PEP_EDIT_RECALC; /* redraw selection only */
@@ -1869,15 +1868,15 @@ static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_select_more(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select More";
- ot->idname= "PARTICLE_OT_select_more";
+ ot->name = "Select More";
+ ot->idname = "PARTICLE_OT_select_more";
/* api callbacks */
- ot->exec= select_more_exec;
- ot->poll= PE_poll;
+ ot->exec = select_more_exec;
+ ot->poll = PE_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ rekey operator ************************/
@@ -1913,7 +1912,7 @@ static void rekey_particle(PEData *data, int pa_index)
dval= (end - sta) / (float)(data->totrekey - 1);
/* interpolate new keys from old ones */
- for(k=1,key++; k<data->totrekey-1; k++,key++) {
+ for (k=1,key++; k<data->totrekey-1; k++,key++) {
state.time= (float)k / (float)(data->totrekey-1);
psys_get_particle_on_path(&sim, pa_index, &state, 0);
copy_v3_v3(key->co, state.co);
@@ -1921,22 +1920,22 @@ static void rekey_particle(PEData *data, int pa_index)
}
/* replace keys */
- if(pa->hair)
+ if (pa->hair)
MEM_freeN(pa->hair);
pa->hair= new_keys;
point->totkey=pa->totkey=data->totrekey;
- if(point->keys)
+ if (point->keys)
MEM_freeN(point->keys);
ekey= point->keys= MEM_callocN(pa->totkey * sizeof(PTCacheEditKey),"Hair re-key edit keys");
- for(k=0, key=pa->hair; k<pa->totkey; k++, key++, ekey++) {
+ for (k=0, key=pa->hair; k<pa->totkey; k++, key++, ekey++) {
ekey->co= key->co;
ekey->time= &key->time;
ekey->flag |= PEK_SELECT;
- if(!(psys->flag & PSYS_GLOBAL_HAIR))
+ if (!(psys->flag & PSYS_GLOBAL_HAIR))
ekey->flag |= PEK_USE_WCO;
}
@@ -1965,16 +1964,16 @@ static int rekey_exec(bContext *C, wmOperator *op)
void PARTICLE_OT_rekey(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Rekey";
- ot->idname= "PARTICLE_OT_rekey";
+ ot->name = "Rekey";
+ ot->idname = "PARTICLE_OT_rekey";
/* api callbacks */
- ot->exec= rekey_exec;
- ot->invoke= WM_operator_props_popup;
- ot->poll= PE_poll;
+ ot->exec = rekey_exec;
+ ot->invoke = WM_operator_props_popup;
+ ot->poll = PE_hair_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_int(ot->srna, "keys", 2, 2, INT_MAX, "Number of Keys", "", 2, 100);
@@ -1991,7 +1990,7 @@ static void rekey_particle_to_time(Scene *scene, Object *ob, int pa_index, float
PTCacheEditKey *ekey;
int k;
- if(!edit || !edit->psys) return;
+ if (!edit || !edit->psys) return;
psys = edit->psys;
@@ -2006,19 +2005,19 @@ static void rekey_particle_to_time(Scene *scene, Object *ob, int pa_index, float
key= new_keys= MEM_dupallocN(pa->hair);
/* interpolate new keys from old ones (roots stay the same) */
- for(k=1, key++; k < pa->totkey; k++, key++) {
+ for (k=1, key++; k < pa->totkey; k++, key++) {
state.time= path_time * (float)k / (float)(pa->totkey-1);
psys_get_particle_on_path(&sim, pa_index, &state, 0);
copy_v3_v3(key->co, state.co);
}
/* replace hair keys */
- if(pa->hair)
+ if (pa->hair)
MEM_freeN(pa->hair);
pa->hair= new_keys;
/* update edit pointers */
- for(k=0, key=pa->hair, ekey=edit->points[pa_index].keys; k<pa->totkey; k++, key++, ekey++) {
+ for (k=0, key=pa->hair, ekey=edit->points[pa_index].keys; k<pa->totkey; k++, key++, ekey++) {
ekey->co= key->co;
ekey->time= &key->time;
}
@@ -2037,7 +2036,7 @@ static int remove_tagged_particles(Object *ob, ParticleSystem *psys, int mirror)
ParticleSystemModifierData *psmd;
int i, new_totpart= psys->totpart, removed= 0;
- if(mirror) {
+ if (mirror) {
/* mirror tags */
psmd= psys_get_modifier(ob, psys);
@@ -2051,16 +2050,16 @@ static int remove_tagged_particles(Object *ob, ParticleSystem *psys, int mirror)
removed++;
}
- if(new_totpart != psys->totpart) {
- if(new_totpart) {
+ if (new_totpart != psys->totpart) {
+ if (new_totpart) {
npa= new_pars= MEM_callocN(new_totpart * sizeof(ParticleData), "ParticleData array");
npoint= new_points= MEM_callocN(new_totpart * sizeof(PTCacheEditPoint), "PTCacheEditKey array");
- if(ELEM(NULL, new_pars, new_points)) {
+ if (ELEM(NULL, new_pars, new_points)) {
/* allocation error! */
- if(new_pars)
+ if (new_pars)
MEM_freeN(new_pars);
- if(new_points)
+ if (new_points)
MEM_freeN(new_points);
return 0;
}
@@ -2068,11 +2067,11 @@ static int remove_tagged_particles(Object *ob, ParticleSystem *psys, int mirror)
pa= psys->particles;
point= edit->points;
- for(i=0; i<psys->totpart; i++, pa++, point++) {
- if(point->flag & PEP_TAG) {
- if(point->keys)
+ for (i=0; i<psys->totpart; i++, pa++, point++) {
+ if (point->flag & PEP_TAG) {
+ if (point->keys)
MEM_freeN(point->keys);
- if(pa->hair)
+ if (pa->hair)
MEM_freeN(pa->hair);
}
else {
@@ -2083,18 +2082,18 @@ static int remove_tagged_particles(Object *ob, ParticleSystem *psys, int mirror)
}
}
- if(psys->particles) MEM_freeN(psys->particles);
+ if (psys->particles) MEM_freeN(psys->particles);
psys->particles= new_pars;
- if(edit->points) MEM_freeN(edit->points);
+ if (edit->points) MEM_freeN(edit->points);
edit->points= new_points;
- if(edit->mirror_cache) {
+ if (edit->mirror_cache) {
MEM_freeN(edit->mirror_cache);
edit->mirror_cache= NULL;
}
- if(psys->child) {
+ if (psys->child) {
MEM_freeN(psys->child);
psys->child= NULL;
psys->totchild=0;
@@ -2116,7 +2115,7 @@ static void remove_tagged_keys(Object *ob, ParticleSystem *psys)
ParticleSystemModifierData *psmd;
short new_totkey;
- if(pe_x_mirror(ob)) {
+ if (pe_x_mirror(ob)) {
/* mirror key tags */
psmd= psys_get_modifier(ob, psys);
@@ -2134,7 +2133,7 @@ static void remove_tagged_keys(Object *ob, ParticleSystem *psys)
new_totkey--;
}
/* we can't have elements with less than two keys*/
- if(new_totkey < 2)
+ if (new_totkey < 2)
point->flag |= PEP_TAG;
}
remove_tagged_particles(ob, psys, pe_x_mirror(ob));
@@ -2147,18 +2146,18 @@ static void remove_tagged_keys(Object *ob, ParticleSystem *psys)
new_totkey--;
}
- if(new_totkey != pa->totkey) {
+ if (new_totkey != pa->totkey) {
nhkey= new_hkeys= MEM_callocN(new_totkey*sizeof(HairKey), "HairKeys");
nkey= new_keys= MEM_callocN(new_totkey*sizeof(PTCacheEditKey), "particle edit keys");
hkey= pa->hair;
LOOP_KEYS {
- while(key->flag & PEK_TAG && hkey < pa->hair + pa->totkey) {
+ while (key->flag & PEK_TAG && hkey < pa->hair + pa->totkey) {
key++;
hkey++;
}
- if(hkey < pa->hair + pa->totkey) {
+ if (hkey < pa->hair + pa->totkey) {
copy_v3_v3(nhkey->co, hkey->co);
nhkey->editflag = hkey->editflag;
nhkey->time= hkey->time;
@@ -2177,10 +2176,10 @@ static void remove_tagged_keys(Object *ob, ParticleSystem *psys)
hkey++;
}
- if(pa->hair)
+ if (pa->hair)
MEM_freeN(pa->hair);
- if(point->keys)
+ if (point->keys)
MEM_freeN(point->keys);
pa->hair= new_hkeys;
@@ -2196,7 +2195,7 @@ static void remove_tagged_keys(Object *ob, ParticleSystem *psys)
/************************ subdivide opertor *********************/
-/* works like normal edit mode subdivide, inserts keys between neighbouring selected keys */
+/* works like normal edit mode subdivide, inserts keys between neighboring selected keys */
static void subdivide_particle(PEData *data, int pa_index)
{
PTCacheEdit *edit= data->edit;
@@ -2216,12 +2215,12 @@ static void subdivide_particle(PEData *data, int pa_index)
sim.ob= data->ob;
sim.psys= edit->psys;
- for(k=0, ekey=point->keys; k<pa->totkey-1; k++,ekey++) {
- if(ekey->flag&PEK_SELECT && (ekey+1)->flag&PEK_SELECT)
+ for (k=0, ekey=point->keys; k<pa->totkey-1; k++,ekey++) {
+ if (ekey->flag&PEK_SELECT && (ekey+1)->flag&PEK_SELECT)
totnewkey++;
}
- if(totnewkey==0) return;
+ if (totnewkey==0) return;
pa->flag |= PARS_REKEY;
@@ -2231,7 +2230,7 @@ static void subdivide_particle(PEData *data, int pa_index)
key = pa->hair;
endtime= key[pa->totkey-1].time;
- for(k=0, ekey=point->keys; k<pa->totkey-1; k++, key++, ekey++) {
+ for (k=0, ekey=point->keys; k<pa->totkey-1; k++, key++, ekey++) {
memcpy(nkey,key,sizeof(HairKey));
memcpy(nekey,ekey,sizeof(PTCacheEditKey));
@@ -2242,7 +2241,7 @@ static void subdivide_particle(PEData *data, int pa_index)
nkey++;
nekey++;
- if(ekey->flag & PEK_SELECT && (ekey+1)->flag & PEK_SELECT) {
+ if (ekey->flag & PEK_SELECT && (ekey+1)->flag & PEK_SELECT) {
nkey->time= (key->time + (key+1)->time)*0.5f;
state.time= (endtime != 0.0f)? nkey->time/endtime: 0.0f;
psys_get_particle_on_path(&sim, pa_index, &state, 0);
@@ -2251,7 +2250,7 @@ static void subdivide_particle(PEData *data, int pa_index)
nekey->co= nkey->co;
nekey->time= &nkey->time;
nekey->flag |= PEK_SELECT;
- if(!(psys->flag & PSYS_GLOBAL_HAIR))
+ if (!(psys->flag & PSYS_GLOBAL_HAIR))
nekey->flag |= PEK_USE_WCO;
nekey++;
@@ -2265,11 +2264,11 @@ static void subdivide_particle(PEData *data, int pa_index)
nekey->co= nkey->co;
nekey->time= &nkey->time;
- if(pa->hair)
+ if (pa->hair)
MEM_freeN(pa->hair);
pa->hair= new_keys;
- if(point->keys)
+ if (point->keys)
MEM_freeN(point->keys);
point->keys= new_ekeys;
@@ -2295,15 +2294,15 @@ static int subdivide_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_subdivide(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Subdivide";
- ot->idname= "PARTICLE_OT_subdivide";
+ ot->name = "Subdivide";
+ ot->idname = "PARTICLE_OT_subdivide";
/* api callbacks */
- ot->exec= subdivide_exec;
- ot->poll= PE_poll;
+ ot->exec = subdivide_exec;
+ ot->poll = PE_hair_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ remove doubles opertor *********************/
@@ -2321,7 +2320,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
float mat[4][4], co[3], threshold= RNA_float_get(op->ptr, "threshold");
int n, totn, removed, totremoved;
- if(psys->flag & PSYS_GLOBAL_HAIR)
+ if (psys->flag & PSYS_GLOBAL_HAIR)
return OPERATOR_CANCELLED;
edit= psys->edit;
@@ -2351,10 +2350,10 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
totn= BLI_kdtree_find_n_nearest(tree,10,co,NULL,nearest);
- for(n=0; n<totn; n++) {
+ for (n=0; n<totn; n++) {
/* this needs a custom threshold still */
- if(nearest[n].index > p && nearest[n].dist < threshold) {
- if(!(point->flag & PEP_TAG)) {
+ if (nearest[n].index > p && nearest[n].dist < threshold) {
+ if (!(point->flag & PEP_TAG)) {
point->flag |= PEP_TAG;
removed++;
}
@@ -2367,9 +2366,9 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
/* remove tagged particles - don't do mirror here! */
remove_tagged_particles(ob, psys, 0);
totremoved += removed;
- } while(removed);
+ } while (removed);
- if(totremoved == 0)
+ if (totremoved == 0)
return OPERATOR_CANCELLED;
BKE_reportf(op->reports, RPT_INFO, "Remove %d double particles", totremoved);
@@ -2383,15 +2382,15 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
void PARTICLE_OT_remove_doubles(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Doubles";
- ot->idname= "PARTICLE_OT_remove_doubles";
+ ot->name = "Remove Doubles";
+ ot->idname = "PARTICLE_OT_remove_doubles";
/* api callbacks */
- ot->exec= remove_doubles_exec;
- ot->poll= PE_poll;
+ ot->exec = remove_doubles_exec;
+ ot->poll = PE_hair_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_float(ot->srna, "threshold", 0.0002f, 0.0f, FLT_MAX, "Threshold", "Threshold distance withing which particles are removed", 0.00001f, 0.1f);
@@ -2433,15 +2432,15 @@ static int weight_set_exec(bContext *C, wmOperator *op)
void PARTICLE_OT_weight_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Weight Set";
- ot->idname= "PARTICLE_OT_weight_set";
+ ot->name = "Weight Set";
+ ot->idname = "PARTICLE_OT_weight_set";
/* api callbacks */
- ot->exec= weight_set_exec;
- ot->poll= PE_poll;
+ ot->exec = weight_set_exec;
+ ot->poll = PE_hair_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_float(ot->srna, "factor", 1, 0, 1, "Factor", "", 0, 1);
}
@@ -2453,12 +2452,12 @@ static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata)
ParticleEditSettings *pset= PE_settings(CTX_data_scene(C));
ParticleBrushData *brush;
- if(pset->brushtype < 0)
+ if (pset->brushtype < 0)
return;
brush= &pset->brush[pset->brushtype];
- if(brush) {
+ if (brush) {
glPushMatrix();
glTranslatef((float)x, (float)y, 0.0f);
@@ -2478,11 +2477,11 @@ static void toggle_particle_cursor(bContext *C, int enable)
{
ParticleEditSettings *pset= PE_settings(CTX_data_scene(C));
- if(pset->paintcursor && !enable) {
+ if (pset->paintcursor && !enable) {
WM_paint_cursor_end(CTX_wm_manager(C), pset->paintcursor);
pset->paintcursor = NULL;
}
- else if(enable)
+ else if (enable)
pset->paintcursor= WM_paint_cursor_activate(CTX_wm_manager(C), PE_poll_view3d, brush_drawcursor, NULL);
}
@@ -2516,12 +2515,12 @@ static int delete_exec(bContext *C, wmOperator *op)
PE_set_data(C, &data);
- if(type == DEL_KEY) {
+ if (type == DEL_KEY) {
foreach_selected_key(&data, set_delete_particle_key);
remove_tagged_keys(data.ob, data.edit->psys);
recalc_lengths(data.edit);
}
- else if(type == DEL_PARTICLE) {
+ else if (type == DEL_PARTICLE) {
foreach_selected_point(&data, set_delete_particle);
remove_tagged_particles(data.ob, data.edit->psys, pe_x_mirror(data.ob));
recalc_lengths(data.edit);
@@ -2536,19 +2535,19 @@ static int delete_exec(bContext *C, wmOperator *op)
void PARTICLE_OT_delete(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete";
- ot->idname= "PARTICLE_OT_delete";
+ ot->name = "Delete";
+ ot->idname = "PARTICLE_OT_delete";
/* api callbacks */
- ot->exec= delete_exec;
- ot->invoke= WM_menu_invoke;
- ot->poll= PE_hair_poll;
+ ot->exec = delete_exec;
+ ot->invoke = WM_menu_invoke;
+ ot->poll = PE_hair_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", delete_type_items, DEL_PARTICLE, "Type", "Delete a full particle or only keys");
+ ot->prop = RNA_def_enum(ot->srna, "type", delete_type_items, DEL_PARTICLE, "Type", "Delete a full particle or only keys");
}
/*************************** mirror operator **************************/
@@ -2566,25 +2565,25 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
int *mirrorfaces = NULL;
int rotation, totpart, newtotpart;
- if(psys->flag & PSYS_GLOBAL_HAIR)
+ if (psys->flag & PSYS_GLOBAL_HAIR)
return;
psmd= psys_get_modifier(ob, psys);
- if(!psmd->dm)
+ if (!psmd->dm)
return;
mirrorfaces= mesh_get_x_mirror_faces(ob, NULL);
- if(!edit->mirror_cache)
+ if (!edit->mirror_cache)
PE_update_mirror_cache(ob, psys);
totpart= psys->totpart;
newtotpart= psys->totpart;
LOOP_VISIBLE_POINTS {
pa = psys->particles + p;
- if(!tagged) {
- if(point_is_selected(point)) {
- if(edit->mirror_cache[p] != -1) {
+ if (!tagged) {
+ if (point_is_selected(point)) {
+ if (edit->mirror_cache[p] != -1) {
/* already has a mirror, don't need to duplicate */
PE_mirror_particle(ob, psmd->dm, psys, pa, NULL);
continue;
@@ -2594,28 +2593,28 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
}
}
- if((point->flag & PEP_TAG) && mirrorfaces[pa->num*2] != -1)
+ if ((point->flag & PEP_TAG) && mirrorfaces[pa->num*2] != -1)
newtotpart++;
}
- if(newtotpart != psys->totpart) {
+ if (newtotpart != psys->totpart) {
/* allocate new arrays and copy existing */
new_pars= MEM_callocN(newtotpart*sizeof(ParticleData), "ParticleData new");
new_points= MEM_callocN(newtotpart*sizeof(PTCacheEditPoint), "PTCacheEditPoint new");
- if(psys->particles) {
+ if (psys->particles) {
memcpy(new_pars, psys->particles, totpart*sizeof(ParticleData));
MEM_freeN(psys->particles);
}
psys->particles= new_pars;
- if(edit->points) {
+ if (edit->points) {
memcpy(new_points, edit->points, totpart*sizeof(PTCacheEditPoint));
MEM_freeN(edit->points);
}
edit->points= new_points;
- if(edit->mirror_cache) {
+ if (edit->mirror_cache) {
MEM_freeN(edit->mirror_cache);
edit->mirror_cache= NULL;
}
@@ -2626,19 +2625,19 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
newpa= psys->particles + totpart;
newpoint= edit->points + totpart;
- for(p=0, point=edit->points; p<totpart; p++, point++) {
+ for (p=0, point=edit->points; p<totpart; p++, point++) {
pa = psys->particles + p;
- if(point->flag & PEP_HIDE)
+ if (point->flag & PEP_HIDE)
continue;
- if(!(point->flag & PEP_TAG) || mirrorfaces[pa->num*2] == -1)
+ if (!(point->flag & PEP_TAG) || mirrorfaces[pa->num*2] == -1)
continue;
/* duplicate */
*newpa= *pa;
*newpoint= *point;
- if(pa->hair) newpa->hair= MEM_dupallocN(pa->hair);
- if(point->keys) newpoint->keys= MEM_dupallocN(point->keys);
+ if (pa->hair) newpa->hair= MEM_dupallocN(pa->hair);
+ if (point->keys) newpoint->keys= MEM_dupallocN(point->keys);
/* rotate weights according to vertex index rotation */
rotation= mirrorfaces[pa->num*2+1];
@@ -2646,11 +2645,13 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
newpa->fuv[1]= pa->fuv[1];
newpa->fuv[2]= pa->fuv[0];
newpa->fuv[3]= pa->fuv[3];
- while(rotation-- > 0)
- if(me->mface[pa->num].v4)
- SHIFT4(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2], newpa->fuv[3])
- else
- SHIFT3(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2])
+ while (rotation-- > 0)
+ if (me->mface[pa->num].v4) {
+ SHIFT4(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2], newpa->fuv[3]);
+ }
+ else {
+ SHIFT3(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2]);
+ }
/* assign face inddex */
newpa->num= mirrorfaces[pa->num*2];
@@ -2658,7 +2659,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
/* update edit key pointers */
key= newpoint->keys;
- for(k=0, hkey=newpa->hair; k<newpa->totkey; k++, hkey++, key++) {
+ for (k=0, hkey=newpa->hair; k<newpa->totkey; k++, hkey++, key++) {
key->co= hkey->co;
key->time= &hkey->time;
}
@@ -2696,15 +2697,15 @@ static int mirror_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_mirror(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mirror";
- ot->idname= "PARTICLE_OT_mirror";
+ ot->name = "Mirror";
+ ot->idname = "PARTICLE_OT_mirror";
/* api callbacks */
- ot->exec= mirror_exec;
- ot->poll= PE_poll;
+ ot->exec = mirror_exec;
+ ot->poll = PE_hair_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************* brush edit callbacks ********************/
@@ -2714,7 +2715,7 @@ static void brush_comb(PEData *data, float UNUSED(mat[][4]), float imat[][4], in
ParticleEditSettings *pset= PE_settings(data->scene);
float cvec[3], fac;
- if(pset->flag & PE_LOCK_FIRST && key_index == 0) return;
+ if (pset->flag & PE_LOCK_FIRST && key_index == 0) return;
fac= (float)pow((double)(1.0f - data->dist / data->rad), (double)data->combfac);
@@ -2739,10 +2740,10 @@ static void brush_cut(PEData *data, int pa_index)
int vertco[2];
/* blunt scissors */
- if(BLI_frand() > data->cutfac) return;
+ if (BLI_frand() > data->cutfac) return;
/* don't cut hidden */
- if(edit->points[pa_index].flag & PEP_HIDE)
+ if (edit->points[pa_index].flag & PEP_HIDE)
return;
rad2= data->rad * data->rad;
@@ -2760,16 +2761,16 @@ static void brush_cut(PEData *data, int pa_index)
xo1= x1 - o1;
/* check if root is inside circle */
- if(xo0*xo0 + xo1*xo1 < rad2 && key_test_depth(data, key->co)) {
+ if (xo0*xo0 + xo1*xo1 < rad2 && key_test_depth(data, key->co)) {
cut_time= -1.0f;
cut= 1;
}
else {
/* calculate path time closest to root that was inside the circle */
- for(k=1, key++; k<=keys; k++, key++) {
+ for (k=1, key++; k<=keys; k++, key++) {
project_int_noclip(ar, key->co, vertco);
- if(key_test_depth(data, key->co) == 0) {
+ if (key_test_depth(data, key->co) == 0) {
x0= (float)vertco[0];
x1= (float)vertco[1];
@@ -2787,15 +2788,15 @@ static void brush_cut(PEData *data, int pa_index)
d= dv * rad2 - d*d;
- if(d > 0.0f) {
+ if (d > 0.0f) {
d= sqrt(d);
cut_time= -(v0*xo0 + v1*xo1 + d);
- if(cut_time > 0.0f) {
+ if (cut_time > 0.0f) {
cut_time /= dv;
- if(cut_time < 1.0f) {
+ if (cut_time < 1.0f) {
cut_time += (float)(k-1);
cut_time /= (float)keys;
cut= 1;
@@ -2812,8 +2813,8 @@ static void brush_cut(PEData *data, int pa_index)
}
}
- if(cut) {
- if(cut_time < 0.0f) {
+ if (cut) {
+ if (cut_time < 0.0f) {
edit->points[pa_index].flag |= PEP_TAG;
}
else {
@@ -2831,7 +2832,7 @@ static void brush_length(PEData *data, int point_index)
float dvec[3],pvec[3] = {0.0f, 0.0f, 0.0f};
LOOP_KEYS {
- if(k==0) {
+ if (k==0) {
copy_v3_v3(pvec,key->co);
}
else {
@@ -2863,7 +2864,7 @@ static void brush_puff(PEData *data, int point_index)
puff_volume = brush->flag & PE_BRUSH_DATA_PUFF_VOLUME;
}
- if(psys && !(psys->flag & PSYS_GLOBAL_HAIR)) {
+ if (psys && !(psys->flag & PSYS_GLOBAL_HAIR)) {
psys_mat_hair_to_global(data->ob, data->dm, psys->part->from, psys->particles + point_index, mat);
invert_m4_m4(imat,mat);
}
@@ -2873,14 +2874,14 @@ static void brush_puff(PEData *data, int point_index)
}
LOOP_KEYS {
- if(k==0) {
+ if (k==0) {
/* find root coordinate and normal on emitter */
copy_v3_v3(co, key->co);
mul_m4_v3(mat, co);
mul_v3_m4v3(kco, data->ob->imat, co); /* use 'kco' as the object space version of worldspace 'co', ob->imat is set before calling */
point_index= BLI_kdtree_find_nearest(edit->emitter_field, kco, NULL, NULL);
- if(point_index == -1) return;
+ if (point_index == -1) return;
copy_v3_v3(rootco, co);
copy_v3_v3(nor, &edit->emitter_cosnos[point_index*6+3]);
@@ -2891,7 +2892,7 @@ static void brush_puff(PEData *data, int point_index)
fac= (float)pow((double)(1.0f - data->dist / data->rad), (double)data->pufffac);
fac *= 0.025f;
- if(data->invert)
+ if (data->invert)
fac= -fac;
}
else {
@@ -2901,7 +2902,7 @@ static void brush_puff(PEData *data, int point_index)
copy_v3_v3(co, key->co);
mul_m4_v3(mat, co);
length += len_v3v3(lastco, co);
- if((data->select==0 || (key->flag & PEK_SELECT)) && !(key->flag & PEK_HIDE)) {
+ if ((data->select==0 || (key->flag & PEK_SELECT)) && !(key->flag & PEK_HIDE)) {
madd_v3_v3v3fl(kco, rootco, nor, length);
/* blend between the current and straight position */
@@ -2913,7 +2914,7 @@ static void brush_puff(PEData *data, int point_index)
mul_v3_m4v3(key->co, imat, co);
- if(puff_volume) {
+ if (puff_volume) {
/* accumulate the total distance moved to apply to unselected
* keys that come after */
ofs[0] += key->co[0] - dco[0];
@@ -2924,13 +2925,13 @@ static void brush_puff(PEData *data, int point_index)
}
else {
- if(puff_volume) {
+ if (puff_volume) {
#if 0
/* this is simple but looks bad, adds annoying kinks */
add_v3_v3(key->co, ofs);
#else
/* translate (not rotate) the rest of the hair if its not selected */
- if(ofs[0] || ofs[1] || ofs[2]) {
+ if (ofs[0] || ofs[1] || ofs[2]) {
#if 0 /* kindof works but looks worse then whats below */
/* Move the unselected point on a vector based on the
@@ -2955,7 +2956,7 @@ static void brush_puff(PEData *data, int point_index)
mul_v3_m4v3(kco, data->ob->imat, oco); /* use 'kco' as the object space version of worldspace 'co', ob->imat is set before calling */
point_index= BLI_kdtree_find_nearest(edit->emitter_field, kco, NULL, NULL);
- if(point_index != -1) {
+ if (point_index != -1) {
copy_v3_v3(onor, &edit->emitter_cosnos[point_index*6+3]);
mul_mat3_m4_v3(data->ob->obmat, onor); /* normal into worldspace */
mul_mat3_m4_v3(imat, onor); /* worldspace into particle space */
@@ -2973,7 +2974,7 @@ static void brush_puff(PEData *data, int point_index)
}
}
- if(change)
+ if (change)
point->flag |= PEP_EDIT_RECALC;
}
@@ -2981,7 +2982,7 @@ static void brush_puff(PEData *data, int point_index)
static void brush_weight(PEData *data, float UNUSED(mat[][4]), float UNUSED(imat[][4]), int point_index, int key_index, PTCacheEditKey *UNUSED(key))
{
/* roots have full weight allways */
- if(key_index) {
+ if (key_index) {
PTCacheEdit *edit = data->edit;
ParticleSystem *psys = edit->psys;
@@ -2994,7 +2995,7 @@ static void brush_weight(PEData *data, float UNUSED(mat[][4]), float UNUSED(imat
static void brush_smooth_get(PEData *data, float mat[][4], float UNUSED(imat[][4]), int UNUSED(point_index), int key_index, PTCacheEditKey *key)
{
- if(key_index) {
+ if (key_index) {
float dvec[3];
sub_v3_v3v3(dvec,key->co,(key-1)->co);
@@ -3008,7 +3009,7 @@ static void brush_smooth_do(PEData *data, float UNUSED(mat[][4]), float imat[][4
{
float vec[3], dvec[3];
- if(key_index) {
+ if (key_index) {
copy_v3_v3(vec, data->vec);
mul_mat3_m4_v3(imat,vec);
@@ -3054,16 +3055,16 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm,
float cur_d, cur_uv[2], v1[3], v2[3], v3[3], v4[3], min[3], max[3], p_min[3],p_max[3];
float cur_ipoint[3];
- if(dm == NULL){
+ if (dm == NULL) {
psys_disable_all(ob);
dm=mesh_get_derived_final(scene, ob, 0);
- if(dm == NULL)
+ if (dm == NULL)
dm=mesh_get_derived_deform(scene, ob, 0);
psys_enable_all(ob);
- if(dm == NULL)
+ if (dm == NULL)
return 0;
}
@@ -3071,12 +3072,12 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm,
DM_ensure_tessface(dm);
- if(pa_minmax==0){
+ if (pa_minmax==0) {
INIT_MINMAX(p_min,p_max);
DO_MINMAX(co1,p_min,p_max);
DO_MINMAX(co2,p_min,p_max);
}
- else{
+ else {
copy_v3_v3(p_min,pa_minmax);
copy_v3_v3(p_max,pa_minmax+3);
}
@@ -3086,51 +3087,51 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm,
mvert=dm->getVertDataArray(dm,CD_MVERT);
/* lets intersect the faces */
- for(i=0; i<totface; i++,mface++){
- if(vert_cos){
+ for (i=0; i<totface; i++,mface++) {
+ if (vert_cos) {
copy_v3_v3(v1,vert_cos+3*mface->v1);
copy_v3_v3(v2,vert_cos+3*mface->v2);
copy_v3_v3(v3,vert_cos+3*mface->v3);
- if(mface->v4)
+ if (mface->v4)
copy_v3_v3(v4,vert_cos+3*mface->v4);
}
- else{
+ else {
copy_v3_v3(v1,mvert[mface->v1].co);
copy_v3_v3(v2,mvert[mface->v2].co);
copy_v3_v3(v3,mvert[mface->v3].co);
- if(mface->v4)
+ if (mface->v4)
copy_v3_v3(v4,mvert[mface->v4].co);
}
- if(face_minmax==0){
+ if (face_minmax==0) {
INIT_MINMAX(min,max);
DO_MINMAX(v1,min,max);
DO_MINMAX(v2,min,max);
DO_MINMAX(v3,min,max);
- if(mface->v4)
- DO_MINMAX(v4,min,max)
- if(isect_aabb_aabb_v3(min,max,p_min,p_max)==0)
+ if (mface->v4)
+ DO_MINMAX(v4, min, max);
+ if (isect_aabb_aabb_v3(min,max,p_min,p_max)==0)
continue;
}
- else{
+ else {
copy_v3_v3(min, face_minmax+6*i);
copy_v3_v3(max, face_minmax+6*i+3);
- if(isect_aabb_aabb_v3(min,max,p_min,p_max)==0)
+ if (isect_aabb_aabb_v3(min,max,p_min,p_max)==0)
continue;
}
- if(radius>0.0f){
- if(isect_sweeping_sphere_tri_v3(co1, co2, radius, v2, v3, v1, &cur_d, cur_ipoint)){
- if(cur_d<*min_d){
+ if (radius>0.0f) {
+ if (isect_sweeping_sphere_tri_v3(co1, co2, radius, v2, v3, v1, &cur_d, cur_ipoint)) {
+ if (cur_d<*min_d) {
*min_d=cur_d;
copy_v3_v3(ipoint,cur_ipoint);
*min_face=i;
intersect=1;
}
}
- if(mface->v4){
- if(isect_sweeping_sphere_tri_v3(co1, co2, radius, v4, v1, v3, &cur_d, cur_ipoint)){
- if(cur_d<*min_d){
+ if (mface->v4) {
+ if (isect_sweeping_sphere_tri_v3(co1, co2, radius, v4, v1, v3, &cur_d, cur_ipoint)) {
+ if (cur_d<*min_d) {
*min_d=cur_d;
copy_v3_v3(ipoint,cur_ipoint);
*min_face=i;
@@ -3139,23 +3140,23 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm,
}
}
}
- else{
- if(isect_line_tri_v3(co1, co2, v1, v2, v3, &cur_d, cur_uv)){
- if(cur_d<*min_d){
+ else {
+ if (isect_line_tri_v3(co1, co2, v1, v2, v3, &cur_d, cur_uv)) {
+ if (cur_d<*min_d) {
*min_d=cur_d;
min_w[0]= 1.0f - cur_uv[0] - cur_uv[1];
min_w[1]= cur_uv[0];
min_w[2]= cur_uv[1];
min_w[3]= 0.0f;
- if(mface->v4)
+ if (mface->v4)
intersect_dm_quad_weights(v1, v2, v3, v4, min_w);
*min_face=i;
intersect=1;
}
}
- if(mface->v4){
- if(isect_line_tri_v3(co1, co2, v1, v3, v4, &cur_d, cur_uv)){
- if(cur_d<*min_d){
+ if (mface->v4) {
+ if (isect_line_tri_v3(co1, co2, v1, v3, v4, &cur_d, cur_uv)) {
+ if (cur_d<*min_d) {
*min_d=cur_d;
min_w[0]= 1.0f - cur_uv[0] - cur_uv[1];
min_w[1]= 0.0f;
@@ -3192,7 +3193,7 @@ static int brush_add(PEData *data, short number)
DerivedMesh *dm=0;
invert_m4_m4(imat,ob->obmat);
- if(psys->flag & PSYS_GLOBAL_HAIR)
+ if (psys->flag & PSYS_GLOBAL_HAIR)
return 0;
BLI_srandom(psys->seed+data->mval[0]+data->mval[1]);
@@ -3205,15 +3206,15 @@ static int brush_add(PEData *data, short number)
timestep= psys_get_timestep(&sim);
/* painting onto the deformed mesh, could be an option? */
- if(psmd->dm->deformedOnly)
+ if (psmd->dm->deformedOnly)
dm= psmd->dm;
else
dm= mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
- for(i=0; i<number; i++) {
- if(number>1) {
+ for (i=0; i<number; i++) {
+ if (number>1) {
dmx=dmy=size;
- while(dmx*dmx+dmy*dmy>size2) {
+ while (dmx*dmx+dmy*dmy>size2) {
dmx=(short)((2.0f*BLI_frand()-1.0f)*size);
dmy=(short)((2.0f*BLI_frand()-1.0f)*size);
}
@@ -3228,12 +3229,12 @@ static int brush_add(PEData *data, short number)
min_d=2.0;
/* warning, returns the derived mesh face */
- if(particle_intersect_dm(scene, ob,dm,0,co1,co2,&min_d,&add_pars[n].num,add_pars[n].fuv,0,0,0,0)) {
+ if (particle_intersect_dm(scene, ob,dm,0,co1,co2,&min_d,&add_pars[n].num,add_pars[n].fuv,0,0,0,0)) {
add_pars[n].num_dmcache= psys_particle_dm_face_lookup(ob,psmd->dm,add_pars[n].num,add_pars[n].fuv,NULL);
n++;
}
}
- if(n) {
+ if (n) {
int newtotpart=totpart+n;
float hairmat[4][4], cur_co[3];
KDTree *tree=0;
@@ -3247,22 +3248,22 @@ static int brush_add(PEData *data, short number)
memcpy(new_points, edit->points, totpart * sizeof(PTCacheEditPoint));
/* change old arrays to new ones */
- if(psys->particles) MEM_freeN(psys->particles);
+ if (psys->particles) MEM_freeN(psys->particles);
psys->particles= new_pars;
- if(edit->points) MEM_freeN(edit->points);
+ if (edit->points) MEM_freeN(edit->points);
edit->points= new_points;
- if(edit->mirror_cache) {
+ if (edit->mirror_cache) {
MEM_freeN(edit->mirror_cache);
edit->mirror_cache= NULL;
}
/* create tree for interpolation */
- if(pset->flag & PE_INTERPOLATE_ADDED && psys->totpart) {
+ if (pset->flag & PE_INTERPOLATE_ADDED && psys->totpart) {
tree=BLI_kdtree_new(psys->totpart);
- for(i=0, pa=psys->particles; i<totpart; i++, pa++) {
+ for (i=0, pa=psys->particles; i<totpart; i++, pa++) {
psys_particle_on_dm(psmd->dm,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,cur_co,0,0,0,0,0);
BLI_kdtree_insert(tree, i, cur_co, NULL);
}
@@ -3276,17 +3277,17 @@ static int brush_add(PEData *data, short number)
pa= psys->particles + totpart;
point= edit->points + totpart;
- for(i=totpart; i<newtotpart; i++, pa++, point++) {
+ for (i=totpart; i<newtotpart; i++, pa++, point++) {
memcpy(pa, add_pars + i - totpart, sizeof(ParticleData));
pa->hair= MEM_callocN(pset->totaddkey * sizeof(HairKey), "BakeKey key add");
key= point->keys= MEM_callocN(pset->totaddkey * sizeof(PTCacheEditKey), "PTCacheEditKey add");
point->totkey= pa->totkey= pset->totaddkey;
- for(k=0, hkey=pa->hair; k<pa->totkey; k++, hkey++, key++) {
+ for (k=0, hkey=pa->hair; k<pa->totkey; k++, hkey++, key++) {
key->co= hkey->co;
key->time= &hkey->time;
- if(!(psys->flag & PSYS_GLOBAL_HAIR))
+ if (!(psys->flag & PSYS_GLOBAL_HAIR))
key->flag |= PEK_USE_WCO;
}
@@ -3294,12 +3295,12 @@ static int brush_add(PEData *data, short number)
initialize_particle(&sim, pa,i);
reset_particle(&sim, pa, 0.0, 1.0);
point->flag |= PEP_EDIT_RECALC;
- if(pe_x_mirror(ob))
+ if (pe_x_mirror(ob))
point->flag |= PEP_TAG; /* signal for duplicate */
framestep= pa->lifetime/(float)(pset->totaddkey-1);
- if(tree) {
+ if (tree) {
ParticleData *ppa;
HairKey *thkey;
ParticleKey key3[3];
@@ -3312,20 +3313,20 @@ static int brush_add(PEData *data, short number)
maxd= ptn[maxw-1].dist;
- for(w=0; w<maxw; w++) {
+ for (w=0; w<maxw; w++) {
weight[w]= (float)pow(2.0, (double)(-6.0f * ptn[w].dist / maxd));
totw += weight[w];
}
- for(;w<3; w++) {
+ for (;w<3; w++) {
weight[w]= 0.0f;
}
- for(w=0; w<maxw; w++)
+ for (w=0; w<maxw; w++)
weight[w] /= totw;
ppa= psys->particles+ptn[0].index;
- for(k=0; k<pset->totaddkey; k++) {
+ for (k=0; k<pset->totaddkey; k++) {
thkey= (HairKey*)pa->hair + k;
thkey->time= pa->time + k * framestep;
@@ -3336,13 +3337,13 @@ static int brush_add(PEData *data, short number)
/* TODO: interpolatint the weight would be nicer */
thkey->weight= (ppa->hair+MIN2(k, ppa->totkey-1))->weight;
- if(maxw>1) {
+ if (maxw>1) {
key3[1].time= key3[0].time;
psys_get_particle_on_path(&sim, ptn[1].index, &key3[1], 0);
mul_v3_fl(key3[1].co, weight[1]);
add_v3_v3(key3[0].co, key3[1].co);
- if(maxw>2) {
+ if (maxw>2) {
key3[2].time= key3[0].time;
psys_get_particle_on_path(&sim, ptn[2].index, &key3[2], 0);
mul_v3_fl(key3[2].co, weight[2]);
@@ -3350,7 +3351,7 @@ static int brush_add(PEData *data, short number)
}
}
- if(k==0)
+ if (k==0)
sub_v3_v3v3(co1, pa->state.co, key3[0].co);
add_v3_v3v3(thkey->co, key3[0].co, co1);
@@ -3359,26 +3360,26 @@ static int brush_add(PEData *data, short number)
}
}
else {
- for(k=0, hkey=pa->hair; k<pset->totaddkey; k++, hkey++) {
+ for (k=0, hkey=pa->hair; k<pset->totaddkey; k++, hkey++) {
madd_v3_v3v3fl(hkey->co, pa->state.co, pa->state.vel, k * framestep * timestep);
hkey->time += k * framestep;
hkey->weight = 1.f - (float)k/(float)(pset->totaddkey-1);
}
}
- for(k=0, hkey=pa->hair; k<pset->totaddkey; k++, hkey++) {
+ for (k=0, hkey=pa->hair; k<pset->totaddkey; k++, hkey++) {
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
invert_m4_m4(imat,hairmat);
mul_m4_v3(imat, hkey->co);
}
}
- if(tree)
+ if (tree)
BLI_kdtree_free(tree);
}
- if(add_pars)
+ if (add_pars)
MEM_freeN(add_pars);
- if(!psmd->dm->deformedOnly)
+ if (!psmd->dm->deformedOnly)
dm->release(dm);
return n;
@@ -3407,7 +3408,7 @@ static int brush_edit_init(bContext *C, wmOperator *op)
ARegion *ar= CTX_wm_region(C);
BrushEdit *bedit;
- if(pset->brushtype < 0)
+ if (pset->brushtype < 0)
return 0;
initgrabz(ar->regiondata, ob->obmat[3][0], ob->obmat[3][1], ob->obmat[3][2]);
@@ -3442,7 +3443,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
float dx, dy, dmax;
int lock_root = pset->flag & PE_LOCK_FIRST;
- if(!PE_start_edit(edit))
+ if (!PE_start_edit(edit))
return;
RNA_float_get_array(itemptr, "mouse", mousef);
@@ -3450,7 +3451,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
mouse[1] = mousef[1];
flip= RNA_boolean_get(itemptr, "pen_flip");
- if(bedit->first) {
+ if (bedit->first) {
bedit->lastmouse[0]= mouse[0];
bedit->lastmouse[1]= mouse[1];
}
@@ -3463,10 +3464,10 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
/* disable locking temporatily for disconnected hair */
- if(edit->psys && edit->psys->flag & PSYS_GLOBAL_HAIR)
+ if (edit->psys && edit->psys->flag & PSYS_GLOBAL_HAIR)
pset->flag &= ~PE_LOCK_FIRST;
- if(((pset->brushtype == PE_BRUSH_ADD) ?
+ if (((pset->brushtype == PE_BRUSH_ADD) ?
(sqrt(dx * dx + dy * dy) > pset->brush[PE_BRUSH_ADD].step) : (dx != 0 || dy != 0))
|| bedit->first) {
PEData data= bedit->data;
@@ -3480,7 +3481,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
dx /= (float)tot_steps;
dy /= (float)tot_steps;
- for(step = 1; step<=tot_steps; step++) {
+ for (step = 1; step<=tot_steps; step++) {
mval[0] = bedit->lastmouse[0] + step*dx;
mval[1] = bedit->lastmouse[1] + step*dy;
@@ -3492,7 +3493,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
data.rad= (float)brush->size;
data.combfac= (brush->strength - 0.5f) * 2.0f;
- if(data.combfac < 0.0f)
+ if (data.combfac < 0.0f)
data.combfac= 1.0f - 9.0f * data.combfac;
else
data.combfac= 1.0f - data.combfac;
@@ -3509,18 +3510,18 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
}
case PE_BRUSH_CUT:
{
- if(edit->psys && edit->pathcache) {
+ if (edit->psys && edit->pathcache) {
data.mval= mval;
data.rad= (float)brush->size;
data.cutfac= brush->strength;
- if(selected)
+ if (selected)
foreach_selected_point(&data, brush_cut);
else
foreach_point(&data, brush_cut);
removed= remove_tagged_particles(ob, edit->psys, pe_x_mirror(ob));
- if(pset->flag & PE_KEEP_LENGTHS)
+ if (pset->flag & PE_KEEP_LENGTHS)
recalc_lengths(edit);
}
else
@@ -3535,27 +3536,27 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
data.rad= (float)brush->size;
data.growfac= brush->strength / 50.0f;
- if(brush->invert ^ flip)
+ if (brush->invert ^ flip)
data.growfac= 1.0f - data.growfac;
else
data.growfac= 1.0f + data.growfac;
foreach_mouse_hit_point(&data, brush_length, selected);
- if(pset->flag & PE_KEEP_LENGTHS)
+ if (pset->flag & PE_KEEP_LENGTHS)
recalc_lengths(edit);
break;
}
case PE_BRUSH_PUFF:
{
- if(edit->psys) {
+ if (edit->psys) {
data.dm= psmd->dm;
data.mval= mval;
data.rad= (float)brush->size;
data.select= selected;
data.pufffac= (brush->strength - 0.5f) * 2.0f;
- if(data.pufffac < 0.0f)
+ if (data.pufffac < 0.0f)
data.pufffac= 1.0f - 9.0f * data.pufffac;
else
data.pufffac= 1.0f - data.pufffac;
@@ -3569,12 +3570,12 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
}
case PE_BRUSH_ADD:
{
- if(edit->psys && edit->psys->part->from==PART_FROM_FACE) {
+ if (edit->psys && edit->psys->part->from==PART_FROM_FACE) {
data.mval= mval;
added= brush_add(&data, brush->count);
- if(pset->flag & PE_KEEP_LENGTHS)
+ if (pset->flag & PE_KEEP_LENGTHS)
recalc_lengths(edit);
}
else
@@ -3595,7 +3596,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
foreach_mouse_hit_key(&data, brush_smooth_get, selected);
- if(data.tot) {
+ if (data.tot) {
mul_v3_fl(data.vec, 1.0f / (float)data.tot);
foreach_mouse_hit_key(&data, brush_smooth_do, selected);
}
@@ -3604,7 +3605,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
}
case PE_BRUSH_WEIGHT:
{
- if(edit->psys) {
+ if (edit->psys) {
data.dm= psmd->dm;
data.mval= mval;
data.rad= (float)brush->size;
@@ -3617,11 +3618,11 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
break;
}
}
- if((pset->flag & PE_KEEP_LENGTHS)==0)
+ if ((pset->flag & PE_KEEP_LENGTHS)==0)
recalc_lengths(edit);
- if(ELEM(pset->brushtype, PE_BRUSH_ADD, PE_BRUSH_CUT) && (added || removed)) {
- if(pset->brushtype == PE_BRUSH_ADD && pe_x_mirror(ob))
+ if (ELEM(pset->brushtype, PE_BRUSH_ADD, PE_BRUSH_CUT) && (added || removed)) {
+ if (pset->brushtype == PE_BRUSH_ADD && pe_x_mirror(ob))
PE_mirror_x(scene, ob, 1);
update_world_cos(ob,edit);
@@ -3632,10 +3633,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);
}
@@ -3657,7 +3658,7 @@ static void brush_edit_exit(wmOperator *op)
static int brush_edit_exec(bContext *C, wmOperator *op)
{
- if(!brush_edit_init(C, op))
+ if (!brush_edit_init(C, op))
return OPERATOR_CANCELLED;
RNA_BEGIN(op->ptr, itemptr, "stroke") {
@@ -3689,7 +3690,7 @@ static void brush_edit_apply_event(bContext *C, wmOperator *op, wmEvent *event)
static int brush_edit_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if(!brush_edit_init(C, op))
+ if (!brush_edit_init(C, op))
return OPERATOR_CANCELLED;
brush_edit_apply_event(C, op, event);
@@ -3725,18 +3726,18 @@ static int brush_edit_cancel(bContext *UNUSED(C), wmOperator *op)
void PARTICLE_OT_brush_edit(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Brush Edit";
- ot->idname= "PARTICLE_OT_brush_edit";
+ ot->name = "Brush Edit";
+ ot->idname = "PARTICLE_OT_brush_edit";
/* api callbacks */
- ot->exec= brush_edit_exec;
- ot->invoke= brush_edit_invoke;
- ot->modal= brush_edit_modal;
- ot->cancel= brush_edit_cancel;
- ot->poll= PE_poll_view3d;
+ ot->exec = brush_edit_exec;
+ ot->invoke = brush_edit_invoke;
+ ot->modal = brush_edit_modal;
+ ot->cancel = brush_edit_cancel;
+ ot->poll = PE_poll_view3d;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
/* properties */
RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
@@ -3749,16 +3750,16 @@ static void free_PTCacheUndo(PTCacheUndo *undo)
PTCacheEditPoint *point;
int i;
- for(i=0, point=undo->points; i<undo->totpoint; i++, point++) {
- if(undo->particles && (undo->particles + i)->hair)
+ for (i=0, point=undo->points; i<undo->totpoint; i++, point++) {
+ if (undo->particles && (undo->particles + i)->hair)
MEM_freeN((undo->particles + i)->hair);
- if(point->keys)
+ if (point->keys)
MEM_freeN(point->keys);
}
- if(undo->points)
+ if (undo->points)
MEM_freeN(undo->points);
- if(undo->particles)
+ if (undo->particles)
MEM_freeN(undo->particles);
BKE_ptcache_free_mem(&undo->mem_cache);
@@ -3771,12 +3772,12 @@ static void make_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo)
undo->totpoint= edit->totpoint;
- if(edit->psys) {
+ if (edit->psys) {
ParticleData *pa;
pa= undo->particles= MEM_dupallocN(edit->psys->particles);
- for(i=0; i<edit->totpoint; i++, pa++)
+ for (i=0; i<edit->totpoint; i++, pa++)
pa->hair= MEM_dupallocN(pa->hair);
undo->psys_flag = edit->psys->flag;
@@ -3787,8 +3788,8 @@ static void make_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo)
BLI_duplicatelist(&undo->mem_cache, &edit->pid.cache->mem_cache);
pm = undo->mem_cache.first;
- for(; pm; pm=pm->next) {
- for(i=0; i<BPHYS_TOT_DATA; i++)
+ for (; pm; pm=pm->next) {
+ for (i=0; i<BPHYS_TOT_DATA; i++)
pm->data[i] = MEM_dupallocN(pm->data[i]);
}
}
@@ -3796,7 +3797,7 @@ static void make_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo)
point= undo->points = MEM_dupallocN(edit->points);
undo->totpoint = edit->totpoint;
- for(i=0; i<edit->totpoint; i++, point++) {
+ for (i=0; i<edit->totpoint; i++, point++) {
point->keys= MEM_dupallocN(point->keys);
/* no need to update edit key->co & key->time pointers here */
}
@@ -3810,17 +3811,17 @@ static void get_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo)
POINT_P; KEY_K;
LOOP_POINTS {
- if(psys && psys->particles[p].hair)
+ if (psys && psys->particles[p].hair)
MEM_freeN(psys->particles[p].hair);
- if(point->keys)
+ if (point->keys)
MEM_freeN(point->keys);
}
- if(psys && psys->particles)
+ if (psys && psys->particles)
MEM_freeN(psys->particles);
- if(edit->points)
+ if (edit->points)
MEM_freeN(edit->points);
- if(edit->mirror_cache) {
+ if (edit->mirror_cache) {
MEM_freeN(edit->mirror_cache);
edit->mirror_cache= NULL;
}
@@ -3832,7 +3833,7 @@ static void get_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo)
point->keys= MEM_dupallocN(point->keys);
}
- if(psys) {
+ if (psys) {
psys->particles= MEM_dupallocN(undo->particles);
psys->totpart= undo->totpoint;
@@ -3860,15 +3861,15 @@ static void get_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo)
pm = edit->pid.cache->mem_cache.first;
- for(; pm; pm=pm->next) {
- for(i=0; i<BPHYS_TOT_DATA; i++)
+ for (; pm; pm=pm->next) {
+ for (i=0; i<BPHYS_TOT_DATA; i++)
pm->data[i] = MEM_dupallocN(pm->data[i]);
BKE_ptcache_mem_pointers_init(pm);
LOOP_POINTS {
LOOP_KEYS {
- if((int)key->ftime == (int)pm->frame) {
+ if ((int)key->ftime == (int)pm->frame) {
key->co = pm->cur[BPHYS_DATA_LOCATION];
key->vel = pm->cur[BPHYS_DATA_VELOCITY];
key->rot = pm->cur[BPHYS_DATA_ROTATION];
@@ -3887,10 +3888,10 @@ void PE_undo_push(Scene *scene, const char *str)
PTCacheUndo *undo;
int nr;
- if(!edit) return;
+ if (!edit) return;
/* remove all undos after (also when curundo==NULL) */
- while(edit->undo.last != edit->curundo) {
+ while (edit->undo.last != edit->curundo) {
undo= edit->undo.last;
BLI_remlink(&edit->undo, undo);
free_PTCacheUndo(undo);
@@ -3905,13 +3906,13 @@ void PE_undo_push(Scene *scene, const char *str)
/* and limit amount to the maximum */
nr= 0;
undo= edit->undo.last;
- while(undo) {
+ while (undo) {
nr++;
- if(nr==U.undosteps) break;
+ if (nr==U.undosteps) break;
undo= undo->prev;
}
- if(undo) {
- while(edit->undo.first!=undo) {
+ if (undo) {
+ while (edit->undo.first!=undo) {
PTCacheUndo *first= edit->undo.first;
BLI_remlink(&edit->undo, first);
free_PTCacheUndo(first);
@@ -3927,16 +3928,16 @@ void PE_undo_step(Scene *scene, int step)
{
PTCacheEdit *edit= PE_get_current(scene, OBACT);
- if(!edit) return;
+ if (!edit) return;
- if(step==0) {
+ if (step==0) {
get_PTCacheUndo(edit,edit->curundo);
}
- else if(step==1) {
+ else if (step==1) {
- if(edit->curundo==NULL || edit->curundo->prev==NULL);
+ if (edit->curundo==NULL || edit->curundo->prev==NULL);
else {
- if(G.f & G_DEBUG) printf("undo %s\n", edit->curundo->name);
+ if (G.debug & G_DEBUG) printf("undo %s\n", edit->curundo->name);
edit->curundo= edit->curundo->prev;
get_PTCacheUndo(edit, edit->curundo);
}
@@ -3944,11 +3945,11 @@ void PE_undo_step(Scene *scene, int step)
else {
/* curundo has to remain current situation! */
- if(edit->curundo==NULL || edit->curundo->next==NULL);
+ if (edit->curundo==NULL || edit->curundo->next==NULL);
else {
get_PTCacheUndo(edit, edit->curundo->next);
edit->curundo= edit->curundo->next;
- if(G.f & G_DEBUG) printf("redo %s\n", edit->curundo->name);
+ if (G.debug & G_DEBUG) printf("redo %s\n", edit->curundo->name);
}
}
@@ -3959,7 +3960,7 @@ int PE_undo_valid(Scene *scene)
{
PTCacheEdit *edit= PE_get_current(scene, OBACT);
- if(edit) {
+ if (edit) {
return (edit->undo.last != edit->undo.first);
}
return 0;
@@ -3969,10 +3970,10 @@ static void PTCacheUndo_clear(PTCacheEdit *edit)
{
PTCacheUndo *undo;
- if(edit==NULL) return;
+ if (edit==NULL) return;
undo= edit->undo.first;
- while(undo) {
+ while (undo) {
free_PTCacheUndo(undo);
undo= undo->next;
}
@@ -3996,8 +3997,8 @@ void PE_undo_number(Scene *scene, int nr)
PTCacheUndo *undo;
int a=0;
- for(undo= edit->undo.first; undo; undo= undo->next, a++) {
- if(a==nr) break;
+ for (undo= edit->undo.first; undo; undo= undo->next, a++) {
+ if (a==nr) break;
}
edit->curundo= undo;
PE_undo_step(scene, 0);
@@ -4011,12 +4012,12 @@ const char *PE_undo_get_name(Scene *scene, int nr, int *active)
PTCacheEdit *edit= PE_get_current(scene, OBACT);
PTCacheUndo *undo;
- if(active) *active= 0;
+ if (active) *active= 0;
- if(edit) {
+ if (edit) {
undo= BLI_findlink(&edit->undo, nr);
- if(undo) {
- if(active && undo==edit->curundo)
+ if (undo) {
+ if (active && undo==edit->curundo)
*active= 1;
return undo->name;
}
@@ -4036,15 +4037,15 @@ int PE_minmax(Scene *scene, float min[3], float max[3])
float co[3], mat[4][4];
int ok= 0;
- if(!edit) return ok;
+ if (!edit) return ok;
- if((psys = edit->psys))
+ if ((psys = edit->psys))
psmd= psys_get_modifier(ob, psys);
else
unit_m4(mat);
LOOP_VISIBLE_POINTS {
- if(psys)
+ if (psys)
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles+p, mat);
LOOP_SELECTED_KEYS {
@@ -4055,7 +4056,7 @@ int PE_minmax(Scene *scene, float min[3], float max[3])
}
}
- if(!ok) {
+ if (!ok) {
minmax_object(ob, min, max);
ok= 1;
}
@@ -4076,23 +4077,23 @@ static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache,
int totpoint;
/* no psmd->dm happens in case particle system modifier is not enabled */
- if(!(psys && psmd && psmd->dm) && !cache)
+ if (!(psys && psmd && psmd->dm) && !cache)
return;
- if(cache && cache->flag & PTCACHE_DISK_CACHE)
+ if (cache && cache->flag & PTCACHE_DISK_CACHE)
return;
- if(psys == NULL && cache->mem_cache.first == NULL)
+ if (psys == NULL && cache->mem_cache.first == NULL)
return;
- if(!edit) {
+ if (!edit) {
totpoint = psys ? psys->totpart : (int)((PTCacheMem*)cache->mem_cache.first)->totpoint;
edit= MEM_callocN(sizeof(PTCacheEdit), "PE_create_particle_edit");
edit->points=MEM_callocN(totpoint*sizeof(PTCacheEditPoint),"PTCacheEditPoints");
edit->totpoint = totpoint;
- if(psys && !cache) {
+ if (psys && !cache) {
psys->edit= edit;
edit->psys = psys;
@@ -4112,7 +4113,7 @@ static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache,
key->co= hkey->co;
key->time= &hkey->time;
key->flag= hkey->editflag;
- if(!(psys->flag & PSYS_GLOBAL_HAIR)) {
+ if (!(psys->flag & PSYS_GLOBAL_HAIR)) {
key->flag |= PEK_USE_WCO;
hkey->editflag |= PEK_USE_WCO;
}
@@ -4131,15 +4132,15 @@ static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache,
cache->free_edit= PE_free_ptcache_edit;
edit->psys = NULL;
- for(pm=cache->mem_cache.first; pm; pm=pm->next)
+ for (pm=cache->mem_cache.first; pm; pm=pm->next)
totframe++;
- for(pm=cache->mem_cache.first; pm; pm=pm->next) {
+ for (pm=cache->mem_cache.first; pm; pm=pm->next) {
LOOP_POINTS {
- if(BKE_ptcache_mem_pointers_seek(p, pm) == 0)
+ if (BKE_ptcache_mem_pointers_seek(p, pm) == 0)
continue;
- if(!point->totkey) {
+ if (!point->totkey) {
key = point->keys = MEM_callocN(totframe*sizeof(PTCacheEditKey),"ParticleEditKeys");
point->flag |= PEP_EDIT_RECALC;
}
@@ -4163,7 +4164,7 @@ static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache,
UI_GetThemeColor3ubv(TH_WIRE, edit->nosel_col);
recalc_lengths(edit);
- if(psys && !cache)
+ if (psys && !cache)
recalc_emitter_field(ob, psys);
PE_update_object(scene, ob, 1);
@@ -4177,7 +4178,7 @@ static int particle_edit_toggle_poll(bContext *C)
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- if(!scene || !ob || ob->id.lib)
+ if (!scene || !ob || ob->id.lib)
return 0;
return (ob->particlesystem.first || modifiers_findByType(ob, eModifierType_Cloth) || modifiers_findByType(ob, eModifierType_Softbody));
@@ -4188,14 +4189,14 @@ static int particle_edit_toggle_exec(bContext *C, wmOperator *UNUSED(op))
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- if(!(ob->mode & OB_MODE_PARTICLE_EDIT)) {
+ if (!(ob->mode & OB_MODE_PARTICLE_EDIT)) {
PTCacheEdit *edit;
ob->mode |= OB_MODE_PARTICLE_EDIT;
edit= PE_create_current(scene, ob);
/* mesh may have changed since last entering editmode.
* note, this may have run before if the edit data was just created, so could avoid this and speed up a little */
- if(edit && edit->psys)
+ if (edit && edit->psys)
recalc_emitter_field(ob, edit->psys);
toggle_particle_cursor(C, 1);
@@ -4215,15 +4216,15 @@ static int particle_edit_toggle_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_particle_edit_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Particle Edit Toggle";
- ot->idname= "PARTICLE_OT_particle_edit_toggle";
+ ot->name = "Particle Edit Toggle";
+ ot->idname = "PARTICLE_OT_particle_edit_toggle";
/* api callbacks */
- ot->exec= particle_edit_toggle_exec;
- ot->poll= particle_edit_toggle_poll;
+ ot->exec = particle_edit_toggle_exec;
+ ot->poll = particle_edit_toggle_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -4234,8 +4235,8 @@ static int clear_edited_exec(bContext *C, wmOperator *UNUSED(op))
Object *ob= CTX_data_active_object(C);
ParticleSystem *psys = psys_get_current(ob);
- if(psys->edit) {
- if(psys->edit->edited || 1) { // XXX okee("Lose changes done in particle mode?"))
+ if (psys->edit) {
+ if (psys->edit->edited || 1) { // XXX okee("Lose changes done in particle mode?"))
PE_free_ptcache_edit(psys->edit);
psys->edit = NULL;
@@ -4264,14 +4265,14 @@ static int clear_edited_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_edited_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Edited";
- ot->idname= "PARTICLE_OT_edited_clear";
+ ot->name = "Clear Edited";
+ ot->idname = "PARTICLE_OT_edited_clear";
/* api callbacks */
- ot->exec= clear_edited_exec;
- ot->poll= particle_edit_toggle_poll;
+ ot->exec = clear_edited_exec;
+ ot->poll = particle_edit_toggle_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index da3f7e1f7c1..3d50ec26a40 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -70,7 +70,7 @@ static int particle_system_add_exec(bContext *C, wmOperator *UNUSED(op))
Object *ob= ED_object_context(C);
Scene *scene = CTX_data_scene(C);
- if(!scene || !ob)
+ if (!scene || !ob)
return OPERATOR_CANCELLED;
object_add_particle_system(scene, ob, NULL);
@@ -84,16 +84,16 @@ static int particle_system_add_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_particle_system_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Particle System Slot";
- ot->idname= "OBJECT_OT_particle_system_add";
- ot->description="Add a particle system";
+ ot->name = "Add Particle System Slot";
+ ot->idname = "OBJECT_OT_particle_system_add";
+ ot->description = "Add a particle system";
/* api callbacks */
- ot->poll= ED_operator_object_active_editable;
- ot->exec= particle_system_add_exec;
+ ot->poll = ED_operator_object_active_editable;
+ ot->exec = particle_system_add_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int particle_system_remove_exec(bContext *C, wmOperator *UNUSED(op))
@@ -101,7 +101,7 @@ static int particle_system_remove_exec(bContext *C, wmOperator *UNUSED(op))
Object *ob= ED_object_context(C);
Scene *scene = CTX_data_scene(C);
int mode_orig = ob->mode;
- if(!scene || !ob)
+ if (!scene || !ob)
return OPERATOR_CANCELLED;
object_remove_particle_system(scene, ob);
@@ -109,9 +109,9 @@ static int particle_system_remove_exec(bContext *C, wmOperator *UNUSED(op))
/* possible this isn't the active object
* object_remove_particle_system() clears the mode on the last psys
* */
- if(mode_orig & OB_MODE_PARTICLE_EDIT)
- if((ob->mode & OB_MODE_PARTICLE_EDIT)==0)
- if(scene->basact && scene->basact->object==ob)
+ if (mode_orig & OB_MODE_PARTICLE_EDIT)
+ if ((ob->mode & OB_MODE_PARTICLE_EDIT)==0)
+ if (scene->basact && scene->basact->object==ob)
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, NULL);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob);
@@ -123,16 +123,16 @@ static int particle_system_remove_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_particle_system_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Particle System Slot";
- ot->idname= "OBJECT_OT_particle_system_remove";
- ot->description="Remove the selected particle system";
+ ot->name = "Remove Particle System Slot";
+ ot->idname = "OBJECT_OT_particle_system_remove";
+ ot->description = "Remove the selected particle system";
/* api callbacks */
- ot->poll= ED_operator_object_active_editable;
- ot->exec= particle_system_remove_exec;
+ ot->poll = ED_operator_object_active_editable;
+ ot->exec = particle_system_remove_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** new particle settings operator *********************/
@@ -157,14 +157,14 @@ static int new_particle_settings_exec(bContext *C, wmOperator *UNUSED(op))
psys = ptr.data;
/* add or copy particle setting */
- if(psys->part)
+ if (psys->part)
part= psys_copy_settings(psys->part);
else
part= psys_new_settings("ParticleSettings", bmain);
ob= ptr.id.data;
- if(psys->part)
+ if (psys->part)
psys->part->id.us--;
psys->part = part;
@@ -182,16 +182,16 @@ static int new_particle_settings_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_new(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "New Particle Settings";
- ot->idname= "PARTICLE_OT_new";
- ot->description="Add new particle settings";
+ ot->name = "New Particle Settings";
+ ot->idname = "PARTICLE_OT_new";
+ ot->description = "Add new particle settings";
/* api callbacks */
- ot->exec= new_particle_settings_exec;
- ot->poll= psys_poll;
+ ot->exec = new_particle_settings_exec;
+ ot->poll = psys_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** keyed particle target operators *********************/
@@ -206,11 +206,11 @@ static int new_particle_target_exec(bContext *C, wmOperator *UNUSED(op))
ParticleTarget *pt;
- if(!psys)
+ if (!psys)
return OPERATOR_CANCELLED;
pt = psys->targets.first;
- for(; pt; pt=pt->next)
+ for (; pt; pt=pt->next)
pt->flag &= ~PTARGET_CURRENT;
pt = MEM_callocN(sizeof(ParticleTarget), "keyed particle target");
@@ -231,15 +231,15 @@ static int new_particle_target_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_new_target(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "New Particle Target";
- ot->idname= "PARTICLE_OT_new_target";
- ot->description="Add a new particle target";
+ ot->name = "New Particle Target";
+ ot->idname = "PARTICLE_OT_new_target";
+ ot->description = "Add a new particle target";
/* api callbacks */
- ot->exec= new_particle_target_exec;
+ ot->exec = new_particle_target_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int remove_particle_target_exec(bContext *C, wmOperator *UNUSED(op))
@@ -252,12 +252,12 @@ static int remove_particle_target_exec(bContext *C, wmOperator *UNUSED(op))
ParticleTarget *pt;
- if(!psys)
+ if (!psys)
return OPERATOR_CANCELLED;
pt = psys->targets.first;
- for(; pt; pt=pt->next) {
- if(pt->flag & PTARGET_CURRENT) {
+ for (; pt; pt=pt->next) {
+ if (pt->flag & PTARGET_CURRENT) {
BLI_remlink(&psys->targets, pt);
MEM_freeN(pt);
break;
@@ -266,7 +266,7 @@ static int remove_particle_target_exec(bContext *C, wmOperator *UNUSED(op))
}
pt = psys->targets.last;
- if(pt)
+ if (pt)
pt->flag |= PTARGET_CURRENT;
DAG_scene_sort(bmain, scene);
@@ -280,15 +280,15 @@ static int remove_particle_target_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_target_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Particle Target";
- ot->idname= "PARTICLE_OT_target_remove";
- ot->description="Remove the selected particle target";
+ ot->name = "Remove Particle Target";
+ ot->idname = "PARTICLE_OT_target_remove";
+ ot->description = "Remove the selected particle target";
/* api callbacks */
- ot->exec= remove_particle_target_exec;
+ ot->exec = remove_particle_target_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ move up particle target operator *********************/
@@ -300,12 +300,12 @@ static int target_move_up_exec(bContext *C, wmOperator *UNUSED(op))
Object *ob = ptr.id.data;
ParticleTarget *pt;
- if(!psys)
+ if (!psys)
return OPERATOR_CANCELLED;
pt = psys->targets.first;
- for(; pt; pt=pt->next) {
- if(pt->flag & PTARGET_CURRENT && pt->prev) {
+ for (; pt; pt=pt->next) {
+ if (pt->flag & PTARGET_CURRENT && pt->prev) {
BLI_remlink(&psys->targets, pt);
BLI_insertlink(&psys->targets, pt->prev->prev, pt);
@@ -320,14 +320,14 @@ static int target_move_up_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_target_move_up(wmOperatorType *ot)
{
- ot->name= "Move Up Target";
- ot->idname= "PARTICLE_OT_target_move_up";
- ot->description= "Move particle target up in the list";
+ ot->name = "Move Up Target";
+ ot->idname = "PARTICLE_OT_target_move_up";
+ ot->description = "Move particle target up in the list";
- ot->exec= target_move_up_exec;
+ ot->exec = target_move_up_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ move down particle target operator *********************/
@@ -339,11 +339,11 @@ static int target_move_down_exec(bContext *C, wmOperator *UNUSED(op))
Object *ob = ptr.id.data;
ParticleTarget *pt;
- if(!psys)
+ if (!psys)
return OPERATOR_CANCELLED;
pt = psys->targets.first;
- for(; pt; pt=pt->next) {
- if(pt->flag & PTARGET_CURRENT && pt->next) {
+ for (; pt; pt=pt->next) {
+ if (pt->flag & PTARGET_CURRENT && pt->next) {
BLI_remlink(&psys->targets, pt);
BLI_insertlink(&psys->targets, pt->next, pt);
@@ -358,14 +358,14 @@ static int target_move_down_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_target_move_down(wmOperatorType *ot)
{
- ot->name= "Move Down Target";
- ot->idname= "PARTICLE_OT_target_move_down";
- ot->description= "Move particle target down in the list";
+ ot->name = "Move Down Target";
+ ot->idname = "PARTICLE_OT_target_move_down";
+ ot->description = "Move particle target down in the list";
- ot->exec= target_move_down_exec;
+ ot->exec = target_move_down_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ move up particle dupliweight operator *********************/
@@ -377,12 +377,12 @@ static int dupliob_move_up_exec(bContext *C, wmOperator *UNUSED(op))
ParticleSettings *part;
ParticleDupliWeight *dw;
- if(!psys)
+ if (!psys)
return OPERATOR_CANCELLED;
part = psys->part;
- for(dw=part->dupliweights.first; dw; dw=dw->next) {
- if(dw->flag & PART_DUPLIW_CURRENT && dw->prev) {
+ for (dw=part->dupliweights.first; dw; dw=dw->next) {
+ if (dw->flag & PART_DUPLIW_CURRENT && dw->prev) {
BLI_remlink(&part->dupliweights, dw);
BLI_insertlink(&part->dupliweights, dw->prev->prev, dw);
@@ -396,14 +396,14 @@ static int dupliob_move_up_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_dupliob_move_up(wmOperatorType *ot)
{
- ot->name= "Move Up Dupli Object";
- ot->idname= "PARTICLE_OT_dupliob_move_up";
- ot->description= "Move dupli object up in the list";
+ ot->name = "Move Up Dupli Object";
+ ot->idname = "PARTICLE_OT_dupliob_move_up";
+ ot->description = "Move dupli object up in the list";
- ot->exec= dupliob_move_up_exec;
+ ot->exec = dupliob_move_up_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** particle dupliweight operators *********************/
@@ -415,11 +415,11 @@ static int copy_particle_dupliob_exec(bContext *C, wmOperator *UNUSED(op))
ParticleSettings *part;
ParticleDupliWeight *dw;
- if(!psys)
+ if (!psys)
return OPERATOR_CANCELLED;
part = psys->part;
- for(dw=part->dupliweights.first; dw; dw=dw->next) {
- if(dw->flag & PART_DUPLIW_CURRENT) {
+ for (dw=part->dupliweights.first; dw; dw=dw->next) {
+ if (dw->flag & PART_DUPLIW_CURRENT) {
dw->flag &= ~PART_DUPLIW_CURRENT;
dw = MEM_dupallocN(dw);
dw->flag |= PART_DUPLIW_CURRENT;
@@ -436,15 +436,15 @@ static int copy_particle_dupliob_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_dupliob_copy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Particle Dupliob";
- ot->idname= "PARTICLE_OT_dupliob_copy";
- ot->description="Duplicate the current dupliobject";
+ ot->name = "Copy Particle Dupliob";
+ ot->idname = "PARTICLE_OT_dupliob_copy";
+ ot->description = "Duplicate the current dupliobject";
/* api callbacks */
- ot->exec= copy_particle_dupliob_exec;
+ ot->exec = copy_particle_dupliob_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int remove_particle_dupliob_exec(bContext *C, wmOperator *UNUSED(op))
@@ -454,12 +454,12 @@ static int remove_particle_dupliob_exec(bContext *C, wmOperator *UNUSED(op))
ParticleSettings *part;
ParticleDupliWeight *dw;
- if(!psys)
+ if (!psys)
return OPERATOR_CANCELLED;
part = psys->part;
- for(dw=part->dupliweights.first; dw; dw=dw->next) {
- if(dw->flag & PART_DUPLIW_CURRENT) {
+ for (dw=part->dupliweights.first; dw; dw=dw->next) {
+ if (dw->flag & PART_DUPLIW_CURRENT) {
BLI_remlink(&part->dupliweights, dw);
MEM_freeN(dw);
break;
@@ -468,7 +468,7 @@ static int remove_particle_dupliob_exec(bContext *C, wmOperator *UNUSED(op))
}
dw = part->dupliweights.last;
- if(dw)
+ if (dw)
dw->flag |= PART_DUPLIW_CURRENT;
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, NULL);
@@ -479,15 +479,15 @@ static int remove_particle_dupliob_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_dupliob_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Particle Dupliobject";
- ot->idname= "PARTICLE_OT_dupliob_remove";
- ot->description="Remove the selected dupliobject";
+ ot->name = "Remove Particle Dupliobject";
+ ot->idname = "PARTICLE_OT_dupliob_remove";
+ ot->description = "Remove the selected dupliobject";
/* api callbacks */
- ot->exec= remove_particle_dupliob_exec;
+ ot->exec = remove_particle_dupliob_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ move down particle dupliweight operator *********************/
@@ -499,12 +499,12 @@ static int dupliob_move_down_exec(bContext *C, wmOperator *UNUSED(op))
ParticleSettings *part;
ParticleDupliWeight *dw;
- if(!psys)
+ if (!psys)
return OPERATOR_CANCELLED;
part = psys->part;
- for(dw=part->dupliweights.first; dw; dw=dw->next) {
- if(dw->flag & PART_DUPLIW_CURRENT && dw->next) {
+ for (dw=part->dupliweights.first; dw; dw=dw->next) {
+ if (dw->flag & PART_DUPLIW_CURRENT && dw->next) {
BLI_remlink(&part->dupliweights, dw);
BLI_insertlink(&part->dupliweights, dw->next, dw);
@@ -518,14 +518,14 @@ static int dupliob_move_down_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_dupliob_move_down(wmOperatorType *ot)
{
- ot->name= "Move Down Dupli Object";
- ot->idname= "PARTICLE_OT_dupliob_move_down";
- ot->description= "Move dupli object down in the list";
+ ot->name = "Move Down Dupli Object";
+ ot->idname = "PARTICLE_OT_dupliob_move_down";
+ ot->description = "Move dupli object down in the list";
- ot->exec= dupliob_move_down_exec;
+ ot->exec = dupliob_move_down_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ connect/disconnect hair operators *********************/
@@ -542,27 +542,27 @@ static void disconnect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
int i, k;
float hairmat[4][4];
- if(!ob || !psys || psys->flag & PSYS_GLOBAL_HAIR)
+ if (!ob || !psys || psys->flag & PSYS_GLOBAL_HAIR)
return;
- if(!psys->part || psys->part->type != PART_HAIR)
+ if (!psys->part || psys->part->type != PART_HAIR)
return;
edit = psys->edit;
point= edit ? edit->points : NULL;
- for(i=0, pa=psys->particles; i<psys->totpart; i++,pa++) {
- if(point) {
+ for (i=0, pa=psys->particles; i<psys->totpart; i++,pa++) {
+ if (point) {
ekey = point->keys;
point++;
}
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
- for(k=0,key=pa->hair; k<pa->totkey; k++,key++) {
+ for (k=0,key=pa->hair; k<pa->totkey; k++,key++) {
mul_m4_v3(hairmat,key->co);
- if(ekey) {
+ if (ekey) {
ekey->flag &= ~PEK_USE_WCO;
ekey++;
}
@@ -573,7 +573,7 @@ static void disconnect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
psys->flag |= PSYS_GLOBAL_HAIR;
- if(ELEM(pset->brushtype, PE_BRUSH_ADD, PE_BRUSH_PUFF))
+ if (ELEM(pset->brushtype, PE_BRUSH_ADD, PE_BRUSH_PUFF))
pset->brushtype = PE_BRUSH_NONE;
PE_update_object(scene, ob, 0);
@@ -587,11 +587,11 @@ static int disconnect_hair_exec(bContext *C, wmOperator *op)
ParticleSystem *psys= NULL;
int all = RNA_boolean_get(op->ptr, "all");
- if(!ob)
+ if (!ob)
return OPERATOR_CANCELLED;
- if(all) {
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
+ if (all) {
+ for (psys=ob->particlesystem.first; psys; psys=psys->next) {
disconnect_hair(scene, ob, psys);
}
}
@@ -608,14 +608,14 @@ static int disconnect_hair_exec(bContext *C, wmOperator *op)
void PARTICLE_OT_disconnect_hair(wmOperatorType *ot)
{
- ot->name= "Disconnect Hair";
- ot->description= "Disconnect hair from the emitter mesh";
- ot->idname= "PARTICLE_OT_disconnect_hair";
+ ot->name = "Disconnect Hair";
+ ot->description = "Disconnect hair from the emitter mesh";
+ ot->idname = "PARTICLE_OT_disconnect_hair";
- ot->exec= disconnect_hair_exec;
+ ot->exec = disconnect_hair_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "all", 0, "All hair", "Disconnect all hair systems from the emitter mesh");
}
@@ -637,13 +637,13 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
float hairmat[4][4], imat[4][4];
float v[4][3], vec[3];
- if(!psys || !psys->part || psys->part->type != PART_HAIR)
+ if (!psys || !psys->part || psys->part->type != PART_HAIR)
return;
edit= psys->edit;
point= edit ? edit->points : NULL;
- if(psmd->dm->deformedOnly)
+ if (psmd->dm->deformedOnly)
/* we don't want to mess up psmd->dm when converting to global coordinates below */
dm= CDDM_copy(psmd->dm);
else
@@ -661,7 +661,7 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
bvhtree_from_mesh_faces(&bvhtree, dm, 0.0, 2, 6);
- for(i=0, pa= psys->particles; i<psys->totpart; i++,pa++) {
+ for (i=0, pa= psys->particles; i<psys->totpart; i++,pa++) {
key = pa->hair;
nearest.index = -1;
@@ -669,8 +669,8 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
BLI_bvhtree_find_nearest(bvhtree.tree, key->co, &nearest, bvhtree.nearest_callback, &bvhtree);
- if(nearest.index == -1) {
- if (G.f & G_DEBUG)
+ if (nearest.index == -1) {
+ if (G.debug & G_DEBUG)
printf("No nearest point found for hair root!");
continue;
}
@@ -680,7 +680,7 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
copy_v3_v3(v[0], CDDM_get_vert(dm,mface->v1)->co);
copy_v3_v3(v[1], CDDM_get_vert(dm,mface->v2)->co);
copy_v3_v3(v[2], CDDM_get_vert(dm,mface->v3)->co);
- if(mface->v4) {
+ if (mface->v4) {
copy_v3_v3(v[3], CDDM_get_vert(dm,mface->v4)->co);
interp_weights_poly_v3( pa->fuv,v, 4, nearest.co);
}
@@ -695,16 +695,16 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
sub_v3_v3v3(vec, nearest.co, key->co);
- if(point) {
+ if (point) {
ekey = point->keys;
point++;
}
- for(k=0,key=pa->hair; k<pa->totkey; k++,key++) {
+ for (k=0,key=pa->hair; k<pa->totkey; k++,key++) {
add_v3_v3(key->co, vec);
mul_m4_v3(imat,key->co);
- if(ekey) {
+ if (ekey) {
ekey->flag |= PEK_USE_WCO;
ekey++;
}
@@ -729,11 +729,11 @@ static int connect_hair_exec(bContext *C, wmOperator *op)
ParticleSystem *psys= NULL;
int all = RNA_boolean_get(op->ptr, "all");
- if(!ob)
+ if (!ob)
return OPERATOR_CANCELLED;
- if(all) {
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
+ if (all) {
+ for (psys=ob->particlesystem.first; psys; psys=psys->next) {
connect_hair(scene, ob, psys);
}
}
@@ -750,14 +750,14 @@ static int connect_hair_exec(bContext *C, wmOperator *op)
void PARTICLE_OT_connect_hair(wmOperatorType *ot)
{
- ot->name= "Connect Hair";
- ot->description= "Connect hair to the emitter mesh";
- ot->idname= "PARTICLE_OT_connect_hair";
+ ot->name = "Connect Hair";
+ ot->description = "Connect hair to the emitter mesh";
+ ot->idname = "PARTICLE_OT_connect_hair";
- ot->exec= connect_hair_exec;
+ ot->exec = connect_hair_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "all", 0, "All hair", "Connect all hair systems to the emitter mesh");
}
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index e8ada1e0655..6a074a542c3 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -129,7 +129,8 @@ static void get_fluid_gravity(float *gravity, Scene *scene, FluidsimSettings *fs
{
if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
copy_v3_v3(gravity, scene->physics_settings.gravity);
- } else {
+ }
+ else {
copy_v3_v3(gravity, fss->grav);
}
}
@@ -138,7 +139,8 @@ static float get_fluid_size_m(Scene *scene, Object *domainob, FluidsimSettings *
{
if (!scene->unit.system) {
return fss->realsize;
- } else {
+ }
+ else {
float dim[3];
float longest_axis;
@@ -212,25 +214,27 @@ static void fluidsimPrintChannel(FILE *file, float *channel, int paramsize, char
int i,j;
int channelSize = paramsize;
- if(entries==3) {
+ if (entries==3) {
elbeemSimplifyChannelVec3( channel, &channelSize);
- } else if(entries==1) {
+ }
+ else if (entries==1) {
elbeemSimplifyChannelFloat( channel, &channelSize);
- } else {
+ }
+ else {
// invalid, cant happen?
}
- fprintf(file, " CHANNEL %s = \n", str);
- for(i=0; i<channelSize;i++) {
+ fprintf(file, " CHANNEL %s =\n", str);
+ for (i=0; i<channelSize;i++) {
fprintf(file," ");
- for(j=0;j<=entries;j++) { // also print time value
+ for (j=0;j<=entries;j++) { // also print time value
fprintf(file," %f ", channel[i*(entries+1)+j] );
- if(j==entries-1){ fprintf(file," "); }
+ if (j==entries-1) { fprintf(file," "); }
}
- fprintf(file," \n");
+ fprintf(file,"\n");
}
- fprintf(file, " ; \n" );
+ fprintf(file, " ;\n" );
}
#endif
@@ -298,7 +302,7 @@ static void set_vertex_channel(float *channel, float time, struct Scene *scene,
}
/* fill frame of channel with vertex locations */
- for(j=0; j < (3*numVerts); j++) {
+ for (j=0; j < (3*numVerts); j++) {
channel[i*framesize + j] = verts[j];
}
channel[i*framesize + framesize-1] = time;
@@ -423,7 +427,7 @@ static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), Fluid
eval_time = domainSettings->bakeStart + i;
- /* XXX: This can't be used due to an anim sys optimisation that ignores recalc object animation,
+ /* XXX: This can't be used due to an anim sys optimization that ignores recalc object animation,
* leaving it for the depgraph (this ignores object animation such as modifier properties though... :/ )
* --> BKE_animsys_evaluate_all_animation(G.main, eval_time);
* This doesn't work with drivers:
@@ -468,7 +472,7 @@ static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), Fluid
/* init euler rotation values and convert to elbeem format */
/* get the rotation from ob->obmat rather than ob->rot to account for parent animations */
- if(i) {
+ if (i) {
copy_v3_v3(old_rot, fobj->Rotation + 4*(i-1));
mul_v3_fl(old_rot, -M_PI/180.f);
}
@@ -538,16 +542,16 @@ static void export_fluid_objects(ListBase *fobjects, Scene *scene, int length)
fsmesh.channelScale = fobj->Scale;
fsmesh.channelActive = fobj->Active;
- if( ELEM(fsmesh.type, OB_FLUIDSIM_FLUID, OB_FLUIDSIM_INFLOW)) {
+ if ( ELEM(fsmesh.type, OB_FLUIDSIM_FLUID, OB_FLUIDSIM_INFLOW)) {
fsmesh.channelInitialVel = fobj->InitialVelocity;
fsmesh.localInivelCoords = ((fluidmd->fss->typeFlags & OB_FSINFLOW_LOCALCOORD)?1:0);
}
- if(fluidmd->fss->typeFlags & OB_FSBND_NOSLIP)
+ if (fluidmd->fss->typeFlags & OB_FSBND_NOSLIP)
fsmesh.obstacleType = FLUIDSIM_OBSTACLE_NOSLIP;
- else if(fluidmd->fss->typeFlags & OB_FSBND_PARTSLIP)
+ else if (fluidmd->fss->typeFlags & OB_FSBND_PARTSLIP)
fsmesh.obstacleType = FLUIDSIM_OBSTACLE_PARTSLIP;
- else if(fluidmd->fss->typeFlags & OB_FSBND_FREESLIP)
+ else if (fluidmd->fss->typeFlags & OB_FSBND_FREESLIP)
fsmesh.obstacleType = FLUIDSIM_OBSTACLE_FREESLIP;
fsmesh.obstaclePartslip = fluidmd->fss->partSlipValue;
@@ -578,7 +582,7 @@ static void export_fluid_objects(ListBase *fobjects, Scene *scene, int length)
}
/* animated meshes */
- if(deform) {
+ if (deform) {
fsmesh.channelSizeVertices = length;
fsmesh.channelVertices = fobj->VertexCache;
@@ -590,8 +594,8 @@ static void export_fluid_objects(ListBase *fobjects, Scene *scene, int length)
elbeemAddMesh(&fsmesh);
- if(verts) MEM_freeN(verts);
- if(tris) MEM_freeN(tris);
+ if (verts) MEM_freeN(verts);
+ if (tris) MEM_freeN(tris);
}
}
@@ -602,7 +606,7 @@ static int fluid_validate_scene(ReportList *reports, Scene *scene, Object *fsDom
int channelObjCount = 0;
int fluidInputCount = 0;
- for(base=scene->base.first; base; base= base->next)
+ for (base=scene->base.first; base; base= base->next)
{
Object *ob = base->object;
FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
@@ -610,7 +614,7 @@ static int fluid_validate_scene(ReportList *reports, Scene *scene, Object *fsDom
/* only find objects with fluid modifiers */
if (!fluidmdtmp || ob->type != OB_MESH) continue;
- if(fluidmdtmp->fss->type == OB_FLUIDSIM_DOMAIN) {
+ if (fluidmdtmp->fss->type == OB_FLUIDSIM_DOMAIN) {
/* if no initial domain object given, find another potential domain */
if (!fsDomain) {
newdomain = ob;
@@ -654,6 +658,7 @@ static int fluid_validate_scene(ReportList *reports, Scene *scene, Object *fsDom
#define FLUID_SUFFIX_CONFIG "fluidsim.cfg"
+#define FLUID_SUFFIX_CONFIG_TMP (FLUID_SUFFIX_CONFIG ".tmp")
#define FLUID_SUFFIX_SURFACE "fluidsurface"
static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetFile, char *debugStrBuffer)
@@ -663,7 +668,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
FILE *fileCfg;
int dirExist = 0;
char newSurfdataPath[FILE_MAX]; // modified output settings
- const char *suffixConfig = FLUID_SUFFIX_CONFIG;
+ const char *suffixConfigTmp = FLUID_SUFFIX_CONFIG_TMP;
int outStringsChanged = 0;
// prepare names...
@@ -673,9 +678,8 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
BLI_strncpy(newSurfdataPath, domainSettings->surfdataPath, FILE_MAXDIR); /* if 0'd out below, this value is never used! */
BLI_path_abs(targetDir, relbase); // fixed #frame-no
- BLI_join_dirfile(targetFile, FILE_MAX, targetDir, suffixConfig);
- /* .tmp: dont overwrite/delete original file */
- strncat(targetFile, ".tmp", FILE_MAX);
+ /* .tmp: don't overwrite/delete original file */
+ BLI_join_dirfile(targetFile, FILE_MAX, targetDir, suffixConfigTmp);
// make sure all directories exist
// as the bobjs use the same dir, this only needs to be checked
@@ -684,14 +688,14 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
// check selected directory
// simply try to open cfg file for writing to test validity of settings
- fileCfg = fopen(targetFile, "w");
- if(fileCfg) {
+ fileCfg = BLI_fopen(targetFile, "w");
+ if (fileCfg) {
dirExist = 1; fclose(fileCfg);
// remove cfg dummy from directory test
BLI_delete(targetFile, 0,0);
}
- if(targetDir[0] == '\0' || (!dirExist)) {
+ if (targetDir[0] == '\0' || (!dirExist)) {
char blendDir[FILE_MAX];
char blendFile[FILE_MAX];
@@ -709,7 +713,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
// check if modified output dir is ok
#if 0
- if(outStringsChanged) {
+ if (outStringsChanged) {
char dispmsg[FILE_MAX+256];
int selection=0;
BLI_strncpy(dispmsg,"Output settings set to: '", sizeof(dispmsg));
@@ -718,7 +722,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
// ask user if thats what he/she wants...
selection = pupmenu(dispmsg);
- if(selection<1) return 0; // 0 from menu, or -1 aborted
+ if (selection<1) return 0; // 0 from menu, or -1 aborted
BLI_strncpy(targetDir, newSurfdataPath, sizeof(targetDir));
strncpy(domainSettings->surfdataPath, newSurfdataPath, FILE_MAXDIR);
BLI_path_abs(targetDir, G.main->name); // fixed #frame-no
@@ -751,7 +755,7 @@ static int fluidbake_breakjob(void *customdata)
{
FluidBakeJob *fb= (FluidBakeJob *)customdata;
- if(fb->stop && *(fb->stop))
+ if (fb->stop && *(fb->stop))
return 1;
/* this is not nice yet, need to make the jobs list template better
@@ -801,7 +805,7 @@ int runSimulationCallback(void *data, int status, int frame)
if (status == FLUIDSIM_CBSTATUS_NEWFRAME) {
fluidbake_updatejob(fb, frame / (float)settings->noOfFrames);
- //printf("elbeem blender cb s%d, f%d, domainid:%d noOfFrames: %d \n", status,frame, settings->domainId, settings->noOfFrames ); // DEBUG
+ //printf("elbeem blender cb s%d, f%d, domainid:%d noOfFrames: %d\n", status,frame, settings->domainId, settings->noOfFrames ); // DEBUG
}
if (fluidbake_breakjob(fb)) {
@@ -860,13 +864,12 @@ 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);
}
- } while(exists);
+ } while (exists);
return;
}
@@ -882,7 +885,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
int gridlevels = 0;
const char *relbase= modifier_path_relbase(fsDomain);
const char *strEnvName = "BLENDER_ELBEEMDEBUG"; // from blendercall.cpp
- const char *suffixConfig = FLUID_SUFFIX_CONFIG;
+ const char *suffixConfigTmp = FLUID_SUFFIX_CONFIG_TMP;
const char *suffixSurface = FLUID_SUFFIX_SURFACE;
char targetDir[FILE_MAX]; // store & modify output settings
@@ -905,7 +908,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
fb= MEM_callocN(sizeof(FluidBakeJob), "fluid bake job");
- if(getenv(strEnvName)) {
+ if (getenv(strEnvName)) {
int dlevel = atoi(getenv(strEnvName));
elbeemSetDebugLevel(dlevel);
BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer),"fluidsimBake::msg: Debug messages activated due to envvar '%s'\n",strEnvName);
@@ -914,7 +917,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
/* make sure it corresponds to startFrame setting (old: noFrames = scene->r.efra - scene->r.sfra +1) */;
noFrames = scene->r.efra - 0;
- if(noFrames<=0) {
+ if (noFrames<=0) {
BKE_report(reports, RPT_ERROR, "No frames to export - check your animation range settings");
fluidbake_free_data(channels, fobjects, fsset, fb);
return 0;
@@ -944,7 +947,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
fluidsim_delete_until_lastframe(domainSettings, relbase);
/* rough check of settings... */
- if(domainSettings->previewresxyz > domainSettings->resolutionxyz) {
+ if (domainSettings->previewresxyz > domainSettings->resolutionxyz) {
BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::warning - Preview (%d) >= Resolution (%d)... setting equal.\n", domainSettings->previewresxyz , domainSettings->resolutionxyz);
elbeemDebugOut(debugStrBuffer);
domainSettings->previewresxyz = domainSettings->resolutionxyz;
@@ -953,16 +956,19 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
// this should do as an approximation, with in/outflow
// doing this more accurate would be overkill
// perhaps add manual setting?
- if(domainSettings->maxRefine <0) {
- if(domainSettings->resolutionxyz>128) {
+ if (domainSettings->maxRefine <0) {
+ if (domainSettings->resolutionxyz>128) {
gridlevels = 2;
- } else
- if(domainSettings->resolutionxyz>64) {
+ }
+ else
+ if (domainSettings->resolutionxyz>64) {
gridlevels = 1;
- } else {
+ }
+ else {
gridlevels = 0;
}
- } else {
+ }
+ else {
gridlevels = domainSettings->maxRefine;
}
BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::msg: Baking %s, refine: %d\n", fsDomain->id.name , gridlevels );
@@ -975,7 +981,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
channels->length = scene->r.efra;
channels->aniFrameTime = (domainSettings->animEnd - domainSettings->animStart)/(double)noFrames;
- /* ******** initialise and allocate animation channels ******** */
+ /* ******** initialize and allocate animation channels ******** */
fluid_init_all_channels(C, fsDomain, domainSettings, channels, fobjects);
/* reset to original current frame */
@@ -984,7 +990,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
/* ******** init domain object's matrix ******** */
copy_m4_m4(domainMat, fsDomain->obmat);
- if(!invert_m4_m4(invDomMat, domainMat)) {
+ if (!invert_m4_m4(invDomMat, domainMat)) {
BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::error - Invalid obj matrix?\n");
elbeemDebugOut(debugStrBuffer);
BKE_report(reports, RPT_ERROR, "Invalid object matrix");
@@ -994,12 +1000,11 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
}
/* ******** start writing / exporting ******** */
- // use .tmp, dont overwrite/delete original file
- BLI_join_dirfile(targetFile, sizeof(targetFile), targetDir, suffixConfig);
- strncat(targetFile, ".tmp", sizeof(targetFile));
+ // use .tmp, don't overwrite/delete original file
+ BLI_join_dirfile(targetFile, sizeof(targetFile), targetDir, suffixConfigTmp);
// make sure these directories exist as well
- if(outStringsChanged) {
+ if (outStringsChanged) {
BLI_make_existing_file(targetFile);
}
@@ -1053,7 +1058,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
fsset->domainobsPartslip = domainSettings->partSlipValue;
/* use domainobsType also for surface generation flag (bit: >=64) */
- if(domainSettings->typeFlags & OB_FSSG_NOOBS)
+ if (domainSettings->typeFlags & OB_FSSG_NOOBS)
fsset->mFsSurfGenSetting = FLUIDSIM_FSSG_NOOBS;
else
fsset->mFsSurfGenSetting = 0; // "normal" mode
@@ -1062,8 +1067,8 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
// init blender domain transform matrix
{ int j;
- for(i=0; i<4; i++) {
- for(j=0; j<4; j++) {
+ for (i=0; i<4; i++) {
+ for (j=0; j<4; j++) {
fsset->surfaceTrafo[i*4+j] = invDomMat[j][i];
}
} }
@@ -1078,7 +1083,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
/* custom data for fluid bake job */
fb->settings = fsset;
- if(do_job) {
+ if (do_job) {
wmJob *steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, "Fluid Simulation", WM_JOB_PROGRESS);
/* setup job */
@@ -1141,10 +1146,10 @@ static int fluidsimBake(bContext *UNUSED(C), ReportList *UNUSED(reports), Object
static int fluid_bake_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
/* only one bake job at a time */
- if(WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C)))
+ if (WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C)))
return OPERATOR_CANCELLED;
- if(!fluidsimBake(C, op->reports, CTX_data_active_object(C), TRUE))
+ if (!fluidsimBake(C, op->reports, CTX_data_active_object(C), TRUE))
return OPERATOR_CANCELLED;
return OPERATOR_FINISHED;
@@ -1152,7 +1157,7 @@ static int fluid_bake_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
static int fluid_bake_exec(bContext *C, wmOperator *op)
{
- if(!fluidsimBake(C, op->reports, CTX_data_active_object(C), FALSE))
+ if (!fluidsimBake(C, op->reports, CTX_data_active_object(C), FALSE))
return OPERATOR_CANCELLED;
return OPERATOR_FINISHED;
@@ -1161,13 +1166,13 @@ static int fluid_bake_exec(bContext *C, wmOperator *op)
void FLUID_OT_bake(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Fluid Simulation Bake";
- ot->description= "Bake fluid simulation";
- ot->idname= "FLUID_OT_bake";
+ ot->name = "Fluid Simulation Bake";
+ ot->description = "Bake fluid simulation";
+ ot->idname = "FLUID_OT_bake";
/* api callbacks */
- ot->invoke= fluid_bake_invoke;
- ot->exec= fluid_bake_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->invoke = fluid_bake_invoke;
+ ot->exec = fluid_bake_exec;
+ ot->poll = ED_operator_object_active_editable;
}
diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c
index 473ed50b5e2..272e13e2a62 100644
--- a/source/blender/editors/physics/physics_ops.c
+++ b/source/blender/editors/physics/physics_ops.c
@@ -93,8 +93,8 @@ static void keymap_particle(wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
wmKeyMap *keymap;
- keymap= WM_keymap_find(keyconf, "Particle", 0, 0);
- keymap->poll= PE_poll;
+ keymap = WM_keymap_find(keyconf, "Particle", 0, 0);
+ keymap->poll = PE_poll;
kmi = WM_keymap_add_item(keymap, "PARTICLE_OT_select_all", AKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
@@ -187,7 +187,7 @@ static void operatortypes_dynamicpaint(void)
//static void keymap_pointcache(wmWindowManager *wm)
//{
-// wmKeyMap *keymap= WM_keymap_find(wm, "Pointcache", 0, 0);
+// wmKeyMap *keymap = WM_keymap_find(wm, "Pointcache", 0, 0);
//
// WM_keymap_add_item(keymap, "PHYSICS_OT_bake_all", AKEY, KM_PRESS, 0, 0);
// WM_keymap_add_item(keymap, "PHYSICS_OT_free_all", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c
index 62e0e5e201d..6573647aaee 100644
--- a/source/blender/editors/physics/physics_pointcache.c
+++ b/source/blender/editors/physics/physics_pointcache.c
@@ -67,7 +67,7 @@ static int ptcache_bake_all_poll(bContext *C)
{
Scene *scene= CTX_data_scene(C);
- if(!scene)
+ if (!scene)
return 0;
return 1;
@@ -114,7 +114,8 @@ static int ptcache_bake_all_exec(bContext *C, wmOperator *op)
baker.progressbar = (void (*)(void *, int))WM_timecursor;
baker.progressend = (void (*)(void *))WM_cursor_restore;
baker.progresscontext = win;
- } else {
+ }
+ else {
baker.progressbar = bake_console_progress;
baker.progressend = bake_console_progress_end;
baker.progresscontext = NULL;
@@ -134,10 +135,10 @@ static int ptcache_free_bake_all_exec(bContext *C, wmOperator *UNUSED(op))
PTCacheID *pid;
ListBase pidlist;
- for(base=scene->base.first; base; base= base->next) {
+ for (base=scene->base.first; base; base= base->next) {
BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR);
- for(pid=pidlist.first; pid; pid=pid->next) {
+ for (pid=pidlist.first; pid; pid=pid->next) {
pid->cache->flag &= ~PTCACHE_BAKED;
}
@@ -154,31 +155,31 @@ static int ptcache_free_bake_all_exec(bContext *C, wmOperator *UNUSED(op))
void PTCACHE_OT_bake_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Bake All Physics";
- ot->description= "Bake all physics";
- ot->idname= "PTCACHE_OT_bake_all";
+ ot->name = "Bake All Physics";
+ ot->description = "Bake all physics";
+ ot->idname = "PTCACHE_OT_bake_all";
/* api callbacks */
- ot->exec= ptcache_bake_all_exec;
- ot->poll= ptcache_bake_all_poll;
+ ot->exec = ptcache_bake_all_exec;
+ ot->poll = ptcache_bake_all_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "bake", 1, "Bake", "");
}
void PTCACHE_OT_free_bake_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Free All Physics Bakes";
- ot->idname= "PTCACHE_OT_free_bake_all";
+ ot->name = "Free All Physics Bakes";
+ ot->idname = "PTCACHE_OT_free_bake_all";
/* api callbacks */
- ot->exec= ptcache_free_bake_all_exec;
- ot->poll= ptcache_bake_all_poll;
+ ot->exec = ptcache_free_bake_all_exec;
+ ot->poll = ptcache_bake_all_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int ptcache_bake_exec(bContext *C, wmOperator *op)
{
@@ -194,8 +195,8 @@ static int ptcache_bake_exec(bContext *C, wmOperator *op)
BKE_ptcache_ids_from_object(&pidlist, ob, scene, MAX_DUPLI_RECUR);
- 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;
}
@@ -216,7 +217,8 @@ static int ptcache_bake_exec(bContext *C, wmOperator *op)
baker.progressbar = (void (*)(void *, int))WM_timecursor;
baker.progressend = (void (*)(void *))WM_cursor_restore;
baker.progresscontext = win;
- } else {
+ }
+ else {
printf("\n"); /* empty first line before console reports */
baker.progressbar = bake_console_progress;
baker.progressend = bake_console_progress_end;
@@ -238,8 +240,8 @@ static int ptcache_free_bake_exec(bContext *C, wmOperator *UNUSED(op))
PointCache *cache= ptr.data;
Object *ob= ptr.id.data;
- if(cache->edit) {
- if(!cache->edit->edited || 1) {// XXX okee("Lose changes done in particle mode?")) {
+ if (cache->edit) {
+ if (!cache->edit->edited || 1) {// XXX okee("Lose changes done in particle mode?")) {
PE_free_ptcache_edit(cache->edit);
cache->edit = NULL;
cache->flag &= ~PTCACHE_BAKED;
@@ -267,46 +269,46 @@ static int ptcache_bake_from_cache_exec(bContext *C, wmOperator *UNUSED(op))
void PTCACHE_OT_bake(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Bake Physics";
- ot->description= "Bake physics";
- ot->idname= "PTCACHE_OT_bake";
+ ot->name = "Bake Physics";
+ ot->description = "Bake physics";
+ ot->idname = "PTCACHE_OT_bake";
/* api callbacks */
- ot->exec= ptcache_bake_exec;
- ot->poll= ptcache_poll;
+ ot->exec = ptcache_bake_exec;
+ ot->poll = ptcache_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "bake", 0, "Bake", "");
}
void PTCACHE_OT_free_bake(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Free Physics Bake";
- ot->description= "Free physics bake";
- ot->idname= "PTCACHE_OT_free_bake";
+ ot->name = "Free Physics Bake";
+ ot->description = "Free physics bake";
+ ot->idname = "PTCACHE_OT_free_bake";
/* api callbacks */
- ot->exec= ptcache_free_bake_exec;
- ot->poll= ptcache_poll;
+ ot->exec = ptcache_free_bake_exec;
+ ot->poll = ptcache_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
void PTCACHE_OT_bake_from_cache(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Bake From Cache";
- ot->description= "Bake from cache";
- ot->idname= "PTCACHE_OT_bake_from_cache";
+ ot->name = "Bake From Cache";
+ ot->description = "Bake from cache";
+ ot->idname = "PTCACHE_OT_bake_from_cache";
/* api callbacks */
- ot->exec= ptcache_bake_from_cache_exec;
- ot->poll= ptcache_poll;
+ ot->exec = ptcache_bake_from_cache_exec;
+ ot->poll = ptcache_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int ptcache_add_new_exec(bContext *C, wmOperator *UNUSED(op))
@@ -320,8 +322,8 @@ static int ptcache_add_new_exec(bContext *C, wmOperator *UNUSED(op))
BKE_ptcache_ids_from_object(&pidlist, ob, scene, MAX_DUPLI_RECUR);
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->cache == cache) {
+ for (pid=pidlist.first; pid; pid=pid->next) {
+ if (pid->cache == cache) {
PointCache *cache = BKE_ptcache_add(pid->ptcaches);
cache->step = pid->default_step;
*(pid->cache_ptr) = cache;
@@ -347,9 +349,9 @@ static int ptcache_remove_exec(bContext *C, wmOperator *UNUSED(op))
BKE_ptcache_ids_from_object(&pidlist, ob, scene, MAX_DUPLI_RECUR);
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->cache == cache) {
- if(pid->ptcaches->first == pid->ptcaches->last)
+ for (pid=pidlist.first; pid; pid=pid->next) {
+ if (pid->cache == cache) {
+ if (pid->ptcaches->first == pid->ptcaches->last)
continue; /* don't delete last cache */
BLI_remlink(pid->ptcaches, pid->cache);
@@ -369,29 +371,29 @@ static int ptcache_remove_exec(bContext *C, wmOperator *UNUSED(op))
void PTCACHE_OT_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add New Cache";
- ot->description= "Add new cache";
- ot->idname= "PTCACHE_OT_add";
+ ot->name = "Add New Cache";
+ ot->description = "Add new cache";
+ ot->idname = "PTCACHE_OT_add";
/* api callbacks */
- ot->exec= ptcache_add_new_exec;
- ot->poll= ptcache_poll; // ptcache_bake_all_poll;
+ ot->exec = ptcache_add_new_exec;
+ ot->poll = ptcache_poll; // ptcache_bake_all_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
void PTCACHE_OT_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Current Cache";
- ot->description= "Delete current cache";
- ot->idname= "PTCACHE_OT_remove";
+ ot->name = "Delete Current Cache";
+ ot->description = "Delete current cache";
+ ot->idname = "PTCACHE_OT_remove";
/* api callbacks */
- ot->exec= ptcache_remove_exec;
- ot->poll= ptcache_poll;
+ ot->exec = ptcache_remove_exec;
+ ot->poll = ptcache_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index e35df217761..47a4c376f96 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -76,107 +76,107 @@
/* called inside thread! */
void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volatile rcti *renrect)
{
- float *rectf= NULL;
+ float *rectf = NULL;
int ymin, ymax, xmin, xmax;
int rymin, rxmin, predivide, profile_from;
unsigned char *rectc;
/* if renrect argument, we only refresh scanlines */
- if(renrect) {
+ if (renrect) {
/* if ymax==recty, rendering of layer is ready, we should not draw, other things happen... */
- if(rr->renlay==NULL || renrect->ymax>=rr->recty)
+ if (rr->renlay == NULL || renrect->ymax >= rr->recty)
return;
/* xmin here is first subrect x coord, xmax defines subrect width */
xmin = renrect->xmin + rr->crop;
xmax = renrect->xmax - xmin + rr->crop;
- if(xmax<2)
+ if (xmax < 2)
return;
- ymin= renrect->ymin + rr->crop;
- ymax= renrect->ymax - ymin + rr->crop;
- if(ymax<2)
+ ymin = renrect->ymin + rr->crop;
+ ymax = renrect->ymax - ymin + rr->crop;
+ if (ymax < 2)
return;
- renrect->ymin= renrect->ymax;
+ renrect->ymin = renrect->ymax;
}
else {
xmin = ymin = rr->crop;
- xmax = rr->rectx - 2*rr->crop;
- ymax = rr->recty - 2*rr->crop;
+ xmax = rr->rectx - 2 * rr->crop;
+ ymax = rr->recty - 2 * rr->crop;
}
/* xmin ymin is in tile coords. transform to ibuf */
- rxmin= rr->tilerect.xmin + xmin;
- if(rxmin >= ibuf->x) return;
- rymin= rr->tilerect.ymin + ymin;
- if(rymin >= ibuf->y) return;
+ rxmin = rr->tilerect.xmin + xmin;
+ if (rxmin >= ibuf->x) return;
+ rymin = rr->tilerect.ymin + ymin;
+ if (rymin >= ibuf->y) return;
- if(rxmin + xmax > ibuf->x)
- xmax= ibuf->x - rxmin;
- if(rymin + ymax > ibuf->y)
- ymax= ibuf->y - rymin;
+ if (rxmin + xmax > ibuf->x)
+ xmax = ibuf->x - rxmin;
+ if (rymin + ymax > ibuf->y)
+ ymax = ibuf->y - rymin;
- if(xmax < 1 || ymax < 1) return;
+ if (xmax < 1 || ymax < 1) return;
- /* find current float rect for display, first case is after composit... still weak */
- if(rr->rectf)
- rectf= rr->rectf;
+ /* find current float rect for display, first case is after composite... still weak */
+ if (rr->rectf)
+ rectf = rr->rectf;
else {
- if(rr->rect32)
+ if (rr->rect32)
return;
else {
- if(rr->renlay==NULL || rr->renlay->rectf==NULL) return;
- rectf= rr->renlay->rectf;
+ if (rr->renlay == NULL || rr->renlay->rectf == NULL) return;
+ rectf = rr->renlay->rectf;
}
}
- if(rectf==NULL) return;
+ if (rectf == NULL) return;
- if(ibuf->rect==NULL)
+ if (ibuf->rect == NULL)
imb_addrectImBuf(ibuf);
- rectf+= 4*(rr->rectx*ymin + xmin);
- rectc= (unsigned char*)(ibuf->rect + ibuf->x*rymin + rxmin);
+ rectf += 4 * (rr->rectx * ymin + xmin);
+ rectc = (unsigned char *)(ibuf->rect + ibuf->x * rymin + rxmin);
- if(scene && (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)) {
- profile_from= IB_PROFILE_LINEAR_RGB;
- predivide= (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT_PREDIVIDE);
+ if (scene && (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)) {
+ profile_from = IB_PROFILE_LINEAR_RGB;
+ predivide = (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT_PREDIVIDE);
}
else {
- profile_from= IB_PROFILE_SRGB;
- predivide= 0;
+ profile_from = IB_PROFILE_SRGB;
+ predivide = 0;
}
IMB_buffer_byte_from_float(rectc, rectf,
- 4, ibuf->dither, IB_PROFILE_SRGB, profile_from, predivide,
- xmax, ymax, ibuf->x, rr->rectx);
+ 4, ibuf->dither, IB_PROFILE_SRGB, profile_from, predivide,
+ xmax, ymax, ibuf->x, rr->rectx);
}
/* ****************************** 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)
{
/* single layer re-render */
- if(RNA_struct_property_is_set(op->ptr, "scene")) {
+ if (RNA_struct_property_is_set(op->ptr, "scene")) {
Scene *scn;
- char scene_name[MAX_ID_NAME-2];
+ char scene_name[MAX_ID_NAME - 2];
RNA_string_get(op->ptr, "scene", scene_name);
scn = (Scene *)BLI_findstring(&mainp->scene, scene_name, offsetof(ID, name) + 2);
if (scn) {
/* camera switch wont have updated */
- scn->r.cfra= (*scene)->r.cfra;
+ scn->r.cfra = (*scene)->r.cfra;
scene_camera_switch_update(scn);
*scene = scn;
}
}
- if(RNA_struct_property_is_set(op->ptr, "layer")) {
+ if (RNA_struct_property_is_set(op->ptr, "layer")) {
SceneRenderLayer *rl;
char rl_name[RE_MAXNAME];
@@ -191,44 +191,44 @@ static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **s
/* executes blocking render */
static int screen_render_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- SceneRenderLayer *srl= NULL;
+ Scene *scene = CTX_data_scene(C);
+ SceneRenderLayer *srl = NULL;
Render *re;
Image *ima;
- View3D *v3d= CTX_wm_view3d(C);
- Main *mainp= CTX_data_main(C);
+ View3D *v3d = CTX_wm_view3d(C);
+ Main *mainp = CTX_data_main(C);
unsigned int lay;
- const short is_animation= RNA_boolean_get(op->ptr, "animation");
- const short is_write_still= RNA_boolean_get(op->ptr, "write_still");
- struct Object *camera_override= v3d ? V3D_CAMERA_LOCAL(v3d) : NULL;
+ const short is_animation = RNA_boolean_get(op->ptr, "animation");
+ const short is_write_still = RNA_boolean_get(op->ptr, "write_still");
+ struct Object *camera_override = v3d ? V3D_CAMERA_LOCAL(v3d) : NULL;
/* custom scene and single layer re-render */
screen_render_scene_layer_set(op, mainp, &scene, &srl);
- if(!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) {
+ if (!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) {
BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected");
return OPERATOR_CANCELLED;
}
- re= RE_NewRender(scene->id.name);
- lay= (v3d)? v3d->lay: scene->lay;
+ re = RE_NewRender(scene->id.name);
+ lay = (v3d) ? v3d->lay : scene->lay;
- G.afbreek= 0;
- RE_test_break_cb(re, NULL, (int (*)(void *)) blender_test_break);
+ G.afbreek = 0;
+ RE_test_break_cb(re, NULL, (int (*)(void *))blender_test_break);
- ima= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
+ ima = BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
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);
- if(is_animation)
+ if (is_animation)
RE_BlenderAnim(re, mainp, scene, camera_override, lay, scene->r.sfra, scene->r.efra, scene->r.frame_step);
else
RE_BlenderFrame(re, mainp, scene, srl, camera_override, lay, scene->r.cfra, is_write_still);
@@ -238,7 +238,7 @@ static int screen_render_exec(bContext *C, wmOperator *op)
// no redraw needed, we leave state as we entered it
ED_update_for_newframe(mainp, scene, CTX_wm_screen(C), 1);
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_RESULT, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_RENDER_RESULT, scene);
return OPERATOR_FINISHED;
}
@@ -262,7 +262,7 @@ typedef struct RenderJob {
static void render_freejob(void *rjv)
{
- RenderJob *rj= rjv;
+ RenderJob *rj = rjv;
MEM_freeN(rj);
}
@@ -270,69 +270,69 @@ static void render_freejob(void *rjv)
/* str is IMA_MAX_RENDER_TEXT in size */
static void make_renderinfo_string(RenderStats *rs, Scene *scene, char *str)
{
- char info_time_str[32]; // used to be extern to header_info.c
+ char info_time_str[32]; // used to be extern to header_info.c
uintptr_t mem_in_use, mmap_in_use, peak_memory;
float megs_used_memory, mmap_used_memory, megs_peak_memory;
- char *spos= str;
+ char *spos = str;
- mem_in_use= MEM_get_memory_in_use();
- mmap_in_use= MEM_get_mapped_memory_in_use();
+ mem_in_use = MEM_get_memory_in_use();
+ mmap_in_use = MEM_get_mapped_memory_in_use();
peak_memory = MEM_get_peak_memory();
- megs_used_memory= (mem_in_use-mmap_in_use)/(1024.0*1024.0);
- mmap_used_memory= (mmap_in_use)/(1024.0*1024.0);
- megs_peak_memory = (peak_memory)/(1024.0*1024.0);
+ megs_used_memory = (mem_in_use - mmap_in_use) / (1024.0 * 1024.0);
+ mmap_used_memory = (mmap_in_use) / (1024.0 * 1024.0);
+ megs_peak_memory = (peak_memory) / (1024.0 * 1024.0);
- if(scene->lay & 0xFF000000)
- spos+= sprintf(spos, "Localview | ");
- else if(scene->r.scemode & R_SINGLE_LAYER)
- spos+= sprintf(spos, "Single Layer | ");
+ if (scene->lay & 0xFF000000)
+ spos += sprintf(spos, "Localview | ");
+ else if (scene->r.scemode & R_SINGLE_LAYER)
+ spos += sprintf(spos, "Single Layer | ");
- if(rs->statstr) {
- spos+= sprintf(spos, "%s ", rs->statstr);
+ if (rs->statstr) {
+ spos += sprintf(spos, "%s ", rs->statstr);
}
else {
- spos+= sprintf(spos, "Fra:%d ", (scene->r.cfra));
- if(rs->totvert) spos+= sprintf(spos, "Ve:%d ", rs->totvert);
- if(rs->totface) spos+= sprintf(spos, "Fa:%d ", rs->totface);
- if(rs->tothalo) spos+= sprintf(spos, "Ha:%d ", rs->tothalo);
- if(rs->totstrand) spos+= sprintf(spos, "St:%d ", rs->totstrand);
- if(rs->totlamp) spos+= sprintf(spos, "La:%d ", rs->totlamp);
- spos+= sprintf(spos, "Mem:%.2fM (%.2fM, peak %.2fM) ", megs_used_memory, mmap_used_memory, megs_peak_memory);
-
- if(rs->curfield)
- spos+= sprintf(spos, "Field %d ", rs->curfield);
- if(rs->curblur)
- spos+= sprintf(spos, "Blur %d ", rs->curblur);
+ spos += sprintf(spos, "Fra:%d ", (scene->r.cfra));
+ if (rs->totvert) spos += sprintf(spos, "Ve:%d ", rs->totvert);
+ if (rs->totface) spos += sprintf(spos, "Fa:%d ", rs->totface);
+ if (rs->tothalo) spos += sprintf(spos, "Ha:%d ", rs->tothalo);
+ if (rs->totstrand) spos += sprintf(spos, "St:%d ", rs->totstrand);
+ if (rs->totlamp) spos += sprintf(spos, "La:%d ", rs->totlamp);
+ spos += sprintf(spos, "Mem:%.2fM (%.2fM, peak %.2fM) ", megs_used_memory, mmap_used_memory, megs_peak_memory);
+
+ if (rs->curfield)
+ spos += sprintf(spos, "Field %d ", rs->curfield);
+ if (rs->curblur)
+ spos += sprintf(spos, "Blur %d ", rs->curblur);
}
BLI_timestr(rs->lastframetime, info_time_str);
- spos+= sprintf(spos, "Time:%s ", info_time_str);
+ spos += sprintf(spos, "Time:%s ", info_time_str);
- if(rs->curfsa)
- spos+= sprintf(spos, "| Full Sample %d ", rs->curfsa);
+ if (rs->curfsa)
+ spos += sprintf(spos, "| Full Sample %d ", rs->curfsa);
- if(rs->infostr && rs->infostr[0])
- spos+= sprintf(spos, "| %s ", rs->infostr);
+ if (rs->infostr && rs->infostr[0])
+ spos += sprintf(spos, "| %s ", rs->infostr);
/* very weak... but 512 characters is quite safe */
- if(spos >= str+IMA_MAX_RENDER_TEXT)
- if (G.f & G_DEBUG)
- printf("WARNING! renderwin text beyond limit \n");
+ if (spos >= str + IMA_MAX_RENDER_TEXT)
+ if (G.debug & G_DEBUG)
+ printf("WARNING! renderwin text beyond limit\n");
}
static void image_renderinfo_cb(void *rjv, RenderStats *rs)
{
- RenderJob *rj= rjv;
+ RenderJob *rj = rjv;
RenderResult *rr;
- rr= RE_AcquireResultRead(rj->re);
+ rr = RE_AcquireResultRead(rj->re);
- if(rr) {
+ if (rr) {
/* malloc OK here, stats_draw is not in tile threads */
- if(rr->text==NULL)
- rr->text= MEM_callocN(IMA_MAX_RENDER_TEXT, "rendertext");
+ if (rr->text == NULL)
+ rr->text = MEM_callocN(IMA_MAX_RENDER_TEXT, "rendertext");
make_renderinfo_string(rs, rj->scene, rr->text);
}
@@ -340,54 +340,54 @@ static void image_renderinfo_cb(void *rjv, RenderStats *rs)
RE_ReleaseResult(rj->re);
/* make jobs timer to send notifier */
- *(rj->do_update)= 1;
+ *(rj->do_update) = 1;
}
static void render_progress_update(void *rjv, float progress)
{
- RenderJob *rj= rjv;
+ RenderJob *rj = rjv;
- if(rj->progress && *rj->progress != progress) {
+ if (rj->progress && *rj->progress != progress) {
*rj->progress = progress;
/* make jobs timer to send notifier */
- *(rj->do_update)= 1;
+ *(rj->do_update) = 1;
}
}
static void image_rect_update(void *rjv, RenderResult *rr, volatile rcti *renrect)
{
- RenderJob *rj= rjv;
- Image *ima= rj->image;
+ RenderJob *rj = rjv;
+ Image *ima = rj->image;
ImBuf *ibuf;
void *lock;
/* only update if we are displaying the slot being rendered */
- if(ima->render_slot != ima->last_render_slot)
+ if (ima->render_slot != ima->last_render_slot)
return;
- ibuf= BKE_image_acquire_ibuf(ima, &rj->iuser, &lock);
- if(ibuf) {
+ ibuf = BKE_image_acquire_ibuf(ima, &rj->iuser, &lock);
+ if (ibuf) {
image_buffer_rect_update(rj->scene, rr, ibuf, renrect);
/* make jobs timer to send notifier */
- *(rj->do_update)= 1;
+ *(rj->do_update) = 1;
}
BKE_image_release_ibuf(ima, lock);
}
static void render_startjob(void *rjv, short *stop, short *do_update, float *progress)
{
- RenderJob *rj= rjv;
+ RenderJob *rj = rjv;
- rj->stop= stop;
- rj->do_update= do_update;
- rj->progress= progress;
+ rj->stop = stop;
+ rj->do_update = do_update;
+ rj->progress = progress;
RE_SetReports(rj->re, rj->reports);
- if(rj->anim)
+ if (rj->anim)
RE_BlenderAnim(rj->re, rj->main, rj->scene, rj->camera_override, rj->lay, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step);
else
RE_BlenderFrame(rj->re, rj->main, rj->scene, rj->srl, rj->camera_override, rj->lay, rj->scene->r.cfra, rj->write_still);
@@ -397,17 +397,17 @@ static void render_startjob(void *rjv, short *stop, short *do_update, float *pro
static void render_endjob(void *rjv)
{
- RenderJob *rj= rjv;
+ RenderJob *rj = rjv;
/* this render may be used again by the sequencer without the active 'Render' where the callbacks
* would be re-assigned. assign dummy callbacks to avoid referencing freed renderjobs bug [#24508] */
RE_InitRenderCB(rj->re);
- if(rj->main != G.main)
+ if (rj->main != G.main)
free_main(rj->main);
/* else the frame will not update for the original value */
- if(!(rj->scene->r.scemode & R_NO_FRAME_UPDATE))
+ if (!(rj->scene->r.scemode & R_NO_FRAME_UPDATE))
ED_update_for_newframe(G.main, rj->scene, rj->win->screen, 1);
/* XXX above function sets all tags in nodes */
@@ -416,9 +416,9 @@ static void render_endjob(void *rjv)
/* potentially set by caller */
rj->scene->r.scemode &= ~R_NO_FRAME_UPDATE;
- if(rj->srl) {
+ if (rj->srl) {
nodeUpdateID(rj->scene->nodetree, &rj->scene->id);
- WM_main_add_notifier(NC_NODE|NA_EDITED, rj->scene);
+ WM_main_add_notifier(NC_NODE | NA_EDITED, rj->scene);
}
/* XXX render stability hack */
@@ -429,11 +429,11 @@ static void render_endjob(void *rjv)
/* called by render, check job 'stop' value or the global */
static int render_breakjob(void *rjv)
{
- RenderJob *rj= rjv;
+ RenderJob *rj = rjv;
- if(G.afbreek)
+ if (G.afbreek)
return 1;
- if(rj->stop && *(rj->stop))
+ if (rj->stop && *(rj->stop))
return 1;
return 0;
}
@@ -450,8 +450,8 @@ static void render_drawlock(void *UNUSED(rjv), int lock)
static int screen_render_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
/* no running blender, remove handler and pass through */
- if(0==WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C))) {
- return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
+ if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C))) {
+ return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH;
}
/* running render */
@@ -468,29 +468,29 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
/* new render clears all callbacks */
Main *mainp;
- Scene *scene= CTX_data_scene(C);
- SceneRenderLayer *srl=NULL;
- bScreen *screen= CTX_wm_screen(C);
- View3D *v3d= CTX_wm_view3d(C);
+ Scene *scene = CTX_data_scene(C);
+ SceneRenderLayer *srl = NULL;
+ bScreen *screen = CTX_wm_screen(C);
+ View3D *v3d = CTX_wm_view3d(C);
Render *re;
wmJob *steve;
RenderJob *rj;
Image *ima;
int jobflag;
- const short is_animation= RNA_boolean_get(op->ptr, "animation");
- const short is_write_still= RNA_boolean_get(op->ptr, "write_still");
- struct Object *camera_override= v3d ? V3D_CAMERA_LOCAL(v3d) : NULL;
+ const short is_animation = RNA_boolean_get(op->ptr, "animation");
+ const short is_write_still = RNA_boolean_get(op->ptr, "write_still");
+ struct Object *camera_override = v3d ? V3D_CAMERA_LOCAL(v3d) : NULL;
const char *name;
/* only one render job at a time */
- if(WM_jobs_test(CTX_wm_manager(C), scene))
+ if (WM_jobs_test(CTX_wm_manager(C), scene))
return OPERATOR_CANCELLED;
- if(!RE_is_rendering_allowed(scene, camera_override, op->reports)) {
+ if (!RE_is_rendering_allowed(scene, camera_override, op->reports)) {
return OPERATOR_CANCELLED;
}
- if(!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) {
+ if (!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) {
BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected");
return OPERATOR_CANCELLED;
}
@@ -499,12 +499,12 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
WM_jobs_stop_all(CTX_wm_manager(C));
/* get main */
- if(G.rt == 101) {
+ if (G.rt == 101) {
/* thread-safety experiment, copy main from the undo buffer */
- mainp= BKE_undo_get_main(&scene);
+ mainp = BKE_undo_get_main(&scene);
}
else
- mainp= CTX_data_main(C);
+ mainp = CTX_data_main(C);
/* cancel animation playback */
if (screen->animtimer)
@@ -517,13 +517,13 @@ 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 */
- ED_object_exit_editmode(C, 0); /* 0 = does not exit editmode */
+ ED_object_exit_editmode(C, 0); /* 0 = does not exit editmode */
// store spare
// get view3d layer, local layer, make this nice api call to render
@@ -532,62 +532,62 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* ensure at least 1 area shows result */
render_view_open(C, event->x, event->y);
- jobflag= WM_JOB_EXCL_RENDER|WM_JOB_PRIORITY|WM_JOB_PROGRESS;
+ jobflag = WM_JOB_EXCL_RENDER | WM_JOB_PRIORITY | WM_JOB_PROGRESS;
/* custom scene and single layer re-render */
screen_render_scene_layer_set(op, mainp, &scene, &srl);
- if(RNA_struct_property_is_set(op->ptr, "layer"))
+ if (RNA_struct_property_is_set(op->ptr, "layer"))
jobflag |= WM_JOB_SUSPEND;
/* job custom data */
- rj= MEM_callocN(sizeof(RenderJob), "render job");
- rj->main= mainp;
- rj->scene= scene;
- rj->win= CTX_wm_window(C);
+ rj = MEM_callocN(sizeof(RenderJob), "render job");
+ rj->main = mainp;
+ rj->scene = scene;
+ rj->win = CTX_wm_window(C);
rj->srl = srl;
rj->camera_override = camera_override;
- rj->lay = (v3d)? v3d->lay: scene->lay;
- rj->anim= is_animation;
- rj->write_still= is_write_still && !is_animation;
- rj->iuser.scene= scene;
- rj->iuser.ok= 1;
- rj->reports= op->reports;
+ rj->lay = (v3d) ? v3d->lay : scene->lay;
+ rj->anim = is_animation;
+ rj->write_still = is_write_still && !is_animation;
+ rj->iuser.scene = scene;
+ rj->iuser.ok = 1;
+ rj->reports = op->reports;
/* setup job */
- if(RE_seq_render_active(scene, &scene->r)) name= "Sequence Render";
- else name= "Render";
+ if (RE_seq_render_active(scene, &scene->r)) name = "Sequence Render";
+ else name = "Render";
- steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, name, jobflag);
+ steve = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, name, jobflag);
WM_jobs_customdata(steve, rj, render_freejob);
- WM_jobs_timer(steve, 0.2, NC_SCENE|ND_RENDER_RESULT, 0);
+ WM_jobs_timer(steve, 0.2, NC_SCENE | ND_RENDER_RESULT, 0);
WM_jobs_callbacks(steve, render_startjob, NULL, NULL, render_endjob);
/* get a render result image, and make sure it is empty */
- ima= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
+ ima = BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
BKE_image_backup_render(rj->scene, ima);
- rj->image= ima;
+ rj->image = ima;
/* setup new render */
- re= RE_NewRender(scene->id.name);
+ re = RE_NewRender(scene->id.name);
RE_test_break_cb(re, rj, render_breakjob);
RE_draw_lock_cb(re, rj, render_drawlock);
RE_display_draw_cb(re, rj, image_rect_update);
RE_stats_draw_cb(re, rj, image_renderinfo_cb);
RE_progress_cb(re, rj, render_progress_update);
- rj->re= re;
- G.afbreek= 0;
+ rj->re = re;
+ G.afbreek = 0;
WM_jobs_start(CTX_wm_manager(C), steve);
WM_cursor_wait(0);
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_RESULT, scene);
+ 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 */
@@ -600,20 +600,20 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
void RENDER_OT_render(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Render";
- ot->description= "Render active scene";
- ot->idname= "RENDER_OT_render";
+ ot->name = "Render";
+ ot->description = "Render active scene";
+ ot->idname = "RENDER_OT_render";
/* api callbacks */
- ot->invoke= screen_render_invoke;
- ot->modal= screen_render_modal;
- ot->exec= screen_render_exec;
+ ot->invoke = screen_render_invoke;
+ ot->modal = screen_render_modal;
+ ot->exec = screen_render_exec;
- /*ot->poll= ED_operator_screenactive;*/ /* this isnt needed, causes failer in background mode */
+ /*ot->poll = ED_operator_screenactive;*/ /* this isn't needed, causes failer in background mode */
RNA_def_boolean(ot->srna, "animation", 0, "Animation", "Render files from the animation range of this scene");
RNA_def_boolean(ot->srna, "write_still", 0, "Write Image", "Save rendered the image to the output path (used only when animation is disabled)");
RNA_def_string(ot->srna, "layer", "", RE_MAXNAME, "Render Layer", "Single render layer to re-render (used only when animation is disabled)");
- RNA_def_string(ot->srna, "scene", "", MAX_ID_NAME-2, "Scene", "Scene to render, current scene if not specified");
+ RNA_def_string(ot->srna, "scene", "", MAX_ID_NAME - 2, "Scene", "Scene to render, current scene if not specified");
}
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 4b4d7354898..397f2cc6978 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -50,6 +50,7 @@
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_scene.h"
+#include "BKE_sequencer.h"
#include "BKE_writeavi.h"
#include "WM_api.h"
@@ -87,6 +88,10 @@ typedef struct OGLRender {
short obcenter_dia_back; /* temp overwrite */
+ short is_sequencer;
+ SpaceSeq *sseq;
+
+
Image *ima;
ImageUser iuser;
@@ -104,7 +109,7 @@ typedef struct OGLRender {
/* added because v3d is not always valid */
static unsigned int screen_opengl_layers(OGLRender *oglrender)
{
- if(oglrender->v3d) {
+ if (oglrender->v3d) {
return oglrender->scene->lay | oglrender->v3d->lay;
}
else {
@@ -114,28 +119,48 @@ static unsigned int screen_opengl_layers(OGLRender *oglrender)
static void screen_opengl_render_apply(OGLRender *oglrender)
{
- Scene *scene= oglrender->scene;
- ARegion *ar= oglrender->ar;
- View3D *v3d= oglrender->v3d;
- RegionView3D *rv3d= oglrender->rv3d;
+ Scene *scene = oglrender->scene;
+ ARegion *ar = oglrender->ar;
+ View3D *v3d = oglrender->v3d;
+ RegionView3D *rv3d = oglrender->rv3d;
RenderResult *rr;
- Object *camera= NULL;
+ Object *camera = NULL;
ImBuf *ibuf;
void *lock;
float winmat[4][4];
- int sizex= oglrender->sizex;
- int sizey= oglrender->sizey;
- const short view_context= (v3d != NULL);
+ int sizex = oglrender->sizex;
+ int sizey = oglrender->sizey;
+ const short view_context = (v3d != NULL);
- rr= RE_AcquireResultRead(oglrender->re);
-
- if(view_context) {
+ rr = RE_AcquireResultRead(oglrender->re);
+
+ if (oglrender->is_sequencer) {
+ SeqRenderData context;
+ int chanshown = oglrender->sseq ? oglrender->sseq->chanshown : 0;
+
+ context = seq_new_render_data(oglrender->bmain, scene, oglrender->sizex, oglrender->sizey, 100.0f);
+
+ ibuf = give_ibuf_seq(context, CFRA, chanshown);
+
+ if (ibuf) {
+ BLI_assert((oglrender->sizex == ibuf->x) && (oglrender->sizey == ibuf->y));
+
+ if (ibuf->rect_float == NULL) {
+ IMB_float_from_rect(ibuf);
+ }
+
+ memcpy(rr->rectf, ibuf->rect_float, sizeof(float) * 4 * oglrender->sizex * oglrender->sizey);
+
+ IMB_freeImBuf(ibuf);
+ }
+ }
+ else if (view_context) {
GPU_offscreen_bind(oglrender->ofs); /* bind */
/* render 3d view */
- if(rv3d->persp==RV3D_CAMOB && v3d->camera) {
+ if (rv3d->persp == RV3D_CAMOB && v3d->camera) {
/*int is_ortho= scene->r.mode & R_ORTHO;*/
- camera= v3d->camera;
+ camera = v3d->camera;
RE_GetCameraWindow(oglrender->re, camera, scene->r.cfra, winmat);
}
@@ -143,42 +168,42 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
rctf viewplane;
float clipsta, clipend;
- int is_ortho= ED_view3d_viewplane_get(v3d, rv3d, sizex, sizey, &viewplane, &clipsta, &clipend);
- if(is_ortho) orthographic_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, -clipend, clipend);
- else perspective_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clipsta, clipend);
+ int is_ortho = ED_view3d_viewplane_get(v3d, rv3d, sizex, sizey, &viewplane, &clipsta, &clipend);
+ if (is_ortho) orthographic_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, -clipend, clipend);
+ else perspective_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clipsta, clipend);
}
- if((scene->r.mode & R_OSA) == 0) {
- ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat);
+ if ((scene->r.mode & R_OSA) == 0) {
+ ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat, TRUE);
GPU_offscreen_read_pixels(oglrender->ofs, GL_FLOAT, rr->rectf);
}
else {
/* simple accumulation, less hassle then FSAA FBO's */
static float jit_ofs[32][2];
float winmat_jitter[4][4];
- float *accum_buffer= MEM_mallocN(sizex * sizey * sizeof(float) * 4, "accum1");
- float *accum_tmp= MEM_mallocN(sizex * sizey * sizeof(float) * 4, "accum2");
+ float *accum_buffer = MEM_mallocN(sizex * sizey * sizeof(float) * 4, "accum1");
+ float *accum_tmp = MEM_mallocN(sizex * sizey * sizeof(float) * 4, "accum2");
int j;
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 */
- for(j=1; j < scene->r.osa; j++) {
+ for (j = 1; j < scene->r.osa; j++) {
copy_m4_m4(winmat_jitter, winmat);
window_translate_m4(winmat_jitter, rv3d->persmat,
(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));
+ add_vn_vn(accum_buffer, accum_tmp, sizex * sizey * sizeof(float));
}
- mul_vn_vn_fl(rr->rectf, accum_buffer, sizex*sizey*sizeof(float), 1.0f / scene->r.osa);
+ mul_vn_vn_fl(rr->rectf, accum_buffer, sizex * sizey * sizeof(float), 1.0f / scene->r.osa);
MEM_freeN(accum_buffer);
MEM_freeN(accum_tmp);
@@ -188,22 +213,22 @@ 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);
- camera= scene->camera;
+ 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, TRUE, err_out);
+ camera = scene->camera;
- if(ibuf_view) {
+ if (ibuf_view) {
memcpy(rr->rectf, ibuf_view->rect_float, sizeof(float) * 4 * oglrender->sizex * oglrender->sizey);
IMB_freeImBuf(ibuf_view);
}
else {
- fprintf(stderr, "screen_opengl_render_apply: failed to get buffer, %s\n", err_out);
+ fprintf(stderr, "%s: failed to get buffer, %s\n", __func__, err_out);
}
}
/* rr->rectf is now filled with image data */
- if((scene->r.stamp & R_STAMP_ALL) && (scene->r.stamp & R_STAMP_DRAW))
+ if ((scene->r.stamp & R_STAMP_ALL) && (scene->r.stamp & R_STAMP_DRAW))
BKE_stamp_buf(scene, camera, NULL, rr->rectf, rr->rectx, rr->recty, 4);
/* note on color management:
@@ -214,34 +239,34 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
* sRGB again, and so that e.g. openexr saving also saves the correct linear
* float buffer. */
- if(oglrender->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) {
- int predivide= 0; /* no alpha */
+ if (oglrender->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) {
+ int predivide = 0; /* no alpha */
IMB_buffer_float_from_float(rr->rectf, rr->rectf,
- 4, IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB, predivide,
- oglrender->sizex, oglrender->sizey, oglrender->sizex, oglrender->sizex);
+ 4, IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB, predivide,
+ oglrender->sizex, oglrender->sizey, oglrender->sizex, oglrender->sizex);
}
RE_ReleaseResult(oglrender->re);
/* update byte from float buffer */
- ibuf= BKE_image_acquire_ibuf(oglrender->ima, &oglrender->iuser, &lock);
+ ibuf = BKE_image_acquire_ibuf(oglrender->ima, &oglrender->iuser, &lock);
- if(ibuf) {
+ if (ibuf) {
image_buffer_rect_update(scene, rr, ibuf, NULL);
- if(oglrender->write_still) {
+ if (oglrender->write_still) {
char name[FILE_MAX];
int ok;
- if(scene->r.im_format.planes == R_IMF_CHAN_DEPTH_8) {
+ if (scene->r.im_format.planes == R_IMF_CHAN_DEPTH_8) {
IMB_color_to_bw(ibuf);
}
BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, scene->r.im_format.imtype, scene->r.scemode & R_EXTENSION, FALSE);
- ok= BKE_write_ibuf_as(ibuf, name, &scene->r.im_format, TRUE); /* no need to stamp here */
- if(ok) printf("OpenGL Render written to '%s'\n", name);
- else printf("OpenGL Render failed to write '%s'\n", name);
+ ok = BKE_write_ibuf_as(ibuf, name, &scene->r.im_format, TRUE); /* no need to stamp here */
+ if (ok) printf("OpenGL Render written to '%s'\n", name);
+ else printf("OpenGL Render failed to write '%s'\n", name);
}
}
@@ -251,40 +276,41 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
static int screen_opengl_render_init(bContext *C, wmOperator *op)
{
/* new render clears all callbacks */
- Scene *scene= CTX_data_scene(C);
- ScrArea *prevsa= CTX_wm_area(C);
- ARegion *prevar= CTX_wm_region(C);
+ Scene *scene = CTX_data_scene(C);
+ ScrArea *prevsa = CTX_wm_area(C);
+ ARegion *prevar = CTX_wm_region(C);
RenderResult *rr;
GPUOffScreen *ofs;
OGLRender *oglrender;
int sizex, sizey;
- short is_view_context= RNA_boolean_get(op->ptr, "view_context");
- const short is_animation= RNA_boolean_get(op->ptr, "animation");
- const short is_write_still= RNA_boolean_get(op->ptr, "write_still");
- char err_out[256]= "unknown";
+ short is_view_context = RNA_boolean_get(op->ptr, "view_context");
+ const short is_animation = RNA_boolean_get(op->ptr, "animation");
+ const short is_sequencer = RNA_boolean_get(op->ptr, "sequencer");
+ const short is_write_still = RNA_boolean_get(op->ptr, "write_still");
+ char err_out[256] = "unknown";
- if(G.background) {
+ if (G.background) {
BKE_report(op->reports, RPT_ERROR, "Can't use OpenGL render in background mode (no opengl context)");
return 0;
}
/* ensure we have a 3d view */
- if(!ED_view3d_context_activate(C)) {
+ if (!ED_view3d_context_activate(C)) {
RNA_boolean_set(op->ptr, "view_context", FALSE);
is_view_context = 0;
}
/* only one render job at a time */
- if(WM_jobs_test(CTX_wm_manager(C), scene))
+ if (WM_jobs_test(CTX_wm_manager(C), scene))
return 0;
- if(!is_view_context && scene->camera==NULL) {
+ if (!is_view_context && scene->camera == NULL) {
BKE_report(op->reports, RPT_ERROR, "Scene has no camera");
return 0;
}
- if(!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) {
+ if (!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) {
BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected");
return 0;
}
@@ -296,66 +322,73 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
WM_cursor_wait(1);
/* create offscreen buffer */
- sizex= (scene->r.size*scene->r.xsch)/100;
- sizey= (scene->r.size*scene->r.ysch)/100;
+ sizex = (scene->r.size * scene->r.xsch) / 100;
+ sizey = (scene->r.size * scene->r.ysch) / 100;
/* corrects render size with actual size, not every card supports non-power-of-two dimensions */
- ofs= GPU_offscreen_create(sizex, sizey, err_out);
+ ofs = GPU_offscreen_create(sizex, sizey, err_out);
- if(!ofs) {
+ if (!ofs) {
BKE_reportf(op->reports, RPT_ERROR, "Failed to create OpenGL offscreen buffer, %s", err_out);
return 0;
}
/* allocate opengl render */
- oglrender= MEM_callocN(sizeof(OGLRender), "OGLRender");
- op->customdata= oglrender;
+ oglrender = MEM_callocN(sizeof(OGLRender), "OGLRender");
+ op->customdata = oglrender;
- oglrender->ofs= ofs;
- oglrender->sizex= sizex;
- oglrender->sizey= sizey;
- oglrender->bmain= CTX_data_main(C);
- oglrender->scene= scene;
+ oglrender->ofs = ofs;
+ oglrender->sizex = sizex;
+ 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;
+
+ oglrender->is_sequencer = is_sequencer;
+ if (is_sequencer) {
+ oglrender->sseq = CTX_wm_space_seq(C);;
+ }
- oglrender->write_still= is_write_still && !is_animation;
oglrender->obcenter_dia_back = U.obcenter_dia;
U.obcenter_dia = 0;
- oglrender->prevsa= prevsa;
- oglrender->prevar= prevar;
+ oglrender->prevsa = prevsa;
+ oglrender->prevar = prevar;
- if(is_view_context) {
+ if (is_view_context) {
ED_view3d_context_user_region(C, &oglrender->v3d, &oglrender->ar); /* so quad view renders camera */
- oglrender->rv3d= oglrender->ar->regiondata;
+ oglrender->rv3d = oglrender->ar->regiondata;
/* MUST be cleared on exit */
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;
}
/* create render */
- oglrender->re= RE_NewRender(scene->id.name);
+ oglrender->re = RE_NewRender(scene->id.name);
/* create image and image user */
- oglrender->ima= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
+ oglrender->ima = BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
BKE_image_signal(oglrender->ima, NULL, IMA_SIGNAL_FREE);
BKE_image_backup_render(oglrender->scene, oglrender->ima);
- oglrender->iuser.scene= scene;
- oglrender->iuser.ok= 1;
+ oglrender->iuser.scene = scene;
+ oglrender->iuser.ok = 1;
/* create render result */
RE_InitState(oglrender->re, NULL, &scene->r, NULL, sizex, sizey, NULL);
- rr= RE_AcquireResultWrite(oglrender->re);
- if(rr->rectf==NULL)
- rr->rectf= MEM_callocN(sizeof(float)*4*sizex*sizey, "screen_opengl_render_init rect");
+ rr = RE_AcquireResultWrite(oglrender->re);
+ if (rr->rectf == NULL)
+ rr->rectf = MEM_callocN(sizeof(float) * 4 * sizex * sizey, "screen_opengl_render_init rect");
RE_ReleaseResult(oglrender->re);
return 1;
@@ -363,29 +396,29 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
static void screen_opengl_render_end(bContext *C, OGLRender *oglrender)
{
- Main *bmain= CTX_data_main(C);
- Scene *scene= oglrender->scene;
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = oglrender->scene;
- if(oglrender->mh) {
- if(BKE_imtype_is_movie(scene->r.im_format.imtype))
+ if (oglrender->mh) {
+ if (BKE_imtype_is_movie(scene->r.im_format.imtype))
oglrender->mh->end_movie();
}
- if(oglrender->timer) { /* exec will not have a timer */
- scene->r.cfra= oglrender->cfrao;
+ if (oglrender->timer) { /* exec will not have a timer */
+ scene->r.cfra = oglrender->cfrao;
scene_update_for_newframe(bmain, scene, screen_opengl_layers(oglrender));
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), oglrender->timer);
}
WM_cursor_wait(0);
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_RESULT, oglrender->scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_RENDER_RESULT, oglrender->scene);
U.obcenter_dia = oglrender->obcenter_dia_back;
GPU_offscreen_free(oglrender->ofs);
- oglrender->scene->customdata_mask_modal= 0;
+ oglrender->scene->customdata_mask_modal = 0;
CTX_wm_area_set(C, oglrender->prevsa);
CTX_wm_region_set(C, oglrender->prevar);
@@ -407,45 +440,45 @@ static int screen_opengl_render_anim_initialize(bContext *C, wmOperator *op)
OGLRender *oglrender;
Scene *scene;
- oglrender= op->customdata;
- scene= oglrender->scene;
+ oglrender = op->customdata;
+ scene = oglrender->scene;
- oglrender->reports= op->reports;
- oglrender->mh= BKE_get_movie_handle(scene->r.im_format.imtype);
- if(BKE_imtype_is_movie(scene->r.im_format.imtype)) {
- if(!oglrender->mh->start_movie(scene, &scene->r, oglrender->sizex, oglrender->sizey, oglrender->reports)) {
+ oglrender->reports = op->reports;
+ oglrender->mh = BKE_get_movie_handle(scene->r.im_format.imtype);
+ if (BKE_imtype_is_movie(scene->r.im_format.imtype)) {
+ if (!oglrender->mh->start_movie(scene, &scene->r, oglrender->sizex, oglrender->sizey, oglrender->reports)) {
screen_opengl_render_end(C, oglrender);
return 0;
}
}
- oglrender->cfrao= scene->r.cfra;
- oglrender->nfra= PSFRA;
- scene->r.cfra= PSFRA;
+ oglrender->cfrao = scene->r.cfra;
+ oglrender->nfra = PSFRA;
+ scene->r.cfra = PSFRA;
return 1;
}
static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
{
- Main *bmain= CTX_data_main(C);
- OGLRender *oglrender= op->customdata;
- Scene *scene= oglrender->scene;
+ Main *bmain = CTX_data_main(C);
+ OGLRender *oglrender = op->customdata;
+ Scene *scene = oglrender->scene;
ImBuf *ibuf;
void *lock;
char name[FILE_MAX];
- int ok= 0;
- const short view_context= (oglrender->v3d != NULL);
- Object *camera= NULL;
+ int ok = 0;
+ const short view_context = (oglrender->v3d != NULL);
+ Object *camera = NULL;
/* update animated image textures for gpu, etc,
- * call before scene_update_for_newframe so modifiers with textuers dont lag 1 frame */
+ * call before scene_update_for_newframe so modifiers with textuers don't lag 1 frame */
ED_image_update_frame(bmain, scene->r.cfra);
/* go to next frame */
- while(CFRA<oglrender->nfra) {
- unsigned int lay= screen_opengl_layers(oglrender);
+ while (CFRA < oglrender->nfra) {
+ unsigned int lay = screen_opengl_layers(oglrender);
- if(lay & 0xFF000000)
+ if (lay & 0xFF000000)
lay &= 0xFF000000;
scene_update_for_newframe(bmain, scene, lay);
@@ -454,61 +487,61 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
scene_update_for_newframe(bmain, scene, screen_opengl_layers(oglrender));
- if(view_context) {
- if(oglrender->rv3d->persp==RV3D_CAMOB && oglrender->v3d->camera && oglrender->v3d->scenelock) {
+ if (view_context) {
+ if (oglrender->rv3d->persp == RV3D_CAMOB && oglrender->v3d->camera && oglrender->v3d->scenelock) {
/* since scene_update_for_newframe() is used rather
* then ED_update_for_newframe() the camera needs to be set */
- if(scene_camera_switch_update(scene)) {
- oglrender->v3d->camera= scene->camera;
+ if (scene_camera_switch_update(scene)) {
+ oglrender->v3d->camera = scene->camera;
}
- camera= oglrender->v3d->camera;
+ camera = oglrender->v3d->camera;
}
}
else {
scene_camera_switch_update(scene);
- camera= scene->camera;
+ camera = scene->camera;
}
/* render into offscreen buffer */
screen_opengl_render_apply(oglrender);
/* save to disk */
- ibuf= BKE_image_acquire_ibuf(oglrender->ima, &oglrender->iuser, &lock);
+ ibuf = BKE_image_acquire_ibuf(oglrender->ima, &oglrender->iuser, &lock);
- if(ibuf) {
+ if (ibuf) {
/* color -> greyscale */
/* editing directly would alter the render view */
- if(scene->r.im_format.planes == R_IMF_PLANES_BW) {
- ImBuf *ibuf_bw= IMB_dupImBuf(ibuf);
+ if (scene->r.im_format.planes == R_IMF_PLANES_BW) {
+ ImBuf *ibuf_bw = IMB_dupImBuf(ibuf);
IMB_color_to_bw(ibuf_bw);
// IMB_freeImBuf(ibuf); /* owned by the image */
- ibuf= ibuf_bw;
+ ibuf = ibuf_bw;
}
else {
/* this is lightweight & doesnt re-alloc the buffers, only do this
* to save the correct bit depth since the image is always RGBA */
- ImBuf *ibuf_cpy= IMB_allocImBuf(ibuf->x, ibuf->y, scene->r.im_format.planes, 0);
- ibuf_cpy->rect= ibuf->rect;
- ibuf_cpy->rect_float= ibuf->rect_float;
- ibuf_cpy->zbuf_float= ibuf->zbuf_float;
- ibuf= ibuf_cpy;
+ ImBuf *ibuf_cpy = IMB_allocImBuf(ibuf->x, ibuf->y, scene->r.im_format.planes, 0);
+ ibuf_cpy->rect = ibuf->rect;
+ ibuf_cpy->rect_float = ibuf->rect_float;
+ ibuf_cpy->zbuf_float = ibuf->zbuf_float;
+ ibuf = ibuf_cpy;
}
- if(BKE_imtype_is_movie(scene->r.im_format.imtype)) {
- ok= oglrender->mh->append_movie(&scene->r, SFRA, CFRA, (int*)ibuf->rect,
- oglrender->sizex, oglrender->sizey, oglrender->reports);
- if(ok) {
+ if (BKE_imtype_is_movie(scene->r.im_format.imtype)) {
+ ok = oglrender->mh->append_movie(&scene->r, SFRA, CFRA, (int *)ibuf->rect,
+ oglrender->sizex, oglrender->sizey, oglrender->reports);
+ if (ok) {
printf("Append frame %d", scene->r.cfra);
BKE_reportf(op->reports, RPT_INFO, "Appended frame: %d", scene->r.cfra);
}
}
else {
BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, scene->r.im_format.imtype, scene->r.scemode & R_EXTENSION, TRUE);
- ok= BKE_write_ibuf_stamp(scene, camera, ibuf, name, &scene->r.im_format);
+ ok = BKE_write_ibuf_stamp(scene, camera, ibuf, name, &scene->r.im_format);
- if(ok==0) {
+ if (ok == 0) {
printf("Write error: cannot save %s\n", name);
BKE_reportf(op->reports, RPT_ERROR, "Write error: cannot save %s", name);
}
@@ -532,7 +565,7 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
scene->r.cfra++;
/* stop at the end or on error */
- if(scene->r.cfra > PEFRA || !ok) {
+ if (scene->r.cfra > PEFRA || !ok) {
screen_opengl_render_end(C, op->customdata);
return 0;
}
@@ -543,18 +576,18 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
static int screen_opengl_render_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- OGLRender *oglrender= op->customdata;
- int anim= RNA_boolean_get(op->ptr, "animation");
+ OGLRender *oglrender = op->customdata;
+ int anim = RNA_boolean_get(op->ptr, "animation");
int ret;
- switch(event->type) {
+ switch (event->type) {
case ESCKEY:
/* cancel */
screen_opengl_render_end(C, op->customdata);
return OPERATOR_FINISHED;
case TIMER:
/* render frame? */
- if(oglrender->timer == event->customdata)
+ if (oglrender->timer == event->customdata)
break;
default:
/* nothing to do */
@@ -562,18 +595,18 @@ static int screen_opengl_render_modal(bContext *C, wmOperator *op, wmEvent *even
}
/* run first because screen_opengl_render_anim_step can free oglrender */
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_RESULT, oglrender->scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_RENDER_RESULT, oglrender->scene);
- if(anim == 0) {
+ if (anim == 0) {
screen_opengl_render_apply(op->customdata);
screen_opengl_render_end(C, op->customdata);
return OPERATOR_FINISHED;
}
else
- ret= screen_opengl_render_anim_step(C, op);
+ ret = screen_opengl_render_anim_step(C, op);
/* stop at the end or on error */
- if(ret == 0) {
+ if (ret == 0) {
return OPERATOR_FINISHED;
}
@@ -583,21 +616,21 @@ static int screen_opengl_render_modal(bContext *C, wmOperator *op, wmEvent *even
static int screen_opengl_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
OGLRender *oglrender;
- int anim= RNA_boolean_get(op->ptr, "animation");
+ int anim = RNA_boolean_get(op->ptr, "animation");
- if(!screen_opengl_render_init(C, op))
+ if (!screen_opengl_render_init(C, op))
return OPERATOR_CANCELLED;
- if(anim) {
- if(!screen_opengl_render_anim_initialize(C, op))
+ if (anim) {
+ if (!screen_opengl_render_anim_initialize(C, op))
return OPERATOR_CANCELLED;
}
- oglrender= op->customdata;
+ oglrender = op->customdata;
render_view_open(C, event->x, event->y);
WM_event_add_modal_handler(C, op);
- oglrender->timer= WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f);
+ oglrender->timer = WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f);
return OPERATOR_RUNNING_MODAL;
}
@@ -605,12 +638,12 @@ static int screen_opengl_render_invoke(bContext *C, wmOperator *op, wmEvent *eve
/* executes blocking render */
static int screen_opengl_render_exec(bContext *C, wmOperator *op)
{
- const short is_animation= RNA_boolean_get(op->ptr, "animation");
+ const short is_animation = RNA_boolean_get(op->ptr, "animation");
- if(!screen_opengl_render_init(C, op))
+ if (!screen_opengl_render_init(C, op))
return OPERATOR_CANCELLED;
- if(!is_animation) { /* same as invoke */
+ if (!is_animation) { /* same as invoke */
/* render image */
screen_opengl_render_apply(op->customdata);
screen_opengl_render_end(C, op->customdata);
@@ -618,41 +651,49 @@ static int screen_opengl_render_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
else {
- int ret= 1;
+ int ret = 1;
- if(!screen_opengl_render_anim_initialize(C, op))
+ if (!screen_opengl_render_anim_initialize(C, op))
return OPERATOR_CANCELLED;
- while(ret) {
- ret= screen_opengl_render_anim_step(C, op);
+ while (ret) {
+ ret = screen_opengl_render_anim_step(C, op);
}
}
// no redraw needed, we leave state as we entered it
// ED_update_for_newframe(C, 1);
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_RESULT, CTX_data_scene(C));
+ WM_event_add_notifier(C, NC_SCENE | ND_RENDER_RESULT, CTX_data_scene(C));
return OPERATOR_FINISHED;
}
void RENDER_OT_opengl(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
- ot->name= "OpenGL Render";
- ot->description= "OpenGL render active viewport";
- ot->idname= "RENDER_OT_opengl";
+ ot->name = "OpenGL Render";
+ ot->description = "OpenGL render active viewport";
+ ot->idname = "RENDER_OT_opengl";
/* api callbacks */
- ot->invoke= screen_opengl_render_invoke;
- ot->exec= screen_opengl_render_exec; /* blocking */
- ot->modal= screen_opengl_render_modal;
- ot->cancel= screen_opengl_render_cancel;
-
- ot->poll= ED_operator_screenactive;
+ ot->invoke = screen_opengl_render_invoke;
+ ot->exec = screen_opengl_render_exec; /* blocking */
+ ot->modal = screen_opengl_render_modal;
+ ot->cancel = screen_opengl_render_cancel;
+
+ ot->poll = ED_operator_screenactive;
+
+ prop = RNA_def_boolean(ot->srna, "animation", 0, "Animation", "Render files from the animation range of this scene");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ prop = RNA_def_boolean(ot->srna, "sequencer", 0, "Sequencer", "Render using the sequencer's OpenGL display");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ prop = RNA_def_boolean(ot->srna, "write_still", 0, "Write Image", "Save rendered the image to the output path (used only when animation is disabled)");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ prop = RNA_def_boolean(ot->srna, "view_context", 1, "View Context", "Use the current 3D view for rendering, else use scene settings");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
- RNA_def_boolean(ot->srna, "animation", 0, "Animation", "Render files from the animation range of this scene");
- RNA_def_boolean(ot->srna, "write_still", 0, "Write Image", "Save rendered the image to the output path (used only when animation is disabled)");
- RNA_def_boolean(ot->srna, "view_context", 1, "View Context", "Use the current 3D view for rendering, else use scene settings");
}
/* function for getting an opengl buffer from a View3D, used by sequencer */
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index 3eda30e1554..27e1486c4f3 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -100,9 +100,9 @@
#include "render_intern.h"
-ImBuf* get_brush_icon(Brush *brush)
+ImBuf *get_brush_icon(Brush *brush)
{
- static const int flags = IB_rect|IB_multilayer|IB_metadata;
+ static const int flags = IB_rect | IB_multilayer | IB_metadata;
char path[FILE_MAX];
char *folder;
@@ -116,16 +116,16 @@ ImBuf* get_brush_icon(Brush *brush)
BLI_strncpy(path, brush->icon_filepath, sizeof(brush->icon_filepath));
BLI_path_abs(path, G.main->name);
- brush->icon_imbuf= IMB_loadiffname(path, flags);
+ brush->icon_imbuf = IMB_loadiffname(path, flags);
// otherwise lets try to find it in other directories
if (!(brush->icon_imbuf)) {
- folder= BLI_get_folder(BLENDER_DATAFILES, "brushicons");
+ folder = BLI_get_folder(BLENDER_DATAFILES, "brushicons");
BLI_make_file_string(G.main->name, path, folder, brush->icon_filepath);
if (path[0])
- brush->icon_imbuf= IMB_loadiffname(path, flags);
+ brush->icon_imbuf = IMB_loadiffname(path, flags);
}
if (brush->icon_imbuf)
@@ -156,7 +156,7 @@ typedef struct ShaderPreview {
Lamp *lampcopy;
World *worldcopy;
- float col[4]; /* active object color */
+ float col[4]; /* active object color */
int sizex, sizey;
unsigned int *pr_rect;
@@ -179,7 +179,7 @@ typedef struct IconPreview {
/* *************************** Preview for buttons *********************** */
-static Main *pr_main= NULL;
+static Main *pr_main = NULL;
void ED_preview_init_dbase(void)
{
@@ -187,44 +187,44 @@ void ED_preview_init_dbase(void)
BlendFileData *bfd;
extern int datatoc_preview_blend_size;
extern char datatoc_preview_blend[];
- const int fileflags= G.fileflags;
+ const int fileflags = G.fileflags;
G.fileflags |= G_FILE_NO_UI;
- bfd= BLO_read_from_memory(datatoc_preview_blend, datatoc_preview_blend_size, NULL);
+ bfd = BLO_read_from_memory(datatoc_preview_blend, datatoc_preview_blend_size, NULL);
if (bfd) {
- pr_main= bfd->main;
+ pr_main = bfd->main;
MEM_freeN(bfd);
}
- G.fileflags= fileflags;
+ G.fileflags = fileflags;
#endif
}
void ED_preview_free_dbase(void)
{
- if(pr_main)
+ if (pr_main)
free_main(pr_main);
}
static int preview_mat_has_sss(Material *mat, bNodeTree *ntree)
{
- if(mat) {
- if(mat->sss_flag & MA_DIFF_SSS)
+ if (mat) {
+ if (mat->sss_flag & MA_DIFF_SSS)
return 1;
- if(mat->nodetree)
- if( preview_mat_has_sss(NULL, mat->nodetree))
+ if (mat->nodetree)
+ if (preview_mat_has_sss(NULL, mat->nodetree))
return 1;
}
- else if(ntree) {
+ else if (ntree) {
bNode *node;
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type==NODE_GROUP && node->id) {
- if( preview_mat_has_sss(NULL, (bNodeTree *)node->id))
+ for (node = ntree->nodes.first; node; node = node->next) {
+ if (node->type == NODE_GROUP && node->id) {
+ if (preview_mat_has_sss(NULL, (bNodeTree *)node->id))
return 1;
}
- else if(node->id && ELEM(node->type, SH_NODE_MATERIAL, SH_NODE_MATERIAL_EXT)) {
- mat= (Material *)node->id;
- if(mat->sss_flag & MA_DIFF_SSS)
+ else if (node->id && ELEM(node->type, SH_NODE_MATERIAL, SH_NODE_MATERIAL_EXT)) {
+ mat = (Material *)node->id;
+ if (mat->sss_flag & MA_DIFF_SSS)
return 1;
}
}
@@ -239,75 +239,75 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
Scene *sce;
Base *base;
- if(pr_main==NULL) return NULL;
+ if (pr_main == NULL) return NULL;
- sce= pr_main->scene.first;
- if(sce) {
+ sce = pr_main->scene.first;
+ if (sce) {
/* this flag tells render to not execute depsgraph or ipos etc */
sce->r.scemode |= R_PREVIEWBUTS;
/* set world always back, is used now */
- sce->world= pr_main->world.first;
+ sce->world = pr_main->world.first;
/* now: exposure copy */
- if(scene->world) {
- sce->world->exp= scene->world->exp;
- sce->world->range= scene->world->range;
+ if (scene->world) {
+ sce->world->exp = scene->world->exp;
+ sce->world->range = scene->world->range;
}
sce->r.color_mgt_flag = scene->r.color_mgt_flag;
/* prevent overhead for small renders and icons (32) */
- if(id && sp->sizex < 40)
- sce->r.xparts= sce->r.yparts= 1;
+ if (id && sp->sizex < 40)
+ sce->r.xparts = sce->r.yparts = 1;
else
- sce->r.xparts= sce->r.yparts= 4;
+ sce->r.xparts = sce->r.yparts = 4;
/* exception: don't color manage texture previews or icons */
- if((id && sp->pr_method==PR_ICON_RENDER) || id_type == ID_TE)
+ if ((id && sp->pr_method == PR_ICON_RENDER) || id_type == ID_TE)
sce->r.color_mgt_flag &= ~R_COLOR_MANAGEMENT;
- if((id && sp->pr_method==PR_ICON_RENDER) && id_type != ID_WO)
- sce->r.alphamode= R_ALPHAPREMUL;
+ if ((id && sp->pr_method == PR_ICON_RENDER) && id_type != ID_WO)
+ sce->r.alphamode = R_ALPHAPREMUL;
else
- sce->r.alphamode= R_ADDSKY;
+ sce->r.alphamode = R_ADDSKY;
- sce->r.cfra= scene->r.cfra;
+ sce->r.cfra = scene->r.cfra;
BLI_strncpy(sce->r.engine, scene->r.engine, sizeof(sce->r.engine));
- if(id_type==ID_MA) {
- Material *mat= NULL, *origmat= (Material *)id;
+ if (id_type == ID_MA) {
+ Material *mat = NULL, *origmat = (Material *)id;
- if(origmat) {
+ if (origmat) {
/* work on a copy */
- mat= localize_material(origmat);
- sp->matcopy= mat;
+ mat = localize_material(origmat);
+ sp->matcopy = mat;
BLI_addtail(&pr_main->mat, mat);
- init_render_material(mat, 0, NULL); /* call that retrieves mode_l */
+ init_render_material(mat, 0, NULL); /* call that retrieves mode_l */
end_render_material(mat);
/* un-useful option */
- if(sp->pr_method==PR_ICON_RENDER)
+ if (sp->pr_method == PR_ICON_RENDER)
mat->shade_flag &= ~MA_OBCOLOR;
/* turn on raytracing if needed */
- if(mat->mode_l & MA_RAYMIRROR)
+ if (mat->mode_l & MA_RAYMIRROR)
sce->r.mode |= R_RAYTRACE;
- if(mat->material_type == MA_TYPE_VOLUME)
+ if (mat->material_type == MA_TYPE_VOLUME)
sce->r.mode |= R_RAYTRACE;
- if((mat->mode_l & MA_RAYTRANSP) && (mat->mode_l & MA_TRANSP))
+ if ((mat->mode_l & MA_RAYTRANSP) && (mat->mode_l & MA_TRANSP))
sce->r.mode |= R_RAYTRACE;
- if(preview_mat_has_sss(mat, NULL))
+ if (preview_mat_has_sss(mat, NULL))
sce->r.mode |= R_SSS;
/* turn off fake shadows if needed */
/* this only works in a specific case where the preview.blend contains
* an object starting with 'c' which has a material linked to it (not the obdata)
* and that material has a fake shadow texture in the active texture slot */
- for(base= sce->base.first; base; base= base->next) {
- if(base->object->id.name[2]=='c') {
- Material *shadmat= give_current_material(base->object, base->object->actcol);
- if(shadmat) {
+ for (base = sce->base.first; base; base = base->next) {
+ if (base->object->id.name[2] == 'c') {
+ Material *shadmat = give_current_material(base->object, base->object->actcol);
+ if (shadmat) {
if (mat->mode & MA_SHADBUF) shadmat->septex = 0;
else shadmat->septex |= 1;
}
@@ -316,11 +316,11 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
/* turn off bounce lights for volume,
* doesn't make much visual difference and slows it down too */
- if(mat->material_type == MA_TYPE_VOLUME) {
- for(base= sce->base.first; base; base= base->next) {
- if(base->object->type == OB_LAMP) {
+ if (mat->material_type == MA_TYPE_VOLUME) {
+ for (base = sce->base.first; base; base = base->next) {
+ if (base->object->type == OB_LAMP) {
/* if doesn't match 'Lamp.002' --> main key light */
- if( strcmp(base->object->id.name+2, "Lamp.002") != 0 ) {
+ if (strcmp(base->object->id.name + 2, "Lamp.002") != 0) {
base->object->restrictflag |= OB_RESTRICT_RENDER;
}
}
@@ -328,17 +328,17 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
}
- if(sp->pr_method==PR_ICON_RENDER) {
+ if (sp->pr_method == PR_ICON_RENDER) {
if (mat->material_type == MA_TYPE_HALO) {
- sce->lay= 1<<MA_FLAT;
+ sce->lay = 1 << MA_FLAT;
}
else {
- sce->lay= 1<<MA_SPHERE_A;
+ sce->lay = 1 << MA_SPHERE_A;
}
}
else {
- sce->lay= 1<<mat->pr_type;
- if(mat->nodetree && sp->pr_method==PR_NODE_RENDER) {
+ sce->lay = 1 << mat->pr_type;
+ if (mat->nodetree && sp->pr_method == PR_NODE_RENDER) {
/* two previews, they get copied by wmJob */
ntreeInitPreview(mat->nodetree, sp->sizex, sp->sizey);
ntreeInitPreview(origmat->nodetree, sp->sizex, sp->sizey);
@@ -346,114 +346,115 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
}
}
else {
- sce->r.mode &= ~(R_OSA|R_RAYTRACE|R_SSS);
+ sce->r.mode &= ~(R_OSA | R_RAYTRACE | R_SSS);
}
- for(base= sce->base.first; base; base= base->next) {
- if(base->object->id.name[2]=='p') {
+ for (base = sce->base.first; base; base = base->next) {
+ if (base->object->id.name[2] == 'p') {
/* copy over object color, in case material uses it */
copy_v4_v4(base->object->col, sp->col);
- if(OB_TYPE_SUPPORT_MATERIAL(base->object->type)) {
+ if (OB_TYPE_SUPPORT_MATERIAL(base->object->type)) {
/* don't use assign_material, it changed mat->id.us, which shows in the UI */
- Material ***matar= give_matarar(base->object);
- int actcol= MAX2(base->object->actcol > 0, 1) - 1;
+ Material ***matar = give_matarar(base->object);
+ int actcol = MAX2(base->object->actcol > 0, 1) - 1;
- if(matar && actcol < base->object->totcol)
- (*matar)[actcol]= mat;
- } else if (base->object->type == OB_LAMP) {
+ if (matar && actcol < base->object->totcol)
+ (*matar)[actcol] = mat;
+ }
+ else if (base->object->type == OB_LAMP) {
base->object->restrictflag &= ~OB_RESTRICT_RENDER;
}
}
}
}
- else if(id_type==ID_TE) {
- Tex *tex= NULL, *origtex= (Tex *)id;
+ else if (id_type == ID_TE) {
+ Tex *tex = NULL, *origtex = (Tex *)id;
- if(origtex) {
- tex= localize_texture(origtex);
- sp->texcopy= tex;
+ if (origtex) {
+ tex = localize_texture(origtex);
+ sp->texcopy = tex;
BLI_addtail(&pr_main->tex, tex);
}
- sce->lay= 1<<MA_TEXTURE;
+ sce->lay = 1 << MA_TEXTURE;
- for(base= sce->base.first; base; base= base->next) {
- if(base->object->id.name[2]=='t') {
- Material *mat= give_current_material(base->object, base->object->actcol);
- if(mat && mat->mtex[0]) {
- mat->mtex[0]->tex= tex;
+ for (base = sce->base.first; base; base = base->next) {
+ if (base->object->id.name[2] == 't') {
+ Material *mat = give_current_material(base->object, base->object->actcol);
+ if (mat && mat->mtex[0]) {
+ mat->mtex[0]->tex = tex;
- if(tex && sp->slot)
+ if (tex && sp->slot)
mat->mtex[0]->which_output = sp->slot->which_output;
/* show alpha in this case */
- if(tex==NULL || (tex->flag & TEX_PRV_ALPHA)) {
+ if (tex == NULL || (tex->flag & TEX_PRV_ALPHA)) {
mat->mtex[0]->mapto |= MAP_ALPHA;
- mat->alpha= 0.0f;
+ mat->alpha = 0.0f;
}
else {
mat->mtex[0]->mapto &= ~MAP_ALPHA;
- mat->alpha= 1.0f;
+ mat->alpha = 1.0f;
}
}
}
}
- if(tex && tex->nodetree && sp->pr_method==PR_NODE_RENDER) {
+ if (tex && tex->nodetree && sp->pr_method == PR_NODE_RENDER) {
/* two previews, they get copied by wmJob */
ntreeInitPreview(origtex->nodetree, sp->sizex, sp->sizey);
ntreeInitPreview(tex->nodetree, sp->sizex, sp->sizey);
}
}
- else if(id_type==ID_LA) {
- Lamp *la= NULL, *origla= (Lamp *)id;
+ else if (id_type == ID_LA) {
+ Lamp *la = NULL, *origla = (Lamp *)id;
/* work on a copy */
- if(origla) {
- la= localize_lamp(origla);
- sp->lampcopy= la;
+ if (origla) {
+ la = localize_lamp(origla);
+ sp->lampcopy = la;
BLI_addtail(&pr_main->lamp, la);
}
- if(la && la->type==LA_SUN && (la->sun_effect_type & LA_SUN_EFFECT_SKY)) {
- sce->lay= 1<<MA_ATMOS;
- sce->world= scene->world;
- sce->camera= (Object *)BLI_findstring(&pr_main->object, "CameraAtmo", offsetof(ID, name)+2);
+ if (la && la->type == LA_SUN && (la->sun_effect_type & LA_SUN_EFFECT_SKY)) {
+ sce->lay = 1 << MA_ATMOS;
+ sce->world = scene->world;
+ sce->camera = (Object *)BLI_findstring(&pr_main->object, "CameraAtmo", offsetof(ID, name) + 2);
}
else {
- sce->lay= 1<<MA_LAMP;
- sce->world= NULL;
- sce->camera= (Object *)BLI_findstring(&pr_main->object, "Camera", offsetof(ID, name)+2);
+ sce->lay = 1 << MA_LAMP;
+ sce->world = NULL;
+ sce->camera = (Object *)BLI_findstring(&pr_main->object, "Camera", offsetof(ID, name) + 2);
}
sce->r.mode &= ~R_SHADOW;
- for(base= sce->base.first; base; base= base->next) {
- if(base->object->id.name[2]=='p') {
- if(base->object->type==OB_LAMP)
- base->object->data= la;
+ for (base = sce->base.first; base; base = base->next) {
+ if (base->object->id.name[2] == 'p') {
+ if (base->object->type == OB_LAMP)
+ base->object->data = la;
}
}
- if(la && la->nodetree && sp->pr_method==PR_NODE_RENDER) {
+ if (la && la->nodetree && sp->pr_method == PR_NODE_RENDER) {
/* two previews, they get copied by wmJob */
ntreeInitPreview(origla->nodetree, sp->sizex, sp->sizey);
ntreeInitPreview(la->nodetree, sp->sizex, sp->sizey);
}
}
- else if(id_type==ID_WO) {
- World *wrld= NULL, *origwrld= (World *)id;
+ else if (id_type == ID_WO) {
+ World *wrld = NULL, *origwrld = (World *)id;
- if(origwrld) {
- wrld= localize_world(origwrld);
- sp->worldcopy= wrld;
+ if (origwrld) {
+ wrld = localize_world(origwrld);
+ sp->worldcopy = wrld;
BLI_addtail(&pr_main->world, wrld);
}
- sce->lay= 1<<MA_SKY;
- sce->world= wrld;
+ sce->lay = 1 << MA_SKY;
+ sce->world = wrld;
- if(wrld && wrld->nodetree && sp->pr_method==PR_NODE_RENDER) {
+ if (wrld && wrld->nodetree && sp->pr_method == PR_NODE_RENDER) {
/* two previews, they get copied by wmJob */
ntreeInitPreview(wrld->nodetree, sp->sizex, sp->sizey);
ntreeInitPreview(origwrld->nodetree, sp->sizex, sp->sizey);
@@ -473,8 +474,8 @@ static int ed_preview_draw_rect(ScrArea *sa, Scene *sce, ID *id, int split, int
Render *re;
RenderResult rres;
char name[32];
- int do_gamma_correct=0, do_predivide=0;
- int offx=0, newx= rect->xmax-rect->xmin, newy= rect->ymax-rect->ymin;
+ int do_gamma_correct = 0, do_predivide = 0;
+ int offx = 0, newx = rect->xmax - rect->xmin, newy = rect->ymax - rect->ymin;
if (id && GS(id->name) != ID_TE) {
/* exception: don't color manage texture previews - show the raw values */
@@ -484,43 +485,43 @@ static int ed_preview_draw_rect(ScrArea *sa, Scene *sce, ID *id, int split, int
}
}
- if(!split || first) sprintf(name, "Preview %p", (void *)sa);
+ if (!split || first) sprintf(name, "Preview %p", (void *)sa);
else sprintf(name, "SecondPreview %p", (void *)sa);
- if(split) {
- if(first) {
- offx= 0;
- newx= newx/2;
+ if (split) {
+ if (first) {
+ offx = 0;
+ newx = newx / 2;
}
else {
- offx= newx/2;
- newx= newx - newx/2;
+ offx = newx / 2;
+ newx = newx - newx / 2;
}
}
- re= RE_GetRender(name);
+ re = RE_GetRender(name);
RE_AcquireResultImage(re, &rres);
- if(rres.rectf) {
+ if (rres.rectf) {
- if(ABS(rres.rectx-newx)<2 && ABS(rres.recty-newy)<2) {
+ if (ABS(rres.rectx - newx) < 2 && ABS(rres.recty - newy) < 2) {
- newrect->xmax= MAX2(newrect->xmax, rect->xmin + rres.rectx + offx);
- newrect->ymax= MAX2(newrect->ymax, rect->ymin + rres.recty);
+ newrect->xmax = MAX2(newrect->xmax, rect->xmin + rres.rectx + offx);
+ newrect->ymax = MAX2(newrect->ymax, rect->ymin + rres.recty);
- if(rres.rectx && rres.recty) {
+ if (rres.rectx && rres.recty) {
/* temporary conversion to byte for drawing */
- float fx= rect->xmin + offx;
- float fy= rect->ymin;
- int profile_from= (do_gamma_correct)? IB_PROFILE_LINEAR_RGB: IB_PROFILE_SRGB;
- int dither= 0;
+ float fx = rect->xmin + offx;
+ float fy = rect->ymin;
+ int profile_from = (do_gamma_correct) ? IB_PROFILE_LINEAR_RGB : IB_PROFILE_SRGB;
+ int dither = 0;
unsigned char *rect_byte;
- rect_byte= MEM_mallocN(rres.rectx*rres.recty*sizeof(int), "ed_preview_draw_rect");
+ rect_byte = MEM_mallocN(rres.rectx * rres.recty * sizeof(int), "ed_preview_draw_rect");
IMB_buffer_byte_from_float(rect_byte, rres.rectf,
- 4, dither, IB_PROFILE_SRGB, profile_from, do_predivide,
- rres.rectx, rres.recty, rres.rectx, rres.rectx);
+ 4, dither, IB_PROFILE_SRGB, profile_from, do_predivide,
+ rres.rectx, rres.recty, rres.rectx, rres.rectx);
glaDrawPixelsSafe(fx, fy, rres.rectx, rres.recty, rres.rectx, GL_RGBA, GL_UNSIGNED_BYTE, rect_byte);
@@ -538,39 +539,39 @@ static int ed_preview_draw_rect(ScrArea *sa, Scene *sce, ID *id, int split, int
void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slotp, rcti *rect)
{
- if(idp) {
- ScrArea *sa= CTX_wm_area(C);
+ if (idp) {
+ ScrArea *sa = CTX_wm_area(C);
Scene *sce = CTX_data_scene(C);
ID *id = (ID *)idp;
- ID *parent= (ID *)parentp;
- MTex *slot= (MTex *)slotp;
- SpaceButs *sbuts= sa->spacedata.first;
+ ID *parent = (ID *)parentp;
+ MTex *slot = (MTex *)slotp;
+ SpaceButs *sbuts = sa->spacedata.first;
rcti newrect;
int ok;
- int newx= rect->xmax-rect->xmin, newy= rect->ymax-rect->ymin;
+ int newx = rect->xmax - rect->xmin, newy = rect->ymax - rect->ymin;
- newrect.xmin= rect->xmin;
- newrect.xmax= rect->xmin;
- newrect.ymin= rect->ymin;
- newrect.ymax= rect->ymin;
+ newrect.xmin = rect->xmin;
+ newrect.xmax = rect->xmin;
+ newrect.ymin = rect->ymin;
+ newrect.ymax = rect->ymin;
- if(parent) {
+ if (parent) {
ok = ed_preview_draw_rect(sa, sce, id, 1, 1, rect, &newrect);
ok &= ed_preview_draw_rect(sa, sce, parent, 1, 0, rect, &newrect);
}
else
ok = ed_preview_draw_rect(sa, sce, id, 0, 0, rect, &newrect);
- if(ok)
- *rect= newrect;
+ if (ok)
+ *rect = newrect;
/* check for spacetype... */
- if(sbuts->spacetype==SPACE_BUTS && sbuts->preview) {
- sbuts->preview= 0;
- ok= 0;
+ if (sbuts->spacetype == SPACE_BUTS && sbuts->preview) {
+ sbuts->preview = 0;
+ ok = 0;
}
- if(ok==0) {
+ if (ok == 0) {
ED_preview_shader_job(C, sa, id, parent, slot, newx, newy, PR_BUTS_RENDER);
}
}
@@ -581,15 +582,15 @@ void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slotp, r
/* inside thread, called by renderer, sets job update value */
static void shader_preview_draw(void *spv, RenderResult *UNUSED(rr), volatile struct rcti *UNUSED(rect))
{
- ShaderPreview *sp= spv;
+ ShaderPreview *sp = spv;
- *(sp->do_update)= 1;
+ *(sp->do_update) = 1;
}
/* called by renderer, checks job value */
static int shader_preview_break(void *spv)
{
- ShaderPreview *sp= spv;
+ ShaderPreview *sp = spv;
return *(sp->stop);
}
@@ -597,32 +598,32 @@ static int shader_preview_break(void *spv)
/* outside thread, called before redraw notifiers, it moves finished preview over */
static void shader_preview_updatejob(void *spv)
{
- ShaderPreview *sp= spv;
+ ShaderPreview *sp = spv;
- if(sp->id) {
- if(sp->pr_method==PR_NODE_RENDER) {
- if( GS(sp->id->name) == ID_MA) {
- Material *mat= (Material *)sp->id;
+ if (sp->id) {
+ if (sp->pr_method == PR_NODE_RENDER) {
+ if (GS(sp->id->name) == ID_MA) {
+ Material *mat = (Material *)sp->id;
- if(sp->matcopy && mat->nodetree && sp->matcopy->nodetree)
+ if (sp->matcopy && mat->nodetree && sp->matcopy->nodetree)
ntreeLocalSync(sp->matcopy->nodetree, mat->nodetree);
}
- else if( GS(sp->id->name) == ID_TE) {
- Tex *tex= (Tex *)sp->id;
+ else if (GS(sp->id->name) == ID_TE) {
+ Tex *tex = (Tex *)sp->id;
- if(sp->texcopy && tex->nodetree && sp->texcopy->nodetree)
+ if (sp->texcopy && tex->nodetree && sp->texcopy->nodetree)
ntreeLocalSync(sp->texcopy->nodetree, tex->nodetree);
}
- else if( GS(sp->id->name) == ID_WO) {
- World *wrld= (World *)sp->id;
+ else if (GS(sp->id->name) == ID_WO) {
+ World *wrld = (World *)sp->id;
- if(sp->worldcopy && wrld->nodetree && sp->worldcopy->nodetree)
+ if (sp->worldcopy && wrld->nodetree && sp->worldcopy->nodetree)
ntreeLocalSync(sp->worldcopy->nodetree, wrld->nodetree);
}
- else if( GS(sp->id->name) == ID_LA) {
- Lamp *la= (Lamp *)sp->id;
+ else if (GS(sp->id->name) == ID_LA) {
+ Lamp *la = (Lamp *)sp->id;
- if(sp->lampcopy && la->nodetree && sp->lampcopy->nodetree)
+ if (sp->lampcopy && la->nodetree && sp->lampcopy->nodetree)
ntreeLocalSync(sp->lampcopy->nodetree, la->nodetree);
}
}
@@ -634,73 +635,73 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
Render *re;
Scene *sce;
float oldlens;
- short idtype= GS(id->name);
+ short idtype = GS(id->name);
char name[32];
int sizex;
/* get the stuff from the builtin preview dbase */
- sce= preview_prepare_scene(sp->scene, id, idtype, sp); // XXX sizex
- if(sce==NULL) return;
+ sce = preview_prepare_scene(sp->scene, id, idtype, sp); // XXX sizex
+ if (sce == NULL) return;
- if(!split || first) sprintf(name, "Preview %p", sp->owner);
+ if (!split || first) sprintf(name, "Preview %p", sp->owner);
else sprintf(name, "SecondPreview %p", sp->owner);
- re= RE_GetRender(name);
+ re = RE_GetRender(name);
/* full refreshed render from first tile */
- if(re==NULL)
- re= RE_NewRender(name);
+ if (re == NULL)
+ re = RE_NewRender(name);
/* sce->r gets copied in RE_InitState! */
- sce->r.scemode &= ~(R_MATNODE_PREVIEW|R_TEXNODE_PREVIEW);
+ sce->r.scemode &= ~(R_MATNODE_PREVIEW | R_TEXNODE_PREVIEW);
sce->r.scemode &= ~R_NO_IMAGE_LOAD;
- if(sp->pr_method==PR_ICON_RENDER) {
+ if (sp->pr_method == PR_ICON_RENDER) {
sce->r.scemode |= R_NO_IMAGE_LOAD;
sce->r.mode |= R_OSA;
}
- else if(sp->pr_method==PR_NODE_RENDER) {
- if(idtype == ID_MA) sce->r.scemode |= R_MATNODE_PREVIEW;
- else if(idtype == ID_TE) sce->r.scemode |= R_TEXNODE_PREVIEW;
+ else if (sp->pr_method == PR_NODE_RENDER) {
+ if (idtype == ID_MA) sce->r.scemode |= R_MATNODE_PREVIEW;
+ else if (idtype == ID_TE) sce->r.scemode |= R_TEXNODE_PREVIEW;
sce->r.mode &= ~R_OSA;
}
- else { /* PR_BUTS_RENDER */
+ else { /* PR_BUTS_RENDER */
sce->r.mode |= R_OSA;
}
/* in case of split preview, use border render */
- if(split) {
- if(first) sizex= sp->sizex/2;
- else sizex= sp->sizex - sp->sizex/2;
+ if (split) {
+ if (first) sizex = sp->sizex / 2;
+ else sizex = sp->sizex - sp->sizex / 2;
}
- else sizex= sp->sizex;
+ else sizex = sp->sizex;
/* allocates or re-uses render result */
- sce->r.xsch= sizex;
- sce->r.ysch= sp->sizey;
- sce->r.size= 100;
+ sce->r.xsch = sizex;
+ sce->r.ysch = sp->sizey;
+ sce->r.size = 100;
/* callbacs are cleared on GetRender() */
- if(ELEM(sp->pr_method, PR_BUTS_RENDER, PR_NODE_RENDER)) {
+ if (ELEM(sp->pr_method, PR_BUTS_RENDER, PR_NODE_RENDER)) {
RE_display_draw_cb(re, sp, shader_preview_draw);
}
/* set this for all previews, default is react to G.afbreek still */
RE_test_break_cb(re, sp, shader_preview_break);
/* lens adjust */
- oldlens= ((Camera *)sce->camera->data)->lens;
- if(sizex > sp->sizey)
- ((Camera *)sce->camera->data)->lens *= (float)sp->sizey/(float)sizex;
+ oldlens = ((Camera *)sce->camera->data)->lens;
+ if (sizex > sp->sizey)
+ ((Camera *)sce->camera->data)->lens *= (float)sp->sizey / (float)sizex;
/* entire cycle for render engine */
RE_PreviewRender(re, pr_main, sce);
- ((Camera *)sce->camera->data)->lens= oldlens;
+ ((Camera *)sce->camera->data)->lens = oldlens;
/* handle results */
- if(sp->pr_method==PR_ICON_RENDER) {
+ if (sp->pr_method == PR_ICON_RENDER) {
// char *rct= (char *)(sp->pr_rect + 32*16 + 16);
- if(sp->pr_rect)
+ if (sp->pr_rect)
RE_ResultGet32(re, sp->pr_rect);
}
else {
@@ -714,9 +715,9 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
preview_prepare_scene(sp->scene, NULL, GS(id->name), sp);
/* XXX bad exception, end-exec is not being called in render, because it uses local main */
-// if(idtype == ID_TE) {
+// if (idtype == ID_TE) {
// Tex *tex= (Tex *)id;
-// if(tex->use_nodes && tex->nodetree)
+// if (tex->use_nodes && tex->nodetree)
// ntreeEndExecTree(tex->nodetree);
// }
@@ -725,26 +726,26 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
/* runs inside thread for material and icons */
static void shader_preview_startjob(void *customdata, short *stop, short *do_update)
{
- ShaderPreview *sp= customdata;
+ ShaderPreview *sp = customdata;
- sp->stop= stop;
- sp->do_update= do_update;
+ sp->stop = stop;
+ sp->do_update = do_update;
- if(sp->parent) {
+ if (sp->parent) {
shader_preview_render(sp, sp->id, 1, 1);
shader_preview_render(sp, sp->parent, 1, 0);
}
else
shader_preview_render(sp, sp->id, 0, 0);
- *do_update= 1;
+ *do_update = 1;
}
static void shader_preview_free(void *customdata)
{
- ShaderPreview *sp= customdata;
+ ShaderPreview *sp = customdata;
- if(sp->matcopy) {
+ if (sp->matcopy) {
struct IDProperty *properties;
int a;
@@ -755,21 +756,21 @@ static void shader_preview_free(void *customdata)
BLI_remlink(&pr_main->mat, sp->matcopy);
/* free_material decrements texture, prevent this. hack alert! */
- for(a=0; a<MAX_MTEX; a++) {
- MTex *mtex= sp->matcopy->mtex[a];
- if(mtex && mtex->tex) mtex->tex= NULL;
+ for (a = 0; a < MAX_MTEX; a++) {
+ MTex *mtex = sp->matcopy->mtex[a];
+ if (mtex && mtex->tex) mtex->tex = NULL;
}
free_material(sp->matcopy);
- properties= IDP_GetProperties((ID *)sp->matcopy, FALSE);
+ properties = IDP_GetProperties((ID *)sp->matcopy, FALSE);
if (properties) {
IDP_FreeProperty(properties);
MEM_freeN(properties);
}
MEM_freeN(sp->matcopy);
}
- if(sp->texcopy) {
+ if (sp->texcopy) {
struct IDProperty *properties;
/* node previews */
shader_preview_updatejob(sp);
@@ -778,14 +779,14 @@ static void shader_preview_free(void *customdata)
BLI_remlink(&pr_main->tex, sp->texcopy);
free_texture(sp->texcopy);
- properties= IDP_GetProperties((ID *)sp->texcopy, FALSE);
+ properties = IDP_GetProperties((ID *)sp->texcopy, FALSE);
if (properties) {
IDP_FreeProperty(properties);
MEM_freeN(properties);
}
MEM_freeN(sp->texcopy);
}
- if(sp->worldcopy) {
+ if (sp->worldcopy) {
struct IDProperty *properties;
/* node previews */
shader_preview_updatejob(sp);
@@ -794,14 +795,14 @@ static void shader_preview_free(void *customdata)
BLI_remlink(&pr_main->world, sp->worldcopy);
free_world(sp->worldcopy);
- properties= IDP_GetProperties((ID *)sp->worldcopy, FALSE);
+ properties = IDP_GetProperties((ID *)sp->worldcopy, FALSE);
if (properties) {
IDP_FreeProperty(properties);
MEM_freeN(properties);
}
MEM_freeN(sp->worldcopy);
}
- if(sp->lampcopy) {
+ if (sp->lampcopy) {
struct IDProperty *properties;
/* node previews */
shader_preview_updatejob(sp);
@@ -810,7 +811,7 @@ static void shader_preview_free(void *customdata)
BLI_remlink(&pr_main->lamp, sp->lampcopy);
free_lamp(sp->lampcopy);
- properties= IDP_GetProperties((ID *)sp->lampcopy, FALSE);
+ properties = IDP_GetProperties((ID *)sp->lampcopy, FALSE);
if (properties) {
IDP_FreeProperty(properties);
MEM_freeN(properties);
@@ -831,7 +832,7 @@ static void icon_copy_rect(ImBuf *ibuf, unsigned int w, unsigned int h, unsigned
short ex, ey, dx, dy;
/* paranoia test */
- if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL))
+ if (ibuf == NULL || (ibuf->rect == NULL && ibuf->rect_float == NULL))
return;
/* waste of cpu cyles... but the imbuf API has no other way to scale fast (ton) */
@@ -842,10 +843,10 @@ static void icon_copy_rect(ImBuf *ibuf, unsigned int w, unsigned int h, unsigned
if (ima->x > ima->y) {
scaledx = (float)w;
- scaledy = ( (float)ima->y/(float)ima->x )*(float)w;
+ scaledy = ( (float)ima->y / (float)ima->x) * (float)w;
}
else {
- scaledx = ( (float)ima->x/(float)ima->y )*(float)h;
+ scaledx = ( (float)ima->x / (float)ima->y) * (float)h;
scaledy = (float)h;
}
@@ -858,15 +859,15 @@ static void icon_copy_rect(ImBuf *ibuf, unsigned int w, unsigned int h, unsigned
IMB_scalefastImBuf(ima, ex, ey);
/* if needed, convert to 32 bits */
- if(ima->rect==NULL)
+ if (ima->rect == NULL)
IMB_rect_from_float(ima);
srect = ima->rect;
drect = rect;
- drect+= dy*w+dx;
- for (;ey > 0; ey--){
- memcpy(drect,srect, ex * sizeof(int));
+ drect += dy * w + dx;
+ for (; ey > 0; ey--) {
+ memcpy(drect, srect, ex * sizeof(int));
drect += w;
srect += ima->x;
}
@@ -876,82 +877,82 @@ static void icon_copy_rect(ImBuf *ibuf, unsigned int w, unsigned int h, unsigned
static void set_alpha(char *cp, int sizex, int sizey, char alpha)
{
- int a, size= sizex*sizey;
+ int a, size = sizex * sizey;
- for(a=0; a<size; a++, cp+=4)
- cp[3]= alpha;
+ for (a = 0; a < size; a++, cp += 4)
+ cp[3] = alpha;
}
static void icon_preview_startjob(void *customdata, short *stop, short *do_update)
{
- ShaderPreview *sp= customdata;
- ID *id= sp->id;
- short idtype= GS(id->name);
+ ShaderPreview *sp = customdata;
+ ID *id = sp->id;
+ short idtype = GS(id->name);
- if(idtype == ID_IM) {
- Image *ima= (Image*)id;
- ImBuf *ibuf= NULL;
- ImageUser iuser= {NULL};
+ if (idtype == ID_IM) {
+ Image *ima = (Image *)id;
+ ImBuf *ibuf = NULL;
+ ImageUser iuser = {NULL};
/* ima->ok is zero when Image cannot load */
- if(ima==NULL || ima->ok==0)
+ if (ima == NULL || ima->ok == 0)
return;
/* setup dummy image user */
- iuser.ok= iuser.framenr= 1;
- iuser.scene= sp->scene;
+ iuser.ok = iuser.framenr = 1;
+ 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)
+ if (ibuf == NULL || ibuf->rect == NULL)
return;
icon_copy_rect(ibuf, sp->sizex, sp->sizey, sp->pr_rect);
- *do_update= 1;
+ *do_update = 1;
}
- else if(idtype == ID_BR) {
- Brush *br= (Brush*)id;
+ else if (idtype == ID_BR) {
+ Brush *br = (Brush *)id;
- br->icon_imbuf= get_brush_icon(br);
+ br->icon_imbuf = get_brush_icon(br);
- memset(sp->pr_rect, 0x888888, sp->sizex*sp->sizey*sizeof(unsigned int));
+ memset(sp->pr_rect, 0x888888, sp->sizex * sp->sizey * sizeof(unsigned int));
- if(!(br->icon_imbuf) || !(br->icon_imbuf->rect))
+ if (!(br->icon_imbuf) || !(br->icon_imbuf->rect))
return;
icon_copy_rect(br->icon_imbuf, sp->sizex, sp->sizey, sp->pr_rect);
- *do_update= 1;
+ *do_update = 1;
}
else {
/* re-use shader job */
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 */
- if(idtype == ID_WO) {
- set_alpha((char*)sp->pr_rect, sp->sizex, sp->sizey, 255);
+ * 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);
}
- else if(idtype == ID_MA) {
- Material* ma = (Material*)id;
+ else if (idtype == ID_MA) {
+ Material *ma = (Material *)id;
- if(ma->material_type == MA_TYPE_HALO)
- set_alpha((char*)sp->pr_rect, sp->sizex, sp->sizey, 255);
+ if (ma->material_type == MA_TYPE_HALO)
+ set_alpha((char *)sp->pr_rect, sp->sizex, sp->sizey, 255);
}
}
}
/* 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))
{
- ShaderPreview *sp= customdata;
+ ShaderPreview *sp = customdata;
- if(sp->pr_method == PR_ICON_RENDER)
+ if (sp->pr_method == PR_ICON_RENDER)
icon_preview_startjob(customdata, stop, do_update);
else
shader_preview_startjob(customdata, stop, do_update);
@@ -991,12 +992,12 @@ static void icon_preview_startjob_all_sizes(void *customdata, short *stop, short
memset(&sp, 0, sizeof(ShaderPreview));
/* construct shader preview from image size and previewcustomdata */
- sp.scene= ip->scene;
- sp.owner= ip->owner;
- sp.sizex= cur_size->sizex;
- sp.sizey= cur_size->sizey;
- sp.pr_method= PR_ICON_RENDER;
- sp.pr_rect= cur_size->rect;
+ sp.scene = ip->scene;
+ sp.owner = ip->owner;
+ sp.sizex = cur_size->sizex;
+ sp.sizey = cur_size->sizey;
+ sp.pr_method = PR_ICON_RENDER;
+ sp.pr_rect = cur_size->rect;
sp.id = ip->id;
common_preview_startjob(&sp, stop, do_update, progress);
@@ -1010,7 +1011,7 @@ static void icon_preview_endjob(void *customdata)
IconPreview *ip = customdata;
if (ip->id && GS(ip->id->name) == ID_BR)
- WM_main_add_notifier(NC_BRUSH|NA_EDITED, ip->id);
+ WM_main_add_notifier(NC_BRUSH | NA_EDITED, ip->id);
}
static void icon_preview_free(void *customdata)
@@ -1027,19 +1028,19 @@ void ED_preview_icon_job(const bContext *C, void *owner, ID *id, unsigned int *r
IconPreview *ip, *old_ip;
/* suspended start means it starts after 1 timer step, see WM_jobs_timer below */
- steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner, "Icon Preview", WM_JOB_EXCL_RENDER|WM_JOB_SUSPEND);
+ steve = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner, "Icon Preview", WM_JOB_EXCL_RENDER | WM_JOB_SUSPEND);
- ip= MEM_callocN(sizeof(IconPreview), "icon preview");
+ ip = MEM_callocN(sizeof(IconPreview), "icon preview");
/* render all resolutions from suspended job too */
- old_ip= WM_jobs_get_customdata(steve);
+ old_ip = WM_jobs_get_customdata(steve);
if (old_ip)
BLI_movelisttolist(&ip->sizes, &old_ip->sizes);
/* customdata for preview thread */
- ip->scene= CTX_data_scene(C);
- ip->owner= id;
- ip->id= id;
+ ip->scene = CTX_data_scene(C);
+ ip->owner = id;
+ ip->id = id;
icon_preview_add_size(ip, rect, sizex, sizey);
@@ -1053,24 +1054,24 @@ void ED_preview_icon_job(const bContext *C, void *owner, ID *id, unsigned int *r
void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, MTex *slot, int sizex, int sizey, int method)
{
- Object *ob= CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
wmJob *steve;
ShaderPreview *sp;
- steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner, "Shader Preview", WM_JOB_EXCL_RENDER);
- sp= MEM_callocN(sizeof(ShaderPreview), "shader preview");
+ steve = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner, "Shader Preview", WM_JOB_EXCL_RENDER);
+ sp = MEM_callocN(sizeof(ShaderPreview), "shader preview");
/* customdata for preview thread */
- sp->scene= CTX_data_scene(C);
- sp->owner= owner;
- sp->sizex= sizex;
- sp->sizey= sizey;
- sp->pr_method= method;
+ sp->scene = CTX_data_scene(C);
+ sp->owner = owner;
+ sp->sizex = sizex;
+ sp->sizey = sizey;
+ sp->pr_method = method;
sp->id = id;
- sp->parent= parent;
- sp->slot= slot;
- if(ob && ob->totcol) copy_v4_v4(sp->col, ob->col);
- else sp->col[0]= sp->col[1]= sp->col[2]= sp->col[3]= 1.0f;
+ sp->parent = parent;
+ sp->slot = slot;
+ if (ob && ob->totcol) copy_v4_v4(sp->col, ob->col);
+ else sp->col[0] = sp->col[1] = sp->col[2] = sp->col[3] = 1.0f;
/* setup job */
WM_jobs_customdata(steve, sp, shader_preview_free);
@@ -1082,8 +1083,8 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
void ED_preview_kill_jobs(const struct bContext *C)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- if(wm)
+ wmWindowManager *wm = CTX_wm_manager(C);
+ if (wm)
WM_jobs_kill(wm, NULL, common_preview_startjob);
}
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 3a65d701b58..14f7e337f91 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -87,20 +87,20 @@
#include "RE_pipeline.h"
-#include "render_intern.h" // own include
+#include "render_intern.h" // own include
/********************** material slot operators *********************/
static int material_slot_add_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= ED_object_context(C);
+ Object *ob = ED_object_context(C);
- if(!ob)
+ if (!ob)
return OPERATOR_CANCELLED;
object_add_material_slot(ob);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
- WM_event_add_notifier(C, NC_OBJECT|ND_OB_SHADING, ob);
+ WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
+ WM_event_add_notifier(C, NC_OBJECT | ND_OB_SHADING, ob);
return OPERATOR_FINISHED;
}
@@ -108,35 +108,35 @@ static int material_slot_add_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_material_slot_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Material Slot";
- ot->idname= "OBJECT_OT_material_slot_add";
- ot->description="Add a new material slot";
+ ot->name = "Add Material Slot";
+ ot->idname = "OBJECT_OT_material_slot_add";
+ ot->description = "Add a new material slot";
/* api callbacks */
- ot->exec= material_slot_add_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = material_slot_add_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int material_slot_remove_exec(bContext *C, wmOperator *op)
{
- Object *ob= ED_object_context(C);
+ Object *ob = ED_object_context(C);
- if(!ob)
+ if (!ob)
return OPERATOR_CANCELLED;
/* Removing material slots in edit mode screws things up, see bug #21822.*/
- if(ob == CTX_data_edit_object(C)) {
+ if (ob == CTX_data_edit_object(C)) {
BKE_report(op->reports, RPT_ERROR, "Unable to remove material slot in edit mode");
return OPERATOR_CANCELLED;
}
object_remove_material_slot(ob);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
- WM_event_add_notifier(C, NC_OBJECT|ND_OB_SHADING, ob);
+ WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
+ WM_event_add_notifier(C, NC_OBJECT | ND_OB_SHADING, ob);
return OPERATOR_FINISHED;
}
@@ -144,61 +144,62 @@ static int material_slot_remove_exec(bContext *C, wmOperator *op)
void OBJECT_OT_material_slot_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Material Slot";
- ot->idname= "OBJECT_OT_material_slot_remove";
- ot->description="Remove the selected material slot";
+ ot->name = "Remove Material Slot";
+ ot->idname = "OBJECT_OT_material_slot_remove";
+ ot->description = "Remove the selected material slot";
/* api callbacks */
- ot->exec= material_slot_remove_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = material_slot_remove_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= ED_object_context(C);
+ Object *ob = ED_object_context(C);
- if(!ob)
+ if (!ob)
return OPERATOR_CANCELLED;
- if(ob && ob->actcol>0) {
- if(ob->type == OB_MESH) {
- BMEditMesh *em= ((Mesh*)ob->data)->edit_btmesh;
+ if (ob && ob->actcol > 0) {
+ if (ob->type == OB_MESH) {
+ BMEditMesh *em = BMEdit_FromObject(ob);
BMFace *efa;
BMIter iter;
- if(em) {
- BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- if(BM_elem_flag_test(efa, BM_ELEM_SELECT))
- efa->mat_nr= ob->actcol-1;
+ if (em) {
+ BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL)
+ {
+ if (BM_elem_flag_test(efa, BM_ELEM_SELECT))
+ efa->mat_nr = ob->actcol - 1;
}
}
}
- else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Nurb *nu;
- ListBase *nurbs= curve_editnurbs((Curve*)ob->data);
+ ListBase *nurbs = curve_editnurbs((Curve *)ob->data);
- if(nurbs) {
- for(nu= nurbs->first; nu; nu= nu->next)
- if(isNurbsel(nu))
- nu->mat_nr= nu->charidx= ob->actcol-1;
+ if (nurbs) {
+ for (nu = nurbs->first; nu; nu = nu->next)
+ if (isNurbsel(nu))
+ nu->mat_nr = nu->charidx = ob->actcol - 1;
}
}
- else if(ob->type == OB_FONT) {
- EditFont *ef= ((Curve*)ob->data)->editfont;
+ else if (ob->type == OB_FONT) {
+ EditFont *ef = ((Curve *)ob->data)->editfont;
int i, selstart, selend;
- if(ef && BKE_font_getselection(ob, &selstart, &selend)) {
- for(i=selstart; i<=selend; i++)
+ if (ef && BKE_font_getselection(ob, &selstart, &selend)) {
+ for (i = selstart; i <= selend; i++)
ef->textbufinfo[i].mat_nr = ob->actcol;
}
}
}
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data);
return OPERATOR_FINISHED;
}
@@ -206,48 +207,48 @@ static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_material_slot_assign(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Assign Material Slot";
- ot->idname= "OBJECT_OT_material_slot_assign";
- ot->description="Assign the material in the selected material slot to the selected vertices";
+ ot->name = "Assign Material Slot";
+ ot->idname = "OBJECT_OT_material_slot_assign";
+ ot->description = "Assign the material in the selected material slot to the selected vertices";
/* api callbacks */
- ot->exec= material_slot_assign_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->exec = material_slot_assign_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int material_slot_de_select(bContext *C, int select)
{
- Object *ob= ED_object_context(C);
+ Object *ob = ED_object_context(C);
- if(!ob)
+ if (!ob)
return OPERATOR_CANCELLED;
- if(ob->type == OB_MESH) {
- BMEditMesh *em= ((Mesh*)ob->data)->edit_btmesh;
+ if (ob->type == OB_MESH) {
+ BMEditMesh *em = BMEdit_FromObject(ob);
- if(em) {
- EDBM_deselect_by_material(em, ob->actcol-1, select);
+ if (em) {
+ EDBM_deselect_by_material(em, ob->actcol - 1, select);
}
}
- else if ELEM(ob->type, OB_CURVE, OB_SURF) {
- ListBase *nurbs= curve_editnurbs((Curve*)ob->data);
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ ListBase *nurbs = curve_editnurbs((Curve *)ob->data);
Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int a;
- if(nurbs) {
- for(nu= nurbs->first; nu; nu=nu->next) {
- if(nu->mat_nr==ob->actcol-1) {
- if(nu->bezt) {
- a= nu->pntsu;
- bezt= nu->bezt;
- while(a--) {
- if(bezt->hide==0) {
- if(select) {
+ if (nurbs) {
+ for (nu = nurbs->first; nu; nu = nu->next) {
+ if (nu->mat_nr == ob->actcol - 1) {
+ if (nu->bezt) {
+ a = nu->pntsu;
+ bezt = nu->bezt;
+ while (a--) {
+ if (bezt->hide == 0) {
+ if (select) {
bezt->f1 |= SELECT;
bezt->f2 |= SELECT;
bezt->f3 |= SELECT;
@@ -261,12 +262,12 @@ static int material_slot_de_select(bContext *C, int select)
bezt++;
}
}
- else if(nu->bp) {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a--) {
- if(bp->hide==0) {
- if(select) bp->f1 |= SELECT;
+ else if (nu->bp) {
+ a = nu->pntsu * nu->pntsv;
+ bp = nu->bp;
+ while (a--) {
+ if (bp->hide == 0) {
+ if (select) bp->f1 |= SELECT;
else bp->f1 &= ~SELECT;
}
bp++;
@@ -277,7 +278,7 @@ static int material_slot_de_select(bContext *C, int select)
}
}
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, ob->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data);
return OPERATOR_FINISHED;
}
@@ -290,15 +291,15 @@ static int material_slot_select_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_material_slot_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Material Slot";
- ot->idname= "OBJECT_OT_material_slot_select";
- ot->description="Select vertices assigned to the selected material slot";
+ ot->name = "Select Material Slot";
+ ot->idname = "OBJECT_OT_material_slot_select";
+ ot->description = "Select vertices assigned to the selected material slot";
/* api callbacks */
- ot->exec= material_slot_select_exec;
+ ot->exec = material_slot_select_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int material_slot_deselect_exec(bContext *C, wmOperator *UNUSED(op))
@@ -309,34 +310,34 @@ static int material_slot_deselect_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_material_slot_deselect(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Deselect Material Slot";
- ot->idname= "OBJECT_OT_material_slot_deselect";
- ot->description="Deselect vertices assigned to the selected material slot";
+ ot->name = "Deselect Material Slot";
+ ot->idname = "OBJECT_OT_material_slot_deselect";
+ ot->description = "Deselect vertices assigned to the selected material slot";
/* api callbacks */
- ot->exec= material_slot_deselect_exec;
+ ot->exec = material_slot_deselect_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int material_slot_copy_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= ED_object_context(C);
+ Object *ob = ED_object_context(C);
Material ***matar;
- if(!ob || !(matar= give_matarar(ob)))
+ if (!ob || !(matar = give_matarar(ob)))
return OPERATOR_CANCELLED;
- CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
- if(ob != ob_iter && give_matarar(ob_iter)) {
+ CTX_DATA_BEGIN(C, Object *, ob_iter, selected_editable_objects) {
+ if (ob != ob_iter && give_matarar(ob_iter)) {
if (ob->data != ob_iter->data)
assign_matarar(ob_iter, matar, ob->totcol);
- if(ob_iter->totcol==ob->totcol) {
- ob_iter->actcol= ob->actcol;
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob_iter);
+ if (ob_iter->totcol == ob->totcol) {
+ ob_iter->actcol = ob->actcol;
+ WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob_iter);
}
}
}
@@ -349,43 +350,43 @@ static int material_slot_copy_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_material_slot_copy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Material to Others";
- ot->idname= "OBJECT_OT_material_slot_copy";
- ot->description="Copies materials to other selected objects";
+ ot->name = "Copy Material to Others";
+ ot->idname = "OBJECT_OT_material_slot_copy";
+ ot->description = "Copies materials to other selected objects";
/* api callbacks */
- ot->exec= material_slot_copy_exec;
+ ot->exec = material_slot_copy_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/********************** new material operator *********************/
static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- Material *ma= CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
+ Scene *scene = CTX_data_scene(C);
+ Material *ma = CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
PointerRNA ptr, idptr;
PropertyRNA *prop;
/* add or copy material */
- if(ma) {
- ma= copy_material(ma);
+ if (ma) {
+ ma = copy_material(ma);
}
else {
- ma= add_material("Material");
+ ma = add_material("Material");
- if(scene_use_new_shading_nodes(scene)) {
+ if (scene_use_new_shading_nodes(scene)) {
ED_node_shader_default(scene, &ma->id);
- ma->use_nodes= 1;
+ ma->use_nodes = 1;
}
}
/* hook into UI */
uiIDContextProperty(C, &ptr, &prop);
- if(prop) {
+ if (prop) {
/* when creating new ID blocks, use is already 1, but RNA
* pointer se also increases user, so this compensates it */
ma->id.us--;
@@ -395,7 +396,7 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
RNA_property_update(C, &ptr, prop);
}
- WM_event_add_notifier(C, NC_MATERIAL|NA_ADDED, ma);
+ WM_event_add_notifier(C, NC_MATERIAL | NA_ADDED, ma);
return OPERATOR_FINISHED;
}
@@ -403,35 +404,35 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
void MATERIAL_OT_new(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "New Material";
- ot->idname= "MATERIAL_OT_new";
- ot->description="Add a new material";
+ ot->name = "New Material";
+ ot->idname = "MATERIAL_OT_new";
+ ot->description = "Add a new material";
/* api callbacks */
- ot->exec= new_material_exec;
+ ot->exec = new_material_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/********************** new texture operator *********************/
static int new_texture_exec(bContext *C, wmOperator *UNUSED(op))
{
- Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
+ Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
PointerRNA ptr, idptr;
PropertyRNA *prop;
/* add or copy texture */
- if(tex)
- tex= copy_texture(tex);
+ if (tex)
+ tex = copy_texture(tex);
else
- tex= add_texture("Texture");
+ tex = add_texture("Texture");
/* hook into UI */
uiIDContextProperty(C, &ptr, &prop);
- if(prop) {
+ if (prop) {
/* when creating new ID blocks, use is already 1, but RNA
* pointer se also increases user, so this compensates it */
tex->id.us--;
@@ -441,7 +442,7 @@ static int new_texture_exec(bContext *C, wmOperator *UNUSED(op))
RNA_property_update(C, &ptr, prop);
}
- WM_event_add_notifier(C, NC_TEXTURE|NA_ADDED, tex);
+ WM_event_add_notifier(C, NC_TEXTURE | NA_ADDED, tex);
return OPERATOR_FINISHED;
}
@@ -449,43 +450,43 @@ static int new_texture_exec(bContext *C, wmOperator *UNUSED(op))
void TEXTURE_OT_new(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "New Texture";
- ot->idname= "TEXTURE_OT_new";
- ot->description="Add a new texture";
+ ot->name = "New Texture";
+ ot->idname = "TEXTURE_OT_new";
+ ot->description = "Add a new texture";
/* api callbacks */
- ot->exec= new_texture_exec;
+ ot->exec = new_texture_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/********************** new world operator *********************/
static int new_world_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- World *wo= CTX_data_pointer_get_type(C, "world", &RNA_World).data;
+ Scene *scene = CTX_data_scene(C);
+ World *wo = CTX_data_pointer_get_type(C, "world", &RNA_World).data;
PointerRNA ptr, idptr;
PropertyRNA *prop;
/* add or copy world */
- if(wo) {
- wo= copy_world(wo);
+ if (wo) {
+ wo = copy_world(wo);
}
else {
- wo= add_world("World");
+ wo = add_world("World");
- if(scene_use_new_shading_nodes(scene)) {
+ if (scene_use_new_shading_nodes(scene)) {
ED_node_shader_default(scene, &wo->id);
- wo->use_nodes= 1;
+ wo->use_nodes = 1;
}
}
/* hook into UI */
uiIDContextProperty(C, &ptr, &prop);
- if(prop) {
+ if (prop) {
/* when creating new ID blocks, use is already 1, but RNA
* pointer se also increases user, so this compensates it */
wo->id.us--;
@@ -495,7 +496,7 @@ static int new_world_exec(bContext *C, wmOperator *UNUSED(op))
RNA_property_update(C, &ptr, prop);
}
- WM_event_add_notifier(C, NC_WORLD|NA_ADDED, wo);
+ WM_event_add_notifier(C, NC_WORLD | NA_ADDED, wo);
return OPERATOR_FINISHED;
}
@@ -503,27 +504,27 @@ static int new_world_exec(bContext *C, wmOperator *UNUSED(op))
void WORLD_OT_new(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "New World";
- ot->idname= "WORLD_OT_new";
- ot->description= "Add a new world";
+ ot->name = "New World";
+ ot->idname = "WORLD_OT_new";
+ ot->description = "Add a new world";
/* api callbacks */
- ot->exec= new_world_exec;
+ ot->exec = new_world_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/********************** render layer operators *********************/
static int render_layer_add_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
scene_add_render_layer(scene, NULL);
- scene->r.actlay= BLI_countlist(&scene->r.layers) - 1;
+ scene->r.actlay = BLI_countlist(&scene->r.layers) - 1;
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
return OPERATOR_FINISHED;
}
@@ -531,15 +532,15 @@ static int render_layer_add_exec(bContext *C, wmOperator *UNUSED(op))
void SCENE_OT_render_layer_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Render Layer";
- ot->idname= "SCENE_OT_render_layer_add";
- ot->description="Add a render layer";
+ ot->name = "Add Render Layer";
+ ot->idname = "SCENE_OT_render_layer_add";
+ ot->description = "Add a render layer";
/* api callbacks */
- ot->exec= render_layer_add_exec;
+ ot->exec = render_layer_add_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int render_layer_remove_exec(bContext *C, wmOperator *UNUSED(op))
@@ -547,10 +548,10 @@ static int render_layer_remove_exec(bContext *C, wmOperator *UNUSED(op))
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *rl = BLI_findlink(&scene->r.layers, scene->r.actlay);
- if(!scene_remove_render_layer(CTX_data_main(C), scene, rl))
+ if (!scene_remove_render_layer(CTX_data_main(C), scene, rl))
return OPERATOR_CANCELLED;
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
return OPERATOR_FINISHED;
}
@@ -558,71 +559,71 @@ static int render_layer_remove_exec(bContext *C, wmOperator *UNUSED(op))
void SCENE_OT_render_layer_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Render Layer";
- ot->idname= "SCENE_OT_render_layer_remove";
- ot->description="Remove the selected render layer";
+ ot->name = "Remove Render Layer";
+ ot->idname = "SCENE_OT_render_layer_remove";
+ ot->description = "Remove the selected render layer";
/* api callbacks */
- ot->exec= render_layer_remove_exec;
+ ot->exec = render_layer_remove_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int texture_slot_move(bContext *C, wmOperator *op)
{
- ID *id= CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data;
+ ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data;
- if(id) {
+ if (id) {
MTex **mtex_ar, *mtexswap;
short act;
- int type= RNA_enum_get(op->ptr, "type");
- struct AnimData *adt= BKE_animdata_from_id(id);
+ int type = RNA_enum_get(op->ptr, "type");
+ struct AnimData *adt = BKE_animdata_from_id(id);
give_active_mtex(id, &mtex_ar, &act);
- if(type == -1) { /* Up */
- if(act > 0) {
+ if (type == -1) { /* Up */
+ if (act > 0) {
mtexswap = mtex_ar[act];
- mtex_ar[act] = mtex_ar[act-1];
- mtex_ar[act-1] = mtexswap;
+ mtex_ar[act] = mtex_ar[act - 1];
+ mtex_ar[act - 1] = mtexswap;
- BKE_animdata_fix_paths_rename(id, adt, "texture_slots", NULL, NULL, act-1, -1, 0);
- BKE_animdata_fix_paths_rename(id, adt, "texture_slots", NULL, NULL, act, act-1, 0);
- BKE_animdata_fix_paths_rename(id, adt, "texture_slots", NULL, NULL, -1, act, 0);
-
- if(GS(id->name)==ID_MA) {
- Material *ma= (Material *)id;
- int mtexuse = ma->septex & (1<<act);
- ma->septex &= ~(1<<act);
- ma->septex |= (ma->septex & (1<<(act-1))) << 1;
- ma->septex &= ~(1<<(act-1));
+ BKE_animdata_fix_paths_rename(id, adt, NULL, "texture_slots", NULL, NULL, act - 1, -1, 0);
+ BKE_animdata_fix_paths_rename(id, adt, NULL, "texture_slots", NULL, NULL, act, act - 1, 0);
+ BKE_animdata_fix_paths_rename(id, adt, NULL, "texture_slots", NULL, NULL, -1, act, 0);
+
+ if (GS(id->name) == ID_MA) {
+ Material *ma = (Material *)id;
+ int mtexuse = ma->septex & (1 << act);
+ ma->septex &= ~(1 << act);
+ ma->septex |= (ma->septex & (1 << (act - 1))) << 1;
+ ma->septex &= ~(1 << (act - 1));
ma->septex |= mtexuse >> 1;
}
- set_active_mtex(id, act-1);
+ set_active_mtex(id, act - 1);
}
}
else { /* Down */
- if(act < MAX_MTEX-1) {
+ if (act < MAX_MTEX - 1) {
mtexswap = mtex_ar[act];
- mtex_ar[act] = mtex_ar[act+1];
- mtex_ar[act+1] = mtexswap;
+ mtex_ar[act] = mtex_ar[act + 1];
+ mtex_ar[act + 1] = mtexswap;
- BKE_animdata_fix_paths_rename(id, adt, "texture_slots", NULL, NULL, act+1, -1, 0);
- BKE_animdata_fix_paths_rename(id, adt, "texture_slots", NULL, NULL, act, act+1, 0);
- BKE_animdata_fix_paths_rename(id, adt, "texture_slots", NULL, NULL, -1, act, 0);
-
- if(GS(id->name)==ID_MA) {
- Material *ma= (Material *)id;
- int mtexuse = ma->septex & (1<<act);
- ma->septex &= ~(1<<act);
- ma->septex |= (ma->septex & (1<<(act+1))) >> 1;
- ma->septex &= ~(1<<(act+1));
+ BKE_animdata_fix_paths_rename(id, adt, NULL, "texture_slots", NULL, NULL, act + 1, -1, 0);
+ BKE_animdata_fix_paths_rename(id, adt, NULL, "texture_slots", NULL, NULL, act, act + 1, 0);
+ BKE_animdata_fix_paths_rename(id, adt, NULL, "texture_slots", NULL, NULL, -1, act, 0);
+
+ if (GS(id->name) == ID_MA) {
+ Material *ma = (Material *)id;
+ int mtexuse = ma->septex & (1 << act);
+ ma->septex &= ~(1 << act);
+ ma->septex |= (ma->septex & (1 << (act + 1))) >> 1;
+ ma->septex &= ~(1 << (act + 1));
ma->septex |= mtexuse << 1;
}
- set_active_mtex(id, act+1);
+ set_active_mtex(id, act + 1);
}
}
@@ -642,15 +643,15 @@ void TEXTURE_OT_slot_move(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Move Texture Slot";
- ot->idname= "TEXTURE_OT_slot_move";
- ot->description="Move texture slots up and down";
+ ot->name = "Move Texture Slot";
+ ot->idname = "TEXTURE_OT_slot_move";
+ ot->description = "Move texture slots up and down";
/* api callbacks */
- ot->exec= texture_slot_move;
+ ot->exec = texture_slot_move;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_enum(ot->srna, "type", slot_move, 0, "Type", "");
}
@@ -662,8 +663,8 @@ void TEXTURE_OT_slot_move(wmOperatorType *ot)
static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *path, const char imtype)
{
float layout[12];
- if ( RNA_struct_find_property(op->ptr, "layout") )
- RNA_float_get_array(op->ptr, "layout",layout);
+ if (RNA_struct_find_property(op->ptr, "layout") )
+ RNA_float_get_array(op->ptr, "layout", layout);
else
memcpy(layout, default_envmap_layout, sizeof(layout));
@@ -678,7 +679,7 @@ static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *path, co
static int envmap_save_exec(bContext *C, wmOperator *op)
{
- Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
+ Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
Scene *scene = CTX_data_scene(C);
//int imtype = RNA_enum_get(op->ptr, "file_type");
char imtype = scene->r.im_format.imtype;
@@ -686,7 +687,7 @@ static int envmap_save_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filepath", path);
- if(scene->r.scemode & R_EXTENSION) {
+ if (scene->r.scemode & R_EXTENSION) {
BKE_add_image_extension(path, imtype);
}
@@ -705,7 +706,7 @@ static int envmap_save_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event
{
//Scene *scene= CTX_data_scene(C);
- if(RNA_struct_property_is_set(op->ptr, "filepath"))
+ if (RNA_struct_property_is_set(op->ptr, "filepath"))
return envmap_save_exec(C, op);
//RNA_enum_set(op->ptr, "file_type", scene->r.im_format.imtype);
@@ -717,13 +718,13 @@ static int envmap_save_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event
static int envmap_save_poll(bContext *C)
{
- Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
+ Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
if (!tex)
return 0;
if (!tex->env || !tex->env->ok)
return 0;
- if (tex->env->cube[1]==NULL)
+ if (tex->env->cube[1] == NULL)
return 0;
return 1;
@@ -733,45 +734,45 @@ void TEXTURE_OT_envmap_save(wmOperatorType *ot)
{
PropertyRNA *prop;
/* identifiers */
- ot->name= "Save Environment Map";
- ot->idname= "TEXTURE_OT_envmap_save";
- ot->description="Save the current generated Environment map to an image file";
+ ot->name = "Save Environment Map";
+ ot->idname = "TEXTURE_OT_envmap_save";
+ ot->description = "Save the current generated Environment map to an image file";
/* api callbacks */
- ot->exec= envmap_save_exec;
- ot->invoke= envmap_save_invoke;
- ot->poll= envmap_save_poll;
+ ot->exec = envmap_save_exec;
+ ot->invoke = envmap_save_invoke;
+ ot->poll = envmap_save_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER; /* no undo since this doesnt modify the env-map */
+ ot->flag = OPTYPE_REGISTER; /* no undo since this doesnt modify the env-map */
/* properties */
- prop= RNA_def_float_array(ot->srna, "layout", 12, default_envmap_layout, 0.0f, 0.0f, "File layout", "Flat array describing the X,Y position of each cube face in the output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] (use -1 to skip a face)", 0.0f, 0.0f);
+ prop = RNA_def_float_array(ot->srna, "layout", 12, default_envmap_layout, 0.0f, 0.0f, "File layout", "Flat array describing the X,Y position of each cube face in the output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] (use -1 to skip a face)", 0.0f, 0.0f);
RNA_def_property_flag(prop, PROP_HIDDEN);
- WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE | MOVIEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
}
static int envmap_clear_exec(bContext *C, wmOperator *UNUSED(op))
{
- Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
+ Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
BKE_free_envmapdata(tex->env);
- WM_event_add_notifier(C, NC_TEXTURE|NA_EDITED, tex);
+ WM_event_add_notifier(C, NC_TEXTURE | NA_EDITED, tex);
return OPERATOR_FINISHED;
}
static int envmap_clear_poll(bContext *C)
{
- Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
+ Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
if (!tex)
return 0;
if (!tex->env || !tex->env->ok)
return 0;
- if (tex->env->cube[1]==NULL)
+ if (tex->env->cube[1] == NULL)
return 0;
return 1;
@@ -780,16 +781,16 @@ static int envmap_clear_poll(bContext *C)
void TEXTURE_OT_envmap_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Environment Map";
- ot->idname= "TEXTURE_OT_envmap_clear";
- ot->description="Discard the environment map and free it from memory";
+ ot->name = "Clear Environment Map";
+ ot->idname = "TEXTURE_OT_envmap_clear";
+ ot->description = "Discard the environment map and free it from memory";
/* api callbacks */
- ot->exec= envmap_clear_exec;
- ot->poll= envmap_clear_poll;
+ ot->exec = envmap_clear_exec;
+ ot->poll = envmap_clear_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int envmap_clear_all_exec(bContext *C, wmOperator *UNUSED(op))
@@ -797,11 +798,11 @@ static int envmap_clear_all_exec(bContext *C, wmOperator *UNUSED(op))
Main *bmain = CTX_data_main(C);
Tex *tex;
- for (tex=bmain->tex.first; tex; tex=tex->id.next)
+ for (tex = bmain->tex.first; tex; tex = tex->id.next)
if (tex->env)
BKE_free_envmapdata(tex->env);
- WM_event_add_notifier(C, NC_TEXTURE|NA_EDITED, tex);
+ WM_event_add_notifier(C, NC_TEXTURE | NA_EDITED, tex);
return OPERATOR_FINISHED;
}
@@ -809,16 +810,16 @@ static int envmap_clear_all_exec(bContext *C, wmOperator *UNUSED(op))
void TEXTURE_OT_envmap_clear_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear All Environment Maps";
- ot->idname= "TEXTURE_OT_envmap_clear_all";
- ot->description="Discard all environment maps in the .blend file and free them from memory";
+ ot->name = "Clear All Environment Maps";
+ ot->idname = "TEXTURE_OT_envmap_clear_all";
+ ot->description = "Discard all environment maps in the .blend file and free them from memory";
/* api callbacks */
- ot->exec= envmap_clear_all_exec;
- ot->poll= envmap_clear_poll;
+ ot->exec = envmap_clear_all_exec;
+ ot->poll = envmap_clear_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/********************** material operators *********************/
@@ -826,9 +827,9 @@ void TEXTURE_OT_envmap_clear_all(wmOperatorType *ot)
/* material copy/paste */
static int copy_material_exec(bContext *C, wmOperator *UNUSED(op))
{
- Material *ma= CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
+ Material *ma = CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
- if(ma==NULL)
+ if (ma == NULL)
return OPERATOR_CANCELLED;
copy_matcopybuf(ma);
@@ -839,27 +840,27 @@ static int copy_material_exec(bContext *C, wmOperator *UNUSED(op))
void MATERIAL_OT_copy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Material";
- ot->idname= "MATERIAL_OT_copy";
- ot->description="Copy the material settings and nodes";
+ ot->name = "Copy Material";
+ ot->idname = "MATERIAL_OT_copy";
+ ot->description = "Copy the material settings and nodes";
/* api callbacks */
- ot->exec= copy_material_exec;
+ ot->exec = copy_material_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER; /* no undo needed since no changes are made to the material */
+ ot->flag = OPTYPE_REGISTER; /* no undo needed since no changes are made to the material */
}
static int paste_material_exec(bContext *C, wmOperator *UNUSED(op))
{
- Material *ma= CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
+ Material *ma = CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
- if(ma==NULL)
+ if (ma == NULL)
return OPERATOR_CANCELLED;
paste_matcopybuf(ma);
- WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING_DRAW, ma);
+ WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_DRAW, ma);
return OPERATOR_FINISHED;
}
@@ -867,88 +868,88 @@ static int paste_material_exec(bContext *C, wmOperator *UNUSED(op))
void MATERIAL_OT_paste(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Paste Material";
- ot->idname= "MATERIAL_OT_paste";
- ot->description="Paste the material settings and nodes";
+ ot->name = "Paste Material";
+ ot->idname = "MATERIAL_OT_paste";
+ ot->description = "Paste the material settings and nodes";
/* api callbacks */
- ot->exec= paste_material_exec;
+ ot->exec = paste_material_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static short mtexcopied=0; /* must be reset on file load */
+static short mtexcopied = 0; /* must be reset on file load */
static MTex mtexcopybuf;
void ED_render_clear_mtex_copybuf(void)
-{ /* use for file reload */
- mtexcopied= 0;
+{ /* use for file reload */
+ mtexcopied = 0;
}
static void copy_mtex_copybuf(ID *id)
{
- MTex **mtex= NULL;
+ MTex **mtex = NULL;
- switch(GS(id->name)) {
+ switch (GS(id->name)) {
case ID_MA:
- mtex= &(((Material *)id)->mtex[(int)((Material *)id)->texact]);
+ mtex = &(((Material *)id)->mtex[(int)((Material *)id)->texact]);
break;
case ID_LA:
- mtex= &(((Lamp *)id)->mtex[(int)((Lamp *)id)->texact]);
+ mtex = &(((Lamp *)id)->mtex[(int)((Lamp *)id)->texact]);
// la->mtex[(int)la->texact] // TODO
break;
case ID_WO:
- mtex= &(((World *)id)->mtex[(int)((World *)id)->texact]);
+ mtex = &(((World *)id)->mtex[(int)((World *)id)->texact]);
// mtex= wrld->mtex[(int)wrld->texact]; // TODO
break;
case ID_PA:
- mtex= &(((ParticleSettings *)id)->mtex[(int)((ParticleSettings *)id)->texact]);
+ mtex = &(((ParticleSettings *)id)->mtex[(int)((ParticleSettings *)id)->texact]);
break;
}
- if(mtex && *mtex) {
+ if (mtex && *mtex) {
memcpy(&mtexcopybuf, *mtex, sizeof(MTex));
- mtexcopied= 1;
+ mtexcopied = 1;
}
else {
- mtexcopied= 0;
+ mtexcopied = 0;
}
}
static void paste_mtex_copybuf(ID *id)
{
- MTex **mtex= NULL;
+ MTex **mtex = NULL;
- if(mtexcopied == 0 || mtexcopybuf.tex==NULL)
+ if (mtexcopied == 0 || mtexcopybuf.tex == NULL)
return;
- switch(GS(id->name)) {
+ switch (GS(id->name)) {
case ID_MA:
- mtex= &(((Material *)id)->mtex[(int)((Material *)id)->texact]);
+ mtex = &(((Material *)id)->mtex[(int)((Material *)id)->texact]);
break;
case ID_LA:
- mtex= &(((Lamp *)id)->mtex[(int)((Lamp *)id)->texact]);
+ mtex = &(((Lamp *)id)->mtex[(int)((Lamp *)id)->texact]);
// la->mtex[(int)la->texact] // TODO
break;
case ID_WO:
- mtex= &(((World *)id)->mtex[(int)((World *)id)->texact]);
+ mtex = &(((World *)id)->mtex[(int)((World *)id)->texact]);
// mtex= wrld->mtex[(int)wrld->texact]; // TODO
break;
case ID_PA:
- mtex= &(((ParticleSettings *)id)->mtex[(int)((ParticleSettings *)id)->texact]);
+ mtex = &(((ParticleSettings *)id)->mtex[(int)((ParticleSettings *)id)->texact]);
break;
default:
BLI_assert("invalid id type");
return;
}
- if(mtex) {
- if(*mtex==NULL) {
- *mtex= MEM_mallocN(sizeof(MTex), "mtex copy");
+ if (mtex) {
+ if (*mtex == NULL) {
+ *mtex = MEM_mallocN(sizeof(MTex), "mtex copy");
}
- else if((*mtex)->tex) {
+ else if ((*mtex)->tex) {
(*mtex)->tex->id.us--;
}
@@ -961,9 +962,9 @@ static void paste_mtex_copybuf(ID *id)
static int copy_mtex_exec(bContext *C, wmOperator *UNUSED(op))
{
- ID *id= CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data;
+ ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data;
- if(id==NULL) {
+ if (id == NULL) {
/* copying empty slot */
ED_render_clear_mtex_copybuf();
return OPERATOR_CANCELLED;
@@ -976,7 +977,7 @@ static int copy_mtex_exec(bContext *C, wmOperator *UNUSED(op))
static int copy_mtex_poll(bContext *C)
{
- ID *id= CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data;
+ ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data;
return (id != NULL);
}
@@ -984,27 +985,27 @@ static int copy_mtex_poll(bContext *C)
void TEXTURE_OT_slot_copy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Texture Slot Settings";
- ot->idname= "TEXTURE_OT_slot_copy";
- ot->description="Copy the material texture settings and nodes";
+ ot->name = "Copy Texture Slot Settings";
+ ot->idname = "TEXTURE_OT_slot_copy";
+ ot->description = "Copy the material texture settings and nodes";
/* api callbacks */
- ot->exec= copy_mtex_exec;
- ot->poll= copy_mtex_poll;
+ ot->exec = copy_mtex_exec;
+ ot->poll = copy_mtex_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER; /* no undo needed since no changes are made to the mtex */
+ ot->flag = OPTYPE_REGISTER; /* no undo needed since no changes are made to the mtex */
}
static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op))
{
- ID *id= CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data;
+ ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data;
- if(id==NULL) {
- Material *ma= CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
- Lamp *la= CTX_data_pointer_get_type(C, "lamp", &RNA_Lamp).data;
- World *wo= CTX_data_pointer_get_type(C, "world", &RNA_World).data;
- ParticleSystem *psys= CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem).data;
+ if (id == NULL) {
+ Material *ma = CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
+ Lamp *la = CTX_data_pointer_get_type(C, "lamp", &RNA_Lamp).data;
+ World *wo = CTX_data_pointer_get_type(C, "world", &RNA_World).data;
+ ParticleSystem *psys = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem).data;
if (ma)
id = &ma->id;
@@ -1015,13 +1016,13 @@ static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op))
else if (psys)
id = &psys->part->id;
- if (id==NULL)
+ if (id == NULL)
return OPERATOR_CANCELLED;
}
paste_mtex_copybuf(id);
- WM_event_add_notifier(C, NC_TEXTURE|ND_SHADING_DRAW, NULL);
+ WM_event_add_notifier(C, NC_TEXTURE | ND_SHADING_DRAW, NULL);
return OPERATOR_FINISHED;
}
@@ -1029,14 +1030,14 @@ static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op))
void TEXTURE_OT_slot_paste(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Paste Texture Slot Settings";
- ot->idname= "TEXTURE_OT_slot_paste";
- ot->description="Copy the texture settings and nodes";
+ ot->name = "Paste Texture Slot Settings";
+ ot->idname = "TEXTURE_OT_slot_paste";
+ ot->description = "Copy the texture settings and nodes";
/* api callbacks */
- ot->exec= paste_mtex_exec;
+ ot->exec = paste_mtex_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c
index d921308aad5..b56a295864b 100644
--- a/source/blender/editors/render/render_update.c
+++ b/source/blender/editors/render/render_update.c
@@ -62,7 +62,7 @@
#include "ED_node.h"
#include "ED_render.h"
-#include "render_intern.h" // own include
+#include "render_intern.h" // own include
/***************************** Render Engines ********************************/
@@ -76,32 +76,32 @@ 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 */
- if(!BLI_thread_is_main())
+ * other threads doing e.g. rendering or baking jobs */
+ if (!BLI_thread_is_main())
return;
- C= CTX_create();
+ C = CTX_create();
CTX_data_main_set(C, bmain);
CTX_data_scene_set(C, scene);
CTX_wm_manager_set(C, bmain->wm.first);
- for(sc=bmain->screen.first; sc; sc=sc->id.next) {
- for(sa=sc->areabase.first; sa; sa=sa->next) {
- if(sa->spacetype != SPACE_VIEW3D)
+ for (sc = bmain->screen.first; sc; sc = sc->id.next) {
+ for (sa = sc->areabase.first; sa; sa = sa->next) {
+ if (sa->spacetype != SPACE_VIEW3D)
continue;
- for(ar=sa->regionbase.first; ar; ar=ar->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
RegionView3D *rv3d;
RenderEngine *engine;
- if(ar->regiontype != RGN_TYPE_WINDOW)
+ if (ar->regiontype != RGN_TYPE_WINDOW)
continue;
- rv3d= ar->regiondata;
- engine= rv3d->render_engine;
+ rv3d = ar->regiondata;
+ engine = rv3d->render_engine;
- if(engine && (updated || (engine->flag & RE_ENGINE_DO_UPDATE))) {
+ if (engine && (updated || (engine->flag & RE_ENGINE_DO_UPDATE))) {
CTX_wm_screen_set(C, sc);
CTX_wm_area_set(C, sa);
CTX_wm_region_set(C, ar);
@@ -123,22 +123,22 @@ void ED_render_engine_changed(Main *bmain)
ScrArea *sa;
ARegion *ar;
- for(sc=bmain->screen.first; sc; sc=sc->id.next) {
- for(sa=sc->areabase.first; sa; sa=sa->next) {
- if(sa->spacetype != SPACE_VIEW3D)
+ for (sc = bmain->screen.first; sc; sc = sc->id.next) {
+ for (sa = sc->areabase.first; sa; sa = sa->next) {
+ if (sa->spacetype != SPACE_VIEW3D)
continue;
- for(ar=sa->regionbase.first; ar; ar=ar->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
RegionView3D *rv3d;
- if(ar->regiontype != RGN_TYPE_WINDOW)
+ if (ar->regiontype != RGN_TYPE_WINDOW)
continue;
- rv3d= ar->regiondata;
+ rv3d = ar->regiondata;
- if(rv3d->render_engine) {
+ if (rv3d->render_engine) {
RE_engine_free(rv3d->render_engine);
- rv3d->render_engine= NULL;
+ rv3d->render_engine = NULL;
}
}
}
@@ -146,19 +146,19 @@ void ED_render_engine_changed(Main *bmain)
}
/***************************** Updates ***********************************
- * ED_render_id_flush_update gets called from DAG_id_tag_update, to do *
- * editor level updates when the ID changes. when these ID blocks are in *
- * the dependency graph, we can get rid of the manual dependency checks */
+* ED_render_id_flush_update gets called from DAG_id_tag_update, to do *
+* editor level updates when the ID changes. when these ID blocks are in *
+* the dependency graph, we can get rid of the manual dependency checks */
static int mtex_use_tex(MTex **mtex, int tot, Tex *tex)
{
int a;
- if(!mtex)
+ if (!mtex)
return 0;
- for(a=0; a<tot; a++)
- if(mtex[a] && mtex[a]->tex == tex)
+ for (a = 0; a < tot; a++)
+ if (mtex[a] && mtex[a]->tex == tex)
return 1;
return 0;
@@ -168,17 +168,17 @@ static int nodes_use_tex(bNodeTree *ntree, Tex *tex)
{
bNode *node;
- for(node=ntree->nodes.first; node; node= node->next) {
- if(node->id) {
- if(node->id == (ID*)tex) {
+ for (node = ntree->nodes.first; node; node = node->next) {
+ if (node->id) {
+ if (node->id == (ID *)tex) {
return 1;
}
- else if(GS(node->id->name) == ID_MA) {
- if(mtex_use_tex(((Material*)node->id)->mtex, MAX_MTEX, tex))
+ else if (GS(node->id->name) == ID_MA) {
+ if (mtex_use_tex(((Material *)node->id)->mtex, MAX_MTEX, tex))
return 1;
}
- else if(node->type==NODE_GROUP) {
- if(nodes_use_tex((bNodeTree *)node->id, tex))
+ else if (node->type == NODE_GROUP) {
+ if (nodes_use_tex((bNodeTree *)node->id, tex))
return 1;
}
}
@@ -191,13 +191,13 @@ static int nodes_use_material(bNodeTree *ntree, Material *ma)
{
bNode *node;
- for(node=ntree->nodes.first; node; node= node->next) {
- if(node->id) {
- if(node->id == (ID*)ma) {
+ for (node = ntree->nodes.first; node; node = node->next) {
+ if (node->id) {
+ if (node->id == (ID *)ma) {
return 1;
}
- else if(node->type==NODE_GROUP) {
- if(nodes_use_material((bNodeTree *)node->id, ma))
+ else if (node->type == NODE_GROUP) {
+ if (nodes_use_material((bNodeTree *)node->id, ma))
return 1;
}
}
@@ -214,17 +214,17 @@ static void material_changed(Main *bmain, Material *ma)
BKE_icon_changed(BKE_icon_getid(&ma->id));
/* glsl */
- if(ma->gpumaterial.first)
+ if (ma->gpumaterial.first)
GPU_material_free(ma);
/* find node materials using this */
- for(parent=bmain->mat.first; parent; parent=parent->id.next) {
- if(parent->use_nodes && parent->nodetree && nodes_use_material(parent->nodetree, ma));
+ for (parent = bmain->mat.first; parent; parent = parent->id.next) {
+ if (parent->use_nodes && parent->nodetree && nodes_use_material(parent->nodetree, ma)) ;
else continue;
BKE_icon_changed(BKE_icon_getid(&parent->id));
- if(parent->gpumaterial.first)
+ if (parent->gpumaterial.first)
GPU_material_free(parent);
}
}
@@ -241,40 +241,40 @@ static void texture_changed(Main *bmain, Tex *tex)
BKE_icon_changed(BKE_icon_getid(&tex->id));
/* find materials */
- for(ma=bmain->mat.first; ma; ma=ma->id.next) {
- if(mtex_use_tex(ma->mtex, MAX_MTEX, tex));
- else if(ma->use_nodes && ma->nodetree && nodes_use_tex(ma->nodetree, tex));
+ for (ma = bmain->mat.first; ma; ma = ma->id.next) {
+ if (mtex_use_tex(ma->mtex, MAX_MTEX, tex)) ;
+ else if (ma->use_nodes && ma->nodetree && nodes_use_tex(ma->nodetree, tex)) ;
else continue;
BKE_icon_changed(BKE_icon_getid(&ma->id));
- if(ma->gpumaterial.first)
+ if (ma->gpumaterial.first)
GPU_material_free(ma);
}
/* find lamps */
- for(la=bmain->lamp.first; la; la=la->id.next) {
- if(mtex_use_tex(la->mtex, MAX_MTEX, tex));
- else if(la->nodetree && nodes_use_tex(la->nodetree, tex));
+ for (la = bmain->lamp.first; la; la = la->id.next) {
+ if (mtex_use_tex(la->mtex, MAX_MTEX, tex)) ;
+ else if (la->nodetree && nodes_use_tex(la->nodetree, tex)) ;
else continue;
BKE_icon_changed(BKE_icon_getid(&la->id));
}
/* find worlds */
- for(wo=bmain->world.first; wo; wo=wo->id.next) {
- if(mtex_use_tex(wo->mtex, MAX_MTEX, tex));
- else if(wo->nodetree && nodes_use_tex(wo->nodetree, tex));
+ for (wo = bmain->world.first; wo; wo = wo->id.next) {
+ if (mtex_use_tex(wo->mtex, MAX_MTEX, tex)) ;
+ else if (wo->nodetree && nodes_use_tex(wo->nodetree, tex)) ;
else continue;
BKE_icon_changed(BKE_icon_getid(&wo->id));
}
/* find compositing nodes */
- for(scene=bmain->scene.first; scene; scene=scene->id.next) {
- if(scene->use_nodes && scene->nodetree) {
- for(node=scene->nodetree->nodes.first; node; node=node->next) {
- if(node->id == &tex->id)
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
+ if (scene->use_nodes && scene->nodetree) {
+ for (node = scene->nodetree->nodes.first; node; node = node->next) {
+ if (node->id == &tex->id)
ED_node_changed_update(&scene->id, node);
}
}
@@ -290,12 +290,12 @@ static void lamp_changed(Main *bmain, Lamp *la)
BKE_icon_changed(BKE_icon_getid(&la->id));
/* glsl */
- for(ob=bmain->object.first; ob; ob=ob->id.next)
- if(ob->data == la && ob->gpulamp.first)
+ for (ob = bmain->object.first; ob; ob = ob->id.next)
+ if (ob->data == la && ob->gpulamp.first)
GPU_lamp_free(ob);
- for(ma=bmain->mat.first; ma; ma=ma->id.next)
- if(ma->gpumaterial.first)
+ for (ma = bmain->mat.first; ma; ma = ma->id.next)
+ if (ma->gpumaterial.first)
GPU_material_free(ma);
}
@@ -307,8 +307,8 @@ static void world_changed(Main *bmain, World *wo)
BKE_icon_changed(BKE_icon_getid(&wo->id));
/* glsl */
- for(ma=bmain->mat.first; ma; ma=ma->id.next)
- if(ma->gpumaterial.first)
+ for (ma = bmain->mat.first; ma; ma = ma->id.next)
+ if (ma->gpumaterial.first)
GPU_material_free(ma);
}
@@ -320,8 +320,8 @@ static void image_changed(Main *bmain, Image *ima)
BKE_icon_changed(BKE_icon_getid(&ima->id));
/* textures */
- for(tex=bmain->tex.first; tex; tex=tex->id.next)
- if(tex->ima == ima)
+ for (tex = bmain->tex.first; tex; tex = tex->id.next)
+ if (tex->ima == ima)
texture_changed(bmain, tex);
}
@@ -331,35 +331,35 @@ static void scene_changed(Main *bmain, Scene *UNUSED(scene))
Material *ma;
/* glsl */
- for(ob=bmain->object.first; ob; ob=ob->id.next)
- if(ob->gpulamp.first)
+ for (ob = bmain->object.first; ob; ob = ob->id.next)
+ if (ob->gpulamp.first)
GPU_lamp_free(ob);
- for(ma=bmain->mat.first; ma; ma=ma->id.next)
- if(ma->gpumaterial.first)
+ for (ma = bmain->mat.first; ma; ma = ma->id.next)
+ if (ma->gpumaterial.first)
GPU_material_free(ma);
}
void ED_render_id_flush_update(Main *bmain, ID *id)
{
- switch(GS(id->name)) {
+ switch (GS(id->name)) {
case ID_MA:
- material_changed(bmain, (Material*)id);
+ material_changed(bmain, (Material *)id);
break;
case ID_TE:
- texture_changed(bmain, (Tex*)id);
+ texture_changed(bmain, (Tex *)id);
break;
case ID_WO:
- world_changed(bmain, (World*)id);
+ world_changed(bmain, (World *)id);
break;
case ID_LA:
- lamp_changed(bmain, (Lamp*)id);
+ lamp_changed(bmain, (Lamp *)id);
break;
case ID_IM:
- image_changed(bmain, (Image*)id);
+ image_changed(bmain, (Image *)id);
break;
case ID_SCE:
- scene_changed(bmain, (Scene*)id);
+ scene_changed(bmain, (Scene *)id);
break;
default:
break;
diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c
index d8719c7d7cd..0d902722183 100644
--- a/source/blender/editors/render/render_view.c
+++ b/source/blender/editors/render/render_view.c
@@ -61,24 +61,24 @@
/* would use BKE_screen_find_big_area(...) but this is too specific */
static ScrArea *biggest_non_image_area(bContext *C)
{
- bScreen *sc= CTX_wm_screen(C);
- ScrArea *sa, *big= NULL;
- int size, maxsize= 0, bwmaxsize= 0;
- short foundwin= 0;
-
- for(sa= sc->areabase.first; sa; sa= sa->next) {
- if(sa->winx > 30 && sa->winy > 30) {
- size= sa->winx*sa->winy;
- if(sa->spacetype == SPACE_BUTS) {
- if(foundwin == 0 && size > bwmaxsize) {
- bwmaxsize= size;
- big= sa;
+ bScreen *sc = CTX_wm_screen(C);
+ ScrArea *sa, *big = NULL;
+ int size, maxsize = 0, bwmaxsize = 0;
+ short foundwin = 0;
+
+ for (sa = sc->areabase.first; sa; sa = sa->next) {
+ if (sa->winx > 30 && sa->winy > 30) {
+ size = sa->winx * sa->winy;
+ if (sa->spacetype == SPACE_BUTS) {
+ if (foundwin == 0 && size > bwmaxsize) {
+ bwmaxsize = size;
+ big = sa;
}
}
- else if(sa->spacetype != SPACE_IMAGE && size > maxsize) {
- maxsize= size;
- big= sa;
- foundwin= 1;
+ else if (sa->spacetype != SPACE_IMAGE && size > maxsize) {
+ maxsize = size;
+ big = sa;
+ foundwin = 1;
}
}
}
@@ -88,20 +88,20 @@ static ScrArea *biggest_non_image_area(bContext *C)
static ScrArea *find_area_showing_r_result(bContext *C, wmWindow **win)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
ScrArea *sa = NULL;
SpaceImage *sima;
/* find an imagewindow showing render result */
- for(*win=wm->windows.first; *win; *win= (*win)->next) {
- for(sa= (*win)->screen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_IMAGE) {
- sima= sa->spacedata.first;
- if(sima->image && sima->image->type==IMA_TYPE_R_RESULT)
+ for (*win = wm->windows.first; *win; *win = (*win)->next) {
+ for (sa = (*win)->screen->areabase.first; sa; sa = sa->next) {
+ if (sa->spacetype == SPACE_IMAGE) {
+ sima = sa->spacedata.first;
+ if (sima->image && sima->image->type == IMA_TYPE_R_RESULT)
break;
}
}
- if(sa)
+ if (sa)
break;
}
@@ -110,15 +110,15 @@ static ScrArea *find_area_showing_r_result(bContext *C, wmWindow **win)
static ScrArea *find_area_image_empty(bContext *C)
{
- bScreen *sc= CTX_wm_screen(C);
+ bScreen *sc = CTX_wm_screen(C);
ScrArea *sa;
SpaceImage *sima;
/* find an imagewindow showing render result */
- for(sa=sc->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_IMAGE) {
- sima= sa->spacedata.first;
- if(!sima->image)
+ for (sa = sc->areabase.first; sa; sa = sa->next) {
+ if (sa->spacetype == SPACE_IMAGE) {
+ sima = sa->spacedata.first;
+ if (!sima->image)
break;
}
}
@@ -131,70 +131,70 @@ static ScrArea *find_area_image_empty(bContext *C)
/* new window uses x,y to set position */
void render_view_open(bContext *C, int mx, int my)
{
- wmWindow *win= CTX_wm_window(C);
- Scene *scene= CTX_data_scene(C);
- ScrArea *sa= NULL;
+ wmWindow *win = CTX_wm_window(C);
+ Scene *scene = CTX_data_scene(C);
+ ScrArea *sa = NULL;
SpaceImage *sima;
- int area_was_image=0;
+ int area_was_image = 0;
- if(scene->r.displaymode==R_OUTPUT_NONE)
+ if (scene->r.displaymode == R_OUTPUT_NONE)
return;
- if(scene->r.displaymode==R_OUTPUT_WINDOW) {
+ if (scene->r.displaymode == R_OUTPUT_WINDOW) {
rcti rect;
int sizex, sizey;
- sizex= 10 + (scene->r.xsch*scene->r.size)/100;
- sizey= 40 + (scene->r.ysch*scene->r.size)/100;
+ sizex = 10 + (scene->r.xsch * scene->r.size) / 100;
+ sizey = 40 + (scene->r.ysch * scene->r.size) / 100;
/* arbitrary... miniature image window views don't make much sense */
- if(sizex < 320) sizex= 320;
- if(sizey < 256) sizey= 256;
+ if (sizex < 320) sizex = 320;
+ if (sizey < 256) sizey = 256;
/* XXX some magic to calculate postition */
- rect.xmin= mx + win->posx - sizex/2;
- rect.ymin= my + win->posy - sizey/2;
- rect.xmax= rect.xmin + sizex;
- rect.ymax= rect.ymin + sizey;
+ rect.xmin = mx + win->posx - sizex / 2;
+ rect.ymin = my + win->posy - sizey / 2;
+ rect.xmax = rect.xmin + sizex;
+ rect.ymax = rect.ymin + sizey;
/* changes context! */
WM_window_open_temp(C, &rect, WM_WINDOW_RENDER);
- sa= CTX_wm_area(C);
+ sa = CTX_wm_area(C);
}
- else if(scene->r.displaymode==R_OUTPUT_SCREEN) {
+ else if (scene->r.displaymode == R_OUTPUT_SCREEN) {
if (CTX_wm_area(C) && CTX_wm_area(C)->spacetype == SPACE_IMAGE)
area_was_image = 1;
/* this function returns with changed context */
- sa= ED_screen_full_newspace(C, CTX_wm_area(C), SPACE_IMAGE);
+ sa = ED_screen_full_newspace(C, CTX_wm_area(C), SPACE_IMAGE);
}
- if(!sa) {
- sa= find_area_showing_r_result(C, &win);
- if(sa==NULL)
- sa= find_area_image_empty(C);
+ if (!sa) {
+ sa = find_area_showing_r_result(C, &win);
+ if (sa == NULL)
+ sa = find_area_image_empty(C);
/* if area found in other window, we make that one show in front */
- if(win && win!=CTX_wm_window(C))
+ if (win && win != CTX_wm_window(C))
wm_window_raise(win);
- if(sa==NULL) {
+ if (sa == NULL) {
/* find largest open non-image area */
- sa= biggest_non_image_area(C);
- if(sa) {
+ sa = biggest_non_image_area(C);
+ if (sa) {
ED_area_newspace(C, sa, SPACE_IMAGE);
- sima= sa->spacedata.first;
+ sima = sa->spacedata.first;
/* makes ESC go back to prev space */
sima->flag |= SI_PREVSPACE;
}
else {
/* use any area of decent size */
- sa= BKE_screen_find_big_area(CTX_wm_screen(C), -1, 0);
- if(sa->spacetype!=SPACE_IMAGE) {
+ sa = BKE_screen_find_big_area(CTX_wm_screen(C), -1, 0);
+ if (sa->spacetype != SPACE_IMAGE) {
// XXX newspace(sa, SPACE_IMAGE);
- sima= sa->spacedata.first;
+ sima = sa->spacedata.first;
/* makes ESC go back to prev space */
sima->flag |= SI_PREVSPACE;
@@ -202,15 +202,15 @@ void render_view_open(bContext *C, int mx, int my)
}
}
}
- sima= sa->spacedata.first;
+ sima = sa->spacedata.first;
/* get the correct image, and scale it */
- sima->image= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
+ sima->image = BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
/* if we're rendering to full screen, set appropriate hints on image editor
* so it can restore properly on pressing esc */
- if(sa->full) {
+ if (sa->full) {
sima->flag |= SI_FULLWINDOW;
/* Tell the image editor to revert to previous space in space list on close
@@ -229,20 +229,20 @@ void render_view_open(bContext *C, int mx, int my)
static int render_view_cancel_exec(bContext *C, wmOperator *UNUSED(op))
{
- wmWindow *win= CTX_wm_window(C);
- ScrArea *sa= CTX_wm_area(C);
- SpaceImage *sima= sa->spacedata.first;
+ wmWindow *win = CTX_wm_window(C);
+ ScrArea *sa = CTX_wm_area(C);
+ SpaceImage *sima = sa->spacedata.first;
/* test if we have a temp screen in front */
- if(CTX_wm_window(C)->screen->temp) {
+ if (CTX_wm_window(C)->screen->temp) {
wm_window_lower(CTX_wm_window(C));
return OPERATOR_FINISHED;
}
/* determine if render already shows */
- else if(sima->flag & SI_PREVSPACE) {
+ else if (sima->flag & SI_PREVSPACE) {
sima->flag &= ~SI_PREVSPACE;
- if(sima->flag & SI_FULLWINDOW) {
+ if (sima->flag & SI_FULLWINDOW) {
sima->flag &= ~SI_FULLWINDOW;
ED_screen_full_prevspace(C, sa);
}
@@ -251,7 +251,7 @@ static int render_view_cancel_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
- else if(sima->flag & SI_FULLWINDOW) {
+ else if (sima->flag & SI_FULLWINDOW) {
sima->flag &= ~SI_FULLWINDOW;
ED_screen_full_toggle(C, win, sa);
return OPERATOR_FINISHED;
@@ -263,13 +263,13 @@ static int render_view_cancel_exec(bContext *C, wmOperator *UNUSED(op))
void RENDER_OT_view_cancel(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Cancel Render View";
- ot->description= "Cancel show render view";
- ot->idname= "RENDER_OT_view_cancel";
+ ot->name = "Cancel Render View";
+ ot->description = "Cancel show render view";
+ ot->idname = "RENDER_OT_view_cancel";
/* api callbacks */
- ot->exec= render_view_cancel_exec;
- ot->poll= ED_operator_image_active;
+ ot->exec = render_view_cancel_exec;
+ ot->poll = ED_operator_image_active;
}
/************************* show render viewer *****************/
@@ -279,38 +279,38 @@ static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
wmWindow *wincur = CTX_wm_window(C);
/* test if we have currently a temp screen active */
- if(wincur->screen->temp) {
+ if (wincur->screen->temp) {
wm_window_lower(wincur);
}
else {
wmWindow *win, *winshow;
- ScrArea *sa= find_area_showing_r_result(C, &winshow);
+ ScrArea *sa = find_area_showing_r_result(C, &winshow);
/* is there another window showing result? */
- for(win= CTX_wm_manager(C)->windows.first; win; win= win->next) {
- if(win->screen->temp || (win==winshow && winshow!=wincur)) {
+ for (win = CTX_wm_manager(C)->windows.first; win; win = win->next) {
+ if (win->screen->temp || (win == winshow && winshow != wincur)) {
wm_window_raise(win);
return OPERATOR_FINISHED;
}
}
/* determine if render already shows */
- if(sa) {
+ if (sa) {
/* but don't close it when rendering */
- if(!G.rendering) {
- SpaceImage *sima= sa->spacedata.first;
+ if (!G.rendering) {
+ SpaceImage *sima = sa->spacedata.first;
- if(sima->flag & SI_PREVSPACE) {
+ if (sima->flag & SI_PREVSPACE) {
sima->flag &= ~SI_PREVSPACE;
- if(sima->flag & SI_FULLWINDOW) {
+ if (sima->flag & SI_FULLWINDOW) {
sima->flag &= ~SI_FULLWINDOW;
ED_screen_full_prevspace(C, sa);
}
- else if(sima->next) {
+ 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) */
- if(sima->next->spacetype == SPACE_FILE && sima->next->next)
+ * 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
ED_area_newspace(C, sa, sima->next->spacetype);
@@ -330,12 +330,12 @@ static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
void RENDER_OT_view_show(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Show/Hide Render View";
- ot->description= "Toggle show render view";
- ot->idname= "RENDER_OT_view_show";
+ ot->name = "Show/Hide Render View";
+ ot->description = "Toggle show render view";
+ ot->idname = "RENDER_OT_view_show";
/* api callbacks */
- ot->invoke= render_view_show_invoke;
- ot->poll= ED_operator_screenactive;
+ ot->invoke = render_view_show_invoke;
+ ot->poll = ED_operator_screenactive;
}
diff --git a/source/blender/editors/screen/CMakeLists.txt b/source/blender/editors/screen/CMakeLists.txt
index 79a805cfa6e..33373354aa4 100644
--- a/source/blender/editors/screen/CMakeLists.txt
+++ b/source/blender/editors/screen/CMakeLists.txt
@@ -47,4 +47,8 @@ set(SRC
screen_intern.h
)
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_editor_screen "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/screen/SConscript b/source/blender/editors/screen/SConscript
index ade26a0b80f..038a86328a3 100644
--- a/source/blender/editors/screen/SConscript
+++ b/source/blender/editors/screen/SConscript
@@ -8,7 +8,7 @@ incs += ' ../../blenloader ../../windowmanager ../../makesrna ../../gpu'
incs += ' ../../render/extern/include ../../bmesh'
incs += ' #/intern/guardedalloc #/extern/glew/include'
-defs = ''
+defs = []
if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
@@ -17,4 +17,7 @@ if env['OURPLATFORM'] == 'linux':
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
env.BlenderLib ( 'bf_editors_screen', sources, Split(incs), Split(defs), libtype=['core'], priority=[105] )
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index e4088fe10c4..43b917c2186 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -74,10 +74,10 @@ static void region_draw_emboss(ARegion *ar, rcti *scirct)
rcti rect;
/* translate scissor rect to region space */
- rect.xmin= scirct->xmin - ar->winrct.xmin;
- rect.ymin= scirct->ymin - ar->winrct.ymin;
- rect.xmax= scirct->xmax - ar->winrct.xmin;
- rect.ymax= scirct->ymax - ar->winrct.ymin;
+ rect.xmin = scirct->xmin - ar->winrct.xmin;
+ rect.ymin = scirct->ymin - ar->winrct.ymin;
+ rect.xmax = scirct->xmax - ar->winrct.xmin;
+ rect.ymax = scirct->ymax - ar->winrct.ymin;
/* set transp line */
glEnable( GL_BLEND );
@@ -117,7 +117,7 @@ void ED_region_do_listen(ARegion *ar, wmNotifier *note)
/* generic notes first */
switch(note->category) {
case NC_WM:
- if(note->data==ND_FILEREAD)
+ if (note->data==ND_FILEREAD)
ED_region_tag_redraw(ar);
break;
case NC_WINDOW:
@@ -125,7 +125,7 @@ void ED_region_do_listen(ARegion *ar, wmNotifier *note)
break;
}
- if(ar->type && ar->type->listener)
+ if (ar->type && ar->type->listener)
ar->type->listener(ar, note);
}
@@ -133,7 +133,7 @@ void ED_region_do_listen(ARegion *ar, wmNotifier *note)
void ED_area_do_listen(ScrArea *sa, wmNotifier *note)
{
/* no generic notes? */
- if(sa->type && sa->type->listener) {
+ if (sa->type && sa->type->listener) {
sa->type->listener(sa, note);
}
}
@@ -142,7 +142,7 @@ void ED_area_do_listen(ScrArea *sa, wmNotifier *note)
void ED_area_do_refresh(bContext *C, ScrArea *sa)
{
/* no generic notes? */
- if(sa->type && sa->type->refresh) {
+ if (sa->type && sa->type->refresh) {
sa->type->refresh(C, sa);
}
sa->do_refresh= 0;
@@ -154,14 +154,14 @@ void ED_area_overdraw_flush(ScrArea *sa, ARegion *ar)
{
AZone *az;
- for(az= sa->actionzones.first; az; az= az->next) {
+ for (az= sa->actionzones.first; az; az= az->next) {
int xs, ys;
xs= (az->x1+az->x2)/2;
ys= (az->y1+az->y2)/2;
/* test if inside */
- if(BLI_in_rcti(&ar->winrct, xs, ys)) {
+ if (BLI_in_rcti(&ar->winrct, xs, ys)) {
az->do_draw= 1;
}
}
@@ -360,22 +360,23 @@ void ED_area_overdraw(bContext *C)
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
- for(sa= screen->areabase.first; sa; sa= sa->next) {
+ for (sa= screen->areabase.first; sa; sa= sa->next) {
AZone *az;
- for(az= sa->actionzones.first; az; az= az->next) {
- if(az->do_draw) {
- if(az->type==AZONE_AREA) {
+ for (az= sa->actionzones.first; az; az= az->next) {
+ if (az->do_draw) {
+ if (az->type==AZONE_AREA) {
area_draw_azone(az->x1, az->y1, az->x2, az->y2);
- } else if(az->type==AZONE_REGION) {
+ }
+ else if (az->type==AZONE_REGION) {
- if(az->ar) {
+ if (az->ar) {
/* only display tab or icons when the region is hidden */
if (az->ar->flag & (RGN_FLAG_HIDDEN|RGN_FLAG_TOO_SMALL)) {
- if(G.rt==3)
+ if (G.rt==3)
region_draw_azone_icon(az);
- else if(G.rt==2)
+ else if (G.rt==2)
region_draw_azone_tria(az);
- else if(G.rt==1)
+ else if (G.rt==1)
region_draw_azone_tab(az);
else
region_draw_azone_tab_plus(az);
@@ -396,20 +397,20 @@ void region_scissor_winrct(ARegion *ar, rcti *winrct)
{
*winrct= ar->winrct;
- if(ELEM(ar->alignment, RGN_OVERLAP_LEFT, RGN_OVERLAP_RIGHT))
+ if (ELEM(ar->alignment, RGN_OVERLAP_LEFT, RGN_OVERLAP_RIGHT))
return;
- while(ar->prev) {
+ while (ar->prev) {
ar= ar->prev;
- if(BLI_isect_rcti(winrct, &ar->winrct, NULL)) {
- if(ar->flag & RGN_FLAG_HIDDEN);
- else if(ar->alignment & RGN_SPLIT_PREV);
- else if(ar->alignment==RGN_OVERLAP_LEFT) {
- winrct->xmin= ar->winrct.xmax + 1;
+ if (BLI_isect_rcti(winrct, &ar->winrct, NULL)) {
+ if (ar->flag & RGN_FLAG_HIDDEN);
+ else if (ar->alignment & RGN_SPLIT_PREV);
+ else if (ar->alignment==RGN_OVERLAP_LEFT) {
+ winrct->xmin = ar->winrct.xmax + 1;
}
- else if(ar->alignment==RGN_OVERLAP_RIGHT) {
- winrct->xmax= ar->winrct.xmin - 1;
+ else if (ar->alignment==RGN_OVERLAP_RIGHT) {
+ winrct->xmax = ar->winrct.xmin - 1;
}
else break;
}
@@ -447,40 +448,37 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
rcti winrct;
/* see BKE_spacedata_draw_locks() */
- if(at->do_lock)
+ if (at->do_lock)
return;
/* checks other overlapping regions */
region_scissor_winrct(ar, &winrct);
/* if no partial draw rect set, full rect */
- if(ar->drawrct.xmin == ar->drawrct.xmax)
+ if (ar->drawrct.xmin == ar->drawrct.xmax)
ar->drawrct= winrct;
else {
/* extra clip for safety */
- ar->drawrct.xmin= MAX2(winrct.xmin, ar->drawrct.xmin);
- ar->drawrct.ymin= MAX2(winrct.ymin, ar->drawrct.ymin);
- ar->drawrct.xmax= MIN2(winrct.xmax, ar->drawrct.xmax);
- ar->drawrct.ymax= MIN2(winrct.ymax, ar->drawrct.ymax);
+ ar->drawrct.xmin = MAX2(winrct.xmin, ar->drawrct.xmin);
+ ar->drawrct.ymin = MAX2(winrct.ymin, ar->drawrct.ymin);
+ ar->drawrct.xmax = MIN2(winrct.xmax, ar->drawrct.xmax);
+ ar->drawrct.ymax = MIN2(winrct.ymax, ar->drawrct.ymax);
}
/* 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);
/* optional header info instead? */
- if(ar->headerstr) {
+ if (ar->headerstr) {
UI_ThemeClearColor(TH_HEADER);
glClear(GL_COLOR_BUFFER_BIT);
UI_ThemeColor(TH_TEXT);
BLF_draw_default(20, 8, 0.0f, ar->headerstr, BLF_DRAW_STR_DUMMY_MAX);
}
- else if(at->draw) {
+ else if (at->draw) {
at->draw(C, ar);
}
@@ -488,21 +486,24 @@ 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);
- if(sa)
+ if (sa)
region_draw_emboss(ar, &winrct);
}
/* **********************************
- 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)
{
- if(ar) {
+ if (ar) {
/* zero region means full region redraw */
ar->do_draw= RGN_DRAW;
memset(&ar->drawrct, 0, sizeof(ar->drawrct));
@@ -511,24 +512,24 @@ void ED_region_tag_redraw(ARegion *ar)
void ED_region_tag_redraw_overlay(ARegion *ar)
{
- if(ar)
+ if (ar)
ar->do_draw_overlay= RGN_DRAW;
}
void ED_region_tag_redraw_partial(ARegion *ar, rcti *rct)
{
- if(ar) {
- if(!ar->do_draw) {
+ if (ar) {
+ if (!ar->do_draw) {
/* no redraw set yet, set partial region */
ar->do_draw= RGN_DRAW_PARTIAL;
ar->drawrct= *rct;
}
- else if(ar->drawrct.xmin != ar->drawrct.xmax) {
+ else if (ar->drawrct.xmin != ar->drawrct.xmax) {
/* partial redraw already set, expand region */
- ar->drawrct.xmin= MIN2(ar->drawrct.xmin, rct->xmin);
- ar->drawrct.ymin= MIN2(ar->drawrct.ymin, rct->ymin);
- ar->drawrct.xmax= MAX2(ar->drawrct.xmax, rct->xmax);
- ar->drawrct.ymax= MAX2(ar->drawrct.ymax, rct->ymax);
+ ar->drawrct.xmin = MIN2(ar->drawrct.xmin, rct->xmin);
+ ar->drawrct.ymin = MIN2(ar->drawrct.ymin, rct->ymin);
+ ar->drawrct.xmax = MAX2(ar->drawrct.xmax, rct->xmax);
+ ar->drawrct.ymax = MAX2(ar->drawrct.ymax, rct->ymax);
}
}
}
@@ -537,8 +538,8 @@ void ED_area_tag_redraw(ScrArea *sa)
{
ARegion *ar;
- if(sa)
- for(ar= sa->regionbase.first; ar; ar= ar->next)
+ if (sa)
+ for (ar= sa->regionbase.first; ar; ar= ar->next)
ED_region_tag_redraw(ar);
}
@@ -546,9 +547,9 @@ void ED_area_tag_redraw_regiontype(ScrArea *sa, int regiontype)
{
ARegion *ar;
- if(sa) {
- for(ar= sa->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype == regiontype) {
+ if (sa) {
+ for (ar= sa->regionbase.first; ar; ar= ar->next) {
+ if (ar->regiontype == regiontype) {
ED_region_tag_redraw(ar);
}
}
@@ -557,7 +558,7 @@ void ED_area_tag_redraw_regiontype(ScrArea *sa, int regiontype)
void ED_area_tag_refresh(ScrArea *sa)
{
- if(sa)
+ if (sa)
sa->do_refresh= 1;
}
@@ -569,17 +570,17 @@ void ED_area_headerprint(ScrArea *sa, const char *str)
ARegion *ar;
/* happens when running transform operators in backround mode */
- if(sa == NULL)
+ if (sa == NULL)
return;
- for(ar= sa->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype==RGN_TYPE_HEADER) {
- if(str) {
- if(ar->headerstr==NULL)
+ for (ar= sa->regionbase.first; ar; ar= ar->next) {
+ if (ar->regiontype==RGN_TYPE_HEADER) {
+ if (str) {
+ if (ar->headerstr==NULL)
ar->headerstr= MEM_mallocN(256, "headerprint");
BLI_strncpy(ar->headerstr, str, 256);
}
- else if(ar->headerstr) {
+ else if (ar->headerstr) {
MEM_freeN(ar->headerstr);
ar->headerstr= NULL;
}
@@ -658,10 +659,10 @@ 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 */
- for(azt= sa->actionzones.first; azt; azt= azt->next) {
- if(azt->edge == az->edge) tot++;
+ * 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++;
}
switch(az->edge) {
@@ -694,14 +695,14 @@ static void region_azone_icon(ScrArea *sa, AZone *az, ARegion *ar)
BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
/* if more azones on 1 spot, set offset */
- for(azt= sa->actionzones.first; azt; azt= azt->next) {
- if(az!=azt) {
- if( ABS(az->x1-azt->x1) < 2 && ABS(az->y1-azt->y1) < 2) {
- if(az->edge==AE_TOP_TO_BOTTOMRIGHT || az->edge==AE_BOTTOM_TO_TOPLEFT) {
+ for (azt= sa->actionzones.first; azt; azt= azt->next) {
+ if (az!=azt) {
+ if ( ABS(az->x1-azt->x1) < 2 && ABS(az->y1-azt->y1) < 2) {
+ if (az->edge==AE_TOP_TO_BOTTOMRIGHT || az->edge==AE_BOTTOM_TO_TOPLEFT) {
az->x1+= AZONESPOT;
az->x2+= AZONESPOT;
}
- else{
+ else {
az->y1-= AZONESPOT;
az->y2-= AZONESPOT;
}
@@ -720,13 +721,13 @@ static void region_azone_tab_plus(ScrArea *sa, AZone *az, ARegion *ar)
AZone *azt;
int tot= 0, add;
- for(azt= sa->actionzones.first; azt; azt= azt->next) {
- if(azt->edge == az->edge) tot++;
+ for (azt= sa->actionzones.first; azt; azt= azt->next) {
+ if (azt->edge == az->edge) tot++;
}
switch(az->edge) {
case AE_TOP_TO_BOTTOMRIGHT:
- if(ar->winrct.ymax == sa->totrct.ymin) add= 1; else add= 0;
+ if (ar->winrct.ymax == sa->totrct.ymin) add= 1; else add= 0;
az->x1= ar->winrct.xmax - 2.5*AZONEPAD_TAB_PLUSW;
az->y1= ar->winrct.ymax - add;
az->x2= ar->winrct.xmax - 1.5*AZONEPAD_TAB_PLUSW;
@@ -765,13 +766,13 @@ static void region_azone_tab(ScrArea *sa, AZone *az, ARegion *ar)
AZone *azt;
int tot= 0, add;
- for(azt= sa->actionzones.first; azt; azt= azt->next) {
- if(azt->edge == az->edge) tot++;
+ for (azt= sa->actionzones.first; azt; azt= azt->next) {
+ if (azt->edge == az->edge) tot++;
}
switch(az->edge) {
case AE_TOP_TO_BOTTOMRIGHT:
- if(ar->winrct.ymax == sa->totrct.ymin) add= 1; else add= 0;
+ if (ar->winrct.ymax == sa->totrct.ymin) add= 1; else add= 0;
az->x1= ar->winrct.xmax - 2*AZONEPAD_TABW;
az->y1= ar->winrct.ymax - add;
az->x2= ar->winrct.xmax - AZONEPAD_TABW;
@@ -810,13 +811,13 @@ static void region_azone_tria(ScrArea *sa, AZone *az, ARegion *ar)
AZone *azt;
int tot= 0, add;
- for(azt= sa->actionzones.first; azt; azt= azt->next) {
- if(azt->edge == az->edge) tot++;
+ for (azt= sa->actionzones.first; azt; azt= azt->next) {
+ if (azt->edge == az->edge) tot++;
}
switch(az->edge) {
case AE_TOP_TO_BOTTOMRIGHT:
- if(ar->winrct.ymax == sa->totrct.ymin) add= 1; else add= 0;
+ if (ar->winrct.ymax == sa->totrct.ymin) add= 1; else add= 0;
az->x1= ar->winrct.xmax - 2*AZONEPAD_TRIAW;
az->y1= ar->winrct.ymax - add;
az->x2= ar->winrct.xmax - AZONEPAD_TRIAW;
@@ -857,15 +858,16 @@ static void region_azone_initialize(ScrArea *sa, ARegion *ar, AZEdge edge)
az->edge= edge;
if (ar->flag & (RGN_FLAG_HIDDEN|RGN_FLAG_TOO_SMALL)) {
- if(G.rt==3)
+ if (G.rt==3)
region_azone_icon(sa, az, ar);
- else if(G.rt==2)
+ else if (G.rt==2)
region_azone_tria(sa, az, ar);
- else if(G.rt==1)
+ else if (G.rt==1)
region_azone_tab(sa, az, ar);
else
region_azone_tab_plus(sa, az, ar);
- } else {
+ }
+ else {
region_azone_edge(az, ar);
}
@@ -878,20 +880,20 @@ static void region_azone_add(ScrArea *sa, ARegion *ar, int alignment)
{
/* edge code (t b l r) is along which area edge azone will be drawn */
- if(alignment==RGN_ALIGN_TOP)
+ if (alignment==RGN_ALIGN_TOP)
region_azone_initialize(sa, ar, AE_BOTTOM_TO_TOPLEFT);
- else if(alignment==RGN_ALIGN_BOTTOM)
+ else if (alignment==RGN_ALIGN_BOTTOM)
region_azone_initialize(sa, ar, AE_TOP_TO_BOTTOMRIGHT);
- else if(ELEM(alignment, RGN_ALIGN_RIGHT, RGN_OVERLAP_RIGHT))
+ else if (ELEM(alignment, RGN_ALIGN_RIGHT, RGN_OVERLAP_RIGHT))
region_azone_initialize(sa, ar, AE_LEFT_TO_TOPRIGHT);
- else if(ELEM(alignment, RGN_ALIGN_LEFT, RGN_OVERLAP_LEFT))
+ else if (ELEM(alignment, RGN_ALIGN_LEFT, RGN_OVERLAP_LEFT))
region_azone_initialize(sa, ar, AE_RIGHT_TO_TOPLEFT);
}
/* dir is direction to check, not the splitting edge direction! */
static int rct_fits(rcti *rect, char dir, int size)
{
- if(dir=='h') {
+ if (dir=='h') {
return rect->xmax-rect->xmin - size;
}
else { // 'v'
@@ -905,15 +907,15 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int
int prefsizex, prefsizey;
int alignment;
- if(ar==NULL)
+ if (ar==NULL)
return;
/* no returns in function, winrct gets set in the end again */
BLI_init_rcti(&ar->winrct, 0, 0, 0, 0);
/* for test; allow split of previously defined region */
- if(ar->alignment & RGN_SPLIT_PREV)
- if(ar->prev)
+ if (ar->alignment & RGN_SPLIT_PREV)
+ if (ar->prev)
remainder= &ar->prev->winrct;
alignment = ar->alignment & ~RGN_SPLIT_PREV;
@@ -921,135 +923,135 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int
/* clear state flags first */
ar->flag &= ~RGN_FLAG_TOO_SMALL;
/* user errors */
- if(ar->next==NULL && alignment!=RGN_ALIGN_QSPLIT)
+ if (ar->next==NULL && alignment!=RGN_ALIGN_QSPLIT)
alignment= RGN_ALIGN_NONE;
/* prefsize, for header we stick to exception */
prefsizex= ar->sizex?ar->sizex:ar->type->prefsizex;
- if(ar->regiontype==RGN_TYPE_HEADER)
+ if (ar->regiontype==RGN_TYPE_HEADER)
prefsizey= ar->type->prefsizey;
- else if(ar->regiontype==RGN_TYPE_UI && sa->spacetype == SPACE_FILE) {
+ else if (ar->regiontype==RGN_TYPE_UI && sa->spacetype == SPACE_FILE) {
prefsizey= UI_UNIT_Y * 2 + (UI_UNIT_Y/2);
}
else
prefsizey= ar->sizey?ar->sizey:ar->type->prefsizey;
/* hidden is user flag */
- if(ar->flag & RGN_FLAG_HIDDEN);
+ if (ar->flag & RGN_FLAG_HIDDEN);
/* XXX floating area region, not handled yet here */
- else if(alignment == RGN_ALIGN_FLOAT);
+ else if (alignment == RGN_ALIGN_FLOAT);
/* remainder is too small for any usage */
- else if( rct_fits(remainder, 'v', 1)<0 || rct_fits(remainder, 'h', 1) < 0 ) {
+ else if ( rct_fits(remainder, 'v', 1)<0 || rct_fits(remainder, 'h', 1) < 0 ) {
ar->flag |= RGN_FLAG_TOO_SMALL;
}
- else if(alignment==RGN_ALIGN_NONE) {
+ else if (alignment==RGN_ALIGN_NONE) {
/* typically last region */
ar->winrct= *remainder;
BLI_init_rcti(remainder, 0, 0, 0, 0);
}
- else if(alignment==RGN_ALIGN_TOP || alignment==RGN_ALIGN_BOTTOM) {
+ else if (alignment==RGN_ALIGN_TOP || alignment==RGN_ALIGN_BOTTOM) {
- if( rct_fits(remainder, 'v', prefsizey) < 0 ) {
+ if ( rct_fits(remainder, 'v', prefsizey) < 0 ) {
ar->flag |= RGN_FLAG_TOO_SMALL;
}
else {
int fac= rct_fits(remainder, 'v', prefsizey);
- if(fac < 0 )
+ if (fac < 0 )
prefsizey += fac;
ar->winrct= *remainder;
- if(alignment==RGN_ALIGN_TOP) {
- ar->winrct.ymin= ar->winrct.ymax - prefsizey + 1;
- remainder->ymax= ar->winrct.ymin - 1;
+ if (alignment==RGN_ALIGN_TOP) {
+ ar->winrct.ymin = ar->winrct.ymax - prefsizey + 1;
+ remainder->ymax = ar->winrct.ymin - 1;
}
else {
- ar->winrct.ymax= ar->winrct.ymin + prefsizey - 1;
- remainder->ymin= ar->winrct.ymax + 1;
+ ar->winrct.ymax = ar->winrct.ymin + prefsizey - 1;
+ remainder->ymin = ar->winrct.ymax + 1;
}
}
}
- else if( ELEM4(alignment, RGN_ALIGN_LEFT, RGN_ALIGN_RIGHT, RGN_OVERLAP_LEFT, RGN_OVERLAP_RIGHT)) {
+ else if ( ELEM4(alignment, RGN_ALIGN_LEFT, RGN_ALIGN_RIGHT, RGN_OVERLAP_LEFT, RGN_OVERLAP_RIGHT)) {
- if( rct_fits(remainder, 'h', prefsizex) < 0 ) {
+ if ( rct_fits(remainder, 'h', prefsizex) < 0 ) {
ar->flag |= RGN_FLAG_TOO_SMALL;
}
else {
int fac= rct_fits(remainder, 'h', prefsizex);
- if(fac < 0 )
+ if (fac < 0 )
prefsizex += fac;
ar->winrct= *remainder;
- if(ELEM(alignment, RGN_ALIGN_RIGHT, RGN_OVERLAP_RIGHT)) {
- ar->winrct.xmin= ar->winrct.xmax - prefsizex + 1;
- if(alignment==RGN_ALIGN_RIGHT)
- remainder->xmax= ar->winrct.xmin - 1;
+ if (ELEM(alignment, RGN_ALIGN_RIGHT, RGN_OVERLAP_RIGHT)) {
+ ar->winrct.xmin = ar->winrct.xmax - prefsizex + 1;
+ if (alignment==RGN_ALIGN_RIGHT)
+ remainder->xmax = ar->winrct.xmin - 1;
}
else {
- ar->winrct.xmax= ar->winrct.xmin + prefsizex - 1;
- if(alignment==RGN_ALIGN_LEFT)
- remainder->xmin= ar->winrct.xmax + 1;
+ ar->winrct.xmax = ar->winrct.xmin + prefsizex - 1;
+ if (alignment==RGN_ALIGN_LEFT)
+ remainder->xmin = ar->winrct.xmax + 1;
}
}
}
- else if(alignment==RGN_ALIGN_VSPLIT || alignment==RGN_ALIGN_HSPLIT) {
+ else if (alignment==RGN_ALIGN_VSPLIT || alignment==RGN_ALIGN_HSPLIT) {
/* percentage subdiv*/
ar->winrct= *remainder;
- if(alignment==RGN_ALIGN_HSPLIT) {
- if( rct_fits(remainder, 'h', prefsizex) > 4) {
- ar->winrct.xmax= (remainder->xmin+remainder->xmax)/2;
- remainder->xmin= ar->winrct.xmax+1;
+ if (alignment==RGN_ALIGN_HSPLIT) {
+ if ( rct_fits(remainder, 'h', prefsizex) > 4) {
+ ar->winrct.xmax = (remainder->xmin+remainder->xmax)/2;
+ remainder->xmin = ar->winrct.xmax+1;
}
else {
BLI_init_rcti(remainder, 0, 0, 0, 0);
}
}
else {
- if( rct_fits(remainder, 'v', prefsizey) > 4) {
- ar->winrct.ymax= (remainder->ymin+remainder->ymax)/2;
- remainder->ymin= ar->winrct.ymax+1;
+ if ( rct_fits(remainder, 'v', prefsizey) > 4) {
+ ar->winrct.ymax = (remainder->ymin+remainder->ymax)/2;
+ remainder->ymin = ar->winrct.ymax+1;
}
else {
BLI_init_rcti(remainder, 0, 0, 0, 0);
}
}
}
- else if(alignment==RGN_ALIGN_QSPLIT) {
+ else if (alignment==RGN_ALIGN_QSPLIT) {
ar->winrct= *remainder;
/* test if there's still 4 regions left */
- if(quad==0) {
+ if (quad==0) {
ARegion *artest= ar->next;
int count= 1;
- while(artest) {
+ while (artest) {
artest->alignment= RGN_ALIGN_QSPLIT;
artest= artest->next;
count++;
}
- if(count!=4) {
+ if (count!=4) {
/* let's stop adding regions */
BLI_init_rcti(remainder, 0, 0, 0, 0);
- if (G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("region quadsplit failed\n");
}
else quad= 1;
}
- if(quad) {
- if(quad==1) { /* left bottom */
+ if (quad) {
+ if (quad==1) { /* left bottom */
ar->winrct.xmax = (remainder->xmin + remainder->xmax)/2;
ar->winrct.ymax = (remainder->ymin + remainder->ymax)/2;
}
- else if(quad==2) { /* left top */
+ else if (quad==2) { /* left top */
ar->winrct.xmax = (remainder->xmin + remainder->xmax)/2;
ar->winrct.ymin = 1 + (remainder->ymin + remainder->ymax)/2;
}
- else if(quad==3) { /* right bottom */
+ else if (quad==3) { /* right bottom */
ar->winrct.xmin = 1 + (remainder->xmin + remainder->xmax)/2;
ar->winrct.ymax = (remainder->ymin + remainder->ymax)/2;
}
@@ -1068,24 +1070,24 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int
ar->winy= ar->winrct.ymax - ar->winrct.ymin + 1;
/* set winrect for azones */
- if(ar->flag & (RGN_FLAG_HIDDEN|RGN_FLAG_TOO_SMALL)) {
+ if (ar->flag & (RGN_FLAG_HIDDEN|RGN_FLAG_TOO_SMALL)) {
ar->winrct= *remainder;
- if(alignment==RGN_ALIGN_TOP)
- ar->winrct.ymin= ar->winrct.ymax;
- else if(alignment==RGN_ALIGN_BOTTOM)
- ar->winrct.ymax= ar->winrct.ymin;
- else if(ELEM(alignment, RGN_ALIGN_RIGHT, RGN_OVERLAP_RIGHT))
- ar->winrct.xmin= ar->winrct.xmax;
- else if(ELEM(alignment, RGN_ALIGN_LEFT, RGN_OVERLAP_LEFT))
- ar->winrct.xmax= ar->winrct.xmin;
+ if (alignment==RGN_ALIGN_TOP)
+ ar->winrct.ymin = ar->winrct.ymax;
+ else if (alignment==RGN_ALIGN_BOTTOM)
+ ar->winrct.ymax = ar->winrct.ymin;
+ else if (ELEM(alignment, RGN_ALIGN_RIGHT, RGN_OVERLAP_RIGHT))
+ ar->winrct.xmin = ar->winrct.xmax;
+ else if (ELEM(alignment, RGN_ALIGN_LEFT, RGN_OVERLAP_LEFT))
+ ar->winrct.xmax = ar->winrct.xmin;
else /* prevent winrct to be valid */
- ar->winrct.xmax= ar->winrct.xmin;
+ ar->winrct.xmax = ar->winrct.xmin;
}
/* restore prev-split exception */
- if(ar->alignment & RGN_SPLIT_PREV) {
- if(ar->prev) {
+ if (ar->alignment & RGN_SPLIT_PREV) {
+ if (ar->prev) {
remainder= remainder_prev;
ar->prev->winx= ar->prev->winrct.xmax - ar->prev->winrct.xmin + 1;
ar->prev->winy= ar->prev->winrct.ymax - ar->prev->winrct.ymin + 1;
@@ -1093,7 +1095,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int
}
/* in end, add azones, where appropriate */
- if(ar->regiontype == RGN_TYPE_HEADER && ar->winy + 6 > sa->winy) {
+ if (ar->regiontype == RGN_TYPE_HEADER && ar->winy + 6 > sa->winy) {
/* The logic for this is: when the header takes up the full area,
* disallow hiding it to view the main window.
*
@@ -1113,15 +1115,15 @@ static void area_calc_totrct(ScrArea *sa, int sizex, int sizey)
{
short rt= 0; // CLAMPIS(G.rt, 0, 16);
- if(sa->v1->vec.x>0) sa->totrct.xmin= sa->v1->vec.x+1+rt;
- else sa->totrct.xmin= sa->v1->vec.x;
- if(sa->v4->vec.x<sizex-1) sa->totrct.xmax= sa->v4->vec.x-1-rt;
- else sa->totrct.xmax= sa->v4->vec.x;
+ if (sa->v1->vec.x>0) sa->totrct.xmin = sa->v1->vec.x+1+rt;
+ else sa->totrct.xmin = sa->v1->vec.x;
+ if (sa->v4->vec.x<sizex-1) sa->totrct.xmax = sa->v4->vec.x-1-rt;
+ else sa->totrct.xmax = sa->v4->vec.x;
- if(sa->v1->vec.y>0) sa->totrct.ymin= sa->v1->vec.y+1+rt;
- else sa->totrct.ymin= sa->v1->vec.y;
- if(sa->v2->vec.y<sizey-1) sa->totrct.ymax= sa->v2->vec.y-1-rt;
- else sa->totrct.ymax= sa->v2->vec.y;
+ if (sa->v1->vec.y>0) sa->totrct.ymin = sa->v1->vec.y+1+rt;
+ else sa->totrct.ymin = sa->v1->vec.y;
+ if (sa->v2->vec.y<sizey-1) sa->totrct.ymax = sa->v2->vec.y-1-rt;
+ else sa->totrct.ymax = sa->v2->vec.y;
/* for speedup */
sa->winx= sa->totrct.xmax-sa->totrct.xmin+1;
@@ -1132,12 +1134,12 @@ static void area_calc_totrct(ScrArea *sa, int sizex, int sizey)
/* used for area initialize below */
static void region_subwindow(wmWindow *win, ARegion *ar)
{
- if(ar->flag & (RGN_FLAG_HIDDEN|RGN_FLAG_TOO_SMALL)) {
- if(ar->swinid)
+ if (ar->flag & (RGN_FLAG_HIDDEN|RGN_FLAG_TOO_SMALL)) {
+ if (ar->swinid)
wm_subwindow_close(win, ar->swinid);
ar->swinid= 0;
}
- else if(ar->swinid==0)
+ else if (ar->swinid==0)
ar->swinid= wm_subwindow_open(win, &ar->winrct);
else
wm_subwindow_position(win, ar->swinid, &ar->winrct);
@@ -1148,49 +1150,49 @@ static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *hand
/* note, add-handler checks if it already exists */
// XXX it would be good to have boundbox checks for some of these...
- if(flag & ED_KEYMAP_UI) {
+ if (flag & ED_KEYMAP_UI) {
/* user interface widgets */
UI_add_region_handlers(handlers);
}
- if(flag & ED_KEYMAP_VIEW2D) {
+ if (flag & ED_KEYMAP_VIEW2D) {
/* 2d-viewport handling+manipulation */
- wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "View2D", 0, 0);
+ wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "View2D", 0, 0);
WM_event_add_keymap_handler(handlers, keymap);
}
- if(flag & ED_KEYMAP_MARKERS) {
+ if (flag & ED_KEYMAP_MARKERS) {
/* time-markers */
- wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "Markers", 0, 0);
+ wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Markers", 0, 0);
/* time space only has this keymap, the others get a boundbox restricted map */
- if(sa->spacetype!=SPACE_TIME) {
+ if (sa->spacetype!=SPACE_TIME) {
ARegion *ar;
static rcti rect= {0, 10000, 0, 30}; /* same local check for all areas */
ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
- if(ar) {
+ if (ar) {
WM_event_add_keymap_handler_bb(handlers, keymap, &rect, &ar->winrct);
}
}
else
WM_event_add_keymap_handler(handlers, keymap);
}
- if(flag & ED_KEYMAP_ANIMATION) {
+ if (flag & ED_KEYMAP_ANIMATION) {
/* frame changing and timeline operators (for time spaces) */
- wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "Animation", 0, 0);
+ wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Animation", 0, 0);
WM_event_add_keymap_handler(handlers, keymap);
}
- if(flag & ED_KEYMAP_FRAMES) {
+ if (flag & ED_KEYMAP_FRAMES) {
/* frame changing/jumping (for all spaces) */
- wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "Frames", 0, 0);
+ wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Frames", 0, 0);
WM_event_add_keymap_handler(handlers, keymap);
}
- if(flag & ED_KEYMAP_GPENCIL) {
+ if (flag & ED_KEYMAP_GPENCIL) {
/* grease pencil */
- wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "Grease Pencil", 0, 0);
+ wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Grease Pencil", 0, 0);
WM_event_add_keymap_handler(handlers, keymap);
}
- if(flag & ED_KEYMAP_HEADER) {
+ if (flag & ED_KEYMAP_HEADER) {
/* standard keymap for headers regions */
- wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "Header", 0, 0);
+ wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Header", 0, 0);
WM_event_add_keymap_handler(handlers, keymap);
}
}
@@ -1205,12 +1207,12 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa)
/* set typedefinitions */
sa->type= BKE_spacetype_from_id(sa->spacetype);
- if(sa->type==NULL) {
+ if (sa->type==NULL) {
sa->butspacetype= sa->spacetype= SPACE_VIEW3D;
sa->type= BKE_spacetype_from_id(sa->spacetype);
}
- for(ar= sa->regionbase.first; ar; ar= ar->next)
+ for (ar= sa->regionbase.first; ar; ar= ar->next)
ar->type= BKE_regiontype_from_id(sa->type, ar->regiontype);
/* area sizes */
@@ -1226,18 +1228,18 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa)
/* default area handlers */
ed_default_handlers(wm, sa, &sa->handlers, sa->type->keymapflag);
/* checks spacedata, adds own handlers */
- if(sa->type->init)
+ if (sa->type->init)
sa->type->init(wm, sa);
/* region windows, default and own handlers */
- for(ar= sa->regionbase.first; ar; ar= ar->next) {
+ for (ar= sa->regionbase.first; ar; ar= ar->next) {
region_subwindow(win, ar);
- if(ar->swinid) {
+ if (ar->swinid) {
/* default region handlers */
ed_default_handlers(wm, sa, &ar->handlers, ar->type->keymapflag);
/* own handlers */
- if(ar->type->init)
+ if (ar->type->init)
ar->type->init(wm, ar);
}
else {
@@ -1246,7 +1248,7 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa)
}
/* rechecks 2d matrix for header on dpi changing, do not do for other regions, it resets view && blocks view2d operator polls (ton) */
- if(ar->regiontype==RGN_TYPE_HEADER)
+ if (ar->regiontype==RGN_TYPE_HEADER)
ar->v2d.flag &= ~V2D_IS_INITIALISED;
}
}
@@ -1273,7 +1275,7 @@ void ED_region_toggle_hidden(bContext *C, ARegion *ar)
ar->flag ^= RGN_FLAG_HIDDEN;
- if(ar->flag & RGN_FLAG_HIDDEN)
+ if (ar->flag & RGN_FLAG_HIDDEN)
WM_event_remove_handlers(C, &ar->handlers);
ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa);
@@ -1292,10 +1294,10 @@ void area_copy_data(ScrArea *sa1, ScrArea *sa2, int swap_space)
sa1->spacetype= sa2->spacetype;
sa1->butspacetype= sa2->butspacetype;
- if(swap_space == 1) {
+ if (swap_space == 1) {
SWAP(ListBase, sa1->spacedata, sa2->spacedata);
/* exception: ensure preview is reset */
-// if(sa1->spacetype==SPACE_VIEW3D)
+// if (sa1->spacetype==SPACE_VIEW3D)
// XXX BIF_view3d_previewrender_free(sa1->spacedata.first);
}
else if (swap_space == 2) {
@@ -1309,19 +1311,19 @@ void area_copy_data(ScrArea *sa1, ScrArea *sa2, int swap_space)
/* Note; SPACE_EMPTY is possible on new screens */
/* regions */
- if(swap_space == 1) {
+ if (swap_space == 1) {
SWAP(ListBase, sa1->regionbase, sa2->regionbase);
}
else {
- if(swap_space<2) {
+ if (swap_space<2) {
st= BKE_spacetype_from_id(spacetype);
- for(ar= sa1->regionbase.first; ar; ar= ar->next)
+ for (ar= sa1->regionbase.first; ar; ar= ar->next)
BKE_area_region_free(st, ar);
BLI_freelistN(&sa1->regionbase);
}
st= BKE_spacetype_from_id(sa2->spacetype);
- for(ar= sa2->regionbase.first; ar; ar= ar->next) {
+ for (ar= sa2->regionbase.first; ar; ar= ar->next) {
ARegion *newar= BKE_area_region_copy(st, ar);
BLI_addtail(&sa1->regionbase, newar);
}
@@ -1357,7 +1359,7 @@ void ED_area_swapspace(bContext *C, ScrArea *sa1, ScrArea *sa2)
void ED_area_newspace(bContext *C, ScrArea *sa, int type)
{
- if(sa->spacetype != type) {
+ if (sa->spacetype != type) {
SpaceType *st;
SpaceLink *slold;
SpaceLink *sl;
@@ -1373,14 +1375,14 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type)
/* check previously stored space */
for (sl= sa->spacedata.first; sl; sl= sl->next)
- if(sl->spacetype==type)
+ if (sl->spacetype==type)
break;
/* old spacedata... happened during work on 2.50, remove */
- if(sl && sl->regionbase.first==NULL) {
+ if (sl && sl->regionbase.first==NULL) {
st->free(sl);
BLI_freelinkN(&sa->spacedata, sl);
- if(slold == sl) {
+ if (slold == sl) {
slold= NULL;
}
sl= NULL;
@@ -1399,12 +1401,12 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type)
}
else {
/* new space */
- if(st) {
+ if (st) {
sl= st->new(C);
BLI_addhead(&sa->spacedata, sl);
/* swap regions */
- if(slold)
+ if (slold)
slold->regionbase= sa->regionbase;
sa->regionbase= sl->regionbase;
sl->regionbase.first= sl->regionbase.last= NULL;
@@ -1430,10 +1432,10 @@ void ED_area_prevspace(bContext *C, ScrArea *sa)
{
SpaceLink *sl = (sa) ? sa->spacedata.first : CTX_wm_space_data(C);
- if(sl->next) {
+ if (sl->next) {
/* workaround for case of double prevspace, render window
- with a file browser on top of it */
- if(sl->next->spacetype == SPACE_FILE && sl->next->next)
+ * 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
ED_area_newspace(C, sa, sl->next->spacetype);
@@ -1505,7 +1507,7 @@ int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco)
uiBut *but;
int xco= 8;
- but= uiDefIconTextButC(block, ICONTEXTROW, 0, ICON_VIEW3D,
+ but = uiDefIconTextButC(block, ICONTEXTROW, 0, ICON_VIEW3D,
editortype_pup(), xco, yco, UI_UNIT_X+10, UI_UNIT_Y,
&(sa->butspacetype), 1.0, SPACEICONMAX, 0, 0,
TIP_("Displays current editor type. Click for menu of available types"));
@@ -1527,14 +1529,14 @@ int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco)
uiBlockSetEmboss(block, UI_EMBOSSN);
if (sa->flag & HEADER_NO_PULLDOWN) {
- but= uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
+ but = uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
ICON_DISCLOSURE_TRI_RIGHT,
xco,yco,UI_UNIT_X,UI_UNIT_Y-2,
&(sa->flag), 0, 0, 0, 0,
"Show pulldown menus");
}
else {
- but= uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
+ but = uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
ICON_DISCLOSURE_TRI_DOWN,
xco,yco,UI_UNIT_X,UI_UNIT_Y-2,
&(sa->flag), 0, 0, 0, 0,
@@ -1561,10 +1563,10 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
View2DScrollers *scrollers;
int x, y, xco, yco, w, em, triangle, open, newcontext= 0;
- if(contextnr >= 0)
+ if (contextnr >= 0)
newcontext= UI_view2d_tab_set(v2d, contextnr);
- if(vertical) {
+ if (vertical) {
w= v2d->cur.xmax - v2d->cur.xmin;
em= (ar->type->prefsizex)? UI_UNIT_Y/2: UI_UNIT_Y;
}
@@ -1579,21 +1581,21 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
/* set view2d view matrix for scrolling (without scrollers) */
UI_view2d_view_ortho(v2d);
- for(pt= ar->type->paneltypes.first; pt; pt= pt->next) {
+ for (pt= ar->type->paneltypes.first; pt; pt= pt->next) {
/* verify context */
- if(context)
- if(pt->context[0] && strcmp(context, pt->context) != 0)
+ if (context)
+ if (pt->context[0] && strcmp(context, pt->context) != 0)
continue;
/* draw panel */
- if(pt->draw && (!pt->poll || pt->poll(C, pt))) {
+ if (pt->draw && (!pt->poll || pt->poll(C, pt))) {
block= uiBeginBlock(C, ar, pt->idname, UI_EMBOSS);
panel= uiBeginPanel(sa, ar, block, pt, &open);
/* bad fixed values */
triangle= (int)(UI_UNIT_Y * 1.1f);
- if(pt->draw_header && !(pt->flag & PNL_NO_HEADER) && (open || vertical)) {
+ if (pt->draw_header && !(pt->flag & PNL_NO_HEADER) && (open || vertical)) {
/* for enabled buttons */
panel->layout= uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER,
triangle, UI_UNIT_Y+style->panelspace+2, UI_UNIT_Y, 1, style);
@@ -1608,7 +1610,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
panel->labelofs= 0;
}
- if(open) {
+ if (open) {
short panelContext;
/* panel context can either be toolbar region or normal panels region */
@@ -1645,7 +1647,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
glClear(GL_COLOR_BUFFER_BIT);
/* before setting the view */
- if(vertical) {
+ if (vertical) {
/* only allow scrolling in vertical direction */
v2d->keepofs |= V2D_LOCKOFS_X|V2D_KEEPOFS_Y;
v2d->keepofs &= ~(V2D_LOCKOFS_Y|V2D_KEEPOFS_X);
@@ -1653,13 +1655,13 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
v2d->scroll &= ~V2D_SCROLL_VERTICAL_HIDE;
// don't jump back when panels close or hide
- if(!newcontext)
+ if (!newcontext)
y= MAX2(-y, -v2d->cur.ymin);
else
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);
@@ -1669,7 +1671,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
v2d->scroll &= ~V2D_SCROLL_HORIZONTAL_HIDE;
// don't jump back when panels close or hide
- if(!newcontext)
+ if (!newcontext)
x= MAX2(x, v2d->cur.xmax);
y= -y;
}
@@ -1703,13 +1705,13 @@ void ED_region_panels_init(wmWindowManager *wm, ARegion *ar)
ar->v2d.scroll &= ~V2D_SCROLL_VERTICAL_HIDE;
ar->v2d.keepzoom |= V2D_KEEPZOOM;
- // correctly initialised User-Prefs?
- if(!(ar->v2d.align & V2D_ALIGN_NO_POS_Y))
+ // correctly initialized User-Prefs?
+ if (!(ar->v2d.align & V2D_ALIGN_NO_POS_Y))
ar->v2d.flag &= ~V2D_IS_INITIALISED;
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_PANELS_UI, ar->winx, ar->winy);
- keymap= WM_keymap_find(wm->defaultconf, "View2D Buttons List", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "View2D Buttons List", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -1734,25 +1736,25 @@ void ED_region_header(const bContext *C, ARegion *ar)
yco= headery-4;
/* draw all headers types */
- for(ht= ar->type->headertypes.first; ht; ht= ht->next) {
+ for (ht= ar->type->headertypes.first; ht; ht= ht->next) {
block= uiBeginBlock(C, ar, ht->idname, UI_EMBOSS);
layout= uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER, xco, yco, UI_UNIT_Y, 1, style);
- if(ht->draw) {
+ if (ht->draw) {
header.type= ht;
header.layout= layout;
ht->draw(C, &header);
/* for view2d */
xco= uiLayoutGetWidth(layout);
- if(xco > maxco)
+ if (xco > maxco)
maxco= xco;
}
uiBlockLayoutResolve(block, &xco, &yco);
/* for view2d */
- if(xco > maxco)
+ if (xco > maxco)
maxco= xco;
uiEndBlock(C, block);
@@ -1788,17 +1790,17 @@ void ED_region_info_draw(ARegion *ar, const char *text, int block, float alpha)
/* background box */
rect= ar->winrct;
- rect.xmin= 0;
- rect.ymin= ar->winrct.ymax - ar->winrct.ymin - header_height;
+ rect.xmin = 0;
+ rect.ymin = ar->winrct.ymax - ar->winrct.ymin - header_height;
- if(block) {
- rect.xmax= ar->winrct.xmax - ar->winrct.xmin;
+ if (block) {
+ rect.xmax = ar->winrct.xmax - ar->winrct.xmin;
}
else {
- rect.xmax= rect.xmin + BLF_width(fontid, text) + 24;
+ rect.xmax = rect.xmin + BLF_width(fontid, text) + 24;
}
- rect.ymax= ar->winrct.ymax - ar->winrct.ymin;
+ rect.ymax = ar->winrct.ymax - ar->winrct.ymin;
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index 235c5da08c3..66abbaecbe7 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;
}
@@ -188,6 +191,31 @@ void fdrawbox(float x1, float y1, float x2, float y2)
glEnd();
}
+void fdrawcheckerboard(float x1, float y1, float x2, float y2)
+{
+ unsigned char col1[4]= {40, 40, 40}, col2[4]= {50, 50, 50};
+
+ GLubyte checker_stipple[32*32/8] = {
+ 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
+ 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
+ 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
+ 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
+ 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
+ 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
+ 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
+ 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
+ };
+
+ glColor3ubv(col1);
+ glRectf(x1, y1, x2, y2);
+ glColor3ubv(col2);
+
+ glEnable(GL_POLYGON_STIPPLE);
+ glPolygonStipple(checker_stipple);
+ glRectf(x1, y1, x2, y2);
+ glDisable(GL_POLYGON_STIPPLE);
+}
+
void sdrawline(short x1, short y1, short x2, short y2)
{
short v[2];
@@ -201,14 +229,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)
{
@@ -260,7 +286,7 @@ void sdrawbox(short x1, short y1, short x2, short y2)
void setlinestyle(int nr)
{
- if(nr==0) {
+ if (nr==0) {
glDisable(GL_LINE_STIPPLE);
}
else {
@@ -283,7 +309,7 @@ void set_inverted_drawing(int enable)
void sdrawXORline(int x0, int y0, int x1, int y1)
{
- if(x0==x1 && y0==y1) return;
+ if (x0==x1 && y0==y1) return;
set_inverted_drawing(1);
@@ -305,7 +331,7 @@ void sdrawXORline4(int nr, int x0, int y0, int x1, int y1)
set_inverted_drawing(1);
glBegin(GL_LINES);
- if(nr== -1) { /* flush */
+ if (nr== -1) { /* flush */
for (nr=0; nr<4; nr++) {
if (flags[nr]) {
glVertex2sv(old[nr][0]);
@@ -313,9 +339,10 @@ void sdrawXORline4(int nr, int x0, int y0, int x1, int y1)
flags[nr]= 0;
}
}
- } else {
- if(nr>=0 && nr<4) {
- if(flags[nr]) {
+ }
+ else {
+ if (nr>=0 && nr<4) {
+ if (flags[nr]) {
glVertex2sv(old[nr][0]);
glVertex2sv(old[nr][1]);
}
@@ -338,7 +365,7 @@ void sdrawXORline4(int nr, int x0, int y0, int x1, int y1)
void fdrawXORellipse(float xofs, float yofs, float hw, float hh)
{
- if(hw==0) return;
+ if (hw==0) return;
set_inverted_drawing(1);
@@ -410,7 +437,7 @@ void glaRasterPosSafe2f(float x, float y, float known_good_x, float known_good_y
GLubyte dummy= 0;
/* As long as known good coordinates are correct
- * this is guarenteed to generate an ok raster
+ * this is guaranteed to generate an ok raster
* position (ignoring potential (real) overflow
* issues).
*/
@@ -501,28 +528,28 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format,
float rast_y= y+subpart_y*offset_y*yzoom;
/* check if we already got these because we always get 2 more when doing seamless*/
- if(subpart_w<=seamless || subpart_h<=seamless)
+ if (subpart_w<=seamless || subpart_h<=seamless)
continue;
- if(format==GL_FLOAT) {
+ if (format==GL_FLOAT) {
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, subpart_w, subpart_h, GL_RGBA, GL_FLOAT, &f_rect[subpart_y*offset_y*img_w*4 + subpart_x*offset_x*4]);
/* add an extra border of pixels so linear looks ok at edges of full image. */
- if(subpart_w<tex_w)
+ if (subpart_w<tex_w)
glTexSubImage2D(GL_TEXTURE_2D, 0, subpart_w, 0, 1, subpart_h, GL_RGBA, GL_FLOAT, &f_rect[subpart_y*offset_y*img_w*4 + (subpart_x*offset_x+subpart_w-1)*4]);
- if(subpart_h<tex_h)
+ if (subpart_h<tex_h)
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, subpart_h, subpart_w, 1, GL_RGBA, GL_FLOAT, &f_rect[(subpart_y*offset_y+subpart_h-1)*img_w*4 + subpart_x*offset_x*4]);
- if(subpart_w<tex_w && subpart_h<tex_h)
+ if (subpart_w<tex_w && subpart_h<tex_h)
glTexSubImage2D(GL_TEXTURE_2D, 0, subpart_w, subpart_h, 1, 1, GL_RGBA, GL_FLOAT, &f_rect[(subpart_y*offset_y+subpart_h-1)*img_w*4 + (subpart_x*offset_x+subpart_w-1)*4]);
}
else {
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, subpart_w, subpart_h, GL_RGBA, GL_UNSIGNED_BYTE, &uc_rect[subpart_y*offset_y*img_w*4 + subpart_x*offset_x*4]);
- if(subpart_w<tex_w)
+ if (subpart_w<tex_w)
glTexSubImage2D(GL_TEXTURE_2D, 0, subpart_w, 0, 1, subpart_h, GL_RGBA, GL_UNSIGNED_BYTE, &uc_rect[subpart_y*offset_y*img_w*4 + (subpart_x*offset_x+subpart_w-1)*4]);
- if(subpart_h<tex_h)
+ if (subpart_h<tex_h)
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, subpart_h, subpart_w, 1, GL_RGBA, GL_UNSIGNED_BYTE, &uc_rect[(subpart_y*offset_y+subpart_h-1)*img_w*4 + subpart_x*offset_x*4]);
- if(subpart_w<tex_w && subpart_h<tex_h)
+ if (subpart_w<tex_w && subpart_h<tex_h)
glTexSubImage2D(GL_TEXTURE_2D, 0, subpart_w, subpart_h, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &uc_rect[(subpart_y*offset_y+subpart_h-1)*img_w*4 + (subpart_x*offset_x+subpart_w-1)*4]);
}
@@ -607,27 +634,28 @@ void glaDrawPixelsSafe(float x, float y, int img_w, int img_h, int row_w, int fo
/* Don't use safe RasterPos (slower) if we can avoid it. */
if (rast_x>=0 && rast_y>=0) {
glRasterPos2f(rast_x, rast_y);
- } else {
+ }
+ else {
glaRasterPosSafe2f(rast_x, rast_y, 0, 0);
}
glPixelStorei(GL_UNPACK_ROW_LENGTH, row_w);
- if(format==GL_LUMINANCE || format==GL_RED) {
- if(type==GL_FLOAT) {
+ if (format==GL_LUMINANCE || format==GL_RED) {
+ if (type==GL_FLOAT) {
float *f_rect= (float *)rect;
glDrawPixels(draw_w, draw_h, format, type, f_rect + (off_y*row_w + off_x));
}
- else if(type==GL_INT || type==GL_UNSIGNED_INT) {
+ else if (type==GL_INT || type==GL_UNSIGNED_INT) {
int *i_rect= (int *)rect;
glDrawPixels(draw_w, draw_h, format, type, i_rect + (off_y*row_w + off_x));
}
}
else { /* RGBA */
- if(type==GL_FLOAT) {
+ if (type==GL_FLOAT) {
float *f_rect= (float *)rect;
glDrawPixels(draw_w, draw_h, format, type, f_rect + (off_y*row_w + off_x)*4);
}
- else if(type==GL_UNSIGNED_BYTE) {
+ else if (type==GL_UNSIGNED_BYTE) {
unsigned char *uc_rect= (unsigned char *) rect;
glDrawPixels(draw_w, draw_h, format, type, uc_rect + (off_y*row_w + off_x)*4);
}
@@ -708,11 +736,12 @@ gla2DDrawInfo *glaBegin2DDraw(rcti *screen_rect, rctf *world_rect)
di->screen_rect= *screen_rect;
if (world_rect) {
di->world_rect= *world_rect;
- } else {
- di->world_rect.xmin= di->screen_rect.xmin;
- di->world_rect.ymin= di->screen_rect.ymin;
- di->world_rect.xmax= di->screen_rect.xmax;
- di->world_rect.ymax= di->screen_rect.ymax;
+ }
+ else {
+ di->world_rect.xmin = di->screen_rect.xmin;
+ di->world_rect.ymin = di->screen_rect.ymin;
+ di->world_rect.xmax = di->screen_rect.xmax;
+ di->world_rect.ymax = di->screen_rect.ymax;
}
sc_w= (di->screen_rect.xmax-di->screen_rect.xmin);
@@ -764,13 +793,13 @@ void bglBegin(int mode)
{
curmode= mode;
- if(mode==GL_POINTS) {
+ if (mode==GL_POINTS) {
float value[4];
glGetFloatv(GL_POINT_SIZE_RANGE, value);
- if(value[1] < 2.0f) {
+ if (value[1] < 2.0f) {
glGetFloatv(GL_POINT_SIZE, value);
pointhack= floor(value[0] + 0.5f);
- if(pointhack>4) pointhack= 4;
+ if (pointhack>4) pointhack= 4;
}
else glBegin(mode);
}
@@ -781,10 +810,10 @@ int bglPointHack(void)
float value[4];
int pointhack_px;
glGetFloatv(GL_POINT_SIZE_RANGE, value);
- if(value[1] < 2.0f) {
+ if (value[1] < 2.0f) {
glGetFloatv(GL_POINT_SIZE, value);
pointhack_px= floorf(value[0]+0.5f);
- if(pointhack_px>4) pointhack_px= 4;
+ if (pointhack_px>4) pointhack_px= 4;
return pointhack_px;
}
return 0;
@@ -794,7 +823,7 @@ void bglVertex3fv(const float vec[3])
{
switch(curmode) {
case GL_POINTS:
- if(pointhack) {
+ if (pointhack) {
glRasterPos3fv(vec);
glBitmap(pointhack, pointhack, (float)pointhack/2.0f, (float)pointhack/2.0f, 0.0, 0.0, Squaredot);
}
@@ -807,7 +836,7 @@ void bglVertex3f(float x, float y, float z)
{
switch(curmode) {
case GL_POINTS:
- if(pointhack) {
+ if (pointhack) {
glRasterPos3f(x, y, z);
glBitmap(pointhack, pointhack, (float)pointhack/2.0f, (float)pointhack/2.0f, 0.0, 0.0, Squaredot);
}
@@ -820,7 +849,7 @@ void bglVertex2fv(const float vec[2])
{
switch(curmode) {
case GL_POINTS:
- if(pointhack) {
+ if (pointhack) {
glRasterPos2fv(vec);
glBitmap(pointhack, pointhack, (float)pointhack/2, pointhack/2, 0.0, 0.0, Squaredot);
}
@@ -832,7 +861,7 @@ void bglVertex2fv(const float vec[2])
void bglEnd(void)
{
- if(pointhack) pointhack= 0;
+ if (pointhack) pointhack= 0;
else glEnd();
}
@@ -847,11 +876,11 @@ 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. */
- if(mats->modelview[0] < badvalue &&
+ * modelview matrix can cause gluUnProject to give bad results. */
+ if (mats->modelview[0] < badvalue &&
mats->modelview[0] > -badvalue)
mats->modelview[0]= 0;
- if(mats->modelview[5] < badvalue &&
+ if (mats->modelview[5] < badvalue &&
mats->modelview[5] > -badvalue)
mats->modelview[5]= 0;
@@ -867,7 +896,7 @@ void bglPolygonOffset(float viewdist, float dist)
{
static float winmat[16], offset=0.0;
- if(dist != 0.0f) {
+ if (dist != 0.0f) {
float offs;
// glEnable(GL_POLYGON_OFFSET_FILL);
@@ -879,7 +908,7 @@ void bglPolygonOffset(float viewdist, float dist)
/* dist is from camera to center point */
- if(winmat[15]>0.5f) offs= 0.00001f*dist*viewdist; // ortho tweaking
+ if (winmat[15]>0.5f) offs= 0.00001f*dist*viewdist; // ortho tweaking
else offs= 0.0005f*dist; // should be clipping value or so...
winmat[14]-= offs;
@@ -902,7 +931,7 @@ void bglFlush(void)
{
glFlush();
#ifdef __APPLE__
-// if(GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_MAC, GPU_DRIVER_OFFICIAL))
+// if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_MAC, GPU_DRIVER_OFFICIAL))
// XXX myswapbuffers(); //hack to get mac intel graphics to show frontbuffer
#endif
}
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c
index 9e2a2f54e0b..9e044068468 100644
--- a/source/blender/editors/screen/screen_context.c
+++ b/source/blender/editors/screen/screen_context.c
@@ -87,20 +87,20 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
base= BASACT;
#endif
- if(CTX_data_dir(member)) {
+ if (CTX_data_dir(member)) {
CTX_data_dir_set(result, screen_context_dir);
return 1;
}
- else if(CTX_data_equals(member, "scene")) {
+ else if (CTX_data_equals(member, "scene")) {
CTX_data_id_pointer_set(result, &scene->id);
return 1;
}
- else if(CTX_data_equals(member, "visible_objects") || CTX_data_equals(member, "visible_bases")) {
+ else if (CTX_data_equals(member, "visible_objects") || CTX_data_equals(member, "visible_bases")) {
int visible_objects= CTX_data_equals(member, "visible_objects");
- for(base=scene->base.first; base; base=base->next) {
- if(((base->object->restrictflag & OB_RESTRICT_VIEW) == 0) && (base->lay & scene->lay)) {
- if(visible_objects)
+ for (base=scene->base.first; base; base=base->next) {
+ if (((base->object->restrictflag & OB_RESTRICT_VIEW) == 0) && (base->lay & scene->lay)) {
+ if (visible_objects)
CTX_data_id_list_add(result, &base->object->id);
else
CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base);
@@ -109,13 +109,13 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
return 1;
}
- else if(CTX_data_equals(member, "selectable_objects") || CTX_data_equals(member, "selectable_bases")) {
+ else if (CTX_data_equals(member, "selectable_objects") || CTX_data_equals(member, "selectable_bases")) {
int selectable_objects= CTX_data_equals(member, "selectable_objects");
- for(base=scene->base.first; base; base=base->next) {
- if(base->lay & lay) {
- if((base->object->restrictflag & OB_RESTRICT_VIEW)==0 && (base->object->restrictflag & OB_RESTRICT_SELECT)==0) {
- if(selectable_objects)
+ for (base=scene->base.first; base; base=base->next) {
+ if (base->lay & lay) {
+ if ((base->object->restrictflag & OB_RESTRICT_VIEW)==0 && (base->object->restrictflag & OB_RESTRICT_SELECT)==0) {
+ if (selectable_objects)
CTX_data_id_list_add(result, &base->object->id);
else
CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base);
@@ -125,12 +125,12 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
return 1;
}
- else if(CTX_data_equals(member, "selected_objects") || CTX_data_equals(member, "selected_bases")) {
+ else if (CTX_data_equals(member, "selected_objects") || CTX_data_equals(member, "selected_bases")) {
int selected_objects= CTX_data_equals(member, "selected_objects");
- for(base=scene->base.first; base; base=base->next) {
- if((base->flag & SELECT) && (base->lay & scene->lay)) {
- if(selected_objects)
+ for (base=scene->base.first; base; base=base->next) {
+ if ((base->flag & SELECT) && (base->lay & scene->lay)) {
+ if (selected_objects)
CTX_data_id_list_add(result, &base->object->id);
else
CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base);
@@ -139,14 +139,14 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
return 1;
}
- else if(CTX_data_equals(member, "selected_editable_objects") || CTX_data_equals(member, "selected_editable_bases")) {
+ else if (CTX_data_equals(member, "selected_editable_objects") || CTX_data_equals(member, "selected_editable_bases")) {
int selected_editable_objects= CTX_data_equals(member, "selected_editable_objects");
- for(base=scene->base.first; base; base=base->next) {
- if((base->flag & SELECT) && (base->lay & scene->lay)) {
- if((base->object->restrictflag & OB_RESTRICT_VIEW)==0) {
- if(0==object_is_libdata(base->object)) {
- if(selected_editable_objects)
+ for (base=scene->base.first; base; base=base->next) {
+ if ((base->flag & SELECT) && (base->lay & scene->lay)) {
+ if ((base->object->restrictflag & OB_RESTRICT_VIEW)==0) {
+ if (0==object_is_libdata(base->object)) {
+ if (selected_editable_objects)
CTX_data_id_list_add(result, &base->object->id);
else
CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base);
@@ -157,7 +157,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
return 1;
}
- else if(CTX_data_equals(member, "visible_bones") || CTX_data_equals(member, "editable_bones")) {
+ else if (CTX_data_equals(member, "visible_bones") || CTX_data_equals(member, "editable_bones")) {
bArmature *arm= (obedit && obedit->type == OB_ARMATURE) ? obedit->data : NULL;
EditBone *ebone, *flipbone=NULL;
int editable_bones= CTX_data_equals(member, "editable_bones");
@@ -199,7 +199,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
return 1;
}
}
- else if(CTX_data_equals(member, "selected_bones") || CTX_data_equals(member, "selected_editable_bones")) {
+ else if (CTX_data_equals(member, "selected_bones") || CTX_data_equals(member, "selected_editable_bones")) {
bArmature *arm= (obedit && obedit->type == OB_ARMATURE) ? obedit->data : NULL;
EditBone *ebone, *flipbone=NULL;
int selected_editable_bones= CTX_data_equals(member, "selected_editable_bones");
@@ -241,7 +241,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
return 1;
}
}
- else if(CTX_data_equals(member, "visible_pose_bones")) {
+ else if (CTX_data_equals(member, "visible_pose_bones")) {
Object *obpose= object_pose_armature_get(obact);
bArmature *arm= (obpose) ? obpose->data : NULL;
bPoseChannel *pchan;
@@ -257,7 +257,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
return 1;
}
}
- else if(CTX_data_equals(member, "selected_pose_bones")) {
+ else if (CTX_data_equals(member, "selected_pose_bones")) {
Object *obpose= object_pose_armature_get(obact);
bArmature *arm= (obpose) ? obpose->data : NULL;
bPoseChannel *pchan;
@@ -274,24 +274,24 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
return 1;
}
}
- else if(CTX_data_equals(member, "active_bone")) {
- if(obact && obact->type == OB_ARMATURE) {
+ else if (CTX_data_equals(member, "active_bone")) {
+ if (obact && obact->type == OB_ARMATURE) {
bArmature *arm= obact->data;
- if(arm->edbo) {
- if(arm->act_edbone) {
+ if (arm->edbo) {
+ if (arm->act_edbone) {
CTX_data_pointer_set(result, &arm->id, &RNA_EditBone, arm->act_edbone);
return 1;
}
}
else {
- if(arm->act_bone) {
+ if (arm->act_bone) {
CTX_data_pointer_set(result, &arm->id, &RNA_Bone, arm->act_bone);
return 1;
}
}
}
}
- else if(CTX_data_equals(member, "active_pose_bone")) {
+ else if (CTX_data_equals(member, "active_pose_bone")) {
bPoseChannel *pchan;
Object *obpose= object_pose_armature_get(obact);
@@ -301,64 +301,64 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
return 1;
}
}
- else if(CTX_data_equals(member, "active_base")) {
- if(base)
+ else if (CTX_data_equals(member, "active_base")) {
+ if (base)
CTX_data_pointer_set(result, &scene->id, &RNA_ObjectBase, base);
return 1;
}
- else if(CTX_data_equals(member, "active_object")) {
- if(obact)
+ else if (CTX_data_equals(member, "active_object")) {
+ if (obact)
CTX_data_id_pointer_set(result, &obact->id);
return 1;
}
- else if(CTX_data_equals(member, "object")) {
- if(obact)
+ else if (CTX_data_equals(member, "object")) {
+ if (obact)
CTX_data_id_pointer_set(result, &obact->id);
return 1;
}
- else if(CTX_data_equals(member, "edit_object")) {
+ else if (CTX_data_equals(member, "edit_object")) {
/* convenience for now, 1 object per scene in editmode */
- if(obedit)
+ if (obedit)
CTX_data_id_pointer_set(result, &obedit->id);
return 1;
}
- else if(CTX_data_equals(member, "sculpt_object")) {
- if(obact && (obact->mode & OB_MODE_SCULPT))
+ else if (CTX_data_equals(member, "sculpt_object")) {
+ if (obact && (obact->mode & OB_MODE_SCULPT))
CTX_data_id_pointer_set(result, &obact->id);
return 1;
}
- else if(CTX_data_equals(member, "vertex_paint_object")) {
- if(obact && (obact->mode & OB_MODE_VERTEX_PAINT))
+ else if (CTX_data_equals(member, "vertex_paint_object")) {
+ if (obact && (obact->mode & OB_MODE_VERTEX_PAINT))
CTX_data_id_pointer_set(result, &obact->id);
return 1;
}
- else if(CTX_data_equals(member, "weight_paint_object")) {
- if(obact && (obact->mode & OB_MODE_WEIGHT_PAINT))
+ else if (CTX_data_equals(member, "weight_paint_object")) {
+ if (obact && (obact->mode & OB_MODE_WEIGHT_PAINT))
CTX_data_id_pointer_set(result, &obact->id);
return 1;
}
- else if(CTX_data_equals(member, "image_paint_object")) {
- if(obact && (obact->mode & OB_MODE_TEXTURE_PAINT))
+ else if (CTX_data_equals(member, "image_paint_object")) {
+ if (obact && (obact->mode & OB_MODE_TEXTURE_PAINT))
CTX_data_id_pointer_set(result, &obact->id);
return 1;
}
- else if(CTX_data_equals(member, "particle_edit_object")) {
- if(obact && (obact->mode & OB_MODE_PARTICLE_EDIT))
+ else if (CTX_data_equals(member, "particle_edit_object")) {
+ if (obact && (obact->mode & OB_MODE_PARTICLE_EDIT))
CTX_data_id_pointer_set(result, &obact->id);
return 1;
}
- else if(CTX_data_equals(member, "sequences")) {
+ else if (CTX_data_equals(member, "sequences")) {
Editing *ed= seq_give_editing(scene, FALSE);
- if(ed) {
+ if (ed) {
Sequence *seq;
for (seq= ed->seqbasep->first; seq; seq= seq->next) {
CTX_data_list_add(result, &scene->id, &RNA_Sequence, seq);
@@ -367,9 +367,9 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
return 1;
}
}
- else if(CTX_data_equals(member, "selected_sequences")) {
+ else if (CTX_data_equals(member, "selected_sequences")) {
Editing *ed= seq_give_editing(scene, FALSE);
- if(ed) {
+ if (ed) {
Sequence *seq;
for (seq= ed->seqbasep->first; seq; seq= seq->next) {
if (seq->flag & SELECT) {
@@ -380,9 +380,9 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
return 1;
}
}
- else if(CTX_data_equals(member, "selected_editable_sequences")) {
+ else if (CTX_data_equals(member, "selected_editable_sequences")) {
Editing *ed= seq_give_editing(scene, FALSE);
- if(ed) {
+ if (ed) {
Sequence *seq;
for (seq= ed->seqbasep->first; seq; seq= seq->next) {
if (seq->flag & SELECT && !(seq->flag & SEQ_LOCK)) {
@@ -393,11 +393,11 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
return 1;
}
}
- else if(CTX_data_equals(member, "active_operator")) {
+ else if (CTX_data_equals(member, "active_operator")) {
wmOperator *op= NULL;
SpaceFile *sfile= CTX_wm_space_file(C);
- if(sfile) {
+ if (sfile) {
op= sfile->op;
}
else if ((op= uiContextActiveOperator(C))) {
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 25b8b8415d9..1b56feb09d1 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -111,7 +111,7 @@ ScrEdge *screen_findedge(bScreen *sc, ScrVert *v1, ScrVert *v2)
sortscrvert(&v1, &v2);
for (se= sc->edgebase.first; se; se= se->next)
- if(se->v1==v1 && se->v2==v2)
+ if (se->v1==v1 && se->v2==v2)
return se;
return NULL;
@@ -124,12 +124,12 @@ void removedouble_scrverts(bScreen *sc)
ScrArea *sa;
verg= sc->vertbase.first;
- while(verg) {
- if(verg->newv==NULL) { /* !!! */
+ while (verg) {
+ if (verg->newv==NULL) { /* !!! */
v1= verg->next;
- while(v1) {
- if(v1->newv==NULL) { /* !?! */
- if(v1->vec.x==verg->vec.x && v1->vec.y==verg->vec.y) {
+ while (v1) {
+ if (v1->newv==NULL) { /* !?! */
+ if (v1->vec.x==verg->vec.x && v1->vec.y==verg->vec.y) {
/* printf("doublevert\n"); */
v1->newv= verg;
}
@@ -142,27 +142,27 @@ void removedouble_scrverts(bScreen *sc)
/* replace pointers in edges and faces */
se= sc->edgebase.first;
- while(se) {
- if(se->v1->newv) se->v1= se->v1->newv;
- if(se->v2->newv) se->v2= se->v2->newv;
+ while (se) {
+ if (se->v1->newv) se->v1= se->v1->newv;
+ if (se->v2->newv) se->v2= se->v2->newv;
/* edges changed: so.... */
sortscrvert(&(se->v1), &(se->v2));
se= se->next;
}
sa= sc->areabase.first;
- while(sa) {
- if(sa->v1->newv) sa->v1= sa->v1->newv;
- if(sa->v2->newv) sa->v2= sa->v2->newv;
- if(sa->v3->newv) sa->v3= sa->v3->newv;
- if(sa->v4->newv) sa->v4= sa->v4->newv;
+ while (sa) {
+ if (sa->v1->newv) sa->v1= sa->v1->newv;
+ if (sa->v2->newv) sa->v2= sa->v2->newv;
+ if (sa->v3->newv) sa->v3= sa->v3->newv;
+ if (sa->v4->newv) sa->v4= sa->v4->newv;
sa= sa->next;
}
/* remove */
verg= sc->vertbase.first;
- while(verg) {
+ while (verg) {
v1= verg->next;
- if(verg->newv) {
+ if (verg->newv) {
BLI_remlink(&sc->vertbase, verg);
MEM_freeN(verg);
}
@@ -179,16 +179,16 @@ void removenotused_scrverts(bScreen *sc)
/* we assume edges are ok */
se= sc->edgebase.first;
- while(se) {
+ while (se) {
se->v1->flag= 1;
se->v2->flag= 1;
se= se->next;
}
sv= sc->vertbase.first;
- while(sv) {
+ while (sv) {
svn= sv->next;
- if(sv->flag==0) {
+ if (sv->flag==0) {
BLI_remlink(&sc->vertbase, sv);
MEM_freeN(sv);
}
@@ -203,11 +203,11 @@ void removedouble_scredges(bScreen *sc)
/* compare */
verg= sc->edgebase.first;
- while(verg) {
+ while (verg) {
se= verg->next;
- while(se) {
+ while (se) {
sn= se->next;
- if(verg->v1==se->v1 && verg->v2==se->v2) {
+ if (verg->v1==se->v1 && verg->v2==se->v2) {
BLI_remlink(&sc->edgebase, se);
MEM_freeN(se);
}
@@ -225,26 +225,26 @@ void removenotused_scredges(bScreen *sc)
/* sets flags when edge is used in area */
sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
se= screen_findedge(sc, sa->v1, sa->v2);
- if(se==NULL) printf("error: area %d edge 1 doesn't exist\n", a);
+ if (se==NULL) printf("error: area %d edge 1 doesn't exist\n", a);
else se->flag= 1;
se= screen_findedge(sc, sa->v2, sa->v3);
- if(se==NULL) printf("error: area %d edge 2 doesn't exist\n", a);
+ if (se==NULL) printf("error: area %d edge 2 doesn't exist\n", a);
else se->flag= 1;
se= screen_findedge(sc, sa->v3, sa->v4);
- if(se==NULL) printf("error: area %d edge 3 doesn't exist\n", a);
+ if (se==NULL) printf("error: area %d edge 3 doesn't exist\n", a);
else se->flag= 1;
se= screen_findedge(sc, sa->v4, sa->v1);
- if(se==NULL) printf("error: area %d edge 4 doesn't exist\n", a);
+ if (se==NULL) printf("error: area %d edge 4 doesn't exist\n", a);
else se->flag= 1;
sa= sa->next;
a++;
}
se= sc->edgebase.first;
- while(se) {
+ while (se) {
sen= se->next;
- if(se->flag==0) {
+ if (se->flag==0) {
BLI_remlink(&sc->edgebase, se);
MEM_freeN(se);
}
@@ -320,18 +320,18 @@ static short testsplitpoint(ScrArea *sa, char dir, float fac)
short x, y;
// area big enough?
- if(dir=='v' && (sa->v4->vec.x- sa->v1->vec.x <= 2*AREAMINX)) return 0;
- if(dir=='h' && (sa->v2->vec.y- sa->v1->vec.y <= 2*AREAMINY)) return 0;
+ if (dir=='v' && (sa->v4->vec.x- sa->v1->vec.x <= 2*AREAMINX)) return 0;
+ if (dir=='h' && (sa->v2->vec.y- sa->v1->vec.y <= 2*AREAMINY)) return 0;
// to be sure
CLAMP(fac, 0.0f, 1.0f);
- if(dir=='h') {
+ if (dir=='h') {
y= sa->v1->vec.y+ fac*(sa->v2->vec.y- sa->v1->vec.y);
- if(y- sa->v1->vec.y < AREAMINY)
+ if (y- sa->v1->vec.y < AREAMINY)
y= sa->v1->vec.y+ AREAMINY;
- else if(sa->v2->vec.y- y < AREAMINY)
+ else if (sa->v2->vec.y- y < AREAMINY)
y= sa->v2->vec.y- AREAMINY;
else y-= (y % AREAGRID);
@@ -340,9 +340,9 @@ static short testsplitpoint(ScrArea *sa, char dir, float fac)
else {
x= sa->v1->vec.x+ fac*(sa->v4->vec.x- sa->v1->vec.x);
- if(x- sa->v1->vec.x < AREAMINX)
+ if (x- sa->v1->vec.x < AREAMINX)
x= sa->v1->vec.x+ AREAMINX;
- else if(sa->v4->vec.x- x < AREAMINX)
+ else if (sa->v4->vec.x- x < AREAMINX)
x= sa->v4->vec.x- AREAMINX;
else x-= (x % AREAGRID);
@@ -356,12 +356,12 @@ ScrArea *area_split(bScreen *sc, ScrArea *sa, char dir, float fac, int merge)
ScrVert *sv1, *sv2;
short split;
- if(sa==NULL) return NULL;
+ if (sa==NULL) return NULL;
split= testsplitpoint(sa, dir, fac);
- if(split==0) return NULL;
+ if (split==0) return NULL;
- if(dir=='h') {
+ if (dir=='h') {
/* new vertices */
sv1= screen_addvert(sc, sa->v1->vec.x, split);
sv2= screen_addvert(sc, sa->v4->vec.x, split);
@@ -404,7 +404,7 @@ ScrArea *area_split(bScreen *sc, ScrArea *sa, char dir, float fac, int merge)
}
/* remove double vertices en edges */
- if(merge)
+ if (merge)
removedouble_scrverts(sc);
removedouble_scredges(sc);
removenotused_scredges(sc);
@@ -456,18 +456,18 @@ static void screen_copy(bScreen *to, bScreen *from)
to->regionbase.first= to->regionbase.last= NULL;
s2= to->vertbase.first;
- for(s1= from->vertbase.first; s1; s1= s1->next, s2= s2->next) {
+ for (s1= from->vertbase.first; s1; s1= s1->next, s2= s2->next) {
s1->newv= s2;
}
- for(se= to->edgebase.first; se; se= se->next) {
+ for (se= to->edgebase.first; se; se= se->next) {
se->v1= se->v1->newv;
se->v2= se->v2->newv;
sortscrvert(&(se->v1), &(se->v2));
}
saf= from->areabase.first;
- for(sa= to->areabase.first; sa; sa= sa->next, saf= saf->next) {
+ for (sa= to->areabase.first; sa; sa= sa->next, saf= saf->next) {
sa->v1= sa->v1->newv;
sa->v2= sa->v2->newv;
sa->v3= sa->v3->newv;
@@ -482,7 +482,7 @@ static void screen_copy(bScreen *to, bScreen *from)
}
/* put at zero (needed?) */
- for(s1= from->vertbase.first; s1; s1= s1->next)
+ for (s1= from->vertbase.first; s1; s1= s1->next)
s1->newv= NULL;
}
@@ -496,7 +496,7 @@ int area_getorientation(ScrArea *sa, ScrArea *sb)
ScrVert *sav1, *sav2, *sav3, *sav4;
ScrVert *sbv1, *sbv2, *sbv3, *sbv4;
- if(sa==NULL || sb==NULL) return -1;
+ if (sa==NULL || sb==NULL) return -1;
sav1= sa->v1;
sav2= sa->v2;
@@ -507,16 +507,16 @@ int area_getorientation(ScrArea *sa, ScrArea *sb)
sbv3= sb->v3;
sbv4= sb->v4;
- if(sav1==sbv4 && sav2==sbv3) { /* sa to right of sb = W */
+ if (sav1==sbv4 && sav2==sbv3) { /* sa to right of sb = W */
return 0;
}
- else if(sav2==sbv1 && sav3==sbv4) { /* sa to bottom of sb = N */
+ else if (sav2==sbv1 && sav3==sbv4) { /* sa to bottom of sb = N */
return 1;
}
- else if(sav3==sbv2 && sav4==sbv1) { /* sa to left of sb = E */
+ else if (sav3==sbv2 && sav4==sbv1) { /* sa to left of sb = E */
return 2;
}
- else if(sav1==sbv2 && sav4==sbv3) { /* sa on top of sb = S*/
+ else if (sav1==sbv2 && sav4==sbv3) { /* sa on top of sb = S*/
return 3;
}
@@ -524,14 +524,14 @@ 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;
dir = area_getorientation(sa1, sa2);
- /*printf("dir is : %i \n", dir);*/
+ /*printf("dir is : %i\n", dir);*/
if (dir < 0) {
if (sa1 ) sa1->flag &= ~AREA_FLAG_DRAWJOINFROM;
@@ -539,25 +539,25 @@ int screen_area_join(bContext *C, bScreen* scr, ScrArea *sa1, ScrArea *sa2)
return 0;
}
- if(dir == 0) {
+ if (dir == 0) {
sa1->v1= sa2->v1;
sa1->v2= sa2->v2;
screen_addedge(scr, sa1->v2, sa1->v3);
screen_addedge(scr, sa1->v1, sa1->v4);
}
- else if(dir == 1) {
+ else if (dir == 1) {
sa1->v2= sa2->v2;
sa1->v3= sa2->v3;
screen_addedge(scr, sa1->v1, sa1->v2);
screen_addedge(scr, sa1->v3, sa1->v4);
}
- else if(dir == 2) {
+ else if (dir == 2) {
sa1->v3= sa2->v3;
sa1->v4= sa2->v4;
screen_addedge(scr, sa1->v2, sa1->v3);
screen_addedge(scr, sa1->v1, sa1->v4);
}
- else if(dir == 3) {
+ else if (dir == 3) {
sa1->v1= sa2->v1;
sa1->v4= sa2->v4;
screen_addedge(scr, sa1->v1, sa1->v2);
@@ -581,11 +581,11 @@ void select_connected_scredge(bScreen *sc, ScrEdge *edge)
/* select connected, only in the right direction */
/* 'dir' is the direction of EDGE */
- if(edge->v1->vec.x==edge->v2->vec.x) dir= 'v';
+ if (edge->v1->vec.x==edge->v2->vec.x) dir= 'v';
else dir= 'h';
sv= sc->vertbase.first;
- while(sv) {
+ while (sv) {
sv->flag = 0;
sv= sv->next;
}
@@ -594,16 +594,16 @@ void select_connected_scredge(bScreen *sc, ScrEdge *edge)
edge->v2->flag= 1;
oneselected= 1;
- while(oneselected) {
+ while (oneselected) {
se= sc->edgebase.first;
oneselected= 0;
- while(se) {
- if(se->v1->flag + se->v2->flag==1) {
- if(dir=='h') if(se->v1->vec.y==se->v2->vec.y) {
+ while (se) {
+ if (se->v1->flag + se->v2->flag==1) {
+ if (dir=='h') if (se->v1->vec.y==se->v2->vec.y) {
se->v1->flag= se->v2->flag= 1;
oneselected= 1;
}
- if(dir=='v') if(se->v1->vec.x==se->v2->vec.x) {
+ if (dir=='v') if (se->v1->vec.x==se->v2->vec.x) {
se->v1->flag= se->v2->flag= 1;
oneselected= 1;
}
@@ -625,7 +625,7 @@ static void screen_test_scale(bScreen *sc, int winsizex, int winsizey)
min[0]= min[1]= 10000.0f;
max[0]= max[1]= 0.0f;
- for(sv= sc->vertbase.first; sv; sv= sv->next) {
+ for (sv= sc->vertbase.first; sv; sv= sv->next) {
min[0]= MIN2(min[0], sv->vec.x);
min[1]= MIN2(min[1], sv->vec.y);
max[0]= MAX2(max[0], sv->vec.x);
@@ -633,7 +633,7 @@ static void screen_test_scale(bScreen *sc, int winsizex, int winsizey)
}
/* always make 0.0 left under */
- for(sv= sc->vertbase.first; sv; sv= sv->next) {
+ for (sv= sc->vertbase.first; sv; sv= sv->next) {
sv->vec.x -= min[0];
sv->vec.y -= min[1];
}
@@ -641,15 +641,15 @@ static void screen_test_scale(bScreen *sc, int winsizex, int winsizey)
sizex= max[0]-min[0];
sizey= max[1]-min[1];
- if(sizex!= winsizex || sizey!= winsizey) {
+ if (sizex!= winsizex || sizey!= winsizey) {
facx= winsizex;
facx/= (float)sizex;
facy= winsizey;
facy/= (float)sizey;
/* 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]
+ for (sv= sc->vertbase.first; sv; sv= sv->next) {
+ /* 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);
@@ -671,13 +671,13 @@ static void screen_test_scale(bScreen *sc, int winsizex, int winsizey)
/* ton: removed option now, it needs Context... */
/* make each window at least ED_area_headersize() high */
- for(sa= sc->areabase.first; sa; sa= sa->next) {
+ for (sa= sc->areabase.first; sa; sa= sa->next) {
int headery= ED_area_headersize()+1;
- if(sa->v1->vec.y+headery > sa->v2->vec.y) {
+ if (sa->v1->vec.y+headery > sa->v2->vec.y) {
/* lower edge */
ScrEdge *se= screen_findedge(sc, sa->v4, sa->v1);
- if(se && sa->v1!=sa->v2 ) {
+ if (se && sa->v1!=sa->v2 ) {
int yval;
select_connected_scredge(sc, se);
@@ -685,10 +685,10 @@ static void screen_test_scale(bScreen *sc, int winsizex, int winsizey)
/* all selected vertices get the right offset */
yval= sa->v2->vec.y-headery;
sv= sc->vertbase.first;
- while(sv) {
+ while (sv) {
/* if is a collapsed area */
- if(sv!=sa->v2 && sv!=sa->v3) {
- if(sv->flag) sv->vec.y= yval;
+ if (sv!=sa->v2 && sv!=sa->v3) {
+ if (sv->flag) sv->vec.y= yval;
}
sv= sv->next;
}
@@ -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)
{
@@ -714,7 +714,7 @@ static void draw_horizontal_join_shape(ScrArea *sa, char dir)
float width = sa->v3->vec.x - sa->v1->vec.x;
float height = sa->v3->vec.y - sa->v1->vec.y;
- if(height<width) {
+ if (height<width) {
h = height/8;
w = height/4;
}
@@ -753,10 +753,10 @@ static void draw_horizontal_join_shape(ScrArea *sa, char dir)
points[9].x = sa->v4->vec.x;
points[9].y = sa->v4->vec.y + height/2 + h;
- if(dir=='l') {
+ if (dir=='l') {
/* when direction is left, then we flip direction of arrow */
float cx = sa->v1->vec.x + width;
- for(i=0;i<10;i++) {
+ for (i=0;i<10;i++) {
points[i].x -= cx;
points[i].x = -points[i].x;
points[i].x += sa->v1->vec.x;
@@ -764,11 +764,11 @@ static void draw_horizontal_join_shape(ScrArea *sa, char dir)
}
glBegin(GL_POLYGON);
- for(i=0;i<5;i++)
+ for (i=0;i<5;i++)
glVertex2f(points[i].x, points[i].y);
glEnd();
glBegin(GL_POLYGON);
- for(i=4;i<8;i++)
+ for (i=4;i<8;i++)
glVertex2f(points[i].x, points[i].y);
glVertex2f(points[0].x, points[0].y);
glEnd();
@@ -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];
@@ -786,7 +786,7 @@ static void draw_vertical_join_shape(ScrArea *sa, char dir)
float width = sa->v3->vec.x - sa->v1->vec.x;
float height = sa->v3->vec.y - sa->v1->vec.y;
- if(height<width) {
+ if (height<width) {
h = height/4;
w = height/8;
}
@@ -825,10 +825,10 @@ static void draw_vertical_join_shape(ScrArea *sa, char dir)
points[9].x = sa->v1->vec.x + width/2 + w;
points[9].y = sa->v1->vec.y;
- if(dir=='u') {
+ if (dir=='u') {
/* when direction is up, then we flip direction of arrow */
float cy = sa->v1->vec.y + height;
- for(i=0;i<10;i++) {
+ for (i=0;i<10;i++) {
points[i].y -= cy;
points[i].y = -points[i].y;
points[i].y += sa->v1->vec.y;
@@ -836,11 +836,11 @@ static void draw_vertical_join_shape(ScrArea *sa, char dir)
}
glBegin(GL_POLYGON);
- for(i=0;i<5;i++)
+ for (i=0;i<5;i++)
glVertex2f(points[i].x, points[i].y);
glEnd();
glBegin(GL_POLYGON);
- for(i=4;i<8;i++)
+ for (i=4;i<8;i++)
glVertex2f(points[i].x, points[i].y);
glVertex2f(points[0].x, points[0].y);
glEnd();
@@ -852,7 +852,7 @@ static void draw_vertical_join_shape(ScrArea *sa, char dir)
/* draw join shape due to direction of joining */
static void draw_join_shape(ScrArea *sa, char dir)
{
- if(dir=='u' || dir=='d')
+ if (dir=='u' || dir=='d')
draw_vertical_join_shape(sa, dir);
else
draw_horizontal_join_shape(sa, dir);
@@ -883,19 +883,19 @@ static void scrarea_draw_shape_light(ScrArea *sa, char UNUSED(dir))
static void drawscredge_area_draw(int sizex, int sizey, short x1, short y1, short x2, short y2, short a)
{
/* right border area */
- if(x2<sizex-1)
+ if (x2<sizex-1)
sdrawline(x2+a, y1, x2+a, y2);
/* left border area */
- if(x1>0) /* otherwise it draws the emboss of window over */
+ if (x1>0) /* otherwise it draws the emboss of window over */
sdrawline(x1+a, y1, x1+a, y2);
/* top border area */
- if(y2<sizey-1)
+ if (y2<sizey-1)
sdrawline(x1, y2+a, x2, y2+a);
/* bottom border area */
- if(y1>0)
+ if (y1>0)
sdrawline(x1, y1+a, x2, y1+a);
}
@@ -911,10 +911,10 @@ static void drawscredge_area(ScrArea *sa, int sizex, int sizey, int center)
rt= 0; // CLAMPIS(G.rt, 0, 16);
- if(center==0) {
+ if (center==0) {
cpack(0x505050);
- for(a=-rt; a<=rt; a++)
- if(a!=0)
+ for (a=-rt; a<=rt; a++)
+ if (a!=0)
drawscredge_area_draw(sizex, sizey, x1, y1, x2, y2, a);
}
else {
@@ -929,7 +929,7 @@ bScreen *ED_screen_duplicate(wmWindow *win, bScreen *sc)
{
bScreen *newsc;
- if(sc->full != SCREENNORMAL) return NULL; /* XXX handle this case! */
+ if (sc->full != SCREENNORMAL) return NULL; /* XXX handle this case! */
/* make new empty screen: */
newsc= ED_screen_add(win, sc->scene, sc->id.name+2);
@@ -944,11 +944,11 @@ static void region_cursor_set(wmWindow *win, int swinid)
{
ScrArea *sa= win->screen->areabase.first;
- for(;sa; sa= sa->next) {
+ for (;sa; sa= sa->next) {
ARegion *ar= sa->regionbase.first;
- for(;ar; ar= ar->next) {
- if(ar->swinid == swinid) {
- if(ar->type && ar->type->cursor)
+ for (;ar; ar= ar->next) {
+ if (ar->swinid == swinid) {
+ if (ar->type && ar->type->cursor)
ar->type->cursor(win, sa, ar);
else
WM_cursor_set(win, CURSOR_STD);
@@ -965,20 +965,20 @@ void ED_screen_do_listen(bContext *C, wmNotifier *note)
/* generic notes */
switch(note->category) {
case NC_WM:
- if(note->data==ND_FILEREAD)
+ if (note->data==ND_FILEREAD)
win->screen->do_draw= 1;
break;
case NC_WINDOW:
win->screen->do_draw= 1;
break;
case NC_SCREEN:
- if(note->data==ND_SUBWINACTIVE)
+ if (note->data==ND_SUBWINACTIVE)
uiFreeActiveButtons(C, win->screen);
- if(note->action==NA_EDITED)
+ if (note->action==NA_EDITED)
win->screen->do_draw= win->screen->do_refresh= 1;
break;
case NC_SCENE:
- if(note->data==ND_MODE)
+ if (note->data==ND_MODE)
region_cursor_set(win, note->swinid);
break;
}
@@ -996,13 +996,13 @@ void ED_screen_draw(wmWindow *win)
wmSubWindowSet(win, win->screen->mainwin);
- for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+ for (sa= win->screen->areabase.first; sa; sa= sa->next) {
if (sa->flag & AREA_FLAG_DRAWJOINFROM) sa1 = sa;
if (sa->flag & AREA_FLAG_DRAWJOINTO) sa2 = sa;
if (sa->flag & (AREA_FLAG_DRAWSPLIT_H|AREA_FLAG_DRAWSPLIT_V)) sa3 = sa;
drawscredge_area(sa, win->sizex, win->sizey, 0);
}
- for(sa= win->screen->areabase.first; sa; sa= sa->next)
+ for (sa= win->screen->areabase.first; sa; sa= sa->next)
drawscredge_area(sa, win->sizex, win->sizey, 1);
/* blended join arrow */
@@ -1033,11 +1033,11 @@ void ED_screen_draw(wmWindow *win)
}
/* splitpoint */
- if(sa3) {
+ if (sa3) {
glEnable(GL_BLEND);
glColor4ub(255, 255, 255, 100);
- if(sa3->flag & AREA_FLAG_DRAWSPLIT_H) {
+ if (sa3->flag & AREA_FLAG_DRAWSPLIT_H) {
sdrawline(sa3->totrct.xmin, win->eventstate->y, sa3->totrct.xmax, win->eventstate->y);
glColor4ub(0, 0, 0, 100);
sdrawline(sa3->totrct.xmin, win->eventstate->y+1, sa3->totrct.xmax, win->eventstate->y+1);
@@ -1060,9 +1060,9 @@ static void screen_refresh_headersizes(void)
const ListBase *lb= BKE_spacetypes_list();
SpaceType *st;
- for(st= lb->first; st; st= st->next) {
+ for (st= lb->first; st; st= st->next) {
ARegionType *art= BKE_regiontype_from_id(st, RGN_TYPE_HEADER);
- if(art) art->prefsizey= ED_area_headersize();
+ if (art) art->prefsizey= ED_area_headersize();
}
}
@@ -1075,14 +1075,14 @@ void ED_screen_refresh(wmWindowManager *wm, wmWindow *win)
ScrArea *sa;
rcti winrct;
- winrct.xmin= 0;
- winrct.xmax= win->sizex-1;
- winrct.ymin= 0;
- winrct.ymax= win->sizey-1;
+ winrct.xmin = 0;
+ winrct.xmax = win->sizex-1;
+ winrct.ymin = 0;
+ winrct.ymax = win->sizey-1;
screen_test_scale(win->screen, win->sizex, win->sizey);
- if(win->screen->mainwin==0)
+ if (win->screen->mainwin==0)
win->screen->mainwin= wm_subwindow_open(win, &winrct);
else
wm_subwindow_position(win, win->screen->mainwin, &winrct);
@@ -1090,18 +1090,20 @@ void ED_screen_refresh(wmWindowManager *wm, wmWindow *win)
/* header size depends on DPI, let's verify */
screen_refresh_headersizes();
- for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+ for (sa= win->screen->areabase.first; sa; sa= sa->next) {
/* set spacetype and region callbacks, calls init() */
/* sets subwindows for regions, adds handlers */
ED_area_initialize(wm, win, sa);
}
/* wake up animtimer */
- if(win->screen->animtimer)
+ if (win->screen->animtimer)
WM_event_timer_sleep(wm, win, win->screen->animtimer, 0);
}
- if(G.f & G_DEBUG) printf("set screen\n");
+ if (G.debug & G_DEBUG_EVENTS) {
+ printf("%s: set screen\n", __func__);
+ }
win->screen->do_refresh= 0;
win->screen->context= ed_screen_context;
@@ -1112,9 +1114,9 @@ void ED_screens_initialize(wmWindowManager *wm)
{
wmWindow *win;
- for(win= wm->windows.first; win; win= win->next) {
+ for (win= wm->windows.first; win; win= win->next) {
- if(win->screen==NULL)
+ if (win->screen==NULL)
win->screen= G.main->screen.first;
ED_screen_refresh(wm, win);
@@ -1130,11 +1132,11 @@ void ED_region_exit(bContext *C, ARegion *ar)
CTX_wm_region_set(C, ar);
WM_event_remove_handlers(C, &ar->handlers);
- if(ar->swinid)
+ if (ar->swinid)
wm_subwindow_close(CTX_wm_window(C), ar->swinid);
ar->swinid= 0;
- if(ar->headerstr)
+ if (ar->headerstr)
MEM_freeN(ar->headerstr);
ar->headerstr= NULL;
@@ -1148,13 +1150,13 @@ void ED_area_exit(bContext *C, ScrArea *sa)
if (sa->spacetype == SPACE_FILE) {
SpaceLink *sl= sa->spacedata.first;
- if(sl && sl->spacetype == SPACE_FILE) {
+ if (sl && sl->spacetype == SPACE_FILE) {
ED_fileselect_exit(C, (SpaceFile *)sl);
}
}
CTX_wm_area_set(C, sa);
- for(ar= sa->regionbase.first; ar; ar= ar->next)
+ for (ar= sa->regionbase.first; ar; ar= ar->next)
ED_region_exit(C, ar);
WM_event_remove_handlers(C, &sa->handlers);
@@ -1170,19 +1172,19 @@ void ED_screen_exit(bContext *C, wmWindow *window, bScreen *screen)
CTX_wm_window_set(C, window);
- if(screen->animtimer)
+ if (screen->animtimer)
WM_event_remove_timer(wm, window, screen->animtimer);
screen->animtimer= NULL;
- if(screen->mainwin)
+ if (screen->mainwin)
wm_subwindow_close(window, screen->mainwin);
screen->mainwin= 0;
screen->subwinactive= 0;
- for(ar= screen->regionbase.first; ar; ar= ar->next)
+ for (ar= screen->regionbase.first; ar; ar= ar->next)
ED_region_exit(C, ar);
- for(sa= screen->areabase.first; sa; sa= sa->next)
+ for (sa= screen->areabase.first; sa; sa= sa->next)
ED_area_exit(C, sa);
/* mark it available for use for other windows */
@@ -1191,7 +1193,8 @@ void ED_screen_exit(bContext *C, wmWindow *window, bScreen *screen)
if (prevwin->screen->temp == 0) {
/* use previous window if possible */
CTX_wm_window_set(C, prevwin);
- } else {
+ }
+ else {
/* none otherwise */
CTX_wm_window_set(C, NULL);
}
@@ -1206,15 +1209,15 @@ static void screen_cursor_set(wmWindow *win, wmEvent *event)
AZone *az= NULL;
ScrArea *sa;
- for(sa= win->screen->areabase.first; sa; sa= sa->next)
- if((az=is_in_area_actionzone(sa, event->x, event->y)))
+ for (sa= win->screen->areabase.first; sa; sa= sa->next)
+ if ((az=is_in_area_actionzone(sa, event->x, event->y)))
break;
- if(sa) {
- if(az->type==AZONE_AREA)
+ if (sa) {
+ if (az->type==AZONE_AREA)
WM_cursor_set(win, CURSOR_EDIT);
- else if(az->type==AZONE_REGION) {
- if(az->edge == AE_LEFT_TO_TOPRIGHT || az->edge == AE_RIGHT_TO_TOPLEFT)
+ else if (az->type==AZONE_REGION) {
+ if (az->edge == AE_LEFT_TO_TOPRIGHT || az->edge == AE_RIGHT_TO_TOPLEFT)
WM_cursor_set(win, CURSOR_X_MOVE);
else
WM_cursor_set(win, CURSOR_Y_MOVE);
@@ -1224,7 +1227,7 @@ static void screen_cursor_set(wmWindow *win, wmEvent *event)
ScrEdge *actedge= screen_find_active_scredge(win->screen, event->x, event->y);
if (actedge) {
- if(scredge_is_horizontal(actedge))
+ if (scredge_is_horizontal(actedge))
WM_cursor_set(win, CURSOR_Y_MOVE);
else
WM_cursor_set(win, CURSOR_X_MOVE);
@@ -1241,21 +1244,21 @@ void ED_screen_set_subwinactive(bContext *C, wmEvent *event)
{
wmWindow *win= CTX_wm_window(C);
- if(win->screen) {
+ if (win->screen) {
bScreen *scr= win->screen;
ScrArea *sa;
ARegion *ar;
int oldswin= scr->subwinactive;
- for(sa= scr->areabase.first; sa; sa= sa->next) {
- if(event->x > sa->totrct.xmin && event->x < sa->totrct.xmax)
- if(event->y > sa->totrct.ymin && event->y < sa->totrct.ymax)
- if(NULL==is_in_area_actionzone(sa, event->x, event->y))
+ for (sa= scr->areabase.first; sa; sa= sa->next) {
+ if (event->x > sa->totrct.xmin && event->x < sa->totrct.xmax)
+ if (event->y > sa->totrct.ymin && event->y < sa->totrct.ymax)
+ if (NULL==is_in_area_actionzone(sa, event->x, event->y))
break;
}
- if(sa) {
- for(ar= sa->regionbase.first; ar; ar= ar->next) {
- if(BLI_in_rcti(&ar->winrct, event->x, event->y))
+ if (sa) {
+ for (ar= sa->regionbase.first; ar; ar= ar->next) {
+ if (BLI_in_rcti(&ar->winrct, event->x, event->y))
scr->subwinactive= ar->swinid;
}
}
@@ -1263,28 +1266,28 @@ void ED_screen_set_subwinactive(bContext *C, wmEvent *event)
scr->subwinactive= scr->mainwin;
/* check for redraw headers */
- if(oldswin!=scr->subwinactive) {
+ if (oldswin!=scr->subwinactive) {
- for(sa= scr->areabase.first; sa; sa= sa->next) {
+ for (sa= scr->areabase.first; sa; sa= sa->next) {
int do_draw= 0;
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->swinid==oldswin || ar->swinid==scr->subwinactive)
+ for (ar= sa->regionbase.first; ar; ar= ar->next)
+ if (ar->swinid==oldswin || ar->swinid==scr->subwinactive)
do_draw= 1;
- if(do_draw) {
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->regiontype==RGN_TYPE_HEADER)
+ if (do_draw) {
+ for (ar= sa->regionbase.first; ar; ar= ar->next)
+ if (ar->regiontype==RGN_TYPE_HEADER)
ED_region_tag_redraw(ar);
}
}
}
/* cursors, for time being set always on edges, otherwise aregion doesnt switch */
- if(scr->subwinactive==scr->mainwin) {
+ if (scr->subwinactive==scr->mainwin) {
screen_cursor_set(win, event);
}
- else if(oldswin!=scr->subwinactive) {
+ else if (oldswin!=scr->subwinactive) {
region_cursor_set(win, scr->subwinactive);
WM_event_add_notifier(C, NC_SCREEN|ND_SUBWINACTIVE, scr);
}
@@ -1297,15 +1300,15 @@ int ED_screen_area_active(const bContext *C)
bScreen *sc= CTX_wm_screen(C);
ScrArea *sa= CTX_wm_area(C);
- if(win && sc && sa) {
+ if (win && sc && sa) {
AZone *az= is_in_area_actionzone(sa, win->eventstate->x, win->eventstate->y);
ARegion *ar;
if (az && az->type == AZONE_REGION)
return 1;
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->swinid == sc->subwinactive)
+ for (ar= sa->regionbase.first; ar; ar= ar->next)
+ if (ar->swinid == sc->subwinactive)
return 1;
}
return 0;
@@ -1321,21 +1324,21 @@ void ED_screen_set(bContext *C, bScreen *sc)
ID *id;
/* validate screen, it's called with notifier reference */
- for(id= CTX_data_main(C)->screen.first; id; id= id->next)
- if(sc == (bScreen *)id)
+ for (id= CTX_data_main(C)->screen.first; id; id= id->next)
+ if (sc == (bScreen *)id)
break;
- if(id==NULL)
+ if (id==NULL)
return;
/* check for valid winid */
- if(sc->winid!=0 && sc->winid!=win->winid)
+ if (sc->winid!=0 && sc->winid!=win->winid)
return;
- if(sc->full) { /* find associated full */
+ if (sc->full) { /* find associated full */
bScreen *sc1;
- for(sc1= CTX_data_main(C)->screen.first; sc1; sc1= sc1->id.next) {
+ for (sc1= CTX_data_main(C)->screen.first; sc1; sc1= sc1->id.next) {
ScrArea *sa= sc1->areabase.first;
- if(sa->full==sc) {
+ if (sa->full==sc) {
sc= sc1;
break;
}
@@ -1347,13 +1350,13 @@ void ED_screen_set(bContext *C, bScreen *sc)
ScrArea *sa;
/* remove handlers referencing areas in old screen */
- for(sa = oldscreen->areabase.first; sa; sa = sa->next) {
+ for (sa = oldscreen->areabase.first; sa; sa = sa->next) {
WM_event_remove_area_handler(&win->modalhandlers, sa);
}
/* we put timer to sleep, so screen_exit has to think there's no timer */
oldscreen->animtimer= NULL;
- if(wt)
+ if (wt)
WM_event_timer_sleep(wm, win, wt, 1);
ED_screen_exit(C, win, oldscreen);
@@ -1378,8 +1381,8 @@ static int ed_screen_used(wmWindowManager *wm, bScreen *sc)
{
wmWindow *win;
- for(win=wm->windows.first; win; win=win->next)
- if(win->screen == sc)
+ for (win=wm->windows.first; win; win=win->next)
+ if (win->screen == sc)
return 1;
return 0;
@@ -1401,44 +1404,47 @@ 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))
+ for (newsc= sc->id.prev; newsc; newsc=newsc->id.prev)
+ if (!ed_screen_used(wm, newsc))
break;
- if(!newsc) {
- for(newsc= sc->id.next; newsc; newsc=newsc->id.next)
- if(!ed_screen_used(wm, newsc))
+ if (!newsc) {
+ for (newsc= sc->id.next; newsc; newsc=newsc->id.next)
+ if (!ed_screen_used(wm, newsc))
break;
}
- if(!newsc)
+ if (!newsc)
return;
ED_screen_set(C, newsc);
- if(delete && win->screen != sc)
+ if (delete && win->screen != sc)
free_libblock(&bmain->screen, 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) {
+ for (sc= CTX_data_main(C)->screen.first; sc; sc= sc->id.next) {
+ if ((U.flag & USER_SCENEGLOBAL) || sc==screen) {
- if(scene != sc->scene) {
+ if (scene != sc->scene) {
/* all areas endlocalview */
// XXX ScrArea *sa= sc->areabase.first;
- // while(sa) {
+ // while (sa) {
// endlocalview(sa);
// sa= sa->next;
// }
@@ -1451,13 +1457,13 @@ void ED_screen_set_scene(bContext *C, Scene *scene)
// copy_view3d_lock(0); /* space.c */
/* 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) {
+ for (sc= CTX_data_main(C)->screen.first; sc; sc= sc->id.next) {
+ if ( (U.flag & USER_SCENEGLOBAL) || sc==screen) {
ScrArea *sa= sc->areabase.first;
- while(sa) {
+ while (sa) {
SpaceLink *sl= sa->spacedata.first;
- while(sl) {
- if(sl->spacetype==SPACE_VIEW3D) {
+ while (sl) {
+ if (sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D*) sl;
BKE_screen_view3d_sync(v3d, scene);
@@ -1467,11 +1473,11 @@ void ED_screen_set_scene(bContext *C, Scene *scene)
// XXX if (sc==curscreen) handle_view3d_lock();
if (!v3d->camera) {
ARegion *ar;
- for(ar=v3d->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype == RGN_TYPE_WINDOW) {
+ for (ar=v3d->regionbase.first; ar; ar= ar->next) {
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
RegionView3D *rv3d= ar->regiondata;
- if(rv3d->persp==RV3D_CAMOB)
+ if (rv3d->persp==RV3D_CAMOB)
rv3d->persp= RV3D_PERSP;
}
}
@@ -1489,7 +1495,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);
@@ -1502,14 +1508,14 @@ void ED_screen_delete_scene(bContext *C, Scene *scene)
Main *bmain= CTX_data_main(C);
Scene *newscene;
- if(scene->id.prev)
+ if (scene->id.prev)
newscene= scene->id.prev;
- else if(scene->id.next)
+ else if (scene->id.next)
newscene= scene->id.next;
else
return;
- ED_screen_set_scene(C, newscene);
+ ED_screen_set_scene(C, CTX_wm_screen(C), newscene);
unlink_scene(bmain, scene, newscene);
}
@@ -1520,11 +1526,11 @@ ScrArea *ED_screen_full_newspace(bContext *C, ScrArea *sa, int type)
bScreen *screen= CTX_wm_screen(C);
ScrArea *newsa= NULL;
- if(!sa || sa->full==NULL) {
+ if (!sa || sa->full==NULL) {
newsa= ED_screen_full_toggle(C, win, sa);
}
- if(!newsa) {
+ if (!newsa) {
if (sa->full) {
/* if this has been called from the temporary info header generated in
* temp fullscreen layouts, find the correct fullscreen area to change
@@ -1533,8 +1539,10 @@ ScrArea *ED_screen_full_newspace(bContext *C, ScrArea *sa, int type)
if (!(sa->flag & AREA_TEMP_INFO))
break;
}
- } else
- newsa= sa;
+ }
+ else {
+ newsa = sa;
+ }
}
ED_area_newspace(C, newsa, type);
@@ -1548,7 +1556,7 @@ void ED_screen_full_prevspace(bContext *C, ScrArea *sa)
ED_area_prevspace(C, sa);
- if(sa->full)
+ if (sa->full)
ED_screen_full_toggle(C, win, sa);
}
@@ -1581,10 +1589,13 @@ void ED_screen_full_restore(bContext *C, ScrArea *sa)
sima->flag &= ~SI_FULLWINDOW;
ED_screen_full_prevspace(C, sa);
}
- } else if (sl->spacetype == SPACE_FILE) {
+ }
+ else if (sl->spacetype == SPACE_FILE) {
ED_screen_full_prevspace(C, sa);
- } else
+ }
+ else {
ED_screen_full_toggle(C, win, sa);
+ }
}
/* otherwise just tile the area again */
else {
@@ -1598,18 +1609,18 @@ ScrArea *ED_screen_full_toggle(bContext *C, wmWindow *win, ScrArea *sa)
bScreen *sc, *oldscreen;
ARegion *ar;
- if(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 */
- for(ar=sa->regionbase.first; ar; ar=ar->next)
+ * 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);
/* prevent hanging header prints */
ED_area_headerprint(sa, NULL);
}
- if(sa && sa->full) {
+ if (sa && sa->full) {
ScrArea *old;
/*short fulltype;*/ /*UNUSED*/
@@ -1622,11 +1633,11 @@ ScrArea *ED_screen_full_toggle(bContext *C, wmWindow *win, ScrArea *sa)
/* removed: SCREENAUTOPLAY exception here */
/* find old area */
- for(old= sc->areabase.first; old; old= old->next)
- if(old->full) break;
- if(old==NULL) {
- if (G.f & G_DEBUG)
- printf("something wrong in areafullscreen\n");
+ for (old= sc->areabase.first; old; old= old->next)
+ if (old->full) break;
+ if (old==NULL) {
+ if (G.debug & G_DEBUG)
+ printf("%s: something wrong in areafullscreen\n", __func__);
return NULL;
}
@@ -1651,10 +1662,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?
- if(oldscreen->areabase.first==oldscreen->areabase.last)
+ * 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,8 +1682,8 @@ 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 */
- if(!sa)
+ * mouse is outside of the window and we open a file browser */
+ if (!sa)
sa= oldscreen->areabase.first;
/* copy area */
@@ -1728,17 +1740,24 @@ void ED_screen_animation_timer(bContext *C, int redraws, int refresh, int sync,
wmWindow *win= CTX_wm_window(C);
Scene *scene= CTX_data_scene(C);
- if(screen->animtimer)
+ if (screen->animtimer)
WM_event_remove_timer(wm, win, screen->animtimer);
screen->animtimer= NULL;
- if(enable) {
+ if (enable) {
ScreenAnimData *sad= MEM_callocN(sizeof(ScreenAnimData), "ScreenAnimData");
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;
@@ -1758,12 +1777,12 @@ static ARegion *time_top_left_3dwindow(bScreen *screen)
ScrArea *sa;
int min= 10000;
- for(sa= screen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_VIEW3D) {
+ for (sa= screen->areabase.first; sa; sa= sa->next) {
+ if (sa->spacetype==SPACE_VIEW3D) {
ARegion *ar;
- for(ar= sa->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype==RGN_TYPE_WINDOW) {
- if(ar->winrct.xmin - ar->winrct.ymin < min) {
+ for (ar= sa->regionbase.first; ar; ar= ar->next) {
+ if (ar->regiontype==RGN_TYPE_WINDOW) {
+ if (ar->winrct.xmin - ar->winrct.ymin < min) {
aret= ar;
min= ar->winrct.xmin - ar->winrct.ymin;
}
@@ -1777,14 +1796,14 @@ static ARegion *time_top_left_3dwindow(bScreen *screen)
void ED_screen_animation_timer_update(bScreen *screen, int redraws, int refresh)
{
- if(screen && screen->animtimer) {
+ if (screen && screen->animtimer) {
wmTimer *wt= screen->animtimer;
ScreenAnimData *sad= wt->customdata;
sad->redraws= redraws;
sad->refresh= refresh;
sad->ar= NULL;
- if(redraws & TIME_REGION)
+ if (redraws & TIME_REGION)
sad->ar= time_top_left_3dwindow(screen);
}
}
@@ -1795,11 +1814,11 @@ void ED_update_for_newframe(Main *bmain, Scene *scene, bScreen *screen, int UNUS
{
#ifdef DURIAN_CAMERA_SWITCH
void *camera= scene_camera_switch_find(scene);
- if(camera && scene->camera != camera) {
+ if (camera && scene->camera != camera) {
bScreen *sc;
scene->camera= camera;
/* are there cameras in the views that are not in the scene? */
- for(sc= bmain->screen.first; sc; sc= sc->id.next) {
+ for (sc= bmain->screen.first; sc; sc= sc->id.next) {
BKE_screen_view3d_scene_sync(sc);
}
}
@@ -1808,7 +1827,7 @@ void ED_update_for_newframe(Main *bmain, Scene *scene, bScreen *screen, int UNUS
//extern void audiostream_scrub(unsigned int frame); /* seqaudio.c */
/* update animated image textures for gpu, etc,
- * call before scene_update_for_newframe so modifiers with textuers dont lag 1 frame */
+ * call before scene_update_for_newframe so modifiers with textuers don't lag 1 frame */
ED_image_update_frame(bmain, scene->r.cfra);
ED_clip_update_frame(bmain, scene->r.cfra);
@@ -1827,15 +1846,15 @@ void ED_update_for_newframe(Main *bmain, Scene *scene, bScreen *screen, int UNUS
//BIF_image_update_frame();
/* composite */
- if(scene->use_nodes && scene->nodetree)
+ if (scene->use_nodes && scene->nodetree)
ntreeCompositTagAnimated(scene->nodetree);
/* update animated texture nodes */
{
Tex *tex;
- for(tex= bmain->tex.first; tex; tex= tex->id.next)
- if( tex->use_nodes && tex->nodetree ) {
- ntreeTexTagAnimated( tex->nodetree );
+ for (tex= bmain->tex.first; tex; tex= tex->id.next)
+ if (tex->use_nodes && tex->nodetree) {
+ ntreeTexTagAnimated(tex->nodetree);
}
}
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 039b1c2f866..e427e1e21cf 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -89,42 +89,42 @@
int ED_operator_regionactive(bContext *C)
{
- if(CTX_wm_window(C)==NULL) return 0;
- if(CTX_wm_screen(C)==NULL) return 0;
- if(CTX_wm_region(C)==NULL) return 0;
+ if (CTX_wm_window(C)==NULL) return 0;
+ if (CTX_wm_screen(C)==NULL) return 0;
+ if (CTX_wm_region(C)==NULL) return 0;
return 1;
}
int ED_operator_areaactive(bContext *C)
{
- if(CTX_wm_window(C)==NULL) return 0;
- if(CTX_wm_screen(C)==NULL) return 0;
- if(CTX_wm_area(C)==NULL) return 0;
+ if (CTX_wm_window(C)==NULL) return 0;
+ if (CTX_wm_screen(C)==NULL) return 0;
+ if (CTX_wm_area(C)==NULL) return 0;
return 1;
}
int ED_operator_screenactive(bContext *C)
{
- if(CTX_wm_window(C)==NULL) return 0;
- if(CTX_wm_screen(C)==NULL) return 0;
+ if (CTX_wm_window(C)==NULL) return 0;
+ if (CTX_wm_screen(C)==NULL) return 0;
return 1;
}
/* XXX added this to prevent anim state to change during renders */
static int ED_operator_screenactive_norender(bContext *C)
{
- if(G.rendering) return 0;
- if(CTX_wm_window(C)==NULL) return 0;
- if(CTX_wm_screen(C)==NULL) return 0;
+ if (G.rendering) return 0;
+ if (CTX_wm_window(C)==NULL) return 0;
+ if (CTX_wm_screen(C)==NULL) return 0;
return 1;
}
static int screen_active_editable(bContext *C)
{
- if(ED_operator_screenactive(C)) {
+ if (ED_operator_screenactive(C)) {
/* no full window splitting allowed */
- if(CTX_wm_screen(C)->full != SCREENNORMAL)
+ if (CTX_wm_screen(C)->full != SCREENNORMAL)
return 0;
return 1;
}
@@ -134,8 +134,8 @@ static int screen_active_editable(bContext *C)
/* when mouse is over area-edge */
int ED_operator_screen_mainwinactive(bContext *C)
{
- if(CTX_wm_window(C)==NULL) return 0;
- if(CTX_wm_screen(C)==NULL) return 0;
+ if (CTX_wm_window(C)==NULL) return 0;
+ if (CTX_wm_screen(C)==NULL) return 0;
if (CTX_wm_screen(C)->subwinactive!=CTX_wm_screen(C)->mainwin) return 0;
return 1;
}
@@ -143,7 +143,7 @@ int ED_operator_screen_mainwinactive(bContext *C)
int ED_operator_scene_editable(bContext *C)
{
Scene *scene= CTX_data_scene(C);
- if(scene && scene->id.lib==NULL)
+ if (scene && scene->id.lib==NULL)
return 1;
return 0;
}
@@ -153,13 +153,13 @@ int ED_operator_objectmode(bContext *C)
Scene *scene= CTX_data_scene(C);
Object *obact= CTX_data_active_object(C);
- if(scene==NULL || scene->id.lib)
+ if (scene==NULL || scene->id.lib)
return 0;
- if( CTX_data_edit_object(C) )
+ if ( CTX_data_edit_object(C) )
return 0;
/* add a check for ob->mode too? */
- if(obact && obact->mode)
+ if (obact && obact->mode)
return 0;
return 1;
@@ -168,7 +168,7 @@ int ED_operator_objectmode(bContext *C)
static int ed_spacetype_test(bContext *C, int type)
{
- if(ED_operator_areaactive(C)) {
+ if (ED_operator_areaactive(C)) {
SpaceLink *sl= (SpaceLink *)CTX_wm_space_data(C);
return sl && (sl->spacetype == type);
}
@@ -182,7 +182,7 @@ int ED_operator_view3d_active(bContext *C)
int ED_operator_region_view3d_active(bContext *C)
{
- if(CTX_wm_region_view3d(C))
+ if (CTX_wm_region_view3d(C))
return TRUE;
CTX_wm_operator_poll_msg_set(C, "expected a view3d region");
@@ -192,7 +192,7 @@ int ED_operator_region_view3d_active(bContext *C)
/* generic for any view2d which uses anim_ops */
int ED_operator_animview_active(bContext *C)
{
- if(ED_operator_areaactive(C)) {
+ if (ED_operator_areaactive(C)) {
SpaceLink *sl= (SpaceLink *)CTX_wm_space_data(C);
if (sl && (ELEM5(sl->spacetype, SPACE_SEQ, SPACE_ACTION, SPACE_NLA, SPACE_IPO, SPACE_TIME)))
return TRUE;
@@ -214,10 +214,10 @@ int ED_operator_outliner_active(bContext *C)
int ED_operator_outliner_active_no_editobject(bContext *C)
{
- if(ed_spacetype_test(C, SPACE_OUTLINER)) {
+ if (ed_spacetype_test(C, SPACE_OUTLINER)) {
Object *ob = ED_object_active_context(C);
Object *obedit= CTX_data_edit_object(C);
- if(ob && ob == obedit)
+ if (ob && ob == obedit)
return 0;
else
return 1;
@@ -244,7 +244,7 @@ int ED_operator_node_active(bContext *C)
{
SpaceNode *snode= CTX_wm_space_node(C);
- if(snode && snode->edittree)
+ if (snode && snode->edittree)
return 1;
return 0;
@@ -314,8 +314,8 @@ int ED_operator_object_active_editable_font(bContext *C)
int ED_operator_editmesh(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
- if(obedit && obedit->type==OB_MESH)
- return NULL != ((Mesh *)obedit->data)->edit_btmesh;
+ if (obedit && obedit->type==OB_MESH)
+ return NULL != BMEdit_FromObject(obedit);
return 0;
}
@@ -326,7 +326,7 @@ int ED_operator_editmesh_view3d(bContext *C)
int ED_operator_editmesh_region_view3d(bContext *C)
{
- if(ED_operator_editmesh(C) && CTX_wm_region_view3d(C))
+ if (ED_operator_editmesh(C) && CTX_wm_region_view3d(C))
return 1;
CTX_wm_operator_poll_msg_set(C, "expected a view3d region & editmesh");
@@ -336,7 +336,7 @@ int ED_operator_editmesh_region_view3d(bContext *C)
int ED_operator_editarmature(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
- if(obedit && obedit->type==OB_ARMATURE)
+ if (obedit && obedit->type==OB_ARMATURE)
return NULL != ((bArmature *)obedit->data)->edbo;
return 0;
}
@@ -347,8 +347,8 @@ int ED_operator_posemode(bContext *C)
if (obact && !(obact->mode & OB_MODE_EDIT)) {
Object *obpose;
- if((obpose= object_pose_armature_get(obact))) {
- if((obact == obpose) || (obact->mode & OB_MODE_WEIGHT_PAINT)) {
+ if ((obpose= object_pose_armature_get(obact))) {
+ if ((obact == obpose) || (obact->mode & OB_MODE_WEIGHT_PAINT)) {
return 1;
}
}
@@ -367,30 +367,31 @@ int ED_operator_uvedit(bContext *C)
int ED_operator_uvmap(bContext *C)
{
- Object *obedit= CTX_data_edit_object(C);
- BMEditMesh *em= NULL;
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = NULL;
- if(obedit && obedit->type==OB_MESH)
- em= ((Mesh *)obedit->data)->edit_btmesh;
+ if (obedit && obedit->type == OB_MESH) {
+ em = BMEdit_FromObject(obedit);
+ }
- if(em && (em->bm->totface)) {
- return 1;
+ if (em && (em->bm->totface)) {
+ return TRUE;
}
- return 0;
+ return FALSE;
}
int ED_operator_editsurfcurve(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
- if(obedit && ELEM(obedit->type, OB_CURVE, OB_SURF))
+ if (obedit && ELEM(obedit->type, OB_CURVE, OB_SURF))
return NULL != ((Curve *)obedit->data)->editnurb;
return 0;
}
int ED_operator_editsurfcurve_region_view3d(bContext *C)
{
- if(ED_operator_editsurfcurve(C) && CTX_wm_region_view3d(C))
+ if (ED_operator_editsurfcurve(C) && CTX_wm_region_view3d(C))
return 1;
CTX_wm_operator_poll_msg_set(C, "expected a view3d region & editcurve");
@@ -400,7 +401,7 @@ int ED_operator_editsurfcurve_region_view3d(bContext *C)
int ED_operator_editcurve(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
- if(obedit && obedit->type==OB_CURVE)
+ if (obedit && obedit->type==OB_CURVE)
return NULL != ((Curve *)obedit->data)->editnurb;
return 0;
}
@@ -408,7 +409,7 @@ int ED_operator_editcurve(bContext *C)
int ED_operator_editcurve_3d(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
- if(obedit && obedit->type==OB_CURVE) {
+ if (obedit && obedit->type==OB_CURVE) {
Curve *cu= (Curve *)obedit->data;
return (cu->flag&CU_3D) && (NULL != cu->editnurb);
@@ -419,7 +420,7 @@ int ED_operator_editcurve_3d(bContext *C)
int ED_operator_editsurf(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
- if(obedit && obedit->type==OB_SURF)
+ if (obedit && obedit->type==OB_SURF)
return NULL != ((Curve *)obedit->data)->editnurb;
return 0;
}
@@ -427,7 +428,7 @@ int ED_operator_editsurf(bContext *C)
int ED_operator_editfont(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
- if(obedit && obedit->type==OB_FONT)
+ if (obedit && obedit->type==OB_FONT)
return NULL != ((Curve *)obedit->data)->editfont;
return 0;
}
@@ -435,7 +436,7 @@ int ED_operator_editfont(bContext *C)
int ED_operator_editlattice(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
- if(obedit && obedit->type==OB_LATTICE)
+ if (obedit && obedit->type==OB_LATTICE)
return NULL != ((Lattice *)obedit->data)->editlatt;
return 0;
}
@@ -443,7 +444,7 @@ int ED_operator_editlattice(bContext *C)
int ED_operator_editmball(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
- if(obedit && obedit->type==OB_MBALL)
+ if (obedit && obedit->type==OB_MBALL)
return NULL != ((MetaBall *)obedit->data)->editelems;
return 0;
}
@@ -451,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 {
@@ -484,8 +484,8 @@ static ScrArea *screen_areahascursor(bScreen *scr, int x, int y)
{
ScrArea *sa= NULL;
sa= scr->areabase.first;
- while(sa) {
- if(BLI_in_rcti(&sa->totrct, x, y)) break;
+ while (sa) {
+ if (BLI_in_rcti(&sa->totrct, x, y)) break;
sa= sa->next;
}
@@ -498,13 +498,13 @@ static int actionzone_area_poll(bContext *C)
wmWindow *win= CTX_wm_window(C);
ScrArea *sa= CTX_wm_area(C);
- if(sa && win) {
+ if (sa && win) {
AZone *az;
int x= win->eventstate->x;
int y= win->eventstate->y;
- for(az= sa->actionzones.first; az; az= az->next)
- if(BLI_in_rcti(&az->rect, x, y))
+ for (az= sa->actionzones.first; az; az= az->next)
+ if (BLI_in_rcti(&az->rect, x, y))
return 1;
}
return 0;
@@ -514,16 +514,16 @@ AZone *is_in_area_actionzone(ScrArea *sa, int x, int y)
{
AZone *az= NULL;
- for(az= sa->actionzones.first; az; az= az->next) {
- if(BLI_in_rcti(&az->rect, x, y)) {
- if(az->type == AZONE_AREA) {
+ for (az= sa->actionzones.first; az; az= az->next) {
+ if (BLI_in_rcti(&az->rect, x, y)) {
+ if (az->type == AZONE_AREA) {
/* no triangle intersect but a hotspot circle based on corner */
int radius= (x-az->x1)*(x-az->x1) + (y-az->y1)*(y-az->y1);
- if(radius <= AZONESPOT*AZONESPOT)
+ if (radius <= AZONESPOT*AZONESPOT)
break;
}
- else if(az->type == AZONE_REGION) {
+ else if (az->type == AZONE_REGION) {
break;
}
}
@@ -535,7 +535,7 @@ AZone *is_in_area_actionzone(ScrArea *sa, int x, int y)
static void actionzone_exit(wmOperator *op)
{
- if(op->customdata)
+ if (op->customdata)
MEM_freeN(op->customdata);
op->customdata= NULL;
}
@@ -550,7 +550,7 @@ static void actionzone_apply(bContext *C, wmOperator *op, int type)
sad->modifier= RNA_int_get(op->ptr, "modifier");
event= *(win->eventstate); /* XXX huh huh? make api call */
- if(type==AZONE_AREA)
+ if (type==AZONE_AREA)
event.type= EVT_ACTIONZONE_AREA;
else
event.type= EVT_ACTIONZONE_REGION;
@@ -567,7 +567,7 @@ static int actionzone_invoke(bContext *C, wmOperator *op, wmEvent *event)
sActionzoneData *sad;
/* quick escape */
- if(az==NULL)
+ if (az==NULL)
return OPERATOR_PASS_THROUGH;
/* ok we do the actionzone */
@@ -577,7 +577,7 @@ static int actionzone_invoke(bContext *C, wmOperator *op, wmEvent *event)
sad->x= event->x; sad->y= event->y;
/* region azone directly reacts on mouse clicks */
- if(sad->az->type==AZONE_REGION) {
+ if (sad->az->type==AZONE_REGION) {
actionzone_apply(C, op, AZONE_REGION);
actionzone_exit(op);
return OPERATOR_FINISHED;
@@ -603,17 +603,17 @@ static int actionzone_modal(bContext *C, wmOperator *op, wmEvent *event)
deltax= (event->x - sad->x);
deltay= (event->y - sad->y);
- if(deltay > ABS(deltax))
+ if (deltay > ABS(deltax))
sad->gesture_dir= 'n';
- else if(deltax > ABS(deltay))
+ else if (deltax > ABS(deltay))
sad->gesture_dir= 'e';
- else if(deltay < -ABS(deltax))
+ else if (deltay < -ABS(deltax))
sad->gesture_dir= 's';
else
sad->gesture_dir= 'w';
/* gesture is large enough? */
- if(ABS(deltax) > mindelta || ABS(deltay) > mindelta) {
+ if (ABS(deltax) > mindelta || ABS(deltay) > mindelta) {
/* second area, for join */
sad->sa2= screen_areahascursor(CTX_wm_screen(C), event->x, event->y);
@@ -646,16 +646,16 @@ static int actionzone_cancel(bContext *UNUSED(C), wmOperator *op)
static void SCREEN_OT_actionzone(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Handle area action zones";
- ot->description= "Handle area action zones for mouse actions/gestures";
- ot->idname= "SCREEN_OT_actionzone";
+ ot->name = "Handle area action zones";
+ ot->description = "Handle area action zones for mouse actions/gestures";
+ ot->idname = "SCREEN_OT_actionzone";
- ot->invoke= actionzone_invoke;
- ot->modal= actionzone_modal;
- ot->poll= actionzone_area_poll;
- ot->cancel= actionzone_cancel;
+ ot->invoke = actionzone_invoke;
+ ot->modal = actionzone_modal;
+ ot->poll = actionzone_area_poll;
+ ot->cancel = actionzone_cancel;
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
RNA_def_int(ot->srna, "modifier", 0, 0, 2, "Modifier", "Modifier state", 0, 2);
}
@@ -663,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 {
@@ -692,7 +691,7 @@ static int area_swap_init(wmOperator *op, wmEvent *event)
sAreaSwapData *sd= NULL;
sActionzoneData *sad= event->customdata;
- if(sad==NULL || sad->sa1==NULL)
+ if (sad==NULL || sad->sa1==NULL)
return 0;
sd= MEM_callocN(sizeof(sAreaSwapData), "sAreaSwapData");
@@ -707,7 +706,7 @@ static int area_swap_init(wmOperator *op, wmEvent *event)
static void area_swap_exit(bContext *C, wmOperator *op)
{
WM_cursor_restore(CTX_wm_window(C));
- if(op->customdata)
+ if (op->customdata)
MEM_freeN(op->customdata);
op->customdata= NULL;
}
@@ -721,7 +720,7 @@ static int area_swap_cancel(bContext *C, wmOperator *op)
static int area_swap_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if(!area_swap_init(op, event))
+ if (!area_swap_init(op, event))
return OPERATOR_PASS_THROUGH;
/* add modal handler */
@@ -742,8 +741,8 @@ static int area_swap_modal(bContext *C, wmOperator *op, wmEvent *event)
sad->sa2= screen_areahascursor(CTX_wm_screen(C), event->x, event->y);
break;
case LEFTMOUSE: /* release LMB */
- if(event->val==KM_RELEASE) {
- if(!sad->sa2 || sad->sa1 == sad->sa2) {
+ if (event->val==KM_RELEASE) {
+ if (!sad->sa2 || sad->sa1 == sad->sa2) {
return area_swap_cancel(C, op);
}
@@ -769,16 +768,16 @@ static int area_swap_modal(bContext *C, wmOperator *op, wmEvent *event)
static void SCREEN_OT_area_swap(wmOperatorType *ot)
{
- ot->name= "Swap areas";
- ot->description= "Swap selected areas screen positions";
- ot->idname= "SCREEN_OT_area_swap";
+ ot->name = "Swap areas";
+ ot->description = "Swap selected areas screen positions";
+ ot->idname = "SCREEN_OT_area_swap";
- ot->invoke= area_swap_invoke;
- ot->modal= area_swap_modal;
- ot->poll= ED_operator_areaactive;
- ot->cancel= area_swap_cancel;
+ ot->invoke = area_swap_invoke;
+ ot->modal = area_swap_modal;
+ ot->poll = ED_operator_areaactive;
+ ot->cancel = area_swap_cancel;
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
}
/* *********** Duplicate area as new window operator ****************** */
@@ -796,18 +795,18 @@ static int area_dupli_invoke(bContext *C, wmOperator *op, wmEvent *event)
sa= CTX_wm_area(C);
/* XXX hrmf! */
- if(event->type==EVT_ACTIONZONE_AREA) {
+ if (event->type==EVT_ACTIONZONE_AREA) {
sActionzoneData *sad= event->customdata;
- if(sad==NULL)
+ if (sad==NULL)
return OPERATOR_PASS_THROUGH;
sa= sad->sa1;
}
/* poll() checks area context, but we don't accept full-area windows */
- if(sc->full != SCREENNORMAL) {
- if(event->type==EVT_ACTIONZONE_AREA)
+ if (sc->full != SCREENNORMAL) {
+ if (event->type==EVT_ACTIONZONE_AREA)
actionzone_exit(op);
return OPERATOR_CANCELLED;
}
@@ -829,7 +828,7 @@ static int area_dupli_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* screen, areas init */
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
- if(event->type==EVT_ACTIONZONE_AREA)
+ if (event->type==EVT_ACTIONZONE_AREA)
actionzone_exit(op);
return OPERATOR_FINISHED;
@@ -837,44 +836,43 @@ static int area_dupli_invoke(bContext *C, wmOperator *op, wmEvent *event)
static void SCREEN_OT_area_dupli(wmOperatorType *ot)
{
- ot->name= "Duplicate Area into New Window";
- ot->description= "Duplicate selected area into new window";
- ot->idname= "SCREEN_OT_area_dupli";
+ ot->name = "Duplicate Area into New Window";
+ ot->description = "Duplicate selected area into new window";
+ ot->idname = "SCREEN_OT_area_dupli";
- ot->invoke= area_dupli_invoke;
- ot->poll= ED_operator_areaactive;
+ ot->invoke = area_dupli_invoke;
+ ot->poll = ED_operator_areaactive;
}
/* ************** 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 {
@@ -891,23 +889,23 @@ static void area_move_set_limits(bScreen *sc, int dir, int *bigger, int *smaller
/* we check all areas and test for free space with MINSIZE */
*bigger= *smaller= 100000;
- for(sa= sc->areabase.first; sa; sa= sa->next) {
- if(dir=='h') {
+ for (sa= sc->areabase.first; sa; sa= sa->next) {
+ if (dir=='h') {
int y1= sa->v2->vec.y - sa->v1->vec.y-areaminy;
/* if top or down edge selected, test height */
- if(sa->v1->flag && sa->v4->flag)
+ if (sa->v1->flag && sa->v4->flag)
*bigger= MIN2(*bigger, y1);
- else if(sa->v2->flag && sa->v3->flag)
+ else if (sa->v2->flag && sa->v3->flag)
*smaller= MIN2(*smaller, y1);
}
else {
int x1= sa->v4->vec.x - sa->v1->vec.x-AREAMINX;
/* if left or right edge selected, test width */
- if(sa->v1->flag && sa->v2->flag)
+ if (sa->v1->flag && sa->v2->flag)
*bigger= MIN2(*bigger, x1);
- else if(sa->v3->flag && sa->v4->flag)
+ else if (sa->v3->flag && sa->v4->flag)
*smaller= MIN2(*smaller, x1);
}
}
@@ -928,13 +926,13 @@ static int area_move_init (bContext *C, wmOperator *op)
/* setup */
actedge= screen_find_active_scredge(sc, x, y);
- if(actedge==NULL) return 0;
+ if (actedge==NULL) return 0;
md= MEM_callocN(sizeof(sAreaMoveData), "sAreaMoveData");
op->customdata= md;
md->dir= scredge_is_horizontal(actedge)?'h':'v';
- if(md->dir=='h') md->origval= actedge->v1->vec.y;
+ if (md->dir=='h') md->origval= actedge->v1->vec.y;
else md->origval= actedge->v1->vec.x;
select_connected_scredge(sc, actedge);
@@ -959,25 +957,25 @@ static void area_move_apply_do(bContext *C, int origval, int delta, int dir, int
for (v1= sc->vertbase.first; v1; v1= v1->next) {
if (v1->flag) {
/* that way a nice AREAGRID */
- if((dir=='v') && v1->vec.x>0 && v1->vec.x<win->sizex-1) {
+ if ((dir=='v') && v1->vec.x>0 && v1->vec.x<win->sizex-1) {
v1->vec.x= origval + delta;
- if(delta != bigger && delta != -smaller) v1->vec.x-= (v1->vec.x % AREAGRID);
+ if (delta != bigger && delta != -smaller) v1->vec.x-= (v1->vec.x % AREAGRID);
}
- if((dir=='h') && v1->vec.y>0 && v1->vec.y<win->sizey-1) {
+ if ((dir=='h') && v1->vec.y>0 && v1->vec.y<win->sizey-1) {
v1->vec.y= origval + delta;
v1->vec.y+= AREAGRID-1;
v1->vec.y-= (v1->vec.y % AREAGRID);
/* prevent too small top header */
- if(v1->vec.y > win->sizey-areaminy)
+ if (v1->vec.y > win->sizey-areaminy)
v1->vec.y= win->sizey-areaminy;
}
}
}
- for(sa= sc->areabase.first; sa; sa= sa->next) {
- if(sa->v1->flag || sa->v2->flag || sa->v3->flag || sa->v4->flag)
+ for (sa= sc->areabase.first; sa; sa= sa->next) {
+ if (sa->v1->flag || sa->v2->flag || sa->v3->flag || sa->v4->flag)
ED_area_tag_redraw(sa);
}
@@ -995,7 +993,7 @@ static void area_move_apply(bContext *C, wmOperator *op)
static void area_move_exit(bContext *C, wmOperator *op)
{
- if(op->customdata)
+ if (op->customdata)
MEM_freeN(op->customdata);
op->customdata= NULL;
@@ -1006,7 +1004,7 @@ static void area_move_exit(bContext *C, wmOperator *op)
static int area_move_exec(bContext *C, wmOperator *op)
{
- if(!area_move_init(C, op))
+ if (!area_move_init(C, op))
return OPERATOR_CANCELLED;
area_move_apply(C, op);
@@ -1021,7 +1019,7 @@ static int area_move_invoke(bContext *C, wmOperator *op, wmEvent *event)
RNA_int_set(op->ptr, "x", event->x);
RNA_int_set(op->ptr, "y", event->y);
- if(!area_move_init(C, op))
+ if (!area_move_init(C, op))
return OPERATOR_PASS_THROUGH;
/* add temp handler */
@@ -1054,7 +1052,7 @@ static int area_move_modal(bContext *C, wmOperator *op, wmEvent *event)
y= RNA_int_get(op->ptr, "y");
delta= (md->dir == 'v')? event->x - x: event->y - y;
- if(md->step) delta= delta - (delta % md->step);
+ if (md->step) delta= delta - (delta % md->step);
RNA_int_set(op->ptr, "delta", delta);
area_move_apply(C, op);
@@ -1085,17 +1083,17 @@ static int area_move_modal(bContext *C, wmOperator *op, wmEvent *event)
static void SCREEN_OT_area_move(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move area edges";
- ot->description= "Move selected area edges";
- ot->idname= "SCREEN_OT_area_move";
+ ot->name = "Move area edges";
+ ot->description = "Move selected area edges";
+ ot->idname = "SCREEN_OT_area_move";
- ot->exec= area_move_exec;
- ot->invoke= area_move_invoke;
- ot->cancel= area_move_cancel;
- ot->modal= area_move_modal;
- ot->poll= ED_operator_screen_mainwinactive; /* when mouse is over area-edge */
+ ot->exec = area_move_exec;
+ ot->invoke = area_move_invoke;
+ ot->cancel = area_move_cancel;
+ ot->modal = area_move_modal;
+ ot->poll = ED_operator_screen_mainwinactive; /* when mouse is over area-edge */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
/* rna */
RNA_def_int(ot->srna, "x", 0, INT_MIN, INT_MAX, "X", "", INT_MIN, INT_MAX);
@@ -1106,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
@@ -1169,10 +1166,10 @@ static int area_split_menu_init(bContext *C, wmOperator *op)
sd->sarea= CTX_wm_area(C);
- if(sd->sarea) {
+ if (sd->sarea) {
int dir= RNA_enum_get(op->ptr, "direction");
- if(dir=='h')
+ if (dir=='h')
sd->sarea->flag |= AREA_FLAG_DRAWSPLIT_H;
else
sd->sarea->flag |= AREA_FLAG_DRAWSPLIT_V;
@@ -1189,14 +1186,14 @@ static int area_split_init(bContext *C, wmOperator *op)
int dir;
/* required context */
- if(sa==NULL) return 0;
+ if (sa==NULL) return 0;
/* required properties */
dir= RNA_enum_get(op->ptr, "direction");
/* minimal size */
- if(dir=='v' && sa->winx < 2*AREAMINX) return 0;
- if(dir=='h' && sa->winy < 2*areaminy) return 0;
+ if (dir=='v' && sa->winx < 2*AREAMINX) return 0;
+ if (dir=='h' && sa->winy < 2*areaminy) return 0;
/* custom data */
sd= (sAreaSplitData*)MEM_callocN(sizeof (sAreaSplitData), "op_area_split");
@@ -1222,16 +1219,16 @@ static ScrEdge *area_findsharededge(bScreen *screen, ScrArea *sa, ScrArea *sb)
ScrVert *sbv3= sb->v3;
ScrVert *sbv4= sb->v4;
- if(sav1==sbv4 && sav2==sbv3) { /* sa to right of sb = W */
+ if (sav1==sbv4 && sav2==sbv3) { /* sa to right of sb = W */
return screen_findedge(screen, sav1, sav2);
}
- else if(sav2==sbv1 && sav3==sbv4) { /* sa to bottom of sb = N */
+ else if (sav2==sbv1 && sav3==sbv4) { /* sa to bottom of sb = N */
return screen_findedge(screen, sav2, sav3);
}
- else if(sav3==sbv2 && sav4==sbv1) { /* sa to left of sb = E */
+ else if (sav3==sbv2 && sav4==sbv1) { /* sa to left of sb = E */
return screen_findedge(screen, sav3, sav4);
}
- else if(sav1==sbv2 && sav4==sbv3) { /* sa on top of sb = S*/
+ else if (sav1==sbv2 && sav4==sbv3) { /* sa on top of sb = S*/
return screen_findedge(screen, sav1, sav4);
}
@@ -1252,19 +1249,19 @@ static int area_split_apply(bContext *C, wmOperator *op)
sd->narea= area_split(sc, sd->sarea, dir, fac, 0); /* 0 = no merge */
- if(sd->narea) {
+ if (sd->narea) {
ScrVert *sv;
sd->nedge= area_findsharededge(sc, sd->sarea, sd->narea);
/* select newly created edge, prepare for moving edge */
- for(sv= sc->vertbase.first; sv; sv= sv->next)
+ for (sv= sc->vertbase.first; sv; sv= sv->next)
sv->flag = 0;
sd->nedge->v1->flag= 1;
sd->nedge->v2->flag= 1;
- if(dir=='h') sd->origval= sd->nedge->v1->vec.y;
+ if (dir=='h') sd->origval= sd->nedge->v1->vec.y;
else sd->origval= sd->nedge->v1->vec.x;
ED_area_tag_redraw(sd->sarea);
@@ -1282,10 +1279,10 @@ static void area_split_exit(bContext *C, wmOperator *op)
{
if (op->customdata) {
sAreaSplitData *sd= (sAreaSplitData *)op->customdata;
- if(sd->sarea) ED_area_tag_redraw(sd->sarea);
- if(sd->narea) ED_area_tag_redraw(sd->narea);
+ if (sd->sarea) ED_area_tag_redraw(sd->sarea);
+ if (sd->narea) ED_area_tag_redraw(sd->narea);
- if(sd->sarea)
+ if (sd->sarea)
sd->sarea->flag &= ~(AREA_FLAG_DRAWSPLIT_H|AREA_FLAG_DRAWSPLIT_V);
MEM_freeN(op->customdata);
@@ -1308,26 +1305,26 @@ static int area_split_invoke(bContext *C, wmOperator *op, wmEvent *event)
int dir;
/* no full window splitting allowed */
- if(CTX_wm_screen(C)->full != SCREENNORMAL)
+ if (CTX_wm_screen(C)->full != SCREENNORMAL)
return OPERATOR_CANCELLED;
- if(event->type==EVT_ACTIONZONE_AREA) {
+ if (event->type==EVT_ACTIONZONE_AREA) {
sActionzoneData *sad= event->customdata;
- if(sad->modifier>0) {
+ if (sad->modifier>0) {
return OPERATOR_PASS_THROUGH;
}
/* verify *sad itself */
- if(sad==NULL || sad->sa1==NULL || sad->az==NULL)
+ if (sad==NULL || sad->sa1==NULL || sad->az==NULL)
return OPERATOR_PASS_THROUGH;
/* is this our *sad? if areas not equal it should be passed on */
- if(CTX_wm_area(C)!=sad->sa1 || sad->sa1!=sad->sa2)
+ if (CTX_wm_area(C)!=sad->sa1 || sad->sa1!=sad->sa2)
return OPERATOR_PASS_THROUGH;
/* prepare operator state vars */
- if(sad->gesture_dir=='n' || sad->gesture_dir=='s') {
+ if (sad->gesture_dir=='n' || sad->gesture_dir=='s') {
dir= 'h';
RNA_float_set(op->ptr, "factor", ((float)(event->x - sad->sa1->v1->vec.x)) / (float)sad->sa1->winx);
}
@@ -1338,7 +1335,7 @@ static int area_split_invoke(bContext *C, wmOperator *op, wmEvent *event)
RNA_enum_set(op->ptr, "direction", dir);
/* general init, also non-UI case, adds customdata, sets area and defaults */
- if(!area_split_init(C, op))
+ if (!area_split_init(C, op))
return OPERATOR_PASS_THROUGH;
}
@@ -1347,18 +1344,18 @@ static int area_split_invoke(bContext *C, wmOperator *op, wmEvent *event)
int x, y;
/* retrieve initial mouse coord, so we can find the active edge */
- if(RNA_struct_property_is_set(op->ptr, "mouse_x"))
+ if (RNA_struct_property_is_set(op->ptr, "mouse_x"))
x= RNA_int_get(op->ptr, "mouse_x");
else
x= event->x;
- if(RNA_struct_property_is_set(op->ptr, "mouse_y"))
+ if (RNA_struct_property_is_set(op->ptr, "mouse_y"))
y= RNA_int_get(op->ptr, "mouse_y");
else
y= event->x;
actedge= screen_find_active_scredge(CTX_wm_screen(C), x, y);
- if(actedge==NULL)
+ if (actedge==NULL)
return OPERATOR_CANCELLED;
dir= scredge_is_horizontal(actedge)?'v':'h';
@@ -1366,7 +1363,7 @@ static int area_split_invoke(bContext *C, wmOperator *op, wmEvent *event)
RNA_enum_set(op->ptr, "direction", dir);
/* special case, adds customdata, sets defaults */
- if(!area_split_menu_init(C, op))
+ if (!area_split_menu_init(C, op))
return OPERATOR_CANCELLED;
}
@@ -1376,10 +1373,10 @@ static int area_split_invoke(bContext *C, wmOperator *op, wmEvent *event)
sd->x= event->x;
sd->y= event->y;
- if(event->type==EVT_ACTIONZONE_AREA) {
+ if (event->type==EVT_ACTIONZONE_AREA) {
/* do the split */
- if(area_split_apply(C, op)) {
+ if (area_split_apply(C, op)) {
area_move_set_limits(CTX_wm_screen(C), dir, &sd->bigger, &sd->smaller);
/* add temp handler for edge move or cancel */
@@ -1404,7 +1401,7 @@ static int area_split_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int area_split_exec(bContext *C, wmOperator *op)
{
- if(!area_split_init(C, op))
+ if (!area_split_init(C, op))
return OPERATOR_CANCELLED;
area_split_apply(C, op);
@@ -1418,7 +1415,7 @@ static int area_split_cancel(bContext *C, wmOperator *op)
{
sAreaSplitData *sd= (sAreaSplitData *)op->customdata;
- if(sd->previewmode) {
+ if (sd->previewmode) {
}
else {
if (screen_area_join(C, CTX_wm_screen(C), sd->sarea, sd->narea)) {
@@ -1446,16 +1443,16 @@ static int area_split_modal(bContext *C, wmOperator *op, wmEvent *event)
dir= RNA_enum_get(op->ptr, "direction");
sd->delta= (dir == 'v')? event->x - sd->origval: event->y - sd->origval;
- if(sd->previewmode==0)
+ if (sd->previewmode==0)
area_move_apply_do(C, sd->origval, sd->delta, dir, sd->bigger, sd->smaller);
else {
- if(sd->sarea) {
+ if (sd->sarea) {
sd->sarea->flag &= ~(AREA_FLAG_DRAWSPLIT_H|AREA_FLAG_DRAWSPLIT_V);
ED_area_tag_redraw(sd->sarea);
}
sd->sarea= screen_areahascursor(CTX_wm_screen(C), event->x, event->y); /* area context not set */
- if(sd->sarea) {
+ if (sd->sarea) {
ED_area_tag_redraw(sd->sarea);
if (dir=='v') {
sd->origsize= sd->sarea->winx;
@@ -1479,13 +1476,13 @@ static int area_split_modal(bContext *C, wmOperator *op, wmEvent *event)
break;
case LEFTMOUSE:
- if(sd->previewmode) {
+ if (sd->previewmode) {
area_split_apply(C, op);
area_split_exit(C, op);
return OPERATOR_FINISHED;
}
else {
- if(event->val==KM_RELEASE) { /* mouse up */
+ if (event->val==KM_RELEASE) { /* mouse up */
area_split_exit(C, op);
return OPERATOR_FINISHED;
}
@@ -1494,23 +1491,23 @@ static int area_split_modal(bContext *C, wmOperator *op, wmEvent *event)
case MIDDLEMOUSE:
case TABKEY:
- if (sd->previewmode==0){
+ if (sd->previewmode==0) {
}
- else{
+ else {
dir = RNA_enum_get(op->ptr, "direction");
- if(event->val==KM_PRESS){
- if (sd->sarea){
+ if (event->val==KM_PRESS) {
+ if (sd->sarea) {
sd->sarea->flag &= ~(AREA_FLAG_DRAWSPLIT_H|AREA_FLAG_DRAWSPLIT_V);
ED_area_tag_redraw(sd->sarea);
- if (dir=='v'){
+ if (dir=='v') {
RNA_enum_set(op->ptr, "direction", 'h');
sd->sarea->flag |= AREA_FLAG_DRAWSPLIT_H;
WM_cursor_set(CTX_wm_window(C),CURSOR_X_MOVE);
}
- else{
+ else {
RNA_enum_set(op->ptr, "direction", 'v');
sd->sarea->flag |= AREA_FLAG_DRAWSPLIT_V;
@@ -1538,16 +1535,16 @@ static EnumPropertyItem prop_direction_items[] = {
static void SCREEN_OT_area_split(wmOperatorType *ot)
{
ot->name = "Split area";
- ot->description= "Split selected area into new windows";
+ ot->description = "Split selected area into new windows";
ot->idname = "SCREEN_OT_area_split";
- ot->exec= area_split_exec;
- ot->invoke= area_split_invoke;
- ot->modal= area_split_modal;
- ot->cancel= area_split_cancel;
+ ot->exec = area_split_exec;
+ ot->invoke = area_split_invoke;
+ ot->modal = area_split_modal;
+ ot->cancel = area_split_cancel;
- ot->poll= screen_active_editable;
- ot->flag= OPTYPE_BLOCKING;
+ ot->poll = screen_active_editable;
+ ot->flag = OPTYPE_BLOCKING;
/* rna */
RNA_def_enum(ot->srna, "direction", prop_direction_items, 'h', "Direction", "");
@@ -1577,9 +1574,10 @@ static int area_max_regionsize(ScrArea *sa, ARegion *scalear, AZEdge edge)
ARegion *ar;
int dist;
- if(edge==AE_RIGHT_TO_TOPLEFT || edge==AE_LEFT_TO_TOPRIGHT) {
+ if (edge==AE_RIGHT_TO_TOPLEFT || edge==AE_LEFT_TO_TOPRIGHT) {
dist = sa->totrct.xmax - sa->totrct.xmin;
- } else { /* AE_BOTTOM_TO_TOPLEFT, AE_TOP_TO_BOTTOMRIGHT */
+ }
+ else { /* AE_BOTTOM_TO_TOPLEFT, AE_TOP_TO_BOTTOMRIGHT */
dist = sa->totrct.ymax - sa->totrct.ymin;
}
@@ -1614,14 +1612,14 @@ static int region_scale_invoke(bContext *C, wmOperator *op, wmEvent *event)
sActionzoneData *sad= event->customdata;
AZone *az;
- if(event->type!=EVT_ACTIONZONE_REGION) {
+ if (event->type!=EVT_ACTIONZONE_REGION) {
BKE_report(op->reports, RPT_ERROR, "Can only scale region size from an action zone");
return OPERATOR_CANCELLED;
}
az = sad->az;
- if(az->ar) {
+ if (az->ar) {
RegionMoveData *rmd= MEM_callocN(sizeof(RegionMoveData), "RegionMoveData");
int maxsize;
@@ -1636,15 +1634,16 @@ static int region_scale_invoke(bContext *C, wmOperator *op, wmEvent *event)
rmd->maxsize = area_max_regionsize(rmd->sa, rmd->ar, rmd->edge);
/* if not set we do now, otherwise it uses type */
- if(rmd->ar->sizex==0)
+ if (rmd->ar->sizex==0)
rmd->ar->sizex= rmd->ar->type->prefsizex;
- if(rmd->ar->sizey==0)
+ if (rmd->ar->sizey==0)
rmd->ar->sizey= rmd->ar->type->prefsizey;
/* now copy to regionmovedata */
- if(rmd->edge==AE_LEFT_TO_TOPRIGHT || rmd->edge==AE_RIGHT_TO_TOPLEFT) {
+ if (rmd->edge==AE_LEFT_TO_TOPRIGHT || rmd->edge==AE_RIGHT_TO_TOPLEFT) {
rmd->origval= rmd->ar->sizex;
- } else {
+ }
+ else {
rmd->origval= rmd->ar->sizey;
}
@@ -1669,11 +1668,11 @@ static int region_scale_get_maxsize(RegionMoveData *rmd)
{
int maxsize= 0;
- if(rmd->edge==AE_LEFT_TO_TOPRIGHT || rmd->edge==AE_RIGHT_TO_TOPLEFT) {
+ if (rmd->edge==AE_LEFT_TO_TOPRIGHT || rmd->edge==AE_RIGHT_TO_TOPLEFT) {
return rmd->sa->winx - UI_UNIT_X;
}
- if(rmd->ar->regiontype == RGN_TYPE_TOOL_PROPS) {
+ if (rmd->ar->regiontype == RGN_TYPE_TOOL_PROPS) {
/* this calculation seems overly verbose
* can someone explain why this method is necessary? - campbell */
maxsize = rmd->maxsize - ((rmd->sa->headertype==HEADERTOP)?UI_UNIT_Y*2:UI_UNIT_Y) - (UI_UNIT_Y/4);
@@ -1684,18 +1683,18 @@ static int region_scale_get_maxsize(RegionMoveData *rmd)
static void region_scale_validate_size(RegionMoveData *rmd)
{
- if((rmd->ar->flag & RGN_FLAG_HIDDEN)==0) {
+ if ((rmd->ar->flag & RGN_FLAG_HIDDEN)==0) {
short *size, maxsize= -1;
- if(rmd->edge==AE_LEFT_TO_TOPRIGHT || rmd->edge==AE_RIGHT_TO_TOPLEFT)
+ if (rmd->edge==AE_LEFT_TO_TOPRIGHT || rmd->edge==AE_RIGHT_TO_TOPLEFT)
size= &rmd->ar->sizex;
else
size= &rmd->ar->sizey;
maxsize= region_scale_get_maxsize(rmd);
- if(*size > maxsize && maxsize > 0)
+ if (*size > maxsize && maxsize > 0)
*size= maxsize;
}
}
@@ -1715,25 +1714,25 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event)
switch(event->type) {
case MOUSEMOVE:
- if(rmd->edge==AE_LEFT_TO_TOPRIGHT || rmd->edge==AE_RIGHT_TO_TOPLEFT) {
+ if (rmd->edge==AE_LEFT_TO_TOPRIGHT || rmd->edge==AE_RIGHT_TO_TOPLEFT) {
delta= event->x - rmd->origx;
- if(rmd->edge==AE_LEFT_TO_TOPRIGHT) delta= -delta;
+ if (rmd->edge==AE_LEFT_TO_TOPRIGHT) delta= -delta;
rmd->ar->sizex= rmd->origval + delta;
CLAMP(rmd->ar->sizex, 0, rmd->maxsize);
- if(rmd->ar->sizex < UI_UNIT_X) {
+ if (rmd->ar->sizex < UI_UNIT_X) {
rmd->ar->sizex= rmd->origval;
- if(!(rmd->ar->flag & RGN_FLAG_HIDDEN))
+ if (!(rmd->ar->flag & RGN_FLAG_HIDDEN))
region_scale_toggle_hidden(C, rmd);
}
- else if(rmd->ar->flag & RGN_FLAG_HIDDEN)
+ else if (rmd->ar->flag & RGN_FLAG_HIDDEN)
region_scale_toggle_hidden(C, rmd);
}
else {
int maxsize= region_scale_get_maxsize(rmd);
delta= event->y - rmd->origy;
- if(rmd->edge==AE_BOTTOM_TO_TOPLEFT) delta= -delta;
+ if (rmd->edge==AE_BOTTOM_TO_TOPLEFT) delta= -delta;
rmd->ar->sizey= rmd->origval + delta;
CLAMP(rmd->ar->sizey, 0, rmd->maxsize);
@@ -1741,14 +1740,14 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event)
/* note, 'UI_UNIT_Y/4' means you need to drag the header almost
* all the way down for it to become hidden, this is done
* otherwise its too easy to do this by accident */
- if(rmd->ar->sizey < UI_UNIT_Y/4) {
+ if (rmd->ar->sizey < UI_UNIT_Y/4) {
rmd->ar->sizey= rmd->origval;
- if(!(rmd->ar->flag & RGN_FLAG_HIDDEN))
+ if (!(rmd->ar->flag & RGN_FLAG_HIDDEN))
region_scale_toggle_hidden(C, rmd);
}
- else if(maxsize > 0 && (rmd->ar->sizey > maxsize))
+ else if (maxsize > 0 && (rmd->ar->sizey > maxsize))
rmd->ar->sizey= maxsize;
- else if(rmd->ar->flag & RGN_FLAG_HIDDEN)
+ else if (rmd->ar->flag & RGN_FLAG_HIDDEN)
region_scale_toggle_hidden(C, rmd);
}
ED_area_tag_redraw(rmd->sa);
@@ -1757,13 +1756,13 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event)
break;
case LEFTMOUSE:
- if(event->val==KM_RELEASE) {
+ if (event->val==KM_RELEASE) {
- if(ABS(event->x - rmd->origx) < 2 && ABS(event->y - rmd->origy) < 2) {
- if(rmd->ar->flag & RGN_FLAG_HIDDEN) {
+ if (ABS(event->x - rmd->origx) < 2 && ABS(event->y - rmd->origy) < 2) {
+ if (rmd->ar->flag & RGN_FLAG_HIDDEN) {
region_scale_toggle_hidden(C, rmd);
}
- else if(rmd->ar->flag & RGN_FLAG_TOO_SMALL) {
+ else if (rmd->ar->flag & RGN_FLAG_TOO_SMALL) {
region_scale_validate_size(rmd);
}
@@ -1795,17 +1794,17 @@ static int region_scale_cancel(bContext *UNUSED(C), wmOperator *op)
static void SCREEN_OT_region_scale(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Scale Region Size";
- ot->description= "Scale selected area";
- ot->idname= "SCREEN_OT_region_scale";
+ ot->name = "Scale Region Size";
+ ot->description = "Scale selected area";
+ ot->idname = "SCREEN_OT_region_scale";
- ot->invoke= region_scale_invoke;
- ot->modal= region_scale_modal;
- ot->cancel= region_scale_cancel;
+ ot->invoke = region_scale_invoke;
+ ot->modal = region_scale_modal;
+ ot->cancel = region_scale_cancel;
- ot->poll= ED_operator_areaactive;
+ ot->poll = ED_operator_areaactive;
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
}
@@ -1836,10 +1835,10 @@ static void SCREEN_OT_frame_offset(wmOperatorType *ot)
ot->name = "Frame Offset";
ot->idname = "SCREEN_OT_frame_offset";
- ot->exec= frame_offset_exec;
+ ot->exec = frame_offset_exec;
- ot->poll= ED_operator_screenactive_norender;
- ot->flag= 0;
+ ot->poll = ED_operator_screenactive_norender;
+ ot->flag = 0;
/* rna */
RNA_def_int(ot->srna, "delta", 0, INT_MIN, INT_MAX, "Delta", "", INT_MIN, INT_MAX);
@@ -1857,7 +1856,7 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
* first/last frame not to be actually shown (bad since for example physics
* simulations aren't reset properly).
*/
- if(animtimer) {
+ if (animtimer) {
ScreenAnimData *sad = animtimer->customdata;
sad->flag |= ANIMPLAY_FLAG_USE_NEXT_FRAME;
@@ -1884,13 +1883,13 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
static void SCREEN_OT_frame_jump(wmOperatorType *ot)
{
ot->name = "Jump to Endpoint";
- ot->description= "Jump to first/last frame in frame range";
+ ot->description = "Jump to first/last frame in frame range";
ot->idname = "SCREEN_OT_frame_jump";
- ot->exec= frame_jump_exec;
+ ot->exec = frame_jump_exec;
- ot->poll= ED_operator_screenactive_norender;
- ot->flag= OPTYPE_UNDO;
+ ot->poll = ED_operator_screenactive_norender;
+ ot->flag = OPTYPE_UNDO;
/* rna */
RNA_def_boolean(ot->srna, "end", 0, "Last Frame", "Jump to the last frame of the frame range");
@@ -1967,13 +1966,13 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
static void SCREEN_OT_keyframe_jump(wmOperatorType *ot)
{
ot->name = "Jump to Keyframe";
- ot->description= "Jump to previous/next keyframe";
+ ot->description = "Jump to previous/next keyframe";
ot->idname = "SCREEN_OT_keyframe_jump";
- ot->exec= keyframe_jump_exec;
+ ot->exec = keyframe_jump_exec;
- ot->poll= ED_operator_screenactive_norender;
- ot->flag= OPTYPE_UNDO;
+ ot->poll = ED_operator_screenactive_norender;
+ ot->flag = OPTYPE_UNDO;
/* rna */
RNA_def_boolean(ot->srna, "next", 1, "Next Keyframe", "");
@@ -1993,22 +1992,22 @@ static int screen_set_exec(bContext *C, wmOperator *op)
int delta= RNA_int_get(op->ptr, "delta");
/* temp screens are for userpref or render display */
- if(screen->temp)
+ if (screen->temp)
return OPERATOR_CANCELLED;
- if(delta==1) {
- while(tot--) {
+ if (delta==1) {
+ while (tot--) {
screen= screen->id.next;
- if(screen==NULL) screen= CTX_data_main(C)->screen.first;
- if(screen->winid==0 && screen->full==0 && screen != screen_prev)
+ if (screen==NULL) screen= CTX_data_main(C)->screen.first;
+ if (screen->winid==0 && screen->full==0 && screen != screen_prev)
break;
}
}
- else if(delta== -1) {
- while(tot--) {
+ else if (delta== -1) {
+ while (tot--) {
screen= screen->id.prev;
- if(screen==NULL) screen= CTX_data_main(C)->screen.last;
- if(screen->winid==0 && screen->full==0 && screen != screen_prev)
+ if (screen==NULL) screen= CTX_data_main(C)->screen.last;
+ if (screen->winid==0 && screen->full==0 && screen != screen_prev)
break;
}
}
@@ -2016,9 +2015,9 @@ static int screen_set_exec(bContext *C, wmOperator *op)
screen= NULL;
}
- if(screen && screen_prev != screen) {
+ if (screen && screen_prev != screen) {
/* return to previous state before switching screens */
- if(sa && sa->full) {
+ if (sa && sa->full) {
ED_screen_full_restore(C, sa); /* may free 'screen_prev' */
}
@@ -2031,11 +2030,11 @@ static int screen_set_exec(bContext *C, wmOperator *op)
static void SCREEN_OT_screen_set(wmOperatorType *ot)
{
ot->name = "Set Screen";
- ot->description= "Cycle through available screens";
+ ot->description = "Cycle through available screens";
ot->idname = "SCREEN_OT_screen_set";
- ot->exec= screen_set_exec;
- ot->poll= ED_operator_screenactive;
+ ot->exec = screen_set_exec;
+ ot->poll = ED_operator_screenactive;
/* rna */
RNA_def_int(ot->srna, "delta", 0, INT_MIN, INT_MAX, "Delta", "", INT_MIN, INT_MAX);
@@ -2056,7 +2055,7 @@ static int screen_full_area_exec(bContext *C, wmOperator *UNUSED(op))
if (sa->full) break;
}
- if(sa==NULL) sa= CTX_wm_area(C);
+ if (sa==NULL) sa= CTX_wm_area(C);
ED_screen_full_toggle(C, CTX_wm_window(C), sa);
return OPERATOR_FINISHED;
@@ -2065,12 +2064,12 @@ static int screen_full_area_exec(bContext *C, wmOperator *UNUSED(op))
static void SCREEN_OT_screen_full_area(wmOperatorType *ot)
{
ot->name = "Toggle Full Screen";
- ot->description= "Toggle display selected area as fullscreen";
+ ot->description = "Toggle display selected area as fullscreen";
ot->idname = "SCREEN_OT_screen_full_area";
- ot->exec= screen_full_area_exec;
- ot->poll= ED_operator_areaactive;
- ot->flag= 0;
+ ot->exec = screen_full_area_exec;
+ ot->poll = ED_operator_areaactive;
+ ot->flag = 0;
}
@@ -2079,31 +2078,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
@@ -2134,15 +2132,15 @@ static int area_join_init(bContext *C, wmOperator *op)
sa1 = screen_areahascursor(CTX_wm_screen(C), x1, y1);
sa2 = screen_areahascursor(CTX_wm_screen(C), x2, y2);
- if(sa1==NULL || sa2==NULL || sa1==sa2)
+ if (sa1==NULL || sa2==NULL || sa1==sa2)
return 0;
/* do areas share an edge? */
- if(sa1->v1==sa2->v1 || sa1->v1==sa2->v2 || sa1->v1==sa2->v3 || sa1->v1==sa2->v4) shared++;
- if(sa1->v2==sa2->v1 || sa1->v2==sa2->v2 || sa1->v2==sa2->v3 || sa1->v2==sa2->v4) shared++;
- if(sa1->v3==sa2->v1 || sa1->v3==sa2->v2 || sa1->v3==sa2->v3 || sa1->v3==sa2->v4) shared++;
- if(sa1->v4==sa2->v1 || sa1->v4==sa2->v2 || sa1->v4==sa2->v3 || sa1->v4==sa2->v4) shared++;
- if(shared!=2) {
+ if (sa1->v1==sa2->v1 || sa1->v1==sa2->v2 || sa1->v1==sa2->v3 || sa1->v1==sa2->v4) shared++;
+ if (sa1->v2==sa2->v1 || sa1->v2==sa2->v2 || sa1->v2==sa2->v3 || sa1->v2==sa2->v4) shared++;
+ if (sa1->v3==sa2->v1 || sa1->v3==sa2->v2 || sa1->v3==sa2->v3 || sa1->v3==sa2->v4) shared++;
+ if (sa1->v4==sa2->v1 || sa1->v4==sa2->v2 || sa1->v4==sa2->v3 || sa1->v4==sa2->v4) shared++;
+ if (shared!=2) {
printf("areas don't share edge\n");
return 0;
}
@@ -2165,7 +2163,7 @@ static int area_join_apply(bContext *C, wmOperator *op)
sAreaJoinData *jd = (sAreaJoinData *)op->customdata;
if (!jd) return 0;
- if(!screen_area_join(C, CTX_wm_screen(C), jd->sa1, jd->sa2)){
+ if (!screen_area_join(C, CTX_wm_screen(C), jd->sa1, jd->sa2)) {
return 0;
}
if (CTX_wm_area(C) == jd->sa2) {
@@ -2192,7 +2190,7 @@ static void area_join_exit(bContext *C, wmOperator *op)
static int area_join_exec(bContext *C, wmOperator *op)
{
- if(!area_join_init(C, op))
+ if (!area_join_init(C, op))
return OPERATOR_CANCELLED;
area_join_apply(C, op);
@@ -2205,19 +2203,19 @@ static int area_join_exec(bContext *C, wmOperator *op)
static int area_join_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if(event->type==EVT_ACTIONZONE_AREA) {
+ if (event->type==EVT_ACTIONZONE_AREA) {
sActionzoneData *sad= event->customdata;
- if(sad->modifier>0) {
+ if (sad->modifier>0) {
return OPERATOR_PASS_THROUGH;
}
/* verify *sad itself */
- if(sad==NULL || sad->sa1==NULL || sad->sa2==NULL)
+ if (sad==NULL || sad->sa1==NULL || sad->sa2==NULL)
return OPERATOR_PASS_THROUGH;
/* is this our *sad? if areas equal it should be passed on */
- if(sad->sa1==sad->sa2)
+ if (sad->sa1==sad->sa2)
return OPERATOR_PASS_THROUGH;
/* prepare operator state vars */
@@ -2228,7 +2226,7 @@ static int area_join_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
- if(!area_join_init(C, op))
+ if (!area_join_init(C, op))
return OPERATOR_PASS_THROUGH;
/* add temp handler */
@@ -2281,8 +2279,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) {
@@ -2329,7 +2327,7 @@ static int area_join_modal(bContext *C, wmOperator *op, wmEvent *event)
}
break;
case LEFTMOUSE:
- if(event->val==KM_RELEASE) {
+ if (event->val==KM_RELEASE) {
ED_area_tag_redraw(jd->sa1);
ED_area_tag_redraw(jd->sa2);
@@ -2352,18 +2350,18 @@ static int area_join_modal(bContext *C, wmOperator *op, wmEvent *event)
static void SCREEN_OT_area_join(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Join area";
- ot->description= "Join selected areas into new window";
- ot->idname= "SCREEN_OT_area_join";
+ ot->name = "Join area";
+ ot->description = "Join selected areas into new window";
+ ot->idname = "SCREEN_OT_area_join";
/* api callbacks */
- ot->exec= area_join_exec;
- ot->invoke= area_join_invoke;
- ot->modal= area_join_modal;
- ot->poll= screen_active_editable;
- ot->cancel= area_join_cancel;
+ ot->exec = area_join_exec;
+ ot->invoke = area_join_invoke;
+ ot->modal = area_join_modal;
+ ot->poll = screen_active_editable;
+ ot->cancel = area_join_cancel;
- ot->flag= OPTYPE_BLOCKING|OPTYPE_INTERNAL;
+ ot->flag = OPTYPE_BLOCKING|OPTYPE_INTERNAL;
/* rna */
RNA_def_int(ot->srna, "min_x", -100, INT_MIN, INT_MAX, "X 1", "", INT_MIN, INT_MAX);
@@ -2381,7 +2379,7 @@ static int screen_area_options_invoke(bContext *C, wmOperator *op, wmEvent *even
PointerRNA ptr1, ptr2;
ScrEdge *actedge= screen_find_active_scredge(CTX_wm_screen(C), event->x, event->y);
- if(actedge==NULL) return OPERATOR_CANCELLED;
+ if (actedge==NULL) return OPERATOR_CANCELLED;
pup= uiPupMenuBegin(C, op->type->name, ICON_NONE);
layout= uiPupMenuLayout(pup);
@@ -2411,14 +2409,14 @@ static int screen_area_options_invoke(bContext *C, wmOperator *op, wmEvent *even
static void SCREEN_OT_area_options(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Area Options";
- ot->description= "Operations for splitting and merging";
- ot->idname= "SCREEN_OT_area_options";
+ ot->name = "Area Options";
+ ot->description = "Operations for splitting and merging";
+ ot->idname = "SCREEN_OT_area_options";
/* api callbacks */
- ot->invoke= screen_area_options_invoke;
+ ot->invoke = screen_area_options_invoke;
- ot->poll= ED_operator_screen_mainwinactive;
+ ot->poll = ED_operator_screen_mainwinactive;
}
@@ -2432,9 +2430,9 @@ static int spacedata_cleanup(bContext *C, wmOperator *op)
ScrArea *sa;
int tot= 0;
- for(screen= bmain->screen.first; screen; screen= screen->id.next) {
- for(sa= screen->areabase.first; sa; sa= sa->next) {
- if(sa->spacedata.first != sa->spacedata.last) {
+ for (screen= bmain->screen.first; screen; screen= screen->id.next) {
+ for (sa= screen->areabase.first; sa; sa= sa->next) {
+ if (sa->spacedata.first != sa->spacedata.last) {
SpaceLink *sl= sa->spacedata.first;
BLI_remlink(&sa->spacedata, sl);
@@ -2452,13 +2450,13 @@ static int spacedata_cleanup(bContext *C, wmOperator *op)
static void SCREEN_OT_spacedata_cleanup(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clean-up space-data";
- ot->description= "Remove unused settings for invisible editors";
- ot->idname= "SCREEN_OT_spacedata_cleanup";
+ ot->name = "Clean-up space-data";
+ ot->description = "Remove unused settings for invisible editors";
+ ot->idname = "SCREEN_OT_spacedata_cleanup";
/* api callbacks */
- ot->exec= spacedata_cleanup;
- ot->poll= WM_operator_winactive;
+ ot->exec = spacedata_cleanup;
+ ot->poll = WM_operator_winactive;
}
@@ -2468,7 +2466,7 @@ static int repeat_last_exec(bContext *C, wmOperator *UNUSED(op))
{
wmOperator *lastop= CTX_wm_manager(C)->operators.last;
- if(lastop)
+ if (lastop)
WM_operator_repeat(C, lastop);
return OPERATOR_CANCELLED;
@@ -2477,14 +2475,14 @@ static int repeat_last_exec(bContext *C, wmOperator *UNUSED(op))
static void SCREEN_OT_repeat_last(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Repeat Last";
- ot->description= "Repeat last action";
- ot->idname= "SCREEN_OT_repeat_last";
+ ot->name = "Repeat Last";
+ ot->description = "Repeat last action";
+ ot->idname = "SCREEN_OT_repeat_last";
/* api callbacks */
- ot->exec= repeat_last_exec;
+ ot->exec = repeat_last_exec;
- ot->poll= ED_operator_screenactive;
+ ot->poll = ED_operator_screenactive;
}
@@ -2497,7 +2495,7 @@ static int repeat_history_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev
int items, i;
items= BLI_countlist(&wm->operators);
- if(items==0)
+ if (items==0)
return OPERATOR_CANCELLED;
pup= uiPupMenuBegin(C, op->type->name, ICON_NONE);
@@ -2516,7 +2514,7 @@ static int repeat_history_exec(bContext *C, wmOperator *op)
wmWindowManager *wm= CTX_wm_manager(C);
op= BLI_findlink(&wm->operators, RNA_int_get(op->ptr, "index"));
- if(op) {
+ if (op) {
/* let's put it as last operator in list */
BLI_remlink(&wm->operators, op);
BLI_addtail(&wm->operators, op);
@@ -2530,15 +2528,15 @@ static int repeat_history_exec(bContext *C, wmOperator *op)
static void SCREEN_OT_repeat_history(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Repeat History";
- ot->description= "Display menu for previous actions performed";
- ot->idname= "SCREEN_OT_repeat_history";
+ ot->name = "Repeat History";
+ ot->description = "Display menu for previous actions performed";
+ ot->idname = "SCREEN_OT_repeat_history";
/* api callbacks */
- ot->invoke= repeat_history_invoke;
- ot->exec= repeat_history_exec;
+ ot->invoke = repeat_history_invoke;
+ ot->exec = repeat_history_exec;
- ot->poll= ED_operator_screenactive;
+ ot->poll = ED_operator_screenactive;
RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "", 0, 1000);
}
@@ -2549,7 +2547,7 @@ static int redo_last_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED
{
wmOperator *lastop= WM_operator_last_redo(C);
- if(lastop)
+ if (lastop)
WM_operator_redo_popup(C, lastop);
return OPERATOR_CANCELLED;
@@ -2558,14 +2556,14 @@ static int redo_last_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED
static void SCREEN_OT_redo_last(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Redo Last";
- ot->description= "Display menu for last action performed";
- ot->idname= "SCREEN_OT_redo_last";
+ ot->name = "Redo Last";
+ ot->description = "Display menu for last action performed";
+ ot->idname = "SCREEN_OT_redo_last";
/* api callbacks */
- ot->invoke= redo_last_invoke;
+ ot->invoke = redo_last_invoke;
- ot->poll= ED_operator_screenactive;
+ ot->poll = ED_operator_screenactive;
}
/* ************** region four-split operator ***************************** */
@@ -2576,24 +2574,24 @@ static int region_quadview_exec(bContext *C, wmOperator *op)
ARegion *ar= CTX_wm_region(C);
/* some rules... */
- if(ar->regiontype!=RGN_TYPE_WINDOW)
+ if (ar->regiontype!=RGN_TYPE_WINDOW)
BKE_report(op->reports, RPT_ERROR, "Only window region can be 4-splitted");
- else if(ar->alignment==RGN_ALIGN_QSPLIT) {
+ else if (ar->alignment==RGN_ALIGN_QSPLIT) {
ScrArea *sa= CTX_wm_area(C);
ARegion *arn;
/* keep current region */
ar->alignment= 0;
- if(sa->spacetype==SPACE_VIEW3D) {
+ if (sa->spacetype==SPACE_VIEW3D) {
RegionView3D *rv3d= ar->regiondata;
rv3d->viewlock= 0;
rv3d->rflag &= ~RV3D_CLIPPING;
}
- for(ar= sa->regionbase.first; ar; ar= arn) {
+ for (ar= sa->regionbase.first; ar; ar= arn) {
arn= ar->next;
- if(ar->alignment==RGN_ALIGN_QSPLIT) {
+ if (ar->alignment==RGN_ALIGN_QSPLIT) {
ED_region_exit(C, ar);
BKE_area_region_free(sa->type, ar);
BLI_remlink(&sa->regionbase, ar);
@@ -2603,7 +2601,7 @@ static int region_quadview_exec(bContext *C, wmOperator *op)
ED_area_tag_redraw(sa);
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
}
- else if(ar->next)
+ else if (ar->next)
BKE_report(op->reports, RPT_ERROR, "Only last region can be 4-splitted");
else {
ScrArea *sa= CTX_wm_area(C);
@@ -2612,13 +2610,13 @@ static int region_quadview_exec(bContext *C, wmOperator *op)
ar->alignment= RGN_ALIGN_QSPLIT;
- for(count=0; count<3; count++) {
+ for (count=0; count<3; count++) {
newar= BKE_area_region_copy(sa->type, ar);
BLI_addtail(&sa->regionbase, newar);
}
/* lock views and set them */
- if(sa->spacetype==SPACE_VIEW3D) {
+ if (sa->spacetype==SPACE_VIEW3D) {
/* run ED_view3d_lock() so the correct 'rv3d->viewquat' is set,
* otherwise when restoring rv3d->localvd the 'viewquat' won't
* match the 'view', set on entering localview See: [#26315],
@@ -2661,15 +2659,15 @@ static int region_quadview_exec(bContext *C, wmOperator *op)
static void SCREEN_OT_region_quadview(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Quad View";
- ot->description= "Split selected area into camera, front, right & top views";
- ot->idname= "SCREEN_OT_region_quadview";
+ ot->name = "Toggle Quad View";
+ ot->description = "Split selected area into camera, front, right & top views";
+ ot->idname = "SCREEN_OT_region_quadview";
/* api callbacks */
- // ot->invoke= WM_operator_confirm;
- ot->exec= region_quadview_exec;
- ot->poll= ED_operator_region_view3d_active;
- ot->flag= 0;
+ // ot->invoke = WM_operator_confirm;
+ ot->exec = region_quadview_exec;
+ ot->poll = ED_operator_region_view3d_active;
+ ot->flag = 0;
}
@@ -2684,13 +2682,13 @@ static int region_flip_exec(bContext *C, wmOperator *UNUSED(op))
if (!ar)
return OPERATOR_CANCELLED;
- if(ar->alignment==RGN_ALIGN_TOP)
+ if (ar->alignment==RGN_ALIGN_TOP)
ar->alignment= RGN_ALIGN_BOTTOM;
- else if(ar->alignment==RGN_ALIGN_BOTTOM)
+ else if (ar->alignment==RGN_ALIGN_BOTTOM)
ar->alignment= RGN_ALIGN_TOP;
- else if(ar->alignment==RGN_ALIGN_LEFT)
+ else if (ar->alignment==RGN_ALIGN_LEFT)
ar->alignment= RGN_ALIGN_RIGHT;
- else if(ar->alignment==RGN_ALIGN_RIGHT)
+ else if (ar->alignment==RGN_ALIGN_RIGHT)
ar->alignment= RGN_ALIGN_LEFT;
ED_area_tag_redraw(CTX_wm_area(C));
@@ -2703,13 +2701,13 @@ static int region_flip_exec(bContext *C, wmOperator *UNUSED(op))
static void SCREEN_OT_region_flip(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Flip Region";
- ot->idname= "SCREEN_OT_region_flip";
+ ot->name = "Flip Region";
+ ot->idname = "SCREEN_OT_region_flip";
/* api callbacks */
- ot->exec= region_flip_exec;
- ot->poll= ED_operator_areaactive;
- ot->flag= 0;
+ ot->exec = region_flip_exec;
+ ot->poll = ED_operator_areaactive;
+ ot->flag = 0;
}
/* ************** header flip operator ***************************** */
@@ -2722,23 +2720,23 @@ static int header_flip_exec(bContext *C, wmOperator *UNUSED(op))
/* find the header region
* - try context first, but upon failing, search all regions in area...
*/
- if((ar == NULL) || (ar->regiontype != RGN_TYPE_HEADER)) {
+ if ((ar == NULL) || (ar->regiontype != RGN_TYPE_HEADER)) {
ScrArea *sa= CTX_wm_area(C);
ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
/* don't do anything if no region */
- if(ar == NULL)
+ if (ar == NULL)
return OPERATOR_CANCELLED;
}
/* copied from SCREEN_OT_region_flip */
- if(ar->alignment==RGN_ALIGN_TOP)
+ if (ar->alignment==RGN_ALIGN_TOP)
ar->alignment= RGN_ALIGN_BOTTOM;
- else if(ar->alignment==RGN_ALIGN_BOTTOM)
+ else if (ar->alignment==RGN_ALIGN_BOTTOM)
ar->alignment= RGN_ALIGN_TOP;
- else if(ar->alignment==RGN_ALIGN_LEFT)
+ else if (ar->alignment==RGN_ALIGN_LEFT)
ar->alignment= RGN_ALIGN_RIGHT;
- else if(ar->alignment==RGN_ALIGN_RIGHT)
+ else if (ar->alignment==RGN_ALIGN_RIGHT)
ar->alignment= RGN_ALIGN_LEFT;
ED_area_tag_redraw(CTX_wm_area(C));
@@ -2752,14 +2750,14 @@ static int header_flip_exec(bContext *C, wmOperator *UNUSED(op))
static void SCREEN_OT_header_flip(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Flip Header Region";
- ot->idname= "SCREEN_OT_header_flip";
+ ot->name = "Flip Header Region";
+ ot->idname = "SCREEN_OT_header_flip";
/* api callbacks */
- ot->exec= header_flip_exec;
+ ot->exec = header_flip_exec;
- ot->poll= ED_operator_areaactive;
- ot->flag= 0;
+ ot->poll = ED_operator_areaactive;
+ ot->flag = 0;
}
/* ************** header tools operator ***************************** */
@@ -2798,12 +2796,12 @@ static int header_toolbox_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *U
static void SCREEN_OT_header_toolbox(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Header Toolbox";
- ot->description="Display header region toolbox";
- ot->idname= "SCREEN_OT_header_toolbox";
+ ot->name = "Header Toolbox";
+ ot->description = "Display header region toolbox";
+ ot->idname = "SCREEN_OT_header_toolbox";
/* api callbacks */
- ot->invoke= header_toolbox_invoke;
+ ot->invoke = header_toolbox_invoke;
}
/* ****************** anim player, with timer ***************** */
@@ -2822,68 +2820,68 @@ static int match_area_with_refresh(int spacetype, int refresh)
static int match_region_with_redraws(int spacetype, int regiontype, int redraws)
{
- if(regiontype==RGN_TYPE_WINDOW) {
+ if (regiontype==RGN_TYPE_WINDOW) {
switch (spacetype) {
case SPACE_VIEW3D:
- if(redraws & TIME_ALL_3D_WIN)
+ if (redraws & TIME_ALL_3D_WIN)
return 1;
break;
case SPACE_IPO:
case SPACE_ACTION:
case SPACE_NLA:
- if(redraws & TIME_ALL_ANIM_WIN)
+ if (redraws & TIME_ALL_ANIM_WIN)
return 1;
break;
case SPACE_TIME:
/* if only 1 window or 3d windows, we do timeline too */
- if(redraws & (TIME_ALL_ANIM_WIN|TIME_REGION|TIME_ALL_3D_WIN))
+ if (redraws & (TIME_ALL_ANIM_WIN|TIME_REGION|TIME_ALL_3D_WIN))
return 1;
break;
case SPACE_BUTS:
- if(redraws & TIME_ALL_BUTS_WIN)
+ if (redraws & TIME_ALL_BUTS_WIN)
return 1;
break;
case SPACE_SEQ:
- if(redraws & (TIME_SEQ|TIME_ALL_ANIM_WIN))
+ if (redraws & (TIME_SEQ|TIME_ALL_ANIM_WIN))
return 1;
break;
case SPACE_NODE:
- if(redraws & (TIME_NODES))
+ if (redraws & (TIME_NODES))
return 1;
break;
case SPACE_IMAGE:
- if(redraws & TIME_ALL_IMAGE_WIN)
+ if (redraws & TIME_ALL_IMAGE_WIN)
return 1;
break;
case SPACE_CLIP:
- if(redraws & TIME_CLIPS)
+ if (redraws & TIME_CLIPS)
return 1;
break;
}
}
- else if(regiontype==RGN_TYPE_UI) {
- if(spacetype==SPACE_CLIP) {
+ 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;
}
- if(redraws & TIME_ALL_BUTS_WIN)
+ if (redraws & TIME_ALL_BUTS_WIN)
return 1;
}
- else if(regiontype==RGN_TYPE_HEADER) {
- if(spacetype==SPACE_TIME)
+ else if (regiontype==RGN_TYPE_HEADER) {
+ if (spacetype==SPACE_TIME)
return 1;
}
else if (regiontype==RGN_TYPE_PREVIEW) {
switch (spacetype) {
case SPACE_SEQ:
- if(redraws & (TIME_SEQ|TIME_ALL_ANIM_WIN))
+ if (redraws & (TIME_SEQ|TIME_ALL_ANIM_WIN))
return 1;
break;
case SPACE_CLIP:
@@ -2897,7 +2895,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e
{
bScreen *screen= CTX_wm_screen(C);
- if(screen->animtimer && screen->animtimer==event->customdata) {
+ if (screen->animtimer && screen->animtimer==event->customdata) {
Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
wmTimer *wt= screen->animtimer;
@@ -2911,18 +2909,20 @@ 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);
+ int step = floor((wt->duration - sad->last_duration) * FPS);
/* skip frames */
if (sad->flag & ANIMPLAY_FLAG_REVERSE)
scene->r.cfra -= step;
else
scene->r.cfra += step;
- wt->duration -= ((double)step)/FPS;
}
else {
/* one frame +/- */
@@ -2933,6 +2933,8 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e
}
}
+ sad->last_duration = wt->duration;
+
/* reset 'jumped' flag before checking if we need to jump... */
sad->flag &= ~ANIMPLAY_FLAG_JUMPED;
@@ -2968,7 +2970,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e
}
/* next frame overriden by user action (pressed jump to first/last frame) */
- if(sad->flag & ANIMPLAY_FLAG_USE_NEXT_FRAME) {
+ if (sad->flag & ANIMPLAY_FLAG_USE_NEXT_FRAME) {
scene->r.cfra = sad->nextfra;
sad->flag &= ~ANIMPLAY_FLAG_USE_NEXT_FRAME;
sad->flag |= ANIMPLAY_FLAG_JUMPED;
@@ -3014,14 +3016,14 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e
static void SCREEN_OT_animation_step(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Animation Step";
- ot->description= "Step through animation by position";
- ot->idname= "SCREEN_OT_animation_step";
+ ot->name = "Animation Step";
+ ot->description = "Step through animation by position";
+ ot->idname = "SCREEN_OT_animation_step";
/* api callbacks */
- ot->invoke= screen_animation_step;
+ ot->invoke = screen_animation_step;
- ot->poll= ED_operator_screenactive_norender;
+ ot->poll = ED_operator_screenactive_norender;
}
@@ -3070,18 +3072,22 @@ static int screen_animation_play_exec(bContext *C, wmOperator *op)
static void SCREEN_OT_animation_play(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
- ot->name= "Play Animation";
- ot->description= "Play animation";
- ot->idname= "SCREEN_OT_animation_play";
+ ot->name = "Play Animation";
+ ot->description = "Play animation";
+ ot->idname = "SCREEN_OT_animation_play";
/* api callbacks */
- ot->exec= screen_animation_play_exec;
+ ot->exec = screen_animation_play_exec;
- ot->poll= ED_operator_screenactive_norender;
+ ot->poll = ED_operator_screenactive_norender;
- RNA_def_boolean(ot->srna, "reverse", 0, "Play in Reverse", "Animation is played backwards");
- RNA_def_boolean(ot->srna, "sync", 0, "Sync", "Drop frames to maintain framerate");
+ prop = RNA_def_boolean(ot->srna, "reverse", 0, "Play in Reverse", "Animation is played backwards");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ prop = RNA_def_boolean(ot->srna, "sync", 0, "Sync", "Drop frames to maintain framerate");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
static int screen_animation_cancel_exec(bContext *C, wmOperator *op)
@@ -3089,7 +3095,7 @@ static int screen_animation_cancel_exec(bContext *C, wmOperator *op)
bScreen *screen= CTX_wm_screen(C);
if (screen->animtimer) {
- if(RNA_boolean_get(op->ptr, "restore_frame")) {
+ if (RNA_boolean_get(op->ptr, "restore_frame")) {
ScreenAnimData *sad= screen->animtimer->customdata;
Scene *scene= CTX_data_scene(C);
@@ -3111,14 +3117,14 @@ static int screen_animation_cancel_exec(bContext *C, wmOperator *op)
static void SCREEN_OT_animation_cancel(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Cancel Animation";
- ot->description= "Cancel animation, returning to the original frame";
- ot->idname= "SCREEN_OT_animation_cancel";
+ ot->name = "Cancel Animation";
+ ot->description = "Cancel animation, returning to the original frame";
+ ot->idname = "SCREEN_OT_animation_cancel";
/* api callbacks */
- ot->exec= screen_animation_cancel_exec;
+ ot->exec = screen_animation_cancel_exec;
- ot->poll= ED_operator_screenactive;
+ ot->poll = ED_operator_screenactive;
RNA_def_boolean(ot->srna, "restore_frame", TRUE, "Restore Frame", "Restore the frame when animation was initialized");
}
@@ -3126,31 +3132,31 @@ 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)
{
int event_type= RNA_int_get(op->ptr, "event_type");
- if(event_type==LEFTMOUSE)
+ if (event_type==LEFTMOUSE)
printf("border select do select\n");
- else if(event_type==RIGHTMOUSE)
+ else if (event_type==RIGHTMOUSE)
printf("border select deselect\n");
else
printf("border select do something\n");
@@ -3161,16 +3167,16 @@ static int border_select_do(bContext *C, wmOperator *op)
static void SCREEN_OT_border_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Border select";
- ot->idname= "SCREEN_OT_border_select";
+ ot->name = "Border select";
+ ot->idname = "SCREEN_OT_border_select";
/* api callbacks */
- ot->exec= border_select_do;
- ot->invoke= WM_border_select_invoke;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->exec = border_select_do;
+ ot->invoke = WM_border_select_invoke;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= ED_operator_areaactive;
+ ot->poll = ED_operator_areaactive;
/* rna */
RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX);
@@ -3207,13 +3213,13 @@ static int fullscreen_back_exec(bContext *C, wmOperator *op)
static void SCREEN_OT_back_to_previous(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Back to Previous Screen";
- ot->description= "Revert back to the original screen layout, before fullscreen area overlay";
- ot->idname= "SCREEN_OT_back_to_previous";
+ ot->name = "Back to Previous Screen";
+ ot->description = "Revert back to the original screen layout, before fullscreen area overlay";
+ ot->idname = "SCREEN_OT_back_to_previous";
/* api callbacks */
- ot->exec= fullscreen_back_exec;
- ot->poll= ED_operator_screenactive;
+ ot->exec = fullscreen_back_exec;
+ ot->poll = ED_operator_screenactive;
}
/* *********** show user pref window ****** */
@@ -3227,10 +3233,10 @@ static int userpref_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *ev
sizey= 480;
/* some magic to calculate postition */
- rect.xmin= event->x + CTX_wm_window(C)->posx - sizex/2;
- rect.ymin= event->y + CTX_wm_window(C)->posy - sizey/2;
- rect.xmax= rect.xmin + sizex;
- rect.ymax= rect.ymin + sizey;
+ rect.xmin = event->x + CTX_wm_window(C)->posx - sizex/2;
+ rect.ymin = event->y + CTX_wm_window(C)->posy - sizey/2;
+ rect.xmax = rect.xmin + sizex;
+ rect.ymax = rect.ymin + sizey;
/* changes context! */
WM_window_open_temp(C, &rect, WM_WINDOW_USERPREFS);
@@ -3242,13 +3248,13 @@ static int userpref_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *ev
static void SCREEN_OT_userpref_show(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Show/Hide User Preferences";
- ot->description= "Show/hide user preferences";
- ot->idname= "SCREEN_OT_userpref_show";
+ ot->name = "Show/Hide User Preferences";
+ ot->description = "Show/hide user preferences";
+ ot->idname = "SCREEN_OT_userpref_show";
/* api callbacks */
- ot->invoke= userpref_show_invoke;
- ot->poll= ED_operator_screenactive;
+ ot->invoke = userpref_show_invoke;
+ ot->poll = ED_operator_screenactive;
}
/********************* new screen operator *********************/
@@ -3267,16 +3273,16 @@ static int screen_new_exec(bContext *C, wmOperator *UNUSED(op))
static void SCREEN_OT_new(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "New Screen";
- ot->description= "Add a new screen";
- ot->idname= "SCREEN_OT_new";
+ ot->name = "New Screen";
+ ot->description = "Add a new screen";
+ ot->idname = "SCREEN_OT_new";
/* api callbacks */
- ot->exec= screen_new_exec;
- ot->poll= WM_operator_winactive;
+ ot->exec = screen_new_exec;
+ ot->poll = WM_operator_winactive;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************* delete screen operator *********************/
@@ -3293,15 +3299,15 @@ static int screen_delete_exec(bContext *C, wmOperator *UNUSED(op))
static void SCREEN_OT_delete(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Screen"; //was scene
- ot->description= "Delete active screen";
- ot->idname= "SCREEN_OT_delete";
+ ot->name = "Delete Screen"; //was scene
+ ot->description = "Delete active screen";
+ ot->idname = "SCREEN_OT_delete";
/* api callbacks */
- ot->exec= screen_delete_exec;
+ ot->exec = screen_delete_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************* new scene operator *********************/
@@ -3312,22 +3318,22 @@ static int scene_new_exec(bContext *C, wmOperator *op)
Main *bmain= CTX_data_main(C);
int type= RNA_enum_get(op->ptr, "type");
- if(type == SCE_COPY_NEW) {
+ if (type == SCE_COPY_NEW) {
newscene= add_scene("Scene");
}
else { /* different kinds of copying */
newscene= copy_scene(scene, type);
/* these can't be handled in blenkernel curently, so do them here */
- if(type == SCE_COPY_LINK_DATA) {
+ if (type == SCE_COPY_LINK_DATA) {
ED_object_single_users(bmain, newscene, 0);
}
- else if(type == SCE_COPY_FULL) {
+ else if (type == SCE_COPY_FULL) {
ED_object_single_users(bmain, newscene, 1);
}
}
- 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);
@@ -3345,19 +3351,19 @@ static void SCENE_OT_new(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "New Scene";
- ot->description= "Add new scene by type";
- ot->idname= "SCENE_OT_new";
+ ot->name = "New Scene";
+ ot->description = "Add new scene by type";
+ ot->idname = "SCENE_OT_new";
/* api callbacks */
- ot->exec= scene_new_exec;
- ot->invoke= WM_menu_invoke;
+ ot->exec = scene_new_exec;
+ ot->invoke = WM_menu_invoke;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "");
}
/********************* delete scene operator *********************/
@@ -3368,7 +3374,7 @@ static int scene_delete_exec(bContext *C, wmOperator *UNUSED(op))
ED_screen_delete_scene(C, scene);
- if(G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("scene delete %p\n", scene);
WM_event_add_notifier(C, NC_SCENE|NA_REMOVED, scene);
@@ -3379,15 +3385,15 @@ static int scene_delete_exec(bContext *C, wmOperator *UNUSED(op))
static void SCENE_OT_delete(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Scene";
- ot->description= "Delete active scene";
- ot->idname= "SCENE_OT_delete";
+ ot->name = "Delete Scene";
+ ot->description = "Delete active scene";
+ ot->idname = "SCENE_OT_delete";
/* api callbacks */
- ot->exec= scene_delete_exec;
+ ot->exec = scene_delete_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* **************** Assigning operatortypes to global list, adding handlers **************** */
@@ -3472,8 +3478,8 @@ static void keymap_modal_set(wmKeyConfig *keyconf)
static int open_file_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
- if(drag->type==WM_DRAG_PATH) {
- if(drag->icon==ICON_FILE_BLEND)
+ if (drag->type==WM_DRAG_PATH) {
+ if (drag->icon==ICON_FILE_BLEND)
return 1;
}
return 0;
@@ -3495,7 +3501,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
/* Screen Editing ------------------------------------------------ */
- keymap= WM_keymap_find(keyconf, "Screen Editing", 0, 0);
+ keymap = WM_keymap_find(keyconf, "Screen Editing", 0, 0);
RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_actionzone", LEFTMOUSE, KM_PRESS, 0, 0)->ptr, "modifier", 0);
RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_actionzone", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "modifier", 1);
@@ -3514,12 +3520,12 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
/* Header Editing ------------------------------------------------ */
- keymap= WM_keymap_find(keyconf, "Header", 0, 0);
+ keymap = WM_keymap_find(keyconf, "Header", 0, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_header_toolbox", RIGHTMOUSE, KM_PRESS, 0, 0);
/* Screen General ------------------------------------------------ */
- keymap= WM_keymap_find(keyconf, "Screen", 0, 0);
+ keymap = WM_keymap_find(keyconf, "Screen", 0, 0);
/* standard timers */
WM_keymap_add_item(keymap, "SCREEN_OT_animation_step", TIMER0, KM_ANY, KM_ANY, 0);
@@ -3573,7 +3579,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
/* Anim Playback ------------------------------------------------ */
- keymap= WM_keymap_find(keyconf, "Frames", 0, 0);
+ keymap = WM_keymap_find(keyconf, "Frames", 0, 0);
/* frame offsets */
RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", UPARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "delta", 10);
@@ -3589,10 +3595,15 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", TRUE);
RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", FALSE);
- WM_keymap_add_item(keymap, "SCREEN_OT_keyframe_jump", UPARROWKEY, KM_PRESS, 0, 0);
- RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_keyframe_jump", DOWNARROWKEY, KM_PRESS, 0, 0)->ptr, "next", FALSE);
+ kmi = WM_keymap_add_item(keymap, "SCREEN_OT_keyframe_jump", UPARROWKEY, KM_PRESS, 0, 0);
+ RNA_boolean_set(kmi->ptr, "next", TRUE);
+
+ kmi = WM_keymap_add_item(keymap, "SCREEN_OT_keyframe_jump", DOWNARROWKEY, KM_PRESS, 0, 0);
+ RNA_boolean_set(kmi->ptr, "next", FALSE);
- WM_keymap_add_item(keymap, "SCREEN_OT_keyframe_jump", MEDIALAST, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "SCREEN_OT_keyframe_jump", MEDIALAST, KM_PRESS, 0, 0);
+ RNA_boolean_set(kmi->ptr, "next", TRUE);
+
kmi = WM_keymap_add_item(keymap, "SCREEN_OT_keyframe_jump", MEDIAFIRST, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "next", FALSE);
@@ -3606,7 +3617,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
/* Alternative keys for animation and sequencer playing */
#if 0 // XXX: disabled for restoring later... bad implementation
- keymap= WM_keymap_find(keyconf, "Frames", 0, 0);
+ keymap = WM_keymap_find(keyconf, "Frames", 0, 0);
kmi = WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "cycle_speed", TRUE);
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index deeb3061ad5..e12e6b0ef82 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -106,14 +106,14 @@ static int screenshot_data_create(bContext *C, wmOperator *op)
dumprect= screenshot(C, &dumpsx, &dumpsy);
- if(dumprect) {
+ if (dumprect) {
ScreenshotData *scd= MEM_callocN(sizeof(ScreenshotData), "screenshot");
ScrArea *sa= CTX_wm_area(C);
scd->dumpsx= dumpsx;
scd->dumpsy= dumpsy;
scd->dumprect= dumprect;
- if(sa)
+ if (sa)
scd->crop= sa->totrct;
op->customdata= scd;
@@ -129,8 +129,8 @@ static void screenshot_data_free(wmOperator *op)
{
ScreenshotData *scd= op->customdata;
- if(scd) {
- if(scd->dumprect)
+ if (scd) {
+ if (scd->dumprect)
MEM_freeN(scd->dumprect);
MEM_freeN(scd);
op->customdata= NULL;
@@ -143,8 +143,8 @@ static void screenshot_crop(ImBuf *ibuf, rcti crop)
unsigned int *from= ibuf->rect + crop.ymin*ibuf->x + crop.xmin;
int y, cropw= crop.xmax - crop.xmin, croph = crop.ymax - crop.ymin;
- if(cropw > 0 && croph > 0) {
- for(y=0; y<croph; y++, to+=cropw, from+=ibuf->x)
+ if (cropw > 0 && croph > 0) {
+ for (y=0; y<croph; y++, to+=cropw, from+=ibuf->x)
memmove(to, from, sizeof(unsigned int)*cropw);
ibuf->x= cropw;
@@ -156,14 +156,14 @@ static int screenshot_exec(bContext *C, wmOperator *op)
{
ScreenshotData *scd= op->customdata;
- if(scd == NULL) {
+ if (scd == NULL) {
/* when running exec directly */
screenshot_data_create(C, op);
scd= op->customdata;
}
- if(scd) {
- if(scd->dumprect) {
+ if (scd) {
+ if (scd->dumprect) {
Scene *scene= CTX_data_scene(C);
ImBuf *ibuf;
char path[FILE_MAX];
@@ -174,15 +174,15 @@ static int screenshot_exec(bContext *C, wmOperator *op)
BLI_path_abs(path, G.main->name);
/* BKE_add_image_extension() checks for if extension was already set */
- if(scene->r.scemode & R_EXTENSION)
- if(strlen(path)<FILE_MAX-5)
+ if (scene->r.scemode & R_EXTENSION)
+ if (strlen(path)<FILE_MAX-5)
BKE_add_image_extension(path, scene->r.im_format.imtype);
ibuf= IMB_allocImBuf(scd->dumpsx, scd->dumpsy, 24, 0);
ibuf->rect= scd->dumprect;
/* crop to show only single editor */
- if(!RNA_boolean_get(op->ptr, "full"))
+ if (!RNA_boolean_get(op->ptr, "full"))
screenshot_crop(ibuf, scd->crop);
BKE_write_ibuf(ibuf, path, &scene->r.im_format);
@@ -197,8 +197,8 @@ static int screenshot_exec(bContext *C, wmOperator *op)
static int screenshot_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- if(screenshot_data_create(C, op)) {
- if(RNA_struct_property_is_set(op->ptr, "filepath"))
+ if (screenshot_data_create(C, op)) {
+ if (RNA_struct_property_is_set(op->ptr, "filepath"))
return screenshot_exec(C, op);
RNA_string_set(op->ptr, "filepath", G.ima);
@@ -218,15 +218,15 @@ static int screenshot_cancel(bContext *UNUSED(C), wmOperator *op)
void SCREEN_OT_screenshot(wmOperatorType *ot)
{
- ot->name= "Save Screenshot"; /* weak: opname starting with 'save' makes filewindow give save-over */
- ot->idname= "SCREEN_OT_screenshot";
+ ot->name = "Save Screenshot"; /* weak: opname starting with 'save' makes filewindow give save-over */
+ ot->idname = "SCREEN_OT_screenshot";
- ot->invoke= screenshot_invoke;
- ot->exec= screenshot_exec;
- ot->poll= WM_operator_winactive;
- ot->cancel= screenshot_cancel;
+ ot->invoke = screenshot_invoke;
+ ot->exec = screenshot_exec;
+ ot->poll = WM_operator_winactive;
+ ot->cancel = screenshot_cancel;
- ot->flag= 0;
+ ot->flag = 0;
WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "");
@@ -249,7 +249,7 @@ static void screenshot_freejob(void *sjv)
{
ScreenshotJob *sj= sjv;
- if(sj->dumprect)
+ if (sj->dumprect)
MEM_freeN(sj->dumprect);
MEM_freeN(sj);
@@ -262,7 +262,7 @@ static void screenshot_updatejob(void *sjv)
ScreenshotJob *sj= sjv;
unsigned int *dumprect;
- if(sj->dumprect==NULL) {
+ if (sj->dumprect==NULL) {
dumprect= MEM_mallocN(sizeof(int) * sj->dumpsx * sj->dumpsy, "dumprect");
glReadPixels(sj->x, sj->y, sj->dumpsx, sj->dumpsy, GL_RGBA, GL_UNSIGNED_BYTE, dumprect);
glFinish();
@@ -283,8 +283,8 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float
rd.frs_sec= U.scrcastfps;
rd.frs_sec_base= 1.0f;
- if(BKE_imtype_is_movie(rd.im_format.imtype)) {
- if(!mh->start_movie(sj->scene, &rd, sj->dumpsx, sj->dumpsy, &sj->reports)) {
+ if (BKE_imtype_is_movie(rd.im_format.imtype)) {
+ if (!mh->start_movie(sj->scene, &rd, sj->dumpsx, sj->dumpsy, &sj->reports)) {
printf("screencast job stopped\n");
return;
}
@@ -297,18 +297,20 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float
*do_update= 1; // wait for opengl rect
- while(*stop==0) {
+ while (*stop==0) {
- if(sj->dumprect) {
+ if (sj->dumprect) {
- if(mh) {
- if(mh->append_movie(&rd, rd.sfra, rd.cfra, (int *)sj->dumprect,
+ if (mh) {
+ if (mh->append_movie(&rd, rd.sfra, rd.cfra, (int *)sj->dumprect,
sj->dumpsx, sj->dumpsy, &sj->reports))
{
BKE_reportf(&sj->reports, RPT_INFO, "Appended frame: %d", rd.cfra);
printf("Appended frame %d\n", rd.cfra);
- } else
+ }
+ else {
break;
+ }
}
else {
ImBuf *ibuf= IMB_allocImBuf(sj->dumpsx, sj->dumpsy, rd.im_format.planes, 0);
@@ -320,7 +322,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float
ibuf->rect= sj->dumprect;
ok= BKE_write_ibuf(ibuf, name, &rd.im_format);
- if(ok==0) {
+ if (ok==0) {
printf("Write error: cannot save %s\n", name);
BKE_reportf(&sj->reports, RPT_INFO, "Write error: cannot save %s\n", name);
break;
@@ -346,7 +348,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float
PIL_sleep_ms(U.scrcastwait);
}
- if(mh)
+ if (mh)
mh->end_movie();
BKE_report(&sj->reports, RPT_INFO, "Screencast job stopped");
@@ -359,7 +361,7 @@ static int screencast_exec(bContext *C, wmOperator *op)
ScreenshotJob *sj= MEM_callocN(sizeof(ScreenshotJob), "screenshot job");
/* setup sj */
- if(RNA_boolean_get(op->ptr, "full")) {
+ if (RNA_boolean_get(op->ptr, "full")) {
wmWindow *win= CTX_wm_window(C);
sj->x= 0;
sj->y= 0;
@@ -392,14 +394,14 @@ static int screencast_exec(bContext *C, wmOperator *op)
void SCREEN_OT_screencast(wmOperatorType *ot)
{
- ot->name= "Make Screencast";
- ot->idname= "SCREEN_OT_screencast";
+ ot->name = "Make Screencast";
+ ot->idname = "SCREEN_OT_screencast";
- ot->invoke= WM_operator_confirm;
- ot->exec= screencast_exec;
- ot->poll= WM_operator_winactive;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = screencast_exec;
+ ot->poll = WM_operator_winactive;
- ot->flag= 0;
+ ot->flag = 0;
RNA_def_property(ot->srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "");
diff --git a/source/blender/editors/sculpt_paint/CMakeLists.txt b/source/blender/editors/sculpt_paint/CMakeLists.txt
index 8a6a236d10f..cf8179b4d0e 100644
--- a/source/blender/editors/sculpt_paint/CMakeLists.txt
+++ b/source/blender/editors/sculpt_paint/CMakeLists.txt
@@ -40,6 +40,7 @@ set(INC_SYS
set(SRC
paint_cursor.c
+ paint_hide.c
paint_image.c
paint_ops.c
paint_stroke.c
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 0148f11b930..5d4710accad 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 {
@@ -76,26 +76,26 @@ typedef struct Snapshot {
int curve_changed_timestamp;
} Snapshot;
-static int same_snap(Snapshot* snap, Brush* brush, ViewContext* vc)
+static int same_snap(Snapshot *snap, Brush *brush, ViewContext *vc)
{
- MTex* mtex = &brush->mtex;
+ MTex *mtex = &brush->mtex;
return (((mtex->tex) &&
- equals_v3v3(mtex->ofs, snap->ofs) &&
- equals_v3v3(mtex->size, snap->size) &&
- mtex->rot == snap->rot) &&
-
- /* make brush smaller shouldn't cause a resample */
- ((mtex->brush_map_mode == MTEX_MAP_MODE_FIXED &&
- (brush_size(vc->scene, brush) <= snap->brush_size)) ||
- (brush_size(vc->scene, brush) == snap->brush_size)) &&
-
- (mtex->brush_map_mode == snap->brush_map_mode) &&
- (vc->ar->winx == snap->winx) &&
- (vc->ar->winy == snap->winy));
+ equals_v3v3(mtex->ofs, snap->ofs) &&
+ equals_v3v3(mtex->size, snap->size) &&
+ mtex->rot == snap->rot) &&
+
+ /* make brush smaller shouldn't cause a resample */
+ ((mtex->brush_map_mode == MTEX_MAP_MODE_FIXED &&
+ (brush_size(vc->scene, brush) <= snap->brush_size)) ||
+ (brush_size(vc->scene, brush) == snap->brush_size)) &&
+
+ (mtex->brush_map_mode == snap->brush_map_mode) &&
+ (vc->ar->winx == snap->winx) &&
+ (vc->ar->winy == snap->winy));
}
-static void make_snap(Snapshot* snap, Brush* brush, ViewContext* vc)
+static void make_snap(Snapshot *snap, Brush *brush, ViewContext *vc)
{
if (brush->mtex.tex) {
snap->brush_map_mode = brush->mtex.brush_map_mode;
@@ -105,8 +105,8 @@ static void make_snap(Snapshot* snap, Brush* brush, ViewContext* vc)
}
else {
snap->brush_map_mode = -1;
- snap->ofs[0]= snap->ofs[1]= snap->ofs[2]= -1;
- snap->size[0]= snap->size[1]= snap->size[2]= -1;
+ snap->ofs[0] = snap->ofs[1] = snap->ofs[2] = -1;
+ snap->size[0] = snap->size[1] = snap->size[2] = -1;
snap->rot = -1;
}
@@ -115,7 +115,7 @@ static void make_snap(Snapshot* snap, Brush* brush, ViewContext* vc)
snap->winy = vc->ar->winy;
}
-static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
+static int load_tex(Sculpt *sd, Brush *br, ViewContext *vc)
{
static GLuint overlay_texture = 0;
static int init = 0;
@@ -124,7 +124,7 @@ static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
static Snapshot snap;
static int old_size = -1;
- GLubyte* buffer = NULL;
+ GLubyte *buffer = NULL;
int size;
int j;
@@ -137,13 +137,13 @@ static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
if (br->mtex.brush_map_mode == MTEX_MAP_MODE_TILED && !br->mtex.tex) return 0;
refresh =
- !overlay_texture ||
- (br->mtex.tex &&
- (!br->mtex.tex->preview ||
- br->mtex.tex->preview->changed_timestamp[0] != tex_changed_timestamp)) ||
- !br->curve ||
- br->curve->changed_timestamp != curve_changed_timestamp ||
- !same_snap(&snap, br, vc);
+ !overlay_texture ||
+ (br->mtex.tex &&
+ (!br->mtex.tex->preview ||
+ br->mtex.tex->preview->changed_timestamp[0] != tex_changed_timestamp)) ||
+ !br->curve ||
+ br->curve->changed_timestamp != curve_changed_timestamp ||
+ !same_snap(&snap, br, vc);
if (refresh) {
if (br->mtex.tex && br->mtex.tex->preview)
@@ -161,7 +161,7 @@ static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
for (s >>= 1; s > 0; s >>= 1)
r++;
- size = (1<<r);
+ size = (1 << r);
if (size < 256)
size = 256;
@@ -183,26 +183,26 @@ static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
old_size = size;
}
- buffer = MEM_mallocN(sizeof(GLubyte)*size*size, "load_tex");
+ buffer = MEM_mallocN(sizeof(GLubyte) * size * size, "load_tex");
#pragma omp parallel for schedule(static) if (sd->flags & SCULPT_USE_OPENMP)
- for (j= 0; j < size; j++) {
+ for (j = 0; j < size; j++) {
int i;
float y;
float len;
- for (i= 0; i < size; i++) {
+ for (i = 0; i < size; i++) {
// largely duplicated from tex_strength
const float rotation = -br->mtex.rot;
float radius = brush_size(vc->scene, br);
- int index = j*size + i;
+ int index = j * size + i;
float x;
float avg;
- x = (float)i/size;
- y = (float)j/size;
+ x = (float)i / size;
+ y = (float)j / size;
x -= 0.5f;
y -= 0.5f;
@@ -216,12 +216,12 @@ static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
y *= 2;
}
- len = sqrtf(x*x + y*y);
+ len = sqrtf(x * x + y * y);
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;
@@ -240,9 +240,9 @@ static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
avg += br->texture_sample_bias;
if (br->mtex.brush_map_mode == MTEX_MAP_MODE_FIXED)
- avg *= brush_curve_strength(br, len, 1); /* Falloff curve */
+ avg *= brush_curve_strength(br, len, 1); /* Falloff curve */
- buffer[index] = 255 - (GLubyte)(255*avg);
+ buffer[index] = 255 - (GLubyte)(255 * avg);
}
else {
buffer[index] = 0;
@@ -254,7 +254,7 @@ static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
glGenTextures(1, &overlay_texture);
}
else {
- size= old_size;
+ size = old_size;
}
glBindTexture(GL_TEXTURE_2D, overlay_texture);
@@ -287,8 +287,8 @@ static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
}
static int project_brush_radius(ViewContext *vc,
- float radius,
- const float location[3])
+ float radius,
+ const float location[3])
{
float view[3], nonortho[3], ortho[3], offset[3], p1[2], p2[2];
@@ -328,9 +328,9 @@ static int project_brush_radius(ViewContext *vc,
return len_v2v2(p1, p2);
}
-static int sculpt_get_brush_geometry(bContext* C, ViewContext *vc,
- int x, int y, int* pixel_radius,
- float location[3])
+static int sculpt_get_brush_geometry(bContext *C, ViewContext *vc,
+ int x, int y, int *pixel_radius,
+ float location[3])
{
Scene *scene = CTX_data_scene(C);
Paint *paint = paint_get_active(scene);
@@ -341,12 +341,12 @@ static int sculpt_get_brush_geometry(bContext* C, ViewContext *vc,
window[0] = x + vc->ar->winrct.xmin;
window[1] = y + vc->ar->winrct.ymin;
- if(vc->obact->sculpt && vc->obact->sculpt->pbvh &&
- sculpt_stroke_get_location(C, location, window)) {
+ if (vc->obact->sculpt && vc->obact->sculpt->pbvh &&
+ sculpt_stroke_get_location(C, location, window)) {
*pixel_radius =
- project_brush_radius(vc,
- brush_unprojected_radius(scene, brush),
- location);
+ project_brush_radius(vc,
+ brush_unprojected_radius(scene, brush),
+ location);
if (*pixel_radius == 0)
*pixel_radius = brush_size(scene, brush);
@@ -356,8 +356,8 @@ static int sculpt_get_brush_geometry(bContext* C, ViewContext *vc,
hit = 1;
}
else {
- Sculpt* sd = CTX_data_tool_settings(C)->sculpt;
- Brush* brush = paint_brush(&sd->paint);
+ Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
+ Brush *brush = paint_brush(&sd->paint);
*pixel_radius = brush_size(scene, brush);
hit = 0;
@@ -367,32 +367,32 @@ 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)
+ ViewContext *vc, int x, int y)
{
rctf quad;
/* check for overlay mode */
- if(!(brush->flag & BRUSH_TEXTURE_OVERLAY) ||
- !(ELEM(brush->mtex.brush_map_mode, MTEX_MAP_MODE_FIXED, MTEX_MAP_MODE_TILED)))
+ if (!(brush->flag & BRUSH_TEXTURE_OVERLAY) ||
+ !(ELEM(brush->mtex.brush_map_mode, MTEX_MAP_MODE_FIXED, MTEX_MAP_MODE_TILED)))
return;
/* save lots of GL state
- TODO: check on whether all of these are needed? */
- glPushAttrib(GL_COLOR_BUFFER_BIT|
- GL_CURRENT_BIT|
- GL_DEPTH_BUFFER_BIT|
- GL_ENABLE_BIT|
- GL_LINE_BIT|
- GL_POLYGON_BIT|
- GL_STENCIL_BUFFER_BIT|
- GL_TRANSFORM_BIT|
- GL_VIEWPORT_BIT|
+ * TODO: check on whether all of these are needed? */
+ glPushAttrib(GL_COLOR_BUFFER_BIT |
+ GL_CURRENT_BIT |
+ GL_DEPTH_BUFFER_BIT |
+ GL_ENABLE_BIT |
+ GL_LINE_BIT |
+ GL_POLYGON_BIT |
+ GL_STENCIL_BUFFER_BIT |
+ GL_TRANSFORM_BIT |
+ GL_VIEWPORT_BIT |
GL_TEXTURE_BIT);
- if(load_tex(sd, brush, vc)) {
+ if (load_tex(sd, brush, vc)) {
glEnable(GL_BLEND);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
@@ -403,31 +403,31 @@ static void paint_draw_alpha_overlay(Sculpt *sd, Brush *brush,
glPushMatrix();
glLoadIdentity();
- if(brush->mtex.brush_map_mode == MTEX_MAP_MODE_FIXED) {
+ if (brush->mtex.brush_map_mode == MTEX_MAP_MODE_FIXED) {
/* brush rotation */
glTranslatef(0.5, 0.5, 0);
glRotatef((double)RAD2DEGF((brush->flag & BRUSH_RAKE) ?
sd->last_angle : sd->special_rotation),
- 0.0, 0.0, 1.0);
+ 0.0, 0.0, 1.0);
glTranslatef(-0.5f, -0.5f, 0);
/* scale based on tablet pressure */
- if(sd->draw_pressure && brush_use_size_pressure(vc->scene, brush)) {
+ if (sd->draw_pressure && brush_use_size_pressure(vc->scene, brush)) {
glTranslatef(0.5f, 0.5f, 0);
- glScalef(1.0f/sd->pressure_value, 1.0f/sd->pressure_value, 1);
+ glScalef(1.0f / sd->pressure_value, 1.0f / sd->pressure_value, 1);
glTranslatef(-0.5f, -0.5f, 0);
}
- if(sd->draw_anchored) {
+ if (sd->draw_anchored) {
const float *aim = sd->anchored_initial_mouse;
const rcti *win = &vc->ar->winrct;
- quad.xmin = aim[0]-sd->anchored_size - win->xmin;
- quad.ymin = aim[1]-sd->anchored_size - win->ymin;
- quad.xmax = aim[0]+sd->anchored_size - win->xmin;
- quad.ymax = aim[1]+sd->anchored_size - win->ymin;
+ quad.xmin = aim[0] - sd->anchored_size - win->xmin;
+ quad.ymin = aim[1] - sd->anchored_size - win->ymin;
+ quad.xmax = aim[0] + sd->anchored_size - win->xmin;
+ quad.ymax = aim[1] + sd->anchored_size - win->ymin;
}
else {
- const int radius= brush_size(vc->scene, brush);
+ const int radius = brush_size(vc->scene, brush);
quad.xmin = x - radius;
quad.ymin = y - radius;
quad.xmax = x + radius;
@@ -468,17 +468,17 @@ static void paint_draw_alpha_overlay(Sculpt *sd, Brush *brush,
/* Special actions taken when paint cursor goes over mesh */
/* TODO: sculpt only for now */
static void paint_cursor_on_hit(Sculpt *sd, Brush *brush, ViewContext *vc,
- const float location[3])
+ const float location[3])
{
float unprojected_radius, projected_radius;
/* update the brush's cached 3D radius */
- if(!brush_use_locked_size(vc->scene, brush)) {
+ if (!brush_use_locked_size(vc->scene, brush)) {
/* get 2D brush radius */
- if(sd->draw_anchored)
+ if (sd->draw_anchored)
projected_radius = sd->anchored_size;
else {
- if(brush->flag & BRUSH_ANCHORED)
+ if (brush->flag & BRUSH_ANCHORED)
projected_radius = 8;
else
projected_radius = brush_size(vc->scene, brush);
@@ -486,10 +486,10 @@ static void paint_cursor_on_hit(Sculpt *sd, Brush *brush, ViewContext *vc,
/* convert brush radius from 2D to 3D */
unprojected_radius = paint_calc_object_space_radius(vc, location,
- projected_radius);
+ projected_radius);
/* scale 3D brush radius by pressure */
- if(sd->draw_pressure && brush_use_size_pressure(vc->scene, brush))
+ if (sd->draw_pressure && brush_use_size_pressure(vc->scene, brush))
unprojected_radius *= sd->pressure_value;
/* set cached value in either Brush or UnifiedPaintSettings */
@@ -515,24 +515,24 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
final_radius = brush_size(scene, brush);
/* check that brush drawing is enabled */
- if(!(paint->flags & PAINT_SHOW_BRUSH))
+ if (!(paint->flags & PAINT_SHOW_BRUSH))
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 */
- if(vc.obact->sculpt) {
+ * 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;
@@ -541,11 +541,11 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
const float dx = sd->last_x - x;
const float dy = sd->last_y - y;
- if(dx*dx + dy*dy >= r*r) {
+ if (dx * dx + dy * dy >= r * r) {
sd->last_angle = atan2(dx, dy);
- sd->last_x = u*sd->last_x + v*x;
- sd->last_y = u*sd->last_y + v*y;
+ sd->last_x = u * sd->last_x + v * x;
+ sd->last_y = u * sd->last_y + v * y;
}
}
@@ -555,24 +555,24 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
/* draw overlay */
paint_draw_alpha_overlay(sd, brush, &vc, x, y);
- if(brush_use_locked_size(scene, brush))
+ if (brush_use_locked_size(scene, brush))
brush_set_size(scene, brush, pixel_radius);
/* 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 */
- if((!(brush->flag & BRUSH_INVERTED) ^
- !(brush->flag & BRUSH_DIR_IN)) &&
- ELEM5(brush->sculpt_tool, SCULPT_TOOL_DRAW,
- SCULPT_TOOL_INFLATE, SCULPT_TOOL_CLAY,
- SCULPT_TOOL_PINCH, SCULPT_TOOL_CREASE))
+ * invert key modifier without starting a stroke */
+ if ((!(brush->flag & BRUSH_INVERTED) ^
+ !(brush->flag & BRUSH_DIR_IN)) &&
+ ELEM5(brush->sculpt_tool, SCULPT_TOOL_DRAW,
+ SCULPT_TOOL_INFLATE, SCULPT_TOOL_CLAY,
+ SCULPT_TOOL_PINCH, SCULPT_TOOL_CREASE))
outline_col = brush->sub_col;
/* only do if brush is over the mesh */
- if(hit)
+ if (hit)
paint_cursor_on_hit(sd, brush, &vc, location);
- if(sd->draw_anchored) {
+ if (sd->draw_anchored) {
final_radius = sd->anchored_size;
translation[0] = sd->anchored_initial_mouse[0] - vc.ar->winrct.xmin;
translation[1] = sd->anchored_initial_mouse[1] - vc.ar->winrct.ymin;
@@ -588,7 +588,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
/* draw brush outline */
glTranslatef(translation[0], translation[1], 0);
- glutil_draw_lined_arc(0.0, M_PI*2.0, final_radius, 40);
+ glutil_draw_lined_arc(0.0, M_PI * 2.0, final_radius, 40);
glTranslatef(-translation[0], -translation[1], 0);
/* restore GL state */
@@ -602,6 +602,6 @@ void paint_cursor_start(bContext *C, int (*poll)(bContext *C))
{
Paint *p = paint_get_active(CTX_data_scene(C));
- if(p && !p->paint_cursor)
+ if (p && !p->paint_cursor)
p->paint_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), poll, paint_draw_cursor, NULL);
}
diff --git a/source/blender/editors/sculpt_paint/paint_hide.c b/source/blender/editors/sculpt_paint/paint_hide.c
new file mode 100644
index 00000000000..a3acce33683
--- /dev/null
+++ b/source/blender/editors/sculpt_paint/paint_hide.c
@@ -0,0 +1,392 @@
+/*
+ * $Id$
+ *
+ * ***** 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) 2010 by Nicholas Bishop
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s):
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ *
+ * Implements the PBVH node hiding operator
+ *
+ */
+
+/** \file blender/editors/sculpt_paint/paint_hide.c
+ * \ingroup edsculpt
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_bitmap.h"
+#include "BLI_listbase.h"
+#include "BLI_math_vector.h"
+#include "BLI_pbvh.h"
+#include "BLI_utildefines.h"
+
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+
+#include "BKE_context.h"
+#include "BKE_DerivedMesh.h"
+#include "BKE_mesh.h"
+#include "BKE_multires.h"
+#include "BKE_paint.h"
+#include "BKE_subsurf.h"
+
+#include "BIF_glutil.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_screen.h"
+#include "ED_view3d.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+
+#include "paint_intern.h"
+#include "sculpt_intern.h" /* for undo push */
+
+#include <assert.h>
+
+static int planes_contain_v3(float (*planes)[4], int totplane, const float p[3])
+{
+ int i;
+
+ for (i = 0; i < totplane; i++) {
+ if (dot_v3v3(planes[i], p) + planes[i][3] > 0)
+ return 0;
+ }
+
+ return 1;
+}
+
+/* return true if the element should be hidden/shown */
+static int is_effected(PartialVisArea area,
+ float planes[4][4],
+ const float co[3])
+{
+ if (area == PARTIALVIS_ALL)
+ return 1;
+ else {
+ int inside = planes_contain_v3(planes, 4, co);
+ return ((inside && area == PARTIALVIS_INSIDE) ||
+ (!inside && area == PARTIALVIS_OUTSIDE));
+ }
+}
+
+static void partialvis_update_mesh(Object *ob,
+ PBVH *pbvh,
+ PBVHNode *node,
+ PartialVisAction action,
+ PartialVisArea area,
+ float planes[4][4])
+{
+ MVert *mvert;
+ int *vert_indices;
+ int any_changed = 0, any_visible = 0, totvert, i;
+
+ BLI_pbvh_node_num_verts(pbvh, node, NULL, &totvert);
+ BLI_pbvh_node_get_verts(pbvh, node, &vert_indices, &mvert);
+
+ sculpt_undo_push_node(ob, node, SCULPT_UNDO_HIDDEN);
+
+ for (i = 0; i < totvert; i++) {
+ MVert *v = &mvert[vert_indices[i]];
+
+ /* hide vertex if in the hide volume */
+ if (is_effected(area, planes, v->co)) {
+ if (action == PARTIALVIS_HIDE)
+ v->flag |= ME_HIDE;
+ else
+ v->flag &= ~ME_HIDE;
+ any_changed = 1;
+ }
+
+ if (!(v->flag & ME_HIDE))
+ any_visible = 1;
+ }
+
+ if (any_changed) {
+ BLI_pbvh_node_mark_rebuild_draw(node);
+ BLI_pbvh_node_fully_hidden_set(node, !any_visible);
+ }
+}
+
+/* Hide or show elements in multires grids with a special GridFlags
+ customdata layer. */
+static void partialvis_update_grids(Object *ob,
+ PBVH *pbvh,
+ PBVHNode *node,
+ PartialVisAction action,
+ PartialVisArea area,
+ float planes[4][4])
+{
+ DMGridData **grids;
+ BLI_bitmap *grid_hidden;
+ int any_visible = 0;
+ int *grid_indices, gridsize, totgrid, any_changed, i;
+
+ /* get PBVH data */
+ BLI_pbvh_node_get_grids(pbvh, node,
+ &grid_indices, &totgrid, NULL, &gridsize,
+ &grids, NULL);
+ grid_hidden = BLI_pbvh_grid_hidden(pbvh);
+
+ sculpt_undo_push_node(ob, node, SCULPT_UNDO_HIDDEN);
+
+ any_changed = 0;
+ for (i = 0; i < totgrid; i++) {
+ int any_hidden = 0;
+ int g = grid_indices[i], x, y;
+ BLI_bitmap gh = grid_hidden[g];
+
+ if (!gh) {
+ switch (action) {
+ case PARTIALVIS_HIDE:
+ /* create grid flags data */
+ gh = grid_hidden[g] = BLI_BITMAP_NEW(gridsize * gridsize,
+ "partialvis_update_grids");
+ break;
+ case PARTIALVIS_SHOW:
+ /* entire grid is visible, nothing to show */
+ continue;
+ }
+ }
+ else if (action == PARTIALVIS_SHOW && area == PARTIALVIS_ALL) {
+ /* special case if we're showing all, just free the
+ grid */
+ MEM_freeN(gh);
+ grid_hidden[g] = NULL;
+ any_changed = 1;
+ any_visible = 1;
+ continue;
+ }
+
+ for (y = 0; y < gridsize; y++) {
+ for (x = 0; x < gridsize; x++) {
+ const float *co = grids[g][y * gridsize + x].co;
+
+ /* skip grid element if not in the effected area */
+ if (is_effected(area, planes, co)) {
+ /* set or clear the hide flag */
+ BLI_BITMAP_MODIFY(gh, y * gridsize + x,
+ action == PARTIALVIS_HIDE);
+
+ any_changed = 1;
+ }
+
+ /* keep track of whether any elements are still hidden */
+ if (BLI_BITMAP_GET(gh, y * gridsize + x))
+ any_hidden = 1;
+ else
+ any_visible = 1;
+ }
+ }
+
+ /* if everything in the grid is now visible, free the grid
+ flags */
+ if (!any_hidden) {
+ MEM_freeN(gh);
+ grid_hidden[g] = NULL;
+ }
+ }
+
+ /* mark updates if anything was hidden/shown */
+ if (any_changed) {
+ BLI_pbvh_node_mark_rebuild_draw(node);
+ BLI_pbvh_node_fully_hidden_set(node, !any_visible);
+ multires_mark_as_modified(ob, MULTIRES_HIDDEN_MODIFIED);
+ }
+}
+
+static void rect_from_props(rcti *rect, PointerRNA *ptr)
+{
+ rect->xmin = RNA_int_get(ptr, "xmin");
+ rect->ymin = RNA_int_get(ptr, "ymin");
+ rect->xmax = RNA_int_get(ptr, "xmax");
+ rect->ymax = RNA_int_get(ptr, "ymax");
+}
+
+static void clip_planes_from_rect(bContext *C,
+ float clip_planes[4][4],
+ const rcti *rect)
+{
+ ViewContext vc;
+ BoundBox bb;
+ bglMats mats = {{0}};
+
+ view3d_operator_needs_opengl(C);
+ view3d_set_viewcontext(C, &vc);
+ view3d_get_transformation(vc.ar, vc.rv3d, vc.obact, &mats);
+ ED_view3d_calc_clipping(&bb, clip_planes, &mats, rect);
+ mul_m4_fl(clip_planes, -1.0f);
+}
+
+/* If mode is inside, get all PBVH nodes that lie at least partially
+ inside the clip_planes volume. If mode is outside, get all nodes
+ that lie at least partially outside the volume. If showing all, get
+ all nodes. */
+static void get_pbvh_nodes(PBVH *pbvh,
+ PBVHNode ***nodes,
+ int *totnode,
+ float clip_planes[4][4],
+ PartialVisArea mode)
+{
+ BLI_pbvh_SearchCallback cb;
+
+ /* select search callback */
+ switch (mode) {
+ case PARTIALVIS_INSIDE:
+ cb = BLI_pbvh_node_planes_contain_AABB;
+ break;
+ case PARTIALVIS_OUTSIDE:
+ cb = BLI_pbvh_node_planes_exclude_AABB;
+ break;
+ case PARTIALVIS_ALL:
+ cb = NULL;
+ }
+
+ BLI_pbvh_search_gather(pbvh, cb, clip_planes, nodes, totnode);
+}
+
+static int hide_show_exec(bContext *C, wmOperator *op)
+{
+ ARegion *ar = CTX_wm_region(C);
+ Object *ob = CTX_data_active_object(C);
+ Mesh *me = ob->data;
+ PartialVisAction action;
+ PartialVisArea area;
+ PBVH *pbvh;
+ PBVHNode **nodes;
+ DerivedMesh *dm;
+ PBVHType pbvh_type;
+ float clip_planes[4][4];
+ rcti rect;
+ int totnode, i;
+
+ /* read operator properties */
+ action = RNA_enum_get(op->ptr, "action");
+ area = RNA_enum_get(op->ptr, "area");
+ rect_from_props(&rect, op->ptr);
+
+ clip_planes_from_rect(C, clip_planes, &rect);
+
+ dm = mesh_get_derived_final(CTX_data_scene(C), ob, CD_MASK_BAREMESH);
+ pbvh = dm->getPBVH(ob, dm);
+ ob->sculpt->pbvh = pbvh;
+
+ get_pbvh_nodes(pbvh, &nodes, &totnode, clip_planes, area);
+ pbvh_type = BLI_pbvh_type(pbvh);
+
+ /* start undo */
+ switch (action) {
+ case PARTIALVIS_HIDE:
+ sculpt_undo_push_begin("Hide area");
+ break;
+ case PARTIALVIS_SHOW:
+ sculpt_undo_push_begin("Show area");
+ break;
+ }
+
+ for (i = 0; i < totnode; i++) {
+ switch (pbvh_type) {
+ case PBVH_FACES:
+ partialvis_update_mesh(ob, pbvh, nodes[i], action, area, clip_planes);
+ break;
+ case PBVH_GRIDS:
+ partialvis_update_grids(ob, pbvh, nodes[i], action, area, clip_planes);
+ break;
+ }
+ }
+
+ if (nodes)
+ MEM_freeN(nodes);
+
+ /* end undo */
+ sculpt_undo_push_end();
+
+ /* ensure that edges and faces get hidden as well (not used by
+ sculpt but it looks wrong when entering editmode otherwise) */
+ if (pbvh_type == PBVH_FACES) {
+ mesh_flush_hidden_from_verts(me->mvert, me->mloop,
+ me->medge, me->totedge,
+ me->mpoly, me->totpoly);
+ }
+
+ ED_region_tag_redraw(ar);
+
+ return OPERATOR_FINISHED;
+}
+
+static int hide_show_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ PartialVisArea area = RNA_enum_get(op->ptr, "area");
+
+ if (area != PARTIALVIS_ALL)
+ return WM_border_select_invoke(C, op, event);
+ else
+ return op->type->exec(C, op);
+}
+
+void PAINT_OT_hide_show(struct wmOperatorType *ot)
+{
+ static EnumPropertyItem action_items[] = {
+ {PARTIALVIS_HIDE, "HIDE", 0, "Hide", "Hide vertices"},
+ {PARTIALVIS_SHOW, "SHOW", 0, "Show", "Show vertices"},
+ {0}};
+
+ static EnumPropertyItem area_items[] = {
+ {PARTIALVIS_OUTSIDE, "OUTSIDE", 0, "Outside",
+ "Hide or show vertices outside the selection"},
+ {PARTIALVIS_INSIDE, "INSIDE", 0, "Inside",
+ "Hide or show vertices inside the selection"},
+ {PARTIALVIS_ALL, "ALL", 0, "All",
+ "Hide or show all vertices"},
+ {0}};
+
+ /* identifiers */
+ ot->name = "Hide/Show";
+ ot->idname = "PAINT_OT_hide_show";
+
+ /* api callbacks */
+ ot->invoke = hide_show_invoke;
+ ot->modal = WM_border_select_modal;
+ ot->exec = hide_show_exec;
+ /* sculpt-only for now */
+ ot->poll = sculpt_mode_poll;
+
+ ot->flag = OPTYPE_REGISTER;
+
+ /* rna */
+ RNA_def_enum(ot->srna, "action", action_items, PARTIALVIS_HIDE,
+ "Action", "Whether to hide or show vertices");
+ RNA_def_enum(ot->srna, "area", area_items, PARTIALVIS_INSIDE,
+ "Area", "Which vertices to hide or show");
+
+ RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
+ RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
+ RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
+ RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
+}
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 6f1da1895e9..18f3094fa31 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -111,7 +111,7 @@
/* Defines and Structs */
-#define IMAPAINT_CHAR_TO_FLOAT(c) ((c)/255.0f)
+#define IMAPAINT_CHAR_TO_FLOAT(c) ((c) / 255.0f)
#define IMAPAINT_FLOAT_RGB_TO_CHAR(c, f) { \
(c)[0]= FTOCHAR((f)[0]); \
@@ -138,9 +138,9 @@
#define IMAPAINT_FLOAT_RGB_COPY(a, b) copy_v3_v3(a, b)
-#define IMAPAINT_TILE_BITS 6
-#define IMAPAINT_TILE_SIZE (1 << IMAPAINT_TILE_BITS)
-#define IMAPAINT_TILE_NUMBER(size) (((size)+IMAPAINT_TILE_SIZE-1) >> IMAPAINT_TILE_BITS)
+#define IMAPAINT_TILE_BITS 6
+#define IMAPAINT_TILE_SIZE (1 << IMAPAINT_TILE_BITS)
+#define IMAPAINT_TILE_NUMBER(size) (((size) + IMAPAINT_TILE_SIZE - 1) >> IMAPAINT_TILE_BITS)
static void imapaint_image_update(SpaceImage *sima, Image *image, ImBuf *ibuf, short texpaint);
@@ -160,11 +160,18 @@ typedef struct ImagePaintState {
char *warnpackedfile;
char *warnmultifile;
- /* texture paint only */
+ /* viewport texture paint only, but _not_ project paint */
Object *ob;
- Mesh *me;
int faceindex;
float uv[2];
+ int do_facesel;
+
+ DerivedMesh *dm;
+ int dm_totface;
+ int dm_release;
+
+ MFace *dm_mface;
+ MTFace *dm_mtface;
} ImagePaintState;
typedef struct ImagePaintPartialRedraw {
@@ -202,31 +209,31 @@ typedef struct ImagePaintRegion {
/* projectFaceSeamFlags options */
//#define PROJ_FACE_IGNORE (1<<0) /* When the face is hidden, backfacing or occluded */
//#define PROJ_FACE_INIT (1<<1) /* When we have initialized the faces data */
-#define PROJ_FACE_SEAM1 (1<<0) /* If this face has a seam on any of its edges */
-#define PROJ_FACE_SEAM2 (1<<1)
-#define PROJ_FACE_SEAM3 (1<<2)
-#define PROJ_FACE_SEAM4 (1<<3)
+#define PROJ_FACE_SEAM1 (1 << 0) /* If this face has a seam on any of its edges */
+#define PROJ_FACE_SEAM2 (1 << 1)
+#define PROJ_FACE_SEAM3 (1 << 2)
+#define PROJ_FACE_SEAM4 (1 << 3)
-#define PROJ_FACE_NOSEAM1 (1<<4)
-#define PROJ_FACE_NOSEAM2 (1<<5)
-#define PROJ_FACE_NOSEAM3 (1<<6)
-#define PROJ_FACE_NOSEAM4 (1<<7)
+#define PROJ_FACE_NOSEAM1 (1 << 4)
+#define PROJ_FACE_NOSEAM2 (1 << 5)
+#define PROJ_FACE_NOSEAM3 (1 << 6)
+#define PROJ_FACE_NOSEAM4 (1 << 7)
-#define PROJ_SRC_VIEW 1
-#define PROJ_SRC_IMAGE_CAM 2
-#define PROJ_SRC_IMAGE_VIEW 3
+#define PROJ_SRC_VIEW 1
+#define PROJ_SRC_IMAGE_CAM 2
+#define PROJ_SRC_IMAGE_VIEW 3
#define PROJ_VIEW_DATA_ID "view_data"
-#define PROJ_VIEW_DATA_SIZE (4*4 + 4*4 + 3) /* viewmat + winmat + clipsta + clipend + is_ortho */
+#define PROJ_VIEW_DATA_SIZE (4 * 4 + 4 * 4 + 3) /* viewmat + winmat + clipsta + clipend + is_ortho */
/* a slightly scaled down face is used to get fake 3D location for edge pixels in the seams
* as this number approaches 1.0f the likelihood increases of float precision errors where
* it is occluded by an adjacent face */
-#define PROJ_FACE_SCALE_SEAM 0.99f
+#define PROJ_FACE_SCALE_SEAM 0.99f
-#define PROJ_BUCKET_NULL 0
-#define PROJ_BUCKET_INIT (1<<0)
+#define PROJ_BUCKET_NULL 0
+#define PROJ_BUCKET_INIT (1 << 0)
// #define PROJ_BUCKET_CLONE_INIT (1<<1)
/* used for testing doubles, if a point is on a line etc */
@@ -262,67 +269,67 @@ typedef struct ProjPaintState {
/* end similarities with ImagePaintState */
DerivedMesh *dm;
- int dm_totface;
- int dm_totvert;
- int dm_release;
-
- MVert *dm_mvert;
- MFace *dm_mface;
- MTFace *dm_mtface;
- MTFace *dm_mtface_clone; /* other UV map, use for cloning between layers */
- MTFace *dm_mtface_stencil;
+ int dm_totface;
+ int dm_totvert;
+ int dm_release;
+
+ MVert *dm_mvert;
+ MFace *dm_mface;
+ MTFace *dm_mtface;
+ MTFace *dm_mtface_clone; /* other UV map, use for cloning between layers */
+ MTFace *dm_mtface_stencil;
/* projection painting only */
- MemArena *arena_mt[BLENDER_MAX_THREADS];/* for multithreading, the first item is sometimes used for non threaded cases too */
- LinkNode **bucketRect; /* screen sized 2D array, each pixel has a linked list of ProjPixel's */
- LinkNode **bucketFaces; /* bucketRect aligned array linkList of faces overlapping each bucket */
- unsigned char *bucketFlags; /* store if the bucks have been initialized */
+ MemArena *arena_mt[BLENDER_MAX_THREADS]; /* for multithreading, the first item is sometimes used for non threaded cases too */
+ LinkNode **bucketRect; /* screen sized 2D array, each pixel has a linked list of ProjPixel's */
+ LinkNode **bucketFaces; /* bucketRect aligned array linkList of faces overlapping each bucket */
+ unsigned char *bucketFlags; /* store if the bucks have been initialized */
#ifndef PROJ_DEBUG_NOSEAMBLEED
- char *faceSeamFlags; /* store info about faces, if they are initialized etc*/
- float (*faceSeamUVs)[4][2]; /* expanded UVs for faces to use as seams */
- LinkNode **vertFaces; /* Only needed for when seam_bleed_px is enabled, use to find UV seams */
+ char *faceSeamFlags; /* store info about faces, if they are initialized etc*/
+ float (*faceSeamUVs)[4][2]; /* expanded UVs for faces to use as seams */
+ LinkNode **vertFaces; /* Only needed for when seam_bleed_px is enabled, use to find UV seams */
#endif
- char *vertFlags; /* store options per vert, now only store if the vert is pointing away from the view */
- int buckets_x; /* The size of the bucket grid, the grid span's screenMin/screenMax so you can paint outsize the screen or with 2 brushes at once */
+ char *vertFlags; /* store options per vert, now only store if the vert is pointing away from the view */
+ int buckets_x; /* The size of the bucket grid, the grid span's screenMin/screenMax so you can paint outsize the screen or with 2 brushes at once */
int buckets_y;
ProjPaintImage *projImages;
- int image_tot; /* size of projectImages array */
+ int image_tot; /* size of projectImages array */
- float (*screenCoords)[4]; /* verts projected into floating point screen space */
+ float (*screenCoords)[4]; /* verts projected into floating point screen space */
- float screenMin[2]; /* 2D bounds for mesh verts on the screen's plane (screenspace) */
+ float screenMin[2]; /* 2D bounds for mesh verts on the screen's plane (screenspace) */
float screenMax[2];
- float screen_width; /* Calculated from screenMin & screenMax */
+ float screen_width; /* Calculated from screenMin & screenMax */
float screen_height;
- int winx, winy; /* from the carea or from the projection render */
+ int winx, winy; /* from the carea or from the projection render */
/* options for projection painting */
int do_layer_clone;
int do_layer_stencil;
int do_layer_stencil_inv;
- short do_occlude; /* Use raytraced occlusion? - ortherwise will paint right through to the back*/
- short do_backfacecull; /* ignore faces with normals pointing away, skips a lot of raycasts if your normals are correctly flipped */
- short do_mask_normal; /* mask out pixels based on their normals */
+ short do_occlude; /* Use raytraced occlusion? - ortherwise will paint right through to the back*/
+ short do_backfacecull; /* ignore faces with normals pointing away, skips a lot of raycasts if your normals are correctly flipped */
+ short do_mask_normal; /* mask out pixels based on their normals */
short do_new_shading_nodes; /* cache scene_use_new_shading_nodes value */
- float normal_angle; /* what angle to mask at*/
+ float normal_angle; /* what angle to mask at*/
float normal_angle_inner;
- float normal_angle_range; /* difference between normal_angle and normal_angle_inner, for easy access */
+ float normal_angle_range; /* difference between normal_angle and normal_angle_inner, for easy access */
short is_ortho;
- short is_airbrush; /* only to avoid using (ps.brush->flag & BRUSH_AIRBRUSH) */
- short is_texbrush; /* only to avoid running */
+ short is_airbrush; /* only to avoid using (ps.brush->flag & BRUSH_AIRBRUSH) */
+ short is_texbrush; /* only to avoid running */
#ifndef PROJ_DEBUG_NOSEAMBLEED
float seam_bleed_px;
#endif
/* clone vars */
float cloneOffset[2];
- float projectMat[4][4]; /* Projection matrix, use for getting screen coords */
- float viewDir[3]; /* View vector, use for do_backfacecull and for ray casting with an ortho viewport */
- float viewPos[3]; /* View location in object relative 3D space, so can compare to verts */
+ float projectMat[4][4]; /* Projection matrix, use for getting screen coords */
+ float viewDir[3]; /* View vector, use for do_backfacecull and for ray casting with an ortho viewport */
+ float viewPos[3]; /* View location in object relative 3D space, so can compare to verts */
float clipsta, clipend;
/* reproject vars */
@@ -337,15 +344,13 @@ typedef struct ProjPaintState {
int context_bucket_x, context_bucket_y; /* must lock threads while accessing these */
} ProjPaintState;
-typedef union pixelPointer
-{
- float *f_pt; /* float buffer */
+typedef union pixelPointer {
+ float *f_pt; /* float buffer */
unsigned int *uint_pt; /* 2 ways to access a char buffer */
unsigned char *ch_pt;
} PixelPointer;
-typedef union pixelStore
-{
+typedef union pixelStore {
unsigned char ch[4];
unsigned int uint;
float f[4];
@@ -383,7 +388,7 @@ typedef struct ProjPixelClone {
typedef struct UndoImageTile {
struct UndoImageTile *next, *prev;
- char idname[MAX_ID_NAME]; /* name instead of pointer*/
+ char idname[MAX_ID_NAME]; /* name instead of pointer*/
char ibufname[IB_FILENAME_SIZE];
void *rect;
@@ -400,50 +405,51 @@ static ImagePaintPartialRedraw imapaintpartial = {0, 0, 0, 0, 0};
static void undo_copy_tile(UndoImageTile *tile, ImBuf *tmpibuf, ImBuf *ibuf, int restore)
{
/* copy or swap contents of tile->rect and region in ibuf->rect */
- IMB_rectcpy(tmpibuf, ibuf, 0, 0, tile->x*IMAPAINT_TILE_SIZE,
- tile->y*IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
+ IMB_rectcpy(tmpibuf, ibuf, 0, 0, tile->x * IMAPAINT_TILE_SIZE,
+ tile->y * IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
- if(ibuf->rect_float) {
- SWAP(void*, tmpibuf->rect_float, tile->rect);
- } else {
- SWAP(void*, tmpibuf->rect, tile->rect);
+ if (ibuf->rect_float) {
+ SWAP(void *, tmpibuf->rect_float, tile->rect);
+ }
+ else {
+ SWAP(void *, tmpibuf->rect, tile->rect);
}
- if(restore)
- IMB_rectcpy(ibuf, tmpibuf, tile->x*IMAPAINT_TILE_SIZE,
- tile->y*IMAPAINT_TILE_SIZE, 0, 0, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
+ if (restore)
+ IMB_rectcpy(ibuf, tmpibuf, tile->x * IMAPAINT_TILE_SIZE,
+ tile->y * IMAPAINT_TILE_SIZE, 0, 0, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
}
static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int x_tile, int y_tile)
{
- ListBase *lb= undo_paint_push_get_list(UNDO_PAINT_IMAGE);
+ ListBase *lb = undo_paint_push_get_list(UNDO_PAINT_IMAGE);
UndoImageTile *tile;
int allocsize;
short use_float = ibuf->rect_float ? 1 : 0;
- for(tile=lb->first; tile; tile=tile->next)
- if(tile->x == x_tile && tile->y == y_tile && ima->gen_type == tile->gen_type && ima->source == tile->source)
- if(tile->use_float == use_float)
- if(strcmp(tile->idname, ima->id.name)==0 && strcmp(tile->ibufname, ibuf->name)==0)
+ for (tile = lb->first; tile; tile = tile->next)
+ if (tile->x == x_tile && tile->y == y_tile && ima->gen_type == tile->gen_type && ima->source == tile->source)
+ if (tile->use_float == use_float)
+ if (strcmp(tile->idname, ima->id.name) == 0 && strcmp(tile->ibufname, ibuf->name) == 0)
return tile->rect;
- if (*tmpibuf==NULL)
- *tmpibuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, IB_rectfloat|IB_rect);
+ if (*tmpibuf == NULL)
+ *tmpibuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, IB_rectfloat | IB_rect);
- tile= MEM_callocN(sizeof(UndoImageTile), "UndoImageTile");
+ tile = MEM_callocN(sizeof(UndoImageTile), "UndoImageTile");
BLI_strncpy(tile->idname, ima->id.name, sizeof(tile->idname));
- tile->x= x_tile;
- tile->y= y_tile;
+ tile->x = x_tile;
+ tile->y = y_tile;
- allocsize= IMAPAINT_TILE_SIZE*IMAPAINT_TILE_SIZE*4;
- allocsize *= (ibuf->rect_float)? sizeof(float): sizeof(char);
- tile->rect= MEM_mapallocN(allocsize, "UndeImageTile.rect");
+ allocsize = IMAPAINT_TILE_SIZE * IMAPAINT_TILE_SIZE * 4;
+ allocsize *= (ibuf->rect_float) ? sizeof(float) : sizeof(char);
+ tile->rect = MEM_mapallocN(allocsize, "UndeImageTile.rect");
BLI_strncpy(tile->ibufname, ibuf->name, sizeof(tile->ibufname));
- tile->gen_type= ima->gen_type;
- tile->source= ima->source;
- tile->use_float= use_float;
+ tile->gen_type = ima->gen_type;
+ tile->source = ima->source;
+ tile->use_float = use_float;
undo_copy_tile(tile, *tmpibuf, ibuf, 0);
undo_paint_push_count_alloc(UNDO_PAINT_IMAGE, allocsize);
@@ -455,34 +461,34 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int
static void image_undo_restore(bContext *C, ListBase *lb)
{
- Main *bmain= CTX_data_main(C);
+ Main *bmain = CTX_data_main(C);
Image *ima = NULL;
ImBuf *ibuf, *tmpibuf;
UndoImageTile *tile;
- tmpibuf= IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32,
- IB_rectfloat|IB_rect);
+ tmpibuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32,
+ IB_rectfloat | IB_rect);
- for(tile=lb->first; tile; tile=tile->next) {
+ for (tile = lb->first; tile; tile = tile->next) {
short use_float;
/* find image based on name, pointer becomes invalid with global undo */
- if(ima && strcmp(tile->idname, ima->id.name)==0) {
+ if (ima && strcmp(tile->idname, ima->id.name) == 0) {
/* ima is valid */
}
else {
- ima= BLI_findstring(&bmain->image, tile->idname, offsetof(ID, name));
+ ima = BLI_findstring(&bmain->image, tile->idname, offsetof(ID, name));
}
- ibuf= BKE_image_get_ibuf(ima, NULL);
+ ibuf = BKE_image_get_ibuf(ima, NULL);
- if(ima && ibuf && strcmp(tile->ibufname, ibuf->name)!=0) {
+ 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));
+ ibuf = BLI_findstring(&ima->ibufs, tile->ibufname, offsetof(ImBuf, name));
}
if (!ima || !ibuf || !(ibuf->rect || ibuf->rect_float))
@@ -499,10 +505,10 @@ static void image_undo_restore(bContext *C, ListBase *lb)
undo_copy_tile(tile, tmpibuf, ibuf, 1);
GPU_free_image(ima); /* force OpenGL reload */
- if(ibuf->rect_float)
+ if (ibuf->rect_float)
ibuf->userflags |= IB_RECT_INVALID; /* force recreate of char rect */
- if(ibuf->mipmap[0])
- ibuf->userflags |= IB_MIPMAP_INVALID; /* force mipmap recreatiom */
+ if (ibuf->mipmap[0])
+ ibuf->userflags |= IB_MIPMAP_INVALID; /* force mipmap recreatiom */
}
@@ -513,7 +519,7 @@ static void image_undo_free(ListBase *lb)
{
UndoImageTile *tile;
- for(tile=lb->first; tile; tile=tile->next)
+ for (tile = lb->first; tile; tile = tile->next)
MEM_freeN(tile->rect);
}
@@ -523,12 +529,12 @@ static Image *imapaint_face_image(const ImagePaintState *s, int face_index)
{
Image *ima;
- if(scene_use_new_shading_nodes(s->scene)) {
- MFace *mf = s->me->mface+face_index;
- ED_object_get_active_image(s->ob, mf->mat_nr, &ima, NULL, NULL);
+ if (scene_use_new_shading_nodes(s->scene)) {
+ MFace *mf = &s->dm_mface[face_index];
+ ED_object_get_active_image(s->ob, mf->mat_nr + 1, &ima, NULL, NULL);
}
else {
- MTFace *tf = s->me->mtface+face_index;
+ MTFace *tf = &s->dm_mtface[face_index];
ima = tf->tpage;
}
@@ -539,9 +545,9 @@ static Image *project_paint_face_image(const ProjPaintState *ps, MTFace *dm_mtfa
{
Image *ima;
- if(ps->do_new_shading_nodes) { /* cached scene_use_new_shading_nodes result */
- MFace *mf = ps->dm_mface+face_index;
- ED_object_get_active_image(ps->ob, mf->mat_nr, &ima, NULL, NULL);
+ if (ps->do_new_shading_nodes) { /* cached scene_use_new_shading_nodes result */
+ MFace *mf = ps->dm_mface + face_index;
+ ED_object_get_active_image(ps->ob, mf->mat_nr + 1, &ima, NULL, NULL);
}
else {
ima = dm_mtface[face_index].tpage;
@@ -563,15 +569,15 @@ static int project_bucket_offset(const ProjPaintState *ps, const float projCoSS[
*
* Second multiplication does similar but for vertical offset
*/
- return ( (int)(((projCoSS[0] - ps->screenMin[0]) / ps->screen_width) * ps->buckets_x)) +
- ( ( (int)(((projCoSS[1] - ps->screenMin[1]) / ps->screen_height) * ps->buckets_y)) * ps->buckets_x);
+ return ( (int)(((projCoSS[0] - ps->screenMin[0]) / ps->screen_width) * ps->buckets_x)) +
+ ( ( (int)(((projCoSS[1] - ps->screenMin[1]) / ps->screen_height) * ps->buckets_y)) * ps->buckets_x);
}
static int project_bucket_offset_safe(const ProjPaintState *ps, const float projCoSS[2])
{
int bucket_index = project_bucket_offset(ps, projCoSS);
- if (bucket_index < 0 || bucket_index >= ps->buckets_x*ps->buckets_y) {
+ if (bucket_index < 0 || bucket_index >= ps->buckets_x * ps->buckets_y) {
return -1;
}
else {
@@ -587,23 +593,23 @@ static void barycentric_weights_v2_persp(float v1[4], float v2[4], float v3[4],
w[0] = area_tri_signed_v2(v2, v3, co) / v1[3];
w[1] = area_tri_signed_v2(v3, v1, co) / v2[3];
w[2] = area_tri_signed_v2(v1, v2, co) / v3[3];
- wtot = w[0]+w[1]+w[2];
+ wtot = w[0] + w[1] + w[2];
if (wtot != 0.0f) {
- wtot_inv = 1.0f/wtot;
+ wtot_inv = 1.0f / wtot;
- w[0] = w[0]*wtot_inv;
- w[1] = w[1]*wtot_inv;
- w[2] = w[2]*wtot_inv;
+ w[0] = w[0] * wtot_inv;
+ w[1] = w[1] * wtot_inv;
+ w[2] = w[2] * wtot_inv;
}
else /* dummy values for zero area face */
- w[0] = w[1] = w[2] = 1.0f/3.0f;
+ w[0] = w[1] = w[2] = 1.0f / 3.0f;
}
static float VecZDepthOrtho(float pt[2], float v1[3], float v2[3], float v3[3], float w[3])
{
barycentric_weights_v2(v1, v2, v3, pt, w);
- return (v1[2]*w[0]) + (v2[2]*w[1]) + (v3[2]*w[2]);
+ return (v1[2] * w[0]) + (v2[2] * w[1]) + (v3[2] * w[2]);
}
static float VecZDepthPersp(float pt[2], float v1[4], float v2[4], float v3[4], float w[3])
@@ -618,24 +624,24 @@ static float VecZDepthPersp(float pt[2], float v1[4], float v2[4], float v3[4],
*
* don't call barycentric_weights_v2() becaue our callers expect 'w'
* to be weighted from the perspective */
- w_tmp[0]= w[0] * v1[3];
- w_tmp[1]= w[1] * v2[3];
- w_tmp[2]= w[2] * v3[3];
+ w_tmp[0] = w[0] * v1[3];
+ w_tmp[1] = w[1] * v2[3];
+ w_tmp[2] = w[2] * v3[3];
- wtot = w_tmp[0]+w_tmp[1]+w_tmp[2];
+ wtot = w_tmp[0] + w_tmp[1] + w_tmp[2];
if (wtot != 0.0f) {
- wtot_inv = 1.0f/wtot;
+ wtot_inv = 1.0f / wtot;
- w_tmp[0] = w_tmp[0]*wtot_inv;
- w_tmp[1] = w_tmp[1]*wtot_inv;
- w_tmp[2] = w_tmp[2]*wtot_inv;
+ w_tmp[0] = w_tmp[0] * wtot_inv;
+ w_tmp[1] = w_tmp[1] * wtot_inv;
+ w_tmp[2] = w_tmp[2] * wtot_inv;
}
else /* dummy values for zero area face */
- w_tmp[0] = w_tmp[1] = w_tmp[2] = 1.0f/3.0f;
+ w_tmp[0] = w_tmp[1] = w_tmp[2] = 1.0f / 3.0f;
/* done mimicing barycentric_weights_v2() */
- return (v1[2]*w_tmp[0]) + (v2[2]*w_tmp[1]) + (v3[2]*w_tmp[2]);
+ return (v1[2] * w_tmp[0]) + (v2[2] * w_tmp[1]) + (v3[2] * w_tmp[2]);
}
@@ -653,7 +659,7 @@ static int project_paint_PickFace(const ProjPaintState *ps, float pt[2], float w
MFace *mf;
bucket_index = project_bucket_offset_safe(ps, pt);
- if (bucket_index==-1)
+ if (bucket_index == -1)
return -1;
@@ -661,17 +667,17 @@ static int project_paint_PickFace(const ProjPaintState *ps, float pt[2], float w
/* we could return 0 for 1 face buckets, as long as this function assumes
* that the point its testing is only every originated from an existing face */
- for (node= ps->bucketFaces[bucket_index]; node; node= node->next) {
+ for (node = ps->bucketFaces[bucket_index]; node; node = node->next) {
face_index = GET_INT_FROM_POINTER(node->link);
- mf= ps->dm_mface + face_index;
+ mf = ps->dm_mface + face_index;
- v1= ps->screenCoords[mf->v1];
- v2= ps->screenCoords[mf->v2];
- v3= ps->screenCoords[mf->v3];
+ v1 = ps->screenCoords[mf->v1];
+ v2 = ps->screenCoords[mf->v2];
+ v3 = ps->screenCoords[mf->v3];
if (isect_point_tri_v2(pt, v1, v2, v3)) {
- if (ps->is_ortho) z_depth= VecZDepthOrtho(pt, v1, v2, v3, w_tmp);
- else z_depth= VecZDepthPersp(pt, v1, v2, v3, w_tmp);
+ if (ps->is_ortho) z_depth = VecZDepthOrtho(pt, v1, v2, v3, w_tmp);
+ else z_depth = VecZDepthPersp(pt, v1, v2, v3, w_tmp);
if (z_depth < z_depth_best) {
best_face_index = face_index;
@@ -681,15 +687,15 @@ static int project_paint_PickFace(const ProjPaintState *ps, float pt[2], float w
}
}
else if (mf->v4) {
- v4= ps->screenCoords[mf->v4];
+ v4 = ps->screenCoords[mf->v4];
if (isect_point_tri_v2(pt, v1, v3, v4)) {
- if (ps->is_ortho) z_depth= VecZDepthOrtho(pt, v1, v3, v4, w_tmp);
- else z_depth= VecZDepthPersp(pt, v1, v3, v4, w_tmp);
+ if (ps->is_ortho) z_depth = VecZDepthOrtho(pt, v1, v3, v4, w_tmp);
+ else z_depth = VecZDepthPersp(pt, v1, v3, v4, w_tmp);
if (z_depth < z_depth_best) {
best_face_index = face_index;
- best_side= 1;
+ best_side = 1;
z_depth_best = z_depth;
copy_v3_v3(w, w_tmp);
}
@@ -776,10 +782,10 @@ static int project_paint_PickColor(const ProjPaintState *ps, float pt[2], float
//if (xi<0 || xi>=ibuf->x || yi<0 || yi>=ibuf->y) return 0;
/* wrap */
- xi = ((int)(uv[0]*ibuf->x)) % ibuf->x;
- if (xi<0) xi += ibuf->x;
- yi = ((int)(uv[1]*ibuf->y)) % ibuf->y;
- if (yi<0) yi += ibuf->y;
+ xi = ((int)(uv[0] * ibuf->x)) % ibuf->x;
+ if (xi < 0) xi += ibuf->x;
+ yi = ((int)(uv[1] * ibuf->y)) % ibuf->y;
+ if (yi < 0) yi += ibuf->y;
if (rgba) {
@@ -797,7 +803,7 @@ static int project_paint_PickColor(const ProjPaintState *ps, float pt[2], float
copy_v4_v4(rgba_fp, ((float *)ibuf->rect_float + ((xi + yi * ibuf->x) * 4)));
}
else {
- char *tmp_ch= ((char *)ibuf->rect) + ((xi + yi * ibuf->x) * 4);
+ char *tmp_ch = ((char *)ibuf->rect) + ((xi + yi * ibuf->x) * 4);
IMAPAINT_CHAR_RGBA_TO_FLOAT(rgba_fp, tmp_ch);
}
}
@@ -810,22 +816,22 @@ 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)
{
/* if all are behind us, return false */
- if(v1[2] > pt[2] && v2[2] > pt[2] && v3[2] > pt[2])
+ if (v1[2] > pt[2] && v2[2] > pt[2] && v3[2] > pt[2])
return 0;
/* do a 2D point in try intersection */
if (!isect_point_tri_v2(pt, v1, v2, v3))
- return 0; /* we know there is */
+ return 0; /* we know there is */
/* From here on we know there IS an intersection */
/* if ALL of the verts are infront of us then we know it intersects ? */
- if(v1[2] < pt[2] && v2[2] < pt[2] && v3[2] < pt[2]) {
+ if (v1[2] < pt[2] && v2[2] < pt[2] && v3[2] < pt[2]) {
return 1;
}
else {
@@ -842,10 +848,9 @@ static int project_paint_occlude_ptv(float pt[3], float v1[4], float v2[4], floa
}
-static int project_paint_occlude_ptv_clip(
- const ProjPaintState *ps, const MFace *mf,
- float pt[3], float v1[4], float v2[4], float v3[4],
- const int side )
+static int project_paint_occlude_ptv_clip(const ProjPaintState *ps, const MFace *mf,
+ float pt[3], float v1[4], float v2[4], float v3[4],
+ const int side)
{
float w[3], wco[3];
int ret = project_paint_occlude_ptv(pt, v1, v2, v3, w, ps->is_ortho);
@@ -853,14 +858,14 @@ static int project_paint_occlude_ptv_clip(
if (ret <= 0)
return ret;
- if (ret==1) { /* weights not calculated */
- if (ps->is_ortho) barycentric_weights_v2(v1, v2, v3, pt, w);
- else barycentric_weights_v2_persp(v1, v2, v3, pt, w);
+ if (ret == 1) { /* weights not calculated */
+ if (ps->is_ortho) barycentric_weights_v2(v1, v2, v3, pt, w);
+ else barycentric_weights_v2_persp(v1, v2, v3, pt, w);
}
/* Test if we're in the clipped area, */
- if (side) interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v3].co, ps->dm_mvert[mf->v4].co, w);
- else interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v2].co, ps->dm_mvert[mf->v3].co, w);
+ if (side) interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v3].co, ps->dm_mvert[mf->v4].co, w);
+ else interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v2].co, ps->dm_mvert[mf->v3].co, w);
if (!ED_view3d_clipping_test(ps->rv3d, wco, TRUE)) {
return 1;
@@ -879,7 +884,7 @@ static int project_bucket_point_occluded(const ProjPaintState *ps, LinkNode *buc
int face_index;
int isect_ret;
float w[3]; /* not needed when clipping */
- const short do_clip= ps->rv3d ? ps->rv3d->rflag & RV3D_CLIPPING : 0;
+ const short do_clip = ps->rv3d ? ps->rv3d->rflag & RV3D_CLIPPING : 0;
/* we could return 0 for 1 face buckets, as long as this function assumes
* that the point its testing is only every originated from an existing face */
@@ -889,19 +894,19 @@ static int project_bucket_point_occluded(const ProjPaintState *ps, LinkNode *buc
if (orig_face != face_index) {
mf = ps->dm_mface + face_index;
- if(do_clip)
+ if (do_clip)
isect_ret = project_paint_occlude_ptv_clip(ps, mf, pixelScreenCo, ps->screenCoords[mf->v1], ps->screenCoords[mf->v2], ps->screenCoords[mf->v3], 0);
else
isect_ret = project_paint_occlude_ptv(pixelScreenCo, ps->screenCoords[mf->v1], ps->screenCoords[mf->v2], ps->screenCoords[mf->v3], w, ps->is_ortho);
- /* Note, if isect_ret==-1 then we dont want to test the other side of the quad */
- if (isect_ret==0 && mf->v4) {
- if(do_clip)
+ /* Note, if isect_ret==-1 then we don't want to test the other side of the quad */
+ if (isect_ret == 0 && mf->v4) {
+ if (do_clip)
isect_ret = project_paint_occlude_ptv_clip(ps, mf, pixelScreenCo, ps->screenCoords[mf->v1], ps->screenCoords[mf->v3], ps->screenCoords[mf->v4], 1);
else
isect_ret = project_paint_occlude_ptv(pixelScreenCo, ps->screenCoords[mf->v1], ps->screenCoords[mf->v3], ps->screenCoords[mf->v4], w, ps->is_ortho);
}
- if (isect_ret>=1) {
+ if (isect_ret >= 1) {
/* TODO - we may want to cache the first hit,
* it is not possible to swap the face order in the list anymore */
return 1;
@@ -920,28 +925,28 @@ static int line_isect_y(const float p1[2], const float p2[2], const float y_leve
{
float y_diff;
- if (y_level==p1[1]) { /* are we touching the first point? - no interpolation needed */
+ if (y_level == p1[1]) { /* are we touching the first point? - no interpolation needed */
*x_isect = p1[0];
return ISECT_TRUE_P1;
}
- if (y_level==p2[1]) { /* are we touching the second point? - no interpolation needed */
+ if (y_level == p2[1]) { /* are we touching the second point? - no interpolation needed */
*x_isect = p2[0];
return ISECT_TRUE_P2;
}
- y_diff= fabsf(p1[1]-p2[1]); /* yuck, horizontal line, we cant do much here */
+ y_diff = fabsf(p1[1] - p2[1]); /* yuck, horizontal line, we cant do much here */
if (y_diff < 0.000001f) {
- *x_isect = (p1[0]+p2[0]) * 0.5f;
+ *x_isect = (p1[0] + p2[0]) * 0.5f;
return ISECT_TRUE;
}
if (p1[1] > y_level && p2[1] < y_level) {
- *x_isect = (p2[0]*(p1[1]-y_level) + p1[0]*(y_level-p2[1])) / y_diff; /*(p1[1]-p2[1]);*/
+ *x_isect = (p2[0] * (p1[1] - y_level) + p1[0] * (y_level - p2[1])) / y_diff; /*(p1[1]-p2[1]);*/
return ISECT_TRUE;
}
else if (p1[1] < y_level && p2[1] > y_level) {
- *x_isect = (p2[0]*(y_level-p1[1]) + p1[0]*(p2[1]-y_level)) / y_diff; /*(p2[1]-p1[1]);*/
+ *x_isect = (p2[0] * (y_level - p1[1]) + p1[0] * (p2[1] - y_level)) / y_diff; /*(p2[1]-p1[1]);*/
return ISECT_TRUE;
}
else {
@@ -953,28 +958,28 @@ static int line_isect_x(const float p1[2], const float p2[2], const float x_leve
{
float x_diff;
- if (x_level==p1[0]) { /* are we touching the first point? - no interpolation needed */
+ if (x_level == p1[0]) { /* are we touching the first point? - no interpolation needed */
*y_isect = p1[1];
return ISECT_TRUE_P1;
}
- if (x_level==p2[0]) { /* are we touching the second point? - no interpolation needed */
+ if (x_level == p2[0]) { /* are we touching the second point? - no interpolation needed */
*y_isect = p2[1];
return ISECT_TRUE_P2;
}
- x_diff= fabsf(p1[0]-p2[0]); /* yuck, horizontal line, we cant do much here */
+ x_diff = fabsf(p1[0] - p2[0]); /* yuck, horizontal line, we cant do much here */
if (x_diff < 0.000001f) { /* yuck, vertical line, we cant do much here */
- *y_isect = (p1[0]+p2[0]) * 0.5f;
+ *y_isect = (p1[0] + p2[0]) * 0.5f;
return ISECT_TRUE;
}
if (p1[0] > x_level && p2[0] < x_level) {
- *y_isect = (p2[1]*(p1[0]-x_level) + p1[1]*(x_level-p2[0])) / x_diff; /*(p1[0]-p2[0]);*/
+ *y_isect = (p2[1] * (p1[0] - x_level) + p1[1] * (x_level - p2[0])) / x_diff; /*(p1[0]-p2[0]);*/
return ISECT_TRUE;
}
else if (p1[0] < x_level && p2[0] > x_level) {
- *y_isect = (p2[1]*(x_level-p1[0]) + p1[1]*(p2[0]-x_level)) / x_diff; /*(p2[0]-p1[0]);*/
+ *y_isect = (p2[1] * (x_level - p1[0]) + p1[1] * (p2[0] - x_level)) / x_diff; /*(p2[0]-p1[0]);*/
return ISECT_TRUE;
}
else {
@@ -1002,7 +1007,7 @@ static int cmp_uv(const float vec2a[2], const float vec2b[2])
if (xb < 0.0f) xb += 1.0f;
if (yb < 0.0f) yb += 1.0f;
- return ((fabsf(xa-xb) < PROJ_GEOM_TOLERANCE) && (fabsf(ya-yb) < PROJ_GEOM_TOLERANCE)) ? 1:0;
+ return ((fabsf(xa - xb) < PROJ_GEOM_TOLERANCE) && (fabsf(ya - yb) < PROJ_GEOM_TOLERANCE)) ? 1 : 0;
}
#endif
@@ -1010,11 +1015,12 @@ static int cmp_uv(const float vec2a[2], const float vec2b[2])
* return zero if there is no area in the returned rectangle */
#ifndef PROJ_DEBUG_NOSEAMBLEED
static int pixel_bounds_uv(
- const float uv1[2], const float uv2[2], const float uv3[2], const float uv4[2],
- rcti *bounds_px,
- const int ibuf_x, const int ibuf_y,
- int is_quad
-) {
+ const float uv1[2], const float uv2[2], const float uv3[2], const float uv4[2],
+ rcti *bounds_px,
+ const int ibuf_x, const int ibuf_y,
+ int is_quad
+ )
+{
float min_uv[2], max_uv[2]; /* UV bounds */
INIT_MINMAX2(min_uv, max_uv);
@@ -1028,21 +1034,21 @@ static int pixel_bounds_uv(
bounds_px->xmin = (int)(ibuf_x * min_uv[0]);
bounds_px->ymin = (int)(ibuf_y * min_uv[1]);
- bounds_px->xmax = (int)(ibuf_x * max_uv[0]) +1;
- bounds_px->ymax = (int)(ibuf_y * max_uv[1]) +1;
+ bounds_px->xmax = (int)(ibuf_x * max_uv[0]) + 1;
+ bounds_px->ymax = (int)(ibuf_y * max_uv[1]) + 1;
- /*printf("%d %d %d %d \n", min_px[0], min_px[1], max_px[0], max_px[1]);*/
+ /*printf("%d %d %d %d\n", min_px[0], min_px[1], max_px[0], max_px[1]);*/
/* face uses no UV area when quantized to pixels? */
return (bounds_px->xmin == bounds_px->xmax || bounds_px->ymin == bounds_px->ymax) ? 0 : 1;
}
#endif
-static int pixel_bounds_array(float (* uv)[2], rcti *bounds_px, const int ibuf_x, const int ibuf_y, int tot)
+static int pixel_bounds_array(float (*uv)[2], rcti *bounds_px, const int ibuf_x, const int ibuf_y, int tot)
{
float min_uv[2], max_uv[2]; /* UV bounds */
- if (tot==0) {
+ if (tot == 0) {
return 0;
}
@@ -1056,10 +1062,10 @@ static int pixel_bounds_array(float (* uv)[2], rcti *bounds_px, const int ibuf_x
bounds_px->xmin = (int)(ibuf_x * min_uv[0]);
bounds_px->ymin = (int)(ibuf_y * min_uv[1]);
- bounds_px->xmax = (int)(ibuf_x * max_uv[0]) +1;
- bounds_px->ymax = (int)(ibuf_y * max_uv[1]) +1;
+ bounds_px->xmax = (int)(ibuf_x * max_uv[0]) + 1;
+ bounds_px->ymax = (int)(ibuf_y * max_uv[1]) + 1;
- /*printf("%d %d %d %d \n", min_px[0], min_px[1], max_px[0], max_px[1]);*/
+ /*printf("%d %d %d %d\n", min_px[0], min_px[1], max_px[0], max_px[1]);*/
/* face uses no UV area when quantized to pixels? */
return (bounds_px->xmin == bounds_px->xmax || bounds_px->ymin == bounds_px->ymax) ? 0 : 1;
@@ -1095,15 +1101,15 @@ static int check_seam(const ProjPaintState *ps, const int orig_face, const int o
/* We need to know the order of the verts in the adjacent face
* set the i1_fidx and i2_fidx to (0,1,2,3) */
- if (mf->v1==i1) i1_fidx = 0;
- else if (mf->v2==i1) i1_fidx = 1;
- else if (mf->v3==i1) i1_fidx = 2;
- else if (mf->v4 && mf->v4==i1) i1_fidx = 3;
-
- if (mf->v1==i2) i2_fidx = 0;
- else if (mf->v2==i2) i2_fidx = 1;
- else if (mf->v3==i2) i2_fidx = 2;
- else if (mf->v4 && mf->v4==i2) i2_fidx = 3;
+ if (mf->v1 == i1) i1_fidx = 0;
+ else if (mf->v2 == i1) i1_fidx = 1;
+ else if (mf->v3 == i1) i1_fidx = 2;
+ else if (mf->v4 && mf->v4 == i1) i1_fidx = 3;
+
+ if (mf->v1 == i2) i2_fidx = 0;
+ else if (mf->v2 == i2) i2_fidx = 1;
+ else if (mf->v3 == i2) i2_fidx = 2;
+ else if (mf->v4 && mf->v4 == i2) i2_fidx = 3;
/* Only need to check if 'i2_fidx' is valid because we know i1_fidx is the same vert on both faces */
if (i2_fidx != -1) {
@@ -1118,9 +1124,9 @@ static int check_seam(const ProjPaintState *ps, const int orig_face, const int o
*orig_fidx = (i1_fidx < i2_fidx) ? i1_fidx : i2_fidx;
/* first test if they have the same image */
- if ( (orig_tpage == tpage) &&
- cmp_uv(orig_tf->uv[orig_i1_fidx], tf->uv[i1_fidx]) &&
- cmp_uv(orig_tf->uv[orig_i2_fidx], tf->uv[i2_fidx]) )
+ if ((orig_tpage == tpage) &&
+ cmp_uv(orig_tf->uv[orig_i1_fidx], tf->uv[i1_fidx]) &&
+ cmp_uv(orig_tf->uv[orig_i2_fidx], tf->uv[i2_fidx]) )
{
// printf("SEAM (NONE)\n");
return 0;
@@ -1143,14 +1149,14 @@ static int check_seam(const ProjPaintState *ps, const int orig_face, const int o
* note that the image aspect is taken into account */
static void uv_image_outset(float (*orig_uv)[2], float (*outset_uv)[2], const float scaler, const int ibuf_x, const int ibuf_y, const int is_quad)
{
- float a1, a2, a3, a4=0.0f;
+ float a1, a2, a3, a4 = 0.0f;
float puv[4][2]; /* pixelspace uv's */
float no1[2], no2[2], no3[2], no4[2]; /* normals */
float dir1[2], dir2[2], dir3[2], dir4[2];
float ibuf_inv[2];
- ibuf_inv[0]= 1.0f / (float)ibuf_x;
- ibuf_inv[1]= 1.0f / (float)ibuf_y;
+ ibuf_inv[0] = 1.0f / (float)ibuf_x;
+ ibuf_inv[1] = 1.0f / (float)ibuf_y;
/* make UV's in pixel space so we can */
puv[0][0] = orig_uv[0][0] * ibuf_x;
@@ -1188,15 +1194,15 @@ static void uv_image_outset(float (*orig_uv)[2], float (*outset_uv)[2], const fl
* This is incorrect. Its already given radians but without it wont work.
* need to look into a fix - campbell */
if (is_quad) {
- a1 = shell_angle_to_dist(angle_normalized_v2v2(dir4, dir1) * ((float)M_PI/180.0f));
- a2 = shell_angle_to_dist(angle_normalized_v2v2(dir1, dir2) * ((float)M_PI/180.0f));
- a3 = shell_angle_to_dist(angle_normalized_v2v2(dir2, dir3) * ((float)M_PI/180.0f));
- a4 = shell_angle_to_dist(angle_normalized_v2v2(dir3, dir4) * ((float)M_PI/180.0f));
+ a1 = shell_angle_to_dist(angle_normalized_v2v2(dir4, dir1) * ((float)M_PI / 180.0f));
+ a2 = shell_angle_to_dist(angle_normalized_v2v2(dir1, dir2) * ((float)M_PI / 180.0f));
+ a3 = shell_angle_to_dist(angle_normalized_v2v2(dir2, dir3) * ((float)M_PI / 180.0f));
+ a4 = shell_angle_to_dist(angle_normalized_v2v2(dir3, dir4) * ((float)M_PI / 180.0f));
}
else {
- a1 = shell_angle_to_dist(angle_normalized_v2v2(dir3, dir1) * ((float)M_PI/180.0f));
- a2 = shell_angle_to_dist(angle_normalized_v2v2(dir1, dir2) * ((float)M_PI/180.0f));
- a3 = shell_angle_to_dist(angle_normalized_v2v2(dir2, dir3) * ((float)M_PI/180.0f));
+ a1 = shell_angle_to_dist(angle_normalized_v2v2(dir3, dir1) * ((float)M_PI / 180.0f));
+ a2 = shell_angle_to_dist(angle_normalized_v2v2(dir1, dir2) * ((float)M_PI / 180.0f));
+ a3 = shell_angle_to_dist(angle_normalized_v2v2(dir2, dir3) * ((float)M_PI / 180.0f));
}
if (is_quad) {
@@ -1208,10 +1214,10 @@ static void uv_image_outset(float (*orig_uv)[2], float (*outset_uv)[2], const fl
normalize_v2(no2);
normalize_v2(no3);
normalize_v2(no4);
- mul_v2_fl(no1, a1*scaler);
- mul_v2_fl(no2, a2*scaler);
- mul_v2_fl(no3, a3*scaler);
- mul_v2_fl(no4, a4*scaler);
+ mul_v2_fl(no1, a1 * scaler);
+ mul_v2_fl(no2, a2 * scaler);
+ mul_v2_fl(no3, a3 * scaler);
+ mul_v2_fl(no4, a4 * scaler);
add_v2_v2v2(outset_uv[0], puv[0], no1);
add_v2_v2v2(outset_uv[1], puv[1], no2);
add_v2_v2v2(outset_uv[2], puv[2], no3);
@@ -1228,9 +1234,9 @@ static void uv_image_outset(float (*orig_uv)[2], float (*outset_uv)[2], const fl
normalize_v2(no1);
normalize_v2(no2);
normalize_v2(no3);
- mul_v2_fl(no1, a1*scaler);
- mul_v2_fl(no2, a2*scaler);
- mul_v2_fl(no3, a3*scaler);
+ mul_v2_fl(no1, a1 * scaler);
+ mul_v2_fl(no2, a2 * scaler);
+ mul_v2_fl(no3, a3 * scaler);
add_v2_v2v2(outset_uv[0], puv[0], no1);
add_v2_v2v2(outset_uv[1], puv[1], no2);
add_v2_v2v2(outset_uv[2], puv[2], no3);
@@ -1254,16 +1260,16 @@ static void project_face_seams_init(const ProjPaintState *ps, const int face_ind
int fidx2 = 0; /* next fidx in the face (0,1,2,3) -> (1,2,3,0) or (0,1,2) -> (1,2,0) for a tri */
do {
- if ((ps->faceSeamFlags[face_index] & (1<<fidx1|16<<fidx1)) == 0) {
+ if ((ps->faceSeamFlags[face_index] & (1 << fidx1 | 16 << fidx1)) == 0) {
if (check_seam(ps, face_index, fidx1, fidx2, &other_face, &other_fidx)) {
- ps->faceSeamFlags[face_index] |= 1<<fidx1;
+ ps->faceSeamFlags[face_index] |= 1 << fidx1;
if (other_face != -1)
- ps->faceSeamFlags[other_face] |= 1<<other_fidx;
+ ps->faceSeamFlags[other_face] |= 1 << other_fidx;
}
else {
- ps->faceSeamFlags[face_index] |= 16<<fidx1;
+ ps->faceSeamFlags[face_index] |= 16 << fidx1;
if (other_face != -1)
- ps->faceSeamFlags[other_face] |= 16<<other_fidx; /* second 4 bits for disabled */
+ ps->faceSeamFlags[other_face] |= 16 << other_fidx; /* second 4 bits for disabled */
}
}
@@ -1278,11 +1284,11 @@ static void project_face_seams_init(const ProjPaintState *ps, const int face_ind
*
* This is used for finding a pixels location in screenspace for painting */
static void screen_px_from_ortho(
- float uv[2],
- float v1co[3], float v2co[3], float v3co[3], /* Screenspace coords */
- float uv1co[2], float uv2co[2], float uv3co[2],
- float pixelScreenCo[4],
- float w[3])
+ float uv[2],
+ float v1co[3], float v2co[3], float v3co[3], /* Screenspace coords */
+ float uv1co[2], float uv2co[2], float uv3co[2],
+ float pixelScreenCo[4],
+ float w[3])
{
barycentric_weights_v2(uv1co, uv2co, uv3co, uv, w);
interp_v3_v3v3v3(pixelScreenCo, v1co, v2co, v3co, w);
@@ -1291,11 +1297,11 @@ static void screen_px_from_ortho(
/* same as screen_px_from_ortho except we need to take into account
* the perspective W coord for each vert */
static void screen_px_from_persp(
- float uv[2],
- float v1co[4], float v2co[4], float v3co[4], /* screenspace coords */
- float uv1co[2], float uv2co[2], float uv3co[2],
- float pixelScreenCo[4],
- float w[3])
+ float uv[2],
+ float v1co[4], float v2co[4], float v3co[4], /* screenspace coords */
+ float uv1co[2], float uv2co[2], float uv3co[2],
+ float pixelScreenCo[4],
+ float w[3])
{
float wtot_inv, wtot;
@@ -1306,7 +1312,7 @@ static void screen_px_from_persp(
w[1] *= v2co[3];
w[2] *= v3co[3];
- wtot = w[0]+w[1]+w[2];
+ wtot = w[0] + w[1] + w[2];
if (wtot > 0.0f) {
wtot_inv = 1.0f / wtot;
@@ -1315,7 +1321,7 @@ static void screen_px_from_persp(
w[2] *= wtot_inv;
}
else {
- w[0] = w[1] = w[2] = 1.0f/3.0f; /* dummy values for zero area face */
+ w[0] = w[1] = w[2] = 1.0f / 3.0f; /* dummy values for zero area face */
}
/* done re-weighting */
@@ -1328,7 +1334,7 @@ static void project_face_pixel(const MTFace *tf_other, ImBuf *ibuf_other, const
float uv_other[2], x, y;
uvCo1 = (float *)tf_other->uv[0];
- if (side==1) {
+ if (side == 1) {
uvCo2 = (float *)tf_other->uv[2];
uvCo3 = (float *)tf_other->uv[3];
}
@@ -1337,7 +1343,7 @@ static void project_face_pixel(const MTFace *tf_other, ImBuf *ibuf_other, const
uvCo3 = (float *)tf_other->uv[2];
}
- interp_v2_v2v2v2(uv_other, uvCo1, uvCo2, uvCo3, (float*)w);
+ interp_v2_v2v2v2(uv_other, uvCo1, uvCo2, uvCo3, (float *)w);
/* use */
uvco_to_wrapped_pxco(uv_other, ibuf_other->x, ibuf_other->y, &x, &y);
@@ -1352,12 +1358,12 @@ static void project_face_pixel(const MTFace *tf_other, ImBuf *ibuf_other, const
}
-/* run this outside project_paint_uvpixel_init since pixels with mask 0 dont need init */
+/* run this outside project_paint_uvpixel_init since pixels with mask 0 don't need init */
static float project_paint_uvpixel_mask(
- const ProjPaintState *ps,
- const int face_index,
- const int side,
- const float w[3])
+ const ProjPaintState *ps,
+ const int face_index,
+ const int side,
+ const float w[3])
{
float mask;
@@ -1376,10 +1382,10 @@ static float project_paint_uvpixel_mask(
project_face_pixel(tf_other, ibuf_other, w, side, rgba_ub, rgba_f);
if (ibuf_other->rect_float) { /* from float to float */
- mask = ((rgba_f[0]+rgba_f[1]+rgba_f[2])/3.0f) * rgba_f[3];
+ mask = ((rgba_f[0] + rgba_f[1] + rgba_f[2]) / 3.0f) * rgba_f[3];
}
else { /* from char to float */
- mask = ((rgba_ub[0]+rgba_ub[1]+rgba_ub[2])/(256*3.0f)) * (rgba_ub[3]/256.0f);
+ mask = ((rgba_ub[0] + rgba_ub[1] + rgba_ub[2]) / (256 * 3.0f)) * (rgba_ub[3] / 256.0f);
}
if (!ps->do_layer_stencil_inv) /* matching the gimps layer mask black/white rules, white==full opacity */
@@ -1392,7 +1398,8 @@ static float project_paint_uvpixel_mask(
else {
return 0.0f;
}
- } else {
+ }
+ else {
mask = 1.0f;
}
@@ -1402,7 +1409,7 @@ static float project_paint_uvpixel_mask(
short *no1, *no2, *no3;
float no[3], angle;
no1 = ps->dm_mvert[mf->v1].no;
- if (side==1) {
+ if (side == 1) {
no2 = ps->dm_mvert[mf->v3].no;
no3 = ps->dm_mvert[mf->v4].no;
}
@@ -1411,9 +1418,9 @@ static float project_paint_uvpixel_mask(
no3 = ps->dm_mvert[mf->v3].no;
}
- no[0] = w[0]*no1[0] + w[1]*no2[0] + w[2]*no3[0];
- no[1] = w[0]*no1[1] + w[1]*no2[1] + w[2]*no3[1];
- no[2] = w[0]*no1[2] + w[1]*no2[2] + w[2]*no3[2];
+ no[0] = w[0] * no1[0] + w[1] * no2[0] + w[2] * no3[0];
+ no[1] = w[0] * no1[1] + w[1] * no2[1] + w[2] * no3[1];
+ no[2] = w[0] * no1[2] + w[1] * no2[2] + w[2] * no3[2];
normalize_v3(no);
/* now we can use the normal as a mask */
@@ -1425,7 +1432,7 @@ static float project_paint_uvpixel_mask(
float viewDirPersp[3];
float *co1, *co2, *co3;
co1 = ps->dm_mvert[mf->v1].co;
- if (side==1) {
+ if (side == 1) {
co2 = ps->dm_mvert[mf->v3].co;
co3 = ps->dm_mvert[mf->v4].co;
}
@@ -1435,9 +1442,9 @@ static float project_paint_uvpixel_mask(
}
/* Get the direction from the viewPoint to the pixel and normalize */
- viewDirPersp[0] = (ps->viewPos[0] - (w[0]*co1[0] + w[1]*co2[0] + w[2]*co3[0]));
- viewDirPersp[1] = (ps->viewPos[1] - (w[0]*co1[1] + w[1]*co2[1] + w[2]*co3[1]));
- viewDirPersp[2] = (ps->viewPos[2] - (w[0]*co1[2] + w[1]*co2[2] + w[2]*co3[2]));
+ viewDirPersp[0] = (ps->viewPos[0] - (w[0] * co1[0] + w[1] * co2[0] + w[2] * co3[0]));
+ viewDirPersp[1] = (ps->viewPos[1] - (w[0] * co1[1] + w[1] * co2[1] + w[2] * co3[1]));
+ viewDirPersp[2] = (ps->viewPos[2] - (w[0] * co1[2] + w[1] * co2[2] + w[2] * co3[2]));
normalize_v3(viewDirPersp);
angle = angle_normalized_v3v3(viewDirPersp, no);
@@ -1452,7 +1459,7 @@ static float project_paint_uvpixel_mask(
}
// This only works when the opacity dosnt change while painting, stylus pressure messes with this
- // so dont use it.
+ // so don't use it.
// if (ps->is_airbrush==0) mask *= brush_alpha(ps->brush);
return mask;
@@ -1461,30 +1468,30 @@ static float project_paint_uvpixel_mask(
/* run this function when we know a bucket's, face's pixel can be initialized,
* return the ProjPixel which is added to 'ps->bucketRect[bucket_index]' */
static ProjPixel *project_paint_uvpixel_init(
- const ProjPaintState *ps,
- MemArena *arena,
- const ImBuf *ibuf,
- short x_px, short y_px,
- const float mask,
- const int face_index,
- const int image_index,
- const float pixelScreenCo[4],
- const int side,
- const float w[3])
+ const ProjPaintState *ps,
+ MemArena *arena,
+ const ImBuf *ibuf,
+ short x_px, short y_px,
+ const float mask,
+ const int face_index,
+ const int image_index,
+ const float pixelScreenCo[4],
+ const int side,
+ const float w[3])
{
ProjPixel *projPixel;
short size;
/* wrap pixel location */
x_px = x_px % ibuf->x;
- if (x_px<0) x_px += ibuf->x;
+ if (x_px < 0) x_px += ibuf->x;
y_px = y_px % ibuf->y;
- if (y_px<0) y_px += ibuf->y;
+ if (y_px < 0) y_px += ibuf->y;
- if (ps->tool==PAINT_TOOL_CLONE) {
+ if (ps->tool == PAINT_TOOL_CLONE) {
size = sizeof(ProjPixelClone);
}
- else if (ps->tool==PAINT_TOOL_SMEAR) {
+ else if (ps->tool == PAINT_TOOL_SMEAR) {
size = sizeof(ProjPixelClone);
}
else {
@@ -1506,7 +1513,7 @@ static ProjPixel *project_paint_uvpixel_init(
projPixel->origColor.uint = projPixel->newColor.uint = *projPixel->pixel.uint_pt;
}
- /* screenspace unclamped, we could keep its z and w values but dont need them at the moment */
+ /* screenspace unclamped, we could keep its z and w values but don't need them at the moment */
copy_v2_v2(projPixel->projCoSS, pixelScreenCo);
projPixel->x_px = x_px;
@@ -1520,7 +1527,7 @@ static ProjPixel *project_paint_uvpixel_init(
((int)(((float)y_px / (float)ibuf->y) * PROJ_BOUNDBOX_DIV)) * PROJ_BOUNDBOX_DIV;
/* done with view3d_project_float inline */
- if (ps->tool==PAINT_TOOL_CLONE) {
+ if (ps->tool == PAINT_TOOL_CLONE) {
if (ps->dm_mtface_clone) {
ImBuf *ibuf_other;
Image *other_tpage = project_paint_face_image(ps, ps->dm_mtface_clone, face_index);
@@ -1580,8 +1587,8 @@ static ProjPixel *project_paint_uvpixel_init(
}
#ifdef PROJ_DEBUG_PAINT
- if (ibuf->rect_float) projPixel->pixel.f_pt[0] = 0;
- else projPixel->pixel.ch_pt[0] = 0;
+ if (ibuf->rect_float) projPixel->pixel.f_pt[0] = 0;
+ else projPixel->pixel.ch_pt[0] = 0;
#endif
projPixel->image_index = image_index;
@@ -1589,13 +1596,13 @@ static ProjPixel *project_paint_uvpixel_init(
}
static int line_clip_rect2f(
- rctf *rect,
- const float l1[2], const float l2[2],
- float l1_clip[2], float l2_clip[2])
+ rctf *rect,
+ const float l1[2], const float l2[2],
+ float l1_clip[2], float l2_clip[2])
{
/* first account for horizontal, then vertical lines */
/* horiz */
- if (fabsf(l1[1]-l2[1]) < PROJ_GEOM_TOLERANCE) {
+ if (fabsf(l1[1] - l2[1]) < PROJ_GEOM_TOLERANCE) {
/* is the line out of range on its Y axis? */
if (l1[1] < rect->ymin || l1[1] > rect->ymax) {
return 0;
@@ -1606,7 +1613,7 @@ static int line_clip_rect2f(
}
- if (fabsf(l1[0]-l2[0]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/
+ if (fabsf(l1[0] - l2[0]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/
if (BLI_in_rctf(rect, l1[0], l1[1])) {
copy_v2_v2(l1_clip, l1);
copy_v2_v2(l2_clip, l2);
@@ -1623,7 +1630,7 @@ static int line_clip_rect2f(
CLAMP(l2_clip[0], rect->xmin, rect->xmax);
return 1;
}
- else if (fabsf(l1[0]-l2[0]) < PROJ_GEOM_TOLERANCE) {
+ else if (fabsf(l1[0] - l2[0]) < PROJ_GEOM_TOLERANCE) {
/* is the line out of range on its X axis? */
if (l1[0] < rect->xmin || l1[0] > rect->xmax) {
return 0;
@@ -1634,7 +1641,7 @@ static int line_clip_rect2f(
return 0;
}
- if (fabsf(l1[1]-l2[1]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/
+ if (fabsf(l1[1] - l2[1]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/
if (BLI_in_rctf(rect, l1[0], l1[1])) {
copy_v2_v2(l1_clip, l1);
copy_v2_v2(l2_clip, l2);
@@ -1745,7 +1752,7 @@ static int line_clip_rect2f(
/* scale the quad & tri about its center
* scaling by PROJ_FACE_SCALE_SEAM (0.99x) is used for getting fake UV pixel coords that are on the
- * edge of the face but slightly inside it occlusion tests dont return hits on adjacent faces */
+ * edge of the face but slightly inside it occlusion tests don't return hits on adjacent faces */
#ifndef PROJ_DEBUG_NOSEAMBLEED
static void scale_quad(float insetCos[4][3], float *origCos[4], const float inset)
{
@@ -1796,9 +1803,9 @@ static float len_squared_v2v2_alt(const float *v1, const float v2_1, const float
{
float x, y;
- x = v1[0]-v2_1;
- y = v1[1]-v2_2;
- return x*x+y*y;
+ x = v1[0] - v2_1;
+ y = v1[1] - v2_2;
+ return x * x + y * y;
}
/* note, use a squared value so we can use len_squared_v2v2
@@ -1810,13 +1817,14 @@ 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]) )
+ if ((bucket_bounds->xmin <= cent[0] && bucket_bounds->xmax >= cent[0]) ||
+ (bucket_bounds->ymin <= cent[1] && bucket_bounds->ymax >= cent[1]))
{
return 1;
}
@@ -1850,17 +1858,19 @@ static int project_bucket_isect_circle(const float cent[2], const float radius_s
/* Note for rect_to_uvspace_ortho() and rect_to_uvspace_persp()
* in ortho view this function gives good results when bucket_bounds are outside the triangle
- * however in some cases, perspective view will mess up with faces that have minimal screenspace area (viewed from the side)
+ * however in some cases, perspective view will mess up with faces that have minimal screenspace area
+ * (viewed from the side)
*
- * for this reason its not relyable in this case so we'll use the Simple Barycentric' funcs that only account for points inside the triangle.
+ * for this reason its not reliable in this case so we'll use the Simple Barycentric'
+ * funcs that only account for points inside the triangle.
* however switching back to this for ortho is always an option */
static void rect_to_uvspace_ortho(
- rctf *bucket_bounds,
- float *v1coSS, float *v2coSS, float *v3coSS,
- float *uv1co, float *uv2co, float *uv3co,
- float bucket_bounds_uv[4][2],
- const int flip)
+ rctf *bucket_bounds,
+ float *v1coSS, float *v2coSS, float *v3coSS,
+ float *uv1co, float *uv2co, float *uv3co,
+ float bucket_bounds_uv[4][2],
+ const int flip)
{
float uv[2];
float w[3];
@@ -1869,32 +1879,32 @@ static void rect_to_uvspace_ortho(
uv[0] = bucket_bounds->xmax;
uv[1] = bucket_bounds->ymin;
barycentric_weights_v2(v1coSS, v2coSS, v3coSS, uv, w);
- interp_v2_v2v2v2(bucket_bounds_uv[flip?3:0], uv1co, uv2co, uv3co, w);
+ interp_v2_v2v2v2(bucket_bounds_uv[flip ? 3 : 0], uv1co, uv2co, uv3co, w);
//uv[0] = bucket_bounds->xmax; // set above
uv[1] = bucket_bounds->ymax;
barycentric_weights_v2(v1coSS, v2coSS, v3coSS, uv, w);
- interp_v2_v2v2v2(bucket_bounds_uv[flip?2:1], uv1co, uv2co, uv3co, w);
+ interp_v2_v2v2v2(bucket_bounds_uv[flip ? 2 : 1], uv1co, uv2co, uv3co, w);
uv[0] = bucket_bounds->xmin;
//uv[1] = bucket_bounds->ymax; // set above
barycentric_weights_v2(v1coSS, v2coSS, v3coSS, uv, w);
- interp_v2_v2v2v2(bucket_bounds_uv[flip?1:2], uv1co, uv2co, uv3co, w);
+ interp_v2_v2v2v2(bucket_bounds_uv[flip ? 1 : 2], uv1co, uv2co, uv3co, w);
//uv[0] = bucket_bounds->xmin; // set above
uv[1] = bucket_bounds->ymin;
barycentric_weights_v2(v1coSS, v2coSS, v3coSS, uv, w);
- interp_v2_v2v2v2(bucket_bounds_uv[flip?0:3], uv1co, uv2co, uv3co, w);
+ interp_v2_v2v2v2(bucket_bounds_uv[flip ? 0 : 3], uv1co, uv2co, uv3co, w);
}
/* same as above but use barycentric_weights_v2_persp */
static void rect_to_uvspace_persp(
- rctf *bucket_bounds,
- float *v1coSS, float *v2coSS, float *v3coSS,
- float *uv1co, float *uv2co, float *uv3co,
- float bucket_bounds_uv[4][2],
- const int flip
- )
+ rctf *bucket_bounds,
+ float *v1coSS, float *v2coSS, float *v3coSS,
+ float *uv1co, float *uv2co, float *uv3co,
+ float bucket_bounds_uv[4][2],
+ const int flip
+ )
{
float uv[2];
float w[3];
@@ -1903,22 +1913,22 @@ static void rect_to_uvspace_persp(
uv[0] = bucket_bounds->xmax;
uv[1] = bucket_bounds->ymin;
barycentric_weights_v2_persp(v1coSS, v2coSS, v3coSS, uv, w);
- interp_v2_v2v2v2(bucket_bounds_uv[flip?3:0], uv1co, uv2co, uv3co, w);
+ interp_v2_v2v2v2(bucket_bounds_uv[flip ? 3 : 0], uv1co, uv2co, uv3co, w);
//uv[0] = bucket_bounds->xmax; // set above
uv[1] = bucket_bounds->ymax;
barycentric_weights_v2_persp(v1coSS, v2coSS, v3coSS, uv, w);
- interp_v2_v2v2v2(bucket_bounds_uv[flip?2:1], uv1co, uv2co, uv3co, w);
+ interp_v2_v2v2v2(bucket_bounds_uv[flip ? 2 : 1], uv1co, uv2co, uv3co, w);
uv[0] = bucket_bounds->xmin;
//uv[1] = bucket_bounds->ymax; // set above
barycentric_weights_v2_persp(v1coSS, v2coSS, v3coSS, uv, w);
- interp_v2_v2v2v2(bucket_bounds_uv[flip?1:2], uv1co, uv2co, uv3co, w);
+ interp_v2_v2v2v2(bucket_bounds_uv[flip ? 1 : 2], uv1co, uv2co, uv3co, w);
//uv[0] = bucket_bounds->xmin; // set above
uv[1] = bucket_bounds->ymin;
barycentric_weights_v2_persp(v1coSS, v2coSS, v3coSS, uv, w);
- interp_v2_v2v2v2(bucket_bounds_uv[flip?0:3], uv1co, uv2co, uv3co, w);
+ interp_v2_v2v2v2(bucket_bounds_uv[flip ? 0 : 3], uv1co, uv2co, uv3co, w);
}
/* This works as we need it to but we can save a few steps and not use it */
@@ -1928,24 +1938,24 @@ static float angle_2d_clockwise(const float p1[2], const float p2[2], const floa
{
float v1[2], v2[2];
- v1[0] = p1[0]-p2[0]; v1[1] = p1[1]-p2[1];
- v2[0] = p3[0]-p2[0]; v2[1] = p3[1]-p2[1];
+ v1[0] = p1[0] - p2[0]; v1[1] = p1[1] - p2[1];
+ v2[0] = p3[0] - p2[0]; v2[1] = p3[1] - p2[1];
- return -atan2(v1[0]*v2[1] - v1[1]*v2[0], v1[0]*v2[0]+v1[1]*v2[1]);
+ return -atan2(v1[0] * v2[1] - v1[1] * v2[0], v1[0] * v2[0] + v1[1] * v2[1]);
}
#endif
#define ISECT_1 (1)
-#define ISECT_2 (1<<1)
-#define ISECT_3 (1<<2)
-#define ISECT_4 (1<<3)
-#define ISECT_ALL3 ((1<<3)-1)
-#define ISECT_ALL4 ((1<<4)-1)
+#define ISECT_2 (1 << 1)
+#define ISECT_3 (1 << 2)
+#define ISECT_4 (1 << 3)
+#define ISECT_ALL3 ((1 << 3) - 1)
+#define ISECT_ALL4 ((1 << 4) - 1)
/* limit must be a fraction over 1.0f */
static int IsectPT2Df_limit(float pt[2], float v1[2], float v2[2], float v3[2], float limit)
{
- return ((area_tri_v2(pt,v1,v2) + area_tri_v2(pt,v2,v3) + area_tri_v2(pt,v3,v1)) / (area_tri_v2(v1,v2,v3))) < limit;
+ return ((area_tri_v2(pt, v1, v2) + area_tri_v2(pt, v2, v3) + area_tri_v2(pt, v3, v1)) / (area_tri_v2(v1, v2, v3))) < limit;
}
/* Clip the face by a bucket and set the uv-space bucket_bounds_uv
@@ -1953,21 +1963,21 @@ static int IsectPT2Df_limit(float pt[2], float v1[2], float v2[2], float v3[2],
* */
static int float_z_sort_flip(const void *p1, const void *p2)
{
- return (((float *)p1)[2] < ((float *)p2)[2] ? 1:-1);
+ return (((float *)p1)[2] < ((float *)p2)[2] ? 1 : -1);
}
static int float_z_sort(const void *p1, const void *p2)
{
- return (((float *)p1)[2] < ((float *)p2)[2] ?-1:1);
+ return (((float *)p1)[2] < ((float *)p2)[2] ? -1 : 1);
}
static void project_bucket_clip_face(
- const int is_ortho,
- rctf *bucket_bounds,
- float *v1coSS, float *v2coSS, float *v3coSS,
- float *uv1co, float *uv2co, float *uv3co,
- float bucket_bounds_uv[8][2],
- int *tot)
+ const int is_ortho,
+ rctf *bucket_bounds,
+ float *v1coSS, float *v2coSS, float *v3coSS,
+ float *uv1co, float *uv2co, float *uv3co,
+ float bucket_bounds_uv[8][2],
+ int *tot)
{
int inside_bucket_flag = 0;
int inside_face_flag = 0;
@@ -1977,11 +1987,11 @@ static void project_bucket_clip_face(
/* get the UV space bounding box */
inside_bucket_flag |= BLI_in_rctf(bucket_bounds, v1coSS[0], v1coSS[1]);
- inside_bucket_flag |= BLI_in_rctf(bucket_bounds, v2coSS[0], v2coSS[1]) << 1;
- inside_bucket_flag |= BLI_in_rctf(bucket_bounds, v3coSS[0], v3coSS[1]) << 2;
+ inside_bucket_flag |= BLI_in_rctf(bucket_bounds, v2coSS[0], v2coSS[1]) << 1;
+ inside_bucket_flag |= BLI_in_rctf(bucket_bounds, v3coSS[0], v3coSS[1]) << 2;
if (inside_bucket_flag == ISECT_ALL3) {
- /* all screenspace points are inside the bucket bounding box, this means we dont need to clip and can simply return the UVs */
+ /* all screenspace points are inside the bucket bounding box, this means we don't need to clip and can simply return the UVs */
if (flip) { /* facing the back? */
copy_v2_v2(bucket_bounds_uv[0], uv3co);
copy_v2_v2(bucket_bounds_uv[1], uv2co);
@@ -2001,25 +2011,25 @@ static void project_bucket_clip_face(
/* use IsectPT2Df_limit here so we catch points are are touching the tri edge (or a small fraction over) */
bucket_bounds_ss[0][0] = bucket_bounds->xmax;
bucket_bounds_ss[0][1] = bucket_bounds->ymin;
- inside_face_flag |= (IsectPT2Df_limit(bucket_bounds_ss[0], v1coSS, v2coSS, v3coSS, 1+PROJ_GEOM_TOLERANCE) ? ISECT_1 : 0);
+ inside_face_flag |= (IsectPT2Df_limit(bucket_bounds_ss[0], v1coSS, v2coSS, v3coSS, 1 + PROJ_GEOM_TOLERANCE) ? ISECT_1 : 0);
bucket_bounds_ss[1][0] = bucket_bounds->xmax;
bucket_bounds_ss[1][1] = bucket_bounds->ymax;
- inside_face_flag |= (IsectPT2Df_limit(bucket_bounds_ss[1], v1coSS, v2coSS, v3coSS, 1+PROJ_GEOM_TOLERANCE) ? ISECT_2 : 0);
+ inside_face_flag |= (IsectPT2Df_limit(bucket_bounds_ss[1], v1coSS, v2coSS, v3coSS, 1 + PROJ_GEOM_TOLERANCE) ? ISECT_2 : 0);
bucket_bounds_ss[2][0] = bucket_bounds->xmin;
bucket_bounds_ss[2][1] = bucket_bounds->ymax;
- inside_face_flag |= (IsectPT2Df_limit(bucket_bounds_ss[2], v1coSS, v2coSS, v3coSS, 1+PROJ_GEOM_TOLERANCE) ? ISECT_3 : 0);
+ inside_face_flag |= (IsectPT2Df_limit(bucket_bounds_ss[2], v1coSS, v2coSS, v3coSS, 1 + PROJ_GEOM_TOLERANCE) ? ISECT_3 : 0);
bucket_bounds_ss[3][0] = bucket_bounds->xmin;
bucket_bounds_ss[3][1] = bucket_bounds->ymin;
- inside_face_flag |= (IsectPT2Df_limit(bucket_bounds_ss[3], v1coSS, v2coSS, v3coSS, 1+PROJ_GEOM_TOLERANCE) ? ISECT_4 : 0);
+ inside_face_flag |= (IsectPT2Df_limit(bucket_bounds_ss[3], v1coSS, v2coSS, v3coSS, 1 + PROJ_GEOM_TOLERANCE) ? ISECT_4 : 0);
if (inside_face_flag == ISECT_ALL4) {
/* bucket is totally inside the screenspace face, we can safely use weights */
- if (is_ortho) rect_to_uvspace_ortho(bucket_bounds, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, bucket_bounds_uv, flip);
- else rect_to_uvspace_persp(bucket_bounds, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, bucket_bounds_uv, flip);
+ if (is_ortho) rect_to_uvspace_ortho(bucket_bounds, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, bucket_bounds_uv, flip);
+ else rect_to_uvspace_persp(bucket_bounds, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, bucket_bounds_uv, flip);
*tot = 4;
return;
@@ -2054,33 +2064,33 @@ static void project_bucket_clip_face(
(*tot) = 0;
- if (inside_face_flag & ISECT_1) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[0]); (*tot)++; }
- if (inside_face_flag & ISECT_2) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[1]); (*tot)++; }
- if (inside_face_flag & ISECT_3) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[2]); (*tot)++; }
- if (inside_face_flag & ISECT_4) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[3]); (*tot)++; }
+ if (inside_face_flag & ISECT_1) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[0]); (*tot)++; }
+ if (inside_face_flag & ISECT_2) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[1]); (*tot)++; }
+ if (inside_face_flag & ISECT_3) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[2]); (*tot)++; }
+ if (inside_face_flag & ISECT_4) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[3]); (*tot)++; }
+
+ if (inside_bucket_flag & ISECT_1) { copy_v2_v2(isectVCosSS[*tot], v1coSS); (*tot)++; }
+ if (inside_bucket_flag & ISECT_2) { copy_v2_v2(isectVCosSS[*tot], v2coSS); (*tot)++; }
+ if (inside_bucket_flag & ISECT_3) { copy_v2_v2(isectVCosSS[*tot], v3coSS); (*tot)++; }
- if (inside_bucket_flag & ISECT_1) { copy_v2_v2(isectVCosSS[*tot], v1coSS); (*tot)++; }
- if (inside_bucket_flag & ISECT_2) { copy_v2_v2(isectVCosSS[*tot], v2coSS); (*tot)++; }
- if (inside_bucket_flag & ISECT_3) { copy_v2_v2(isectVCosSS[*tot], v3coSS); (*tot)++; }
-
- if ((inside_bucket_flag & (ISECT_1|ISECT_2)) != (ISECT_1|ISECT_2)) {
+ if ((inside_bucket_flag & (ISECT_1 | ISECT_2)) != (ISECT_1 | ISECT_2)) {
if (line_clip_rect2f(bucket_bounds, v1coSS, v2coSS, v1_clipSS, v2_clipSS)) {
- if ((inside_bucket_flag & ISECT_1)==0) { copy_v2_v2(isectVCosSS[*tot], v1_clipSS); (*tot)++; }
- if ((inside_bucket_flag & ISECT_2)==0) { copy_v2_v2(isectVCosSS[*tot], v2_clipSS); (*tot)++; }
+ if ((inside_bucket_flag & ISECT_1) == 0) { copy_v2_v2(isectVCosSS[*tot], v1_clipSS); (*tot)++; }
+ if ((inside_bucket_flag & ISECT_2) == 0) { copy_v2_v2(isectVCosSS[*tot], v2_clipSS); (*tot)++; }
}
}
- if ((inside_bucket_flag & (ISECT_2|ISECT_3)) != (ISECT_2|ISECT_3)) {
+ if ((inside_bucket_flag & (ISECT_2 | ISECT_3)) != (ISECT_2 | ISECT_3)) {
if (line_clip_rect2f(bucket_bounds, v2coSS, v3coSS, v1_clipSS, v2_clipSS)) {
- if ((inside_bucket_flag & ISECT_2)==0) { copy_v2_v2(isectVCosSS[*tot], v1_clipSS); (*tot)++; }
- if ((inside_bucket_flag & ISECT_3)==0) { copy_v2_v2(isectVCosSS[*tot], v2_clipSS); (*tot)++; }
+ if ((inside_bucket_flag & ISECT_2) == 0) { copy_v2_v2(isectVCosSS[*tot], v1_clipSS); (*tot)++; }
+ if ((inside_bucket_flag & ISECT_3) == 0) { copy_v2_v2(isectVCosSS[*tot], v2_clipSS); (*tot)++; }
}
}
- if ((inside_bucket_flag & (ISECT_3|ISECT_1)) != (ISECT_3|ISECT_1)) {
+ if ((inside_bucket_flag & (ISECT_3 | ISECT_1)) != (ISECT_3 | ISECT_1)) {
if (line_clip_rect2f(bucket_bounds, v3coSS, v1coSS, v1_clipSS, v2_clipSS)) {
- if ((inside_bucket_flag & ISECT_3)==0) { copy_v2_v2(isectVCosSS[*tot], v1_clipSS); (*tot)++; }
- if ((inside_bucket_flag & ISECT_1)==0) { copy_v2_v2(isectVCosSS[*tot], v2_clipSS); (*tot)++; }
+ if ((inside_bucket_flag & ISECT_3) == 0) { copy_v2_v2(isectVCosSS[*tot], v1_clipSS); (*tot)++; }
+ if ((inside_bucket_flag & ISECT_1) == 0) { copy_v2_v2(isectVCosSS[*tot], v2_clipSS); (*tot)++; }
}
}
@@ -2092,7 +2102,7 @@ static void project_bucket_clip_face(
/* now we have all points we need, collect their angles and sort them clockwise */
- for(i=0; i<(*tot); i++) {
+ for (i = 0; i < (*tot); i++) {
cent[0] += isectVCosSS[i][0];
cent[1] += isectVCosSS[i][1];
}
@@ -2104,8 +2114,8 @@ static void project_bucket_clip_face(
/* Collect angles for every point around the center point */
-#if 0 /* uses a few more cycles then the above loop */
- for(i=0; i<(*tot); i++) {
+#if 0 /* uses a few more cycles then the above loop */
+ for (i = 0; i < (*tot); i++) {
isectVCosSS[i][2] = angle_2d_clockwise(up, cent, isectVCosSS[i]);
}
#endif
@@ -2113,18 +2123,18 @@ static void project_bucket_clip_face(
v1_clipSS[0] = cent[0]; /* Abuse this var for the loop below */
v1_clipSS[1] = cent[1] + 1.0f;
- for(i=0; i<(*tot); i++) {
+ for (i = 0; i < (*tot); i++) {
v2_clipSS[0] = isectVCosSS[i][0] - cent[0];
v2_clipSS[1] = isectVCosSS[i][1] - cent[1];
- isectVCosSS[i][2] = atan2f(v1_clipSS[0]*v2_clipSS[1] - v1_clipSS[1]*v2_clipSS[0], v1_clipSS[0]*v2_clipSS[0]+v1_clipSS[1]*v2_clipSS[1]);
+ isectVCosSS[i][2] = atan2f(v1_clipSS[0] * v2_clipSS[1] - v1_clipSS[1] * v2_clipSS[0], v1_clipSS[0] * v2_clipSS[0] + v1_clipSS[1] * v2_clipSS[1]);
}
- if (flip) qsort(isectVCosSS, *tot, sizeof(float)*3, float_z_sort_flip);
- else qsort(isectVCosSS, *tot, sizeof(float)*3, float_z_sort);
+ if (flip) qsort(isectVCosSS, *tot, sizeof(float) * 3, float_z_sort_flip);
+ else qsort(isectVCosSS, *tot, sizeof(float) * 3, float_z_sort);
/* remove doubles */
/* first/last check */
- if (fabsf(isectVCosSS[0][0]-isectVCosSS[(*tot)-1][0]) < PROJ_GEOM_TOLERANCE && fabsf(isectVCosSS[0][1]-isectVCosSS[(*tot)-1][1]) < PROJ_GEOM_TOLERANCE) {
+ if (fabsf(isectVCosSS[0][0] - isectVCosSS[(*tot) - 1][0]) < PROJ_GEOM_TOLERANCE && fabsf(isectVCosSS[0][1] - isectVCosSS[(*tot) - 1][1]) < PROJ_GEOM_TOLERANCE) {
(*tot)--;
}
@@ -2136,16 +2146,16 @@ static void project_bucket_clip_face(
}
doubles = TRUE;
- while (doubles==TRUE) {
+ while (doubles == TRUE) {
doubles = FALSE;
- for(i=1; i<(*tot); i++) {
- if (fabsf(isectVCosSS[i-1][0]-isectVCosSS[i][0]) < PROJ_GEOM_TOLERANCE &&
- fabsf(isectVCosSS[i-1][1]-isectVCosSS[i][1]) < PROJ_GEOM_TOLERANCE)
+ for (i = 1; i < (*tot); i++) {
+ if (fabsf(isectVCosSS[i - 1][0] - isectVCosSS[i][0]) < PROJ_GEOM_TOLERANCE &&
+ fabsf(isectVCosSS[i - 1][1] - isectVCosSS[i][1]) < PROJ_GEOM_TOLERANCE)
{
int j;
- for(j=i+1; j<(*tot); j++) {
- isectVCosSS[j-1][0] = isectVCosSS[j][0];
- isectVCosSS[j-1][1] = isectVCosSS[j][1];
+ for (j = i + 1; j < (*tot); j++) {
+ isectVCosSS[j - 1][0] = isectVCosSS[j][0];
+ isectVCosSS[j - 1][1] = isectVCosSS[j][1];
}
doubles = TRUE; /* keep looking for more doubles */
(*tot)--;
@@ -2162,13 +2172,13 @@ static void project_bucket_clip_face(
if (is_ortho) {
- for(i=0; i<(*tot); i++) {
+ for (i = 0; i < (*tot); i++) {
barycentric_weights_v2(v1coSS, v2coSS, v3coSS, isectVCosSS[i], w);
interp_v2_v2v2v2(bucket_bounds_uv[i], uv1co, uv2co, uv3co, w);
}
}
else {
- for(i=0; i<(*tot); i++) {
+ for (i = 0; i < (*tot); i++) {
barycentric_weights_v2_persp(v1coSS, v2coSS, v3coSS, isectVCosSS[i], w);
interp_v2_v2v2v2(bucket_bounds_uv[i], uv1co, uv2co, uv3co, w);
}
@@ -2182,14 +2192,14 @@ static void project_bucket_clip_face(
/* If there are ever any problems, */
float test_uv[4][2];
int i;
- if (is_ortho) rect_to_uvspace_ortho(bucket_bounds, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, test_uv, flip);
- else rect_to_uvspace_persp(bucket_bounds, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, test_uv, flip);
+ if (is_ortho) rect_to_uvspace_ortho(bucket_bounds, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, test_uv, flip);
+ else rect_to_uvspace_persp(bucket_bounds, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, test_uv, flip);
printf("( [(%f,%f), (%f,%f), (%f,%f), (%f,%f)], ", test_uv[0][0], test_uv[0][1], test_uv[1][0], test_uv[1][1], test_uv[2][0], test_uv[2][1], test_uv[3][0], test_uv[3][1]);
printf(" [(%f,%f), (%f,%f), (%f,%f)], ", uv1co[0], uv1co[1], uv2co[0], uv2co[1], uv3co[0], uv3co[1]);
printf("[");
- for (i=0; i < (*tot); i++) {
+ for (i = 0; i < (*tot); i++) {
printf("(%f, %f),", bucket_bounds_uv[i][0], bucket_bounds_uv[i][1]);
}
printf("]),\\\n");
@@ -2197,51 +2207,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
@@ -2257,11 +2267,11 @@ if __name__ == '__main__':
static int IsectPoly2Df(const float pt[2], float uv[][2], const int tot)
{
int i;
- if (line_point_side_v2(uv[tot-1], uv[0], pt) < 0.0f)
+ if (line_point_side_v2(uv[tot - 1], uv[0], pt) < 0.0f)
return 0;
- for (i=1; i<tot; i++) {
- if (line_point_side_v2(uv[i-1], uv[i], pt) < 0.0f)
+ for (i = 1; i < tot; i++) {
+ if (line_point_side_v2(uv[i - 1], uv[i], pt) < 0.0f)
return 0;
}
@@ -2271,10 +2281,10 @@ static int IsectPoly2Df(const float pt[2], float uv[][2], const int tot)
static int IsectPoly2Df_twoside(const float pt[2], float uv[][2], const int tot)
{
int i;
- int side = (line_point_side_v2(uv[tot-1], uv[0], pt) > 0.0f);
+ int side = (line_point_side_v2(uv[tot - 1], uv[0], pt) > 0.0f);
- for (i=1; i<tot; i++) {
- if ((line_point_side_v2(uv[i-1], uv[i], pt) > 0.0f) != side)
+ for (i = 1; i < tot; i++) {
+ if ((line_point_side_v2(uv[i - 1], uv[i], pt) > 0.0f) != side)
return 0;
}
@@ -2296,7 +2306,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
/* UV/pixel seeking data */
int x; /* Image X-Pixel */
- int y;/* Image Y-Pixel */
+ int y; /* Image Y-Pixel */
float mask;
float uv[2]; /* Image floating point UV - same as x, y but from 0.0-1.0 */
@@ -2325,7 +2335,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
int uv_clip_tot;
const short is_ortho = ps->is_ortho;
const short do_backfacecull = ps->do_backfacecull;
- const short do_clip= ps->rv3d ? ps->rv3d->rflag & RV3D_CLIPPING : 0;
+ const short do_clip = ps->rv3d ? ps->rv3d->rflag & RV3D_CLIPPING : 0;
vCo[0] = ps->dm_mvert[mf->v1].co;
vCo[1] = ps->dm_mvert[mf->v2].co;
@@ -2335,16 +2345,16 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
/* Use tf_uv_pxoffset instead of tf->uv so we can offset the UV half a pixel
* this is done so we can avoid offseting all the pixels by 0.5 which causes
* problems when wrapping negative coords */
- xhalfpx = (0.5f+ (PROJ_GEOM_TOLERANCE/3.0f) ) / ibuf_xf;
- yhalfpx = (0.5f+ (PROJ_GEOM_TOLERANCE/4.0f) ) / ibuf_yf;
+ xhalfpx = (0.5f + (PROJ_GEOM_TOLERANCE / 3.0f) ) / ibuf_xf;
+ 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.
*/
@@ -2359,7 +2369,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
tf_uv_pxoffset[2][1] = tf->uv[2][1] - yhalfpx;
if (mf->v4) {
- vCo[3] = ps->dm_mvert[ mf->v4 ].co;
+ vCo[3] = ps->dm_mvert[mf->v4].co;
tf_uv_pxoffset[3][0] = tf->uv[3][0] - xhalfpx;
tf_uv_pxoffset[3][1] = tf->uv[3][1] - yhalfpx;
@@ -2370,44 +2380,44 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
}
do {
- if (side==1) {
- i1=0; i2=2; i3=3;
+ if (side == 1) {
+ i1 = 0; i2 = 2; i3 = 3;
}
else {
- i1=0; i2=1; i3=2;
+ i1 = 0; i2 = 1; i3 = 2;
}
uv1co = tf_uv_pxoffset[i1]; // was tf->uv[i1];
uv2co = tf_uv_pxoffset[i2]; // was tf->uv[i2];
uv3co = tf_uv_pxoffset[i3]; // was tf->uv[i3];
- v1coSS = ps->screenCoords[ (*(&mf->v1 + i1)) ];
- v2coSS = ps->screenCoords[ (*(&mf->v1 + i2)) ];
- v3coSS = ps->screenCoords[ (*(&mf->v1 + i3)) ];
+ v1coSS = ps->screenCoords[(*(&mf->v1 + i1))];
+ v2coSS = ps->screenCoords[(*(&mf->v1 + i2))];
+ v3coSS = ps->screenCoords[(*(&mf->v1 + i3))];
/* This funtion gives is a concave polyline in UV space from the clipped quad and tri*/
project_bucket_clip_face(
- is_ortho, bucket_bounds,
- v1coSS, v2coSS, v3coSS,
- uv1co, uv2co, uv3co,
- uv_clip, &uv_clip_tot
- );
+ is_ortho, bucket_bounds,
+ v1coSS, v2coSS, v3coSS,
+ uv1co, uv2co, uv3co,
+ uv_clip, &uv_clip_tot
+ );
/* sometimes this happens, better just allow for 8 intersectiosn even though there should be max 6 */
- /*
- if (uv_clip_tot>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)) {
- if(clamp_u) {
+ if (clamp_u) {
CLAMP(bounds_px.xmin, 0, ibuf->x);
CLAMP(bounds_px.xmax, 0, ibuf->x);
}
- if(clamp_v) {
+ if (clamp_v) {
CLAMP(bounds_px.ymin, 0, ibuf->y);
CLAMP(bounds_px.ymax, 0, ibuf->y);
}
@@ -2426,17 +2436,18 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
/* Note about IsectPoly2Df_twoside, checking the face or uv flipping doesnt work,
* could check the poly direction but better to do this */
- if( (do_backfacecull && IsectPoly2Df(uv, uv_clip, uv_clip_tot)) ||
- (do_backfacecull==0 && IsectPoly2Df_twoside(uv, uv_clip, uv_clip_tot))) {
+ if ((do_backfacecull && IsectPoly2Df(uv, uv_clip, uv_clip_tot)) ||
+ (do_backfacecull == 0 && IsectPoly2Df_twoside(uv, uv_clip, uv_clip_tot)))
+ {
has_x_isect = has_isect = 1;
- if (is_ortho) screen_px_from_ortho(uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo, w);
- else screen_px_from_persp(uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo, w);
+ if (is_ortho) screen_px_from_ortho(uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo, w);
+ else screen_px_from_persp(uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo, w);
- /* a pitty we need to get the worldspace pixel location here */
- if(do_clip) {
- interp_v3_v3v3v3(wco, ps->dm_mvert[ (*(&mf->v1 + i1)) ].co, ps->dm_mvert[ (*(&mf->v1 + i2)) ].co, ps->dm_mvert[ (*(&mf->v1 + i3)) ].co, w);
+ /* a pity we need to get the worldspace pixel location here */
+ if (do_clip) {
+ interp_v3_v3v3v3(wco, ps->dm_mvert[(*(&mf->v1 + i1))].co, ps->dm_mvert[(*(&mf->v1 + i2))].co, ps->dm_mvert[(*(&mf->v1 + i3))].co, w);
if (ED_view3d_clipping_test(ps->rv3d, wco, TRUE)) {
continue; /* Watch out that no code below this needs to run */
}
@@ -2445,16 +2456,16 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
/* Is this UV visible from the view? - raytrace */
/* project_paint_PickFace is less complex, use for testing */
//if (project_paint_PickFace(ps, pixelScreenCo, w, &side) == face_index) {
- if (ps->do_occlude==0 || !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo)) {
+ if (ps->do_occlude == 0 || !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo)) {
mask = project_paint_uvpixel_mask(ps, face_index, side, w);
if (mask > 0.0f) {
BLI_linklist_prepend_arena(
- bucketPixelNodes,
- project_paint_uvpixel_init(ps, arena, ibuf, x, y, mask, face_index, image_index, pixelScreenCo, side, w),
- arena
- );
+ bucketPixelNodes,
+ project_paint_uvpixel_init(ps, arena, ibuf, x, y, mask, face_index, image_index, pixelScreenCo, side, w),
+ arena
+ );
}
}
@@ -2468,15 +2479,15 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
}
-#if 0 /* TODO - investigate why this dosnt work sometimes! it should! */
+#if 0 /* TODO - investigate why this dosnt work sometimes! it should! */
/* no intersection for this entire row, after some intersection above means we can quit now */
- if (has_x_isect==0 && has_isect) {
+ if (has_x_isect == 0 && has_isect) {
break;
}
#endif
}
}
- } while(side--);
+ } while (side--);
@@ -2485,25 +2496,25 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
int face_seam_flag;
if (ps->thread_tot > 1)
- BLI_lock_thread(LOCK_CUSTOM1); /* Other threads could be modifying these vars */
+ BLI_lock_thread(LOCK_CUSTOM1); /* Other threads could be modifying these vars */
face_seam_flag = ps->faceSeamFlags[face_index];
/* are any of our edges un-initialized? */
- if ((face_seam_flag & (PROJ_FACE_SEAM1|PROJ_FACE_NOSEAM1))==0 ||
- (face_seam_flag & (PROJ_FACE_SEAM2|PROJ_FACE_NOSEAM2))==0 ||
- (face_seam_flag & (PROJ_FACE_SEAM3|PROJ_FACE_NOSEAM3))==0 ||
- (face_seam_flag & (PROJ_FACE_SEAM4|PROJ_FACE_NOSEAM4))==0
- ) {
+ if ((face_seam_flag & (PROJ_FACE_SEAM1 | PROJ_FACE_NOSEAM1)) == 0 ||
+ (face_seam_flag & (PROJ_FACE_SEAM2 | PROJ_FACE_NOSEAM2)) == 0 ||
+ (face_seam_flag & (PROJ_FACE_SEAM3 | PROJ_FACE_NOSEAM3)) == 0 ||
+ (face_seam_flag & (PROJ_FACE_SEAM4 | PROJ_FACE_NOSEAM4)) == 0)
+ {
project_face_seams_init(ps, face_index, mf->v4);
face_seam_flag = ps->faceSeamFlags[face_index];
//printf("seams - %d %d %d %d\n", flag&PROJ_FACE_SEAM1, flag&PROJ_FACE_SEAM2, flag&PROJ_FACE_SEAM3, flag&PROJ_FACE_SEAM4);
}
- if ((face_seam_flag & (PROJ_FACE_SEAM1|PROJ_FACE_SEAM2|PROJ_FACE_SEAM3|PROJ_FACE_SEAM4))==0) {
+ if ((face_seam_flag & (PROJ_FACE_SEAM1 | PROJ_FACE_SEAM2 | PROJ_FACE_SEAM3 | PROJ_FACE_SEAM4)) == 0) {
if (ps->thread_tot > 1)
- BLI_unlock_thread(LOCK_CUSTOM1); /* Other threads could be modifying these vars */
+ BLI_unlock_thread(LOCK_CUSTOM1); /* Other threads could be modifying these vars */
}
else {
@@ -2524,45 +2535,45 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
float fac1, fac2, ftot;
- if (outset_uv[0][0]==FLT_MAX) /* first time initialize */
+ if (outset_uv[0][0] == FLT_MAX) /* first time initialize */
uv_image_outset(tf_uv_pxoffset, outset_uv, ps->seam_bleed_px, ibuf->x, ibuf->y, mf->v4);
/* ps->faceSeamUVs cant be modified when threading, now this is done we can unlock */
if (ps->thread_tot > 1)
- BLI_unlock_thread(LOCK_CUSTOM1); /* Other threads could be modifying these vars */
+ BLI_unlock_thread(LOCK_CUSTOM1); /* Other threads could be modifying these vars */
vCoSS[0] = ps->screenCoords[mf->v1];
vCoSS[1] = ps->screenCoords[mf->v2];
vCoSS[2] = ps->screenCoords[mf->v3];
if (mf->v4)
- vCoSS[3] = ps->screenCoords[ mf->v4 ];
+ vCoSS[3] = ps->screenCoords[mf->v4];
/* PROJ_FACE_SCALE_SEAM must be slightly less then 1.0f */
if (is_ortho) {
- if (mf->v4) scale_quad(insetCos, vCoSS, PROJ_FACE_SCALE_SEAM);
- else scale_tri(insetCos, vCoSS, PROJ_FACE_SCALE_SEAM);
+ if (mf->v4) scale_quad(insetCos, vCoSS, PROJ_FACE_SCALE_SEAM);
+ else scale_tri(insetCos, vCoSS, PROJ_FACE_SCALE_SEAM);
}
else {
- if (mf->v4) scale_quad(insetCos, vCo, PROJ_FACE_SCALE_SEAM);
- else scale_tri(insetCos, vCo, PROJ_FACE_SCALE_SEAM);
+ if (mf->v4) scale_quad(insetCos, vCo, PROJ_FACE_SCALE_SEAM);
+ else scale_tri(insetCos, vCo, PROJ_FACE_SCALE_SEAM);
}
side = 0; /* for triangles this wont need to change */
for (fidx1 = 0; fidx1 < (mf->v4 ? 4 : 3); fidx1++) {
- if (mf->v4) fidx2 = (fidx1==3) ? 0 : fidx1+1; /* next fidx in the face (0,1,2,3) -> (1,2,3,0) */
- else fidx2 = (fidx1==2) ? 0 : fidx1+1; /* next fidx in the face (0,1,2) -> (1,2,0) */
+ if (mf->v4) fidx2 = (fidx1 == 3) ? 0 : fidx1 + 1; /* next fidx in the face (0,1,2,3) -> (1,2,3,0) */
+ else fidx2 = (fidx1 == 2) ? 0 : fidx1 + 1; /* next fidx in the face (0,1,2) -> (1,2,0) */
- if ( (face_seam_flag & (1<<fidx1)) && /* 1<<fidx1 -> PROJ_FACE_SEAM# */
- line_clip_rect2f(bucket_bounds, vCoSS[fidx1], vCoSS[fidx2], bucket_clip_edges[0], bucket_clip_edges[1])
- ) {
+ if ((face_seam_flag & (1 << fidx1)) && /* 1<<fidx1 -> PROJ_FACE_SEAM# */
+ line_clip_rect2f(bucket_bounds, vCoSS[fidx1], vCoSS[fidx2], bucket_clip_edges[0], bucket_clip_edges[1]))
+ {
ftot = len_v2v2(vCoSS[fidx1], vCoSS[fidx2]); /* screenspace edge length */
if (ftot > 0.0f) { /* avoid div by zero */
if (mf->v4) {
- if (fidx1==2 || fidx2==2) side= 1;
- else side= 0;
+ if (fidx1 == 2 || fidx2 == 2) side = 1;
+ else side = 0;
}
fac1 = len_v2v2(vCoSS[fidx1], bucket_clip_edges[0]) / ftot;
@@ -2598,39 +2609,39 @@ 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 (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);
- */
+#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]);
fac = line_point_factor_v2(uv, seam_subsection[0], seam_subsection[1]);
- if (fac < 0.0f) { copy_v3_v3(pixelScreenCo, edge_verts_inset_clip[0]); }
- else if (fac > 1.0f) { copy_v3_v3(pixelScreenCo, edge_verts_inset_clip[1]); }
- else { interp_v3_v3v3(pixelScreenCo, edge_verts_inset_clip[0], edge_verts_inset_clip[1], fac); }
+ if (fac < 0.0f) { copy_v3_v3(pixelScreenCo, edge_verts_inset_clip[0]); }
+ else if (fac > 1.0f) { copy_v3_v3(pixelScreenCo, edge_verts_inset_clip[1]); }
+ else { interp_v3_v3v3(pixelScreenCo, edge_verts_inset_clip[0], edge_verts_inset_clip[1], fac); }
if (!is_ortho) {
pixelScreenCo[3] = 1.0f;
mul_m4_v4((float(*)[4])ps->projectMat, pixelScreenCo); /* cast because of const */
- pixelScreenCo[0] = (float)(ps->winx/2.0f)+(ps->winx/2.0f)*pixelScreenCo[0]/pixelScreenCo[3];
- pixelScreenCo[1] = (float)(ps->winy/2.0f)+(ps->winy/2.0f)*pixelScreenCo[1]/pixelScreenCo[3];
- pixelScreenCo[2] = pixelScreenCo[2]/pixelScreenCo[3]; /* Use the depth for bucket point occlusion */
+ pixelScreenCo[0] = (float)(ps->winx / 2.0f) + (ps->winx / 2.0f) * pixelScreenCo[0] / pixelScreenCo[3];
+ pixelScreenCo[1] = (float)(ps->winy / 2.0f) + (ps->winy / 2.0f) * pixelScreenCo[1] / pixelScreenCo[3];
+ pixelScreenCo[2] = pixelScreenCo[2] / pixelScreenCo[3]; /* Use the depth for bucket point occlusion */
}
- if (ps->do_occlude==0 || !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo)) {
+ if (ps->do_occlude == 0 || !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo)) {
/* Only bother calculating the weights if we intersect */
if (ps->do_mask_normal || ps->dm_mtface_clone) {
#if 1
/* get the UV on the line since we want to copy the pixels from there for bleeding */
float uv_close[2];
- float fac= closest_to_line_v2(uv_close, uv, tf_uv_pxoffset[fidx1], tf_uv_pxoffset[fidx2]);
- if (fac < 0.0f) copy_v2_v2(uv_close, tf_uv_pxoffset[fidx1]);
- else if (fac > 1.0f) copy_v2_v2(uv_close, tf_uv_pxoffset[fidx2]);
+ float fac = closest_to_line_v2(uv_close, uv, tf_uv_pxoffset[fidx1], tf_uv_pxoffset[fidx2]);
+ if (fac < 0.0f) copy_v2_v2(uv_close, tf_uv_pxoffset[fidx1]);
+ else if (fac > 1.0f) copy_v2_v2(uv_close, tf_uv_pxoffset[fidx2]);
if (side) {
barycentric_weights_v2(tf_uv_pxoffset[0], tf_uv_pxoffset[2], tf_uv_pxoffset[3], uv_close, w);
@@ -2638,27 +2649,27 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
else {
barycentric_weights_v2(tf_uv_pxoffset[0], tf_uv_pxoffset[1], tf_uv_pxoffset[2], uv_close, w);
}
-#else /* this is buggy with quads, dont use for now */
+#else /* this is buggy with quads, don't use for now */
/* Cheat, we know where we are along the edge so work out the weights from that */
- fac = fac1 + (fac * (fac2-fac1));
+ fac = fac1 + (fac * (fac2 - fac1));
- w[0]=w[1]=w[2]= 0.0;
+ w[0] = w[1] = w[2] = 0.0;
if (side) {
- w[fidx1?fidx1-1:0] = 1.0f-fac;
- w[fidx2?fidx2-1:0] = fac;
+ w[fidx1 ? fidx1 - 1 : 0] = 1.0f - fac;
+ w[fidx2 ? fidx2 - 1 : 0] = fac;
}
else {
- w[fidx1] = 1.0f-fac;
+ w[fidx1] = 1.0f - fac;
w[fidx2] = fac;
}
#endif
}
- /* a pitty we need to get the worldspace pixel location here */
- if(do_clip) {
- if (side) interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v3].co, ps->dm_mvert[mf->v4].co, w);
- else interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v2].co, ps->dm_mvert[mf->v3].co, w);
+ /* a pity we need to get the worldspace pixel location here */
+ if (do_clip) {
+ if (side) interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v3].co, ps->dm_mvert[mf->v4].co, w);
+ else interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v2].co, ps->dm_mvert[mf->v3].co, w);
if (ED_view3d_clipping_test(ps->rv3d, wco, TRUE)) {
continue; /* Watch out that no code below this needs to run */
@@ -2669,10 +2680,10 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
if (mask > 0.0f) {
BLI_linklist_prepend_arena(
- bucketPixelNodes,
- project_paint_uvpixel_init(ps, arena, ibuf, x, y, mask, face_index, image_index, pixelScreenCo, side, w),
- arena
- );
+ bucketPixelNodes,
+ project_paint_uvpixel_init(ps, arena, ibuf, x, y, mask, face_index, image_index, pixelScreenCo, side, w),
+ arena
+ );
}
}
@@ -2683,9 +2694,9 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
}
}
-#if 0 /* TODO - investigate why this dosnt work sometimes! it should! */
+#if 0 /* TODO - investigate why this dosnt work sometimes! it should! */
/* no intersection for this entire row, after some intersection above means we can quit now */
- if (has_x_isect==0 && has_isect) {
+ if (has_x_isect == 0 && has_isect) {
break;
}
#endif
@@ -2711,7 +2722,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);
@@ -2722,37 +2733,37 @@ static void project_paint_bucket_bounds(const ProjPaintState *ps, const float mi
/* set bucket_bounds to a screen space-aligned floating point bound-box */
static void project_bucket_bounds(const ProjPaintState *ps, const int bucket_x, const int bucket_y, rctf *bucket_bounds)
{
- bucket_bounds->xmin = ps->screenMin[0]+((bucket_x)*(ps->screen_width / ps->buckets_x)); /* left */
- bucket_bounds->xmax = ps->screenMin[0]+((bucket_x+1)*(ps->screen_width / ps->buckets_x)); /* right */
+ bucket_bounds->xmin = ps->screenMin[0] + ((bucket_x) * (ps->screen_width / ps->buckets_x)); /* left */
+ bucket_bounds->xmax = ps->screenMin[0] + ((bucket_x + 1) * (ps->screen_width / ps->buckets_x)); /* right */
- bucket_bounds->ymin = ps->screenMin[1]+((bucket_y)*(ps->screen_height / ps->buckets_y)); /* bottom */
- bucket_bounds->ymax = ps->screenMin[1]+((bucket_y+1)*(ps->screen_height / ps->buckets_y)); /* top */
+ bucket_bounds->ymin = ps->screenMin[1] + ((bucket_y) * (ps->screen_height / ps->buckets_y)); /* bottom */
+ bucket_bounds->ymax = ps->screenMin[1] + ((bucket_y + 1) * (ps->screen_height / ps->buckets_y)); /* top */
}
/* Fill this bucket with pixels from the faces that intersect it.
*
- * have bucket_bounds as an argument so we don;t need to give bucket_x/y the rect function needs */
+ * have bucket_bounds as an argument so we don't need to give bucket_x/y the rect function needs */
static void project_bucket_init(const ProjPaintState *ps, const int thread_index, const int bucket_index, rctf *bucket_bounds)
{
LinkNode *node;
- int face_index, image_index=0;
+ int face_index, image_index = 0;
ImBuf *ibuf = NULL;
Image *tpage_last = NULL, *tpage;
Image *ima = NULL;
- if (ps->image_tot==1) {
+ if (ps->image_tot == 1) {
/* Simple loop, no context switching */
ibuf = ps->projImages[0].ibuf;
ima = ps->projImages[0].ima;
- for (node = ps->bucketFaces[bucket_index]; node; node= node->next) {
+ for (node = ps->bucketFaces[bucket_index]; node; node = node->next) {
project_paint_face_init(ps, thread_index, bucket_index, GET_INT_FROM_POINTER(node->link), 0, bucket_bounds, ibuf, ima->tpageflag & IMA_CLAMP_U, ima->tpageflag & IMA_CLAMP_V);
}
}
else {
/* More complicated loop, switch between images */
- for (node = ps->bucketFaces[bucket_index]; node; node= node->next) {
+ for (node = ps->bucketFaces[bucket_index]; node; node = node->next) {
face_index = GET_INT_FROM_POINTER(node->link);
/* Image context switching */
@@ -2760,7 +2771,7 @@ static void project_bucket_init(const ProjPaintState *ps, const int thread_index
if (tpage_last != tpage) {
tpage_last = tpage;
- for (image_index=0; image_index < ps->image_tot; image_index++) {
+ for (image_index = 0; image_index < ps->image_tot; image_index++) {
if (ps->projImages[image_index].ima == tpage_last) {
ibuf = ps->projImages[image_index].ibuf;
ima = ps->projImages[image_index].ima;
@@ -2789,16 +2800,16 @@ static int project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucke
/* TODO - replace this with a tricker method that uses sideofline for all screenCoords's edges against the closest bucket corner */
rctf bucket_bounds;
float p1[2], p2[2], p3[2], p4[2];
- float *v, *v1,*v2,*v3,*v4=NULL;
+ float *v, *v1, *v2, *v3, *v4 = NULL;
int fidx;
project_bucket_bounds(ps, bucket_x, bucket_y, &bucket_bounds);
/* Is one of the faces verts in the bucket bounds? */
- fidx = mf->v4 ? 3:2;
+ fidx = mf->v4 ? 3 : 2;
do {
- v = ps->screenCoords[ (*(&mf->v1 + fidx)) ];
+ v = ps->screenCoords[(*(&mf->v1 + fidx))];
if (BLI_in_rctf(&bucket_bounds, v[0], v[1])) {
return 1;
}
@@ -2812,36 +2823,36 @@ static int project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucke
}
p1[0] = bucket_bounds.xmin; p1[1] = bucket_bounds.ymin;
- p2[0] = bucket_bounds.xmin; p2[1] = bucket_bounds.ymax;
- p3[0] = bucket_bounds.xmax; p3[1] = bucket_bounds.ymax;
- p4[0] = bucket_bounds.xmax; p4[1] = bucket_bounds.ymin;
+ p2[0] = bucket_bounds.xmin; p2[1] = bucket_bounds.ymax;
+ p3[0] = bucket_bounds.xmax; p3[1] = bucket_bounds.ymax;
+ p4[0] = bucket_bounds.xmax; p4[1] = bucket_bounds.ymin;
if (mf->v4) {
- if ( isect_point_quad_v2(p1, v1, v2, v3, v4) ||
- isect_point_quad_v2(p2, v1, v2, v3, v4) ||
- isect_point_quad_v2(p3, v1, v2, v3, v4) ||
- isect_point_quad_v2(p4, v1, v2, v3, v4) ||
-
- /* we can avoid testing v3,v1 because another intersection MUST exist if this intersects */
- (isect_line_line_v2(p1, p2, v1, v2) || isect_line_line_v2(p1, p2, v2, v3) || isect_line_line_v2(p1, p2, v3, v4)) ||
- (isect_line_line_v2(p2, p3, v1, v2) || isect_line_line_v2(p2, p3, v2, v3) || isect_line_line_v2(p2, p3, v3, v4)) ||
- (isect_line_line_v2(p3, p4, v1, v2) || isect_line_line_v2(p3, p4, v2, v3) || isect_line_line_v2(p3, p4, v3, v4)) ||
- (isect_line_line_v2(p4, p1, v1, v2) || isect_line_line_v2(p4, p1, v2, v3) || isect_line_line_v2(p4, p1, v3, v4))
- ) {
+ if (isect_point_quad_v2(p1, v1, v2, v3, v4) ||
+ isect_point_quad_v2(p2, v1, v2, v3, v4) ||
+ isect_point_quad_v2(p3, v1, v2, v3, v4) ||
+ isect_point_quad_v2(p4, v1, v2, v3, v4) ||
+
+ /* we can avoid testing v3,v1 because another intersection MUST exist if this intersects */
+ (isect_line_line_v2(p1, p2, v1, v2) || isect_line_line_v2(p1, p2, v2, v3) || isect_line_line_v2(p1, p2, v3, v4)) ||
+ (isect_line_line_v2(p2, p3, v1, v2) || isect_line_line_v2(p2, p3, v2, v3) || isect_line_line_v2(p2, p3, v3, v4)) ||
+ (isect_line_line_v2(p3, p4, v1, v2) || isect_line_line_v2(p3, p4, v2, v3) || isect_line_line_v2(p3, p4, v3, v4)) ||
+ (isect_line_line_v2(p4, p1, v1, v2) || isect_line_line_v2(p4, p1, v2, v3) || isect_line_line_v2(p4, p1, v3, v4)))
+ {
return 1;
}
}
else {
- if ( isect_point_tri_v2(p1, v1, v2, v3) ||
- isect_point_tri_v2(p2, v1, v2, v3) ||
- isect_point_tri_v2(p3, v1, v2, v3) ||
- isect_point_tri_v2(p4, v1, v2, v3) ||
- /* we can avoid testing v3,v1 because another intersection MUST exist if this intersects */
- (isect_line_line_v2(p1, p2, v1, v2) || isect_line_line_v2(p1, p2, v2, v3)) ||
- (isect_line_line_v2(p2, p3, v1, v2) || isect_line_line_v2(p2, p3, v2, v3)) ||
- (isect_line_line_v2(p3, p4, v1, v2) || isect_line_line_v2(p3, p4, v2, v3)) ||
- (isect_line_line_v2(p4, p1, v1, v2) || isect_line_line_v2(p4, p1, v2, v3))
- ) {
+ if (isect_point_tri_v2(p1, v1, v2, v3) ||
+ isect_point_tri_v2(p2, v1, v2, v3) ||
+ isect_point_tri_v2(p3, v1, v2, v3) ||
+ isect_point_tri_v2(p4, v1, v2, v3) ||
+ /* we can avoid testing v3,v1 because another intersection MUST exist if this intersects */
+ (isect_line_line_v2(p1, p2, v1, v2) || isect_line_line_v2(p1, p2, v2, v3)) ||
+ (isect_line_line_v2(p2, p3, v1, v2) || isect_line_line_v2(p2, p3, v2, v3)) ||
+ (isect_line_line_v2(p3, p4, v1, v2) || isect_line_line_v2(p3, p4, v2, v3)) ||
+ (isect_line_line_v2(p4, p1, v1, v2) || isect_line_line_v2(p4, p1, v2, v3)))
+ {
return 1;
}
}
@@ -2849,7 +2860,7 @@ static int project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucke
return 0;
}
-/* Add faces to the bucket but dont initialize its pixels
+/* Add faces to the bucket but don't initialize its pixels
* TODO - when painting occluded, sort the faces on their min-Z and only add faces that faces that are not occluded */
static void project_paint_delayed_face_init(ProjPaintState *ps, const MFace *mf, const int face_index)
{
@@ -2861,9 +2872,9 @@ static void project_paint_delayed_face_init(ProjPaintState *ps, const MFace *mf,
INIT_MINMAX2(min, max);
- fidx = mf->v4 ? 3:2;
+ fidx = mf->v4 ? 3 : 2;
do {
- vCoSS = ps->screenCoords[ *(&mf->v1 + fidx) ];
+ vCoSS = ps->screenCoords[*(&mf->v1 + fidx)];
DO_MINMAX2(vCoSS, min, max);
} while (fidx--);
@@ -2873,12 +2884,12 @@ static void project_paint_delayed_face_init(ProjPaintState *ps, const MFace *mf,
has_x_isect = 0;
for (bucket_x = bucketMin[0]; bucket_x < bucketMax[0]; bucket_x++) {
if (project_bucket_face_isect(ps, bucket_x, bucket_y, mf)) {
- int bucket_index= bucket_x + (bucket_y * ps->buckets_x);
+ int bucket_index = bucket_x + (bucket_y * ps->buckets_x);
BLI_linklist_prepend_arena(
- &ps->bucketFaces[ bucket_index ],
- SET_INT_IN_POINTER(face_index), /* cast to a pointer to shut up the compiler */
- arena
- );
+ &ps->bucketFaces[bucket_index],
+ SET_INT_IN_POINTER(face_index), /* cast to a pointer to shut up the compiler */
+ arena
+ );
has_x_isect = has_isect = 1;
}
@@ -2889,7 +2900,7 @@ static void project_paint_delayed_face_init(ProjPaintState *ps, const MFace *mf,
}
/* no intersection for this entire row, after some intersection above means we can quit now */
- if (has_x_isect==0 && has_isect) {
+ if (has_x_isect == 0 && has_isect) {
break;
}
}
@@ -2906,7 +2917,7 @@ static void project_paint_delayed_face_init(ProjPaintState *ps, const MFace *mf,
static int project_paint_view_clip(View3D *v3d, RegionView3D *rv3d, float *clipsta, float *clipend)
{
- int orth= ED_view3d_clip_range_get(v3d, rv3d, clipsta, clipend);
+ int orth = ED_view3d_clip_range_get(v3d, rv3d, clipsta, clipend);
if (orth) { /* only needed for ortho */
float fac = 2.0f / ((*clipend) - (*clipsta));
@@ -2945,33 +2956,33 @@ static void project_paint_begin(ProjPaintState *ps)
MemArena *arena; /* at the moment this is just ps->arena_mt[0], but use this to show were not multithreading */
- const int diameter= 2*brush_size(ps->scene, ps->brush);
+ const int diameter = 2 * brush_size(ps->scene, ps->brush);
/* ---- end defines ---- */
- if(ps->source==PROJ_SRC_VIEW)
- ED_view3d_clipping_local(ps->rv3d, ps->ob->obmat); /* faster clipping lookups */
+ if (ps->source == PROJ_SRC_VIEW)
+ ED_view3d_clipping_local(ps->rv3d, ps->ob->obmat); /* faster clipping lookups */
/* paint onto the derived mesh */
/* Workaround for subsurf selection, try the display mesh first */
- if (ps->source==PROJ_SRC_IMAGE_CAM) {
+ if (ps->source == PROJ_SRC_IMAGE_CAM) {
/* using render mesh, assume only camera was rendered from */
ps->dm = mesh_create_derived_render(ps->scene, ps->ob, ps->scene->customdata_mask | CD_MASK_MTFACE);
- ps->dm_release= TRUE;
+ ps->dm_release = TRUE;
}
- else if(ps->ob->derivedFinal && CustomData_has_layer( &ps->ob->derivedFinal->faceData, CD_MTFACE)) {
+ else if (ps->ob->derivedFinal && CustomData_has_layer(&ps->ob->derivedFinal->faceData, CD_MTFACE)) {
ps->dm = ps->ob->derivedFinal;
- ps->dm_release= FALSE;
+ ps->dm_release = FALSE;
}
else {
ps->dm = mesh_get_derived_final(ps->scene, ps->ob, ps->scene->customdata_mask | CD_MASK_MTFACE);
- ps->dm_release= TRUE;
+ ps->dm_release = TRUE;
}
- if ( !CustomData_has_layer( &ps->dm->faceData, CD_MTFACE) ) {
+ if (!CustomData_has_layer(&ps->dm->faceData, CD_MTFACE) ) {
- if(ps->dm_release)
+ if (ps->dm_release)
ps->dm->release(ps->dm);
ps->dm = NULL;
@@ -2980,7 +2991,7 @@ static void project_paint_begin(ProjPaintState *ps)
ps->dm_mvert = ps->dm->getVertArray(ps->dm);
ps->dm_mface = ps->dm->getTessFaceArray(ps->dm);
- ps->dm_mtface= ps->dm->getTessFaceDataArray(ps->dm, CD_MTFACE);
+ ps->dm_mtface = ps->dm->getTessFaceDataArray(ps->dm, CD_MTFACE);
ps->dm_totvert = ps->dm->getNumVerts(ps->dm);
ps->dm_totface = ps->dm->getNumTessFaces(ps->dm);
@@ -2989,16 +3000,16 @@ static void project_paint_begin(ProjPaintState *ps)
/* Note, use the original mesh for getting the clone and mask layer index
- * this avoids re-generating the derived mesh just to get the new index */
+ * this avoids re-generating the derived mesh just to get the new index */
if (ps->do_layer_clone) {
//int layer_num = CustomData_get_clone_layer(&ps->dm->faceData, CD_MTFACE);
int layer_num = CustomData_get_clone_layer(&((Mesh *)ps->ob->data)->fdata, CD_MTFACE);
if (layer_num != -1)
ps->dm_mtface_clone = CustomData_get_layer_n(&ps->dm->faceData, CD_MTFACE, layer_num);
- if (ps->dm_mtface_clone==NULL || ps->dm_mtface_clone==ps->dm_mtface) {
+ if (ps->dm_mtface_clone == NULL || ps->dm_mtface_clone == ps->dm_mtface) {
ps->do_layer_clone = 0;
- ps->dm_mtface_clone= NULL;
+ ps->dm_mtface_clone = NULL;
printf("ACK!\n");
}
}
@@ -3009,22 +3020,22 @@ static void project_paint_begin(ProjPaintState *ps)
if (layer_num != -1)
ps->dm_mtface_stencil = CustomData_get_layer_n(&ps->dm->faceData, CD_MTFACE, layer_num);
- if (ps->dm_mtface_stencil==NULL || ps->dm_mtface_stencil==ps->dm_mtface) {
+ if (ps->dm_mtface_stencil == NULL || ps->dm_mtface_stencil == ps->dm_mtface) {
ps->do_layer_stencil = 0;
ps->dm_mtface_stencil = NULL;
}
}
/* when using subsurf or multires, mface arrays are thrown away, we need to keep a copy */
- if(ps->dm->type != DM_TYPE_CDDM) {
- ps->dm_mvert= MEM_dupallocN(ps->dm_mvert);
- ps->dm_mface= MEM_dupallocN(ps->dm_mface);
+ if (ps->dm->type != DM_TYPE_CDDM) {
+ ps->dm_mvert = MEM_dupallocN(ps->dm_mvert);
+ ps->dm_mface = MEM_dupallocN(ps->dm_mface);
/* looks like these are ok for now.*/
- /*
- 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);
- */
+#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;
@@ -3037,44 +3048,44 @@ static void project_paint_begin(ProjPaintState *ps)
invert_m4_m4(ps->ob->imat, ps->ob->obmat);
- if(ps->source==PROJ_SRC_VIEW) {
+ if (ps->source == PROJ_SRC_VIEW) {
/* normal drawing */
- ps->winx= ps->ar->winx;
- ps->winy= ps->ar->winy;
+ ps->winx = ps->ar->winx;
+ ps->winy = ps->ar->winy;
copy_m4_m4(viewmat, ps->rv3d->viewmat);
copy_m4_m4(viewinv, ps->rv3d->viewinv);
ED_view3d_ob_project_mat_get(ps->rv3d, ps->ob, ps->projectMat);
- ps->is_ortho= project_paint_view_clip(ps->v3d, ps->rv3d, &ps->clipsta, &ps->clipend);
+ 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];
- ps->winx= ps->reproject_ibuf->x;
- ps->winy= ps->reproject_ibuf->y;
+ ps->winx = ps->reproject_ibuf->x;
+ ps->winy = ps->reproject_ibuf->y;
- if (ps->source==PROJ_SRC_IMAGE_VIEW) {
+ if (ps->source == PROJ_SRC_IMAGE_VIEW) {
/* image stores camera data, tricky */
- IDProperty *idgroup= IDP_GetProperties(&ps->reproject_image->id, 0);
- IDProperty *view_data= IDP_GetPropertyFromGroup(idgroup, PROJ_VIEW_DATA_ID);
+ IDProperty *idgroup = IDP_GetProperties(&ps->reproject_image->id, 0);
+ IDProperty *view_data = IDP_GetPropertyFromGroup(idgroup, PROJ_VIEW_DATA_ID);
- float *array= (float *)IDP_Array(view_data);
+ float *array = (float *)IDP_Array(view_data);
/* use image array, written when creating image */
- memcpy(winmat, array, sizeof(winmat)); array += sizeof(winmat)/sizeof(float);
- memcpy(viewmat, array, sizeof(viewmat)); array += sizeof(viewmat)/sizeof(float);
- ps->clipsta= array[0];
- ps->clipend= array[1];
- ps->is_ortho= array[2] ? 1:0;
+ memcpy(winmat, array, sizeof(winmat)); array += sizeof(winmat) / sizeof(float);
+ memcpy(viewmat, array, sizeof(viewmat)); array += sizeof(viewmat) / sizeof(float);
+ ps->clipsta = array[0];
+ ps->clipend = array[1];
+ ps->is_ortho = array[2] ? 1 : 0;
invert_m4_m4(viewinv, viewmat);
}
- else if (ps->source==PROJ_SRC_IMAGE_CAM) {
- Object *cam_ob= ps->scene->camera;
+ else if (ps->source == PROJ_SRC_IMAGE_CAM) {
+ Object *cam_ob = ps->scene->camera;
CameraParams params;
/* viewmat & viewinv */
@@ -3089,9 +3100,9 @@ static void project_paint_begin(ProjPaintState *ps)
camera_params_compute_matrix(&params);
copy_m4_m4(winmat, params.winmat);
- ps->clipsta= params.clipsta;
- ps->clipend= params.clipend;
- ps->is_ortho= params.is_ortho;
+ ps->clipsta = params.clipsta;
+ ps->clipend = params.clipend;
+ ps->is_ortho = params.is_ortho;
}
/* same as view3d_get_object_project_mat */
@@ -3120,20 +3131,20 @@ static void project_paint_begin(ProjPaintState *ps)
INIT_MINMAX2(ps->screenMin, ps->screenMax);
ps->screenCoords = MEM_mallocN(sizeof(float) * ps->dm_totvert * 4, "ProjectPaint ScreenVerts");
- projScreenCo= *ps->screenCoords;
+ projScreenCo = *ps->screenCoords;
if (ps->is_ortho) {
- for(a=0, mv=ps->dm_mvert; a < ps->dm_totvert; a++, mv++, projScreenCo+=4) {
+ for (a = 0, mv = ps->dm_mvert; a < ps->dm_totvert; a++, mv++, projScreenCo += 4) {
mul_v3_m4v3(projScreenCo, ps->projectMat, mv->co);
/* screen space, not clamped */
- projScreenCo[0] = (float)(ps->winx/2.0f)+(ps->winx/2.0f)*projScreenCo[0];
- projScreenCo[1] = (float)(ps->winy/2.0f)+(ps->winy/2.0f)*projScreenCo[1];
+ projScreenCo[0] = (float)(ps->winx / 2.0f) + (ps->winx / 2.0f) * projScreenCo[0];
+ projScreenCo[1] = (float)(ps->winy / 2.0f) + (ps->winy / 2.0f) * projScreenCo[1];
DO_MINMAX2(projScreenCo, ps->screenMin, ps->screenMax);
}
}
else {
- for(a=0, mv=ps->dm_mvert; a < ps->dm_totvert; a++, mv++, projScreenCo+=4) {
+ for (a = 0, mv = ps->dm_mvert; a < ps->dm_totvert; a++, mv++, projScreenCo += 4) {
copy_v3_v3(projScreenCo, mv->co);
projScreenCo[3] = 1.0f;
@@ -3141,9 +3152,9 @@ static void project_paint_begin(ProjPaintState *ps)
if (projScreenCo[3] > ps->clipsta) {
/* screen space, not clamped */
- projScreenCo[0] = (float)(ps->winx/2.0f)+(ps->winx/2.0f)*projScreenCo[0]/projScreenCo[3];
- projScreenCo[1] = (float)(ps->winy/2.0f)+(ps->winy/2.0f)*projScreenCo[1]/projScreenCo[3];
- projScreenCo[2] = projScreenCo[2]/projScreenCo[3]; /* Use the depth for bucket point occlusion */
+ projScreenCo[0] = (float)(ps->winx / 2.0f) + (ps->winx / 2.0f) * projScreenCo[0] / projScreenCo[3];
+ projScreenCo[1] = (float)(ps->winy / 2.0f) + (ps->winy / 2.0f) * projScreenCo[1] / projScreenCo[3];
+ projScreenCo[2] = projScreenCo[2] / projScreenCo[3]; /* Use the depth for bucket point occlusion */
DO_MINMAX2(projScreenCo, ps->screenMin, ps->screenMax);
}
else {
@@ -3166,7 +3177,7 @@ static void project_paint_begin(ProjPaintState *ps)
ps->screenMax[1] += projMargin;
ps->screenMin[1] -= projMargin;
- if(ps->source==PROJ_SRC_VIEW) {
+ if (ps->source == PROJ_SRC_VIEW) {
#ifdef PROJ_DEBUG_WINCLIP
CLAMP(ps->screenMin[0], (float)(-diameter), (float)(ps->winx + diameter));
CLAMP(ps->screenMax[0], (float)(-diameter), (float)(ps->winx + diameter));
@@ -3175,12 +3186,12 @@ static void project_paint_begin(ProjPaintState *ps)
CLAMP(ps->screenMax[1], (float)(-diameter), (float)(ps->winy + diameter));
#endif
}
- else { /* reprojection, use bounds */
- ps->screenMin[0]= 0;
- ps->screenMax[0]= (float)(ps->winx);
+ else { /* re-projection, use bounds */
+ ps->screenMin[0] = 0;
+ ps->screenMax[0] = (float)(ps->winx);
- ps->screenMin[1]= 0;
- ps->screenMax[1]= (float)(ps->winy);
+ ps->screenMin[1] = 0;
+ ps->screenMax[1] = (float)(ps->winy);
}
/* only for convenience */
@@ -3198,14 +3209,14 @@ static void project_paint_begin(ProjPaintState *ps)
CLAMP(ps->buckets_y, PROJ_BUCKET_RECT_MIN, PROJ_BUCKET_RECT_MAX);
ps->bucketRect = (LinkNode **)MEM_callocN(sizeof(LinkNode *) * ps->buckets_x * ps->buckets_y, "paint-bucketRect");
- ps->bucketFaces= (LinkNode **)MEM_callocN(sizeof(LinkNode *) * ps->buckets_x * ps->buckets_y, "paint-bucketFaces");
+ ps->bucketFaces = (LinkNode **)MEM_callocN(sizeof(LinkNode *) * ps->buckets_x * ps->buckets_y, "paint-bucketFaces");
- ps->bucketFlags= (unsigned char *)MEM_callocN(sizeof(char) * ps->buckets_x * ps->buckets_y, "paint-bucketFaces");
+ ps->bucketFlags = (unsigned char *)MEM_callocN(sizeof(char) * ps->buckets_x * ps->buckets_y, "paint-bucketFaces");
#ifndef PROJ_DEBUG_NOSEAMBLEED
if (ps->seam_bleed_px > 0.0f) {
- ps->vertFaces= (LinkNode **)MEM_callocN(sizeof(LinkNode *) * ps->dm_totvert, "paint-vertFaces");
+ ps->vertFaces = (LinkNode **)MEM_callocN(sizeof(LinkNode *) * ps->dm_totvert, "paint-vertFaces");
ps->faceSeamFlags = (char *)MEM_callocN(sizeof(char) * ps->dm_totface, "paint-faceSeamFlags");
- ps->faceSeamUVs= MEM_mallocN(sizeof(float) * ps->dm_totface * 8, "paint-faceSeamUVs");
+ ps->faceSeamUVs = MEM_mallocN(sizeof(float) * ps->dm_totface * 8, "paint-faceSeamUVs");
}
#endif
@@ -3221,8 +3232,8 @@ static void project_paint_begin(ProjPaintState *ps)
else {
ps->thread_tot = BLI_system_thread_count();
}
- for (a=0; a<ps->thread_tot; a++) {
- ps->arena_mt[a] = BLI_memarena_new(1<<16, "project paint arena");
+ for (a = 0; a < ps->thread_tot; a++) {
+ ps->arena_mt[a] = BLI_memarena_new(1 << 16, "project paint arena");
}
arena = ps->arena_mt[0];
@@ -3232,7 +3243,7 @@ static void project_paint_begin(ProjPaintState *ps)
ps->vertFlags = MEM_callocN(sizeof(char) * ps->dm_totvert, "paint-vertFlags");
- for(a=0, mv=ps->dm_mvert; a < ps->dm_totvert; a++, mv++) {
+ for (a = 0, mv = ps->dm_mvert; a < ps->dm_totvert; a++, mv++) {
normal_short_to_float_v3(no, mv->no);
if (ps->is_ortho) {
@@ -3251,7 +3262,7 @@ static void project_paint_begin(ProjPaintState *ps)
}
- for(face_index = 0, tf = ps->dm_mtface, mf = ps->dm_mface; face_index < ps->dm_totface; mf++, tf++, face_index++) {
+ for (face_index = 0, tf = ps->dm_mtface, mf = ps->dm_mface; face_index < ps->dm_totface; mf++, tf++, face_index++) {
#ifndef PROJ_DEBUG_NOSEAMBLEED
/* add face user if we have bleed enabled, set the UV seam flags later */
@@ -3268,9 +3279,9 @@ static void project_paint_begin(ProjPaintState *ps)
tpage = project_paint_face_image(ps, ps->dm_mtface, face_index);
- if (tpage && ((((Mesh *)ps->ob->data)->editflag & ME_EDIT_PAINT_MASK)==0 || mf->flag & ME_FACE_SEL)) {
+ if (tpage && ((((Mesh *)ps->ob->data)->editflag & ME_EDIT_PAINT_MASK) == 0 || mf->flag & ME_FACE_SEL)) {
- float *v1coSS, *v2coSS, *v3coSS, *v4coSS=NULL;
+ float *v1coSS, *v2coSS, *v3coSS, *v4coSS = NULL;
v1coSS = ps->screenCoords[mf->v1];
v2coSS = ps->screenCoords[mf->v2];
@@ -3281,11 +3292,11 @@ static void project_paint_begin(ProjPaintState *ps)
if (!ps->is_ortho) {
- if ( v1coSS[0]==FLT_MAX ||
- v2coSS[0]==FLT_MAX ||
- v3coSS[0]==FLT_MAX ||
- (mf->v4 && v4coSS[0]==FLT_MAX)
- ) {
+ if (v1coSS[0] == FLT_MAX ||
+ v2coSS[0] == FLT_MAX ||
+ v3coSS[0] == FLT_MAX ||
+ (mf->v4 && v4coSS[0] == FLT_MAX))
+ {
continue;
}
}
@@ -3293,26 +3304,27 @@ static void project_paint_begin(ProjPaintState *ps)
#ifdef PROJ_DEBUG_WINCLIP
/* ignore faces outside the view */
if (
- (v1coSS[0] < ps->screenMin[0] &&
- v2coSS[0] < ps->screenMin[0] &&
- v3coSS[0] < ps->screenMin[0] &&
- (mf->v4 && v4coSS[0] < ps->screenMin[0])) ||
-
- (v1coSS[0] > ps->screenMax[0] &&
- v2coSS[0] > ps->screenMax[0] &&
- v3coSS[0] > ps->screenMax[0] &&
- (mf->v4 && v4coSS[0] > ps->screenMax[0])) ||
-
- (v1coSS[1] < ps->screenMin[1] &&
- v2coSS[1] < ps->screenMin[1] &&
- v3coSS[1] < ps->screenMin[1] &&
- (mf->v4 && v4coSS[1] < ps->screenMin[1])) ||
-
- (v1coSS[1] > ps->screenMax[1] &&
- v2coSS[1] > ps->screenMax[1] &&
- v3coSS[1] > ps->screenMax[1] &&
- (mf->v4 && v4coSS[1] > ps->screenMax[1]))
- ) {
+ (v1coSS[0] < ps->screenMin[0] &&
+ v2coSS[0] < ps->screenMin[0] &&
+ v3coSS[0] < ps->screenMin[0] &&
+ (mf->v4 && v4coSS[0] < ps->screenMin[0])) ||
+
+ (v1coSS[0] > ps->screenMax[0] &&
+ v2coSS[0] > ps->screenMax[0] &&
+ v3coSS[0] > ps->screenMax[0] &&
+ (mf->v4 && v4coSS[0] > ps->screenMax[0])) ||
+
+ (v1coSS[1] < ps->screenMin[1] &&
+ v2coSS[1] < ps->screenMin[1] &&
+ v3coSS[1] < ps->screenMin[1] &&
+ (mf->v4 && v4coSS[1] < ps->screenMin[1])) ||
+
+ (v1coSS[1] > ps->screenMax[1] &&
+ v2coSS[1] > ps->screenMax[1] &&
+ v3coSS[1] > ps->screenMax[1] &&
+ (mf->v4 && v4coSS[1] > ps->screenMax[1]))
+ )
+ {
continue;
}
@@ -3324,12 +3336,12 @@ static void project_paint_begin(ProjPaintState *ps)
/* Since we are interpolating the normals of faces, we want to make
* sure all the verts are pointing away from the view,
* not just the face */
- if ( (ps->vertFlags[mf->v1] & PROJ_VERT_CULL) &&
- (ps->vertFlags[mf->v2] & PROJ_VERT_CULL) &&
- (ps->vertFlags[mf->v3] & PROJ_VERT_CULL) &&
- (mf->v4==0 || ps->vertFlags[mf->v4] & PROJ_VERT_CULL)
-
- ) {
+ if ((ps->vertFlags[mf->v1] & PROJ_VERT_CULL) &&
+ (ps->vertFlags[mf->v2] & PROJ_VERT_CULL) &&
+ (ps->vertFlags[mf->v3] & PROJ_VERT_CULL) &&
+ (mf->v4 == 0 || ps->vertFlags[mf->v4] & PROJ_VERT_CULL)
+ )
+ {
continue;
}
}
@@ -3345,7 +3357,7 @@ static void project_paint_begin(ProjPaintState *ps)
image_index = BLI_linklist_index(image_LinkList, tpage);
- if (image_index==-1 && BKE_image_get_ibuf(tpage, NULL)) { /* MemArena dosnt have an append func */
+ if (image_index == -1 && BKE_image_get_ibuf(tpage, NULL)) { /* MemArena dosnt have an append func */
BLI_linklist_append(&image_LinkList, tpage);
image_index = ps->image_tot;
ps->image_tot++;
@@ -3365,7 +3377,7 @@ static void project_paint_begin(ProjPaintState *ps)
/* build an array of images we use*/
projIma = ps->projImages = (ProjPaintImage *)BLI_memarena_alloc(arena, sizeof(ProjPaintImage) * ps->image_tot);
- for (node= image_LinkList, i=0; node; node= node->next, i++, projIma++) {
+ for (node = image_LinkList, i = 0; node; node = node->next, i++, projIma++) {
projIma->ima = node->link;
projIma->touch = 0;
projIma->ibuf = BKE_image_get_ibuf(projIma->ima, NULL);
@@ -3387,8 +3399,8 @@ static void project_paint_begin_clone(ProjPaintState *ps, int mouse[2])
projCo[3] = 1.0f;
mul_m4_v4(ps->projectMat, projCo);
- ps->cloneOffset[0] = mouse[0] - ((float)(ps->winx/2.0f)+(ps->winx/2.0f)*projCo[0]/projCo[3]);
- ps->cloneOffset[1] = mouse[1] - ((float)(ps->winy/2.0f)+(ps->winy/2.0f)*projCo[1]/projCo[3]);
+ ps->cloneOffset[0] = mouse[0] - ((float)(ps->winx / 2.0f) + (ps->winx / 2.0f) * projCo[0] / projCo[3]);
+ ps->cloneOffset[1] = mouse[1] - ((float)(ps->winy / 2.0f) + (ps->winy / 2.0f) * projCo[1] / projCo[3]);
}
}
@@ -3397,7 +3409,7 @@ static void project_paint_end(ProjPaintState *ps)
int a;
/* build undo data from original pixel colors */
- if(U.uiflag & USER_GLOBALUNDO) {
+ if (U.uiflag & USER_GLOBALUNDO) {
ProjPixel *projPixel;
ImBuf *tmpibuf = NULL, *tmpibuf_float = NULL;
LinkNode *pixel_node;
@@ -3414,9 +3426,9 @@ static void project_paint_end(ProjPaintState *ps)
/* context */
ProjPaintImage *last_projIma;
int last_image_index = -1;
- int last_tile_width=0;
+ int last_tile_width = 0;
- for(a=0, last_projIma=ps->projImages; a < ps->image_tot; a++, last_projIma++) {
+ for (a = 0, last_projIma = ps->projImages; a < ps->image_tot; a++, last_projIma++) {
int size = sizeof(void **) * IMAPAINT_TILE_NUMBER(last_projIma->ibuf->x) * IMAPAINT_TILE_NUMBER(last_projIma->ibuf->y);
last_projIma->undoRect = (void **) BLI_memarena_alloc(arena, size);
memset(last_projIma->undoRect, 0, size);
@@ -3425,28 +3437,28 @@ static void project_paint_end(ProjPaintState *ps)
for (bucket_index = 0; bucket_index < bucket_tot; bucket_index++) {
/* loop through all pixels */
- for(pixel_node= ps->bucketRect[bucket_index]; pixel_node; pixel_node= pixel_node->next) {
+ for (pixel_node = ps->bucketRect[bucket_index]; pixel_node; pixel_node = pixel_node->next) {
/* ok we have a pixel, was it modified? */
projPixel = (ProjPixel *)pixel_node->link;
if (last_image_index != projPixel->image_index) {
/* set the context */
- last_image_index = projPixel->image_index;
- last_projIma = ps->projImages + last_image_index;
- last_tile_width = IMAPAINT_TILE_NUMBER(last_projIma->ibuf->x);
- is_float = last_projIma->ibuf->rect_float ? 1 : 0;
+ last_image_index = projPixel->image_index;
+ last_projIma = ps->projImages + last_image_index;
+ last_tile_width = IMAPAINT_TILE_NUMBER(last_projIma->ibuf->x);
+ is_float = last_projIma->ibuf->rect_float ? 1 : 0;
}
- if ( (is_float == 0 && projPixel->origColor.uint != *projPixel->pixel.uint_pt) ||
-
- (is_float == 1 &&
- ( projPixel->origColor.f[0] != projPixel->pixel.f_pt[0] ||
- projPixel->origColor.f[1] != projPixel->pixel.f_pt[1] ||
- projPixel->origColor.f[2] != projPixel->pixel.f_pt[2] ||
- projPixel->origColor.f[3] != projPixel->pixel.f_pt[3] ))
- ) {
+ if ((is_float == 0 && projPixel->origColor.uint != *projPixel->pixel.uint_pt) ||
+ (is_float == 1 &&
+ (projPixel->origColor.f[0] != projPixel->pixel.f_pt[0] ||
+ projPixel->origColor.f[1] != projPixel->pixel.f_pt[1] ||
+ projPixel->origColor.f[2] != projPixel->pixel.f_pt[2] ||
+ projPixel->origColor.f[3] != projPixel->pixel.f_pt[3]))
+ )
+ {
x_tile = projPixel->x_px >> IMAPAINT_TILE_BITS;
y_tile = projPixel->y_px >> IMAPAINT_TILE_BITS;
@@ -3456,9 +3468,9 @@ static void project_paint_end(ProjPaintState *ps)
tile_index = x_tile + y_tile * last_tile_width;
- if (last_projIma->undoRect[tile_index]==NULL) {
+ if (last_projIma->undoRect[tile_index] == NULL) {
/* add the undo tile from the modified image, then write the original colors back into it */
- tilerect = last_projIma->undoRect[tile_index] = image_undo_push_tile(last_projIma->ima, last_projIma->ibuf, is_float ? (&tmpibuf_float):(&tmpibuf) , x_tile, y_tile);
+ tilerect = last_projIma->undoRect[tile_index] = image_undo_push_tile(last_projIma->ima, last_projIma->ibuf, is_float ? (&tmpibuf_float) : (&tmpibuf), x_tile, y_tile);
}
else {
tilerect = last_projIma->undoRect[tile_index];
@@ -3472,14 +3484,14 @@ static void project_paint_end(ProjPaintState *ps)
copy_v4_v4(rgba_fp, projPixel->origColor.f);
}
else {
- ((unsigned int *)tilerect)[ (projPixel->x_px - x_round) + (projPixel->y_px - y_round) * IMAPAINT_TILE_SIZE ] = projPixel->origColor.uint;
+ ((unsigned int *)tilerect)[(projPixel->x_px - x_round) + (projPixel->y_px - y_round) * IMAPAINT_TILE_SIZE] = projPixel->origColor.uint;
}
}
}
}
- if (tmpibuf) IMB_freeImBuf(tmpibuf);
- if (tmpibuf_float) IMB_freeImBuf(tmpibuf_float);
+ if (tmpibuf) IMB_freeImBuf(tmpibuf);
+ if (tmpibuf_float) IMB_freeImBuf(tmpibuf_float);
}
/* done calculating undo data */
@@ -3498,23 +3510,23 @@ static void project_paint_end(ProjPaintState *ps)
if (ps->vertFlags) MEM_freeN(ps->vertFlags);
- for (a=0; a<ps->thread_tot; a++) {
+ for (a = 0; a < ps->thread_tot; a++) {
BLI_memarena_free(ps->arena_mt[a]);
}
/* copy for subsurf/multires, so throw away */
- if(ps->dm->type != DM_TYPE_CDDM) {
- 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(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);
- */
- }
-
- if(ps->dm_release)
+ if (ps->dm->type != DM_TYPE_CDDM) {
+ if (ps->dm_mvert) MEM_freeN(ps->dm_mvert);
+ if (ps->dm_mface) MEM_freeN(ps->dm_mface);
+ /* looks like these don't 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)
ps->dm->release(ps->dm);
}
@@ -3538,7 +3550,7 @@ static void partial_redraw_array_init(ImagePaintPartialRedraw *pr)
static int partial_redraw_array_merge(ImagePaintPartialRedraw *pr, ImagePaintPartialRedraw *pr_other, int tot)
{
- int touch= 0;
+ int touch = 0;
while (tot--) {
pr->x1 = MIN2(pr->x1, pr_other->x1);
pr->y1 = MIN2(pr->y1, pr_other->y1);
@@ -3560,14 +3572,14 @@ static int project_image_refresh_tagged(ProjPaintState *ps)
{
ImagePaintPartialRedraw *pr;
ProjPaintImage *projIma;
- int a,i;
+ int a, i;
int redraw = 0;
- for (a=0, projIma=ps->projImages; a < ps->image_tot; a++, projIma++) {
+ for (a = 0, projIma = ps->projImages; a < ps->image_tot; a++, projIma++) {
if (projIma->touch) {
/* look over each bound cell */
- for (i=0; i<PROJ_BOUNDBOX_SQUARED; i++) {
+ for (i = 0; i < PROJ_BOUNDBOX_SQUARED; i++) {
pr = &(projIma->partRedrawRect[i]);
if (pr->x2 != -1) { /* TODO - use 'enabled' ? */
imapaintpartial = *pr;
@@ -3586,11 +3598,11 @@ static int project_image_refresh_tagged(ProjPaintState *ps)
/* run this per painting onto each mouse location */
static int project_bucket_iter_init(ProjPaintState *ps, const float mval_f[2])
{
- if(ps->source==PROJ_SRC_VIEW) {
+ if (ps->source == PROJ_SRC_VIEW) {
float min_brush[2], max_brush[2];
const float radius = (float)brush_size(ps->scene, ps->brush);
- /* so we dont have a bucket bounds that is way too small to paint into */
+ /* so we don't have a bucket bounds that is way too small to paint into */
// if (radius < 1.0f) radius = 1.0f; // this doesn't work yet :/
min_brush[0] = mval_f[0] - radius;
@@ -3603,7 +3615,7 @@ static int project_bucket_iter_init(ProjPaintState *ps, const float mval_f[2])
project_paint_bucket_bounds(ps, min_brush, max_brush, ps->bucketMin, ps->bucketMax);
/* mouse outside the model areas? */
- if (ps->bucketMin[0]==ps->bucketMax[0] || ps->bucketMin[1]==ps->bucketMax[1]) {
+ if (ps->bucketMin[0] == ps->bucketMax[0] || ps->bucketMin[1] == ps->bucketMax[1]) {
return 0;
}
@@ -3611,11 +3623,11 @@ static int project_bucket_iter_init(ProjPaintState *ps, const float mval_f[2])
ps->context_bucket_y = ps->bucketMin[1];
}
else { /* reproject: PROJ_SRC_* */
- ps->bucketMin[0]= 0;
- ps->bucketMin[1]= 0;
+ ps->bucketMin[0] = 0;
+ ps->bucketMin[1] = 0;
- ps->bucketMax[0]= ps->buckets_x;
- ps->bucketMax[1]= ps->buckets_y;
+ ps->bucketMax[0] = ps->buckets_x;
+ ps->bucketMax[1] = ps->buckets_y;
ps->context_bucket_x = 0;
ps->context_bucket_y = 0;
@@ -3626,22 +3638,22 @@ static int project_bucket_iter_init(ProjPaintState *ps, const float mval_f[2])
static int project_bucket_iter_next(ProjPaintState *ps, int *bucket_index, rctf *bucket_bounds, const float mval[2])
{
- const int diameter= 2*brush_size(ps->scene, ps->brush);
+ const int diameter = 2 * brush_size(ps->scene, ps->brush);
if (ps->thread_tot > 1)
BLI_lock_thread(LOCK_CUSTOM1);
- //printf("%d %d \n", ps->context_bucket_x, ps->context_bucket_y);
+ //printf("%d %d\n", ps->context_bucket_x, ps->context_bucket_y);
- for ( ; ps->context_bucket_y < ps->bucketMax[1]; ps->context_bucket_y++) {
- for ( ; ps->context_bucket_x < ps->bucketMax[0]; ps->context_bucket_x++) {
+ for (; ps->context_bucket_y < ps->bucketMax[1]; ps->context_bucket_y++) {
+ for (; ps->context_bucket_x < ps->bucketMax[0]; ps->context_bucket_x++) {
/* use bucket_bounds for project_bucket_isect_circle and project_bucket_init*/
project_bucket_bounds(ps, ps->context_bucket_x, ps->context_bucket_y, bucket_bounds);
- if ( (ps->source != PROJ_SRC_VIEW) ||
- project_bucket_isect_circle(mval, (float)(diameter*diameter), bucket_bounds)
- ) {
+ if ((ps->source != PROJ_SRC_VIEW) ||
+ project_bucket_isect_circle(mval, (float)(diameter * diameter), bucket_bounds))
+ {
*bucket_index = ps->context_bucket_x + (ps->context_bucket_y * ps->buckets_x);
ps->context_bucket_x++;
@@ -3667,7 +3679,7 @@ typedef struct ProjectHandle {
float mval[2];
/* annoying but we need to have image bounds per thread, then merge into ps->projectPartialRedraws */
- ProjPaintImage *projImages; /* array of partial redraws */
+ ProjPaintImage *projImages; /* array of partial redraws */
/* thread settings */
int thread_index;
@@ -3676,58 +3688,58 @@ 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 */
- const int mfac= 255-fac;
+ * 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;
- cp[1]= (mfac*cp1[1]+fac*cp2[1])/255;
- cp[2]= (mfac*cp1[2]+fac*cp2[2])/255;
- cp[3]= (mfac*cp1[3]+fac*cp2[3])/255;
+ cp[0] = (mfac * cp1[0] + fac * cp2[0]) / 255;
+ cp[1] = (mfac * cp1[1] + fac * cp2[1]) / 255;
+ cp[2] = (mfac * cp1[2] + fac * cp2[2]) / 255;
+ cp[3] = (mfac * cp1[3] + fac * cp2[3]) / 255;
}
static void blend_color_mix_float(float *cp, const float *cp1, const float *cp2, const float fac)
{
- const float mfac= 1.0f-fac;
- cp[0]= mfac*cp1[0] + fac*cp2[0];
- cp[1]= mfac*cp1[1] + fac*cp2[1];
- cp[2]= mfac*cp1[2] + fac*cp2[2];
- cp[3]= mfac*cp1[3] + fac*cp2[3];
+ const float mfac = 1.0f - fac;
+ cp[0] = mfac * cp1[0] + fac * cp2[0];
+ cp[1] = mfac * cp1[1] + fac * cp2[1];
+ cp[2] = mfac * cp1[2] + fac * cp2[2];
+ cp[3] = mfac * cp1[3] + fac * cp2[3];
}
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 */
- const int mfac= 255-fac;
- const int alpha= cp1[3] + ((fac * cp2[3]) / 255);
+ * 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);
- cp[0]= (mfac*cp1[0]+fac*cp2[0])/255;
- cp[1]= (mfac*cp1[1]+fac*cp2[1])/255;
- cp[2]= (mfac*cp1[2]+fac*cp2[2])/255;
- cp[3]= alpha > 255 ? 255 : alpha;
+ cp[0] = (mfac * cp1[0] + fac * cp2[0]) / 255;
+ cp[1] = (mfac * cp1[1] + fac * cp2[1]) / 255;
+ cp[2] = (mfac * cp1[2] + fac * cp2[2]) / 255;
+ cp[3] = alpha > 255 ? 255 : alpha;
}
static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask)
{
- if (ps->is_airbrush==0 && mask < 1.0f) {
- projPixel->newColor.uint = IMB_blend_color(projPixel->newColor.uint, ((ProjPixelClone*)projPixel)->clonepx.uint, (int)(alpha*255), ps->blend);
- blend_color_mix(projPixel->pixel.ch_pt, projPixel->origColor.ch, projPixel->newColor.ch, (int)(mask*255));
+ if (ps->is_airbrush == 0 && mask < 1.0f) {
+ projPixel->newColor.uint = IMB_blend_color(projPixel->newColor.uint, ((ProjPixelClone *)projPixel)->clonepx.uint, (int)(alpha * 255), ps->blend);
+ blend_color_mix(projPixel->pixel.ch_pt, projPixel->origColor.ch, projPixel->newColor.ch, (int)(mask * 255));
}
else {
- *projPixel->pixel.uint_pt = IMB_blend_color(*projPixel->pixel.uint_pt, ((ProjPixelClone*)projPixel)->clonepx.uint, (int)(alpha*mask*255), ps->blend);
+ *projPixel->pixel.uint_pt = IMB_blend_color(*projPixel->pixel.uint_pt, ((ProjPixelClone *)projPixel)->clonepx.uint, (int)(alpha * mask * 255), ps->blend);
}
}
static void do_projectpaint_clone_f(ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask)
{
- if (ps->is_airbrush==0 && mask < 1.0f) {
+ if (ps->is_airbrush == 0 && mask < 1.0f) {
IMB_blend_color_float(projPixel->newColor.f, projPixel->newColor.f, ((ProjPixelClone *)projPixel)->clonepx.f, alpha, ps->blend);
blend_color_mix_float(projPixel->pixel.f_pt, projPixel->origColor.f, projPixel->newColor.f, mask);
}
else {
- IMB_blend_color_float(projPixel->pixel.f_pt, projPixel->pixel.f_pt, ((ProjPixelClone *)projPixel)->clonepx.f, alpha*mask, ps->blend);
+ IMB_blend_color_float(projPixel->pixel.f_pt, projPixel->pixel.f_pt, ((ProjPixelClone *)projPixel)->clonepx.f, alpha * mask, ps->blend);
}
}
@@ -3741,10 +3753,10 @@ static void do_projectpaint_smear(ProjPaintState *ps, ProjPixel *projPixel, floa
{
unsigned char rgba_ub[4];
- if (project_paint_PickColor(ps, co, NULL, rgba_ub, 1)==0)
+ if (project_paint_PickColor(ps, co, NULL, rgba_ub, 1) == 0)
return;
/* ((ProjPixelClone *)projPixel)->clonepx.uint = IMB_blend_color(*projPixel->pixel.uint_pt, *((unsigned int *)rgba_ub), (int)(alpha*mask*255), ps->blend); */
- blend_color_mix(((ProjPixelClone *)projPixel)->clonepx.ch, projPixel->pixel.ch_pt, rgba_ub, (int)(alpha*mask*255));
+ blend_color_mix(((ProjPixelClone *)projPixel)->clonepx.ch, projPixel->pixel.ch_pt, rgba_ub, (int)(alpha * mask * 255));
BLI_linklist_prepend_arena(smearPixels, (void *)projPixel, smearArena);
}
@@ -3752,11 +3764,11 @@ static void do_projectpaint_smear_f(ProjPaintState *ps, ProjPixel *projPixel, fl
{
float rgba[4];
- if (project_paint_PickColor(ps, co, rgba, NULL, 1)==0)
+ if (project_paint_PickColor(ps, co, rgba, NULL, 1) == 0)
return;
/* (ProjPixelClone *)projPixel)->clonepx.uint = IMB_blend_color(*((unsigned int *)rgba_smear), *((unsigned int *)rgba_ub), (int)(alpha*mask*255), ps->blend); */
- blend_color_mix_float(((ProjPixelClone *)projPixel)->clonepx.f, projPixel->pixel.f_pt, rgba, alpha*mask);
+ blend_color_mix_float(((ProjPixelClone *)projPixel)->clonepx.f, projPixel->pixel.f_pt, rgba, alpha * mask);
BLI_linklist_prepend_arena(smearPixels_f, (void *)projPixel, smearArena);
}
@@ -3775,12 +3787,12 @@ static void do_projectpaint_draw(ProjPaintState *ps, ProjPixel *projPixel, float
rgba_ub[3] = 255;
}
- if (ps->is_airbrush==0 && mask < 1.0f) {
- projPixel->newColor.uint = IMB_blend_color(projPixel->newColor.uint, *((unsigned int *)rgba_ub), (int)(alpha*255), ps->blend);
- blend_color_mix(projPixel->pixel.ch_pt, projPixel->origColor.ch, projPixel->newColor.ch, (int)(mask*255));
+ if (ps->is_airbrush == 0 && mask < 1.0f) {
+ projPixel->newColor.uint = IMB_blend_color(projPixel->newColor.uint, *((unsigned int *)rgba_ub), (int)(alpha * 255), ps->blend);
+ blend_color_mix(projPixel->pixel.ch_pt, projPixel->origColor.ch, projPixel->newColor.ch, (int)(mask * 255));
}
else {
- *projPixel->pixel.uint_pt = IMB_blend_color(*projPixel->pixel.uint_pt, *((unsigned int *)rgba_ub), (int)(alpha*mask*255), ps->blend);
+ *projPixel->pixel.uint_pt = IMB_blend_color(*projPixel->pixel.uint_pt, *((unsigned int *)rgba_ub), (int)(alpha * mask * 255), ps->blend);
}
}
@@ -3788,17 +3800,17 @@ static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, flo
{
if (ps->is_texbrush) {
/* rgba already holds a texture result here from higher level function */
- if(use_color_correction){
+ if (use_color_correction) {
float rgba_br[3];
srgb_to_linearrgb_v3_v3(rgba_br, ps->brush->rgb);
mul_v3_v3(rgba, rgba_br);
}
- else{
+ else {
mul_v3_v3(rgba, ps->brush->rgb);
}
}
else {
- if(use_color_correction){
+ if (use_color_correction) {
srgb_to_linearrgb_v3_v3(rgba, ps->brush->rgb);
}
else {
@@ -3807,12 +3819,12 @@ static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, flo
rgba[3] = 1.0;
}
- if (ps->is_airbrush==0 && mask < 1.0f) {
+ if (ps->is_airbrush == 0 && mask < 1.0f) {
IMB_blend_color_float(projPixel->newColor.f, projPixel->newColor.f, rgba, alpha, ps->blend);
blend_color_mix_float(projPixel->pixel.f_pt, projPixel->origColor.f, projPixel->newColor.f, mask);
}
else {
- IMB_blend_color_float(projPixel->pixel.f_pt, projPixel->pixel.f_pt, rgba, alpha*mask, ps->blend);
+ IMB_blend_color_float(projPixel->pixel.f_pt, projPixel->pixel.f_pt, rgba, alpha * mask, ps->blend);
}
}
@@ -3822,18 +3834,18 @@ static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, flo
static void *do_projectpaint_thread(void *ph_v)
{
/* First unpack args from the struct */
- ProjPaintState *ps = ((ProjectHandle *)ph_v)->ps;
- ProjPaintImage *projImages = ((ProjectHandle *)ph_v)->projImages;
- const float *lastpos = ((ProjectHandle *)ph_v)->prevmval;
- const float *pos = ((ProjectHandle *)ph_v)->mval;
- const int thread_index = ((ProjectHandle *)ph_v)->thread_index;
+ ProjPaintState *ps = ((ProjectHandle *)ph_v)->ps;
+ ProjPaintImage *projImages = ((ProjectHandle *)ph_v)->projImages;
+ const float *lastpos = ((ProjectHandle *)ph_v)->prevmval;
+ const float *pos = ((ProjectHandle *)ph_v)->mval;
+ const int thread_index = ((ProjectHandle *)ph_v)->thread_index;
/* Done with args from ProjectHandle */
LinkNode *node;
ProjPixel *projPixel;
int last_index = -1;
- ProjPaintImage *last_projIma= NULL;
+ ProjPaintImage *last_projIma = NULL;
ImagePaintPartialRedraw *last_partial_redraw_cell;
float rgba[4], alpha, dist_nosqrt, dist;
@@ -3850,20 +3862,20 @@ static void *do_projectpaint_thread(void *ph_v)
float co[2];
float mask = 1.0f; /* airbrush wont use mask */
unsigned short mask_short;
- const float radius= (float)brush_size(ps->scene, ps->brush);
- const float radius_squared= radius*radius; /* avoid a square root with every dist comparison */
+ const float radius = (float)brush_size(ps->scene, ps->brush);
+ const float radius_squared = radius * radius; /* avoid a square root with every dist comparison */
- short lock_alpha= ELEM(ps->brush->blend, IMB_BLEND_ERASE_ALPHA, IMB_BLEND_ADD_ALPHA) ? 0 : ps->brush->flag & BRUSH_LOCK_ALPHA;
+ short lock_alpha = ELEM(ps->brush->blend, IMB_BLEND_ERASE_ALPHA, IMB_BLEND_ADD_ALPHA) ? 0 : ps->brush->flag & BRUSH_LOCK_ALPHA;
LinkNode *smearPixels = NULL;
LinkNode *smearPixels_f = NULL;
MemArena *smearArena = NULL; /* mem arena for this brush projection only */
- if (tool==PAINT_TOOL_SMEAR) {
+ if (tool == PAINT_TOOL_SMEAR) {
pos_ofs[0] = pos[0] - lastpos[0];
pos_ofs[1] = pos[1] - lastpos[1];
- smearArena = BLI_memarena_new(1<<16, "paint smear arena");
+ smearArena = BLI_memarena_new(1 << 16, "paint smear arena");
}
/* printf("brush bounds %d %d %d %d\n", bucketMin[0], bucketMin[1], bucketMax[0], bucketMax[1]); */
@@ -3876,7 +3888,7 @@ static void *do_projectpaint_thread(void *ph_v)
project_bucket_init(ps, thread_index, bucket_index, &bucket_bounds);
}
- if(ps->source != PROJ_SRC_VIEW) {
+ if (ps->source != PROJ_SRC_VIEW) {
/* Re-Projection, simple, no brushes! */
@@ -3884,9 +3896,9 @@ static void *do_projectpaint_thread(void *ph_v)
projPixel = (ProjPixel *)node->link;
bicubic_interpolation_color(ps->reproject_ibuf, projPixel->newColor.ch, NULL, projPixel->projCoSS[0], projPixel->projCoSS[1]);
- if(projPixel->newColor.ch[3]) {
- mask = ((float)projPixel->mask)/65535.0f;
- blend_color_mix_accum(projPixel->pixel.ch_pt, projPixel->origColor.ch, projPixel->newColor.ch, (int)(mask*projPixel->newColor.ch[3]));
+ if (projPixel->newColor.ch[3]) {
+ mask = ((float)projPixel->mask) / 65535.0f;
+ blend_color_mix_accum(projPixel->pixel.ch_pt, projPixel->origColor.ch, projPixel->newColor.ch, (int)(mask * projPixel->newColor.ch[3]));
}
}
@@ -3902,7 +3914,7 @@ static void *do_projectpaint_thread(void *ph_v)
/*if (dist < radius) {*/ /* correct but uses a sqrtf */
if (dist_nosqrt <= radius_squared) {
- dist=sqrtf(dist_nosqrt);
+ dist = sqrtf(dist_nosqrt);
falloff = brush_curve_strength_clamp(ps->brush, dist, radius);
@@ -3911,14 +3923,15 @@ static void *do_projectpaint_thread(void *ph_v)
/* note, for clone and smear, we only use the alpha, could be a special function */
brush_sample_tex(ps->scene, ps->brush, projPixel->projCoSS, rgba, thread_index);
alpha = rgba[3];
- } else {
+ }
+ else {
alpha = 1.0f;
}
if (ps->is_airbrush) {
/* for an aurbrush there is no real mask, so just multiply the alpha by it */
alpha *= falloff * brush_alpha(ps->scene, ps->brush);
- mask = ((float)projPixel->mask)/65535.0f;
+ mask = ((float)projPixel->mask) / 65535.0f;
}
else {
/* This brush dosnt accumulate so add some curve to the brushes falloff */
@@ -3927,7 +3940,7 @@ static void *do_projectpaint_thread(void *ph_v)
mask_short = (unsigned short)(projPixel->mask * (brush_alpha(ps->scene, ps->brush) * falloff));
if (mask_short > projPixel->mask_max) {
- mask = ((float)mask_short)/65535.0f;
+ mask = ((float)mask_short) / 65535.0f;
projPixel->mask_max = mask_short;
}
else {
@@ -3953,39 +3966,39 @@ static void *do_projectpaint_thread(void *ph_v)
last_partial_redraw_cell->x1 = MIN2(last_partial_redraw_cell->x1, projPixel->x_px);
last_partial_redraw_cell->y1 = MIN2(last_partial_redraw_cell->y1, projPixel->y_px);
- last_partial_redraw_cell->x2 = MAX2(last_partial_redraw_cell->x2, projPixel->x_px+1);
- last_partial_redraw_cell->y2 = MAX2(last_partial_redraw_cell->y2, projPixel->y_px+1);
+ last_partial_redraw_cell->x2 = MAX2(last_partial_redraw_cell->x2, projPixel->x_px + 1);
+ last_partial_redraw_cell->y2 = MAX2(last_partial_redraw_cell->y2, projPixel->y_px + 1);
- switch(tool) {
- case PAINT_TOOL_CLONE:
- if (is_floatbuf) {
- if (((ProjPixelClone *)projPixel)->clonepx.f[3]) {
- do_projectpaint_clone_f(ps, projPixel, alpha, mask); /* rgba isnt used for cloning, only alpha */
+ switch (tool) {
+ case PAINT_TOOL_CLONE:
+ if (is_floatbuf) {
+ if (((ProjPixelClone *)projPixel)->clonepx.f[3]) {
+ do_projectpaint_clone_f(ps, projPixel, alpha, mask); /* rgba isn't used for cloning, only alpha */
+ }
}
- }
- else {
- if (((ProjPixelClone*)projPixel)->clonepx.ch[3]) {
- do_projectpaint_clone(ps, projPixel, alpha, mask); /* rgba isnt used for cloning, only alpha */
+ else {
+ if (((ProjPixelClone *)projPixel)->clonepx.ch[3]) {
+ do_projectpaint_clone(ps, projPixel, alpha, mask); /* rgba isn't used for cloning, only alpha */
+ }
}
- }
- break;
- case PAINT_TOOL_SMEAR:
- sub_v2_v2v2(co, projPixel->projCoSS, pos_ofs);
-
- if (is_floatbuf) do_projectpaint_smear_f(ps, projPixel, alpha, mask, smearArena, &smearPixels_f, co);
- else do_projectpaint_smear(ps, projPixel, alpha, mask, smearArena, &smearPixels, co);
- break;
- default:
- if (is_floatbuf) do_projectpaint_draw_f(ps, projPixel, rgba, alpha, mask, use_color_correction);
- else do_projectpaint_draw(ps, projPixel, rgba, alpha, mask);
- break;
+ break;
+ case PAINT_TOOL_SMEAR:
+ sub_v2_v2v2(co, projPixel->projCoSS, pos_ofs);
+
+ if (is_floatbuf) do_projectpaint_smear_f(ps, projPixel, alpha, mask, smearArena, &smearPixels_f, co);
+ else do_projectpaint_smear(ps, projPixel, alpha, mask, smearArena, &smearPixels, co);
+ break;
+ default:
+ if (is_floatbuf) do_projectpaint_draw_f(ps, projPixel, rgba, alpha, mask, use_color_correction);
+ else do_projectpaint_draw(ps, projPixel, rgba, alpha, mask);
+ break;
}
}
- if(lock_alpha) {
- if (is_floatbuf) projPixel->pixel.f_pt[3]= projPixel->origColor.f[3];
- else projPixel->pixel.ch_pt[3]= projPixel->origColor.ch[3];
+ if (lock_alpha) {
+ if (is_floatbuf) projPixel->pixel.f_pt[3] = projPixel->origColor.f[3];
+ else projPixel->pixel.ch_pt[3] = projPixel->origColor.ch[3];
}
/* done painting */
@@ -3996,14 +4009,14 @@ static void *do_projectpaint_thread(void *ph_v)
}
- if (tool==PAINT_TOOL_SMEAR) {
+ if (tool == PAINT_TOOL_SMEAR) {
- for (node= smearPixels; node; node= node->next) { /* this wont run for a float image */
+ for (node = smearPixels; node; node = node->next) { /* this wont run for a float image */
projPixel = node->link;
*projPixel->pixel.uint_pt = ((ProjPixelClone *)projPixel)->clonepx.uint;
}
- for (node= smearPixels_f; node; node= node->next) {
+ for (node = smearPixels_f; node; node = node->next) {
projPixel = node->link;
copy_v4_v4(projPixel->pixel.f_pt, ((ProjPixelClone *)projPixel)->clonepx.f);
}
@@ -4022,7 +4035,7 @@ static int project_paint_op(void *state, ImBuf *UNUSED(ibufb), const float lastp
ProjectHandle handles[BLENDER_MAX_THREADS];
ListBase threads;
- int a,i;
+ int a, i;
if (!project_bucket_iter_init(ps, pos)) {
return 0;
@@ -4032,7 +4045,7 @@ static int project_paint_op(void *state, ImBuf *UNUSED(ibufb), const float lastp
BLI_init_threads(&threads, do_projectpaint_thread, ps->thread_tot);
/* get the threads running */
- for(a=0; a < ps->thread_tot; a++) {
+ for (a = 0; a < ps->thread_tot; a++) {
/* set defaults in handles */
//memset(&handles[a], 0, sizeof(BakeShade));
@@ -4049,7 +4062,7 @@ static int project_paint_op(void *state, ImBuf *UNUSED(ibufb), const float lastp
memcpy(handles[a].projImages, ps->projImages, ps->image_tot * sizeof(ProjPaintImage));
/* image bounds */
- for (i=0; i< ps->image_tot; i++) {
+ for (i = 0; i < ps->image_tot; i++) {
handles[a].projImages[i].partRedrawRect = (ImagePaintPartialRedraw *)BLI_memarena_alloc(ps->arena_mt[a], sizeof(ImagePaintPartialRedraw) * PROJ_BOUNDBOX_SQUARED);
memcpy(handles[a].projImages[i].partRedrawRect, ps->projImages[i].partRedrawRect, sizeof(ImagePaintPartialRedraw) * PROJ_BOUNDBOX_SQUARED);
}
@@ -4065,9 +4078,9 @@ static int project_paint_op(void *state, ImBuf *UNUSED(ibufb), const float lastp
/* move threaded bounds back into ps->projectPartialRedraws */
- for(i=0; i < ps->image_tot; i++) {
+ for (i = 0; i < ps->image_tot; i++) {
int touch = 0;
- for(a=0; a < ps->thread_tot; a++) {
+ for (a = 0; a < ps->thread_tot; a++) {
touch |= partial_redraw_array_merge(ps->projImages[i].partRedrawRect, handles[a].projImages[i].partRedrawRect, PROJ_BOUNDBOX_SQUARED);
}
@@ -4104,12 +4117,12 @@ static int project_paint_stroke(ProjPaintState *ps, BrushPainter *painter, const
{
int a, redraw;
- for (a=0; a < ps->image_tot; a++)
+ for (a = 0; a < ps->image_tot; a++)
partial_redraw_array_init(ps->projImages[a].partRedrawRect);
- redraw= project_paint_sub_stroke(ps, painter, prevmval_i, mval_i, time, pressure);
+ redraw = project_paint_sub_stroke(ps, painter, prevmval_i, mval_i, time, pressure);
- if(project_image_refresh_tagged(ps))
+ if (project_image_refresh_tagged(ps))
return redraw;
return 0;
@@ -4125,7 +4138,7 @@ static void imapaint_clear_partial_redraw(void)
static void imapaint_dirty_region(Image *ima, ImBuf *ibuf, int x, int y, int w, int h)
{
ImBuf *tmpibuf = NULL;
- int srcx= 0, srcy= 0, origx;
+ int srcx = 0, srcy = 0, origx;
IMB_rectclip(ibuf, NULL, &x, &y, &srcx, &srcy, &w, &h);
@@ -4135,15 +4148,15 @@ static void imapaint_dirty_region(Image *ima, ImBuf *ibuf, int x, int y, int w,
if (!imapaintpartial.enabled) {
imapaintpartial.x1 = x;
imapaintpartial.y1 = y;
- imapaintpartial.x2 = x+w;
- imapaintpartial.y2 = y+h;
+ imapaintpartial.x2 = x + w;
+ imapaintpartial.y2 = y + h;
imapaintpartial.enabled = 1;
}
else {
imapaintpartial.x1 = MIN2(imapaintpartial.x1, x);
imapaintpartial.y1 = MIN2(imapaintpartial.y1, y);
- imapaintpartial.x2 = MAX2(imapaintpartial.x2, x+w);
- imapaintpartial.y2 = MAX2(imapaintpartial.y2, y+h);
+ imapaintpartial.x2 = MAX2(imapaintpartial.x2, x + w);
+ imapaintpartial.y2 = MAX2(imapaintpartial.y2, y + h);
}
w = ((x + w - 1) >> IMAPAINT_TILE_BITS);
@@ -4152,7 +4165,7 @@ static void imapaint_dirty_region(Image *ima, ImBuf *ibuf, int x, int y, int w,
y = (y >> IMAPAINT_TILE_BITS);
for (; y <= h; y++)
- for (x=origx; x <= w; x++)
+ for (x = origx; x <= w; x++)
image_undo_push_tile(ima, ibuf, &tmpibuf, x, y);
ibuf->userflags |= IB_BITMAPDIRTY;
@@ -4163,18 +4176,18 @@ static void imapaint_dirty_region(Image *ima, ImBuf *ibuf, int x, int y, int w,
static void imapaint_image_update(SpaceImage *sima, Image *image, ImBuf *ibuf, short texpaint)
{
- if(ibuf->rect_float)
- ibuf->userflags |= IB_RECT_INVALID; /* force recreate of char rect */
+ if (ibuf->rect_float)
+ ibuf->userflags |= IB_RECT_INVALID; /* force recreate of char rect */
- if(ibuf->mipmap[0])
+ if (ibuf->mipmap[0])
ibuf->userflags |= IB_MIPMAP_INVALID;
/* todo: should set_tpage create ->rect? */
- if(texpaint || (sima && sima->lock)) {
+ if (texpaint || (sima && sima->lock)) {
int w = imapaintpartial.x2 - imapaintpartial.x1;
int h = imapaintpartial.y2 - imapaintpartial.y1;
/* Testing with partial update in uv editor too */
- GPU_paint_update_image(image, imapaintpartial.x1, imapaintpartial.y1, w, h, 0);//!texpaint);
+ GPU_paint_update_image(image, imapaintpartial.x1, imapaintpartial.y1, w, h, 0); //!texpaint);
}
}
@@ -4190,20 +4203,22 @@ static void imapaint_ibuf_get_set_rgb(ImBuf *ibuf, int x, int y, short torus, sh
}
if (ibuf->rect_float) {
- float *rrgbf = ibuf->rect_float + (ibuf->x*y + x)*4;
+ float *rrgbf = ibuf->rect_float + (ibuf->x * y + x) * 4;
if (set) {
IMAPAINT_FLOAT_RGB_COPY(rrgbf, rgb);
- } else {
+ }
+ else {
IMAPAINT_FLOAT_RGB_COPY(rgb, rrgbf);
}
}
else {
- char *rrgb = (char*)ibuf->rect + (ibuf->x*y + x)*4;
+ char *rrgb = (char *)ibuf->rect + (ibuf->x * y + x) * 4;
if (set) {
IMAPAINT_FLOAT_RGB_TO_CHAR(rrgb, rgb)
- } else {
+ }
+ else {
IMAPAINT_CHAR_RGB_TO_FLOAT(rgb, rrgb)
}
}
@@ -4241,14 +4256,14 @@ static void imapaint_lift_soften(ImBuf *ibuf, ImBuf *ibufb, int *pos, short toru
if (!torus) {
IMB_rectclip(ibuf, ibufb, &in_off[0], &in_off[1], &out_off[0],
- &out_off[1], &dim[0], &dim[1]);
+ &out_off[1], &dim[0], &dim[1]);
if ((dim[0] == 0) || (dim[1] == 0))
return;
}
- for (y=0; y < dim[1]; y++) {
- for (x=0; x < dim[0]; x++) {
+ for (y = 0; y < dim[1]; y++) {
+ for (x = 0; x < dim[0]; x++) {
/* get input pixel */
xi = in_off[0] + x;
yi = in_off[1] + y;
@@ -4256,16 +4271,16 @@ static void imapaint_lift_soften(ImBuf *ibuf, ImBuf *ibufb, int *pos, short toru
count = 1;
imapaint_ibuf_get_set_rgb(ibuf, xi, yi, torus, 0, outrgb);
- count += imapaint_ibuf_add_if(ibuf, xi-1, yi-1, outrgb, torus);
- count += imapaint_ibuf_add_if(ibuf, xi-1, yi , outrgb, torus);
- count += imapaint_ibuf_add_if(ibuf, xi-1, yi+1, outrgb, torus);
+ count += imapaint_ibuf_add_if(ibuf, xi - 1, yi - 1, outrgb, torus);
+ count += imapaint_ibuf_add_if(ibuf, xi - 1, yi, outrgb, torus);
+ count += imapaint_ibuf_add_if(ibuf, xi - 1, yi + 1, outrgb, torus);
- count += imapaint_ibuf_add_if(ibuf, xi , yi-1, outrgb, torus);
- count += imapaint_ibuf_add_if(ibuf, xi , yi+1, outrgb, torus);
+ count += imapaint_ibuf_add_if(ibuf, xi, yi - 1, outrgb, torus);
+ count += imapaint_ibuf_add_if(ibuf, xi, yi + 1, outrgb, torus);
- count += imapaint_ibuf_add_if(ibuf, xi+1, yi-1, outrgb, torus);
- count += imapaint_ibuf_add_if(ibuf, xi+1, yi , outrgb, torus);
- count += imapaint_ibuf_add_if(ibuf, xi+1, yi+1, outrgb, torus);
+ count += imapaint_ibuf_add_if(ibuf, xi + 1, yi - 1, outrgb, torus);
+ count += imapaint_ibuf_add_if(ibuf, xi + 1, yi, outrgb, torus);
+ count += imapaint_ibuf_add_if(ibuf, xi + 1, yi + 1, outrgb, torus);
outrgb[0] /= count;
outrgb[1] /= count;
@@ -4281,23 +4296,23 @@ static void imapaint_lift_soften(ImBuf *ibuf, ImBuf *ibufb, int *pos, short toru
static void imapaint_set_region(ImagePaintRegion *region, int destx, int desty, int srcx, int srcy, int width, int height)
{
- region->destx= destx;
- region->desty= desty;
- region->srcx= srcx;
- region->srcy= srcy;
- region->width= width;
- region->height= height;
+ region->destx = destx;
+ region->desty = desty;
+ region->srcx = srcx;
+ region->srcy = srcy;
+ region->width = width;
+ region->height = height;
}
static int imapaint_torus_split_region(ImagePaintRegion region[4], ImBuf *dbuf, ImBuf *sbuf)
{
- int destx= region->destx;
- int desty= region->desty;
- int srcx= region->srcx;
- int srcy= region->srcy;
- int width= region->width;
- int height= region->height;
- int origw, origh, w, h, tot= 0;
+ int destx = region->destx;
+ int desty = region->desty;
+ int srcx = region->srcx;
+ int srcy = region->srcy;
+ int width = region->width;
+ int height = region->height;
+ int origw, origh, w, h, tot = 0;
/* convert destination and source coordinates to be within image */
destx = destx % dbuf->x;
@@ -4310,9 +4325,9 @@ 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 */
- origw = w = (width > dbuf->x)? dbuf->x: width;
- origh = h = (height > dbuf->y)? dbuf->y: height;
+ * same pixel twice */
+ origw = w = (width > dbuf->x) ? dbuf->x : width;
+ origh = h = (height > dbuf->y) ? dbuf->y : height;
/* clip within image */
IMB_rectclip(dbuf, sbuf, &destx, &desty, &srcx, &srcy, &w, &h);
@@ -4320,11 +4335,11 @@ static int imapaint_torus_split_region(ImagePaintRegion region[4], ImBuf *dbuf,
/* do 3 other rects if needed */
if (w < origw)
- imapaint_set_region(&region[tot++], (destx+w)%dbuf->x, desty, (srcx+w)%sbuf->x, srcy, origw-w, h);
+ imapaint_set_region(&region[tot++], (destx + w) % dbuf->x, desty, (srcx + w) % sbuf->x, srcy, origw - w, h);
if (h < origh)
- imapaint_set_region(&region[tot++], destx, (desty+h)%dbuf->y, srcx, (srcy+h)%sbuf->y, w, origh-h);
+ imapaint_set_region(&region[tot++], destx, (desty + h) % dbuf->y, srcx, (srcy + h) % sbuf->y, w, origh - h);
if ((w < origw) && (h < origh))
- imapaint_set_region(&region[tot++], (destx+w)%dbuf->x, (desty+h)%dbuf->y, (srcx+w)%sbuf->x, (srcy+h)%sbuf->y, origw-w, origh-h);
+ imapaint_set_region(&region[tot++], (destx + w) % dbuf->x, (desty + h) % dbuf->y, (srcx + w) % sbuf->x, (srcy + h) % sbuf->y, origw - w, origh - h);
return tot;
}
@@ -4335,46 +4350,46 @@ static void imapaint_lift_smear(ImBuf *ibuf, ImBuf *ibufb, int *pos)
int a, tot;
imapaint_set_region(region, 0, 0, pos[0], pos[1], ibufb->x, ibufb->y);
- tot= imapaint_torus_split_region(region, ibufb, ibuf);
+ tot = imapaint_torus_split_region(region, ibufb, ibuf);
- for(a=0; a<tot; a++)
+ for (a = 0; a < tot; a++)
IMB_rectblend(ibufb, ibuf, region[a].destx, region[a].desty,
- region[a].srcx, region[a].srcy,
- region[a].width, region[a].height, IMB_BLEND_COPY_RGB);
+ region[a].srcx, region[a].srcy,
+ region[a].width, region[a].height, IMB_BLEND_COPY_RGB);
}
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 */
- 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);
+ * 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);
IMB_rectclip(clonebuf, ibuf, &destx, &desty, &srcx, &srcy, &w, &h);
IMB_rectblend(clonebuf, ibuf, destx, desty, srcx, srcy, w, h,
- IMB_BLEND_COPY_RGB);
+ IMB_BLEND_COPY_RGB);
IMB_rectblend(clonebuf, ibufb, destx, desty, destx, desty, w, h,
- IMB_BLEND_COPY_ALPHA);
+ IMB_BLEND_COPY_ALPHA);
return clonebuf;
}
static void imapaint_convert_brushco(ImBuf *ibufb, const float pos[2], int ipos[2])
{
- ipos[0]= (int)floorf((pos[0] - ibufb->x/2) + 1.0f);
- ipos[1]= (int)floorf((pos[1] - ibufb->y/2) + 1.0f);
+ ipos[0] = (int)floorf((pos[0] - ibufb->x / 2) + 1.0f);
+ ipos[1] = (int)floorf((pos[1] - ibufb->y / 2) + 1.0f);
}
/* dosnt run for projection painting
* only the old style painting in the 3d view */
static int imapaint_paint_op(void *state, ImBuf *ibufb, const float lastpos[2], const float pos[2])
{
- ImagePaintState *s= ((ImagePaintState*)state);
- ImBuf *clonebuf= NULL, *frombuf;
+ ImagePaintState *s = ((ImagePaintState *)state);
+ ImBuf *clonebuf = NULL, *frombuf;
ImagePaintRegion region[4];
- short torus= s->brush->flag & BRUSH_TORUS;
- short blend= s->blend;
- float *offset= s->brush->clone.offset;
+ short torus = s->brush->flag & BRUSH_TORUS;
+ short blend = s->blend;
+ float *offset = s->brush->clone.offset;
float liftpos[2];
int bpos[2], blastpos[2], bliftpos[2];
int a, tot;
@@ -4382,48 +4397,48 @@ static int imapaint_paint_op(void *state, ImBuf *ibufb, const float lastpos[2],
imapaint_convert_brushco(ibufb, pos, bpos);
/* lift from canvas */
- if(s->tool == PAINT_TOOL_SOFTEN) {
+ if (s->tool == PAINT_TOOL_SOFTEN) {
imapaint_lift_soften(s->canvas, ibufb, bpos, torus);
}
- else if(s->tool == PAINT_TOOL_SMEAR) {
- if (lastpos[0]==pos[0] && lastpos[1]==pos[1])
+ else if (s->tool == PAINT_TOOL_SMEAR) {
+ if (lastpos[0] == pos[0] && lastpos[1] == pos[1])
return 0;
imapaint_convert_brushco(ibufb, lastpos, blastpos);
imapaint_lift_smear(s->canvas, ibufb, blastpos);
}
- else if(s->tool == PAINT_TOOL_CLONE && s->clonecanvas) {
- liftpos[0]= pos[0] - offset[0]*s->canvas->x;
- liftpos[1]= pos[1] - offset[1]*s->canvas->y;
+ else if (s->tool == PAINT_TOOL_CLONE && s->clonecanvas) {
+ liftpos[0] = pos[0] - offset[0] * s->canvas->x;
+ liftpos[1] = pos[1] - offset[1] * s->canvas->y;
imapaint_convert_brushco(ibufb, liftpos, bliftpos);
- clonebuf= imapaint_lift_clone(s->clonecanvas, ibufb, bliftpos);
+ clonebuf = imapaint_lift_clone(s->clonecanvas, ibufb, bliftpos);
}
- frombuf= (clonebuf)? clonebuf: ibufb;
+ frombuf = (clonebuf) ? clonebuf : ibufb;
- if(torus) {
+ if (torus) {
imapaint_set_region(region, bpos[0], bpos[1], 0, 0, frombuf->x, frombuf->y);
- tot= imapaint_torus_split_region(region, s->canvas, frombuf);
+ tot = imapaint_torus_split_region(region, s->canvas, frombuf);
}
else {
imapaint_set_region(region, bpos[0], bpos[1], 0, 0, frombuf->x, frombuf->y);
- tot= 1;
+ tot = 1;
}
/* blend into canvas */
- for(a=0; a<tot; a++) {
+ for (a = 0; a < tot; a++) {
imapaint_dirty_region(s->image, s->canvas,
- region[a].destx, region[a].desty,
- region[a].width, region[a].height);
+ region[a].destx, region[a].desty,
+ region[a].width, region[a].height);
IMB_rectblend(s->canvas, frombuf,
- region[a].destx, region[a].desty,
- region[a].srcx, region[a].srcy,
- region[a].width, region[a].height, blend);
+ region[a].destx, region[a].desty,
+ region[a].srcx, region[a].srcy,
+ region[a].width, region[a].height, blend);
}
- if(clonebuf) IMB_freeImBuf(clonebuf);
+ if (clonebuf) IMB_freeImBuf(clonebuf);
return 1;
}
@@ -4440,56 +4455,56 @@ static int texpaint_break_stroke(float *prevuv, float *fwuv, float *bkuv, float
sub_v2_v2v2(d1, fwuv, prevuv);
sub_v2_v2v2(d2, uv, bkuv);
- return ((dot_v2v2(d1, d2) < 0.0f) || (mismatch > MAX2(len1, len2)*2));
+ return ((dot_v2v2(d1, d2) < 0.0f) || (mismatch > MAX2(len1, len2) * 2));
}
/* ImagePaint Common */
static int imapaint_canvas_set(ImagePaintState *s, Image *ima)
{
- ImBuf *ibuf= BKE_image_get_ibuf(ima, s->sima? &s->sima->iuser: NULL);
+ ImBuf *ibuf = BKE_image_get_ibuf(ima, s->sima ? &s->sima->iuser : NULL);
/* verify that we can paint and set canvas */
- if(ima==NULL) {
+ if (ima == NULL) {
return 0;
}
- else if(ima->packedfile && ima->rr) {
+ else if (ima->packedfile && ima->rr) {
s->warnpackedfile = ima->id.name + 2;
return 0;
}
- else if(ibuf && ibuf->channels!=4) {
+ else if (ibuf && ibuf->channels != 4) {
s->warnmultifile = ima->id.name + 2;
return 0;
}
- else if(!ibuf || !(ibuf->rect || ibuf->rect_float))
+ else if (!ibuf || !(ibuf->rect || ibuf->rect_float))
return 0;
- s->image= ima;
- s->canvas= ibuf;
+ s->image = ima;
+ s->canvas = ibuf;
/* set clone canvas */
- if(s->tool == PAINT_TOOL_CLONE) {
- ima= s->brush->clone.image;
- ibuf= BKE_image_get_ibuf(ima, s->sima? &s->sima->iuser: NULL);
+ if (s->tool == PAINT_TOOL_CLONE) {
+ ima = s->brush->clone.image;
+ ibuf = BKE_image_get_ibuf(ima, s->sima ? &s->sima->iuser : NULL);
- if(!ima || !ibuf || !(ibuf->rect || ibuf->rect_float))
+ if (!ima || !ibuf || !(ibuf->rect || ibuf->rect_float))
return 0;
- s->clonecanvas= ibuf;
+ s->clonecanvas = ibuf;
/* temporarily add float rect for cloning */
- if(s->canvas->rect_float && !s->clonecanvas->rect_float) {
+ if (s->canvas->rect_float && !s->clonecanvas->rect_float) {
int profile = IB_PROFILE_NONE;
/* Don't want to color manage, but don't disturb existing profiles */
SWAP(int, s->clonecanvas->profile, profile);
IMB_float_from_rect(s->clonecanvas);
- s->clonefreefloat= 1;
+ s->clonefreefloat = 1;
SWAP(int, s->clonecanvas->profile, profile);
}
- else if(!s->canvas->rect_float && !s->clonecanvas->rect)
+ else if (!s->canvas->rect_float && !s->clonecanvas->rect)
IMB_rect_from_float(s->clonecanvas);
}
@@ -4504,16 +4519,16 @@ static void imapaint_canvas_free(ImagePaintState *s)
static int imapaint_paint_sub_stroke(ImagePaintState *s, BrushPainter *painter, Image *image, short texpaint, float *uv, double time, int update, float pressure)
{
- ImBuf *ibuf= BKE_image_get_ibuf(image, s->sima? &s->sima->iuser: NULL);
+ ImBuf *ibuf = BKE_image_get_ibuf(image, s->sima ? &s->sima->iuser : NULL);
float pos[2];
- if(!ibuf)
+ if (!ibuf)
return 0;
- pos[0] = uv[0]*ibuf->x;
- pos[1] = uv[1]*ibuf->y;
+ pos[0] = uv[0] * ibuf->x;
+ pos[1] = uv[1] * ibuf->y;
- brush_painter_require_imbuf(painter, ((ibuf->rect_float)? 1: 0), 0, 0);
+ brush_painter_require_imbuf(painter, ((ibuf->rect_float) ? 1 : 0), 0, 0);
if (brush_painter_paint(painter, imapaint_paint_op, pos, time, pressure, s, ibuf->profile == IB_PROFILE_LINEAR_RGB)) {
if (update)
@@ -4532,15 +4547,15 @@ static int imapaint_paint_stroke(ViewContext *vc, ImagePaintState *s, BrushPaint
if (texpaint) {
/* pick new face and image */
- if ( imapaint_pick_face(vc, s->me, mval, &newfaceindex) &&
- ((s->me->editflag & ME_EDIT_PAINT_MASK)==0 || (s->me->mface+newfaceindex)->flag & ME_FACE_SEL)
- ) {
+ if (imapaint_pick_face(vc, mval, &newfaceindex, s->dm_totface) &&
+ ((s->do_facesel == FALSE) || (s->dm_mface[newfaceindex].flag & ME_FACE_SEL)))
+ {
ImBuf *ibuf;
newimage = imapaint_face_image(s, newfaceindex);
- ibuf= BKE_image_get_ibuf(newimage, s->sima? &s->sima->iuser: NULL);
+ ibuf = BKE_image_get_ibuf(newimage, s->sima ? &s->sima->iuser : NULL);
- if(ibuf && ibuf->rect)
+ if (ibuf && ibuf->rect)
imapaint_pick_uv(s->scene, s->ob, newfaceindex, mval, newuv);
else {
newimage = NULL;
@@ -4556,17 +4571,17 @@ static int imapaint_paint_stroke(ViewContext *vc, ImagePaintState *s, BrushPaint
imapaint_pick_uv(s->scene, s->ob, newfaceindex, prevmval, bkuv);
if (newimage == s->image)
- breakstroke= texpaint_break_stroke(s->uv, fwuv, bkuv, newuv);
+ breakstroke = texpaint_break_stroke(s->uv, fwuv, bkuv, newuv);
else
- breakstroke= 1;
+ breakstroke = 1;
}
else
- fwuv[0]= fwuv[1]= 0.0f;
+ fwuv[0] = fwuv[1] = 0.0f;
if (breakstroke) {
imapaint_pick_uv(s->scene, s->ob, s->faceindex, mval, fwuv);
redraw |= imapaint_paint_sub_stroke(s, painter, s->image, texpaint,
- fwuv, time, 1, pressure);
+ fwuv, time, 1, pressure);
imapaint_clear_partial_redraw();
brush_painter_break_stroke(painter);
}
@@ -4579,10 +4594,10 @@ static int imapaint_paint_stroke(ViewContext *vc, ImagePaintState *s, BrushPaint
/* paint in new image */
if (newimage) {
if (breakstroke)
- redraw|= imapaint_paint_sub_stroke(s, painter, newimage,
- texpaint, bkuv, time, 0, pressure);
- redraw|= imapaint_paint_sub_stroke(s, painter, newimage, texpaint,
- newuv, time, 1, pressure);
+ redraw |= imapaint_paint_sub_stroke(s, painter, newimage,
+ texpaint, bkuv, time, 0, pressure);
+ redraw |= imapaint_paint_sub_stroke(s, painter, newimage, texpaint,
+ newuv, time, 1, pressure);
}
/* update state */
@@ -4594,7 +4609,7 @@ static int imapaint_paint_stroke(ViewContext *vc, ImagePaintState *s, BrushPaint
else {
UI_view2d_region_to_view(s->v2d, mval[0], mval[1], &newuv[0], &newuv[1]);
redraw |= imapaint_paint_sub_stroke(s, painter, s->image, texpaint, newuv,
- time, 1, pressure);
+ time, 1, pressure);
}
if (redraw)
@@ -4607,18 +4622,18 @@ static int imapaint_paint_stroke(ViewContext *vc, ImagePaintState *s, BrushPaint
static Brush *image_paint_brush(bContext *C)
{
- Scene *scene= CTX_data_scene(C);
- ToolSettings *settings= scene->toolsettings;
+ Scene *scene = CTX_data_scene(C);
+ ToolSettings *settings = scene->toolsettings;
return paint_brush(&settings->imapaint.paint);
}
static Brush *uv_sculpt_brush(bContext *C)
{
- Scene *scene= CTX_data_scene(C);
- ToolSettings *settings= scene->toolsettings;
+ Scene *scene = CTX_data_scene(C);
+ ToolSettings *settings = scene->toolsettings;
- if(!settings->uvsculpt)
+ if (!settings->uvsculpt)
return NULL;
return paint_brush(&settings->uvsculpt->paint);
}
@@ -4627,19 +4642,19 @@ static int image_paint_poll(bContext *C)
{
Object *obact = CTX_data_active_object(C);
- if(!image_paint_brush(C))
+ if (!image_paint_brush(C))
return 0;
- if((obact && obact->mode & OB_MODE_TEXTURE_PAINT) && CTX_wm_region_view3d(C)) {
+ if ((obact && obact->mode & OB_MODE_TEXTURE_PAINT) && CTX_wm_region_view3d(C)) {
return 1;
}
else {
- SpaceImage *sima= CTX_wm_space_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
- if(sima) {
- ARegion *ar= CTX_wm_region(C);
+ if (sima) {
+ ARegion *ar = CTX_wm_region(C);
- if((sima->flag & SI_DRAWTOOL) && ar->regiontype==RGN_TYPE_WINDOW)
+ if ((sima->flag & SI_DRAWTOOL) && ar->regiontype == RGN_TYPE_WINDOW)
return 1;
}
}
@@ -4652,19 +4667,19 @@ static int uv_sculpt_brush_poll(bContext *C)
BMEditMesh *em;
int ret;
Object *obedit = CTX_data_edit_object(C);
- SpaceImage *sima= CTX_wm_space_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
Scene *scene = CTX_data_scene(C);
ToolSettings *toolsettings = scene->toolsettings;
- if(!uv_sculpt_brush(C) || !obedit || obedit->type != OB_MESH)
+ if (!uv_sculpt_brush(C) || !obedit || obedit->type != OB_MESH)
return 0;
- em = ((Mesh *)obedit->data)->edit_btmesh;
- ret = EDBM_texFaceCheck(em);
+ em = BMEdit_FromObject(obedit);
+ ret = EDBM_mtexpoly_check(em);
- if(ret && sima) {
- ARegion *ar= CTX_wm_region(C);
- if((toolsettings->use_uv_sculpt) && ar->regiontype==RGN_TYPE_WINDOW)
+ if (ret && sima) {
+ ARegion *ar = CTX_wm_region(C);
+ if ((toolsettings->use_uv_sculpt) && ar->regiontype == RGN_TYPE_WINDOW)
return 1;
}
@@ -4673,7 +4688,7 @@ static int uv_sculpt_brush_poll(bContext *C)
static int image_paint_3d_poll(bContext *C)
{
- if(CTX_wm_region_view3d(C))
+ if (CTX_wm_region_view3d(C))
return image_paint_poll(C);
return 0;
@@ -4681,11 +4696,11 @@ static int image_paint_3d_poll(bContext *C)
static int image_paint_2d_clone_poll(bContext *C)
{
- Brush *brush= image_paint_brush(C);
+ Brush *brush = image_paint_brush(C);
- if(!CTX_wm_region_view3d(C) && image_paint_poll(C))
- if(brush && (brush->imagepaint_tool == PAINT_TOOL_CLONE))
- if(brush->clone.image)
+ if (!CTX_wm_region_view3d(C) && image_paint_poll(C))
+ if (brush && (brush->imagepaint_tool == PAINT_TOOL_CLONE))
+ if (brush->clone.image)
return 1;
return 0;
@@ -4708,7 +4723,7 @@ typedef struct PaintOperation {
int first;
int prevmouse[2];
- float prev_pressure; /* need this since we dont get tablet events for pressure change */
+ float prev_pressure; /* need this since we don't get tablet events for pressure change */
int orig_brush_size;
double starttime;
@@ -4718,29 +4733,29 @@ typedef struct PaintOperation {
short restore_projection;
} PaintOperation;
-static void paint_redraw(bContext *C, ImagePaintState *s, int final)
+static void paint_redraw(bContext *C, ImagePaintState *s, int texpaint, int final)
{
- if(final) {
- if(s->image)
+ if (final) {
+ if (s->image && !(texpaint || (s->sima && s->sima->lock)))
GPU_free_image(s->image);
/* compositor listener deals with updating */
- WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, s->image);
+ WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, s->image);
}
else {
- if(!s->sima || !s->sima->lock)
+ if (!s->sima || !s->sima->lock)
ED_region_tag_redraw(CTX_wm_region(C));
else
- WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, s->image);
+ WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, s->image);
}
}
/* initialize project paint settings from context */
static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps)
{
- Scene *scene= CTX_data_scene(C);
- ToolSettings *settings= scene->toolsettings;
- Brush *brush= paint_brush(&settings->imapaint.paint);
+ Scene *scene = CTX_data_scene(C);
+ ToolSettings *settings = scene->toolsettings;
+ Brush *brush = paint_brush(&settings->imapaint.paint);
/* brush */
ps->brush = brush;
@@ -4752,12 +4767,12 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps)
/* these can be NULL */
- ps->v3d= CTX_wm_view3d(C);
- ps->rv3d= CTX_wm_region_view3d(C);
- ps->ar= CTX_wm_region(C);
+ ps->v3d = CTX_wm_view3d(C);
+ ps->rv3d = CTX_wm_region_view3d(C);
+ ps->ar = CTX_wm_region(C);
- ps->scene= scene;
- ps->ob= ob; /* allow override of active object */
+ ps->scene = scene;
+ ps->ob = ob; /* allow override of active object */
/* setup projection painting data */
ps->do_backfacecull = (settings->imapaint.flag & IMAGEPAINT_PROJECT_BACKFACE) ? 0 : 1;
@@ -4776,86 +4791,116 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps)
ps->seam_bleed_px = settings->imapaint.seam_bleed; /* pixel num to bleed */
#endif
- if(ps->do_mask_normal) {
+ if (ps->do_mask_normal) {
ps->normal_angle_inner = settings->imapaint.normal_angle;
ps->normal_angle = (ps->normal_angle_inner + 90.0f) * 0.5f;
}
else {
- ps->normal_angle_inner= ps->normal_angle= settings->imapaint.normal_angle;
+ ps->normal_angle_inner = ps->normal_angle = settings->imapaint.normal_angle;
}
- ps->normal_angle_inner *= (float)(M_PI_2 / 90);
- ps->normal_angle *= (float)(M_PI_2 / 90);
+ ps->normal_angle_inner *= (float)(M_PI_2 / 90);
+ ps->normal_angle *= (float)(M_PI_2 / 90);
ps->normal_angle_range = ps->normal_angle - ps->normal_angle_inner;
- if(ps->normal_angle_range <= 0.0f)
- ps->do_mask_normal = 0; /* no need to do blending */
+ if (ps->normal_angle_range <= 0.0f)
+ ps->do_mask_normal = 0; /* no need to do blending */
}
static void paint_brush_init_tex(Brush *brush)
{
/* init mtex nodes */
- if(brush) {
- MTex *mtex= &brush->mtex;
- if(mtex->tex && mtex->tex->nodetree)
- ntreeTexBeginExecTree(mtex->tex->nodetree, 1); /* has internal flag to detect it only does it once */
+ if (brush) {
+ MTex *mtex = &brush->mtex;
+ if (mtex->tex && mtex->tex->nodetree)
+ ntreeTexBeginExecTree(mtex->tex->nodetree, 1); /* has internal flag to detect it only does it once */
}
}
static int texture_paint_init(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- ToolSettings *settings= scene->toolsettings;
- Brush *brush= paint_brush(&settings->imapaint.paint);
- PaintOperation *pop= MEM_callocN(sizeof(PaintOperation), "PaintOperation"); /* caller frees */
+ Scene *scene = CTX_data_scene(C);
+ ToolSettings *settings = scene->toolsettings;
+ Brush *brush = paint_brush(&settings->imapaint.paint);
+ PaintOperation *pop = MEM_callocN(sizeof(PaintOperation), "PaintOperation"); /* caller frees */
- pop->first= 1;
- op->customdata= pop;
+ pop->first = 1;
+ op->customdata = pop;
/* XXX: Soften tool does not support projection painting atm, so just disable
- projection for this brush */
- if(brush->imagepaint_tool == PAINT_TOOL_SOFTEN) {
+ * projection for this brush */
+ if (brush->imagepaint_tool == PAINT_TOOL_SOFTEN) {
settings->imapaint.flag |= IMAGEPAINT_PROJECT_DISABLE;
pop->restore_projection = 1;
}
/* initialize from context */
- if(CTX_wm_region_view3d(C)) {
- pop->mode= PAINT_MODE_3D;
+ if (CTX_wm_region_view3d(C)) {
+ pop->mode = PAINT_MODE_3D;
- if(!(settings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE))
- pop->mode= PAINT_MODE_3D_PROJECT;
+ if (!(settings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE))
+ pop->mode = PAINT_MODE_3D_PROJECT;
else
view3d_set_viewcontext(C, &pop->vc);
}
else {
- pop->s.sima= CTX_wm_space_image(C);
- pop->s.v2d= &CTX_wm_region(C)->v2d;
+ pop->s.sima = CTX_wm_space_image(C);
+ pop->s.v2d = &CTX_wm_region(C)->v2d;
}
- pop->s.scene= scene;
- pop->s.screen= CTX_wm_screen(C);
+ pop->s.scene = scene;
+ pop->s.screen = CTX_wm_screen(C);
pop->s.brush = brush;
pop->s.tool = brush->imagepaint_tool;
- if(pop->mode == PAINT_MODE_3D && (pop->s.tool == PAINT_TOOL_CLONE))
+ if (pop->mode == PAINT_MODE_3D && (pop->s.tool == PAINT_TOOL_CLONE))
pop->s.tool = PAINT_TOOL_DRAW;
pop->s.blend = brush->blend;
- pop->orig_brush_size= brush_size(scene, brush);
+ pop->orig_brush_size = brush_size(scene, brush);
+
+ if (pop->mode != PAINT_MODE_2D) {
+ Object *ob = OBACT;
+ Mesh *me = get_mesh(ob);
+
+ if (!me) {
+ return 0;
+ }
+
+ pop->s.ob = ob;
+ pop->s.do_facesel = (me->editflag & ME_EDIT_PAINT_MASK) != 0;
+
+ /* for non prohect paint we need */
+ /* fill in derived mesh */
+ if (ob->derivedFinal && CustomData_has_layer(&ob->derivedFinal->faceData, CD_MTFACE)) {
+ pop->s.dm = ob->derivedFinal;
+ pop->s.dm_release = FALSE;
+ }
+ else {
+ pop->s.dm = mesh_get_derived_final(pop->s.scene, ob, pop->s.scene->customdata_mask | CD_MASK_MTFACE);
+ pop->s.dm_release = TRUE;
+ }
+
+ if (!CustomData_has_layer(&pop->s.dm->faceData, CD_MTFACE)) {
+
+ if (pop->s.dm_release)
+ pop->s.dm->release(pop->s.dm);
+
+ pop->s.dm = NULL;
+ return 0;
+ }
- if(pop->mode != PAINT_MODE_2D) {
- pop->s.ob = OBACT;
- pop->s.me = get_mesh(pop->s.ob);
- if (!pop->s.me) return 0;
+ pop->s.dm_mface = pop->s.dm->getTessFaceArray(pop->s.dm);
+ pop->s.dm_mtface = pop->s.dm->getTessFaceDataArray(pop->s.dm, CD_MTFACE);
+ pop->s.dm_totface = pop->s.dm->getNumTessFaces(pop->s.dm);
}
else {
pop->s.image = pop->s.sima->image;
- if(!imapaint_canvas_set(&pop->s, pop->s.image)) {
- if(pop->s.warnmultifile)
+ if (!imapaint_canvas_set(&pop->s, pop->s.image)) {
+ if (pop->s.warnmultifile)
BKE_report(op->reports, RPT_WARNING, "Image requires 4 color channels to paint");
- if(pop->s.warnpackedfile)
+ if (pop->s.warnpackedfile)
BKE_report(op->reports, RPT_WARNING, "Packed MultiLayer files cannot be painted");
return 0;
@@ -4865,42 +4910,42 @@ static int texture_paint_init(bContext *C, wmOperator *op)
paint_brush_init_tex(pop->s.brush);
/* note, if we have no UVs on the derived mesh, then we must return here */
- if(pop->mode == PAINT_MODE_3D_PROJECT) {
+ if (pop->mode == PAINT_MODE_3D_PROJECT) {
/* initialize all data from the context */
project_state_init(C, OBACT, &pop->ps);
paint_brush_init_tex(pop->ps.brush);
- pop->ps.source= PROJ_SRC_VIEW;
+ pop->ps.source = PROJ_SRC_VIEW;
- if (pop->ps.ob==NULL || !(pop->ps.ob->lay & pop->ps.v3d->lay))
+ if (pop->ps.ob == NULL || !(pop->ps.ob->lay & pop->ps.v3d->lay))
return 0;
- /* Dont allow brush size below 2 */
+ /* Don't allow brush size below 2 */
if (brush_size(scene, brush) < 2)
brush_set_size(scene, brush, 2);
/* allocate and initialize spacial data structures */
project_paint_begin(&pop->ps);
- if(pop->ps.dm==NULL)
+ if (pop->ps.dm == NULL)
return 0;
}
settings->imapaint.flag |= IMAGEPAINT_DRAWING;
undo_paint_push_begin(UNDO_PAINT_IMAGE, op->type->name,
- image_undo_restore, image_undo_free);
+ image_undo_restore, image_undo_free);
/* create painter */
- pop->painter= brush_painter_new(scene, pop->s.brush);
+ pop->painter = brush_painter_new(scene, pop->s.brush);
return 1;
}
static void paint_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
{
- PaintOperation *pop= op->customdata;
+ PaintOperation *pop = op->customdata;
float time, mousef[2];
float pressure;
int mouse[2], redraw;
@@ -4908,52 +4953,52 @@ static void paint_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
RNA_float_get_array(itemptr, "mouse", mousef);
mouse[0] = (int)(mousef[0]);
mouse[1] = (int)(mousef[1]);
- time= RNA_float_get(itemptr, "time");
- pressure= RNA_float_get(itemptr, "pressure");
+ time = RNA_float_get(itemptr, "time");
+ pressure = RNA_float_get(itemptr, "pressure");
- if(pop->first)
+ if (pop->first)
project_paint_begin_clone(&pop->ps, mouse);
- if(pop->mode == PAINT_MODE_3D)
+ if (pop->mode == PAINT_MODE_3D)
view3d_operator_needs_opengl(C);
- if(pop->mode == PAINT_MODE_3D_PROJECT) {
- redraw= project_paint_stroke(&pop->ps, pop->painter, pop->prevmouse, mouse, time, pressure);
- pop->prevmouse[0]= mouse[0];
- pop->prevmouse[1]= mouse[1];
+ if (pop->mode == PAINT_MODE_3D_PROJECT) {
+ redraw = project_paint_stroke(&pop->ps, pop->painter, pop->prevmouse, mouse, time, pressure);
+ pop->prevmouse[0] = mouse[0];
+ pop->prevmouse[1] = mouse[1];
}
else {
- redraw= imapaint_paint_stroke(&pop->vc, &pop->s, pop->painter, pop->mode == PAINT_MODE_3D, pop->prevmouse, mouse, time, pressure);
- pop->prevmouse[0]= mouse[0];
- pop->prevmouse[1]= mouse[1];
+ redraw = imapaint_paint_stroke(&pop->vc, &pop->s, pop->painter, pop->mode == PAINT_MODE_3D, pop->prevmouse, mouse, time, pressure);
+ pop->prevmouse[0] = mouse[0];
+ pop->prevmouse[1] = mouse[1];
}
- if(redraw)
- paint_redraw(C, &pop->s, 0);
+ if (redraw)
+ paint_redraw(C, &pop->s, pop->mode == PAINT_MODE_3D, 0);
- pop->first= 0;
+ pop->first = 0;
}
static void paint_brush_exit_tex(Brush *brush)
{
- if(brush) {
- MTex *mtex= &brush->mtex;
- if(mtex->tex && mtex->tex->nodetree)
+ if (brush) {
+ MTex *mtex = &brush->mtex;
+ if (mtex->tex && mtex->tex->nodetree)
ntreeTexEndExecTree(mtex->tex->nodetree->execdata, 1);
}
}
static void paint_exit(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- ToolSettings *settings= scene->toolsettings;
- PaintOperation *pop= op->customdata;
+ Scene *scene = CTX_data_scene(C);
+ ToolSettings *settings = scene->toolsettings;
+ PaintOperation *pop = op->customdata;
- if(pop->timer)
+ if (pop->timer)
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), pop->timer);
- if(pop->restore_projection)
+ if (pop->restore_projection)
settings->imapaint.flag &= ~IMAGEPAINT_PROJECT_DISABLE;
paint_brush_exit_tex(pop->s.brush);
@@ -4962,19 +5007,24 @@ static void paint_exit(bContext *C, wmOperator *op)
imapaint_canvas_free(&pop->s);
brush_painter_free(pop->painter);
- if(pop->mode == PAINT_MODE_3D_PROJECT) {
+ if (pop->mode == PAINT_MODE_3D_PROJECT) {
brush_set_size(scene, pop->ps.brush, pop->orig_brush_size);
paint_brush_exit_tex(pop->ps.brush);
project_paint_end(&pop->ps);
}
+ else {
+ /* non projection 3d paint, could move into own function of more needs adding */
+ if (pop->s.dm_release)
+ pop->s.dm->release(pop->s.dm);
+ }
- paint_redraw(C, &pop->s, 1);
+ paint_redraw(C, &pop->s, pop->mode == PAINT_MODE_3D, 1);
undo_paint_push_end(UNDO_PAINT_IMAGE);
- if(pop->s.warnmultifile)
+ if (pop->s.warnmultifile)
BKE_reportf(op->reports, RPT_WARNING, "Image requires 4 color channels to paint: %s", pop->s.warnmultifile);
- if(pop->s.warnpackedfile)
+ if (pop->s.warnpackedfile)
BKE_reportf(op->reports, RPT_WARNING, "Packed MultiLayer files cannot be painted: %s", pop->s.warnpackedfile);
MEM_freeN(pop);
@@ -4982,7 +5032,7 @@ static void paint_exit(bContext *C, wmOperator *op)
static int paint_exec(bContext *C, wmOperator *op)
{
- if(!texture_paint_init(C, op)) {
+ if (!texture_paint_init(C, op)) {
MEM_freeN(op->customdata);
return OPERATOR_CANCELLED;
}
@@ -5000,43 +5050,43 @@ static int paint_exec(bContext *C, wmOperator *op)
static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
{
const Scene *scene = CTX_data_scene(C);
- PaintOperation *pop= op->customdata;
+ PaintOperation *pop = op->customdata;
wmTabletData *wmtab;
PointerRNA itemptr;
float pressure, mousef[2];
double time;
int tablet;
- time= PIL_check_seconds_timer();
+ time = PIL_check_seconds_timer();
- tablet= 0;
- pop->s.blend= pop->s.brush->blend;
+ tablet = 0;
+ pop->s.blend = pop->s.brush->blend;
- if(event->custom == EVT_DATA_TABLET) {
- wmtab= event->customdata;
+ if (event->custom == EVT_DATA_TABLET) {
+ wmtab = event->customdata;
- tablet= (wmtab->Active != EVT_TABLET_NONE);
- pressure= wmtab->Pressure;
- if(wmtab->Active == EVT_TABLET_ERASER)
- pop->s.blend= IMB_BLEND_ERASE_ALPHA;
+ tablet = (wmtab->Active != EVT_TABLET_NONE);
+ pressure = wmtab->Pressure;
+ if (wmtab->Active == EVT_TABLET_ERASER)
+ pop->s.blend = IMB_BLEND_ERASE_ALPHA;
}
else { /* otherwise airbrush becomes 1.0 pressure instantly */
- pressure= pop->prev_pressure ? pop->prev_pressure : 1.0f;
+ pressure = pop->prev_pressure ? pop->prev_pressure : 1.0f;
}
- if(pop->first) {
- pop->prevmouse[0]= event->mval[0];
- pop->prevmouse[1]= event->mval[1];
- pop->starttime= time;
+ if (pop->first) {
+ pop->prevmouse[0] = event->mval[0];
+ pop->prevmouse[1] = event->mval[1];
+ 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;
@@ -5054,34 +5104,34 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
/* apply */
paint_apply(C, op, &itemptr);
- pop->prev_pressure= pressure;
+ pop->prev_pressure = pressure;
}
static int paint_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
PaintOperation *pop;
- if(!texture_paint_init(C, op)) {
+ if (!texture_paint_init(C, op)) {
MEM_freeN(op->customdata);
return OPERATOR_CANCELLED;
}
paint_apply_event(C, op, event);
- pop= op->customdata;
+ pop = op->customdata;
WM_event_add_modal_handler(C, op);
- if(pop->s.brush->flag & BRUSH_AIRBRUSH)
- pop->timer= WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f);
+ if (pop->s.brush->flag & BRUSH_AIRBRUSH)
+ pop->timer = WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f);
return OPERATOR_RUNNING_MODAL;
}
static int paint_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- PaintOperation *pop= op->customdata;
+ PaintOperation *pop = op->customdata;
- switch(event->type) {
+ switch (event->type) {
case LEFTMOUSE:
case MIDDLEMOUSE:
case RIGHTMOUSE: // XXX hardcoded
@@ -5092,7 +5142,7 @@ static int paint_modal(bContext *C, wmOperator *op, wmEvent *event)
paint_apply_event(C, op, event);
break;
case TIMER:
- if(event->customdata == pop->timer)
+ if (event->customdata == pop->timer)
paint_apply_event(C, op, event);
break;
}
@@ -5110,18 +5160,18 @@ static int paint_cancel(bContext *C, wmOperator *op)
void PAINT_OT_image_paint(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Image Paint";
- ot->idname= "PAINT_OT_image_paint";
+ ot->name = "Image Paint";
+ ot->idname = "PAINT_OT_image_paint";
/* api callbacks */
- ot->exec= paint_exec;
- ot->invoke= paint_invoke;
- ot->modal= paint_modal;
- ot->cancel= paint_cancel;
- ot->poll= image_paint_poll;
+ ot->exec = paint_exec;
+ ot->invoke = paint_invoke;
+ ot->modal = paint_modal;
+ ot->cancel = paint_cancel;
+ ot->poll = image_paint_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_BLOCKING;
/* properties */
RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
@@ -5129,11 +5179,11 @@ void PAINT_OT_image_paint(wmOperatorType *ot)
int get_imapaint_zoom(bContext *C, float *zoomx, float *zoomy)
{
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
- if(!rv3d) {
- SpaceImage *sima= CTX_wm_space_image(C);
- ARegion *ar= CTX_wm_region(C);
+ if (!rv3d) {
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ARegion *ar = CTX_wm_region(C);
ED_space_image_zoom(sima, ar, zoomx, zoomy);
@@ -5152,22 +5202,24 @@ static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata)
#define PX_SIZE_FADE_MAX 12.0f
#define PX_SIZE_FADE_MIN 4.0f
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
//Brush *brush= image_paint_brush(C);
- Paint *paint= paint_get_active(scene);
- Brush *brush= paint_brush(paint);
+ Paint *paint = paint_get_active(scene);
+ Brush *brush = paint_brush(paint);
- if(paint && brush && paint->flags & PAINT_SHOW_BRUSH) {
+ if (paint && brush && paint->flags & PAINT_SHOW_BRUSH) {
ToolSettings *ts;
float zoomx, zoomy;
- const float size= (float)brush_size(scene, brush);
- const short use_zoom= get_imapaint_zoom(C, &zoomx, &zoomy);
+ const float size = (float)brush_size(scene, brush);
+ short use_zoom;
float pixel_size;
- float alpha= 0.5f;
+ float alpha = 0.5f;
ts = scene->toolsettings;
+ use_zoom = get_imapaint_zoom(C, &zoomx, &zoomy)
+ && !(ts->use_uv_sculpt && (scene->basact->object->mode == OB_MODE_EDIT));
- if(use_zoom && !ts->use_uv_sculpt){
+ if (use_zoom) {
pixel_size = MAX2(size * zoomx, size * zoomy);
}
else {
@@ -5175,7 +5227,7 @@ static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata)
}
/* fade out the brush (cheap trick to work around brush interfearing with sampling [#])*/
- if(pixel_size < PX_SIZE_FADE_MIN) {
+ if (pixel_size < PX_SIZE_FADE_MIN) {
return;
}
else if (pixel_size < PX_SIZE_FADE_MAX) {
@@ -5187,15 +5239,15 @@ static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata)
glTranslatef((float)x, (float)y, 0.0f);
/* No need to scale for uv sculpting, on the contrary it might be useful to keep unscaled */
- if(use_zoom && !ts->use_uv_sculpt)
+ if (use_zoom)
glScalef(zoomx, zoomy, 1.0f);
glColor4f(brush->add_col[0], brush->add_col[1], brush->add_col[2], alpha);
- glEnable( GL_LINE_SMOOTH );
+ glEnable(GL_LINE_SMOOTH);
glEnable(GL_BLEND);
- glutil_draw_lined_arc(0, (float)(M_PI*2.0), size, 40);
+ glutil_draw_lined_arc(0, (float)(M_PI * 2.0), size, 40);
glDisable(GL_BLEND);
- glDisable( GL_LINE_SMOOTH );
+ glDisable(GL_LINE_SMOOTH);
glPopMatrix();
}
@@ -5205,39 +5257,39 @@ static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata)
static void toggle_paint_cursor(bContext *C, int enable)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
Scene *scene = CTX_data_scene(C);
- ToolSettings *settings= scene->toolsettings;
+ ToolSettings *settings = scene->toolsettings;
- if(settings->imapaint.paintcursor && !enable) {
+ if (settings->imapaint.paintcursor && !enable) {
WM_paint_cursor_end(wm, settings->imapaint.paintcursor);
settings->imapaint.paintcursor = NULL;
}
- else if(enable)
- settings->imapaint.paintcursor= WM_paint_cursor_activate(wm, image_paint_poll, brush_drawcursor, NULL);
+ else if (enable)
+ settings->imapaint.paintcursor = WM_paint_cursor_activate(wm, image_paint_poll, brush_drawcursor, NULL);
}
/* 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;
- if(!imapaint->paintcursor) {
+ if (!imapaint->paintcursor) {
imapaint->paintcursor =
- WM_paint_cursor_activate(wm, image_paint_poll,
- brush_drawcursor, NULL);
+ WM_paint_cursor_activate(wm, image_paint_poll,
+ brush_drawcursor, NULL);
}
}
void ED_space_image_uv_sculpt_update(wmWindowManager *wm, ToolSettings *settings)
{
- if(settings->use_uv_sculpt) {
- if(!settings->uvsculpt) {
+ if (settings->use_uv_sculpt) {
+ if (!settings->uvsculpt) {
settings->uvsculpt = MEM_callocN(sizeof(*settings->uvsculpt), "UV Smooth paint");
settings->uv_sculpt_tool = UV_SCULPT_TOOL_GRAB;
settings->uv_sculpt_settings = UV_SCULPT_LOCK_BORDERS | UV_SCULPT_ALL_ISLANDS;
@@ -5247,10 +5299,10 @@ void ED_space_image_uv_sculpt_update(wmWindowManager *wm, ToolSettings *settings
paint_init(&settings->uvsculpt->paint, PAINT_CURSOR_SCULPT);
WM_paint_cursor_activate(wm, uv_sculpt_brush_poll,
- brush_drawcursor, NULL);
+ brush_drawcursor, NULL);
}
else {
- if(settings->uvsculpt)
+ if (settings->uvsculpt)
settings->uvsculpt->paint.flags &= ~PAINT_SHOW_BRUSH;
}
}
@@ -5263,7 +5315,7 @@ typedef struct GrabClone {
static void grab_clone_apply(bContext *C, wmOperator *op)
{
- Brush *brush= image_paint_brush(C);
+ Brush *brush = image_paint_brush(C);
float delta[2];
RNA_float_get_array(op->ptr, "delta", delta);
@@ -5280,14 +5332,14 @@ static int grab_clone_exec(bContext *C, wmOperator *op)
static int grab_clone_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- Brush *brush= image_paint_brush(C);
+ Brush *brush = image_paint_brush(C);
GrabClone *cmv;
- cmv= MEM_callocN(sizeof(GrabClone), "GrabClone");
+ cmv = MEM_callocN(sizeof(GrabClone), "GrabClone");
copy_v2_v2(cmv->startoffset, brush->clone.offset);
- cmv->startx= event->x;
- cmv->starty= event->y;
- op->customdata= cmv;
+ cmv->startx = event->x;
+ cmv->starty = event->y;
+ op->customdata = cmv;
WM_event_add_modal_handler(C, op);
@@ -5296,13 +5348,13 @@ static int grab_clone_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int grab_clone_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- Brush *brush= image_paint_brush(C);
- ARegion *ar= CTX_wm_region(C);
- GrabClone *cmv= op->customdata;
+ Brush *brush = image_paint_brush(C);
+ ARegion *ar = CTX_wm_region(C);
+ GrabClone *cmv = op->customdata;
float startfx, startfy, fx, fy, delta[2];
- int xmin= ar->winrct.xmin, ymin= ar->winrct.ymin;
+ int xmin = ar->winrct.xmin, ymin = ar->winrct.ymin;
- switch(event->type) {
+ switch (event->type) {
case LEFTMOUSE:
case MIDDLEMOUSE:
case RIGHTMOUSE: // XXX hardcoded
@@ -5313,8 +5365,8 @@ static int grab_clone_modal(bContext *C, wmOperator *op, wmEvent *event)
UI_view2d_region_to_view(&ar->v2d, cmv->startx - xmin, cmv->starty - ymin, &startfx, &startfy);
UI_view2d_region_to_view(&ar->v2d, event->x - xmin, event->y - ymin, &fx, &fy);
- delta[0]= fx - startfx;
- delta[1]= fy - startfy;
+ delta[0] = fx - startfx;
+ delta[1] = fy - startfy;
RNA_float_set_array(op->ptr, "delta", delta);
copy_v2_v2(brush->clone.offset, cmv->startoffset);
@@ -5335,18 +5387,18 @@ static int grab_clone_cancel(bContext *UNUSED(C), wmOperator *op)
void PAINT_OT_grab_clone(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Grab Clone";
- ot->idname= "PAINT_OT_grab_clone";
+ ot->name = "Grab Clone";
+ ot->idname = "PAINT_OT_grab_clone";
/* api callbacks */
- ot->exec= grab_clone_exec;
- ot->invoke= grab_clone_invoke;
- ot->modal= grab_clone_modal;
- ot->cancel= grab_clone_cancel;
- ot->poll= image_paint_2d_clone_poll;
+ ot->exec = grab_clone_exec;
+ ot->invoke = grab_clone_invoke;
+ ot->modal = grab_clone_modal;
+ ot->cancel = grab_clone_cancel;
+ ot->poll = image_paint_2d_clone_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
/* properties */
RNA_def_float_vector(ot->srna, "delta", 2, NULL, -FLT_MAX, FLT_MAX, "Delta", "Delta offset of clone image in 0.0..1.0 coordinates", -1.0f, 1.0f);
@@ -5356,15 +5408,15 @@ void PAINT_OT_grab_clone(wmOperatorType *ot)
static int sample_color_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Brush *brush= image_paint_brush(C);
- ARegion *ar= CTX_wm_region(C);
+ Scene *scene = CTX_data_scene(C);
+ Brush *brush = image_paint_brush(C);
+ ARegion *ar = CTX_wm_region(C);
int location[2];
RNA_int_get_array(op->ptr, "location", location);
paint_sample_color(scene, ar, location[0], location[1]);
- WM_event_add_notifier(C, NC_BRUSH|NA_EDITED, brush);
+ WM_event_add_notifier(C, NC_BRUSH | NA_EDITED, brush);
return OPERATOR_FINISHED;
}
@@ -5381,7 +5433,7 @@ static int sample_color_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int sample_color_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- switch(event->type) {
+ switch (event->type) {
case LEFTMOUSE:
case RIGHTMOUSE: // XXX hardcoded
return OPERATOR_FINISHED;
@@ -5397,12 +5449,12 @@ static int sample_color_modal(bContext *C, wmOperator *op, wmEvent *event)
/* same as image_paint_poll but fail when face mask mode is enabled */
static int image_paint_sample_color_poll(bContext *C)
{
- if(image_paint_poll(C)) {
- if(CTX_wm_view3d(C)) {
+ if (image_paint_poll(C)) {
+ if (CTX_wm_view3d(C)) {
Object *obact = CTX_data_active_object(C);
if (obact && obact->mode & OB_MODE_TEXTURE_PAINT) {
- Mesh *me= get_mesh(obact);
- if(me) {
+ Mesh *me = get_mesh(obact);
+ if (me) {
return !(me->editflag & ME_EDIT_PAINT_MASK);
}
}
@@ -5417,17 +5469,17 @@ static int image_paint_sample_color_poll(bContext *C)
void PAINT_OT_sample_color(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Sample Color";
- ot->idname= "PAINT_OT_sample_color";
+ ot->name = "Sample Color";
+ ot->idname = "PAINT_OT_sample_color";
/* api callbacks */
- ot->exec= sample_color_exec;
- ot->invoke= sample_color_invoke;
- ot->modal= sample_color_modal;
- ot->poll= image_paint_sample_color_poll;
+ ot->exec = sample_color_exec;
+ ot->invoke = sample_color_invoke;
+ ot->modal = sample_color_modal;
+ ot->poll = image_paint_sample_color_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_int_vector(ot->srna, "location", 2, NULL, 0, INT_MAX, "Location", "Cursor location in region coordinates", 0, 16384);
@@ -5437,9 +5489,9 @@ void PAINT_OT_sample_color(wmOperatorType *ot)
static int set_clone_cursor_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- View3D *v3d= CTX_wm_view3d(C);
- float *cursor= give_cursor(scene, v3d);
+ Scene *scene = CTX_data_scene(C);
+ View3D *v3d = CTX_wm_view3d(C);
+ float *cursor = give_cursor(scene, v3d);
RNA_float_get_array(op->ptr, "location", cursor);
@@ -5450,14 +5502,14 @@ static int set_clone_cursor_exec(bContext *C, wmOperator *op)
static int set_clone_cursor_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- Scene *scene= CTX_data_scene(C);
- View3D *v3d= CTX_wm_view3d(C);
- ARegion *ar= CTX_wm_region(C);
+ Scene *scene = CTX_data_scene(C);
+ View3D *v3d = CTX_wm_view3d(C);
+ ARegion *ar = CTX_wm_region(C);
float location[3];
view3d_operator_needs_opengl(C);
- if(!ED_view3d_autodist(scene, ar, v3d, event->mval, location))
+ if (!ED_view3d_autodist(scene, ar, v3d, event->mval, location))
return OPERATOR_CANCELLED;
RNA_float_set_array(op->ptr, "location", location);
@@ -5468,16 +5520,16 @@ static int set_clone_cursor_invoke(bContext *C, wmOperator *op, wmEvent *event)
void PAINT_OT_clone_cursor_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Clone Cursor";
- ot->idname= "PAINT_OT_clone_cursor_set";
+ ot->name = "Set Clone Cursor";
+ ot->idname = "PAINT_OT_clone_cursor_set";
/* api callbacks */
- ot->exec= set_clone_cursor_exec;
- ot->invoke= set_clone_cursor_invoke;
- ot->poll= image_paint_3d_poll;
+ ot->exec = set_clone_cursor_exec;
+ ot->invoke = set_clone_cursor_invoke;
+ ot->poll = image_paint_3d_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_float_vector(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in world space coordinates", -10000.0f, 10000.0f);
@@ -5487,9 +5539,9 @@ void PAINT_OT_clone_cursor_set(wmOperatorType *ot)
static int texture_paint_toggle_poll(bContext *C)
{
- if(CTX_data_edit_object(C))
+ if (CTX_data_edit_object(C))
return 0;
- if(CTX_data_active_object(C)==NULL)
+ if (CTX_data_active_object(C) == NULL)
return 0;
return 1;
@@ -5497,11 +5549,11 @@ static int texture_paint_toggle_poll(bContext *C)
static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_active_object(C);
- Mesh *me= NULL;
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = CTX_data_active_object(C);
+ Mesh *me = NULL;
- if(ob==NULL)
+ if (ob == NULL)
return OPERATOR_CANCELLED;
if (object_data_is_libdata(ob)) {
@@ -5509,17 +5561,17 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- me= get_mesh(ob);
+ me = get_mesh(ob);
- if(!(ob->mode & OB_MODE_TEXTURE_PAINT) && !me) {
+ if (!(ob->mode & OB_MODE_TEXTURE_PAINT) && !me) {
BKE_report(op->reports, RPT_ERROR, "Can only enter texture paint mode for mesh objects");
return OPERATOR_CANCELLED;
}
- if(ob->mode & OB_MODE_TEXTURE_PAINT) {
+ if (ob->mode & OB_MODE_TEXTURE_PAINT) {
ob->mode &= ~OB_MODE_TEXTURE_PAINT;
- if(U.glreslimit != 0)
+ if (U.glreslimit != 0)
GPU_free_images();
GPU_paint_set_mipmap(1);
@@ -5528,13 +5580,13 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
else {
ob->mode |= OB_MODE_TEXTURE_PAINT;
- if(me->mtface==NULL)
- me->mtface= CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT,
- NULL, me->totface);
+ if (me->mtface == NULL)
+ me->mtface = CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT,
+ NULL, me->totface);
paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
- if(U.glreslimit != 0)
+ if (U.glreslimit != 0)
GPU_free_images();
GPU_paint_set_mipmap(0);
@@ -5542,7 +5594,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
}
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_SCENE|ND_MODE, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene);
return OPERATOR_FINISHED;
}
@@ -5550,21 +5602,21 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
void PAINT_OT_texture_paint_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Texture Paint Toggle";
- ot->idname= "PAINT_OT_texture_paint_toggle";
+ ot->name = "Texture Paint Toggle";
+ ot->idname = "PAINT_OT_texture_paint_toggle";
/* api callbacks */
- ot->exec= texture_paint_toggle_exec;
- ot->poll= texture_paint_toggle_poll;
+ ot->exec = texture_paint_toggle_exec;
+ ot->poll = texture_paint_toggle_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int texture_paint_poll(bContext *C)
{
- if(texture_paint_toggle_poll(C))
- if(CTX_data_active_object(C)->mode & OB_MODE_TEXTURE_PAINT)
+ if (texture_paint_toggle_poll(C))
+ if (CTX_data_active_object(C)->mode & OB_MODE_TEXTURE_PAINT)
return 1;
return 0;
@@ -5597,93 +5649,93 @@ int mask_paint_poll(bContext *C)
/* use project paint to re-apply an image */
static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
{
- Image *image= BLI_findlink(&CTX_data_main(C)->image, RNA_enum_get(op->ptr, "image"));
- Scene *scene= CTX_data_scene(C);
- ProjPaintState ps= {NULL};
+ Image *image = BLI_findlink(&CTX_data_main(C)->image, RNA_enum_get(op->ptr, "image"));
+ Scene *scene = CTX_data_scene(C);
+ ProjPaintState ps = {NULL};
int orig_brush_size;
IDProperty *idgroup;
- IDProperty *view_data= NULL;
+ IDProperty *view_data = NULL;
project_state_init(C, OBACT, &ps);
- if(ps.ob==NULL || ps.ob->type != OB_MESH) {
+ if (ps.ob == NULL || ps.ob->type != OB_MESH) {
BKE_report(op->reports, RPT_ERROR, "No active mesh object");
return OPERATOR_CANCELLED;
}
- if(image==NULL) {
+ if (image == NULL) {
BKE_report(op->reports, RPT_ERROR, "Image could not be found");
return OPERATOR_CANCELLED;
}
- ps.reproject_image= image;
- ps.reproject_ibuf= BKE_image_get_ibuf(image, NULL);
+ ps.reproject_image = image;
+ ps.reproject_ibuf = BKE_image_get_ibuf(image, NULL);
- if(ps.reproject_ibuf==NULL || ps.reproject_ibuf->rect==NULL) {
+ if (ps.reproject_ibuf == NULL || ps.reproject_ibuf->rect == NULL) {
BKE_report(op->reports, RPT_ERROR, "Image data could not be found");
return OPERATOR_CANCELLED;
}
- idgroup= IDP_GetProperties(&image->id, 0);
+ idgroup = IDP_GetProperties(&image->id, 0);
- if(idgroup) {
- view_data= IDP_GetPropertyTypeFromGroup(idgroup, PROJ_VIEW_DATA_ID, IDP_ARRAY);
+ if (idgroup) {
+ view_data = IDP_GetPropertyTypeFromGroup(idgroup, PROJ_VIEW_DATA_ID, IDP_ARRAY);
/* type check to make sure its ok */
- if(view_data->len != PROJ_VIEW_DATA_SIZE || view_data->subtype != IDP_FLOAT) {
+ if (view_data->len != PROJ_VIEW_DATA_SIZE || view_data->subtype != IDP_FLOAT) {
BKE_report(op->reports, RPT_ERROR, "Image project data invalid");
return OPERATOR_CANCELLED;
}
}
- if(view_data) {
+ if (view_data) {
/* image has stored view projection info */
- ps.source= PROJ_SRC_IMAGE_VIEW;
+ ps.source = PROJ_SRC_IMAGE_VIEW;
}
else {
- ps.source= PROJ_SRC_IMAGE_CAM;
+ ps.source = PROJ_SRC_IMAGE_CAM;
- if(scene->camera==NULL) {
+ if (scene->camera == NULL) {
BKE_report(op->reports, RPT_ERROR, "No active camera set");
return OPERATOR_CANCELLED;
}
}
/* override */
- ps.is_texbrush= 0;
- ps.is_airbrush= 1;
- orig_brush_size= brush_size(scene, ps.brush);
+ ps.is_texbrush = 0;
+ ps.is_airbrush = 1;
+ orig_brush_size = brush_size(scene, ps.brush);
brush_set_size(scene, ps.brush, 32); /* cover the whole image */
- ps.tool= PAINT_TOOL_DRAW; /* so pixels are initialized with minimal info */
+ ps.tool = PAINT_TOOL_DRAW; /* so pixels are initialized with minimal info */
scene->toolsettings->imapaint.flag |= IMAGEPAINT_DRAWING;
undo_paint_push_begin(UNDO_PAINT_IMAGE, op->type->name,
- image_undo_restore, image_undo_free);
+ image_undo_restore, image_undo_free);
/* allocate and initialize spacial data structures */
project_paint_begin(&ps);
- if(ps.dm==NULL) {
+ if (ps.dm == NULL) {
brush_set_size(scene, ps.brush, orig_brush_size);
return OPERATOR_CANCELLED;
}
else {
- float pos[2]= {0.0, 0.0};
- float lastpos[2]= {0.0, 0.0};
+ float pos[2] = {0.0, 0.0};
+ float lastpos[2] = {0.0, 0.0};
int a;
- for (a=0; a < ps.image_tot; a++)
+ for (a = 0; a < ps.image_tot; a++)
partial_redraw_array_init(ps.projImages[a].partRedrawRect);
project_paint_op(&ps, NULL, lastpos, pos);
project_image_refresh_tagged(&ps);
- for (a=0; a < ps.image_tot; a++) {
+ for (a = 0; a < ps.image_tot; a++) {
GPU_free_image(ps.projImages[a].ima);
- WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ps.projImages[a].ima);
+ WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, ps.projImages[a].ima);
}
}
@@ -5700,20 +5752,20 @@ void PAINT_OT_project_image(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Project Image";
- ot->idname= "PAINT_OT_project_image";
- ot->description= "Project an edited render from the active camera back onto the object";
+ ot->name = "Project Image";
+ ot->idname = "PAINT_OT_project_image";
+ ot->description = "Project an edited render from the active camera back onto the object";
/* api callbacks */
- ot->invoke= WM_enum_search_invoke;
- ot->exec= texture_paint_camera_project_exec;
+ ot->invoke = WM_enum_search_invoke;
+ ot->exec = texture_paint_camera_project_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- prop= RNA_def_enum(ot->srna, "image", DummyRNA_NULL_items, 0, "Image", "");
+ prop = RNA_def_enum(ot->srna, "image", DummyRNA_NULL_items, 0, "Image", "");
RNA_def_enum_funcs(prop, RNA_image_itemf);
- ot->prop= prop;
+ ot->prop = prop;
}
static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
@@ -5722,38 +5774,38 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
ImBuf *ibuf;
char filename[FILE_MAX];
- Scene *scene= CTX_data_scene(C);
- ToolSettings *settings= scene->toolsettings;
- int w= settings->imapaint.screen_grab_size[0];
- int h= settings->imapaint.screen_grab_size[1];
+ Scene *scene = CTX_data_scene(C);
+ ToolSettings *settings = scene->toolsettings;
+ int w = settings->imapaint.screen_grab_size[0];
+ int h = settings->imapaint.screen_grab_size[1];
int maxsize;
- char err_out[256]= "unknown";
+ char err_out[256] = "unknown";
RNA_string_get(op->ptr, "filepath", filename);
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
- if(w > maxsize) w= maxsize;
- if(h > maxsize) h= maxsize;
+ 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);
- if(!ibuf) {
+ 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 */
BKE_reportf(op->reports, RPT_ERROR, "Failed to create OpenGL offscreen buffer: %s", err_out);
return OPERATOR_CANCELLED;
}
- image= BKE_add_image_imbuf(ibuf);
+ image = BKE_add_image_imbuf(ibuf);
- if(image) {
+ if (image) {
/* now for the trickyness. store the view projection here!
- * reprojection will reuse this */
- View3D *v3d= CTX_wm_view3d(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ * re-projection will reuse this */
+ View3D *v3d = CTX_wm_view3d(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
IDPropertyTemplate val;
- IDProperty *idgroup= IDP_GetProperties(&image->id, 1);
+ IDProperty *idgroup = IDP_GetProperties(&image->id, 1);
IDProperty *view_data;
int orth;
float *array;
@@ -5762,11 +5814,11 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
val.array.type = IDP_FLOAT;
view_data = IDP_New(IDP_ARRAY, &val, PROJ_VIEW_DATA_ID);
- array= (float *)IDP_Array(view_data);
- memcpy(array, rv3d->winmat, sizeof(rv3d->winmat)); array += sizeof(rv3d->winmat)/sizeof(float);
- memcpy(array, rv3d->viewmat, sizeof(rv3d->viewmat)); array += sizeof(rv3d->viewmat)/sizeof(float);
- orth= project_paint_view_clip(v3d, rv3d, &array[0], &array[1]);
- array[2]= orth ? 1.0f : 0.0f; /* using float for a bool is dodgy but since its an extra member in the array... easier then adding a single bool prop */
+ array = (float *)IDP_Array(view_data);
+ memcpy(array, rv3d->winmat, sizeof(rv3d->winmat)); array += sizeof(rv3d->winmat) / sizeof(float);
+ memcpy(array, rv3d->viewmat, sizeof(rv3d->viewmat)); array += sizeof(rv3d->viewmat) / sizeof(float);
+ orth = project_paint_view_clip(v3d, rv3d, &array[0], &array[1]);
+ array[2] = orth ? 1.0f : 0.0f; /* using float for a bool is dodgy but since its an extra member in the array... easier then adding a single bool prop */
IDP_AddToGroup(idgroup, view_data);
@@ -5779,16 +5831,16 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
void PAINT_OT_image_from_view(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Image from View";
- ot->idname= "PAINT_OT_image_from_view";
- ot->description= "Make an image from the current 3D view for re-projection";
+ ot->name = "Image from View";
+ ot->idname = "PAINT_OT_image_from_view";
+ ot->description = "Make an image from the current 3D view for re-projection";
/* api callbacks */
- ot->exec= texture_paint_image_from_view_exec;
- ot->poll= ED_operator_region_view3d_active;
+ ot->exec = texture_paint_image_from_view_exec;
+ ot->poll = ED_operator_region_view3d_active;
/* flags */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
RNA_def_string_file_name(ot->srna, "filepath", "", FILE_MAX, "File Path", "Name of the file");
}
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index b4315c2847d..200fd8e65c7 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,
@@ -132,7 +132,7 @@ void paint_calc_redraw_planes(float planes[4][4],
void projectf(struct bglMats *mats, const float v[3], float p[2]);
float paint_calc_object_space_radius(struct ViewContext *vc, const float center[3], float pixel_radius);
float paint_get_tex_pixel(struct Brush* br, float u, float v);
-int imapaint_pick_face(struct ViewContext *vc, struct Mesh *me, const int mval[2], unsigned int *index);
+int imapaint_pick_face(struct ViewContext *vc, const int mval[2], unsigned int *index, unsigned int totface);
void imapaint_pick_uv(struct Scene *scene, struct Object *ob, unsigned int faceindex, const int xy[2], float uv[2]);
void paint_sample_color(struct Scene *scene, struct ARegion *ar, int x, int y);
@@ -168,5 +168,19 @@ struct ListBase *undo_paint_push_get_list(int type);
void undo_paint_push_count_alloc(int type, int size);
void undo_paint_push_end(int type);
-#endif /* __PAINT_INTERN_H__ */
+/* paint_hide.c */
+
+typedef enum {
+ PARTIALVIS_HIDE,
+ PARTIALVIS_SHOW
+} PartialVisAction;
+
+typedef enum {
+ PARTIALVIS_INSIDE,
+ PARTIALVIS_OUTSIDE,
+ PARTIALVIS_ALL
+} PartialVisArea;
+void PAINT_OT_hide_show(struct wmOperatorType *ot);
+
+#endif /* __PAINT_INTERN_H__ */
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 757f501d296..3bc3c7a9224 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -75,31 +75,31 @@ static int brush_add_exec(bContext *C, wmOperator *UNUSED(op))
static void BRUSH_OT_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Brush";
- ot->description= "Add brush by mode type";
- ot->idname= "BRUSH_OT_add";
+ ot->name = "Add Brush";
+ ot->description = "Add brush by mode type";
+ ot->idname = "BRUSH_OT_add";
/* api callbacks */
- ot->exec= brush_add_exec;
+ ot->exec = brush_add_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int brush_scale_size_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Paint *paint= paint_get_active(scene);
- struct Brush *brush= paint_brush(paint);
+ Paint *paint = paint_get_active(scene);
+ struct Brush *brush = paint_brush(paint);
// Object *ob= CTX_data_active_object(C);
- float scalar= RNA_float_get(op->ptr, "scalar");
+ float scalar = RNA_float_get(op->ptr, "scalar");
if (brush) {
// pixel radius
{
- const int old_size= brush_size(scene, brush);
- int size= (int)(scalar*old_size);
+ const int old_size = brush_size(scene, brush);
+ int size = (int)(scalar * old_size);
if (old_size == size) {
if (scalar > 1) {
@@ -116,10 +116,10 @@ static int brush_scale_size_exec(bContext *C, wmOperator *op)
// unprojected radius
{
- float unprojected_radius= scalar*brush_unprojected_radius(scene, brush);
+ float unprojected_radius = scalar * brush_unprojected_radius(scene, brush);
if (unprojected_radius < 0.001f) // XXX magic number
- unprojected_radius= 0.001f;
+ unprojected_radius = 0.001f;
brush_set_unprojected_radius(scene, brush, unprojected_radius);
}
@@ -131,15 +131,15 @@ static int brush_scale_size_exec(bContext *C, wmOperator *op)
static void BRUSH_OT_scale_size(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Scale Sculpt/Paint Brush Size";
- ot->description= "Change brush size by a scalar";
- ot->idname= "BRUSH_OT_scale_size";
+ ot->name = "Scale Sculpt/Paint Brush Size";
+ ot->description = "Change brush size by a scalar";
+ ot->idname = "BRUSH_OT_scale_size";
/* api callbacks */
- ot->exec= brush_scale_size_exec;
+ ot->exec = brush_scale_size_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_float(ot->srna, "scalar", 1, 0, 2, "Scalar", "Factor to scale brush size by", 0, 2);
}
@@ -158,15 +158,15 @@ static int vertex_color_set_exec(bContext *C, wmOperator *UNUSED(op))
static void PAINT_OT_vertex_color_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Vertex Colors";
- ot->idname= "PAINT_OT_vertex_color_set";
+ ot->name = "Set Vertex Colors";
+ ot->idname = "PAINT_OT_vertex_color_set";
/* api callbacks */
- ot->exec= vertex_color_set_exec;
- ot->poll= vertex_paint_mode_poll;
+ ot->exec = vertex_color_set_exec;
+ ot->poll = vertex_paint_mode_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int brush_reset_exec(bContext *C, wmOperator *UNUSED(op))
@@ -175,9 +175,9 @@ static int brush_reset_exec(bContext *C, wmOperator *UNUSED(op))
struct Brush *brush = paint_brush(paint);
Object *ob = CTX_data_active_object(C);
- if(!ob) return OPERATOR_CANCELLED;
+ if (!ob) return OPERATOR_CANCELLED;
- if(ob->mode & OB_MODE_SCULPT)
+ if (ob->mode & OB_MODE_SCULPT)
brush_reset_sculpt(brush);
/* TODO: other modes */
@@ -187,15 +187,20 @@ static int brush_reset_exec(bContext *C, wmOperator *UNUSED(op))
static void BRUSH_OT_reset(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reset Brush";
- ot->description= "Return brush to defaults based on current tool";
- ot->idname= "BRUSH_OT_reset";
+ ot->name = "Reset Brush";
+ ot->description = "Return brush to defaults based on current tool";
+ ot->idname = "BRUSH_OT_reset";
/* api callbacks */
- ot->exec= brush_reset_exec;
+ ot->exec = brush_reset_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}
+
+static int brush_tool(const Brush *brush, size_t tool_offset)
+{
+ return *(((char *)brush) + tool_offset);
}
/* generic functions for setting the active brush based on the tool */
@@ -203,35 +208,33 @@ static Brush *brush_tool_cycle(Main *bmain, Brush *brush_orig, const int tool, c
{
struct Brush *brush;
- if(!brush_orig && !(brush_orig= bmain->brush.first)) {
+ if (!brush_orig && !(brush_orig = bmain->brush.first)) {
return NULL;
}
/* get the next brush with the active tool */
- for( brush= brush_orig->id.next ? brush_orig->id.next : bmain->brush.first;
- brush != brush_orig;
- brush= brush->id.next ? brush->id.next : bmain->brush.first)
+ for (brush = brush_orig->id.next ? brush_orig->id.next : bmain->brush.first;
+ brush != brush_orig;
+ brush = brush->id.next ? brush->id.next : bmain->brush.first)
{
- if( (brush->ob_mode & ob_mode) &&
- (*(((char *)brush) + tool_offset) == tool)
- ) {
+ if ((brush->ob_mode & ob_mode) &&
+ (brush_tool(brush, tool_offset) == tool)) {
return brush;
}
}
return NULL;
-
}
static int brush_generic_tool_set(Main *bmain, Paint *paint, const int tool, const size_t tool_offset, const int ob_mode)
{
- struct Brush *brush, *brush_orig= paint_brush(paint);
+ struct Brush *brush, *brush_orig = paint_brush(paint);
- brush= brush_tool_cycle(bmain, brush_orig, tool, tool_offset, ob_mode);
+ brush = brush_tool_cycle(bmain, brush_orig, tool, tool_offset, ob_mode);
- if(brush) {
+ if (brush) {
paint_brush_set(paint, brush);
- WM_main_add_notifier(NC_BRUSH|NA_EDITED, brush);
+ WM_main_add_notifier(NC_BRUSH | NA_EDITED, brush);
return OPERATOR_FINISHED;
}
else {
@@ -239,116 +242,123 @@ static int brush_generic_tool_set(Main *bmain, Paint *paint, const int tool, con
}
}
-static int brush_sculpt_tool_set_exec(bContext *C, wmOperator *op)
-{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
-
- return brush_generic_tool_set(bmain, &scene->toolsettings->sculpt->paint, RNA_enum_get(op->ptr, "tool"), offsetof(Brush, sculpt_tool), OB_MODE_SCULPT);
-}
-
-static void BRUSH_OT_sculpt_tool_set(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Sculpt Tool Set";
- ot->description= "Set the sculpt tool";
- ot->idname= "BRUSH_OT_sculpt_tool_set";
-
- /* api callbacks */
- ot->exec= brush_sculpt_tool_set_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-
- /* props */
- ot->prop= RNA_def_enum(ot->srna, "tool", brush_sculpt_tool_items, 0, "Tool", "");
-}
-
-static int brush_vertex_tool_set_exec(bContext *C, wmOperator *op)
-{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
+/* used in the PAINT_OT_brush_select operator */
+#define OB_MODE_ACTIVE 0
- return brush_generic_tool_set(bmain, &scene->toolsettings->vpaint->paint, RNA_enum_get(op->ptr, "tool"), offsetof(Brush, vertexpaint_tool), OB_MODE_VERTEX_PAINT);
-}
-
-static void BRUSH_OT_vertex_tool_set(wmOperatorType *ot)
+static int brush_select_exec(bContext *C, wmOperator *op)
{
- /* identifiers */
- ot->name= "Vertex Paint Tool Set";
- ot->description= "Set the vertex paint tool";
- ot->idname= "BRUSH_OT_vertex_tool_set";
-
- /* api callbacks */
- ot->exec= brush_vertex_tool_set_exec;
+ Main *bmain = CTX_data_main(C);
+ ToolSettings *toolsettings = CTX_data_tool_settings(C);
+ Paint *paint = NULL;
+ int tool, paint_mode = RNA_enum_get(op->ptr, "paint_mode");
+ size_t tool_offset;
+
+ if (paint_mode == OB_MODE_ACTIVE) {
+ /* select current paint mode */
+ paint_mode = CTX_data_active_object(C)->mode &
+ (OB_MODE_SCULPT |
+ OB_MODE_VERTEX_PAINT |
+ OB_MODE_WEIGHT_PAINT |
+ OB_MODE_TEXTURE_PAINT);
+ }
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ switch (paint_mode) {
+ case OB_MODE_SCULPT:
+ paint = &toolsettings->sculpt->paint;
+ tool_offset = offsetof(Brush, sculpt_tool);
+ tool = RNA_enum_get(op->ptr, "sculpt_tool");
+ break;
+ case OB_MODE_VERTEX_PAINT:
+ paint = &toolsettings->vpaint->paint;
+ tool_offset = offsetof(Brush, vertexpaint_tool);
+ tool = RNA_enum_get(op->ptr, "vertex_paint_tool");
+ break;
+ case OB_MODE_WEIGHT_PAINT:
+ paint = &toolsettings->wpaint->paint;
+ /* vertexpaint_tool is used for weight paint mode */
+ tool_offset = offsetof(Brush, vertexpaint_tool);
+ tool = RNA_enum_get(op->ptr, "weight_paint_tool");
+ break;
+ case OB_MODE_TEXTURE_PAINT:
+ paint = &toolsettings->imapaint.paint;
+ tool_offset = offsetof(Brush, imagepaint_tool);
+ tool = RNA_enum_get(op->ptr, "texture_paint_tool");
+ break;
+ default:
+ /* invalid paint mode */
+ return OPERATOR_CANCELLED;
+ }
- /* props */
- ot->prop= RNA_def_enum(ot->srna, "tool", brush_vertex_tool_items, 0, "Tool", "");
+ return brush_generic_tool_set(bmain, paint, tool, tool_offset, paint_mode);
}
-static int brush_weight_tool_set_exec(bContext *C, wmOperator *op)
+static void PAINT_OT_brush_select(wmOperatorType *ot)
{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
- /* vertexpaint_tool is used for weight paint mode */
- return brush_generic_tool_set(bmain, &scene->toolsettings->wpaint->paint, RNA_enum_get(op->ptr, "tool"), offsetof(Brush, vertexpaint_tool), OB_MODE_WEIGHT_PAINT);
-}
+ static EnumPropertyItem paint_mode_items[] = {
+ {OB_MODE_ACTIVE, "ACTIVE", 0, "Current", "Set brush for active paint mode"},
+ {OB_MODE_SCULPT, "SCULPT", ICON_SCULPTMODE_HLT, "Sculpt", ""},
+ {OB_MODE_VERTEX_PAINT, "VERTEX_PAINT", ICON_VPAINT_HLT, "Vertex Paint", ""},
+ {OB_MODE_WEIGHT_PAINT, "WEIGHT_PAINT", ICON_WPAINT_HLT, "Weight Paint", ""},
+ {OB_MODE_TEXTURE_PAINT, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""},
+ {0, NULL, 0, NULL, NULL}
+ };
-static void BRUSH_OT_weight_tool_set(wmOperatorType *ot)
-{
/* identifiers */
- ot->name= "Weight Paint Tool Set";
- ot->description= "Set the weight paint tool";
- ot->idname= "BRUSH_OT_weight_tool_set";
+ ot->name = "Brush Select";
+ ot->description = "Select a paint mode's brush by tool type";
+ ot->idname = "PAINT_OT_brush_select";
/* api callbacks */
- ot->exec= brush_weight_tool_set_exec;
+ ot->exec = brush_select_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
- ot->prop= RNA_def_enum(ot->srna, "tool", brush_vertex_tool_items, 0, "Tool", "");
+ RNA_def_enum(ot->srna, "paint_mode", paint_mode_items, OB_MODE_ACTIVE, "Paint Mode", "");
+ RNA_def_enum(ot->srna, "sculpt_tool", brush_sculpt_tool_items, 0, "Sculpt Tool", "");
+ RNA_def_enum(ot->srna, "vertex_paint_tool", brush_vertex_tool_items, 0, "Vertex Paint Tool", "");
+ RNA_def_enum(ot->srna, "weight_paint_tool", brush_vertex_tool_items, 0, "Weight Paint Tool", "");
+ RNA_def_enum(ot->srna, "texture_paint_tool", brush_image_tool_items, 0, "Texture Paint Tool", "");
}
-static int brush_image_tool_set_exec(bContext *C, wmOperator *op)
+static wmKeyMapItem *keymap_brush_select(wmKeyMap *keymap, int paint_mode,
+ int tool, int keymap_type,
+ int keymap_modifier)
{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
-
- return brush_generic_tool_set(bmain, &scene->toolsettings->imapaint.paint, RNA_enum_get(op->ptr, "tool"), offsetof(Brush, imagepaint_tool), OB_MODE_TEXTURE_PAINT);
-}
-
-static void BRUSH_OT_image_tool_set(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Image Paint Tool Set";
- ot->description= "Set the image tool";
- ot->idname= "BRUSH_OT_image_tool_set";
-
- /* api callbacks */
- ot->exec= brush_image_tool_set_exec;
+ wmKeyMapItem *kmi;
+ kmi = WM_keymap_add_item(keymap, "PAINT_OT_brush_select",
+ keymap_type, KM_PRESS, keymap_modifier, 0);
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ RNA_enum_set(kmi->ptr, "paint_mode", paint_mode);
+
+ switch (paint_mode) {
+ case OB_MODE_SCULPT:
+ RNA_enum_set(kmi->ptr, "sculpt_tool", tool);
+ break;
+ case OB_MODE_VERTEX_PAINT:
+ RNA_enum_set(kmi->ptr, "vertex_paint_tool", tool);
+ break;
+ case OB_MODE_WEIGHT_PAINT:
+ RNA_enum_set(kmi->ptr, "weight_paint_tool", tool);
+ break;
+ case OB_MODE_TEXTURE_PAINT:
+ RNA_enum_set(kmi->ptr, "texture_paint_tool", tool);
+ break;
+ }
- /* props */
- ot->prop= RNA_def_enum(ot->srna, "tool", brush_image_tool_items, 0, "Tool", "");
+ return kmi;
}
-
static int brush_uv_sculpt_tool_set_exec(bContext *C, wmOperator *op)
{
Brush *brush;
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
ToolSettings *ts = scene->toolsettings;
ts->uv_sculpt_tool = RNA_enum_get(op->ptr, "tool");
brush = ts->uvsculpt->paint.brush;
/* To update toolshelf */
- WM_event_add_notifier(C, NC_BRUSH|NA_EDITED, brush);
+ WM_event_add_notifier(C, NC_BRUSH | NA_EDITED, brush);
return OPERATOR_FINISHED;
}
@@ -384,10 +394,7 @@ void ED_operatortypes_paint(void)
WM_operatortype_append(BRUSH_OT_reset);
/* note, particle uses a different system, can be added with existing operators in wm.py */
- WM_operatortype_append(BRUSH_OT_sculpt_tool_set);
- WM_operatortype_append(BRUSH_OT_vertex_tool_set);
- WM_operatortype_append(BRUSH_OT_weight_tool_set);
- WM_operatortype_append(BRUSH_OT_image_tool_set);
+ WM_operatortype_append(PAINT_OT_brush_select);
WM_operatortype_append(BRUSH_OT_uv_sculpt_tool_set);
/* image */
@@ -426,6 +433,9 @@ void ED_operatortypes_paint(void)
WM_operatortype_append(PAINT_OT_face_select_inverse);
WM_operatortype_append(PAINT_OT_face_select_hide);
WM_operatortype_append(PAINT_OT_face_select_reveal);
+
+ /* partial visibility */
+ WM_operatortype_append(PAINT_OT_hide_show);
}
@@ -435,8 +445,8 @@ static void ed_keymap_paint_brush_switch(wmKeyMap *keymap, const char *mode)
int i;
/* index 0-9 (zero key is tenth), shift key for index 10-19 */
for (i = 0; i < 20; i++) {
- kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set",
- ZEROKEY + ((i + 1) % 10), KM_PRESS, i < 10 ? 0 : KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set",
+ ZEROKEY + ((i + 1) % 10), KM_PRESS, i < 10 ? 0 : KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "mode", mode);
RNA_int_set(kmi->ptr, "index", i);
}
@@ -446,11 +456,11 @@ static void ed_keymap_paint_brush_size(wmKeyMap *keymap, const char *UNUSED(path
{
wmKeyMapItem *kmi;
- kmi= WM_keymap_add_item(keymap, "BRUSH_OT_scale_size", LEFTBRACKETKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "BRUSH_OT_scale_size", LEFTBRACKETKEY, KM_PRESS, 0, 0);
RNA_float_set(kmi->ptr, "scalar", 0.9);
- kmi= WM_keymap_add_item(keymap, "BRUSH_OT_scale_size", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
- RNA_float_set(kmi->ptr, "scalar", 10.0/9.0); // 1.1111....
+ kmi = WM_keymap_add_item(keymap, "BRUSH_OT_scale_size", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
+ RNA_float_set(kmi->ptr, "scalar", 10.0 / 9.0); // 1.1111....
}
typedef enum {
@@ -460,7 +470,7 @@ typedef enum {
} RCFlags;
static void set_brush_rc_path(PointerRNA *ptr, const char *brush_path,
- const char *output_name, const char *input_name)
+ const char *output_name, const char *input_name)
{
char *path;
@@ -470,8 +480,8 @@ static void set_brush_rc_path(PointerRNA *ptr, const char *brush_path,
}
static void set_brush_rc_props(PointerRNA *ptr, const char *paint,
- const char *prop, const char *secondary_prop,
- RCFlags flags)
+ const char *prop, const char *secondary_prop,
+ RCFlags flags)
{
const char *ups_path = "tool_settings.unified_paint_settings";
char *brush_path;
@@ -479,7 +489,7 @@ static void set_brush_rc_props(PointerRNA *ptr, const char *paint,
brush_path = BLI_sprintfN("tool_settings.%s.brush", paint);
set_brush_rc_path(ptr, brush_path, "data_path_primary", prop);
- if(secondary_prop) {
+ if (secondary_prop) {
set_brush_rc_path(ptr, ups_path, "use_secondary", secondary_prop);
set_brush_rc_path(ptr, ups_path, "data_path_secondary", prop);
}
@@ -491,11 +501,11 @@ static void set_brush_rc_props(PointerRNA *ptr, const char *paint,
set_brush_rc_path(ptr, brush_path, "rotation_path", "texture_slot.angle");
RNA_string_set(ptr, "image_id", brush_path);
- if(flags & RC_COLOR)
+ if (flags & RC_COLOR)
set_brush_rc_path(ptr, brush_path, "fill_color_path", "color");
else
RNA_string_set(ptr, "fill_color_path", "");
- if(flags & RC_ZOOM)
+ if (flags & RC_ZOOM)
RNA_string_set(ptr, "zoom_path", "space_data.zoom");
else
RNA_string_set(ptr, "zoom_path", "");
@@ -504,7 +514,7 @@ static void set_brush_rc_props(PointerRNA *ptr, const char *paint,
}
static void ed_keymap_paint_brush_radial_control(wmKeyMap *keymap, const char *paint,
- RCFlags flags)
+ RCFlags flags)
{
wmKeyMapItem *kmi;
@@ -514,12 +524,28 @@ static void ed_keymap_paint_brush_radial_control(wmKeyMap *keymap, const char *p
kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0);
set_brush_rc_props(kmi->ptr, paint, "strength", "use_unified_strength", flags);
- if(flags & RC_ROTATION) {
+ if (flags & RC_ROTATION) {
kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, KM_CTRL, 0);
set_brush_rc_props(kmi->ptr, paint, "texture_slot.angle", NULL, flags);
}
}
+void paint_partial_visibility_keys(wmKeyMap *keymap)
+{
+ wmKeyMapItem *kmi;
+
+ /* Partial visiblity */
+ kmi = WM_keymap_add_item(keymap, "PAINT_OT_hide_show", HKEY, KM_PRESS, KM_SHIFT, 0);
+ RNA_enum_set(kmi->ptr, "action", PARTIALVIS_SHOW);
+ RNA_enum_set(kmi->ptr, "area", PARTIALVIS_INSIDE);
+ kmi = WM_keymap_add_item(keymap, "PAINT_OT_hide_show", HKEY, KM_PRESS, 0, 0);
+ RNA_enum_set(kmi->ptr, "action", PARTIALVIS_HIDE);
+ RNA_enum_set(kmi->ptr, "area", PARTIALVIS_INSIDE);
+ kmi = WM_keymap_add_item(keymap, "PAINT_OT_hide_show", HKEY, KM_PRESS, KM_ALT, 0);
+ RNA_enum_set(kmi->ptr, "action", PARTIALVIS_SHOW);
+ RNA_enum_set(kmi->ptr, "area", PARTIALVIS_ALL);
+}
+
void ED_keymap_paint(wmKeyConfig *keyconf)
{
wmKeyMap *keymap;
@@ -527,22 +553,25 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
int i;
/* Sculpt mode */
- keymap= WM_keymap_find(keyconf, "Sculpt", 0, 0);
- keymap->poll= sculpt_poll;
+ keymap = WM_keymap_find(keyconf, "Sculpt", 0, 0);
+ keymap->poll = sculpt_poll;
RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, 0, 0)->ptr, "mode", BRUSH_STROKE_NORMAL);
RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, KM_CTRL, 0)->ptr, "mode", BRUSH_STROKE_INVERT);
RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", BRUSH_STROKE_SMOOTH);
- for(i=0; i<=5; i++)
- RNA_int_set(WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", ZEROKEY+i, KM_PRESS, KM_CTRL, 0)->ptr, "level", i);
+ /* Partial visibility, sculpt-only for now */
+ paint_partial_visibility_keys(keymap);
+
+ for (i = 0; i <= 5; i++)
+ RNA_int_set(WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", ZEROKEY + i, KM_PRESS, KM_CTRL, 0)->ptr, "level", i);
/* multires switch */
- kmi= WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEUPKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEUPKEY, KM_PRESS, 0, 0);
RNA_int_set(kmi->ptr, "level", 1);
RNA_boolean_set(kmi->ptr, "relative", TRUE);
- kmi= WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEDOWNKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEDOWNKEY, KM_PRESS, 0, 0);
RNA_int_set(kmi->ptr, "level", -1);
RNA_boolean_set(kmi->ptr, "relative", TRUE);
@@ -550,15 +579,15 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
ed_keymap_paint_brush_size(keymap, "tool_settings.sculpt.brush.size");
ed_keymap_paint_brush_radial_control(keymap, "sculpt", RC_ROTATION);
- RNA_enum_set(WM_keymap_add_item(keymap, "BRUSH_OT_sculpt_tool_set", DKEY, KM_PRESS, 0, 0)->ptr, "tool", SCULPT_TOOL_DRAW);
- RNA_enum_set(WM_keymap_add_item(keymap, "BRUSH_OT_sculpt_tool_set", SKEY, KM_PRESS, 0, 0)->ptr, "tool", SCULPT_TOOL_SMOOTH);
- RNA_enum_set(WM_keymap_add_item(keymap, "BRUSH_OT_sculpt_tool_set", PKEY, KM_PRESS, 0, 0)->ptr, "tool", SCULPT_TOOL_PINCH);
- RNA_enum_set(WM_keymap_add_item(keymap, "BRUSH_OT_sculpt_tool_set", IKEY, KM_PRESS, 0, 0)->ptr, "tool", SCULPT_TOOL_INFLATE);
- RNA_enum_set(WM_keymap_add_item(keymap, "BRUSH_OT_sculpt_tool_set", GKEY, KM_PRESS, 0, 0)->ptr, "tool", SCULPT_TOOL_GRAB);
- RNA_enum_set(WM_keymap_add_item(keymap, "BRUSH_OT_sculpt_tool_set", LKEY, KM_PRESS, 0, 0)->ptr, "tool", SCULPT_TOOL_LAYER);
- RNA_enum_set(WM_keymap_add_item(keymap, "BRUSH_OT_sculpt_tool_set", TKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "tool", SCULPT_TOOL_FLATTEN); /* was just TKEY in 2.4x */
- RNA_enum_set(WM_keymap_add_item(keymap, "BRUSH_OT_sculpt_tool_set", CKEY, KM_PRESS, 0, 0)->ptr, "tool", SCULPT_TOOL_CLAY);
- RNA_enum_set(WM_keymap_add_item(keymap, "BRUSH_OT_sculpt_tool_set", CKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "tool", SCULPT_TOOL_CREASE);
+ keymap_brush_select(keymap, OB_MODE_SCULPT, SCULPT_TOOL_DRAW, DKEY, 0);
+ keymap_brush_select(keymap, OB_MODE_SCULPT, SCULPT_TOOL_SMOOTH, SKEY, 0);
+ keymap_brush_select(keymap, OB_MODE_SCULPT, SCULPT_TOOL_PINCH, PKEY, 0);
+ keymap_brush_select(keymap, OB_MODE_SCULPT, SCULPT_TOOL_INFLATE, IKEY, 0);
+ keymap_brush_select(keymap, OB_MODE_SCULPT, SCULPT_TOOL_GRAB, GKEY, 0);
+ keymap_brush_select(keymap, OB_MODE_SCULPT, SCULPT_TOOL_LAYER, LKEY, 0);
+ keymap_brush_select(keymap, OB_MODE_SCULPT, SCULPT_TOOL_FLATTEN, TKEY, KM_SHIFT);
+ keymap_brush_select(keymap, OB_MODE_SCULPT, SCULPT_TOOL_CLAY, CKEY, 0);
+ keymap_brush_select(keymap, OB_MODE_SCULPT, SCULPT_TOOL_CREASE, CKEY, KM_SHIFT);
/* */
kmi = WM_keymap_add_item(keymap, "WM_OT_context_menu_enum", AKEY, KM_PRESS, 0, 0);
@@ -571,14 +600,14 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.brush.texture_angle_source_random");
/* Vertex Paint mode */
- keymap= WM_keymap_find(keyconf, "Vertex Paint", 0, 0);
- keymap->poll= vertex_paint_mode_poll;
+ keymap = WM_keymap_find(keyconf, "Vertex Paint", 0, 0);
+ keymap->poll = vertex_paint_mode_poll;
WM_keymap_verify_item(keymap, "PAINT_OT_vertex_paint", LEFTMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "PAINT_OT_sample_color", RIGHTMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap,
- "PAINT_OT_vertex_color_set",KKEY, KM_PRESS, KM_SHIFT, 0);
+ "PAINT_OT_vertex_color_set", KKEY, KM_PRESS, KM_SHIFT, 0);
ed_keymap_paint_brush_switch(keymap, "vertex_paint");
ed_keymap_paint_brush_size(keymap, "tool_settings.vertex_paint.brush.size");
@@ -588,8 +617,8 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
RNA_string_set(kmi->ptr, "data_path", "vertex_paint_object.data.use_paint_mask");
/* Weight Paint mode */
- keymap= WM_keymap_find(keyconf, "Weight Paint", 0, 0);
- keymap->poll= weight_paint_mode_poll;
+ keymap = WM_keymap_find(keyconf, "Weight Paint", 0, 0);
+ keymap->poll = weight_paint_mode_poll;
WM_keymap_verify_item(keymap, "PAINT_OT_weight_paint", LEFTMOUSE, KM_PRESS, 0, 0);
@@ -598,7 +627,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
WM_keymap_verify_item(keymap, "PAINT_OT_weight_sample_group", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap,
- "PAINT_OT_weight_set", KKEY, KM_PRESS, KM_SHIFT, 0);
+ "PAINT_OT_weight_set", KKEY, KM_PRESS, KM_SHIFT, 0);
ed_keymap_paint_brush_switch(keymap, "weight_paint");
ed_keymap_paint_brush_size(keymap, "tool_settings.weight_paint.brush.size");
@@ -615,20 +644,20 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
/*Weight paint's Vertex Selection Mode */
- keymap= WM_keymap_find(keyconf, "Weight Paint Vertex Selection", 0, 0);
- keymap->poll= vert_paint_poll;
+ keymap = WM_keymap_find(keyconf, "Weight Paint Vertex Selection", 0, 0);
+ keymap->poll = vert_paint_poll;
WM_keymap_add_item(keymap, "PAINT_OT_vert_select_all", AKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "PAINT_OT_vert_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "VIEW3D_OT_select_border", BKEY, KM_PRESS, 0, 0);
kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "deselect", FALSE);
- kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT|KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT | KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "deselect", TRUE);
WM_keymap_add_item(keymap, "VIEW3D_OT_select_circle", CKEY, KM_PRESS, 0, 0);
/* Image/Texture Paint mode */
- keymap= WM_keymap_find(keyconf, "Image Paint", 0, 0);
- keymap->poll= image_texture_paint_poll;
+ keymap = WM_keymap_find(keyconf, "Image Paint", 0, 0);
+ keymap->poll = image_texture_paint_poll;
WM_keymap_add_item(keymap, "PAINT_OT_image_paint", LEFTMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "PAINT_OT_grab_clone", RIGHTMOUSE, KM_PRESS, 0, 0);
@@ -637,14 +666,14 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
ed_keymap_paint_brush_switch(keymap, "image_paint");
ed_keymap_paint_brush_size(keymap, "tool_settings.image_paint.brush.size");
- ed_keymap_paint_brush_radial_control(keymap, "image_paint", RC_COLOR|RC_ZOOM);
+ ed_keymap_paint_brush_radial_control(keymap, "image_paint", RC_COLOR | RC_ZOOM);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); /* mask toggle */
RNA_string_set(kmi->ptr, "data_path", "image_paint_object.data.use_paint_mask");
/* face-mask mode */
- keymap= WM_keymap_find(keyconf, "Face Mask", 0, 0);
- keymap->poll= facemask_paint_poll;
+ keymap = WM_keymap_find(keyconf, "Face Mask", 0, 0);
+ keymap->poll = facemask_paint_poll;
WM_keymap_add_item(keymap, "PAINT_OT_face_select_all", AKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "PAINT_OT_face_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
@@ -657,8 +686,8 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked_pick", LKEY, KM_PRESS, 0, 0);
- keymap= WM_keymap_find(keyconf, "UV Sculpt", 0, 0);
- keymap->poll= uv_sculpt_poll;
+ keymap = WM_keymap_find(keyconf, "UV Sculpt", 0, 0);
+ keymap->poll = uv_sculpt_poll;
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", QKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_uv_sculpt");
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index cd8262f06bd..fb640346a99 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;
@@ -95,10 +95,10 @@ static void paint_draw_smooth_stroke(bContext *C, int x, int y, void *customdata
glEnable(GL_LINE_SMOOTH);
glEnable(GL_BLEND);
- if(stroke && brush && (brush->flag & BRUSH_SMOOTH_STROKE)) {
+ if (stroke && brush && (brush->flag & BRUSH_SMOOTH_STROKE)) {
ARegion *ar = CTX_wm_region(C);
sdrawline(x, y, (int)stroke->last_mouse_position[0] - ar->winrct.xmin,
- (int)stroke->last_mouse_position[1] - ar->winrct.ymin);
+ (int)stroke->last_mouse_position[1] - ar->winrct.ymin);
}
glDisable(GL_BLEND);
@@ -106,20 +106,20 @@ 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;
float pressure = 1;
- if(event->custom == EVT_DATA_TABLET) {
- wmTabletData *wmtab= event->customdata;
+ if (event->custom == EVT_DATA_TABLET) {
+ wmTabletData *wmtab = event->customdata;
erasor = (wmtab->Active == EVT_TABLET_ERASER);
pressure = (wmtab->Active != EVT_TABLET_NONE) ? wmtab->Pressure : 1;
}
- if(pen_flip)
+ if (pen_flip)
(*pen_flip) = erasor;
return pressure;
@@ -142,16 +142,16 @@ 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 */
- if(stroke->vc.obact->sculpt) {
+ * 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 */
- if(brush->flag & BRUSH_JITTER_PRESSURE) {
+ * 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);
add_v2_v2v2(mouse, mouse_in, delta);
@@ -162,7 +162,7 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *ev
}
/* TODO: can remove the if statement once all modes have this */
- if(stroke->get_location)
+ if (stroke->get_location)
stroke->get_location(C, location, mouse);
else
zero_v3(location);
@@ -196,8 +196,8 @@ 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. */
- if(dx*dx + dy*dy < stroke->brush->smooth_stroke_radius * stroke->brush->smooth_stroke_radius)
+ * 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;
output[0] = event->x * v + stroke->last_mouse_position[0] * u;
@@ -208,13 +208,13 @@ 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;
int cnt = 0;
- if(paint_space_stroke_enabled(stroke->brush)) {
+ if (paint_space_stroke_enabled(stroke->brush)) {
float mouse[2];
float vec[2];
float length, scale;
@@ -224,24 +224,24 @@ static int paint_space_stroke(bContext *C, wmOperator *op, wmEvent *event, const
length = len_v2(vec);
- if(length > FLT_EPSILON) {
+ if (length > FLT_EPSILON) {
const Scene *scene = CTX_data_scene(C);
int steps;
int i;
- float pressure= 1.0f;
+ float pressure = 1.0f;
/* XXX mysterious :) what has 'use size' do with this here... if you don't check for it, pressure fails */
- if(brush_use_size_pressure(scene, stroke->brush))
+ if (brush_use_size_pressure(scene, stroke->brush))
pressure = event_tablet_data(event, NULL);
- if(pressure > FLT_EPSILON) {
- scale = (brush_size(scene, stroke->brush)*pressure*stroke->brush->spacing/50.0f) / length;
- if(scale > FLT_EPSILON) {
+ if (pressure > FLT_EPSILON) {
+ scale = (brush_size(scene, stroke->brush) * pressure * stroke->brush->spacing / 50.0f) / length;
+ if (scale > FLT_EPSILON) {
mul_v2_fl(vec, scale);
steps = (int)(1.0f / scale);
- for(i = 0; i < steps; ++i, ++cnt) {
+ for (i = 0; i < steps; ++i, ++cnt) {
add_v2_v2(mouse, vec);
paint_brush_stroke_add_step(C, op, event, mouse);
}
@@ -256,10 +256,10 @@ static int paint_space_stroke(bContext *C, wmOperator *op, wmEvent *event, const
/**** Public API ****/
PaintStroke *paint_stroke_new(bContext *C,
- StrokeGetLocation get_location,
- StrokeTestStart test_start,
- StrokeUpdateStep update_step,
- StrokeDone done, int event_type)
+ StrokeGetLocation get_location,
+ StrokeTestStart test_start,
+ StrokeUpdateStep update_step,
+ StrokeDone done, int event_type)
{
PaintStroke *stroke = MEM_callocN(sizeof(PaintStroke), "PaintStroke");
@@ -271,7 +271,7 @@ PaintStroke *paint_stroke_new(bContext *C,
stroke->test_start = test_start;
stroke->update_step = update_step;
stroke->done = done;
- stroke->event_type= event_type; /* for modal, return event */
+ stroke->event_type = event_type; /* for modal, return event */
return stroke;
}
@@ -293,7 +293,7 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
{
PaintStroke *stroke = op->customdata;
float mouse[2];
- int first= 0;
+ int first = 0;
// let NDOF motion pass through to the 3D view so we can paint and rotate simultaneously!
// this isn't perfect... even when an extra MOUSEMOVE is spoofed, the stroke discards it
@@ -302,43 +302,43 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
if (event->type == NDOF_MOTION)
return OPERATOR_PASS_THROUGH;
- if(!stroke->stroke_started) {
+ if (!stroke->stroke_started) {
stroke->last_mouse_position[0] = event->x;
stroke->last_mouse_position[1] = event->y;
stroke->stroke_started = stroke->test_start(C, op, event);
- if(stroke->stroke_started) {
+ if (stroke->stroke_started) {
stroke->smooth_stroke_cursor =
- WM_paint_cursor_activate(CTX_wm_manager(C), paint_poll, paint_draw_smooth_stroke, stroke);
+ WM_paint_cursor_activate(CTX_wm_manager(C), paint_poll, paint_draw_smooth_stroke, stroke);
- if(stroke->brush->flag & BRUSH_AIRBRUSH)
+ if (stroke->brush->flag & BRUSH_AIRBRUSH)
stroke->timer = WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, stroke->brush->rate);
}
- first= 1;
+ first = 1;
//ED_region_tag_redraw(ar);
}
- if(event->type == stroke->event_type && event->val == KM_RELEASE) {
+ if (event->type == stroke->event_type && event->val == KM_RELEASE) {
/* exit stroke, free data */
- if(stroke->smooth_stroke_cursor)
+ if (stroke->smooth_stroke_cursor)
WM_paint_cursor_end(CTX_wm_manager(C), stroke->smooth_stroke_cursor);
- if(stroke->timer)
+ if (stroke->timer)
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), stroke->timer);
stroke->done(C, stroke);
MEM_freeN(stroke);
return OPERATOR_FINISHED;
}
- else if( (first) ||
+ else if ((first) ||
(ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) ||
(event->type == TIMER && (event->customdata == stroke->timer)) )
{
- if(stroke->stroke_started) {
- if(paint_smooth_stroke(stroke, mouse, event)) {
- if(paint_space_stroke_enabled(stroke->brush)) {
- if(!paint_space_stroke(C, op, event, mouse)) {
+ if (stroke->stroke_started) {
+ if (paint_smooth_stroke(stroke, mouse, event)) {
+ if (paint_space_stroke_enabled(stroke->brush)) {
+ if (!paint_space_stroke(C, op, event, mouse)) {
//ED_region_tag_redraw(ar);
}
}
@@ -347,18 +347,18 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
}
}
else {
- ;//ED_region_tag_redraw(ar);
+ ; //ED_region_tag_redraw(ar);
}
}
}
/* we want the stroke to have the first daub at the start location
* instead of waiting till we have moved the space distance */
- if(first &&
- stroke->stroke_started &&
- paint_space_stroke_enabled(stroke->brush) &&
- !(stroke->brush->flag & BRUSH_ANCHORED) &&
- !(stroke->brush->flag & BRUSH_SMOOTH_STROKE))
+ if (first &&
+ stroke->stroke_started &&
+ paint_space_stroke_enabled(stroke->brush) &&
+ !(stroke->brush->flag & BRUSH_ANCHORED) &&
+ !(stroke->brush->flag & BRUSH_SMOOTH_STROKE))
{
paint_brush_stroke_add_step(C, op, event, mouse);
}
@@ -371,10 +371,10 @@ int paint_stroke_exec(bContext *C, wmOperator *op)
PaintStroke *stroke = op->customdata;
/* only when executed for the first time */
- if(stroke->stroke_started == 0) {
+ if (stroke->stroke_started == 0) {
/* XXX stroke->last_mouse_position is unset, this may cause problems */
stroke->test_start(C, op, NULL);
- stroke->stroke_started= 1;
+ stroke->stroke_started = 1;
}
RNA_BEGIN(op->ptr, itemptr, "stroke") {
@@ -394,7 +394,7 @@ int paint_stroke_cancel(bContext *C, wmOperator *op)
{
PaintStroke *stroke = op->customdata;
- if(stroke->done)
+ if (stroke->done)
stroke->done(C, stroke);
MEM_freeN(stroke);
@@ -424,6 +424,6 @@ int paint_poll(bContext *C)
Object *ob = CTX_data_active_object(C);
return p && ob && paint_brush(p) &&
- CTX_wm_area(C)->spacetype == SPACE_VIEW3D &&
- CTX_wm_region(C)->regiontype == RGN_TYPE_WINDOW;
+ CTX_wm_area(C)->spacetype == SPACE_VIEW3D &&
+ CTX_wm_region(C)->regiontype == RGN_TYPE_WINDOW;
}
diff --git a/source/blender/editors/sculpt_paint/paint_undo.c b/source/blender/editors/sculpt_paint/paint_undo.c
index b00910195ff..65bcfcb7024 100644
--- a/source/blender/editors/sculpt_paint/paint_undo.c
+++ b/source/blender/editors/sculpt_paint/paint_undo.c
@@ -45,7 +45,7 @@
#include "paint_intern.h"
-#define MAXUNDONAME 64
+#define MAXUNDONAME 64
typedef struct UndoElem {
struct UndoElem *next, *prev;
@@ -71,13 +71,13 @@ static UndoStack MeshUndoStack = {UNDO_PAINT_MESH, {NULL, NULL}, NULL};
static void undo_restore(bContext *C, UndoStack *UNUSED(stack), UndoElem *uel)
{
- if(uel && uel->restore)
+ if (uel && uel->restore)
uel->restore(C, &uel->elems);
}
static void undo_elem_free(UndoStack *UNUSED(stack), UndoElem *uel)
{
- if(uel && uel->free) {
+ if (uel && uel->free) {
uel->free(&uel->elems);
BLI_freelistN(&uel->elems);
}
@@ -93,32 +93,32 @@ static void undo_stack_push_begin(UndoStack *stack, const char *name, UndoRestor
* know how much memory the undo used to remove old undo elements */
/* remove all undos after (also when stack->current==NULL) */
- while(stack->elems.last != stack->current) {
- uel= stack->elems.last;
+ while (stack->elems.last != stack->current) {
+ uel = stack->elems.last;
undo_elem_free(stack, uel);
BLI_freelinkN(&stack->elems, uel);
}
/* make new */
- stack->current= uel= MEM_callocN(sizeof(UndoElem), "undo file");
- uel->restore= restore;
- uel->free= free;
+ stack->current = uel = MEM_callocN(sizeof(UndoElem), "undo file");
+ uel->restore = restore;
+ uel->free = free;
BLI_addtail(&stack->elems, uel);
/* name can be a dynamic string */
BLI_strncpy(uel->name, name, sizeof(uel->name));
/* limit amount to the maximum amount*/
- nr= 0;
- uel= stack->elems.last;
- while(uel) {
+ nr = 0;
+ uel = stack->elems.last;
+ while (uel) {
nr++;
- if(nr==U.undosteps) break;
- uel= uel->prev;
+ if (nr == U.undosteps) break;
+ uel = uel->prev;
}
- if(uel) {
- while(stack->elems.first!=uel) {
- UndoElem *first= stack->elems.first;
+ if (uel) {
+ while (stack->elems.first != uel) {
+ UndoElem *first = stack->elems.first;
undo_elem_free(stack, first);
BLI_freelinkN(&stack->elems, first);
}
@@ -130,21 +130,21 @@ static void undo_stack_push_end(UndoStack *stack)
UndoElem *uel;
uintptr_t totmem, maxmem;
- if(U.undomemory != 0) {
+ if (U.undomemory != 0) {
/* limit to maximum memory (afterwards, we can't know in advance) */
- totmem= 0;
- maxmem= ((uintptr_t)U.undomemory)*1024*1024;
-
- uel= stack->elems.last;
- while(uel) {
- totmem+= uel->undosize;
- if(totmem>maxmem) break;
- uel= uel->prev;
+ totmem = 0;
+ maxmem = ((uintptr_t)U.undomemory) * 1024 * 1024;
+
+ uel = stack->elems.last;
+ while (uel) {
+ totmem += uel->undosize;
+ if (totmem > maxmem) break;
+ uel = uel->prev;
}
- if(uel) {
- while(stack->elems.first!=uel) {
- UndoElem *first= stack->elems.first;
+ if (uel) {
+ while (stack->elems.first != uel) {
+ UndoElem *first = stack->elems.first;
undo_elem_free(stack, first);
BLI_freelinkN(&stack->elems, first);
}
@@ -156,25 +156,29 @@ static int undo_stack_step(bContext *C, UndoStack *stack, int step, const char *
{
UndoElem *undo;
- if(step==1) {
- if(stack->current==NULL);
+ if (step == 1) {
+ if (stack->current == NULL) ;
else {
- if(!name || strcmp(stack->current->name, name) == 0) {
- if(G.f & G_DEBUG) printf("undo %s\n", stack->current->name);
+ if (!name || strcmp(stack->current->name, name) == 0) {
+ if (G.debug & G_DEBUG_WM) {
+ printf("%s: undo '%s'\n", __func__, stack->current->name);
+ }
undo_restore(C, stack, stack->current);
- stack->current= stack->current->prev;
+ stack->current = stack->current->prev;
return 1;
}
}
}
- else if(step==-1) {
- if((stack->current!=NULL && stack->current->next==NULL) || stack->elems.first==NULL);
+ else if (step == -1) {
+ if ((stack->current != NULL && stack->current->next == NULL) || stack->elems.first == NULL) ;
else {
- if(!name || strcmp(stack->current->name, name) == 0) {
- undo= (stack->current && stack->current->next)? stack->current->next: stack->elems.first;
+ if (!name || strcmp(stack->current->name, name) == 0) {
+ undo = (stack->current && stack->current->next) ? stack->current->next : stack->elems.first;
undo_restore(C, stack, undo);
- stack->current= undo;
- if(G.f & G_DEBUG) printf("redo %s\n", undo->name);
+ stack->current = undo;
+ if (G.debug & G_DEBUG_WM) {
+ printf("%s: redo %s\n", __func__, undo->name);
+ }
return 1;
}
}
@@ -187,31 +191,31 @@ static void undo_stack_free(UndoStack *stack)
{
UndoElem *uel;
- for(uel=stack->elems.first; uel; uel=uel->next)
+ for (uel = stack->elems.first; uel; uel = uel->next)
undo_elem_free(stack, uel);
BLI_freelistN(&stack->elems);
- stack->current= NULL;
+ stack->current = NULL;
}
/* Exported Functions */
void undo_paint_push_begin(int type, const char *name, UndoRestoreCb restore, UndoFreeCb free)
{
- if(type == UNDO_PAINT_IMAGE)
+ if (type == UNDO_PAINT_IMAGE)
undo_stack_push_begin(&ImageUndoStack, name, restore, free);
- else if(type == UNDO_PAINT_MESH)
+ else if (type == UNDO_PAINT_MESH)
undo_stack_push_begin(&MeshUndoStack, name, restore, free);
}
ListBase *undo_paint_push_get_list(int type)
{
- if(type == UNDO_PAINT_IMAGE) {
- if(ImageUndoStack.current)
+ if (type == UNDO_PAINT_IMAGE) {
+ if (ImageUndoStack.current)
return &ImageUndoStack.current->elems;
}
- else if(type == UNDO_PAINT_MESH) {
- if(MeshUndoStack.current)
+ else if (type == UNDO_PAINT_MESH) {
+ if (MeshUndoStack.current)
return &MeshUndoStack.current->elems;
}
@@ -220,25 +224,25 @@ ListBase *undo_paint_push_get_list(int type)
void undo_paint_push_count_alloc(int type, int size)
{
- if(type == UNDO_PAINT_IMAGE)
+ if (type == UNDO_PAINT_IMAGE)
ImageUndoStack.current->undosize += size;
- else if(type == UNDO_PAINT_MESH)
+ else if (type == UNDO_PAINT_MESH)
MeshUndoStack.current->undosize += size;
}
void undo_paint_push_end(int type)
{
- if(type == UNDO_PAINT_IMAGE)
+ if (type == UNDO_PAINT_IMAGE)
undo_stack_push_end(&ImageUndoStack);
- else if(type == UNDO_PAINT_MESH)
+ else if (type == UNDO_PAINT_MESH)
undo_stack_push_end(&MeshUndoStack);
}
int ED_undo_paint_step(bContext *C, int type, int step, const char *name)
{
- if(type == UNDO_PAINT_IMAGE)
+ if (type == UNDO_PAINT_IMAGE)
return undo_stack_step(C, &ImageUndoStack, step, name);
- else if(type == UNDO_PAINT_MESH)
+ else if (type == UNDO_PAINT_MESH)
return undo_stack_step(C, &MeshUndoStack, step, name);
return 0;
@@ -248,16 +252,16 @@ int ED_undo_paint_valid(int type, const char *name)
{
UndoStack *stack;
- if(type == UNDO_PAINT_IMAGE)
- stack= &ImageUndoStack;
- else if(type == UNDO_PAINT_MESH)
- stack= &MeshUndoStack;
+ if (type == UNDO_PAINT_IMAGE)
+ stack = &ImageUndoStack;
+ else if (type == UNDO_PAINT_MESH)
+ stack = &MeshUndoStack;
else
return 0;
- if(stack->current==NULL);
+ if (stack->current == NULL) ;
else {
- if(name && strcmp(stack->current->name, name) == 0)
+ if (name && strcmp(stack->current->name, name) == 0)
return 1;
else
return stack->elems.first != stack->elems.last;
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index 0d9c0f2e38e..6a31e96b51b 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -68,14 +68,14 @@
#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],
- const ARegion *ar,
- RegionView3D *rv3d,
- Object *ob)
+ const float bb_min[3],
+ const float bb_max[3],
+ const ARegion *ar,
+ RegionView3D *rv3d,
+ Object *ob)
{
float projection_mat[4][4];
int i, j, k;
@@ -84,21 +84,20 @@ int paint_convert_bb_to_rect(rcti *rect,
rect->xmax = rect->ymax = INT_MIN;
/* return zero if the bounding box has non-positive volume */
- if(bb_min[0] > bb_max[0] || bb_min[1] > bb_max[1] || bb_min[2] > bb_max[2])
+ if (bb_min[0] > bb_max[0] || bb_min[1] > bb_max[1] || bb_min[2] > bb_max[2])
return 0;
ED_view3d_ob_project_mat_get(rv3d, ob, projection_mat);
- for(i = 0; i < 2; ++i) {
- for(j = 0; j < 2; ++j) {
- for(k = 0; k < 2; ++k) {
+ for (i = 0; i < 2; ++i) {
+ for (j = 0; j < 2; ++j) {
+ for (k = 0; k < 2; ++k) {
float vec[3], proj[2];
vec[0] = i ? bb_min[0] : bb_max[0];
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,13 +112,13 @@ 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,
- Object *ob,
- const rcti *screen_rect)
+ const ARegion *ar,
+ RegionView3D *rv3d,
+ Object *ob,
+ const rcti *screen_rect)
{
BoundBox bb;
bglMats mats;
@@ -141,19 +140,19 @@ 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;
- gluProject(v[0],v[1],v[2], mats->modelview, mats->projection,
- (GLint *)mats->viewport, &ux, &uy, &uz);
- p[0]= ux;
- p[1]= uy;
+ gluProject(v[0], v[1], v[2], mats->modelview, mats->projection,
+ (GLint *)mats->viewport, &ux, &uy, &uz);
+ p[0] = ux;
+ p[1] = uy;
}
float paint_calc_object_space_radius(ViewContext *vc, const float center[3],
- float pixel_radius)
+ float pixel_radius)
{
Object *ob = vc->obact;
float delta[3], scale, loc[3];
@@ -163,17 +162,17 @@ float paint_calc_object_space_radius(ViewContext *vc, const float center[3],
initgrabz(vc->rv3d, loc[0], loc[1], loc[2]);
- mval_f[0]= pixel_radius;
- mval_f[1]= 0.0f;
+ mval_f[0] = pixel_radius;
+ mval_f[1] = 0.0f;
ED_view3d_win_to_delta(vc->ar, mval_f, delta);
- scale= fabsf(mat4_to_scale(ob->obmat));
- scale= (scale == 0.0f)? 1.0f: scale;
+ scale = fabsf(mat4_to_scale(ob->obmat));
+ scale = (scale == 0.0f) ? 1.0f : scale;
- return len_v3(delta)/scale;
+ return len_v3(delta) / scale;
}
-float paint_get_tex_pixel(Brush* br, float u, float v)
+float paint_get_tex_pixel(Brush *br, float u, float v)
{
TexResult texres;
float co[3];
@@ -187,7 +186,7 @@ float paint_get_tex_pixel(Brush* br, float u, float v)
hasrgb = multitex_ext(br->mtex.tex, co, NULL, NULL, 0, &texres);
if (hasrgb & TEX_RGB)
- texres.tin = (0.35f*texres.tr + 0.45f*texres.tg + 0.2f*texres.tb)*texres.ta;
+ texres.tin = (0.35f * texres.tr + 0.45f * texres.tg + 0.2f * texres.tb) * texres.ta;
return texres.tin;
}
@@ -197,7 +196,7 @@ float paint_get_tex_pixel(Brush* br, float u, float v)
static void imapaint_project(Object *ob, float model[][4], float proj[][4], const float co[3], float pco[4])
{
copy_v3_v3(pco, co);
- pco[3]= 1.0f;
+ pco[3] = 1.0f;
mul_m4_v3(ob->obmat, pco);
mul_m4_v3(model, pco);
@@ -226,16 +225,16 @@ static void imapaint_tri_weights(Object *ob,
imapaint_project(ob, model, proj, v3, pv3);
/* do inverse view mapping, see gluProject man page */
- h[0]= (co[0] - view[0])*2.0f/view[2] - 1;
- h[1]= (co[1] - view[1])*2.0f/view[3] - 1;
- h[2]= 1.0f;
+ h[0] = (co[0] - view[0]) * 2.0f / view[2] - 1;
+ h[1] = (co[1] - view[1]) * 2.0f / view[3] - 1;
+ h[2] = 1.0f;
- /* solve for(w1,w2,w3)/perspdiv in:
- h*perspdiv = Project*Model*(w1*v1 + w2*v2 + w3*v3) */
+ /* solve for (w1,w2,w3)/perspdiv in:
+ * 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];
- wmat[0][2]= pv1[3]; wmat[1][2]= pv2[3]; wmat[2][2]= pv3[3];
+ 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];
+ wmat[0][2] = pv1[3]; wmat[1][2] = pv2[3]; wmat[2][2] = pv3[3];
invert_m3_m3(invwmat, wmat);
mul_m3_v3(invwmat, h);
@@ -243,9 +242,9 @@ static void imapaint_tri_weights(Object *ob,
copy_v3_v3(w, h);
/* w is still divided by perspdiv, make it sum to one */
- divw= w[0] + w[1] + w[2];
- if(divw != 0.0f) {
- mul_v3_fl(w, 1.0f/divw);
+ divw = w[0] + w[1] + w[2];
+ if (divw != 0.0f) {
+ mul_v3_fl(w, 1.0f / divw);
}
}
@@ -264,48 +263,48 @@ void imapaint_pick_uv(Scene *scene, Object *ob, unsigned int faceindex, const in
uv[0] = uv[1] = 0.0;
/* test all faces in the derivedmesh with the original index of the picked face */
- for(a = 0; a < numfaces; a++) {
- findex= index ? index[a]: a;
+ for (a = 0; a < numfaces; a++) {
+ findex = index ? index[a] : a;
- if(findex == faceindex) {
+ if (findex == faceindex) {
dm->getTessFace(dm, a, &mf);
dm->getVert(dm, mf.v1, &mv[0]);
dm->getVert(dm, mf.v2, &mv[1]);
dm->getVert(dm, mf.v3, &mv[2]);
- if(mf.v4)
+ if (mf.v4)
dm->getVert(dm, mf.v4, &mv[3]);
- tf= &tface[a];
+ tf = &tface[a];
- p[0]= xy[0];
- p[1]= xy[1];
+ p[0] = xy[0];
+ p[1] = xy[1];
- if(mf.v4) {
+ 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) {
- uv[0]= tf->uv[0][0]*w[0] + tf->uv[1][0]*w[1] + tf->uv[3][0]*w[2];
- uv[1]= tf->uv[0][1]*w[0] + tf->uv[1][1]*w[1] + tf->uv[3][1]*w[2];
+ absw = fabs(w[0]) + fabs(w[1]) + fabs(w[2]);
+ if (absw < minabsw) {
+ uv[0] = tf->uv[0][0] * w[0] + tf->uv[1][0] * w[1] + tf->uv[3][0] * w[2];
+ uv[1] = tf->uv[0][1] * w[0] + tf->uv[1][1] * w[1] + tf->uv[3][1] * w[2];
minabsw = absw;
}
imapaint_tri_weights(ob, mv[1].co, mv[2].co, mv[3].co, p, w);
- absw= fabs(w[0]) + fabs(w[1]) + fabs(w[2]);
- if(absw < minabsw) {
- uv[0]= tf->uv[1][0]*w[0] + tf->uv[2][0]*w[1] + tf->uv[3][0]*w[2];
- uv[1]= tf->uv[1][1]*w[0] + tf->uv[2][1]*w[1] + tf->uv[3][1]*w[2];
+ absw = fabs(w[0]) + fabs(w[1]) + fabs(w[2]);
+ if (absw < minabsw) {
+ uv[0] = tf->uv[1][0] * w[0] + tf->uv[2][0] * w[1] + tf->uv[3][0] * w[2];
+ uv[1] = tf->uv[1][1] * w[0] + tf->uv[2][1] * w[1] + tf->uv[3][1] * w[2];
minabsw = absw;
}
}
else {
imapaint_tri_weights(ob, mv[0].co, mv[1].co, mv[2].co, p, w);
- absw= fabs(w[0]) + fabs(w[1]) + fabs(w[2]);
- if(absw < minabsw) {
- uv[0]= tf->uv[0][0]*w[0] + tf->uv[1][0]*w[1] + tf->uv[2][0]*w[2];
- uv[1]= tf->uv[0][1]*w[0] + tf->uv[1][1]*w[1] + tf->uv[2][1]*w[2];
+ absw = fabs(w[0]) + fabs(w[1]) + fabs(w[2]);
+ if (absw < minabsw) {
+ uv[0] = tf->uv[0][0] * w[0] + tf->uv[1][0] * w[1] + tf->uv[2][0] * w[2];
+ uv[1] = tf->uv[0][1] * w[0] + tf->uv[1][1] * w[1] + tf->uv[2][1] * w[2];
minabsw = absw;
}
}
@@ -315,17 +314,18 @@ void imapaint_pick_uv(Scene *scene, Object *ob, unsigned int faceindex, const in
dm->release(dm);
}
-///* returns 0 if not found, otherwise 1 */
-int imapaint_pick_face(ViewContext *vc, Mesh *me, const int mval[2], unsigned int *index)
+/* returns 0 if not found, otherwise 1 */
+int imapaint_pick_face(ViewContext *vc, const int mval[2], unsigned int *index, unsigned int totface)
{
- if(!me || me->totface==0)
+ if (totface == 0)
return 0;
/* sample only on the exact position */
*index = view3d_sample_backbuf(vc, mval[0], mval[1]);
- if((*index)<=0 || (*index)>(unsigned int)me->totface)
+ if ((*index) <= 0 || (*index) > (unsigned int)totface) {
return 0;
+ }
(*index)--;
@@ -333,7 +333,7 @@ int imapaint_pick_face(ViewContext *vc, Mesh *me, const int mval[2], unsigned in
}
/* used for both 3d view and image window */
-void paint_sample_color(Scene *scene, ARegion *ar, int x, int y) /* frontbuf */
+void paint_sample_color(Scene *scene, ARegion *ar, int x, int y) /* frontbuf */
{
Brush *br = paint_brush(paint_get_active(scene));
unsigned int col;
@@ -343,15 +343,15 @@ void paint_sample_color(Scene *scene, ARegion *ar, int x, int y) /* frontbuf */
CLAMP(y, 0, ar->winy);
glReadBuffer(GL_FRONT);
- glReadPixels(x+ar->winrct.xmin, y+ar->winrct.ymin, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col);
+ glReadPixels(x + ar->winrct.xmin, y + ar->winrct.ymin, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col);
glReadBuffer(GL_BACK);
cp = (char *)&col;
- if(br) {
- br->rgb[0]= cp[0]/255.0f;
- br->rgb[1]= cp[1]/255.0f;
- br->rgb[2]= cp[2]/255.0f;
+ if (br) {
+ br->rgb[0] = cp[0] / 255.0f;
+ br->rgb[1] = cp[1] / 255.0f;
+ br->rgb[2] = cp[2] / 255.0f;
}
}
@@ -381,14 +381,14 @@ void BRUSH_OT_curve_preset(wmOperatorType *ot)
{CURVE_PRESET_ROOT, "ROOT", 0, "Root", ""},
{0, NULL, 0, NULL, NULL}};
- ot->name= "Preset";
- ot->description= "Set brush shape";
- ot->idname= "BRUSH_OT_curve_preset";
+ ot->name = "Preset";
+ ot->description = "Set brush shape";
+ ot->idname = "BRUSH_OT_curve_preset";
- ot->exec= brush_curve_preset_exec;
- ot->poll= brush_curve_preset_poll;
+ ot->exec = brush_curve_preset_exec;
+ ot->poll = brush_curve_preset_poll;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_enum(ot->srna, "shape", prop_shape_items, CURVE_PRESET_SMOOTH, "Mode", "");
}
@@ -404,19 +404,19 @@ static int paint_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
void PAINT_OT_face_select_linked(wmOperatorType *ot)
{
- ot->name= "Select Linked";
- ot->description= "Select linked faces";
- ot->idname= "PAINT_OT_face_select_linked";
+ ot->name = "Select Linked";
+ ot->description = "Select linked faces";
+ ot->idname = "PAINT_OT_face_select_linked";
- ot->exec= paint_select_linked_exec;
- ot->poll= facemask_paint_poll;
+ ot->exec = paint_select_linked_exec;
+ ot->poll = facemask_paint_poll;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int paint_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- int mode= RNA_boolean_get(op->ptr, "extend") ? 1:0;
+ int mode = RNA_boolean_get(op->ptr, "extend") ? 1 : 0;
paintface_select_linked(C, CTX_data_active_object(C), event->mval, mode);
ED_region_tag_redraw(CTX_wm_region(C));
return OPERATOR_FINISHED;
@@ -424,14 +424,14 @@ static int paint_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent
void PAINT_OT_face_select_linked_pick(wmOperatorType *ot)
{
- ot->name= "Select Linked Pick";
- ot->description= "Select linked faces";
- ot->idname= "PAINT_OT_face_select_linked_pick";
+ ot->name = "Select Linked Pick";
+ ot->description = "Select linked faces";
+ ot->idname = "PAINT_OT_face_select_linked_pick";
- ot->invoke= paint_select_linked_pick_invoke;
- ot->poll= facemask_paint_poll;
+ ot->invoke = paint_select_linked_pick_invoke;
+ ot->poll = facemask_paint_poll;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the existing selection");
}
@@ -439,7 +439,7 @@ void PAINT_OT_face_select_linked_pick(wmOperatorType *ot)
static int face_select_all_exec(bContext *C, wmOperator *op)
{
- Object *ob= CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
paintface_deselect_all_visible(ob, RNA_enum_get(op->ptr, "action"), TRUE);
ED_region_tag_redraw(CTX_wm_region(C));
return OPERATOR_FINISHED;
@@ -448,14 +448,14 @@ static int face_select_all_exec(bContext *C, wmOperator *op)
void PAINT_OT_face_select_all(wmOperatorType *ot)
{
- ot->name= "Face Selection";
- ot->description= "Change selection for all faces";
- ot->idname= "PAINT_OT_face_select_all";
+ ot->name = "Face Selection";
+ ot->description = "Change selection for all faces";
+ ot->idname = "PAINT_OT_face_select_all";
- ot->exec= face_select_all_exec;
- ot->poll= facemask_paint_poll;
+ ot->exec = face_select_all_exec;
+ ot->poll = facemask_paint_poll;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
WM_operator_properties_select_all(ot);
}
@@ -463,7 +463,7 @@ void PAINT_OT_face_select_all(wmOperatorType *ot)
static int vert_select_all_exec(bContext *C, wmOperator *op)
{
- Object *ob= CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
paintvert_deselect_all_visible(ob, RNA_enum_get(op->ptr, "action"), TRUE);
ED_region_tag_redraw(CTX_wm_region(C));
return OPERATOR_FINISHED;
@@ -472,21 +472,21 @@ static int vert_select_all_exec(bContext *C, wmOperator *op)
void PAINT_OT_vert_select_all(wmOperatorType *ot)
{
- ot->name= "Vertex Selection";
- ot->description= "Change selection for all vertices";
- ot->idname= "PAINT_OT_vert_select_all";
+ ot->name = "Vertex Selection";
+ ot->description = "Change selection for all vertices";
+ ot->idname = "PAINT_OT_vert_select_all";
- ot->exec= vert_select_all_exec;
- ot->poll= vert_paint_poll;
+ ot->exec = vert_select_all_exec;
+ ot->poll = vert_paint_poll;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
WM_operator_properties_select_all(ot);
}
static int vert_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
paintvert_deselect_all_visible(ob, SEL_INVERT, TRUE);
ED_region_tag_redraw(CTX_wm_region(C));
return OPERATOR_FINISHED;
@@ -494,18 +494,18 @@ static int vert_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
void PAINT_OT_vert_select_inverse(wmOperatorType *ot)
{
- ot->name= "Vertex Select Invert";
- ot->description= "Invert selection of vertices";
- ot->idname= "PAINT_OT_vert_select_inverse";
+ ot->name = "Vertex Select Invert";
+ ot->description = "Invert selection of vertices";
+ ot->idname = "PAINT_OT_vert_select_inverse";
- ot->exec= vert_select_inverse_exec;
- ot->poll= vert_paint_poll;
+ ot->exec = vert_select_inverse_exec;
+ ot->poll = vert_paint_poll;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int face_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
paintface_deselect_all_visible(ob, SEL_INVERT, TRUE);
ED_region_tag_redraw(CTX_wm_region(C));
return OPERATOR_FINISHED;
@@ -514,20 +514,20 @@ static int face_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
void PAINT_OT_face_select_inverse(wmOperatorType *ot)
{
- ot->name= "Face Select Invert";
- ot->description= "Invert selection of faces";
- ot->idname= "PAINT_OT_face_select_inverse";
+ ot->name = "Face Select Invert";
+ ot->description = "Invert selection of faces";
+ ot->idname = "PAINT_OT_face_select_inverse";
- ot->exec= face_select_inverse_exec;
- ot->poll= facemask_paint_poll;
+ ot->exec = face_select_inverse_exec;
+ ot->poll = facemask_paint_poll;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int face_select_hide_exec(bContext *C, wmOperator *op)
{
- const int unselected= RNA_boolean_get(op->ptr, "unselected");
- Object *ob= CTX_data_active_object(C);
+ const int unselected = RNA_boolean_get(op->ptr, "unselected");
+ Object *ob = CTX_data_active_object(C);
paintface_hide(ob, unselected);
ED_region_tag_redraw(CTX_wm_region(C));
return OPERATOR_FINISHED;
@@ -535,21 +535,21 @@ static int face_select_hide_exec(bContext *C, wmOperator *op)
void PAINT_OT_face_select_hide(wmOperatorType *ot)
{
- ot->name= "Face Select Hide";
- ot->description= "Hide selected faces";
- ot->idname= "PAINT_OT_face_select_hide";
+ ot->name = "Face Select Hide";
+ ot->description = "Hide selected faces";
+ ot->idname = "PAINT_OT_face_select_hide";
- ot->exec= face_select_hide_exec;
- ot->poll= facemask_paint_poll;
+ ot->exec = face_select_hide_exec;
+ ot->poll = facemask_paint_poll;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects");
}
static int face_select_reveal_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
paintface_reveal(ob);
ED_region_tag_redraw(CTX_wm_region(C));
return OPERATOR_FINISHED;
@@ -557,14 +557,14 @@ static int face_select_reveal_exec(bContext *C, wmOperator *UNUSED(op))
void PAINT_OT_face_select_reveal(wmOperatorType *ot)
{
- ot->name= "Face Select Reveal";
- ot->description= "Reveal hidden faces";
- ot->idname= "PAINT_OT_face_select_reveal";
+ ot->name = "Face Select Reveal";
+ ot->description = "Reveal hidden faces";
+ ot->idname = "PAINT_OT_face_select_reveal";
- ot->exec= face_select_reveal_exec;
- ot->poll= facemask_paint_poll;
+ ot->exec = face_select_reveal_exec;
+ ot->poll = facemask_paint_poll;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects");
}
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index ad5aeea1b18..ae0c19d7245 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -103,7 +103,7 @@ static int vertex_paint_use_fast_update_check(Object *ob)
}
/* if the polygons from the mesh and the 'derivedFinal' match
- * we can assume that no modifiers are applied and that its worth adding tesselated faces
+ * we can assume that no modifiers are applied and that its worth adding tessellated faces
* so 'vertex_paint_use_fast_update_check()' returns TRUE */
static int vertex_paint_use_tessface_check(Object *ob)
{
@@ -129,15 +129,16 @@ int vertex_paint_mode_poll(bContext *C)
int vertex_paint_poll(bContext *C)
{
- if(vertex_paint_mode_poll(C) &&
- paint_brush(&CTX_data_tool_settings(C)->vpaint->paint)) {
- ScrArea *sa= CTX_wm_area(C);
- if(sa->spacetype==SPACE_VIEW3D) {
- ARegion *ar= CTX_wm_region(C);
- if(ar->regiontype==RGN_TYPE_WINDOW)
+ if (vertex_paint_mode_poll(C) &&
+ paint_brush(&CTX_data_tool_settings(C)->vpaint->paint))
+ {
+ ScrArea *sa = CTX_wm_area(C);
+ if (sa->spacetype == SPACE_VIEW3D) {
+ ARegion *ar = CTX_wm_region(C);
+ if (ar->regiontype == RGN_TYPE_WINDOW)
return 1;
- }
}
+ }
return 0;
}
@@ -150,17 +151,17 @@ int weight_paint_mode_poll(bContext *C)
int weight_paint_poll(bContext *C)
{
- Object *ob= CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
ScrArea *sa;
- if( (ob != NULL) &&
- (ob->mode & OB_MODE_WEIGHT_PAINT) &&
- (paint_brush(&CTX_data_tool_settings(C)->wpaint->paint) != NULL) &&
- (sa= CTX_wm_area(C)) &&
- (sa->spacetype == SPACE_VIEW3D)
- ) {
- ARegion *ar= CTX_wm_region(C);
- if(ar->regiontype==RGN_TYPE_WINDOW) {
+ if ((ob != NULL) &&
+ (ob->mode & OB_MODE_WEIGHT_PAINT) &&
+ (paint_brush(&CTX_data_tool_settings(C)->wpaint->paint) != NULL) &&
+ (sa = CTX_wm_area(C)) &&
+ (sa->spacetype == SPACE_VIEW3D))
+ {
+ ARegion *ar = CTX_wm_region(C);
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
return 1;
}
}
@@ -169,54 +170,28 @@ int weight_paint_poll(bContext *C)
static VPaint *new_vpaint(int wpaint)
{
- VPaint *vp= MEM_callocN(sizeof(VPaint), "VPaint");
+ VPaint *vp = MEM_callocN(sizeof(VPaint), "VPaint");
- vp->flag= VP_AREA+VP_SPRAY;
+ vp->flag = VP_AREA + VP_SPRAY;
- if(wpaint)
- vp->flag= VP_AREA;
+ if (wpaint)
+ vp->flag = VP_AREA;
return vp;
}
static int *get_indexarray(Mesh *me)
{
- return MEM_mallocN(sizeof(int)*(me->totpoly+1), "vertexpaint");
-}
-
-
-/* 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 */
-
-static unsigned int rgba_to_mcol(float r, float g, float b, float a)
-{
- int ir, ig, ib, ia;
- unsigned int col;
- char *cp;
-
- ir= floor(255.0f * r);
- if(ir<0) ir= 0; else if(ir>255) ir= 255;
- ig= floor(255.0f * g);
- if(ig<0) ig= 0; else if(ig>255) ig= 255;
- ib= floor(255.0f * b);
- if(ib<0) ib= 0; else if(ib>255) ib= 255;
- ia= floor(255.0f * a);
- if(ia<0) ia= 0; else if(ia>255) ia= 255;
-
- cp= (char *)&col;
- cp[0]= ia;
- cp[1]= ib;
- cp[2]= ig;
- cp[3]= ir;
-
- return col;
-
+ return MEM_mallocN(sizeof(int) * (me->totpoly + 1), "vertexpaint");
}
unsigned int vpaint_get_current_col(VPaint *vp)
{
Brush *brush = paint_brush(&vp->paint);
- return rgba_to_mcol(brush->rgb[0], brush->rgb[1], brush->rgb[2], 1.0f);
+ unsigned char col[4];
+ rgb_float_to_uchar(col, brush->rgb);
+ col[3] = 255; /* alpha isn't used, could even be removed to speedup paint a little */
+ return *(unsigned int *)col;
}
static void do_shared_vertex_tesscol(Mesh *me)
@@ -229,57 +204,57 @@ static void do_shared_vertex_tesscol(Mesh *me)
short *scolmain, *scol;
char *mcol;
- if(me->mcol==NULL || me->totvert==0 || me->totface==0) return;
-
- scolmain= MEM_callocN(4*sizeof(short)*me->totvert, "colmain");
-
- tface= me->mtface;
- mface= me->mface;
- mcol= (char *)me->mcol;
- for(a=me->totface; a>0; a--, mface++, mcol+=16) {
- if((tface && tface->mode & TF_SHAREDCOL) || (me->editflag & ME_EDIT_PAINT_MASK)==0) {
- scol= scolmain+4*mface->v1;
- scol[0]++; scol[1]+= mcol[1]; scol[2]+= mcol[2]; scol[3]+= mcol[3];
- scol= scolmain+4*mface->v2;
- scol[0]++; scol[1]+= mcol[5]; scol[2]+= mcol[6]; scol[3]+= mcol[7];
- scol= scolmain+4*mface->v3;
- scol[0]++; scol[1]+= mcol[9]; scol[2]+= mcol[10]; scol[3]+= mcol[11];
- if(mface->v4) {
- scol= scolmain+4*mface->v4;
- scol[0]++; scol[1]+= mcol[13]; scol[2]+= mcol[14]; scol[3]+= mcol[15];
+ if (me->mcol == NULL || me->totvert == 0 || me->totface == 0) return;
+
+ scolmain = MEM_callocN(4 * sizeof(short) * me->totvert, "colmain");
+
+ tface = me->mtface;
+ mface = me->mface;
+ mcol = (char *)me->mcol;
+ for (a = me->totface; a > 0; a--, mface++, mcol += 16) {
+ if ((tface && tface->mode & TF_SHAREDCOL) || (me->editflag & ME_EDIT_PAINT_MASK) == 0) {
+ scol = scolmain + 4 * mface->v1;
+ scol[0]++; scol[1] += mcol[1]; scol[2] += mcol[2]; scol[3] += mcol[3];
+ scol = scolmain + 4 * mface->v2;
+ scol[0]++; scol[1] += mcol[5]; scol[2] += mcol[6]; scol[3] += mcol[7];
+ scol = scolmain + 4 * mface->v3;
+ scol[0]++; scol[1] += mcol[9]; scol[2] += mcol[10]; scol[3] += mcol[11];
+ if (mface->v4) {
+ scol = scolmain + 4 * mface->v4;
+ scol[0]++; scol[1] += mcol[13]; scol[2] += mcol[14]; scol[3] += mcol[15];
}
}
- if(tface) tface++;
- }
-
- a= me->totvert;
- scol= scolmain;
- while(a--) {
- if(scol[0]>1) {
- scol[1]/= scol[0];
- scol[2]/= scol[0];
- scol[3]/= scol[0];
- }
- scol+= 4;
- }
-
- tface= me->mtface;
- mface= me->mface;
- mcol= (char *)me->mcol;
- for(a=me->totface; a>0; a--, mface++, mcol+=16) {
- if((tface && tface->mode & TF_SHAREDCOL) || (me->editflag & ME_EDIT_PAINT_MASK)==0) {
- scol= scolmain+4*mface->v1;
- mcol[1]= scol[1]; mcol[2]= scol[2]; mcol[3]= scol[3];
- scol= scolmain+4*mface->v2;
- mcol[5]= scol[1]; mcol[6]= scol[2]; mcol[7]= scol[3];
- scol= scolmain+4*mface->v3;
- mcol[9]= scol[1]; mcol[10]= scol[2]; mcol[11]= scol[3];
- if(mface->v4) {
- scol= scolmain+4*mface->v4;
- mcol[13]= scol[1]; mcol[14]= scol[2]; mcol[15]= scol[3];
+ if (tface) tface++;
+ }
+
+ a = me->totvert;
+ scol = scolmain;
+ while (a--) {
+ if (scol[0] > 1) {
+ scol[1] /= scol[0];
+ scol[2] /= scol[0];
+ scol[3] /= scol[0];
+ }
+ scol += 4;
+ }
+
+ tface = me->mtface;
+ mface = me->mface;
+ mcol = (char *)me->mcol;
+ for (a = me->totface; a > 0; a--, mface++, mcol += 16) {
+ if ((tface && tface->mode & TF_SHAREDCOL) || (me->editflag & ME_EDIT_PAINT_MASK) == 0) {
+ scol = scolmain + 4 * mface->v1;
+ mcol[1] = scol[1]; mcol[2] = scol[2]; mcol[3] = scol[3];
+ scol = scolmain + 4 * mface->v2;
+ mcol[5] = scol[1]; mcol[6] = scol[2]; mcol[7] = scol[3];
+ scol = scolmain + 4 * mface->v3;
+ mcol[9] = scol[1]; mcol[10] = scol[2]; mcol[11] = scol[3];
+ if (mface->v4) {
+ scol = scolmain + 4 * mface->v4;
+ mcol[13] = scol[1]; mcol[14] = scol[2]; mcol[15] = scol[3];
}
}
- if(tface) tface++;
+ if (tface) tface++;
}
MEM_freeN(scolmain);
@@ -297,17 +272,17 @@ void do_shared_vertexcol(Mesh *me, int do_tessface)
/* if no mloopcol: do not do */
/* if mtexpoly: only the involved faces, otherwise all */
- if(me->mloopcol==0 || me->totvert==0 || me->totpoly==0) return;
+ if (me->mloopcol == 0 || me->totvert == 0 || me->totpoly == 0) return;
- scol = MEM_callocN(sizeof(float)*me->totvert*5, "scol");
+ scol = MEM_callocN(sizeof(float) * me->totvert * 5, "scol");
- for (i=0; i<me->totloop; i++, ml++, lcol++) {
+ for (i = 0; i < me->totloop; i++, ml++, lcol++) {
if (i >= mp->loopstart + mp->totloop) {
mp++;
if (mtp) mtp++;
}
- if (!(mtp && (mtp->mode & TF_SHAREDCOL)) && (me->editflag & ME_EDIT_PAINT_MASK)!=0)
+ if (!(mtp && (mtp->mode & TF_SHAREDCOL)) && (me->editflag & ME_EDIT_PAINT_MASK) != 0)
continue;
scol[ml->v][0] += lcol->r;
@@ -319,7 +294,7 @@ void do_shared_vertexcol(Mesh *me, int do_tessface)
}
if (has_shared) {
- for (i=0; i<me->totvert; i++) {
+ for (i = 0; i < me->totvert; i++) {
if (!scol[i][4]) continue;
scol[i][0] /= scol[i][4];
@@ -330,7 +305,7 @@ void do_shared_vertexcol(Mesh *me, int do_tessface)
ml = me->mloop;
lcol = me->mloopcol;
- for (i=0; i<me->totloop; i++, ml++, lcol++) {
+ for (i = 0; i < me->totloop; i++, ml++, lcol++) {
if (!scol[ml->v][4]) continue;
lcol->r = scol[ml->v][0];
@@ -347,17 +322,17 @@ void do_shared_vertexcol(Mesh *me, int do_tessface)
}
}
-static void make_vertexcol(Object *ob) /* single ob */
+static void make_vertexcol(Object *ob) /* single ob */
{
Mesh *me;
- if(!ob || ob->id.lib) return;
- me= get_mesh(ob);
- if(me==NULL) return;
- if(me->edit_btmesh) return;
+ if (!ob || ob->id.lib) return;
+ me = get_mesh(ob);
+ if (me == NULL) return;
+ if (me->edit_btmesh) return;
/* copies from shadedisplist to mcol */
if (!me->mloopcol) {
- if(!me->mcol) {
+ if (!me->mcol) {
CustomData_add_layer(&me->fdata, CD_MCOL, CD_DEFAULT, NULL, me->totface);
}
if (!me->mloopcol) {
@@ -371,10 +346,10 @@ static void make_vertexcol(Object *ob) /* single ob */
if (!me->mcol || !me->mface) {
/* should always be true */
if (me->mcol) {
- memset(me->mcol, 255, 4*sizeof(MCol)*me->totface);
+ memset(me->mcol, 255, 4 * sizeof(MCol) * me->totface);
}
- /* create tessfaces because they will be used for drawing & fast updates*/
+ /* create tessfaces because they will be used for drawing & fast updates */
BKE_mesh_tessface_calc(me); /* does own call to update pointers */
}
}
@@ -396,31 +371,31 @@ static void make_vertexcol(Object *ob) /* single ob */
/* mirror_vgroup is set to -1 when invalid */
static int wpaint_mirror_vgroup_ensure(Object *ob, const int vgroup_active)
{
- bDeformGroup *defgroup= BLI_findlink(&ob->defbase, vgroup_active);
+ bDeformGroup *defgroup = BLI_findlink(&ob->defbase, vgroup_active);
- if(defgroup) {
+ if (defgroup) {
bDeformGroup *curdef;
int mirrdef;
char name[MAXBONENAME];
flip_side_name(name, defgroup->name, FALSE);
- if(strcmp(name, defgroup->name) != 0) {
- for (curdef= ob->defbase.first, mirrdef= 0; curdef; curdef=curdef->next, mirrdef++) {
+ if (strcmp(name, defgroup->name) != 0) {
+ for (curdef = ob->defbase.first, mirrdef = 0; curdef; curdef = curdef->next, mirrdef++) {
if (!strcmp(curdef->name, name)) {
break;
}
}
- if(curdef==NULL) {
- int olddef= ob->actdef; /* tsk, ED_vgroup_add sets the active defgroup */
- curdef= ED_vgroup_add_name(ob, name);
- ob->actdef= olddef;
+ if (curdef == NULL) {
+ int olddef = ob->actdef; /* tsk, ED_vgroup_add sets the active defgroup */
+ curdef = ED_vgroup_add_name(ob, name);
+ ob->actdef = olddef;
}
/* curdef should never be NULL unless this is
* a lamp and ED_vgroup_add_name fails */
- if(curdef) {
+ if (curdef) {
return mirrdef;
}
}
@@ -431,31 +406,31 @@ static int wpaint_mirror_vgroup_ensure(Object *ob, const int vgroup_active)
static void copy_vpaint_prev(VPaint *vp, unsigned int *lcol, int tot)
{
- if(vp->vpaint_prev) {
+ if (vp->vpaint_prev) {
MEM_freeN(vp->vpaint_prev);
- vp->vpaint_prev= NULL;
+ vp->vpaint_prev = NULL;
}
- vp->tot= tot;
+ vp->tot = tot;
- if(lcol==NULL || tot==0) return;
+ if (lcol == NULL || tot == 0) return;
- vp->vpaint_prev= MEM_mallocN(sizeof(int)*tot, "vpaint_prev");
- memcpy(vp->vpaint_prev, lcol, sizeof(int)*tot);
+ vp->vpaint_prev = MEM_mallocN(sizeof(int) * tot, "vpaint_prev");
+ memcpy(vp->vpaint_prev, lcol, sizeof(int) * tot);
}
-static void copy_wpaint_prev (VPaint *wp, MDeformVert *dverts, int dcount)
+static void copy_wpaint_prev(VPaint *wp, MDeformVert *dverts, int dcount)
{
if (wp->wpaint_prev) {
free_dverts(wp->wpaint_prev, wp->tot);
- wp->wpaint_prev= NULL;
+ wp->wpaint_prev = NULL;
}
- if(dverts && dcount) {
+ if (dverts && dcount) {
- wp->wpaint_prev = MEM_mallocN (sizeof(MDeformVert)*dcount, "wpaint prev");
+ wp->wpaint_prev = MEM_mallocN(sizeof(MDeformVert) * dcount, "wpaint prev");
wp->tot = dcount;
- copy_dverts (wp->wpaint_prev, dverts, dcount);
+ copy_dverts(wp->wpaint_prev, dverts, dcount);
}
}
@@ -467,24 +442,23 @@ void vpaint_fill(Object *ob, unsigned int paintcol)
MLoopCol *lcol;
int i, j, selected;
- me= get_mesh(ob);
- if(me==NULL || me->totpoly==0) return;
+ me = get_mesh(ob);
+ if (me == NULL || me->totpoly == 0) return;
- if(!me->mloopcol) make_vertexcol(ob);
- if(!me->mloopcol) return; /* possible we can't make mcol's */
+ if (!me->mloopcol) make_vertexcol(ob);
+ if (!me->mloopcol) return; /* possible we can't make mcol's */
- selected= (me->editflag & ME_EDIT_PAINT_MASK);
+ selected = (me->editflag & ME_EDIT_PAINT_MASK);
mp = me->mpoly;
- lcol = me->mloopcol;
- for (i=0; i<me->totpoly; i++, mp++) {
+ for (i = 0; i < me->totpoly; i++, mp++) {
if (!(!selected || mp->flag & ME_FACE_SEL))
continue;
lcol = me->mloopcol + mp->loopstart;
- for (j=0; j<mp->totloop; j++, lcol++) {
- *(int*)lcol = paintcol;
+ for (j = 0; j < mp->totloop; j++, lcol++) {
+ *(int *)lcol = paintcol;
}
}
@@ -498,73 +472,74 @@ void vpaint_fill(Object *ob, unsigned int paintcol)
/* fills in the selected faces with the current weight and vertex group */
void wpaint_fill(VPaint *wp, Object *ob, float paintweight)
{
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
MPoly *mf;
MDeformWeight *dw, *dw_prev;
- int vgroup_active, vgroup_mirror= -1;
+ int vgroup_active, vgroup_mirror = -1;
unsigned int index;
/* mutually exclusive, could be made into a */
- const short paint_selmode= ME_EDIT_PAINT_SEL_MODE(me);
+ const short paint_selmode = ME_EDIT_PAINT_SEL_MODE(me);
- if(me->totpoly==0 || me->dvert==NULL || !me->mpoly) return;
+ if (me->totpoly == 0 || me->dvert == NULL || !me->mpoly) return;
vgroup_active = ob->actdef - 1;
/* if mirror painting, find the other group */
- if(me->editflag & ME_EDIT_MIRROR_X) {
- vgroup_mirror= wpaint_mirror_vgroup_ensure(ob, vgroup_active);
+ if (me->editflag & ME_EDIT_MIRROR_X) {
+ vgroup_mirror = wpaint_mirror_vgroup_ensure(ob, vgroup_active);
}
copy_wpaint_prev(wp, me->dvert, me->totvert);
- for(index=0, mf= me->mpoly; index < me->totpoly; index++, mf++) {
- unsigned int fidx= mf->totloop - 1;
+ for (index = 0, mf = me->mpoly; index < me->totpoly; index++, mf++) {
+ unsigned int fidx = mf->totloop - 1;
if ((paint_selmode == SCE_SELECT_FACE) && !(mf->flag & ME_FACE_SEL)) {
continue;
}
do {
- unsigned int vidx= me->mloop[mf->loopstart + fidx].v;
+ unsigned int vidx = me->mloop[mf->loopstart + fidx].v;
- if(!me->dvert[vidx].flag) {
- if((paint_selmode == SCE_SELECT_VERTEX) && !(me->mvert[vidx].flag & SELECT)) {
+ if (!me->dvert[vidx].flag) {
+ if ((paint_selmode == SCE_SELECT_VERTEX) && !(me->mvert[vidx].flag & SELECT)) {
continue;
}
- dw= defvert_verify_index(&me->dvert[vidx], vgroup_active);
- if(dw) {
- dw_prev= defvert_verify_index(wp->wpaint_prev+vidx, vgroup_active);
- dw_prev->weight= dw->weight; /* set the undo weight */
- dw->weight= paintweight;
+ dw = defvert_verify_index(&me->dvert[vidx], vgroup_active);
+ if (dw) {
+ dw_prev = defvert_verify_index(wp->wpaint_prev + vidx, vgroup_active);
+ dw_prev->weight = dw->weight; /* set the undo weight */
+ dw->weight = paintweight;
- if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */
- int j= mesh_get_x_mirror_vert(ob, vidx);
- if(j>=0) {
+ if (me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */
+ int j = mesh_get_x_mirror_vert(ob, vidx);
+ if (j >= 0) {
/* copy, not paint again */
- if(vgroup_mirror != -1) {
- dw= defvert_verify_index(me->dvert+j, vgroup_mirror);
- dw_prev= defvert_verify_index(wp->wpaint_prev+j, vgroup_mirror);
- } else {
- dw= defvert_verify_index(me->dvert+j, vgroup_active);
- dw_prev= defvert_verify_index(wp->wpaint_prev+j, vgroup_active);
+ if (vgroup_mirror != -1) {
+ dw = defvert_verify_index(me->dvert + j, vgroup_mirror);
+ dw_prev = defvert_verify_index(wp->wpaint_prev + j, vgroup_mirror);
+ }
+ else {
+ dw = defvert_verify_index(me->dvert + j, vgroup_active);
+ dw_prev = defvert_verify_index(wp->wpaint_prev + j, vgroup_active);
}
- dw_prev->weight= dw->weight; /* set the undo weight */
- dw->weight= paintweight;
+ dw_prev->weight = dw->weight; /* set the undo weight */
+ dw->weight = paintweight;
}
}
}
- me->dvert[vidx].flag= 1;
+ me->dvert[vidx].flag = 1;
}
} while (fidx--);
}
{
- MDeformVert *dv= me->dvert;
- for(index= me->totvert; index != 0; index--, dv++) {
- dv->flag= 0;
+ MDeformVert *dv = me->dvert;
+ for (index = me->totvert; index != 0; index--, dv++) {
+ dv->flag = 0;
}
}
@@ -573,194 +548,214 @@ 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;
+ VPaint *vp = scene->toolsettings->vpaint;
Mesh *me;
Object *ob;
float igam, fac;
int a, temp;
unsigned char *cp, gamtab[256];
- ob= OBACT;
- me= get_mesh(ob);
+ ob = OBACT;
+ me = get_mesh(ob);
- if(!(ob->mode & OB_MODE_VERTEX_PAINT)) return;
- if(me==0 || me->mcol==0 || me->totface==0) return;
+ if (!(ob->mode & OB_MODE_VERTEX_PAINT)) return;
+ if (me == 0 || me->mcol == 0 || me->totface == 0) return;
- igam= 1.0/vp->gamma;
- for(a=0; a<256; a++) {
+ igam = 1.0 / vp->gamma;
+ for (a = 0; a < 256; a++) {
- fac= ((float)a)/255.0;
- fac= vp->mul*pow( fac, igam);
+ fac = ((float)a) / 255.0;
+ fac = vp->mul * pow(fac, igam);
- temp= 255.9*fac;
+ temp = 255.9 * fac;
- if(temp<=0) gamtab[a]= 0;
- else if(temp>=255) gamtab[a]= 255;
- else gamtab[a]= temp;
+ if (temp <= 0) gamtab[a] = 0;
+ else if (temp >= 255) gamtab[a] = 255;
+ else gamtab[a] = temp;
}
- a= 4*me->totface;
- cp= (unsigned char *)me->mcol;
- while(a--) {
+ a = 4 * me->totface;
+ cp = (unsigned char *)me->mcol;
+ while (a--) {
- cp[1]= gamtab[ cp[1] ];
- cp[2]= gamtab[ cp[2] ];
- cp[3]= gamtab[ cp[3] ];
+ cp[1] = gamtab[cp[1]];
+ cp[2] = gamtab[cp[2]];
+ cp[3] = gamtab[cp[3]];
- cp+= 4;
+ cp += 4;
}
}
- */
+#endif
-BM_INLINE unsigned int mcol_blend(unsigned int col1, unsigned int col2, int fac)
+BLI_INLINE unsigned int mcol_blend(unsigned int col1, unsigned int col2, int fac)
{
- char *cp1, *cp2, *cp;
+ unsigned char *cp1, *cp2, *cp;
int mfac;
- unsigned int col=0;
-
- if(fac==0) return col1;
- if(fac>=255) return col2;
+ unsigned int col = 0;
+
+ if (fac == 0) {
+ return col1;
+ }
+
+ if (fac >= 255) {
+ return col2;
+ }
+
+ mfac = 255 - fac;
+
+ cp1 = (unsigned char *)&col1;
+ cp2 = (unsigned char *)&col2;
+ cp = (unsigned char *)&col;
+
+ cp[0] = (mfac * cp1[0] + fac * cp2[0]) / 255;
+ cp[1] = (mfac * cp1[1] + fac * cp2[1]) / 255;
+ cp[2] = (mfac * cp1[2] + fac * cp2[2]) / 255;
+ cp[3] = 255;
- mfac= 255-fac;
-
- cp1= (char *)&col1;
- cp2= (char *)&col2;
- cp= (char *)&col;
-
- cp[0]= 255;
- cp[1]= (mfac*cp1[1]+fac*cp2[1])/255;
- cp[2]= (mfac*cp1[2]+fac*cp2[2])/255;
- cp[3]= (mfac*cp1[3]+fac*cp2[3])/255;
-
return col;
}
-BM_INLINE unsigned int mcol_add(unsigned int col1, unsigned int col2, int fac)
+BLI_INLINE unsigned int mcol_add(unsigned int col1, unsigned int col2, int fac)
{
- char *cp1, *cp2, *cp;
+ unsigned char *cp1, *cp2, *cp;
int temp;
- unsigned int col=0;
-
- if(fac==0) return col1;
-
- cp1= (char *)&col1;
- cp2= (char *)&col2;
- cp= (char *)&col;
-
- cp[0]= 255;
- temp= cp1[1] + ((fac*cp2[1])/255);
- if(temp>254) cp[1]= 255; else cp[1]= temp;
- temp= cp1[2] + ((fac*cp2[2])/255);
- if(temp>254) cp[2]= 255; else cp[2]= temp;
- temp= cp1[3] + ((fac*cp2[3])/255);
- if(temp>254) cp[3]= 255; else cp[3]= temp;
+ unsigned int col = 0;
+
+ if (fac == 0) {
+ return col1;
+ }
+
+ cp1 = (unsigned char *)&col1;
+ cp2 = (unsigned char *)&col2;
+ cp = (unsigned char *)&col;
+
+ temp = cp1[0] + ((fac * cp2[0]) / 255);
+ cp[0] = (temp > 254) ? 255 : temp;
+ temp = cp1[1] + ((fac * cp2[1]) / 255);
+ cp[1] = (temp > 254) ? 255 : temp;
+ temp = cp1[2] + ((fac * cp2[2]) / 255);
+ cp[2] = (temp > 254) ? 255 : temp;
+ cp[3] = 255;
return col;
}
-BM_INLINE unsigned int mcol_sub(unsigned int col1, unsigned int col2, int fac)
+BLI_INLINE unsigned int mcol_sub(unsigned int col1, unsigned int col2, int fac)
{
- char *cp1, *cp2, *cp;
+ unsigned char *cp1, *cp2, *cp;
int temp;
- unsigned int col=0;
-
- if(fac==0) return col1;
-
- cp1= (char *)&col1;
- cp2= (char *)&col2;
- cp= (char *)&col;
-
- cp[0]= 255;
- temp= cp1[1] - ((fac*cp2[1])/255);
- if(temp<0) cp[1]= 0; else cp[1]= temp;
- temp= cp1[2] - ((fac*cp2[2])/255);
- if(temp<0) cp[2]= 0; else cp[2]= temp;
- temp= cp1[3] - ((fac*cp2[3])/255);
- if(temp<0) cp[3]= 0; else cp[3]= temp;
-
+ unsigned int col = 0;
+
+ if (fac == 0) {
+ return col1;
+ }
+
+ cp1 = (unsigned char *)&col1;
+ cp2 = (unsigned char *)&col2;
+ cp = (unsigned char *)&col;
+
+ temp = cp1[0] - ((fac * cp2[0]) / 255);
+ cp1[0] = (temp < 0) ? 0 : temp;
+ temp = cp1[1] - ((fac * cp2[1]) / 255);
+ cp1[1] = (temp < 0) ? 0 : temp;
+ temp = cp1[2] - ((fac * cp2[2]) / 255);
+ cp1[2] = (temp < 0) ? 0 : temp;
+ cp[3] = 255;
+
return col;
}
-BM_INLINE unsigned int mcol_mul(unsigned int col1, unsigned int col2, int fac)
+BLI_INLINE unsigned int mcol_mul(unsigned int col1, unsigned int col2, int fac)
{
- char *cp1, *cp2, *cp;
+ unsigned char *cp1, *cp2, *cp;
int mfac;
- unsigned int col=0;
-
- if(fac==0) return col1;
+ unsigned int col = 0;
+
+ if (fac == 0) {
+ return col1;
+ }
+
+ mfac = 255 - fac;
+
+ cp1 = (unsigned char *)&col1;
+ cp2 = (unsigned char *)&col2;
+ cp = (unsigned char *)&col;
- mfac= 255-fac;
-
- cp1= (char *)&col1;
- cp2= (char *)&col2;
- cp= (char *)&col;
-
/* first mul, then blend the fac */
- cp[0]= 255;
- cp[1]= (mfac*cp1[1] + fac*((cp2[1]*cp1[1])/255) )/255;
- cp[2]= (mfac*cp1[2] + fac*((cp2[2]*cp1[2])/255) )/255;
- cp[3]= (mfac*cp1[3] + fac*((cp2[3]*cp1[3])/255) )/255;
+ cp[0] = (mfac * cp1[0] + fac * ((cp2[0] * cp1[0]) / 255)) / 255;
+ cp[1] = (mfac * cp1[1] + fac * ((cp2[1] * cp1[1]) / 255)) / 255;
+ cp[2] = (mfac * cp1[2] + fac * ((cp2[2] * cp1[2]) / 255)) / 255;
+ cp[3] = 255;
-
return col;
}
-BM_INLINE unsigned int mcol_lighten(unsigned int col1, unsigned int col2, int fac)
+BLI_INLINE unsigned int mcol_lighten(unsigned int col1, unsigned int col2, int fac)
{
- char *cp1, *cp2, *cp;
+ unsigned char *cp1, *cp2, *cp;
int mfac;
- unsigned int col=0;
-
- if(fac==0) return col1;
- if(fac>=255) return col2;
+ unsigned int col = 0;
- mfac= 255-fac;
-
- cp1= (char *)&col1;
- cp2= (char *)&col2;
- 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 (cp1[1]+cp1[2]+cp1[3] > cp2[1]+cp2[2]+cp2[3])
+ if (fac == 0) {
return col1;
-
- cp[0]= 255;
- cp[1]= (mfac*cp1[1]+fac*cp2[1])/255;
- cp[2]= (mfac*cp1[2]+fac*cp2[2])/255;
- cp[3]= (mfac*cp1[3]+fac*cp2[3])/255;
-
+ }
+ else if (fac >= 255) {
+ return col2;
+ }
+
+ mfac = 255 - fac;
+
+ cp1 = (unsigned char *)&col1;
+ cp2 = (unsigned char *)&col2;
+ cp = (unsigned char *)&col;
+
+ /* See if are lighter, if so mix, else don't do anything.
+ * if the paint col is darker then the original, then ignore */
+ if (rgb_to_grayscale_byte(cp1) > rgb_to_grayscale_byte(cp2)) {
+ return col1;
+ }
+
+ cp[0] = (mfac * cp1[0] + fac * cp2[0]) / 255;
+ cp[1] = (mfac * cp1[1] + fac * cp2[1]) / 255;
+ cp[2] = (mfac * cp1[2] + fac * cp2[2]) / 255;
+ cp[3] = 255;
+
return col;
}
-BM_INLINE unsigned int mcol_darken(unsigned int col1, unsigned int col2, int fac)
+BLI_INLINE unsigned int mcol_darken(unsigned int col1, unsigned int col2, int fac)
{
- char *cp1, *cp2, *cp;
+ unsigned char *cp1, *cp2, *cp;
int mfac;
- unsigned int col=0;
-
- if(fac==0) return col1;
- if(fac>=255) return col2;
+ unsigned int col = 0;
- mfac= 255-fac;
-
- cp1= (char *)&col1;
- cp2= (char *)&col2;
- 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 (cp1[1]+cp1[2]+cp1[3] < cp2[1]+cp2[2]+cp2[3])
+ if (fac == 0) {
return col1;
-
- cp[0]= 255;
- cp[1]= (mfac*cp1[1]+fac*cp2[1])/255;
- cp[2]= (mfac*cp1[2]+fac*cp2[2])/255;
- cp[3]= (mfac*cp1[3]+fac*cp2[3])/255;
+ }
+ else if (fac >= 255) {
+ return col2;
+ }
+
+ mfac = 255 - fac;
+
+ cp1 = (unsigned char *)&col1;
+ cp2 = (unsigned char *)&col2;
+ cp = (unsigned char *)&col;
+
+ /* See if were darker, if so mix, else don't do anything.
+ * if the paint col is brighter then the original, then ignore */
+ if (rgb_to_grayscale_byte(cp1) < rgb_to_grayscale_byte(cp2)) {
+ return col1;
+ }
+
+ cp[0] = (mfac * cp1[0] + fac * cp2[0]) / 255;
+ cp[1] = (mfac * cp1[1] + fac * cp2[1]) / 255;
+ cp[2] = (mfac * cp1[2] + fac * cp2[2]) / 255;
+ cp[3] = 255;
return col;
}
@@ -794,24 +789,24 @@ static unsigned int vpaint_blend(VPaint *vp, unsigned int col, unsigned int colo
col = vpaint_blend_tool(tool, col, paintcol, alpha_i);
/* if no spray, clip color adding with colorig & orig alpha */
- if((vp->flag & VP_SPRAY)==0) {
+ if ((vp->flag & VP_SPRAY) == 0) {
unsigned int testcol, a;
char *cp, *ct, *co;
testcol = vpaint_blend_tool(tool, colorig, paintcol, brush_alpha_value_i);
- cp= (char *)&col;
- ct= (char *)&testcol;
- co= (char *)&colorig;
+ cp = (char *)&col;
+ ct = (char *)&testcol;
+ co = (char *)&colorig;
- for(a=0; a<4; a++) {
- if( ct[a]<co[a] ) {
- if( cp[a]<ct[a] ) cp[a]= ct[a];
- else if( cp[a]>co[a] ) cp[a]= co[a];
+ for (a = 0; a < 4; a++) {
+ if (ct[a] < co[a]) {
+ if (cp[a] < ct[a]) cp[a] = ct[a];
+ else if (cp[a] > co[a]) cp[a] = co[a];
}
else {
- if( cp[a]<co[a] ) cp[a]= co[a];
- else if( cp[a]>ct[a] ) cp[a]= ct[a];
+ if (cp[a] < co[a]) cp[a] = co[a];
+ else if (cp[a] > ct[a]) cp[a] = ct[a];
}
}
}
@@ -823,32 +818,32 @@ static unsigned int vpaint_blend(VPaint *vp, unsigned int col, unsigned int colo
static int sample_backbuf_area(ViewContext *vc, int *indexar, int totface, int x, int y, float size)
{
struct ImBuf *ibuf;
- int a, tot=0, index;
+ int a, tot = 0, index;
- /* brecht: disabled this because it obviously failes for
- brushes with size > 64, why is this here? */
- /*if(size>64.0) size= 64.0;*/
+ /* 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);
- if(ibuf) {
- unsigned int *rt= ibuf->rect;
+ ibuf = view3d_read_backbuf(vc, x - size, y - size, x + size, y + size);
+ if (ibuf) {
+ unsigned int *rt = ibuf->rect;
- memset(indexar, 0, sizeof(int)*(totface+1));
+ memset(indexar, 0, sizeof(int) * (totface + 1));
- size= ibuf->x*ibuf->y;
- while(size--) {
+ size = ibuf->x * ibuf->y;
+ while (size--) {
- if(*rt) {
- index= WM_framebuffer_to_index(*rt);
- if(index>0 && index<=totface)
+ if (*rt) {
+ index = WM_framebuffer_to_index(*rt);
+ if (index > 0 && index <= totface)
indexar[index] = 1;
}
rt++;
}
- for(a=1; a<=totface; a++) {
- if(indexar[a]) indexar[tot++]= a;
+ for (a = 1; a <= totface; a++) {
+ if (indexar[a]) indexar[tot++] = a;
}
IMB_freeImBuf(ibuf);
@@ -859,7 +854,7 @@ static int sample_backbuf_area(ViewContext *vc, int *indexar, int totface, int x
/* whats _dl mean? */
static float calc_vp_strength_dl(VPaint *vp, ViewContext *vc, const float *vert_nor,
- const float mval[2], const float brush_size_pressure)
+ const float mval[2], const float brush_size_pressure)
{
Brush *brush = paint_brush(&vp->paint);
float dist_squared;
@@ -867,7 +862,7 @@ static float calc_vp_strength_dl(VPaint *vp, ViewContext *vc, const float *vert_
project_float_noclip(vc->ar, vert_nor, vertco);
sub_v2_v2v2(delta, mval, vertco);
- dist_squared= dot_v2v2(delta, delta); /* len squared */
+ dist_squared = dot_v2v2(delta, delta); /* len squared */
if (dist_squared > brush_size_pressure * brush_size_pressure) {
return 0.0f;
}
@@ -885,11 +880,11 @@ static float calc_vp_alpha_dl(VPaint *vp, ViewContext *vc,
float strength = calc_vp_strength_dl(vp, vc, vert_nor, mval, brush_size_pressure);
if (strength > 0.0f) {
- float alpha= brush_alpha_pressure * strength;
+ float alpha = brush_alpha_pressure * strength;
- if(vp->flag & VP_NORMALS) {
+ if (vp->flag & VP_NORMALS) {
float dvec[3];
- const float *no= vert_nor + 3;
+ const float *no = vert_nor + 3;
/* transpose ! */
dvec[2] = dot_v3v3(vpimat[2], no);
@@ -911,27 +906,27 @@ static float calc_vp_alpha_dl(VPaint *vp, ViewContext *vc,
}
-BM_INLINE float wval_blend(const float weight, const float paintval, const float alpha)
+BLI_INLINE float wval_blend(const float weight, const float paintval, const float alpha)
{
return (paintval * alpha) + (weight * (1.0f - alpha));
}
-BM_INLINE float wval_add(const float weight, const float paintval, const float alpha)
+BLI_INLINE float wval_add(const float weight, const float paintval, const float alpha)
{
return weight + (paintval * alpha);
}
-BM_INLINE float wval_sub(const float weight, const float paintval, const float alpha)
+BLI_INLINE float wval_sub(const float weight, const float paintval, const float alpha)
{
return weight - (paintval * alpha);
}
-BM_INLINE float wval_mul(const float weight, const float paintval, const float alpha)
-{ /* first mul, then blend the fac */
+BLI_INLINE float wval_mul(const float weight, const float paintval, const float alpha)
+{ /* first mul, then blend the fac */
return ((1.0f - alpha) + (alpha * paintval)) * weight;
}
-BM_INLINE float wval_lighten(const float weight, const float paintval, const float alpha)
+BLI_INLINE float wval_lighten(const float weight, const float paintval, const float alpha)
{
return (weight < paintval) ? wval_blend(weight, paintval, alpha) : weight;
}
-BM_INLINE float wval_darken(const float weight, const float paintval, const float alpha)
+BLI_INLINE float wval_darken(const float weight, const float paintval, const float alpha)
{
return (weight > paintval) ? wval_blend(weight, paintval, alpha) : weight;
}
@@ -968,36 +963,36 @@ static float wpaint_blend(VPaint *wp, float weight, float weight_prev,
int tool = brush->vertexpaint_tool;
if (do_flip) {
- switch(tool) {
+ switch (tool) {
case PAINT_BLEND_MIX:
paintval = 1.f - paintval; break;
case PAINT_BLEND_ADD:
- tool= PAINT_BLEND_SUB; break;
+ tool = PAINT_BLEND_SUB; break;
case PAINT_BLEND_SUB:
- tool= PAINT_BLEND_ADD; break;
+ tool = PAINT_BLEND_ADD; break;
case PAINT_BLEND_LIGHTEN:
- tool= PAINT_BLEND_DARKEN; break;
+ tool = PAINT_BLEND_DARKEN; break;
case PAINT_BLEND_DARKEN:
- tool= PAINT_BLEND_LIGHTEN; break;
+ tool = PAINT_BLEND_LIGHTEN; break;
}
}
weight = wpaint_blend_tool(tool, weight, paintval, alpha);
/* delay clamping until the end so multi-paint can function when the active group is at the limits */
- if(do_multipaint_totsel == FALSE) {
+ if (do_multipaint_totsel == FALSE) {
CLAMP(weight, 0.0f, 1.0f);
}
/* if no spray, clip result with orig weight & orig alpha */
if ((wp->flag & VP_SPRAY) == 0) {
- if(do_multipaint_totsel == FALSE) {
+ if (do_multipaint_totsel == FALSE) {
float testw = wpaint_blend_tool(tool, weight_prev, paintval, brush_alpha_value);
CLAMP(testw, 0.0f, 1.0f);
if (testw < weight_prev) {
- if(weight < testw) weight = testw;
- else if(weight > weight_prev) weight = weight_prev;
+ if (weight < testw) weight = testw;
+ else if (weight > weight_prev) weight = weight_prev;
}
else {
if (weight > testw) weight = testw;
@@ -1018,61 +1013,61 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
ViewContext vc;
Mesh *me;
- short change= FALSE;
+ short change = FALSE;
view3d_set_viewcontext(C, &vc);
- me= get_mesh(vc.obact);
+ me = get_mesh(vc.obact);
if (me && me->dvert && vc.v3d && vc.rv3d) {
int index;
view3d_operator_needs_opengl(C);
- index= view3d_sample_backbuf(&vc, event->mval[0], event->mval[1]);
+ index = view3d_sample_backbuf(&vc, event->mval[0], event->mval[1]);
- if(index && index<=me->totpoly) {
- DerivedMesh *dm= mesh_get_derived_final(vc.scene, vc.obact, CD_MASK_BAREMESH);
+ if (index && index <= me->totpoly) {
+ DerivedMesh *dm = mesh_get_derived_final(vc.scene, vc.obact, CD_MASK_BAREMESH);
- if(dm->getVertCo==NULL) {
+ if (dm->getVertCo == NULL) {
BKE_report(op->reports, RPT_WARNING, "The modifier used does not support deformed locations");
}
else {
- MPoly *mf= ((MPoly *)me->mpoly) + index-1;
- const int vgroup_active= vc.obact->actdef - 1;
- ToolSettings *ts= vc.scene->toolsettings;
+ MPoly *mf = ((MPoly *)me->mpoly) + index - 1;
+ const int vgroup_active = vc.obact->actdef - 1;
+ ToolSettings *ts = vc.scene->toolsettings;
float mval_f[2];
- int v_idx_best= -1;
+ int v_idx_best = -1;
int fidx;
- float len_best= FLT_MAX;
+ float len_best = FLT_MAX;
- mval_f[0]= (float)event->mval[0];
- mval_f[1]= (float)event->mval[1];
+ mval_f[0] = (float)event->mval[0];
+ mval_f[1] = (float)event->mval[1];
- fidx= mf->totloop - 1;
+ fidx = mf->totloop - 1;
do {
float co[3], sco[3], len;
- const int v_idx= me->mloop[mf->loopstart + fidx].v;
+ const int v_idx = me->mloop[mf->loopstart + fidx].v;
dm->getVertCo(dm, v_idx, co);
project_float_noclip(vc.ar, co, sco);
- len= len_squared_v2v2(mval_f, sco);
- if(len < len_best) {
- len_best= len;
- v_idx_best= v_idx;
+ len = len_squared_v2v2(mval_f, sco);
+ if (len < len_best) {
+ len_best = len;
+ v_idx_best = v_idx;
}
} while (fidx--);
- if(v_idx_best != -1) { /* should always be valid */
- ts->vgroup_weight= defvert_find_weight(&me->dvert[v_idx_best], vgroup_active);
- change= TRUE;
+ if (v_idx_best != -1) { /* should always be valid */
+ ts->vgroup_weight = defvert_find_weight(&me->dvert[v_idx_best], vgroup_active);
+ change = TRUE;
}
}
dm->release(dm);
}
}
- if(change) {
+ if (change) {
/* not really correct since the brush didnt change, but redraws the toolbar */
- WM_main_add_notifier(NC_BRUSH|NA_EDITED, NULL); /* ts->wpaint->paint.brush */
+ WM_main_add_notifier(NC_BRUSH | NA_EDITED, NULL); /* ts->wpaint->paint.brush */
return OPERATOR_FINISHED;
}
@@ -1084,74 +1079,74 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, wmEvent *event)
void PAINT_OT_weight_sample(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Weight Paint Sample Weight";
- ot->idname= "PAINT_OT_weight_sample";
+ ot->name = "Weight Paint Sample Weight";
+ ot->idname = "PAINT_OT_weight_sample";
/* api callbacks */
- ot->invoke= weight_sample_invoke;
- ot->poll= weight_paint_mode_poll;
+ ot->invoke = weight_sample_invoke;
+ ot->poll = weight_paint_mode_poll;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
}
/* samples cursor location, and gives menu with vertex groups to activate */
static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
{
if (C) {
- wmWindow *win= CTX_wm_window(C);
- if(win && win->eventstate) {
+ wmWindow *win = CTX_wm_window(C);
+ if (win && win->eventstate) {
ViewContext vc;
Mesh *me;
view3d_set_viewcontext(C, &vc);
- me= get_mesh(vc.obact);
+ me = get_mesh(vc.obact);
if (me && me->dvert && vc.v3d && vc.rv3d) {
int index;
view3d_operator_needs_opengl(C);
- index= view3d_sample_backbuf(&vc, win->eventstate->x - vc.ar->winrct.xmin, win->eventstate->y - vc.ar->winrct.ymin);
+ index = view3d_sample_backbuf(&vc, win->eventstate->x - vc.ar->winrct.xmin, win->eventstate->y - vc.ar->winrct.ymin);
- if(index && index<=me->totpoly) {
- const int defbase_tot= BLI_countlist(&vc.obact->defbase);
- if(defbase_tot) {
- MPoly *mf= ((MPoly *)me->mpoly) + index-1;
- unsigned int fidx= mf->totloop - 1;
- int *groups= MEM_callocN(defbase_tot*sizeof(int), "groups");
- int found= FALSE;
+ if (index && index <= me->totpoly) {
+ const int defbase_tot = BLI_countlist(&vc.obact->defbase);
+ if (defbase_tot) {
+ MPoly *mf = ((MPoly *)me->mpoly) + index - 1;
+ unsigned int fidx = mf->totloop - 1;
+ int *groups = MEM_callocN(defbase_tot * sizeof(int), "groups");
+ int found = FALSE;
do {
- MDeformVert *dvert= me->dvert + me->mloop[mf->loopstart + fidx].v;
- int i= dvert->totweight;
+ MDeformVert *dvert = me->dvert + me->mloop[mf->loopstart + fidx].v;
+ int i = dvert->totweight;
MDeformWeight *dw;
- for(dw= dvert->dw; i > 0; dw++, i--) {
+ for (dw = dvert->dw; i > 0; dw++, i--) {
if (dw->def_nr < defbase_tot) {
- groups[dw->def_nr]= TRUE;
- found= TRUE;
+ groups[dw->def_nr] = TRUE;
+ found = TRUE;
}
}
} while (fidx--);
- if(found==FALSE) {
+ if (found == FALSE) {
MEM_freeN(groups);
}
else {
- EnumPropertyItem *item= NULL, item_tmp= {0};
- int totitem= 0;
- int i= 0;
+ EnumPropertyItem *item = NULL, item_tmp = {0};
+ int totitem = 0;
+ int i = 0;
bDeformGroup *dg;
- for(dg= vc.obact->defbase.first; dg && i<defbase_tot; i++, dg= dg->next) {
- if(groups[i]) {
- item_tmp.identifier= item_tmp.name= dg->name;
- item_tmp.value= i;
+ for (dg = vc.obact->defbase.first; dg && i < defbase_tot; i++, dg = dg->next) {
+ if (groups[i]) {
+ item_tmp.identifier = item_tmp.name = dg->name;
+ item_tmp.value = i;
RNA_enum_item_add(&item, &totitem, &item_tmp);
}
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
MEM_freeN(groups);
return item;
@@ -1167,48 +1162,48 @@ static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA
static int weight_sample_group_exec(bContext *C, wmOperator *op)
{
- int type= RNA_enum_get(op->ptr, "group");
+ int type = RNA_enum_get(op->ptr, "group");
ViewContext vc;
view3d_set_viewcontext(C, &vc);
BLI_assert(type + 1 >= 0);
- vc.obact->actdef= type + 1;
+ vc.obact->actdef = type + 1;
DAG_id_tag_update(&vc.obact->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, vc.obact);
+ WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, vc.obact);
return OPERATOR_FINISHED;
}
/* TODO, we could make this a menu into OBJECT_OT_vertex_group_set_active rather than its own operator */
void PAINT_OT_weight_sample_group(wmOperatorType *ot)
{
- PropertyRNA *prop= NULL;
+ PropertyRNA *prop = NULL;
/* identifiers */
- ot->name= "Weight Paint Sample Group";
- ot->idname= "PAINT_OT_weight_sample_group";
+ ot->name = "Weight Paint Sample Group";
+ ot->idname = "PAINT_OT_weight_sample_group";
/* api callbacks */
- ot->exec= weight_sample_group_exec;
- ot->invoke= WM_menu_invoke;
- ot->poll= weight_paint_mode_poll;
+ ot->exec = weight_sample_group_exec;
+ ot->invoke = WM_menu_invoke;
+ ot->poll = weight_paint_mode_poll;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* keyingset to use (dynamic enum) */
- prop= RNA_def_enum(ot->srna, "group", DummyRNA_DEFAULT_items, 0, "Keying Set", "The Keying Set to use");
+ prop = RNA_def_enum(ot->srna, "group", DummyRNA_DEFAULT_items, 0, "Keying Set", "The Keying Set to use");
RNA_def_enum_funcs(prop, weight_paint_sample_enum_itemf);
- ot->prop= prop;
+ ot->prop = prop;
}
static void do_weight_paint_normalize_all(MDeformVert *dvert, const int defbase_tot, const char *vgroup_validmap)
{
- float sum= 0.0f, fac;
- unsigned int i, tot=0;
+ float sum = 0.0f, fac;
+ unsigned int i, tot = 0;
MDeformWeight *dw;
- for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+ for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) {
tot++;
sum += dw->weight;
@@ -1220,11 +1215,11 @@ static void do_weight_paint_normalize_all(MDeformVert *dvert, const int defbase_
}
if (sum != 0.0f) {
- fac= 1.0f / sum;
+ fac = 1.0f / sum;
- for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+ for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) {
- dw->weight *= fac;
+ dw->weight *= fac;
}
}
}
@@ -1232,7 +1227,7 @@ static void do_weight_paint_normalize_all(MDeformVert *dvert, const int defbase_
/* hrmf, not a factor in this case */
fac = 1.0f / tot;
- for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+ for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) {
dw->weight = fac;
}
@@ -1247,12 +1242,12 @@ static void do_weight_paint_normalize_all(MDeformVert *dvert, const int defbase_
static void do_weight_paint_normalize_all_active(MDeformVert *dvert, const int defbase_tot, const char *vgroup_validmap,
const int vgroup_active)
{
- float sum= 0.0f, fac;
- unsigned int i, tot=0;
+ float sum = 0.0f, fac;
+ unsigned int i, tot = 0;
MDeformWeight *dw;
float act_weight = 0.0f;
- for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+ for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) {
if (dw->def_nr != vgroup_active) {
sum += dw->weight;
@@ -1271,7 +1266,7 @@ static void do_weight_paint_normalize_all_active(MDeformVert *dvert, const int d
if (sum != 0.0f) {
fac = (1.0f / sum) * (1.0f - act_weight);
- for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+ for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) {
if (dw->def_nr != vgroup_active) {
dw->weight *= fac;
@@ -1291,7 +1286,7 @@ static void do_weight_paint_normalize_all_active(MDeformVert *dvert, const int d
/* paranoid but possibly with float error */
CLAMP(fac, 0.0f, 1.0f);
- for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+ for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) {
if (dw->def_nr != vgroup_active) {
dw->weight = fac;
@@ -1302,15 +1297,15 @@ 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)
{
int i;
MDeformWeight *dw;
- for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+ for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
if (dw->def_nr < defbase_tot) {
if (bone_groups[dw->def_nr] && lock_flags[dw->def_nr] && dw->weight > 0.0f) {
return TRUE;
@@ -1321,17 +1316,17 @@ static char has_locked_group(MDeformVert *dvert, const int defbase_tot,
}
/*
* gen_lck_flags gets the status of "flag" for each bDeformGroup
- *in ob->defbase and returns an array containing them
+ * in ob->defbase and returns an array containing them
*/
-static char *gen_lock_flags(Object* ob, int defbase_tot)
+static char *gen_lock_flags(Object *ob, int defbase_tot)
{
char is_locked = FALSE;
int i;
//int defbase_tot = BLI_countlist(&ob->defbase);
- char *lock_flags = MEM_mallocN(defbase_tot*sizeof(char), "defflags");
+ char *lock_flags = MEM_mallocN(defbase_tot * sizeof(char), "defflags");
bDeformGroup *defgroup;
- for(i = 0, defgroup = ob->defbase.first; i < defbase_tot && defgroup; defgroup = defgroup->next, i++) {
+ for (i = 0, defgroup = ob->defbase.first; i < defbase_tot && defgroup; defgroup = defgroup->next, i++) {
lock_flags[i] = ((defgroup->flag & DG_LOCK_WEIGHT) != 0);
is_locked |= lock_flags[i];
}
@@ -1346,8 +1341,8 @@ static char *gen_lock_flags(Object* ob, int defbase_tot)
static int has_locked_group_selected(int defbase_tot, const char *defbase_sel, const char *lock_flags)
{
int i;
- for(i = 0; i < defbase_tot; i++) {
- if(defbase_sel[i] && lock_flags[i]) {
+ for (i = 0; i < defbase_tot; i++) {
+ if (defbase_sel[i] && lock_flags[i]) {
return TRUE;
}
}
@@ -1359,11 +1354,11 @@ static int has_locked_group_selected(int defbase_tot, const char *defbase_sel, c
static int has_unselected_unlocked_bone_group(int defbase_tot, char *defbase_sel, int selected, char *lock_flags, char *vgroup_validmap)
{
int i;
- if(defbase_tot == selected) {
+ if (defbase_tot == selected) {
return FALSE;
}
- for(i = 0; i < defbase_tot; i++) {
- if(vgroup_validmap[i] && !defbase_sel[i] && !lock_flags[i]) {
+ for (i = 0; i < defbase_tot; i++) {
+ if (vgroup_validmap[i] && !defbase_sel[i] && !lock_flags[i]) {
return TRUE;
}
}
@@ -1378,30 +1373,30 @@ static void multipaint_selection(MDeformVert *dvert, const int defbase_tot, floa
MDeformWeight *dw;
float val;
/* make sure they are all at most 1 after the change */
- for(i = 0; i < defbase_tot; i++) {
- if(defbase_sel[i]) {
+ for (i = 0; i < defbase_tot; i++) {
+ if (defbase_sel[i]) {
dw = defvert_find_index(dvert, i);
- if(dw && dw->weight) {
+ if (dw && dw->weight) {
val = dw->weight * change;
- if(val > 1) {
+ if (val > 1) {
/* TODO: when the change is reduced, you need to recheck
* the earlier values to make sure they are not 0
* (precision error) */
- change = 1.0f/dw->weight;
+ change = 1.0f / dw->weight;
}
/* the value should never reach zero while multi-painting if it
* was nonzero beforehand */
- if(val <= 0) {
+ if (val <= 0) {
return;
}
}
}
}
/* apply the valid change */
- for(i = 0; i < defbase_tot; i++) {
- if(defbase_sel[i]) {
+ for (i = 0; i < defbase_tot; i++) {
+ if (defbase_sel[i]) {
dw = defvert_find_index(dvert, i);
- if(dw && dw->weight) {
+ if (dw && dw->weight) {
dw->weight = dw->weight * change;
}
}
@@ -1425,36 +1420,36 @@ static float redistribute_change(MDeformVert *ndv, const int defbase_tot,
/* assume there is no change until you see one */
was_change = FALSE;
/* change each group by the same amount each time */
- change = totchange/total_valid;
- for(i = 0; i < ndv->totweight && total_valid && totchange; i++) {
- ndw = (ndv->dw+i);
+ change = totchange / total_valid;
+ for (i = 0; i < ndv->totweight && total_valid && totchange; i++) {
+ ndw = (ndv->dw + i);
/* ignore anything outside the value range */
if (ndw->def_nr < defbase_tot) {
/* change only the groups with a valid status */
- if(change_status[ndw->def_nr] == change_me) {
+ if (change_status[ndw->def_nr] == change_me) {
oldval = ndw->weight;
/* if auto normalize is active, don't worry about upper bounds */
- if(do_auto_normalize == FALSE && ndw->weight + change > 1) {
- totchange -= 1-ndw->weight;
- ndw->weight = 1;
+ if (do_auto_normalize == FALSE && ndw->weight + change > 1) {
+ totchange -= 1.0f - ndw->weight;
+ ndw->weight = 1.0f;
/* stop the changes to this group */
change_status[ndw->def_nr] = changeto;
total_valid--;
}
- else if(ndw->weight + change < 0) { /* check the lower bound */
+ else if (ndw->weight + change < 0) { /* check the lower bound */
totchange -= ndw->weight;
ndw->weight = 0;
change_status[ndw->def_nr] = changeto;
total_valid--;
}
- else {/* a perfectly valid change occurred to ndw->weight */
+ else { /* a perfectly valid change occurred to ndw->weight */
totchange -= change;
ndw->weight += change;
}
/* see if there was a change */
- if(oldval != ndw->weight) {
+ if (oldval != ndw->weight) {
was_change = TRUE;
}
}
@@ -1462,7 +1457,7 @@ static float redistribute_change(MDeformVert *ndv, const int defbase_tot,
}
/* don't go again if there was no change, if there is no valid group,
* or there is no change left */
- } while(was_change && total_valid && totchange);
+ } while (was_change && total_valid && totchange);
/* left overs */
return totchange;
}
@@ -1489,17 +1484,17 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv,
char *change_status;
- if(!lock_flags || !has_locked_group(ndv, defbase_tot, vgroup_validmap, lock_flags)) {
+ if (!lock_flags || !has_locked_group(ndv, defbase_tot, vgroup_validmap, lock_flags)) {
return;
}
/* record if a group was changed, unlocked and not changed, or locked */
- change_status = MEM_callocN(sizeof(char)*defbase_tot, "unlocked_unchanged");
+ change_status = MEM_callocN(sizeof(char) * defbase_tot, "unlocked_unchanged");
- for(i = 0; i < defbase_tot; i++) {
+ for (i = 0; i < defbase_tot; i++) {
ndw = defvert_find_index(ndv, i);
odw = defvert_find_index(odv, i);
/* the weights are zero, so we can assume a lot */
- if(!ndw || !odw) {
+ if (!ndw || !odw) {
if (!lock_flags[i] && vgroup_validmap[i]) {
defvert_verify_index(odv, i);
defvert_verify_index(ndv, i);
@@ -1509,10 +1504,10 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv,
continue;
}
/* locked groups should not be changed */
- if(lock_flags[i]) {
+ if (lock_flags[i]) {
ndw->weight = odw->weight;
}
- else if(ndw->weight != odw->weight) { /* changed groups are handled here */
+ else if (ndw->weight != odw->weight) { /* changed groups are handled here */
totchange += ndw->weight - odw->weight;
changed_sum += ndw->weight;
change_status[i] = 2; /* was altered already */
@@ -1525,26 +1520,26 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv,
}
}
/* if there was any change, redistribute it */
- if(total_changed) {
+ if (total_changed) {
/* auto normalize will allow weights to temporarily go above 1 in redistribution */
- if(vgroup_validmap && total_changed < 0 && total_valid) {
+ if (vgroup_validmap && total_changed < 0 && total_valid) {
totchange_allowed = total_valid;
}
- /* the way you modify the unlocked+unchanged groups is different depending
+ /* the way you modify the unlocked + unchanged groups is different depending
* on whether or not you are painting the weight(s) up or down */
- if(totchange < 0) {
+ if (totchange < 0) {
totchange_allowed = total_valid - totchange_allowed;
}
else {
totchange_allowed *= -1;
}
/* there needs to be change allowed, or you should not bother */
- if(totchange_allowed) {
+ if (totchange_allowed) {
left_over = 0;
- if(fabsf(totchange_allowed) < fabsf(totchange)) {
+ if (fabsf(totchange_allowed) < fabsf(totchange)) {
/* this amount goes back onto the changed, unlocked weights */
left_over = fabsf(fabsf(totchange) - fabsf(totchange_allowed));
- if(totchange > 0) {
+ if (totchange > 0) {
left_over *= -1;
}
}
@@ -1555,9 +1550,9 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv,
/* move the weight evenly between the allowed groups, move excess back onto the used groups based on the change */
totchange_allowed = redistribute_change(ndv, defbase_tot, change_status, 1, -1, totchange_allowed, total_valid, do_auto_normalize);
left_over += totchange_allowed;
- if(left_over) {
+ if (left_over) {
/* more than one nonzero weights were changed with the same ratio with multipaint, so keep them changed that way! */
- if(total_changed > 1 && do_multipaint) {
+ if (total_changed > 1 && do_multipaint) {
float undo_change = get_mp_change(ndv, defbase_tot, defbase_sel, left_over);
multipaint_selection(ndv, defbase_tot, undo_change, defbase_sel);
}
@@ -1570,11 +1565,11 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv,
else {
/* reset the weights */
unsigned int i;
- MDeformWeight *dw_old= odv->dw;
- MDeformWeight *dw_new= ndv->dw;
+ MDeformWeight *dw_old = odv->dw;
+ MDeformWeight *dw_new = ndv->dw;
- for (i= odv->totweight; i != 0; i--, dw_old++, dw_new++) {
- dw_new->weight= dw_old->weight;
+ for (i = odv->totweight; i != 0; i--, dw_old++, dw_new++) {
+ dw_new->weight = dw_old->weight;
}
}
}
@@ -1587,17 +1582,17 @@ static float get_mp_change(MDeformVert *odv, const int defbase_tot, const char *
{
float selwsum = 0.0f;
unsigned int i;
- MDeformWeight *dw= odv->dw;
+ MDeformWeight *dw = odv->dw;
- for (i= odv->totweight; i != 0; i--, dw++) {
+ for (i = odv->totweight; i != 0; i--, dw++) {
if (dw->def_nr < defbase_tot) {
- if(defbase_sel[dw->def_nr]) {
+ if (defbase_sel[dw->def_nr]) {
selwsum += dw->weight;
}
}
}
- if(selwsum && selwsum+brush_change > 0) {
- return (selwsum+brush_change)/selwsum;
+ if (selwsum && selwsum + brush_change > 0) {
+ return (selwsum + brush_change) / selwsum;
}
return 0.0f;
}
@@ -1606,11 +1601,11 @@ static float get_mp_change(MDeformVert *odv, const int defbase_tot, const char *
* it assumes you already have the correct pointer index */
static void defvert_reset_to_prev(MDeformVert *dv_prev, MDeformVert *dv)
{
- MDeformWeight *dw= dv->dw;
+ MDeformWeight *dw = dv->dw;
MDeformWeight *dw_prev;
unsigned int i;
- for (i= dv->totweight; i != 0; i--, dw++) {
- dw_prev= defvert_find_index(dv_prev, dw->def_nr);
+ for (i = dv->totweight; i != 0; i--, dw++) {
+ dw_prev = defvert_find_index(dv_prev, dw->def_nr);
/* if there was no w when there is a d, then the old weight was 0 */
dw->weight = dw_prev ? dw_prev->weight : 0.0f;
}
@@ -1618,9 +1613,9 @@ static void defvert_reset_to_prev(MDeformVert *dv_prev, MDeformVert *dv)
static void clamp_weights(MDeformVert *dvert)
{
- MDeformWeight *dw= dvert->dw;
+ MDeformWeight *dw = dvert->dw;
unsigned int i;
- for (i= dvert->totweight; i != 0; i--, dw++) {
+ for (i = dvert->totweight; i != 0; i--, dw++) {
CLAMP(dw->weight, 0.0f, 1.0f);
}
}
@@ -1667,10 +1662,10 @@ static int apply_mp_locks_normalize(Mesh *me, const WeightPaintInfo *wpi,
float change, float oldChange,
float oldw, float neww)
{
- MDeformVert *dv= &me->dvert[index];
- MDeformVert dv_test= {NULL};
+ MDeformVert *dv = &me->dvert[index];
+ MDeformVert dv_test = {NULL};
- dv_test.dw= MEM_dupallocN(dv->dw);
+ dv_test.dw = MEM_dupallocN(dv->dw);
dv_test.flag = dv->flag;
dv_test.totweight = dv->totweight;
/* do not multi-paint if a locked group is selected or the active group is locked
@@ -1679,8 +1674,8 @@ static int apply_mp_locks_normalize(Mesh *me, const WeightPaintInfo *wpi,
((wpi->lock_flags[dw->def_nr] == FALSE) && /* def_nr range has to be checked for by caller */
has_locked_group_selected(wpi->defbase_tot, wpi->defbase_sel, wpi->lock_flags) == FALSE))
{
- if(wpi->do_multipaint && wpi->defbase_tot_sel > 1) {
- if(change && change!=1) {
+ if (wpi->do_multipaint && wpi->defbase_tot_sel > 1) {
+ if (change && change != 1) {
multipaint_selection(dv, wpi->defbase_tot, change, wpi->defbase_sel);
}
}
@@ -1697,16 +1692,16 @@ static int apply_mp_locks_normalize(Mesh *me, const WeightPaintInfo *wpi,
do_weight_paint_normalize_all(dv, wpi->defbase_tot, wpi->vgroup_validmap);
}
- if(oldChange && wpi->do_multipaint && wpi->defbase_tot_sel > 1) {
- if(tdw->weight != oldw) {
- if(neww > oldw) {
- if(tdw->weight <= oldw) {
+ if (oldChange && wpi->do_multipaint && wpi->defbase_tot_sel > 1) {
+ if (tdw->weight != oldw) {
+ if (neww > oldw) {
+ if (tdw->weight <= oldw) {
MEM_freeN(dv_test.dw);
return TRUE;
}
}
else {
- if(tdw->weight >= oldw) {
+ if (tdw->weight >= oldw) {
MEM_freeN(dv_test.dw);
return TRUE;
}
@@ -1722,8 +1717,8 @@ static int apply_mp_locks_normalize(Mesh *me, const WeightPaintInfo *wpi,
static int get_first_selected_nonzero_weight(MDeformVert *dvert, const int defbase_tot, const char *defbase_sel)
{
int i;
- MDeformWeight *dw= dvert->dw;
- for(i=0; i< dvert->totweight; i++, dw++) {
+ MDeformWeight *dw = dvert->dw;
+ for (i = 0; i < dvert->totweight; i++, dw++) {
if (dw->def_nr < defbase_tot) {
if (defbase_sel[dw->def_nr] && dw->weight > 0.0f) {
return i;
@@ -1737,14 +1732,15 @@ static int get_first_selected_nonzero_weight(MDeformVert *dvert, const int defba
static char *wpaint_make_validmap(Object *ob);
-static void do_weight_paint_vertex(/* vars which remain the same for every vert */
- VPaint *wp, Object *ob, const WeightPaintInfo *wpi,
- /* vars which change on each stroke */
- const unsigned int index, float alpha, float paintweight
- )
+static void do_weight_paint_vertex(
+ /* vars which remain the same for every vert */
+ VPaint *wp, Object *ob, const WeightPaintInfo *wpi,
+ /* vars which change on each stroke */
+ const unsigned int index, float alpha, float paintweight
+ )
{
- Mesh *me= ob->data;
- MDeformVert *dv= &me->dvert[index];
+ Mesh *me = ob->data;
+ MDeformVert *dv = &me->dvert[index];
MDeformWeight *dw, *dw_prev;
@@ -1757,16 +1753,16 @@ static void do_weight_paint_vertex(/* vars which remain the same for every vert
const short do_multipaint_totsel = (wpi->do_multipaint && wpi->defbase_tot_sel > 1);
- if(wp->flag & VP_ONLYVGROUP) {
- dw= defvert_find_index(dv, wpi->vgroup_active);
- dw_prev= defvert_find_index(wp->wpaint_prev+index, wpi->vgroup_active);
+ if (wp->flag & VP_ONLYVGROUP) {
+ dw = defvert_find_index(dv, wpi->vgroup_active);
+ dw_prev = defvert_find_index(wp->wpaint_prev + index, wpi->vgroup_active);
}
else {
- dw= defvert_verify_index(dv, wpi->vgroup_active);
- dw_prev= defvert_verify_index(wp->wpaint_prev+index, wpi->vgroup_active);
+ dw = defvert_verify_index(dv, wpi->vgroup_active);
+ dw_prev = defvert_verify_index(wp->wpaint_prev + index, wpi->vgroup_active);
}
- if(dw==NULL || dw_prev==NULL) {
+ if (dw == NULL || dw_prev == NULL) {
return;
}
@@ -1836,7 +1832,7 @@ static void do_weight_paint_vertex(/* vars which remain the same for every vert
* can give wrong results [#26193], least confusing if normalize is done last */
/* apply mirror */
- if(index_mirr != -1) {
+ if (index_mirr != -1) {
/* copy, not paint again */
dw_mirr->weight = dw->weight;
}
@@ -1845,7 +1841,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 +1865,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.
*
@@ -1887,12 +1883,12 @@ static void do_weight_paint_vertex(/* vars which remain the same for every vert
/* use locks and/or multipaint */
float oldw;
float neww;
- float testw=0;
+ float testw = 0;
float change = 0;
float oldChange = 0;
int i;
MDeformWeight *tdw = NULL, *tdw_prev;
- MDeformVert dv_copy= {NULL};
+ MDeformVert dv_copy = {NULL};
oldw = dw->weight;
neww = wpaint_blend(wp, dw->weight, dw_prev->weight, alpha, paintweight,
@@ -1900,16 +1896,16 @@ static void do_weight_paint_vertex(/* vars which remain the same for every vert
/* setup multi-paint */
if (do_multipaint_totsel) {
- dv_copy.dw= MEM_dupallocN(dv->dw);
+ dv_copy.dw = MEM_dupallocN(dv->dw);
dv_copy.flag = dv->flag;
dv_copy.totweight = dv->totweight;
tdw = dw;
tdw_prev = dw_prev;
change = get_mp_change(&wp->wpaint_prev[index], wpi->defbase_tot, wpi->defbase_sel, neww - oldw);
- if(change) {
- if(!tdw->weight) {
+ if (change) {
+ if (!tdw->weight) {
i = get_first_selected_nonzero_weight(dv, wpi->defbase_tot, wpi->defbase_sel);
- if(i>=0) {
+ if (i >= 0) {
tdw = &(dv->dw[i]);
tdw_prev = defvert_verify_index(&wp->wpaint_prev[index], tdw->def_nr);
}
@@ -1917,14 +1913,14 @@ static void do_weight_paint_vertex(/* vars which remain the same for every vert
change = 0;
}
}
- if(change && tdw_prev->weight && tdw_prev->weight * change) {
- if(tdw->weight != tdw_prev->weight) {
- oldChange = tdw->weight/tdw_prev->weight;
- testw = tdw_prev->weight*change;
- if( testw > tdw_prev->weight ) {
- if(change > oldChange) {
+ if (change && tdw_prev->weight && tdw_prev->weight * change) {
+ if (tdw->weight != tdw_prev->weight) {
+ oldChange = tdw->weight / tdw_prev->weight;
+ testw = tdw_prev->weight * change;
+ if (testw > tdw_prev->weight) {
+ if (change > oldChange) {
/* reset the weights and use the new change */
- defvert_reset_to_prev(wp->wpaint_prev+index, dv);
+ defvert_reset_to_prev(wp->wpaint_prev + index, dv);
}
else {
/* the old change was more significant, so set
@@ -1933,8 +1929,8 @@ static void do_weight_paint_vertex(/* vars which remain the same for every vert
}
}
else {
- if(change < oldChange) {
- defvert_reset_to_prev(wp->wpaint_prev+index, dv);
+ if (change < oldChange) {
+ defvert_reset_to_prev(wp->wpaint_prev + index, dv);
}
else {
change = 0;
@@ -1948,12 +1944,12 @@ static void do_weight_paint_vertex(/* vars which remain the same for every vert
}
}
- if(apply_mp_locks_normalize(me, wpi, index, dw, tdw, change, oldChange, oldw, neww)) {
+ if (apply_mp_locks_normalize(me, wpi, index, dw, tdw, change, oldChange, oldw, neww)) {
defvert_reset_to_prev(&dv_copy, dv);
change = 0;
oldChange = 0;
}
- if(dv_copy.dw) {
+ if (dv_copy.dw) {
MEM_freeN(dv_copy.dw);
}
#if 0
@@ -1961,12 +1957,12 @@ static void do_weight_paint_vertex(/* vars which remain the same for every vert
dw = defvert_find_index(dv, vgroup);
#else
dw = NULL; /* UNUSED after assignment, set to NULL to ensuyre we don't
- * use again, we thats needed un-ifdef the line above */
+ * use again, we thats needed un-ifdef the line above */
(void)dw; /* quiet warnigns */
#endif
/* x mirror painting */
- if(index_mirr != -1) {
+ if (index_mirr != -1) {
/* copy, not paint again */
/* dw_mirr->weight = dw->weight; */ /* TODO, explain the logic in not assigning weight! - campbell */
@@ -1978,32 +1974,32 @@ static void do_weight_paint_vertex(/* vars which remain the same for every vert
/* *************** set wpaint operator ****************** */
-static int set_wpaint(bContext *C, wmOperator *UNUSED(op)) /* toggle */
+static int set_wpaint(bContext *C, wmOperator *UNUSED(op)) /* toggle */
{
- Object *ob= CTX_data_active_object(C);
- Scene *scene= CTX_data_scene(C);
- VPaint *wp= scene->toolsettings->wpaint;
+ Object *ob = CTX_data_active_object(C);
+ Scene *scene = CTX_data_scene(C);
+ VPaint *wp = scene->toolsettings->wpaint;
Mesh *me;
- me= get_mesh(ob);
- if(ob->id.lib || me==NULL) return OPERATOR_PASS_THROUGH;
+ me = get_mesh(ob);
+ if (ob->id.lib || me == NULL) return OPERATOR_PASS_THROUGH;
- if(ob->mode & OB_MODE_WEIGHT_PAINT) ob->mode &= ~OB_MODE_WEIGHT_PAINT;
+ if (ob->mode & OB_MODE_WEIGHT_PAINT) ob->mode &= ~OB_MODE_WEIGHT_PAINT;
else ob->mode |= OB_MODE_WEIGHT_PAINT;
/* 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) {
+ if (ob->mode & OB_MODE_WEIGHT_PAINT) {
Object *par;
- if(wp==NULL)
- wp= scene->toolsettings->wpaint= new_vpaint(1);
+ if (wp == NULL)
+ wp = scene->toolsettings->wpaint = new_vpaint(1);
paint_init(&wp->paint, PAINT_CURSOR_WEIGHT_PAINT);
paint_cursor_start(C, weight_paint_poll);
@@ -2011,11 +2007,11 @@ static int set_wpaint(bContext *C, wmOperator *UNUSED(op)) /* toggle */
mesh_octree_table(ob, NULL, NULL, 's');
/* verify if active weight group is also active bone */
- par= modifiers_isDeformedByArmature(ob);
- if(par && (par->mode & OB_MODE_POSE)) {
- bArmature *arm= par->data;
+ par = modifiers_isDeformedByArmature(ob);
+ if (par && (par->mode & OB_MODE_POSE)) {
+ bArmature *arm = par->data;
- if(arm->act_bone)
+ if (arm->act_bone)
ED_vgroup_select_by_name(ob, arm->act_bone->name);
}
}
@@ -2024,7 +2020,7 @@ static int set_wpaint(bContext *C, wmOperator *UNUSED(op)) /* toggle */
mesh_mirrtopo_table(NULL, 'e');
}
- WM_event_add_notifier(C, NC_SCENE|ND_MODE, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene);
return OPERATOR_FINISHED;
}
@@ -2032,12 +2028,12 @@ static int set_wpaint(bContext *C, wmOperator *UNUSED(op)) /* toggle */
/* for switching to/from mode */
static int paint_poll_test(bContext *C)
{
- Object *ob= CTX_data_active_object(C);
- if(CTX_data_edit_object(C))
+ Object *ob = CTX_data_active_object(C);
+ if (CTX_data_edit_object(C))
return 0;
- if(CTX_data_active_object(C)==NULL)
+ if (CTX_data_active_object(C) == NULL)
return 0;
- if(!ob->data || ((ID *)ob->data)->lib)
+ if (!ob->data || ((ID *)ob->data)->lib)
return 0;
return 1;
}
@@ -2046,15 +2042,15 @@ void PAINT_OT_weight_paint_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Weight Paint Mode";
- ot->idname= "PAINT_OT_weight_paint_toggle";
+ ot->name = "Weight Paint Mode";
+ ot->idname = "PAINT_OT_weight_paint_toggle";
/* api callbacks */
- ot->exec= set_wpaint;
- ot->poll= paint_poll_test;
+ ot->exec = set_wpaint;
+ ot->poll = paint_poll_test;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
@@ -2068,8 +2064,8 @@ struct WPaintData {
float *vertexcosnos;
float wpimat[3][3];
- /*variables for auto normalize*/
- const char *vgroup_validmap; /*stores if vgroups tie to deforming bones or not*/
+ /* variables for auto normalize */
+ const char *vgroup_validmap; /* stores if vgroups tie to deforming bones or not */
const char *lock_flags;
int defbase_tot;
};
@@ -2080,32 +2076,32 @@ static char *wpaint_make_validmap(Object *ob)
ModifierData *md;
char *vgroup_validmap;
GHash *gh;
- int i, step1=1;
+ int i, step1 = 1;
- if(ob->defbase.first == NULL) {
+ if (ob->defbase.first == NULL) {
return NULL;
}
- gh= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "wpaint_make_validmap gh");
+ gh = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "wpaint_make_validmap gh");
- /*add all names to a hash table*/
- for (dg=ob->defbase.first; dg; dg=dg->next) {
+ /* add all names to a hash table */
+ for (dg = ob->defbase.first; dg; dg = dg->next) {
BLI_ghash_insert(gh, dg->name, NULL);
}
- /*now loop through the armature modifiers and identify deform bones*/
- for (md = ob->modifiers.first; md; md= !md->next && step1 ? (step1=0), modifiers_getVirtualModifierList(ob) : md->next) {
- if (!(md->mode & (eModifierMode_Realtime|eModifierMode_Virtual)))
+ /* now loop through the armature modifiers and identify deform bones */
+ for (md = ob->modifiers.first; md; md = !md->next && step1 ? (step1 = 0), modifiers_getVirtualModifierList(ob) : md->next) {
+ if (!(md->mode & (eModifierMode_Realtime | eModifierMode_Virtual)))
continue;
if (md->type == eModifierType_Armature) {
- ArmatureModifierData *amd= (ArmatureModifierData*) md;
+ ArmatureModifierData *amd = (ArmatureModifierData *) md;
- if(amd->object && amd->object->pose) {
- bPose *pose= amd->object->pose;
+ if (amd->object && amd->object->pose) {
+ bPose *pose = amd->object->pose;
bPoseChannel *chan;
- for (chan=pose->chanbase.first; chan; chan=chan->next) {
+ for (chan = pose->chanbase.first; chan; chan = chan->next) {
if (chan->bone->flag & BONE_NO_DEFORM)
continue;
@@ -2118,11 +2114,11 @@ static char *wpaint_make_validmap(Object *ob)
}
}
- vgroup_validmap= MEM_mallocN(BLI_ghash_size(gh), "wpaint valid map");
+ vgroup_validmap = MEM_mallocN(BLI_ghash_size(gh), "wpaint valid map");
- /*add all names to a hash table*/
- for (dg=ob->defbase.first, i=0; dg; dg=dg->next, i++) {
- vgroup_validmap[i]= (BLI_ghash_lookup(gh, dg->name) != NULL);
+ /* add all names to a hash table */
+ for (dg = ob->defbase.first, i = 0; dg; dg = dg->next, i++) {
+ vgroup_validmap[i] = (BLI_ghash_lookup(gh, dg->name) != NULL);
}
BLI_assert(i == BLI_ghash_size(gh));
@@ -2134,57 +2130,57 @@ static char *wpaint_make_validmap(Object *ob)
static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
struct PaintStroke *stroke = op->customdata;
- ToolSettings *ts= scene->toolsettings;
- VPaint *wp= ts->wpaint;
- Object *ob= CTX_data_active_object(C);
+ ToolSettings *ts = scene->toolsettings;
+ VPaint *wp = ts->wpaint;
+ Object *ob = CTX_data_active_object(C);
struct WPaintData *wpd;
Mesh *me;
bDeformGroup *dg;
float mat[4][4], imat[4][4];
- if(scene->obedit) {
+ if (scene->obedit) {
return FALSE;
}
- me= get_mesh(ob);
- if(me==NULL || me->totpoly==0) return OPERATOR_PASS_THROUGH;
+ me = get_mesh(ob);
+ if (me == NULL || me->totpoly == 0) return OPERATOR_PASS_THROUGH;
/* if nothing was added yet, we make dverts and a vertex deform group */
if (!me->dvert) {
ED_vgroup_data_create(&me->id);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, me);
}
/* this happens on a Bone select, when no vgroup existed yet */
if (ob->actdef <= 0) {
Object *modob;
- if((modob = modifiers_isDeformedByArmature(ob))) {
- Bone *actbone= ((bArmature *)modob->data)->act_bone;
- if(actbone) {
- bPoseChannel *pchan= get_pose_channel(modob->pose, actbone->name);
-
- if(pchan) {
- bDeformGroup *dg= defgroup_find_name(ob, pchan->name);
- if(dg==NULL) {
- dg= ED_vgroup_add_name(ob, pchan->name); /* sets actdef */
+ if ((modob = modifiers_isDeformedByArmature(ob))) {
+ Bone *actbone = ((bArmature *)modob->data)->act_bone;
+ if (actbone) {
+ bPoseChannel *pchan = get_pose_channel(modob->pose, actbone->name);
+
+ if (pchan) {
+ bDeformGroup *dg = defgroup_find_name(ob, pchan->name);
+ if (dg == NULL) {
+ dg = ED_vgroup_add_name(ob, pchan->name); /* sets actdef */
}
else {
int actdef = 1 + BLI_findindex(&ob->defbase, dg);
BLI_assert(actdef >= 0);
- ob->actdef= actdef;
+ ob->actdef = actdef;
}
}
}
}
}
- if(ob->defbase.first==NULL) {
+ if (ob->defbase.first == NULL) {
ED_vgroup_add(ob);
}
- /* ensure we dont try paint onto an invalid group */
+ /* ensure we don't try paint onto an invalid group */
if (ob->actdef <= 0) {
BKE_report(op->reports, RPT_WARNING, "No active vertex group for painting, aborting");
return FALSE;
@@ -2192,7 +2188,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED
/* check if we are attempting to paint onto a locked vertex group,
* and other options disallow it from doing anything useful */
- dg = BLI_findlink(&ob->defbase, (ob->actdef-1));
+ dg = BLI_findlink(&ob->defbase, (ob->actdef - 1));
if (dg->flag & DG_LOCK_WEIGHT) {
BKE_report(op->reports, RPT_WARNING, "Active group is locked, aborting");
return FALSE;
@@ -2200,7 +2196,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED
/* ALLOCATIONS! no return after this line */
/* make mode data storage */
- wpd= MEM_callocN(sizeof(struct WPaintData), "WPaintData");
+ wpd = MEM_callocN(sizeof(struct WPaintData), "WPaintData");
paint_stroke_set_mode_data(stroke, wpd);
view3d_set_viewcontext(C, &wpd->vc);
@@ -2208,7 +2204,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED
wpd->vgroup_mirror = -1;
/* set up auto-normalize, and generate map for detecting which
- * vgroups affect deform bones*/
+ * vgroups affect deform bones */
wpd->defbase_tot = BLI_countlist(&ob->defbase);
wpd->lock_flags = gen_lock_flags(ob, wpd->defbase_tot);
if (ts->auto_normalize || ts->multipaint || wpd->lock_flags) {
@@ -2216,8 +2212,8 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED
}
/* painting on subsurfs should give correct points too, this returns me->totvert amount */
- wpd->vertexcosnos= mesh_get_mapped_verts_nors(scene, ob);
- wpd->indexar= get_indexarray(me);
+ wpd->vertexcosnos = mesh_get_mapped_verts_nors(scene, ob);
+ wpd->indexar = get_indexarray(me);
copy_wpaint_prev(wp, me->dvert, me->totvert);
/* imat for normals */
@@ -2226,7 +2222,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED
copy_m3_m4(wpd->wpimat, imat);
/* if mirror painting, find the other group */
- if(me->editflag & ME_EDIT_MIRROR_X) {
+ if (me->editflag & ME_EDIT_MIRROR_X) {
wpd->vgroup_mirror = wpaint_mirror_vgroup_ensure(ob, wpd->vgroup_active);
}
@@ -2235,11 +2231,11 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED
static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr)
{
- Scene *scene= CTX_data_scene(C);
- ToolSettings *ts= CTX_data_tool_settings(C);
- VPaint *wp= ts->wpaint;
+ Scene *scene = CTX_data_scene(C);
+ ToolSettings *ts = CTX_data_tool_settings(C);
+ VPaint *wp = ts->wpaint;
Brush *brush = paint_brush(&wp->paint);
- struct WPaintData *wpd= paint_stroke_mode_data(stroke);
+ struct WPaintData *wpd = paint_stroke_mode_data(stroke);
ViewContext *vc;
Object *ob;
Mesh *me;
@@ -2258,7 +2254,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
const float brush_alpha_value = brush_alpha(scene, brush);
const float brush_alpha_pressure = brush_alpha_value * (brush_use_alpha_pressure(scene, brush) ? pressure : 1.0f);
- /* intentionally dont initialize as NULL, make sure we initialize all members below */
+ /* intentionally don't initialize as NULL, make sure we initialize all members below */
WeightPaintInfo wpi;
/* cannot paint if there is no stroke data */
@@ -2269,10 +2265,10 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
return;
}
- vc= &wpd->vc;
- ob= vc->obact;
- me= ob->data;
- indexar= wpd->indexar;
+ vc = &wpd->vc;
+ ob = vc->obact;
+ me = ob->data;
+ indexar = wpd->indexar;
view3d_operator_needs_opengl(C);
@@ -2280,93 +2276,93 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
mult_m4_m4m4(mat, vc->rv3d->persmat, ob->obmat);
RNA_float_get_array(itemptr, "mouse", mval);
- mval[0]-= vc->ar->winrct.xmin;
- mval[1]-= vc->ar->winrct.ymin;
+ mval[0] -= vc->ar->winrct.xmin;
+ mval[1] -= vc->ar->winrct.ymin;
/* *** setup WeightPaintInfo - pass onto do_weight_paint_vertex *** */
- wpi.defbase_tot= wpd->defbase_tot;
- defbase_sel= MEM_mallocN(wpi.defbase_tot*sizeof(char), "wpi.defbase_sel");
- wpi.defbase_tot_sel= get_selected_defgroups(ob, defbase_sel, wpi.defbase_tot);
- wpi.defbase_sel= defbase_sel; /* so we can stay const */
- if(wpi.defbase_tot_sel == 0 && ob->actdef > 0) wpi.defbase_tot_sel = 1;
-
- wpi.defbase_tot_unsel= wpi.defbase_tot - wpi.defbase_tot_sel;
- wpi.vgroup_active= wpd->vgroup_active;
- wpi.vgroup_mirror= wpd->vgroup_mirror;
- wpi.lock_flags= wpd->lock_flags;
- wpi.vgroup_validmap= wpd->vgroup_validmap;
- wpi.do_flip= RNA_boolean_get(itemptr, "pen_flip");
- wpi.do_multipaint= (ts->multipaint != 0);
- wpi.do_auto_normalize= ((ts->auto_normalize != 0) && (wpi.vgroup_validmap != NULL));
- wpi.brush_alpha_value= brush_alpha_value;
+ wpi.defbase_tot = wpd->defbase_tot;
+ defbase_sel = MEM_mallocN(wpi.defbase_tot * sizeof(char), "wpi.defbase_sel");
+ wpi.defbase_tot_sel = get_selected_defgroups(ob, defbase_sel, wpi.defbase_tot);
+ wpi.defbase_sel = defbase_sel; /* so we can stay const */
+ if (wpi.defbase_tot_sel == 0 && ob->actdef > 0) wpi.defbase_tot_sel = 1;
+
+ wpi.defbase_tot_unsel = wpi.defbase_tot - wpi.defbase_tot_sel;
+ wpi.vgroup_active = wpd->vgroup_active;
+ wpi.vgroup_mirror = wpd->vgroup_mirror;
+ wpi.lock_flags = wpd->lock_flags;
+ wpi.vgroup_validmap = wpd->vgroup_validmap;
+ wpi.do_flip = RNA_boolean_get(itemptr, "pen_flip");
+ wpi.do_multipaint = (ts->multipaint != 0);
+ wpi.do_auto_normalize = ((ts->auto_normalize != 0) && (wpi.vgroup_validmap != NULL));
+ wpi.brush_alpha_value = brush_alpha_value;
/* *** done setting up WeightPaintInfo *** */
swap_m4m4(wpd->vc.rv3d->persmat, mat);
- use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
+ use_vert_sel = (me->editflag & ME_EDIT_VERT_SEL) != 0;
/* which faces are involved */
- if(wp->flag & VP_AREA) {
+ if (wp->flag & VP_AREA) {
/* Ugly hack, to avoid drawing vertex index when getting the face index buffer - campbell */
me->editflag &= ~ME_EDIT_VERT_SEL;
- totindex= sample_backbuf_area(vc, indexar, me->totpoly, mval[0], mval[1], brush_size_pressure);
+ totindex = sample_backbuf_area(vc, indexar, me->totpoly, mval[0], mval[1], brush_size_pressure);
me->editflag |= use_vert_sel ? ME_EDIT_VERT_SEL : 0;
}
else {
- indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]);
- if(indexar[0]) totindex= 1;
- else totindex= 0;
+ indexar[0] = view3d_sample_backbuf(vc, mval[0], mval[1]);
+ if (indexar[0]) totindex = 1;
+ else totindex = 0;
}
- if(wp->flag & VP_COLINDEX) {
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totpoly) {
- MPoly *mpoly= ((MPoly *)me->mpoly) + (indexar[index]-1);
+ if (wp->flag & VP_COLINDEX) {
+ for (index = 0; index < totindex; index++) {
+ if (indexar[index] && indexar[index] <= me->totpoly) {
+ MPoly *mpoly = ((MPoly *)me->mpoly) + (indexar[index] - 1);
- if(mpoly->mat_nr!=ob->actcol-1) {
- indexar[index]= 0;
+ if (mpoly->mat_nr != ob->actcol - 1) {
+ indexar[index] = 0;
}
}
}
}
- if((me->editflag & ME_EDIT_PAINT_MASK) && me->mpoly) {
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totpoly) {
- MPoly *mpoly= ((MPoly *)me->mpoly) + (indexar[index]-1);
+ if ((me->editflag & ME_EDIT_PAINT_MASK) && me->mpoly) {
+ for (index = 0; index < totindex; index++) {
+ if (indexar[index] && indexar[index] <= me->totpoly) {
+ MPoly *mpoly = ((MPoly *)me->mpoly) + (indexar[index] - 1);
- if((mpoly->flag & ME_FACE_SEL)==0) {
- indexar[index]= 0;
+ if ((mpoly->flag & ME_FACE_SEL) == 0) {
+ indexar[index] = 0;
}
- }
+ }
}
}
-
+
/* make sure each vertex gets treated only once */
/* and calculate filter weight */
- totw= 0.0f;
+ totw = 0.0f;
if (brush->vertexpaint_tool == PAINT_BLEND_BLUR)
- paintweight= 0.0f;
+ paintweight = 0.0f;
else
- paintweight= ts->vgroup_weight;
+ paintweight = ts->vgroup_weight;
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totpoly) {
- MPoly *mpoly= me->mpoly + (indexar[index]-1);
+ for (index = 0; index < totindex; index++) {
+ if (indexar[index] && indexar[index] <= me->totpoly) {
+ MPoly *mpoly = me->mpoly + (indexar[index] - 1);
MLoop *ml = me->mloop + mpoly->loopstart;
int i;
- if(use_vert_sel) {
- for (i=0; i<mpoly->totloop; i++, ml++) {
+ if (use_vert_sel) {
+ for (i = 0; i < mpoly->totloop; i++, ml++) {
me->dvert[ml->v].flag = (me->mvert[ml->v].flag & SELECT);
}
}
else {
- for (i=0; i<mpoly->totloop; i++, ml++) {
+ for (i = 0; i < mpoly->totloop; i++, ml++) {
me->dvert[ml->v].flag = 1;
}
}
@@ -2374,15 +2370,15 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
if (brush->vertexpaint_tool == PAINT_BLEND_BLUR) {
MDeformWeight *dw, *(*dw_func)(MDeformVert *, const int);
- if(wp->flag & VP_ONLYVGROUP)
- dw_func= (MDeformWeight *(*)(MDeformVert *, const int))defvert_find_index;
+ if (wp->flag & VP_ONLYVGROUP)
+ dw_func = (MDeformWeight *(*)(MDeformVert *, const int))defvert_find_index;
else
- dw_func= defvert_verify_index;
+ dw_func = defvert_verify_index;
ml = me->mloop + mpoly->loopstart;
- for (i=0; i<mpoly->totloop; i++, ml++) {
- unsigned int vidx= ml->v;
- const float fac = calc_vp_strength_dl(wp, vc, wpd->vertexcosnos+6*vidx, mval, brush_size_pressure);
+ for (i = 0; i < mpoly->totloop; i++, ml++) {
+ unsigned int vidx = ml->v;
+ const float fac = calc_vp_strength_dl(wp, vc, wpd->vertexcosnos + 6 * vidx, mval, brush_size_pressure);
if (fac > 0.0f) {
dw = dw_func(&me->dvert[vidx], wpi.vgroup_active);
paintweight += dw ? (dw->weight * fac) : 0.0f;
@@ -2397,23 +2393,23 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
paintweight /= totw;
}
- for(index=0; index<totindex; index++) {
+ for (index = 0; index < totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totpoly) {
- MPoly *mpoly= me->mpoly + (indexar[index]-1);
- MLoop *ml=me->mloop+mpoly->loopstart;
+ if (indexar[index] && indexar[index] <= me->totpoly) {
+ MPoly *mpoly = me->mpoly + (indexar[index] - 1);
+ MLoop *ml = me->mloop + mpoly->loopstart;
int i;
- for (i=0; i<mpoly->totloop; i++, ml++) {
- unsigned int vidx= ml->v;
+ for (i = 0; i < mpoly->totloop; i++, ml++) {
+ unsigned int vidx = ml->v;
if (me->dvert[vidx].flag) {
- alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*vidx,
- mval, brush_size_pressure, brush_alpha_pressure);
- if(alpha) {
+ alpha = calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos + 6 * vidx,
+ mval, brush_size_pressure, brush_alpha_pressure);
+ if (alpha) {
do_weight_paint_vertex(wp, ob, &wpi, vidx, alpha, paintweight);
}
- me->dvert[vidx].flag= 0;
+ me->dvert[vidx].flag = 0;
}
}
}
@@ -2422,7 +2418,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
/* *** free wpi members */
MEM_freeN((void *)wpi.defbase_sel);
- /* *** dont freeing wpi members */
+ /* *** don't freeing wpi members */
swap_m4m4(vc->rv3d->persmat, mat);
@@ -2433,18 +2429,18 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
static void wpaint_stroke_done(bContext *C, struct PaintStroke *stroke)
{
- ToolSettings *ts= CTX_data_tool_settings(C);
- Object *ob= CTX_data_active_object(C);
- struct WPaintData *wpd= paint_stroke_mode_data(stroke);
+ ToolSettings *ts = CTX_data_tool_settings(C);
+ Object *ob = CTX_data_active_object(C);
+ struct WPaintData *wpd = paint_stroke_mode_data(stroke);
- if(wpd) {
- if(wpd->vertexcosnos)
+ if (wpd) {
+ if (wpd->vertexcosnos)
MEM_freeN(wpd->vertexcosnos);
MEM_freeN(wpd->indexar);
if (wpd->vgroup_validmap)
MEM_freeN((void *)wpd->vgroup_validmap);
- if(wpd->lock_flags)
+ if (wpd->lock_flags)
MEM_freeN((void *)wpd->lock_flags);
MEM_freeN(wpd);
@@ -2454,13 +2450,13 @@ static void wpaint_stroke_done(bContext *C, struct PaintStroke *stroke)
copy_wpaint_prev(ts->wpaint, NULL, 0);
/* and particles too */
- if(ob->particlesystem.first) {
+ if (ob->particlesystem.first) {
ParticleSystem *psys;
int i;
- for(psys= ob->particlesystem.first; psys; psys= psys->next) {
- for(i=0; i<PSYS_TOT_VG; i++) {
- if(psys->vgroup[i]==ob->actdef) {
+ for (psys = ob->particlesystem.first; psys; psys = psys->next) {
+ for (i = 0; i < PSYS_TOT_VG; i++) {
+ if (psys->vgroup[i] == ob->actdef) {
psys->recalc |= PSYS_RECALC_RESET;
break;
}
@@ -2498,25 +2494,25 @@ void PAINT_OT_weight_paint(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Weight Paint";
- ot->idname= "PAINT_OT_weight_paint";
+ ot->name = "Weight Paint";
+ ot->idname = "PAINT_OT_weight_paint";
/* api callbacks */
- ot->invoke= wpaint_invoke;
- ot->modal= paint_stroke_modal;
- /* ot->exec= vpaint_exec; <-- needs stroke property */
- ot->poll= weight_paint_poll;
- ot->cancel= wpaint_cancel;
+ ot->invoke = wpaint_invoke;
+ ot->modal = paint_stroke_modal;
+ /* ot->exec = vpaint_exec; <-- needs stroke property */
+ ot->poll = weight_paint_poll;
+ ot->cancel = wpaint_cancel;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
}
static int weight_paint_set_exec(bContext *C, wmOperator *UNUSED(op))
{
- struct Scene *scene= CTX_data_scene(C);
+ struct Scene *scene = CTX_data_scene(C);
Object *obact = CTX_data_active_object(C);
wpaint_fill(scene->toolsettings->wpaint, obact, scene->toolsettings->vgroup_weight);
@@ -2527,38 +2523,40 @@ static int weight_paint_set_exec(bContext *C, wmOperator *UNUSED(op))
void PAINT_OT_weight_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Weight";
- ot->idname= "PAINT_OT_weight_set";
+ ot->name = "Set Weight";
+ ot->idname = "PAINT_OT_weight_set";
/* api callbacks */
- ot->exec= weight_paint_set_exec;
- ot->poll= mask_paint_poll; /* it was facemask_paint_poll */
+ ot->exec = weight_paint_set_exec;
+ ot->poll = mask_paint_poll; /* it was facemask_paint_poll */
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* ************ set / clear vertex paint mode ********** */
-static int set_vpaint(bContext *C, wmOperator *op) /* toggle */
+static int set_vpaint(bContext *C, wmOperator *op) /* toggle */
{
- Object *ob= CTX_data_active_object(C);
- Scene *scene= CTX_data_scene(C);
- VPaint *vp= scene->toolsettings->vpaint;
+ Object *ob = CTX_data_active_object(C);
+ Scene *scene = CTX_data_scene(C);
+ VPaint *vp = scene->toolsettings->vpaint;
Mesh *me;
- me= get_mesh(ob);
+ me = get_mesh(ob);
- if(me==NULL || object_data_is_libdata(ob)) {
+ if (me == NULL || object_data_is_libdata(ob)) {
ob->mode &= ~OB_MODE_VERTEX_PAINT;
return OPERATOR_PASS_THROUGH;
}
- if(me && me->mloopcol==NULL) make_vertexcol(ob);
+ if (me && me->mloopcol == NULL) {
+ make_vertexcol(ob);
+ }
/* toggle: end vpaint */
- if(ob->mode & OB_MODE_VERTEX_PAINT) {
+ if (ob->mode & OB_MODE_VERTEX_PAINT) {
ob->mode &= ~OB_MODE_VERTEX_PAINT;
}
@@ -2568,8 +2566,8 @@ static int set_vpaint(bContext *C, wmOperator *op) /* toggle */
if (ob->mode & OB_MODE_WEIGHT_PAINT)
set_wpaint(C, op);
- if(vp==NULL)
- vp= scene->toolsettings->vpaint= new_vpaint(0);
+ if (vp == NULL)
+ vp = scene->toolsettings->vpaint = new_vpaint(0);
paint_cursor_start(C, vertex_paint_poll);
@@ -2580,7 +2578,7 @@ static int set_vpaint(bContext *C, wmOperator *op) /* toggle */
/* update modifier stack for mapping requirements */
DAG_id_tag_update(&me->id, 0);
- WM_event_add_notifier(C, NC_SCENE|ND_MODE, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene);
return OPERATOR_FINISHED;
}
@@ -2589,15 +2587,15 @@ void PAINT_OT_vertex_paint_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Vertex Paint Mode";
- ot->idname= "PAINT_OT_vertex_paint_toggle";
+ ot->name = "Vertex Paint Mode";
+ ot->idname = "PAINT_OT_vertex_paint_toggle";
/* api callbacks */
- ot->exec= set_vpaint;
- ot->poll= paint_poll_test;
+ ot->exec = set_vpaint;
+ ot->poll = paint_poll_test;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
@@ -2605,23 +2603,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;
@@ -2639,7 +2636,7 @@ typedef struct VPaintData {
* otherwise we need to refresh the modifier stack */
int use_fast_update;
- /*mpoly -> mface mapping*/
+ /* mpoly -> mface mapping */
MemArena *polyfacemap_arena;
ListBase *polyfacemap;
} VPaintData;
@@ -2651,10 +2648,10 @@ static void vpaint_build_poly_facemap(struct VPaintData *vd, Mesh *me)
int *origIndex;
int i;
- vd->polyfacemap_arena = BLI_memarena_new(1<<13, "vpaint tmp");
+ vd->polyfacemap_arena = BLI_memarena_new(1 << 13, "vpaint tmp");
BLI_memarena_use_calloc(vd->polyfacemap_arena);
- vd->polyfacemap = BLI_memarena_alloc(vd->polyfacemap_arena, sizeof(ListBase)*me->totpoly);
+ vd->polyfacemap = BLI_memarena_alloc(vd->polyfacemap_arena, sizeof(ListBase) * me->totpoly);
origIndex = CustomData_get_layer(&me->fdata, CD_POLYINDEX);
mf = me->mface;
@@ -2662,7 +2659,7 @@ static void vpaint_build_poly_facemap(struct VPaintData *vd, Mesh *me)
if (!origIndex)
return;
- for (i=0; i<me->totface; i++, mf++, origIndex++) {
+ for (i = 0; i < me->totface; i++, mf++, origIndex++) {
if (*origIndex == ORIGINDEX_NONE)
continue;
@@ -2675,32 +2672,32 @@ static void vpaint_build_poly_facemap(struct VPaintData *vd, Mesh *me)
static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent *UNUSED(event))
{
- ToolSettings *ts= CTX_data_tool_settings(C);
+ ToolSettings *ts = CTX_data_tool_settings(C);
struct PaintStroke *stroke = op->customdata;
- VPaint *vp= ts->vpaint;
+ VPaint *vp = ts->vpaint;
struct VPaintData *vpd;
- Object *ob= CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
Mesh *me;
float mat[4][4], imat[4][4];
/* context checks could be a poll() */
- me= get_mesh(ob);
- if(me==NULL || me->totpoly==0)
+ me = get_mesh(ob);
+ if (me == NULL || me->totpoly == 0)
return OPERATOR_PASS_THROUGH;
- if(me->mloopcol==NULL)
+ if (me->mloopcol == NULL)
make_vertexcol(ob);
- if(me->mloopcol==NULL)
+ if (me->mloopcol == NULL)
return OPERATOR_CANCELLED;
/* make mode data storage */
- vpd= MEM_callocN(sizeof(struct VPaintData), "VPaintData");
+ vpd = MEM_callocN(sizeof(struct VPaintData), "VPaintData");
paint_stroke_set_mode_data(stroke, vpd);
view3d_set_viewcontext(C, &vpd->vc);
- vpd->vertexcosnos= mesh_get_mapped_verts_nors(vpd->vc.scene, ob);
- vpd->indexar= get_indexarray(me);
- vpd->paintcol= vpaint_get_current_col(vp);
+ vpd->vertexcosnos = mesh_get_mapped_verts_nors(vpd->vc.scene, ob);
+ vpd->indexar = get_indexarray(me);
+ vpd->paintcol = vpaint_get_current_col(vp);
/* are we painting onto a modified mesh?,
@@ -2733,36 +2730,36 @@ static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob,
ViewContext *vc = &vpd->vc;
Brush *brush = paint_brush(&vp->paint);
Mesh *me = get_mesh(ob);
- MFace *mface= &me->mface[index];
- unsigned int *mcol= ((unsigned int*)me->mcol) + 4*index;
- unsigned int *mcolorig= ((unsigned int*)vp->vpaint_prev) + 4*index;
+ MFace *mface = &me->mface[index];
+ unsigned int *mcol = ((unsigned int *)me->mcol) + 4 * index;
+ unsigned int *mcolorig = ((unsigned int *)vp->vpaint_prev) + 4 * index;
float alpha;
int i;
int brush_alpha_pressure_i;
- if((vp->flag & VP_COLINDEX && mface->mat_nr!=ob->actcol-1) ||
- ((me->editflag & ME_EDIT_PAINT_MASK) && !(mface->flag & ME_FACE_SEL)))
+ if ((vp->flag & VP_COLINDEX && mface->mat_nr != ob->actcol - 1) ||
+ ((me->editflag & ME_EDIT_PAINT_MASK) && !(mface->flag & ME_FACE_SEL)))
return;
if (brush->vertexpaint_tool == PAINT_BLEND_BLUR) {
- unsigned int fcol1= mcol_blend( mcol[0], mcol[1], 128);
- if(mface->v4) {
- unsigned int fcol2= mcol_blend( mcol[2], mcol[3], 128);
- vpd->paintcol= mcol_blend( fcol1, fcol2, 128);
+ unsigned int fcol1 = mcol_blend(mcol[0], mcol[1], 128);
+ if (mface->v4) {
+ unsigned int fcol2 = mcol_blend(mcol[2], mcol[3], 128);
+ vpd->paintcol = mcol_blend(fcol1, fcol2, 128);
}
else {
- vpd->paintcol= mcol_blend( mcol[2], fcol1, 170);
+ vpd->paintcol = mcol_blend(mcol[2], fcol1, 170);
}
}
- brush_alpha_pressure_i = (int)(brush_alpha_pressure*255.0f);
+ brush_alpha_pressure_i = (int)(brush_alpha_pressure * 255.0f);
- for(i = 0; i < (mface->v4 ? 4 : 3); ++i) {
- alpha = calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*(&mface->v1)[i],
+ for (i = 0; i < (mface->v4 ? 4 : 3); ++i) {
+ alpha = calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos + 6 * (&mface->v1)[i],
mval, brush_size_pressure, brush_alpha_pressure);
if (alpha) {
- const int alpha_i = (int)(alpha*255.0f);
+ const int alpha_i = (int)(alpha * 255.0f);
mcol[i] = vpaint_blend(vp, mcol[i], mcolorig[i], vpd->paintcol, alpha_i, brush_alpha_pressure_i);
}
}
@@ -2780,25 +2777,25 @@ static void vpaint_paint_poly(VPaint *vp, VPaintData *vpd, Object *ob,
ViewContext *vc = &vpd->vc;
Brush *brush = paint_brush(&vp->paint);
Mesh *me = get_mesh(ob);
- MPoly *mpoly= &me->mpoly[index];
+ MPoly *mpoly = &me->mpoly[index];
MFace *mf;
MCol *mc;
MLoop *ml;
MLoopCol *mlc;
polyfacemap_e *e;
- unsigned int *lcol = ((unsigned int*)me->mloopcol) + mpoly->loopstart;
- unsigned int *lcolorig = ((unsigned int*)vp->vpaint_prev) + mpoly->loopstart;
+ unsigned int *lcol = ((unsigned int *)me->mloopcol) + mpoly->loopstart;
+ unsigned int *lcolorig = ((unsigned int *)vp->vpaint_prev) + mpoly->loopstart;
float alpha;
int i, j;
- int brush_alpha_pressure_i = (int)(brush_alpha_pressure*255.0f);
+ int brush_alpha_pressure_i = (int)(brush_alpha_pressure * 255.0f);
- if(brush->vertexpaint_tool == PAINT_BLEND_BLUR) {
+ if (brush->vertexpaint_tool == PAINT_BLEND_BLUR) {
unsigned int blend[4] = {0};
unsigned int tcol;
char *col;
- for (j=0; j<mpoly->totloop; j++) {
+ for (j = 0; j < mpoly->totloop; j++) {
col = (char *)(lcol + j);
blend[0] += col[0];
blend[1] += col[1];
@@ -2820,12 +2817,12 @@ static void vpaint_paint_poly(VPaint *vp, VPaintData *vpd, Object *ob,
}
ml = me->mloop + mpoly->loopstart;
- for (i=0; i<mpoly->totloop; i++, ml++) {
- alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat,
- vpd->vertexcosnos+6*ml->v, mval,
- brush_size_pressure, brush_alpha_pressure);
- if(alpha > 0.0f) {
- const int alpha_i = (int)(alpha*255.0f);
+ for (i = 0; i < mpoly->totloop; i++, ml++) {
+ alpha = calc_vp_alpha_dl(vp, vc, vpd->vpimat,
+ vpd->vertexcosnos + 6 * ml->v, mval,
+ brush_size_pressure, brush_alpha_pressure);
+ if (alpha > 0.0f) {
+ const int alpha_i = (int)(alpha * 255.0f);
lcol[i] = vpaint_blend(vp, lcol[i], lcolorig[i], vpd->paintcol, alpha_i, brush_alpha_pressure_i);
}
}
@@ -2837,23 +2834,23 @@ static void vpaint_paint_poly(VPaint *vp, VPaintData *vpd, Object *ob,
#endif
#define CPYCOL(c, l) (c)->a = (l)->a, (c)->r = (l)->r, (c)->g = (l)->g, (c)->b = (l)->b
- /* update vertex colors for tesselations incrementally,
- * rather then regenerating the tesselation altogether */
+ /* update vertex colors for tessellations incrementally,
+ * rather then regenerating the tessellation altogether */
for (e = vpd->polyfacemap[index].first; e; e = e->next) {
mf = me->mface + e->facenr;
- mc = me->mcol + e->facenr*4;
+ mc = me->mcol + e->facenr * 4;
ml = me->mloop + mpoly->loopstart;
mlc = me->mloopcol + mpoly->loopstart;
- for (j=0; j<mpoly->totloop; j++, ml++, mlc++) {
+ for (j = 0; j < mpoly->totloop; j++, ml++, mlc++) {
if (ml->v == mf->v1)
CPYCOL(mc, mlc);
else if (ml->v == mf->v2)
- CPYCOL(mc+1, mlc);
+ CPYCOL(mc + 1, mlc);
else if (ml->v == mf->v3)
- CPYCOL(mc+2, mlc);
+ CPYCOL(mc + 2, mlc);
else if (mf->v4 && ml->v == mf->v4)
- CPYCOL(mc+3, mlc);
+ CPYCOL(mc + 3, mlc);
}
}
@@ -2864,16 +2861,16 @@ static void vpaint_paint_poly(VPaint *vp, VPaintData *vpd, Object *ob,
static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr)
{
- Scene *scene= CTX_data_scene(C);
- ToolSettings *ts= CTX_data_tool_settings(C);
+ Scene *scene = CTX_data_scene(C);
+ ToolSettings *ts = CTX_data_tool_settings(C);
struct VPaintData *vpd = paint_stroke_mode_data(stroke);
- VPaint *vp= ts->vpaint;
+ VPaint *vp = ts->vpaint;
Brush *brush = paint_brush(&vp->paint);
- ViewContext *vc= &vpd->vc;
- Object *ob= vc->obact;
- Mesh *me= ob->data;
+ ViewContext *vc = &vpd->vc;
+ Object *ob = vc->obact;
+ Mesh *me = ob->data;
float mat[4][4];
- int *indexar= vpd->indexar;
+ int *indexar = vpd->indexar;
int totindex, index, flip;
float mval[2];
@@ -2891,40 +2888,40 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
/* load projection matrix */
mult_m4_m4m4(mat, vc->rv3d->persmat, ob->obmat);
- mval[0]-= vc->ar->winrct.xmin;
- mval[1]-= vc->ar->winrct.ymin;
+ mval[0] -= vc->ar->winrct.xmin;
+ mval[1] -= vc->ar->winrct.ymin;
/* which faces are involved */
- if(vp->flag & VP_AREA) {
- totindex= sample_backbuf_area(vc, indexar, me->totpoly, mval[0], mval[1], brush_size_pressure);
+ if (vp->flag & VP_AREA) {
+ totindex = sample_backbuf_area(vc, indexar, me->totpoly, mval[0], mval[1], brush_size_pressure);
}
else {
- indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]);
- if(indexar[0]) totindex= 1;
- else totindex= 0;
+ indexar[0] = view3d_sample_backbuf(vc, mval[0], mval[1]);
+ if (indexar[0]) totindex = 1;
+ else totindex = 0;
}
- if(vp->flag & VP_COLINDEX) {
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totpoly) {
- MPoly *mpoly= ((MPoly *)me->mpoly) + (indexar[index]-1);
+ if (vp->flag & VP_COLINDEX) {
+ for (index = 0; index < totindex; index++) {
+ if (indexar[index] && indexar[index] <= me->totpoly) {
+ MPoly *mpoly = ((MPoly *)me->mpoly) + (indexar[index] - 1);
- if(mpoly->mat_nr!=ob->actcol-1) {
- indexar[index]= 0;
+ if (mpoly->mat_nr != ob->actcol - 1) {
+ indexar[index] = 0;
}
}
}
}
- if((me->editflag & ME_EDIT_PAINT_MASK) && me->mpoly) {
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totpoly) {
- MPoly *mpoly= ((MPoly *)me->mpoly) + (indexar[index]-1);
+ if ((me->editflag & ME_EDIT_PAINT_MASK) && me->mpoly) {
+ for (index = 0; index < totindex; index++) {
+ if (indexar[index] && indexar[index] <= me->totpoly) {
+ MPoly *mpoly = ((MPoly *)me->mpoly) + (indexar[index] - 1);
- if((mpoly->flag & ME_FACE_SEL)==0)
- indexar[index]= 0;
+ if ((mpoly->flag & ME_FACE_SEL) == 0)
+ indexar[index] = 0;
}
}
}
@@ -2932,17 +2929,17 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
swap_m4m4(vc->rv3d->persmat, mat);
- for(index=0; index<totindex; index++) {
+ for (index = 0; index < totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totpoly) {
- vpaint_paint_poly(vp, vpd, ob, indexar[index]-1, mval, brush_size_pressure, brush_alpha_pressure, flip);
+ if (indexar[index] && indexar[index] <= me->totpoly) {
+ vpaint_paint_poly(vp, vpd, ob, indexar[index] - 1, mval, brush_size_pressure, brush_alpha_pressure, flip);
}
}
swap_m4m4(vc->rv3d->persmat, mat);
/* was disabled because it is slow, but necessary for blur */
- if(brush->vertexpaint_tool == PAINT_BLEND_BLUR) {
+ if (brush->vertexpaint_tool == PAINT_BLEND_BLUR) {
int do_tessface = vpd->use_fast_update;
do_shared_vertexcol(me, do_tessface);
}
@@ -2958,10 +2955,10 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
static void vpaint_stroke_done(bContext *C, struct PaintStroke *stroke)
{
- ToolSettings *ts= CTX_data_tool_settings(C);
- struct VPaintData *vpd= paint_stroke_mode_data(stroke);
+ ToolSettings *ts = CTX_data_tool_settings(C);
+ struct VPaintData *vpd = paint_stroke_mode_data(stroke);
- if(vpd->vertexcosnos)
+ if (vpd->vertexcosnos)
MEM_freeN(vpd->vertexcosnos);
MEM_freeN(vpd->indexar);
@@ -2979,8 +2976,8 @@ static int vpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
op->customdata = paint_stroke_new(C, NULL, vpaint_stroke_test_start,
- vpaint_stroke_update_step,
- vpaint_stroke_done, event->type);
+ vpaint_stroke_update_step,
+ vpaint_stroke_done, event->type);
/* add modal handler */
WM_event_add_modal_handler(C, op);
@@ -3000,18 +2997,18 @@ static int vpaint_cancel(bContext *C, wmOperator *op)
void PAINT_OT_vertex_paint(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Vertex Paint";
- ot->idname= "PAINT_OT_vertex_paint";
+ ot->name = "Vertex Paint";
+ ot->idname = "PAINT_OT_vertex_paint";
/* api callbacks */
- ot->invoke= vpaint_invoke;
- ot->modal= paint_stroke_modal;
- /* ot->exec= vpaint_exec; <-- needs stroke property */
- ot->poll= vertex_paint_poll;
- ot->cancel= vpaint_cancel;
+ ot->invoke = vpaint_invoke;
+ ot->modal = paint_stroke_modal;
+ /* ot->exec = vpaint_exec; <-- needs stroke property */
+ ot->poll = vertex_paint_poll;
+ ot->cancel = vpaint_cancel;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
}
@@ -3020,47 +3017,46 @@ void PAINT_OT_vertex_paint(wmOperatorType *ot)
static int weight_from_bones_poll(bContext *C)
{
- Object *ob= CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
return (ob && (ob->mode & OB_MODE_WEIGHT_PAINT) && modifiers_isDeformedByArmature(ob));
}
static int weight_from_bones_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_active_object(C);
- Object *armob= modifiers_isDeformedByArmature(ob);
- Mesh *me= ob->data;
- int type= RNA_enum_get(op->ptr, "type");
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = CTX_data_active_object(C);
+ Object *armob = modifiers_isDeformedByArmature(ob);
+ Mesh *me = ob->data;
+ int type = RNA_enum_get(op->ptr, "type");
create_vgroups_from_armature(op->reports, scene, ob, armob, type, (me->editflag & ME_EDIT_MIRROR_X));
DAG_id_tag_update(&me->id, 0);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, me);
return OPERATOR_FINISHED;
}
void PAINT_OT_weight_from_bones(wmOperatorType *ot)
{
- static EnumPropertyItem type_items[]= {
+ static EnumPropertyItem type_items[] = {
{ARM_GROUPS_AUTO, "AUTOMATIC", 0, "Automatic", "Automatic weights froms bones"},
{ARM_GROUPS_ENVELOPE, "ENVELOPES", 0, "From Envelopes", "Weights from envelopes with user defined radius"},
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Weight from Bones";
- ot->idname= "PAINT_OT_weight_from_bones";
+ ot->name = "Weight from Bones";
+ ot->idname = "PAINT_OT_weight_from_bones";
/* api callbacks */
- ot->exec= weight_from_bones_exec;
- ot->invoke= WM_menu_invoke;
- ot->poll= weight_from_bones_poll;
+ ot->exec = weight_from_bones_exec;
+ ot->invoke = WM_menu_invoke;
+ ot->poll = weight_from_bones_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "Method to use for assigning weights");
+ ot->prop = RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "Method to use for assigning weights");
}
-
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index dc25f2964e0..baf4e17b584 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -64,6 +64,7 @@
#include "BKE_report.h"
#include "BKE_lattice.h" /* for armature_deform_verts */
#include "BKE_node.h"
+#include "BKE_subsurf.h"
#include "BIF_glutil.h"
@@ -94,32 +95,32 @@
void ED_sculpt_force_update(bContext *C)
{
- Object *ob= CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
- if(ob && (ob->mode & OB_MODE_SCULPT))
+ if (ob && (ob->mode & OB_MODE_SCULPT))
multires_force_update(ob);
}
/* 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;
+ Mesh *me = (Mesh *)ob->data;
ModifierData *md;
- if(!CustomData_get_layer(&me->ldata, CD_MDISPS)) {
+ if (!CustomData_get_layer(&me->ldata, CD_MDISPS)) {
/* multires can't work without displacement layer */
return NULL;
}
- for(md= modifiers_getVirtualModifierList(ob); md; md= md->next) {
- if(md->type == eModifierType_Multires) {
- MultiresModifierData *mmd= (MultiresModifierData*)md;
+ for (md = modifiers_getVirtualModifierList(ob); md; md = md->next) {
+ if (md->type == eModifierType_Multires) {
+ MultiresModifierData *mmd = (MultiresModifierData *)md;
- if(!modifier_isEnabled(scene, md, eModifierMode_Realtime))
+ if (!modifier_isEnabled(scene, md, eModifierMode_Realtime))
continue;
- if(mmd->sculptlvl > 0) return mmd;
+ if (mmd->sculptlvl > 0) return mmd;
else return NULL;
}
}
@@ -132,11 +133,11 @@ static int sculpt_has_active_modifiers(Scene *scene, Object *ob)
{
ModifierData *md;
- md= modifiers_getVirtualModifierList(ob);
+ md = modifiers_getVirtualModifierList(ob);
/* exception for shape keys because we can edit those */
- for(; md; md= md->next) {
- if(modifier_isEnabled(scene, md, eModifierMode_Realtime))
+ for (; md; md = md->next) {
+ if (modifier_isEnabled(scene, md, eModifierMode_Realtime))
return 1;
}
@@ -147,25 +148,25 @@ static int sculpt_has_active_modifiers(Scene *scene, Object *ob)
static int sculpt_modifiers_active(Scene *scene, Sculpt *sd, Object *ob)
{
ModifierData *md;
- Mesh *me= (Mesh*)ob->data;
- MultiresModifierData *mmd= sculpt_multires_active(scene, ob);
+ Mesh *me = (Mesh *)ob->data;
+ MultiresModifierData *mmd = sculpt_multires_active(scene, ob);
- if(mmd) return 0;
+ if (mmd) return 0;
/* non-locked shape keys could be handled in the same way as deformed mesh */
- if((ob->shapeflag&OB_SHAPE_LOCK)==0 && me->key && ob->shapenr)
+ if ((ob->shapeflag & OB_SHAPE_LOCK) == 0 && me->key && ob->shapenr)
return 1;
- md= modifiers_getVirtualModifierList(ob);
+ md = modifiers_getVirtualModifierList(ob);
/* exception for shape keys because we can edit those */
- for(; md; md= md->next) {
+ for (; md; md = md->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
- if(!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
- if(md->type==eModifierType_ShapeKey) continue;
+ if (!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
+ if (md->type == eModifierType_ShapeKey) continue;
- if(mti->type==eModifierTypeType_OnlyDeform) return 1;
- else if((sd->flags & SCULPT_ONLY_DEFORM)==0) return 1;
+ if (mti->type == eModifierTypeType_OnlyDeform) return 1;
+ else if ((sd->flags & SCULPT_ONLY_DEFORM) == 0) return 1;
}
return 0;
@@ -178,10 +179,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;
@@ -193,7 +194,6 @@ typedef struct StrokeCache {
/* Variants */
float radius;
float radius_squared;
- //float traced_location[3];
float true_location[3];
float location[3];
@@ -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];
@@ -248,36 +248,36 @@ typedef struct StrokeCache {
/* Get a screen-space rectangle of the modified area */
static int sculpt_get_redraw_rect(ARegion *ar, RegionView3D *rv3d,
- Object *ob, rcti *rect)
+ Object *ob, rcti *rect)
{
SculptSession *ss;
- PBVH *pbvh= ob->sculpt->pbvh;
+ PBVH *pbvh = ob->sculpt->pbvh;
float bb_min[3], bb_max[3];
- if(!pbvh)
+ if (!pbvh)
return 0;
BLI_pbvh_redraw_BB(pbvh, bb_min, bb_max);
/* convert 3D bounding box to screen space */
- if(!paint_convert_bb_to_rect(rect,
- bb_min,
- bb_max,
- ar,
- rv3d,
- ob)) {
+ if (!paint_convert_bb_to_rect(rect,
+ bb_min,
+ bb_max,
+ ar,
+ rv3d,
+ ob)) {
return 0;
}
/* 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))
+ if (ss->cache) {
+ if (!BLI_rcti_is_empty(&ss->cache->previous_r))
BLI_union_rcti(rect, &ss->cache->previous_r);
}
@@ -285,9 +285,9 @@ static int sculpt_get_redraw_rect(ARegion *ar, RegionView3D *rv3d,
}
void sculpt_get_redraw_planes(float planes[4][4], ARegion *ar,
- RegionView3D *rv3d, Object *ob)
+ RegionView3D *rv3d, Object *ob)
{
- PBVH *pbvh= ob->sculpt->pbvh;
+ PBVH *pbvh = ob->sculpt->pbvh;
rcti rect;
sculpt_get_redraw_rect(ar, rv3d, ob, &rect);
@@ -295,7 +295,7 @@ void sculpt_get_redraw_planes(float planes[4][4], ARegion *ar,
paint_calc_redraw_planes(planes, ar, rv3d, ob, &rect);
/* clear redraw flag from nodes */
- if(pbvh)
+ if (pbvh)
BLI_pbvh_update(pbvh, PBVH_UpdateRedraw, NULL);
}
@@ -309,16 +309,16 @@ typedef struct SculptBrushTest {
static void sculpt_brush_test_init(SculptSession *ss, SculptBrushTest *test)
{
- test->radius_squared= ss->cache->radius_squared;
+ test->radius_squared = ss->cache->radius_squared;
copy_v3_v3(test->location, ss->cache->location);
- test->dist= 0.0f; /* just for initialize */
+ test->dist = 0.0f; /* just for initialize */
}
static int sculpt_brush_test(SculptBrushTest *test, float co[3])
{
float distsq = len_squared_v3v3(co, test->location);
- if(distsq <= test->radius_squared) {
+ if (distsq <= test->radius_squared) {
test->dist = sqrt(distsq);
return 1;
}
@@ -331,7 +331,7 @@ static int sculpt_brush_test_sq(SculptBrushTest *test, float co[3])
{
float distsq = len_squared_v3v3(co, test->location);
- if(distsq <= test->radius_squared) {
+ if (distsq <= test->radius_squared) {
test->dist = distsq;
return 1;
}
@@ -347,8 +347,7 @@ static int sculpt_brush_test_fast(SculptBrushTest *test, float co[3])
static int sculpt_brush_test_cube(SculptBrushTest *test, float co[3], float local[4][4])
{
- static const float side = 0.70710678118654752440084436210485; // sqrt(.5);
-
+ float side = M_SQRT1_2;
float local_co[3];
mul_v3_m4v3(local_co, local, co);
@@ -358,7 +357,11 @@ static int sculpt_brush_test_cube(SculptBrushTest *test, float co[3], float loca
local_co[2] = fabs(local_co[2]);
if (local_co[0] <= side && local_co[1] <= side && local_co[2] <= side) {
- test->dist = MAX3(local_co[0], local_co[1], local_co[2]) / side;
+ float p = 4;
+
+ test->dist = ((powf(local_co[0], p) +
+ powf(local_co[1], p) +
+ powf(local_co[2], p)) / pow(side, p));
return 1;
}
@@ -368,7 +371,7 @@ static int sculpt_brush_test_cube(SculptBrushTest *test, float co[3], float loca
}
static float frontface(Brush *brush, const float sculpt_normal[3],
- const short no[3], const float fno[3])
+ const short no[3], const float fno[3])
{
if (brush->flag & BRUSH_FRONTFACE) {
float dot;
@@ -377,10 +380,10 @@ static float frontface(Brush *brush, const float sculpt_normal[3],
float tmp[3];
normal_short_to_float_v3(tmp, no);
- dot= dot_v3v3(tmp, sculpt_normal);
+ dot = dot_v3v3(tmp, sculpt_normal);
}
else {
- dot= dot_v3v3(fno, sculpt_normal);
+ dot = dot_v3v3(fno, sculpt_normal);
}
return dot > 0 ? dot : 0;
}
@@ -401,7 +404,7 @@ static int sculpt_brush_test_cyl(SculptBrushTest *test, float co[3], float locat
cross_v3_v3v3(t3, an, t1);
- dist = len_v3(t3)/len_v3(t2);
+ dist = len_v3(t3) / len_v3(t2);
test->dist = dist;
@@ -418,20 +421,20 @@ static int sculpt_brush_test_cyl(SculptBrushTest *test, float co[3], float locat
*/
-static float overlapped_curve(Brush* br, float x)
+static float overlapped_curve(Brush *br, float x)
{
int i;
const int n = 100 / br->spacing;
const float h = br->spacing / 50.0f;
- const float x0 = x-1;
+ const float x0 = x - 1;
float sum;
sum = 0;
- for (i= 0; i < n; i++) {
+ for (i = 0; i < n; i++) {
float xx;
- xx = fabs(x0 + i*h);
+ xx = fabs(x0 + i * h);
if (xx < 1.0f)
sum += brush_curve_strength(br, xx, 1);
@@ -440,16 +443,16 @@ static float overlapped_curve(Brush* br, float x)
return sum;
}
-static float integrate_overlap(Brush* br)
+static float integrate_overlap(Brush *br)
{
int i;
- int m= 10;
- float g = 1.0f/m;
+ int m = 10;
+ float g = 1.0f / m;
float max;
- max= 0;
- for(i= 0; i < m; i++) {
- float overlap= overlapped_curve(br, i*g);
+ max = 0;
+ for (i = 0; i < m; i++) {
+ float overlap = overlapped_curve(br, i * g);
if (overlap > max)
max = overlap;
@@ -461,18 +464,18 @@ static float integrate_overlap(Brush* br)
/* Uses symm to selectively flip any axis of a coordinate. */
static void flip_coord(float out[3], float in[3], const char symm)
{
- if(symm & SCULPT_SYMM_X)
- out[0]= -in[0];
+ if (symm & SCULPT_SYMM_X)
+ out[0] = -in[0];
else
- out[0]= in[0];
- if(symm & SCULPT_SYMM_Y)
- out[1]= -in[1];
+ out[0] = in[0];
+ if (symm & SCULPT_SYMM_Y)
+ out[1] = -in[1];
else
- out[1]= in[1];
- if(symm & SCULPT_SYMM_Z)
- out[2]= -in[2];
+ out[1] = in[1];
+ if (symm & SCULPT_SYMM_Z)
+ out[2] = -in[2];
else
- out[2]= in[2];
+ out[2] = in[2];
}
static float calc_overlap(StrokeCache *cache, const char symm, const char axis, const float angle)
@@ -480,20 +483,20 @@ static float calc_overlap(StrokeCache *cache, const char symm, const char axis,
float mirror[3];
float distsq;
- //flip_coord(mirror, cache->traced_location, symm);
+ /* flip_coord(mirror, cache->traced_location, symm); */
flip_coord(mirror, cache->true_location, symm);
- if(axis != 0) {
- float mat[4][4]= MAT4_UNITY;
+ if (axis != 0) {
+ float mat[4][4] = MAT4_UNITY;
rotate_m4(mat, axis, angle);
mul_m4_v3(mat, mirror);
}
- //distsq = len_squared_v3v3(mirror, cache->traced_location);
+ /* distsq = len_squared_v3v3(mirror, cache->traced_location); */
distsq = len_squared_v3v3(mirror, cache->true_location);
- if (distsq <= 4.0f*(cache->radius_squared))
- return (2.0f*(cache->radius) - sqrtf(distsq)) / (2.0f*(cache->radius));
+ if (distsq <= 4.0f * (cache->radius_squared))
+ return (2.0f * (cache->radius) - sqrtf(distsq)) / (2.0f * (cache->radius));
else
return 0;
}
@@ -504,15 +507,15 @@ static float calc_radial_symmetry_feather(Sculpt *sd, StrokeCache *cache, const
float overlap;
overlap = 0;
- for(i = 1; i < sd->radial_symm[axis-'X']; ++i) {
- const float angle = 2*M_PI*i/sd->radial_symm[axis-'X'];
+ for (i = 1; i < sd->radial_symm[axis - 'X']; ++i) {
+ const float angle = 2 * M_PI * i / sd->radial_symm[axis - 'X'];
overlap += calc_overlap(cache, symm, axis, angle);
}
return overlap;
}
-static float calc_symmetry_feather(Sculpt *sd, StrokeCache* cache)
+static float calc_symmetry_feather(Sculpt *sd, StrokeCache *cache)
{
if (sd->flags & SCULPT_SYMMETRY_FEATHER) {
float overlap;
@@ -521,7 +524,7 @@ static float calc_symmetry_feather(Sculpt *sd, StrokeCache* cache)
overlap = 0;
for (i = 0; i <= symm; i++) {
- if(i == 0 || (symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5)))) {
+ if (i == 0 || (symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5)))) {
overlap += calc_overlap(cache, i, 0, 0);
@@ -531,7 +534,7 @@ static float calc_symmetry_feather(Sculpt *sd, StrokeCache* cache)
}
}
- return 1/overlap;
+ return 1 / overlap;
}
else {
return 1;
@@ -539,8 +542,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;
@@ -548,23 +551,23 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather)
/* Primary strength input; square it to make lower values more sensitive */
const float root_alpha = brush_alpha(scene, brush);
- float alpha = root_alpha*root_alpha;
+ float alpha = root_alpha * root_alpha;
float dir = brush->flag & BRUSH_DIR_IN ? -1 : 1;
float pressure = brush_use_alpha_pressure(scene, brush) ? cache->pressure : 1;
float pen_flip = cache->pen_flip ? -1 : 1;
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) &&
- (brush->spacing < 100)) ? 1.0f/accum : 1;
+ brush->flag & BRUSH_SPACE &&
+ !(brush->flag & BRUSH_ANCHORED) &&
+ (brush->spacing < 100)) ? 1.0f / accum : 1;
float flip = dir * invert * pen_flip;
- switch(brush->sculpt_tool){
+ switch (brush->sculpt_tool) {
case SCULPT_TOOL_CLAY:
- case SCULPT_TOOL_CLAY_TUBES:
+ case SCULPT_TOOL_CLAY_STRIPS:
case SCULPT_TOOL_DRAW:
case SCULPT_TOOL_LAYER:
return alpha * flip * pressure * overlap * feather;
@@ -585,7 +588,7 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather)
case SCULPT_TOOL_SCRAPE:
case SCULPT_TOOL_FLATTEN:
if (flip > 0) {
- overlap = (1+overlap) / 2;
+ overlap = (1 + overlap) / 2;
return alpha * flip * pressure * overlap * feather;
}
else {
@@ -605,11 +608,11 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather)
}
case SCULPT_TOOL_NUDGE:
- overlap = (1+overlap) / 2;
+ overlap = (1 + overlap) / 2;
return alpha * pressure * overlap * feather;
case SCULPT_TOOL_THUMB:
- return alpha*pressure*feather;
+ return alpha * pressure * feather;
case SCULPT_TOOL_SNAKE_HOOK:
return feather;
@@ -618,7 +621,7 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather)
return feather;
case SCULPT_TOOL_ROTATE:
- return alpha*pressure*feather;
+ return alpha * pressure * feather;
default:
return 0;
@@ -627,60 +630,61 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather)
/* Return a multiplier for brush strength on a particular vertex. */
static float tex_strength(SculptSession *ss, Brush *br, float point[3],
- const float len,
- const float sculpt_normal[3],
- const short vno[3],
- const float fno[3])
+ const float len,
+ const float sculpt_normal[3],
+ const short vno[3],
+ const float fno[3])
{
MTex *mtex = &br->mtex;
- float avg= 1;
+ float avg = 1;
- if(!mtex->tex) {
- avg= 1;
+ if (!mtex->tex) {
+ avg = 1;
}
- else if(mtex->brush_map_mode == MTEX_MAP_MODE_3D) {
+ else if (mtex->brush_map_mode == MTEX_MAP_MODE_3D) {
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);
+ &jnk, &jnk, &jnk, &jnk, 0);
}
- else if(ss->texcache) {
+ else if (ss->texcache) {
float rotation = -mtex->rot;
float symm_point[3], point_2d[2];
float x, y;
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) {
+ if (mtex->brush_map_mode == MTEX_MAP_MODE_FIXED) {
rotation += ss->cache->special_rotation;
point_2d[0] -= ss->cache->tex_mouse[0];
point_2d[1] -= ss->cache->tex_mouse[1];
- radius = ss->cache->pixel_radius; // use pressure adjusted size for fixed mode
+ /* use pressure adjusted size for fixed mode */
+ radius = ss->cache->pixel_radius;
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 */
- {
- radius = brush_size(ss->cache->vc->scene, br); // use unadjusted size for tiled mode
+ else { /* else (mtex->brush_map_mode == MTEX_MAP_MODE_TILED) */
+ /* leave the coordinates relative to the screen */
+
+ /* use unadjusted size for tiled mode */
+ radius = brush_size(ss->cache->vc->scene, br);
x = point_2d[0];
y = point_2d[1];
@@ -698,11 +702,11 @@ 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);
+ const float flen = sqrtf(x * x + y * y);
x = flen * cosf(angle);
y = flen * sinf(angle);
@@ -742,15 +746,15 @@ static int sculpt_search_sphere_cb(PBVHNode *node, void *data_v)
float t[3], bb_min[3], bb_max[3];
int i;
- if(data->original)
+ if (data->original)
BLI_pbvh_node_get_original_BB(node, bb_min, bb_max);
else
BLI_pbvh_node_get_BB(node, bb_min, bb_max);
- for(i = 0; i < 3; ++i) {
- if(bb_min[i] > center[i])
+ for (i = 0; i < 3; ++i) {
+ if (bb_min[i] > center[i])
nearest[i] = bb_min[i];
- else if(bb_max[i] < center[i])
+ else if (bb_max[i] < center[i])
nearest[i] = bb_max[i];
else
nearest[i] = center[i];
@@ -766,22 +770,23 @@ static void sculpt_clip(Sculpt *sd, SculptSession *ss, float *co, const float va
{
int i;
- for(i=0; i<3; ++i) {
- if(sd->flags & (SCULPT_LOCK_X << i))
+ for (i = 0; i < 3; ++i) {
+ if (sd->flags & (SCULPT_LOCK_X << i))
continue;
- if((ss->cache->flag & (CLIP_X << i)) && (fabsf(co[i]) <= ss->cache->clip_tolerance[i]))
- co[i]= 0.0f;
+ if ((ss->cache->flag & (CLIP_X << i)) && (fabsf(co[i]) <= ss->cache->clip_tolerance[i]))
+ co[i] = 0.0f;
else
- co[i]= val[i];
+ co[i] = val[i];
}
}
static void add_norm_if(float view_vec[3], float out[3], float out_flip[3], float fno[3])
{
- if((dot_v3v3(view_vec, fno)) > 0) {
+ if ((dot_v3v3(view_vec, fno)) > 0) {
add_v3_v3(out, fno);
- } else {
+ }
+ else {
add_v3_v3(out_flip, fno); /* out_flip is used when out is {0,0,0} */
}
}
@@ -798,19 +803,19 @@ static void calc_area_normal(Sculpt *sd, Object *ob, float an[3], PBVHNode **nod
zero_v3(an);
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n=0; n<totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
SculptUndoNode *unode;
float private_an[3] = {0.0f, 0.0f, 0.0f};
float private_out_flip[3] = {0.0f, 0.0f, 0.0f};
- unode = sculpt_undo_push_node(ob, nodes[n]);
+ unode = sculpt_undo_push_node(ob, nodes[n], SCULPT_UNDO_COORDS);
sculpt_brush_test_init(ss, &test);
- if(ss->cache->original) {
+ if (ss->cache->original) {
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test_fast(&test, unode->co[vd.i])) {
+ if (sculpt_brush_test_fast(&test, unode->co[vd.i])) {
float fno[3];
normal_short_to_float_v3(fno, unode->no[vd.i]);
@@ -821,8 +826,8 @@ static void calc_area_normal(Sculpt *sd, Object *ob, float an[3], PBVHNode **nod
}
else {
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test_fast(&test, vd.co)) {
- if(vd.no) {
+ if (sculpt_brush_test_fast(&test, vd.co)) {
+ if (vd.no) {
float fno[3];
normal_short_to_float_v3(fno, vd.no);
@@ -850,7 +855,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;
@@ -858,7 +863,7 @@ static void calc_sculpt_normal(Sculpt *sd, Object *ob, float an[3], PBVHNode **n
if (ss->cache->mirror_symmetry_pass == 0 &&
ss->cache->radial_symmetry_pass == 0 &&
- (ss->cache->first_time || !(brush->flag & BRUSH_ORIGINAL_NORMAL)))
+ (ss->cache->first_time || !(brush->flag & BRUSH_ORIGINAL_NORMAL)))
{
switch (brush->sculpt_plane) {
case SCULPT_DISP_DIR_VIEW:
@@ -900,32 +905,31 @@ 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]);
+ const MeshElemMap *vert_map = &ss->pmap[vert];
const MVert *mvert = ss->mvert;
float (*deform_co)[3] = ss->deform_cos;
zero_v3(avg);
/* Don't modify corner vertices */
- if(ncount != 1) {
- IndexNode *node;
- int total = 0;
+ if (vert_map->count > 1) {
+ int i, total = 0;
- for(node = ss->pmap[vert].first; node; node = node->next) {
- const MPoly *p= &ss->mpoly[node->index];
+ for (i = 0; i < vert_map->count; i++) {
+ const MPoly *p = &ss->mpoly[vert_map->indices[i]];
unsigned f_adj_v[3];
- if(poly_get_adj_loops_from_vert(f_adj_v, p, ss->mloop, vert) != -1) {
- int i;
+ if (poly_get_adj_loops_from_vert(f_adj_v, p, ss->mloop, vert) != -1) {
+ int j;
- for (i = 0; i < 3; i++) {
- if (ncount != 2 || BLI_countlist(&ss->pmap[f_adj_v[i]]) <= 2) {
- add_v3_v3(avg, deform_co ? deform_co[f_adj_v[i]] :
- mvert[f_adj_v[i]].co);
+ for (j = 0; j < 3; j++) {
+ if (vert_map->count != 2 || ss->pmap[f_adj_v[j]].count <= 2) {
+ add_v3_v3(avg, deform_co ? deform_co[f_adj_v[j]] :
+ mvert[f_adj_v[j]].co);
total++;
}
@@ -933,7 +937,7 @@ static void neighbor_average(SculptSession *ss, float avg[3], unsigned vert)
}
}
- if(total > 0) {
+ if (total > 0) {
mul_v3_fl(avg, 1.0f / total);
return;
}
@@ -953,9 +957,9 @@ static void do_mesh_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *node,
sculpt_brush_test_init(ss, &test);
BLI_pbvh_vertex_iter_begin(ss->pbvh, node, vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test(&test, vd.co)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist,
- ss->cache->view_normal, vd.no, vd.fno);
+ if (sculpt_brush_test(&test, vd.co)) {
+ const float fade = bstrength * tex_strength(ss, brush, vd.co, test.dist,
+ ss->cache->view_normal, vd.no, vd.fno);
float avg[3], val[3];
neighbor_average(ss, avg, vd.vert_indices[vd.i]);
@@ -966,8 +970,8 @@ static void do_mesh_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *node,
sculpt_clip(sd, ss, vd.co, val);
- if(vd.mvert)
- vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
+ if (vd.mvert)
+ vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
BLI_pbvh_vertex_iter_end;
@@ -988,34 +992,34 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no
CLAMP(bstrength, 0.0f, 1.0f);
BLI_pbvh_node_get_grids(ss->pbvh, node, &grid_indices, &totgrid,
- NULL, &gridsize, &griddata, &gridadj);
+ NULL, &gridsize, &griddata, &gridadj);
#pragma omp critical
{
- tmpgrid= MEM_mallocN(sizeof(float)*3*gridsize*gridsize, "tmpgrid");
- tmprow= MEM_mallocN(sizeof(float)*3*gridsize, "tmprow");
+ tmpgrid = MEM_mallocN(sizeof(float) * 3 * gridsize * gridsize, "tmpgrid");
+ tmprow = MEM_mallocN(sizeof(float) * 3 * gridsize, "tmprow");
}
- for(i = 0; i < totgrid; ++i) {
+ for (i = 0; i < totgrid; ++i) {
data = griddata[grid_indices[i]];
adj = &gridadj[grid_indices[i]];
- memset(tmpgrid, 0, sizeof(float)*3*gridsize*gridsize);
+ memset(tmpgrid, 0, sizeof(float) * 3 * gridsize * gridsize);
- for (y= 0; y < gridsize-1; y++) {
+ for (y = 0; y < gridsize - 1; y++) {
float tmp[3];
- v1 = y*gridsize;
- add_v3_v3v3(tmprow[0], data[v1].co, data[v1+gridsize].co);
+ v1 = y * gridsize;
+ add_v3_v3v3(tmprow[0], data[v1].co, data[v1 + gridsize].co);
- for (x= 0; x < gridsize-1; x++) {
- v1 = x + y*gridsize;
+ for (x = 0; x < gridsize - 1; x++) {
+ v1 = x + y * gridsize;
v2 = v1 + 1;
v3 = v1 + gridsize;
v4 = v3 + 1;
- add_v3_v3v3(tmprow[x+1], data[v2].co, data[v4].co);
- add_v3_v3v3(tmp, tmprow[x+1], tmprow[x]);
+ add_v3_v3v3(tmprow[x + 1], data[v2].co, data[v4].co);
+ add_v3_v3v3(tmp, tmprow[x + 1], tmprow[x]);
add_v3_v3(tmpgrid[v1], tmp);
add_v3_v3(tmpgrid[v2], tmp);
@@ -1025,42 +1029,42 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no
}
/* blend with existing coordinates */
- for(y = 0; y < gridsize; ++y) {
- for(x = 0; x < gridsize; ++x) {
+ for (y = 0; y < gridsize; ++y) {
+ for (x = 0; x < gridsize; ++x) {
float *co;
float *fno;
int index;
- if(x == 0 && adj->index[0] == -1)
+ if (x == 0 && adj->index[0] == -1)
continue;
- if(x == gridsize - 1 && adj->index[2] == -1)
+ if (x == gridsize - 1 && adj->index[2] == -1)
continue;
- if(y == 0 && adj->index[3] == -1)
+ if (y == 0 && adj->index[3] == -1)
continue;
- if(y == gridsize - 1 && adj->index[1] == -1)
+ if (y == gridsize - 1 && adj->index[1] == -1)
continue;
- index = x + y*gridsize;
- co= data[index].co;
- fno= data[index].no;
+ index = x + y * gridsize;
+ co = data[index].co;
+ fno = data[index].no;
- if(sculpt_brush_test(&test, co)) {
- const float fade = bstrength*tex_strength(ss, brush, co, test.dist,
- ss->cache->view_normal, NULL, fno);
+ if (sculpt_brush_test(&test, co)) {
+ const float fade = bstrength * tex_strength(ss, brush, co, test.dist,
+ ss->cache->view_normal, NULL, fno);
float *avg, val[3];
float n;
- avg = tmpgrid[x + y*gridsize];
+ avg = tmpgrid[x + y * gridsize];
- n = 1/16.0f;
+ n = 1 / 16.0f;
- if(x == 0 || x == gridsize - 1)
+ if (x == 0 || x == gridsize - 1)
n *= 2;
- if(y == 0 || y == gridsize - 1)
+ if (y == 0 || y == gridsize - 1)
n *= 2;
mul_v3_fl(avg, n);
@@ -1087,26 +1091,26 @@ static void smooth(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float
{
SculptSession *ss = ob->sculpt;
const int max_iterations = 4;
- const float fract = 1.0f/max_iterations;
+ const float fract = 1.0f / max_iterations;
int iteration, n, count;
float last;
CLAMP(bstrength, 0, 1);
- count = (int)(bstrength*max_iterations);
- last = max_iterations*(bstrength - count*fract);
+ count = (int)(bstrength * max_iterations);
+ last = max_iterations * (bstrength - count * fract);
- for(iteration = 0; iteration <= count; ++iteration) {
+ for (iteration = 0; iteration <= count; ++iteration) {
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n=0; n<totnode; n++) {
- if(ss->multires) {
+ for (n = 0; n < totnode; n++) {
+ if (ss->multires) {
do_multires_smooth_brush(sd, ss, nodes[n], iteration != count ? 1.0f : last);
}
- else if(ss->pmap)
+ else if (ss->pmap)
do_mesh_smooth_brush(sd, ss, nodes[n], iteration != count ? 1.0f : last);
}
- if(ss->multires)
+ if (ss->multires)
multires_stitch_grids(ob);
}
}
@@ -1122,7 +1126,7 @@ static void do_draw_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
SculptSession *ss = ob->sculpt;
Brush *brush = paint_brush(&sd->paint);
float offset[3], area_normal[3];
- float bstrength= ss->cache->bstrength;
+ float bstrength = ss->cache->bstrength;
int n;
calc_sculpt_normal(sd, ob, area_normal, nodes, totnode);
@@ -1134,12 +1138,12 @@ static void do_draw_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
/* threaded loop over nodes */
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n=0; n<totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
float (*proxy)[3];
- proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ proxy = BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
@@ -1147,11 +1151,11 @@ static void do_draw_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
if (sculpt_brush_test(&test, vd.co)) {
/* offset vertex */
float fade = tex_strength(ss, brush, vd.co, test.dist,
- area_normal, vd.no, vd.fno);
+ area_normal, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], offset, fade);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -1165,7 +1169,7 @@ static void do_crease_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
const Scene *scene = ss->cache->vc->scene;
Brush *brush = paint_brush(&sd->paint);
float offset[3], area_normal[3];
- float bstrength= ss->cache->bstrength;
+ float bstrength = ss->cache->bstrength;
float flippedbstrength, crease_correction;
int n;
@@ -1178,29 +1182,29 @@ static void do_crease_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
/* we divide out the squared alpha and multiply by the squared crease to give us the pinch strength */
- if(brush_alpha(scene, brush) > 0.0f)
- crease_correction = brush->crease_pinch_factor*brush->crease_pinch_factor/(brush_alpha(scene, brush)*brush_alpha(scene, brush));
+ if (brush_alpha(scene, brush) > 0.0f)
+ crease_correction = brush->crease_pinch_factor * brush->crease_pinch_factor / (brush_alpha(scene, brush) * brush_alpha(scene, brush));
else
- crease_correction = brush->crease_pinch_factor*brush->crease_pinch_factor;
+ crease_correction = brush->crease_pinch_factor * brush->crease_pinch_factor;
/* we always want crease to pinch or blob to relax even when draw is negative */
- flippedbstrength = (bstrength < 0) ? -crease_correction*bstrength : crease_correction*bstrength;
+ flippedbstrength = (bstrength < 0) ? -crease_correction * bstrength : crease_correction * bstrength;
- if(brush->sculpt_tool == SCULPT_TOOL_BLOB) flippedbstrength *= -1.0f;
+ if (brush->sculpt_tool == SCULPT_TOOL_BLOB) flippedbstrength *= -1.0f;
/* threaded loop over nodes */
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n=0; n<totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
float (*proxy)[3];
- proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ proxy = BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test(&test, vd.co)) {
+ if (sculpt_brush_test(&test, vd.co)) {
/* offset vertex */
const float fade = tex_strength(ss, brush, vd.co, test.dist,
area_normal, vd.no, vd.fno);
@@ -1209,15 +1213,14 @@ static void do_crease_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
/* first we pinch */
sub_v3_v3v3(val1, test.location, vd.co);
- //mul_v3_v3(val1, ss->cache->scale);
- mul_v3_fl(val1, fade*flippedbstrength);
+ mul_v3_fl(val1, fade * flippedbstrength);
/* then we draw */
mul_v3_v3fl(val2, offset, fade);
add_v3_v3v3(proxy[vd.i], val1, val2);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -1229,29 +1232,29 @@ static void do_pinch_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
{
SculptSession *ss = ob->sculpt;
Brush *brush = paint_brush(&sd->paint);
- float bstrength= ss->cache->bstrength;
+ float bstrength = ss->cache->bstrength;
int n;
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n=0; n<totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
float (*proxy)[3];
- proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ proxy = BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test(&test, vd.co)) {
- float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist,
- ss->cache->view_normal, vd.no, vd.fno);
+ if (sculpt_brush_test(&test, vd.co)) {
+ float fade = bstrength * tex_strength(ss, brush, vd.co, test.dist,
+ ss->cache->view_normal, vd.no, vd.fno);
float val[3];
sub_v3_v3v3(val, test.location, vd.co);
mul_v3_v3fl(proxy[vd.i], val, fade);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -1262,14 +1265,14 @@ static void do_pinch_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
static void do_grab_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
{
SculptSession *ss = ob->sculpt;
- Brush *brush= paint_brush(&sd->paint);
- float bstrength= ss->cache->bstrength;
+ Brush *brush = paint_brush(&sd->paint);
+ float bstrength = ss->cache->bstrength;
float grab_delta[3], an[3];
int n;
float len;
if (brush->normal_weight > 0 || brush->flag & BRUSH_FRONTFACE) {
- int cache= 1;
+ int cache = 1;
/* grab brush requires to test on original data */
SWAP(int, ss->cache->original, cache);
calc_sculpt_normal(sd, ob, an, nodes, totnode);
@@ -1281,36 +1284,37 @@ static void do_grab_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
len = len_v3(grab_delta);
if (brush->normal_weight > 0) {
- mul_v3_fl(an, len*brush->normal_weight);
+ mul_v3_fl(an, len * brush->normal_weight);
mul_v3_fl(grab_delta, 1.0f - brush->normal_weight);
add_v3_v3(grab_delta, an);
}
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n=0; n<totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
- SculptUndoNode* unode;
+ SculptUndoNode *unode;
SculptBrushTest test;
float (*origco)[3];
short (*origno)[3];
float (*proxy)[3];
- unode= sculpt_undo_push_node(ob, nodes[n]);
- origco= unode->co;
- origno= unode->no;
+ unode = sculpt_undo_push_node(ob, nodes[n], SCULPT_UNDO_COORDS);
+ origco = unode->co;
+ origno = unode->no;
- proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ proxy = BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
- BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test(&test, origco[vd.i])) {
- const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist,
- an, origno[vd.i], NULL);
+ BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE)
+ {
+ if (sculpt_brush_test(&test, origco[vd.i])) {
+ const float fade = bstrength * tex_strength(ss, brush, origco[vd.i], test.dist,
+ an, origno[vd.i], NULL);
mul_v3_v3fl(proxy[vd.i], grab_delta, fade);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -1336,23 +1340,23 @@ static void do_nudge_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
cross_v3_v3v3(cono, tmp, an);
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n = 0; n < totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
float (*proxy)[3];
- proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ proxy = BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test(&test, vd.co)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist,
- an, vd.no, vd.fno);
+ if (sculpt_brush_test(&test, vd.co)) {
+ const float fade = bstrength * tex_strength(ss, brush, vd.co, test.dist,
+ an, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], cono, fade);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -1380,29 +1384,29 @@ static void do_snake_hook_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
negate_v3(grab_delta);
if (brush->normal_weight > 0) {
- mul_v3_fl(an, len*brush->normal_weight);
+ mul_v3_fl(an, len * brush->normal_weight);
mul_v3_fl(grab_delta, 1.0f - brush->normal_weight);
add_v3_v3(grab_delta, an);
}
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n = 0; n < totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
float (*proxy)[3];
- proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ proxy = BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test(&test, vd.co)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist,
- an, vd.no, vd.fno);
+ if (sculpt_brush_test(&test, vd.co)) {
+ const float fade = bstrength * tex_strength(ss, brush, vd.co, test.dist,
+ an, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], grab_delta, fade);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -1428,30 +1432,30 @@ static void do_thumb_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
cross_v3_v3v3(cono, tmp, an);
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n = 0; n < totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
- SculptUndoNode* unode;
+ SculptUndoNode *unode;
SculptBrushTest test;
float (*origco)[3];
short (*origno)[3];
float (*proxy)[3];
- unode= sculpt_undo_push_node(ob, nodes[n]);
- origco= unode->co;
- origno= unode->no;
+ unode = sculpt_undo_push_node(ob, nodes[n], SCULPT_UNDO_COORDS);
+ origco = unode->co;
+ origno = unode->no;
- proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ proxy = BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test(&test, origco[vd.i])) {
- const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist,
- an, origno[vd.i], NULL);
+ if (sculpt_brush_test(&test, origco[vd.i])) {
+ const float fade = bstrength * tex_strength(ss, brush, origco[vd.i], test.dist,
+ an, origno[vd.i], NULL);
mul_v3_v3fl(proxy[vd.i], cono, fade);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -1462,8 +1466,8 @@ static void do_thumb_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
static void do_rotate_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
{
SculptSession *ss = ob->sculpt;
- Brush *brush= paint_brush(&sd->paint);
- float bstrength= ss->cache->bstrength;
+ Brush *brush = paint_brush(&sd->paint);
+ float bstrength = ss->cache->bstrength;
float an[3];
int n;
float m[4][4], rot[4][4], lmat[4][4], ilmat[4][4];
@@ -1482,32 +1486,32 @@ static void do_rotate_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
mul_serie_m4(m, lmat, rot, ilmat, NULL, NULL, NULL, NULL, NULL);
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n=0; n<totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
- SculptUndoNode* unode;
+ SculptUndoNode *unode;
SculptBrushTest test;
float (*origco)[3];
short (*origno)[3];
float (*proxy)[3];
- unode= sculpt_undo_push_node(ob, nodes[n]);
- origco= unode->co;
- origno= unode->no;
+ unode = sculpt_undo_push_node(ob, nodes[n], SCULPT_UNDO_COORDS);
+ origco = unode->co;
+ origno = unode->no;
- proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ proxy = BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test(&test, origco[vd.i])) {
- const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist,
- an, origno[vd.i], NULL);
+ if (sculpt_brush_test(&test, origco[vd.i])) {
+ const float fade = bstrength * tex_strength(ss, brush, origco[vd.i], test.dist,
+ an, origno[vd.i], NULL);
mul_v3_m4v3(proxy[vd.i], m, origco[vd.i]);
sub_v3_v3(proxy[vd.i], origco[vd.i]);
mul_v3_fl(proxy[vd.i], fade);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -1519,12 +1523,12 @@ static void do_layer_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
{
SculptSession *ss = ob->sculpt;
Brush *brush = paint_brush(&sd->paint);
- float bstrength= ss->cache->bstrength;
+ float bstrength = ss->cache->bstrength;
float area_normal[3], offset[3];
- float lim= brush->height;
+ float lim = brush->height;
int n;
- if(bstrength < 0)
+ if (bstrength < 0)
lim = -lim;
calc_sculpt_normal(sd, ob, area_normal, nodes, totnode);
@@ -1532,44 +1536,42 @@ static void do_layer_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
mul_v3_v3v3(offset, ss->cache->scale, area_normal);
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n=0; n<totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
SculptUndoNode *unode;
float (*origco)[3], *layer_disp;
- //float (*proxy)[3]; // XXX layer brush needs conversion to proxy but its more complicated
-
- //proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ /* XXX: layer brush needs conversion to proxy but its more complicated */
+ /* proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co; */
- 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");
- }
+ unode = sculpt_undo_push_node(ob, nodes[n], SCULPT_UNDO_COORDS);
+ origco = unode->co;
+ if (!unode->layer_disp) {
+ #pragma omp critical
+ unode->layer_disp = MEM_callocN(sizeof(float) * unode->totvert, "layer disp");
+ }
- layer_disp= unode->layer_disp;
+ layer_disp = unode->layer_disp;
sculpt_brush_test_init(ss, &test);
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test(&test, origco[vd.i])) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist,
- area_normal, vd.no, vd.fno);
- float *disp= &layer_disp[vd.i];
+ if (sculpt_brush_test(&test, origco[vd.i])) {
+ const float fade = bstrength * tex_strength(ss, brush, vd.co, test.dist,
+ area_normal, vd.no, vd.fno);
+ float *disp = &layer_disp[vd.i];
float val[3];
- *disp+= fade;
+ *disp += fade;
/* Don't let the displacement go past the limit */
- if((lim < 0 && *disp < lim) || (lim >= 0 && *disp > lim))
+ if ((lim < 0 && *disp < lim) || (lim >= 0 && *disp > lim))
*disp = lim;
mul_v3_v3fl(val, offset, *disp);
- if(ss->layer_co && (brush->flag & BRUSH_PERSISTENT)) {
- int index= vd.vert_indices[vd.i];
+ if (ss->layer_co && (brush->flag & BRUSH_PERSISTENT)) {
+ int index = vd.vert_indices[vd.i];
/* persistent base */
add_v3_v3(val, ss->layer_co[index]);
@@ -1580,7 +1582,7 @@ static void do_layer_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
sculpt_clip(sd, ss, vd.co, val);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -1592,32 +1594,32 @@ static void do_inflate_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totno
{
SculptSession *ss = ob->sculpt;
Brush *brush = paint_brush(&sd->paint);
- float bstrength= ss->cache->bstrength;
+ float bstrength = ss->cache->bstrength;
int n;
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n=0; n<totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
float (*proxy)[3];
- proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ proxy = BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test(&test, vd.co)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist,
- ss->cache->view_normal, vd.no, vd.fno);
+ if (sculpt_brush_test(&test, vd.co)) {
+ const float fade = bstrength * tex_strength(ss, brush, vd.co, test.dist,
+ ss->cache->view_normal, vd.no, vd.fno);
float val[3];
- if(vd.fno) copy_v3_v3(val, vd.fno);
+ if (vd.fno) copy_v3_v3(val, vd.fno);
else normal_short_to_float_v3(val, vd.no);
mul_v3_fl(val, fade * ss->cache->radius);
mul_v3_v3v3(proxy[vd.i], val, ss->cache->scale);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -1637,19 +1639,19 @@ static void calc_flatten_center(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
zero_v3(fc);
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n=0; n<totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
SculptUndoNode *unode;
float private_fc[3] = {0.0f, 0.0f, 0.0f};
int private_count = 0;
- unode = sculpt_undo_push_node(ob, nodes[n]);
+ unode = sculpt_undo_push_node(ob, nodes[n], SCULPT_UNDO_COORDS);
sculpt_brush_test_init(ss, &test);
- if(ss->cache->original) {
+ if (ss->cache->original) {
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test_fast(&test, unode->co[vd.i])) {
+ if (sculpt_brush_test_fast(&test, unode->co[vd.i])) {
add_v3_v3(private_fc, unode->co[vd.i]);
private_count++;
}
@@ -1658,7 +1660,7 @@ static void calc_flatten_center(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
}
else {
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test_fast(&test, vd.co)) {
+ if (sculpt_brush_test_fast(&test, vd.co)) {
add_v3_v3(private_fc, vd.co);
private_count++;
}
@@ -1677,30 +1679,30 @@ 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])
+ PBVHNode **nodes, int totnode,
+ float an[3], float fc[3])
{
SculptSession *ss = ob->sculpt;
int n;
- // an
+ /* for area normal */
float out_flip[3] = {0.0f, 0.0f, 0.0f};
- // fc
+ /* for flatten center */
float count = 0;
(void)sd; /* unused w/o openmp */
- // an
+ /* for area normal */
zero_v3(an);
- // fc
+ /* for flatten center */
zero_v3(fc);
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n=0; n<totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
SculptUndoNode *unode;
@@ -1709,19 +1711,19 @@ static void calc_area_normal_and_flatten_center(Sculpt *sd, Object *ob,
float private_fc[3] = {0.0f, 0.0f, 0.0f};
int private_count = 0;
- unode = sculpt_undo_push_node(ob, nodes[n]);
+ unode = sculpt_undo_push_node(ob, nodes[n], SCULPT_UNDO_COORDS);
sculpt_brush_test_init(ss, &test);
- if(ss->cache->original) {
+ if (ss->cache->original) {
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test_fast(&test, unode->co[vd.i])) {
- // an
+ if (sculpt_brush_test_fast(&test, unode->co[vd.i])) {
+ /* for area normal */
float fno[3];
normal_short_to_float_v3(fno, unode->no[vd.i]);
add_norm_if(ss->cache->view_normal, private_an, private_out_flip, fno);
- // fc
+ /* for flatten center */
add_v3_v3(private_fc, unode->co[vd.i]);
private_count++;
}
@@ -1730,9 +1732,9 @@ static void calc_area_normal_and_flatten_center(Sculpt *sd, Object *ob,
}
else {
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
- if(sculpt_brush_test_fast(&test, vd.co)) {
- // an
- if(vd.no) {
+ if (sculpt_brush_test_fast(&test, vd.co)) {
+ /* for area normal */
+ if (vd.no) {
float fno[3];
normal_short_to_float_v3(fno, vd.no);
@@ -1742,7 +1744,7 @@ static void calc_area_normal_and_flatten_center(Sculpt *sd, Object *ob,
add_norm_if(ss->cache->view_normal, private_an, private_out_flip, vd.fno);
}
- // fc
+ /* for flatten center */
add_v3_v3(private_fc, vd.co);
private_count++;
}
@@ -1752,23 +1754,23 @@ static void calc_area_normal_and_flatten_center(Sculpt *sd, Object *ob,
#pragma omp critical
{
- // an
+ /* for area normal */
add_v3_v3(an, private_an);
add_v3_v3(out_flip, private_out_flip);
- // fc
+ /* for flatten center */
add_v3_v3(fc, private_fc);
count += private_count;
}
}
- // an
+ /* for area normal */
if (is_zero_v3(an))
copy_v3_v3(an, out_flip);
normalize_v3(an);
- // fc
+ /* for flatten center */
if (count != 0) {
mul_v3_fl(fc, 1.0f / count);
}
@@ -1784,7 +1786,7 @@ static void calc_sculpt_plane(Sculpt *sd, Object *ob, PBVHNode **nodes, int totn
if (ss->cache->mirror_symmetry_pass == 0 &&
ss->cache->radial_symmetry_pass == 0 &&
- (ss->cache->first_time || !(brush->flag & BRUSH_ORIGINAL_NORMAL)))
+ (ss->cache->first_time || !(brush->flag & BRUSH_ORIGINAL_NORMAL)))
{
switch (brush->sculpt_plane) {
case SCULPT_DISP_DIR_VIEW:
@@ -1816,34 +1818,34 @@ static void calc_sculpt_plane(Sculpt *sd, Object *ob, PBVHNode **nodes, int totn
break;
}
- // fc
+ /* for flatten center */
/* flatten center has not been calculated yet if we are not using the area normal */
if (brush->sculpt_plane != SCULPT_DISP_DIR_AREA)
calc_flatten_center(sd, ob, nodes, totnode, fc);
- // an
+ /* for area normal */
copy_v3_v3(ss->cache->last_area_normal, an);
- // fc
+ /* for flatten center */
copy_v3_v3(ss->cache->last_center, fc);
}
else {
- // an
+ /* for area normal */
copy_v3_v3(an, ss->cache->last_area_normal);
- // fc
+ /* for flatten center */
copy_v3_v3(fc, ss->cache->last_center);
- // an
+ /* for area normal */
flip_coord(an, an, ss->cache->mirror_symmetry_pass);
- // fc
+ /* for flatten center */
flip_coord(fc, fc, ss->cache->mirror_symmetry_pass);
- // an
+ /* for area normal */
mul_m4_v3(ss->cache->symm_rot_mat, an);
- // fc
+ /* for flatten center */
mul_m4_v3(ss->cache->symm_rot_mat, fc);
}
}
@@ -1858,7 +1860,7 @@ static void point_plane_project(float intr[3], float co[3], float plane_normal[3
static int plane_trim(StrokeCache *cache, Brush *brush, float val[3])
{
- return !(brush->flag & BRUSH_PLANE_TRIM) || (dot_v3v3(val, val) <= cache->radius_squared*cache->plane_trim_squared);
+ return !(brush->flag & BRUSH_PLANE_TRIM) || (dot_v3v3(val, val) <= cache->radius_squared * cache->plane_trim_squared);
}
static int plane_point_side_flip(float co[3], float plane_normal[3], float plane_center[3], int flip)
@@ -1879,12 +1881,12 @@ static int plane_point_side(float co[3], float plane_normal[3], float plane_cent
float delta[3];
sub_v3_v3v3(delta, co, plane_center);
- return dot_v3v3(plane_normal, delta) <= 0.0f;
+ return dot_v3v3(plane_normal, delta) <= 0.0f;
}
static float get_offset(Sculpt *sd, SculptSession *ss)
{
- Brush* brush = paint_brush(&sd->paint);
+ Brush *brush = paint_brush(&sd->paint);
float rv = brush->plane_offset;
@@ -1916,19 +1918,19 @@ static void do_flatten_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totno
calc_sculpt_plane(sd, ob, nodes, totnode, an, fc);
- displace = radius*offset;
+ displace = radius * offset;
mul_v3_v3v3(temp, an, ss->cache->scale);
mul_v3_fl(temp, displace);
add_v3_v3(fc, temp);
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n = 0; n < totnode; n++) {
- PBVHVertexIter vd;
+ for (n = 0; n < totnode; n++) {
+ PBVHVertexIter vd;
SculptBrushTest test;
float (*proxy)[3];
- proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ proxy = BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
@@ -1942,12 +1944,12 @@ static void do_flatten_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totno
sub_v3_v3v3(val, intr, vd.co);
if (plane_trim(ss->cache, brush, val)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist),
- an, vd.no, vd.fno);
+ const float fade = bstrength * tex_strength(ss, brush, vd.co, sqrt(test.dist),
+ an, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], val, fade);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -1967,13 +1969,12 @@ static void do_clay_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
float displace;
- float an[3]; // area normal
- float fc[3]; // flatten center
+ float an[3];
+ float fc[3];
int n;
float temp[3];
- //float p[3];
int flip;
@@ -1986,13 +1987,13 @@ static void do_clay_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
radius = -radius;
}
- displace = radius * (0.25f+offset);
+ displace = radius * (0.25f + offset);
mul_v3_v3v3(temp, an, ss->cache->scale);
mul_v3_fl(temp, displace);
add_v3_v3(fc, temp);
- //add_v3_v3v3(p, ss->cache->location, an);
+ /* add_v3_v3v3(p, ss->cache->location, an); */
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
for (n = 0; n < totnode; n++) {
@@ -2000,14 +2001,13 @@ static void do_clay_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
SculptBrushTest test;
float (*proxy)[3];
- proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ proxy = BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if (sculpt_brush_test_sq(&test, vd.co)) {
if (plane_point_side_flip(vd.co, an, fc, flip)) {
- //if (sculpt_brush_test_cyl(&test, vd.co, ss->cache->location, p)) {
float intr[3];
float val[3];
@@ -2016,13 +2016,13 @@ static void do_clay_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
sub_v3_v3v3(val, intr, vd.co);
if (plane_trim(ss->cache, brush, val)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co,
- sqrt(test.dist),
- an, vd.no, vd.fno);
+ const float fade = bstrength * tex_strength(ss, brush, vd.co,
+ sqrt(test.dist),
+ an, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], val, fade);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -2032,7 +2032,7 @@ static void do_clay_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
}
}
-static void do_clay_tubes_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
+static void do_clay_strips_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
{
SculptSession *ss = ob->sculpt;
Brush *brush = paint_brush(&sd->paint);
@@ -2043,9 +2043,9 @@ static void do_clay_tubes_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
float displace;
- float sn[3]; // sculpt normal
- float an[3]; // area normal
- float fc[3]; // flatten center
+ float sn[3];
+ float an[3];
+ float fc[3];
int n;
@@ -2063,8 +2063,9 @@ static void do_clay_tubes_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
else
copy_v3_v3(an, sn);
+ /* delay the first daub because grab delta is not setup */
if (ss->cache->first_time)
- return; // delay the first daub because grab delta is not setup
+ return;
flip = bstrength < 0;
@@ -2073,17 +2074,24 @@ static void do_clay_tubes_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
radius = -radius;
}
- displace = radius * (0.25f+offset);
+ displace = radius * (0.25f + offset);
mul_v3_v3v3(temp, sn, ss->cache->scale);
mul_v3_fl(temp, displace);
add_v3_v3(fc, temp);
- cross_v3_v3v3(mat[0], an, ss->cache->grab_delta_symmetry); mat[0][3] = 0;
- cross_v3_v3v3(mat[1], an, mat[0]); mat[1][3] = 0;
- copy_v3_v3(mat[2], an); mat[2][3] = 0;
- copy_v3_v3(mat[3], ss->cache->location); mat[3][3] = 1;
+ /* init mat */
+ cross_v3_v3v3(mat[0], an, ss->cache->grab_delta_symmetry);
+ mat[0][3] = 0;
+ cross_v3_v3v3(mat[1], an, mat[0]);
+ mat[1][3] = 0;
+ copy_v3_v3(mat[2], an);
+ mat[2][3] = 0;
+ copy_v3_v3(mat[3], ss->cache->location);
+ mat[3][3] = 1;
normalize_m4(mat);
+
+ /* scale mat */
scale_m4_fl(scale, ss->cache->radius);
mult_m4_m4m4(tmat, mat, scale);
invert_m4_m4(mat, tmat);
@@ -2094,7 +2102,7 @@ static void do_clay_tubes_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
SculptBrushTest test;
float (*proxy)[3];
- proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ proxy = BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
@@ -2109,13 +2117,13 @@ static void do_clay_tubes_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
sub_v3_v3v3(val, intr, vd.co);
if (plane_trim(ss->cache, brush, val)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co,
- ss->cache->radius*test.dist,
- an, vd.no, vd.fno);
+ const float fade = bstrength * tex_strength(ss, brush, vd.co,
+ ss->cache->radius * test.dist,
+ an, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], val, fade);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -2145,7 +2153,7 @@ static void do_fill_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
calc_sculpt_plane(sd, ob, nodes, totnode, an, fc);
- displace = radius*offset;
+ displace = radius * offset;
mul_v3_v3v3(temp, an, ss->cache->scale);
mul_v3_fl(temp, displace);
@@ -2157,7 +2165,7 @@ static void do_fill_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
SculptBrushTest test;
float (*proxy)[3];
- proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ proxy = BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
@@ -2172,13 +2180,13 @@ static void do_fill_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
sub_v3_v3v3(val, intr, vd.co);
if (plane_trim(ss->cache, brush, val)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co,
- sqrt(test.dist),
- an, vd.no, vd.fno);
+ const float fade = bstrength * tex_strength(ss, brush, vd.co,
+ sqrt(test.dist),
+ an, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], val, fade);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -2208,7 +2216,7 @@ static void do_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
calc_sculpt_plane(sd, ob, nodes, totnode, an, fc);
- displace = -radius*offset;
+ displace = -radius * offset;
mul_v3_v3v3(temp, an, ss->cache->scale);
mul_v3_fl(temp, displace);
@@ -2220,7 +2228,7 @@ static void do_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
SculptBrushTest test;
float (*proxy)[3];
- proxy= BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
+ proxy = BLI_pbvh_node_add_proxy(ss->pbvh, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
@@ -2235,13 +2243,13 @@ static void do_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
sub_v3_v3v3(val, intr, vd.co);
if (plane_trim(ss->cache, brush, val)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co,
- sqrt(test.dist),
- an, vd.no, vd.fno);
+ const float fade = bstrength * tex_strength(ss, brush, vd.co,
+ sqrt(test.dist),
+ an, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], val, fade);
- if(vd.mvert)
+ if (vd.mvert)
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
}
@@ -2253,36 +2261,36 @@ static void do_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3])
{
- Mesh *me= (Mesh*)ob->data;
- float (*ofs)[3]= NULL;
- int a, is_basis= 0;
+ Mesh *me = (Mesh *)ob->data;
+ float (*ofs)[3] = NULL;
+ int a, is_basis = 0;
KeyBlock *currkey;
/* for relative keys editing of base should update other keys */
if (me->key->type == KEY_RELATIVE)
- for (currkey = me->key->block.first; currkey; currkey= currkey->next)
- if(ob->shapenr-1 == currkey->relative) {
- is_basis= 1;
+ for (currkey = me->key->block.first; currkey; currkey = currkey->next)
+ if (ob->shapenr - 1 == currkey->relative) {
+ is_basis = 1;
break;
}
if (is_basis) {
- ofs= key_to_vertcos(ob, kb);
+ ofs = key_to_vertcos(ob, kb);
/* calculate key coord offsets (from previous location) */
- for (a= 0; a < me->totvert; a++) {
+ for (a = 0; a < me->totvert; a++) {
sub_v3_v3v3(ofs[a], vertCos[a], ofs[a]);
}
/* apply offsets on other keys */
currkey = me->key->block.first;
while (currkey) {
- int apply_offset = ((currkey != kb) && (ob->shapenr-1 == currkey->relative));
+ int apply_offset = ((currkey != kb) && (ob->shapenr - 1 == currkey->relative));
if (apply_offset)
offset_to_key(ob, currkey, ofs);
- currkey= currkey->next;
+ currkey = currkey->next;
}
MEM_freeN(ofs);
@@ -2290,9 +2298,9 @@ void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3])
/* modifying of basis key should update mesh */
if (kb == me->key->refkey) {
- MVert *mvert= me->mvert;
+ MVert *mvert = me->mvert;
- for (a= 0; a < me->totvert; a++, mvert++)
+ for (a = 0; a < me->totvert; a++, mvert++)
copy_v3_v3(mvert->co, vertCos[a]);
mesh_calc_normals_mapping(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL, NULL, 0, NULL, NULL);
@@ -2319,69 +2327,69 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush)
/* Only act if some verts are inside the brush area */
if (totnode) {
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for (n= 0; n < totnode; n++) {
- sculpt_undo_push_node(ob, nodes[n]);
+ for (n = 0; n < totnode; n++) {
+ sculpt_undo_push_node(ob, nodes[n], SCULPT_UNDO_COORDS);
BLI_pbvh_node_mark_update(nodes[n]);
}
/* Apply one type of brush action */
- switch(brush->sculpt_tool){
- case SCULPT_TOOL_DRAW:
- do_draw_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_SMOOTH:
- do_smooth_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_CREASE:
- do_crease_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_BLOB:
- do_crease_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_PINCH:
- do_pinch_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_INFLATE:
- do_inflate_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_GRAB:
- do_grab_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_ROTATE:
- do_rotate_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_SNAKE_HOOK:
- do_snake_hook_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_NUDGE:
- do_nudge_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_THUMB:
- do_thumb_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_LAYER:
- do_layer_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_FLATTEN:
- do_flatten_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_CLAY:
- do_clay_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_CLAY_TUBES:
- do_clay_tubes_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_FILL:
- do_fill_brush(sd, ob, nodes, totnode);
- break;
- case SCULPT_TOOL_SCRAPE:
- do_scrape_brush(sd, ob, nodes, totnode);
- break;
+ switch (brush->sculpt_tool) {
+ case SCULPT_TOOL_DRAW:
+ do_draw_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_SMOOTH:
+ do_smooth_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_CREASE:
+ do_crease_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_BLOB:
+ do_crease_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_PINCH:
+ do_pinch_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_INFLATE:
+ do_inflate_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_GRAB:
+ do_grab_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_ROTATE:
+ do_rotate_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_SNAKE_HOOK:
+ do_snake_hook_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_NUDGE:
+ do_nudge_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_THUMB:
+ do_thumb_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_LAYER:
+ do_layer_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_FLATTEN:
+ do_flatten_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_CLAY:
+ do_clay_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_CLAY_STRIPS:
+ do_clay_strips_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_FILL:
+ do_fill_brush(sd, ob, nodes, totnode);
+ break;
+ case SCULPT_TOOL_SCRAPE:
+ do_scrape_brush(sd, ob, nodes, totnode);
+ break;
}
if (brush->sculpt_tool != SCULPT_TOOL_SMOOTH && brush->autosmooth_factor > 0) {
if (brush->flag & BRUSH_INVERSE_SMOOTH_PRESSURE) {
- smooth(sd, ob, nodes, totnode, brush->autosmooth_factor*(1-ss->cache->pressure));
+ smooth(sd, ob, nodes, totnode, brush->autosmooth_factor * (1 - ss->cache->pressure));
}
else {
smooth(sd, ob, nodes, totnode, brush->autosmooth_factor);
@@ -2396,9 +2404,9 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush)
static void sculpt_flush_pbvhvert_deform(Object *ob, PBVHVertexIter *vd)
{
SculptSession *ss = ob->sculpt;
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
float disp[3], newco[3];
- int index= vd->vert_indices[vd->i];
+ int index = vd->vert_indices[vd->i];
sub_v3_v3v3(disp, vd->co, ss->deform_cos[index]);
mul_m3_v3(ss->deform_imats[index], disp);
@@ -2407,33 +2415,33 @@ static void sculpt_flush_pbvhvert_deform(Object *ob, PBVHVertexIter *vd)
copy_v3_v3(ss->deform_cos[index], vd->co);
copy_v3_v3(ss->orig_cos[index], newco);
- if(!ss->kb)
+ if (!ss->kb)
copy_v3_v3(me->mvert[index].co, newco);
}
static void sculpt_combine_proxies(Sculpt *sd, Object *ob)
{
SculptSession *ss = ob->sculpt;
- Brush *brush= paint_brush(&sd->paint);
- PBVHNode** nodes;
+ Brush *brush = paint_brush(&sd->paint);
+ PBVHNode **nodes;
int totnode, n;
BLI_pbvh_gather_proxies(ss->pbvh, &nodes, &totnode);
- if(!ELEM(brush->sculpt_tool, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_LAYER)) {
+ if (!ELEM(brush->sculpt_tool, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_LAYER)) {
/* these brushes start from original coordinates */
const int use_orco = (ELEM3(brush->sculpt_tool, SCULPT_TOOL_GRAB,
SCULPT_TOOL_ROTATE, SCULPT_TOOL_THUMB));
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for (n= 0; n < totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
- PBVHProxyNode* proxies;
+ PBVHProxyNode *proxies;
int proxy_count;
float (*orco)[3];
- if(use_orco)
- orco= sculpt_undo_push_node(ob, nodes[n])->co;
+ if (use_orco)
+ orco = sculpt_undo_push_node(ob, nodes[n], SCULPT_UNDO_COORDS)->co;
BLI_pbvh_node_get_proxies(nodes[n], &proxies, &proxy_count);
@@ -2441,17 +2449,17 @@ static void sculpt_combine_proxies(Sculpt *sd, Object *ob)
float val[3];
int p;
- if(use_orco)
+ if (use_orco)
copy_v3_v3(val, orco[vd.i]);
else
copy_v3_v3(val, vd.co);
- for (p= 0; p < proxy_count; p++)
+ for (p = 0; p < proxy_count; p++)
add_v3_v3(val, proxies[p].co[vd.i]);
sculpt_clip(sd, ss, vd.co, val);
- if(ss->modifiers_active)
+ if (ss->modifiers_active)
sculpt_flush_pbvhvert_deform(ob, &vd);
}
BLI_pbvh_vertex_iter_end;
@@ -2471,14 +2479,14 @@ 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 */
- if(ss->orig_cos) vertCos = ss->orig_cos;
+ * 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);
if (vertCos) {
sculpt_vertcos_to_key(ob, ss->kb, vertCos);
- if(vertCos != ss->orig_cos)
+ if (vertCos != ss->orig_cos)
MEM_freeN(vertCos);
}
}
@@ -2487,38 +2495,38 @@ static void sculpt_update_keyblock(Object *ob)
static void sculpt_flush_stroke_deform(Sculpt *sd, Object *ob)
{
SculptSession *ss = ob->sculpt;
- Brush *brush= paint_brush(&sd->paint);
+ Brush *brush = paint_brush(&sd->paint);
- if(ELEM(brush->sculpt_tool, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_LAYER)) {
+ 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;
- PBVHNode** nodes;
- float (*vertCos)[3]= NULL;
+ Mesh *me = (Mesh *)ob->data;
+ PBVHNode **nodes;
+ float (*vertCos)[3] = NULL;
- if(ss->kb)
- vertCos= MEM_callocN(sizeof(*vertCos)*me->totvert, "flushStrokeDeofrm keyVerts");
+ if (ss->kb)
+ vertCos = MEM_callocN(sizeof(*vertCos) * me->totvert, "flushStrokeDeofrm keyVerts");
BLI_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode);
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for (n= 0; n < totnode; n++) {
+ for (n = 0; n < totnode; n++) {
PBVHVertexIter vd;
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
sculpt_flush_pbvhvert_deform(ob, &vd);
- if(vertCos) {
- int index= vd.vert_indices[vd.i];
+ if (vertCos) {
+ int index = vd.vert_indices[vd.i];
copy_v3_v3(vertCos[index], ss->orig_cos[index]);
}
}
BLI_pbvh_vertex_iter_end;
}
- if(vertCos) {
+ if (vertCos) {
sculpt_vertcos_to_key(ob, ss->kb, vertCos);
MEM_freeN(vertCos);
}
@@ -2526,35 +2534,20 @@ 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)
+ }
+ else if (ss->kb) {
sculpt_update_keyblock(ob);
+ }
}
-//static int max_overlap_count(Sculpt *sd)
-//{
-// int count[3];
-// int i, j;
-//
-// for (i= 0; i < 3; i++) {
-// count[i] = sd->radial_symm[i];
-//
-// for (j= 0; j < 3; j++) {
-// if (i != j && sd->flags & (SCULPT_SYMM_X<<i))
-// count[i] *= 2;
-// }
-// }
-//
-// return MAX3(count[0], count[1], count[2]);
-//}
-
/* 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))
+ const char axis, const float angle,
+ const float UNUSED(feather))
{
(void)sd; /* unused */
@@ -2562,22 +2555,22 @@ static void calc_brushdata_symm(Sculpt *sd, StrokeCache *cache, const char symm,
flip_coord(cache->grab_delta_symmetry, cache->grab_delta, symm);
flip_coord(cache->view_normal, cache->true_view_normal, symm);
- // XXX This reduces the length of the grab delta if it approaches the line of symmetry
- // XXX However, a different approach appears to be needed
- //if (sd->flags & SCULPT_SYMMETRY_FEATHER) {
- // float frac = 1.0f/max_overlap_count(sd);
- // float reduce = (feather-frac)/(1-frac);
+ /* XXX This reduces the length of the grab delta if it approaches the line of symmetry
+ XXX However, a different approach appears to be needed
+ if (sd->flags & SCULPT_SYMMETRY_FEATHER) {
+ float frac = 1.0f/max_overlap_count(sd);
+ float reduce = (feather-frac)/(1-frac);
- // printf("feather: %f frac: %f reduce: %f\n", feather, frac, reduce);
+ printf("feather: %f frac: %f reduce: %f\n", feather, frac, reduce);
- // if (frac < 1)
- // mul_v3_fl(cache->grab_delta_symmetry, reduce);
- //}
+ if (frac < 1)
+ mul_v3_fl(cache->grab_delta_symmetry, reduce);
+ } */
unit_m4(cache->symm_rot_mat);
unit_m4(cache->symm_rot_mat_inv);
- if(axis) { /* expects XYZ */
+ if (axis) { /* expects XYZ */
rotate_m4(cache->symm_rot_mat, axis, angle);
rotate_m4(cache->symm_rot_mat_inv, axis, -angle);
}
@@ -2587,30 +2580,30 @@ static void calc_brushdata_symm(Sculpt *sd, StrokeCache *cache, const char symm,
}
static void do_radial_symmetry(Sculpt *sd, Object *ob, Brush *brush,
- const char symm, const int axis,
- const float feather)
+ const char symm, const int axis,
+ const float feather)
{
SculptSession *ss = ob->sculpt;
int i;
- for(i = 1; i < sd->radial_symm[axis-'X']; ++i) {
- const float angle = 2*M_PI*i/sd->radial_symm[axis-'X'];
- ss->cache->radial_symmetry_pass= i;
+ for (i = 1; i < sd->radial_symm[axis - 'X']; ++i) {
+ const float angle = 2 * M_PI * i / sd->radial_symm[axis - 'X'];
+ ss->cache->radial_symmetry_pass = i;
calc_brushdata_symm(sd, ss->cache, symm, axis, angle, feather);
do_brush_action(sd, ob, 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;
Brush *brush = paint_brush(&sd->paint);
MTex *mtex = &brush->mtex;
- if(ss->multires && mtex->tex && mtex->tex->type == TEX_NOISE)
+ if (ss->multires && mtex->tex && mtex->tex->type == TEX_NOISE)
multires_stitch_grids(ob);
}
@@ -2624,15 +2617,15 @@ static void do_symmetrical_brush_actions(Sculpt *sd, Object *ob)
float feather = calc_symmetry_feather(sd, ss->cache);
- cache->bstrength= brush_strength(sd, cache, feather);
+ cache->bstrength = brush_strength(sd, cache, feather);
- cache->symmetry= symm;
+ cache->symmetry = symm;
/* symm is a bit combination of XYZ - 1 is mirror X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
- for(i = 0; i <= symm; ++i) {
- if(i == 0 || (symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5)))) {
- cache->mirror_symmetry_pass= i;
- cache->radial_symmetry_pass= 0;
+ for (i = 0; i <= symm; ++i) {
+ if (i == 0 || (symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5)))) {
+ cache->mirror_symmetry_pass = i;
+ cache->radial_symmetry_pass = 0;
calc_brushdata_symm(sd, cache, i, 0, 0, feather);
do_brush_action(sd, ob, brush);
@@ -2651,22 +2644,22 @@ static void do_symmetrical_brush_actions(Sculpt *sd, Object *ob)
if (ss->modifiers_active)
sculpt_flush_stroke_deform(sd, ob);
- cache->first_time= 0;
+ cache->first_time = 0;
}
static void sculpt_update_tex(const Scene *scene, Sculpt *sd, SculptSession *ss)
{
Brush *brush = paint_brush(&sd->paint);
- const int radius= brush_size(scene, brush);
+ const int radius = brush_size(scene, brush);
- if(ss->texcache) {
+ if (ss->texcache) {
MEM_freeN(ss->texcache);
- ss->texcache= NULL;
+ ss->texcache = NULL;
}
/* Need to allocate a bigger buffer for bigger brush size */
- ss->texcache_side = 2*radius;
- if(!ss->texcache || ss->texcache_side > ss->texcache_actual) {
+ ss->texcache_side = 2 * radius;
+ if (!ss->texcache || ss->texcache_side > ss->texcache_actual) {
ss->texcache = brush_gen_texture_cache(brush, radius);
ss->texcache_actual = ss->texcache_side;
}
@@ -2676,21 +2669,21 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, int need_
{
DerivedMesh *dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
SculptSession *ss = ob->sculpt;
- MultiresModifierData *mmd= sculpt_multires_active(scene, ob);
+ MultiresModifierData *mmd = sculpt_multires_active(scene, ob);
- ss->modifiers_active= sculpt_modifiers_active(scene, sd, ob);
+ ss->modifiers_active = sculpt_modifiers_active(scene, sd, ob);
- if(!mmd) ss->kb= ob_get_keyblock(ob);
- else ss->kb= NULL;
+ if (!mmd) ss->kb = ob_get_keyblock(ob);
+ else ss->kb = NULL;
- if(mmd) {
+ if (mmd) {
ss->multires = mmd;
ss->totvert = dm->getNumVerts(dm);
ss->totpoly = dm->getNumPolys(dm);
- ss->mvert= NULL;
- ss->mpoly= NULL;
- ss->mloop= NULL;
- ss->face_normals= NULL;
+ ss->mvert = NULL;
+ ss->mpoly = NULL;
+ ss->mloop = NULL;
+ ss->face_normals = NULL;
}
else {
Mesh *me = get_mesh(ob);
@@ -2707,28 +2700,29 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, int need_
BKE_mesh_tessface_ensure(ob->data);
ss->pbvh = dm->getPBVH(ob, dm);
- ss->pmap = (need_pmap && dm->getPolyMap)? dm->getPolyMap(ob, dm): NULL;
+ ss->pmap = (need_pmap && dm->getPolyMap) ? dm->getPolyMap(ob, dm) : NULL;
- if(ss->modifiers_active) {
- if(!ss->orig_cos) {
+ if (ss->modifiers_active) {
+ if (!ss->orig_cos) {
int a;
free_sculptsession_deformMats(ss);
- if(ss->kb) ss->orig_cos = key_to_vertcos(ob, ss->kb);
+ if (ss->kb) ss->orig_cos = key_to_vertcos(ob, ss->kb);
else ss->orig_cos = mesh_getVertexCos(ob->data, NULL);
crazyspace_build_sculpt(scene, ob, &ss->deform_imats, &ss->deform_cos);
BLI_pbvh_apply_vertCos(ss->pbvh, ss->deform_cos);
- for(a = 0; a < ((Mesh*)ob->data)->totvert; ++a)
+ for (a = 0; a < ((Mesh *)ob->data)->totvert; ++a)
invert_m3(ss->deform_imats[a]);
}
- } else free_sculptsession_deformMats(ss);
+ }
+ else free_sculptsession_deformMats(ss);
/* if pbvh is deformed, key block is already applied to it */
if (ss->kb && !BLI_pbvh_isDeformed(ss->pbvh)) {
- float (*vertCos)[3]= key_to_vertcos(ob, ss->kb);
+ float (*vertCos)[3] = key_to_vertcos(ob, ss->kb);
if (vertCos) {
/* apply shape keys coordinates to PBVH */
@@ -2738,7 +2732,7 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, int need_
}
}
-static int sculpt_mode_poll(bContext *C)
+int sculpt_mode_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
return ob && ob->mode & OB_MODE_SCULPT;
@@ -2753,48 +2747,49 @@ static const char *sculpt_tool_name(Sculpt *sd)
{
Brush *brush = paint_brush(&sd->paint);
- switch(brush->sculpt_tool) {
- case SCULPT_TOOL_DRAW:
- return "Draw Brush"; break;
- case SCULPT_TOOL_SMOOTH:
- return "Smooth Brush"; break;
- case SCULPT_TOOL_CREASE:
- return "Crease Brush"; break;
- case SCULPT_TOOL_BLOB:
- return "Blob Brush"; break;
- case SCULPT_TOOL_PINCH:
- return "Pinch Brush"; break;
- case SCULPT_TOOL_INFLATE:
- return "Inflate Brush"; break;
- case SCULPT_TOOL_GRAB:
- return "Grab Brush"; break;
- case SCULPT_TOOL_NUDGE:
- return "Nudge Brush"; break;
- case SCULPT_TOOL_THUMB:
- return "Thumb Brush"; break;
- case SCULPT_TOOL_LAYER:
- return "Layer Brush"; break;
- case SCULPT_TOOL_FLATTEN:
- return "Flatten Brush"; break;
- case SCULPT_TOOL_CLAY:
- return "Clay Brush"; break;
- case SCULPT_TOOL_CLAY_TUBES:
- return "Clay Tubes Brush"; break;
- case SCULPT_TOOL_FILL:
- return "Fill Brush"; break;
- case SCULPT_TOOL_SCRAPE:
- return "Scrape Brush"; break;
- default:
- return "Sculpting"; break;
- }
-}
-
-/**** Operator for applying a stroke (various attributes including mouse path)
- using the current brush. ****/
+ switch (brush->sculpt_tool) {
+ case SCULPT_TOOL_DRAW:
+ return "Draw Brush"; break;
+ case SCULPT_TOOL_SMOOTH:
+ return "Smooth Brush"; break;
+ case SCULPT_TOOL_CREASE:
+ return "Crease Brush"; break;
+ case SCULPT_TOOL_BLOB:
+ return "Blob Brush"; break;
+ case SCULPT_TOOL_PINCH:
+ return "Pinch Brush"; break;
+ case SCULPT_TOOL_INFLATE:
+ return "Inflate Brush"; break;
+ case SCULPT_TOOL_GRAB:
+ return "Grab Brush"; break;
+ case SCULPT_TOOL_NUDGE:
+ return "Nudge Brush"; break;
+ case SCULPT_TOOL_THUMB:
+ return "Thumb Brush"; break;
+ case SCULPT_TOOL_LAYER:
+ return "Layer Brush"; break;
+ case SCULPT_TOOL_FLATTEN:
+ return "Flatten Brush"; break;
+ case SCULPT_TOOL_CLAY:
+ return "Clay Brush"; break;
+ case SCULPT_TOOL_CLAY_STRIPS:
+ return "Clay Strips Brush"; break;
+ case SCULPT_TOOL_FILL:
+ return "Fill Brush"; break;
+ case SCULPT_TOOL_SCRAPE:
+ return "Scrape Brush"; break;
+ default:
+ return "Sculpting"; break;
+ }
+}
+
+/**
+ * Operator for applying a stroke (various attributes including mouse path)
+ * using the current brush. */
static void sculpt_cache_free(StrokeCache *cache)
{
- if(cache->face_norms)
+ if (cache->face_norms)
MEM_freeN(cache->face_norms);
MEM_freeN(cache);
}
@@ -2805,23 +2800,23 @@ static void sculpt_init_mirror_clipping(Object *ob, SculptSession *ss)
ModifierData *md;
int i;
- for(md= ob->modifiers.first; md; md= md->next) {
- if(md->type==eModifierType_Mirror &&
- (md->mode & eModifierMode_Realtime)) {
- MirrorModifierData *mmd = (MirrorModifierData*)md;
+ for (md = ob->modifiers.first; md; md = md->next) {
+ if (md->type == eModifierType_Mirror &&
+ (md->mode & eModifierMode_Realtime)) {
+ MirrorModifierData *mmd = (MirrorModifierData *)md;
- if(mmd->flag & MOD_MIR_CLIPPING) {
+ if (mmd->flag & MOD_MIR_CLIPPING) {
/* check each axis for mirroring */
- for(i = 0; i < 3; ++i) {
- if(mmd->flag & (MOD_MIR_AXIS_X << i)) {
+ for (i = 0; i < 3; ++i) {
+ if (mmd->flag & (MOD_MIR_AXIS_X << i)) {
/* enable sculpt clipping */
ss->cache->flag |= CLIP_X << i;
/* update the clip tolerance */
- if(mmd->tolerance >
- ss->cache->clip_tolerance[i])
+ if (mmd->tolerance >
+ ss->cache->clip_tolerance[i])
ss->cache->clip_tolerance[i] =
- mmd->tolerance;
+ mmd->tolerance;
}
}
}
@@ -2830,12 +2825,12 @@ static void sculpt_init_mirror_clipping(Object *ob, SculptSession *ss)
}
/* Initialize the stroke cache invariants from operator properties */
-static void sculpt_update_cache_invariants(bContext* C, Sculpt *sd, SculptSession *ss, wmOperator *op, wmEvent *event)
+static void sculpt_update_cache_invariants(bContext *C, Sculpt *sd, SculptSession *ss, wmOperator *op, wmEvent *event)
{
StrokeCache *cache = MEM_callocN(sizeof(StrokeCache), "stroke cache");
Brush *brush = paint_brush(&sd->paint);
ViewContext *vc = paint_stroke_view_context(op->customdata);
- Object *ob= CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
int i;
int mode;
@@ -2867,19 +2862,19 @@ 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) */
- if(cache->invert) brush->flag |= BRUSH_INVERTED;
+ * we can't handle brush appearance inversion hotkey separately (sergey) */
+ if (cache->invert) brush->flag |= BRUSH_INVERTED;
else brush->flag &= ~BRUSH_INVERTED;
/* Alt-Smooth */
if (ss->cache->alt_smooth) {
- Paint *p= &sd->paint;
+ Paint *p = &sd->paint;
Brush *br;
- BLI_strncpy(cache->saved_active_brush_name, brush->id.name+2, sizeof(cache->saved_active_brush_name));
+ BLI_strncpy(cache->saved_active_brush_name, brush->id.name + 2, sizeof(cache->saved_active_brush_name));
- br= (Brush *)find_id("BR", "Smooth");
- if(br) {
+ br = (Brush *)find_id("BR", "Smooth");
+ if (br) {
paint_brush_set(p, br);
brush = br;
}
@@ -2899,16 +2894,16 @@ static void sculpt_update_cache_invariants(bContext* C, Sculpt *sd, SculptSessio
ED_view3d_global_to_vector(cache->vc->rv3d, cache->vc->rv3d->twmat[3], cache->true_view_normal);
/* Initialize layer brush displacements and persistent coords */
- if(brush->sculpt_tool == SCULPT_TOOL_LAYER) {
+ if (brush->sculpt_tool == SCULPT_TOOL_LAYER) {
/* not supported yet for multires */
- if(!ss->multires && !ss->layer_co && (brush->flag & BRUSH_PERSISTENT)) {
- if(!ss->layer_co)
- ss->layer_co= MEM_mallocN(sizeof(float) * 3 * ss->totvert,
- "sculpt mesh vertices copy");
+ if (!ss->multires && !ss->layer_co && (brush->flag & BRUSH_PERSISTENT)) {
+ if (!ss->layer_co)
+ ss->layer_co = MEM_mallocN(sizeof(float) * 3 * ss->totvert,
+ "sculpt mesh vertices copy");
- if(ss->deform_cos) memcpy(ss->layer_co, ss->deform_cos, ss->totvert);
+ if (ss->deform_cos) memcpy(ss->layer_co, ss->deform_cos, ss->totvert);
else {
- for(i = 0; i < ss->totvert; ++i) {
+ for (i = 0; i < ss->totvert; ++i) {
copy_v3_v3(ss->layer_co[i], ss->mvert[i].co);
}
}
@@ -2916,79 +2911,86 @@ static void sculpt_update_cache_invariants(bContext* C, Sculpt *sd, SculptSessio
}
/* Make copies of the mesh vertex locations and normals for some tools */
- if(brush->flag & BRUSH_ANCHORED) {
- if(ss->face_normals) {
+ if (brush->flag & BRUSH_ANCHORED) {
+ if (ss->face_normals) {
float *fn = ss->face_normals;
- cache->face_norms= MEM_mallocN(sizeof(float) * 3 * ss->totpoly, "Sculpt face norms");
- for(i = 0; i < ss->totpoly; ++i, fn += 3)
+ cache->face_norms = MEM_mallocN(sizeof(float) * 3 * ss->totpoly, "Sculpt face norms");
+ for (i = 0; i < ss->totpoly; ++i, fn += 3)
copy_v3_v3(cache->face_norms[i], fn);
}
cache->original = 1;
}
- if(ELEM8(brush->sculpt_tool,
- SCULPT_TOOL_DRAW, SCULPT_TOOL_CREASE, SCULPT_TOOL_BLOB,
- SCULPT_TOOL_LAYER, SCULPT_TOOL_INFLATE, SCULPT_TOOL_CLAY,
- SCULPT_TOOL_CLAY_TUBES, SCULPT_TOOL_ROTATE))
- if(!(brush->flag & BRUSH_ACCUMULATE))
+ if (ELEM8(brush->sculpt_tool,
+ SCULPT_TOOL_DRAW, SCULPT_TOOL_CREASE, SCULPT_TOOL_BLOB,
+ SCULPT_TOOL_LAYER, SCULPT_TOOL_INFLATE, SCULPT_TOOL_CLAY,
+ SCULPT_TOOL_CLAY_STRIPS, SCULPT_TOOL_ROTATE))
+ if (!(brush->flag & BRUSH_ACCUMULATE))
cache->original = 1;
cache->special_rotation = (brush->flag & BRUSH_RAKE) ? sd->last_angle : 0;
- //cache->last_rake[0] = sd->last_x;
- //cache->last_rake[1] = sd->last_y;
- cache->first_time= 1;
+ cache->first_time = 1;
- cache->vertex_rotation= 0;
+ cache->vertex_rotation = 0;
}
static void sculpt_update_brush_delta(Sculpt *sd, Object *ob, Brush *brush)
{
SculptSession *ss = ob->sculpt;
StrokeCache *cache = ss->cache;
+ float mouse[2] = {
+ cache->mouse[0] - cache->vc->ar->winrct.xmin,
+ cache->mouse[1] - cache->vc->ar->winrct.ymin
+ };
int tool = brush->sculpt_tool;
- if(ELEM5(tool,
- SCULPT_TOOL_GRAB, SCULPT_TOOL_NUDGE,
- SCULPT_TOOL_CLAY_TUBES, SCULPT_TOOL_SNAKE_HOOK,
- SCULPT_TOOL_THUMB)) {
+ if (ELEM5(tool,
+ SCULPT_TOOL_GRAB, SCULPT_TOOL_NUDGE,
+ SCULPT_TOOL_CLAY_STRIPS, SCULPT_TOOL_SNAKE_HOOK,
+ SCULPT_TOOL_THUMB)) {
float grab_location[3], imat[4][4], delta[3], loc[3];
- if(cache->first_time) {
+ if (cache->first_time) {
copy_v3_v3(cache->orig_grab_location,
cache->true_location);
}
- else if(tool == SCULPT_TOOL_SNAKE_HOOK)
+ else if (tool == SCULPT_TOOL_SNAKE_HOOK)
add_v3_v3(cache->true_location, cache->grab_delta);
/* compute 3d coordinate at same z from original location + mouse */
mul_v3_m4v3(loc, ob->obmat, cache->orig_grab_location);
initgrabz(cache->vc->rv3d, loc[0], loc[1], loc[2]);
- ED_view3d_win_to_delta(cache->vc->ar, cache->mouse, grab_location);
+ ED_view3d_win_to_3d(cache->vc->ar, loc, mouse, grab_location);
/* compute delta to move verts by */
- if(!cache->first_time) {
- switch(tool) {
- case SCULPT_TOOL_GRAB:
- case SCULPT_TOOL_THUMB:
- sub_v3_v3v3(delta, grab_location, cache->old_grab_location);
- invert_m4_m4(imat, ob->obmat);
- mul_mat3_m4_v3(imat, delta);
- add_v3_v3(cache->grab_delta, delta);
- break;
- case SCULPT_TOOL_CLAY_TUBES:
- case SCULPT_TOOL_NUDGE:
- sub_v3_v3v3(cache->grab_delta, grab_location, cache->old_grab_location);
- invert_m4_m4(imat, ob->obmat);
- mul_mat3_m4_v3(imat, cache->grab_delta);
- break;
- case SCULPT_TOOL_SNAKE_HOOK:
- sub_v3_v3v3(cache->grab_delta, grab_location, cache->old_grab_location);
- invert_m4_m4(imat, ob->obmat);
- mul_mat3_m4_v3(imat, cache->grab_delta);
- break;
+ if (!cache->first_time) {
+ switch (tool) {
+ case SCULPT_TOOL_GRAB:
+ case SCULPT_TOOL_THUMB:
+ sub_v3_v3v3(delta, grab_location, cache->old_grab_location);
+ invert_m4_m4(imat, ob->obmat);
+ mul_mat3_m4_v3(imat, delta);
+ add_v3_v3(cache->grab_delta, delta);
+ break;
+ case SCULPT_TOOL_CLAY_STRIPS:
+ case SCULPT_TOOL_NUDGE:
+ case SCULPT_TOOL_SNAKE_HOOK:
+ if (brush->flag & BRUSH_ANCHORED) {
+ float orig[3];
+ mul_v3_m4v3(orig, ob->obmat, cache->orig_grab_location);
+ sub_v3_v3v3(cache->grab_delta, grab_location, orig);
+ }
+ else {
+ sub_v3_v3v3(cache->grab_delta, grab_location,
+ cache->old_grab_location);
+ }
+
+ invert_m4_m4(imat, ob->obmat);
+ mul_mat3_m4_v3(imat, cache->grab_delta);
+ break;
}
}
else {
@@ -2997,12 +2999,12 @@ static void sculpt_update_brush_delta(Sculpt *sd, Object *ob, Brush *brush)
copy_v3_v3(cache->old_grab_location, grab_location);
- if(tool == SCULPT_TOOL_GRAB)
+ if (tool == SCULPT_TOOL_GRAB)
copy_v3_v3(sd->anchored_location, cache->true_location);
- else if(tool == SCULPT_TOOL_THUMB)
+ else if (tool == SCULPT_TOOL_THUMB)
copy_v3_v3(sd->anchored_location, cache->orig_grab_location);
- if(ELEM(tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_THUMB)) {
+ if (ELEM(tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_THUMB)) {
/* location stays the same for finding vertices in brush radius */
copy_v3_v3(cache->true_location, cache->orig_grab_location);
@@ -3015,8 +3017,8 @@ static void sculpt_update_brush_delta(Sculpt *sd, Object *ob, Brush *brush)
/* Initialize the stroke cache variants from operator properties */
static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
- struct PaintStroke *stroke,
- PointerRNA *ptr)
+ struct PaintStroke *stroke,
+ PointerRNA *ptr)
{
Scene *scene = CTX_data_scene(C);
SculptSession *ss = ob->sculpt;
@@ -3025,13 +3027,13 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
int dx, dy;
- //RNA_float_get_array(ptr, "location", cache->traced_location);
+ /* RNA_float_get_array(ptr, "location", cache->traced_location); */
if (cache->first_time ||
- !((brush->flag & BRUSH_ANCHORED)||
- (brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK)||
+ !((brush->flag & BRUSH_ANCHORED) ||
+ (brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK) ||
(brush->sculpt_tool == SCULPT_TOOL_ROTATE))
- )
+ )
{
RNA_float_get_array(ptr, "location", cache->true_location);
}
@@ -3040,60 +3042,61 @@ 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 */
- if(paint_space_stroke_enabled(brush) || cache->first_time)
+ * 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");
/* Truly temporary data that isn't stored in properties */
- sd->draw_pressure= 1;
- sd->pressure_value= cache->pressure;
+ sd->draw_pressure = 1;
+ sd->pressure_value = cache->pressure;
cache->previous_pixel_radius = cache->pixel_radius;
cache->pixel_radius = brush_size(scene, brush);
- if(cache->first_time) {
+ if (cache->first_time) {
if (!brush_use_locked_size(scene, brush)) {
- cache->initial_radius= paint_calc_object_space_radius(cache->vc, cache->true_location, brush_size(scene, brush));
+ cache->initial_radius = paint_calc_object_space_radius(cache->vc, cache->true_location, brush_size(scene, brush));
brush_set_unprojected_radius(scene, brush, cache->initial_radius);
}
else {
- cache->initial_radius= brush_unprojected_radius(scene, brush);
+ cache->initial_radius = brush_unprojected_radius(scene, brush);
}
}
- if(brush_use_size_pressure(scene, brush)) {
+ if (brush_use_size_pressure(scene, brush)) {
cache->pixel_radius *= cache->pressure;
- cache->radius= cache->initial_radius * cache->pressure;
+ cache->radius = cache->initial_radius * cache->pressure;
}
else
- cache->radius= cache->initial_radius;
+ cache->radius = cache->initial_radius;
- cache->radius_squared = cache->radius*cache->radius;
+ cache->radius_squared = cache->radius * cache->radius;
- if(!(brush->flag & BRUSH_ANCHORED ||
- ELEM4(brush->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK,
- SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE))) {
+ if (!(brush->flag & BRUSH_ANCHORED ||
+ ELEM4(brush->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK,
+ SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE)))
+ {
copy_v2_v2(cache->tex_mouse, cache->mouse);
if ( (brush->mtex.brush_map_mode == MTEX_MAP_MODE_FIXED) &&
- (brush->flag & BRUSH_RANDOM_ROTATION) &&
- !(brush->flag & BRUSH_RAKE))
+ (brush->flag & BRUSH_RANDOM_ROTATION) &&
+ !(brush->flag & BRUSH_RAKE))
{
- cache->special_rotation = 2.0f*(float)M_PI*BLI_frand();
+ cache->special_rotation = 2.0f * (float)M_PI * BLI_frand();
}
}
- if(brush->flag & BRUSH_ANCHORED) {
+ if (brush->flag & BRUSH_ANCHORED) {
int hit = 0;
dx = cache->mouse[0] - cache->initial_mouse[0];
dy = cache->mouse[1] - cache->initial_mouse[1];
- sd->anchored_size = cache->pixel_radius = sqrt(dx*dx + dy*dy);
+ sd->anchored_size = cache->pixel_radius = sqrt(dx * dx + dy * dy);
cache->special_rotation = atan2(dx, dy) + M_PI;
@@ -3118,16 +3121,16 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
if (!hit)
copy_v2_v2(sd->anchored_initial_mouse, cache->initial_mouse);
- cache->radius= paint_calc_object_space_radius(paint_stroke_view_context(stroke),
- cache->true_location,
- cache->pixel_radius);
- cache->radius_squared = cache->radius*cache->radius;
+ cache->radius = paint_calc_object_space_radius(paint_stroke_view_context(stroke),
+ cache->true_location,
+ cache->pixel_radius);
+ cache->radius_squared = cache->radius * cache->radius;
copy_v3_v3(sd->anchored_location, cache->true_location);
sd->draw_anchored = 1;
}
- else if(brush->flag & BRUSH_RAKE) {
+ else if (brush->flag & BRUSH_RAKE) {
const float u = 0.5f;
const float v = 1 - u;
const float r = 20;
@@ -3138,17 +3141,17 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
if (cache->first_time) {
copy_v2_v2(cache->last_rake, cache->mouse);
}
- else if (dx*dx + dy*dy >= r*r) {
+ else if (dx * dx + dy * dy >= r * r) {
cache->special_rotation = atan2(dx, dy);
- cache->last_rake[0] = u*cache->last_rake[0] + v*cache->mouse[0];
- cache->last_rake[1] = u*cache->last_rake[1] + v*cache->mouse[1];
+ cache->last_rake[0] = u * cache->last_rake[0] + v * cache->mouse[0];
+ cache->last_rake[1] = u * cache->last_rake[1] + v * cache->mouse[1];
}
}
sculpt_update_brush_delta(sd, ob, brush);
- if(brush->sculpt_tool == SCULPT_TOOL_ROTATE) {
+ if (brush->sculpt_tool == SCULPT_TOOL_ROTATE) {
dx = cache->mouse[0] - cache->initial_mouse[0];
dy = cache->mouse[1] - cache->initial_mouse[1];
@@ -3167,7 +3170,7 @@ static void sculpt_stroke_modifiers_check(bContext *C, Object *ob)
{
SculptSession *ss = ob->sculpt;
- if(ss->modifiers_active) {
+ if (ss->modifiers_active) {
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
Brush *brush = paint_brush(&sd->paint);
@@ -3183,16 +3186,16 @@ typedef struct {
int original;
} SculptRaycastData;
-static void sculpt_raycast_cb(PBVHNode *node, void *data_v, float* tmin)
+static void sculpt_raycast_cb(PBVHNode *node, void *data_v, float *tmin)
{
if (BLI_pbvh_node_get_tmin(node) < *tmin) {
SculptRaycastData *srd = data_v;
- float (*origco)[3]= NULL;
+ float (*origco)[3] = NULL;
- if(srd->original && srd->ss->cache) {
+ if (srd->original && srd->ss->cache) {
/* intersect with coordinates from before we started stroke */
- SculptUndoNode *unode= sculpt_undo_get_node(node);
- origco= (unode)? unode->co: NULL;
+ SculptUndoNode *unode = sculpt_undo_get_node(node);
+ origco = (unode) ? unode->co : NULL;
}
if (BLI_pbvh_node_raycast(srd->ss->pbvh, node, origco, srd->ray_start, srd->ray_normal, &srd->dist)) {
@@ -3203,8 +3206,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])
{
@@ -3235,14 +3238,14 @@ int sculpt_stroke_get_location(bContext *C, float out[3], float mouse[2])
mul_m4_v3(obimat, ray_end);
sub_v3_v3v3(ray_normal, ray_end, ray_start);
- dist= normalize_v3(ray_normal);
+ dist = normalize_v3(ray_normal);
srd.ss = vc.obact->sculpt;
srd.ray_start = ray_start;
srd.ray_normal = ray_normal;
srd.dist = dist;
srd.hit = 0;
- srd.original = (cache)? cache->original: 0;
+ srd.original = (cache) ? cache->original : 0;
BLI_pbvh_raycast(ss->pbvh, sculpt_raycast_cb, &srd,
ray_start, ray_normal, srd.original);
@@ -3256,33 +3259,33 @@ int sculpt_stroke_get_location(bContext *C, float out[3], float mouse[2])
static void sculpt_brush_init_tex(const Scene *scene, Sculpt *sd, SculptSession *ss)
{
Brush *brush = paint_brush(&sd->paint);
- MTex *mtex= &brush->mtex;
+ MTex *mtex = &brush->mtex;
/* init mtex nodes */
- if(mtex->tex && mtex->tex->nodetree)
- ntreeTexBeginExecTree(mtex->tex->nodetree, 1); /* has internal flag to detect it only does it once */
+ if (mtex->tex && mtex->tex->nodetree)
+ 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);
}
static int sculpt_brush_stroke_init(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_active_object(C);
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = CTX_data_active_object(C);
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
SculptSession *ss = CTX_data_active_object(C)->sculpt;
Brush *brush = paint_brush(&sd->paint);
- int mode= RNA_enum_get(op->ptr, "mode");
- int is_smooth= 0;
+ int mode = RNA_enum_get(op->ptr, "mode");
+ int is_smooth = 0;
view3d_operator_needs_opengl(C);
sculpt_brush_init_tex(scene, sd, ss);
- is_smooth|= mode == BRUSH_STROKE_SMOOTH;
- is_smooth|= brush->sculpt_tool == SCULPT_TOOL_SMOOTH;
+ is_smooth |= mode == BRUSH_STROKE_SMOOTH;
+ is_smooth |= brush->sculpt_tool == SCULPT_TOOL_SMOOTH;
sculpt_update_mesh_elements(scene, sd, ob, is_smooth);
@@ -3294,10 +3297,10 @@ static void sculpt_restore_mesh(Sculpt *sd, SculptSession *ss)
Brush *brush = paint_brush(&sd->paint);
/* Restore the mesh before continuing with anchored stroke */
- if((brush->flag & BRUSH_ANCHORED) ||
- (brush->sculpt_tool == SCULPT_TOOL_GRAB &&
- brush_use_size_pressure(ss->cache->vc->scene, brush)) ||
- (brush->flag & BRUSH_RESTORE_MESH))
+ if ((brush->flag & BRUSH_ANCHORED) ||
+ (brush->sculpt_tool == SCULPT_TOOL_GRAB &&
+ brush_use_size_pressure(ss->cache->vc->scene, brush)) ||
+ (brush->flag & BRUSH_RESTORE_MESH))
{
StrokeCache *cache = ss->cache;
int i;
@@ -3308,19 +3311,19 @@ static void sculpt_restore_mesh(Sculpt *sd, SculptSession *ss)
BLI_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode);
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
- for(n=0; n<totnode; n++) {
+ for (n = 0; n < totnode; n++) {
SculptUndoNode *unode;
- unode= sculpt_undo_get_node(nodes[n]);
- if(unode) {
+ unode = sculpt_undo_get_node(nodes[n]);
+ if (unode) {
PBVHVertexIter vd;
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
copy_v3_v3(vd.co, unode->co[vd.i]);
- if(vd.no) copy_v3_v3_short(vd.no, unode->no[vd.i]);
+ if (vd.no) copy_v3_v3_short(vd.no, unode->no[vd.i]);
else normal_short_to_float_v3(vd.fno, unode->no[vd.i]);
- if(vd.mvert) vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
+ if (vd.mvert) vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
BLI_pbvh_vertex_iter_end;
@@ -3328,13 +3331,13 @@ static void sculpt_restore_mesh(Sculpt *sd, SculptSession *ss)
}
}
- if(ss->face_normals) {
+ if (ss->face_normals) {
float *fn = ss->face_normals;
- for(i = 0; i < ss->totpoly; ++i, fn += 3)
+ for (i = 0; i < ss->totpoly; ++i, fn += 3)
copy_v3_v3(fn, cache->face_norms[i]);
}
- if(nodes)
+ if (nodes)
MEM_freeN(nodes);
}
}
@@ -3346,12 +3349,12 @@ static void sculpt_flush_update(bContext *C)
ARegion *ar = CTX_wm_region(C);
MultiresModifierData *mmd = ss->multires;
- if(mmd)
- multires_mark_as_modified(ob);
- if(ob->derivedFinal) /* VBO no longer valid */
+ if (mmd)
+ multires_mark_as_modified(ob, MULTIRES_COORDS_MODIFIED);
+ if (ob->derivedFinal) /* VBO no longer valid */
GPU_drawobject_free(ob->derivedFinal);
- if(ss->modifiers_active) {
+ if (ss->modifiers_active) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
ED_region_tag_redraw(ar);
}
@@ -3361,7 +3364,7 @@ static void sculpt_flush_update(bContext *C)
BLI_pbvh_update(ss->pbvh, PBVH_UpdateBB, NULL);
if (sculpt_get_redraw_rect(ar, CTX_wm_region_view3d(C), ob, &r)) {
if (ss->cache)
- ss->cache->previous_r= r;
+ ss->cache->previous_r = r;
r.xmin += ar->winrct.xmin + 1;
r.xmax += ar->winrct.xmin - 1;
@@ -3375,7 +3378,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];
@@ -3387,11 +3390,11 @@ static int over_mesh(bContext *C, struct wmOperator *UNUSED(op), float x, float
}
static int sculpt_stroke_test_start(bContext *C, struct wmOperator *op,
- wmEvent *event)
+ wmEvent *event)
{
/* Don't start the stroke until mouse goes over the mesh.
* note: event will only be null when re-executing the saved stroke. */
- if(event==NULL || over_mesh(C, op, event->x, event->y)) {
+ if (event == NULL || over_mesh(C, op, event->x, event->y)) {
Object *ob = CTX_data_active_object(C);
SculptSession *ss = ob->sculpt;
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
@@ -3404,14 +3407,14 @@ 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;
num_procs = omp_get_num_procs();
- omp_set_num_threads(2*num_procs);
+ omp_set_num_threads(2 * num_procs);
}
#endif
@@ -3438,36 +3441,36 @@ static void sculpt_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
static void sculpt_brush_exit_tex(Sculpt *sd)
{
- Brush *brush= paint_brush(&sd->paint);
- MTex *mtex= &brush->mtex;
+ Brush *brush = paint_brush(&sd->paint);
+ MTex *mtex = &brush->mtex;
- if(mtex->tex && mtex->tex->nodetree)
+ if (mtex->tex && mtex->tex->nodetree)
ntreeTexEndExecTree(mtex->tex->nodetree->execdata, 1);
}
static void sculpt_stroke_done(bContext *C, struct PaintStroke *UNUSED(stroke))
{
- Object *ob= CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
SculptSession *ss = ob->sculpt;
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
- // reset values used to draw brush after completing the stroke
- sd->draw_anchored= 0;
- sd->draw_pressure= 0;
- sd->special_rotation= 0;
+ /* reset values used to draw brush after completing the stroke */
+ sd->draw_anchored = 0;
+ sd->draw_pressure = 0;
+ sd->special_rotation = 0;
/* Finished */
- if(ss->cache) {
- Brush *brush= paint_brush(&sd->paint);
+ if (ss->cache) {
+ Brush *brush = paint_brush(&sd->paint);
brush->flag &= ~BRUSH_INVERTED;
sculpt_stroke_modifiers_check(C, ob);
/* Alt-Smooth */
if (ss->cache->alt_smooth) {
- Paint *p= &sd->paint;
- brush= (Brush *)find_id("BR", ss->cache->saved_active_brush_name);
- if(brush) {
+ Paint *p = &sd->paint;
+ brush = (Brush *)find_id("BR", ss->cache->saved_active_brush_name);
+ if (brush) {
paint_brush_set(p, brush);
}
}
@@ -3482,15 +3485,15 @@ static void sculpt_stroke_done(bContext *C, struct PaintStroke *UNUSED(stroke))
/* optimization: if there is locked key and active modifiers present in */
/* the stack, keyblock is updating at each step. otherwise we could update */
/* keyblock only when stroke is finished */
- if(ss->kb && !ss->modifiers_active) sculpt_update_keyblock(ob);
+ if (ss->kb && !ss->modifiers_active) sculpt_update_keyblock(ob);
ss->partial_redraw = 0;
/* try to avoid calling this, only for e.g. linked duplicates now */
- if(((Mesh*)ob->data)->id.us > 1)
+ if (((Mesh *)ob->data)->id.us > 1)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
}
sculpt_brush_exit_tex(sd);
@@ -3501,7 +3504,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *even
struct PaintStroke *stroke;
int ignore_background_click;
- if(!sculpt_brush_stroke_init(C, op))
+ if (!sculpt_brush_stroke_init(C, op))
return OPERATOR_CANCELLED;
stroke = paint_stroke_new(C, sculpt_stroke_get_location,
@@ -3513,9 +3516,9 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *even
/* For tablet rotation */
ignore_background_click = RNA_boolean_get(op->ptr,
- "ignore_background_click");
+ "ignore_background_click");
- if(ignore_background_click && !over_mesh(C, op, event->x, event->y)) {
+ if (ignore_background_click && !over_mesh(C, op, event->x, event->y)) {
paint_stroke_free(stroke);
return OPERATOR_PASS_THROUGH;
}
@@ -3530,11 +3533,11 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *even
static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op)
{
- if(!sculpt_brush_stroke_init(C, op))
+ if (!sculpt_brush_stroke_init(C, op))
return OPERATOR_CANCELLED;
op->customdata = paint_stroke_new(C, sculpt_stroke_get_location, sculpt_stroke_test_start,
- sculpt_stroke_update_step, sculpt_stroke_done, 0);
+ sculpt_stroke_update_step, sculpt_stroke_done, 0);
/* frees op->customdata */
paint_stroke_exec(C, op);
@@ -3544,13 +3547,13 @@ static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op)
static int sculpt_brush_stroke_cancel(bContext *C, wmOperator *op)
{
- Object *ob= CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
SculptSession *ss = ob->sculpt;
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
paint_stroke_cancel(C, op);
- if(ss->cache) {
+ if (ss->cache) {
sculpt_cache_free(ss->cache);
ss->cache = NULL;
}
@@ -3570,31 +3573,31 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Sculpt Mode";
- ot->idname= "SCULPT_OT_brush_stroke";
+ ot->name = "Sculpt Mode";
+ ot->idname = "SCULPT_OT_brush_stroke";
/* api callbacks */
- ot->invoke= sculpt_brush_stroke_invoke;
- ot->modal= paint_stroke_modal;
- ot->exec= sculpt_brush_stroke_exec;
- ot->poll= sculpt_poll;
- ot->cancel= sculpt_brush_stroke_cancel;
+ ot->invoke = sculpt_brush_stroke_invoke;
+ ot->modal = paint_stroke_modal;
+ ot->exec = sculpt_brush_stroke_exec;
+ ot->poll = sculpt_poll;
+ ot->cancel = sculpt_brush_stroke_cancel;
/* flags (sculpt does own undo? (ton) */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
/* properties */
RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement,
- "Stroke", "");
+ "Stroke", "");
RNA_def_enum(ot->srna, "mode", stroke_mode_items, BRUSH_STROKE_NORMAL,
- "Sculpt Stroke Mode",
- "Action taken when a sculpt stroke is made");
+ "Sculpt Stroke Mode",
+ "Action taken when a sculpt stroke is made");
RNA_def_boolean(ot->srna, "ignore_background_click", 0,
- "Ignore Background Click",
- "Clicks on the background do not start the stroke");
+ "Ignore Background Click",
+ "Clicks on the background do not start the stroke");
}
/**** Reset the copy of the mesh that is being sculpted on (currently just for the layer brush) ****/
@@ -3603,8 +3606,8 @@ static int sculpt_set_persistent_base(bContext *C, wmOperator *UNUSED(op))
{
SculptSession *ss = CTX_data_active_object(C)->sculpt;
- if(ss) {
- if(ss->layer_co)
+ if (ss) {
+ if (ss->layer_co)
MEM_freeN(ss->layer_co);
ss->layer_co = NULL;
}
@@ -3615,14 +3618,14 @@ static int sculpt_set_persistent_base(bContext *C, wmOperator *UNUSED(op))
static void SCULPT_OT_set_persistent_base(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Persistent Base";
- ot->idname= "SCULPT_OT_set_persistent_base";
+ ot->name = "Set Persistent Base";
+ ot->idname = "SCULPT_OT_set_persistent_base";
/* api callbacks */
- ot->exec= sculpt_set_persistent_base;
- ot->poll= sculpt_mode_poll;
+ ot->exec = sculpt_set_persistent_base;
+ ot->poll = sculpt_mode_poll;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/**** Toggle operator for turning sculpt mode on or off ****/
@@ -3639,19 +3642,19 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *UNUSED(op))
Scene *scene = CTX_data_scene(C);
ToolSettings *ts = CTX_data_tool_settings(C);
Object *ob = CTX_data_active_object(C);
- MultiresModifierData *mmd= sculpt_multires_active(scene, ob);
- int flush_recalc= 0;
+ MultiresModifierData *mmd = sculpt_multires_active(scene, ob);
+ int flush_recalc = 0;
/* multires in sculpt mode could have different from object mode subdivision level */
flush_recalc |= mmd && mmd->sculptlvl != mmd->lvl;
/* if object has got active modifiers, it's dm could be different in sculpt mode */
flush_recalc |= sculpt_has_active_modifiers(scene, ob);
- if(ob->mode & OB_MODE_SCULPT) {
- if(mmd)
+ if (ob->mode & OB_MODE_SCULPT) {
+ if (mmd)
multires_force_update(ob);
- if(flush_recalc)
+ if (flush_recalc)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
/* Leave sculptmode */
@@ -3663,11 +3666,11 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *UNUSED(op))
/* Enter sculptmode */
ob->mode |= OB_MODE_SCULPT;
- if(flush_recalc)
+ if (flush_recalc)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
/* Create persistent sculpt mode data */
- if(!ts->sculpt) {
+ if (!ts->sculpt) {
ts->sculpt = MEM_callocN(sizeof(Sculpt), "sculpt mode data");
/* Turn on X plane mirror symmetry by default */
@@ -3675,7 +3678,7 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *UNUSED(op))
}
/* Create sculpt mode session data */
- if(ob->sculpt)
+ if (ob->sculpt)
free_sculptsession(ob);
sculpt_init_session(scene, ob);
@@ -3685,7 +3688,7 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *UNUSED(op))
paint_cursor_start(C, sculpt_poll);
}
- WM_event_add_notifier(C, NC_SCENE|ND_MODE, CTX_data_scene(C));
+ WM_event_add_notifier(C, NC_SCENE | ND_MODE, CTX_data_scene(C));
return OPERATOR_FINISHED;
}
@@ -3693,14 +3696,14 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *UNUSED(op))
static void SCULPT_OT_sculptmode_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Sculpt Mode";
- ot->idname= "SCULPT_OT_sculptmode_toggle";
+ ot->name = "Sculpt Mode";
+ ot->idname = "SCULPT_OT_sculptmode_toggle";
/* api callbacks */
- ot->exec= sculpt_toggle_mode;
- ot->poll= ED_operator_object_active_editable_mesh;
+ ot->exec = sculpt_toggle_mode;
+ ot->poll = ED_operator_object_active_editable_mesh;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
void ED_operatortypes_sculpt(void)
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index 8ece42b7d2f..8ccf55ec4fb 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -37,6 +37,7 @@
#include "DNA_vec_types.h"
#include "DNA_key_types.h"
+#include "BLI_bitmap.h"
#include "BLI_pbvh.h"
struct bContext;
@@ -54,6 +55,7 @@ struct MultiresModifierData *sculpt_multires_active(struct Scene *scene, struct
void sculpt(Sculpt *sd);
+int sculpt_mode_poll(struct bContext *C);
int sculpt_poll(struct bContext *C);
void sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct Object *ob, int need_pmap);
@@ -65,9 +67,16 @@ int sculpt_stroke_get_location(bContext *C, float out[3], float mouse[2]);
/* Undo */
+typedef enum {
+ SCULPT_UNDO_COORDS,
+ SCULPT_UNDO_HIDDEN
+} SculptUndoType;
+
typedef struct SculptUndoNode {
struct SculptUndoNode *next, *prev;
+ SculptUndoType type;
+
char idname[MAX_ID_NAME]; /* name instead of pointer*/
void *node; /* only during push, not valid afterwards! */
@@ -79,12 +88,14 @@ typedef struct SculptUndoNode {
/* non-multires */
int maxvert; /* to verify if totvert it still the same */
int *index; /* to restore into right location */
+ BLI_bitmap vert_hidden;
/* multires */
int maxgrid; /* same for grid */
int gridsize; /* same for grid */
int totgrid; /* to restore into right location */
int *grids; /* to restore into right location */
+ BLI_bitmap *grid_hidden;
/* layer brush */
float *layer_disp;
@@ -93,7 +104,7 @@ typedef struct SculptUndoNode {
char shapeName[sizeof(((KeyBlock *)0))->name];
} SculptUndoNode;
-SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node);
+SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType type);
SculptUndoNode *sculpt_undo_get_node(PBVHNode *node);
void sculpt_undo_push_begin(const char *name);
void sculpt_undo_push_end(void);
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 46a75d3b722..5378ce7872a 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -55,6 +55,7 @@
#include "BKE_paint.h"
#include "BKE_key.h"
#include "BKE_mesh.h"
+#include "BKE_subsurf.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -67,59 +68,66 @@
/************************** Undo *************************/
-static void update_cb(PBVHNode *node, void *UNUSED(unused))
+static void update_cb(PBVHNode *node, void *rebuild)
{
BLI_pbvh_node_mark_update(node);
+ if (*((int *)rebuild))
+ BLI_pbvh_node_mark_rebuild_draw(node);
+ BLI_pbvh_node_fully_hidden_set(node, 0);
}
static void sculpt_undo_restore_deformed(SculptSession *ss, SculptUndoNode *unode, int uindex, int oindex, float coord[3])
{
- if(unode->orig_co) {
+ if (unode->orig_co) {
swap_v3_v3(coord, unode->orig_co[uindex]);
copy_v3_v3(unode->co[uindex], ss->deform_cos[oindex]);
- } else swap_v3_v3(coord, unode->co[uindex]);
+ }
+ else {
+ swap_v3_v3(coord, unode->co[uindex]);
+ }
}
static int sculpt_undo_restore_coords(bContext *C, DerivedMesh *dm, SculptUndoNode *unode)
{
- Scene *scene= CTX_data_scene(C);
- Sculpt *sd= CTX_data_tool_settings(C)->sculpt;
- Object *ob= CTX_data_active_object(C);
- SculptSession *ss= ob->sculpt;
+ Scene *scene = CTX_data_scene(C);
+ Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
+ Object *ob = CTX_data_active_object(C);
+ SculptSession *ss = ob->sculpt;
MVert *mvert;
int *index, i, j;
- if(unode->maxvert) {
+ if (unode->maxvert) {
/* regular mesh restore */
if (ss->kb && strcmp(ss->kb->name, unode->shapeName)) {
/* shape key has been changed before calling undo operator */
- Key *key= ob_get_key(ob);
- KeyBlock *kb= key_get_named_keyblock(key, unode->shapeName);
+ Key *key = ob_get_key(ob);
+ KeyBlock *kb = key_get_named_keyblock(key, unode->shapeName);
if (kb) {
- ob->shapenr= BLI_findindex(&key->block, kb) + 1;
+ ob->shapenr = BLI_findindex(&key->block, kb) + 1;
sculpt_update_mesh_elements(scene, sd, ob, 0);
- WM_event_add_notifier(C, NC_OBJECT|ND_DATA, ob);
- } else {
+ WM_event_add_notifier(C, NC_OBJECT | ND_DATA, ob);
+ }
+ else {
/* key has been removed -- skip this undo node */
return 0;
}
}
- index= unode->index;
- mvert= ss->mvert;
+ index = unode->index;
+ mvert = ss->mvert;
if (ss->kb) {
float (*vertCos)[3];
- vertCos= key_to_vertcos(ob, ss->kb);
+ vertCos = key_to_vertcos(ob, ss->kb);
- for(i=0; i<unode->totvert; i++) {
- if(ss->modifiers_active) sculpt_undo_restore_deformed(ss, unode, i, index[i], vertCos[index[i]]);
+ for (i = 0; i < unode->totvert; i++) {
+ if (ss->modifiers_active) sculpt_undo_restore_deformed(ss, unode, i, index[i], vertCos[index[i]]);
else {
- if(unode->orig_co) swap_v3_v3(vertCos[index[i]], unode->orig_co[i]);
+ if (unode->orig_co) swap_v3_v3(vertCos[index[i]], unode->orig_co[i]);
else swap_v3_v3(vertCos[index[i]], unode->co[i]);
}
}
@@ -132,31 +140,32 @@ static int sculpt_undo_restore_coords(bContext *C, DerivedMesh *dm, SculptUndoNo
BLI_pbvh_apply_vertCos(ss->pbvh, vertCos);
MEM_freeN(vertCos);
- } else {
- for(i=0; i<unode->totvert; i++) {
- if(ss->modifiers_active) sculpt_undo_restore_deformed(ss, unode, i, index[i], mvert[index[i]].co);
+ }
+ else {
+ for (i = 0; i < unode->totvert; i++) {
+ if (ss->modifiers_active) sculpt_undo_restore_deformed(ss, unode, i, index[i], mvert[index[i]].co);
else {
- if(unode->orig_co) swap_v3_v3(mvert[index[i]].co, unode->orig_co[i]);
+ if (unode->orig_co) swap_v3_v3(mvert[index[i]].co, unode->orig_co[i]);
else swap_v3_v3(mvert[index[i]].co, unode->co[i]);
}
mvert[index[i]].flag |= ME_VERT_PBVH_UPDATE;
}
}
}
- else if(unode->maxgrid && dm->getGridData) {
+ else if (unode->maxgrid && dm->getGridData) {
/* multires restore */
DMGridData **grids, *grid;
float (*co)[3];
int gridsize;
- grids= dm->getGridData(dm);
- gridsize= dm->getGridSize(dm);
+ grids = dm->getGridData(dm);
+ gridsize = dm->getGridSize(dm);
co = unode->co;
- for(j=0; j<unode->totgrid; j++) {
- grid= grids[unode->grids[j]];
+ for (j = 0; j < unode->totgrid; j++) {
+ grid = grids[unode->grids[j]];
- for(i=0; i<gridsize*gridsize; i++, co++)
+ for (i = 0; i < gridsize * gridsize; i++, co++)
swap_v3_v3(grid[i].co, co[0]);
}
}
@@ -164,6 +173,44 @@ static int sculpt_undo_restore_coords(bContext *C, DerivedMesh *dm, SculptUndoNo
return 1;
}
+static int sculpt_undo_restore_hidden(bContext *C, DerivedMesh *dm,
+ SculptUndoNode *unode)
+{
+ Object *ob = CTX_data_active_object(C);
+ SculptSession *ss = ob->sculpt;
+ int i;
+
+ if (unode->maxvert) {
+ MVert *mvert = ss->mvert;
+
+ for (i = 0; i < unode->totvert; i++) {
+ MVert *v = &mvert[unode->index[i]];
+ int uval = BLI_BITMAP_GET(unode->vert_hidden, i);
+
+ BLI_BITMAP_MODIFY(unode->vert_hidden, i,
+ v->flag & ME_HIDE);
+ if (uval)
+ v->flag |= ME_HIDE;
+ else
+ v->flag &= ~ME_HIDE;
+
+ v->flag |= ME_VERT_PBVH_UPDATE;
+ }
+ }
+ else if (unode->maxgrid && dm->getGridData) {
+ BLI_bitmap *grid_hidden = dm->getGridHidden(dm);
+
+ for (i = 0; i < unode->totgrid; i++) {
+ SWAP(BLI_bitmap,
+ unode->grid_hidden[i],
+ grid_hidden[unode->grids[i]]);
+
+ }
+ }
+
+ return 1;
+}
+
static void sculpt_undo_restore(bContext *C, ListBase *lb)
{
Scene *scene = CTX_data_scene(C);
@@ -173,55 +220,67 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
SculptSession *ss = ob->sculpt;
SculptUndoNode *unode;
MultiresModifierData *mmd;
- int update= 0;
+ int update = 0, rebuild = 1;
sculpt_update_mesh_elements(scene, sd, ob, 0);
- for(unode=lb->first; unode; unode=unode->next) {
- if(!(strcmp(unode->idname, ob->id.name)==0))
+ for (unode = lb->first; unode; unode = unode->next) {
+ if (!(strcmp(unode->idname, ob->id.name) == 0))
continue;
/* check if undo data matches current data well enough to
- continue */
- if(unode->maxvert) {
- if(ss->totvert != unode->maxvert)
+ * continue */
+ if (unode->maxvert) {
+ if (ss->totvert != unode->maxvert)
continue;
}
- else if(unode->maxgrid && dm->getGridData) {
- if((dm->getNumGrids(dm) != unode->maxgrid) ||
- (dm->getGridSize(dm) != unode->gridsize))
+ else if (unode->maxgrid && dm->getGridData) {
+ if ((dm->getNumGrids(dm) != unode->maxgrid) ||
+ (dm->getGridSize(dm) != unode->gridsize))
continue;
}
else {
continue;
}
- if(sculpt_undo_restore_coords(C, dm, unode))
- update= 1;
+ switch (unode->type) {
+ case SCULPT_UNDO_COORDS:
+ if (sculpt_undo_restore_coords(C, dm, unode))
+ update = 1;
+ break;
+ case SCULPT_UNDO_HIDDEN:
+ if (sculpt_undo_restore_hidden(C, dm, unode))
+ rebuild = 1;
+ break;
+ }
}
- if(update) {
- int tag_update= 0;
+ if (update || rebuild) {
+ 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 */
- BLI_pbvh_search_callback(ss->pbvh, NULL, NULL, update_cb, NULL);
- BLI_pbvh_update(ss->pbvh, PBVH_UpdateBB|PBVH_UpdateOriginalBB|PBVH_UpdateRedraw, NULL);
-
- if((mmd=sculpt_multires_active(scene, ob)))
- multires_mark_as_modified(ob);
+ * 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, &rebuild);
+ BLI_pbvh_update(ss->pbvh, PBVH_UpdateBB | PBVH_UpdateOriginalBB | PBVH_UpdateRedraw, NULL);
+
+ if ((mmd = sculpt_multires_active(scene, ob))) {
+ if (rebuild)
+ multires_mark_as_modified(ob, MULTIRES_HIDDEN_MODIFIED);
+ else
+ multires_mark_as_modified(ob, MULTIRES_COORDS_MODIFIED);
+ }
- tag_update= ((Mesh*)ob->data)->id.us > 1;
+ tag_update = ((Mesh *)ob->data)->id.us > 1;
- if(ss->modifiers_active) {
- Mesh *mesh= ob->data;
+ if (ss->modifiers_active) {
+ Mesh *mesh = ob->data;
mesh_calc_normals_mapping(mesh->mvert, mesh->totvert, mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly, NULL, NULL, 0, NULL, NULL);
free_sculptsession_deformMats(ss);
- tag_update|= 1;
+ tag_update |= 1;
}
- if(tag_update)
+ if (tag_update)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
/* for non-PBVH drawing, need to recreate VBOs */
@@ -232,80 +291,169 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
static void sculpt_undo_free(ListBase *lb)
{
SculptUndoNode *unode;
+ int i;
- for(unode=lb->first; unode; unode=unode->next) {
- if(unode->co)
+ for (unode = lb->first; unode; unode = unode->next) {
+ if (unode->co)
MEM_freeN(unode->co);
- if(unode->no)
+ if (unode->no)
MEM_freeN(unode->no);
- if(unode->index)
+ if (unode->index)
MEM_freeN(unode->index);
- if(unode->grids)
+ if (unode->grids)
MEM_freeN(unode->grids);
- if(unode->layer_disp)
+ if (unode->layer_disp)
MEM_freeN(unode->layer_disp);
- if(unode->orig_co)
+ if (unode->orig_co)
MEM_freeN(unode->orig_co);
+ if (unode->vert_hidden)
+ MEM_freeN(unode->vert_hidden);
+ if (unode->grid_hidden) {
+ for (i = 0; i < unode->totgrid; i++) {
+ if (unode->grid_hidden[i])
+ MEM_freeN(unode->grid_hidden[i]);
+ }
+ MEM_freeN(unode->grid_hidden);
+ }
}
}
SculptUndoNode *sculpt_undo_get_node(PBVHNode *node)
{
- ListBase *lb= undo_paint_push_get_list(UNDO_PAINT_MESH);
+ ListBase *lb = undo_paint_push_get_list(UNDO_PAINT_MESH);
SculptUndoNode *unode;
- if(!lb)
+ if (!lb)
return NULL;
- for(unode=lb->first; unode; unode=unode->next)
- if(unode->node == node)
+ for (unode = lb->first; unode; unode = unode->next)
+ if (unode->node == node)
return unode;
return NULL;
}
-SculptUndoNode *sculpt_undo_alloc_node(Object *ob, PBVHNode *node)
+static void sculpt_undo_alloc_and_store_hidden(PBVH *pbvh,
+ SculptUndoNode *unode)
{
- ListBase *lb= undo_paint_push_get_list(UNDO_PAINT_MESH);
+ PBVHNode *node = unode->node;
+ BLI_bitmap *grid_hidden;
+ int i, *grid_indices, totgrid;
+
+ grid_hidden = BLI_pbvh_grid_hidden(pbvh);
+
+ BLI_pbvh_node_get_grids(pbvh, node, &grid_indices, &totgrid,
+ NULL, NULL, NULL, NULL);
+
+ unode->grid_hidden = MEM_mapallocN(sizeof(BLI_bitmap) * totgrid,
+ "unode->grid_hidden");
+
+ for (i = 0; i < totgrid; i++) {
+ if (grid_hidden[grid_indices[i]])
+ unode->grid_hidden[i] = MEM_dupallocN(grid_hidden[grid_indices[i]]);
+ else
+ unode->grid_hidden[i] = NULL;
+ }
+}
+
+static SculptUndoNode *sculpt_undo_alloc_node(Object *ob, PBVHNode *node,
+ SculptUndoType type)
+{
+ ListBase *lb = undo_paint_push_get_list(UNDO_PAINT_MESH);
SculptUndoNode *unode;
- SculptSession *ss= ob->sculpt;
+ SculptSession *ss = ob->sculpt;
int totvert, allvert, totgrid, maxgrid, gridsize, *grids;
- unode= MEM_callocN(sizeof(SculptUndoNode), "SculptUndoNode");
+ unode = MEM_callocN(sizeof(SculptUndoNode), "SculptUndoNode");
BLI_strncpy(unode->idname, ob->id.name, sizeof(unode->idname));
- unode->node= node;
+ unode->type = type;
+ unode->node = node;
BLI_pbvh_node_num_verts(ss->pbvh, node, &totvert, &allvert);
BLI_pbvh_node_get_grids(ss->pbvh, node, &grids, &totgrid,
- &maxgrid, &gridsize, NULL, NULL);
+ &maxgrid, &gridsize, NULL, NULL);
- unode->totvert= totvert;
+ unode->totvert = totvert;
+
/* we will use this while sculpting, is mapalloc slow to access then? */
- unode->co= MEM_mapallocN(sizeof(float)*3*allvert, "SculptUndoNode.co");
- unode->no= MEM_mapallocN(sizeof(short)*3*allvert, "SculptUndoNode.no");
- undo_paint_push_count_alloc(UNDO_PAINT_MESH, (sizeof(float)*3 + sizeof(short)*3 + sizeof(int))*allvert);
+
+ /* general TODO, fix count_alloc */
+ switch (type) {
+ case SCULPT_UNDO_COORDS:
+ unode->co = MEM_mapallocN(sizeof(float) * 3 * allvert, "SculptUndoNode.co");
+ unode->no = MEM_mapallocN(sizeof(short) * 3 * allvert, "SculptUndoNode.no");
+ undo_paint_push_count_alloc(UNDO_PAINT_MESH, (sizeof(float) * 3 + sizeof(short) * 3 + sizeof(int)) * allvert);
+ break;
+ case SCULPT_UNDO_HIDDEN:
+ if (maxgrid)
+ sculpt_undo_alloc_and_store_hidden(ss->pbvh, unode);
+ else
+ unode->vert_hidden = BLI_BITMAP_NEW(allvert, "SculptUndoNode.vert_hidden");
+
+ break;
+ }
+
BLI_addtail(lb, unode);
- if(maxgrid) {
+ if (maxgrid) {
/* multires */
- unode->maxgrid= maxgrid;
- unode->totgrid= totgrid;
- unode->gridsize= gridsize;
- unode->grids= MEM_mapallocN(sizeof(int)*totgrid, "SculptUndoNode.grids");
+ unode->maxgrid = maxgrid;
+ unode->totgrid = totgrid;
+ unode->gridsize = gridsize;
+ unode->grids = MEM_mapallocN(sizeof(int) * totgrid, "SculptUndoNode.grids");
}
else {
/* regular mesh */
- unode->maxvert= ss->totvert;
- unode->index= MEM_mapallocN(sizeof(int)*allvert, "SculptUndoNode.index");
+ unode->maxvert = ss->totvert;
+ unode->index = MEM_mapallocN(sizeof(int) * allvert, "SculptUndoNode.index");
}
- if(ss->modifiers_active)
- unode->orig_co= MEM_callocN(allvert*sizeof(*unode->orig_co), "undoSculpt orig_cos");
+ if (ss->modifiers_active)
+ unode->orig_co = MEM_callocN(allvert * sizeof(*unode->orig_co), "undoSculpt orig_cos");
return unode;
}
-SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node)
+static void sculpt_undo_store_coords(Object *ob, SculptUndoNode *unode)
+{
+ SculptSession *ss = ob->sculpt;
+ PBVHVertexIter vd;
+
+ BLI_pbvh_vertex_iter_begin(ss->pbvh, unode->node, vd, PBVH_ITER_ALL) {
+ copy_v3_v3(unode->co[vd.i], vd.co);
+ if (vd.no) copy_v3_v3_short(unode->no[vd.i], vd.no);
+ else normal_float_to_short_v3(unode->no[vd.i], vd.fno);
+
+ if (ss->modifiers_active)
+ copy_v3_v3(unode->orig_co[vd.i], ss->orig_cos[unode->index[vd.i]]);
+ }
+ BLI_pbvh_vertex_iter_end;
+}
+
+static void sculpt_undo_store_hidden(Object *ob, SculptUndoNode *unode)
+{
+ PBVH *pbvh = ob->sculpt->pbvh;
+ PBVHNode *node = unode->node;
+
+ if (unode->grids) {
+ /* already stored during allocation */
+ }
+ else {
+ MVert *mvert;
+ int *vert_indices, allvert;
+ int i;
+
+ BLI_pbvh_node_num_verts(pbvh, node, NULL, &allvert);
+ BLI_pbvh_node_get_verts(pbvh, node, &vert_indices, &mvert);
+ for (i = 0; i < allvert; i++) {
+ BLI_BITMAP_MODIFY(unode->vert_hidden, i,
+ mvert[vert_indices[i]].flag & ME_HIDE);
+ }
+ }
+}
+
+SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node,
+ SculptUndoType type)
{
SculptSession *ss = ob->sculpt;
SculptUndoNode *unode;
@@ -313,41 +461,41 @@ SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node)
/* list is manipulated by multiple threads, so we lock */
BLI_lock_thread(LOCK_CUSTOM1);
- if((unode= sculpt_undo_get_node(node))) {
+ if ((unode = sculpt_undo_get_node(node))) {
BLI_unlock_thread(LOCK_CUSTOM1);
return unode;
}
- unode= sculpt_undo_alloc_node(ob, node);
-
+ unode = sculpt_undo_alloc_node(ob, node, type);
+
BLI_unlock_thread(LOCK_CUSTOM1);
/* copy threaded, hopefully this is the performance critical part */
- {
- PBVHVertexIter vd;
-
- BLI_pbvh_vertex_iter_begin(ss->pbvh, node, vd, PBVH_ITER_ALL) {
- copy_v3_v3(unode->co[vd.i], vd.co);
- if(vd.no) copy_v3_v3_short(unode->no[vd.i], vd.no);
- else normal_float_to_short_v3(unode->no[vd.i], vd.fno);
- if(vd.vert_indices) unode->index[vd.i]= vd.vert_indices[vd.i];
-
- if(ss->modifiers_active)
- copy_v3_v3(unode->orig_co[vd.i], ss->orig_cos[unode->index[vd.i]]);
- }
- BLI_pbvh_vertex_iter_end;
+ switch (type) {
+ case SCULPT_UNDO_COORDS:
+ sculpt_undo_store_coords(ob, unode);
+ break;
+ case SCULPT_UNDO_HIDDEN:
+ sculpt_undo_store_hidden(ob, unode);
+ break;
}
- if(unode->grids) {
+ if (unode->grids) {
int totgrid, *grids;
BLI_pbvh_node_get_grids(ss->pbvh, node, &grids, &totgrid,
- NULL, NULL, NULL, NULL);
- memcpy(unode->grids, grids, sizeof(int)*totgrid);
+ NULL, NULL, NULL, NULL);
+ memcpy(unode->grids, grids, sizeof(int) * totgrid);
+ }
+ else {
+ int *vert_indices, allvert;
+ BLI_pbvh_node_num_verts(ss->pbvh, node, NULL, &allvert);
+ BLI_pbvh_node_get_verts(ss->pbvh, node, &vert_indices, NULL);
+ memcpy(unode->index, vert_indices, sizeof(int) * unode->totvert);
}
/* store active shape key */
- if(ss->kb) BLI_strncpy(unode->shapeName, ss->kb->name, sizeof(ss->kb->name));
- else unode->shapeName[0]= '\0';
+ if (ss->kb) BLI_strncpy(unode->shapeName, ss->kb->name, sizeof(ss->kb->name));
+ else unode->shapeName[0] = '\0';
return unode;
}
@@ -355,24 +503,24 @@ SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node)
void sculpt_undo_push_begin(const char *name)
{
undo_paint_push_begin(UNDO_PAINT_MESH, name,
- sculpt_undo_restore, sculpt_undo_free);
+ sculpt_undo_restore, sculpt_undo_free);
}
void sculpt_undo_push_end(void)
{
- ListBase *lb= undo_paint_push_get_list(UNDO_PAINT_MESH);
+ ListBase *lb = undo_paint_push_get_list(UNDO_PAINT_MESH);
SculptUndoNode *unode;
/* we don't need normals in the undo stack */
- for(unode=lb->first; unode; unode=unode->next) {
- if(unode->no) {
+ for (unode = lb->first; unode; unode = unode->next) {
+ if (unode->no) {
MEM_freeN(unode->no);
- unode->no= NULL;
+ unode->no = NULL;
}
- if(unode->layer_disp) {
+ if (unode->layer_disp) {
MEM_freeN(unode->layer_disp);
- unode->layer_disp= NULL;
+ unode->layer_disp = NULL;
}
}
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c
index 9bdb151d55d..2a0118f9c24 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -68,7 +68,7 @@
#include "UI_view2d.h"
-#define MARK_BOUNDARY 1
+#define MARK_BOUNDARY 1
typedef struct UvAdjacencyElement {
/* pointer to original uvelement */
@@ -86,7 +86,7 @@ typedef struct UvEdge {
char flag;
}UvEdge;
-typedef struct UVInitialStrokeElement{
+typedef struct UVInitialStrokeElement {
/* index to unique uv */
int uv;
@@ -97,7 +97,7 @@ typedef struct UVInitialStrokeElement{
float initial_uv[2];
}UVInitialStrokeElement;
-typedef struct UVInitialStroke{
+typedef struct UVInitialStroke {
/* Initial Selection,for grab brushes for instance */
UVInitialStrokeElement *initialSelection;
@@ -110,7 +110,7 @@ typedef struct UVInitialStroke{
/* custom data for uv smoothing brush */
-typedef struct UvSculptData{
+typedef struct UvSculptData {
/* Contains the first of each set of coincident uvs.
* These will be used to perform smoothing on and propagate the changes
* to their coincident uvs */
@@ -146,10 +146,10 @@ typedef struct UvSculptData{
/*********** Improved Laplacian Relaxation Operator ************************/
/* original code by Raul Fernandez Hernandez "farsthary" *
- * adapted to uv smoothing by Antony Riakiatakis *
- ***************************************************************************/
+* adapted to uv smoothing by Antony Riakiatakis *
+***************************************************************************/
-typedef struct Temp_UvData{
+typedef struct Temp_UvData {
float sum_co[2], p[2], b[2], sum_b[2];
int ncounter;
}Temp_UVData;
@@ -169,7 +169,7 @@ void HC_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *sculptdata, float
/* counting neighbors */
for (i = 0; i < sculptdata->totalUvEdges; i++) {
- UvEdge *tmpedge = sculptdata->uvedges+i;
+ UvEdge *tmpedge = sculptdata->uvedges + i;
tmp_uvdata[tmpedge->uv1].ncounter++;
tmp_uvdata[tmpedge->uv2].ncounter++;
@@ -178,16 +178,16 @@ void HC_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *sculptdata, float
}
for (i = 0; i < sculptdata->totalUniqueUvs; i++) {
- copy_v2_v2(diff,tmp_uvdata[i].sum_co);
- mul_v2_fl(diff,1.f/tmp_uvdata[i].ncounter);
- copy_v2_v2(tmp_uvdata[i].p,diff);
+ copy_v2_v2(diff, tmp_uvdata[i].sum_co);
+ mul_v2_fl(diff, 1.f / tmp_uvdata[i].ncounter);
+ copy_v2_v2(tmp_uvdata[i].p, diff);
tmp_uvdata[i].b[0] = diff[0] - sculptdata->uv[i].uv[0];
tmp_uvdata[i].b[1] = diff[1] - sculptdata->uv[i].uv[1];
}
for (i = 0; i < sculptdata->totalUvEdges; i++) {
- UvEdge *tmpedge = sculptdata->uvedges+i;
+ UvEdge *tmpedge = sculptdata->uvedges + i;
add_v2_v2(tmp_uvdata[tmpedge->uv1].sum_b, tmp_uvdata[tmpedge->uv2].b);
add_v2_v2(tmp_uvdata[tmpedge->uv2].sum_b, tmp_uvdata[tmpedge->uv1].b);
}
@@ -205,10 +205,10 @@ void HC_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *sculptdata, float
if ((dist = dot_v2v2(diff, diff)) <= radius) {
UvElement *element;
float strength;
- strength = alpha*brush_curve_strength(brush, sqrt(dist), radius_root);
+ strength = alpha * brush_curve_strength(brush, sqrt(dist), radius_root);
- sculptdata->uv[i].uv[0] = (1.0-strength)*sculptdata->uv[i].uv[0] + strength*(tmp_uvdata[i].p[0] - 0.5f*(tmp_uvdata[i].b[0] + tmp_uvdata[i].sum_b[0]/tmp_uvdata[i].ncounter));
- sculptdata->uv[i].uv[1] = (1.0-strength)*sculptdata->uv[i].uv[1] + strength*(tmp_uvdata[i].p[1] - 0.5f*(tmp_uvdata[i].b[1] + tmp_uvdata[i].sum_b[1]/tmp_uvdata[i].ncounter));
+ sculptdata->uv[i].uv[0] = (1.0 - strength) * sculptdata->uv[i].uv[0] + strength * (tmp_uvdata[i].p[0] - 0.5f * (tmp_uvdata[i].b[0] + tmp_uvdata[i].sum_b[0] / tmp_uvdata[i].ncounter));
+ sculptdata->uv[i].uv[1] = (1.0 - strength) * sculptdata->uv[i].uv[1] + strength * (tmp_uvdata[i].p[1] - 0.5f * (tmp_uvdata[i].b[1] + tmp_uvdata[i].sum_b[1] / tmp_uvdata[i].ncounter));
for (element = sculptdata->uv[i].element; element; element = element->next) {
MLoopUV *luv;
@@ -241,7 +241,7 @@ static void laplacian_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *scul
/* counting neighbors */
for (i = 0; i < sculptdata->totalUvEdges; i++) {
- UvEdge *tmpedge = sculptdata->uvedges+i;
+ UvEdge *tmpedge = sculptdata->uvedges + i;
tmp_uvdata[tmpedge->uv1].ncounter++;
tmp_uvdata[tmpedge->uv2].ncounter++;
@@ -253,7 +253,7 @@ static void laplacian_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *scul
* needed since we translate along the UV plane always.*/
for (i = 0; i < sculptdata->totalUniqueUvs; i++) {
copy_v2_v2(tmp_uvdata[i].p, tmp_uvdata[i].sum_co);
- mul_v2_fl(tmp_uvdata[i].p, 1.f/tmp_uvdata[i].ncounter);
+ mul_v2_fl(tmp_uvdata[i].p, 1.f / tmp_uvdata[i].ncounter);
}
for (i = 0; i < sculptdata->totalUniqueUvs; i++) {
@@ -269,10 +269,10 @@ static void laplacian_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *scul
if ((dist = dot_v2v2(diff, diff)) <= radius) {
UvElement *element;
float strength;
- strength = alpha*brush_curve_strength(brush, sqrt(dist), radius_root);
+ strength = alpha * brush_curve_strength(brush, sqrt(dist), radius_root);
- sculptdata->uv[i].uv[0] = (1.0-strength)*sculptdata->uv[i].uv[0] + strength*tmp_uvdata[i].p[0];
- sculptdata->uv[i].uv[1] = (1.0-strength)*sculptdata->uv[i].uv[1] + strength*tmp_uvdata[i].p[1];
+ sculptdata->uv[i].uv[0] = (1.0 - strength) * sculptdata->uv[i].uv[0] + strength * tmp_uvdata[i].p[0];
+ sculptdata->uv[i].uv[1] = (1.0 - strength) * sculptdata->uv[i].uv[1] + strength * tmp_uvdata[i].p[1];
for (element = sculptdata->uv[i].element; element; element = element->next) {
MLoopUV *luv;
@@ -299,7 +299,7 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event,
float co[2], radius, radius_root;
Scene *scene = CTX_data_scene(C);
ARegion *ar = CTX_wm_region(C);
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
unsigned int tool;
UvSculptData *sculptdata = (UvSculptData *)op->customdata;
SpaceImage *sima;
@@ -310,7 +310,7 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event,
Brush *brush = paint_brush(sculptdata->uvsculpt);
ToolSettings *toolsettings = CTX_data_tool_settings(C);
tool = sculptdata->tool;
- invert = sculptdata->invert? -1 : 1;
+ invert = sculptdata->invert ? -1 : 1;
alpha = brush_alpha(scene, brush);
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &co[0], &co[1]);
@@ -318,11 +318,11 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event,
ED_space_image_size(sima, &width, &height);
ED_space_image_zoom(sima, ar, &zoomx, &zoomy);
- radius = brush_size(scene, brush)/(width*zoomx);
- aspectRatio = width/(float)height;
+ radius = brush_size(scene, brush) / (width * zoomx);
+ aspectRatio = width / (float)height;
/* We will compare squares to save some computation */
- radius = radius*radius;
+ radius = radius * radius;
radius_root = sqrt(radius);
/*
@@ -344,11 +344,11 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event,
if ((dist = dot_v2v2(diff, diff)) <= radius) {
UvElement *element;
float strength;
- strength = alpha*brush_curve_strength(brush, sqrt(dist), radius_root);
+ strength = alpha * brush_curve_strength(brush, sqrt(dist), radius_root);
normalize_v2(diff);
- sculptdata->uv[i].uv[0] -= strength*diff[0]*0.001;
- sculptdata->uv[i].uv[1] -= strength*diff[1]*0.001;
+ sculptdata->uv[i].uv[0] -= strength * diff[0] * 0.001;
+ sculptdata->uv[i].uv[1] -= strength * diff[1] * 0.001;
for (element = sculptdata->uv[i].element; element; element = element->next) {
MLoopUV *luv;
@@ -372,7 +372,8 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event,
unsigned int method = toolsettings->uv_relax_method;
if (method == UV_SCULPT_TOOL_RELAX_HC) {
HC_relaxation_iteration_uv(em, sculptdata, co, alpha, radius, aspectRatio);
- }else{
+ }
+ else {
laplacian_relaxation_iteration_uv(em, sculptdata, co, alpha, radius, aspectRatio);
}
}
@@ -385,12 +386,12 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event,
float diff[2];
sub_v2_v2v2(diff, co, sculptdata->initial_stroke->init_coord);
- for (i = 0; i < sculptdata->initial_stroke->totalInitialSelected; i++ ) {
+ for (i = 0; i < sculptdata->initial_stroke->totalInitialSelected; i++) {
UvElement *element;
int uvindex = sculptdata->initial_stroke->initialSelection[i].uv;
float strength = sculptdata->initial_stroke->initialSelection[i].strength;
- sculptdata->uv[uvindex].uv[0] = sculptdata->initial_stroke->initialSelection[i].initial_uv[0] + strength*diff[0];
- sculptdata->uv[uvindex].uv[1] = sculptdata->initial_stroke->initialSelection[i].initial_uv[1] + strength*diff[1];
+ sculptdata->uv[uvindex].uv[0] = sculptdata->initial_stroke->initialSelection[i].initial_uv[0] + strength * diff[0];
+ sculptdata->uv[uvindex].uv[1] = sculptdata->initial_stroke->initialSelection[i].initial_uv[1] + strength * diff[1];
for (element = sculptdata->uv[uvindex].element; element; element = element->next) {
MLoopUV *luv;
@@ -414,9 +415,8 @@ 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)
- {
- EDBM_free_uv_element_map(data->elementMap);
+ if (data->elementMap) {
+ EDBM_uv_element_map_free(data->elementMap);
}
if (data->uv) {
MEM_freeN(data->uv);
@@ -435,9 +435,9 @@ static void uv_sculpt_stroke_exit(bContext *C, wmOperator *op)
op->customdata = NULL;
}
-static int get_uv_element_offset_from_face(UvElementMap *map, BMFace *efa, BMLoop *l, int island_index, int doIslands)
+static int uv_element_offset_from_face_get(UvElementMap *map, BMFace *efa, BMLoop *l, int island_index, int doIslands)
{
- UvElement *element = ED_get_uv_element(map, efa, l);
+ UvElement *element = ED_uv_element_get(map, efa, l);
if (!element || (doIslands && element->island != island_index)) {
return -1;
}
@@ -445,12 +445,11 @@ static int get_uv_element_offset_from_face(UvElementMap *map, BMFace *efa, BMLoo
}
-static unsigned int uv_edge_hash(const void *key)
+static unsigned int uv_edge_hash(const void *key)
{
UvEdge *edge = (UvEdge *)key;
- return
- BLI_ghashutil_inthash(SET_INT_IN_POINTER(edge->uv2)) +
- BLI_ghashutil_inthash(SET_INT_IN_POINTER(edge->uv1));
+ return (BLI_ghashutil_inthash(SET_INT_IN_POINTER(edge->uv2)) +
+ BLI_ghashutil_inthash(SET_INT_IN_POINTER(edge->uv1)));
}
static int uv_edge_compare(const void *a, const void *b)
@@ -471,14 +470,14 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent
Object *obedit = CTX_data_edit_object(C);
ToolSettings *ts = scene->toolsettings;
UvSculptData *data = MEM_callocN(sizeof(*data), "UV Smooth Brush Data");
- BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMesh *bm = em->bm;
op->customdata = data;
if (data) {
int counter = 0, i;
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
float co[2];
BMFace *efa;
MLoopUV *luv;
@@ -487,29 +486,32 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent
UvEdge *edges;
GHash *edgeHash;
- GHashIterator* ghi;
+ GHashIterator *ghi;
int do_island_optimization = !(ts->uv_sculpt_settings & UV_SCULPT_ALL_ISLANDS);
int island_index = 0;
/* Holds, for each UvElement in elementMap, a pointer to its unique uv.*/
int *uniqueUv;
- data->tool = (RNA_enum_get(op->ptr, "mode") == BRUSH_STROKE_SMOOTH)? UV_SCULPT_TOOL_RELAX : ts->uv_sculpt_tool;
- data->invert = (RNA_enum_get(op->ptr, "mode") == BRUSH_STROKE_INVERT)? 1 : 0;
+ data->tool = (RNA_enum_get(op->ptr, "mode") == BRUSH_STROKE_SMOOTH) ? UV_SCULPT_TOOL_RELAX : ts->uv_sculpt_tool;
+ data->invert = (RNA_enum_get(op->ptr, "mode") == BRUSH_STROKE_INVERT) ? 1 : 0;
data->uvsculpt = &ts->uvsculpt->paint;
if (do_island_optimization) {
/* We will need island information */
if (ts->uv_flag & UV_SYNC_SELECTION) {
- data->elementMap = EDBM_make_uv_element_map(em, 0, 1);
- }else{
- data->elementMap = EDBM_make_uv_element_map(em, 1, 1);
+ data->elementMap = EDBM_uv_element_map_create(em, 0, 1);
+ }
+ else {
+ data->elementMap = EDBM_uv_element_map_create(em, 1, 1);
}
- }else {
+ }
+ else {
if (ts->uv_flag & UV_SYNC_SELECTION) {
- data->elementMap = EDBM_make_uv_element_map(em, 0, 0);
- }else{
- data->elementMap = EDBM_make_uv_element_map(em, 1, 0);
+ data->elementMap = EDBM_uv_element_map_create(em, 0, 0);
+ }
+ else {
+ data->elementMap = EDBM_uv_element_map_create(em, 1, 0);
}
}
@@ -525,10 +527,10 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent
if (do_island_optimization) {
UvElement *element;
NearestHit hit;
- Image *ima= CTX_data_edit_image(C);
+ Image *ima = CTX_data_edit_image(C);
uv_find_nearest_vert(scene, ima, em, co, NULL, &hit);
- element = ED_get_uv_element(data->elementMap, hit.efa, hit.l);
+ element = ED_uv_element_get(data->elementMap, hit.efa, hit.l);
island_index = element->island;
}
@@ -536,17 +538,17 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent
/* Count 'unique' uvs */
for (i = 0; i < data->elementMap->totalUVs; i++) {
if (data->elementMap->buf[i].separate
- && (!do_island_optimization || data->elementMap->buf[i].island == island_index)) {
+ && (!do_island_optimization || data->elementMap->buf[i].island == island_index)) {
counter++;
}
}
/* Allocate the unique uv buffers */
- data->uv = MEM_mallocN(sizeof(*data->uv)*counter, "uv_brush_unique_uvs");
- uniqueUv = MEM_mallocN(sizeof(*uniqueUv)*data->elementMap->totalUVs, "uv_brush_unique_uv_map");
+ data->uv = MEM_mallocN(sizeof(*data->uv) * counter, "uv_brush_unique_uvs");
+ uniqueUv = MEM_mallocN(sizeof(*uniqueUv) * data->elementMap->totalUVs, "uv_brush_unique_uv_map");
edgeHash = BLI_ghash_new(uv_edge_hash, uv_edge_compare, "uv_brush_edge_hash");
/* we have at most totalUVs edges */
- edges = MEM_mallocN(sizeof(*edges)*data->elementMap->totalUVs, "uv_brush_all_edges");
+ edges = MEM_mallocN(sizeof(*edges) * data->elementMap->totalUVs, "uv_brush_all_edges");
if (!data->uv || !uniqueUv || !edgeHash || !edges) {
if (edges) {
MEM_freeN(edges);
@@ -594,8 +596,8 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent
counter = 0;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
- int offset1, itmp1 = get_uv_element_offset_from_face(data->elementMap, efa, l, island_index, do_island_optimization);
- int offset2, itmp2 = get_uv_element_offset_from_face(data->elementMap, efa, l->next, island_index, do_island_optimization);
+ int offset1, itmp1 = uv_element_offset_from_face_get(data->elementMap, efa, l, island_index, do_island_optimization);
+ int offset2, itmp2 = uv_element_offset_from_face_get(data->elementMap, efa, l->next, island_index, do_island_optimization);
/* Skip edge if not found(unlikely) or not on valid island */
if (itmp1 == -1 || itmp2 == -1)
@@ -611,7 +613,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent
edges[counter].uv1 = offset1;
edges[counter].uv2 = offset2;
}
- else{
+ else {
edges[counter].uv1 = offset2;
edges[counter].uv2 = offset1;
}
@@ -620,7 +622,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent
char *flag = BLI_ghash_lookup(edgeHash, &edges[counter]);
*flag = 1;
}
- else{
+ else {
/* Hack mentioned */
BLI_ghash_insert(edgeHash, &edges[counter], &edges[counter].flag);
}
@@ -631,7 +633,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent
MEM_freeN(uniqueUv);
/* Allocate connectivity data, we allocate edges once */
- data->uvedges = MEM_mallocN(sizeof(*data->uvedges)*BLI_ghash_size(edgeHash), "uv_brush_edge_connectivity_data");
+ data->uvedges = MEM_mallocN(sizeof(*data->uvedges) * BLI_ghash_size(edgeHash), "uv_brush_edge_connectivity_data");
if (!data->uvedges) {
BLI_ghash_free(edgeHash, NULL, NULL);
MEM_freeN(edges);
@@ -683,9 +685,9 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent
ED_space_image_size(sima, &width, &height);
ED_space_image_zoom(sima, ar, &zoomx, &zoomy);
- aspectRatio = width/(float)height;
- radius /= (width*zoomx);
- radius = radius*radius;
+ aspectRatio = width / (float)height;
+ radius /= (width * zoomx);
+ radius = radius * radius;
radius_root = sqrt(radius);
/* Allocate selection stack */
@@ -693,7 +695,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent
if (!data->initial_stroke) {
uv_sculpt_stroke_exit(C, op);
}
- data->initial_stroke->initialSelection = MEM_mallocN(sizeof(*data->initial_stroke->initialSelection)*data->totalUniqueUvs, "uv_sculpt_initial_selection");
+ data->initial_stroke->initialSelection = MEM_mallocN(sizeof(*data->initial_stroke->initialSelection) * data->totalUniqueUvs, "uv_sculpt_initial_selection");
if (!data->initial_stroke->initialSelection) {
uv_sculpt_stroke_exit(C, op);
}
@@ -712,7 +714,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent
diff[1] /= aspectRatio;
if ((dist = dot_v2v2(diff, diff)) <= radius) {
float strength;
- strength = alpha*brush_curve_strength(brush, sqrt(dist), radius_root);
+ strength = alpha * brush_curve_strength(brush, sqrt(dist), radius_root);
data->initial_stroke->initialSelection[counter].uv = i;
data->initial_stroke->initialSelection[counter].strength = strength;
@@ -739,7 +741,7 @@ static int uv_sculpt_stroke_invoke(bContext *C, wmOperator *op, wmEvent *event)
uv_sculpt_stroke_apply(C, op, event, obedit);
- data->timer= WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.001f);
+ data->timer = WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.001f);
if (!data->timer) {
uv_sculpt_stroke_exit(C, op);
@@ -756,7 +758,7 @@ static int uv_sculpt_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
UvSculptData *data = (UvSculptData *)op->customdata;
Object *obedit = CTX_data_edit_object(C);
- switch(event->type) {
+ switch (event->type) {
case LEFTMOUSE:
case MIDDLEMOUSE:
case RIGHTMOUSE:
@@ -776,7 +778,7 @@ static int uv_sculpt_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
}
ED_region_tag_redraw(CTX_wm_region(C));
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
DAG_id_tag_update(obedit->data, 0);
return OPERATOR_RUNNING_MODAL;
}
@@ -801,7 +803,7 @@ void SCULPT_OT_uv_sculpt_stroke(wmOperatorType *ot)
ot->poll = uv_sculpt_poll;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_enum(ot->srna, "mode", stroke_mode_items, BRUSH_STROKE_NORMAL, "Mode", "Stroke Mode");
diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c
index 3f3369ac6cb..f7598045f81 100644
--- a/source/blender/editors/sound/sound_ops.c
+++ b/source/blender/editors/sound/sound_ops.c
@@ -105,11 +105,11 @@ static int sound_open_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filepath", path);
sound = sound_new_file(bmain, path);
- if(!op->customdata)
+ if (!op->customdata)
sound_open_init(C, op);
if (sound==NULL || sound->playback_handle == NULL) {
- if(op->customdata) MEM_freeN(op->customdata);
+ if (op->customdata) MEM_freeN(op->customdata);
BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
return OPERATOR_CANCELLED;
}
@@ -118,12 +118,12 @@ static int sound_open_exec(bContext *C, wmOperator *op)
if (info.specs.channels == AUD_CHANNELS_INVALID) {
sound_delete(bmain, sound);
- if(op->customdata) MEM_freeN(op->customdata);
+ if (op->customdata) MEM_freeN(op->customdata);
BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
return OPERATOR_CANCELLED;
}
- if(RNA_boolean_get(op->ptr, "mono")) {
+ if (RNA_boolean_get(op->ptr, "mono")) {
sound->flags |= SOUND_FLAGS_MONO;
sound_load(bmain, sound);
}
@@ -135,7 +135,7 @@ static int sound_open_exec(bContext *C, wmOperator *op)
/* hook into UI */
pprop= op->customdata;
- if(pprop->prop) {
+ if (pprop->prop) {
/* when creating new ID blocks, use is already 1, but RNA
* pointer se also increases user, so this compensates it */
sound->id.us--;
@@ -145,7 +145,7 @@ static int sound_open_exec(bContext *C, wmOperator *op)
RNA_property_update(C, &pprop->ptr, pprop->prop);
}
- if(op->customdata) MEM_freeN(op->customdata);
+ if (op->customdata) MEM_freeN(op->customdata);
return OPERATOR_FINISHED;
}
@@ -162,7 +162,7 @@ static int sound_open_exec(bContext *UNUSED(C), wmOperator *op)
static int sound_open_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if(RNA_struct_property_is_set(op->ptr, "filepath"))
+ if (RNA_struct_property_is_set(op->ptr, "filepath"))
return sound_open_exec(C, op);
sound_open_init(C, op);
@@ -173,17 +173,17 @@ static int sound_open_invoke(bContext *C, wmOperator *op, wmEvent *event)
static void SOUND_OT_open(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Open Sound";
- ot->description= "Load a sound file";
- ot->idname= "SOUND_OT_open";
+ ot->name = "Open Sound";
+ ot->description = "Load a sound file";
+ ot->idname = "SOUND_OT_open";
/* api callbacks */
- ot->exec= sound_open_exec;
- ot->invoke= sound_open_invoke;
- ot->cancel= sound_open_cancel;
+ ot->exec = sound_open_exec;
+ ot->invoke = sound_open_invoke;
+ ot->cancel = sound_open_cancel;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
@@ -194,17 +194,17 @@ static void SOUND_OT_open(wmOperatorType *ot)
static void SOUND_OT_open_mono(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Open Sound Mono";
- ot->description= "Load a sound file as mono";
- ot->idname= "SOUND_OT_open_mono";
+ ot->name = "Open Sound Mono";
+ ot->description = "Load a sound file as mono";
+ ot->idname = "SOUND_OT_open_mono";
/* api callbacks */
- ot->exec= sound_open_exec;
- ot->invoke= sound_open_invoke;
- ot->cancel= sound_open_cancel;
+ ot->exec = sound_open_exec;
+ ot->invoke = sound_open_invoke;
+ ot->cancel = sound_open_cancel;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
@@ -223,19 +223,19 @@ static int sound_update_animation_flags_exec(bContext *C, wmOperator *UNUSED(op)
SEQ_BEGIN(scene->ed, seq) {
fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence, "volume", 0, &driven);
- if(fcu || driven)
+ if (fcu || driven)
seq->flag |= SEQ_AUDIO_VOLUME_ANIMATED;
else
seq->flag &= ~SEQ_AUDIO_VOLUME_ANIMATED;
fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence, "pitch", 0, &driven);
- if(fcu || driven)
+ if (fcu || driven)
seq->flag |= SEQ_AUDIO_PITCH_ANIMATED;
else
seq->flag &= ~SEQ_AUDIO_PITCH_ANIMATED;
fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence, "pan", 0, &driven);
- if(fcu || driven)
+ if (fcu || driven)
seq->flag |= SEQ_AUDIO_PAN_ANIMATED;
else
seq->flag &= ~SEQ_AUDIO_PAN_ANIMATED;
@@ -243,7 +243,7 @@ static int sound_update_animation_flags_exec(bContext *C, wmOperator *UNUSED(op)
SEQ_END
fcu = id_data_find_fcurve(&scene->id, scene, &RNA_Scene, "audio_volume", 0, &driven);
- if(fcu || driven)
+ if (fcu || driven)
scene->audio.flag |= AUDIO_VOLUME_ANIMATED;
else
scene->audio.flag &= ~AUDIO_VOLUME_ANIMATED;
@@ -254,22 +254,22 @@ 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";
- ot->description= "Update animation flags";
- ot->idname= "SOUND_OT_update_animation_flags";
+ ot->name = "Update animation";
+ ot->description = "Update animation flags";
+ ot->idname = "SOUND_OT_update_animation_flags";
/* api callbacks */
- ot->exec= sound_update_animation_flags_exec;
+ ot->exec = sound_update_animation_flags_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
}
/* ******************************************************* */
@@ -283,7 +283,7 @@ static int sound_bake_animation_exec(bContext *C, wmOperator *UNUSED(op))
sound_update_animation_flags_exec(C, NULL);
- for(cfra = scene->r.sfra > 0 ? scene->r.sfra - 1 : 0; cfra <= scene->r.efra + 1; cfra++)
+ for (cfra = scene->r.sfra > 0 ? scene->r.sfra - 1 : 0; cfra <= scene->r.efra + 1; cfra++)
{
scene->r.cfra = cfra;
scene_update_for_newframe(bmain, scene, scene->lay);
@@ -298,15 +298,15 @@ static int sound_bake_animation_exec(bContext *C, wmOperator *UNUSED(op))
static void SOUND_OT_bake_animation(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Update animation cache";
- ot->description= "Updates the audio animation cache so that it's up to date";
- ot->idname= "SOUND_OT_bake_animation";
+ ot->name = "Update animation cache";
+ ot->description = "Update the audio animation cache";
+ ot->idname = "SOUND_OT_bake_animation";
/* api callbacks */
- ot->exec= sound_bake_animation_exec;
+ ot->exec = sound_bake_animation_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
}
@@ -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;
}
@@ -359,7 +358,7 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op)
static int sound_mixdown_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if(RNA_struct_property_is_set(op->ptr, "filepath"))
+ if (RNA_struct_property_is_set(op->ptr, "filepath"))
return sound_mixdown_exec(C, op);
return WM_operator_filesel(C, op, event);
@@ -572,19 +571,19 @@ static void SOUND_OT_mixdown(wmOperatorType *ot)
#endif // WITH_AUDASPACE
/* identifiers */
- ot->name= "Mixdown";
- ot->description= "Mixes the scene's audio to a sound file";
- ot->idname= "SOUND_OT_mixdown";
+ ot->name = "Mixdown";
+ ot->description = "Mixes the scene's audio to a sound file";
+ ot->idname = "SOUND_OT_mixdown";
/* api callbacks */
- ot->exec= sound_mixdown_exec;
- ot->invoke= sound_mixdown_invoke;
+ ot->exec = sound_mixdown_exec;
+ ot->invoke = sound_mixdown_invoke;
#ifdef WITH_AUDASPACE
- ot->ui= sound_mixdown_draw;
+ ot->ui = sound_mixdown_draw;
#endif
/* flags */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
/* properties */
WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
@@ -603,7 +602,7 @@ static int sound_poll(bContext *C)
{
Editing* ed = CTX_data_scene(C)->ed;
- if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)
+ if (!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)
return 0;
return 1;
@@ -616,12 +615,12 @@ static int sound_pack_exec(bContext *C, wmOperator *op)
Editing* ed = CTX_data_scene(C)->ed;
bSound* sound;
- if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)
+ if (!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)
return OPERATOR_CANCELLED;
sound = ed->act_seq->sound;
- if(!sound || sound->packedfile)
+ if (!sound || sound->packedfile)
return OPERATOR_CANCELLED;
sound->packedfile= newPackedFile(op->reports, sound->name, ID_BLEND_PATH(bmain, &sound->id));
@@ -633,16 +632,16 @@ static int sound_pack_exec(bContext *C, wmOperator *op)
static void SOUND_OT_pack(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Pack Sound";
- ot->description= "Pack the sound into the current blend file";
- ot->idname= "SOUND_OT_pack";
+ ot->name = "Pack Sound";
+ ot->description = "Pack the sound into the current blend file";
+ ot->idname = "SOUND_OT_pack";
/* api callbacks */
- ot->exec= sound_pack_exec;
- ot->poll= sound_poll;
+ ot->exec = sound_pack_exec;
+ ot->poll = sound_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************* unpack operator *********************/
@@ -659,10 +658,10 @@ static int sound_unpack_exec(bContext *C, wmOperator *op)
sound = BLI_findstring(&CTX_data_main(C)->sound, sndname, offsetof(ID, name) + 2);
}
- if(!sound || !sound->packedfile)
+ if (!sound || !sound->packedfile)
return OPERATOR_CANCELLED;
- if(G.fileflags & G_AUTOPACK)
+ if (G.fileflags & G_AUTOPACK)
BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save");
unpackSound(CTX_data_main(C), op->reports, sound, method);
@@ -675,18 +674,18 @@ static int sound_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
Editing* ed = CTX_data_scene(C)->ed;
bSound* sound;
- if(RNA_struct_property_is_set(op->ptr, "id"))
+ if (RNA_struct_property_is_set(op->ptr, "id"))
return sound_unpack_exec(C, op);
- if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)
+ if (!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)
return OPERATOR_CANCELLED;
sound = ed->act_seq->sound;
- if(!sound || !sound->packedfile)
+ if (!sound || !sound->packedfile)
return OPERATOR_CANCELLED;
- if(G.fileflags & G_AUTOPACK)
+ if (G.fileflags & G_AUTOPACK)
BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save");
unpack_menu(C, "SOUND_OT_unpack", sound->id.name+2, sound->name, "sounds", sound->packedfile);
@@ -697,17 +696,17 @@ static int sound_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
static void SOUND_OT_unpack(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Unpack Sound";
- ot->description= "Unpack the sound to the samples filename";
- ot->idname= "SOUND_OT_unpack";
+ ot->name = "Unpack Sound";
+ ot->description = "Unpack the sound to the samples filename";
+ ot->idname = "SOUND_OT_unpack";
/* api callbacks */
- ot->exec= sound_unpack_exec;
- ot->invoke= sound_unpack_invoke;
- ot->poll= sound_poll;
+ ot->exec = sound_unpack_exec;
+ ot->invoke = sound_unpack_invoke;
+ ot->poll = sound_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack");
diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c
index 309b455e2a2..024a9ffb57d 100644
--- a/source/blender/editors/space_action/action_draw.c
+++ b/source/blender/editors/space_action/action_draw.c
@@ -93,7 +93,7 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *ar)
/* don't use totrect set, as the width stays the same
* (NOTE: this is ok here, the configuration is pretty straightforward)
*/
- v2d->tot.ymin= (float)(-height);
+ v2d->tot.ymin = (float)(-height);
}
/* need to do a view-sync here, so that the keys area doesn't jump around (it must copy this) */
UI_view2d_sync(NULL, ac->sa, v2d, V2D_LOCK_COPY);
@@ -209,7 +209,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
/* don't use totrect set, as the width stays the same
* (NOTE: this is ok here, the configuration is pretty straightforward)
*/
- v2d->tot.ymin= (float)(-height);
+ v2d->tot.ymin = (float)(-height);
/* first backdrop strips */
y= (float)(-ACHANNEL_HEIGHT);
@@ -300,7 +300,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
/* Draw keyframes
* 1) Only channels that are visible in the Action Editor get drawn/evaluated.
- * This is to try to optimise this for heavier data sets
+ * This is to try to optimize this for heavier data sets
* 2) Keyframes which are out of view horizontally are disregarded
*/
y= (float)(-ACHANNEL_HEIGHT);
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index a044651652e..b8c310f8477 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -124,17 +124,17 @@ static int act_new_exec(bContext *C, wmOperator *UNUSED(op))
void ACTION_OT_new (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "New Action";
- ot->idname= "ACTION_OT_new";
- ot->description= "Create new action";
+ ot->name = "New Action";
+ ot->idname = "ACTION_OT_new";
+ ot->description = "Create new action";
/* api callbacks */
- ot->exec= act_new_exec;
+ ot->exec = act_new_exec;
// NOTE: this is used in the NLA too...
- //ot->poll= ED_operator_action_active;
+ //ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ************************************************************************** */
@@ -207,16 +207,16 @@ static int act_markers_make_local_exec (bContext *C, wmOperator *UNUSED(op))
void ACTION_OT_markers_make_local (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Make Markers Local";
- ot->idname= "ACTION_OT_markers_make_local";
- ot->description= "Move selected scene markers to the active Action as local 'pose' markers";
+ ot->name = "Make Markers Local";
+ ot->idname = "ACTION_OT_markers_make_local";
+ ot->description = "Move selected scene markers to the active Action as local 'pose' markers";
/* callbacks */
ot->exec = act_markers_make_local_exec;
ot->poll = act_markers_make_local_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ************************************************************************** */
@@ -322,16 +322,16 @@ static int actkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
void ACTION_OT_previewrange_set (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Auto-Set Preview Range";
- ot->idname= "ACTION_OT_previewrange_set";
- ot->description= "Set Preview Range based on extents of selected Keyframes";
+ ot->name = "Auto-Set Preview Range";
+ ot->idname = "ACTION_OT_previewrange_set";
+ ot->description = "Set Preview Range based on extents of selected Keyframes";
/* api callbacks */
- ot->exec= actkeys_previewrange_exec;
- ot->poll= ED_operator_action_active;
+ ot->exec = actkeys_previewrange_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ****************** View-All Operator ****************** */
@@ -355,8 +355,8 @@ static int actkeys_viewall(bContext *C, const short onlySel)
v2d->cur.xmax += extra;
/* set vertical range */
- v2d->cur.ymax= 0.0f;
- v2d->cur.ymin= (float)-(v2d->mask.ymax - v2d->mask.ymin);
+ v2d->cur.ymax = 0.0f;
+ v2d->cur.ymin = (float)-(v2d->mask.ymax - v2d->mask.ymin);
/* do View2D syncing */
UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY);
@@ -384,31 +384,31 @@ static int actkeys_viewsel_exec(bContext *C, wmOperator *UNUSED(op))
void ACTION_OT_view_all (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View All";
- ot->idname= "ACTION_OT_view_all";
- ot->description= "Reset viewable area to show full keyframe range";
+ ot->name = "View All";
+ ot->idname = "ACTION_OT_view_all";
+ ot->description = "Reset viewable area to show full keyframe range";
/* api callbacks */
- ot->exec= actkeys_viewall_exec;
- ot->poll= ED_operator_action_active;
+ ot->exec = actkeys_viewall_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
void ACTION_OT_view_selected (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Selected";
- ot->idname= "ACTION_OT_view_selected";
- ot->description= "Reset viewable area to show selected keyframes range";
+ ot->name = "View Selected";
+ ot->idname = "ACTION_OT_view_selected";
+ ot->description = "Reset viewable area to show selected keyframes range";
/* api callbacks */
- ot->exec= actkeys_viewsel_exec;
- ot->poll= ED_operator_action_active;
+ ot->exec = actkeys_viewsel_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ************************************************************************** */
@@ -487,16 +487,16 @@ static int actkeys_copy_exec(bContext *C, wmOperator *op)
void ACTION_OT_copy (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Keyframes";
- ot->idname= "ACTION_OT_copy";
- ot->description= "Copy selected keyframes to the copy/paste buffer";
+ ot->name = "Copy Keyframes";
+ ot->idname = "ACTION_OT_copy";
+ ot->description = "Copy selected keyframes to the copy/paste buffer";
/* api callbacks */
- ot->exec= actkeys_copy_exec;
- ot->poll= ED_operator_action_active;
+ ot->exec = actkeys_copy_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int actkeys_paste_exec(bContext *C, wmOperator *op)
@@ -538,17 +538,17 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op)
void ACTION_OT_paste (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Paste Keyframes";
- ot->idname= "ACTION_OT_paste";
- ot->description= "Paste keyframes from copy/paste buffer for the selected channels, starting on the current frame";
+ ot->name = "Paste Keyframes";
+ ot->idname = "ACTION_OT_paste";
+ ot->description = "Paste keyframes from copy/paste buffer for the selected channels, starting on the current frame";
/* api callbacks */
-// ot->invoke= WM_operator_props_popup; // better wait for action redo panel
- ot->exec= actkeys_paste_exec;
- ot->poll= ED_operator_action_active;
+// ot->invoke = WM_operator_props_popup; // better wait for action redo panel
+ ot->exec = actkeys_paste_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
RNA_def_enum(ot->srna, "offset", keyframe_paste_offset_items, KEYFRAME_PASTE_OFFSET_CFRA_START, "Offset", "Paste time offset of keys");
@@ -639,20 +639,20 @@ static int actkeys_insertkey_exec(bContext *C, wmOperator *op)
void ACTION_OT_keyframe_insert (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Insert Keyframes";
- ot->idname= "ACTION_OT_keyframe_insert";
- ot->description= "Insert keyframes for the specified channels";
+ ot->name = "Insert Keyframes";
+ ot->idname = "ACTION_OT_keyframe_insert";
+ ot->description = "Insert keyframes for the specified channels";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= actkeys_insertkey_exec;
- ot->poll= ED_operator_action_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = actkeys_insertkey_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_actkeys_insertkey_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_insertkey_types, 0, "Type", "");
}
/* ******************** Duplicate Keyframes Operator ************************* */
@@ -715,17 +715,17 @@ static int actkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED
void ACTION_OT_duplicate (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Duplicate Keyframes";
- ot->idname= "ACTION_OT_duplicate";
- ot->description= "Make a copy of all selected keyframes";
+ ot->name = "Duplicate Keyframes";
+ ot->idname = "ACTION_OT_duplicate";
+ ot->description = "Make a copy of all selected keyframes";
/* api callbacks */
- ot->invoke= actkeys_duplicate_invoke;
- ot->exec= actkeys_duplicate_exec;
- ot->poll= ED_operator_action_active;
+ ot->invoke = actkeys_duplicate_invoke;
+ ot->exec = actkeys_duplicate_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Delete Keyframes Operator ************************* */
@@ -790,17 +790,17 @@ static int actkeys_delete_exec(bContext *C, wmOperator *UNUSED(op))
void ACTION_OT_delete (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Keyframes";
- ot->idname= "ACTION_OT_delete";
- ot->description= "Remove all selected keyframes";
+ ot->name = "Delete Keyframes";
+ ot->idname = "ACTION_OT_delete";
+ ot->description = "Remove all selected keyframes";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= actkeys_delete_exec;
- ot->poll= ED_operator_action_active;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = actkeys_delete_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Clean Keyframes Operator ************************* */
@@ -854,20 +854,20 @@ static int actkeys_clean_exec(bContext *C, wmOperator *op)
void ACTION_OT_clean (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clean Keyframes";
- ot->idname= "ACTION_OT_clean";
- ot->description= "Simplify F-Curves by removing closely spaced keyframes";
+ ot->name = "Clean Keyframes";
+ ot->idname = "ACTION_OT_clean";
+ ot->description = "Simplify F-Curves by removing closely spaced keyframes";
/* api callbacks */
- //ot->invoke= // XXX we need that number popup for this!
- ot->exec= actkeys_clean_exec;
- ot->poll= ED_operator_action_active;
+ //ot->invoke = // XXX we need that number popup for this!
+ ot->exec = actkeys_clean_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_float(ot->srna, "threshold", 0.001f, 0.0f, FLT_MAX, "Threshold", "", 0.0f, 1000.0f);
+ ot->prop = RNA_def_float(ot->srna, "threshold", 0.001f, 0.0f, FLT_MAX, "Threshold", "", 0.0f, 1000.0f);
}
/* ******************** Sample Keyframes Operator *********************** */
@@ -918,16 +918,16 @@ static int actkeys_sample_exec(bContext *C, wmOperator *UNUSED(op))
void ACTION_OT_sample (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Sample Keyframes";
- ot->idname= "ACTION_OT_sample";
- ot->description= "Add keyframes on every frame between the selected keyframes";
+ ot->name = "Sample Keyframes";
+ ot->idname = "ACTION_OT_sample";
+ ot->description = "Add keyframes on every frame between the selected keyframes";
/* api callbacks */
- ot->exec= actkeys_sample_exec;
- ot->poll= ED_operator_action_active;
+ ot->exec = actkeys_sample_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ************************************************************************** */
@@ -1028,20 +1028,20 @@ static int actkeys_expo_exec(bContext *C, wmOperator *op)
void ACTION_OT_extrapolation_type (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Keyframe Extrapolation";
- ot->idname= "ACTION_OT_extrapolation_type";
- ot->description= "Set extrapolation mode for selected F-Curves";
+ ot->name = "Set Keyframe Extrapolation";
+ ot->idname = "ACTION_OT_extrapolation_type";
+ ot->description = "Set extrapolation mode for selected F-Curves";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= actkeys_expo_exec;
- ot->poll= ED_operator_action_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = actkeys_expo_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_actkeys_expo_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_expo_types, 0, "Type", "");
}
/* ******************** Set Interpolation-Type Operator *********************** */
@@ -1099,20 +1099,20 @@ static int actkeys_ipo_exec(bContext *C, wmOperator *op)
void ACTION_OT_interpolation_type (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Keyframe Interpolation";
- ot->idname= "ACTION_OT_interpolation_type";
- ot->description= "Set interpolation mode for the F-Curve segments starting from the selected keyframes";
+ ot->name = "Set Keyframe Interpolation";
+ ot->idname = "ACTION_OT_interpolation_type";
+ ot->description = "Set interpolation mode for the F-Curve segments starting from the selected keyframes";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= actkeys_ipo_exec;
- ot->poll= ED_operator_action_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = actkeys_ipo_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", beztriple_interpolation_mode_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", beztriple_interpolation_mode_items, 0, "Type", "");
}
/* ******************** Set Handle-Type Operator *********************** */
@@ -1179,20 +1179,20 @@ static int actkeys_handletype_exec(bContext *C, wmOperator *op)
void ACTION_OT_handle_type (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Keyframe Handle Type";
- ot->idname= "ACTION_OT_handle_type";
- ot->description= "Set type of handle for selected keyframes";
+ ot->name = "Set Keyframe Handle Type";
+ ot->idname = "ACTION_OT_handle_type";
+ ot->description = "Set type of handle for selected keyframes";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= actkeys_handletype_exec;
- ot->poll= ED_operator_action_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = actkeys_handletype_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", keyframe_handle_type_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", keyframe_handle_type_items, 0, "Type", "");
}
/* ******************** Set Keyframe-Type Operator *********************** */
@@ -1250,20 +1250,20 @@ static int actkeys_keytype_exec(bContext *C, wmOperator *op)
void ACTION_OT_keyframe_type (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Keyframe Type";
- ot->idname= "ACTION_OT_keyframe_type";
- ot->description= "Set type of keyframe for the selected keyframes";
+ ot->name = "Set Keyframe Type";
+ ot->idname = "ACTION_OT_keyframe_type";
+ ot->description = "Set type of keyframe for the selected keyframes";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= actkeys_keytype_exec;
- ot->poll= ED_operator_action_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = actkeys_keytype_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", beztriple_keyframe_type_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", beztriple_keyframe_type_items, 0, "Type", "");
}
/* ************************************************************************** */
@@ -1318,16 +1318,16 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
void ACTION_OT_frame_jump (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Jump to Frame";
- ot->idname= "ACTION_OT_frame_jump";
- ot->description= "Set the current frame to the average frame of the selected keyframes";
+ ot->name = "Jump to Frame";
+ ot->idname = "ACTION_OT_frame_jump";
+ ot->description = "Set the current frame to the average frame of the selected keyframes";
/* api callbacks */
- ot->exec= actkeys_framejump_exec;
- ot->poll= ED_operator_action_active;
+ ot->exec = actkeys_framejump_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Snap Keyframes Operator *********************** */
@@ -1418,20 +1418,20 @@ static int actkeys_snap_exec(bContext *C, wmOperator *op)
void ACTION_OT_snap (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Snap Keys";
- ot->idname= "ACTION_OT_snap";
- ot->description= "Snap selected keyframes to the times specified";
+ ot->name = "Snap Keys";
+ ot->idname = "ACTION_OT_snap";
+ ot->description = "Snap selected keyframes to the times specified";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= actkeys_snap_exec;
- ot->poll= ED_operator_action_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = actkeys_snap_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_actkeys_snap_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_snap_types, 0, "Type", "");
}
/* ******************** Mirror Keyframes Operator *********************** */
@@ -1532,20 +1532,20 @@ static int actkeys_mirror_exec(bContext *C, wmOperator *op)
void ACTION_OT_mirror (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mirror Keys";
- ot->idname= "ACTION_OT_mirror";
- ot->description= "Flip selected keyframes over the selected mirror line";
+ ot->name = "Mirror Keys";
+ ot->idname = "ACTION_OT_mirror";
+ ot->description = "Flip selected keyframes over the selected mirror line";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= actkeys_mirror_exec;
- ot->poll= ED_operator_action_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = actkeys_mirror_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_actkeys_mirror_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_mirror_types, 0, "Type", "");
}
/* ************************************************************************** */
diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c
index d4e44dee9c3..f502a97967f 100644
--- a/source/blender/editors/space_action/action_ops.c
+++ b/source/blender/editors/space_action/action_ops.c
@@ -93,11 +93,11 @@ void ED_operatormacros_action(void)
wmOperatorType *ot;
wmOperatorTypeMacro *otmacro;
- ot= WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
if (ot) {
- ot->description= "Make a copy of all selected keyframes and move them";
+ ot->description = "Make a copy of all selected keyframes and move them";
WM_operatortype_macro_define(ot, "ACTION_OT_duplicate");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
}
@@ -114,13 +114,13 @@ static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_boolean_set(kmi->ptr, "column", FALSE);
- kmi= WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_boolean_set(kmi->ptr, "column", TRUE);
- kmi= WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_boolean_set(kmi->ptr, "column", FALSE);
- kmi= WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_boolean_set(kmi->ptr, "column", TRUE);
@@ -128,14 +128,14 @@ static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_TEST);
- kmi= WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_TEST);
- kmi= WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_LEFT);
- kmi= WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_RIGHT);
@@ -225,7 +225,7 @@ void action_keymap(wmKeyConfig *keyconf)
*/
/* keyframes */
- keymap= WM_keymap_find(keyconf, "Dopesheet", SPACE_ACTION, 0);
+ keymap = WM_keymap_find(keyconf, "Dopesheet", SPACE_ACTION, 0);
action_keymap_keyframes(keyconf, keymap);
}
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index 414999b2f2b..f76f5f6523e 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -146,7 +146,7 @@ static int actkeys_deselectall_exec(bContext *C, wmOperator *op)
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
- /* 'standard' behaviour - check if selected, then apply relevant selection */
+ /* 'standard' behavior - check if selected, then apply relevant selection */
if (RNA_boolean_get(op->ptr, "invert"))
deselect_action_keys(&ac, 0, SELECT_INVERT);
else
@@ -161,19 +161,19 @@ static int actkeys_deselectall_exec(bContext *C, wmOperator *op)
void ACTION_OT_select_all_toggle (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select All";
- ot->idname= "ACTION_OT_select_all_toggle";
- ot->description= "Toggle selection of all keyframes";
+ ot->name = "Select All";
+ ot->idname = "ACTION_OT_select_all_toggle";
+ ot->description = "Toggle selection of all keyframes";
/* api callbacks */
- ot->exec= actkeys_deselectall_exec;
- ot->poll= ED_operator_action_active;
+ ot->exec = actkeys_deselectall_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- ot->prop= RNA_def_boolean(ot->srna, "invert", 0, "Invert", "");
+ ot->prop = RNA_def_boolean(ot->srna, "invert", 0, "Invert", "");
}
/* ******************** Border Select Operator **************************** */
@@ -281,10 +281,10 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op)
deselect_action_keys(&ac, 1, SELECT_SUBTRACT);
/* get settings 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");
+ 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");
gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
if (gesture_mode == GESTURE_MODAL_SELECT)
@@ -296,7 +296,7 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op)
if (RNA_boolean_get(op->ptr, "axis_range")) {
/* mode depends on which axis of the range is larger to determine which axis to use
* - checking this in region-space is fine, as it's fundamentally still going to be a different rect size
- * - the frame-range select option is favoured over the channel one (x over y), as frame-range one is often
+ * - the frame-range select option is favored over the channel one (x over y), as frame-range one is often
* used for tweaking timing when "blocking", while channels is not that useful...
*/
if ((rect.xmax - rect.xmin) >= (rect.ymax - rect.ymin))
@@ -319,25 +319,25 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op)
void ACTION_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Border Select";
- ot->idname= "ACTION_OT_select_border";
- ot->description= "Select all keyframes within the specified region";
+ ot->name = "Border Select";
+ ot->idname = "ACTION_OT_select_border";
+ ot->description = "Select all keyframes within the specified region";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= actkeys_borderselect_exec;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = actkeys_borderselect_exec;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= ED_operator_action_active;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
WM_operator_properties_gesture_border(ot, TRUE);
- ot->prop= RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
+ ot->prop = RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
}
/* ******************** Column Select Operator **************************** */
@@ -422,7 +422,7 @@ static void columnselect_action_keys (bAnimContext *ac, short mode)
KeyframeEditFunc select_cb, ok_cb;
KeyframeEditData ked= {{NULL}};
- /* initialise keyframe editing data */
+ /* initialize keyframe editing data */
/* build list of columns */
switch (mode) {
@@ -527,19 +527,19 @@ static int actkeys_columnselect_exec(bContext *C, wmOperator *op)
void ACTION_OT_select_column (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select All";
- ot->idname= "ACTION_OT_select_column";
- ot->description= "Select all keyframes on the specified frame(s)";
+ ot->name = "Select All";
+ ot->idname = "ACTION_OT_select_column";
+ ot->description = "Select all keyframes on the specified frame(s)";
/* api callbacks */
- ot->exec= actkeys_columnselect_exec;
- ot->poll= ED_operator_action_active;
+ ot->exec = actkeys_columnselect_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- ot->prop= RNA_def_enum(ot->srna, "mode", prop_column_select_types, 0, "Mode", "");
+ ot->prop = RNA_def_enum(ot->srna, "mode", prop_column_select_types, 0, "Mode", "");
}
/* ******************** Select Linked Operator *********************** */
@@ -586,15 +586,15 @@ void ACTION_OT_select_linked (wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select Linked";
- ot->idname= "ACTION_OT_select_linked";
+ ot->idname = "ACTION_OT_select_linked";
ot->description = "Select keyframes occurring in the same F-Curves as selected ones";
/* api callbacks */
- ot->exec= actkeys_select_linked_exec;
- ot->poll= ED_operator_action_active;
+ ot->exec = actkeys_select_linked_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+ ot->flag = OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
}
/* ******************** Select More/Less Operators *********************** */
@@ -663,15 +663,15 @@ void ACTION_OT_select_more (wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select More";
- ot->idname= "ACTION_OT_select_more";
+ ot->idname = "ACTION_OT_select_more";
ot->description = "Select keyframes beside already selected ones";
/* api callbacks */
- ot->exec= actkeys_select_more_exec;
- ot->poll= ED_operator_action_active;
+ ot->exec = actkeys_select_more_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+ ot->flag = OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
}
/* ----------------- */
@@ -697,15 +697,15 @@ void ACTION_OT_select_less (wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select Less";
- ot->idname= "ACTION_OT_select_less";
+ ot->idname = "ACTION_OT_select_less";
ot->description = "Deselect keyframes on ends of selection islands";
/* api callbacks */
- ot->exec= actkeys_select_less_exec;
- ot->poll= ED_operator_action_active;
+ ot->exec = actkeys_select_less_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+ ot->flag = OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
}
/* ******************** Select Left/Right Operator ************************* */
@@ -785,7 +785,7 @@ static void actkeys_select_leftright (bAnimContext *ac, short leftright, short s
TimeMarker *marker;
for (marker= markers->first; marker; marker= marker->next) {
- if( ((leftright == ACTKEYS_LRSEL_LEFT) && (marker->frame < CFRA)) ||
+ if ( ((leftright == ACTKEYS_LRSEL_LEFT) && (marker->frame < CFRA)) ||
((leftright == ACTKEYS_LRSEL_RIGHT) && (marker->frame >= CFRA)) )
{
marker->flag |= SELECT;
@@ -863,20 +863,20 @@ static int actkeys_select_leftright_invoke (bContext *C, wmOperator *op, wmEvent
void ACTION_OT_select_leftright (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Left/Right";
- ot->idname= "ACTION_OT_select_leftright";
- ot->description= "Select keyframes to the left or the right of the current frame";
+ ot->name = "Select Left/Right";
+ ot->idname = "ACTION_OT_select_leftright";
+ ot->description = "Select keyframes to the left or the right of the current frame";
/* api callbacks */
- ot->invoke= actkeys_select_leftright_invoke;
- ot->exec= actkeys_select_leftright_exec;
- ot->poll= ED_operator_action_active;
+ ot->invoke = actkeys_select_leftright_invoke;
+ ot->exec = actkeys_select_leftright_exec;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "mode", prop_actkeys_leftright_select_types, ACTKEYS_LRSEL_TEST, "Mode", "");
+ ot->prop = RNA_def_enum(ot->srna, "mode", prop_actkeys_leftright_select_types, ACTKEYS_LRSEL_TEST, "Mode", "");
RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", "");
}
@@ -997,7 +997,7 @@ static void mouse_action_keys (bAnimContext *ac, const int mval[2], short select
ale= BLI_findlink(&anim_data, channel_index);
if (ale == NULL) {
/* channel not found */
- printf("Error: animation channel (index = %d) not found in mouse_action_keys() \n", channel_index);
+ printf("Error: animation channel (index = %d) not found in mouse_action_keys()\n", channel_index);
BLI_freelistN(&anim_data);
return;
}
@@ -1177,16 +1177,16 @@ static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even
void ACTION_OT_clickselect (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mouse Select Keys";
- ot->idname= "ACTION_OT_clickselect";
- ot->description= "Select keyframes by clicking on them";
+ ot->name = "Mouse Select Keys";
+ ot->idname = "ACTION_OT_clickselect";
+ ot->description = "Select keyframes by clicking on them";
/* api callbacks - absolutely no exec() this yet... */
- ot->invoke= actkeys_clickselect_invoke;
- ot->poll= ED_operator_action_active;
+ ot->invoke = actkeys_clickselect_invoke;
+ ot->poll = ED_operator_action_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", ""); // SHIFTKEY
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index 4baaa469127..9d0dab7d34e 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -101,10 +101,10 @@ static SpaceLink *action_new(const bContext *C)
BLI_addtail(&saction->regionbase, ar);
ar->regiontype= RGN_TYPE_WINDOW;
- ar->v2d.tot.xmin= -10.0f;
- ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f;
- ar->v2d.tot.xmax= (float)(sa->winx);
- ar->v2d.tot.ymax= 0.0f;
+ ar->v2d.tot.xmin = -10.0f;
+ ar->v2d.tot.ymin = (float)(-sa->winy)/3.0f;
+ ar->v2d.tot.xmax = (float)(sa->winx);
+ ar->v2d.tot.ymax = 0.0f;
ar->v2d.cur = ar->v2d.tot;
@@ -160,7 +160,7 @@ static void action_main_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "Dopesheet", SPACE_ACTION, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Dopesheet", SPACE_ACTION, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -223,7 +223,7 @@ static void action_channel_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -289,17 +289,17 @@ static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn)
ED_region_tag_redraw(ar);
break;
case ND_MODIFIER:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
}
break;
case NC_ID:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
default:
- if(wmn->data==ND_KEYS)
+ if (wmn->data==ND_KEYS)
ED_region_tag_redraw(ar);
}
}
@@ -341,12 +341,12 @@ static void action_main_area_listener(ARegion *ar, wmNotifier *wmn)
}
break;
case NC_ID:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
default:
- if(wmn->data==ND_KEYS)
+ if (wmn->data==ND_KEYS)
ED_region_tag_redraw(ar);
}
}
@@ -438,7 +438,7 @@ static void action_header_area_listener(ARegion *ar, wmNotifier *wmn)
}
break;
case NC_ID:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
}
@@ -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..31243184961 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -117,8 +117,8 @@ void ED_spacetypes_init(void)
/* register operators */
spacetypes = BKE_spacetypes_list();
- for(type=spacetypes->first; type; type=type->next) {
- if(type->operatortypes)
+ for (type=spacetypes->first; type; type=type->next) {
+ if (type->operatortypes)
type->operatortypes();
}
@@ -136,8 +136,8 @@ void ED_spacetypes_init(void)
/* register dropboxes (can use macros) */
spacetypes = BKE_spacetypes_list();
- for(type=spacetypes->first; type; type=type->next) {
- if(type->dropboxes)
+ for (type=spacetypes->first; type; type=type->next) {
+ if (type->dropboxes)
type->dropboxes();
}
@@ -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;
@@ -169,11 +169,11 @@ void ED_spacetypes_keymap(wmKeyConfig *keyconf)
UI_view2d_keymap(keyconf);
spacetypes = BKE_spacetypes_list();
- for(stype=spacetypes->first; stype; stype=stype->next) {
- if(stype->keymap)
+ for (stype=spacetypes->first; stype; stype=stype->next) {
+ if (stype->keymap)
stype->keymap(keyconf);
- for(atype=stype->regiontypes.first; atype; atype=atype->next) {
- if(atype->keymap)
+ for (atype=stype->regiontypes.first; atype; atype=atype->next) {
+ if (atype->keymap)
atype->keymap(keyconf);
}
}
@@ -209,8 +209,8 @@ void ED_region_draw_cb_exit(ARegionType *art, void *handle)
{
RegionDrawCB *rdc;
- for(rdc= art->drawcalls.first; rdc; rdc= rdc->next) {
- if(rdc==(RegionDrawCB *)handle) {
+ for (rdc= art->drawcalls.first; rdc; rdc= rdc->next) {
+ if (rdc==(RegionDrawCB *)handle) {
BLI_remlink(&art->drawcalls, rdc);
MEM_freeN(rdc);
return;
@@ -227,8 +227,8 @@ void ED_region_draw_cb_draw(const bContext *C, ARegion *ar, int type)
{
RegionDrawCB *rdc;
- for(rdc= ar->type->drawcalls.first; rdc; rdc= rdc->next) {
- if(rdc->type==type)
+ for (rdc= ar->type->drawcalls.first; rdc; rdc= rdc->next) {
+ if (rdc->type==type)
rdc->draw(C, ar, rdc->customdata);
}
}
diff --git a/source/blender/editors/space_buttons/CMakeLists.txt b/source/blender/editors/space_buttons/CMakeLists.txt
index ee118f12062..7233d4623d1 100644
--- a/source/blender/editors/space_buttons/CMakeLists.txt
+++ b/source/blender/editors/space_buttons/CMakeLists.txt
@@ -44,4 +44,8 @@ set(SRC
buttons_intern.h
)
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_editor_space_buttons "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/space_buttons/SConscript b/source/blender/editors/space_buttons/SConscript
index 7bc588c627c..92579b6dedf 100644
--- a/source/blender/editors/space_buttons/SConscript
+++ b/source/blender/editors/space_buttons/SConscript
@@ -9,4 +9,7 @@ incs += ' ../../bmesh ../../makesrna ../../render/extern/include ../../blenloade
defs = []
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
env.BlenderLib ( 'bf_editors_space_buttons', sources, Split(incs), defs, libtype=['core'], priority=[120] )
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 2b63e455e11..b698ec03668 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -70,10 +70,10 @@ static int set_pointer_type(ButsContextPath *path, bContextDataResult *result, S
PointerRNA *ptr;
int a;
- for(a=0; a<path->len; a++) {
+ for (a=0; a<path->len; a++) {
ptr= &path->ptr[a];
- if(RNA_struct_is_a(ptr->type, type)) {
+ if (RNA_struct_is_a(ptr->type, type)) {
CTX_data_pointer_set(result, ptr->id.data, ptr->type, ptr->data);
return 1;
}
@@ -87,10 +87,10 @@ static PointerRNA *get_pointer_type(ButsContextPath *path, StructRNA *type)
PointerRNA *ptr;
int a;
- for(a=0; a<path->len; a++) {
+ for (a=0; a<path->len; a++) {
ptr= &path->ptr[a];
- if(RNA_struct_is_a(ptr->type, type))
+ if (RNA_struct_is_a(ptr->type, type))
return ptr;
}
@@ -116,15 +116,15 @@ static int buttons_context_path_world(ButsContextPath *path)
PointerRNA *ptr= &path->ptr[path->len-1];
/* if we already have a (pinned) world, we're done */
- if(RNA_struct_is_a(ptr->type, &RNA_World)) {
+ if (RNA_struct_is_a(ptr->type, &RNA_World)) {
return 1;
}
/* if we have a scene, use the scene's world */
- else if(buttons_context_path_scene(path)) {
+ else if (buttons_context_path_scene(path)) {
scene= path->ptr[path->len-1].data;
world= scene->world;
- if(world) {
+ if (world) {
RNA_id_pointer_create(&scene->world->id, &path->ptr[path->len]);
path->len++;
return 1;
@@ -146,15 +146,15 @@ static int buttons_context_path_object(ButsContextPath *path)
PointerRNA *ptr= &path->ptr[path->len-1];
/* if we already have a (pinned) object, we're done */
- if(RNA_struct_is_a(ptr->type, &RNA_Object)) {
+ if (RNA_struct_is_a(ptr->type, &RNA_Object)) {
return 1;
}
/* if we have a scene, use the scene's active object */
- else if(buttons_context_path_scene(path)) {
+ else if (buttons_context_path_scene(path)) {
scene= path->ptr[path->len-1].data;
ob= (scene->basact)? scene->basact->object: NULL;
- if(ob) {
+ if (ob) {
RNA_id_pointer_create(&ob->id, &path->ptr[path->len]);
path->len++;
@@ -172,19 +172,19 @@ static int buttons_context_path_data(ButsContextPath *path, int type)
PointerRNA *ptr= &path->ptr[path->len-1];
/* if we already have a data, we're done */
- if(RNA_struct_is_a(ptr->type, &RNA_Mesh) && (type == -1 || type == OB_MESH)) return 1;
- else if(RNA_struct_is_a(ptr->type, &RNA_Curve) && (type == -1 || ELEM3(type, OB_CURVE, OB_SURF, OB_FONT))) return 1;
- else if(RNA_struct_is_a(ptr->type, &RNA_Armature) && (type == -1 || type == OB_ARMATURE)) return 1;
- else if(RNA_struct_is_a(ptr->type, &RNA_MetaBall) && (type == -1 || type == OB_MBALL)) return 1;
- else if(RNA_struct_is_a(ptr->type, &RNA_Lattice) && (type == -1 || type == OB_LATTICE)) return 1;
- else if(RNA_struct_is_a(ptr->type, &RNA_Camera) && (type == -1 || type == OB_CAMERA)) return 1;
- else if(RNA_struct_is_a(ptr->type, &RNA_Lamp) && (type == -1 || type == OB_LAMP)) return 1;
- else if(RNA_struct_is_a(ptr->type, &RNA_Speaker) && (type == -1 || type == OB_SPEAKER)) return 1;
+ if (RNA_struct_is_a(ptr->type, &RNA_Mesh) && (type == -1 || type == OB_MESH)) return 1;
+ else if (RNA_struct_is_a(ptr->type, &RNA_Curve) && (type == -1 || ELEM3(type, OB_CURVE, OB_SURF, OB_FONT))) return 1;
+ else if (RNA_struct_is_a(ptr->type, &RNA_Armature) && (type == -1 || type == OB_ARMATURE)) return 1;
+ else if (RNA_struct_is_a(ptr->type, &RNA_MetaBall) && (type == -1 || type == OB_MBALL)) return 1;
+ else if (RNA_struct_is_a(ptr->type, &RNA_Lattice) && (type == -1 || type == OB_LATTICE)) return 1;
+ else if (RNA_struct_is_a(ptr->type, &RNA_Camera) && (type == -1 || type == OB_CAMERA)) return 1;
+ else if (RNA_struct_is_a(ptr->type, &RNA_Lamp) && (type == -1 || type == OB_LAMP)) return 1;
+ else if (RNA_struct_is_a(ptr->type, &RNA_Speaker) && (type == -1 || type == OB_SPEAKER)) return 1;
/* try to get an object in the path, no pinning supported here */
- else if(buttons_context_path_object(path)) {
+ else if (buttons_context_path_object(path)) {
ob= path->ptr[path->len-1].data;
- if(ob && (type == -1 || type == ob->type)) {
+ if (ob && (type == -1 || type == ob->type)) {
RNA_id_pointer_create(ob->data, &path->ptr[path->len]);
path->len++;
@@ -200,10 +200,10 @@ static int buttons_context_path_modifier(ButsContextPath *path)
{
Object *ob;
- if(buttons_context_path_object(path)) {
+ if (buttons_context_path_object(path)) {
ob= path->ptr[path->len-1].data;
- if(ob && ELEM5(ob->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_LATTICE))
+ if (ob && ELEM5(ob->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_LATTICE))
return 1;
}
@@ -217,23 +217,23 @@ static int buttons_context_path_material(ButsContextPath *path, int for_texture)
Material *ma;
/* if we already have a (pinned) material, we're done */
- if(RNA_struct_is_a(ptr->type, &RNA_Material)) {
+ if (RNA_struct_is_a(ptr->type, &RNA_Material)) {
return 1;
}
/* if we have an object, use the object material slot */
- else if(buttons_context_path_object(path)) {
+ else if (buttons_context_path_object(path)) {
ob= path->ptr[path->len-1].data;
- if(ob && OB_TYPE_SUPPORT_MATERIAL(ob->type)) {
+ if (ob && OB_TYPE_SUPPORT_MATERIAL(ob->type)) {
ma= give_current_material(ob, ob->actcol);
RNA_id_pointer_create(&ma->id, &path->ptr[path->len]);
path->len++;
- if(for_texture && give_current_material_texture_node(ma))
+ if (for_texture && give_current_material_texture_node(ma))
return 1;
ma= give_node_material(ma);
- if(ma) {
+ if (ma) {
RNA_id_pointer_create(&ma->id, &path->ptr[path->len]);
path->len++;
}
@@ -251,11 +251,11 @@ static int buttons_context_path_bone(ButsContextPath *path)
EditBone *edbo;
/* if we have an armature, get the active bone */
- if(buttons_context_path_data(path, OB_ARMATURE)) {
+ if (buttons_context_path_data(path, OB_ARMATURE)) {
arm= path->ptr[path->len-1].data;
- if(arm->edbo) {
- if(arm->act_edbone) {
+ if (arm->edbo) {
+ if (arm->act_edbone) {
edbo= arm->act_edbone;
RNA_pointer_create(&arm->id, &RNA_EditBone, edbo, &path->ptr[path->len]);
path->len++;
@@ -263,7 +263,7 @@ static int buttons_context_path_bone(ButsContextPath *path)
}
}
else {
- if(arm->act_bone) {
+ if (arm->act_bone) {
RNA_pointer_create(&arm->id, &RNA_Bone, arm->act_bone, &path->ptr[path->len]);
path->len++;
return 1;
@@ -280,22 +280,22 @@ static int buttons_context_path_pose_bone(ButsContextPath *path)
PointerRNA *ptr= &path->ptr[path->len-1];
/* if we already have a (pinned) PoseBone, we're done */
- if(RNA_struct_is_a(ptr->type, &RNA_PoseBone)) {
+ if (RNA_struct_is_a(ptr->type, &RNA_PoseBone)) {
return 1;
}
/* if we have an armature, get the active bone */
- if(buttons_context_path_object(path)) {
+ if (buttons_context_path_object(path)) {
Object *ob= path->ptr[path->len-1].data;
bArmature *arm= ob->data; /* path->ptr[path->len-1].data - works too */
- if(ob->type != OB_ARMATURE || arm->edbo) {
+ if (ob->type != OB_ARMATURE || arm->edbo) {
return 0;
}
else {
- if(arm->act_bone) {
+ if (arm->act_bone) {
bPoseChannel *pchan= get_pose_channel(ob->pose, arm->act_bone->name);
- if(pchan) {
+ if (pchan) {
RNA_pointer_create(&ob->id, &RNA_PoseBone, pchan, &path->ptr[path->len]);
path->len++;
return 1;
@@ -316,14 +316,14 @@ static int buttons_context_path_particle(ButsContextPath *path)
PointerRNA *ptr= &path->ptr[path->len-1];
/* if we already have (pinned) particle settings, we're done */
- if(RNA_struct_is_a(ptr->type, &RNA_ParticleSettings)) {
+ if (RNA_struct_is_a(ptr->type, &RNA_ParticleSettings)) {
return 1;
}
/* if we have an object, get the active particle system */
- if(buttons_context_path_object(path)) {
+ if (buttons_context_path_object(path)) {
ob= path->ptr[path->len-1].data;
- if(ob && ob->type == OB_MESH) {
+ if (ob && ob->type == OB_MESH) {
psys= psys_get_current(ob);
RNA_pointer_create(&ob->id, &RNA_ParticleSystem, psys, &path->ptr[path->len]);
@@ -343,17 +343,17 @@ static int buttons_context_path_brush(ButsContextPath *path)
PointerRNA *ptr= &path->ptr[path->len-1];
/* if we already have a (pinned) brush, we're done */
- if(RNA_struct_is_a(ptr->type, &RNA_Brush)) {
+ if (RNA_struct_is_a(ptr->type, &RNA_Brush)) {
return 1;
}
/* if we have a scene, use the toolsettings brushes */
- else if(buttons_context_path_scene(path)) {
+ else if (buttons_context_path_scene(path)) {
scene= path->ptr[path->len-1].data;
- if(scene)
+ if (scene)
br= paint_brush(paint_get_active(scene));
- if(br) {
+ if (br) {
RNA_id_pointer_create((ID *)br, &path->ptr[path->len]);
path->len++;
@@ -367,36 +367,36 @@ static int buttons_context_path_brush(ButsContextPath *path)
static int buttons_context_path_texture(ButsContextPath *path, ButsContextTexture *ct)
{
- if(ct) {
+ if (ct) {
/* new shading system */
PointerRNA *ptr= &path->ptr[path->len-1];
ID *id;
/* if we already have a (pinned) texture, we're done */
- if(RNA_struct_is_a(ptr->type, &RNA_Texture))
+ if (RNA_struct_is_a(ptr->type, &RNA_Texture))
return 1;
- if(!ct->user)
+ if (!ct->user)
return 0;
id= ct->user->id;
- if(id) {
- if(GS(id->name) == ID_BR)
+ if (id) {
+ if (GS(id->name) == ID_BR)
buttons_context_path_brush(path);
- else if(GS(id->name) == ID_MA)
+ else if (GS(id->name) == ID_MA)
buttons_context_path_material(path, 0);
- else if(GS(id->name) == ID_WO)
+ else if (GS(id->name) == ID_WO)
buttons_context_path_world(path);
- else if(GS(id->name) == ID_LA)
+ else if (GS(id->name) == ID_LA)
buttons_context_path_data(path, OB_LAMP);
- else if(GS(id->name) == ID_PA)
+ else if (GS(id->name) == ID_PA)
buttons_context_path_particle(path);
- else if(GS(id->name) == ID_OB)
+ else if (GS(id->name) == ID_OB)
buttons_context_path_object(path);
}
- if(ct->texture) {
+ if (ct->texture) {
RNA_id_pointer_create(&ct->texture->id, &path->ptr[path->len]);
path->len++;
}
@@ -415,14 +415,14 @@ static int buttons_context_path_texture(ButsContextPath *path, ButsContextTextur
int orig_len = path->len;
/* if we already have a (pinned) texture, we're done */
- if(RNA_struct_is_a(ptr->type, &RNA_Texture)) {
+ if (RNA_struct_is_a(ptr->type, &RNA_Texture)) {
return 1;
}
/* try brush */
- if((path->tex_ctx == SB_TEXC_BRUSH) && buttons_context_path_brush(path)) {
+ if ((path->tex_ctx == SB_TEXC_BRUSH) && buttons_context_path_brush(path)) {
br= path->ptr[path->len-1].data;
- if(br) {
+ if (br) {
tex= give_current_brush_texture(br);
RNA_id_pointer_create(&tex->id, &path->ptr[path->len]);
@@ -431,10 +431,10 @@ static int buttons_context_path_texture(ButsContextPath *path, ButsContextTextur
}
}
/* try world */
- if((path->tex_ctx == SB_TEXC_WORLD) && buttons_context_path_world(path)) {
+ if ((path->tex_ctx == SB_TEXC_WORLD) && buttons_context_path_world(path)) {
wo= path->ptr[path->len-1].data;
- if(wo && GS(wo->id.name)==ID_WO) {
+ if (wo && GS(wo->id.name)==ID_WO) {
tex= give_current_world_texture(wo);
RNA_id_pointer_create(&tex->id, &path->ptr[path->len]);
@@ -443,8 +443,8 @@ static int buttons_context_path_texture(ButsContextPath *path, ButsContextTextur
}
}
/* try particles */
- if((path->tex_ctx == SB_TEXC_PARTICLES) && buttons_context_path_particle(path)) {
- if(path->ptr[path->len-1].type == &RNA_ParticleSettings) {
+ if ((path->tex_ctx == SB_TEXC_PARTICLES) && buttons_context_path_particle(path)) {
+ if (path->ptr[path->len-1].type == &RNA_ParticleSettings) {
ParticleSettings *part = path->ptr[path->len-1].data;
tex= give_current_particle_texture(part);
@@ -455,7 +455,7 @@ static int buttons_context_path_texture(ButsContextPath *path, ButsContextTextur
else {
psys= path->ptr[path->len-1].data;
- if(psys && psys->part && GS(psys->part->id.name)==ID_PA) {
+ if (psys && psys->part && GS(psys->part->id.name)==ID_PA) {
tex= give_current_particle_texture(psys->part);
RNA_id_pointer_create(&tex->id, &path->ptr[path->len]);
@@ -465,10 +465,10 @@ static int buttons_context_path_texture(ButsContextPath *path, ButsContextTextur
}
}
/* try material */
- if(buttons_context_path_material(path, 1)) {
+ if (buttons_context_path_material(path, 1)) {
ma= path->ptr[path->len-1].data;
- if(ma) {
+ if (ma) {
tex= give_current_material_texture(ma);
RNA_id_pointer_create(&tex->id, &path->ptr[path->len]);
@@ -477,10 +477,10 @@ static int buttons_context_path_texture(ButsContextPath *path, ButsContextTextur
}
}
/* try lamp */
- if(buttons_context_path_data(path, OB_LAMP)) {
+ if (buttons_context_path_data(path, OB_LAMP)) {
la= path->ptr[path->len-1].data;
- if(la) {
+ if (la) {
tex= give_current_lamp_texture(la);
RNA_id_pointer_create(&tex->id, &path->ptr[path->len]);
@@ -490,10 +490,10 @@ static int buttons_context_path_texture(ButsContextPath *path, ButsContextTextur
}
/* try brushes again in case of no material, lamp, etc */
path->len = orig_len;
- if(buttons_context_path_brush(path)) {
+ if (buttons_context_path_brush(path)) {
br= path->ptr[path->len-1].data;
- if(br) {
+ if (br) {
tex= give_current_brush_texture(br);
RNA_id_pointer_create(&tex->id, &path->ptr[path->len]);
@@ -519,7 +519,7 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma
path->tex_ctx = sbuts->texture_context;
/* if some ID datablock is pinned, set the root pointer */
- if(sbuts->pinid) {
+ if (sbuts->pinid) {
id= sbuts->pinid;
RNA_id_pointer_create(id, &path->ptr[0]);
@@ -527,7 +527,7 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma
}
/* no pinned root, use scene as root */
- if(path->len == 0) {
+ if (path->len == 0) {
id= (ID*)CTX_data_scene(C);
RNA_id_pointer_create(id, &path->ptr[0]);
path->len++;
@@ -565,7 +565,7 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma
break;
case BCONTEXT_BONE:
found= buttons_context_path_bone(path);
- if(!found)
+ if (!found)
found= buttons_context_path_data(path, OB_ARMATURE);
break;
case BCONTEXT_BONE_CONSTRAINT:
@@ -583,9 +583,9 @@ static int buttons_shading_context(const bContext *C, int mainb)
{
Object *ob= CTX_data_active_object(C);
- if(ELEM3(mainb, BCONTEXT_MATERIAL, BCONTEXT_WORLD, BCONTEXT_TEXTURE))
+ if (ELEM3(mainb, BCONTEXT_MATERIAL, BCONTEXT_WORLD, BCONTEXT_TEXTURE))
return 1;
- if(mainb == BCONTEXT_DATA && ob && ELEM(ob->type, OB_LAMP, OB_CAMERA))
+ if (mainb == BCONTEXT_DATA && ob && ELEM(ob->type, OB_LAMP, OB_CAMERA))
return 1;
return 0;
@@ -595,11 +595,11 @@ static int buttons_shading_new_context(const bContext *C, int flag)
{
Object *ob= CTX_data_active_object(C);
- if(flag & (1 << BCONTEXT_MATERIAL))
+ if (flag & (1 << BCONTEXT_MATERIAL))
return BCONTEXT_MATERIAL;
- else if(ob && ELEM(ob->type, OB_LAMP, OB_CAMERA) && (flag & (1 << BCONTEXT_DATA)))
+ else if (ob && ELEM(ob->type, OB_LAMP, OB_CAMERA) && (flag & (1 << BCONTEXT_DATA)))
return BCONTEXT_DATA;
- else if(flag & (1 << BCONTEXT_WORLD))
+ else if (flag & (1 << BCONTEXT_WORLD))
return BCONTEXT_WORLD;
return BCONTEXT_RENDER;
@@ -613,22 +613,22 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts)
buttons_texture_context_compute(C, sbuts);
- if(!sbuts->path)
+ if (!sbuts->path)
sbuts->path= MEM_callocN(sizeof(ButsContextPath), "ButsContextPath");
path= sbuts->path;
/* for each context, see if we can compute a valid path to it, if
* this is the case, we know we have to display the button */
- for(a=0; a<BCONTEXT_TOT; a++) {
- if(buttons_context_path(C, path, a, pflag)) {
+ for (a=0; a<BCONTEXT_TOT; a++) {
+ if (buttons_context_path(C, path, a, pflag)) {
flag |= (1<<a);
/* setting icon for data context */
- if(a == BCONTEXT_DATA) {
+ if (a == BCONTEXT_DATA) {
ptr= &path->ptr[path->len-1];
- if(ptr->type)
+ if (ptr->type)
sbuts->dataicon= RNA_struct_ui_icon(ptr->type);
else
sbuts->dataicon= ICON_EMPTY_DATA;
@@ -642,17 +642,17 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts)
sbuts->mainb= sbuts->mainbuser;
/* in case something becomes invalid, change */
- if((flag & (1 << sbuts->mainb)) == 0) {
- if(sbuts->flag & SB_SHADING_CONTEXT) {
+ if ((flag & (1 << sbuts->mainb)) == 0) {
+ if (sbuts->flag & SB_SHADING_CONTEXT) {
/* try to keep showing shading related buttons */
sbuts->mainb= buttons_shading_new_context(C, flag);
}
- else if(flag & BCONTEXT_OBJECT) {
+ else if (flag & BCONTEXT_OBJECT) {
sbuts->mainb= BCONTEXT_OBJECT;
}
else {
- for(a=0; a<BCONTEXT_TOT; a++) {
- if(flag & (1 << a)) {
+ for (a=0; a<BCONTEXT_TOT; a++) {
+ if (flag & (1 << a)) {
sbuts->mainb= a;
break;
}
@@ -662,14 +662,14 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts)
buttons_context_path(C, path, sbuts->mainb, pflag);
- if(!(flag & (1 << sbuts->mainb))) {
- if(flag & (1 << BCONTEXT_OBJECT))
+ if (!(flag & (1 << sbuts->mainb))) {
+ if (flag & (1 << BCONTEXT_OBJECT))
sbuts->mainb= BCONTEXT_OBJECT;
else
sbuts->mainb= BCONTEXT_SCENE;
}
- if(buttons_shading_context(C, sbuts->mainb))
+ if (buttons_shading_context(C, sbuts->mainb))
sbuts->flag |= SB_SHADING_CONTEXT;
else
sbuts->flag &= ~SB_SHADING_CONTEXT;
@@ -691,62 +691,62 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
SpaceButs *sbuts= CTX_wm_space_buts(C);
ButsContextPath *path= sbuts?sbuts->path:NULL;
- if(!path)
+ if (!path)
return 0;
/* here we handle context, getting data from precomputed path */
- if(CTX_data_dir(member)) {
+ if (CTX_data_dir(member)) {
CTX_data_dir_set(result, buttons_context_dir);
return 1;
}
- else if(CTX_data_equals(member, "world")) {
+ else if (CTX_data_equals(member, "world")) {
set_pointer_type(path, result, &RNA_World);
return 1;
}
- else if(CTX_data_equals(member, "object")) {
+ else if (CTX_data_equals(member, "object")) {
set_pointer_type(path, result, &RNA_Object);
return 1;
}
- else if(CTX_data_equals(member, "mesh")) {
+ else if (CTX_data_equals(member, "mesh")) {
set_pointer_type(path, result, &RNA_Mesh);
return 1;
}
- else if(CTX_data_equals(member, "armature")) {
+ else if (CTX_data_equals(member, "armature")) {
set_pointer_type(path, result, &RNA_Armature);
return 1;
}
- else if(CTX_data_equals(member, "lattice")) {
+ else if (CTX_data_equals(member, "lattice")) {
set_pointer_type(path, result, &RNA_Lattice);
return 1;
}
- else if(CTX_data_equals(member, "curve")) {
+ else if (CTX_data_equals(member, "curve")) {
set_pointer_type(path, result, &RNA_Curve);
return 1;
}
- else if(CTX_data_equals(member, "meta_ball")) {
+ else if (CTX_data_equals(member, "meta_ball")) {
set_pointer_type(path, result, &RNA_MetaBall);
return 1;
}
- else if(CTX_data_equals(member, "lamp")) {
+ else if (CTX_data_equals(member, "lamp")) {
set_pointer_type(path, result, &RNA_Lamp);
return 1;
}
- else if(CTX_data_equals(member, "camera")) {
+ else if (CTX_data_equals(member, "camera")) {
set_pointer_type(path, result, &RNA_Camera);
return 1;
}
- else if(CTX_data_equals(member, "speaker")) {
+ else if (CTX_data_equals(member, "speaker")) {
set_pointer_type(path, result, &RNA_Speaker);
return 1;
}
- else if(CTX_data_equals(member, "material")) {
+ else if (CTX_data_equals(member, "material")) {
set_pointer_type(path, result, &RNA_Material);
return 1;
}
- else if(CTX_data_equals(member, "texture")) {
+ else if (CTX_data_equals(member, "texture")) {
ButsContextTexture *ct= sbuts->texuser;
- if(ct) {
+ if (ct) {
/* new shading system */
CTX_data_pointer_set(result, &ct->texture->id, &RNA_Texture, ct->texture);
}
@@ -757,41 +757,41 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
return 1;
}
- else if(CTX_data_equals(member, "material_slot")) {
+ else if (CTX_data_equals(member, "material_slot")) {
PointerRNA *ptr= get_pointer_type(path, &RNA_Object);
- if(ptr) {
+ if (ptr) {
Object *ob= ptr->data;
- if(ob && OB_TYPE_SUPPORT_MATERIAL(ob->type) && ob->totcol) {
+ if (ob && OB_TYPE_SUPPORT_MATERIAL(ob->type) && ob->totcol) {
/* a valid actcol isn't ensured [#27526] */
int matnr= ob->actcol-1;
- if(matnr < 0) matnr= 0;
+ if (matnr < 0) matnr= 0;
CTX_data_pointer_set(result, &ob->id, &RNA_MaterialSlot, &ob->mat[matnr]);
}
}
return 1;
}
- else if(CTX_data_equals(member, "texture_user")) {
+ else if (CTX_data_equals(member, "texture_user")) {
ButsContextTexture *ct= sbuts->texuser;
- if(!ct)
+ if (!ct)
return -1; /* old shading system (found but not available) */
- if(ct->user && ct->user->ptr.data) {
+ if (ct->user && ct->user->ptr.data) {
ButsTextureUser *user= ct->user;
CTX_data_pointer_set(result, user->ptr.id.data, user->ptr.type, user->ptr.data);
}
return 1;
}
- else if(CTX_data_equals(member, "texture_node")) {
+ else if (CTX_data_equals(member, "texture_node")) {
ButsContextTexture *ct= sbuts->texuser;
- if(ct) {
+ if (ct) {
/* new shading system */
- if(ct->user && ct->user->node)
+ if (ct->user && ct->user->node)
CTX_data_pointer_set(result, &ct->user->ntree->id, &RNA_Node, ct->user->node);
return 1;
@@ -800,10 +800,10 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
/* old shading system */
PointerRNA *ptr;
- if((ptr=get_pointer_type(path, &RNA_Material))) {
+ if ((ptr=get_pointer_type(path, &RNA_Material))) {
Material *ma= ptr->data;
- if(ma) {
+ if (ma) {
bNode *node= give_current_material_texture_node(ma);
CTX_data_pointer_set(result, &ma->nodetree->id, &RNA_Node, node);
}
@@ -812,18 +812,18 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
return 1;
}
}
- else if(CTX_data_equals(member, "texture_slot")) {
+ else if (CTX_data_equals(member, "texture_slot")) {
ButsContextTexture *ct= sbuts->texuser;
PointerRNA *ptr;
- if(ct)
+ if (ct)
return 0; /* new shading system */
- if((ptr=get_pointer_type(path, &RNA_Material))) {
+ if ((ptr=get_pointer_type(path, &RNA_Material))) {
Material *ma= ptr->data;
/* if we have a node material, get slot from material in material node */
- if(ma && ma->use_nodes && ma->nodetree) {
+ if (ma && ma->use_nodes && ma->nodetree) {
/* if there's an active texture node in the node tree,
* then that texture is in context directly, without a texture slot */
if (give_current_material_texture_node(ma))
@@ -834,84 +834,85 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
CTX_data_pointer_set(result, &ma->id, &RNA_MaterialTextureSlot, ma->mtex[(int)ma->texact]);
else
return 0;
- } else if(ma) {
+ }
+ else if (ma) {
CTX_data_pointer_set(result, &ma->id, &RNA_MaterialTextureSlot, ma->mtex[(int)ma->texact]);
}
}
- else if((ptr=get_pointer_type(path, &RNA_Lamp))) {
+ else if ((ptr=get_pointer_type(path, &RNA_Lamp))) {
Lamp *la= ptr->data;
- if(la)
+ if (la)
CTX_data_pointer_set(result, &la->id, &RNA_LampTextureSlot, la->mtex[(int)la->texact]);
}
- else if((ptr=get_pointer_type(path, &RNA_World))) {
+ else if ((ptr=get_pointer_type(path, &RNA_World))) {
World *wo= ptr->data;
- if(wo)
+ if (wo)
CTX_data_pointer_set(result, &wo->id, &RNA_WorldTextureSlot, wo->mtex[(int)wo->texact]);
}
- else if((ptr=get_pointer_type(path, &RNA_Brush))) { /* how to get this into context? */
+ else if ((ptr=get_pointer_type(path, &RNA_Brush))) { /* how to get this into context? */
Brush *br= ptr->data;
- if(br)
+ if (br)
CTX_data_pointer_set(result, &br->id, &RNA_BrushTextureSlot, &br->mtex);
}
- else if((ptr=get_pointer_type(path, &RNA_ParticleSystem))) {
+ else if ((ptr=get_pointer_type(path, &RNA_ParticleSystem))) {
ParticleSettings *part= ((ParticleSystem *)ptr->data)->part;
- if(part)
+ if (part)
CTX_data_pointer_set(result, &part->id, &RNA_ParticleSettingsTextureSlot, part->mtex[(int)part->texact]);
}
return 1;
}
- else if(CTX_data_equals(member, "bone")) {
+ else if (CTX_data_equals(member, "bone")) {
set_pointer_type(path, result, &RNA_Bone);
return 1;
}
- else if(CTX_data_equals(member, "edit_bone")) {
+ else if (CTX_data_equals(member, "edit_bone")) {
set_pointer_type(path, result, &RNA_EditBone);
return 1;
}
- else if(CTX_data_equals(member, "pose_bone")) {
+ else if (CTX_data_equals(member, "pose_bone")) {
set_pointer_type(path, result, &RNA_PoseBone);
return 1;
}
- else if(CTX_data_equals(member, "particle_system")) {
+ else if (CTX_data_equals(member, "particle_system")) {
set_pointer_type(path, result, &RNA_ParticleSystem);
return 1;
}
- else if(CTX_data_equals(member, "particle_system_editable")) {
- if(PE_poll((bContext*)C))
+ else if (CTX_data_equals(member, "particle_system_editable")) {
+ if (PE_poll((bContext*)C))
set_pointer_type(path, result, &RNA_ParticleSystem);
else
CTX_data_pointer_set(result, NULL, &RNA_ParticleSystem, NULL);
return 1;
}
- else if(CTX_data_equals(member, "cloth")) {
+ else if (CTX_data_equals(member, "cloth")) {
PointerRNA *ptr= get_pointer_type(path, &RNA_Object);
- if(ptr && ptr->data) {
+ if (ptr && ptr->data) {
Object *ob= ptr->data;
ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth);
CTX_data_pointer_set(result, &ob->id, &RNA_ClothModifier, md);
return 1;
}
}
- else if(CTX_data_equals(member, "soft_body")) {
+ else if (CTX_data_equals(member, "soft_body")) {
PointerRNA *ptr= get_pointer_type(path, &RNA_Object);
- if(ptr && ptr->data) {
+ if (ptr && ptr->data) {
Object *ob= ptr->data;
ModifierData *md= modifiers_findByType(ob, eModifierType_Softbody);
CTX_data_pointer_set(result, &ob->id, &RNA_SoftBodyModifier, md);
return 1;
}
}
- else if(CTX_data_equals(member, "fluid")) {
+ else if (CTX_data_equals(member, "fluid")) {
PointerRNA *ptr= get_pointer_type(path, &RNA_Object);
- if(ptr && ptr->data) {
+ if (ptr && ptr->data) {
Object *ob= ptr->data;
ModifierData *md= modifiers_findByType(ob, eModifierType_Fluidsim);
CTX_data_pointer_set(result, &ob->id, &RNA_FluidSimulationModifier, md);
@@ -919,34 +920,34 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
}
}
- else if(CTX_data_equals(member, "smoke")) {
+ else if (CTX_data_equals(member, "smoke")) {
PointerRNA *ptr= get_pointer_type(path, &RNA_Object);
- if(ptr && ptr->data) {
+ if (ptr && ptr->data) {
Object *ob= ptr->data;
ModifierData *md= modifiers_findByType(ob, eModifierType_Smoke);
CTX_data_pointer_set(result, &ob->id, &RNA_SmokeModifier, md);
return 1;
}
}
- else if(CTX_data_equals(member, "collision")) {
+ else if (CTX_data_equals(member, "collision")) {
PointerRNA *ptr= get_pointer_type(path, &RNA_Object);
- if(ptr && ptr->data) {
+ if (ptr && ptr->data) {
Object *ob= ptr->data;
ModifierData *md= modifiers_findByType(ob, eModifierType_Collision);
CTX_data_pointer_set(result, &ob->id, &RNA_CollisionModifier, md);
return 1;
}
}
- else if(CTX_data_equals(member, "brush")) {
+ else if (CTX_data_equals(member, "brush")) {
set_pointer_type(path, result, &RNA_Brush);
return 1;
}
- else if(CTX_data_equals(member, "dynamic_paint")) {
+ else if (CTX_data_equals(member, "dynamic_paint")) {
PointerRNA *ptr= get_pointer_type(path, &RNA_Object);
- if(ptr && ptr->data) {
+ if (ptr && ptr->data) {
Object *ob= ptr->data;
ModifierData *md= modifiers_findByType(ob, eModifierType_DynamicPaint);
CTX_data_pointer_set(result, &ob->id, &RNA_DynamicPaintModifier, md);
@@ -966,7 +967,7 @@ static void pin_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2))
{
SpaceButs *sbuts= CTX_wm_space_buts(C);
- if(sbuts->flag & SB_PIN_CONTEXT) {
+ if (sbuts->flag & SB_PIN_CONTEXT) {
sbuts->pinid= buttons_context_id_path(C);
}
else
@@ -986,7 +987,7 @@ void buttons_context_draw(const bContext *C, uiLayout *layout)
char namebuf[128], *name;
int a, icon;
- if(!path)
+ if (!path)
return;
row= uiLayoutRow(layout, 1);
@@ -994,27 +995,27 @@ void buttons_context_draw(const bContext *C, uiLayout *layout)
block= uiLayoutGetBlock(row);
uiBlockSetEmboss(block, UI_EMBOSSN);
- but= uiDefIconButBitC(block, ICONTOG, SB_PIN_CONTEXT, 0, ICON_UNPINNED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &sbuts->flag, 0, 0, 0, 0, "Follow context or keep fixed datablock displayed");
+ but = uiDefIconButBitC(block, ICONTOG, SB_PIN_CONTEXT, 0, ICON_UNPINNED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &sbuts->flag, 0, 0, 0, 0, "Follow context or keep fixed datablock displayed");
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
uiButSetFunc(but, pin_cb, NULL, NULL);
- for(a=0; a<path->len; a++) {
+ for (a=0; a<path->len; a++) {
ptr= &path->ptr[a];
- if(a != 0)
+ if (a != 0)
uiItemL(row, "", VICO_SMALL_TRI_RIGHT_VEC);
- if(ptr->data) {
+ if (ptr->data) {
icon= RNA_struct_ui_icon(ptr->type);
name= RNA_struct_name_get_alloc(ptr, namebuf, sizeof(namebuf), NULL);
- if(name) {
- if(!ELEM(sbuts->mainb, BCONTEXT_RENDER, BCONTEXT_SCENE) && ptr->type == &RNA_Scene)
+ if (name) {
+ if (!ELEM(sbuts->mainb, BCONTEXT_RENDER, BCONTEXT_SCENE) && ptr->type == &RNA_Scene)
uiItemLDrag(row, ptr, "", icon); /* save some space */
else
uiItemLDrag(row, ptr, name, icon);
- if(name != namebuf)
+ if (name != namebuf)
MEM_freeN(name);
}
else
@@ -1047,19 +1048,19 @@ ID *buttons_context_id_path(const bContext *C)
PointerRNA *ptr;
int a;
- if(path->len) {
- for(a=path->len-1; a>=0; a--) {
+ if (path->len) {
+ for (a=path->len-1; a>=0; a--) {
ptr= &path->ptr[a];
/* pin particle settings instead of system, since only settings are an idblock*/
- if(sbuts->mainb == BCONTEXT_PARTICLE && sbuts->flag & SB_PIN_CONTEXT) {
- if(ptr->type == &RNA_ParticleSystem && ptr->data) {
+ if (sbuts->mainb == BCONTEXT_PARTICLE && sbuts->flag & SB_PIN_CONTEXT) {
+ if (ptr->type == &RNA_ParticleSystem && ptr->data) {
ParticleSystem *psys = (ParticleSystem *)ptr->data;
return &psys->part->id;
}
}
- if(ptr->id.data) {
+ if (ptr->id.data) {
return ptr->id.data;
}
}
diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c
index 6777e2c2d85..fcc5b488ca9 100644
--- a/source/blender/editors/space_buttons/buttons_header.c
+++ b/source/blender/editors/space_buttons/buttons_header.c
@@ -63,7 +63,7 @@ static void set_texture_context(bContext *C, SpaceButs *sbuts)
case BCONTEXT_DATA:
{
Object *ob = CTX_data_active_object(C);
- if(ob && ob->type==OB_LAMP)
+ if (ob && ob->type==OB_LAMP)
sbuts->texture_context = SB_TEXC_MAT_OR_LAMP;
break;
}
@@ -80,7 +80,7 @@ static void do_buttons_buttons(bContext *C, void *UNUSED(arg), int event)
{
SpaceButs *sbuts= CTX_wm_space_buts(C);
- if(!sbuts) /* editor type switch */
+ if (!sbuts) /* editor type switch */
return;
switch(event) {
@@ -122,8 +122,8 @@ void buttons_header_buttons(const bContext *C, ARegion *ar)
uiBlockBeginAlign(block);
#define BUTTON_HEADER_CTX(_ctx, _icon, _tip) \
- if(sbuts->pathflag & (1<<_ctx)) { \
- but= uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, _icon, xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)_ctx, 0, 0, TIP_(_tip)); \
+ if (sbuts->pathflag & (1<<_ctx)) { \
+ but = uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, _icon, xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)_ctx, 0, 0, TIP_(_tip)); \
uiButClearFlag(but, UI_BUT_UNDO); \
} \
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c
index 26516bcda99..ec1c74013e0 100644
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@ -81,13 +81,13 @@ static int toolbox_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(e
void BUTTONS_OT_toolbox(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toolbox";
- ot->description="Display button panel toolbox";
- ot->idname= "BUTTONS_OT_toolbox";
+ ot->name = "Toolbox";
+ ot->description = "Display button panel toolbox";
+ ot->idname = "BUTTONS_OT_toolbox";
/* api callbacks */
- ot->invoke= toolbox_invoke;
- ot->poll= ED_operator_buttons_active;
+ ot->invoke = toolbox_invoke;
+ ot->poll = ED_operator_buttons_active;
}
/********************** filebrowse operator *********************/
@@ -110,7 +110,7 @@ static int file_browse_exec(bContext *C, wmOperator *op)
str= RNA_string_get_alloc(op->ptr, path_prop, NULL, 0);
/* add slash for directories, important for some properties */
- if(RNA_property_subtype(fbo->prop) == PROP_DIRPATH) {
+ if (RNA_property_subtype(fbo->prop) == PROP_DIRPATH) {
char name[FILE_MAX];
id = fbo->ptr.id.data;
@@ -118,7 +118,7 @@ static int file_browse_exec(bContext *C, wmOperator *op)
BLI_strncpy(path, str, FILE_MAX);
BLI_path_abs(path, id ? ID_BLEND_PATH(G.main, id) : G.main->name);
- if(BLI_is_dir(path)) {
+ if (BLI_is_dir(path)) {
str = MEM_reallocN(str, strlen(str)+2);
BLI_add_slash(str);
}
@@ -134,8 +134,8 @@ static int file_browse_exec(bContext *C, wmOperator *op)
/* special, annoying exception, filesel on redo panel [#26618] */
{
wmOperator *redo_op= WM_operator_last_redo(C);
- if(redo_op) {
- if(fbo->ptr.data == redo_op->ptr->data) {
+ if (redo_op) {
+ if (fbo->ptr.data == redo_op->ptr->data) {
ED_undo_operator_repeat(C, redo_op);
}
}
@@ -168,19 +168,19 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event)
uiFileBrowseContextProperty(C, &ptr, &prop);
- if(!prop)
+ if (!prop)
return OPERATOR_CANCELLED;
str= RNA_property_string_get_alloc(&ptr, prop, NULL, 0, NULL);
/* useful yet irritating feature, Shift+Click to open the file
* Alt+Click to browse a folder in the OS's browser */
- if(event->shift || event->alt) {
+ if (event->shift || event->alt) {
PointerRNA props_ptr;
- if(event->alt) {
+ if (event->alt) {
char *lslash= BLI_last_slash(str);
- if(lslash)
+ if (lslash)
*lslash= '\0';
}
@@ -205,8 +205,8 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* normally ED_fileselect_get_params would handle this but we need to because of stupid
* user-prefs exception - campbell */
- if(RNA_struct_find_property(op->ptr, "relative_path")) {
- if(!RNA_struct_property_is_set(op->ptr, "relative_path")) {
+ if (RNA_struct_find_property(op->ptr, "relative_path")) {
+ if (!RNA_struct_property_is_set(op->ptr, "relative_path")) {
/* annoying exception!, if were dealign with the user prefs, default relative to be off */
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS && (ptr.data != &U));
}
@@ -220,14 +220,14 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event)
void BUTTONS_OT_file_browse(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Accept";
- ot->description="Open a file browser, Hold Shift to open the file, Alt to browse containing directory";
- ot->idname= "BUTTONS_OT_file_browse";
+ ot->name = "Accept";
+ ot->description = "Open a file browser, Hold Shift to open the file, Alt to browse containing directory";
+ ot->idname = "BUTTONS_OT_file_browse";
/* api callbacks */
- ot->invoke= file_browse_invoke;
- ot->exec= file_browse_exec;
- ot->cancel= file_browse_cancel;
+ ot->invoke = file_browse_invoke;
+ ot->exec = file_browse_exec;
+ ot->cancel = file_browse_cancel;
/* properties */
WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
@@ -237,14 +237,14 @@ void BUTTONS_OT_file_browse(wmOperatorType *ot)
void BUTTONS_OT_directory_browse(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Accept";
- ot->description="Open a directory browser, Hold Shift to open the file, Alt to browse containing directory";
- ot->idname= "BUTTONS_OT_directory_browse";
+ ot->name = "Accept";
+ ot->description = "Open a directory browser, Hold Shift to open the file, Alt to browse containing directory";
+ ot->idname = "BUTTONS_OT_directory_browse";
/* api callbacks */
- ot->invoke= file_browse_invoke;
- ot->exec= file_browse_exec;
- ot->cancel= file_browse_cancel;
+ ot->invoke = file_browse_invoke;
+ ot->exec = file_browse_exec;
+ ot->cancel = file_browse_cancel;
/* properties */
WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c
index 6927a78332f..ba37cb8a892 100644
--- a/source/blender/editors/space_buttons/buttons_texture.c
+++ b/source/blender/editors/space_buttons/buttons_texture.c
@@ -111,9 +111,9 @@ static void buttons_texture_users_find_nodetree(ListBase *users, ID *id,
{
bNode *node;
- if(ntree) {
- for(node=ntree->nodes.first; node; node=node->next) {
- if(node->typeinfo->nclass == NODE_CLASS_TEXTURE) {
+ if (ntree) {
+ for (node=ntree->nodes.first; node; node=node->next) {
+ if (node->typeinfo->nclass == NODE_CLASS_TEXTURE) {
PointerRNA ptr;
/* PropertyRNA *prop; */ /* UNUSED */
@@ -123,7 +123,7 @@ static void buttons_texture_users_find_nodetree(ListBase *users, ID *id,
buttons_texture_user_node_add(users, id, ntree, node,
category, RNA_struct_ui_icon(ptr.type), node->name);
}
- else if(node->type == NODE_GROUP && node->id) {
+ else if (node->type == NODE_GROUP && node->id) {
buttons_texture_users_find_nodetree(users, id, (bNodeTree*)node->id, category);
}
}
@@ -154,46 +154,46 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext *
ID *pinid = sbuts->pinid;
/* get data from context */
- if(pinid) {
- if(GS(pinid->name) == ID_SCE)
+ if (pinid) {
+ if (GS(pinid->name) == ID_SCE)
scene= (Scene*)pinid;
- else if(GS(pinid->name) == ID_OB)
+ else if (GS(pinid->name) == ID_OB)
ob= (Object*)pinid;
- else if(GS(pinid->name) == ID_LA)
+ else if (GS(pinid->name) == ID_LA)
la= (Lamp*)pinid;
- else if(GS(pinid->name) == ID_WO)
+ else if (GS(pinid->name) == ID_WO)
wrld= (World*)pinid;
- else if(GS(pinid->name) == ID_MA)
+ else if (GS(pinid->name) == ID_MA)
ma= (Material*)pinid;
- else if(GS(pinid->name) == ID_BR)
+ else if (GS(pinid->name) == ID_BR)
brush= (Brush*)pinid;
}
- if(!scene)
+ if (!scene)
scene= CTX_data_scene(C);
- if(!(pinid || pinid == &scene->id)) {
+ if (!(pinid || pinid == &scene->id)) {
ob= (scene->basact)? scene->basact->object: NULL;
wrld= scene->world;
brush= paint_brush(paint_get_active(scene));
}
- if(ob && ob->type == OB_LAMP && !la)
+ if (ob && ob->type == OB_LAMP && !la)
la= ob->data;
- if(ob && !ma)
+ if (ob && !ma)
ma= give_current_material(ob, ob->actcol);
/* fill users */
users->first = users->last = NULL;
- if(ma)
+ if (ma)
buttons_texture_users_find_nodetree(users, &ma->id, ma->nodetree, "Material");
- if(la)
+ if (la)
buttons_texture_users_find_nodetree(users, &la->id, la->nodetree, "Lamp");
- if(wrld)
+ if (wrld)
buttons_texture_users_find_nodetree(users, &wrld->id, wrld->nodetree, "World");
- if(ob) {
+ if (ob) {
ParticleSystem *psys= psys_get_current(ob);
MTex *mtex;
int a;
@@ -202,12 +202,12 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext *
modifiers_foreachTexLink(ob, buttons_texture_modifier_foreach, users);
/* particle systems */
- if(psys) {
+ if (psys) {
/* todo: these slots are not in the UI */
- for(a=0; a<MAX_MTEX; a++) {
+ for (a=0; a<MAX_MTEX; a++) {
mtex = psys->part->mtex[a];
- if(mtex) {
+ if (mtex) {
PointerRNA ptr;
PropertyRNA *prop;
@@ -221,7 +221,7 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext *
}
/* field */
- if(ob->pd && ob->pd->forcefield == PFIELD_TEXTURE) {
+ if (ob->pd && ob->pd->forcefield == PFIELD_TEXTURE) {
PointerRNA ptr;
PropertyRNA *prop;
@@ -234,7 +234,7 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext *
}
/* brush */
- if(brush) {
+ if (brush) {
PointerRNA ptr;
PropertyRNA *prop;
@@ -249,12 +249,12 @@ 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);
- if(!scene_use_new_shading_nodes(scene)) {
- if(ct) {
+ if (!scene_use_new_shading_nodes(scene)) {
+ if (ct) {
BLI_freelistN(&ct->users);
MEM_freeN(ct);
sbuts->texuser= NULL;
@@ -263,7 +263,7 @@ void buttons_texture_context_compute(const bContext *C, SpaceButs *sbuts)
return;
}
- if(!ct) {
+ if (!ct) {
ct= MEM_callocN(sizeof(ButsContextTexture), "ButsContextTexture");
sbuts->texuser= ct;
}
@@ -274,14 +274,14 @@ void buttons_texture_context_compute(const bContext *C, SpaceButs *sbuts)
buttons_texture_users_from_context(&ct->users, C, sbuts);
/* set one user as active based on active index */
- if(ct->index >= BLI_countlist(&ct->users))
+ if (ct->index >= BLI_countlist(&ct->users))
ct->index= 0;
ct->user = BLI_findlink(&ct->users, ct->index);
ct->texture = NULL;
- if(ct->user) {
- if(ct->user->ptr.data) {
+ if (ct->user) {
+ if (ct->user->ptr.data) {
PointerRNA texptr;
Tex *tex;
@@ -291,14 +291,14 @@ void buttons_texture_context_compute(const bContext *C, SpaceButs *sbuts)
ct->texture = tex;
}
- else if(ct->user->node && !(ct->user->node->flag & NODE_ACTIVE_TEXTURE)) {
+ else if (ct->user->node && !(ct->user->node->flag & NODE_ACTIVE_TEXTURE)) {
ButsTextureUser *user;
/* detect change of active texture node in same node tree, in that
- 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) {
+ * 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) {
ct->user = user;
ct->index = BLI_findindex(&ct->users, user);
break;
@@ -318,11 +318,11 @@ static void template_texture_select(bContext *C, void *user_p, void *UNUSED(arg)
PointerRNA texptr;
Tex *tex;
- if(!ct)
+ if (!ct)
return;
/* set user as active */
- if(user->node) {
+ if (user->node) {
ED_node_set_active(CTX_data_main(C), user->ntree, user->node);
ct->texture = NULL;
}
@@ -346,12 +346,12 @@ static void template_texture_user_menu(bContext *C, uiLayout *layout, void *UNUS
uiBlock *block = uiLayoutGetBlock(layout);
const char *last_category = NULL;
- for(user=ct->users.first; user; user=user->next) {
+ for (user=ct->users.first; user; user=user->next) {
uiBut *but;
char name[UI_MAX_NAME_STR];
/* add label per category */
- if(!last_category || strcmp(last_category, user->category) != 0) {
+ if (!last_category || strcmp(last_category, user->category) != 0) {
uiItemL(layout, user->category, ICON_NONE);
but= block->buttons.last;
but->flag= UI_TEXT_LEFT;
@@ -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);
@@ -380,13 +380,13 @@ void uiTemplateTextureUser(uiLayout *layout, bContext *C)
ButsTextureUser *user;
char name[UI_MAX_NAME_STR];
- if(!ct)
+ if (!ct)
return;
/* get current user */
user= ct->user;
- if(!user) {
+ if (!user) {
uiItemL(layout, "No textures in context.", ICON_NONE);
return;
}
@@ -394,12 +394,12 @@ void uiTemplateTextureUser(uiLayout *layout, bContext *C)
/* create button */
BLI_snprintf(name, UI_MAX_NAME_STR, "%s", user->name);
- if(user->icon) {
- but= uiDefIconTextMenuBut(block, template_texture_user_menu, NULL,
+ if (user->icon) {
+ but = uiDefIconTextMenuBut(block, template_texture_user_menu, NULL,
user->icon, name, 0, 0, UI_UNIT_X*4, UI_UNIT_Y, "");
}
else {
- but= uiDefMenuBut(block, template_texture_user_menu, NULL,
+ but = uiDefMenuBut(block, template_texture_user_menu, NULL,
name, 0, 0, UI_UNIT_X*4, UI_UNIT_Y, "");
}
@@ -417,14 +417,14 @@ static void template_texture_show(bContext *C, void *data_p, void *prop_p)
ButsContextTexture *ct= (sbuts)? sbuts->texuser: NULL;
ButsTextureUser *user;
- if(!ct)
+ if (!ct)
return;
- for(user=ct->users.first; user; user=user->next)
- if(user->ptr.data == data_p && user->prop == prop_p)
+ for (user=ct->users.first; user; user=user->next)
+ if (user->ptr.data == data_p && user->prop == prop_p)
break;
- if(user) {
+ if (user) {
/* select texture */
template_texture_select(C, user, NULL);
@@ -446,20 +446,20 @@ void uiTemplateTextureShow(uiLayout *layout, bContext *C, PointerRNA *ptr, Prope
ButsTextureUser *user;
/* only show button in other tabs in properties editor */
- if(!ct || sbuts->mainb == BCONTEXT_TEXTURE)
+ if (!ct || sbuts->mainb == BCONTEXT_TEXTURE)
return;
/* find corresponding texture user */
- for(user=ct->users.first; user; user=user->next)
- if(user->ptr.data == ptr->data && user->prop == prop)
+ for (user=ct->users.first; user; user=user->next)
+ if (user->ptr.data == ptr->data && user->prop == prop)
break;
/* draw button */
- if(user) {
+ if (user) {
uiBlock *block = uiLayoutGetBlock(layout);
uiBut *but;
- but= uiDefIconBut(block, BUT, 0, ICON_BUTS, 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ but = uiDefIconBut(block, BUT, 0, ICON_BUTS, 0, 0, UI_UNIT_X, UI_UNIT_Y,
NULL, 0.0, 0.0, 0.0, 0.0, "Show texture in texture tab");
uiButSetFunc(but, template_texture_show, user->ptr.data, user->prop);
}
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index e6928e31dc7..f1f4fb37b6e 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -97,10 +97,10 @@ static void buttons_free(SpaceLink *sl)
{
SpaceButs *sbuts= (SpaceButs*) sl;
- if(sbuts->path)
+ if (sbuts->path)
MEM_freeN(sbuts->path);
- if(sbuts->texuser) {
+ if (sbuts->texuser) {
ButsContextTexture *ct= sbuts->texuser;
BLI_freelistN(&ct->users);
MEM_freeN(ct);
@@ -113,8 +113,8 @@ static void buttons_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa)
SpaceButs *sbuts= sa->spacedata.first;
/* auto-align based on size */
- if(sbuts->align == BUT_AUTO || !sbuts->align) {
- if(sa->winx > sa->winy)
+ if (sbuts->align == BUT_AUTO || !sbuts->align) {
+ if (sa->winx > sa->winy)
sbuts->align= BUT_HORIZONTAL;
else
sbuts->align= BUT_VERTICAL;
@@ -139,7 +139,7 @@ static void buttons_main_area_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap= WM_keymap_find(wm->defaultconf, "Property Editor", SPACE_BUTS, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Property Editor", SPACE_BUTS, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -151,31 +151,31 @@ static void buttons_main_area_draw(const bContext *C, ARegion *ar)
buttons_context_compute(C, sbuts);
- if(sbuts->mainb == BCONTEXT_SCENE)
+ if (sbuts->mainb == BCONTEXT_SCENE)
ED_region_panels(C, ar, vertical, "scene", sbuts->mainb);
- else if(sbuts->mainb == BCONTEXT_RENDER)
+ else if (sbuts->mainb == BCONTEXT_RENDER)
ED_region_panels(C, ar, vertical, "render", sbuts->mainb);
- else if(sbuts->mainb == BCONTEXT_WORLD)
+ else if (sbuts->mainb == BCONTEXT_WORLD)
ED_region_panels(C, ar, vertical, "world", sbuts->mainb);
- else if(sbuts->mainb == BCONTEXT_OBJECT)
+ else if (sbuts->mainb == BCONTEXT_OBJECT)
ED_region_panels(C, ar, vertical, "object", sbuts->mainb);
- else if(sbuts->mainb == BCONTEXT_DATA)
+ else if (sbuts->mainb == BCONTEXT_DATA)
ED_region_panels(C, ar, vertical, "data", sbuts->mainb);
- else if(sbuts->mainb == BCONTEXT_MATERIAL)
+ else if (sbuts->mainb == BCONTEXT_MATERIAL)
ED_region_panels(C, ar, vertical, "material", sbuts->mainb);
- else if(sbuts->mainb == BCONTEXT_TEXTURE)
+ else if (sbuts->mainb == BCONTEXT_TEXTURE)
ED_region_panels(C, ar, vertical, "texture", sbuts->mainb);
- else if(sbuts->mainb == BCONTEXT_PARTICLE)
+ else if (sbuts->mainb == BCONTEXT_PARTICLE)
ED_region_panels(C, ar, vertical, "particle", sbuts->mainb);
- else if(sbuts->mainb == BCONTEXT_PHYSICS)
+ else if (sbuts->mainb == BCONTEXT_PHYSICS)
ED_region_panels(C, ar, vertical, "physics", sbuts->mainb);
- else if(sbuts->mainb == BCONTEXT_BONE)
+ else if (sbuts->mainb == BCONTEXT_BONE)
ED_region_panels(C, ar, vertical, "bone", sbuts->mainb);
- else if(sbuts->mainb == BCONTEXT_MODIFIER)
+ else if (sbuts->mainb == BCONTEXT_MODIFIER)
ED_region_panels(C, ar, vertical, "modifier", sbuts->mainb);
else if (sbuts->mainb == BCONTEXT_CONSTRAINT)
ED_region_panels(C, ar, vertical, "constraint", sbuts->mainb);
- else if(sbuts->mainb == BCONTEXT_BONE_CONSTRAINT)
+ else if (sbuts->mainb == BCONTEXT_BONE_CONSTRAINT)
ED_region_panels(C, ar, vertical, "bone_constraint", sbuts->mainb);
sbuts->re_align= 0;
@@ -191,7 +191,7 @@ static void buttons_operatortypes(void)
static void buttons_keymap(struct wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "Property Editor", SPACE_BUTS, 0);
+ wmKeyMap *keymap = WM_keymap_find(keyconf, "Property Editor", SPACE_BUTS, 0);
WM_keymap_add_item(keymap, "BUTTONS_OT_toolbox", RIGHTMOUSE, KM_PRESS, 0, 0);
}
@@ -224,7 +224,7 @@ static void buttons_area_redraw(ScrArea *sa, short buttons)
SpaceButs *sbuts= sa->spacedata.first;
/* if the area's current button set is equal to the one to redraw */
- if(sbuts->mainb == buttons)
+ if (sbuts->mainb == buttons)
ED_area_tag_redraw(sa);
}
@@ -273,9 +273,10 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
case ND_BONE_SELECT:
buttons_area_redraw(sa, BCONTEXT_BONE);
buttons_area_redraw(sa, BCONTEXT_BONE_CONSTRAINT);
+ buttons_area_redraw(sa, BCONTEXT_DATA);
break;
case ND_MODIFIER:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_area_tag_redraw(sa);
else
buttons_area_redraw(sa, BCONTEXT_MODIFIER);
@@ -341,11 +342,11 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
sbuts->preview= 1;
break;
case NC_SPACE:
- if(wmn->data == ND_SPACE_PROPERTIES)
+ if (wmn->data == ND_SPACE_PROPERTIES)
ED_area_tag_redraw(sa);
break;
case NC_ID:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_area_tag_redraw(sa);
break;
case NC_ANIMATION:
@@ -357,10 +358,10 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
}
break;
case NC_NODE:
- if(wmn->action==NA_SELECTED) {
+ if (wmn->action==NA_SELECTED) {
ED_area_tag_redraw(sa);
/* new active node, update texture preview */
- if(sbuts->mainb == BCONTEXT_TEXTURE)
+ if (sbuts->mainb == BCONTEXT_TEXTURE)
sbuts->preview= 1;
}
break;
@@ -371,7 +372,7 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
break;
}
- if(wmn->data == ND_KEYS)
+ if (wmn->data == ND_KEYS)
ED_area_tag_redraw(sa);
}
diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c
index ddfd403806c..eabd64bdc4f 100644
--- a/source/blender/editors/space_clip/clip_buttons.c
+++ b/source/blender/editors/space_clip/clip_buttons.c
@@ -67,11 +67,11 @@ void ED_clip_buttons_register(ARegionType *art)
{
PanelType *pt;
- pt= MEM_callocN(sizeof(PanelType), "spacetype clip panel gpencil");
+ pt = MEM_callocN(sizeof(PanelType), "spacetype clip panel gpencil");
strcpy(pt->idname, "CLIP_PT_gpencil");
strcpy(pt->label, "Grease Pencil");
- pt->draw= gpencil_panel_standard;
- pt->flag|= PNL_DEFAULT_CLOSED;
+ pt->draw = gpencil_panel_standard;
+ pt->flag |= PNL_DEFAULT_CLOSED;
BLI_addtail(&art->paneltypes, pt);
}
@@ -85,38 +85,38 @@ void uiTemplateMovieClip(uiLayout *layout, bContext *C, PointerRNA *ptr, const c
uiLayout *row, *split;
uiBlock *block;
- if(!ptr->data)
+ if (!ptr->data)
return;
- prop= RNA_struct_find_property(ptr, propname);
- if(!prop) {
+ prop = RNA_struct_find_property(ptr, propname);
+ if (!prop) {
printf("%s: property not found: %s.%s\n",
__func__, RNA_struct_identifier(ptr->type), propname);
return;
}
- if(RNA_property_type(prop) != PROP_POINTER) {
+ if (RNA_property_type(prop) != PROP_POINTER) {
printf("%s: expected pointer property for %s.%s\n",
__func__, RNA_struct_identifier(ptr->type), propname);
return;
}
- clipptr= RNA_property_pointer_get(ptr, prop);
- clip= clipptr.data;
+ clipptr = RNA_property_pointer_get(ptr, prop);
+ clip = clipptr.data;
uiLayoutSetContextPointer(layout, "edit_movieclip", &clipptr);
- if(!compact)
+ if (!compact)
uiTemplateID(layout, C, ptr, propname, NULL, "CLIP_OT_open", NULL);
- if(clip) {
- row= uiLayoutRow(layout, 0);
- block= uiLayoutGetBlock(row);
+ if (clip) {
+ row = uiLayoutRow(layout, 0);
+ block = uiLayoutGetBlock(row);
uiDefBut(block, LABEL, 0, "File Path:", 0, 19, 145, 19, NULL, 0, 0, 0, 0, "");
- row= uiLayoutRow(layout, 0);
+ row = uiLayoutRow(layout, 0);
split = uiLayoutSplit(row, 0.0, 0);
- row= uiLayoutRow(split, 1);
+ row = uiLayoutRow(split, 1);
uiItemR(row, &clipptr, "filepath", 0, "", ICON_NONE);
uiItemO(row, "", ICON_FILE_REFRESH, "clip.reload");
@@ -133,31 +133,31 @@ void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname)
rctf rect;
MovieClipScopes *scopes;
- if(!ptr->data)
+ if (!ptr->data)
return;
- prop= RNA_struct_find_property(ptr, propname);
- if(!prop) {
+ prop = RNA_struct_find_property(ptr, propname);
+ if (!prop) {
printf("%s: property not found: %s.%s\n",
__func__, RNA_struct_identifier(ptr->type), propname);
return;
}
- if(RNA_property_type(prop) != PROP_POINTER) {
+ if (RNA_property_type(prop) != PROP_POINTER) {
printf("%s: expected pointer property for %s.%s\n",
__func__, RNA_struct_identifier(ptr->type), propname);
return;
}
- scopesptr= RNA_property_pointer_get(ptr, prop);
- scopes= (MovieClipScopes *)scopesptr.data;
+ scopesptr = RNA_property_pointer_get(ptr, prop);
+ scopes = (MovieClipScopes *)scopesptr.data;
- rect.xmin= 0; rect.xmax= 200;
- rect.ymin= 0; rect.ymax= 120;
+ rect.xmin = 0; rect.xmax = 200;
+ rect.ymin = 0; rect.ymax = 120;
- block= uiLayoutAbsoluteBlock(layout);
+ block = uiLayoutAbsoluteBlock(layout);
- scopes->track_preview_height= (scopes->track_preview_height<=UI_UNIT_Y)?UI_UNIT_Y:scopes->track_preview_height;
+ scopes->track_preview_height = (scopes->track_preview_height<=UI_UNIT_Y)?UI_UNIT_Y:scopes->track_preview_height;
uiDefBut(block, TRACKPREVIEW, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, scopes->track_preview_height, scopes, 0, 0, 0, 0, "");
}
@@ -189,89 +189,89 @@ typedef struct {
static void to_pixel_space(float r[2], float a[2], int width, int height)
{
copy_v2_v2(r, a);
- r[0]*= width;
- r[1]*= height;
+ r[0] *= width;
+ r[1] *= height;
}
static void marker_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg))
{
- MarkerUpdateCb *cb= (MarkerUpdateCb*) arg_cb;
+ MarkerUpdateCb *cb = (MarkerUpdateCb*) arg_cb;
MovieTrackingMarker *marker;
- if(!cb->compact)
+ if (!cb->compact)
return;
- marker= BKE_tracking_ensure_marker(cb->track, cb->framenr);
+ marker = BKE_tracking_ensure_marker(cb->track, cb->framenr);
- marker->flag= cb->marker_flag;
+ marker->flag = cb->marker_flag;
WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, NULL);
}
static void marker_block_handler(bContext *C, void *arg_cb, int event)
{
- MarkerUpdateCb *cb= (MarkerUpdateCb*) arg_cb;
+ MarkerUpdateCb *cb = (MarkerUpdateCb*) arg_cb;
MovieTrackingMarker *marker;
- int width, height, ok= 0;
+ int width, height, ok = FALSE;
BKE_movieclip_get_size(cb->clip, cb->user, &width, &height);
- marker= BKE_tracking_ensure_marker(cb->track, cb->framenr);
+ marker = BKE_tracking_ensure_marker(cb->track, cb->framenr);
- if(event==B_MARKER_POS) {
- marker->pos[0]= cb->marker_pos[0]/width;
- marker->pos[1]= cb->marker_pos[1]/height;
+ if (event == B_MARKER_POS) {
+ marker->pos[0] = cb->marker_pos[0]/width;
+ marker->pos[1] = cb->marker_pos[1]/height;
/* to update position of "parented" objects */
DAG_id_tag_update(&cb->clip->id, 0);
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- ok= 1;
+ ok = TRUE;
}
- else if(event==B_MARKER_PAT_DIM) {
+ else if (event == B_MARKER_PAT_DIM) {
float dim[2], pat_dim[2];
sub_v2_v2v2(pat_dim, cb->track->pat_max, cb->track->pat_min);
- dim[0]= cb->track_pat[0]/width;
- dim[1]= cb->track_pat[1]/height;
+ dim[0] = cb->track_pat[0] / width;
+ dim[1] = cb->track_pat[1] / height;
sub_v2_v2(dim, pat_dim);
mul_v2_fl(dim, 0.5f);
- cb->track->pat_min[0]-= dim[0];
- cb->track->pat_min[1]-= dim[1];
+ cb->track->pat_min[0] -= dim[0];
+ cb->track->pat_min[1] -= dim[1];
- cb->track->pat_max[0]+= dim[0];
- cb->track->pat_max[1]+= dim[1];
+ cb->track->pat_max[0] += dim[0];
+ cb->track->pat_max[1] += dim[1];
BKE_tracking_clamp_track(cb->track, CLAMP_PAT_DIM);
- ok= 1;
+ ok = TRUE;
}
- else if(event==B_MARKER_SEARCH_POS) {
+ else if (event == B_MARKER_SEARCH_POS) {
float delta[2], side[2];
sub_v2_v2v2(side, cb->track->search_max, cb->track->search_min);
mul_v2_fl(side, 0.5f);
- delta[0]= cb->track_search_pos[0]/width;
- delta[1]= cb->track_search_pos[1]/height;
+ delta[0] = cb->track_search_pos[0] / width;
+ delta[1] = cb->track_search_pos[1] / height;
sub_v2_v2v2(cb->track->search_min, delta, side);
add_v2_v2v2(cb->track->search_max, delta, side);
BKE_tracking_clamp_track(cb->track, CLAMP_SEARCH_POS);
- ok= 1;
+ ok = TRUE;
}
- else if(event==B_MARKER_SEARCH_DIM) {
+ else if (event == B_MARKER_SEARCH_DIM) {
float dim[2], search_dim[2];
sub_v2_v2v2(search_dim, cb->track->search_max, cb->track->search_min);
- dim[0]= cb->track_search[0]/width;
- dim[1]= cb->track_search[1]/height;
+ dim[0] = cb->track_search[0]/width;
+ dim[1] = cb->track_search[1]/height;
sub_v2_v2(dim, search_dim);
mul_v2_fl(dim, 0.5f);
@@ -284,32 +284,34 @@ static void marker_block_handler(bContext *C, void *arg_cb, int event)
BKE_tracking_clamp_track(cb->track, CLAMP_SEARCH_DIM);
- ok= 1;
- } else if(event==B_MARKER_FLAG) {
- marker->flag= cb->marker_flag;
+ ok = TRUE;
+ }
+ else if (event == B_MARKER_FLAG) {
+ marker->flag = cb->marker_flag;
- ok= 1;
- } else if(event==B_MARKER_OFFSET) {
+ ok = TRUE;
+ }
+ else if (event == B_MARKER_OFFSET) {
float offset[2], delta[2];
int i;
- offset[0]= cb->track_offset[0]/width;
- offset[1]= cb->track_offset[1]/height;
+ offset[0] = cb->track_offset[0] / width;
+ offset[1] = cb->track_offset[1] / height;
sub_v2_v2v2(delta, offset, cb->track->offset);
copy_v2_v2(cb->track->offset, offset);
- for(i=0; i<cb->track->markersnr; i++)
+ for (i = 0; i < cb->track->markersnr; i++)
sub_v2_v2(cb->track->markers[i].pos, delta);
/* to update position of "parented" objects */
DAG_id_tag_update(&cb->clip->id, 0);
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- ok= 1;
+ ok = TRUE;
}
- if(ok)
+ if (ok)
WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, cb->clip);
}
@@ -326,64 +328,65 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
MarkerUpdateCb *cb;
const char *tip;
- if(!ptr->data)
+ if (!ptr->data)
return;
- prop= RNA_struct_find_property(ptr, propname);
- if(!prop) {
+ prop = RNA_struct_find_property(ptr, propname);
+ if (!prop) {
printf("%s: property not found: %s.%s\n",
__func__, RNA_struct_identifier(ptr->type), propname);
return;
}
- if(RNA_property_type(prop) != PROP_POINTER) {
+ if (RNA_property_type(prop) != PROP_POINTER) {
printf("%s: expected pointer property for %s.%s\n",
__func__, RNA_struct_identifier(ptr->type), propname);
return;
}
- clipptr= RNA_property_pointer_get(ptr, prop);
- clip= (MovieClip *)clipptr.data;
- user= userptr->data;
- track= trackptr->data;
+ clipptr = RNA_property_pointer_get(ptr, prop);
+ clip = (MovieClip *)clipptr.data;
+ user = userptr->data;
+ track = trackptr->data;
- marker= BKE_tracking_get_marker(track, user->framenr);
+ marker = BKE_tracking_get_marker(track, user->framenr);
- cb= MEM_callocN(sizeof(MarkerUpdateCb), "uiTemplateMarker update_cb");
- cb->compact= compact;
- cb->clip= clip;
- cb->user= user;
- cb->track= track;
- cb->marker_flag= marker->flag;
- cb->framenr= user->framenr;
+ cb = MEM_callocN(sizeof(MarkerUpdateCb), "uiTemplateMarker update_cb");
+ cb->compact = compact;
+ cb->clip = clip;
+ cb->user = user;
+ cb->track = track;
+ cb->marker_flag = marker->flag;
+ cb->framenr = user->framenr;
- if(compact) {
- block= uiLayoutGetBlock(layout);
+ if (compact) {
+ block = uiLayoutGetBlock(layout);
- if(cb->marker_flag&MARKER_DISABLED)
+ if (cb->marker_flag & MARKER_DISABLED)
tip= "Marker is disabled at current frame";
else
tip= "Marker is enabled at current frame";
- bt= uiDefIconButBitI(block, TOGN, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, 20, 20, &cb->marker_flag, 0, 0, 1, 0, tip);
+ bt = uiDefIconButBitI(block, TOGN, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, 20, 20, &cb->marker_flag, 0, 0, 1, 0, tip);
uiButSetNFunc(bt, marker_update_cb, cb, NULL);
- } else {
+ }
+ else {
int width, height, step, digits;
float pat_dim[2], pat_pos[2], search_dim[2], search_pos[2];
uiLayout *col;
BKE_movieclip_get_size(clip, user, &width, &height);
- if(track->flag&TRACK_LOCKED) {
+ if (track->flag & TRACK_LOCKED) {
uiLayoutSetActive(layout, 0);
- block= uiLayoutAbsoluteBlock(layout);
+ block = uiLayoutAbsoluteBlock(layout);
uiDefBut(block, LABEL, 0, "Track is locked", 0, 0, 300, 19, NULL, 0, 0, 0, 0, "");
return;
}
step= 100;
- digits= 2;
+ digits = 2;
sub_v2_v2v2(pat_dim, track->pat_max, track->pat_min);
sub_v2_v2v2(search_dim, track->search_max, track->search_min);
@@ -400,13 +403,13 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
to_pixel_space(cb->track_search_pos, search_pos, width, height);
to_pixel_space(cb->track_offset, track->offset, width, height);
- cb->marker_flag= marker->flag;
+ cb->marker_flag = marker->flag;
block= uiLayoutAbsoluteBlock(layout);
uiBlockSetHandleFunc(block, marker_block_handler, cb);
uiBlockSetNFunc(block, marker_update_cb, cb, NULL);
- if(cb->marker_flag&MARKER_DISABLED)
+ if (cb->marker_flag & MARKER_DISABLED)
tip= "Marker is disabled at current frame";
else
tip= "Marker is enabled at current frame";
@@ -414,10 +417,10 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG, "Enabled", 10, 190, 145, 19, &cb->marker_flag,
0, 0, 0, 0, tip);
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
uiLayoutSetActive(col, (cb->marker_flag&MARKER_DISABLED)==0);
- block= uiLayoutAbsoluteBlock(col);
+ block = uiLayoutAbsoluteBlock(col);
uiBlockBeginAlign(block);
uiDefBut(block, LABEL, 0, "Position:", 0, 190, 300, 19, NULL, 0, 0, 0, 0, "");
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c
index 42c127df016..019b23c231b 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -73,8 +73,8 @@
void clip_draw_curfra_label(SpaceClip *sc, float x, float y)
{
- uiStyle *style= UI_GetStyle();
- int fontid= style->widget.uifont_id;
+ uiStyle *style = UI_GetStyle();
+ int fontid = style->widget.uifont_id;
char numstr[32];
float font_dims[2] = {0.0f, 0.0f};
@@ -95,9 +95,9 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc
{
float x;
int *points, totseg, i, a;
- float sfra= SFRA, efra= EFRA, framelen= ar->winx/(efra-sfra+1);
- MovieTrackingTrack *act_track= BKE_tracking_active_track(&clip->tracking);
- MovieTrackingReconstruction *reconstruction= BKE_tracking_get_reconstruction(&clip->tracking);
+ float sfra = SFRA, efra = EFRA, framelen = ar->winx / (efra - sfra + 1);
+ MovieTrackingTrack *act_track = BKE_tracking_active_track(&clip->tracking);
+ MovieTrackingReconstruction *reconstruction = BKE_tracking_get_reconstruction(&clip->tracking);
glEnable(GL_BLEND);
@@ -107,83 +107,88 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc
/* cached segments -- could be usefu lto debug caching strategies */
BKE_movieclip_get_cache_segments(clip, &sc->user, &totseg, &points);
- if(totseg) {
+ if (totseg) {
glColor4ub(128, 128, 255, 128);
- for(a= 0; a<totseg; a++) {
+ for (a = 0; a < totseg; a++) {
float x1, x2;
- x1= (points[a*2]-sfra)/(efra-sfra+1)*ar->winx;
- x2= (points[a*2+1]-sfra+1)/(efra-sfra+1)*ar->winx;
+ x1 = (points[a * 2] - sfra) / (efra - sfra + 1) * ar->winx;
+ x2 = (points[a * 2 + 1] - sfra + 1) / (efra - sfra + 1) * ar->winx;
glRecti(x1, 0, x2, 8);
}
}
/* track */
- if(act_track) {
- MovieTrackingTrack *track= act_track;
+ if (act_track) {
+ MovieTrackingTrack *track = act_track;
- for(i= sfra, a= 0; i <= efra; i++) {
+ for (i = sfra, a = 0; i <= efra; i++) {
int framenr;
MovieTrackingMarker *marker;
- while(a<track->markersnr) {
- if(track->markers[a].framenr>=i)
+ while (a<track->markersnr) {
+ if (track->markers[a].framenr >= i)
break;
- if(a<track->markersnr-1 && track->markers[a+1].framenr>i)
+ if (a < track->markersnr - 1 && track->markers[a + 1].framenr > i)
break;
a++;
}
- if(a<track->markersnr) marker= &track->markers[a];
- else marker= &track->markers[track->markersnr-1];
+ if (a < track->markersnr)
+ marker = &track->markers[a];
+ else
+ marker = &track->markers[track->markersnr - 1];
- if((marker->flag&MARKER_DISABLED)==0) {
- framenr= marker->framenr;
+ if ((marker->flag & MARKER_DISABLED) == 0) {
+ framenr = marker->framenr;
- if(framenr!=i) glColor4ub(128, 128, 0, 96);
- else if((marker->flag&MARKER_TRACKED)==0) glColor4ub(255, 255, 0, 196);
- else glColor4ub(255, 255, 0, 96);
+ if (framenr != i)
+ glColor4ub(128, 128, 0, 96);
+ else if ((marker->flag & MARKER_TRACKED) == 0)
+ glColor4ub(255, 255, 0, 196);
+ else
+ glColor4ub(255, 255, 0, 96);
- glRecti((i-sfra)*framelen, 0, (i-sfra+1)*framelen, 4);
+ glRecti((i - sfra) * framelen, 0, (i - sfra + 1)*framelen, 4);
}
}
}
/* failed frames */
- if(reconstruction->flag&TRACKING_RECONSTRUCTED) {
- int n= reconstruction->camnr;
- MovieReconstructedCamera *cameras= reconstruction->cameras;
+ if (reconstruction->flag & TRACKING_RECONSTRUCTED) {
+ int n = reconstruction->camnr;
+ MovieReconstructedCamera *cameras = reconstruction->cameras;
glColor4ub(255, 0, 0, 96);
- for(i= sfra, a= 0; i <= efra; i++) {
- int ok= 0;
+ for (i = sfra, a = 0; i <= efra; i++) {
+ int ok = FALSE;
- while(a<n) {
- if(cameras[a].framenr==i) {
- ok= 1;
+ while (a < n) {
+ if (cameras[a].framenr == i) {
+ ok = TRUE;
break;
}
- else if(cameras[a].framenr>i) {
+ else if (cameras[a].framenr > i) {
break;
}
a++;
}
- if(!ok)
- glRecti((i-sfra)*framelen, 0, (i-sfra+1)*framelen, 8);
+ if (!ok)
+ glRecti((i - sfra) * framelen, 0, (i - sfra + 1) * framelen, 8);
}
}
glDisable(GL_BLEND);
/* current frame */
- x= (sc->user.framenr-sfra)/(efra-sfra+1)*ar->winx;
+ x = (sc->user.framenr - sfra) / (efra - sfra + 1) * ar->winx;
UI_ThemeColor(TH_CFRAME);
glRecti(x, 0, x+framelen, 8);
@@ -193,28 +198,29 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc
static void draw_movieclip_notes(SpaceClip *sc, ARegion *ar)
{
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- char str[256]= {0};
- int block= 0;
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ char str[256] = {0};
+ int block = FALSE;
- if(tracking->stats) {
+ if (tracking->stats) {
BLI_strncpy(str, tracking->stats->message, sizeof(str));
- block= 1;
- } else {
- if(sc->flag&SC_LOCK_SELECTION)
+ block = TRUE;
+ }
+ else {
+ if (sc->flag & SC_LOCK_SELECTION)
strcpy(str, "Locked");
}
- if(str[0])
+ if (str[0])
ED_region_info_draw(ar, str, block, 0.6f);
}
static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf,
- int width, int height, float zoomx, float zoomy)
+ int width, int height, float zoomx, float zoomy)
{
int x, y;
- MovieClip *clip= ED_space_clip(sc);
+ MovieClip *clip = ED_space_clip(sc);
/* set zoom */
glPixelZoom(zoomx*width/ibuf->x, zoomy*height/ibuf->y);
@@ -222,20 +228,21 @@ static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf,
/* find window pixel coordinates of origin */
UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &x, &y);
- if(sc->flag&SC_MUTE_FOOTAGE) {
+ if (sc->flag & SC_MUTE_FOOTAGE) {
glColor3f(0.0f, 0.0f, 0.0f);
- glRectf(x, y, x+zoomx*width, y+zoomy*height);
- } else {
- if(ibuf->rect_float && !ibuf->rect) {
+ glRectf(x, y, x + zoomx * width, y + zoomy * height);
+ }
+ else {
+ if (ibuf->rect_float && !ibuf->rect) {
IMB_rect_from_float(ibuf);
}
- if(ibuf->rect)
+ if (ibuf->rect)
glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
}
/* draw boundary border for frame if stabilization is enabled */
- if(sc->flag&SC_SHOW_STABLE && clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) {
+ if (sc->flag & SC_SHOW_STABLE && clip->tracking.stabilization.flag & TRACKING_2D_STABILIZATION) {
glColor3f(0.0f, 0.0f, 0.0f);
glLineStipple(3, 0xaaaa);
glEnable(GL_LINE_STIPPLE);
@@ -268,69 +275,72 @@ static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf,
static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackingTrack *track)
{
- int count= sc->path_length;
- int i, a, b, curindex= -1;
+ int count = sc->path_length;
+ int i, a, b, curindex = -1;
float path[102][2];
- int tiny= sc->flag&SC_SHOW_TINY_MARKER, framenr;
+ int tiny = sc->flag&SC_SHOW_TINY_MARKER, framenr;
MovieTrackingMarker *marker;
- if(count==0)
+ if (count == 0)
return;
- marker= BKE_tracking_get_marker(track, sc->user.framenr);
- if(marker->framenr!=sc->user.framenr || marker->flag&MARKER_DISABLED)
+ marker = BKE_tracking_get_marker(track, sc->user.framenr);
+ if (marker->framenr != sc->user.framenr || marker->flag & MARKER_DISABLED)
return;
- framenr= marker->framenr;
+ framenr = marker->framenr;
- a= count;
- i= framenr-1;
- while(i>=framenr-count) {
- marker= BKE_tracking_get_marker(track, i);
+ a = count;
+ i = framenr - 1;
+ while (i >= framenr - count) {
+ marker = BKE_tracking_get_marker(track, i);
- if(!marker || marker->flag&MARKER_DISABLED)
+ if (!marker || marker->flag & MARKER_DISABLED)
break;
- if(marker->framenr==i) {
+ if (marker->framenr == i) {
add_v2_v2v2(path[--a], marker->pos, track->offset);
ED_clip_point_undistorted_pos(sc, path[a], path[a]);
- if(marker->framenr==sc->user.framenr)
- curindex= a;
- } else
+ if (marker->framenr == sc->user.framenr)
+ curindex = a;
+ }
+ else {
break;
+ }
i--;
}
- b= count;
- i= framenr;
- while(i<=framenr+count) {
- marker= BKE_tracking_get_marker(track, i);
+ b = count;
+ i = framenr;
+ while (i <= framenr+count) {
+ marker = BKE_tracking_get_marker(track, i);
- if(!marker || marker->flag&MARKER_DISABLED)
+ if (!marker || marker->flag & MARKER_DISABLED)
break;
- if(marker->framenr==i) {
- if(marker->framenr==sc->user.framenr)
+ if (marker->framenr == i) {
+ if (marker->framenr == sc->user.framenr)
curindex= b;
add_v2_v2v2(path[b++], marker->pos, track->offset);
ED_clip_point_undistorted_pos(sc, path[b-1], path[b-1]);
- } else
+ }
+ else
break;
i++;
}
- if(!tiny) {
+ if (!tiny) {
UI_ThemeColor(TH_MARKER_OUTLINE);
- if(TRACK_VIEW_SELECTED(sc, track)) {
+ if (TRACK_VIEW_SELECTED(sc, track)) {
glPointSize(5.0f);
glBegin(GL_POINTS);
- for(i= a; i<b; i++) {
- if(i!=curindex)
+ for (i = a; i < b; i++) {
+ if (i != curindex)
glVertex2f(path[i][0], path[i][1]);
}
glEnd();
@@ -338,7 +348,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
glLineWidth(3.0f);
glBegin(GL_LINE_STRIP);
- for(i= a; i<b; i++)
+ for (i = a; i < b; i++)
glVertex2f(path[i][0], path[i][1]);
glEnd();
glLineWidth(1.0f);
@@ -346,14 +356,14 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
UI_ThemeColor(TH_PATH_BEFORE);
- if(TRACK_VIEW_SELECTED(sc, track)) {
+ if (TRACK_VIEW_SELECTED(sc, track)) {
glPointSize(3.0f);
glBegin(GL_POINTS);
- for(i= a; i<b; i++) {
- if(i==count+1)
+ for (i = a; i < b; i++) {
+ if (i == count + 1)
UI_ThemeColor(TH_PATH_AFTER);
- if(i!=curindex)
+ if (i != curindex)
glVertex2f(path[i][0], path[i][1]);
}
glEnd();
@@ -362,8 +372,8 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
UI_ThemeColor(TH_PATH_BEFORE);
glBegin(GL_LINE_STRIP);
- for(i= a; i<b; i++) {
- if(i==count+1)
+ for (i = a; i < b; i++) {
+ if (i == count + 1)
UI_ThemeColor(TH_PATH_AFTER);
glVertex2f(path[i][0], path[i][1]);
@@ -374,16 +384,16 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker, float marker_pos[2], int width, int height)
{
- int tiny= sc->flag&SC_SHOW_TINY_MARKER;
- int show_search= 0;
+ int tiny = sc->flag&SC_SHOW_TINY_MARKER;
+ int show_search = FALSE;
float px[2];
UI_ThemeColor(TH_MARKER_OUTLINE);
- px[0]= 1.0f/width/sc->zoom;
- px[1]= 1.0f/height/sc->zoom;
+ px[0] = 1.0f / width / sc->zoom;
+ px[1] = 1.0f / height / sc->zoom;
- if((marker->flag&MARKER_DISABLED)==0) {
+ if ((marker->flag & MARKER_DISABLED) == 0) {
float pos[2];
rctf r;
@@ -392,15 +402,16 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT
ED_clip_point_undistorted_pos(sc, pos, pos);
- if(BLI_in_rctf(&r, pos[0]-marker_pos[0], pos[1]-marker_pos[1])) {
- if(tiny) glPointSize(3.0f);
+ if (BLI_in_rctf(&r, pos[0]-marker_pos[0], pos[1]-marker_pos[1])) {
+ if (tiny) glPointSize(3.0f);
else glPointSize(4.0f);
glBegin(GL_POINTS);
glVertex2f(pos[0], pos[1]);
glEnd();
glPointSize(1.0f);
- } else {
- if(!tiny) glLineWidth(3.0f);
+ }
+ else {
+ if (!tiny) glLineWidth(3.0f);
glBegin(GL_LINES);
glVertex2f(pos[0] + px[0]*2, pos[1]);
glVertex2f(pos[0] + px[0]*8, pos[1]);
@@ -414,7 +425,7 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT
glVertex2f(pos[0], pos[1] + px[1]*2);
glVertex2f(pos[0], pos[1] + px[1]*8);
glEnd();
- if(!tiny) glLineWidth(1.0f);
+ if (!tiny) glLineWidth(1.0f);
}
}
@@ -422,9 +433,10 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT
glPushMatrix();
glTranslatef(marker_pos[0], marker_pos[1], 0);
- if(!tiny) glLineWidth(3.0f);
+ if (!tiny)
+ glLineWidth(3.0f);
- if(sc->flag&SC_SHOW_MARKER_PATTERN) {
+ if (sc->flag & SC_SHOW_MARKER_PATTERN) {
glBegin(GL_LINE_LOOP);
glVertex2f(track->pat_min[0], track->pat_min[1]);
glVertex2f(track->pat_max[0], track->pat_min[1]);
@@ -433,8 +445,9 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT
glEnd();
}
- show_search= TRACK_VIEW_SELECTED(sc, track) && ((marker->flag&MARKER_DISABLED)==0 || (sc->flag&SC_SHOW_MARKER_PATTERN)==0);
- if(sc->flag&SC_SHOW_MARKER_SEARCH && show_search) {
+ show_search = TRACK_VIEW_SELECTED(sc, track) &&
+ ((marker->flag & MARKER_DISABLED) == 0 || (sc->flag & SC_SHOW_MARKER_PATTERN) == 0);
+ if (sc->flag & SC_SHOW_MARKER_SEARCH && show_search) {
glBegin(GL_LINE_LOOP);
glVertex2f(track->search_min[0], track->search_min[1]);
glVertex2f(track->search_max[0], track->search_min[1]);
@@ -444,21 +457,27 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT
}
glPopMatrix();
- if(!tiny) glLineWidth(1.0f);
+ if (!tiny)
+ glLineWidth(1.0f);
}
static void track_colors(MovieTrackingTrack *track, int act, float col[3], float scol[3])
{
- if(track->flag&TRACK_CUSTOMCOLOR) {
- if(act) UI_GetThemeColor3fv(TH_ACT_MARKER, scol);
- else copy_v3_v3(scol, track->color);
+ if (track->flag & TRACK_CUSTOMCOLOR) {
+ if (act)
+ UI_GetThemeColor3fv(TH_ACT_MARKER, scol);
+ else
+ copy_v3_v3(scol, track->color);
mul_v3_v3fl(col, track->color, 0.5f);
- } else {
+ }
+ else {
UI_GetThemeColor3fv(TH_MARKER, col);
- if(act) UI_GetThemeColor3fv(TH_ACT_MARKER, scol);
- else UI_GetThemeColor3fv(TH_SEL_MARKER, scol);
+ if (act)
+ UI_GetThemeColor3fv(TH_ACT_MARKER, scol);
+ else
+ UI_GetThemeColor3fv(TH_SEL_MARKER, scol);
}
}
@@ -470,34 +489,45 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
track_colors(track, act, col, scol);
- px[0]= 1.0f/width/sc->zoom;
- px[1]= 1.0f/height/sc->zoom;
+ px[0]= 1.0f / width / sc->zoom;
+ px[1]= 1.0f / height / sc->zoom;
/* marker position and offset position */
- if((track->flag&SELECT)==sel && (marker->flag&MARKER_DISABLED)==0) {
+ if ((track->flag&SELECT) == sel && (marker->flag & MARKER_DISABLED) == 0) {
float pos[2];
rctf r;
- if(track->flag&TRACK_LOCKED) {
- if(act) UI_ThemeColor(TH_ACT_MARKER);
- else if(track->flag&SELECT) UI_ThemeColorShade(TH_LOCK_MARKER, 64);
- else UI_ThemeColor(TH_LOCK_MARKER);
- } else {
- if(track->flag&SELECT) glColor3fv(scol);
- else glColor3fv(col);
+ if (track->flag & TRACK_LOCKED) {
+ if (act)
+ UI_ThemeColor(TH_ACT_MARKER);
+ else if (track->flag & SELECT)
+ UI_ThemeColorShade(TH_LOCK_MARKER, 64);
+ else
+ UI_ThemeColor(TH_LOCK_MARKER);
+ }
+ else {
+ if (track->flag & SELECT)
+ glColor3fv(scol);
+ else
+ glColor3fv(col);
}
BLI_init_rctf(&r, track->pat_min[0], track->pat_max[0], track->pat_min[1], track->pat_max[1]);
add_v2_v2v2(pos, marker->pos, track->offset);
ED_clip_point_undistorted_pos(sc, pos, pos);
- if(BLI_in_rctf(&r, pos[0]-marker_pos[0], pos[1]-marker_pos[1])) {
- if(!tiny) glPointSize(2.0f);
+ if (BLI_in_rctf(&r, pos[0]-marker_pos[0], pos[1]-marker_pos[1])) {
+ if (!tiny)
+ glPointSize(2.0f);
+
glBegin(GL_POINTS);
glVertex2f(pos[0], pos[1]);
glEnd();
- if(!tiny) glPointSize(1.0f);
- } else {
+
+ if (!tiny)
+ glPointSize(1.0f);
+ }
+ else {
glBegin(GL_LINES);
glVertex2f(pos[0] + px[0]*3, pos[1]);
glVertex2f(pos[0] + px[0]*7, pos[1]);
@@ -532,23 +562,29 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
glPushMatrix();
glTranslatef(marker_pos[0], marker_pos[1], 0);
- if(tiny) {
+ if (tiny) {
glLineStipple(3, 0xaaaa);
glEnable(GL_LINE_STIPPLE);
}
- if((track->pat_flag&SELECT)==sel && (sc->flag&SC_SHOW_MARKER_PATTERN)) {
- if(track->flag&TRACK_LOCKED) {
- if(act) UI_ThemeColor(TH_ACT_MARKER);
- else if(track->pat_flag&SELECT) UI_ThemeColorShade(TH_LOCK_MARKER, 64);
+ if ((track->pat_flag & SELECT) == sel && (sc->flag & SC_SHOW_MARKER_PATTERN)) {
+ if (track->flag & TRACK_LOCKED) {
+ if (act)
+ UI_ThemeColor(TH_ACT_MARKER);
+ else if (track->pat_flag & SELECT)
+ UI_ThemeColorShade(TH_LOCK_MARKER, 64);
else UI_ThemeColor(TH_LOCK_MARKER);
}
- else if(marker->flag&MARKER_DISABLED) {
- if(act) UI_ThemeColor(TH_ACT_MARKER);
- else if(track->pat_flag&SELECT) UI_ThemeColorShade(TH_DIS_MARKER, 128);
+ else if (marker->flag & MARKER_DISABLED) {
+ if (act)
+ UI_ThemeColor(TH_ACT_MARKER);
+ else if (track->pat_flag & SELECT)
+ UI_ThemeColorShade(TH_DIS_MARKER, 128);
else UI_ThemeColor(TH_DIS_MARKER);
- } else {
- if(track->pat_flag&SELECT) glColor3fv(scol);
+ }
+ else {
+ if (track->pat_flag & SELECT)
+ glColor3fv(scol);
else glColor3fv(col);
}
@@ -561,20 +597,28 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
}
/* search */
- show_search= TRACK_VIEW_SELECTED(sc, track) && ((marker->flag&MARKER_DISABLED)==0 || (sc->flag&SC_SHOW_MARKER_PATTERN)==0);
- if((track->search_flag&SELECT)==sel && (sc->flag&SC_SHOW_MARKER_SEARCH) && show_search) {
- if(track->flag&TRACK_LOCKED) {
- if(act) UI_ThemeColor(TH_ACT_MARKER);
- else if(track->search_flag&SELECT) UI_ThemeColorShade(TH_LOCK_MARKER, 64);
+ show_search = TRACK_VIEW_SELECTED(sc, track) &&
+ ((marker->flag & MARKER_DISABLED) == 0 || (sc->flag & SC_SHOW_MARKER_PATTERN) == 0);
+ if ((track->search_flag & SELECT) == sel && (sc->flag & SC_SHOW_MARKER_SEARCH) && show_search) {
+ if (track->flag & TRACK_LOCKED) {
+ if (act)
+ UI_ThemeColor(TH_ACT_MARKER);
+ else if (track->search_flag & SELECT)
+ UI_ThemeColorShade(TH_LOCK_MARKER, 64);
else UI_ThemeColor(TH_LOCK_MARKER);
}
- else if(marker->flag&MARKER_DISABLED) {
- if(act) UI_ThemeColor(TH_ACT_MARKER);
- else if(track->search_flag&SELECT) UI_ThemeColorShade(TH_DIS_MARKER, 128);
+ else if (marker->flag & MARKER_DISABLED) {
+ if (act)
+ UI_ThemeColor(TH_ACT_MARKER);
+ else if (track->search_flag & SELECT)
+ UI_ThemeColorShade(TH_DIS_MARKER, 128);
else UI_ThemeColor(TH_DIS_MARKER);
- } else {
- if(track->search_flag&SELECT) glColor3fv(scol);
- else glColor3fv(col);
+ }
+ else {
+ if (track->search_flag & SELECT)
+ glColor3fv(scol);
+ else
+ glColor3fv(col);
}
glBegin(GL_LINE_LOOP);
@@ -586,19 +630,29 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
}
/* pyramid */
- if(sel && TRACK_VIEW_SELECTED(sc, track) && (track->tracker==TRACKER_KLT) && (marker->flag&MARKER_DISABLED)==0) {
- if(track->flag&TRACK_LOCKED) {
- if(act) UI_ThemeColor(TH_ACT_MARKER);
- else if(track->pat_flag&SELECT) UI_ThemeColorShade(TH_LOCK_MARKER, 64);
+ if (sel && TRACK_VIEW_SELECTED(sc, track) &&
+ (track->tracker == TRACKER_KLT) &&
+ (marker->flag & MARKER_DISABLED) == 0)
+ {
+ if (track->flag & TRACK_LOCKED) {
+ if (act)
+ UI_ThemeColor(TH_ACT_MARKER);
+ else if (track->pat_flag & SELECT)
+ UI_ThemeColorShade(TH_LOCK_MARKER, 64);
else UI_ThemeColor(TH_LOCK_MARKER);
}
- else if(marker->flag&MARKER_DISABLED) {
- if(act) UI_ThemeColor(TH_ACT_MARKER);
- else if(track->pat_flag&SELECT) UI_ThemeColorShade(TH_DIS_MARKER, 128);
+ else if (marker->flag & MARKER_DISABLED) {
+ if (act)
+ UI_ThemeColor(TH_ACT_MARKER);
+ else if (track->pat_flag & SELECT)
+ UI_ThemeColorShade(TH_DIS_MARKER, 128);
else UI_ThemeColor(TH_DIS_MARKER);
- } else {
- if(track->pat_flag&SELECT) glColor3fv(scol);
- else glColor3fv(col);
+ }
+ else {
+ if (track->pat_flag & SELECT)
+ glColor3fv(scol);
+ else
+ glColor3fv(col);
}
{
@@ -620,28 +674,28 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
}
}
- if(tiny)
+ if (tiny)
glDisable(GL_LINE_STIPPLE);
glPopMatrix();
}
static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker,
- float marker_pos[2], int outline, int sel, int act, int width, int height)
+ float marker_pos[2], int outline, int sel, int act, int width, int height)
{
float x, y, dx, dy, patdx, patdy, searchdx, searchdy, tdx, tdy;
- int tiny= sc->flag&SC_SHOW_TINY_MARKER;
+ int tiny = sc->flag&SC_SHOW_TINY_MARKER;
float col[3], scol[3], px[2];
- if((tiny && outline) || (marker->flag&MARKER_DISABLED))
+ if ((tiny && outline) || (marker->flag & MARKER_DISABLED))
return;
- if(!TRACK_VIEW_SELECTED(sc, track) || track->flag&TRACK_LOCKED)
+ if (!TRACK_VIEW_SELECTED(sc, track) || track->flag & TRACK_LOCKED)
return;
track_colors(track, act, col, scol);
- if(outline) {
+ if (outline) {
glLineWidth(3.0f);
UI_ThemeColor(TH_MARKER_OUTLINE);
}
@@ -649,34 +703,36 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo
glPushMatrix();
glTranslatef(marker_pos[0], marker_pos[1], 0);
- dx= 6.0f/width/sc->zoom;
- dy= 6.0f/height/sc->zoom;
+ dx = 6.0f / width / sc->zoom;
+ dy = 6.0f / height / sc->zoom;
- patdx= MIN2(dx*2.0f/3.0f, (track->pat_max[0]-track->pat_min[0])/6.0f);
- patdy= MIN2(dy*2.0f/3.0f, (track->pat_max[1]-track->pat_min[1])/6.0f);
+ patdx = MIN2(dx * 2.0f / 3.0f, (track->pat_max[0] - track->pat_min[0]) / 6.0f);
+ patdy = MIN2(dy * 2.0f / 3.0f, (track->pat_max[1] - track->pat_min[1]) / 6.0f);
- searchdx= MIN2(dx, (track->search_max[0]-track->search_min[0])/6.0f);
- searchdy= MIN2(dy, (track->search_max[1]-track->search_min[1])/6.0f);
+ searchdx = MIN2(dx, (track->search_max[0] - track->search_min[0]) / 6.0f);
+ searchdy = MIN2(dy, (track->search_max[1] - track->search_min[1]) / 6.0f);
- px[0]= 1.0f/sc->zoom/width/sc->scale;
- px[1]= 1.0f/sc->zoom/height/sc->scale;
+ px[0] = 1.0f / sc->zoom / width / sc->scale;
+ px[1] = 1.0f / sc->zoom / height / sc->scale;
- if((sc->flag&SC_SHOW_MARKER_SEARCH) && ((track->search_flag&SELECT)==sel || outline)) {
- if(!outline) {
- if(track->search_flag&SELECT) glColor3fv(scol);
- else glColor3fv(col);
+ if ((sc->flag & SC_SHOW_MARKER_SEARCH) && ((track->search_flag & SELECT) == sel || outline)) {
+ if (!outline) {
+ if (track->search_flag & SELECT)
+ glColor3fv(scol);
+ else
+ glColor3fv(col);
}
/* search offset square */
- x= track->search_min[0];
- y= track->search_max[1];
+ x = track->search_min[0];
+ y = track->search_max[1];
- tdx= searchdx;
- tdy= searchdy;
+ tdx = searchdx;
+ tdy = searchdy;
- if(outline) {
- tdx+= px[0];
- tdy+= px[1];
+ if (outline) {
+ tdx += px[0];
+ tdy += px[1];
}
glBegin(GL_QUADS);
@@ -686,16 +742,16 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo
glVertex3f(x-tdx, y-tdy, 0);
glEnd();
- /* search resizing triangle */
- x= track->search_max[0];
- y= track->search_min[1];
+ /* search re-sizing triangle */
+ x = track->search_max[0];
+ y = track->search_min[1];
- tdx= searchdx*2.0f;
- tdy= searchdy*2.0f;
+ tdx = searchdx*2.0f;
+ tdy = searchdy*2.0f;
- if(outline) {
- tdx+= px[0];
- tdy+= px[1];
+ if (outline) {
+ tdx += px[0];
+ tdy += px[1];
}
glBegin(GL_TRIANGLES);
@@ -705,22 +761,24 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo
glEnd();
}
- if((sc->flag&SC_SHOW_MARKER_PATTERN) && ((track->pat_flag&SELECT)==sel || outline)) {
- if(!outline) {
- if(track->pat_flag&SELECT) glColor3fv(scol);
- else glColor3fv(col);
+ if ((sc->flag & SC_SHOW_MARKER_PATTERN) && ((track->pat_flag & SELECT)==sel || outline)) {
+ if (!outline) {
+ if (track->pat_flag & SELECT)
+ glColor3fv(scol);
+ else
+ glColor3fv(col);
}
/* pattern offset square */
- x= track->pat_min[0];
- y= track->pat_max[1];
+ x = track->pat_min[0];
+ y = track->pat_max[1];
- tdx= patdx;
- tdy= patdy;
+ tdx = patdx;
+ tdy = patdy;
- if(outline) {
- tdx+= px[0];
- tdy+= px[1];
+ if (outline) {
+ tdx += px[0];
+ tdy += px[1];
}
glBegin(GL_QUADS);
@@ -730,16 +788,16 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo
glVertex3f(x-tdx, y-tdy, 0);
glEnd();
- /* pattern resizing triangle */
- x= track->pat_max[0];
- y= track->pat_min[1];
+ /* pattern re-sizing triangle */
+ x = track->pat_max[0];
+ y = track->pat_min[1];
- tdx= patdx*2.0f;
- tdy= patdy*2.0f;
+ tdx = patdx*2.0f;
+ tdy = patdy*2.0f;
- if(outline) {
- tdx+= px[0];
- tdy+= px[1];
+ if (outline) {
+ tdx += px[0];
+ tdy += px[1];
}
glBegin(GL_TRIANGLES);
@@ -751,73 +809,83 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo
glPopMatrix();
- if(outline)
+ if (outline)
glLineWidth(1.0f);
}
static void draw_marker_texts(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker, float marker_pos[2], int act,
- int width, int height, float zoomx, float zoomy)
+ int width, int height, float zoomx, float zoomy)
{
- char str[128]= {0}, state[64]= {0};
- float dx= 0.0f, dy= 0.0f, fontsize, pos[3];
- uiStyle *style= U.uistyles.first;
- int fontid= style->widget.uifont_id;
+ char str[128] = {0}, state[64] = {0};
+ float dx= 0.0f, dy = 0.0f, fontsize, pos[3];
+ uiStyle *style = U.uistyles.first;
+ int fontid = style->widget.uifont_id;
- if(!TRACK_VIEW_SELECTED(sc, track))
+ if (!TRACK_VIEW_SELECTED(sc, track))
return;
BLF_size(fontid, 11.0f, U.dpi);
- fontsize= BLF_height_max(fontid);
-
- if(marker->flag&MARKER_DISABLED) {
- if(act) UI_ThemeColor(TH_ACT_MARKER);
- else UI_ThemeColorShade(TH_DIS_MARKER, 128);
- } else {
- if(act) UI_ThemeColor(TH_ACT_MARKER);
- else UI_ThemeColor(TH_SEL_MARKER);
+ fontsize = BLF_height_max(fontid);
+
+ if (marker->flag & MARKER_DISABLED) {
+ if (act)
+ UI_ThemeColor(TH_ACT_MARKER);
+ else
+ UI_ThemeColorShade(TH_DIS_MARKER, 128);
+ }
+ else {
+ if (act)
+ UI_ThemeColor(TH_ACT_MARKER);
+ else
+ UI_ThemeColor(TH_SEL_MARKER);
}
- if((sc->flag&SC_SHOW_MARKER_SEARCH) &&
- ((marker->flag&MARKER_DISABLED)==0 || (sc->flag&SC_SHOW_MARKER_PATTERN)==0))
+ if ((sc->flag & SC_SHOW_MARKER_SEARCH) &&
+ ((marker->flag & MARKER_DISABLED) == 0 || (sc->flag & SC_SHOW_MARKER_PATTERN) == 0))
{
- dx= track->search_min[0];
- dy= track->search_min[1];
- } else if(sc->flag&SC_SHOW_MARKER_PATTERN) {
- dx= track->pat_min[0];
- dy= track->pat_min[1];
+ dx = track->search_min[0];
+ dy = track->search_min[1];
+ }
+ else if (sc->flag & SC_SHOW_MARKER_PATTERN) {
+ dx = track->pat_min[0];
+ dy = track->pat_min[1];
}
- pos[0]= (marker_pos[0]+dx)*width;
- pos[1]= (marker_pos[1]+dy)*height;
- pos[2]= 0.0f;
+ pos[0] = (marker_pos[0] + dx) * width;
+ pos[1] = (marker_pos[1] + dy) * height;
+ pos[2] = 0.0f;
mul_m4_v3(sc->stabmat, pos);
- pos[0]= pos[0]*zoomx;
- pos[1]= pos[1]*zoomy - fontsize;
+ pos[0] = pos[0]*zoomx;
+ pos[1] = pos[1]*zoomy - fontsize;
- if(marker->flag&MARKER_DISABLED) strcpy(state, "disabled");
- else if(marker->framenr!=sc->user.framenr) strcpy(state, "estimated");
- else if(marker->flag&MARKER_TRACKED) strcpy(state, "tracked");
- else strcpy(state, "keyframed");
+ if (marker->flag & MARKER_DISABLED)
+ strcpy(state, "disabled");
+ else if (marker->framenr != sc->user.framenr)
+ strcpy(state, "estimated");
+ else if (marker->flag & MARKER_TRACKED)
+ strcpy(state, "tracked");
+ else
+ strcpy(state, "keyframed");
- if(state[0])
+ if (state[0])
BLI_snprintf(str, sizeof(str), "%s: %s", track->name, state);
else
BLI_snprintf(str, sizeof(str), "%s", track->name);
BLF_position(fontid, pos[0], pos[1], 0.0f);
BLF_draw(fontid, str, sizeof(str));
- pos[1]-= fontsize;
+ pos[1] -= fontsize;
- if(track->flag&TRACK_HAS_BUNDLE) {
+ if (track->flag & TRACK_HAS_BUNDLE) {
BLI_snprintf(str, sizeof(str), "Average error: %.3f", track->error);
BLF_position(fontid, pos[0], pos[1], 0.0f);
BLF_draw(fontid, str, sizeof(str));
- pos[1]-= fontsize;
+ pos[1] -= fontsize;
}
- if(track->flag&TRACK_LOCKED) {
+ if (track->flag & TRACK_LOCKED) {
BLF_position(fontid, pos[0], pos[1], 0.0f);
BLF_draw(fontid, "locked", 6);
}
@@ -826,32 +894,32 @@ static void draw_marker_texts(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
static void view2d_to_region_float(View2D *v2d, float x, float y, float *regionx, float *regiony)
{
/* express given coordinates as proportional values */
- x= -v2d->cur.xmin / (v2d->cur.xmax-v2d->cur.xmin);
- y= -v2d->cur.ymin / (v2d->cur.ymax-v2d->cur.ymin);
+ x = -v2d->cur.xmin / (v2d->cur.xmax - v2d->cur.xmin);
+ y = -v2d->cur.ymin / (v2d->cur.ymax - v2d->cur.ymin);
/* convert proportional distances to screen coordinates */
- *regionx= v2d->mask.xmin + x*(v2d->mask.xmax-v2d->mask.xmin);
- *regiony= v2d->mask.ymin + y*(v2d->mask.ymax-v2d->mask.ymin);
+ *regionx = v2d->mask.xmin + x*(v2d->mask.xmax - v2d->mask.xmin);
+ *regiony = v2d->mask.ymin + y*(v2d->mask.ymax - v2d->mask.ymin);
}
static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
- int width, int height, float zoomx, float zoomy)
+ int width, int height, float zoomx, float zoomy)
{
float x, y;
- MovieTracking* tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
MovieTrackingTrack *track, *act_track;
MovieTrackingMarker *marker;
- int framenr= sc->user.framenr;
- int undistort= sc->user.render_flag&MCLIP_PROXY_RENDER_UNDISTORT;
- float *marker_pos= NULL, *fp, *active_pos= NULL, cur_pos[2];
+ int framenr = sc->user.framenr;
+ int undistort = sc->user.render_flag & MCLIP_PROXY_RENDER_UNDISTORT;
+ float *marker_pos = NULL, *fp, *active_pos = NULL, cur_pos[2];
/* ** 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);
@@ -863,67 +931,67 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
glMultMatrixf(sc->stabmat);
glScalef(width, height, 0);
- act_track= BKE_tracking_active_track(tracking);
+ act_track = BKE_tracking_active_track(tracking);
- if(sc->user.render_flag&MCLIP_PROXY_RENDER_UNDISTORT) {
- int count= 0;
+ if (sc->user.render_flag & MCLIP_PROXY_RENDER_UNDISTORT) {
+ int count = 0;
/* count */
- track= tracksbase->first;
- while(track) {
- if((track->flag&TRACK_HIDDEN)==0) {
- marker= BKE_tracking_get_marker(track, framenr);
+ track = tracksbase->first;
+ while (track) {
+ if ((track->flag & TRACK_HIDDEN)==0) {
+ marker = BKE_tracking_get_marker(track, framenr);
- if(MARKER_VISIBLE(sc, marker))
+ if (MARKER_VISIBLE(sc, marker))
count++;
}
- track= track->next;
+ track = track->next;
}
/* undistort */
- if(count) {
- marker_pos= MEM_callocN(2*sizeof(float)*count, "draw_tracking_tracks marker_pos");
+ if (count) {
+ marker_pos = MEM_callocN(2*sizeof(float)*count, "draw_tracking_tracks marker_pos");
- track= tracksbase->first;
- fp= marker_pos;
- while(track) {
- if((track->flag&TRACK_HIDDEN)==0) {
- marker= BKE_tracking_get_marker(track, framenr);
+ track = tracksbase->first;
+ fp = marker_pos;
+ while (track) {
+ if ((track->flag & TRACK_HIDDEN)==0) {
+ marker = BKE_tracking_get_marker(track, framenr);
- if(MARKER_VISIBLE(sc, marker)) {
+ if (MARKER_VISIBLE(sc, marker)) {
ED_clip_point_undistorted_pos(sc, marker->pos, fp);
- if(track==act_track)
- active_pos= fp;
+ if (track == act_track)
+ active_pos = fp;
- fp+= 2;
+ fp += 2;
}
}
- track= track->next;
+ track = track->next;
}
}
}
- if(sc->flag&SC_SHOW_TRACK_PATH) {
- track= tracksbase->first;
- while(track) {
- if((track->flag&TRACK_HIDDEN)==0)
+ if (sc->flag & SC_SHOW_TRACK_PATH) {
+ track = tracksbase->first;
+ while (track) {
+ if ((track->flag & TRACK_HIDDEN)==0)
draw_track_path(sc, clip, track);
- track= track->next;
+ track = track->next;
}
}
/* markers outline and non-selected areas */
- track= tracksbase->first;
- fp= marker_pos;
- while(track) {
- if((track->flag&TRACK_HIDDEN)==0) {
- marker= BKE_tracking_get_marker(track, framenr);
+ track = tracksbase->first;
+ fp = marker_pos;
+ while (track) {
+ if ((track->flag & TRACK_HIDDEN)==0) {
+ marker = BKE_tracking_get_marker(track, framenr);
- if(MARKER_VISIBLE(sc, marker)) {
+ if (MARKER_VISIBLE(sc, marker)) {
copy_v2_v2(cur_pos, fp ? fp : marker->pos);
draw_marker_outline(sc, track, marker, cur_pos, width, height);
@@ -931,45 +999,45 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
draw_marker_slide_zones(sc, track, marker, cur_pos, 1, 0, 0, width, height);
draw_marker_slide_zones(sc, track, marker, cur_pos, 0, 0, 0, width, height);
- if(fp)
- fp+= 2;
+ if (fp)
+ fp += 2;
}
}
- track= track->next;
+ track = track->next;
}
/* selected areas only, so selection wouldn't be overlapped by
- non-selected areas */
- track= tracksbase->first;
- fp= marker_pos;
- while(track) {
- if((track->flag&TRACK_HIDDEN)==0) {
- int act= track==act_track;
- marker= BKE_tracking_get_marker(track, framenr);
-
- if(MARKER_VISIBLE(sc, marker)) {
- if(!act) {
+ * non-selected areas */
+ track = tracksbase->first;
+ fp = marker_pos;
+ while (track) {
+ if ((track->flag & TRACK_HIDDEN)==0) {
+ int act = track == act_track;
+ marker = BKE_tracking_get_marker(track, framenr);
+
+ if (MARKER_VISIBLE(sc, marker)) {
+ if (!act) {
copy_v2_v2(cur_pos, fp ? fp : marker->pos);
draw_marker_areas(sc, track, marker, cur_pos, width, height, 0, 1);
draw_marker_slide_zones(sc, track, marker, cur_pos, 0, 1, 0, width, height);
}
- if(fp)
- fp+= 2;
+ if (fp)
+ fp += 2;
}
}
- track= track->next;
+ track = track->next;
}
/* active marker would be displayed on top of everything else */
- if(act_track) {
- if((act_track->flag&TRACK_HIDDEN)==0) {
- marker= BKE_tracking_get_marker(act_track, framenr);
+ if (act_track) {
+ if ((act_track->flag & TRACK_HIDDEN)==0) {
+ marker = BKE_tracking_get_marker(act_track, framenr);
- if(MARKER_VISIBLE(sc, marker)) {
+ if (MARKER_VISIBLE(sc, marker)) {
copy_v2_v2(cur_pos, active_pos ? active_pos : marker->pos);
draw_marker_areas(sc, act_track, marker, cur_pos, width, height, 1, 1);
@@ -978,51 +1046,55 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
}
}
- if(sc->flag&SC_SHOW_BUNDLES) {
- MovieTrackingObject *object= BKE_tracking_active_object(tracking);
+ if (sc->flag & SC_SHOW_BUNDLES) {
+ MovieTrackingObject *object = BKE_tracking_active_object(tracking);
float pos[4], vec[4], mat[4][4], aspy;
glEnable(GL_POINT_SMOOTH);
glPointSize(3.0f);
- aspy= 1.0f/clip->tracking.camera.pixel_aspect;
+ aspy = 1.0f / clip->tracking.camera.pixel_aspect;
BKE_tracking_projection_matrix(tracking, object, framenr, width, height, mat);
- track= tracksbase->first;
- while(track) {
- if((track->flag&TRACK_HIDDEN)==0 && track->flag&TRACK_HAS_BUNDLE) {
+ track = tracksbase->first;
+ while (track) {
+ if ((track->flag & TRACK_HIDDEN) == 0 && track->flag & TRACK_HAS_BUNDLE) {
marker= BKE_tracking_get_marker(track, framenr);
- if(MARKER_VISIBLE(sc, marker)) {
+ if (MARKER_VISIBLE(sc, marker)) {
float npos[2];
copy_v4_v4(vec, track->bundle_pos);
vec[3]=1;
mul_v4_m4v4(pos, mat, vec);
- pos[0]= (pos[0]/(pos[3]*2.0f)+0.5f)*width;
- pos[1]= (pos[1]/(pos[3]*2.0f)+0.5f)*height*aspy;
+ pos[0] = (pos[0] / (pos[3] * 2.0f) + 0.5f) * width;
+ pos[1] = (pos[1] / (pos[3] * 2.0f) + 0.5f) * height * aspy;
BKE_tracking_apply_intrinsics(tracking, pos, npos);
- if(npos[0]>=0.0f && npos[1]>=0.0f && npos[0]<=width && npos[1]<=height*aspy) {
- vec[0]= (marker->pos[0]+track->offset[0])*width;
- vec[1]= (marker->pos[1]+track->offset[1])*height*aspy;
+ if (npos[0] >= 0.0f && npos[1] >= 0.0f && npos[0] <= width && npos[1] <= height * aspy) {
+ vec[0] = (marker->pos[0] + track->offset[0]) * width;
+ vec[1] = (marker->pos[1] + track->offset[1]) * height * aspy;
sub_v2_v2(vec, npos);
- if(len_v2(vec)<3) glColor3f(0.0f, 1.0f, 0.0f);
- else glColor3f(1.0f, 0.0f, 0.0f);
+ if (len_v2(vec)< 3.0f)
+ glColor3f(0.0f, 1.0f, 0.0f);
+ else
+ glColor3f(1.0f, 0.0f, 0.0f);
glBegin(GL_POINTS);
- if(undistort) glVertex3f(pos[0]/width, pos[1]/(height*aspy), 0);
- else glVertex3f(npos[0]/width, npos[1]/(height*aspy), 0);
+ if (undistort)
+ glVertex3f(pos[0] / width, pos[1] / (height * aspy), 0);
+ else
+ glVertex3f(npos[0] / width, npos[1] / (height * aspy), 0);
glEnd();
}
}
}
- track= track->next;
+ track = track->next;
}
glPointSize(1.0f);
@@ -1031,52 +1103,53 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
glPopMatrix();
- if(sc->flag&SC_SHOW_NAMES) {
+ if (sc->flag & SC_SHOW_NAMES) {
/* scaling should be cleared before drawing texts, otherwise font would also be scaled */
- track= tracksbase->first;
- fp= marker_pos;
- while(track) {
- if((track->flag&TRACK_HIDDEN)==0) {
- marker= BKE_tracking_get_marker(track, framenr);
+ track = tracksbase->first;
+ fp = marker_pos;
+ while (track) {
+ if ((track->flag & TRACK_HIDDEN) == 0) {
+ marker = BKE_tracking_get_marker(track, framenr);
- if(MARKER_VISIBLE(sc, marker)) {
- int act= track==act_track;
+ if (MARKER_VISIBLE(sc, marker)) {
+ int act = track == act_track;
copy_v2_v2(cur_pos, fp ? fp : marker->pos);
draw_marker_texts(sc, track, marker, cur_pos, act, width, height, zoomx, zoomy);
- if(fp) fp+= 2;
+ if (fp)
+ fp += 2;
}
}
- track= track->next;
+ track = track->next;
}
}
glPopMatrix();
- if(marker_pos)
+ if (marker_pos)
MEM_freeN(marker_pos);
}
static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, int width, int height, float zoomx, float zoomy)
{
float x, y;
- const int n= 10;
+ const int n = 10;
int i, j, a;
float pos[2], tpos[2], grid[11][11][2];
- MovieTracking *tracking= &clip->tracking;
- float aspy= 1.0f/tracking->camera.pixel_aspect;
- float dx= (float)width/n, dy= (float)height/n*aspy;
+ MovieTracking *tracking = &clip->tracking;
+ float aspy = 1.0f / tracking->camera.pixel_aspect;
+ float dx = (float)width / n, dy = (float)height / n * aspy;
- if(sc->mode!=SC_MODE_DISTORTION)
+ if (sc->mode != SC_MODE_DISTORTION)
return;
- if(!tracking->camera.focal)
+ if (!tracking->camera.focal)
return;
- if((sc->flag&SC_SHOW_GRID)==0 && (sc->flag&SC_MANUAL_CALIBRATION)==0)
+ if ((sc->flag & SC_SHOW_GRID) == 0 && (sc->flag & SC_MANUAL_CALIBRATION) == 0)
return;
view2d_to_region_float(&ar->v2d, 0.0f, 0.0f, &x, &y);
@@ -1088,47 +1161,51 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, int wid
glScalef(width, height, 0);
/* grid */
- if(sc->flag&SC_SHOW_GRID) {
+ if (sc->flag & SC_SHOW_GRID) {
float val[4][2], idx[4][2];
float min[2], max[2];
- for(a=0; a<4; a++) {
- if(a<2) val[a][a%2]= FLT_MAX;
- else val[a][a%2]= -FLT_MAX;
+ for (a = 0; a < 4; a++) {
+ if (a < 2)
+ val[a][a%2] = FLT_MAX;
+ else
+ val[a][a%2] = -FLT_MAX;
}
zero_v2(pos);
- for(i= 0; i<=n; i++) {
- for(j= 0; j<=n; j++) {
- if(i==0 || j==0 || i==n || j==n) {
+ for (i = 0; i <= n; i++) {
+ for (j = 0; j <= n; j++) {
+ if (i == 0 || j == 0 || i == n || j == n) {
BKE_tracking_apply_intrinsics(tracking, pos, tpos);
- for(a=0; a<4; a++) {
+ for (a = 0; a < 4; a++) {
int ok;
- if(a<2) ok= tpos[a%2] < val[a][a%2];
- else ok= tpos[a%2] > val[a][a%2];
+ if (a<2)
+ ok = tpos[a%2] < val[a][a%2];
+ else
+ ok= tpos[a%2] > val[a][a%2];
- if(ok) {
+ if (ok) {
copy_v2_v2(val[a], tpos);
- idx[a][0]= j;
- idx[a][1]= i;
+ idx[a][0] = j;
+ idx[a][1] = i;
}
}
}
- pos[0]+= dx;
+ pos[0] += dx;
}
- pos[0]= 0.0f;
- pos[1]+= dy;
+ pos[0] = 0.0f;
+ pos[1] += dy;
}
INIT_MINMAX2(min, max);
- for(a= 0; a<4; a++) {
- pos[0]= idx[a][0]*dx;
- pos[1]= idx[a][1]*dy;
+ for (a = 0; a < 4; a++) {
+ pos[0] = idx[a][0] * dx;
+ pos[1] = idx[a][1] * dy;
BKE_tracking_invert_intrinsics(tracking, pos, tpos);
@@ -1136,50 +1213,50 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, int wid
}
copy_v2_v2(pos, min);
- dx= (max[0]-min[0])/n;
- dy= (max[1]-min[1])/n;
+ dx = (max[0] - min[0]) / n;
+ dy = (max[1] - min[1]) / n;
- for(i= 0; i<=n; i++) {
- for(j= 0; j<=n; j++) {
+ for (i = 0; i <= n; i++) {
+ for (j = 0; j <= n; j++) {
BKE_tracking_apply_intrinsics(tracking, pos, grid[i][j]);
- grid[i][j][0]/= width;
- grid[i][j][1]/= height*aspy;
+ grid[i][j][0] /= width;
+ grid[i][j][1] /= height*aspy;
- pos[0]+= dx;
+ pos[0] += dx;
}
- pos[0]= min[0];
- pos[1]+= dy;
+ pos[0] = min[0];
+ pos[1] += dy;
}
glColor3f(1.0f, 0.0f, 0.0f);
- for(i= 0; i<=n; i++) {
+ for (i = 0; i <= n; i++) {
glBegin(GL_LINE_STRIP);
- for(j= 0; j<=n; j++) {
+ for (j = 0; j <= n; j++) {
glVertex2fv(grid[i][j]);
}
glEnd();
}
- for(j= 0; j<=n; j++) {
+ for (j = 0; j <= n; j++) {
glBegin(GL_LINE_STRIP);
- for(i= 0; i<=n; i++) {
+ for (i = 0; i <= n; i++) {
glVertex2fv(grid[i][j]);
}
glEnd();
}
}
- if(sc->flag&SC_MANUAL_CALIBRATION && clip->gpd) {
+ if (sc->flag & SC_MANUAL_CALIBRATION && clip->gpd) {
bGPDlayer *layer= clip->gpd->layers.first;
- while(layer) {
- bGPDframe *frame= layer->frames.first;
+ while (layer) {
+ bGPDframe *frame = layer->frames.first;
- if(layer->flag & GP_LAYER_HIDE) {
- layer= layer->next;
+ if (layer->flag & GP_LAYER_HIDE) {
+ layer = layer->next;
continue;
}
@@ -1187,28 +1264,28 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, int wid
glLineWidth(layer->thickness);
glPointSize((float)(layer->thickness + 2));
- while(frame) {
- bGPDstroke *stroke= frame->strokes.first;
+ while (frame) {
+ bGPDstroke *stroke = frame->strokes.first;
- while(stroke) {
- if(stroke->flag&GP_STROKE_2DSPACE) {
- if(stroke->totpoints>1) {
+ while (stroke) {
+ if (stroke->flag & GP_STROKE_2DSPACE) {
+ if (stroke->totpoints > 1) {
glBegin(GL_LINE_STRIP);
- for(i= 0; i<stroke->totpoints-1; i++) {
+ for (i = 0; i < stroke->totpoints - 1; i++) {
float npos[2], dpos[2], len;
int steps;
- pos[0]= stroke->points[i].x*width;
- pos[1]= stroke->points[i].y*height*aspy;
+ pos[0] = stroke->points[i].x * width;
+ pos[1] = stroke->points[i].y * height * aspy;
- npos[0]= stroke->points[i+1].x*width;
- npos[1]= stroke->points[i+1].y*height*aspy;
+ npos[0] = stroke->points[i+1].x * width;
+ npos[1] = stroke->points[i+1].y * height * aspy;
- len= len_v2v2(pos, npos);
+ len = len_v2v2(pos, npos);
steps= ceil(len/5.0f);
/* we want to distort only long straight lines */
- if(stroke->totpoints==2) {
+ if (stroke->totpoints == 2) {
BKE_tracking_invert_intrinsics(tracking, pos, pos);
BKE_tracking_invert_intrinsics(tracking, npos, npos);
}
@@ -1216,7 +1293,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, int wid
sub_v2_v2v2(dpos, npos, pos);
mul_v2_fl(dpos, 1.0f/steps);
- for(j= 0; j<=steps; j++) {
+ for (j = 0; j <= steps; j++) {
BKE_tracking_apply_intrinsics(tracking, pos, tpos);
glVertex2f(tpos[0]/width, tpos[1]/(height*aspy));
@@ -1225,20 +1302,20 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, int wid
}
glEnd();
}
- else if(stroke->totpoints==1) {
+ else if (stroke->totpoints == 1) {
glBegin(GL_POINTS);
glVertex2f(stroke->points[0].x, stroke->points[0].y);
glEnd();
}
}
- stroke= stroke->next;
+ stroke = stroke->next;
}
- frame= frame->next;
+ frame = frame->next;
}
- layer= layer->next;
+ layer = layer->next;
}
glLineWidth(1.0f);
@@ -1256,22 +1333,22 @@ void clip_draw_main(SpaceClip *sc, ARegion *ar, Scene *scene)
float zoomx, zoomy;
/* if no clip, nothing to do */
- if(!clip)
+ if (!clip)
return;
ED_space_clip_size(sc, &width, &height);
ED_space_clip_zoom(sc, ar, &zoomx, &zoomy);
- if(sc->flag&SC_SHOW_STABLE) {
+ if (sc->flag & SC_SHOW_STABLE) {
float smat[4][4], ismat[4][4];
- ibuf= ED_space_clip_get_stable_buffer(sc, sc->loc, &sc->scale, &sc->angle);
+ ibuf = ED_space_clip_get_stable_buffer(sc, sc->loc, &sc->scale, &sc->angle);
- if(ibuf) {
+ if (ibuf) {
float loc[2];
- float aspect= clip->tracking.camera.pixel_aspect;
+ float aspect = clip->tracking.camera.pixel_aspect;
- if(width != ibuf->x)
+ if (width != ibuf->x)
mul_v2_v2fl(loc, sc->loc, (float)width / ibuf->x);
else
copy_v2_v2(loc, sc->loc);
@@ -1279,22 +1356,23 @@ void clip_draw_main(SpaceClip *sc, ARegion *ar, Scene *scene)
BKE_tracking_stabdata_to_mat4(width, height, aspect, loc, sc->scale, sc->angle, sc->stabmat);
unit_m4(smat);
- smat[0][0]= 1.0f/width;
- smat[1][1]= 1.0f/height;
+ smat[0][0] = 1.0f / width;
+ smat[1][1] = 1.0f / height;
invert_m4_m4(ismat, smat);
mul_serie_m4(sc->unistabmat, smat, sc->stabmat, ismat, NULL, NULL, NULL, NULL, NULL);
}
- } else {
- ibuf= ED_space_clip_get_buffer(sc);
+ }
+ else {
+ ibuf = ED_space_clip_get_buffer(sc);
zero_v2(sc->loc);
- sc->scale= 1.0f;
+ sc->scale = 1.0f;
unit_m4(sc->stabmat);
unit_m4(sc->unistabmat);
}
- if(ibuf) {
+ if (ibuf) {
draw_movieclip_buffer(sc, ar, ibuf, width, height, zoomx, zoomy);
IMB_freeImBuf(ibuf);
@@ -1309,20 +1387,20 @@ void clip_draw_main(SpaceClip *sc, ARegion *ar, Scene *scene)
/* draw grease pencil */
void clip_draw_grease_pencil(bContext *C, int onlyv2d)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
ImBuf *ibuf;
- if(!clip)
+ if (!clip)
return;
- if(onlyv2d) {
- /* if manual calibration is used then grase 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);
+ if (onlyv2d) {
+ /* 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);
- if(ibuf) {
+ if (ibuf) {
glPushMatrix();
glMultMatrixf(sc->unistabmat);
draw_gpencil_2dimage(C, ibuf);
@@ -1331,7 +1409,8 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d)
glPopMatrix();
}
}
- } else {
+ }
+ else {
draw_gpencil_view2d(C, 0);
}
}
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c
index 35d870022a4..3946d4cc36d 100644
--- a/source/blender/editors/space_clip/clip_editor.c
+++ b/source/blender/editors/space_clip/clip_editor.c
@@ -57,22 +57,22 @@
int ED_space_clip_poll(bContext *C)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
- if(sc && sc->clip)
- return 1;
+ if (sc && sc->clip)
+ return TRUE;
- return 0;
+ return FALSE;
}
void ED_space_clip_set(bContext *C, SpaceClip *sc, MovieClip *clip)
{
- sc->clip= clip;
+ sc->clip = clip;
- if(sc->clip && sc->clip->id.us==0)
- sc->clip->id.us= 1;
+ if (sc->clip && sc->clip->id.us==0)
+ sc->clip->id.us = 1;
- if(C)
+ if (C)
WM_event_add_notifier(C, NC_MOVIECLIP|NA_SELECTED, sc->clip);
}
@@ -83,15 +83,15 @@ MovieClip *ED_space_clip(SpaceClip *sc)
ImBuf *ED_space_clip_get_buffer(SpaceClip *sc)
{
- if(sc->clip) {
+ if (sc->clip) {
ImBuf *ibuf;
- ibuf= BKE_movieclip_get_postprocessed_ibuf(sc->clip, &sc->user, sc->postproc_flag);
+ ibuf = BKE_movieclip_get_postprocessed_ibuf(sc->clip, &sc->user, sc->postproc_flag);
- if(ibuf && (ibuf->rect || ibuf->rect_float))
+ if (ibuf && (ibuf->rect || ibuf->rect_float))
return ibuf;
- if(ibuf)
+ if (ibuf)
IMB_freeImBuf(ibuf);
}
@@ -100,15 +100,15 @@ ImBuf *ED_space_clip_get_buffer(SpaceClip *sc)
ImBuf *ED_space_clip_get_stable_buffer(SpaceClip *sc, float loc[2], float *scale, float *angle)
{
- if(sc->clip) {
+ if (sc->clip) {
ImBuf *ibuf;
- ibuf= BKE_movieclip_get_stable_ibuf(sc->clip, &sc->user, loc, scale, angle, sc->postproc_flag);
+ ibuf = BKE_movieclip_get_stable_ibuf(sc->clip, &sc->user, loc, scale, angle, sc->postproc_flag);
- if(ibuf && (ibuf->rect || ibuf->rect_float))
+ if (ibuf && (ibuf->rect || ibuf->rect_float))
return ibuf;
- if(ibuf)
+ if (ibuf)
IMB_freeImBuf(ibuf);
}
@@ -117,11 +117,12 @@ ImBuf *ED_space_clip_get_stable_buffer(SpaceClip *sc, float loc[2], float *scale
void ED_space_clip_size(SpaceClip *sc, int *width, int *height)
{
- if(!sc->clip) {
- *width= 0;
- *height= 0;
- } else
+ if (!sc->clip) {
+ *width = *height = 0;
+ }
+ else {
BKE_movieclip_get_size(sc->clip, &sc->user, width, height);
+ }
}
void ED_space_clip_zoom(SpaceClip *sc, ARegion *ar, float *zoomx, float *zoomy)
@@ -130,18 +131,18 @@ void ED_space_clip_zoom(SpaceClip *sc, ARegion *ar, float *zoomx, float *zoomy)
ED_space_clip_size(sc, &width, &height);
- *zoomx= (float)(ar->winrct.xmax - ar->winrct.xmin + 1)/(float)((ar->v2d.cur.xmax - ar->v2d.cur.xmin)*width);
- *zoomy= (float)(ar->winrct.ymax - ar->winrct.ymin + 1)/(float)((ar->v2d.cur.ymax - ar->v2d.cur.ymin)*height);
+ *zoomx = (float)(ar->winrct.xmax - ar->winrct.xmin + 1)/(float)((ar->v2d.cur.xmax - ar->v2d.cur.xmin)*width);
+ *zoomy = (float)(ar->winrct.ymax - ar->winrct.ymin + 1)/(float)((ar->v2d.cur.ymax - ar->v2d.cur.ymin)*height);
}
void ED_space_clip_aspect(SpaceClip *sc, float *aspx, float *aspy)
{
- MovieClip *clip= ED_space_clip(sc);
+ MovieClip *clip = ED_space_clip(sc);
- if(clip)
+ if (clip)
BKE_movieclip_aspect(clip, aspx, aspy);
else
- *aspx= *aspy= 1.0f;
+ *aspx = *aspy = 1.0f;
}
void ED_clip_update_frame(const Main *mainp, int cfra)
@@ -150,14 +151,15 @@ void ED_clip_update_frame(const Main *mainp, int cfra)
wmWindow *win;
/* image window, compo node users */
- for(wm=mainp->wm.first; wm; wm= wm->id.next) { /* only 1 wm */
- for(win= wm->windows.first; win; win= win->next) {
+ for (wm = mainp->wm.first; wm; wm = wm->id.next) { /* only 1 wm */
+ for (win = wm->windows.first; win; win = win->next) {
ScrArea *sa;
- for(sa= win->screen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_CLIP) {
- SpaceClip *sc= sa->spacedata.first;
- sc->scopes.ok= 0;
+ for (sa = win->screen->areabase.first; sa; sa = sa->next) {
+ if (sa->spacetype == SPACE_CLIP) {
+ SpaceClip *sc = sa->spacedata.first;
+
+ sc->scopes.ok = FALSE;
BKE_movieclip_user_set_frame(&sc->user, cfra);
}
@@ -168,44 +170,45 @@ void ED_clip_update_frame(const Main *mainp, int cfra)
static int selected_boundbox(SpaceClip *sc, float min[2], float max[2])
{
- MovieClip *clip= ED_space_clip(sc);
+ MovieClip *clip = ED_space_clip(sc);
MovieTrackingTrack *track;
- int width, height, ok= 0;
+ int width, height, ok = FALSE;
ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
INIT_MINMAX2(min, max);
ED_space_clip_size(sc, &width, &height);
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track)) {
- MovieTrackingMarker *marker= BKE_tracking_get_marker(track, sc->user.framenr);
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track)) {
+ MovieTrackingMarker *marker = BKE_tracking_get_marker(track, sc->user.framenr);
- if(marker) {
+ if (marker) {
float pos[3];
- pos[0]= marker->pos[0]+track->offset[0];
- pos[1]= marker->pos[1]+track->offset[1];
- pos[2]= 0.0f;
+ pos[0] = marker->pos[0] + track->offset[0];
+ pos[1] = marker->pos[1] + track->offset[1];
+ pos[2] = 0.0f;
/* undistortion happens for normalized coords */
- if(sc->user.render_flag&MCLIP_PROXY_RENDER_UNDISTORT)
+ if (sc->user.render_flag & MCLIP_PROXY_RENDER_UNDISTORT) {
/* undistortion happens for normalized coords */
ED_clip_point_undistorted_pos(sc, pos, pos);
+ }
- pos[0]*= width;
- pos[1]*= height;
+ pos[0] *= width;
+ pos[1] *= height;
mul_v3_m4v3(pos, sc->stabmat, pos);
DO_MINMAX2(pos, min, max);
- ok= 1;
+ ok = TRUE;
}
}
- track= track->next;
+ track = track->next;
}
return ok;
@@ -218,90 +221,92 @@ int ED_clip_view_selection(SpaceClip *sc, ARegion *ar, int fit)
ED_space_clip_size(sc, &frame_width, &frame_height);
- if(frame_width==0 || frame_height==0) return 0;
+ if (frame_width == 0 || frame_height == 0)
+ return FALSE;
- if(!selected_boundbox(sc, min, max))
- return 0;
+ if (!selected_boundbox(sc, min, max))
+ return FALSE;
/* center view */
clip_view_center_to_point(sc, (max[0]+min[0])/(2*frame_width), (max[1]+min[1])/(2*frame_height));
- w= max[0]-min[0];
- h= max[1]-min[1];
+ w = max[0] - min[0];
+ h = max[1] - min[1];
/* set zoom to see all selection */
- if(w>0 && h>0) {
+ if (w > 0 && h > 0) {
int width, height;
float zoomx, zoomy, newzoom, aspx, aspy;
ED_space_clip_aspect(sc, &aspx, &aspy);
- width= ar->winrct.xmax - ar->winrct.xmin + 1;
- height= ar->winrct.ymax - ar->winrct.ymin + 1;
+ width = ar->winrct.xmax - ar->winrct.xmin + 1;
+ height = ar->winrct.ymax - ar->winrct.ymin + 1;
- zoomx= (float)width/w/aspx;
- zoomy= (float)height/h/aspy;
+ zoomx = (float)width / w / aspx;
+ zoomy = (float)height / h / aspy;
- newzoom= 1.0f/power_of_2(1/MIN2(zoomx, zoomy));
+ newzoom = 1.0f / power_of_2(1.0f / MIN2(zoomx, zoomy));
- if(fit || sc->zoom>newzoom)
- sc->zoom= newzoom;
+ if (fit || sc->zoom>newzoom)
+ sc->zoom = newzoom;
}
- return 1;
+ return TRUE;
}
void ED_clip_point_undistorted_pos(SpaceClip *sc, float co[2], float nco[2])
{
copy_v2_v2(nco, co);
- if(sc->user.render_flag&MCLIP_PROXY_RENDER_UNDISTORT) {
- MovieClip *clip= ED_space_clip(sc);
- float aspy= 1.0f/clip->tracking.camera.pixel_aspect;
+ if (sc->user.render_flag & MCLIP_PROXY_RENDER_UNDISTORT) {
+ MovieClip *clip = ED_space_clip(sc);
+ float aspy = 1.0f / clip->tracking.camera.pixel_aspect;
int width, height;
ED_space_clip_size(sc, &width, &height);
- nco[0]*= width;
- nco[1]*= height*aspy;
+ nco[0] *= width;
+ nco[1] *= height * aspy;
BKE_tracking_invert_intrinsics(&clip->tracking, nco, nco);
- nco[0]/= width;
- nco[1]/= height*aspy;
+
+ nco[0] /= width;
+ nco[1] /= height * aspy;
}
}
void ED_clip_point_stable_pos(bContext *C, float x, float y, float *xr, float *yr)
{
- ARegion *ar= CTX_wm_region(C);
- SpaceClip *sc= CTX_wm_space_clip(C);
+ ARegion *ar = CTX_wm_region(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
int sx, sy, width, height;
- float zoomx, zoomy, pos[3]={0.0f, 0.0f, 0.0f}, imat[4][4];
+ float zoomx, zoomy, pos[3] = {0.0f, 0.0f, 0.0f}, imat[4][4];
ED_space_clip_zoom(sc, ar, &zoomx, &zoomy);
ED_space_clip_size(sc, &width, &height);
UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &sx, &sy);
- pos[0]= (x-sx)/zoomx;
- pos[1]= (y-sy)/zoomy;
+ pos[0] = (x - sx) / zoomx;
+ pos[1] = (y - sy) / zoomy;
invert_m4_m4(imat, sc->stabmat);
mul_v3_m4v3(pos, imat, pos);
- *xr= pos[0]/width;
- *yr= pos[1]/height;
+ *xr = pos[0] / width;
+ *yr = pos[1] / height;
- if(sc->user.render_flag&MCLIP_PROXY_RENDER_UNDISTORT) {
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- float aspy= 1.0f/tracking->camera.pixel_aspect;
- float tmp[2]= {*xr*width, *yr*height*aspy};
+ if (sc->user.render_flag & MCLIP_PROXY_RENDER_UNDISTORT) {
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ float aspy = 1.0f / tracking->camera.pixel_aspect;
+ float tmp[2] = {*xr * width, *yr * height * aspy};
BKE_tracking_apply_intrinsics(tracking, tmp, tmp);
- *xr= tmp[0]/width;
- *yr= tmp[1]/(height*aspy);
+ *xr = tmp[0] / width;
+ *yr = tmp[1] / (height * aspy);
}
}
diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c
index 6fabe802ff0..df14491c9c9 100644
--- a/source/blender/editors/space_clip/clip_graph_draw.c
+++ b/source/blender/editors/space_clip/clip_graph_draw.c
@@ -63,14 +63,14 @@ static void draw_curve_knot(float x, float y, float xscale, float yscale, float
{
static GLuint displist=0;
- /* initialise round circle shape */
+ /* initialize round circle shape */
if (displist == 0) {
GLUquadricObj *qobj;
- displist= glGenLists(1);
+ displist = glGenLists(1);
glNewList(displist, GL_COMPILE);
- qobj= gluNewQuadric();
+ qobj = gluNewQuadric();
gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
gluDisk(qobj, 0, 0.7, 8, 1);
gluDeleteQuadric(qobj);
@@ -89,21 +89,21 @@ static void draw_curve_knot(float x, float y, float xscale, float yscale, float
static void draw_graph_cfra(SpaceClip *sc, ARegion *ar, Scene *scene)
{
- View2D *v2d= &ar->v2d;
+ View2D *v2d = &ar->v2d;
float xscale, yscale;
float vec[2];
/* Draw a light green line to indicate current frame */
- vec[0]= (float)(sc->user.framenr * scene->r.framelen);
+ vec[0] = (float)(sc->user.framenr * scene->r.framelen);
UI_ThemeColor(TH_CFRAME);
glLineWidth(2.0);
glBegin(GL_LINE_STRIP);
- vec[1]= v2d->cur.ymin;
+ vec[1] = v2d->cur.ymin;
glVertex2fv(vec);
- vec[1]= v2d->cur.ymax;
+ vec[1] = v2d->cur.ymax;
glVertex2fv(vec);
glEnd();
@@ -155,11 +155,12 @@ void tracking_segment_start_cb(void *userdata, MovieTrackingTrack *track, int co
copy_v3_v3(col, colors[coord]);
- if(track==userdata) {
- col[3]= 1.0f;
+ if (track==userdata) {
+ col[3] = 1.0f;
glLineWidth(2.0f);
- } else {
- col[3]= 0.5f;
+ }
+ else {
+ col[3] = 0.5f;
glLineWidth(1.0f);
}
@@ -181,15 +182,17 @@ static void tracking_segment_knot_cb(void *userdata, MovieTrackingTrack *track,
struct { MovieTrackingTrack *act_track; int sel; float xscale, yscale, hsize; } *data = userdata;
int sel= 0, sel_flag;
- if(track!=data->act_track)
+ if (track != data->act_track)
return;
- sel_flag= coord == 0 ? MARKER_GRAPH_SEL_X : MARKER_GRAPH_SEL_Y;
- sel= (marker->flag & sel_flag) ? 1 : 0;
+ sel_flag = coord == 0 ? MARKER_GRAPH_SEL_X : MARKER_GRAPH_SEL_Y;
+ sel = (marker->flag & sel_flag) ? 1 : 0;
- if(sel == data->sel) {
- if(sel) UI_ThemeColor(TH_HANDLE_VERTEX_SELECT);
- else UI_ThemeColor(TH_HANDLE_VERTEX);
+ if (sel == data->sel) {
+ if (sel)
+ UI_ThemeColor(TH_HANDLE_VERTEX_SELECT);
+ else
+ UI_ThemeColor(TH_HANDLE_VERTEX);
draw_curve_knot(marker->framenr, val, data->xscale, data->yscale, data->hsize);
}
@@ -197,21 +200,21 @@ static void tracking_segment_knot_cb(void *userdata, MovieTrackingTrack *track,
static void draw_tracks_curves(View2D *v2d, SpaceClip *sc)
{
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingTrack *act_track = BKE_tracking_active_track(tracking);
int width, height;
struct { MovieTrackingTrack *act_track; int sel; float xscale, yscale, hsize; } userdata;
BKE_movieclip_get_size(clip, &sc->user, &width, &height);
- if(!width || !height)
+ if (!width || !height)
return;
/* non-selected knot handles */
- userdata.hsize= UI_GetThemeValuef(TH_HANDLE_VERTEX_SIZE);
- userdata.sel= 0;
- userdata.act_track= act_track;
+ userdata.hsize = UI_GetThemeValuef(TH_HANDLE_VERTEX_SIZE);
+ userdata.sel = FALSE;
+ userdata.act_track = act_track;
UI_view2d_getscale(v2d, &userdata.xscale, &userdata.yscale);
clip_graph_tracking_values_iterate(sc, &userdata, tracking_segment_knot_cb, NULL, NULL);
@@ -221,58 +224,58 @@ static void draw_tracks_curves(View2D *v2d, SpaceClip *sc)
glDisable(GL_BLEND);
/* selected knot handles on top of curves */
- userdata.sel= 1;
+ userdata.sel= TRUE;
clip_graph_tracking_values_iterate(sc, &userdata, tracking_segment_knot_cb, NULL, NULL);
}
static void draw_frame_curves(SpaceClip *sc)
{
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingReconstruction *reconstruction= BKE_tracking_get_reconstruction(tracking);
- int i, lines= 0, prevfra= 0;
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingReconstruction *reconstruction = BKE_tracking_get_reconstruction(tracking);
+ int i, lines = 0, prevfra = 0;
glColor3f(0.0f, 0.0f, 1.0f);
- for(i= 0; i<reconstruction->camnr; i++) {
- MovieReconstructedCamera *camera= &reconstruction->cameras[i];
+ for (i = 0; i<reconstruction->camnr; i++) {
+ MovieReconstructedCamera *camera = &reconstruction->cameras[i];
- if(lines && camera->framenr!=prevfra+1) {
+ if (lines && camera->framenr!=prevfra+1) {
glEnd();
- lines= 0;
+ lines = 0;
}
- if(!lines) {
+ if (!lines) {
glBegin(GL_LINE_STRIP);
- lines= 1;
+ lines = 1;
}
glVertex2f(camera->framenr, camera->error);
- prevfra= camera->framenr;
+ prevfra = camera->framenr;
}
- if(lines)
+ if (lines)
glEnd();
}
void clip_draw_graph(SpaceClip *sc, ARegion *ar, Scene *scene)
{
- MovieClip *clip= ED_space_clip(sc);
- View2D *v2d= &ar->v2d;
+ MovieClip *clip = ED_space_clip(sc);
+ View2D *v2d = &ar->v2d;
View2DGrid *grid;
- short unitx= V2D_UNIT_FRAMESCALE, unity= V2D_UNIT_VALUES;
+ short unitx = V2D_UNIT_FRAMESCALE, unity = V2D_UNIT_VALUES;
/* grid */
- grid= UI_view2d_grid_calc(scene, v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP, ar->winx, ar->winy);
+ grid = UI_view2d_grid_calc(scene, v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP, ar->winx, ar->winy);
UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL);
UI_view2d_grid_free(grid);
- if(clip) {
- if(sc->flag&SC_SHOW_GRAPH_TRACKS)
+ if (clip) {
+ if (sc->flag & SC_SHOW_GRAPH_TRACKS)
draw_tracks_curves(v2d, sc);
- if(sc->flag&SC_SHOW_GRAPH_FRAMES)
+ if (sc->flag & SC_SHOW_GRAPH_FRAMES)
draw_frame_curves(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..f8c81c2944a 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"
@@ -63,7 +65,7 @@ static int ED_space_clip_graph_poll(bContext *C)
{
SpaceClip *sc = CTX_wm_space_clip(C);
- if(sc && sc->clip) {
+ if (sc && sc->clip) {
ARegion *ar = CTX_wm_region(C);
return ar->regiontype == RGN_TYPE_PREVIEW;
@@ -78,17 +80,17 @@ typedef struct {
static void toggle_selection_cb(void *userdata, MovieTrackingMarker *marker)
{
- SelectUserData *data= (SelectUserData *)userdata;
+ SelectUserData *data = (SelectUserData *)userdata;
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;
}
}
@@ -109,47 +111,47 @@ typedef struct {
} MouseSelectUserData;
static void find_nearest_tracking_segment_cb(void *userdata, MovieTrackingTrack *track,
- MovieTrackingMarker *marker, int coord, float val)
+ MovieTrackingMarker *marker, int coord, float val)
{
- MouseSelectUserData *data= userdata;
- float co[2]= {marker->framenr, val};
+ MouseSelectUserData *data = userdata;
+ float co[2] = {marker->framenr, val};
- if(data->has_prev) {
- float d= dist_to_line_segment_v2(data->mouse_co, data->prev_co, co);
+ if (data->has_prev) {
+ float d = dist_to_line_segment_v2(data->mouse_co, data->prev_co, co);
- if(data->track==NULL || d<data->min_dist) {
- data->track= track;
- data->min_dist= d;
- data->coord= coord;
+ if (data->track == NULL || d < data->min_dist) {
+ data->track = track;
+ data->min_dist = d;
+ data->coord = coord;
copy_v2_v2(data->min_co, co);
}
}
- data->has_prev= 1;
+ data->has_prev = TRUE;
copy_v2_v2(data->prev_co, co);
}
void find_nearest_tracking_segment_end_cb(void *userdata)
{
- MouseSelectUserData *data= userdata;
+ MouseSelectUserData *data = userdata;
- data->has_prev= 0;
+ data->has_prev = FALSE;
}
static void find_nearest_tracking_knot_cb(void *userdata, MovieTrackingTrack *track,
- MovieTrackingMarker *marker, int coord, float val)
+ MovieTrackingMarker *marker, int coord, float val)
{
- MouseSelectUserData *data= userdata;
- float dx= marker->framenr-data->mouse_co[0], dy= val-data->mouse_co[1];
- float d= dx*dx+dy*dy;
+ MouseSelectUserData *data = userdata;
+ float dx = marker->framenr - data->mouse_co[0], dy = val - data->mouse_co[1];
+ float d = dx * dx + dy * dy;
- if(data->marker==NULL || d<data->min_dist) {
+ if (data->marker == NULL || d < data->min_dist) {
float co[2]= {marker->framenr, val};
- data->track= track;
- data->marker= marker;
- data->min_dist= d;
- data->coord= coord;
+ data->track = track;
+ data->marker = marker;
+ data->min_dist = d;
+ data->coord = coord;
copy_v2_v2(data->min_co, co);
}
@@ -158,78 +160,80 @@ static void find_nearest_tracking_knot_cb(void *userdata, MovieTrackingTrack *tr
static void mouse_select_init_data(MouseSelectUserData *userdata, float *co)
{
memset(userdata, 0, sizeof(MouseSelectUserData));
- userdata->min_dist= FLT_MAX;
+ userdata->min_dist = FLT_MAX;
copy_v2_v2(userdata->mouse_co, co);
}
static int mouse_select_knot(bContext *C, float co[2], int extend)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
MovieClip *clip= ED_space_clip(sc);
- ARegion *ar= CTX_wm_region(C);
- View2D *v2d= &ar->v2d;
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking);
- static const int delta= 6;
+ ARegion *ar = CTX_wm_region(C);
+ View2D *v2d = &ar->v2d;
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingTrack *act_track = BKE_tracking_active_track(tracking);
+ static const int delta = 6;
- if(act_track) {
+ if (act_track) {
MouseSelectUserData userdata;
mouse_select_init_data(&userdata, co);
- clip_graph_tracking_values_iterate_track(sc, act_track,
- &userdata, find_nearest_tracking_knot_cb, NULL, NULL);
+ clip_graph_tracking_values_iterate_track(sc, act_track, &userdata,
+ find_nearest_tracking_knot_cb, NULL, NULL);
- if(userdata.marker) {
+ if (userdata.marker) {
int x1, y1, x2, y2;
UI_view2d_view_to_region(v2d, co[0], co[1], &x1, &y1);
UI_view2d_view_to_region(v2d, userdata.min_co[0], userdata.min_co[1], &x2, &y2);
- if(abs(x2-x1)<=delta && abs(y2-y1)<=delta) {
- if(!extend) {
+ if (abs(x2 - x1) <= delta && abs(y2 - y1) <= delta) {
+ if (!extend) {
SelectUserData selectdata = {SEL_DESELECT};
+
clip_graph_tracking_iterate(sc, &selectdata, toggle_selection_cb);
}
- if(userdata.coord==0)
- userdata.marker->flag|= MARKER_GRAPH_SEL_X;
+ if (userdata.coord == 0)
+ userdata.marker->flag |= MARKER_GRAPH_SEL_X;
else
- userdata.marker->flag|= MARKER_GRAPH_SEL_Y;
+ userdata.marker->flag |= MARKER_GRAPH_SEL_Y;
- return 1;
+ return TRUE;
}
}
}
- return 0;
+ return FALSE;
}
static int mouse_select_curve(bContext *C, float co[2], int extend)
{
- 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);
+ 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);
MouseSelectUserData userdata;
mouse_select_init_data(&userdata, co);
- clip_graph_tracking_values_iterate(sc, &userdata, find_nearest_tracking_segment_cb, NULL, find_nearest_tracking_segment_end_cb);
+ clip_graph_tracking_values_iterate(sc, &userdata, find_nearest_tracking_segment_cb,
+ NULL, find_nearest_tracking_segment_end_cb);
- if(userdata.track) {
- if(extend) {
- if(act_track==userdata.track) {
+ if (userdata.track) {
+ if (extend) {
+ if (act_track == userdata.track) {
/* currently only single curve can be selected (selected curve represents active track) */
- act_track= NULL;
+ act_track = NULL;
}
}
- else if(act_track!=userdata.track) {
+ else if (act_track != userdata.track) {
MovieTrackingMarker *marker;
SelectUserData selectdata = {SEL_DESELECT};
- tracking->act_track= userdata.track;
+ tracking->act_track = userdata.track;
/* make active track be centered to screen */
- marker= BKE_tracking_get_marker(userdata.track, sc->user.framenr);
+ marker = BKE_tracking_get_marker(userdata.track, sc->user.framenr);
clip_view_center_to_point(sc, marker->pos[0], marker->pos[1]);
@@ -237,25 +241,25 @@ static int mouse_select_curve(bContext *C, float co[2], int extend)
clip_graph_tracking_iterate(sc, &selectdata, toggle_selection_cb);
}
- return 1;
+ return TRUE;
}
- return 0;
+ return FALSE;
}
static int mouse_select(bContext *C, float co[2], int extend)
{
- int sel= 0;
+ int sel = FALSE;
/* first try to select knot on selected curves */
- sel= mouse_select_knot(C, co, extend);
+ sel = mouse_select_knot(C, co, extend);
- if(!sel) {
+ if (!sel) {
/* if there's no close enough knot to mouse osition, select nearest curve */
- sel= mouse_select_curve(C, co, extend);
+ sel = mouse_select_curve(C, co, extend);
}
- if(sel)
+ if (sel)
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
return OPERATOR_FINISHED;
@@ -264,7 +268,7 @@ static int mouse_select(bContext *C, float co[2], int extend)
static int select_exec(bContext *C, wmOperator *op)
{
float co[2];
- int extend= RNA_boolean_get(op->ptr, "extend");
+ int extend = RNA_boolean_get(op->ptr, "extend");
RNA_float_get_array(op->ptr, "location", co);
@@ -273,7 +277,7 @@ static int select_exec(bContext *C, wmOperator *op)
static int select_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
float co[2];
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &co[0], &co[1]);
@@ -285,17 +289,17 @@ static int select_invoke(bContext *C, wmOperator *op, wmEvent *event)
void CLIP_OT_graph_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select";
- ot->description= "Select graph curves";
- ot->idname= "CLIP_OT_graph_select";
+ ot->name = "Select";
+ ot->description = "Select graph curves";
+ ot->idname = "CLIP_OT_graph_select";
/* api callbacks */
- ot->exec= select_exec;
- ot->invoke= select_invoke;
- ot->poll= ED_space_clip_graph_poll;
+ ot->exec = select_exec;
+ ot->invoke = select_invoke;
+ ot->poll = ED_space_clip_graph_poll;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* properties */
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX,
@@ -304,17 +308,169 @@ 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 = "(De)select 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))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
- MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
+ MovieTrackingTrack *act_track = BKE_tracking_active_track(tracking);
- if(act_track)
+ if (act_track)
clip_delete_track(C, clip, tracksbase, act_track);
return OPERATOR_FINISHED;
@@ -323,36 +479,36 @@ static int delete_curve_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_graph_delete_curve(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Curve";
- ot->description= "Delete selected curves";
- ot->idname= "CLIP_OT_graph_delete_curve";
+ ot->name = "Delete Curve";
+ ot->description = "Delete selected curves";
+ ot->idname = "CLIP_OT_graph_delete_curve";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= delete_curve_exec;
- ot->poll= ED_space_clip_poll;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = delete_curve_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/******************** delete knot operator ********************/
static int delete_knot_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
- MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
+ MovieTrackingTrack *act_track = BKE_tracking_active_track(tracking);
- if(act_track) {
- int a= 0;
+ if (act_track) {
+ int a = 0;
- while(a<act_track->markersnr) {
- MovieTrackingMarker *marker= &act_track->markers[a];
+ 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++;
@@ -365,16 +521,16 @@ static int delete_knot_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_graph_delete_knot(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Knot";
- ot->description= "Delete curve knots";
- ot->idname= "CLIP_OT_graph_delete_knot";
+ ot->name = "Delete Knot";
+ ot->description = "Delete curve knots";
+ ot->idname = "CLIP_OT_graph_delete_knot";
/* api callbacks */
- ot->exec= delete_knot_exec;
- ot->poll= ED_space_clip_graph_poll;
+ ot->exec = delete_knot_exec;
+ ot->poll = ED_space_clip_graph_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/******************** view all operator ********************/
@@ -386,10 +542,13 @@ typedef struct {
static void view_all_cb(void *userdata, MovieTrackingTrack *UNUSED(track), MovieTrackingMarker *UNUSED(marker),
int UNUSED(coord), float val)
{
- ViewAllUserData *data = (ViewAllUserData *)userdata;
+ ViewAllUserData *data = (ViewAllUserData *) userdata;
- if(val < data->min) data->min = val;
- if(val > data->max) data->max = val;
+ if (val < data->min)
+ data->min = val;
+
+ if (val > data->max)
+ data->max = val;
}
static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
@@ -407,8 +566,8 @@ static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
clip_graph_tracking_values_iterate(sc, &userdata, view_all_cb, NULL, NULL);
/* set extents of view to start/end frames */
- v2d->cur.xmin = (float)SFRA;
- v2d->cur.xmax = (float)EFRA;
+ v2d->cur.xmin = (float) SFRA;
+ v2d->cur.xmax = (float) EFRA;
if (userdata.min < userdata.max) {
v2d->cur.ymin = userdata.min;
@@ -420,11 +579,11 @@ static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
}
/* we need an extra "buffer" factor on either side so that the endpoints are visible */
- extra= 0.01f * (v2d->cur.xmax - v2d->cur.xmin);
+ extra = 0.01f * (v2d->cur.xmax - v2d->cur.xmin);
v2d->cur.xmin -= extra;
v2d->cur.xmax += extra;
- extra= 0.01f * (v2d->cur.ymax - v2d->cur.ymin);
+ extra = 0.01f * (v2d->cur.ymax - v2d->cur.ymin);
v2d->cur.ymin -= extra;
v2d->cur.ymax += extra;
@@ -480,3 +639,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..425a1da9ec5 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);
@@ -94,7 +97,7 @@ void clip_graph_tracking_values_iterate(struct SpaceClip *sc, void *userdata,
void (*segment_end) (void *userdata));
void clip_graph_tracking_iterate(struct SpaceClip *sc, void *userdata,
- void (*func) (void *userdata, struct MovieTrackingMarker *marker));
+ void (*func) (void *userdata, struct MovieTrackingMarker *marker));
void clip_delete_track(struct bContext *C, struct MovieClip *clip, struct ListBase *tracksbase, struct MovieTrackingTrack *track);
void clip_delete_marker(struct bContext *C, struct MovieClip *clip, struct ListBase *tracksbase, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker);
@@ -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..7e1bbc254e9 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.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
@@ -70,31 +70,31 @@
static void sclip_zoom_set(SpaceClip *sc, ARegion *ar, float zoom, float location[2])
{
- float oldzoom= sc->zoom;
+ float oldzoom = sc->zoom;
int width, height;
- sc->zoom= zoom;
+ sc->zoom = zoom;
if (sc->zoom < 0.1f || sc->zoom > 4.0f) {
/* check zoom limits */
ED_space_clip_size(sc, &width, &height);
- width*= sc->zoom;
- height*= sc->zoom;
+ width *= sc->zoom;
+ height *= sc->zoom;
- if((width < 4) && (height < 4))
- sc->zoom= oldzoom;
- else if((ar->winrct.xmax - ar->winrct.xmin) <= sc->zoom)
- sc->zoom= oldzoom;
- else if((ar->winrct.ymax - ar->winrct.ymin) <= sc->zoom)
- sc->zoom= oldzoom;
+ if ((width < 4) && (height < 4))
+ sc->zoom = oldzoom;
+ else if ((ar->winrct.xmax - ar->winrct.xmin) <= sc->zoom)
+ sc->zoom = oldzoom;
+ else if ((ar->winrct.ymax - ar->winrct.ymin) <= sc->zoom)
+ sc->zoom = oldzoom;
}
- if((U.uiflag & USER_ZOOM_TO_MOUSEPOS) && location) {
+ if ((U.uiflag & USER_ZOOM_TO_MOUSEPOS) && location) {
ED_space_clip_size(sc, &width, &height);
- sc->xof+= ((location[0]-0.5f)*width-sc->xof)*(sc->zoom-oldzoom)/sc->zoom;
- sc->yof+= ((location[1]-0.5f)*height-sc->yof)*(sc->zoom-oldzoom)/sc->zoom;
+ sc->xof += ((location[0] - 0.5f) * width-sc->xof) * (sc->zoom-oldzoom) / sc->zoom;
+ sc->yof += ((location[1] - 0.5f) * height-sc->yof) * (sc->zoom-oldzoom) / sc->zoom;
}
}
@@ -105,8 +105,8 @@ static void sclip_zoom_set_factor(SpaceClip *sc, ARegion *ar, float zoomfac, flo
static void sclip_zoom_set_factor_exec(bContext *C, wmEvent *event, float factor)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ ARegion *ar = CTX_wm_region(C);
float location[2], *mpos = NULL;
if (event) {
@@ -124,6 +124,7 @@ static void sclip_zoom_set_factor_exec(bContext *C, wmEvent *event, float factor
static void clip_filesel(bContext *C, wmOperator *op, const char *path)
{
RNA_string_set(op->ptr, "filepath", path);
+
WM_event_add_fileselect(C, op);
}
@@ -131,35 +132,35 @@ static void open_init(bContext *C, wmOperator *op)
{
PropertyPointerRNA *pprop;
- op->customdata= pprop= MEM_callocN(sizeof(PropertyPointerRNA), "OpenPropertyPointerRNA");
+ op->customdata = pprop = MEM_callocN(sizeof(PropertyPointerRNA), "OpenPropertyPointerRNA");
uiIDContextProperty(C, &pprop->ptr, &pprop->prop);
}
static int open_cancel(bContext *UNUSED(C), wmOperator *op)
{
MEM_freeN(op->customdata);
- op->customdata= NULL;
+ op->customdata = NULL;
return OPERATOR_CANCELLED;
}
static int open_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
PropertyPointerRNA *pprop;
PointerRNA idptr;
- MovieClip *clip= NULL;
+ MovieClip *clip = NULL;
char str[FILE_MAX];
RNA_string_get(op->ptr, "filepath", str);
/* default to frame 1 if there's no scene in context */
- errno= 0;
+ errno = 0;
- clip= BKE_add_movieclip_file(str);
+ clip = BKE_add_movieclip_file(str);
- if(!clip) {
- if(op->customdata)
+ if (!clip) {
+ if (op->customdata)
MEM_freeN(op->customdata);
BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s.", str, errno ? strerror(errno) : "Unsupported movie clip format");
@@ -167,13 +168,13 @@ static int open_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- if(!op->customdata)
+ if (!op->customdata)
open_init(C, op);
/* hook into UI */
- pprop= op->customdata;
+ pprop = op->customdata;
- if(pprop->prop) {
+ if (pprop->prop) {
/* when creating new ID blocks, use is already 1, but RNA
* pointer se also increases user, so this compensates it */
clip->id.us--;
@@ -182,7 +183,7 @@ static int open_exec(bContext *C, wmOperator *op)
RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr);
RNA_property_update(C, &pprop->ptr, pprop->prop);
}
- else if(sc) {
+ else if (sc) {
ED_space_clip_set(C, sc, clip);
}
@@ -195,20 +196,20 @@ static int open_exec(bContext *C, wmOperator *op)
static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- char *path= U.textudir;
- MovieClip *clip= NULL;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ char *path = U.textudir;
+ MovieClip *clip = NULL;
- if(sc)
- clip= ED_space_clip(sc);
+ if (sc)
+ clip = ED_space_clip(sc);
- if(clip)
- path= clip->name;
+ if (clip)
+ path = clip->name;
- if(!RNA_struct_property_is_set(op->ptr, "relative_path"))
+ if (!RNA_struct_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
- if(RNA_struct_property_is_set(op->ptr, "filepath"))
+ if (RNA_struct_property_is_set(op->ptr, "filepath"))
return open_exec(C, op);
open_init(C, op);
@@ -221,17 +222,17 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CLIP_OT_open(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Open Clip";
- ot->description= "Load a sequence of frames or a movie file";
- ot->idname= "CLIP_OT_open";
+ ot->name = "Open Clip";
+ ot->description = "Load a sequence of frames or a movie file";
+ ot->idname = "CLIP_OT_open";
/* api callbacks */
- ot->exec= open_exec;
- ot->invoke= open_invoke;
- ot->cancel= open_cancel;
+ ot->exec = open_exec;
+ ot->invoke = open_invoke;
+ ot->cancel = open_cancel;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
@@ -241,9 +242,9 @@ void CLIP_OT_open(wmOperatorType *ot)
static int reload_exec(bContext *C, wmOperator *UNUSED(op))
{
- MovieClip *clip= CTX_data_edit_movieclip(C);
+ MovieClip *clip = CTX_data_edit_movieclip(C);
- if(!clip)
+ if (!clip)
return OPERATOR_CANCELLED;
BKE_movieclip_reload(clip);
@@ -256,12 +257,12 @@ static int reload_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_reload(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reload Clip";
- ot->description= "Reload clip";
- ot->idname= "CLIP_OT_reload";
+ ot->name = "Reload Clip";
+ ot->description = "Reload clip";
+ ot->idname = "CLIP_OT_reload";
/* api callbacks */
- ot->exec= reload_exec;
+ ot->exec = reload_exec;
}
/********************** view pan operator *********************/
@@ -275,17 +276,19 @@ typedef struct ViewPanData {
static void view_pan_init(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
ViewPanData *vpd;
- op->customdata= vpd= MEM_callocN(sizeof(ViewPanData), "ClipViewPanData");
+ op->customdata = vpd = MEM_callocN(sizeof(ViewPanData), "ClipViewPanData");
WM_cursor_modal(CTX_wm_window(C), BC_NSEW_SCROLLCURSOR);
- vpd->x= event->x;
- vpd->y= event->y;
+ vpd->x = event->x;
+ vpd->y = event->y;
- if(sc->flag&SC_LOCK_SELECTION) vpd->vec= &sc->xlockof;
- else vpd->vec= &sc->xof;
+ if (sc->flag & SC_LOCK_SELECTION)
+ vpd->vec= &sc->xlockof;
+ else
+ vpd->vec= &sc->xof;
copy_v2_v2(&vpd->xof, vpd->vec);
copy_v2_v2(&vpd->xorig, &vpd->xof);
@@ -297,9 +300,9 @@ static void view_pan_init(bContext *C, wmOperator *op, wmEvent *event)
static void view_pan_exit(bContext *C, wmOperator *op, int cancel)
{
- ViewPanData *vpd= op->customdata;
+ ViewPanData *vpd = op->customdata;
- if(cancel) {
+ if (cancel) {
copy_v2_v2(vpd->vec, &vpd->xorig);
ED_region_tag_redraw(CTX_wm_region(C));
@@ -311,17 +314,18 @@ static void view_pan_exit(bContext *C, wmOperator *op, int cancel)
static int view_pan_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
float offset[2];
RNA_float_get_array(op->ptr, "offset", offset);
- if(sc->flag&SC_LOCK_SELECTION) {
- sc->xlockof+= offset[0];
- sc->ylockof+= offset[1];
- } else {
- sc->xof+= offset[0];
- sc->yof+= offset[1];
+ if (sc->flag & SC_LOCK_SELECTION) {
+ sc->xlockof += offset[0];
+ sc->ylockof += offset[1];
+ }
+ else {
+ sc->xof += offset[0];
+ sc->yof += offset[1];
}
ED_region_tag_redraw(CTX_wm_region(C));
@@ -331,47 +335,52 @@ static int view_pan_exec(bContext *C, wmOperator *op)
static int view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if (event->type==MOUSEPAN) {
- SpaceClip *sc= CTX_wm_space_clip(C);
+ if (event->type == MOUSEPAN) {
+ SpaceClip *sc = CTX_wm_space_clip(C);
float offset[2];
- offset[0]= (event->x - event->prevx)/sc->zoom;
- offset[1]= (event->y - event->prevy)/sc->zoom;
+ offset[0] = (event->x - event->prevx) / sc->zoom;
+ offset[1] = (event->y - event->prevy) / sc->zoom;
RNA_float_set_array(op->ptr, "offset", offset);
view_pan_exec(C, op);
+
return OPERATOR_FINISHED;
}
else {
view_pan_init(C, op, event);
+
return OPERATOR_RUNNING_MODAL;
}
}
static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- ViewPanData *vpd= op->customdata;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ ViewPanData *vpd = op->customdata;
float offset[2];
switch(event->type) {
case MOUSEMOVE:
copy_v2_v2(vpd->vec, &vpd->xorig);
- offset[0]= (vpd->x - event->x)/sc->zoom;
- offset[1]= (vpd->y - event->y)/sc->zoom;
+ offset[0] = (vpd->x - event->x) / sc->zoom;
+ offset[1] = (vpd->y - event->y) / sc->zoom;
RNA_float_set_array(op->ptr, "offset", offset);
view_pan_exec(C, op);
break;
case ESCKEY:
view_pan_exit(C, op, 1);
+
return OPERATOR_CANCELLED;
case SPACEKEY:
view_pan_exit(C, op, 0);
+
return OPERATOR_FINISHED;
default:
- if(event->type==vpd->event_type && event->val==KM_RELEASE) {
+ if (event->type == vpd->event_type && event->val == KM_RELEASE) {
view_pan_exit(C, op, 0);
+
return OPERATOR_FINISHED;
}
break;
@@ -390,18 +399,18 @@ static int view_pan_cancel(bContext *C, wmOperator *op)
void CLIP_OT_view_pan(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Pan";
- ot->idname= "CLIP_OT_view_pan";
+ ot->name = "View Pan";
+ ot->idname = "CLIP_OT_view_pan";
/* api callbacks */
- ot->exec= view_pan_exec;
- ot->invoke= view_pan_invoke;
- ot->modal= view_pan_modal;
- ot->cancel= view_pan_cancel;
- ot->poll= ED_space_clip_poll;
+ ot->exec = view_pan_exec;
+ ot->invoke = view_pan_invoke;
+ ot->modal = view_pan_modal;
+ ot->cancel = view_pan_cancel;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
/* properties */
RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX,
@@ -419,16 +428,16 @@ typedef struct ViewZoomData {
static void view_zoom_init(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
ViewZoomData *vpd;
op->customdata= vpd= MEM_callocN(sizeof(ViewZoomData), "ClipViewZoomData");
WM_cursor_modal(CTX_wm_window(C), BC_NSEW_SCROLLCURSOR);
- vpd->x= event->x;
- vpd->y= event->y;
- vpd->zoom= sc->zoom;
- vpd->event_type= event->type;
+ vpd->x = event->x;
+ vpd->y = event->y;
+ vpd->zoom = sc->zoom;
+ vpd->event_type = event->type;
ED_clip_mouse_pos(C, event, vpd->location);
@@ -437,11 +446,11 @@ static void view_zoom_init(bContext *C, wmOperator *op, wmEvent *event)
static void view_zoom_exit(bContext *C, wmOperator *op, int cancel)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- ViewZoomData *vpd= op->customdata;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ ViewZoomData *vpd = op->customdata;
- if(cancel) {
- sc->zoom= vpd->zoom;
+ if (cancel) {
+ sc->zoom = vpd->zoom;
ED_region_tag_redraw(CTX_wm_region(C));
}
@@ -451,8 +460,8 @@ static void view_zoom_exit(bContext *C, wmOperator *op, int cancel)
static int view_zoom_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ ARegion *ar = CTX_wm_region(C);
sclip_zoom_set_factor(sc, ar, RNA_float_get(op->ptr, "factor"), NULL);
@@ -463,10 +472,10 @@ static int view_zoom_exec(bContext *C, wmOperator *op)
static int view_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if (event->type==MOUSEZOOM) {
+ if (event->type == MOUSEZOOM) {
float factor;
- factor= 1.0f + (event->x-event->prevx+event->y-event->prevy)/300.0f;
+ factor = 1.0f + (event->x - event->prevx + event->y - event->prevy) / 300.0f;
RNA_float_set(op->ptr, "factor", factor);
sclip_zoom_set_factor_exec(C, event, factor);
@@ -482,21 +491,22 @@ static int view_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int view_zoom_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- ARegion *ar= CTX_wm_region(C);
- ViewZoomData *vpd= op->customdata;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ ARegion *ar = CTX_wm_region(C);
+ ViewZoomData *vpd = op->customdata;
float factor;
switch(event->type) {
case MOUSEMOVE:
- factor= 1.0f + (vpd->x-event->x+vpd->y-event->y)/300.0f;
+ factor = 1.0f + (vpd->x-event->x + vpd->y - event->y) / 300.0f;
RNA_float_set(op->ptr, "factor", factor);
- sclip_zoom_set(sc, ar, vpd->zoom*factor, vpd->location);
+ sclip_zoom_set(sc, ar, vpd->zoom * factor, vpd->location);
ED_region_tag_redraw(CTX_wm_region(C));
break;
default:
- if(event->type==vpd->event_type && event->val==KM_RELEASE) {
+ if (event->type == vpd->event_type && event->val == KM_RELEASE) {
view_zoom_exit(C, op, 0);
+
return OPERATOR_FINISHED;
}
break;
@@ -508,24 +518,25 @@ static int view_zoom_modal(bContext *C, wmOperator *op, wmEvent *event)
static int view_zoom_cancel(bContext *C, wmOperator *op)
{
view_zoom_exit(C, op, 1);
+
return OPERATOR_CANCELLED;
}
void CLIP_OT_view_zoom(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Zoom";
- ot->idname= "CLIP_OT_view_zoom";
+ ot->name = "View Zoom";
+ ot->idname = "CLIP_OT_view_zoom";
/* api callbacks */
- ot->exec= view_zoom_exec;
- ot->invoke= view_zoom_invoke;
- ot->modal= view_zoom_modal;
- ot->cancel= view_zoom_cancel;
- ot->poll= ED_space_clip_poll;
+ ot->exec = view_zoom_exec;
+ ot->invoke = view_zoom_invoke;
+ ot->modal = view_zoom_modal;
+ ot->cancel = view_zoom_cancel;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
+ ot->flag = OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
/* properties */
RNA_def_float(ot->srna, "factor", 0.0f, 0.0f, FLT_MAX,
@@ -536,8 +547,8 @@ void CLIP_OT_view_zoom(wmOperatorType *ot)
static int view_zoom_in_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ ARegion *ar = CTX_wm_region(C);
float location[2];
RNA_float_get_array(op->ptr, "location", location);
@@ -562,13 +573,13 @@ static int view_zoom_in_invoke(bContext *C, wmOperator *op, wmEvent *event)
void CLIP_OT_view_zoom_in(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Zoom In";
- ot->idname= "CLIP_OT_view_zoom_in";
+ ot->name = "View Zoom In";
+ ot->idname = "CLIP_OT_view_zoom_in";
/* api callbacks */
- ot->exec= view_zoom_in_exec;
- ot->invoke= view_zoom_in_invoke;
- ot->poll= ED_space_clip_poll;
+ ot->exec = view_zoom_in_exec;
+ ot->invoke = view_zoom_in_invoke;
+ ot->poll = ED_space_clip_poll;
/* properties */
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in screen coordinates", -10.0f, 10.0f);
@@ -576,8 +587,8 @@ void CLIP_OT_view_zoom_in(wmOperatorType *ot)
static int view_zoom_out_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ ARegion *ar = CTX_wm_region(C);
float location[2];
RNA_float_get_array(op->ptr, "location", location);
@@ -602,13 +613,13 @@ static int view_zoom_out_invoke(bContext *C, wmOperator *op, wmEvent *event)
void CLIP_OT_view_zoom_out(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Zoom Out";
- ot->idname= "CLIP_OT_view_zoom_out";
+ ot->name = "View Zoom Out";
+ ot->idname = "CLIP_OT_view_zoom_out";
/* api callbacks */
- ot->exec= view_zoom_out_exec;
- ot->invoke= view_zoom_out_invoke;
- ot->poll= ED_space_clip_poll;
+ ot->exec = view_zoom_out_exec;
+ ot->invoke = view_zoom_out_invoke;
+ ot->poll = ED_space_clip_poll;
/* properties */
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in normalised (0.0-1.0) coordinates", -10.0f, 10.0f);
@@ -618,14 +629,14 @@ void CLIP_OT_view_zoom_out(wmOperatorType *ot)
static int view_zoom_ratio_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ ARegion *ar = CTX_wm_region(C);
sclip_zoom_set(sc, ar, RNA_float_get(op->ptr, "ratio"), NULL);
/* ensure pixel exact locations for draw */
- sc->xof= (int)sc->xof;
- sc->yof= (int)sc->yof;
+ sc->xof= (int) sc->xof;
+ sc->yof= (int) sc->yof;
ED_region_tag_redraw(CTX_wm_region(C));
@@ -635,12 +646,12 @@ static int view_zoom_ratio_exec(bContext *C, wmOperator *op)
void CLIP_OT_view_zoom_ratio(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Zoom Ratio";
- ot->idname= "CLIP_OT_view_zoom_ratio";
+ ot->name = "View Zoom Ratio";
+ ot->idname = "CLIP_OT_view_zoom_ratio";
/* api callbacks */
- ot->exec= view_zoom_ratio_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = view_zoom_ratio_exec;
+ ot->poll = ED_space_clip_poll;
/* properties */
RNA_def_float(ot->srna, "ratio", 0.0f, 0.0f, FLT_MAX,
@@ -649,39 +660,50 @@ 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);
- ar= CTX_wm_region(C);
+ sc = CTX_wm_space_clip(C);
+ ar = CTX_wm_region(C);
ED_space_clip_size(sc, &w, &h);
ED_space_clip_aspect(sc, &aspx, &aspy);
- w= w*aspx;
- h= h*aspy;
+ w = w * aspx;
+ h = h * aspy;
/* check if the image will fit in the image with zoom==1 */
- width= ar->winrct.xmax - ar->winrct.xmin + 1;
- height= ar->winrct.ymax - ar->winrct.ymin + 1;
+ width = ar->winrct.xmax - ar->winrct.xmin + 1;
+ height = ar->winrct.ymax - ar->winrct.ymin + 1;
+
+ if (fit_view) {
+ const int margin = 5; /* margin from border */
- if((w >= width || h >= height) && (width > 0 && height > 0)) {
- float zoomx, zoomy;
+ zoomx= (float) width / (w + 2 * margin);
+ zoomy= (float) height / (h + 2 * margin);
- /* 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);
+ sclip_zoom_set(sc, ar, MIN2(zoomx, zoomy), NULL);
}
- else
- sclip_zoom_set(sc, ar, 1.0f, NULL);
+ else {
+ if ((w >= width || h >= height) && (width > 0 && height > 0)) {
+ zoomx= (float) width / w;
+ zoomy= (float) height / h;
- sc->xof= sc->yof= 0.0f;
+ /* 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);
+ }
+
+ sc->xof = sc->yof = 0.0f;
ED_region_tag_redraw(CTX_wm_region(C));
@@ -691,23 +713,26 @@ static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_view_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View All";
- ot->idname= "CLIP_OT_view_all";
+ ot->name = "View All";
+ ot->idname = "CLIP_OT_view_all";
/* api callbacks */
- ot->exec= view_all_exec;
- ot->poll= ED_space_clip_poll;
+ 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 *********************/
static int view_selected_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ ARegion *ar = CTX_wm_region(C);
- sc->xlockof= 0.0f;
- sc->ylockof= 0.0f;
+ sc->xlockof = 0.0f;
+ sc->ylockof = 0.0f;
ED_clip_view_selection(sc, ar, 1);
ED_region_tag_redraw(CTX_wm_region(C));
@@ -718,12 +743,12 @@ static int view_selected_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_view_selected(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Selected";
- ot->idname= "CLIP_OT_view_selected";
+ ot->name = "View Selected";
+ ot->idname = "CLIP_OT_view_selected";
/* api callbacks */
- ot->exec= view_selected_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = view_selected_exec;
+ ot->poll = ED_space_clip_poll;
}
/********************** change frame operator *********************/
@@ -731,7 +756,7 @@ void CLIP_OT_view_selected(wmOperatorType *ot)
static int change_frame_poll(bContext *C)
{
/* prevent changes during render */
- if(G.rendering)
+ if (G.rendering)
return 0;
return ED_space_clip_poll(C);
@@ -739,10 +764,10 @@ static int change_frame_poll(bContext *C)
static void change_frame_apply(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
/* set the new frame number */
- CFRA= RNA_int_get(op->ptr, "frame");
+ CFRA = RNA_int_get(op->ptr, "frame");
FRAMENUMBER_MIN_CLAMP(CFRA);
SUBFRA = 0.0f;
@@ -760,20 +785,21 @@ static int change_frame_exec(bContext *C, wmOperator *op)
static int frame_from_event(bContext *C, wmEvent *event)
{
- ARegion *ar= CTX_wm_region(C);
- Scene *scene= CTX_data_scene(C);
- int framenr= 0;
+ ARegion *ar = CTX_wm_region(C);
+ Scene *scene = CTX_data_scene(C);
+ int framenr = 0;
- if(ar->regiontype == RGN_TYPE_WINDOW) {
- float sfra= SFRA, efra= EFRA, framelen= ar->winx/(efra-sfra+1);
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
+ float sfra = SFRA, efra = EFRA, framelen = ar->winx / (efra - sfra + 1);
- framenr= sfra+event->mval[0]/framelen;
- } else {
+ framenr = sfra + event->mval[0] / framelen;
+ }
+ else {
float viewx, viewy;
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &viewx, &viewy);
- framenr= (int)floor(viewx+0.5f);
+ framenr= (int) floor(viewx + 0.5f);
}
return framenr;
@@ -781,10 +807,10 @@ static int frame_from_event(bContext *C, wmEvent *event)
static int change_frame_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
- if(ar->regiontype == RGN_TYPE_WINDOW) {
- if(event->mval[1]>16)
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
+ if (event->mval[1] > 16)
return OPERATOR_PASS_THROUGH;
}
@@ -811,7 +837,7 @@ static int change_frame_modal(bContext *C, wmOperator *op, wmEvent *event)
case LEFTMOUSE:
case RIGHTMOUSE:
- if (event->val==KM_RELEASE)
+ if (event->val == KM_RELEASE)
return OPERATOR_FINISHED;
break;
}
@@ -822,18 +848,18 @@ static int change_frame_modal(bContext *C, wmOperator *op, wmEvent *event)
void CLIP_OT_change_frame(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Change frame";
- ot->idname= "CLIP_OT_change_frame";
- ot->description= "Interactively change the current frame number";
+ ot->name = "Change frame";
+ ot->idname = "CLIP_OT_change_frame";
+ ot->description = "Interactively change the current frame number";
/* api callbacks */
- ot->exec= change_frame_exec;
- ot->invoke= change_frame_invoke;
- ot->modal= change_frame_modal;
- ot->poll= change_frame_poll;
+ ot->exec = change_frame_exec;
+ ot->invoke = change_frame_invoke;
+ ot->modal = change_frame_modal;
+ ot->poll = change_frame_poll;
/* flags */
- ot->flag= OPTYPE_BLOCKING|OPTYPE_UNDO;
+ ot->flag = OPTYPE_BLOCKING|OPTYPE_UNDO;
/* rna */
RNA_def_int(ot->srna, "frame", 0, MINAFRAME, MAXFRAME, "Frame", "", MINAFRAME, MAXFRAME);
@@ -861,18 +887,25 @@ static int proxy_bitflag_to_array(int size_flag, int build_sizes[4], int undisto
int build_count = 0;
int size_flags[2][4] = {{MCLIP_PROXY_SIZE_25,
MCLIP_PROXY_SIZE_50,
- MCLIP_PROXY_SIZE_75,
- MCLIP_PROXY_SIZE_100},
- {MCLIP_PROXY_UNDISTORTED_SIZE_25,
- MCLIP_PROXY_UNDISTORTED_SIZE_50,
- MCLIP_PROXY_UNDISTORTED_SIZE_75,
- MCLIP_PROXY_UNDISTORTED_SIZE_100}};
+ MCLIP_PROXY_SIZE_75,
+ MCLIP_PROXY_SIZE_100},
+ {MCLIP_PROXY_UNDISTORTED_SIZE_25,
+ MCLIP_PROXY_UNDISTORTED_SIZE_50,
+ MCLIP_PROXY_UNDISTORTED_SIZE_75,
+ MCLIP_PROXY_UNDISTORTED_SIZE_100}};
int size_nr = undistort ? 1 : 0;
- if(size_flag & size_flags[size_nr][0]) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_25;
- if(size_flag & size_flags[size_nr][1]) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_50;
- if(size_flag & size_flags[size_nr][2]) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_75;
- if(size_flag & size_flags[size_nr][3]) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_100;
+ if (size_flag & size_flags[size_nr][0])
+ build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_25;
+
+ if (size_flag & size_flags[size_nr][1])
+ build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_50;
+
+ if (size_flag & size_flags[size_nr][2])
+ build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_75;
+
+ if (size_flag & size_flags[size_nr][3])
+ build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_100;
return build_count;
}
@@ -880,55 +913,53 @@ static int proxy_bitflag_to_array(int size_flag, int build_sizes[4], int undisto
/* only this runs inside thread */
static void proxy_startjob(void *pjv, short *stop, short *do_update, float *progress)
{
- ProxyJob *pj= pjv;
- Scene *scene=pj->scene;
- MovieClip *clip= pj->clip;
- struct MovieDistortion *distortion= NULL;
- short tc_flag, size_flag, quality;
- 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);
-
- if(clip->source == MCLIP_SRC_MOVIE) {
+ ProxyJob *pj = pjv;
+ Scene *scene = pj->scene;
+ MovieClip *clip = pj->clip;
+ struct MovieDistortion *distortion = NULL;
+ 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;
+
+ size_flag = clip->proxy.build_size_flag;
+
+ build_count = proxy_bitflag_to_array(size_flag, build_sizes, 0);
+ build_undistort_count = proxy_bitflag_to_array(size_flag, build_undistort_sizes, 1);
+
+ if (clip->source == MCLIP_SRC_MOVIE) {
if (pj->index_context)
IMB_anim_index_rebuild(pj->index_context, stop, do_update, progress);
- if(!build_undistort_count) {
+ if (!build_undistort_count) {
if (*stop)
pj->stop = 1;
return;
}
else {
- sfra= 1;
- efra= IMB_anim_get_duration(clip->anim, IMB_TC_NONE);
+ sfra = 1;
+ efra = IMB_anim_get_duration(clip->anim, IMB_TC_NONE);
}
}
- if(build_undistort_count)
- distortion= BKE_tracking_distortion_create();
+ if (build_undistort_count)
+ distortion = BKE_tracking_distortion_create();
- for(cfra= sfra; cfra<=efra; cfra++) {
- if(clip->source != MCLIP_SRC_MOVIE)
+ for (cfra = sfra; cfra <= efra; cfra++) {
+ if (clip->source != MCLIP_SRC_MOVIE)
BKE_movieclip_build_proxy_frame(clip, pj->clip_flag, NULL, cfra, build_sizes, build_count, 0);
BKE_movieclip_build_proxy_frame(clip, pj->clip_flag, distortion, cfra, build_undistort_sizes, build_undistort_count, 1);
- if(*stop || G.afbreek)
+ if (*stop || G.afbreek)
break;
- *do_update= 1;
- *progress= ((float)cfra)/(efra-sfra);
+ *do_update = TRUE;
+ *progress= ((float) cfra) / (efra - sfra);
}
- if(distortion)
+ if (distortion)
BKE_tracking_distortion_destroy(distortion);
if (*stop)
@@ -954,21 +985,21 @@ static int clip_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
{
wmJob * steve;
ProxyJob *pj;
- Scene *scene= CTX_data_scene(C);
- ScrArea *sa= CTX_wm_area(C);
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ Scene *scene = CTX_data_scene(C);
+ ScrArea *sa = CTX_wm_area(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
- if((clip->flag&MCLIP_USE_PROXY)==0)
+ if ((clip->flag & MCLIP_USE_PROXY) == 0)
return OPERATOR_CANCELLED;
- steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), sa, "Building Proxies", WM_JOB_PROGRESS);
+ steve = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), sa, "Building Proxies", WM_JOB_PROGRESS);
- pj= MEM_callocN(sizeof(ProxyJob), "proxy rebuild job");
- pj->scene= scene;
- pj->main= CTX_data_main(C);
- pj->clip= clip;
- pj->clip_flag= clip->flag&MCLIP_TIMECODE_FLAGS;
+ pj = MEM_callocN(sizeof(ProxyJob), "proxy rebuild job");
+ pj->scene = scene;
+ pj->main = CTX_data_main(C);
+ pj->clip = clip;
+ pj->clip_flag = clip->flag & MCLIP_TIMECODE_FLAGS;
if (clip->anim) {
pj->index_context = IMB_anim_index_rebuild_context(clip->anim, clip->proxy.build_tc_flag,
@@ -979,7 +1010,7 @@ static int clip_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
WM_jobs_timer(steve, 0.2, NC_MOVIECLIP|ND_DISPLAY, 0);
WM_jobs_callbacks(steve, proxy_startjob, NULL, NULL, proxy_endjob);
- G.afbreek= 0;
+ G.afbreek = 0;
WM_jobs_start(CTX_wm_manager(C), steve);
ED_area_tag_redraw(CTX_wm_area(C));
@@ -990,31 +1021,32 @@ static int clip_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_rebuild_proxy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Rebuild Proxy and Timecode Indices";
- ot->idname= "CLIP_OT_rebuild_proxy";
- ot->description= "Rebuild all selected proxies and timecode indices in the background";
+ ot->name = "Rebuild Proxy and Timecode Indices";
+ ot->idname = "CLIP_OT_rebuild_proxy";
+ ot->description = "Rebuild all selected proxies and timecode indices in the background";
/* api callbacks */
- ot->exec= clip_rebuild_proxy_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = clip_rebuild_proxy_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
}
/********************** mode set operator *********************/
static int mode_set_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- int mode= RNA_enum_get(op->ptr, "mode");
- int toggle= RNA_boolean_get(op->ptr, "toggle");
-
- if(sc->mode==mode) {
- if(toggle)
- sc->mode= SC_MODE_TRACKING;
- } else {
- sc->mode= mode;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ int mode = RNA_enum_get(op->ptr, "mode");
+ int toggle = RNA_boolean_get(op->ptr, "toggle");
+
+ if (sc->mode == mode) {
+ if (toggle)
+ sc->mode = SC_MODE_TRACKING;
+ }
+ else {
+ sc->mode = mode;
}
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_CLIP, NULL);
@@ -1032,14 +1064,14 @@ void CLIP_OT_mode_set(wmOperatorType *ot)
/* identifiers */
- ot->name= "Set Clip Mode";
+ ot->name = "Set Clip Mode";
ot->description = "Set the clip interaction mode";
- ot->idname= "CLIP_OT_mode_set";
+ ot->idname = "CLIP_OT_mode_set";
/* api callbacks */
- ot->exec= mode_set_exec;
+ ot->exec = mode_set_exec;
- ot->poll= ED_space_clip_poll;
+ ot->poll = ED_space_clip_poll;
/* properties */
RNA_def_enum(ot->srna, "mode", mode_items, SC_MODE_TRACKING, "Mode", "");
@@ -1053,15 +1085,15 @@ void ED_operatormacros_clip(void)
wmOperatorType *ot;
wmOperatorTypeMacro *otmacro;
- ot= WM_operatortype_append_macro("CLIP_OT_add_marker_move", "Add Marker and Move", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("CLIP_OT_add_marker_move", "Add Marker and Move", OPTYPE_UNDO|OPTYPE_REGISTER);
ot->description = "Add new marker and move it on movie";
WM_operatortype_macro_define(ot, "CLIP_OT_add_marker");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_struct_idprops_unset(otmacro->ptr, "release_confirm");
- ot= WM_operatortype_append_macro("CLIP_OT_add_marker_slide", "Add Marker and Slide", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("CLIP_OT_add_marker_slide", "Add Marker and Slide", OPTYPE_UNDO|OPTYPE_REGISTER);
ot->description = "Add new marker and slide it with mouse until mouse button release";
WM_operatortype_macro_define(ot, "CLIP_OT_add_marker");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_boolean_set(otmacro->ptr, "release_confirm", TRUE);
}
diff --git a/source/blender/editors/space_clip/clip_toolbar.c b/source/blender/editors/space_clip/clip_toolbar.c
index d90f429a206..b80deb8260a 100644
--- a/source/blender/editors/space_clip/clip_toolbar.c
+++ b/source/blender/editors/space_clip/clip_toolbar.c
@@ -60,24 +60,24 @@ static ARegion *clip_has_properties_region(ScrArea *sa)
{
ARegion *ar, *arnew;
- ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
- if(ar)
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_UI);
+ if (ar)
return ar;
/* add subdiv level; after header */
- ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
/* is error! */
- if(ar==NULL)
+ if (ar == NULL)
return NULL;
- arnew= MEM_callocN(sizeof(ARegion), "clip properties region");
+ arnew = MEM_callocN(sizeof(ARegion), "clip properties region");
BLI_insertlinkafter(&sa->regionbase, ar, arnew);
- arnew->regiontype= RGN_TYPE_UI;
- arnew->alignment= RGN_ALIGN_RIGHT;
+ arnew->regiontype = RGN_TYPE_UI;
+ arnew->alignment = RGN_ALIGN_RIGHT;
- arnew->flag= RGN_FLAG_HIDDEN;
+ arnew->flag = RGN_FLAG_HIDDEN;
return arnew;
}
@@ -89,10 +89,10 @@ static int properties_poll(bContext *C)
static int properties_exec(bContext *C, wmOperator *UNUSED(op))
{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= clip_has_properties_region(sa);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = clip_has_properties_region(sa);
- if(ar)
+ if (ar)
ED_region_toggle_hidden(C, ar);
return OPERATOR_FINISHED;
@@ -101,56 +101,57 @@ static int properties_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_properties(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Properties";
- ot->description= "Toggle clip properties panel";
- ot->idname= "CLIP_OT_properties";
+ ot->name = "Properties";
+ ot->description = "Toggle clip properties panel";
+ ot->idname = "CLIP_OT_properties";
/* api callbacks */
- ot->exec= properties_exec;
- ot->poll= properties_poll;
+ ot->exec = properties_exec;
+ ot->poll = properties_poll;
}
/************************** tools ******************************/
static ARegion *clip_has_tools_region(ScrArea *sa)
{
- ARegion *ar, *artool=NULL, *arprops=NULL, *arhead;
+ ARegion *ar, *artool = NULL, *arprops = NULL, *arhead;
- for(ar= sa->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype==RGN_TYPE_TOOLS)
- artool= ar;
- if(ar->regiontype==RGN_TYPE_TOOL_PROPS)
- arprops= ar;
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar->regiontype == RGN_TYPE_TOOLS)
+ artool = ar;
+
+ if (ar->regiontype == RGN_TYPE_TOOL_PROPS)
+ arprops = ar;
}
/* tool region hide/unhide also hides props */
- if(arprops && artool)
+ if (arprops && artool)
return artool;
- if(artool==NULL) {
+ if (artool == NULL) {
/* add subdiv level; after header */
- arhead= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
+ arhead = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
/* is error! */
- if(arhead==NULL)
+ if (arhead == NULL)
return NULL;
- artool= MEM_callocN(sizeof(ARegion), "clip tools region");
+ artool = MEM_callocN(sizeof(ARegion), "clip tools region");
BLI_insertlinkafter(&sa->regionbase, arhead, artool);
- artool->regiontype= RGN_TYPE_TOOLS;
- artool->alignment= RGN_ALIGN_LEFT;
+ artool->regiontype = RGN_TYPE_TOOLS;
+ artool->alignment = RGN_ALIGN_LEFT;
- artool->flag= RGN_FLAG_HIDDEN;
+ artool->flag = RGN_FLAG_HIDDEN;
}
- if(arprops==NULL) {
+ if (arprops == NULL) {
/* add extra subdivided region for tool properties */
- arprops= MEM_callocN(sizeof(ARegion), "tool props for clip");
+ arprops = MEM_callocN(sizeof(ARegion), "tool props for clip");
BLI_insertlinkafter(&sa->regionbase, artool, arprops);
- arprops->regiontype= RGN_TYPE_TOOL_PROPS;
- arprops->alignment= RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV;
+ arprops->regiontype = RGN_TYPE_TOOL_PROPS;
+ arprops->alignment = RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV;
}
return artool;
@@ -163,10 +164,10 @@ static int tools_poll(bContext *C)
static int tools_exec(bContext *C, wmOperator *UNUSED(op))
{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= clip_has_tools_region(sa);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = clip_has_tools_region(sa);
- if(ar)
+ if (ar)
ED_region_toggle_hidden(C, ar);
return OPERATOR_FINISHED;
@@ -175,13 +176,13 @@ static int tools_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_tools(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Tools";
- ot->description= "Toggle clip tools panel";
- ot->idname= "CLIP_OT_tools";
+ ot->name = "Tools";
+ ot->description = "Toggle clip tools panel";
+ ot->idname = "CLIP_OT_tools";
/* api callbacks */
- ot->exec= tools_exec;
- ot->poll= tools_poll;
+ ot->exec = tools_exec;
+ ot->poll = tools_poll;
}
/************************** redo panel ******************************/
@@ -193,16 +194,18 @@ static void clip_panel_operator_redo_buts(const bContext *C, Panel *pa, wmOperat
static void clip_panel_operator_redo_header(const bContext *C, Panel *pa)
{
- wmOperator *op= WM_operator_last_redo(C);
+ wmOperator *op = WM_operator_last_redo(C);
- if(op) BLI_strncpy(pa->drawname, op->type->name, sizeof(pa->drawname));
- else BLI_strncpy(pa->drawname, "Operator", sizeof(pa->drawname));
+ if (op)
+ BLI_strncpy(pa->drawname, op->type->name, sizeof(pa->drawname));
+ else
+ BLI_strncpy(pa->drawname, "Operator", sizeof(pa->drawname));
}
static void clip_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOperator *op)
{
- if(op->type->flag & OPTYPE_MACRO) {
- for(op= op->macro.first; op; op= op->next) {
+ if (op->type->flag & OPTYPE_MACRO) {
+ for (op = op->macro.first; op; op = op->next) {
uiItemL(pa->layout, op->type->name, ICON_NONE);
clip_panel_operator_redo_operator(C, pa, op);
}
@@ -215,15 +218,16 @@ static void clip_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOp
/* TODO de-duplicate redo panel functions - campbell */
static void clip_panel_operator_redo(const bContext *C, Panel *pa)
{
- wmOperator *op= WM_operator_last_redo(C);
+ wmOperator *op = WM_operator_last_redo(C);
uiBlock *block;
- if(op==NULL)
+ if (op == NULL)
return;
- if(WM_operator_poll((bContext*)C, op->type) == 0)
+
+ if (WM_operator_poll((bContext*)C, op->type) == 0)
return;
- block= uiLayoutGetBlock(pa->layout);
+ block = uiLayoutGetBlock(pa->layout);
if (!WM_operator_check_ui_enabled(C, op->type->name))
uiLayoutSetEnabled(pa->layout, 0);
@@ -238,10 +242,10 @@ void ED_clip_tool_props_register(ARegionType *art)
{
PanelType *pt;
- pt= MEM_callocN(sizeof(PanelType), "spacetype clip panel last operator");
+ pt = MEM_callocN(sizeof(PanelType), "spacetype clip panel last operator");
strcpy(pt->idname, "CLIP_PT_last_operator");
strcpy(pt->label, "Operator");
- pt->draw_header= clip_panel_operator_redo_header;
- pt->draw= clip_panel_operator_redo;
+ pt->draw_header = clip_panel_operator_redo_header;
+ pt->draw = clip_panel_operator_redo;
BLI_addtail(&art->paneltypes, pt);
}
diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c
index 46442d39a7b..443a1d0cdd3 100644
--- a/source/blender/editors/space_clip/clip_utils.c
+++ b/source/blender/editors/space_clip/clip_utils.c
@@ -62,51 +62,51 @@ void clip_graph_tracking_values_iterate_track(SpaceClip *sc, MovieTrackingTrack
void (*segment_start) (void *userdata, MovieTrackingTrack *track, int coord),
void (*segment_end) (void *userdata))
{
- MovieClip *clip= ED_space_clip(sc);
+ MovieClip *clip = ED_space_clip(sc);
int width, height, coord;
BKE_movieclip_get_size(clip, &sc->user, &width, &height);
- for(coord= 0; coord<2; coord++) {
- int i, open= 0, prevfra= 0;
- float prevval= 0.0f;
+ for (coord = 0; coord < 2; coord++) {
+ int i, open = FALSE, prevfra = 0;
+ float prevval = 0.0f;
- for(i= 0; i<track->markersnr; i++) {
- MovieTrackingMarker *marker= &track->markers[i];
+ for (i = 0; i < track->markersnr; i++) {
+ MovieTrackingMarker *marker = &track->markers[i];
float val;
- if(marker->flag&MARKER_DISABLED) {
- if(open) {
- if(segment_end)
+ if (marker->flag & MARKER_DISABLED) {
+ if (open) {
+ if (segment_end)
segment_end(userdata);
- open= 0;
+ open = FALSE;
}
continue;
}
- if(!open) {
- if(segment_start)
+ if (!open) {
+ if (segment_start)
segment_start(userdata, track, coord);
- open= 1;
- prevval= marker->pos[coord];
+ open = TRUE;
+ prevval = marker->pos[coord];
}
/* value is a pixels per frame speed */
- val= (marker->pos[coord] - prevval) * ((coord==0) ? (width) : (height));
- val/= marker->framenr-prevfra;
+ val = (marker->pos[coord] - prevval) * ((coord == 0) ? (width) : (height));
+ val /= marker->framenr - prevfra;
- if(func)
+ if (func)
func(userdata, track, marker, coord, val);
- prevval= marker->pos[coord];
- prevfra= marker->framenr;
+ prevval = marker->pos[coord];
+ prevfra = marker->framenr;
}
- if(open) {
- if(segment_end)
+ if (open) {
+ if (segment_end)
segment_end(userdata);
}
}
@@ -117,89 +117,89 @@ void clip_graph_tracking_values_iterate(SpaceClip *sc, void *userdata,
void (*segment_start) (void *userdata, MovieTrackingTrack *track, int coord),
void (*segment_end) (void *userdata))
{
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
MovieTrackingTrack *track;
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track)) {
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track)) {
clip_graph_tracking_values_iterate_track(sc, track, userdata, func, segment_start, segment_end);
}
- track= track->next;
+ track = track->next;
}
}
void clip_graph_tracking_iterate(SpaceClip *sc, void *userdata,
void (*func) (void *userdata, MovieTrackingMarker *marker))
{
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
MovieTrackingTrack *track;
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track)) {
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track)) {
int i;
- for(i= 0; i<track->markersnr; i++) {
- MovieTrackingMarker *marker= &track->markers[i];
+ for (i = 0; i < track->markersnr; i++) {
+ MovieTrackingMarker *marker = &track->markers[i];
- if(marker->flag&MARKER_DISABLED)
+ if (marker->flag & MARKER_DISABLED)
continue;
- if(func)
+ if (func)
func(userdata, marker);
}
}
- track= track->next;
+ track = track->next;
}
}
void clip_delete_track(bContext *C, MovieClip *clip, ListBase *tracksbase, MovieTrackingTrack *track)
{
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingStabilization *stab= &tracking->stabilization;
- MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking);
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingStabilization *stab = &tracking->stabilization;
+ MovieTrackingTrack *act_track = BKE_tracking_active_track(tracking);
- int has_bundle= 0, update_stab= 0;
+ int has_bundle = FALSE, update_stab = FALSE;
- if(track==act_track)
- tracking->act_track= NULL;
+ if (track==act_track)
+ tracking->act_track = NULL;
- if(track==stab->rot_track) {
- stab->rot_track= NULL;
+ if (track == stab->rot_track) {
+ stab->rot_track = NULL;
- update_stab= 1;
+ update_stab = TRUE;
}
/* handle reconstruction display in 3d viewport */
- if(track->flag&TRACK_HAS_BUNDLE)
- has_bundle= 1;
+ if (track->flag & TRACK_HAS_BUNDLE)
+ has_bundle = TRUE;
BKE_tracking_free_track(track);
BLI_freelinkN(tracksbase, track);
WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip);
- if(update_stab) {
- tracking->stabilization.ok= 0;
+ if (update_stab) {
+ tracking->stabilization.ok = FALSE;
DAG_id_tag_update(&clip->id, 0);
WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip);
}
- if(has_bundle)
+ if (has_bundle)
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL);
}
void clip_delete_marker(bContext *C, MovieClip *clip, ListBase *tracksbase, MovieTrackingTrack *track, MovieTrackingMarker *marker)
{
- if(track->markersnr==1) {
+ if (track->markersnr == 1) {
clip_delete_track(C, clip, tracksbase, track);
}
else {
@@ -217,6 +217,6 @@ void clip_view_center_to_point(SpaceClip *sc, float x, float y)
ED_space_clip_size(sc, &width, &height);
ED_space_clip_aspect(sc, &aspx, &aspy);
- sc->xof= (x-0.5f)*width*aspx;
- sc->yof= (y-0.5f)*height*aspy;
+ sc->xof = (x - 0.5f) * width * aspx;
+ sc->yof = (y - 0.5f) * height * aspy;
}
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index 9edf4fab280..228c716e3b6 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -71,47 +71,47 @@
static void init_preview_region(const bContext *C, ARegion *ar)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
- ar->regiontype= RGN_TYPE_PREVIEW;
- ar->alignment= RGN_ALIGN_TOP;
- ar->flag|= RGN_FLAG_HIDDEN;
+ ar->regiontype = RGN_TYPE_PREVIEW;
+ ar->alignment = RGN_ALIGN_TOP;
+ ar->flag |= RGN_FLAG_HIDDEN;
- ar->v2d.tot.xmin= 0.0f;
- ar->v2d.tot.ymin= -10.0f;
- ar->v2d.tot.xmax= (float)scene->r.efra;
- ar->v2d.tot.ymax= 10.0f;
+ ar->v2d.tot.xmin = 0.0f;
+ ar->v2d.tot.ymin = -10.0f;
+ ar->v2d.tot.xmax = (float)scene->r.efra;
+ ar->v2d.tot.ymax = 10.0f;
- ar->v2d.cur= ar->v2d.tot;
+ ar->v2d.cur = ar->v2d.tot;
- ar->v2d.min[0]= FLT_MIN;
- ar->v2d.min[1]= FLT_MIN;
+ ar->v2d.min[0] = FLT_MIN;
+ ar->v2d.min[1] = FLT_MIN;
- ar->v2d.max[0]= MAXFRAMEF;
- ar->v2d.max[1]= FLT_MAX;
+ ar->v2d.max[0] = MAXFRAMEF;
+ ar->v2d.max[1] = FLT_MAX;
- ar->v2d.scroll= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
+ ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
ar->v2d.scroll |= (V2D_SCROLL_LEFT|V2D_SCROLL_SCALE_VERTICAL);
- ar->v2d.keeptot= 0;
+ ar->v2d.keeptot = 0;
}
static ARegion *clip_has_preview_region(const bContext *C, ScrArea *sa)
{
ARegion *ar, *arnew;
- ar= BKE_area_find_region_type(sa, RGN_TYPE_PREVIEW);
- if(ar)
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_PREVIEW);
+ if (ar)
return ar;
/* add subdiv level; after header */
- ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
/* is error! */
- if(ar==NULL)
+ if (ar == NULL)
return NULL;
- arnew= MEM_callocN(sizeof(ARegion), "clip preview region");
+ arnew = MEM_callocN(sizeof(ARegion), "clip preview region");
BLI_insertlinkbefore(&sa->regionbase, ar, arnew);
init_preview_region(C, arnew);
@@ -121,30 +121,30 @@ static ARegion *clip_has_preview_region(const bContext *C, ScrArea *sa)
static void clip_scopes_tag_refresh(ScrArea *sa)
{
- SpaceClip *sc= (SpaceClip *)sa->spacedata.first;
+ SpaceClip *sc = (SpaceClip *)sa->spacedata.first;
ARegion *ar;
- if(sc->mode!=SC_MODE_TRACKING)
+ if (sc->mode != SC_MODE_TRACKING)
return;
/* only while proeprties are visible */
- for (ar=sa->regionbase.first; ar; ar=ar->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
if (ar->regiontype == RGN_TYPE_UI && ar->flag & RGN_FLAG_HIDDEN)
return;
}
- sc->scopes.ok= 0;
+ sc->scopes.ok = FALSE;
}
static void clip_stabilization_tag_refresh(ScrArea *sa)
{
- SpaceClip *sc= (SpaceClip *)sa->spacedata.first;
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = (SpaceClip *) sa->spacedata.first;
+ MovieClip *clip = ED_space_clip(sc);
- if(clip) {
- MovieTrackingStabilization *stab= &clip->tracking.stabilization;
+ if (clip) {
+ MovieTrackingStabilization *stab = &clip->tracking.stabilization;
- stab->ok= 0;
+ stab->ok = FALSE;
}
}
@@ -155,64 +155,64 @@ static SpaceLink *clip_new(const bContext *C)
ARegion *ar;
SpaceClip *sc;
- sc= MEM_callocN(sizeof(SpaceClip), "initclip");
- sc->spacetype= SPACE_CLIP;
- sc->flag= SC_SHOW_MARKER_PATTERN|SC_SHOW_TRACK_PATH|SC_MANUAL_CALIBRATION|SC_SHOW_GRAPH_TRACKS|SC_SHOW_GRAPH_FRAMES;
- sc->zoom= 1.0f;
- sc->path_length= 20;
- sc->scopes.track_preview_height= 120;
+ sc = MEM_callocN(sizeof(SpaceClip), "initclip");
+ sc->spacetype = SPACE_CLIP;
+ sc->flag = SC_SHOW_MARKER_PATTERN|SC_SHOW_TRACK_PATH|SC_MANUAL_CALIBRATION|SC_SHOW_GRAPH_TRACKS|SC_SHOW_GRAPH_FRAMES;
+ sc->zoom = 1.0f;
+ sc->path_length = 20;
+ sc->scopes.track_preview_height = 120;
/* header */
- ar= MEM_callocN(sizeof(ARegion), "header for clip");
+ ar = MEM_callocN(sizeof(ARegion), "header for clip");
BLI_addtail(&sc->regionbase, ar);
- ar->regiontype= RGN_TYPE_HEADER;
- ar->alignment= RGN_ALIGN_BOTTOM;
+ ar->regiontype = RGN_TYPE_HEADER;
+ ar->alignment = RGN_ALIGN_BOTTOM;
/* tools view */
- ar= MEM_callocN(sizeof(ARegion), "tools for clip");
+ ar = MEM_callocN(sizeof(ARegion), "tools for clip");
BLI_addtail(&sc->regionbase, ar);
- ar->regiontype= RGN_TYPE_TOOLS;
- ar->alignment= RGN_ALIGN_LEFT;
+ ar->regiontype = RGN_TYPE_TOOLS;
+ ar->alignment = RGN_ALIGN_LEFT;
/* tool properties */
- ar= MEM_callocN(sizeof(ARegion), "tool properties for clip");
+ ar = MEM_callocN(sizeof(ARegion), "tool properties for clip");
BLI_addtail(&sc->regionbase, ar);
- ar->regiontype= RGN_TYPE_TOOL_PROPS;
- ar->alignment= RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV;
+ ar->regiontype = RGN_TYPE_TOOL_PROPS;
+ ar->alignment = RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV;
/* properties view */
- ar= MEM_callocN(sizeof(ARegion), "properties for clip");
+ ar = MEM_callocN(sizeof(ARegion), "properties for clip");
BLI_addtail(&sc->regionbase, ar);
- ar->regiontype= RGN_TYPE_UI;
- ar->alignment= RGN_ALIGN_RIGHT;
+ ar->regiontype = RGN_TYPE_UI;
+ ar->alignment = RGN_ALIGN_RIGHT;
/* preview view */
- ar= MEM_callocN(sizeof(ARegion), "preview for clip");
+ ar = MEM_callocN(sizeof(ARegion), "preview for clip");
BLI_addtail(&sc->regionbase, ar);
init_preview_region(C, ar);
/* main area */
- ar= MEM_callocN(sizeof(ARegion), "main area for clip");
+ ar = MEM_callocN(sizeof(ARegion), "main area for clip");
BLI_addtail(&sc->regionbase, ar);
- ar->regiontype= RGN_TYPE_WINDOW;
+ ar->regiontype = RGN_TYPE_WINDOW;
- return (SpaceLink *)sc;
+ return (SpaceLink *) sc;
}
/* not spacelink itself */
static void clip_free(SpaceLink *sl)
{
- SpaceClip *sc= (SpaceClip*) sl;
+ SpaceClip *sc = (SpaceClip*) sl;
- sc->clip= NULL;
+ sc->clip = NULL;
- if(sc->scopes.track_preview)
+ if (sc->scopes.track_preview)
IMB_freeImBuf(sc->scopes.track_preview);
}
@@ -224,11 +224,11 @@ static void clip_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa))
static SpaceLink *clip_duplicate(SpaceLink *sl)
{
- SpaceClip *scn= MEM_dupallocN(sl);
+ SpaceClip *scn = MEM_dupallocN(sl);
/* clear or remove stuff from old */
- scn->scopes.track_preview= NULL;
- scn->scopes.ok= 0;
+ scn->scopes.track_preview = NULL;
+ scn->scopes.ok = FALSE;
return (SpaceLink *)scn;
}
@@ -278,12 +278,12 @@ static void clip_listener(ScrArea *sa, wmNotifier *wmn)
}
break;
case NC_SCREEN:
- if(wmn->data==ND_ANIMPLAY) {
+ if (wmn->data ==ND_ANIMPLAY) {
ED_area_tag_redraw(sa);
}
break;
case NC_SPACE:
- if(wmn->data==ND_SPACE_CLIP) {
+ if (wmn->data ==ND_SPACE_CLIP) {
clip_scopes_tag_refresh(sa);
clip_stabilization_tag_refresh(sa);
ED_area_tag_redraw(sa);
@@ -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)
@@ -391,7 +400,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
/* ******** Global hotkeys avalaible for all regions ******** */
- keymap= WM_keymap_find(keyconf, "Clip", SPACE_CLIP, 0);
+ keymap = WM_keymap_find(keyconf, "Clip", SPACE_CLIP, 0);
WM_keymap_add_item(keymap, "CLIP_OT_open", OKEY, KM_PRESS, KM_ALT, 0);
@@ -399,23 +408,25 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "CLIP_OT_properties", NKEY, KM_PRESS, 0, 0);
/* 2d tracking */
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", LEFTARROWKEY, KM_PRESS, KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_track_markers", LEFTARROWKEY, KM_PRESS, KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "backwards", TRUE);
RNA_boolean_set(kmi->ptr, "sequence", FALSE);
- WM_keymap_add_item(keymap, "CLIP_OT_track_markers", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0);
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", TKEY, KM_PRESS, KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_track_markers", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0);
+ RNA_boolean_set(kmi->ptr, "backwards", FALSE);
+ RNA_boolean_set(kmi->ptr, "sequence", FALSE);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_track_markers", TKEY, KM_PRESS, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "backwards", FALSE);
RNA_boolean_set(kmi->ptr, "sequence", TRUE);
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", TKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_track_markers", TKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "backwards", TRUE);
RNA_boolean_set(kmi->ptr, "sequence", TRUE);
/* mode */
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "mode", SC_MODE_RECONSTRUCTION);
RNA_boolean_set(kmi->ptr, "toggle", TRUE);
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0);
RNA_enum_set(kmi->ptr, "mode", SC_MODE_DISTORTION);
RNA_boolean_set(kmi->ptr, "toggle", TRUE);
@@ -428,7 +439,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
/* ******** Hotkeys avalaible for main region only ******** */
- keymap= WM_keymap_find(keyconf, "Clip Editor", SPACE_CLIP, 0);
+ keymap = WM_keymap_find(keyconf, "Clip Editor", SPACE_CLIP, 0);
/* ** View/navigation ** */
@@ -452,19 +463,23 @@ 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 */
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "position", 0);
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "position", 1);
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "position", 2);
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "position", 3);
/* "timeline" */
@@ -491,58 +506,62 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "CLIP_OT_slide_marker", LEFTMOUSE, KM_PRESS, 0, 0);
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_disable_markers", DKEY, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_disable_markers", DKEY, KM_PRESS, KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "action", 2); /* toggle */
/* tracks */
WM_keymap_add_item(keymap, "CLIP_OT_delete_track", DELKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "CLIP_OT_delete_track", XKEY, KM_PRESS, 0, 0);
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_lock_tracks", LKEY, KM_PRESS, KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_lock_tracks", LKEY, KM_PRESS, KM_CTRL, 0);
RNA_enum_set(kmi->ptr, "action", 0); /* lock */
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_lock_tracks", LKEY, KM_PRESS, KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_lock_tracks", LKEY, KM_PRESS, KM_ALT, 0);
RNA_enum_set(kmi->ptr, "action", 1); /* unlock */
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "unselected", FALSE);
- kmi= WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "unselected", TRUE);
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 */
WM_keymap_add_menu(keymap, "CLIP_MT_tracking_specials", WKEY, KM_PRESS, 0, 0);
/* display */
- kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", LKEY, KM_PRESS, 0, 0);
+ 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_selection");
- kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", DKEY, KM_PRESS, KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", DKEY, KM_PRESS, KM_ALT, 0);
RNA_string_set(kmi->ptr, "data_path", "space_data.show_disabled");
- kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", SKEY, KM_PRESS, KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", SKEY, KM_PRESS, KM_ALT, 0);
RNA_string_set(kmi->ptr, "data_path", "space_data.show_marker_search");
- kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "data_path", "space_data.use_mute_footage");
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);
+ keymap = WM_keymap_find(keyconf, "Clip Graph Editor", SPACE_CLIP, 0);
/* "timeline" */
WM_keymap_add_item(keymap, "CLIP_OT_change_frame", ACTIONMOUSE, KM_PRESS, 0, 0);
@@ -553,6 +572,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);
@@ -564,9 +590,24 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "CLIP_OT_graph_view_all", HOMEKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "CLIP_OT_graph_center_current_frame", PADPERIOD, KM_PRESS, 0, 0);
- kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", LKEY, KM_PRESS, 0, 0);
+ 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);
}
@@ -574,29 +615,29 @@ const char *clip_context_dir[]= {"edit_movieclip", NULL};
static int clip_context(const bContext *C, const char *member, bContextDataResult *result)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
- if(CTX_data_dir(member)) {
+ if (CTX_data_dir(member)) {
CTX_data_dir_set(result, clip_context_dir);
- return 1;
+ return TRUE;
}
- else if(CTX_data_equals(member, "edit_movieclip")) {
+ else if (CTX_data_equals(member, "edit_movieclip")) {
CTX_data_id_pointer_set(result, &sc->clip->id);
- return 1;
+ return TRUE;
}
- return 0;
+ return FALSE;
}
static void clip_refresh(const bContext *C, ScrArea *sa)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- wmWindow *window= CTX_wm_window(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
+ wmWindow *window = CTX_wm_window(C);
Scene *scene = CTX_data_scene(C);
- SpaceClip *sc= (SpaceClip *)sa->spacedata.first;
- ARegion *ar_main= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
- ARegion *ar_preview= clip_has_preview_region(C, sa);
- int view_changed= 0;
+ SpaceClip *sc = (SpaceClip *)sa->spacedata.first;
+ ARegion *ar_main = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+ ARegion *ar_preview = clip_has_preview_region(C, sa);
+ int view_changed = FALSE;
switch (sc->view) {
case SC_VIEW_CLIP:
@@ -604,11 +645,11 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
ar_preview->flag |= RGN_FLAG_HIDDEN;
ar_preview->v2d.flag &= ~V2D_IS_INITIALISED;
WM_event_remove_handlers((bContext*)C, &ar_preview->handlers);
- view_changed= 1;
+ view_changed = TRUE;
}
if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) {
- ar_main->alignment= RGN_ALIGN_NONE;
- view_changed= 1;
+ ar_main->alignment = RGN_ALIGN_NONE;
+ view_changed = TRUE;
}
if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) {
/* store graph region align */
@@ -617,8 +658,8 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
else
sc->runtime_flag |= SC_GRAPH_BOTTOM;
- ar_preview->alignment= RGN_ALIGN_NONE;
- view_changed= 1;
+ ar_preview->alignment = RGN_ALIGN_NONE;
+ view_changed = TRUE;
}
break;
case SC_VIEW_GRAPH:
@@ -626,24 +667,24 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
ar_preview->flag &= ~RGN_FLAG_HIDDEN;
ar_preview->v2d.flag &= ~V2D_IS_INITIALISED;
ar_preview->v2d.cur = ar_preview->v2d.tot;
- view_changed= 1;
+ view_changed = TRUE;
}
if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) {
- ar_main->alignment= RGN_ALIGN_NONE;
- view_changed= 1;
+ ar_main->alignment = RGN_ALIGN_NONE;
+ view_changed = TRUE;
}
if (ar_preview && !ELEM(ar_preview->alignment, RGN_ALIGN_TOP, RGN_ALIGN_BOTTOM)) {
if (sc->runtime_flag & SC_GRAPH_BOTTOM)
- ar_preview->alignment= RGN_ALIGN_BOTTOM;
+ ar_preview->alignment = RGN_ALIGN_BOTTOM;
else
- ar_preview->alignment= RGN_ALIGN_TOP;
+ ar_preview->alignment = RGN_ALIGN_TOP;
- view_changed= 1;
+ view_changed = TRUE;
}
break;
}
- if(view_changed) {
+ if (view_changed) {
ED_area_initialize(wm, window, sa);
ED_area_tag_redraw(sa);
}
@@ -656,44 +697,44 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
/* sets up the fields of the View2D from zoom and offset */
static void movieclip_main_area_set_view2d(SpaceClip *sc, ARegion *ar)
{
- MovieClip *clip= ED_space_clip(sc);
+ MovieClip *clip = ED_space_clip(sc);
float x1, y1, w, h;
int width, height, winx, winy;
ED_space_clip_size(sc, &width, &height);
- w= width;
- h= height;
+ w = width;
+ h = height;
- if(clip)
- h*= clip->aspy/clip->aspx/clip->tracking.camera.pixel_aspect;
+ if (clip)
+ h *= clip->aspy / clip->aspx / clip->tracking.camera.pixel_aspect;
- winx= ar->winrct.xmax - ar->winrct.xmin + 1;
- winy= ar->winrct.ymax - ar->winrct.ymin + 1;
+ winx = ar->winrct.xmax - ar->winrct.xmin + 1;
+ winy = ar->winrct.ymax - ar->winrct.ymin + 1;
- ar->v2d.tot.xmin= 0;
- ar->v2d.tot.ymin= 0;
- ar->v2d.tot.xmax= w;
- ar->v2d.tot.ymax= h;
+ ar->v2d.tot.xmin = 0;
+ ar->v2d.tot.ymin = 0;
+ ar->v2d.tot.xmax = w;
+ ar->v2d.tot.ymax = h;
- ar->v2d.mask.xmin= ar->v2d.mask.ymin= 0;
- ar->v2d.mask.xmax= winx;
- ar->v2d.mask.ymax= winy;
+ ar->v2d.mask.xmin = ar->v2d.mask.ymin = 0;
+ ar->v2d.mask.xmax = winx;
+ ar->v2d.mask.ymax = winy;
/* which part of the image space do we see? */
- x1= ar->winrct.xmin+(winx-sc->zoom*w)/2.0f;
- y1= ar->winrct.ymin+(winy-sc->zoom*h)/2.0f;
+ x1= ar->winrct.xmin + (winx-sc->zoom * w) / 2.0f;
+ y1= ar->winrct.ymin + (winy-sc->zoom * h) / 2.0f;
- x1-= sc->zoom*sc->xof;
- y1-= sc->zoom*sc->yof;
+ x1-= sc->zoom * sc->xof;
+ y1-= sc->zoom * sc->yof;
/* relative display right */
- ar->v2d.cur.xmin= ((ar->winrct.xmin - (float)x1)/sc->zoom);
- ar->v2d.cur.xmax= ar->v2d.cur.xmin + ((float)winx/sc->zoom);
+ ar->v2d.cur.xmin = (ar->winrct.xmin - (float)x1) / sc->zoom;
+ ar->v2d.cur.xmax = ar->v2d.cur.xmin + ((float)winx / sc->zoom);
/* relative display left */
- ar->v2d.cur.ymin= ((ar->winrct.ymin-(float)y1)/sc->zoom);
- ar->v2d.cur.ymax= ar->v2d.cur.ymin + ((float)winy/sc->zoom);
+ ar->v2d.cur.ymin = (ar->winrct.ymin - (float)y1) / sc->zoom;
+ ar->v2d.cur.ymax = ar->v2d.cur.ymin + ((float)winy / sc->zoom);
/* normalize 0.0..1.0 */
ar->v2d.cur.xmin /= w;
@@ -710,38 +751,38 @@ static void clip_main_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap= WM_keymap_find(wm->defaultconf, "Clip Editor", SPACE_CLIP, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Clip Editor", SPACE_CLIP, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
static void clip_main_area_draw(const bContext *C, ARegion *ar)
{
/* draw entirely, view changes should be handled here */
- SpaceClip *sc= CTX_wm_space_clip(C);
- Scene *scene= CTX_data_scene(C);
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ 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(clip && clip->tracking_context)
+ /* 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);
- if(sc->flag&SC_LOCK_SELECTION) {
- ImBuf *tmpibuf= NULL;
+ if (sc->flag & SC_LOCK_SELECTION) {
+ ImBuf *tmpibuf = NULL;
- if(clip && clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) {
- tmpibuf= ED_space_clip_get_stable_buffer(sc, NULL, NULL, NULL);
+ if (clip && clip->tracking.stabilization.flag & TRACKING_2D_STABILIZATION) {
+ tmpibuf = ED_space_clip_get_stable_buffer(sc, NULL, NULL, NULL);
}
- if(ED_clip_view_selection(sc, ar, 0)) {
- sc->xof+= sc->xlockof;
- sc->yof+= sc->ylockof;
+ if (ED_clip_view_selection(sc, ar, 0)) {
+ sc->xof += sc->xlockof;
+ sc->yof += sc->ylockof;
}
- if(tmpibuf)
+ if (tmpibuf)
IMB_freeImBuf(tmpibuf);
}
@@ -769,7 +810,7 @@ static void clip_main_area_listener(ARegion *ar, wmNotifier *wmn)
/* context changes */
switch(wmn->category) {
case NC_SCREEN:
- if (wmn->data==ND_GPENCIL)
+ if (wmn->data == ND_GPENCIL)
ED_region_tag_redraw(ar);
break;
}
@@ -784,22 +825,22 @@ static void clip_preview_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap= WM_keymap_find(wm->defaultconf, "Clip Graph Editor", SPACE_CLIP, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Clip Graph Editor", SPACE_CLIP, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
static void clip_preview_area_draw(const bContext *C, ARegion *ar)
{
- View2D *v2d= &ar->v2d;
+ View2D *v2d = &ar->v2d;
View2DScrollers *scrollers;
- SpaceClip *sc= CTX_wm_space_clip(C);
- Scene *scene= CTX_data_scene(C);
- short unitx= V2D_UNIT_FRAMESCALE, unity= V2D_UNIT_VALUES;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ Scene *scene = CTX_data_scene(C);
+ short unitx = V2D_UNIT_FRAMESCALE, unity = V2D_UNIT_VALUES;
- if(sc->flag & SC_LOCK_TIMECURSOR)
+ if (sc->flag & SC_LOCK_TIMECURSOR)
ED_clip_graph_center_current_frame(scene, ar);
/* clear and setup matrix */
@@ -815,7 +856,7 @@ static void clip_preview_area_draw(const bContext *C, ARegion *ar)
UI_view2d_view_restore(C);
/* scrollers */
- scrollers= UI_view2d_scrollers_calc(C, v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP);
+ scrollers = UI_view2d_scrollers_calc(C, v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP);
UI_view2d_scrollers_draw(C, v2d, scrollers);
UI_view2d_scrollers_free(scrollers);
}
@@ -857,19 +898,19 @@ static void clip_props_area_listener(ARegion *ar, wmNotifier *wmn)
/* context changes */
switch(wmn->category) {
case NC_WM:
- if(wmn->data == ND_HISTORY)
+ if (wmn->data == ND_HISTORY)
ED_region_tag_redraw(ar);
break;
case NC_SCENE:
- if(wmn->data == ND_MODE)
+ if (wmn->data == ND_MODE)
ED_region_tag_redraw(ar);
break;
case NC_SPACE:
- if(wmn->data == ND_SPACE_CLIP)
+ if (wmn->data == ND_SPACE_CLIP)
ED_region_tag_redraw(ar);
break;
case NC_SCREEN:
- if(wmn->data == ND_GPENCIL)
+ if (wmn->data == ND_GPENCIL)
ED_region_tag_redraw(ar);
break;
}
@@ -884,13 +925,13 @@ static void clip_properties_area_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap= WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
static void clip_properties_area_draw(const bContext *C, ARegion *ar)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
BKE_movieclip_update_scopes(sc->clip, &sc->user, &sc->scopes);
@@ -902,11 +943,11 @@ static void clip_properties_area_listener(ARegion *ar, wmNotifier *wmn)
/* context changes */
switch(wmn->category) {
case NC_SCREEN:
- if (wmn->data==ND_GPENCIL)
+ if (wmn->data ==ND_GPENCIL)
ED_region_tag_redraw(ar);
break;
case NC_BRUSH:
- if(wmn->action==NA_EDITED)
+ if (wmn->action ==NA_EDITED)
ED_region_tag_redraw(ar);
break;
}
@@ -917,86 +958,86 @@ static void clip_properties_area_listener(ARegion *ar, wmNotifier *wmn)
/* only called once, from space/spacetypes.c */
void ED_spacetype_clip(void)
{
- SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype clip");
+ SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype clip");
ARegionType *art;
- st->spaceid= SPACE_CLIP;
+ st->spaceid = SPACE_CLIP;
strncpy(st->name, "Clip", BKE_ST_MAXNAME);
- st->new= clip_new;
- st->free= clip_free;
- st->init= clip_init;
- st->duplicate= clip_duplicate;
- st->operatortypes= clip_operatortypes;
- st->keymap= clip_keymap;
- st->listener= clip_listener;
- st->context= clip_context;
- st->refresh= clip_refresh;
+ st->new = clip_new;
+ st->free = clip_free;
+ st->init = clip_init;
+ st->duplicate = clip_duplicate;
+ st->operatortypes = clip_operatortypes;
+ st->keymap = clip_keymap;
+ st->listener = clip_listener;
+ st->context = clip_context;
+ st->refresh = clip_refresh;
/* regions: main window */
- art= MEM_callocN(sizeof(ARegionType), "spacetype clip region");
- art->regionid= RGN_TYPE_WINDOW;
- art->init= clip_main_area_init;
- art->draw= clip_main_area_draw;
- art->listener= clip_main_area_listener;
- art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI|ED_KEYMAP_GPENCIL;
+ art = MEM_callocN(sizeof(ARegionType), "spacetype clip region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->init = clip_main_area_init;
+ art->draw = clip_main_area_draw;
+ art->listener = clip_main_area_listener;
+ art->keymapflag = ED_KEYMAP_FRAMES|ED_KEYMAP_UI|ED_KEYMAP_GPENCIL;
BLI_addhead(&st->regiontypes, art);
/* preview */
- art= MEM_callocN(sizeof(ARegionType), "spacetype clip region preview");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype clip region preview");
art->regionid = RGN_TYPE_PREVIEW;
art->prefsizey = 240;
- art->init= clip_preview_area_init;
- art->draw= clip_preview_area_draw;
- art->listener= clip_preview_area_listener;
- art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+ art->init = clip_preview_area_init;
+ art->draw = clip_preview_area_draw;
+ art->listener = clip_preview_area_listener;
+ art->keymapflag = ED_KEYMAP_FRAMES|ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
BLI_addhead(&st->regiontypes, art);
/* regions: properties */
- art= MEM_callocN(sizeof(ARegionType), "spacetype clip region properties");
- art->regionid= RGN_TYPE_UI;
- art->prefsizex= UI_COMPACT_PANEL_WIDTH;
- art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI;
- art->init= clip_properties_area_init;
- art->draw= clip_properties_area_draw;
- art->listener= clip_properties_area_listener;
+ art = MEM_callocN(sizeof(ARegionType), "spacetype clip region properties");
+ art->regionid = RGN_TYPE_UI;
+ art->prefsizex = UI_COMPACT_PANEL_WIDTH;
+ art->keymapflag = ED_KEYMAP_FRAMES|ED_KEYMAP_UI;
+ art->init = clip_properties_area_init;
+ art->draw = clip_properties_area_draw;
+ art->listener = clip_properties_area_listener;
BLI_addhead(&st->regiontypes, art);
ED_clip_buttons_register(art);
/* regions: tools */
- art= MEM_callocN(sizeof(ARegionType), "spacetype clip region tools");
- art->regionid= RGN_TYPE_TOOLS;
- art->prefsizex= UI_COMPACT_PANEL_WIDTH;
- art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI;
- art->listener= clip_props_area_listener;
- art->init= clip_tools_area_init;
- art->draw= clip_tools_area_draw;
+ art = MEM_callocN(sizeof(ARegionType), "spacetype clip region tools");
+ art->regionid = RGN_TYPE_TOOLS;
+ art->prefsizex = UI_COMPACT_PANEL_WIDTH;
+ art->keymapflag = ED_KEYMAP_FRAMES|ED_KEYMAP_UI;
+ art->listener = clip_props_area_listener;
+ art->init = clip_tools_area_init;
+ art->draw = clip_tools_area_draw;
BLI_addhead(&st->regiontypes, art);
/* tool properties */
- art= MEM_callocN(sizeof(ARegionType), "spacetype clip tool properties region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype clip tool properties region");
art->regionid = RGN_TYPE_TOOL_PROPS;
- art->prefsizex= 0;
- art->prefsizey= 120;
- art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI;
- art->listener= clip_props_area_listener;
- art->init= clip_tools_area_init;
- art->draw= clip_tools_area_draw;
+ art->prefsizex = 0;
+ art->prefsizey = 120;
+ art->keymapflag = ED_KEYMAP_FRAMES|ED_KEYMAP_UI;
+ art->listener = clip_props_area_listener;
+ art->init = clip_tools_area_init;
+ art->draw = clip_tools_area_draw;
ED_clip_tool_props_register(art);
BLI_addhead(&st->regiontypes, art);
/* regions: header */
- art= MEM_callocN(sizeof(ARegionType), "spacetype clip region");
- art->regionid= RGN_TYPE_HEADER;
- art->prefsizey= HEADERY;
- art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_HEADER;
+ art = MEM_callocN(sizeof(ARegionType), "spacetype clip region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->prefsizey = HEADERY;
+ art->keymapflag = ED_KEYMAP_FRAMES|ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_HEADER;
- art->init= clip_header_area_init;
- art->draw= clip_header_area_draw;
+ art->init = clip_header_area_init;
+ art->draw = clip_header_area_draw;
BLI_addhead(&st->regiontypes, art);
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index 18a5d8689c8..79569b82476 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -80,46 +80,46 @@
static int space_clip_frame_poll(bContext *C)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
- if(sc) {
- MovieClip *clip= ED_space_clip(sc);
+ if (sc) {
+ MovieClip *clip = ED_space_clip(sc);
- if(clip)
+ if (clip)
return BKE_movieclip_has_frame(clip, &sc->user);
}
- return 0;
+ return FALSE;
}
/********************** add marker operator *********************/
static void add_marker(SpaceClip *sc, float x, float y)
{
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
MovieTrackingTrack *track;
int width, height;
-
+
ED_space_clip_size(sc, &width, &height);
- track= BKE_tracking_add_track(tracking, tracksbase, x, y, sc->user.framenr, width, height);
+ track = BKE_tracking_add_track(tracking, tracksbase, x, y, sc->user.framenr, width, height);
BKE_tracking_select_track(tracksbase, track, TRACK_AREA_ALL, 0);
- clip->tracking.act_track= track;
+ clip->tracking.act_track = track;
}
static int add_marker_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
float pos[2];
int width, height;
ED_space_clip_size(sc, &width, &height);
- if(!width || !height)
+ if (!width || !height)
return OPERATOR_CANCELLED;
RNA_float_get_array(op->ptr, "location", pos);
@@ -127,8 +127,8 @@ static int add_marker_exec(bContext *C, wmOperator *op)
add_marker(sc, pos[0], pos[1]);
/* reset offset from locked position, so frame jumping wouldn't be so confusing */
- sc->xlockof= 0;
- sc->ylockof= 0;
+ sc->xlockof = 0;
+ sc->ylockof = 0;
WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip);
@@ -149,17 +149,17 @@ static int add_marker_invoke(bContext *C, wmOperator *op, wmEvent *event)
void CLIP_OT_add_marker(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Marker";
- ot->idname= "CLIP_OT_add_marker";
- ot->description= "Place new marker at specified location";
+ ot->name = "Add Marker";
+ ot->idname = "CLIP_OT_add_marker";
+ ot->description = "Place new marker at specified location";
/* api callbacks */
- ot->invoke= add_marker_invoke;
- ot->exec= add_marker_exec;
- ot->poll= space_clip_frame_poll;
+ ot->invoke = add_marker_invoke;
+ ot->exec = add_marker_exec;
+ ot->poll = space_clip_frame_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MIN, FLT_MAX,
@@ -170,23 +170,23 @@ void CLIP_OT_add_marker(wmOperatorType *ot)
static int delete_track_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
- MovieTrackingTrack *track= tracksbase->first, *next;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
+ MovieTrackingTrack *track = tracksbase->first, *next;
- while(track) {
- next= track->next;
+ while (track) {
+ next = track->next;
- if(TRACK_VIEW_SELECTED(sc, track))
+ if (TRACK_VIEW_SELECTED(sc, track))
clip_delete_track(C, clip, tracksbase, track);
- track= next;
+ track = next;
}
/* nothing selected now, unlock view so it can be scrolled nice again */
- sc->flag&= ~SC_LOCK_SELECTION;
+ sc->flag &= ~SC_LOCK_SELECTION;
return OPERATOR_FINISHED;
}
@@ -194,49 +194,49 @@ static int delete_track_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_delete_track(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Track";
- ot->idname= "CLIP_OT_delete_track";
- ot->description= "Delete selected tracks";
+ ot->name = "Delete Track";
+ ot->idname = "CLIP_OT_delete_track";
+ ot->description = "Delete selected tracks";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= delete_track_exec;
- ot->poll= ED_space_clip_poll;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = delete_track_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** delete marker operator *********************/
static int delete_marker_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
- MovieTrackingTrack *track= tracksbase->first, *next;
- int framenr= sc->user.framenr;
- int has_selection= 0;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
+ MovieTrackingTrack *track = tracksbase->first, *next;
+ int framenr = sc->user.framenr;
+ int has_selection = 0;
- while(track) {
- next= track->next;
+ while (track) {
+ next = track->next;
- if(TRACK_VIEW_SELECTED(sc, track)) {
- MovieTrackingMarker *marker= BKE_tracking_exact_marker(track, framenr);
+ if (TRACK_VIEW_SELECTED(sc, track)) {
+ MovieTrackingMarker *marker = BKE_tracking_exact_marker(track, framenr);
- if(marker) {
- has_selection|= track->markersnr>1;
+ if (marker) {
+ has_selection |= track->markersnr>1;
clip_delete_marker(C, clip, tracksbase, track, marker);
}
}
- track= next;
+ track = next;
}
- if(!has_selection) {
+ if (!has_selection) {
/* nothing selected now, unlock view so it can be scrolled nice again */
- sc->flag&= ~SC_LOCK_SELECTION;
+ sc->flag &= ~SC_LOCK_SELECTION;
}
return OPERATOR_FINISHED;
@@ -245,17 +245,17 @@ static int delete_marker_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_delete_marker(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Marker";
- ot->idname= "CLIP_OT_delete_marker";
- ot->description= "Delete marker for current frame from selected tracks";
+ ot->name = "Delete Marker";
+ ot->idname = "CLIP_OT_delete_marker";
+ ot->description = "Delete marker for current frame from selected tracks";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= delete_marker_exec;
- ot->poll= ED_space_clip_poll;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = delete_marker_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** slide marker operator *********************/
@@ -281,95 +281,100 @@ typedef struct {
static SlideMarkerData *create_slide_marker_data(SpaceClip *sc, MovieTrackingTrack *track,
MovieTrackingMarker *marker, wmEvent *event, int area, int action, int width, int height)
{
- SlideMarkerData *data= MEM_callocN(sizeof(SlideMarkerData), "slide marker data");
+ SlideMarkerData *data = MEM_callocN(sizeof(SlideMarkerData), "slide marker data");
- marker= BKE_tracking_ensure_marker(track, sc->user.framenr);
+ marker = BKE_tracking_ensure_marker(track, sc->user.framenr);
- data->area= area;
- data->action= action;
- data->track= track;
- data->marker= marker;
+ data->area = area;
+ data->action = action;
+ data->track = track;
+ data->marker = marker;
- if(area==TRACK_AREA_POINT) {
- data->pos= marker->pos;
- data->offset= track->offset;
+ if (area == TRACK_AREA_POINT) {
+ data->pos = marker->pos;
+ data->offset = track->offset;
copy_v2_v2(data->spos, marker->pos);
copy_v2_v2(data->soff, track->offset);
- } else if(area==TRACK_AREA_PAT) {
- if(action==SLIDE_ACTION_SIZE) {
- data->min= track->pat_min;
- data->max= track->pat_max;
- } else {
+ }
+ else if (area == TRACK_AREA_PAT) {
+ if (action == SLIDE_ACTION_SIZE) {
+ data->min = track->pat_min;
+ data->max = track->pat_max;
+ }
+ else {
int a;
- data->pos= marker->pos;
- data->offset= track->offset;
+ data->pos = marker->pos;
+ data->offset = track->offset;
copy_v2_v2(data->soff, track->offset);
- data->smarkers= MEM_callocN(sizeof(*data->smarkers)*track->markersnr, "slide marekrs");
- for(a= 0; a<track->markersnr; a++)
+ data->smarkers = MEM_callocN(sizeof(*data->smarkers)*track->markersnr, "slide marekrs");
+ for (a = 0; a < track->markersnr; a++)
copy_v2_v2(data->smarkers[a], track->markers[a].pos);
}
- } else if(area==TRACK_AREA_SEARCH) {
- data->min= track->search_min;
- data->max= track->search_max;
+ }
+ else if (area == TRACK_AREA_SEARCH) {
+ data->min = track->search_min;
+ data->max = track->search_max;
}
- if(area==TRACK_AREA_SEARCH || (area==TRACK_AREA_PAT && action!=SLIDE_ACTION_OFFSET)) {
+ if (area == TRACK_AREA_SEARCH || (area == TRACK_AREA_PAT && action != SLIDE_ACTION_OFFSET)) {
copy_v2_v2(data->smin, data->min);
copy_v2_v2(data->smax, data->max);
}
- data->mval[0]= event->mval[0];
- data->mval[1]= event->mval[1];
+ data->mval[0] = event->mval[0];
+ data->mval[1] = event->mval[1];
- data->width= width;
- data->height= height;
+ data->width = width;
+ data->height = height;
- if(action==SLIDE_ACTION_SIZE)
- data->lock= 1;
+ if (action == SLIDE_ACTION_SIZE)
+ data->lock = 1;
return data;
}
/* 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)
+ int area, float co[2], int corner, int width, int height)
{
- int inside= 0;
- float size= 12.0f;
+ int inside = 0;
+ float size = 12.0f;
float min[2], max[2];
float crn[2], dx, dy, tdx, tdy;
- if(area==TRACK_AREA_SEARCH) {
+ if (area == TRACK_AREA_SEARCH) {
copy_v2_v2(min, track->search_min);
copy_v2_v2(max, track->search_max);
- } else {
+ }
+ else {
copy_v2_v2(min, track->pat_min);
copy_v2_v2(max, track->pat_max);
}
- dx= size/width/sc->zoom;
- dy= size/height/sc->zoom;
+ dx = size / width / sc->zoom;
+ dy = size / height / sc->zoom;
- tdx= 5.0f/width/sc->zoom;
- tdy= 5.0f/height/sc->zoom;
+ tdx = 5.0f / width / sc->zoom;
+ tdy = 5.0f / height / sc->zoom;
- dx= MIN2(dx, (max[0]-min[0])/6.0f) + tdx;
- dy= MIN2(dy, (max[1]-min[1])/6.0f) + tdy;
+ dx = MIN2(dx, (max[0] - min[0]) / 6.0f) + tdx;
+ dy = MIN2(dy, (max[1] - min[1]) / 6.0f) + tdy;
- if(corner==0) {
- crn[0]= marker->pos[0]+max[0];
- crn[1]= marker->pos[1]+min[1];
+ if (corner == 0) {
+ crn[0] = marker->pos[0] + max[0];
+ crn[1] = marker->pos[1] + min[1];
- inside= co[0]>=crn[0]-dx && co[0]<=crn[0]+tdx && co[1]>=crn[1]-tdy && co[1]<=crn[1]+dy;
- } else {
- crn[0]= marker->pos[0]+min[0];
- crn[1]= marker->pos[1]+max[1];
+ inside = co[0] >= crn[0] - dx && co[0] <= crn[0] + tdx && co[1] >= crn[1] - tdy && co[1] <= crn[1] + dy;
+ }
+ else {
+ crn[0] = marker->pos[0]+min[0];
+ crn[1] = marker->pos[1]+max[1];
- inside= co[0]>=crn[0]-dx && co[0]<=crn[0]+dx && co[1]>=crn[1]-dy && co[1]<=crn[1]+dy;
+ inside = co[0] >= crn[0] - dx && co[0] <= crn[0] + dx && co[1] >= crn[1] - dy && co[1] <= crn[1] + dy;
}
return inside;
@@ -382,77 +387,77 @@ static int mouse_on_offset(SpaceClip *sc, MovieTrackingTrack *track, MovieTracki
add_v2_v2v2(pos, marker->pos, track->offset);
- dx= 12.0f/width/sc->zoom;
- dy= 12.0f/height/sc->zoom;
+ dx = 12.0f / width / sc->zoom;
+ dy = 12.0f / height /sc->zoom;
- dx=MIN2(dx, (track->pat_max[0]-track->pat_min[0])/2.0f);
- dy=MIN2(dy, (track->pat_max[1]-track->pat_min[1])/2.0f);
+ dx = MIN2(dx, (track->pat_max[0] - track->pat_min[0]) / 2.0f);
+ dy = MIN2(dy, (track->pat_max[1] - track->pat_min[1]) / 2.0f);
- return co[0]>=pos[0]-dx && co[0]<=pos[0]+dx && co[1]>=pos[1]-dy && co[1]<=pos[1]+dy;
+ return co[0] >= pos[0] - dx && co[0] <= pos[0] + dx && co[1] >= pos[1] - dy && co[1] <= pos[1] + dy;
}
static void hide_cursor(bContext *C)
{
- wmWindow *win= CTX_wm_window(C);
+ wmWindow *win = CTX_wm_window(C);
WM_cursor_set(win, CURSOR_NONE);
}
static void show_cursor(bContext *C)
{
- wmWindow *win= CTX_wm_window(C);
+ wmWindow *win = CTX_wm_window(C);
WM_cursor_set(win, CURSOR_STD);
}
static void *slide_marker_customdata(bContext *C, wmEvent *event)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
MovieTrackingTrack *track;
int width, height;
float co[2];
- void *customdata= NULL;
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
+ void *customdata = NULL;
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
ED_space_clip_size(sc, &width, &height);
- if(width==0 || height==0)
+ if (width == 0 || height == 0)
return NULL;
ED_clip_mouse_pos(C, event, co);
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0) {
- MovieTrackingMarker *marker= BKE_tracking_get_marker(track, sc->user.framenr);
-
- if((marker->flag&MARKER_DISABLED)==0) {
- if(!customdata)
- if(mouse_on_offset(sc, track, marker, co, width, height))
- customdata= create_slide_marker_data(sc, track, marker, event, TRACK_AREA_POINT, SLIDE_ACTION_POS, width, height);
-
- if(sc->flag&SC_SHOW_MARKER_SEARCH) {
- if(mouse_on_corner(sc, track, marker, TRACK_AREA_SEARCH, co, 1, width, height))
- customdata= create_slide_marker_data(sc, track, marker, event, TRACK_AREA_SEARCH, SLIDE_ACTION_OFFSET, width, height);
- else if(mouse_on_corner(sc, track, marker, TRACK_AREA_SEARCH, co, 0, width, height))
- customdata= create_slide_marker_data(sc, track, marker, event, TRACK_AREA_SEARCH, SLIDE_ACTION_SIZE, width, height);
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED) == 0) {
+ MovieTrackingMarker *marker = BKE_tracking_get_marker(track, sc->user.framenr);
+
+ if ((marker->flag & MARKER_DISABLED) == 0) {
+ if (!customdata)
+ if (mouse_on_offset(sc, track, marker, co, width, height))
+ customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_POINT, SLIDE_ACTION_POS, width, height);
+
+ if (sc->flag & SC_SHOW_MARKER_SEARCH) {
+ if (mouse_on_corner(sc, track, marker, TRACK_AREA_SEARCH, co, 1, width, height))
+ customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_SEARCH, SLIDE_ACTION_OFFSET, width, height);
+ else if (mouse_on_corner(sc, track, marker, TRACK_AREA_SEARCH, co, 0, width, height))
+ customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_SEARCH, SLIDE_ACTION_SIZE, width, height);
}
- if(!customdata && sc->flag&SC_SHOW_MARKER_PATTERN) {
- if(mouse_on_corner(sc, track, marker, TRACK_AREA_PAT, co, 1, width, height))
- customdata= create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT, SLIDE_ACTION_OFFSET, width, height);
+ if (!customdata && (sc->flag & SC_SHOW_MARKER_PATTERN)) {
+ if (mouse_on_corner(sc, track, marker, TRACK_AREA_PAT, co, 1, width, height))
+ customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT, SLIDE_ACTION_OFFSET, width, height);
- if(!customdata && mouse_on_corner(sc, track, marker, TRACK_AREA_PAT, co, 0, width, height))
- customdata= create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT, SLIDE_ACTION_SIZE, width, height);
+ if (!customdata && mouse_on_corner(sc, track, marker, TRACK_AREA_PAT, co, 0, width, height))
+ customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT, SLIDE_ACTION_SIZE, width, height);
}
- if(customdata)
+ if (customdata)
break;
}
}
- track= track->next;
+ track = track->next;
}
return customdata;
@@ -460,16 +465,16 @@ static void *slide_marker_customdata(bContext *C, wmEvent *event)
static int slide_marker_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- SlideMarkerData *slidedata= slide_marker_customdata(C, event);
+ SlideMarkerData *slidedata = slide_marker_customdata(C, event);
- if(slidedata) {
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
+ if (slidedata) {
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
- tracking->act_track= slidedata->track;
+ tracking->act_track = slidedata->track;
- op->customdata= slidedata;
+ op->customdata = slidedata;
hide_cursor(C);
WM_event_add_modal_handler(C, op);
@@ -485,19 +490,21 @@ static int slide_marker_invoke(bContext *C, wmOperator *op, wmEvent *event)
static void cancel_mouse_slide(SlideMarkerData *data)
{
/* cancel sliding */
- if(data->area == TRACK_AREA_POINT) {
- if(data->action==SLIDE_ACTION_OFFSET)
+ if (data->area == TRACK_AREA_POINT) {
+ if (data->action == SLIDE_ACTION_OFFSET)
copy_v2_v2(data->offset, data->soff);
else
copy_v2_v2(data->pos, data->spos);
- } else {
- if(data->action==SLIDE_ACTION_SIZE) {
+ }
+ else {
+ if (data->action == SLIDE_ACTION_SIZE) {
copy_v2_v2(data->min, data->smin);
copy_v2_v2(data->max, data->smax);
- } else {
+ }
+ else {
int a;
- for(a= 0; a<data->track->markersnr; a++)
+ for (a = 0; a<data->track->markersnr; a++)
copy_v2_v2(data->track->markers[a].pos, data->smarkers[a]);
copy_v2_v2(data->offset, data->soff);
@@ -507,14 +514,16 @@ static void cancel_mouse_slide(SlideMarkerData *data)
static void free_slide_data(SlideMarkerData *data)
{
- if(data->smarkers) MEM_freeN(data->smarkers);
+ if (data->smarkers)
+ MEM_freeN(data->smarkers);
+
MEM_freeN(data);
}
static int slide_marker_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- SlideMarkerData *data= (SlideMarkerData *)op->customdata;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ SlideMarkerData *data = (SlideMarkerData *)op->customdata;
float dx, dy, mdelta[2];
switch(event->type) {
@@ -522,68 +531,76 @@ static int slide_marker_modal(bContext *C, wmOperator *op, wmEvent *event)
case RIGHTCTRLKEY:
case LEFTSHIFTKEY:
case RIGHTSHIFTKEY:
- if(data->action==SLIDE_ACTION_SIZE)
- if(ELEM(event->type, LEFTCTRLKEY, RIGHTCTRLKEY))
- data->lock= event->val==KM_RELEASE;
+ if (data->action == SLIDE_ACTION_SIZE)
+ if (ELEM(event->type, LEFTCTRLKEY, RIGHTCTRLKEY))
+ data->lock = event->val == KM_RELEASE;
- if(ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY))
- data->accurate= event->val==KM_PRESS;
+ if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY))
+ data->accurate = event->val == KM_PRESS;
/* no break! update area size */
case MOUSEMOVE:
- mdelta[0]= event->mval[0]-data->mval[0];
- mdelta[1]= event->mval[1]-data->mval[1];
+ mdelta[0] = event->mval[0]-data->mval[0];
+ mdelta[1] = event->mval[1]-data->mval[1];
- dx= mdelta[0]/data->width/sc->zoom;
+ dx = mdelta[0] / data->width / sc->zoom;
- if(data->lock) dy= -dx/data->height*data->width;
- else dy= mdelta[1]/data->height/sc->zoom;
+ if (data->lock)
+ dy = -dx / data->height * data->width;
+ else
+ dy = mdelta[1] / data->height / sc->zoom;
- if(data->accurate) {
- dx/= 5;
- dy/= 5;
+ if (data->accurate) {
+ dx /= 5;
+ dy /= 5;
}
- if(data->area==TRACK_AREA_POINT) {
- if(data->action==SLIDE_ACTION_OFFSET) {
- data->offset[0]= data->soff[0]+dx;
- data->offset[1]= data->soff[1]+dy;
- } else {
- data->pos[0]= data->spos[0]+dx;
- data->pos[1]= data->spos[1]+dy;
+ if (data->area == TRACK_AREA_POINT) {
+ if (data->action == SLIDE_ACTION_OFFSET) {
+ data->offset[0] = data->soff[0] + dx;
+ data->offset[1] = data->soff[1] + dy;
+ }
+ else {
+ data->pos[0] = data->spos[0] + dx;
+ data->pos[1] = data->spos[1] + dy;
- data->marker->flag&= ~MARKER_TRACKED;
+ data->marker->flag &= ~MARKER_TRACKED;
}
WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
DAG_id_tag_update(&sc->clip->id, 0);
- } else {
- if(data->action==SLIDE_ACTION_SIZE) {
- data->min[0]= data->smin[0]-dx;
- data->max[0]= data->smax[0]+dx;
+ }
+ else {
+ if (data->action == SLIDE_ACTION_SIZE) {
+ data->min[0] = data->smin[0] - dx;
+ data->max[0] = data->smax[0] + dx;
- data->min[1]= data->smin[1]+dy;
- data->max[1]= data->smax[1]-dy;
+ data->min[1] = data->smin[1] + dy;
+ data->max[1] = data->smax[1] - dy;
- if(data->area==TRACK_AREA_SEARCH) BKE_tracking_clamp_track(data->track, CLAMP_SEARCH_DIM);
- else BKE_tracking_clamp_track(data->track, CLAMP_PAT_DIM);
- } else {
- float d[2]={dx, dy};
+ if (data->area == TRACK_AREA_SEARCH)
+ BKE_tracking_clamp_track(data->track, CLAMP_SEARCH_DIM);
+ else
+ BKE_tracking_clamp_track(data->track, CLAMP_PAT_DIM);
+ }
+ else {
+ float d[2] = {dx, dy};
- if(data->area==TRACK_AREA_SEARCH) {
+ if (data->area == TRACK_AREA_SEARCH) {
add_v2_v2v2(data->min, data->smin, d);
add_v2_v2v2(data->max, data->smax, d);
- } else {
+ }
+ else {
int a;
- for(a= 0; a<data->track->markersnr; a++)
+ for (a = 0; a<data->track->markersnr; a++)
add_v2_v2v2(data->track->markers[a].pos, data->smarkers[a], d);
sub_v2_v2v2(data->offset, data->soff, d);
}
- if(data->area==TRACK_AREA_SEARCH)
+ if (data->area == TRACK_AREA_SEARCH)
BKE_tracking_clamp_track(data->track, CLAMP_SEARCH_POS);
}
}
@@ -593,7 +610,7 @@ static int slide_marker_modal(bContext *C, wmOperator *op, wmEvent *event)
break;
case LEFTMOUSE:
- if(event->val==KM_RELEASE) {
+ if (event->val == KM_RELEASE) {
free_slide_data(op->customdata);
show_cursor(C);
@@ -621,17 +638,17 @@ static int slide_marker_modal(bContext *C, wmOperator *op, wmEvent *event)
void CLIP_OT_slide_marker(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Slide Marker";
- ot->description= "Slide marker areas";
- ot->idname= "CLIP_OT_slide_marker";
+ ot->name = "Slide Marker";
+ ot->description = "Slide marker areas";
+ ot->idname = "CLIP_OT_slide_marker";
/* api callbacks */
- ot->poll= space_clip_frame_poll;
- ot->invoke= slide_marker_invoke;
- ot->modal= slide_marker_modal;
+ ot->poll = space_clip_frame_poll;
+ ot->invoke = slide_marker_invoke;
+ ot->modal = slide_marker_modal;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_GRAB_POINTER|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_GRAB_POINTER|OPTYPE_BLOCKING;
/* properties */
RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX,
@@ -642,10 +659,14 @@ void CLIP_OT_slide_marker(wmOperatorType *ot)
static int mouse_on_side(float co[2], float x1, float y1, float x2, float y2, float epsx, float epsy)
{
- if(x1>x2) SWAP(float, x1, x2);
- if(y1>y2) SWAP(float, y1, y2);
+ if (x1 > x2)
+
+ SWAP(float, x1, x2);
- return (co[0]>=x1-epsx && co[0]<=x2+epsx) && (co[1]>=y1-epsy && co[1]<=y2+epsy);
+ if (y1 > y2)
+ SWAP(float, y1, y2);
+
+ return (co[0] >= x1 - epsx && co[0] <= x2 + epsx) && (co[1] >= y1 - epsy && co[1] <= y2 + epsy);
}
static int mouse_on_rect(float co[2], float pos[2], float min[2], float max[2], float epsx, float epsy)
@@ -658,33 +679,34 @@ static int mouse_on_rect(float co[2], float pos[2], float min[2], float max[2],
static int track_mouse_area(SpaceClip *sc, float co[2], MovieTrackingTrack *track)
{
- MovieTrackingMarker *marker= BKE_tracking_get_marker(track, sc->user.framenr);
+ MovieTrackingMarker *marker = BKE_tracking_get_marker(track, sc->user.framenr);
float epsx, epsy;
int width, height;
ED_space_clip_size(sc, &width, &height);
- epsx= MIN4(track->pat_min[0]-track->search_min[0], track->search_max[0]-track->pat_max[0],
+ epsx = MIN4(track->pat_min[0]-track->search_min[0], track->search_max[0]-track->pat_max[0],
fabsf(track->pat_min[0]), fabsf(track->pat_max[0])) / 2;
- epsy= MIN4(track->pat_min[1]-track->search_min[1], track->search_max[1]-track->pat_max[1],
+ epsy = MIN4(track->pat_min[1]-track->search_min[1], track->search_max[1]-track->pat_max[1],
fabsf(track->pat_min[1]), fabsf(track->pat_max[1])) / 2;
- epsx= MAX2(epsx, 2.0f / width);
- epsy= MAX2(epsy, 2.0f / height);
+ epsx = MAX2(epsx, 2.0f / width);
+ epsy = MAX2(epsy, 2.0f / height);
- if(sc->flag&SC_SHOW_MARKER_SEARCH)
- if(mouse_on_rect(co, marker->pos, track->search_min, track->search_max, epsx, epsy))
+ if (sc->flag & SC_SHOW_MARKER_SEARCH) {
+ if (mouse_on_rect(co, marker->pos, track->search_min, track->search_max, epsx, epsy))
return TRACK_AREA_SEARCH;
+ }
- if((marker->flag&MARKER_DISABLED)==0) {
- if(sc->flag&SC_SHOW_MARKER_PATTERN)
- if(mouse_on_rect(co, marker->pos, track->pat_min, track->pat_max, epsx, epsy))
+ if ((marker->flag & MARKER_DISABLED)== 0) {
+ if (sc->flag & SC_SHOW_MARKER_PATTERN)
+ if (mouse_on_rect(co, marker->pos, track->pat_min, track->pat_max, epsx, epsy))
return TRACK_AREA_PAT;
- epsx= 12.0f/width;
- epsy= 12.0f/height;
+ epsx = 12.0f / width;
+ epsy = 12.0f / height;
- if(fabsf(co[0]-marker->pos[0]-track->offset[0])< epsx && fabsf(co[1]-marker->pos[1]-track->offset[1])<=epsy)
+ if (fabsf(co[0]-marker->pos[0]-track->offset[0])< epsx && fabsf(co[1]-marker->pos[1]-track->offset[1])<=epsy)
return TRACK_AREA_POINT;
}
@@ -694,51 +716,51 @@ static int track_mouse_area(SpaceClip *sc, float co[2], MovieTrackingTrack *trac
static float dist_to_rect(float co[2], float pos[2], float min[2], float max[2])
{
float d1, d2, d3, d4;
- float p[2]= {co[0]-pos[0], co[1]-pos[1]};
- float v1[2]= {min[0], min[1]}, v2[2]= {max[0], min[1]},
- v3[2]= {max[0], max[1]}, v4[2]= {min[0], max[1]};
+ float p[2] = {co[0]-pos[0], co[1]-pos[1]};
+ float v1[2] = {min[0], min[1]}, v2[2] = {max[0], min[1]},
+ v3[2] = {max[0], max[1]}, v4[2] = {min[0], max[1]};
- d1= dist_to_line_segment_v2(p, v1, v2);
- d2= dist_to_line_segment_v2(p, v2, v3);
- d3= dist_to_line_segment_v2(p, v3, v4);
- d4= dist_to_line_segment_v2(p, v4, v1);
+ d1 = dist_to_line_segment_v2(p, v1, v2);
+ d2 = dist_to_line_segment_v2(p, v2, v3);
+ d3 = dist_to_line_segment_v2(p, v3, v4);
+ d4 = dist_to_line_segment_v2(p, v4, v1);
return MIN4(d1, d2, d3, d4);
}
static MovieTrackingTrack *find_nearest_track(SpaceClip *sc, ListBase *tracksbase, float co[2])
{
- MovieTrackingTrack *track= NULL, *cur;
- float mindist= 0.0f;
+ MovieTrackingTrack *track = NULL, *cur;
+ float mindist = 0.0f;
- cur= tracksbase->first;
- while(cur) {
- MovieTrackingMarker *marker= BKE_tracking_get_marker(cur, sc->user.framenr);
+ cur = tracksbase->first;
+ while (cur) {
+ MovieTrackingMarker *marker = BKE_tracking_get_marker(cur, sc->user.framenr);
- if(((cur->flag&TRACK_HIDDEN)==0) && MARKER_VISIBLE(sc, marker)) {
- float dist, d1, d2=FLT_MAX, d3=FLT_MAX;
+ if (((cur->flag & TRACK_HIDDEN) == 0) && MARKER_VISIBLE(sc, marker)) {
+ float dist, d1, d2 = FLT_MAX, d3 = FLT_MAX;
d1= sqrtf((co[0]-marker->pos[0]-cur->offset[0])*(co[0]-marker->pos[0]-cur->offset[0])+
(co[1]-marker->pos[1]-cur->offset[1])*(co[1]-marker->pos[1]-cur->offset[1])); /* distance to marker point */
/* distance to pattern boundbox */
- if(sc->flag&SC_SHOW_MARKER_PATTERN)
+ if (sc->flag & SC_SHOW_MARKER_PATTERN)
d2= dist_to_rect(co, marker->pos, cur->pat_min, cur->pat_max);
/* distance to search boundbox */
- if(sc->flag&SC_SHOW_MARKER_SEARCH && TRACK_VIEW_SELECTED(sc, cur))
+ if (sc->flag & SC_SHOW_MARKER_SEARCH && TRACK_VIEW_SELECTED(sc, cur))
d3= dist_to_rect(co, marker->pos, cur->search_min, cur->search_max);
/* choose minimal distance. useful for cases of overlapped markers. */
- dist= MIN3(d1, d2, d3);
+ dist = MIN3(d1, d2, d3);
- if(track==NULL || dist<mindist) {
- track= cur;
- mindist= dist;
+ if (track == NULL || dist<mindist) {
+ track = cur;
+ mindist = dist;
}
}
- cur= cur->next;
+ cur = cur->next;
}
return track;
@@ -746,38 +768,39 @@ static MovieTrackingTrack *find_nearest_track(SpaceClip *sc, ListBase *tracksbas
static int mouse_select(bContext *C, float co[2], int extend)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
- MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking);
- MovieTrackingTrack *track= NULL; /* selected marker */
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
+ MovieTrackingTrack *act_track = BKE_tracking_active_track(tracking);
+ MovieTrackingTrack *track = NULL; /* selected marker */
- track= find_nearest_track(sc, tracksbase, co);
+ track = find_nearest_track(sc, tracksbase, co);
- if(track) {
- int area= track_mouse_area(sc, co, track);
+ if (track) {
+ int area = track_mouse_area(sc, co, track);
- if(!extend || !TRACK_VIEW_SELECTED(sc, track))
- area= TRACK_AREA_ALL;
+ if (!extend || !TRACK_VIEW_SELECTED(sc, track))
+ area = TRACK_AREA_ALL;
- if(extend && TRACK_AREA_SELECTED(track, area)) {
- if(track==act_track)
+ if (extend && TRACK_AREA_SELECTED(track, area)) {
+ if (track == act_track)
BKE_tracking_deselect_track(track, area);
else
- clip->tracking.act_track= track;
- } else {
- if(area==TRACK_AREA_POINT)
- area= TRACK_AREA_ALL;
+ clip->tracking.act_track = track;
+ }
+ else {
+ if (area == TRACK_AREA_POINT)
+ area = TRACK_AREA_ALL;
BKE_tracking_select_track(tracksbase, track, area, extend);
- clip->tracking.act_track= track;
+ clip->tracking.act_track = track;
}
}
- if(!extend) {
- sc->xlockof= 0.0f;
- sc->ylockof= 0.0f;
+ if (!extend) {
+ sc->xlockof = 0.0f;
+ sc->ylockof = 0.0f;
}
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
@@ -791,7 +814,7 @@ static int select_exec(bContext *C, wmOperator *op)
int extend;
RNA_float_get_array(op->ptr, "location", co);
- extend= RNA_boolean_get(op->ptr, "extend");
+ extend = RNA_boolean_get(op->ptr, "extend");
return mouse_select(C, co, extend);
}
@@ -799,16 +822,16 @@ static int select_exec(bContext *C, wmOperator *op)
static int select_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
float co[2];
- int extend= RNA_boolean_get(op->ptr, "extend");
+ int extend = RNA_boolean_get(op->ptr, "extend");
- if(!extend) {
- SlideMarkerData *slidedata= slide_marker_customdata(C, event);
+ if (!extend) {
+ SlideMarkerData *slidedata = slide_marker_customdata(C, event);
- if(slidedata) {
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ if (slidedata) {
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
- clip->tracking.act_track= slidedata->track;
+ clip->tracking.act_track = slidedata->track;
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
@@ -827,17 +850,17 @@ static int select_invoke(bContext *C, wmOperator *op, wmEvent *event)
void CLIP_OT_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select";
- ot->description= "Select tracking markers";
- ot->idname= "CLIP_OT_select";
+ ot->name = "Select";
+ ot->description = "Select tracking markers";
+ ot->idname = "CLIP_OT_select";
/* api callbacks */
- ot->exec= select_exec;
- ot->invoke= select_invoke;
- ot->poll= ED_space_clip_poll;
+ ot->exec = select_exec;
+ ot->invoke = select_invoke;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "extend", 0,
@@ -850,48 +873,48 @@ void CLIP_OT_select(wmOperatorType *ot)
static int border_select_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
MovieTrackingTrack *track;
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
rcti rect;
rctf rectf;
- int change= 0, mode, extend;
+ int change = FALSE, mode, extend;
/* 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");
+ 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");
ED_clip_point_stable_pos(C, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin);
ED_clip_point_stable_pos(C, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
- mode= RNA_int_get(op->ptr, "gesture_mode");
- extend= RNA_boolean_get(op->ptr, "extend");
+ mode = RNA_int_get(op->ptr, "gesture_mode");
+ extend = RNA_boolean_get(op->ptr, "extend");
/* do actual selection */
- track= tracksbase->first;
- while(track) {
- if((track->flag&TRACK_HIDDEN)==0) {
- MovieTrackingMarker *marker= BKE_tracking_get_marker(track, sc->user.framenr);
+ track = tracksbase->first;
+ while (track) {
+ if ((track->flag & TRACK_HIDDEN) == 0) {
+ MovieTrackingMarker *marker = BKE_tracking_get_marker(track, sc->user.framenr);
- if(MARKER_VISIBLE(sc, marker)) {
- if(BLI_in_rctf(&rectf, marker->pos[0], marker->pos[1])) {
+ if (MARKER_VISIBLE(sc, marker)) {
+ if (BLI_in_rctf(&rectf, marker->pos[0], marker->pos[1])) {
BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, mode!=GESTURE_MODAL_SELECT);
}
- else if(!extend) {
+ else if (!extend) {
BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, 1);
}
- change= 1;
+ change = TRUE;
}
}
- track= track->next;
+ track = track->next;
}
- if(change) {
+ if (change) {
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
return OPERATOR_FINISHED;
@@ -903,18 +926,18 @@ static int border_select_exec(bContext *C, wmOperator *op)
void CLIP_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Border Select";
- ot->description= "Select markers using border selection";
- ot->idname= "CLIP_OT_select_border";
+ ot->name = "Border Select";
+ ot->description = "Select markers using border selection";
+ ot->idname = "CLIP_OT_select_border";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= border_select_exec;
- ot->modal= WM_border_select_modal;
- ot->poll= ED_space_clip_poll;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = border_select_exec;
+ ot->modal = WM_border_select_modal;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* properties */
WM_operator_properties_gesture_border(ot, TRUE);
@@ -927,55 +950,55 @@ static int marker_inside_ellipse(MovieTrackingMarker *marker, float offset[2], f
/* normalized ellipse: ell[0] = scaleX, ell[1] = scaleY */
float x, y;
- x= (marker->pos[0] - offset[0])*ellipse[0];
- y= (marker->pos[1] - offset[1])*ellipse[1];
+ x = (marker->pos[0] - offset[0])*ellipse[0];
+ y = (marker->pos[1] - offset[1])*ellipse[1];
return x*x + y*y < 1.0f;
}
static int circle_select_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- ARegion *ar= CTX_wm_region(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ ARegion *ar = CTX_wm_region(C);
MovieTrackingTrack *track;
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
- int x, y, radius, width, height, mode, change= 0;
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
+ int x, y, radius, width, height, mode, change = FALSE;
float zoomx, zoomy, offset[2], ellipse[2];
/* get operator properties */
- x= RNA_int_get(op->ptr, "x");
- y= RNA_int_get(op->ptr, "y");
- radius= RNA_int_get(op->ptr, "radius");
+ x = RNA_int_get(op->ptr, "x");
+ y = RNA_int_get(op->ptr, "y");
+ radius = RNA_int_get(op->ptr, "radius");
- mode= RNA_int_get(op->ptr, "gesture_mode");
+ mode = RNA_int_get(op->ptr, "gesture_mode");
/* compute ellipse and position in unified coordinates */
ED_space_clip_size(sc, &width, &height);
ED_space_clip_zoom(sc, ar, &zoomx, &zoomy);
- ellipse[0]= width*zoomx/radius;
- ellipse[1]= height*zoomy/radius;
+ ellipse[0] = width * zoomx / radius;
+ ellipse[1] = height * zoomy / radius;
ED_clip_point_stable_pos(C, x, y, &offset[0], &offset[1]);
/* do selection */
- track= tracksbase->first;
- while(track) {
- if((track->flag&TRACK_HIDDEN)==0) {
- MovieTrackingMarker *marker= BKE_tracking_get_marker(track, sc->user.framenr);
+ track = tracksbase->first;
+ while (track) {
+ if ((track->flag & TRACK_HIDDEN) == 0) {
+ MovieTrackingMarker *marker = BKE_tracking_get_marker(track, sc->user.framenr);
- if(MARKER_VISIBLE(sc, marker) && marker_inside_ellipse(marker, offset, ellipse)) {
+ if (MARKER_VISIBLE(sc, marker) && marker_inside_ellipse(marker, offset, ellipse)) {
BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, mode!=GESTURE_MODAL_SELECT);
- change= 1;
+ change = TRUE;
}
}
- track= track->next;
+ track = track->next;
}
- if(change) {
+ if (change) {
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
return OPERATOR_FINISHED;
@@ -987,18 +1010,18 @@ static int circle_select_exec(bContext *C, wmOperator *op)
void CLIP_OT_select_circle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Circle Select";
- ot->description= "Select markers using circle selection";
- ot->idname= "CLIP_OT_select_circle";
+ ot->name = "Circle Select";
+ ot->description = "Select markers using circle selection";
+ ot->idname = "CLIP_OT_select_circle";
/* api callbacks */
- ot->invoke= WM_gesture_circle_invoke;
- ot->modal= WM_gesture_circle_modal;
- ot->exec= circle_select_exec;
- ot->poll= ED_space_clip_poll;
+ ot->invoke = WM_gesture_circle_invoke;
+ ot->modal = WM_gesture_circle_modal;
+ ot->exec = circle_select_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_int(ot->srna, "x", 0, INT_MIN, INT_MAX, "X", "", INT_MIN, INT_MAX);
@@ -1011,66 +1034,66 @@ void CLIP_OT_select_circle(wmOperatorType *ot)
static int select_all_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTrackingTrack *track= NULL; /* selected track */
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTrackingTrack *track = NULL; /* selected track */
MovieTrackingMarker *marker;
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
- int action= RNA_enum_get(op->ptr, "action");
- int framenr= sc->user.framenr;
- int has_selection= 0;
-
- if(action == SEL_TOGGLE){
- action= SEL_SELECT;
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track)) {
- marker= BKE_tracking_get_marker(track, framenr);
-
- if(MARKER_VISIBLE(sc, marker)) {
- action= SEL_DESELECT;
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
+ int action = RNA_enum_get(op->ptr, "action");
+ int framenr = sc->user.framenr;
+ int has_selection = FALSE;
+
+ if (action == SEL_TOGGLE) {
+ action = SEL_SELECT;
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track)) {
+ marker = BKE_tracking_get_marker(track, framenr);
+
+ if (MARKER_VISIBLE(sc, marker)) {
+ action = SEL_DESELECT;
break;
}
}
- track= track->next;
+ track = track->next;
}
}
- track= tracksbase->first;
- while(track) {
- if((track->flag&TRACK_HIDDEN)==0) {
- marker= BKE_tracking_get_marker(track, framenr);
+ track = tracksbase->first;
+ while (track) {
+ if ((track->flag & TRACK_HIDDEN)==0) {
+ marker = BKE_tracking_get_marker(track, framenr);
- if(MARKER_VISIBLE(sc, marker)) {
+ if (MARKER_VISIBLE(sc, marker)) {
switch (action) {
case SEL_SELECT:
- track->flag|= SELECT;
- track->pat_flag|= SELECT;
- track->search_flag|= SELECT;
+ track->flag |= SELECT;
+ track->pat_flag |= SELECT;
+ track->search_flag |= SELECT;
break;
case SEL_DESELECT:
- track->flag&= ~SELECT;
- track->pat_flag&= ~SELECT;
- track->search_flag&= ~SELECT;
+ track->flag &= ~SELECT;
+ track->pat_flag &= ~SELECT;
+ track->search_flag &= ~SELECT;
break;
case SEL_INVERT:
- track->flag^= SELECT;
- track->pat_flag^= SELECT;
- track->search_flag^= SELECT;
+ track->flag ^= SELECT;
+ track->pat_flag ^= SELECT;
+ track->search_flag ^= SELECT;
break;
}
}
}
- if(TRACK_VIEW_SELECTED(sc, track))
- has_selection= 1;
+ if (TRACK_VIEW_SELECTED(sc, track))
+ has_selection = TRUE;
- track= track->next;
+ track = track->next;
}
- if(!has_selection)
- sc->flag&= ~SC_LOCK_SELECTION;
+ if (!has_selection)
+ sc->flag &= ~SC_LOCK_SELECTION;
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
@@ -1080,16 +1103,16 @@ static int select_all_exec(bContext *C, wmOperator *op)
void CLIP_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select or Deselect All";
- ot->description= "Change selection of all tracking markers";
- ot->idname= "CLIP_OT_select_all";
+ ot->name = "(De)select All";
+ ot->description = "Change selection of all tracking markers";
+ ot->idname = "CLIP_OT_select_all";
/* api callbacks */
- ot->exec= select_all_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = select_all_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
WM_operator_properties_select_all(ot);
}
@@ -1098,56 +1121,58 @@ void CLIP_OT_select_all(wmOperatorType *ot)
static int select_groped_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
MovieTrackingTrack *track;
MovieTrackingMarker *marker;
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
- int group= RNA_enum_get(op->ptr, "group");
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
+ int group = RNA_enum_get(op->ptr, "group");
- track= tracksbase->first;
- while(track) {
- int ok= 0;
+ track = tracksbase->first;
+ while (track) {
+ int ok = FALSE;
- marker= BKE_tracking_get_marker(track, sc->user.framenr);
+ marker = BKE_tracking_get_marker(track, sc->user.framenr);
- if(group==0) { /* Keyframed */
- ok= marker->framenr==sc->user.framenr && (marker->flag&MARKER_TRACKED)==0;
+ if (group == 0) { /* Keyframed */
+ ok = marker->framenr == sc->user.framenr && (marker->flag & MARKER_TRACKED)==0;
}
- else if(group==1) { /* Estimated */
- ok= marker->framenr!=sc->user.framenr;
+ else if (group == 1) { /* Estimated */
+ ok = marker->framenr != sc->user.framenr;
}
- else if(group==2) { /* tracked */
- ok= marker->framenr==sc->user.framenr && (marker->flag&MARKER_TRACKED);
+ else if (group == 2) { /* tracked */
+ ok = marker->framenr == sc->user.framenr && (marker->flag & MARKER_TRACKED);
}
- else if(group==3) { /* locked */
- ok= track->flag&TRACK_LOCKED;
+ else if (group == 3) { /* locked */
+ ok = track->flag & TRACK_LOCKED;
}
- else if(group==4) { /* disabled */
- ok= marker->flag&MARKER_DISABLED;
+ else if (group == 4) { /* disabled */
+ ok = marker->flag & MARKER_DISABLED;
}
- else if(group==5) { /* color */
- MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking);
+ else if (group == 5) { /* color */
+ MovieTrackingTrack *act_track = BKE_tracking_active_track(tracking);
- if(act_track) {
- ok= (track->flag&TRACK_CUSTOMCOLOR) == (act_track->flag&TRACK_CUSTOMCOLOR);
+ if (act_track) {
+ ok = (track->flag & TRACK_CUSTOMCOLOR) == (act_track->flag & TRACK_CUSTOMCOLOR);
- if(ok && track->flag&TRACK_CUSTOMCOLOR)
- ok= equals_v3v3(track->color, act_track->color);
+ if (ok && track->flag & TRACK_CUSTOMCOLOR)
+ ok = equals_v3v3(track->color, act_track->color);
}
}
- else if(group==6) { /* failed */
- ok= (track->flag&TRACK_HAS_BUNDLE) == 0;
+ else if (group == 6) { /* failed */
+ ok = (track->flag & TRACK_HAS_BUNDLE) == 0;
}
- if(ok) {
- track->flag|= SELECT;
- if(sc->flag&SC_SHOW_MARKER_PATTERN) track->pat_flag|= SELECT;
- if(sc->flag&SC_SHOW_MARKER_SEARCH) track->search_flag|= SELECT;
+ if (ok) {
+ track->flag |= SELECT;
+ if (sc->flag & SC_SHOW_MARKER_PATTERN)
+ track->pat_flag |= SELECT;
+ if (sc->flag & SC_SHOW_MARKER_SEARCH)
+ track->search_flag |= SELECT;
}
- track= track->next;
+ track = track->next;
}
WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip);
@@ -1169,16 +1194,16 @@ void CLIP_OT_select_grouped(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Select Grouped";
- ot->description= "Joint Selected Tracks";
- ot->idname= "CLIP_OT_select_grouped";
+ ot->name = "Select Grouped";
+ ot->description = "Select all tracks from specified group";
+ ot->idname = "CLIP_OT_select_grouped";
/* api callbacks */
- ot->exec= select_groped_exec;
- ot->poll= space_clip_frame_poll;
+ ot->exec = select_groped_exec;
+ ot->poll = space_clip_frame_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* proeprties */
RNA_def_enum(ot->srna, "group", select_group_items, TRACK_CLEAR_REMAINED, "Action", "Clear action to execute");
@@ -1205,21 +1230,21 @@ static int track_markers_testbreak(void)
static int track_count_markers(SpaceClip *sc, MovieClip *clip)
{
- int tot= 0;
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
+ int tot = 0;
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
MovieTrackingTrack *track;
- int framenr= sc->user.framenr;
+ int framenr = sc->user.framenr;
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0) {
- MovieTrackingMarker *marker= BKE_tracking_get_marker(track, framenr);
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED) == 0) {
+ MovieTrackingMarker *marker = BKE_tracking_get_marker(track, framenr);
- if (!marker || (marker->flag&MARKER_DISABLED) == 0)
+ if (!marker || (marker->flag & MARKER_DISABLED) == 0)
tot++;
}
- track= track->next;
+ track = track->next;
}
return tot;
@@ -1227,19 +1252,19 @@ static int track_count_markers(SpaceClip *sc, MovieClip *clip)
static void clear_invisible_track_selection(SpaceClip *sc, MovieClip *clip)
{
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
int hidden = 0;
- if ((sc->flag&SC_SHOW_MARKER_PATTERN)==0)
+ if ((sc->flag & SC_SHOW_MARKER_PATTERN)==0)
hidden |= TRACK_AREA_PAT;
- if ((sc->flag&SC_SHOW_MARKER_SEARCH)==0)
+ if ((sc->flag & SC_SHOW_MARKER_SEARCH)==0)
hidden |= TRACK_AREA_SEARCH;
if (hidden) {
MovieTrackingTrack *track = tracksbase->first;
- while(track) {
+ while (track) {
if ((track->flag & TRACK_HIDDEN) == 0)
BKE_tracking_track_flag(track, hidden, SELECT, 1);
@@ -1250,129 +1275,141 @@ static void clear_invisible_track_selection(SpaceClip *sc, MovieClip *clip)
static void track_init_markers(SpaceClip *sc, MovieClip *clip, int *frames_limit_r)
{
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
MovieTrackingTrack *track;
- int framenr= sc->user.framenr;
- int frames_limit= 0;
+ int framenr = sc->user.framenr;
+ int frames_limit = 0;
clear_invisible_track_selection(sc, clip);
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track)) {
- if((track->flag&TRACK_HIDDEN)==0 && (track->flag&TRACK_LOCKED)==0) {
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track)) {
+ if ((track->flag & TRACK_HIDDEN)==0 && (track->flag & TRACK_LOCKED)==0) {
BKE_tracking_ensure_marker(track, framenr);
- if(track->frames_limit) {
- if(frames_limit==0)
- frames_limit= track->frames_limit;
+ if (track->frames_limit) {
+ if (frames_limit == 0)
+ frames_limit = track->frames_limit;
else
- frames_limit= MIN2(frames_limit, track->frames_limit);
+ frames_limit = MIN2(frames_limit, track->frames_limit);
}
}
}
- track= track->next;
+ track = track->next;
}
- *frames_limit_r= frames_limit;
+ *frames_limit_r = frames_limit;
}
static int track_markers_check_direction(int backwards, int curfra, int efra)
{
- if(backwards) {
- if(curfra<efra) return 0;
+ if (backwards) {
+ if (curfra < efra)
+ return FALSE;
}
else {
- if(curfra>efra) return 0;
+ if (curfra > efra)
+ return FALSE;
}
- return 1;
+ return TRUE;
}
static int track_markers_initjob(bContext *C, TrackMarkersJob *tmj, int backwards)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- Scene *scene= CTX_data_scene(C);
- MovieTrackingSettings *settings= &clip->tracking.settings;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ Scene *scene = CTX_data_scene(C);
+ MovieTrackingSettings *settings = &clip->tracking.settings;
int frames_limit;
track_init_markers(sc, clip, &frames_limit);
- tmj->sfra= sc->user.framenr;
- tmj->clip= clip;
- tmj->backwards= backwards;
+ tmj->sfra = sc->user.framenr;
+ tmj->clip = clip;
+ tmj->backwards = backwards;
- if(backwards) tmj->efra= SFRA;
- else tmj->efra= EFRA;
+ if (backwards)
+ tmj->efra = SFRA;
+ else
+ tmj->efra = EFRA;
/* limit frames to be tracked by user setting */
- if(frames_limit) {
- if(backwards) tmj->efra= MAX2(tmj->efra, tmj->sfra-frames_limit);
- else tmj->efra= MIN2(tmj->efra, tmj->sfra+frames_limit);
+ if (frames_limit) {
+ if (backwards)
+ tmj->efra = MAX2(tmj->efra, tmj->sfra - frames_limit);
+ else
+ tmj->efra = MIN2(tmj->efra, tmj->sfra + frames_limit);
}
- if(settings->speed!=TRACKING_SPEED_FASTEST) {
- tmj->delay= 1.0f/scene->r.frs_sec*1000.0f;
+ if (settings->speed != TRACKING_SPEED_FASTEST) {
+ tmj->delay = 1.0f / scene->r.frs_sec * 1000.0f;
- if(settings->speed==TRACKING_SPEED_HALF) tmj->delay*= 2;
- else if(settings->speed==TRACKING_SPEED_QUARTER) tmj->delay*= 4;
- else if(settings->speed==TRACKING_SPEED_DOUBLE) tmj->delay/= 2;
+ if (settings->speed == TRACKING_SPEED_HALF)
+ tmj->delay *= 2;
+ else if (settings->speed == TRACKING_SPEED_QUARTER)
+ tmj->delay *= 4;
+ else if (settings->speed == TRACKING_SPEED_DOUBLE)
+ tmj->delay /= 2;
}
- tmj->context= BKE_tracking_context_new(clip, &sc->user, backwards, 1);
+ tmj->context = BKE_tracking_context_new(clip, &sc->user, backwards, 1);
- clip->tracking_context= tmj->context;
+ clip->tracking_context = tmj->context;
- tmj->lastfra= tmj->sfra;
+ 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). */
- tmj->scene= scene;
- tmj->main= CTX_data_main(C);
- tmj->screen= CTX_wm_screen(C);
+ /* 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);
return track_markers_check_direction(backwards, tmj->sfra, tmj->efra);
}
static void track_markers_startjob(void *tmv, short *stop, short *do_update, float *progress)
{
- TrackMarkersJob *tmj= (TrackMarkersJob *)tmv;
- int framenr= tmj->sfra;
- //double t= PIL_check_seconds_timer();
+ TrackMarkersJob *tmj = (TrackMarkersJob *)tmv;
+ int framenr = tmj->sfra;
+ //double t = PIL_check_seconds_timer();
- while(framenr != tmj->efra) {
- if(tmj->delay>0) {
+ 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;
+ double start_time = PIL_check_seconds_timer(), exec_time;
- if(!BKE_tracking_next(tmj->context))
+ if (!BKE_tracking_next(tmj->context))
break;
- exec_time= PIL_check_seconds_timer()-start_time;
- if(tmj->delay > (float)exec_time)
+ exec_time = PIL_check_seconds_timer()-start_time;
+ if (tmj->delay > (float)exec_time)
PIL_sleep_ms(tmj->delay-(float)exec_time);
- } else if(!BKE_tracking_next(tmj->context))
+ }
+ else if (!BKE_tracking_next(tmj->context))
break;
- *do_update= 1;
- *progress=(float)(framenr-tmj->sfra) / (tmj->efra-tmj->sfra);
+ *do_update = TRUE;
+ *progress = (float)(framenr-tmj->sfra) / (tmj->efra-tmj->sfra);
- if(tmj->backwards) framenr--;
- else framenr++;
+ if (tmj->backwards)
+ framenr--;
+ else
+ framenr++;
- tmj->lastfra= framenr;
+ tmj->lastfra = framenr;
- if(*stop || track_markers_testbreak())
+ if (*stop || track_markers_testbreak())
break;
}
@@ -1381,17 +1418,17 @@ static void track_markers_startjob(void *tmv, short *stop, short *do_update, flo
static void track_markers_updatejob(void *tmv)
{
- TrackMarkersJob *tmj= (TrackMarkersJob *)tmv;
+ TrackMarkersJob *tmj = (TrackMarkersJob *)tmv;
BKE_tracking_sync(tmj->context);
}
static void track_markers_freejob(void *tmv)
{
- TrackMarkersJob *tmj= (TrackMarkersJob *)tmv;
+ TrackMarkersJob *tmj = (TrackMarkersJob *)tmv;
- tmj->clip->tracking_context= NULL;
- tmj->scene->r.cfra= tmj->lastfra;
+ tmj->clip->tracking_context = NULL;
+ tmj->scene->r.cfra = tmj->lastfra;
ED_update_for_newframe(tmj->main, tmj->scene, tmj->screen, 0);
BKE_tracking_sync(tmj->context);
@@ -1404,44 +1441,46 @@ static void track_markers_freejob(void *tmv)
static int track_markers_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- Scene *scene= CTX_data_scene(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ Scene *scene = CTX_data_scene(C);
struct MovieTrackingContext *context;
- int framenr= sc->user.framenr;
- int sfra= framenr, efra;
- int backwards= RNA_boolean_get(op->ptr, "backwards");
- int sequence= RNA_boolean_get(op->ptr, "sequence");
+ int framenr = sc->user.framenr;
+ int sfra = framenr, efra;
+ int backwards = RNA_boolean_get(op->ptr, "backwards");
+ int sequence = RNA_boolean_get(op->ptr, "sequence");
int frames_limit;
- if(track_count_markers(sc, clip)==0)
+ if (track_count_markers(sc, clip)==0)
return OPERATOR_CANCELLED;
track_init_markers(sc, clip, &frames_limit);
- if(backwards) efra= SFRA;
- else efra= EFRA;
+ if (backwards)
+ efra = SFRA;
+ else
+ efra = EFRA;
/* limit frames to be tracked by user setting */
- if(frames_limit) {
- if(backwards) efra= MAX2(efra, sfra-frames_limit);
- else efra= MIN2(efra, sfra+frames_limit);
+ if (frames_limit) {
+ if (backwards) efra = MAX2(efra, sfra-frames_limit);
+ else efra = MIN2(efra, sfra+frames_limit);
}
- if(!track_markers_check_direction(backwards, framenr, efra))
+ if (!track_markers_check_direction(backwards, framenr, efra))
return OPERATOR_CANCELLED;
/* do not disable tracks due to threshold when tracking frame-by-frame */
- context= BKE_tracking_context_new(clip, &sc->user, backwards, sequence);
+ context = BKE_tracking_context_new(clip, &sc->user, backwards, sequence);
- while(framenr != efra) {
- if(!BKE_tracking_next(context))
+ while (framenr != efra) {
+ if (!BKE_tracking_next(context))
break;
- if(backwards) framenr--;
+ if (backwards) framenr--;
else framenr++;
- if(!sequence)
+ if (!sequence)
break;
}
@@ -1449,7 +1488,7 @@ static int track_markers_exec(bContext *C, wmOperator *op)
BKE_tracking_context_free(context);
/* update scene current frame to the lastes tracked frame */
- scene->r.cfra= framenr;
+ scene->r.cfra = framenr;
WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip);
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
@@ -1460,48 +1499,48 @@ static int track_markers_exec(bContext *C, wmOperator *op)
static int track_markers_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
TrackMarkersJob *tmj;
- ScrArea *sa= CTX_wm_area(C);
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ ScrArea *sa = CTX_wm_area(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
wmJob *steve;
- int backwards= RNA_boolean_get(op->ptr, "backwards");
- int sequence= RNA_boolean_get(op->ptr, "sequence");
+ int backwards = RNA_boolean_get(op->ptr, "backwards");
+ int sequence = RNA_boolean_get(op->ptr, "sequence");
- if(WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C))) {
+ if (WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C))) {
/* only one tracking is allowed at a time */
return OPERATOR_CANCELLED;
}
- if(clip->tracking_context)
+ if (clip->tracking_context)
return OPERATOR_CANCELLED;
- if(track_count_markers(sc, clip)==0)
+ if (track_count_markers(sc, clip)==0)
return OPERATOR_CANCELLED;
- if(!sequence)
+ if (!sequence)
return track_markers_exec(C, op);
- tmj= MEM_callocN(sizeof(TrackMarkersJob), "TrackMarkersJob data");
- if(!track_markers_initjob(C, tmj, backwards)) {
+ tmj = MEM_callocN(sizeof(TrackMarkersJob), "TrackMarkersJob data");
+ if (!track_markers_initjob(C, tmj, backwards)) {
track_markers_freejob(tmj);
return OPERATOR_CANCELLED;
}
/* setup job */
- steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), sa, "Track Markers", WM_JOB_PROGRESS);
+ steve = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), sa, "Track Markers", WM_JOB_PROGRESS);
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. */
- if(tmj->delay>0) WM_jobs_timer(steve, tmj->delay/1000.0f, NC_MOVIECLIP|NA_EVALUATED, 0);
+ * 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);
WM_jobs_callbacks(steve, track_markers_startjob, NULL, track_markers_updatejob, NULL);
- G.afbreek= 0;
+ G.afbreek = 0;
WM_jobs_start(CTX_wm_manager(C), steve);
WM_cursor_wait(0);
@@ -1515,7 +1554,7 @@ static int track_markers_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
static int track_markers_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
/* no running tracking, remove handler and pass through */
- if(0==WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C)))
+ if (0==WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C)))
return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
/* running tracking */
@@ -1531,18 +1570,18 @@ static int track_markers_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *eve
void CLIP_OT_track_markers(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Track Markers";
- ot->description= "Track selected markers";
- ot->idname= "CLIP_OT_track_markers";
+ ot->name = "Track Markers";
+ ot->description = "Track selected markers";
+ ot->idname = "CLIP_OT_track_markers";
/* api callbacks */
- ot->exec= track_markers_exec;
- ot->invoke= track_markers_invoke;
- ot->poll= space_clip_frame_poll;
- ot->modal= track_markers_modal;
+ ot->exec = track_markers_exec;
+ ot->invoke = track_markers_invoke;
+ ot->poll = space_clip_frame_poll;
+ ot->modal = track_markers_modal;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "backwards", 0, "Backwards", "Do backwards tracking");
@@ -1565,44 +1604,44 @@ typedef struct {
static int solve_camera_initjob(bContext *C, SolveCameraJob *scj, wmOperator *op, char *error_msg, int max_error)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- Scene *scene= CTX_data_scene(C);
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingSettings *settings= &clip->tracking.settings;
- MovieTrackingObject *object= BKE_tracking_active_object(tracking);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ Scene *scene = CTX_data_scene(C);
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingSettings *settings = &clip->tracking.settings;
+ MovieTrackingObject *object = BKE_tracking_active_object(tracking);
int width, height;
- if(!BKE_tracking_can_reconstruct(tracking, object, error_msg, max_error))
+ if (!BKE_tracking_can_reconstruct(tracking, object, error_msg, max_error))
return 0;
/* could fail if footage uses images with different sizes */
BKE_movieclip_get_size(clip, &sc->user, &width, &height);
- scj->clip= clip;
- scj->scene= scene;
- scj->reports= op->reports;
- scj->user= sc->user;
+ scj->clip = clip;
+ scj->scene = scene;
+ scj->reports = op->reports;
+ scj->user = sc->user;
- scj->context= BKE_tracking_reconstruction_context_new(tracking, object,
+ scj->context = BKE_tracking_reconstruction_context_new(tracking, object,
settings->keyframe1, settings->keyframe2, width, height);
- tracking->stats= MEM_callocN(sizeof(MovieTrackingStats), "solve camera stats");
+ tracking->stats = MEM_callocN(sizeof(MovieTrackingStats), "solve camera stats");
return 1;
}
static void solve_camera_updatejob(void *scv)
{
- SolveCameraJob *scj= (SolveCameraJob *)scv;
- MovieTracking *tracking= &scj->clip->tracking;
+ SolveCameraJob *scj = (SolveCameraJob *)scv;
+ MovieTracking *tracking = &scj->clip->tracking;
BLI_strncpy(tracking->stats->message, scj->stats_message, sizeof(tracking->stats->message));
}
static void solve_camera_startjob(void *scv, short *stop, short *do_update, float *progress)
{
- SolveCameraJob *scj= (SolveCameraJob *)scv;
+ SolveCameraJob *scj = (SolveCameraJob *)scv;
BKE_tracking_solve_reconstruction(scj->context, stop, do_update, progress,
scj->stats_message, sizeof(scj->stats_message));
@@ -1610,35 +1649,35 @@ static void solve_camera_startjob(void *scv, short *stop, short *do_update, floa
static void solve_camera_freejob(void *scv)
{
- SolveCameraJob *scj= (SolveCameraJob *)scv;
- MovieTracking *tracking= &scj->clip->tracking;
- Scene *scene= scj->scene;
- MovieClip *clip= scj->clip;
+ SolveCameraJob *scj = (SolveCameraJob *)scv;
+ MovieTracking *tracking = &scj->clip->tracking;
+ Scene *scene = scj->scene;
+ MovieClip *clip = scj->clip;
int solved;
- if(!scj->context) {
+ if (!scj->context) {
/* job weren't fully initialized due to some error */
MEM_freeN(scj);
return;
}
- solved= BKE_tracking_finish_reconstruction(scj->context, tracking);
+ solved = BKE_tracking_finish_reconstruction(scj->context, tracking);
- if(!solved)
+ 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)
+ if (scene->clip)
id_us_min(&clip->id);
- scene->clip= clip;
+ scene->clip = clip;
id_us_plus(&clip->id);
/* set blender camera focal length so result would look fine there */
- if(scene->camera) {
- Camera *camera= (Camera*)scene->camera->data;
+ if (scene->camera) {
+ Camera *camera = (Camera*)scene->camera->data;
int width, height;
BKE_movieclip_get_size(clip, &scj->user, &width, &height);
@@ -1649,7 +1688,7 @@ static void solve_camera_freejob(void *scv)
}
MEM_freeN(tracking->stats);
- tracking->stats= NULL;
+ tracking->stats = NULL;
DAG_id_tag_update(&clip->id, 0);
@@ -1666,11 +1705,11 @@ static void solve_camera_freejob(void *scv)
static int solve_camera_exec(bContext *C, wmOperator *op)
{
SolveCameraJob *scj;
- char error_msg[256]= "\0";
+ char error_msg[256] = "\0";
- scj= MEM_callocN(sizeof(SolveCameraJob), "SolveCameraJob data");
- if(!solve_camera_initjob(C, scj, op, error_msg, sizeof(error_msg))) {
- if(error_msg[0])
+ scj = MEM_callocN(sizeof(SolveCameraJob), "SolveCameraJob data");
+ if (!solve_camera_initjob(C, scj, op, error_msg, sizeof(error_msg))) {
+ if (error_msg[0])
BKE_report(op->reports, RPT_ERROR, error_msg);
solve_camera_freejob(scj);
@@ -1688,22 +1727,22 @@ static int solve_camera_exec(bContext *C, wmOperator *op)
static int solve_camera_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
SolveCameraJob *scj;
- ScrArea *sa= CTX_wm_area(C);
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingReconstruction *reconstruction= BKE_tracking_get_reconstruction(tracking);
+ ScrArea *sa = CTX_wm_area(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingReconstruction *reconstruction = BKE_tracking_get_reconstruction(tracking);
wmJob *steve;
- char error_msg[256]= "\0";
+ char error_msg[256] = "\0";
- if(WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C))) {
+ if (WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C))) {
/* only one solve is allowed at a time */
return OPERATOR_CANCELLED;
}
- scj= MEM_callocN(sizeof(SolveCameraJob), "SolveCameraJob data");
- if(!solve_camera_initjob(C, scj, op, error_msg, sizeof(error_msg))) {
- if(error_msg[0])
+ scj = MEM_callocN(sizeof(SolveCameraJob), "SolveCameraJob data");
+ if (!solve_camera_initjob(C, scj, op, error_msg, sizeof(error_msg))) {
+ if (error_msg[0])
BKE_report(op->reports, RPT_ERROR, error_msg);
solve_camera_freejob(scj);
@@ -1714,16 +1753,16 @@ static int solve_camera_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
BLI_strncpy(tracking->stats->message, "Solving camera | Preparing solve", sizeof(tracking->stats->message));
/* hide reconstruction statistics from previous solve */
- reconstruction->flag&= ~TRACKING_RECONSTRUCTED;
+ reconstruction->flag &= ~TRACKING_RECONSTRUCTED;
WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip);
/* setup job */
- steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), sa, "Solve Camera", WM_JOB_PROGRESS);
+ steve = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), sa, "Solve Camera", WM_JOB_PROGRESS);
WM_jobs_customdata(steve, scj, solve_camera_freejob);
WM_jobs_timer(steve, 0.1, NC_MOVIECLIP|NA_EVALUATED, 0);
WM_jobs_callbacks(steve, solve_camera_startjob, NULL, solve_camera_updatejob, NULL);
- G.afbreek= 0;
+ G.afbreek = 0;
WM_jobs_start(CTX_wm_manager(C), steve);
WM_cursor_wait(0);
@@ -1737,7 +1776,7 @@ static int solve_camera_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
static int solve_camera_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
/* no running solver, remove handler and pass through */
- if(0==WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C)))
+ if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C)))
return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
/* running tracking */
@@ -1753,44 +1792,44 @@ static int solve_camera_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *even
void CLIP_OT_solve_camera(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Solve Camera";
- ot->description= "Solve camera motion from tracks";
- ot->idname= "CLIP_OT_solve_camera";
+ ot->name = "Solve Camera";
+ ot->description = "Solve camera motion from tracks";
+ ot->idname = "CLIP_OT_solve_camera";
/* api callbacks */
- ot->exec= solve_camera_exec;
- ot->invoke= solve_camera_invoke;
- ot->modal= solve_camera_modal;
- ot->poll= ED_space_clip_poll;
+ ot->exec = solve_camera_exec;
+ ot->invoke = solve_camera_invoke;
+ ot->modal = solve_camera_modal;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** clear solution operator *********************/
static int clear_solution_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
- MovieTrackingReconstruction *reconstruction= BKE_tracking_get_reconstruction(tracking);
- MovieTrackingTrack *track= tracksbase->first;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
+ MovieTrackingReconstruction *reconstruction = BKE_tracking_get_reconstruction(tracking);
+ MovieTrackingTrack *track = tracksbase->first;
- while(track) {
- track->flag&= ~TRACK_HAS_BUNDLE;
+ while (track) {
+ track->flag &= ~TRACK_HAS_BUNDLE;
- track= track->next;
+ track = track->next;
}
- if(reconstruction->cameras)
+ if (reconstruction->cameras)
MEM_freeN(reconstruction->cameras);
- reconstruction->cameras= NULL;
- reconstruction->camnr= 0;
+ reconstruction->cameras = NULL;
+ reconstruction->camnr = 0;
- reconstruction->flag&= ~TRACKING_RECONSTRUCTED;
+ reconstruction->flag &= ~TRACKING_RECONSTRUCTED;
DAG_id_tag_update(&clip->id, 0);
@@ -1803,34 +1842,41 @@ static int clear_solution_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_clear_solution(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Solution";
- ot->description= "Clear all calculated data";
- ot->idname= "CLIP_OT_clear_solution";
+ ot->name = "Clear Solution";
+ ot->description = "Clear all calculated data";
+ ot->idname = "CLIP_OT_clear_solution";
/* api callbacks */
- ot->exec= clear_solution_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = clear_solution_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** clear track operator *********************/
static int clear_track_path_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
MovieTrackingTrack *track;
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
- int action= RNA_enum_get(op->ptr, "action");
+ 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);
@@ -1848,42 +1894,45 @@ void CLIP_OT_clear_track_path(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Clear Track Path";
- ot->description= "Clear tracks after/before current position or clear the whole track";
- ot->idname= "CLIP_OT_clear_track_path";
+ ot->name = "Clear Track Path";
+ ot->description = "Clear tracks after/before current position or clear the whole track";
+ ot->idname = "CLIP_OT_clear_track_path";
/* api callbacks */
- ot->exec= clear_track_path_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = clear_track_path_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* 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 *********************/
static int disable_markers_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
- MovieTrackingTrack *track= tracksbase->first;
- int action= RNA_enum_get(op->ptr, "action");
-
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0) {
- MovieTrackingMarker *marker= BKE_tracking_ensure_marker(track, sc->user.framenr);
-
- if(action==0) marker->flag|= MARKER_DISABLED;
- else if(action==1) marker->flag&= ~MARKER_DISABLED;
- else marker->flag^= MARKER_DISABLED;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
+ MovieTrackingTrack *track = tracksbase->first;
+ int action = RNA_enum_get(op->ptr, "action");
+
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED)==0) {
+ MovieTrackingMarker *marker = BKE_tracking_ensure_marker(track, sc->user.framenr);
+
+ if (action == 0)
+ marker->flag |= MARKER_DISABLED;
+ else if (action == 1)
+ marker->flag &= ~MARKER_DISABLED;
+ else marker->flag ^= MARKER_DISABLED;
}
- track= track->next;
+ track = track->next;
}
DAG_id_tag_update(&clip->id, 0);
@@ -1903,16 +1952,16 @@ void CLIP_OT_disable_markers(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Disable Markers";
- ot->description= "Disable/enable selected markers";
- ot->idname= "CLIP_OT_disable_markers";
+ ot->name = "Disable Markers";
+ ot->description = "Disable/enable selected markers";
+ ot->idname = "CLIP_OT_disable_markers";
/* api callbacks */
- ot->exec= disable_markers_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = disable_markers_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "action", actions_items, 0, "Action", "Disable action to execute");
@@ -1922,22 +1971,22 @@ void CLIP_OT_disable_markers(wmOperatorType *ot)
static Object *get_camera_with_movieclip(Scene *scene, MovieClip *clip)
{
- Object *camera= scene->camera;
+ Object *camera = scene->camera;
Base *base;
- if(camera && object_get_movieclip(scene, camera, 0)==clip)
+ if (camera && object_get_movieclip(scene, camera, 0)==clip)
return camera;
- base= scene->base.first;
- while(base) {
- if(base->object->type == OB_CAMERA) {
- if(object_get_movieclip(scene, base->object, 0)==clip) {
- camera= base->object;
+ base = scene->base.first;
+ while (base) {
+ if (base->object->type == OB_CAMERA) {
+ if (object_get_movieclip(scene, base->object, 0)==clip) {
+ camera = base->object;
break;
}
}
- base= base->next;
+ base = base->next;
}
return camera;
@@ -1945,60 +1994,60 @@ static Object *get_camera_with_movieclip(Scene *scene, MovieClip *clip)
static Object *get_orientation_object(bContext *C)
{
- Scene *scene= CTX_data_scene(C);
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingObject *tracking_object= BKE_tracking_active_object(tracking);
- Object *object= NULL;
+ Scene *scene = CTX_data_scene(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingObject *tracking_object = BKE_tracking_active_object(tracking);
+ Object *object = NULL;
- if(tracking_object->flag&TRACKING_OBJECT_CAMERA) {
- object= get_camera_with_movieclip(scene, clip);
+ if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
+ object = get_camera_with_movieclip(scene, clip);
}
else {
- object= OBACT;
+ object = OBACT;
}
- if(object && object->parent)
- object= object->parent;
+ if (object && object->parent)
+ object = object->parent;
return object;
}
static int set_orientation_poll(bContext *C)
{
- if(space_clip_frame_poll(C)) {
- Scene *scene= CTX_data_scene(C);
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingObject *tracking_object= BKE_tracking_active_object(tracking);
+ if (space_clip_frame_poll(C)) {
+ Scene *scene = CTX_data_scene(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingObject *tracking_object = BKE_tracking_active_object(tracking);
- if(tracking_object->flag&TRACKING_OBJECT_CAMERA) {
- return 1;
+ if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
+ return TRUE;
}
else {
return OBACT != NULL;
}
}
- return 0;
+ return FALSE;
}
static int count_selected_bundles(bContext *C)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
MovieTrackingTrack *track;
- int tot= 0;
+ int tot = 0;
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_HAS_BUNDLE))
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_HAS_BUNDLE))
tot++;
- track= track->next;
+ track = track->next;
}
return tot;
@@ -2007,30 +2056,30 @@ static int count_selected_bundles(bContext *C)
static void object_solver_inverted_matrix(Scene *scene, Object *ob, float invmat[4][4])
{
bConstraint *con;
- int found= 0;
+ int found = FALSE;
- for (con= ob->constraints.first; con; con=con->next) {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
+ for (con = ob->constraints.first; con; con = con->next) {
+ bConstraintTypeInfo *cti = constraint_get_typeinfo(con);
- if(!cti)
+ if (!cti)
continue;
- if(cti->type==CONSTRAINT_TYPE_OBJECTSOLVER) {
- bObjectSolverConstraint *data= (bObjectSolverConstraint *)con->data;
+ if (cti->type == CONSTRAINT_TYPE_OBJECTSOLVER) {
+ bObjectSolverConstraint *data = (bObjectSolverConstraint *)con->data;
- if(!found) {
- Object *cam= data->camera ? data->camera : scene->camera;
+ if (!found) {
+ Object *cam = data->camera ? data->camera : scene->camera;
where_is_object_mat(scene, cam, invmat);
}
mult_m4_m4m4(invmat, invmat, data->invmat);
- found= 1;
+ found = TRUE;
}
}
- if(found)
+ if (found)
invert_m4(invmat);
else
unit_m4(invmat);
@@ -2040,14 +2089,14 @@ static Object *object_solver_camera(Scene *scene, Object *ob)
{
bConstraint *con;
- for (con= ob->constraints.first; con; con=con->next) {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
+ for (con = ob->constraints.first; con; con = con->next) {
+ bConstraintTypeInfo *cti = constraint_get_typeinfo(con);
- if(!cti)
+ if (!cti)
continue;
- if(cti->type==CONSTRAINT_TYPE_OBJECTSOLVER) {
- bObjectSolverConstraint *data= (bObjectSolverConstraint *)con->data;
+ if (cti->type == CONSTRAINT_TYPE_OBJECTSOLVER) {
+ bObjectSolverConstraint *data = (bObjectSolverConstraint *)con->data;
return data->camera ? data->camera : scene->camera;
}
@@ -2058,43 +2107,43 @@ static Object *object_solver_camera(Scene *scene, Object *ob)
static int set_origin_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
MovieTrackingTrack *track;
MovieTrackingObject *tracking_object;
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
Object *object;
- Object *camera= get_camera_with_movieclip(scene, clip);
+ Object *camera = get_camera_with_movieclip(scene, clip);
ListBase *tracksbase;
float mat[4][4], vec[3], median[3];
- int selected_count= count_selected_bundles(C);
+ int selected_count = count_selected_bundles(C);
- if(selected_count==0) {
+ if (selected_count == 0) {
BKE_report(op->reports, RPT_ERROR, "At least one track with bundle should be selected to define origin position");
return OPERATOR_CANCELLED;
}
- object= get_orientation_object(C);
- if(!object) {
+ object = get_orientation_object(C);
+ if (!object) {
BKE_report(op->reports, RPT_ERROR, "No object to apply orientation on");
return OPERATOR_CANCELLED;
}
- tracking_object= BKE_tracking_active_object(tracking);
+ tracking_object = BKE_tracking_active_object(tracking);
- tracksbase= BKE_tracking_object_tracks(tracking, tracking_object);
+ tracksbase = BKE_tracking_object_tracks(tracking, tracking_object);
- track= tracksbase->first;
+ track = tracksbase->first;
zero_v3(median);
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_HAS_BUNDLE)) {
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_HAS_BUNDLE)) {
add_v3_v3(median, track->bundle_pos);
}
- track= track->next;
+ track = track->next;
}
mul_v3_fl(median, 1.0f/selected_count);
@@ -2102,7 +2151,7 @@ static int set_origin_exec(bContext *C, wmOperator *op)
mul_v3_m4v3(vec, mat, median);
- if(tracking_object->flag&TRACKING_OBJECT_CAMERA) {
+ if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
sub_v3_v3(object->loc, vec);
}
else {
@@ -2123,16 +2172,16 @@ static int set_origin_exec(bContext *C, wmOperator *op)
void CLIP_OT_set_origin(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Origin";
- ot->description= "Set active marker as origin by moving camera (or it's parent if present) in 3D space";
- ot->idname= "CLIP_OT_set_origin";
+ ot->name = "Set Origin";
+ ot->description = "Set active marker as origin by moving camera (or it's parent if present) in 3D space";
+ ot->idname = "CLIP_OT_set_origin";
/* api callbacks */
- ot->exec= set_origin_exec;
- ot->poll= set_orientation_poll;
+ ot->exec = set_origin_exec;
+ ot->poll = set_orientation_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "use_median", 0, "Use Median", "Set origin to median point of selected bundles");
@@ -2143,9 +2192,9 @@ void CLIP_OT_set_origin(wmOperatorType *ot)
static void set_axis(Scene *scene, Object *ob, MovieClip *clip, MovieTrackingObject *tracking_object,
MovieTrackingTrack *track, char axis)
{
- Object *camera= get_camera_with_movieclip(scene, clip);
- int is_camera= tracking_object->flag&TRACKING_OBJECT_CAMERA;
- int flip= 0;
+ Object *camera = get_camera_with_movieclip(scene, clip);
+ int is_camera = tracking_object->flag & TRACKING_OBJECT_CAMERA;
+ int flip = FALSE;
float mat[4][4], vec[3], obmat[4][4], dvec[3];
object_to_mat4(ob, obmat);
@@ -2154,7 +2203,7 @@ static void set_axis(Scene *scene, Object *ob, MovieClip *clip, MovieTrackingOb
mul_v3_m4v3(vec, mat, track->bundle_pos);
copy_v3_v3(dvec, vec);
- if(!is_camera) {
+ if (!is_camera) {
float imat[4][4];
object_solver_inverted_matrix(scene, ob, imat);
@@ -2166,50 +2215,53 @@ static void set_axis(Scene *scene, Object *ob, MovieClip *clip, MovieTrackingOb
sub_v3_v3(vec, obmat[3]);
}
- if(len_v2(vec) < 1e-3f)
+ if (len_v2(vec) < 1e-3f)
return;
unit_m4(mat);
- if(axis=='X') {
- if(fabsf(dvec[1])<1e-3f) {
- flip= 1;
+ if (axis == 'X') {
+ if (fabsf(dvec[1]) < 1e-3f) {
+ flip = TRUE;
- mat[0][0]= -1.0f; mat[0][1]= 0.0f; mat[0][2]= 0.0f;
- mat[1][0]= 0.0f; mat[1][1]= -1.0f; mat[1][2]= 0.0f;
- mat[2][0]= 0.0f; mat[2][1]= 0.0f; mat[2][2]= 1.0f;
- } else {
+ mat[0][0] = -1.0f; mat[0][1] = 0.0f; mat[0][2] = 0.0f;
+ mat[1][0] = 0.0f; mat[1][1] = -1.0f; mat[1][2] = 0.0f;
+ mat[2][0] = 0.0f; mat[2][1] = 0.0f; mat[2][2] = 1.0f;
+ }
+ else {
copy_v3_v3(mat[0], vec);
- if(is_camera || fabsf(vec[2])<1e-3f) {
- mat[0][2]= 0.0f;
- mat[2][0]= 0.0f; mat[2][1]= 0.0f; mat[2][2]= 1.0f;
+ if (is_camera || fabsf(vec[2]) < 1e-3f) {
+ mat[0][2] = 0.0f;
+ mat[2][0] = 0.0f; mat[2][1] = 0.0f; mat[2][2] = 1.0f;
cross_v3_v3v3(mat[1], mat[2], mat[0]);
}
else {
- vec[2]= 0.0f;
+ vec[2] = 0.0f;
cross_v3_v3v3(mat[1], mat[0], vec);
cross_v3_v3v3(mat[2], mat[0], mat[1]);
}
}
- } else {
- if(fabsf(dvec[0])<1e-3f) {
- flip= 1;
-
- mat[0][0]= -1.0f; mat[0][1]= 0.0f; mat[0][2]= 0.0f;
- mat[1][0]= 0.0f; mat[1][1]= -1.0f; mat[1][2]= 0.0f;
- mat[2][0]= 0.0f; mat[2][1]= 0.0f; mat[2][2]= 1.0f;
- } else {
+ }
+ else {
+ if (fabsf(dvec[0]) < 1e-3f) {
+ flip = TRUE;
+
+ mat[0][0] = -1.0f; mat[0][1] = 0.0f; mat[0][2] = 0.0f;
+ mat[1][0] = 0.0f; mat[1][1] = -1.0f; mat[1][2] = 0.0f;
+ mat[2][0] = 0.0f; mat[2][1] = 0.0f; mat[2][2] = 1.0f;
+ }
+ else {
copy_v3_v3(mat[1], vec);
- if(is_camera || fabsf(vec[2])<1e-3f) {
- mat[1][2]= 0.0f;
- mat[2][0]= 0.0f; mat[2][1]= 0.0f; mat[2][2]= 1.0f;
+ if (is_camera || fabsf(vec[2])<1e-3f) {
+ mat[1][2] = 0.0f;
+ mat[2][0] = 0.0f; mat[2][1] = 0.0f; mat[2][2] = 1.0f;
cross_v3_v3v3(mat[0], mat[1], mat[2]);
}
else {
- vec[2]= 0.0f;
+ vec[2] = 0.0f;
cross_v3_v3v3(mat[0], vec, mat[1]);
cross_v3_v3v3(mat[2], mat[0], mat[1]);
@@ -2221,13 +2273,13 @@ static void set_axis(Scene *scene, Object *ob, MovieClip *clip, MovieTrackingOb
normalize_v3(mat[1]);
normalize_v3(mat[2]);
- if(is_camera) {
+ if (is_camera) {
invert_m4(mat);
mult_m4_m4m4(mat, mat, obmat);
}
else {
- if(!flip) {
+ if (!flip) {
float lmat[4][4], ilmat[4][4], rmat[3][3];
object_rot_to_mat3(ob, rmat);
@@ -2248,36 +2300,37 @@ 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);
- Scene *scene= CTX_data_scene(C);
- MovieTracking *tracking= &clip->tracking;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ Scene *scene = CTX_data_scene(C);
+ MovieTracking *tracking = &clip->tracking;
MovieTrackingObject *tracking_object;
- MovieTrackingTrack *track, *axis_track= NULL, *act_track;
+ MovieTrackingTrack *track, *axis_track = NULL, *act_track;
ListBase *tracksbase;
Object *object;
- 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};
- 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},
- {0.0f, 0.0f, 0.0f, 1.0f}}; /* 90 degrees Y-axis rotation matrix */
-
- if(count_selected_bundles(C)!=3) {
+ 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},
+ {0.0f, 0.0f, 0.0f, 1.0f}}; /* 90 degrees Y-axis rotation matrix */
+
+ if (count_selected_bundles(C)!=3) {
BKE_report(op->reports, RPT_ERROR, "Three tracks with bundles are needed to orient the floor");
return OPERATOR_CANCELLED;
}
- tracking_object= BKE_tracking_active_object(tracking);
- tracksbase= BKE_tracking_object_tracks(tracking, tracking_object);
- act_track= BKE_tracking_active_track(tracking);
+ tracking_object = BKE_tracking_active_object(tracking);
+ tracksbase = BKE_tracking_object_tracks(tracking, tracking_object);
+ act_track = BKE_tracking_active_track(tracking);
- object= get_orientation_object(C);
- if(!object) {
+ object = get_orientation_object(C);
+ if (!object) {
BKE_report(op->reports, RPT_ERROR, "No object to apply orientation on");
return OPERATOR_CANCELLED;
@@ -2286,20 +2339,20 @@ static int set_floor_exec(bContext *C, wmOperator *op)
BKE_get_tracking_mat(scene, camera, mat);
/* get 3 bundles to use as reference */
- track= tracksbase->first;
- while(track && tot<3) {
- if(track->flag&TRACK_HAS_BUNDLE && TRACK_VIEW_SELECTED(sc, track)) {
+ track = tracksbase->first;
+ while (track && tot<3) {
+ if (track->flag & TRACK_HAS_BUNDLE && TRACK_VIEW_SELECTED(sc, track)) {
mul_v3_m4v3(vec[tot], mat, track->bundle_pos);
- if(tot==0 || track==act_track)
+ if (tot == 0 || track == act_track)
copy_v3_v3(orig, vec[tot]);
else
- axis_track= track;
+ axis_track = track;
tot++;
}
- track= track->next;
+ track = track->next;
}
sub_v3_v3(vec[1], vec[0]);
@@ -2308,20 +2361,27 @@ 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]);
normalize_v3(mat[2]);
/* move to origin point */
- mat[3][0]= orig[0];
- mat[3][1]= orig[1];
- mat[3][2]= orig[2];
+ mat[3][0] = orig[0];
+ mat[3][1] = orig[1];
+ mat[3][2] = orig[2];
- if(tracking_object->flag&TRACKING_OBJECT_CAMERA) {
+ if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
invert_m4(mat);
object_to_mat4(object, obmat);
@@ -2330,7 +2390,7 @@ static int set_floor_exec(bContext *C, wmOperator *op)
object_apply_mat4(object, newmat, 0, 0);
/* make camera have positive z-coordinate */
- if(object->loc[2]<0) {
+ if (object->loc[2]<0) {
invert_m4(rot);
mult_m4_m4m4(newmat, rot, mat);
object_apply_mat4(object, newmat, 0, 0);
@@ -2352,59 +2412,68 @@ 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->poll= set_orientation_poll;
+ ot->exec = set_plane_exec;
+ ot->poll = set_orientation_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ 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 *********************/
static int set_axis_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingObject *tracking_object= BKE_tracking_active_object(tracking);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingObject *tracking_object = BKE_tracking_active_object(tracking);
MovieTrackingTrack *track;
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
Object *object;
ListBase *tracksbase;
- int axis= RNA_enum_get(op->ptr, "axis");
+ int axis = RNA_enum_get(op->ptr, "axis");
- if(count_selected_bundles(C)!=1) {
+ if (count_selected_bundles(C)!=1) {
BKE_report(op->reports, RPT_ERROR, "Single track with bundle should be selected to define axis");
return OPERATOR_CANCELLED;
}
- object= get_orientation_object(C);
- if(!object) {
+ object = get_orientation_object(C);
+ if (!object) {
BKE_report(op->reports, RPT_ERROR, "No object to apply orientation on");
return OPERATOR_CANCELLED;
}
- tracksbase= BKE_tracking_object_tracks(tracking, tracking_object);
+ tracksbase = BKE_tracking_object_tracks(tracking, tracking_object);
- track=tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track))
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track))
break;
- track= track->next;
+ track = track->next;
}
- set_axis(scene, object, clip, tracking_object, track, axis==0?'X':'Y');
+ set_axis(scene, object, clip, tracking_object, track, axis == 0 ? 'X' : 'Y');
DAG_id_tag_update(&clip->id, 0);
DAG_id_tag_update(&object->id, OB_RECALC_OB);
@@ -2424,16 +2493,16 @@ void CLIP_OT_set_axis(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Set Axis";
- ot->description= "Set direction of scene axis rotating camera (or it's parent if present) and assuming selected track lies on real axis joining it with the origin";
- ot->idname= "CLIP_OT_set_axis";
+ ot->name = "Set Axis";
+ ot->description = "Set direction of scene axis rotating camera (or it's parent if present) and assuming selected track lies on real axis joining it with the origin";
+ ot->idname = "CLIP_OT_set_axis";
/* api callbacks */
- ot->exec= set_axis_exec;
- ot->poll= set_orientation_poll;
+ ot->exec = set_axis_exec;
+ ot->poll = set_orientation_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "axis", axis_actions, 0, "Axis", "Axis to use to align bundle along");
@@ -2443,27 +2512,27 @@ void CLIP_OT_set_axis(wmOperatorType *ot)
static int do_set_scale(bContext *C, wmOperator *op, int scale_solution)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingObject *tracking_object= BKE_tracking_active_object(tracking);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingObject *tracking_object = BKE_tracking_active_object(tracking);
MovieTrackingTrack *track;
- Scene *scene= CTX_data_scene(C);
- Object *object= NULL;
- Object *camera= get_camera_with_movieclip(scene, clip);
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
- int tot= 0;
+ Scene *scene = CTX_data_scene(C);
+ Object *object = NULL;
+ Object *camera = get_camera_with_movieclip(scene, clip);
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
+ int tot = 0;
float vec[2][3], mat[4][4], scale;
- float dist= RNA_float_get(op->ptr, "distance");
+ float dist = RNA_float_get(op->ptr, "distance");
- if(count_selected_bundles(C)!=2) {
+ if (count_selected_bundles(C) != 2) {
BKE_report(op->reports, RPT_ERROR, "Two tracks with bundles should be selected to set scale");
return OPERATOR_CANCELLED;
}
- object= get_orientation_object(C);
- if(!object) {
+ object = get_orientation_object(C);
+ if (!object) {
BKE_report(op->reports, RPT_ERROR, "No object to apply orientation on");
return OPERATOR_CANCELLED;
@@ -2471,43 +2540,43 @@ static int do_set_scale(bContext *C, wmOperator *op, int scale_solution)
BKE_get_tracking_mat(scene, camera, mat);
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track)) {
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track)) {
mul_v3_m4v3(vec[tot], mat, track->bundle_pos);
tot++;
}
- track= track->next;
+ track = track->next;
}
sub_v3_v3(vec[0], vec[1]);
- if(len_v3(vec[0])>1e-5f) {
- scale= dist / len_v3(vec[0]);
+ if (len_v3(vec[0])>1e-5f) {
+ scale = dist / len_v3(vec[0]);
- if(tracking_object->flag&TRACKING_OBJECT_CAMERA) {
+ if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
mul_v3_fl(object->size, scale);
mul_v3_fl(object->loc, scale);
}
- else if(!scale_solution){
- Object *solver_camera= object_solver_camera(scene, object);
+ else if (!scale_solution) {
+ Object *solver_camera = object_solver_camera(scene, object);
- object->size[0]= object->size[1]= object->size[2]= 1.0f/scale;
+ object->size[0] = object->size[1] = object->size[2] = 1.0f/scale;
- if(solver_camera) {
- object->size[0]/= solver_camera->size[0];
- object->size[1]/= solver_camera->size[1];
- object->size[2]/= solver_camera->size[2];
+ if (solver_camera) {
+ object->size[0] /= solver_camera->size[0];
+ object->size[1] /= solver_camera->size[1];
+ object->size[2] /= solver_camera->size[2];
}
}
else {
- tracking_object->scale= scale;
+ tracking_object->scale = scale;
}
DAG_id_tag_update(&clip->id, 0);
- if(object)
+ if (object)
DAG_id_tag_update(&object->id, OB_RECALC_OB);
WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip);
@@ -2524,10 +2593,10 @@ static int set_scale_exec(bContext *C, wmOperator *op)
static int set_scale_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
- if(!RNA_struct_property_is_set(op->ptr, "distance"))
+ if (!RNA_struct_property_is_set(op->ptr, "distance"))
RNA_float_set(op->ptr, "distance", clip->tracking.settings.dist);
return set_scale_exec(C, op);
@@ -2536,17 +2605,17 @@ static int set_scale_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CLIP_OT_set_scale(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Scale";
- ot->description= "Set scale of scene by scaling camera (or it's parent if present)";
- ot->idname= "CLIP_OT_set_scale";
+ ot->name = "Set Scale";
+ ot->description = "Set scale of scene by scaling camera (or it's parent if present)";
+ ot->idname = "CLIP_OT_set_scale";
/* api callbacks */
- ot->exec= set_scale_exec;
- ot->invoke= set_scale_invoke;
- ot->poll= set_orientation_poll;
+ ot->exec = set_scale_exec;
+ ot->invoke = set_scale_invoke;
+ ot->poll = set_orientation_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_float(ot->srna, "distance", 0.0f, -FLT_MAX, FLT_MAX,
@@ -2557,13 +2626,13 @@ void CLIP_OT_set_scale(wmOperatorType *ot)
static int set_solution_scale_poll(bContext *C)
{
- if(space_clip_frame_poll(C)) {
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingObject *tracking_object= BKE_tracking_active_object(tracking);
+ if (space_clip_frame_poll(C)) {
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingObject *tracking_object = BKE_tracking_active_object(tracking);
- return (tracking_object->flag&TRACKING_OBJECT_CAMERA) == 0;
+ return (tracking_object->flag & TRACKING_OBJECT_CAMERA) == 0;
}
return 0;
@@ -2576,10 +2645,10 @@ static int set_solution_scale_exec(bContext *C, wmOperator *op)
static int set_solution_scale_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
- if(!RNA_struct_property_is_set(op->ptr, "distance"))
+ if (!RNA_struct_property_is_set(op->ptr, "distance"))
RNA_float_set(op->ptr, "distance", clip->tracking.settings.object_distance);
return set_solution_scale_exec(C, op);
@@ -2588,17 +2657,17 @@ static int set_solution_scale_invoke(bContext *C, wmOperator *op, wmEvent *UNUSE
void CLIP_OT_set_solution_scale(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Solution Scale";
- ot->description= "Set object solution scale using distance between two selected tracks";
- ot->idname= "CLIP_OT_set_solution_scale";
+ ot->name = "Set Solution Scale";
+ ot->description = "Set object solution scale using distance between two selected tracks";
+ ot->idname = "CLIP_OT_set_solution_scale";
/* api callbacks */
- ot->exec= set_solution_scale_exec;
- ot->invoke= set_solution_scale_invoke;
- ot->poll= set_solution_scale_poll;
+ ot->exec = set_solution_scale_exec;
+ ot->invoke = set_solution_scale_invoke;
+ ot->poll = set_solution_scale_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_float(ot->srna, "distance", 0.0f, -FLT_MAX, FLT_MAX,
@@ -2609,17 +2678,17 @@ void CLIP_OT_set_solution_scale(wmOperatorType *ot)
static int set_center_principal_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
int width, height;
BKE_movieclip_get_size(clip, &sc->user, &width, &height);
- if(width==0 || height==0)
+ if (width == 0 || height == 0)
return OPERATOR_CANCELLED;
- clip->tracking.camera.principal[0]= ((float)width)/2.0f;
- clip->tracking.camera.principal[1]= ((float)height)/2.0f;
+ clip->tracking.camera.principal[0] = ((float)width)/2.0f;
+ clip->tracking.camera.principal[1] = ((float)height)/2.0f;
WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip);
@@ -2629,49 +2698,50 @@ static int set_center_principal_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_set_center_principal(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Principal to Center";
- ot->description= "Set optical center to center of footage";
- ot->idname= "CLIP_OT_set_center_principal";
+ ot->name = "Set Principal to Center";
+ ot->description = "Set optical center to center of footage";
+ ot->idname = "CLIP_OT_set_center_principal";
/* api callbacks */
- ot->exec= set_center_principal_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = set_center_principal_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** hide tracks operator *********************/
static int hide_tracks_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
MovieTrackingTrack *track;
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
- MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
+ MovieTrackingTrack *act_track = BKE_tracking_active_track(tracking);
int unselected;
- unselected= RNA_boolean_get(op->ptr, "unselected");
+ unselected = RNA_boolean_get(op->ptr, "unselected");
- track= tracksbase->first;
- while(track) {
- if(unselected==0 && TRACK_VIEW_SELECTED(sc, track)) {
- track->flag|= TRACK_HIDDEN;
- } else if(unselected==1 && !TRACK_VIEW_SELECTED(sc, track)) {
- track->flag|= TRACK_HIDDEN;
+ track = tracksbase->first;
+ while (track) {
+ if (unselected == 0 && TRACK_VIEW_SELECTED(sc, track)) {
+ track->flag |= TRACK_HIDDEN;
+ }
+ else if (unselected == 1 && !TRACK_VIEW_SELECTED(sc, track)) {
+ track->flag |= TRACK_HIDDEN;
}
- track= track->next;
+ track = track->next;
}
- if(act_track && act_track->flag&TRACK_HIDDEN)
- clip->tracking.act_track= NULL;
+ if (act_track && act_track->flag & TRACK_HIDDEN)
+ clip->tracking.act_track = NULL;
- if(unselected==0) {
+ if (unselected == 0) {
/* no selection on screen now, unlock view so it can be scrolled nice again */
- sc->flag&= ~SC_LOCK_SELECTION;
+ sc->flag &= ~SC_LOCK_SELECTION;
}
WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, NULL);
@@ -2682,16 +2752,16 @@ static int hide_tracks_exec(bContext *C, wmOperator *op)
void CLIP_OT_hide_tracks(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Hide Tracks";
- ot->description= "Hide selected tracks";
- ot->idname= "CLIP_OT_hide_tracks";
+ ot->name = "Hide Tracks";
+ ot->description = "Hide selected tracks";
+ ot->idname = "CLIP_OT_hide_tracks";
/* api callbacks */
- ot->exec= hide_tracks_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = hide_tracks_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected tracks");
@@ -2701,16 +2771,16 @@ void CLIP_OT_hide_tracks(wmOperatorType *ot)
static int hide_tracks_clear_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
MovieTrackingTrack *track;
- track= tracksbase->first;
- while(track) {
- track->flag&= ~TRACK_HIDDEN;
+ track = tracksbase->first;
+ while (track) {
+ track->flag &= ~TRACK_HIDDEN;
- track= track->next;
+ track = track->next;
}
WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, NULL);
@@ -2721,16 +2791,16 @@ static int hide_tracks_clear_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_hide_tracks_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Hide Tracks Clear";
- ot->description= "Clear hide selected tracks";
- ot->idname= "CLIP_OT_hide_tracks_clear";
+ ot->name = "Hide Tracks Clear";
+ ot->description = "Clear hide selected tracks";
+ ot->idname = "CLIP_OT_hide_tracks_clear";
/* api callbacks */
- ot->exec= hide_tracks_clear_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = hide_tracks_clear_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** detect features operator *********************/
@@ -2739,15 +2809,15 @@ static bGPDlayer *detect_get_layer(MovieClip *clip)
{
bGPDlayer *layer;
- if(!clip->gpd)
+ if (!clip->gpd)
return NULL;
- layer= clip->gpd->layers.first;
- while(layer) {
- if(layer->flag&GP_LAYER_ACTIVE)
+ layer = clip->gpd->layers.first;
+ while (layer) {
+ if (layer->flag & GP_LAYER_ACTIVE)
return layer;
- layer= layer->next;
+ layer = layer->next;
}
return NULL;
@@ -2755,32 +2825,32 @@ static bGPDlayer *detect_get_layer(MovieClip *clip)
static int detect_features_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- int clip_flag= clip->flag&MCLIP_TIMECODE_FLAGS;
- ImBuf *ibuf= BKE_movieclip_get_ibuf_flag(clip, &sc->user, clip_flag, MOVIECLIP_CACHE_SKIP);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
- MovieTrackingTrack *track= tracksbase->first;
- int placement= RNA_enum_get(op->ptr, "placement");
- int margin= RNA_int_get(op->ptr, "margin");
- int min_trackability= RNA_int_get(op->ptr, "min_trackability");
- int min_distance= RNA_int_get(op->ptr, "min_distance");
- int place_outside_layer= 0;
- bGPDlayer *layer= NULL;
-
- if(placement!=0) {
- layer= detect_get_layer(clip);
- place_outside_layer= placement==2;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ int clip_flag = clip->flag & MCLIP_TIMECODE_FLAGS;
+ ImBuf *ibuf = BKE_movieclip_get_ibuf_flag(clip, &sc->user, clip_flag, MOVIECLIP_CACHE_SKIP);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
+ MovieTrackingTrack *track = tracksbase->first;
+ int placement = RNA_enum_get(op->ptr, "placement");
+ int margin = RNA_int_get(op->ptr, "margin");
+ int min_trackability = RNA_int_get(op->ptr, "min_trackability");
+ int min_distance = RNA_int_get(op->ptr, "min_distance");
+ int place_outside_layer = 0;
+ bGPDlayer *layer = NULL;
+
+ if (placement != 0) {
+ layer = detect_get_layer(clip);
+ place_outside_layer = placement == 2;
}
/* deselect existing tracks */
- while(track) {
- track->flag&= ~SELECT;
- track->pat_flag&= ~SELECT;
- track->search_flag&= ~SELECT;
+ while (track) {
+ track->flag &= ~SELECT;
+ track->pat_flag &= ~SELECT;
+ track->search_flag &= ~SELECT;
- track= track->next;
+ track = track->next;
}
BKE_tracking_detect_fast(tracking, tracksbase, ibuf, sc->user.framenr, margin,
@@ -2803,16 +2873,16 @@ void CLIP_OT_detect_features(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Detect Features";
- ot->description= "Automatically detect features and place markers to track";
- ot->idname= "CLIP_OT_detect_features";
+ ot->name = "Detect Features";
+ ot->description = "Automatically detect features and place markers to track";
+ ot->idname = "CLIP_OT_detect_features";
/* api callbacks */
- ot->exec= detect_features_exec;
- ot->poll= space_clip_frame_poll;
+ ot->exec = detect_features_exec;
+ ot->poll = space_clip_frame_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "placement", placement_items, 0, "Placement", "Placement for detected features");
@@ -2825,58 +2895,58 @@ void CLIP_OT_detect_features(wmOperatorType *ot)
static int frame_jump_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ Scene *scene = CTX_data_scene(C);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
MovieTrackingTrack *track;
- int pos= RNA_enum_get(op->ptr, "position");
+ int pos = RNA_enum_get(op->ptr, "position");
int delta;
- if(pos<=1) { /* jump to path */
- track= BKE_tracking_active_track(&clip->tracking);
+ if (pos <= 1) { /* jump to path */
+ track = BKE_tracking_active_track(&clip->tracking);
- if(!track)
+ if (!track)
return OPERATOR_CANCELLED;
- delta= pos == 1 ? 1 : -1;
+ delta = pos == 1 ? 1 : -1;
- while(sc->user.framenr+delta >= SFRA && sc->user.framenr+delta <= EFRA) {
- MovieTrackingMarker *marker= BKE_tracking_exact_marker(track, sc->user.framenr+delta);
+ while (sc->user.framenr+delta >= SFRA && sc->user.framenr+delta <= EFRA) {
+ MovieTrackingMarker *marker = BKE_tracking_exact_marker(track, sc->user.framenr+delta);
- if(!marker || marker->flag&MARKER_DISABLED)
+ if (!marker || marker->flag & MARKER_DISABLED)
break;
- sc->user.framenr+= delta;
+ sc->user.framenr += delta;
}
}
else { /* to to failed frame */
- if(clip->tracking.reconstruction.flag&TRACKING_RECONSTRUCTED) {
- int a= sc->user.framenr;
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingObject *object= BKE_tracking_active_object(tracking);
+ if (clip->tracking.reconstruction.flag & TRACKING_RECONSTRUCTED) {
+ int a = sc->user.framenr;
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingObject *object = BKE_tracking_active_object(tracking);
- delta= pos == 3 ? 1 : -1;
+ delta = pos == 3 ? 1 : -1;
- a+= delta;
+ a += delta;
- while(a+delta >= SFRA && a+delta <= EFRA) {
+ while (a+delta >= SFRA && a+delta <= EFRA) {
MovieReconstructedCamera *cam;
- cam= BKE_tracking_get_reconstructed_camera(tracking, object, a);
+ cam = BKE_tracking_get_reconstructed_camera(tracking, object, a);
- if(!cam) {
- sc->user.framenr= a;
+ if (!cam) {
+ sc->user.framenr = a;
break;
}
- a+= delta;
+ a += delta;
}
}
}
- if(CFRA!=sc->user.framenr) {
- CFRA= sc->user.framenr;
+ if (CFRA != sc->user.framenr) {
+ CFRA = sc->user.framenr;
sound_seek_scene(CTX_data_main(C), CTX_data_scene(C));
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
@@ -2898,62 +2968,53 @@ void CLIP_OT_frame_jump(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Jump to Frame";
- ot->description= "Jump to special frame";
- ot->idname= "CLIP_OT_frame_jump";
+ ot->name = "Jump to Frame";
+ ot->description = "Jump to special frame";
+ ot->idname = "CLIP_OT_frame_jump";
/* api callbacks */
- ot->exec= frame_jump_exec;
- ot->poll= space_clip_frame_poll;
+ ot->exec = frame_jump_exec;
+ ot->poll = space_clip_frame_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_enum(ot->srna, "position", position_items, 0, "Position", "Position to jumo to");
+ RNA_def_enum(ot->srna, "position", position_items, 0, "Position", "Position to jump to");
}
/********************** join tracks operator *********************/
static int join_tracks_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
MovieTrackingTrack *act_track, *track, *next;
- act_track= BKE_tracking_active_track(tracking);
+ act_track = BKE_tracking_active_track(tracking);
- if(!act_track) {
+ if (!act_track) {
BKE_report(op->reports, RPT_ERROR, "No active track to join to");
return OPERATOR_CANCELLED;
}
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && track!=act_track) {
- if(!BKE_tracking_test_join_tracks(act_track, track)) {
- BKE_report(op->reports, RPT_ERROR, "Some selected tracks have got keyframed markers to the same frame");
- return OPERATOR_CANCELLED;
- }
- }
+ track = tracksbase->first;
+ while (track) {
+ next = track->next;
- track= track->next;
- }
-
- track= tracksbase->first;
- while(track) {
- next= track->next;
-
- if(TRACK_VIEW_SELECTED(sc, track) && track!=act_track) {
+ 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);
}
- track= next;
+ track = next;
}
WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip);
@@ -2964,37 +3025,39 @@ static int join_tracks_exec(bContext *C, wmOperator *op)
void CLIP_OT_join_tracks(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Join Tracks";
- ot->description= "Join selected tracks";
- ot->idname= "CLIP_OT_join_tracks";
+ ot->name = "Join Tracks";
+ ot->description = "Join selected tracks";
+ ot->idname = "CLIP_OT_join_tracks";
/* api callbacks */
- ot->exec= join_tracks_exec;
- ot->poll= space_clip_frame_poll;
+ ot->exec = join_tracks_exec;
+ ot->poll = space_clip_frame_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** lock tracks operator *********************/
static int lock_tracks_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
- MovieTrackingTrack *track= tracksbase->first;
- int action= RNA_enum_get(op->ptr, "action");
-
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track)) {
- if(action==0) track->flag|= TRACK_LOCKED;
- else if(action==1) track->flag&= ~TRACK_LOCKED;
- else track->flag^= TRACK_LOCKED;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
+ MovieTrackingTrack *track = tracksbase->first;
+ int action = RNA_enum_get(op->ptr, "action");
+
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track)) {
+ if (action == 0)
+ track->flag |= TRACK_LOCKED;
+ else if (action == 1)
+ track->flag &= ~TRACK_LOCKED;
+ else track->flag ^= TRACK_LOCKED;
}
- track= track->next;
+ track = track->next;
}
WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip);
@@ -3012,16 +3075,16 @@ void CLIP_OT_lock_tracks(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Lock Tracks";
- ot->description= "Lock/unlock selected tracks";
- ot->idname= "CLIP_OT_lock_tracks";
+ ot->name = "Lock Tracks";
+ ot->description = "Lock/unlock selected tracks";
+ ot->idname = "CLIP_OT_lock_tracks";
/* api callbacks */
- ot->exec= lock_tracks_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = lock_tracks_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "action", actions_items, 0, "Action", "Lock action to execute");
@@ -3031,27 +3094,27 @@ void CLIP_OT_lock_tracks(wmOperatorType *ot)
static int track_copy_color_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
- MovieTrackingTrack *track, *act_track= BKE_tracking_active_track(tracking);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
+ MovieTrackingTrack *track, *act_track = BKE_tracking_active_track(tracking);
- if(!act_track)
+ if (!act_track)
return OPERATOR_CANCELLED;
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && track!=act_track) {
- track->flag&= ~TRACK_CUSTOMCOLOR;
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track) && track != act_track) {
+ track->flag &= ~TRACK_CUSTOMCOLOR;
- if(act_track->flag&TRACK_CUSTOMCOLOR) {
+ if (act_track->flag & TRACK_CUSTOMCOLOR) {
copy_v3_v3(track->color, act_track->color);
- track->flag|= TRACK_CUSTOMCOLOR;
+ track->flag |= TRACK_CUSTOMCOLOR;
}
}
- track= track->next;
+ track = track->next;
}
WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip);
@@ -3062,44 +3125,44 @@ static int track_copy_color_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_track_copy_color(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Color";
- ot->description= "Copy color to all selected tracks";
- ot->idname= "CLIP_OT_track_copy_color";
+ ot->name = "Copy Color";
+ ot->description = "Copy color to all selected tracks";
+ ot->idname = "CLIP_OT_track_copy_color";
/* api callbacks */
- ot->exec= track_copy_color_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = track_copy_color_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** add 2d stabilization tracks operator *********************/
static int stabilize_2d_add_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
MovieTrackingTrack *track;
- MovieTrackingStabilization *stab= &tracking->stabilization;
- int update= 0;
+ MovieTrackingStabilization *stab = &tracking->stabilization;
+ int update = 0;
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_USE_2D_STAB)==0) {
- track->flag|= TRACK_USE_2D_STAB;
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_USE_2D_STAB)==0) {
+ track->flag |= TRACK_USE_2D_STAB;
stab->tot_track++;
- update= 1;
+ update = 1;
}
- track= track->next;
+ track = track->next;
}
- if(update) {
- stab->ok= 0;
+ if (update) {
+ stab->ok = 0;
DAG_id_tag_update(&clip->id, 0);
WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip);
@@ -3111,43 +3174,43 @@ static int stabilize_2d_add_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_stabilize_2d_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Stabilization Tracks";
- ot->description= "Add selected tracks to 2D stabilization tool";
- ot->idname= "CLIP_OT_stabilize_2d_add";
+ ot->name = "Add Stabilization Tracks";
+ ot->description = "Add selected tracks to 2D stabilization tool";
+ ot->idname = "CLIP_OT_stabilize_2d_add";
/* api callbacks */
- ot->exec= stabilize_2d_add_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = stabilize_2d_add_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** remove 2d stabilization tracks operator *********************/
static int stabilize_2d_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- MovieTrackingStabilization *stab= &tracking->stabilization;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ MovieTrackingStabilization *stab = &tracking->stabilization;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
MovieTrackingTrack *track;
- int a= 0, update= 0;
+ int a = 0, update = 0;
- track= tracksbase->first;
- while(track) {
- if(track->flag&TRACK_USE_2D_STAB) {
- if(a==stab->act_track) {
- track->flag&= ~TRACK_USE_2D_STAB;
+ track = tracksbase->first;
+ while (track) {
+ if (track->flag & TRACK_USE_2D_STAB) {
+ if (a == stab->act_track) {
+ track->flag &= ~TRACK_USE_2D_STAB;
stab->act_track--;
stab->tot_track--;
- if(stab->act_track<0)
- stab->act_track= 0;
+ if (stab->act_track<0)
+ stab->act_track = 0;
- update= 1;
+ update = 1;
break;
}
@@ -3155,11 +3218,11 @@ static int stabilize_2d_remove_exec(bContext *C, wmOperator *UNUSED(op))
a++;
}
- track= track->next;
+ track = track->next;
}
- if(update) {
- stab->ok= 0;
+ if (update) {
+ stab->ok = 0;
DAG_id_tag_update(&clip->id, 0);
WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip);
@@ -3171,41 +3234,41 @@ static int stabilize_2d_remove_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_stabilize_2d_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Stabilization Track";
- ot->description= "Remove selected track from stabilization";
- ot->idname= "CLIP_OT_stabilize_2d_remove";
+ ot->name = "Remove Stabilization Track";
+ ot->description = "Remove selected track from stabilization";
+ ot->idname = "CLIP_OT_stabilize_2d_remove";
/* api callbacks */
- ot->exec= stabilize_2d_remove_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = stabilize_2d_remove_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** select 2d stabilization tracks operator *********************/
static int stabilize_2d_select_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
MovieTrackingTrack *track;
- int update= 0;
+ int update = 0;
- track= tracksbase->first;
- while(track) {
- if(track->flag&TRACK_USE_2D_STAB) {
+ track = tracksbase->first;
+ while (track) {
+ if (track->flag & TRACK_USE_2D_STAB) {
BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, 0);
- update= 1;
+ update = 1;
}
- track= track->next;
+ track = track->next;
}
- if(update)
+ if (update)
WM_event_add_notifier(C, NC_MOVIECLIP|ND_SELECT, clip);
return OPERATOR_FINISHED;
@@ -3214,32 +3277,32 @@ static int stabilize_2d_select_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_stabilize_2d_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Stabilization Tracks";
- ot->description= "Select track which are used for stabilization";
- ot->idname= "CLIP_OT_stabilize_2d_select";
+ ot->name = "Select Stabilization Tracks";
+ ot->description = "Select track which are used for stabilization";
+ ot->idname = "CLIP_OT_stabilize_2d_select";
/* api callbacks */
- ot->exec= stabilize_2d_select_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = stabilize_2d_select_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** set 2d stabilization rotation track operator *********************/
static int stabilize_2d_set_rotation_exec(bContext *C, wmOperator *UNUSED(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);
+ 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);
- if(act_track) {
- MovieTrackingStabilization *stab= &tracking->stabilization;
+ if (act_track) {
+ MovieTrackingStabilization *stab = &tracking->stabilization;
- stab->rot_track= act_track;
- stab->ok= 0;
+ stab->rot_track = act_track;
+ stab->ok = 0;
DAG_id_tag_update(&clip->id, 0);
WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip);
@@ -3251,108 +3314,108 @@ static int stabilize_2d_set_rotation_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_stabilize_2d_set_rotation(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Rotation Track";
- ot->description= "Use active track to compensate rotation when doing 2D stabilization";
- ot->idname= "CLIP_OT_stabilize_2d_set_rotation";
+ ot->name = "Set Rotation Track";
+ ot->description = "Use active track to compensate rotation when doing 2D stabilization";
+ ot->idname = "CLIP_OT_stabilize_2d_set_rotation";
/* api callbacks */
- ot->exec= stabilize_2d_set_rotation_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = stabilize_2d_set_rotation_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** clean tracks operator *********************/
static int is_track_clean(MovieTrackingTrack *track, int frames, int del)
{
- int ok= 1, a, prev= -1, count= 0;
- MovieTrackingMarker *markers= track->markers, *new_markers= NULL;
- int start_disabled= 0;
- int markersnr= track->markersnr;
+ int ok = 1, a, prev = -1, count = 0;
+ MovieTrackingMarker *markers = track->markers, *new_markers = NULL;
+ int start_disabled = 0;
+ int markersnr = track->markersnr;
- if(del)
- new_markers= MEM_callocN(markersnr*sizeof(MovieTrackingMarker), "track cleaned markers");
+ if (del)
+ new_markers = MEM_callocN(markersnr*sizeof(MovieTrackingMarker), "track cleaned markers");
- for(a= 0; a<markersnr; a++) {
- int end= 0;
+ for (a = 0; a<markersnr; a++) {
+ int end = 0;
- if(prev==-1) {
- if((markers[a].flag&MARKER_DISABLED)==0)
- prev= a;
+ if (prev == -1) {
+ if ((markers[a].flag & MARKER_DISABLED)==0)
+ prev = a;
else
- start_disabled= 1;
+ start_disabled = 1;
}
- if(prev >= 0) {
- end= a == markersnr-1;
- end|= (a < markersnr-1) && (markers[a].framenr != markers[a+1].framenr-1 ||
- markers[a].flag&MARKER_DISABLED);
+ if (prev >= 0) {
+ end = a == markersnr-1;
+ end |= (a < markersnr-1) && (markers[a].framenr != markers[a+1].framenr-1 ||
+ markers[a].flag & MARKER_DISABLED);
}
- if(end) {
- int segok= 1, len= 0;
+ if (end) {
+ int segok = 1, len = 0;
- if(a != prev && markers[a].framenr != markers[a-1].framenr+1)
- len= a-prev;
- else if(markers[a].flag&MARKER_DISABLED)
- len= a-prev;
- else len= a-prev+1;
+ if (a != prev && markers[a].framenr != markers[a-1].framenr+1)
+ len = a-prev;
+ else if (markers[a].flag & MARKER_DISABLED)
+ len = a-prev;
+ else len = a-prev+1;
- if(frames) {
- if(len < frames) {
- segok= 0;
- ok= 0;
+ if (frames) {
+ if (len < frames) {
+ segok = 0;
+ ok = 0;
- if(!del)
+ if (!del)
break;
}
}
- if(del) {
- if(segok) {
- int t= len;
+ if (del) {
+ if (segok) {
+ int t = len;
- if(markers[a].flag&MARKER_DISABLED)
+ if (markers[a].flag & MARKER_DISABLED)
t++;
/* place disabled marker in front of current segment */
- if(start_disabled) {
+ if (start_disabled) {
memcpy(new_markers+count, markers+prev, sizeof(MovieTrackingMarker));
new_markers[count].framenr--;
- new_markers[count].flag|= MARKER_DISABLED;
+ new_markers[count].flag |= MARKER_DISABLED;
count++;
- start_disabled= 0;
+ start_disabled = 0;
}
memcpy(new_markers+count, markers+prev, t*sizeof(MovieTrackingMarker));
- count+= t;
+ count += t;
}
- else if(markers[a].flag&MARKER_DISABLED) {
+ 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 */
- start_disabled= 1;
+ * so next segment should be started from disabled marker */
+ start_disabled = 1;
}
}
- prev= -1;
+ prev = -1;
}
}
- if(del) {
+ if (del) {
MEM_freeN(track->markers);
- if(count) {
- track->markers= new_markers;
+ if (count) {
+ track->markers = new_markers;
}
else {
- track->markers= NULL;
+ track->markers = NULL;
MEM_freeN(new_markers);
}
- track->markersnr= count;
+ track->markersnr = count;
}
return ok;
@@ -3360,45 +3423,45 @@ static int is_track_clean(MovieTrackingTrack *track, int frames, int del)
static int clean_tracks_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
- ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
- MovieTrackingTrack *track, *next, *act_track= BKE_tracking_active_track(tracking);
- int frames= RNA_int_get(op->ptr, "frames");
- int action= RNA_enum_get(op->ptr, "action");
- float error= RNA_float_get(op->ptr, "error");
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
+ ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
+ MovieTrackingTrack *track, *next, *act_track = BKE_tracking_active_track(tracking);
+ int frames = RNA_int_get(op->ptr, "frames");
+ int action = RNA_enum_get(op->ptr, "action");
+ float error = RNA_float_get(op->ptr, "error");
- if(error && action==TRACKING_CLEAN_DELETE_SEGMENT)
- action= TRACKING_CLEAN_DELETE_TRACK;
+ if (error && action == TRACKING_CLEAN_DELETE_SEGMENT)
+ action = TRACKING_CLEAN_DELETE_TRACK;
- track= tracksbase->first;
- while(track) {
- next= track->next;
+ track = tracksbase->first;
+ while (track) {
+ next = track->next;
- if((track->flag&TRACK_HIDDEN)==0 && (track->flag&TRACK_LOCKED)==0) {
- int ok= 1;
+ if ((track->flag & TRACK_HIDDEN)==0 && (track->flag & TRACK_LOCKED)==0) {
+ int ok = 1;
- ok= (is_track_clean(track, frames, action==TRACKING_CLEAN_DELETE_SEGMENT)) &&
- (error == 0.0f || (track->flag&TRACK_HAS_BUNDLE)==0 || track->error < error);
+ ok = (is_track_clean(track, frames, action == TRACKING_CLEAN_DELETE_SEGMENT)) &&
+ (error == 0.0f || (track->flag & TRACK_HAS_BUNDLE)==0 || track->error < error);
- if(!ok) {
- if(action==TRACKING_CLEAN_SELECT) {
+ if (!ok) {
+ if (action == TRACKING_CLEAN_SELECT) {
BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, 0);
}
- else if(action==TRACKING_CLEAN_DELETE_TRACK) {
- if(track==act_track)
- clip->tracking.act_track= NULL;
+ else if (action == TRACKING_CLEAN_DELETE_TRACK) {
+ if (track == act_track)
+ clip->tracking.act_track = NULL;
BKE_tracking_free_track(track);
BLI_freelinkN(tracksbase, track);
- track= NULL;
+ track = NULL;
}
/* happens when all tracking segments are not long enough */
- if(track && track->markersnr==0) {
- if(track==act_track)
- clip->tracking.act_track= NULL;
+ if (track && track->markersnr == 0) {
+ if (track == act_track)
+ clip->tracking.act_track = NULL;
BKE_tracking_free_track(track);
BLI_freelinkN(tracksbase, track);
@@ -3406,7 +3469,7 @@ static int clean_tracks_exec(bContext *C, wmOperator *op)
}
}
- track= next;
+ track = next;
}
WM_event_add_notifier(C, NC_MOVIECLIP|ND_SELECT, clip);
@@ -3416,16 +3479,16 @@ static int clean_tracks_exec(bContext *C, wmOperator *op)
static int clean_tracks_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
- if(!RNA_struct_property_is_set(op->ptr, "frames"))
+ if (!RNA_struct_property_is_set(op->ptr, "frames"))
RNA_int_set(op->ptr, "frames", clip->tracking.settings.clean_frames);
- if(!RNA_struct_property_is_set(op->ptr, "error"))
+ if (!RNA_struct_property_is_set(op->ptr, "error"))
RNA_float_set(op->ptr, "error", clip->tracking.settings.clean_error);
- if(!RNA_struct_property_is_set(op->ptr, "action"))
+ if (!RNA_struct_property_is_set(op->ptr, "action"))
RNA_enum_set(op->ptr, "action", clip->tracking.settings.clean_action);
return clean_tracks_exec(C, op);
@@ -3441,21 +3504,21 @@ void CLIP_OT_clean_tracks(wmOperatorType *ot)
};
/* identifiers */
- ot->name= "Clean Tracks";
- ot->description= "Clean tracks with high error values or few frames";
- ot->idname= "CLIP_OT_clean_tracks";
+ ot->name = "Clean Tracks";
+ ot->description = "Clean tracks with high error values or few frames";
+ ot->idname = "CLIP_OT_clean_tracks";
/* api callbacks */
- ot->exec= clean_tracks_exec;
- ot->invoke= clean_tracks_invoke;
- ot->poll= ED_space_clip_poll;
+ ot->exec = clean_tracks_exec;
+ ot->invoke = clean_tracks_invoke;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* 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");
}
@@ -3463,9 +3526,9 @@ void CLIP_OT_clean_tracks(wmOperatorType *ot)
static int tracking_object_new_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
BKE_tracking_new_object(tracking, "Object");
@@ -3477,30 +3540,30 @@ static int tracking_object_new_exec(bContext *C, wmOperator *UNUSED(op))
void CLIP_OT_tracking_object_new(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Tracking Object";
- ot->description= "Add new object for tracking";
- ot->idname= "CLIP_OT_tracking_object_new";
+ ot->name = "Add Tracking Object";
+ ot->description = "Add new object for tracking";
+ ot->idname = "CLIP_OT_tracking_object_new";
/* api callbacks */
- ot->exec= tracking_object_new_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = tracking_object_new_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** remove tracking object *********************/
static int tracking_object_remove_exec(bContext *C, wmOperator *op)
{
- SpaceClip *sc= CTX_wm_space_clip(C);
- MovieClip *clip= ED_space_clip(sc);
- MovieTracking *tracking= &clip->tracking;
+ SpaceClip *sc = CTX_wm_space_clip(C);
+ MovieClip *clip = ED_space_clip(sc);
+ MovieTracking *tracking = &clip->tracking;
MovieTrackingObject *object;
- object= BKE_tracking_active_object(tracking);
+ object = BKE_tracking_active_object(tracking);
- if(object->flag&TRACKING_OBJECT_CAMERA) {
+ if (object->flag & TRACKING_OBJECT_CAMERA) {
BKE_report(op->reports, RPT_WARNING, "Object used for camera tracking can't be deleted");
return OPERATOR_CANCELLED;
}
@@ -3515,16 +3578,16 @@ static int tracking_object_remove_exec(bContext *C, wmOperator *op)
void CLIP_OT_tracking_object_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Movie Tracking Object";
- ot->description= "Remove object for tracking";
- ot->idname= "CLIP_OT_tracking_object_remove";
+ ot->name = "Movie Tracking Object";
+ ot->description = "Remove object for tracking";
+ ot->idname = "CLIP_OT_tracking_object_remove";
/* api callbacks */
- ot->exec= tracking_object_remove_exec;
- ot->poll= ED_space_clip_poll;
+ ot->exec = tracking_object_remove_exec;
+ ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/********************** copy tracks to clipboard operator *********************/
@@ -3555,7 +3618,7 @@ void CLIP_OT_copy_tracks(wmOperatorType *ot)
ot->poll = ED_space_clip_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
}
/********************** paste tracks from clipboard operator *********************/
@@ -3595,5 +3658,5 @@ void CLIP_OT_paste_tracks(wmOperatorType *ot)
ot->poll = paste_tracks_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c
index 4855121a4de..2897c5d7d67 100644
--- a/source/blender/editors/space_console/console_draw.c
+++ b/source/blender/editors/space_console/console_draw.c
@@ -59,19 +59,19 @@
static void console_line_color(unsigned char fg[3], int type)
{
- switch(type) {
- case CONSOLE_LINE_OUTPUT:
- UI_GetThemeColor3ubv(TH_CONSOLE_OUTPUT, fg);
- break;
- case CONSOLE_LINE_INPUT:
- UI_GetThemeColor3ubv(TH_CONSOLE_INPUT, fg);
- break;
- case CONSOLE_LINE_INFO:
- UI_GetThemeColor3ubv(TH_CONSOLE_INFO, fg);
- break;
- case CONSOLE_LINE_ERROR:
- UI_GetThemeColor3ubv(TH_CONSOLE_ERROR, fg);
- break;
+ switch (type) {
+ case CONSOLE_LINE_OUTPUT:
+ UI_GetThemeColor3ubv(TH_CONSOLE_OUTPUT, fg);
+ break;
+ case CONSOLE_LINE_INPUT:
+ UI_GetThemeColor3ubv(TH_CONSOLE_INPUT, fg);
+ break;
+ case CONSOLE_LINE_INFO:
+ UI_GetThemeColor3ubv(TH_CONSOLE_INFO, fg);
+ break;
+ case CONSOLE_LINE_ERROR:
+ UI_GetThemeColor3ubv(TH_CONSOLE_ERROR, fg);
+ break;
}
}
@@ -93,11 +93,11 @@ typedef struct ConsoleDrawContext {
void console_scrollback_prompt_begin(struct SpaceConsole *sc, ConsoleLine *cl_dummy)
{
/* fake the edit line being in the scroll buffer */
- ConsoleLine *cl= sc->history.last;
- cl_dummy->type= CONSOLE_LINE_INPUT;
- cl_dummy->len= cl_dummy->len_alloc= strlen(sc->prompt) + cl->len;
- cl_dummy->len_alloc= cl_dummy->len + 1;
- cl_dummy->line= MEM_mallocN(cl_dummy->len_alloc, "cl_dummy");
+ ConsoleLine *cl = sc->history.last;
+ cl_dummy->type = CONSOLE_LINE_INPUT;
+ cl_dummy->len = cl_dummy->len_alloc = strlen(sc->prompt) + cl->len;
+ cl_dummy->len_alloc = cl_dummy->len + 1;
+ cl_dummy->line = MEM_mallocN(cl_dummy->len_alloc, "cl_dummy");
memcpy(cl_dummy->line, sc->prompt, (cl_dummy->len_alloc - cl->len));
memcpy(cl_dummy->line + ((cl_dummy->len_alloc - cl->len)) - 1, cl->line, cl->len + 1);
BLI_addtail(&sc->scrollback, cl_dummy);
@@ -116,73 +116,73 @@ void console_scrollback_prompt_end(struct SpaceConsole *sc, ConsoleLine *cl_dumm
/* console textview callbacks */
static int console_textview_begin(TextViewContext *tvc)
{
- SpaceConsole *sc= (SpaceConsole *)tvc->arg1;
- tvc->lheight= sc->lheight;
- tvc->sel_start= sc->sel_start;
- tvc->sel_end= sc->sel_end;
+ SpaceConsole *sc = (SpaceConsole *)tvc->arg1;
+ tvc->lheight = sc->lheight;
+ tvc->sel_start = sc->sel_start;
+ tvc->sel_end = sc->sel_end;
/* iterator */
- tvc->iter= sc->scrollback.last;
+ tvc->iter = sc->scrollback.last;
return (tvc->iter != NULL);
}
static void console_textview_end(TextViewContext *tvc)
{
- SpaceConsole *sc= (SpaceConsole *)tvc->arg1;
+ SpaceConsole *sc = (SpaceConsole *)tvc->arg1;
(void)sc;
}
static int console_textview_step(TextViewContext *tvc)
{
- return ((tvc->iter= (void *)((Link *)tvc->iter)->prev) != NULL);
+ return ((tvc->iter = (void *)((Link *)tvc->iter)->prev) != NULL);
}
static int console_textview_line_get(struct TextViewContext *tvc, const char **line, int *len)
{
- ConsoleLine *cl= (ConsoleLine *)tvc->iter;
- *line= cl->line;
- *len= cl->len;
+ ConsoleLine *cl = (ConsoleLine *)tvc->iter;
+ *line = cl->line;
+ *len = cl->len;
return 1;
}
static int console_textview_line_color(struct TextViewContext *tvc, unsigned char fg[3], unsigned char UNUSED(bg[3]))
{
- ConsoleLine *cl_iter= (ConsoleLine *)tvc->iter;
+ ConsoleLine *cl_iter = (ConsoleLine *)tvc->iter;
/* annoying hack, to draw the prompt */
- if(tvc->iter_index == 0) {
- const SpaceConsole *sc= (SpaceConsole *)tvc->arg1;
- const ConsoleLine *cl= (ConsoleLine *)sc->history.last;
- const int prompt_len= strlen(sc->prompt);
- const int cursor_loc= cl->cursor + prompt_len;
+ if (tvc->iter_index == 0) {
+ const SpaceConsole *sc = (SpaceConsole *)tvc->arg1;
+ const ConsoleLine *cl = (ConsoleLine *)sc->history.last;
+ const int prompt_len = strlen(sc->prompt);
+ const int cursor_loc = cl->cursor + prompt_len;
int xy[2] = {CONSOLE_DRAW_MARGIN, CONSOLE_DRAW_MARGIN};
int pen[2];
- xy[1] += tvc->lheight/6;
+ xy[1] += tvc->lheight / 6;
/* account for wrapping */
- if(cl->len < tvc->console_width) {
+ if (cl->len < tvc->console_width) {
/* simple case, no wrapping */
- pen[0]= tvc->cwidth * cursor_loc;
- pen[1]= -2;
+ pen[0] = tvc->cwidth * cursor_loc;
+ pen[1] = -2;
}
else {
/* wrap */
- pen[0]= tvc->cwidth * (cursor_loc % tvc->console_width);
- pen[1]= -2 + (((cl->len / tvc->console_width) - (cursor_loc / tvc->console_width)) * tvc->lheight);
+ pen[0] = tvc->cwidth * (cursor_loc % tvc->console_width);
+ pen[1] = -2 + (((cl->len / tvc->console_width) - (cursor_loc / tvc->console_width)) * tvc->lheight);
}
/* cursor */
UI_GetThemeColor3ubv(TH_CONSOLE_CURSOR, fg);
glColor3ubv(fg);
- glRecti( (xy[0] + pen[0]) - 1,
- (xy[1] + pen[1]),
- (xy[0] + pen[0]) + 1,
- (xy[1] + pen[1] + tvc->lheight)
- );
+ glRecti((xy[0] + pen[0]) - 1,
+ (xy[1] + pen[1]),
+ (xy[0] + pen[0]) + 1,
+ (xy[1] + pen[1] + tvc->lheight)
+ );
}
console_line_color(fg, cl_iter->type);
@@ -193,33 +193,33 @@ static int console_textview_line_color(struct TextViewContext *tvc, unsigned cha
static int console_textview_main__internal(struct SpaceConsole *sc, struct ARegion *ar, int draw, int mval[2], void **mouse_pick, int *pos_pick)
{
- ConsoleLine cl_dummy= {NULL};
- int ret= 0;
+ ConsoleLine cl_dummy = {NULL};
+ int ret = 0;
- View2D *v2d= &ar->v2d;
+ View2D *v2d = &ar->v2d;
- TextViewContext tvc= {0};
+ TextViewContext tvc = {0};
- tvc.begin= console_textview_begin;
- tvc.end= console_textview_end;
+ tvc.begin = console_textview_begin;
+ tvc.end = console_textview_end;
- tvc.step= console_textview_step;
- tvc.line_get= console_textview_line_get;
- tvc.line_color= console_textview_line_color;
+ tvc.step = console_textview_step;
+ tvc.line_get = console_textview_line_get;
+ tvc.line_color = console_textview_line_color;
- tvc.arg1= sc;
- tvc.arg2= NULL;
+ tvc.arg1 = sc;
+ tvc.arg2 = NULL;
/* view */
- tvc.sel_start= sc->sel_start;
- tvc.sel_end= sc->sel_end;
- tvc.lheight= sc->lheight;
- tvc.ymin= v2d->cur.ymin;
- tvc.ymax= v2d->cur.ymax;
- tvc.winx= ar->winx;
+ tvc.sel_start = sc->sel_start;
+ tvc.sel_end = sc->sel_end;
+ tvc.lheight = sc->lheight;
+ tvc.ymin = v2d->cur.ymin;
+ tvc.ymax = v2d->cur.ymax;
+ tvc.winx = ar->winx;
console_scrollback_prompt_begin(sc, &cl_dummy);
- ret= textview_draw(&tvc, draw, mval, mouse_pick, pos_pick);
+ ret = textview_draw(&tvc, draw, mval, mouse_pick, pos_pick);
console_scrollback_prompt_end(sc, &cl_dummy);
return ret;
@@ -240,12 +240,12 @@ int console_textview_height(struct SpaceConsole *sc, struct ARegion *ar)
int console_char_pick(struct SpaceConsole *sc, struct ARegion *ar, int mval[2])
{
- int pos_pick= 0;
- void *mouse_pick= NULL;
+ int pos_pick = 0;
+ void *mouse_pick = NULL;
int mval_clamp[2];
- mval_clamp[0]= CLAMPIS(mval[0], CONSOLE_DRAW_MARGIN, ar->winx-(CONSOLE_DRAW_SCROLL + CONSOLE_DRAW_MARGIN));
- mval_clamp[1]= CLAMPIS(mval[1], CONSOLE_DRAW_MARGIN, ar->winy-CONSOLE_DRAW_MARGIN);
+ mval_clamp[0] = CLAMPIS(mval[0], CONSOLE_DRAW_MARGIN, ar->winx - (CONSOLE_DRAW_SCROLL + CONSOLE_DRAW_MARGIN));
+ mval_clamp[1] = CLAMPIS(mval[1], CONSOLE_DRAW_MARGIN, ar->winy - CONSOLE_DRAW_MARGIN);
console_textview_main__internal(sc, ar, 0, mval_clamp, &mouse_pick, &pos_pick);
return pos_pick;
diff --git a/source/blender/editors/space_console/console_intern.h b/source/blender/editors/space_console/console_intern.h
index ca0e999d7ea..33588cc0923 100644
--- a/source/blender/editors/space_console/console_intern.h
+++ b/source/blender/editors/space_console/console_intern.h
@@ -64,6 +64,6 @@ void CONSOLE_OT_paste(struct wmOperatorType *ot);
void CONSOLE_OT_select_set(struct wmOperatorType *ot);
enum { LINE_BEGIN, LINE_END, PREV_CHAR, NEXT_CHAR, PREV_WORD, NEXT_WORD };
-enum { DEL_ALL, DEL_NEXT_CHAR, DEL_PREV_CHAR, DEL_SELECTION, DEL_NEXT_SEL, DEL_PREV_SEL };
+enum { DEL_ALL, DEL_NEXT_CHAR, DEL_PREV_CHAR, DEL_NEXT_WORD, DEL_PREV_WORD, DEL_SELECTION, DEL_NEXT_SEL, DEL_PREV_SEL };
#endif /* __CONSOLE_INTERN_H__ */
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c
index 9640701965c..ef036b071be 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"
@@ -55,16 +57,16 @@
/* so when we type - the view scrolls to the bottom */
static void console_scroll_bottom(ARegion *ar)
{
- View2D *v2d= &ar->v2d;
+ View2D *v2d = &ar->v2d;
v2d->cur.ymin = 0.0;
- v2d->cur.ymax =(float)v2d->winy;
+ v2d->cur.ymax = (float)v2d->winy;
}
static void console_textview_update_rect(SpaceConsole *sc, ARegion *ar)
{
- View2D *v2d= &ar->v2d;
+ View2D *v2d = &ar->v2d;
- UI_view2d_totRect_set(v2d, ar->winx-1, console_textview_height(sc, ar));
+ UI_view2d_totRect_set(v2d, ar->winx - 1, console_textview_height(sc, ar));
}
static void console_select_offset(SpaceConsole *sc, const int offset)
@@ -90,21 +92,21 @@ static void console_scrollback_limit(SpaceConsole *sc)
{
int tot;
- if (U.scrollback < 32) U.scrollback= 256; // XXX - save in user defaults
+ if (U.scrollback < 32) U.scrollback = 256; // XXX - save in user defaults
- for(tot= BLI_countlist(&sc->scrollback); tot > U.scrollback; tot--)
+ for (tot = BLI_countlist(&sc->scrollback); tot > U.scrollback; tot--)
console_scrollback_free(sc, sc->scrollback.first);
}
-static ConsoleLine * console_history_find(SpaceConsole *sc, const char *str, ConsoleLine *cl_ignore)
+static ConsoleLine *console_history_find(SpaceConsole *sc, const char *str, ConsoleLine *cl_ignore)
{
ConsoleLine *cl;
- for(cl= sc->history.last; cl; cl= cl->prev) {
- if (cl==cl_ignore)
+ for (cl = sc->history.last; cl; cl = cl->prev) {
+ if (cl == cl_ignore)
continue;
- if(strcmp(str, cl->line)==0)
+ if (strcmp(str, cl->line) == 0)
return cl;
}
@@ -115,49 +117,26 @@ 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;
printf("%d: ", BLI_countlist(lb));
- for(cl= lb->first; cl; cl= cl->next)
+ for (cl = lb->first; cl; cl = cl->next)
printf("<%s> ", cl->line);
printf("\n");
@@ -165,7 +144,7 @@ static void console_lb_debug__internal(ListBase *lb)
static void console_history_debug(const bContext *C)
{
- SpaceConsole *sc= CTX_wm_space_console(C);
+ SpaceConsole *sc = CTX_wm_space_console(C);
console_lb_debug__internal(&sc->history);
@@ -174,19 +153,20 @@ static void console_history_debug(const bContext *C)
static ConsoleLine *console_lb_add__internal(ListBase *lb, ConsoleLine *from)
{
- ConsoleLine *ci= MEM_callocN(sizeof(ConsoleLine), "ConsoleLine Add");
+ ConsoleLine *ci = MEM_callocN(sizeof(ConsoleLine), "ConsoleLine Add");
- if(from) {
- ci->line= BLI_strdup(from->line);
- ci->len= strlen(ci->line);
- ci->len_alloc= ci->len;
+ if (from) {
+ ci->line = BLI_strdup(from->line);
+ ci->len = strlen(ci->line);
+ ci->len_alloc = ci->len;
- ci->cursor= from->cursor;
- ci->type= from->type;
- } else {
- ci->line= MEM_callocN(64, "console-in-line");
- ci->len_alloc= 64;
- ci->len= 0;
+ ci->cursor = from->cursor;
+ ci->type = from->type;
+ }
+ else {
+ ci->line = MEM_callocN(64, "console-in-line");
+ ci->len_alloc = 64;
+ ci->len = 0;
}
BLI_addtail(lb, ci);
@@ -195,7 +175,7 @@ static ConsoleLine *console_lb_add__internal(ListBase *lb, ConsoleLine *from)
static ConsoleLine *console_history_add(const bContext *C, ConsoleLine *from)
{
- SpaceConsole *sc= CTX_wm_space_console(C);
+ SpaceConsole *sc = CTX_wm_space_console(C);
return console_lb_add__internal(&sc->history, from);
}
@@ -203,7 +183,7 @@ static ConsoleLine *console_history_add(const bContext *C, ConsoleLine *from)
#if 0 /* may use later ? */
static ConsoleLine *console_scrollback_add(const bContext *C, ConsoleLine *from)
{
- SpaceConsole *sc= CTX_wm_space_console(C);
+ SpaceConsole *sc = CTX_wm_space_console(C);
return console_lb_add__internal(&sc->scrollback, from);
}
@@ -211,9 +191,9 @@ static ConsoleLine *console_scrollback_add(const bContext *C, ConsoleLine *from)
static ConsoleLine *console_lb_add_str__internal(ListBase *lb, char *str, int own)
{
- ConsoleLine *ci= MEM_callocN(sizeof(ConsoleLine), "ConsoleLine Add");
- if(own) ci->line= str;
- else ci->line= BLI_strdup(str);
+ ConsoleLine *ci = MEM_callocN(sizeof(ConsoleLine), "ConsoleLine Add");
+ if (own) ci->line = str;
+ else ci->line = BLI_strdup(str);
ci->len = ci->len_alloc = strlen(str);
@@ -226,17 +206,17 @@ ConsoleLine *console_history_add_str(SpaceConsole *sc, char *str, int own)
}
ConsoleLine *console_scrollback_add_str(SpaceConsole *sc, char *str, int own)
{
- ConsoleLine *ci= console_lb_add_str__internal(&sc->scrollback, str, own);
+ ConsoleLine *ci = console_lb_add_str__internal(&sc->scrollback, str, own);
console_select_offset(sc, ci->len + 1);
return ci;
}
ConsoleLine *console_history_verify(const bContext *C)
{
- SpaceConsole *sc= CTX_wm_space_console(C);
- ConsoleLine *ci= sc->history.last;
- if(ci==NULL)
- ci= console_history_add(C, NULL);
+ SpaceConsole *sc = CTX_wm_space_console(C);
+ ConsoleLine *ci = sc->history.last;
+ if (ci == NULL)
+ ci = console_history_add(C, NULL);
return ci;
}
@@ -245,14 +225,14 @@ ConsoleLine *console_history_verify(const bContext *C)
static void console_line_verify_length(ConsoleLine *ci, int len)
{
/* resize the buffer if needed */
- if(len >= ci->len_alloc) {
- int new_len= len * 2; /* new length */
- char *new_line= MEM_callocN(new_len, "console line");
+ if (len >= ci->len_alloc) {
+ int new_len = len * 2; /* new length */
+ char *new_line = MEM_callocN(new_len, "console line");
memcpy(new_line, ci->line, ci->len);
MEM_freeN(ci->line);
- ci->line= new_line;
- ci->len_alloc= new_len;
+ ci->line = new_line;
+ ci->len_alloc = new_len;
}
}
@@ -260,18 +240,18 @@ static int console_line_insert(ConsoleLine *ci, char *str)
{
int len = strlen(str);
- if(len>0 && str[len-1]=='\n') {/* stop new lines being pasted at the end of lines */
- str[len-1]= '\0';
+ if (len > 0 && str[len - 1] == '\n') { /* stop new lines being pasted at the end of lines */
+ str[len - 1] = '\0';
len--;
}
- if(len==0)
+ if (len == 0)
return 0;
console_line_verify_length(ci, len + ci->len);
- memmove(ci->line+ci->cursor+len, ci->line+ci->cursor, (ci->len - ci->cursor)+1);
- memcpy(ci->line+ci->cursor, str, len);
+ memmove(ci->line + ci->cursor + len, ci->line + ci->cursor, (ci->len - ci->cursor) + 1);
+ memcpy(ci->line + ci->cursor, str, len);
ci->len += len;
ci->cursor += len;
@@ -282,71 +262,75 @@ static int console_line_insert(ConsoleLine *ci, char *str)
/* static funcs for text editing */
/* similar to the text editor, with some not used. keep compatible */
-static EnumPropertyItem console_move_type_items[]= {
+static EnumPropertyItem console_move_type_items[] = {
{LINE_BEGIN, "LINE_BEGIN", 0, "Line Begin", ""},
{LINE_END, "LINE_END", 0, "Line End", ""},
{PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""},
{NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""},
{PREV_WORD, "PREVIOUS_WORD", 0, "Previous Word", ""},
{NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}
+};
static int console_move_exec(bContext *C, wmOperator *op)
{
- ConsoleLine *ci= console_history_verify(C);
-
- int type= RNA_enum_get(op->ptr, "type");
- int done= 0;
-
- switch(type) {
- case LINE_BEGIN:
- done= console_line_cursor_set(ci, 0);
- break;
- case LINE_END:
- done= console_line_cursor_set(ci, INT_MAX);
- break;
- case PREV_CHAR:
- done= console_line_cursor_set(ci, ci->cursor-1);
- break;
- case NEXT_CHAR:
- done= console_line_cursor_set(ci, ci->cursor+1);
- 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 */
- 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 */
- break;
- }
-
- if(done) {
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= CTX_wm_region(C);
+ ConsoleLine *ci = console_history_verify(C);
+
+ int type = RNA_enum_get(op->ptr, "type");
+ int done = 0;
+ int pos;
+
+ switch (type) {
+ case LINE_BEGIN:
+ 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:
+ 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:
+ 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:
+ 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:
+ 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:
+ 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;
+ }
+
+ if (done) {
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = CTX_wm_region(C);
ED_area_tag_redraw(sa);
console_scroll_bottom(ar);
@@ -359,13 +343,13 @@ static int console_move_exec(bContext *C, wmOperator *op)
void CONSOLE_OT_move(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move Cursor";
- ot->description= "Move cursor position";
- ot->idname= "CONSOLE_OT_move";
+ ot->name = "Move Cursor";
+ ot->description = "Move cursor position";
+ ot->idname = "CONSOLE_OT_move";
/* api callbacks */
- ot->exec= console_move_exec;
- ot->poll= ED_operator_console_active;
+ ot->exec = console_move_exec;
+ ot->poll = ED_operator_console_active;
/* properties */
RNA_def_enum(ot->srna, "type", console_move_type_items, LINE_BEGIN, "Type", "Where to move cursor to");
@@ -374,26 +358,26 @@ void CONSOLE_OT_move(wmOperatorType *ot)
#define TAB_LENGTH 4
static int console_insert_exec(bContext *C, wmOperator *op)
{
- SpaceConsole *sc= CTX_wm_space_console(C);
- ARegion *ar= CTX_wm_region(C);
- ConsoleLine *ci= console_history_verify(C);
- char *str= RNA_string_get_alloc(op->ptr, "text", NULL, 0);
+ SpaceConsole *sc = CTX_wm_space_console(C);
+ ARegion *ar = CTX_wm_region(C);
+ ConsoleLine *ci = console_history_verify(C);
+ char *str = RNA_string_get_alloc(op->ptr, "text", NULL, 0);
int len;
// XXX, alligned tab key hack
- if(str[0]=='\t' && str[1]=='\0') {
- len= TAB_LENGTH - (ci->cursor % TAB_LENGTH);
+ if (str[0] == '\t' && str[1] == '\0') {
+ len = TAB_LENGTH - (ci->cursor % TAB_LENGTH);
MEM_freeN(str);
- str= MEM_mallocN(len + 1, "insert_exec");
+ str = MEM_mallocN(len + 1, "insert_exec");
memset(str, ' ', len);
- str[len]= '\0';
+ str[len] = '\0';
}
- len= console_line_insert(ci, str);
+ len = console_line_insert(ci, str);
MEM_freeN(str);
- if(len==0) {
+ if (len == 0) {
return OPERATOR_CANCELLED;
}
else {
@@ -410,16 +394,16 @@ static int console_insert_exec(bContext *C, wmOperator *op)
static int console_insert_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- // if(!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
- if(!RNA_string_length(op->ptr, "text")) {
+ // if (!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
+ if (!RNA_string_length(op->ptr, "text")) {
/* if alt/ctrl/super are pressed pass through */
- if(event->ctrl || event->oskey) {
+ if (event->ctrl || event->oskey) {
return OPERATOR_PASS_THROUGH;
}
else {
char str[2];
- str[0]= event->ascii;
- str[1]= '\0';
+ str[0] = event->ascii;
+ str[1] = '\0';
RNA_string_set(op->ptr, "text", str);
}
@@ -429,60 +413,82 @@ static int console_insert_invoke(bContext *C, wmOperator *op, wmEvent *event)
void CONSOLE_OT_insert(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
- ot->name= "Insert";
- ot->description= "Insert text at cursor position";
- ot->idname= "CONSOLE_OT_insert";
+ ot->name = "Insert";
+ ot->description = "Insert text at cursor position";
+ ot->idname = "CONSOLE_OT_insert";
/* api callbacks */
- ot->exec= console_insert_exec;
- ot->invoke= console_insert_invoke;
- ot->poll= ED_operator_console_active;
+ ot->exec = console_insert_exec;
+ ot->invoke = console_insert_invoke;
+ ot->poll = ED_operator_console_active;
/* properties */
- RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position");
+ prop = RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
-static EnumPropertyItem console_delete_type_items[]= {
+static EnumPropertyItem console_delete_type_items[] = {
{DEL_NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""},
{DEL_PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""},
-// {DEL_NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""},
-// {DEL_PREV_WORD, "PREVIOUS_WORD", 0, "Previous Word", ""},
- {0, NULL, 0, NULL, NULL}};
+ {DEL_NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""},
+ {DEL_PREV_WORD, "PREVIOUS_WORD", 0, "Previous Word", ""},
+ {0, NULL, 0, NULL, NULL}
+};
static int console_delete_exec(bContext *C, wmOperator *op)
{
- SpaceConsole *sc= CTX_wm_space_console(C);
- ARegion *ar= CTX_wm_region(C);
- ConsoleLine *ci= console_history_verify(C);
+ SpaceConsole *sc = CTX_wm_space_console(C);
+ ARegion *ar = CTX_wm_region(C);
+ ConsoleLine *ci = console_history_verify(C);
+ int pos;
+ int stride;
- const short type= RNA_enum_get(op->ptr, "type");
+ const short type = RNA_enum_get(op->ptr, "type");
int done = 0;
- if(ci->len==0) {
+ if (ci->len == 0) {
return OPERATOR_CANCELLED;
}
- switch(type) {
- case DEL_NEXT_CHAR:
- if(ci->cursor < ci->len) {
- memmove(ci->line + ci->cursor, ci->line + ci->cursor+1, (ci->len - ci->cursor)+1);
- ci->len--;
- done= 1;
- }
- break;
- case DEL_PREV_CHAR:
- if(ci->cursor > 0) {
- ci->cursor--; /* same as above */
- memmove(ci->line + ci->cursor, ci->line + ci->cursor+1, (ci->len - ci->cursor)+1);
- ci->len--;
- done= 1;
- }
- break;
+ switch (type) {
+ case DEL_NEXT_CHAR:
+ case DEL_NEXT_WORD:
+ if (ci->cursor < ci->len) {
+ pos = ci->cursor;
+ BLI_str_cursor_step_utf8(ci->line, ci->len,
+ &pos, STRCUR_DIR_NEXT,
+ (type == DEL_NEXT_CHAR) ? STRCUR_JUMP_NONE : STRCUR_JUMP_DELIM);
+ stride = pos - ci->cursor;
+ if (stride) {
+ memmove(ci->line + ci->cursor, ci->line + ci->cursor + stride, (ci->len - ci->cursor) + 1);
+ ci->len -= stride;
+ done = 1;
+ }
+ }
+ break;
+ case DEL_PREV_CHAR:
+ case DEL_PREV_WORD:
+ if (ci->cursor > 0) {
+ pos = ci->cursor;
+ BLI_str_cursor_step_utf8(ci->line, ci->len,
+ &pos, STRCUR_DIR_PREV,
+ (type == DEL_PREV_CHAR) ? STRCUR_JUMP_NONE : STRCUR_JUMP_DELIM);
+ stride = ci->cursor - pos;
+ if (stride) {
+ ci->cursor -= stride; /* same as above */
+ memmove(ci->line + ci->cursor, ci->line + ci->cursor + stride, (ci->len - ci->cursor) + 1);
+ ci->len -= stride;
+ done = 1;
+ }
+ }
+ break;
}
-
- if(!done) {
+
+ if (!done) {
return OPERATOR_CANCELLED;
}
else {
@@ -501,13 +507,13 @@ static int console_delete_exec(bContext *C, wmOperator *op)
void CONSOLE_OT_delete(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete";
- ot->description= "Delete text by cursor position";
- ot->idname= "CONSOLE_OT_delete";
+ ot->name = "Delete";
+ ot->description = "Delete text by cursor position";
+ ot->idname = "CONSOLE_OT_delete";
/* api callbacks */
- ot->exec= console_delete_exec;
- ot->poll= ED_operator_console_active;
+ ot->exec = console_delete_exec;
+ ot->poll = ED_operator_console_active;
/* properties */
RNA_def_enum(ot->srna, "type", console_delete_type_items, DEL_NEXT_CHAR, "Type", "Which part of the text to delete");
@@ -517,21 +523,21 @@ void CONSOLE_OT_delete(wmOperatorType *ot)
/* the python exec operator uses this */
static int console_clear_exec(bContext *C, wmOperator *op)
{
- SpaceConsole *sc= CTX_wm_space_console(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceConsole *sc = CTX_wm_space_console(C);
+ ARegion *ar = CTX_wm_region(C);
- short scrollback= RNA_boolean_get(op->ptr, "scrollback");
- short history= RNA_boolean_get(op->ptr, "history");
+ short scrollback = RNA_boolean_get(op->ptr, "scrollback");
+ short history = RNA_boolean_get(op->ptr, "history");
/*ConsoleLine *ci= */ console_history_verify(C);
- if(scrollback) { /* last item in mistory */
- while(sc->scrollback.first)
+ if (scrollback) { /* last item in mistory */
+ while (sc->scrollback.first)
console_scrollback_free(sc, sc->scrollback.first);
}
- if(history) {
- while(sc->history.first)
+ if (history) {
+ while (sc->history.first)
console_history_free(sc, sc->history.first);
}
@@ -544,13 +550,13 @@ static int console_clear_exec(bContext *C, wmOperator *op)
void CONSOLE_OT_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear";
- ot->description= "Clear text by type";
- ot->idname= "CONSOLE_OT_clear";
+ ot->name = "Clear";
+ ot->description = "Clear text by type";
+ ot->idname = "CONSOLE_OT_clear";
/* api callbacks */
- ot->exec= console_clear_exec;
- ot->poll= ED_operator_console_active;
+ ot->exec = console_clear_exec;
+ ot->poll = ED_operator_console_active;
/* properties */
RNA_def_boolean(ot->srna, "scrollback", 1, "Scrollback", "Clear the scrollback history");
@@ -562,42 +568,42 @@ void CONSOLE_OT_clear(wmOperatorType *ot)
/* the python exec operator uses this */
static int console_history_cycle_exec(bContext *C, wmOperator *op)
{
- SpaceConsole *sc= CTX_wm_space_console(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceConsole *sc = CTX_wm_space_console(C);
+ ARegion *ar = CTX_wm_region(C);
- ConsoleLine *ci= console_history_verify(C); /* TODO - stupid, just prevernts crashes when no command line */
- short reverse= RNA_boolean_get(op->ptr, "reverse"); /* assumes down, reverse is up */
- int prev_len= ci->len;
+ ConsoleLine *ci = console_history_verify(C); /* TODO - stupid, just prevernts crashes when no command line */
+ short reverse = RNA_boolean_get(op->ptr, "reverse"); /* assumes down, reverse is up */
+ int prev_len = ci->len;
/* keep a copy of the line above so when history is cycled
* this is the only function that needs to know about the double-up */
- if(ci->prev) {
- ConsoleLine *ci_prev= (ConsoleLine *)ci->prev;
+ if (ci->prev) {
+ ConsoleLine *ci_prev = (ConsoleLine *)ci->prev;
- if(strcmp(ci->line, ci_prev->line)==0)
+ if (strcmp(ci->line, ci_prev->line) == 0)
console_history_free(sc, ci_prev);
}
- if(reverse) { /* last item in mistory */
- ci= sc->history.last;
+ if (reverse) { /* last item in mistory */
+ ci = sc->history.last;
BLI_remlink(&sc->history, ci);
BLI_addhead(&sc->history, ci);
}
else {
- ci= sc->history.first;
+ ci = sc->history.first;
BLI_remlink(&sc->history, ci);
BLI_addtail(&sc->history, ci);
}
- { /* add a duplicate of the new arg and remove all other instances */
+ { /* add a duplicate of the new arg and remove all other instances */
ConsoleLine *cl;
- while((cl= console_history_find(sc, ci->line, ci)))
+ while ((cl = console_history_find(sc, ci->line, ci)))
console_history_free(sc, cl);
console_history_add(C, (ConsoleLine *)sc->history.last);
}
- ci= sc->history.last;
+ ci = sc->history.last;
console_select_offset(sc, ci->len - prev_len);
/* could be wrapped so update scroll rect */
@@ -612,13 +618,13 @@ static int console_history_cycle_exec(bContext *C, wmOperator *op)
void CONSOLE_OT_history_cycle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "History Cycle";
- ot->description= "Cycle through history";
- ot->idname= "CONSOLE_OT_history_cycle";
+ ot->name = "History Cycle";
+ ot->description = "Cycle through history";
+ ot->idname = "CONSOLE_OT_history_cycle";
/* api callbacks */
- ot->exec= console_history_cycle_exec;
- ot->poll= ED_operator_console_active;
+ ot->exec = console_history_cycle_exec;
+ ot->poll = ED_operator_console_active;
/* properties */
RNA_def_boolean(ot->srna, "reverse", 0, "Reverse", "Reverse cycle history");
@@ -628,28 +634,28 @@ void CONSOLE_OT_history_cycle(wmOperatorType *ot)
/* the python exec operator uses this */
static int console_history_append_exec(bContext *C, wmOperator *op)
{
- SpaceConsole *sc= CTX_wm_space_console(C);
- ARegion *ar= CTX_wm_region(C);
- ScrArea *sa= CTX_wm_area(C);
- ConsoleLine *ci= console_history_verify(C);
- char *str= RNA_string_get_alloc(op->ptr, "text", NULL, 0); /* own this text in the new line, dont free */
- int cursor= RNA_int_get(op->ptr, "current_character");
- short rem_dupes= RNA_boolean_get(op->ptr, "remove_duplicates");
- int prev_len= ci->len;
+ SpaceConsole *sc = CTX_wm_space_console(C);
+ ARegion *ar = CTX_wm_region(C);
+ ScrArea *sa = CTX_wm_area(C);
+ ConsoleLine *ci = console_history_verify(C);
+ char *str = RNA_string_get_alloc(op->ptr, "text", NULL, 0); /* own this text in the new line, don't free */
+ int cursor = RNA_int_get(op->ptr, "current_character");
+ short rem_dupes = RNA_boolean_get(op->ptr, "remove_duplicates");
+ int prev_len = ci->len;
- if(rem_dupes) {
+ if (rem_dupes) {
ConsoleLine *cl;
- while((cl= console_history_find(sc, ci->line, ci)))
+ while ((cl = console_history_find(sc, ci->line, ci)))
console_history_free(sc, cl);
- if(strcmp(str, ci->line)==0) {
+ if (strcmp(str, ci->line) == 0) {
MEM_freeN(str);
return OPERATOR_FINISHED;
}
}
- ci= console_history_add_str(sc, str, 1); /* own the string */
+ ci = console_history_add_str(sc, str, 1); /* own the string */
console_select_offset(sc, ci->len - prev_len);
console_line_cursor_set(ci, cursor);
@@ -667,13 +673,13 @@ static int console_history_append_exec(bContext *C, wmOperator *op)
void CONSOLE_OT_history_append(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "History Append";
- ot->description= "Append history at cursor position";
- ot->idname= "CONSOLE_OT_history_append";
+ ot->name = "History Append";
+ ot->description = "Append history at cursor position";
+ ot->idname = "CONSOLE_OT_history_append";
/* api callbacks */
- ot->exec= console_history_append_exec;
- ot->poll= ED_operator_console_active;
+ ot->exec = console_history_append_exec;
+ ot->poll = ED_operator_console_active;
/* properties */
RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position");
@@ -685,23 +691,23 @@ void CONSOLE_OT_history_append(wmOperatorType *ot)
/* the python exec operator uses this */
static int console_scrollback_append_exec(bContext *C, wmOperator *op)
{
- SpaceConsole *sc= CTX_wm_space_console(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceConsole *sc = CTX_wm_space_console(C);
+ ARegion *ar = CTX_wm_region(C);
ConsoleLine *ci;
- char *str= RNA_string_get_alloc(op->ptr, "text", NULL, 0); /* own this text in the new line, dont free */
- int type= RNA_enum_get(op->ptr, "type");
+ char *str = RNA_string_get_alloc(op->ptr, "text", NULL, 0); /* own this text in the new line, don't free */
+ int type = RNA_enum_get(op->ptr, "type");
console_history_verify(C);
- ci= console_scrollback_add_str(sc, str, 1); /* own the string */
- ci->type= type;
+ ci = console_scrollback_add_str(sc, str, 1); /* own the string */
+ ci->type = type;
console_scrollback_limit(sc);
/* 'ar' can be null depending on the operator that runs
* rendering with invoke default for eg causes this */
- if(ar) {
+ if (ar) {
console_textview_update_rect(sc, ar);
}
@@ -714,20 +720,20 @@ void CONSOLE_OT_scrollback_append(wmOperatorType *ot)
{
/* defined in DNA_space_types.h */
static EnumPropertyItem console_line_type_items[] = {
- {CONSOLE_LINE_OUTPUT, "OUTPUT", 0, "Output", ""},
- {CONSOLE_LINE_INPUT, "INPUT", 0, "Input", ""},
- {CONSOLE_LINE_INFO, "INFO", 0, "Information", ""},
- {CONSOLE_LINE_ERROR, "ERROR", 0, "Error", ""},
+ {CONSOLE_LINE_OUTPUT, "OUTPUT", 0, "Output", ""},
+ {CONSOLE_LINE_INPUT, "INPUT", 0, "Input", ""},
+ {CONSOLE_LINE_INFO, "INFO", 0, "Information", ""},
+ {CONSOLE_LINE_ERROR, "ERROR", 0, "Error", ""},
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Scrollback Append";
- ot->description= "Append scrollback text by type";
- ot->idname= "CONSOLE_OT_scrollback_append";
+ ot->name = "Scrollback Append";
+ ot->description = "Append scrollback text by type";
+ ot->idname = "CONSOLE_OT_scrollback_append";
/* api callbacks */
- ot->exec= console_scrollback_append_exec;
- ot->poll= ED_operator_console_active;
+ ot->exec = console_scrollback_append_exec;
+ ot->poll = ED_operator_console_active;
/* properties */
RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position");
@@ -737,49 +743,49 @@ void CONSOLE_OT_scrollback_append(wmOperatorType *ot)
static int console_copy_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceConsole *sc= CTX_wm_space_console(C);
+ SpaceConsole *sc = CTX_wm_space_console(C);
- DynStr *buf_dyn= BLI_dynstr_new();
+ DynStr *buf_dyn = BLI_dynstr_new();
char *buf_str;
ConsoleLine *cl;
int sel[2];
- int offset= 0;
+ int offset = 0;
- ConsoleLine cl_dummy= {NULL};
+ ConsoleLine cl_dummy = {NULL};
#if 0
/* copy whole file */
- for(cl= sc->scrollback.first; cl; cl= cl->next) {
+ for (cl = sc->scrollback.first; cl; cl = cl->next) {
BLI_dynstr_append(buf_dyn, cl->line);
BLI_dynstr_append(buf_dyn, "\n");
}
#endif
- if(sc->sel_start == sc->sel_end)
+ if (sc->sel_start == sc->sel_end)
return OPERATOR_CANCELLED;
console_scrollback_prompt_begin(sc, &cl_dummy);
- for(cl= sc->scrollback.first; cl; cl= cl->next) {
+ for (cl = sc->scrollback.first; cl; cl = cl->next) {
offset += cl->len + 1;
}
- if(offset==0) {
+ if (offset == 0) {
console_scrollback_prompt_end(sc, &cl_dummy);
return OPERATOR_CANCELLED;
}
offset -= 1;
- sel[0]= offset - sc->sel_end;
- sel[1]= offset - sc->sel_start;
+ sel[0] = offset - sc->sel_end;
+ sel[1] = offset - sc->sel_start;
- for(cl= sc->scrollback.first; cl; cl= cl->next) {
- if(sel[0] <= cl->len && sel[1] >= 0) {
- int sta= MAX2(sel[0], 0);
- int end= MIN2(sel[1], cl->len);
+ for (cl = sc->scrollback.first; cl; cl = cl->next) {
+ if (sel[0] <= cl->len && sel[1] >= 0) {
+ int sta = MAX2(sel[0], 0);
+ int end = MIN2(sel[1], cl->len);
- if(BLI_dynstr_get_len(buf_dyn))
+ if (BLI_dynstr_get_len(buf_dyn))
BLI_dynstr_append(buf_dyn, "\n");
BLI_dynstr_nappend(buf_dyn, cl->line + sta, end - sta);
@@ -789,7 +795,7 @@ static int console_copy_exec(bContext *C, wmOperator *UNUSED(op))
sel[1] -= cl->len + 1;
}
- buf_str= BLI_dynstr_get_cstring(buf_dyn);
+ buf_str = BLI_dynstr_get_cstring(buf_dyn);
BLI_dynstr_free(buf_dyn);
WM_clipboard_text_set(buf_str, 0);
@@ -804,41 +810,41 @@ static int console_copy_exec(bContext *C, wmOperator *UNUSED(op))
void CONSOLE_OT_copy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy to Clipboard";
- ot->description= "Copy selected text to clipboard";
- ot->idname= "CONSOLE_OT_copy";
+ ot->name = "Copy to Clipboard";
+ ot->description = "Copy selected text to clipboard";
+ ot->idname = "CONSOLE_OT_copy";
/* api callbacks */
- ot->poll= ED_operator_console_active;
- ot->exec= console_copy_exec;
+ ot->poll = ED_operator_console_active;
+ ot->exec = console_copy_exec;
/* properties */
}
static int console_paste_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceConsole *sc= CTX_wm_space_console(C);
- ARegion *ar= CTX_wm_region(C);
- ConsoleLine *ci= console_history_verify(C);
+ SpaceConsole *sc = CTX_wm_space_console(C);
+ ARegion *ar = CTX_wm_region(C);
+ ConsoleLine *ci = console_history_verify(C);
- char *buf_str= WM_clipboard_text_get(0);
+ char *buf_str = WM_clipboard_text_get(0);
char *buf_step, *buf_next;
- if(buf_str==NULL)
+ if (buf_str == NULL)
return OPERATOR_CANCELLED;
- buf_step= buf_str;
+ buf_step = buf_str;
- while((buf_next=buf_step) && buf_next[0] != '\0') {
- buf_step= strchr(buf_next, '\n');
- if(buf_step) {
- *buf_step= '\0';
+ while ((buf_next = buf_step) && buf_next[0] != '\0') {
+ buf_step = strchr(buf_next, '\n');
+ if (buf_step) {
+ *buf_step = '\0';
buf_step++;
}
- if(buf_next != buf_str) {
+ if (buf_next != buf_str) {
WM_operator_name_call(C, "CONSOLE_OT_execute", WM_OP_EXEC_DEFAULT, NULL);
- ci= console_history_verify(C);
+ ci = console_history_verify(C);
}
console_select_offset(sc, console_line_insert(ci, buf_next));
@@ -857,13 +863,13 @@ static int console_paste_exec(bContext *C, wmOperator *UNUSED(op))
void CONSOLE_OT_paste(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Paste from Clipboard";
- ot->description= "Paste text from clipboard";
- ot->idname= "CONSOLE_OT_paste";
+ ot->name = "Paste from Clipboard";
+ ot->description = "Paste text from clipboard";
+ ot->idname = "CONSOLE_OT_paste";
/* api callbacks */
- ot->poll= ED_operator_console_active;
- ot->exec= console_paste_exec;
+ ot->poll = ED_operator_console_active;
+ ot->exec = console_paste_exec;
/* properties */
}
@@ -877,10 +883,10 @@ typedef struct SetConsoleCursor {
static void console_cursor_set_to_pos(SpaceConsole *sc, ARegion *ar, SetConsoleCursor *scu, int mval[2], int UNUSED(sel))
{
int pos;
- pos= console_char_pick(sc, ar, mval);
+ pos = console_char_pick(sc, ar, mval);
- if(scu->sel_init == INT_MAX) {
- scu->sel_init= pos;
+ if (scu->sel_init == INT_MAX) {
+ scu->sel_init = pos;
sc->sel_start = sc->sel_end = pos;
return;
}
@@ -900,22 +906,22 @@ static void console_cursor_set_to_pos(SpaceConsole *sc, ARegion *ar, SetConsoleC
static void console_modal_select_apply(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceConsole *sc= CTX_wm_space_console(C);
- ARegion *ar= CTX_wm_region(C);
- SetConsoleCursor *scu= op->customdata;
+ SpaceConsole *sc = CTX_wm_space_console(C);
+ ARegion *ar = CTX_wm_region(C);
+ SetConsoleCursor *scu = op->customdata;
int mval[2];
int sel_prev[2];
- mval[0]= event->mval[0];
- mval[1]= event->mval[1];
+ mval[0] = event->mval[0];
+ mval[1] = event->mval[1];
- sel_prev[0]= sc->sel_start;
- sel_prev[1]= sc->sel_end;
+ sel_prev[0] = sc->sel_start;
+ sel_prev[1] = sc->sel_end;
console_cursor_set_to_pos(sc, ar, scu, mval, TRUE);
/* only redraw if the selection changed */
- if(sel_prev[0] != sc->sel_start || sel_prev[1] != sc->sel_end) {
+ if (sel_prev[0] != sc->sel_start || sel_prev[1] != sc->sel_end) {
ED_area_tag_redraw(CTX_wm_area(C));
}
}
@@ -923,29 +929,30 @@ static void console_modal_select_apply(bContext *C, wmOperator *op, wmEvent *eve
static void console_cursor_set_exit(bContext *UNUSED(C), wmOperator *op)
{
// SpaceConsole *sc= CTX_wm_space_console(C);
- SetConsoleCursor *scu= op->customdata;
+ SetConsoleCursor *scu = op->customdata;
- /*
- if(txt_has_sel(text)) {
+#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);
}
static int console_modal_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceConsole *sc= CTX_wm_space_console(C);
+ SpaceConsole *sc = CTX_wm_space_console(C);
// ARegion *ar= CTX_wm_region(C);
SetConsoleCursor *scu;
- op->customdata= MEM_callocN(sizeof(SetConsoleCursor), "SetConsoleCursor");
- scu= op->customdata;
+ op->customdata = MEM_callocN(sizeof(SetConsoleCursor), "SetConsoleCursor");
+ scu = op->customdata;
- scu->sel_old[0]= sc->sel_start;
- scu->sel_old[1]= sc->sel_end;
+ scu->sel_old[0] = sc->sel_start;
+ scu->sel_old[1] = sc->sel_end;
scu->sel_init = INT_MAX;
@@ -958,7 +965,7 @@ static int console_modal_select_invoke(bContext *C, wmOperator *op, wmEvent *eve
static int console_modal_select(bContext *C, wmOperator *op, wmEvent *event)
{
- switch(event->type) {
+ switch (event->type) {
case LEFTMOUSE:
case MIDDLEMOUSE:
case RIGHTMOUSE:
@@ -981,13 +988,13 @@ static int console_modal_select_cancel(bContext *C, wmOperator *op)
void CONSOLE_OT_select_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Selection";
- ot->idname= "CONSOLE_OT_select_set";
- ot->description= "Set the console selection";
+ ot->name = "Set Selection";
+ ot->idname = "CONSOLE_OT_select_set";
+ ot->description = "Set the console selection";
/* api callbacks */
- ot->invoke= console_modal_select_invoke;
- ot->modal= console_modal_select;
- ot->cancel= console_modal_select_cancel;
- ot->poll= ED_operator_console_active;
+ ot->invoke = console_modal_select_invoke;
+ ot->modal = console_modal_select;
+ ot->cancel = console_modal_select_cancel;
+ ot->poll = ED_operator_console_active;
}
diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c
index 3df8e98be3a..b71ca6c36c4 100644
--- a/source/blender/editors/space_console/space_console.c
+++ b/source/blender/editors/space_console/space_console.c
@@ -54,7 +54,7 @@
#include "UI_resources.h"
#include "UI_view2d.h"
-#include "console_intern.h" // own include
+#include "console_intern.h" // own include
/* ******************** default callbacks for console space ***************** */
@@ -63,32 +63,32 @@ static SpaceLink *console_new(const bContext *UNUSED(C))
ARegion *ar;
SpaceConsole *sconsole;
- sconsole= MEM_callocN(sizeof(SpaceConsole), "initconsole");
- sconsole->spacetype= SPACE_CONSOLE;
+ sconsole = MEM_callocN(sizeof(SpaceConsole), "initconsole");
+ sconsole->spacetype = SPACE_CONSOLE;
- sconsole->lheight= 14;
+ sconsole->lheight = 14;
/* header */
- ar= MEM_callocN(sizeof(ARegion), "header for console");
+ ar = MEM_callocN(sizeof(ARegion), "header for console");
BLI_addtail(&sconsole->regionbase, ar);
- ar->regiontype= RGN_TYPE_HEADER;
- ar->alignment= RGN_ALIGN_BOTTOM;
+ ar->regiontype = RGN_TYPE_HEADER;
+ ar->alignment = RGN_ALIGN_BOTTOM;
/* main area */
- ar= MEM_callocN(sizeof(ARegion), "main area for text");
+ ar = MEM_callocN(sizeof(ARegion), "main area for text");
BLI_addtail(&sconsole->regionbase, ar);
- ar->regiontype= RGN_TYPE_WINDOW;
+ ar->regiontype = RGN_TYPE_WINDOW;
/* keep in sync with info */
ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
- ar->v2d.align |= V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y; /* align bottom left */
+ ar->v2d.align |= V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_NEG_Y; /* align bottom left */
ar->v2d.keepofs |= V2D_LOCKOFS_X;
- ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT);
- ar->v2d.keeptot= V2D_KEEPTOT_BOUNDS;
- ar->v2d.minzoom= ar->v2d.maxzoom= 1.0f;
+ ar->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT);
+ ar->v2d.keeptot = V2D_KEEPTOT_BOUNDS;
+ ar->v2d.minzoom = ar->v2d.maxzoom = 1.0f;
/* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */
//ar->v2d.keepzoom= (V2D_KEEPASPECT|V2D_LIMITZOOM);
@@ -99,12 +99,12 @@ static SpaceLink *console_new(const bContext *UNUSED(C))
/* not spacelink itself */
static void console_free(SpaceLink *sl)
{
- SpaceConsole *sc= (SpaceConsole*) sl;
+ SpaceConsole *sc = (SpaceConsole *) sl;
- while(sc->scrollback.first)
+ while (sc->scrollback.first)
console_scrollback_free(sc, sc->scrollback.first);
- while(sc->history.first)
+ while (sc->history.first)
console_history_free(sc, sc->history.first);
}
@@ -117,13 +117,13 @@ static void console_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)
static SpaceLink *console_duplicate(SpaceLink *sl)
{
- SpaceConsole *sconsolen= MEM_dupallocN(sl);
+ SpaceConsole *sconsolen = MEM_dupallocN(sl);
/* clear or remove stuff from old */
/* TODO - duplicate?, then we also need to duplicate the py namespace */
- sconsolen->scrollback.first= sconsolen->scrollback.last= NULL;
- sconsolen->history.first= sconsolen->history.last= NULL;
+ sconsolen->scrollback.first = sconsolen->scrollback.last = NULL;
+ sconsolen->history.first = sconsolen->history.last = NULL;
return (SpaceLink *)sconsolen;
}
@@ -136,23 +136,23 @@ 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);
/* always keep the bottom part of the view aligned, less annoying */
- if(prev_y_min != ar->v2d.cur.ymin) {
- const float cur_y_range= ar->v2d.cur.ymax - ar->v2d.cur.ymin;
- ar->v2d.cur.ymin= prev_y_min;
- ar->v2d.cur.ymax= prev_y_min + cur_y_range;
+ if (prev_y_min != ar->v2d.cur.ymin) {
+ const float cur_y_range = ar->v2d.cur.ymax - ar->v2d.cur.ymin;
+ ar->v2d.cur.ymin = prev_y_min;
+ ar->v2d.cur.ymax = prev_y_min + cur_y_range;
}
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "Console", SPACE_CONSOLE, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Console", SPACE_CONSOLE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* add drop boxes */
- lb= WM_dropboxmap_find("Console", SPACE_CONSOLE, RGN_TYPE_WINDOW);
+ lb = WM_dropboxmap_find("Console", SPACE_CONSOLE, RGN_TYPE_WINDOW);
WM_event_add_dropbox_handler(&ar->handlers, lb);
}
@@ -163,7 +163,7 @@ static void console_main_area_init(wmWindowManager *wm, ARegion *ar)
static int id_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
// SpaceConsole *sc= CTX_wm_space_console(C);
- if(drag->type==WM_DRAG_ID)
+ if (drag->type == WM_DRAG_ID)
return 1;
return 0;
}
@@ -171,10 +171,10 @@ static int id_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event
static void id_drop_copy(wmDrag *drag, wmDropBox *drop)
{
char text[64];
- ID *id= drag->poin;
+ ID *id = drag->poin;
char id_esc[(sizeof(id->name) - 2) * 2];
- BLI_strescape(id_esc, id->name+2, sizeof(id_esc));
+ BLI_strescape(id_esc, id->name + 2, sizeof(id_esc));
BLI_snprintf(text, sizeof(text), "bpy.data.%s[\"%s\"]", BKE_idcode_to_name_plural(GS(id->name)), id_esc);
@@ -185,14 +185,14 @@ static void id_drop_copy(wmDrag *drag, wmDropBox *drop)
static int path_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
// SpaceConsole *sc= CTX_wm_space_console(C);
- if(drag->type==WM_DRAG_PATH)
+ if (drag->type == WM_DRAG_PATH)
return 1;
return 0;
}
static void path_drop_copy(wmDrag *drag, wmDropBox *drop)
{
- char pathname[FILE_MAX+2];
+ char pathname[FILE_MAX + 2];
BLI_snprintf(pathname, sizeof(pathname), "\"%s\"", drag->path);
RNA_string_set(drop->ptr, "text", pathname);
}
@@ -201,7 +201,7 @@ static void path_drop_copy(wmDrag *drag, wmDropBox *drop)
/* this region dropbox definition */
static void console_dropboxes(void)
{
- ListBase *lb= WM_dropboxmap_find("Console", SPACE_CONSOLE, RGN_TYPE_WINDOW);
+ ListBase *lb = WM_dropboxmap_find("Console", SPACE_CONSOLE, RGN_TYPE_WINDOW);
WM_dropbox_add(lb, "CONSOLE_OT_insert", id_drop_poll, id_drop_copy);
WM_dropbox_add(lb, "CONSOLE_OT_insert", path_drop_poll, path_drop_copy);
@@ -212,11 +212,11 @@ static void console_dropboxes(void)
static void console_main_area_draw(const bContext *C, ARegion *ar)
{
/* draw entirely, view changes should be handled here */
- SpaceConsole *sc= CTX_wm_space_console(C);
- View2D *v2d= &ar->v2d;
+ SpaceConsole *sc = CTX_wm_space_console(C);
+ View2D *v2d = &ar->v2d;
View2DScrollers *scrollers;
- if(sc->scrollback.first==NULL)
+ if (sc->scrollback.first == NULL)
WM_operator_name_call((bContext *)C, "CONSOLE_OT_banner", WM_OP_EXEC_DEFAULT, NULL);
/* clear and setup matrix */
@@ -235,7 +235,7 @@ static void console_main_area_draw(const bContext *C, ARegion *ar)
UI_view2d_view_restore(C);
/* scrollers */
- scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_GRID_CLAMP);
+ scrollers = UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_GRID_CLAMP);
UI_view2d_scrollers_draw(C, v2d, scrollers);
UI_view2d_scrollers_free(scrollers);
}
@@ -260,7 +260,7 @@ static void console_operatortypes(void)
static void console_keymap(struct wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "Console", SPACE_CONSOLE, 0);
+ wmKeyMap *keymap = WM_keymap_find(keyconf, "Console", SPACE_CONSOLE, 0);
wmKeyMapItem *kmi;
#ifdef __APPLE__
@@ -293,30 +293,25 @@ static void console_keymap(struct wmKeyConfig *keyconf)
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", LEFTARROWKEY, KM_PRESS, 0, 0)->ptr, "type", PREV_CHAR);
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", RIGHTARROWKEY, KM_PRESS, 0, 0)->ptr, "type", NEXT_CHAR);
- kmi = WM_keymap_add_item(keymap, "CONSOLE_OT_history_cycle", UPARROWKEY, KM_PRESS, 0, 0);
- RNA_boolean_set(kmi->ptr, "reverse", TRUE);
- WM_keymap_add_item(keymap, "CONSOLE_OT_history_cycle", DOWNARROWKEY, KM_PRESS, 0, 0);
+ RNA_boolean_set(WM_keymap_add_item(keymap, "CONSOLE_OT_history_cycle", UPARROWKEY, KM_PRESS, 0, 0)->ptr, "reverse", TRUE);
+ RNA_boolean_set(WM_keymap_add_item(keymap, "CONSOLE_OT_history_cycle", DOWNARROWKEY, KM_PRESS, 0, 0)->ptr, "reverse", FALSE);
- /*
+#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);
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", DOWNARROWKEY, KM_PRESS, 0, 0)->ptr, "type", NEXT_LINE);
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", PAGEUPKEY, KM_PRESS, 0, 0)->ptr, "type", PREV_PAGE);
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", PAGEDOWNKEY, KM_PRESS, 0, 0)->ptr, "type", NEXT_PAGE);
-
-
- //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", DKEY, KM_PRESS, KM_CTRL, 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);
- 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);
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_delete", BACKSPACEKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", DEL_PREV_CHAR); /* same as above [#26623] */
+ 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);
+
#ifdef WITH_PYTHON
WM_keymap_add_item(keymap, "CONSOLE_OT_execute", RETKEY, KM_PRESS, 0, 0); /* python operator - space_text.py */
WM_keymap_add_item(keymap, "CONSOLE_OT_execute", PADENTER, KM_PRESS, 0, 0);
@@ -356,9 +351,9 @@ static void console_main_area_listener(ARegion *ar, wmNotifier *wmn)
// SpaceInfo *sinfo= sa->spacedata.first;
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_SPACE:
- if(wmn->data == ND_SPACE_CONSOLE) { /* generic redraw request */
+ if (wmn->data == ND_SPACE_CONSOLE) { /* generic redraw request */
ED_region_tag_redraw(ar);
}
break;
@@ -368,41 +363,41 @@ static void console_main_area_listener(ARegion *ar, wmNotifier *wmn)
/* only called once, from space/spacetypes.c */
void ED_spacetype_console(void)
{
- SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype console");
+ SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype console");
ARegionType *art;
- st->spaceid= SPACE_CONSOLE;
+ st->spaceid = SPACE_CONSOLE;
strncpy(st->name, "Console", BKE_ST_MAXNAME);
- st->new= console_new;
- st->free= console_free;
- st->init= console_init;
- st->duplicate= console_duplicate;
- st->operatortypes= console_operatortypes;
- st->keymap= console_keymap;
- st->dropboxes= console_dropboxes;
+ st->new = console_new;
+ st->free = console_free;
+ st->init = console_init;
+ st->duplicate = console_duplicate;
+ st->operatortypes = console_operatortypes;
+ st->keymap = console_keymap;
+ st->dropboxes = console_dropboxes;
/* regions: main window */
- art= MEM_callocN(sizeof(ARegionType), "spacetype console region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype console region");
art->regionid = RGN_TYPE_WINDOW;
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D;
- art->init= console_main_area_init;
- art->draw= console_main_area_draw;
- art->listener= console_main_area_listener;
+ art->init = console_main_area_init;
+ art->draw = console_main_area_draw;
+ art->listener = console_main_area_listener;
BLI_addhead(&st->regiontypes, art);
/* regions: header */
- art= MEM_callocN(sizeof(ARegionType), "spacetype console region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype console region");
art->regionid = RGN_TYPE_HEADER;
- art->prefsizey= HEADERY;
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_HEADER;
+ art->prefsizey = HEADERY;
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_HEADER;
- art->init= console_header_area_init;
- art->draw= console_header_area_draw;
+ art->init = console_header_area_init;
+ art->draw = console_header_area_draw;
BLI_addhead(&st->regiontypes, art);
diff --git a/source/blender/editors/space_file/CMakeLists.txt b/source/blender/editors/space_file/CMakeLists.txt
index 6d959d0b739..98e147413ff 100644
--- a/source/blender/editors/space_file/CMakeLists.txt
+++ b/source/blender/editors/space_file/CMakeLists.txt
@@ -78,4 +78,8 @@ if(WITH_IMAGE_HDR)
add_definitions(-DWITH_HDR)
endif()
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_editor_space_file "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/space_file/SConscript b/source/blender/editors/space_file/SConscript
index ad96840f7b9..ad8bcba39d6 100644
--- a/source/blender/editors/space_file/SConscript
+++ b/source/blender/editors/space_file/SConscript
@@ -19,11 +19,14 @@ if env['WITH_BF_OPENEXR']:
if env['WITH_BF_TIFF']:
defs.append('WITH_TIFF')
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
-
+
env.BlenderLib ( 'bf_editors_space_file', sources, Split(incs), defs, libtype=['core'], priority=[115] )
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 33d14ec38ae..4d764bff311 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -157,7 +157,8 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
if (available_w <= loadbutton + separator + input_minw
|| params->title[0] == 0) {
loadbutton = 0;
- } else {
+ }
+ else {
line1_w -= (loadbutton + separator);
line2_w = line1_w;
}
@@ -166,7 +167,8 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
fnumbuttons = 2 * btn_fn_w;
if (!loadbutton || line2_w <= fnumbuttons + separator + input_minw) {
fnumbuttons = 0;
- } else {
+ }
+ else {
line2_w -= (fnumbuttons + separator);
}
@@ -183,16 +185,17 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
uiButSetCompleteFunc(but, autocomplete_directory, NULL);
uiButSetFlag(but, UI_BUT_NO_UTF8);
- if((params->flag & FILE_DIRSEL_ONLY) == 0) {
+ if ((params->flag & FILE_DIRSEL_ONLY) == 0) {
but = uiDefBut(block, TEX, B_FS_FILENAME, "",
min_x, line2_y, line2_w-chan_offs, btn_h,
params->file, 0.0, (float)FILE_MAXFILE, 0, 0,
TIP_(overwrite_alert ?N_("File name, overwrite existing") : N_("File name")));
uiButSetCompleteFunc(but, autocomplete_file, NULL);
uiButSetFlag(but, UI_BUT_NO_UTF8);
+ uiButClearFlag(but, UI_BUT_UNDO); /* operator button above does this automatic */
/* check if this overrides a file and if the operator option is used */
- if(overwrite_alert) {
+ if (overwrite_alert) {
uiButSetFlag(but, UI_BUT_REDALERT);
}
}
@@ -219,14 +222,12 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
}
/* Execute / cancel buttons. */
- if(loadbutton) {
+ 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);
@@ -248,7 +249,7 @@ static int get_file_icon(struct direntry *file)
if ( strcmp(file->relname, "..") == 0) {
return ICON_FILE_PARENT;
}
- if(file->flags & BLENDERFILE) {
+ if (file->flags & BLENDERFILE) {
return ICON_FILE_BLEND;
}
return ICON_FILE_FOLDER;
@@ -286,7 +287,7 @@ static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon,
/*if (icon == ICON_FILE_BLANK) alpha = 0.375f;*/
- but= uiDefIconBut(block, LABEL, 0, icon, x, y, width, height, NULL, 0.0f, 0.0f, 0.0f, 0.0f, "");
+ but = uiDefIconBut(block, LABEL, 0, icon, x, y, width, height, NULL, 0.0f, 0.0f, 0.0f, 0.0f, "");
uiButSetDragPath(but, path);
}
@@ -344,7 +345,8 @@ static void file_draw_preview(uiBlock *block, struct direntry *file, int sx, int
scaledx = ( (float)imb->x/(float)imb->y )*layout->prv_h;
scale = scaledy/imb->y;
}
- } else {
+ }
+ else {
scaledx = (float)imb->x;
scaledy = (float)imb->y;
scale = 1.0;
@@ -377,7 +379,7 @@ static void file_draw_preview(uiBlock *block, struct direntry *file, int sx, int
}
/* dragregion */
- but= uiDefBut(block, LABEL, 0, "", xco, yco, ex, ey, NULL, 0.0, 0.0, 0, 0, "");
+ but = uiDefBut(block, LABEL, 0, "", xco, yco, ex, ey, NULL, 0.0, 0.0, 0, 0, "");
uiButSetDragImage(but, file->path, get_file_icon(file), imb, scale);
glDisable(GL_BLEND);
@@ -397,7 +399,7 @@ static void renamebutton_cb(bContext *C, void *UNUSED(arg1), char *oldname)
BLI_strncpy(filename, sfile->params->renameedit, sizeof(filename));
BLI_make_file_string(G.main->name, newname, sfile->params->dir, filename);
- if( strcmp(orgname, newname) != 0 ) {
+ if ( strcmp(orgname, newname) != 0 ) {
if (!BLI_exists(newname)) {
BLI_rename(orgname, newname);
/* to make sure we show what is on disk */
@@ -478,7 +480,8 @@ void file_draw_list(const bContext *C, ARegion *ar)
/* adjust, so the next row is already drawn when scrolling */
if (layout->flag & FILE_LAYOUT_HOR) {
numfiles_layout += layout->rows;
- } else {
+ }
+ else {
numfiles_layout += layout->columns;
}
@@ -516,7 +519,8 @@ void file_draw_list(const bContext *C, ARegion *ar)
}
file_draw_preview(block, file, sx, sy, imb, layout, !is_icon && (file->flags & IMAGEFILE));
- } else {
+ }
+ else {
file_draw_icon(block, file->path, sx, sy-(UI_UNIT_Y / 6), get_file_icon(file), ICON_DEFAULT_WIDTH_SCALE, ICON_DEFAULT_HEIGHT_SCALE);
sx += ICON_DEFAULT_WIDTH_SCALE + 4;
}
@@ -528,6 +532,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
textwidth, textheight, sfile->params->renameedit, 1.0f, (float)sizeof(sfile->params->renameedit),0,0,"");
uiButSetRenameFunc(but, renamebutton_cb, file);
uiButSetFlag(but, UI_BUT_NO_UTF8); /* allow non utf8 names */
+ uiButClearFlag(but, UI_BUT_UNDO);
if ( 0 == uiButActiveOnly(C, block, but)) {
file->selflag &= ~EDITING_FILE;
}
@@ -544,7 +549,8 @@ void file_draw_list(const bContext *C, ARegion *ar)
file_draw_string(sx, sy, file->size, layout->column_widths[COLUMN_SIZE], layout->tile_h, align);
sx += (int)layout->column_widths[COLUMN_SIZE] + 12;
}
- } else if (params->display == FILE_LONGDISPLAY) {
+ }
+ else if (params->display == FILE_LONGDISPLAY) {
sx += (int)layout->column_widths[COLUMN_NAME] + 12;
#ifndef WIN32
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 548a51d9ee2..62b7aafb187 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -170,7 +170,7 @@ static FileSelect file_select_do(bContext* C, int selected_idx)
{
params->active_file = selected_idx;
- if(S_ISDIR(file->type)) {
+ if (S_ISDIR(file->type)) {
/* the path is too long and we are not going up! */
if (strcmp(file->relname, "..") && strlen(params->dir) + strlen(file->relname) >= FILE_MAX ) {
// XXX error("Path too long, cannot enter this directory");
@@ -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);
@@ -241,12 +240,12 @@ static int file_border_select_modal(bContext *C, wmOperator *op, wmEvent *event)
result= WM_border_select_modal(C, op, event);
- if(result==OPERATOR_RUNNING_MODAL) {
+ if (result==OPERATOR_RUNNING_MODAL) {
- 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");
+ 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");
BLI_isect_rcti(&(ar->v2d.mask), &rect, &rect);
@@ -258,7 +257,8 @@ static int file_border_select_modal(bContext *C, wmOperator *op, wmEvent *event)
}
params->sel_first = sel.first; params->sel_last = sel.last;
- }else {
+ }
+ else {
params->active_file = -1;
params->sel_first = params->sel_last = -1;
file_deselect_all(sfile, HILITED_FILE);
@@ -276,12 +276,12 @@ static int file_border_select_exec(bContext *C, wmOperator *op)
int extend= RNA_boolean_get(op->ptr, "extend");
short select= (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT);
- 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");
+ 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");
- if(!extend) {
+ if (!extend) {
SpaceFile *sfile= CTX_wm_space_file(C);
file_deselect_all(sfile, SELECTED_FILE);
@@ -292,7 +292,8 @@ static int file_border_select_exec(bContext *C, wmOperator *op)
ret = file_select(C, &rect, select ? FILE_SEL_ADD : FILE_SEL_REMOVE, 0);
if (FILE_SELECT_DIR == ret) {
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
- } else if (FILE_SELECT_FILE == ret) {
+ }
+ else if (FILE_SELECT_FILE == ret) {
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
}
return OPERATOR_FINISHED;
@@ -301,16 +302,16 @@ static int file_border_select_exec(bContext *C, wmOperator *op)
void FILE_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Activate/Select File";
- ot->description= "Activate/select the file(s) contained in the border";
- ot->idname= "FILE_OT_select_border";
+ ot->name = "Activate/Select File";
+ ot->description = "Activate/select the file(s) contained in the border";
+ ot->idname = "FILE_OT_select_border";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= file_border_select_exec;
- ot->modal= file_border_select_modal;
- ot->poll= ED_operator_file_active;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = file_border_select_exec;
+ ot->modal = file_border_select_modal;
+ ot->poll = ED_operator_file_active;
+ ot->cancel = WM_border_select_cancel;
/* rna */
WM_operator_properties_gesture_border(ot, 1);
@@ -325,13 +326,13 @@ static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
int extend = RNA_boolean_get(op->ptr, "extend");
int fill = RNA_boolean_get(op->ptr, "fill");
- if(ar->regiontype != RGN_TYPE_WINDOW)
+ if (ar->regiontype != RGN_TYPE_WINDOW)
return OPERATOR_CANCELLED;
rect.xmin = rect.xmax = event->mval[0];
rect.ymin = rect.ymax = event->mval[1];
- if(!BLI_in_rcti(&ar->v2d.mask, rect.xmin, rect.ymin))
+ if (!BLI_in_rcti(&ar->v2d.mask, rect.xmin, rect.ymin))
return OPERATOR_CANCELLED;
/* single select, deselect all selected first */
@@ -352,13 +353,13 @@ static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
void FILE_OT_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Activate/Select File";
- ot->description= "Activate/select file";
- ot->idname= "FILE_OT_select";
+ ot->name = "Activate/Select File";
+ ot->description = "Activate/select file";
+ ot->idname = "FILE_OT_select";
/* api callbacks */
- ot->invoke= file_select_invoke;
- ot->poll= ED_operator_file_active;
+ ot->invoke = file_select_invoke;
+ ot->poll = ED_operator_file_active;
/* rna */
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first");
@@ -399,13 +400,13 @@ static int file_select_all_exec(bContext *C, wmOperator *UNUSED(op))
void FILE_OT_select_all_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select/Deselect All Files";
- ot->description= "Select/deselect all files";
- ot->idname= "FILE_OT_select_all_toggle";
+ ot->name = "(De)select All Files";
+ ot->description = "Select or deselect all files";
+ ot->idname = "FILE_OT_select_all_toggle";
/* api callbacks */
- ot->exec= file_select_all_exec;
- ot->poll= ED_operator_file_active;
+ ot->exec = file_select_all_exec;
+ ot->poll = ED_operator_file_active;
/* rna */
@@ -418,7 +419,7 @@ static int bookmark_select_exec(bContext *C, wmOperator *op)
{
SpaceFile *sfile= CTX_wm_space_file(C);
- if(RNA_struct_find_property(op->ptr, "dir")) {
+ if (RNA_struct_find_property(op->ptr, "dir")) {
char entry[256];
FileSelectParams* params = sfile->params;
@@ -436,13 +437,13 @@ static int bookmark_select_exec(bContext *C, wmOperator *op)
void FILE_OT_select_bookmark(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Directory";
- ot->description= "Select a bookmarked directory";
- ot->idname= "FILE_OT_select_bookmark";
+ ot->name = "Select Directory";
+ ot->description = "Select a bookmarked directory";
+ ot->idname = "FILE_OT_select_bookmark";
/* api callbacks */
- ot->exec= bookmark_select_exec;
- ot->poll= ED_operator_file_active;
+ ot->exec = bookmark_select_exec;
+ ot->poll = ED_operator_file_active;
RNA_def_string(ot->srna, "dir", "", 256, "Dir", "");
}
@@ -469,13 +470,13 @@ static int bookmark_add_exec(bContext *C, wmOperator *UNUSED(op))
void FILE_OT_bookmark_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Bookmark";
- ot->description= "Add a bookmark for the selected/active directory";
- ot->idname= "FILE_OT_bookmark_add";
+ ot->name = "Add Bookmark";
+ ot->description = "Add a bookmark for the selected/active directory";
+ ot->idname = "FILE_OT_bookmark_add";
/* api callbacks */
- ot->exec= bookmark_add_exec;
- ot->poll= ED_operator_file_active;
+ ot->exec = bookmark_add_exec;
+ ot->poll = ED_operator_file_active;
}
static int bookmark_delete_exec(bContext *C, wmOperator *op)
@@ -484,7 +485,7 @@ static int bookmark_delete_exec(bContext *C, wmOperator *op)
struct FSMenu* fsmenu = fsmenu_get();
int nentries = fsmenu_get_nentries(fsmenu, FS_CATEGORY_BOOKMARKS);
- if(RNA_struct_find_property(op->ptr, "index")) {
+ if (RNA_struct_find_property(op->ptr, "index")) {
int index = RNA_int_get(op->ptr, "index");
if ( (index >-1) && (index < nentries)) {
char name[FILE_MAX];
@@ -502,13 +503,13 @@ static int bookmark_delete_exec(bContext *C, wmOperator *op)
void FILE_OT_delete_bookmark(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Bookmark";
- ot->description= "Delete selected bookmark";
- ot->idname= "FILE_OT_delete_bookmark";
+ ot->name = "Delete Bookmark";
+ ot->description = "Delete selected bookmark";
+ ot->idname = "FILE_OT_delete_bookmark";
/* api callbacks */
- ot->exec= bookmark_delete_exec;
- ot->poll= ED_operator_file_active;
+ ot->exec = bookmark_delete_exec;
+ ot->poll = ED_operator_file_active;
RNA_def_int(ot->srna, "index", -1, -1, 20000, "Index", "", -1, 20000);
}
@@ -519,7 +520,7 @@ int file_hilight_set(SpaceFile *sfile, ARegion *ar, int mx, int my)
FileSelectParams* params;
int numfiles, origfile;
- if(sfile==NULL || sfile->files==NULL) return 0;
+ if (sfile==NULL || sfile->files==NULL) return 0;
numfiles = filelist_numfiles(sfile->files);
params = ED_fileselect_get_params(sfile);
@@ -529,7 +530,7 @@ int file_hilight_set(SpaceFile *sfile, ARegion *ar, int mx, int my)
mx -= ar->winrct.xmin;
my -= ar->winrct.ymin;
- if(BLI_in_rcti(&ar->v2d.mask, mx, my)) {
+ if (BLI_in_rcti(&ar->v2d.mask, mx, my)) {
float fx, fy;
int active_file;
@@ -537,7 +538,7 @@ int file_hilight_set(SpaceFile *sfile, ARegion *ar, int mx, int my)
active_file = ED_fileselect_layout_offset(sfile->layout, (int)(v2d->tot.xmin + fx), (int)(v2d->tot.ymax - fy));
- if((active_file >= 0) && (active_file < numfiles))
+ if ((active_file >= 0) && (active_file < numfiles))
params->active_file=active_file;
else
params->active_file= -1;
@@ -553,7 +554,7 @@ static int file_highlight_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *e
ARegion *ar= CTX_wm_region(C);
SpaceFile *sfile= CTX_wm_space_file(C);
- if(!file_hilight_set(sfile, ar, event->x, event->y))
+ if (!file_hilight_set(sfile, ar, event->x, event->y))
return OPERATOR_CANCELLED;
ED_area_tag_redraw(CTX_wm_area(C));
@@ -564,13 +565,13 @@ static int file_highlight_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *e
void FILE_OT_highlight(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Highlight File";
- ot->description= "Highlight selected file(s)";
- ot->idname= "FILE_OT_highlight";
+ ot->name = "Highlight File";
+ ot->description = "Highlight selected file(s)";
+ ot->idname = "FILE_OT_highlight";
/* api callbacks */
- ot->invoke= file_highlight_invoke;
- ot->poll= ED_operator_file_active;
+ ot->invoke = file_highlight_invoke;
+ ot->poll = ED_operator_file_active;
}
int file_cancel_exec(bContext *C, wmOperator *UNUSED(unused))
@@ -598,32 +599,32 @@ static int file_operator_poll(bContext *C)
void FILE_OT_cancel(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Cancel File Load";
- ot->description= "Cancel loading of selected file";
- ot->idname= "FILE_OT_cancel";
+ ot->name = "Cancel File Load";
+ ot->description = "Cancel loading of selected file";
+ ot->idname = "FILE_OT_cancel";
/* api callbacks */
- ot->exec= file_cancel_exec;
- ot->poll= file_operator_poll;
+ ot->exec = file_cancel_exec;
+ ot->poll = file_operator_poll;
}
void file_sfile_to_operator(wmOperator *op, SpaceFile *sfile, char *filepath)
{
BLI_join_dirfile(filepath, FILE_MAX, sfile->params->dir, sfile->params->file); /* XXX, not real length */
- if(RNA_struct_find_property(op->ptr, "relative_path")) {
- if(RNA_boolean_get(op->ptr, "relative_path")) {
+ if (RNA_struct_find_property(op->ptr, "relative_path")) {
+ if (RNA_boolean_get(op->ptr, "relative_path")) {
BLI_path_rel(filepath, G.main->name);
}
}
- if(RNA_struct_find_property(op->ptr, "filename")) {
+ if (RNA_struct_find_property(op->ptr, "filename")) {
RNA_string_set(op->ptr, "filename", sfile->params->file);
}
- if(RNA_struct_find_property(op->ptr, "directory")) {
+ if (RNA_struct_find_property(op->ptr, "directory")) {
RNA_string_set(op->ptr, "directory", sfile->params->dir);
}
- if(RNA_struct_find_property(op->ptr, "filepath")) {
+ if (RNA_struct_find_property(op->ptr, "filepath")) {
RNA_string_set(op->ptr, "filepath", filepath);
}
@@ -636,7 +637,7 @@ void file_sfile_to_operator(wmOperator *op, SpaceFile *sfile, char *filepath)
PropertyRNA *prop_dirs= RNA_struct_find_property(op->ptr, "dirs");
int i, numfiles = filelist_numfiles(sfile->files);
- if(prop_files) {
+ if (prop_files) {
RNA_property_collection_clear(op->ptr, prop_files);
for (i=0; i<numfiles; i++) {
if (filelist_is_selected(sfile->files, i, CHECK_FILES)) {
@@ -647,7 +648,7 @@ void file_sfile_to_operator(wmOperator *op, SpaceFile *sfile, char *filepath)
}
}
- if(prop_dirs) {
+ if (prop_dirs) {
RNA_property_collection_clear(op->ptr, prop_dirs);
for (i=0; i<numfiles; i++) {
if (filelist_is_selected(sfile->files, i, CHECK_DIRS)) {
@@ -667,16 +668,16 @@ void file_operator_to_sfile(SpaceFile *sfile, wmOperator *op)
PropertyRNA *prop;
/* If neither of the above are set, split the filepath back */
- if((prop= RNA_struct_find_property(op->ptr, "filepath"))) {
+ if ((prop= RNA_struct_find_property(op->ptr, "filepath"))) {
char filepath[FILE_MAX];
RNA_property_string_get(op->ptr, prop, filepath);
BLI_split_dirfile(filepath, sfile->params->dir, sfile->params->file, sizeof(sfile->params->dir), sizeof(sfile->params->file));
}
else {
- if((prop= RNA_struct_find_property(op->ptr, "filename"))) {
+ if ((prop= RNA_struct_find_property(op->ptr, "filename"))) {
RNA_property_string_get(op->ptr, prop, sfile->params->file);
}
- if((prop= RNA_struct_find_property(op->ptr, "directory"))) {
+ if ((prop= RNA_struct_find_property(op->ptr, "directory"))) {
RNA_property_string_get(op->ptr, prop, sfile->params->dir);
}
}
@@ -692,13 +693,13 @@ void file_draw_check_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2))
{
SpaceFile *sfile= CTX_wm_space_file(C);
wmOperator *op= sfile->op;
- if(op) { /* fail on reload */
- if(op->type->check) {
+ if (op) { /* fail on reload */
+ if (op->type->check) {
char filepath[FILE_MAX];
file_sfile_to_operator(op, sfile, filepath);
/* redraw */
- if(op->type->check(C, op)) {
+ if (op->type->check(C, op)) {
file_operator_to_sfile(sfile, op);
/* redraw, else the changed settings wont get updated */
@@ -710,12 +711,12 @@ void file_draw_check_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2))
int file_draw_check_exists(SpaceFile *sfile)
{
- if(sfile->op) { /* fails on reload */
- if(RNA_struct_find_property(sfile->op->ptr, "check_existing")) {
- if(RNA_boolean_get(sfile->op->ptr, "check_existing")) {
+ if (sfile->op) { /* fails on reload */
+ if (RNA_struct_find_property(sfile->op->ptr, "check_existing")) {
+ if (RNA_boolean_get(sfile->op->ptr, "check_existing")) {
char filepath[FILE_MAX];
BLI_join_dirfile(filepath, sizeof(filepath), sfile->params->dir, sfile->params->file);
- if(BLI_is_file(filepath)) {
+ if (BLI_is_file(filepath)) {
return TRUE;
}
}
@@ -731,16 +732,16 @@ int file_exec(bContext *C, wmOperator *exec_op)
SpaceFile *sfile= CTX_wm_space_file(C);
char filepath[FILE_MAX];
- if(sfile->op) {
+ if (sfile->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;
for (i=0; i<filelist_numfiles(sfile->files); i++) {
- if(filelist_is_selected(sfile->files, i, CHECK_ALL)) {
+ if (filelist_is_selected(sfile->files, i, CHECK_ALL)) {
active=1;
break;
}
@@ -767,16 +768,20 @@ int file_exec(bContext *C, wmOperator *exec_op)
void FILE_OT_execute(struct wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
- ot->name= "Execute File Window";
- ot->description= "Execute selected file";
- ot->idname= "FILE_OT_execute";
+ ot->name = "Execute File Window";
+ ot->description = "Execute selected file";
+ ot->idname = "FILE_OT_execute";
/* api callbacks */
- ot->exec= file_exec;
- ot->poll= file_operator_poll;
+ ot->exec = file_exec;
+ ot->poll = file_operator_poll;
- RNA_def_boolean(ot->srna, "need_active", 0, "Need Active", "Only execute if there's an active selected file in the file list");
+ prop = RNA_def_boolean(ot->srna, "need_active", 0, "Need Active",
+ "Only execute if there's an active selected file in the file list");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
@@ -784,7 +789,7 @@ int file_parent_exec(bContext *C, wmOperator *UNUSED(unused))
{
SpaceFile *sfile= CTX_wm_space_file(C);
- if(sfile->params) {
+ if (sfile->params) {
if (BLI_has_parent(sfile->params->dir)) {
BLI_parent_dir(sfile->params->dir);
BLI_cleanup_dir(G.main->name, sfile->params->dir);
@@ -801,13 +806,13 @@ int file_parent_exec(bContext *C, wmOperator *UNUSED(unused))
void FILE_OT_parent(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Parent File";
- ot->description= "Move to parent directory";
- ot->idname= "FILE_OT_parent";
+ ot->name = "Parent File";
+ ot->description = "Move to parent directory";
+ ot->idname = "FILE_OT_parent";
/* api callbacks */
- ot->exec= file_parent_exec;
- ot->poll= ED_operator_file_active; /* <- important, handler is on window level */
+ ot->exec = file_parent_exec;
+ ot->poll = ED_operator_file_active; /* <- important, handler is on window level */
}
@@ -826,20 +831,20 @@ static int file_refresh_exec(bContext *C, wmOperator *UNUSED(unused))
void FILE_OT_previous(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Previous Folder";
- ot->description= "Move to previous folder";
- ot->idname= "FILE_OT_previous";
+ ot->name = "Previous Folder";
+ ot->description = "Move to previous folder";
+ ot->idname = "FILE_OT_previous";
/* api callbacks */
- ot->exec= file_previous_exec;
- ot->poll= ED_operator_file_active; /* <- important, handler is on window level */
+ ot->exec = file_previous_exec;
+ ot->poll = ED_operator_file_active; /* <- important, handler is on window level */
}
int file_previous_exec(bContext *C, wmOperator *UNUSED(unused))
{
SpaceFile *sfile= CTX_wm_space_file(C);
- if(sfile->params) {
+ if (sfile->params) {
if (!sfile->folders_next)
sfile->folders_next = folderlist_new();
@@ -857,19 +862,19 @@ int file_previous_exec(bContext *C, wmOperator *UNUSED(unused))
void FILE_OT_next(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Next Folder";
- ot->description= "Move to next folder";
- ot->idname= "FILE_OT_next";
+ ot->name = "Next Folder";
+ ot->description = "Move to next folder";
+ ot->idname = "FILE_OT_next";
/* api callbacks */
- ot->exec= file_next_exec;
- ot->poll= ED_operator_file_active; /* <- important, handler is on window level */
+ ot->exec = file_next_exec;
+ ot->poll = ED_operator_file_active; /* <- important, handler is on window level */
}
int file_next_exec(bContext *C, wmOperator *UNUSED(unused))
{
SpaceFile *sfile= CTX_wm_space_file(C);
- if(sfile->params) {
+ if (sfile->params) {
if (!sfile->folders_next)
sfile->folders_next = folderlist_new();
@@ -899,7 +904,7 @@ static int file_smoothscroll_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
int i;
/* escape if not our timer */
- if(sfile->smoothscroll_timer==NULL || sfile->smoothscroll_timer!=event->customdata)
+ if (sfile->smoothscroll_timer==NULL || sfile->smoothscroll_timer!=event->customdata)
return OPERATOR_PASS_THROUGH;
numfiles = filelist_numfiles(sfile->files);
@@ -936,7 +941,8 @@ static int file_smoothscroll_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
if (sfile->layout->flag & FILE_LAYOUT_HOR) {
sfile->scroll_offset = (edit_idx/sfile->layout->rows)*sfile->layout->rows;
if (sfile->scroll_offset <= offset) sfile->scroll_offset -= sfile->layout->rows;
- } else {
+ }
+ else {
sfile->scroll_offset = (edit_idx/sfile->layout->columns)*sfile->layout->columns;
if (sfile->scroll_offset <= offset) sfile->scroll_offset -= sfile->layout->columns;
}
@@ -959,14 +965,17 @@ static int file_smoothscroll_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
if (sfile->scroll_offset < offset) {
if (sfile->layout->flag & FILE_LAYOUT_HOR) {
WM_operator_name_call(C, "VIEW2D_OT_scroll_left", 0, NULL);
- } else {
+ }
+ else {
WM_operator_name_call(C, "VIEW2D_OT_scroll_up", 0, NULL);
}
- } else {
+ }
+ else {
if (sfile->layout->flag & FILE_LAYOUT_HOR) {
WM_operator_name_call(C, "VIEW2D_OT_scroll_right", 0, NULL);
- } else {
+ }
+ else {
WM_operator_name_call(C, "VIEW2D_OT_scroll_down", 0, NULL);
}
}
@@ -984,20 +993,20 @@ void FILE_OT_smoothscroll(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Smooth Scroll";
- ot->idname= "FILE_OT_smoothscroll";
- ot->description="Smooth scroll to make editable file visible";
+ ot->name = "Smooth Scroll";
+ ot->idname = "FILE_OT_smoothscroll";
+ ot->description = "Smooth scroll to make editable file visible";
/* api callbacks */
- ot->invoke= file_smoothscroll_invoke;
+ ot->invoke = file_smoothscroll_invoke;
- ot->poll= ED_operator_file_active;
+ ot->poll = ED_operator_file_active;
}
/* 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 +1015,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 */
@@ -1025,14 +1034,14 @@ int file_directory_new_exec(bContext *C, wmOperator *op)
SpaceFile *sfile= CTX_wm_space_file(C);
- if(!sfile->params) {
+ if (!sfile->params) {
BKE_report(op->reports,RPT_WARNING, "No parent directory given");
return OPERATOR_CANCELLED;
}
path[0] = '\0';
- if(RNA_struct_find_property(op->ptr, "directory")) {
+ if (RNA_struct_find_property(op->ptr, "directory")) {
RNA_string_get(op->ptr, "directory", path);
if (path[0] != '\0') generate_name= 0;
}
@@ -1071,14 +1080,14 @@ int file_directory_new_exec(bContext *C, wmOperator *op)
void FILE_OT_directory_new(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Create New Directory";
- ot->description= "Create a new directory";
- ot->idname= "FILE_OT_directory_new";
+ ot->name = "Create New Directory";
+ ot->description = "Create a new directory";
+ ot->idname = "FILE_OT_directory_new";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= file_directory_new_exec;
- ot->poll= ED_operator_file_active; /* <- important, handler is on window level */
+ ot->invoke = WM_operator_confirm;
+ ot->exec = file_directory_new_exec;
+ ot->poll = ED_operator_file_active; /* <- important, handler is on window level */
RNA_def_string_dir_path(ot->srna, "directory", "", FILE_MAX, "Directory", "Name of new directory");
@@ -1089,7 +1098,7 @@ static void file_expand_directory(bContext *C)
{
SpaceFile *sfile= CTX_wm_space_file(C);
- if(sfile->params) {
+ if (sfile->params) {
if ( sfile->params->dir[0] == '~' ) {
char tmpstr[sizeof(sfile->params->dir)-1];
BLI_strncpy(tmpstr, sfile->params->dir+1, sizeof(tmpstr));
@@ -1123,7 +1132,7 @@ static int file_directory_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev
{
SpaceFile *sfile= CTX_wm_space_file(C);
- if(sfile->params) {
+ if (sfile->params) {
file_expand_directory(C);
if (!BLI_exists(sfile->params->dir)) {
@@ -1142,7 +1151,7 @@ int file_directory_exec(bContext *C, wmOperator *UNUSED(unused))
{
SpaceFile *sfile= CTX_wm_space_file(C);
- if(sfile->params) {
+ if (sfile->params) {
file_expand_directory(C);
if (!BLI_exists(sfile->params->dir)) {
@@ -1150,7 +1159,7 @@ int file_directory_exec(bContext *C, wmOperator *UNUSED(unused))
}
/* special case, user may have pasted a filepath into the directory */
- if(BLI_is_file(sfile->params->dir)) {
+ if (BLI_is_file(sfile->params->dir)) {
char path[sizeof(sfile->params->dir)];
BLI_strncpy(path, sfile->params->dir, sizeof(path));
BLI_split_dirfile(path, sfile->params->dir, sfile->params->file, sizeof(sfile->params->dir), sizeof(sfile->params->file));
@@ -1171,9 +1180,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);
}
@@ -1194,33 +1202,33 @@ static int file_directory_poll(bContext *C)
void FILE_OT_directory(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Enter Directory Name";
- ot->description= "Enter a directory name";
- ot->idname= "FILE_OT_directory";
+ ot->name = "Enter Directory Name";
+ ot->description = "Enter a directory name";
+ ot->idname = "FILE_OT_directory";
/* api callbacks */
- ot->invoke= file_directory_invoke;
- ot->exec= file_directory_exec;
- ot->poll= file_directory_poll; /* <- important, handler is on window level */
+ ot->invoke = file_directory_invoke;
+ ot->exec = file_directory_exec;
+ ot->poll = file_directory_poll; /* <- important, handler is on window level */
}
void FILE_OT_refresh(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Refresh Filelist";
- ot->description= "Refresh the file list";
- ot->idname= "FILE_OT_refresh";
+ ot->name = "Refresh Filelist";
+ ot->description = "Refresh the file list";
+ ot->idname = "FILE_OT_refresh";
/* api callbacks */
- ot->exec= file_refresh_exec;
- ot->poll= ED_operator_file_active; /* <- important, handler is on window level */
+ ot->exec = file_refresh_exec;
+ ot->poll = ED_operator_file_active; /* <- important, handler is on window level */
}
static int file_hidedot_exec(bContext *C, wmOperator *UNUSED(unused))
{
SpaceFile *sfile= CTX_wm_space_file(C);
- if(sfile->params) {
+ if (sfile->params) {
sfile->params->flag ^= FILE_HIDE_DOT;
ED_fileselect_clear(C, sfile);
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
@@ -1233,30 +1241,30 @@ static int file_hidedot_exec(bContext *C, wmOperator *UNUSED(unused))
void FILE_OT_hidedot(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Hide Dot Files";
- ot->description= "Toggle hide hidden dot files";
- ot->idname= "FILE_OT_hidedot";
+ ot->name = "Toggle Hide Dot Files";
+ ot->description = "Toggle hide hidden dot files";
+ ot->idname = "FILE_OT_hidedot";
/* api callbacks */
- ot->exec= file_hidedot_exec;
- ot->poll= ED_operator_file_active; /* <- important, handler is on window level */
+ ot->exec = file_hidedot_exec;
+ ot->poll = ED_operator_file_active; /* <- important, handler is on window level */
}
struct ARegion *file_buttons_region(struct ScrArea *sa)
{
ARegion *ar, *arnew;
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->regiontype==RGN_TYPE_CHANNELS)
+ for (ar= sa->regionbase.first; ar; ar= ar->next)
+ if (ar->regiontype==RGN_TYPE_CHANNELS)
return ar;
/* add subdiv level; after header */
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->regiontype==RGN_TYPE_HEADER)
+ for (ar= sa->regionbase.first; ar; ar= ar->next)
+ if (ar->regiontype==RGN_TYPE_HEADER)
break;
/* is error! */
- if(ar==NULL) return NULL;
+ if (ar==NULL) return NULL;
arnew= MEM_callocN(sizeof(ARegion), "buttons for file panels");
@@ -1274,7 +1282,7 @@ static int file_bookmark_toggle_exec(bContext *C, wmOperator *UNUSED(unused))
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= file_buttons_region(sa);
- if(ar)
+ if (ar)
ED_region_toggle_hidden(C, ar);
return OPERATOR_FINISHED;
@@ -1283,13 +1291,13 @@ static int file_bookmark_toggle_exec(bContext *C, wmOperator *UNUSED(unused))
void FILE_OT_bookmark_toggle(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Bookmarks";
- ot->description= "Toggle bookmarks display";
- ot->idname= "FILE_OT_bookmark_toggle";
+ ot->name = "Toggle Bookmarks";
+ ot->description = "Toggle bookmarks display";
+ ot->idname = "FILE_OT_bookmark_toggle";
/* api callbacks */
- ot->exec= file_bookmark_toggle_exec;
- ot->poll= ED_operator_file_active; /* <- important, handler is on window level */
+ ot->exec = file_bookmark_toggle_exec;
+ ot->poll = ED_operator_file_active; /* <- important, handler is on window level */
}
@@ -1299,7 +1307,7 @@ static int file_filenum_exec(bContext *C, wmOperator *op)
ScrArea *sa= CTX_wm_area(C);
int inc = RNA_int_get(op->ptr, "increment");
- if(sfile->params && (inc != 0)) {
+ if (sfile->params && (inc != 0)) {
BLI_newname(sfile->params->file, inc);
ED_area_tag_redraw(sa);
file_draw_check_cb(C, NULL, NULL);
@@ -1313,13 +1321,13 @@ static int file_filenum_exec(bContext *C, wmOperator *op)
void FILE_OT_filenum(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Increment Number in Filename";
- ot->description= "Increment number in filename";
- ot->idname= "FILE_OT_filenum";
+ ot->name = "Increment Number in Filename";
+ ot->description = "Increment number in filename";
+ ot->idname = "FILE_OT_filenum";
/* api callbacks */
- ot->exec= file_filenum_exec;
- ot->poll= ED_operator_file_active; /* <- important, handler is on window level */
+ ot->exec = file_filenum_exec;
+ ot->poll = ED_operator_file_active; /* <- important, handler is on window level */
/* props */
RNA_def_int(ot->srna, "increment", 1, -100, 100, "Increment", "", -100,100);
@@ -1330,7 +1338,7 @@ static int file_rename_exec(bContext *C, wmOperator *UNUSED(op))
ScrArea *sa= CTX_wm_area(C);
SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C);
- if(sfile->params) {
+ if (sfile->params) {
int idx = sfile->params->active_file;
int numfiles = filelist_numfiles(sfile->files);
if ( (0<=idx) && (idx<numfiles) ) {
@@ -1354,7 +1362,8 @@ static int file_rename_poll(bContext *C)
if (sfile && sfile->params) {
if (sfile->params->active_file < 0) {
poll= 0;
- } else {
+ }
+ else {
char dir[FILE_MAX], group[FILE_MAX];
if (filelist_islibrary(sfile->files, dir, group)) poll= 0;
}
@@ -1367,13 +1376,13 @@ static int file_rename_poll(bContext *C)
void FILE_OT_rename(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Rename File or Directory";
- ot->description= "Rename file or file directory";
- ot->idname= "FILE_OT_rename";
+ ot->name = "Rename File or Directory";
+ ot->description = "Rename file or file directory";
+ ot->idname = "FILE_OT_rename";
/* api callbacks */
- ot->exec= file_rename_exec;
- ot->poll= file_rename_poll;
+ ot->exec = file_rename_exec;
+ ot->poll = file_rename_poll;
}
@@ -1386,7 +1395,8 @@ static int file_delete_poll(bContext *C)
if (sfile && sfile->params) {
if (sfile->params->active_file < 0) {
poll= 0;
- } else {
+ }
+ else {
char dir[FILE_MAX], group[FILE_MAX];
if (filelist_islibrary(sfile->files, dir, group)) poll= 0;
file = filelist_file(sfile->files, sfile->params->active_file);
@@ -1419,14 +1429,14 @@ int file_delete_exec(bContext *C, wmOperator *UNUSED(op))
void FILE_OT_delete(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete File";
- ot->description= "Delete selected file";
- ot->idname= "FILE_OT_delete";
+ ot->name = "Delete File";
+ ot->description = "Delete selected file";
+ ot->idname = "FILE_OT_delete";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= file_delete_exec;
- ot->poll= file_delete_poll; /* <- important, handler is on window level */
+ ot->invoke = WM_operator_confirm;
+ ot->exec = file_delete_exec;
+ ot->poll = file_delete_poll; /* <- important, handler is on window level */
}
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index 26083cbe625..596721bff07 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -80,7 +80,7 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat
*nr= -1;
/* hide if no entries */
- if(nentries == 0)
+ if (nentries == 0)
return;
/* layout */
@@ -100,8 +100,8 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat
entry = fsmenu_get_entry(fsmenu, category, i);
/* set this list item as active if we have a match */
- if(sfile->params) {
- if(BLI_path_cmp(sfile->params->dir, entry) == 0) {
+ if (sfile->params) {
+ if (BLI_path_cmp(sfile->params->dir, entry) == 0) {
*nr= i;
}
}
@@ -112,16 +112,16 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat
BLI_getlastdir(temp, dir, FILE_MAX);
BLI_del_slash(dir);
- if(dir[0] == 0)
+ if (dir[0] == 0)
BLI_strncpy(dir, entry, FILE_MAX);
/* create list item */
- but= uiDefIconTextButS(block, LISTROW, 0, icon, dir, 0,0,UI_UNIT_X*10,UI_UNIT_Y, nr, 0, i, 0, 0, entry);
+ but = uiDefIconTextButS(block, LISTROW, 0, icon, dir, 0,0,UI_UNIT_X*10,UI_UNIT_Y, nr, 0, i, 0, 0, entry);
uiButSetFunc(but, file_panel_cb, entry, NULL);
uiButSetFlag(but, UI_ICON_LEFT|UI_TEXT_LEFT);
/* create delete button */
- if(allow_delete && fsmenu_can_save(fsmenu, category, i)) {
+ if (allow_delete && fsmenu_can_save(fsmenu, category, i)) {
uiBlockSetEmboss(block, UI_EMBOSSN);
uiItemIntO(layout, "", ICON_X, "FILE_OT_delete_bookmark", "index", i);
uiBlockSetEmboss(block, UI_EMBOSS);
@@ -133,7 +133,7 @@ static void file_panel_system(const bContext *C, Panel *pa)
{
SpaceFile *sfile= CTX_wm_space_file(C);
- if(sfile)
+ if (sfile)
file_panel_category(C, pa, FS_CATEGORY_SYSTEM, &sfile->systemnr, ICON_DISK_DRIVE, 0, 0);
}
@@ -142,7 +142,7 @@ static void file_panel_bookmarks(const bContext *C, Panel *pa)
SpaceFile *sfile= CTX_wm_space_file(C);
uiLayout *row;
- if(sfile) {
+ if (sfile) {
row= uiLayoutRow(pa->layout, 0);
uiItemO(row, IFACE_("Add"), ICON_ZOOMIN, "file.bookmark_add");
uiItemL(row, NULL, ICON_NONE);
@@ -155,7 +155,7 @@ static void file_panel_recent(const bContext *C, Panel *pa)
{
SpaceFile *sfile= CTX_wm_space_file(C);
- if(sfile) {
+ if (sfile) {
if ( !(U.uiflag & USER_HIDE_RECENT) ) {
file_panel_category(C, pa, FS_CATEGORY_RECENT, &sfile->recentnr, ICON_FILE_FOLDER, 0, 1);
}
@@ -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 b5059d157b9..71ead483d06 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -158,24 +158,26 @@ static int compare_name(const void *a1, const void *a2)
/* type is equal to stat.st_mode */
- if (S_ISDIR(entry1->type)){
+ if (S_ISDIR(entry1->type)) {
if (S_ISDIR(entry2->type)==0) return (-1);
- } else{
+ }
+ else {
if (S_ISDIR(entry2->type)) return (1);
}
- if (S_ISREG(entry1->type)){
+ if (S_ISREG(entry1->type)) {
if (S_ISREG(entry2->type)==0) return (-1);
- } else{
+ }
+ else {
if (S_ISREG(entry2->type)) return (1);
}
if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1);
if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1);
/* make sure "." and ".." are always first */
- if( strcmp(entry1->relname, ".")==0 ) return (-1);
- if( strcmp(entry2->relname, ".")==0 ) return (1);
- if( strcmp(entry1->relname, "..")==0 ) return (-1);
- if( strcmp(entry2->relname, "..")==0 ) return (1);
+ if ( strcmp(entry1->relname, ".")==0 ) return (-1);
+ if ( strcmp(entry2->relname, ".")==0 ) return (1);
+ if ( strcmp(entry1->relname, "..")==0 ) return (-1);
+ if ( strcmp(entry2->relname, "..")==0 ) return (1);
return (BLI_natstrcmp(entry1->relname,entry2->relname));
}
@@ -186,24 +188,26 @@ static int compare_date(const void *a1, const void *a2)
/* type is equal to stat.st_mode */
- if (S_ISDIR(entry1->type)){
+ if (S_ISDIR(entry1->type)) {
if (S_ISDIR(entry2->type)==0) return (-1);
- } else{
+ }
+ else {
if (S_ISDIR(entry2->type)) return (1);
}
- if (S_ISREG(entry1->type)){
+ if (S_ISREG(entry1->type)) {
if (S_ISREG(entry2->type)==0) return (-1);
- } else{
+ }
+ else {
if (S_ISREG(entry2->type)) return (1);
}
if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1);
if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1);
/* make sure "." and ".." are always first */
- if( strcmp(entry1->relname, ".")==0 ) return (-1);
- if( strcmp(entry2->relname, ".")==0 ) return (1);
- if( strcmp(entry1->relname, "..")==0 ) return (-1);
- if( strcmp(entry2->relname, "..")==0 ) return (1);
+ if ( strcmp(entry1->relname, ".")==0 ) return (-1);
+ if ( strcmp(entry2->relname, ".")==0 ) return (1);
+ if ( strcmp(entry1->relname, "..")==0 ) return (-1);
+ if ( strcmp(entry2->relname, "..")==0 ) return (1);
if ( entry1->s.st_mtime < entry2->s.st_mtime) return 1;
if ( entry1->s.st_mtime > entry2->s.st_mtime) return -1;
@@ -217,24 +221,26 @@ static int compare_size(const void *a1, const void *a2)
/* type is equal to stat.st_mode */
- if (S_ISDIR(entry1->type)){
+ if (S_ISDIR(entry1->type)) {
if (S_ISDIR(entry2->type)==0) return (-1);
- } else{
+ }
+ else {
if (S_ISDIR(entry2->type)) return (1);
}
- if (S_ISREG(entry1->type)){
+ if (S_ISREG(entry1->type)) {
if (S_ISREG(entry2->type)==0) return (-1);
- } else{
+ }
+ else {
if (S_ISREG(entry2->type)) return (1);
}
if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1);
if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1);
/* make sure "." and ".." are always first */
- if( strcmp(entry1->relname, ".")==0 ) return (-1);
- if( strcmp(entry2->relname, ".")==0 ) return (1);
- if( strcmp(entry1->relname, "..")==0 ) return (-1);
- if( strcmp(entry2->relname, "..")==0 ) return (1);
+ if ( strcmp(entry1->relname, ".")==0 ) return (-1);
+ if ( strcmp(entry2->relname, ".")==0 ) return (1);
+ if ( strcmp(entry1->relname, "..")==0 ) return (-1);
+ if ( strcmp(entry2->relname, "..")==0 ) return (1);
if ( entry1->s.st_size < entry2->s.st_size) return 1;
if ( entry1->s.st_size > entry2->s.st_size) return -1;
@@ -256,24 +262,26 @@ static int compare_extension(const void *a1, const void *a2)
/* type is equal to stat.st_mode */
- if (S_ISDIR(entry1->type)){
+ if (S_ISDIR(entry1->type)) {
if (S_ISDIR(entry2->type)==0) return (-1);
- } else{
+ }
+ else {
if (S_ISDIR(entry2->type)) return (1);
}
- if (S_ISREG(entry1->type)){
+ if (S_ISREG(entry1->type)) {
if (S_ISREG(entry2->type)==0) return (-1);
- } else{
+ }
+ else {
if (S_ISREG(entry2->type)) return (1);
}
if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1);
if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1);
/* make sure "." and ".." are always first */
- if( strcmp(entry1->relname, ".")==0 ) return (-1);
- if( strcmp(entry2->relname, ".")==0 ) return (1);
- if( strcmp(entry1->relname, "..")==0 ) return (-1);
- if( strcmp(entry2->relname, "..")==0 ) return (1);
+ if ( strcmp(entry1->relname, ".")==0 ) return (-1);
+ if ( strcmp(entry2->relname, ".")==0 ) return (1);
+ if ( strcmp(entry1->relname, "..")==0 ) return (-1);
+ if ( strcmp(entry2->relname, "..")==0 ) return (1);
return (BLI_strcasecmp(sufix1, sufix2));
}
@@ -283,17 +291,20 @@ static int is_hidden_file(const char* filename, short hide_dot)
int is_hidden=0;
if (hide_dot) {
- if(filename[0]=='.' && filename[1]!='.' && filename[1]!=0) {
+ if (filename[0]=='.' && filename[1]!='.' && filename[1]!=0) {
is_hidden=1; /* ignore .file */
- } else if (((filename[0] == '.') && (filename[1] == 0) )) {
+ }
+ else if (((filename[0] == '.') && (filename[1] == 0) )) {
is_hidden=1; /* ignore . */
- } else {
+ }
+ else {
int len=strlen(filename);
- if( (len>0) && (filename[len-1]=='~') ) {
+ if ( (len>0) && (filename[len-1]=='~') ) {
is_hidden=1; /* ignore file~ */
}
}
- } else {
+ }
+ else {
if (((filename[0] == '.') && (filename[1] == 0) )) {
is_hidden=1; /* ignore . */
}
@@ -307,12 +318,14 @@ static int is_filtered_file(struct direntry* file, const char* UNUSED(dir), unsi
if (filter) {
if (file->flags & filter) {
is_filtered=1;
- } else if (file->type & S_IFDIR) {
+ }
+ else if (file->type & S_IFDIR) {
if (filter & FOLDERFILE) {
is_filtered = 1;
}
}
- } else {
+ }
+ else {
is_filtered = 1;
}
return is_filtered && !is_hidden_file(file->relname, hide_dot);
@@ -324,7 +337,8 @@ static int is_filtered_lib(struct direntry* file, const char* dir, unsigned int
char tdir[FILE_MAX], tgroup[GROUP_MAX];
if (BLO_is_a_library(dir, tdir, tgroup)) {
is_filtered = !is_hidden_file(file->relname, hide_dot);
- } else {
+ }
+ else {
is_filtered = is_filtered_file(file, dir, filter, hide_dot);
}
return is_filtered;
@@ -415,13 +429,13 @@ void folderlist_popdir(struct ListBase* folderlist, char *dir)
struct FolderList *folder;
folder = folderlist->last;
- if(folder){
+ if (folder) {
// remove the current directory
MEM_freeN(folder->foldername);
BLI_freelinkN(folderlist, folder);
folder = folderlist->last;
- if(folder){
+ if (folder) {
prev_dir = folder->foldername;
BLI_strncpy(dir, prev_dir, FILE_MAXDIR);
}
@@ -435,8 +449,8 @@ void folderlist_pushdir(ListBase* folderlist, const char *dir)
previous_folder = folderlist->last;
// check if already exists
- if(previous_folder && previous_folder->foldername){
- if(BLI_path_cmp(previous_folder->foldername, dir)==0){
+ if (previous_folder && previous_folder->foldername) {
+ if (BLI_path_cmp(previous_folder->foldername, dir)==0) {
return;
}
}
@@ -472,9 +486,9 @@ int folderlist_clear_next(struct SpaceFile *sfile)
/* not listbase itself */
void folderlist_free(ListBase* folderlist)
{
- if (folderlist){
+ if (folderlist) {
FolderList *folder;
- for(folder= folderlist->first; folder; folder= folder->next)
+ for (folder= folderlist->first; folder; folder= folder->next)
MEM_freeN(folder->foldername);
BLI_freelistN(folderlist);
}
@@ -489,7 +503,7 @@ ListBase *folderlist_duplicate(ListBase* folderlist)
BLI_duplicatelist(folderlistn, folderlist);
- for(folder= folderlistn->first; folder; folder= folder->next) {
+ for (folder= folderlistn->first; folder; folder= folder->next) {
folder->foldername= MEM_dupallocN(folder->foldername);
}
return folderlistn;
@@ -564,7 +578,7 @@ void filelist_free(struct FileList* filelist)
void filelist_freelib(struct FileList* filelist)
{
- if(filelist->libfiledata)
+ if (filelist->libfiledata)
BLO_blendhandle_close(filelist->libfiledata);
filelist->libfiledata= NULL;
}
@@ -626,28 +640,37 @@ struct ImBuf * filelist_geticon(struct FileList* filelist, int index)
if (file->type & S_IFDIR) {
if ( strcmp(filelist->filelist[fidx].relname, "..") == 0) {
ibuf = gSpecialFileImages[SPECIAL_IMG_PARENT];
- } else if ( strcmp(filelist->filelist[fidx].relname, ".") == 0) {
+ }
+ else if ( strcmp(filelist->filelist[fidx].relname, ".") == 0) {
ibuf = gSpecialFileImages[SPECIAL_IMG_REFRESH];
- } else {
+ }
+ else {
ibuf = gSpecialFileImages[SPECIAL_IMG_FOLDER];
}
- } else {
+ }
+ else {
ibuf = gSpecialFileImages[SPECIAL_IMG_UNKNOWNFILE];
}
if (file->flags & BLENDERFILE) {
ibuf = gSpecialFileImages[SPECIAL_IMG_BLENDFILE];
- } else if ( (file->flags & MOVIEFILE) || (file->flags & MOVIEFILE_ICON) ) {
+ }
+ else if ( (file->flags & MOVIEFILE) || (file->flags & MOVIEFILE_ICON) ) {
ibuf = gSpecialFileImages[SPECIAL_IMG_MOVIEFILE];
- } else if (file->flags & SOUNDFILE) {
+ }
+ else if (file->flags & SOUNDFILE) {
ibuf = gSpecialFileImages[SPECIAL_IMG_SOUNDFILE];
- } else if (file->flags & PYSCRIPTFILE) {
+ }
+ else if (file->flags & PYSCRIPTFILE) {
ibuf = gSpecialFileImages[SPECIAL_IMG_PYTHONFILE];
- } else if (file->flags & FTFONTFILE) {
+ }
+ else if (file->flags & FTFONTFILE) {
ibuf = gSpecialFileImages[SPECIAL_IMG_FONTFILE];
- } else if (file->flags & TEXTFILE) {
+ }
+ else if (file->flags & TEXTFILE) {
ibuf = gSpecialFileImages[SPECIAL_IMG_TEXTFILE];
- } else if (file->flags & IMAGEFILE) {
+ }
+ else if (file->flags & IMAGEFILE) {
ibuf = gSpecialFileImages[SPECIAL_IMG_LOADING];
}
@@ -677,7 +700,7 @@ int filelist_find(struct FileList* filelist, const char *filename)
for (i = 0; i < filelist->numfiles; ++i) {
- if ( strcmp(filelist->filelist[i].relname, filename) == 0) { /* not dealing with user input so dont need BLI_path_cmp */
+ if ( strcmp(filelist->filelist[i].relname, filename) == 0) { /* not dealing with user input so don't need BLI_path_cmp */
index = i;
break;
}
@@ -715,17 +738,17 @@ static int file_is_blend_backup(const char *str)
a= strlen(str);
b= 7;
- if(a==0 || b>=a);
+ if (a==0 || b>=a);
else {
char *loc;
- if(a > b+1)
+ if (a > b+1)
b++;
/* allow .blend1 .blend2 .blend32 */
loc= BLI_strcasestr(str+a-b, ".blend");
- if(loc)
+ if (loc)
retval= 1;
}
@@ -735,32 +758,41 @@ static int file_is_blend_backup(const char *str)
static int file_extension_type(const char *relname)
{
- if(BLO_has_bfile_extension(relname)) {
+ if (BLO_has_bfile_extension(relname)) {
return BLENDERFILE;
- } else if(file_is_blend_backup(relname)) {
+ }
+ else if (file_is_blend_backup(relname)) {
return BLENDERFILE_BACKUP;
- } else if(BLI_testextensie(relname, ".py")) {
+ }
+ else if (BLI_testextensie(relname, ".py")) {
return PYSCRIPTFILE;
- } else if(BLI_testextensie(relname, ".txt")
+ }
+ else if (BLI_testextensie(relname, ".txt")
|| BLI_testextensie(relname, ".glsl")
|| BLI_testextensie(relname, ".data")) {
return TEXTFILE;
- } else if( BLI_testextensie(relname, ".ttf")
+ }
+ else if ( BLI_testextensie(relname, ".ttf")
|| BLI_testextensie(relname, ".ttc")
|| BLI_testextensie(relname, ".pfb")
|| BLI_testextensie(relname, ".otf")
|| BLI_testextensie(relname, ".otc")) {
return FTFONTFILE;
- } else if(BLI_testextensie(relname, ".btx")) {
+ }
+ else if (BLI_testextensie(relname, ".btx")) {
return BTXFILE;
- } else if(BLI_testextensie(relname, ".dae")) {
+ }
+ else if (BLI_testextensie(relname, ".dae")) {
return COLLADAFILE;
- } else if(BLI_testextensie_array(relname, imb_ext_image)
+ }
+ else if (BLI_testextensie_array(relname, imb_ext_image)
|| (G.have_quicktime && BLI_testextensie_array(relname, imb_ext_image_qt))) {
return IMAGEFILE;
- } else if(BLI_testextensie_array(relname, imb_ext_movie)) {
+ }
+ else if (BLI_testextensie_array(relname, imb_ext_movie)) {
return MOVIEFILE;
- } else if(BLI_testextensie_array(relname, imb_ext_audio)) {
+ }
+ else if (BLI_testextensie_array(relname, imb_ext_audio)) {
return SOUNDFILE;
}
return 0;
@@ -797,7 +829,7 @@ static void filelist_setfiletypes(struct FileList* filelist)
file= filelist->filelist;
- for(num=0; num<filelist->numfiles; num++, file++) {
+ for (num=0; num<filelist->numfiles; num++, file++) {
file->type= file->s.st_mode; /* restore the mess below */
/* Don't check extensions for directories */
@@ -806,7 +838,7 @@ static void filelist_setfiletypes(struct FileList* filelist)
}
file->flags = file_extension_type(file->relname);
- if(filelist->filter_glob
+ if (filelist->filter_glob
&& BLI_testextensie_glob(file->relname, filelist->filter_glob)) {
file->flags= OPERATORFILE;
}
@@ -827,7 +859,7 @@ static void filelist_read_dir(struct FileList* filelist)
BLI_cleanup_dir(G.main->name, filelist->dir);
filelist->numfiles = BLI_dir_contents(filelist->dir, &(filelist->filelist));
- if(!chdir(wdir)) {} /* fix warning about not checking return value */
+ if (!chdir(wdir)) {} /* fix warning about not checking return value */
filelist_setfiletypes(filelist);
filelist_filter(filelist);
}
@@ -843,15 +875,15 @@ static void filelist_read_library(struct FileList* filelist)
if (!filelist) return;
BLI_cleanup_dir(G.main->name, filelist->dir);
filelist_from_library(filelist);
- if(!filelist->libfiledata) {
+ if (!filelist->libfiledata) {
int num;
struct direntry *file;
BLI_make_exist(filelist->dir);
filelist_read_dir(filelist);
file = filelist->filelist;
- for(num=0; num<filelist->numfiles; num++, file++) {
- if(BLO_has_bfile_extension(file->relname)) {
+ for (num=0; num<filelist->numfiles; num++, file++) {
+ if (BLO_has_bfile_extension(file->relname)) {
char name[FILE_MAX];
BLI_join_dirfile(name, sizeof(name), filelist->dir, file->relname);
@@ -994,7 +1026,7 @@ void filelist_from_library(struct FileList* filelist)
ok= filelist_islibrary(filelist, dir, group);
if (!ok) {
/* free */
- if(filelist->libfiledata) BLO_blendhandle_close(filelist->libfiledata);
+ if (filelist->libfiledata) BLO_blendhandle_close(filelist->libfiledata);
filelist->libfiledata= NULL;
return;
}
@@ -1005,13 +1037,13 @@ void filelist_from_library(struct FileList* filelist)
/* for the time being only read filedata when libfiledata==0 */
if (filelist->libfiledata == NULL) {
filelist->libfiledata= BLO_blendhandle_from_file(dir, NULL);
- if(filelist->libfiledata == NULL) return;
+ if (filelist->libfiledata == NULL) return;
}
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);
@@ -1019,7 +1051,8 @@ void filelist_from_library(struct FileList* filelist)
BLO_blendhandle_close(filelist->libfiledata);
filelist->libfiledata= BLO_blendhandle_from_file(dir, NULL);
- } else {
+ }
+ else {
previews= NULL;
nprevs= 0;
names= BLO_blendhandle_get_linkable_groups(filelist->libfiledata);
@@ -1039,15 +1072,16 @@ void filelist_from_library(struct FileList* filelist)
filelist->filelist[i + 1].relname= BLI_strdup(blockname);
if (idcode) {
filelist->filelist[i + 1].type |= S_IFREG;
- } else {
+ }
+ else {
filelist->filelist[i + 1].type |= S_IFDIR;
}
}
- if(previews && (nnames != nprevs)) {
+ if (previews && (nnames != nprevs)) {
printf("filelist_from_library: error, found %d items, %d previews\n", nnames, nprevs);
}
- else if(previews) {
+ else if (previews) {
for (i=0, l= previews; i<nnames; i++, l= l->next) {
PreviewImage *img= l->link;
@@ -1092,20 +1126,20 @@ void filelist_from_main(struct FileList *filelist)
// filelist->type = FILE_MAIN; // XXXXX TODO: add modes to filebrowser
- if(filelist->dir[0]=='/') filelist->dir[0]= 0;
+ if (filelist->dir[0]=='/') filelist->dir[0]= 0;
- if(filelist->dir[0]) {
+ if (filelist->dir[0]) {
idcode= groupname_to_code(filelist->dir);
- if(idcode==0) filelist->dir[0]= 0;
+ if (idcode==0) filelist->dir[0]= 0;
}
- if( filelist->dir[0]==0) {
+ if ( filelist->dir[0]==0) {
/* make directories */
filelist->numfiles= 24;
filelist->filelist= (struct direntry *)malloc(filelist->numfiles * sizeof(struct direntry));
- for(a=0; a<filelist->numfiles; a++) {
+ for (a=0; a<filelist->numfiles; a++) {
memset( &(filelist->filelist[a]), 0 , sizeof(struct direntry));
filelist->filelist[a].type |= S_IFDIR;
}
@@ -1141,11 +1175,11 @@ void filelist_from_main(struct FileList *filelist)
idcode= groupname_to_code(filelist->dir);
lb= which_libbase(G.main, idcode );
- if(lb == NULL) return;
+ if (lb == NULL) return;
id= lb->first;
filelist->numfiles= 0;
- while(id) {
+ while (id) {
if (!filelist->hide_dot || id->name[2] != '.') {
filelist->numfiles++;
}
@@ -1170,12 +1204,12 @@ void filelist_from_main(struct FileList *filelist)
id= lb->first;
totlib= totbl= 0;
- while(id) {
+ while (id) {
ok = 1;
- if(ok) {
+ if (ok) {
if (!filelist->hide_dot || id->name[2] != '.') {
memset( files, 0 , sizeof(struct direntry));
- if(id->lib==NULL)
+ if (id->lib==NULL)
files->relname= BLI_strdup(id->name+2);
else {
files->relname= MEM_mallocN(FILE_MAX+32, "filename for lib");
@@ -1183,28 +1217,28 @@ void filelist_from_main(struct FileList *filelist)
}
files->type |= S_IFREG;
#if 0 // XXXXX TODO show the selection status of the objects
- if(!filelist->has_func) { /* F4 DATA BROWSE */
- if(idcode==ID_OB) {
- if( ((Object *)id)->flag & SELECT) files->selflag |= SELECTED_FILE;
+ if (!filelist->has_func) { /* F4 DATA BROWSE */
+ if (idcode==ID_OB) {
+ if ( ((Object *)id)->flag & SELECT) files->selflag |= SELECTED_FILE;
}
- else if(idcode==ID_SCE) {
- if( ((Scene *)id)->r.scemode & R_BG_RENDER) files->selflag |= SELECTED_FILE;
+ else if (idcode==ID_SCE) {
+ if ( ((Scene *)id)->r.scemode & R_BG_RENDER) files->selflag |= SELECTED_FILE;
}
}
#endif
files->nr= totbl+1;
files->poin= id;
fake= id->flag & LIB_FAKEUSER;
- if(idcode == ID_MA || idcode == ID_TE || idcode == ID_LA || idcode == ID_WO || idcode == ID_IM) {
+ if (idcode == ID_MA || idcode == ID_TE || idcode == ID_LA || idcode == ID_WO || idcode == ID_IM) {
files->flags |= IMAGEFILE;
}
- if(id->lib && fake) BLI_snprintf(files->extra, sizeof(files->extra), "LF %d", id->us);
- else if(id->lib) BLI_snprintf(files->extra, sizeof(files->extra), "L %d", id->us);
- else if(fake) BLI_snprintf(files->extra, sizeof(files->extra), "F %d", id->us);
+ if (id->lib && fake) BLI_snprintf(files->extra, sizeof(files->extra), "LF %d", id->us);
+ else if (id->lib) BLI_snprintf(files->extra, sizeof(files->extra), "L %d", id->us);
+ else if (fake) BLI_snprintf(files->extra, sizeof(files->extra), "F %d", id->us);
else BLI_snprintf(files->extra, sizeof(files->extra), " %d", id->us);
- if(id->lib) {
- if(totlib==0) firstlib= files;
+ if (id->lib) {
+ if (totlib==0) firstlib= files;
totlib++;
}
@@ -1217,7 +1251,7 @@ void filelist_from_main(struct FileList *filelist)
}
/* only qsort of library blocks */
- if(totlib>1) {
+ if (totlib>1) {
qsort(firstlib, totlib, sizeof(struct direntry), compare_name);
}
}
@@ -1230,7 +1264,7 @@ static void thumbnail_joblist_free(ThumbnailJob *tj)
FileImage* limg = tj->loadimages.first;
/* free the images not yet copied to the filelist -> these will get freed with the filelist */
- for( ; limg; limg= limg->next) {
+ for ( ; limg; limg= limg->next) {
if ((limg->img) && (!limg->done)) {
IMB_freeImBuf(limg->img);
}
@@ -1249,9 +1283,11 @@ static void thumbnails_startjob(void *tjv, short *stop, short *do_update, float
while ( (*stop==0) && (limg) ) {
if ( limg->flags & IMAGEFILE ) {
limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_IMAGE);
- } else if ( limg->flags & BLENDERFILE ) {
+ }
+ else if ( limg->flags & BLENDERFILE ) {
limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_BLEND);
- } else if ( limg->flags & MOVIEFILE ) {
+ }
+ else if ( limg->flags & MOVIEFILE ) {
limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_MOVIE);
if (!limg->img) {
/* remember that file can't be loaded via IMB_open_anim */
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 44eadc9dee8..3ed3c0690a2 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -125,7 +125,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
BLI_strncpy(params->title, op->type->name, sizeof(params->title));
- if(RNA_struct_find_property(op->ptr, "filemode"))
+ if (RNA_struct_find_property(op->ptr, "filemode"))
params->type = RNA_int_get(op->ptr, "filemode");
else
params->type = FILE_SPECIAL;
@@ -152,12 +152,12 @@ short ED_fileselect_set_params(SpaceFile *sfile)
}
}
- if(params->dir[0]) {
+ if (params->dir[0]) {
BLI_cleanup_dir(G.main->name, params->dir);
BLI_path_abs(params->dir, G.main->name);
}
- if(is_directory==TRUE && is_filename==FALSE && is_filepath==FALSE && is_files==FALSE) {
+ if (is_directory==TRUE && is_filename==FALSE && is_filepath==FALSE && is_files==FALSE) {
params->flag |= FILE_DIRSEL_ONLY;
}
else {
@@ -165,27 +165,27 @@ short ED_fileselect_set_params(SpaceFile *sfile)
}
params->filter = 0;
- if(RNA_struct_find_property(op->ptr, "filter_blender"))
+ if (RNA_struct_find_property(op->ptr, "filter_blender"))
params->filter |= RNA_boolean_get(op->ptr, "filter_blender") ? BLENDERFILE : 0;
- if(RNA_struct_find_property(op->ptr, "filter_image"))
+ if (RNA_struct_find_property(op->ptr, "filter_image"))
params->filter |= RNA_boolean_get(op->ptr, "filter_image") ? IMAGEFILE : 0;
- if(RNA_struct_find_property(op->ptr, "filter_movie"))
+ if (RNA_struct_find_property(op->ptr, "filter_movie"))
params->filter |= RNA_boolean_get(op->ptr, "filter_movie") ? MOVIEFILE : 0;
- if(RNA_struct_find_property(op->ptr, "filter_text"))
+ if (RNA_struct_find_property(op->ptr, "filter_text"))
params->filter |= RNA_boolean_get(op->ptr, "filter_text") ? TEXTFILE : 0;
- if(RNA_struct_find_property(op->ptr, "filter_python"))
+ if (RNA_struct_find_property(op->ptr, "filter_python"))
params->filter |= RNA_boolean_get(op->ptr, "filter_python") ? PYSCRIPTFILE : 0;
- if(RNA_struct_find_property(op->ptr, "filter_font"))
+ if (RNA_struct_find_property(op->ptr, "filter_font"))
params->filter |= RNA_boolean_get(op->ptr, "filter_font") ? FTFONTFILE : 0;
- if(RNA_struct_find_property(op->ptr, "filter_sound"))
+ if (RNA_struct_find_property(op->ptr, "filter_sound"))
params->filter |= RNA_boolean_get(op->ptr, "filter_sound") ? SOUNDFILE : 0;
- if(RNA_struct_find_property(op->ptr, "filter_text"))
+ if (RNA_struct_find_property(op->ptr, "filter_text"))
params->filter |= RNA_boolean_get(op->ptr, "filter_text") ? TEXTFILE : 0;
- if(RNA_struct_find_property(op->ptr, "filter_folder"))
+ if (RNA_struct_find_property(op->ptr, "filter_folder"))
params->filter |= RNA_boolean_get(op->ptr, "filter_folder") ? FOLDERFILE : 0;
- if(RNA_struct_find_property(op->ptr, "filter_btx"))
+ if (RNA_struct_find_property(op->ptr, "filter_btx"))
params->filter |= RNA_boolean_get(op->ptr, "filter_btx") ? BTXFILE : 0;
- if(RNA_struct_find_property(op->ptr, "filter_collada"))
+ if (RNA_struct_find_property(op->ptr, "filter_collada"))
params->filter |= RNA_boolean_get(op->ptr, "filter_collada") ? COLLADAFILE : 0;
if (RNA_struct_find_property(op->ptr, "filter_glob")) {
RNA_string_get(op->ptr, "filter_glob", params->filter_glob);
@@ -198,14 +198,16 @@ short ED_fileselect_set_params(SpaceFile *sfile)
if (params->filter != 0) {
if (U.uiflag & USER_FILTERFILEEXTS) {
params->flag |= FILE_FILTER;
- } else {
+ }
+ else {
params->flag &= ~FILE_FILTER;
}
}
if (U.uiflag & USER_HIDE_DOT) {
params->flag |= FILE_HIDE_DOT;
- } else {
+ }
+ else {
params->flag &= ~FILE_HIDE_DOT;
}
@@ -216,16 +218,17 @@ short ED_fileselect_set_params(SpaceFile *sfile)
params->flag |= RNA_boolean_get(op->ptr, "active_layer") ? FILE_ACTIVELAY : 0;
}
- if(RNA_struct_find_property(op->ptr, "display_type"))
+ if (RNA_struct_find_property(op->ptr, "display_type"))
params->display= RNA_enum_get(op->ptr, "display_type");
- if(params->display==FILE_DEFAULTDISPLAY) {
+ if (params->display==FILE_DEFAULTDISPLAY) {
if (U.uiflag & USER_SHOW_THUMBNAILS) {
- if(params->filter & (IMAGEFILE|MOVIEFILE))
+ if (params->filter & (IMAGEFILE|MOVIEFILE))
params->display= FILE_IMGDISPLAY;
else
params->display= FILE_SHORTDISPLAY;
- } else {
+ }
+ else {
params->display= FILE_SHORTDISPLAY;
}
}
@@ -276,7 +279,8 @@ int ED_fileselect_layout_numfiles(FileLayout* layout, struct ARegion *ar)
int width = (int)(ar->v2d.cur.xmax - ar->v2d.cur.xmin - 2*layout->tile_border_x);
numfiles = (int)((float)width / (float)layout->tile_w + 0.5f);
return numfiles*layout->rows;
- } else {
+ }
+ else {
int height = (int)(ar->v2d.cur.ymax - ar->v2d.cur.ymin - 2*layout->tile_border_y);
numfiles = (int)((float)height/(float)layout->tile_h + 0.5f);
return numfiles*layout->columns;
@@ -312,7 +316,8 @@ FileSelection ED_fileselect_layout_offset_rect(FileLayout* layout, const rcti* r
if ( (colmin > layout->columns-1) || (rowmin > layout->rows-1) ) {
sel.first = -1;
- } else {
+ }
+ else {
if (layout->flag & FILE_LAYOUT_HOR)
sel.first = layout->rows*colmin + rowmin;
else
@@ -320,7 +325,8 @@ FileSelection ED_fileselect_layout_offset_rect(FileLayout* layout, const rcti* r
}
if ( (colmax > layout->columns-1) || (rowmax > layout->rows-1) ) {
sel.last = -1;
- } else {
+ }
+ else {
if (layout->flag & FILE_LAYOUT_HOR)
sel.last = layout->rows*colmax + rowmax;
else
@@ -356,15 +362,16 @@ void ED_fileselect_layout_tilepos(FileLayout* layout, int tile, int *x, int *y)
if (layout->flag == FILE_LAYOUT_HOR) {
*x = layout->tile_border_x + (tile/layout->rows)*(layout->tile_w+2*layout->tile_border_x);
*y = layout->tile_border_y + (tile%layout->rows)*(layout->tile_h+2*layout->tile_border_y);
- } else {
+ }
+ else {
*x = layout->tile_border_x + ((tile)%layout->columns)*(layout->tile_w+2*layout->tile_border_x);
*y = layout->tile_border_y + ((tile)/layout->columns)*(layout->tile_h+2*layout->tile_border_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];
@@ -393,7 +400,8 @@ float file_shorten_string(char* string, float w, int front)
temp[slen+4] = '\0';
BLI_strncpy(string, temp, slen+4);
}
- } else {
+ }
+ else {
char *s = string;
while (sw>w) {
int slen = strlen(string);
@@ -482,7 +490,8 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar)
if (sfile->layout == NULL) {
sfile->layout = MEM_callocN(sizeof(struct FileLayout), "file_layout");
sfile->layout->dirty = TRUE;
- } else if (sfile->layout->dirty == FALSE) {
+ }
+ else if (sfile->layout->dirty == FALSE) {
return;
}
@@ -502,7 +511,7 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar)
layout->tile_h = layout->prv_h + 2*layout->prv_border_y + textheight;
layout->width= (int)(v2d->cur.xmax - v2d->cur.xmin - 2*layout->tile_border_x);
layout->columns= layout->width / (layout->tile_w + 2*layout->tile_border_x);
- if(layout->columns > 0)
+ if (layout->columns > 0)
layout->rows= numfiles/layout->columns + 1; // XXX dirty, modulo is zero
else {
layout->columns = 1;
@@ -510,7 +519,8 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar)
}
layout->height= sfile->layout->rows*(layout->tile_h+2*layout->tile_border_y) + layout->tile_border_y*2;
layout->flag = FILE_LAYOUT_VER;
- } else {
+ }
+ else {
layout->prv_w = 0;
layout->prv_h = 0;
layout->tile_border_x = 8;
@@ -527,7 +537,8 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar)
maxlen = ICON_DEFAULT_WIDTH_SCALE + 4 +
(int)layout->column_widths[COLUMN_NAME] + 12 +
(int)layout->column_widths[COLUMN_SIZE] + 12;
- } else {
+ }
+ else {
maxlen = ICON_DEFAULT_WIDTH_SCALE + 4 +
(int)layout->column_widths[COLUMN_NAME] + 12 +
#ifndef WIN32
@@ -542,7 +553,7 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar)
}
layout->tile_w = maxlen;
- if(layout->rows > 0)
+ if (layout->rows > 0)
layout->columns = numfiles/layout->rows + 1; // XXX dirty, modulo is zero
else {
layout->rows = 1;
@@ -570,13 +581,13 @@ void file_change_dir(bContext *C, int checkdir)
ED_fileselect_clear(C, sfile);
- if(checkdir && BLI_is_dir(sfile->params->dir)==0) {
+ if (checkdir && BLI_is_dir(sfile->params->dir)==0) {
BLI_strncpy(sfile->params->dir, filelist_dir(sfile->files), sizeof(sfile->params->dir));
/* could return but just refresh the current dir */
}
filelist_setdir(sfile->files, sfile->params->dir);
- if(folderlist_clear_next(sfile))
+ if (folderlist_clear_next(sfile))
folderlist_free(sfile->folders_next);
folderlist_pushdir(sfile->folders_prev, sfile->params->dir);
@@ -608,7 +619,7 @@ void autocomplete_directory(struct bContext *C, char *str, void *UNUSED(arg_v))
SpaceFile *sfile= CTX_wm_space_file(C);
/* search if str matches the beginning of name */
- if(str[0] && sfile->files) {
+ if (str[0] && sfile->files) {
char dirname[FILE_MAX];
DIR *dir;
@@ -618,7 +629,7 @@ void autocomplete_directory(struct bContext *C, char *str, void *UNUSED(arg_v))
dir = opendir(dirname);
- if(dir) {
+ if (dir) {
AutoComplete *autocpl= autocomplete_begin(str, FILE_MAX);
while ((de = readdir(dir)) != NULL) {
@@ -643,7 +654,8 @@ void autocomplete_directory(struct bContext *C, char *str, void *UNUSED(arg_v))
autocomplete_end(autocpl, str);
if (BLI_exists(str)) {
BLI_add_slash(str);
- } else {
+ }
+ else {
BLI_strncpy(sfile->params->dir, str, sizeof(sfile->params->dir));
}
}
@@ -655,12 +667,12 @@ void autocomplete_file(struct bContext *C, char *str, void *UNUSED(arg_v))
SpaceFile *sfile= CTX_wm_space_file(C);
/* search if str matches the beginning of name */
- if(str[0] && sfile->files) {
+ if (str[0] && sfile->files) {
AutoComplete *autocpl= autocomplete_begin(str, FILE_MAX);
int nentries = filelist_numfiles(sfile->files);
int i;
- for(i= 0; i<nentries; ++i) {
+ for (i= 0; i<nentries; ++i) {
struct direntry* file = filelist_file(sfile->files, i);
if (file && S_ISREG(file->type)) {
autocomplete_do_name(autocpl, file->relname);
@@ -685,8 +697,8 @@ void ED_fileselect_clear(struct bContext *C, struct SpaceFile *sfile)
void ED_fileselect_exit(struct bContext *C, struct SpaceFile *sfile)
{
- if(!sfile) return;
- if(sfile->op) {
+ if (!sfile) return;
+ if (sfile->op) {
WM_event_fileselect_event(C, sfile->op, EVT_FILESELECT_EXTERNAL_CANCEL);
sfile->op = NULL;
}
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index ea894750605..ddd4b31d145 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -177,7 +177,8 @@ void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, const c
else if (sorted && cmp_ret < 0) {
break;
}
- } else {
+ }
+ else {
// if we're bookmarking this, file should come
// before the last separator, only automatically added
// current dir go after the last sep.
@@ -194,7 +195,8 @@ void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, const c
if (prev) {
fsme->next= prev->next;
prev->next= fsme;
- } else {
+ }
+ else {
fsme->next= fsms;
fsmenu_set_category(fsmenu, category, fsme);
}
@@ -210,14 +212,15 @@ 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 */
if (prev) {
prev->next= fsme->next;
- } else {
+ }
+ else {
fsms= fsme->next;
fsmenu_set_category(fsmenu, category, fsms);
}
@@ -233,7 +236,7 @@ void fsmenu_write_file(struct FSMenu* fsmenu, const char *filename)
FSMenuEntry *fsme= NULL;
int nskip= 0;
- FILE *fp = fopen(filename, "w");
+ FILE *fp = BLI_fopen(filename, "w");
if (!fp) return;
fprintf(fp, "[Bookmarks]\n");
@@ -262,16 +265,18 @@ void fsmenu_read_bookmarks(struct FSMenu* fsmenu, const char *filename)
FSMenuCategory category = FS_CATEGORY_BOOKMARKS;
FILE *fp;
- fp = fopen(filename, "r");
+ fp = BLI_fopen(filename, "r");
if (!fp) return;
while ( fgets ( line, 256, fp ) != NULL ) /* read a line */
{
- if (strncmp(line, "[Bookmarks]", 11)==0){
+ if (strncmp(line, "[Bookmarks]", 11)==0) {
category = FS_CATEGORY_BOOKMARKS;
- } else if (strncmp(line, "[Recent]", 8)==0){
+ }
+ else if (strncmp(line, "[Recent]", 8)==0) {
category = FS_CATEGORY_RECENT;
- } else {
+ }
+ else {
int len = strlen(line);
if (len>0) {
if (line[len-1] == '\n') {
@@ -334,17 +339,17 @@ 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) {
+ if (home) {
BLI_snprintf(line, 256, "%s/", home);
fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0);
BLI_snprintf(line, 256, "%s/Desktop/", home);
@@ -465,7 +470,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
{
const char *home= getenv("HOME");
- if(home) {
+ if (home) {
BLI_snprintf(line, FILE_MAXDIR, "%s/", home);
fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0);
BLI_snprintf(line, FILE_MAXDIR, "%s/Desktop/", home);
@@ -489,11 +494,11 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
else {
while ((mnt = getmntent (fp))) {
/* not sure if this is right, but seems to give the relevant mnts */
- if(strncmp(mnt->mnt_fsname, "/dev", 4))
+ if (strncmp(mnt->mnt_fsname, "/dev", 4))
continue;
len= strlen(mnt->mnt_dir);
- if(len && mnt->mnt_dir[len-1] != '/') {
+ if (len && mnt->mnt_dir[len-1] != '/') {
BLI_snprintf(line, FILE_MAXDIR, "%s/", mnt->mnt_dir);
fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, line, 1, 0);
}
@@ -509,7 +514,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
#endif
/* fallback */
- if(!found)
+ if (!found)
fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, "/", 1, 0);
}
}
diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h
index 0d046fd985d..c926a4f382c 100644
--- a/source/blender/editors/space_file/fsmenu.h
+++ b/source/blender/editors/space_file/fsmenu.h
@@ -50,21 +50,21 @@ struct FSMenu* fsmenu_get (void);
/** Returns the number of entries in the Fileselect Menu */
int fsmenu_get_nentries (struct FSMenu* fsmenu, FSMenuCategory category);
- /** Returns the fsmenu entry at @a index (or NULL if a bad index)
+ /** Returns the fsmenu entry at \a index (or NULL if a bad index)
* or a separator.
*/
char* fsmenu_get_entry (struct FSMenu* fsmenu, FSMenuCategory category, int index);
- /** Inserts a new fsmenu entry with the given @a path.
+ /** Inserts a new fsmenu entry with the given \a path.
* Duplicate entries are not added.
- * @param sorted Should entry be inserted in sorted order?
+ * \param sorted Should entry be inserted in sorted order?
*/
void fsmenu_insert_entry (struct FSMenu* fsmenu, FSMenuCategory category, const char *path, int sorted, short save);
/** Return whether the entry was created by the user and can be saved and deleted */
short fsmenu_can_save (struct FSMenu* fsmenu, FSMenuCategory category, int index);
- /** Removes the fsmenu entry at the given @a index. */
+ /** Removes the fsmenu entry at the given \a index. */
void fsmenu_remove_entry (struct FSMenu* fsmenu, FSMenuCategory category, int index);
/** saves the 'bookmarks' to the specified file */
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 02c9728348e..0cf15c22efa 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -113,7 +113,7 @@ static void file_free(SpaceLink *sl)
{
SpaceFile *sfile= (SpaceFile *) sl;
- if(sfile->files) {
+ if (sfile->files) {
// XXXXX would need to do thumbnails_stop here, but no context available
filelist_freelib(sfile->files);
filelist_free(sfile->files);
@@ -121,13 +121,13 @@ static void file_free(SpaceLink *sl)
sfile->files= NULL;
}
- if(sfile->folders_prev) {
+ if (sfile->folders_prev) {
folderlist_free(sfile->folders_prev);
MEM_freeN(sfile->folders_prev);
sfile->folders_prev= NULL;
}
- if(sfile->folders_next) {
+ if (sfile->folders_next) {
folderlist_free(sfile->folders_next);
MEM_freeN(sfile->folders_next);
sfile->folders_next= NULL;
@@ -151,7 +151,7 @@ static void file_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa)
SpaceFile *sfile= (SpaceFile*)sa->spacedata.first;
//printf("file_init\n");
- if(sfile->layout) sfile->layout->dirty= TRUE;
+ if (sfile->layout) sfile->layout->dirty= TRUE;
}
@@ -169,10 +169,10 @@ static SpaceLink *file_duplicate(SpaceLink *sl)
filelist_setdir(sfilen->files, sfilen->params->dir);
}
- if(sfileo->folders_prev)
+ if (sfileo->folders_prev)
sfilen->folders_prev = folderlist_duplicate(sfileo->folders_prev);
- if(sfileo->folders_next)
+ if (sfileo->folders_next)
sfilen->folders_next = folderlist_duplicate(sfileo->folders_next);
if (sfileo->layout) {
@@ -196,32 +196,35 @@ 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) {
+ if (params->sort!=FILE_SORT_NONE) {
filelist_sort(sfile->files, params->sort);
}
BLI_strncpy(params->dir, filelist_dir(sfile->files), FILE_MAX);
- if(params->display == FILE_IMGDISPLAY) {
+ if (params->display == FILE_IMGDISPLAY) {
thumbnails_start(sfile->files, C);
}
- } else {
- if(params->sort!=FILE_SORT_NONE) {
+ }
+ else {
+ if (params->sort!=FILE_SORT_NONE) {
thumbnails_stop(sfile->files, C);
filelist_sort(sfile->files, params->sort);
- if(params->display == FILE_IMGDISPLAY) {
+ if (params->display == FILE_IMGDISPLAY) {
thumbnails_start(sfile->files, C);
}
- } else {
- if(params->display == FILE_IMGDISPLAY) {
+ }
+ else {
+ if (params->display == FILE_IMGDISPLAY) {
if (!thumbnails_running(sfile->files,C)) {
thumbnails_start(sfile->files, C);
}
- } else {
+ }
+ 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);
@@ -272,10 +275,10 @@ static void file_main_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
/* own keymaps */
- keymap= WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap= WM_keymap_find(wm->defaultconf, "File Browser Main", SPACE_FILE, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "File Browser Main", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
@@ -333,9 +336,9 @@ static void file_main_area_draw(const bContext *C, ARegion *ar)
/* XXX this happens on scaling down Screen (like from startup.blend) */
/* view2d has no type specific for filewindow case, which doesnt scroll vertically */
- if(v2d->cur.ymax < 0) {
+ if (v2d->cur.ymax < 0) {
v2d->cur.ymin -= v2d->cur.ymax;
- v2d->cur.ymax= 0;
+ v2d->cur.ymax = 0;
}
}
/* v2d has initialized flag, so this call will only set the mask correct */
@@ -395,7 +398,7 @@ static void file_keymap(struct wmKeyConfig *keyconf)
{
wmKeyMapItem *kmi;
/* keys for all areas */
- wmKeyMap *keymap= WM_keymap_find(keyconf, "File Browser", SPACE_FILE, 0);
+ wmKeyMap *keymap = WM_keymap_find(keyconf, "File Browser", SPACE_FILE, 0);
WM_keymap_add_item(keymap, "FILE_OT_bookmark_toggle", NKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "FILE_OT_parent", PKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "FILE_OT_bookmark_add", BKEY, KM_PRESS, KM_CTRL, 0);
@@ -408,8 +411,8 @@ static void file_keymap(struct wmKeyConfig *keyconf)
WM_keymap_verify_item(keymap, "FILE_OT_smoothscroll", TIMER1, KM_ANY, KM_ANY, 0);
/* keys for main area */
- keymap= WM_keymap_find(keyconf, "File Browser Main", SPACE_FILE, 0);
- kmi= WM_keymap_add_item(keymap, "FILE_OT_execute", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
+ keymap = WM_keymap_find(keyconf, "File Browser Main", SPACE_FILE, 0);
+ kmi = WM_keymap_add_item(keymap, "FILE_OT_execute", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
RNA_boolean_set(kmi->ptr, "need_active", TRUE);
WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, 0, 0);
kmi = WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, KM_SHIFT, 0);
@@ -438,7 +441,7 @@ static void file_keymap(struct wmKeyConfig *keyconf)
/* keys for button area (top) */
- keymap= WM_keymap_find(keyconf, "File Browser Buttons", SPACE_FILE, 0);
+ keymap = WM_keymap_find(keyconf, "File Browser Buttons", SPACE_FILE, 0);
kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0);
RNA_int_set(kmi->ptr, "increment", 1);
kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_SHIFT, 0);
@@ -461,7 +464,7 @@ static void file_channel_area_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
/* own keymaps */
- keymap= WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -485,7 +488,7 @@ static void file_header_area_init(wmWindowManager *wm, ARegion *ar)
ED_region_header_init(ar);
- keymap= WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -502,10 +505,10 @@ static void file_ui_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap= WM_keymap_find(wm->defaultconf, "File Browser Buttons", SPACE_FILE, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "File Browser Buttons", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -518,8 +521,8 @@ static void file_ui_area_draw(const bContext *C, ARegion *ar)
glClear(GL_COLOR_BUFFER_BIT);
/* scrolling here is just annoying, disable it */
- ar->v2d.cur.ymax= ar->v2d.cur.ymax - ar->v2d.cur.ymin;
- ar->v2d.cur.ymin= 0;
+ ar->v2d.cur.ymax = ar->v2d.cur.ymax - ar->v2d.cur.ymin;
+ ar->v2d.cur.ymin = 0;
/* set view2d view matrix for scrolling (without scrollers) */
UI_view2d_view_ortho(&ar->v2d);
diff --git a/source/blender/editors/space_graph/CMakeLists.txt b/source/blender/editors/space_graph/CMakeLists.txt
index 50ab985d1e0..5b39604809c 100644
--- a/source/blender/editors/space_graph/CMakeLists.txt
+++ b/source/blender/editors/space_graph/CMakeLists.txt
@@ -53,4 +53,8 @@ if(WITH_AUDASPACE)
add_definitions(-DWITH_AUDASPACE)
endif()
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_editor_space_graph "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/space_graph/SConscript b/source/blender/editors/space_graph/SConscript
index fe8846d2c30..83239a5480a 100644
--- a/source/blender/editors/space_graph/SConscript
+++ b/source/blender/editors/space_graph/SConscript
@@ -7,4 +7,9 @@ incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' #/intern/audaspace/intern ../../blenloader'
-env.BlenderLib ( 'bf_editors_space_graph', sources, Split(incs), [], libtype=['core'], priority=[50] )
+defs = []
+
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
+env.BlenderLib ( 'bf_editors_space_graph', sources, Split(incs), defs, libtype=['core'], priority=[50] )
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index e2ea6849a72..4d2fe2cd568 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -108,12 +108,12 @@ static int graph_panel_context(const bContext *C, bAnimListElem **ale, FCurve **
/* try to find 'active' F-Curve */
elem= get_active_fcurve_channel(&ac);
- if(elem == NULL)
+ if (elem == NULL)
return 0;
- if(fcu)
+ if (fcu)
*fcu= (FCurve*)elem->data;
- if(ale)
+ if (ale)
*ale= elem;
else
MEM_freeN(elem);
@@ -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);
@@ -445,7 +452,7 @@ static int graph_panel_drivers_poll(const bContext *C, PanelType *UNUSED(pt))
{
SpaceIpo *sipo= CTX_wm_space_graph(C);
- if(sipo->mode != SIPO_MODE_DRIVERS)
+ if (sipo->mode != SIPO_MODE_DRIVERS)
return 0;
return graph_panel_context(C, NULL, NULL);
@@ -458,12 +465,12 @@ static void graph_panel_driverVar__singleProp(uiLayout *layout, ID *id, DriverVa
PointerRNA dtar_ptr;
uiLayout *row, *col;
- /* initialise RNA pointer to the target */
+ /* initialize RNA pointer to the target */
RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr);
/* Target ID */
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"));
}
}
@@ -489,13 +496,13 @@ static void graph_panel_driverVar__rotDiff(uiLayout *layout, ID *id, DriverVar *
PointerRNA dtar_ptr, dtar2_ptr;
uiLayout *col;
- /* initialise RNA pointer to the target */
+ /* initialize RNA pointer to the target */
RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr);
RNA_pointer_create(id, &RNA_DriverTarget, dtar2, &dtar2_ptr);
/* 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;
@@ -525,13 +532,13 @@ static void graph_panel_driverVar__locDiff(uiLayout *layout, ID *id, DriverVar *
PointerRNA dtar_ptr, dtar2_ptr;
uiLayout *col;
- /* initialise RNA pointer to the target */
+ /* initialize RNA pointer to the target */
RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr);
RNA_pointer_create(id, &RNA_DriverTarget, dtar2, &dtar2_ptr);
/* 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;
@@ -563,12 +570,12 @@ static void graph_panel_driverVar__transChan(uiLayout *layout, ID *id, DriverVar
PointerRNA dtar_ptr;
uiLayout *col, *sub;
- /* initialise RNA pointer to the target */
+ /* initialize RNA pointer to the target */
RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr);
/* properties */
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);
@@ -820,7 +831,7 @@ static int graph_properties(bContext *C, wmOperator *UNUSED(op))
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= graph_has_buttons_region(sa);
- if(ar)
+ if (ar)
ED_region_toggle_hidden(C, ar);
return OPERATOR_FINISHED;
@@ -828,13 +839,13 @@ static int graph_properties(bContext *C, wmOperator *UNUSED(op))
void GRAPH_OT_properties(wmOperatorType *ot)
{
- ot->name= "Properties";
- ot->idname= "GRAPH_OT_properties";
- ot->description= "Toggle display properties panel";
+ ot->name = "Properties";
+ ot->idname = "GRAPH_OT_properties";
+ ot->description = "Toggle display properties panel";
- ot->exec= graph_properties;
- ot->poll= ED_operator_graphedit_active;
+ ot->exec = graph_properties;
+ ot->poll = ED_operator_graphedit_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index 7bdb37d9651..fc84cfc46a2 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -48,6 +48,7 @@
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_windowmanager_types.h"
+#include "DNA_userdef_types.h"
#include "BKE_context.h"
#include "BKE_curve.h"
@@ -72,18 +73,10 @@
* drawing components for some F-Curve (fcu)
* - selected F-Curves should be more visible than partially visible ones
*/
-#define drawFCurveFade(fcu) ( ((fcu)->flag & FCURVE_SELECTED)? 1.0f : 0.25f )
-
-/* set the color for some point from some value given packed into an int
- * - intV: integer value containing color info packed into an int
- * - alpha: float value describing the
- */
-#define cpackA(intVC, alpha) \
- { \
- float _cpackCol[3]; \
- cpack_to_rgb(intVC, &_cpackCol[0], &_cpackCol[1], &_cpackCol[2]); \
- glColor4f(_cpackCol[0], _cpackCol[1], _cpackCol[2], alpha); \
- }
+static float fcurve_display_alpha(FCurve *fcu)
+{
+ return (fcu->flag & FCURVE_SELECTED) ? 1.0f : U.fcu_inactive_alpha;
+}
/* *************************** */
/* F-Curve Modifier Drawing */
@@ -125,7 +118,7 @@ static void draw_fcurve_modifier_controls_envelope (FModifier *fcm, View2D *v2d)
/* only draw if visible
* - min/max here are fixed, not relative
*/
- if IN_RANGE(fed->time, (v2d->cur.xmin - fac), (v2d->cur.xmax + fac)) {
+ if (IN_RANGE(fed->time, (v2d->cur.xmin - fac), (v2d->cur.xmax + fac))) {
glVertex2f(fed->time, fed->min);
glVertex2f(fed->time, fed->max);
}
@@ -153,10 +146,10 @@ static void draw_fcurve_vertices_keyframes (FCurve *fcu, SpaceIpo *UNUSED(sipo),
bglBegin(GL_POINTS);
for (i = 0; i < fcu->totvert; i++, bezt++) {
- /* as an optimisation step, only draw those in view
+ /* as an optimization step, only draw those in view
* - we apply a correction factor to ensure that points don't pop in/out due to slight twitches of view size
*/
- if IN_RANGE(bezt->vec[1][0], (v2d->cur.xmin - fac), (v2d->cur.xmax + fac)) {
+ if (IN_RANGE(bezt->vec[1][0], (v2d->cur.xmin - fac), (v2d->cur.xmax + fac))) {
if (edit) {
/* 'Keyframe' vertex only, as handle lines and handles have already been drawn
* - only draw those with correct selection state for the current drawing color
@@ -185,7 +178,7 @@ static void draw_fcurve_handle_control (float x, float y, float xscale, float ys
{
static GLuint displist=0;
- /* initialise round circle shape */
+ /* initialize round circle shape */
if (displist == 0) {
GLUquadricObj *qobj;
@@ -262,7 +255,7 @@ static void draw_fcurve_vertices_handles (FCurve *fcu, SpaceIpo *sipo, View2D *v
static void set_fcurve_vertex_color (FCurve *fcu, short sel)
{
/* Fade the 'intensity' of the vertices based on the selection of the curves too */
- int alphaOffset= (int)((drawFCurveFade(fcu) - 1.0f) * 255);
+ int alphaOffset= (int)((fcurve_display_alpha(fcu) - 1.0f) * 255);
/* Set color of curve vertex based on state of curve (i.e. 'Edit' Mode) */
if ((fcu->flag & FCURVE_PROTECTED)==0) {
@@ -292,8 +285,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 +319,7 @@ static int draw_fcurve_handles_check(SpaceIpo *sipo, FCurve *fcu)
{
return 0;
}
- else
- {
+ else {
return 1;
}
}
@@ -368,20 +359,18 @@ 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;
+ col[3]= fcurve_display_alpha(fcu) * 255;
glColor4ubv((GLubyte *)col);
glVertex2fv(fp); glVertex2fv(fp+3);
}
/* 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;
+ col[3]= fcurve_display_alpha(fcu) * 255;
glColor4ubv((GLubyte *)col);
glVertex2fv(fp+3); glVertex2fv(fp+6);
@@ -394,7 +383,7 @@ static void draw_fcurve_handles (SpaceIpo *sipo, FCurve *fcu)
{
fp= bezt->vec[0];
UI_GetThemeColor3ubv(basecol + bezt->h1, col);
- col[3]= drawFCurveFade(fcu) * 255;
+ col[3]= fcurve_display_alpha(fcu) * 255;
glColor4ubv((GLubyte *)col);
glVertex2fv(fp); glVertex2fv(fp+3);
@@ -406,7 +395,7 @@ static void draw_fcurve_handles (SpaceIpo *sipo, FCurve *fcu)
{
fp= bezt->vec[1];
UI_GetThemeColor3ubv(basecol + bezt->h2, col);
- col[3]= drawFCurveFade(fcu) * 255;
+ col[3]= fcurve_display_alpha(fcu) * 255;
glColor4ubv((GLubyte *)col);
glVertex2fv(fp); glVertex2fv(fp+3);
@@ -428,7 +417,7 @@ static void draw_fcurve_sample_control (float x, float y, float xscale, float ys
{
static GLuint displist=0;
- /* initialise X shape */
+ /* initialize X shape */
if (displist == 0) {
displist= glGenLists(1);
glNewList(displist, GL_COMPILE);
@@ -502,7 +491,7 @@ static void draw_fcurve_curve (bAnimContext *ac, ID *id, FCurve *fcu, View2D *v2
/* when opening a blend file on a different sized screen or while dragging the toolbar this can happen
* best just bail out in this case */
UI_view2d_grid_size(grid, &dx, &dy);
- if(dx <= 0.0f)
+ if (dx <= 0.0f)
return;
@@ -678,7 +667,7 @@ static void draw_fcurve_curve_bezts (bAnimContext *ac, ID *id, FCurve *fcu, View
}
/* draw curve between first and last keyframe (if there are enough to do so) */
- // TODO: optimise this to not have to calc stuff out of view too?
+ // TODO: optimize this to not have to calc stuff out of view too?
while (b--) {
if (prevbezt->ipo==BEZT_IPO_CONST) {
/* Constant-Interpolation: draw segment between previous keyframe and next, but holding same value */
@@ -850,7 +839,7 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri
/* draw curve:
* - curve line may be result of one or more destructive modifiers or just the raw data,
* so we need to check which method should be used
- * - controls from active modifier take precidence over keyframes
+ * - controls from active modifier take precedence over keyframes
* (XXX! editing tools need to take this into account!)
*/
@@ -870,7 +859,7 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri
/* set whatever color the curve has set
* - unselected curves draw less opaque to help distinguish the selected ones
*/
- glColor4f(fcu->color[0], fcu->color[1], fcu->color[2], drawFCurveFade(fcu));
+ glColor4f(fcu->color[0], fcu->color[1], fcu->color[2], fcurve_display_alpha(fcu));
}
/* draw active F-Curve thicker than the rest to make it stand out */
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index fbcb9546a1b..76a2c926522 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"
@@ -182,16 +184,16 @@ static int graphkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
void GRAPH_OT_previewrange_set (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Auto-Set Preview Range";
- ot->idname= "GRAPH_OT_previewrange_set";
- ot->description= "Automatically set Preview Range based on range of keyframes";
+ ot->name = "Auto-Set Preview Range";
+ ot->idname = "GRAPH_OT_previewrange_set";
+ ot->description = "Automatically set Preview Range based on range of keyframes";
/* api callbacks */
- ot->exec= graphkeys_previewrange_exec;
- ot->poll= ED_operator_graphedit_active; // XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier...
+ ot->exec = graphkeys_previewrange_exec;
+ ot->poll = ED_operator_graphedit_active; // XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier...
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ****************** View-All Operator ****************** */
@@ -244,31 +246,31 @@ static int graphkeys_view_selected_exec(bContext *C, wmOperator *UNUSED(op))
void GRAPH_OT_view_all (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View All";
- ot->idname= "GRAPH_OT_view_all";
- ot->description= "Reset viewable area to show full keyframe range";
+ ot->name = "View All";
+ ot->idname = "GRAPH_OT_view_all";
+ ot->description = "Reset viewable area to show full keyframe range";
/* api callbacks */
- ot->exec= graphkeys_viewall_exec;
- ot->poll= ED_operator_graphedit_active; // XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier...
+ ot->exec = graphkeys_viewall_exec;
+ ot->poll = ED_operator_graphedit_active; // XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier...
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
void GRAPH_OT_view_selected (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Selected";
- ot->idname= "GRAPH_OT_view_selected";
- ot->description= "Reset viewable area to show selected keyframe range";
+ ot->name = "View Selected";
+ ot->idname = "GRAPH_OT_view_selected";
+ ot->description = "Reset viewable area to show selected keyframe range";
/* api callbacks */
- ot->exec= graphkeys_view_selected_exec;
- ot->poll= ED_operator_graphedit_active; // XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier...
+ ot->exec = graphkeys_view_selected_exec;
+ ot->poll = ED_operator_graphedit_active; // XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier...
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Create Ghost-Curves Operator *********************** */
@@ -289,7 +291,7 @@ static void create_ghost_curves (bAnimContext *ac, int start, int end)
/* sanity check */
if (start >= end) {
- printf("Error: Frame range for Ghost F-Curve creation is inappropriate \n");
+ printf("Error: Frame range for Ghost F-Curve creation is inappropriate\n");
return;
}
@@ -374,16 +376,16 @@ static int graphkeys_create_ghostcurves_exec(bContext *C, wmOperator *UNUSED(op)
void GRAPH_OT_ghost_curves_create (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Create Ghost Curves";
- ot->idname= "GRAPH_OT_ghost_curves_create";
- ot->description= "Create snapshot (Ghosts) of selected F-Curves as background aid for active Graph Editor";
+ ot->name = "Create Ghost Curves";
+ ot->idname = "GRAPH_OT_ghost_curves_create";
+ ot->description = "Create snapshot (Ghosts) of selected F-Curves as background aid for active Graph Editor";
/* api callbacks */
- ot->exec= graphkeys_create_ghostcurves_exec;
- ot->poll= graphop_visible_keyframes_poll;
+ ot->exec = graphkeys_create_ghostcurves_exec;
+ ot->poll = graphop_visible_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
// todo: add props for start/end frames
}
@@ -417,16 +419,16 @@ static int graphkeys_clear_ghostcurves_exec(bContext *C, wmOperator *UNUSED(op))
void GRAPH_OT_ghost_curves_clear (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Ghost Curves";
- ot->idname= "GRAPH_OT_ghost_curves_clear";
- ot->description= "Clear F-Curve snapshots (Ghosts) for active Graph Editor";
+ ot->name = "Clear Ghost Curves";
+ ot->idname = "GRAPH_OT_ghost_curves_clear";
+ ot->description = "Clear F-Curve snapshots (Ghosts) for active Graph Editor";
/* api callbacks */
- ot->exec= graphkeys_clear_ghostcurves_exec;
- ot->poll= ED_operator_graphedit_active;
+ ot->exec = graphkeys_clear_ghostcurves_exec;
+ ot->poll = ED_operator_graphedit_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ************************************************************************** */
@@ -512,20 +514,20 @@ static int graphkeys_insertkey_exec(bContext *C, wmOperator *op)
void GRAPH_OT_keyframe_insert (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Insert Keyframes";
- ot->idname= "GRAPH_OT_keyframe_insert";
- ot->description= "Insert keyframes for the specified channels";
+ ot->name = "Insert Keyframes";
+ ot->idname = "GRAPH_OT_keyframe_insert";
+ ot->description = "Insert keyframes for the specified channels";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= graphkeys_insertkey_exec;
- ot->poll= graphop_editable_keyframes_poll;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = graphkeys_insertkey_exec;
+ ot->poll = graphop_editable_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_graphkeys_insertkey_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_graphkeys_insertkey_types, 0, "Type", "");
}
/* ******************** Click-Insert Keyframes Operator ************************* */
@@ -619,17 +621,17 @@ static int graphkeys_click_insert_invoke (bContext *C, wmOperator *op, wmEvent *
void GRAPH_OT_click_insert (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Click-Insert Keyframes";
- ot->idname= "GRAPH_OT_click_insert";
- ot->description= "Insert new keyframe at the cursor position for the active F-Curve";
+ ot->name = "Click-Insert Keyframes";
+ ot->idname = "GRAPH_OT_click_insert";
+ ot->description = "Insert new keyframe at the cursor position for the active F-Curve";
/* api callbacks */
- ot->invoke= graphkeys_click_insert_invoke;
- ot->exec= graphkeys_click_insert_exec;
- ot->poll= graphop_active_fcurve_poll;
+ ot->invoke = graphkeys_click_insert_invoke;
+ ot->exec = graphkeys_click_insert_exec;
+ ot->poll = graphop_active_fcurve_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_float(ot->srna, "frame", 1.0f, -FLT_MAX, FLT_MAX, "Frame Number", "Frame to insert keyframe on", 0, 100);
@@ -702,16 +704,16 @@ static int graphkeys_copy_exec(bContext *C, wmOperator *op)
void GRAPH_OT_copy (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Keyframes";
- ot->idname= "GRAPH_OT_copy";
- ot->description= "Copy selected keyframes to the copy/paste buffer";
+ ot->name = "Copy Keyframes";
+ ot->idname = "GRAPH_OT_copy";
+ ot->description = "Copy selected keyframes to the copy/paste buffer";
/* api callbacks */
- ot->exec= graphkeys_copy_exec;
- ot->poll= graphop_editable_keyframes_poll;
+ ot->exec = graphkeys_copy_exec;
+ ot->poll = graphop_editable_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -747,17 +749,17 @@ static int graphkeys_paste_exec(bContext *C, wmOperator *op)
void GRAPH_OT_paste (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Paste Keyframes";
- ot->idname= "GRAPH_OT_paste";
- ot->description= "Paste keyframes from copy/paste buffer for the selected channels, starting on the current frame";
+ ot->name = "Paste Keyframes";
+ ot->idname = "GRAPH_OT_paste";
+ ot->description = "Paste keyframes from copy/paste buffer for the selected channels, starting on the current frame";
/* api callbacks */
-// ot->invoke= WM_operator_props_popup; // better wait for graph redo panel
- ot->exec= graphkeys_paste_exec;
- ot->poll= graphop_editable_keyframes_poll;
+// ot->invoke = WM_operator_props_popup; // better wait for graph redo panel
+ ot->exec = graphkeys_paste_exec;
+ ot->poll = graphop_editable_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "offset", keyframe_paste_offset_items, KEYFRAME_PASTE_OFFSET_CFRA_START, "Offset", "Paste time offset of keys");
RNA_def_enum(ot->srna, "merge", keyframe_paste_merge_items, KEYFRAME_PASTE_MERGE_MIX, "Type", "Method of merging pasted keys and existing");
@@ -816,17 +818,17 @@ static int graphkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUS
void GRAPH_OT_duplicate (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Duplicate Keyframes";
- ot->idname= "GRAPH_OT_duplicate";
- ot->description= "Make a copy of all selected keyframes";
+ ot->name = "Duplicate Keyframes";
+ ot->idname = "GRAPH_OT_duplicate";
+ ot->description = "Make a copy of all selected keyframes";
/* api callbacks */
- ot->invoke= graphkeys_duplicate_invoke;
- ot->exec= graphkeys_duplicate_exec;
- ot->poll= graphop_editable_keyframes_poll;
+ ot->invoke = graphkeys_duplicate_invoke;
+ ot->exec = graphkeys_duplicate_exec;
+ ot->poll = graphop_editable_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* to give to transform */
RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", "");
@@ -886,17 +888,17 @@ static int graphkeys_delete_exec(bContext *C, wmOperator *UNUSED(op))
void GRAPH_OT_delete (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Keyframes";
- ot->idname= "GRAPH_OT_delete";
- ot->description= "Remove all selected keyframes";
+ ot->name = "Delete Keyframes";
+ ot->idname = "GRAPH_OT_delete";
+ ot->description = "Remove all selected keyframes";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= graphkeys_delete_exec;
- ot->poll= graphop_editable_keyframes_poll;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = graphkeys_delete_exec;
+ ot->poll = graphop_editable_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Clean Keyframes Operator ************************* */
@@ -948,20 +950,20 @@ static int graphkeys_clean_exec(bContext *C, wmOperator *op)
void GRAPH_OT_clean (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clean Keyframes";
- ot->idname= "GRAPH_OT_clean";
- ot->description= "Simplify F-Curves by removing closely spaced keyframes";
+ ot->name = "Clean Keyframes";
+ ot->idname = "GRAPH_OT_clean";
+ ot->description = "Simplify F-Curves by removing closely spaced keyframes";
/* api callbacks */
- //ot->invoke= // XXX we need that number popup for this!
- ot->exec= graphkeys_clean_exec;
- ot->poll= graphop_editable_keyframes_poll;
+ //ot->invoke = // XXX we need that number popup for this!
+ ot->exec = graphkeys_clean_exec;
+ ot->poll = graphop_editable_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_float(ot->srna, "threshold", 0.001f, 0.0f, FLT_MAX, "Threshold", "", 0.0f, 1000.0f);
+ ot->prop = RNA_def_float(ot->srna, "threshold", 0.001f, 0.0f, FLT_MAX, "Threshold", "", 0.0f, 1000.0f);
}
/* ******************** Bake F-Curve Operator *********************** */
@@ -1031,17 +1033,17 @@ static int graphkeys_bake_exec(bContext *C, wmOperator *UNUSED(op))
void GRAPH_OT_bake (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Bake Curve";
- ot->idname= "GRAPH_OT_bake";
- ot->description= "Bake selected F-Curves to a set of sampled points defining a similar curve";
+ ot->name = "Bake Curve";
+ ot->idname = "GRAPH_OT_bake";
+ ot->description = "Bake selected F-Curves to a set of sampled points defining a similar curve";
/* api callbacks */
- ot->invoke= WM_operator_confirm; // FIXME...
- ot->exec= graphkeys_bake_exec;
- ot->poll= graphop_selected_fcurve_poll;
+ ot->invoke = WM_operator_confirm; // FIXME...
+ ot->exec = graphkeys_bake_exec;
+ ot->poll = graphop_selected_fcurve_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
// todo: add props for start/end frames
}
@@ -1072,7 +1074,7 @@ static float fcurve_samplingcb_sound (FCurve *UNUSED(fcu), void *data, float eva
tSoundBakeInfo *sbi= (tSoundBakeInfo *)data;
int position = evaltime - sbi->cfra;
- if((position < 0) || (position >= sbi->length))
+ if ((position < 0) || (position >= sbi->length))
return 0.0f;
return sbi->samples[position];
@@ -1175,17 +1177,17 @@ static int graphkeys_sound_bake_invoke (bContext *C, wmOperator *op, wmEvent *ev
void GRAPH_OT_sound_bake (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Bake Sound to F-Curves";
- ot->idname= "GRAPH_OT_sound_bake";
- ot->description= "Bakes a sound wave to selected F-Curves";
+ ot->name = "Bake Sound to F-Curves";
+ ot->idname = "GRAPH_OT_sound_bake";
+ ot->description = "Bakes a sound wave to selected F-Curves";
/* api callbacks */
- ot->invoke= graphkeys_sound_bake_invoke;
- ot->exec= graphkeys_sound_bake_exec;
- ot->poll= graphop_selected_fcurve_poll;
+ ot->invoke = graphkeys_sound_bake_invoke;
+ ot->exec = graphkeys_sound_bake_exec;
+ ot->poll = graphop_selected_fcurve_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
@@ -1249,16 +1251,16 @@ static int graphkeys_sample_exec(bContext *C, wmOperator *UNUSED(op))
void GRAPH_OT_sample (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Sample Keyframes";
- ot->idname= "GRAPH_OT_sample";
- ot->description= "Add keyframes on every frame between the selected keyframes";
+ ot->name = "Sample Keyframes";
+ ot->idname = "GRAPH_OT_sample";
+ ot->description = "Add keyframes on every frame between the selected keyframes";
/* api callbacks */
- ot->exec= graphkeys_sample_exec;
- ot->poll= graphop_editable_keyframes_poll;
+ ot->exec = graphkeys_sample_exec;
+ ot->poll = graphop_editable_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -1358,20 +1360,20 @@ static int graphkeys_expo_exec(bContext *C, wmOperator *op)
void GRAPH_OT_extrapolation_type (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Keyframe Extrapolation";
- ot->idname= "GRAPH_OT_extrapolation_type";
- ot->description= "Set extrapolation mode for selected F-Curves";
+ ot->name = "Set Keyframe Extrapolation";
+ ot->idname = "GRAPH_OT_extrapolation_type";
+ ot->description = "Set extrapolation mode for selected F-Curves";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= graphkeys_expo_exec;
- ot->poll= graphop_editable_keyframes_poll;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = graphkeys_expo_exec;
+ ot->poll = graphop_editable_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_graphkeys_expo_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_graphkeys_expo_types, 0, "Type", "");
}
/* ******************** Set Interpolation-Type Operator *********************** */
@@ -1427,20 +1429,20 @@ static int graphkeys_ipo_exec(bContext *C, wmOperator *op)
void GRAPH_OT_interpolation_type (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Keyframe Interpolation";
- ot->idname= "GRAPH_OT_interpolation_type";
- ot->description= "Set interpolation mode for the F-Curve segments starting from the selected keyframes";
+ ot->name = "Set Keyframe Interpolation";
+ ot->idname = "GRAPH_OT_interpolation_type";
+ ot->description = "Set interpolation mode for the F-Curve segments starting from the selected keyframes";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= graphkeys_ipo_exec;
- ot->poll= graphop_editable_keyframes_poll;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = graphkeys_ipo_exec;
+ ot->poll = graphop_editable_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", beztriple_interpolation_mode_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", beztriple_interpolation_mode_items, 0, "Type", "");
}
/* ******************** Set Handle-Type Operator *********************** */
@@ -1504,20 +1506,20 @@ static int graphkeys_handletype_exec(bContext *C, wmOperator *op)
void GRAPH_OT_handle_type (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Keyframe Handle Type";
- ot->idname= "GRAPH_OT_handle_type";
- ot->description= "Set type of handle for selected keyframes";
+ ot->name = "Set Keyframe Handle Type";
+ ot->idname = "GRAPH_OT_handle_type";
+ ot->description = "Set type of handle for selected keyframes";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= graphkeys_handletype_exec;
- ot->poll= graphop_editable_keyframes_poll;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = graphkeys_handletype_exec;
+ ot->poll = graphop_editable_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", keyframe_handle_type_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", keyframe_handle_type_items, 0, "Type", "");
}
/* ************************************************************************** */
@@ -1582,7 +1584,7 @@ static int graphkeys_euler_filter_exec (bContext *C, wmOperator *op)
continue;
}
- /* optimisation: assume that xyz curves will always be stored consecutively,
+ /* optimization: assume that xyz curves will always be stored consecutively,
* so if the paths or the ID's don't match up, then a curve needs to be added
* to a new group
*/
@@ -1698,16 +1700,16 @@ static int graphkeys_euler_filter_exec (bContext *C, wmOperator *op)
void GRAPH_OT_euler_filter (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Euler Discontinuity Filter";
- ot->idname= "GRAPH_OT_euler_filter";
- ot->description= "Fixes the most common causes of gimbal lock in the selected Euler Rotation F-Curves";
+ ot->name = "Euler Discontinuity Filter";
+ ot->idname = "GRAPH_OT_euler_filter";
+ ot->description = "Fixes the most common causes of gimbal lock in the selected Euler Rotation F-Curves";
/* api callbacks */
- ot->exec= graphkeys_euler_filter_exec;
- ot->poll= graphop_editable_keyframes_poll;
+ ot->exec = graphkeys_euler_filter_exec;
+ ot->poll = graphop_editable_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ***************** Jump to Selected Frames Operator *********************** */
@@ -1772,16 +1774,16 @@ static int graphkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
void GRAPH_OT_frame_jump (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Jump to Frame";
- ot->idname= "GRAPH_OT_frame_jump";
- ot->description= "Set the current frame to the average frame of the selected keyframes";
+ ot->name = "Jump to Frame";
+ ot->idname = "GRAPH_OT_frame_jump";
+ ot->description = "Set the current frame to the average frame of the selected keyframes";
/* api callbacks */
- ot->exec= graphkeys_framejump_exec;
- ot->poll= graphop_visible_keyframes_poll;
+ ot->exec = graphkeys_framejump_exec;
+ ot->poll = graphop_visible_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Snap Keyframes Operator *********************** */
@@ -1876,20 +1878,20 @@ static int graphkeys_snap_exec(bContext *C, wmOperator *op)
void GRAPH_OT_snap (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Snap Keys";
- ot->idname= "GRAPH_OT_snap";
- ot->description= "Snap selected keyframes to the chosen times/values";
+ ot->name = "Snap Keys";
+ ot->idname = "GRAPH_OT_snap";
+ ot->description = "Snap selected keyframes to the chosen times/values";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= graphkeys_snap_exec;
- ot->poll= graphop_editable_keyframes_poll;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = graphkeys_snap_exec;
+ ot->poll = graphop_editable_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_graphkeys_snap_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_graphkeys_snap_types, 0, "Type", "");
}
/* ******************** Mirror Keyframes Operator *********************** */
@@ -1994,20 +1996,20 @@ static int graphkeys_mirror_exec(bContext *C, wmOperator *op)
void GRAPH_OT_mirror (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mirror Keys";
- ot->idname= "GRAPH_OT_mirror";
- ot->description= "Flip selected keyframes over the selected mirror line";
+ ot->name = "Mirror Keys";
+ ot->idname = "GRAPH_OT_mirror";
+ ot->description = "Flip selected keyframes over the selected mirror line";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= graphkeys_mirror_exec;
- ot->poll= graphop_editable_keyframes_poll;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = graphkeys_mirror_exec;
+ ot->poll = graphop_editable_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_graphkeys_mirror_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_graphkeys_mirror_types, 0, "Type", "");
}
/* ******************** Smooth Keyframes Operator *********************** */
@@ -2049,16 +2051,16 @@ static int graphkeys_smooth_exec(bContext *C, wmOperator *UNUSED(op))
void GRAPH_OT_smooth (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Smooth Keys";
- ot->idname= "GRAPH_OT_smooth";
- ot->description= "Apply weighted moving means to make selected F-Curves less bumpy";
+ ot->name = "Smooth Keys";
+ ot->idname = "GRAPH_OT_smooth";
+ ot->description = "Apply weighted moving means to make selected F-Curves less bumpy";
/* api callbacks */
- ot->exec= graphkeys_smooth_exec;
- ot->poll= graphop_editable_keyframes_poll;
+ ot->exec = graphkeys_smooth_exec;
+ ot->poll = graphop_editable_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ************************************************************************** */
@@ -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... */
@@ -2152,20 +2155,20 @@ static int graph_fmodifier_add_exec(bContext *C, wmOperator *op)
void GRAPH_OT_fmodifier_add (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add F-Curve Modifier";
- ot->idname= "GRAPH_OT_fmodifier_add";
- ot->description= "Add F-Modifiers to the selected F-Curves";
+ ot->name = "Add F-Curve Modifier";
+ ot->idname = "GRAPH_OT_fmodifier_add";
+ ot->description = "Add F-Modifiers to the selected F-Curves";
/* api callbacks */
- ot->invoke= graph_fmodifier_add_invoke;
- ot->exec= graph_fmodifier_add_exec;
- ot->poll= graphop_selected_fcurve_poll;
+ ot->invoke = graph_fmodifier_add_invoke;
+ ot->exec = graph_fmodifier_add_exec;
+ ot->poll = graphop_selected_fcurve_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", fmodifier_type_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", fmodifier_type_items, 0, "Type", "");
RNA_def_boolean(ot->srna, "only_active", 1, "Only Active", "Only add F-Modifier to active F-Curve");
}
@@ -2210,16 +2213,16 @@ static int graph_fmodifier_copy_exec(bContext *C, wmOperator *op)
void GRAPH_OT_fmodifier_copy (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy F-Modifiers";
- ot->idname= "GRAPH_OT_fmodifier_copy";
- ot->description= "Copy the F-Modifier(s) of the active F-Curve";
+ ot->name = "Copy F-Modifiers";
+ ot->idname = "GRAPH_OT_fmodifier_copy";
+ ot->description = "Copy the F-Modifier(s) of the active F-Curve";
/* api callbacks */
- ot->exec= graph_fmodifier_copy_exec;
- ot->poll= graphop_active_fcurve_poll;
+ ot->exec = graph_fmodifier_copy_exec;
+ ot->poll = graphop_active_fcurve_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
//ot->prop = RNA_def_boolean(ot->srna, "all", 1, "All F-Modifiers", "Copy all the F-Modifiers, instead of just the active one");
@@ -2272,16 +2275,16 @@ static int graph_fmodifier_paste_exec(bContext *C, wmOperator *op)
void GRAPH_OT_fmodifier_paste (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Paste F-Modifiers";
- ot->idname= "GRAPH_OT_fmodifier_paste";
- ot->description= "Add copied F-Modifiers to the selected F-Curves";
+ ot->name = "Paste F-Modifiers";
+ ot->idname = "GRAPH_OT_fmodifier_paste";
+ ot->description = "Add copied F-Modifiers to the selected F-Curves";
/* api callbacks */
- ot->exec= graph_fmodifier_paste_exec;
- ot->poll= graphop_active_fcurve_poll;
+ ot->exec = graph_fmodifier_paste_exec;
+ ot->poll = graphop_active_fcurve_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ************************************************************************** */
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index aba58098563..2887fa1c881 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -164,18 +164,18 @@ static int graphview_cursor_modal(bContext *C, wmOperator *op, wmEvent *event)
static void GRAPH_OT_cursor_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Cursor";
- ot->idname= "GRAPH_OT_cursor_set";
- ot->description= "Interactively set the current frame number and value cursor";
+ ot->name = "Set Cursor";
+ ot->idname = "GRAPH_OT_cursor_set";
+ ot->description = "Interactively set the current frame number and value cursor";
/* api callbacks */
- ot->exec= graphview_cursor_exec;
- ot->invoke= graphview_cursor_invoke;
- ot->modal= graphview_cursor_modal;
- ot->poll= ED_operator_graphedit_active;
+ ot->exec = graphview_cursor_exec;
+ ot->invoke = graphview_cursor_invoke;
+ ot->modal = graphview_cursor_modal;
+ ot->poll = ED_operator_graphedit_active;
/* flags */
- ot->flag= OPTYPE_BLOCKING|OPTYPE_UNDO;
+ ot->flag = OPTYPE_BLOCKING|OPTYPE_UNDO;
/* rna */
RNA_def_int(ot->srna, "frame", 0, MINAFRAME, MAXFRAME, "Frame", "", MINAFRAME, MAXFRAME);
@@ -241,11 +241,11 @@ void ED_operatormacros_graph(void)
wmOperatorType *ot;
wmOperatorTypeMacro *otmacro;
- ot= WM_operatortype_append_macro("GRAPH_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("GRAPH_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
if (ot) {
- ot->description= "Make a copy of all selected keyframes and move them";
+ ot->description = "Make a copy of all selected keyframes and move them";
WM_operatortype_macro_define(ot, "GRAPH_OT_duplicate");
- otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
+ otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
}
}
@@ -273,23 +273,23 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_boolean_set(kmi->ptr, "curves", FALSE);
RNA_boolean_set(kmi->ptr, "column", FALSE);
- kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_boolean_set(kmi->ptr, "curves", FALSE);
RNA_boolean_set(kmi->ptr, "column", TRUE);
- kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_boolean_set(kmi->ptr, "curves", FALSE);
RNA_boolean_set(kmi->ptr, "column", FALSE);
- kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_boolean_set(kmi->ptr, "curves", FALSE);
RNA_boolean_set(kmi->ptr, "column", TRUE);
- kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_boolean_set(kmi->ptr, "curves", TRUE);
RNA_boolean_set(kmi->ptr, "column", FALSE);
- kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT|KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT|KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_boolean_set(kmi->ptr, "curves", TRUE);
RNA_boolean_set(kmi->ptr, "column", FALSE);
@@ -298,14 +298,14 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_TEST);
- kmi= WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_TEST);
- kmi= WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_LEFT);
- kmi= WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_RIGHT);
@@ -406,7 +406,7 @@ void graphedit_keymap(wmKeyConfig *keyconf)
wmKeyMap *keymap;
/* keymap for all regions */
- keymap= WM_keymap_find(keyconf, "Graph Editor Generic", SPACE_IPO, 0);
+ keymap = WM_keymap_find(keyconf, "Graph Editor Generic", SPACE_IPO, 0);
WM_keymap_add_item(keymap, "GRAPH_OT_properties", NKEY, KM_PRESS, 0, 0);
/* extrapolation works on channels, not keys */
WM_keymap_add_item(keymap, "GRAPH_OT_extrapolation_type", EKEY, KM_PRESS, KM_SHIFT, 0);
@@ -418,7 +418,7 @@ void graphedit_keymap(wmKeyConfig *keyconf)
*/
/* keyframes */
- keymap= WM_keymap_find(keyconf, "Graph Editor", SPACE_IPO, 0);
+ keymap = WM_keymap_find(keyconf, "Graph Editor", SPACE_IPO, 0);
graphedit_keymap_keyframes(keyconf, keymap);
}
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index 617dd172c05..864708a873a 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -154,7 +154,7 @@ static int graphkeys_deselectall_exec(bContext *C, wmOperator *op)
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
- /* 'standard' behaviour - check if selected, then apply relevant selection */
+ /* 'standard' behavior - check if selected, then apply relevant selection */
if (RNA_boolean_get(op->ptr, "invert"))
deselect_graph_keys(&ac, 0, SELECT_INVERT, TRUE);
else
@@ -169,19 +169,19 @@ static int graphkeys_deselectall_exec(bContext *C, wmOperator *op)
void GRAPH_OT_select_all_toggle (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select All";
- ot->idname= "GRAPH_OT_select_all_toggle";
- ot->description= "Toggle selection of all keyframes";
+ ot->name = "Select All";
+ ot->idname = "GRAPH_OT_select_all_toggle";
+ ot->description = "Toggle selection of all keyframes";
/* api callbacks */
- ot->exec= graphkeys_deselectall_exec;
- ot->poll= graphop_visible_keyframes_poll;
+ ot->exec = graphkeys_deselectall_exec;
+ ot->poll = graphop_visible_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+ ot->flag = OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
/* props */
- ot->prop= RNA_def_boolean(ot->srna, "invert", 0, "Invert", "");
+ ot->prop = RNA_def_boolean(ot->srna, "invert", 0, "Invert", "");
}
/* ******************** Border Select Operator **************************** */
@@ -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).
*/
@@ -316,16 +316,16 @@ static int graphkeys_borderselect_exec(bContext *C, wmOperator *op)
incl_handles = RNA_boolean_get(op->ptr, "include_handles");
/* get settings 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");
+ 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");
/* selection 'mode' depends on whether borderselect region only matters on one axis */
if (RNA_boolean_get(op->ptr, "axis_range")) {
/* mode depends on which axis of the range is larger to determine which axis to use
* - checking this in region-space is fine, as it's fundamentally still going to be a different rect size
- * - the frame-range select option is favoured over the channel one (x over y), as frame-range one is often
+ * - the frame-range select option is favored over the channel one (x over y), as frame-range one is often
* used for tweaking timing when "blocking", while channels is not that useful...
*/
if ((rect.xmax - rect.xmin) >= (rect.ymax - rect.ymin))
@@ -348,25 +348,25 @@ static int graphkeys_borderselect_exec(bContext *C, wmOperator *op)
void GRAPH_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Border Select";
- ot->idname= "GRAPH_OT_select_border";
- ot->description= "Select all keyframes within the specified region";
+ ot->name = "Border Select";
+ ot->idname = "GRAPH_OT_select_border";
+ ot->description = "Select all keyframes within the specified region";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= graphkeys_borderselect_exec;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = graphkeys_borderselect_exec;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= graphop_visible_keyframes_poll;
+ ot->poll = graphop_visible_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+ ot->flag = OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
/* rna */
WM_operator_properties_gesture_border(ot, TRUE);
- ot->prop= RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
+ ot->prop = RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
RNA_def_boolean(ot->srna, "include_handles", 0, "Include Handles", "Are handles tested individually against the selection criteria");
}
@@ -449,7 +449,7 @@ static void columnselect_graph_keys (bAnimContext *ac, short mode)
KeyframeEditFunc select_cb, ok_cb;
KeyframeEditData ked;
- /* initialise keyframe editing data */
+ /* initialize keyframe editing data */
memset(&ked, 0, sizeof(KeyframeEditData));
/* build list of columns */
@@ -538,19 +538,19 @@ static int graphkeys_columnselect_exec(bContext *C, wmOperator *op)
void GRAPH_OT_select_column (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select All";
- ot->idname= "GRAPH_OT_select_column";
- ot->description= "Select all keyframes on the specified frame(s)";
+ ot->name = "Select All";
+ ot->idname = "GRAPH_OT_select_column";
+ ot->description = "Select all keyframes on the specified frame(s)";
/* api callbacks */
- ot->exec= graphkeys_columnselect_exec;
- ot->poll= graphop_visible_keyframes_poll;
+ ot->exec = graphkeys_columnselect_exec;
+ ot->poll = graphop_visible_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+ ot->flag = OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
/* props */
- ot->prop= RNA_def_enum(ot->srna, "mode", prop_column_select_types, 0, "Mode", "");
+ ot->prop = RNA_def_enum(ot->srna, "mode", prop_column_select_types, 0, "Mode", "");
}
/* ******************** Select Linked Operator *********************** */
@@ -597,15 +597,15 @@ void GRAPH_OT_select_linked (wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select Linked";
- ot->idname= "GRAPH_OT_select_linked";
+ ot->idname = "GRAPH_OT_select_linked";
ot->description = "Select keyframes occurring in the same F-Curves as selected ones";
/* api callbacks */
- ot->exec= graphkeys_select_linked_exec;
- ot->poll= graphop_visible_keyframes_poll;
+ ot->exec = graphkeys_select_linked_exec;
+ ot->poll = graphop_visible_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+ ot->flag = OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
}
/* ******************** Select More/Less Operators *********************** */
@@ -675,15 +675,15 @@ void GRAPH_OT_select_more (wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select More";
- ot->idname= "GRAPH_OT_select_more";
+ ot->idname = "GRAPH_OT_select_more";
ot->description = "Select keyframes beside already selected ones";
/* api callbacks */
- ot->exec= graphkeys_select_more_exec;
- ot->poll= graphop_visible_keyframes_poll;
+ ot->exec = graphkeys_select_more_exec;
+ ot->poll = graphop_visible_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+ ot->flag = OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
}
/* ----------------- */
@@ -709,15 +709,15 @@ void GRAPH_OT_select_less (wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select Less";
- ot->idname= "GRAPH_OT_select_less";
+ ot->idname = "GRAPH_OT_select_less";
ot->description = "Deselect keyframes on ends of selection islands";
/* api callbacks */
- ot->exec= graphkeys_select_less_exec;
- ot->poll= graphop_visible_keyframes_poll;
+ ot->exec = graphkeys_select_less_exec;
+ ot->poll = graphop_visible_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+ ot->flag = OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
}
/* ******************** Select Left/Right Operator ************************* */
@@ -849,20 +849,20 @@ static int graphkeys_select_leftright_invoke (bContext *C, wmOperator *op, wmEve
void GRAPH_OT_select_leftright (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Left/Right";
- ot->idname= "GRAPH_OT_select_leftright";
- ot->description= "Select keyframes to the left or the right of the current frame";
+ ot->name = "Select Left/Right";
+ ot->idname = "GRAPH_OT_select_leftright";
+ ot->description = "Select keyframes to the left or the right of the current frame";
/* api callbacks */
ot->invoke= graphkeys_select_leftright_invoke;
- ot->exec= graphkeys_select_leftright_exec;
- ot->poll= graphop_visible_keyframes_poll;
+ ot->exec = graphkeys_select_leftright_exec;
+ ot->poll = graphop_visible_keyframes_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "mode", prop_graphkeys_leftright_select_types, GRAPHKEYS_LRSEL_TEST, "Mode", "");
+ ot->prop = RNA_def_enum(ot->srna, "mode", prop_graphkeys_leftright_select_types, GRAPHKEYS_LRSEL_TEST, "Mode", "");
RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", "");
}
@@ -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);
}
}
@@ -1180,7 +1178,7 @@ static void mouse_graph_keys (bAnimContext *ac, const int mval[2], short select_
KeyframeEditFunc select_cb;
KeyframeEditData ked;
- /* initialise keyframe editing data */
+ /* initialize keyframe editing data */
memset(&ked, 0, sizeof(KeyframeEditData));
/* set up BezTriple edit callbacks */
@@ -1262,7 +1260,7 @@ static void graphkeys_mselect_column (bAnimContext *ac, const int mval[2], short
deselect_graph_keys(ac, 0, SELECT_SUBTRACT, FALSE);
}
- /* initialise keyframe editing data */
+ /* initialize keyframe editing data */
memset(&ked, 0, sizeof(KeyframeEditData));
/* set up BezTriple edit callbacks */
@@ -1336,13 +1334,13 @@ static int graphkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *ev
void GRAPH_OT_clickselect (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mouse Select Keys";
- ot->idname= "GRAPH_OT_clickselect";
- ot->description= "Select keyframes by clicking on them";
+ ot->name = "Mouse Select Keys";
+ ot->idname = "GRAPH_OT_clickselect";
+ ot->description = "Select keyframes by clicking on them";
/* api callbacks */
- ot->invoke= graphkeys_clickselect_invoke;
- ot->poll= graphop_visible_keyframes_poll;
+ ot->invoke = graphkeys_clickselect_invoke;
+ ot->poll = graphop_visible_keyframes_poll;
/* id-props */
RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", ""); // SHIFTKEY
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..37cdbd4963a 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -70,7 +70,7 @@ ARegion *graph_has_buttons_region(ScrArea *sa)
ARegion *ar, *arnew;
ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
- if(ar) return ar;
+ if (ar) return ar;
/* add subdiv level; after main */
ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
@@ -142,10 +142,10 @@ static SpaceLink *graph_new(const bContext *C)
BLI_addtail(&sipo->regionbase, ar);
ar->regiontype= RGN_TYPE_WINDOW;
- ar->v2d.tot.xmin= 0.0f;
- ar->v2d.tot.ymin= (float)scene->r.sfra - 10.0f;
- ar->v2d.tot.xmax= (float)scene->r.efra;
- ar->v2d.tot.ymax= 10.0f;
+ ar->v2d.tot.xmin = 0.0f;
+ ar->v2d.tot.ymin = (float)scene->r.sfra - 10.0f;
+ ar->v2d.tot.xmax = (float)scene->r.efra;
+ ar->v2d.tot.ymax = 10.0f;
ar->v2d.cur= ar->v2d.tot;
@@ -211,9 +211,9 @@ static void graph_main_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "Graph Editor", SPACE_IPO, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Graph Editor", SPACE_IPO, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap= WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -310,9 +310,9 @@ static void graph_channel_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap= WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -362,7 +362,7 @@ static void graph_buttons_area_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap= WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -400,7 +400,7 @@ static void graph_region_listener(ARegion *ar, wmNotifier *wmn)
ED_region_tag_redraw(ar);
break;
case ND_MODIFIER:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
}
@@ -414,11 +414,11 @@ static void graph_region_listener(ARegion *ar, wmNotifier *wmn)
}
break;
case NC_ID:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
default:
- if(wmn->data==ND_KEYS)
+ if (wmn->data==ND_KEYS)
ED_region_tag_redraw(ar);
}
@@ -474,13 +474,13 @@ static void graph_listener(ScrArea *sa, wmNotifier *wmn)
}
break;
case NC_SPACE:
- if(wmn->data == ND_SPACE_GRAPH)
+ if (wmn->data == ND_SPACE_GRAPH)
ED_area_tag_redraw(sa);
break;
// XXX: restore the case below if not enough updates occur...
//default:
- // if(wmn->data==ND_KEYS)
+ // if (wmn->data==ND_KEYS)
// ED_area_tag_redraw(sa);
}
}
@@ -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..f116a246d72 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -71,97 +71,96 @@
#include "image_intern.h"
-#define B_REDR 1
-#define B_IMAGECHANGED 2
-#define B_NOP 0
-#define B_TWINANIM 5
-#define B_SIMAGETILE 6
-#define B_IDNAME 10
-#define B_FACESEL_PAINT_TEST 11
-#define B_SIMA_RECORD 12
-#define B_SIMA_PLAY 13
-
-#define B_SIMANOTHING 16
-#define B_SIMABRUSHCHANGE 17
-#define B_SIMABRUSHBROWSE 18
-#define B_SIMABRUSHLOCAL 19
-#define B_SIMABRUSHDELETE 20
-#define B_KEEPDATA 21
-#define B_SIMABTEXBROWSE 22
-#define B_SIMABTEXDELETE 23
-#define B_VPCOLSLI 24
-#define B_SIMACLONEBROWSE 25
-#define B_SIMACLONEDELETE 26
+#define B_REDR 1
+#define B_IMAGECHANGED 2
+#define B_NOP 0
+#define B_TWINANIM 5
+#define B_SIMAGETILE 6
+#define B_IDNAME 10
+#define B_FACESEL_PAINT_TEST 11
+#define B_SIMA_RECORD 12
+#define B_SIMA_PLAY 13
+
+#define B_SIMANOTHING 16
+#define B_SIMABRUSHCHANGE 17
+#define B_SIMABRUSHBROWSE 18
+#define B_SIMABRUSHLOCAL 19
+#define B_SIMABRUSHDELETE 20
+#define B_KEEPDATA 21
+#define B_SIMABTEXBROWSE 22
+#define B_SIMABTEXDELETE 23
+#define B_VPCOLSLI 24
+#define B_SIMACLONEBROWSE 25
+#define B_SIMACLONEDELETE 26
/* proto */
static void image_info(Scene *scene, ImageUser *iuser, Image *ima, ImBuf *ibuf, char *str)
{
- int ofs= 0;
+ int ofs = 0;
- str[0]= 0;
+ str[0] = 0;
- if(ima==NULL) return;
+ if (ima == NULL) return;
- if(ibuf==NULL) {
- ofs+= sprintf(str, "Can't Load Image");
+ if (ibuf == NULL) {
+ ofs += sprintf(str, "Can't Load Image");
}
else {
- if(ima->source==IMA_SRC_MOVIE) {
- ofs+= sprintf(str, "Movie");
- if(ima->anim)
- ofs+= sprintf(str+ofs, "%d frs", IMB_anim_get_duration(ima->anim, IMB_TC_RECORD_RUN));
+ if (ima->source == IMA_SRC_MOVIE) {
+ ofs += sprintf(str, "Movie");
+ if (ima->anim)
+ ofs += sprintf(str + ofs, "%d frs", IMB_anim_get_duration(ima->anim, IMB_TC_RECORD_RUN));
}
else
- ofs+= sprintf(str, "Image");
+ ofs += sprintf(str, "Image");
- ofs+= sprintf(str+ofs, ": size %d x %d,", ibuf->x, ibuf->y);
+ ofs += sprintf(str + ofs, ": size %d x %d,", ibuf->x, ibuf->y);
- if(ibuf->rect_float) {
- if(ibuf->channels!=4) {
- ofs+= sprintf(str+ofs, "%d float channel(s)", ibuf->channels);
+ if (ibuf->rect_float) {
+ if (ibuf->channels != 4) {
+ ofs += sprintf(str + ofs, "%d float channel(s)", ibuf->channels);
}
- else if(ibuf->planes == R_IMF_PLANES_RGBA)
- ofs+= sprintf(str+ofs, " RGBA float");
+ else if (ibuf->planes == R_IMF_PLANES_RGBA)
+ ofs += sprintf(str + ofs, " RGBA float");
else
- ofs+= sprintf(str+ofs, " RGB float");
+ ofs += sprintf(str + ofs, " RGB float");
}
else {
- if(ibuf->planes == R_IMF_PLANES_RGBA)
- ofs+= sprintf(str+ofs, " RGBA byte");
+ if (ibuf->planes == R_IMF_PLANES_RGBA)
+ ofs += sprintf(str + ofs, " RGBA byte");
else
- ofs+= sprintf(str+ofs, " RGB byte");
+ ofs += sprintf(str + ofs, " RGB byte");
}
- if(ibuf->zbuf || ibuf->zbuf_float)
- ofs+= sprintf(str+ofs, " + Z");
-
- if(ima->source==IMA_SRC_SEQUENCE) {
- char *file= BLI_last_slash(ibuf->name);
- if(file==NULL) file= ibuf->name;
- else file++;
- ofs+= sprintf(str+ofs, ", %s", file);
+ if (ibuf->zbuf || ibuf->zbuf_float)
+ ofs += sprintf(str + ofs, " + Z");
+
+ if (ima->source == IMA_SRC_SEQUENCE) {
+ char *file = BLI_last_slash(ibuf->name);
+ if (file == NULL) file = ibuf->name;
+ else file++;
+ ofs += sprintf(str + ofs, ", %s", file);
}
}
/* the frame number, even if we cant */
- if(ima->source==IMA_SRC_SEQUENCE) {
+ if (ima->source == IMA_SRC_SEQUENCE) {
/* don't use iuser->framenr directly because it may not be updated if auto-refresh is off */
- const int framenr= BKE_image_user_get_frame(iuser, CFRA, 0);
- ofs+= sprintf(str+ofs, ", Frame: %d", framenr);
+ const int framenr = BKE_image_user_get_frame(iuser, CFRA, 0);
+ ofs += sprintf(str + ofs, ", Frame: %d", framenr);
}
(void)ofs;
}
/* gets active viewer user */
-struct ImageUser *ntree_get_active_iuser(bNodeTree *ntree)
-{
+struct ImageUser *ntree_get_active_iuser(bNodeTree *ntree){
bNode *node;
- if(ntree)
- for(node= ntree->nodes.first; node; node= node->next)
- if( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
- if(node->flag & NODE_DO_OUTPUT)
+ if (ntree)
+ for (node = ntree->nodes.first; node; node = node->next)
+ if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
+ if (node->flag & NODE_DO_OUTPUT)
return node->storage;
return NULL;
}
@@ -173,13 +172,13 @@ struct ImageUser *ntree_get_active_iuser(bNodeTree *ntree)
static int image_panel_poll(const bContext *C, PanelType *UNUSED(pt))
{
- SpaceImage *sima= CTX_wm_space_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
ImBuf *ibuf;
void *lock;
int result;
- ibuf= ED_space_image_acquire_buffer(sima, &lock);
- result= ibuf && ibuf->rect_float;
+ ibuf = ED_space_image_acquire_buffer(sima, &lock);
+ result = ibuf && ibuf->rect_float;
ED_space_image_release_buffer(sima, lock);
return result;
@@ -187,21 +186,21 @@ static int image_panel_poll(const bContext *C, PanelType *UNUSED(pt))
static void image_panel_curves(const bContext *C, Panel *pa)
{
- bScreen *sc= CTX_wm_screen(C);
- SpaceImage *sima= CTX_wm_space_image(C);
+ bScreen *sc = CTX_wm_screen(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
ImBuf *ibuf;
PointerRNA simaptr;
int levels;
void *lock;
- ibuf= ED_space_image_acquire_buffer(sima, &lock);
+ ibuf = ED_space_image_acquire_buffer(sima, &lock);
- if(ibuf) {
- if(sima->cumap==NULL)
- sima->cumap= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
+ if (ibuf) {
+ if (sima->cumap == NULL)
+ sima->cumap = curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
/* curvemap black/white levels only works for RGBA */
- levels= (ibuf->channels==4);
+ levels = (ibuf->channels == 4);
RNA_pointer_create(&sc->id, &RNA_SpaceImageEditor, sima, &simaptr);
uiTemplateCurveMapping(pa->layout, &simaptr, "curve", 'c', levels, 0);
@@ -212,42 +211,42 @@ 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;
+ int exec = 0;
- if(event==0) {
+ if (event == 0) {
G.scene->r.scemode &= ~R_COMP_CROP;
- exec= 1;
+ exec = 1;
}
else {
- if(image_preview_active(curarea, NULL, NULL)) {
+ if (image_preview_active(curarea, NULL, NULL)) {
G.scene->r.scemode |= R_COMP_CROP;
- exec= 1;
+ exec = 1;
}
else
G.scene->r.scemode &= ~R_COMP_CROP;
}
- if(exec && G.scene->nodetree) {
+ if (exec && G.scene->nodetree) {
/* should work when no node editor in screen..., so we execute right away */
ntreeCompositTagGenerators(G.scene->nodetree);
- G.afbreek= 0;
- G.scene->nodetree->timecursor= set_timecursor;
- G.scene->nodetree->test_break= blender_test_break;
+ G.afbreek = 0;
+ G.scene->nodetree->timecursor = set_timecursor;
+ G.scene->nodetree->test_break = blender_test_break;
BIF_store_spare();
- ntreeCompositExecTree(G.scene->nodetree, &G.scene->r, 1); /* 1 is do_previews */
+ ntreeCompositExecTree(G.scene->nodetree, &G.scene->r, 1); /* 1 is do_previews */
- G.scene->nodetree->timecursor= NULL;
- G.scene->nodetree->test_break= NULL;
+ G.scene->nodetree->timecursor = NULL;
+ G.scene->nodetree->test_break = NULL;
scrarea_do_windraw(curarea);
waitcursor(0);
@@ -260,21 +259,21 @@ void image_preview_event(int event)
/* nothing drawn here, we use it to store values */
static void preview_cb(struct ScrArea *sa, struct uiBlock *block)
{
- SpaceImage *sima= sa->spacedata.first;
+ SpaceImage *sima = sa->spacedata.first;
rctf dispf;
- rcti *disprect= &G.scene->r.disprect;
- int winx= (G.scene->r.size*G.scene->r.xsch)/100;
- int winy= (G.scene->r.size*G.scene->r.ysch)/100;
+ rcti *disprect = &G.scene->r.disprect;
+ int winx = (G.scene->r.size * G.scene->r.xsch) / 100;
+ int winy = (G.scene->r.size * G.scene->r.ysch) / 100;
int mval[2];
- if(G.scene->r.mode & R_BORDER) {
- winx*= (G.scene->r.border.xmax - G.scene->r.border.xmin);
- winy*= (G.scene->r.border.ymax - G.scene->r.border.ymin);
+ if (G.scene->r.mode & R_BORDER) {
+ winx *= (G.scene->r.border.xmax - G.scene->r.border.xmin);
+ winy *= (G.scene->r.border.ymax - G.scene->r.border.ymin);
}
/* while dragging we need to update the rects, otherwise it doesn't end with correct one */
- BLI_init_rctf(&dispf, 15.0f, (block->maxx - block->minx)-15.0f, 15.0f, (block->maxy - block->miny)-15.0f);
+ BLI_init_rctf(&dispf, 15.0f, (block->maxx - block->minx) - 15.0f, 15.0f, (block->maxy - block->miny) - 15.0f);
ui_graphics_to_window_rct(sa->win, &dispf, disprect);
/* correction for gla draw */
@@ -283,16 +282,16 @@ static void preview_cb(struct ScrArea *sa, struct uiBlock *block)
calc_image_view(sima, 'p');
// printf("winrct %d %d %d %d\n", disprect->xmin, disprect->ymin,disprect->xmax, disprect->ymax);
/* map to image space coordinates */
- mval[0]= disprect->xmin; mval[1]= disprect->ymin;
+ mval[0] = disprect->xmin; mval[1] = disprect->ymin;
areamouseco_to_ipoco(v2d, mval, &dispf.xmin, &dispf.ymin);
- mval[0]= disprect->xmax; mval[1]= disprect->ymax;
+ mval[0] = disprect->xmax; mval[1] = disprect->ymax;
areamouseco_to_ipoco(v2d, mval, &dispf.xmax, &dispf.ymax);
/* map to render coordinates */
- disprect->xmin= dispf.xmin;
- disprect->xmax= dispf.xmax;
- disprect->ymin= dispf.ymin;
- disprect->ymax= dispf.ymax;
+ disprect->xmin = dispf.xmin;
+ disprect->xmax = dispf.xmax;
+ disprect->ymin = dispf.ymin;
+ disprect->ymax = dispf.ymax;
CLAMP(disprect->xmin, 0, winx);
CLAMP(disprect->xmax, 0, winx);
@@ -304,43 +303,43 @@ static void preview_cb(struct ScrArea *sa, struct uiBlock *block)
static int is_preview_allowed(ScrArea *cur)
{
- SpaceImage *sima= cur->spacedata.first;
+ SpaceImage *sima = cur->spacedata.first;
ScrArea *sa;
/* check if another areawindow has preview set */
- for(sa=G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa!=cur && sa->spacetype==SPACE_IMAGE) {
- if(image_preview_active(sa, NULL, NULL))
+ for (sa = G.curscreen->areabase.first; sa; sa = sa->next) {
+ if (sa != cur && sa->spacetype == SPACE_IMAGE) {
+ if (image_preview_active(sa, NULL, NULL))
return 0;
}
}
/* check image type */
- if(sima->image==NULL || sima->image->type!=IMA_TYPE_COMPOSITE)
+ if (sima->image == NULL || sima->image->type != IMA_TYPE_COMPOSITE)
return 0;
return 1;
}
-static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PREVIEW
+static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PREVIEW
{
uiBlock *block;
- SpaceImage *sima= sa->spacedata.first;
+ SpaceImage *sima = sa->spacedata.first;
int ofsx, ofsy;
- if(is_preview_allowed(sa)==0) {
+ if (is_preview_allowed(sa) == 0) {
rem_blockhandler(sa, IMAGE_HANDLER_PREVIEW);
- G.scene->r.scemode &= ~R_COMP_CROP; /* quite weak */
+ G.scene->r.scemode &= ~R_COMP_CROP; /* quite weak */
return;
}
- 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(IMAGE_HANDLER_PREVIEW); // for close and esc
- ofsx= -150+(sa->winx/2)/sima->blockscale;
- ofsy= -100+(sa->winy/2)/sima->blockscale;
- if(uiNewPanel(C, ar, block, "Preview", "Image", ofsx, ofsy, 300, 200)==0) return;
+ ofsx = -150 + (sa->winx / 2) / sima->blockscale;
+ ofsy = -100 + (sa->winy / 2) / sima->blockscale;
+ if (uiNewPanel(C, ar, block, "Preview", "Image", ofsx, ofsy, 300, 200) == 0) return;
uiBlockSetDrawExtraFunc(block, preview_cb);
@@ -355,13 +354,13 @@ static char *slot_menu(void)
char *str;
int a, slot;
- str= MEM_callocN(IMA_MAX_RENDER_SLOT*32, "menu slots");
+ str = MEM_callocN(IMA_MAX_RENDER_SLOT * 32, "menu slots");
strcpy(str, "Slot %t");
- a= strlen(str);
+ a = strlen(str);
- for(slot=0; slot<IMA_MAX_RENDER_SLOT; slot++)
- a += sprintf(str+a, "|Slot %d %%x%d", slot+1, slot);
+ for (slot = 0; slot < IMA_MAX_RENDER_SLOT; slot++)
+ a += sprintf(str + a, "|Slot %d %%x%d", slot + 1, slot);
return str;
}
@@ -370,24 +369,24 @@ static char *slot_menu(void)
static char *layer_menu(RenderResult *rr, short *UNUSED(curlay))
{
RenderLayer *rl;
- int len= 64 + 32*BLI_countlist(&rr->layers);
- short a, nr= 0;
- char *str= MEM_callocN(len, "menu layers");
+ int len = 64 + 32 * BLI_countlist(&rr->layers);
+ short a, nr = 0;
+ char *str = MEM_callocN(len, "menu layers");
strcpy(str, "Layer %t");
- a= strlen(str);
+ a = strlen(str);
/* compo result */
- if(rr->rectf) {
- a+= sprintf(str+a, "|Composite %%x0");
- nr= 1;
+ if (rr->rectf) {
+ a += sprintf(str + a, "|Composite %%x0");
+ nr = 1;
}
- else if(rr->rect32) {
- a+= sprintf(str+a, "|Sequence %%x0");
- nr= 1;
+ else if (rr->rect32) {
+ a += sprintf(str + a, "|Sequence %%x0");
+ nr = 1;
}
- for(rl= rr->layers.first; rl; rl= rl->next, nr++) {
- a+= sprintf(str+a, "|%s %%x%d", rl->name, nr);
+ for (rl = rr->layers.first; rl; rl = rl->next, nr++) {
+ a += sprintf(str + a, "|%s %%x%d", rl->name, nr);
}
/* no curlay clip here, on render (redraws) the amount of layers can be 1 fir single-layer render */
@@ -399,36 +398,36 @@ static char *layer_menu(RenderResult *rr, short *UNUSED(curlay))
static char *pass_menu(RenderLayer *rl, short *curpass)
{
RenderPass *rpass;
- int len= 64 + 32*(rl?BLI_countlist(&rl->passes):1);
- short a, nr= 0;
- char *str= MEM_callocN(len, "menu layers");
+ int len = 64 + 32 * (rl ? BLI_countlist(&rl->passes) : 1);
+ short a, nr = 0;
+ char *str = MEM_callocN(len, "menu layers");
strcpy(str, "Pass %t");
- a= strlen(str);
+ a = strlen(str);
/* rendered results don't have a Combined pass */
- if(rl==NULL || rl->rectf) {
- a+= sprintf(str+a, "|Combined %%x0");
- nr= 1;
+ if (rl == NULL || rl->rectf) {
+ a += sprintf(str + a, "|Combined %%x0");
+ nr = 1;
}
- if(rl)
- for(rpass= rl->passes.first; rpass; rpass= rpass->next, nr++)
- a+= sprintf(str+a, "|%s %%x%d", rpass->name, nr);
+ if (rl)
+ for (rpass = rl->passes.first; rpass; rpass = rpass->next, nr++)
+ a += sprintf(str + a, "|%s %%x%d", rpass->name, nr);
- if(*curpass >= nr)
- *curpass= 0;
+ if (*curpass >= nr)
+ *curpass = 0;
return str;
}
static void set_frames_cb(bContext *C, void *ima_v, void *iuser_v)
{
- Scene *scene= CTX_data_scene(C);
- Image *ima= ima_v;
- ImageUser *iuser= iuser_v;
+ Scene *scene = CTX_data_scene(C);
+ Image *ima = ima_v;
+ ImageUser *iuser = iuser_v;
- if(ima->anim) {
+ if (ima->anim) {
iuser->frames = IMB_anim_get_duration(ima->anim, IMB_TC_RECORD_RUN);
BKE_image_user_calc_frame(iuser, scene->r.cfra, 0);
}
@@ -437,70 +436,70 @@ static void set_frames_cb(bContext *C, void *ima_v, void *iuser_v)
/* 5 layer button callbacks... */
static void image_multi_cb(bContext *C, void *rr_v, void *iuser_v)
{
- ImageUser *iuser= iuser_v;
+ ImageUser *iuser = iuser_v;
BKE_image_multilayer_index(rr_v, iuser);
- WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL);
+ WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
}
static void image_multi_inclay_cb(bContext *C, void *rr_v, void *iuser_v)
{
- RenderResult *rr= rr_v;
- ImageUser *iuser= iuser_v;
- int tot= BLI_countlist(&rr->layers);
+ RenderResult *rr = rr_v;
+ ImageUser *iuser = iuser_v;
+ int tot = BLI_countlist(&rr->layers);
- if(rr->rectf || rr->rect32)
- tot++; /* fake compo/sequencer layer */
+ if (rr->rectf || rr->rect32)
+ tot++; /* fake compo/sequencer layer */
- if(iuser->layer<tot-1) {
+ if (iuser->layer < tot - 1) {
iuser->layer++;
BKE_image_multilayer_index(rr, iuser);
- WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL);
+ WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
}
}
static void image_multi_declay_cb(bContext *C, void *rr_v, void *iuser_v)
{
- ImageUser *iuser= iuser_v;
+ ImageUser *iuser = iuser_v;
- if(iuser->layer>0) {
+ if (iuser->layer > 0) {
iuser->layer--;
BKE_image_multilayer_index(rr_v, iuser);
- WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL);
+ WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
}
}
static void image_multi_incpass_cb(bContext *C, void *rr_v, void *iuser_v)
{
- RenderResult *rr= rr_v;
- ImageUser *iuser= iuser_v;
- RenderLayer *rl= BLI_findlink(&rr->layers, iuser->layer);
+ RenderResult *rr = rr_v;
+ ImageUser *iuser = iuser_v;
+ RenderLayer *rl = BLI_findlink(&rr->layers, iuser->layer);
- if(rl) {
- int tot= BLI_countlist(&rl->passes);
+ if (rl) {
+ int tot = BLI_countlist(&rl->passes);
- if(rr->rectf || rr->rect32)
- tot++; /* fake compo/sequencer layer */
+ if (rr->rectf || rr->rect32)
+ tot++; /* fake compo/sequencer layer */
- if(iuser->pass<tot-1) {
+ if (iuser->pass < tot - 1) {
iuser->pass++;
BKE_image_multilayer_index(rr, iuser);
- WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL);
+ WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
}
}
}
static void image_multi_decpass_cb(bContext *C, void *rr_v, void *iuser_v)
{
- ImageUser *iuser= iuser_v;
+ ImageUser *iuser = iuser_v;
- if(iuser->pass>0) {
+ if (iuser->pass > 0) {
iuser->pass--;
BKE_image_multilayer_index(rr_v, iuser);
- WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL);
+ WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
}
}
#if 0
static void image_freecache_cb(bContext *C, void *ima_v, void *unused)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
BKE_image_free_anim_ibufs(ima_v, scene->r.cfra);
WM_event_add_notifier(C, NC_IMAGE, ima_v);
}
@@ -509,47 +508,47 @@ static void image_freecache_cb(bContext *C, void *ima_v, void *unused)
#if 0
static void image_user_change(bContext *C, void *iuser_v, void *unused)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
BKE_image_user_calc_imanr(iuser_v, scene->r.cfra, 0);
}
#endif
static void uiblock_layer_pass_buttons(uiLayout *layout, RenderResult *rr, ImageUser *iuser, int w, short *render_slot)
{
- uiBlock *block= uiLayoutGetBlock(layout);
+ uiBlock *block = uiLayoutGetBlock(layout);
uiBut *but;
- RenderLayer *rl= NULL;
+ RenderLayer *rl = NULL;
int wmenu1, wmenu2, wmenu3, layer;
char *strp;
uiLayoutRow(layout, 1);
/* layer menu is 1/3 larger than pass */
- wmenu1= (2*w)/5;
- wmenu2= (3*w)/5;
- wmenu3= (3*w)/6;
+ wmenu1 = (2 * w) / 5;
+ wmenu2 = (3 * w) / 5;
+ wmenu3 = (3 * w) / 6;
/* menu buts */
- if(render_slot) {
- strp= slot_menu();
- but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu1, UI_UNIT_Y, render_slot, 0,0,0,0, "Select Slot");
+ if (render_slot) {
+ strp = slot_menu();
+ but = uiDefButS(block, MENU, 0, strp, 0, 0, wmenu1, UI_UNIT_Y, render_slot, 0, 0, 0, 0, "Select Slot");
uiButSetFunc(but, image_multi_cb, rr, iuser);
MEM_freeN(strp);
}
- if(rr) {
- strp= layer_menu(rr, &iuser->layer);
- but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu2, UI_UNIT_Y, &iuser->layer, 0,0,0,0, "Select Layer");
+ if (rr) {
+ strp = layer_menu(rr, &iuser->layer);
+ but = uiDefButS(block, MENU, 0, strp, 0, 0, wmenu2, UI_UNIT_Y, &iuser->layer, 0, 0, 0, 0, "Select Layer");
uiButSetFunc(but, image_multi_cb, rr, iuser);
MEM_freeN(strp);
layer = iuser->layer;
- if(rr->rectf || rr->rect32)
- layer--; /* fake compo/sequencer layer */
+ if (rr->rectf || rr->rect32)
+ layer--; /* fake compo/sequencer layer */
- rl= BLI_findlink(&rr->layers, layer); /* return NULL is meant to be */
- strp= pass_menu(rl, &iuser->pass);
- but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu3, UI_UNIT_Y, &iuser->pass, 0,0,0,0, "Select Pass");
+ rl = BLI_findlink(&rr->layers, layer); /* return NULL is meant to be */
+ strp = pass_menu(rl, &iuser->pass);
+ but = uiDefButS(block, MENU, 0, strp, 0, 0, wmenu3, UI_UNIT_Y, &iuser->pass, 0, 0, 0, 0, "Select Pass");
uiButSetFunc(but, image_multi_cb, rr, iuser);
MEM_freeN(strp);
}
@@ -557,32 +556,32 @@ static void uiblock_layer_pass_buttons(uiLayout *layout, RenderResult *rr, Image
static void uiblock_layer_pass_arrow_buttons(uiLayout *layout, RenderResult *rr, ImageUser *iuser, short *render_slot)
{
- uiBlock *block= uiLayoutGetBlock(layout);
+ uiBlock *block = uiLayoutGetBlock(layout);
uiLayout *row;
uiBut *but;
- const float dpi_fac= UI_DPI_FAC;
+ const float dpi_fac = UI_DPI_FAC;
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
- if(rr==NULL || iuser==NULL)
+ if (rr == NULL || iuser == NULL)
return;
- if(rr->layers.first==NULL) {
+ if (rr->layers.first == NULL) {
uiItemL(row, "No Layers in Render Result", ICON_NONE);
return;
}
/* decrease, increase arrows */
- but= uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT, 0,0,17,20, NULL, 0, 0, 0, 0, "Previous Layer");
+ but = uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT, 0, 0, 17, 20, NULL, 0, 0, 0, 0, "Previous Layer");
uiButSetFunc(but, image_multi_declay_cb, rr, iuser);
- but= uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT, 0,0,18,20, NULL, 0, 0, 0, 0, "Next Layer");
+ but = uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT, 0, 0, 18, 20, NULL, 0, 0, 0, 0, "Next Layer");
uiButSetFunc(but, image_multi_inclay_cb, rr, iuser);
uiblock_layer_pass_buttons(row, rr, iuser, 230 * dpi_fac, render_slot);
/* decrease, increase arrows */
- but= uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT, 0,0,17,20, NULL, 0, 0, 0, 0, "Previous Pass");
+ but = uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT, 0, 0, 17, 20, NULL, 0, 0, 0, 0, "Previous Pass");
uiButSetFunc(but, image_multi_decpass_cb, rr, iuser);
- but= uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT, 0,0,18,20, NULL, 0, 0, 0, 0, "Next Pass");
+ but = uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT, 0, 0, 18, 20, NULL, 0, 0, 0, 0, "Next Pass");
uiButSetFunc(but, image_multi_incpass_cb, rr, iuser);
uiBlockEndAlign(block);
@@ -599,15 +598,15 @@ typedef struct RNAUpdateCb {
static void rna_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg))
{
- RNAUpdateCb *cb= (RNAUpdateCb*)arg_cb;
+ 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 */
- cb->iuser->ok= 1;
+ * 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);
}
@@ -619,80 +618,80 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
Image *ima;
ImageUser *iuser;
ImBuf *ibuf;
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
uiLayout *row, *split, *col;
uiBlock *block;
uiBut *but;
char str[128];
void *lock;
- if(!ptr->data)
+ if (!ptr->data)
return;
- prop= RNA_struct_find_property(ptr, propname);
- if(!prop) {
+ prop = RNA_struct_find_property(ptr, propname);
+ if (!prop) {
printf("%s: property not found: %s.%s\n",
__func__, RNA_struct_identifier(ptr->type), propname);
return;
}
- if(RNA_property_type(prop) != PROP_POINTER) {
+ if (RNA_property_type(prop) != PROP_POINTER) {
printf("%s: expected pointer property for %s.%s\n",
__func__, RNA_struct_identifier(ptr->type), propname);
return;
}
- block= uiLayoutGetBlock(layout);
+ block = uiLayoutGetBlock(layout);
- imaptr= RNA_property_pointer_get(ptr, prop);
- ima= imaptr.data;
- iuser= userptr->data;
+ imaptr = RNA_property_pointer_get(ptr, prop);
+ ima = imaptr.data;
+ iuser = userptr->data;
- cb= MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb");
- cb->ptr= *ptr;
- cb->prop= prop;
- cb->iuser= iuser;
+ cb = MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb");
+ cb->ptr = *ptr;
+ cb->prop = prop;
+ cb->iuser = iuser;
uiLayoutSetContextPointer(layout, "edit_image", &imaptr);
- if(!compact)
+ if (!compact)
uiTemplateID(layout, C, ptr, propname, "IMAGE_OT_new", "IMAGE_OT_open", NULL);
- if(ima) {
+ if (ima) {
uiBlockSetNFunc(block, rna_update_cb, MEM_dupallocN(cb), NULL);
- if(ima->source == IMA_SRC_VIEWER) {
- ibuf= BKE_image_acquire_ibuf(ima, iuser, &lock);
+ if (ima->source == IMA_SRC_VIEWER) {
+ ibuf = BKE_image_acquire_ibuf(ima, iuser, &lock);
image_info(scene, iuser, ima, ibuf, str);
BKE_image_release_ibuf(ima, lock);
- uiItemL(layout, ima->id.name+2, ICON_NONE);
+ uiItemL(layout, ima->id.name + 2, ICON_NONE);
uiItemL(layout, str, ICON_NONE);
- if(ima->type==IMA_TYPE_COMPOSITE) {
+ if (ima->type == IMA_TYPE_COMPOSITE) {
// XXX not working yet
#if 0
- iuser= ntree_get_active_iuser(scene->nodetree);
- if(iuser) {
+ iuser = ntree_get_active_iuser(scene->nodetree);
+ if (iuser) {
uiBlockBeginAlign(block);
- uiDefIconTextBut(block, BUT, B_SIMA_RECORD, ICON_REC, "Record", 10,120,100,20, 0, 0, 0, 0, 0, "");
- uiDefIconTextBut(block, BUT, B_SIMA_PLAY, ICON_PLAY, "Play", 110,120,100,20, 0, 0, 0, 0, 0, "");
- but= uiDefBut(block, BUT, B_NOP, "Free Cache", 210,120,100,20, 0, 0, 0, 0, 0, "");
+ uiDefIconTextBut(block, BUT, B_SIMA_RECORD, ICON_REC, "Record", 10, 120, 100, 20, 0, 0, 0, 0, 0, "");
+ uiDefIconTextBut(block, BUT, B_SIMA_PLAY, ICON_PLAY, "Play", 110, 120, 100, 20, 0, 0, 0, 0, 0, "");
+ but = uiDefBut(block, BUT, B_NOP, "Free Cache", 210, 120, 100, 20, 0, 0, 0, 0, 0, "");
uiButSetFunc(but, image_freecache_cb, ima, NULL);
- if(iuser->frames)
+ if (iuser->frames)
BLI_snprintf(str, sizeof(str), "(%d) Frames:", iuser->framenr);
else strcpy(str, "Frames:");
uiBlockBeginAlign(block);
- uiDefButI(block, NUM, imagechanged, str, 10, 90,150, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Number of images of a movie to use");
- uiDefButI(block, NUM, imagechanged, "StartFr:", 160,90,150,20, &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Global starting frame of the movie");
+ uiDefButI(block, NUM, imagechanged, str, 10, 90, 150, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Number of images of a movie to use");
+ uiDefButI(block, NUM, imagechanged, "StartFr:", 160, 90, 150, 20, &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Global starting frame of the movie");
}
#endif
}
- else if(ima->type==IMA_TYPE_R_RESULT) {
+ else if (ima->type == IMA_TYPE_R_RESULT) {
/* browse layer/passes */
- Render *re= RE_GetRender(scene->id.name);
- RenderResult *rr= RE_AcquireResultRead(re);
+ Render *re = RE_GetRender(scene->id.name);
+ RenderResult *rr = RE_AcquireResultRead(re);
uiblock_layer_pass_arrow_buttons(layout, rr, iuser, &ima->render_slot);
RE_ReleaseResult(re);
}
@@ -700,24 +699,24 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
else {
uiItemR(layout, &imaptr, "source", 0, NULL, ICON_NONE);
- if(ima->source != IMA_SRC_GENERATED) {
- row= uiLayoutRow(layout, 1);
+ if (ima->source != IMA_SRC_GENERATED) {
+ row = uiLayoutRow(layout, 1);
if (ima->packedfile)
uiItemO(row, "", ICON_PACKAGE, "image.unpack");
else
uiItemO(row, "", ICON_UGLYPACKAGE, "image.pack");
- row= uiLayoutRow(row, 0);
- uiLayoutSetEnabled(row, ima->packedfile==NULL);
+ row = uiLayoutRow(row, 0);
+ uiLayoutSetEnabled(row, ima->packedfile == NULL);
uiItemR(row, &imaptr, "filepath", 0, "", ICON_NONE);
uiItemO(row, "", ICON_FILE_REFRESH, "image.reload");
}
// XXX what was this for?
#if 0
- /* check for re-render, only buttons */
- if(imagechanged==B_IMAGECHANGED) {
- if(iuser->flag & IMA_ANIM_REFRESHED) {
+ /* check for re-render, only buttons */
+ if (imagechanged == B_IMAGECHANGED) {
+ if (iuser->flag & IMA_ANIM_REFRESHED) {
iuser->flag &= ~IMA_ANIM_REFRESHED;
WM_event_add_notifier(C, NC_IMAGE, ima);
}
@@ -725,65 +724,65 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
#endif
/* multilayer? */
- if(ima->type==IMA_TYPE_MULTILAYER && ima->rr) {
+ if (ima->type == IMA_TYPE_MULTILAYER && ima->rr) {
uiblock_layer_pass_arrow_buttons(layout, ima->rr, iuser, NULL);
}
- else if(ima->source != IMA_SRC_GENERATED) {
- if(compact == 0) {
- ibuf= BKE_image_acquire_ibuf(ima, iuser, &lock);
+ else if (ima->source != IMA_SRC_GENERATED) {
+ if (compact == 0) {
+ ibuf = BKE_image_acquire_ibuf(ima, iuser, &lock);
image_info(scene, iuser, ima, ibuf, str);
BKE_image_release_ibuf(ima, lock);
uiItemL(layout, str, ICON_NONE);
}
}
- if(ima->source != IMA_SRC_GENERATED) {
- if(compact == 0) { /* background image view doesnt need these */
+ if (ima->source != IMA_SRC_GENERATED) {
+ if (compact == 0) { /* background image view doesnt need these */
uiItemS(layout);
- split= uiLayoutSplit(layout, 0, 0);
+ split = uiLayoutSplit(layout, 0, 0);
- col= uiLayoutColumn(split, 0);
+ col = uiLayoutColumn(split, 0);
uiItemR(col, &imaptr, "use_fields", 0, NULL, ICON_NONE);
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiLayoutSetActive(row, RNA_boolean_get(&imaptr, "use_fields"));
uiItemR(row, &imaptr, "field_order", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
- row= uiLayoutRow(layout, 0);
+ row = uiLayoutRow(layout, 0);
uiItemR(row, &imaptr, "use_premultiply", 0, NULL, ICON_NONE);
uiItemR(row, &imaptr, "use_color_unpremultiply", 0, NULL, ICON_NONE);
}
}
- if(ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
+ if (ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
uiItemS(layout);
- split= uiLayoutSplit(layout, 0, 0);
+ split = uiLayoutSplit(layout, 0, 0);
- col= uiLayoutColumn(split, 0);
+ col = uiLayoutColumn(split, 0);
BLI_snprintf(str, sizeof(str), "(%d) Frames", iuser->framenr);
uiItemR(col, userptr, "frame_duration", 0, str, ICON_NONE);
- if(ima->anim) {
- block= uiLayoutGetBlock(col);
- but= uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence");
+ if (ima->anim) {
+ block = uiLayoutGetBlock(col);
+ but = uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X * 2, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence");
uiButSetFunc(but, set_frames_cb, ima, iuser);
}
uiItemR(col, userptr, "frame_start", 0, "Start", ICON_NONE);
uiItemR(col, userptr, "frame_offset", 0, NULL, ICON_NONE);
- col= uiLayoutColumn(split, 0);
- row= uiLayoutRow(col, 0);
+ col = uiLayoutColumn(split, 0);
+ row = uiLayoutRow(col, 0);
uiLayoutSetActive(row, RNA_boolean_get(&imaptr, "use_fields"));
uiItemR(row, userptr, "fields_per_frame", 0, "Fields", ICON_NONE);
uiItemR(col, userptr, "use_auto_refresh", 0, NULL, ICON_NONE);
uiItemR(col, userptr, "use_cyclic", 0, NULL, ICON_NONE);
}
- else if(ima->source==IMA_SRC_GENERATED) {
- split= uiLayoutSplit(layout, 0, 0);
+ else if (ima->source == IMA_SRC_GENERATED) {
+ split = uiLayoutSplit(layout, 0, 0);
- col= uiLayoutColumn(split, 1);
+ col = uiLayoutColumn(split, 1);
uiItemR(col, &imaptr, "generated_width", 0, "X", ICON_NONE);
uiItemR(col, &imaptr, "generated_height", 0, "Y", ICON_NONE);
uiItemR(col, &imaptr, "use_generated_float", 0, NULL, ICON_NONE);
@@ -791,7 +790,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
uiItemR(split, &imaptr, "generated_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
}
- }
+ }
uiBlockSetNFunc(block, NULL, NULL, NULL);
}
@@ -801,32 +800,32 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr)
{
- ImageFormatData *imf= imfptr->data;
- ID *id= imfptr->id.data;
- const int depth_ok= BKE_imtype_valid_depths(imf->imtype);
+ ImageFormatData *imf = imfptr->data;
+ ID *id = imfptr->id.data;
+ const int depth_ok = BKE_imtype_valid_depths(imf->imtype);
/* some settings depend on this being a scene thats rendered */
- const short is_render_out= (id && GS(id->name) == ID_SCE);
+ const short is_render_out = (id && GS(id->name) == ID_SCE);
uiLayout *col, *row, *split, *sub;
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
- split= uiLayoutSplit(col, 0.5f, 0);
+ split = uiLayoutSplit(col, 0.5f, 0);
uiItemR(split, imfptr, "file_format", 0, "", ICON_NONE);
- sub= uiLayoutRow(split, 0);
+ sub = uiLayoutRow(split, 0);
uiItemR(sub, imfptr, "color_mode", UI_ITEM_R_EXPAND, "Color", ICON_NONE);
/* only display depth setting if multiple depths can be used */
- if((ELEM6(depth_ok,
- R_IMF_CHAN_DEPTH_1,
- R_IMF_CHAN_DEPTH_8,
- R_IMF_CHAN_DEPTH_12,
- R_IMF_CHAN_DEPTH_16,
- R_IMF_CHAN_DEPTH_24,
- R_IMF_CHAN_DEPTH_32)) == 0)
+ if ((ELEM6(depth_ok,
+ R_IMF_CHAN_DEPTH_1,
+ R_IMF_CHAN_DEPTH_8,
+ R_IMF_CHAN_DEPTH_12,
+ R_IMF_CHAN_DEPTH_16,
+ R_IMF_CHAN_DEPTH_24,
+ R_IMF_CHAN_DEPTH_32)) == 0)
{
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, imfptr, "color_depth", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
}
@@ -842,7 +841,7 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr)
uiItemR(col, imfptr, "exr_codec", 0, NULL, ICON_NONE);
}
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
if (BKE_imtype_supports_zbuf(imf->imtype)) {
uiItemR(row, imfptr, "use_zbuffer", 0, NULL, ICON_NONE);
}
@@ -852,7 +851,7 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr)
}
if (imf->imtype == R_IMF_IMTYPE_JP2) {
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, imfptr, "use_jpeg2k_cinema_preset", 0, NULL, ICON_NONE);
uiItemR(row, imfptr, "use_jpeg2k_cinema_48", 0, NULL, ICON_NONE);
@@ -873,15 +872,17 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr)
void uiTemplateImageLayers(uiLayout *layout, bContext *C, Image *ima, ImageUser *iuser)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
+ Render *re;
RenderResult *rr;
/* render layers and passes */
- if(ima && iuser) {
- const float dpi_fac= UI_DPI_FAC;
- rr= BKE_image_acquire_renderresult(scene, ima);
- uiblock_layer_pass_buttons(layout, rr, iuser, 160 * dpi_fac, (ima->type==IMA_TYPE_R_RESULT)? &ima->render_slot: NULL);
- BKE_image_release_renderresult(scene, ima);
+ if (ima && iuser) {
+ const float dpi_fac = UI_DPI_FAC;
+ re = RE_GetRender(scene->id.name);
+ rr = RE_AcquireResultRead(re);
+ uiblock_layer_pass_buttons(layout, rr, iuser, 160 * dpi_fac, (ima->type == IMA_TYPE_R_RESULT) ? &ima->render_slot : NULL);
+ RE_ReleaseResult(re);
}
}
@@ -889,27 +890,27 @@ void image_buttons_register(ARegionType *art)
{
PanelType *pt;
- pt= MEM_callocN(sizeof(PanelType), "spacetype image panel curves");
+ pt = MEM_callocN(sizeof(PanelType), "spacetype image panel curves");
strcpy(pt->idname, "IMAGE_PT_curves");
strcpy(pt->label, "Curves");
- pt->draw= image_panel_curves;
- pt->poll= image_panel_poll;
+ pt->draw = image_panel_curves;
+ pt->poll = image_panel_poll;
pt->flag |= PNL_DEFAULT_CLOSED;
BLI_addtail(&art->paneltypes, pt);
- pt= MEM_callocN(sizeof(PanelType), "spacetype image panel gpencil");
+ pt = MEM_callocN(sizeof(PanelType), "spacetype image panel gpencil");
strcpy(pt->idname, "IMAGE_PT_gpencil");
strcpy(pt->label, "Grease Pencil");
- pt->draw= gpencil_panel_standard;
+ pt->draw = gpencil_panel_standard;
BLI_addtail(&art->paneltypes, pt);
}
static int image_properties(bContext *C, wmOperator *UNUSED(op))
{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= image_has_buttons_region(sa);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = image_has_buttons_region(sa);
- if(ar)
+ if (ar)
ED_region_toggle_hidden(C, ar);
return OPERATOR_FINISHED;
@@ -917,23 +918,23 @@ static int image_properties(bContext *C, wmOperator *UNUSED(op))
void IMAGE_OT_properties(wmOperatorType *ot)
{
- ot->name= "Properties";
- ot->idname= "IMAGE_OT_properties";
- ot->description= "Toggle display properties panel";
+ ot->name = "Properties";
+ ot->idname = "IMAGE_OT_properties";
+ ot->description = "Toggle display properties panel";
- ot->exec= image_properties;
- ot->poll= ED_operator_image_active;
+ ot->exec = image_properties;
+ ot->poll = ED_operator_image_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
static int image_scopes(bContext *C, wmOperator *UNUSED(op))
{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= image_has_scope_region(sa);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = image_has_scope_region(sa);
- if(ar)
+ if (ar)
ED_region_toggle_hidden(C, ar);
return OPERATOR_FINISHED;
@@ -941,14 +942,14 @@ static int image_scopes(bContext *C, wmOperator *UNUSED(op))
void IMAGE_OT_scopes(wmOperatorType *ot)
{
- ot->name= "Scopes";
- ot->idname= "IMAGE_OT_scopes";
- ot->description= "Toggle display scopes panel";
+ ot->name = "Scopes";
+ ot->idname = "IMAGE_OT_scopes";
+ ot->description = "Toggle display scopes panel";
- ot->exec= image_scopes;
- ot->poll= ED_operator_image_active;
+ ot->exec = image_scopes;
+ ot->poll = ED_operator_image_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 9ec9c5ef0e0..29bd5f5117d 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -79,15 +79,15 @@
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
- */
-
- if(ibuf->rect_float && (ibuf->rect==NULL || (ibuf->userflags & IB_RECT_INVALID)) ) {
- if(color_manage) {
- if(ima && ima->source == IMA_SRC_VIEWER)
+ * ibuf->rect is zero for compositor and render results after change
+ * convert to 32 bits always... drawing float rects isn't 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) {
+ if (ima && ima->source == IMA_SRC_VIEWER)
ibuf->profile = IB_PROFILE_LINEAR_RGB;
}
else
@@ -101,9 +101,9 @@ static void draw_render_info(Scene *scene, Image *ima, ARegion *ar)
{
RenderResult *rr;
- rr= BKE_image_acquire_renderresult(scene, ima);
+ rr = BKE_image_acquire_renderresult(scene, ima);
- if(rr && rr->text) {
+ if (rr && rr->text) {
ED_region_info_draw(ar, rr->text, 1, 0.25);
}
@@ -115,7 +115,7 @@ void ED_image_draw_info(ARegion *ar, int color_manage, int channels, int x, int
const unsigned char cp[4], const float fp[4], int *zp, float *zpf)
{
char str[256];
- float dx= 6;
+ float dx = 6;
/* text colors */
/* XXX colored text not allowed in Blender UI */
#if 0
@@ -127,10 +127,10 @@ void ED_image_draw_info(ARegion *ar, int color_manage, int channels, int x, int
unsigned char green[3] = {255, 255, 255};
unsigned char blue[3] = {255, 255, 255};
#endif
- float hue=0, sat=0, val=0, lum=0, u=0, v=0;
+ float hue = 0, sat = 0, val = 0, lum = 0, u = 0, v = 0;
float col[4], finalcol[4];
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
/* noisy, high contrast make impossible to read if lower alpha is used. */
@@ -147,14 +147,14 @@ void ED_image_draw_info(ARegion *ar, int color_manage, int channels, int x, int
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
- if(zp) {
+ if (zp) {
glColor3ub(255, 255, 255);
- BLI_snprintf(str, sizeof(str), " Z:%-.4f |", 0.5f+0.5f*(((float)*zp)/(float)0x7fffffff));
+ BLI_snprintf(str, sizeof(str), " Z:%-.4f |", 0.5f + 0.5f * (((float)*zp) / (float)0x7fffffff));
BLF_position(blf_mono_font, dx, 6, 0);
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
}
- if(zpf) {
+ if (zpf) {
glColor3ub(255, 255, 255);
BLI_snprintf(str, sizeof(str), " Z:%-.3f |", *zpf);
BLF_position(blf_mono_font, dx, 6, 0);
@@ -162,7 +162,7 @@ void ED_image_draw_info(ARegion *ar, int color_manage, int channels, int x, int
dx += BLF_width(blf_mono_font, str);
}
- if(channels >= 3) {
+ if (channels >= 3) {
glColor3ubv(red);
if (fp)
BLI_snprintf(str, sizeof(str), " R:%-.4f", fp[0]);
@@ -196,7 +196,7 @@ void ED_image_draw_info(ARegion *ar, int color_manage, int channels, int x, int
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
- if(channels == 4) {
+ if (channels == 4) {
glColor3ub(255, 255, 255);
if (fp)
BLI_snprintf(str, sizeof(str), " A:%-.4f", fp[3]);
@@ -211,19 +211,19 @@ void ED_image_draw_info(ARegion *ar, int color_manage, int channels, int x, int
}
/* color rectangle */
- if (channels==1) {
+ if (channels == 1) {
if (fp) {
col[0] = col[1] = col[2] = fp[0];
}
else if (cp) {
- col[0] = col[1] = col[2] = (float)cp[0]/255.0f;
+ col[0] = col[1] = col[2] = (float)cp[0] / 255.0f;
}
else {
col[0] = col[1] = col[2] = 0.0f;
}
col[3] = 1.0f;
}
- else if (channels==3) {
+ else if (channels == 3) {
if (fp) {
copy_v3_v3(col, fp);
}
@@ -235,7 +235,7 @@ void ED_image_draw_info(ARegion *ar, int color_manage, int channels, int x, int
}
col[3] = 1.0f;
}
- else if (channels==4) {
+ else if (channels == 4) {
if (fp)
copy_v4_v4(col, fp);
else if (cp) {
@@ -262,20 +262,30 @@ void ED_image_draw_info(ARegion *ar, int color_manage, int channels, int x, int
glBegin(GL_QUADS);
glVertex2f(dx, 3);
glVertex2f(dx, 17);
- glVertex2f(dx+30, 17);
- glVertex2f(dx+30, 3);
+ glVertex2f(dx + 30, 17);
+ glVertex2f(dx + 30, 3);
glEnd();
+
+ /* draw outline */
+ glColor3ub(128, 128, 128);
+ glBegin(GL_LINE_LOOP);
+ glVertex2f(dx, 3);
+ glVertex2f(dx, 17);
+ glVertex2f(dx + 30, 17);
+ glVertex2f(dx + 30, 3);
+ glEnd();
+
dx += 35;
glColor3ub(255, 255, 255);
- if(channels == 1) {
+ if (channels == 1) {
if (fp) {
rgb_to_hsv(fp[0], fp[0], fp[0], &hue, &sat, &val);
rgb_to_yuv(fp[0], fp[0], fp[0], &lum, &u, &v);
}
else if (cp) {
- rgb_to_hsv((float)cp[0]/255.0f, (float)cp[0]/255.0f, (float)cp[0]/255.0f, &hue, &sat, &val);
- rgb_to_yuv((float)cp[0]/255.0f, (float)cp[0]/255.0f, (float)cp[0]/255.0f, &lum, &u, &v);
+ rgb_to_hsv((float)cp[0] / 255.0f, (float)cp[0] / 255.0f, (float)cp[0] / 255.0f, &hue, &sat, &val);
+ rgb_to_yuv((float)cp[0] / 255.0f, (float)cp[0] / 255.0f, (float)cp[0] / 255.0f, &lum, &u, &v);
}
BLI_snprintf(str, sizeof(str), "V:%-.4f", val);
@@ -288,14 +298,14 @@ void ED_image_draw_info(ARegion *ar, int color_manage, int channels, int x, int
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
}
- else if(channels >= 3) {
+ else if (channels >= 3) {
if (fp) {
rgb_to_hsv(fp[0], fp[1], fp[2], &hue, &sat, &val);
rgb_to_yuv(fp[0], fp[1], fp[2], &lum, &u, &v);
}
else if (cp) {
- rgb_to_hsv((float)cp[0]/255.0f, (float)cp[1]/255.0f, (float)cp[2]/255.0f, &hue, &sat, &val);
- rgb_to_yuv((float)cp[0]/255.0f, (float)cp[1]/255.0f, (float)cp[2]/255.0f, &lum, &u, &v);
+ rgb_to_hsv((float)cp[0] / 255.0f, (float)cp[1] / 255.0f, (float)cp[2] / 255.0f, &hue, &sat, &val);
+ rgb_to_yuv((float)cp[0] / 255.0f, (float)cp[1] / 255.0f, (float)cp[2] / 255.0f, &lum, &u, &v);
}
BLI_snprintf(str, sizeof(str), "H:%-.4f", hue);
@@ -326,7 +336,7 @@ void ED_image_draw_info(ARegion *ar, int color_manage, int channels, int x, int
static void draw_image_grid(ARegion *ar, float zoomx, float zoomy)
{
- float gridsize, gridstep= 1.0f/32.0f;
+ float gridsize, gridstep = 1.0f / 32.0f;
float fac, blendfac;
int x1, y1, x2, y2;
@@ -338,80 +348,56 @@ static void draw_image_grid(ARegion *ar, float zoomx, float zoomy)
glRectf(x1, y1, x2, y2);
/* gridsize adapted to zoom level */
- gridsize= 0.5f*(zoomx+zoomy);
- if(gridsize<=0.0f) return;
+ gridsize = 0.5f * (zoomx + zoomy);
+ if (gridsize <= 0.0f) return;
- if(gridsize<1.0f) {
- while(gridsize<1.0f) {
- gridsize*= 4.0f;
- gridstep*= 4.0f;
+ if (gridsize < 1.0f) {
+ while (gridsize < 1.0f) {
+ gridsize *= 4.0f;
+ gridstep *= 4.0f;
}
}
else {
- while(gridsize>=4.0f) {
- gridsize/= 4.0f;
- gridstep/= 4.0f;
+ while (gridsize >= 4.0f) {
+ gridsize /= 4.0f;
+ gridstep /= 4.0f;
}
}
/* the fine resolution level */
- blendfac= 0.25f*gridsize - floorf(0.25f*gridsize);
+ blendfac = 0.25f * gridsize - floorf(0.25f * gridsize);
CLAMP(blendfac, 0.0f, 1.0f);
- UI_ThemeColorShade(TH_BACK, (int)(20.0f*(1.0f-blendfac)));
+ UI_ThemeColorShade(TH_BACK, (int)(20.0f * (1.0f - blendfac)));
- fac= 0.0f;
+ fac = 0.0f;
glBegin(GL_LINES);
- while(fac<1.0f) {
- glVertex2f(x1, y1*(1.0f-fac) + y2*fac);
- glVertex2f(x2, y1*(1.0f-fac) + y2*fac);
- glVertex2f(x1*(1.0f-fac) + x2*fac, y1);
- glVertex2f(x1*(1.0f-fac) + x2*fac, y2);
- fac+= gridstep;
+ while (fac < 1.0f) {
+ glVertex2f(x1, y1 * (1.0f - fac) + y2 * fac);
+ glVertex2f(x2, y1 * (1.0f - fac) + y2 * fac);
+ glVertex2f(x1 * (1.0f - fac) + x2 * fac, y1);
+ glVertex2f(x1 * (1.0f - fac) + x2 * fac, y2);
+ fac += gridstep;
}
/* the large resolution level */
UI_ThemeColor(TH_BACK);
- fac= 0.0f;
- while(fac<1.0f) {
- glVertex2f(x1, y1*(1.0f-fac) + y2*fac);
- glVertex2f(x2, y1*(1.0f-fac) + y2*fac);
- glVertex2f(x1*(1.0f-fac) + x2*fac, y1);
- glVertex2f(x1*(1.0f-fac) + x2*fac, y2);
- fac+= 4.0f*gridstep;
+ fac = 0.0f;
+ while (fac < 1.0f) {
+ glVertex2f(x1, y1 * (1.0f - fac) + y2 * fac);
+ glVertex2f(x2, y1 * (1.0f - fac) + y2 * fac);
+ glVertex2f(x1 * (1.0f - fac) + x2 * fac, y1);
+ glVertex2f(x1 * (1.0f - fac) + x2 * fac, y2);
+ fac += 4.0f * gridstep;
}
glEnd();
}
-static void sima_draw_alpha_backdrop(float x1, float y1, float xsize, float ysize, float zoomx, float zoomy, unsigned char col1[3], unsigned char col2[3])
-{
- GLubyte checker_stipple[32*32/8] =
- {
- 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,
- 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,
- 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,
- 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,
- 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255,
- 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255,
- 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255,
- 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255,
- };
-
- glColor3ubv(col1);
- glRectf(x1, y1, x1 + zoomx*xsize, y1 + zoomy*ysize);
- glColor3ubv(col2);
-
- glEnable(GL_POLYGON_STIPPLE);
- glPolygonStipple(checker_stipple);
- glRectf(x1, y1, x1 + zoomx*xsize, y1 + zoomy*ysize);
- glDisable(GL_POLYGON_STIPPLE);
-}
-
static void sima_draw_alpha_pixels(float x1, float y1, int rectx, int recty, unsigned int *recti)
{
/* swap bytes, so alpha is most significant one, then just draw it as luminance int */
- if(ENDIAN_ORDER == B_ENDIAN)
+ if (ENDIAN_ORDER == B_ENDIAN)
glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_UNSIGNED_INT, recti);
@@ -420,11 +406,11 @@ static void sima_draw_alpha_pixels(float x1, float y1, int rectx, int recty, uns
static void sima_draw_alpha_pixelsf(float x1, float y1, int rectx, int recty, float *rectf)
{
- float *trectf= MEM_mallocN(rectx*recty*4, "temp");
+ float *trectf = MEM_mallocN(rectx * recty * 4, "temp");
int a, b;
- for(a= rectx*recty -1, b= 4*a+3; a>=0; a--, b-=4)
- trectf[a]= rectf[b];
+ for (a = rectx * recty - 1, b = 4 * a + 3; a >= 0; a--, b -= 4)
+ trectf[a] = rectf[b];
glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_FLOAT, trectf);
MEM_freeN(trectf);
@@ -463,26 +449,26 @@ static void sima_draw_zbuffloat_pixels(Scene *scene, float x1, float y1, int rec
float bias, scale, *rectf, clipend;
int a;
- if(scene->camera && scene->camera->type==OB_CAMERA) {
- bias= ((Camera *)scene->camera->data)->clipsta;
- clipend= ((Camera *)scene->camera->data)->clipend;
- scale= 1.0f/(clipend-bias);
+ if (scene->camera && scene->camera->type == OB_CAMERA) {
+ bias = ((Camera *)scene->camera->data)->clipsta;
+ clipend = ((Camera *)scene->camera->data)->clipend;
+ scale = 1.0f / (clipend - bias);
}
else {
- bias= 0.1f;
- scale= 0.01f;
- clipend= 100.0f;
+ bias = 0.1f;
+ scale = 0.01f;
+ clipend = 100.0f;
}
- rectf= MEM_mallocN(rectx*recty*4, "temp");
- for(a= rectx*recty -1; a>=0; a--) {
- if(rect_float[a]>clipend)
- rectf[a]= 0.0f;
- else if(rect_float[a]<bias)
- rectf[a]= 1.0f;
+ rectf = MEM_mallocN(rectx * recty * 4, "temp");
+ for (a = rectx * recty - 1; a >= 0; a--) {
+ if (rect_float[a] > clipend)
+ rectf[a] = 0.0f;
+ else if (rect_float[a] < bias)
+ rectf[a] = 1.0f;
else {
- rectf[a]= 1.0f - (rect_float[a]-bias)*scale;
- rectf[a]*= rectf[a];
+ rectf[a] = 1.0f - (rect_float[a] - bias) * scale;
+ rectf[a] *= rectf[a];
}
}
glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_FLOAT, rectf);
@@ -502,24 +488,23 @@ static void draw_image_buffer(SpaceImage *sima, ARegion *ar, Scene *scene, Image
UI_view2d_to_region_no_clip(&ar->v2d, fx, fy, &x, &y);
/* this part is generic image display */
- if(sima->flag & SI_SHOW_ALPHA) {
- if(ibuf->rect)
+ if (sima->flag & SI_SHOW_ALPHA) {
+ if (ibuf->rect)
sima_draw_alpha_pixels(x, y, ibuf->x, ibuf->y, ibuf->rect);
- else if(ibuf->rect_float && ibuf->channels==4)
+ else if (ibuf->rect_float && ibuf->channels == 4)
sima_draw_alpha_pixelsf(x, y, ibuf->x, ibuf->y, ibuf->rect_float);
}
- else if(sima->flag & SI_SHOW_ZBUF && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1))) {
- if(ibuf->zbuf)
+ else if (sima->flag & SI_SHOW_ZBUF && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels == 1))) {
+ if (ibuf->zbuf)
sima_draw_zbuf_pixels(x, y, ibuf->x, ibuf->y, ibuf->zbuf);
- else if(ibuf->zbuf_float)
+ else if (ibuf->zbuf_float)
sima_draw_zbuffloat_pixels(scene, x, y, ibuf->x, ibuf->y, ibuf->zbuf_float);
- else if(ibuf->channels==1)
+ else if (ibuf->channels == 1)
sima_draw_zbuffloat_pixels(scene, x, y, ibuf->x, ibuf->y, ibuf->rect_float);
}
else {
- if(sima->flag & SI_USE_ALPHA) {
- unsigned char col1[3]= {100, 100, 100}, col2[3]= {160, 160, 160};
- sima_draw_alpha_backdrop(x, y, ibuf->x, ibuf->y, zoomx, zoomy, col1, col2);
+ if (sima->flag & SI_USE_ALPHA) {
+ fdrawcheckerboard(x, y, x + ibuf->x * zoomx, y + ibuf->y * zoomy);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -529,12 +514,14 @@ static void draw_image_buffer(SpaceImage *sima, ARegion *ar, Scene *scene, Image
* convert them, and optionally apply curves */
image_verify_buffer_float(ima, ibuf, color_manage);
- if(ibuf->rect)
+ 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)
+ if (sima->flag & SI_USE_ALPHA)
glDisable(GL_BLEND);
}
@@ -549,17 +536,17 @@ static unsigned int *get_part_from_ibuf(ImBuf *ibuf, short startx, short starty,
/* the right offset in rectot */
- rt= ibuf->rect+ (starty*ibuf->x+ startx);
+ rt = ibuf->rect + (starty * ibuf->x + startx);
- len= (endx-startx);
- heigth= (endy-starty);
+ len = (endx - startx);
+ heigth = (endy - starty);
- rp=rectmain= MEM_mallocN(heigth*len*sizeof(int), "rect");
+ rp = rectmain = MEM_mallocN(heigth * len * sizeof(int), "rect");
- for(y=0; y<heigth; y++) {
- memcpy(rp, rt, len*4);
- rt+= ibuf->x;
- rp+= len;
+ for (y = 0; y < heigth; y++) {
+ memcpy(rp, rt, len * 4);
+ rt += ibuf->x;
+ rp += len;
}
return rectmain;
}
@@ -571,28 +558,28 @@ static void draw_image_buffer_tiled(SpaceImage *sima, ARegion *ar, Scene *scene,
int color_manage = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT;
/* verify valid values, just leave this a while */
- if(ima->xrep<1) return;
- if(ima->yrep<1) return;
+ if (ima->xrep < 1) return;
+ if (ima->yrep < 1) return;
glPixelZoom(zoomx, zoomy);
- if(sima->curtile >= ima->xrep*ima->yrep)
- sima->curtile = ima->xrep*ima->yrep - 1;
+ if (sima->curtile >= ima->xrep * ima->yrep)
+ sima->curtile = ima->xrep * ima->yrep - 1;
/* create char buffer from float if needed */
image_verify_buffer_float(ima, ibuf, color_manage);
/* retrieve part of image buffer */
- dx= ibuf->x/ima->xrep;
- dy= ibuf->y/ima->yrep;
- sx= (sima->curtile % ima->xrep)*dx;
- sy= (sima->curtile / ima->xrep)*dy;
- rect= get_part_from_ibuf(ibuf, sx, sy, sx+dx, sy+dy);
+ dx = ibuf->x / ima->xrep;
+ dy = ibuf->y / ima->yrep;
+ sx = (sima->curtile % ima->xrep) * dx;
+ sy = (sima->curtile / ima->xrep) * dy;
+ rect = get_part_from_ibuf(ibuf, sx, sy, sx + dx, sy + dy);
/* draw repeated */
- for(sy=0; sy+dy<=ibuf->y; sy+= dy) {
- for(sx=0; sx+dx<=ibuf->x; sx+= dx) {
- UI_view2d_to_region_no_clip(&ar->v2d, fx + (float)sx/(float)ibuf->x, fy + (float)sy/(float)ibuf->y, &x, &y);
+ for (sy = 0; sy + dy <= ibuf->y; sy += dy) {
+ for (sx = 0; sx + dx <= ibuf->x; sx += dx) {
+ UI_view2d_to_region_no_clip(&ar->v2d, fx + (float)sx / (float)ibuf->x, fy + (float)sy / (float)ibuf->y, &x, &y);
glaDrawPixelsSafe(x, y, dx, dy, dx, GL_RGBA, GL_UNSIGNED_BYTE, rect);
}
@@ -605,25 +592,25 @@ static void draw_image_buffer_tiled(SpaceImage *sima, ARegion *ar, Scene *scene,
static void draw_image_buffer_repeated(SpaceImage *sima, ARegion *ar, Scene *scene, Image *ima, ImBuf *ibuf, float zoomx, float zoomy)
{
- const double time_current= PIL_check_seconds_timer();
+ const double time_current = PIL_check_seconds_timer();
- const int xmax= ceil(ar->v2d.cur.xmax);
- const int ymax= ceil(ar->v2d.cur.ymax);
- const int xmin= floor(ar->v2d.cur.xmin);
- const int ymin= floor(ar->v2d.cur.ymin);
+ const int xmax = ceil(ar->v2d.cur.xmax);
+ const int ymax = ceil(ar->v2d.cur.ymax);
+ const int xmin = floor(ar->v2d.cur.xmin);
+ const int ymin = floor(ar->v2d.cur.ymin);
int x;
- for(x=xmin; x<xmax; x++) {
+ for (x = xmin; x < xmax; x++) {
int y;
- for(y=ymin; y<ymax; y++) {
- if(ima && (ima->tpageflag & IMA_TILES))
+ for (y = ymin; y < ymax; y++) {
+ if (ima && (ima->tpageflag & IMA_TILES))
draw_image_buffer_tiled(sima, ar, scene, ima, ibuf, x, y, zoomx, zoomy);
else
draw_image_buffer(sima, ar, scene, ima, ibuf, x, y, zoomx, zoomy);
/* only draw until running out of time */
- if((PIL_check_seconds_timer() - time_current) > 0.25)
+ if ((PIL_check_seconds_timer() - time_current) > 0.25)
return;
}
}
@@ -637,13 +624,13 @@ void draw_image_grease_pencil(bContext *C, short onlyv2d)
/* draw in View2D space? */
if (onlyv2d) {
/* assume that UI_view2d_ortho(C) has been called... */
- SpaceImage *sima= (SpaceImage *)CTX_wm_space_data(C);
+ SpaceImage *sima = (SpaceImage *)CTX_wm_space_data(C);
void *lock;
- ImBuf *ibuf= ED_space_image_acquire_buffer(sima, &lock);
+ ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock);
/* draw grease-pencil ('image' strokes) */
//if (sima->flag & SI_DISPGP)
- draw_gpencil_2dimage(C, ibuf);
+ draw_gpencil_2dimage(C, ibuf);
ED_space_image_release_buffer(sima, lock);
}
@@ -653,7 +640,7 @@ void draw_image_grease_pencil(bContext *C, short onlyv2d)
/* draw grease-pencil ('screen' strokes) */
//if (sima->flag & SI_DISPGP)
- draw_gpencil_view2d(C, 0);
+ draw_gpencil_view2d(C, 0);
}
}
@@ -661,24 +648,24 @@ void draw_image_grease_pencil(bContext *C, short onlyv2d)
#if 0
static void draw_image_view_tool(Scene *scene)
{
- ToolSettings *settings= scene->toolsettings;
- Brush *brush= settings->imapaint.brush;
+ ToolSettings *settings = scene->toolsettings;
+ Brush *brush = settings->imapaint.brush;
int mval[2];
float radius;
- int draw= 0;
+ int draw = 0;
- if(brush) {
- if(settings->imapaint.flag & IMAGEPAINT_DRAWING) {
- if(settings->imapaint.flag & IMAGEPAINT_DRAW_TOOL_DRAWING)
- draw= 1;
+ if (brush) {
+ if (settings->imapaint.flag & IMAGEPAINT_DRAWING) {
+ if (settings->imapaint.flag & IMAGEPAINT_DRAW_TOOL_DRAWING)
+ draw = 1;
}
- else if(settings->imapaint.flag & IMAGEPAINT_DRAW_TOOL)
- draw= 1;
+ else if (settings->imapaint.flag & IMAGEPAINT_DRAW_TOOL)
+ draw = 1;
- if(draw) {
+ if (draw) {
getmouseco_areawin(mval);
- radius= brush_size(brush)*G.sima->zoom;
+ radius = brush_size(brush) * G.sima->zoom;
fdrawXORcirc(mval[0], mval[1], radius);
if (brush->innerradius != 1.0) {
@@ -697,27 +684,27 @@ static unsigned char *get_alpha_clone_image(Scene *scene, int *width, int *heigh
unsigned int size, alpha;
unsigned char *rect, *cp;
- if(!brush || !brush->clone.image)
+ if (!brush || !brush->clone.image)
return NULL;
- ibuf= BKE_image_get_ibuf(brush->clone.image, NULL);
+ ibuf = BKE_image_get_ibuf(brush->clone.image, NULL);
- if(!ibuf || !ibuf->rect)
+ if (!ibuf || !ibuf->rect)
return NULL;
- rect= MEM_dupallocN(ibuf->rect);
- if(!rect)
+ rect = MEM_dupallocN(ibuf->rect);
+ if (!rect)
return NULL;
- *width= ibuf->x;
- *height= ibuf->y;
+ *width = ibuf->x;
+ *height = ibuf->y;
- size= (*width)*(*height);
- alpha= (unsigned char)255*brush->clone.alpha;
- cp= rect;
+ size = (*width) * (*height);
+ alpha = (unsigned char)255 * brush->clone.alpha;
+ cp = rect;
- while(size-- > 0) {
- cp[3]= alpha;
+ while (size-- > 0) {
+ cp[3] = alpha;
cp += 4;
}
@@ -730,14 +717,14 @@ static void draw_image_paint_helpers(ARegion *ar, Scene *scene, float zoomx, flo
int x, y, w, h;
unsigned char *clonerect;
- brush= paint_brush(&scene->toolsettings->imapaint.paint);
+ brush = paint_brush(&scene->toolsettings->imapaint.paint);
- if(brush && (brush->imagepaint_tool == PAINT_TOOL_CLONE)) {
+ if (brush && (brush->imagepaint_tool == PAINT_TOOL_CLONE)) {
/* this is not very efficient, but glDrawPixels doesn't allow
- drawing with alpha */
- clonerect= get_alpha_clone_image(scene, &w, &h);
+ * drawing with alpha */
+ clonerect = get_alpha_clone_image(scene, &w, &h);
- if(clonerect) {
+ if (clonerect) {
UI_view2d_to_region_no_clip(&ar->v2d, brush->clone.offset[0], brush->clone.offset[1], &x, &y);
glPixelZoom(zoomx, zoomy);
@@ -768,54 +755,54 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene)
#if 0
what_image(sima);
- if(sima->image) {
+ if (sima->image) {
ED_image_aspect(sima->image, &xuser_asp, &yuser_asp);
/* UGLY hack? until now iusers worked fine... but for flipbook viewer we need this */
- if(sima->image->type==IMA_TYPE_COMPOSITE) {
- ImageUser *iuser= ntree_get_active_iuser(scene->nodetree);
- if(iuser) {
+ if (sima->image->type == IMA_TYPE_COMPOSITE) {
+ ImageUser *iuser = ntree_get_active_iuser(scene->nodetree);
+ if (iuser) {
BKE_image_user_calc_imanr(iuser, scene->r.cfra, 0);
- sima->iuser= *iuser;
+ sima->iuser = *iuser;
}
}
/* and we check for spare */
- ibuf= ED_space_image_buffer(sima);
+ ibuf = ED_space_image_buffer(sima);
}
#endif
/* retrieve the image and information about it */
- ima= ED_space_image(sima);
+ ima = ED_space_image(sima);
ED_space_image_zoom(sima, ar, &zoomx, &zoomy);
- ibuf= ED_space_image_acquire_buffer(sima, &lock);
+ ibuf = ED_space_image_acquire_buffer(sima, &lock);
- show_viewer= (ima && ima->source == IMA_SRC_VIEWER);
- show_render= (show_viewer && ima->type == IMA_TYPE_R_RESULT);
+ show_viewer = (ima && ima->source == IMA_SRC_VIEWER);
+ show_render = (show_viewer && ima->type == IMA_TYPE_R_RESULT);
/* draw the image or grid */
- if(ibuf==NULL)
+ if (ibuf == NULL)
draw_image_grid(ar, zoomx, zoomy);
- else if(sima->flag & SI_DRAW_TILE)
+ else if (sima->flag & SI_DRAW_TILE)
draw_image_buffer_repeated(sima, ar, scene, ima, ibuf, zoomx, zoomy);
- else if(ima && (ima->tpageflag & IMA_TILES))
+ else if (ima && (ima->tpageflag & IMA_TILES))
draw_image_buffer_tiled(sima, ar, scene, ima, ibuf, 0.0f, 0.0, zoomx, zoomy);
else
draw_image_buffer(sima, ar, scene, ima, ibuf, 0.0f, 0.0f, zoomx, zoomy);
/* paint helpers */
- if(sima->flag & SI_DRAWTOOL)
+ if (sima->flag & SI_DRAWTOOL)
draw_image_paint_helpers(ar, scene, zoomx, zoomy);
/* XXX integrate this code */
#if 0
- if(ibuf) {
- float xoffs=0.0f, yoffs= 0.0f;
+ if (ibuf) {
+ float xoffs = 0.0f, yoffs = 0.0f;
- if(image_preview_active(sa, &xim, &yim)) {
- xoffs= scene->r.disprect.xmin;
- yoffs= scene->r.disprect.ymin;
- glColor3ub(0,0,0);
+ if (image_preview_active(sa, &xim, &yim)) {
+ xoffs = scene->r.disprect.xmin;
+ yoffs = scene->r.disprect.ymin;
+ glColor3ub(0, 0, 0);
calc_image_view(sima, 'f');
myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
glRectf(0.0f, 0.0f, 1.0f, 1.0f);
@@ -827,7 +814,7 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene)
ED_space_image_release_buffer(sima, lock);
/* render info */
- if(ima && show_render)
+ if (ima && show_render)
draw_render_info(scene, ima, ar);
}
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 6742852cbf4..1602fe48a17 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -84,10 +84,10 @@
static void sima_zoom_set(SpaceImage *sima, ARegion *ar, float zoom, float location[2])
{
- float oldzoom= sima->zoom;
+ float oldzoom = sima->zoom;
int width, height;
- sima->zoom= zoom;
+ sima->zoom = zoom;
if (sima->zoom < 0.1f || sima->zoom > 4.0f) {
/* check zoom limits */
@@ -96,31 +96,31 @@ static void sima_zoom_set(SpaceImage *sima, ARegion *ar, float zoom, float locat
width *= sima->zoom;
height *= sima->zoom;
- if((width < 4) && (height < 4))
- sima->zoom= oldzoom;
- else if((ar->winrct.xmax - ar->winrct.xmin) <= sima->zoom)
- sima->zoom= oldzoom;
- else if((ar->winrct.ymax - ar->winrct.ymin) <= sima->zoom)
- sima->zoom= oldzoom;
+ if ((width < 4) && (height < 4))
+ sima->zoom = oldzoom;
+ else if ((ar->winrct.xmax - ar->winrct.xmin) <= sima->zoom)
+ sima->zoom = oldzoom;
+ else if ((ar->winrct.ymax - ar->winrct.ymin) <= sima->zoom)
+ sima->zoom = oldzoom;
}
- if((U.uiflag & USER_ZOOM_TO_MOUSEPOS) && location) {
+ if ((U.uiflag & USER_ZOOM_TO_MOUSEPOS) && location) {
float aspx, aspy, w, h;
ED_space_image_size(sima, &width, &height);
ED_space_image_aspect(sima, &aspx, &aspy);
- w= width*aspx;
- h= height*aspy;
+ w = width * aspx;
+ h = height * aspy;
- sima->xof+= ((location[0]-0.5f)*w-sima->xof)*(sima->zoom-oldzoom)/sima->zoom;
- sima->yof+= ((location[1]-0.5f)*h-sima->yof)*(sima->zoom-oldzoom)/sima->zoom;
+ sima->xof += ((location[0] - 0.5f) * w - sima->xof) * (sima->zoom - oldzoom) / sima->zoom;
+ sima->yof += ((location[1] - 0.5f) * h - sima->yof) * (sima->zoom - oldzoom) / sima->zoom;
}
}
static void sima_zoom_set_factor(SpaceImage *sima, ARegion *ar, float zoomfac, float location[2])
{
- sima_zoom_set(sima, ar, sima->zoom*zoomfac, location);
+ sima_zoom_set(sima, ar, sima->zoom * zoomfac, location);
}
#if 0 // currently unused
@@ -132,36 +132,36 @@ static int image_poll(bContext *C)
static int space_image_buffer_exists_poll(bContext *C)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- if(sima && sima->spacetype==SPACE_IMAGE)
- if(ED_space_image_has_buffer(sima))
+ SpaceImage *sima = CTX_wm_space_image(C);
+ if (sima && sima->spacetype == SPACE_IMAGE)
+ if (ED_space_image_has_buffer(sima))
return 1;
return 0;
}
static int space_image_file_exists_poll(bContext *C)
{
- if(space_image_buffer_exists_poll(C)) {
- Main *bmain= CTX_data_main(C);
- SpaceImage *sima= CTX_wm_space_image(C);
+ if (space_image_buffer_exists_poll(C)) {
+ Main *bmain = CTX_data_main(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
ImBuf *ibuf;
void *lock;
- int ret= FALSE;
+ int ret = FALSE;
char name[FILE_MAX];
- ibuf= ED_space_image_acquire_buffer(sima, &lock);
- if(ibuf) {
+ ibuf = ED_space_image_acquire_buffer(sima, &lock);
+ if (ibuf) {
BLI_strncpy(name, ibuf->name, FILE_MAX);
BLI_path_abs(name, bmain->name);
- if(BLI_exists(name) == FALSE) {
+ if (BLI_exists(name) == FALSE) {
CTX_wm_operator_poll_msg_set(C, "image file not found");
}
else if (BLI_file_is_writable(name) == FALSE) {
CTX_wm_operator_poll_msg_set(C, "image path can't be written to");
}
else {
- ret= TRUE;
+ ret = TRUE;
}
}
ED_space_image_release_buffer(sima, lock);
@@ -173,19 +173,19 @@ static int space_image_file_exists_poll(bContext *C)
static int space_image_poll(bContext *C)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- if(sima && sima->spacetype==SPACE_IMAGE && sima->image)
+ SpaceImage *sima = CTX_wm_space_image(C);
+ if (sima && sima->spacetype == SPACE_IMAGE && sima->image)
return 1;
return 0;
}
int space_image_main_area_poll(bContext *C)
{
- SpaceImage *sima= CTX_wm_space_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
// XXX ARegion *ar= CTX_wm_region(C);
- if(sima)
- return 1; // XXX (ar && ar->type->regionid == RGN_TYPE_WINDOW);
+ if (sima)
+ return 1; // XXX (ar && ar->type->regionid == RGN_TYPE_WINDOW);
return 0;
}
@@ -193,10 +193,10 @@ int space_image_main_area_poll(bContext *C)
/* For IMAGE_OT_curves_point_set to avoid sampling when in uv smooth mode */
int space_image_main_area_not_uv_brush_poll(bContext *C)
{
- SpaceImage *sima= CTX_wm_space_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
ToolSettings *toolsettings = CTX_data_scene(C)->toolsettings;
- if(sima && !toolsettings->uvsculpt)
+ if (sima && !toolsettings->uvsculpt)
return 1;
return 0;
@@ -204,12 +204,12 @@ int space_image_main_area_not_uv_brush_poll(bContext *C)
static int space_image_image_sample_poll(bContext *C)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- Object *obedit= CTX_data_edit_object(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ Object *obedit = CTX_data_edit_object(C);
ToolSettings *toolsettings = CTX_data_scene(C)->toolsettings;
- if(obedit){
- if(ED_space_image_show_uvedit(sima, obedit) && (toolsettings->use_uv_sculpt))
+ if (obedit) {
+ if (ED_space_image_show_uvedit(sima, obedit) && (toolsettings->use_uv_sculpt))
return 0;
}
return space_image_main_area_poll(C);
@@ -224,29 +224,29 @@ typedef struct ViewPanData {
static void image_view_pan_init(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceImage *sima= CTX_wm_space_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
ViewPanData *vpd;
- op->customdata= vpd= MEM_callocN(sizeof(ViewPanData), "ImageViewPanData");
+ op->customdata = vpd = MEM_callocN(sizeof(ViewPanData), "ImageViewPanData");
WM_cursor_modal(CTX_wm_window(C), BC_NSEW_SCROLLCURSOR);
- vpd->x= event->x;
- vpd->y= event->y;
- vpd->xof= sima->xof;
- vpd->yof= sima->yof;
- vpd->event_type= event->type;
+ vpd->x = event->x;
+ vpd->y = event->y;
+ vpd->xof = sima->xof;
+ vpd->yof = sima->yof;
+ vpd->event_type = event->type;
WM_event_add_modal_handler(C, op);
}
static void image_view_pan_exit(bContext *C, wmOperator *op, int cancel)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- ViewPanData *vpd= op->customdata;
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ViewPanData *vpd = op->customdata;
- if(cancel) {
- sima->xof= vpd->xof;
- sima->yof= vpd->yof;
+ if (cancel) {
+ sima->xof = vpd->xof;
+ sima->yof = vpd->yof;
ED_region_tag_redraw(CTX_wm_region(C));
}
@@ -256,7 +256,7 @@ static void image_view_pan_exit(bContext *C, wmOperator *op, int cancel)
static int image_view_pan_exec(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
float offset[2];
RNA_float_get_array(op->ptr, "offset", offset);
@@ -267,7 +267,7 @@ static int image_view_pan_exec(bContext *C, wmOperator *op)
/* XXX notifier? */
#if 0
- if(image_preview_active(curarea, NULL, NULL)) {
+ if (image_preview_active(curarea, NULL, NULL)) {
/* recalculates new preview rect */
scrarea_do_windraw(curarea);
image_preview_event(2);
@@ -280,11 +280,11 @@ static int image_view_pan_exec(bContext *C, wmOperator *op)
static int image_view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
if (event->type == MOUSEPAN) {
- SpaceImage *sima= CTX_wm_space_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
float offset[2];
- offset[0]= (event->x - event->prevx)/sima->zoom;
- offset[1]= (event->y - event->prevy)/sima->zoom;
+ offset[0] = (event->x - event->prevx) / sima->zoom;
+ offset[1] = (event->y - event->prevy) / sima->zoom;
RNA_float_set_array(op->ptr, "offset", offset);
image_view_pan_exec(C, op);
@@ -298,21 +298,21 @@ static int image_view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int image_view_pan_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- ViewPanData *vpd= op->customdata;
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ViewPanData *vpd = op->customdata;
float offset[2];
- switch(event->type) {
+ switch (event->type) {
case MOUSEMOVE:
- sima->xof= vpd->xof;
- sima->yof= vpd->yof;
- offset[0]= (vpd->x - event->x)/sima->zoom;
- offset[1]= (vpd->y - event->y)/sima->zoom;
+ sima->xof = vpd->xof;
+ sima->yof = vpd->yof;
+ offset[0] = (vpd->x - event->x) / sima->zoom;
+ offset[1] = (vpd->y - event->y) / sima->zoom;
RNA_float_set_array(op->ptr, "offset", offset);
image_view_pan_exec(C, op);
break;
default:
- if(event->type==vpd->event_type && event->val==KM_RELEASE) {
+ if (event->type == vpd->event_type && event->val == KM_RELEASE) {
image_view_pan_exit(C, op, 0);
return OPERATOR_FINISHED;
}
@@ -331,22 +331,22 @@ static int image_view_pan_cancel(bContext *C, wmOperator *op)
void IMAGE_OT_view_pan(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Pan";
- ot->idname= "IMAGE_OT_view_pan";
+ ot->name = "View Pan";
+ ot->idname = "IMAGE_OT_view_pan";
/* api callbacks */
- ot->exec= image_view_pan_exec;
- ot->invoke= image_view_pan_invoke;
- ot->modal= image_view_pan_modal;
- ot->cancel= image_view_pan_cancel;
- ot->poll= space_image_main_area_poll;
+ ot->exec = image_view_pan_exec;
+ ot->invoke = image_view_pan_invoke;
+ ot->modal = image_view_pan_modal;
+ ot->cancel = image_view_pan_cancel;
+ ot->poll = space_image_main_area_poll;
/* flags */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING | OPTYPE_GRAB_POINTER;
/* properties */
RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX,
- "Offset", "Offset in floating point units, 1.0 is the width and height of the image", -FLT_MAX, FLT_MAX);
+ "Offset", "Offset in floating point units, 1.0 is the width and height of the image", -FLT_MAX, FLT_MAX);
}
/********************** view zoom operator *********************/
@@ -360,17 +360,17 @@ typedef struct ViewZoomData {
static void image_view_zoom_init(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ARegion *ar = CTX_wm_region(C);
ViewZoomData *vpd;
- op->customdata= vpd= MEM_callocN(sizeof(ViewZoomData), "ImageViewZoomData");
+ op->customdata = vpd = MEM_callocN(sizeof(ViewZoomData), "ImageViewZoomData");
WM_cursor_modal(CTX_wm_window(C), BC_NSEW_SCROLLCURSOR);
- vpd->x= event->x;
- vpd->y= event->y;
- vpd->zoom= sima->zoom;
- vpd->event_type= event->type;
+ vpd->x = event->x;
+ vpd->y = event->y;
+ vpd->zoom = sima->zoom;
+ vpd->event_type = event->type;
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &vpd->location[0], &vpd->location[1]);
@@ -379,11 +379,11 @@ static void image_view_zoom_init(bContext *C, wmOperator *op, wmEvent *event)
static void image_view_zoom_exit(bContext *C, wmOperator *op, int cancel)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- ViewZoomData *vpd= op->customdata;
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ViewZoomData *vpd = op->customdata;
- if(cancel) {
- sima->zoom= vpd->zoom;
+ if (cancel) {
+ sima->zoom = vpd->zoom;
ED_region_tag_redraw(CTX_wm_region(C));
}
@@ -393,8 +393,8 @@ static void image_view_zoom_exit(bContext *C, wmOperator *op, int cancel)
static int image_view_zoom_exec(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ARegion *ar = CTX_wm_region(C);
sima_zoom_set_factor(sima, ar, RNA_float_get(op->ptr, "factor"), NULL);
@@ -402,7 +402,7 @@ static int image_view_zoom_exec(bContext *C, wmOperator *op)
/* XXX notifier? */
#if 0
- if(image_preview_active(curarea, NULL, NULL)) {
+ if (image_preview_active(curarea, NULL, NULL)) {
/* recalculates new preview rect */
scrarea_do_windraw(curarea);
image_preview_event(2);
@@ -415,15 +415,15 @@ static int image_view_zoom_exec(bContext *C, wmOperator *op)
static int image_view_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
if (event->type == MOUSEZOOM) {
- SpaceImage *sima= CTX_wm_space_image(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ARegion *ar = CTX_wm_region(C);
float factor, location[2];
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &location[0], &location[1]);
- factor= 1.0f + (event->x-event->prevx+event->y-event->prevy)/300.0f;
+ factor = 1.0f + (event->x - event->prevx + event->y - event->prevy) / 300.0f;
RNA_float_set(op->ptr, "factor", factor);
- sima_zoom_set(sima, ar, sima->zoom*factor, location);
+ sima_zoom_set(sima, ar, sima->zoom * factor, location);
ED_region_tag_redraw(CTX_wm_region(C));
return OPERATOR_FINISHED;
@@ -436,20 +436,20 @@ static int image_view_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int image_view_zoom_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- ARegion *ar= CTX_wm_region(C);
- ViewZoomData *vpd= op->customdata;
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ARegion *ar = CTX_wm_region(C);
+ ViewZoomData *vpd = op->customdata;
float factor;
- switch(event->type) {
+ switch (event->type) {
case MOUSEMOVE:
- factor= 1.0f + (vpd->x-event->x+vpd->y-event->y)/300.0f;
+ factor = 1.0f + (vpd->x - event->x + vpd->y - event->y) / 300.0f;
RNA_float_set(op->ptr, "factor", factor);
- sima_zoom_set(sima, ar, vpd->zoom*factor, vpd->location);
+ sima_zoom_set(sima, ar, vpd->zoom * factor, vpd->location);
ED_region_tag_redraw(CTX_wm_region(C));
break;
default:
- if(event->type==vpd->event_type && event->val==KM_RELEASE) {
+ if (event->type == vpd->event_type && event->val == KM_RELEASE) {
image_view_zoom_exit(C, op, 0);
return OPERATOR_FINISHED;
}
@@ -468,22 +468,22 @@ static int image_view_zoom_cancel(bContext *C, wmOperator *op)
void IMAGE_OT_view_zoom(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Zoom";
- ot->idname= "IMAGE_OT_view_zoom";
+ ot->name = "View Zoom";
+ ot->idname = "IMAGE_OT_view_zoom";
/* api callbacks */
- ot->exec= image_view_zoom_exec;
- ot->invoke= image_view_zoom_invoke;
- ot->modal= image_view_zoom_modal;
- ot->cancel= image_view_zoom_cancel;
- ot->poll= space_image_main_area_poll;
+ ot->exec = image_view_zoom_exec;
+ ot->invoke = image_view_zoom_invoke;
+ ot->modal = image_view_zoom_modal;
+ ot->cancel = image_view_zoom_cancel;
+ ot->poll = space_image_main_area_poll;
/* flags */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
/* properties */
RNA_def_float(ot->srna, "factor", 0.0f, 0.0f, FLT_MAX,
- "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out", -FLT_MAX, FLT_MAX);
+ "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out", -FLT_MAX, FLT_MAX);
}
/********************** NDOF operator *********************/
@@ -499,10 +499,10 @@ static int image_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *
if (event->type != NDOF_MOTION)
return OPERATOR_CANCELLED;
else {
- SpaceImage *sima= CTX_wm_space_image(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ARegion *ar = CTX_wm_region(C);
- wmNDOFMotionData* ndof = (wmNDOFMotionData*) event->customdata;
+ wmNDOFMotionData *ndof = (wmNDOFMotionData *) event->customdata;
float dt = ndof->dt;
/* tune these until it feels right */
@@ -536,11 +536,11 @@ static int image_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *
void IMAGE_OT_view_ndof(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "NDOF Pan/Zoom";
- ot->idname= "IMAGE_OT_view_ndof";
+ ot->name = "NDOF Pan/Zoom";
+ ot->idname = "IMAGE_OT_view_ndof";
/* api callbacks */
- ot->invoke= image_view_ndof_invoke;
+ ot->invoke = image_view_ndof_invoke;
}
/********************** view all operator *********************/
@@ -557,29 +557,29 @@ static int image_view_all_exec(bContext *C, wmOperator *UNUSED(op))
int width, height;
/* retrieve state */
- sima= CTX_wm_space_image(C);
- ar= CTX_wm_region(C);
+ sima = CTX_wm_space_image(C);
+ ar = CTX_wm_region(C);
ED_space_image_size(sima, &width, &height);
ED_space_image_aspect(sima, &aspx, &aspy);
- w= width*aspx;
- h= height*aspy;
+ w = width * aspx;
+ h = height * aspy;
/* check if the image will fit in the image with zoom==1 */
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)) {
+ if ((w >= width || h >= height) && (width > 0 && height > 0)) {
/* find the zoom value that will fit the image in the image space */
- zoomx= width/w;
- zoomy= height/h;
- sima_zoom_set(sima, ar, 1.0f/power_of_2(1/MIN2(zoomx, zoomy)), NULL);
+ zoomx = width / w;
+ zoomy = height / h;
+ sima_zoom_set(sima, ar, 1.0f / power_of_2(1 / MIN2(zoomx, zoomy)), NULL);
}
else
sima_zoom_set(sima, ar, 1.0f, NULL);
- sima->xof= sima->yof= 0.0f;
+ sima->xof = sima->yof = 0.0f;
ED_region_tag_redraw(CTX_wm_region(C));
@@ -589,12 +589,12 @@ static int image_view_all_exec(bContext *C, wmOperator *UNUSED(op))
void IMAGE_OT_view_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View All";
- ot->idname= "IMAGE_OT_view_all";
+ ot->name = "View All";
+ ot->idname = "IMAGE_OT_view_all";
/* api callbacks */
- ot->exec= image_view_all_exec;
- ot->poll= space_image_main_area_poll;
+ ot->exec = image_view_all_exec;
+ ot->poll = space_image_main_area_poll;
}
/********************** view selected operator *********************/
@@ -610,32 +610,32 @@ static int image_view_selected_exec(bContext *C, wmOperator *UNUSED(op))
int width, height;
/* retrieve state */
- sima= CTX_wm_space_image(C);
- ar= CTX_wm_region(C);
- scene= CTX_data_scene(C);
- obedit= CTX_data_edit_object(C);
+ sima = CTX_wm_space_image(C);
+ ar = CTX_wm_region(C);
+ scene = CTX_data_scene(C);
+ obedit = CTX_data_edit_object(C);
- ima= ED_space_image(sima);
+ ima = ED_space_image(sima);
ED_space_image_size(sima, &width, &height);
ED_image_aspect(ima, &aspx, &aspy);
- width= width*aspx;
- height= height*aspy;
+ width = width * aspx;
+ height = height * aspy;
/* get bounds */
- if(!ED_uvedit_minmax(scene, ima, obedit, min, max))
+ if (!ED_uvedit_minmax(scene, ima, obedit, min, max))
return OPERATOR_CANCELLED;
/* adjust offset and zoom */
- sima->xof= (int)(((min[0] + max[0])*0.5f - 0.5f)*width);
- sima->yof= (int)(((min[1] + max[1])*0.5f - 0.5f)*height);
+ sima->xof = (int)(((min[0] + max[0]) * 0.5f - 0.5f) * width);
+ sima->yof = (int)(((min[1] + max[1]) * 0.5f - 0.5f) * height);
- d[0]= max[0] - min[0];
- d[1]= max[1] - min[1];
- size= 0.5f*MAX2(d[0], d[1])*MAX2(width, height)/256.0f;
+ d[0] = max[0] - min[0];
+ d[1] = max[1] - min[1];
+ size = 0.5f * MAX2(d[0], d[1]) * MAX2(width, height) / 256.0f;
- if(size<=0.01f) size= 0.01f;
- sima_zoom_set(sima, ar, 0.7f/size, NULL);
+ if (size <= 0.01f) size = 0.01f;
+ sima_zoom_set(sima, ar, 0.7f / size, NULL);
ED_region_tag_redraw(CTX_wm_region(C));
@@ -650,20 +650,20 @@ static int image_view_selected_poll(bContext *C)
void IMAGE_OT_view_selected(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Center";
- ot->idname= "IMAGE_OT_view_selected";
+ ot->name = "View Center";
+ ot->idname = "IMAGE_OT_view_selected";
/* api callbacks */
- ot->exec= image_view_selected_exec;
- ot->poll= image_view_selected_poll;
+ ot->exec = image_view_selected_exec;
+ ot->poll = image_view_selected_poll;
}
/********************** view zoom in/out operator *********************/
static int image_view_zoom_in_exec(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ARegion *ar = CTX_wm_region(C);
float location[2];
RNA_float_get_array(op->ptr, "location", location);
@@ -677,7 +677,7 @@ static int image_view_zoom_in_exec(bContext *C, wmOperator *op)
static int image_view_zoom_in_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
float location[2];
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &location[0], &location[1]);
@@ -689,13 +689,13 @@ static int image_view_zoom_in_invoke(bContext *C, wmOperator *op, wmEvent *event
void IMAGE_OT_view_zoom_in(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Zoom In";
- ot->idname= "IMAGE_OT_view_zoom_in";
+ ot->name = "View Zoom In";
+ ot->idname = "IMAGE_OT_view_zoom_in";
/* api callbacks */
- ot->invoke= image_view_zoom_in_invoke;
- ot->exec= image_view_zoom_in_exec;
- ot->poll= space_image_main_area_poll;
+ ot->invoke = image_view_zoom_in_invoke;
+ ot->exec = image_view_zoom_in_exec;
+ ot->poll = space_image_main_area_poll;
/* properties */
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in screen coordinates", -10.0f, 10.0f);
@@ -703,8 +703,8 @@ void IMAGE_OT_view_zoom_in(wmOperatorType *ot)
static int image_view_zoom_out_exec(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ARegion *ar = CTX_wm_region(C);
float location[2];
RNA_float_get_array(op->ptr, "location", location);
@@ -718,7 +718,7 @@ static int image_view_zoom_out_exec(bContext *C, wmOperator *op)
static int image_view_zoom_out_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
float location[2];
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &location[0], &location[1]);
@@ -730,13 +730,13 @@ static int image_view_zoom_out_invoke(bContext *C, wmOperator *op, wmEvent *even
void IMAGE_OT_view_zoom_out(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Zoom Out";
- ot->idname= "IMAGE_OT_view_zoom_out";
+ ot->name = "View Zoom Out";
+ ot->idname = "IMAGE_OT_view_zoom_out";
/* api callbacks */
- ot->invoke= image_view_zoom_out_invoke;
- ot->exec= image_view_zoom_out_exec;
- ot->poll= space_image_main_area_poll;
+ ot->invoke = image_view_zoom_out_invoke;
+ ot->exec = image_view_zoom_out_exec;
+ ot->poll = space_image_main_area_poll;
/* properties */
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in screen coordinates", -10.0f, 10.0f);
@@ -746,18 +746,18 @@ void IMAGE_OT_view_zoom_out(wmOperatorType *ot)
static int image_view_zoom_ratio_exec(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ARegion *ar = CTX_wm_region(C);
sima_zoom_set(sima, ar, RNA_float_get(op->ptr, "ratio"), NULL);
/* ensure pixel exact locations for draw */
- sima->xof= (int)sima->xof;
- sima->yof= (int)sima->yof;
+ sima->xof = (int)sima->xof;
+ sima->yof = (int)sima->yof;
/* XXX notifier? */
#if 0
- if(image_preview_active(curarea, NULL, NULL)) {
+ if (image_preview_active(curarea, NULL, NULL)) {
/* recalculates new preview rect */
scrarea_do_windraw(curarea);
image_preview_event(2);
@@ -772,16 +772,16 @@ static int image_view_zoom_ratio_exec(bContext *C, wmOperator *op)
void IMAGE_OT_view_zoom_ratio(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Zoom Ratio";
- ot->idname= "IMAGE_OT_view_zoom_ratio";
+ ot->name = "View Zoom Ratio";
+ ot->idname = "IMAGE_OT_view_zoom_ratio";
/* api callbacks */
- ot->exec= image_view_zoom_ratio_exec;
- ot->poll= space_image_main_area_poll;
+ ot->exec = image_view_zoom_ratio_exec;
+ ot->poll = space_image_main_area_poll;
/* properties */
RNA_def_float(ot->srna, "ratio", 0.0f, 0.0f, FLT_MAX,
- "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX);
+ "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX);
}
/**************** load/replace/save callbacks ******************/
@@ -797,48 +797,48 @@ static void image_open_init(bContext *C, wmOperator *op)
{
PropertyPointerRNA *pprop;
- op->customdata= pprop= MEM_callocN(sizeof(PropertyPointerRNA), "OpenPropertyPointerRNA");
+ op->customdata = pprop = MEM_callocN(sizeof(PropertyPointerRNA), "OpenPropertyPointerRNA");
uiIDContextProperty(C, &pprop->ptr, &pprop->prop);
}
static int image_open_cancel(bContext *UNUSED(C), wmOperator *op)
{
MEM_freeN(op->customdata);
- op->customdata= NULL;
+ op->customdata = NULL;
return OPERATOR_CANCELLED;
}
static int image_open_exec(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C); /* XXX other space types can call */
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- ImageUser *iuser= NULL;
+ SpaceImage *sima = CTX_wm_space_image(C); /* XXX other space types can call */
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ ImageUser *iuser = NULL;
PropertyPointerRNA *pprop;
PointerRNA idptr;
- Image *ima= NULL;
+ Image *ima = NULL;
char str[FILE_MAX];
RNA_string_get(op->ptr, "filepath", str);
/* default to frame 1 if there's no scene in context */
- errno= 0;
+ errno = 0;
- ima= BKE_add_image_file(str);
+ ima = BKE_add_image_file(str);
- if(!ima) {
- if(op->customdata) MEM_freeN(op->customdata);
+ if (!ima) {
+ if (op->customdata) MEM_freeN(op->customdata);
BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s", str, errno ? strerror(errno) : "Unsupported image format");
return OPERATOR_CANCELLED;
}
- if(!op->customdata)
+ if (!op->customdata)
image_open_init(C, op);
/* hook into UI */
- pprop= op->customdata;
+ pprop = op->customdata;
- if(pprop->prop) {
+ if (pprop->prop) {
/* when creating new ID blocks, use is already 1, but RNA
* pointer se also increases user, so this compensates it */
ima->id.us--;
@@ -847,29 +847,29 @@ static int image_open_exec(bContext *C, wmOperator *op)
RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr);
RNA_property_update(C, &pprop->ptr, pprop->prop);
}
- else if(sima) {
+ else if (sima) {
ED_space_image_set(sima, scene, obedit, ima);
- iuser= &sima->iuser;
+ iuser = &sima->iuser;
}
else {
- Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
- if(tex && tex->type==TEX_IMAGE)
- iuser= &tex->iuser;
+ Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
+ if (tex && tex->type == TEX_IMAGE)
+ iuser = &tex->iuser;
}
/* initialize because of new image */
- if(iuser) {
- iuser->sfra= 1;
- iuser->offset= 0;
- iuser->fie_ima= 2;
+ if (iuser) {
+ iuser->sfra = 1;
+ iuser->offset = 0;
+ iuser->fie_ima = 2;
}
/* XXX unpackImage frees image buffers */
ED_preview_kill_jobs(C);
BKE_image_signal(ima, iuser, IMA_SIGNAL_RELOAD);
- WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima);
+ WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, ima);
MEM_freeN(op->customdata);
@@ -878,24 +878,24 @@ static int image_open_exec(bContext *C, wmOperator *op)
static int image_open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- SpaceImage *sima= CTX_wm_space_image(C); /* XXX other space types can call */
- char *path=U.textudir;
- Image *ima= NULL;
+ SpaceImage *sima = CTX_wm_space_image(C); /* XXX other space types can call */
+ char *path = U.textudir;
+ Image *ima = NULL;
- if(sima) {
- ima= sima->image;
+ if (sima) {
+ ima = sima->image;
}
- if (ima==NULL) {
- Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
- if(tex && tex->type==TEX_IMAGE)
- ima= tex->ima;
+ if (ima == NULL) {
+ Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
+ if (tex && tex->type == TEX_IMAGE)
+ ima = tex->ima;
}
- if(ima)
- path= ima->name;
+ if (ima)
+ path = ima->name;
- if(RNA_struct_property_is_set(op->ptr, "filepath"))
+ if (RNA_struct_property_is_set(op->ptr, "filepath"))
return image_open_exec(C, op);
image_open_init(C, op);
@@ -909,30 +909,30 @@ static int image_open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
void IMAGE_OT_open(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Open Image";
- ot->description= "Open image";
- ot->idname= "IMAGE_OT_open";
+ ot->name = "Open Image";
+ ot->description = "Open image";
+ ot->idname = "IMAGE_OT_open";
/* api callbacks */
- ot->exec= image_open_exec;
- ot->invoke= image_open_invoke;
- ot->cancel= image_open_cancel;
+ ot->exec = image_open_exec;
+ ot->invoke = image_open_invoke;
+ ot->cancel = image_open_cancel;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
- WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE | MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
}
/******************** replace image operator ********************/
static int image_replace_exec(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
char str[FILE_MAX];
- if(!sima->image)
+ if (!sima->image)
return OPERATOR_CANCELLED;
RNA_string_get(op->ptr, "filepath", str);
@@ -941,31 +941,31 @@ static int image_replace_exec(bContext *C, wmOperator *op)
BLI_strncpy(sima->image->name, str, sizeof(sima->image->name));
if (BLI_testextensie_array(str, imb_ext_movie))
- sima->image->source= IMA_SRC_MOVIE;
+ sima->image->source = IMA_SRC_MOVIE;
else
- sima->image->source= IMA_SRC_FILE;
+ sima->image->source = IMA_SRC_FILE;
/* XXX unpackImage frees image buffers */
ED_preview_kill_jobs(C);
BKE_image_signal(sima->image, &sima->iuser, IMA_SIGNAL_RELOAD);
- WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, sima->image);
+ WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, sima->image);
return OPERATOR_FINISHED;
}
static int image_replace_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- SpaceImage *sima= CTX_wm_space_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
- if(!sima->image)
+ if (!sima->image)
return OPERATOR_CANCELLED;
- if(RNA_struct_property_is_set(op->ptr, "filepath"))
+ if (RNA_struct_property_is_set(op->ptr, "filepath"))
return image_replace_exec(C, op);
- if(!RNA_struct_property_is_set(op->ptr, "relative_path"))
- RNA_boolean_set(op->ptr, "relative_path", (strncmp(sima->image->name, "//", 2))==0);
+ if (!RNA_struct_property_is_set(op->ptr, "relative_path"))
+ RNA_boolean_set(op->ptr, "relative_path", (strncmp(sima->image->name, "//", 2)) == 0);
image_filesel(C, op, sima->image->name);
@@ -975,19 +975,19 @@ static int image_replace_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
void IMAGE_OT_replace(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Replace Image";
- ot->idname= "IMAGE_OT_replace";
+ ot->name = "Replace Image";
+ ot->idname = "IMAGE_OT_replace";
/* api callbacks */
- ot->exec= image_replace_exec;
- ot->invoke= image_replace_invoke;
- ot->poll= space_image_poll;
+ ot->exec = image_replace_exec;
+ ot->invoke = image_replace_invoke;
+ ot->poll = space_image_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
- WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE | MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
}
/******************** save image as operator ********************/
@@ -1002,16 +1002,16 @@ typedef struct {
static void save_image_options_defaults(SaveImageOptions *simopts)
{
memset(&simopts->im_format, 0, sizeof(simopts->im_format));
- simopts->im_format.planes= R_IMF_PLANES_RGB;
- simopts->im_format.imtype= R_IMF_IMTYPE_PNG;
- simopts->im_format.quality= 90;
- simopts->im_format.compress= 90;
- simopts->filepath[0]= '\0';
+ simopts->im_format.planes = R_IMF_PLANES_RGB;
+ simopts->im_format.imtype = R_IMF_IMTYPE_PNG;
+ simopts->im_format.quality = 90;
+ simopts->im_format.compress = 90;
+ simopts->filepath[0] = '\0';
}
static char imtype_best_depth(ImBuf *ibuf, const char imtype)
{
- const char depth_ok= BKE_imtype_valid_depths(imtype);
+ const char depth_ok = BKE_imtype_valid_depths(imtype);
if (ibuf->rect_float) {
if (depth_ok & R_IMF_CHAN_DEPTH_32) return R_IMF_CHAN_DEPTH_32;
@@ -1033,52 +1033,53 @@ static char imtype_best_depth(ImBuf *ibuf, const char imtype)
static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima, Scene *scene, const short guess_path)
{
void *lock;
- ImBuf *ibuf= ED_space_image_acquire_buffer(sima, &lock);
+ ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock);
- if(ibuf) {
- Image *ima= sima->image;
- short is_depth_set= FALSE;
+ if (ibuf) {
+ Image *ima = sima->image;
+ short is_depth_set = FALSE;
- simopts->im_format.planes= ibuf->planes;
+ simopts->im_format.planes = ibuf->planes;
- if(ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) {
+ if (ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) {
/* imtype */
- simopts->im_format= scene->r.im_format;
- is_depth_set= TRUE;
+ simopts->im_format = scene->r.im_format;
+ is_depth_set = TRUE;
}
else if (ima->source == IMA_SRC_GENERATED) {
- simopts->im_format.imtype= R_IMF_IMTYPE_PNG;
+ simopts->im_format.imtype = R_IMF_IMTYPE_PNG;
}
else {
- simopts->im_format.imtype= BKE_ftype_to_imtype(ibuf->ftype);
+ simopts->im_format.imtype = BKE_ftype_to_imtype(ibuf->ftype);
}
//simopts->subimtype= scene->r.subimtype; /* XXX - this is lame, we need to make these available too! */
- simopts->im_format.quality= ibuf->ftype & 0xff;
+ simopts->im_format.quality = ibuf->ftype & 0xff;
BLI_strncpy(simopts->filepath, ibuf->name, sizeof(simopts->filepath));
/* 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;
+ simopts->im_format.planes = R_IMF_PLANES_RGBA;
}
/* depth, account for float buffer and format support */
if (is_depth_set == FALSE) {
- simopts->im_format.depth= imtype_best_depth(ibuf, simopts->im_format.imtype);
+ simopts->im_format.depth = imtype_best_depth(ibuf, simopts->im_format.imtype);
}
- /* some formats dont use quality so fallback to scenes quality */
+ /* some formats don't use quality so fallback to scenes quality */
if (simopts->im_format.quality == 0) {
- simopts->im_format.quality= scene->r.im_format.quality;
+ simopts->im_format.quality = scene->r.im_format.quality;
}
/* check for empty path */
- if(guess_path && simopts->filepath[0]==0) {
+ if (guess_path && simopts->filepath[0] == 0) {
if ( (G.ima[0] == '/') && (G.ima[1] == '/') && (G.ima[2] == '\0') ) {
BLI_strncpy(simopts->filepath, "//untitled", FILE_MAX);
- } else {
+ }
+ else {
BLI_strncpy(simopts->filepath, G.ima, FILE_MAX);
}
BLI_path_abs(simopts->filepath, G.main->name);
@@ -1093,7 +1094,7 @@ static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima,
static void save_image_options_from_op(SaveImageOptions *simopts, wmOperator *op)
{
if (op->customdata) {
- simopts->im_format= *(ImageFormatData *)op->customdata;
+ simopts->im_format = *(ImageFormatData *)op->customdata;
}
if (RNA_struct_property_is_set(op->ptr, "filepath")) {
@@ -1105,7 +1106,7 @@ static void save_image_options_from_op(SaveImageOptions *simopts, wmOperator *op
static void save_image_options_to_op(SaveImageOptions *simopts, wmOperator *op)
{
if (op->customdata) {
- *(ImageFormatData *)op->customdata= simopts->im_format;
+ *(ImageFormatData *)op->customdata = simopts->im_format;
}
RNA_string_set(op->ptr, "filepath", simopts->filepath);
@@ -1115,44 +1116,44 @@ static void save_image_options_to_op(SaveImageOptions *simopts, wmOperator *op)
/* ima->name and ibuf->name should end up the same */
static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveImageOptions *simopts, int do_newpath)
{
- Image *ima= ED_space_image(sima);
+ Image *ima = ED_space_image(sima);
void *lock;
- ImBuf *ibuf= ED_space_image_acquire_buffer(sima, &lock);
+ ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock);
if (ibuf) {
- const char *relbase= ID_BLEND_PATH(CTX_data_main(C), &ima->id);
- const short relative= (RNA_struct_find_property(op->ptr, "relative_path") && RNA_boolean_get(op->ptr, "relative_path"));
- const short save_copy= (RNA_struct_find_property(op->ptr, "copy") && RNA_boolean_get(op->ptr, "copy"));
- short ok= FALSE;
+ const char *relbase = ID_BLEND_PATH(CTX_data_main(C), &ima->id);
+ const short relative = (RNA_struct_find_property(op->ptr, "relative_path") && RNA_boolean_get(op->ptr, "relative_path"));
+ const short save_copy = (RNA_struct_find_property(op->ptr, "copy") && RNA_boolean_get(op->ptr, "copy"));
+ short ok = FALSE;
/* old global to ensure a 2nd save goes to same dir */
BLI_strncpy(G.ima, simopts->filepath, sizeof(G.ima));
WM_cursor_wait(1);
- if(ima->type == IMA_TYPE_R_RESULT) {
+ if (ima->type == IMA_TYPE_R_RESULT) {
/* enforce user setting for RGB or RGBA, but skip BW */
- if(simopts->im_format.planes==R_IMF_PLANES_RGBA) {
- ibuf->planes= R_IMF_PLANES_RGBA;
+ if (simopts->im_format.planes == R_IMF_PLANES_RGBA) {
+ ibuf->planes = R_IMF_PLANES_RGBA;
}
- else if(simopts->im_format.planes==R_IMF_PLANES_RGB) {
- ibuf->planes= R_IMF_PLANES_RGB;
+ else if (simopts->im_format.planes == R_IMF_PLANES_RGB) {
+ ibuf->planes = R_IMF_PLANES_RGB;
}
}
else {
/* TODO, better solution, if a 24bit image is painted onto it may contain alpha */
- if(ibuf->userflags & IB_BITMAPDIRTY) { /* it has been painted onto */
+ if (ibuf->userflags & IB_BITMAPDIRTY) { /* it has been painted onto */
/* checks each pixel, not ideal */
- ibuf->planes= BKE_alphatest_ibuf(ibuf) ? 32 : 24;
+ ibuf->planes = BKE_alphatest_ibuf(ibuf) ? 32 : 24;
}
}
- if(simopts->im_format.imtype==R_IMF_IMTYPE_MULTILAYER) {
- Scene *scene= CTX_data_scene(C);
- RenderResult *rr= BKE_image_acquire_renderresult(scene, ima);
- if(rr) {
+ if (simopts->im_format.imtype == R_IMF_IMTYPE_MULTILAYER) {
+ Scene *scene = CTX_data_scene(C);
+ RenderResult *rr = BKE_image_acquire_renderresult(scene, ima);
+ if (rr) {
RE_WriteRenderResult(op->reports, rr, simopts->filepath, simopts->im_format.quality);
- ok= TRUE;
+ ok = TRUE;
}
else {
BKE_report(op->reports, RPT_ERROR, "Did not write, no Multilayer Image");
@@ -1161,13 +1162,13 @@ static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
}
else {
if (BKE_write_ibuf_as(ibuf, simopts->filepath, &simopts->im_format, save_copy)) {
- ok= TRUE;
+ ok = TRUE;
}
}
- if (ok) {
- if(!save_copy) {
- if(do_newpath) {
+ if (ok) {
+ if (!save_copy) {
+ if (do_newpath) {
BLI_strncpy(ibuf->name, simopts->filepath, sizeof(ibuf->name));
BLI_strncpy(ima->name, simopts->filepath, sizeof(ima->name));
}
@@ -1175,28 +1176,28 @@ static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
ibuf->userflags &= ~IB_BITMAPDIRTY;
/* change type? */
- if(ima->type==IMA_TYPE_R_RESULT) {
- ima->type= IMA_TYPE_IMAGE;
+ if (ima->type == IMA_TYPE_R_RESULT) {
+ ima->type = IMA_TYPE_IMAGE;
/* workaround to ensure the render result buffer is no longer used
* by this image, otherwise can crash when a new render result is
* created. */
- if(ibuf->rect && !(ibuf->mall & IB_rect))
+ if (ibuf->rect && !(ibuf->mall & IB_rect))
imb_freerectImBuf(ibuf);
- if(ibuf->rect_float && !(ibuf->mall & IB_rectfloat))
+ if (ibuf->rect_float && !(ibuf->mall & IB_rectfloat))
imb_freerectfloatImBuf(ibuf);
- if(ibuf->zbuf && !(ibuf->mall & IB_zbuf))
+ if (ibuf->zbuf && !(ibuf->mall & IB_zbuf))
IMB_freezbufImBuf(ibuf);
- if(ibuf->zbuf_float && !(ibuf->mall & IB_zbuffloat))
+ if (ibuf->zbuf_float && !(ibuf->mall & IB_zbuffloat))
IMB_freezbuffloatImBuf(ibuf);
}
- if( ELEM(ima->source, IMA_SRC_GENERATED, IMA_SRC_VIEWER)) {
- ima->source= IMA_SRC_FILE;
- ima->type= IMA_TYPE_IMAGE;
+ if (ELEM(ima->source, IMA_SRC_GENERATED, IMA_SRC_VIEWER)) {
+ ima->source = IMA_SRC_FILE;
+ ima->type = IMA_TYPE_IMAGE;
}
/* only image path, never ibuf */
- if(relative) {
+ if (relative) {
BLI_path_rel(ima->name, relbase); /* only after saving */
}
}
@@ -1206,7 +1207,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
}
- WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, sima->image);
+ WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, sima->image);
WM_cursor_wait(0);
}
@@ -1218,18 +1219,18 @@ static void image_save_as_free(wmOperator *op)
{
if (op->customdata) {
MEM_freeN(op->customdata);
- op->customdata= NULL;
+ op->customdata = NULL;
}
}
static int image_save_as_exec(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
SaveImageOptions simopts;
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);
@@ -1244,10 +1245,10 @@ static int image_save_as_exec(bContext *C, wmOperator *op)
static int image_save_as_check(bContext *UNUSED(C), wmOperator *op)
{
- ImageFormatData *imf= op->customdata;
+ ImageFormatData *imf = op->customdata;
char filepath[FILE_MAX];
RNA_string_get(op->ptr, "filepath", filepath);
- if(BKE_add_image_extension(filepath, imf->imtype)) {
+ if (BKE_add_image_extension(filepath, imf->imtype)) {
RNA_string_set(op->ptr, "filepath", filepath);
return TRUE;
}
@@ -1256,12 +1257,12 @@ static int image_save_as_check(bContext *UNUSED(C), wmOperator *op)
static int image_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- SpaceImage *sima= CTX_wm_space_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
Image *ima = ED_space_image(sima);
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
SaveImageOptions simopts;
- if(RNA_struct_property_is_set(op->ptr, "filepath"))
+ if (RNA_struct_property_is_set(op->ptr, "filepath"))
return image_save_as_exec(C, op);
if (save_image_options_init(&simopts, sima, scene, TRUE) == 0)
@@ -1269,11 +1270,11 @@ static int image_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
save_image_options_to_op(&simopts, op);
/* enable save_copy by default for render results */
- if(ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE) && !RNA_struct_property_is_set(op->ptr, "copy")) {
+ if (ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE) && !RNA_struct_property_is_set(op->ptr, "copy")) {
RNA_boolean_set(op->ptr, "copy", TRUE);
}
- op->customdata= MEM_mallocN(sizeof(simopts.im_format), __func__);
+ op->customdata = MEM_mallocN(sizeof(simopts.im_format), __func__);
memcpy(op->customdata, &simopts.im_format, sizeof(simopts.im_format));
image_filesel(C, op, simopts.filepath);
@@ -1290,7 +1291,7 @@ static int image_save_as_cancel(bContext *UNUSED(C), wmOperator *op)
static int image_save_as_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
{
- const char *prop_id= RNA_property_identifier(prop);
+ const char *prop_id = RNA_property_identifier(prop);
return !(strcmp(prop_id, "filepath") == 0 ||
strcmp(prop_id, "directory") == 0 ||
@@ -1302,8 +1303,8 @@ static int image_save_as_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
static void image_save_as_draw(bContext *UNUSED(C), wmOperator *op)
{
- uiLayout *layout= op->layout;
- ImageFormatData *imf= op->customdata;
+ uiLayout *layout = op->layout;
+ ImageFormatData *imf = op->customdata;
PointerRNA ptr;
/* image template */
@@ -1320,32 +1321,32 @@ void IMAGE_OT_save_as(wmOperatorType *ot)
// PropertyRNA *prop;
/* identifiers */
- ot->name= "Save As Image";
- ot->idname= "IMAGE_OT_save_as";
+ ot->name = "Save As Image";
+ ot->idname = "IMAGE_OT_save_as";
/* api callbacks */
- ot->exec= image_save_as_exec;
- ot->check= image_save_as_check;
- ot->invoke= image_save_as_invoke;
- ot->cancel= image_save_as_cancel;
- ot->ui= image_save_as_draw;
- ot->poll= space_image_buffer_exists_poll;
+ ot->exec = image_save_as_exec;
+ ot->check = image_save_as_check;
+ ot->invoke = image_save_as_invoke;
+ ot->cancel = image_save_as_cancel;
+ ot->ui = image_save_as_draw;
+ ot->poll = space_image_buffer_exists_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "copy", 0, "Copy", "Create a new image file without modifying the current image in blender");
- WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE | MOVIEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
}
/******************** save image operator ********************/
static int image_save_exec(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- Scene *scene= CTX_data_scene(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ Scene *scene = CTX_data_scene(C);
SaveImageOptions simopts;
if (save_image_options_init(&simopts, sima, scene, FALSE) == 0)
@@ -1366,53 +1367,53 @@ static int image_save_exec(bContext *C, wmOperator *op)
void IMAGE_OT_save(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Save Image";
- ot->idname= "IMAGE_OT_save";
+ ot->name = "Save Image";
+ ot->idname = "IMAGE_OT_save";
/* api callbacks */
- ot->exec= image_save_exec;
- ot->poll= space_image_file_exists_poll;
+ ot->exec = image_save_exec;
+ ot->poll = space_image_file_exists_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/******************* save sequence operator ********************/
static int image_save_sequence_exec(bContext *C, wmOperator *op)
{
- Main *bmain= CTX_data_main(C);
- SpaceImage *sima= CTX_wm_space_image(C);
+ Main *bmain = CTX_data_main(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
ImBuf *ibuf;
- int tot= 0;
+ int tot = 0;
char di[FILE_MAX], fi[FILE_MAX];
- if(sima->image==NULL)
+ if (sima->image == NULL)
return OPERATOR_CANCELLED;
- if(sima->image->source!=IMA_SRC_SEQUENCE) {
+ if (sima->image->source != IMA_SRC_SEQUENCE) {
BKE_report(op->reports, RPT_ERROR, "Can only save sequence on image sequences");
return OPERATOR_CANCELLED;
}
- if(sima->image->type==IMA_TYPE_MULTILAYER) {
+ if (sima->image->type == IMA_TYPE_MULTILAYER) {
BKE_report(op->reports, RPT_ERROR, "Can't save multilayer sequences");
return OPERATOR_CANCELLED;
}
/* get total */
- for(ibuf= sima->image->ibufs.first; ibuf; ibuf= ibuf->next)
- if(ibuf->userflags & IB_BITMAPDIRTY)
+ for (ibuf = sima->image->ibufs.first; ibuf; ibuf = ibuf->next)
+ if (ibuf->userflags & IB_BITMAPDIRTY)
tot++;
- if(tot==0) {
+ if (tot == 0) {
BKE_report(op->reports, RPT_WARNING, "No images have been changed");
return OPERATOR_CANCELLED;
}
/* get a filename for menu */
- for(ibuf= sima->image->ibufs.first; ibuf; ibuf= ibuf->next)
- if(ibuf->userflags & IB_BITMAPDIRTY)
+ for (ibuf = sima->image->ibufs.first; ibuf; ibuf = ibuf->next)
+ if (ibuf->userflags & IB_BITMAPDIRTY)
break;
BLI_strncpy(di, ibuf->name, FILE_MAX);
@@ -1420,14 +1421,14 @@ static int image_save_sequence_exec(bContext *C, wmOperator *op)
BKE_reportf(op->reports, RPT_INFO, "%d Image(s) will be saved in %s", tot, di);
- for(ibuf= sima->image->ibufs.first; ibuf; ibuf= ibuf->next) {
- if(ibuf->userflags & IB_BITMAPDIRTY) {
+ for (ibuf = sima->image->ibufs.first; ibuf; ibuf = ibuf->next) {
+ if (ibuf->userflags & IB_BITMAPDIRTY) {
char name[FILE_MAX];
BLI_strncpy(name, ibuf->name, sizeof(name));
BLI_path_abs(name, bmain->name);
- if(0 == IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat)) {
+ if (0 == IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat)) {
BKE_reportf(op->reports, RPT_ERROR, "Could not write image %s", name);
break;
}
@@ -1443,34 +1444,34 @@ static int image_save_sequence_exec(bContext *C, wmOperator *op)
void IMAGE_OT_save_sequence(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Save Sequence";
- ot->idname= "IMAGE_OT_save_sequence";
+ ot->name = "Save Sequence";
+ ot->idname = "IMAGE_OT_save_sequence";
/* api callbacks */
- ot->exec= image_save_sequence_exec;
- ot->poll= space_image_buffer_exists_poll;
+ ot->exec = image_save_sequence_exec;
+ ot->poll = space_image_buffer_exists_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/******************** reload image operator ********************/
static int image_reload_exec(bContext *C, wmOperator *UNUSED(op))
{
- Image *ima= CTX_data_edit_image(C);
- SpaceImage *sima= CTX_wm_space_image(C);
+ Image *ima = CTX_data_edit_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
- if(!ima)
+ if (!ima)
return OPERATOR_CANCELLED;
/* XXX unpackImage frees image buffers */
ED_preview_kill_jobs(C);
// XXX other users?
- BKE_image_signal(ima, (sima)? &sima->iuser: NULL, IMA_SIGNAL_RELOAD);
+ BKE_image_signal(ima, (sima) ? &sima->iuser : NULL, IMA_SIGNAL_RELOAD);
- WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima);
+ WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, ima);
return OPERATOR_FINISHED;
}
@@ -1478,14 +1479,14 @@ static int image_reload_exec(bContext *C, wmOperator *UNUSED(op))
void IMAGE_OT_reload(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reload Image";
- ot->idname= "IMAGE_OT_reload";
+ ot->name = "Reload Image";
+ ot->idname = "IMAGE_OT_reload";
/* api callbacks */
- ot->exec= image_reload_exec;
+ ot->exec = image_reload_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER; /* no undo, image buffer is not handled by undo */
+ ot->flag = OPTYPE_REGISTER; /* no undo, image buffer is not handled by undo */
}
/********************** new image operator *********************/
@@ -1498,38 +1499,38 @@ static int image_new_exec(bContext *C, wmOperator *op)
Image *ima;
PointerRNA ptr, idptr;
PropertyRNA *prop;
- char name[MAX_ID_NAME-2];
+ char name[MAX_ID_NAME - 2];
float color[4];
int width, height, floatbuf, uvtestgrid, alpha;
/* retrieve state */
- sima= CTX_wm_space_image(C);
- scene= CTX_data_scene(C);
- obedit= CTX_data_edit_object(C);
+ sima = CTX_wm_space_image(C);
+ scene = CTX_data_scene(C);
+ obedit = CTX_data_edit_object(C);
RNA_string_get(op->ptr, "name", name);
- width= RNA_int_get(op->ptr, "width");
- height= RNA_int_get(op->ptr, "height");
- floatbuf= RNA_boolean_get(op->ptr, "float");
- uvtestgrid= RNA_boolean_get(op->ptr, "uv_test_grid");
+ width = RNA_int_get(op->ptr, "width");
+ height = RNA_int_get(op->ptr, "height");
+ floatbuf = RNA_boolean_get(op->ptr, "float");
+ uvtestgrid = RNA_boolean_get(op->ptr, "uv_test_grid");
RNA_float_get_array(op->ptr, "color", color);
- alpha= RNA_boolean_get(op->ptr, "alpha");
+ alpha = RNA_boolean_get(op->ptr, "alpha");
if (!floatbuf && scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
linearrgb_to_srgb_v3_v3(color, color);
- if(!alpha)
- color[3]= 1.0f;
+ if (!alpha)
+ color[3] = 1.0f;
ima = BKE_add_image_size(width, height, name, alpha ? 32 : 24, floatbuf, uvtestgrid, color);
- if(!ima)
+ if (!ima)
return OPERATOR_CANCELLED;
/* hook into UI */
uiIDContextProperty(C, &ptr, &prop);
- if(prop) {
+ if (prop) {
/* when creating new ID blocks, use is already 1, but RNA
* pointer se also increases user, so this compensates it */
ima->id.us--;
@@ -1538,11 +1539,11 @@ static int image_new_exec(bContext *C, wmOperator *op)
RNA_property_pointer_set(&ptr, prop, idptr);
RNA_property_update(C, &ptr, prop);
}
- else if(sima)
+ else if (sima)
ED_space_image_set(sima, scene, obedit, ima);
// XXX other users?
- BKE_image_signal(ima, (sima)? &sima->iuser: NULL, IMA_SIGNAL_USER_NEW_IMAGE);
+ BKE_image_signal(ima, (sima) ? &sima->iuser : NULL, IMA_SIGNAL_USER_NEW_IMAGE);
return OPERATOR_FINISHED;
}
@@ -1557,25 +1558,25 @@ static int image_new_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void IMAGE_OT_new(wmOperatorType *ot)
{
PropertyRNA *prop;
- static float default_color[4]= {0.0f, 0.0f, 0.0f, 1.0f};
+ static float default_color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
/* identifiers */
- ot->name= "New Image";
- ot->description= "Create a new image";
- ot->idname= "IMAGE_OT_new";
+ ot->name = "New Image";
+ ot->description = "Create a new image";
+ ot->idname = "IMAGE_OT_new";
/* api callbacks */
- ot->exec= image_new_exec;
- ot->invoke= image_new_invoke;
+ ot->exec = image_new_exec;
+ ot->invoke = image_new_invoke;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* properties */
- RNA_def_string(ot->srna, "name", "untitled", MAX_ID_NAME-2, "Name", "Image datablock name");
+ RNA_def_string(ot->srna, "name", "untitled", MAX_ID_NAME - 2, "Name", "Image datablock name");
RNA_def_int(ot->srna, "width", 1024, 1, INT_MAX, "Width", "Image width", 1, 16384);
RNA_def_int(ot->srna, "height", 1024, 1, INT_MAX, "Height", "Image height", 1, 16384);
- prop= RNA_def_float_color(ot->srna, "color", 4, NULL, 0.0f, FLT_MAX, "Color", "Default fill color", 0.0f, 1.0f);
+ prop = RNA_def_float_color(ot->srna, "color", 4, NULL, 0.0f, FLT_MAX, "Color", "Default fill color", 0.0f, 1.0f);
RNA_def_property_float_array_default(prop, default_color);
RNA_def_boolean(ot->srna, "alpha", 1, "Alpha", "Create an image with an alpha channel");
RNA_def_boolean(ot->srna, "uv_test_grid", 0, "UV Test Grid", "Fill the image with a grid for UV map testing");
@@ -1586,53 +1587,53 @@ void IMAGE_OT_new(wmOperatorType *ot)
static int image_invert_poll(bContext *C)
{
- Image *ima= CTX_data_edit_image(C);
- ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
+ Image *ima = CTX_data_edit_image(C);
+ ImBuf *ibuf = BKE_image_get_ibuf(ima, NULL);
- if( ibuf != NULL )
+ if (ibuf != NULL)
return 1;
return 0;
}
static int image_invert_exec(bContext *C, wmOperator *op)
{
- Image *ima= CTX_data_edit_image(C);
- ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
+ Image *ima = CTX_data_edit_image(C);
+ ImBuf *ibuf = BKE_image_get_ibuf(ima, NULL);
// flags indicate if this channel should be inverted
- const short r= RNA_boolean_get(op->ptr, "invert_r");
- const short g= RNA_boolean_get(op->ptr, "invert_g");
- const short b= RNA_boolean_get(op->ptr, "invert_b");
- const short a= RNA_boolean_get(op->ptr, "invert_a");
+ const short r = RNA_boolean_get(op->ptr, "invert_r");
+ const short g = RNA_boolean_get(op->ptr, "invert_g");
+ const short b = RNA_boolean_get(op->ptr, "invert_b");
+ const short a = RNA_boolean_get(op->ptr, "invert_a");
int i;
- if( ibuf == NULL) // TODO: this should actually never happen, but does for render-results -> cleanup
+ if (ibuf == NULL) // TODO: this should actually never happen, but does for render-results -> cleanup
return OPERATOR_CANCELLED;
/* TODO: make this into an IMB_invert_channels(ibuf,r,g,b,a) method!? */
if (ibuf->rect_float) {
float *fp = (float *) ibuf->rect_float;
- for( i = ibuf->x * ibuf->y; i > 0; i--, fp+=4 ) {
- if( r ) fp[0] = 1.0f - fp[0];
- if( g ) fp[1] = 1.0f - fp[1];
- if( b ) fp[2] = 1.0f - fp[2];
- if( a ) fp[3] = 1.0f - fp[3];
+ for (i = ibuf->x * ibuf->y; i > 0; i--, fp += 4) {
+ if (r) fp[0] = 1.0f - fp[0];
+ if (g) fp[1] = 1.0f - fp[1];
+ if (b) fp[2] = 1.0f - fp[2];
+ if (a) fp[3] = 1.0f - fp[3];
}
- if(ibuf->rect) {
+ if (ibuf->rect) {
IMB_rect_from_float(ibuf);
}
}
- else if(ibuf->rect) {
+ else if (ibuf->rect) {
char *cp = (char *) ibuf->rect;
- for( i = ibuf->x * ibuf->y; i > 0; i--, cp+=4 ) {
- if( r ) cp[0] = 255 - cp[0];
- if( g ) cp[1] = 255 - cp[1];
- if( b ) cp[2] = 255 - cp[2];
- if( a ) cp[3] = 255 - cp[3];
+ for (i = ibuf->x * ibuf->y; i > 0; i--, cp += 4) {
+ if (r) cp[0] = 255 - cp[0];
+ if (g) cp[1] = 255 - cp[1];
+ if (b) cp[2] = 255 - cp[2];
+ if (a) cp[3] = 255 - cp[3];
}
}
else {
@@ -1640,22 +1641,22 @@ static int image_invert_exec(bContext *C, wmOperator *op)
}
ibuf->userflags |= IB_BITMAPDIRTY;
- if(ibuf->mipmap[0])
+ if (ibuf->mipmap[0])
ibuf->userflags |= IB_MIPMAP_INVALID;
- WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima);
+ WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, ima);
return OPERATOR_FINISHED;
}
void IMAGE_OT_invert(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Invert Channels";
- ot->idname= "IMAGE_OT_invert";
+ ot->name = "Invert Channels";
+ ot->idname = "IMAGE_OT_invert";
/* api callbacks */
- ot->exec= image_invert_exec;
- ot->poll= image_invert_poll;
+ ot->exec = image_invert_exec;
+ ot->poll = image_invert_poll;
/* properties */
RNA_def_boolean(ot->srna, "invert_r", 0, "Red", "Invert Red Channel");
@@ -1664,22 +1665,22 @@ void IMAGE_OT_invert(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "invert_a", 0, "Alpha", "Invert Alpha Channel");
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/********************* pack operator *********************/
static int image_pack_test(bContext *C, wmOperator *op)
{
- Image *ima= CTX_data_edit_image(C);
- int as_png= RNA_boolean_get(op->ptr, "as_png");
+ Image *ima = CTX_data_edit_image(C);
+ int as_png = RNA_boolean_get(op->ptr, "as_png");
- if(!ima)
+ if (!ima)
return 0;
- if(!as_png && ima->packedfile)
+ if (!as_png && ima->packedfile)
return 0;
- if(ima->source==IMA_SRC_SEQUENCE || ima->source==IMA_SRC_MOVIE) {
+ if (ima->source == IMA_SRC_SEQUENCE || ima->source == IMA_SRC_MOVIE) {
BKE_report(op->reports, RPT_ERROR, "Packing movies or image sequences not supported");
return 0;
}
@@ -1689,43 +1690,43 @@ static int image_pack_test(bContext *C, wmOperator *op)
static int image_pack_exec(bContext *C, wmOperator *op)
{
- struct Main *bmain= CTX_data_main(C);
- Image *ima= CTX_data_edit_image(C);
- ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
- int as_png= RNA_boolean_get(op->ptr, "as_png");
+ struct Main *bmain = CTX_data_main(C);
+ Image *ima = CTX_data_edit_image(C);
+ ImBuf *ibuf = BKE_image_get_ibuf(ima, NULL);
+ int as_png = RNA_boolean_get(op->ptr, "as_png");
- if(!image_pack_test(C, op))
+ if (!image_pack_test(C, op))
return OPERATOR_CANCELLED;
- if(!as_png && (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))) {
+ if (!as_png && (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))) {
BKE_report(op->reports, RPT_ERROR, "Can't pack edited image from disk, only as internal PNG");
return OPERATOR_CANCELLED;
}
- if(as_png)
+ if (as_png)
BKE_image_memorypack(ima);
else
- ima->packedfile= newPackedFile(op->reports, ima->name, ID_BLEND_PATH(bmain, &ima->id));
+ ima->packedfile = newPackedFile(op->reports, ima->name, ID_BLEND_PATH(bmain, &ima->id));
- WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima);
+ WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, ima);
return OPERATOR_FINISHED;
}
static int image_pack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- Image *ima= CTX_data_edit_image(C);
- ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
+ Image *ima = CTX_data_edit_image(C);
+ ImBuf *ibuf = BKE_image_get_ibuf(ima, NULL);
uiPopupMenu *pup;
uiLayout *layout;
- int as_png= RNA_boolean_get(op->ptr, "as_png");
+ int as_png = RNA_boolean_get(op->ptr, "as_png");
- if(!image_pack_test(C, op))
+ if (!image_pack_test(C, op))
return OPERATOR_CANCELLED;
- if(!as_png && (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))) {
- pup= uiPupMenuBegin(C, "OK", ICON_QUESTION);
- layout= uiPupMenuLayout(pup);
+ if (!as_png && (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))) {
+ pup = uiPupMenuBegin(C, "OK", ICON_QUESTION);
+ layout = uiPupMenuLayout(pup);
uiItemBooleanO(layout, "Can't pack edited image from disk. Pack as internal PNG?", ICON_NONE, op->idname, "as_png", 1);
uiPupMenuEnd(C, pup);
@@ -1738,16 +1739,16 @@ static int image_pack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
void IMAGE_OT_pack(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Pack Image";
- ot->description= "Pack an image as embedded data into the .blend file";
- ot->idname= "IMAGE_OT_pack";
+ ot->name = "Pack Image";
+ ot->description = "Pack an image as embedded data into the .blend file";
+ ot->idname = "IMAGE_OT_pack";
/* api callbacks */
- ot->exec= image_pack_exec;
- ot->invoke= image_pack_invoke;
+ ot->exec = image_pack_exec;
+ ot->invoke = image_pack_invoke;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "as_png", 0, "Pack As PNG", "Pack image as lossless PNG");
@@ -1757,26 +1758,26 @@ void IMAGE_OT_pack(wmOperatorType *ot)
static int image_unpack_exec(bContext *C, wmOperator *op)
{
- Image *ima= CTX_data_edit_image(C);
- int method= RNA_enum_get(op->ptr, "method");
+ Image *ima = CTX_data_edit_image(C);
+ int method = RNA_enum_get(op->ptr, "method");
/* find the suppplied image by name */
if (RNA_struct_property_is_set(op->ptr, "id")) {
- char imaname[MAX_ID_NAME-2];
+ char imaname[MAX_ID_NAME - 2];
RNA_string_get(op->ptr, "id", imaname);
ima = BLI_findstring(&CTX_data_main(C)->image, imaname, offsetof(ID, name) + 2);
if (!ima) ima = CTX_data_edit_image(C);
}
- if(!ima || !ima->packedfile)
+ if (!ima || !ima->packedfile)
return OPERATOR_CANCELLED;
- if(ima->source==IMA_SRC_SEQUENCE || ima->source==IMA_SRC_MOVIE) {
+ if (ima->source == IMA_SRC_SEQUENCE || ima->source == IMA_SRC_MOVIE) {
BKE_report(op->reports, RPT_ERROR, "Unpacking movies or image sequences not supported");
return OPERATOR_CANCELLED;
}
- if(G.fileflags & G_AUTOPACK)
+ if (G.fileflags & G_AUTOPACK)
BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save");
/* XXX unpackImage frees image buffers */
@@ -1784,30 +1785,30 @@ static int image_unpack_exec(bContext *C, wmOperator *op)
unpackImage(op->reports, ima, method);
- WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima);
+ WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, ima);
return OPERATOR_FINISHED;
}
static int image_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- Image *ima= CTX_data_edit_image(C);
+ Image *ima = CTX_data_edit_image(C);
- if(RNA_struct_property_is_set(op->ptr, "id"))
+ if (RNA_struct_property_is_set(op->ptr, "id"))
return image_unpack_exec(C, op);
- if(!ima || !ima->packedfile)
+ if (!ima || !ima->packedfile)
return OPERATOR_CANCELLED;
- if(ima->source==IMA_SRC_SEQUENCE || ima->source==IMA_SRC_MOVIE) {
+ if (ima->source == IMA_SRC_SEQUENCE || ima->source == IMA_SRC_MOVIE) {
BKE_report(op->reports, RPT_ERROR, "Unpacking movies or image sequences not supported");
return OPERATOR_CANCELLED;
}
- if(G.fileflags & G_AUTOPACK)
+ if (G.fileflags & G_AUTOPACK)
BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save");
- unpack_menu(C, "IMAGE_OT_unpack", ima->id.name+2, ima->name, "textures", ima->packedfile);
+ unpack_menu(C, "IMAGE_OT_unpack", ima->id.name + 2, ima->name, "textures", ima->packedfile);
return OPERATOR_FINISHED;
}
@@ -1815,20 +1816,20 @@ static int image_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
void IMAGE_OT_unpack(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Unpack Image";
- ot->description= "Save an image packed in the .blend file to disk";
- ot->idname= "IMAGE_OT_unpack";
+ ot->name = "Unpack Image";
+ ot->description = "Save an image packed in the .blend file to disk";
+ ot->idname = "IMAGE_OT_unpack";
/* api callbacks */
- ot->exec= image_unpack_exec;
- ot->invoke= image_unpack_invoke;
+ ot->exec = image_unpack_exec;
+ ot->invoke = image_unpack_invoke;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack");
- RNA_def_string(ot->srna, "id", "", MAX_ID_NAME-2, "Image Name", "Image datablock name to unpack"); /* XXX, weark!, will fail with library, name collisions */
+ RNA_def_string(ot->srna, "id", "", MAX_ID_NAME - 2, "Image Name", "Image datablock name to unpack"); /* XXX, weark!, will fail with library, name collisions */
}
/******************** sample image operator ********************/
@@ -1854,8 +1855,8 @@ typedef struct ImageSampleInfo {
static void image_sample_draw(const bContext *UNUSED(C), ARegion *ar, void *arg_info)
{
- ImageSampleInfo *info= arg_info;
- if(info->draw) {
+ ImageSampleInfo *info = arg_info;
+ if (info->draw) {
/* no color management needed for images (color_manage=0) */
ED_image_draw_info(ar, 0, info->channels, info->x, info->y, info->colp, info->colfp, info->zp, info->zfp);
}
@@ -1863,85 +1864,85 @@ static void image_sample_draw(const bContext *UNUSED(C), ARegion *ar, void *arg_
static void image_sample_apply(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ARegion *ar = CTX_wm_region(C);
void *lock;
- ImBuf *ibuf= ED_space_image_acquire_buffer(sima, &lock);
- ImageSampleInfo *info= op->customdata;
+ ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock);
+ ImageSampleInfo *info = op->customdata;
float fx, fy;
- if(ibuf == NULL) {
+ if (ibuf == NULL) {
ED_space_image_release_buffer(sima, lock);
return;
}
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fx, &fy);
- if(fx>=0.0f && fy>=0.0f && fx<1.0f && fy<1.0f) {
+ if (fx >= 0.0f && fy >= 0.0f && fx < 1.0f && fy < 1.0f) {
float *fp;
unsigned char *cp;
- int x= (int)(fx*ibuf->x), y= (int)(fy*ibuf->y);
+ int x = (int)(fx * ibuf->x), y = (int)(fy * ibuf->y);
- CLAMP(x, 0, ibuf->x-1);
- CLAMP(y, 0, ibuf->y-1);
+ CLAMP(x, 0, ibuf->x - 1);
+ CLAMP(y, 0, ibuf->y - 1);
- info->x= x;
- info->y= y;
- info->draw= 1;
- info->channels= ibuf->channels;
+ info->x = x;
+ info->y = y;
+ info->draw = 1;
+ info->channels = ibuf->channels;
- info->colp= NULL;
- info->colfp= NULL;
- info->zp= NULL;
- info->zfp= NULL;
+ info->colp = NULL;
+ info->colfp = NULL;
+ info->zp = NULL;
+ info->zfp = NULL;
- if(ibuf->rect) {
- cp= (unsigned char *)(ibuf->rect + y*ibuf->x + x);
-
- info->col[0]= cp[0];
- info->col[1]= cp[1];
- info->col[2]= cp[2];
- info->col[3]= cp[3];
- info->colp= info->col;
-
- info->colf[0]= (float)cp[0]/255.0f;
- info->colf[1]= (float)cp[1]/255.0f;
- info->colf[2]= (float)cp[2]/255.0f;
- info->colf[3]= (float)cp[3]/255.0f;
- info->colfp= info->colf;
+ if (ibuf->rect) {
+ cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x);
+
+ info->col[0] = cp[0];
+ info->col[1] = cp[1];
+ info->col[2] = cp[2];
+ info->col[3] = cp[3];
+ info->colp = info->col;
+
+ info->colf[0] = (float)cp[0] / 255.0f;
+ info->colf[1] = (float)cp[1] / 255.0f;
+ info->colf[2] = (float)cp[2] / 255.0f;
+ info->colf[3] = (float)cp[3] / 255.0f;
+ info->colfp = info->colf;
}
- if(ibuf->rect_float) {
- fp= (ibuf->rect_float + (ibuf->channels)*(y*ibuf->x + x));
-
- info->colf[0]= fp[0];
- info->colf[1]= fp[1];
- info->colf[2]= fp[2];
- info->colf[3]= fp[3];
- info->colfp= info->colf;
+ if (ibuf->rect_float) {
+ fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x));
+
+ info->colf[0] = fp[0];
+ info->colf[1] = fp[1];
+ info->colf[2] = fp[2];
+ info->colf[3] = fp[3];
+ info->colfp = info->colf;
}
- if(ibuf->zbuf) {
- info->z= ibuf->zbuf[y*ibuf->x + x];
- info->zp= &info->z;
+ if (ibuf->zbuf) {
+ info->z = ibuf->zbuf[y * ibuf->x + x];
+ info->zp = &info->z;
}
- if(ibuf->zbuf_float) {
- info->zf= ibuf->zbuf_float[y*ibuf->x + x];
- info->zfp= &info->zf;
+ if (ibuf->zbuf_float) {
+ info->zf = ibuf->zbuf_float[y * ibuf->x + x];
+ info->zfp = &info->zf;
}
- if(sima->cumap && ibuf->channels==4) {
+ if (sima->cumap && ibuf->channels == 4) {
/* we reuse this callback for set curves point operators */
- if(RNA_struct_find_property(op->ptr, "point")) {
- int point= RNA_enum_get(op->ptr, "point");
+ if (RNA_struct_find_property(op->ptr, "point")) {
+ int point = RNA_enum_get(op->ptr, "point");
- if(point == 1) {
+ if (point == 1) {
curvemapping_set_black_white(sima->cumap, NULL, info->colfp);
- if(ibuf->rect_float)
+ if (ibuf->rect_float)
curvemapping_do_ibuf(sima->cumap, ibuf);
}
- else if(point == 0) {
+ else if (point == 0) {
curvemapping_set_black_white(sima->cumap, info->colfp, NULL);
- if(ibuf->rect_float)
+ if (ibuf->rect_float)
curvemapping_do_ibuf(sima->cumap, ibuf);
}
}
@@ -1950,22 +1951,22 @@ static void image_sample_apply(bContext *C, wmOperator *op, wmEvent *event)
// XXX node curve integration ..
#if 0
{
- ScrArea *sa, *cur= curarea;
+ ScrArea *sa, *cur = curarea;
- node_curvemap_sample(fp); /* sends global to node editor */
- for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_NODE) {
+ node_curvemap_sample(fp); /* sends global to node editor */
+ for (sa = G.curscreen->areabase.first; sa; sa = sa->next) {
+ if (sa->spacetype == SPACE_NODE) {
areawinset(sa->win);
scrarea_do_windraw(sa);
}
}
- node_curvemap_sample(NULL); /* clears global in node editor */
- curarea= cur;
+ node_curvemap_sample(NULL); /* clears global in node editor */
+ curarea = cur;
}
#endif
}
else
- info->draw= 0;
+ info->draw = 0;
ED_space_image_release_buffer(sima, lock);
ED_area_tag_redraw(CTX_wm_area(C));
@@ -1973,7 +1974,7 @@ static void image_sample_apply(bContext *C, wmOperator *op, wmEvent *event)
static void image_sample_exit(bContext *C, wmOperator *op)
{
- ImageSampleInfo *info= op->customdata;
+ ImageSampleInfo *info = op->customdata;
ED_region_draw_cb_exit(info->art, info->draw_handle);
ED_area_tag_redraw(CTX_wm_area(C));
@@ -1982,17 +1983,17 @@ static void image_sample_exit(bContext *C, wmOperator *op)
static int image_sample_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ARegion *ar = CTX_wm_region(C);
ImageSampleInfo *info;
- if(!ED_space_image_has_buffer(sima))
+ if (!ED_space_image_has_buffer(sima))
return OPERATOR_CANCELLED;
- info= MEM_callocN(sizeof(ImageSampleInfo), "ImageSampleInfo");
- info->art= ar->type;
+ info = MEM_callocN(sizeof(ImageSampleInfo), "ImageSampleInfo");
+ info->art = ar->type;
info->draw_handle = ED_region_draw_cb_activate(ar->type, image_sample_draw, info, REGION_DRAW_POST_PIXEL);
- op->customdata= info;
+ op->customdata = info;
image_sample_apply(C, op, event);
@@ -2003,7 +2004,7 @@ static int image_sample_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int image_sample_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- switch(event->type) {
+ switch (event->type) {
case LEFTMOUSE:
case RIGHTMOUSE: // XXX hardcoded
image_sample_exit(C, op);
@@ -2025,34 +2026,34 @@ static int image_sample_cancel(bContext *C, wmOperator *op)
void IMAGE_OT_sample(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Sample Color";
- ot->idname= "IMAGE_OT_sample";
+ ot->name = "Sample Color";
+ ot->idname = "IMAGE_OT_sample";
/* api callbacks */
- ot->invoke= image_sample_invoke;
- ot->modal= image_sample_modal;
- ot->cancel= image_sample_cancel;
- ot->poll= space_image_image_sample_poll;
+ ot->invoke = image_sample_invoke;
+ ot->modal = image_sample_modal;
+ ot->cancel = image_sample_cancel;
+ ot->poll = space_image_image_sample_poll;
/* flags */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
}
/******************** sample line operator ********************/
static int image_sample_line_exec(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- ARegion *ar= CTX_wm_region(C);
- Scene *scene= CTX_data_scene(C);
-
- int x_start= RNA_int_get(op->ptr, "xstart");
- int y_start= RNA_int_get(op->ptr, "ystart");
- int x_end= RNA_int_get(op->ptr, "xend");
- int y_end= RNA_int_get(op->ptr, "yend");
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ARegion *ar = CTX_wm_region(C);
+ Scene *scene = CTX_data_scene(C);
+
+ int x_start = RNA_int_get(op->ptr, "xstart");
+ int y_start = RNA_int_get(op->ptr, "ystart");
+ int x_end = RNA_int_get(op->ptr, "xend");
+ int y_end = RNA_int_get(op->ptr, "yend");
void *lock;
- ImBuf *ibuf= ED_space_image_acquire_buffer(sima, &lock);
- Histogram *hist= &sima->sample_line_hist;
+ ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock);
+ Histogram *hist = &sima->sample_line_hist;
float x1f, y1f, x2f, y2f;
int x1, y1, x2, y2;
@@ -2073,25 +2074,26 @@ static int image_sample_line_exec(bContext *C, wmOperator *op)
UI_view2d_region_to_view(&ar->v2d, x_start, y_start, &x1f, &y1f);
UI_view2d_region_to_view(&ar->v2d, x_end, y_end, &x2f, &y2f);
- x1= 0.5f+ x1f*ibuf->x;
- x2= 0.5f+ x2f*ibuf->x;
- y1= 0.5f+ y1f*ibuf->y;
- y2= 0.5f+ y2f*ibuf->y;
+ x1 = 0.5f + x1f * ibuf->x;
+ x2 = 0.5f + x2f * ibuf->x;
+ y1 = 0.5f + y1f * ibuf->y;
+ y2 = 0.5f + y2f * ibuf->y;
hist->channels = 3;
hist->x_resolution = 256;
hist->xmax = 1.0f;
hist->ymax = 1.0f;
- for (i=0; i<256; i++) {
- x= (int)(0.5f + x1 + (float)i*(x2-x1)/255.0f);
- y= (int)(0.5f + y1 + (float)i*(y2-y1)/255.0f);
+ for (i = 0; i < 256; i++) {
+ x = (int)(0.5f + x1 + (float)i * (x2 - x1) / 255.0f);
+ y = (int)(0.5f + y1 + (float)i * (y2 - y1) / 255.0f);
- if (x<0 || y<0 || x>=ibuf->x || y>=ibuf->y) {
- hist->data_luma[i] = hist->data_r[i] = hist->data_g[i]= hist->data_b[i] = 0.0f;
- } else {
+ if (x < 0 || y < 0 || x >= ibuf->x || y >= ibuf->y) {
+ hist->data_luma[i] = hist->data_r[i] = hist->data_g[i] = hist->data_b[i] = 0.0f;
+ }
+ else {
if (ibuf->rect_float) {
- fp= (ibuf->rect_float + (ibuf->channels)*(y*ibuf->x + x));
+ fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x));
if (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
linearrgb_to_srgb_v3_v3(rgb, fp);
@@ -2104,11 +2106,11 @@ static int image_sample_line_exec(bContext *C, wmOperator *op)
hist->data_luma[i] = rgb_to_luma(rgb);
}
else if (ibuf->rect) {
- cp= (unsigned char *)(ibuf->rect + y*ibuf->x + x);
- hist->data_r[i] = (float)cp[0]/255.0f;
- hist->data_g[i] = (float)cp[1]/255.0f;
- hist->data_b[i] = (float)cp[2]/255.0f;
- hist->data_luma[i] = (float)rgb_to_luma_byte(cp)/255.0f;
+ cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x);
+ hist->data_r[i] = (float)cp[0] / 255.0f;
+ hist->data_g[i] = (float)cp[1] / 255.0f;
+ hist->data_b[i] = (float)cp[2] / 255.0f;
+ hist->data_luma[i] = (float)rgb_to_luma_byte(cp) / 255.0f;
}
}
}
@@ -2122,9 +2124,9 @@ static int image_sample_line_exec(bContext *C, wmOperator *op)
static int image_sample_line_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceImage *sima= CTX_wm_space_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
- if(!ED_space_image_has_buffer(sima))
+ if (!ED_space_image_has_buffer(sima))
return OPERATOR_CANCELLED;
return WM_gesture_straightline_invoke(C, op, event);
@@ -2133,18 +2135,18 @@ static int image_sample_line_invoke(bContext *C, wmOperator *op, wmEvent *event)
void IMAGE_OT_sample_line(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Sample Line";
- ot->idname= "IMAGE_OT_sample_line";
+ ot->name = "Sample Line";
+ ot->idname = "IMAGE_OT_sample_line";
/* api callbacks */
- ot->invoke= image_sample_line_invoke;
- ot->modal= WM_gesture_straightline_modal;
- ot->exec= image_sample_line_exec;
- ot->poll= space_image_main_area_poll;
- ot->cancel= WM_gesture_straightline_cancel;
+ ot->invoke = image_sample_line_invoke;
+ ot->modal = WM_gesture_straightline_modal;
+ ot->exec = image_sample_line_exec;
+ ot->poll = space_image_main_area_poll;
+ ot->cancel = WM_gesture_straightline_cancel;
/* flags */
- ot->flag= 0; /* no undo/register since this operates on the space */
+ ot->flag = 0; /* no undo/register since this operates on the space */
WM_operator_properties_gesture_straightline(ot, CURSOR_EDIT);
}
@@ -2153,23 +2155,24 @@ void IMAGE_OT_sample_line(wmOperatorType *ot)
void IMAGE_OT_curves_point_set(wmOperatorType *ot)
{
- static EnumPropertyItem point_items[]= {
+ static EnumPropertyItem point_items[] = {
{0, "BLACK_POINT", 0, "Black Point", ""},
{1, "WHITE_POINT", 0, "White Point", ""},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}
+ };
/* identifiers */
- ot->name= "Set Curves Point";
- ot->idname= "IMAGE_OT_curves_point_set";
+ ot->name = "Set Curves Point";
+ ot->idname = "IMAGE_OT_curves_point_set";
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* api callbacks */
- ot->invoke= image_sample_invoke;
- ot->modal= image_sample_modal;
- ot->cancel= image_sample_cancel;
- ot->poll= space_image_main_area_not_uv_brush_poll;
+ ot->invoke = image_sample_invoke;
+ ot->modal = image_sample_modal;
+ ot->cancel = image_sample_cancel;
+ ot->poll = space_image_main_area_not_uv_brush_poll;
/* properties */
RNA_def_enum(ot->srna, "point", point_items, 0, "Point", "Set black point or white point for curves");
@@ -2185,9 +2188,9 @@ typedef struct RecordCompositeData {
static int image_record_composite_apply(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- RecordCompositeData *rcd= op->customdata;
- Scene *scene= CTX_data_scene(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ RecordCompositeData *rcd = op->customdata;
+ Scene *scene = CTX_data_scene(C);
ImBuf *ibuf;
WM_timecursor(CTX_wm_window(C), scene->r.cfra);
@@ -2197,13 +2200,13 @@ static int image_record_composite_apply(bContext *C, wmOperator *op)
BKE_image_all_free_anim_ibufs(scene->r.cfra);
ntreeCompositTagAnimated(scene->nodetree);
- ntreeCompositExecTree(scene->nodetree, &scene->r, scene->r.cfra != rcd->old_cfra); /* 1 is no previews */
+ ntreeCompositExecTree(scene->nodetree, &scene->r, scene->r.cfra != rcd->old_cfra); /* 1 is no previews */
ED_area_tag_redraw(CTX_wm_area(C));
- ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser);
+ ibuf = BKE_image_get_ibuf(sima->image, &sima->iuser);
/* save memory in flipbooks */
- if(ibuf)
+ if (ibuf)
imb_freerectfloatImBuf(ibuf);
scene->r.cfra++;
@@ -2213,39 +2216,39 @@ static int image_record_composite_apply(bContext *C, wmOperator *op)
static int image_record_composite_init(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- Scene *scene= CTX_data_scene(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ Scene *scene = CTX_data_scene(C);
RecordCompositeData *rcd;
- if(sima->iuser.frames < 2)
+ if (sima->iuser.frames < 2)
return 0;
- if(scene->nodetree == NULL)
+ if (scene->nodetree == NULL)
return 0;
- op->customdata= rcd= MEM_callocN(sizeof(RecordCompositeData), "ImageRecordCompositeData");
+ op->customdata = rcd = MEM_callocN(sizeof(RecordCompositeData), "ImageRecordCompositeData");
- rcd->old_cfra= scene->r.cfra;
- rcd->sfra= sima->iuser.sfra;
- rcd->efra= sima->iuser.sfra + sima->iuser.frames-1;
- scene->r.cfra= rcd->sfra;
+ rcd->old_cfra = scene->r.cfra;
+ rcd->sfra = sima->iuser.sfra;
+ rcd->efra = sima->iuser.sfra + sima->iuser.frames - 1;
+ scene->r.cfra = rcd->sfra;
return 1;
}
static void image_record_composite_exit(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- SpaceImage *sima= CTX_wm_space_image(C);
- RecordCompositeData *rcd= op->customdata;
+ Scene *scene = CTX_data_scene(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ RecordCompositeData *rcd = op->customdata;
- scene->r.cfra= rcd->old_cfra;
+ scene->r.cfra = rcd->old_cfra;
WM_cursor_restore(CTX_wm_window(C));
- if(rcd->timer)
+ if (rcd->timer)
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), rcd->timer);
- WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, sima->image);
+ WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, sima->image);
// XXX play_anim(0);
// XXX allqueue(REDRAWNODE, 1);
@@ -2255,10 +2258,10 @@ static void image_record_composite_exit(bContext *C, wmOperator *op)
static int image_record_composite_exec(bContext *C, wmOperator *op)
{
- if(!image_record_composite_init(C, op))
+ if (!image_record_composite_init(C, op))
return OPERATOR_CANCELLED;
- while(image_record_composite_apply(C, op))
+ while (image_record_composite_apply(C, op))
;
image_record_composite_exit(C, op);
@@ -2270,14 +2273,14 @@ static int image_record_composite_invoke(bContext *C, wmOperator *op, wmEvent *U
{
RecordCompositeData *rcd;
- if(!image_record_composite_init(C, op))
+ if (!image_record_composite_init(C, op))
return OPERATOR_CANCELLED;
- rcd= op->customdata;
- rcd->timer= WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.0f);
+ rcd = op->customdata;
+ rcd->timer = WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.0f);
WM_event_add_modal_handler(C, op);
- if(!image_record_composite_apply(C, op))
+ if (!image_record_composite_apply(C, op))
return OPERATOR_FINISHED;
return OPERATOR_RUNNING_MODAL;
@@ -2285,12 +2288,12 @@ static int image_record_composite_invoke(bContext *C, wmOperator *op, wmEvent *U
static int image_record_composite_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- RecordCompositeData *rcd= op->customdata;
+ RecordCompositeData *rcd = op->customdata;
- switch(event->type) {
+ switch (event->type) {
case TIMER:
- if(rcd->timer == event->customdata) {
- if(!image_record_composite_apply(C, op)) {
+ if (rcd->timer == event->customdata) {
+ if (!image_record_composite_apply(C, op)) {
image_record_composite_exit(C, op);
return OPERATOR_FINISHED;
}
@@ -2313,53 +2316,49 @@ static int image_record_composite_cancel(bContext *C, wmOperator *op)
void IMAGE_OT_record_composite(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Record Composite";
- ot->idname= "IMAGE_OT_record_composite";
+ ot->name = "Record Composite";
+ ot->idname = "IMAGE_OT_record_composite";
/* api callbacks */
- ot->exec= image_record_composite_exec;
- ot->invoke= image_record_composite_invoke;
- ot->modal= image_record_composite_modal;
- ot->cancel= image_record_composite_cancel;
- ot->poll= space_image_buffer_exists_poll;
+ ot->exec = image_record_composite_exec;
+ ot->invoke = image_record_composite_invoke;
+ ot->modal = image_record_composite_modal;
+ ot->cancel = image_record_composite_cancel;
+ ot->poll = space_image_buffer_exists_poll;
}
/********************* cycle render slot operator *********************/
static int image_cycle_render_slot_poll(bContext *C)
{
- Image *ima= CTX_data_edit_image(C);
+ Image *ima = CTX_data_edit_image(C);
return (ima && ima->type == IMA_TYPE_R_RESULT);
}
static int image_cycle_render_slot_exec(bContext *C, wmOperator *op)
{
- Image *ima= CTX_data_edit_image(C);
- int a, slot, cur= ima->render_slot;
- const short use_reverse= RNA_boolean_get(op->ptr, "reverse");
+ Image *ima = CTX_data_edit_image(C);
+ int a, slot, cur = ima->render_slot;
+ const short use_reverse = RNA_boolean_get(op->ptr, "reverse");
- for(a=1; a<IMA_MAX_RENDER_SLOT; a++) {
- slot= (cur + (use_reverse ? -a:a))%IMA_MAX_RENDER_SLOT;
- if(slot<0) slot+=IMA_MAX_RENDER_SLOT;
+ for (a = 1; a < IMA_MAX_RENDER_SLOT; a++) {
+ slot = (cur + (use_reverse ? -a : a)) % IMA_MAX_RENDER_SLOT;
+ if (slot < 0) slot += IMA_MAX_RENDER_SLOT;
- if(ima->renders[slot] || slot == ima->last_render_slot) {
- ima->render_slot= slot;
- break;
- }
- else if((slot - 1) == ima->last_render_slot && slot < IMA_MAX_RENDER_SLOT) {
- ima->render_slot= slot;
+ if (ima->renders[slot] || slot == ima->last_render_slot) {
+ ima->render_slot = slot;
break;
}
}
- if(a == IMA_MAX_RENDER_SLOT)
- ima->render_slot= ((cur == 1)? 0: 1);
+ if (a == IMA_MAX_RENDER_SLOT)
+ ima->render_slot = ((cur == 1) ? 0 : 1);
- WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL);
+ WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
/* no undo push for browsing existing */
- if(ima->renders[ima->render_slot] || ima->render_slot==ima->last_render_slot)
+ if (ima->renders[ima->render_slot] || ima->render_slot == ima->last_render_slot)
return OPERATOR_CANCELLED;
return OPERATOR_FINISHED;
@@ -2368,15 +2367,15 @@ static int image_cycle_render_slot_exec(bContext *C, wmOperator *op)
void IMAGE_OT_cycle_render_slot(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Cycle Render Slot";
- ot->idname= "IMAGE_OT_cycle_render_slot";
+ ot->name = "Cycle Render Slot";
+ ot->idname = "IMAGE_OT_cycle_render_slot";
/* api callbacks */
- ot->exec= image_cycle_render_slot_exec;
- ot->poll= image_cycle_render_slot_poll;
+ ot->exec = image_cycle_render_slot_exec;
+ ot->poll = image_cycle_render_slot_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "reverse", 0, "Cycle in Reverse", "");
}
@@ -2394,42 +2393,42 @@ void ED_image_update_frame(const Main *mainp, int cfra)
Tex *tex;
/* texture users */
- for(tex= mainp->tex.first; tex; tex= tex->id.next) {
- if(tex->type==TEX_IMAGE && tex->ima) {
- if(ELEM(tex->ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
- if(tex->iuser.flag & IMA_ANIM_ALWAYS)
+ for (tex = mainp->tex.first; tex; tex = tex->id.next) {
+ if (tex->type == TEX_IMAGE && tex->ima) {
+ if (ELEM(tex->ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
+ if (tex->iuser.flag & IMA_ANIM_ALWAYS)
BKE_image_user_calc_frame(&tex->iuser, cfra, 0);
}
}
}
/* image window, compo node users */
- for(wm=mainp->wm.first; wm; wm= wm->id.next) { /* only 1 wm */
- for(win= wm->windows.first; win; win= win->next) {
+ for (wm = mainp->wm.first; wm; wm = wm->id.next) { /* only 1 wm */
+ for (win = wm->windows.first; win; win = win->next) {
ScrArea *sa;
- for(sa= win->screen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_VIEW3D) {
- View3D *v3d= sa->spacedata.first;
+ for (sa = win->screen->areabase.first; sa; sa = sa->next) {
+ if (sa->spacetype == SPACE_VIEW3D) {
+ View3D *v3d = sa->spacedata.first;
BGpic *bgpic;
- for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next)
- if(bgpic->iuser.flag & IMA_ANIM_ALWAYS)
+ for (bgpic = v3d->bgpicbase.first; bgpic; bgpic = bgpic->next)
+ if (bgpic->iuser.flag & IMA_ANIM_ALWAYS)
BKE_image_user_calc_frame(&bgpic->iuser, cfra, 0);
}
- else if(sa->spacetype==SPACE_IMAGE) {
- SpaceImage *sima= sa->spacedata.first;
- if(sima->iuser.flag & IMA_ANIM_ALWAYS)
+ else if (sa->spacetype == SPACE_IMAGE) {
+ SpaceImage *sima = sa->spacedata.first;
+ if (sima->iuser.flag & IMA_ANIM_ALWAYS)
BKE_image_user_calc_frame(&sima->iuser, cfra, 0);
}
- else if(sa->spacetype==SPACE_NODE) {
- SpaceNode *snode= sa->spacedata.first;
- if((snode->treetype==NTREE_COMPOSIT) && (snode->nodetree)) {
+ else if (sa->spacetype == SPACE_NODE) {
+ SpaceNode *snode = sa->spacedata.first;
+ if ((snode->treetype == NTREE_COMPOSIT) && (snode->nodetree)) {
bNode *node;
- for(node= snode->nodetree->nodes.first; node; node= node->next) {
- if(node->id && node->type==CMP_NODE_IMAGE) {
- Image *ima= (Image *)node->id;
- ImageUser *iuser= node->storage;
- if(ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE))
- if(iuser->flag & IMA_ANIM_ALWAYS)
+ for (node = snode->nodetree->nodes.first; node; node = node->next) {
+ if (node->id && node->type == CMP_NODE_IMAGE) {
+ Image *ima = (Image *)node->id;
+ ImageUser *iuser = node->storage;
+ if (ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE))
+ if (iuser->flag & IMA_ANIM_ALWAYS)
BKE_image_user_calc_frame(iuser, cfra, 0);
}
}
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index ce7338ced13..3c1c8ac9941 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -90,36 +90,36 @@ void ED_space_image_set(SpaceImage *sima, Scene *scene, Object *obedit, Image *i
/* change the space ima after because uvedit_face_visible uses the space ima
* to check if the face is displayed in UV-localview */
- sima->image= ima;
+ sima->image = ima;
- if(ima == NULL || ima->type==IMA_TYPE_R_RESULT || ima->type==IMA_TYPE_COMPOSITE)
+ if (ima == NULL || ima->type == IMA_TYPE_R_RESULT || ima->type == IMA_TYPE_COMPOSITE)
sima->flag &= ~SI_DRAWTOOL;
- if(sima->image)
+ if (sima->image)
BKE_image_signal(sima->image, &sima->iuser, IMA_SIGNAL_USER_NEW_IMAGE);
- if(sima->image && sima->image->id.us==0)
- sima->image->id.us= 1;
+ if (sima->image && sima->image->id.us == 0)
+ sima->image->id.us = 1;
- if(obedit)
- WM_main_add_notifier(NC_GEOM|ND_DATA, obedit->data);
+ if (obedit)
+ WM_main_add_notifier(NC_GEOM | ND_DATA, obedit->data);
- WM_main_add_notifier(NC_SPACE|ND_SPACE_IMAGE, NULL);
+ WM_main_add_notifier(NC_SPACE | ND_SPACE_IMAGE, NULL);
}
ImBuf *ED_space_image_acquire_buffer(SpaceImage *sima, void **lock_r)
{
ImBuf *ibuf;
- if(sima && sima->image) {
+ if (sima && sima->image) {
#if 0
- if(sima->image->type==IMA_TYPE_R_RESULT && BIF_show_render_spare())
+ if (sima->image->type == IMA_TYPE_R_RESULT && BIF_show_render_spare())
return BIF_render_spare_imbuf();
else
#endif
- ibuf= BKE_image_acquire_ibuf(sima->image, &sima->iuser, lock_r);
+ ibuf = BKE_image_acquire_ibuf(sima->image, &sima->iuser, lock_r);
- if(ibuf && (ibuf->rect || ibuf->rect_float))
+ if (ibuf && (ibuf->rect || ibuf->rect_float))
return ibuf;
}
@@ -128,7 +128,7 @@ ImBuf *ED_space_image_acquire_buffer(SpaceImage *sima, void **lock_r)
void ED_space_image_release_buffer(SpaceImage *sima, void *lock)
{
- if(sima && sima->image)
+ if (sima && sima->image)
BKE_image_release_ibuf(sima->image, lock);
}
@@ -138,8 +138,8 @@ int ED_space_image_has_buffer(SpaceImage *sima)
void *lock;
int has_buffer;
- ibuf= ED_space_image_acquire_buffer(sima, &lock);
- has_buffer= (ibuf != NULL);
+ ibuf = ED_space_image_acquire_buffer(sima, &lock);
+ has_buffer = (ibuf != NULL);
ED_space_image_release_buffer(sima, lock);
return has_buffer;
@@ -147,53 +147,53 @@ int ED_space_image_has_buffer(SpaceImage *sima)
void ED_image_size(Image *ima, int *width, int *height)
{
- ImBuf *ibuf= NULL;
+ ImBuf *ibuf = NULL;
void *lock;
- if(ima)
- ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
+ if (ima)
+ ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
- if(ibuf && ibuf->x > 0 && ibuf->y > 0) {
- *width= ibuf->x;
- *height= ibuf->y;
+ if (ibuf && ibuf->x > 0 && ibuf->y > 0) {
+ *width = ibuf->x;
+ *height = ibuf->y;
}
else {
- *width= 256;
- *height= 256;
+ *width = 256;
+ *height = 256;
}
- if(ima)
+ if (ima)
BKE_image_release_ibuf(ima, lock);
}
void ED_space_image_size(SpaceImage *sima, int *width, int *height)
{
- Scene *scene= sima->iuser.scene;
+ Scene *scene = sima->iuser.scene;
ImBuf *ibuf;
void *lock;
- ibuf= ED_space_image_acquire_buffer(sima, &lock);
+ ibuf = ED_space_image_acquire_buffer(sima, &lock);
- if(ibuf && ibuf->x > 0 && ibuf->y > 0) {
- *width= ibuf->x;
- *height= ibuf->y;
+ if (ibuf && ibuf->x > 0 && ibuf->y > 0) {
+ *width = ibuf->x;
+ *height = ibuf->y;
}
- else if(sima->image && sima->image->type==IMA_TYPE_R_RESULT && scene) {
+ else if (sima->image && sima->image->type == IMA_TYPE_R_RESULT && scene) {
/* not very important, just nice */
- *width= (scene->r.xsch*scene->r.size)/100;
- *height= (scene->r.ysch*scene->r.size)/100;
+ *width = (scene->r.xsch * scene->r.size) / 100;
+ *height = (scene->r.ysch * scene->r.size) / 100;
- if((scene->r.mode & R_BORDER) && (scene->r.mode & R_CROP)) {
+ if ((scene->r.mode & R_BORDER) && (scene->r.mode & R_CROP)) {
*width *= (scene->r.border.xmax - scene->r.border.xmin);
*height *= (scene->r.border.ymax - scene->r.border.ymin);
}
}
/* I know a bit weak... but preview uses not actual image size */
- // XXX else if(image_preview_active(sima, width, height));
+ // XXX else if (image_preview_active(sima, width, height));
else {
- *width= 256;
- *height= 256;
+ *width = 256;
+ *height = 256;
}
ED_space_image_release_buffer(sima, lock);
@@ -201,14 +201,14 @@ void ED_space_image_size(SpaceImage *sima, int *width, int *height)
void ED_image_aspect(Image *ima, float *aspx, float *aspy)
{
- *aspx= *aspy= 1.0;
+ *aspx = *aspy = 1.0;
- if((ima == NULL) || (ima->type == IMA_TYPE_R_RESULT) || (ima->type == IMA_TYPE_COMPOSITE) ||
- (ima->aspx==0.0f || ima->aspy==0.0f))
+ if ((ima == NULL) || (ima->type == IMA_TYPE_R_RESULT) || (ima->type == IMA_TYPE_COMPOSITE) ||
+ (ima->aspx == 0.0f || ima->aspy == 0.0f))
return;
/* x is always 1 */
- *aspy = ima->aspy/ima->aspx;
+ *aspy = ima->aspy / ima->aspx;
}
void ED_space_image_aspect(SpaceImage *sima, float *aspx, float *aspy)
@@ -222,8 +222,8 @@ void ED_space_image_zoom(SpaceImage *sima, ARegion *ar, float *zoomx, float *zoo
ED_space_image_size(sima, &width, &height);
- *zoomx= (float)(ar->winrct.xmax - ar->winrct.xmin + 1)/(float)((ar->v2d.cur.xmax - ar->v2d.cur.xmin)*width);
- *zoomy= (float)(ar->winrct.ymax - ar->winrct.ymin + 1)/(float)((ar->v2d.cur.ymax - ar->v2d.cur.ymin)*height);
+ *zoomx = (float)(ar->winrct.xmax - ar->winrct.xmin + 1) / (float)((ar->v2d.cur.xmax - ar->v2d.cur.xmin) * width);
+ *zoomy = (float)(ar->winrct.ymax - ar->winrct.ymin + 1) / (float)((ar->v2d.cur.ymax - ar->v2d.cur.ymin) * height);
}
void ED_space_image_uv_aspect(SpaceImage *sima, float *aspx, float *aspy)
@@ -236,13 +236,13 @@ void ED_space_image_uv_aspect(SpaceImage *sima, float *aspx, float *aspy)
*aspx *= (float)w;
*aspy *= (float)h;
- if(*aspx < *aspy) {
- *aspy= *aspy / *aspx;
- *aspx= 1.0f;
+ if (*aspx < *aspy) {
+ *aspy = *aspy / *aspx;
+ *aspx = 1.0f;
}
else {
- *aspx= *aspx / *aspy;
- *aspy= 1.0f;
+ *aspx = *aspx / *aspy;
+ *aspy = 1.0f;
}
}
@@ -264,7 +264,7 @@ int ED_space_image_show_render(SpaceImage *sima)
int ED_space_image_show_paint(SpaceImage *sima)
{
- if(ED_space_image_show_render(sima))
+ if (ED_space_image_show_render(sima))
return 0;
return (sima->flag & SI_DRAWTOOL);
@@ -272,14 +272,14 @@ int ED_space_image_show_paint(SpaceImage *sima)
int ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit)
{
- if(sima && (ED_space_image_show_render(sima) || ED_space_image_show_paint(sima)))
+ if (sima && (ED_space_image_show_render(sima) || ED_space_image_show_paint(sima)))
return 0;
- if(obedit && obedit->type == OB_MESH) {
- struct BMEditMesh *em = ((Mesh*)obedit->data)->edit_btmesh;
+ if (obedit && obedit->type == OB_MESH) {
+ struct BMEditMesh *em = BMEdit_FromObject(obedit);
int ret;
- ret = EDBM_texFaceCheck(em);
+ ret = EDBM_mtexpoly_check(em);
return ret;
}
@@ -289,15 +289,15 @@ int ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit)
int ED_space_image_show_uvshadow(SpaceImage *sima, Object *obedit)
{
- if(ED_space_image_show_render(sima))
+ if (ED_space_image_show_render(sima))
return 0;
- if(ED_space_image_show_paint(sima))
- if(obedit && obedit->type == OB_MESH) {
- struct BMEditMesh *em = ((Mesh*)obedit->data)->edit_btmesh;
+ if (ED_space_image_show_paint(sima))
+ if (obedit && obedit->type == OB_MESH) {
+ struct BMEditMesh *em = BMEdit_FromObject(obedit);
int ret;
- ret = EDBM_texFaceCheck(em);
+ ret = EDBM_mtexpoly_check(em);
return ret;
}
@@ -308,16 +308,16 @@ int ED_space_image_show_uvshadow(SpaceImage *sima, Object *obedit)
static void image_scopes_tag_refresh(ScrArea *sa)
{
- SpaceImage *sima= (SpaceImage *)sa->spacedata.first;
+ SpaceImage *sima = (SpaceImage *)sa->spacedata.first;
ARegion *ar;
/* only while histogram is visible */
- for (ar=sa->regionbase.first; ar; ar=ar->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
if (ar->regiontype == RGN_TYPE_PREVIEW && ar->flag & RGN_FLAG_HIDDEN)
return;
}
- sima->scopes.ok=0;
+ sima->scopes.ok = 0;
}
@@ -327,20 +327,20 @@ ARegion *image_has_buttons_region(ScrArea *sa)
{
ARegion *ar, *arnew;
- ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
- if(ar) return ar;
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_UI);
+ if (ar) return ar;
/* add subdiv level; after header */
- ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
/* is error! */
- if(ar==NULL) return NULL;
+ if (ar == NULL) return NULL;
- arnew= MEM_callocN(sizeof(ARegion), "buttons for image");
+ arnew = MEM_callocN(sizeof(ARegion), "buttons for image");
BLI_insertlinkafter(&sa->regionbase, ar, arnew);
- arnew->regiontype= RGN_TYPE_UI;
- arnew->alignment= RGN_ALIGN_LEFT;
+ arnew->regiontype = RGN_TYPE_UI;
+ arnew->alignment = RGN_ALIGN_LEFT;
arnew->flag = RGN_FLAG_HIDDEN;
@@ -351,20 +351,20 @@ ARegion *image_has_scope_region(ScrArea *sa)
{
ARegion *ar, *arnew;
- ar= BKE_area_find_region_type(sa, RGN_TYPE_PREVIEW);
- if(ar) return ar;
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_PREVIEW);
+ if (ar) return ar;
/* add subdiv level; after buttons */
- ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_UI);
/* is error! */
- if(ar==NULL) return NULL;
+ if (ar == NULL) return NULL;
- arnew= MEM_callocN(sizeof(ARegion), "scopes for image");
+ arnew = MEM_callocN(sizeof(ARegion), "scopes for image");
BLI_insertlinkafter(&sa->regionbase, ar, arnew);
- arnew->regiontype= RGN_TYPE_PREVIEW;
- arnew->alignment= RGN_ALIGN_RIGHT;
+ arnew->regiontype = RGN_TYPE_PREVIEW;
+ arnew->alignment = RGN_ALIGN_RIGHT;
arnew->flag = RGN_FLAG_HIDDEN;
@@ -380,46 +380,46 @@ static SpaceLink *image_new(const bContext *UNUSED(C))
ARegion *ar;
SpaceImage *simage;
- simage= MEM_callocN(sizeof(SpaceImage), "initimage");
- simage->spacetype= SPACE_IMAGE;
- simage->zoom= 1;
- simage->lock= 1;
-
- simage->iuser.ok= 1;
- simage->iuser.fie_ima= 2;
- simage->iuser.frames= 100;
+ simage = MEM_callocN(sizeof(SpaceImage), "initimage");
+ simage->spacetype = SPACE_IMAGE;
+ simage->zoom = 1;
+ simage->lock = 1;
+
+ simage->iuser.ok = 1;
+ simage->iuser.fie_ima = 2;
+ simage->iuser.frames = 100;
scopes_new(&simage->scopes);
- simage->sample_line_hist.height= 100;
+ simage->sample_line_hist.height = 100;
/* header */
- ar= MEM_callocN(sizeof(ARegion), "header for image");
+ ar = MEM_callocN(sizeof(ARegion), "header for image");
BLI_addtail(&simage->regionbase, ar);
- ar->regiontype= RGN_TYPE_HEADER;
- ar->alignment= RGN_ALIGN_BOTTOM;
+ ar->regiontype = RGN_TYPE_HEADER;
+ ar->alignment = RGN_ALIGN_BOTTOM;
/* buttons/list view */
- ar= MEM_callocN(sizeof(ARegion), "buttons for image");
+ ar = MEM_callocN(sizeof(ARegion), "buttons for image");
BLI_addtail(&simage->regionbase, ar);
- ar->regiontype= RGN_TYPE_UI;
- ar->alignment= RGN_ALIGN_LEFT;
+ ar->regiontype = RGN_TYPE_UI;
+ ar->alignment = RGN_ALIGN_LEFT;
ar->flag = RGN_FLAG_HIDDEN;
/* scopes */
- ar= MEM_callocN(sizeof(ARegion), "buttons for image");
+ ar = MEM_callocN(sizeof(ARegion), "buttons for image");
BLI_addtail(&simage->regionbase, ar);
- ar->regiontype= RGN_TYPE_PREVIEW;
- ar->alignment= RGN_ALIGN_RIGHT;
+ ar->regiontype = RGN_TYPE_PREVIEW;
+ ar->alignment = RGN_ALIGN_RIGHT;
ar->flag = RGN_FLAG_HIDDEN;
/* main area */
- ar= MEM_callocN(sizeof(ARegion), "main area for image");
+ ar = MEM_callocN(sizeof(ARegion), "main area for image");
BLI_addtail(&simage->regionbase, ar);
- ar->regiontype= RGN_TYPE_WINDOW;
+ ar->regiontype = RGN_TYPE_WINDOW;
return (SpaceLink *)simage;
}
@@ -427,9 +427,9 @@ static SpaceLink *image_new(const bContext *UNUSED(C))
/* not spacelink itself */
static void image_free(SpaceLink *sl)
{
- SpaceImage *simage= (SpaceImage*) sl;
+ SpaceImage *simage = (SpaceImage *) sl;
- if(simage->cumap)
+ if (simage->cumap)
curvemapping_free(simage->cumap);
scopes_free(&simage->scopes);
}
@@ -438,7 +438,7 @@ static void image_free(SpaceLink *sl)
/* spacetype; init callback, add handlers */
static void image_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa)
{
- ListBase *lb= WM_dropboxmap_find("Image", SPACE_IMAGE, 0);
+ ListBase *lb = WM_dropboxmap_find("Image", SPACE_IMAGE, 0);
/* add drop boxes */
WM_event_add_dropbox_handler(&sa->handlers, lb);
@@ -447,11 +447,11 @@ static void image_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa)
static SpaceLink *image_duplicate(SpaceLink *sl)
{
- SpaceImage *simagen= MEM_dupallocN(sl);
+ SpaceImage *simagen = MEM_dupallocN(sl);
/* clear or remove stuff from old */
- if(simagen->cumap)
- simagen->cumap= curvemapping_copy(simagen->cumap);
+ if (simagen->cumap)
+ simagen->cumap = curvemapping_copy(simagen->cumap);
scopes_new(&simagen->scopes);
@@ -495,8 +495,9 @@ static void image_operatortypes(void)
static void image_keymap(struct wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "Image Generic", SPACE_IMAGE, 0);
+ wmKeyMap *keymap = WM_keymap_find(keyconf, "Image Generic", SPACE_IMAGE, 0);
wmKeyMapItem *kmi;
+ int i;
WM_keymap_add_item(keymap, "IMAGE_OT_new", NKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "IMAGE_OT_open", OKEY, KM_PRESS, KM_ALT, 0);
@@ -509,7 +510,7 @@ static void image_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "IMAGE_OT_cycle_render_slot", JKEY, KM_PRESS, 0, 0);
RNA_boolean_set(WM_keymap_add_item(keymap, "IMAGE_OT_cycle_render_slot", JKEY, KM_PRESS, KM_ALT, 0)->ptr, "reverse", TRUE);
- keymap= WM_keymap_find(keyconf, "Image", SPACE_IMAGE, 0);
+ keymap = WM_keymap_find(keyconf, "Image", SPACE_IMAGE, 0);
WM_keymap_add_item(keymap, "IMAGE_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "IMAGE_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0);
@@ -540,16 +541,23 @@ static void image_keymap(struct wmKeyConfig *keyconf)
RNA_enum_set(WM_keymap_add_item(keymap, "IMAGE_OT_curves_point_set", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "point", 1);
/* toggle editmode is handy to have while UV unwrapping */
- kmi= WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT);
RNA_boolean_set(kmi->ptr, "toggle", TRUE);
+
+ /* fast switch to render slots */
+ for(i = 0; i < MAX2(IMA_MAX_RENDER_SLOT, 9); i++) {
+ kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", ONEKEY+i, KM_PRESS, 0, 0);
+ RNA_string_set(kmi->ptr, "data_path", "space_data.image.render_slot");
+ RNA_int_set(kmi->ptr, "value", i);
+ }
}
/* dropboxes */
static int image_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
- if(drag->type==WM_DRAG_PATH)
- if(ELEM3(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */
+ if (drag->type == WM_DRAG_PATH)
+ if (ELEM3(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */
return 1;
return 0;
}
@@ -563,7 +571,7 @@ static void image_drop_copy(wmDrag *drag, wmDropBox *drop)
/* area+region dropbox definition */
static void image_dropboxes(void)
{
- ListBase *lb= WM_dropboxmap_find("Image", SPACE_IMAGE, 0);
+ ListBase *lb = WM_dropboxmap_find("Image", SPACE_IMAGE, 0);
WM_dropbox_add(lb, "IMAGE_OT_open", image_drop_poll, image_drop_copy);
}
@@ -573,49 +581,49 @@ static void image_dropboxes(void)
static void image_refresh(const bContext *C, ScrArea *UNUSED(sa))
{
Scene *scene = CTX_data_scene(C);
- SpaceImage *sima= CTX_wm_space_image(C);
- Object *obedit= CTX_data_edit_object(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ Object *obedit = CTX_data_edit_object(C);
Image *ima;
- ima= ED_space_image(sima);
+ ima = ED_space_image(sima);
- if(sima->iuser.flag & IMA_ANIM_ALWAYS)
+ if (sima->iuser.flag & IMA_ANIM_ALWAYS)
BKE_image_user_calc_frame(&sima->iuser, scene->r.cfra, 0);
/* check if we have to set the image from the editmesh */
- if(ima && (ima->source==IMA_SRC_VIEWER || sima->pin));
- else if(obedit && obedit->type == OB_MESH) {
- Mesh *me= (Mesh*)obedit->data;
- struct BMEditMesh *em= me->edit_btmesh;
- int sloppy= 1; /* partially selected face is ok */
+ if (ima && (ima->source == IMA_SRC_VIEWER || sima->pin)) ;
+ else if (obedit && obedit->type == OB_MESH) {
+ Mesh *me = (Mesh *)obedit->data;
+ struct BMEditMesh *em = me->edit_btmesh;
+ int sloppy = 1; /* partially selected face is ok */
- if(scene_use_new_shading_nodes(scene)) {
+ if (scene_use_new_shading_nodes(scene)) {
/* new shading system, get image from material */
BMFace *efa = BM_active_face_get(em->bm, sloppy);
- if(efa) {
+ if (efa) {
Image *node_ima;
- ED_object_get_active_image(obedit, efa->mat_nr, &node_ima, NULL, NULL);
+ ED_object_get_active_image(obedit, efa->mat_nr + 1, &node_ima, NULL, NULL);
- if(node_ima)
- sima->image= node_ima;
+ if (node_ima)
+ sima->image = node_ima;
}
}
else {
/* old shading system, we set texface */
MTexPoly *tf;
- if(em && EDBM_texFaceCheck(em)) {
- sima->image= NULL;
+ if (em && EDBM_mtexpoly_check(em)) {
+ sima->image = NULL;
- tf = EDBM_get_active_mtexpoly(em, NULL, TRUE); /* partially selected face is ok */
+ tf = EDBM_mtexpoly_active_get(em, NULL, TRUE); /* partially selected face is ok */
- if(tf) {
+ if (tf) {
/* don't need to check for pin here, see above */
- sima->image= tf->tpage;
+ sima->image = tf->tpage;
- if(sima->flag & SI_EDITTILE);
- else sima->curtile= tf->tile;
+ if (sima->flag & SI_EDITTILE) ;
+ else sima->curtile = tf->tile;
}
}
}
@@ -624,12 +632,12 @@ static void image_refresh(const bContext *C, ScrArea *UNUSED(sa))
static void image_listener(ScrArea *sa, wmNotifier *wmn)
{
- SpaceImage *sima= (SpaceImage *)sa->spacedata.first;
+ SpaceImage *sima = (SpaceImage *)sa->spacedata.first;
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_SCENE:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_FRAME:
image_scopes_tag_refresh(sa);
ED_area_tag_refresh(sa);
@@ -653,13 +661,13 @@ static void image_listener(ScrArea *sa, wmNotifier *wmn)
}
break;
case NC_SPACE:
- if(wmn->data == ND_SPACE_IMAGE) {
+ if (wmn->data == ND_SPACE_IMAGE) {
image_scopes_tag_refresh(sa);
ED_area_tag_redraw(sa);
}
break;
case NC_GEOM:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_DATA:
case ND_SELECT:
image_scopes_tag_refresh(sa);
@@ -669,11 +677,11 @@ static void image_listener(ScrArea *sa, wmNotifier *wmn)
}
case NC_OBJECT:
{
- Object *ob= (Object *)wmn->reference;
- switch(wmn->data) {
+ Object *ob = (Object *)wmn->reference;
+ switch (wmn->data) {
case ND_TRANSFORM:
case ND_MODIFIER:
- if(ob && (ob->mode & OB_MODE_EDIT) && sima->lock && (sima->flag & SI_DRAWSHADOW)) {
+ if (ob && (ob->mode & OB_MODE_EDIT) && sima->lock && (sima->flag & SI_DRAWSHADOW)) {
ED_area_tag_refresh(sa);
ED_area_tag_redraw(sa);
}
@@ -687,13 +695,13 @@ const char *image_context_dir[] = {"edit_image", NULL};
static int image_context(const bContext *C, const char *member, bContextDataResult *result)
{
- SpaceImage *sima= CTX_wm_space_image(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
- if(CTX_data_dir(member)) {
+ if (CTX_data_dir(member)) {
CTX_data_dir_set(result, image_context_dir);
}
- else if(CTX_data_equals(member, "edit_image")) {
- CTX_data_id_pointer_set(result, (ID*)ED_space_image(sima));
+ else if (CTX_data_equals(member, "edit_image")) {
+ CTX_data_id_pointer_set(result, (ID *)ED_space_image(sima));
return 1;
}
@@ -705,48 +713,48 @@ static int image_context(const bContext *C, const char *member, bContextDataResu
/* sets up the fields of the View2D from zoom and offset */
static void image_main_area_set_view2d(SpaceImage *sima, ARegion *ar)
{
- Image *ima= ED_space_image(sima);
+ Image *ima = ED_space_image(sima);
float x1, y1, w, h;
int width, height, winx, winy;
#if 0
- if(image_preview_active(curarea, &width, &height));
+ if (image_preview_active(curarea, &width, &height)) ;
else
#endif
ED_space_image_size(sima, &width, &height);
- w= width;
- h= height;
+ w = width;
+ h = height;
- if(ima)
- h *= ima->aspy/ima->aspx;
+ if (ima)
+ h *= ima->aspy / ima->aspx;
- winx= ar->winrct.xmax - ar->winrct.xmin + 1;
- winy= ar->winrct.ymax - ar->winrct.ymin + 1;
+ winx = ar->winrct.xmax - ar->winrct.xmin + 1;
+ winy = ar->winrct.ymax - ar->winrct.ymin + 1;
- ar->v2d.tot.xmin= 0;
- ar->v2d.tot.ymin= 0;
- ar->v2d.tot.xmax= w;
- ar->v2d.tot.ymax= h;
+ ar->v2d.tot.xmin = 0;
+ ar->v2d.tot.ymin = 0;
+ ar->v2d.tot.xmax = w;
+ ar->v2d.tot.ymax = h;
- ar->v2d.mask.xmin= ar->v2d.mask.ymin= 0;
- ar->v2d.mask.xmax= winx;
- ar->v2d.mask.ymax= winy;
+ ar->v2d.mask.xmin = ar->v2d.mask.ymin = 0;
+ ar->v2d.mask.xmax = winx;
+ ar->v2d.mask.ymax = winy;
/* which part of the image space do we see? */
- x1= ar->winrct.xmin+(winx-sima->zoom*w)/2.0f;
- y1= ar->winrct.ymin+(winy-sima->zoom*h)/2.0f;
+ x1 = ar->winrct.xmin + (winx - sima->zoom * w) / 2.0f;
+ y1 = ar->winrct.ymin + (winy - sima->zoom * h) / 2.0f;
- x1-= sima->zoom*sima->xof;
- y1-= sima->zoom*sima->yof;
+ x1 -= sima->zoom * sima->xof;
+ y1 -= sima->zoom * sima->yof;
/* relative display right */
- ar->v2d.cur.xmin= ((ar->winrct.xmin - (float)x1)/sima->zoom);
- ar->v2d.cur.xmax= ar->v2d.cur.xmin + ((float)winx/sima->zoom);
+ ar->v2d.cur.xmin = ((ar->winrct.xmin - (float)x1) / sima->zoom);
+ ar->v2d.cur.xmax = ar->v2d.cur.xmin + ((float)winx / sima->zoom);
/* relative display left */
- ar->v2d.cur.ymin= ((ar->winrct.ymin-(float)y1)/sima->zoom);
- ar->v2d.cur.ymax= ar->v2d.cur.ymin + ((float)winy/sima->zoom);
+ ar->v2d.cur.ymin = ((ar->winrct.ymin - (float)y1) / sima->zoom);
+ ar->v2d.cur.ymax = ar->v2d.cur.ymin + ((float)winy / sima->zoom);
/* normalize 0.0..1.0 */
ar->v2d.cur.xmin /= w;
@@ -764,19 +772,19 @@ static void image_main_area_init(wmWindowManager *wm, ARegion *ar)
// UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
/* image paint polls for mode */
- keymap= WM_keymap_find(wm->defaultconf, "Image Paint", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Image Paint", 0, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap= WM_keymap_find(wm->defaultconf, "UV Editor", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "UV Editor", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "UV Sculpt", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "UV Sculpt", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
/* own keymaps */
- keymap= WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Image", SPACE_IMAGE, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Image", SPACE_IMAGE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -784,11 +792,11 @@ static void image_main_area_init(wmWindowManager *wm, ARegion *ar)
static void image_main_area_draw(const bContext *C, ARegion *ar)
{
/* draw entirely, view changes should be handled here */
- SpaceImage *sima= CTX_wm_space_image(C);
- Object *obact= CTX_data_active_object(C);
- Object *obedit= CTX_data_edit_object(C);
- Scene *scene= CTX_data_scene(C);
- View2D *v2d= &ar->v2d;
+ SpaceImage *sima = CTX_wm_space_image(C);
+ Object *obact = CTX_data_active_object(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Scene *scene = CTX_data_scene(C);
+ View2D *v2d = &ar->v2d;
//View2DScrollers *scrollers;
float col[3];
@@ -801,7 +809,7 @@ static void image_main_area_draw(const bContext *C, ARegion *ar)
glClear(GL_COLOR_BUFFER_BIT);
/* put scene context variable in iuser */
- sima->iuser.scene= scene;
+ sima->iuser.scene = scene;
/* we set view2d from own zoom and offset each time */
image_main_area_set_view2d(sima, ar);
@@ -824,19 +832,21 @@ 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)
{
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_SCREEN:
- if (wmn->data==ND_GPENCIL)
+ if (wmn->data == ND_GPENCIL)
ED_region_tag_redraw(ar);
- break;
+ break;
}
}
@@ -849,7 +859,7 @@ static void image_buttons_area_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap= WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -861,13 +871,13 @@ static void image_buttons_area_draw(const bContext *C, ARegion *ar)
static void image_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_SCREEN:
- if (wmn->data==ND_GPENCIL)
+ if (wmn->data == ND_GPENCIL)
ED_region_tag_redraw(ar);
break;
case NC_BRUSH:
- if(wmn->action==NA_EDITED)
+ if (wmn->action == NA_EDITED)
ED_region_tag_redraw(ar);
break;
case NC_TEXTURE:
@@ -888,18 +898,18 @@ static void image_scope_area_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap= WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
static void image_scope_area_draw(const bContext *C, ARegion *ar)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- Scene *scene= CTX_data_scene(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ Scene *scene = CTX_data_scene(C);
void *lock;
- ImBuf *ibuf= ED_space_image_acquire_buffer(sima, &lock);
- if(ibuf) {
- scopes_update(&sima->scopes, ibuf, scene->r.color_mgt_flag & R_COLOR_MANAGEMENT );
+ ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock);
+ if (ibuf) {
+ scopes_update(&sima->scopes, ibuf, scene->r.color_mgt_flag & R_COLOR_MANAGEMENT);
}
ED_space_image_release_buffer(sima, lock);
@@ -909,9 +919,9 @@ static void image_scope_area_draw(const bContext *C, ARegion *ar)
static void image_scope_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_SCENE:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_MODE:
case ND_RENDER_RESULT:
case ND_COMPO_RESULT:
@@ -945,9 +955,9 @@ static void image_header_area_draw(const bContext *C, ARegion *ar)
static void image_header_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_SCENE:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_MODE:
case ND_TOOLSETTINGS:
ED_region_tag_redraw(ar);
@@ -955,7 +965,7 @@ static void image_header_area_listener(ARegion *ar, wmNotifier *wmn)
}
break;
case NC_GEOM:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_DATA:
case ND_SELECT:
ED_region_tag_redraw(ar);
@@ -970,64 +980,64 @@ static void image_header_area_listener(ARegion *ar, wmNotifier *wmn)
/* only called once, from space/spacetypes.c */
void ED_spacetype_image(void)
{
- SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype image");
+ SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype image");
ARegionType *art;
- st->spaceid= SPACE_IMAGE;
+ st->spaceid = SPACE_IMAGE;
strncpy(st->name, "Image", BKE_ST_MAXNAME);
- st->new= image_new;
- st->free= image_free;
- st->init= image_init;
- st->duplicate= image_duplicate;
- st->operatortypes= image_operatortypes;
- st->keymap= image_keymap;
- st->dropboxes= image_dropboxes;
- st->refresh= image_refresh;
- st->listener= image_listener;
- st->context= image_context;
+ st->new = image_new;
+ st->free = image_free;
+ st->init = image_init;
+ st->duplicate = image_duplicate;
+ st->operatortypes = image_operatortypes;
+ st->keymap = image_keymap;
+ st->dropboxes = image_dropboxes;
+ st->refresh = image_refresh;
+ st->listener = image_listener;
+ st->context = image_context;
/* regions: main window */
- art= MEM_callocN(sizeof(ARegionType), "spacetype image region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype image region");
art->regionid = RGN_TYPE_WINDOW;
- art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_GPENCIL;
- art->init= image_main_area_init;
- art->draw= image_main_area_draw;
- art->listener= image_main_area_listener;
+ art->keymapflag = ED_KEYMAP_FRAMES | ED_KEYMAP_GPENCIL;
+ art->init = image_main_area_init;
+ art->draw = image_main_area_draw;
+ art->listener = image_main_area_listener;
BLI_addhead(&st->regiontypes, art);
/* regions: listview/buttons */
- art= MEM_callocN(sizeof(ARegionType), "spacetype image region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype image region");
art->regionid = RGN_TYPE_UI;
- art->prefsizex= 220; // XXX
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES;
- art->listener= image_buttons_area_listener;
- art->init= image_buttons_area_init;
- art->draw= image_buttons_area_draw;
+ art->prefsizex = 220; // XXX
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
+ art->listener = image_buttons_area_listener;
+ art->init = image_buttons_area_init;
+ art->draw = image_buttons_area_draw;
BLI_addhead(&st->regiontypes, art);
image_buttons_register(art);
ED_uvedit_buttons_register(art);
/* regions: statistics/scope buttons */
- art= MEM_callocN(sizeof(ARegionType), "spacetype image region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype image region");
art->regionid = RGN_TYPE_PREVIEW;
- art->prefsizex= 220; // XXX
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES;
- art->listener= image_scope_area_listener;
- art->init= image_scope_area_init;
- art->draw= image_scope_area_draw;
+ art->prefsizex = 220; // XXX
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
+ art->listener = image_scope_area_listener;
+ art->init = image_scope_area_init;
+ art->draw = image_scope_area_draw;
BLI_addhead(&st->regiontypes, art);
/* regions: header */
- art= MEM_callocN(sizeof(ARegionType), "spacetype image region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype image region");
art->regionid = RGN_TYPE_HEADER;
- art->prefsizey= HEADERY;
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES|ED_KEYMAP_HEADER;
- art->listener= image_header_area_listener;
- art->init= image_header_area_init;
- art->draw= image_header_area_draw;
+ art->prefsizey = HEADERY;
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES | ED_KEYMAP_HEADER;
+ art->listener = image_header_area_listener;
+ art->init = image_header_area_init;
+ art->draw = image_header_area_draw;
BLI_addhead(&st->regiontypes, art);
diff --git a/source/blender/editors/space_info/CMakeLists.txt b/source/blender/editors/space_info/CMakeLists.txt
index 7cf5b1fc3fb..94b40a9f40a 100644
--- a/source/blender/editors/space_info/CMakeLists.txt
+++ b/source/blender/editors/space_info/CMakeLists.txt
@@ -48,4 +48,8 @@ set(SRC
textview.h
)
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_editor_space_info "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/space_info/SConscript b/source/blender/editors/space_info/SConscript
index 746edadccc2..e4746aefa0c 100644
--- a/source/blender/editors/space_info/SConscript
+++ b/source/blender/editors/space_info/SConscript
@@ -8,4 +8,7 @@ incs += ' ../../bmesh ../../windowmanager #/intern/guardedalloc #/extern/glew/in
defs = []
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
env.BlenderLib ( 'bf_editors_space_info', sources, Split(incs), defs, libtype=['core'], priority=[70] )
diff --git a/source/blender/editors/space_info/info_draw.c b/source/blender/editors/space_info/info_draw.c
index d2be3bd2812..2409ab8c4e0 100644
--- a/source/blender/editors/space_info/info_draw.c
+++ b/source/blender/editors/space_info/info_draw.c
@@ -65,43 +65,43 @@
static void info_report_color(unsigned char *fg, unsigned char *bg, Report *report, int bool)
{
- if(report->flag & SELECT) {
- fg[0]=255; fg[1]=255; fg[2]=255;
- if(bool) {
- bg[0]=96; bg[1]=128; bg[2]=255;
+ if (report->flag & SELECT) {
+ fg[0] = 255; fg[1] = 255; fg[2] = 255;
+ if (bool) {
+ bg[0] = 96; bg[1] = 128; bg[2] = 255;
}
else {
- bg[0]=90; bg[1]=122; bg[2]=249;
+ bg[0] = 90; bg[1] = 122; bg[2] = 249;
}
}
else {
- fg[0]=0; fg[1]=0; fg[2]=0;
+ fg[0] = 0; fg[1] = 0; fg[2] = 0;
if (report->type & RPT_ERROR_ALL) {
- if (bool) { bg[0]=220; bg[1]=0; bg[2]=0; }
- else { bg[0]=214; bg[1]=0; bg[2]=0; }
+ if (bool) { bg[0] = 220; bg[1] = 0; bg[2] = 0; }
+ else { bg[0] = 214; bg[1] = 0; bg[2] = 0; }
}
else if (report->type & RPT_WARNING_ALL) {
- if (bool) { bg[0]=220; bg[1]=128; bg[2]=96; }
- else { bg[0]=214; bg[1]=122; bg[2]=90; }
+ if (bool) { bg[0] = 220; bg[1] = 128; bg[2] = 96; }
+ else { bg[0] = 214; bg[1] = 122; bg[2] = 90; }
}
#if 0 // XXX: this looks like the selected color, so don't use this
else if (report->type & RPT_OPERATOR_ALL) {
- if (bool) { bg[0]=96; bg[1]=128; bg[2]=255; }
- else { bg[0]=90; bg[1]=122; bg[2]=249; }
+ if (bool) { bg[0] = 96; bg[1] = 128; bg[2] = 255; }
+ else { bg[0] = 90; bg[1] = 122; bg[2] = 249; }
}
#endif
else if (report->type & RPT_INFO_ALL) {
- if (bool) { bg[0]=0; bg[1]=170; bg[2]=0; }
- else { bg[0]=0; bg[1]=164; bg[2]=0; }
+ if (bool) { bg[0] = 0; bg[1] = 170; bg[2] = 0; }
+ else { bg[0] = 0; bg[1] = 164; bg[2] = 0; }
}
else if (report->type & RPT_DEBUG_ALL) {
- if (bool) { bg[0]=196; bg[1]=196; bg[2]=196; }
- else { bg[0]=190; bg[1]=190; bg[2]=190; }
+ if (bool) { bg[0] = 196; bg[1] = 196; bg[2] = 196; }
+ else { bg[0] = 190; bg[1] = 190; bg[2] = 190; }
}
else {
- if (bool) { bg[0]=120; bg[1]=120; bg[2]=120; }
- else { bg[0]=114; bg[1]=114; bg[2]=114; }
+ if (bool) { bg[0] = 120; bg[1] = 120; bg[2] = 120; }
+ else { bg[0] = 114; bg[1] = 114; bg[2] = 114; }
}
}
}
@@ -110,24 +110,24 @@ static void info_report_color(unsigned char *fg, unsigned char *bg, Report *repo
#ifdef USE_INFO_NEWLINE
static void report_textview_init__internal(TextViewContext *tvc)
{
- Report *report= (Report *)tvc->iter;
- const char *str= report->message;
- const char *next_str= strchr(str + tvc->iter_char, '\n');
+ Report *report = (Report *)tvc->iter;
+ const char *str = report->message;
+ const char *next_str = strchr(str + tvc->iter_char, '\n');
- if(next_str) {
- tvc->iter_char_next= (int)(next_str - str);
+ if (next_str) {
+ tvc->iter_char_next = (int)(next_str - str);
}
else {
- tvc->iter_char_next= report->len;
+ tvc->iter_char_next = report->len;
}
}
static int report_textview_skip__internal(TextViewContext *tvc)
{
- SpaceInfo *sinfo= (SpaceInfo *)tvc->arg1;
- const int report_mask= info_report_mask(sinfo);
- while (tvc->iter && (((Report *)tvc->iter)->type & report_mask)==0) {
- tvc->iter= (void *)((Link *)tvc->iter)->prev;
+ SpaceInfo *sinfo = (SpaceInfo *)tvc->arg1;
+ const int report_mask = info_report_mask(sinfo);
+ while (tvc->iter && (((Report *)tvc->iter)->type & report_mask) == 0) {
+ tvc->iter = (void *)((Link *)tvc->iter)->prev;
}
return (tvc->iter != NULL);
}
@@ -137,23 +137,23 @@ static int report_textview_skip__internal(TextViewContext *tvc)
static int report_textview_begin(TextViewContext *tvc)
{
// SpaceConsole *sc= (SpaceConsole *)tvc->arg1;
- ReportList *reports= (ReportList *)tvc->arg2;
+ ReportList *reports = (ReportList *)tvc->arg2;
- tvc->lheight= 14; //sc->lheight;
- tvc->sel_start= 0;
- tvc->sel_end= 0;
+ tvc->lheight = 14; //sc->lheight;
+ tvc->sel_start = 0;
+ tvc->sel_end = 0;
/* iterator */
- tvc->iter= reports->list.last;
+ tvc->iter = reports->list.last;
- glClearColor(120.0/255.0, 120.0/255.0, 120.0/255.0, 1.0);
+ glClearColor(120.0 / 255.0, 120.0 / 255.0, 120.0 / 255.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
#ifdef USE_INFO_NEWLINE
- tvc->iter_tmp= 0;
- if(tvc->iter && report_textview_skip__internal(tvc)) {
+ tvc->iter_tmp = 0;
+ if (tvc->iter && report_textview_skip__internal(tvc)) {
/* init the newline iterator */
- tvc->iter_char= 0;
+ tvc->iter_char = 0;
report_textview_init__internal(tvc);
return TRUE;
@@ -175,14 +175,14 @@ static void report_textview_end(TextViewContext *UNUSED(tvc))
static int report_textview_step(TextViewContext *tvc)
{
/* simple case, but no newline support */
- Report *report= (Report *)tvc->iter;
+ Report *report = (Report *)tvc->iter;
- if(report->len <= tvc->iter_char_next) {
- tvc->iter= (void *)((Link *)tvc->iter)->prev;
- if(tvc->iter && report_textview_skip__internal(tvc)) {
+ if (report->len <= tvc->iter_char_next) {
+ tvc->iter = (void *)((Link *)tvc->iter)->prev;
+ if (tvc->iter && report_textview_skip__internal(tvc)) {
tvc->iter_tmp++;
- tvc->iter_char= 0; /* reset start */
+ tvc->iter_char = 0; /* reset start */
report_textview_init__internal(tvc);
return TRUE;
@@ -193,7 +193,7 @@ static int report_textview_step(TextViewContext *tvc)
}
else {
/* step to the next newline */
- tvc->iter_char= tvc->iter_char_next + 1;
+ tvc->iter_char = tvc->iter_char_next + 1;
report_textview_init__internal(tvc);
return TRUE;
@@ -202,15 +202,15 @@ static int report_textview_step(TextViewContext *tvc)
static int report_textview_line_get(struct TextViewContext *tvc, const char **line, int *len)
{
- Report *report= (Report *)tvc->iter;
- *line= report->message + tvc->iter_char;
- *len= tvc->iter_char_next - tvc->iter_char;
+ Report *report = (Report *)tvc->iter;
+ *line = report->message + tvc->iter_char;
+ *len = tvc->iter_char_next - tvc->iter_char;
return 1;
}
static int report_textview_line_color(struct TextViewContext *tvc, unsigned char fg[3], unsigned char bg[3])
{
- Report *report= (Report *)tvc->iter;
+ Report *report = (Report *)tvc->iter;
info_report_color(fg, bg, report, tvc->iter_tmp % 2);
return TVC_LINE_FG | TVC_LINE_BG;
}
@@ -220,27 +220,27 @@ static int report_textview_line_color(struct TextViewContext *tvc, unsigned char
static int report_textview_step(TextViewContext *tvc)
{
- SpaceInfo *sinfo= (SpaceInfo *)tvc->arg1;
- const int report_mask= info_report_mask(sinfo);
+ SpaceInfo *sinfo = (SpaceInfo *)tvc->arg1;
+ const int report_mask = info_report_mask(sinfo);
do {
- tvc->iter= (void *)((Link *)tvc->iter)->prev;
- } while (tvc->iter && (((Report *)tvc->iter)->type & report_mask)==0);
+ tvc->iter = (void *)((Link *)tvc->iter)->prev;
+ } while (tvc->iter && (((Report *)tvc->iter)->type & report_mask) == 0);
return (tvc->iter != NULL);
}
static int report_textview_line_get(struct TextViewContext *tvc, const char **line, int *len)
{
- Report *report= (Report *)tvc->iter;
- *line= report->message;
- *len= report->len;
+ Report *report = (Report *)tvc->iter;
+ *line = report->message;
+ *len = report->len;
return 1;
}
static int report_textview_line_color(struct TextViewContext *tvc, unsigned char fg[3], unsigned char bg[3])
{
- Report *report= (Report *)tvc->iter;
+ Report *report = (Report *)tvc->iter;
info_report_color(fg, bg, report, tvc->iter_tmp % 2);
return TVC_LINE_FG | TVC_LINE_BG;
}
@@ -251,41 +251,41 @@ static int report_textview_line_color(struct TextViewContext *tvc, unsigned char
static int info_textview_main__internal(struct SpaceInfo *sinfo, struct ARegion *ar, ReportList *reports, int draw, int mval[2], void **mouse_pick, int *pos_pick)
{
- int ret= 0;
+ int ret = 0;
- View2D *v2d= &ar->v2d;
+ View2D *v2d = &ar->v2d;
- TextViewContext tvc= {0};
- tvc.begin= report_textview_begin;
- tvc.end= report_textview_end;
+ TextViewContext tvc = {0};
+ tvc.begin = report_textview_begin;
+ tvc.end = report_textview_end;
- tvc.step= report_textview_step;
- tvc.line_get= report_textview_line_get;
- tvc.line_color= report_textview_line_color;
+ tvc.step = report_textview_step;
+ tvc.line_get = report_textview_line_get;
+ tvc.line_color = report_textview_line_color;
- tvc.arg1= sinfo;
- tvc.arg2= reports;
+ tvc.arg1 = sinfo;
+ tvc.arg2 = reports;
/* view */
- tvc.sel_start= 0;
- tvc.sel_end= 0;
- tvc.lheight= 14; //sc->lheight;
- tvc.ymin= v2d->cur.ymin;
- tvc.ymax= v2d->cur.ymax;
- tvc.winx= ar->winx;
-
- ret= textview_draw(&tvc, draw, mval, mouse_pick, pos_pick);
+ tvc.sel_start = 0;
+ tvc.sel_end = 0;
+ tvc.lheight = 14; //sc->lheight;
+ tvc.ymin = v2d->cur.ymin;
+ tvc.ymax = v2d->cur.ymax;
+ tvc.winx = ar->winx;
+
+ ret = textview_draw(&tvc, draw, mval, mouse_pick, pos_pick);
return ret;
}
void *info_text_pick(struct SpaceInfo *sinfo, struct ARegion *ar, ReportList *reports, int mouse_y)
{
- void *mouse_pick= NULL;
+ void *mouse_pick = NULL;
int mval[2];
- mval[0]= 0;
- mval[1]= mouse_y;
+ mval[0] = 0;
+ mval[1] = mouse_y;
info_textview_main__internal(sinfo, ar, reports, 0, mval, &mouse_pick, NULL);
return (void *)mouse_pick;
diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c
index 54e8b1b490d..5256fc8f044 100644
--- a/source/blender/editors/space_info/info_ops.c
+++ b/source/blender/editors/space_info/info_ops.c
@@ -70,7 +70,7 @@
static int pack_all_exec(bContext *C, wmOperator *op)
{
- Main *bmain= CTX_data_main(C);
+ Main *bmain = CTX_data_main(C);
packAll(bmain, op->reports);
G.fileflags |= G_AUTOPACK;
@@ -80,21 +80,21 @@ static int pack_all_exec(bContext *C, wmOperator *op)
static int pack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- Main *bmain= CTX_data_main(C);
+ Main *bmain = CTX_data_main(C);
Image *ima;
ImBuf *ibuf;
// first check for dirty images
- for(ima=bmain->image.first; ima; ima=ima->id.next) {
- if(ima->ibufs.first) { /* XXX FIX */
- ibuf= BKE_image_get_ibuf(ima, NULL);
+ for (ima = bmain->image.first; ima; ima = ima->id.next) {
+ if (ima->ibufs.first) { /* XXX FIX */
+ ibuf = BKE_image_get_ibuf(ima, NULL);
- if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
+ if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
break;
}
}
- if(ima) {
+ if (ima) {
uiPupMenuOkee(C, "FILE_OT_pack_all", "Some images are painted on. These changes will be lost. Continue?");
return OPERATOR_CANCELLED;
}
@@ -105,15 +105,15 @@ static int pack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void FILE_OT_pack_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Pack All";
- ot->idname= "FILE_OT_pack_all";
+ ot->name = "Pack All";
+ ot->idname = "FILE_OT_pack_all";
/* api callbacks */
- ot->exec= pack_all_exec;
- ot->invoke= pack_all_invoke;
+ ot->exec = pack_all_exec;
+ ot->invoke = pack_all_invoke;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/********************* unpack all operator *********************/
@@ -129,10 +129,10 @@ static const EnumPropertyItem unpack_all_method_items[] = {
static int unpack_all_exec(bContext *C, wmOperator *op)
{
- Main *bmain= CTX_data_main(C);
- int method= RNA_enum_get(op->ptr, "method");
+ Main *bmain = CTX_data_main(C);
+ int method = RNA_enum_get(op->ptr, "method");
- if(method != PF_KEEP) unpackAll(bmain, op->reports, method); /* XXX PF_ASK can't work here */
+ if (method != PF_KEEP) unpackAll(bmain, op->reports, method); /* XXX PF_ASK can't work here */
G.fileflags &= ~G_AUTOPACK;
return OPERATOR_FINISHED;
@@ -140,7 +140,7 @@ static int unpack_all_exec(bContext *C, wmOperator *op)
static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- Main *bmain= CTX_data_main(C);
+ Main *bmain = CTX_data_main(C);
uiPopupMenu *pup;
uiLayout *layout;
char title[64];
@@ -148,19 +148,19 @@ static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
count = countPackedFiles(bmain);
- if(!count) {
+ if (!count) {
BKE_report(op->reports, RPT_WARNING, "No packed files. Autopack disabled");
G.fileflags &= ~G_AUTOPACK;
return OPERATOR_CANCELLED;
}
- if(count == 1)
+ if (count == 1)
strcpy(title, "Unpack 1 file");
else
BLI_snprintf(title, sizeof(title), "Unpack %d files", count);
- pup= uiPupMenuBegin(C, title, ICON_NONE);
- layout= uiPupMenuLayout(pup);
+ pup = uiPupMenuBegin(C, title, ICON_NONE);
+ layout = uiPupMenuLayout(pup);
uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
uiItemsEnumO(layout, "FILE_OT_unpack_all", "method");
@@ -173,15 +173,15 @@ static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
void FILE_OT_unpack_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Unpack All";
- ot->idname= "FILE_OT_unpack_all";
+ ot->name = "Unpack All";
+ ot->idname = "FILE_OT_unpack_all";
/* api callbacks */
- ot->exec= unpack_all_exec;
- ot->invoke= unpack_all_invoke;
+ ot->exec = unpack_all_exec;
+ ot->invoke = unpack_all_invoke;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "method", unpack_all_method_items, PF_USE_LOCAL, "Method", "How to unpack");
@@ -191,9 +191,9 @@ void FILE_OT_unpack_all(wmOperatorType *ot)
static int make_paths_relative_exec(bContext *C, wmOperator *op)
{
- Main *bmain= CTX_data_main(C);
+ Main *bmain = CTX_data_main(C);
- if(!G.relbase_valid) {
+ if (!G.relbase_valid) {
BKE_report(op->reports, RPT_WARNING, "Can't set relative paths with an unsaved blend file");
return OPERATOR_CANCELLED;
}
@@ -209,23 +209,23 @@ static int make_paths_relative_exec(bContext *C, wmOperator *op)
void FILE_OT_make_paths_relative(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Make All Paths Relative";
- ot->idname= "FILE_OT_make_paths_relative";
+ ot->name = "Make All Paths Relative";
+ ot->idname = "FILE_OT_make_paths_relative";
/* api callbacks */
- ot->exec= make_paths_relative_exec;
+ ot->exec = make_paths_relative_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/********************* make paths absolute operator *********************/
static int make_paths_absolute_exec(bContext *C, wmOperator *op)
{
- Main *bmain= CTX_data_main(C);
+ Main *bmain = CTX_data_main(C);
- if(!G.relbase_valid) {
+ if (!G.relbase_valid) {
BKE_report(op->reports, RPT_WARNING, "Can't set absolute paths with an unsaved blend file");
return OPERATOR_CANCELLED;
}
@@ -241,21 +241,21 @@ static int make_paths_absolute_exec(bContext *C, wmOperator *op)
void FILE_OT_make_paths_absolute(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Make All Paths Absolute";
- ot->idname= "FILE_OT_make_paths_absolute";
+ ot->name = "Make All Paths Absolute";
+ ot->idname = "FILE_OT_make_paths_absolute";
/* api callbacks */
- ot->exec= make_paths_absolute_exec;
+ ot->exec = make_paths_absolute_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/********************* report missing files operator *********************/
static int report_missing_files_exec(bContext *C, wmOperator *op)
{
- Main *bmain= CTX_data_main(C);
+ Main *bmain = CTX_data_main(C);
/* run the missing file check */
checkMissingFiles(bmain, op->reports);
@@ -266,22 +266,22 @@ static int report_missing_files_exec(bContext *C, wmOperator *op)
void FILE_OT_report_missing_files(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Report Missing Files";
- ot->idname= "FILE_OT_report_missing_files";
+ ot->name = "Report Missing Files";
+ ot->idname = "FILE_OT_report_missing_files";
/* api callbacks */
- ot->exec= report_missing_files_exec;
+ ot->exec = report_missing_files_exec;
/* flags */
- ot->flag= 0; /* only reports so no need to undo/register */
+ ot->flag = 0; /* only reports so no need to undo/register */
}
/********************* find missing files operator *********************/
static int find_missing_files_exec(bContext *C, wmOperator *op)
{
- Main *bmain= CTX_data_main(C);
- const char *searchpath= RNA_string_get_alloc(op->ptr, "filepath", NULL, 0);
+ Main *bmain = CTX_data_main(C);
+ const char *searchpath = RNA_string_get_alloc(op->ptr, "filepath", NULL, 0);
findMissingFiles(bmain, searchpath, op->reports);
MEM_freeN((void *)searchpath);
@@ -298,15 +298,15 @@ static int find_missing_files_invoke(bContext *C, wmOperator *op, wmEvent *UNUSE
void FILE_OT_find_missing_files(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Find Missing Files";
- ot->idname= "FILE_OT_find_missing_files";
+ ot->name = "Find Missing Files";
+ ot->idname = "FILE_OT_find_missing_files";
/* api callbacks */
- ot->exec= find_missing_files_exec;
- ot->invoke= find_missing_files_invoke;
+ ot->exec = find_missing_files_exec;
+ ot->invoke = find_missing_files_invoke;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
@@ -321,71 +321,74 @@ void FILE_OT_find_missing_files(wmOperatorType *ot)
* inactive regions, so use this for now. --matt
*/
-#define INFO_TIMEOUT 5.0f
-#define INFO_COLOR_TIMEOUT 3.0f
-#define ERROR_TIMEOUT 10.0f
-#define ERROR_COLOR_TIMEOUT 6.0f
-#define COLLAPSE_TIMEOUT 0.25f
+#define INFO_TIMEOUT 5.0f
+#define INFO_COLOR_TIMEOUT 3.0f
+#define ERROR_TIMEOUT 10.0f
+#define ERROR_COLOR_TIMEOUT 6.0f
+#define COLLAPSE_TIMEOUT 0.25f
static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- ReportList *reports= CTX_wm_reports(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
+ ReportList *reports = CTX_wm_reports(C);
Report *report;
ReportTimerInfo *rti;
- float progress=0.0, color_progress=0.0;
+ float progress = 0.0, color_progress = 0.0;
float neutral_col[3] = {0.35, 0.35, 0.35};
- float neutral_grey= 0.6;
- float timeout=0.0, color_timeout=0.0;
- int send_note= 0;
+ float neutral_grey = 0.6;
+ float timeout = 0.0, color_timeout = 0.0;
+ int send_note = 0;
/* escape if not our timer */
- if( (reports->reporttimer==NULL) ||
- (reports->reporttimer != event->customdata) ||
- ((report= BKE_reports_last_displayable(reports))==NULL) /* may have been deleted */
- ) {
+ if ((reports->reporttimer == NULL) ||
+ (reports->reporttimer != event->customdata) ||
+ ((report = BKE_reports_last_displayable(reports)) == NULL) /* may have been deleted */
+ )
+ {
return OPERATOR_PASS_THROUGH;
}
rti = (ReportTimerInfo *)reports->reporttimer->customdata;
- timeout = (report->type & RPT_ERROR_ALL)?ERROR_TIMEOUT:INFO_TIMEOUT;
- color_timeout = (report->type & RPT_ERROR_ALL)?ERROR_COLOR_TIMEOUT:INFO_COLOR_TIMEOUT;
+ timeout = (report->type & RPT_ERROR_ALL) ? ERROR_TIMEOUT : INFO_TIMEOUT;
+ color_timeout = (report->type & RPT_ERROR_ALL) ? ERROR_COLOR_TIMEOUT : INFO_COLOR_TIMEOUT;
/* clear the report display after timeout */
if ((float)reports->reporttimer->duration > timeout) {
WM_event_remove_timer(wm, NULL, reports->reporttimer);
reports->reporttimer = NULL;
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_INFO, NULL);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO, NULL);
- return (OPERATOR_FINISHED|OPERATOR_PASS_THROUGH);
+ return (OPERATOR_FINISHED | OPERATOR_PASS_THROUGH);
}
if (rti->widthfac == 0.0f) {
- /* initialise colors based on report type */
- if(report->type & RPT_ERROR_ALL) {
+ /* initialize colors based on report type */
+ if (report->type & RPT_ERROR_ALL) {
rti->col[0] = 1.0;
rti->col[1] = 0.2;
rti->col[2] = 0.0;
- } else if(report->type & RPT_WARNING_ALL) {
+ }
+ else if (report->type & RPT_WARNING_ALL) {
rti->col[0] = 1.0;
rti->col[1] = 1.0;
rti->col[2] = 0.0;
- } else if(report->type & RPT_INFO_ALL) {
+ }
+ else if (report->type & RPT_INFO_ALL) {
rti->col[0] = 0.3;
rti->col[1] = 0.45;
rti->col[2] = 0.7;
}
rti->greyscale = 0.75;
- rti->widthfac=1.0;
+ rti->widthfac = 1.0;
}
progress = (float)reports->reporttimer->duration / timeout;
color_progress = (float)reports->reporttimer->duration / color_timeout;
/* save us from too many draws */
- if(color_progress <= 1.0f) {
- send_note= 1;
+ if (color_progress <= 1.0f) {
+ send_note = 1;
/* fade colors out sharply according to progress through fade-out duration */
interp_v3_v3v3(rti->col, rti->col, neutral_col, color_progress);
@@ -393,30 +396,30 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wm
}
/* collapse report at end of timeout */
- if (progress*timeout > timeout - COLLAPSE_TIMEOUT) {
- rti->widthfac = (progress*timeout - (timeout - COLLAPSE_TIMEOUT)) / COLLAPSE_TIMEOUT;
+ if (progress * timeout > timeout - COLLAPSE_TIMEOUT) {
+ rti->widthfac = (progress * timeout - (timeout - COLLAPSE_TIMEOUT)) / COLLAPSE_TIMEOUT;
rti->widthfac = 1.0f - rti->widthfac;
- send_note= 1;
+ send_note = 1;
}
- if(send_note) {
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_INFO, NULL);
+ if (send_note) {
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO, NULL);
}
- return (OPERATOR_FINISHED|OPERATOR_PASS_THROUGH);
+ return (OPERATOR_FINISHED | OPERATOR_PASS_THROUGH);
}
void INFO_OT_reports_display_update(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Update Reports Display";
- ot->idname= "INFO_OT_reports_display_update";
+ ot->name = "Update Reports Display";
+ ot->idname = "INFO_OT_reports_display_update";
/* api callbacks */
- ot->invoke= update_reports_display_invoke;
+ ot->invoke = update_reports_display_invoke;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
/* properties */
}
diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c
index 206639f064a..46cd2530063 100644
--- a/source/blender/editors/space_info/info_report.c
+++ b/source/blender/editors/space_info/info_report.c
@@ -53,16 +53,16 @@ int info_report_mask(SpaceInfo *UNUSED(sinfo))
#if 0
int report_mask = 0;
- if(sinfo->rpt_mask & INFO_RPT_DEBUG) report_mask |= RPT_DEBUG_ALL;
- if(sinfo->rpt_mask & INFO_RPT_INFO) report_mask |= RPT_INFO_ALL;
- if(sinfo->rpt_mask & INFO_RPT_OP) report_mask |= RPT_OPERATOR_ALL;
- if(sinfo->rpt_mask & INFO_RPT_WARN) report_mask |= RPT_WARNING_ALL;
- if(sinfo->rpt_mask & INFO_RPT_ERR) report_mask |= RPT_ERROR_ALL;
+ if (sinfo->rpt_mask & INFO_RPT_DEBUG) report_mask |= RPT_DEBUG_ALL;
+ if (sinfo->rpt_mask & INFO_RPT_INFO) report_mask |= RPT_INFO_ALL;
+ if (sinfo->rpt_mask & INFO_RPT_OP) report_mask |= RPT_OPERATOR_ALL;
+ if (sinfo->rpt_mask & INFO_RPT_WARN) report_mask |= RPT_WARNING_ALL;
+ if (sinfo->rpt_mask & INFO_RPT_ERR) report_mask |= RPT_ERROR_ALL;
return report_mask;
#endif
- return RPT_DEBUG_ALL|RPT_INFO_ALL|RPT_OPERATOR_ALL|RPT_WARNING_ALL|RPT_ERROR_ALL;
+ return RPT_DEBUG_ALL | RPT_INFO_ALL | RPT_OPERATOR_ALL | RPT_WARNING_ALL | RPT_ERROR_ALL;
}
// TODO, get this working again!
@@ -74,10 +74,10 @@ static int report_replay_exec(bContext *C, wmOperator *UNUSED(op))
// Report *report;
#if 0
- sc->type= CONSOLE_TYPE_PYTHON;
+ sc->type = CONSOLE_TYPE_PYTHON;
- for(report=reports->list.last; report; report=report->prev) {
- if((report->type & report_mask) && (report->type & RPT_OPERATOR_ALL) && (report->flag & SELECT)) {
+ for (report = reports->list.last; report; report = report->prev) {
+ if ((report->type & report_mask) && (report->type & RPT_OPERATOR_ALL) && (report->flag & SELECT)) {
console_history_add_str(sc, report->message, 0);
WM_operator_name_call(C, "CONSOLE_OT_execute", WM_OP_EXEC_DEFAULT, NULL);
@@ -85,7 +85,7 @@ static int report_replay_exec(bContext *C, wmOperator *UNUSED(op))
}
}
- sc->type= CONSOLE_TYPE_REPORT;
+ sc->type = CONSOLE_TYPE_REPORT;
#endif
ED_area_tag_redraw(CTX_wm_area(C));
@@ -95,26 +95,26 @@ static int report_replay_exec(bContext *C, wmOperator *UNUSED(op))
void INFO_OT_report_replay(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Replay Operators";
- ot->description= "Replay selected reports";
- ot->idname= "INFO_OT_report_replay";
+ ot->name = "Replay Operators";
+ ot->description = "Replay selected reports";
+ ot->idname = "INFO_OT_report_replay";
/* api callbacks */
- ot->poll= ED_operator_info_active;
- ot->exec= report_replay_exec;
+ ot->poll = ED_operator_info_active;
+ ot->exec = report_replay_exec;
/* flags */
- /* ot->flag= OPTYPE_REGISTER; */
+ /* ot->flag = OPTYPE_REGISTER; */
/* properties */
}
static int select_report_pick_exec(bContext *C, wmOperator *op)
{
- int report_index= RNA_int_get(op->ptr, "report_index");
- Report *report= BLI_findlink(&CTX_wm_reports(C)->list, report_index);
+ int report_index = RNA_int_get(op->ptr, "report_index");
+ Report *report = BLI_findlink(&CTX_wm_reports(C)->list, report_index);
- if(!report)
+ if (!report)
return OPERATOR_CANCELLED;
report->flag ^= SELECT; /* toggle */
@@ -126,15 +126,15 @@ static int select_report_pick_exec(bContext *C, wmOperator *op)
static int select_report_pick_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceInfo *sinfo= CTX_wm_space_info(C);
- ARegion *ar= CTX_wm_region(C);
- ReportList *reports= CTX_wm_reports(C);
+ SpaceInfo *sinfo = CTX_wm_space_info(C);
+ ARegion *ar = CTX_wm_region(C);
+ ReportList *reports = CTX_wm_reports(C);
Report *report;
/* uses opengl */
wmSubWindowSet(CTX_wm_window(C), ar->swinid);
- report= info_text_pick(sinfo, ar, reports, event->mval[1]);
+ report = info_text_pick(sinfo, ar, reports, event->mval[1]);
RNA_int_set(op->ptr, "report_index", BLI_findindex(&reports->list, report));
@@ -145,17 +145,17 @@ static int select_report_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
void INFO_OT_select_pick(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select report";
- ot->description= "Select reports by index";
- ot->idname= "INFO_OT_select_pick";
+ ot->name = "Select report";
+ ot->description = "Select reports by index";
+ ot->idname = "INFO_OT_select_pick";
/* api callbacks */
- ot->poll= ED_operator_info_active;
- ot->invoke= select_report_pick_invoke;
- ot->exec= select_report_pick_exec;
+ ot->poll = ED_operator_info_active;
+ ot->invoke = select_report_pick_invoke;
+ ot->exec = select_report_pick_exec;
/* flags */
- /* ot->flag= OPTYPE_REGISTER; */
+ /* ot->flag = OPTYPE_REGISTER; */
/* properties */
RNA_def_int(ot->srna, "report_index", 0, 0, INT_MAX, "Report", "Index of the report", 0, INT_MAX);
@@ -165,29 +165,29 @@ void INFO_OT_select_pick(wmOperatorType *ot)
static int report_select_all_toggle_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceInfo *sinfo= CTX_wm_space_info(C);
- ReportList *reports= CTX_wm_reports(C);
- int report_mask= info_report_mask(sinfo);
- int deselect= 0;
+ SpaceInfo *sinfo = CTX_wm_space_info(C);
+ ReportList *reports = CTX_wm_reports(C);
+ int report_mask = info_report_mask(sinfo);
+ int deselect = 0;
Report *report;
- for(report=reports->list.last; report; report=report->prev) {
- if((report->type & report_mask) && (report->flag & SELECT)) {
- deselect= 1;
+ for (report = reports->list.last; report; report = report->prev) {
+ if ((report->type & report_mask) && (report->flag & SELECT)) {
+ deselect = 1;
break;
}
}
- if(deselect) {
- for(report=reports->list.last; report; report=report->prev)
- if(report->type & report_mask)
+ if (deselect) {
+ for (report = reports->list.last; report; report = report->prev)
+ if (report->type & report_mask)
report->flag &= ~SELECT;
}
else {
- for(report=reports->list.last; report; report=report->prev)
- if(report->type & report_mask)
+ for (report = reports->list.last; report; report = report->prev)
+ if (report->type & report_mask)
report->flag |= SELECT;
}
@@ -199,16 +199,16 @@ static int report_select_all_toggle_exec(bContext *C, wmOperator *UNUSED(op))
void INFO_OT_select_all_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "(De)Select All";
- ot->description= "(de)select all reports";
- ot->idname= "INFO_OT_select_all_toggle";
+ ot->name = "(De)select All";
+ ot->description = "Select or deselect all reports";
+ ot->idname = "INFO_OT_select_all_toggle";
/* api callbacks */
- ot->poll= ED_operator_info_active;
- ot->exec= report_select_all_toggle_exec;
+ ot->poll = ED_operator_info_active;
+ ot->exec = report_select_all_toggle_exec;
/* flags */
- /*ot->flag= OPTYPE_REGISTER;*/
+ /*ot->flag = OPTYPE_REGISTER;*/
/* properties */
}
@@ -216,11 +216,11 @@ void INFO_OT_select_all_toggle(wmOperatorType *ot)
/* borderselect operator */
static int borderselect_exec(bContext *C, wmOperator *op)
{
- SpaceInfo *sinfo= CTX_wm_space_info(C);
- ARegion *ar= CTX_wm_region(C);
- ReportList *reports= CTX_wm_reports(C);
- int report_mask= info_report_mask(sinfo);
- int extend= RNA_boolean_get(op->ptr, "extend");
+ SpaceInfo *sinfo = CTX_wm_space_info(C);
+ ARegion *ar = CTX_wm_region(C);
+ ReportList *reports = CTX_wm_reports(C);
+ int report_mask = info_report_mask(sinfo);
+ int extend = RNA_boolean_get(op->ptr, "extend");
Report *report_min, *report_max, *report;
//View2D *v2d= UI_view2d_fromcontext(C);
@@ -228,66 +228,66 @@ static int borderselect_exec(bContext *C, wmOperator *op)
rcti rect;
//rctf rectf, rq;
- short selecting= (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT);
+ short selecting = (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT);
//int mval[2];
- 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");
+ 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");
- /*
- mval[0]= rect.xmin;
- mval[1]= rect.ymin;
+#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;
+ 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) {
+ if (!extend) {
+ for (report = reports->list.first; report; report = report->next) {
- if((report->type & report_mask)==0)
+ if ((report->type & report_mask) == 0)
continue;
report->flag &= ~SELECT;
}
}
- report_min= info_text_pick(sinfo, ar, reports, rect.ymax);
- report_max= info_text_pick(sinfo, ar, reports, rect.ymin);
+ report_min = info_text_pick(sinfo, ar, reports, rect.ymax);
+ report_max = info_text_pick(sinfo, ar, reports, rect.ymin);
/* get the first report if none found */
- if(report_min==NULL) {
+ if (report_min == NULL) {
// printf("find_min\n");
- for(report=reports->list.first; report; report=report->next) {
- if(report->type & report_mask) {
- report_min= report;
+ for (report = reports->list.first; report; report = report->next) {
+ if (report->type & report_mask) {
+ report_min = report;
break;
}
}
}
- if(report_max==NULL) {
+ if (report_max == NULL) {
// printf("find_max\n");
- for(report=reports->list.last; report; report=report->prev) {
- if(report->type & report_mask) {
- report_max= report;
+ for (report = reports->list.last; report; report = report->prev) {
+ if (report->type & report_mask) {
+ report_max = report;
break;
}
}
}
- if(report_min==NULL || report_max==NULL)
+ if (report_min == NULL || report_max == NULL)
return OPERATOR_CANCELLED;
- for(report= report_min; (report != report_max->next); report= report->next) {
+ for (report = report_min; (report != report_max->next); report = report->next) {
- if((report->type & report_mask)==0)
+ if ((report->type & report_mask) == 0)
continue;
- if(selecting)
+ if (selecting)
report->flag |= SELECT;
else
report->flag &= ~SELECT;
@@ -303,20 +303,20 @@ static int borderselect_exec(bContext *C, wmOperator *op)
void INFO_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Border Select";
- ot->description= "Toggle border selection";
- ot->idname= "INFO_OT_select_border";
+ ot->name = "Border Select";
+ ot->description = "Toggle border selection";
+ ot->idname = "INFO_OT_select_border";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= borderselect_exec;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = borderselect_exec;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= ED_operator_info_active;
+ ot->poll = ED_operator_info_active;
/* flags */
- /* ot->flag= OPTYPE_REGISTER; */
+ /* ot->flag = OPTYPE_REGISTER; */
/* rna */
WM_operator_properties_gesture_border(ot, TRUE);
@@ -326,24 +326,24 @@ void INFO_OT_select_border(wmOperatorType *ot)
static int report_delete_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceInfo *sinfo= CTX_wm_space_info(C);
- ReportList *reports= CTX_wm_reports(C);
- int report_mask= info_report_mask(sinfo);
+ SpaceInfo *sinfo = CTX_wm_space_info(C);
+ ReportList *reports = CTX_wm_reports(C);
+ int report_mask = info_report_mask(sinfo);
Report *report, *report_next;
- for(report=reports->list.first; report; ) {
+ for (report = reports->list.first; report; ) {
- report_next=report->next;
+ report_next = report->next;
- if((report->type & report_mask) && (report->flag & SELECT)) {
+ if ((report->type & report_mask) && (report->flag & SELECT)) {
BLI_remlink(&reports->list, report);
MEM_freeN((void *)report->message);
MEM_freeN(report);
}
- report= report_next;
+ report = report_next;
}
ED_area_tag_redraw(CTX_wm_area(C));
@@ -354,16 +354,16 @@ static int report_delete_exec(bContext *C, wmOperator *UNUSED(op))
void INFO_OT_report_delete(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Reports";
- ot->description= "Delete selected reports";
- ot->idname= "INFO_OT_report_delete";
+ ot->name = "Delete Reports";
+ ot->description = "Delete selected reports";
+ ot->idname = "INFO_OT_report_delete";
/* api callbacks */
- ot->poll= ED_operator_info_active;
- ot->exec= report_delete_exec;
+ ot->poll = ED_operator_info_active;
+ ot->exec = report_delete_exec;
/* flags */
- /*ot->flag= OPTYPE_REGISTER;*/
+ /*ot->flag = OPTYPE_REGISTER;*/
/* properties */
}
@@ -371,23 +371,23 @@ void INFO_OT_report_delete(wmOperatorType *ot)
static int report_copy_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceInfo *sinfo= CTX_wm_space_info(C);
- ReportList *reports= CTX_wm_reports(C);
- int report_mask= info_report_mask(sinfo);
+ SpaceInfo *sinfo = CTX_wm_space_info(C);
+ ReportList *reports = CTX_wm_reports(C);
+ int report_mask = info_report_mask(sinfo);
Report *report;
- DynStr *buf_dyn= BLI_dynstr_new();
+ DynStr *buf_dyn = BLI_dynstr_new();
char *buf_str;
- for(report=reports->list.first; report; report= report->next) {
- if((report->type & report_mask) && (report->flag & SELECT)) {
+ for (report = reports->list.first; report; report = report->next) {
+ if ((report->type & report_mask) && (report->flag & SELECT)) {
BLI_dynstr_append(buf_dyn, report->message);
BLI_dynstr_append(buf_dyn, "\n");
}
}
- buf_str= BLI_dynstr_get_cstring(buf_dyn);
+ buf_str = BLI_dynstr_get_cstring(buf_dyn);
BLI_dynstr_free(buf_dyn);
WM_clipboard_text_set(buf_str, 0);
@@ -399,16 +399,16 @@ static int report_copy_exec(bContext *C, wmOperator *UNUSED(op))
void INFO_OT_report_copy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy Reports to Clipboard";
- ot->description= "Copy selected reports to Clipboard";
- ot->idname= "INFO_OT_report_copy";
+ ot->name = "Copy Reports to Clipboard";
+ ot->description = "Copy selected reports to Clipboard";
+ ot->idname = "INFO_OT_report_copy";
/* api callbacks */
- ot->poll= ED_operator_info_active;
- ot->exec= report_copy_exec;
+ ot->poll = ED_operator_info_active;
+ ot->exec = report_copy_exec;
/* flags */
- /*ot->flag= OPTYPE_REGISTER;*/
+ /*ot->flag = OPTYPE_REGISTER;*/
/* properties */
}
diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c
index cf003d8c1eb..1c2f43f67a4 100644
--- a/source/blender/editors/space_info/info_stats.c
+++ b/source/blender/editors/space_info/info_stats.c
@@ -68,79 +68,79 @@ typedef struct SceneStats {
static void stats_object(Object *ob, int sel, int totob, SceneStats *stats)
{
- switch(ob->type) {
- case OB_MESH: {
- /* we assume derivedmesh is already built, this strictly does stats now. */
- DerivedMesh *dm= ob->derivedFinal;
- int totvert, totedge, totface;
-
- stats->totmesh +=totob;
-
- if(dm) {
- totvert = dm->getNumVerts(dm);
- totedge = dm->getNumEdges(dm);
- totface = dm->getNumPolys(dm);
-
- stats->totvert += totvert*totob;
- stats->totedge += totedge*totob;
- stats->totface += totface*totob;
-
- if(sel) {
- stats->totvertsel += totvert;
- stats->totfacesel += totface;
+ switch (ob->type) {
+ case OB_MESH: {
+ /* we assume derivedmesh is already built, this strictly does stats now. */
+ DerivedMesh *dm = ob->derivedFinal;
+ int totvert, totedge, totface;
+
+ stats->totmesh += totob;
+
+ if (dm) {
+ totvert = dm->getNumVerts(dm);
+ totedge = dm->getNumEdges(dm);
+ totface = dm->getNumPolys(dm);
+
+ stats->totvert += totvert * totob;
+ stats->totedge += totedge * totob;
+ stats->totface += totface * totob;
+
+ if (sel) {
+ stats->totvertsel += totvert;
+ stats->totfacesel += totface;
+ }
}
+ break;
}
- break;
- }
- case OB_LAMP:
- stats->totlamp += totob;
- break;
- case OB_SURF:
- case OB_CURVE:
- case OB_FONT: {
- int tot= 0, totf= 0;
+ case OB_LAMP:
+ stats->totlamp += totob;
+ break;
+ case OB_SURF:
+ case OB_CURVE:
+ case OB_FONT: {
+ int tot = 0, totf = 0;
- stats->totcurve += totob;
+ stats->totcurve += totob;
- if(ob->disp.first)
- count_displist(&ob->disp, &tot, &totf);
+ if (ob->disp.first)
+ count_displist(&ob->disp, &tot, &totf);
- tot *= totob;
- totf *= totob;
+ tot *= totob;
+ totf *= totob;
- stats->totvert+= tot;
- stats->totface+= totf;
+ stats->totvert += tot;
+ stats->totface += totf;
- if(sel) {
- stats->totvertsel += tot;
- stats->totfacesel += totf;
+ if (sel) {
+ stats->totvertsel += tot;
+ stats->totfacesel += totf;
+ }
+ break;
}
- break;
- }
- case OB_MBALL: {
- int tot= 0, totf= 0;
+ case OB_MBALL: {
+ int tot = 0, totf = 0;
- count_displist(&ob->disp, &tot, &totf);
+ count_displist(&ob->disp, &tot, &totf);
- tot *= totob;
- totf *= totob;
+ tot *= totob;
+ totf *= totob;
- stats->totvert += tot;
- stats->totface += totf;
+ stats->totvert += tot;
+ stats->totface += totf;
- if(sel) {
- stats->totvertsel += tot;
- stats->totfacesel += totf;
+ if (sel) {
+ stats->totvertsel += tot;
+ stats->totfacesel += totf;
+ }
+ break;
}
- break;
- }
}
}
static void stats_object_edit(Object *obedit, SceneStats *stats)
{
- if(obedit->type==OB_MESH) {
- BMEditMesh *em = ((Mesh*)obedit->data)->edit_btmesh;
+ if (obedit->type == OB_MESH) {
+ BMEditMesh *em = BMEdit_FromObject(obedit);
stats->totvert = em->bm->totvert;
stats->totvertsel = em->bm->totvertsel;
@@ -151,86 +151,86 @@ static void stats_object_edit(Object *obedit, SceneStats *stats)
stats->totface = em->bm->totface;
stats->totfacesel = em->bm->totfacesel;
}
- else if(obedit->type==OB_ARMATURE){
+ else if (obedit->type == OB_ARMATURE) {
/* Armature Edit */
- bArmature *arm= obedit->data;
+ bArmature *arm = obedit->data;
EditBone *ebo;
- for(ebo=arm->edbo->first; ebo; ebo=ebo->next){
+ for (ebo = arm->edbo->first; ebo; ebo = ebo->next) {
stats->totbone++;
- if((ebo->flag & BONE_CONNECTED) && ebo->parent)
+ if ((ebo->flag & BONE_CONNECTED) && ebo->parent)
stats->totvert--;
- if(ebo->flag & BONE_TIPSEL)
+ if (ebo->flag & BONE_TIPSEL)
stats->totvertsel++;
- if(ebo->flag & BONE_ROOTSEL)
+ if (ebo->flag & BONE_ROOTSEL)
stats->totvertsel++;
- if(ebo->flag & BONE_SELECTED) stats->totbonesel++;
+ if (ebo->flag & BONE_SELECTED) stats->totbonesel++;
/* if this is a connected child and it's parent is being moved, remove our root */
- if((ebo->flag & BONE_CONNECTED)&& (ebo->flag & BONE_ROOTSEL) && ebo->parent && (ebo->parent->flag & BONE_TIPSEL))
+ if ((ebo->flag & BONE_CONNECTED) && (ebo->flag & BONE_ROOTSEL) && ebo->parent && (ebo->parent->flag & BONE_TIPSEL))
stats->totvertsel--;
- stats->totvert+=2;
+ stats->totvert += 2;
}
}
- else if ELEM(obedit->type, OB_CURVE, OB_SURF) { /* OB_FONT has no cu->editnurb */
+ else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { /* OB_FONT has no cu->editnurb */
/* Curve Edit */
- Curve *cu= obedit->data;
+ Curve *cu = obedit->data;
Nurb *nu;
BezTriple *bezt;
BPoint *bp;
int a;
- ListBase *nurbs= curve_editnurbs(cu);
-
- for(nu=nurbs->first; nu; nu=nu->next) {
- if(nu->type == CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- stats->totvert+=3;
- if(bezt->f1) stats->totvertsel++;
- if(bezt->f2) stats->totvertsel++;
- if(bezt->f3) stats->totvertsel++;
+ ListBase *nurbs = curve_editnurbs(cu);
+
+ for (nu = nurbs->first; nu; nu = nu->next) {
+ if (nu->type == CU_BEZIER) {
+ bezt = nu->bezt;
+ a = nu->pntsu;
+ while (a--) {
+ stats->totvert += 3;
+ if (bezt->f1) stats->totvertsel++;
+ if (bezt->f2) stats->totvertsel++;
+ if (bezt->f3) stats->totvertsel++;
bezt++;
}
}
else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
+ bp = nu->bp;
+ a = nu->pntsu * nu->pntsv;
+ while (a--) {
stats->totvert++;
- if(bp->f1 & SELECT) stats->totvertsel++;
+ if (bp->f1 & SELECT) stats->totvertsel++;
bp++;
}
}
}
}
- else if(obedit->type==OB_MBALL) {
+ else if (obedit->type == OB_MBALL) {
/* MetaBall Edit */
- MetaBall *mball= obedit->data;
+ MetaBall *mball = obedit->data;
MetaElem *ml;
- for(ml= mball->editelems->first; ml; ml=ml->next) {
+ for (ml = mball->editelems->first; ml; ml = ml->next) {
stats->totvert++;
- if(ml->flag & SELECT) stats->totvertsel++;
+ if (ml->flag & SELECT) stats->totvertsel++;
}
}
- else if(obedit->type==OB_LATTICE) {
+ else if (obedit->type == OB_LATTICE) {
/* Lattice Edit */
- Lattice *lt= obedit->data;
- Lattice *editlatt= lt->editlatt->latt;
+ Lattice *lt = obedit->data;
+ Lattice *editlatt = lt->editlatt->latt;
BPoint *bp;
int a;
- bp= editlatt->def;
+ bp = editlatt->def;
- a= editlatt->pntsu*editlatt->pntsv*editlatt->pntsw;
- while(a--) {
+ a = editlatt->pntsu * editlatt->pntsv * editlatt->pntsw;
+ while (a--) {
stats->totvert++;
- if(bp->f1 & SELECT) stats->totvertsel++;
+ if (bp->f1 & SELECT) stats->totvertsel++;
bp++;
}
}
@@ -238,54 +238,44 @@ static void stats_object_edit(Object *obedit, SceneStats *stats)
static void stats_object_pose(Object *ob, SceneStats *stats)
{
- if(ob->pose) {
- bArmature *arm= ob->data;
+ if (ob->pose) {
+ bArmature *arm = ob->data;
bPoseChannel *pchan;
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
stats->totbone++;
- if(pchan->bone && (pchan->bone->flag & BONE_SELECTED))
- if(pchan->bone->layer & arm->layer)
+ if (pchan->bone && (pchan->bone->flag & BONE_SELECTED))
+ if (pchan->bone->layer & arm->layer)
stats->totbonesel++;
}
}
}
-static void stats_object_paint(Object *ob, SceneStats *stats)
-{
- if(ob->type == OB_MESH) {
- Mesh *me= ob->data;
-
- stats->totface= me->totface;
- stats->totvert= me->totvert;
- }
-}
-
static void stats_dupli_object(Base *base, Object *ob, SceneStats *stats)
{
- if(base->flag & SELECT) stats->totobjsel++;
+ if (base->flag & SELECT) stats->totobjsel++;
- if(ob->transflag & OB_DUPLIPARTS) {
+ if (ob->transflag & OB_DUPLIPARTS) {
/* Dupli Particles */
ParticleSystem *psys;
ParticleSettings *part;
- for(psys=ob->particlesystem.first; psys; psys=psys->next){
- part=psys->part;
+ for (psys = ob->particlesystem.first; psys; psys = psys->next) {
+ part = psys->part;
- if(part->draw_as==PART_DRAW_OB && part->dup_ob){
- int tot=count_particles(psys);
+ if (part->draw_as == PART_DRAW_OB && part->dup_ob) {
+ int tot = count_particles(psys);
stats_object(part->dup_ob, 0, tot, stats);
}
- else if(part->draw_as==PART_DRAW_GR && part->dup_group){
+ else if (part->draw_as == PART_DRAW_GR && part->dup_group) {
GroupObject *go;
- int tot, totgroup=0, cur=0;
+ int tot, totgroup = 0, cur = 0;
- for(go= part->dup_group->gobject.first; go; go=go->next)
+ for (go = part->dup_group->gobject.first; go; go = go->next)
totgroup++;
- for(go= part->dup_group->gobject.first; go; go=go->next) {
- tot=count_particles_mod(psys,totgroup,cur);
+ for (go = part->dup_group->gobject.first; go; go = go->next) {
+ tot = count_particles_mod(psys, totgroup, cur);
stats_object(go->ob, 0, tot, stats);
cur++;
}
@@ -295,22 +285,22 @@ static void stats_dupli_object(Base *base, Object *ob, SceneStats *stats)
stats_object(ob, base->flag & SELECT, 1, stats);
stats->totobj++;
}
- else if(ob->parent && (ob->parent->transflag & (OB_DUPLIVERTS|OB_DUPLIFACES))) {
+ else if (ob->parent && (ob->parent->transflag & (OB_DUPLIVERTS | OB_DUPLIFACES))) {
/* Dupli Verts/Faces */
- int tot= count_duplilist(ob->parent);
- stats->totobj+=tot;
+ int tot = count_duplilist(ob->parent);
+ stats->totobj += tot;
stats_object(ob, base->flag & SELECT, tot, stats);
}
- else if(ob->transflag & OB_DUPLIFRAMES) {
+ else if (ob->transflag & OB_DUPLIFRAMES) {
/* Dupli Frames */
- int tot= count_duplilist(ob);
- stats->totobj+=tot;
+ int tot = count_duplilist(ob);
+ stats->totobj += tot;
stats_object(ob, base->flag & SELECT, tot, stats);
}
- else if((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) {
+ else if ((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) {
/* Dupli Group */
- int tot= count_duplilist(ob);
- stats->totobj+=tot;
+ int tot = count_duplilist(ob);
+ stats->totobj += tot;
stats_object(ob, base->flag & SELECT, tot, stats);
}
else {
@@ -323,102 +313,98 @@ static void stats_dupli_object(Base *base, Object *ob, SceneStats *stats)
/* Statistics displayed in info header. Called regularly on scene changes. */
static void stats_update(Scene *scene)
{
- SceneStats stats= {0};
- Object *ob= (scene->basact)? scene->basact->object: NULL;
+ SceneStats stats = {0};
+ Object *ob = (scene->basact) ? scene->basact->object : NULL;
Base *base;
- if(scene->obedit) {
+ if (scene->obedit) {
/* Edit Mode */
stats_object_edit(scene->obedit, &stats);
}
- else if(ob && (ob->mode & OB_MODE_POSE)) {
+ else if (ob && (ob->mode & OB_MODE_POSE)) {
/* Pose Mode */
stats_object_pose(ob, &stats);
}
- else if(ob && (ob->flag & OB_MODE_ALL_PAINT)) {
- /* Sculpt and Paint Mode */
- stats_object_paint(ob, &stats);
- }
else {
/* Objects */
- for(base= scene->base.first; base; base=base->next)
- if(scene->lay & base->lay)
+ for (base = scene->base.first; base; base = base->next)
+ if (scene->lay & base->lay)
stats_dupli_object(base, base->object, &stats);
}
- if(!scene->stats)
- scene->stats= MEM_callocN(sizeof(SceneStats), "SceneStats");
+ if (!scene->stats)
+ scene->stats = MEM_callocN(sizeof(SceneStats), "SceneStats");
- *(scene->stats)= stats;
+ *(scene->stats) = stats;
}
static void stats_string(Scene *scene)
{
- SceneStats *stats= scene->stats;
- Object *ob= (scene->basact)? scene->basact->object: NULL;
+ SceneStats *stats = scene->stats;
+ Object *ob = (scene->basact) ? scene->basact->object : NULL;
uintptr_t mem_in_use, mmap_in_use;
char memstr[64];
char *s;
- mem_in_use= MEM_get_memory_in_use();
- mmap_in_use= MEM_get_mapped_memory_in_use();
+ mem_in_use = MEM_get_memory_in_use();
+ mmap_in_use = MEM_get_mapped_memory_in_use();
/* get memory statistics */
- s= memstr + sprintf(memstr, " | Mem:%.2fM", (double)((mem_in_use-mmap_in_use)>>10)/1024.0);
- if(mmap_in_use)
- sprintf(s, " (%.2fM)", (double)((mmap_in_use)>>10)/1024.0);
+ s = memstr + sprintf(memstr, " | Mem:%.2fM", (double)((mem_in_use - mmap_in_use) >> 10) / 1024.0);
+ if (mmap_in_use)
+ sprintf(s, " (%.2fM)", (double)((mmap_in_use) >> 10) / 1024.0);
- s= stats->infostr;
+ s = stats->infostr;
- s+= sprintf(s, "%s | ", versionstr);
-
- if(scene->obedit) {
- if(ob_get_keyblock(scene->obedit))
- s+= sprintf(s, "(Key) ");
-
- if(scene->obedit->type==OB_MESH) {
- if(scene->toolsettings->selectmode & SCE_SELECT_VERTEX)
- s+= sprintf(s, "Ve:%d-%d | Ed:%d-%d | Fa:%d-%d",
- stats->totvertsel, stats->totvert, stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface);
- else if(scene->toolsettings->selectmode & SCE_SELECT_EDGE)
- s+= sprintf(s, "Ed:%d-%d | Fa:%d-%d",
- stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface);
+ s += sprintf(s, "%s | ", versionstr);
+
+ if (scene->obedit) {
+ if (ob_get_keyblock(scene->obedit))
+ s += sprintf(s, "(Key) ");
+
+ if (scene->obedit->type == OB_MESH) {
+ if (scene->toolsettings->selectmode & SCE_SELECT_VERTEX)
+ s += sprintf(s, "Ve:%d-%d | Ed:%d-%d | Fa:%d-%d",
+ stats->totvertsel, stats->totvert, stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface);
+ else if (scene->toolsettings->selectmode & SCE_SELECT_EDGE)
+ s += sprintf(s, "Ed:%d-%d | Fa:%d-%d",
+ stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface);
else
- s+= sprintf(s, "Fa:%d-%d", stats->totfacesel, stats->totface);
+ s += sprintf(s, "Fa:%d-%d", stats->totfacesel, stats->totface);
}
- else if(scene->obedit->type==OB_ARMATURE) {
- s+= sprintf(s, "Ve:%d-%d | Bo:%d-%d", stats->totvertsel, stats->totvert, stats->totbonesel, stats->totbone);
+ else if (scene->obedit->type == OB_ARMATURE) {
+ s += sprintf(s, "Ve:%d-%d | Bo:%d-%d", stats->totvertsel, stats->totvert, stats->totbonesel, stats->totbone);
}
else {
- s+= sprintf(s, "Ve:%d-%d", stats->totvertsel, stats->totvert);
+ s += sprintf(s, "Ve:%d-%d", stats->totvertsel, stats->totvert);
}
strcat(s, memstr);
}
- else if(ob && (ob->mode & OB_MODE_POSE)) {
+ else if (ob && (ob->mode & OB_MODE_POSE)) {
s += sprintf(s, "Bo:%d-%d %s",
- stats->totbonesel, stats->totbone, memstr);
+ stats->totbonesel, stats->totbone, memstr);
}
else {
s += sprintf(s, "Ve:%d | Fa:%d | Ob:%d-%d | La:%d%s",
- stats->totvert, stats->totface, stats->totobjsel, stats->totobj, stats->totlamp, memstr);
+ stats->totvert, stats->totface, stats->totobjsel, stats->totobj, stats->totlamp, memstr);
}
- if(ob)
- sprintf(s, " | %s", ob->id.name+2);
+ if (ob)
+ sprintf(s, " | %s", ob->id.name + 2);
}
void ED_info_stats_clear(Scene *scene)
{
- if(scene->stats) {
+ if (scene->stats) {
MEM_freeN(scene->stats);
- scene->stats= NULL;
+ scene->stats = NULL;
}
}
const char *ED_info_stats_string(Scene *scene)
{
- if(!scene->stats)
+ if (!scene->stats)
stats_update(scene);
stats_string(scene);
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c
index b9ef57e6850..7cb89b6bc6b 100644
--- a/source/blender/editors/space_info/space_info.c
+++ b/source/blender/editors/space_info/space_info.c
@@ -57,7 +57,7 @@
#include "UI_interface.h"
#include "UI_view2d.h"
-#include "info_intern.h" // own include
+#include "info_intern.h" /* own include */
/* ******************** default callbacks for info space ***************** */
@@ -66,31 +66,31 @@ static SpaceLink *info_new(const bContext *UNUSED(C))
ARegion *ar;
SpaceInfo *sinfo;
- sinfo= MEM_callocN(sizeof(SpaceInfo), "initinfo");
- sinfo->spacetype= SPACE_INFO;
+ sinfo = MEM_callocN(sizeof(SpaceInfo), "initinfo");
+ sinfo->spacetype = SPACE_INFO;
- sinfo->rpt_mask= INFO_RPT_OP;
+ sinfo->rpt_mask = INFO_RPT_OP;
/* header */
- ar= MEM_callocN(sizeof(ARegion), "header for info");
+ ar = MEM_callocN(sizeof(ARegion), "header for info");
BLI_addtail(&sinfo->regionbase, ar);
- ar->regiontype= RGN_TYPE_HEADER;
- ar->alignment= RGN_ALIGN_BOTTOM;
+ ar->regiontype = RGN_TYPE_HEADER;
+ ar->alignment = RGN_ALIGN_BOTTOM;
/* main area */
- ar= MEM_callocN(sizeof(ARegion), "main area for info");
+ ar = MEM_callocN(sizeof(ARegion), "main area for info");
BLI_addtail(&sinfo->regionbase, ar);
- ar->regiontype= RGN_TYPE_WINDOW;
+ ar->regiontype = RGN_TYPE_WINDOW;
/* keep in sync with console */
ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
- ar->v2d.align |= V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y; /* align bottom left */
+ ar->v2d.align |= V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_NEG_Y; /* align bottom left */
ar->v2d.keepofs |= V2D_LOCKOFS_X;
- ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT);
- ar->v2d.keeptot= V2D_KEEPTOT_BOUNDS;
- ar->v2d.minzoom= ar->v2d.maxzoom= 1.0f;
+ ar->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT);
+ ar->v2d.keeptot = V2D_KEEPTOT_BOUNDS;
+ ar->v2d.minzoom = ar->v2d.maxzoom = 1.0f;
/* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */
//ar->v2d.keepzoom= (V2D_KEEPASPECT|V2D_LIMITZOOM);
@@ -114,7 +114,7 @@ static void info_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa))
static SpaceLink *info_duplicate(SpaceLink *sl)
{
- SpaceInfo *sinfon= MEM_dupallocN(sl);
+ SpaceInfo *sinfon = MEM_dupallocN(sl);
/* clear or remove stuff from old */
@@ -131,23 +131,23 @@ static void info_main_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "Info", SPACE_INFO, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Info", SPACE_INFO, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
static void info_textview_update_rect(const bContext *C, ARegion *ar)
{
- SpaceInfo *sinfo= CTX_wm_space_info(C);
- View2D *v2d= &ar->v2d;
+ SpaceInfo *sinfo = CTX_wm_space_info(C);
+ View2D *v2d = &ar->v2d;
- UI_view2d_totRect_set(v2d, ar->winx-1, info_textview_height(sinfo, ar, CTX_wm_reports(C)));
+ UI_view2d_totRect_set(v2d, ar->winx - 1, info_textview_height(sinfo, ar, CTX_wm_reports(C)));
}
static void info_main_area_draw(const bContext *C, ARegion *ar)
{
/* draw entirely, view changes should be handled here */
- SpaceInfo *sinfo= CTX_wm_space_info(C);
- View2D *v2d= &ar->v2d;
+ SpaceInfo *sinfo = CTX_wm_space_info(C);
+ View2D *v2d = &ar->v2d;
View2DScrollers *scrollers;
/* clear and setup matrix */
@@ -155,7 +155,7 @@ static void info_main_area_draw(const bContext *C, ARegion *ar)
glClear(GL_COLOR_BUFFER_BIT);
/* quick way to avoid drawing if not bug enough */
- if(ar->winy < 16)
+ if (ar->winy < 16)
return;
info_textview_update_rect(C, ar);
@@ -169,7 +169,7 @@ static void info_main_area_draw(const bContext *C, ARegion *ar)
UI_view2d_view_restore(C);
/* scrollers */
- scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_GRID_CLAMP);
+ scrollers = UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_GRID_CLAMP);
UI_view2d_scrollers_draw(C, v2d, scrollers);
UI_view2d_scrollers_free(scrollers);
}
@@ -196,12 +196,12 @@ static void info_operatortypes(void)
static void info_keymap(struct wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "Window", 0, 0);
+ wmKeyMap *keymap = WM_keymap_find(keyconf, "Window", 0, 0);
WM_keymap_verify_item(keymap, "INFO_OT_reports_display_update", TIMERREPORT, KM_ANY, KM_ANY, 0);
/* info space */
- keymap= WM_keymap_find(keyconf, "Info", SPACE_INFO, 0);
+ keymap = WM_keymap_find(keyconf, "Info", SPACE_INFO, 0);
/* report selection */
@@ -231,9 +231,9 @@ static void info_main_area_listener(ARegion *ar, wmNotifier *wmn)
// SpaceInfo *sinfo= sa->spacedata.first;
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_SPACE:
- if(wmn->data == ND_SPACE_INFO_REPORT) {
+ if (wmn->data == ND_SPACE_INFO_REPORT) {
/* redraw also but only for report view, could do less redraws by checking the type */
ED_region_tag_redraw(ar);
}
@@ -244,25 +244,25 @@ static void info_main_area_listener(ARegion *ar, wmNotifier *wmn)
static void info_header_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_SCREEN:
- if(ELEM(wmn->data, ND_SCREENCAST, ND_ANIMPLAY))
+ if (ELEM(wmn->data, ND_SCREENCAST, ND_ANIMPLAY))
ED_region_tag_redraw(ar);
break;
case NC_WM:
- if(wmn->data == ND_JOB)
+ if (wmn->data == ND_JOB)
ED_region_tag_redraw(ar);
break;
case NC_SCENE:
- if(wmn->data==ND_RENDER_RESULT)
+ if (wmn->data == ND_RENDER_RESULT)
ED_region_tag_redraw(ar);
break;
case NC_SPACE:
- if(wmn->data == ND_SPACE_INFO)
+ if (wmn->data == ND_SPACE_INFO)
ED_region_tag_redraw(ar);
break;
case NC_ID:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
}
@@ -271,13 +271,14 @@ static void info_header_listener(ARegion *ar, wmNotifier *wmn)
static void recent_files_menu_draw(const bContext *UNUSED(C), Menu *menu)
{
struct RecentFile *recent;
- uiLayout *layout= menu->layout;
+ uiLayout *layout = menu->layout;
uiLayoutSetOperatorContext(layout, WM_OP_EXEC_REGION_WIN);
if (G.recent_files.first) {
- for(recent = G.recent_files.first; (recent); recent = recent->next) {
+ for (recent = G.recent_files.first; (recent); recent = recent->next) {
uiItemStringO(layout, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath);
}
- } else {
+ }
+ else {
uiItemL(layout, IFACE_("No Recent Files"), ICON_NONE);
}
}
@@ -286,49 +287,49 @@ static void recent_files_menu_register(void)
{
MenuType *mt;
- mt= MEM_callocN(sizeof(MenuType), "spacetype info menu recent files");
+ mt = MEM_callocN(sizeof(MenuType), "spacetype info menu recent files");
strcpy(mt->idname, "INFO_MT_file_open_recent");
strcpy(mt->label, N_("Open Recent..."));
- mt->draw= recent_files_menu_draw;
+ mt->draw = recent_files_menu_draw;
WM_menutype_add(mt);
}
/* only called once, from space/spacetypes.c */
void ED_spacetype_info(void)
{
- SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype info");
+ SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype info");
ARegionType *art;
- st->spaceid= SPACE_INFO;
+ st->spaceid = SPACE_INFO;
strncpy(st->name, "Info", BKE_ST_MAXNAME);
- st->new= info_new;
- st->free= info_free;
- st->init= info_init;
- st->duplicate= info_duplicate;
- st->operatortypes= info_operatortypes;
- st->keymap= info_keymap;
+ st->new = info_new;
+ st->free = info_free;
+ st->init = info_init;
+ st->duplicate = info_duplicate;
+ st->operatortypes = info_operatortypes;
+ st->keymap = info_keymap;
/* regions: main window */
- art= MEM_callocN(sizeof(ARegionType), "spacetype info region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype info region");
art->regionid = RGN_TYPE_WINDOW;
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D;
- art->init= info_main_area_init;
- art->draw= info_main_area_draw;
- art->listener= info_main_area_listener;
+ art->init = info_main_area_init;
+ art->draw = info_main_area_draw;
+ art->listener = info_main_area_listener;
BLI_addhead(&st->regiontypes, art);
/* regions: header */
- art= MEM_callocN(sizeof(ARegionType), "spacetype info region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype info region");
art->regionid = RGN_TYPE_HEADER;
- art->prefsizey= HEADERY;
+ art->prefsizey = HEADERY;
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES|ED_KEYMAP_HEADER;
- art->listener= info_header_listener;
- art->init= info_header_area_init;
- art->draw= info_header_area_draw;
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES | ED_KEYMAP_HEADER;
+ art->listener = info_header_listener;
+ art->init = info_header_area_init;
+ art->draw = info_header_area_draw;
BLI_addhead(&st->regiontypes, art);
diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c
index 177b72567e5..4ba196276da 100644
--- a/source/blender/editors/space_info/textview.c
+++ b/source/blender/editors/space_info/textview.c
@@ -47,7 +47,7 @@
static void console_font_begin(TextViewContext *sc)
{
- BLF_size(blf_mono_font, sc->lheight-2, 72);
+ BLF_size(blf_mono_font, sc->lheight - 2, 72);
}
typedef struct ConsoleDrawContext {
@@ -65,20 +65,20 @@ typedef struct ConsoleDrawContext {
static void console_draw_sel(int sel[2], int xy[2], int str_len_draw, int cwidth, int lheight)
{
- if(sel[0] <= str_len_draw && sel[1] >= 0) {
+ if (sel[0] <= str_len_draw && sel[1] >= 0) {
int sta = MAX2(sel[0], 0);
int end = MIN2(sel[1], str_len_draw);
glEnable(GL_POLYGON_STIPPLE);
glPolygonStipple(stipple_halftone);
- glEnable( GL_BLEND );
+ glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4ub(255, 255, 255, 96);
- glRecti(xy[0]+(cwidth*sta), xy[1]-2 + lheight, xy[0]+(cwidth*end), xy[1]-2);
+ glRecti(xy[0] + (cwidth * sta), xy[1] - 2 + lheight, xy[0] + (cwidth * end), xy[1] - 2);
glDisable(GL_POLYGON_STIPPLE);
- glDisable( GL_BLEND );
+ glDisable(GL_BLEND);
}
}
@@ -89,47 +89,48 @@ static void console_draw_sel(int sel[2], int xy[2], int str_len_draw, int cwidth
static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str_len, unsigned char *fg, unsigned char *bg)
{
#define STEP_SEL(value) cdc->sel[0] += (value); cdc->sel[1] += (value)
- int rct_ofs= cdc->lheight/4;
- int tot_lines = (str_len/cdc->console_width)+1; /* total number of lines for wrapping */
- int y_next = (str_len > cdc->console_width) ? cdc->xy[1]+cdc->lheight*tot_lines : cdc->xy[1]+cdc->lheight;
- const int mono= blf_mono_font;
+ int rct_ofs = cdc->lheight / 4;
+ int tot_lines = (str_len / cdc->console_width) + 1; /* total number of lines for wrapping */
+ int y_next = (str_len > cdc->console_width) ? cdc->xy[1] + cdc->lheight * tot_lines : cdc->xy[1] + cdc->lheight;
+ const int mono = blf_mono_font;
/* just advance the height */
- if(cdc->draw==0) {
- if(cdc->pos_pick && (cdc->mval[1] != INT_MAX)) {
- if(cdc->xy[1] <= cdc->mval[1]) {
- if((y_next >= cdc->mval[1])) {
+ if (cdc->draw == 0) {
+ if (cdc->pos_pick && (cdc->mval[1] != INT_MAX)) {
+ if (cdc->xy[1] <= cdc->mval[1]) {
+ if ((y_next >= cdc->mval[1])) {
int ofs = (int)floor(((float)cdc->mval[0] / (float)cdc->cwidth));
/* wrap */
- if(str_len > cdc->console_width)
- ofs += (cdc->console_width * ((int)((((float)(y_next - cdc->mval[1]) / (float)(y_next-cdc->xy[1])) * tot_lines))));
+ if (str_len > cdc->console_width)
+ ofs += (cdc->console_width * ((int)((((float)(y_next - cdc->mval[1]) / (float)(y_next - cdc->xy[1])) * tot_lines))));
CLAMP(ofs, 0, str_len);
*cdc->pos_pick += str_len - ofs;
- } else
+ }
+ else
*cdc->pos_pick += str_len + 1;
}
}
- cdc->xy[1]= y_next;
+ cdc->xy[1] = y_next;
return 1;
}
- else if (y_next-cdc->lheight < cdc->ymin) {
+ else if (y_next - cdc->lheight < cdc->ymin) {
/* have not reached the drawable area so don't break */
- cdc->xy[1]= y_next;
+ cdc->xy[1] = y_next;
/* adjust selection even if not drawing */
- if(cdc->sel[0] != cdc->sel[1]) {
+ if (cdc->sel[0] != cdc->sel[1]) {
STEP_SEL(-(str_len + 1));
}
return 1;
}
- if(str_len > cdc->console_width) { /* wrap? */
- const int initial_offset= ((tot_lines-1) * cdc->console_width);
- const char *line_stride= str + initial_offset; /* advance to the last line and draw it first */
+ if (str_len > cdc->console_width) { /* wrap? */
+ const int initial_offset = ((tot_lines - 1) * cdc->console_width);
+ const char *line_stride = str + initial_offset; /* advance to the last line and draw it first */
int sel_orig[2];
copy_v2_v2_int(sel_orig, cdc->sel);
@@ -138,9 +139,9 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str
cdc->sel[0] = str_len - sel_orig[1];
cdc->sel[1] = str_len - sel_orig[0];
- if(bg) {
+ if (bg) {
glColor3ubv(bg);
- glRecti(0, cdc->xy[1]-rct_ofs, cdc->winx, (cdc->xy[1]+(cdc->lheight*tot_lines))+rct_ofs);
+ glRecti(0, cdc->xy[1] - rct_ofs, cdc->winx, (cdc->xy[1] + (cdc->lheight * tot_lines)) + rct_ofs);
}
glColor3ubv(fg);
@@ -149,7 +150,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str
BLF_position(mono, cdc->xy[0], cdc->xy[1], 0);
BLF_draw(mono, line_stride, str_len - initial_offset);
- if(cdc->sel[0] != cdc->sel[1]) {
+ if (cdc->sel[0] != cdc->sel[1]) {
STEP_SEL(-initial_offset);
// glColor4ub(255, 0, 0, 96); // debug
console_draw_sel(cdc->sel, cdc->xy, str_len % cdc->console_width, cdc->cwidth, cdc->lheight);
@@ -161,11 +162,11 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str
line_stride -= cdc->console_width;
- for(; line_stride >= str; line_stride -= cdc->console_width) {
+ for (; line_stride >= str; line_stride -= cdc->console_width) {
BLF_position(mono, cdc->xy[0], cdc->xy[1], 0);
BLF_draw(mono, line_stride, cdc->console_width);
- if(cdc->sel[0] != cdc->sel[1]) {
+ if (cdc->sel[0] != cdc->sel[1]) {
// glColor4ub(0, 255, 0, 96); // debug
console_draw_sel(cdc->sel, cdc->xy, cdc->console_width, cdc->cwidth, cdc->lheight);
STEP_SEL(cdc->console_width);
@@ -175,7 +176,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str
cdc->xy[1] += cdc->lheight;
/* check if were out of view bounds */
- if(cdc->xy[1] > cdc->ymax)
+ if (cdc->xy[1] > cdc->ymax)
return 0;
}
@@ -184,9 +185,9 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str
}
else { /* simple, no wrap */
- if(bg) {
+ if (bg) {
glColor3ubv(bg);
- glRecti(0, cdc->xy[1]-rct_ofs, cdc->winx, cdc->xy[1]+cdc->lheight-rct_ofs);
+ glRecti(0, cdc->xy[1] - rct_ofs, cdc->winx, cdc->xy[1] + cdc->lheight - rct_ofs);
}
glColor3ubv(fg);
@@ -194,11 +195,11 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str
BLF_position(mono, cdc->xy[0], cdc->xy[1], 0);
BLF_draw(mono, str, str_len);
- if(cdc->sel[0] != cdc->sel[1]) {
+ if (cdc->sel[0] != cdc->sel[1]) {
int isel[2];
- isel[0]= str_len - cdc->sel[1];
- isel[1]= str_len - cdc->sel[0];
+ isel[0] = str_len - cdc->sel[1];
+ isel[1] = str_len - cdc->sel[0];
// glColor4ub(255, 255, 0, 96); // debug
console_draw_sel(isel, cdc->xy, str_len, cdc->cwidth, cdc->lheight);
@@ -207,7 +208,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str
cdc->xy[1] += cdc->lheight;
- if(cdc->xy[1] > cdc->ymax)
+ if (cdc->xy[1] > cdc->ymax)
return 0;
}
@@ -220,78 +221,78 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str
int textview_draw(TextViewContext *tvc, int draw, int mval[2], void **mouse_pick, int *pos_pick)
{
- ConsoleDrawContext cdc= {0};
+ ConsoleDrawContext cdc = {0};
- int x_orig=CONSOLE_DRAW_MARGIN, y_orig=CONSOLE_DRAW_MARGIN + tvc->lheight/6;
+ int x_orig = CONSOLE_DRAW_MARGIN, y_orig = CONSOLE_DRAW_MARGIN + tvc->lheight / 6;
int xy[2], y_prev;
- int sel[2]= {-1, -1}; /* defaults disabled */
+ int sel[2] = {-1, -1}; /* defaults disabled */
unsigned char fg[3], bg[3];
- const int mono= blf_mono_font;
+ const int mono = blf_mono_font;
console_font_begin(tvc);
- xy[0]= x_orig; xy[1]= y_orig;
+ xy[0] = x_orig; xy[1] = y_orig;
- if(mval[1] != INT_MAX)
+ if (mval[1] != INT_MAX)
mval[1] += (tvc->ymin + CONSOLE_DRAW_MARGIN);
- if(pos_pick)
+ if (pos_pick)
*pos_pick = 0;
/* constants for the sequencer context */
- cdc.cwidth= (int)BLF_fixed_width(mono);
+ cdc.cwidth = (int)BLF_fixed_width(mono);
assert(cdc.cwidth > 0);
- cdc.lheight= tvc->lheight;
- cdc.console_width= (tvc->winx - (CONSOLE_DRAW_SCROLL + CONSOLE_DRAW_MARGIN*2) ) / cdc.cwidth;
+ cdc.lheight = tvc->lheight;
+ cdc.console_width = (tvc->winx - (CONSOLE_DRAW_SCROLL + CONSOLE_DRAW_MARGIN * 2) ) / cdc.cwidth;
CLAMP(cdc.console_width, 1, INT_MAX); /* avoid divide by zero on small windows */
- cdc.winx= tvc->winx-(CONSOLE_DRAW_MARGIN+CONSOLE_DRAW_SCROLL);
- cdc.ymin= tvc->ymin;
- cdc.ymax= tvc->ymax;
- cdc.xy= xy;
- cdc.sel= sel;
- cdc.pos_pick= pos_pick;
- cdc.mval= mval;
- cdc.draw= draw;
+ cdc.winx = tvc->winx - (CONSOLE_DRAW_MARGIN + CONSOLE_DRAW_SCROLL);
+ cdc.ymin = tvc->ymin;
+ cdc.ymax = tvc->ymax;
+ cdc.xy = xy;
+ cdc.sel = sel;
+ cdc.pos_pick = pos_pick;
+ cdc.mval = mval;
+ cdc.draw = draw;
/* shouldnt be needed */
- tvc->cwidth= cdc.cwidth;
- tvc->console_width= cdc.console_width;
- tvc->iter_index= 0;
+ tvc->cwidth = cdc.cwidth;
+ tvc->console_width = cdc.console_width;
+ tvc->iter_index = 0;
- if(tvc->sel_start != tvc->sel_end) {
- sel[0]= tvc->sel_start;
- sel[1]= tvc->sel_end;
+ if (tvc->sel_start != tvc->sel_end) {
+ sel[0] = tvc->sel_start;
+ sel[1] = tvc->sel_end;
}
- if(tvc->begin(tvc)) {
+ if (tvc->begin(tvc)) {
do {
const char *ext_line;
int ext_len;
- int color_flag= 0;
+ int color_flag = 0;
- y_prev= xy[1];
+ y_prev = xy[1];
- if(draw)
- color_flag= tvc->line_color(tvc, fg, bg);
+ if (draw)
+ color_flag = tvc->line_color(tvc, fg, bg);
tvc->line_get(tvc, &ext_line, &ext_len);
- if(!console_draw_string(&cdc, ext_line, ext_len, (color_flag & TVC_LINE_FG) ? fg : NULL, (color_flag & TVC_LINE_BG) ? bg : NULL)) {
+ if (!console_draw_string(&cdc, ext_line, ext_len, (color_flag & TVC_LINE_FG) ? fg : NULL, (color_flag & TVC_LINE_BG) ? bg : NULL)) {
/* when drawing, if we pass v2d->cur.ymax, then quit */
- if(draw) {
+ if (draw) {
break; /* past the y limits */
}
}
- if((mval[1] != INT_MAX) && (mval[1] >= y_prev && mval[1] <= xy[1])) {
- *mouse_pick= (void *)tvc->iter;
+ if ((mval[1] != INT_MAX) && (mval[1] >= y_prev && mval[1] <= xy[1])) {
+ *mouse_pick = (void *)tvc->iter;
break;
}
tvc->iter_index++;
- } while(tvc->step(tvc));
+ } while (tvc->step(tvc));
}
tvc->end(tvc);
diff --git a/source/blender/editors/space_logic/logic_buttons.c b/source/blender/editors/space_logic/logic_buttons.c
index 388f9470cb5..b98e6995f46 100644
--- a/source/blender/editors/space_logic/logic_buttons.c
+++ b/source/blender/editors/space_logic/logic_buttons.c
@@ -108,7 +108,7 @@ static int logic_properties(bContext *C, wmOperator *UNUSED(op))
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= logic_has_buttons_region(sa);
- if(ar)
+ if (ar)
ED_region_toggle_hidden(C, ar);
return OPERATOR_FINISHED;
@@ -116,15 +116,15 @@ static int logic_properties(bContext *C, wmOperator *UNUSED(op))
void LOGIC_OT_properties(wmOperatorType *ot)
{
- ot->name= "Properties";
- ot->description= "Toggle display properties panel";
- ot->idname= "LOGIC_OT_properties";
+ ot->name = "Properties";
+ ot->description = "Toggle display properties panel";
+ ot->idname = "LOGIC_OT_properties";
- ot->exec= logic_properties;
- ot->poll= ED_operator_logic_active;
+ ot->exec = logic_properties;
+ ot->poll = ED_operator_logic_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
/* Remove Logic Bricks Connections */
@@ -137,15 +137,15 @@ static int cut_links_intersect(uiLinkLine *line, float mcoords[][2], int tot)
int i, b;
rcti rectlink;
- rectlink.xmin= (int) (line->from->x1 + line->from->x2) / 2;
- rectlink.ymin= (int) (line->from->y1 + line->from->y2) / 2;
- rectlink.xmax= (int) (line->to->x1 + line->to->x2) / 2;
- rectlink.ymax= (int) (line->to->y1 + line->to->y2) / 2;
+ rectlink.xmin = (int) (line->from->x1 + line->from->x2) / 2;
+ rectlink.ymin = (int) (line->from->y1 + line->from->y2) / 2;
+ rectlink.xmax = (int) (line->to->x1 + line->to->x2) / 2;
+ rectlink.ymax = (int) (line->to->y1 + line->to->y2) / 2;
- if(ui_link_bezier_points(&rectlink, coord_array, LINK_RESOL)){
- for(i=0; i<tot-1; i++)
- for(b=0; b<LINK_RESOL-1; b++)
- if(isect_line_line_v2(mcoords[i], mcoords[i+1], coord_array[b], coord_array[b+1]) > 0)
+ if (ui_link_bezier_points(&rectlink, coord_array, LINK_RESOL)) {
+ for (i=0; i<tot-1; i++)
+ for (b=0; b<LINK_RESOL-1; b++)
+ if (isect_line_line_v2(mcoords[i], mcoords[i+1], coord_array[b], coord_array[b+1]) > 0)
return 1;
}
return 0;
@@ -164,7 +164,7 @@ static int cut_links_exec(bContext *C, wmOperator *op)
UI_view2d_region_to_view(&ar->v2d, (short)loc[0], (short)loc[1],
&mcoords[i][0], &mcoords[i][1]);
i++;
- if(i>= 256) break;
+ if (i>= 256) break;
}
RNA_END;
@@ -172,15 +172,15 @@ static int cut_links_exec(bContext *C, wmOperator *op)
uiBlock *block;
uiLinkLine *line, *nline;
uiBut *but;
- for(block= ar->uiblocks.first; block; block= block->next)
+ for (block= ar->uiblocks.first; block; block= block->next)
{
but= block->buttons.first;
- while(but) {
- if(but->type==LINK && but->link) {
- for(line= but->link->lines.first; line; line= nline) {
+ while (but) {
+ if (but->type==LINK && but->link) {
+ for (line= but->link->lines.first; line; line= nline) {
nline= line->next;
- if(cut_links_intersect(line, mcoords, i)) {
+ if (cut_links_intersect(line, mcoords, i)) {
ui_delete_linkline(line, but);
}
}
@@ -197,19 +197,19 @@ void LOGIC_OT_links_cut(wmOperatorType *ot)
{
PropertyRNA *prop;
- ot->name= "Cut links";
- ot->idname= "LOGIC_OT_links_cut";
- ot->description= "Remove logic brick connections";
+ ot->name = "Cut links";
+ ot->idname = "LOGIC_OT_links_cut";
+ ot->description = "Remove logic brick connections";
- ot->invoke= WM_gesture_lines_invoke;
- ot->modal= WM_gesture_lines_modal;
- ot->exec= cut_links_exec;
- ot->cancel= WM_gesture_lines_cancel;
+ ot->invoke = WM_gesture_lines_invoke;
+ ot->modal = WM_gesture_lines_modal;
+ ot->exec = cut_links_exec;
+ ot->cancel = WM_gesture_lines_cancel;
- ot->poll= ED_operator_logic_active;
+ ot->poll = ED_operator_logic_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c
index 0dfcafcf549..cac4fe04765 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
@@ -258,16 +258,16 @@ static int sensor_remove_exec(bContext *C, wmOperator *op)
static void LOGIC_OT_sensor_remove(wmOperatorType *ot)
{
- ot->name= "Remove Sensor";
- ot->description= "Remove a sensor from the active object";
- ot->idname= "LOGIC_OT_sensor_remove";
+ ot->name = "Remove Sensor";
+ ot->description = "Remove a sensor from the active object";
+ ot->idname = "LOGIC_OT_sensor_remove";
- ot->invoke= sensor_remove_invoke;
- ot->exec= sensor_remove_exec;
- ot->poll= edit_sensor_poll;
+ ot->invoke = sensor_remove_invoke;
+ ot->exec = sensor_remove_exec;
+ ot->poll = edit_sensor_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_sensor_properties(ot);
}
@@ -293,7 +293,7 @@ static int sensor_add_exec(bContext *C, wmOperator *op)
prop = RNA_struct_find_property(&sens_ptr, "type");
RNA_string_get(op->ptr, "name", name);
- if(BLI_strnlen(name, MAX_NAME) < 1){
+ if (BLI_strnlen(name, MAX_NAME) < 1) {
RNA_property_enum_name(C, &sens_ptr, prop, RNA_property_enum_get(&sens_ptr, prop), &sens_name);
BLI_strncpy(sens->name, sens_name, sizeof(sens->name));
}
@@ -313,20 +313,20 @@ static void LOGIC_OT_sensor_add(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Add Sensor";
+ ot->name = "Add Sensor";
ot->description = "Add a sensor to the active object";
- ot->idname= "LOGIC_OT_sensor_add";
+ ot->idname = "LOGIC_OT_sensor_add";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= sensor_add_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = sensor_add_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add");
+ ot->prop = prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add");
RNA_def_enum_funcs(prop, rna_Sensor_type_itemf);
RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Sensor to add");
RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Sensor to");
@@ -361,16 +361,16 @@ static int controller_remove_exec(bContext *C, wmOperator *op)
static void LOGIC_OT_controller_remove(wmOperatorType *ot)
{
- ot->name= "Remove Controller";
- ot->description= "Remove a controller from the active object";
- ot->idname= "LOGIC_OT_controller_remove";
+ ot->name = "Remove Controller";
+ ot->description = "Remove a controller from the active object";
+ ot->idname = "LOGIC_OT_controller_remove";
- ot->invoke= controller_remove_invoke;
- ot->exec= controller_remove_exec;
- ot->poll= edit_controller_poll;
+ ot->invoke = controller_remove_invoke;
+ ot->exec = controller_remove_exec;
+ ot->poll = edit_controller_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_controller_properties(ot);
}
@@ -386,7 +386,7 @@ static int controller_add_exec(bContext *C, wmOperator *op)
int type= RNA_enum_get(op->ptr, "type");
ob= edit_object_property_get(C, op);
- if(!ob)
+ if (!ob)
return OPERATOR_CANCELLED;
cont= new_controller(type);
@@ -397,7 +397,7 @@ static int controller_add_exec(bContext *C, wmOperator *op)
prop = RNA_struct_find_property(&cont_ptr, "type");
RNA_string_get(op->ptr, "name", name);
- if(BLI_strnlen(name, MAX_NAME) < 1){
+ if (BLI_strnlen(name, MAX_NAME) < 1) {
RNA_property_enum_name(C, &cont_ptr, prop, RNA_property_enum_get(&cont_ptr, prop), &cont_name);
BLI_strncpy(cont->name, cont_name, sizeof(cont->name));
}
@@ -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;
@@ -428,20 +428,20 @@ static int controller_add_exec(bContext *C, wmOperator *op)
static void LOGIC_OT_controller_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Controller";
+ ot->name = "Add Controller";
ot->description = "Add a controller to the active object";
- ot->idname= "LOGIC_OT_controller_add";
+ ot->idname = "LOGIC_OT_controller_add";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= controller_add_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = controller_add_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
+ ot->prop = RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Controller to add");
RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Controller to");
}
@@ -475,16 +475,16 @@ static int actuator_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(e
static void LOGIC_OT_actuator_remove(wmOperatorType *ot)
{
- ot->name= "Remove Actuator";
- ot->description= "Remove an actuator from the active object";
- ot->idname= "LOGIC_OT_actuator_remove";
+ ot->name = "Remove Actuator";
+ ot->description = "Remove an actuator from the active object";
+ ot->idname = "LOGIC_OT_actuator_remove";
- ot->invoke= actuator_remove_invoke;
- ot->exec= actuator_remove_exec;
- ot->poll= edit_actuator_poll;
+ ot->invoke = actuator_remove_invoke;
+ ot->exec = actuator_remove_exec;
+ ot->poll = edit_actuator_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
edit_actuator_properties(ot);
}
@@ -499,7 +499,7 @@ static int actuator_add_exec(bContext *C, wmOperator *op)
int type= RNA_enum_get(op->ptr, "type");
ob= edit_object_property_get(C, op);
- if(!ob)
+ if (!ob)
return OPERATOR_CANCELLED;
act= new_actuator(type);
@@ -510,7 +510,7 @@ static int actuator_add_exec(bContext *C, wmOperator *op)
prop = RNA_struct_find_property(&act_ptr, "type");
RNA_string_get(op->ptr, "name", name);
- if (BLI_strnlen(name, MAX_NAME) < 1){
+ if (BLI_strnlen(name, MAX_NAME) < 1) {
RNA_property_enum_name(C, &act_ptr, prop, RNA_property_enum_get(&act_ptr, prop), &act_name);
BLI_strncpy(act->name, act_name, sizeof(act->name));
}
@@ -530,20 +530,20 @@ static void LOGIC_OT_actuator_add(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Add Actuator";
+ ot->name = "Add Actuator";
ot->description = "Add an actuator to the active object";
- ot->idname= "LOGIC_OT_actuator_add";
+ ot->idname = "LOGIC_OT_actuator_add";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= actuator_add_exec;
- ot->poll= ED_operator_object_active_editable;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = actuator_add_exec;
+ ot->poll = ED_operator_object_active_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add");
+ ot->prop = prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add");
RNA_def_enum_funcs(prop, rna_Actuator_type_itemf);
RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Actuator to add");
RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Actuator to");
@@ -584,17 +584,17 @@ static int sensor_move_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event
static void LOGIC_OT_sensor_move(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move Sensor";
+ ot->name = "Move Sensor";
ot->description = "Move Sensor";
- ot->idname= "LOGIC_OT_sensor_move";
+ ot->idname = "LOGIC_OT_sensor_move";
/* api callbacks */
- ot->invoke= sensor_move_invoke;
- ot->exec= sensor_move_exec;
- ot->poll= edit_sensor_poll;
+ ot->invoke = sensor_move_invoke;
+ ot->exec = sensor_move_exec;
+ ot->poll = edit_sensor_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
edit_sensor_properties(ot);
@@ -629,17 +629,17 @@ static int controller_move_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(e
static void LOGIC_OT_controller_move(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move Controller";
+ ot->name = "Move Controller";
ot->description = "Move Controller";
- ot->idname= "LOGIC_OT_controller_move";
+ ot->idname = "LOGIC_OT_controller_move";
/* api callbacks */
- ot->invoke= controller_move_invoke;
- ot->exec= controller_move_exec;
- ot->poll= edit_controller_poll;
+ ot->invoke = controller_move_invoke;
+ ot->exec = controller_move_exec;
+ ot->poll = edit_controller_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
edit_controller_properties(ot);
@@ -674,17 +674,17 @@ static int actuator_move_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
static void LOGIC_OT_actuator_move(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move Actuator";
+ ot->name = "Move Actuator";
ot->description = "Move Actuator";
- ot->idname= "LOGIC_OT_actuator_move";
+ ot->idname = "LOGIC_OT_actuator_move";
/* api callbacks */
- ot->invoke= actuator_move_invoke;
- ot->exec= actuator_move_exec;
- ot->poll= edit_actuator_poll;
+ ot->invoke = actuator_move_invoke;
+ ot->exec = actuator_move_exec;
+ ot->poll = edit_actuator_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
edit_actuator_properties(ot);
@@ -708,17 +708,17 @@ static int texface_convert_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(e
static void LOGIC_OT_texface_convert(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "TexFace to Material Converter";
+ ot->name = "TexFace to Material Converter";
ot->description = "Convert old texface settings into material. It may create new materials if needed";
- ot->idname= "LOGIC_OT_texface_convert";
+ ot->idname = "LOGIC_OT_texface_convert";
/* api callbacks */
- ot->invoke= texface_convert_invoke;
- ot->exec= texface_convert_exec;
-// ot->poll= texface_convert_poll;
+ ot->invoke = texface_convert_invoke;
+ ot->exec = texface_convert_exec;
+// ot->poll = texface_convert_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 878543e6a36..37b284a030d 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -124,23 +124,23 @@ 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);
/* for each object, make properties and sca names unique */
/* count total names */
- for(a=0; a<obcount; a++) {
+ for (a=0; a<obcount; a++) {
ob= (Object *)idar[a];
propcount+= BLI_countlist(&ob->prop);
propcount+= BLI_countlist(&ob->sensors);
propcount+= BLI_countlist(&ob->controllers);
propcount+= BLI_countlist(&ob->actuators);
}
- if(propcount==0) {
- if(idar) MEM_freeN(idar);
+ if (propcount==0) {
+ if (idar) MEM_freeN(idar);
return;
}
@@ -149,25 +149,25 @@ void make_unique_prop_names(bContext *C, char *str)
/* count total names */
nr= 0;
- for(a=0; a<obcount; a++) {
+ for (a=0; a<obcount; a++) {
ob= (Object *)idar[a];
prop= ob->prop.first;
- while(prop) {
+ while (prop) {
names[nr++]= prop->name;
prop= prop->next;
}
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
names[nr++]= sens->name;
sens= sens->next;
}
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
names[nr++]= cont->name;
cont= cont->next;
}
act= ob->actuators.first;
- while(act) {
+ while (act) {
names[nr++]= act->name;
act= act->next;
}
@@ -177,8 +177,8 @@ void make_unique_prop_names(bContext *C, char *str)
/* now we check for double names, and change them */
- for(nr=0; nr<propcount; nr++) {
- if(names[nr]!=str && strcmp( names[nr], str )==0 ) {
+ for (nr=0; nr<propcount; nr++) {
+ if (names[nr]!=str && strcmp( names[nr], str )==0 ) {
BLI_newname(str, +1);
}
}
@@ -208,19 +208,19 @@ static void old_sca_move_sensor(bContext *C, void *datav, void *move_up)
// val= pupmenu("Move up%x1|Move down %x2");
val = move_up ? 1:2;
- if(val>0) {
+ if (val>0) {
/* now find out which object has this ... */
base= FIRSTBASE;
- while(base) {
+ while (base) {
sens= base->object->sensors.first;
- while(sens) {
- if(sens == sens_to_delete) break;
+ while (sens) {
+ if (sens == sens_to_delete) break;
sens= sens->next;
}
- if(sens) {
- if( val==1 && sens->prev) {
+ if (sens) {
+ if ( val==1 && sens->prev) {
for (tmp=sens->prev; tmp; tmp=tmp->prev) {
if (tmp->flag & SENS_VISIBLE)
break;
@@ -230,7 +230,7 @@ static void old_sca_move_sensor(bContext *C, void *datav, void *move_up)
BLI_insertlinkbefore(&base->object->sensors, tmp, sens);
}
}
- else if( val==2 && sens->next) {
+ else if ( val==2 && sens->next) {
for (tmp=sens->next; tmp; tmp=tmp->next) {
if (tmp->flag & SENS_VISIBLE)
break;
@@ -261,23 +261,23 @@ static void old_sca_move_controller(bContext *C, void *datav, void *move_up)
//val= pupmenu("Move up%x1|Move down %x2");
val = move_up ? 1:2;
- if(val>0) {
+ if (val>0) {
/* now find out which object has this ... */
base= FIRSTBASE;
- while(base) {
+ while (base) {
cont= base->object->controllers.first;
- while(cont) {
- if(cont == controller_to_del) break;
+ while (cont) {
+ if (cont == controller_to_del) break;
cont= cont->next;
}
- if(cont) {
- if( val==1 && cont->prev) {
+ if (cont) {
+ if ( val==1 && cont->prev) {
/* locate the controller that has the same state mask but is earlier in the list */
tmp = cont->prev;
- while(tmp) {
- if(tmp->state_mask & cont->state_mask)
+ while (tmp) {
+ if (tmp->state_mask & cont->state_mask)
break;
tmp = tmp->prev;
}
@@ -286,10 +286,10 @@ static void old_sca_move_controller(bContext *C, void *datav, void *move_up)
BLI_insertlinkbefore(&base->object->controllers, tmp, cont);
}
}
- else if( val==2 && cont->next) {
+ else if ( val==2 && cont->next) {
tmp = cont->next;
- while(tmp) {
- if(tmp->state_mask & cont->state_mask)
+ while (tmp) {
+ if (tmp->state_mask & cont->state_mask)
break;
tmp = tmp->next;
}
@@ -317,19 +317,19 @@ static void old_sca_move_actuator(bContext *C, void *datav, void *move_up)
//val= pupmenu("Move up%x1|Move down %x2");
val = move_up ? 1:2;
- if(val>0) {
+ if (val>0) {
/* now find out which object has this ... */
base= FIRSTBASE;
- while(base) {
+ while (base) {
act= base->object->actuators.first;
- while(act) {
- if(act == actuator_to_move) break;
+ while (act) {
+ if (act == actuator_to_move) break;
act= act->next;
}
- if(act) {
- if( val==1 && act->prev) {
+ if (act) {
+ if ( val==1 && act->prev) {
/* locate the first visible actuators before this one */
for (tmp = act->prev; tmp; tmp=tmp->prev) {
if (tmp->flag & ACT_VISIBLE)
@@ -340,7 +340,7 @@ static void old_sca_move_actuator(bContext *C, void *datav, void *move_up)
BLI_insertlinkbefore(&base->object->actuators, tmp, act);
}
}
- else if( val==2 && act->next) {
+ else if ( val==2 && act->next) {
for (tmp=act->next; tmp; tmp=tmp->next) {
if (tmp->flag & ACT_VISIBLE)
break;
@@ -369,7 +369,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
int didit, bit;
ob= CTX_data_active_object(C);
- if(ob==NULL) return;
+ if (ob==NULL) return;
switch(event) {
@@ -385,8 +385,8 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
break;
case B_ADD_SENS:
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
- if(ob->scaflag & OB_ADDSENS) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next) {
+ if (ob->scaflag & OB_ADDSENS) {
ob->scaflag &= ~OB_ADDSENS;
sens= new_sensor(SENS_ALWAYS);
BLI_addtail(&(ob->sensors), sens);
@@ -399,10 +399,10 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
break;
case B_CHANGE_SENS:
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next) {
sens= ob->sensors.first;
- while(sens) {
- if(sens->type != sens->otype) {
+ while (sens) {
+ if (sens->type != sens->otype) {
init_sensor(sens);
sens->otype= sens->type;
break;
@@ -413,10 +413,10 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
break;
case B_DEL_SENS:
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next) {
sens= ob->sensors.first;
- while(sens) {
- if(sens->flag & SENS_DEL) {
+ while (sens) {
+ if (sens->flag & SENS_DEL) {
BLI_remlink(&(ob->sensors), sens);
free_sensor(sens);
break;
@@ -428,16 +428,16 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
break;
case B_ADD_CONT:
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
- if(ob->scaflag & OB_ADDCONT) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next) {
+ if (ob->scaflag & OB_ADDCONT) {
ob->scaflag &= ~OB_ADDCONT;
cont= new_controller(CONT_LOGIC_AND);
make_unique_prop_names(C, cont->name);
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;
@@ -453,8 +453,8 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
break;
case B_SET_STATE_BIT:
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
- if(ob->scaflag & OB_ALLSTATE) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next) {
+ if (ob->scaflag & OB_ALLSTATE) {
ob->scaflag &= ~OB_ALLSTATE;
ob->state = 0x3FFFFFFF;
}
@@ -462,8 +462,8 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
break;
case B_INIT_STATE_BIT:
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
- if(ob->scaflag & OB_INITSTBIT) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next) {
+ if (ob->scaflag & OB_INITSTBIT) {
ob->scaflag &= ~OB_INITSTBIT;
ob->state = ob->init_state;
if (!ob->state)
@@ -473,10 +473,10 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
break;
case B_CHANGE_CONT:
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next) {
cont= ob->controllers.first;
- while(cont) {
- if(cont->type != cont->otype) {
+ while (cont) {
+ if (cont->type != cont->otype) {
init_controller(cont);
cont->otype= cont->type;
break;
@@ -488,10 +488,10 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
case B_DEL_CONT:
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next) {
cont= ob->controllers.first;
- while(cont) {
- if(cont->flag & CONT_DEL) {
+ while (cont) {
+ if (cont->flag & CONT_DEL) {
BLI_remlink(&(ob->controllers), cont);
unlink_controller(cont);
free_controller(cont);
@@ -504,8 +504,8 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
break;
case B_ADD_ACT:
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
- if(ob->scaflag & OB_ADDACT) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next) {
+ if (ob->scaflag & OB_ADDACT) {
ob->scaflag &= ~OB_ADDACT;
act= new_actuator(ACT_OBJECT);
make_unique_prop_names(C, act->name);
@@ -517,10 +517,10 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
break;
case B_CHANGE_ACT:
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next) {
act= ob->actuators.first;
- while(act) {
- if(act->type != act->otype) {
+ while (act) {
+ if (act->type != act->otype) {
init_actuator(act);
act->otype= act->type;
break;
@@ -531,10 +531,10 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
break;
case B_DEL_ACT:
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next) {
act= ob->actuators.first;
- while(act) {
- if(act->flag & ACT_DEL) {
+ while (act) {
+ if (act->flag & ACT_DEL) {
BLI_remlink(&(ob->actuators), act);
unlink_actuator(act);
free_actuator(act);
@@ -549,38 +549,38 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
case B_SOUNDACT_BROWSE:
/* since we don't know which... */
didit= 0;
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
+ for (ob=bmain->object.first; ob; ob=ob->id.next) {
act= ob->actuators.first;
- while(act)
+ while (act)
{
- if(act->type==ACT_SOUND)
+ if (act->type==ACT_SOUND)
{
bSoundActuator *sa= act->data;
- if(sa->sndnr)
+ if (sa->sndnr)
{
ID *sound= bmain->sound.first;
int nr= 1;
- if(sa->sndnr == -2) {
+ if (sa->sndnr == -2) {
// XXX activate_databrowse((ID *)bmain->sound.first, ID_SO, 0, B_SOUNDACT_BROWSE,
// &sa->sndnr, do_logic_buts);
break;
}
- while(sound)
+ while (sound)
{
- if(nr==sa->sndnr)
+ if (nr==sa->sndnr)
break;
nr++;
sound= sound->next;
}
- if(sa->sound)
+ if (sa->sound)
((ID *)sa->sound)->us--;
sa->sound= (struct bSound *)sound;
- if(sound)
+ if (sound)
sound->us++;
sa->sndnr= 0;
@@ -589,7 +589,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
}
act= act->next;
}
- if(didit)
+ if (didit)
break;
}
@@ -759,12 +759,12 @@ static void set_sca_ob(Object *ob)
bActuator *act;
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
cont->mynew= (bController *)ob;
cont= cont->next;
}
act= ob->actuators.first;
- while(act) {
+ while (act) {
act->mynew= (bActuator *)ob;
act= act->next;
}
@@ -788,10 +788,10 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
*count= 0;
- if(scene==NULL) return NULL;
+ if (scene==NULL) return NULL;
ob= bmain->object.first;
- while(ob) {
+ while (ob) {
ob->scavisflag= 0;
set_sca_ob(ob);
ob= ob->id.next;
@@ -801,78 +801,78 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
lay= scene->lay;
base= FIRSTBASE;
- while(base) {
- if(base->lay & lay) {
- if(base->flag & SELECT) {
- if(scavisflag & BUTS_SENS_SEL) base->object->scavisflag |= OB_VIS_SENS;
- if(scavisflag & BUTS_CONT_SEL) base->object->scavisflag |= OB_VIS_CONT;
- if(scavisflag & BUTS_ACT_SEL) base->object->scavisflag |= OB_VIS_ACT;
+ while (base) {
+ if (base->lay & lay) {
+ if (base->flag & SELECT) {
+ if (scavisflag & BUTS_SENS_SEL) base->object->scavisflag |= OB_VIS_SENS;
+ if (scavisflag & BUTS_CONT_SEL) base->object->scavisflag |= OB_VIS_CONT;
+ if (scavisflag & BUTS_ACT_SEL) base->object->scavisflag |= OB_VIS_ACT;
}
}
base= base->next;
}
- if(obact) {
- if(scavisflag & BUTS_SENS_ACT) obact->scavisflag |= OB_VIS_SENS;
- if(scavisflag & BUTS_CONT_ACT) obact->scavisflag |= OB_VIS_CONT;
- if(scavisflag & BUTS_ACT_ACT) obact->scavisflag |= OB_VIS_ACT;
+ if (obact) {
+ if (scavisflag & BUTS_SENS_ACT) obact->scavisflag |= OB_VIS_SENS;
+ if (scavisflag & BUTS_CONT_ACT) obact->scavisflag |= OB_VIS_CONT;
+ if (scavisflag & BUTS_ACT_ACT) obact->scavisflag |= OB_VIS_ACT;
}
/* BUTS_XXX_STATE are similar to BUTS_XXX_LINK for selecting the object */
- if(scavisflag & (BUTS_SENS_LINK|BUTS_CONT_LINK|BUTS_ACT_LINK|BUTS_SENS_STATE|BUTS_ACT_STATE)) {
+ if (scavisflag & (BUTS_SENS_LINK|BUTS_CONT_LINK|BUTS_ACT_LINK|BUTS_SENS_STATE|BUTS_ACT_STATE)) {
doit= 1;
- while(doit) {
+ while (doit) {
doit= 0;
ob= bmain->object.first;
- while(ob) {
+ while (ob) {
/* 1st case: select sensor when controller selected */
- if((scavisflag & (BUTS_SENS_LINK|BUTS_SENS_STATE)) && (ob->scavisflag & OB_VIS_SENS)==0) {
+ if ((scavisflag & (BUTS_SENS_LINK|BUTS_SENS_STATE)) && (ob->scavisflag & OB_VIS_SENS)==0) {
sens= ob->sensors.first;
- while(sens) {
- for(a=0; a<sens->totlinks; a++) {
- if(sens->links[a]) {
+ while (sens) {
+ for (a=0; a<sens->totlinks; a++) {
+ if (sens->links[a]) {
obt= (Object *)sens->links[a]->mynew;
- if(obt && (obt->scavisflag & OB_VIS_CONT)) {
+ if (obt && (obt->scavisflag & OB_VIS_CONT)) {
doit= 1;
ob->scavisflag |= OB_VIS_SENS;
break;
}
}
}
- if(doit) break;
+ if (doit) break;
sens= sens->next;
}
}
/* 2nd case: select cont when act selected */
- if((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_CONT)==0) {
+ if ((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_CONT)==0) {
cont= ob->controllers.first;
- while(cont) {
- for(a=0; a<cont->totlinks; a++) {
- if(cont->links[a]) {
+ while (cont) {
+ for (a=0; a<cont->totlinks; a++) {
+ if (cont->links[a]) {
obt= (Object *)cont->links[a]->mynew;
- if(obt && (obt->scavisflag & OB_VIS_ACT)) {
+ if (obt && (obt->scavisflag & OB_VIS_ACT)) {
doit= 1;
ob->scavisflag |= OB_VIS_CONT;
break;
}
}
}
- if(doit) break;
+ if (doit) break;
cont= cont->next;
}
}
/* 3rd case: select controller when sensor selected */
- if((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_SENS)) {
+ if ((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_SENS)) {
sens= ob->sensors.first;
- while(sens) {
- for(a=0; a<sens->totlinks; a++) {
- if(sens->links[a]) {
+ while (sens) {
+ for (a=0; a<sens->totlinks; a++) {
+ if (sens->links[a]) {
obt= (Object *)sens->links[a]->mynew;
- if(obt && (obt->scavisflag & OB_VIS_CONT)==0) {
+ if (obt && (obt->scavisflag & OB_VIS_CONT)==0) {
doit= 1;
obt->scavisflag |= OB_VIS_CONT;
}
@@ -883,13 +883,13 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
}
/* 4th case: select actuator when controller selected */
- if( (scavisflag & (BUTS_ACT_LINK|BUTS_ACT_STATE)) && (ob->scavisflag & OB_VIS_CONT)) {
+ if ( (scavisflag & (BUTS_ACT_LINK|BUTS_ACT_STATE)) && (ob->scavisflag & OB_VIS_CONT)) {
cont= ob->controllers.first;
- while(cont) {
- for(a=0; a<cont->totlinks; a++) {
- if(cont->links[a]) {
+ while (cont) {
+ for (a=0; a<cont->totlinks; a++) {
+ if (cont->links[a]) {
obt= (Object *)cont->links[a]->mynew;
- if(obt && (obt->scavisflag & OB_VIS_ACT)==0) {
+ if (obt && (obt->scavisflag & OB_VIS_ACT)==0) {
doit= 1;
obt->scavisflag |= OB_VIS_ACT;
}
@@ -906,13 +906,13 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
/* now we count */
ob= bmain->object.first;
- while(ob) {
- if( ob->scavisflag ) (*count)++;
+ while (ob) {
+ if ( ob->scavisflag ) (*count)++;
ob= ob->id.next;
}
- if(*count==0) return NULL;
- if(*count>24) *count= 24; /* temporal */
+ if (*count==0) return NULL;
+ if (*count>24) *count= 24; /* temporal */
idar= MEM_callocN( (*count)*sizeof(void *), "idar");
@@ -925,12 +925,12 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
nr++;
}
- while(ob) {
- if( (ob->scavisflag) && (ob != obact)) {
+ while (ob) {
+ if ( (ob->scavisflag) && (ob != obact)) {
idar[nr]= (ID *)ob;
nr++;
}
- if(nr>=24) break;
+ if (nr>=24) break;
ob= ob->id.next;
}
@@ -975,8 +975,8 @@ static void verify_logicbutton_func(bContext *UNUSED(C), void *data1, void *data
{
bSensor *sens= (bSensor*)data1;
- if(sens->level && sens->tap) {
- if(data2 == &(sens->level))
+ if (sens->level && sens->tap) {
+ if (data2 == &(sens->level))
sens->tap= 0;
else
sens->level= 0;
@@ -991,7 +991,7 @@ static void test_scriptpoin_but(struct bContext *C, const char *name, ID **idpp)
static void test_actionpoin_but(struct bContext *C, const char *name, ID **idpp)
{
*idpp= BLI_findstring(&CTX_data_main(C)->action, name, offsetof(ID, name) + 2);
- if(*idpp)
+ if (*idpp)
id_us_plus(*idpp);
}
@@ -999,28 +999,28 @@ static void test_actionpoin_but(struct bContext *C, const char *name, ID **idpp)
static void test_obpoin_but(struct bContext *C, const char *name, ID **idpp)
{
*idpp= BLI_findstring(&CTX_data_main(C)->object, name, offsetof(ID, name) + 2);
- if(*idpp)
+ if (*idpp)
id_lib_extern(*idpp); /* checks lib data, sets correct flag for saving then */
}
static void test_meshpoin_but(struct bContext *C, const char *name, ID **idpp)
{
*idpp= BLI_findstring(&CTX_data_main(C)->mesh, name, offsetof(ID, name) + 2);
- if(*idpp)
+ if (*idpp)
id_us_plus(*idpp);
}
static void test_matpoin_but(struct bContext *C, const char *name, ID **idpp)
{
*idpp= BLI_findstring(&CTX_data_main(C)->mat, name, offsetof(ID, name) + 2);
- if(*idpp)
+ if (*idpp)
id_us_plus(*idpp);
}
static void test_scenepoin_but(struct bContext *C, const char *name, ID **idpp)
{
*idpp= BLI_findstring(&CTX_data_main(C)->scene, name, offsetof(ID, name) + 2);
- if(*idpp)
+ if (*idpp)
id_us_plus(*idpp);
}
@@ -1028,11 +1028,11 @@ static void test_keyboard_event(struct bContext *UNUSED(C), void *arg_ks, void *
{
bKeyboardSensor *ks= (bKeyboardSensor*)arg_ks;
- if(!ISKEYBOARD(ks->key))
+ if (!ISKEYBOARD(ks->key))
ks->key= 0;
- if(!ISKEYBOARD(ks->qual))
+ if (!ISKEYBOARD(ks->qual))
ks->qual= 0;
- if(!ISKEYBOARD(ks->qual2))
+ if (!ISKEYBOARD(ks->qual2))
ks->qual2= 0;
}
@@ -1067,12 +1067,12 @@ static void draw_default_sensor_header(bSensor *sens,
/* value or shift? */
uiBlockBeginAlign(block);
- but= uiDefButS(block, TOG, 1, "Level",
+ but = uiDefButS(block, TOG, 1, "Level",
(short)(x + 10 + 0.5 * (w-20)), (short)(y - 21), (short)(0.20 * (w-20)), 19,
&sens->level, 0.0, 0.0, 0, 0,
"Level detector, trigger controllers of new states (only applicable upon logic state transition)");
uiButSetFunc(but, verify_logicbutton_func, sens, &(sens->level));
- but= uiDefButS(block, TOG, 1, "Tap",
+ but = uiDefButS(block, TOG, 1, "Tap",
(short)(x + 10 + 0.702 * (w-20)), (short)(y - 21), (short)(0.12 * (w-20)), 19,
&sens->tap, 0.0, 0.0, 0, 0,
"Trigger controllers only for an instant, even while the sensor remains true");
@@ -1090,9 +1090,9 @@ static void get_armature_bone_constraint(Object *ob, const char *posechannel, co
/* check that bone exist in the active object */
if (ob->type == OB_ARMATURE && ob->pose) {
bPoseChannel *pchan= get_pose_channel(ob->pose, posechannel);
- if(pchan) {
+ if (pchan) {
bConstraint *con= BLI_findstring(&pchan->constraints, constraint_name, offsetof(bConstraint, name));
- if(con) {
+ if (con) {
*constraint= con;
}
}
@@ -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;
}
@@ -1218,7 +1218,8 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
uiDefBut(block, TEX, 1, "Material:", (short)(xco + 10 + 0.40 * (width-20)),
(short)(yco-44), (short)(0.6*(width-20)), 19, &cs->materialName, 0, MAX_NAME, 0, 0,
"Only look for Objects with this material");
- } else {
+ }
+ else {
uiDefBut(block, TEX, 1, "Property:", (short)(xco + 10 + 0.40 * (width-20)), (short)(yco-44),
(short)(0.6*(width-20)), 19, &cs->name, 0, MAX_NAME, 0, 0,
"Only look for Objects with this property");
@@ -1302,14 +1303,14 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
if ((ks->type&1)==0) { /* is All Keys option off? */
/* line 2: hotkey and allkeys toggle */
- but= uiDefKeyevtButS(block, 0, "", xco+40, yco-44, (width)/2, 19, &ks->key, "Key code");
+ but = uiDefKeyevtButS(block, 0, "", xco+40, yco-44, (width)/2, 19, &ks->key, "Key code");
uiButSetFunc(but, test_keyboard_event, ks, NULL);
/* line 3: two key modifyers (qual1, qual2) */
uiDefBut(block, LABEL, 0, "Hold", xco, yco-68, 40, 19, NULL, 0, 0, 0, 0, "");
- but= uiDefKeyevtButS(block, 0, "", xco+40, yco-68, (width-50)/2, 19, &ks->qual, "Modifier key code");
+ but = uiDefKeyevtButS(block, 0, "", xco+40, yco-68, (width-50)/2, 19, &ks->qual, "Modifier key code");
uiButSetFunc(but, test_keyboard_event, ks, NULL);
- but= uiDefKeyevtButS(block, 0, "", xco+40+(width-50)/2, yco-68, (width-50)/2, 19, &ks->qual2, "Second Modifier key code");
+ but = uiDefKeyevtButS(block, 0, "", xco+40+(width-50)/2, yco-68, (width-50)/2, 19, &ks->qual2, "Second Modifier key code");
uiButSetFunc(but, test_keyboard_event, ks, NULL);
}
@@ -1352,18 +1353,19 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
ps->name, 0, MAX_NAME, 0, 0, "Property name");
}
- if(ps->type == SENS_PROP_INTERVAL)
+ if (ps->type == SENS_PROP_INTERVAL)
{
uiDefBut(block, TEX, 1, "Min: ", xco,yco-92,width/2, 19,
ps->value, 0, MAX_NAME, 0, 0, "check for min value");
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,16 +1460,17 @@ 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,
&ms->type, 0, 31, 0, 0,
"Specify the type of event this mouse sensor should trigger on");
- if(ms->type==32) {
+ if (ms->type==32) {
uiDefButBitS(block, TOG, SENS_MOUSE_FOCUS_PULSE, B_REDR, "Pulse",(short)(xco + 10) + (width*0.8f)-20,(short)(yco - 44),
(short)(0.20 * (width-20)), 19, &ms->flag, 0.0, 0.0, 0, 0,
"Moving the mouse over a different object generates a pulse");
@@ -1510,14 +1513,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");
@@ -1599,7 +1600,8 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
str = "All Hat Events";
break;
}
- } else {
+ }
+ else {
str = "All";
}
@@ -1608,7 +1610,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
&joy->flag, 0, 0, 0, 0,
"Triggered by all events on this joysticks current type (axis/button/hat)");
}
- if(joy->type == SENS_JOY_BUTTON)
+ if (joy->type == SENS_JOY_BUTTON)
{
if ((joy->flag & SENS_JOY_ANY_EVENT)==0) {
uiDefButI(block, NUM, 1, "Number:", xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19,
@@ -1616,8 +1618,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 +1634,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");
@@ -1691,7 +1691,7 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco
case CONT_PYTHON:
ysize= 28;
- if(cont->data==NULL) init_controller(cont);
+ if (cont->data==NULL) init_controller(cont);
pc= cont->data;
UI_ThemeColor(TH_PANEL);
@@ -1701,7 +1701,7 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco
uiBlockBeginAlign(block);
uiDefButI(block, MENU, B_REDR, "Execution Method%t|Script%x0|Module%x1", xco+4,yco-23, 66, 19, &pc->mode, 0, 0, 0, 0, "Python script type (textblock or module - faster)");
- if(pc->mode==0)
+ if (pc->mode==0)
uiDefIDPoinBut(block, test_scriptpoin_but, ID_TXT, 1, "", xco+70,yco-23,width-74, 19, &pc->text, "Blender textblock to run as a script");
else {
uiDefBut(block, TEX, 1, "", xco+70,yco-23,(width-70)-25, 19, pc->module, 0, sizeof(pc->module), 0, 0, "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used");
@@ -1877,12 +1877,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;
}
@@ -1949,7 +1947,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "use_additive",xco+45+3*wval+15, yco-129, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV");
}
- } else if (oa->type == ACT_OBJECT_SERVO)
+ }
+ else if (oa->type == ACT_OBJECT_SERVO)
{
ysize= 195;
@@ -2030,12 +2029,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 +2044,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
@@ -2091,7 +2087,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
"Let the ipo acts in local coordinates, used in Force and Add mode");
}
- if(ia->type==ACT_IPO_FROM_PROP) {
+ if (ia->type==ACT_IPO_FROM_PROP) {
uiDefBut(block, TEX, 0,
"Prop: ", xco+10, yco-44, width-80, 19,
ia->name, 0.0, MAX_NAME, 0, 0,
@@ -2134,11 +2130,11 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-44,width-60, 19, pa->name, 0, MAX_NAME, 0, 0, "Property name");
- if(pa->type==ACT_PROP_TOGGLE) {
+ if (pa->type==ACT_PROP_TOGGLE) {
/* no ui */
ysize -= 22;
}
- else if(pa->type==ACT_PROP_COPY) {
+ else if (pa->type==ACT_PROP_COPY) {
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-64, (width-20)/2, 19, &(pa->ob), "Copy from this Object");
uiDefBut(block, TEX, 1, "Prop: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, pa->value, 0, MAX_NAME, 0, 0, "Copy this property");
}
@@ -2154,7 +2150,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
sa = act->data;
sa->sndnr = 0;
- if(sa->flag & ACT_SND_3D_SOUND)
+ if (sa->flag & ACT_SND_3D_SOUND)
ysize = 180;
else
ysize = 92;
@@ -2163,7 +2159,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- if(bmain->sound.first) {
+ if (bmain->sound.first) {
IDnames_to_pupstring(&str, "Sound files", NULL, &(bmain->sound), (ID *)sa->sound, &(sa->sndnr));
/* reset this value, it is for handling the event */
sa->sndnr = 0;
@@ -2171,7 +2167,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+wval+10, yco-22, wval, 19,
"Load a sound file (remember to set caching on for small sounds that are played often)");
- if(sa->sound) {
+ if (sa->sound) {
char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|"
"Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4";
uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,wval-20,19,
@@ -2184,8 +2180,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");
@@ -2237,7 +2232,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefButF(block, NUM, 0, "Min:", xco+10, yco-44, (width-60)/2, 19, &ca->min, 0.0, 20.0, 0, 0, "");
- if(ca->axis==0) ca->axis= 'x';
+ if (ca->axis==0) ca->axis= 'x';
uiDefButS(block, ROW, 0, "X", xco+10+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'x', 0, 0, "Camera tries to get behind the X axis");
uiDefButS(block, ROW, 0, "Y", xco+30+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'y', 0, 0, "Camera tries to get behind the Y axis");
@@ -2251,7 +2246,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
eoa= act->data;
- if(eoa->type==ACT_EDOB_ADD_OBJECT) {
+ if (eoa->type==ACT_EDOB_ADD_OBJECT) {
ysize = 92;
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
@@ -2295,12 +2290,12 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
}
- else if(eoa->type==ACT_EDOB_END_OBJECT) {
+ else if (eoa->type==ACT_EDOB_END_OBJECT) {
ysize= 28;
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
}
- else if(eoa->type==ACT_EDOB_REPLACE_MESH) {
+ else if (eoa->type==ACT_EDOB_REPLACE_MESH) {
ysize= 48;
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
@@ -2310,7 +2305,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefButBitS(block, TOGN, ACT_EDOB_REPLACE_MESH_NOGFX, 0, "Gfx", xco+40 + (width-80)/2, yco-44, (width-80)/4, 19, &eoa->flag, 0, 0, 0, 0, "Replace the display mesh");
uiDefButBitS(block, TOG, ACT_EDOB_REPLACE_MESH_PHYS, 0, "Phys", xco+40 + (width-80)/2 +(width-80)/4, yco-44, (width-80)/4, 19, &eoa->flag, 0, 0, 0, 0, "Replace the physics mesh (triangle bounds only. compound shapes not supported)");
}
- else if(eoa->type==ACT_EDOB_TRACK_TO) {
+ else if (eoa->type==ACT_EDOB_TRACK_TO) {
ysize= 48;
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
@@ -2319,14 +2314,14 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefButI(block, NUM, 0, "Time:", xco+10+(width-20)/2, yco-44, (width-20)/2-40, 19, &eoa->time, 0.0, 2000.0, 0, 0, "Duration the tracking takes");
uiDefButS(block, TOG, 0, "3D", xco+width-50, yco-44, 40, 19, &eoa->flag, 0.0, 0.0, 0, 0, "Enable 3D tracking");
}
- else if(eoa->type==ACT_EDOB_DYNAMICS) {
+ else if (eoa->type==ACT_EDOB_DYNAMICS) {
ysize= 69;
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
str= "Dynamic Operation %t|Restore Dynamics %x0|Suspend Dynamics %x1|Enable Rigid Body %x2|Disable Rigid Body %x3|Set Mass %x4";
uiDefButS(block, MENU, B_REDR, str, xco+40, yco-44, (width-80), 19, &(eoa->dyn_operation), 0.0, 0.0, 0, 0, "");
- if(eoa->dyn_operation==4) {
+ if (eoa->dyn_operation==4) {
uiDefButF(block, NUM, 0, "", xco+40, yco-63, width-80, 19,
&eoa->mass, 0.0, 10000.0, 10, 0,
"Mass for object");
@@ -2359,16 +2354,17 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefBut(block, LABEL, 0, "Min", xco+80, yco-45, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, "");
uiDefBut(block, LABEL, 0, "Max", xco+80+(width-90)/2, yco-45, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, "");
- if(coa->flag & ACT_CONST_LOCX) fp= coa->minloc;
- else if(coa->flag & ACT_CONST_LOCY) fp= coa->minloc+1;
- else if(coa->flag & ACT_CONST_LOCZ) fp= coa->minloc+2;
- else if(coa->flag & ACT_CONST_ROTX) fp= coa->minrot;
- else if(coa->flag & ACT_CONST_ROTY) fp= coa->minrot+1;
+ if (coa->flag & ACT_CONST_LOCX) fp= coa->minloc;
+ else if (coa->flag & ACT_CONST_LOCY) fp= coa->minloc+1;
+ else if (coa->flag & ACT_CONST_LOCZ) fp= coa->minloc+2;
+ else if (coa->flag & ACT_CONST_ROTX) fp= coa->minrot;
+ else if (coa->flag & ACT_CONST_ROTY) fp= coa->minrot+1;
else fp= coa->minrot+2;
uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-90)/2, 19, fp, -2000.0, 2000.0, 10, 0, "");
uiDefButF(block, NUM, 0, "", xco+80+(width-90)/2, yco-65, (width-90)/2, 19, fp+3, -2000.0, 2000.0, 10, 0, "");
- } else if (coa->type == ACT_CONST_TYPE_DIST) {
+ }
+ else if (coa->type == ACT_CONST_TYPE_DIST) {
ysize= 106;
glRects(xco, yco-ysize, xco+width, yco);
@@ -2383,8 +2379,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefButBitS(block, TOG, ACT_CONST_LOCAL, 0, "L", xco+80+(width-115), yco-45, 25, 19,
&coa->flag, 0.0, 0.0, 0, 0, "Set ray along object's axis or global axis");
- if(coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= coa->minloc;
- else if(coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= coa->minloc+1;
+ if (coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= coa->minloc;
+ else if (coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= coa->minloc+1;
else fp= coa->minloc+2;
uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-115)/2, 19, fp+3, 0.0, 2000.0, 10, 0, "Maximum length of ray");
@@ -2394,14 +2390,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");
@@ -2410,7 +2404,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
&coa->flag, 0.0, 0.0, 0, 0, "Persistent actuator: stays active even if ray does not reach target");
uiDefButS(block, NUM, 0, "time", xco+50, yco-103, (width-60)/2, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited");
uiDefButS(block, NUM, 0, "rotDamp", xco+50+(width-60)/2, yco-103, (width-60)/2, 19, &(coa->rotdamp), 0.0, 100.0, 0, 0, "Use a different damping for orientation");
- } else if (coa->type == ACT_CONST_TYPE_ORI) {
+ }
+ else if (coa->type == ACT_CONST_TYPE_ORI) {
ysize= 87;
glRects(xco, yco-ysize, xco+width, yco);
@@ -2431,7 +2426,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefButS(block, NUM, 0, "time", xco+10, yco-84, 70, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited");
uiDefButF(block, NUM, 0, "min", xco+80, yco-84, (width-115)/2, 19, &(coa->minloc[0]), 0.0, 180.0, 10, 1, "Minimum angle (in degree) to maintain with target direction. No correction is done if angle with target direction is between min and max");
uiDefButF(block, NUM, 0, "max", xco+80+(width-115)/2, yco-84, (width-115)/2, 19, &(coa->maxloc[0]), 0.0, 180.0, 10, 1, "Maximum angle (in degree) allowed with target direction. No correction is done if angle with target direction is between min and max");
- } else if (coa->type == ACT_CONST_TYPE_FH) {
+ }
+ else if (coa->type == ACT_CONST_TYPE_FH) {
ysize= 106;
glRects(xco, yco-ysize, xco+width, yco);
@@ -2440,8 +2436,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
str= "Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4|-X axis %x8|-Y axis %x16|-Z axis %x32";
uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, &coa->mode, 0.0, 0.0, 0, 0, "Set the direction of the ray (in world coordinate)");
- if(coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= coa->minloc;
- else if(coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= coa->minloc+1;
+ if (coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= coa->minloc;
+ else if (coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= coa->minloc+1;
else fp= coa->minloc+2;
uiDefButF(block, NUM, 0, "damp", xco+10, yco-45, (width-70)/2, 19, &coa->maxrot[0], 0.0, 1.0, 1, 0, "Damping factor of the Fh spring force");
@@ -2453,14 +2449,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");
@@ -2478,12 +2472,12 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
case ACT_SCENE:
sca= act->data;
- if(sca->type==ACT_SCENE_RESTART) {
+ if (sca->type==ACT_SCENE_RESTART) {
ysize= 28;
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
}
- else if(sca->type==ACT_SCENE_CAMERA) {
+ else if (sca->type==ACT_SCENE_CAMERA) {
ysize= 48;
glRects(xco, yco-ysize, xco+width, yco);
@@ -2491,7 +2485,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+40, yco-44, (width-80), 19, &(sca->camera), "Set this Camera. Leave empty to refer to self object");
}
- else if(sca->type==ACT_SCENE_SET) {
+ else if (sca->type==ACT_SCENE_SET) {
ysize= 48;
glRects(xco, yco-ysize, xco+width, yco);
@@ -2499,7 +2493,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Set this Scene");
}
- else if(sca->type==ACT_SCENE_ADD_FRONT) {
+ else if (sca->type==ACT_SCENE_ADD_FRONT) {
ysize= 48;
glRects(xco, yco-ysize, xco+width, yco);
@@ -2507,7 +2501,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Add an Overlay Scene");
}
- else if(sca->type==ACT_SCENE_ADD_BACK) {
+ else if (sca->type==ACT_SCENE_ADD_BACK) {
ysize= 48;
glRects(xco, yco-ysize, xco+width, yco);
@@ -2515,7 +2509,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Add a Background Scene");
}
- else if(sca->type==ACT_SCENE_REMOVE) {
+ else if (sca->type==ACT_SCENE_REMOVE) {
ysize= 48;
glRects(xco, yco-ysize, xco+width, yco);
@@ -2523,7 +2517,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Remove a Scene");
}
- else if(sca->type==ACT_SCENE_SUSPEND) {
+ else if (sca->type==ACT_SCENE_SUSPEND) {
ysize= 48;
glRects(xco, yco-ysize, xco+width, yco);
@@ -2531,7 +2525,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Pause a Scene");
}
- else if(sca->type==ACT_SCENE_RESUME) {
+ else if (sca->type==ACT_SCENE_RESUME) {
ysize= 48;
glRects(xco, yco-ysize, xco+width, yco);
@@ -2547,9 +2541,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 +2550,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 +2559,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);
@@ -2591,11 +2584,11 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
str= "GroupKey types %t|Set Key %x6|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x5";
uiDefButS(block, MENU, 1, str, xco+20, yco-24, width-40, 19, &ga->type, 0, 0, 0, 0, "");
- if(ga->type==ACT_GROUP_SET) {
+ if (ga->type==ACT_GROUP_SET) {
uiDefBut(block, TEX, 0, "Key: ", xco+20, yco-44, (width-10)/2, 19, ga->name, 0.0, MAX_NAME, 0, 0, "This name defines groupkey to be set");
uiDefButI(block, NUM, 0, "Frame:", xco+20+(width-10)/2, yco-44, (width-70)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Set this frame");
}
- else if(ga->type==ACT_GROUP_FROM_PROP) {
+ else if (ga->type==ACT_GROUP_FROM_PROP) {
uiDefBut(block, TEX, 0, "Prop: ", xco+20, yco-44, width-40, 19, ga->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Group position");
}
else {
@@ -2804,15 +2797,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 +2818,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 +2827,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;
@@ -2877,7 +2866,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
case ACT_PARENT:
parAct = act->data;
- if(parAct->type==ACT_PARENT_SET) {
+ if (parAct->type==ACT_PARENT_SET) {
ysize= 48;
glRects(xco, yco-ysize, xco+width, yco);
@@ -2896,7 +2885,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
"Make this object ghost while parented (only if not compound)");
uiBlockEndAlign(block);
}
- else if(parAct->type==ACT_PARENT_REMOVE) {
+ else if (parAct->type==ACT_PARENT_REMOVE) {
ysize= 28;
glRects(xco, yco-ysize, xco+width, yco);
@@ -2975,23 +2964,23 @@ static void do_sensor_menu(bContext *C, void *UNUSED(arg), int event)
idar= get_selected_and_linked_obs(C, &count, slogic->scaflag);
- for(a=0; a<count; a++) {
+ for (a=0; a<count; a++) {
ob= (Object *)idar[a];
- if(event==0 || event==2) ob->scaflag |= OB_SHOWSENS;
- else if(event==1) ob->scaflag &= ~OB_SHOWSENS;
+ if (event==0 || event==2) ob->scaflag |= OB_SHOWSENS;
+ else if (event==1) ob->scaflag &= ~OB_SHOWSENS;
}
- for(a=0; a<count; a++) {
+ for (a=0; a<count; a++) {
ob= (Object *)idar[a];
sens= ob->sensors.first;
- while(sens) {
- if(event==2) sens->flag |= SENS_SHOW;
- else if(event==3) sens->flag &= ~SENS_SHOW;
+ while (sens) {
+ if (event==2) sens->flag |= SENS_SHOW;
+ else if (event==3) sens->flag &= ~SENS_SHOW;
sens= sens->next;
}
}
- if(idar) MEM_freeN(idar);
+ if (idar) MEM_freeN(idar);
}
static uiBlock *sensor_menu(bContext *C, ARegion *ar, void *UNUSED(arg))
@@ -3024,23 +3013,23 @@ static void do_controller_menu(bContext *C, void *UNUSED(arg), int event)
idar= get_selected_and_linked_obs(C, &count, slogic->scaflag);
- for(a=0; a<count; a++) {
+ for (a=0; a<count; a++) {
ob= (Object *)idar[a];
- if(event==0 || event==2) ob->scaflag |= OB_SHOWCONT;
- else if(event==1) ob->scaflag &= ~OB_SHOWCONT;
+ if (event==0 || event==2) ob->scaflag |= OB_SHOWCONT;
+ else if (event==1) ob->scaflag &= ~OB_SHOWCONT;
}
- for(a=0; a<count; a++) {
+ for (a=0; a<count; a++) {
ob= (Object *)idar[a];
cont= ob->controllers.first;
- while(cont) {
- if(event==2) cont->flag |= CONT_SHOW;
- else if(event==3) cont->flag &= ~CONT_SHOW;
+ while (cont) {
+ if (event==2) cont->flag |= CONT_SHOW;
+ else if (event==3) cont->flag &= ~CONT_SHOW;
cont= cont->next;
}
}
- if(idar) MEM_freeN(idar);
+ if (idar) MEM_freeN(idar);
}
static uiBlock *controller_menu(bContext *C, ARegion *ar, void *UNUSED(arg))
@@ -3073,23 +3062,23 @@ static void do_actuator_menu(bContext *C, void *UNUSED(arg), int event)
idar= get_selected_and_linked_obs(C, &count, slogic->scaflag);
- for(a=0; a<count; a++) {
+ for (a=0; a<count; a++) {
ob= (Object *)idar[a];
- if(event==0 || event==2) ob->scaflag |= OB_SHOWACT;
- else if(event==1) ob->scaflag &= ~OB_SHOWACT;
+ if (event==0 || event==2) ob->scaflag |= OB_SHOWACT;
+ else if (event==1) ob->scaflag &= ~OB_SHOWACT;
}
- for(a=0; a<count; a++) {
+ for (a=0; a<count; a++) {
ob= (Object *)idar[a];
act= ob->actuators.first;
- while(act) {
- if(event==2) act->flag |= ACT_SHOW;
- else if(event==3) act->flag &= ~ACT_SHOW;
+ while (act) {
+ if (event==2) act->flag |= ACT_SHOW;
+ else if (event==3) act->flag &= ~ACT_SHOW;
act= act->next;
}
}
- if(idar) MEM_freeN(idar);
+ if (idar) MEM_freeN(idar);
}
static uiBlock *actuator_menu(bContext *C, ARegion *ar, void *UNUSED(arg))
@@ -3229,10 +3218,11 @@ static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *lo
row= uiLayoutRow(box, 0);
uiItemR(row, ptr, "show_expanded", UI_ITEM_R_NO_BG, "", ICON_NONE);
- if(RNA_boolean_get(ptr, "show_expanded")) {
+ if (RNA_boolean_get(ptr, "show_expanded")) {
uiItemR(row, ptr, "type", 0, "", ICON_NONE);
uiItemR(row, ptr, "name", 0, "", ICON_NONE);
- } else {
+ }
+ else {
uiItemL(row, sensor_name(sens->type), ICON_NONE);
uiItemL(row, sens->name, ICON_NONE);
}
@@ -3242,7 +3232,7 @@ static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *lo
&& RNA_boolean_get(ptr, "show_expanded")) || RNA_boolean_get(ptr, "pin")));
uiItemR(sub, ptr, "pin", UI_ITEM_R_NO_BG, "", ICON_NONE);
- if(RNA_boolean_get(ptr, "show_expanded")==0) {
+ if (RNA_boolean_get(ptr, "show_expanded")==0) {
sub= uiLayoutRow(row, 1);
uiItemEnumO(sub, "LOGIC_OT_sensor_move", "", ICON_TRIA_UP, "direction", 1); // up
uiItemEnumO(sub, "LOGIC_OT_sensor_move", "", ICON_TRIA_DOWN, "direction", 2); // down
@@ -3293,7 +3283,7 @@ static void draw_sensor_armature(uiLayout *layout, PointerRNA *ptr)
PropertyRNA *bones_prop= NULL;
uiLayout *row;
- if(ob->type != OB_ARMATURE){
+ if (ob->type != OB_ARMATURE) {
uiItemL(layout, "Sensor only available for armatures", ICON_NONE);
return;
}
@@ -3586,12 +3576,13 @@ static void draw_controller_header(uiLayout *layout, PointerRNA *ptr, int xco, i
row= uiLayoutRow(box, 0);
uiItemR(row, ptr, "show_expanded", UI_ITEM_R_NO_BG, "", ICON_NONE);
- if(RNA_boolean_get(ptr, "show_expanded")) {
+ if (RNA_boolean_get(ptr, "show_expanded")) {
uiItemR(row, ptr, "type", 0, "", ICON_NONE);
uiItemR(row, ptr, "name", 0, "", ICON_NONE);
/* XXX provisory for Blender 2.50Beta */
uiDefBlockBut(uiLayoutGetBlock(layout), controller_state_mask_menu, cont, state, (short)(xco+width-44), yco, 22+22, UI_UNIT_Y, "Set controller state index (from 1 to 30)");
- } else {
+ }
+ else {
uiItemL(row, controller_name(cont->type), ICON_NONE);
uiItemL(row, cont->name, ICON_NONE);
uiItemL(row, state, ICON_NONE);
@@ -3599,7 +3590,7 @@ static void draw_controller_header(uiLayout *layout, PointerRNA *ptr, int xco, i
uiItemR(row, ptr, "use_priority", 0, "", ICON_NONE);
- if(RNA_boolean_get(ptr, "show_expanded")==0) {
+ if (RNA_boolean_get(ptr, "show_expanded")==0) {
sub= uiLayoutRow(row, 1);
uiItemEnumO(sub, "LOGIC_OT_controller_move", "", ICON_TRIA_UP, "direction", 1); // up
uiItemEnumO(sub, "LOGIC_OT_controller_move", "", ICON_TRIA_DOWN, "direction", 2); // down
@@ -3676,10 +3667,11 @@ static void draw_actuator_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *
row= uiLayoutRow(box, 0);
uiItemR(row, ptr, "show_expanded", UI_ITEM_R_NO_BG, "", ICON_NONE);
- if(RNA_boolean_get(ptr, "show_expanded")) {
+ if (RNA_boolean_get(ptr, "show_expanded")) {
uiItemR(row, ptr, "type", 0, "", ICON_NONE);
uiItemR(row, ptr, "name", 0, "", ICON_NONE);
- } else {
+ }
+ else {
uiItemL(row, actuator_name(act->type), ICON_NONE);
uiItemL(row, act->name, ICON_NONE);
}
@@ -3689,7 +3681,7 @@ static void draw_actuator_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *
&& RNA_boolean_get(ptr, "show_expanded")) || RNA_boolean_get(ptr, "pin")));
uiItemR(sub, ptr, "pin", UI_ITEM_R_NO_BG, "", ICON_NONE);
- if(RNA_boolean_get(ptr, "show_expanded")==0) {
+ if (RNA_boolean_get(ptr, "show_expanded")==0) {
sub= uiLayoutRow(row, 1);
uiItemEnumO(sub, "LOGIC_OT_actuator_move", "", ICON_TRIA_UP, "direction", 1); // up
uiItemEnumO(sub, "LOGIC_OT_actuator_move", "", ICON_TRIA_DOWN, "direction", 2); // down
@@ -3721,7 +3713,7 @@ static void draw_actuator_action(uiLayout *layout, PointerRNA *ptr)
uiItemR(row, ptr, "use_continue_last_frame", 0, NULL, ICON_NONE);
row= uiLayoutRow(layout, 0);
- if((RNA_enum_get(ptr, "play_mode") == ACT_ACTION_FROM_PROP))
+ if ((RNA_enum_get(ptr, "play_mode") == ACT_ACTION_FROM_PROP))
uiItemPointerR(row, ptr, "property", &settings_ptr, "properties", NULL, ICON_NONE);
else {
@@ -3755,7 +3747,7 @@ static void draw_actuator_armature(uiLayout *layout, PointerRNA *ptr)
PointerRNA pose_ptr, pchan_ptr;
PropertyRNA *bones_prop = NULL;
- if(ob->type != OB_ARMATURE){
+ if (ob->type != OB_ARMATURE) {
uiItemL(layout, "Actuator only available for armatures", ICON_NONE);
return;
}
@@ -3806,6 +3798,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;
}
}
@@ -3952,7 +3954,7 @@ static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr)
case ACT_EDOB_END_OBJECT:
break;
case ACT_EDOB_REPLACE_MESH:
- if(ob->type != OB_MESH) {
+ if (ob->type != OB_MESH) {
uiItemL(layout, "Mode only available for mesh objects", ICON_NONE);
break;
}
@@ -3970,7 +3972,7 @@ static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr)
uiItemR(sub, ptr, "use_3d_tracking", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
break;
case ACT_EDOB_DYNAMICS:
- if(ob->type != OB_MESH) {
+ if (ob->type != OB_MESH) {
uiItemL(layout, "Mode only available for mesh objects", ICON_NONE);
break;
}
@@ -4029,7 +4031,7 @@ static void draw_actuator_message(uiLayout *layout, PointerRNA *ptr, bContext *C
row= uiLayoutRow(layout, 1);
uiItemR(row, ptr, "body_type", 0, NULL, ICON_NONE);
- if(RNA_enum_get(ptr, "body_type") == ACT_MESG_MESG)
+ if (RNA_enum_get(ptr, "body_type") == ACT_MESG_MESG)
uiItemR(row, ptr, "body_message", 0, "", ICON_NONE);
else // mode == ACT_MESG_PROP
uiItemPointerR(row, ptr, "body_property", &settings_ptr, "properties", "", ICON_NONE);
@@ -4174,11 +4176,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);
@@ -4206,7 +4208,7 @@ static void draw_actuator_random(uiLayout *layout, PointerRNA *ptr)
row = uiLayoutRow(layout, 0);
- switch (RNA_enum_get(ptr, "distribution")){
+ switch (RNA_enum_get(ptr, "distribution")) {
case ACT_RANDOM_BOOL_CONST:
uiItemR(row, ptr, "use_always_true", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
break;
@@ -4274,7 +4276,7 @@ static void draw_actuator_shape_action(uiLayout *layout, PointerRNA *ptr)
PointerRNA settings_ptr;
uiLayout *row;
- if(ob->type != OB_MESH){
+ if (ob->type != OB_MESH) {
uiItemL(layout, "Actuator only available for mesh objects", ICON_NONE);
return;
}
@@ -4287,7 +4289,7 @@ static void draw_actuator_shape_action(uiLayout *layout, PointerRNA *ptr)
uiItemR(row, ptr, "use_continue_last_frame", 0, NULL, ICON_NONE);
row= uiLayoutRow(layout, 0);
- if((RNA_enum_get(ptr, "mode") == ACT_ACTION_FROM_PROP))
+ if ((RNA_enum_get(ptr, "mode") == ACT_ACTION_FROM_PROP))
uiItemPointerR(row, ptr, "property", &settings_ptr, "properties", NULL, ICON_NONE);
else {
@@ -4312,8 +4314,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 +4390,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);
}
@@ -4492,7 +4490,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
short a, count;
int xco, yco, width;
- if(ob==NULL) return;
+ if (ob==NULL) return;
RNA_pointer_create(NULL, &RNA_SpaceLogicEditor, slogic, &logic_ptr);
idar= get_selected_and_linked_obs(C, &count, slogic->scaflag);
@@ -4502,7 +4500,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
uiBlockSetHandleFunc(block, do_logic_buts, NULL);
/* loop over all objects and set visible/linked flags for the logic bricks */
- for(a=0; a<count; a++) {
+ for (a=0; a<count; a++) {
bActuator *act;
bSensor *sens;
bController *cont;
@@ -4513,20 +4511,20 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
/* clean ACT_LINKED and ACT_VISIBLE of all potentially visible actuators so that we can determine which is actually linked/visible */
act = ob->actuators.first;
- while(act) {
+ while (act) {
act->flag &= ~(ACT_LINKED|ACT_VISIBLE);
act = act->next;
}
/* same for sensors */
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
sens->flag &= ~(SENS_VISIBLE);
sens = sens->next;
}
/* mark the linked and visible actuators */
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
flag = ACT_LINKED;
/* this controller is visible, mark all its actuator */
@@ -4554,7 +4552,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
uiItemR(row, &logic_ptr, "show_controllers_active_object", 0, "Act", ICON_NONE);
uiItemR(row, &logic_ptr, "show_controllers_linked_controller", 0, "Link", ICON_NONE);
- for(a=0; a<count; a++) {
+ for (a=0; a<count; a++) {
bController *cont;
PointerRNA ptr;
uiLayout *split, *subsplit, *col;
@@ -4563,7 +4561,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
ob= (Object *)idar[a];
/* only draw the controller common header if "use_visible" */
- if( (ob->scavisflag & OB_VIS_CONT) == 0) continue;
+ if ( (ob->scavisflag & OB_VIS_CONT) == 0) continue;
/* Drawing the Controller Header common to all Selected Objects */
@@ -4606,7 +4604,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
uiItemS(layout);
- for(cont= ob->controllers.first; cont; cont=cont->next) {
+ for (cont= ob->controllers.first; cont; cont=cont->next) {
RNA_pointer_create((ID *)ob, &RNA_Controller, cont, &ptr);
if (!(ob->scaflag & OB_ALLSTATE) && !(ob->state & cont->state_mask))
@@ -4638,7 +4636,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
/* put link button to the right */
col = uiLayoutColumn(subsplit, 0);
uiLayoutSetAlignment(col, UI_LAYOUT_ALIGN_LEFT);
- but= uiDefIconBut(block, LINK, 0, ICON_LINK, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
+ but = uiDefIconBut(block, LINK, 0, ICON_LINK, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
uiSetButLink(but, NULL, (void ***)&(cont->links), &cont->totlinks, LINK_CONTROLLER, LINK_ACTUATOR);
}
}
@@ -4658,14 +4656,14 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
uiItemR(row, &logic_ptr, "show_sensors_linked_controller", 0, "Link", ICON_NONE);
uiItemR(row, &logic_ptr, "show_sensors_active_states", 0, "State", ICON_NONE);
- for(a=0; a<count; a++) {
+ for (a=0; a<count; a++) {
bSensor *sens;
PointerRNA ptr;
ob= (Object *)idar[a];
/* only draw the sensor common header if "use_visible" */
- if((ob->scavisflag & OB_VIS_SENS) == 0) continue;
+ if ((ob->scavisflag & OB_VIS_SENS) == 0) continue;
row = uiLayoutRow(layout, 1);
uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors");
@@ -4676,7 +4674,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
uiItemS(layout);
- for(sens= ob->sensors.first; sens; sens=sens->next) {
+ for (sens= ob->sensors.first; sens; sens=sens->next) {
RNA_pointer_create((ID *)ob, &RNA_Sensor, sens, &ptr);
if ((ob->scaflag & OB_ALLSTATE) ||
@@ -4703,8 +4701,8 @@ 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 */
- but= uiDefIconBut(block, LINK, 0, ICON_LINK, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
+ /* 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);
}
}
@@ -4724,14 +4722,14 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
uiItemR(row, &logic_ptr, "show_actuators_linked_controller", 0, "Link", ICON_NONE);
uiItemR(row, &logic_ptr, "show_actuators_active_states", 0, "State", ICON_NONE);
- for(a=0; a<count; a++) {
+ for (a=0; a<count; a++) {
bActuator *act;
PointerRNA ptr;
ob= (Object *)idar[a];
/* only draw the actuator common header if "use_visible" */
- if( (ob->scavisflag & OB_VIS_ACT) == 0) continue;
+ if ( (ob->scavisflag & OB_VIS_ACT) == 0) continue;
row = uiLayoutRow(layout, 1);
uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators");
@@ -4742,7 +4740,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
uiItemS(layout);
- for(act= ob->actuators.first; act; act=act->next) {
+ for (act= ob->actuators.first; act; act=act->next) {
RNA_pointer_create((ID *)ob, &RNA_Actuator, act, &ptr);
@@ -4784,7 +4782,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
uiEndBlock(C, block);
uiDrawBlock(C, block);
- if(idar) MEM_freeN(idar);
+ if (idar) MEM_freeN(idar);
}
void logic_buttons(bContext *C, ARegion *ar)
@@ -4812,7 +4810,7 @@ void logic_buttons(bContext *C, ARegion *ar)
return;
}
- if(ob==NULL) return;
+ if (ob==NULL) return;
// uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
BLI_snprintf(numstr, sizeof(numstr), "buttonswin %p", (void *)ar);
@@ -4824,17 +4822,17 @@ 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 */
- for(a=0; a<count; a++) {
+ * we can determine which is actually linked/visible */
+ for (a=0; a<count; a++) {
ob= (Object *)idar[a];
act= ob->actuators.first;
- while(act) {
+ while (act) {
act->flag &= ~(ACT_LINKED|ACT_VISIBLE);
act = act->next;
}
/* same for sensors */
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
sens->flag &= ~(SENS_VISIBLE);
sens = sens->next;
}
@@ -4852,28 +4850,28 @@ void logic_buttons(bContext *C, ARegion *ar)
uiDefButBitS(block, TOG, BUTS_CONT_LINK, B_REDR, "Link", xco+110+2*(width-100)/3, yco+35, (width-100)/3, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Sensor/Actuator");
uiBlockEndAlign(block);
- for(a=0; a<count; a++) {
+ for (a=0; a<count; a++) {
unsigned int controller_state_mask = 0; /* store a bitmask for states that are used */
ob= (Object *)idar[a];
// uiClearButLock();
// uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
- if( (ob->scavisflag & OB_VIS_CONT) == 0) continue;
+ if ( (ob->scavisflag & OB_VIS_CONT) == 0) continue;
/* presume it is only objects for now */
uiBlockBeginAlign(block);
-// if(ob->controllers.first) uiSetCurFont(block, UI_HELVB);
+// if (ob->controllers.first) uiSetCurFont(block, UI_HELVB);
uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Active Object name");
-// if(ob->controllers.first) uiSetCurFont(block, UI_HELV);
+// if (ob->controllers.first) uiSetCurFont(block, UI_HELV);
uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Controller");
uiBlockEndAlign(block);
yco-=20;
/* 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) {
+ while (cont) {
for (iact=0; iact<cont->totlinks; iact++) {
act = cont->links[iact];
if (act)
@@ -4883,7 +4881,7 @@ void logic_buttons(bContext *C, ARegion *ar)
cont = cont->next;
}
- if(ob->scaflag & OB_SHOWCONT) {
+ if (ob->scaflag & OB_SHOWCONT) {
/* first show the state */
uiDefBlockBut(block, object_state_mask_menu, ob, "State", (short)(xco-10), (short)(yco-10), 36, UI_UNIT_Y, "Object state menu: store and retrieve initial state");
@@ -4920,7 +4918,7 @@ void logic_buttons(bContext *C, ARegion *ar)
yco -= 6;
}
cont= ob->controllers.first;
- while(cont) {
+ while (cont) {
if (cont->state_mask & (1<<stbit)) {
/* this controller is visible, mark all its actuator */
for (iact=0; iact<cont->totlinks; iact++) {
@@ -4935,35 +4933,35 @@ void logic_buttons(bContext *C, ARegion *ar)
sprintf(numstr, "%d", first_bit(cont->state_mask)+1);
uiDefBlockBut(block, controller_state_mask_menu, cont, numstr, (short)(xco+width-44), yco, 22, UI_UNIT_Y, "Set controller state index (from 1 to 30)");
- if(cont->flag & CONT_SHOW) {
+ if (cont->flag & CONT_SHOW) {
cont->otype= cont->type;
uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 70, UI_UNIT_Y, &cont->type, 0, 0, 0, 0, "Controller type");
- but= uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont->name, 0, MAX_NAME, 0, 0, "Controller name");
+ but = uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont->name, 0, MAX_NAME, 0, 0, "Controller name");
uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0);
ycoo= yco;
yco= draw_controllerbuttons(cont, block, xco, yco, width);
- if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2;
+ if (yco-6 < ycoo) ycoo= (yco+ycoo-20)/2;
}
else {
cpack(0x999999);
glRecti(xco+22, yco, xco+width-22,yco+19);
- but= uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller type");
+ but = uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller type");
//uiButSetFunc(but, old_sca_move_controller, cont, NULL);
- but= uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller name");
+ but = uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller name");
//uiButSetFunc(but, old_sca_move_controller, cont, NULL);
uiBlockBeginAlign(block);
- but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(110+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up");
+ but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(110+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up");
uiButSetFunc(but, old_sca_move_controller, cont, (void *)TRUE);
- but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(88+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down");
+ but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(88+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down");
uiButSetFunc(but, old_sca_move_controller, cont, (void *)FALSE);
uiBlockEndAlign(block);
ycoo= yco;
}
- but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
+ but = uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
uiSetButLink(but, NULL, (void ***)&(cont->links), &cont->totlinks, LINK_CONTROLLER, LINK_ACTUATOR);
uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, UI_UNIT_X, UI_UNIT_Y, cont, LINK_CONTROLLER, 0, 0, 0, "");
@@ -4991,26 +4989,26 @@ void logic_buttons(bContext *C, ARegion *ar)
uiDefButBitS(block, TOG, BUTS_SENS_STATE, B_REDR, "State", xco+80+3*(width-70)/4, yco+35, (width-70)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show only sensors connected to active states");
uiBlockEndAlign(block);
- for(a=0; a<count; a++) {
+ for (a=0; a<count; a++) {
ob= (Object *)idar[a];
// uiClearButLock();
// uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
- if( (ob->scavisflag & OB_VIS_SENS) == 0) continue;
+ if ( (ob->scavisflag & OB_VIS_SENS) == 0) continue;
/* presume it is only objects for now */
uiBlockBeginAlign(block);
-// if(ob->sensors.first) uiSetCurFont(block, UI_HELVB);
+// if (ob->sensors.first) uiSetCurFont(block, UI_HELVB);
uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors");
-// if(ob->sensors.first) uiSetCurFont(block, UI_HELV);
+// if (ob->sensors.first) uiSetCurFont(block, UI_HELV);
uiDefButBitS(block, TOG, OB_ADDSENS, B_ADD_SENS, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Sensor");
uiBlockEndAlign(block);
yco-=20;
- if(ob->scaflag & OB_SHOWSENS) {
+ if (ob->scaflag & OB_SHOWSENS) {
sens= ob->sensors.first;
- while(sens) {
+ while (sens) {
if (!(slogic->scaflag & BUTS_SENS_STATE) ||
(sens->totlinks == 0) || /* always display sensor without links so that is can be edited */
(sens->flag & SENS_PIN && slogic->scaflag & BUTS_SENS_STATE) || /* states can hide some sensors, pinned sensors ignore the visible state */
@@ -5027,33 +5025,32 @@ 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");
+ 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);
sens->otype= sens->type;
yco= draw_sensorbuttons(ob, sens, block, xco, yco, width);
- if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2;
+ if (yco-6 < ycoo) ycoo= (yco+ycoo-20)/2;
}
else {
set_col_sensor(sens->type, 1);
glRecti(xco+22, yco, xco+width-22,yco+19);
- but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, UI_UNIT_Y, sens, 0, 0, 0, 0, "");
+ but = uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, UI_UNIT_Y, sens, 0, 0, 0, 0, "");
//uiButSetFunc(but, old_sca_move_sensor, sens, NULL);
- but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens, 0, MAX_NAME, 0, 0, "");
+ but = uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens, 0, MAX_NAME, 0, 0, "");
//uiButSetFunc(but, old_sca_move_sensor, sens, NULL);
uiBlockBeginAlign(block);
- but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(66+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up");
+ but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(66+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up");
uiButSetFunc(but, old_sca_move_sensor, sens, (void *)TRUE);
- but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(44+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down");
+ but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(44+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down");
uiButSetFunc(but, old_sca_move_sensor, sens, (void *)FALSE);
uiBlockEndAlign(block);
}
- but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
+ but = uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
uiSetButLink(but, NULL, (void ***)&(sens->links), &sens->totlinks, LINK_SENSOR, LINK_CONTROLLER);
yco-=20;
@@ -5073,25 +5070,25 @@ void logic_buttons(bContext *C, ARegion *ar)
uiDefButBitS(block, TOG, BUTS_ACT_LINK, B_REDR, "Link", xco+110+2*(width-100)/4, yco+35, (width-100)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller");
uiDefButBitS(block, TOG, BUTS_ACT_STATE, B_REDR, "State", xco+110+3*(width-100)/4, yco+35, (width-100)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show only actuators connected to active states");
uiBlockEndAlign(block);
- for(a=0; a<count; a++) {
+ for (a=0; a<count; a++) {
ob= (Object *)idar[a];
// uiClearButLock();
// uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
- if( (ob->scavisflag & OB_VIS_ACT) == 0) continue;
+ if ( (ob->scavisflag & OB_VIS_ACT) == 0) continue;
/* presume it is only objects for now */
uiBlockBeginAlign(block);
-// if(ob->actuators.first) uiSetCurFont(block, UI_HELVB);
+// if (ob->actuators.first) uiSetCurFont(block, UI_HELVB);
uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco,(short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators");
-// if(ob->actuators.first) uiSetCurFont(block, UI_HELV);
+// if (ob->actuators.first) uiSetCurFont(block, UI_HELV);
uiDefButBitS(block, TOG, OB_ADDACT, B_ADD_ACT, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Actuator");
uiBlockEndAlign(block);
yco-=20;
- if(ob->scaflag & OB_SHOWACT) {
+ if (ob->scaflag & OB_SHOWACT) {
act= ob->actuators.first;
- while(act) {
+ while (act) {
if (!(slogic->scaflag & BUTS_ACT_STATE) ||
!(act->flag & ACT_LINKED) || /* always display actuators without links so that is can be edited */
(act->flag & ACT_VISIBLE) || /* this actuator has visible connection, display it */
@@ -5105,15 +5102,15 @@ void logic_buttons(bContext *C, ARegion *ar)
uiDefIconButBitS(block, ICONTOG, ACT_PIN, B_REDR, ICON_PINNED, (short)(xco+width-44), yco, 22, UI_UNIT_Y, &act->flag, 0, 0, 0, 0, "Display when not linked to a visible states controller");
uiDefIconButBitS(block, ICONTOG, ACT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, UI_UNIT_Y, &act->flag, 0, 0, 0, 0, "Display the actuator");
- if(act->flag & ACT_SHOW) {
+ if (act->flag & ACT_SHOW) {
act->otype= act->type;
uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 90, UI_UNIT_Y, &act->type, 0, 0, 0, 0, "Actuator type");
- but= uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act->name, 0, MAX_NAME, 0, 0, "Actuator name");
+ but = uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act->name, 0, MAX_NAME, 0, 0, "Actuator name");
uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0);
ycoo= yco;
yco= draw_actuatorbuttons(bmain, ob, act, block, xco, yco, width);
- if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2;
+ if (yco-6 < ycoo) ycoo= (yco+ycoo-20)/2;
}
else {
set_col_actuator(act->type, 1);
@@ -5124,9 +5121,9 @@ void logic_buttons(bContext *C, ARegion *ar)
// uiButSetFunc(but, old_sca_move_actuator, act, NULL);
uiBlockBeginAlign(block);
- but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(66+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up");
+ but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(66+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up");
uiButSetFunc(but, old_sca_move_actuator, act, (void *)TRUE);
- but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(44+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down");
+ but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(44+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down");
uiButSetFunc(but, old_sca_move_actuator, act, (void *)FALSE);
uiBlockEndAlign(block);
@@ -5148,7 +5145,7 @@ void logic_buttons(bContext *C, ARegion *ar)
uiEndBlock(C, block);
uiDrawBlock(C, block);
- if(idar) MEM_freeN(idar);
+ if (idar) MEM_freeN(idar);
}
diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c
index a9b1acbcc04..1b6d72cbc3e 100644
--- a/source/blender/editors/space_logic/space_logic.c
+++ b/source/blender/editors/space_logic/space_logic.c
@@ -63,13 +63,13 @@ ARegion *logic_has_buttons_region(ScrArea *sa)
ARegion *ar, *arnew;
ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
- if(ar) return ar;
+ if (ar) return ar;
/* add subdiv level; after header */
ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
/* is error! */
- if(ar==NULL) return NULL;
+ if (ar==NULL) return NULL;
arnew= MEM_callocN(sizeof(ARegion), "buttons for image");
@@ -119,15 +119,15 @@ static SpaceLink *logic_new(const bContext *UNUSED(C))
BLI_addtail(&slogic->regionbase, ar);
ar->regiontype= RGN_TYPE_WINDOW;
- ar->v2d.tot.xmin= 0.0f;
- ar->v2d.tot.ymin= 0.0f;
- ar->v2d.tot.xmax= 1280;
- ar->v2d.tot.ymax= 240.0f;
+ ar->v2d.tot.xmin = 0.0f;
+ ar->v2d.tot.ymin = 0.0f;
+ ar->v2d.tot.xmax = 1280;
+ ar->v2d.tot.ymax = 240.0f;
- ar->v2d.cur.xmin= 0.0f;
- ar->v2d.cur.ymin= 0.0f;
- ar->v2d.cur.xmax= 1280.0f;
- ar->v2d.cur.ymax= 240.0f;
+ ar->v2d.cur.xmin = 0.0f;
+ ar->v2d.cur.ymin = 0.0f;
+ ar->v2d.cur.xmax = 1280.0f;
+ ar->v2d.cur.ymax = 240.0f;
ar->v2d.min[0]= 1.0f;
ar->v2d.min[1]= 1.0f;
@@ -151,7 +151,7 @@ static void logic_free(SpaceLink *UNUSED(sl))
{
// Spacelogic *slogic= (SpaceLogic*) sl;
-// if(slogic->gpd)
+// if (slogic->gpd)
// XXX free_gpencil_data(slogic->gpd);
}
@@ -178,7 +178,7 @@ static void logic_operatortypes(void)
static void logic_keymap(struct wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "Logic Editor", SPACE_LOGIC, 0);
+ wmKeyMap *keymap = WM_keymap_find(keyconf, "Logic Editor", SPACE_LOGIC, 0);
WM_keymap_add_item(keymap, "LOGIC_OT_properties", NKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "LOGIC_OT_links_cut", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
@@ -213,7 +213,7 @@ static void logic_listener(ARegion *ar, wmNotifier *wmn)
case NC_OBJECT:
break;
case NC_ID:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
}
@@ -236,7 +236,7 @@ static void logic_main_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymaps */
- keymap= WM_keymap_find(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -275,7 +275,7 @@ static void logic_buttons_area_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap= WM_keymap_find(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
diff --git a/source/blender/editors/space_nla/CMakeLists.txt b/source/blender/editors/space_nla/CMakeLists.txt
index cae31f86388..aa3598e8e1f 100644
--- a/source/blender/editors/space_nla/CMakeLists.txt
+++ b/source/blender/editors/space_nla/CMakeLists.txt
@@ -46,4 +46,8 @@ set(SRC
nla_intern.h
)
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_editor_space_nla "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/space_nla/SConscript b/source/blender/editors/space_nla/SConscript
index 6738f3380b4..ee010e6856f 100644
--- a/source/blender/editors/space_nla/SConscript
+++ b/source/blender/editors/space_nla/SConscript
@@ -6,4 +6,9 @@ sources = env.Glob('*.c')
incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include ../../blenloader'
-env.BlenderLib ( 'bf_editors_space_nla', sources, Split(incs), [], libtype=['core'], priority=[85] )
+defs = []
+
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
+env.BlenderLib ( 'bf_editors_space_nla', sources, Split(incs), defs, libtype=['core'], priority=[85] )
diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c
index fc42d9fa966..de42e4a783d 100644
--- a/source/blender/editors/space_nla/nla_buttons.c
+++ b/source/blender/editors/space_nla/nla_buttons.c
@@ -518,7 +518,7 @@ static int nla_properties(bContext *C, wmOperator *UNUSED(op))
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= nla_has_buttons_region(sa);
- if(ar)
+ if (ar)
ED_region_toggle_hidden(C, ar);
return OPERATOR_FINISHED;
@@ -526,13 +526,13 @@ static int nla_properties(bContext *C, wmOperator *UNUSED(op))
void NLA_OT_properties(wmOperatorType *ot)
{
- ot->name= "Properties";
- ot->idname= "NLA_OT_properties";
- ot->description= "Toggle display properties panel";
+ ot->name = "Properties";
+ ot->idname = "NLA_OT_properties";
+ ot->description = "Toggle display properties panel";
- ot->exec= nla_properties;
- ot->poll= ED_operator_nla_active;
+ ot->exec = nla_properties;
+ ot->poll = ED_operator_nla_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c
index fb23533636c..1d323cb6a4f 100644
--- a/source/blender/editors/space_nla/nla_channels.c
+++ b/source/blender/editors/space_nla/nla_channels.c
@@ -92,8 +92,8 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
ale= BLI_findlink(&anim_data, channel_index);
if (ale == NULL) {
/* channel not found */
- if (G.f & G_DEBUG)
- printf("Error: animation channel (index = %d) not found in mouse_anim_channels() \n", channel_index);
+ if (G.debug & G_DEBUG)
+ printf("Error: animation channel (index = %d) not found in mouse_anim_channels()\n", channel_index);
BLI_freelistN(&anim_data);
return 0;
@@ -284,8 +284,8 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
break;
default:
- if (G.f & G_DEBUG)
- printf("Error: Invalid channel type in mouse_nla_channels() \n");
+ if (G.debug & G_DEBUG)
+ printf("Error: Invalid channel type in mouse_nla_channels()\n");
}
/* free channels */
@@ -344,16 +344,16 @@ static int nlachannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *e
void NLA_OT_channels_click (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mouse Click on NLA Channels";
- ot->idname= "NLA_OT_channels_click";
- ot->description= "Handle clicks to select NLA channels";
+ ot->name = "Mouse Click on NLA Channels";
+ ot->idname = "NLA_OT_channels_click";
+ ot->description = "Handle clicks to select NLA channels";
/* api callbacks */
- ot->invoke= nlachannels_mouseclick_invoke;
- ot->poll= ED_operator_nla_active;
+ ot->invoke = nlachannels_mouseclick_invoke;
+ ot->poll = ED_operator_nla_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", ""); // SHIFTKEY
@@ -418,16 +418,16 @@ static int nlaedit_add_tracks_exec (bContext *C, wmOperator *op)
void NLA_OT_tracks_add (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Track(s)";
- ot->idname= "NLA_OT_tracks_add";
- ot->description= "Add NLA-Tracks above/after the selected tracks";
+ ot->name = "Add Track(s)";
+ ot->idname = "NLA_OT_tracks_add";
+ ot->description = "Add NLA-Tracks above/after the selected tracks";
/* api callbacks */
- ot->exec= nlaedit_add_tracks_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_add_tracks_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "above_selected", 0, "Above Selected", "Add a new NLA Track above every existing selected one");
@@ -454,7 +454,7 @@ static int nlaedit_delete_tracks_exec (bContext *C, wmOperator *UNUSED(op))
/* delete tracks */
for (ale= anim_data.first; ale; ale= ale->next) {
- if(ale->type == ANIMTYPE_NLATRACK) {
+ if (ale->type == ANIMTYPE_NLATRACK) {
NlaTrack *nlt= (NlaTrack *)ale->data;
AnimData *adt= ale->adt;
@@ -482,16 +482,16 @@ static int nlaedit_delete_tracks_exec (bContext *C, wmOperator *UNUSED(op))
void NLA_OT_delete_tracks (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Tracks";
- ot->idname= "NLA_OT_delete_tracks";
- ot->description= "Delete selected NLA-Tracks and the strips they contain";
+ ot->name = "Delete Tracks";
+ ot->idname = "NLA_OT_delete_tracks";
+ ot->description = "Delete selected NLA-Tracks and the strips they contain";
/* api callbacks */
- ot->exec= nlaedit_delete_tracks_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_delete_tracks_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* *********************************************** */
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index d7a1053f3c1..7ed49025814 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -121,7 +121,7 @@ static void nla_action_draw_keyframes (AnimData *adt, bAction *act, View2D *v2d,
action_to_keylist(adt, act, &keys, NULL);
BLI_dlrbTree_linkedlist_sync(&keys);
- if ELEM(NULL, act, keys.first)
+ if (ELEM(NULL, act, keys.first))
return;
/* draw a darkened region behind the strips
@@ -172,7 +172,7 @@ static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float co
color[2]= 0.86f;
}
else {
- /* normal, unselected strip - use (hardly noticable) blue tinge */
+ /* normal, unselected strip - use (hardly noticeable) blue tinge */
// FIXME: hardcoded temp-hack colors
color[0]= 0.11f;
color[1]= 0.15f;
@@ -190,7 +190,7 @@ static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float co
color[2]= 0.59f;
}
else {
- /* normal, unselected strip - use (hardly noticable) dark purple tinge */
+ /* normal, unselected strip - use (hardly noticeable) dark purple tinge */
// FIXME: hardcoded temp-hack colors
color[0]= 0.20f;
color[1]= 0.15f;
@@ -207,7 +207,7 @@ static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float co
color[2]= 0.48f;
}
else {
- /* normal, unselected strip - use (hardly noticable) teal tinge */
+ /* normal, unselected strip - use (hardly noticeable) teal tinge */
// FIXME: hardcoded temp-hack colors
color[0]= 0.17f;
color[1]= 0.24f;
@@ -498,10 +498,10 @@ static void nla_draw_strip_text (AnimData *adt, NlaTrack *nlt, NlaStrip *strip,
* - padding of 2 'units' on either side
*/
// TODO: make this centered?
- rect.xmin= strip->start + xofs;
- rect.ymin= yminc;
- rect.xmax= strip->end - xofs;
- rect.ymax= ymaxc;
+ rect.xmin = strip->start + xofs;
+ rect.ymin = yminc;
+ rect.xmax = strip->end - xofs;
+ rect.ymax = ymaxc;
/* add this string to the cache of texts to draw */
UI_view2d_text_cache_rectf(v2d, &rect, str, col);
@@ -559,7 +559,7 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
/* don't use totrect set, as the width stays the same
* (NOTE: this is ok here, the configuration is pretty straightforward)
*/
- v2d->tot.ymin= (float)(-height);
+ v2d->tot.ymin = (float)(-height);
/* loop through channels, and set up drawing depending on their type */
y= (float)(-NLACHANNEL_HEIGHT(snla));
@@ -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
@@ -813,7 +812,7 @@ static void draw_nla_channel_list_gl (bAnimContext *ac, ListBase *anim_data, Vie
/* only on top two corners, to show that this channel sits on top of the preceding ones */
uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
- /* draw slightly shifted up vertically to look like it has more separtion from other channels,
+ /* draw slightly shifted up vertically to look like it has more separation from other channels,
* but we then need to slightly shorten it so that it doesn't look like it overlaps
*/
uiDrawBox(GL_POLYGON, x+offset, yminc+NLACHANNEL_SKIP, (float)v2d->cur.xmax, ymaxc+NLACHANNEL_SKIP-1, 8);
@@ -947,7 +946,7 @@ void draw_nla_channel_list (bContext *C, bAnimContext *ac, ARegion *ar)
/* don't use totrect set, as the width stays the same
* (NOTE: this is ok here, the configuration is pretty straightforward)
*/
- v2d->tot.ymin= (float)(-height);
+ v2d->tot.ymin = (float)(-height);
/* need to do a view-sync here, so that the keys area doesn't jump around (it must copy this) */
UI_view2d_sync(NULL, ac->sa, v2d, V2D_LOCK_COPY);
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index d7dfea0b7e7..1a94b1160be 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -158,16 +158,16 @@ static int nlaedit_enable_tweakmode_exec (bContext *C, wmOperator *op)
void NLA_OT_tweakmode_enter (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Enter Tweak Mode";
- ot->idname= "NLA_OT_tweakmode_enter";
- ot->description= "Enter tweaking mode for the action referenced by the active strip";
+ ot->name = "Enter Tweak Mode";
+ ot->idname = "NLA_OT_tweakmode_enter";
+ ot->description = "Enter tweaking mode for the action referenced by the active strip";
/* api callbacks */
- ot->exec= nlaedit_enable_tweakmode_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_enable_tweakmode_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ------------- */
@@ -223,16 +223,16 @@ static int nlaedit_disable_tweakmode_exec (bContext *C, wmOperator *op)
void NLA_OT_tweakmode_exit (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Exit Tweak Mode";
- ot->idname= "NLA_OT_tweakmode_exit";
- ot->description= "Exit tweaking mode for the action referenced by the active strip";
+ ot->name = "Exit Tweak Mode";
+ ot->idname = "NLA_OT_tweakmode_exit";
+ ot->description = "Exit tweaking mode for the action referenced by the active strip";
/* api callbacks */
- ot->exec= nlaedit_disable_tweakmode_exec;
- ot->poll= nlaop_poll_tweakmode_on;
+ ot->exec = nlaedit_disable_tweakmode_exec;
+ ot->poll = nlaop_poll_tweakmode_on;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* *********************************************** */
@@ -309,8 +309,8 @@ static int nlaedit_viewall(bContext *C, const short onlySel)
v2d->cur.xmax += extra;
/* set vertical range */
- v2d->cur.ymax= 0.0f;
- v2d->cur.ymin= (float)-(v2d->mask.ymax - v2d->mask.ymin);
+ v2d->cur.ymax = 0.0f;
+ v2d->cur.ymin = (float)-(v2d->mask.ymax - v2d->mask.ymin);
/* do View2D syncing */
UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY);
@@ -338,31 +338,31 @@ static int nlaedit_viewsel_exec(bContext *C, wmOperator *UNUSED(op))
void NLA_OT_view_all (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View All";
- ot->idname= "NLA_OT_view_all";
- ot->description= "Reset viewable area to show full strips range";
+ ot->name = "View All";
+ ot->idname = "NLA_OT_view_all";
+ ot->description = "Reset viewable area to show full strips range";
/* api callbacks */
- ot->exec= nlaedit_viewall_exec;
- ot->poll= ED_operator_nla_active;
+ ot->exec = nlaedit_viewall_exec;
+ ot->poll = ED_operator_nla_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
void NLA_OT_view_selected (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Selected";
- ot->idname= "NLA_OT_view_selected";
- ot->description= "Reset viewable area to show selected strips range";
+ ot->name = "View Selected";
+ ot->idname = "NLA_OT_view_selected";
+ ot->description = "Reset viewable area to show selected strips range";
/* api callbacks */
- ot->exec= nlaedit_viewsel_exec;
- ot->poll= ED_operator_nla_active;
+ ot->exec = nlaedit_viewsel_exec;
+ ot->poll = ED_operator_nla_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* *********************************************** */
@@ -399,7 +399,7 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op)
if (act == NULL) {
BKE_report(op->reports, RPT_ERROR, "No valid Action to add");
- //printf("Add strip - actname = '%s' \n", actname);
+ //printf("Add strip - actname = '%s'\n", actname);
return OPERATOR_CANCELLED;
}
else if (act->idroot == 0) {
@@ -473,23 +473,23 @@ void NLA_OT_actionclip_add (wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Add Action Strip";
- ot->idname= "NLA_OT_actionclip_add";
- ot->description= "Add an Action-Clip strip (i.e. an NLA Strip referencing an Action) to the active track";
+ ot->name = "Add Action Strip";
+ ot->idname = "NLA_OT_actionclip_add";
+ ot->description = "Add an Action-Clip strip (i.e. an NLA Strip referencing an Action) to the active track";
/* api callbacks */
- ot->invoke= WM_enum_search_invoke;
- ot->exec= nlaedit_add_actionclip_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->invoke = WM_enum_search_invoke;
+ ot->exec = nlaedit_add_actionclip_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
// TODO: this would be nicer as an ID-pointer...
prop= RNA_def_enum(ot->srna, "action", DummyRNA_NULL_items, 0, "Action", "");
RNA_def_enum_funcs(prop, RNA_action_itemf);
- ot->prop= prop;
+ ot->prop = prop;
}
/* ******************** Add Transition Operator ***************************** */
@@ -520,7 +520,7 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op)
NlaStrip *s1, *s2;
/* get initial pair of strips */
- if ELEM(nlt->strips.first, NULL, nlt->strips.last)
+ if (ELEM(nlt->strips.first, NULL, nlt->strips.last))
continue;
s1= nlt->strips.first;
s2= s1->next;
@@ -530,7 +530,7 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op)
NlaStrip *strip;
/* check if both are selected */
- if ELEM(0, (s1->flag & NLASTRIP_FLAG_SELECT), (s2->flag & NLASTRIP_FLAG_SELECT))
+ if (ELEM(0, (s1->flag & NLASTRIP_FLAG_SELECT), (s2->flag & NLASTRIP_FLAG_SELECT)))
continue;
/* check if there's space between the two */
if (IS_EQF(s1->end, s2->start))
@@ -598,16 +598,16 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op)
void NLA_OT_transition_add (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Transition";
- ot->idname= "NLA_OT_transition_add";
- ot->description= "Add a transition strip between two adjacent selected strips";
+ ot->name = "Add Transition";
+ ot->idname = "NLA_OT_transition_add";
+ ot->description = "Add a transition strip between two adjacent selected strips";
/* api callbacks */
- ot->exec= nlaedit_add_transition_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_add_transition_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Add Sound Clip Operator ***************************** */
@@ -683,16 +683,16 @@ static int nlaedit_add_sound_exec (bContext *C, wmOperator *UNUSED(op))
void NLA_OT_soundclip_add (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Sound Clip";
- ot->idname= "NLA_OT_soundclip_add";
- ot->description= "Add a strip for controlling when speaker plays its sound clip";
+ ot->name = "Add Sound Clip";
+ ot->idname = "NLA_OT_soundclip_add";
+ ot->description = "Add a strip for controlling when speaker plays its sound clip";
/* api callbacks */
- ot->exec= nlaedit_add_sound_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_add_sound_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Add Meta-Strip Operator ***************************** */
@@ -745,16 +745,16 @@ static int nlaedit_add_meta_exec (bContext *C, wmOperator *UNUSED(op))
void NLA_OT_meta_add (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Meta-Strips";
- ot->idname= "NLA_OT_meta_add";
- ot->description= "Add new meta-strips incorporating the selected strips";
+ ot->name = "Add Meta-Strips";
+ ot->idname = "NLA_OT_meta_add";
+ ot->description = "Add new meta-strips incorporating the selected strips";
/* api callbacks */
- ot->exec= nlaedit_add_meta_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_add_meta_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Remove Meta-Strip Operator ***************************** */
@@ -797,16 +797,16 @@ static int nlaedit_remove_meta_exec (bContext *C, wmOperator *UNUSED(op))
void NLA_OT_meta_remove (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Meta-Strips";
- ot->idname= "NLA_OT_meta_remove";
- ot->description= "Separate out the strips held by the selected meta-strips";
+ ot->name = "Remove Meta-Strips";
+ ot->idname = "NLA_OT_meta_remove";
+ ot->description = "Separate out the strips held by the selected meta-strips";
/* api callbacks */
- ot->exec= nlaedit_remove_meta_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_remove_meta_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Duplicate Strips Operator ************************** */
@@ -900,17 +900,17 @@ static int nlaedit_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED
void NLA_OT_duplicate (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Duplicate Strips";
- ot->idname= "NLA_OT_duplicate";
- ot->description= "Duplicate selected NLA-Strips, adding the new strips in new tracks above the originals";
+ ot->name = "Duplicate Strips";
+ ot->idname = "NLA_OT_duplicate";
+ ot->description = "Duplicate selected NLA-Strips, adding the new strips in new tracks above the originals";
/* api callbacks */
- ot->invoke= nlaedit_duplicate_invoke;
- ot->exec= nlaedit_duplicate_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->invoke = nlaedit_duplicate_invoke;
+ ot->exec = nlaedit_duplicate_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* to give to transform */
RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", "");
@@ -975,16 +975,16 @@ static int nlaedit_delete_exec (bContext *C, wmOperator *UNUSED(op))
void NLA_OT_delete (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete Strips";
- ot->idname= "NLA_OT_delete";
- ot->description= "Delete selected strips";
+ ot->name = "Delete Strips";
+ ot->idname = "NLA_OT_delete";
+ ot->description = "Delete selected strips";
/* api callbacks */
- ot->exec= nlaedit_delete_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_delete_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Split Strips Operator ***************************** */
@@ -1120,16 +1120,16 @@ static int nlaedit_split_exec (bContext *C, wmOperator *UNUSED(op))
void NLA_OT_split (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Split Strips";
- ot->idname= "NLA_OT_split";
- ot->description= "Split selected strips at their midpoints";
+ ot->name = "Split Strips";
+ ot->idname = "NLA_OT_split";
+ ot->description = "Split selected strips at their midpoints";
/* api callbacks */
- ot->exec= nlaedit_split_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_split_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Bake Strips Operator ***************************** */
@@ -1173,16 +1173,16 @@ static int nlaedit_bake_exec (bContext *C, wmOperator *UNUSED(op))
void NLA_OT_bake (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Bake Strips";
- ot->idname= "NLA_OT_bake";
- ot->description= "Bake all strips of selected AnimData blocks";
+ ot->name = "Bake Strips";
+ ot->idname = "NLA_OT_bake";
+ ot->description = "Bake all strips of selected AnimData blocks";
/* api callbacks */
- ot->exec= nlaedit_bake_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_bake_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* *********************************************** */
@@ -1235,16 +1235,16 @@ static int nlaedit_toggle_mute_exec (bContext *C, wmOperator *UNUSED(op))
void NLA_OT_mute_toggle (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Muting";
- ot->idname= "NLA_OT_mute_toggle";
- ot->description= "Mute or un-mute selected strips";
+ ot->name = "Toggle Muting";
+ ot->idname = "NLA_OT_mute_toggle";
+ ot->description = "Mute or un-mute selected strips";
/* api callbacks */
- ot->exec= nlaedit_toggle_mute_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_toggle_mute_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Swap Strips Operator ************************** */
@@ -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);
}
@@ -1393,16 +1392,16 @@ static int nlaedit_swap_exec (bContext *C, wmOperator *op)
void NLA_OT_swap (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Swap Strips";
- ot->idname= "NLA_OT_swap";
- ot->description= "Swap order of selected strips within tracks";
+ ot->name = "Swap Strips";
+ ot->idname = "NLA_OT_swap";
+ ot->description = "Swap order of selected strips within tracks";
/* api callbacks */
- ot->exec= nlaedit_swap_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_swap_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Move Strips Up Operator ************************** */
@@ -1467,16 +1466,16 @@ static int nlaedit_move_up_exec (bContext *C, wmOperator *UNUSED(op))
void NLA_OT_move_up (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move Strips Up";
- ot->idname= "NLA_OT_move_up";
- ot->description= "Move selected strips up a track if there's room";
+ ot->name = "Move Strips Up";
+ ot->idname = "NLA_OT_move_up";
+ ot->description = "Move selected strips up a track if there's room";
/* api callbacks */
- ot->exec= nlaedit_move_up_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_move_up_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Move Strips Down Operator ************************** */
@@ -1541,16 +1540,16 @@ static int nlaedit_move_down_exec (bContext *C, wmOperator *UNUSED(op))
void NLA_OT_move_down (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move Strips Down";
- ot->idname= "NLA_OT_move_down";
- ot->description= "Move selected strips down a track if there's room";
+ ot->name = "Move Strips Down";
+ ot->idname = "NLA_OT_move_down";
+ ot->description = "Move selected strips down a track if there's room";
/* api callbacks */
- ot->exec= nlaedit_move_down_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_move_down_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Sync Action Length Operator ***************************** */
@@ -1617,19 +1616,19 @@ static int nlaedit_sync_actlen_exec (bContext *C, wmOperator *op)
void NLA_OT_action_sync_length (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Sync Action Length";
- ot->idname= "NLA_OT_action_sync_length";
- ot->description= "Synchronise the length of the referenced Action with the length used in the strip";
+ ot->name = "Sync Action Length";
+ ot->idname = "NLA_OT_action_sync_length";
+ ot->description = "Synchronize the length of the referenced Action with the length used in the strip";
/* api callbacks */
- ot->exec= nlaedit_sync_actlen_exec;
- ot->poll= ED_operator_nla_active; // XXX: is this satisfactory... probably requires a check for active strip...
+ ot->exec = nlaedit_sync_actlen_exec;
+ ot->poll = ED_operator_nla_active; // XXX: is this satisfactory... probably requires a check for active strip...
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_boolean(ot->srna, "active", 1, "Active Strip Only", "Only sync the active length for the active strip");
+ ot->prop = RNA_def_boolean(ot->srna, "active", 1, "Active Strip Only", "Only sync the active length for the active strip");
}
/* ******************** Apply Scale Operator ***************************** */
@@ -1717,16 +1716,16 @@ static int nlaedit_apply_scale_exec (bContext *C, wmOperator *UNUSED(op))
void NLA_OT_apply_scale (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Apply Scale";
- ot->idname= "NLA_OT_apply_scale";
- ot->description= "Apply scaling of selected strips to their referenced Actions";
+ ot->name = "Apply Scale";
+ ot->idname = "NLA_OT_apply_scale";
+ ot->description = "Apply scaling of selected strips to their referenced Actions";
/* api callbacks */
- ot->exec= nlaedit_apply_scale_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_apply_scale_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Clear Scale Operator ***************************** */
@@ -1780,16 +1779,16 @@ static int nlaedit_clear_scale_exec (bContext *C, wmOperator *UNUSED(op))
void NLA_OT_clear_scale (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Scale";
- ot->idname= "NLA_OT_clear_scale";
- ot->description= "Reset scaling of selected strips";
+ ot->name = "Clear Scale";
+ ot->idname = "NLA_OT_clear_scale";
+ ot->description = "Reset scaling of selected strips";
/* api callbacks */
- ot->exec= nlaedit_clear_scale_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_clear_scale_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ******************** Snap Strips Operator ************************** */
@@ -1921,20 +1920,20 @@ static int nlaedit_snap_exec (bContext *C, wmOperator *op)
void NLA_OT_snap (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Snap Strips";
- ot->idname= "NLA_OT_snap";
- ot->description= "Move start of strips to specified time";
+ ot->name = "Snap Strips";
+ ot->idname = "NLA_OT_snap";
+ ot->description = "Move start of strips to specified time";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= nlaedit_snap_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = nlaedit_snap_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_nlaedit_snap_types, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_nlaedit_snap_types, 0, "Type", "");
}
/* *********************************************** */
@@ -2040,20 +2039,20 @@ static int nla_fmodifier_add_exec(bContext *C, wmOperator *op)
void NLA_OT_fmodifier_add (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add F-Modifier";
- ot->idname= "NLA_OT_fmodifier_add";
- ot->description= "Add a F-Modifier of the specified type to the selected NLA-Strips";
+ ot->name = "Add F-Modifier";
+ ot->idname = "NLA_OT_fmodifier_add";
+ ot->description = "Add a F-Modifier of the specified type to the selected NLA-Strips";
/* api callbacks */
- ot->invoke= nla_fmodifier_add_invoke;
- ot->exec= nla_fmodifier_add_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->invoke = nla_fmodifier_add_invoke;
+ ot->exec = nla_fmodifier_add_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "type", fmodifier_type_items, 0, "Type", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", fmodifier_type_items, 0, "Type", "");
RNA_def_boolean(ot->srna, "only_active", 0, "Only Active", "Only add a F-Modifier of the specified type to the active strip");
}
@@ -2104,16 +2103,16 @@ static int nla_fmodifier_copy_exec(bContext *C, wmOperator *op)
void NLA_OT_fmodifier_copy (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy F-Modifiers";
- ot->idname= "NLA_OT_fmodifier_copy";
- ot->description= "Copy the F-Modifier(s) of the active NLA-Strip";
+ ot->name = "Copy F-Modifiers";
+ ot->idname = "NLA_OT_fmodifier_copy";
+ ot->description = "Copy the F-Modifier(s) of the active NLA-Strip";
/* api callbacks */
- ot->exec= nla_fmodifier_copy_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nla_fmodifier_copy_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
//ot->prop = RNA_def_boolean(ot->srna, "all", 1, "All F-Modifiers", "Copy all the F-Modifiers, instead of just the active one");
@@ -2166,16 +2165,16 @@ static int nla_fmodifier_paste_exec(bContext *C, wmOperator *op)
void NLA_OT_fmodifier_paste (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Paste F-Modifiers";
- ot->idname= "NLA_OT_fmodifier_paste";
- ot->description= "Add copied F-Modifiers to the selected NLA-Strips";
+ ot->name = "Paste F-Modifiers";
+ ot->idname = "NLA_OT_fmodifier_paste";
+ ot->description = "Add copied F-Modifiers to the selected NLA-Strips";
/* api callbacks */
- ot->exec= nla_fmodifier_paste_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nla_fmodifier_paste_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* *********************************************** */
diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c
index 55831de876c..78fb92f2ee4 100644
--- a/source/blender/editors/space_nla/nla_ops.c
+++ b/source/blender/editors/space_nla/nla_ops.c
@@ -200,21 +200,21 @@ static void nla_keymap_main (wmKeyConfig *keyconf, wmKeyMap *keymap)
/* click select */
kmi = WM_keymap_add_item(keymap, "NLA_OT_click_select", SELECTMOUSE, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
- kmi= WM_keymap_add_item(keymap, "NLA_OT_click_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "NLA_OT_click_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
/* select left/right */
kmi = WM_keymap_add_item(keymap, "NLA_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_enum_set(kmi->ptr, "mode", NLAEDIT_LRSEL_TEST);
- kmi= WM_keymap_add_item(keymap, "NLA_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "NLA_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_enum_set(kmi->ptr, "mode", NLAEDIT_LRSEL_TEST);
- kmi= WM_keymap_add_item(keymap, "NLA_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "NLA_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_enum_set(kmi->ptr, "mode", NLAEDIT_LRSEL_LEFT);
- kmi= WM_keymap_add_item(keymap, "NLA_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "NLA_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_enum_set(kmi->ptr, "mode", NLAEDIT_LRSEL_RIGHT);
@@ -301,7 +301,7 @@ void nla_keymap(wmKeyConfig *keyconf)
wmKeyMap *keymap;
/* keymap for all regions */
- keymap= WM_keymap_find(keyconf, "NLA Generic", SPACE_NLA, 0);
+ keymap = WM_keymap_find(keyconf, "NLA Generic", SPACE_NLA, 0);
WM_keymap_add_item(keymap, "NLA_OT_properties", NKEY, KM_PRESS, 0, 0);
/* channels */
@@ -311,11 +311,11 @@ void nla_keymap(wmKeyConfig *keyconf)
*
* However, those operations which involve clicking on channels and/or the placement of them in the view are implemented here instead
*/
- keymap= WM_keymap_find(keyconf, "NLA Channels", SPACE_NLA, 0);
+ keymap = WM_keymap_find(keyconf, "NLA Channels", SPACE_NLA, 0);
nla_keymap_channels(keymap);
/* data */
- keymap= WM_keymap_find(keyconf, "NLA Editor", SPACE_NLA, 0);
+ keymap = WM_keymap_find(keyconf, "NLA Editor", SPACE_NLA, 0);
nla_keymap_main(keyconf, keymap);
}
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c
index 0cb48582bc9..b0cd59ea7ad 100644
--- a/source/blender/editors/space_nla/nla_select.c
+++ b/source/blender/editors/space_nla/nla_select.c
@@ -171,7 +171,7 @@ static int nlaedit_deselectall_exec(bContext *C, wmOperator *op)
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
- /* 'standard' behaviour - check if selected, then apply relevant selection */
+ /* 'standard' behavior - check if selected, then apply relevant selection */
if (RNA_boolean_get(op->ptr, "invert"))
deselect_nla_strips(&ac, DESELECT_STRIPS_NOTEST, SELECT_INVERT);
else
@@ -186,16 +186,16 @@ static int nlaedit_deselectall_exec(bContext *C, wmOperator *op)
void NLA_OT_select_all_toggle (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select or Deselect All";
- ot->idname= "NLA_OT_select_all_toggle";
- ot->description= "(De)Select all NLA-Strips";
+ ot->name = "(De)select All";
+ ot->idname = "NLA_OT_select_all_toggle";
+ ot->description = "Select or deselect all NLA-Strips";
/* api callbacks */
- ot->exec= nlaedit_deselectall_exec;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->exec = nlaedit_deselectall_exec;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+ ot->flag = OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
/* props */
RNA_def_boolean(ot->srna, "invert", 0, "Invert", "");
@@ -294,10 +294,10 @@ static int nlaedit_borderselect_exec(bContext *C, wmOperator *op)
deselect_nla_strips(&ac, DESELECT_STRIPS_TEST, SELECT_SUBTRACT);
/* get settings 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");
+ 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");
if (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT)
selectmode = SELECT_ADD;
@@ -308,7 +308,7 @@ static int nlaedit_borderselect_exec(bContext *C, wmOperator *op)
if (RNA_boolean_get(op->ptr, "axis_range")) {
/* mode depends on which axis of the range is larger to determine which axis to use
* - checking this in region-space is fine, as it's fundamentally still going to be a different rect size
- * - the frame-range select option is favoured over the channel one (x over y), as frame-range one is often
+ * - the frame-range select option is favored over the channel one (x over y), as frame-range one is often
* used for tweaking timing when "blocking", while channels is not that useful...
*/
if ((rect.xmax - rect.xmin) >= (rect.ymax - rect.ymin))
@@ -331,20 +331,20 @@ static int nlaedit_borderselect_exec(bContext *C, wmOperator *op)
void NLA_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Border Select";
- ot->idname= "NLA_OT_select_border";
- ot->description= "Use box selection to grab NLA-Strips";
+ ot->name = "Border Select";
+ ot->idname = "NLA_OT_select_border";
+ ot->description = "Use box selection to grab NLA-Strips";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= nlaedit_borderselect_exec;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = nlaedit_borderselect_exec;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= nlaop_poll_tweakmode_off;
+ ot->poll = nlaop_poll_tweakmode_off;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
WM_operator_properties_gesture_border(ot, 1);
@@ -484,20 +484,20 @@ static int nlaedit_select_leftright_invoke (bContext *C, wmOperator *op, wmEvent
void NLA_OT_select_leftright (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Left/Right";
- ot->idname= "NLA_OT_select_leftright";
- ot->description= "Select strips to the left or the right of the current frame";
+ ot->name = "Select Left/Right";
+ ot->idname = "NLA_OT_select_leftright";
+ ot->description = "Select strips to the left or the right of the current frame";
/* api callbacks */
- ot->invoke= nlaedit_select_leftright_invoke;
- ot->exec= nlaedit_select_leftright_exec;
- ot->poll= ED_operator_nla_active;
+ ot->invoke = nlaedit_select_leftright_invoke;
+ ot->exec = nlaedit_select_leftright_exec;
+ ot->poll = ED_operator_nla_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- ot->prop= RNA_def_enum(ot->srna, "mode", prop_nlaedit_leftright_select_types, NLAEDIT_LRSEL_TEST, "Mode", "");
+ ot->prop = RNA_def_enum(ot->srna, "mode", prop_nlaedit_leftright_select_types, NLAEDIT_LRSEL_TEST, "Mode", "");
RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", "");
}
@@ -538,7 +538,7 @@ static void mouse_nla_strips (bContext *C, bAnimContext *ac, const int mval[2],
ale= BLI_findlink(&anim_data, channel_index);
if (ale == NULL) {
/* channel not found */
- printf("Error: animation channel (index = %d) not found in mouse_nla_strips() \n", channel_index);
+ printf("Error: animation channel (index = %d) not found in mouse_nla_strips()\n", channel_index);
BLI_freelistN(&anim_data);
return;
}
@@ -646,16 +646,16 @@ static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even
void NLA_OT_click_select (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mouse Select";
- ot->idname= "NLA_OT_click_select";
- ot->description= "Handle clicks to select NLA Strips";
+ ot->name = "Mouse Select";
+ ot->idname = "NLA_OT_click_select";
+ ot->description = "Handle clicks to select NLA Strips";
/* api callbacks - absolutely no exec() this yet... */
- ot->invoke= nlaedit_clickselect_invoke;
- ot->poll= ED_operator_nla_active;
+ ot->invoke = nlaedit_clickselect_invoke;
+ ot->poll = ED_operator_nla_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", ""); // SHIFTKEY
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
index 48859acff6a..4dc3aef7d2c 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -69,7 +69,7 @@ ARegion *nla_has_buttons_region(ScrArea *sa)
ARegion *ar, *arnew;
ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
- if(ar) return ar;
+ if (ar) return ar;
/* add subdiv level; after main */
ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
@@ -140,10 +140,10 @@ static SpaceLink *nla_new(const bContext *C)
BLI_addtail(&snla->regionbase, ar);
ar->regiontype= RGN_TYPE_WINDOW;
- ar->v2d.tot.xmin= (float)(SFRA-10);
- ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f;
- ar->v2d.tot.xmax= (float)(EFRA+10);
- ar->v2d.tot.ymax= 0.0f;
+ ar->v2d.tot.xmin = (float)(SFRA-10);
+ ar->v2d.tot.ymin = (float)(-sa->winy)/3.0f;
+ ar->v2d.tot.xmax = (float)(EFRA+10);
+ ar->v2d.tot.ymax = 0.0f;
ar->v2d.cur = ar->v2d.tot;
@@ -210,13 +210,13 @@ static void nla_channel_area_init(wmWindowManager *wm, ARegion *ar)
/* own keymap */
/* own channels map first to override some channel keymaps */
- keymap= WM_keymap_find(wm->defaultconf, "NLA Channels", SPACE_NLA, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "NLA Channels", SPACE_NLA, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* now generic channels map for everything else that can apply */
- keymap= WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap= WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -256,9 +256,9 @@ static void nla_main_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "NLA Editor", SPACE_NLA, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "NLA Editor", SPACE_NLA, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap= WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -336,7 +336,7 @@ static void nla_buttons_area_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap= WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -371,7 +371,7 @@ static void nla_region_listener(ARegion *ar, wmNotifier *wmn)
}
break;
default:
- if(wmn->data==ND_KEYS)
+ if (wmn->data==ND_KEYS)
ED_region_tag_redraw(ar);
break;
}
@@ -413,11 +413,11 @@ static void nla_main_area_listener(ARegion *ar, wmNotifier *wmn)
}
break;
case NC_ID:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
default:
- if(wmn->data==ND_KEYS)
+ if (wmn->data==ND_KEYS)
ED_region_tag_redraw(ar);
}
}
@@ -446,12 +446,12 @@ static void nla_channel_area_listener(ARegion *ar, wmNotifier *wmn)
}
break;
case NC_ID:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
default:
- if(wmn->data==ND_KEYS)
+ if (wmn->data==ND_KEYS)
ED_region_tag_redraw(ar);
}
}
@@ -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:
@@ -485,7 +487,7 @@ static void nla_listener(ScrArea *sa, wmNotifier *wmn)
}
break;
case NC_SPACE:
- if(wmn->data == ND_SPACE_NLA)
+ if (wmn->data == ND_SPACE_NLA)
ED_area_tag_redraw(sa);
break;
}
diff --git a/source/blender/editors/space_node/CMakeLists.txt b/source/blender/editors/space_node/CMakeLists.txt
index f33b784c5d2..8c3397b9ddd 100644
--- a/source/blender/editors/space_node/CMakeLists.txt
+++ b/source/blender/editors/space_node/CMakeLists.txt
@@ -54,4 +54,8 @@ set(SRC
node_intern.h
)
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_editor_space_node "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/space_node/SConscript b/source/blender/editors/space_node/SConscript
index ec4ed971a76..58fae203cf5 100644
--- a/source/blender/editors/space_node/SConscript
+++ b/source/blender/editors/space_node/SConscript
@@ -14,7 +14,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
if env['CC'] == 'gcc':
#cf.append('-Werror')
pass
-
+
if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
@@ -22,4 +22,7 @@ if env['OURPLATFORM'] == 'linux':
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
env.BlenderLib ( 'bf_editors_space_node', sources, Split(incs), defs, libtype=['core'], priority=[55], compileflags=cf )
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index a58e03be237..7176c86cb11 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -79,17 +79,13 @@
#include "node_intern.h"
-
-// XXX interface.h
-extern void ui_dropshadow(rctf *rct, float radius, float aspect, int select);
-
/* ****************** SOCKET BUTTON DRAW FUNCTIONS ***************** */
static void node_sync_cb(bContext *UNUSED(C), void *snode_v, void *node_v)
{
SpaceNode *snode= snode_v;
- if(snode->treetype==NTREE_SHADER) {
+ if (snode->treetype==NTREE_SHADER) {
nodeShaderSynchronizeID(node_v, 1);
// allqueue(REDRAWBUTSSHADING, 0);
}
@@ -102,24 +98,71 @@ static void node_socket_button_label(const bContext *UNUSED(C), uiBlock *block,
uiDefBut(block, LABEL, 0, sock->name, x, y, width, NODE_DY, NULL, 0, 0, 0, 0, "");
}
+/* draw function for file output node sockets.
+ * XXX a bit ugly use atm, called from datatype button functions,
+ * since all node types and callbacks only use data type without struct_type.
+ */
+static void node_socket_button_output_file(const bContext *C, uiBlock *block,
+ bNodeTree *ntree, bNode *node, bNodeSocket *sock,
+ const char *UNUSED(name), int x, int y, int width)
+{
+ uiLayout *layout, *row;
+ PointerRNA nodeptr, sockptr, imfptr;
+ int imtype;
+ int rx, ry;
+ RNA_pointer_create(&ntree->id, &RNA_Node, node, &nodeptr);
+ RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &sockptr);
+
+ layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, x, y+NODE_DY, width, 20, UI_GetStyle());
+ row = uiLayoutRow(layout, 0);
+
+ uiItemL(row, sock->name, 0);
+
+ imfptr = RNA_pointer_get(&nodeptr, "format");
+ imtype = RNA_enum_get(&imfptr, "file_format");
+ /* in multilayer format all socket format details are ignored */
+ if (imtype != R_IMF_IMTYPE_MULTILAYER) {
+ PropertyRNA *imtype_prop;
+ const char *imtype_name;
+
+ if (!RNA_boolean_get(&sockptr, "use_node_format"))
+ imfptr = RNA_pointer_get(&sockptr, "format");
+
+ imtype_prop = RNA_struct_find_property(&imfptr, "file_format");
+ RNA_property_enum_name((bContext*)C, &imfptr, imtype_prop, RNA_property_enum_get(&imfptr, imtype_prop), &imtype_name);
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+ uiItemL(row, imtype_name, 0);
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+ }
+
+ uiBlockLayoutResolve(block, &rx, &ry);
+}
static void node_socket_button_default(const bContext *C, uiBlock *block,
bNodeTree *ntree, bNode *node, bNodeSocket *sock,
const char *name, int x, int y, int width)
{
- if (sock->link || (sock->flag & SOCK_HIDE_VALUE))
- node_socket_button_label(C, block, ntree, node, sock, name, x, y, width);
- else {
- PointerRNA ptr;
- uiBut *bt;
-
- RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr);
-
- bt = uiDefButR(block, NUM, B_NODE_EXEC, name,
- x, y+1, width, NODE_DY-2,
- &ptr, "default_value", 0, 0, 0, -1, -1, NULL);
- if (node)
- uiButSetFunc(bt, node_sync_cb, CTX_wm_space_node(C), node);
+ switch (sock->struct_type) {
+ case SOCK_STRUCT_NONE: {
+ if (sock->link || (sock->flag & SOCK_HIDE_VALUE))
+ node_socket_button_label(C, block, ntree, node, sock, name, x, y, width);
+ else {
+ PointerRNA ptr;
+ uiBut *bt;
+
+ RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr);
+
+ bt = uiDefButR(block, NUM, B_NODE_EXEC, name,
+ x, y+1, width, NODE_DY-2,
+ &ptr, "default_value", 0, 0, 0, -1, -1, NULL);
+ if (node)
+ uiButSetFunc(bt, node_sync_cb, CTX_wm_space_node(C), node);
+ }
+ break;
+ }
+ case SOCK_STRUCT_OUTPUT_FILE:
+ node_socket_button_output_file(C, block, ntree, node, sock, name, x, y, width);
+ break;
}
}
@@ -149,25 +192,33 @@ static void node_socket_button_components(const bContext *C, uiBlock *block,
bNodeTree *ntree, bNode *node, bNodeSocket *sock,
const char *name, int x, int y, int width)
{
- if (sock->link || (sock->flag & SOCK_HIDE_VALUE))
- node_socket_button_label(C, block, ntree, node, sock, name, x, y, width);
- else {
- PointerRNA ptr;
- SocketComponentMenuArgs *args;
-
- RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr);
-
- args= MEM_callocN(sizeof(SocketComponentMenuArgs), "SocketComponentMenuArgs");
-
- args->ptr = ptr;
- args->x = x;
- args->y = y;
- args->width = width;
- args->cb = node_sync_cb;
- args->arg1 = CTX_wm_space_node(C);
- args->arg2 = node;
-
- uiDefBlockButN(block, socket_component_menu, args, name, x, y+1, width, NODE_DY-2, "");
+ switch (sock->struct_type) {
+ case SOCK_STRUCT_NONE: {
+ if (sock->link || (sock->flag & SOCK_HIDE_VALUE))
+ node_socket_button_label(C, block, ntree, node, sock, name, x, y, width);
+ else {
+ PointerRNA ptr;
+ SocketComponentMenuArgs *args;
+
+ RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr);
+
+ args= MEM_callocN(sizeof(SocketComponentMenuArgs), "SocketComponentMenuArgs");
+
+ args->ptr = ptr;
+ args->x = x;
+ args->y = y;
+ args->width = width;
+ args->cb = node_sync_cb;
+ args->arg1 = CTX_wm_space_node(C);
+ args->arg2 = node;
+
+ uiDefBlockButN(block, socket_component_menu, args, name, x, y+1, width, NODE_DY-2, "");
+ }
+ break;
+ }
+ case SOCK_STRUCT_OUTPUT_FILE:
+ node_socket_button_output_file(C, block, ntree, node, sock, name, x, y, width);
+ break;
}
}
@@ -200,29 +251,10 @@ static void node_socket_button_color(const bContext *C, uiBlock *block,
}
break;
}
- case SOCK_STRUCT_OUTPUT_MULTI_FILE: {
- uiLayout *layout, *row;
- PointerRNA ptr, imfptr;
- PropertyRNA *imtype_prop;
- const char *imtype_name;
- int rx, ry;
- RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr);
- imfptr = RNA_pointer_get(&ptr, "format");
-
- layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, x, y+NODE_DY, width, 20, UI_GetStyle());
- row = uiLayoutRow(layout, 0);
-
- uiItemL(row, sock->name, 0);
- imtype_prop = RNA_struct_find_property(&imfptr, "file_format");
- RNA_property_enum_name((bContext*)C, &imfptr, imtype_prop, RNA_property_enum_get(&imfptr, imtype_prop), &imtype_name);
- uiBlockSetEmboss(block, UI_EMBOSSP);
- uiItemL(row, imtype_name, 0);
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- uiBlockLayoutResolve(block, &rx, &ry);
+ case SOCK_STRUCT_OUTPUT_FILE:
+ node_socket_button_output_file(C, block, ntree, node, sock, name, x, y, width);
break;
}
- }
}
/* ****************** BASE DRAW FUNCTIONS FOR NEW OPERATOR NODES ***************** */
@@ -251,7 +283,7 @@ static void node_draw_socket_new(bNodeSocket *sock, float size)
glColor3ub(180, 180, 180);
glBegin(GL_POLYGON);
- for(a=0; a<16; a++)
+ for (a=0; a<16; a++)
glVertex2f(x+size*si[a], y+size*co[a]);
glEnd();
@@ -259,7 +291,7 @@ static void node_draw_socket_new(bNodeSocket *sock, float size)
glEnable(GL_BLEND);
glEnable( GL_LINE_SMOOTH );
glBegin(GL_LINE_LOOP);
- for(a=0; a<16; a++)
+ for (a=0; a<16; a++)
glVertex2f(x+size*si[a], y+size*co[a]);
glEnd();
glDisable( GL_LINE_SMOOTH );
@@ -304,7 +336,7 @@ static void node_buts_mix_rgb(uiLayout *layout, bContext *UNUSED(C), PointerRNA
row= uiLayoutRow(layout, 1);
uiItemR(row, ptr, "blend_type", 0, "", ICON_NONE);
- if(ntree->type == NTREE_COMPOSIT)
+ if (ntree->type == NTREE_COMPOSIT)
uiItemR(row, ptr, "use_alpha", 0, "", ICON_IMAGE_RGB_ALPHA);
}
@@ -316,9 +348,9 @@ static void node_buts_time(uiLayout *layout, bContext *UNUSED(C), PointerRNA *pt
bNode *node= ptr->data;
CurveMapping *cumap= node->storage;
- if(cumap) {
+ if (cumap) {
cumap->flag |= CUMA_DRAW_CFRA;
- if(node->custom1<node->custom2)
+ if (node->custom1<node->custom2)
cumap->sample[0]= (float)(CFRA - node->custom1)/(float)(node->custom2-node->custom1);
}
#endif
@@ -353,7 +385,7 @@ static void node_buts_curvecol(uiLayout *layout, bContext *UNUSED(C), PointerRNA
bNode *node= ptr->data;
CurveMapping *cumap= node->storage;
- if(_sample_col) {
+ if (_sample_col) {
cumap->flag |= CUMA_DRAW_SAMPLE;
copy_v3_v3(cumap->sample, _sample_col);
}
@@ -395,9 +427,9 @@ static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v)
bNode *node= node_v;
Tex *tex;
- if(node->menunr<1) return;
+ if (node->menunr<1) return;
- if(node->id) {
+ if (node->id) {
node->id->us--;
node->id= NULL;
}
@@ -409,7 +441,7 @@ static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v)
nodeSetActive(ntree, node);
- if( ntree->type == NTREE_TEXTURE )
+ if ( ntree->type == NTREE_TEXTURE )
ntreeTexCheckCyclics( ntree );
// allqueue(REDRAWBUTSSHADING, 0);
@@ -464,7 +496,7 @@ static void node_buts_texture(uiLayout *layout, bContext *UNUSED(C), PointerRNA
uiItemR(layout, ptr, "texture", 0, "", ICON_NONE);
- if(multi) {
+ if (multi) {
/* Number Drawing not optimal here, better have a list*/
uiItemR(layout, ptr, "node_output", 0, "", ICON_NONE);
}
@@ -480,15 +512,15 @@ static int node_resize_area_default(bNode *node, int x, int y)
if (node->flag & NODE_HIDDEN) {
rctf totr= node->totr;
/* right part of node */
- totr.xmin= node->totr.xmax-20.0f;
+ totr.xmin = node->totr.xmax-20.0f;
return BLI_in_rctf(&totr, x, y);
}
else {
/* rect we're interested in is just the bottom right corner */
rctf totr= node->totr;
/* bottom right corner */
- totr.xmin= totr.xmax-10.0f;
- totr.ymax= totr.ymin+10.0f;
+ totr.xmin = totr.xmax-10.0f;
+ totr.ymax = totr.ymin+10.0f;
return BLI_in_rctf(&totr, x, y);
}
}
@@ -527,8 +559,8 @@ static void node_update_group(const bContext *C, bNodeTree *ntree, bNode *gnode)
rect->ymin = rect->ymax = locy;
counter= 1;
- for(node= ngroup->nodes.first; node; node= node->next) {
- if(counter) {
+ for (node= ngroup->nodes.first; node; node= node->next) {
+ if (counter) {
*rect= node->totr;
counter= 0;
}
@@ -920,13 +952,13 @@ static void node_update_frame(const bContext *UNUSED(C), bNodeTree *UNUSED(ntree
/* get "global" coords */
nodeSpaceCoords(node, &locx, &locy);
- node->prvr.xmin= locx + NODE_DYS;
- node->prvr.xmax= locx + node->width- NODE_DYS;
+ node->prvr.xmin = locx + NODE_DYS;
+ node->prvr.xmax = locx + node->width- NODE_DYS;
- node->totr.xmin= locx;
- node->totr.xmax= locx + node->width;
- node->totr.ymax= locy;
- node->totr.ymin= locy - node->height;
+ node->totr.xmin = locx;
+ node->totr.xmax = locx + node->width;
+ node->totr.ymax = locy;
+ node->totr.ymin = locy - node->height;
}
static void node_common_set_butfunc(bNodeType *ntype)
@@ -962,9 +994,9 @@ static void node_browse_text_cb(bContext *C, void *ntree_v, void *node_v)
bNode *node= node_v;
/* ID *oldid; */ /* UNUSED */
- if(node->menunr<1) return;
+ if (node->menunr<1) return;
- if(node->id) {
+ if (node->id) {
node->id->us--;
}
/* oldid= node->id; */ /* UNUSED */
@@ -989,7 +1021,7 @@ static void node_shader_buts_material(uiLayout *layout, bContext *C, PointerRNA
uiTemplateID(layout, C, ptr, "material", "MATERIAL_OT_new", NULL, NULL);
- if(!node->id) return;
+ if (!node->id) return;
col= uiLayoutColumn(layout, 0);
uiItemR(col, ptr, "use_diffuse", 0, NULL, ICON_NONE);
@@ -1034,7 +1066,7 @@ static void node_shader_buts_geometry(uiLayout *layout, bContext *C, PointerRNA
col= uiLayoutColumn(layout, 0);
- if(obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) {
+ if (obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) {
PointerRNA dataptr= RNA_pointer_get(&obptr, "data");
uiItemPointerR(col, ptr, "uv_layer", &dataptr, "uv_textures", "", ICON_NONE);
@@ -1057,6 +1089,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);
@@ -1106,7 +1146,7 @@ static void node_shader_buts_dynamic(uiLayout *layout, bContext *C, PointerRNA *
int xoff=0;
/* B_NODE_EXEC is handled in butspace.c do_node_buts */
- if(!node->id) {
+ if (!node->id) {
const char *strp;
IDnames_to_pupstring(&strp, NULL, "", &(bmain->text), NULL, NULL);
node->menunr= 0;
@@ -1115,7 +1155,7 @@ static void node_shader_buts_dynamic(uiLayout *layout, bContext *C, PointerRNA *
&node->menunr, 0, 0, 0, 0, "Browses existing choices");
uiButSetFunc(bt, node_browse_text_cb, ntree, node);
xoff=19;
- if(strp) MEM_freeN((void *)strp);
+ if (strp) MEM_freeN((void *)strp);
}
else {
bt = uiDefBut(block, BUT, B_NOP, "Update",
@@ -1189,7 +1229,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;
@@ -1229,7 +1269,7 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *
uiTemplateID(layout, C, ptr, "image", NULL, "IMAGE_OT_open", NULL);
- if(!node->id) return;
+ if (!node->id) return;
prop = RNA_struct_find_property(ptr, "image");
if (!prop || RNA_property_type(prop) != PROP_POINTER) return;
@@ -1241,7 +1281,7 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *
source= RNA_enum_get(&imaptr, "source");
- if(source == IMA_SRC_SEQUENCE) {
+ if (source == IMA_SRC_SEQUENCE) {
/* don't use iuser->framenr directly because it may not be updated if auto-refresh is off */
Scene *scene= CTX_data_scene(C);
ImageUser *iuser= node->storage;
@@ -1281,7 +1321,7 @@ static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, Point
uiTemplateID(layout, C, ptr, "scene", NULL, NULL, NULL);
- if(!node->id) return;
+ if (!node->id) return;
col= uiLayoutColumn(layout, 0);
row = uiLayoutRow(col, 0);
@@ -1494,12 +1534,13 @@ static void node_composit_buts_crop(uiLayout *layout, bContext *UNUSED(C), Point
uiItemR(layout, ptr, "relative", 0, NULL, ICON_NONE);
col= uiLayoutColumn(layout, 1);
- if (RNA_boolean_get(ptr, "relative")){
+ if (RNA_boolean_get(ptr, "relative")) {
uiItemR(col, ptr, "rel_min_x", 0, "Left", ICON_NONE);
uiItemR(col, ptr, "rel_max_x", 0, "Right", ICON_NONE);
uiItemR(col, ptr, "rel_min_y", 0, "Up", ICON_NONE);
uiItemR(col, ptr, "rel_max_y", 0, "Down", ICON_NONE);
- } else {
+ }
+ else {
uiItemR(col, ptr, "min_x", 0, "Left", ICON_NONE);
uiItemR(col, ptr, "max_x", 0, "Right", ICON_NONE);
uiItemR(col, ptr, "min_y", 0, "Up", ICON_NONE);
@@ -1612,7 +1653,7 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C)
col= uiLayoutColumn(layout, 0);
uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE);
- if(RNA_enum_get(ptr, "limit_method")==0) {
+ if (RNA_enum_get(ptr, "limit_method")==0) {
uiItemL(col, "Limiting Channel:", ICON_NONE);
row=uiLayoutRow(col,0);
uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
@@ -1667,7 +1708,7 @@ static void node_composit_buts_channel_matte(uiLayout *layout, bContext *UNUSED(
col = uiLayoutColumn(layout, 0);
uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE);
- if(RNA_enum_get(ptr, "limit_method")==0) {
+ if (RNA_enum_get(ptr, "limit_method")==0) {
uiItemL(col, "Limiting Channel:", ICON_NONE);
row=uiLayoutRow(col,0);
uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
@@ -1699,56 +1740,54 @@ static void node_composit_buts_id_mask(uiLayout *layout, bContext *UNUSED(C), Po
static void node_composit_buts_file_output(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
- bNode *node= ptr->data;
- NodeImageFile *nif= node->storage;
- PointerRNA imfptr;
-
- uiLayout *row;
-
- uiItemR(layout, ptr, "filepath", 0, "", ICON_NONE);
-
- RNA_pointer_create(NULL, &RNA_ImageFormatSettings, &nif->im_format, &imfptr);
- uiTemplateImageSettings(layout, &imfptr);
-
- row= uiLayoutRow(layout, 1);
- uiItemR(row, ptr, "frame_start", 0, "Start", ICON_NONE);
- uiItemR(row, ptr, "frame_end", 0, "End", ICON_NONE);
-}
-
-static void node_composit_buts_multi_file_output(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
-{
- uiItemL(layout, "Base Path:", 0);
+ PointerRNA imfptr = RNA_pointer_get(ptr, "format");
+ int multilayer = (RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_MULTILAYER);
+
+ if (multilayer)
+ uiItemL(layout, "Path:", 0);
+ else
+ uiItemL(layout, "Base Path:", 0);
uiItemR(layout, ptr, "base_path", 0, "", ICON_NONE);
}
-static void node_composit_buts_multi_file_output_details(uiLayout *layout, bContext *C, PointerRNA *ptr)
+static void node_composit_buts_file_output_details(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
+ PointerRNA imfptr = RNA_pointer_get(ptr, "format");
PointerRNA active_input_ptr = RNA_pointer_get(ptr, "active_input");
+ int multilayer = (RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_MULTILAYER);
- node_composit_buts_multi_file_output(layout, C, ptr);
+ node_composit_buts_file_output(layout, C, ptr);
+ uiTemplateImageSettings(layout, &imfptr);
- uiItemO(layout, "Add Input", ICON_ZOOMIN, "NODE_OT_output_multi_file_add_socket");
+ uiItemS(layout);
+
+ uiItemO(layout, "Add Input", ICON_ZOOMIN, "NODE_OT_output_file_add_socket");
uiTemplateList(layout, C, ptr, "inputs", ptr, "active_input_index", NULL, 0, 0, 0);
if (active_input_ptr.data) {
- PointerRNA imfptr = RNA_pointer_get(&active_input_ptr, "format");
uiLayout *row, *col;
col = uiLayoutColumn(layout, 1);
- uiItemL(col, "File Path:", 0);
+ if (multilayer)
+ uiItemL(col, "Layer Name:", 0);
+ else
+ uiItemL(col, "File Path:", 0);
row = uiLayoutRow(col, 0);
uiItemR(row, &active_input_ptr, "name", 0, "", 0);
- uiItemFullO(row, "NODE_OT_output_multi_file_remove_active_socket", "", ICON_X, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_R_ICON_ONLY);
-
- uiItemS(layout);
+ uiItemFullO(row, "NODE_OT_output_file_remove_active_socket", "", ICON_X, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_R_ICON_ONLY);
- col = uiLayoutColumn(layout, 1);
- uiItemL(col, "Format:", 0);
- uiItemR(col, &active_input_ptr, "use_render_format", 0, NULL, 0);
-
- col= uiLayoutColumn(layout, 0);
- uiLayoutSetActive(col, RNA_boolean_get(&active_input_ptr, "use_render_format")==0);
- uiTemplateImageSettings(col, &imfptr);
+ /* in multilayer format all socket format details are ignored */
+ if (!multilayer) {
+ imfptr = RNA_pointer_get(&active_input_ptr, "format");
+
+ col = uiLayoutColumn(layout, 1);
+ uiItemL(col, "Format:", 0);
+ uiItemR(col, &active_input_ptr, "use_node_format", 0, NULL, 0);
+
+ col= uiLayoutColumn(layout, 0);
+ uiLayoutSetActive(col, RNA_boolean_get(&active_input_ptr, "use_node_format")==0);
+ uiTemplateImageSettings(col, &imfptr);
+ }
}
}
@@ -1805,7 +1844,8 @@ static void node_composit_buts_colorbalance(uiLayout *layout, bContext *UNUSED(C
row = uiLayoutRow(col, 0);
uiItemR(row, ptr, "gain", 0, NULL, ICON_NONE);
- } else {
+ }
+ else {
split = uiLayoutSplit(layout, 0, 0);
col = uiLayoutColumn(split, 0);
@@ -1839,7 +1879,8 @@ static void node_composit_buts_colorbalance_but(uiLayout *layout, bContext *UNUS
uiTemplateColorWheel(layout, ptr, "gain", 1, 1, 1, 1);
uiItemR(layout, ptr, "gain", 0, NULL, ICON_NONE);
- } else {
+ }
+ else {
uiTemplateColorWheel(layout, ptr, "offset", 1, 1, 0, 1);
uiItemR(layout, ptr, "offset", 0, NULL, ICON_NONE);
@@ -1873,7 +1914,7 @@ static void node_composit_buts_stabilize2d(uiLayout *layout, bContext *C, Pointe
uiTemplateID(layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL);
- if(!node->id)
+ if (!node->id)
return;
uiItemR(layout, ptr, "filter_type", 0, "", 0);
@@ -1890,7 +1931,7 @@ static void node_composit_buts_moviedistortion(uiLayout *layout, bContext *C, Po
uiTemplateID(layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL);
- if(!node->id)
+ if (!node->id)
return;
uiItemR(layout, ptr, "distortion_type", 0, "", 0);
@@ -1986,10 +2027,7 @@ static void node_composit_set_butfunc(bNodeType *ntype)
break;
case CMP_NODE_OUTPUT_FILE:
ntype->uifunc= node_composit_buts_file_output;
- break;
- case CMP_NODE_OUTPUT_MULTI_FILE:
- ntype->uifunc= node_composit_buts_multi_file_output;
- ntype->uifuncbut= node_composit_buts_multi_file_output_details;
+ ntype->uifuncbut= node_composit_buts_file_output_details;
break;
case CMP_NODE_DIFF_MATTE:
ntype->uifunc=node_composit_buts_diff_matte;
@@ -2159,7 +2197,7 @@ static void node_texture_buts_proc(uiLayout *layout, bContext *UNUSED(C), Pointe
break;
case TEX_VORONOI:
uiItemR(col, &tex_ptr, "distance_metric", 0, "", ICON_NONE);
- if(tex->vn_distm == TEX_MINKOVSKY) {
+ if (tex->vn_distm == TEX_MINKOVSKY) {
uiItemR(col, &tex_ptr, "minkovsky_exponent", 0, NULL, ICON_NONE);
}
uiItemR(col, &tex_ptr, "color_mode", 0, "", ICON_NONE);
@@ -2181,7 +2219,7 @@ static void node_texture_buts_output(uiLayout *layout, bContext *UNUSED(C), Poin
static void node_texture_set_butfunc(bNodeType *ntype)
{
ntype->uifuncbut = NULL;
- if( ntype->type >= TEX_NODE_PROC && ntype->type < TEX_NODE_PROC_MAX ) {
+ if ( ntype->type >= TEX_NODE_PROC && ntype->type < TEX_NODE_PROC_MAX ) {
ntype->uifunc = node_texture_buts_proc;
}
else switch(ntype->type) {
@@ -2294,11 +2332,11 @@ void ED_init_node_butfuncs(void)
void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage)
{
- if((snode->flag & SNODE_BACKDRAW) && snode->treetype==NTREE_COMPOSIT) {
+ if ((snode->flag & SNODE_BACKDRAW) && snode->treetype==NTREE_COMPOSIT) {
Image *ima= BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node");
void *lock;
ImBuf *ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
- if(ibuf) {
+ if (ibuf) {
float x, y;
glMatrixMode(GL_PROJECTION);
@@ -2307,7 +2345,7 @@ void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage)
glPushMatrix();
/* keep this, saves us from a version patch */
- if(snode->zoom==0.0f) snode->zoom= 1.0f;
+ if (snode->zoom==0.0f) snode->zoom= 1.0f;
/* somehow the offset has to be calculated inverse */
@@ -2318,26 +2356,27 @@ void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage)
x = (ar->winx-snode->zoom*ibuf->x)/2 + snode->xof;
y = (ar->winy-snode->zoom*ibuf->y)/2 + snode->yof;
- if(!ibuf->rect) {
- if(color_manage)
+ if (!ibuf->rect) {
+ if (color_manage)
ibuf->profile = IB_PROFILE_LINEAR_RGB;
else
ibuf->profile = IB_PROFILE_NONE;
IMB_rect_from_float(ibuf);
}
- if(ibuf->rect) {
+ if (ibuf->rect) {
if (snode->flag & SNODE_SHOW_ALPHA) {
glPixelZoom(snode->zoom, snode->zoom);
/* swap bytes, so alpha is most significant one, then just draw it as luminance int */
- if(ENDIAN_ORDER == B_ENDIAN)
+ if (ENDIAN_ORDER == B_ENDIAN)
glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_LUMINANCE, GL_UNSIGNED_INT, ibuf->rect);
glPixelStorei(GL_UNPACK_SWAP_BYTES, 0);
glPixelZoom(1.0f, 1.0f);
- } else if (snode->flag & SNODE_USE_ALPHA) {
+ }
+ else if (snode->flag & SNODE_USE_ALPHA) {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glPixelZoom(snode->zoom, snode->zoom);
@@ -2346,7 +2385,8 @@ void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage)
glPixelZoom(1.0f, 1.0f);
glDisable(GL_BLEND);
- } else {
+ }
+ else {
glPixelZoom(snode->zoom, snode->zoom);
glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
@@ -2372,10 +2412,10 @@ static void draw_nodespace_back_tex(ScrArea *sa, SpaceNode *snode)
draw_nodespace_grid(snode);
- if(snode->flag & SNODE_BACKDRAW) {
+ if (snode->flag & SNODE_BACKDRAW) {
Image *ima= BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node");
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
- if(ibuf) {
+ if (ibuf) {
int x, y;
float zoom = 1.0;
@@ -2386,7 +2426,7 @@ static void draw_nodespace_back_tex(ScrArea *sa, SpaceNode *snode)
glaDefine2DArea(&sa->winrct);
- if(ibuf->x > sa->winx || ibuf->y > sa->winy) {
+ if (ibuf->x > sa->winx || ibuf->y > sa->winy) {
float zoomx, zoomy;
zoomx= (float)sa->winx/ibuf->x;
zoomy= (float)sa->winy/ibuf->y;
@@ -2399,9 +2439,9 @@ static void draw_nodespace_back_tex(ScrArea *sa, SpaceNode *snode)
glPixelZoom(zoom, zoom);
glColor4f(1.0, 1.0, 1.0, 1.0);
- if(ibuf->rect)
+ if (ibuf->rect)
glaDrawPixelsTex(x, y, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, ibuf->rect);
- else if(ibuf->channels==4)
+ else if (ibuf->channels==4)
glaDrawPixelsTex(x, y, ibuf->x, ibuf->y, GL_FLOAT, ibuf->rect_float);
glPixelZoom(1.0, 1.0);
@@ -2421,21 +2461,21 @@ int node_link_bezier_points(View2D *v2d, SpaceNode *snode, bNodeLink *link, floa
float dist, vec[4][2];
/* in v0 and v3 we put begin/end points */
- if(link->fromsock) {
+ if (link->fromsock) {
vec[0][0]= link->fromsock->locx;
vec[0][1]= link->fromsock->locy;
}
else {
- if(snode==NULL) return 0;
+ if (snode==NULL) return 0;
vec[0][0]= snode->mx;
vec[0][1]= snode->my;
}
- if(link->tosock) {
+ if (link->tosock) {
vec[3][0]= link->tosock->locx;
vec[3][1]= link->tosock->locy;
}
else {
- if(snode==NULL) return 0;
+ if (snode==NULL) return 0;
vec[3][0]= snode->mx;
vec[3][1]= snode->my;
}
@@ -2449,7 +2489,7 @@ int node_link_bezier_points(View2D *v2d, SpaceNode *snode, bNodeLink *link, floa
vec[2][0]= vec[3][0]-dist;
vec[2][1]= vec[3][1];
- if(v2d && MIN4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) > v2d->cur.xmax); /* clipped */
+ if (v2d && MIN4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) > v2d->cur.xmax); /* clipped */
else if (v2d && MAX4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) < v2d->cur.xmin); /* clipped */
else {
@@ -2467,7 +2507,7 @@ void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int t
{
float coord_array[LINK_RESOL+1][2];
- if(node_link_bezier_points(v2d, snode, link, coord_array, LINK_RESOL)) {
+ if (node_link_bezier_points(v2d, snode, link, coord_array, LINK_RESOL)) {
float dist, spline_step = 0.0f;
int i;
@@ -2480,12 +2520,12 @@ void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int t
glEnable(GL_LINE_SMOOTH);
- if(do_triple) {
+ if (do_triple) {
UI_ThemeColorShadeAlpha(th_col3, -80, -120);
glLineWidth(4.0f);
glBegin(GL_LINE_STRIP);
- for(i=0; i<=LINK_RESOL; i++) {
+ for (i=0; i<=LINK_RESOL; i++) {
glVertex2fv(coord_array[i]);
}
glEnd();
@@ -2496,9 +2536,9 @@ void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int t
* changing color in begin/end blocks.
*/
glLineWidth(1.5f);
- if(do_shaded) {
+ if (do_shaded) {
glBegin(GL_LINES);
- for(i=0; i<LINK_RESOL; i++) {
+ for (i=0; i<LINK_RESOL; i++) {
UI_ThemeColorBlend(th_col1, th_col2, spline_step);
glVertex2fv(coord_array[i]);
@@ -2512,7 +2552,7 @@ void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int t
else {
UI_ThemeColor(th_col1);
glBegin(GL_LINE_STRIP);
- for(i=0; i<=LINK_RESOL; i++) {
+ for (i=0; i<=LINK_RESOL; i++) {
glVertex2fv(coord_array[i]);
}
glEnd();
@@ -2527,21 +2567,21 @@ void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int t
static void node_link_straight_points(View2D *UNUSED(v2d), SpaceNode *snode, bNodeLink *link, float coord_array[][2])
{
- if(link->fromsock) {
+ if (link->fromsock) {
coord_array[0][0]= link->fromsock->locx;
coord_array[0][1]= link->fromsock->locy;
}
else {
- if(snode==NULL) return;
+ if (snode==NULL) return;
coord_array[0][0]= snode->mx;
coord_array[0][1]= snode->my;
}
- if(link->tosock) {
+ if (link->tosock) {
coord_array[1][0]= link->tosock->locx;
coord_array[1][1]= link->tosock->locy;
}
else {
- if(snode==NULL) return;
+ if (snode==NULL) return;
coord_array[1][0]= snode->mx;
coord_array[1][1]= snode->my;
}
@@ -2560,7 +2600,7 @@ void node_draw_link_straight(View2D *v2d, SpaceNode *snode, bNodeLink *link, int
glEnable(GL_LINE_SMOOTH);
- if(do_triple) {
+ if (do_triple) {
UI_ThemeColorShadeAlpha(th_col3, -80, -120);
glLineWidth(4.0f);
@@ -2577,7 +2617,7 @@ void node_draw_link_straight(View2D *v2d, SpaceNode *snode, bNodeLink *link, int
* for Intel hardware, this breaks with GL_LINE_STRIP and
* changing color in begin/end blocks.
*/
- if(do_shaded) {
+ if (do_shaded) {
glBegin(GL_LINES);
for (i=0; i < LINK_RESOL-1; ++i) {
float t= (float)i/(float)(LINK_RESOL-1);
@@ -2611,38 +2651,38 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link)
int do_shaded= 0, th_col1= TH_HEADER, th_col2= TH_HEADER;
int do_triple= 0, th_col3= TH_WIRE;
- if(link->fromsock==NULL && link->tosock==NULL)
+ if (link->fromsock==NULL && link->tosock==NULL)
return;
/* new connection */
- if(!link->fromsock || !link->tosock) {
+ if (!link->fromsock || !link->tosock) {
th_col1 = TH_ACTIVE;
do_triple = 1;
}
else {
/* going to give issues once... */
- if(link->tosock->flag & SOCK_UNAVAIL)
+ if (link->tosock->flag & SOCK_UNAVAIL)
return;
- if(link->fromsock->flag & SOCK_UNAVAIL)
+ if (link->fromsock->flag & SOCK_UNAVAIL)
return;
/* a bit ugly... but thats how we detect the internal group links */
- if(!link->fromnode || !link->tonode) {
+ if (!link->fromnode || !link->tonode) {
UI_ThemeColorBlend(TH_BACK, TH_WIRE, 0.5f);
do_shaded= 0;
}
else {
/* check cyclic */
- if((link->fromnode->level >= link->tonode->level && link->tonode->level!=0xFFF) && (link->flag & NODE_LINK_VALID)) {
+ if ((link->fromnode->level >= link->tonode->level && link->tonode->level!=0xFFF) && (link->flag & NODE_LINK_VALID)) {
/* special indicated link, on drop-node */
- if(link->flag & NODE_LINKFLAG_HILITE) {
+ if (link->flag & NODE_LINKFLAG_HILITE) {
th_col1= th_col2= TH_ACTIVE;
}
else {
/* regular link */
- if(link->fromnode->flag & SELECT)
+ if (link->fromnode->flag & SELECT)
th_col1= TH_EDGE_SELECT;
- if(link->tonode->flag & SELECT)
+ if (link->tonode->flag & SELECT)
th_col2= TH_EDGE_SELECT;
}
do_shaded= 1;
diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c
index 1b5f2417384..dac185bf46e 100644
--- a/source/blender/editors/space_node/node_buttons.c
+++ b/source/blender/editors/space_node/node_buttons.c
@@ -98,7 +98,7 @@ static void active_node_panel(const bContext *C, Panel *pa)
PointerRNA ptr;
/* verify pointers, and create RNA pointer for the node */
- if ELEM(NULL, ntree, node)
+ if (ELEM(NULL, ntree, node))
return;
//if (node->id) /* for group nodes */
// RNA_pointer_create(node->id, &RNA_Node, node, &ptr);
@@ -142,10 +142,10 @@ static void node_sockets_panel(const bContext *C, Panel *pa)
uiLayout *layout= pa->layout, *split;
char name[UI_MAX_NAME_STR];
- if(ELEM(NULL, ntree, node))
+ if (ELEM(NULL, ntree, node))
return;
- for(sock=node->inputs.first; sock; sock=sock->next) {
+ for (sock=node->inputs.first; sock; sock=sock->next) {
BLI_snprintf(name, sizeof(name), "%s:", sock->name);
split = uiLayoutSplit(layout, 0.35f, 0);
@@ -187,7 +187,7 @@ static int node_properties(bContext *C, wmOperator *UNUSED(op))
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= node_has_buttons_region(sa);
- if(ar)
+ if (ar)
ED_region_toggle_hidden(C, ar);
return OPERATOR_FINISHED;
@@ -202,13 +202,13 @@ static int node_properties_poll(bContext *C)
void NODE_OT_properties(wmOperatorType *ot)
{
- ot->name= "Properties";
- ot->description= "Toggles the properties panel display";
- ot->idname= "NODE_OT_properties";
+ ot->name = "Properties";
+ ot->description = "Toggles the properties panel display";
+ ot->idname = "NODE_OT_properties";
- ot->exec= node_properties;
- ot->poll= node_properties_poll;
+ ot->exec = node_properties;
+ ot->poll = node_properties_poll;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 5b35352417c..23b700e5b64 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -49,6 +49,8 @@
#include "BLI_threads.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_main.h"
@@ -88,7 +90,7 @@ void ED_node_tree_update(SpaceNode *snode, Scene *scene)
{
snode_set_context(snode, scene);
- if(snode->nodetree && snode->nodetree->id.us==0)
+ if (snode->nodetree && snode->nodetree->id.us==0)
snode->nodetree->id.us= 1;
}
@@ -99,28 +101,28 @@ void ED_node_changed_update(ID *id, bNode *node)
node_tree_from_ID(id, &nodetree, &edittree, &treetype);
- if(treetype==NTREE_SHADER) {
+ if (treetype==NTREE_SHADER) {
DAG_id_tag_update(id, 0);
- if(GS(id->name) == ID_MA)
+ if (GS(id->name) == ID_MA)
WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, id);
- else if(GS(id->name) == ID_LA)
+ else if (GS(id->name) == ID_LA)
WM_main_add_notifier(NC_LAMP|ND_LIGHTING_DRAW, id);
- else if(GS(id->name) == ID_WO)
+ else if (GS(id->name) == ID_WO)
WM_main_add_notifier(NC_WORLD|ND_WORLD_DRAW, id);
}
- else if(treetype==NTREE_COMPOSIT) {
- if(node)
+ else if (treetype==NTREE_COMPOSIT) {
+ if (node)
nodeUpdate(edittree, node);
/* don't use NodeTagIDChanged, it gives far too many recomposites for image, scene layers, ... */
node= node_tree_get_editgroup(nodetree);
- if(node)
+ if (node)
nodeUpdateID(nodetree, node->id);
WM_main_add_notifier(NC_SCENE|ND_NODES, id);
}
- else if(treetype==NTREE_TEXTURE) {
+ else if (treetype==NTREE_TEXTURE) {
DAG_id_tag_update(id, 0);
WM_main_add_notifier(NC_TEXTURE|ND_NODES, id);
}
@@ -130,12 +132,12 @@ static int has_nodetree(bNodeTree *ntree, bNodeTree *lookup)
{
bNode *node;
- if(ntree == lookup)
+ if (ntree == lookup)
return 1;
- for(node=ntree->nodes.first; node; node=node->next)
- if(node->type == NODE_GROUP && node->id)
- if(has_nodetree((bNodeTree*)node->id, lookup))
+ for (node=ntree->nodes.first; node; node=node->next)
+ if (node->type == NODE_GROUP && node->id)
+ if (has_nodetree((bNodeTree*)node->id, lookup))
return 1;
return 0;
@@ -161,15 +163,15 @@ void ED_node_generic_update(Main *bmain, bNodeTree *ntree, bNode *node)
/* look through all datablocks, to support groups */
tti->foreach_nodetree(bmain, &cd, node_generic_update_cb);
- if(ntree->type == NTREE_TEXTURE)
+ if (ntree->type == NTREE_TEXTURE)
ntreeTexCheckCyclics(ntree);
}
static void do_node_internal_buttons(bContext *C, void *node_v, int event)
{
- if(event==B_NODE_EXEC) {
+ if (event==B_NODE_EXEC) {
SpaceNode *snode= CTX_wm_space_node(C);
- if(snode && snode->id)
+ if (snode && snode->id)
ED_node_changed_update(snode->id, node_v);
}
}
@@ -228,41 +230,41 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
dy-= NODE_DY;
/* little bit space in top */
- if(node->outputs.first)
+ if (node->outputs.first)
dy-= NODE_DYS/2;
/* output sockets */
- for(nsock= node->outputs.first; nsock; nsock= nsock->next) {
- if(!nodeSocketIsHidden(nsock)) {
+ for (nsock= node->outputs.first; nsock; nsock= nsock->next) {
+ if (!nodeSocketIsHidden(nsock)) {
nsock->locx= locx + node->width;
nsock->locy= dy - NODE_DYS;
dy-= NODE_DY;
}
}
- node->prvr.xmin= locx + NODE_DYS;
- node->prvr.xmax= locx + node->width- NODE_DYS;
+ node->prvr.xmin = locx + NODE_DYS;
+ node->prvr.xmax = locx + node->width- NODE_DYS;
/* preview rect? */
- if(node->flag & NODE_PREVIEW) {
+ if (node->flag & NODE_PREVIEW) {
/* only recalculate size when there's a preview actually, otherwise we use stored result */
BLI_lock_thread(LOCK_PREVIEW);
- if(node->preview && node->preview->rect) {
+ if (node->preview && node->preview->rect) {
float aspect= 1.0f;
- if(node->preview && node->preview->xsize && node->preview->ysize)
+ if (node->preview && node->preview->xsize && node->preview->ysize)
aspect= (float)node->preview->ysize/(float)node->preview->xsize;
dy-= NODE_DYS/2;
- node->prvr.ymax= dy;
+ node->prvr.ymax = dy;
- if(aspect <= 1.0f)
- node->prvr.ymin= dy - aspect*(node->width-NODE_DY);
+ if (aspect <= 1.0f)
+ node->prvr.ymin = dy - aspect*(node->width-NODE_DY);
else {
float dx= (node->width - NODE_DYS) - (node->width- NODE_DYS)/aspect; /* width correction of image */
- node->prvr.ymin= dy - (node->width-NODE_DY);
+ node->prvr.ymin = dy - (node->width-NODE_DY);
node->prvr.xmin+= 0.5f*dx;
node->prvr.xmax-= 0.5f*dx;
@@ -271,16 +273,16 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
dy= node->prvr.ymin - NODE_DYS/2;
/* make sure that maximums are bigger or equal to minimums */
- if(node->prvr.xmax < node->prvr.xmin) SWAP(float, node->prvr.xmax, node->prvr.xmin);
- if(node->prvr.ymax < node->prvr.ymin) SWAP(float, node->prvr.ymax, node->prvr.ymin);
+ if (node->prvr.xmax < node->prvr.xmin) SWAP(float, node->prvr.xmax, node->prvr.xmin);
+ if (node->prvr.ymax < node->prvr.ymin) SWAP(float, node->prvr.ymax, node->prvr.ymin);
}
else {
float oldh= node->prvr.ymax - node->prvr.ymin;
- if(oldh==0.0f)
+ if (oldh==0.0f)
oldh= 0.6f*node->width-NODE_DY;
dy-= NODE_DYS/2;
- node->prvr.ymax= dy;
- node->prvr.ymin= dy - oldh;
+ node->prvr.ymax = dy;
+ node->prvr.ymin = dy - oldh;
dy= node->prvr.ymin - NODE_DYS/2;
}
@@ -288,14 +290,14 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
}
/* buttons rect? */
- if((node->flag & NODE_OPTIONS) && node->typeinfo->uifunc) {
+ if ((node->flag & NODE_OPTIONS) && node->typeinfo->uifunc) {
dy-= NODE_DYS/2;
/* set this for uifunc() that don't use layout engine yet */
- node->butr.xmin= 0;
- node->butr.xmax= node->width - 2*NODE_DYS;
- node->butr.ymin= 0;
- node->butr.ymax= 0;
+ node->butr.xmin = 0;
+ node->butr.xmax = node->width - 2*NODE_DYS;
+ node->butr.ymin = 0;
+ node->butr.ymax = 0;
RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr);
@@ -311,8 +313,8 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
}
/* input sockets */
- for(nsock= node->inputs.first; nsock; nsock= nsock->next) {
- if(!nodeSocketIsHidden(nsock)) {
+ for (nsock= node->inputs.first; nsock; nsock= nsock->next) {
+ if (!nodeSocketIsHidden(nsock)) {
nsock->locx= locx;
nsock->locy= dy - NODE_DYS;
dy-= NODE_DY;
@@ -320,13 +322,13 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
}
/* little bit space in end */
- if(node->inputs.first || (node->flag & (NODE_OPTIONS|NODE_PREVIEW))==0 )
+ if (node->inputs.first || (node->flag & (NODE_OPTIONS|NODE_PREVIEW))==0 )
dy-= NODE_DYS/2;
- node->totr.xmin= locx;
- node->totr.xmax= locx + node->width;
- node->totr.ymax= locy;
- node->totr.ymin= MIN2(dy, locy-2*NODE_DY);
+ node->totr.xmin = locx;
+ node->totr.xmax = locx + node->width;
+ node->totr.ymax = locy;
+ node->totr.ymin = MIN2(dy, locy-2*NODE_DY);
/* Set the block bounds to clip mouse events from underlying nodes.
* Add a margin for sockets on each side.
@@ -350,28 +352,28 @@ static void node_update_hidden(bNode *node)
nodeSpaceCoords(node, &locx, &locy);
/* calculate minimal radius */
- for(nsock= node->inputs.first; nsock; nsock= nsock->next)
- if(!nodeSocketIsHidden(nsock))
+ for (nsock= node->inputs.first; nsock; nsock= nsock->next)
+ if (!nodeSocketIsHidden(nsock))
totin++;
- for(nsock= node->outputs.first; nsock; nsock= nsock->next)
- if(!nodeSocketIsHidden(nsock))
+ for (nsock= node->outputs.first; nsock; nsock= nsock->next)
+ if (!nodeSocketIsHidden(nsock))
totout++;
tot= MAX2(totin, totout);
- if(tot>4) {
+ if (tot>4) {
hiddenrad += 5.0f*(float)(tot-4);
}
- node->totr.xmin= locx;
- node->totr.xmax= locx + 3*hiddenrad + node->miniwidth;
- node->totr.ymax= locy + (hiddenrad - 0.5f*NODE_DY);
- node->totr.ymin= node->totr.ymax - 2*hiddenrad;
+ node->totr.xmin = locx;
+ node->totr.xmax = locx + 3*hiddenrad + node->miniwidth;
+ node->totr.ymax = locy + (hiddenrad - 0.5f*NODE_DY);
+ node->totr.ymin = node->totr.ymax - 2*hiddenrad;
/* output sockets */
rad=drad= (float)M_PI/(1.0f + (float)totout);
- for(nsock= node->outputs.first; nsock; nsock= nsock->next) {
- if(!nodeSocketIsHidden(nsock)) {
+ for (nsock= node->outputs.first; nsock; nsock= nsock->next) {
+ if (!nodeSocketIsHidden(nsock)) {
nsock->locx= node->totr.xmax - hiddenrad + (float)sin(rad)*hiddenrad;
nsock->locy= node->totr.ymin + hiddenrad + (float)cos(rad)*hiddenrad;
rad+= drad;
@@ -381,8 +383,8 @@ static void node_update_hidden(bNode *node)
/* input sockets */
rad=drad= - (float)M_PI/(1.0f + (float)totin);
- for(nsock= node->inputs.first; nsock; nsock= nsock->next) {
- if(!nodeSocketIsHidden(nsock)) {
+ for (nsock= node->inputs.first; nsock; nsock= nsock->next) {
+ if (!nodeSocketIsHidden(nsock)) {
nsock->locx= node->totr.xmin + hiddenrad + (float)sin(rad)*hiddenrad;
nsock->locy= node->totr.ymin + hiddenrad + (float)cos(rad)*hiddenrad;
rad+= drad;
@@ -401,7 +403,7 @@ static void node_update_hidden(bNode *node)
void node_update_default(const bContext *C, bNodeTree *ntree, bNode *node)
{
- if(node->flag & NODE_HIDDEN)
+ if (node->flag & NODE_HIDDEN)
node_update_hidden(node);
else
node_update_basis(C, ntree, node);
@@ -409,19 +411,19 @@ void node_update_default(const bContext *C, bNodeTree *ntree, bNode *node)
static int node_get_colorid(bNode *node)
{
- if(node->typeinfo->nclass==NODE_CLASS_INPUT)
+ if (node->typeinfo->nclass==NODE_CLASS_INPUT)
return TH_NODE_IN_OUT;
- if(node->typeinfo->nclass==NODE_CLASS_OUTPUT) {
- if(node->flag & NODE_DO_OUTPUT)
+ if (node->typeinfo->nclass==NODE_CLASS_OUTPUT) {
+ if (node->flag & NODE_DO_OUTPUT)
return TH_NODE_IN_OUT;
else
return TH_NODE;
}
- if(node->typeinfo->nclass==NODE_CLASS_CONVERTOR)
+ if (node->typeinfo->nclass==NODE_CLASS_CONVERTOR)
return TH_NODE_CONVERTOR;
- if(ELEM3(node->typeinfo->nclass, NODE_CLASS_OP_COLOR, NODE_CLASS_OP_VECTOR, NODE_CLASS_OP_FILTER))
+ if (ELEM3(node->typeinfo->nclass, NODE_CLASS_OP_COLOR, NODE_CLASS_OP_VECTOR, NODE_CLASS_OP_FILTER))
return TH_NODE_OPERATOR;
- if(node->typeinfo->nclass==NODE_CLASS_GROUP)
+ if (node->typeinfo->nclass==NODE_CLASS_GROUP)
return TH_NODE_GROUP;
return TH_NODE;
}
@@ -434,7 +436,7 @@ static void node_draw_mute_line(View2D *v2d, SpaceNode *snode, bNode *node)
ListBase links;
bNodeLink *link;
- if(node->typeinfo->internal_connect == NULL)
+ if (node->typeinfo->internal_connect == NULL)
return;
/* Get default muting links. */
@@ -443,7 +445,7 @@ static void node_draw_mute_line(View2D *v2d, SpaceNode *snode, bNode *node)
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
- for(link = links.first; link; link = link->next)
+ for (link = links.first; link; link = link->next)
node_draw_link_bezier(v2d, snode, link, TH_REDALERT, 0, TH_WIRE, 0, TH_WIRE);
glDisable(GL_BLEND);
@@ -453,7 +455,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] = {
@@ -474,25 +476,32 @@ static void node_circle_draw(float x, float y, float size, char *col)
glColor3ub(col[0], col[1], col[2]);
glBegin(GL_POLYGON);
- for(a=0; a<16; a++)
+ for (a=0; a<16; a++)
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);
- for(a=0; a<16; a++)
+ for (a=0; a<16; a++)
glVertex2f(x+size*si[a], y+size*co[a]);
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 *********** */
@@ -510,25 +519,25 @@ static void node_draw_preview(bNodePreview *preview, rctf *prv)
glRectf(prv->xmin, prv->ymin, prv->xmax, prv->ymax);
glColor3ub(160, 160, 160);
- for(y=prv->ymin; y<prv->ymax; y+=tile*2) {
- for(x=prv->xmin; x<prv->xmax; x+=tile*2) {
+ for (y=prv->ymin; y<prv->ymax; y+=tile*2) {
+ for (x=prv->xmin; x<prv->xmax; x+=tile*2) {
float tilex= tile, tiley= tile;
- if(x+tile > prv->xmax)
+ if (x+tile > prv->xmax)
tilex= prv->xmax-x;
- if(y+tile > prv->ymax)
+ if (y+tile > prv->ymax)
tiley= prv->ymax-y;
glRectf(x, y, x + tilex, y + tiley);
}
}
- for(y=prv->ymin+tile; y<prv->ymax; y+=tile*2) {
- for(x=prv->xmin+tile; x<prv->xmax; x+=tile*2) {
+ for (y=prv->ymin+tile; y<prv->ymax; y+=tile*2) {
+ for (x=prv->xmin+tile; x<prv->xmax; x+=tile*2) {
float tilex= tile, tiley= tile;
- if(x+tile > prv->xmax)
+ if (x+tile > prv->xmax)
tilex= prv->xmax-x;
- if(y+tile > prv->ymax)
+ if (y+tile > prv->ymax)
tiley= prv->ymax-y;
glRectf(x, y, x + tilex, y + tiley);
@@ -575,7 +584,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
View2D *v2d = &ar->v2d;
/* hurmf... another candidate for callback, have to see how this works first */
- if(node->id && node->block && snode->treetype==NTREE_SHADER)
+ if (node->id && node->block && snode->treetype==NTREE_SHADER)
nodeShaderSynchronizeID(node, 0);
/* skip if out of view */
@@ -591,12 +600,12 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
ui_dropshadow(rct, BASIS_RAD, snode->aspect, node->flag & SELECT);
/* header */
- if(color_id==TH_NODE)
+ if (color_id==TH_NODE)
UI_ThemeColorShade(color_id, -20);
else
UI_ThemeColor(color_id);
- if(node->flag & NODE_MUTED)
+ if (node->flag & NODE_MUTED)
UI_ThemeColorBlend(color_id, TH_REDALERT, 0.5f);
uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
@@ -606,7 +615,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
iconofs= rct->xmax - 7.0f;
/* preview */
- if(node->typeinfo->flag & NODE_PREVIEW) {
+ if (node->typeinfo->flag & NODE_PREVIEW) {
uiBut *but;
iconofs-=iconbutw;
uiBlockSetEmboss(node->block, UI_EMBOSSN);
@@ -622,7 +631,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
uiBlockSetEmboss(node->block, UI_EMBOSS);
}
/* group edit */
- if(node->type == NODE_GROUP) {
+ if (node->type == NODE_GROUP) {
uiBut *but;
iconofs-=iconbutw;
uiBlockSetEmboss(node->block, UI_EMBOSSN);
@@ -633,7 +642,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
}
/* title */
- if(node->flag & SELECT)
+ if (node->flag & SELECT)
UI_ThemeColor(TH_TEXT_HI);
else
UI_ThemeColorBlendShade(TH_TEXT, color_id, 0.4f, 10);
@@ -653,16 +662,18 @@ 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
- if(node->flag & SELECT)
+ /* 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));
//if(node->flag & NODE_MUTED)
- // BLI_snprintf(showname, sizeof(showname), "[%s]", showname); // XXX - dont print into self!
+ // BLI_snprintf(showname, sizeof(showname), "[%s]", showname); // XXX - don't print into self!
uiDefBut(node->block, LABEL, 0, showname, (short)(rct->xmin+15), (short)(rct->ymax-NODE_DY),
(int)(iconofs - rct->xmin-18.0f), NODE_DY, NULL, 0, 0, 0, 0, "");
@@ -678,11 +689,11 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
node_scaling_widget(TH_NODE, snode->aspect, rct->xmax-BASIS_RAD*snode->aspect, rct->ymin, rct->xmax, rct->ymin+BASIS_RAD*snode->aspect);
/* outline active and selected emphasis */
- if( node->flag & (NODE_ACTIVE|SELECT) ) {
+ if ( node->flag & (NODE_ACTIVE|SELECT) ) {
glEnable(GL_BLEND);
glEnable( GL_LINE_SMOOTH );
/* using different shades of TH_TEXT_HI for the empasis, like triangle */
- if( node->flag & NODE_ACTIVE )
+ if ( node->flag & NODE_ACTIVE )
UI_ThemeColorShadeAlpha(TH_TEXT_HI, 0, -40);
else
UI_ThemeColorShadeAlpha(TH_TEXT_HI, -20, -120);
@@ -694,51 +705,53 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
}
/* disable lines */
- if(node->flag & NODE_MUTED)
+ if (node->flag & NODE_MUTED)
node_draw_mute_line(v2d, snode, node);
/* socket inputs, buttons */
- for(sock= node->inputs.first; sock; sock= sock->next) {
+ for (sock= node->inputs.first; sock; sock= sock->next) {
bNodeSocketType *stype= ntreeGetSocketType(sock->type);
- if(nodeSocketIsHidden(sock))
+ if (nodeSocketIsHidden(sock))
continue;
node_socket_circle_draw(ntree, sock, NODE_SOCKSIZE);
if (stype->buttonfunc)
- stype->buttonfunc(C, node->block, ntree, node, sock, sock->name, sock->locx+NODE_DYS, sock->locy-NODE_DYS, node->width-NODE_DY);
+ stype->buttonfunc(C, node->block, ntree, node, sock, IFACE_(sock->name), sock->locx+NODE_DYS, sock->locy-NODE_DYS, node->width-NODE_DY);
}
/* socket outputs */
- for(sock= node->outputs.first; sock; sock= sock->next) {
+ for (sock= node->outputs.first; sock; sock= sock->next) {
PointerRNA sockptr;
- float slen;
- int ofs;
RNA_pointer_create((ID*)ntree, &RNA_NodeSocket, sock, &sockptr);
- if(nodeSocketIsHidden(sock))
+ if (nodeSocketIsHidden(sock))
continue;
node_socket_circle_draw(ntree, sock, NODE_SOCKSIZE);
- ofs= 0;
- UI_ThemeColor(TH_TEXT);
- slen= snode->aspect*UI_GetStringWidth(sock->name);
- while(slen > node->width) {
- ofs++;
- slen= snode->aspect*UI_GetStringWidth(sock->name+ofs);
+ {
+ const char *name = IFACE_(sock->name);
+ float slen;
+ int ofs = 0;
+ UI_ThemeColor(TH_TEXT);
+ slen= snode->aspect*UI_GetStringWidth(name);
+ while (slen > node->width) {
+ ofs++;
+ slen= snode->aspect*UI_GetStringWidth(name+ofs);
+ }
+ uiDefBut(node->block, LABEL, 0, name+ofs, (short)(sock->locx-15.0f-slen), (short)(sock->locy-9.0f),
+ (short)(node->width-NODE_DY), NODE_DY, NULL, 0, 0, 0, 0, "");
}
- uiDefBut(node->block, LABEL, 0, sock->name+ofs, (short)(sock->locx-15.0f-slen), (short)(sock->locy-9.0f),
- (short)(node->width-NODE_DY), NODE_DY, NULL, 0, 0, 0, 0, "");
}
/* preview */
- if(node->flag & NODE_PREVIEW) {
+ if (node->flag & NODE_PREVIEW) {
BLI_lock_thread(LOCK_PREVIEW);
- if(node->preview && node->preview->rect && !BLI_rctf_is_empty(&node->prvr))
+ if (node->preview && node->preview->rect && !BLI_rctf_is_empty(&node->prvr))
node_draw_preview(node->preview, &node->prvr);
BLI_unlock_thread(LOCK_PREVIEW);
}
@@ -766,16 +779,16 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
/* body */
UI_ThemeColor(color_id);
- if(node->flag & NODE_MUTED)
+ if (node->flag & NODE_MUTED)
UI_ThemeColorBlend(color_id, TH_REDALERT, 0.5f);
uiRoundBox(rct->xmin, rct->ymin, rct->xmax, rct->ymax, hiddenrad);
/* outline active and selected emphasis */
- if( node->flag & (NODE_ACTIVE|SELECT) ) {
+ if ( node->flag & (NODE_ACTIVE|SELECT) ) {
glEnable(GL_BLEND);
glEnable( GL_LINE_SMOOTH );
/* using different shades of TH_TEXT_HI for the empasis, like triangle */
- if( node->flag & NODE_ACTIVE )
+ if ( node->flag & NODE_ACTIVE )
UI_ThemeColorShadeAlpha(TH_TEXT_HI, 0, -40);
else
UI_ThemeColorShadeAlpha(TH_TEXT_HI, -20, -120);
@@ -785,7 +798,7 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
}
/* title */
- if(node->flag & SELECT)
+ if (node->flag & SELECT)
UI_ThemeColor(TH_TEXT_HI);
else
UI_ThemeColorBlendShade(TH_TEXT, color_id, 0.4f, 10);
@@ -806,19 +819,19 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
}
/* disable lines */
- if(node->flag & NODE_MUTED)
+ if (node->flag & NODE_MUTED)
node_draw_mute_line(&ar->v2d, snode, node);
- if(node->flag & SELECT)
+ if (node->flag & SELECT)
UI_ThemeColor(TH_TEXT_HI);
else
UI_ThemeColor(TH_TEXT);
- if(node->miniwidth>0.0f) {
+ if (node->miniwidth>0.0f) {
BLI_strncpy(showname, nodeLabel(node), sizeof(showname));
//if(node->flag & NODE_MUTED)
- // BLI_snprintf(showname, sizeof(showname), "[%s]", showname); // XXX - dont print into self!
+ // BLI_snprintf(showname, sizeof(showname), "[%s]", showname); // XXX - don't print into self!
uiDefBut(node->block, LABEL, 0, showname, (short)(rct->xmin+15), (short)(centy-10),
(int)(rct->xmax - rct->xmin-18.0f -12.0f), NODE_DY, NULL, 0, 0, 0, 0, "");
@@ -836,13 +849,13 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
fdrawline(rct->xmax-dx-3.0f*snode->aspect, centy-4.0f, rct->xmax-dx-3.0f*snode->aspect, centy+4.0f);
/* sockets */
- for(sock= node->inputs.first; sock; sock= sock->next) {
- if(!nodeSocketIsHidden(sock))
+ for (sock= node->inputs.first; sock; sock= sock->next) {
+ if (!nodeSocketIsHidden(sock))
node_socket_circle_draw(snode->nodetree, sock, socket_size);
}
- for(sock= node->outputs.first; sock; sock= sock->next) {
- if(!nodeSocketIsHidden(sock))
+ for (sock= node->outputs.first; sock; sock= sock->next) {
+ if (!nodeSocketIsHidden(sock))
node_socket_circle_draw(snode->nodetree, sock, socket_size);
}
@@ -853,7 +866,7 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
void node_draw_default(const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree, bNode *node)
{
- if(node->flag & NODE_HIDDEN)
+ if (node->flag & NODE_HIDDEN)
node_draw_hidden(C, ar, snode, node);
else
node_draw_basis(C, ar, snode, ntree, node);
@@ -869,7 +882,7 @@ void node_update_nodetree(const bContext *C, bNodeTree *ntree, float offsetx, fl
{
bNode *node;
- for(node= ntree->nodes.first; node; node= node->next) {
+ for (node= ntree->nodes.first; node; node= node->next) {
/* XXX little hack */
node->locx += offsetx;
node->locy += offsety;
@@ -893,18 +906,18 @@ void node_draw_nodetree(const bContext *C, ARegion *ar, SpaceNode *snode, bNodeT
bNodeLink *link;
int a;
- if(ntree==NULL) return; /* groups... */
+ if (ntree==NULL) return; /* groups... */
/* node lines */
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
- for(link= ntree->links.first; link; link= link->next)
+ for (link= ntree->links.first; link; link= link->next)
node_draw_link(&ar->v2d, snode, link);
glDisable(GL_LINE_SMOOTH);
glDisable(GL_BLEND);
/* draw nodes, last nodes in front */
- for(a=0, node= ntree->nodes.first; node; node=node->next, a++) {
+ for (a=0, node= ntree->nodes.first; node; node=node->next, a++) {
node->nr= a; /* index of node in list, used for exec event code */
node_draw(C, ar, snode, ntree, node);
}
@@ -940,7 +953,7 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
/* nodes */
snode_set_context(snode, CTX_data_scene(C));
- if(snode->nodetree) {
+ if (snode->nodetree) {
bNode *node;
node_uiblocks_init(C, snode->nodetree);
@@ -948,8 +961,8 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
/* uiBlocks must be initialized in drawing order for correct event clipping.
* Node group internal blocks added after the main group block.
*/
- for(node= snode->nodetree->nodes.first; node; node= node->next) {
- if(node->flag & NODE_GROUP_EDIT)
+ for (node= snode->nodetree->nodes.first; node; node= node->next) {
+ if (node->flag & NODE_GROUP_EDIT)
node_uiblocks_init(C, (bNodeTree *)node->id);
}
@@ -958,8 +971,8 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
#if 0
/* active group */
- for(node= snode->nodetree->nodes.first; node; node= node->next) {
- if(node->flag & NODE_GROUP_EDIT)
+ for (node= snode->nodetree->nodes.first; node; node= node->next) {
+ if (node->flag & NODE_GROUP_EDIT)
node_draw_group(C, ar, snode, snode->nodetree, node);
}
#endif
@@ -968,7 +981,7 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
/* temporary links */
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
- for(nldrag= snode->linkdrag.first; nldrag; nldrag= nldrag->next)
+ for (nldrag= snode->linkdrag.first; nldrag; nldrag= nldrag->next)
node_draw_link(&ar->v2d, snode, nldrag->link);
glDisable(GL_LINE_SMOOTH);
glDisable(GL_BLEND);
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index c89e91724fb..cf2b3730462 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -132,14 +132,14 @@ static void compo_freejob(void *cjv)
{
CompoJob *cj= cjv;
- if(cj->localtree) {
+ if (cj->localtree) {
ntreeLocalMerge(cj->localtree, cj->ntree);
}
MEM_freeN(cj);
}
/* 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;
@@ -169,7 +169,7 @@ static void compo_startjob(void *cjv, short *stop, short *do_update, float *prog
CompoJob *cj= cjv;
bNodeTree *ntree= cj->localtree;
- if(cj->scene->use_nodes==0)
+ if (cj->scene->use_nodes==0)
return;
cj->stop= stop;
@@ -220,9 +220,9 @@ void snode_composite_job(const bContext *C, ScrArea *sa)
/* operator poll callback */
static int composite_node_active(bContext *C)
{
- if( ED_operator_node_active(C)) {
+ if ( ED_operator_node_active(C)) {
SpaceNode *snode= CTX_wm_space_node(C);
- if(snode->treetype==NTREE_COMPOSIT)
+ if (snode->treetype==NTREE_COMPOSIT)
return 1;
}
return 0;
@@ -234,10 +234,10 @@ static bNode *editnode_get_active(bNodeTree *ntree)
bNode *node;
/* check for edited group */
- for(node= ntree->nodes.first; node; node= node->next)
- if(nodeGroupEditGet(node))
+ for (node= ntree->nodes.first; node; node= node->next)
+ if (nodeGroupEditGet(node))
break;
- if(node)
+ if (node)
return nodeGetActive((bNodeTree *)node->id);
else
return nodeGetActive(ntree);
@@ -252,11 +252,11 @@ void snode_notify(bContext *C, SpaceNode *snode)
{
WM_event_add_notifier(C, NC_NODE|NA_EDITED, NULL);
- if(snode->treetype==NTREE_SHADER)
+ if (snode->treetype==NTREE_SHADER)
WM_event_add_notifier(C, NC_MATERIAL|ND_NODES, snode->id);
- else if(snode->treetype==NTREE_COMPOSIT)
+ else if (snode->treetype==NTREE_COMPOSIT)
WM_event_add_notifier(C, NC_SCENE|ND_NODES, snode->id);
- else if(snode->treetype==NTREE_TEXTURE)
+ else if (snode->treetype==NTREE_TEXTURE)
WM_event_add_notifier(C, NC_TEXTURE|ND_NODES, snode->id);
}
@@ -265,8 +265,8 @@ bNode *node_tree_get_editgroup(bNodeTree *nodetree)
bNode *gnode;
/* get the groupnode */
- for(gnode= nodetree->nodes.first; gnode; gnode= gnode->next)
- if(nodeGroupEditGet(gnode))
+ for (gnode= nodetree->nodes.first; gnode; gnode= gnode->next)
+ if (nodeGroupEditGet(gnode))
break;
return gnode;
}
@@ -289,7 +289,7 @@ void ED_node_shader_default(Scene *scene, ID *id)
Material *ma= (Material*)id;
ma->nodetree = ntree;
- if(scene_use_new_shading_nodes(scene)) {
+ if (scene_use_new_shading_nodes(scene)) {
output_type = SH_NODE_OUTPUT_MATERIAL;
shader_type = SH_NODE_BSDF_DIFFUSE;
}
@@ -321,7 +321,7 @@ void ED_node_shader_default(Scene *scene, ID *id)
shader_type = SH_NODE_EMISSION;
copy_v3_v3(color, &la->r);
- if(la->type == LA_LOCAL || la->type == LA_SPOT || la->type == LA_AREA)
+ if (la->type == LA_LOCAL || la->type == LA_SPOT || la->type == LA_AREA)
strength= 100.0f;
else
strength= 1.0f;
@@ -347,11 +347,11 @@ void ED_node_shader_default(Scene *scene, ID *id)
nodeAddLink(ntree, in, fromsock, out, tosock);
/* default values */
- if(scene_use_new_shading_nodes(scene)) {
+ if (scene_use_new_shading_nodes(scene)) {
sock= in->inputs.first;
copy_v3_v3(((bNodeSocketValueRGBA*)sock->default_value)->value, color);
- if(strength != 0.0f) {
+ if (strength != 0.0f) {
sock= in->inputs.last;
((bNodeSocketValueFloat*)sock->default_value)->value= strength;
}
@@ -369,8 +369,8 @@ void ED_node_composit_default(Scene *sce)
bNodeTemplate ntemp;
/* but lets check it anyway */
- if(sce->nodetree) {
- if (G.f & G_DEBUG)
+ if (sce->nodetree) {
+ if (G.debug & G_DEBUG)
printf("error in composite initialize\n");
return;
}
@@ -409,8 +409,8 @@ void ED_node_texture_default(Tex *tx)
bNodeTemplate ntemp;
/* but lets check it anyway */
- if(tx->nodetree) {
- if (G.f & G_DEBUG)
+ if (tx->nodetree) {
+ if (G.debug & G_DEBUG)
printf("error in texture initialize\n");
return;
}
@@ -440,43 +440,43 @@ void node_tree_from_ID(ID *id, bNodeTree **ntree, bNodeTree **edittree, int *tre
bNode *node= NULL;
short idtype= GS(id->name);
- if(idtype == ID_NT) {
+ if (idtype == ID_NT) {
*ntree= (bNodeTree*)id;
- if(treetype) *treetype= (*ntree)->type;
+ if (treetype) *treetype= (*ntree)->type;
}
- else if(idtype == ID_MA) {
+ else if (idtype == ID_MA) {
*ntree= ((Material*)id)->nodetree;
- if(treetype) *treetype= NTREE_SHADER;
+ if (treetype) *treetype= NTREE_SHADER;
}
- else if(idtype == ID_LA) {
+ else if (idtype == ID_LA) {
*ntree= ((Lamp*)id)->nodetree;
- if(treetype) *treetype= NTREE_SHADER;
+ if (treetype) *treetype= NTREE_SHADER;
}
- else if(idtype == ID_WO) {
+ else if (idtype == ID_WO) {
*ntree= ((World*)id)->nodetree;
- if(treetype) *treetype= NTREE_SHADER;
+ if (treetype) *treetype= NTREE_SHADER;
}
- else if(idtype == ID_SCE) {
+ else if (idtype == ID_SCE) {
*ntree= ((Scene*)id)->nodetree;
- if(treetype) *treetype= NTREE_COMPOSIT;
+ if (treetype) *treetype= NTREE_COMPOSIT;
}
- else if(idtype == ID_TE) {
+ else if (idtype == ID_TE) {
*ntree= ((Tex*)id)->nodetree;
- if(treetype) *treetype= NTREE_TEXTURE;
+ if (treetype) *treetype= NTREE_TEXTURE;
}
else {
- if(treetype) *treetype= 0;
+ if (treetype) *treetype= 0;
return;
}
/* find editable group */
- if(edittree) {
- if(*ntree)
- for(node= (*ntree)->nodes.first; node; node= node->next)
- if(nodeGroupEditGet(node))
+ if (edittree) {
+ if (*ntree)
+ for (node= (*ntree)->nodes.first; node; node= node->next)
+ if (nodeGroupEditGet(node))
break;
- if(node && node->id)
+ if (node && node->id)
*edittree= (bNodeTree *)node->id;
else
*edittree= *ntree;
@@ -485,7 +485,7 @@ void node_tree_from_ID(ID *id, bNodeTree **ntree, bNodeTree **edittree, int *tre
else {
*ntree= NULL;
*edittree= NULL;
- if(treetype) *treetype= 0;
+ if (treetype) *treetype= 0;
}
}
@@ -496,17 +496,17 @@ void snode_set_context(SpaceNode *snode, Scene *scene)
snode->id= snode->from= NULL;
- if(snode->treetype==NTREE_SHADER) {
+ if (snode->treetype==NTREE_SHADER) {
/* need active object, or we allow pinning... */
- if(snode->shaderfrom == SNODE_SHADER_OBJECT) {
- if(ob) {
- if(ob->type == OB_LAMP) {
+ if (snode->shaderfrom == SNODE_SHADER_OBJECT) {
+ if (ob) {
+ if (ob->type == OB_LAMP) {
snode->from= &ob->id;
snode->id= ob->data;
}
else {
Material *ma= give_current_material(ob, ob->actcol);
- if(ma) {
+ if (ma) {
snode->from= &ob->id;
snode->id= &ma->id;
}
@@ -514,26 +514,26 @@ void snode_set_context(SpaceNode *snode, Scene *scene)
}
}
else { /* SNODE_SHADER_WORLD */
- if(scene->world) {
+ if (scene->world) {
snode->from= NULL;
snode->id= &scene->world->id;
}
}
}
- else if(snode->treetype==NTREE_COMPOSIT) {
+ else if (snode->treetype==NTREE_COMPOSIT) {
snode->id= &scene->id;
/* update output sockets based on available layers */
ntreeCompositForceHidden(scene->nodetree, scene);
}
- else if(snode->treetype==NTREE_TEXTURE) {
+ else if (snode->treetype==NTREE_TEXTURE) {
Tex *tx= NULL;
- if(snode->texfrom==SNODE_TEX_OBJECT) {
- if(ob) {
+ if (snode->texfrom==SNODE_TEX_OBJECT) {
+ if (ob) {
tx= give_current_object_texture(ob);
- if(ob->type == OB_LAMP)
+ if (ob->type == OB_LAMP)
snode->from= (ID*)ob->data;
else
snode->from= (ID*)give_current_material(ob, ob->actcol);
@@ -542,7 +542,7 @@ void snode_set_context(SpaceNode *snode, Scene *scene)
snode->id= &tx->id;
}
}
- else if(snode->texfrom==SNODE_TEX_WORLD) {
+ else if (snode->texfrom==SNODE_TEX_WORLD) {
tx= give_current_world_texture(scene->world);
snode->from= (ID *)scene->world;
snode->id= &tx->id;
@@ -550,7 +550,7 @@ void snode_set_context(SpaceNode *snode, Scene *scene)
else {
struct Brush *brush= NULL;
- if(ob && (ob->mode & OB_MODE_SCULPT))
+ if (ob && (ob->mode & OB_MODE_SCULPT))
brush= paint_brush(&scene->toolsettings->sculpt->paint);
else
brush= paint_brush(&scene->toolsettings->imapaint.paint);
@@ -581,7 +581,7 @@ static void snode_update(SpaceNode *snode, bNode *node)
/* if inside group, tag entire group */
gnode= node_tree_get_editgroup(snode->nodetree);
- if(gnode)
+ if (gnode)
nodeUpdateID(snode->nodetree, gnode->id);
}
@@ -589,12 +589,12 @@ static int has_nodetree(bNodeTree *ntree, bNodeTree *lookup)
{
bNode *node;
- if(ntree == lookup)
+ if (ntree == lookup)
return 1;
- for(node=ntree->nodes.first; node; node=node->next)
- if(node->type == NODE_GROUP && node->id)
- if(has_nodetree((bNodeTree*)node->id, lookup))
+ for (node=ntree->nodes.first; node; node=node->next)
+ if (node->type == NODE_GROUP && node->id)
+ if (has_nodetree((bNodeTree*)node->id, lookup))
return 1;
return 0;
@@ -606,72 +606,72 @@ void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node)
nodeSetActive(ntree, node);
- if(node->type!=NODE_GROUP) {
+ if (node->type!=NODE_GROUP) {
int was_output= (node->flag & NODE_DO_OUTPUT);
/* tree specific activate calls */
- if(ntree->type==NTREE_SHADER) {
+ if (ntree->type==NTREE_SHADER) {
/* when we select a material, active texture is cleared, for buttons */
- if(node->id && ELEM3(GS(node->id->name), ID_MA, ID_LA, ID_WO))
+ if (node->id && ELEM3(GS(node->id->name), ID_MA, ID_LA, ID_WO))
nodeClearActiveID(ntree, ID_TE);
- if(node->type==SH_NODE_OUTPUT) {
+ if (node->type==SH_NODE_OUTPUT) {
bNode *tnode;
- for(tnode= ntree->nodes.first; tnode; tnode= tnode->next)
- if( tnode->type==SH_NODE_OUTPUT)
+ for (tnode= ntree->nodes.first; tnode; tnode= tnode->next)
+ if ( tnode->type==SH_NODE_OUTPUT)
tnode->flag &= ~NODE_DO_OUTPUT;
node->flag |= NODE_DO_OUTPUT;
- if(was_output==0)
+ if (was_output==0)
ED_node_generic_update(bmain, ntree, node);
}
/* if active texture changed, free glsl materials */
- if((node->flag & NODE_ACTIVE_TEXTURE) && !was_active_texture) {
+ if ((node->flag & NODE_ACTIVE_TEXTURE) && !was_active_texture) {
Material *ma;
- for(ma=bmain->mat.first; ma; ma=ma->id.next)
- if(ma->nodetree && ma->use_nodes && has_nodetree(ma->nodetree, ntree))
+ for (ma=bmain->mat.first; ma; ma=ma->id.next)
+ if (ma->nodetree && ma->use_nodes && has_nodetree(ma->nodetree, ntree))
GPU_material_free(ma);
}
WM_main_add_notifier(NC_MATERIAL|ND_NODES, node->id);
}
- else if(ntree->type==NTREE_COMPOSIT) {
+ else if (ntree->type==NTREE_COMPOSIT) {
/* make active viewer, currently only 1 supported... */
- if( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
+ if ( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
bNode *tnode;
- for(tnode= ntree->nodes.first; tnode; tnode= tnode->next)
- if( ELEM(tnode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
+ for (tnode= ntree->nodes.first; tnode; tnode= tnode->next)
+ if ( ELEM(tnode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
tnode->flag &= ~NODE_DO_OUTPUT;
node->flag |= NODE_DO_OUTPUT;
- if(was_output==0)
+ if (was_output==0)
ED_node_generic_update(bmain, ntree, node);
/* addnode() doesnt link this yet... */
node->id= (ID *)BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node");
}
- else if(node->type==CMP_NODE_R_LAYERS) {
+ else if (node->type==CMP_NODE_R_LAYERS) {
Scene *scene;
- for(scene=bmain->scene.first; scene; scene=scene->id.next) {
- if(scene->nodetree && scene->use_nodes && has_nodetree(scene->nodetree, ntree)) {
- if(node->id==NULL || node->id==(ID *)scene) {
+ for (scene=bmain->scene.first; scene; scene=scene->id.next) {
+ if (scene->nodetree && scene->use_nodes && has_nodetree(scene->nodetree, ntree)) {
+ if (node->id==NULL || node->id==(ID *)scene) {
scene->r.actlay= node->custom1;
}
}
}
}
- else if(node->type==CMP_NODE_COMPOSITE) {
+ else if (node->type==CMP_NODE_COMPOSITE) {
if (was_output==0) {
bNode *tnode;
- for(tnode= ntree->nodes.first; tnode; tnode= tnode->next)
- if( tnode->type==CMP_NODE_COMPOSITE)
+ for (tnode= ntree->nodes.first; tnode; tnode= tnode->next)
+ if ( tnode->type==CMP_NODE_COMPOSITE)
tnode->flag &= ~NODE_DO_OUTPUT;
node->flag |= NODE_DO_OUTPUT;
@@ -679,10 +679,10 @@ void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node)
}
}
}
- else if(ntree->type==NTREE_TEXTURE) {
+ else if (ntree->type==NTREE_TEXTURE) {
// XXX
#if 0
- if(node->id)
+ if (node->id)
; // XXX BIF_preview_changed(-1);
// allqueue(REDRAWBUTSSHADING, 1);
// allqueue(REDRAWIPO, 0);
@@ -811,12 +811,12 @@ void snode_make_group_editable(SpaceNode *snode, bNode *gnode)
bNode *node;
/* make sure nothing has group editing on */
- for(node=snode->nodetree->nodes.first; node; node=node->next)
+ for (node=snode->nodetree->nodes.first; node; node=node->next)
nodeGroupEditClear(node);
- if(gnode==NULL) {
+ if (gnode==NULL) {
/* with NULL argument we do a toggle */
- if(snode->edittree==snode->nodetree)
+ if (snode->edittree==snode->nodetree)
gnode= nodeGetActive(snode->nodetree);
}
@@ -824,9 +824,9 @@ void snode_make_group_editable(SpaceNode *snode, bNode *gnode)
snode->edittree = nodeGroupEditSet(gnode, 1);
/* deselect all other nodes, so we can also do grabbing of entire subtree */
- for(node= snode->nodetree->nodes.first; node; node= node->next)
- node->flag &= ~SELECT;
- gnode->flag |= SELECT;
+ for (node= snode->nodetree->nodes.first; node; node= node->next)
+ node_deselect(node);
+ node_select(gnode);
}
else
snode->edittree= snode->nodetree;
@@ -858,7 +858,7 @@ static int node_group_edit_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(e
/* XXX callback? */
if (snode->nodetree==snode->edittree) {
gnode = nodeGetActive(snode->edittree);
- if(gnode && gnode->id && GS(gnode->id->name)==ID_NT && gnode->id->lib) {
+ if (gnode && gnode->id && GS(gnode->id->name)==ID_NT && gnode->id->lib) {
uiPupMenuOkee(C, op->type->idname, "Make group local?");
return OPERATOR_CANCELLED;
}
@@ -1138,18 +1138,18 @@ static int node_group_ungroup_exec(bContext *C, wmOperator *op)
/* are we inside of a group? */
gnode= node_tree_get_editgroup(snode->nodetree);
- if(gnode)
+ if (gnode)
snode_make_group_editable(snode, NULL);
gnode= nodeGetActive(snode->edittree);
- if(gnode==NULL)
+ if (gnode==NULL)
return OPERATOR_CANCELLED;
- if(gnode->type!=NODE_GROUP) {
+ if (gnode->type!=NODE_GROUP) {
BKE_report(op->reports, RPT_WARNING, "Not a group");
return OPERATOR_CANCELLED;
}
- else if(!node_group_ungroup(snode->edittree, gnode)) {
+ else if (!node_group_ungroup(snode->edittree, gnode)) {
BKE_report(op->reports, RPT_WARNING, "Can't ungroup");
return OPERATOR_CANCELLED;
}
@@ -1182,8 +1182,8 @@ static bNode *visible_node(SpaceNode *snode, rctf *rct)
{
bNode *node;
- for(node=snode->edittree->nodes.last; node; node=node->prev) {
- if(BLI_isect_rctf(&node->totr, rct, NULL))
+ for (node=snode->edittree->nodes.last; node; node=node->prev) {
+ if (BLI_isect_rctf(&node->totr, rct, NULL))
break;
}
return node;
@@ -1245,7 +1245,7 @@ static int snode_bg_viewmove_invoke(bContext *C, wmOperator *op, wmEvent *event)
ima= BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node");
ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
- if(ibuf == NULL) {
+ if (ibuf == NULL) {
BKE_image_release_ibuf(ima, lock);
return OPERATOR_CANCELLED;
}
@@ -1279,18 +1279,18 @@ static int snode_bg_viewmove_cancel(bContext *UNUSED(C), wmOperator *op)
void NODE_OT_backimage_move(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Background Image Move";
+ ot->name = "Background Image Move";
ot->description = "Move Node backdrop";
- ot->idname= "NODE_OT_backimage_move";
+ ot->idname = "NODE_OT_backimage_move";
/* api callbacks */
- ot->invoke= snode_bg_viewmove_invoke;
- ot->modal= snode_bg_viewmove_modal;
- ot->poll= composite_node_active;
- ot->cancel= snode_bg_viewmove_cancel;
+ ot->invoke = snode_bg_viewmove_invoke;
+ ot->modal = snode_bg_viewmove_modal;
+ ot->poll = composite_node_active;
+ ot->cancel = snode_bg_viewmove_cancel;
/* flags */
- ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
+ ot->flag = OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
}
static int backimage_zoom(bContext *C, wmOperator *op)
@@ -1310,15 +1310,15 @@ void NODE_OT_backimage_zoom(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Background Image Zoom";
- ot->idname= "NODE_OT_backimage_zoom";
+ ot->name = "Background Image Zoom";
+ ot->idname = "NODE_OT_backimage_zoom";
/* api callbacks */
- ot->exec= backimage_zoom;
- ot->poll= composite_node_active;
+ ot->exec = backimage_zoom;
+ ot->poll = composite_node_active;
/* flags */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
/* internal */
RNA_def_float(ot->srna, "factor", 1.2f, 0.0f, 10.0f, "Factor", "", 0.0f, 10.0f);
@@ -1362,11 +1362,11 @@ static void sample_apply(bContext *C, wmOperator *op, wmEvent *event)
ima= BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node");
ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
- if(!ibuf)
+ if (!ibuf)
return;
- if(!ibuf->rect) {
- if(info->color_manage)
+ if (!ibuf->rect) {
+ if (info->color_manage)
ibuf->profile = IB_PROFILE_LINEAR_RGB;
else
ibuf->profile = IB_PROFILE_NONE;
@@ -1379,7 +1379,7 @@ static void sample_apply(bContext *C, wmOperator *op, wmEvent *event)
fx = (bufx > 0.0f ? ((float)event->mval[0] - 0.5f*ar->winx - snode->xof) / bufx + 0.5f : 0.0f);
fy = (bufy > 0.0f ? ((float)event->mval[1] - 0.5f*ar->winy - snode->yof) / bufy + 0.5f : 0.0f);
- if(fx>=0.0f && fy>=0.0f && fx<1.0f && fy<1.0f) {
+ if (fx>=0.0f && fy>=0.0f && fx<1.0f && fy<1.0f) {
float *fp;
char *cp;
int x= (int)(fx*ibuf->x), y= (int)(fy*ibuf->y);
@@ -1392,7 +1392,7 @@ static void sample_apply(bContext *C, wmOperator *op, wmEvent *event)
info->draw= 1;
info->channels= ibuf->channels;
- if(ibuf->rect) {
+ if (ibuf->rect) {
cp= (char *)(ibuf->rect + y*ibuf->x + x);
info->col[0]= cp[0];
@@ -1405,7 +1405,7 @@ static void sample_apply(bContext *C, wmOperator *op, wmEvent *event)
info->colf[2]= (float)cp[2]/255.0f;
info->colf[3]= (float)cp[3]/255.0f;
}
- if(ibuf->rect_float) {
+ if (ibuf->rect_float) {
fp= (ibuf->rect_float + (ibuf->channels)*(y*ibuf->x + x));
info->colf[0]= fp[0];
@@ -1437,7 +1437,7 @@ static int sample_invoke(bContext *C, wmOperator *op, wmEvent *event)
ARegion *ar= CTX_wm_region(C);
ImageSampleInfo *info;
- if(snode->treetype!=NTREE_COMPOSIT || !(snode->flag & SNODE_BACKDRAW))
+ if (snode->treetype!=NTREE_COMPOSIT || !(snode->flag & SNODE_BACKDRAW))
return OPERATOR_CANCELLED;
info= MEM_callocN(sizeof(ImageSampleInfo), "ImageSampleInfo");
@@ -1476,17 +1476,17 @@ static int sample_cancel(bContext *C, wmOperator *op)
void NODE_OT_backimage_sample(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Backimage Sample";
- ot->idname= "NODE_OT_backimage_sample";
+ ot->name = "Backimage Sample";
+ ot->idname = "NODE_OT_backimage_sample";
/* api callbacks */
- ot->invoke= sample_invoke;
- ot->modal= sample_modal;
- ot->cancel= sample_cancel;
- ot->poll= ED_operator_node_active;
+ ot->invoke = sample_invoke;
+ ot->modal = sample_modal;
+ ot->cancel = sample_cancel;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
}
/* ********************** size widget operator ******************** */
@@ -1512,7 +1512,7 @@ static int node_resize_modal(bContext *C, wmOperator *op, wmEvent *event)
&mx, &my);
if (node) {
- if(node->flag & NODE_HIDDEN) {
+ if (node->flag & NODE_HIDDEN) {
node->miniwidth= nsw->oldminiwidth + mx - nsw->mxstart;
CLAMP(node->miniwidth, 0.0f, 100.0f);
}
@@ -1550,12 +1550,12 @@ static int node_resize_invoke(bContext *C, wmOperator *op, wmEvent *event)
ARegion *ar= CTX_wm_region(C);
bNode *node= editnode_get_active(snode->edittree);
- if(node) {
+ if (node) {
/* convert mouse coordinates to v2d space */
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1],
&snode->mx, &snode->my);
- if(node->typeinfo->resize_area_func(node, snode->mx, snode->my)) {
+ if (node->typeinfo->resize_area_func(node, snode->mx, snode->my)) {
NodeSizeWidget *nsw= MEM_callocN(sizeof(NodeSizeWidget), "size widget op data");
op->customdata= nsw;
@@ -1587,17 +1587,17 @@ static int node_resize_cancel(bContext *UNUSED(C), wmOperator *op)
void NODE_OT_resize(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Resize Node";
- ot->idname= "NODE_OT_resize";
+ ot->name = "Resize Node";
+ ot->idname = "NODE_OT_resize";
/* api callbacks */
- ot->invoke= node_resize_invoke;
- ot->modal= node_resize_modal;
- ot->poll= ED_operator_node_active;
- ot->cancel= node_resize_cancel;
+ ot->invoke = node_resize_invoke;
+ ot->modal = node_resize_modal;
+ ot->poll = ED_operator_node_active;
+ ot->cancel = node_resize_cancel;
/* flags */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
}
@@ -1607,11 +1607,11 @@ int node_has_hidden_sockets(bNode *node, short flag)
{
bNodeSocket *sock;
- for(sock= node->inputs.first; sock; sock= sock->next)
- if(sock->flag & flag)
+ for (sock= node->inputs.first; sock; sock= sock->next)
+ if (sock->flag & flag)
return 1;
- for(sock= node->outputs.first; sock; sock= sock->next)
- if(sock->flag & flag)
+ for (sock= node->outputs.first; sock; sock= sock->next)
+ if (sock->flag & flag)
return 1;
return 0;
}
@@ -1620,95 +1620,115 @@ void node_set_hidden_sockets(SpaceNode *snode, bNode *node, short flag, int set)
{
bNodeSocket *sock;
- if(set==0) {
- for(sock= node->inputs.first; sock; sock= sock->next)
+ if (set==0) {
+ for (sock= node->inputs.first; sock; sock= sock->next)
sock->flag &= ~flag;
- for(sock= node->outputs.first; sock; sock= sock->next)
+ for (sock= node->outputs.first; sock; sock= sock->next)
sock->flag &= ~flag;
}
else {
/* hide unused sockets */
- for(sock= node->inputs.first; sock; sock= sock->next) {
- if(sock->link==NULL)
+ for (sock= node->inputs.first; sock; sock= sock->next) {
+ if (sock->link==NULL)
sock->flag |= flag;
}
- for(sock= node->outputs.first; sock; sock= sock->next) {
- if(nodeCountSocketLinks(snode->edittree, sock)==0)
+ for (sock= node->outputs.first; sock; sock= sock->next) {
+ if (nodeCountSocketLinks(snode->edittree, sock)==0)
sock->flag |= flag;
}
}
}
-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;
- if( ELEM(tonode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
- return;
+ if (tonode==NULL || tonode->outputs.first==NULL)
+ return OPERATOR_CANCELLED;
+ if ( ELEM(tonode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
+ return OPERATOR_CANCELLED;
/* get viewer */
- for(node= snode->edittree->nodes.first; node; node= node->next)
- if( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
- if(node->flag & NODE_DO_OUTPUT)
+ for (node= snode->edittree->nodes.first; node; node= node->next)
+ if ( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
+ if (node->flag & NODE_DO_OUTPUT)
break;
/* no viewer, we make one active */
- if(node==NULL) {
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
+ if (node==NULL) {
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
+ if ( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
node->flag |= NODE_DO_OUTPUT;
break;
}
}
}
-
- if(node) {
- bNodeLink *link;
- bNodeSocket *sock= NULL;
-
- /* try to find an already connected socket to cycle to the next */
- for(link= snode->edittree->links.first; link; link= link->next)
- if(link->tonode==node && link->fromnode==tonode)
- if(link->tosock==node->inputs.first)
+
+ 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) {
+ 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))
+ 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)
+ 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;
}
@@ -1719,12 +1739,14 @@ static int node_active_link_viewer(bContext *C, wmOperator *UNUSED(op))
node= editnode_get_active(snode->edittree);
- if(!node)
+ if (!node)
return OPERATOR_CANCELLED;
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;
@@ -1735,16 +1757,16 @@ static int node_active_link_viewer(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_link_viewer(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Link to Viewer Node";
+ ot->name = "Link to Viewer Node";
ot->description = "Link to viewer node";
- ot->idname= "NODE_OT_link_viewer";
+ ot->idname = "NODE_OT_link_viewer";
/* api callbacks */
- ot->exec= node_active_link_viewer;
- ot->poll= ED_operator_node_active;
+ ot->exec = node_active_link_viewer;
+ ot->poll = composite_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -1757,17 +1779,17 @@ static int UNUSED_FUNCTION(node_mouse_groupheader)(SpaceNode *snode)
// XXX int mval[2];
gnode= node_tree_get_editgroup(snode->nodetree);
- if(gnode==NULL) return 0;
+ if (gnode==NULL) return 0;
// XXX getmouseco_areawin(mval);
// XXX areamouseco_to_ipoco(G.v2d, mval, &mx, &my);
/* click in header or outside? */
- if(BLI_in_rctf(&gnode->totr, mx, my)==0) {
+ if (BLI_in_rctf(&gnode->totr, mx, my)==0) {
rctf rect= gnode->totr;
rect.ymax += NODE_DY;
- if(BLI_in_rctf(&rect, mx, my)==0)
+ if (BLI_in_rctf(&rect, mx, my)==0)
snode_make_group_editable(snode, NULL); /* toggles, so exits editmode */
// else
// XXX transform_nodes(snode->nodetree, 'g', "Move group");
@@ -1779,14 +1801,17 @@ 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) {
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
rect.xmin = snode->mx - (NODE_SOCKSIZE+4);
rect.ymin = snode->my - (NODE_SOCKSIZE+4);
@@ -1798,17 +1823,18 @@ static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **
if (in_out == SOCK_IN) {
rect.xmax += NODE_SOCKSIZE;
rect.xmin -= NODE_SOCKSIZE*4;
- } else if (in_out == SOCK_OUT) {
+ }
+ else if (in_out == SOCK_OUT) {
rect.xmax += NODE_SOCKSIZE*4;
rect.xmin -= NODE_SOCKSIZE;
}
}
- if(in_out & SOCK_IN) {
- for(sock= node->inputs.first; sock; sock= sock->next) {
- if(!nodeSocketIsHidden(sock)) {
- if(BLI_in_rctf(&rect, sock->locx, sock->locy)) {
- if(node == visible_node(snode, &rect)) {
+ if (in_out & SOCK_IN) {
+ for (sock= node->inputs.first; sock; sock= sock->next) {
+ if (!nodeSocketIsHidden(sock)) {
+ if (BLI_in_rctf(&rect, sock->locx, sock->locy)) {
+ if (node == visible_node(snode, &rect)) {
*nodep= node;
*sockp= sock;
return 1;
@@ -1817,11 +1843,11 @@ static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **
}
}
}
- if(in_out & SOCK_OUT) {
- for(sock= node->outputs.first; sock; sock= sock->next) {
- if(!nodeSocketIsHidden(sock)) {
- if(BLI_in_rctf(&rect, sock->locx, sock->locy)) {
- if(node == visible_node(snode, &rect)) {
+ if (in_out & SOCK_OUT) {
+ for (sock= node->outputs.first; sock; sock= sock->next) {
+ if (!nodeSocketIsHidden(sock)) {
+ if (BLI_in_rctf(&rect, sock->locx, sock->locy)) {
+ if (node == visible_node(snode, &rect)) {
*nodep= node;
*sockp= sock;
return 1;
@@ -1835,10 +1861,10 @@ static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **
/* check group sockets
* NB: using ngroup->outputs as input sockets and vice versa here!
*/
- if(in_out & SOCK_IN) {
- for(sock= snode->edittree->outputs.first; sock; sock= sock->next) {
- if(!nodeSocketIsHidden(sock)) {
- if(BLI_in_rctf(&rect, sock->locx, sock->locy)) {
+ if (in_out & SOCK_IN) {
+ for (sock= snode->edittree->outputs.first; sock; sock= sock->next) {
+ if (!nodeSocketIsHidden(sock)) {
+ if (BLI_in_rctf(&rect, sock->locx, sock->locy)) {
*nodep= NULL; /* NULL node pointer indicates group socket */
*sockp= sock;
return 1;
@@ -1846,10 +1872,10 @@ static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **
}
}
}
- if(in_out & SOCK_OUT) {
- for(sock= snode->edittree->inputs.first; sock; sock= sock->next) {
- if(!nodeSocketIsHidden(sock)) {
- if(BLI_in_rctf(&rect, sock->locx, sock->locy)) {
+ if (in_out & SOCK_OUT) {
+ for (sock= snode->edittree->inputs.first; sock; sock= sock->next) {
+ if (!nodeSocketIsHidden(sock)) {
+ if (BLI_in_rctf(&rect, sock->locx, sock->locy)) {
*nodep= NULL; /* NULL node pointer indicates group socket */
*sockp= sock;
return 1;
@@ -1861,43 +1887,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 +1933,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 +1969,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,16 +2003,37 @@ 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) {
- if(node->flag & NODE_SELECT) {
+ 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;
BLI_addtail(nodelist, nli);
@@ -2028,43 +2046,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);
@@ -2081,13 +2113,13 @@ bNode *node_add_node(SpaceNode *snode, Main *bmain, Scene *scene, bNodeTemplate
node = nodeAddNode(snode->edittree, ntemp);
/* generics */
- if(node) {
+ if (node) {
node->locx= locx;
node->locy= locy + 60.0f; // arbitrary.. so its visible, (0,0) is top of node
- node->flag |= SELECT;
+ node_select(node);
gnode= node_tree_get_editgroup(snode->nodetree);
- if(gnode) {
+ if (gnode) {
node->locx -= gnode->locx;
node->locy -= gnode->locy;
}
@@ -2095,24 +2127,24 @@ bNode *node_add_node(SpaceNode *snode, Main *bmain, Scene *scene, bNodeTemplate
ntreeUpdateTree(snode->edittree);
ED_node_set_active(bmain, snode->edittree, node);
- if(snode->nodetree->type==NTREE_COMPOSIT) {
- if(ELEM4(node->type, CMP_NODE_R_LAYERS, CMP_NODE_COMPOSITE, CMP_NODE_DEFOCUS, CMP_NODE_OUTPUT_FILE)) {
+ if (snode->nodetree->type==NTREE_COMPOSIT) {
+ if (ELEM4(node->type, CMP_NODE_R_LAYERS, CMP_NODE_COMPOSITE, CMP_NODE_DEFOCUS, CMP_NODE_OUTPUT_FILE)) {
node->id = &scene->id;
}
- else if(ELEM3(node->type, CMP_NODE_MOVIECLIP, CMP_NODE_MOVIEDISTORTION, CMP_NODE_STABILIZE2D)) {
+ else if (ELEM3(node->type, CMP_NODE_MOVIECLIP, CMP_NODE_MOVIEDISTORTION, CMP_NODE_STABILIZE2D)) {
node->id = (ID *)scene->clip;
}
ntreeCompositForceHidden(snode->edittree, scene);
}
- if(node->id)
+ if (node->id)
id_us_plus(node->id);
snode_update(snode, node);
}
- if(snode->nodetree->type==NTREE_TEXTURE) {
+ if (snode->nodetree->type==NTREE_TEXTURE) {
ntreeTexCheckCyclics(snode->edittree);
}
@@ -2132,12 +2164,12 @@ static int node_duplicate_exec(bContext *C, wmOperator *op)
ED_preview_kill_jobs(C);
lastnode = ntree->nodes.last;
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->flag & SELECT) {
newnode = nodeCopyNode(ntree, node);
- if(newnode->id) {
- /* simple id user adjustment, node internal functions dont touch this
+ if (newnode->id) {
+ /* simple id user adjustment, node internal functions don't touch this
* but operators and readfile.c do. */
id_us_plus(newnode->id);
/* to ensure redraws or rerenders happen */
@@ -2183,13 +2215,14 @@ static int node_duplicate_exec(bContext *C, wmOperator *op)
}
/* deselect old nodes, select the copies instead */
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->flag & SELECT) {
/* has been set during copy above */
newnode = node->new_node;
- node->flag &= ~(NODE_SELECT|NODE_ACTIVE);
- newnode->flag |= NODE_SELECT;
+ node_deselect(node);
+ node->flag &= ~NODE_ACTIVE;
+ node_select(newnode);
}
/* make sure we don't copy new nodes again! */
@@ -2208,16 +2241,16 @@ static int node_duplicate_exec(bContext *C, wmOperator *op)
void NODE_OT_duplicate(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Duplicate Nodes";
+ ot->name = "Duplicate Nodes";
ot->description = "Duplicate selected nodes";
- ot->idname= "NODE_OT_duplicate";
+ ot->idname = "NODE_OT_duplicate";
/* api callbacks */
- ot->exec= node_duplicate_exec;
- ot->poll= ED_operator_node_active;
+ ot->exec = node_duplicate_exec;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "keep_inputs", 0, "Keep Inputs", "Keep the input links to duplicated nodes");
}
@@ -2229,22 +2262,22 @@ static void node_remove_extra_links(SpaceNode *snode, bNodeSocket *tsock, bNodeL
bNodeLink *tlink;
bNodeSocket *sock;
- if(tsock && nodeCountSocketLinks(snode->edittree, link->tosock) > tsock->limit) {
+ if (tsock && nodeCountSocketLinks(snode->edittree, link->tosock) > tsock->limit) {
- for(tlink= snode->edittree->links.first; tlink; tlink= tlink->next) {
- if(link!=tlink && tlink->tosock==link->tosock)
+ for (tlink= snode->edittree->links.first; tlink; tlink= tlink->next) {
+ if (link!=tlink && tlink->tosock==link->tosock)
break;
}
- if(tlink) {
+ if (tlink) {
/* try to move the existing link to the next available socket */
if (tlink->tonode) {
/* is there a free input socket with the target type? */
- for(sock= tlink->tonode->inputs.first; sock; sock= sock->next) {
- if(sock->type==tlink->tosock->type)
- if(nodeCountSocketLinks(snode->edittree, sock) < sock->limit)
+ for (sock= tlink->tonode->inputs.first; sock; sock= sock->next) {
+ if (sock->type==tlink->tosock->type)
+ if (nodeCountSocketLinks(snode->edittree, sock) < sock->limit)
break;
}
- if(sock) {
+ if (sock) {
tlink->tosock= sock;
sock->flag &= ~(SOCK_HIDDEN|SOCK_AUTO_HIDDEN);
}
@@ -2254,6 +2287,8 @@ static void node_remove_extra_links(SpaceNode *snode, bNodeSocket *tsock, bNodeL
}
else
nodeRemLink(snode->edittree, tlink);
+
+ snode->edittree->update |= NTREE_UPDATE_LINKS;
}
}
}
@@ -2281,10 +2316,13 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event)
switch (event->type) {
case MOUSEMOVE:
- if(in_out==SOCK_OUT) {
- if(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)) ) {
+ if (in_out==SOCK_OUT) {
+ /* 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;
link->tosock= tsock;
if (link->prev==NULL && link->next==NULL) {
@@ -2295,6 +2333,9 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event)
ntreeUpdateTree(snode->edittree);
}
}
+
+ /* hilight target socket */
+ node_socket_select(tnode, tsock);
}
else {
if (link->tonode || link->tosock) {
@@ -2309,10 +2350,13 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event)
}
}
else {
- if(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)) ) {
+ /* 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)) ) {
link->fromnode= tnode;
link->fromsock= tsock;
if (link->prev==NULL && link->next==NULL) {
@@ -2324,6 +2368,9 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event)
}
}
}
+
+ /* hilight target socket */
+ node_socket_select(tnode, tsock);
}
else {
if (link->tonode || link->tosock) {
@@ -2336,22 +2383,25 @@ 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;
case LEFTMOUSE:
case RIGHTMOUSE:
case MIDDLEMOUSE:
- if(link->tosock && link->fromsock) {
+ if (link->tosock && link->fromsock) {
/* send changed events for original tonode and new */
snode_update(snode, link->tonode);
/* we might need to remove a link */
- if(in_out==SOCK_OUT)
+ 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) {
@@ -2376,6 +2426,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);
@@ -2397,49 +2451,58 @@ 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(nodeCountSocketLinks(snode->edittree, nldrag->sock) < nldrag->sock->limit)
- return SOCK_OUT;
+ if (node_find_indicated_socket(snode, &nldrag->node, &nldrag->sock, SOCK_OUT)) {
+ if (nodeCountSocketLinks(snode->edittree, nldrag->sock) < nldrag->sock->limit)
+ in_out = SOCK_OUT;
else {
/* find if we break a link */
- for(link= snode->edittree->links.first; link; link= link->next) {
- if(link->fromsock==nldrag->sock)
+ for (link= snode->edittree->links.first; link; link= link->next) {
+ if (link->fromsock==nldrag->sock)
break;
}
- if(link) {
+ if (link) {
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);
+ node_socket_select(nldrag->node, nldrag->sock);
}
/* or an input? */
- else if(find_indicated_socket(snode, &nldrag->node, &nldrag->sock, SOCK_IN)) {
- if(nodeCountSocketLinks(snode->edittree, nldrag->sock) < nldrag->sock->limit)
- return SOCK_IN;
+ else if (node_find_indicated_socket(snode, &nldrag->node, &nldrag->sock, SOCK_IN)) {
+ if (nodeCountSocketLinks(snode->edittree, nldrag->sock) < nldrag->sock->limit)
+ in_out = SOCK_IN;
else {
/* find if we break a link */
- for(link= snode->edittree->links.first; link; link= link->next) {
- if(link->tosock==nldrag->sock)
+ for (link= snode->edittree->links.first; link; link= link->next) {
+ if (link->tosock==nldrag->sock)
break;
}
- if(link) {
+ if (link) {
/* send changed event to original tonode */
- if(link->tonode)
+ if (link->tonode)
snode_update(snode, link->tonode);
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);
+ node_socket_select(nldrag->node, nldrag->sock);
}
- return 0;
+ return in_out;
}
static int node_link_invoke(bContext *C, wmOperator *op, wmEvent *event)
@@ -2456,11 +2519,11 @@ static int node_link_invoke(bContext *C, wmOperator *op, wmEvent *event)
nldrag->in_out= node_link_init(snode, nldrag);
- if(nldrag->in_out) {
+ if (nldrag->in_out) {
op->customdata= nldrag;
/* we make a temporal link */
- if(nldrag->in_out==SOCK_OUT) {
+ if (nldrag->in_out==SOCK_OUT) {
nldrag->link= MEM_callocN(sizeof(bNodeLink), "link");
nldrag->link->fromnode= nldrag->node;
nldrag->link->fromsock= nldrag->sock;
@@ -2502,18 +2565,18 @@ static int node_link_cancel(bContext *C, wmOperator *op)
void NODE_OT_link(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Link Nodes";
- ot->idname= "NODE_OT_link";
+ ot->name = "Link Nodes";
+ ot->idname = "NODE_OT_link";
/* api callbacks */
- ot->invoke= node_link_invoke;
- ot->modal= node_link_modal;
-// ot->exec= node_link_exec;
- ot->poll= ED_operator_node_active;
- ot->cancel= node_link_cancel;
+ ot->invoke = node_link_invoke;
+ ot->modal = node_link_modal;
+// ot->exec = node_link_exec;
+ ot->poll = ED_operator_node_active;
+ ot->cancel = node_link_cancel;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
}
/* ********************** Make Link operator ***************** */
@@ -2528,6 +2591,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);
@@ -2538,16 +2605,16 @@ static int node_make_link_exec(bContext *C, wmOperator *op)
void NODE_OT_link_make(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Make Links";
- ot->description= "Makes a link between selected output in input sockets";
- ot->idname= "NODE_OT_link_make";
+ ot->name = "Make Links";
+ ot->description = "Makes a link between selected output in input sockets";
+ ot->idname = "NODE_OT_link_make";
/* callbacks */
- ot->exec= node_make_link_exec;
- ot->poll= ED_operator_node_active; // XXX we need a special poll which checks that there are selected input/output sockets
+ ot->exec = node_make_link_exec;
+ ot->poll = ED_operator_node_active; // XXX we need a special poll which checks that there are selected input/output sockets
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "replace", 0, "Replace", "Replace socket connections with the new links");
}
@@ -2560,11 +2627,11 @@ static int cut_links_intersect(bNodeLink *link, float mcoords[][2], int tot)
float coord_array[LINK_RESOL+1][2];
int i, b;
- if(node_link_bezier_points(NULL, NULL, link, coord_array, LINK_RESOL)) {
+ if (node_link_bezier_points(NULL, NULL, link, coord_array, LINK_RESOL)) {
- for(i=0; i<tot-1; i++)
- for(b=0; b<LINK_RESOL; b++)
- if(isect_line_line_v2(mcoords[i], mcoords[i+1], coord_array[b], coord_array[b+1]) > 0)
+ for (i=0; i<tot-1; i++)
+ for (b=0; b<LINK_RESOL; b++)
+ if (isect_line_line_v2(mcoords[i], mcoords[i+1], coord_array[b], coord_array[b+1]) > 0)
return 1;
}
return 0;
@@ -2584,19 +2651,19 @@ static int cut_links_exec(bContext *C, wmOperator *op)
UI_view2d_region_to_view(&ar->v2d, (short)loc[0], (short)loc[1],
&mcoords[i][0], &mcoords[i][1]);
i++;
- if(i>= 256) break;
+ if (i>= 256) break;
}
RNA_END;
- if(i>1) {
+ if (i>1) {
bNodeLink *link, *next;
ED_preview_kill_jobs(C);
- for(link= snode->edittree->links.first; link; link= next) {
+ for (link= snode->edittree->links.first; link; link= next) {
next= link->next;
- if(cut_links_intersect(link, mcoords, i)) {
+ if (cut_links_intersect(link, mcoords, i)) {
snode_update(snode, link->tonode);
nodeRemLink(snode->edittree, link);
}
@@ -2616,18 +2683,18 @@ void NODE_OT_links_cut(wmOperatorType *ot)
{
PropertyRNA *prop;
- ot->name= "Cut links";
- ot->idname= "NODE_OT_links_cut";
+ ot->name = "Cut links";
+ ot->idname = "NODE_OT_links_cut";
- ot->invoke= WM_gesture_lines_invoke;
- ot->modal= WM_gesture_lines_modal;
- ot->exec= cut_links_exec;
- ot->cancel= WM_gesture_lines_cancel;
+ ot->invoke = WM_gesture_lines_invoke;
+ ot->modal = WM_gesture_lines_modal;
+ ot->exec = cut_links_exec;
+ ot->cancel = WM_gesture_lines_cancel;
- ot->poll= ED_operator_node_active;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
@@ -2645,8 +2712,8 @@ static int detach_links_exec(bContext *C, wmOperator *UNUSED(op))
ED_preview_kill_jobs(C);
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->flag & SELECT) {
nodeInternalRelink(ntree, node);
}
}
@@ -2661,47 +2728,48 @@ static int detach_links_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_links_detach(wmOperatorType *ot)
{
- ot->name= "Detach Links";
- ot->idname= "NODE_OT_links_detach";
+ ot->name = "Detach Links";
+ ot->idname = "NODE_OT_links_detach";
- ot->exec= detach_links_exec;
- ot->poll= ED_operator_node_active;
+ ot->exec = detach_links_exec;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ********************* 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 */
@@ -2712,27 +2780,27 @@ static SpaceNode *ed_node_link_conditions(ScrArea *sa, bNode **select)
bNodeLink *link;
/* no unlucky accidents */
- if(sa==NULL || sa->spacetype!=SPACE_NODE) return NULL;
+ if (sa==NULL || sa->spacetype!=SPACE_NODE) return NULL;
*select= NULL;
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
- if(*select)
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
+ if (node->flag & SELECT) {
+ if (*select)
break;
else
*select= node;
}
}
/* only one selected */
- if(node || *select==NULL) return NULL;
+ if (node || *select==NULL) return NULL;
/* correct node */
- if((*select)->inputs.first==NULL || (*select)->outputs.first==NULL) return NULL;
+ if ((*select)->inputs.first==NULL || (*select)->outputs.first==NULL) return NULL;
/* test node for links */
- for(link= snode->edittree->links.first; link; link=link->next) {
- if(link->tonode == *select || link->fromnode == *select)
+ for (link= snode->edittree->links.first; link; link=link->next) {
+ if (link->tonode == *select || link->fromnode == *select)
return NULL;
}
@@ -2747,22 +2815,22 @@ void ED_node_link_insert(ScrArea *sa)
bNodeLink *link;
bNodeSocket *sockto;
- if(snode==NULL) return;
+ if (snode==NULL) return;
/* get the link */
- for(link= snode->edittree->links.first; link; link=link->next)
- if(link->flag & NODE_LINKFLAG_HILITE)
+ for (link= snode->edittree->links.first; link; link=link->next)
+ if (link->flag & NODE_LINKFLAG_HILITE)
break;
- if(link) {
+ if (link) {
node= link->tonode;
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);
@@ -2778,13 +2846,13 @@ void ED_node_link_intersect_test(ScrArea *sa, int test)
bNodeLink *link, *selink=NULL;
float mcoords[6][2];
- if(snode==NULL) return;
+ if (snode==NULL) return;
/* clear flags */
- for(link= snode->edittree->links.first; link; link=link->next)
+ for (link= snode->edittree->links.first; link; link=link->next)
link->flag &= ~NODE_LINKFLAG_HILITE;
- if(test==0) return;
+ if (test==0) return;
/* okay, there's 1 node, without links, now intersect */
mcoords[0][0]= select->totr.xmin;
@@ -2802,16 +2870,16 @@ void ED_node_link_intersect_test(ScrArea *sa, int test)
/* we only tag a single link for intersect now */
/* idea; use header dist when more? */
- for(link= snode->edittree->links.first; link; link=link->next) {
+ for (link= snode->edittree->links.first; link; link=link->next) {
- if(cut_links_intersect(link, mcoords, 5)) { /* intersect code wants edges */
- if(selink)
+ if (cut_links_intersect(link, mcoords, 5)) { /* intersect code wants edges */
+ if (selink)
break;
selink= link;
}
}
- if(link==NULL && selink)
+ if (link==NULL && selink)
selink->flag |= NODE_LINKFLAG_HILITE;
}
@@ -2831,13 +2899,13 @@ static int node_read_renderlayers_exec(bContext *C, wmOperator *UNUSED(op))
ED_preview_kill_jobs(C);
/* first tag scenes unread */
- for(scene= bmain->scene.first; scene; scene= scene->id.next)
+ for (scene= bmain->scene.first; scene; scene= scene->id.next)
scene->id.flag |= LIB_DOIT;
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS) {
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
+ if (node->type==CMP_NODE_R_LAYERS) {
ID *id= node->id;
- if(id->flag & LIB_DOIT) {
+ if (id->flag & LIB_DOIT) {
RE_ReadRenderResult(curscene, (Scene *)id);
ntreeCompositTagRender((Scene *)id);
id->flag &= ~LIB_DOIT;
@@ -2854,15 +2922,15 @@ static int node_read_renderlayers_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_read_renderlayers(wmOperatorType *ot)
{
- ot->name= "Read Render Layers";
- ot->idname= "NODE_OT_read_renderlayers";
+ ot->name = "Read Render Layers";
+ ot->idname = "NODE_OT_read_renderlayers";
- ot->exec= node_read_renderlayers_exec;
+ ot->exec = node_read_renderlayers_exec;
- ot->poll= composite_node_active;
+ ot->poll = composite_node_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
static int node_read_fullsamplelayers_exec(bContext *C, wmOperator *UNUSED(op))
@@ -2877,7 +2945,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;
@@ -2887,15 +2955,15 @@ static int node_read_fullsamplelayers_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_read_fullsamplelayers(wmOperatorType *ot)
{
- ot->name= "Read Full Sample Layers";
- ot->idname= "NODE_OT_read_fullsamplelayers";
+ ot->name = "Read Full Sample Layers";
+ ot->idname = "NODE_OT_read_fullsamplelayers";
- ot->exec= node_read_fullsamplelayers_exec;
+ ot->exec = node_read_fullsamplelayers_exec;
- ot->poll= composite_node_active;
+ ot->poll = composite_node_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
int node_render_changed_exec(bContext *C, wmOperator *UNUSED(op))
@@ -2903,15 +2971,15 @@ int node_render_changed_exec(bContext *C, wmOperator *UNUSED(op))
Scene *sce= CTX_data_scene(C);
bNode *node;
- for(node= sce->nodetree->nodes.first; node; node= node->next) {
- if(node->id==(ID *)sce && node->need_exec) {
+ for (node= sce->nodetree->nodes.first; node; node= node->next) {
+ if (node->id==(ID *)sce && node->need_exec) {
break;
}
}
- if(node) {
+ if (node) {
SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1);
- if(srl) {
+ if (srl) {
PointerRNA op_ptr;
WM_operator_properties_create(&op_ptr, "RENDER_OT_render");
@@ -2935,15 +3003,15 @@ int node_render_changed_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_render_changed(wmOperatorType *ot)
{
- ot->name= "Render Changed Layer";
- ot->idname= "NODE_OT_render_changed";
+ ot->name = "Render Changed Layer";
+ ot->idname = "NODE_OT_render_changed";
- ot->exec= node_render_changed_exec;
+ ot->exec = node_render_changed_exec;
- ot->poll= composite_node_active;
+ ot->poll = composite_node_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
@@ -2954,20 +3022,20 @@ static int node_group_make_exec(bContext *C, wmOperator *op)
SpaceNode *snode = CTX_wm_space_node(C);
bNode *gnode;
- if(snode->edittree!=snode->nodetree) {
+ if (snode->edittree!=snode->nodetree) {
BKE_report(op->reports, RPT_WARNING, "Can not add a new Group in a Group");
return OPERATOR_CANCELLED;
}
/* for time being... is too complex to handle */
- if(snode->treetype==NTREE_COMPOSIT) {
- for(gnode=snode->nodetree->nodes.first; gnode; gnode= gnode->next) {
- if(gnode->flag & SELECT)
- if(gnode->type==CMP_NODE_R_LAYERS)
+ if (snode->treetype==NTREE_COMPOSIT) {
+ for (gnode=snode->nodetree->nodes.first; gnode; gnode= gnode->next) {
+ if (gnode->flag & SELECT)
+ if (gnode->type==CMP_NODE_R_LAYERS)
break;
}
- if(gnode) {
+ if (gnode) {
BKE_report(op->reports, RPT_WARNING, "Can not add RenderLayer in a Group");
return OPERATOR_CANCELLED;
}
@@ -2976,7 +3044,7 @@ static int node_group_make_exec(bContext *C, wmOperator *op)
ED_preview_kill_jobs(C);
gnode= node_group_make_from_selected(snode->nodetree);
- if(gnode==NULL) {
+ if (gnode==NULL) {
BKE_report(op->reports, RPT_WARNING, "Can not make Group");
return OPERATOR_CANCELLED;
}
@@ -3017,29 +3085,29 @@ static void node_flag_toggle_exec(SpaceNode *snode, int toggle_flag)
* If the flag is set on all nodes it is unset.
* If the flag is not set on all nodes, it is set.
*/
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
+ if (node->flag & SELECT) {
- if(toggle_flag== NODE_PREVIEW && (node->typeinfo->flag & NODE_PREVIEW)==0)
+ if (toggle_flag== NODE_PREVIEW && (node->typeinfo->flag & NODE_PREVIEW)==0)
continue;
- if(toggle_flag== NODE_OPTIONS && (node->typeinfo->flag & NODE_OPTIONS)==0)
+ if (toggle_flag== NODE_OPTIONS && (node->typeinfo->flag & NODE_OPTIONS)==0)
continue;
- if(node->flag & toggle_flag)
+ if (node->flag & toggle_flag)
tot_eq++;
else
tot_neq++;
}
}
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
+ if (node->flag & SELECT) {
- if(toggle_flag== NODE_PREVIEW && (node->typeinfo->flag & NODE_PREVIEW)==0)
+ if (toggle_flag== NODE_PREVIEW && (node->typeinfo->flag & NODE_PREVIEW)==0)
continue;
- if(toggle_flag== NODE_OPTIONS && (node->typeinfo->flag & NODE_OPTIONS)==0)
+ if (toggle_flag== NODE_OPTIONS && (node->typeinfo->flag & NODE_OPTIONS)==0)
continue;
- if( (tot_eq && tot_neq) || tot_eq==0) {
+ if ( (tot_eq && tot_neq) || tot_eq==0) {
node->flag |= toggle_flag;
/* hide/unhide node also toggles unlinked socket display */
@@ -3062,7 +3130,7 @@ static int node_hide_toggle_exec(bContext *C, wmOperator *UNUSED(op))
SpaceNode *snode= CTX_wm_space_node(C);
/* sanity checking (poll callback checks this already) */
- if((snode == NULL) || (snode->edittree == NULL))
+ if ((snode == NULL) || (snode->edittree == NULL))
return OPERATOR_CANCELLED;
node_flag_toggle_exec(snode, NODE_HIDDEN);
@@ -3075,16 +3143,16 @@ static int node_hide_toggle_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_hide_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Hide";
- ot->description= "Toggle hiding of selected nodes";
- ot->idname= "NODE_OT_hide_toggle";
+ ot->name = "Hide";
+ ot->description = "Toggle hiding of selected nodes";
+ ot->idname = "NODE_OT_hide_toggle";
/* callbacks */
- ot->exec= node_hide_toggle_exec;
- ot->poll= ED_operator_node_active;
+ ot->exec = node_hide_toggle_exec;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int node_preview_toggle_exec(bContext *C, wmOperator *UNUSED(op))
@@ -3092,7 +3160,7 @@ static int node_preview_toggle_exec(bContext *C, wmOperator *UNUSED(op))
SpaceNode *snode= CTX_wm_space_node(C);
/* sanity checking (poll callback checks this already) */
- if((snode == NULL) || (snode->edittree == NULL))
+ if ((snode == NULL) || (snode->edittree == NULL))
return OPERATOR_CANCELLED;
ED_preview_kill_jobs(C);
@@ -3107,16 +3175,16 @@ static int node_preview_toggle_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_preview_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Node Preview";
- ot->description= "Toggle preview display for selected nodes";
- ot->idname= "NODE_OT_preview_toggle";
+ ot->name = "Toggle Node Preview";
+ ot->description = "Toggle preview display for selected nodes";
+ ot->idname = "NODE_OT_preview_toggle";
/* callbacks */
- ot->exec= node_preview_toggle_exec;
- ot->poll= ED_operator_node_active;
+ ot->exec = node_preview_toggle_exec;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int node_options_toggle_exec(bContext *C, wmOperator *UNUSED(op))
@@ -3124,7 +3192,7 @@ static int node_options_toggle_exec(bContext *C, wmOperator *UNUSED(op))
SpaceNode *snode= CTX_wm_space_node(C);
/* sanity checking (poll callback checks this already) */
- if((snode == NULL) || (snode->edittree == NULL))
+ if ((snode == NULL) || (snode->edittree == NULL))
return OPERATOR_CANCELLED;
node_flag_toggle_exec(snode, NODE_OPTIONS);
@@ -3137,16 +3205,16 @@ static int node_options_toggle_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_options_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Node Options";
- ot->description= "Toggle option buttons display for selected nodes";
- ot->idname= "NODE_OT_options_toggle";
+ ot->name = "Toggle Node Options";
+ ot->description = "Toggle option buttons display for selected nodes";
+ ot->idname = "NODE_OT_options_toggle";
/* callbacks */
- ot->exec= node_options_toggle_exec;
- ot->poll= ED_operator_node_active;
+ ot->exec = node_options_toggle_exec;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
static int node_socket_toggle_exec(bContext *C, wmOperator *UNUSED(op))
@@ -3156,24 +3224,24 @@ static int node_socket_toggle_exec(bContext *C, wmOperator *UNUSED(op))
int hidden;
/* sanity checking (poll callback checks this already) */
- if((snode == NULL) || (snode->edittree == NULL))
+ if ((snode == NULL) || (snode->edittree == NULL))
return OPERATOR_CANCELLED;
ED_preview_kill_jobs(C);
/* Toggle for all selected nodes */
hidden = 0;
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
- if(node_has_hidden_sockets(node, SOCK_HIDDEN)) {
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
+ if (node->flag & SELECT) {
+ if (node_has_hidden_sockets(node, SOCK_HIDDEN)) {
hidden= 1;
break;
}
}
}
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
+ if (node->flag & SELECT) {
node_set_hidden_sockets(snode, node, SOCK_HIDDEN, !hidden);
}
}
@@ -3188,16 +3256,16 @@ static int node_socket_toggle_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_hide_socket_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Hidden Node Sockets";
- ot->description= "Toggle unused node socket display";
- ot->idname= "NODE_OT_hide_socket_toggle";
+ ot->name = "Toggle Hidden Node Sockets";
+ ot->description = "Toggle unused node socket display";
+ ot->idname = "NODE_OT_hide_socket_toggle";
/* callbacks */
- ot->exec= node_socket_toggle_exec;
- ot->poll= ED_operator_node_active;
+ ot->exec = node_socket_toggle_exec;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ****************** Mute operator *********************** */
@@ -3209,7 +3277,7 @@ static int node_mute_exec(bContext *C, wmOperator *UNUSED(op))
ED_preview_kill_jobs(C);
- for(node= snode->edittree->nodes.first; node; node= node->next) {
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
/* Only allow muting of nodes having a mute func! */
if ((node->flag & SELECT) && node->typeinfo->internal_connect) {
node->flag ^= NODE_MUTED;
@@ -3226,16 +3294,16 @@ static int node_mute_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_mute_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Node Mute";
- ot->description= "Toggle muting of the nodes";
- ot->idname= "NODE_OT_mute_toggle";
+ ot->name = "Toggle Node Mute";
+ ot->description = "Toggle muting of the nodes";
+ ot->idname = "NODE_OT_mute_toggle";
/* callbacks */
- ot->exec= node_mute_exec;
- ot->poll= ED_operator_node_active;
+ ot->exec = node_mute_exec;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ****************** Delete operator ******************* */
@@ -3247,11 +3315,11 @@ static int node_delete_exec(bContext *C, wmOperator *UNUSED(op))
ED_preview_kill_jobs(C);
- for(node= snode->edittree->nodes.first; node; node= next) {
+ for (node= snode->edittree->nodes.first; node; node= next) {
next= node->next;
- if(node->flag & SELECT) {
+ if (node->flag & SELECT) {
/* check id user here, nodeFreeNode is called for free dbase too */
- if(node->id)
+ if (node->id)
node->id->us--;
nodeFreeNode(snode->edittree, node);
}
@@ -3268,16 +3336,16 @@ static int node_delete_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_delete(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete";
+ ot->name = "Delete";
ot->description = "Delete selected nodes";
- ot->idname= "NODE_OT_delete";
+ ot->idname = "NODE_OT_delete";
/* api callbacks */
- ot->exec= node_delete_exec;
- ot->poll= ED_operator_node_active;
+ ot->exec = node_delete_exec;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ****************** Delete with reconnect ******************* */
@@ -3288,13 +3356,13 @@ static int node_delete_reconnect_exec(bContext *C, wmOperator *UNUSED(op))
ED_preview_kill_jobs(C);
- for(node= snode->edittree->nodes.first; node; node= next) {
+ for (node= snode->edittree->nodes.first; node; node= next) {
next= node->next;
- if(node->flag & SELECT) {
+ if (node->flag & SELECT) {
nodeInternalRelink(snode->edittree, node);
/* check id user here, nodeFreeNode is called for free dbase too */
- if(node->id)
+ if (node->id)
node->id->us--;
nodeFreeNode(snode->edittree, node);
}
@@ -3311,16 +3379,16 @@ static int node_delete_reconnect_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_delete_reconnect(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete with reconnect";
+ ot->name = "Delete with reconnect";
ot->description = "Delete nodes; will reconnect nodes as if deletion was muted";
- ot->idname= "NODE_OT_delete_reconnect";
+ ot->idname = "NODE_OT_delete_reconnect";
/* api callbacks */
- ot->exec= node_delete_reconnect_exec;
- ot->poll= ED_operator_node_active;
+ ot->exec = node_delete_reconnect_exec;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ****************** Show Cyclic Dependencies Operator ******************* */
@@ -3339,16 +3407,16 @@ static int node_show_cycles_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_show_cyclic_dependencies(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Show Cyclic Dependencies";
- ot->description= "Sort the nodes and show the cyclic dependencies between the nodes";
- ot->idname= "NODE_OT_show_cyclic_dependencies";
+ ot->name = "Show Cyclic Dependencies";
+ ot->description = "Sort the nodes and show the cyclic dependencies between the nodes";
+ ot->idname = "NODE_OT_show_cyclic_dependencies";
/* callbacks */
- ot->exec= node_show_cycles_exec;
- ot->poll= ED_operator_node_active;
+ ot->exec = node_show_cycles_exec;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ****************** Add File Node Operator ******************* */
@@ -3362,11 +3430,8 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
Image *ima= NULL;
bNodeTemplate ntemp;
- 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);
@@ -3374,18 +3439,17 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
ima= BKE_add_image_file(path);
- if(!ima) {
+ if (!ima) {
BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s", path, errno ? strerror(errno) : "Unsupported image format");
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);
- if(!ima) {
+ if (!ima) {
BKE_reportf(op->reports, RPT_ERROR, "Image named \"%s\", not found", name);
return OPERATOR_CANCELLED;
}
@@ -3393,12 +3457,20 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
node_deselect_all(snode);
- if (snode->nodetree->type==NTREE_COMPOSIT)
- ntemp.type = CMP_NODE_IMAGE;
-
- if (ntemp.type < 0)
- return OPERATOR_CANCELLED;
-
+ switch (snode->nodetree->type) {
+ case NTREE_SHADER:
+ ntemp.type = SH_NODE_TEX_IMAGE;
+ break;
+ case NTREE_TEXTURE:
+ ntemp.type = TEX_NODE_IMAGE;
+ break;
+ case NTREE_COMPOSIT:
+ ntemp.type = CMP_NODE_IMAGE;
+ break;
+ default:
+ return OPERATOR_CANCELLED;
+ }
+
ED_preview_kill_jobs(C);
node = node_add_node(snode, bmain, scene, &ntemp, snode->mx, snode->my);
@@ -3434,17 +3506,17 @@ static int node_add_file_invoke(bContext *C, wmOperator *op, wmEvent *event)
void NODE_OT_add_file(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add File Node";
- ot->description= "Add a file node to the current node editor";
- ot->idname= "NODE_OT_add_file";
+ ot->name = "Add File Node";
+ ot->description = "Add a file node to the current node editor";
+ ot->idname = "NODE_OT_add_file";
/* callbacks */
- ot->exec= node_add_file_exec;
- ot->invoke= node_add_file_invoke;
- ot->poll= composite_node_active;
+ ot->exec = node_add_file_exec;
+ ot->invoke = node_add_file_invoke;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY); //XXX TODO, relative_path
RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME-2, "Name", "Datablock name to assign");
@@ -3473,13 +3545,13 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "name", treename);
ntree = ntreeAddTree(treename, treetype, 0);
- if(!ntree)
+ if (!ntree)
return OPERATOR_CANCELLED;
/* hook into UI */
uiIDContextProperty(C, &ptr, &prop);
- if(prop) {
+ if (prop) {
RNA_id_pointer_create(&ntree->id, &idptr);
RNA_property_pointer_set(&ptr, prop, idptr);
/* RNA_property_pointer_set increases the user count,
@@ -3488,7 +3560,7 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
--ntree->id.us;
RNA_property_update(C, &ptr, prop);
}
- else if(snode) {
+ else if (snode) {
Scene *scene= CTX_data_scene(C);
snode->nodetree = ntree;
@@ -3501,63 +3573,61 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
void NODE_OT_new_node_tree(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "New node tree";
- ot->idname= "NODE_OT_new_node_tree";
+ ot->name = "New node tree";
+ ot->idname = "NODE_OT_new_node_tree";
/* api callbacks */
- ot->exec= new_node_tree_exec;
- ot->poll= ED_operator_node_active;
+ ot->exec = new_node_tree_exec;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "type", nodetree_type_items, NTREE_COMPOSIT, "Tree Type", "");
RNA_def_string(ot->srna, "name", "NodeTree", MAX_ID_NAME-2, "Name", "");
}
-/* ****************** Multi File Output Add Socket ******************* */
+/* ****************** File Output Add Socket ******************* */
-static int node_output_multi_file_add_socket_exec(bContext *C, wmOperator *UNUSED(op))
+static int node_output_file_add_socket_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
SpaceNode *snode= CTX_wm_space_node(C);
bNodeTree *ntree = snode->edittree;
bNode *node = nodeGetActive(ntree);
+ char file_path[MAX_NAME];
if (!node)
return OPERATOR_CANCELLED;
- ntreeCompositOutputMultiFileAddSocket(ntree, node, &scene->r.im_format);
+ RNA_string_get(op->ptr, "file_path", file_path);
+ ntreeCompositOutputFileAddSocket(ntree, node, file_path, &scene->r.im_format);
snode_notify(C, snode);
return OPERATOR_FINISHED;
}
-static int node_output_multi_file_add_socket_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
-{
- return node_output_multi_file_add_socket_exec(C, op);
-}
-
-void NODE_OT_output_multi_file_add_socket(wmOperatorType *ot)
+void NODE_OT_output_file_add_socket(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Multi File Node Socket";
- ot->description= "Add a new input to a multi file output node";
- ot->idname= "NODE_OT_output_multi_file_add_socket";
+ ot->name = "Add File Node Socket";
+ ot->description = "Add a new input to a file output node";
+ ot->idname = "NODE_OT_output_file_add_socket";
/* callbacks */
- ot->exec= node_output_multi_file_add_socket_exec;
- ot->invoke= node_output_multi_file_add_socket_invoke;
- ot->poll= composite_node_active;
+ ot->exec = node_output_file_add_socket_exec;
+ ot->poll = composite_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_string(ot->srna, "file_path", "Image", MAX_NAME, "File Path", "Sub-path of the output file");
}
/* ****************** Multi File Output Remove Socket ******************* */
-static int node_output_multi_file_remove_active_socket_exec(bContext *C, wmOperator *UNUSED(op))
+static int node_output_file_remove_active_socket_exec(bContext *C, wmOperator *UNUSED(op))
{
SpaceNode *snode= CTX_wm_space_node(C);
bNodeTree *ntree = snode->edittree;
@@ -3566,7 +3636,7 @@ static int node_output_multi_file_remove_active_socket_exec(bContext *C, wmOpera
if (!node)
return OPERATOR_CANCELLED;
- if (!ntreeCompositOutputMultiFileRemoveActiveSocket(ntree, node))
+ if (!ntreeCompositOutputFileRemoveActiveSocket(ntree, node))
return OPERATOR_CANCELLED;
snode_notify(C, snode);
@@ -3574,17 +3644,17 @@ static int node_output_multi_file_remove_active_socket_exec(bContext *C, wmOpera
return OPERATOR_FINISHED;
}
-void NODE_OT_output_multi_file_remove_active_socket(wmOperatorType *ot)
+void NODE_OT_output_file_remove_active_socket(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Remove Multi File Node Socket";
- ot->description= "Remove active input from a multi file output node";
- ot->idname= "NODE_OT_output_multi_file_remove_active_socket";
+ ot->name = "Remove File Node Socket";
+ ot->description = "Remove active input from a file output node";
+ ot->idname = "NODE_OT_output_file_remove_active_socket";
/* callbacks */
- ot->exec= node_output_multi_file_remove_active_socket_exec;
- ot->poll= composite_node_active;
+ ot->exec = node_output_file_remove_active_socket_exec;
+ ot->poll = composite_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c
index df83afc143e..7ddc4bdf857 100644
--- a/source/blender/editors/space_node/node_header.c
+++ b/source/blender/editors/space_node/node_header.c
@@ -75,33 +75,33 @@ static void do_node_add(bContext *C, bNodeTemplate *ntemp)
bNode *node;
/* get location to add node at mouse */
- for(ar=sa->regionbase.first; ar; ar=ar->next) {
- if(ar->regiontype == RGN_TYPE_WINDOW) {
+ for (ar=sa->regionbase.first; ar; ar=ar->next) {
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
wmWindow *win= CTX_wm_window(C);
int x= win->eventstate->x - ar->winrct.xmin;
int y= win->eventstate->y - ar->winrct.ymin;
- if(y < 60) y+= 60;
+ if (y < 60) y+= 60;
UI_view2d_region_to_view(&ar->v2d, x, y, &snode->mx, &snode->my);
}
}
/* store selection in temp test flag */
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & NODE_SELECT) node->flag |= NODE_TEST;
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
+ if (node->flag & NODE_SELECT) node->flag |= NODE_TEST;
else node->flag &= ~NODE_TEST;
}
/* node= */ node_add_node(snode, bmain, scene, ntemp, snode->mx, snode->my);
/* select previous selection before autoconnect */
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & NODE_TEST) node->flag |= NODE_SELECT;
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
+ if (node->flag & NODE_TEST) node->flag |= NODE_SELECT;
}
/* deselect after autoconnection */
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & NODE_TEST) node->flag &= ~NODE_SELECT;
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
+ if (node->flag & NODE_TEST) node->flag &= ~NODE_SELECT;
}
snode_notify(C, snode);
@@ -195,13 +195,13 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
ntree = snode->nodetree;
- if(!ntree) {
+ if (!ntree) {
uiItemS(layout);
return;
}
- if(ntree->type == NTREE_SHADER) {
- if(scene_use_new_shading_nodes(scene))
+ if (ntree->type == NTREE_SHADER) {
+ if (scene_use_new_shading_nodes(scene))
compatibility= NODE_NEW_SHADING;
else
compatibility= NODE_OLD_SHADING;
@@ -214,14 +214,14 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
/* XXX hack: negative numbers used for empty group types */
if (node_tree_has_type(ntree->type, NODE_GROUP))
- uiItemV(layout, "New Group", 0, -NODE_GROUP);
+ uiItemV(layout, IFACE_("New Group"), 0, -NODE_GROUP);
if (node_tree_has_type(ntree->type, NODE_FORLOOP))
- uiItemV(layout, "New For Loop", 0, -NODE_FORLOOP);
+ uiItemV(layout, IFACE_("New For Loop"), 0, -NODE_FORLOOP);
if (node_tree_has_type(ntree->type, NODE_WHILELOOP))
- uiItemV(layout, "New While Loop", 0, -NODE_WHILELOOP);
+ uiItemV(layout, IFACE_("New While Loop"), 0, -NODE_WHILELOOP);
uiItemS(layout);
- for(ngroup=bmain->nodetree.first, event=0; ngroup; ngroup= ngroup->id.next, ++event) {
+ for (ngroup=bmain->nodetree.first, event=0; ngroup; ngroup= ngroup->id.next, ++event) {
/* only use group trees */
if (ngroup->type==ntree->type && ELEM3(ngroup->nodetype, NODE_GROUP, NODE_FORLOOP, NODE_WHILELOOP)) {
uiItemV(layout, ngroup->id.name+2, 0, event);
@@ -239,7 +239,7 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
for (ntype=ntreeGetType(ntree->type)->node_types.first; ntype; ntype=ntype->next) {
if (ntype->nclass==nodeclass && ntype->name)
if (!compatibility || (ntype->compatibility & compatibility))
- uiItemV(layout, ntype->name, 0, ntype->type);
+ uiItemV(layout, IFACE_(ntype->name), 0, ntype->type);
}
}
}
@@ -247,7 +247,7 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
static void node_menu_add_foreach_cb(void *calldata, int nclass, const char *name)
{
uiLayout *layout= calldata;
- uiItemMenuF(layout, name, 0, node_add_menu, SET_INT_IN_POINTER(nclass));
+ uiItemMenuF(layout, IFACE_(name), 0, node_add_menu, SET_INT_IN_POINTER(nclass));
}
static void node_menu_add(const bContext *C, Menu *menu)
@@ -257,10 +257,10 @@ static void node_menu_add(const bContext *C, Menu *menu)
uiLayout *layout= menu->layout;
bNodeTreeType *ntreetype= ntreeGetType(snode->treetype);
- if(!snode->nodetree)
+ if (!snode->nodetree)
uiLayoutSetActive(layout, 0);
- if(ntreetype && ntreetype->foreach_nodeclass)
+ if (ntreetype && ntreetype->foreach_nodeclass)
ntreetype->foreach_nodeclass(scene, layout, node_menu_add_foreach_cb);
}
diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h
index f6d52aa9474..ea8fdd8059b 100644
--- a/source/blender/editors/space_node/node_intern.h
+++ b/source/blender/editors/space_node/node_intern.h
@@ -81,7 +81,13 @@ void node_operatortypes(void);
void node_keymap(wmKeyConfig *keyconf);
/* node_select.c */
+void node_select(struct bNode *node);
+void node_deselect(struct bNode *node);
void node_deselect_all(struct SpaceNode *snode);
+void node_socket_select(struct bNode *node, struct bNodeSocket *sock);
+void node_socket_deselect(struct bNode *node, struct bNodeSocket *sock, int deselect_node);
+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 +124,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);
@@ -157,8 +164,8 @@ void NODE_OT_add_file(struct wmOperatorType *ot);
void NODE_OT_new_node_tree(struct wmOperatorType *ot);
-void NODE_OT_output_multi_file_add_socket(struct wmOperatorType *ot);
-void NODE_OT_output_multi_file_remove_active_socket(struct wmOperatorType *ot);
+void NODE_OT_output_file_add_socket(struct wmOperatorType *ot);
+void NODE_OT_output_file_remove_active_socket(struct wmOperatorType *ot);
extern const char *node_context_dir[];
diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c
index 608c6b51f70..e1493b5b1a5 100644
--- a/source/blender/editors/space_node/node_ops.c
+++ b/source/blender/editors/space_node/node_ops.c
@@ -101,8 +101,8 @@ void node_operatortypes(void)
WM_operatortype_append(NODE_OT_new_node_tree);
- WM_operatortype_append(NODE_OT_output_multi_file_add_socket);
- WM_operatortype_append(NODE_OT_output_multi_file_remove_active_socket);
+ WM_operatortype_append(NODE_OT_output_file_add_socket);
+ WM_operatortype_append(NODE_OT_output_file_remove_active_socket);
}
void ED_operatormacros_node(void)
@@ -110,24 +110,24 @@ void ED_operatormacros_node(void)
wmOperatorType *ot;
wmOperatorTypeMacro *mot;
- ot= WM_operatortype_append_macro("NODE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("NODE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
ot->description = "Duplicate selected nodes and move them";
WM_operatortype_macro_define(ot, "NODE_OT_duplicate");
WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
/* modified operator call for duplicating with input links */
- ot= WM_operatortype_append_macro("NODE_OT_duplicate_move_keep_inputs", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("NODE_OT_duplicate_move_keep_inputs", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
ot->description = "Duplicate selected nodes keeping input links and move them";
mot = WM_operatortype_macro_define(ot, "NODE_OT_duplicate");
RNA_boolean_set(mot->ptr, "keep_inputs", TRUE);
WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
- ot= WM_operatortype_append_macro("NODE_OT_select_link_viewer", "Link Viewer", OPTYPE_UNDO);
+ ot = WM_operatortype_append_macro("NODE_OT_select_link_viewer", "Link Viewer", OPTYPE_UNDO);
ot->description = "Select node and link it to a viewer node";
WM_operatortype_macro_define(ot, "NODE_OT_select");
WM_operatortype_macro_define(ot, "NODE_OT_link_viewer");
- ot= WM_operatortype_append_macro("NODE_OT_move_detach_links", "Detach", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("NODE_OT_move_detach_links", "Detach", OPTYPE_UNDO|OPTYPE_REGISTER);
ot->description = "Move a node to detach links";
WM_operatortype_macro_define(ot, "NODE_OT_links_detach");
mot = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
@@ -140,15 +140,16 @@ void node_keymap(struct wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
/* Entire Editor only ----------------- */
- keymap= WM_keymap_find(keyconf, "Node Generic", SPACE_NODE, 0);
+ keymap = WM_keymap_find(keyconf, "Node Generic", SPACE_NODE, 0);
WM_keymap_add_item(keymap, "NODE_OT_properties", NKEY, KM_PRESS, 0, 0);
/* Main Area only ----------------- */
- keymap= WM_keymap_find(keyconf, "Node Editor", SPACE_NODE, 0);
+ keymap = WM_keymap_find(keyconf, "Node Editor", SPACE_NODE, 0);
/* 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);
@@ -169,9 +170,9 @@ void node_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "NODE_OT_select_link_viewer", LEFTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
WM_keymap_add_item(keymap, "NODE_OT_backimage_move", MIDDLEMOUSE, KM_PRESS, KM_ALT, 0);
- kmi= WM_keymap_add_item(keymap, "NODE_OT_backimage_zoom", VKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "NODE_OT_backimage_zoom", VKEY, KM_PRESS, 0, 0);
RNA_float_set(kmi->ptr, "factor", 0.83333f);
- kmi= WM_keymap_add_item(keymap, "NODE_OT_backimage_zoom", VKEY, KM_PRESS, KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "NODE_OT_backimage_zoom", VKEY, KM_PRESS, KM_ALT, 0);
RNA_float_set(kmi->ptr, "factor", 1.2f);
WM_keymap_add_item(keymap, "NODE_OT_backimage_sample", ACTIONMOUSE, KM_PRESS, KM_ALT, 0);
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index 15efd65450c..15d7986a5c4 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -62,7 +62,7 @@ static bNode *node_under_mouse(bNodeTree *ntree, int mx, int my)
{
bNode *node;
- for(node=ntree->nodes.last; node; node=node->prev) {
+ for (node=ntree->nodes.last; node; node=node->prev) {
/* node body (header and scale are in other operators) */
if (BLI_in_rctf(&node->totr, mx, my))
return node;
@@ -173,13 +173,150 @@ static void node_sort(bNodeTree *ntree)
}
}
+void node_select(bNode *node)
+{
+ node->flag |= SELECT;
+}
+
+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);
+}
+
+void node_socket_select(bNode *node, bNodeSocket *sock)
+{
+ sock->flag |= SELECT;
+
+ /* select node too */
+ if (node)
+ node->flag |= SELECT;
+}
+
+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;
+ for (node= snode->edittree->nodes.first; node; node= node->next)
+ 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,74 @@ 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;
+ int selected = 0;
/* 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;
+
+ if (extend) {
+ /* first do socket selection, these generally overlap with nodes.
+ * socket selection only in extend mode.
+ */
+ if (node_find_indicated_socket(snode, &node, &sock, SOCK_IN)) {
+ node_socket_toggle(node, sock, 1);
+ selected = 1;
}
- else
- node->flag ^= SELECT;
+ else if (node_find_indicated_socket(snode, &node, &sock, SOCK_OUT)) {
+ if (sock->flag & SELECT) {
+ node_socket_deselect(node, sock, 1);
+ }
+ else {
+ /* only allow one selected output per node, for sensible linking.
+ * 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);
+ }
+ selected = 1;
+ }
+ else {
+ /* find the closest visible node */
+ node = node_under_mouse(snode->edittree, mx, my);
+
+ if (node) {
+ node_toggle(node);
+
+ ED_node_set_active(bmain, snode->edittree, node);
+ selected = 1;
+ }
+ }
+ }
+ else { /* extend==0 */
- ED_node_set_active(bmain, snode->edittree, node);
+ /* find the closest visible node */
+ node = node_under_mouse(snode->edittree, mx, my);
- node_sort(snode->edittree);
+ if (node) {
+ for (tnode=snode->edittree->nodes.first; tnode; tnode=tnode->next)
+ node_deselect(tnode);
+ node_select(node);
+ ED_node_set_active(bmain, snode->edittree, node);
+ selected = 1;
+ }
}
-
- return node;
+
+ /* update node order */
+ if (selected)
+ node_sort(snode->edittree);
+
+ return selected;
}
static int node_select_exec(bContext *C, wmOperator *op)
@@ -309,7 +491,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 +499,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)
@@ -339,16 +524,16 @@ static int node_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
void NODE_OT_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select";
- ot->idname= "NODE_OT_select";
- ot->description= "Select the node under the cursor";
+ ot->name = "Select";
+ ot->idname = "NODE_OT_select";
+ ot->description = "Select the node under the cursor";
/* api callbacks */
- ot->invoke= node_select_invoke;
- ot->poll= ED_operator_node_active;
+ ot->invoke = node_select_invoke;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_int(ot->srna, "mouse_x", 0, INT_MIN, INT_MAX, "Mouse X", "", INT_MIN, INT_MAX);
@@ -368,23 +553,23 @@ static int node_borderselect_exec(bContext *C, wmOperator *op)
int gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
int extend= RNA_boolean_get(op->ptr, "extend");
- rect.xmin= RNA_int_get(op->ptr, "xmin");
- rect.ymin= RNA_int_get(op->ptr, "ymin");
+ rect.xmin = RNA_int_get(op->ptr, "xmin");
+ rect.ymin = RNA_int_get(op->ptr, "ymin");
UI_view2d_region_to_view(&ar->v2d, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin);
- rect.xmax= RNA_int_get(op->ptr, "xmax");
- rect.ymax= RNA_int_get(op->ptr, "ymax");
+ rect.xmax = RNA_int_get(op->ptr, "xmax");
+ rect.ymax = RNA_int_get(op->ptr, "ymax");
UI_view2d_region_to_view(&ar->v2d, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
- 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;
+ 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_select(node);
else
- node->flag &= ~SELECT;
+ node_deselect(node);
}
- else if(!extend) {
- node->flag &= ~SELECT;
+ else if (!extend) {
+ node_deselect(node);
}
}
@@ -418,20 +603,20 @@ static int node_border_select_invoke(bContext *C, wmOperator *op, wmEvent *event
void NODE_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Border Select";
- ot->idname= "NODE_OT_select_border";
- ot->description= "Use box selection to select nodes";
+ ot->name = "Border Select";
+ ot->idname = "NODE_OT_select_border";
+ ot->description = "Use box selection to select nodes";
/* api callbacks */
- ot->invoke= node_border_select_invoke;
- ot->exec= node_borderselect_exec;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = node_border_select_invoke;
+ ot->exec = node_borderselect_exec;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= ED_operator_node_active;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
WM_operator_properties_gesture_border(ot, TRUE);
@@ -447,17 +632,17 @@ static int node_select_all_exec(bContext *C, wmOperator *UNUSED(op))
bNode *node;
int count= 0;
- for(node=first; node; node=node->next)
- if(node->flag & NODE_SELECT)
+ for (node=first; node; node=node->next)
+ if (node->flag & NODE_SELECT)
count++;
- if(count) {
- for(node=first; node; node=node->next)
- node->flag &= ~NODE_SELECT;
+ if (count) {
+ for (node=first; node; node=node->next)
+ node_deselect(node);
}
else {
- for(node=first; node; node=node->next)
- node->flag |= NODE_SELECT;
+ for (node=first; node; node=node->next)
+ node_select(node);
}
node_sort(snode->edittree);
@@ -469,7 +654,7 @@ static int node_select_all_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name = "Select or Deselect All";
+ ot->name = "(De)select All";
ot->description = "(De)select all nodes";
ot->idname = "NODE_OT_select_all";
@@ -499,7 +684,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);
@@ -531,17 +716,17 @@ static int node_select_linked_from_exec(bContext *C, wmOperator *UNUSED(op))
bNodeLink *link;
bNode *node;
- for(node=snode->edittree->nodes.first; node; node=node->next)
+ for (node=snode->edittree->nodes.first; node; node=node->next)
node->flag &= ~NODE_TEST;
- for(link=snode->edittree->links.first; link; link=link->next) {
- if(link->fromnode && link->tonode && (link->tonode->flag & NODE_SELECT))
+ for (link=snode->edittree->links.first; link; link=link->next) {
+ if (link->fromnode && link->tonode && (link->tonode->flag & NODE_SELECT))
link->fromnode->flag |= NODE_TEST;
}
- for(node=snode->edittree->nodes.first; node; node=node->next) {
- if(node->flag & NODE_TEST)
- node->flag |= NODE_SELECT;
+ for (node=snode->edittree->nodes.first; node; node=node->next) {
+ if (node->flag & NODE_TEST)
+ node_select(node);
}
node_sort(snode->edittree);
diff --git a/source/blender/editors/space_node/node_state.c b/source/blender/editors/space_node/node_state.c
index 58623e17b10..5463d4a8ff0 100644
--- a/source/blender/editors/space_node/node_state.c
+++ b/source/blender/editors/space_node/node_state.c
@@ -67,13 +67,13 @@ static void snode_home(ScrArea *UNUSED(sa), ARegion *ar, SpaceNode* snode)
oldwidth= cur->xmax - cur->xmin;
oldheight= cur->ymax - cur->ymin;
- cur->xmin= cur->ymin= 0.0f;
+ cur->xmin = cur->ymin = 0.0f;
cur->xmax=ar->winx;
cur->ymax=ar->winy;
- if(snode->edittree) {
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(first) {
+ if (snode->edittree) {
+ for (node= snode->edittree->nodes.first; node; node= node->next) {
+ if (first) {
first= 0;
ar->v2d.cur= node->totr;
}
@@ -88,17 +88,17 @@ static void snode_home(ScrArea *UNUSED(sa), ARegion *ar, SpaceNode* snode)
width= cur->xmax - cur->xmin;
height= cur->ymax- cur->ymin;
- if(width > height) {
+ if (width > height) {
float newheight;
newheight= oldheight * width/oldwidth;
- cur->ymin= cur->ymin - newheight/4;
- cur->ymax= cur->ymax + newheight/4;
+ cur->ymin = cur->ymin - newheight/4;
+ cur->ymax = cur->ymax + newheight/4;
}
else {
float newwidth;
newwidth= oldwidth * height/oldheight;
- cur->xmin= cur->xmin - newwidth/4;
- cur->xmax= cur->xmax + newwidth/4;
+ cur->xmin = cur->xmin - newwidth/4;
+ cur->xmax = cur->xmax + newwidth/4;
}
ar->v2d.tot= ar->v2d.cur;
@@ -120,14 +120,14 @@ static int node_view_all_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_view_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View All";
- ot->idname= "NODE_OT_view_all";
- ot->description= "Resize view so you can see all nodes";
+ ot->name = "View All";
+ ot->idname = "NODE_OT_view_all";
+ ot->description = "Resize view so you can see all nodes";
/* api callbacks */
- ot->exec= node_view_all_exec;
- ot->poll= ED_operator_node_active;
+ ot->exec = node_view_all_exec;
+ ot->poll = ED_operator_node_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c
index 24fb55be38e..049886b1d66 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -59,6 +59,7 @@
#include "../interface/interface_intern.h"
#include "ED_node.h"
+#include "ED_util.h"
/************************* Node Socket Manipulation **************************/
@@ -66,13 +67,13 @@ static void node_tag_recursive(bNode *node)
{
bNodeSocket *input;
- if(!node || (node->flag & NODE_TEST))
+ if (!node || (node->flag & NODE_TEST))
return; /* in case of cycles */
node->flag |= NODE_TEST;
- for(input=node->inputs.first; input; input=input->next)
- if(input->link)
+ for (input=node->inputs.first; input; input=input->next)
+ if (input->link)
node_tag_recursive(input->link->fromnode);
}
@@ -80,13 +81,13 @@ static void node_clear_recursive(bNode *node)
{
bNodeSocket *input;
- if(!node || !(node->flag & NODE_TEST))
+ if (!node || !(node->flag & NODE_TEST))
return; /* in case of cycles */
node->flag &= ~NODE_TEST;
- for(input=node->inputs.first; input; input=input->next)
- if(input->link)
+ for (input=node->inputs.first; input; input=input->next)
+ if (input->link)
node_clear_recursive(input->link->fromnode);
}
@@ -95,28 +96,28 @@ static void node_remove_linked(bNodeTree *ntree, bNode *rem_node)
bNode *node, *next;
bNodeSocket *sock;
- if(!rem_node)
+ if (!rem_node)
return;
/* tag linked nodes to be removed */
- for(node=ntree->nodes.first; node; node=node->next)
+ for (node=ntree->nodes.first; node; node=node->next)
node->flag &= ~NODE_TEST;
node_tag_recursive(rem_node);
/* clear tags on nodes that are still used by other nodes */
- for(node=ntree->nodes.first; node; node=node->next)
- if(!(node->flag & NODE_TEST))
- for(sock=node->inputs.first; sock; sock=sock->next)
- if(sock->link && sock->link->fromnode != rem_node)
+ for (node=ntree->nodes.first; node; node=node->next)
+ if (!(node->flag & NODE_TEST))
+ for (sock=node->inputs.first; sock; sock=sock->next)
+ if (sock->link && sock->link->fromnode != rem_node)
node_clear_recursive(sock->link->fromnode);
/* remove nodes */
- for(node=ntree->nodes.first; node; node=next) {
+ for (node=ntree->nodes.first; node; node=next) {
next = node->next;
- if(node->flag & NODE_TEST) {
- if(node->id)
+ if (node->flag & NODE_TEST) {
+ if (node->id)
node->id->us--;
nodeFreeNode(ntree, node);
}
@@ -126,7 +127,7 @@ static void node_remove_linked(bNodeTree *ntree, bNode *rem_node)
/* disconnect socket from the node it is connected to */
static void node_socket_disconnect(Main *bmain, bNodeTree *ntree, bNode *node_to, bNodeSocket *sock_to)
{
- if(!sock_to->link)
+ if (!sock_to->link)
return;
nodeRemLink(ntree, sock_to->link);
@@ -140,7 +141,7 @@ static void node_socket_disconnect(Main *bmain, bNodeTree *ntree, bNode *node_to
/* remove all nodes connected to this socket, if they aren't connected to other nodes */
static void node_socket_remove(Main *bmain, bNodeTree *ntree, bNode *node_to, bNodeSocket *sock_to)
{
- if(!sock_to->link)
+ if (!sock_to->link)
return;
node_remove_linked(ntree, sock_to->link->fromnode);
@@ -159,31 +160,31 @@ static void node_socket_add_replace(Main *bmain, bNodeTree *ntree, bNode *node_t
bNode *node_prev = NULL;
/* unlink existing node */
- if(sock_to->link) {
+ if (sock_to->link) {
node_prev = sock_to->link->fromnode;
nodeRemLink(ntree, sock_to->link);
}
/* find existing node that we can use */
- for(node_from=ntree->nodes.first; node_from; node_from=node_from->next)
- if(node_from->type == ntemp->type)
+ for (node_from=ntree->nodes.first; node_from; node_from=node_from->next)
+ if (node_from->type == ntemp->type)
break;
- if(node_from)
- if(!(node_from->inputs.first == NULL && !(node_from->typeinfo->flag & NODE_OPTIONS)))
+ if (node_from)
+ if (!(node_from->inputs.first == NULL && !(node_from->typeinfo->flag & NODE_OPTIONS)))
node_from = NULL;
- if(node_prev && node_prev->type == ntemp->type &&
+ if (node_prev && node_prev->type == ntemp->type &&
(ntemp->type != NODE_GROUP || node_prev->id == &ntemp->ngroup->id)) {
/* keep the previous node if it's the same type */
node_from = node_prev;
}
- else if(!node_from) {
+ else if (!node_from) {
node_from= nodeAddNode(ntree, ntemp);
node_from->locx = node_to->locx - (node_from->typeinfo->width + 50);
node_from->locy = node_to->locy;
- if(node_from->id)
+ if (node_from->id)
id_us_plus(node_from->id);
}
@@ -194,15 +195,18 @@ static void node_socket_add_replace(Main *bmain, bNodeTree *ntree, bNode *node_t
nodeAddLink(ntree, node_from, sock_from, node_to, sock_to);
/* copy input sockets from previous node */
- if(node_prev && node_from != node_prev) {
+ if (node_prev && node_from != node_prev) {
bNodeSocket *sock_prev, *sock_from;
- for(sock_prev=node_prev->inputs.first; sock_prev; sock_prev=sock_prev->next) {
- for(sock_from=node_from->inputs.first; sock_from; sock_from=sock_from->next) {
- if(strcmp(sock_prev->name, sock_from->name) == 0 && sock_prev->type == sock_from->type) {
+ for (sock_prev=node_prev->inputs.first; sock_prev; sock_prev=sock_prev->next) {
+ for (sock_from=node_from->inputs.first; sock_from; sock_from=sock_from->next) {
+ if (nodeCountSocketLinks(ntree, sock_from) >= sock_from->limit)
+ continue;
+
+ if (strcmp(sock_prev->name, sock_from->name) == 0 && sock_prev->type == sock_from->type) {
bNodeLink *link = sock_prev->link;
- if(link && link->fromnode) {
+ if (link && link->fromnode) {
nodeAddLink(ntree, link->fromnode, link->fromsock, node_from, sock_from);
nodeRemLink(ntree, link);
}
@@ -215,7 +219,7 @@ static void node_socket_add_replace(Main *bmain, bNodeTree *ntree, bNode *node_t
}
/* also preserve mapping for texture nodes */
- if(node_from->typeinfo->nclass == NODE_CLASS_TEXTURE &&
+ if (node_from->typeinfo->nclass == NODE_CLASS_TEXTURE &&
node_prev->typeinfo->nclass == NODE_CLASS_TEXTURE)
memcpy(node_from->storage, node_prev->storage, sizeof(NodeTexBase));
@@ -250,7 +254,7 @@ typedef struct NodeLinkArg {
uiLayout *layout;
} NodeLinkArg;
-static void ui_node_link(bContext *UNUSED(C), void *arg_p, void *event_p)
+static void ui_node_link(bContext *C, void *arg_p, void *event_p)
{
NodeLinkArg *arg = (NodeLinkArg*)arg_p;
Main *bmain = arg->bmain;
@@ -262,34 +266,42 @@ static void ui_node_link(bContext *UNUSED(C), void *arg_p, void *event_p)
ntemp.type = arg->type;
ntemp.ngroup = arg->ngroup;
+ ntemp.scene = CTX_data_scene(C);
+ ntemp.main = CTX_data_main(C);
- if(event == UI_NODE_LINK_DISCONNECT)
+ if (event == UI_NODE_LINK_DISCONNECT)
node_socket_disconnect(bmain, ntree, node_to, sock_to);
- else if(event == UI_NODE_LINK_REMOVE)
+ else if (event == UI_NODE_LINK_REMOVE)
node_socket_remove(bmain, ntree, node_to, sock_to);
else
node_socket_add_replace(bmain, ntree, node_to, sock_to, &ntemp, arg->output);
+
+ ED_undo_push(C, "Node input modify");
}
static void ui_node_sock_name(bNodeSocket *sock, char name[UI_MAX_NAME_STR])
{
- if(sock->link && sock->link->fromnode) {
+ if (sock->link && sock->link->fromnode) {
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);
- if(node->inputs.first == NULL &&
+ if (node->inputs.first == NULL &&
node->outputs.first != node->outputs.last &&
!(node->typeinfo->flag & NODE_OPTIONS))
BLI_snprintf(name, UI_MAX_NAME_STR, "%s | %s", node_name, sock->link->fromsock->name);
else
BLI_strncpy(name, node_name, UI_MAX_NAME_STR);
}
- else if(sock->type == SOCK_SHADER)
+ else if (sock->type == SOCK_SHADER)
BLI_strncpy(name, "None", UI_MAX_NAME_STR);
else
BLI_strncpy(name, "Default", UI_MAX_NAME_STR);
@@ -315,31 +327,31 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname)
int first = 1;
int compatibility= 0;
- if(ntree->type == NTREE_SHADER) {
- if(scene_use_new_shading_nodes(arg->scene))
+ if (ntree->type == NTREE_SHADER) {
+ if (scene_use_new_shading_nodes(arg->scene))
compatibility= NODE_NEW_SHADING;
else
compatibility= NODE_OLD_SHADING;
}
- if(nclass == NODE_CLASS_GROUP) {
- for(ngroup=bmain->nodetree.first; ngroup; ngroup=ngroup->id.next) {
+ if (nclass == NODE_CLASS_GROUP) {
+ for (ngroup=bmain->nodetree.first; ngroup; ngroup=ngroup->id.next) {
bNodeSocket *gsock;
char name[UI_MAX_NAME_STR];
int i, j, num = 0;
- if(ngroup->type != ntree->type)
+ if (ngroup->type != ntree->type)
continue;
- for(gsock=ngroup->inputs.first; gsock; gsock=gsock->next)
- if(ui_compatible_sockets(gsock->type, sock->type))
+ for (gsock=ngroup->inputs.first; gsock; gsock=gsock->next)
+ if (ui_compatible_sockets(gsock->type, sock->type))
num++;
- for(i=0, j=0, gsock=ngroup->outputs.first; gsock; gsock=gsock->next, i++) {
- if(!ui_compatible_sockets(gsock->type, sock->type))
+ for (i=0, j=0, gsock=ngroup->outputs.first; gsock; gsock=gsock->next, i++) {
+ if (!ui_compatible_sockets(gsock->type, sock->type))
continue;
- if(first) {
+ if (first) {
column= uiLayoutColumn(layout, 0);
uiBlockSetCurLayout(block, column);
@@ -350,8 +362,8 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname)
first = 0;
}
- if(num > 1) {
- if(j == 0) {
+ if (num > 1) {
+ if (j == 0) {
uiItemL(column, ngroup->id.name+2, ICON_NODE);
but= block->buttons.last;
but->flag= UI_TEXT_LEFT;
@@ -377,26 +389,26 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname)
else {
bNodeTreeType *ttype= ntreeGetType(ntree->type);
- for(ntype=ttype->node_types.first; ntype; ntype=ntype->next) {
+ for (ntype=ttype->node_types.first; ntype; ntype=ntype->next) {
bNodeSocketTemplate *stemp;
char name[UI_MAX_NAME_STR];
int i, j, num = 0;
- if(compatibility && !(ntype->compatibility & compatibility))
+ if (compatibility && !(ntype->compatibility & compatibility))
continue;
- if(ntype->nclass != nclass)
+ if (ntype->nclass != nclass)
continue;
- for(i=0, stemp=ntype->outputs; stemp && stemp->type != -1; stemp++, i++)
- if(ui_compatible_sockets(stemp->type, sock->type))
+ for (i=0, stemp=ntype->outputs; stemp && stemp->type != -1; stemp++, i++)
+ if (ui_compatible_sockets(stemp->type, sock->type))
num++;
- for(i=0, j=0, stemp=ntype->outputs; stemp && stemp->type != -1; stemp++, i++) {
- if(!ui_compatible_sockets(stemp->type, sock->type))
+ for (i=0, j=0, stemp=ntype->outputs; stemp && stemp->type != -1; stemp++, i++) {
+ if (!ui_compatible_sockets(stemp->type, sock->type))
continue;
- if(first) {
+ if (first) {
column= uiLayoutColumn(layout, 0);
uiBlockSetCurLayout(block, column);
@@ -407,8 +419,8 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname)
first = 0;
}
- if(num > 1) {
- if(j == 0) {
+ if (num > 1) {
+ if (j == 0) {
uiItemL(column, ntype->name, ICON_NODE);
but= block->buttons.last;
but->flag= UI_TEXT_LEFT;
@@ -436,7 +448,7 @@ static void node_menu_column_foreach_cb(void *calldata, int nclass, const char *
{
NodeLinkArg *arg = (NodeLinkArg*)calldata;
- if(!ELEM(nclass, NODE_CLASS_GROUP, NODE_CLASS_LAYOUT))
+ if (!ELEM(nclass, NODE_CLASS_GROUP, NODE_CLASS_LAYOUT))
ui_node_menu_column(arg, nclass, name);
}
@@ -458,13 +470,13 @@ static void ui_template_node_link_menu(bContext *C, uiLayout *layout, void *but_
arg->scene= scene;
arg->layout= split;
- if(ntreetype && ntreetype->foreach_nodeclass)
+ if (ntreetype && ntreetype->foreach_nodeclass)
ntreetype->foreach_nodeclass(scene, arg, node_menu_column_foreach_cb);
column= uiLayoutColumn(split, 0);
uiBlockSetCurLayout(block, column);
- if(sock->link) {
+ if (sock->link) {
uiItemL(column, "Link", ICON_NONE);
but= block->buttons.last;
but->flag= UI_TEXT_LEFT;
@@ -496,21 +508,21 @@ void uiTemplateNodeLink(uiLayout *layout, bNodeTree *ntree, bNode *node, bNodeSo
uiBlockSetCurLayout(block, layout);
- if(sock->link || sock->type == SOCK_SHADER || (sock->flag & SOCK_HIDE_VALUE)) {
+ if (sock->link || sock->type == SOCK_SHADER || (sock->flag & SOCK_HIDE_VALUE)) {
char name[UI_MAX_NAME_STR];
ui_node_sock_name(sock, name);
- but= uiDefMenuBut(block, ui_template_node_link_menu, NULL, name, 0, 0, UI_UNIT_X*4, UI_UNIT_Y, "");
+ but = uiDefMenuBut(block, ui_template_node_link_menu, NULL, name, 0, 0, UI_UNIT_X*4, UI_UNIT_Y, "");
}
else
- but= uiDefIconMenuBut(block, ui_template_node_link_menu, NULL, ICON_NONE, 0, 0, UI_UNIT_X, UI_UNIT_Y, "");
+ but = uiDefIconMenuBut(block, ui_template_node_link_menu, NULL, ICON_NONE, 0, 0, UI_UNIT_X, UI_UNIT_Y, "");
but->type= MENU;
but->flag |= UI_TEXT_LEFT|UI_BUT_NODE_LINK;
but->poin= (char*)but;
but->func_argN = arg;
- if(sock->link && sock->link->fromnode)
- if(sock->link->fromnode->flag & NODE_ACTIVE_TEXTURE)
+ if (sock->link && sock->link->fromnode)
+ if (sock->link->fromnode->flag & NODE_ACTIVE_TEXTURE)
but->flag |= UI_BUT_NODE_ACTIVE;
}
@@ -527,8 +539,8 @@ static void ui_node_draw_node(uiLayout *layout, bContext *C, bNodeTree *ntree, b
RNA_pointer_create(&ntree->id, &RNA_Node, node, &nodeptr);
- if(node->typeinfo->uifunc) {
- if(node->type != NODE_GROUP) {
+ if (node->typeinfo->uifunc) {
+ if (node->type != NODE_GROUP) {
split = uiLayoutSplit(layout, 0.35f, 0);
col = uiLayoutColumn(split, 0);
col = uiLayoutColumn(split, 0);
@@ -537,7 +549,7 @@ static void ui_node_draw_node(uiLayout *layout, bContext *C, bNodeTree *ntree, b
}
}
- for(input=node->inputs.first; input; input=input->next)
+ for (input=node->inputs.first; input; input=input->next)
ui_node_draw_input(layout, C, ntree, node, input, depth+1);
}
@@ -552,7 +564,7 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree,
int indent = (depth > 1)? 2*(depth - 1): 0;
int dependency_loop;
- if(input->flag & SOCK_UNAVAIL)
+ if (input->flag & SOCK_UNAVAIL)
return;
/* to avoid eternal loops on cyclic dependencies */
@@ -560,7 +572,7 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree,
lnode = (input->link)? input->link->fromnode: NULL;
dependency_loop = (lnode && (lnode->flag & NODE_TEST));
- if(dependency_loop)
+ if (dependency_loop)
lnode = NULL;
/* socket RNA pointer */
@@ -576,10 +588,10 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree,
row = uiLayoutRow(split, 1);
- if(depth > 0) {
+ if (depth > 0) {
uiBlockSetEmboss(block, UI_EMBOSSN);
- if(lnode && (lnode->inputs.first || (lnode->typeinfo->uifunc && lnode->type != NODE_GROUP))) {
+ if (lnode && (lnode->inputs.first || (lnode->typeinfo->uifunc && lnode->type != NODE_GROUP))) {
int icon = (input->flag & SOCK_COLLAPSED)? ICON_DISCLOSURE_TRI_RIGHT: ICON_DISCLOSURE_TRI_DOWN;
uiItemR(row, &inputptr, "show_expanded", UI_ITEM_R_ICON_ONLY, "", icon);
}
@@ -596,16 +608,16 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree,
bt= block->buttons.last;
bt->flag= UI_TEXT_LEFT;
- if(dependency_loop) {
+ if (dependency_loop) {
row = uiLayoutRow(split, 0);
uiItemL(row, "Dependency Loop", ICON_ERROR);
}
- else if(lnode) {
+ else if (lnode) {
/* input linked to a node */
uiTemplateNodeLink(split, ntree, node, input);
- if(!(input->flag & SOCK_COLLAPSED)) {
- if(depth == 0)
+ if (!(input->flag & SOCK_COLLAPSED)) {
+ if (depth == 0)
uiItemS(layout);
ui_node_draw_node(layout, C, ntree, lnode, depth);
@@ -613,8 +625,8 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree,
}
else {
/* input not linked, show value */
- if(input->type != SOCK_SHADER && !(input->flag & SOCK_HIDE_VALUE)) {
- if(input->type == SOCK_VECTOR) {
+ if (input->type != SOCK_SHADER && !(input->flag & SOCK_HIDE_VALUE)) {
+ if (input->type == SOCK_VECTOR) {
row = uiLayoutRow(split, 0);
col = uiLayoutColumn(row, 0);
@@ -639,14 +651,14 @@ void uiTemplateNodeView(uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *
{
bNode *tnode;
- if(!ntree)
+ if (!ntree)
return;
/* clear for cycle check */
- for(tnode=ntree->nodes.first; tnode; tnode=tnode->next)
+ for (tnode=ntree->nodes.first; tnode; tnode=tnode->next)
tnode->flag &= ~NODE_TEST;
- if(input)
+ if (input)
ui_node_draw_input(layout, C, ntree, node, input, 0);
else
ui_node_draw_node(layout, C, ntree, node, 0);
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 493fb854585..fca9927b0f5 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -72,13 +72,13 @@ ARegion *node_has_buttons_region(ScrArea *sa)
ARegion *ar, *arnew;
ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
- if(ar) return ar;
+ if (ar) return ar;
/* add subdiv level; after header */
ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
/* is error! */
- if(ar==NULL) return NULL;
+ if (ar==NULL) return NULL;
arnew= MEM_callocN(sizeof(ARegion), "buttons for node");
@@ -125,15 +125,15 @@ static SpaceLink *node_new(const bContext *UNUSED(C))
BLI_addtail(&snode->regionbase, ar);
ar->regiontype= RGN_TYPE_WINDOW;
- ar->v2d.tot.xmin= -256.0f;
- ar->v2d.tot.ymin= -256.0f;
- ar->v2d.tot.xmax= 768.0f;
- ar->v2d.tot.ymax= 768.0f;
+ ar->v2d.tot.xmin = -256.0f;
+ ar->v2d.tot.ymin = -256.0f;
+ ar->v2d.tot.xmax = 768.0f;
+ ar->v2d.tot.ymax = 768.0f;
- ar->v2d.cur.xmin= -256.0f;
- ar->v2d.cur.ymin= -256.0f;
- ar->v2d.cur.xmax= 768.0f;
- ar->v2d.cur.ymax= 768.0f;
+ ar->v2d.cur.xmin = -256.0f;
+ ar->v2d.cur.ymin = -256.0f;
+ ar->v2d.cur.xmax = 768.0f;
+ ar->v2d.cur.ymax = 768.0f;
ar->v2d.min[0]= 1.0f;
ar->v2d.min[1]= 1.0f;
@@ -183,8 +183,8 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn)
ED_area_tag_redraw(sa);
break;
case ND_TRANSFORM_DONE:
- if(type==NTREE_COMPOSIT) {
- if(snode->flag & SNODE_AUTO_RENDER) {
+ if (type==NTREE_COMPOSIT) {
+ if (snode->flag & SNODE_AUTO_RENDER) {
snode->recalc= 1;
ED_area_tag_refresh(sa);
}
@@ -193,48 +193,48 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn)
}
break;
case NC_WM:
- if(wmn->data==ND_FILEREAD)
+ if (wmn->data==ND_FILEREAD)
ED_area_tag_refresh(sa);
break;
/* future: add ID checks? */
case NC_MATERIAL:
- if(type==NTREE_SHADER) {
- if(wmn->data==ND_SHADING)
+ if (type==NTREE_SHADER) {
+ if (wmn->data==ND_SHADING)
ED_area_tag_refresh(sa);
- else if(wmn->data==ND_SHADING_DRAW)
+ else if (wmn->data==ND_SHADING_DRAW)
ED_area_tag_refresh(sa);
- else if(wmn->action==NA_ADDED && snode->edittree)
+ else if (wmn->action==NA_ADDED && snode->edittree)
nodeSetActiveID(snode->edittree, ID_MA, wmn->reference);
}
break;
case NC_TEXTURE:
- if(type==NTREE_SHADER || type==NTREE_TEXTURE) {
- if(wmn->data==ND_NODES)
+ if (type==NTREE_SHADER || type==NTREE_TEXTURE) {
+ if (wmn->data==ND_NODES)
ED_area_tag_refresh(sa);
}
break;
case NC_WORLD:
- if(type==NTREE_SHADER && shader_type==SNODE_SHADER_WORLD) {
+ if (type==NTREE_SHADER && shader_type==SNODE_SHADER_WORLD) {
ED_area_tag_refresh(sa);
}
break;
case NC_OBJECT:
- if(type==NTREE_SHADER) {
- if(wmn->data==ND_OB_SHADING)
+ if (type==NTREE_SHADER) {
+ if (wmn->data==ND_OB_SHADING)
ED_area_tag_refresh(sa);
}
break;
case NC_TEXT:
/* pynodes */
- if(wmn->data==ND_SHADING)
+ if (wmn->data==ND_SHADING)
ED_area_tag_refresh(sa);
break;
case NC_SPACE:
- if(wmn->data==ND_SPACE_NODE)
+ if (wmn->data==ND_SPACE_NODE)
ED_area_tag_refresh(sa);
- else if(wmn->data==ND_SPACE_NODE_VIEW)
+ else if (wmn->data==ND_SPACE_NODE_VIEW)
ED_area_tag_redraw(sa);
break;
case NC_NODE:
@@ -253,11 +253,11 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn)
case NC_IMAGE:
if (wmn->action == NA_EDITED) {
- if(type==NTREE_COMPOSIT) {
+ if (type==NTREE_COMPOSIT) {
/* note that nodeUpdateID is already called by BKE_image_signal() on all
* scenes so really this is just to know if the images is used in the compo else
* painting on images could become very slow when the compositor is open. */
- if(nodeUpdateID(snode->nodetree, wmn->reference))
+ if (nodeUpdateID(snode->nodetree, wmn->reference))
ED_area_tag_refresh(sa);
}
}
@@ -272,29 +272,29 @@ static void node_area_refresh(const struct bContext *C, struct ScrArea *sa)
snode_set_context(snode, CTX_data_scene(C));
- if(snode->nodetree) {
- if(snode->treetype==NTREE_SHADER) {
- if(GS(snode->id->name) == ID_MA) {
+ if (snode->nodetree) {
+ if (snode->treetype==NTREE_SHADER) {
+ if (GS(snode->id->name) == ID_MA) {
Material *ma= (Material *)snode->id;
- if(ma->use_nodes)
+ if (ma->use_nodes)
ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER);
}
- else if(GS(snode->id->name) == ID_LA) {
+ else if (GS(snode->id->name) == ID_LA) {
Lamp *la= (Lamp *)snode->id;
- if(la->use_nodes)
+ if (la->use_nodes)
ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER);
}
- else if(GS(snode->id->name) == ID_WO) {
+ else if (GS(snode->id->name) == ID_WO) {
World *wo= (World *)snode->id;
- if(wo->use_nodes)
+ if (wo->use_nodes)
ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER);
}
}
- else if(snode->treetype==NTREE_COMPOSIT) {
+ else if (snode->treetype==NTREE_COMPOSIT) {
Scene *scene= (Scene *)snode->id;
- if(scene->use_nodes) {
+ if (scene->use_nodes) {
/* recalc is set on 3d view changes for auto compo */
- if(snode->recalc) {
+ if (snode->recalc) {
snode->recalc= 0;
node_render_changed_exec((struct bContext*)C, NULL);
}
@@ -302,9 +302,9 @@ static void node_area_refresh(const struct bContext *C, struct ScrArea *sa)
snode_composite_job(C, sa);
}
}
- else if(snode->treetype==NTREE_TEXTURE) {
+ else if (snode->treetype==NTREE_TEXTURE) {
Tex *tex= (Tex *)snode->id;
- if(tex->use_nodes) {
+ if (tex->use_nodes) {
ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER);
}
}
@@ -330,7 +330,7 @@ static void node_buttons_area_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap= WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -339,7 +339,7 @@ static void node_buttons_area_draw(const bContext *C, ARegion *ar)
ED_region_panels(C, ar, 1, NULL, -1);
}
-/* Initialise main area, setting handlers. */
+/* Initialize main area, setting handlers. */
static void node_main_area_init(wmWindowManager *wm, ARegion *ar)
{
wmKeyMap *keymap;
@@ -348,10 +348,10 @@ static void node_main_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymaps */
- keymap= WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Node Editor", SPACE_NODE, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Node Editor", SPACE_NODE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* add drop boxes */
@@ -372,13 +372,13 @@ static void node_main_area_draw(const bContext *C, ARegion *ar)
static int node_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
- if(drag->type==WM_DRAG_ID) {
+ if (drag->type==WM_DRAG_ID) {
ID *id= (ID *)drag->poin;
- if( GS(id->name)==ID_IM )
+ if ( GS(id->name)==ID_IM )
return 1;
}
- else if(drag->type==WM_DRAG_PATH){
- if(ELEM(drag->icon, 0, ICON_FILE_IMAGE)) /* rule might not work? */
+ else if (drag->type==WM_DRAG_PATH) {
+ if (ELEM(drag->icon, 0, ICON_FILE_IMAGE)) /* rule might not work? */
return 1;
}
return 0;
@@ -388,7 +388,7 @@ static void node_id_path_drop_copy(wmDrag *drag, wmDropBox *drop)
{
ID *id= (ID *)drag->poin;
- if(id) {
+ if (id) {
RNA_string_set(drop->ptr, "name", id->name+2);
}
if (drag->path[0]) {
@@ -431,11 +431,11 @@ static void node_region_listener(ARegion *ar, wmNotifier *wmn)
/* context changes */
switch(wmn->category) {
case NC_SPACE:
- if(wmn->data==ND_SPACE_NODE)
+ if (wmn->data==ND_SPACE_NODE)
ED_region_tag_redraw(ar);
break;
case NC_SCREEN:
- if(wmn->data == ND_GPENCIL)
+ if (wmn->data == ND_GPENCIL)
ED_region_tag_redraw(ar);
break;
case NC_SCENE:
@@ -445,11 +445,11 @@ static void node_region_listener(ARegion *ar, wmNotifier *wmn)
ED_region_tag_redraw(ar);
break;
case NC_OBJECT:
- if(wmn->data==ND_OB_SHADING)
+ if (wmn->data==ND_OB_SHADING)
ED_region_tag_redraw(ar);
break;
case NC_ID:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
}
@@ -461,16 +461,16 @@ static int node_context(const bContext *C, const char *member, bContextDataResul
{
SpaceNode *snode= CTX_wm_space_node(C);
- if(CTX_data_dir(member)) {
+ if (CTX_data_dir(member)) {
CTX_data_dir_set(result, node_context_dir);
return 1;
}
- else if(CTX_data_equals(member, "selected_nodes")) {
+ else if (CTX_data_equals(member, "selected_nodes")) {
bNode *node;
- if(snode->edittree) {
- for(node=snode->edittree->nodes.last; node; node=node->prev) {
- if(node->flag & NODE_SELECT) {
+ if (snode->edittree) {
+ for (node=snode->edittree->nodes.last; node; node=node->prev) {
+ if (node->flag & NODE_SELECT) {
CTX_data_list_add(result, &snode->edittree->id, &RNA_Node, node);
}
}
@@ -478,12 +478,12 @@ static int node_context(const bContext *C, const char *member, bContextDataResul
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
return 1;
}
- else if(CTX_data_equals(member, "active_node")) {
+ else if (CTX_data_equals(member, "active_node")) {
bNode *node;
- if(snode->edittree) {
- for(node=snode->edittree->nodes.last; node; node=node->prev) {
- if(node->flag & NODE_ACTIVE) {
+ if (snode->edittree) {
+ for (node=snode->edittree->nodes.last; node; node=node->prev) {
+ if (node->flag & NODE_ACTIVE) {
CTX_data_pointer_set(result, &snode->edittree->id, &RNA_Node, node);
break;
}
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index bb694ae5705..73289dce968 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -95,9 +95,9 @@
static void outliner_height(SpaceOops *soops, ListBase *lb, int *h)
{
TreeElement *te= lb->first;
- while(te) {
+ while (te) {
TreeStoreElem *tselem= TREESTORE(te);
- if(TSELEM_OPEN(tselem,soops))
+ if (TSELEM_OPEN(tselem,soops))
outliner_height(soops, &te->subtree, h);
(*h) += UI_UNIT_Y;
te= te->next;
@@ -108,11 +108,11 @@ static void outliner_height(SpaceOops *soops, ListBase *lb, int *h)
static void outliner_width(SpaceOops *soops, ListBase *lb, int *w)
{
TreeElement *te= lb->first;
- while(te) {
+ while (te) {
// TreeStoreElem *tselem= TREESTORE(te);
// XXX fixme... te->xend is not set yet
- if(!TSELEM_OPEN(tselem,soops)) {
+ if (!TSELEM_OPEN(tselem,soops)) {
if (te->xend > *w)
*w = te->xend;
}
@@ -125,17 +125,19 @@ static void outliner_width(SpaceOops *soops, ListBase *lb, int *w)
static void outliner_rna_width(SpaceOops *soops, ListBase *lb, int *w, int startx)
{
TreeElement *te= lb->first;
- while(te) {
+ while (te) {
TreeStoreElem *tselem= TREESTORE(te);
- // XXX fixme... (currently, we're using a fixed length of 100)!
- /*if(te->xend) {
- if(te->xend > *w)
+ // XXX fixme... (currently, we're using a fixed length of 100)!
+#if 0
+ if (te->xend) {
+ if (te->xend > *w)
*w = te->xend;
- }*/
- if(startx+100 > *w)
+ }
+#endif
+ if (startx+100 > *w)
*w = startx+100;
- if(TSELEM_OPEN(tselem,soops))
+ if (TSELEM_OPEN(tselem,soops))
outliner_rna_width(soops, &te->subtree, w, startx+UI_UNIT_X);
te= te->next;
}
@@ -148,7 +150,7 @@ static void restrictbutton_view_cb(bContext *C, void *poin, void *poin2)
Scene *scene = (Scene *)poin;
Object *ob = (Object *)poin2;
- if(!common_restrict_check(C, ob)) return;
+ if (!common_restrict_check(C, ob)) return;
/* deselect objects that are invisible */
if (ob->restrictflag & OB_RESTRICT_VIEW) {
@@ -165,7 +167,7 @@ static void restrictbutton_sel_cb(bContext *C, void *poin, void *poin2)
Scene *scene = (Scene *)poin;
Object *ob = (Object *)poin2;
- if(!common_restrict_check(C, ob)) return;
+ if (!common_restrict_check(C, ob)) return;
/* if select restriction has just been turned on */
if (ob->restrictflag & OB_RESTRICT_SELECT) {
@@ -199,7 +201,7 @@ static void restrictbutton_modifier_cb(bContext *C, void *UNUSED(poin), void *po
static void restrictbutton_bone_cb(bContext *C, void *UNUSED(poin), void *poin2)
{
Bone *bone= (Bone *)poin2;
- if(bone && (bone->flag & BONE_HIDDEN_P))
+ if (bone && (bone->flag & BONE_HIDDEN_P))
bone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL);
}
@@ -207,7 +209,7 @@ static void restrictbutton_bone_cb(bContext *C, void *UNUSED(poin), void *poin2)
static void restrictbutton_ebone_cb(bContext *C, void *UNUSED(poin), void *poin2)
{
EditBone *ebone= (EditBone *)poin2;
- if(ebone && (ebone->flag & BONE_HIDDEN_A))
+ if (ebone && (ebone->flag & BONE_HIDDEN_A))
ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL);
@@ -217,8 +219,8 @@ static int group_restrict_flag(Group *gr, int flag)
{
GroupObject *gob;
- for(gob= gr->gobject.first; gob; gob= gob->next) {
- if((gob->ob->restrictflag & flag) == 0)
+ for (gob= gr->gobject.first; gob; gob= gob->next) {
+ if ((gob->ob->restrictflag & flag) == 0)
return 0;
}
@@ -229,8 +231,8 @@ static int group_select_flag(Group *gr)
{
GroupObject *gob;
- for(gob= gr->gobject.first; gob; gob= gob->next)
- if((gob->ob->flag & SELECT))
+ for (gob= gr->gobject.first; gob; gob= gob->next)
+ if ((gob->ob->flag & SELECT))
return 1;
return 0;
@@ -242,23 +244,23 @@ void restrictbutton_gr_restrict_flag(void *poin, void *poin2, int flag)
GroupObject *gob;
Group *gr = (Group *)poin2;
- if(group_restrict_flag(gr, flag)) {
- for(gob= gr->gobject.first; gob; gob= gob->next) {
+ if (group_restrict_flag(gr, flag)) {
+ for (gob= gr->gobject.first; gob; gob= gob->next) {
gob->ob->restrictflag &= ~flag;
- if(flag==OB_RESTRICT_VIEW)
- if(gob->ob->flag & SELECT)
+ if (flag==OB_RESTRICT_VIEW)
+ if (gob->ob->flag & SELECT)
ED_base_object_select(object_in_scene(gob->ob, scene), BA_DESELECT);
}
}
else {
- for(gob= gr->gobject.first; gob; gob= gob->next) {
+ for (gob= gr->gobject.first; gob; gob= gob->next) {
/* not in editmode */
- if(scene->obedit!=gob->ob) {
+ if (scene->obedit!=gob->ob) {
gob->ob->restrictflag |= flag;
- if(flag==OB_RESTRICT_VIEW)
- if((gob->ob->flag & SELECT) == 0)
+ if (flag==OB_RESTRICT_VIEW)
+ if ((gob->ob->flag & SELECT) == 0)
ED_base_object_select(object_in_scene(gob->ob, scene), BA_SELECT);
}
}
@@ -290,10 +292,10 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
TreeStore *ts= soops->treestore;
TreeStoreElem *tselem= tsep;
- if(ts && tselem) {
+ if (ts && tselem) {
TreeElement *te= outliner_find_tse(soops, tselem);
- if(tselem->type==0) {
+ if (tselem->type==0) {
test_idbutton(tselem->id->name+2); // library.c, unique name and alpha sort
switch(GS(tselem->id->name)) {
@@ -333,7 +335,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
case TSE_EBONE:
{
bArmature *arm= (bArmature *)tselem->id;
- if(arm->edbo) {
+ if (arm->edbo) {
EditBone *ebone= te->directdata;
char newname[sizeof(ebone->name)];
@@ -405,11 +407,11 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
Object *ob = NULL;
Group *gr = NULL;
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
- if(te->ys+2*UI_UNIT_Y >= ar->v2d.cur.ymin && te->ys <= ar->v2d.cur.ymax) {
+ if (te->ys+2*UI_UNIT_Y >= ar->v2d.cur.ymin && te->ys <= ar->v2d.cur.ymax) {
/* objects have toggle-able restriction flags */
- if(tselem->type==0 && te->idcode==ID_OB) {
+ if (tselem->type==0 && te->idcode==ID_OB) {
PointerRNA ptr;
ob = (Object *)tselem->id;
@@ -434,7 +436,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
uiBlockSetEmboss(block, UI_EMBOSS);
}
- if(tselem->type==0 && te->idcode==ID_GR){
+ if (tselem->type==0 && te->idcode==ID_GR) {
int restrict_bool;
gr = (Group *)tselem->id;
@@ -455,7 +457,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
uiBlockSetEmboss(block, UI_EMBOSS);
}
/* scene render layers and passes have toggle-able flags too! */
- else if(tselem->type==TSE_R_LAYER) {
+ else if (tselem->type==TSE_R_LAYER) {
uiBlockSetEmboss(block, UI_EMBOSSN);
bt= uiDefIconButBitI(block, ICONTOGN, SCE_LAY_DISABLE, 0, ICON_CHECKBOX_HLT-1,
@@ -464,7 +466,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
uiBlockSetEmboss(block, UI_EMBOSS);
}
- else if(tselem->type==TSE_R_PASS) {
+ else if (tselem->type==TSE_R_PASS) {
int *layflag= te->directdata;
int passflag= 1<<tselem->nr;
@@ -476,14 +478,14 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
uiButSetFunc(bt, restrictbutton_r_lay_cb, tselem->id, NULL);
layflag++; /* is lay_xor */
- if(ELEM8(passflag, SCE_PASS_SPEC, SCE_PASS_SHADOW, SCE_PASS_AO, SCE_PASS_REFLECT, SCE_PASS_REFRACT, SCE_PASS_INDIRECT, SCE_PASS_EMIT, SCE_PASS_ENVIRONMENT))
+ if (ELEM8(passflag, SCE_PASS_SPEC, SCE_PASS_SHADOW, SCE_PASS_AO, SCE_PASS_REFLECT, SCE_PASS_REFRACT, SCE_PASS_INDIRECT, SCE_PASS_EMIT, SCE_PASS_ENVIRONMENT))
bt= uiDefIconButBitI(block, TOG, passflag, 0, (*layflag & passflag)?ICON_DOT:ICON_BLANK1,
(int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, (int)te->ys, UI_UNIT_X-1, UI_UNIT_Y-1, layflag, 0, 0, 0, 0, "Exclude this Pass from Combined");
uiButSetFunc(bt, restrictbutton_r_lay_cb, tselem->id, NULL);
uiBlockSetEmboss(block, UI_EMBOSS);
}
- else if(tselem->type==TSE_MODIFIER) {
+ else if (tselem->type==TSE_MODIFIER) {
ModifierData *md= (ModifierData *)te->directdata;
ob = (Object *)tselem->id;
@@ -496,7 +498,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
(int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, (int)te->ys, UI_UNIT_X-1, UI_UNIT_Y-1, &(md->mode), 0, 0, 0, 0, "Restrict/Allow renderability");
uiButSetFunc(bt, restrictbutton_modifier_cb, scene, ob);
}
- else if(tselem->type==TSE_POSE_CHANNEL) {
+ else if (tselem->type==TSE_POSE_CHANNEL) {
bPoseChannel *pchan= (bPoseChannel *)te->directdata;
Bone *bone = pchan->bone;
@@ -509,7 +511,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
(int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, (int)te->ys, UI_UNIT_X-1, UI_UNIT_Y-1, &(bone->flag), 0, 0, 0, 0, "Restrict/Allow selection in the 3D View");
uiButSetFunc(bt, restrictbutton_bone_cb, NULL, NULL);
}
- else if(tselem->type==TSE_EBONE) {
+ else if (tselem->type==TSE_EBONE) {
EditBone *ebone= (EditBone *)te->directdata;
uiBlockSetEmboss(block, UI_EMBOSSN);
@@ -523,7 +525,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
}
}
- if(TSELEM_OPEN(tselem,soops)) outliner_draw_restrictbuts(block, scene, ar, soops, &te->subtree);
+ if (TSELEM_OPEN(tselem,soops)) outliner_draw_restrictbuts(block, scene, ar, soops, &te->subtree);
}
}
@@ -532,7 +534,7 @@ static void outliner_draw_rnacols(ARegion *ar, int sizex)
View2D *v2d= &ar->v2d;
float miny = v2d->cur.ymin-V2D_SCROLL_HEIGHT;
- if(miny<v2d->tot.ymin) miny = v2d->tot.ymin;
+ if (miny<v2d->tot.ymin) miny = v2d->tot.ymin;
UI_ThemeColorShadeAlpha(TH_BACK, -15, -200);
@@ -557,17 +559,17 @@ static void outliner_draw_rnabuts(uiBlock *block, Scene *scene, ARegion *ar, Spa
uiBlockSetEmboss(block, UI_EMBOSST);
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
- if(te->ys+2*UI_UNIT_Y >= ar->v2d.cur.ymin && te->ys <= ar->v2d.cur.ymax) {
- if(tselem->type == TSE_RNA_PROPERTY) {
+ if (te->ys+2*UI_UNIT_Y >= ar->v2d.cur.ymin && te->ys <= ar->v2d.cur.ymax) {
+ if (tselem->type == TSE_RNA_PROPERTY) {
ptr= &te->rnaptr;
prop= te->directdata;
- if(!(RNA_property_type(prop) == PROP_POINTER && (TSELEM_OPEN(tselem,soops))) )
+ if (!(RNA_property_type(prop) == PROP_POINTER && (TSELEM_OPEN(tselem,soops))) )
uiDefAutoButR(block, ptr, prop, -1, "", ICON_NONE, sizex, (int)te->ys, OL_RNA_COL_SIZEX, UI_UNIT_Y-1);
}
- else if(tselem->type == TSE_RNA_ARRAY_ELEM) {
+ else if (tselem->type == TSE_RNA_ARRAY_ELEM) {
ptr= &te->rnaptr;
prop= te->directdata;
@@ -575,16 +577,16 @@ static void outliner_draw_rnabuts(uiBlock *block, Scene *scene, ARegion *ar, Spa
}
}
- if(TSELEM_OPEN(tselem,soops)) outliner_draw_rnabuts(block, scene, ar, soops, sizex, &te->subtree);
+ if (TSELEM_OPEN(tselem,soops)) outliner_draw_rnabuts(block, scene, ar, soops, sizex, &te->subtree);
}
}
static void operator_call_cb(struct bContext *UNUSED(C), void *arg_kmi, void *arg2)
{
wmOperatorType *ot= arg2;
- wmKeyMapItem *kmi= arg_kmi;
+ wmKeyMapItem *kmi = arg_kmi;
- if(ot)
+ if (ot)
BLI_strncpy(kmi->idname, ot->idname, OP_MAX_TYPENAME);
}
@@ -592,16 +594,16 @@ static void operator_search_cb(const struct bContext *UNUSED(C), void *UNUSED(ar
{
GHashIterator *iter= WM_operatortype_iter();
- for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+ for ( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
wmOperatorType *ot= BLI_ghashIterator_getValue(iter);
- if(BLI_strcasestr(ot->idname, str)) {
+ if (BLI_strcasestr(ot->idname, str)) {
char name[OP_MAX_TYPENAME];
/* display name for menu */
WM_operator_py_idname(name, ot->idname);
- if(0==uiSearchItemAdd(items, name, ot, 0))
+ if (0==uiSearchItemAdd(items, name, ot, 0))
break;
}
}
@@ -614,7 +616,7 @@ static uiBlock *operator_search_menu(bContext *C, ARegion *ar, void *arg_kmi)
static char search[OP_MAX_TYPENAME];
wmEvent event;
wmWindow *win= CTX_wm_window(C);
- wmKeyMapItem *kmi= arg_kmi;
+ wmKeyMapItem *kmi = arg_kmi;
wmOperatorType *ot= WM_operatortype_find(kmi->idname, 0);
uiBlock *block;
uiBut *but;
@@ -628,7 +630,7 @@ static uiBlock *operator_search_menu(bContext *C, ARegion *ar, void *arg_kmi)
/* fake button, it holds space for search items */
uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
- but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, UI_UNIT_Y, 0, 0, "");
+ but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, UI_UNIT_Y, 0, 0, "");
uiButSetSearchFunc(but, operator_search_cb, arg_kmi, operator_call_cb, ot);
uiBoundsBlock(block, 6);
@@ -652,9 +654,9 @@ static uiBlock *operator_search_menu(bContext *C, ARegion *ar, void *arg_kmi)
static short keymap_menu_type(short type)
{
- if(ISKEYBOARD(type)) return OL_KM_KEYBOARD;
- if(ISTWEAK(type)) return OL_KM_TWEAK;
- if(ISMOUSE(type)) return OL_KM_MOUSE;
+ if (ISKEYBOARD(type)) return OL_KM_KEYBOARD;
+ if (ISTWEAK(type)) return OL_KM_TWEAK;
+ if (ISMOUSE(type)) return OL_KM_MOUSE;
// return OL_KM_SPECIALS;
return 0;
}
@@ -733,10 +735,10 @@ static const char *keymap_tweak_dir_menu(void)
static void keymap_type_cb(bContext *C, void *kmi_v, void *UNUSED(arg_v))
{
- wmKeyMapItem *kmi= kmi_v;
+ wmKeyMapItem *kmi = kmi_v;
short maptype= keymap_menu_type(kmi->type);
- if(maptype!=kmi->maptype) {
+ if (maptype!=kmi->maptype) {
switch(kmi->maptype) {
case OL_KM_KEYBOARD:
kmi->type= AKEY;
@@ -765,9 +767,9 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo
uiBlockSetEmboss(block, UI_EMBOSST);
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
- if(te->ys+2*UI_UNIT_Y >= ar->v2d.cur.ymin && te->ys <= ar->v2d.cur.ymax) {
+ if (te->ys+2*UI_UNIT_Y >= ar->v2d.cur.ymin && te->ys <= ar->v2d.cur.ymax) {
uiBut *but;
const char *str;
int xstart= 240;
@@ -775,11 +777,11 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo
int butw2= 90; /* event type, menus */
int butw3= 43; /* modifiers */
- if(tselem->type == TSE_KEYMAP_ITEM) {
- wmKeyMapItem *kmi= te->directdata;
+ if (tselem->type == TSE_KEYMAP_ITEM) {
+ wmKeyMapItem *kmi = te->directdata;
/* modal map? */
- if(kmi->propvalue);
+ if (kmi->propvalue);
else {
uiDefBlockBut(block, operator_search_menu, kmi, "", xstart, (int)te->ys+1, butw1, UI_UNIT_Y-1, "Assign new Operator");
}
@@ -789,7 +791,7 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo
kmi->maptype= keymap_menu_type(kmi->type);
str= keymap_type_menu();
- but= uiDefButS(block, MENU, 0, str, xstart, (int)te->ys+1, butw2, UI_UNIT_Y-1, &kmi->maptype, 0, 0, 0, 0, "Event type");
+ but = uiDefButS(block, MENU, 0, str, xstart, (int)te->ys+1, butw2, UI_UNIT_Y-1, &kmi->maptype, 0, 0, 0, 0, "Event type");
uiButSetFunc(but, keymap_type_cb, kmi, NULL);
xstart+= butw2+5;
@@ -824,7 +826,7 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo
xstart+= butw3+5;
/* rna property */
- if(kmi->ptr && kmi->ptr->data) {
+ if (kmi->ptr && kmi->ptr->data) {
uiDefBut(block, LABEL, 0, "(RNA property)", xstart, (int)te->ys+1, butw2, UI_UNIT_Y-1, &kmi->oskey, 0, 0, 0, 0, ""); xstart+= butw2;
}
@@ -832,7 +834,7 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo
}
}
- if(TSELEM_OPEN(tselem,soops)) outliner_draw_keymapbuts(block, ar, soops, &te->subtree);
+ if (TSELEM_OPEN(tselem,soops)) outliner_draw_keymapbuts(block, ar, soops, &te->subtree);
}
}
@@ -844,38 +846,38 @@ static void outliner_buttons(const bContext *C, uiBlock *block, ARegion *ar, Spa
TreeStoreElem *tselem;
int spx, dx, len;
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
- if(te->ys+2*UI_UNIT_Y >= ar->v2d.cur.ymin && te->ys <= ar->v2d.cur.ymax) {
+ if (te->ys+2*UI_UNIT_Y >= ar->v2d.cur.ymin && te->ys <= ar->v2d.cur.ymax) {
- if(tselem->flag & TSE_TEXTBUT) {
+ if (tselem->flag & TSE_TEXTBUT) {
/* If we add support to rename Sequence.
* need change this.
*/
- if(tselem->type == TSE_POSE_BASE) continue; // prevent crash when trying to rename 'pose' entry of armature
+ if (tselem->type == TSE_POSE_BASE) continue; // prevent crash when trying to rename 'pose' entry of armature
- if(tselem->type==TSE_EBONE) len = sizeof(((EditBone*) 0)->name);
+ if (tselem->type==TSE_EBONE) len = sizeof(((EditBone*) 0)->name);
else if (tselem->type==TSE_MODIFIER) len = sizeof(((ModifierData*) 0)->name);
- else if(tselem->id && GS(tselem->id->name)==ID_LI) len = sizeof(((Library*) 0)->name);
+ else if (tselem->id && GS(tselem->id->name)==ID_LI) len = sizeof(((Library*) 0)->name);
else len= MAX_ID_NAME-2;
dx= (int)UI_GetStringWidth(te->name);
- if(dx<100) dx= 100;
+ if (dx<100) dx= 100;
spx=te->xs+2*UI_UNIT_X-4;
- if(spx+dx+10>ar->v2d.cur.xmax) dx = ar->v2d.cur.xmax-spx-10;
+ if (spx+dx+10>ar->v2d.cur.xmax) dx = ar->v2d.cur.xmax-spx-10;
bt= uiDefBut(block, TEX, OL_NAMEBUTTON, "", spx, (int)te->ys, dx+10, UI_UNIT_Y-1, (void *)te->name, 1.0, (float)len, 0, 0, "");
uiButSetRenameFunc(bt, namebutton_cb, tselem);
/* returns false if button got removed */
- if( 0 == uiButActiveOnly(C, block, bt) )
+ if ( 0 == uiButActiveOnly(C, block, bt) )
tselem->flag &= ~TSE_TEXTBUT;
}
}
- if(TSELEM_OPEN(tselem,soops)) outliner_buttons(C, block, ar, soops, &te->subtree);
+ if (TSELEM_OPEN(tselem,soops)) outliner_buttons(C, block, ar, soops, &te->subtree);
}
}
@@ -892,17 +894,18 @@ 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 */
- if(arg->x >= arg->xmax) {
+ /* 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);
glDisable(GL_BLEND);
- } else {
+ }
+ else {
/* XXX investigate: button placement of icons is way different than UI_icon_draw? */
float ufac= UI_UNIT_X/20.0f;
- uiBut *but= uiDefIconBut(arg->block, LABEL, 0, icon, arg->x-3.0f*ufac, arg->y, UI_UNIT_X-4.0f*ufac, UI_UNIT_Y-4.0f*ufac, NULL, 0.0, 0.0, 1.0, arg->alpha, (arg->id && arg->id->lib) ? arg->id->lib->name : "");
+ uiBut *but = uiDefIconBut(arg->block, LABEL, 0, icon, arg->x-3.0f*ufac, arg->y, UI_UNIT_X-4.0f*ufac, UI_UNIT_Y-4.0f*ufac, NULL, 0.0, 0.0, 1.0, arg->alpha, (arg->id && arg->id->lib) ? arg->id->lib->name : "");
- if(arg->id)
+ if (arg->id)
uiButSetDragID(but, arg->id);
}
@@ -915,12 +918,12 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto
/* make function calls a bit compacter */
arg.block= block;
arg.id= tselem->id;
- arg.xmax= xmax;
+ arg.xmax = xmax;
arg.x= x;
arg.y= y;
arg.alpha= alpha;
- if(tselem->type) {
+ if (tselem->type) {
switch( tselem->type) {
case TSE_ANIM_DATA:
UI_icon_draw(x, y, ICON_ANIM_DATA); break; // xxx
@@ -1050,15 +1053,15 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto
case TSE_POSEGRP_BASE:
UI_icon_draw(x, y, ICON_VERTEXSEL); break;
case TSE_SEQUENCE:
- if(te->idcode==SEQ_MOVIE)
+ if (te->idcode==SEQ_MOVIE)
UI_icon_draw(x, y, ICON_SEQUENCE);
- else if(te->idcode==SEQ_META)
+ else if (te->idcode==SEQ_META)
UI_icon_draw(x, y, ICON_DOT);
- else if(te->idcode==SEQ_SCENE)
+ else if (te->idcode==SEQ_SCENE)
UI_icon_draw(x, y, ICON_SCENE);
- else if(te->idcode==SEQ_SOUND)
+ else if (te->idcode==SEQ_SOUND)
UI_icon_draw(x, y, ICON_SOUND);
- else if(te->idcode==SEQ_IMAGE)
+ else if (te->idcode==SEQ_IMAGE)
UI_icon_draw(x, y, ICON_IMAGE_COL);
else
UI_icon_draw(x, y, ICON_PARTICLES);
@@ -1070,7 +1073,7 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto
UI_icon_draw(x, y, ICON_OBJECT_DATA);
break;
case TSE_RNA_STRUCT:
- if(RNA_struct_is_ID(te->rnaptr.type)) {
+ if (RNA_struct_is_ID(te->rnaptr.type)) {
arg.id= (ID *)te->rnaptr.data;
tselem_draw_icon_uibut(&arg, RNA_struct_ui_icon(te->rnaptr.type));
}
@@ -1178,26 +1181,26 @@ static void outliner_draw_iconrow(bContext *C, uiBlock *block, Scene *scene, Spa
TreeStoreElem *tselem;
int active;
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
/* exit drawing early */
- if((*offsx) - UI_UNIT_X > xmax)
+ if ((*offsx) - UI_UNIT_X > xmax)
break;
tselem= TREESTORE(te);
/* object hierarchy always, further constrained on level */
- if(level<1 || (tselem->type==0 && te->idcode==ID_OB)) {
+ if (level<1 || (tselem->type==0 && te->idcode==ID_OB)) {
/* active blocks get white circle */
- if(tselem->type==0) {
- if(te->idcode==ID_OB) active= (OBACT==(Object *)tselem->id);
- else if(scene->obedit && scene->obedit->data==tselem->id) active= 1; // XXX use context?
+ if (tselem->type==0) {
+ if (te->idcode==ID_OB) active= (OBACT==(Object *)tselem->id);
+ else if (scene->obedit && scene->obedit->data==tselem->id) active= 1; // XXX use context?
else active= tree_element_active(C, scene, soops, te, 0);
}
else active= tree_element_type_active(NULL, scene, soops, te, tselem, 0);
- if(active) {
+ if (active) {
float ufac= UI_UNIT_X/20.0f;
uiSetRoundBox(UI_CNR_ALL);
@@ -1215,8 +1218,8 @@ static void outliner_draw_iconrow(bContext *C, uiBlock *block, Scene *scene, Spa
(*offsx) += UI_UNIT_X;
}
- /* this tree element always has same amount of branches, so dont draw */
- if(tselem->type!=TSE_R_LAYER)
+ /* this tree element always has same amount of branches, so don't draw */
+ if (tselem->type!=TSE_R_LAYER)
outliner_draw_iconrow(C, block, scene, soops, &te->subtree, level+1, xmax, offsx, ys);
}
@@ -1231,7 +1234,7 @@ static void outliner_set_coord_tree_element(SpaceOops *soops, TreeElement *te, i
te->xs= (float)startx;
te->ys= (float)(*starty);
- for(ten= te->subtree.first; ten; ten= ten->next) {
+ for (ten= te->subtree.first; ten; ten= ten->next) {
outliner_set_coord_tree_element(soops, ten, startx+UI_UNIT_X, starty);
}
}
@@ -1246,11 +1249,11 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
tselem= TREESTORE(te);
- if(*starty+2*UI_UNIT_Y >= ar->v2d.cur.ymin && *starty<= ar->v2d.cur.ymax) {
+ if (*starty+2*UI_UNIT_Y >= ar->v2d.cur.ymin && *starty<= ar->v2d.cur.ymax) {
int xmax= ar->v2d.cur.xmax;
- /* icons can be ui buts, we dont want it to overlap with restrict */
- if((soops->flag & SO_HIDE_RESTRICTCOLS)==0)
+ /* icons can be ui buts, we don't want it to overlap with restrict */
+ if ((soops->flag & SO_HIDE_RESTRICTCOLS)==0)
xmax-= OL_TOGW+UI_UNIT_X;
glEnable(GL_BLEND);
@@ -1270,17 +1273,17 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
}
/* colors for active/selected data */
- if(tselem->type==0) {
- if(te->idcode==ID_SCE) {
- if(tselem->id == (ID *)scene) {
+ if (tselem->type==0) {
+ if (te->idcode==ID_SCE) {
+ if (tselem->id == (ID *)scene) {
glColor4ub(255, 255, 255, 100);
active= 2;
}
}
- else if(te->idcode==ID_GR) {
+ else if (te->idcode==ID_GR) {
Group *gr = (Group *)tselem->id;
- if(group_select_flag(gr)) {
+ if (group_select_flag(gr)) {
char col[4];
UI_GetThemeColorType4ubv(TH_SELECT, SPACE_VIEW3D, col);
col[3]= 100;
@@ -1289,24 +1292,24 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
active= 2;
}
}
- else if(te->idcode==ID_OB) {
+ else if (te->idcode==ID_OB) {
Object *ob= (Object *)tselem->id;
- if(ob==OBACT || (ob->flag & SELECT)) {
+ if (ob==OBACT || (ob->flag & SELECT)) {
char col[4]= {0, 0, 0, 0};
/* outliner active ob: always white text, circle color now similar to view3d */
active= 2; /* means it draws a color circle */
- if(ob==OBACT) {
- if(ob->flag & SELECT) {
+ if (ob==OBACT) {
+ if (ob->flag & SELECT) {
UI_GetThemeColorType4ubv(TH_ACTIVE, SPACE_VIEW3D, col);
col[3]= 100;
}
active= 1; /* means it draws white text */
}
- else if(ob->flag & SELECT) {
+ else if (ob->flag & SELECT) {
UI_GetThemeColorType4ubv(TH_SELECT, SPACE_VIEW3D, col);
col[3]= 100;
}
@@ -1315,24 +1318,24 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
}
}
- else if(scene->obedit && scene->obedit->data==tselem->id) {
+ else if (scene->obedit && scene->obedit->data==tselem->id) {
glColor4ub(255, 255, 255, 100);
active= 2;
}
else {
- if(tree_element_active(C, scene, soops, te, 0)) {
+ if (tree_element_active(C, scene, soops, te, 0)) {
glColor4ub(220, 220, 255, 100);
active= 2;
}
}
}
else {
- if( tree_element_type_active(NULL, scene, soops, te, tselem, 0) ) active= 2;
+ if ( tree_element_type_active(NULL, scene, soops, te, tselem, 0) ) active= 2;
glColor4ub(220, 220, 255, 100);
}
/* active circle */
- if(active) {
+ if (active) {
uiSetRoundBox(UI_CNR_ALL);
uiRoundBox( (float)startx+UI_UNIT_Y-1.5f*ufac, (float)*starty+2.0f*ufac, (float)startx+2.0f*UI_UNIT_Y-4.0f*ufac, (float)*starty+UI_UNIT_Y-1.0f*ufac, UI_UNIT_Y/2.0f-2.0f*ufac);
glEnable(GL_BLEND); /* roundbox disables it */
@@ -1341,15 +1344,15 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
}
/* open/close icon, only when sublevels, except for scene */
- if(te->subtree.first || (tselem->type==0 && te->idcode==ID_SCE) || (te->flag & TE_LAZY_CLOSED)) {
+ if (te->subtree.first || (tselem->type==0 && te->idcode==ID_SCE) || (te->flag & TE_LAZY_CLOSED)) {
int icon_x;
- if(tselem->type==0 && ELEM(te->idcode, ID_OB, ID_SCE))
+ if (tselem->type==0 && ELEM(te->idcode, ID_OB, ID_SCE))
icon_x = startx;
else
icon_x = startx+5*ufac;
// icons a bit higher
- if(TSELEM_OPEN(tselem,soops))
+ if (TSELEM_OPEN(tselem,soops))
UI_icon_draw((float)icon_x, (float)*starty+2*ufac, ICON_DISCLOSURE_TRI_DOWN);
else
UI_icon_draw((float)icon_x, (float)*starty+2*ufac, ICON_DISCLOSURE_TRI_RIGHT);
@@ -1358,7 +1361,7 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
/* datatype icon */
- if(!(ELEM(tselem->type, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM))) {
+ if (!(ELEM(tselem->type, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM))) {
// icons a bit higher
tselem_draw_icon(block, xmax, (float)startx+offsx - 0.5f*ufac, (float)*starty+2.0f*ufac, tselem, te, 1.0f);
@@ -1367,9 +1370,9 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
else
offsx+= 2*ufac;
- if(tselem->type==0 && tselem->id->lib) {
+ if (tselem->type==0 && tselem->id->lib) {
glPixelTransferf(GL_ALPHA_SCALE, 0.5f);
- if(tselem->id->flag & LIB_INDIRECT)
+ if (tselem->id->flag & LIB_INDIRECT)
UI_icon_draw((float)startx+offsx, (float)*starty+2*ufac, ICON_LIBRARY_DATA_INDIRECT);
else
UI_icon_draw((float)startx+offsx, (float)*starty+2*ufac, ICON_LIBRARY_DATA_DIRECT);
@@ -1379,8 +1382,8 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
glDisable(GL_BLEND);
/* name */
- if(active==1) UI_ThemeColor(TH_TEXT_HI);
- else if(ELEM(tselem->type, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) UI_ThemeColorBlend(TH_BACK, TH_TEXT, 0.75f);
+ if (active==1) UI_ThemeColor(TH_TEXT_HI);
+ else if (ELEM(tselem->type, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) UI_ThemeColorBlend(TH_BACK, TH_TEXT, 0.75f);
else UI_ThemeColor(TH_TEXT);
UI_DrawString(startx+offsx, *starty+5*ufac, te->name);
@@ -1388,10 +1391,10 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
offsx+= (int)(UI_UNIT_X + UI_GetStringWidth(te->name));
/* closed item, we draw the icons, not when it's a scene, or master-server list though */
- if(!TSELEM_OPEN(tselem,soops)) {
- if(te->subtree.first) {
- if(tselem->type==0 && te->idcode==ID_SCE);
- else if(tselem->type!=TSE_R_LAYER) { /* this tree element always has same amount of branches, so dont draw */
+ if (!TSELEM_OPEN(tselem,soops)) {
+ if (te->subtree.first) {
+ if (tselem->type==0 && te->idcode==ID_SCE);
+ else if (tselem->type!=TSE_R_LAYER) { /* this tree element always has same amount of branches, so don't draw */
int tempx= startx+offsx;
// divider
@@ -1414,14 +1417,14 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
te->ys= (float)*starty;
te->xend= startx+offsx;
- if(TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem,soops)) {
*starty-= UI_UNIT_Y;
- for(ten= te->subtree.first; ten; ten= ten->next)
+ for (ten= te->subtree.first; ten; ten= ten->next)
outliner_draw_tree_element(C, block, scene, ar, soops, ten, startx+UI_UNIT_X, starty);
}
else {
- for(ten= te->subtree.first; ten; ten= ten->next)
+ for (ten= te->subtree.first; ten; ten= ten->next)
outliner_set_coord_tree_element(soops, te, startx, starty);
*starty-= UI_UNIT_Y;
@@ -1434,28 +1437,28 @@ static void outliner_draw_hierarchy(SpaceOops *soops, ListBase *lb, int startx,
TreeStoreElem *tselem;
int y1, y2;
- if(lb->first==NULL) return;
+ if (lb->first==NULL) return;
y1=y2= *starty; /* for vertical lines between objects */
- for(te=lb->first; te; te= te->next) {
+ for (te=lb->first; te; te= te->next) {
y2= *starty;
tselem= TREESTORE(te);
/* horizontal line? */
- if(tselem->type==0 && (te->idcode==ID_OB || te->idcode==ID_SCE))
+ if (tselem->type==0 && (te->idcode==ID_OB || te->idcode==ID_SCE))
glRecti(startx, *starty, startx+UI_UNIT_X, *starty-1);
*starty-= UI_UNIT_Y;
- if(TSELEM_OPEN(tselem,soops))
+ if (TSELEM_OPEN(tselem,soops))
outliner_draw_hierarchy(soops, &te->subtree, startx+UI_UNIT_X, starty);
}
/* vertical line */
te= lb->last;
- if(te->parent || lb->first!=lb->last) {
+ if (te->parent || lb->first!=lb->last) {
tselem= TREESTORE(te);
- if(tselem->type==0 && te->idcode==ID_OB) {
+ if (tselem->type==0 && te->idcode==ID_OB) {
glRecti(startx, y1+UI_UNIT_Y, startx+1, y2);
}
@@ -1467,18 +1470,18 @@ static void outliner_draw_struct_marks(ARegion *ar, SpaceOops *soops, ListBase *
TreeElement *te;
TreeStoreElem *tselem;
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
/* selection status */
- if(TSELEM_OPEN(tselem,soops))
- if(tselem->type == TSE_RNA_STRUCT)
+ if (TSELEM_OPEN(tselem,soops))
+ if (tselem->type == TSE_RNA_STRUCT)
glRecti(0, *starty+1, (int)ar->v2d.cur.xmax+V2D_SCROLL_WIDTH, *starty+UI_UNIT_Y-1);
*starty-= UI_UNIT_Y;
- if(TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem,soops)) {
outliner_draw_struct_marks(ar, soops, &te->subtree, starty);
- if(tselem->type == TSE_RNA_STRUCT)
+ if (tselem->type == TSE_RNA_STRUCT)
fdrawline(0, (float)*starty+UI_UNIT_Y, ar->v2d.cur.xmax+V2D_SCROLL_WIDTH, (float)*starty+UI_UNIT_Y);
}
}
@@ -1489,15 +1492,15 @@ static void outliner_draw_selection(ARegion *ar, SpaceOops *soops, ListBase *lb,
TreeElement *te;
TreeStoreElem *tselem;
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
/* selection status */
- if(tselem->flag & TSE_SELECTED) {
+ if (tselem->flag & TSE_SELECTED) {
glRecti(0, *starty+1, (int)ar->v2d.cur.xmax, *starty+UI_UNIT_Y-1);
}
*starty-= UI_UNIT_Y;
- if(TSELEM_OPEN(tselem,soops)) outliner_draw_selection(ar, soops, &te->subtree, starty);
+ if (TSELEM_OPEN(tselem,soops)) outliner_draw_selection(ar, soops, &te->subtree, starty);
}
}
@@ -1533,7 +1536,7 @@ static void outliner_draw_tree(bContext *C, uiBlock *block, Scene *scene, ARegio
// items themselves
starty= (int)ar->v2d.tot.ymax-UI_UNIT_Y-OL_Y_OFFSET;
startx= 0;
- for(te= soops->tree.first; te; te= te->next) {
+ for (te= soops->tree.first; te; te= te->next) {
outliner_draw_tree_element(C, block, scene, ar, soops, te, startx, &starty);
}
}
@@ -1547,7 +1550,7 @@ static void outliner_back(ARegion *ar)
ystart= (int)ar->v2d.tot.ymax;
ystart= UI_UNIT_Y*(ystart/(UI_UNIT_Y))-OL_Y_OFFSET;
- while(ystart+2*UI_UNIT_Y > ar->v2d.cur.ymin) {
+ while (ystart+2*UI_UNIT_Y > ar->v2d.cur.ymin) {
glRecti(0, ystart, (int)ar->v2d.cur.xmax+V2D_SCROLL_WIDTH, ystart+UI_UNIT_Y);
ystart-= 2*UI_UNIT_Y;
}
@@ -1565,7 +1568,7 @@ static void outliner_draw_restrictcols(ARegion *ar)
ystart= (int)ar->v2d.tot.ymax;
ystart= UI_UNIT_Y*(ystart/(UI_UNIT_Y))-OL_Y_OFFSET;
- while(ystart+2*UI_UNIT_Y > ar->v2d.cur.ymin) {
+ while (ystart+2*UI_UNIT_Y > ar->v2d.cur.ymin) {
glRecti((int)ar->v2d.cur.xmax-OL_TOGW, ystart, (int)ar->v2d.cur.xmax, ystart+UI_UNIT_Y);
ystart-= 2*UI_UNIT_Y;
}
@@ -1658,12 +1661,12 @@ void draw_outliner(const bContext *C)
block= uiBeginBlock(C, ar, __func__, UI_EMBOSS);
outliner_draw_tree((bContext *)C, block, scene, ar, soops);
- if(ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) {
+ if (ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) {
/* draw rna buttons */
outliner_draw_rnacols(ar, sizex_rna);
outliner_draw_rnabuts(block, scene, ar, soops, sizex_rna, &soops->tree);
}
- else if(soops->outlinevis == SO_KEYMAP) {
+ else if (soops->outlinevis == SO_KEYMAP) {
outliner_draw_keymapbuts(block, ar, soops, &soops->tree);
}
else if (!(soops->flag & SO_HIDE_RESTRICTCOLS)) {
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index de798e5c23b..c59cd626a93 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -158,24 +158,24 @@ static void outliner_open_reveal(SpaceOops *soops, ListBase *lb, TreeElement *te
static int do_outliner_item_openclose(bContext *C, SpaceOops *soops, TreeElement *te, int all, const float mval[2])
{
- if(mval[1]>te->ys && mval[1]<te->ys+UI_UNIT_Y) {
+ if (mval[1]>te->ys && mval[1]<te->ys+UI_UNIT_Y) {
TreeStoreElem *tselem= TREESTORE(te);
/* all below close/open? */
- if(all) {
+ if (all) {
tselem->flag &= ~TSE_CLOSED;
outliner_set_flag(soops, &te->subtree, TSE_CLOSED, !outliner_has_one_flag(soops, &te->subtree, TSE_CLOSED, 1));
}
else {
- if(tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED;
+ if (tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED;
else tselem->flag |= TSE_CLOSED;
}
return 1;
}
- for(te= te->subtree.first; te; te= te->next) {
- if(do_outliner_item_openclose(C, soops, te, all, mval))
+ for (te= te->subtree.first; te; te= te->next) {
+ if (do_outliner_item_openclose(C, soops, te, all, mval))
return 1;
}
return 0;
@@ -193,8 +193,8 @@ static int outliner_item_openclose(bContext *C, wmOperator *op, wmEvent *event)
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], fmval, fmval+1);
- for(te= soops->tree.first; te; te= te->next) {
- if(do_outliner_item_openclose(C, soops, te, all, fmval))
+ for (te= soops->tree.first; te; te= te->next) {
+ if (do_outliner_item_openclose(C, soops, te, all, fmval))
break;
}
@@ -205,13 +205,13 @@ static int outliner_item_openclose(bContext *C, wmOperator *op, wmEvent *event)
void OUTLINER_OT_item_openclose(wmOperatorType *ot)
{
- ot->name= "Open/Close Item";
- ot->idname= "OUTLINER_OT_item_openclose";
- ot->description= "Toggle whether item under cursor is enabled or closed";
+ ot->name = "Open/Close Item";
+ ot->idname = "OUTLINER_OT_item_openclose";
+ ot->description = "Toggle whether item under cursor is enabled or closed";
- ot->invoke= outliner_item_openclose;
+ ot->invoke = outliner_item_openclose;
- ot->poll= ED_operator_outliner_active;
+ ot->poll = ED_operator_outliner_active;
RNA_def_boolean(ot->srna, "all", 1, "All", "Close or open all items");
}
@@ -221,21 +221,21 @@ void OUTLINER_OT_item_openclose(wmOperatorType *ot)
static void do_item_rename(ARegion *ar, TreeElement *te, TreeStoreElem *tselem, ReportList *reports)
{
/* can't rename rna datablocks entries */
- if(ELEM3(tselem->type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
+ if (ELEM3(tselem->type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
/* do nothing */;
}
- else if(ELEM10(tselem->type, TSE_ANIM_DATA, TSE_NLA, TSE_DEFGROUP_BASE, TSE_CONSTRAINT_BASE, TSE_MODIFIER_BASE,
+ else if (ELEM10(tselem->type, TSE_ANIM_DATA, TSE_NLA, TSE_DEFGROUP_BASE, TSE_CONSTRAINT_BASE, TSE_MODIFIER_BASE,
TSE_SCRIPT_BASE, TSE_POSE_BASE, TSE_POSEGRP_BASE, TSE_R_LAYER_BASE, TSE_R_PASS))
{
BKE_report(reports, RPT_WARNING, "Cannot edit builtin name");
}
- else if(ELEM3(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) {
+ else if (ELEM3(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) {
BKE_report(reports, RPT_WARNING, "Cannot edit sequence name");
}
- else if(tselem->id->lib) {
+ else if (tselem->id->lib) {
// XXX error_libdata();
}
- else if(te->idcode == ID_LI && te->parent) {
+ else if (te->idcode == ID_LI && te->parent) {
BKE_report(reports, RPT_WARNING, "Cannot edit the path of an indirectly linked library");
}
else {
@@ -255,19 +255,19 @@ static int do_outliner_item_rename(bContext *C, ARegion *ar, SpaceOops *soops, T
{
ReportList *reports= CTX_wm_reports(C); // XXX
- if(mval[1]>te->ys && mval[1]<te->ys+UI_UNIT_Y) {
+ if (mval[1]>te->ys && mval[1]<te->ys+UI_UNIT_Y) {
TreeStoreElem *tselem= TREESTORE(te);
/* name and first icon */
- if(mval[0]>te->xs+UI_UNIT_X && mval[0]<te->xend) {
+ if (mval[0]>te->xs+UI_UNIT_X && mval[0]<te->xend) {
do_item_rename(ar, te, tselem, reports);
}
return 1;
}
- for(te= te->subtree.first; te; te= te->next) {
- if(do_outliner_item_rename(C, ar, soops, te, mval)) return 1;
+ for (te= te->subtree.first; te; te= te->next) {
+ if (do_outliner_item_rename(C, ar, soops, te, mval)) return 1;
}
return 0;
}
@@ -281,8 +281,8 @@ static int outliner_item_rename(bContext *C, wmOperator *UNUSED(op), wmEvent *ev
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], fmval, fmval+1);
- for(te= soops->tree.first; te; te= te->next) {
- if(do_outliner_item_rename(C, ar, soops, te, fmval)) break;
+ for (te= soops->tree.first; te; te= te->next) {
+ if (do_outliner_item_rename(C, ar, soops, te, fmval)) break;
}
return OPERATOR_FINISHED;
@@ -291,13 +291,13 @@ static int outliner_item_rename(bContext *C, wmOperator *UNUSED(op), wmEvent *ev
void OUTLINER_OT_item_rename(wmOperatorType *ot)
{
- ot->name= "Rename Item";
- ot->idname= "OUTLINER_OT_item_rename";
- ot->description= "Rename item under cursor";
+ ot->name = "Rename Item";
+ ot->idname = "OUTLINER_OT_item_rename";
+ ot->description = "Rename item under cursor";
- ot->invoke= outliner_item_rename;
+ ot->invoke = outliner_item_rename;
- ot->poll= ED_operator_outliner_active;
+ ot->poll = ED_operator_outliner_active;
}
/* ************************************************************** */
@@ -313,10 +313,10 @@ static int outliner_count_levels(SpaceOops *soops, ListBase *lb, int curlevel)
TreeElement *te;
int level=curlevel, lev;
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
lev= outliner_count_levels(soops, &te->subtree, curlevel+1);
- if(lev>level) level= lev;
+ if (lev>level) level= lev;
}
return level;
}
@@ -327,12 +327,12 @@ int outliner_has_one_flag(SpaceOops *soops, ListBase *lb, short flag, short curl
TreeStoreElem *tselem;
int level;
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
- if(tselem->flag & flag) return curlevel;
+ if (tselem->flag & flag) return curlevel;
level= outliner_has_one_flag(soops, &te->subtree, flag, curlevel+1);
- if(level) return level;
+ if (level) return level;
}
return 0;
}
@@ -342,9 +342,9 @@ void outliner_set_flag(SpaceOops *soops, ListBase *lb, short flag, short set)
TreeElement *te;
TreeStoreElem *tselem;
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
- if(set==0) tselem->flag &= ~flag;
+ if (set==0) tselem->flag &= ~flag;
else tselem->flag |= flag;
outliner_set_flag(soops, &te->subtree, flag, set);
}
@@ -385,10 +385,10 @@ void object_toggle_visibility_cb(bContext *C, Scene *scene, TreeElement *te, Tre
Object *ob = (Object *)tselem->id;
/* add check for edit mode */
- if(!common_restrict_check(C, ob)) return;
+ if (!common_restrict_check(C, ob)) return;
- if(base || (base= object_in_scene(ob, scene))) {
- if((base->object->restrictflag ^= OB_RESTRICT_VIEW)) {
+ if (base || (base= object_in_scene(ob, scene))) {
+ if ((base->object->restrictflag ^= OB_RESTRICT_VIEW)) {
ED_base_object_select(base, BA_DESELECT);
}
}
@@ -417,15 +417,15 @@ static int outliner_toggle_visibility_exec(bContext *C, wmOperator *UNUSED(op))
void OUTLINER_OT_visibility_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Visibility";
- ot->idname= "OUTLINER_OT_visibility_toggle";
- ot->description= "Toggle the visibility of selected items";
+ ot->name = "Toggle Visibility";
+ ot->idname = "OUTLINER_OT_visibility_toggle";
+ ot->description = "Toggle the visibility of selected items";
/* callbacks */
- ot->exec= outliner_toggle_visibility_exec;
- ot->poll= ED_operator_outliner_active_no_editobject;
+ ot->exec = outliner_toggle_visibility_exec;
+ ot->poll = ED_operator_outliner_active_no_editobject;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* Toggle Selectability ---------------------------------------- */
@@ -434,8 +434,8 @@ void object_toggle_selectability_cb(bContext *UNUSED(C), Scene *scene, TreeEleme
{
Base *base= (Base *)te->directdata;
- if(base==NULL) base= object_in_scene((Object *)tselem->id, scene);
- if(base) {
+ if (base==NULL) base= object_in_scene((Object *)tselem->id, scene);
+ if (base) {
base->object->restrictflag^=OB_RESTRICT_SELECT;
}
}
@@ -463,15 +463,15 @@ static int outliner_toggle_selectability_exec(bContext *C, wmOperator *UNUSED(op
void OUTLINER_OT_selectability_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Selectability";
- ot->idname= "OUTLINER_OT_selectability_toggle";
- ot->description= "Toggle the selectability";
+ ot->name = "Toggle Selectability";
+ ot->idname = "OUTLINER_OT_selectability_toggle";
+ ot->description = "Toggle the selectability";
/* callbacks */
- ot->exec= outliner_toggle_selectability_exec;
- ot->poll= ED_operator_outliner_active_no_editobject;
+ ot->exec = outliner_toggle_selectability_exec;
+ ot->poll = ED_operator_outliner_active_no_editobject;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* Toggle Renderability ---------------------------------------- */
@@ -480,8 +480,8 @@ void object_toggle_renderability_cb(bContext *UNUSED(C), Scene *scene, TreeEleme
{
Base *base= (Base *)te->directdata;
- if(base==NULL) base= object_in_scene((Object *)tselem->id, scene);
- if(base) {
+ if (base==NULL) base= object_in_scene((Object *)tselem->id, scene);
+ if (base) {
base->object->restrictflag^=OB_RESTRICT_RENDER;
}
}
@@ -507,15 +507,15 @@ static int outliner_toggle_renderability_exec(bContext *C, wmOperator *UNUSED(op
void OUTLINER_OT_renderability_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Renderability";
- ot->idname= "OUTLINER_OT_renderability_toggle";
- ot->description= "Toggle the renderability of selected items";
+ ot->name = "Toggle Renderability";
+ ot->idname = "OUTLINER_OT_renderability_toggle";
+ ot->description = "Toggle the renderability of selected items";
/* callbacks */
- ot->exec= outliner_toggle_renderability_exec;
- ot->poll= ED_operator_outliner_active;
+ ot->exec = outliner_toggle_renderability_exec;
+ ot->poll = ED_operator_outliner_active;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* =============================================== */
@@ -541,13 +541,13 @@ static int outliner_toggle_expanded_exec(bContext *C, wmOperator *UNUSED(op))
void OUTLINER_OT_expanded_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Expand/Collapse All";
- ot->idname= "OUTLINER_OT_expanded_toggle";
- ot->description= "Expand/Collapse all items";
+ ot->name = "Expand/Collapse All";
+ ot->idname = "OUTLINER_OT_expanded_toggle";
+ ot->description = "Expand/Collapse all items";
/* callbacks */
- ot->exec= outliner_toggle_expanded_exec;
- ot->poll= ED_operator_outliner_active;
+ ot->exec = outliner_toggle_expanded_exec;
+ ot->poll = ED_operator_outliner_active;
/* no undo or registry, UI option */
}
@@ -576,13 +576,13 @@ static int outliner_toggle_selected_exec(bContext *C, wmOperator *UNUSED(op))
void OUTLINER_OT_selected_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Selected";
- ot->idname= "OUTLINER_OT_selected_toggle";
- ot->description= "Toggle the Outliner selection of items";
+ ot->name = "Toggle Selected";
+ ot->idname = "OUTLINER_OT_selected_toggle";
+ ot->description = "Toggle the Outliner selection of items";
/* callbacks */
- ot->exec= outliner_toggle_selected_exec;
- ot->poll= ED_operator_outliner_active;
+ ot->exec = outliner_toggle_selected_exec;
+ ot->poll = ED_operator_outliner_active;
/* no undo or registry, UI option */
}
@@ -612,8 +612,8 @@ static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op))
ytop= (int)(te->ys + (v2d->mask.ymax - v2d->mask.ymin)/2);
if (ytop>0) ytop= 0;
- v2d->cur.ymax= (float)ytop;
- v2d->cur.ymin= (float)(ytop-(v2d->mask.ymax - v2d->mask.ymin));
+ v2d->cur.ymax = (float)ytop;
+ v2d->cur.ymin = (float)(ytop-(v2d->mask.ymax - v2d->mask.ymin));
/* make te->xs ==> te->xend center of view */
xdelta = (int)(te->xs - v2d->cur.xmin);
@@ -631,13 +631,13 @@ static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op))
void OUTLINER_OT_show_active(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Show Active";
- ot->idname= "OUTLINER_OT_show_active";
- ot->description= "Adjust the view so that the active Object is shown centered";
+ ot->name = "Show Active";
+ ot->idname = "OUTLINER_OT_show_active";
+ ot->description = "Adjust the view so that the active Object is shown centered";
/* callbacks */
- ot->exec= outliner_show_active_exec;
- ot->poll= ED_operator_outliner_active;
+ ot->exec = outliner_show_active_exec;
+ ot->poll = ED_operator_outliner_active;
}
/* View Panning --------------------------------------------------- */
@@ -648,10 +648,10 @@ static int outliner_scroll_page_exec(bContext *C, wmOperator *op)
int dy= ar->v2d.mask.ymax - ar->v2d.mask.ymin;
int up= 0;
- if(RNA_boolean_get(op->ptr, "up"))
+ if (RNA_boolean_get(op->ptr, "up"))
up= 1;
- if(up == 0) dy= -dy;
+ if (up == 0) dy= -dy;
ar->v2d.cur.ymin+= dy;
ar->v2d.cur.ymax+= dy;
@@ -664,13 +664,13 @@ static int outliner_scroll_page_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_scroll_page(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Scroll Page";
- ot->idname= "OUTLINER_OT_scroll_page";
- ot->description= "Scroll page up or down";
+ ot->name = "Scroll Page";
+ ot->idname = "OUTLINER_OT_scroll_page";
+ ot->description = "Scroll page up or down";
/* callbacks */
- ot->exec= outliner_scroll_page_exec;
- ot->poll= ED_operator_outliner_active;
+ ot->exec = outliner_scroll_page_exec;
+ ot->poll = ED_operator_outliner_active;
/* properties */
RNA_def_boolean(ot->srna, "up", 0, "Up", "Scroll up one page");
@@ -691,9 +691,9 @@ static void outliner_set_coordinates_element(SpaceOops *soops, TreeElement *te,
te->ys= (float)(*starty);
*starty-= UI_UNIT_Y;
- if(TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem,soops)) {
TreeElement *ten;
- for(ten= te->subtree.first; ten; ten= ten->next) {
+ for (ten= te->subtree.first; ten; ten= ten->next) {
outliner_set_coordinates_element(soops, ten, startx+UI_UNIT_X, starty);
}
}
@@ -707,7 +707,7 @@ static void outliner_set_coordinates(ARegion *ar, SpaceOops *soops)
int starty= (int)(ar->v2d.tot.ymax)-UI_UNIT_Y;
int startx= 0;
- for(te= soops->tree.first; te; te= te->next) {
+ for (te= soops->tree.first; te; te= te->next) {
outliner_set_coordinates_element(soops, te, startx, &starty);
}
}
@@ -720,7 +720,7 @@ static TreeElement *outliner_find_named(SpaceOops *soops, ListBase *lb, char *na
for (te= lb->first; te; te= te->next) {
int found = outliner_filter_has_name(te, name, flags);
- if(found) {
+ if (found) {
/* name is right, but is element the previous one? */
if (prev) {
if ((te != prev) && (*prevFound))
@@ -734,7 +734,7 @@ static TreeElement *outliner_find_named(SpaceOops *soops, ListBase *lb, char *na
}
tes= outliner_find_named(soops, &te->subtree, name, flags, prev, prevFound);
- if(tes) return tes;
+ if (tes) return tes;
}
/* nothing valid found */
@@ -781,7 +781,7 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOops *so
tselem= TREESTORE(te);
if (tselem) {
/* expand branches so that it will be visible, we need to get correct coordinates */
- if( outliner_open_back(soops, te))
+ if ( outliner_open_back(soops, te))
outliner_set_coordinates(ar, soops);
/* deselect all visible, and select found element */
@@ -790,9 +790,9 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOops *so
/* make te->ys center of view */
ytop= (int)(te->ys + (ar->v2d.mask.ymax-ar->v2d.mask.ymin)/2);
- if(ytop>0) ytop= 0;
- ar->v2d.cur.ymax= (float)ytop;
- ar->v2d.cur.ymin= (float)(ytop-(ar->v2d.mask.ymax-ar->v2d.mask.ymin));
+ if (ytop>0) ytop= 0;
+ ar->v2d.cur.ymax = (float)ytop;
+ ar->v2d.cur.ymin = (float)(ytop-(ar->v2d.mask.ymax-ar->v2d.mask.ymin));
/* make te->xs ==> te->xend center of view */
xdelta = (int)(te->xs - ar->v2d.cur.xmin);
@@ -824,14 +824,14 @@ static void outliner_openclose_level(SpaceOops *soops, ListBase *lb, int curleve
TreeElement *te;
TreeStoreElem *tselem;
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
- if(open) {
- if(curlevel<=level) tselem->flag &= ~TSE_CLOSED;
+ if (open) {
+ if (curlevel<=level) tselem->flag &= ~TSE_CLOSED;
}
else {
- if(curlevel>=level) tselem->flag |= TSE_CLOSED;
+ if (curlevel>=level) tselem->flag |= TSE_CLOSED;
}
outliner_openclose_level(soops, &te->subtree, curlevel+1, level, open);
@@ -846,12 +846,12 @@ static int outliner_one_level_exec(bContext *C, wmOperator *op)
int level;
level= outliner_has_one_flag(soops, &soops->tree, TSE_CLOSED, 1);
- if(add==1) {
- if(level) outliner_openclose_level(soops, &soops->tree, 1, level, 1);
+ if (add==1) {
+ if (level) outliner_openclose_level(soops, &soops->tree, 1, level, 1);
}
else {
- if(level==0) level= outliner_count_levels(soops, &soops->tree, 0);
- if(level) outliner_openclose_level(soops, &soops->tree, 1, level-1, 0);
+ if (level==0) level= outliner_count_levels(soops, &soops->tree, 0);
+ if (level) outliner_openclose_level(soops, &soops->tree, 1, level-1, 0);
}
ED_region_tag_redraw(ar);
@@ -862,13 +862,13 @@ static int outliner_one_level_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_show_one_level(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Show/Hide One Level";
- ot->idname= "OUTLINER_OT_show_one_level";
- ot->description= "Expand/collapse all entries by one level";
+ ot->name = "Show/Hide One Level";
+ ot->idname = "OUTLINER_OT_show_one_level";
+ ot->description = "Expand/collapse all entries by one level";
/* callbacks */
- ot->exec= outliner_one_level_exec;
- ot->poll= ED_operator_outliner_active;
+ ot->exec = outliner_one_level_exec;
+ ot->poll = ED_operator_outliner_active;
/* no undo or registry, UI option */
@@ -884,10 +884,10 @@ static int subtree_has_objects(SpaceOops *soops, ListBase *lb)
TreeElement *te;
TreeStoreElem *tselem;
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
- if(tselem->type==0 && te->idcode==ID_OB) return 1;
- if( subtree_has_objects(soops, &te->subtree)) return 1;
+ if (tselem->type==0 && te->idcode==ID_OB) return 1;
+ if ( subtree_has_objects(soops, &te->subtree)) return 1;
}
return 0;
}
@@ -899,22 +899,22 @@ static void tree_element_show_hierarchy(Scene *scene, SpaceOops *soops, ListBase
TreeStoreElem *tselem;
/* open all object elems, close others */
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
- if(tselem->type==0) {
- if(te->idcode==ID_SCE) {
- if(tselem->id!=(ID *)scene) tselem->flag |= TSE_CLOSED;
+ if (tselem->type==0) {
+ if (te->idcode==ID_SCE) {
+ if (tselem->id!=(ID *)scene) tselem->flag |= TSE_CLOSED;
else tselem->flag &= ~TSE_CLOSED;
}
- else if(te->idcode==ID_OB) {
- if(subtree_has_objects(soops, &te->subtree)) tselem->flag &= ~TSE_CLOSED;
+ else if (te->idcode==ID_OB) {
+ if (subtree_has_objects(soops, &te->subtree)) tselem->flag &= ~TSE_CLOSED;
else tselem->flag |= TSE_CLOSED;
}
}
else tselem->flag |= TSE_CLOSED;
- if(TSELEM_OPEN(tselem,soops)) tree_element_show_hierarchy(scene, soops, &te->subtree);
+ if (TSELEM_OPEN(tselem,soops)) tree_element_show_hierarchy(scene, soops, &te->subtree);
}
}
@@ -936,13 +936,13 @@ static int outliner_show_hierarchy_exec(bContext *C, wmOperator *UNUSED(op))
void OUTLINER_OT_show_hierarchy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Show Hierarchy";
- ot->idname= "OUTLINER_OT_show_hierarchy";
- ot->description= "Open all object entries and close all others";
+ ot->name = "Show Hierarchy";
+ ot->idname = "OUTLINER_OT_show_hierarchy";
+ ot->description = "Open all object entries and close all others";
/* callbacks */
- ot->exec= outliner_show_hierarchy_exec;
- ot->poll= ED_operator_outliner_active; // TODO: shouldn't be allowed in RNA views...
+ ot->exec = outliner_show_hierarchy_exec;
+ ot->poll = ED_operator_outliner_active; // TODO: shouldn't be allowed in RNA views...
/* no undo or registry, UI option */
}
@@ -978,7 +978,7 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle
PropertyRNA *prop;
char *newpath=NULL;
- /* optimise tricks:
+ /* optimize tricks:
* - Don't do anything if the selected item is a 'struct', but arrays are allowed
*/
if (tselem->type == TSE_RNA_STRUCT)
@@ -1013,12 +1013,12 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle
/* just 'append' property to path
* - to prevent memory leaks, we must write to newpath not path, then free old path + swap them
*/
- if(tse->type == TSE_RNA_PROPERTY) {
- if(RNA_property_type(prop) == PROP_POINTER) {
+ if (tse->type == TSE_RNA_PROPERTY) {
+ if (RNA_property_type(prop) == PROP_POINTER) {
/* for pointer we just append property name */
newpath= RNA_path_append(*path, ptr, prop, 0, NULL);
}
- else if(RNA_property_type(prop) == PROP_COLLECTION) {
+ else if (RNA_property_type(prop) == PROP_COLLECTION) {
char buf[128], *name;
temnext= (TreeElement*)(ld->next->data);
@@ -1027,19 +1027,19 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle
nextptr= &temnext->rnaptr;
name= RNA_struct_name_get_alloc(nextptr, buf, sizeof(buf), NULL);
- if(name) {
+ if (name) {
/* if possible, use name as a key in the path */
newpath= RNA_path_append(*path, NULL, prop, 0, name);
- if(name != buf)
+ if (name != buf)
MEM_freeN(name);
}
else {
/* otherwise use index */
int index= 0;
- for(temsub=tem->subtree.first; temsub; temsub=temsub->next, index++)
- if(temsub == temnext)
+ for (temsub=tem->subtree.first; temsub; temsub=temsub->next, index++)
+ if (temsub == temnext)
break;
newpath= RNA_path_append(*path, NULL, prop, index, NULL);
@@ -1049,7 +1049,7 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle
}
}
- if(newpath) {
+ if (newpath) {
if (*path) MEM_freeN(*path);
*path= newpath;
newpath= NULL;
@@ -1059,11 +1059,11 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle
/* no ID, so check if entry is RNA-struct, and if that RNA-struct is an ID datablock to extract info from */
if (tse->type == TSE_RNA_STRUCT) {
/* ptr->data not ptr->id.data seems to be the one we want, since ptr->data is sometimes the owner of this ID? */
- if(RNA_struct_is_ID(ptr->type)) {
+ if (RNA_struct_is_ID(ptr->type)) {
*id= (ID *)ptr->data;
/* clear path */
- if(*path) {
+ if (*path) {
MEM_freeN(*path);
path= NULL;
}
@@ -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,
@@ -1206,13 +1206,13 @@ static int outliner_drivers_addsel_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_drivers_add_selected(wmOperatorType *ot)
{
/* api callbacks */
- ot->idname= "OUTLINER_OT_drivers_add_selected";
- ot->name= "Add Drivers for Selected";
- ot->description= "Add drivers to selected items";
+ ot->idname = "OUTLINER_OT_drivers_add_selected";
+ ot->name = "Add Drivers for Selected";
+ ot->description = "Add drivers to selected items";
/* api callbacks */
- ot->exec= outliner_drivers_addsel_exec;
- ot->poll= ed_operator_outliner_datablocks_active;
+ ot->exec = outliner_drivers_addsel_exec;
+ ot->poll = ed_operator_outliner_datablocks_active;
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1241,13 +1241,13 @@ static int outliner_drivers_deletesel_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_drivers_delete_selected(wmOperatorType *ot)
{
/* identifiers */
- ot->idname= "OUTLINER_OT_drivers_delete_selected";
- ot->name= "Delete Drivers for Selected";
- ot->description= "Delete drivers assigned to selected items";
+ ot->idname = "OUTLINER_OT_drivers_delete_selected";
+ ot->name = "Delete Drivers for Selected";
+ ot->description = "Delete drivers assigned to selected items";
/* api callbacks */
- ot->exec= outliner_drivers_deletesel_exec;
- ot->poll= ed_operator_outliner_datablocks_active;
+ ot->exec = outliner_drivers_deletesel_exec;
+ ot->poll = ed_operator_outliner_datablocks_active;
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -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,
@@ -1380,13 +1380,13 @@ static int outliner_keyingset_additems_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_keyingset_add_selected(wmOperatorType *ot)
{
/* identifiers */
- ot->idname= "OUTLINER_OT_keyingset_add_selected";
- ot->name= "Keying Set Add Selected";
- ot->description= "Add selected items (blue-grey rows) to active Keying Set";
+ ot->idname = "OUTLINER_OT_keyingset_add_selected";
+ ot->name = "Keying Set Add Selected";
+ ot->description = "Add selected items (blue-grey rows) to active Keying Set";
/* api callbacks */
- ot->exec= outliner_keyingset_additems_exec;
- ot->poll= ed_operator_outliner_datablocks_active;
+ ot->exec = outliner_keyingset_additems_exec;
+ ot->poll = ed_operator_outliner_datablocks_active;
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1417,13 +1417,13 @@ static int outliner_keyingset_removeitems_exec(bContext *C, wmOperator *UNUSED(o
void OUTLINER_OT_keyingset_remove_selected(wmOperatorType *ot)
{
/* identifiers */
- ot->idname= "OUTLINER_OT_keyingset_remove_selected";
- ot->name= "Keying Set Remove Selected";
+ ot->idname = "OUTLINER_OT_keyingset_remove_selected";
+ ot->name = "Keying Set Remove Selected";
ot->description = "Remove selected items (blue-grey rows) from active Keying Set";
/* api callbacks */
- ot->exec= outliner_keyingset_removeitems_exec;
- ot->poll= ed_operator_outliner_datablocks_active;
+ ot->exec = outliner_keyingset_removeitems_exec;
+ ot->poll = ed_operator_outliner_datablocks_active;
/* flags */
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1508,7 +1508,7 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, wmEvent *event)
if (te_found) break;
}
- if(te_found) {
+ if (te_found) {
RNA_string_set(op->ptr, "parent", te_found->name);
/* Identify parent and child */
RNA_string_get(op->ptr, "child", childname);
@@ -1624,18 +1624,18 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, wmEvent *event)
void OUTLINER_OT_parent_drop(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Drop to Set Parent";
+ ot->name = "Drop to Set Parent";
ot->description = "Drag to parent in Outliner";
- ot->idname= "OUTLINER_OT_parent_drop";
+ ot->idname = "OUTLINER_OT_parent_drop";
/* api callbacks */
- ot->invoke= parent_drop_invoke;
- ot->exec= parent_drop_exec;
+ ot->invoke = parent_drop_invoke;
+ ot->exec = parent_drop_exec;
- ot->poll= ED_operator_outliner_active;
+ ot->poll = ED_operator_outliner_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_string(ot->srna, "child", "Object", MAX_ID_NAME, "Child", "Child Object");
@@ -1702,17 +1702,17 @@ static int parent_clear_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
void OUTLINER_OT_parent_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Drop to Clear Parent";
+ ot->name = "Drop to Clear Parent";
ot->description = "Drag to clear parent in Outliner";
- ot->idname= "OUTLINER_OT_parent_clear";
+ ot->idname = "OUTLINER_OT_parent_clear";
/* api callbacks */
- ot->invoke= parent_clear_invoke;
+ ot->invoke = parent_clear_invoke;
- ot->poll= ED_operator_outliner_active;
+ ot->poll = ED_operator_outliner_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_string(ot->srna, "dragged_obj", "Object", MAX_ID_NAME, "Child", "Child Object");
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_ops.c b/source/blender/editors/space_outliner/outliner_ops.c
index 17434d0f6c9..d2ef4573ccf 100644
--- a/source/blender/editors/space_outliner/outliner_ops.c
+++ b/source/blender/editors/space_outliner/outliner_ops.c
@@ -84,7 +84,7 @@ void outliner_operatortypes(void)
void outliner_keymap(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "Outliner", SPACE_OUTLINER, 0);
+ wmKeyMap *keymap = WM_keymap_find(keyconf, "Outliner", SPACE_OUTLINER, 0);
wmKeyMapItem *kmi;
WM_keymap_add_item(keymap, "OUTLINER_OT_item_rename", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 345e7a835f4..c7aa4dc4e92 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -159,11 +159,11 @@ static int tree_element_active_renderlayer(bContext *C, TreeElement *te, TreeSto
Scene *sce;
/* paranoia check */
- if(te->idcode!=ID_SCE)
+ if (te->idcode!=ID_SCE)
return 0;
sce= (Scene *)tselem->id;
- if(set) {
+ if (set) {
sce->r.actlay= tselem->nr;
WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, sce);
}
@@ -181,25 +181,25 @@ static int tree_element_set_active_object(bContext *C, Scene *scene, SpaceOops
Object *ob= NULL;
/* if id is not object, we search back */
- if(te->idcode==ID_OB) ob= (Object *)tselem->id;
+ if (te->idcode==ID_OB) ob= (Object *)tselem->id;
else {
ob= (Object *)outliner_search_back(soops, te, ID_OB);
- if(ob==OBACT) return 0;
+ if (ob==OBACT) return 0;
}
- if(ob==NULL) return 0;
+ if (ob==NULL) return 0;
sce= (Scene *)outliner_search_back(soops, te, ID_SCE);
- if(sce && scene != sce) {
- ED_screen_set_scene(C, sce);
+ if (sce && scene != sce) {
+ ED_screen_set_scene(C, CTX_wm_screen(C), sce);
}
/* find associated base in current scene */
base= object_in_scene(ob, scene);
- if(base) {
- if(set==2) {
+ if (base) {
+ if (set==2) {
/* swap select */
- if(base->flag & SELECT)
+ if (base->flag & SELECT)
ED_base_object_select(base, BA_DESELECT);
else
ED_base_object_select(base, BA_SELECT);
@@ -209,13 +209,13 @@ static int tree_element_set_active_object(bContext *C, Scene *scene, SpaceOops
scene_deselect_all(scene);
ED_base_object_select(base, BA_SELECT);
}
- if(C) {
+ if (C) {
ED_base_object_activate(C, base); /* adds notifier */
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
}
}
- if(ob!=scene->obedit)
+ if (ob!=scene->obedit)
ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR|EM_DO_UNDO);
return 1;
@@ -229,32 +229,32 @@ static int tree_element_active_material(bContext *C, Scene *scene, SpaceOops *so
/* we search for the object parent */
ob= (Object *)outliner_search_back(soops, te, ID_OB);
// note: ob->matbits can be NULL when a local object points to a library mesh.
- if(ob==NULL || ob!=OBACT || ob->matbits==NULL) return 0; // just paranoia
+ if (ob==NULL || ob!=OBACT || ob->matbits==NULL) return 0; // just paranoia
/* searching in ob mat array? */
tes= te->parent;
- if(tes->idcode==ID_OB) {
- if(set) {
+ if (tes->idcode==ID_OB) {
+ if (set) {
ob->actcol= te->index+1;
ob->matbits[te->index]= 1; // make ob material active too
}
else {
- if(ob->actcol == te->index+1)
- if(ob->matbits[te->index]) return 1;
+ if (ob->actcol == te->index+1)
+ if (ob->matbits[te->index]) return 1;
}
}
/* or we search for obdata material */
else {
- if(set) {
+ if (set) {
ob->actcol= te->index+1;
ob->matbits[te->index]= 0; // make obdata material active too
}
else {
- if(ob->actcol == te->index+1)
- if(ob->matbits[te->index]==0) return 1;
+ if (ob->actcol == te->index+1)
+ if (ob->matbits[te->index]==0) return 1;
}
}
- if(set) {
+ if (set) {
WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING, NULL);
}
return 0;
@@ -267,7 +267,7 @@ static int tree_element_active_texture(bContext *C, Scene *scene, SpaceOops *soo
Object *ob=OBACT;
SpaceButs *sbuts=NULL;
- if(ob==NULL) return 0; // no active object
+ if (ob==NULL) return 0; // no active object
/*tselem= TREESTORE(te);*/ /*UNUSED*/
@@ -278,25 +278,25 @@ static int tree_element_active_texture(bContext *C, Scene *scene, SpaceOops *soo
tep= te->parent;
tselemp= TREESTORE(tep);
- if(tep->idcode==ID_WO) {
+ if (tep->idcode==ID_WO) {
World *wrld= (World *)tselemp->id;
- if(set) {
- if(sbuts) {
+ if (set) {
+ if (sbuts) {
// XXX sbuts->tabo= TAB_SHADING_TEX; // hack from header_buttonswin.c
// XXX sbuts->texfrom= 1;
}
// XXX extern_set_butspace(F6KEY, 0); // force shading buttons texture
wrld->texact= te->index;
}
- else if(tselemp->id == (ID *)(scene->world)) {
- if(wrld->texact==te->index) return 1;
+ else if (tselemp->id == (ID *)(scene->world)) {
+ if (wrld->texact==te->index) return 1;
}
}
- else if(tep->idcode==ID_LA) {
+ else if (tep->idcode==ID_LA) {
Lamp *la= (Lamp *)tselemp->id;
- if(set) {
- if(sbuts) {
+ if (set) {
+ if (sbuts) {
// XXX sbuts->tabo= TAB_SHADING_TEX; // hack from header_buttonswin.c
// XXX sbuts->texfrom= 2;
}
@@ -304,15 +304,15 @@ static int tree_element_active_texture(bContext *C, Scene *scene, SpaceOops *soo
la->texact= te->index;
}
else {
- if(tselemp->id == ob->data) {
- if(la->texact==te->index) return 1;
+ if (tselemp->id == ob->data) {
+ if (la->texact==te->index) return 1;
}
}
}
- else if(tep->idcode==ID_MA) {
+ else if (tep->idcode==ID_MA) {
Material *ma= (Material *)tselemp->id;
- if(set) {
- if(sbuts) {
+ if (set) {
+ if (sbuts) {
//sbuts->tabo= TAB_SHADING_TEX; // hack from header_buttonswin.c
// XXX sbuts->texfrom= 0;
}
@@ -322,12 +322,12 @@ static int tree_element_active_texture(bContext *C, Scene *scene, SpaceOops *soo
/* also set active material */
ob->actcol= tep->index+1;
}
- else if(tep->flag & TE_ACTIVE) { // this is active material
- if(ma->texact==te->index) return 1;
+ else if (tep->flag & TE_ACTIVE) { // this is active material
+ if (ma->texact==te->index) return 1;
}
}
- if(set)
+ if (set)
WM_event_add_notifier(C, NC_TEXTURE, NULL);
return 0;
@@ -340,9 +340,9 @@ static int tree_element_active_lamp(bContext *UNUSED(C), Scene *scene, SpaceOops
/* we search for the object parent */
ob= (Object *)outliner_search_back(soops, te, ID_OB);
- if(ob==NULL || ob!=OBACT) return 0; // just paranoia
+ if (ob==NULL || ob!=OBACT) return 0; // just paranoia
- if(set) {
+ if (set) {
// XXX extern_set_butspace(F5KEY, 0);
}
else return 1;
@@ -354,7 +354,7 @@ static int tree_element_active_camera(bContext *UNUSED(C), Scene *scene, SpaceOo
{
Object *ob= (Object *)outliner_search_back(soops, te, ID_OB);
- if(set)
+ if (set)
return 0;
return scene->camera == ob;
@@ -367,19 +367,19 @@ static int tree_element_active_world(bContext *C, Scene *scene, SpaceOops *soops
Scene *sce=NULL;
tep= te->parent;
- if(tep) {
+ if (tep) {
tselem= TREESTORE(tep);
sce= (Scene *)tselem->id;
}
- if(set) { // make new scene active
- if(sce && scene != sce) {
- ED_screen_set_scene(C, sce);
+ if (set) { // make new scene active
+ if (sce && scene != sce) {
+ ED_screen_set_scene(C, CTX_wm_screen(C), sce);
}
}
- if(tep==NULL || tselem->id == (ID *)scene) {
- if(set) {
+ if (tep==NULL || tselem->id == (ID *)scene) {
+ if (set) {
// XXX extern_set_butspace(F8KEY, 0);
}
else {
@@ -395,7 +395,7 @@ static int tree_element_active_defgroup(bContext *C, Scene *scene, TreeElement *
/* id in tselem is object */
ob= (Object *)tselem->id;
- if(set) {
+ if (set) {
BLI_assert(te->index+1 >= 0);
ob->actdef= te->index+1;
@@ -403,8 +403,8 @@ static int tree_element_active_defgroup(bContext *C, Scene *scene, TreeElement *
WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob);
}
else {
- if(ob==OBACT)
- if(ob->actdef== te->index+1) return 1;
+ if (ob==OBACT)
+ if (ob->actdef== te->index+1) return 1;
}
return 0;
}
@@ -413,14 +413,14 @@ static int tree_element_active_posegroup(bContext *C, Scene *scene, TreeElement
{
Object *ob= (Object *)tselem->id;
- if(set) {
+ if (set) {
if (ob->pose) {
ob->pose->active_group= te->index+1;
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
}
}
else {
- if(ob==OBACT && ob->pose) {
+ if (ob==OBACT && ob->pose) {
if (ob->pose->active_group== te->index+1) return 1;
}
}
@@ -433,15 +433,16 @@ static int tree_element_active_posechannel(bContext *C, Scene *scene, TreeElemen
bArmature *arm= ob->data;
bPoseChannel *pchan= te->directdata;
- if(set) {
- if(!(pchan->bone->flag & BONE_HIDDEN_P)) {
+ if (set) {
+ if (!(pchan->bone->flag & BONE_HIDDEN_P)) {
- if(set==2) ED_pose_deselectall(ob, 2); // 2 = clear active tag
+ if (set==2) ED_pose_deselectall(ob, 2); // 2 = clear active tag
else ED_pose_deselectall(ob, 0); // 0 = deselect
- if(set==2 && (pchan->bone->flag & BONE_SELECTED)) {
+ if (set==2 && (pchan->bone->flag & BONE_SELECTED)) {
pchan->bone->flag &= ~BONE_SELECTED;
- } else {
+ }
+ else {
pchan->bone->flag |= BONE_SELECTED;
arm->act_bone= pchan->bone;
}
@@ -451,7 +452,7 @@ static int tree_element_active_posechannel(bContext *C, Scene *scene, TreeElemen
}
}
else {
- if(ob==OBACT && ob->pose) {
+ if (ob==OBACT && ob->pose) {
if (pchan->bone->flag & BONE_SELECTED) return 1;
}
}
@@ -463,14 +464,15 @@ static int tree_element_active_bone(bContext *C, Scene *scene, TreeElement *te,
bArmature *arm= (bArmature *)tselem->id;
Bone *bone= te->directdata;
- if(set) {
- if(!(bone->flag & BONE_HIDDEN_P)) {
- if(set==2) ED_pose_deselectall(OBACT, 2); // 2 is clear active tag
+ if (set) {
+ if (!(bone->flag & BONE_HIDDEN_P)) {
+ if (set==2) ED_pose_deselectall(OBACT, 2); // 2 is clear active tag
else ED_pose_deselectall(OBACT, 0);
- if(set==2 && (bone->flag & BONE_SELECTED)) {
+ if (set==2 && (bone->flag & BONE_SELECTED)) {
bone->flag &= ~BONE_SELECTED;
- } else {
+ }
+ else {
bone->flag |= BONE_SELECTED;
arm->act_bone= bone;
}
@@ -481,7 +483,7 @@ static int tree_element_active_bone(bContext *C, Scene *scene, TreeElement *te,
else {
Object *ob= OBACT;
- if(ob && ob->data==arm) {
+ if (ob && ob->data==arm) {
if (bone->flag & BONE_SELECTED) return 1;
}
}
@@ -492,16 +494,16 @@ static int tree_element_active_bone(bContext *C, Scene *scene, TreeElement *te,
/* ebones only draw in editmode armature */
static void tree_element_active_ebone__sel(bContext *C, Scene *scene, bArmature *arm, EditBone *ebone, short sel)
{
- if(sel) {
+ if (sel) {
ebone->flag |= BONE_SELECTED|BONE_ROOTSEL|BONE_TIPSEL;
arm->act_edbone= ebone;
// flush to parent?
- if(ebone->parent && (ebone->flag & BONE_CONNECTED)) ebone->parent->flag |= BONE_TIPSEL;
+ if (ebone->parent && (ebone->flag & BONE_CONNECTED)) ebone->parent->flag |= BONE_TIPSEL;
}
else {
ebone->flag &= ~(BONE_SELECTED|BONE_ROOTSEL|BONE_TIPSEL);
// flush to parent?
- if(ebone->parent && (ebone->flag & BONE_CONNECTED)) ebone->parent->flag &= ~BONE_TIPSEL;
+ if (ebone->parent && (ebone->flag & BONE_CONNECTED)) ebone->parent->flag &= ~BONE_TIPSEL;
}
WM_event_add_notifier(C, NC_OBJECT|ND_BONE_ACTIVE, scene->obedit);
@@ -511,16 +513,16 @@ static int tree_element_active_ebone(bContext *C, Scene *scene, TreeElement *te,
bArmature *arm= scene->obedit->data;
EditBone *ebone= te->directdata;
- if(set==1) {
- if(!(ebone->flag & BONE_HIDDEN_A)) {
+ if (set==1) {
+ if (!(ebone->flag & BONE_HIDDEN_A)) {
ED_armature_deselect_all(scene->obedit, 0); // deselect
tree_element_active_ebone__sel(C, scene, arm, ebone, TRUE);
return 1;
}
}
else if (set==2) {
- if(!(ebone->flag & BONE_HIDDEN_A)) {
- if(!(ebone->flag & BONE_SELECTED)) {
+ if (!(ebone->flag & BONE_HIDDEN_A)) {
+ if (!(ebone->flag & BONE_SELECTED)) {
tree_element_active_ebone__sel(C, scene, arm, ebone, TRUE);
return 1;
}
@@ -539,7 +541,7 @@ static int tree_element_active_ebone(bContext *C, Scene *scene, TreeElement *te,
static int tree_element_active_modifier(bContext *C, TreeElement *UNUSED(te), TreeStoreElem *tselem, int set)
{
- if(set) {
+ if (set) {
Object *ob= (Object *)tselem->id;
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
@@ -552,7 +554,7 @@ static int tree_element_active_modifier(bContext *C, TreeElement *UNUSED(te), Tr
static int tree_element_active_psys(bContext *C, Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *tselem, int set)
{
- if(set) {
+ if (set) {
Object *ob= (Object *)tselem->id;
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
@@ -565,7 +567,7 @@ static int tree_element_active_psys(bContext *C, Scene *UNUSED(scene), TreeEleme
static int tree_element_active_constraint(bContext *C, TreeElement *UNUSED(te), TreeStoreElem *tselem, int set)
{
- if(set) {
+ if (set) {
Object *ob= (Object *)tselem->id;
WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, ob);
@@ -586,17 +588,17 @@ static int tree_element_active_pose(bContext *C, Scene *scene, TreeElement *UNUS
Object *ob= (Object *)tselem->id;
Base *base= object_in_scene(ob, scene);
- if(set) {
- if(scene->obedit)
+ if (set) {
+ if (scene->obedit)
ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR|EM_DO_UNDO);
- if(ob->mode & OB_MODE_POSE)
+ if (ob->mode & OB_MODE_POSE)
ED_armature_exit_posemode(C, base);
else
ED_armature_enter_posemode(C, base);
}
else {
- if(ob->mode & OB_MODE_POSE) return 1;
+ if (ob->mode & OB_MODE_POSE) return 1;
}
return 0;
}
@@ -605,11 +607,11 @@ static int tree_element_active_sequence(TreeElement *te, TreeStoreElem *UNUSED(t
{
Sequence *seq= (Sequence*) te->directdata;
- if(set) {
+ if (set) {
// XXX select_single_seq(seq, 1);
}
else {
- if(seq->flag & SELECT)
+ if (seq->flag & SELECT)
return(1);
}
return(0);
@@ -621,21 +623,21 @@ static int tree_element_active_sequence_dup(Scene *scene, TreeElement *te, TreeS
Editing *ed= seq_give_editing(scene, FALSE);
seq= (Sequence*)te->directdata;
- if(set==0) {
- if(seq->flag & SELECT)
+ if (set==0) {
+ if (seq->flag & SELECT)
return(1);
return(0);
}
// XXX select_single_seq(seq, 1);
p= ed->seqbasep->first;
- while(p) {
- if((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
+ while (p) {
+ if ((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
p= p->next;
continue;
}
-// if(!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
+// if (!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
// XXX select_single_seq(p, 0);
p= p->next;
}
@@ -644,10 +646,10 @@ static int tree_element_active_sequence_dup(Scene *scene, TreeElement *te, TreeS
static int tree_element_active_keymap_item(bContext *UNUSED(C), TreeElement *te, TreeStoreElem *UNUSED(tselem), int set)
{
- wmKeyMapItem *kmi= te->directdata;
+ wmKeyMapItem *kmi = te->directdata;
- if(set==0) {
- if(kmi->flag & KMI_INACTIVE) return 0;
+ if (set==0) {
+ if (kmi->flag & KMI_INACTIVE) return 0;
return 1;
}
else {
@@ -664,7 +666,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:
@@ -695,8 +697,8 @@ int tree_element_type_active(bContext *C, Scene *scene, SpaceOops *soops, TreeEl
case TSE_MODIFIER:
return tree_element_active_modifier(C, te, tselem, set);
case TSE_LINKED_OB:
- if(set) tree_element_set_active_object(C, scene, soops, te, set);
- else if(tselem->id==(ID *)OBACT) return 1;
+ if (set) tree_element_set_active_object(C, scene, soops, te, set);
+ else if (tselem->id==(ID *)OBACT) return 1;
break;
case TSE_LINKED_PSYS:
return tree_element_active_psys(C, scene, te, tselem, set);
@@ -726,24 +728,24 @@ int tree_element_type_active(bContext *C, Scene *scene, SpaceOops *soops, TreeEl
static int do_outliner_item_activate(bContext *C, Scene *scene, ARegion *ar, SpaceOops *soops, TreeElement *te, int extend, const float mval[2])
{
- if(mval[1]>te->ys && mval[1]<te->ys+UI_UNIT_Y) {
+ if (mval[1]>te->ys && mval[1]<te->ys+UI_UNIT_Y) {
TreeStoreElem *tselem= TREESTORE(te);
int openclose= 0;
/* open close icon */
- if((te->flag & TE_ICONROW)==0) { // hidden icon, no open/close
- if( mval[0]>te->xs && mval[0]<te->xs+UI_UNIT_X)
+ if ((te->flag & TE_ICONROW)==0) { // hidden icon, no open/close
+ if ( mval[0]>te->xs && mval[0]<te->xs+UI_UNIT_X)
openclose= 1;
}
- if(openclose) {
+ if (openclose) {
/* all below close/open? */
- if(extend) {
+ if (extend) {
tselem->flag &= ~TSE_CLOSED;
outliner_set_flag(soops, &te->subtree, TSE_CLOSED, !outliner_has_one_flag(soops, &te->subtree, TSE_CLOSED, 1));
}
else {
- if(tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED;
+ if (tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED;
else tselem->flag |= TSE_CLOSED;
}
@@ -751,50 +753,51 @@ static int do_outliner_item_activate(bContext *C, Scene *scene, ARegion *ar, Spa
return 1;
}
/* name and first icon */
- else if(mval[0]>te->xs+UI_UNIT_X && mval[0]<te->xend) {
+ else if (mval[0]>te->xs+UI_UNIT_X && mval[0]<te->xend) {
/* always makes active object */
- if(tselem->type!=TSE_SEQUENCE && tselem->type!=TSE_SEQ_STRIP && tselem->type!=TSE_SEQUENCE_DUP)
+ if (tselem->type!=TSE_SEQUENCE && tselem->type!=TSE_SEQ_STRIP && tselem->type!=TSE_SEQUENCE_DUP)
tree_element_set_active_object(C, scene, soops, te, 1 + (extend!=0 && tselem->type==0));
- if(tselem->type==0) { // the lib blocks
+ if (tselem->type==0) { // the lib blocks
/* editmode? */
- if(te->idcode==ID_SCE) {
- if(scene!=(Scene *)tselem->id) {
- ED_screen_set_scene(C, (Scene *)tselem->id);
+ if (te->idcode==ID_SCE) {
+ if (scene!=(Scene *)tselem->id) {
+ ED_screen_set_scene(C, CTX_wm_screen(C), (Scene *)tselem->id);
}
}
- else if(te->idcode==ID_GR) {
+ else if (te->idcode==ID_GR) {
Group *gr= (Group *)tselem->id;
GroupObject *gob;
- if(extend) {
+ if (extend) {
int sel= BA_SELECT;
- for(gob= gr->gobject.first; gob; gob= gob->next) {
- if(gob->ob->flag & SELECT) {
+ for (gob= gr->gobject.first; gob; gob= gob->next) {
+ if (gob->ob->flag & SELECT) {
sel= BA_DESELECT;
break;
}
}
- for(gob= gr->gobject.first; gob; gob= gob->next) {
+ for (gob= gr->gobject.first; gob; gob= gob->next) {
ED_base_object_select(object_in_scene(gob->ob, scene), sel);
}
}
else {
scene_deselect_all(scene);
- for(gob= gr->gobject.first; gob; gob= gob->next) {
- if((gob->ob->flag & SELECT) == 0)
+ for (gob= gr->gobject.first; gob; gob= gob->next) {
+ if ((gob->ob->flag & SELECT) == 0)
ED_base_object_select(object_in_scene(gob->ob, scene), BA_SELECT);
}
}
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
}
- else if(ELEM5(te->idcode, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR)) {
+ else if (ELEM5(te->idcode, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR)) {
WM_operator_name_call(C, "OBJECT_OT_editmode_toggle", WM_OP_INVOKE_REGION_WIN, NULL);
- } else { // rest of types
+ }
+ else { // rest of types
tree_element_active(C, scene, soops, te, 1);
}
@@ -805,8 +808,8 @@ static int do_outliner_item_activate(bContext *C, Scene *scene, ARegion *ar, Spa
}
}
- for(te= te->subtree.first; te; te= te->next) {
- if(do_outliner_item_activate(C, scene, ar, soops, te, extend, mval)) return 1;
+ for (te= te->subtree.first; te; te= te->next) {
+ if (do_outliner_item_activate(C, scene, ar, soops, te, extend, mval)) return 1;
}
return 0;
}
@@ -830,11 +833,11 @@ static int outliner_item_activate(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_CANCELLED;
}
- for(te= soops->tree.first; te; te= te->next) {
- if(do_outliner_item_activate(C, scene, ar, soops, te, extend, fmval)) break;
+ for (te= soops->tree.first; te; te= te->next) {
+ if (do_outliner_item_activate(C, scene, ar, soops, te, extend, fmval)) break;
}
- if(te) {
+ if (te) {
ED_undo_push(C, "Outliner click event");
}
else {
@@ -846,7 +849,7 @@ static int outliner_item_activate(bContext *C, wmOperator *op, wmEvent *event)
fmval[0], fmval[1], NULL, &row);
/* select relevant row */
- if(outliner_select(soops, &soops->tree, &row, &selecting)) {
+ if (outliner_select(soops, &soops->tree, &row, &selecting)) {
soops->storeflag |= SO_TREESTORE_REDRAW;
@@ -863,13 +866,13 @@ static int outliner_item_activate(bContext *C, wmOperator *op, wmEvent *event)
void OUTLINER_OT_item_activate(wmOperatorType *ot)
{
- ot->name= "Activate Item";
- ot->idname= "OUTLINER_OT_item_activate";
- ot->description= "Handle mouse clicks to activate/select items";
+ ot->name = "Activate Item";
+ ot->idname = "OUTLINER_OT_item_activate";
+ ot->description = "Handle mouse clicks to activate/select items";
- ot->invoke= outliner_item_activate;
+ ot->invoke = outliner_item_activate;
- ot->poll= ED_operator_outliner_active;
+ ot->poll = ED_operator_outliner_active;
RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection for activation");
}
@@ -909,15 +912,15 @@ static int outliner_border_select_exec(bContext *C, wmOperator *op)
rctf rectf;
int gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
- rect.xmin= RNA_int_get(op->ptr, "xmin");
- rect.ymin= RNA_int_get(op->ptr, "ymin");
+ rect.xmin = RNA_int_get(op->ptr, "xmin");
+ rect.ymin = RNA_int_get(op->ptr, "ymin");
UI_view2d_region_to_view(&ar->v2d, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin);
- rect.xmax= RNA_int_get(op->ptr, "xmax");
- rect.ymax= RNA_int_get(op->ptr, "ymax");
+ rect.xmax = RNA_int_get(op->ptr, "xmax");
+ rect.ymax = RNA_int_get(op->ptr, "ymax");
UI_view2d_region_to_view(&ar->v2d, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
- for(te= soops->tree.first; te; te= te->next) {
+ for (te= soops->tree.first; te; te= te->next) {
outliner_item_border_select(scene, soops, &rectf, te, gesture_mode);
}
@@ -930,20 +933,20 @@ static int outliner_border_select_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Border Select";
- ot->idname= "OUTLINER_OT_select_border";
- ot->description= "Use box selection to select tree elements";
+ ot->name = "Border Select";
+ ot->idname = "OUTLINER_OT_select_border";
+ ot->description = "Use box selection to select tree elements";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= outliner_border_select_exec;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = outliner_border_select_exec;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= ED_operator_outliner_active;
+ ot->poll = ED_operator_outliner_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna */
WM_operator_properties_gesture_border(ot, FALSE);
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 09a125692d2..c4fe337ba58 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -115,13 +115,13 @@ static void set_operation_types(SpaceOops *soops, ListBase *lb,
TreeElement *te;
TreeStoreElem *tselem;
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
- if(tselem->flag & TSE_SELECTED) {
- if(tselem->type) {
- if(*datalevel==0)
+ if (tselem->flag & TSE_SELECTED) {
+ if (tselem->type) {
+ if (*datalevel==0)
*datalevel= tselem->type;
- else if(*datalevel!=tselem->type)
+ else if (*datalevel!=tselem->type)
*datalevel= -1;
}
else {
@@ -139,13 +139,13 @@ static void set_operation_types(SpaceOops *soops, ListBase *lb,
case ID_MA: case ID_TE: case ID_IP: case ID_IM:
case ID_SO: case ID_KE: case ID_WO: case ID_AC:
case ID_NLA: case ID_TXT: case ID_GR:
- if(*idlevel==0) *idlevel= idcode;
- else if(*idlevel!=idcode) *idlevel= -1;
+ if (*idlevel==0) *idlevel= idcode;
+ else if (*idlevel!=idcode) *idlevel= -1;
break;
}
}
}
- if(TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem,soops)) {
set_operation_types(soops, &te->subtree,
scenelevel, objectlevel, idlevel, datalevel);
}
@@ -163,29 +163,29 @@ static void unlink_material_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeEl
Material **matar=NULL;
int a, totcol=0;
- if( GS(tsep->id->name)==ID_OB) {
+ if ( GS(tsep->id->name)==ID_OB) {
Object *ob= (Object *)tsep->id;
totcol= ob->totcol;
matar= ob->mat;
}
- else if( GS(tsep->id->name)==ID_ME) {
+ else if ( GS(tsep->id->name)==ID_ME) {
Mesh *me= (Mesh *)tsep->id;
totcol= me->totcol;
matar= me->mat;
}
- else if( GS(tsep->id->name)==ID_CU) {
+ else if ( GS(tsep->id->name)==ID_CU) {
Curve *cu= (Curve *)tsep->id;
totcol= cu->totcol;
matar= cu->mat;
}
- else if( GS(tsep->id->name)==ID_MB) {
+ else if ( GS(tsep->id->name)==ID_MB) {
MetaBall *mb= (MetaBall *)tsep->id;
totcol= mb->totcol;
matar= mb->mat;
}
- for(a=0; a<totcol; a++) {
- if(a==te->index && matar[a]) {
+ for (a=0; a<totcol; a++) {
+ if (a==te->index && matar[a]) {
matar[a]->id.us--;
matar[a]= NULL;
}
@@ -197,23 +197,23 @@ static void unlink_texture_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeEle
MTex **mtex= NULL;
int a;
- if( GS(tsep->id->name)==ID_MA) {
+ if ( GS(tsep->id->name)==ID_MA) {
Material *ma= (Material *)tsep->id;
mtex= ma->mtex;
}
- else if( GS(tsep->id->name)==ID_LA) {
+ else if ( GS(tsep->id->name)==ID_LA) {
Lamp *la= (Lamp *)tsep->id;
mtex= la->mtex;
}
- else if( GS(tsep->id->name)==ID_WO) {
+ else if ( GS(tsep->id->name)==ID_WO) {
World *wrld= (World *)tsep->id;
mtex= wrld->mtex;
}
else return;
- for(a=0; a<MAX_MTEX; a++) {
- if(a==te->index && mtex[a]) {
- if(mtex[a]->tex) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (a==te->index && mtex[a]) {
+ if (mtex[a]->tex) {
mtex[a]->tex->id.us--;
mtex[a]->tex= NULL;
}
@@ -225,8 +225,8 @@ static void unlink_group_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeEleme
{
Group *group= (Group *)tselem->id;
- if(tsep) {
- if( GS(tsep->id->name)==ID_OB) {
+ if (tsep) {
+ if ( GS(tsep->id->name)==ID_OB) {
Object *ob= (Object *)tsep->id;
ob->dup_group= NULL;
}
@@ -252,15 +252,15 @@ static void outliner_do_libdata_operation(bContext *C, Scene *scene, SpaceOops *
TreeElement *te;
TreeStoreElem *tselem;
- for(te=lb->first; te; te= te->next) {
+ for (te=lb->first; te; te= te->next) {
tselem= TREESTORE(te);
- if(tselem->flag & TSE_SELECTED) {
- if(tselem->type==0) {
+ if (tselem->flag & TSE_SELECTED) {
+ if (tselem->type==0) {
TreeStoreElem *tsep= TREESTORE(te->parent);
operation_cb(C, scene, te, tsep, tselem);
}
}
- if(TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem,soops)) {
outliner_do_libdata_operation(C, scene, soops, &te->subtree, operation_cb);
}
}
@@ -272,8 +272,8 @@ static void object_select_cb(bContext *UNUSED(C), Scene *scene, TreeElement *te,
{
Base *base= (Base *)te->directdata;
- if(base==NULL) base= object_in_scene((Object *)tselem->id, scene);
- if(base && ((base->object->restrictflag & OB_RESTRICT_VIEW)==0)) {
+ if (base==NULL) base= object_in_scene((Object *)tselem->id, scene);
+ if (base && ((base->object->restrictflag & OB_RESTRICT_VIEW)==0)) {
base->flag |= SELECT;
base->object->flag |= SELECT;
}
@@ -283,8 +283,8 @@ static void object_deselect_cb(bContext *UNUSED(C), Scene *scene, TreeElement *t
{
Base *base= (Base *)te->directdata;
- if(base==NULL) base= object_in_scene((Object *)tselem->id, scene);
- if(base) {
+ if (base==NULL) base= object_in_scene((Object *)tselem->id, scene);
+ if (base) {
base->flag &= ~SELECT;
base->object->flag &= ~SELECT;
}
@@ -294,11 +294,11 @@ static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto
{
Base *base= (Base *)te->directdata;
- if(base==NULL)
+ if (base==NULL)
base= object_in_scene((Object *)tselem->id, scene);
- if(base) {
+ if (base) {
// check also library later
- if(scene->obedit==base->object)
+ if (scene->obedit==base->object)
ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR|EM_DO_UNDO);
ED_base_object_free_and_unlink(CTX_data_main(C), scene, base);
@@ -378,12 +378,13 @@ static void group_linkobs2scene_cb(bContext *UNUSED(C), Scene *scene, TreeElemen
GroupObject *gob;
Base *base;
- for(gob=group->gobject.first; gob; gob=gob->next) {
+ for (gob=group->gobject.first; gob; gob=gob->next) {
base= object_in_scene(gob->ob, scene);
if (base) {
base->object->flag |= SELECT;
base->flag |= SELECT;
- } else {
+ }
+ else {
/* link to scene */
base= MEM_callocN( sizeof(Base), "add_base");
BLI_addhead(&scene->base, base);
@@ -391,7 +392,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 */
}
}
}
@@ -402,22 +403,22 @@ void outliner_do_object_operation(bContext *C, Scene *scene_act, SpaceOops *soop
TreeElement *te;
TreeStoreElem *tselem;
- for(te=lb->first; te; te= te->next) {
+ for (te=lb->first; te; te= te->next) {
tselem= TREESTORE(te);
- if(tselem->flag & TSE_SELECTED) {
- if(tselem->type==0 && te->idcode==ID_OB) {
+ if (tselem->flag & TSE_SELECTED) {
+ if (tselem->type==0 && te->idcode==ID_OB) {
// 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);
+ if (scene_owner && scene_act != 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
- * outliner isnt showing scenes: Visible Layer draw mode for eg. */
+ * outliner isn't showing scenes: Visible Layer draw mode for eg. */
operation_cb(C, scene_owner ? scene_owner : scene_act, te, NULL, tselem);
}
}
- if(TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem,soops)) {
outliner_do_object_operation(C, scene_act, soops, &te->subtree, operation_cb);
}
}
@@ -459,15 +460,15 @@ static void pchan_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem))
{
bPoseChannel *pchan= (bPoseChannel *)te->directdata;
- if(event==1)
+ if (event==1)
pchan->bone->flag |= BONE_SELECTED;
- else if(event==2)
+ else if (event==2)
pchan->bone->flag &= ~BONE_SELECTED;
- else if(event==3) {
+ else if (event==3) {
pchan->bone->flag |= BONE_HIDDEN_P;
pchan->bone->flag &= ~BONE_SELECTED;
}
- else if(event==4)
+ else if (event==4)
pchan->bone->flag &= ~BONE_HIDDEN_P;
}
@@ -475,15 +476,15 @@ static void bone_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem))
{
Bone *bone= (Bone *)te->directdata;
- if(event==1)
+ if (event==1)
bone->flag |= BONE_SELECTED;
- else if(event==2)
+ else if (event==2)
bone->flag &= ~BONE_SELECTED;
- else if(event==3) {
+ else if (event==3) {
bone->flag |= BONE_HIDDEN_P;
bone->flag &= ~BONE_SELECTED;
}
- else if(event==4)
+ else if (event==4)
bone->flag &= ~BONE_HIDDEN_P;
}
@@ -491,22 +492,22 @@ static void ebone_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem))
{
EditBone *ebone= (EditBone *)te->directdata;
- if(event==1)
+ if (event==1)
ebone->flag |= BONE_SELECTED;
- else if(event==2)
+ else if (event==2)
ebone->flag &= ~BONE_SELECTED;
- else if(event==3) {
+ else if (event==3) {
ebone->flag |= BONE_HIDDEN_A;
ebone->flag &= ~BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
}
- else if(event==4)
+ else if (event==4)
ebone->flag &= ~BONE_HIDDEN_A;
}
static void sequence_cb(int event, TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tselem))
{
// Sequence *seq= (Sequence*) te->directdata;
- if(event==1) {
+ if (event==1) {
// XXX select_single_seq(seq, 1);
}
}
@@ -517,14 +518,14 @@ static void outliner_do_data_operation(SpaceOops *soops, int type, int event, Li
TreeElement *te;
TreeStoreElem *tselem;
- for(te=lb->first; te; te= te->next) {
+ for (te=lb->first; te; te= te->next) {
tselem= TREESTORE(te);
- if(tselem->flag & TSE_SELECTED) {
- if(tselem->type==type) {
+ if (tselem->flag & TSE_SELECTED) {
+ if (tselem->type==type) {
operation_cb(event, te, tselem);
}
}
- if(TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem,soops)) {
outliner_do_data_operation(soops, type, event, &te->subtree, operation_cb);
}
}
@@ -557,55 +558,55 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
event= RNA_enum_get(op->ptr, "type");
- if(event==1) {
+ if (event==1) {
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);
+ if (scene != sce) {
+ ED_screen_set_scene(C, CTX_wm_screen(C), sce);
}
str= "Select Objects";
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
}
- else if(event==2) {
+ else if (event==2) {
outliner_do_object_operation(C, scene, soops, &soops->tree, object_deselect_cb);
str= "Deselect Objects";
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
}
- else if(event==4) {
+ else if (event==4) {
outliner_do_object_operation(C, scene, soops, &soops->tree, object_delete_cb);
/* XXX: tree management normally happens from draw_outliner(), but when
- you're clicking to fast on Delete object from context menu in
- outliner several mouse events can be handled in one cycle without
- handling notifiers/redraw which leads to deleting the same object twice.
- cleanup tree here to prevent such cases. */
+ * you're clicking to fast on Delete object from context menu in
+ * outliner several mouse events can be handled in one cycle without
+ * handling notifiers/redraw which leads to deleting the same object twice.
+ * cleanup tree here to prevent such cases. */
outliner_cleanup_tree(soops);
DAG_scene_sort(bmain, scene);
str= "Delete Objects";
WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene);
}
- else if(event==5) { /* disabled, see above enum (ton) */
+ else if (event==5) { /* disabled, see above enum (ton) */
outliner_do_object_operation(C, scene, soops, &soops->tree, id_local_cb);
str= "Localized Objects";
}
- else if(event==6) {
+ else if (event==6) {
outliner_do_object_operation(C, scene, soops, &soops->tree, object_toggle_visibility_cb);
str= "Toggle Visibility";
WM_event_add_notifier(C, NC_SCENE|ND_OB_VISIBLE, scene);
}
- else if(event==7) {
+ else if (event==7) {
outliner_do_object_operation(C, scene, soops, &soops->tree, object_toggle_selectability_cb);
str= "Toggle Selectability";
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
}
- else if(event==8) {
+ else if (event==8) {
outliner_do_object_operation(C, scene, soops, &soops->tree, object_toggle_renderability_cb);
str= "Toggle Renderability";
WM_event_add_notifier(C, NC_SCENE|ND_OB_RENDER, scene);
}
- else if(event==9) {
+ else if (event==9) {
outliner_do_object_operation(C, scene, soops, &soops->tree, item_rename_cb);
str= "Rename Object";
}
@@ -619,18 +620,18 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_object_operation(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Outliner Object Operation";
- ot->idname= "OUTLINER_OT_object_operation";
- ot->description= "";
+ ot->name = "Outliner Object Operation";
+ ot->idname = "OUTLINER_OT_object_operation";
+ ot->description = "";
/* callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= outliner_object_operation_exec;
- ot->poll= ED_operator_outliner_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = outliner_object_operation_exec;
+ ot->poll = ED_operator_outliner_active;
- ot->flag= 0;
+ ot->flag = 0;
- ot->prop= RNA_def_enum(ot->srna, "type", prop_object_op_types, 0, "Object Operation", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_object_op_types, 0, "Object Operation", "");
}
/* **************************************** */
@@ -659,31 +660,31 @@ static int outliner_group_operation_exec(bContext *C, wmOperator *op)
event= RNA_enum_get(op->ptr, "type");
- if(event==1) {
+ if (event==1) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, unlink_group_cb);
str= "Unlink group";
}
- else if(event==2) {
+ else if (event==2) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, id_local_cb);
str= "Localized Data";
}
- else if(event==3) {
+ else if (event==3) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, group_linkobs2scene_cb);
str= "Link Group Objects to Scene";
}
- else if(event==4) {
+ else if (event==4) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, group_toggle_visibility_cb);
str= "Toggle Visibility";
}
- else if(event==5) {
+ else if (event==5) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, group_toggle_selectability_cb);
str= "Toggle Selectability";
}
- else if(event==6) {
+ else if (event==6) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, group_toggle_renderability_cb);
str= "Toggle Renderability";
}
- else if(event==7) {
+ else if (event==7) {
outliner_do_libdata_operation(C, scene, soops, &soops->tree, item_rename_cb);
str= "Rename";
}
@@ -699,18 +700,18 @@ static int outliner_group_operation_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_group_operation(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Outliner Group Operation";
- ot->idname= "OUTLINER_OT_group_operation";
- ot->description= "";
+ ot->name = "Outliner Group Operation";
+ ot->idname = "OUTLINER_OT_group_operation";
+ ot->description = "";
/* callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= outliner_group_operation_exec;
- ot->poll= ED_operator_outliner_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = outliner_group_operation_exec;
+ ot->poll = ED_operator_outliner_active;
- ot->flag= 0;
+ ot->flag = 0;
- ot->prop= RNA_def_enum(ot->srna, "type", prop_group_op_types, 0, "Group Operation", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_group_op_types, 0, "Group Operation", "");
}
/* **************************************** */
@@ -869,18 +870,18 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_id_operation(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Outliner ID data Operation";
- ot->idname= "OUTLINER_OT_id_operation";
- ot->description= "";
+ ot->name = "Outliner ID data Operation";
+ ot->idname = "OUTLINER_OT_id_operation";
+ ot->description = "";
/* callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= outliner_id_operation_exec;
- ot->poll= ED_operator_outliner_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = outliner_id_operation_exec;
+ ot->poll = ED_operator_outliner_active;
- ot->flag= 0;
+ ot->flag = 0;
- ot->prop= RNA_def_enum(ot->srna, "type", prop_id_op_types, 0, "ID data Operation", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_id_op_types, 0, "ID data Operation", "");
}
/* **************************************** */
@@ -894,7 +895,7 @@ static void outliner_do_id_set_operation(SpaceOops *soops, int type, ListBase *l
for (te=lb->first; te; te= te->next) {
tselem= TREESTORE(te);
if (tselem->flag & TSE_SELECTED) {
- if(tselem->type==type) {
+ if (tselem->type==type) {
TreeStoreElem *tsep = TREESTORE(te->parent);
operation_cb(te, tselem, tsep, newid);
}
@@ -972,23 +973,23 @@ void OUTLINER_OT_action_set(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Outliner Set Action";
- ot->idname= "OUTLINER_OT_action_set";
- ot->description= "Change the active action used";
+ ot->name = "Outliner Set Action";
+ ot->idname = "OUTLINER_OT_action_set";
+ ot->description = "Change the active action used";
/* api callbacks */
- ot->invoke= WM_enum_search_invoke;
- ot->exec= outliner_action_set_exec;
- ot->poll= ED_operator_outliner_active;
+ ot->invoke = WM_enum_search_invoke;
+ ot->exec = outliner_action_set_exec;
+ ot->poll = ED_operator_outliner_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
/* props */
// TODO: this would be nicer as an ID-pointer...
prop= RNA_def_enum(ot->srna, "action", DummyRNA_NULL_items, 0, "Action", "");
RNA_def_enum_funcs(prop, RNA_action_itemf);
- ot->prop= prop;
+ ot->prop = prop;
}
/* **************************************** */
@@ -1087,18 +1088,18 @@ static int outliner_animdata_operation_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_animdata_operation(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Outliner Animation Data Operation";
- ot->idname= "OUTLINER_OT_animdata_operation";
- ot->description= "";
+ ot->name = "Outliner Animation Data Operation";
+ ot->idname = "OUTLINER_OT_animdata_operation";
+ ot->description = "";
/* callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= outliner_animdata_operation_exec;
- ot->poll= ED_operator_outliner_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = outliner_animdata_operation_exec;
+ ot->poll = ED_operator_outliner_active;
- ot->flag= 0;
+ ot->flag = 0;
- ot->prop= RNA_def_enum(ot->srna, "type", prop_animdata_op_types, 0, "Animation Operation", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_animdata_op_types, 0, "Animation Operation", "");
}
/* **************************************** */
@@ -1124,29 +1125,29 @@ static int outliner_data_operation_exec(bContext *C, wmOperator *op)
event= RNA_enum_get(op->ptr, "type");
set_operation_types(soops, &soops->tree, &scenelevel, &objectlevel, &idlevel, &datalevel);
- if(datalevel==TSE_POSE_CHANNEL) {
- if(event>0) {
+ if (datalevel==TSE_POSE_CHANNEL) {
+ if (event>0) {
outliner_do_data_operation(soops, datalevel, event, &soops->tree, pchan_cb);
WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL);
ED_undo_push(C, "PoseChannel operation");
}
}
- else if(datalevel==TSE_BONE) {
- if(event>0) {
+ else if (datalevel==TSE_BONE) {
+ if (event>0) {
outliner_do_data_operation(soops, datalevel, event, &soops->tree, bone_cb);
WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL);
ED_undo_push(C, "Bone operation");
}
}
- else if(datalevel==TSE_EBONE) {
- if(event>0) {
+ else if (datalevel==TSE_EBONE) {
+ if (event>0) {
outliner_do_data_operation(soops, datalevel, event, &soops->tree, ebone_cb);
WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL);
ED_undo_push(C, "EditBone operation");
}
}
- else if(datalevel==TSE_SEQUENCE) {
- if(event>0) {
+ else if (datalevel==TSE_SEQUENCE) {
+ if (event>0) {
outliner_do_data_operation(soops, datalevel, event, &soops->tree, sequence_cb);
}
}
@@ -1158,18 +1159,18 @@ static int outliner_data_operation_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_data_operation(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Outliner Data Operation";
- ot->idname= "OUTLINER_OT_data_operation";
- ot->description= "";
+ ot->name = "Outliner Data Operation";
+ ot->idname = "OUTLINER_OT_data_operation";
+ ot->description = "";
/* callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= outliner_data_operation_exec;
- ot->poll= ED_operator_outliner_active;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = outliner_data_operation_exec;
+ ot->poll = ED_operator_outliner_active;
- ot->flag= 0;
+ ot->flag = 0;
- ot->prop= RNA_def_enum(ot->srna, "type", prop_data_op_types, 0, "Data Operation", "");
+ ot->prop = RNA_def_enum(ot->srna, "type", prop_data_op_types, 0, "Data Operation", "");
}
@@ -1180,7 +1181,7 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
{
ReportList *reports = CTX_wm_reports(C); // XXX...
- if(mval[1]>te->ys && mval[1]<te->ys+UI_UNIT_Y) {
+ if (mval[1]>te->ys && mval[1]<te->ys+UI_UNIT_Y) {
int scenelevel=0, objectlevel=0, idlevel=0, datalevel=0;
TreeStoreElem *tselem= TREESTORE(te);
@@ -1198,15 +1199,15 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
set_operation_types(soops, &soops->tree, &scenelevel, &objectlevel, &idlevel, &datalevel);
- if(scenelevel) {
+ if (scenelevel) {
//if(objectlevel || datalevel || idlevel) error("Mixed selection");
//else pupmenu("Scene Operations%t|Delete");
}
- else if(objectlevel) {
+ else if (objectlevel) {
WM_operator_name_call(C, "OUTLINER_OT_object_operation", WM_OP_INVOKE_REGION_WIN, NULL);
}
- else if(idlevel) {
- if(idlevel==-1 || datalevel) BKE_report(reports, RPT_WARNING, "Mixed selection");
+ else if (idlevel) {
+ if (idlevel==-1 || datalevel) BKE_report(reports, RPT_WARNING, "Mixed selection");
else {
if (idlevel==ID_GR)
WM_operator_name_call(C, "OUTLINER_OT_group_operation", WM_OP_INVOKE_REGION_WIN, NULL);
@@ -1214,14 +1215,14 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
WM_operator_name_call(C, "OUTLINER_OT_id_operation", WM_OP_INVOKE_REGION_WIN, NULL);
}
}
- else if(datalevel) {
- if(datalevel==-1) BKE_report(reports, RPT_WARNING, "Mixed selection");
+ else if (datalevel) {
+ if (datalevel==-1) BKE_report(reports, RPT_WARNING, "Mixed selection");
else {
if (datalevel == TSE_ANIM_DATA)
WM_operator_name_call(C, "OUTLINER_OT_animdata_operation", WM_OP_INVOKE_REGION_WIN, NULL);
else if (datalevel == TSE_DRIVER_BASE)
/* do nothing... no special ops needed yet */;
- else if ELEM3(datalevel, TSE_R_LAYER_BASE, TSE_R_LAYER, TSE_R_PASS)
+ else if (ELEM3(datalevel, TSE_R_LAYER_BASE, TSE_R_LAYER, TSE_R_PASS))
/*WM_operator_name_call(C, "OUTLINER_OT_renderdata_operation", WM_OP_INVOKE_REGION_WIN, NULL)*/;
else
WM_operator_name_call(C, "OUTLINER_OT_data_operation", WM_OP_INVOKE_REGION_WIN, NULL);
@@ -1231,8 +1232,8 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
return 1;
}
- for(te= te->subtree.first; te; te= te->next) {
- if(do_outliner_operation_event(C, scene, ar, soops, te, event, mval))
+ for (te= te->subtree.first; te; te= te->next) {
+ if (do_outliner_operation_event(C, scene, ar, soops, te, event, mval))
return 1;
}
return 0;
@@ -1249,8 +1250,8 @@ static int outliner_operation(bContext *C, wmOperator *UNUSED(op), wmEvent *even
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], fmval, fmval+1);
- for(te= soops->tree.first; te; te= te->next) {
- if(do_outliner_operation_event(C, scene, ar, soops, te, event, fmval)) break;
+ for (te= soops->tree.first; te; te= te->next) {
+ if (do_outliner_operation_event(C, scene, ar, soops, te, event, fmval)) break;
}
return OPERATOR_FINISHED;
@@ -1259,13 +1260,13 @@ static int outliner_operation(bContext *C, wmOperator *UNUSED(op), wmEvent *even
/* Menu only! Calls other operators */
void OUTLINER_OT_operation(wmOperatorType *ot)
{
- ot->name= "Execute Operation";
- ot->idname= "OUTLINER_OT_operation";
- ot->description= "Context menu for item operations";
+ ot->name = "Execute Operation";
+ ot->idname = "OUTLINER_OT_operation";
+ ot->description = "Context menu for item operations";
- ot->invoke= outliner_operation;
+ ot->invoke = outliner_operation;
- ot->poll= ED_operator_outliner_active;
+ ot->poll = ED_operator_outliner_active;
}
/* ****************************************************** */
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 7f3a8694d68..e83fce0cf05 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -115,23 +115,23 @@ static void outliner_storage_cleanup(SpaceOops *soops)
{
TreeStore *ts= soops->treestore;
- if(ts) {
+ if (ts) {
TreeStoreElem *tselem;
int a, unused= 0;
/* each element used once, for ID blocks with more users to have each a treestore */
- for(a=0, tselem= ts->data; a<ts->usedelem; a++, tselem++) tselem->used= 0;
+ for (a=0, tselem= ts->data; a<ts->usedelem; a++, tselem++) tselem->used= 0;
/* cleanup only after reading file or undo step, and always for
* RNA datablocks view in order to save memory */
- if(soops->storeflag & SO_TREESTORE_CLEANUP) {
+ if (soops->storeflag & SO_TREESTORE_CLEANUP) {
- for(a=0, tselem= ts->data; a<ts->usedelem; a++, tselem++) {
- if(tselem->id==NULL) unused++;
+ for (a=0, tselem= ts->data; a<ts->usedelem; a++, tselem++) {
+ if (tselem->id==NULL) unused++;
}
- if(unused) {
- if(ts->usedelem == unused) {
+ if (unused) {
+ if (ts->usedelem == unused) {
MEM_freeN(ts->data);
ts->data= NULL;
ts->usedelem= ts->totelem= 0;
@@ -140,8 +140,8 @@ static void outliner_storage_cleanup(SpaceOops *soops)
TreeStoreElem *tsnewar, *tsnew;
tsnew=tsnewar= MEM_mallocN((ts->usedelem-unused)*sizeof(TreeStoreElem), "new tselem");
- for(a=0, tselem= ts->data; a<ts->usedelem; a++, tselem++) {
- if(tselem->id) {
+ for (a=0, tselem= ts->data; a<ts->usedelem; a++, tselem++) {
+ if (tselem->id) {
*tsnew= *tselem;
tsnew++;
}
@@ -163,16 +163,16 @@ static void check_persistent(SpaceOops *soops, TreeElement *te, ID *id, short ty
int a;
/* case 1; no TreeStore */
- if(soops->treestore==NULL) {
+ if (soops->treestore==NULL) {
soops->treestore= MEM_callocN(sizeof(TreeStore), "treestore");
}
ts= soops->treestore;
/* check if 'te' is in treestore */
tselem= ts->data;
- for(a=0; a<ts->usedelem; a++, tselem++) {
- if(tselem->id==id && tselem->used==0) {
- if((type==0 && tselem->type==0) ||(tselem->type==type && tselem->nr==nr)) {
+ for (a=0; a<ts->usedelem; a++, tselem++) {
+ if (tselem->id==id && tselem->used==0) {
+ if ((type==0 && tselem->type==0) ||(tselem->type==type && tselem->nr==nr)) {
te->store_index= a;
tselem->used= 1;
return;
@@ -181,11 +181,11 @@ static void check_persistent(SpaceOops *soops, TreeElement *te, ID *id, short ty
}
/* add 1 element to treestore */
- if(ts->usedelem==ts->totelem) {
+ if (ts->usedelem==ts->totelem) {
TreeStoreElem *tsnew;
tsnew= MEM_mallocN((ts->totelem+TS_CHUNK)*sizeof(TreeStoreElem), "treestore data");
- if(ts->data) {
+ if (ts->data) {
memcpy(tsnew, ts->data, ts->totelem*sizeof(TreeStoreElem));
MEM_freeN(ts->data);
}
@@ -196,7 +196,7 @@ static void check_persistent(SpaceOops *soops, TreeElement *te, ID *id, short ty
tselem= ts->data+ts->usedelem;
tselem->type= type;
- if(type) tselem->nr= nr; // we're picky! :)
+ if (type) tselem->nr= nr; // we're picky! :)
else tselem->nr= 0;
tselem->id= id;
tselem->used = 0;
@@ -211,13 +211,13 @@ static void check_persistent(SpaceOops *soops, TreeElement *te, ID *id, short ty
void outliner_free_tree(ListBase *lb)
{
- while(lb->first) {
+ while (lb->first) {
TreeElement *te= lb->first;
outliner_free_tree(&te->subtree);
BLI_remlink(lb, te);
- if(te->flag & TE_FREE_NAME) MEM_freeN((void *)te->name);
+ if (te->flag & TE_FREE_NAME) MEM_freeN((void *)te->name);
MEM_freeN(te);
}
}
@@ -232,10 +232,10 @@ void outliner_cleanup_tree(SpaceOops *soops)
static TreeElement *outliner_find_tree_element(ListBase *lb, int store_index)
{
TreeElement *te= lb->first, *tes;
- while(te) {
- if(te->store_index==store_index) return te;
+ while (te) {
+ if (te->store_index==store_index) return te;
tes= outliner_find_tree_element(&te->subtree, store_index);
- if(tes) return tes;
+ if (tes) return tes;
te= te->next;
}
return NULL;
@@ -248,18 +248,18 @@ TreeElement *outliner_find_tse(SpaceOops *soops, TreeStoreElem *tse)
TreeStoreElem *tselem;
int a;
- if(tse->id==NULL) return NULL;
+ if (tse->id==NULL) return NULL;
/* check if 'tse' is in treestore */
tselem= ts->data;
- for(a=0; a<ts->usedelem; a++, tselem++) {
- if((tse->type==0 && tselem->type==0) || (tselem->type==tse->type && tselem->nr==tse->nr)) {
- if(tselem->id==tse->id) {
+ for (a=0; a<ts->usedelem; a++, tselem++) {
+ if ((tse->type==0 && tselem->type==0) || (tselem->type==tse->type && tselem->nr==tse->nr)) {
+ if (tselem->id==tse->id) {
break;
}
}
}
- if(tselem)
+ if (tselem)
return outliner_find_tree_element(&soops->tree, a);
return NULL;
@@ -271,14 +271,14 @@ TreeElement *outliner_find_id(SpaceOops *soops, ListBase *lb, ID *id)
TreeElement *te, *tes;
TreeStoreElem *tselem;
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
- if(tselem->type==0) {
- if(tselem->id==id) return te;
+ if (tselem->type==0) {
+ if (tselem->id==id) return te;
/* only deeper on scene or object */
- if( te->idcode==ID_OB || te->idcode==ID_SCE || (soops->outlinevis == SO_GROUPS && te->idcode==ID_GR)) {
+ if ( te->idcode==ID_OB || te->idcode==ID_SCE || (soops->outlinevis == SO_GROUPS && te->idcode==ID_GR)) {
tes= outliner_find_id(soops, &te->subtree, id);
- if(tes) return tes;
+ if (tes) return tes;
}
}
}
@@ -291,9 +291,9 @@ ID *outliner_search_back(SpaceOops *soops, TreeElement *te, short idcode)
TreeStoreElem *tselem;
te= te->parent;
- while(te) {
+ while (te) {
tselem= TREESTORE(te);
- if(tselem->type==0 && te->idcode==idcode) return tselem->id;
+ if (tselem->type==0 && te->idcode==idcode) return tselem->id;
te= te->parent;
}
return NULL;
@@ -318,7 +318,7 @@ static void outliner_add_bone(SpaceOops *soops, ListBase *lb, ID *id, Bone *curB
te->name= curBone->name;
te->directdata= curBone;
- for(curBone= curBone->childbase.first; curBone; curBone=curBone->next) {
+ for (curBone= curBone->childbase.first; curBone; curBone=curBone->next) {
outliner_add_bone(soops, &te->subtree, id, curBone, te, a);
}
}
@@ -341,7 +341,7 @@ static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, Sc
/* save cpu cycles, but we add the first to invoke an open/close triangle */
tselem = TREESTORE(tenla);
- if(tselem->flag & TSE_CLOSED)
+ if (tselem->flag & TSE_CLOSED)
return;
te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_Z));
@@ -422,14 +422,14 @@ static void outliner_add_scene_contents(SpaceOops *soops, ListBase *lb, Scene *s
int a;
tenla->name= "RenderLayers";
- for(a=0, srl= sce->r.layers.first; srl; srl= srl->next, a++) {
+ for (a=0, srl= sce->r.layers.first; srl; srl= srl->next, a++) {
TreeElement *tenlay= outliner_add_element(soops, &tenla->subtree, sce, te, TSE_R_LAYER, a);
tenlay->name= srl->name;
tenlay->directdata= &srl->passflag;
- if(srl->light_override)
+ if (srl->light_override)
outliner_add_element(soops, &tenlay->subtree, srl->light_override, tenlay, TSE_LINKED_LAMP, 0);
- if(srl->mat_override)
+ if (srl->mat_override)
outliner_add_element(soops, &tenlay->subtree, srl->mat_override, tenlay, TSE_LINKED_MAT, 0);
outliner_add_passes(soops, tenlay, &sce->id, srl);
@@ -469,13 +469,13 @@ static void outliner_add_object_contents(SpaceOops *soops, TreeElement *te, Tree
if ((arm->edbo == NULL) && (ob->mode & OB_MODE_POSE)) {
int a= 0, const_index= 1000; /* ensure unique id for bone constraints */
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next, a++) {
+ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next, a++) {
ten= outliner_add_element(soops, &tenla->subtree, ob, tenla, TSE_POSE_CHANNEL, a);
ten->name= pchan->name;
ten->directdata= pchan;
pchan->temp= (void *)ten;
- if(pchan->constraints.first) {
+ if (pchan->constraints.first) {
//Object *target;
bConstraint *con;
TreeElement *ten1;
@@ -483,12 +483,12 @@ static void outliner_add_object_contents(SpaceOops *soops, TreeElement *te, Tree
//char *str;
tenla1->name= "Constraints";
- for(con= pchan->constraints.first; con; con= con->next, const_index++) {
+ for (con= pchan->constraints.first; con; con= con->next, const_index++) {
ten1= outliner_add_element(soops, &tenla1->subtree, ob, tenla1, TSE_CONSTRAINT, const_index);
#if 0 /* disabled as it needs to be reworked for recoded constraints system */
target= get_constraint_target(con, &str);
- if(str && str[0]) ten1->name= str;
- else if(target) ten1->name= target->id.name+2;
+ if (str && str[0]) ten1->name= str;
+ else if (target) ten1->name= target->id.name+2;
else ten1->name= con->name;
#endif
ten1->name= con->name;
@@ -499,12 +499,12 @@ static void outliner_add_object_contents(SpaceOops *soops, TreeElement *te, Tree
}
/* make hierarchy */
ten= tenla->subtree.first;
- while(ten) {
+ while (ten) {
TreeElement *nten= ten->next, *par;
tselem= TREESTORE(ten);
- if(tselem->type==TSE_POSE_CHANNEL) {
+ if (tselem->type==TSE_POSE_CHANNEL) {
pchan= (bPoseChannel *)ten->directdata;
- if(pchan->parent) {
+ if (pchan->parent) {
BLI_remlink(&tenla->subtree, ten);
par= (TreeElement *)pchan->parent->temp;
BLI_addtail(&par->subtree, ten);
@@ -516,7 +516,7 @@ static void outliner_add_object_contents(SpaceOops *soops, TreeElement *te, Tree
}
/* Pose Groups */
- if(ob->pose->agroups.first) {
+ if (ob->pose->agroups.first) {
bActionGroup *agrp;
TreeElement *ten;
TreeElement *tenla= outliner_add_element(soops, &te->subtree, ob, te, TSE_POSEGRP_BASE, 0);
@@ -531,10 +531,10 @@ static void outliner_add_object_contents(SpaceOops *soops, TreeElement *te, Tree
}
}
- for(a=0; a<ob->totcol; a++)
+ for (a=0; a<ob->totcol; a++)
outliner_add_element(soops, &te->subtree, ob->mat[a], te, 0, a);
- if(ob->constraints.first) {
+ if (ob->constraints.first) {
//Object *target;
bConstraint *con;
TreeElement *ten;
@@ -546,8 +546,8 @@ static void outliner_add_object_contents(SpaceOops *soops, TreeElement *te, Tree
ten= outliner_add_element(soops, &tenla->subtree, ob, tenla, TSE_CONSTRAINT, a);
#if 0 /* disabled due to constraints system targets recode... code here needs review */
target= get_constraint_target(con, &str);
- if(str && str[0]) ten->name= str;
- else if(target) ten->name= target->id.name+2;
+ if (str && str[0]) ten->name= str;
+ else if (target) ten->name= target->id.name+2;
else ten->name= con->name;
#endif
ten->name= con->name;
@@ -641,10 +641,10 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
outliner_add_element(soops, &te->subtree, me, te, TSE_ANIM_DATA, 0);
outliner_add_element(soops, &te->subtree, me->key, te, 0, 0);
- for(a=0; a<me->totcol; a++)
+ 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:
@@ -655,7 +655,7 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
if (cu->adt)
outliner_add_element(soops, &te->subtree, cu, te, TSE_ANIM_DATA, 0);
- for(a=0; a<cu->totcol; a++)
+ for (a=0; a<cu->totcol; a++)
outliner_add_element(soops, &te->subtree, cu->mat[a], te, 0, a);
}
break;
@@ -667,7 +667,7 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
if (mb->adt)
outliner_add_element(soops, &te->subtree, mb, te, TSE_ANIM_DATA, 0);
- for(a=0; a<mb->totcol; a++)
+ for (a=0; a<mb->totcol; a++)
outliner_add_element(soops, &te->subtree, mb->mat[a], te, 0, a);
}
break;
@@ -679,8 +679,8 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
if (ma->adt)
outliner_add_element(soops, &te->subtree, ma, te, TSE_ANIM_DATA, 0);
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a]) outliner_add_element(soops, &te->subtree, ma->mtex[a]->tex, te, 0, a);
+ for (a=0; a<MAX_MTEX; a++) {
+ if (ma->mtex[a]) outliner_add_element(soops, &te->subtree, ma->mtex[a]->tex, te, 0, a);
}
}
break;
@@ -710,8 +710,8 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
if (la->adt)
outliner_add_element(soops, &te->subtree, la, te, TSE_ANIM_DATA, 0);
- for(a=0; a<MAX_MTEX; a++) {
- if(la->mtex[a]) outliner_add_element(soops, &te->subtree, la->mtex[a]->tex, te, 0, a);
+ for (a=0; a<MAX_MTEX; a++) {
+ if (la->mtex[a]) outliner_add_element(soops, &te->subtree, la->mtex[a]->tex, te, 0, a);
}
}
break;
@@ -719,7 +719,7 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
{
Speaker *spk= (Speaker *)id;
- if(spk->adt)
+ if (spk->adt)
outliner_add_element(soops, &te->subtree, spk, te, TSE_ANIM_DATA, 0);
}
break;
@@ -731,8 +731,8 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
if (wrld->adt)
outliner_add_element(soops, &te->subtree, wrld, te, TSE_ANIM_DATA, 0);
- for(a=0; a<MAX_MTEX; a++) {
- if(wrld->mtex[a]) outliner_add_element(soops, &te->subtree, wrld->mtex[a]->tex, te, 0, a);
+ for (a=0; a<MAX_MTEX; a++) {
+ if (wrld->mtex[a]) outliner_add_element(soops, &te->subtree, wrld->mtex[a]->tex, te, 0, a);
}
}
break;
@@ -758,7 +758,7 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
if (arm->adt)
outliner_add_element(soops, &te->subtree, arm, te, TSE_ANIM_DATA, 0);
- if(arm->edbo) {
+ if (arm->edbo) {
EditBone *ebone;
TreeElement *ten;
@@ -770,10 +770,10 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
}
/* make hierarchy */
ten= arm->edbo->first ? ((EditBone *)arm->edbo->first)->temp : NULL;
- while(ten) {
+ while (ten) {
TreeElement *nten= ten->next, *par;
ebone= (EditBone *)ten->directdata;
- if(ebone->parent) {
+ if (ebone->parent) {
BLI_remlink(&te->subtree, ten);
par= ebone->parent->temp;
BLI_addtail(&par->subtree, ten);
@@ -785,10 +785,10 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
else {
/* do not extend Armature when we have posemode */
tselem= TREESTORE(te->parent);
- if( GS(tselem->id->name)==ID_OB && ((Object *)tselem->id)->mode & OB_MODE_POSE);
+ if ( GS(tselem->id->name)==ID_OB && ((Object *)tselem->id)->mode & OB_MODE_POSE);
else {
Bone *curBone;
- for (curBone=arm->bonebase.first; curBone; curBone=curBone->next){
+ for (curBone=arm->bonebase.first; curBone; curBone=curBone->next) {
outliner_add_bone(soops, &te->subtree, id, curBone, te, &a);
}
}
@@ -807,12 +807,12 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
ID *id= idv;
int a = 0;
- if(ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
+ if (ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
id= ((PointerRNA*)idv)->id.data;
- if(!id) id= ((PointerRNA*)idv)->data;
+ if (!id) id= ((PointerRNA*)idv)->data;
}
- if(id==NULL) return NULL;
+ if (id==NULL) return NULL;
te= MEM_callocN(sizeof(TreeElement), "tree elem");
/* add to the visual tree */
@@ -822,24 +822,24 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
tselem= TREESTORE(te);
/* if we are searching for something expand to see child elements */
- if(SEARCHING_OUTLINER(soops))
+ if (SEARCHING_OUTLINER(soops))
tselem->flag |= TSE_CHILDSEARCH;
te->parent= parent;
te->index= index; // for data arays
- if(ELEM3(type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP));
- else if(ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM));
- else if(type==TSE_ANIM_DATA);
+ if (ELEM3(type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP));
+ else if (ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM));
+ else if (type==TSE_ANIM_DATA);
else {
te->name= id->name+2; // default, can be overridden by Library or non-ID data
te->idcode= GS(id->name);
}
- if(type==0) {
+ if (type==0) {
/* ID datablock */
outliner_add_id_contents(soops, te, tselem, id);
}
- else if(type==TSE_ANIM_DATA) {
+ else if (type==TSE_ANIM_DATA) {
IdAdtTemplate *iat = (IdAdtTemplate *)idv;
AnimData *adt= (AnimData *)iat->adt;
@@ -897,12 +897,12 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
for (strip=nlt->strips.first; strip; strip=strip->next, b++) {
ten= outliner_add_element(soops, &tenlt->subtree, strip->act, tenlt, TSE_NLA_ACTION, b);
- if(ten) ten->directdata= strip;
+ if (ten) ten->directdata= strip;
}
}
}
}
- else if(type==TSE_SEQUENCE) {
+ else if (type==TSE_SEQUENCE) {
Sequence *seq= (Sequence*) idv;
Sequence *p;
@@ -914,25 +914,25 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
te->idcode= seq->type;
te->directdata= seq;
- if(seq->type<7) {
+ if (seq->type<7) {
/*
* This work like the sequence.
* If the sequence have a name (not default name)
* show it, in other case put the filename.
*/
- if(strcmp(seq->name, "SQ"))
+ if (strcmp(seq->name, "SQ"))
te->name= seq->name;
else {
- if((seq->strip) && (seq->strip->stripdata))
+ if ((seq->strip) && (seq->strip->stripdata))
te->name= seq->strip->stripdata->name;
else
te->name= "SQ None";
}
- if(seq->type==SEQ_META) {
+ if (seq->type==SEQ_META) {
te->name= "Meta Strip";
p= seq->seqbase.first;
- while(p) {
+ while (p) {
outliner_add_element(soops, &te->subtree, (void*)p, te, TSE_SEQUENCE, index);
p= p->next;
}
@@ -943,23 +943,23 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
else
te->name= "Effect";
}
- else if(type==TSE_SEQ_STRIP) {
+ else if (type==TSE_SEQ_STRIP) {
Strip *strip= (Strip *)idv;
- if(strip->dir)
+ if (strip->dir)
te->name= strip->dir;
else
te->name= "Strip None";
te->directdata= strip;
}
- else if(type==TSE_SEQUENCE_DUP) {
+ else if (type==TSE_SEQUENCE_DUP) {
Sequence *seq= (Sequence*)idv;
te->idcode= seq->type;
te->directdata= seq;
te->name= seq->strip->stripdata->name;
}
- else if(ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
+ else if (ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
PointerRNA pptr, propptr, *ptr= (PointerRNA*)idv;
PropertyRNA *prop, *iterprop;
PropertyType proptype;
@@ -967,39 +967,39 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
/* we do lazy build, for speed and to avoid infinite recusion */
- if(ptr->data == NULL) {
+ if (ptr->data == NULL) {
te->name= "(empty)";
}
- else if(type == TSE_RNA_STRUCT) {
+ else if (type == TSE_RNA_STRUCT) {
/* struct */
te->name= RNA_struct_name_get_alloc(ptr, NULL, 0, NULL);
- if(te->name)
+ if (te->name)
te->flag |= TE_FREE_NAME;
else
te->name= RNA_struct_ui_name(ptr->type);
/* If searching don't expand RNA entries */
- if(SEARCHING_OUTLINER(soops) && BLI_strcasecmp("RNA",te->name)==0) tselem->flag &= ~TSE_CHILDSEARCH;
+ if (SEARCHING_OUTLINER(soops) && BLI_strcasecmp("RNA",te->name)==0) tselem->flag &= ~TSE_CHILDSEARCH;
iterprop= RNA_struct_iterator_property(ptr->type);
tot= RNA_property_collection_length(ptr, iterprop);
/* auto open these cases */
- if(!parent || (RNA_property_type(parent->directdata)) == PROP_POINTER)
- if(!tselem->used)
+ if (!parent || (RNA_property_type(parent->directdata)) == PROP_POINTER)
+ if (!tselem->used)
tselem->flag &= ~TSE_CLOSED;
- if(TSELEM_OPEN(tselem,soops)) {
- for(a=0; a<tot; a++)
+ if (TSELEM_OPEN(tselem,soops)) {
+ for (a=0; a<tot; a++)
outliner_add_element(soops, &te->subtree, (void*)ptr, te, TSE_RNA_PROPERTY, a);
}
- else if(tot)
+ else if (tot)
te->flag |= TE_LAZY_CLOSED;
te->rnaptr= *ptr;
}
- else if(type == TSE_RNA_PROPERTY) {
+ else if (type == TSE_RNA_PROPERTY) {
/* property */
iterprop= RNA_struct_iterator_property(ptr->type);
RNA_property_collection_lookup_int(ptr, iterprop, index, &propptr);
@@ -1012,42 +1012,42 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
te->rnaptr= *ptr;
/* If searching don't expand RNA entries */
- if(SEARCHING_OUTLINER(soops) && BLI_strcasecmp("RNA",te->name)==0) tselem->flag &= ~TSE_CHILDSEARCH;
+ if (SEARCHING_OUTLINER(soops) && BLI_strcasecmp("RNA",te->name)==0) tselem->flag &= ~TSE_CHILDSEARCH;
- if(proptype == PROP_POINTER) {
+ if (proptype == PROP_POINTER) {
pptr= RNA_property_pointer_get(ptr, prop);
- if(pptr.data) {
- if(TSELEM_OPEN(tselem,soops))
+ if (pptr.data) {
+ if (TSELEM_OPEN(tselem,soops))
outliner_add_element(soops, &te->subtree, (void*)&pptr, te, TSE_RNA_STRUCT, -1);
else
te->flag |= TE_LAZY_CLOSED;
}
}
- else if(proptype == PROP_COLLECTION) {
+ else if (proptype == PROP_COLLECTION) {
tot= RNA_property_collection_length(ptr, prop);
- if(TSELEM_OPEN(tselem,soops)) {
- for(a=0; a<tot; a++) {
+ if (TSELEM_OPEN(tselem,soops)) {
+ for (a=0; a<tot; a++) {
RNA_property_collection_lookup_int(ptr, prop, a, &pptr);
outliner_add_element(soops, &te->subtree, (void*)&pptr, te, TSE_RNA_STRUCT, a);
}
}
- else if(tot)
+ else if (tot)
te->flag |= TE_LAZY_CLOSED;
}
- else if(ELEM3(proptype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
+ else if (ELEM3(proptype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
tot= RNA_property_array_length(ptr, prop);
- if(TSELEM_OPEN(tselem,soops)) {
- for(a=0; a<tot; a++)
+ if (TSELEM_OPEN(tselem,soops)) {
+ for (a=0; a<tot; a++)
outliner_add_element(soops, &te->subtree, (void*)ptr, te, TSE_RNA_ARRAY_ELEM, a);
}
- else if(tot)
+ else if (tot)
te->flag |= TE_LAZY_CLOSED;
}
}
- else if(type == TSE_RNA_ARRAY_ELEM) {
+ else if (type == TSE_RNA_ARRAY_ELEM) {
char c;
prop= parent->directdata;
@@ -1059,12 +1059,12 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
c= RNA_property_array_item_char(prop, index);
te->name= MEM_callocN(sizeof(char)*20, "OutlinerRNAArrayName");
- if(c) sprintf((char *)te->name, " %c", c);
+ if (c) sprintf((char *)te->name, " %c", c);
else sprintf((char *)te->name, " %d", index+1);
te->flag |= TE_FREE_NAME;
}
}
- else if(type == TSE_KEYMAP) {
+ else if (type == TSE_KEYMAP) {
wmKeyMap *km= (wmKeyMap *)idv;
wmKeyMapItem *kmi;
char opname[OP_MAX_TYPENAME];
@@ -1072,24 +1072,24 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
te->directdata= idv;
te->name= km->idname;
- if(TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem,soops)) {
a= 0;
- for (kmi= km->items.first; kmi; kmi= kmi->next, a++) {
+ for (kmi = km->items.first; kmi; kmi = kmi->next, a++) {
const char *key= WM_key_event_string(kmi->type);
- if(key[0]) {
+ if (key[0]) {
wmOperatorType *ot= NULL;
- if(kmi->propvalue);
+ if (kmi->propvalue);
else ot= WM_operatortype_find(kmi->idname, 0);
- if(ot || kmi->propvalue) {
+ if (ot || kmi->propvalue) {
TreeElement *ten= outliner_add_element(soops, &te->subtree, kmi, te, TSE_KEYMAP_ITEM, a);
ten->directdata= kmi;
- if(kmi->propvalue) {
+ if (kmi->propvalue) {
ten->name= "Modal map, not yet";
}
else {
@@ -1116,7 +1116,7 @@ static int need_add_seq_dup(Sequence *seq)
{
Sequence *p;
- if((!seq->strip) || (!seq->strip->stripdata) || (!seq->strip->stripdata->name))
+ if ((!seq->strip) || (!seq->strip->stripdata) || (!seq->strip->stripdata->name))
return(1);
/*
@@ -1124,25 +1124,25 @@ static int need_add_seq_dup(Sequence *seq)
* sequence before this, don't need it, just return.
*/
p= seq->prev;
- while(p) {
- if((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
+ while (p) {
+ if ((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
p= p->prev;
continue;
}
- if(!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
+ if (!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
return(2);
p= p->prev;
}
p= seq->next;
- while(p) {
- if((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
+ while (p) {
+ if ((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
p= p->next;
continue;
}
- if(!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
+ if (!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
return(0);
p= p->next;
}
@@ -1155,13 +1155,13 @@ static void outliner_add_seq_dup(SpaceOops *soops, Sequence *seq, TreeElement *t
Sequence *p;
p= seq;
- while(p) {
- if((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
+ while (p) {
+ if ((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
p= p->next;
continue;
}
- if(!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
+ if (!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
/* ch= */ /* UNUSED */ outliner_add_element(soops, &te->subtree, (void*)p, te, TSE_SEQUENCE, index);
p= p->next;
}
@@ -1181,18 +1181,18 @@ static void outliner_make_hierarchy(SpaceOops *soops, ListBase *lb)
/* build hierarchy */
// XXX also, set extents here...
te= lb->first;
- while(te) {
+ while (te) {
ten= te->next;
tselem= TREESTORE(te);
- if(tselem->type==0 && te->idcode==ID_OB) {
+ if (tselem->type==0 && te->idcode==ID_OB) {
Object *ob= (Object *)tselem->id;
- if(ob->parent && ob->parent->id.newid) {
+ if (ob->parent && ob->parent->id.newid) {
BLI_remlink(lb, te);
tep= (TreeElement *)ob->parent->id.newid;
BLI_addtail(&tep->subtree, te);
// set correct parent pointers
- for(te=tep->subtree.first; te; te= te->next) te->parent= tep;
+ for (te=tep->subtree.first; te; te= te->next) te->parent= tep;
}
}
te= ten;
@@ -1216,15 +1216,15 @@ static int treesort_alpha(const void *v1, const void *v2)
/* first put objects last (hierarchy) */
comp= (x1->idcode==ID_OB);
- if(x2->idcode==ID_OB) comp+=2;
+ if (x2->idcode==ID_OB) comp+=2;
- if(comp==1) return 1;
- else if(comp==2) return -1;
- else if(comp==3) {
+ if (comp==1) return 1;
+ else if (comp==2) return -1;
+ else if (comp==3) {
comp= strcmp(x1->name, x2->name);
- if( comp>0 ) return 1;
- else if( comp<0) return -1;
+ if ( comp>0 ) return 1;
+ else if ( comp<0) return -1;
return 0;
}
return 0;
@@ -1237,20 +1237,20 @@ static int treesort_obtype_alpha(const void *v1, const void *v2)
const tTreeSort *x1= v1, *x2= v2;
/* first put objects last (hierarchy) */
- if(x1->idcode==ID_OB && x2->idcode!=ID_OB) return 1;
- else if(x2->idcode==ID_OB && x1->idcode!=ID_OB) return -1;
+ if (x1->idcode==ID_OB && x2->idcode!=ID_OB) return 1;
+ else if (x2->idcode==ID_OB && x1->idcode!=ID_OB) return -1;
else {
/* 2nd we check ob type */
- if(x1->idcode==ID_OB && x2->idcode==ID_OB) {
- if( ((Object *)x1->id)->type > ((Object *)x2->id)->type) return 1;
- else if( ((Object *)x1->id)->type > ((Object *)x2->id)->type) return -1;
+ if (x1->idcode==ID_OB && x2->idcode==ID_OB) {
+ if ( ((Object *)x1->id)->type > ((Object *)x2->id)->type) return 1;
+ else if ( ((Object *)x1->id)->type > ((Object *)x2->id)->type) return -1;
else return 0;
}
else {
int comp= strcmp(x1->name, x2->name);
- if( comp>0 ) return 1;
- else if( comp<0) return -1;
+ if ( comp>0 ) return 1;
+ else if ( comp<0) return -1;
return 0;
}
}
@@ -1265,38 +1265,38 @@ static void outliner_sort(SpaceOops *soops, ListBase *lb)
int totelem=0;
te= lb->last;
- if(te==NULL) return;
+ if (te==NULL) return;
tselem= TREESTORE(te);
/* sorting rules; only object lists or deformgroups */
- if( (tselem->type==TSE_DEFGROUP) || (tselem->type==0 && te->idcode==ID_OB)) {
+ if ( (tselem->type==TSE_DEFGROUP) || (tselem->type==0 && te->idcode==ID_OB)) {
/* count first */
- for(te= lb->first; te; te= te->next) totelem++;
+ for (te= lb->first; te; te= te->next) totelem++;
- if(totelem>1) {
+ if (totelem>1) {
tTreeSort *tear= MEM_mallocN(totelem*sizeof(tTreeSort), "tree sort array");
tTreeSort *tp=tear;
int skip= 0;
- for(te= lb->first; te; te= te->next, tp++) {
+ for (te= lb->first; te; te= te->next, tp++) {
tselem= TREESTORE(te);
tp->te= te;
tp->name= te->name;
tp->idcode= te->idcode;
- if(tselem->type && tselem->type!=TSE_DEFGROUP) tp->idcode= 0; // dont sort this
+ if (tselem->type && tselem->type!=TSE_DEFGROUP) tp->idcode= 0; // don't sort this
tp->id= tselem->id;
}
/* keep beginning of list */
- for(tp= tear, skip=0; skip<totelem; skip++, tp++)
- if(tp->idcode) break;
+ for (tp= tear, skip=0; skip<totelem; skip++, tp++)
+ if (tp->idcode) break;
- if(skip<totelem)
+ if (skip<totelem)
qsort(tear+skip, totelem-skip, sizeof(tTreeSort), treesort_alpha);
lb->first=lb->last= NULL;
tp= tear;
- while(totelem--) {
+ while (totelem--) {
BLI_addtail(lb, tp->te);
tp++;
}
@@ -1304,7 +1304,7 @@ static void outliner_sort(SpaceOops *soops, ListBase *lb)
}
}
- for(te= lb->first; te; te= te->next) {
+ for (te= lb->first; te; te= te->next) {
outliner_sort(soops, &te->subtree);
}
}
@@ -1379,7 +1379,7 @@ static int outliner_filter_tree(SpaceOops *soops, ListBase *lb)
outliner_free_tree(&te->subtree);
BLI_remlink(lb, te);
- if(te->flag & TE_FREE_NAME) MEM_freeN((void *)te->name);
+ if (te->flag & TE_FREE_NAME) MEM_freeN((void *)te->name);
MEM_freeN(te);
}
}
@@ -1412,37 +1412,37 @@ 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 */
- if(soops->search_string[0]!=0 && soops->outlinevis!=SO_DATABLOCKS)
+ * - 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
soops->search_flags &= ~SO_SEARCH_RECURSIVE;
- if(soops->tree.first && (soops->storeflag & SO_TREESTORE_REDRAW))
+ if (soops->tree.first && (soops->storeflag & SO_TREESTORE_REDRAW))
return;
outliner_free_tree(&soops->tree);
outliner_storage_cleanup(soops);
/* clear ob id.new flags */
- for(ob= mainvar->object.first; ob; ob= ob->id.next) ob->id.newid= NULL;
+ for (ob= mainvar->object.first; ob; ob= ob->id.next) ob->id.newid= NULL;
/* options */
- if(soops->outlinevis == SO_LIBRARIES) {
+ if (soops->outlinevis == SO_LIBRARIES) {
Library *lib;
- for(lib= mainvar->library.first; lib; lib= lib->id.next) {
+ for (lib= mainvar->library.first; lib; lib= lib->id.next) {
ten= outliner_add_element(soops, &soops->tree, lib, NULL, 0, 0);
lib->id.newid= (ID *)ten;
}
/* make hierarchy */
ten= soops->tree.first;
- while(ten) {
+ while (ten) {
TreeElement *nten= ten->next, *par;
tselem= TREESTORE(ten);
lib= (Library *)tselem->id;
- if(lib->parent) {
+ if (lib->parent) {
BLI_remlink(&soops->tree, ten);
par= (TreeElement *)lib->parent->id.newid;
BLI_addtail(&par->subtree, ten);
@@ -1451,67 +1451,67 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
ten= nten;
}
/* restore newid pointers */
- for(lib= mainvar->library.first; lib; lib= lib->id.next)
+ for (lib= mainvar->library.first; lib; lib= lib->id.next)
lib->id.newid= NULL;
}
- else if(soops->outlinevis == SO_ALL_SCENES) {
+ else if (soops->outlinevis == SO_ALL_SCENES) {
Scene *sce;
- for(sce= mainvar->scene.first; sce; sce= sce->id.next) {
+ for (sce= mainvar->scene.first; sce; sce= sce->id.next) {
te= outliner_add_element(soops, &soops->tree, sce, NULL, 0, 0);
tselem= TREESTORE(te);
- if(sce==scene && show_opened)
+ if (sce==scene && show_opened)
tselem->flag &= ~TSE_CLOSED;
- for(base= sce->base.first; base; base= base->next) {
+ for (base= sce->base.first; base; base= base->next) {
ten= outliner_add_element(soops, &te->subtree, base->object, te, 0, 0);
ten->directdata= base;
}
outliner_make_hierarchy(soops, &te->subtree);
/* clear id.newid, to prevent objects be inserted in wrong scenes (parent in other scene) */
- for(base= sce->base.first; base; base= base->next) base->object->id.newid= NULL;
+ for (base= sce->base.first; base; base= base->next) base->object->id.newid= NULL;
}
}
- else if(soops->outlinevis == SO_CUR_SCENE) {
+ else if (soops->outlinevis == SO_CUR_SCENE) {
outliner_add_scene_contents(soops, &soops->tree, scene, NULL);
- for(base= scene->base.first; base; base= base->next) {
+ for (base= scene->base.first; base; base= base->next) {
ten= outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0);
ten->directdata= base;
}
outliner_make_hierarchy(soops, &soops->tree);
}
- else if(soops->outlinevis == SO_VISIBLE) {
- for(base= scene->base.first; base; base= base->next) {
- if(base->lay & scene->lay)
+ else if (soops->outlinevis == SO_VISIBLE) {
+ for (base= scene->base.first; base; base= base->next) {
+ if (base->lay & scene->lay)
outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0);
}
outliner_make_hierarchy(soops, &soops->tree);
}
- else if(soops->outlinevis == SO_GROUPS) {
+ else if (soops->outlinevis == SO_GROUPS) {
Group *group;
GroupObject *go;
- for(group= mainvar->group.first; group; group= group->id.next) {
- if(group->gobject.first) {
+ for (group= mainvar->group.first; group; group= group->id.next) {
+ if (group->gobject.first) {
te= outliner_add_element(soops, &soops->tree, group, NULL, 0, 0);
- for(go= group->gobject.first; go; go= go->next) {
+ for (go= group->gobject.first; go; go= go->next) {
ten= outliner_add_element(soops, &te->subtree, go->ob, te, 0, 0);
ten->directdata= NULL; /* eh, why? */
}
outliner_make_hierarchy(soops, &te->subtree);
/* clear id.newid, to prevent objects be inserted in wrong scenes (parent in other scene) */
- for(go= group->gobject.first; go; go= go->next) go->ob->id.newid= NULL;
+ for (go= group->gobject.first; go; go= go->next) go->ob->id.newid= NULL;
}
}
}
- else if(soops->outlinevis == SO_SAME_TYPE) {
+ else if (soops->outlinevis == SO_SAME_TYPE) {
Object *ob= OBACT;
- if(ob) {
- for(base= scene->base.first; base; base= base->next) {
- if(base->object->type==ob->type) {
+ if (ob) {
+ for (base= scene->base.first; base; base= base->next) {
+ if (base->object->type==ob->type) {
ten= outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0);
ten->directdata= base;
}
@@ -1519,10 +1519,10 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
outliner_make_hierarchy(soops, &soops->tree);
}
}
- else if(soops->outlinevis == SO_SELECTED) {
- for(base= scene->base.first; base; base= base->next) {
- if(base->lay & scene->lay) {
- if(base==BASACT || (base->flag & SELECT)) {
+ else if (soops->outlinevis == SO_SELECTED) {
+ for (base= scene->base.first; base; base= base->next) {
+ if (base->lay & scene->lay) {
+ if (base==BASACT || (base->flag & SELECT)) {
ten= outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0);
ten->directdata= base;
}
@@ -1530,65 +1530,65 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
}
outliner_make_hierarchy(soops, &soops->tree);
}
- else if(soops->outlinevis==SO_SEQUENCE) {
+ else if (soops->outlinevis==SO_SEQUENCE) {
Sequence *seq;
Editing *ed= seq_give_editing(scene, FALSE);
int op;
- if(ed==NULL)
+ if (ed==NULL)
return;
seq= ed->seqbasep->first;
- if(!seq)
+ if (!seq)
return;
- while(seq) {
+ while (seq) {
op= need_add_seq_dup(seq);
- if(op==1) {
+ if (op==1) {
/* ten= */ outliner_add_element(soops, &soops->tree, (void*)seq, NULL, TSE_SEQUENCE, 0);
}
- else if(op==0) {
+ else if (op==0) {
ten= outliner_add_element(soops, &soops->tree, (void*)seq, NULL, TSE_SEQUENCE_DUP, 0);
outliner_add_seq_dup(soops, seq, ten, 0);
}
seq= seq->next;
}
}
- else if(soops->outlinevis==SO_DATABLOCKS) {
+ else if (soops->outlinevis==SO_DATABLOCKS) {
PointerRNA mainptr;
RNA_main_pointer_create(mainvar, &mainptr);
ten= outliner_add_element(soops, &soops->tree, (void*)&mainptr, NULL, TSE_RNA_STRUCT, -1);
- if(show_opened) {
+ if (show_opened) {
tselem= TREESTORE(ten);
tselem->flag &= ~TSE_CLOSED;
}
}
- else if(soops->outlinevis==SO_USERDEF) {
+ else if (soops->outlinevis==SO_USERDEF) {
PointerRNA userdefptr;
RNA_pointer_create(NULL, &RNA_UserPreferences, &U, &userdefptr);
ten= outliner_add_element(soops, &soops->tree, (void*)&userdefptr, NULL, TSE_RNA_STRUCT, -1);
- if(show_opened) {
+ if (show_opened) {
tselem= TREESTORE(ten);
tselem->flag &= ~TSE_CLOSED;
}
}
- else if(soops->outlinevis==SO_KEYMAP) {
+ else if (soops->outlinevis==SO_KEYMAP) {
wmWindowManager *wm= mainvar->wm.first;
wmKeyMap *km;
- for(km= wm->defaultconf->keymaps.first; km; km= km->next) {
+ for (km= wm->defaultconf->keymaps.first; km; km= km->next) {
/* ten= */ outliner_add_element(soops, &soops->tree, (void*)km, NULL, TSE_KEYMAP, 0);
}
}
else {
ten= outliner_add_element(soops, &soops->tree, OBACT, NULL, 0, 0);
- if(ten) ten->directdata= BASACT;
+ if (ten) ten->directdata= BASACT;
}
outliner_sort(soops, &soops->tree);
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index ebbe28e62fa..ed050b7f93d 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -66,7 +66,7 @@ static void outliner_main_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "Outliner", SPACE_OUTLINER, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Outliner", SPACE_OUTLINER, 0);
/* don't pass on view2d mask, it's always set with scrollbar space, hide fails */
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, NULL, &ar->winrct);
@@ -83,15 +83,15 @@ static int outliner_parent_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
float fmval[2];
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]);
- if(drag->type == WM_DRAG_ID) {
+ if (drag->type == WM_DRAG_ID) {
ID *id = (ID *)drag->poin;
- if( GS(id->name) == ID_OB ) {
+ if ( GS(id->name) == ID_OB ) {
/* Ensure item under cursor is valid drop target */
/* Find object hovered over */
- for(te= soops->tree.first; te; te= te->next) {
+ for (te= soops->tree.first; te; te= te->next) {
TreeElement *te_valid;
te_valid= outliner_dropzone_parent(C, event, te, fmval);
- if(te_valid) return 1;
+ if (te_valid) return 1;
}
}
}
@@ -114,20 +114,20 @@ static int outliner_parent_clear_poll(bContext *C, wmDrag *drag, wmEvent *event)
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]);
- if(drag->type == WM_DRAG_ID) {
+ if (drag->type == WM_DRAG_ID) {
ID *id = (ID *)drag->poin;
- if( GS(id->name) == ID_OB ) {
+ if ( GS(id->name) == ID_OB ) {
//TODO: Check if no parent?
/* Ensure location under cursor is valid dropzone */
- for(te= soops->tree.first; te; te= te->next) {
- if(outliner_dropzone_parent_clear(C, event, te, fmval)) return 1;
+ for (te= soops->tree.first; te; te= te->next) {
+ if (outliner_dropzone_parent_clear(C, event, te, fmval)) return 1;
}
/* Check if mouse cursor is below the tree */
te= soops->tree.last;
- while(((te->flag & TE_LAZY_CLOSED)==0) && (te->subtree.last)) {
+ while (((te->flag & TE_LAZY_CLOSED)==0) && (te->subtree.last)) {
te= te->subtree.last;
}
- if(fmval[1] < te->ys) return 1;
+ if (fmval[1] < te->ys) return 1;
}
}
return 0;
@@ -232,15 +232,15 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn)
break;
case NC_LAMP:
/* For updating lamp icons, when changing lamp type */
- if(wmn->data == ND_LIGHTING_DRAW)
+ if (wmn->data == ND_LIGHTING_DRAW)
ED_region_tag_redraw(ar);
break;
case NC_SPACE:
- if(wmn->data == ND_SPACE_OUTLINER)
+ if (wmn->data == ND_SPACE_OUTLINER)
ED_region_tag_redraw(ar);
break;
case NC_ID:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
case NC_MATERIAL:
@@ -269,7 +269,7 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn)
ED_region_tag_redraw(ar);
break;
case ND_ANIMCHAN:
- if(wmn->action==NA_SELECTED)
+ if (wmn->action==NA_SELECTED)
ED_region_tag_redraw(ar);
break;
}
@@ -301,11 +301,11 @@ static void outliner_header_area_listener(ARegion *ar, wmNotifier *wmn)
/* context changes */
switch(wmn->category) {
case NC_SCENE:
- if(wmn->data == ND_KEYINGSET)
+ if (wmn->data == ND_KEYINGSET)
ED_region_tag_redraw(ar);
break;
case NC_SPACE:
- if(wmn->data == ND_SPACE_OUTLINER)
+ if (wmn->data == ND_SPACE_OUTLINER)
ED_region_tag_redraw(ar);
break;
}
@@ -349,8 +349,8 @@ static void outliner_free(SpaceLink *sl)
SpaceOops *soutliner= (SpaceOops*)sl;
outliner_free_tree(&soutliner->tree);
- if(soutliner->treestore) {
- if(soutliner->treestore->data) MEM_freeN(soutliner->treestore->data);
+ if (soutliner->treestore) {
+ if (soutliner->treestore->data) MEM_freeN(soutliner->treestore->data);
MEM_freeN(soutliner->treestore);
}
diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c
index 7702e952e24..4ff0c7ba5b3 100644
--- a/source/blender/editors/space_script/script_edit.c
+++ b/source/blender/editors/space_script/script_edit.c
@@ -57,7 +57,7 @@ static int run_pyfile_exec(bContext *C, wmOperator *op)
char path[512];
RNA_string_get(op->ptr, "filepath", path);
#ifdef WITH_PYTHON
- if(BPY_filepath_exec(C, path, op->reports)) {
+ if (BPY_filepath_exec(C, path, op->reports)) {
ARegion *ar= CTX_wm_region(C);
ED_region_tag_redraw(ar);
return OPERATOR_FINISHED;
@@ -71,16 +71,16 @@ static int run_pyfile_exec(bContext *C, wmOperator *op)
void SCRIPT_OT_python_file_run(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Run python file";
- ot->description= "Run Python file";
- ot->idname= "SCRIPT_OT_python_file_run";
+ ot->name = "Run python file";
+ ot->description = "Run Python file";
+ ot->idname = "SCRIPT_OT_python_file_run";
ot->flag = OPTYPE_UNDO;
/* api callbacks */
- ot->exec= run_pyfile_exec;
- ot->poll= ED_operator_areaactive;
+ ot->exec = run_pyfile_exec;
+ ot->poll = ED_operator_areaactive;
- RNA_def_string_file_path(ot->srna, "filepath", "", 512, "Path", "");
+ RNA_def_string_file_path(ot->srna, "filepath", "", FILE_MAX, "Path", "");
}
@@ -103,10 +103,10 @@ static int script_reload_exec(bContext *C, wmOperator *UNUSED(op))
void SCRIPT_OT_reload(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reload Scripts";
- ot->description= "Reload Scripts";
- ot->idname= "SCRIPT_OT_reload";
+ ot->name = "Reload Scripts";
+ ot->description = "Reload Scripts";
+ ot->idname = "SCRIPT_OT_reload";
/* api callbacks */
- ot->exec= script_reload_exec;
+ ot->exec = script_reload_exec;
}
diff --git a/source/blender/editors/space_script/script_ops.c b/source/blender/editors/space_script/script_ops.c
index 3ae89eefda3..0c99d9b34c4 100644
--- a/source/blender/editors/space_script/script_ops.c
+++ b/source/blender/editors/space_script/script_ops.c
@@ -60,7 +60,7 @@ void script_operatortypes(void)
void script_keymap(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "Script", SPACE_SCRIPT, 0);
+ wmKeyMap *keymap = WM_keymap_find(keyconf, "Script", SPACE_SCRIPT, 0);
/* TODO - this is just while we have no way to load a text datablock */
RNA_string_set(WM_keymap_add_item(keymap, "SCRIPT_OT_python_file_run", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0)->ptr, "filepath", "test.py");
diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c
index dbda276b20c..bad9a01fbcf 100644
--- a/source/blender/editors/space_script/space_script.c
+++ b/source/blender/editors/space_script/space_script.c
@@ -135,7 +135,7 @@ static void script_main_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "Script", SPACE_SCRIPT, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Script", SPACE_SCRIPT, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 438016a38fa..b611037061f 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -52,9 +52,9 @@
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_sequencer.h"
+#include "BKE_movieclip.h"
#include "BKE_report.h"
-
#include "WM_api.h"
#include "WM_types.h"
@@ -79,20 +79,20 @@
/* Generic functions, reused by add strip operators */
/* avoid passing multiple args and be more verbose */
-#define SEQPROP_STARTFRAME (1<<0)
-#define SEQPROP_ENDFRAME (1<<1)
-#define SEQPROP_NOPATHS (1<<2)
-#define SEQPROP_NOCHAN (1<<3)
+#define SEQPROP_STARTFRAME (1 << 0)
+#define SEQPROP_ENDFRAME (1 << 1)
+#define SEQPROP_NOPATHS (1 << 2)
+#define SEQPROP_NOCHAN (1 << 3)
#define SELECT 1
static void sequencer_generic_props__internal(wmOperatorType *ot, int flag)
{
- if(flag & SEQPROP_STARTFRAME)
+ if (flag & SEQPROP_STARTFRAME)
RNA_def_int(ot->srna, "frame_start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame of the sequence strip", INT_MIN, INT_MAX);
- if(flag & SEQPROP_ENDFRAME)
- RNA_def_int(ot->srna, "frame_end", 0, INT_MIN, INT_MAX, "End Frame", "End frame for the color strip", INT_MIN, INT_MAX); /* not useual since most strips have a fixed length */
+ if (flag & SEQPROP_ENDFRAME)
+ RNA_def_int(ot->srna, "frame_end", 0, INT_MIN, INT_MAX, "End Frame", "End frame for the color strip", INT_MIN, INT_MAX); /* not usual since most strips have a fixed length */
RNA_def_int(ot->srna, "channel", 1, 1, MAXSEQ, "Channel", "Channel to place this strip into", 1, MAXSEQ);
@@ -103,10 +103,10 @@ static void sequencer_generic_props__internal(wmOperatorType *ot, int flag)
static void sequencer_generic_invoke_path__internal(bContext *C, wmOperator *op, const char *identifier)
{
- if(RNA_struct_find_property(op->ptr, identifier)) {
- Scene *scene= CTX_data_scene(C);
- Sequence *last_seq= seq_active_get(scene);
- if(last_seq && last_seq->strip && SEQ_HAS_PATH(last_seq)) {
+ if (RNA_struct_find_property(op->ptr, identifier)) {
+ Scene *scene = CTX_data_scene(C);
+ Sequence *last_seq = seq_active_get(scene);
+ if (last_seq && last_seq->strip && SEQ_HAS_PATH(last_seq)) {
char path[sizeof(last_seq->strip->dir)];
BLI_strncpy(path, last_seq->strip->dir, sizeof(path));
BLI_path_abs(path, G.main->name);
@@ -117,21 +117,21 @@ static void sequencer_generic_invoke_path__internal(bContext *C, wmOperator *op,
static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, wmEvent *event, int flag)
{
- View2D *v2d= UI_view2d_fromcontext(C);
+ View2D *v2d = UI_view2d_fromcontext(C);
float mval_v2d[2];
UI_view2d_region_to_view(v2d, event->mval[0], event->mval[1], &mval_v2d[0], &mval_v2d[1]);
- /* effect strips dont need a channel initialized from the mouse */
- if(!(flag & SEQPROP_NOCHAN)) {
- RNA_int_set(op->ptr, "channel", (int)mval_v2d[1]+0.5f);
+ /* effect strips don't need a channel initialized from the mouse */
+ if (!(flag & SEQPROP_NOCHAN)) {
+ RNA_int_set(op->ptr, "channel", (int)mval_v2d[1] + 0.5f);
}
RNA_int_set(op->ptr, "frame_start", (int)mval_v2d[0]);
- if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end")==0)
- RNA_int_set(op->ptr, "frame_end", (int)mval_v2d[0] + 25); // XXX arbitary but ok for now.
+ if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end") == 0)
+ RNA_int_set(op->ptr, "frame_end", (int)mval_v2d[0] + 25); // XXX arbitary but ok for now.
if (!(flag & SEQPROP_NOPATHS)) {
sequencer_generic_invoke_path__internal(C, op, "filepath");
@@ -141,25 +141,26 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, w
static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op)
{
- int relative= RNA_struct_find_property(op->ptr, "relative_path") && RNA_boolean_get(op->ptr, "relative_path");
- int is_file= -1;
+ int relative = RNA_struct_find_property(op->ptr, "relative_path") && RNA_boolean_get(op->ptr, "relative_path");
+ int is_file = -1;
memset(seq_load, 0, sizeof(SeqLoadInfo));
- seq_load->start_frame= RNA_int_get(op->ptr, "frame_start");
- seq_load->end_frame= seq_load->start_frame; /* un-set */
+ seq_load->start_frame = RNA_int_get(op->ptr, "frame_start");
+ seq_load->end_frame = seq_load->start_frame; /* un-set */
- seq_load->channel= RNA_int_get(op->ptr, "channel");
- seq_load->len= 1; // images only, if endframe isnt set!
+ seq_load->channel = RNA_int_get(op->ptr, "channel");
+ seq_load->len = 1; // images only, if endframe isn't set!
- if(RNA_struct_find_property(op->ptr, "filepath")) {
+ if (RNA_struct_find_property(op->ptr, "filepath")) {
RNA_string_get(op->ptr, "filepath", seq_load->path); /* full path, file is set by the caller */
- is_file= 1;
- } else if (RNA_struct_find_property(op->ptr, "directory")) {
+ is_file = 1;
+ }
+ else if (RNA_struct_find_property(op->ptr, "directory")) {
RNA_string_get(op->ptr, "directory", seq_load->path); /* full path, file is set by the caller */
- is_file= 0;
+ is_file = 0;
}
- if((is_file != -1) && relative)
+ if ((is_file != -1) && relative)
BLI_path_rel(seq_load->path, G.main->name);
@@ -180,14 +181,14 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op)
seq_load->flag |= SEQ_LOAD_FRAME_ADVANCE;
- if(is_file==1) {
+ if (is_file == 1) {
BLI_strncpy(seq_load->name, BLI_path_basename(seq_load->path), sizeof(seq_load->name));
}
- else if(RNA_struct_find_property(op->ptr, "files")) {
+ else if (RNA_struct_find_property(op->ptr, "files")) {
/* used for image strip */
/* best guess, first images name */
RNA_BEGIN(op->ptr, itemptr, "files") {
- char *name= RNA_string_get_alloc(&itemptr, "name", NULL, 0);
+ char *name = RNA_string_get_alloc(&itemptr, "name", NULL, 0);
BLI_strncpy(seq_load->name, name, sizeof(seq_load->name));
MEM_freeN(name);
break;
@@ -199,44 +200,41 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op)
/* add scene operator */
static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, TRUE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, TRUE);
Scene *sce_seq;
- Sequence *seq; /* generic strip vars */
+ Sequence *seq; /* generic strip vars */
Strip *strip;
int start_frame, channel; /* operator props */
- start_frame= RNA_int_get(op->ptr, "frame_start");
- channel= RNA_int_get(op->ptr, "channel");
+ start_frame = RNA_int_get(op->ptr, "frame_start");
+ channel = RNA_int_get(op->ptr, "channel");
- sce_seq= BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "scene"));
+ sce_seq = BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "scene"));
- if (sce_seq==NULL) {
+ if (sce_seq == NULL) {
BKE_report(op->reports, RPT_ERROR, "Scene not found");
return OPERATOR_CANCELLED;
}
seq = alloc_sequence(ed->seqbasep, start_frame, channel);
- seq->type= SEQ_SCENE;
- seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */
+ seq->type = SEQ_SCENE;
+ seq->blend_mode = SEQ_CROSS; /* so alpha adjustment fade to the strip below */
- seq->scene= sce_seq;
- seq->sfra= sce_seq->r.sfra;
+ seq->scene = sce_seq;
/* basic defaults */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len = seq->len = sce_seq->r.efra - sce_seq->r.sfra + 1;
- strip->us= 1;
-
- strip->stripdata= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
+ seq->strip = strip = MEM_callocN(sizeof(Strip), "strip");
+ seq->len = sce_seq->r.efra - sce_seq->r.sfra + 1;
+ strip->us = 1;
- BLI_strncpy(seq->name+2, sce_seq->id.name+2, sizeof(seq->name)-2);
+ BLI_strncpy(seq->name + 2, sce_seq->id.name + 2, sizeof(seq->name) - 2);
seqbase_unique_name_recursive(&ed->seqbase, seq);
- seq->scene_sound = sound_scene_add_scene_sound(scene, seq, start_frame, start_frame + strip->len, 0);
+ seq->scene_sound = sound_scene_add_scene_sound(scene, seq, start_frame, start_frame + seq->len, 0);
calc_sequence_disp(scene, seq);
sort_seq(scene);
@@ -247,11 +245,11 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
seq->flag |= SELECT;
}
- if(RNA_boolean_get(op->ptr, "overlap") == FALSE) {
- if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+ if (RNA_boolean_get(op->ptr, "overlap") == FALSE) {
+ if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -259,12 +257,12 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if(!ED_operator_sequencer_active(C)) {
+ if (!ED_operator_sequencer_active(C)) {
BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
return OPERATOR_CANCELLED;
}
- if(!RNA_struct_property_is_set(op->ptr, "scene"))
+ if (!RNA_struct_property_is_set(op->ptr, "scene"))
return WM_enum_search_invoke(C, op, event);
sequencer_generic_invoke_xy__internal(C, op, event, 0);
@@ -279,56 +277,154 @@ void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Add Scene Strip";
- ot->idname= "SEQUENCER_OT_scene_strip_add";
- ot->description= "Add a strip to the sequencer using a blender scene as a source";
+ ot->name = "Add Scene Strip";
+ ot->idname = "SEQUENCER_OT_scene_strip_add";
+ ot->description = "Add a strip to the sequencer using a blender scene as a source";
/* api callbacks */
- ot->invoke= sequencer_add_scene_strip_invoke;
- ot->exec= sequencer_add_scene_strip_exec;
+ ot->invoke = sequencer_add_scene_strip_invoke;
+ ot->exec = sequencer_add_scene_strip_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME);
- prop= RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", "");
+ prop = RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", "");
RNA_def_enum_funcs(prop, RNA_scene_itemf);
- ot->prop= prop;
+ ot->prop = prop;
+}
+
+/* add movieclip operator */
+static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, TRUE);
+
+ MovieClip *clip;
+
+ Sequence *seq; /* generic strip vars */
+ Strip *strip;
+
+ int start_frame, channel; /* operator props */
+
+ start_frame = RNA_int_get(op->ptr, "frame_start");
+ channel = RNA_int_get(op->ptr, "channel");
+
+ clip = BLI_findlink(&CTX_data_main(C)->movieclip, RNA_enum_get(op->ptr, "clip"));
+
+ if (clip == NULL) {
+ BKE_report(op->reports, RPT_ERROR, "MovieClip not found");
+ return OPERATOR_CANCELLED;
+ }
+
+ seq = alloc_sequence(ed->seqbasep, start_frame, channel);
+ seq->type = SEQ_MOVIECLIP;
+ seq->blend_mode = SEQ_CROSS;
+ seq->clip = clip;
+
+ /* basic defaults */
+ seq->strip = strip = MEM_callocN(sizeof(Strip), "strip");
+ seq->len = BKE_movieclip_get_duration(clip);
+ strip->us = 1;
+
+ BLI_strncpy(seq->name + 2, clip->id.name + 2, sizeof(seq->name) - 2);
+ seqbase_unique_name_recursive(&ed->seqbase, seq);
+
+ calc_sequence_disp(scene, seq);
+ sort_seq(scene);
+
+ if (RNA_boolean_get(op->ptr, "replace_sel")) {
+ deselect_all_seq(scene);
+ seq_active_set(scene, seq);
+ seq->flag |= SELECT;
+ }
+
+ if (RNA_boolean_get(op->ptr, "overlap") == FALSE) {
+ if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+ }
+
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
+
+ return OPERATOR_FINISHED;
+}
+
+
+static int sequencer_add_movieclip_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ if (!ED_operator_sequencer_active(C)) {
+ BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
+ return OPERATOR_CANCELLED;
+ }
+
+ if (!RNA_struct_property_is_set(op->ptr, "clip"))
+ return WM_enum_search_invoke(C, op, event);
+
+ sequencer_generic_invoke_xy__internal(C, op, event, 0);
+ return sequencer_add_movieclip_strip_exec(C, op);
+ // needs a menu
+ // return WM_menu_invoke(C, op, event);
+}
+
+
+void SEQUENCER_OT_movieclip_strip_add(struct wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name = "Add MovieClip Strip";
+ ot->idname = "SEQUENCER_OT_movieclip_strip_add";
+ ot->description = "Add a movieclip strip to the sequencer";
+
+ /* api callbacks */
+ ot->invoke = sequencer_add_movieclip_strip_invoke;
+ ot->exec = sequencer_add_movieclip_strip_exec;
+
+ ot->poll = ED_operator_scene_editable;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+ sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME);
+ prop = RNA_def_enum(ot->srna, "clip", DummyRNA_NULL_items, 0, "Clip", "");
+ RNA_def_enum_funcs(prop, RNA_movieclip_itemf);
+ ot->prop = prop;
}
+
static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoadFunc seq_load_func)
{
- Scene *scene= CTX_data_scene(C); /* only for sound */
- Editing *ed= seq_give_editing(scene, TRUE);
+ Scene *scene = CTX_data_scene(C); /* only for sound */
+ Editing *ed = seq_give_editing(scene, TRUE);
SeqLoadInfo seq_load;
Sequence *seq;
int tot_files;
- const short overlap= RNA_boolean_get(op->ptr, "overlap");
+ const short overlap = RNA_boolean_get(op->ptr, "overlap");
seq_load_operator_info(&seq_load, op);
if (seq_load.flag & SEQ_LOAD_REPLACE_SEL)
deselect_all_seq(scene);
- tot_files= RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files"));
+ tot_files = RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files"));
- if(tot_files) {
+ if (tot_files) {
/* multiple files */
char dir_only[FILE_MAX];
char file_only[FILE_MAX];
BLI_split_dir_part(seq_load.path, dir_only, sizeof(dir_only));
- RNA_BEGIN(op->ptr, itemptr, "files") {
+ RNA_BEGIN(op->ptr, itemptr, "files")
+ {
RNA_string_get(&itemptr, "name", file_only);
BLI_join_dirfile(seq_load.path, sizeof(seq_load.path), dir_only, file_only);
seq = seq_load_func(C, ed->seqbasep, &seq_load);
if (seq) {
- if(overlap == FALSE) {
- if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+ if (overlap == FALSE) {
+ if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
}
}
}
@@ -338,13 +434,13 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
/* single file */
seq = seq_load_func(C, ed->seqbasep, &seq_load);
if (seq) {
- if(overlap == FALSE) {
- if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+ if (overlap == FALSE) {
+ if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
}
}
}
- if (seq_load.tot_success==0) {
+ if (seq_load.tot_success == 0) {
BKE_reportf(op->reports, RPT_ERROR, "File \"%s\" could not be loaded", seq_load.path);
return OPERATOR_CANCELLED;
}
@@ -352,7 +448,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
sort_seq(scene);
seq_update_muting(ed);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -367,13 +463,15 @@ static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op)
static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if(!ED_operator_sequencer_active(C)) {
+ if (!ED_operator_sequencer_active(C)) {
BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
return OPERATOR_CANCELLED;
}
/* This is for drag and drop */
- if(RNA_collection_length(op->ptr, "files") || RNA_struct_property_is_set(op->ptr, "filepath")) {
+ if ((RNA_struct_property_is_set(op->ptr, "files") && RNA_collection_length(op->ptr, "files")) ||
+ RNA_struct_property_is_set(op->ptr, "filepath"))
+ {
sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_NOPATHS);
return sequencer_add_movie_strip_exec(C, op);
}
@@ -391,20 +489,20 @@ void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Movie Strip";
- ot->idname= "SEQUENCER_OT_movie_strip_add";
- ot->description= "Add a movie strip to the sequencer";
+ ot->name = "Add Movie Strip";
+ ot->idname = "SEQUENCER_OT_movie_strip_add";
+ ot->description = "Add a movie strip to the sequencer";
/* api callbacks */
- ot->invoke= sequencer_add_movie_strip_invoke;
- ot->exec= sequencer_add_movie_strip_exec;
+ ot->invoke = sequencer_add_movie_strip_invoke;
+ ot->exec = sequencer_add_movie_strip_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, FOLDERFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH|WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME);
RNA_def_boolean(ot->srna, "sound", TRUE, "Sound", "Load sound with the movie");
}
@@ -419,13 +517,15 @@ static int sequencer_add_sound_strip_exec(bContext *C, wmOperator *op)
static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if(!ED_operator_sequencer_active(C)) {
+ if (!ED_operator_sequencer_active(C)) {
BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
return OPERATOR_CANCELLED;
}
/* This is for drag and drop */
- if(RNA_collection_length(op->ptr, "files") || RNA_struct_property_is_set(op->ptr, "filepath")) {
+ if ((RNA_struct_property_is_set(op->ptr, "files") && RNA_collection_length(op->ptr, "files")) ||
+ RNA_struct_property_is_set(op->ptr, "filepath"))
+ {
sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_NOPATHS);
return sequencer_add_sound_strip_exec(C, op);
}
@@ -443,20 +543,20 @@ void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Sound Strip";
- ot->idname= "SEQUENCER_OT_sound_strip_add";
- ot->description= "Add a sound strip to the sequencer";
+ ot->name = "Add Sound Strip";
+ ot->idname = "SEQUENCER_OT_sound_strip_add";
+ ot->description = "Add a sound strip to the sequencer";
/* api callbacks */
- ot->invoke= sequencer_add_sound_strip_invoke;
- ot->exec= sequencer_add_sound_strip_exec;
+ ot->invoke = sequencer_add_sound_strip_invoke;
+ ot->exec = sequencer_add_sound_strip_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH|WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME);
RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory");
}
@@ -466,8 +566,8 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
{
/* cant use the generic function for this */
- Scene *scene= CTX_data_scene(C); /* only for sound */
- Editing *ed= seq_give_editing(scene, TRUE);
+ Scene *scene = CTX_data_scene(C); /* only for sound */
+ Editing *ed = seq_give_editing(scene, TRUE);
SeqLoadInfo seq_load;
Sequence *seq;
@@ -477,31 +577,31 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
seq_load_operator_info(&seq_load, op);
/* images are unique in how they handle this - 1 per strip elem */
- seq_load.len= RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files"));
+ seq_load.len = RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files"));
- if(seq_load.len==0)
+ if (seq_load.len == 0)
return OPERATOR_CANCELLED;
- if(seq_load.flag & SEQ_LOAD_REPLACE_SEL)
+ if (seq_load.flag & SEQ_LOAD_REPLACE_SEL)
deselect_all_seq(scene);
/* main adding function */
- seq= sequencer_add_image_strip(C, ed->seqbasep, &seq_load);
- strip= seq->strip;
- se= strip->stripdata;
+ seq = sequencer_add_image_strip(C, ed->seqbasep, &seq_load);
+ strip = seq->strip;
+ se = strip->stripdata;
RNA_BEGIN(op->ptr, itemptr, "files") {
- char *filename= RNA_string_get_alloc(&itemptr, "name", NULL, 0);
+ char *filename = RNA_string_get_alloc(&itemptr, "name", NULL, 0);
BLI_strncpy(se->name, filename, sizeof(se->name));
MEM_freeN(filename);
se++;
}
RNA_END;
- if(seq_load.len == 1) {
- if(seq_load.start_frame < seq_load.end_frame) {
- seq->endstill= seq_load.end_frame - seq_load.start_frame;
+ if (seq_load.len == 1) {
+ if (seq_load.start_frame < seq_load.end_frame) {
+ seq->endstill = seq_load.end_frame - seq_load.start_frame;
}
}
@@ -510,13 +610,13 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
sort_seq(scene);
/* last active name */
- strncpy(ed->act_imagedir, strip->dir, FILE_MAXDIR-1);
+ strncpy(ed->act_imagedir, strip->dir, FILE_MAXDIR - 1);
- if(RNA_boolean_get(op->ptr, "overlap") == FALSE) {
- if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+ if (RNA_boolean_get(op->ptr, "overlap") == FALSE) {
+ if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -524,15 +624,15 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
static int sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if(!ED_operator_sequencer_active(C)) {
+ if (!ED_operator_sequencer_active(C)) {
BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
return OPERATOR_CANCELLED;
}
/* drag drop has set the names */
- if(RNA_collection_length(op->ptr, "files")) {
- sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_ENDFRAME|SEQPROP_NOPATHS);
+ if (RNA_struct_property_is_set(op->ptr, "files") && RNA_collection_length(op->ptr, "files")) {
+ sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_ENDFRAME | SEQPROP_NOPATHS);
return sequencer_add_image_strip_exec(C, op);
}
@@ -547,31 +647,31 @@ void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Image Strip";
- ot->idname= "SEQUENCER_OT_image_strip_add";
- ot->description= "Add an image or image sequence to the sequencer";
+ ot->name = "Add Image Strip";
+ ot->idname = "SEQUENCER_OT_image_strip_add";
+ ot->description = "Add an image or image sequence to the sequencer";
/* api callbacks */
- ot->invoke= sequencer_add_image_strip_invoke;
- ot->exec= sequencer_add_image_strip_exec;
+ ot->invoke = sequencer_add_image_strip_invoke;
+ ot->exec = sequencer_add_image_strip_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY|WM_FILESEL_RELPATH|WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
- sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME);
+ WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY | WM_FILESEL_RELPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
+ sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME | SEQPROP_ENDFRAME);
}
/* add_effect_strip operator */
static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, TRUE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, TRUE);
- Sequence *seq; /* generic strip vars */
+ Sequence *seq; /* generic strip vars */
Strip *strip;
struct SeqEffectHandle sh;
@@ -580,41 +680,41 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
Sequence *seq1, *seq2, *seq3;
const char *error_msg;
- start_frame= RNA_int_get(op->ptr, "frame_start");
- end_frame= RNA_int_get(op->ptr, "frame_end");
- channel= RNA_int_get(op->ptr, "channel");
+ start_frame = RNA_int_get(op->ptr, "frame_start");
+ end_frame = RNA_int_get(op->ptr, "frame_end");
+ channel = RNA_int_get(op->ptr, "channel");
- type= RNA_enum_get(op->ptr, "type");
+ type = RNA_enum_get(op->ptr, "type");
// XXX move to invoke
- if(!seq_effect_find_selected(scene, NULL, type, &seq1, &seq2, &seq3, &error_msg)) {
+ if (!seq_effect_find_selected(scene, NULL, type, &seq1, &seq2, &seq3, &error_msg)) {
BKE_report(op->reports, RPT_ERROR, error_msg);
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) {
+ if (seq1 == NULL && end_frame <= start_frame) {
BKE_report(op->reports, RPT_ERROR, "Start and end frame are not set");
return OPERATOR_CANCELLED;
}
seq = alloc_sequence(ed->seqbasep, start_frame, channel);
- seq->type= type;
+ seq->type = type;
- BLI_strncpy(seq->name+2, give_seqname(seq), sizeof(seq->name)-2);
+ BLI_strncpy(seq->name + 2, give_seqname(seq), sizeof(seq->name) - 2);
seqbase_unique_name_recursive(&ed->seqbase, seq);
sh = get_sequence_effect(seq);
- seq->seq1= seq1;
- seq->seq2= seq2;
- seq->seq3= seq3;
+ seq->seq1 = seq1;
+ seq->seq2 = seq2;
+ seq->seq3 = seq3;
sh.init(seq);
if (!seq1) { /* effect has no deps */
- seq->len= 1;
+ seq->len = 1;
seq_tx_set_final_right(seq, end_frame);
}
@@ -623,47 +723,46 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
calc_sequence(scene, seq);
/* basic defaults */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len = seq->len;
- strip->us= 1;
- if(seq->len>0)
- strip->stripdata= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
+ seq->strip = strip = MEM_callocN(sizeof(Strip), "strip");
+ strip->us = 1;
- if (seq->type==SEQ_PLUGIN) {
+ if (seq->type == SEQ_PLUGIN) {
char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path);
sh.init_plugin(seq, path);
- if(seq->plugin==NULL) {
+ if (seq->plugin == NULL) {
BLI_remlink(ed->seqbasep, seq);
seq_free_sequence(scene, seq);
BKE_reportf(op->reports, RPT_ERROR, "Sequencer plugin \"%s\" could not load", path);
return OPERATOR_CANCELLED;
}
- } else if (seq->type == SEQ_COLOR) {
- SolidColorVars *colvars= (SolidColorVars *)seq->effectdata;
+ }
+ else if (seq->type == SEQ_COLOR) {
+ SolidColorVars *colvars = (SolidColorVars *)seq->effectdata;
RNA_float_get_array(op->ptr, "color", colvars->col);
- seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */
+ seq->blend_mode = SEQ_CROSS; /* so alpha adjustment fade to the strip below */
- } else if (seq->type == SEQ_ADJUSTMENT) {
- seq->blend_mode= SEQ_CROSS;
+ }
+ else if (seq->type == SEQ_ADJUSTMENT) {
+ seq->blend_mode = SEQ_CROSS;
}
/* an unset channel is a special case where we automatically go above
* the other strips. */
- if(!RNA_struct_property_is_set(op->ptr, "channel")) {
- if(seq->seq1) {
- int chan= MAX3( seq->seq1 ? seq->seq1->machine : 0,
- seq->seq2 ? seq->seq2->machine : 0,
- seq->seq3 ? seq->seq3->machine : 0);
- if(chan < MAXSEQ)
- seq->machine= chan;
+ if (!RNA_struct_property_is_set(op->ptr, "channel")) {
+ if (seq->seq1) {
+ int chan = MAX3(seq->seq1 ? seq->seq1->machine : 0,
+ seq->seq2 ? seq->seq2->machine : 0,
+ seq->seq3 ? seq->seq3->machine : 0);
+ if (chan < MAXSEQ)
+ seq->machine = chan;
}
}
- if(RNA_boolean_get(op->ptr, "overlap") == FALSE) {
- if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+ if (RNA_boolean_get(op->ptr, "overlap") == FALSE) {
+ if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
}
update_changed_seq_and_deps(scene, seq, 1, 1); /* runs calc_sequence */
@@ -679,7 +778,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
seq->flag |= SELECT;
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -688,30 +787,30 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
/* add color */
static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- short is_type_set= RNA_struct_property_is_set(op->ptr, "type");
- int type= -1;
- int prop_flag= SEQPROP_ENDFRAME;
+ short is_type_set = RNA_struct_property_is_set(op->ptr, "type");
+ int type = -1;
+ int prop_flag = SEQPROP_ENDFRAME;
- if(!ED_operator_sequencer_active(C)) {
+ if (!ED_operator_sequencer_active(C)) {
BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
return OPERATOR_CANCELLED;
}
- if(is_type_set) {
- type= RNA_enum_get(op->ptr, "type");
+ if (is_type_set) {
+ 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) {
+ if (get_sequence_effect_num_inputs(type) != 0) {
prop_flag |= SEQPROP_NOCHAN;
}
}
sequencer_generic_invoke_xy__internal(C, op, event, prop_flag);
- if (is_type_set && type==SEQ_PLUGIN) {
+ if (is_type_set && type == SEQ_PLUGIN) {
/* only plugins need the file selector */
WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL;
@@ -724,21 +823,21 @@ static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEven
void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Effect Strip";
- ot->idname= "SEQUENCER_OT_effect_strip_add";
- ot->description= "Add an effect to the sequencer, most are applied on top of existing strips";
+ ot->name = "Add Effect Strip";
+ ot->idname = "SEQUENCER_OT_effect_strip_add";
+ ot->description = "Add an effect to the sequencer, most are applied on top of existing strips";
/* api callbacks */
- ot->invoke= sequencer_add_effect_strip_invoke;
- ot->exec= sequencer_add_effect_strip_exec;
+ ot->invoke = sequencer_add_effect_strip_invoke;
+ ot->exec = sequencer_add_effect_strip_exec;
- ot->poll= ED_operator_scene_editable;
+ ot->poll = ED_operator_scene_editable;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
- sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME);
+ WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
+ sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME | SEQPROP_ENDFRAME);
RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_CROSS, "Type", "Sequencer effect type");
RNA_def_float_vector(ot->srna, "color", 3, NULL, 0.0f, 1.0f, "Color", "Initialize the strip with this color (only used when type='COLOR')", 0.0f, 1.0f);
}
diff --git a/source/blender/editors/space_sequencer/sequencer_buttons.c b/source/blender/editors/space_sequencer/sequencer_buttons.c
index 9aefdea9fb0..81712ec10c4 100644
--- a/source/blender/editors/space_sequencer/sequencer_buttons.c
+++ b/source/blender/editors/space_sequencer/sequencer_buttons.c
@@ -59,7 +59,7 @@ static void sequencer_panel_view_properties(const bContext *UNUSED(C), Panel *pa
{
uiBlock *block;
- block= uiLayoutAbsoluteBlock(pa->layout);
+ block = uiLayoutAbsoluteBlock(pa->layout);
uiBlockSetHandleFunc(block, do_sequencer_panel_events, NULL);
}
@@ -69,7 +69,7 @@ static void sequencer_panel_properties(const bContext *UNUSED(C), Panel *pa)
{
uiBlock *block;
- block= uiLayoutAbsoluteBlock(pa->layout);
+ block = uiLayoutAbsoluteBlock(pa->layout);
uiBlockSetHandleFunc(block, do_sequencer_panel_events, NULL);
}
@@ -78,16 +78,16 @@ void sequencer_buttons_register(ARegionType *art)
{
PanelType *pt;
- pt= MEM_callocN(sizeof(PanelType), "spacetype sequencer strip properties");
+ pt = MEM_callocN(sizeof(PanelType), "spacetype sequencer strip properties");
strcpy(pt->idname, "SEQUENCER_PT_properties");
strcpy(pt->label, "Strip Properties");
- pt->draw= sequencer_panel_properties;
+ pt->draw = sequencer_panel_properties;
BLI_addtail(&art->paneltypes, pt);
- pt= MEM_callocN(sizeof(PanelType), "spacetype sequencer view properties");
+ pt = MEM_callocN(sizeof(PanelType), "spacetype sequencer view properties");
strcpy(pt->idname, "SEQUENCER_PT_view_properties");
strcpy(pt->label, "View Properties");
- pt->draw= sequencer_panel_view_properties;
+ pt->draw = sequencer_panel_view_properties;
BLI_addtail(&art->paneltypes, pt);
}
@@ -96,10 +96,10 @@ void sequencer_buttons_register(ARegionType *art)
static int sequencer_properties(bContext *C, wmOperator *UNUSED(op))
{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= sequencer_has_buttons_region(sa);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = sequencer_has_buttons_region(sa);
- if(ar)
+ if (ar)
ED_region_toggle_hidden(C, ar);
return OPERATOR_FINISHED;
@@ -107,14 +107,14 @@ static int sequencer_properties(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_properties(wmOperatorType *ot)
{
- ot->name= "Properties";
- ot->idname= "SEQUENCER_OT_properties";
- ot->description= "Open sequencer properties panel";
+ ot->name = "Properties";
+ ot->idname = "SEQUENCER_OT_properties";
+ ot->description = "Open sequencer properties panel";
- ot->exec= sequencer_properties;
- ot->poll= ED_operator_sequencer_active;
+ ot->exec = sequencer_properties;
+ ot->poll = ED_operator_sequencer_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 7bc8600c11c..cd0c8779c39 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -68,11 +68,11 @@
#include "sequencer_intern.h"
-#define SEQ_LEFTHANDLE 1
-#define SEQ_RIGHTHANDLE 2
+#define SEQ_LEFTHANDLE 1
+#define SEQ_RIGHTHANDLE 2
-/* Note, Dont use SEQ_BEGIN/SEQ_END while drawing!
+/* Note, Don't use SEQ_BEGIN/SEQ_END while drawing!
* it messes up transform, - Campbell */
static void draw_shadedstrip(Sequence *seq, unsigned char col[3], float x1, float y1, float x2, float y2);
@@ -81,157 +81,161 @@ static void get_seq_color3ubv(Scene *curscene, Sequence *seq, unsigned char col[
unsigned char blendcol[3];
SolidColorVars *colvars = (SolidColorVars *)seq->effectdata;
- switch(seq->type) {
- case SEQ_IMAGE:
- UI_GetThemeColor3ubv(TH_SEQ_IMAGE, col);
- break;
-
- case SEQ_META:
- UI_GetThemeColor3ubv(TH_SEQ_META, col);
- break;
-
- case SEQ_MOVIE:
- UI_GetThemeColor3ubv(TH_SEQ_MOVIE, col);
- break;
-
- case SEQ_SCENE:
- UI_GetThemeColor3ubv(TH_SEQ_SCENE, col);
-
- if(seq->scene==curscene) {
- UI_GetColorPtrShade3ubv(col, col, 20);
- }
- break;
-
- /* transitions */
- case SEQ_CROSS:
- case SEQ_GAMCROSS:
- case SEQ_WIPE:
- UI_GetThemeColor3ubv(TH_SEQ_TRANSITION, col);
-
- /* slightly offset hue to distinguish different effects */
- if (seq->type == SEQ_CROSS) rgb_byte_set_hue_float_offset(col,0.04);
- if (seq->type == SEQ_GAMCROSS) rgb_byte_set_hue_float_offset(col,0.08);
- if (seq->type == SEQ_WIPE) rgb_byte_set_hue_float_offset(col,0.12);
- break;
-
- /* effects */
- case SEQ_TRANSFORM:
- case SEQ_SPEED:
- case SEQ_ADD:
- case SEQ_SUB:
- case SEQ_MUL:
- case SEQ_ALPHAOVER:
- case SEQ_ALPHAUNDER:
- case SEQ_OVERDROP:
- case SEQ_GLOW:
- case SEQ_MULTICAM:
- case SEQ_ADJUSTMENT:
- UI_GetThemeColor3ubv(TH_SEQ_EFFECT, col);
+ switch (seq->type) {
+ case SEQ_IMAGE:
+ UI_GetThemeColor3ubv(TH_SEQ_IMAGE, col);
+ break;
+
+ case SEQ_META:
+ UI_GetThemeColor3ubv(TH_SEQ_META, col);
+ break;
+
+ case SEQ_MOVIE:
+ UI_GetThemeColor3ubv(TH_SEQ_MOVIE, col);
+ break;
+
+ case SEQ_MOVIECLIP:
+ UI_GetThemeColor3ubv(TH_SEQ_MOVIECLIP, col);
+ break;
- /* slightly offset hue to distinguish different effects */
- if (seq->type == SEQ_ADD) rgb_byte_set_hue_float_offset(col,0.04);
- if (seq->type == SEQ_SUB) rgb_byte_set_hue_float_offset(col,0.08);
- if (seq->type == SEQ_MUL) rgb_byte_set_hue_float_offset(col,0.12);
- if (seq->type == SEQ_ALPHAOVER) rgb_byte_set_hue_float_offset(col,0.16);
- if (seq->type == SEQ_ALPHAUNDER) rgb_byte_set_hue_float_offset(col,0.20);
- if (seq->type == SEQ_OVERDROP) rgb_byte_set_hue_float_offset(col,0.24);
- if (seq->type == SEQ_GLOW) rgb_byte_set_hue_float_offset(col,0.28);
- if (seq->type == SEQ_TRANSFORM) rgb_byte_set_hue_float_offset(col,0.36);
- if (seq->type == SEQ_MULTICAM) rgb_byte_set_hue_float_offset(col,0.32);
- if (seq->type == SEQ_ADJUSTMENT) rgb_byte_set_hue_float_offset(col,0.40);
- break;
+ case SEQ_SCENE:
+ UI_GetThemeColor3ubv(TH_SEQ_SCENE, col);
- case SEQ_COLOR:
- if (colvars->col) {
- rgb_float_to_uchar(col, colvars->col);
- } else {
- col[0] = col[1] = col[2] = 128;
- }
- break;
+ if (seq->scene == curscene) {
+ UI_GetColorPtrShade3ubv(col, col, 20);
+ }
+ break;
- case SEQ_PLUGIN:
- UI_GetThemeColor3ubv(TH_SEQ_PLUGIN, col);
- break;
+ /* transitions */
+ case SEQ_CROSS:
+ case SEQ_GAMCROSS:
+ case SEQ_WIPE:
+ UI_GetThemeColor3ubv(TH_SEQ_TRANSITION, col);
+
+ /* slightly offset hue to distinguish different effects */
+ if (seq->type == SEQ_CROSS) rgb_byte_set_hue_float_offset(col, 0.04);
+ if (seq->type == SEQ_GAMCROSS) rgb_byte_set_hue_float_offset(col, 0.08);
+ if (seq->type == SEQ_WIPE) rgb_byte_set_hue_float_offset(col, 0.12);
+ break;
+
+ /* effects */
+ case SEQ_TRANSFORM:
+ case SEQ_SPEED:
+ case SEQ_ADD:
+ case SEQ_SUB:
+ case SEQ_MUL:
+ case SEQ_ALPHAOVER:
+ case SEQ_ALPHAUNDER:
+ case SEQ_OVERDROP:
+ case SEQ_GLOW:
+ case SEQ_MULTICAM:
+ case SEQ_ADJUSTMENT:
+ UI_GetThemeColor3ubv(TH_SEQ_EFFECT, col);
+
+ /* slightly offset hue to distinguish different effects */
+ if (seq->type == SEQ_ADD) rgb_byte_set_hue_float_offset(col, 0.04);
+ else if (seq->type == SEQ_SUB) rgb_byte_set_hue_float_offset(col, 0.08);
+ else if (seq->type == SEQ_MUL) rgb_byte_set_hue_float_offset(col, 0.12);
+ else if (seq->type == SEQ_ALPHAOVER) rgb_byte_set_hue_float_offset(col, 0.16);
+ else if (seq->type == SEQ_ALPHAUNDER) rgb_byte_set_hue_float_offset(col, 0.20);
+ else if (seq->type == SEQ_OVERDROP) rgb_byte_set_hue_float_offset(col, 0.24);
+ else if (seq->type == SEQ_GLOW) rgb_byte_set_hue_float_offset(col, 0.28);
+ else if (seq->type == SEQ_TRANSFORM) rgb_byte_set_hue_float_offset(col, 0.36);
+ else if (seq->type == SEQ_MULTICAM) rgb_byte_set_hue_float_offset(col, 0.32);
+ else if (seq->type == SEQ_ADJUSTMENT) rgb_byte_set_hue_float_offset(col, 0.40);
+ break;
+
+ case SEQ_COLOR:
+ if (colvars->col) {
+ rgb_float_to_uchar(col, colvars->col);
+ }
+ else {
+ col[0] = col[1] = col[2] = 128;
+ }
+ break;
- case SEQ_SOUND:
- UI_GetThemeColor3ubv(TH_SEQ_AUDIO, col);
- blendcol[0] = blendcol[1] = blendcol[2] = 128;
- if(seq->flag & SEQ_MUTE) UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.5, 20);
- break;
+ case SEQ_PLUGIN:
+ UI_GetThemeColor3ubv(TH_SEQ_PLUGIN, col);
+ break;
+
+ case SEQ_SOUND:
+ UI_GetThemeColor3ubv(TH_SEQ_AUDIO, col);
+ blendcol[0] = blendcol[1] = blendcol[2] = 128;
+ if (seq->flag & SEQ_MUTE) UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.5, 20);
+ break;
- default:
- col[0] = 10; col[1] = 255; col[2] = 40;
+ default:
+ col[0] = 10; col[1] = 255; col[2] = 40;
}
}
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;
- float yscale = (y2-y1)/2;
+ int length = floor((x2 - x1) / stepsize) + 1;
+ float ymid = (y1 + y2) / 2;
+ float yscale = (y2 - y1) / 2;
float samplestep;
float startsample, endsample;
float value;
- SoundWaveform* waveform;
+ SoundWaveform *waveform;
- if(!seq->sound->waveform)
+ if (!seq->sound->waveform)
sound_read_waveform(seq->sound);
- if(!seq->sound->waveform)
- return; /* zero length sound */
+ if (!seq->sound->waveform)
+ return; /* zero length sound */
waveform = seq->sound->waveform;
- if(!waveform)
+ if (!waveform)
return;
- startsample = floor((seq->startofs + seq->anim_startofs)/FPS * SOUND_WAVE_SAMPLES_PER_SECOND);
- endsample = ceil((seq->startofs + seq->anim_startofs + seq->enddisp - seq->startdisp)/FPS * SOUND_WAVE_SAMPLES_PER_SECOND);
- samplestep = (endsample-startsample) * stepsize / (x2-x1);
+ startsample = floor((seq->startofs + seq->anim_startofs) / FPS * SOUND_WAVE_SAMPLES_PER_SECOND);
+ endsample = ceil((seq->startofs + seq->anim_startofs + seq->enddisp - seq->startdisp) / FPS * SOUND_WAVE_SAMPLES_PER_SECOND);
+ samplestep = (endsample - startsample) * stepsize / (x2 - x1);
- if(length > floor((waveform->length - startsample) / samplestep))
+ if (length > floor((waveform->length - startsample) / samplestep))
length = floor((waveform->length - startsample) / samplestep);
glBegin(GL_LINE_STRIP);
- for(i = 0; i < length; i++)
+ for (i = 0; i < length; i++)
{
pos = startsample + i * samplestep;
value = waveform->data[pos * 3];
- for(j = pos+1; (j < waveform->length) && (j < pos + samplestep); j++)
+ for (j = pos + 1; (j < waveform->length) && (j < pos + samplestep); j++)
{
- if(value > waveform->data[j * 3])
+ if (value > waveform->data[j * 3])
value = waveform->data[j * 3];
}
- glVertex2f(x1+i*stepsize, ymid + value * yscale);
+ glVertex2f(x1 + i * stepsize, ymid + value * yscale);
}
glEnd();
glBegin(GL_LINE_STRIP);
- for(i = 0; i < length; i++)
+ for (i = 0; i < length; i++)
{
pos = startsample + i * samplestep;
value = waveform->data[pos * 3 + 1];
- for(j = pos+1; (j < waveform->length) && (j < pos + samplestep); j++)
+ for (j = pos + 1; (j < waveform->length) && (j < pos + samplestep); j++)
{
- if(value < waveform->data[j * 3 + 1])
+ if (value < waveform->data[j * 3 + 1])
value = waveform->data[j * 3 + 1];
}
- glVertex2f(x1+i*stepsize, ymid + value * yscale);
+ glVertex2f(x1 + i * stepsize, ymid + value * yscale);
}
glEnd();
}
@@ -239,7 +243,7 @@ static void drawseqwave(Scene *scene, Sequence *seq, float x1, float y1, float x
static void drawmeta_stipple(int value)
{
- if(value) {
+ if (value) {
glEnable(GL_POLYGON_STIPPLE);
glPolygonStipple(stipple_halftone);
@@ -261,36 +265,36 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1,
Sequence *seq;
unsigned char col[4];
- int chan_min= MAXSEQ;
- int chan_max= 0;
- int chan_range= 0;
- float draw_range= y2 - y1;
+ int chan_min = MAXSEQ;
+ int chan_max = 0;
+ int chan_range = 0;
+ float draw_range = y2 - y1;
float draw_height;
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- if(seqm->flag & SEQ_MUTE)
+ if (seqm->flag & SEQ_MUTE)
drawmeta_stipple(1);
- for (seq= seqm->seqbase.first; seq; seq= seq->next) {
- chan_min= MIN2(chan_min, seq->machine);
- chan_max= MAX2(chan_max, seq->machine);
+ for (seq = seqm->seqbase.first; seq; seq = seq->next) {
+ chan_min = MIN2(chan_min, seq->machine);
+ chan_max = MAX2(chan_max, seq->machine);
}
- chan_range= (chan_max - chan_min) + 1;
- draw_height= draw_range / chan_range;
+ chan_range = (chan_max - chan_min) + 1;
+ draw_height = draw_range / chan_range;
- col[3]= 196; /* alpha, used for all meta children */
+ col[3] = 196; /* alpha, used for all meta children */
- for (seq= seqm->seqbase.first; seq; seq= seq->next) {
- if((seq->startdisp > x2 || seq->enddisp < x1) == 0) {
- float y_chan= (seq->machine - chan_min) / (float)(chan_range) * draw_range;
- float x1_chan= seq->startdisp;
- float x2_chan= seq->enddisp;
+ for (seq = seqm->seqbase.first; seq; seq = seq->next) {
+ if ((seq->startdisp > x2 || seq->enddisp < x1) == 0) {
+ float y_chan = (seq->machine - chan_min) / (float)(chan_range) * draw_range;
+ float x1_chan = seq->startdisp;
+ float x2_chan = seq->enddisp;
float y1_chan, y2_chan;
- if((seqm->flag & SEQ_MUTE) == 0 && (seq->flag & SEQ_MUTE))
+ if ((seqm->flag & SEQ_MUTE) == 0 && (seq->flag & SEQ_MUTE))
drawmeta_stipple(1);
get_seq_color3ubv(scene, seq, col);
@@ -298,11 +302,11 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1,
glColor4ubv(col);
/* clamp within parent sequence strip bounds */
- if(x1_chan < x1) x1_chan= x1;
- if(x2_chan > x2) x2_chan= x2;
+ if (x1_chan < x1) x1_chan = x1;
+ if (x2_chan > x2) x2_chan = x2;
- y1_chan= y1 + y_chan + (draw_height * SEQ_STRIP_OFSBOTTOM);
- y2_chan= y1 + y_chan + (draw_height * SEQ_STRIP_OFSTOP);
+ y1_chan = y1 + y_chan + (draw_height * SEQ_STRIP_OFSBOTTOM);
+ y2_chan = y1 + y_chan + (draw_height * SEQ_STRIP_OFSTOP);
glRectf(x1_chan, y1_chan, x2_chan, y2_chan);
@@ -310,7 +314,7 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1,
glColor4ubv(col);
fdrawbox(x1_chan, y1_chan, x2_chan, y2_chan);
- if((seqm->flag & SEQ_MUTE) == 0 && (seq->flag & SEQ_MUTE))
+ if ((seqm->flag & SEQ_MUTE) == 0 && (seq->flag & SEQ_MUTE))
drawmeta_stipple(0);
}
}
@@ -324,81 +328,83 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1,
/* draw a handle, for each end of a sequence strip */
static void draw_seq_handle(View2D *v2d, Sequence *seq, float pixelx, short direction)
{
- float v1[2], v2[2], v3[2], rx1=0, rx2=0; //for triangles and rect
+ float v1[2], v2[2], v3[2], rx1 = 0, rx2 = 0; //for triangles and rect
float x1, x2, y1, y2;
float handsize;
float minhandle, maxhandle;
char numstr[32];
- unsigned int whichsel=0;
+ unsigned int whichsel = 0;
- x1= seq->startdisp;
- x2= seq->enddisp;
+ x1 = seq->startdisp;
+ x2 = seq->enddisp;
- y1= seq->machine+SEQ_STRIP_OFSBOTTOM;
- y2= seq->machine+SEQ_STRIP_OFSTOP;
+ y1 = seq->machine + SEQ_STRIP_OFSBOTTOM;
+ y2 = seq->machine + SEQ_STRIP_OFSTOP;
/* clamp handles to defined size in pixel space */
handsize = seq->handsize;
minhandle = 7;
maxhandle = 40;
- CLAMP(handsize, minhandle*pixelx, maxhandle*pixelx);
+ CLAMP(handsize, minhandle * pixelx, maxhandle * pixelx);
/* set up co-ordinates/dimensions for either left or right handle */
if (direction == SEQ_LEFTHANDLE) {
rx1 = x1;
- rx2 = x1+handsize * 0.75f;
+ rx2 = x1 + handsize * 0.75f;
- v1[0]= x1+handsize/4; v1[1]= y1+( ((y1+y2)/2.0f - y1)/2);
- v2[0]= x1+handsize/4; v2[1]= y2-( ((y1+y2)/2.0f - y1)/2);
- v3[0]= v2[0] + handsize/4; v3[1]= (y1+y2)/2.0f;
+ v1[0] = x1 + handsize / 4; v1[1] = y1 + ( ((y1 + y2) / 2.0f - y1) / 2);
+ v2[0] = x1 + handsize / 4; v2[1] = y2 - ( ((y1 + y2) / 2.0f - y1) / 2);
+ v3[0] = v2[0] + handsize / 4; v3[1] = (y1 + y2) / 2.0f;
whichsel = SEQ_LEFTSEL;
- } else if (direction == SEQ_RIGHTHANDLE) {
- rx1 = x2-handsize*0.75f;
+ }
+ else if (direction == SEQ_RIGHTHANDLE) {
+ rx1 = x2 - handsize * 0.75f;
rx2 = x2;
- v1[0]= x2-handsize/4; v1[1]= y1+( ((y1+y2)/2.0f - y1)/2);
- v2[0]= x2-handsize/4; v2[1]= y2-( ((y1+y2)/2.0f - y1)/2);
- v3[0]= v2[0] - handsize/4; v3[1]= (y1+y2)/2.0f;
+ v1[0] = x2 - handsize / 4; v1[1] = y1 + ( ((y1 + y2) / 2.0f - y1) / 2);
+ v2[0] = x2 - handsize / 4; v2[1] = y2 - ( ((y1 + y2) / 2.0f - y1) / 2);
+ v3[0] = v2[0] - handsize / 4; v3[1] = (y1 + y2) / 2.0f;
whichsel = SEQ_RIGHTSEL;
}
/* draw! */
- if(seq->type < SEQ_EFFECT ||
- get_sequence_effect_num_inputs(seq->type) == 0) {
- glEnable( GL_BLEND );
+ if (seq->type < SEQ_EFFECT ||
+ get_sequence_effect_num_inputs(seq->type) == 0) {
+ glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- if(seq->flag & whichsel) glColor4ub(0, 0, 0, 80);
+ if (seq->flag & whichsel) glColor4ub(0, 0, 0, 80);
else if (seq->flag & SELECT) glColor4ub(255, 255, 255, 30);
else glColor4ub(0, 0, 0, 22);
glRectf(rx1, y1, rx2, y2);
- if(seq->flag & whichsel) glColor4ub(255, 255, 255, 200);
+ if (seq->flag & whichsel) glColor4ub(255, 255, 255, 200);
else glColor4ub(0, 0, 0, 50);
- glEnable( GL_POLYGON_SMOOTH );
+ glEnable(GL_POLYGON_SMOOTH);
glBegin(GL_TRIANGLES);
glVertex2fv(v1); glVertex2fv(v2); glVertex2fv(v3);
glEnd();
- glDisable( GL_POLYGON_SMOOTH );
- glDisable( GL_BLEND );
+ glDisable(GL_POLYGON_SMOOTH);
+ glDisable(GL_BLEND);
}
- if(G.moving || (seq->flag & whichsel)) {
- const char col[4]= {255, 255, 255, 255};
+ if (G.moving || (seq->flag & whichsel)) {
+ const char col[4] = {255, 255, 255, 255};
if (direction == SEQ_LEFTHANDLE) {
- BLI_snprintf(numstr, sizeof(numstr),"%d", seq->startdisp);
- x1= rx1;
+ BLI_snprintf(numstr, sizeof(numstr), "%d", seq->startdisp);
+ x1 = rx1;
y1 -= 0.45f;
- } else {
+ }
+ else {
BLI_snprintf(numstr, sizeof(numstr), "%d", seq->enddisp - 1);
- x1= x2 - handsize*0.75f;
- y1= y2 + 0.05f;
+ x1 = x2 - handsize * 0.75f;
+ y1 = y2 + 0.05f;
}
UI_view2d_text_cache_add(v2d, x1, y1, numstr, col);
}
@@ -408,24 +414,24 @@ static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq)
{
float x1, x2, y1, y2, pixely, a;
unsigned char col[3], blendcol[3];
- View2D *v2d= &ar->v2d;
+ View2D *v2d = &ar->v2d;
- if(seq->type >= SEQ_EFFECT) return;
+ if (seq->type >= SEQ_EFFECT) return;
- x1= seq->startdisp;
- x2= seq->enddisp;
+ x1 = seq->startdisp;
+ x2 = seq->enddisp;
- y1= seq->machine+SEQ_STRIP_OFSBOTTOM;
- y2= seq->machine+SEQ_STRIP_OFSTOP;
+ y1 = seq->machine + SEQ_STRIP_OFSBOTTOM;
+ y2 = seq->machine + SEQ_STRIP_OFSTOP;
- pixely = (v2d->cur.ymax - v2d->cur.ymin)/(v2d->mask.ymax - v2d->mask.ymin);
+ pixely = (v2d->cur.ymax - v2d->cur.ymin) / (v2d->mask.ymax - v2d->mask.ymin);
- if(pixely <= 0) return; /* can happen when the view is split/resized */
+ if (pixely <= 0) return; /* can happen when the view is split/resized */
blendcol[0] = blendcol[1] = blendcol[2] = 120;
- if(seq->startofs) {
- glEnable( GL_BLEND );
+ if (seq->startofs) {
+ glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
get_seq_color3ubv(scene, seq, col);
@@ -433,22 +439,23 @@ static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq)
if (seq->flag & SELECT) {
UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.3, -40);
glColor4ub(col[0], col[1], col[2], 170);
- } else {
+ }
+ else {
UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.6, 0);
glColor4ub(col[0], col[1], col[2], 110);
}
- glRectf((float)(seq->start), y1-SEQ_STRIP_OFSBOTTOM, x1, y1);
+ glRectf((float)(seq->start), y1 - SEQ_STRIP_OFSBOTTOM, x1, y1);
if (seq->flag & SELECT) glColor4ub(col[0], col[1], col[2], 255);
else glColor4ub(col[0], col[1], col[2], 160);
- fdrawbox((float)(seq->start), y1-SEQ_STRIP_OFSBOTTOM, x1, y1); //outline
+ fdrawbox((float)(seq->start), y1 - SEQ_STRIP_OFSBOTTOM, x1, y1); //outline
- glDisable( GL_BLEND );
+ glDisable(GL_BLEND);
}
- if(seq->endofs) {
- glEnable( GL_BLEND );
+ if (seq->endofs) {
+ glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
get_seq_color3ubv(scene, seq, col);
@@ -456,21 +463,22 @@ static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq)
if (seq->flag & SELECT) {
UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.3, -40);
glColor4ub(col[0], col[1], col[2], 170);
- } else {
+ }
+ else {
UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.6, 0);
glColor4ub(col[0], col[1], col[2], 110);
}
- glRectf(x2, y2, (float)(seq->start+seq->len), y2+SEQ_STRIP_OFSBOTTOM);
+ glRectf(x2, y2, (float)(seq->start + seq->len), y2 + SEQ_STRIP_OFSBOTTOM);
if (seq->flag & SELECT) glColor4ub(col[0], col[1], col[2], 255);
else glColor4ub(col[0], col[1], col[2], 160);
- fdrawbox(x2, y2, (float)(seq->start+seq->len), y2+SEQ_STRIP_OFSBOTTOM); //outline
+ fdrawbox(x2, y2, (float)(seq->start + seq->len), y2 + SEQ_STRIP_OFSBOTTOM); //outline
- glDisable( GL_BLEND );
+ glDisable(GL_BLEND);
}
- if(seq->startstill) {
+ if (seq->startstill) {
get_seq_color3ubv(scene, seq, col);
UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.75, 40);
glColor3ubv((GLubyte *)col);
@@ -478,32 +486,32 @@ 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);
glColor3ubv((GLubyte *)col);
- for(a=y1; a< y2; a+= pixely * 2.0f) {
+ for (a = y1; a < y2; a += pixely * 2.0f) {
fdrawline(x1, a, (float)(seq->start), a);
}
}
- if(seq->endstill) {
+ if (seq->endstill) {
get_seq_color3ubv(scene, seq, col);
UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.75, 40);
glColor3ubv((GLubyte *)col);
- draw_shadedstrip(seq, col, (float)(seq->start+seq->len), y1, x2, y2);
+ 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);
glColor3ubv((GLubyte *)col);
- for(a=y1; a< y2; a+= pixely * 2.0f) {
- fdrawline((float)(seq->start+seq->len), a, x2, a);
+ for (a = y1; a < y2; a += pixely * 2.0f) {
+ fdrawline((float)(seq->start + seq->len), a, x2, a);
}
}
}
@@ -513,68 +521,96 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float
{
rctf rect;
char str[32 + FILE_MAX];
- const char *name= seq->name+2;
+ const char *name = seq->name + 2;
char col[4];
/* note, all strings should include 'name' */
- if(name[0]=='\0')
- name= give_seqname(seq);
+ if (name[0] == '\0')
+ name = give_seqname(seq);
- if(seq->type == SEQ_META || seq->type == SEQ_ADJUSTMENT) {
+ if (seq->type == SEQ_META || seq->type == SEQ_ADJUSTMENT) {
BLI_snprintf(str, sizeof(str), "%d | %s", seq->len, name);
}
- else if(seq->type == SEQ_SCENE) {
- if(seq->scene) {
- if(seq->scene_camera) {
- BLI_snprintf(str, sizeof(str), "%d | %s: %s (%s)", seq->len, name, seq->scene->id.name+2, ((ID *)seq->scene_camera)->name+2);
- } else {
- BLI_snprintf(str, sizeof(str), "%d | %s: %s", seq->len, name, seq->scene->id.name+2);
+ else if (seq->type == SEQ_SCENE) {
+ if (seq->scene) {
+ if (seq->scene_camera) {
+ BLI_snprintf(str, sizeof(str), "%d | %s: %s (%s)",
+ seq->len, name, seq->scene->id.name + 2, ((ID *)seq->scene_camera)->name + 2);
}
+ else {
+ BLI_snprintf(str, sizeof(str), "%d | %s: %s",
+ seq->len, name, seq->scene->id.name + 2);
+ }
+ }
+ else {
+ BLI_snprintf(str, sizeof(str), "%d | %s",
+ seq->len, name);
+ }
+ }
+ else if (seq->type == SEQ_MOVIECLIP) {
+ if (seq->clip && strcmp(name, seq->clip->id.name + 2) != 0) {
+ BLI_snprintf(str, sizeof(str), "%d | %s: %s",
+ seq->len, name, seq->clip->id.name + 2);
}
else {
- BLI_snprintf(str, sizeof(str), "%d | %s", seq->len, name);
+ BLI_snprintf(str, sizeof(str), "%d | %s",
+ seq->len, name);
}
}
- else if(seq->type == SEQ_MULTICAM) {
- BLI_snprintf(str, sizeof(str), "Cam | %s: %d", name, seq->multicam_source);
+ else if (seq->type == SEQ_MULTICAM) {
+ BLI_snprintf(str, sizeof(str), "Cam | %s: %d",
+ name, seq->multicam_source);
}
- else if(seq->type == SEQ_IMAGE) {
- BLI_snprintf(str, sizeof(str), "%d | %s: %s%s", seq->len, name, seq->strip->dir, seq->strip->stripdata->name);
+ else if (seq->type == SEQ_IMAGE) {
+ BLI_snprintf(str, sizeof(str), "%d | %s: %s%s",
+ seq->len, name, seq->strip->dir, seq->strip->stripdata->name);
}
- else if(seq->type & SEQ_EFFECT) {
- int can_float = (seq->type != SEQ_PLUGIN)
- || (seq->plugin && seq->plugin->version >= 4);
-
- if(seq->seq3!=seq->seq2 && seq->seq1!=seq->seq3)
- BLI_snprintf(str, sizeof(str), "%d | %s: %d>%d (use %d)%s", seq->len, name, seq->seq1->machine, seq->seq2->machine, seq->seq3->machine, can_float ? "" : " No float, upgrade plugin!");
- else if (seq->seq1 && seq->seq2)
- BLI_snprintf(str, sizeof(str), "%d | %s: %d>%d%s", seq->len, name, seq->seq1->machine, seq->seq2->machine, can_float ? "" : " No float, upgrade plugin!");
- else
- BLI_snprintf(str, sizeof(str), "%d | %s", seq->len, name);
+ else if (seq->type & SEQ_EFFECT) {
+ int can_float = (seq->type != SEQ_PLUGIN) || (seq->plugin && seq->plugin->version >= 4);
+
+ if (seq->seq3 != seq->seq2 && seq->seq1 != seq->seq3) {
+ BLI_snprintf(str, sizeof(str), "%d | %s: %d>%d (use %d)%s",
+ seq->len, name, seq->seq1->machine, seq->seq2->machine, seq->seq3->machine,
+ can_float ? "" : " No float, upgrade plugin!");
+ }
+ else if (seq->seq1 && seq->seq2) {
+ BLI_snprintf(str, sizeof(str), "%d | %s: %d>%d%s",
+ seq->len, name, seq->seq1->machine, seq->seq2->machine,
+ can_float ? "" : " No float, upgrade plugin!");
+ }
+ else {
+ BLI_snprintf(str, sizeof(str), "%d | %s",
+ seq->len, name);
+ }
}
else if (seq->type == SEQ_SOUND) {
- if(seq->sound)
- BLI_snprintf(str, sizeof(str), "%d | %s: %s", seq->len, name, seq->sound->name);
+ if (seq->sound)
+ BLI_snprintf(str, sizeof(str), "%d | %s: %s",
+ seq->len, name, seq->sound->name);
else
- BLI_snprintf(str, sizeof(str), "%d | %s", seq->len, name);
+ BLI_snprintf(str, sizeof(str), "%d | %s",
+ seq->len, name);
}
else if (seq->type == SEQ_MOVIE) {
- BLI_snprintf(str, sizeof(str), "%d | %s: %s%s", seq->len, name, seq->strip->dir, seq->strip->stripdata->name);
+ BLI_snprintf(str, sizeof(str), "%d | %s: %s%s",
+ seq->len, name, seq->strip->dir, seq->strip->stripdata->name);
}
- if(seq->flag & SELECT){
- col[0]= col[1]= col[2]= 255;
- }else if ((((int)background_col[0] + (int)background_col[1] + (int)background_col[2]) / 3) < 50){
- col[0]= col[1]= col[2]= 80; /* use lighter text color for dark background */
- }else{
- col[0]= col[1]= col[2]= 0;
+ if (seq->flag & SELECT) {
+ col[0] = col[1] = col[2] = 255;
}
- col[3]= 255;
+ else if ((((int)background_col[0] + (int)background_col[1] + (int)background_col[2]) / 3) < 50) {
+ col[0] = col[1] = col[2] = 80; /* use lighter text color for dark background */
+ }
+ else {
+ col[0] = col[1] = col[2] = 0;
+ }
+ col[3] = 255;
- rect.xmin= x1;
- rect.ymin= y1;
- rect.xmax= x2;
- rect.ymax= y2;
+ rect.xmin = x1;
+ rect.ymin = y1;
+ rect.xmax = x2;
+ rect.ymax = y2;
UI_view2d_text_cache_rectf(v2d, &rect, str, col);
}
@@ -588,29 +624,29 @@ static void draw_shadedstrip(Sequence *seq, unsigned char col[3], float x1, floa
glPolygonStipple(stipple_halftone);
}
- ymid1 = (y2-y1)*0.25f + y1;
- ymid2 = (y2-y1)*0.65f + y1;
+ ymid1 = (y2 - y1) * 0.25f + y1;
+ ymid2 = (y2 - y1) * 0.65f + y1;
glShadeModel(GL_SMOOTH);
glBegin(GL_QUADS);
- if(seq->flag & SEQ_INVALID_EFFECT) { col[0]= 255; col[1]= 0; col[2]= 255; }
- else if(seq->flag & SELECT) UI_GetColorPtrShade3ubv(col, col, -50);
+ if (seq->flag & SEQ_INVALID_EFFECT) { col[0] = 255; col[1] = 0; col[2] = 255; }
+ else if (seq->flag & SELECT) UI_GetColorPtrShade3ubv(col, col, -50);
/* else UI_GetColorPtrShade3ubv(col, col, 0); */ /* DO NOTHING */
glColor3ubv(col);
- glVertex2f(x1,y1);
- glVertex2f(x2,y1);
+ glVertex2f(x1, y1);
+ glVertex2f(x2, y1);
- if(seq->flag & SEQ_INVALID_EFFECT) { col[0]= 255; col[1]= 0; col[2]= 255; }
- else if(seq->flag & SELECT) UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 5);
+ if (seq->flag & SEQ_INVALID_EFFECT) { col[0] = 255; col[1] = 0; col[2] = 255; }
+ else if (seq->flag & SELECT) UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 5);
else UI_GetColorPtrShade3ubv(col, col, -5);
glColor3ubv((GLubyte *)col);
- glVertex2f(x2,ymid1);
- glVertex2f(x1,ymid1);
+ glVertex2f(x2, ymid1);
+ glVertex2f(x1, ymid1);
glEnd();
@@ -618,16 +654,16 @@ static void draw_shadedstrip(Sequence *seq, unsigned char col[3], float x1, floa
glBegin(GL_QUADS);
- glVertex2f(x1,ymid2);
- glVertex2f(x2,ymid2);
+ glVertex2f(x1, ymid2);
+ glVertex2f(x2, ymid2);
- if(seq->flag & SELECT) UI_GetColorPtrShade3ubv(col, col, -15);
+ if (seq->flag & SELECT) UI_GetColorPtrShade3ubv(col, col, -15);
else UI_GetColorPtrShade3ubv(col, col, 25);
glColor3ubv((GLubyte *)col);
- glVertex2f(x2,y2);
- glVertex2f(x1,y2);
+ glVertex2f(x2, y2);
+ glVertex2f(x1, y2);
glEnd();
@@ -637,13 +673,13 @@ 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;
+ View2D *v2d = &ar->v2d;
float x1, x2, y1, y2;
unsigned char col[3], background_col[3], is_single_image;
@@ -651,23 +687,23 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
is_single_image = (char)seq_single_check(seq);
/* body */
- if(seq->startstill) x1= seq->start;
- else x1= seq->startdisp;
- y1= seq->machine+SEQ_STRIP_OFSBOTTOM;
- if(seq->endstill) x2= seq->start+seq->len;
- else x2= seq->enddisp;
- y2= seq->machine+SEQ_STRIP_OFSTOP;
-
-
+ x1 = (seq->startstill) ? seq->start : seq->startdisp;
+ y1 = seq->machine + SEQ_STRIP_OFSBOTTOM;
+ x2 = (seq->endstill) ? (seq->start + seq->len) : seq->enddisp;
+ y2 = seq->machine + SEQ_STRIP_OFSTOP;
+
+
/* get the correct color per strip type*/
//get_seq_color3ubv(scene, seq, col);
get_seq_color3ubv(scene, seq, background_col);
/* draw the main strip body */
- if (is_single_image) /* single image */
+ if (is_single_image) { /* single image */
draw_shadedstrip(seq, background_col, seq_tx_get_final_left(seq, 0), y1, seq_tx_get_final_right(seq, 0), y2);
- else /* normal operation */
+ }
+ else { /* normal operation */
draw_shadedstrip(seq, background_col, x1, y1, x2, y2);
+ }
/* draw additional info and controls */
if (!is_single_image)
@@ -677,14 +713,16 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
draw_seq_handle(v2d, seq, pixelx, SEQ_RIGHTHANDLE);
/* draw the strip outline */
- x1= seq->startdisp;
- x2= seq->enddisp;
+ x1 = seq->startdisp;
+ x2 = seq->enddisp;
/* draw sound wave */
- if(seq->type == SEQ_SOUND) drawseqwave(scene, seq, x1, y1, x2, y2, (ar->v2d.cur.xmax - ar->v2d.cur.xmin)/ar->winx);
+ if (seq->type == SEQ_SOUND) {
+ drawseqwave(scene, seq, x1, y1, x2, y2, (ar->v2d.cur.xmax - ar->v2d.cur.xmin) / ar->winx);
+ }
/* draw lock */
- if(seq->flag & SEQ_LOCK) {
+ if (seq->flag & SEQ_LOCK) {
glEnable(GL_POLYGON_STIPPLE);
glEnable(GL_BLEND);
@@ -704,11 +742,11 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
get_seq_color3ubv(scene, seq, col);
if (G.moving && (seq->flag & SELECT)) {
- if(seq->flag & SEQ_OVERLAP) {
- col[0]= 255; col[1]= col[2]= 40;
+ if (seq->flag & SEQ_OVERLAP) {
+ col[0] = 255; col[1] = col[2] = 40;
}
else
- UI_GetColorPtrShade3ubv(col, col, 120+outline_tint);
+ UI_GetColorPtrShade3ubv(col, col, 120 + outline_tint);
}
else
UI_GetColorPtrShade3ubv(col, col, outline_tint);
@@ -726,47 +764,50 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
glDisable(GL_LINE_STIPPLE);
}
- if(seq->type==SEQ_META) drawmeta_contents(scene, seq, x1, y1, x2, y2);
+ if (seq->type == SEQ_META) {
+ drawmeta_contents(scene, seq, x1, y1, x2, y2);
+ }
/* calculate if seq is long enough to print a name */
- x1= seq->startdisp+seq->handsize;
- x2= seq->enddisp-seq->handsize;
+ x1 = seq->startdisp + seq->handsize;
+ x2 = seq->enddisp - seq->handsize;
/* info text on the strip */
- if(x1<v2d->cur.xmin) x1= v2d->cur.xmin;
- else if(x1>v2d->cur.xmax) x1= v2d->cur.xmax;
- if(x2<v2d->cur.xmin) x2= v2d->cur.xmin;
- else if(x2>v2d->cur.xmax) x2= v2d->cur.xmax;
+ if (x1 < v2d->cur.xmin) x1 = v2d->cur.xmin;
+ else if (x1 > v2d->cur.xmax) x1 = v2d->cur.xmax;
+ if (x2 < v2d->cur.xmin) x2 = v2d->cur.xmin;
+ else if (x2 > v2d->cur.xmax) x2 = v2d->cur.xmax;
/* nice text here would require changing the view matrix for texture text */
- if( (x2-x1) / pixelx > 32) {
+ if ((x2 - x1) / pixelx > 32) {
draw_seq_text(v2d, seq, x1, x2, y1, y2, background_col);
}
}
-static Sequence *special_seq_update= NULL;
+static Sequence *special_seq_update = NULL;
-static void UNUSED_FUNCTION(set_special_seq_update)(int val)
+static void UNUSED_FUNCTION(set_special_seq_update) (int val)
{
// int x;
/* if mouse over a sequence && LEFTMOUSE */
- if(val) {
+ if (val) {
// XXX special_seq_update= find_nearest_seq(&x);
}
- else special_seq_update= NULL;
+ else special_seq_update = NULL;
}
-void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq, int cfra, int frame_ofs)
+void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq, int cfra, int frame_ofs)
{
- struct Main *bmain= CTX_data_main(C);
- struct ImBuf *ibuf= NULL;
- struct ImBuf *scope= NULL;
+ struct Main *bmain = CTX_data_main(C);
+ struct ImBuf *ibuf = NULL;
+ struct ImBuf *scope = NULL;
struct View2D *v2d = &ar->v2d;
int rectx, recty;
float viewrectx, viewrecty;
float render_size = 0.0;
float proxy_size = 100.0;
+ float col[3];
GLuint texid;
GLuint last_texid;
SeqRenderData context;
@@ -774,15 +815,16 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq
render_size = sseq->render_size;
if (render_size == 0) {
render_size = scene->r.size;
- } else {
+ }
+ else {
proxy_size = render_size;
}
if (render_size < 0) {
return;
}
- viewrectx = (render_size*(float)scene->r.xsch)/100.0f;
- viewrecty = (render_size*(float)scene->r.ysch)/100.0f;
+ viewrectx = (render_size * (float)scene->r.xsch) / 100.0f;
+ viewrecty = (render_size * (float)scene->r.ysch) / 100.0f;
rectx = viewrectx + 0.5f;
recty = viewrecty + 0.5f;
@@ -793,9 +835,9 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq
viewrecty /= proxy_size / 100.0f;
}
- if(frame_ofs == 0) {
- /* XXX TODO: take color from theme */
- glClearColor(0.0, 0.0, 0.0, 0.0);
+ if (frame_ofs == 0) {
+ UI_GetThemeColor3fv(TH_SEQ_PREVIEW, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
glClear(GL_COLOR_BUFFER_BIT);
}
@@ -806,43 +848,44 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq
UI_view2d_curRect_validate(v2d);
/* only initialize the preview if a render is in progress */
- if(G.rendering)
+ if (G.rendering)
return;
context = seq_new_render_data(bmain, scene, rectx, recty, proxy_size);
if (special_seq_update)
- ibuf= give_ibuf_seq_direct(context, cfra + frame_ofs, special_seq_update);
+ ibuf = give_ibuf_seq_direct(context, cfra + frame_ofs, special_seq_update);
else if (!U.prefetchframes) // XXX || (G.f & G_PLAYANIM) == 0) {
- ibuf= (ImBuf *)give_ibuf_seq(context, cfra + frame_ofs, sseq->chanshown);
+ ibuf = give_ibuf_seq(context, cfra + frame_ofs, sseq->chanshown);
else
- ibuf= (ImBuf *)give_ibuf_seq_threaded(context, cfra + frame_ofs, sseq->chanshown);
+ ibuf = give_ibuf_seq_threaded(context, cfra + frame_ofs, sseq->chanshown);
- if(ibuf==NULL)
+ if (ibuf == NULL)
return;
- if(ibuf->rect==NULL && ibuf->rect_float == NULL)
+ if (ibuf->rect == NULL && ibuf->rect_float == NULL)
return;
- switch(sseq->mainb) {
- case SEQ_DRAW_IMG_IMBUF:
- if (sseq->zebra != 0) {
- scope = make_zebra_view_from_ibuf(ibuf, sseq->zebra);
- }
- break;
- case SEQ_DRAW_IMG_WAVEFORM:
- if ((sseq->flag & SEQ_DRAW_COLOR_SEPERATED) != 0) {
- scope = make_sep_waveform_view_from_ibuf(ibuf);
- } else {
- scope = make_waveform_view_from_ibuf(ibuf);
- }
- break;
- case SEQ_DRAW_IMG_VECTORSCOPE:
- scope = make_vectorscope_view_from_ibuf(ibuf);
- break;
- case SEQ_DRAW_IMG_HISTOGRAM:
- scope = make_histogram_view_from_ibuf(ibuf);
- break;
+ switch (sseq->mainb) {
+ case SEQ_DRAW_IMG_IMBUF:
+ if (sseq->zebra != 0) {
+ scope = make_zebra_view_from_ibuf(ibuf, sseq->zebra);
+ }
+ break;
+ case SEQ_DRAW_IMG_WAVEFORM:
+ if ((sseq->flag & SEQ_DRAW_COLOR_SEPARATED) != 0) {
+ scope = make_sep_waveform_view_from_ibuf(ibuf);
+ }
+ else {
+ scope = make_waveform_view_from_ibuf(ibuf);
+ }
+ break;
+ case SEQ_DRAW_IMG_VECTORSCOPE:
+ scope = make_vectorscope_view_from_ibuf(ibuf);
+ break;
+ case SEQ_DRAW_IMG_HISTOGRAM:
+ scope = make_histogram_view_from_ibuf(ibuf);
+ break;
}
if (scope) {
@@ -850,14 +893,14 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq
ibuf = scope;
}
- if(ibuf->rect_float && ibuf->rect==NULL) {
+ if (ibuf->rect_float && ibuf->rect == NULL) {
IMB_rect_from_float(ibuf);
}
/* setting up the view - actual drawing starts here */
UI_view2d_view_ortho(v2d);
- last_texid= glaGetOneInteger(GL_TEXTURE_2D);
+ last_texid = glaGetOneInteger(GL_TEXTURE_2D);
glEnable(GL_TEXTURE_2D);
glGenTextures(1, (GLuint *)&texid);
@@ -869,30 +912,30 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, ibuf->x, ibuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
glBegin(GL_QUADS);
- if(frame_ofs) {
+ if (frame_ofs) {
rctf tot_clip;
- tot_clip.xmin= v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmin);
- tot_clip.ymin= v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymin);
- tot_clip.xmax= v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmax);
- tot_clip.ymax= v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymax);
-
- glTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymin);glVertex2f(tot_clip.xmin, tot_clip.ymin);
- glTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymax);glVertex2f(tot_clip.xmin, tot_clip.ymax);
- glTexCoord2f(scene->ed->over_border.xmax, scene->ed->over_border.ymax);glVertex2f(tot_clip.xmax, tot_clip.ymax);
- glTexCoord2f(scene->ed->over_border.xmax, scene->ed->over_border.ymin);glVertex2f(tot_clip.xmax, tot_clip.ymin);
+ tot_clip.xmin = v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmin);
+ tot_clip.ymin = v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymin);
+ tot_clip.xmax = v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmax);
+ tot_clip.ymax = v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymax);
+
+ glTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymin); glVertex2f(tot_clip.xmin, tot_clip.ymin);
+ glTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymax); glVertex2f(tot_clip.xmin, tot_clip.ymax);
+ glTexCoord2f(scene->ed->over_border.xmax, scene->ed->over_border.ymax); glVertex2f(tot_clip.xmax, tot_clip.ymax);
+ glTexCoord2f(scene->ed->over_border.xmax, scene->ed->over_border.ymin); glVertex2f(tot_clip.xmax, tot_clip.ymin);
}
else {
- glTexCoord2f(0.0f, 0.0f);glVertex2f(v2d->tot.xmin, v2d->tot.ymin);
- glTexCoord2f(0.0f, 1.0f);glVertex2f(v2d->tot.xmin, v2d->tot.ymax);
- glTexCoord2f(1.0f, 1.0f);glVertex2f(v2d->tot.xmax, v2d->tot.ymax);
- glTexCoord2f(1.0f, 0.0f);glVertex2f(v2d->tot.xmax, v2d->tot.ymin);
+ glTexCoord2f(0.0f, 0.0f); glVertex2f(v2d->tot.xmin, v2d->tot.ymin);
+ glTexCoord2f(0.0f, 1.0f); glVertex2f(v2d->tot.xmin, v2d->tot.ymax);
+ glTexCoord2f(1.0f, 1.0f); glVertex2f(v2d->tot.xmax, v2d->tot.ymax);
+ glTexCoord2f(1.0f, 0.0f); glVertex2f(v2d->tot.xmax, v2d->tot.ymin);
}
glEnd( );
glBindTexture(GL_TEXTURE_2D, last_texid);
glDisable(GL_TEXTURE_2D);
glDeleteTextures(1, &texid);
- if(sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
+ if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
float x1 = v2d->tot.xmin;
float y1 = v2d->tot.ymin;
@@ -905,23 +948,23 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq
UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 1.0, 0);
glBegin(GL_LINE_LOOP);
- glVertex2f(x1-0.5f, y1-0.5f);
- glVertex2f(x1-0.5f, y2+0.5f);
- glVertex2f(x2+0.5f, y2+0.5f);
- glVertex2f(x2+0.5f, y1-0.5f);
+ glVertex2f(x1 - 0.5f, y1 - 0.5f);
+ glVertex2f(x1 - 0.5f, y2 + 0.5f);
+ glVertex2f(x2 + 0.5f, y2 + 0.5f);
+ glVertex2f(x2 + 0.5f, y1 - 0.5f);
glEnd();
/* safety border */
if ((sseq->flag & SEQ_DRAW_SAFE_MARGINS) != 0) {
- float fac= 0.1;
+ float fac = 0.1;
- float a= fac*(x2-x1);
- x1+= a;
- x2-= a;
+ float a = fac * (x2 - x1);
+ x1 += a;
+ x2 -= a;
- a= fac*(y2-y1);
- y1+= a;
- y2-= a;
+ a = fac * (y2 - y1);
+ y1 += a;
+ y2 -= a;
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
@@ -957,20 +1000,21 @@ void drawprefetchseqspace(Scene *scene, ARegion *UNUSED(ar), SpaceSeq *sseq)
int proxy_size = 100.0;
if (render_size == 0) {
render_size = scene->r.size;
- } else {
+ }
+ else {
proxy_size = render_size;
}
if (render_size < 0) {
return;
}
- rectx= (render_size*scene->r.xsch)/100;
- recty= (render_size*scene->r.ysch)/100;
+ rectx = (render_size * scene->r.xsch) / 100;
+ recty = (render_size * scene->r.ysch) / 100;
- if(sseq->mainb != SEQ_DRAW_SEQUENCE) {
+ if (sseq->mainb != SEQ_DRAW_SEQUENCE) {
give_ibuf_prefetch_request(
- rectx, recty, (scene->r.cfra), sseq->chanshown,
- proxy_size);
+ rectx, recty, (scene->r.cfra), sseq->chanshown,
+ proxy_size);
}
}
#endif
@@ -985,60 +1029,60 @@ static void draw_seq_backdrop(View2D *v2d)
glRectf(v2d->cur.xmin, -1.0, v2d->cur.xmax, 1.0);
/* Alternating horizontal stripes */
- i= MAX2(1, ((int)v2d->cur.ymin)-1);
+ i = MAX2(1, ((int)v2d->cur.ymin) - 1);
glBegin(GL_QUADS);
- while (i<v2d->cur.ymax) {
- if (((int)i) & 1)
- UI_ThemeColorShade(TH_BACK, -15);
- else
- UI_ThemeColorShade(TH_BACK, -25);
-
- glVertex2f(v2d->cur.xmax, i);
- glVertex2f(v2d->cur.xmin, i);
- glVertex2f(v2d->cur.xmin, i+1);
- glVertex2f(v2d->cur.xmax, i+1);
+ while (i < v2d->cur.ymax) {
+ if (((int)i) & 1)
+ UI_ThemeColorShade(TH_BACK, -15);
+ else
+ UI_ThemeColorShade(TH_BACK, -25);
- i+=1.0;
- }
+ glVertex2f(v2d->cur.xmax, i);
+ glVertex2f(v2d->cur.xmin, i);
+ glVertex2f(v2d->cur.xmin, i + 1);
+ glVertex2f(v2d->cur.xmax, i + 1);
+
+ i += 1.0;
+ }
glEnd();
/* Darker lines separating the horizontal bands */
- i= MAX2(1, ((int)v2d->cur.ymin)-1);
+ i = MAX2(1, ((int)v2d->cur.ymin) - 1);
UI_ThemeColor(TH_GRID);
glBegin(GL_LINES);
- while (i < v2d->cur.ymax) {
- glVertex2f(v2d->cur.xmax, i);
- glVertex2f(v2d->cur.xmin, i);
+ while (i < v2d->cur.ymax) {
+ glVertex2f(v2d->cur.xmax, i);
+ glVertex2f(v2d->cur.xmin, i);
- i+=1.0;
- }
+ i += 1.0;
+ }
glEnd();
}
/* draw the contents of the sequencer strips view */
static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar)
{
- Scene *scene= CTX_data_scene(C);
- View2D *v2d= &ar->v2d;
+ Scene *scene = CTX_data_scene(C);
+ View2D *v2d = &ar->v2d;
Sequence *last_seq = seq_active_get(scene);
int sel = 0, j;
- float pixelx = (v2d->cur.xmax - v2d->cur.xmin)/(v2d->mask.xmax - v2d->mask.xmin);
+ float pixelx = (v2d->cur.xmax - v2d->cur.xmin) / (v2d->mask.xmax - v2d->mask.xmin);
/* loop through twice, first unselected, then selected */
- for (j=0; j<2; j++) {
+ for (j = 0; j < 2; j++) {
Sequence *seq;
- int outline_tint= (j) ? -60 : -150; /* highlighting around strip edges indicating selection */
+ int outline_tint = (j) ? -60 : -150; /* highlighting around strip edges indicating selection */
/* loop through strips, checking for those that are visible */
- for (seq= ed->seqbasep->first; seq; seq= seq->next) {
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
/* boundbox and selection tests for NOT drawing the strip... */
if ((seq->flag & SELECT) != sel) continue;
else if (seq == last_seq) continue;
else if (MIN2(seq->startdisp, seq->start) > v2d->cur.xmax) continue;
- else if (MAX2(seq->enddisp, seq->start+seq->len) < v2d->cur.xmin) continue;
- else if (seq->machine+1.0f < v2d->cur.ymin) continue;
+ else if (MAX2(seq->enddisp, seq->start + seq->len) < v2d->cur.xmin) continue;
+ else if (seq->machine + 1.0f < v2d->cur.ymin) continue;
else if (seq->machine > v2d->cur.ymax) continue;
/* strip passed all tests unscathed... so draw it now */
@@ -1046,7 +1090,7 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar)
}
/* draw selected next time round */
- sel= SELECT;
+ sel = SELECT;
}
/* draw the last selected last (i.e. 'active' in other parts of Blender), removes some overlapping error */
@@ -1081,18 +1125,18 @@ static void seq_draw_sfra_efra(Scene *scene, View2D *v2d)
/* Draw Timeline/Strip Editor Mode for Sequencer */
void draw_timeline_seq(const bContext *C, ARegion *ar)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
- SpaceSeq *sseq= CTX_wm_space_seq(C);
- View2D *v2d= &ar->v2d;
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
+ SpaceSeq *sseq = CTX_wm_space_seq(C);
+ View2D *v2d = &ar->v2d;
View2DScrollers *scrollers;
- short unit=0, flag=0;
+ short unit = 0, flag = 0;
float col[3];
/* clear and setup matrix */
UI_GetThemeColor3fv(TH_BACK, col);
if (ed && ed->metastack.first)
- glClearColor(col[0], col[1], col[2]-0.1f, 0.0f);
+ glClearColor(col[0], col[1], col[2] - 0.1f, 0.0f);
else
glClearColor(col[0], col[1], col[2], 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
@@ -1113,7 +1157,7 @@ void draw_timeline_seq(const bContext *C, ARegion *ar)
// NOTE: the gridlines are currently spaced every 25 frames, which is only fine for 25 fps, but maybe not for 30...
UI_view2d_constant_grid_draw(v2d);
- seq_draw_sfra_efra(scene, v2d);
+ seq_draw_sfra_efra(scene, v2d);
/* sequence strips (if there is data available to be drawn) */
if (ed) {
@@ -1126,8 +1170,8 @@ void draw_timeline_seq(const bContext *C, ARegion *ar)
/* current frame */
UI_view2d_view_ortho(v2d);
- if ((sseq->flag & SEQ_DRAWFRAMES)==0) flag |= DRAWCFRA_UNIT_SECONDS;
- if ((sseq->flag & SEQ_NO_DRAW_CFRANUM)==0) flag |= DRAWCFRA_SHOW_NUMBOX;
+ if ((sseq->flag & SEQ_DRAWFRAMES) == 0) flag |= DRAWCFRA_UNIT_SECONDS;
+ if ((sseq->flag & SEQ_NO_DRAW_CFRANUM) == 0) flag |= DRAWCFRA_SHOW_NUMBOX;
ANIM_draw_cfra(C, v2d, flag);
/* markers */
@@ -1139,14 +1183,14 @@ void draw_timeline_seq(const bContext *C, ARegion *ar)
ANIM_draw_previewrange(C, v2d);
/* overlap playhead */
- if(scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW) {
- int cfra_over= (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) ? scene->ed->over_cfra : scene->r.cfra + scene->ed->over_ofs;
+ if (scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW) {
+ int cfra_over = (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) ? scene->ed->over_cfra : scene->r.cfra + scene->ed->over_ofs;
glColor3f(0.2, 0.2, 0.2);
// glRectf(cfra_over, v2d->cur.ymin, scene->ed->over_ofs + scene->r.cfra + 1, v2d->cur.ymax);
glBegin(GL_LINES);
- glVertex2f(cfra_over, v2d->cur.ymin);
- glVertex2f(cfra_over, v2d->cur.ymax);
+ glVertex2f(cfra_over, v2d->cur.ymin);
+ glVertex2f(cfra_over, v2d->cur.ymax);
glEnd();
}
@@ -1155,8 +1199,8 @@ void draw_timeline_seq(const bContext *C, ARegion *ar)
UI_view2d_view_restore(C);
/* scrollers */
- unit= (sseq->flag & SEQ_DRAWFRAMES)? V2D_UNIT_FRAMES : V2D_UNIT_SECONDSSEQ;
- scrollers= UI_view2d_scrollers_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_UNIT_VALUES, V2D_GRID_CLAMP);
+ unit = (sseq->flag & SEQ_DRAWFRAMES) ? V2D_UNIT_FRAMES : V2D_UNIT_SECONDSSEQ;
+ scrollers = UI_view2d_scrollers_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_UNIT_VALUES, V2D_GRID_CLAMP);
UI_view2d_scrollers_draw(C, v2d, scrollers);
UI_view2d_scrollers_free(scrollers);
}
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index fad402a6787..29fdf80f667 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -55,6 +55,7 @@
#include "BKE_sequencer.h"
#include "BKE_report.h"
#include "BKE_sound.h"
+#include "BKE_movieclip.h"
#include "IMB_imbuf.h"
@@ -75,9 +76,6 @@
/* own include */
#include "sequencer_intern.h"
-static int okee(const char *UNUSED(dummy)) {return 0;}
-
-
/* XXX */
/* RNA Enums, used in multiple files */
EnumPropertyItem sequencer_prop_effect_types[] = {
@@ -131,14 +129,14 @@ typedef struct TransSeq {
typedef struct ProxyBuildJob {
Scene *scene;
- struct Main * main;
+ struct Main *main;
ListBase queue;
int stop;
} ProxyJob;
static void proxy_freejob(void *pjv)
{
- ProxyJob *pj= pjv;
+ ProxyJob *pj = pjv;
BLI_freelistN(&pj->queue);
@@ -175,19 +173,19 @@ static void proxy_endjob(void *pjv)
free_imbuf_seq(pj->scene, &ed->seqbase, FALSE, FALSE);
- WM_main_add_notifier(NC_SCENE|ND_SEQUENCER, pj->scene);
+ WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, pj->scene);
}
static void seq_proxy_build_job(const bContext *C)
{
- wmJob * steve;
+ wmJob *steve;
ProxyJob *pj;
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
Editing *ed = seq_give_editing(scene, FALSE);
- ScrArea * sa= CTX_wm_area(C);
+ ScrArea *sa = CTX_wm_area(C);
struct SeqIndexBuildContext *context;
LinkData *link;
- Sequence * seq;
+ Sequence *seq;
steve = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), sa, "Building Proxies", WM_JOB_PROGRESS);
@@ -196,11 +194,11 @@ static void seq_proxy_build_job(const bContext *C)
if (!pj) {
pj = MEM_callocN(sizeof(ProxyJob), "proxy rebuild job");
- pj->scene= scene;
+ pj->scene = scene;
pj->main = CTX_data_main(C);
WM_jobs_customdata(steve, pj, proxy_freejob);
- WM_jobs_timer(steve, 0.1, NC_SCENE|ND_SEQUENCER, NC_SCENE|ND_SEQUENCER);
+ WM_jobs_timer(steve, 0.1, NC_SCENE | ND_SEQUENCER, NC_SCENE | ND_SEQUENCER);
WM_jobs_callbacks(steve, proxy_startjob, NULL, NULL, proxy_endjob);
}
@@ -225,21 +223,21 @@ static void seq_proxy_build_job(const bContext *C)
void seq_rectf(Sequence *seq, rctf *rectf)
{
- if(seq->startstill) rectf->xmin= seq->start;
- else rectf->xmin= seq->startdisp;
- rectf->ymin= seq->machine+SEQ_STRIP_OFSBOTTOM;
- if(seq->endstill) rectf->xmax= seq->start+seq->len;
- else rectf->xmax= seq->enddisp;
- rectf->ymax= seq->machine+SEQ_STRIP_OFSTOP;
+ if (seq->startstill) rectf->xmin = seq->start;
+ else rectf->xmin = seq->startdisp;
+ rectf->ymin = seq->machine + SEQ_STRIP_OFSBOTTOM;
+ if (seq->endstill) rectf->xmax = seq->start + seq->len;
+ else rectf->xmax = seq->enddisp;
+ rectf->ymax = seq->machine + SEQ_STRIP_OFSTOP;
}
-static void UNUSED_FUNCTION(change_plugin_seq)(Scene *scene, char *str) /* called from fileselect */
+static void UNUSED_FUNCTION(change_plugin_seq) (Scene * scene, char *str) /* called from fileselect */
{
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
struct SeqEffectHandle sh;
- Sequence *last_seq= seq_active_get(scene);
+ Sequence *last_seq = seq_active_get(scene);
- if(last_seq==NULL || last_seq->type != SEQ_PLUGIN) return;
+ if (last_seq == NULL || last_seq->type != SEQ_PLUGIN) return;
sh = get_sequence_effect(last_seq);
sh.free(last_seq);
@@ -249,7 +247,7 @@ static void UNUSED_FUNCTION(change_plugin_seq)(Scene *scene, char *str) /* calle
last_seq->seq2->machine,
last_seq->seq3->machine);
- if( seq_test_overlap(ed->seqbasep, last_seq) ) shuffle_seq(ed->seqbasep, last_seq, scene);
+ if (seq_test_overlap(ed->seqbasep, last_seq) ) shuffle_seq(ed->seqbasep, last_seq, scene);
}
@@ -257,41 +255,41 @@ static void UNUSED_FUNCTION(change_plugin_seq)(Scene *scene, char *str) /* calle
void boundbox_seq(Scene *scene, rctf *rect)
{
Sequence *seq;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
float min[2], max[2];
- if(ed==NULL) return;
+ if (ed == NULL) return;
- min[0]= 0.0;
- max[0]= EFRA+1;
- min[1]= 0.0;
- max[1]= 8.0;
+ min[0] = 0.0;
+ max[0] = EFRA + 1;
+ min[1] = 0.0;
+ max[1] = 8.0;
- seq= ed->seqbasep->first;
- while(seq) {
+ seq = ed->seqbasep->first;
+ while (seq) {
- if( min[0] > seq->startdisp-1) min[0]= seq->startdisp-1;
- if( max[0] < seq->enddisp+1) max[0]= seq->enddisp+1;
- if( max[1] < seq->machine+2) max[1]= seq->machine+2;
+ if (min[0] > seq->startdisp - 1) min[0] = seq->startdisp - 1;
+ if (max[0] < seq->enddisp + 1) max[0] = seq->enddisp + 1;
+ if (max[1] < seq->machine + 2) max[1] = seq->machine + 2;
- seq= seq->next;
+ seq = seq->next;
}
- rect->xmin= min[0];
- rect->xmax= max[0];
- rect->ymin= min[1];
- rect->ymax= max[1];
+ rect->xmin = min[0];
+ rect->xmax = max[0];
+ rect->ymin = min[1];
+ rect->ymax = max[1];
}
-static int mouse_frame_side(View2D *v2d, short mouse_x, int frame )
+static int mouse_frame_side(View2D *v2d, short mouse_x, int frame)
{
int mval[2];
float mouseloc[2];
- mval[0]= mouse_x;
- mval[1]= 0;
+ mval[0] = mouse_x;
+ mval[1] = 0;
/* choose the side based on which side of the playhead the mouse is on */
UI_view2d_region_to_view(v2d, mval[0], mval[1], &mouseloc[0], &mouseloc[1]);
@@ -304,28 +302,28 @@ Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int se
{
/* sel - 0==unselected, 1==selected, -1==done care*/
Sequence *seq;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
- if(ed==NULL) return NULL;
+ if (ed == NULL) return NULL;
- if (sel>0) sel = SELECT;
+ if (sel > 0) sel = SELECT;
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- if( (seq!=test) &&
- (test->machine==seq->machine) &&
- ((sel == -1) || (sel && (seq->flag & SELECT)) || (sel==0 && (seq->flag & SELECT)==0) ))
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if ((seq != test) &&
+ (test->machine == seq->machine) &&
+ ((sel == -1) || (sel && (seq->flag & SELECT)) || (sel == 0 && (seq->flag & SELECT) == 0) ))
{
switch (lr) {
- case SEQ_SIDE_LEFT:
- if (test->startdisp == (seq->enddisp)) {
- return seq;
- }
- break;
- case SEQ_SIDE_RIGHT:
- if (test->enddisp == (seq->startdisp)) {
- return seq;
- }
- break;
+ case SEQ_SIDE_LEFT:
+ if (test->startdisp == (seq->enddisp)) {
+ return seq;
+ }
+ break;
+ case SEQ_SIDE_RIGHT:
+ if (test->enddisp == (seq->startdisp)) {
+ return seq;
+ }
+ break;
}
}
}
@@ -335,46 +333,47 @@ Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int se
static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, int sel)
{
/* sel - 0==unselected, 1==selected, -1==done care*/
- Sequence *seq,*best_seq = NULL;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Sequence *seq, *best_seq = NULL;
+ Editing *ed = seq_give_editing(scene, FALSE);
int dist, best_dist;
- best_dist = MAXFRAME*2;
+ best_dist = MAXFRAME * 2;
- if(ed==NULL) return NULL;
+ if (ed == NULL) return NULL;
- seq= ed->seqbasep->first;
- while(seq) {
- if( (seq!=test) &&
- (test->machine==seq->machine) &&
- (test->depth==seq->depth) &&
- ((sel == -1) || (sel==(seq->flag & SELECT))))
+ seq = ed->seqbasep->first;
+ while (seq) {
+ if ((seq != test) &&
+ (test->machine == seq->machine) &&
+ (test->depth == seq->depth) &&
+ ((sel == -1) || (sel == (seq->flag & SELECT))))
{
- dist = MAXFRAME*2;
+ dist = MAXFRAME * 2;
switch (lr) {
- case SEQ_SIDE_LEFT:
- if (seq->enddisp <= test->startdisp) {
- dist = test->enddisp - seq->startdisp;
- }
- break;
- case SEQ_SIDE_RIGHT:
- if (seq->startdisp >= test->enddisp) {
- dist = seq->startdisp - test->enddisp;
- }
- break;
+ case SEQ_SIDE_LEFT:
+ if (seq->enddisp <= test->startdisp) {
+ dist = test->enddisp - seq->startdisp;
+ }
+ break;
+ case SEQ_SIDE_RIGHT:
+ if (seq->startdisp >= test->enddisp) {
+ dist = seq->startdisp - test->enddisp;
+ }
+ break;
}
- if (dist==0) {
+ if (dist == 0) {
best_seq = seq;
break;
- } else if (dist < best_dist) {
+ }
+ else if (dist < best_dist) {
best_dist = dist;
best_seq = seq;
}
}
- seq= seq->next;
+ seq = seq->next;
}
return best_seq; /* can be null */
}
@@ -383,55 +382,56 @@ static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, i
Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[2])
{
Sequence *seq;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
float x, y;
float pixelx;
float handsize;
float displen;
- *hand= SEQ_SIDE_NONE;
+ *hand = SEQ_SIDE_NONE;
- if(ed==NULL) return NULL;
+ if (ed == NULL) return NULL;
- pixelx = (v2d->cur.xmax - v2d->cur.xmin)/(v2d->mask.xmax - v2d->mask.xmin);
+ pixelx = (v2d->cur.xmax - v2d->cur.xmin) / (v2d->mask.xmax - v2d->mask.xmin);
UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y);
- seq= ed->seqbasep->first;
+ seq = ed->seqbasep->first;
- while(seq) {
- if(seq->machine == (int)y) {
+ while (seq) {
+ if (seq->machine == (int)y) {
/* check for both normal strips, and strips that have been flipped horizontally */
- if( ((seq->startdisp < seq->enddisp) && (seq->startdisp<=x && seq->enddisp>=x)) ||
- ((seq->startdisp > seq->enddisp) && (seq->startdisp>=x && seq->enddisp<=x)) )
+ if ( ((seq->startdisp < seq->enddisp) && (seq->startdisp <= x && seq->enddisp >= x)) ||
+ ((seq->startdisp > seq->enddisp) && (seq->startdisp >= x && seq->enddisp <= x)) )
{
- if(seq_tx_test(seq)) {
+ if (seq_tx_test(seq)) {
/* clamp handles to defined size in pixel space */
handsize = seq->handsize;
displen = (float)abs(seq->startdisp - seq->enddisp);
- if (displen / pixelx > 16) { /* dont even try to grab the handles of small strips */
+ if (displen / pixelx > 16) { /* don't 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;
- } else {
- CLAMP(handsize, 7*pixelx, 30*pixelx);
+ if ((displen / 3) < 30 * pixelx) {
+ handsize = displen / 3;
+ }
+ else {
+ CLAMP(handsize, 7 * pixelx, 30 * pixelx);
}
- if( handsize+seq->startdisp >=x )
- *hand= SEQ_SIDE_LEFT;
- else if( -handsize+seq->enddisp <=x )
- *hand= SEQ_SIDE_RIGHT;
+ if (handsize + seq->startdisp >= x)
+ *hand = SEQ_SIDE_LEFT;
+ else if (-handsize + seq->enddisp <= x)
+ *hand = SEQ_SIDE_RIGHT;
}
}
return seq;
}
}
- seq= seq->next;
+ seq = seq->next;
}
return NULL;
}
@@ -445,11 +445,11 @@ static int seq_is_parent(Sequence *par, Sequence *seq)
static int seq_is_predecessor(Sequence *pred, Sequence *seq)
{
if (!pred) return 0;
- if(pred == seq) return 0;
- else if(seq_is_parent(pred, seq)) return 1;
- else if(pred->seq1 && seq_is_predecessor(pred->seq1, seq)) return 1;
- else if(pred->seq2 && seq_is_predecessor(pred->seq2, seq)) return 1;
- else if(pred->seq3 && seq_is_predecessor(pred->seq3, seq)) return 1;
+ if (pred == seq) return 0;
+ else if (seq_is_parent(pred, seq)) return 1;
+ else if (pred->seq1 && seq_is_predecessor(pred->seq1, seq)) return 1;
+ else if (pred->seq2 && seq_is_predecessor(pred->seq2, seq)) return 1;
+ else if (pred->seq3 && seq_is_predecessor(pred->seq3, seq)) return 1;
return 0;
}
@@ -457,12 +457,13 @@ static int seq_is_predecessor(Sequence *pred, Sequence *seq)
void deselect_all_seq(Scene *scene)
{
Sequence *seq;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
- if(ed==NULL) return;
+ if (ed == NULL) return;
- SEQP_BEGIN(ed, seq) {
+ SEQP_BEGIN(ed, seq)
+ {
seq->flag &= ~SEQ_ALLSEL;
}
SEQ_END
@@ -473,49 +474,49 @@ void recurs_sel_seq(Sequence *seqm)
{
Sequence *seq;
- seq= seqm->seqbase.first;
- while(seq) {
+ seq = seqm->seqbase.first;
+ while (seq) {
- if(seqm->flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL)) seq->flag &= ~SEQ_ALLSEL;
- else if(seqm->flag & SELECT) seq->flag |= SELECT;
+ if (seqm->flag & (SEQ_LEFTSEL + SEQ_RIGHTSEL)) seq->flag &= ~SEQ_ALLSEL;
+ else if (seqm->flag & SELECT) seq->flag |= SELECT;
else seq->flag &= ~SEQ_ALLSEL;
- if(seq->seqbase.first) recurs_sel_seq(seq);
+ if (seq->seqbase.first) recurs_sel_seq(seq);
- seq= seq->next;
+ seq = seq->next;
}
}
int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequence **selseq1, Sequence **selseq2, Sequence **selseq3, const char **error_str)
{
Editing *ed = seq_give_editing(scene, FALSE);
- Sequence *seq1= NULL, *seq2= NULL, *seq3= NULL, *seq;
+ Sequence *seq1 = NULL, *seq2 = NULL, *seq3 = NULL, *seq;
- *error_str= NULL;
+ *error_str = NULL;
if (!activeseq)
- seq2= seq_active_get(scene);
+ seq2 = seq_active_get(scene);
- for(seq=ed->seqbasep->first; seq; seq=seq->next) {
- if(seq->flag & SELECT) {
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if (seq->flag & SELECT) {
if (seq->type == SEQ_SOUND && get_sequence_effect_num_inputs(type) != 0) {
- *error_str= "Can't apply effects to audio sequence strips";
+ *error_str = "Can't apply effects to audio sequence strips";
return 0;
}
- if((seq != activeseq) && (seq != seq2)) {
- if(seq2 == NULL) seq2= seq;
- else if(seq1 == NULL) seq1= seq;
- else if(seq3 == NULL) seq3= seq;
- else {
- *error_str= "Can't apply effect to more than 3 sequence strips";
- return 0;
- }
+ if ((seq != activeseq) && (seq != seq2)) {
+ if (seq2 == NULL) seq2 = seq;
+ else if (seq1 == NULL) seq1 = seq;
+ else if (seq3 == NULL) seq3 = seq;
+ else {
+ *error_str = "Can't apply effect to more than 3 sequence strips";
+ return 0;
+ }
}
}
}
/* 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;
@@ -523,33 +524,33 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
}
- switch(get_sequence_effect_num_inputs(type)) {
- case 0:
- *selseq1 = *selseq2 = *selseq3 = NULL;
- return 1; /* succsess */
- case 1:
- if(seq2==NULL) {
- *error_str= "Need at least one selected sequence strip";
- return 0;
- }
- if(seq1==NULL) seq1= seq2;
- if(seq3==NULL) seq3= seq2;
- case 2:
- if(seq1==NULL || seq2==NULL) {
- *error_str= "Need 2 selected sequence strips";
- return 0;
- }
- if(seq3 == NULL) seq3= seq2;
+ switch (get_sequence_effect_num_inputs(type)) {
+ case 0:
+ *selseq1 = *selseq2 = *selseq3 = NULL;
+ return 1; /* succsess */
+ case 1:
+ if (seq2 == NULL) {
+ *error_str = "Need at least one selected sequence strip";
+ return 0;
+ }
+ if (seq1 == NULL) seq1 = seq2;
+ if (seq3 == NULL) seq3 = seq2;
+ case 2:
+ if (seq1 == NULL || seq2 == NULL) {
+ *error_str = "Need 2 selected sequence strips";
+ return 0;
+ }
+ if (seq3 == NULL) seq3 = seq2;
}
- if (seq1==NULL && seq2==NULL && seq3==NULL) {
- *error_str= "TODO: in what cases does this happen?";
+ if (seq1 == NULL && seq2 == NULL && seq3 == NULL) {
+ *error_str = "TODO: in what cases does this happen?";
return 0;
}
- *selseq1= seq1;
- *selseq2= seq2;
- *selseq3= seq3;
+ *selseq1 = seq1;
+ *selseq2 = seq2;
+ *selseq3 = seq3;
return 1;
}
@@ -559,34 +560,34 @@ 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)
+ if (!seq)
return NULL;
- else if(!(seq->type & SEQ_EFFECT))
- return ((seq->flag & SELECT)? NULL: seq);
- else if(!(seq->flag & SELECT)) {
+ else if (!(seq->type & SEQ_EFFECT))
+ return ((seq->flag & SELECT) ? NULL : seq);
+ else if (!(seq->flag & SELECT)) {
/* try to find replacement for effect inputs */
- seq1= del_seq_find_replace_recurs(scene, seq->seq1);
- seq2= del_seq_find_replace_recurs(scene, seq->seq2);
- seq3= del_seq_find_replace_recurs(scene, seq->seq3);
+ seq1 = del_seq_find_replace_recurs(scene, seq->seq1);
+ seq2 = del_seq_find_replace_recurs(scene, seq->seq2);
+ seq3 = del_seq_find_replace_recurs(scene, seq->seq3);
- if(seq1==seq->seq1 && seq2==seq->seq2 && seq3==seq->seq3);
- else if(seq1 || seq2 || seq3) {
- seq->seq1= (seq1)? seq1: (seq2)? seq2: seq3;
- seq->seq2= (seq2)? seq2: (seq1)? seq1: seq3;
- seq->seq3= (seq3)? seq3: (seq1)? seq1: seq2;
+ if (seq1 == seq->seq1 && seq2 == seq->seq2 && seq3 == seq->seq3) ;
+ else if (seq1 || seq2 || seq3) {
+ seq->seq1 = (seq1) ? seq1 : (seq2) ? seq2 : seq3;
+ seq->seq2 = (seq2) ? seq2 : (seq1) ? seq1 : seq3;
+ seq->seq3 = (seq3) ? seq3 : (seq1) ? seq1 : seq2;
update_changed_seq_and_deps(scene, seq, 1, 1);
}
else
- seq->flag |= SELECT; /* mark for delete */
+ seq->flag |= SELECT; /* mark for delete */
}
if (seq->flag & SELECT) {
- if((seq1 = del_seq_find_replace_recurs(scene, seq->seq1))) return seq1;
- if((seq2 = del_seq_find_replace_recurs(scene, seq->seq2))) return seq2;
- if((seq3 = del_seq_find_replace_recurs(scene, seq->seq3))) return seq3;
+ if ((seq1 = del_seq_find_replace_recurs(scene, seq->seq1))) return seq1;
+ if ((seq2 = del_seq_find_replace_recurs(scene, seq->seq2))) return seq2;
+ if ((seq3 = del_seq_find_replace_recurs(scene, seq->seq3))) return seq3;
else return NULL;
}
else
@@ -598,62 +599,63 @@ static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short de
Sequence *seq, *seqn;
Sequence *last_seq = seq_active_get(scene);
- seq= lb->first;
- while(seq) {
- seqn= seq->next;
- if((seq->flag & flag) || deleteall) {
+ seq = lb->first;
+ while (seq) {
+ seqn = seq->next;
+ if ((seq->flag & flag) || deleteall) {
BLI_remlink(lb, seq);
- if(seq==last_seq) seq_active_set(scene, NULL);
- if(seq->type==SEQ_META) recurs_del_seq_flag(scene, &seq->seqbase, flag, 1);
+ if (seq == last_seq) seq_active_set(scene, NULL);
+ if (seq->type == SEQ_META) recurs_del_seq_flag(scene, &seq->seqbase, flag, 1);
seq_free_sequence(scene, seq);
}
- seq= seqn;
+ seq = seqn;
}
}
-static Sequence *cut_seq_hard(Scene *scene, Sequence * seq, int cutframe)
+static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe)
{
TransSeq ts;
Sequence *seqn = NULL;
int skip_dup = FALSE;
/* backup values */
- ts.start= seq->start;
- ts.machine= seq->machine;
- ts.startstill= seq->startstill;
- ts.endstill= seq->endstill;
- ts.startdisp= seq->startdisp;
- ts.enddisp= seq->enddisp;
- ts.startofs= seq->startofs;
- ts.endofs= seq->endofs;
- ts.anim_startofs= seq->anim_startofs;
- ts.anim_endofs= seq->anim_endofs;
- ts.len= seq->len;
+ ts.start = seq->start;
+ ts.machine = seq->machine;
+ ts.startstill = seq->startstill;
+ ts.endstill = seq->endstill;
+ ts.startdisp = seq->startdisp;
+ ts.enddisp = seq->enddisp;
+ ts.startofs = seq->startofs;
+ ts.endofs = seq->endofs;
+ ts.anim_startofs = seq->anim_startofs;
+ ts.anim_endofs = seq->anim_endofs;
+ ts.len = seq->len;
/* First Strip! */
/* strips with extended stillfames before */
- if ((seq->startstill) && (cutframe <seq->start)) {
+ if ((seq->startstill) && (cutframe < seq->start)) {
/* don't do funny things with METAs ... */
if (seq->type == SEQ_META) {
skip_dup = TRUE;
seq->startstill = seq->start - cutframe;
- } else {
- seq->start= cutframe -1;
- seq->startstill= cutframe -seq->startdisp -1;
+ }
+ else {
+ seq->start = cutframe - 1;
+ seq->startstill = cutframe - seq->startdisp - 1;
seq->anim_endofs += seq->len - 1;
- seq->endstill= 0;
+ seq->endstill = 0;
}
}
/* normal strip */
- else if ((cutframe >=seq->start)&&(cutframe <=(seq->start+seq->len))) {
+ else if ((cutframe >= seq->start) && (cutframe <= (seq->start + seq->len))) {
seq->endofs = 0;
seq->endstill = 0;
- seq->anim_endofs += (seq->start+seq->len) - cutframe;
+ seq->anim_endofs += (seq->start + seq->len) - cutframe;
}
/* strips with extended stillframes after */
- else if (((seq->start+seq->len) < cutframe) && (seq->endstill)) {
+ else if (((seq->start + seq->len) < cutframe) && (seq->endstill)) {
seq->endstill -= seq->enddisp - cutframe;
/* don't do funny things with METAs ... */
if (seq->type == SEQ_META) {
@@ -663,7 +665,6 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence * seq, int cutframe)
reload_sequence_new_file(scene, seq, FALSE);
calc_sequence(scene, seq);
- new_tstripdata(seq);
if (!skip_dup) {
/* Duplicate AFTER the first change */
@@ -677,13 +678,13 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence * seq, int cutframe)
/* strips with extended stillframes before */
if ((seqn->startstill) && (cutframe == seqn->start + 1)) {
seqn->start = ts.start;
- seqn->startstill= ts.start- cutframe;
+ seqn->startstill = ts.start - cutframe;
seqn->anim_endofs = ts.anim_endofs;
seqn->endstill = ts.endstill;
}
/* normal strip */
- else if ((cutframe>=seqn->start)&&(cutframe<=(seqn->start+seqn->len))) {
+ else if ((cutframe >= seqn->start) && (cutframe <= (seqn->start + seqn->len))) {
seqn->start = cutframe;
seqn->startstill = 0;
seqn->startofs = 0;
@@ -694,61 +695,61 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence * seq, int cutframe)
}
/* strips with extended stillframes after */
- else if (((seqn->start+seqn->len) < cutframe) && (seqn->endstill)) {
+ else if (((seqn->start + seqn->len) < cutframe) && (seqn->endstill)) {
seqn->start = cutframe;
seqn->startofs = 0;
- seqn->anim_startofs += ts.len-1;
- seqn->endstill = ts.enddisp - cutframe -1;
+ seqn->anim_startofs += ts.len - 1;
+ seqn->endstill = ts.enddisp - cutframe - 1;
seqn->startstill = 0;
}
reload_sequence_new_file(scene, seqn, FALSE);
calc_sequence(scene, seqn);
- new_tstripdata(seqn);
}
return seqn;
}
-static Sequence *cut_seq_soft(Scene *scene, Sequence * seq, int cutframe)
+static Sequence *cut_seq_soft(Scene *scene, Sequence *seq, int cutframe)
{
TransSeq ts;
Sequence *seqn = NULL;
int skip_dup = FALSE;
/* backup values */
- ts.start= seq->start;
- ts.machine= seq->machine;
- ts.startstill= seq->startstill;
- ts.endstill= seq->endstill;
- ts.startdisp= seq->startdisp;
- ts.enddisp= seq->enddisp;
- ts.startofs= seq->startofs;
- ts.endofs= seq->endofs;
- ts.anim_startofs= seq->anim_startofs;
- ts.anim_endofs= seq->anim_endofs;
- ts.len= seq->len;
+ ts.start = seq->start;
+ ts.machine = seq->machine;
+ ts.startstill = seq->startstill;
+ ts.endstill = seq->endstill;
+ ts.startdisp = seq->startdisp;
+ ts.enddisp = seq->enddisp;
+ ts.startofs = seq->startofs;
+ ts.endofs = seq->endofs;
+ ts.anim_startofs = seq->anim_startofs;
+ ts.anim_endofs = seq->anim_endofs;
+ ts.len = seq->len;
/* First Strip! */
/* strips with extended stillfames before */
- if ((seq->startstill) && (cutframe <seq->start)) {
+ if ((seq->startstill) && (cutframe < seq->start)) {
/* don't do funny things with METAs ... */
if (seq->type == SEQ_META) {
skip_dup = TRUE;
seq->startstill = seq->start - cutframe;
- } else {
- seq->start= cutframe -1;
- seq->startstill= cutframe -seq->startdisp -1;
+ }
+ else {
+ seq->start = cutframe - 1;
+ seq->startstill = cutframe - seq->startdisp - 1;
seq->endofs = seq->len - 1;
- seq->endstill= 0;
+ seq->endstill = 0;
}
}
/* normal strip */
- else if ((cutframe >=seq->start)&&(cutframe <=(seq->start+seq->len))) {
- seq->endofs = (seq->start+seq->len) - cutframe;
+ else if ((cutframe >= seq->start) && (cutframe <= (seq->start + seq->len))) {
+ seq->endofs = (seq->start + seq->len) - cutframe;
}
/* strips with extended stillframes after */
- else if (((seq->start+seq->len) < cutframe) && (seq->endstill)) {
+ else if (((seq->start + seq->len) < cutframe) && (seq->endstill)) {
seq->endstill -= seq->enddisp - cutframe;
/* don't do funny things with METAs ... */
if (seq->type == SEQ_META) {
@@ -757,7 +758,6 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence * seq, int cutframe)
}
calc_sequence(scene, seq);
- new_tstripdata(seq);
if (!skip_dup) {
/* Duplicate AFTER the first change */
@@ -771,13 +771,13 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence * seq, int cutframe)
/* strips with extended stillframes before */
if ((seqn->startstill) && (cutframe == seqn->start + 1)) {
seqn->start = ts.start;
- seqn->startstill= ts.start- cutframe;
+ seqn->startstill = ts.start - cutframe;
seqn->endofs = ts.endofs;
seqn->endstill = ts.endstill;
}
/* normal strip */
- else if ((cutframe>=seqn->start)&&(cutframe<=(seqn->start+seqn->len))) {
+ else if ((cutframe >= seqn->start) && (cutframe <= (seqn->start + seqn->len))) {
seqn->startstill = 0;
seqn->startofs = cutframe - ts.start;
seqn->endofs = ts.endofs;
@@ -785,15 +785,14 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence * seq, int cutframe)
}
/* strips with extended stillframes after */
- else if (((seqn->start+seqn->len) < cutframe) && (seqn->endstill)) {
- seqn->start = cutframe - ts.len +1;
- seqn->startofs = ts.len-1;
- seqn->endstill = ts.enddisp - cutframe -1;
+ else if (((seqn->start + seqn->len) < cutframe) && (seqn->endstill)) {
+ seqn->start = cutframe - ts.len + 1;
+ seqn->startofs = ts.len - 1;
+ seqn->endstill = ts.enddisp - cutframe - 1;
seqn->startstill = 0;
}
calc_sequence(scene, seqn);
- new_tstripdata(seqn);
}
return seqn;
}
@@ -802,28 +801,31 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence * seq, int cutframe)
/* like duplicate, but only duplicate and cut overlapping strips,
* strips to the left of the cutframe are ignored and strips to the right are moved into the new list */
static int cut_seq_list(Scene *scene, ListBase *old, ListBase *new, int cutframe,
- Sequence * (*cut_seq)(Scene *, Sequence *, int))
+ Sequence * (*cut_seq)(Scene *, Sequence *, int))
{
int did_something = FALSE;
Sequence *seq, *seq_next_iter;
- seq= old->first;
+ seq = old->first;
- while(seq) {
+ while (seq) {
seq_next_iter = seq->next; /* we need this because we may remove seq */
- seq->tmp= NULL;
- if(seq->flag & SELECT) {
- if(cutframe > seq->startdisp &&
- cutframe < seq->enddisp) {
- Sequence * seqn = cut_seq(scene, seq, cutframe);
+ seq->tmp = NULL;
+ if (seq->flag & SELECT) {
+ if (cutframe > seq->startdisp &&
+ cutframe < seq->enddisp)
+ {
+ Sequence *seqn = cut_seq(scene, seq, cutframe);
if (seqn) {
BLI_addtail(new, seqn);
}
did_something = TRUE;
- } else if (seq->enddisp <= cutframe) {
+ }
+ else if (seq->enddisp <= cutframe) {
/* do nothing */
- } else if (seq->startdisp >= cutframe) {
+ }
+ else if (seq->startdisp >= cutframe) {
/* move into new list */
BLI_remlink(old, seq);
BLI_addtail(new, seq);
@@ -837,18 +839,18 @@ static int cut_seq_list(Scene *scene, ListBase *old, ListBase *new, int cutframe
static int insert_gap(Scene *scene, int gap, int cfra)
{
Sequence *seq;
- Editing *ed= seq_give_editing(scene, FALSE);
- int done=0;
+ Editing *ed = seq_give_editing(scene, FALSE);
+ int done = 0;
/* all strips >= cfra are shifted */
- if(ed==NULL) return 0;
+ if (ed == NULL) return 0;
SEQP_BEGIN(ed, seq) {
- if(seq->startdisp >= cfra) {
- seq->start+= gap;
+ if (seq->startdisp >= cfra) {
+ seq->start += gap;
calc_sequence(scene, seq);
- done= 1;
+ done = 1;
}
}
SEQ_END
@@ -856,24 +858,25 @@ static int insert_gap(Scene *scene, int gap, int cfra)
return done;
}
-static void UNUSED_FUNCTION(touch_seq_files)(Scene *scene)
+static void UNUSED_FUNCTION(touch_seq_files) (Scene * scene)
{
Sequence *seq;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
char str[256];
/* touch all strips with movies */
- if(ed==NULL) return;
+ if (ed == NULL) return;
- if(okee("Touch and print selected movies")==0) return;
+ // XXX25 if (okee("Touch and print selected movies")==0) return;
WM_cursor_wait(1);
- SEQP_BEGIN(ed, seq) {
- if(seq->flag & SELECT) {
- if(seq->type==SEQ_MOVIE) {
- if(seq->strip && seq->strip->stripdata) {
+ SEQP_BEGIN(ed, seq)
+ {
+ if (seq->flag & SELECT) {
+ if (seq->type == SEQ_MOVIE) {
+ if (seq->strip && seq->strip->stripdata) {
BLI_make_file_string(G.main->name, str, seq->strip->dir, seq->strip->stripdata->name);
BLI_file_touch(seq->name);
}
@@ -886,20 +889,21 @@ static void UNUSED_FUNCTION(touch_seq_files)(Scene *scene)
WM_cursor_wait(0);
}
-/*
+#if 0
static void set_filter_seq(Scene *scene)
{
Sequence *seq;
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
- if(ed==NULL) return;
+ if (ed == NULL) return;
- if(okee("Set Deinterlace")==0) return;
+ if (okee("Set Deinterlace") == 0) return;
- SEQP_BEGIN(ed, seq) {
- if(seq->flag & SELECT) {
- if(seq->type==SEQ_MOVIE) {
+ SEQP_BEGIN(ed, seq)
+ {
+ if (seq->flag & SELECT) {
+ if (seq->type == SEQ_MOVIE) {
seq->flag |= SEQ_FILTERY;
reload_sequence_new_file(scene, seq, FALSE);
calc_sequence(scene, seq);
@@ -909,16 +913,16 @@ static void set_filter_seq(Scene *scene)
}
SEQ_END
}
-*/
+#endif
-static void UNUSED_FUNCTION(seq_remap_paths)(Scene *scene)
+static void UNUSED_FUNCTION(seq_remap_paths) (Scene * scene)
{
Sequence *seq, *last_seq = seq_active_get(scene);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
char from[FILE_MAX], to[FILE_MAX], stripped[FILE_MAX];
- if(last_seq==NULL)
+ if (last_seq == NULL)
return;
BLI_strncpy(from, last_seq->strip->dir, sizeof(from));
@@ -929,16 +933,17 @@ static void UNUSED_FUNCTION(seq_remap_paths)(Scene *scene)
// XXX if (0==sbutton(to, 0, sizeof(to)-1, "To: "))
// return;
- if (strcmp(to, from)==0)
+ if (strcmp(to, from) == 0)
return;
- SEQP_BEGIN(ed, seq) {
- if(seq->flag & SELECT) {
- if(strncmp(seq->strip->dir, from, strlen(from))==0) {
+ SEQP_BEGIN(ed, seq)
+ {
+ if (seq->flag & SELECT) {
+ if (strncmp(seq->strip->dir, from, strlen(from)) == 0) {
printf("found %s\n", seq->strip->dir);
/* strip off the beginning */
- stripped[0]= 0;
+ stripped[0] = 0;
BLI_strncpy(stripped, seq->strip->dir + strlen(from), FILE_MAX);
/* new path */
@@ -952,25 +957,25 @@ static void UNUSED_FUNCTION(seq_remap_paths)(Scene *scene)
}
-static void UNUSED_FUNCTION(no_gaps)(Scene *scene)
+static void UNUSED_FUNCTION(no_gaps) (Scene * scene)
{
- Editing *ed= seq_give_editing(scene, FALSE);
- int cfra, first= 0, done;
+ Editing *ed = seq_give_editing(scene, FALSE);
+ int cfra, first = 0, done;
- if(ed==NULL) return;
+ if (ed == NULL) return;
- for(cfra= CFRA; cfra<=EFRA; cfra++) {
- if(first==0) {
- if( evaluate_seq_frame(scene, cfra) ) first= 1;
+ for (cfra = CFRA; cfra <= EFRA; cfra++) {
+ if (first == 0) {
+ if (evaluate_seq_frame(scene, cfra) ) first = 1;
}
else {
- done= 1;
- while( evaluate_seq_frame(scene, cfra) == 0) {
- done= insert_gap(scene, -1, cfra);
- if(done==0) break;
+ done = 1;
+ while (evaluate_seq_frame(scene, cfra) == 0) {
+ done = insert_gap(scene, -1, cfra);
+ if (done == 0) break;
}
- if(done==0) break;
+ if (done == 0) break;
}
}
@@ -980,7 +985,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 */
@@ -1001,20 +1006,20 @@ int sequencer_edit_poll(bContext *C)
int sequencer_strip_poll(bContext *C)
{
Editing *ed;
- return (((ed= seq_give_editing(CTX_data_scene(C), FALSE)) != NULL) && (ed->act_seq != NULL));
+ return (((ed = seq_give_editing(CTX_data_scene(C), FALSE)) != NULL) && (ed->act_seq != NULL));
}
int sequencer_strip_has_path_poll(bContext *C)
{
Editing *ed;
Sequence *seq;
- return (((ed= seq_give_editing(CTX_data_scene(C), FALSE)) != NULL) && ((seq= ed->act_seq) != NULL) && (SEQ_HAS_PATH(seq)));
+ return (((ed = seq_give_editing(CTX_data_scene(C), FALSE)) != NULL) && ((seq = ed->act_seq) != NULL) && (SEQ_HAS_PATH(seq)));
}
int sequencer_view_poll(bContext *C)
{
- SpaceSeq *sseq= CTX_wm_space_seq(C);
- Editing *ed= seq_give_editing(CTX_data_scene(C), FALSE);
+ SpaceSeq *sseq = CTX_wm_space_seq(C);
+ Editing *ed = seq_give_editing(CTX_data_scene(C), FALSE);
if (ed && sseq && (sseq->mainb == SEQ_DRAW_IMG_IMBUF))
return 1;
@@ -1024,27 +1029,30 @@ int sequencer_view_poll(bContext *C)
/* snap operator*/
static int sequencer_snap_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
int snap_frame;
- snap_frame= RNA_int_get(op->ptr, "frame");
+ snap_frame = RNA_int_get(op->ptr, "frame");
/* also check metas */
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- if (seq->flag & SELECT && !(seq->depth==0 && seq->flag & SEQ_LOCK) &&
- seq_tx_test(seq)) {
- if((seq->flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL))==0) {
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if (seq->flag & SELECT && !(seq->depth == 0 && seq->flag & SEQ_LOCK) &&
+ seq_tx_test(seq))
+ {
+ if ((seq->flag & (SEQ_LEFTSEL + SEQ_RIGHTSEL)) == 0) {
/* simple but no anim update */
/* seq->start= snap_frame-seq->startofs+seq->startstill; */
- seq_translate(scene, seq, (snap_frame-seq->startofs+seq->startstill) - seq->start);
- } else {
- if(seq->flag & SEQ_LEFTSEL) {
+ seq_translate(scene, seq, (snap_frame - seq->startofs + seq->startstill) - seq->start);
+ }
+ else {
+ if (seq->flag & SEQ_LEFTSEL) {
seq_tx_set_final_left(seq, snap_frame);
- } else { /* SEQ_RIGHTSEL */
+ }
+ else { /* SEQ_RIGHTSEL */
seq_tx_set_final_right(seq, snap_frame);
}
seq_tx_handle_xlimits(seq, seq->flag & SEQ_LEFTSEL, seq->flag & SEQ_RIGHTSEL);
@@ -1054,20 +1062,20 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op)
}
/* test for effects and overlap
- * dont use SEQP_BEGIN since that would be recursive */
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- if(seq->flag & SELECT && !(seq->depth==0 && seq->flag & SEQ_LOCK)) {
+ * don't use SEQP_BEGIN since that would be recursive */
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if (seq->flag & SELECT && !(seq->depth == 0 && seq->flag & SEQ_LOCK)) {
seq->flag &= ~SEQ_OVERLAP;
- if( seq_test_overlap(ed->seqbasep, seq) ) {
+ if (seq_test_overlap(ed->seqbasep, seq) ) {
shuffle_seq(ed->seqbasep, seq, scene);
}
}
- else if(seq->type & SEQ_EFFECT) {
- if(seq->seq1 && (seq->seq1->flag & SELECT))
+ else if (seq->type & SEQ_EFFECT) {
+ if (seq->seq1 && (seq->seq1->flag & SELECT))
calc_sequence(scene, seq);
- else if(seq->seq2 && (seq->seq2->flag & SELECT))
+ else if (seq->seq2 && (seq->seq2->flag & SELECT))
calc_sequence(scene, seq);
- else if(seq->seq3 && (seq->seq3->flag & SELECT))
+ else if (seq->seq3 && (seq->seq3->flag & SELECT))
calc_sequence(scene, seq);
}
}
@@ -1075,7 +1083,7 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op)
/* as last: */
sort_seq(scene);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -1086,7 +1094,7 @@ static int sequencer_snap_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev
int snap_frame;
- snap_frame= CFRA;
+ snap_frame = CFRA;
RNA_int_set(op->ptr, "frame", snap_frame);
return sequencer_snap_exec(C, op);
@@ -1095,17 +1103,17 @@ static int sequencer_snap_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev
void SEQUENCER_OT_snap(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Snap strips";
- ot->idname= "SEQUENCER_OT_snap";
- ot->description="Frame where selected strips will be snapped";
+ ot->name = "Snap strips";
+ ot->idname = "SEQUENCER_OT_snap";
+ ot->description = "Frame where selected strips will be snapped";
/* api callbacks */
- ot->invoke= sequencer_snap_invoke;
- ot->exec= sequencer_snap_exec;
- ot->poll= sequencer_edit_poll;
+ ot->invoke = sequencer_snap_invoke;
+ ot->exec = sequencer_snap_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_int(ot->srna, "frame", 0, INT_MIN, INT_MAX, "Frame", "Frame where selected strips will be snapped", INT_MIN, INT_MAX);
}
@@ -1113,28 +1121,28 @@ void SEQUENCER_OT_snap(struct wmOperatorType *ot)
/* mute operator */
static int sequencer_mute_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
int selected;
- selected= !RNA_boolean_get(op->ptr, "unselected");
+ selected = !RNA_boolean_get(op->ptr, "unselected");
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- if ((seq->flag & SEQ_LOCK)==0) {
- if(selected){ /* mute unselected */
- if(seq->flag & SELECT)
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if ((seq->flag & SEQ_LOCK) == 0) {
+ if (selected) { /* mute unselected */
+ if (seq->flag & SELECT)
seq->flag |= SEQ_MUTE;
}
else {
- if((seq->flag & SELECT)==0)
+ if ((seq->flag & SELECT) == 0)
seq->flag |= SEQ_MUTE;
}
}
}
seq_update_muting(ed);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -1142,16 +1150,16 @@ static int sequencer_mute_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_mute(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mute Strips";
- ot->idname= "SEQUENCER_OT_mute";
- ot->description="Mute selected strips";
+ ot->name = "Mute Strips";
+ ot->idname = "SEQUENCER_OT_mute";
+ ot->description = "Mute selected strips";
/* api callbacks */
- ot->exec= sequencer_mute_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_mute_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Mute unselected rather than selected strips");
}
@@ -1160,28 +1168,28 @@ void SEQUENCER_OT_mute(struct wmOperatorType *ot)
/* unmute operator */
static int sequencer_unmute_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
int selected;
- selected= !RNA_boolean_get(op->ptr, "unselected");
+ selected = !RNA_boolean_get(op->ptr, "unselected");
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- if ((seq->flag & SEQ_LOCK)==0) {
- if(selected){ /* unmute unselected */
- if(seq->flag & SELECT)
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if ((seq->flag & SEQ_LOCK) == 0) {
+ if (selected) { /* unmute unselected */
+ if (seq->flag & SELECT)
seq->flag &= ~SEQ_MUTE;
}
else {
- if((seq->flag & SELECT)==0)
+ if ((seq->flag & SELECT) == 0)
seq->flag &= ~SEQ_MUTE;
}
}
}
seq_update_muting(ed);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -1189,16 +1197,16 @@ static int sequencer_unmute_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_unmute(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Un-Mute Strips";
- ot->idname= "SEQUENCER_OT_unmute";
- ot->description="Un-Mute unselected rather than selected strips";
+ ot->name = "Un-Mute Strips";
+ ot->idname = "SEQUENCER_OT_unmute";
+ ot->description = "Un-Mute unselected rather than selected strips";
/* api callbacks */
- ot->exec= sequencer_unmute_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_unmute_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "UnMute unselected rather than selected strips");
}
@@ -1207,17 +1215,17 @@ void SEQUENCER_OT_unmute(struct wmOperatorType *ot)
/* lock operator */
static int sequencer_lock_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT) {
seq->flag |= SEQ_LOCK;
}
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -1225,32 +1233,32 @@ static int sequencer_lock_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_lock(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Lock Strips";
- ot->idname= "SEQUENCER_OT_lock";
- ot->description="Lock the active strip so that it can't be transformed";
+ ot->name = "Lock Strips";
+ ot->idname = "SEQUENCER_OT_lock";
+ ot->description = "Lock the active strip so that it can't be transformed";
/* api callbacks */
- ot->exec= sequencer_lock_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_lock_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* unlock operator */
static int sequencer_unlock_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT) {
seq->flag &= ~SEQ_LOCK;
}
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -1258,60 +1266,72 @@ static int sequencer_unlock_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_unlock(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "UnLock Strips";
- ot->idname= "SEQUENCER_OT_unlock";
- ot->description="Unlock the active strip so that it can't be transformed";
+ ot->name = "UnLock Strips";
+ ot->idname = "SEQUENCER_OT_unlock";
+ ot->description = "Unlock the active strip so that it can't be transformed";
/* api callbacks */
- ot->exec= sequencer_unlock_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_unlock_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* reload operator */
-static int sequencer_reload_exec(bContext *C, wmOperator *UNUSED(op))
+static int sequencer_reload_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
+ int adjust_length = RNA_boolean_get(op->ptr, "adjust_length");
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- if(seq->flag & SELECT) {
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if (seq->flag & SELECT) {
update_changed_seq_and_deps(scene, seq, 0, 1);
+ reload_sequence_new_file(scene, seq, !adjust_length);
+
+ if (adjust_length) {
+ if (seq_test_overlap(ed->seqbasep, seq))
+ shuffle_seq(ed->seqbasep, seq, scene);
+ }
}
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
void SEQUENCER_OT_reload(struct wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
- ot->name= "Reload Strips";
- ot->idname= "SEQUENCER_OT_reload";
- ot->description="Reload strips in the sequencer";
+ ot->name = "Reload Strips";
+ ot->idname = "SEQUENCER_OT_reload";
+ ot->description = "Reload strips in the sequencer";
/* api callbacks */
- ot->exec= sequencer_reload_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_reload_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER; /* no undo, the data changed is stored outside 'main' */
+ ot->flag = OPTYPE_REGISTER; /* no undo, the data changed is stored outside 'main' */
+
+ prop = RNA_def_boolean(ot->srna, "adjust_length", 0, "Adjust Length", "Adjust lenght of strips to their data length");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
/* reload operator */
static int sequencer_refresh_all_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -1319,30 +1339,30 @@ static int sequencer_refresh_all_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_refresh_all(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Refresh Sequencer";
- ot->idname= "SEQUENCER_OT_refresh_all";
- ot->description="Refresh the sequencer editor";
+ ot->name = "Refresh Sequencer";
+ ot->idname = "SEQUENCER_OT_refresh_all";
+ ot->description = "Refresh the sequencer editor";
/* api callbacks */
- ot->exec= sequencer_refresh_all_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_refresh_all_exec;
+ ot->poll = sequencer_edit_poll;
}
static int sequencer_reassign_inputs_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
Sequence *seq1, *seq2, *seq3, *last_seq = seq_active_get(scene);
const char *error_msg;
- if(!seq_effect_find_selected(scene, last_seq, last_seq->type, &seq1, &seq2, &seq3, &error_msg)) {
+ if (!seq_effect_find_selected(scene, last_seq, last_seq->type, &seq1, &seq2, &seq3, &error_msg)) {
BKE_report(op->reports, RPT_ERROR, error_msg);
return OPERATOR_CANCELLED;
}
/* see reassigning would create a cycle */
- if( seq_is_predecessor(seq1, last_seq) ||
- seq_is_predecessor(seq2, last_seq) ||
- seq_is_predecessor(seq3, last_seq)
- ) {
+ if (seq_is_predecessor(seq1, last_seq) ||
+ seq_is_predecessor(seq2, last_seq) ||
+ seq_is_predecessor(seq3, last_seq)
+ ) {
BKE_report(op->reports, RPT_ERROR, "Can't reassign inputs: no cycles allowed");
return OPERATOR_CANCELLED;
}
@@ -1353,19 +1373,19 @@ static int sequencer_reassign_inputs_exec(bContext *C, wmOperator *op)
update_changed_seq_and_deps(scene, last_seq, 1, 1);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
static int sequencer_effect_poll(bContext *C)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
- if(ed) {
- Sequence *last_seq= seq_active_get(scene);
- if(last_seq && (last_seq->type & SEQ_EFFECT)) {
+ if (ed) {
+ Sequence *last_seq = seq_active_get(scene);
+ if (last_seq && (last_seq->type & SEQ_EFFECT)) {
return 1;
}
}
@@ -1376,25 +1396,25 @@ static int sequencer_effect_poll(bContext *C)
void SEQUENCER_OT_reassign_inputs(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reassign Inputs";
- ot->idname= "SEQUENCER_OT_reassign_inputs";
- ot->description="Reassign the inputs for the effect strip";
+ ot->name = "Reassign Inputs";
+ ot->idname = "SEQUENCER_OT_reassign_inputs";
+ ot->description = "Reassign the inputs for the effect strip";
/* api callbacks */
- ot->exec= sequencer_reassign_inputs_exec;
- ot->poll= sequencer_effect_poll;
+ ot->exec = sequencer_reassign_inputs_exec;
+ ot->poll = sequencer_effect_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int sequencer_swap_inputs_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
Sequence *seq, *last_seq = seq_active_get(scene);
- if(last_seq->seq1==NULL || last_seq->seq2 == NULL) {
+ if (last_seq->seq1 == NULL || last_seq->seq2 == NULL) {
BKE_report(op->reports, RPT_ERROR, "No valid inputs to swap");
return OPERATOR_CANCELLED;
}
@@ -1405,23 +1425,23 @@ static int sequencer_swap_inputs_exec(bContext *C, wmOperator *op)
update_changed_seq_and_deps(scene, last_seq, 1, 1);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
void SEQUENCER_OT_swap_inputs(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Swap Inputs";
- ot->idname= "SEQUENCER_OT_swap_inputs";
- ot->description="Swap the first two inputs for the effect strip";
+ ot->name = "Swap Inputs";
+ ot->idname = "SEQUENCER_OT_swap_inputs";
+ ot->description = "Swap the first two inputs for the effect strip";
/* api callbacks */
- ot->exec= sequencer_swap_inputs_exec;
- ot->poll= sequencer_effect_poll;
+ ot->exec = sequencer_swap_inputs_exec;
+ ot->poll = sequencer_effect_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
@@ -1434,22 +1454,23 @@ static EnumPropertyItem prop_cut_types[] = {
static int sequencer_cut_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
int cut_side, cut_hard, cut_frame;
ListBase newlist;
int changed;
- cut_frame= RNA_int_get(op->ptr, "frame");
- cut_hard= RNA_enum_get(op->ptr, "type");
- cut_side= RNA_enum_get(op->ptr, "side");
+ cut_frame = RNA_int_get(op->ptr, "frame");
+ cut_hard = RNA_enum_get(op->ptr, "type");
+ cut_side = RNA_enum_get(op->ptr, "side");
- newlist.first= newlist.last= NULL;
+ newlist.first = newlist.last = NULL;
- if (cut_hard==SEQ_CUT_HARD) {
+ if (cut_hard == SEQ_CUT_HARD) {
changed = cut_seq_list(scene, ed->seqbasep, &newlist, cut_frame, cut_seq_hard);
- } else {
+ }
+ else {
changed = cut_seq_list(scene, ed->seqbasep, &newlist, cut_frame, cut_seq_soft);
}
@@ -1459,12 +1480,13 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op)
if (cut_side != SEQ_SIDE_BOTH) {
SEQP_BEGIN(ed, seq) {
- if (cut_side==SEQ_SIDE_LEFT) {
- if ( seq->startdisp >= cut_frame ) {
+ if (cut_side == SEQ_SIDE_LEFT) {
+ if (seq->startdisp >= cut_frame) {
seq->flag &= ~SEQ_ALLSEL;
}
- } else {
- if ( seq->enddisp <= cut_frame ) {
+ }
+ else {
+ if (seq->enddisp <= cut_frame) {
seq->flag &= ~SEQ_ALLSEL;
}
}
@@ -1475,8 +1497,8 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op)
sort_seq(scene);
}
- if(changed) {
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ if (changed) {
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
else {
@@ -1488,13 +1510,13 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op)
static int sequencer_cut_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
Scene *scene = CTX_data_scene(C);
- View2D *v2d= UI_view2d_fromcontext(C);
+ View2D *v2d = UI_view2d_fromcontext(C);
- int cut_side= SEQ_SIDE_BOTH;
- int cut_frame= CFRA;
+ int cut_side = SEQ_SIDE_BOTH;
+ int cut_frame = CFRA;
if (ED_operator_sequencer_active(C) && v2d)
- cut_side= mouse_frame_side(v2d, event->mval[0], cut_frame);
+ cut_side = mouse_frame_side(v2d, event->mval[0], cut_frame);
RNA_int_set(op->ptr, "frame", cut_frame);
RNA_enum_set(op->ptr, "side", cut_side);
@@ -1507,17 +1529,17 @@ static int sequencer_cut_invoke(bContext *C, wmOperator *op, wmEvent *event)
void SEQUENCER_OT_cut(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Cut Strips";
- ot->idname= "SEQUENCER_OT_cut";
- ot->description="Cut the selected strips";
+ ot->name = "Cut Strips";
+ ot->idname = "SEQUENCER_OT_cut";
+ ot->description = "Cut the selected strips";
/* api callbacks */
- ot->invoke= sequencer_cut_invoke;
- ot->exec= sequencer_cut_exec;
- ot->poll= sequencer_edit_poll;
+ ot->invoke = sequencer_cut_invoke;
+ ot->exec = sequencer_cut_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_int(ot->srna, "frame", 0, INT_MIN, INT_MAX, "Frame", "Frame where selected strips will be cut", INT_MIN, INT_MAX);
RNA_def_enum(ot->srna, "type", prop_cut_types, SEQ_CUT_SOFT, "Type", "The type of cut operation to perform on strips");
@@ -1527,37 +1549,37 @@ void SEQUENCER_OT_cut(struct wmOperatorType *ot)
/* duplicate operator */
static int apply_unique_name_cb(Sequence *seq, void *arg_pt)
{
- Scene *scene= (Scene *)arg_pt;
- char name[sizeof(seq->name)-2];
+ Scene *scene = (Scene *)arg_pt;
+ char name[sizeof(seq->name) - 2];
- strcpy(name, seq->name+2);
+ strcpy(name, seq->name + 2);
seqbase_unique_name_recursive(&scene->ed->seqbase, seq);
- seq_dupe_animdata(scene, name, seq->name+2);
+ seq_dupe_animdata(scene, name, seq->name + 2);
return 1;
}
static int sequencer_add_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
- ListBase nseqbase= {NULL, NULL};
+ ListBase nseqbase = {NULL, NULL};
- if(ed==NULL)
+ if (ed == NULL)
return OPERATOR_CANCELLED;
seqbase_dupli_recursive(scene, NULL, &nseqbase, ed->seqbasep, SEQ_DUPE_CONTEXT);
- if(nseqbase.first) {
- Sequence * seq= nseqbase.first;
+ if (nseqbase.first) {
+ Sequence *seq = nseqbase.first;
/* rely on the nseqbase list being added at the end */
BLI_movelisttolist(ed->seqbasep, &nseqbase);
- for( ; seq; seq= seq->next)
+ for (; seq; seq = seq->next)
seq_recursive_apply(seq, apply_unique_name_cb, scene);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -1577,17 +1599,17 @@ static int sequencer_add_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *
void SEQUENCER_OT_duplicate(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Duplicate Strips";
- ot->idname= "SEQUENCER_OT_duplicate";
- ot->description="Duplicate the selected strips";
+ ot->name = "Duplicate Strips";
+ ot->idname = "SEQUENCER_OT_duplicate";
+ ot->description = "Duplicate the selected strips";
/* api callbacks */
- ot->invoke= sequencer_add_duplicate_invoke;
- ot->exec= sequencer_add_duplicate_exec;
- ot->poll= ED_operator_sequencer_active;
+ ot->invoke = sequencer_add_duplicate_invoke;
+ ot->exec = sequencer_add_duplicate_exec;
+ ot->poll = ED_operator_sequencer_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* to give to transform */
RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", "");
@@ -1596,16 +1618,17 @@ void SEQUENCER_OT_duplicate(wmOperatorType *ot)
/* delete operator */
static int sequencer_delete_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
MetaStack *ms;
int nothingSelected = TRUE;
- seq=seq_active_get(scene);
+ seq = seq_active_get(scene);
if (seq && seq->flag & SELECT) { /* avoid a loop since this is likely to be selected */
nothingSelected = FALSE;
- } else {
+ }
+ else {
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT) {
nothingSelected = FALSE;
@@ -1618,29 +1641,28 @@ static int sequencer_delete_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
/* for effects, try to find a replacement input */
- for(seq=ed->seqbasep->first; seq; seq=seq->next)
- if((seq->type & SEQ_EFFECT) && !(seq->flag & SELECT))
+ for (seq = ed->seqbasep->first; seq; seq = seq->next)
+ if ((seq->type & SEQ_EFFECT) && !(seq->flag & SELECT))
del_seq_find_replace_recurs(scene, seq);
/* delete all selected strips */
recurs_del_seq_flag(scene, ed->seqbasep, SELECT, 0);
/* updates lengths etc */
- seq= ed->seqbasep->first;
- while(seq) {
+ seq = ed->seqbasep->first;
+ while (seq) {
calc_sequence(scene, seq);
- seq= seq->next;
+ seq = seq->next;
}
/* free parent metas */
- ms= ed->metastack.last;
- while(ms) {
- ms->parseq->strip->len= 0; /* force new alloc */
+ ms = ed->metastack.last;
+ while (ms) {
calc_sequence(scene, ms->parseq);
- ms= ms->prev;
+ ms = ms->prev;
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -1650,50 +1672,50 @@ void SEQUENCER_OT_delete(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Erase Strips";
- ot->idname= "SEQUENCER_OT_delete";
- ot->description="Erase selected strips from the sequencer";
+ ot->name = "Erase Strips";
+ ot->idname = "SEQUENCER_OT_delete";
+ ot->description = "Erase selected strips from the sequencer";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= sequencer_delete_exec;
- ot->poll= sequencer_edit_poll;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = sequencer_delete_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* offset clear operator */
static int sequencer_offset_clear_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
/* for effects, try to find a replacement input */
- for(seq=ed->seqbasep->first; seq; seq=seq->next) {
- if((seq->type & SEQ_EFFECT)==0 && (seq->flag & SELECT)) {
- seq->startofs= seq->endofs= seq->startstill= seq->endstill= 0;
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if ((seq->type & SEQ_EFFECT) == 0 && (seq->flag & SELECT)) {
+ seq->startofs = seq->endofs = seq->startstill = seq->endstill = 0;
}
}
/* updates lengths etc */
- seq= ed->seqbasep->first;
- while(seq) {
+ seq = ed->seqbasep->first;
+ while (seq) {
calc_sequence(scene, seq);
- seq= seq->next;
+ seq = seq->next;
}
- for(seq=ed->seqbasep->first; seq; seq=seq->next) {
- if((seq->type & SEQ_EFFECT)==0 && (seq->flag & SELECT)) {
- if(seq_test_overlap(ed->seqbasep, seq)) {
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if ((seq->type & SEQ_EFFECT) == 0 && (seq->flag & SELECT)) {
+ if (seq_test_overlap(ed->seqbasep, seq)) {
shuffle_seq(ed->seqbasep, seq, scene);
}
}
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -1703,39 +1725,39 @@ void SEQUENCER_OT_offset_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear Strip Offset";
- ot->idname= "SEQUENCER_OT_offset_clear";
- ot->description="Clear strip offsets from the start and end frames";
+ ot->name = "Clear Strip Offset";
+ ot->idname = "SEQUENCER_OT_offset_clear";
+ ot->description = "Clear strip offsets from the start and end frames";
/* api callbacks */
- ot->exec= sequencer_offset_clear_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_offset_clear_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* separate_images operator */
static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq, *seq_new;
Strip *strip_new;
StripElem *se, *se_new;
int start_ofs, cfra, frame_end;
- int step= RNA_int_get(op->ptr, "length");
+ int step = RNA_int_get(op->ptr, "length");
- seq= ed->seqbasep->first; /* poll checks this is valid */
+ seq = ed->seqbasep->first; /* poll checks this is valid */
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 */
+ if ((seq->flag & SELECT) && (seq->type == SEQ_IMAGE) && (seq->len > 1)) {
+ /* remove seq so overlap tests don't conflict,
+ * see seq_free_sequence below for the real free'ing */
BLI_remlink(ed->seqbasep, seq);
- /* if(seq->ipo) seq->ipo->id.us--; */
+ /* if (seq->ipo) seq->ipo->id.us--; */
/* XXX, remove fcurve and assign to split image strips */
start_ofs = cfra = seq_tx_get_final_left(seq, 0);
@@ -1745,25 +1767,24 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
/* new seq */
se = give_stripelem(seq, cfra);
- seq_new= seq_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME);
+ seq_new = seq_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME);
BLI_addtail(ed->seqbasep, seq_new);
- seq_new->start= start_ofs;
- seq_new->type= SEQ_IMAGE;
+ seq_new->start = start_ofs;
+ seq_new->type = SEQ_IMAGE;
seq_new->len = 1;
- seq_new->endstill = step-1;
+ seq_new->endstill = step - 1;
/* new strip */
- strip_new= seq_new->strip;
- strip_new->len= 1;
- strip_new->us= 1;
+ strip_new = seq_new->strip;
+ strip_new->us = 1;
/* new stripdata */
- se_new= strip_new->stripdata;
+ se_new = strip_new->stripdata;
BLI_strncpy(se_new->name, se->name, sizeof(se_new->name));
calc_sequence(scene, seq_new);
- if(step > 1) {
+ if (step > 1) {
seq_new->flag &= ~SEQ_OVERLAP;
if (seq_test_overlap(ed->seqbasep, seq_new)) {
shuffle_seq(ed->seqbasep, seq_new, scene);
@@ -1778,7 +1799,8 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
seq_free_sequence(scene, seq);
seq = seq->next;
- } else {
+ }
+ else {
seq = seq->next;
}
}
@@ -1786,7 +1808,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
/* as last: */
sort_seq(scene);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -1795,16 +1817,16 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_images_separate(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Separate Images";
- ot->idname= "SEQUENCER_OT_images_separate";
- ot->description="On image sequence strips, it returns a strip for each image";
+ ot->name = "Separate Images";
+ ot->idname = "SEQUENCER_OT_images_separate";
+ ot->description = "On image sequence strips, it returns a strip for each image";
/* api callbacks */
- ot->exec= sequencer_separate_images_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_separate_images_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_int(ot->srna, "length", 1, 1, 1000, "Length", "Length of each frame", 1, INT_MAX);
}
@@ -1815,19 +1837,19 @@ void SEQUENCER_OT_images_separate(wmOperatorType *ot)
/* separate_meta_toggle operator */
static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
- Sequence *last_seq= seq_active_get(scene);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
+ Sequence *last_seq = seq_active_get(scene);
MetaStack *ms;
- if(last_seq && last_seq->type==SEQ_META && last_seq->flag & SELECT) {
+ if (last_seq && last_seq->type == SEQ_META && last_seq->flag & SELECT) {
/* Enter Metastrip */
- ms= MEM_mallocN(sizeof(MetaStack), "metastack");
+ ms = MEM_mallocN(sizeof(MetaStack), "metastack");
BLI_addtail(&ed->metastack, ms);
- ms->parseq= last_seq;
- ms->oldbasep= ed->seqbasep;
+ ms->parseq = last_seq;
+ ms->oldbasep = ed->seqbasep;
- ed->seqbasep= &last_seq->seqbase;
+ ed->seqbasep = &last_seq->seqbase;
seq_active_set(scene, NULL);
@@ -1837,16 +1859,16 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op))
Sequence *seq;
- if(ed->metastack.first==NULL)
+ if (ed->metastack.first == NULL)
return OPERATOR_CANCELLED;
- ms= ed->metastack.last;
+ ms = ed->metastack.last;
BLI_remlink(&ed->metastack, ms);
- ed->seqbasep= ms->oldbasep;
+ ed->seqbasep = ms->oldbasep;
/* recalc all: the meta can have effects connected to it */
- for(seq= ed->seqbasep->first; seq; seq= seq->next)
+ for (seq = ed->seqbasep->first; seq; seq = seq->next)
calc_sequence(scene, seq);
seq_active_set(scene, ms->parseq);
@@ -1859,7 +1881,7 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op))
}
seq_update_muting(ed);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -1867,66 +1889,65 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_meta_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Meta Strip";
- ot->idname= "SEQUENCER_OT_meta_toggle";
- ot->description="Toggle a metastrip (to edit enclosed strips)";
+ ot->name = "Toggle Meta Strip";
+ ot->idname = "SEQUENCER_OT_meta_toggle";
+ ot->description = "Toggle a metastrip (to edit enclosed strips)";
/* api callbacks */
- ot->exec= sequencer_meta_toggle_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_meta_toggle_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* separate_meta_make operator */
static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq, *seqm, *next, *last_seq = seq_active_get(scene);
- int channel_max= 1;
+ int channel_max = 1;
- if(seqbase_isolated_sel_check(ed->seqbasep)==FALSE) {
+ if (seqbase_isolated_sel_check(ed->seqbasep) == FALSE) {
BKE_report(op->reports, RPT_ERROR, "Please select all related strips");
return OPERATOR_CANCELLED;
}
/* remove all selected from main list, and put in meta */
- seqm= alloc_sequence(ed->seqbasep, 1, 1); /* channel number set later */
- strcpy(seqm->name+2, "MetaStrip");
- seqm->type= SEQ_META;
- seqm->flag= SELECT;
+ seqm = alloc_sequence(ed->seqbasep, 1, 1); /* channel number set later */
+ strcpy(seqm->name + 2, "MetaStrip");
+ seqm->type = SEQ_META;
+ seqm->flag = SELECT;
- seq= ed->seqbasep->first;
- while(seq) {
- next= seq->next;
- if(seq!=seqm && (seq->flag & SELECT)) {
- channel_max= MAX2(seq->machine, channel_max);
+ seq = ed->seqbasep->first;
+ while (seq) {
+ next = seq->next;
+ if (seq != seqm && (seq->flag & SELECT)) {
+ channel_max = MAX2(seq->machine, channel_max);
BLI_remlink(ed->seqbasep, seq);
BLI_addtail(&seqm->seqbase, seq);
}
- seq= next;
+ seq = next;
}
- seqm->machine= last_seq ? last_seq->machine : channel_max;
+ seqm->machine = last_seq ? last_seq->machine : channel_max;
calc_sequence(scene, seqm);
- seqm->strip= MEM_callocN(sizeof(Strip), "metastrip");
- seqm->strip->len= seqm->len;
- seqm->strip->us= 1;
+ seqm->strip = MEM_callocN(sizeof(Strip), "metastrip");
+ seqm->strip->us = 1;
seq_active_set(scene, seqm);
- if( seq_test_overlap(ed->seqbasep, seqm) ) shuffle_seq(ed->seqbasep, seqm, scene);
+ if (seq_test_overlap(ed->seqbasep, seqm) ) shuffle_seq(ed->seqbasep, seqm, scene);
seq_update_muting(ed);
seqbase_unique_name_recursive(&scene->ed->seqbase, seqm);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -1934,17 +1955,17 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_meta_make(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Make Meta Strip";
- ot->idname= "SEQUENCER_OT_meta_make";
- ot->description="Group selected strips into a metastrip";
+ ot->name = "Make Meta Strip";
+ ot->idname = "SEQUENCER_OT_meta_make";
+ ot->description = "Group selected strips into a metastrip";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= sequencer_meta_make_exec;
- ot->poll= sequencer_edit_poll;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = sequencer_meta_make_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
@@ -1960,35 +1981,35 @@ static int seq_depends_on_meta(Sequence *seq, Sequence *seqm)
/* separate_meta_make operator */
static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq, *last_seq = seq_active_get(scene); /* last_seq checks ed==NULL */
- if(last_seq==NULL || last_seq->type!=SEQ_META)
+ if (last_seq == NULL || last_seq->type != SEQ_META)
return OPERATOR_CANCELLED;
BLI_movelisttolist(ed->seqbasep, &last_seq->seqbase);
- last_seq->seqbase.first= NULL;
- last_seq->seqbase.last= NULL;
+ last_seq->seqbase.first = NULL;
+ last_seq->seqbase.last = NULL;
BLI_remlink(ed->seqbasep, last_seq);
seq_free_sequence(scene, last_seq);
/* emtpy meta strip, delete all effects depending on it */
- for(seq=ed->seqbasep->first; seq; seq=seq->next)
- if((seq->type & SEQ_EFFECT) && seq_depends_on_meta(seq, last_seq))
+ for (seq = ed->seqbasep->first; seq; seq = seq->next)
+ if ((seq->type & SEQ_EFFECT) && seq_depends_on_meta(seq, last_seq))
seq->flag |= SEQ_FLAG_DELETE;
recurs_del_seq_flag(scene, ed->seqbasep, SEQ_FLAG_DELETE, 0);
/* test for effects and overlap
- * dont use SEQP_BEGIN since that would be recursive */
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- if(seq->flag & SELECT) {
+ * don't use SEQP_BEGIN since that would be recursive */
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if (seq->flag & SELECT) {
seq->flag &= ~SEQ_OVERLAP;
- if(seq_test_overlap(ed->seqbasep, seq)) {
+ if (seq_test_overlap(ed->seqbasep, seq)) {
shuffle_seq(ed->seqbasep, seq, scene);
}
}
@@ -1997,7 +2018,7 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
sort_seq(scene);
seq_update_muting(ed);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -2005,29 +2026,29 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_meta_separate(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "UnMeta Strip";
- ot->idname= "SEQUENCER_OT_meta_separate";
- ot->description="Put the contents of a metastrip back in the sequencer";
+ ot->name = "UnMeta Strip";
+ ot->idname = "SEQUENCER_OT_meta_separate";
+ ot->description = "Put the contents of a metastrip back in the sequencer";
/* api callbacks */
- ot->invoke= WM_operator_confirm;
- ot->exec= sequencer_meta_separate_exec;
- ot->poll= sequencer_edit_poll;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = sequencer_meta_separate_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* view_all operator */
static int sequencer_view_all_exec(bContext *C, wmOperator *UNUSED(op))
{
//Scene *scene= CTX_data_scene(C);
- bScreen *sc= CTX_wm_screen(C);
- ScrArea *area= CTX_wm_area(C);
+ bScreen *sc = CTX_wm_screen(C);
+ ScrArea *area = CTX_wm_area(C);
//ARegion *ar= CTX_wm_region(C);
- View2D *v2d= UI_view2d_fromcontext(C);
+ View2D *v2d = UI_view2d_fromcontext(C);
- v2d->cur= v2d->tot;
+ v2d->cur = v2d->tot;
UI_view2d_curRect_validate(v2d);
UI_view2d_sync(sc, area, v2d, V2D_LOCK_COPY);
@@ -2038,31 +2059,31 @@ static int sequencer_view_all_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_view_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View All";
- ot->idname= "SEQUENCER_OT_view_all";
- ot->description="View all the strips in the sequencer";
+ ot->name = "View All";
+ ot->idname = "SEQUENCER_OT_view_all";
+ ot->description = "View all the strips in the sequencer";
/* api callbacks */
- ot->exec= sequencer_view_all_exec;
- ot->poll= ED_operator_sequencer_active;
+ ot->exec = sequencer_view_all_exec;
+ ot->poll = ED_operator_sequencer_active;
/* flags */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
}
/* view_all operator */
static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op))
{
- bScreen *sc= CTX_wm_screen(C);
- ScrArea *area= CTX_wm_area(C);
+ bScreen *sc = CTX_wm_screen(C);
+ ScrArea *area = CTX_wm_area(C);
#if 0
- ARegion *ar= CTX_wm_region(C);
- SpaceSeq *sseq= area->spacedata.first;
- Scene *scene= CTX_data_scene(C);
+ ARegion *ar = CTX_wm_region(C);
+ SpaceSeq *sseq = area->spacedata.first;
+ Scene *scene = CTX_data_scene(C);
#endif
- View2D *v2d= UI_view2d_fromcontext(C);
+ View2D *v2d = UI_view2d_fromcontext(C);
- v2d->cur= v2d->tot;
+ v2d->cur = v2d->tot;
UI_view2d_curRect_validate(v2d);
UI_view2d_sync(sc, area, v2d, V2D_LOCK_COPY);
@@ -2076,24 +2097,24 @@ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op))
seq_reset_imageofs(sseq);
- imgwidth= (scene->r.size*scene->r.xsch)/100;
- imgheight= (scene->r.size*scene->r.ysch)/100;
+ imgwidth = (scene->r.size * scene->r.xsch) / 100;
+ imgheight = (scene->r.size * scene->r.ysch) / 100;
/* Apply aspect, dosnt need to be that accurate */
- imgwidth= (int)(imgwidth * (scene->r.xasp / scene->r.yasp));
+ imgwidth = (int)(imgwidth * (scene->r.xasp / scene->r.yasp));
if (((imgwidth >= width) || (imgheight >= height)) &&
- ((width > 0) && (height > 0))) {
+ ((width > 0) && (height > 0))) {
/* Find the zoom value that will fit the image in the image space */
zoomX = ((float)width) / ((float)imgwidth);
zoomY = ((float)height) / ((float)imgheight);
- sseq->zoom= (zoomX < zoomY) ? zoomX : zoomY;
+ sseq->zoom = (zoomX < zoomY) ? zoomX : zoomY;
- sseq->zoom = 1.0f / power_of_2(1/ MIN2(zoomX, zoomY) );
+ sseq->zoom = 1.0f / power_of_2(1 / MIN2(zoomX, zoomY) );
}
else {
- sseq->zoom= 1.0f;
+ sseq->zoom = 1.0f;
}
#endif
@@ -2104,33 +2125,33 @@ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_view_all_preview(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View All";
- ot->idname= "SEQUENCER_OT_view_all_preview";
- ot->description="Zoom preview to fit in the area";
+ ot->name = "View All";
+ ot->idname = "SEQUENCER_OT_view_all_preview";
+ ot->description = "Zoom preview to fit in the area";
/* api callbacks */
- ot->exec= sequencer_view_all_preview_exec;
- ot->poll= ED_operator_sequencer_active;
+ ot->exec = sequencer_view_all_preview_exec;
+ ot->poll = ED_operator_sequencer_active;
/* flags */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
}
static int sequencer_view_zoom_ratio_exec(bContext *C, wmOperator *op)
{
- RenderData *r= &CTX_data_scene(C)->r;
- View2D *v2d= UI_view2d_fromcontext(C);
+ RenderData *r = &CTX_data_scene(C)->r;
+ View2D *v2d = UI_view2d_fromcontext(C);
- float ratio= RNA_float_get(op->ptr, "ratio");
+ float ratio = RNA_float_get(op->ptr, "ratio");
- float winx= (int)(r->size * r->xsch)/100;
- float winy= (int)(r->size * r->ysch)/100;
+ float winx = (int)(r->size * r->xsch) / 100;
+ float winy = (int)(r->size * r->ysch) / 100;
- float facx= (v2d->mask.xmax - v2d->mask.xmin) / winx;
- float facy= (v2d->mask.ymax - v2d->mask.ymin) / winy;
+ float facx = (v2d->mask.xmax - v2d->mask.xmin) / winx;
+ float facy = (v2d->mask.ymax - v2d->mask.ymin) / winy;
- BLI_resize_rctf(&v2d->cur, (int)(winx*facx*ratio) + 1, (int)(winy*facy*ratio) + 1);
+ BLI_resize_rctf(&v2d->cur, (int)(winx * facx * ratio) + 1, (int)(winy * facy * ratio) + 1);
ED_region_tag_redraw(CTX_wm_region(C));
@@ -2140,32 +2161,33 @@ static int sequencer_view_zoom_ratio_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_view_zoom_ratio(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Sequencer View Zoom Ratio";
- ot->idname= "SEQUENCER_OT_view_zoom_ratio";
+ ot->name = "Sequencer View Zoom Ratio";
+ ot->idname = "SEQUENCER_OT_view_zoom_ratio";
ot->description = "Change zoom ratio of sequencer preview";
/* api callbacks */
- ot->exec= sequencer_view_zoom_ratio_exec;
- ot->poll= ED_operator_sequencer_active;
+ ot->exec = sequencer_view_zoom_ratio_exec;
+ ot->poll = ED_operator_sequencer_active;
/* properties */
RNA_def_float(ot->srna, "ratio", 1.0f, 0.0f, FLT_MAX,
- "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX);
+ "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX);
}
#if 0
static EnumPropertyItem view_type_items[] = {
- {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
- {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""},
- {SEQ_VIEW_SEQUENCE_PREVIEW, "SEQUENCER_PREVIEW", ICON_SEQ_SEQUENCER, "Sequencer and Image Preview", ""},
- {0, NULL, 0, NULL, NULL}};
+ {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
+ {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""},
+ {SEQ_VIEW_SEQUENCE_PREVIEW, "SEQUENCER_PREVIEW", ICON_SEQ_SEQUENCER, "Sequencer and Image Preview", ""},
+ {0, NULL, 0, NULL, NULL}
+};
#endif
/* view_all operator */
static int sequencer_view_toggle_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceSeq *sseq= (SpaceSeq *)CTX_wm_space_data(C);
+ SpaceSeq *sseq = (SpaceSeq *)CTX_wm_space_data(C);
sseq->view++;
if (sseq->view > SEQ_VIEW_SEQUENCE_PREVIEW) sseq->view = SEQ_VIEW_SEQUENCE;
@@ -2178,48 +2200,48 @@ static int sequencer_view_toggle_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_view_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Toggle";
- ot->idname= "SEQUENCER_OT_view_toggle";
- ot->description="Toggle between sequencer views (sequence, preview, both)";
+ ot->name = "View Toggle";
+ ot->idname = "SEQUENCER_OT_view_toggle";
+ ot->description = "Toggle between sequencer views (sequence, preview, both)";
/* api callbacks */
- ot->exec= sequencer_view_toggle_exec;
- ot->poll= ED_operator_sequencer_active;
+ ot->exec = sequencer_view_toggle_exec;
+ ot->poll = ED_operator_sequencer_active;
/* flags */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
}
/* view_selected operator */
static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- View2D *v2d= UI_view2d_fromcontext(C);
- ScrArea *area= CTX_wm_area(C);
- bScreen *sc= CTX_wm_screen(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ View2D *v2d = UI_view2d_fromcontext(C);
+ ScrArea *area = CTX_wm_area(C);
+ bScreen *sc = CTX_wm_screen(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
- int xmin= MAXFRAME*2;
- int xmax= -MAXFRAME*2;
- int ymin= MAXSEQ+1;
- int ymax= 0;
+ int xmin = MAXFRAME * 2;
+ int xmax = -MAXFRAME * 2;
+ int ymin = MAXSEQ + 1;
+ int ymax = 0;
int orig_height;
int ymid;
- int ymargin= 1;
- int xmargin= FPS;
+ int ymargin = 1;
+ int xmargin = FPS;
- if(ed==NULL)
+ if (ed == NULL)
return OPERATOR_CANCELLED;
- for(seq=ed->seqbasep->first; seq; seq=seq->next) {
- if(seq->flag & SELECT) {
- xmin= MIN2(xmin, seq->startdisp);
- xmax= MAX2(xmax, seq->enddisp);
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if (seq->flag & SELECT) {
+ xmin = MIN2(xmin, seq->startdisp);
+ xmax = MAX2(xmax, seq->enddisp);
- ymin= MIN2(ymin, seq->machine);
- ymax= MAX2(ymax, seq->machine);
+ ymin = MIN2(ymin, seq->machine);
+ ymax = MAX2(ymax, seq->machine);
}
}
@@ -2230,20 +2252,20 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op))
ymax += ymargin;
ymin -= ymargin;
- orig_height= v2d->cur.ymax - v2d->cur.ymin;
+ orig_height = v2d->cur.ymax - v2d->cur.ymin;
- v2d->cur.xmin= xmin;
- v2d->cur.xmax= xmax;
+ v2d->cur.xmin = xmin;
+ v2d->cur.xmax = xmax;
- v2d->cur.ymin= ymin;
- v2d->cur.ymax= ymax;
+ v2d->cur.ymin = ymin;
+ v2d->cur.ymax = ymax;
/* only zoom out vertically */
if (orig_height > v2d->cur.ymax - v2d->cur.ymin) {
- ymid= (v2d->cur.ymax + v2d->cur.ymin) / 2;
+ ymid = (v2d->cur.ymax + v2d->cur.ymin) / 2;
- v2d->cur.ymin= ymid - (orig_height/2);
- v2d->cur.ymax= ymid + (orig_height/2);
+ v2d->cur.ymin = ymid - (orig_height / 2);
+ v2d->cur.ymax = ymid + (orig_height / 2);
}
UI_view2d_curRect_validate(v2d);
@@ -2258,31 +2280,31 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_view_selected(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Selected";
- ot->idname= "SEQUENCER_OT_view_selected";
- ot->description="Zoom the sequencer on the selected strips";
+ ot->name = "View Selected";
+ ot->idname = "SEQUENCER_OT_view_selected";
+ ot->description = "Zoom the sequencer on the selected strips";
/* api callbacks */
- ot->exec= sequencer_view_selected_exec;
- ot->poll= ED_operator_sequencer_active;
+ ot->exec = sequencer_view_selected_exec;
+ ot->poll = ED_operator_sequencer_active;
/* flags */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
}
static int find_next_prev_edit(Scene *scene, int cfra, int side)
{
- Editing *ed= seq_give_editing(scene, FALSE);
- Sequence *seq,*best_seq = NULL,*frame_seq = NULL;
+ Editing *ed = seq_give_editing(scene, FALSE);
+ Sequence *seq, *best_seq = NULL, *frame_seq = NULL;
int dist, best_dist;
- best_dist = MAXFRAME*2;
+ best_dist = MAXFRAME * 2;
- if(ed==NULL) return cfra;
+ if (ed == NULL) return cfra;
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- dist = MAXFRAME*2;
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ dist = MAXFRAME * 2;
switch (side) {
case SEQ_SIDE_LEFT:
@@ -2293,8 +2315,9 @@ static int find_next_prev_edit(Scene *scene, int cfra, int side)
case SEQ_SIDE_RIGHT:
if (seq->startdisp > cfra) {
dist = seq->startdisp - cfra;
- } else if (seq->startdisp == cfra) {
- frame_seq=seq;
+ }
+ else if (seq->startdisp == cfra) {
+ frame_seq = seq;
}
break;
}
@@ -2306,8 +2329,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;
@@ -2315,13 +2338,13 @@ static int find_next_prev_edit(Scene *scene, int cfra, int side)
static int next_prev_edit_internal(Scene *scene, int side)
{
- int change=0;
+ int change = 0;
int cfra = CFRA;
- int nfra= find_next_prev_edit(scene, cfra, side);
+ int nfra = find_next_prev_edit(scene, cfra, side);
if (nfra != cfra) {
CFRA = nfra;
- change= 1;
+ change = 1;
}
return change;
@@ -2330,12 +2353,12 @@ static int next_prev_edit_internal(Scene *scene, int side)
/* move frame to next edit point operator */
static int sequencer_next_edit_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
- if(!next_prev_edit_internal(scene, SEQ_SIDE_RIGHT))
+ if (!next_prev_edit_internal(scene, SEQ_SIDE_RIGHT))
return OPERATOR_CANCELLED;
- WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
return OPERATOR_FINISHED;
}
@@ -2343,16 +2366,16 @@ static int sequencer_next_edit_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_next_edit(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Next Edit";
- ot->idname= "SEQUENCER_OT_next_edit";
- ot->description="Move frame to next edit point";
+ ot->name = "Next Edit";
+ ot->idname = "SEQUENCER_OT_next_edit";
+ ot->description = "Move frame to next edit point";
/* api callbacks */
- ot->exec= sequencer_next_edit_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_next_edit_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
}
@@ -2360,12 +2383,12 @@ void SEQUENCER_OT_next_edit(wmOperatorType *ot)
/* move frame to previous edit point operator */
static int sequencer_previous_edit_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
- if(!next_prev_edit_internal(scene, SEQ_SIDE_LEFT))
+ if (!next_prev_edit_internal(scene, SEQ_SIDE_LEFT))
return OPERATOR_CANCELLED;
- WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
return OPERATOR_FINISHED;
}
@@ -2373,21 +2396,21 @@ static int sequencer_previous_edit_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_previous_edit(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Previous Edit";
- ot->idname= "SEQUENCER_OT_previous_edit";
- ot->description="Move frame to previous edit point";
+ ot->name = "Previous Edit";
+ ot->idname = "SEQUENCER_OT_previous_edit";
+ ot->description = "Move frame to previous edit point";
/* api callbacks */
- ot->exec= sequencer_previous_edit_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_previous_edit_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
}
-static void swap_sequence(Scene* scene, Sequence* seqa, Sequence* seqb)
+static void swap_sequence(Scene *scene, Sequence *seqa, Sequence *seqb)
{
int gap = seqb->startdisp - seqa->enddisp;
seqb->start = (seqb->start - seqb->startdisp) + seqa->startdisp;
@@ -2397,15 +2420,15 @@ static void swap_sequence(Scene* scene, Sequence* seqa, Sequence* seqb)
}
#if 0
-static Sequence* sequence_find_parent(Scene* scene, Sequence* child)
+static Sequence *sequence_find_parent(Scene *scene, Sequence *child)
{
- Editing *ed= seq_give_editing(scene, FALSE);
- Sequence *parent= NULL;
+ Editing *ed = seq_give_editing(scene, FALSE);
+ Sequence *parent = NULL;
Sequence *seq;
- if(ed==NULL) return NULL;
+ if (ed == NULL) return NULL;
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if ( (seq != child) && seq_is_parent(seq, child) ) {
parent = seq;
break;
@@ -2418,17 +2441,17 @@ static Sequence* sequence_find_parent(Scene* scene, Sequence* child)
static int sequencer_swap_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *active_seq = seq_active_get(scene);
Sequence *seq, *iseq;
- int side= RNA_enum_get(op->ptr, "side");
+ int side = RNA_enum_get(op->ptr, "side");
- if(active_seq==NULL) return OPERATOR_CANCELLED;
+ if (active_seq == NULL) return OPERATOR_CANCELLED;
seq = find_next_prev_sequence(scene, active_seq, side, -1);
- if(seq) {
+ if (seq) {
/* disallow effect strips */
if (get_sequence_effect_num_inputs(seq->type) >= 1 && (seq->effectdata || seq->seq1 || seq->seq2 || seq->seq3))
@@ -2446,17 +2469,17 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op)
}
// XXX - should be a generic function
- for(iseq= scene->ed->seqbasep->first; iseq; iseq= iseq->next) {
- if((iseq->type & SEQ_EFFECT) && (seq_is_parent(iseq, active_seq) || seq_is_parent(iseq, seq))) {
+ for (iseq = scene->ed->seqbasep->first; iseq; iseq = iseq->next) {
+ if ((iseq->type & SEQ_EFFECT) && (seq_is_parent(iseq, active_seq) || seq_is_parent(iseq, seq))) {
calc_sequence(scene, iseq);
}
}
/* do this in a new loop since both effects need to be calculated first */
- for(iseq= scene->ed->seqbasep->first; iseq; iseq= iseq->next) {
- if((iseq->type & SEQ_EFFECT) && (seq_is_parent(iseq, active_seq) || seq_is_parent(iseq, seq))) {
+ for (iseq = scene->ed->seqbasep->first; iseq; iseq = iseq->next) {
+ if ((iseq->type & SEQ_EFFECT) && (seq_is_parent(iseq, active_seq) || seq_is_parent(iseq, seq))) {
/* this may now overlap */
- if( seq_test_overlap(ed->seqbasep, iseq) ) {
+ if (seq_test_overlap(ed->seqbasep, iseq) ) {
shuffle_seq(ed->seqbasep, iseq, scene);
}
}
@@ -2466,7 +2489,7 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op)
sort_seq(scene);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -2477,16 +2500,16 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_swap(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Swap Strip";
- ot->idname= "SEQUENCER_OT_swap";
- ot->description="Swap active strip with strip to the right or left";
+ ot->name = "Swap Strip";
+ ot->idname = "SEQUENCER_OT_swap";
+ ot->description = "Swap active strip with strip to the right or left";
/* api callbacks */
- ot->exec= sequencer_swap_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_swap_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "side", prop_side_lr_types, SEQ_SIDE_RIGHT, "Side", "Side of the strip to swap");
@@ -2495,37 +2518,37 @@ void SEQUENCER_OT_swap(wmOperatorType *ot)
static int sequencer_rendersize_exec(bContext *C, wmOperator *UNUSED(op))
{
int retval = OPERATOR_CANCELLED;
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
Sequence *active_seq = seq_active_get(scene);
StripElem *se = NULL;
- if(active_seq==NULL)
+ if (active_seq == NULL)
return OPERATOR_CANCELLED;
if (active_seq->strip) {
switch (active_seq->type) {
- case SEQ_IMAGE:
- se = give_stripelem(active_seq, scene->r.cfra);
- break;
- case SEQ_MOVIE:
- se = active_seq->strip->stripdata;
- break;
- case SEQ_SCENE:
- case SEQ_META:
- case SEQ_RAM_SOUND:
- case SEQ_HD_SOUND:
- default:
- break;
+ case SEQ_IMAGE:
+ se = give_stripelem(active_seq, scene->r.cfra);
+ break;
+ case SEQ_MOVIE:
+ se = active_seq->strip->stripdata;
+ break;
+ case SEQ_SCENE:
+ case SEQ_META:
+ case SEQ_RAM_SOUND:
+ case SEQ_HD_SOUND:
+ default:
+ break;
}
}
if (se) {
// prevent setting the render size if sequence values aren't initialized
if ( (se->orig_width > 0) && (se->orig_height > 0) ) {
- scene->r.xsch= se->orig_width;
- scene->r.ysch= se->orig_height;
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
+ scene->r.xsch = se->orig_width;
+ scene->r.ysch = se->orig_height;
+ WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
retval = OPERATOR_FINISHED;
}
}
@@ -2536,29 +2559,29 @@ static int sequencer_rendersize_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_rendersize(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Render Size";
- ot->idname= "SEQUENCER_OT_rendersize";
- ot->description="Set render size and aspect from active sequence";
+ ot->name = "Set Render Size";
+ ot->idname = "SEQUENCER_OT_rendersize";
+ ot->description = "Set render size and aspect from active sequence";
/* api callbacks */
- ot->exec= sequencer_rendersize_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_rendersize_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
}
static void seq_copy_del_sound(Scene *scene, Sequence *seq)
{
- if(seq->type == SEQ_META) {
+ if (seq->type == SEQ_META) {
Sequence *iseq;
- for(iseq= seq->seqbase.first; iseq; iseq= iseq->next) {
+ for (iseq = seq->seqbase.first; iseq; iseq = iseq->next) {
seq_copy_del_sound(scene, iseq);
}
}
- else if(seq->scene_sound) {
+ else if (seq->scene_sound) {
sound_remove_scene_sound(scene, seq->scene_sound);
seq->scene_sound = NULL;
}
@@ -2567,15 +2590,15 @@ static void seq_copy_del_sound(Scene *scene, Sequence *seq)
/* TODO, validate scenes */
static int sequencer_copy_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
- ListBase nseqbase= {NULL, NULL};
+ ListBase nseqbase = {NULL, NULL};
seq_free_clipboard();
- if(seqbase_isolated_sel_check(ed->seqbasep)==FALSE) {
+ if (seqbase_isolated_sel_check(ed->seqbasep) == FALSE) {
BKE_report(op->reports, RPT_ERROR, "Please select all related strips");
return OPERATOR_CANCELLED;
}
@@ -2585,27 +2608,27 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op)
/* To make sure the copied strips have unique names between each other add
* them temporarily to the end of the original seqbase. (bug 25932)
*/
- if(nseqbase.first) {
+ if (nseqbase.first) {
Sequence *seq, *first_seq = nseqbase.first;
BLI_movelisttolist(ed->seqbasep, &nseqbase);
- for(seq=first_seq; seq; seq=seq->next)
+ for (seq = first_seq; seq; seq = seq->next)
seq_recursive_apply(seq, apply_unique_name_cb, scene);
seqbase_clipboard.first = first_seq;
seqbase_clipboard.last = ed->seqbasep->last;
- if(first_seq->prev) {
+ if (first_seq->prev) {
first_seq->prev->next = NULL;
ed->seqbasep->last = first_seq->prev;
first_seq->prev = NULL;
}
}
- seqbase_clipboard_frame= scene->r.cfra;
+ seqbase_clipboard_frame = scene->r.cfra;
/* Need to remove anything that references the current scene */
- for(seq= seqbase_clipboard.first; seq; seq= seq->next) {
+ for (seq = seqbase_clipboard.first; seq; seq = seq->next) {
seq_copy_del_sound(scene, seq);
}
@@ -2615,37 +2638,37 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_copy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy";
- ot->idname= "SEQUENCER_OT_copy";
- ot->description="";
+ ot->name = "Copy";
+ ot->idname = "SEQUENCER_OT_copy";
+ ot->description = "";
/* api callbacks */
- ot->exec= sequencer_copy_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_copy_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
/* properties */
}
static void seq_paste_add_sound(Scene *scene, Sequence *seq)
{
- if(seq->type == SEQ_META) {
+ if (seq->type == SEQ_META) {
Sequence *iseq;
- for(iseq= seq->seqbase.first; iseq; iseq= iseq->next) {
+ for (iseq = seq->seqbase.first; iseq; iseq = iseq->next) {
seq_paste_add_sound(scene, iseq);
}
}
- else if(seq->type == SEQ_SOUND) {
+ else if (seq->type == SEQ_SOUND) {
seq->scene_sound = sound_add_scene_sound_defaults(scene, seq);
}
}
static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, TRUE); /* create if needed */
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, TRUE); /* create if needed */
ListBase nseqbase = {NULL, NULL};
int ofs;
Sequence *iseq;
@@ -2656,8 +2679,8 @@ static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op))
seqbase_dupli_recursive(scene, NULL, &nseqbase, &seqbase_clipboard, SEQ_DUPE_UNIQUE_NAME);
/* transform pasted strips before adding */
- if(ofs) {
- for(iseq= nseqbase.first; iseq; iseq= iseq->next) {
+ if (ofs) {
+ for (iseq = nseqbase.first; iseq; iseq = iseq->next) {
seq_translate(scene, iseq, ofs);
seq_sound_init(scene, iseq);
}
@@ -2668,14 +2691,14 @@ static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op))
BLI_movelisttolist(ed->seqbasep, &nseqbase);
/* make sure the pasted strips have unique names between them */
- for(; iseq; iseq=iseq->next) {
+ for (; iseq; iseq = iseq->next) {
seq_recursive_apply(iseq, apply_unique_name_cb, scene);
/* restore valid sound_scene for newly added strips */
seq_paste_add_sound(scene, iseq);
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -2683,33 +2706,33 @@ static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_paste(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Paste";
- ot->idname= "SEQUENCER_OT_paste";
- ot->description="";
+ ot->name = "Paste";
+ ot->idname = "SEQUENCER_OT_paste";
+ ot->description = "";
/* api callbacks */
- ot->exec= sequencer_paste_exec;
- ot->poll= ED_operator_sequencer_active;
+ ot->exec = sequencer_paste_exec;
+ ot->poll = ED_operator_sequencer_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
}
static int sequencer_swap_data_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
Sequence *seq_act;
Sequence *seq_other;
const char *error_msg;
- if(seq_active_pair_get(scene, &seq_act, &seq_other) == 0) {
+ if (seq_active_pair_get(scene, &seq_act, &seq_other) == 0) {
BKE_report(op->reports, RPT_ERROR, "Must select 2 strips");
return OPERATOR_CANCELLED;
}
- if(seq_swap(seq_act, seq_other, &error_msg) == 0) {
+ if (seq_swap(seq_act, seq_other, &error_msg) == 0) {
BKE_report(op->reports, RPT_ERROR, error_msg);
return OPERATOR_CANCELLED;
}
@@ -2717,16 +2740,16 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op)
sound_remove_scene_sound(scene, seq_act->scene_sound);
sound_remove_scene_sound(scene, seq_other->scene_sound);
- seq_act->scene_sound= NULL;
- seq_other->scene_sound= NULL;
+ seq_act->scene_sound = NULL;
+ seq_other->scene_sound = NULL;
calc_sequence(scene, seq_act);
calc_sequence(scene, seq_other);
- if(seq_act->sound) sound_add_scene_sound_defaults(scene, seq_act);
- if(seq_other->sound) sound_add_scene_sound_defaults(scene, seq_other);
+ if (seq_act->sound) sound_add_scene_sound_defaults(scene, seq_act);
+ if (seq_other->sound) sound_add_scene_sound_defaults(scene, seq_other);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -2734,16 +2757,16 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_swap_data(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Sequencer Swap Data";
- ot->idname= "SEQUENCER_OT_swap_data";
- ot->description="Swap 2 sequencer strips";
+ ot->name = "Sequencer Swap Data";
+ ot->idname = "SEQUENCER_OT_swap_data";
+ ot->description = "Swap 2 sequencer strips";
/* api callbacks */
- ot->exec= sequencer_swap_data_exec;
- ot->poll= ED_operator_sequencer_active;
+ ot->exec = sequencer_swap_data_exec;
+ ot->poll = ED_operator_sequencer_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
}
@@ -2751,9 +2774,9 @@ void SEQUENCER_OT_swap_data(wmOperatorType *ot)
/* borderselect operator */
static int view_ghost_border_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
- View2D *v2d= UI_view2d_fromcontext(C);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
+ View2D *v2d = UI_view2d_fromcontext(C);
rctf rect;
@@ -2761,7 +2784,7 @@ static int view_ghost_border_exec(bContext *C, wmOperator *op)
UI_view2d_region_to_view(v2d, RNA_int_get(op->ptr, "xmin"), RNA_int_get(op->ptr, "ymin"), &rect.xmin, &rect.ymin);
UI_view2d_region_to_view(v2d, RNA_int_get(op->ptr, "xmax"), RNA_int_get(op->ptr, "ymax"), &rect.xmax, &rect.ymax);
- if(ed==NULL)
+ if (ed == NULL)
return OPERATOR_CANCELLED;
rect.xmin /= (float)(ABS(v2d->tot.xmax - v2d->tot.xmin));
@@ -2770,19 +2793,19 @@ static int view_ghost_border_exec(bContext *C, wmOperator *op)
rect.xmax /= (float)(ABS(v2d->tot.xmax - v2d->tot.xmin));
rect.ymax /= (float)(ABS(v2d->tot.ymax - v2d->tot.ymin));
- rect.xmin+=0.5f;
- rect.xmax+=0.5f;
- rect.ymin+=0.5f;
- rect.ymax+=0.5f;
+ rect.xmin += 0.5f;
+ rect.xmax += 0.5f;
+ rect.ymin += 0.5f;
+ rect.ymax += 0.5f;
CLAMP(rect.xmin, 0.0f, 1.0f);
CLAMP(rect.ymin, 0.0f, 1.0f);
CLAMP(rect.xmax, 0.0f, 1.0f);
CLAMP(rect.ymax, 0.0f, 1.0f);
- scene->ed->over_border= rect;
+ scene->ed->over_border = rect;
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -2791,19 +2814,19 @@ static int view_ghost_border_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_view_ghost_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Border Offset View";
- ot->idname= "SEQUENCER_OT_view_ghost_border";
- ot->description="Enable border select mode";
+ ot->name = "Border Offset View";
+ ot->idname = "SEQUENCER_OT_view_ghost_border";
+ ot->description = "Enable border select mode";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= view_ghost_border_exec;
- ot->modal= WM_border_select_modal;
- ot->poll= sequencer_view_poll;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = view_ghost_border_exec;
+ ot->modal = WM_border_select_modal;
+ ot->poll = sequencer_view_poll;
+ ot->cancel = WM_border_select_cancel;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
/* rna */
WM_operator_properties_gesture_border(ot, FALSE);
@@ -2820,16 +2843,16 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_rebuild_proxy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Rebuild Proxy and Timecode Indices";
- ot->idname= "SEQUENCER_OT_rebuild_proxy";
- ot->description="Rebuild all selected proxies and timecode indeces using the job system";
+ ot->name = "Rebuild Proxy and Timecode Indices";
+ ot->idname = "SEQUENCER_OT_rebuild_proxy";
+ ot->description = "Rebuild all selected proxies and timecode indeces using the job system";
/* api callbacks */
- ot->exec= sequencer_rebuild_proxy_exec;
- ot->poll= ED_operator_sequencer_active;
+ ot->exec = sequencer_rebuild_proxy_exec;
+ ot->poll = ED_operator_sequencer_active;
/* flags */
- ot->flag= OPTYPE_REGISTER;
+ ot->flag = OPTYPE_REGISTER;
}
/* change ops */
@@ -2843,28 +2866,28 @@ static EnumPropertyItem prop_change_effect_input_types[] = {
static int sequencer_change_effect_input_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
- Sequence *seq= seq_active_get(scene);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
+ Sequence *seq = seq_active_get(scene);
Sequence **seq_1, **seq_2;
- switch(RNA_enum_get(op->ptr, "swap")) {
+ switch (RNA_enum_get(op->ptr, "swap")) {
case 0:
- seq_1= &seq->seq1;
- seq_2= &seq->seq2;
+ seq_1 = &seq->seq1;
+ seq_2 = &seq->seq2;
break;
case 1:
- seq_1= &seq->seq2;
- seq_2= &seq->seq3;
+ seq_1 = &seq->seq2;
+ seq_2 = &seq->seq3;
break;
default: /* 2 */
- seq_1= &seq->seq1;
- seq_2= &seq->seq3;
+ seq_1 = &seq->seq1;
+ seq_2 = &seq->seq3;
break;
}
- if(*seq_1 == NULL || *seq_2 == NULL) {
+ if (*seq_1 == NULL || *seq_2 == NULL) {
BKE_report(op->reports, RPT_ERROR, "One of the effect inputs is unset, can't swap");
return OPERATOR_CANCELLED;
}
@@ -2874,10 +2897,10 @@ static int sequencer_change_effect_input_exec(bContext *C, wmOperator *op)
update_changed_seq_and_deps(scene, seq, 0, 1);
- /* important else we dont get the imbuf cache flushed */
+ /* important else we don't get the imbuf cache flushed */
free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -2885,26 +2908,26 @@ static int sequencer_change_effect_input_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_change_effect_input(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Change Effect Input";
- ot->idname= "SEQUENCER_OT_change_effect_input";
- ot->description="";
+ ot->name = "Change Effect Input";
+ ot->idname = "SEQUENCER_OT_change_effect_input";
+ ot->description = "";
/* api callbacks */
- ot->exec= sequencer_change_effect_input_exec;
- ot->poll= sequencer_effect_poll;
+ ot->exec = sequencer_change_effect_input_exec;
+ ot->poll = sequencer_effect_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- ot->prop= RNA_def_enum(ot->srna, "swap", prop_change_effect_input_types, 0, "Swap", "The effect inputs to swap");
+ ot->prop = RNA_def_enum(ot->srna, "swap", prop_change_effect_input_types, 0, "Swap", "The effect inputs to swap");
}
static int sequencer_change_effect_type_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
- Sequence *seq= seq_active_get(scene);
- const int new_type= RNA_enum_get(op->ptr, "type");
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
+ Sequence *seq = seq_active_get(scene);
+ const int new_type = RNA_enum_get(op->ptr, "type");
/* free previous effect and init new effect */
struct SeqEffectHandle sh;
@@ -2913,11 +2936,11 @@ 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)
- ) {
+ get_sequence_effect_num_inputs(new_type))
+ {
BKE_report(op->reports, RPT_ERROR, "New effect needs more input strips");
return OPERATOR_CANCELLED;
}
@@ -2925,7 +2948,7 @@ static int sequencer_change_effect_type_exec(bContext *C, wmOperator *op)
sh = get_sequence_effect(seq);
sh.free(seq);
- seq->type= new_type;
+ seq->type = new_type;
sh = get_sequence_effect(seq);
sh.init(seq);
@@ -2934,10 +2957,10 @@ static int sequencer_change_effect_type_exec(bContext *C, wmOperator *op)
/* update */
update_changed_seq_and_deps(scene, seq, 0, 1);
- /* important else we dont get the imbuf cache flushed */
+ /* important else we don't get the imbuf cache flushed */
free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -2945,34 +2968,34 @@ static int sequencer_change_effect_type_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_change_effect_type(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Change Effect Type";
- ot->idname= "SEQUENCER_OT_change_effect_type";
- ot->description="";
+ ot->name = "Change Effect Type";
+ ot->idname = "SEQUENCER_OT_change_effect_type";
+ ot->description = "";
/* api callbacks */
- ot->exec= sequencer_change_effect_type_exec;
- ot->poll= sequencer_effect_poll;
+ ot->exec = sequencer_change_effect_type_exec;
+ ot->poll = sequencer_effect_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- ot->prop= RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_CROSS, "Type", "Sequencer effect type");
+ ot->prop = RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_CROSS, "Type", "Sequencer effect type");
}
static int sequencer_change_path_exec(bContext *C, wmOperator *op)
{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
- Sequence *seq= seq_active_get(scene);
- const int is_relative_path= RNA_boolean_get(op->ptr, "relative_path");
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
+ Sequence *seq = seq_active_get(scene);
+ const int is_relative_path = RNA_boolean_get(op->ptr, "relative_path");
- if(seq->type == SEQ_IMAGE) {
+ if (seq->type == SEQ_IMAGE) {
char directory[FILE_MAX];
- const int len= RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files"));
+ const int len = RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files"));
StripElem *se;
- if(len==0)
+ if (len == 0)
return OPERATOR_CANCELLED;
RNA_string_get(op->ptr, "directory", directory);
@@ -2984,13 +3007,13 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op)
}
BLI_strncpy(seq->strip->dir, directory, sizeof(seq->strip->dir));
- if(seq->strip->stripdata) {
+ if (seq->strip->stripdata) {
MEM_freeN(seq->strip->stripdata);
}
- seq->strip->stripdata= se= MEM_callocN(len*sizeof(StripElem), "stripelem");
+ seq->strip->stripdata = se = MEM_callocN(len * sizeof(StripElem), "stripelem");
RNA_BEGIN(op->ptr, itemptr, "files") {
- char *filename= RNA_string_get_alloc(&itemptr, "name", NULL, 0);
+ char *filename = RNA_string_get_alloc(&itemptr, "name", NULL, 0);
BLI_strncpy(se->name, filename, sizeof(se->name));
MEM_freeN(filename);
se++;
@@ -2998,15 +3021,15 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op)
RNA_END;
/* reset these else we wont see all the images */
- seq->anim_startofs= seq->anim_endofs= 0;
+ seq->anim_startofs = seq->anim_endofs = 0;
- /* correct start/end frames so we dont move
+ /* correct start/end frames so we don't move
* important not to set seq->len= len; allow the function to handle it */
reload_sequence_new_file(scene, seq, TRUE);
calc_sequence(scene, seq);
- /* important else we dont get the imbuf cache flushed */
+ /* important else we don't get the imbuf cache flushed */
free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
}
else {
@@ -3018,25 +3041,25 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op)
RNA_pointer_create(&scene->id, &RNA_Sequence, seq, &seq_ptr);
RNA_string_get(op->ptr, "filepath", filepath);
- prop= RNA_struct_find_property(&seq_ptr, "filepath");
+ prop = RNA_struct_find_property(&seq_ptr, "filepath");
RNA_property_string_set(&seq_ptr, prop, filepath);
RNA_property_update(C, &seq_ptr, prop);
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
static int sequencer_change_path_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- Scene *scene= CTX_data_scene(C);
- Sequence *seq= seq_active_get(scene);
+ Scene *scene = CTX_data_scene(C);
+ Sequence *seq = seq_active_get(scene);
RNA_string_set(op->ptr, "directory", seq->strip->dir);
/* set default display depending on seq type */
- if(seq->type == SEQ_IMAGE) {
+ if (seq->type == SEQ_IMAGE) {
RNA_boolean_set(op->ptr, "filter_movie", FALSE);
}
else {
@@ -3051,17 +3074,18 @@ static int sequencer_change_path_invoke(bContext *C, wmOperator *op, wmEvent *UN
void SEQUENCER_OT_change_path(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Change Data/Files";
- ot->idname= "SEQUENCER_OT_change_path";
- ot->description="";
+ ot->name = "Change Data/Files";
+ ot->idname = "SEQUENCER_OT_change_path";
+ ot->description = "";
/* api callbacks */
- ot->exec= sequencer_change_path_exec;
- ot->invoke= sequencer_change_path_invoke;
- ot->poll= sequencer_strip_has_path_poll;
+ ot->exec = sequencer_change_path_exec;
+ ot->invoke = sequencer_change_path_invoke;
+ ot->poll = sequencer_strip_has_path_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY|WM_FILESEL_RELPATH|WM_FILESEL_FILEPATH|WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE | MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY | WM_FILESEL_RELPATH | WM_FILESEL_FILEPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
}
+
diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h
index 2d98278e163..7acaaf76c62 100644
--- a/source/blender/editors/space_sequencer/sequencer_intern.h
+++ b/source/blender/editors/space_sequencer/sequencer_intern.h
@@ -117,6 +117,8 @@ void SEQUENCER_OT_paste(struct wmOperatorType *ot);
void SEQUENCER_OT_rebuild_proxy(struct wmOperatorType *ot);
+void SEQUENCER_OT_update_strip_length(struct wmOperatorType *ot);
+
/* preview specific operators */
void SEQUENCER_OT_view_all_preview(struct wmOperatorType *ot);
@@ -136,6 +138,7 @@ void SEQUENCER_OT_select_grouped(struct wmOperatorType *ot);
/* sequencer_select.c */
void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot);
void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot);
+void SEQUENCER_OT_movieclip_strip_add(struct wmOperatorType *ot);
void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot);
void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot);
void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c
index ec9f8bb36d9..3a02c90f99a 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"
@@ -105,6 +104,7 @@ void sequencer_operatortypes(void)
/* sequencer_add.c */
WM_operatortype_append(SEQUENCER_OT_scene_strip_add);
+ WM_operatortype_append(SEQUENCER_OT_movieclip_strip_add);
WM_operatortype_append(SEQUENCER_OT_movie_strip_add);
WM_operatortype_append(SEQUENCER_OT_sound_strip_add);
WM_operatortype_append(SEQUENCER_OT_image_strip_add);
@@ -118,45 +118,51 @@ void sequencer_operatortypes(void)
void sequencer_keymap(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "SequencerCommon", SPACE_SEQ, 0);
+ wmKeyMap *keymap;
wmKeyMapItem *kmi;
-
- kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", OKEY, KM_PRESS, KM_SHIFT, 0);
+
+ /* 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 */
- keymap= WM_keymap_find(keyconf, "Sequencer", SPACE_SEQ, 0);
+ /* Strips Region --------------------------------------------------------------- */
+ keymap = WM_keymap_find(keyconf, "Sequencer", SPACE_SEQ, 0);
WM_keymap_add_item(keymap, "SEQUENCER_OT_properties", NKEY, KM_PRESS, 0, 0);
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select_all", AKEY, KM_PRESS, 0, 0);
- RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
+ RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
- RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
+ RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_cut", KKEY, KM_PRESS, 0, 0);
- RNA_enum_set(kmi->ptr, "type", SEQ_CUT_SOFT);
+ RNA_enum_set(kmi->ptr, "type", SEQ_CUT_SOFT);
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_cut", KKEY, KM_PRESS, KM_SHIFT, 0);
- RNA_enum_set(kmi->ptr, "type", SEQ_CUT_HARD);
+ RNA_enum_set(kmi->ptr, "type", SEQ_CUT_HARD);
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_mute", HKEY, KM_PRESS, 0, 0);
- RNA_boolean_set(kmi->ptr, "unselected", FALSE);
+ RNA_boolean_set(kmi->ptr, "unselected", FALSE);
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_mute", HKEY, KM_PRESS, KM_SHIFT, 0);
- RNA_boolean_set(kmi->ptr, "unselected", TRUE);
+ RNA_boolean_set(kmi->ptr, "unselected", TRUE);
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_unmute", HKEY, KM_PRESS, KM_ALT, 0);
- RNA_boolean_set(kmi->ptr, "unselected", FALSE);
- kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_unmute", HKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0);
- RNA_boolean_set(kmi->ptr, "unselected", TRUE);
+ RNA_boolean_set(kmi->ptr, "unselected", FALSE);
+ kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_unmute", HKEY, KM_PRESS, KM_ALT | KM_SHIFT, 0);
+ RNA_boolean_set(kmi->ptr, "unselected", TRUE);
WM_keymap_add_item(keymap, "SEQUENCER_OT_lock", LKEY, KM_PRESS, KM_SHIFT, 0);
- WM_keymap_add_item(keymap, "SEQUENCER_OT_unlock", LKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
+ WM_keymap_add_item(keymap, "SEQUENCER_OT_unlock", LKEY, KM_PRESS, KM_SHIFT | KM_ALT, 0);
WM_keymap_add_item(keymap, "SEQUENCER_OT_reassign_inputs", RKEY, KM_PRESS, 0, 0);
+
WM_keymap_add_item(keymap, "SEQUENCER_OT_reload", RKEY, KM_PRESS, KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_reload", RKEY, KM_PRESS, KM_SHIFT | KM_ALT, 0);
+ RNA_boolean_set(kmi->ptr, "adjust_length", TRUE);
WM_keymap_add_item(keymap, "SEQUENCER_OT_offset_clear", OKEY, KM_PRESS, KM_ALT, 0);
@@ -188,81 +194,81 @@ 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 };
+ SIXKEY, SEVENKEY, EIGHTKEY, NINEKEY, ZEROKEY };
int i;
for (i = 1; i <= 10; i++) {
- RNA_int_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_cut_multicam", keys[i-1], KM_PRESS, 0, 0)->ptr, "camera", i);
+ RNA_int_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_cut_multicam", keys[i - 1], KM_PRESS, 0, 0)->ptr, "camera", i);
}
}
/* Mouse selection, a bit verbose :/ */
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, 0, 0);
- RNA_boolean_set(kmi->ptr, "extend", FALSE);
- RNA_boolean_set(kmi->ptr, "linked_handle", FALSE);
- RNA_boolean_set(kmi->ptr, "left_right", FALSE);
- RNA_boolean_set(kmi->ptr, "linked_time", FALSE);
+ RNA_boolean_set(kmi->ptr, "extend", FALSE);
+ RNA_boolean_set(kmi->ptr, "linked_handle", FALSE);
+ RNA_boolean_set(kmi->ptr, "left_right", FALSE);
+ RNA_boolean_set(kmi->ptr, "linked_time", FALSE);
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
- RNA_boolean_set(kmi->ptr, "extend", TRUE);
- RNA_boolean_set(kmi->ptr, "linked_handle", FALSE);
- RNA_boolean_set(kmi->ptr, "left_right", FALSE);
- RNA_boolean_set(kmi->ptr, "linked_time", FALSE);
+ RNA_boolean_set(kmi->ptr, "extend", TRUE);
+ RNA_boolean_set(kmi->ptr, "linked_handle", FALSE);
+ RNA_boolean_set(kmi->ptr, "left_right", FALSE);
+ RNA_boolean_set(kmi->ptr, "linked_time", FALSE);
/* 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);
RNA_boolean_set(kmi->ptr, "linked_right", TRUE);
- kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL | KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "linked_left", TRUE);
RNA_boolean_set(kmi->ptr, "linked_right", TRUE);
- kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL|KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT | KM_CTRL | KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_boolean_set(kmi->ptr, "linked_left", TRUE);
RNA_boolean_set(kmi->ptr, "linked_right", TRUE);
- kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_boolean_set(kmi->ptr, "linked_left", TRUE);
- kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0);
+ 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);
- RNA_boolean_set(kmi->ptr, "extend", FALSE);
- RNA_boolean_set(kmi->ptr, "linked_handle", TRUE);
- RNA_boolean_set(kmi->ptr, "left_right", FALSE);
- RNA_boolean_set(kmi->ptr, "linked_time", FALSE);
+ RNA_boolean_set(kmi->ptr, "extend", FALSE);
+ RNA_boolean_set(kmi->ptr, "linked_handle", TRUE);
+ RNA_boolean_set(kmi->ptr, "left_right", FALSE);
+ RNA_boolean_set(kmi->ptr, "linked_time", FALSE);
- 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_handle", TRUE);
- RNA_boolean_set(kmi->ptr, "left_right", FALSE);
- RNA_boolean_set(kmi->ptr, "linked_time", FALSE);
+ 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_handle", TRUE);
+ RNA_boolean_set(kmi->ptr, "left_right", FALSE);
+ RNA_boolean_set(kmi->ptr, "linked_time", FALSE);
/* match action editor */
- kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
- RNA_boolean_set(kmi->ptr, "extend", FALSE);
- RNA_boolean_set(kmi->ptr, "linked_handle", FALSE);
- RNA_boolean_set(kmi->ptr, "left_right", TRUE); /* grr, these conflict - only use left_right if not over an active seq */
- RNA_boolean_set(kmi->ptr, "linked_time", TRUE);
+ kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
+ RNA_boolean_set(kmi->ptr, "extend", FALSE);
+ RNA_boolean_set(kmi->ptr, "linked_handle", FALSE);
+ RNA_boolean_set(kmi->ptr, "left_right", TRUE); /* grr, these conflict - only use left_right if not over an active seq */
+ RNA_boolean_set(kmi->ptr, "linked_time", TRUE);
/* adjusted since 2.4 */
- kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
- RNA_boolean_set(kmi->ptr, "extend", TRUE);
- RNA_boolean_set(kmi->ptr, "linked_handle", FALSE);
- RNA_boolean_set(kmi->ptr, "left_right", FALSE);
- RNA_boolean_set(kmi->ptr, "linked_time", TRUE);
+ kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
+ RNA_boolean_set(kmi->ptr, "extend", TRUE);
+ RNA_boolean_set(kmi->ptr, "linked_handle", FALSE);
+ RNA_boolean_set(kmi->ptr, "left_right", FALSE);
+ RNA_boolean_set(kmi->ptr, "linked_time", TRUE);
WM_keymap_add_item(keymap, "SEQUENCER_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "SEQUENCER_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
@@ -282,13 +288,18 @@ void sequencer_keymap(wmKeyConfig *keyconf)
WM_keymap_add_menu(keymap, "SEQUENCER_MT_change", CKEY, KM_PRESS, 0, 0);
- kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", OKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", OKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "data_path", "scene.sequence_editor.overlay_frame");
RNA_int_set(kmi->ptr, "value", 0);
transform_keymap_for_space(keyconf, keymap, SPACE_SEQ);
-
- keymap= WM_keymap_find(keyconf, "SequencerPreview", SPACE_SEQ, 0);
+
+ /* 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 +318,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/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c
index c13a5202c19..1d81d4bb68b 100644
--- a/source/blender/editors/space_sequencer/sequencer_scopes.c
+++ b/source/blender/editors/space_sequencer/sequencer_scopes.c
@@ -41,27 +41,27 @@
* only difference is it does some normalize after, need to double check on this - campbell */
static void rgb_to_yuv_normalized(const float rgb[3], float yuv[3])
{
- yuv[0]= 0.299f*rgb[0] + 0.587f*rgb[1] + 0.114f*rgb[2];
- yuv[1]= 0.492f*(rgb[2] - yuv[0]);
- yuv[2]= 0.877f*(rgb[0] - yuv[0]);
+ yuv[0] = 0.299f * rgb[0] + 0.587f * rgb[1] + 0.114f * rgb[2];
+ yuv[1] = 0.492f * (rgb[2] - yuv[0]);
+ yuv[2] = 0.877f * (rgb[0] - yuv[0]);
- /* Normalize */
- yuv[1]*= 255.0f/(122*2.0f);
- yuv[1]+= 0.5f;
+ /* Normalize */
+ yuv[1] *= 255.0f / (122 * 2.0f);
+ yuv[1] += 0.5f;
- yuv[2]*= 255.0f/(157*2.0f);
- yuv[2]+= 0.5f;
+ yuv[2] *= 255.0f / (157 * 2.0f);
+ yuv[2] += 0.5f;
}
-static void scope_put_pixel(unsigned char* table, unsigned char * pos)
+static void scope_put_pixel(unsigned char *table, unsigned char *pos)
{
char newval = table[*pos];
pos[0] = pos[1] = pos[2] = newval;
pos[3] = 255;
}
-static void scope_put_pixel_single(unsigned char* table, unsigned char * pos,
- int col)
+static void scope_put_pixel_single(unsigned char *table, unsigned char *pos,
+ int col)
{
char newval = table[pos[col]];
pos[col] = newval;
@@ -69,10 +69,10 @@ static void scope_put_pixel_single(unsigned char* table, unsigned char * pos,
}
static void wform_put_line(int w,
- unsigned char * last_pos, unsigned char * new_pos)
+ unsigned char *last_pos, unsigned char *new_pos)
{
if (last_pos > new_pos) {
- unsigned char* temp = new_pos;
+ unsigned char *temp = new_pos;
new_pos = last_pos;
last_pos = temp;
}
@@ -82,15 +82,15 @@ static void wform_put_line(int w,
last_pos[0] = last_pos[1] = last_pos[2] = 32;
last_pos[3] = 255;
}
- last_pos += 4*w;
+ last_pos += 4 * w;
}
}
static void wform_put_line_single(
- int w, unsigned char * last_pos, unsigned char * new_pos, int col)
+ int w, unsigned char *last_pos, unsigned char *new_pos, int col)
{
if (last_pos > new_pos) {
- unsigned char* temp = new_pos;
+ unsigned char *temp = new_pos;
new_pos = last_pos;
last_pos = temp;
}
@@ -100,16 +100,16 @@ static void wform_put_line_single(
last_pos[col] = 32;
last_pos[3] = 255;
}
- last_pos += 4*w;
+ last_pos += 4 * w;
}
}
-static void wform_put_border(unsigned char * tgt, int w, int h)
+static void wform_put_border(unsigned char *tgt, int w, int h)
{
int x, y;
for (x = 0; x < w; x++) {
- unsigned char * p = tgt + 4 * x;
+ unsigned char *p = tgt + 4 * x;
p[1] = p[3] = 255.0;
p[4 * w + 1] = p[4 * w + 3] = 255.0;
p = tgt + 4 * (w * (h - 1) + x);
@@ -118,7 +118,7 @@ static void wform_put_border(unsigned char * tgt, int w, int h)
}
for (y = 0; y < h; y++) {
- unsigned char * p = tgt + 4 * w * y;
+ unsigned char *p = tgt + 4 * w * y;
p[1] = p[3] = 255.0;
p[4 + 1] = p[4 + 3] = 255.0;
p = tgt + 4 * (w * y + w - 1);
@@ -127,32 +127,32 @@ static void wform_put_border(unsigned char * tgt, int w, int h)
}
}
-static void wform_put_gridrow(unsigned char * tgt, float perc, int w, int h)
+static void wform_put_gridrow(unsigned char *tgt, float perc, int w, int h)
{
int i;
- tgt += (int) (perc/100.0f * h) * w * 4;
+ tgt += (int) (perc / 100.0f * h) * w * 4;
- for (i = 0; i < w*2; i++) {
+ for (i = 0; i < w * 2; i++) {
tgt[0] = 255;
tgt += 4;
}
}
-static void wform_put_grid(unsigned char * tgt, int w, int h)
+static void wform_put_grid(unsigned char *tgt, int w, int h)
{
wform_put_gridrow(tgt, 90.0, w, h);
wform_put_gridrow(tgt, 70.0, w, h);
wform_put_gridrow(tgt, 10.0, w, h);
}
-static struct ImBuf *make_waveform_view_from_ibuf_byte(struct ImBuf * ibuf)
+static ImBuf *make_waveform_view_from_ibuf_byte(ImBuf *ibuf)
{
- struct ImBuf * rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect);
- int x,y;
- unsigned char* src = (unsigned char*) ibuf->rect;
- unsigned char* tgt = (unsigned char*) rval->rect;
+ ImBuf *rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect);
+ int x, y;
+ unsigned char *src = (unsigned char *) ibuf->rect;
+ unsigned char *tgt = (unsigned char *) rval->rect;
int w = ibuf->x + 3;
int h = 515;
float waveform_gamma = 0.2;
@@ -161,17 +161,17 @@ static struct ImBuf *make_waveform_view_from_ibuf_byte(struct ImBuf * ibuf)
wform_put_grid(tgt, w, h);
for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1)/256,
- waveform_gamma)*255);
+ wtable[x] = (unsigned char) (pow(((float) x + 1) / 256,
+ waveform_gamma) * 255);
}
for (y = 0; y < ibuf->y; y++) {
- unsigned char * last_p = NULL;
+ unsigned char *last_p = NULL;
for (x = 0; x < ibuf->x; x++) {
- unsigned char * rgb = src + 4 * (ibuf->x * y + x);
+ unsigned char *rgb = src + 4 * (ibuf->x * y + x);
float v = (float)rgb_to_luma_byte(rgb) / 255.0f;
- unsigned char * p = tgt;
+ unsigned char *p = tgt;
p += 4 * (w * ((int) (v * (h - 3)) + 1) + x + 1);
scope_put_pixel(wtable, p);
@@ -190,12 +190,12 @@ static struct ImBuf *make_waveform_view_from_ibuf_byte(struct ImBuf * ibuf)
return rval;
}
-static struct ImBuf *make_waveform_view_from_ibuf_float(struct ImBuf * ibuf)
+static ImBuf *make_waveform_view_from_ibuf_float(ImBuf *ibuf)
{
- struct ImBuf * rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect);
- int x,y;
- float* src = ibuf->rect_float;
- unsigned char* tgt = (unsigned char*) rval->rect;
+ ImBuf *rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect);
+ int x, y;
+ float *src = ibuf->rect_float;
+ unsigned char *tgt = (unsigned char *) rval->rect;
int w = ibuf->x + 3;
int h = 515;
float waveform_gamma = 0.2;
@@ -204,17 +204,17 @@ static struct ImBuf *make_waveform_view_from_ibuf_float(struct ImBuf * ibuf)
wform_put_grid(tgt, w, h);
for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1)/256,
- waveform_gamma)*255);
+ wtable[x] = (unsigned char) (pow(((float) x + 1) / 256,
+ waveform_gamma) * 255);
}
for (y = 0; y < ibuf->y; y++) {
- unsigned char * last_p = NULL;
+ unsigned char *last_p = NULL;
for (x = 0; x < ibuf->x; x++) {
- float * rgb = src + 4 * (ibuf->x * y + x);
+ float *rgb = src + 4 * (ibuf->x * y + x);
float v = rgb_to_luma(rgb);
- unsigned char * p = tgt;
+ unsigned char *p = tgt;
CLAMP(v, 0.0f, 1.0f);
@@ -236,25 +236,25 @@ static struct ImBuf *make_waveform_view_from_ibuf_float(struct ImBuf * ibuf)
return rval;
}
-struct ImBuf *make_waveform_view_from_ibuf(struct ImBuf * ibuf)
+ImBuf *make_waveform_view_from_ibuf(ImBuf *ibuf)
{
if (ibuf->rect_float) {
return make_waveform_view_from_ibuf_float(ibuf);
- } else {
+ }
+ else {
return make_waveform_view_from_ibuf_byte(ibuf);
}
}
-static struct ImBuf *make_sep_waveform_view_from_ibuf_byte(struct ImBuf * ibuf)
-{
- struct ImBuf * rval = IMB_allocImBuf(
- ibuf->x + 3, 515, 32, IB_rect);
- int x,y;
- unsigned char* src = (unsigned char*) ibuf->rect;
- unsigned char* tgt = (unsigned char*) rval->rect;
+static ImBuf *make_sep_waveform_view_from_ibuf_byte(ImBuf *ibuf){
+ ImBuf *rval = IMB_allocImBuf(
+ ibuf->x + 3, 515, 32, IB_rect);
+ int x, y;
+ unsigned char *src = (unsigned char *) ibuf->rect;
+ unsigned char *tgt = (unsigned char *) rval->rect;
int w = ibuf->x + 3;
- int sw = ibuf->x/3;
+ int sw = ibuf->x / 3;
int h = 515;
float waveform_gamma = 0.2;
unsigned char wtable[256];
@@ -262,8 +262,8 @@ static struct ImBuf *make_sep_waveform_view_from_ibuf_byte(struct ImBuf * ibuf)
wform_put_grid(tgt, w, h);
for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1)/256,
- waveform_gamma)*255);
+ wtable[x] = (unsigned char) (pow(((float) x + 1) / 256,
+ waveform_gamma) * 255);
}
for (y = 0; y < ibuf->y; y++) {
@@ -271,11 +271,11 @@ static struct ImBuf *make_sep_waveform_view_from_ibuf_byte(struct ImBuf * ibuf)
for (x = 0; x < ibuf->x; x++) {
int c;
- unsigned char * rgb = src + 4 * (ibuf->x * y + x);
+ unsigned char *rgb = src + 4 * (ibuf->x * y + x);
for (c = 0; c < 3; c++) {
- unsigned char * p = tgt;
- p += 4 * (w * ((rgb[c] * (h - 3))/255 + 1)
- + c * sw + x/3 + 1);
+ unsigned char *p = tgt;
+ p += 4 * (w * ((rgb[c] * (h - 3)) / 255 + 1)
+ + c * sw + x / 3 + 1);
scope_put_pixel_single(wtable, p, c);
p += 4 * w;
@@ -283,7 +283,7 @@ static struct ImBuf *make_sep_waveform_view_from_ibuf_byte(struct ImBuf * ibuf)
if (last_p[c] != NULL) {
wform_put_line_single(
- w, last_p[c], p, c);
+ w, last_p[c], p, c);
}
last_p[c] = p;
}
@@ -295,16 +295,14 @@ static struct ImBuf *make_sep_waveform_view_from_ibuf_byte(struct ImBuf * ibuf)
return rval;
}
-static struct ImBuf *make_sep_waveform_view_from_ibuf_float(
- struct ImBuf * ibuf)
+static ImBuf *make_sep_waveform_view_from_ibuf_float(ImBuf *ibuf)
{
- struct ImBuf * rval = IMB_allocImBuf(
- ibuf->x + 3, 515, 32, IB_rect);
- int x,y;
- float* src = ibuf->rect_float;
- unsigned char* tgt = (unsigned char*) rval->rect;
+ ImBuf *rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect);
+ int x, y;
+ float *src = ibuf->rect_float;
+ unsigned char *tgt = (unsigned char *) rval->rect;
int w = ibuf->x + 3;
- int sw = ibuf->x/3;
+ int sw = ibuf->x / 3;
int h = 515;
float waveform_gamma = 0.2;
unsigned char wtable[256];
@@ -312,8 +310,8 @@ static struct ImBuf *make_sep_waveform_view_from_ibuf_float(
wform_put_grid(tgt, w, h);
for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1)/256,
- waveform_gamma)*255);
+ wtable[x] = (unsigned char) (pow(((float) x + 1) / 256,
+ waveform_gamma) * 255);
}
for (y = 0; y < ibuf->y; y++) {
@@ -321,15 +319,15 @@ static struct ImBuf *make_sep_waveform_view_from_ibuf_float(
for (x = 0; x < ibuf->x; x++) {
int c;
- float * rgb = src + 4 * (ibuf->x * y + x);
+ float *rgb = src + 4 * (ibuf->x * y + x);
for (c = 0; c < 3; c++) {
- unsigned char * p = tgt;
+ unsigned char *p = tgt;
float v = rgb[c];
CLAMP(v, 0.0f, 1.0f);
p += 4 * (w * ((int) (v * (h - 3)) + 1)
- + c * sw + x/3 + 1);
+ + c * sw + x / 3 + 1);
scope_put_pixel_single(wtable, p, c);
p += 4 * w;
@@ -337,7 +335,7 @@ static struct ImBuf *make_sep_waveform_view_from_ibuf_float(
if (last_p[c] != NULL) {
wform_put_line_single(
- w, last_p[c], p, c);
+ w, last_p[c], p, c);
}
last_p[c] = p;
}
@@ -349,20 +347,21 @@ static struct ImBuf *make_sep_waveform_view_from_ibuf_float(
return rval;
}
-struct ImBuf *make_sep_waveform_view_from_ibuf(struct ImBuf * ibuf)
+ImBuf *make_sep_waveform_view_from_ibuf(ImBuf *ibuf)
{
if (ibuf->rect_float) {
return make_sep_waveform_view_from_ibuf_float(ibuf);
- } else {
+ }
+ else {
return make_sep_waveform_view_from_ibuf_byte(ibuf);
}
}
-static void draw_zebra_byte(struct ImBuf * src,struct ImBuf * ibuf, float perc)
+static void draw_zebra_byte(ImBuf *src, ImBuf *ibuf, float perc)
{
unsigned int limit = 255.0f * perc / 100.0f;
- unsigned char * p = (unsigned char*) src->rect;
- unsigned char * o = (unsigned char*) ibuf->rect;
+ unsigned char *p = (unsigned char *) src->rect;
+ unsigned char *o = (unsigned char *) ibuf->rect;
int x;
int y;
@@ -389,11 +388,11 @@ static void draw_zebra_byte(struct ImBuf * src,struct ImBuf * ibuf, float perc)
}
-static void draw_zebra_float(struct ImBuf * src,struct ImBuf * ibuf,float perc)
+static void draw_zebra_float(ImBuf *src, ImBuf *ibuf, float perc)
{
float limit = perc / 100.0f;
- float * p = src->rect_float;
- unsigned char * o = (unsigned char*) ibuf->rect;
+ float *p = src->rect_float;
+ unsigned char *o = (unsigned char *) ibuf->rect;
int x;
int y;
@@ -420,35 +419,36 @@ static void draw_zebra_float(struct ImBuf * src,struct ImBuf * ibuf,float perc)
}
}
-struct ImBuf * make_zebra_view_from_ibuf(struct ImBuf * src, float perc)
+ImBuf *make_zebra_view_from_ibuf(ImBuf *src, float perc)
{
- struct ImBuf * ibuf = IMB_allocImBuf(src->x, src->y, 32, IB_rect);
+ ImBuf *ibuf = IMB_allocImBuf(src->x, src->y, 32, IB_rect);
if (src->rect_float) {
draw_zebra_float(src, ibuf, perc);
- } else {
+ }
+ else {
draw_zebra_byte(src, ibuf, perc);
}
return ibuf;
}
-static void draw_histogram_marker(struct ImBuf * ibuf, int x)
+static void draw_histogram_marker(ImBuf *ibuf, int x)
{
- unsigned char * p = (unsigned char*) ibuf->rect;
+ unsigned char *p = (unsigned char *) ibuf->rect;
int barh = ibuf->y * 0.1;
int i;
p += 4 * (x + ibuf->x * (ibuf->y - barh + 1));
- for (i = 0; i < barh-1; i++) {
+ for (i = 0; i < barh - 1; i++) {
p[0] = p[1] = p[2] = 255;
p += ibuf->x * 4;
}
}
-static void draw_histogram_bar(struct ImBuf * ibuf, int x,float val, int col)
+static void draw_histogram_bar(ImBuf *ibuf, int x, float val, int col)
{
- unsigned char * p = (unsigned char*) ibuf->rect;
+ unsigned char *p = (unsigned char *) ibuf->rect;
int barh = ibuf->y * val * 0.9f;
int i;
@@ -460,17 +460,16 @@ static void draw_histogram_bar(struct ImBuf * ibuf, int x,float val, int col)
}
}
-static struct ImBuf *make_histogram_view_from_ibuf_byte(
- struct ImBuf * ibuf)
+static ImBuf *make_histogram_view_from_ibuf_byte(ImBuf *ibuf)
{
- struct ImBuf * rval = IMB_allocImBuf(515, 128, 32, IB_rect);
- int c,x,y;
+ ImBuf *rval = IMB_allocImBuf(515, 128, 32, IB_rect);
+ int c, x, y;
unsigned int n;
- unsigned char* src = (unsigned char*) ibuf->rect;
+ unsigned char *src = (unsigned char *) ibuf->rect;
unsigned int bins[3][256];
- memset(bins, 0, 3 * 256* sizeof(unsigned int));
+ memset(bins, 0, 3 * 256 * sizeof(unsigned int));
for (y = 0; y < ibuf->y; y++) {
for (x = 0; x < ibuf->x; x++) {
@@ -492,14 +491,14 @@ static struct ImBuf *make_histogram_view_from_ibuf_byte(
for (c = 0; c < 3; c++) {
for (x = 0; x < 256; x++) {
- draw_histogram_bar(rval, x*2+1,
- ((float) bins[c][x])/n, c);
- draw_histogram_bar(rval, x*2+2,
- ((float) bins[c][x])/n, c);
+ draw_histogram_bar(rval, x * 2 + 1,
+ ((float) bins[c][x]) / n, c);
+ draw_histogram_bar(rval, x * 2 + 2,
+ ((float) bins[c][x]) / n, c);
}
}
- wform_put_border((unsigned char*) rval->rect, rval->x, rval->y);
+ wform_put_border((unsigned char *) rval->rect, rval->x, rval->y);
return rval;
}
@@ -508,23 +507,23 @@ static int get_bin_float(float f)
{
if (f < -0.25f) {
f = -0.25f;
- } else if (f > 1.25f) {
+ }
+ else if (f > 1.25f) {
f = 1.25f;
}
return (int) (((f + 0.25f) / 1.5f) * 512);
}
-static struct ImBuf *make_histogram_view_from_ibuf_float(
- struct ImBuf * ibuf)
+static ImBuf *make_histogram_view_from_ibuf_float(ImBuf *ibuf)
{
- struct ImBuf * rval = IMB_allocImBuf(515, 128, 32, IB_rect);
- int n,c,x,y;
- float* src = ibuf->rect_float;
+ ImBuf *rval = IMB_allocImBuf(515, 128, 32, IB_rect);
+ int n, c, x, y;
+ float *src = ibuf->rect_float;
unsigned int bins[3][512];
- memset(bins, 0, 3 * 256* sizeof(unsigned int));
+ memset(bins, 0, 3 * 256 * sizeof(unsigned int));
for (y = 0; y < ibuf->y; y++) {
for (x = 0; x < ibuf->x; x++) {
@@ -548,40 +547,41 @@ static struct ImBuf *make_histogram_view_from_ibuf_float(
}
for (c = 0; c < 3; c++) {
for (x = 0; x < 512; x++) {
- draw_histogram_bar(rval, x+1, (float) bins[c][x]/n, c);
+ draw_histogram_bar(rval, x + 1, (float) bins[c][x] / n, c);
}
}
- wform_put_border((unsigned char*) rval->rect, rval->x, rval->y);
+ wform_put_border((unsigned char *) rval->rect, rval->x, rval->y);
return rval;
}
-struct ImBuf *make_histogram_view_from_ibuf(struct ImBuf * ibuf)
+ImBuf *make_histogram_view_from_ibuf(ImBuf *ibuf)
{
if (ibuf->rect_float) {
return make_histogram_view_from_ibuf_float(ibuf);
- } else {
+ }
+ else {
return make_histogram_view_from_ibuf_byte(ibuf);
}
}
static void vectorscope_put_cross(unsigned char r, unsigned char g,
- unsigned char b,
- char * tgt, int w, int h, int size)
+ unsigned char b,
+ char *tgt, int w, int h, int size)
{
float rgb[3], yuv[3];
- char * p;
+ char *p;
int x = 0;
int y = 0;
- rgb[0]= (float)r/255.0f;
- rgb[1]= (float)g/255.0f;
- rgb[2]= (float)b/255.0f;
+ rgb[0] = (float)r / 255.0f;
+ rgb[1] = (float)g / 255.0f;
+ rgb[2] = (float)b / 255.0f;
rgb_to_yuv_normalized(rgb, yuv);
p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1))
- + (int) ((yuv[1] * (w - 3) + 1)));
+ + (int) ((yuv[1] * (w - 3) + 1)));
if (r == 0 && g == 0 && b == 0) {
r = 255;
@@ -589,18 +589,18 @@ static void vectorscope_put_cross(unsigned char r, unsigned char g,
for (y = -size; y <= size; y++) {
for (x = -size; x <= size; x++) {
- char * q = p + 4 * (y * w + x);
+ char *q = p + 4 * (y * w + x);
q[0] = r; q[1] = g; q[2] = b; q[3] = 255;
}
}
}
-static struct ImBuf *make_vectorscope_view_from_ibuf_byte(struct ImBuf * ibuf)
+static ImBuf *make_vectorscope_view_from_ibuf_byte(ImBuf *ibuf)
{
- struct ImBuf * rval = IMB_allocImBuf(515, 515, 32, IB_rect);
- int x,y;
- char* src = (char*) ibuf->rect;
- char* tgt = (char*) rval->rect;
+ ImBuf *rval = IMB_allocImBuf(515, 515, 32, IB_rect);
+ int x, y;
+ char *src = (char *) ibuf->rect;
+ char *tgt = (char *) rval->rect;
float rgb[3], yuv[3];
int w = 515;
int h = 515;
@@ -608,14 +608,14 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_byte(struct ImBuf * ibuf)
unsigned char wtable[256];
for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1)/256,
- scope_gamma)*255);
+ wtable[x] = (unsigned char) (pow(((float) x + 1) / 256,
+ scope_gamma) * 255);
}
for (x = 0; x <= 255; x++) {
- vectorscope_put_cross(255 , 0,255 - x, tgt, w, h, 1);
- vectorscope_put_cross(255 , x, 0, tgt, w, h, 1);
- vectorscope_put_cross(255- x, 255, 0, tgt, w, h, 1);
+ vectorscope_put_cross(255, 0, 255 - x, tgt, w, h, 1);
+ vectorscope_put_cross(255, x, 0, tgt, w, h, 1);
+ vectorscope_put_cross(255 - x, 255, 0, tgt, w, h, 1);
vectorscope_put_cross(0, 255, x, tgt, w, h, 1);
vectorscope_put_cross(0, 255 - x, 255, tgt, w, h, 1);
vectorscope_put_cross(x, 0, 255, tgt, w, h, 1);
@@ -623,17 +623,17 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_byte(struct ImBuf * ibuf)
for (y = 0; y < ibuf->y; y++) {
for (x = 0; x < ibuf->x; x++) {
- char * src1 = src + 4 * (ibuf->x * y + x);
- char * p;
+ char *src1 = src + 4 * (ibuf->x * y + x);
+ char *p;
- rgb[0]= (float)src1[0]/255.0f;
- rgb[1]= (float)src1[1]/255.0f;
- rgb[2]= (float)src1[2]/255.0f;
+ rgb[0] = (float)src1[0] / 255.0f;
+ rgb[1] = (float)src1[1] / 255.0f;
+ rgb[2] = (float)src1[2] / 255.0f;
rgb_to_yuv_normalized(rgb, yuv);
p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1))
- + (int) ((yuv[1] * (w - 3) + 1)));
- scope_put_pixel(wtable, (unsigned char*)p);
+ + (int) ((yuv[1] * (w - 3) + 1)));
+ scope_put_pixel(wtable, (unsigned char *)p);
}
}
@@ -642,12 +642,12 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_byte(struct ImBuf * ibuf)
return rval;
}
-static struct ImBuf *make_vectorscope_view_from_ibuf_float(struct ImBuf * ibuf)
+static ImBuf *make_vectorscope_view_from_ibuf_float(ImBuf *ibuf)
{
- struct ImBuf * rval = IMB_allocImBuf(515, 515, 32, IB_rect);
- int x,y;
- float* src = ibuf->rect_float;
- char* tgt = (char*) rval->rect;
+ ImBuf *rval = IMB_allocImBuf(515, 515, 32, IB_rect);
+ int x, y;
+ float *src = ibuf->rect_float;
+ char *tgt = (char *) rval->rect;
float rgb[3], yuv[3];
int w = 515;
int h = 515;
@@ -655,14 +655,14 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_float(struct ImBuf * ibuf)
unsigned char wtable[256];
for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1)/256,
- scope_gamma)*255);
+ wtable[x] = (unsigned char) (pow(((float) x + 1) / 256,
+ scope_gamma) * 255);
}
for (x = 0; x <= 255; x++) {
- vectorscope_put_cross(255 , 0,255 - x, tgt, w, h, 1);
- vectorscope_put_cross(255 , x, 0, tgt, w, h, 1);
- vectorscope_put_cross(255- x, 255, 0, tgt, w, h, 1);
+ vectorscope_put_cross(255, 0, 255 - x, tgt, w, h, 1);
+ vectorscope_put_cross(255, x, 0, tgt, w, h, 1);
+ vectorscope_put_cross(255 - x, 255, 0, tgt, w, h, 1);
vectorscope_put_cross(0, 255, x, tgt, w, h, 1);
vectorscope_put_cross(0, 255 - x, 255, tgt, w, h, 1);
vectorscope_put_cross(x, 0, 255, tgt, w, h, 1);
@@ -670,8 +670,8 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_float(struct ImBuf * ibuf)
for (y = 0; y < ibuf->y; y++) {
for (x = 0; x < ibuf->x; x++) {
- float * src1 = src + 4 * (ibuf->x * y + x);
- char * p;
+ float *src1 = src + 4 * (ibuf->x * y + x);
+ char *p;
memcpy(rgb, src1, 3 * sizeof(float));
@@ -682,8 +682,8 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_float(struct ImBuf * ibuf)
rgb_to_yuv_normalized(rgb, yuv);
p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1))
- + (int) ((yuv[1] * (w - 3) + 1)));
- scope_put_pixel(wtable, (unsigned char*)p);
+ + (int) ((yuv[1] * (w - 3) + 1)));
+ scope_put_pixel(wtable, (unsigned char *)p);
}
}
@@ -692,11 +692,12 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_float(struct ImBuf * ibuf)
return rval;
}
-struct ImBuf *make_vectorscope_view_from_ibuf(struct ImBuf * ibuf)
+ImBuf *make_vectorscope_view_from_ibuf(ImBuf *ibuf)
{
if (ibuf->rect_float) {
return make_vectorscope_view_from_ibuf_float(ibuf);
- } else {
+ }
+ else {
return make_vectorscope_view_from_ibuf_byte(ibuf);
}
}
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index 55fc84b6707..b8fc66cd3c3 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -63,19 +63,22 @@
/* own include */
#include "sequencer_intern.h"
-static void *find_nearest_marker(int UNUSED(d1), int UNUSED(d2)) {return NULL;}
+static void *find_nearest_marker(int UNUSED(d1), int UNUSED(d2))
+{
+ return NULL;
+}
static void select_surrounding_handles(Scene *scene, Sequence *test) /* XXX BRING BACK */
{
Sequence *neighbor;
- neighbor=find_neighboring_sequence(scene, test, SEQ_SIDE_LEFT, -1);
+ neighbor = find_neighboring_sequence(scene, test, SEQ_SIDE_LEFT, -1);
if (neighbor) {
neighbor->flag |= SELECT;
recurs_sel_seq(neighbor);
neighbor->flag |= SEQ_RIGHTSEL;
}
- neighbor=find_neighboring_sequence(scene, test, SEQ_SIDE_RIGHT, -1);
+ neighbor = find_neighboring_sequence(scene, test, SEQ_SIDE_RIGHT, -1);
if (neighbor) {
neighbor->flag |= SELECT;
recurs_sel_seq(neighbor);
@@ -89,24 +92,24 @@ static void select_active_side(ListBase *seqbase, int sel_side, int channel, int
{
Sequence *seq;
- for(seq= seqbase->first; seq; seq=seq->next) {
- if(channel==seq->machine) {
- switch(sel_side) {
- case SEQ_SIDE_LEFT:
- if (frame > (seq->startdisp)) {
- seq->flag &= ~(SEQ_RIGHTSEL|SEQ_LEFTSEL);
- seq->flag |= SELECT;
- }
- break;
- case SEQ_SIDE_RIGHT:
- if (frame < (seq->startdisp)) {
- seq->flag &= ~(SEQ_RIGHTSEL|SEQ_LEFTSEL);
- seq->flag |= SELECT;
- }
- break;
- case SEQ_SIDE_BOTH:
- seq->flag &= ~(SEQ_RIGHTSEL|SEQ_LEFTSEL);
- break;
+ for (seq = seqbase->first; seq; seq = seq->next) {
+ if (channel == seq->machine) {
+ switch (sel_side) {
+ case SEQ_SIDE_LEFT:
+ if (frame > (seq->startdisp)) {
+ seq->flag &= ~(SEQ_RIGHTSEL | SEQ_LEFTSEL);
+ seq->flag |= SELECT;
+ }
+ break;
+ case SEQ_SIDE_RIGHT:
+ if (frame < (seq->startdisp)) {
+ seq->flag &= ~(SEQ_RIGHTSEL | SEQ_LEFTSEL);
+ seq->flag |= SELECT;
+ }
+ break;
+ case SEQ_SIDE_BOTH:
+ seq->flag &= ~(SEQ_RIGHTSEL | SEQ_LEFTSEL);
+ break;
}
}
}
@@ -117,28 +120,28 @@ static void select_linked_time(ListBase *seqbase, Sequence *seq_link)
{
Sequence *seq;
- for(seq= seqbase->first; seq; seq=seq->next) {
- if(seq_link->machine != seq->machine) {
- int left_match = (seq->startdisp == seq_link->startdisp) ? 1:0;
- int right_match = (seq->enddisp == seq_link->enddisp) ? 1:0;
+ for (seq = seqbase->first; seq; seq = seq->next) {
+ if (seq_link->machine != seq->machine) {
+ int left_match = (seq->startdisp == seq_link->startdisp) ? 1 : 0;
+ int right_match = (seq->enddisp == seq_link->enddisp) ? 1 : 0;
- if(left_match && right_match) {
+ if (left_match && right_match) {
/* a direct match, copy the selection settinhs */
- seq->flag &= ~(SELECT|SEQ_LEFTSEL|SEQ_RIGHTSEL);
- seq->flag |= seq_link->flag & (SELECT|SEQ_LEFTSEL|SEQ_RIGHTSEL);
+ seq->flag &= ~(SELECT | SEQ_LEFTSEL | SEQ_RIGHTSEL);
+ seq->flag |= seq_link->flag & (SELECT | SEQ_LEFTSEL | SEQ_RIGHTSEL);
recurs_sel_seq(seq);
}
- else if(seq_link->flag & SELECT && (left_match || right_match)) {
+ else if (seq_link->flag & SELECT && (left_match || right_match)) {
/* clear for reselection */
- seq->flag &= ~(SEQ_LEFTSEL|SEQ_RIGHTSEL);
+ seq->flag &= ~(SEQ_LEFTSEL | SEQ_RIGHTSEL);
- if(left_match && seq_link->flag & SEQ_LEFTSEL)
- seq->flag |= SELECT|SEQ_LEFTSEL;
+ if (left_match && seq_link->flag & SEQ_LEFTSEL)
+ seq->flag |= SELECT | SEQ_LEFTSEL;
- if(right_match && seq_link->flag & SEQ_RIGHTSEL)
- seq->flag |= SELECT|SEQ_RIGHTSEL;
+ if (right_match && seq_link->flag & SEQ_RIGHTSEL)
+ seq->flag |= SELECT | SEQ_RIGHTSEL;
recurs_sel_seq(seq);
}
@@ -149,9 +152,9 @@ static void select_linked_time(ListBase *seqbase, Sequence *seq_link)
#if 0 // BRING BACK
void select_surround_from_last(Scene *scene)
{
- Sequence *seq=get_last_seq(scene);
+ Sequence *seq = get_last_seq(scene);
- if (seq==NULL)
+ if (seq == NULL)
return;
select_surrounding_handles(scene, seq);
@@ -159,51 +162,51 @@ void select_surround_from_last(Scene *scene)
#endif
-static void UNUSED_FUNCTION(select_single_seq)(Scene *scene, Sequence *seq, int deselect_all) /* BRING BACK */
+static void UNUSED_FUNCTION(select_single_seq) (Scene * scene, Sequence * seq, int deselect_all) /* BRING BACK */
{
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
- if(deselect_all)
+ if (deselect_all)
deselect_all_seq(scene);
seq_active_set(scene, seq);
- if((seq->type==SEQ_IMAGE) || (seq->type==SEQ_MOVIE)) {
- if(seq->strip)
+ if ((seq->type == SEQ_IMAGE) || (seq->type == SEQ_MOVIE)) {
+ if (seq->strip)
BLI_strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR);
}
- else if(seq->type==SEQ_SOUND) {
- if(seq->strip)
+ else if (seq->type == SEQ_SOUND) {
+ if (seq->strip)
BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR);
}
- seq->flag|= SELECT;
+ seq->flag |= SELECT;
recurs_sel_seq(seq);
}
#if 0
static void select_neighbor_from_last(Scene *scene, int lr)
{
- Sequence *seq= seq_active_get(scene);
+ Sequence *seq = seq_active_get(scene);
Sequence *neighbor;
int change = 0;
if (seq) {
- neighbor=find_neighboring_sequence(scene, seq, lr, -1);
+ neighbor = find_neighboring_sequence(scene, seq, lr, -1);
if (neighbor) {
switch (lr) {
- case SEQ_SIDE_LEFT:
- neighbor->flag |= SELECT;
- recurs_sel_seq(neighbor);
- neighbor->flag |= SEQ_RIGHTSEL;
- seq->flag |= SEQ_LEFTSEL;
- break;
- case SEQ_SIDE_RIGHT:
- neighbor->flag |= SELECT;
- recurs_sel_seq(neighbor);
- neighbor->flag |= SEQ_LEFTSEL;
- seq->flag |= SEQ_RIGHTSEL;
- break;
+ case SEQ_SIDE_LEFT:
+ neighbor->flag |= SELECT;
+ recurs_sel_seq(neighbor);
+ neighbor->flag |= SEQ_RIGHTSEL;
+ seq->flag |= SEQ_LEFTSEL;
+ break;
+ case SEQ_SIDE_RIGHT:
+ neighbor->flag |= SELECT;
+ recurs_sel_seq(neighbor);
+ neighbor->flag |= SEQ_LEFTSEL;
+ seq->flag |= SEQ_RIGHTSEL;
+ break;
}
- seq->flag |= SELECT;
- change = 1;
+ seq->flag |= SELECT;
+ change = 1;
}
}
if (change) {
@@ -259,16 +262,16 @@ static int sequencer_de_select_all_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_select_all(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select or Deselect All";
- ot->idname= "SEQUENCER_OT_select_all";
- ot->description="Select or deselect all strips";
+ ot->name = "(De)select All";
+ ot->idname = "SEQUENCER_OT_select_all";
+ ot->description = "Select or deselect all strips";
/* api callbacks */
- ot->exec= sequencer_de_select_all_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_de_select_all_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
WM_operator_properties_select_all(ot);
}
@@ -277,21 +280,21 @@ void SEQUENCER_OT_select_all(struct wmOperatorType *ot)
/* (de)select operator */
static int sequencer_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq;
- for(seq= ed->seqbasep->first; seq; seq=seq->next) {
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT) {
seq->flag &= ~SEQ_ALLSEL;
}
else {
- seq->flag &= ~(SEQ_LEFTSEL+SEQ_RIGHTSEL);
+ seq->flag &= ~(SEQ_LEFTSEL + SEQ_RIGHTSEL);
seq->flag |= SELECT;
}
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -299,49 +302,49 @@ static int sequencer_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_select_inverse(struct wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Inverse";
- ot->idname= "SEQUENCER_OT_select_inverse";
- ot->description="Select unselected strips";
+ ot->name = "Select Inverse";
+ ot->idname = "SEQUENCER_OT_select_inverse";
+ ot->description = "Select unselected strips";
/* api callbacks */
- ot->exec= sequencer_select_inverse_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_select_inverse_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- View2D *v2d= UI_view2d_fromcontext(C);
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
- short extend= RNA_boolean_get(op->ptr, "extend");
- short linked_handle= RNA_boolean_get(op->ptr, "linked_handle");
- short left_right= RNA_boolean_get(op->ptr, "left_right");
- short linked_time= RNA_boolean_get(op->ptr, "linked_time");
+ View2D *v2d = UI_view2d_fromcontext(C);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
+ short extend = RNA_boolean_get(op->ptr, "extend");
+ short linked_handle = RNA_boolean_get(op->ptr, "linked_handle");
+ short left_right = RNA_boolean_get(op->ptr, "left_right");
+ short linked_time = RNA_boolean_get(op->ptr, "linked_time");
- Sequence *seq,*neighbor, *act_orig;
- int hand,sel_side;
+ Sequence *seq, *neighbor, *act_orig;
+ int hand, sel_side;
TimeMarker *marker;
- if(ed==NULL)
+ if (ed == NULL)
return OPERATOR_CANCELLED;
- marker=find_nearest_marker(SCE_MARKERS, 1); //XXX - dummy function for now
+ marker = find_nearest_marker(SCE_MARKERS, 1); //XXX - dummy function for now
- seq= find_nearest_seq(scene, v2d, &hand, event->mval);
+ seq = find_nearest_seq(scene, v2d, &hand, event->mval);
// XXX - not nice, Ctrl+RMB needs to do left_right only when not over a strip
- if(seq && linked_time && left_right)
- left_right= FALSE;
+ if (seq && linked_time && left_right)
+ left_right = FALSE;
if (marker) {
int oldflag;
/* select timeline marker */
if (extend) {
- oldflag= marker->flag;
+ oldflag = marker->flag;
if (oldflag & SELECT)
marker->flag &= ~SELECT;
else
@@ -352,21 +355,23 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
marker->flag |= SELECT;
}
- } else if (left_right) {
+ }
+ else if (left_right) {
/* use different logic for this */
float x;
deselect_all_seq(scene);
UI_view2d_region_to_view(v2d, event->mval[0], event->mval[1], &x, NULL);
- SEQP_BEGIN(ed, seq) {
+ SEQP_BEGIN(ed, seq)
+ {
if (x < CFRA) {
- if(seq->enddisp < CFRA) {
+ if (seq->enddisp < CFRA) {
seq->flag |= SELECT;
recurs_sel_seq(seq);
}
}
else {
- if(seq->startdisp > CFRA) {
+ if (seq->startdisp > CFRA) {
seq->flag |= SELECT;
recurs_sel_seq(seq);
}
@@ -375,14 +380,14 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
SEQ_END
{
- SpaceSeq *sseq= CTX_wm_space_seq(C);
+ SpaceSeq *sseq = CTX_wm_space_seq(C);
if (sseq && sseq->flag & SEQ_MARKER_TRANS) {
TimeMarker *tmarker;
- for (tmarker= scene->markers.first; tmarker; tmarker= tmarker->next) {
- if( ((x < CFRA) && tmarker->frame < CFRA) ||
- ((x >= CFRA) && tmarker->frame >= CFRA)
- ) {
+ for (tmarker = scene->markers.first; tmarker; tmarker = tmarker->next) {
+ if (((x < CFRA) && tmarker->frame < CFRA) ||
+ ((x >= CFRA) && tmarker->frame >= CFRA))
+ {
tmarker->flag |= SELECT;
}
else {
@@ -391,51 +396,53 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
}
}
- } else {
+ }
+ else {
// seq= find_nearest_seq(scene, v2d, &hand, mval);
- act_orig= ed->act_seq;
+ act_orig = ed->act_seq;
- if(extend == 0 && linked_handle==0)
+ if (extend == 0 && linked_handle == 0)
deselect_all_seq(scene);
- if(seq) {
+ if (seq) {
seq_active_set(scene, seq);
if ((seq->type == SEQ_IMAGE) || (seq->type == SEQ_MOVIE)) {
- if(seq->strip) {
+ if (seq->strip) {
BLI_strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR);
}
- } else
+ }
+ else
if (seq->type == SEQ_SOUND) {
- if(seq->strip) {
+ if (seq->strip) {
BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR);
}
}
- if(extend && (seq->flag & SELECT) && ed->act_seq == act_orig ) {
- switch(hand) {
- case SEQ_SIDE_NONE:
- if (linked_handle==0)
- seq->flag &= ~SEQ_ALLSEL;
- break;
- case SEQ_SIDE_LEFT:
- seq->flag ^= SEQ_LEFTSEL;
- break;
- case SEQ_SIDE_RIGHT:
- seq->flag ^= SEQ_RIGHTSEL;
- break;
+ if (extend && (seq->flag & SELECT) && ed->act_seq == act_orig) {
+ switch (hand) {
+ case SEQ_SIDE_NONE:
+ if (linked_handle == 0)
+ seq->flag &= ~SEQ_ALLSEL;
+ break;
+ case SEQ_SIDE_LEFT:
+ seq->flag ^= SEQ_LEFTSEL;
+ break;
+ case SEQ_SIDE_RIGHT:
+ seq->flag ^= SEQ_RIGHTSEL;
+ break;
}
}
else {
seq->flag |= SELECT;
- if(hand==SEQ_SIDE_LEFT) seq->flag |= SEQ_LEFTSEL;
- if(hand==SEQ_SIDE_RIGHT) seq->flag |= SEQ_RIGHTSEL;
+ if (hand == SEQ_SIDE_LEFT) seq->flag |= SEQ_LEFTSEL;
+ if (hand == SEQ_SIDE_RIGHT) seq->flag |= SEQ_RIGHTSEL;
}
/* On Alt selection, select the strip and bordering handles */
if (linked_handle && !ELEM(hand, SEQ_SIDE_LEFT, SEQ_SIDE_RIGHT)) {
- if(extend==0) deselect_all_seq(scene);
+ if (extend == 0) deselect_all_seq(scene);
seq->flag |= SELECT;
select_surrounding_handles(scene, seq);
}
@@ -445,51 +452,54 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
* Second click selects all strips in that direction.
* If there are no adjacent strips, it just selects all in that direction.
*/
- sel_side= hand;
- neighbor=find_neighboring_sequence(scene, seq, sel_side, -1);
+ sel_side = hand;
+ neighbor = find_neighboring_sequence(scene, seq, sel_side, -1);
if (neighbor) {
switch (sel_side) {
- case SEQ_SIDE_LEFT:
- if ((seq->flag & SEQ_LEFTSEL) && (neighbor->flag & SEQ_RIGHTSEL)) {
- if(extend==0) deselect_all_seq(scene);
- seq->flag |= SELECT;
-
- select_active_side(ed->seqbasep, SEQ_SIDE_LEFT, seq->machine, seq->startdisp);
- } else {
- if(extend==0) deselect_all_seq(scene);
- seq->flag |= SELECT;
-
- neighbor->flag |= SELECT;
- recurs_sel_seq(neighbor);
- neighbor->flag |= SEQ_RIGHTSEL;
- seq->flag |= SEQ_LEFTSEL;
- }
- break;
- case SEQ_SIDE_RIGHT:
- if ((seq->flag & SEQ_RIGHTSEL) && (neighbor->flag & SEQ_LEFTSEL)) {
- if(extend==0) deselect_all_seq(scene);
- seq->flag |= SELECT;
-
- select_active_side(ed->seqbasep, SEQ_SIDE_RIGHT, seq->machine, seq->startdisp);
- } else {
- if(extend==0) deselect_all_seq(scene);
- seq->flag |= SELECT;
-
- neighbor->flag |= SELECT;
- recurs_sel_seq(neighbor);
- neighbor->flag |= SEQ_LEFTSEL;
- seq->flag |= SEQ_RIGHTSEL;
- }
- break;
+ case SEQ_SIDE_LEFT:
+ if ((seq->flag & SEQ_LEFTSEL) && (neighbor->flag & SEQ_RIGHTSEL)) {
+ if (extend == 0) deselect_all_seq(scene);
+ seq->flag |= SELECT;
+
+ select_active_side(ed->seqbasep, SEQ_SIDE_LEFT, seq->machine, seq->startdisp);
+ }
+ else {
+ if (extend == 0) deselect_all_seq(scene);
+ seq->flag |= SELECT;
+
+ neighbor->flag |= SELECT;
+ recurs_sel_seq(neighbor);
+ neighbor->flag |= SEQ_RIGHTSEL;
+ seq->flag |= SEQ_LEFTSEL;
+ }
+ break;
+ case SEQ_SIDE_RIGHT:
+ if ((seq->flag & SEQ_RIGHTSEL) && (neighbor->flag & SEQ_LEFTSEL)) {
+ if (extend == 0) deselect_all_seq(scene);
+ seq->flag |= SELECT;
+
+ select_active_side(ed->seqbasep, SEQ_SIDE_RIGHT, seq->machine, seq->startdisp);
+ }
+ else {
+ if (extend == 0) deselect_all_seq(scene);
+ seq->flag |= SELECT;
+
+ neighbor->flag |= SELECT;
+ recurs_sel_seq(neighbor);
+ neighbor->flag |= SEQ_LEFTSEL;
+ seq->flag |= SEQ_RIGHTSEL;
+ }
+ break;
}
- } else {
- if(extend==0) deselect_all_seq(scene);
+ }
+ else {
+ if (extend == 0) deselect_all_seq(scene);
select_active_side(ed->seqbasep, sel_side, seq->machine, seq->startdisp);
}
}
recurs_sel_seq(seq);
- if(linked_time) {
+ if (linked_time) {
select_linked_time(ed->seqbasep, seq);
}
}
@@ -500,12 +510,12 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
if (marker) {
int mval[2], xo, yo;
// getmouseco_areawin(mval);
- xo= mval[0];
- yo= mval[1];
+ xo = mval[0];
+ yo = mval[1];
- while(get_mbut()) {
+ while (get_mbut()) {
// getmouseco_areawin(mval);
- if(abs(mval[0]-xo)+abs(mval[1]-yo) > 4) {
+ if (abs(mval[0] - xo) + abs(mval[1] - yo) > 4) {
transform_markers('g', 0);
return;
}
@@ -513,30 +523,30 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
#endif
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
/* allowing tweaks */
- return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
+ return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH;
}
void SEQUENCER_OT_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Activate/Select";
- ot->idname= "SEQUENCER_OT_select";
- ot->description="Select a strip (last selected becomes the \"active strip\")";
+ ot->name = "Activate/Select";
+ ot->idname = "SEQUENCER_OT_select";
+ ot->description = "Select a strip (last selected becomes the \"active strip\")";
/* api callbacks */
- ot->invoke= sequencer_select_invoke;
- ot->poll= ED_operator_sequencer_active;
+ ot->invoke = sequencer_select_invoke;
+ ot->poll = ED_operator_sequencer_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection");
RNA_def_boolean(ot->srna, "linked_handle", 0, "Linked Handle", "Select handles next to the active strip");
- /* for animation this is an enum but atm having an enum isnt useful for us */
+ /* for animation this is an enum but atm having an enum isn't useful for us */
RNA_def_boolean(ot->srna, "left_right", 0, "Left/Right", "Select based on the current frame side the cursor is on");
RNA_def_boolean(ot->srna, "linked_time", 0, "Linked Time", "Select other strips at the same time");
}
@@ -547,44 +557,45 @@ void SEQUENCER_OT_select(wmOperatorType *ot)
/* run recursively to select linked */
static int select_more_less_seq__internal(Scene *scene, int sel, int linked)
{
- Editing *ed= seq_give_editing(scene, FALSE);
+ Editing *ed = seq_give_editing(scene, FALSE);
Sequence *seq, *neighbor;
- int change=0;
+ int change = 0;
int isel;
- if(ed==NULL) return 0;
+ if (ed == NULL) return 0;
if (sel) {
sel = SELECT;
isel = 0;
- } else {
+ }
+ else {
sel = 0;
isel = SELECT;
}
if (!linked) {
/* if not linked we only want to touch each seq once, newseq */
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
seq->tmp = NULL;
}
}
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- if((int)(seq->flag & SELECT) == sel) {
- if ((linked==0 && seq->tmp)==0) {
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if ((int)(seq->flag & SELECT) == sel) {
+ if ((linked == 0 && seq->tmp) == 0) {
/* only get unselected nabours */
neighbor = find_neighboring_sequence(scene, seq, SEQ_SIDE_LEFT, isel);
if (neighbor) {
- if (sel) {neighbor->flag |= SELECT; recurs_sel_seq(neighbor);}
- else neighbor->flag &= ~SELECT;
- if (linked==0) neighbor->tmp = (Sequence *)1;
+ if (sel) {neighbor->flag |= SELECT; recurs_sel_seq(neighbor); }
+ else neighbor->flag &= ~SELECT;
+ if (linked == 0) neighbor->tmp = (Sequence *)1;
change = 1;
}
neighbor = find_neighboring_sequence(scene, seq, SEQ_SIDE_RIGHT, isel);
if (neighbor) {
- if (sel) {neighbor->flag |= SELECT; recurs_sel_seq(neighbor);}
- else neighbor->flag &= ~SELECT;
- if (linked==0) neighbor->tmp = (void *)1;
+ if (sel) {neighbor->flag |= SELECT; recurs_sel_seq(neighbor); }
+ else neighbor->flag &= ~SELECT;
+ if (linked == 0) neighbor->tmp = (void *)1;
change = 1;
}
}
@@ -599,12 +610,12 @@ static int select_more_less_seq__internal(Scene *scene, int sel, int linked)
/* select more operator */
static int sequencer_select_more_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
- if(!select_more_less_seq__internal(scene, 0, 0))
+ if (!select_more_less_seq__internal(scene, 0, 0))
return OPERATOR_CANCELLED;
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -612,16 +623,16 @@ static int sequencer_select_more_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_select_more(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select More";
- ot->idname= "SEQUENCER_OT_select_more";
- ot->description="Select more strips adjacent to the current selection";
+ ot->name = "Select More";
+ ot->idname = "SEQUENCER_OT_select_more";
+ ot->description = "Select more strips adjacent to the current selection";
/* api callbacks */
- ot->exec= sequencer_select_more_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_select_more_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
}
@@ -630,12 +641,12 @@ void SEQUENCER_OT_select_more(wmOperatorType *ot)
/* select less operator */
static int sequencer_select_less_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
- if(!select_more_less_seq__internal(scene, 1, 0))
+ if (!select_more_less_seq__internal(scene, 1, 0))
return OPERATOR_CANCELLED;
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -643,16 +654,16 @@ static int sequencer_select_less_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_select_less(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Less";
- ot->idname= "SEQUENCER_OT_select_less";
- ot->description="Shrink the current selection of adjacent selected strips";
+ ot->name = "Select Less";
+ ot->idname = "SEQUENCER_OT_select_less";
+ ot->description = "Shrink the current selection of adjacent selected strips";
/* api callbacks */
- ot->exec= sequencer_select_less_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_select_less_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
}
@@ -661,20 +672,20 @@ void SEQUENCER_OT_select_less(wmOperatorType *ot)
/* select pick linked operator (uses the mouse) */
static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- Scene *scene= CTX_data_scene(C);
- View2D *v2d= UI_view2d_fromcontext(C);
+ Scene *scene = CTX_data_scene(C);
+ View2D *v2d = UI_view2d_fromcontext(C);
- short extend= RNA_boolean_get(op->ptr, "extend");
+ short extend = RNA_boolean_get(op->ptr, "extend");
Sequence *mouse_seq;
int selected, hand;
/* this works like UV, not mesh */
- mouse_seq= find_nearest_seq(scene, v2d, &hand, event->mval);
+ mouse_seq = find_nearest_seq(scene, v2d, &hand, event->mval);
if (!mouse_seq)
- return OPERATOR_FINISHED; /* user error as with mesh?? */
+ return OPERATOR_FINISHED; /* user error as with mesh?? */
- if (extend==0)
+ if (extend == 0)
deselect_all_seq(scene);
mouse_seq->flag |= SELECT;
@@ -685,7 +696,7 @@ static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEv
selected = select_more_less_seq__internal(scene, 1, 1);
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -693,16 +704,16 @@ static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEv
void SEQUENCER_OT_select_linked_pick(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select pick linked";
- ot->idname= "SEQUENCER_OT_select_linked_pick";
- ot->description="Select a chain of linked strips nearest to the mouse pointer";
+ ot->name = "Select pick linked";
+ ot->idname = "SEQUENCER_OT_select_linked_pick";
+ ot->description = "Select a chain of linked strips nearest to the mouse pointer";
/* api callbacks */
- ot->invoke= sequencer_select_linked_pick_invoke;
- ot->poll= ED_operator_sequencer_active;
+ ot->invoke = sequencer_select_linked_pick_invoke;
+ ot->poll = ED_operator_sequencer_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection");
@@ -712,7 +723,7 @@ void SEQUENCER_OT_select_linked_pick(wmOperatorType *ot)
/* select linked operator */
static int sequencer_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
int selected;
selected = 1;
@@ -720,7 +731,7 @@ static int sequencer_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
selected = select_more_less_seq__internal(scene, 1, 1);
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -728,16 +739,16 @@ static int sequencer_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_select_linked(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select linked";
- ot->idname= "SEQUENCER_OT_select_linked";
- ot->description="Select all strips adjacent to the current selection";
+ ot->name = "Select linked";
+ ot->idname = "SEQUENCER_OT_select_linked";
+ ot->description = "Select all strips adjacent to the current selection";
/* api callbacks */
- ot->exec= sequencer_select_linked_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_select_linked_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
}
@@ -746,31 +757,31 @@ void SEQUENCER_OT_select_linked(wmOperatorType *ot)
/* select handles operator */
static int sequencer_select_handles_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, 0);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, 0);
Sequence *seq;
- int sel_side= RNA_enum_get(op->ptr, "side");
+ int sel_side = RNA_enum_get(op->ptr, "side");
- for(seq= ed->seqbasep->first; seq; seq=seq->next) {
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT) {
- switch(sel_side) {
- case SEQ_SIDE_LEFT:
- seq->flag &= ~SEQ_RIGHTSEL;
- seq->flag |= SEQ_LEFTSEL;
- break;
- case SEQ_SIDE_RIGHT:
- seq->flag &= ~SEQ_LEFTSEL;
- seq->flag |= SEQ_RIGHTSEL;
- break;
- case SEQ_SIDE_BOTH:
- seq->flag |= SEQ_LEFTSEL+SEQ_RIGHTSEL;
- break;
+ switch (sel_side) {
+ case SEQ_SIDE_LEFT:
+ seq->flag &= ~SEQ_RIGHTSEL;
+ seq->flag |= SEQ_LEFTSEL;
+ break;
+ case SEQ_SIDE_RIGHT:
+ seq->flag &= ~SEQ_LEFTSEL;
+ seq->flag |= SEQ_RIGHTSEL;
+ break;
+ case SEQ_SIDE_BOTH:
+ seq->flag |= SEQ_LEFTSEL + SEQ_RIGHTSEL;
+ break;
}
}
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -778,16 +789,16 @@ static int sequencer_select_handles_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_select_handles(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Handles";
- ot->idname= "SEQUENCER_OT_select_handles";
- ot->description="Select manipulator handles on the sides of the selected strip";
+ ot->name = "Select Handles";
+ ot->idname = "SEQUENCER_OT_select_handles";
+ ot->description = "Select manipulator handles on the sides of the selected strip";
/* api callbacks */
- ot->exec= sequencer_select_handles_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_select_handles_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "side", prop_side_types, SEQ_SIDE_BOTH, "Side", "The side of the handle that is selected");
@@ -796,18 +807,18 @@ void SEQUENCER_OT_select_handles(wmOperatorType *ot)
/* select side operator */
static int sequencer_select_active_side_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, 0);
- Sequence *seq_act= seq_active_get(scene);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, 0);
+ Sequence *seq_act = seq_active_get(scene);
- if (ed==NULL || seq_act==NULL)
+ if (ed == NULL || seq_act == NULL)
return OPERATOR_CANCELLED;
seq_act->flag |= SELECT;
select_active_side(ed->seqbasep, RNA_enum_get(op->ptr, "side"), seq_act->machine, seq_act->startdisp);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -815,16 +826,16 @@ static int sequencer_select_active_side_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_select_active_side(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Active Side";
- ot->idname= "SEQUENCER_OT_select_active_side";
- ot->description="Select strips on the nominated side of the active strip";
+ ot->name = "Select Active Side";
+ ot->idname = "SEQUENCER_OT_select_active_side";
+ ot->description = "Select strips on the nominated side of the active strip";
/* api callbacks */
- ot->exec= sequencer_select_active_side_exec;
- ot->poll= sequencer_edit_poll;
+ ot->exec = sequencer_select_active_side_exec;
+ ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "side", prop_side_types, SEQ_SIDE_BOTH, "Side", "The side of the handle that is selected");
@@ -834,47 +845,47 @@ void SEQUENCER_OT_select_active_side(wmOperatorType *ot)
/* borderselect operator */
static int sequencer_borderselect_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, FALSE);
- View2D *v2d= UI_view2d_fromcontext(C);
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, FALSE);
+ View2D *v2d = UI_view2d_fromcontext(C);
Sequence *seq;
rcti rect;
rctf rectf, rq;
- short selecting = (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT);
+ short selecting = (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT);
int extend = RNA_boolean_get(op->ptr, "extend");
int mval[2];
- if(ed==NULL)
+ if (ed == NULL)
return OPERATOR_CANCELLED;
- 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");
+ 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");
- mval[0]= rect.xmin;
- mval[1]= rect.ymin;
+ 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;
+ mval[0] = rect.xmax;
+ mval[1] = rect.ymax;
UI_view2d_region_to_view(v2d, mval[0], mval[1], &rectf.xmax, &rectf.ymax);
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
seq_rectf(seq, &rq);
- if(BLI_isect_rctf(&rq, &rectf, NULL)) {
- if(selecting) seq->flag |= SELECT;
- else seq->flag &= ~SEQ_ALLSEL;
+ if (BLI_isect_rctf(&rq, &rectf, NULL)) {
+ if (selecting) seq->flag |= SELECT;
+ else seq->flag &= ~SEQ_ALLSEL;
recurs_sel_seq(seq);
}
- else if(!extend) {
+ else if (!extend) {
seq->flag &= ~SEQ_ALLSEL;
recurs_sel_seq(seq);
}
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -884,20 +895,20 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Border Select";
- ot->idname= "SEQUENCER_OT_select_border";
- ot->description="Enable border select mode";
+ ot->name = "Border Select";
+ ot->idname = "SEQUENCER_OT_select_border";
+ ot->description = "Enable border select mode";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= sequencer_borderselect_exec;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = sequencer_borderselect_exec;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= ED_operator_sequencer_active;
+ ot->poll = ED_operator_sequencer_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* rna */
WM_operator_properties_gesture_border(ot, TRUE);
@@ -909,11 +920,11 @@ static EnumPropertyItem sequencer_prop_select_grouped_types[] = {
{1, "TYPE", 0, "Type", "Shared strip type"},
{2, "TYPE_BASIC", 0, "Global Type", "All strips of same basic type (Graphical or Sound)"},
{3, "TYPE_EFFECT", 0, "Effect Type",
- "Shared strip effect type (if active strip is not an effect one, select all non-effect strips)"},
+ "Shared strip effect type (if active strip is not an effect one, select all non-effect strips)"},
{4, "DATA", 0, "Data", "Shared data (scene, image, sound, etc.)"},
{5, "EFFECT", 0, "Effect", "Shared effects"},
{6, "EFFECT_LINK", 0, "Effect/Linked",
- "Other strips affected by the active one (sharing some time, and below or effect-assigned)"},
+ "Other strips affected by the active one (sharing some time, and below or effect-assigned)"},
{7, "OVERLAP", 0, "Overlap", "Overlapping time"},
{0, NULL, 0, NULL, NULL}
};
@@ -922,7 +933,7 @@ static EnumPropertyItem sequencer_prop_select_grouped_types[] = {
#define SEQ_IS_EFFECT(_seq) (_seq->type & SEQ_EFFECT)
-#define SEQ_USE_DATA(_seq) (_seq->type == SEQ_SCENE || SEQ_HAS_PATH(_seq))
+#define SEQ_USE_DATA(_seq) (ELEM(_seq->type, SEQ_SCENE, SEQ_MOVIECLIP) || SEQ_HAS_PATH(_seq))
static short select_grouped_type(Editing *ed, Sequence *actseq)
{
@@ -978,7 +989,6 @@ static short select_grouped_data(Editing *ed, Sequence *actseq)
{
Sequence *seq;
short changed = FALSE;
- Scene *sce = actseq->scene;
char *dir = actseq->strip ? actseq->strip->dir : NULL;
if (!SEQ_USE_DATA(actseq))
@@ -993,7 +1003,8 @@ static short select_grouped_data(Editing *ed, Sequence *actseq)
}
SEQ_END;
}
- else {
+ else if (actseq->type == SEQ_SCENE) {
+ Scene *sce = actseq->scene;
SEQP_BEGIN(ed, seq) {
if (seq->type == SEQ_SCENE && seq->scene == sce) {
seq->flag |= SELECT;
@@ -1002,6 +1013,16 @@ static short select_grouped_data(Editing *ed, Sequence *actseq)
}
SEQ_END;
}
+ else if (actseq->type == SEQ_MOVIECLIP) {
+ MovieClip *clip = actseq->clip;
+ SEQP_BEGIN(ed, seq) {
+ if (seq->type == SEQ_MOVIECLIP && seq->clip == clip) {
+ seq->flag |= SELECT;
+ changed = TRUE;
+ }
+ }
+ SEQ_END;
+ }
return changed;
}
@@ -1010,7 +1031,7 @@ static short select_grouped_effect(Editing *ed, Sequence *actseq)
{
Sequence *seq;
short changed = FALSE;
- short effects[SEQ_EFFECT_MAX+1];
+ short effects[SEQ_EFFECT_MAX + 1];
int i;
for (i = 0; i <= SEQ_EFFECT_MAX; i++)
@@ -1025,9 +1046,9 @@ static short select_grouped_effect(Editing *ed, Sequence *actseq)
SEQP_BEGIN(ed, seq) {
if (effects[seq->type]) {
- if(seq->seq1) seq->seq1->flag |= SELECT;
- if(seq->seq2) seq->seq2->flag |= SELECT;
- if(seq->seq3) seq->seq3->flag |= SELECT;
+ if (seq->seq1) seq->seq1->flag |= SELECT;
+ if (seq->seq2) seq->seq2->flag |= SELECT;
+ if (seq->seq3) seq->seq3->flag |= SELECT;
changed = TRUE;
}
}
@@ -1067,9 +1088,9 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq)
}
SEQ_END;
- actseq->tmp= SET_INT_IN_POINTER(TRUE);
+ actseq->tmp = SET_INT_IN_POINTER(TRUE);
- for(seq_begin(ed, &iter, 1); iter.valid; seq_next(&iter)) {
+ for (seq_begin(ed, &iter, 1); iter.valid; seq_next(&iter)) {
seq = iter.seq;
/* Ignore all seqs already selected! */
@@ -1089,12 +1110,12 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq)
if (enddisp < seq->enddisp) enddisp = seq->enddisp;
if (machine < seq->machine) machine = seq->machine;
- seq->tmp= SET_INT_IN_POINTER(TRUE);
+ seq->tmp = SET_INT_IN_POINTER(TRUE);
seq->flag |= SELECT;
changed = TRUE;
- /* Unfortunately, we must restart checks from the begining. */
+ /* Unfortunately, we must restart checks from the beginning. */
seq_end(&iter);
seq_begin(ed, &iter, 1);
}
@@ -1110,6 +1131,10 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq)
return changed;
}
+#undef SEQ_IS_SOUND
+#undef SEQ_IS_EFFECT
+#undef SEQ_USE_DATA
+
static int sequencer_select_grouped_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
@@ -1133,16 +1158,16 @@ static int sequencer_select_grouped_exec(bContext *C, wmOperator *op)
SEQ_END;
}
- if(type==1) changed |= select_grouped_type(ed, actseq);
- else if(type==2) changed |= select_grouped_type_basic(ed, actseq);
- else if(type==3) changed |= select_grouped_type_effect(ed, actseq);
- else if(type==4) changed |= select_grouped_data(ed, actseq);
- else if(type==5) changed |= select_grouped_effect(ed, actseq);
- else if(type==6) changed |= select_grouped_effect_link(ed, actseq);
- else if(type==7) changed |= select_grouped_time_overlap(ed, actseq);
+ if (type == 1) changed |= select_grouped_type(ed, actseq);
+ else if (type == 2) changed |= select_grouped_type_basic(ed, actseq);
+ else if (type == 3) changed |= select_grouped_type_effect(ed, actseq);
+ else if (type == 4) changed |= select_grouped_data(ed, actseq);
+ else if (type == 5) changed |= select_grouped_effect(ed, actseq);
+ else if (type == 6) changed |= select_grouped_effect_link(ed, actseq);
+ else if (type == 7) changed |= select_grouped_time_overlap(ed, actseq);
if (changed) {
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -1162,7 +1187,7 @@ void SEQUENCER_OT_select_grouped(wmOperatorType *ot)
ot->poll = sequencer_edit_poll;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 303f6912ff1..82965426b6d 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -56,7 +56,7 @@
#include "UI_resources.h"
#include "UI_view2d.h"
-#include "sequencer_intern.h" // own include
+#include "sequencer_intern.h" // own include
/* ******************** manage regions ********************* */
@@ -64,20 +64,20 @@ ARegion *sequencer_has_buttons_region(ScrArea *sa)
{
ARegion *ar, *arnew;
- ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
- if(ar) return ar;
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_UI);
+ if (ar) return ar;
/* add subdiv level; after header */
- ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
/* is error! */
- if(ar==NULL) return NULL;
+ if (ar == NULL) return NULL;
- arnew= MEM_callocN(sizeof(ARegion), "buttons for sequencer");
+ arnew = MEM_callocN(sizeof(ARegion), "buttons for sequencer");
BLI_insertlinkafter(&sa->regionbase, ar, arnew);
- arnew->regiontype= RGN_TYPE_UI;
- arnew->alignment= RGN_ALIGN_RIGHT;
+ arnew->regiontype = RGN_TYPE_UI;
+ arnew->alignment = RGN_ALIGN_RIGHT;
arnew->flag = RGN_FLAG_HIDDEN;
@@ -86,10 +86,10 @@ ARegion *sequencer_has_buttons_region(ScrArea *sa)
static ARegion *sequencer_find_region(ScrArea *sa, short type)
{
- ARegion *ar=NULL;
+ ARegion *ar = NULL;
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->regiontype==type)
+ for (ar = sa->regionbase.first; ar; ar = ar->next)
+ if (ar->regiontype == type)
return ar;
return ar;
@@ -99,84 +99,84 @@ static ARegion *sequencer_find_region(ScrArea *sa, short type)
static SpaceLink *sequencer_new(const bContext *C)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
ARegion *ar;
SpaceSeq *sseq;
- sseq= MEM_callocN(sizeof(SpaceSeq), "initsequencer");
- sseq->spacetype= SPACE_SEQ;
+ sseq = MEM_callocN(sizeof(SpaceSeq), "initsequencer");
+ sseq->spacetype = SPACE_SEQ;
sseq->chanshown = 0;
sseq->view = SEQ_VIEW_SEQUENCE;
sseq->mainb = SEQ_DRAW_IMG_IMBUF;
/* header */
- ar= MEM_callocN(sizeof(ARegion), "header for sequencer");
+ ar = MEM_callocN(sizeof(ARegion), "header for sequencer");
BLI_addtail(&sseq->regionbase, ar);
- ar->regiontype= RGN_TYPE_HEADER;
- ar->alignment= RGN_ALIGN_BOTTOM;
+ ar->regiontype = RGN_TYPE_HEADER;
+ ar->alignment = RGN_ALIGN_BOTTOM;
/* buttons/list view */
- ar= MEM_callocN(sizeof(ARegion), "buttons for sequencer");
+ ar = MEM_callocN(sizeof(ARegion), "buttons for sequencer");
BLI_addtail(&sseq->regionbase, ar);
- ar->regiontype= RGN_TYPE_UI;
- ar->alignment= RGN_ALIGN_RIGHT;
+ ar->regiontype = RGN_TYPE_UI;
+ ar->alignment = RGN_ALIGN_RIGHT;
ar->flag = RGN_FLAG_HIDDEN;
/* preview area */
/* NOTE: if you change values here, also change them in sequencer_init_preview_region */
- ar= MEM_callocN(sizeof(ARegion), "preview area for sequencer");
+ ar = MEM_callocN(sizeof(ARegion), "preview area for sequencer");
BLI_addtail(&sseq->regionbase, ar);
- ar->regiontype= RGN_TYPE_PREVIEW;
- ar->alignment= RGN_ALIGN_TOP;
+ ar->regiontype = RGN_TYPE_PREVIEW;
+ ar->alignment = RGN_ALIGN_TOP;
ar->flag |= RGN_FLAG_HIDDEN;
/* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */
- ar->v2d.keepzoom= V2D_KEEPASPECT | V2D_KEEPZOOM;
- ar->v2d.minzoom= 0.00001f;
- ar->v2d.maxzoom= 100000.0f;
- ar->v2d.tot.xmin= -960.0f; /* 1920 width centered */
- ar->v2d.tot.ymin= -540.0f; /* 1080 height centered */
- ar->v2d.tot.xmax= 960.0f;
- ar->v2d.tot.ymax= 540.0f;
- ar->v2d.min[0]= 0.0f;
- ar->v2d.min[1]= 0.0f;
- ar->v2d.max[0]= 12000.0f;
- ar->v2d.max[1]= 12000.0f;
- ar->v2d.cur= ar->v2d.tot;
- ar->v2d.align= V2D_ALIGN_FREE;
- ar->v2d.keeptot= V2D_KEEPTOT_FREE;
+ ar->v2d.keepzoom = V2D_KEEPASPECT | V2D_KEEPZOOM;
+ ar->v2d.minzoom = 0.00001f;
+ ar->v2d.maxzoom = 100000.0f;
+ ar->v2d.tot.xmin = -960.0f; /* 1920 width centered */
+ ar->v2d.tot.ymin = -540.0f; /* 1080 height centered */
+ ar->v2d.tot.xmax = 960.0f;
+ ar->v2d.tot.ymax = 540.0f;
+ ar->v2d.min[0] = 0.0f;
+ ar->v2d.min[1] = 0.0f;
+ ar->v2d.max[0] = 12000.0f;
+ ar->v2d.max[1] = 12000.0f;
+ ar->v2d.cur = ar->v2d.tot;
+ ar->v2d.align = V2D_ALIGN_FREE;
+ ar->v2d.keeptot = V2D_KEEPTOT_FREE;
/* main area */
- ar= MEM_callocN(sizeof(ARegion), "main area for sequencer");
+ ar = MEM_callocN(sizeof(ARegion), "main area for sequencer");
BLI_addtail(&sseq->regionbase, ar);
- ar->regiontype= RGN_TYPE_WINDOW;
+ ar->regiontype = RGN_TYPE_WINDOW;
/* seq space goes from (0,8) to (0, efra) */
- ar->v2d.tot.xmin= 0.0f;
- ar->v2d.tot.ymin= 0.0f;
- ar->v2d.tot.xmax= scene->r.efra;
- ar->v2d.tot.ymax= 8.0f;
+ ar->v2d.tot.xmin = 0.0f;
+ ar->v2d.tot.ymin = 0.0f;
+ ar->v2d.tot.xmax = scene->r.efra;
+ ar->v2d.tot.ymax = 8.0f;
- ar->v2d.cur= ar->v2d.tot;
+ ar->v2d.cur = ar->v2d.tot;
- ar->v2d.min[0]= 10.0f;
- ar->v2d.min[1]= 0.5f;
+ ar->v2d.min[0] = 10.0f;
+ ar->v2d.min[1] = 0.5f;
- ar->v2d.max[0]= MAXFRAMEF;
- ar->v2d.max[1]= MAXSEQ;
+ ar->v2d.max[0] = MAXFRAMEF;
+ ar->v2d.max[1] = MAXSEQ;
- ar->v2d.minzoom= 0.01f;
- ar->v2d.maxzoom= 100.0f;
-
- ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
- ar->v2d.scroll |= (V2D_SCROLL_LEFT|V2D_SCROLL_SCALE_VERTICAL);
- ar->v2d.keepzoom= 0;
- ar->v2d.keeptot= 0;
- ar->v2d.align= V2D_ALIGN_NO_NEG_Y;
+ ar->v2d.minzoom = 0.01f;
+ ar->v2d.maxzoom = 100.0f;
+
+ ar->v2d.scroll |= (V2D_SCROLL_BOTTOM | V2D_SCROLL_SCALE_HORIZONTAL);
+ ar->v2d.scroll |= (V2D_SCROLL_LEFT | V2D_SCROLL_SCALE_VERTICAL);
+ ar->v2d.keepzoom = 0;
+ ar->v2d.keeptot = 0;
+ ar->v2d.align = V2D_ALIGN_NO_NEG_Y;
return (SpaceLink *)sseq;
}
@@ -186,7 +186,7 @@ static void sequencer_free(SpaceLink *UNUSED(sl))
{
// SpaceSeq *sseq= (SpaceSequencer*) sl;
-// XXX if(sseq->gpd) free_gpencil_data(sseq->gpd);
+// XXX if (sseq->gpd) free_gpencil_data(sseq->gpd);
}
@@ -199,81 +199,81 @@ static void sequencer_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(s
static void sequencer_refresh(const bContext *C, ScrArea *sa)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- wmWindow *window= CTX_wm_window(C);
- SpaceSeq *sseq= (SpaceSeq *)sa->spacedata.first;
- ARegion *ar_main= sequencer_find_region(sa, RGN_TYPE_WINDOW);
- ARegion *ar_preview= sequencer_find_region(sa, RGN_TYPE_PREVIEW);
- int view_changed= 0;
+ wmWindowManager *wm = CTX_wm_manager(C);
+ wmWindow *window = CTX_wm_window(C);
+ SpaceSeq *sseq = (SpaceSeq *)sa->spacedata.first;
+ ARegion *ar_main = sequencer_find_region(sa, RGN_TYPE_WINDOW);
+ ARegion *ar_preview = sequencer_find_region(sa, RGN_TYPE_PREVIEW);
+ int view_changed = 0;
switch (sseq->view) {
case SEQ_VIEW_SEQUENCE:
if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) {
ar_main->flag &= ~RGN_FLAG_HIDDEN;
ar_main->v2d.flag &= ~V2D_IS_INITIALISED;
- view_changed= 1;
+ view_changed = 1;
}
if (ar_preview && !(ar_preview->flag & RGN_FLAG_HIDDEN)) {
ar_preview->flag |= RGN_FLAG_HIDDEN;
ar_preview->v2d.flag &= ~V2D_IS_INITIALISED;
- WM_event_remove_handlers((bContext*)C, &ar_preview->handlers);
- view_changed= 1;
+ WM_event_remove_handlers((bContext *)C, &ar_preview->handlers);
+ view_changed = 1;
}
if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) {
- ar_main->alignment= RGN_ALIGN_NONE;
- view_changed= 1;
+ ar_main->alignment = RGN_ALIGN_NONE;
+ view_changed = 1;
}
if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) {
- ar_preview->alignment= RGN_ALIGN_NONE;
- view_changed= 1;
+ ar_preview->alignment = RGN_ALIGN_NONE;
+ view_changed = 1;
}
break;
case SEQ_VIEW_PREVIEW:
if (ar_main && !(ar_main->flag & RGN_FLAG_HIDDEN)) {
ar_main->flag |= RGN_FLAG_HIDDEN;
ar_main->v2d.flag &= ~V2D_IS_INITIALISED;
- WM_event_remove_handlers((bContext*)C, &ar_main->handlers);
- view_changed= 1;
+ WM_event_remove_handlers((bContext *)C, &ar_main->handlers);
+ view_changed = 1;
}
if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) {
ar_preview->flag &= ~RGN_FLAG_HIDDEN;
ar_preview->v2d.flag &= ~V2D_IS_INITIALISED;
ar_preview->v2d.cur = ar_preview->v2d.tot;
- view_changed= 1;
+ view_changed = 1;
}
if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) {
- ar_main->alignment= RGN_ALIGN_NONE;
- view_changed= 1;
+ ar_main->alignment = RGN_ALIGN_NONE;
+ view_changed = 1;
}
if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) {
- ar_preview->alignment= RGN_ALIGN_NONE;
- view_changed= 1;
+ ar_preview->alignment = RGN_ALIGN_NONE;
+ view_changed = 1;
}
break;
case SEQ_VIEW_SEQUENCE_PREVIEW:
if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) {
ar_main->flag &= ~RGN_FLAG_HIDDEN;
ar_main->v2d.flag &= ~V2D_IS_INITIALISED;
- view_changed= 1;
+ view_changed = 1;
}
if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) {
ar_preview->flag &= ~RGN_FLAG_HIDDEN;
ar_preview->v2d.flag &= ~V2D_IS_INITIALISED;
ar_preview->v2d.cur = ar_preview->v2d.tot;
- view_changed= 1;
+ view_changed = 1;
}
if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) {
- ar_main->alignment= RGN_ALIGN_NONE;
- view_changed= 1;
+ ar_main->alignment = RGN_ALIGN_NONE;
+ view_changed = 1;
}
if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP) {
- ar_preview->alignment= RGN_ALIGN_TOP;
- view_changed= 1;
+ ar_preview->alignment = RGN_ALIGN_TOP;
+ view_changed = 1;
}
break;
}
- if(view_changed) {
+ if (view_changed) {
ED_area_initialize(wm, window, sa);
ED_area_tag_redraw(sa);
}
@@ -281,7 +281,7 @@ static void sequencer_refresh(const bContext *C, ScrArea *sa)
static SpaceLink *sequencer_duplicate(SpaceLink *sl)
{
- SpaceSeq *sseqn= MEM_dupallocN(sl);
+ SpaceSeq *sseqn = MEM_dupallocN(sl);
/* clear or remove stuff from old */
// XXX sseq->gpd= gpencil_data_duplicate(sseq->gpd);
@@ -300,15 +300,15 @@ static void sequencer_main_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
- keymap= WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "Sequencer", SPACE_SEQ, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Sequencer", SPACE_SEQ, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* add drop boxes */
- lb= WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW);
+ lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW);
WM_event_add_dropbox_handler(&ar->handlers, lb);
@@ -326,24 +326,24 @@ static void sequencer_main_area_draw(const bContext *C, ARegion *ar)
static int image_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
- if(drag->type==WM_DRAG_PATH)
- if(ELEM(drag->icon, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */
+ if (drag->type == WM_DRAG_PATH)
+ if (ELEM(drag->icon, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */
return 1;
return 0;
}
static int movie_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
- if(drag->type==WM_DRAG_PATH)
- if(ELEM3(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */
+ if (drag->type == WM_DRAG_PATH)
+ if (ELEM3(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */
return 1;
return 0;
}
static int sound_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
- if(drag->type==WM_DRAG_PATH)
- if(ELEM(drag->icon, ICON_FILE_SOUND, ICON_FILE_BLANK)) /* rule might not work? */
+ if (drag->type == WM_DRAG_PATH)
+ if (ELEM(drag->icon, ICON_FILE_SOUND, ICON_FILE_BLANK)) /* rule might not work? */
return 1;
return 0;
}
@@ -351,10 +351,10 @@ static int sound_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(ev
static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop)
{
/* copy drag path to properties */
- if(RNA_struct_find_property(drop->ptr, "filepath"))
+ if (RNA_struct_find_property(drop->ptr, "filepath"))
RNA_string_set(drop->ptr, "filepath", drag->path);
- if(RNA_struct_find_property(drop->ptr, "directory")) {
+ if (RNA_struct_find_property(drop->ptr, "directory")) {
PointerRNA itemptr;
char dir[FILE_MAX], file[FILE_MAX];
@@ -371,7 +371,7 @@ static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop)
/* this region dropbox definition */
static void sequencer_dropboxes(void)
{
- ListBase *lb= WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW);
+ ListBase *lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW);
WM_dropbox_add(lb, "SEQUENCER_OT_image_strip_add", image_drop_poll, sequencer_drop_copy);
WM_dropbox_add(lb, "SEQUENCER_OT_movie_strip_add", movie_drop_poll, sequencer_drop_copy);
@@ -394,9 +394,9 @@ static void sequencer_header_area_draw(const bContext *C, ARegion *ar)
static void sequencer_main_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_SCENE:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_FRAME:
case ND_FRAME_RANGE:
case ND_MARKERS:
@@ -407,11 +407,11 @@ static void sequencer_main_area_listener(ARegion *ar, wmNotifier *wmn)
}
break;
case NC_SPACE:
- if(wmn->data == ND_SPACE_SEQUENCER)
+ if (wmn->data == ND_SPACE_SEQUENCER)
ED_region_tag_redraw(ar);
break;
case NC_ID:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
}
@@ -424,34 +424,34 @@ static void sequencer_preview_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
- keymap= WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "SequencerPreview", SPACE_SEQ, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "SequencerPreview", SPACE_SEQ, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
static void sequencer_preview_area_draw(const bContext *C, ARegion *ar)
{
- ScrArea *sa= CTX_wm_area(C);
- SpaceSeq *sseq= sa->spacedata.first;
- Scene *scene= CTX_data_scene(C);
+ ScrArea *sa = CTX_wm_area(C);
+ SpaceSeq *sseq = sa->spacedata.first;
+ Scene *scene = CTX_data_scene(C);
/* XXX temp fix for wrong setting in sseq->mainb */
if (sseq->mainb == SEQ_DRAW_SEQUENCE) sseq->mainb = SEQ_DRAW_IMG_IMBUF;
draw_image_seq(C, scene, ar, sseq, scene->r.cfra, 0);
- if(scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW && sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
+ if (scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW && sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
int over_cfra;
- if(scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS)
- over_cfra= scene->ed->over_cfra;
+ if (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS)
+ over_cfra = scene->ed->over_cfra;
else
- over_cfra= scene->r.cfra + scene->ed->over_ofs;
+ over_cfra = scene->r.cfra + scene->ed->over_ofs;
- if(over_cfra != scene->r.cfra)
+ if (over_cfra != scene->r.cfra)
draw_image_seq(C, scene, ar, sseq, scene->r.cfra, over_cfra - scene->r.cfra);
}
@@ -460,9 +460,9 @@ static void sequencer_preview_area_draw(const bContext *C, ARegion *ar)
static void sequencer_preview_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_SCENE:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_FRAME:
case ND_MARKERS:
case ND_SEQUENCER:
@@ -471,11 +471,11 @@ static void sequencer_preview_area_listener(ARegion *ar, wmNotifier *wmn)
}
break;
case NC_SPACE:
- if(wmn->data == ND_SPACE_SEQUENCER)
+ if (wmn->data == ND_SPACE_SEQUENCER)
ED_region_tag_redraw(ar);
break;
case NC_ID:
- switch(wmn->data) {
+ switch (wmn->data) {
case NA_RENAME:
ED_region_tag_redraw(ar);
break;
@@ -502,21 +502,21 @@ static void sequencer_buttons_area_draw(const bContext *C, ARegion *ar)
static void sequencer_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_SCENE:
- switch(wmn->data) {
- case ND_FRAME:
- case ND_SEQUENCER:
- ED_region_tag_redraw(ar);
- break;
- }
- break;
+ switch (wmn->data) {
+ case ND_FRAME:
+ case ND_SEQUENCER:
+ ED_region_tag_redraw(ar);
+ break;
+ }
+ break;
case NC_SPACE:
- if(wmn->data == ND_SPACE_SEQUENCER)
+ if (wmn->data == ND_SPACE_SEQUENCER)
ED_region_tag_redraw(ar);
break;
case NC_ID:
- if(wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
}
@@ -526,72 +526,72 @@ static void sequencer_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
/* only called once, from space/spacetypes.c */
void ED_spacetype_sequencer(void)
{
- SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype sequencer");
+ SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype sequencer");
ARegionType *art;
- st->spaceid= SPACE_SEQ;
+ st->spaceid = SPACE_SEQ;
strncpy(st->name, "Sequencer", BKE_ST_MAXNAME);
- st->new= sequencer_new;
- st->free= sequencer_free;
- st->init= sequencer_init;
- st->duplicate= sequencer_duplicate;
- st->operatortypes= sequencer_operatortypes;
- st->keymap= sequencer_keymap;
- st->dropboxes= sequencer_dropboxes;
- st->refresh= sequencer_refresh;
+ st->new = sequencer_new;
+ st->free = sequencer_free;
+ st->init = sequencer_init;
+ st->duplicate = sequencer_duplicate;
+ st->operatortypes = sequencer_operatortypes;
+ st->keymap = sequencer_keymap;
+ st->dropboxes = sequencer_dropboxes;
+ st->refresh = sequencer_refresh;
/* regions: main window */
- art= MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
art->regionid = RGN_TYPE_WINDOW;
- art->init= sequencer_main_area_init;
- art->draw= sequencer_main_area_draw;
- art->listener= sequencer_main_area_listener;
- art->keymapflag= ED_KEYMAP_VIEW2D|ED_KEYMAP_MARKERS|ED_KEYMAP_FRAMES|ED_KEYMAP_ANIMATION;
+ art->init = sequencer_main_area_init;
+ art->draw = sequencer_main_area_draw;
+ art->listener = sequencer_main_area_listener;
+ art->keymapflag = ED_KEYMAP_VIEW2D | ED_KEYMAP_MARKERS | ED_KEYMAP_FRAMES | ED_KEYMAP_ANIMATION;
BLI_addhead(&st->regiontypes, art);
/* preview */
- art= MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
art->regionid = RGN_TYPE_PREVIEW;
art->prefsizey = 240; // XXX
- art->init= sequencer_preview_area_init;
- art->draw= sequencer_preview_area_draw;
- art->listener= sequencer_preview_area_listener;
- art->keymapflag= ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES|ED_KEYMAP_ANIMATION;
+ art->init = sequencer_preview_area_init;
+ art->draw = sequencer_preview_area_draw;
+ art->listener = sequencer_preview_area_listener;
+ art->keymapflag = ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES | ED_KEYMAP_ANIMATION;
BLI_addhead(&st->regiontypes, art);
/* regions: listview/buttons */
- art= MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
art->regionid = RGN_TYPE_UI;
- art->prefsizex= 220; // XXX
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES;
- art->listener= sequencer_buttons_area_listener;
- art->init= sequencer_buttons_area_init;
- art->draw= sequencer_buttons_area_draw;
+ art->prefsizex = 220; // XXX
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
+ art->listener = sequencer_buttons_area_listener;
+ art->init = sequencer_buttons_area_init;
+ art->draw = sequencer_buttons_area_draw;
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");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
art->regionid = RGN_TYPE_HEADER;
- art->prefsizey= HEADERY;
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES|ED_KEYMAP_HEADER;
+ art->prefsizey = HEADERY;
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES | ED_KEYMAP_HEADER;
- art->init= sequencer_header_area_init;
- art->draw= sequencer_header_area_draw;
- art->listener= sequencer_main_area_listener;
+ art->init = sequencer_header_area_init;
+ art->draw = sequencer_header_area_draw;
+ art->listener = sequencer_main_area_listener;
BLI_addhead(&st->regiontypes, art);
BKE_spacetype_register(st);
/* set the sequencer callback when not in background mode */
- if(G.background==0) {
- sequencer_view3d_cb= ED_view3d_draw_offscreen_imbuf_simple;
+ if (G.background == 0) {
+ 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..beccca51265 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -60,7 +60,7 @@
#include "RNA_access.h"
-#include "text_intern.h" // own include
+#include "text_intern.h" // own include
/* ******************** default callbacks for text space ***************** */
@@ -69,25 +69,25 @@ static SpaceLink *text_new(const bContext *UNUSED(C))
ARegion *ar;
SpaceText *stext;
- stext= MEM_callocN(sizeof(SpaceText), "inittext");
- stext->spacetype= SPACE_TEXT;
+ stext = MEM_callocN(sizeof(SpaceText), "inittext");
+ stext->spacetype = SPACE_TEXT;
- stext->lheight= 12;
- stext->tabnumber= 4;
- stext->margin_column= 80;
+ stext->lheight = 12;
+ stext->tabnumber = 4;
+ stext->margin_column = 80;
/* header */
- ar= MEM_callocN(sizeof(ARegion), "header for text");
+ ar = MEM_callocN(sizeof(ARegion), "header for text");
BLI_addtail(&stext->regionbase, ar);
- ar->regiontype= RGN_TYPE_HEADER;
- ar->alignment= RGN_ALIGN_BOTTOM;
+ ar->regiontype = RGN_TYPE_HEADER;
+ ar->alignment = RGN_ALIGN_BOTTOM;
/* main area */
- ar= MEM_callocN(sizeof(ARegion), "main area for text");
+ ar = MEM_callocN(sizeof(ARegion), "main area for text");
BLI_addtail(&stext->regionbase, ar);
- ar->regiontype= RGN_TYPE_WINDOW;
+ ar->regiontype = RGN_TYPE_WINDOW;
return (SpaceLink *)stext;
}
@@ -95,9 +95,9 @@ static SpaceLink *text_new(const bContext *UNUSED(C))
/* not spacelink itself */
static void text_free(SpaceLink *sl)
{
- SpaceText *stext= (SpaceText*) sl;
+ SpaceText *stext = (SpaceText *) sl;
- stext->text= NULL;
+ stext->text = NULL;
text_free_caches(stext);
}
@@ -110,55 +110,55 @@ static void text_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa))
static SpaceLink *text_duplicate(SpaceLink *sl)
{
- SpaceText *stextn= MEM_dupallocN(sl);
+ SpaceText *stextn = MEM_dupallocN(sl);
/* clear or remove stuff from old */
- stextn->drawcache= NULL; /* space need it's own cache */
+ stextn->drawcache = NULL; /* space need it's own cache */
return (SpaceLink *)stextn;
}
static void text_listener(ScrArea *sa, wmNotifier *wmn)
{
- SpaceText *st= sa->spacedata.first;
+ SpaceText *st = sa->spacedata.first;
/* context changes */
- switch(wmn->category) {
+ 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 */
- if(wmn->reference && wmn->reference != st->text)
+ * 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;
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_DISPLAY:
ED_area_tag_redraw(sa);
break;
case ND_CURSOR:
- if(st->text && st->text == wmn->reference)
+ if (st->text && st->text == wmn->reference)
text_scroll_to_cursor(st, sa);
ED_area_tag_redraw(sa);
break;
}
- switch(wmn->action) {
+ switch (wmn->action) {
case NA_EDITED:
- if(st->text) {
+ if (st->text) {
text_drawcache_tag_update(st, 1);
text_update_edited(st->text);
}
ED_area_tag_redraw(sa);
- /* no break -- fall down to tag redraw */
+ /* no break -- fall down to tag redraw */
case NA_ADDED:
case NA_REMOVED:
ED_area_tag_redraw(sa);
break;
case NA_SELECTED:
- if(st->text && st->text == wmn->reference)
+ if (st->text && st->text == wmn->reference)
text_scroll_to_cursor(st, sa);
break;
@@ -166,7 +166,7 @@ static void text_listener(ScrArea *sa, wmNotifier *wmn)
break;
case NC_SPACE:
- if(wmn->data == ND_SPACE_TEXT)
+ if (wmn->data == ND_SPACE_TEXT)
ED_area_tag_redraw(sa);
break;
}
@@ -235,7 +235,7 @@ static void text_keymap(struct wmKeyConfig *keyconf)
wmKeyMap *keymap;
wmKeyMapItem *kmi;
- keymap= WM_keymap_find(keyconf, "Text", SPACE_TEXT, 0);
+ keymap = WM_keymap_find(keyconf, "Text", SPACE_TEXT, 0);
#ifdef __APPLE__
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", LEFTARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", LINE_BEGIN);
@@ -245,17 +245,17 @@ static void text_keymap(struct wmKeyConfig *keyconf)
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", UPARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", FILE_TOP);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", DOWNARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", FILE_BOTTOM);
- RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", LEFTARROWKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0)->ptr, "type", LINE_BEGIN);
- RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", RIGHTARROWKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0)->ptr, "type", LINE_END);
- RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", LEFTARROWKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0)->ptr, "type", PREV_WORD);
- RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", RIGHTARROWKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0)->ptr, "type", NEXT_WORD);
- RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", UPARROWKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0)->ptr, "type", FILE_TOP);
- RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", DOWNARROWKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0)->ptr, "type", FILE_BOTTOM);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", LEFTARROWKEY, KM_PRESS, KM_SHIFT | KM_OSKEY, 0)->ptr, "type", LINE_BEGIN);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", RIGHTARROWKEY, KM_PRESS, KM_SHIFT | KM_OSKEY, 0)->ptr, "type", LINE_END);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", LEFTARROWKEY, KM_PRESS, KM_SHIFT | KM_ALT, 0)->ptr, "type", PREV_WORD);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", RIGHTARROWKEY, KM_PRESS, KM_SHIFT | KM_ALT, 0)->ptr, "type", NEXT_WORD);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", UPARROWKEY, KM_PRESS, KM_SHIFT | KM_OSKEY, 0)->ptr, "type", FILE_TOP);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", DOWNARROWKEY, KM_PRESS, KM_SHIFT | KM_OSKEY, 0)->ptr, "type", FILE_BOTTOM);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_delete", BACKSPACEKEY, KM_PRESS, KM_ALT, 0)->ptr, "type", DEL_PREV_WORD);
- WM_keymap_add_item(keymap, "TEXT_OT_save", SKEY, KM_PRESS, KM_ALT|KM_OSKEY, 0);
- WM_keymap_add_item(keymap, "TEXT_OT_save_as", SKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_OSKEY, 0);
+ WM_keymap_add_item(keymap, "TEXT_OT_save", SKEY, KM_PRESS, KM_ALT | KM_OSKEY, 0);
+ WM_keymap_add_item(keymap, "TEXT_OT_save_as", SKEY, KM_PRESS, KM_ALT | KM_SHIFT | KM_OSKEY, 0);
WM_keymap_add_item(keymap, "TEXT_OT_cut", XKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "TEXT_OT_copy", CKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "TEXT_OT_paste", VKEY, KM_PRESS, KM_OSKEY, 0);
@@ -263,7 +263,7 @@ static void text_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "TEXT_OT_find_set_selected", EKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "TEXT_OT_find", GKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "TEXT_OT_select_all", AKEY, KM_PRESS, KM_OSKEY, 0);
- WM_keymap_add_item(keymap, "TEXT_OT_select_line", AKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0);
+ WM_keymap_add_item(keymap, "TEXT_OT_select_line", AKEY, KM_PRESS, KM_SHIFT | KM_OSKEY, 0);
#endif
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0);
@@ -286,7 +286,7 @@ static void text_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "TEXT_OT_open", OKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "TEXT_OT_reload", RKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "TEXT_OT_save", SKEY, KM_PRESS, KM_ALT, 0);
- WM_keymap_add_item(keymap, "TEXT_OT_save_as", SKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "TEXT_OT_save_as", SKEY, KM_PRESS, KM_ALT | KM_SHIFT | KM_CTRL, 0);
WM_keymap_add_item(keymap, "TEXT_OT_run_script", PKEY, KM_PRESS, KM_ALT, 0);
@@ -298,7 +298,7 @@ static void text_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "TEXT_OT_copy", INSERTKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "TEXT_OT_paste", INSERTKEY, KM_PRESS, KM_SHIFT, 0);
- if(U.uiflag & USER_MMB_PASTE) { // XXX not dynamic
+ if (U.uiflag & USER_MMB_PASTE) { // XXX not dynamic
kmi = WM_keymap_add_item(keymap, "TEXT_OT_paste", MIDDLEMOUSE, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "selection", TRUE);
}
@@ -315,19 +315,19 @@ static void text_keymap(struct wmKeyConfig *keyconf)
RNA_boolean_set(kmi->ptr, "split_lines", TRUE);
WM_keymap_add_item(keymap, "TEXT_OT_select_all", AKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_add_item(keymap, "TEXT_OT_select_line", AKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "TEXT_OT_select_line", AKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
WM_keymap_add_item(keymap, "TEXT_OT_select_word", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
WM_keymap_add_item(keymap, "TEXT_OT_indent", TABKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "TEXT_OT_unindent", TABKEY, KM_PRESS, KM_SHIFT, 0);
- WM_keymap_add_item(keymap, "TEXT_OT_uncomment", DKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
+ WM_keymap_add_item(keymap, "TEXT_OT_uncomment", DKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", HOMEKEY, KM_PRESS, 0, 0)->ptr, "type", LINE_BEGIN);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", ENDKEY, KM_PRESS, 0, 0)->ptr, "type", LINE_END);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", EKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", LINE_END);
- RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", EKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "type", LINE_END);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", EKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0)->ptr, "type", LINE_END);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", LEFTARROWKEY, KM_PRESS, 0, 0)->ptr, "type", PREV_CHAR);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", RIGHTARROWKEY, KM_PRESS, 0, 0)->ptr, "type", NEXT_CHAR);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", LEFTARROWKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", PREV_WORD);
@@ -343,14 +343,14 @@ static void text_keymap(struct wmKeyConfig *keyconf)
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", ENDKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", LINE_END);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", LEFTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", PREV_CHAR);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", RIGHTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", NEXT_CHAR);
- RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", LEFTARROWKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "type", PREV_WORD);
- RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", RIGHTARROWKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "type", NEXT_WORD);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", LEFTARROWKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0)->ptr, "type", PREV_WORD);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", RIGHTARROWKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0)->ptr, "type", NEXT_WORD);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", UPARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", PREV_LINE);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", DOWNARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", NEXT_LINE);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", PAGEUPKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", PREV_PAGE);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", PAGEDOWNKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", NEXT_PAGE);
- RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", HOMEKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "type", FILE_TOP);
- RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", ENDKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "type", FILE_BOTTOM);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", HOMEKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0)->ptr, "type", FILE_TOP);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", ENDKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0)->ptr, "type", FILE_BOTTOM);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_delete", DELKEY, KM_PRESS, 0, 0)->ptr, "type", DEL_NEXT_CHAR);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_delete", DKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", DEL_NEXT_CHAR);
@@ -386,13 +386,13 @@ const char *text_context_dir[] = {"edit_text", NULL};
static int text_context(const bContext *C, const char *member, bContextDataResult *result)
{
- SpaceText *st= CTX_wm_space_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
- if(CTX_data_dir(member)) {
+ if (CTX_data_dir(member)) {
CTX_data_dir_set(result, text_context_dir);
return 1;
}
- else if(CTX_data_equals(member, "edit_text")) {
+ else if (CTX_data_equals(member, "edit_text")) {
CTX_data_id_pointer_set(result, &st->text->id);
return 1;
}
@@ -411,7 +411,7 @@ static void text_main_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "Text", SPACE_TEXT, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Text", SPACE_TEXT, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* add drop boxes */
@@ -423,7 +423,7 @@ static void text_main_area_init(wmWindowManager *wm, ARegion *ar)
static void text_main_area_draw(const bContext *C, ARegion *ar)
{
/* draw entirely, view changes should be handled here */
- SpaceText *st= CTX_wm_space_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
//View2D *v2d= &ar->v2d;
/* clear and setup matrix */
@@ -452,8 +452,8 @@ static void text_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegion *UNUSED(ar))
static int text_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
- if(drag->type==WM_DRAG_PATH)
- if(ELEM(drag->icon, ICON_FILE_SCRIPT, ICON_FILE_BLANK)) /* rule might not work? */
+ if (drag->type == WM_DRAG_PATH)
+ if (ELEM(drag->icon, ICON_FILE_SCRIPT, ICON_FILE_BLANK)) /* rule might not work? */
return 1;
return 0;
}
@@ -467,7 +467,7 @@ static void text_drop_copy(wmDrag *drag, wmDropBox *drop)
/* this region dropbox definition */
static void text_dropboxes(void)
{
- ListBase *lb= WM_dropboxmap_find("Text", SPACE_TEXT, RGN_TYPE_WINDOW);
+ ListBase *lb = WM_dropboxmap_find("Text", SPACE_TEXT, RGN_TYPE_WINDOW);
WM_dropbox_add(lb, "TEXT_OT_open", text_drop_poll, text_drop_copy);
@@ -507,49 +507,49 @@ static void text_properties_area_draw(const bContext *C, ARegion *ar)
/* only called once, from space/spacetypes.c */
void ED_spacetype_text(void)
{
- SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype text");
+ SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype text");
ARegionType *art;
- st->spaceid= SPACE_TEXT;
+ st->spaceid = SPACE_TEXT;
strncpy(st->name, "Text", BKE_ST_MAXNAME);
- st->new= text_new;
- st->free= text_free;
- st->init= text_init;
- st->duplicate= text_duplicate;
- st->operatortypes= text_operatortypes;
- st->keymap= text_keymap;
- st->listener= text_listener;
- st->context= text_context;
+ st->new = text_new;
+ st->free = text_free;
+ st->init = text_init;
+ st->duplicate = text_duplicate;
+ st->operatortypes = text_operatortypes;
+ st->keymap = text_keymap;
+ st->listener = text_listener;
+ st->context = text_context;
st->dropboxes = text_dropboxes;
/* regions: main window */
- art= MEM_callocN(sizeof(ARegionType), "spacetype text region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype text region");
art->regionid = RGN_TYPE_WINDOW;
- art->init= text_main_area_init;
- art->draw= text_main_area_draw;
- art->cursor= text_cursor;
+ art->init = text_main_area_init;
+ art->draw = text_main_area_draw;
+ art->cursor = text_cursor;
BLI_addhead(&st->regiontypes, art);
/* regions: properties */
- art= MEM_callocN(sizeof(ARegionType), "spacetype text region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype text region");
art->regionid = RGN_TYPE_UI;
- art->prefsizex= UI_COMPACT_PANEL_WIDTH;
- art->keymapflag= ED_KEYMAP_UI;
+ art->prefsizex = UI_COMPACT_PANEL_WIDTH;
+ art->keymapflag = ED_KEYMAP_UI;
- art->init= text_properties_area_init;
- art->draw= text_properties_area_draw;
+ art->init = text_properties_area_init;
+ art->draw = text_properties_area_draw;
BLI_addhead(&st->regiontypes, art);
/* regions: header */
- art= MEM_callocN(sizeof(ARegionType), "spacetype text region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype text region");
art->regionid = RGN_TYPE_HEADER;
- art->prefsizey= HEADERY;
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_HEADER;
+ art->prefsizey = HEADERY;
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_HEADER;
- art->init= text_header_area_init;
- art->draw= text_header_area_draw;
+ art->init = text_header_area_init;
+ art->draw = text_header_area_draw;
BLI_addhead(&st->regiontypes, art);
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 8a78f236fea..98560be477d 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -83,8 +83,8 @@ static int text_font_draw(SpaceText *UNUSED(st), int x, int y, const char *str)
static int text_font_draw_character(SpaceText *st, int x, int y, char c)
{
char str[2];
- str[0]= c;
- str[1]= '\0';
+ str[0] = c;
+ str[1] = '\0';
BLF_position(mono, x, y, 0);
BLF_draw(mono, str, 1);
@@ -94,10 +94,10 @@ static int text_font_draw_character(SpaceText *st, int x, int y, char c)
static int text_font_draw_character_utf8(SpaceText *st, int x, int y, const char *c)
{
- char str[BLI_UTF8_MAX+1];
+ char str[BLI_UTF8_MAX + 1];
size_t len = BLI_str_utf8_size(c);
memcpy(str, c, len);
- str[len]= '\0';
+ str[len] = '\0';
BLF_position(mono, x, y, 0);
BLF_draw(mono, str, len);
@@ -111,32 +111,32 @@ static void flatten_string_append(FlattenString *fs, const char *c, int accum, i
{
int i;
- if(fs->pos+len > fs->len) {
+ if (fs->pos + len > fs->len) {
char *nbuf; int *naccum;
- fs->len*= 2;
+ fs->len *= 2;
- nbuf= MEM_callocN(sizeof(*fs->buf)*fs->len, "fs->buf");
- naccum= MEM_callocN(sizeof(*fs->accum)*fs->len, "fs->accum");
+ nbuf = MEM_callocN(sizeof(*fs->buf) * fs->len, "fs->buf");
+ naccum = MEM_callocN(sizeof(*fs->accum) * fs->len, "fs->accum");
memcpy(nbuf, fs->buf, fs->pos * sizeof(*fs->buf));
memcpy(naccum, fs->accum, fs->pos * sizeof(*fs->accum));
- if(fs->buf != fs->fixedbuf) {
+ if (fs->buf != fs->fixedbuf) {
MEM_freeN(fs->buf);
MEM_freeN(fs->accum);
}
- fs->buf= nbuf;
- fs->accum= naccum;
+ fs->buf = nbuf;
+ fs->accum = naccum;
}
for (i = 0; i < len; i++)
{
- fs->buf[fs->pos+i]= c[i];
- fs->accum[fs->pos+i]= accum;
+ fs->buf[fs->pos + i] = c[i];
+ fs->accum[fs->pos + i] = accum;
}
- fs->pos+= len;
+ fs->pos += len;
}
int flatten_string(SpaceText *st, FlattenString *fs, const char *in)
@@ -144,22 +144,22 @@ int flatten_string(SpaceText *st, FlattenString *fs, const char *in)
int r, i, total = 0;
memset(fs, 0, sizeof(FlattenString));
- fs->buf= fs->fixedbuf;
- fs->accum= fs->fixedaccum;
+ fs->buf = fs->fixedbuf;
+ fs->accum = fs->fixedaccum;
fs->len = sizeof(fs->fixedbuf);
- for(r = 0, i = 0; *in; r++) {
- if(*in=='\t') {
- i= st->tabnumber - (total%st->tabnumber);
- total+= i;
+ for (r = 0, i = 0; *in; r++) {
+ if (*in == '\t') {
+ i = st->tabnumber - (total % st->tabnumber);
+ total += i;
- while(i--)
+ while (i--)
flatten_string_append(fs, " ", r, 1);
in++;
}
else {
- size_t len= BLI_str_utf8_size(in);
+ size_t len = BLI_str_utf8_size(in);
flatten_string_append(fs, in, r, len);
in += len;
total++;
@@ -173,78 +173,78 @@ int flatten_string(SpaceText *st, FlattenString *fs, const char *in)
void flatten_string_free(FlattenString *fs)
{
- if(fs->buf != fs->fixedbuf)
+ if (fs->buf != fs->fixedbuf)
MEM_freeN(fs->buf);
- if(fs->accum != fs->fixedaccum)
+ if (fs->accum != fs->fixedaccum)
MEM_freeN(fs->accum);
}
/* 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)
{
int a, i;
char builtinfuncs[][9] = {"and", "as", "assert", "break", "class", "continue", "def",
- "del", "elif", "else", "except", "exec", "finally",
- "for", "from", "global", "if", "import", "in",
- "is", "lambda", "not", "or", "pass", "print",
- "raise", "return", "try", "while", "yield", "with"};
+ "del", "elif", "else", "except", "exec", "finally",
+ "for", "from", "global", "if", "import", "in",
+ "is", "lambda", "not", "or", "pass", "print",
+ "raise", "return", "try", "while", "yield", "with"};
- for(a=0; a < sizeof(builtinfuncs)/sizeof(builtinfuncs[0]); a++) {
+ for (a = 0; a < sizeof(builtinfuncs) / sizeof(builtinfuncs[0]); a++) {
i = 0;
- while(1) {
+ while (1) {
/* If we hit the end of a keyword... (eg. "def") */
- if(builtinfuncs[a][i]=='\0') {
+ if (builtinfuncs[a][i] == '\0') {
/* If we still have identifier chars in the source (eg. "definate") */
- if(text_check_identifier(string[i]))
- i = -1; /* No match */
+ if (text_check_identifier(string[i]))
+ i = -1; /* No match */
break; /* Next keyword if no match, otherwise we're done */
- /* If chars mismatch, move on to next keyword */
+ /* If chars mismatch, move on to next keyword */
}
- else if(string[i]!=builtinfuncs[a][i]) {
+ else if (string[i] != builtinfuncs[a][i]) {
i = -1;
break; /* Break inner loop, start next keyword */
}
i++;
}
- if(i>0) break; /* If we have a match, we're done */
+ if (i > 0) break; /* If we have a match, we're done */
}
return i;
}
/* 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)
{
int i = 0;
/* Check for "def" */
- if(string[0]=='d' && string[1]=='e' && string[2]=='f')
+ if (string[0] == 'd' && string[1] == 'e' && string[2] == 'f')
i = 3;
/* Check for "class" */
- else if(string[0]=='c' && string[1]=='l' && string[2]=='a' && string[3]=='s' && string[4]=='s')
+ else if (string[0] == 'c' && string[1] == 'l' && string[2] == 'a' && string[3] == 's' && string[4] == 's')
i = 5;
/* If next source char is an identifier (eg. 'i' in "definate") no match */
- if(i==0 || text_check_identifier(string[i]))
+ if (i == 0 || text_check_identifier(string[i]))
return -1;
return i;
}
static int find_decorator(char *string)
{
- if(string[0] == '@') {
+ if (string[0] == '@') {
int i = 1;
- while(text_check_identifier(string[i])) {
+ while (text_check_identifier(string[i])) {
i++;
}
return i;
@@ -256,52 +256,52 @@ static int find_bool(char *string)
{
int i = 0;
/* Check for "False" */
- if(string[0]=='F' && string[1]=='a' && string[2]=='l' && string[3]=='s' && string[4]=='e')
+ if (string[0] == 'F' && string[1] == 'a' && string[2] == 'l' && string[3] == 's' && string[4] == 'e')
i = 5;
/* Check for "True" */
- else if(string[0]=='T' && string[1]=='r' && string[2]=='u' && string[3]=='e')
+ else if (string[0] == 'T' && string[1] == 'r' && string[2] == 'u' && string[3] == 'e')
i = 4;
/* Check for "None" */
- else if(string[0]=='N' && string[1]=='o' && string[2]=='n' && string[3]=='e')
+ else if (string[0] == 'N' && string[1] == 'o' && string[2] == 'n' && string[3] == 'e')
i = 4;
/* If next source char is an identifier (eg. 'i' in "definate") no match */
- if(i==0 || text_check_identifier(string[i]))
+ if (i == 0 || text_check_identifier(string[i]))
return -1;
return i;
}
/* 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) {
- if(strlen(line->format) < len) {
+ if (line->format) {
+ if (strlen(line->format) < len) {
MEM_freeN(line->format);
- line->format = MEM_mallocN(len+2, "SyntaxFormat");
- if(!line->format) return 0;
+ line->format = MEM_mallocN(len + 2, "SyntaxFormat");
+ if (!line->format) return 0;
}
}
else {
- line->format = MEM_mallocN(len+2, "SyntaxFormat");
- if(!line->format) return 0;
+ line->format = MEM_mallocN(len + 2, "SyntaxFormat");
+ if (!line->format) return 0;
}
return 1;
}
/* 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)
{
@@ -310,50 +310,50 @@ static void txt_format_line(SpaceText *st, TextLine *line, int do_next)
int len, i;
/* Get continuation from previous line */
- if(line->prev && line->prev->format != NULL) {
- fmt= line->prev->format;
- cont = fmt[strlen(fmt)+1]; /* Just after the null-terminator */
+ if (line->prev && line->prev->format != NULL) {
+ fmt = line->prev->format;
+ cont = fmt[strlen(fmt) + 1]; /* Just after the null-terminator */
}
else cont = 0;
/* Get original continuation from this line */
- if(line->format != NULL) {
- fmt= line->format;
- orig = fmt[strlen(fmt)+1]; /* Just after the null-terminator */
+ if (line->format != NULL) {
+ fmt = line->format;
+ orig = fmt[strlen(fmt) + 1]; /* Just after the null-terminator */
}
else orig = 0xFF;
len = flatten_string(st, &fs, line->line);
str = fs.buf;
- if(!text_check_format_len(line, len)) {
+ if (!text_check_format_len(line, len)) {
flatten_string_free(&fs);
return;
}
fmt = line->format;
- while(*str) {
+ while (*str) {
/* Handle escape sequences by skipping both \ and next char */
- if(*str == '\\') {
+ if (*str == '\\') {
*fmt = prev; fmt++; str++;
- if(*str == '\0') break;
+ if (*str == '\0') break;
*fmt = prev; fmt++; str += BLI_str_utf8_size(str);
continue;
}
/* Handle continuations */
- else if(cont) {
+ else if (cont) {
/* Triple strings ("""...""" or '''...''') */
- if(cont & TXT_TRISTR) {
+ if (cont & TXT_TRISTR) {
find = (cont & TXT_DBLQUOTSTR) ? '"' : '\'';
- if(*str==find && *(str+1)==find && *(str+2)==find) {
+ if (*str == find && *(str + 1) == find && *(str + 2) == find) {
*fmt = 'l'; fmt++; str++;
*fmt = 'l'; fmt++; str++;
cont = 0;
}
- /* Handle other strings */
+ /* Handle other strings */
}
else {
find = (cont & TXT_DBLQUOTSTR) ? '"' : '\'';
- if(*str == find) cont = 0;
+ if (*str == find) cont = 0;
}
*fmt = 'l';
@@ -362,14 +362,15 @@ static void txt_format_line(SpaceText *st, TextLine *line, int do_next)
/* Not in a string... */
else {
/* Deal with comments first */
- if(prev == '#' || *str == '#') {
+ if (prev == '#' || *str == '#') {
*fmt = '#';
str += BLI_str_utf8_size(str) - 1;
- } else if(*str == '"' || *str == '\'') {
+ }
+ else if (*str == '"' || *str == '\'') {
/* Strings */
find = *str;
- cont = (*str== '"') ? TXT_DBLQUOTSTR : TXT_SNGQUOTSTR;
- if(*(str+1) == find && *(str+2) == find) {
+ cont = (*str == '"') ? TXT_DBLQUOTSTR : TXT_SNGQUOTSTR;
+ if (*(str + 1) == find && *(str + 2) == find) {
*fmt = 'l'; fmt++; str++;
*fmt = 'l'; fmt++; str++;
cont |= TXT_TRISTR;
@@ -377,15 +378,15 @@ static void txt_format_line(SpaceText *st, TextLine *line, int do_next)
*fmt = 'l';
}
/* Whitespace (all ws. has been converted to spaces) */
- else if(*str == ' ')
+ else if (*str == ' ')
*fmt = '_';
/* Numbers (digits not part of an identifier and periods followed by digits) */
- else if((prev != 'q' && text_check_digit(*str)) || (*str == '.' && text_check_digit(*(str+1))))
+ else if ((prev != 'q' && text_check_digit(*str)) || (*str == '.' && text_check_digit(*(str + 1))))
*fmt = 'n';
/* Booleans */
- else if(prev != 'q' && (i=find_bool(str)) != -1)
- if(i>0) {
- while(i>1) {
+ else if (prev != 'q' && (i = find_bool(str)) != -1)
+ if (i > 0) {
+ while (i > 1) {
*fmt = 'n'; fmt++; str++;
i--;
}
@@ -396,24 +397,24 @@ static void txt_format_line(SpaceText *st, TextLine *line, int do_next)
*fmt = 'q';
}
/* Punctuation */
- else if(text_check_delim(*str))
+ else if (text_check_delim(*str))
*fmt = '!';
/* Identifiers and other text (no previous ws. or delims. so text continues) */
- else if(prev == 'q') {
+ else if (prev == 'q') {
str += BLI_str_utf8_size(str) - 1;
*fmt = 'q';
}
/* Not ws, a digit, punct, or continuing text. Must be new, check for special words */
else {
/* Special vars(v) or built-in keywords(b) */
- if((i=find_specialvar(str)) != -1)
+ if ((i = find_specialvar(str)) != -1)
prev = 'v';
- else if((i=find_builtinfunc(str)) != -1)
+ else if ((i = find_builtinfunc(str)) != -1)
prev = 'b';
- else if((i=find_decorator(str)) != -1)
- prev = 'v'; /* could have a new color for this */
- if(i>0) {
- while(i>1) {
+ else if ((i = find_decorator(str)) != -1)
+ prev = 'v'; /* could have a new color for this */
+ if (i > 0) {
+ while (i > 1) {
*fmt = prev; fmt++; str++;
i--;
}
@@ -435,7 +436,7 @@ static void txt_format_line(SpaceText *st, TextLine *line, int do_next)
*fmt = cont;
/* If continuation has changed and we're allowed, process the next line */
- if(cont!=orig && do_next && line->next) {
+ if (cont != orig && do_next && line->next) {
txt_format_line(st, line->next, do_next);
}
@@ -448,9 +449,9 @@ static void txt_format_text(SpaceText *st)
{
TextLine *linep;
- if(!st->text) return;
+ if (!st->text) return;
- for(linep=st->text->lines.first; linep; linep=linep->next)
+ for (linep = st->text->lines.first; linep; linep = linep->next)
txt_format_line(st, linep, 0);
}
#endif
@@ -488,40 +489,38 @@ 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)
{
- int winx= ar->winx - TXT_SCROLL_WIDTH;
+ int winx = ar->winx - TXT_SCROLL_WIDTH;
int x, max;
- x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
- max= st->cwidth ? (winx-x)/st->cwidth : 0;
- return max>8 ? max : 8;
+ x = st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
+ max = st->cwidth ? (winx - x) / st->cwidth : 0;
+ return max > 8 ? max : 8;
}
/* Sets (offl, offc) for transforming (line, curs) to its wrapped position */
@@ -532,86 +531,87 @@ void wrap_offset(SpaceText *st, ARegion *ar, TextLine *linein, int cursin, int *
int i, j, start, end, max, chop;
char ch;
- *offl= *offc= 0;
+ *offl = *offc = 0;
- if(!st->text) return;
- if(!st->wordwrap) return;
+ if (!st->text) return;
+ if (!st->wordwrap) return;
- text= st->text;
+ text = st->text;
/* Move pointer to first visible line (top) */
- linep= text->lines.first;
- i= st->top;
- while(i>0 && linep) {
- int lines= text_get_visible_lines(st, ar, linep->line);
+ linep = text->lines.first;
+ i = st->top;
+ while (i > 0 && linep) {
+ int lines = text_get_visible_lines(st, ar, linep->line);
/* Line before top */
- if(linep == linein) {
- if(lines <= i)
+ if (linep == linein) {
+ if (lines <= i)
/* no visible part of line */
return;
}
- if (i-lines<0) {
+ if (i - lines < 0) {
break;
- } else {
- linep= linep->next;
- (*offl)+= lines-1;
- i-= lines;
+ }
+ else {
+ linep = linep->next;
+ (*offl) += lines - 1;
+ i -= lines;
}
}
- max= wrap_width(st, ar);
+ max = wrap_width(st, ar);
cursin = txt_utf8_offset_to_index(linein->line, cursin);
- while(linep) {
- start= 0;
- end= max;
- chop= 1;
- *offc= 0;
- for(i=0, j=0; linep->line[j]; j+=BLI_str_utf8_size(linep->line+j)) {
+ while (linep) {
+ start = 0;
+ end = max;
+ chop = 1;
+ *offc = 0;
+ for (i = 0, j = 0; linep->line[j]; j += BLI_str_utf8_size(linep->line + j)) {
int chars;
/* Mimic replacement of tabs */
- ch= linep->line[j];
- if(ch=='\t') {
- chars= st->tabnumber-i%st->tabnumber;
- if(linep==linein && i<cursin) cursin += chars-1;
- ch= ' ';
+ ch = linep->line[j];
+ if (ch == '\t') {
+ chars = st->tabnumber - i % st->tabnumber;
+ if (linep == linein && i < cursin) cursin += chars - 1;
+ ch = ' ';
}
else {
- chars= 1;
+ chars = 1;
}
- while(chars--) {
- if(i-start>=max) {
- if(chop && linep==linein && i >= cursin) {
- if (i==cursin) {
+ while (chars--) {
+ if (i - start >= max) {
+ if (chop && linep == linein && i >= cursin) {
+ if (i == cursin) {
(*offl)++;
- *offc -= end-start;
+ *offc -= end - start;
}
return;
}
(*offl)++;
- *offc -= end-start;
+ *offc -= end - start;
- start= end;
+ start = end;
end += max;
- chop= 1;
+ chop = 1;
}
- else if(ch==' ' || ch=='-') {
- end = i+1;
- chop= 0;
- if(linep==linein && i >= cursin)
+ else if (ch == ' ' || ch == '-') {
+ end = i + 1;
+ chop = 0;
+ if (linep == linein && i >= cursin)
return;
}
i++;
}
}
- if(linep==linein) break;
- linep= linep->next;
+ if (linep == linein) break;
+ linep = linep->next;
}
}
@@ -621,53 +621,53 @@ void wrap_offset_in_line(SpaceText *st, ARegion *ar, TextLine *linein, int cursi
int i, j, start, end, chars, max, chop;
char ch;
- *offl= *offc= 0;
+ *offl = *offc = 0;
- if(!st->text) return;
- if(!st->wordwrap) return;
+ if (!st->text) return;
+ if (!st->wordwrap) return;
- max= wrap_width(st, ar);
+ max = wrap_width(st, ar);
- start= 0;
- end= max;
- chop= 1;
- *offc= 0;
+ start = 0;
+ end = max;
+ chop = 1;
+ *offc = 0;
cursin = txt_utf8_offset_to_index(linein->line, cursin);
- for(i=0, j=0; linein->line[j]; j += BLI_str_utf8_size(linein->line + j)) {
+ for (i = 0, j = 0; linein->line[j]; j += BLI_str_utf8_size(linein->line + j)) {
/* Mimic replacement of tabs */
- ch= linein->line[j];
- if(ch=='\t') {
- chars= st->tabnumber-i%st->tabnumber;
- if(i<cursin) cursin += chars-1;
- ch= ' ';
+ ch = linein->line[j];
+ if (ch == '\t') {
+ chars = st->tabnumber - i % st->tabnumber;
+ if (i < cursin) cursin += chars - 1;
+ ch = ' ';
}
else
- chars= 1;
+ chars = 1;
- while(chars--) {
- if(i-start>=max) {
- if(chop && i >= cursin) {
- if (i==cursin) {
+ while (chars--) {
+ if (i - start >= max) {
+ if (chop && i >= cursin) {
+ if (i == cursin) {
(*offl)++;
- *offc -= end-start;
+ *offc -= end - start;
}
return;
}
(*offl)++;
- *offc -= end-start;
+ *offc -= end - start;
- start= end;
+ start = end;
end += max;
- chop= 1;
+ chop = 1;
}
- else if(ch==' ' || ch=='-') {
- end = i+1;
- chop= 0;
- if(i >= cursin)
+ else if (ch == ' ' || ch == '-') {
+ end = i + 1;
+ chop = 0;
+ if (i >= cursin)
return;
}
i++;
@@ -677,11 +677,11 @@ void wrap_offset_in_line(SpaceText *st, ARegion *ar, TextLine *linein, int cursi
int text_get_char_pos(SpaceText *st, const char *line, int cur)
{
- int a=0, i;
+ int a = 0, i;
- for(i=0; i<cur && line[i]; i += BLI_str_utf8_size(line + i)) {
- if(line[i]=='\t')
- a += st->tabnumber-a%st->tabnumber;
+ for (i = 0; i < cur && line[i]; i += BLI_str_utf8_size(line + i)) {
+ if (line[i] == '\t')
+ a += st->tabnumber - a % st->tabnumber;
else
a++;
}
@@ -690,9 +690,9 @@ int text_get_char_pos(SpaceText *st, const char *line, int cur)
static const char *txt_utf8_get_nth(const char *str, int n)
{
- int pos= 0;
+ int pos = 0;
while (str[pos] && n--) {
- pos+= BLI_str_utf8_size(str + pos);
+ pos += BLI_str_utf8_size(str + pos);
}
return str + pos;
}
@@ -704,49 +704,49 @@ static int text_draw_wrapped(SpaceText *st, const char *str, int x, int y, int w
int mi, ma, mstart, mend; /* mem */
flatten_string(st, &fs, str);
- str= fs.buf;
- max= w/st->cwidth;
- if(max<8) max= 8;
- basex= x;
- lines= 1;
+ str = fs.buf;
+ max = w / st->cwidth;
+ if (max < 8) max = 8;
+ basex = x;
+ lines = 1;
- start= 0; mstart= 0;
- end= max; mend= txt_utf8_get_nth(str, max) - str;
+ start = 0; mstart = 0;
+ end = max; mend = txt_utf8_get_nth(str, max) - str;
- for(i=0, mi=0; str[mi]; i++, mi+=BLI_str_utf8_size(str+mi)) {
- if(i-start >= max) {
+ for (i = 0, mi = 0; str[mi]; i++, mi += BLI_str_utf8_size(str + mi)) {
+ if (i - start >= max) {
/* skip hidden part of line */
- if(skip) {
+ if (skip) {
skip--;
- start= end; mstart= mend;
- end += max; mend= txt_utf8_get_nth(str+mend, max) - str;
+ start = end; mstart = mend;
+ end += max; mend = txt_utf8_get_nth(str + mend, max) - str;
continue;
}
/* Draw the visible portion of text on the overshot line */
- for(a=start, ma=mstart; a<end; a++, ma+=BLI_str_utf8_size(str+ma)) {
- if(st->showsyntax && format) format_draw_color(format[a]);
+ for (a = start, ma = mstart; a < end; a++, ma += BLI_str_utf8_size(str + ma)) {
+ if (st->showsyntax && format) format_draw_color(format[a]);
x += text_font_draw_character_utf8(st, x, y, str + ma);
}
y -= st->lheight;
- x= basex;
+ x = basex;
lines++;
- start= end; mstart= mend;
- end += max; mend= txt_utf8_get_nth(str+mend, max) - str;
+ start = end; mstart = mend;
+ end += max; mend = txt_utf8_get_nth(str + mend, max) - str;
- if(y<=0) break;
+ if (y <= 0) break;
}
- else if(str[mi]==' ' || str[mi]=='-') {
- end = i+1; mend = mi+1;
+ else if (str[mi] == ' ' || str[mi] == '-') {
+ end = i + 1; mend = mi + 1;
}
}
/* Draw the remaining text */
- for(a=start, ma=mstart; str[ma] && y > 0; a++, ma+=BLI_str_utf8_size(str+ma)) {
- if(st->showsyntax && format)
+ for (a = start, ma = mstart; str[ma] && y > 0; a++, ma += BLI_str_utf8_size(str + ma)) {
+ if (st->showsyntax && format)
format_draw_color(format[a]);
- x += text_font_draw_character_utf8(st, x, y, str+ma);
+ x += text_font_draw_character_utf8(st, x, y, str + ma);
}
flatten_string_free(&fs);
@@ -757,27 +757,27 @@ static int text_draw_wrapped(SpaceText *st, const char *str, int x, int y, int w
static int text_draw(SpaceText *st, char *str, int cshift, int maxwidth, int draw, int x, int y, const char *format)
{
FlattenString fs;
- int *acc, r=0;
+ int *acc, r = 0;
const char *in;
- int w= flatten_string(st, &fs, str);
- if(w < cshift) {
+ int w = flatten_string(st, &fs, str);
+ if (w < cshift) {
flatten_string_free(&fs);
return 0; /* String is shorter than shift */
}
- in= txt_utf8_get_nth(fs.buf, cshift);
- acc= fs.accum+cshift;
- w= w-cshift;
+ in = txt_utf8_get_nth(fs.buf, cshift);
+ acc = fs.accum + cshift;
+ w = w - cshift;
- if(draw) {
+ if (draw) {
int amount = maxwidth ? MIN2(w, maxwidth) : w;
- if(st->showsyntax && format) {
- int a, str_shift= 0;
- format = format+cshift;
+ if (st->showsyntax && format) {
+ int a, str_shift = 0;
+ format = format + cshift;
- for(a = 0; a < amount; a++) {
+ for (a = 0; a < amount; a++) {
format_draw_color(format[a]);
x += text_font_draw_character_utf8(st, x, y, in + str_shift);
str_shift += BLI_str_utf8_size(in + str_shift);
@@ -786,18 +786,18 @@ static int text_draw(SpaceText *st, char *str, int cshift, int maxwidth, int dra
else text_font_draw(st, x, y, in);
}
else {
- while(w-- && *acc++ < maxwidth)
- r+= st->cwidth;
+ while (w-- && *acc++ < maxwidth)
+ r += st->cwidth;
}
flatten_string_free(&fs);
- if(cshift && r==0)
+ if (cshift && r == 0)
return 0;
- else if(st->showlinenrs)
- return r+TXT_OFFSET+TEXTXLOC;
+ else if (st->showlinenrs)
+ return r + TXT_OFFSET + TEXTXLOC;
else
- return r+TXT_OFFSET;
+ return r + TXT_OFFSET;
}
/************************ cache utilities *****************************/
@@ -819,102 +819,105 @@ typedef struct DrawCache {
static void text_drawcache_init(SpaceText *st)
{
- DrawCache *drawcache= MEM_callocN(sizeof (DrawCache), "text draw cache");
+ DrawCache *drawcache = MEM_callocN(sizeof (DrawCache), "text draw cache");
- drawcache->winx= -1;
- drawcache->nlines= BLI_countlist(&st->text->lines);
- drawcache->text_id[0]= '\0';
+ drawcache->winx = -1;
+ drawcache->nlines = BLI_countlist(&st->text->lines);
+ drawcache->text_id[0] = '\0';
- st->drawcache= drawcache;
+ st->drawcache = drawcache;
}
static void text_update_drawcache(SpaceText *st, ARegion *ar)
{
DrawCache *drawcache;
- int full_update= 0, nlines= 0;
- Text *txt= st->text;
+ int full_update = 0, nlines = 0;
+ Text *txt = st->text;
- if(!st->drawcache) text_drawcache_init(st);
+ if (!st->drawcache) text_drawcache_init(st);
text_update_character_width(st);
- drawcache= (DrawCache *)st->drawcache;
- nlines= drawcache->nlines;
+ drawcache = (DrawCache *)st->drawcache;
+ nlines = drawcache->nlines;
/* check if full cache update is needed */
- full_update|= drawcache->winx != ar->winx; /* area was resized */
- full_update|= drawcache->wordwrap != st->wordwrap; /* word-wrapping option was toggled */
- full_update|= drawcache->showlinenrs != st->showlinenrs; /* word-wrapping option was toggled */
- full_update|= drawcache->tabnumber != st->tabnumber; /* word-wrapping option was toggled */
- full_update|= drawcache->lheight != st->lheight; /* word-wrapping option was toggled */
- full_update|= drawcache->cwidth != st->cwidth; /* word-wrapping option was toggled */
- full_update|= strncmp(drawcache->text_id, txt->id.name, MAX_ID_NAME); /* text datablock was changed */
-
- if(st->wordwrap) {
+ full_update |= drawcache->winx != ar->winx; /* area was resized */
+ full_update |= drawcache->wordwrap != st->wordwrap; /* word-wrapping option was toggled */
+ full_update |= drawcache->showlinenrs != st->showlinenrs; /* word-wrapping option was toggled */
+ full_update |= drawcache->tabnumber != st->tabnumber; /* word-wrapping option was toggled */
+ full_update |= drawcache->lheight != st->lheight; /* word-wrapping option was toggled */
+ full_update |= drawcache->cwidth != st->cwidth; /* word-wrapping option was toggled */
+ full_update |= strncmp(drawcache->text_id, txt->id.name, MAX_ID_NAME); /* text datablock was changed */
+
+ if (st->wordwrap) {
/* update line heights */
- if(full_update || !drawcache->line_height) {
+ if (full_update || !drawcache->line_height) {
drawcache->valid_head = 0;
drawcache->valid_tail = 0;
drawcache->update_flag = 1;
}
- if(drawcache->update_flag) {
- TextLine *line= st->text->lines.first;
- int lineno= 0, size, lines_count;
- int *fp= drawcache->line_height, *new_tail, *old_tail;
+ if (drawcache->update_flag) {
+ TextLine *line = st->text->lines.first;
+ int lineno = 0, size, lines_count;
+ int *fp = drawcache->line_height, *new_tail, *old_tail;
- nlines= BLI_countlist(&txt->lines);
- size= sizeof(int)*nlines;
+ nlines = BLI_countlist(&txt->lines);
+ size = sizeof(int) * nlines;
- if(fp) fp= MEM_reallocN(fp, size);
- else fp= MEM_callocN(size, "text drawcache line_height");
+ if (fp) fp = MEM_reallocN(fp, size);
+ else fp = MEM_callocN(size, "text drawcache line_height");
- drawcache->valid_tail= drawcache->valid_head= 0;
- old_tail= fp + drawcache->nlines - drawcache->valid_tail;
- new_tail= fp + nlines - drawcache->valid_tail;
+ drawcache->valid_tail = drawcache->valid_head = 0;
+ old_tail = fp + drawcache->nlines - drawcache->valid_tail;
+ new_tail = fp + nlines - drawcache->valid_tail;
memmove(new_tail, old_tail, drawcache->valid_tail);
- drawcache->total_lines= 0;
+ drawcache->total_lines = 0;
- if(st->showlinenrs)
- st->linenrs_tot= (int)floor(log10((float)nlines)) + 1;
+ if (st->showlinenrs)
+ st->linenrs_tot = (int)floor(log10((float)nlines)) + 1;
- while(line) {
- if(drawcache->valid_head) { /* we're inside valid head lines */
- lines_count= fp[lineno];
+ while (line) {
+ if (drawcache->valid_head) { /* we're inside valid head lines */
+ lines_count = fp[lineno];
drawcache->valid_head--;
- } else if (lineno > new_tail - fp) { /* we-re inside valid tail lines */
- lines_count= fp[lineno];
- } else {
- lines_count= text_get_visible_lines(st, ar, line->line);
+ }
+ else if (lineno > new_tail - fp) { /* we-re inside valid tail lines */
+ lines_count = fp[lineno];
+ }
+ else {
+ lines_count = text_get_visible_lines(st, ar, line->line);
}
- fp[lineno]= lines_count;
+ fp[lineno] = lines_count;
- line= line->next;
+ line = line->next;
lineno++;
- drawcache->total_lines+= lines_count;
+ drawcache->total_lines += lines_count;
}
- drawcache->line_height= fp;
+ drawcache->line_height = fp;
}
- } else {
- if(drawcache->line_height) {
+ }
+ else {
+ if (drawcache->line_height) {
MEM_freeN(drawcache->line_height);
- drawcache->line_height= NULL;
+ drawcache->line_height = NULL;
}
- if(full_update || drawcache->update_flag) {
- nlines= BLI_countlist(&txt->lines);
+ if (full_update || drawcache->update_flag) {
+ nlines = BLI_countlist(&txt->lines);
- if(st->showlinenrs)
- st->linenrs_tot= (int)floor(log10((float)nlines)) + 1;
+ if (st->showlinenrs)
+ st->linenrs_tot = (int)floor(log10((float)nlines)) + 1;
}
- drawcache->total_lines= nlines;
+ drawcache->total_lines = nlines;
}
- drawcache->nlines= nlines;
+ drawcache->nlines = nlines;
/* store settings */
drawcache->winx = ar->winx;
@@ -938,48 +941,50 @@ void text_drawcache_tag_update(SpaceText *st, int full)
if (st == NULL)
return;
- if(st->drawcache) {
- DrawCache *drawcache= (DrawCache *)st->drawcache;
- Text *txt= st->text;
+ if (st->drawcache) {
+ DrawCache *drawcache = (DrawCache *)st->drawcache;
+ Text *txt = st->text;
- if(drawcache->update_flag) {
+ if (drawcache->update_flag) {
/* happens when tagging update from space listener */
/* should do nothing to prevent locally tagged cache be fully recalculated */
return;
}
- if(!full) {
- int sellno= BLI_findindex(&txt->lines, txt->sell);
- int curlno= BLI_findindex(&txt->lines, txt->curl);
+ if (!full) {
+ int sellno = BLI_findindex(&txt->lines, txt->sell);
+ int curlno = BLI_findindex(&txt->lines, txt->curl);
- if(curlno < sellno) {
- drawcache->valid_head= curlno;
- drawcache->valid_tail= drawcache->nlines - sellno - 1;
- } else {
- drawcache->valid_head= sellno;
- drawcache->valid_tail= drawcache->nlines - curlno - 1;
+ if (curlno < sellno) {
+ drawcache->valid_head = curlno;
+ drawcache->valid_tail = drawcache->nlines - sellno - 1;
+ }
+ else {
+ drawcache->valid_head = sellno;
+ drawcache->valid_tail = drawcache->nlines - curlno - 1;
}
/* 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 */
- if(drawcache->valid_head>0) drawcache->valid_head--;
- if(drawcache->valid_tail>0) drawcache->valid_tail--;
- } else {
- drawcache->valid_head= 0;
- drawcache->valid_tail= 0;
+ * 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 {
+ drawcache->valid_head = 0;
+ drawcache->valid_tail = 0;
}
- drawcache->update_flag= 1;
+ drawcache->update_flag = 1;
}
}
void text_free_caches(SpaceText *st)
{
- DrawCache *drawcache= (DrawCache *)st->drawcache;
+ DrawCache *drawcache = (DrawCache *)st->drawcache;
- if(drawcache) {
- if(drawcache->line_height)
+ if (drawcache) {
+ if (drawcache->line_height)
MEM_freeN(drawcache->line_height);
MEM_freeN(drawcache);
@@ -991,7 +996,7 @@ void text_free_caches(SpaceText *st)
/* cache should be updated in caller */
static int text_get_visible_lines_no(SpaceText *st, int lineno)
{
- DrawCache *drawcache= (DrawCache *)st->drawcache;
+ DrawCache *drawcache = (DrawCache *)st->drawcache;
return drawcache->line_height[lineno];
}
@@ -1001,27 +1006,27 @@ int text_get_visible_lines(SpaceText *st, ARegion *ar, const char *str)
int i, j, start, end, max, lines, chars;
char ch;
- max= wrap_width(st, ar);
- lines= 1;
- start= 0;
- end= max;
- for(i= 0, j= 0; str[j]; j+=BLI_str_utf8_size(str+j)) {
+ max = wrap_width(st, ar);
+ lines = 1;
+ start = 0;
+ end = max;
+ for (i = 0, j = 0; str[j]; j += BLI_str_utf8_size(str + j)) {
/* Mimic replacement of tabs */
- ch= str[j];
- if(ch=='\t') {
- chars= st->tabnumber-i%st->tabnumber;
- ch= ' ';
+ ch = str[j];
+ if (ch == '\t') {
+ chars = st->tabnumber - i % st->tabnumber;
+ ch = ' ';
}
- else chars= 1;
+ else chars = 1;
- while(chars--) {
- if(i-start >= max) {
+ while (chars--) {
+ if (i - start >= max) {
lines++;
- start= end;
+ start = end;
end += max;
}
- else if(ch==' ' || ch=='-') {
- end= i+1;
+ else if (ch == ' ' || ch == '-') {
+ end = i + 1;
}
i++;
@@ -1033,19 +1038,20 @@ int text_get_visible_lines(SpaceText *st, ARegion *ar, const char *str)
int text_get_span_wrap(SpaceText *st, ARegion *ar, TextLine *from, TextLine *to)
{
- if(st->wordwrap) {
- int ret=0;
- TextLine *tmp= from;
+ if (st->wordwrap) {
+ int ret = 0;
+ TextLine *tmp = from;
/* Look forwards */
while (tmp) {
if (tmp == to) return ret;
- ret+= text_get_visible_lines(st, ar, tmp->line);
- tmp= tmp->next;
+ ret += text_get_visible_lines(st, ar, tmp->line);
+ tmp = tmp->next;
}
return ret;
- } else return txt_get_span(from, to);
+ }
+ else return txt_get_span(from, to);
}
int text_get_total_lines(SpaceText *st, ARegion *ar)
@@ -1053,7 +1059,7 @@ int text_get_total_lines(SpaceText *st, ARegion *ar)
DrawCache *drawcache;
text_update_drawcache(st, ar);
- drawcache= (DrawCache *)st->drawcache;
+ drawcache = (DrawCache *)st->drawcache;
return drawcache->total_lines;
}
@@ -1061,30 +1067,32 @@ int text_get_total_lines(SpaceText *st, ARegion *ar)
/* Move pointer to first visible line (top) */
static TextLine *first_visible_line(SpaceText *st, ARegion *ar, int *wrap_top)
{
- Text *text= st->text;
- TextLine* pline= text->lines.first;
- int i= st->top, lineno= 0;
+ Text *text = st->text;
+ TextLine *pline = text->lines.first;
+ int i = st->top, lineno = 0;
text_update_drawcache(st, ar);
- if(wrap_top) *wrap_top= 0;
+ if (wrap_top) *wrap_top = 0;
- if(st->wordwrap) {
- while(i>0 && pline) {
- int lines= text_get_visible_lines_no(st, lineno);
+ if (st->wordwrap) {
+ while (i > 0 && pline) {
+ int lines = text_get_visible_lines_no(st, lineno);
- if (i-lines<0) {
- if(wrap_top) *wrap_top= i;
+ if (i - lines < 0) {
+ if (wrap_top) *wrap_top = i;
break;
- } else {
- pline= pline->next;
- i-= lines;
+ }
+ else {
+ pline = pline->next;
+ i -= lines;
lineno++;
}
}
- } else {
- for(i=st->top; pline->next && i>0; i--)
- pline= pline->next;
+ }
+ else {
+ for (i = st->top; pline->next && i > 0; i--)
+ pline = pline->next;
}
return pline;
@@ -1101,89 +1109,89 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll, rcti *back)
pix_top_margin = 8;
pix_bottom_margin = 4;
pix_available = ar->winy - pix_top_margin - pix_bottom_margin;
- ltexth= text_get_total_lines(st, ar);
+ ltexth = text_get_total_lines(st, ar);
blank_lines = st->viewlines / 2;
/* nicer code: use scroll rect for entire bar */
- back->xmin= ar->winx -18;
- back->xmax= ar->winx;
- back->ymin= 0;
- back->ymax= ar->winy;
+ back->xmin = ar->winx - 18;
+ back->xmax = ar->winx;
+ back->ymin = 0;
+ back->ymax = ar->winy;
- scroll->xmin= ar->winx - 17;
- scroll->xmax= ar->winx - 5;
- scroll->ymin= 4;
- scroll->ymax= 4+pix_available;
+ scroll->xmin = ar->winx - 17;
+ scroll->xmax = ar->winx - 5;
+ 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 */
- if(ltexth + blank_lines < st->top + st->viewlines) {
+ /* 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;
}
ltexth += blank_lines;
- barheight = (ltexth > 0)? (st->viewlines*pix_available)/ltexth: 0;
+ barheight = (ltexth > 0) ? (st->viewlines * pix_available) / ltexth : 0;
pix_bardiff = 0;
- if(barheight < 20) {
+ if (barheight < 20) {
pix_bardiff = 20 - barheight; /* take into account the now non-linear sizing of the bar */
barheight = 20;
}
- barstart = (ltexth > 0)? ((pix_available - pix_bardiff) * st->top)/ltexth: 0;
+ barstart = (ltexth > 0) ? ((pix_available - pix_bardiff) * st->top) / ltexth : 0;
- st->txtbar= *scroll;
+ st->txtbar = *scroll;
st->txtbar.ymax -= barstart;
st->txtbar.ymin = st->txtbar.ymax - barheight;
CLAMP(st->txtbar.ymin, pix_bottom_margin, ar->winy - pix_top_margin);
CLAMP(st->txtbar.ymax, pix_bottom_margin, ar->winy - pix_top_margin);
- st->pix_per_line= (pix_available > 0)? (float) ltexth/pix_available: 0;
- if(st->pix_per_line < 0.1f) st->pix_per_line=0.1f;
+ st->pix_per_line = (pix_available > 0) ? (float) ltexth / pix_available : 0;
+ if (st->pix_per_line < 0.1f) st->pix_per_line = 0.1f;
- curl_off= text_get_span_wrap(st, ar, st->text->lines.first, st->text->curl);
- sell_off= text_get_span_wrap(st, ar, st->text->lines.first, st->text->sell);
+ curl_off = text_get_span_wrap(st, ar, st->text->lines.first, st->text->curl);
+ sell_off = text_get_span_wrap(st, ar, st->text->lines.first, st->text->sell);
lhlstart = MIN2(curl_off, sell_off);
lhlend = MAX2(curl_off, sell_off);
- if(ltexth > 0) {
- hlstart = (lhlstart * pix_available)/ltexth;
- hlend = (lhlend * pix_available)/ltexth;
+ if (ltexth > 0) {
+ hlstart = (lhlstart * pix_available) / ltexth;
+ hlend = (lhlend * pix_available) / ltexth;
/* the scrollbar is non-linear sized */
- if(pix_bardiff > 0) {
+ if (pix_bardiff > 0) {
/* the start of the highlight is in the current viewport */
- if(ltexth && st->viewlines && lhlstart >= st->top && lhlstart <= st->top + st->viewlines) {
+ if (ltexth && st->viewlines && lhlstart >= st->top && lhlstart <= st->top + st->viewlines) {
/* speed the progresion of the start of the highlight through the scrollbar */
hlstart = ( ( (pix_available - pix_bardiff) * lhlstart) / ltexth) + (pix_bardiff * (lhlstart - st->top) / st->viewlines);
}
- else if(lhlstart > st->top + st->viewlines && hlstart < barstart + barheight && hlstart > barstart) {
+ else if (lhlstart > st->top + st->viewlines && hlstart < barstart + barheight && hlstart > barstart) {
/* push hl start down */
hlstart = barstart + barheight;
}
- else if(lhlend > st->top && lhlstart < st->top && hlstart > barstart) {
+ else if (lhlend > st->top && lhlstart < st->top && hlstart > barstart) {
/*fill out start */
hlstart = barstart;
}
- if(hlend <= hlstart) {
+ if (hlend <= hlstart) {
hlend = hlstart + 2;
}
/* the end of the highlight is in the current viewport */
- if(ltexth && st->viewlines && lhlend >= st->top && lhlend <= st->top + st->viewlines) {
+ if (ltexth && st->viewlines && lhlend >= st->top && lhlend <= st->top + st->viewlines) {
/* speed the progresion of the end of the highlight through the scrollbar */
- hlend = (((pix_available - pix_bardiff )*lhlend)/ltexth) + (pix_bardiff * (lhlend - st->top)/st->viewlines);
+ hlend = (((pix_available - pix_bardiff) * lhlend) / ltexth) + (pix_bardiff * (lhlend - st->top) / st->viewlines);
}
- else if(lhlend < st->top && hlend >= barstart - 2 && hlend < barstart + barheight) {
+ else if (lhlend < st->top && hlend >= barstart - 2 && hlend < barstart + barheight) {
/* push hl end up */
hlend = barstart;
}
- else if(lhlend > st->top + st->viewlines && lhlstart < st->top + st->viewlines && hlend < barstart + barheight) {
+ else if (lhlend > st->top + st->viewlines && lhlstart < st->top + st->viewlines && hlend < barstart + barheight) {
/* fill out end */
hlend = barstart + barheight;
}
- if(hlend <= hlstart) {
+ if (hlend <= hlstart) {
hlstart = hlend - 2;
}
}
@@ -1193,13 +1201,13 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll, rcti *back)
hlend = 0;
}
- if(hlend - hlstart < 2) {
+ if (hlend - hlstart < 2) {
hlend = hlstart + 2;
}
- st->txtscroll= *scroll;
- st->txtscroll.ymax= ar->winy - pix_top_margin - hlstart;
- st->txtscroll.ymin= ar->winy - pix_top_margin - hlend;
+ st->txtscroll = *scroll;
+ st->txtscroll.ymax = ar->winy - pix_top_margin - hlstart;
+ st->txtscroll.ymin = ar->winy - pix_top_margin - hlend;
CLAMP(st->txtscroll.ymin, pix_bottom_margin, ar->winy - pix_top_margin);
CLAMP(st->txtscroll.ymax, pix_bottom_margin, ar->winy - pix_top_margin);
@@ -1207,23 +1215,23 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll, rcti *back)
static void draw_textscroll(SpaceText *st, rcti *scroll, rcti *back)
{
- bTheme *btheme= UI_GetTheme();
- uiWidgetColors wcol= btheme->tui.wcol_scroll;
+ bTheme *btheme = UI_GetTheme();
+ uiWidgetColors wcol = btheme->tui.wcol_scroll;
unsigned char col[4];
float rad;
UI_ThemeColor(TH_BACK);
glRecti(back->xmin, back->ymin, back->xmax, back->ymax);
- uiWidgetScrollDraw(&wcol, scroll, &st->txtbar, (st->flags & ST_SCROLL_SELECT)?UI_SCROLL_PRESSED:0);
+ uiWidgetScrollDraw(&wcol, scroll, &st->txtbar, (st->flags & ST_SCROLL_SELECT) ? UI_SCROLL_PRESSED : 0);
uiSetRoundBox(UI_CNR_ALL);
- rad= 0.4f*MIN2(st->txtscroll.xmax - st->txtscroll.xmin, st->txtscroll.ymax - st->txtscroll.ymin);
+ rad = 0.4f * MIN2(st->txtscroll.xmax - st->txtscroll.xmin, st->txtscroll.ymax - st->txtscroll.ymin);
UI_GetThemeColor3ubv(TH_HILITE, col);
- col[3]= 48;
+ col[3] = 48;
glColor4ubv(col);
glEnable(GL_BLEND);
- uiRoundBox(st->txtscroll.xmin+1, st->txtscroll.ymin, st->txtscroll.xmax-1, st->txtscroll.ymax, rad);
+ uiRoundBox(st->txtscroll.xmin + 1, st->txtscroll.ymin, st->txtscroll.xmax - 1, st->txtscroll.ymax, rad);
glDisable(GL_BLEND);
}
@@ -1231,28 +1239,28 @@ static void draw_textscroll(SpaceText *st, rcti *scroll, rcti *back)
static void draw_markers(SpaceText *st, ARegion *ar)
{
- Text *text= st->text;
+ Text *text = st->text;
TextMarker *marker, *next;
TextLine *top, *line;
int offl, offc, i, x1, x2, y1, y2, x, y;
int topi, topy;
/* Move pointer to first visible line (top) */
- top= first_visible_line(st, ar, NULL);
- topi= BLI_findindex(&text->lines, top);
+ top = first_visible_line(st, ar, NULL);
+ topi = BLI_findindex(&text->lines, top);
- topy= txt_get_span(text->lines.first, top);
+ topy = txt_get_span(text->lines.first, top);
- for(marker= text->markers.first; marker; marker= next) {
- next= marker->next;
+ for (marker = text->markers.first; marker; marker = next) {
+ next = marker->next;
/* invisible line (before top) */
- if(marker->lineno<topi) continue;
+ if (marker->lineno < topi) continue;
- line= BLI_findlink(&text->lines, marker->lineno);
+ line = BLI_findlink(&text->lines, marker->lineno);
/* Remove broken markers */
- if(marker->end>line->len || marker->start>marker->end) {
+ if (marker->end > line->len || marker->start > marker->end) {
BLI_freelinkN(&text->markers, marker);
continue;
}
@@ -1266,46 +1274,46 @@ static void draw_markers(SpaceText *st, ARegion *ar)
x2 = text_get_char_pos(st, line->line, marker->end) - st->left + offc;
/* invisible part of line (before top, after last visible line) */
- if(y2 < 0 || y1 > st->top+st->viewlines) continue;
+ if (y2 < 0 || y1 > st->top + st->viewlines) continue;
glColor3ubv(marker->color);
- x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
- y= ar->winy-3;
+ x = st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
+ y = ar->winy - 3;
- if(y1==y2) {
- y -= y1*st->lheight;
+ if (y1 == y2) {
+ y -= y1 * st->lheight;
glBegin(GL_LINE_LOOP);
- glVertex2i(x+x2*st->cwidth+1, y);
- glVertex2i(x+x1*st->cwidth-2, y);
- glVertex2i(x+x1*st->cwidth-2, y-st->lheight);
- glVertex2i(x+x2*st->cwidth+1, y-st->lheight);
+ glVertex2i(x + x2 * st->cwidth + 1, y);
+ glVertex2i(x + x1 * st->cwidth - 2, y);
+ glVertex2i(x + x1 * st->cwidth - 2, y - st->lheight);
+ glVertex2i(x + x2 * st->cwidth + 1, y - st->lheight);
glEnd();
}
else {
- y -= y1*st->lheight;
+ y -= y1 * st->lheight;
glBegin(GL_LINE_STRIP);
glVertex2i(ar->winx, y);
- glVertex2i(x+x1*st->cwidth-2, y);
- glVertex2i(x+x1*st->cwidth-2, y-st->lheight);
- glVertex2i(ar->winx, y-st->lheight);
+ glVertex2i(x + x1 * st->cwidth - 2, y);
+ glVertex2i(x + x1 * st->cwidth - 2, y - st->lheight);
+ glVertex2i(ar->winx, y - st->lheight);
glEnd();
- y-=st->lheight;
+ y -= st->lheight;
- for(i=y1+1; i<y2; i++) {
+ for (i = y1 + 1; i < y2; i++) {
glBegin(GL_LINES);
glVertex2i(x, y);
glVertex2i(ar->winx, y);
- glVertex2i(x, y-st->lheight);
- glVertex2i(ar->winx, y-st->lheight);
+ glVertex2i(x, y - st->lheight);
+ glVertex2i(ar->winx, y - st->lheight);
glEnd();
- y-=st->lheight;
+ y -= st->lheight;
}
glBegin(GL_LINE_STRIP);
glVertex2i(x, y);
- glVertex2i(x+x2*st->cwidth+1, y);
- glVertex2i(x+x2*st->cwidth+1, y-st->lheight);
- glVertex2i(x, y-st->lheight);
+ glVertex2i(x + x2 * st->cwidth + 1, y);
+ glVertex2i(x + x2 * st->cwidth + 1, y - st->lheight);
+ glVertex2i(x, y - st->lheight);
glEnd();
}
}
@@ -1316,84 +1324,84 @@ static void draw_markers(SpaceText *st, ARegion *ar)
static void draw_documentation(SpaceText *st, ARegion *ar)
{
TextLine *tmp;
- char *docs, buf[DOC_WIDTH+1], *p;
+ char *docs, buf[DOC_WIDTH + 1], *p;
int i, br, lines;
int boxw, boxh, l, x, y /* , top */ /* UNUSED */;
- if(!st || !st->text) return;
- if(!texttool_text_is_active(st->text)) return;
+ if (!st || !st->text) return;
+ if (!texttool_text_is_active(st->text)) return;
docs = texttool_docs_get();
- if(!docs) return;
+ if (!docs) return;
/* Count the visible lines to the cursor */
- for(tmp=st->text->curl, l=-st->top; tmp; tmp=tmp->prev, l++);
- if(l<0) return;
+ for (tmp = st->text->curl, l = -st->top; tmp; tmp = tmp->prev, l++) ;
+ if (l < 0) return;
- if(st->showlinenrs) {
- x= st->cwidth*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4;
+ if (st->showlinenrs) {
+ x = st->cwidth * (st->text->curc - st->left) + TXT_OFFSET + TEXTXLOC - 4;
}
else {
- x= st->cwidth*(st->text->curc-st->left) + TXT_OFFSET - 4;
+ x = st->cwidth * (st->text->curc - st->left) + TXT_OFFSET - 4;
}
- if(texttool_suggest_first()) {
- x += SUGG_LIST_WIDTH*st->cwidth + 50;
+ if (texttool_suggest_first()) {
+ x += SUGG_LIST_WIDTH * st->cwidth + 50;
}
- /* top= */ /* UNUSED */ y= ar->winy - st->lheight*l - 2;
- boxw= DOC_WIDTH*st->cwidth + 20;
- boxh= (DOC_HEIGHT+1)*st->lheight;
+ /* top= */ /* UNUSED */ y = ar->winy - st->lheight * l - 2;
+ boxw = DOC_WIDTH * st->cwidth + 20;
+ boxh = (DOC_HEIGHT + 1) * st->lheight;
/* Draw panel */
UI_ThemeColor(TH_BACK);
- glRecti(x, y, x+boxw, y-boxh);
+ glRecti(x, y, x + boxw, y - boxh);
UI_ThemeColor(TH_SHADE1);
glBegin(GL_LINE_LOOP);
glVertex2i(x, y);
- glVertex2i(x+boxw, y);
- glVertex2i(x+boxw, y-boxh);
- glVertex2i(x, y-boxh);
+ glVertex2i(x + boxw, y);
+ glVertex2i(x + boxw, y - boxh);
+ glVertex2i(x, y - boxh);
glEnd();
glBegin(GL_LINE_LOOP);
- glVertex2i(x+boxw-10, y-7);
- glVertex2i(x+boxw-4, y-7);
- glVertex2i(x+boxw-7, y-2);
+ glVertex2i(x + boxw - 10, y - 7);
+ glVertex2i(x + boxw - 4, y - 7);
+ glVertex2i(x + boxw - 7, y - 2);
glEnd();
glBegin(GL_LINE_LOOP);
- glVertex2i(x+boxw-10, y-boxh+7);
- glVertex2i(x+boxw-4, y-boxh+7);
- glVertex2i(x+boxw-7, y-boxh+2);
+ glVertex2i(x + boxw - 10, y - boxh + 7);
+ glVertex2i(x + boxw - 4, y - boxh + 7);
+ glVertex2i(x + boxw - 7, y - boxh + 2);
glEnd();
UI_ThemeColor(TH_TEXT);
- i= 0; br= DOC_WIDTH; lines= 0; // XXX -doc_scroll;
- for(p=docs; *p; p++) {
- if(*p == '\r' && *(++p) != '\n') *(--p)= '\n'; /* Fix line endings */
- if(*p == ' ' || *p == '\t')
- br= i;
- else if(*p == '\n') {
- buf[i]= '\0';
- if(lines>=0) {
+ i = 0; br = DOC_WIDTH; lines = 0; // XXX -doc_scroll;
+ for (p = docs; *p; p++) {
+ if (*p == '\r' && *(++p) != '\n') *(--p) = '\n'; /* Fix line endings */
+ if (*p == ' ' || *p == '\t')
+ br = i;
+ else if (*p == '\n') {
+ buf[i] = '\0';
+ if (lines >= 0) {
y -= st->lheight;
- text_draw(st, buf, 0, 0, 1, x+4, y-3, NULL);
+ text_draw(st, buf, 0, 0, 1, x + 4, y - 3, NULL);
}
- i= 0; br= DOC_WIDTH; lines++;
+ i = 0; br = DOC_WIDTH; lines++;
}
- buf[i++]= *p;
- if(i == DOC_WIDTH) { /* Reached the width, go to last break and wrap there */
- buf[br]= '\0';
- if(lines>=0) {
+ buf[i++] = *p;
+ if (i == DOC_WIDTH) { /* Reached the width, go to last break and wrap there */
+ buf[br] = '\0';
+ if (lines >= 0) {
y -= st->lheight;
- text_draw(st, buf, 0, 0, 1, x+4, y-3, NULL);
+ text_draw(st, buf, 0, 0, 1, x + 4, y - 3, NULL);
}
- p -= i-br-1; /* Rewind pointer to last break */
- i= 0; br= DOC_WIDTH; lines++;
+ p -= i - br - 1; /* Rewind pointer to last break */
+ i = 0; br = DOC_WIDTH; lines++;
}
- if(lines >= DOC_HEIGHT) break;
+ if (lines >= DOC_HEIGHT) break;
}
- if(0 /* XXX doc_scroll*/ > 0 && lines < DOC_HEIGHT) {
+ if (0 /* XXX doc_scroll*/ > 0 && lines < DOC_HEIGHT) {
// XXX doc_scroll--;
draw_documentation(st, ar);
}
@@ -1405,45 +1413,45 @@ static void draw_suggestion_list(SpaceText *st, ARegion *ar)
{
SuggItem *item, *first, *last, *sel;
TextLine *tmp;
- char str[SUGG_LIST_WIDTH+1];
- int w, boxw=0, boxh, i, l, x, y, b, *top;
+ char str[SUGG_LIST_WIDTH + 1];
+ int w, boxw = 0, boxh, i, l, x, y, b, *top;
- if(!st || !st->text) return;
- if(!texttool_text_is_active(st->text)) return;
+ if (!st || !st->text) return;
+ if (!texttool_text_is_active(st->text)) return;
first = texttool_suggest_first();
last = texttool_suggest_last();
- if(!first || !last) return;
+ if (!first || !last) return;
text_pop_suggest_list();
sel = texttool_suggest_selected();
top = texttool_suggest_top();
/* Count the visible lines to the cursor */
- for(tmp=st->text->curl, l=-st->top; tmp; tmp=tmp->prev, l++);
- if(l<0) return;
+ for (tmp = st->text->curl, l = -st->top; tmp; tmp = tmp->prev, l++) ;
+ if (l < 0) return;
- if(st->showlinenrs) {
- x = st->cwidth*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4;
+ if (st->showlinenrs) {
+ x = st->cwidth * (st->text->curc - st->left) + TXT_OFFSET + TEXTXLOC - 4;
}
else {
- x = st->cwidth*(st->text->curc-st->left) + TXT_OFFSET - 4;
+ x = st->cwidth * (st->text->curc - st->left) + TXT_OFFSET - 4;
}
- y = ar->winy - st->lheight*l - 2;
+ y = ar->winy - st->lheight * l - 2;
- boxw = SUGG_LIST_WIDTH*st->cwidth + 20;
- boxh = SUGG_LIST_SIZE*st->lheight + 8;
+ boxw = SUGG_LIST_WIDTH * st->cwidth + 20;
+ boxh = SUGG_LIST_SIZE * st->lheight + 8;
UI_ThemeColor(TH_SHADE1);
- glRecti(x-1, y+1, x+boxw+1, y-boxh-1);
+ glRecti(x - 1, y + 1, x + boxw + 1, y - boxh - 1);
UI_ThemeColor(TH_BACK);
- glRecti(x, y, x+boxw, y-boxh);
+ glRecti(x, y, x + boxw, y - boxh);
/* Set the top 'item' of the visible list */
- for(i=0, item=first; i<*top && item->next; i++, item=item->next);
+ for (i = 0, item = first; i < *top && item->next; i++, item = item->next) ;
- for(i=0; i<SUGG_LIST_SIZE && item; i++, item=item->next) {
+ for (i = 0; i < SUGG_LIST_SIZE && item; i++, item = item->next) {
y -= st->lheight;
@@ -1451,25 +1459,25 @@ static void draw_suggestion_list(SpaceText *st, ARegion *ar)
w = BLF_width(mono, str);
- if(item == sel) {
+ if (item == sel) {
UI_ThemeColor(TH_SHADE2);
- glRecti(x+16, y-3, x+16+w, y+st->lheight-3);
+ glRecti(x + 16, y - 3, x + 16 + w, y + st->lheight - 3);
}
- b=1; /* b=1 color block, text is default. b=0 no block, color text */
+ b = 1; /* b=1 color block, text is default. b=0 no block, color text */
switch (item->type) {
- case 'k': UI_ThemeColor(TH_SYNTAX_B); b=0; break;
+ case 'k': UI_ThemeColor(TH_SYNTAX_B); b = 0; break;
case 'm': UI_ThemeColor(TH_TEXT); break;
case 'f': UI_ThemeColor(TH_SYNTAX_L); break;
case 'v': UI_ThemeColor(TH_SYNTAX_N); break;
- case '?': UI_ThemeColor(TH_TEXT); b=0; break;
+ case '?': UI_ThemeColor(TH_TEXT); b = 0; break;
}
- if(b) {
- glRecti(x+8, y+2, x+11, y+5);
+ if (b) {
+ glRecti(x + 8, y + 2, x + 11, y + 5);
UI_ThemeColor(TH_TEXT);
}
- text_draw(st, str, 0, 0, 1, x+16, y-1, NULL);
+ text_draw(st, str, 0, 0, 1, x + 16, y - 1, NULL);
- if(item == last) break;
+ if (item == last) break;
}
}
@@ -1477,12 +1485,12 @@ static void draw_suggestion_list(SpaceText *st, ARegion *ar)
static void draw_cursor(SpaceText *st, ARegion *ar)
{
- Text *text= st->text;
- int vcurl, vcurc, vsell, vselc, hidden=0;
+ Text *text = st->text;
+ int vcurl, vcurc, vsell, vselc, hidden = 0;
int x, y, w, i;
/* Draw the selection */
- if(text->curl!=text->sell || text->curc!=text->selc) {
+ if (text->curl != text->sell || text->curc != text->selc) {
int offl, offc;
/* Convert all to view space character coordinates */
wrap_offset(st, ar, text->curl, text->curc, &offl, &offc);
@@ -1492,38 +1500,38 @@ static void draw_cursor(SpaceText *st, ARegion *ar)
vsell = txt_get_span(text->lines.first, text->sell) - st->top + offl;
vselc = text_get_char_pos(st, text->sell->line, text->selc) - st->left + offc;
- if(vcurc<0) vcurc=0;
- if(vselc<0) vselc=0, hidden=1;
+ if (vcurc < 0) vcurc = 0;
+ if (vselc < 0) vselc = 0, hidden = 1;
UI_ThemeColor(TH_SHADE2);
- x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
- y= ar->winy-2;
+ x = st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
+ y = ar->winy - 2;
- if(vcurl==vsell) {
- y -= vcurl*st->lheight;
- if(vcurc < vselc)
- glRecti(x+vcurc*st->cwidth-1, y, x+vselc*st->cwidth, y-st->lheight);
+ if (vcurl == vsell) {
+ y -= vcurl * st->lheight;
+ if (vcurc < vselc)
+ glRecti(x + vcurc * st->cwidth - 1, y, x + vselc * st->cwidth, y - st->lheight);
else
- glRecti(x+vselc*st->cwidth-1, y, x+vcurc*st->cwidth, y-st->lheight);
+ glRecti(x + vselc * st->cwidth - 1, y, x + vcurc * st->cwidth, y - st->lheight);
}
else {
int froml, fromc, tol, toc;
- if(vcurl < vsell) {
- froml= vcurl; tol= vsell;
- fromc= vcurc; toc= vselc;
+ if (vcurl < vsell) {
+ froml = vcurl; tol = vsell;
+ fromc = vcurc; toc = vselc;
}
else {
- froml= vsell; tol= vcurl;
- fromc= vselc; toc= vcurc;
+ froml = vsell; tol = vcurl;
+ fromc = vselc; toc = vcurc;
}
- y -= froml*st->lheight;
- glRecti(x+fromc*st->cwidth-1, y, ar->winx, y-st->lheight); y-=st->lheight;
- for(i=froml+1; i<tol; i++)
- glRecti(x-4, y, ar->winx, y-st->lheight), y-=st->lheight;
+ y -= froml * st->lheight;
+ glRecti(x + fromc * st->cwidth - 1, y, ar->winx, y - st->lheight); y -= st->lheight;
+ for (i = froml + 1; i < tol; i++)
+ glRecti(x - 4, y, ar->winx, y - st->lheight), y -= st->lheight;
- glRecti(x-4, y, x+toc*st->cwidth, y-st->lheight); y-=st->lheight;
+ glRecti(x - 4, y, x + toc * st->cwidth, y - st->lheight); y -= st->lheight;
}
}
else {
@@ -1532,59 +1540,60 @@ static void draw_cursor(SpaceText *st, ARegion *ar)
vsell = txt_get_span(text->lines.first, text->sell) - st->top + offl;
vselc = text_get_char_pos(st, text->sell->line, text->selc) - st->left + offc;
- if(vselc<0) {
- vselc= 0;
- hidden= 1;
+ if (vselc < 0) {
+ vselc = 0;
+ hidden = 1;
}
}
- if(st->line_hlight) {
+ if (st->line_hlight) {
int x1, x2, y1, y2;
- if(st->wordwrap) {
+ if (st->wordwrap) {
int visible_lines = text_get_visible_lines(st, ar, text->sell->line);
int offl, offc;
wrap_offset_in_line(st, ar, text->sell, text->selc, &offl, &offc);
- y1= ar->winy-2 - (vsell-offl)*st->lheight;
- y2= y1-st->lheight*visible_lines+1;
- } else {
- y1= ar->winy-2 - vsell*st->lheight;
- y2= y1-st->lheight+1;
+ y1 = ar->winy - 2 - (vsell - offl) * st->lheight;
+ y2 = y1 - st->lheight * visible_lines + 1;
+ }
+ else {
+ y1 = ar->winy - 2 - vsell * st->lheight;
+ y2 = y1 - st->lheight + 1;
}
- if(!(y1<0 || y2 > ar->winy)) { /* check we need to draw */
- x1= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
- x2= x1 + ar->winx;
+ if (!(y1 < 0 || y2 > ar->winy)) { /* check we need to draw */
+ x1 = st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
+ x2 = x1 + ar->winx;
glColor4ub(255, 255, 255, 32);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
- glRecti(x1-4, y1, x2, y2);
+ glRecti(x1 - 4, y1, x2, y2);
glDisable(GL_BLEND);
}
}
- if(!hidden) {
+ if (!hidden) {
/* Draw the cursor itself (we draw the sel. cursor as this is the leading edge) */
- x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
- x += vselc*st->cwidth;
- y= ar->winy-2 - vsell*st->lheight;
+ x = st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
+ x += vselc * st->cwidth;
+ y = ar->winy - 2 - vsell * st->lheight;
- if(st->overwrite) {
- char ch= text->sell->line[text->selc];
+ if (st->overwrite) {
+ char ch = text->sell->line[text->selc];
- w= st->cwidth;
- if(ch=='\t') w*= st->tabnumber-(vselc+st->left)%st->tabnumber;
+ w = st->cwidth;
+ if (ch == '\t') w *= st->tabnumber - (vselc + st->left) % st->tabnumber;
UI_ThemeColor(TH_HILITE);
- glRecti(x, y-st->lheight-1, x+w, y-st->lheight+1);
+ glRecti(x, y - st->lheight - 1, x + w, y - st->lheight + 1);
}
else {
UI_ThemeColor(TH_HILITE);
- glRecti(x-1, y, x+1, y-st->lheight);
+ glRecti(x - 1, y, x + 1, y - st->lheight);
}
}
}
@@ -1601,118 +1610,118 @@ static void draw_brackets(SpaceText *st, ARegion *ar)
char ch;
// showsyntax must be on or else the format string will be null
- if(!text->curl || !st->showsyntax) return;
-
- startl= text->curl;
- startc= text->curc;
- b= text_check_bracket(startl->line[startc]);
- if(b==0 && startc>0) b = text_check_bracket(startl->line[--startc]);
- if(b==0) return;
+ if (!text->curl || !st->showsyntax) return;
+
+ startl = text->curl;
+ startc = text->curc;
+ b = text_check_bracket(startl->line[startc]);
+ if (b == 0 && startc > 0) b = text_check_bracket(startl->line[--startc]);
+ if (b == 0) return;
+
+ linep = startl;
+ c = startc;
+ fc = txt_utf8_offset_to_index(linep->line, startc);
+ endl = NULL;
+ endc = -1;
+ find = -b;
+ stack = 0;
- linep= startl;
- c= startc;
- fc= txt_utf8_offset_to_index(linep->line, startc);
- endl= NULL;
- endc= -1;
- find= -b;
- stack= 0;
-
- /* Dont highlight backets if syntax HL is off or bracket in string or comment. */
- if(!linep->format || linep->format[fc] == 'l' || linep->format[fc] == '#')
+ /* Don't highlight backets if syntax HL is off or bracket in string or comment. */
+ if (!linep->format || linep->format[fc] == 'l' || linep->format[fc] == '#')
return;
- if(b>0) {
+ if (b > 0) {
/* opening bracket, search forward for close */
fc++;
- c+= BLI_str_utf8_size(linep->line+c);
- while(linep) {
- while(c<linep->len) {
- if(linep->format && linep->format[fc] != 'l' && linep->format[fc] != '#') {
- b= text_check_bracket(linep->line[c]);
- if(b==find) {
- if(stack==0) {
- endl= linep;
- endc= c;
+ c += BLI_str_utf8_size(linep->line + c);
+ while (linep) {
+ while (c < linep->len) {
+ if (linep->format && linep->format[fc] != 'l' && linep->format[fc] != '#') {
+ b = text_check_bracket(linep->line[c]);
+ if (b == find) {
+ if (stack == 0) {
+ endl = linep;
+ endc = c;
break;
}
stack--;
}
- else if(b==-find) {
+ else if (b == -find) {
stack++;
}
}
fc++;
- c+= BLI_str_utf8_size(linep->line+c);
+ c += BLI_str_utf8_size(linep->line + c);
}
- if(endl) break;
- linep= linep->next;
- c= 0;
- fc= 0;
+ if (endl) break;
+ linep = linep->next;
+ c = 0;
+ fc = 0;
}
}
else {
/* closing bracket, search backward for open */
fc--;
- if (c>0) c -= linep->line+c-BLI_str_prev_char_utf8(linep->line+c);
- while(linep) {
- while(fc>=0) {
- if(linep->format && linep->format[fc] != 'l' && linep->format[fc] != '#') {
- b= text_check_bracket(linep->line[c]);
- if(b==find) {
- if(stack==0) {
- endl= linep;
- endc= c;
+ if (c > 0) c -= linep->line + c - BLI_str_prev_char_utf8(linep->line + c);
+ while (linep) {
+ while (fc >= 0) {
+ if (linep->format && linep->format[fc] != 'l' && linep->format[fc] != '#') {
+ b = text_check_bracket(linep->line[c]);
+ if (b == find) {
+ if (stack == 0) {
+ endl = linep;
+ endc = c;
break;
}
stack--;
}
- else if(b==-find) {
+ else if (b == -find) {
stack++;
}
}
fc--;
- if (c>0) c -= linep->line+c-BLI_str_prev_char_utf8(linep->line+c);
+ if (c > 0) c -= linep->line + c - BLI_str_prev_char_utf8(linep->line + c);
}
- if(endl) break;
- linep= linep->prev;
- if(linep) {
- if (linep->format) fc= strlen(linep->format)-1;
- else fc= -1;
- if (linep->len) c= BLI_str_prev_char_utf8(linep->line+linep->len)-linep->line;
- else fc= -1;
+ if (endl) break;
+ linep = linep->prev;
+ if (linep) {
+ if (linep->format) fc = strlen(linep->format) - 1;
+ else fc = -1;
+ if (linep->len) c = BLI_str_prev_char_utf8(linep->line + linep->len) - linep->line;
+ else fc = -1;
}
}
}
- if(!endl || endc==-1)
+ if (!endl || endc == -1)
return;
UI_ThemeColor(TH_HILITE);
- x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
- y= ar->winy - st->lheight;
+ x = st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
+ y = ar->winy - st->lheight;
/* draw opening bracket */
- ch= startl->line[startc];
+ ch = startl->line[startc];
wrap_offset(st, ar, startl, startc, &offl, &offc);
- viewc= text_get_char_pos(st, startl->line, startc) - st->left + offc;
+ viewc = text_get_char_pos(st, startl->line, startc) - st->left + offc;
- if(viewc >= 0){
- viewl= txt_get_span(text->lines.first, startl) - st->top + offl;
+ if (viewc >= 0) {
+ viewl = txt_get_span(text->lines.first, startl) - st->top + offl;
- text_font_draw_character(st, x+viewc*st->cwidth, y-viewl*st->lheight, ch);
- text_font_draw_character(st, x+viewc*st->cwidth+1, y-viewl*st->lheight, ch);
+ text_font_draw_character(st, x + viewc * st->cwidth, y - viewl * st->lheight, ch);
+ text_font_draw_character(st, x + viewc * st->cwidth + 1, y - viewl * st->lheight, ch);
}
/* draw closing bracket */
- ch= endl->line[endc];
+ ch = endl->line[endc];
wrap_offset(st, ar, endl, endc, &offl, &offc);
- viewc= text_get_char_pos(st, endl->line, endc) - st->left + offc;
+ viewc = text_get_char_pos(st, endl->line, endc) - st->left + offc;
- if(viewc >= 0) {
- viewl= txt_get_span(text->lines.first, endl) - st->top + offl;
+ if (viewc >= 0) {
+ viewl = txt_get_span(text->lines.first, endl) - st->top + offl;
- text_font_draw_character(st, x+viewc*st->cwidth, y-viewl*st->lheight, ch);
- text_font_draw_character(st, x+viewc*st->cwidth+1, y-viewl*st->lheight, ch);
+ text_font_draw_character(st, x + viewc * st->cwidth, y - viewl * st->lheight, ch);
+ text_font_draw_character(st, x + viewc * st->cwidth + 1, y - viewl * st->lheight, ch);
}
}
@@ -1720,49 +1729,51 @@ static void draw_brackets(SpaceText *st, ARegion *ar)
void draw_text_main(SpaceText *st, ARegion *ar)
{
- Text *text= st->text;
+ Text *text = st->text;
TextLine *tmp;
rcti scroll, back;
char linenr[12];
- int i, x, y, winx, linecount= 0, lineno= 0;
- int wraplinecount= 0, wrap_skip= 0;
+ int i, x, y, winx, linecount = 0, lineno = 0;
+ int wraplinecount = 0, wrap_skip = 0;
- if(st->lheight) st->viewlines= (int)ar->winy/st->lheight;
- else st->viewlines= 0;
+ if (st->lheight) st->viewlines = (int)ar->winy / st->lheight;
+ else st->viewlines = 0;
/* if no text, nothing to do */
- if(!text)
+ if (!text)
return;
text_update_drawcache(st, ar);
/* make sure all the positional pointers exist */
- if(!text->curl || !text->sell || !text->lines.first || !text->lines.last)
+ if (!text->curl || !text->sell || !text->lines.first || !text->lines.last)
txt_clean_text(text);
/* update rects for scroll */
- calc_text_rcts(st, ar, &scroll, &back); /* scroll will hold the entire bar size */
+ calc_text_rcts(st, ar, &scroll, &back); /* scroll will hold the entire bar size */
/* update syntax formatting if needed */
- tmp= text->lines.first;
- lineno= 0;
- for(i= 0; i<st->top && tmp; i++) {
- if(st->showsyntax && !tmp->format)
+ tmp = text->lines.first;
+ lineno = 0;
+ for (i = 0; i < st->top && tmp; i++) {
+ if (st->showsyntax && !tmp->format)
txt_format_line(st, tmp, 0);
- if(st->wordwrap) {
- int lines= text_get_visible_lines_no(st, lineno);
+ if (st->wordwrap) {
+ int lines = text_get_visible_lines_no(st, lineno);
- if (wraplinecount+lines>st->top) {
- wrap_skip= st->top-wraplinecount;
+ if (wraplinecount + lines > st->top) {
+ wrap_skip = st->top - wraplinecount;
break;
- } else {
- wraplinecount+= lines;
- tmp= tmp->next;
+ }
+ else {
+ wraplinecount += lines;
+ tmp = tmp->next;
linecount++;
}
- } else {
- tmp= tmp->next;
+ }
+ else {
+ tmp = tmp->next;
linecount++;
}
@@ -1770,22 +1781,22 @@ void draw_text_main(SpaceText *st, ARegion *ar)
}
text_font_begin(st);
- st->cwidth= BLF_fixed_width(mono);
- st->cwidth= MAX2(st->cwidth, 1);
+ st->cwidth = BLF_fixed_width(mono);
+ st->cwidth = MAX2(st->cwidth, 1);
/* draw line numbers background */
- if(st->showlinenrs) {
- x= TXT_OFFSET + TEXTXLOC;
+ if (st->showlinenrs) {
+ x = TXT_OFFSET + TEXTXLOC;
UI_ThemeColor(TH_GRID);
- glRecti((TXT_OFFSET-12), 0, (TXT_OFFSET-5) + TEXTXLOC, ar->winy - 2);
+ glRecti((TXT_OFFSET - 12), 0, (TXT_OFFSET - 5) + TEXTXLOC, ar->winy - 2);
}
else {
- st->linenrs_tot= 0; /* not used */
- x= TXT_OFFSET;
+ st->linenrs_tot = 0; /* not used */
+ x = TXT_OFFSET;
}
- y= ar->winy-st->lheight;
- winx= ar->winx - TXT_SCROLL_WIDTH;
+ y = ar->winy - st->lheight;
+ winx = ar->winx - TXT_SCROLL_WIDTH;
/* draw cursor */
draw_cursor(st, ar);
@@ -1793,13 +1804,13 @@ void draw_text_main(SpaceText *st, ARegion *ar)
/* draw the text */
UI_ThemeColor(TH_TEXT);
- for(i=0; y>0 && i<st->viewlines && tmp; i++, tmp= tmp->next) {
- if(st->showsyntax && !tmp->format)
+ for (i = 0; y > 0 && i < st->viewlines && tmp; i++, tmp = tmp->next) {
+ if (st->showsyntax && !tmp->format)
txt_format_line(st, tmp, 0);
- if(st->showlinenrs && !wrap_skip) {
+ if (st->showlinenrs && !wrap_skip) {
/* draw line number */
- if(tmp == text->curl)
+ if (tmp == text->curl)
UI_ThemeColor(TH_HILITE);
else
UI_ThemeColor(TH_TEXT);
@@ -1811,26 +1822,26 @@ void draw_text_main(SpaceText *st, ARegion *ar)
UI_ThemeColor(TH_TEXT);
}
- if(st->wordwrap) {
+ if (st->wordwrap) {
/* draw word wrapped text */
- int lines = text_draw_wrapped(st, tmp->line, x, y, winx-x, tmp->format, wrap_skip);
- y -= lines*st->lheight;
+ int lines = text_draw_wrapped(st, tmp->line, x, y, winx - x, tmp->format, wrap_skip);
+ y -= lines * st->lheight;
}
else {
/* draw unwrapped text */
- text_draw(st, tmp->line, st->left, ar->winx/st->cwidth, 1, x, y, tmp->format);
+ text_draw(st, tmp->line, st->left, ar->winx / st->cwidth, 1, x, y, tmp->format);
y -= st->lheight;
}
- wrap_skip= 0;
+ wrap_skip = 0;
}
- if(st->flags&ST_SHOW_MARGIN) {
+ if (st->flags & ST_SHOW_MARGIN) {
UI_ThemeColor(TH_HILITE);
glBegin(GL_LINES);
- glVertex2i(x+st->cwidth*st->margin_column, 0);
- glVertex2i(x+st->cwidth*st->margin_column, ar->winy - 2);
+ glVertex2i(x + st->cwidth * st->margin_column, 0);
+ glVertex2i(x + st->cwidth * st->margin_column, ar->winy - 2);
glEnd();
}
@@ -1850,26 +1861,26 @@ void draw_text_main(SpaceText *st, ARegion *ar)
void text_update_character_width(SpaceText *st)
{
text_font_begin(st);
- st->cwidth= BLF_fixed_width(mono);
- st->cwidth= MAX2(st->cwidth, 1);
+ st->cwidth = BLF_fixed_width(mono);
+ st->cwidth = MAX2(st->cwidth, 1);
text_font_end(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 isn't outside the file */
void text_scroll_to_cursor(SpaceText *st, ScrArea *sa)
{
Text *text;
- ARegion *ar= NULL;
- int i, x, winx= 0;
+ ARegion *ar = NULL;
+ int i, x, winx = 0;
- if(ELEM3(NULL, st, st->text, st->text->curl)) return;
+ if (ELEM3(NULL, st, st->text, st->text->curl)) return;
- text= st->text;
+ text = st->text;
- for(ar=sa->regionbase.first; ar; ar= ar->next)
- if(ar->regiontype==RGN_TYPE_WINDOW) {
- winx= ar->winx;
+ for (ar = sa->regionbase.first; ar; ar = ar->next)
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
+ winx = ar->winx;
break;
}
@@ -1877,34 +1888,34 @@ void text_scroll_to_cursor(SpaceText *st, ScrArea *sa)
text_update_character_width(st);
- i= txt_get_span(text->lines.first, text->sell);
- if(st->wordwrap) {
+ i = txt_get_span(text->lines.first, text->sell);
+ if (st->wordwrap) {
int offl, offc;
wrap_offset(st, ar, text->sell, text->selc, &offl, &offc);
- i+= offl;
+ i += offl;
}
- if(st->top+st->viewlines <= i || st->top > i)
- st->top= i - st->viewlines/2;
+ if (st->top + st->viewlines <= i || st->top > i)
+ st->top = i - st->viewlines / 2;
- if(st->wordwrap) {
- st->left= 0;
+ if (st->wordwrap) {
+ st->left = 0;
}
else {
- x= text_draw(st, text->sell->line, st->left, text->selc, 0, 0, 0, NULL);
+ x = text_draw(st, text->sell->line, st->left, text->selc, 0, 0, 0, NULL);
- if(x==0 || x>winx)
- st->left= text->curc-0.5*winx/st->cwidth;
+ if (x == 0 || x > winx)
+ st->left = text->curc - 0.5 * winx / st->cwidth;
}
- if(st->top < 0) st->top= 0;
- if(st->left <0) st->left= 0;
+ if (st->top < 0) st->top = 0;
+ if (st->left < 0) st->left = 0;
}
void text_update_cursor_moved(bContext *C)
{
- ScrArea *sa= CTX_wm_area(C);
- SpaceText *st= CTX_wm_space_text(C);
+ ScrArea *sa = CTX_wm_area(C);
+ SpaceText *st = CTX_wm_space_text(C);
text_scroll_to_cursor(st, sa);
}
diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c
index b8e53f752e2..a7b455a6ff3 100644
--- a/source/blender/editors/space_text/text_header.c
+++ b/source/blender/editors/space_text/text_header.c
@@ -68,7 +68,7 @@
#include "text_intern.h"
-#define HEADER_PATH_MAX 260
+#define HEADER_PATH_MAX 260
/* ************************ header area region *********************** */
@@ -78,20 +78,20 @@ static ARegion *text_has_properties_region(ScrArea *sa)
{
ARegion *ar, *arnew;
- ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
- if(ar) return ar;
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_UI);
+ if (ar) return ar;
/* add subdiv level; after header */
- ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
/* is error! */
- if(ar==NULL) return NULL;
+ if (ar == NULL) return NULL;
- arnew= MEM_callocN(sizeof(ARegion), "properties region");
+ arnew = MEM_callocN(sizeof(ARegion), "properties region");
BLI_insertlinkafter(&sa->regionbase, ar, arnew);
- arnew->regiontype= RGN_TYPE_UI;
- arnew->alignment= RGN_ALIGN_LEFT;
+ arnew->regiontype = RGN_TYPE_UI;
+ arnew->alignment = RGN_ALIGN_LEFT;
arnew->flag = RGN_FLAG_HIDDEN;
@@ -105,10 +105,10 @@ static int text_properties_poll(bContext *C)
static int text_properties_exec(bContext *C, wmOperator *UNUSED(op))
{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= text_has_properties_region(sa);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = text_has_properties_region(sa);
- if(ar)
+ if (ar)
ED_region_toggle_hidden(C, ar);
return OPERATOR_FINISHED;
@@ -117,13 +117,13 @@ static int text_properties_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_properties(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Properties";
- ot->description= "Toggle text properties panel";
- ot->idname= "TEXT_OT_properties";
+ ot->name = "Properties";
+ ot->description = "Toggle text properties panel";
+ ot->idname = "TEXT_OT_properties";
/* api callbacks */
- ot->exec= text_properties_exec;
- ot->poll= text_properties_poll;
+ ot->exec = text_properties_exec;
+ ot->poll = text_properties_poll;
}
/******************** XXX popup menus *******************/
@@ -134,9 +134,9 @@ void TEXT_OT_properties(wmOperatorType *ot)
uiPopupMenu *pup;
- if(text) {
- pup= uiPupMenuBegin(C, "Text", ICON_NONE);
- if(txt_has_sel(text)) {
+ if (text) {
+ pup = uiPupMenuBegin(C, "Text", ICON_NONE);
+ if (txt_has_sel(text)) {
uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_cut");
uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_copy");
}
@@ -149,7 +149,7 @@ void TEXT_OT_properties(wmOperatorType *ot)
uiPupMenuEnd(C, pup);
}
else {
- pup= uiPupMenuBegin(C, "File", ICON_NONE);
+ pup = uiPupMenuBegin(C, "File", ICON_NONE);
uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_new");
uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_open");
uiPupMenuEnd(C, pup);
@@ -161,7 +161,7 @@ void TEXT_OT_properties(wmOperatorType *ot)
uiPopupMenu *pup;
- pup= uiPupMenuBegin(C, "Edit", ICON_NONE);
+ pup = uiPupMenuBegin(C, "Edit", ICON_NONE);
uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_cut");
uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_copy");
uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_paste");
@@ -173,8 +173,8 @@ void TEXT_OT_properties(wmOperatorType *ot)
uiPopupMenu *pup;
- if(text) {
- pup= uiPupMenuBegin(C, "Text", ICON_NONE);
+ if (text) {
+ pup = uiPupMenuBegin(C, "Text", ICON_NONE);
uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_new");
uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_open");
uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_save");
@@ -183,7 +183,7 @@ void TEXT_OT_properties(wmOperatorType *ot)
uiPupMenuEnd(C, pup);
}
else {
- pup= uiPupMenuBegin(C, "File", ICON_NONE);
+ pup = uiPupMenuBegin(C, "File", ICON_NONE);
uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_new");
uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_open");
uiPupMenuEnd(C, pup);
@@ -195,7 +195,7 @@ void TEXT_OT_properties(wmOperatorType *ot)
uiPopupMenu *pup;
- pup= uiPupMenuBegin(C, "Text", ICON_NONE);
+ pup = uiPupMenuBegin(C, "Text", ICON_NONE);
uiItemEnumO(layout, "TEXT_OT_move", "Top of File", 0, "type", FILE_TOP);
uiItemEnumO(layout, "TEXT_OT_move", "Bottom of File", 0, "type", FILE_BOTTOM);
uiItemEnumO(layout, "TEXT_OT_move", "Page Up", 0, "type", PREV_PAGE);
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index db8c1b230ba..730dfb7d979 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -73,6 +73,13 @@
/************************ poll ***************************/
+
+BLI_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;
@@ -80,12 +87,12 @@ static int text_new_poll(bContext *UNUSED(C))
static int text_edit_poll(bContext *C)
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
- if(!text)
+ if (!text)
return 0;
- if(text->id.lib) {
+ if (text->id.lib) {
// BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata");
return 0;
}
@@ -95,13 +102,13 @@ static int text_edit_poll(bContext *C)
static int text_space_edit_poll(bContext *C)
{
- SpaceText *st= CTX_wm_space_text(C);
- Text *text= CTX_data_edit_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
+ Text *text = CTX_data_edit_text(C);
- if(!st || !text)
+ if (!st || !text)
return 0;
- if(text->id.lib) {
+ if (text->id.lib) {
// BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata");
return 0;
}
@@ -111,17 +118,17 @@ static int text_space_edit_poll(bContext *C)
static int text_region_edit_poll(bContext *C)
{
- SpaceText *st= CTX_wm_space_text(C);
- Text *text= CTX_data_edit_text(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceText *st = CTX_wm_space_text(C);
+ Text *text = CTX_data_edit_text(C);
+ ARegion *ar = CTX_wm_region(C);
- if(!st || !text)
+ if (!st || !text)
return 0;
- if(!ar || ar->regiontype != RGN_TYPE_WINDOW)
+ if (!ar || ar->regiontype != RGN_TYPE_WINDOW)
return 0;
- if(text->id.lib) {
+ if (text->id.lib) {
// BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata");
return 0;
}
@@ -133,13 +140,13 @@ static int text_region_edit_poll(bContext *C)
void text_update_line_edited(TextLine *line)
{
- if(!line)
+ if (!line)
return;
/* we just free format here, and let it rebuild during draw */
- if(line->format) {
+ if (line->format) {
MEM_freeN(line->format);
- line->format= NULL;
+ line->format = NULL;
}
}
@@ -147,7 +154,7 @@ void text_update_edited(Text *text)
{
TextLine *line;
- for(line=text->lines.first; line; line=line->next)
+ for (line = text->lines.first; line; line = line->next)
text_update_line_edited(line);
}
@@ -155,34 +162,34 @@ void text_update_edited(Text *text)
static int text_new_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceText *st= CTX_wm_space_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
Text *text;
PointerRNA ptr, idptr;
PropertyRNA *prop;
- text= add_empty_text("Text");
+ text = add_empty_text("Text");
/* hook into UI */
uiIDContextProperty(C, &ptr, &prop);
- if(prop) {
+ if (prop) {
/* when creating new ID blocks, use is already 1, but RNA
* pointer se also increases user, so this compensates it */
/* doesnt always seem to happen... (ton) */
- if(text->id.us>1)
+ if (text->id.us > 1)
text->id.us--;
RNA_id_pointer_create(&text->id, &idptr);
RNA_property_pointer_set(&ptr, prop, idptr);
RNA_property_update(C, &ptr, prop);
}
- else if(st) {
- st->text= text;
- st->top= 0;
+ else if (st) {
+ st->text = text;
+ st->top = 0;
text_drawcache_tag_update(st, 1);
}
- WM_event_add_notifier(C, NC_TEXT|NA_ADDED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_ADDED, text);
return OPERATOR_FINISHED;
}
@@ -190,16 +197,16 @@ static int text_new_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_new(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Create Text Block";
- ot->idname= "TEXT_OT_new";
- ot->description= "Create a new text data block";
+ ot->name = "Create Text Block";
+ ot->idname = "TEXT_OT_new";
+ ot->description = "Create a new text data block";
/* api callbacks */
- ot->exec= text_new_exec;
- ot->poll= text_new_poll;
+ ot->exec = text_new_exec;
+ ot->poll = text_new_poll;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
}
/******************* open operator *********************/
@@ -208,7 +215,7 @@ static void text_open_init(bContext *C, wmOperator *op)
{
PropertyPointerRNA *pprop;
- op->customdata= pprop= MEM_callocN(sizeof(PropertyPointerRNA), "OpenPropertyPointerRNA");
+ op->customdata = pprop = MEM_callocN(sizeof(PropertyPointerRNA), "OpenPropertyPointerRNA");
uiIDContextProperty(C, &pprop->ptr, &pprop->prop);
}
@@ -220,7 +227,7 @@ static int text_open_cancel(bContext *UNUSED(C), wmOperator *op)
static int text_open_exec(bContext *C, wmOperator *op)
{
- SpaceText *st= CTX_wm_space_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
Text *text;
PropertyPointerRNA *pprop;
PointerRNA idptr;
@@ -229,20 +236,20 @@ static int text_open_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filepath", str);
- text= add_text(str, G.main->name);
+ text = add_text(str, G.main->name);
- if(!text) {
- if(op->customdata) MEM_freeN(op->customdata);
+ if (!text) {
+ if (op->customdata) MEM_freeN(op->customdata);
return OPERATOR_CANCELLED;
}
- if(!op->customdata)
+ if (!op->customdata)
text_open_init(C, op);
/* hook into UI */
- pprop= op->customdata;
+ pprop = op->customdata;
- if(pprop->prop) {
+ if (pprop->prop) {
/* when creating new ID blocks, use is already 1, but RNA
* pointer se also increases user, so this compensates it */
text->id.us--;
@@ -251,20 +258,20 @@ static int text_open_exec(bContext *C, wmOperator *op)
RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr);
RNA_property_update(C, &pprop->ptr, pprop->prop);
}
- else if(st) {
- st->text= text;
- st->top= 0;
+ else if (st) {
+ st->text = text;
+ st->top = 0;
}
if (internal) {
- if(text->name)
+ if (text->name)
MEM_freeN(text->name);
text->name = NULL;
}
text_drawcache_tag_update(st, 1);
- WM_event_add_notifier(C, NC_TEXT|NA_ADDED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_ADDED, text);
MEM_freeN(op->customdata);
@@ -273,10 +280,10 @@ static int text_open_exec(bContext *C, wmOperator *op)
static int text_open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- Text *text= CTX_data_edit_text(C);
- char *path= (text && text->name)? text->name: G.main->name;
+ Text *text = CTX_data_edit_text(C);
+ char *path = (text && text->name) ? text->name : G.main->name;
- if(RNA_struct_property_is_set(op->ptr, "filepath"))
+ if (RNA_struct_property_is_set(op->ptr, "filepath"))
return text_open_exec(C, op);
text_open_init(C, op);
@@ -289,21 +296,21 @@ static int text_open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void TEXT_OT_open(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Open Text Block";
- ot->idname= "TEXT_OT_open";
- ot->description= "Open a new text data block";
+ ot->name = "Open Text Block";
+ ot->idname = "TEXT_OT_open";
+ ot->description = "Open a new text data block";
/* api callbacks */
- ot->exec= text_open_exec;
- ot->invoke= text_open_invoke;
- ot->cancel= text_open_cancel;
- ot->poll= text_new_poll;
+ ot->exec = text_open_exec;
+ ot->invoke = text_open_invoke;
+ ot->cancel = text_open_cancel;
+ ot->poll = text_new_poll;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* properties */
- WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY); //XXX TODO, relative_path
+ WM_operator_properties_filesel(ot, FOLDERFILE | TEXTFILE | PYSCRIPTFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY); //XXX TODO, relative_path
RNA_def_boolean(ot->srna, "internal", 0, "Make internal", "Make text file internal after loading");
}
@@ -311,22 +318,22 @@ void TEXT_OT_open(wmOperatorType *ot)
static int text_reload_exec(bContext *C, wmOperator *op)
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
- if(!reopen_text(text)) {
+ if (!reopen_text(text)) {
BKE_report(op->reports, RPT_ERROR, "Could not reopen file");
return OPERATOR_CANCELLED;
}
#ifdef WITH_PYTHON
- if(text->compiled)
+ if (text->compiled)
BPY_text_free_code(text);
#endif
text_update_edited(text);
text_update_cursor_moved(C);
text_drawcache_tag_update(CTX_wm_space_text(C), 1);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -334,14 +341,14 @@ static int text_reload_exec(bContext *C, wmOperator *op)
void TEXT_OT_reload(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reload";
- ot->idname= "TEXT_OT_reload";
- ot->description= "Reload active text data block from its file";
+ ot->name = "Reload";
+ ot->idname = "TEXT_OT_reload";
+ ot->description = "Reload active text data block from its file";
/* api callbacks */
- ot->exec= text_reload_exec;
- ot->invoke= WM_operator_confirm;
- ot->poll= text_edit_poll;
+ ot->exec = text_reload_exec;
+ ot->invoke = WM_operator_confirm;
+ ot->poll = text_edit_poll;
}
/******************* delete operator *********************/
@@ -354,21 +361,21 @@ static int text_unlink_poll(bContext *C)
static int text_unlink_exec(bContext *C, wmOperator *UNUSED(op))
{
- Main *bmain= CTX_data_main(C);
- SpaceText *st= CTX_wm_space_text(C);
- Text *text= CTX_data_edit_text(C);
+ Main *bmain = CTX_data_main(C);
+ SpaceText *st = CTX_wm_space_text(C);
+ Text *text = CTX_data_edit_text(C);
/* make the previous text active, if its not there make the next text active */
- if(st) {
- if(text->id.prev) {
+ if (st) {
+ if (text->id.prev) {
st->text = text->id.prev;
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, st->text);
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, st->text);
}
- else if(text->id.next) {
+ else if (text->id.next) {
st->text = text->id.next;
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, st->text);
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, st->text);
}
}
@@ -376,7 +383,7 @@ static int text_unlink_exec(bContext *C, wmOperator *UNUSED(op))
free_libblock(&bmain->text, text);
text_drawcache_tag_update(st, 1);
- WM_event_add_notifier(C, NC_TEXT|NA_REMOVED, NULL);
+ WM_event_add_notifier(C, NC_TEXT | NA_REMOVED, NULL);
return OPERATOR_FINISHED;
}
@@ -384,34 +391,34 @@ static int text_unlink_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_unlink(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Unlink";
- ot->idname= "TEXT_OT_unlink";
- ot->description= "Unlink active text data block";
+ ot->name = "Unlink";
+ ot->idname = "TEXT_OT_unlink";
+ ot->description = "Unlink active text data block";
/* api callbacks */
- ot->exec= text_unlink_exec;
- ot->invoke= WM_operator_confirm;
- ot->poll= text_unlink_poll;
+ ot->exec = text_unlink_exec;
+ ot->invoke = WM_operator_confirm;
+ ot->poll = text_unlink_poll;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
}
/******************* make internal operator *********************/
static int text_make_internal_exec(bContext *C, wmOperator *UNUSED(op))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
text->flags |= TXT_ISMEM | TXT_ISDIRTY;
- if(text->name) {
+ if (text->name) {
MEM_freeN(text->name);
- text->name= NULL;
+ text->name = NULL;
}
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -419,25 +426,25 @@ static int text_make_internal_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_make_internal(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Make Internal";
- ot->idname= "TEXT_OT_make_internal";
- ot->description= "Make active text file internal";
+ ot->name = "Make Internal";
+ ot->idname = "TEXT_OT_make_internal";
+ ot->description = "Make active text file internal";
/* api callbacks */
- ot->exec= text_make_internal_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_make_internal_exec;
+ ot->poll = text_edit_poll;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
}
/******************* save operator *********************/
static int text_save_poll(bContext *C)
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
- if(!text_edit_poll(C))
+ if (!text_edit_poll(C))
return 0;
return (text->name != NULL && !(text->flags & TXT_ISMEM));
@@ -453,42 +460,42 @@ static void txt_write_file(Text *text, ReportList *reports)
BLI_strncpy(filepath, text->name, FILE_MAX);
BLI_path_abs(filepath, G.main->name);
- fp= fopen(filepath, "w");
- if(fp==NULL) {
+ fp = BLI_fopen(filepath, "w");
+ if (fp == NULL) {
BKE_reportf(reports, RPT_ERROR, "Unable to save \"%s\": %s", filepath, errno ? strerror(errno) : "Unknown error writing file");
return;
}
- tmp= text->lines.first;
- while(tmp) {
- if(tmp->next) fprintf(fp, "%s\n", tmp->line);
+ tmp = text->lines.first;
+ while (tmp) {
+ if (tmp->next) fprintf(fp, "%s\n", tmp->line);
else fprintf(fp, "%s", tmp->line);
- tmp= tmp->next;
+ tmp = tmp->next;
}
- fclose (fp);
+ fclose(fp);
- if(stat(filepath, &st) == 0) {
- text->mtime= st.st_mtime;
+ if (stat(filepath, &st) == 0) {
+ text->mtime = st.st_mtime;
}
else {
- text->mtime= 0;
+ text->mtime = 0;
BKE_reportf(reports, RPT_WARNING, "Unable to stat \"%s\": %s", filepath, errno ? strerror(errno) : "Unknown error starrng file");
}
- if(text->flags & TXT_ISDIRTY)
+ if (text->flags & TXT_ISDIRTY)
text->flags ^= TXT_ISDIRTY;
}
static int text_save_exec(bContext *C, wmOperator *op)
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
txt_write_file(text, op->reports);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -496,53 +503,53 @@ static int text_save_exec(bContext *C, wmOperator *op)
void TEXT_OT_save(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Save";
- ot->idname= "TEXT_OT_save";
- ot->description= "Save active text data block";
+ ot->name = "Save";
+ ot->idname = "TEXT_OT_save";
+ ot->description = "Save active text data block";
/* api callbacks */
- ot->exec= text_save_exec;
- ot->poll= text_save_poll;
+ ot->exec = text_save_exec;
+ ot->poll = text_save_poll;
}
/******************* save as operator *********************/
static int text_save_as_exec(bContext *C, wmOperator *op)
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
char str[FILE_MAX];
- if(!text)
+ if (!text)
return OPERATOR_CANCELLED;
RNA_string_get(op->ptr, "filepath", str);
- if(text->name) MEM_freeN(text->name);
- text->name= BLI_strdup(str);
+ if (text->name) MEM_freeN(text->name);
+ text->name = BLI_strdup(str);
text->flags &= ~TXT_ISMEM;
txt_write_file(text, op->reports);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
static int text_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
char *str;
- if(RNA_struct_property_is_set(op->ptr, "filepath"))
+ if (RNA_struct_property_is_set(op->ptr, "filepath"))
return text_save_as_exec(C, op);
- if(text->name)
- str= text->name;
- else if(text->flags & TXT_ISMEM)
- str= text->id.name+2;
+ if (text->name)
+ str = text->name;
+ else if (text->flags & TXT_ISMEM)
+ str = text->id.name + 2;
else
- str= G.main->name;
+ str = G.main->name;
RNA_string_set(op->ptr, "filepath", str);
WM_event_add_fileselect(C, op);
@@ -553,17 +560,17 @@ static int text_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
void TEXT_OT_save_as(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Save As";
- ot->idname= "TEXT_OT_save_as";
- ot->description= "Save active text file with options";
+ ot->name = "Save As";
+ ot->idname = "TEXT_OT_save_as";
+ ot->description = "Save active text file with options";
/* api callbacks */
- ot->exec= text_save_as_exec;
- ot->invoke= text_save_as_invoke;
- ot->poll= text_edit_poll;
+ ot->exec = text_save_as_exec;
+ ot->invoke = text_save_as_invoke;
+ ot->poll = text_edit_poll;
/* properties */
- WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY); //XXX TODO, relative_path
+ WM_operator_properties_filesel(ot, FOLDERFILE | TEXTFILE | PYSCRIPTFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY); //XXX TODO, relative_path
}
/******************* run script operator *********************/
@@ -576,26 +583,26 @@ static int text_run_script_poll(bContext *C)
static int text_run_script(bContext *C, ReportList *reports)
{
#ifdef WITH_PYTHON
- Text *text= CTX_data_edit_text(C);
- const short is_live= (reports == NULL);
+ Text *text = CTX_data_edit_text(C);
+ const short is_live = (reports == NULL);
/* only for comparison */
- void *curl_prev= text->curl;
- int curc_prev= text->curc;
+ void *curl_prev = text->curl;
+ int curc_prev = text->curc;
if (BPY_text_exec(C, text, reports, !is_live)) {
- if(is_live) {
+ if (is_live) {
/* for nice live updates */
- WM_event_add_notifier(C, NC_WINDOW|NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_WINDOW | NA_EDITED, NULL);
}
return OPERATOR_FINISHED;
}
- /* Dont report error messages while live editing */
- if(!is_live) {
- if(text->curl != curl_prev || curc_prev != text->curc) {
+ /* Don't report error messages while live editing */
+ if (!is_live) {
+ if (text->curl != curl_prev || curc_prev != text->curc) {
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
}
BKE_report(reports, RPT_ERROR, "Python script fail, look in the console for now...");
@@ -623,16 +630,16 @@ static int text_run_script_exec(bContext *C, wmOperator *op)
void TEXT_OT_run_script(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Run Script";
- ot->idname= "TEXT_OT_run_script";
- ot->description= "Run active script";
+ ot->name = "Run Script";
+ ot->idname = "TEXT_OT_run_script";
+ ot->description = "Run active script";
/* api callbacks */
- ot->poll= text_run_script_poll;
- ot->exec= text_run_script_exec;
+ ot->poll = text_run_script_poll;
+ ot->exec = text_run_script_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/******************* refresh pyconstraints operator *********************/
@@ -641,36 +648,36 @@ static int text_refresh_pyconstraints_exec(bContext *UNUSED(C), wmOperator *UNUS
{
#ifdef WITH_PYTHON
#if 0
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
Object *ob;
bConstraint *con;
short update;
/* check all pyconstraints */
- for(ob= CTX_data_main(C)->object.first; ob; ob= ob->id.next) {
+ for (ob = CTX_data_main(C)->object.first; ob; ob = ob->id.next) {
update = 0;
- if(ob->type==OB_ARMATURE && ob->pose) {
+ if (ob->type == OB_ARMATURE && ob->pose) {
bPoseChannel *pchan;
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- for(con = pchan->constraints.first; con; con= con->next) {
- if(con->type==CONSTRAINT_TYPE_PYTHON) {
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ for (con = pchan->constraints.first; con; con = con->next) {
+ if (con->type == CONSTRAINT_TYPE_PYTHON) {
bPythonConstraint *data = con->data;
- if(data->text==text) BPY_pyconstraint_update(ob, con);
+ if (data->text == text) BPY_pyconstraint_update(ob, con);
update = 1;
}
}
}
}
- for(con = ob->constraints.first; con; con= con->next) {
- if(con->type==CONSTRAINT_TYPE_PYTHON) {
+ for (con = ob->constraints.first; con; con = con->next) {
+ if (con->type == CONSTRAINT_TYPE_PYTHON) {
bPythonConstraint *data = con->data;
- if(data->text==text) BPY_pyconstraint_update(ob, con);
+ if (data->text == text) BPY_pyconstraint_update(ob, con);
update = 1;
}
}
- if(update) {
+ if (update) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
}
@@ -683,13 +690,13 @@ static int text_refresh_pyconstraints_exec(bContext *UNUSED(C), wmOperator *UNUS
void TEXT_OT_refresh_pyconstraints(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Refresh PyConstraints";
- ot->idname= "TEXT_OT_refresh_pyconstraints";
- ot->description= "Refresh all pyconstraints";
+ ot->name = "Refresh PyConstraints";
+ ot->idname = "TEXT_OT_refresh_pyconstraints";
+ ot->description = "Refresh all pyconstraints";
/* api callbacks */
- ot->exec= text_refresh_pyconstraints_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_refresh_pyconstraints_exec;
+ ot->poll = text_edit_poll;
}
/******************* paste operator *********************/
@@ -697,80 +704,80 @@ void TEXT_OT_refresh_pyconstraints(wmOperatorType *ot)
static char *txt_copy_selected(Text *text)
{
TextLine *tmp, *linef, *linel;
- char *buf= NULL;
- int charf, charl, length= 0;
+ char *buf = NULL;
+ int charf, charl, length = 0;
- if(!text) return NULL;
- if(!text->curl) return NULL;
- if(!text->sell) return NULL;
+ if (!text) return NULL;
+ if (!text->curl) return NULL;
+ if (!text->sell) return NULL;
- if(!txt_has_sel(text)) return NULL;
+ if (!txt_has_sel(text)) return NULL;
- if(text->curl==text->sell) {
- linef= linel= text->curl;
+ if (text->curl == text->sell) {
+ linef = linel = text->curl;
- if(text->curc < text->selc) {
- charf= text->curc;
- charl= text->selc;
+ if (text->curc < text->selc) {
+ charf = text->curc;
+ charl = text->selc;
}
- else{
- charf= text->selc;
- charl= text->curc;
+ else {
+ charf = text->selc;
+ charl = text->curc;
}
}
- else if(txt_get_span(text->curl, text->sell)<0) {
- linef= text->sell;
- linel= text->curl;
+ else if (txt_get_span(text->curl, text->sell) < 0) {
+ linef = text->sell;
+ linel = text->curl;
- charf= text->selc;
- charl= text->curc;
+ charf = text->selc;
+ charl = text->curc;
}
else {
- linef= text->curl;
- linel= text->sell;
+ linef = text->curl;
+ linel = text->sell;
- charf= text->curc;
- charl= text->selc;
+ charf = text->curc;
+ charl = text->selc;
}
- if(linef == linel) {
- length= charl-charf;
+ if (linef == linel) {
+ length = charl - charf;
- buf= MEM_callocN(length+1, "cut buffera");
+ buf = MEM_callocN(length + 1, "cut buffera");
- BLI_strncpy(buf, linef->line + charf, length+1);
+ BLI_strncpy(buf, linef->line + charf, length + 1);
}
else {
- length+= linef->len - charf;
- length+= charl;
+ length += linef->len - charf;
+ length += charl;
length++; /* For the '\n' */
- tmp= linef->next;
- while(tmp && tmp!= linel) {
- length+= tmp->len+1;
- tmp= tmp->next;
+ tmp = linef->next;
+ while (tmp && tmp != linel) {
+ length += tmp->len + 1;
+ tmp = tmp->next;
}
- buf= MEM_callocN(length+1, "cut bufferb");
+ buf = MEM_callocN(length + 1, "cut bufferb");
- strncpy(buf, linef->line+ charf, linef->len-charf);
- length= linef->len-charf;
+ strncpy(buf, linef->line + charf, linef->len - charf);
+ length = linef->len - charf;
- buf[length++]='\n';
+ buf[length++] = '\n';
- tmp= linef->next;
- while(tmp && tmp!=linel) {
- strncpy(buf+length, tmp->line, tmp->len);
- length+= tmp->len;
+ tmp = linef->next;
+ while (tmp && tmp != linel) {
+ strncpy(buf + length, tmp->line, tmp->len);
+ length += tmp->len;
- buf[length++]='\n';
+ buf[length++] = '\n';
- tmp= tmp->next;
+ tmp = tmp->next;
}
- strncpy(buf+length, linel->line, charl);
- length+= charl;
+ strncpy(buf + length, linel->line, charl);
+ length += charl;
- buf[length]=0;
+ buf[length] = 0;
}
return buf;
@@ -778,13 +785,13 @@ static char *txt_copy_selected(Text *text)
static int text_paste_exec(bContext *C, wmOperator *op)
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
char *buf;
- int selection= RNA_boolean_get(op->ptr, "selection");
+ int selection = RNA_boolean_get(op->ptr, "selection");
- buf= WM_clipboard_text_get(selection);
+ buf = WM_clipboard_text_get(selection);
- if(!buf)
+ if (!buf)
return OPERATOR_CANCELLED;
text_drawcache_tag_update(CTX_wm_space_text(C), 0);
@@ -795,10 +802,10 @@ static int text_paste_exec(bContext *C, wmOperator *op)
MEM_freeN(buf);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
/* run the script while editing, evil but useful */
- if(CTX_wm_space_text(C)->live_edit)
+ if (CTX_wm_space_text(C)->live_edit)
text_run_script(C, NULL);
return OPERATOR_FINISHED;
@@ -807,13 +814,13 @@ static int text_paste_exec(bContext *C, wmOperator *op)
void TEXT_OT_paste(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Paste";
- ot->idname= "TEXT_OT_paste";
- ot->description= "Paste text from clipboard";
+ ot->name = "Paste";
+ ot->idname = "TEXT_OT_paste";
+ ot->description = "Paste text from clipboard";
/* api callbacks */
- ot->exec= text_paste_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_paste_exec;
+ ot->poll = text_edit_poll;
/* properties */
RNA_def_boolean(ot->srna, "selection", 0, "Selection", "Paste text selected elsewhere rather than copied (X11 only)");
@@ -825,9 +832,9 @@ static void txt_copy_clipboard(Text *text)
{
char *buf;
- buf= txt_copy_selected(text);
+ buf = txt_copy_selected(text);
- if(buf) {
+ if (buf) {
WM_clipboard_text_set(buf, 0);
MEM_freeN(buf);
}
@@ -835,7 +842,7 @@ static void txt_copy_clipboard(Text *text)
static int text_copy_exec(bContext *C, wmOperator *UNUSED(op))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
txt_copy_clipboard(text);
@@ -845,20 +852,20 @@ static int text_copy_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_copy(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Copy";
- ot->idname= "TEXT_OT_copy";
- ot->description= "Copy selected text to clipboard";
+ ot->name = "Copy";
+ ot->idname = "TEXT_OT_copy";
+ ot->description = "Copy selected text to clipboard";
/* api callbacks */
- ot->exec= text_copy_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_copy_exec;
+ ot->poll = text_edit_poll;
}
/******************* cut operator *********************/
static int text_cut_exec(bContext *C, wmOperator *UNUSED(op))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
text_drawcache_tag_update(CTX_wm_space_text(C), 0);
@@ -866,10 +873,10 @@ static int text_cut_exec(bContext *C, wmOperator *UNUSED(op))
txt_delete_selected(text);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
/* run the script while editing, evil but useful */
- if(CTX_wm_space_text(C)->live_edit)
+ if (CTX_wm_space_text(C)->live_edit)
text_run_script(C, NULL);
return OPERATOR_FINISHED;
@@ -878,24 +885,24 @@ static int text_cut_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_cut(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Cut";
- ot->idname= "TEXT_OT_cut";
- ot->description= "Cut selected text to clipboard";
+ ot->name = "Cut";
+ ot->idname = "TEXT_OT_cut";
+ ot->description = "Cut selected text to clipboard";
/* api callbacks */
- ot->exec= text_cut_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_cut_exec;
+ ot->poll = text_edit_poll;
}
/******************* indent operator *********************/
static int text_indent_exec(bContext *C, wmOperator *UNUSED(op))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
text_drawcache_tag_update(CTX_wm_space_text(C), 0);
- if(txt_has_sel(text)) {
+ if (txt_has_sel(text)) {
txt_order_cursors(text);
txt_indent(text);
}
@@ -905,7 +912,7 @@ static int text_indent_exec(bContext *C, wmOperator *UNUSED(op))
text_update_edited(text);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -913,22 +920,22 @@ static int text_indent_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_indent(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Indent";
- ot->idname= "TEXT_OT_indent";
- ot->description= "Indent selected text";
+ ot->name = "Indent";
+ ot->idname = "TEXT_OT_indent";
+ ot->description = "Indent selected text";
/* api callbacks */
- ot->exec= text_indent_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_indent_exec;
+ ot->poll = text_edit_poll;
}
/******************* unindent operator *********************/
static int text_unindent_exec(bContext *C, wmOperator *UNUSED(op))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
- if(txt_has_sel(text)) {
+ if (txt_has_sel(text)) {
text_drawcache_tag_update(CTX_wm_space_text(C), 0);
txt_order_cursors(text);
@@ -937,7 +944,7 @@ static int text_unindent_exec(bContext *C, wmOperator *UNUSED(op))
text_update_edited(text);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -948,46 +955,47 @@ static int text_unindent_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_unindent(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Unindent";
- ot->idname= "TEXT_OT_unindent";
- ot->description= "Unindent selected text";
+ ot->name = "Unindent";
+ ot->idname = "TEXT_OT_unindent";
+ ot->description = "Unindent selected text";
/* api callbacks */
- ot->exec= text_unindent_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_unindent_exec;
+ ot->poll = text_edit_poll;
}
/******************* line break operator *********************/
static int text_line_break_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceText *st= CTX_wm_space_text(C);
- Text *text= CTX_data_edit_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
+ Text *text = CTX_data_edit_text(C);
int a, curts;
int space = (text->flags & TXT_TABSTOSPACES) ? st->tabnumber : 1;
text_drawcache_tag_update(st, 0);
// double check tabs/spaces before splitting the line
- curts= setcurr_tab_spaces(text, space);
+ curts = setcurr_tab_spaces(text, space);
txt_split_curline(text);
- for(a=0; a < curts; a++) {
+ for (a = 0; a < curts; a++) {
if (text->flags & TXT_TABSTOSPACES) {
txt_add_char(text, ' ');
- } else {
+ }
+ else {
txt_add_char(text, '\t');
}
}
- if(text->curl) {
- if(text->curl->prev)
+ if (text->curl) {
+ if (text->curl->prev)
text_update_line_edited(text->curl->prev);
text_update_line_edited(text->curl);
}
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_CANCELLED;
}
@@ -995,22 +1003,22 @@ static int text_line_break_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_line_break(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Line Break";
- ot->idname= "TEXT_OT_line_break";
- ot->description= "Insert line break at cursor position";
+ ot->name = "Line Break";
+ ot->idname = "TEXT_OT_line_break";
+ ot->description = "Insert line break at cursor position";
/* api callbacks */
- ot->exec= text_line_break_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_line_break_exec;
+ ot->poll = text_edit_poll;
}
/******************* comment operator *********************/
static int text_comment_exec(bContext *C, wmOperator *UNUSED(op))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
- if(txt_has_sel(text)) {
+ if (txt_has_sel(text)) {
text_drawcache_tag_update(CTX_wm_space_text(C), 0);
txt_order_cursors(text);
@@ -1018,7 +1026,7 @@ static int text_comment_exec(bContext *C, wmOperator *UNUSED(op))
text_update_edited(text);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -1028,22 +1036,22 @@ static int text_comment_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_comment(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Comment";
- ot->idname= "TEXT_OT_comment";
- ot->description= "Convert selected text to comment";
+ ot->name = "Comment";
+ ot->idname = "TEXT_OT_comment";
+ ot->description = "Convert selected text to comment";
/* api callbacks */
- ot->exec= text_comment_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_comment_exec;
+ ot->poll = text_edit_poll;
}
/******************* uncomment operator *********************/
static int text_uncomment_exec(bContext *C, wmOperator *UNUSED(op))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
- if(txt_has_sel(text)) {
+ if (txt_has_sel(text)) {
text_drawcache_tag_update(CTX_wm_space_text(C), 0);
txt_order_cursors(text);
@@ -1051,7 +1059,7 @@ static int text_uncomment_exec(bContext *C, wmOperator *UNUSED(op))
text_update_edited(text);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -1062,56 +1070,56 @@ static int text_uncomment_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_uncomment(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Uncomment";
- ot->idname= "TEXT_OT_uncomment";
- ot->description= "Convert selected comment to text";
+ ot->name = "Uncomment";
+ ot->idname = "TEXT_OT_uncomment";
+ ot->description = "Convert selected comment to text";
/* api callbacks */
- ot->exec= text_uncomment_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_uncomment_exec;
+ ot->poll = text_edit_poll;
}
/******************* convert whitespace operator *********************/
enum { TO_SPACES, TO_TABS };
-static EnumPropertyItem whitespace_type_items[]= {
+static EnumPropertyItem whitespace_type_items[] = {
{TO_SPACES, "SPACES", 0, "To Spaces", NULL},
{TO_TABS, "TABS", 0, "To Tabs", NULL},
{0, NULL, 0, NULL, NULL}};
static int text_convert_whitespace_exec(bContext *C, wmOperator *op)
{
- SpaceText *st= CTX_wm_space_text(C);
- Text *text= CTX_data_edit_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
+ Text *text = CTX_data_edit_text(C);
TextLine *tmp;
FlattenString fs;
size_t a, j;
char *text_check_line, *new_line;
int extra, number; //unknown for now
- int type= RNA_enum_get(op->ptr, "type");
+ int type = RNA_enum_get(op->ptr, "type");
tmp = text->lines.first;
//first convert to all space, this make it a lot easier to convert to tabs because there is no mixtures of ' ' && '\t'
- while(tmp) {
+ while (tmp) {
text_check_line = tmp->line;
- number = flatten_string(st, &fs, text_check_line)+1;
+ number = flatten_string(st, &fs, text_check_line) + 1;
flatten_string_free(&fs);
new_line = MEM_callocN(number, "Converted_Line");
j = 0;
- for(a=0; a < strlen(text_check_line); a++) { //foreach char in line
- if(text_check_line[a] == '\t') { //checking for tabs
+ for (a = 0; a < strlen(text_check_line); a++) { //foreach char in line
+ if (text_check_line[a] == '\t') { //checking for tabs
//get the number of spaces this tabs is showing
- //i dont like doing it this way but will look into it later
+ //i don't like doing it this way but will look into it later
new_line[j] = '\0';
number = flatten_string(st, &fs, new_line);
flatten_string_free(&fs);
new_line[j] = '\t';
- new_line[j+1] = '\0';
- number = flatten_string(st, &fs, new_line)-number;
+ new_line[j + 1] = '\0';
+ number = flatten_string(st, &fs, new_line) - number;
flatten_string_free(&fs);
- for(extra = 0; extra < number; extra++) {
+ for (extra = 0; extra < number; extra++) {
new_line[j] = ' ';
j++;
}
@@ -1123,8 +1131,8 @@ static int text_convert_whitespace_exec(bContext *C, wmOperator *op)
}
new_line[j] = '\0';
// put new_line in the tmp->line spot still need to try and set the curc correctly
- if(tmp->line) MEM_freeN(tmp->line);
- if(tmp->format) MEM_freeN(tmp->format);
+ if (tmp->line) MEM_freeN(tmp->line);
+ if (tmp->format) MEM_freeN(tmp->format);
tmp->line = new_line;
tmp->len = strlen(new_line);
@@ -1132,44 +1140,44 @@ static int text_convert_whitespace_exec(bContext *C, wmOperator *op)
tmp = tmp->next;
}
- if(type == TO_TABS) // Converting to tabs
- { //start over from the begining
+ if (type == TO_TABS) { // Converting to tabs
+ //start over from the beginning
tmp = text->lines.first;
- while(tmp) {
+ while (tmp) {
text_check_line = tmp->line;
extra = 0;
- for(a = 0; a < strlen(text_check_line); a++) {
+ for (a = 0; a < strlen(text_check_line); a++) {
number = 0;
- for(j = 0; j < (size_t)st->tabnumber; j++) {
- if((a+j) <= strlen(text_check_line)) { //check to make sure we are not pass the end of the line
- if(text_check_line[a+j] != ' ') {
+ for (j = 0; j < (size_t)st->tabnumber; j++) {
+ if ((a + j) <= strlen(text_check_line)) { //check to make sure we are not pass the end of the line
+ if (text_check_line[a + j] != ' ') {
number = 1;
}
}
}
- if(!number) { //found all number of space to equal a tab
- a = a+(st->tabnumber-1);
- extra = extra+1;
+ if (!number) { //found all number of space to equal a tab
+ a = a + (st->tabnumber - 1);
+ extra = extra + 1;
}
}
- if( extra > 0 ) { //got tabs make malloc and do what you have to do
- new_line = MEM_callocN(strlen(text_check_line)-(((st->tabnumber*extra)-extra)-1), "Converted_Line");
+ if (extra > 0) { //got tabs make malloc and do what you have to do
+ new_line = MEM_callocN(strlen(text_check_line) - (((st->tabnumber * extra) - extra) - 1), "Converted_Line");
extra = 0; //reuse vars
- for(a = 0; a < strlen(text_check_line); a++) {
+ for (a = 0; a < strlen(text_check_line); a++) {
number = 0;
- for(j = 0; j < (size_t)st->tabnumber; j++) {
- if((a+j) <= strlen(text_check_line)) { //check to make sure we are not pass the end of the line
- if(text_check_line[a+j] != ' ') {
+ for (j = 0; j < (size_t)st->tabnumber; j++) {
+ if ((a + j) <= strlen(text_check_line)) { //check to make sure we are not pass the end of the line
+ if (text_check_line[a + j] != ' ') {
number = 1;
}
}
}
- if(!number) { //found all number of space to equal a tab
+ if (!number) { //found all number of space to equal a tab
new_line[extra] = '\t';
- a = a+(st->tabnumber-1);
+ a = a + (st->tabnumber - 1);
++extra;
}
@@ -1180,8 +1188,8 @@ static int text_convert_whitespace_exec(bContext *C, wmOperator *op)
}
new_line[extra] = '\0';
// put new_line in the tmp->line spot still need to try and set the curc correctly
- if(tmp->line) MEM_freeN(tmp->line);
- if(tmp->format) MEM_freeN(tmp->format);
+ if (tmp->line) MEM_freeN(tmp->line);
+ if (tmp->format) MEM_freeN(tmp->format);
tmp->line = new_line;
tmp->len = strlen(new_line);
@@ -1194,7 +1202,7 @@ static int text_convert_whitespace_exec(bContext *C, wmOperator *op)
text_update_edited(text);
text_update_cursor_moved(C);
text_drawcache_tag_update(st, 1);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -1202,13 +1210,13 @@ static int text_convert_whitespace_exec(bContext *C, wmOperator *op)
void TEXT_OT_convert_whitespace(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Convert Whitespace";
- ot->idname= "TEXT_OT_convert_whitespace";
- ot->description= "Convert whitespaces by type";
+ ot->name = "Convert Whitespace";
+ ot->idname = "TEXT_OT_convert_whitespace";
+ ot->description = "Convert whitespaces by type";
/* api callbacks */
- ot->exec= text_convert_whitespace_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_convert_whitespace_exec;
+ ot->poll = text_edit_poll;
/* properties */
RNA_def_enum(ot->srna, "type", whitespace_type_items, TO_SPACES, "Type", "Type of whitespace to convert to");
@@ -1218,12 +1226,12 @@ void TEXT_OT_convert_whitespace(wmOperatorType *ot)
static int text_select_all_exec(bContext *C, wmOperator *UNUSED(op))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
txt_sel_all(text);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -1231,25 +1239,25 @@ static int text_select_all_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select All";
- ot->idname= "TEXT_OT_select_all";
- ot->description= "Select all text";
+ ot->name = "Select All";
+ ot->idname = "TEXT_OT_select_all";
+ ot->description = "Select all text";
/* api callbacks */
- ot->exec= text_select_all_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_select_all_exec;
+ ot->poll = text_edit_poll;
}
/******************* select line operator *********************/
static int text_select_line_exec(bContext *C, wmOperator *UNUSED(op))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
txt_sel_line(text);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -1257,26 +1265,26 @@ static int text_select_line_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_select_line(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Line";
- ot->idname= "TEXT_OT_select_line";
- ot->description= "Select text by line";
+ ot->name = "Select Line";
+ ot->idname = "TEXT_OT_select_line";
+ ot->description = "Select text by line";
/* api callbacks */
- ot->exec= text_select_line_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_select_line_exec;
+ ot->poll = text_edit_poll;
}
/******************* select word operator *********************/
static int text_select_word_exec(bContext *C, wmOperator *UNUSED(op))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
txt_jump_left(text, 0);
txt_jump_right(text, 1);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -1284,35 +1292,35 @@ static int text_select_word_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_select_word(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Word";
- ot->idname= "TEXT_OT_select_word";
- ot->description= "Select word under cursor";
+ ot->name = "Select Word";
+ ot->idname = "TEXT_OT_select_word";
+ ot->description = "Select word under cursor";
/* api callbacks */
- ot->exec= text_select_word_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_select_word_exec;
+ ot->poll = text_edit_poll;
}
/******************* previous marker operator *********************/
static int text_previous_marker_exec(bContext *C, wmOperator *UNUSED(op))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
TextMarker *mrk;
int lineno;
- lineno= txt_get_span(text->lines.first, text->curl);
- mrk= text->markers.last;
- while(mrk && (mrk->lineno>lineno || (mrk->lineno==lineno && mrk->end > text->curc)))
- mrk= mrk->prev;
- if(!mrk) mrk= text->markers.last;
- if(mrk) {
+ lineno = txt_get_span(text->lines.first, text->curl);
+ mrk = text->markers.last;
+ while (mrk && (mrk->lineno > lineno || (mrk->lineno == lineno && mrk->end > text->curc)))
+ mrk = mrk->prev;
+ if (!mrk) mrk = text->markers.last;
+ if (mrk) {
txt_move_to(text, mrk->lineno, mrk->start, 0);
txt_move_to(text, mrk->lineno, mrk->end, 1);
}
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -1320,35 +1328,35 @@ static int text_previous_marker_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_previous_marker(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Previous Marker";
- ot->idname= "TEXT_OT_previous_marker";
- ot->description= "Move to previous marker";
+ ot->name = "Previous Marker";
+ ot->idname = "TEXT_OT_previous_marker";
+ ot->description = "Move to previous marker";
/* api callbacks */
- ot->exec= text_previous_marker_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_previous_marker_exec;
+ ot->poll = text_edit_poll;
}
/******************* next marker operator *********************/
static int text_next_marker_exec(bContext *C, wmOperator *UNUSED(op))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
TextMarker *mrk;
int lineno;
- lineno= txt_get_span(text->lines.first, text->curl);
- mrk= text->markers.first;
- while(mrk && (mrk->lineno<lineno || (mrk->lineno==lineno && mrk->start <= text->curc)))
- mrk= mrk->next;
- if(!mrk) mrk= text->markers.first;
- if(mrk) {
+ lineno = txt_get_span(text->lines.first, text->curl);
+ mrk = text->markers.first;
+ while (mrk && (mrk->lineno < lineno || (mrk->lineno == lineno && mrk->start <= text->curc)))
+ mrk = mrk->next;
+ if (!mrk) mrk = text->markers.first;
+ if (mrk) {
txt_move_to(text, mrk->lineno, mrk->start, 0);
txt_move_to(text, mrk->lineno, mrk->end, 1);
}
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -1356,25 +1364,25 @@ static int text_next_marker_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_next_marker(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Next Marker";
- ot->idname= "TEXT_OT_next_marker";
- ot->description= "Move to next marker";
+ ot->name = "Next Marker";
+ ot->idname = "TEXT_OT_next_marker";
+ ot->description = "Move to next marker";
/* api callbacks */
- ot->exec= text_next_marker_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_next_marker_exec;
+ ot->poll = text_edit_poll;
}
/******************* clear all markers operator *********************/
static int text_clear_all_markers_exec(bContext *C, wmOperator *UNUSED(op))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
txt_clear_markers(text, 0, 0);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -1382,18 +1390,18 @@ static int text_clear_all_markers_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_markers_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clear All Markers";
- ot->idname= "TEXT_OT_markers_clear";
- ot->description= "Clear all markers";
+ ot->name = "Clear All Markers";
+ ot->idname = "TEXT_OT_markers_clear";
+ ot->description = "Clear all markers";
/* api callbacks */
- ot->exec= text_clear_all_markers_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_clear_all_markers_exec;
+ ot->poll = text_edit_poll;
}
/************************ move operator ************************/
-static EnumPropertyItem move_type_items[]= {
+static EnumPropertyItem move_type_items[] = {
{LINE_BEGIN, "LINE_BEGIN", 0, "Line Begin", ""},
{LINE_END, "LINE_END", 0, "Line End", ""},
{FILE_TOP, "FILE_TOP", 0, "File Top", ""},
@@ -1409,78 +1417,78 @@ static EnumPropertyItem move_type_items[]= {
{0, NULL, 0, NULL, NULL}};
/* get cursor position in line by relative wrapped line and column positions */
-static int text_get_cursor_rel(SpaceText* st, ARegion *ar, TextLine *linein, int rell, int relc)
+static int text_get_cursor_rel(SpaceText *st, ARegion *ar, TextLine *linein, int rell, int relc)
{
int i, j, start, end, max, chop, curs, loop, endj, found, selc;
char ch;
- max= wrap_width(st, ar);
+ max = wrap_width(st, ar);
- selc= start= endj= curs= found= 0;
- end= max;
- chop= loop= 1;
+ selc = start = endj = curs = found = 0;
+ end = max;
+ chop = loop = 1;
- for(i=0, j=0; loop; j+=BLI_str_utf8_size(linein->line+j)) {
+ for (i = 0, j = 0; loop; j += BLI_str_utf8_size(linein->line + j)) {
int chars;
/* Mimic replacement of tabs */
- ch= linein->line[j];
- if(ch=='\t') {
- chars= st->tabnumber-i%st->tabnumber;
- ch= ' ';
+ ch = linein->line[j];
+ if (ch == '\t') {
+ chars = st->tabnumber - i % st->tabnumber;
+ ch = ' ';
}
- else chars= 1;
+ else chars = 1;
- while(chars--) {
- if(rell==0 && i-start==relc) {
+ while (chars--) {
+ if (rell == 0 && i - start == relc) {
/* current position could be wrapped to next line */
/* this should be checked when end of current line would be reached */
- selc= j;
- found= 1;
+ selc = j;
+ found = 1;
}
- else if(i-end==relc) {
- curs= j;
+ else if (i - end == relc) {
+ curs = j;
}
- if(i-start>=max) {
- if(found) {
+ if (i - start >= max) {
+ if (found) {
/* exact cursor position was found, check if it's */
/* still on needed line (hasn't been wrapped) */
- if(selc>endj && !chop) selc= endj;
- loop= 0;
+ if (selc > endj && !chop) selc = endj;
+ loop = 0;
break;
}
- if(chop) endj= j;
+ if (chop) endj = j;
- start= end;
+ start = end;
end += max;
- chop= 1;
+ chop = 1;
rell--;
- if(rell==0 && i-start>=relc) {
- selc= curs;
- loop= 0;
+ if (rell == 0 && i - start >= relc) {
+ selc = curs;
+ loop = 0;
break;
}
}
- else if (ch=='\0') {
- if(!found) selc= linein->len;
- loop= 0;
+ else if (ch == '\0') {
+ if (!found) selc = linein->len;
+ loop = 0;
break;
}
- else if(ch==' ' || ch=='-') {
- if(found) {
- loop= 0;
+ else if (ch == ' ' || ch == '-') {
+ if (found) {
+ loop = 0;
break;
}
- if(rell==0 && i-start>=relc) {
- selc= curs;
- loop= 0;
+ if (rell == 0 && i - start >= relc) {
+ selc = curs;
+ loop = 0;
break;
}
- end= i+1;
- endj= j;
- chop= 0;
+ end = i + 1;
+ endj = j;
+ chop = 0;
}
i++;
}
@@ -1489,83 +1497,87 @@ static int text_get_cursor_rel(SpaceText* st, ARegion *ar, TextLine *linein, int
return selc;
}
-static int cursor_skip_find_line(SpaceText* st, ARegion *ar,
- int lines, TextLine **linep, int *charp, int *rell, int *relc)
+static int cursor_skip_find_line(SpaceText *st, ARegion *ar,
+ int lines, TextLine **linep, int *charp, int *rell, int *relc)
{
int offl, offc, visible_lines;
wrap_offset_in_line(st, ar, *linep, *charp, &offl, &offc);
- *relc= text_get_char_pos(st, (*linep)->line, *charp) + offc;
- *rell= lines;
+ *relc = text_get_char_pos(st, (*linep)->line, *charp) + offc;
+ *rell = lines;
/* handle current line */
- if(lines>0) {
- visible_lines= text_get_visible_lines(st, ar, (*linep)->line);
+ if (lines > 0) {
+ visible_lines = text_get_visible_lines(st, ar, (*linep)->line);
- if(*rell-visible_lines+offl>=0) {
- if(!(*linep)->next) {
- if(offl < visible_lines-1) {
- *rell= visible_lines-1;
+ if (*rell - visible_lines + offl >= 0) {
+ if (!(*linep)->next) {
+ if (offl < visible_lines - 1) {
+ *rell = visible_lines - 1;
return 1;
}
- *charp= (*linep)->len;
+ *charp = (*linep)->len;
return 0;
}
- *rell-= visible_lines-offl;
- *linep=(*linep)->next;
- } else {
- *rell+= offl;
+ *rell -= visible_lines - offl;
+ *linep = (*linep)->next;
+ }
+ else {
+ *rell += offl;
return 1;
}
- } else {
- if(*rell+offl<=0) {
- if(!(*linep)->prev) {
- if(offl) {
- *rell= 0;
+ }
+ else {
+ if (*rell + offl <= 0) {
+ if (!(*linep)->prev) {
+ if (offl) {
+ *rell = 0;
return 1;
}
- *charp= 0;
+ *charp = 0;
return 0;
}
- *rell+= offl;
- *linep=(*linep)->prev;
- } else {
- *rell+= offl;
+ *rell += offl;
+ *linep = (*linep)->prev;
+ }
+ else {
+ *rell += offl;
return 1;
}
}
/* skip lines and find destination line and offsets */
- while(*linep) {
- visible_lines= text_get_visible_lines(st, ar, (*linep)->line);
+ while (*linep) {
+ visible_lines = text_get_visible_lines(st, ar, (*linep)->line);
- if(lines<0) { /* moving top */
- if(*rell+visible_lines >= 0) {
- *rell+= visible_lines;
+ if (lines < 0) { /* moving top */
+ if (*rell + visible_lines >= 0) {
+ *rell += visible_lines;
break;
}
- if(!(*linep)->prev) {
- *rell= 0;
+ if (!(*linep)->prev) {
+ *rell = 0;
break;
}
- *rell+= visible_lines;
- *linep=(*linep)->prev;
- } else { /* moving bottom */
- if(*rell-visible_lines < 0) break;
+ *rell += visible_lines;
+ *linep = (*linep)->prev;
+ }
+ else { /* moving bottom */
+ if (*rell - visible_lines < 0) break;
- if(!(*linep)->next) {
- *rell= visible_lines-1;
+ if (!(*linep)->next) {
+ *rell = visible_lines - 1;
break;
}
- *rell-= visible_lines;
- *linep=(*linep)->next;
+ *rell -= visible_lines;
+ *linep = (*linep)->next;
}
}
@@ -1574,7 +1586,7 @@ static int cursor_skip_find_line(SpaceText* st, ARegion *ar,
static void txt_wrap_move_bol(SpaceText *st, ARegion *ar, short sel)
{
- Text *text= st->text;
+ Text *text = st->text;
TextLine **linep;
int *charp;
int oldl, oldc, i, j, max, start, end, endj, chop, loop;
@@ -1582,67 +1594,67 @@ static void txt_wrap_move_bol(SpaceText *st, ARegion *ar, short sel)
text_update_character_width(st);
- if (sel) linep= &text->sell, charp= &text->selc;
- else linep= &text->curl, charp= &text->curc;
+ if (sel) linep = &text->sell, charp = &text->selc;
+ else linep = &text->curl, charp = &text->curc;
- oldc= *charp;
- oldl= txt_get_span(text->lines.first, *linep);
+ oldc = *charp;
+ oldl = txt_get_span(text->lines.first, *linep);
- max= wrap_width(st, ar);
+ max = wrap_width(st, ar);
- start= endj= 0;
- end= max;
- chop= loop= 1;
- *charp= 0;
+ start = endj = 0;
+ end = max;
+ chop = loop = 1;
+ *charp = 0;
- for(i=0, j=0; loop; j+=BLI_str_utf8_size((*linep)->line+j)) {
+ for (i = 0, j = 0; loop; j += BLI_str_utf8_size((*linep)->line + j)) {
int chars;
/* Mimic replacement of tabs */
- ch= (*linep)->line[j];
- if(ch=='\t') {
- chars= st->tabnumber-i%st->tabnumber;
- ch= ' ';
+ ch = (*linep)->line[j];
+ if (ch == '\t') {
+ chars = st->tabnumber - i % st->tabnumber;
+ ch = ' ';
}
- else chars= 1;
+ else chars = 1;
- while(chars--) {
- if(i-start>=max) {
- *charp= endj;
+ while (chars--) {
+ if (i - start >= max) {
+ *charp = endj;
- if(j>=oldc) {
- if(ch=='\0') *charp= txt_utf8_index_to_offset((*linep)->line, start);
- loop= 0;
+ if (j >= oldc) {
+ if (ch == '\0') *charp = txt_utf8_index_to_offset((*linep)->line, start);
+ loop = 0;
break;
}
- if(chop) endj= j;
+ if (chop) endj = j;
- start= end;
+ start = end;
end += max;
- chop= 1;
+ chop = 1;
}
- else if(ch==' ' || ch=='-' || ch=='\0') {
- if(j>=oldc) {
- *charp= txt_utf8_index_to_offset((*linep)->line, start);
- loop= 0;
+ else if (ch == ' ' || ch == '-' || ch == '\0') {
+ if (j >= oldc) {
+ *charp = txt_utf8_index_to_offset((*linep)->line, start);
+ loop = 0;
break;
}
- end= i+1;
- endj= j+1;
- chop= 0;
+ end = i + 1;
+ endj = j + 1;
+ chop = 0;
}
i++;
}
}
if (!sel) txt_pop_sel(text);
- txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, oldl, oldc, oldl, *charp);
+ txt_undo_add_toop(text, sel ? UNDO_STO : UNDO_CTO, oldl, oldc, oldl, *charp);
}
static void txt_wrap_move_eol(SpaceText *st, ARegion *ar, short sel)
{
- Text *text= st->text;
+ Text *text = st->text;
TextLine **linep;
int *charp;
int oldl, oldc, i, j, max, start, end, endj, chop, loop;
@@ -1650,187 +1662,194 @@ static void txt_wrap_move_eol(SpaceText *st, ARegion *ar, short sel)
text_update_character_width(st);
- if (sel) linep= &text->sell, charp= &text->selc;
- else linep= &text->curl, charp= &text->curc;
+ if (sel) linep = &text->sell, charp = &text->selc;
+ else linep = &text->curl, charp = &text->curc;
- oldc= *charp;
- oldl= txt_get_span(text->lines.first, *linep);
+ oldc = *charp;
+ oldl = txt_get_span(text->lines.first, *linep);
- max= wrap_width(st, ar);
+ max = wrap_width(st, ar);
- start= endj= 0;
- end= max;
- chop= loop= 1;
- *charp= 0;
+ start = endj = 0;
+ end = max;
+ chop = loop = 1;
+ *charp = 0;
- for(i=0, j=0; loop; j+=BLI_str_utf8_size((*linep)->line+j)) {
+ for (i = 0, j = 0; loop; j += BLI_str_utf8_size((*linep)->line + j)) {
int chars;
/* Mimic replacement of tabs */
- ch= (*linep)->line[j];
- if(ch=='\t') {
- chars= st->tabnumber-i%st->tabnumber;
- ch= ' ';
+ ch = (*linep)->line[j];
+ if (ch == '\t') {
+ chars = st->tabnumber - i % st->tabnumber;
+ ch = ' ';
}
- else chars= 1;
+ else chars = 1;
- while(chars--) {
- if(i-start>=max) {
- if(chop) endj= BLI_str_prev_char_utf8((*linep)->line+j)-(*linep)->line;
+ while (chars--) {
+ if (i - start >= max) {
+ if (chop) endj = BLI_str_prev_char_utf8((*linep)->line + j) - (*linep)->line;
- if(endj>=oldc) {
- if(ch=='\0') *charp= (*linep)->len;
- else *charp= endj;
- loop= 0;
+ if (endj >= oldc) {
+ if (ch == '\0') *charp = (*linep)->len;
+ else *charp = endj;
+ loop = 0;
break;
}
- start= end;
+ start = end;
end += max;
- chop= 1;
- } else if(ch=='\0') {
- *charp= (*linep)->len;
- loop= 0;
+ chop = 1;
+ }
+ else if (ch == '\0') {
+ *charp = (*linep)->len;
+ loop = 0;
break;
- } else if(ch==' ' || ch=='-') {
- end= i+1;
- endj= j;
- chop= 0;
+ }
+ else if (ch == ' ' || ch == '-') {
+ end = i + 1;
+ endj = j;
+ chop = 0;
}
i++;
}
}
if (!sel) txt_pop_sel(text);
- txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, oldl, oldc, oldl, *charp);
+ txt_undo_add_toop(text, sel ? UNDO_STO : UNDO_CTO, oldl, oldc, oldl, *charp);
}
static void txt_wrap_move_up(SpaceText *st, ARegion *ar, short sel)
{
- Text *text= st->text;
+ Text *text = st->text;
TextLine **linep;
int *charp;
int oldl, oldc, offl, offc, col, newl;
text_update_character_width(st);
- if (sel) linep= &text->sell, charp= &text->selc;
- else linep= &text->curl, charp= &text->curc;
+ if (sel) linep = &text->sell, charp = &text->selc;
+ else linep = &text->curl, charp = &text->curc;
/* store previous position */
- oldc= *charp;
- newl= oldl= txt_get_span(text->lines.first, *linep);
+ oldc = *charp;
+ newl = oldl = txt_get_span(text->lines.first, *linep);
wrap_offset_in_line(st, ar, *linep, *charp, &offl, &offc);
- col= text_get_char_pos(st, (*linep)->line, *charp) + offc;
- if(offl) {
- *charp= text_get_cursor_rel(st, ar, *linep, offl-1, col);
- newl= BLI_findindex(&text->lines, linep);
- } else {
- if((*linep)->prev) {
+ col = text_get_char_pos(st, (*linep)->line, *charp) + offc;
+ if (offl) {
+ *charp = text_get_cursor_rel(st, ar, *linep, offl - 1, col);
+ newl = BLI_findindex(&text->lines, linep);
+ }
+ else {
+ if ((*linep)->prev) {
int visible_lines;
- *linep= (*linep)->prev;
- visible_lines= text_get_visible_lines(st, ar, (*linep)->line);
- *charp= text_get_cursor_rel(st, ar, *linep, visible_lines-1, col);
+ *linep = (*linep)->prev;
+ visible_lines = text_get_visible_lines(st, ar, (*linep)->line);
+ *charp = text_get_cursor_rel(st, ar, *linep, visible_lines - 1, col);
newl--;
- } else *charp= 0;
+ }
+ else *charp = 0;
}
if (!sel) txt_pop_sel(text);
- txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, oldl, oldc, newl, *charp);
+ txt_undo_add_toop(text, sel ? UNDO_STO : UNDO_CTO, oldl, oldc, newl, *charp);
}
static void txt_wrap_move_down(SpaceText *st, ARegion *ar, short sel)
{
- Text *text= st->text;
+ Text *text = st->text;
TextLine **linep;
int *charp;
int oldl, oldc, offl, offc, col, newl, visible_lines;
text_update_character_width(st);
- if (sel) linep= &text->sell, charp= &text->selc;
- else linep= &text->curl, charp= &text->curc;
+ if (sel) linep = &text->sell, charp = &text->selc;
+ else linep = &text->curl, charp = &text->curc;
/* store previous position */
- oldc= *charp;
- newl= oldl= txt_get_span(text->lines.first, *linep);
+ oldc = *charp;
+ newl = oldl = txt_get_span(text->lines.first, *linep);
wrap_offset_in_line(st, ar, *linep, *charp, &offl, &offc);
- col= text_get_char_pos(st, (*linep)->line, *charp) + offc;
- visible_lines= text_get_visible_lines(st, ar, (*linep)->line);
- if(offl<visible_lines-1) {
- *charp= text_get_cursor_rel(st, ar, *linep, offl+1, col);
- newl= BLI_findindex(&text->lines, linep);
- } else {
- if((*linep)->next) {
- *linep= (*linep)->next;
- *charp= text_get_cursor_rel(st, ar, *linep, 0, col);
+ col = text_get_char_pos(st, (*linep)->line, *charp) + offc;
+ visible_lines = text_get_visible_lines(st, ar, (*linep)->line);
+ if (offl < visible_lines - 1) {
+ *charp = text_get_cursor_rel(st, ar, *linep, offl + 1, col);
+ newl = BLI_findindex(&text->lines, linep);
+ }
+ else {
+ if ((*linep)->next) {
+ *linep = (*linep)->next;
+ *charp = text_get_cursor_rel(st, ar, *linep, 0, col);
newl++;
- } else *charp= (*linep)->len;
+ }
+ else *charp = (*linep)->len;
}
if (!sel) txt_pop_sel(text);
- txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, oldl, oldc, newl, *charp);
+ txt_undo_add_toop(text, sel ? UNDO_STO : UNDO_CTO, oldl, oldc, newl, *charp);
}
/* 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)
+static void cursor_skip(SpaceText *st, ARegion *ar, Text *text, int lines, int sel)
{
TextLine **linep;
int oldl, oldc, *charp;
- if (sel) linep= &text->sell, charp= &text->selc;
- else linep= &text->curl, charp= &text->curc;
- oldl= txt_get_span(text->lines.first, *linep);
- oldc= *charp;
+ if (sel) linep = &text->sell, charp = &text->selc;
+ else linep = &text->curl, charp = &text->curc;
+ oldl = txt_get_span(text->lines.first, *linep);
+ oldc = *charp;
- if(st && ar && st->wordwrap) {
+ if (st && ar && st->wordwrap) {
int rell, relc;
/* find line and offsets inside it needed to set cursor position */
- if(cursor_skip_find_line(st, ar, lines, linep, charp, &rell, &relc))
- *charp= text_get_cursor_rel (st, ar, *linep, rell, relc);
- } else {
- while (lines>0 && (*linep)->next) {
- *linep= (*linep)->next;
+ if (cursor_skip_find_line(st, ar, lines, linep, charp, &rell, &relc))
+ *charp = text_get_cursor_rel(st, ar, *linep, rell, relc);
+ }
+ else {
+ while (lines > 0 && (*linep)->next) {
+ *linep = (*linep)->next;
lines--;
}
- while (lines<0 && (*linep)->prev) {
- *linep= (*linep)->prev;
+ while (lines < 0 && (*linep)->prev) {
+ *linep = (*linep)->prev;
lines++;
}
}
- if (*charp > (*linep)->len) *charp= (*linep)->len;
+ if (*charp > (*linep)->len) *charp = (*linep)->len;
if (!sel) txt_pop_sel(text);
- txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, oldl, oldc, txt_get_span(text->lines.first, *linep), *charp);
+ txt_undo_add_toop(text, sel ? UNDO_STO : UNDO_CTO, oldl, oldc, txt_get_span(text->lines.first, *linep), *charp);
}
static int text_move_cursor(bContext *C, int type, int select)
{
- SpaceText *st= CTX_wm_space_text(C);
- Text *text= CTX_data_edit_text(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceText *st = CTX_wm_space_text(C);
+ Text *text = CTX_data_edit_text(C);
+ ARegion *ar = CTX_wm_region(C);
/* ensure we have the right region, it's optional */
- if(ar && ar->regiontype != RGN_TYPE_WINDOW)
- ar= NULL;
+ if (ar && ar->regiontype != RGN_TYPE_WINDOW)
+ ar = NULL;
- switch(type) {
+ switch (type) {
case LINE_BEGIN:
- if(st && st->wordwrap && ar) txt_wrap_move_bol(st, ar, select);
+ if (st && st->wordwrap && ar) txt_wrap_move_bol(st, ar, select);
else txt_move_bol(text, select);
break;
case LINE_END:
- if(st && st->wordwrap && ar) txt_wrap_move_eol(st, ar, select);
+ if (st && st->wordwrap && ar) txt_wrap_move_eol(st, ar, select);
else txt_move_eol(text, select);
break;
@@ -1859,35 +1878,35 @@ static int text_move_cursor(bContext *C, int type, int select)
break;
case PREV_LINE:
- if(st && st->wordwrap && ar) txt_wrap_move_up(st, ar, select);
+ if (st && st->wordwrap && ar) txt_wrap_move_up(st, ar, select);
else txt_move_up(text, select);
break;
case NEXT_LINE:
- if(st && st->wordwrap && ar) txt_wrap_move_down(st, ar, select);
+ if (st && st->wordwrap && ar) txt_wrap_move_down(st, ar, select);
else txt_move_down(text, select);
break;
case PREV_PAGE:
- if(st) cursor_skip(st, ar, st->text, -st->viewlines, select);
+ if (st) cursor_skip(st, ar, st->text, -st->viewlines, select);
else cursor_skip(NULL, NULL, text, -10, select);
break;
case NEXT_PAGE:
- if(st) cursor_skip(st, ar, st->text, st->viewlines, select);
+ if (st) cursor_skip(st, ar, st->text, st->viewlines, select);
else cursor_skip(NULL, NULL, text, 10, select);
break;
}
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text);
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, text);
return OPERATOR_FINISHED;
}
static int text_move_exec(bContext *C, wmOperator *op)
{
- int type= RNA_enum_get(op->ptr, "type");
+ int type = RNA_enum_get(op->ptr, "type");
return text_move_cursor(C, type, 0);
}
@@ -1895,13 +1914,13 @@ static int text_move_exec(bContext *C, wmOperator *op)
void TEXT_OT_move(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move Cursor";
- ot->idname= "TEXT_OT_move";
- ot->description= "Move cursor to position type";
+ ot->name = "Move Cursor";
+ ot->idname = "TEXT_OT_move";
+ ot->description = "Move cursor to position type";
/* api callbacks */
- ot->exec= text_move_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_move_exec;
+ ot->poll = text_edit_poll;
/* properties */
RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to");
@@ -1911,7 +1930,7 @@ void TEXT_OT_move(wmOperatorType *ot)
static int text_move_select_exec(bContext *C, wmOperator *op)
{
- int type= RNA_enum_get(op->ptr, "type");
+ int type = RNA_enum_get(op->ptr, "type");
return text_move_cursor(C, type, 1);
}
@@ -1919,13 +1938,13 @@ static int text_move_select_exec(bContext *C, wmOperator *op)
void TEXT_OT_move_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move Select";
- ot->idname= "TEXT_OT_move_select";
- ot->description= "Make selection from current cursor position to new cursor position type";
+ ot->name = "Move Select";
+ ot->idname = "TEXT_OT_move_select";
+ ot->description = "Make selection from current cursor position to new cursor position type";
/* api callbacks */
- ot->exec= text_move_select_exec;
- ot->poll= text_space_edit_poll;
+ ot->exec = text_move_select_exec;
+ ot->poll = text_space_edit_poll;
/* properties */
RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to, to make a selection");
@@ -1935,40 +1954,40 @@ void TEXT_OT_move_select(wmOperatorType *ot)
static int text_jump_exec(bContext *C, wmOperator *op)
{
- Text *text= CTX_data_edit_text(C);
- int line= RNA_int_get(op->ptr, "line");
- short nlines= txt_get_span(text->lines.first, text->lines.last)+1;
+ Text *text = CTX_data_edit_text(C);
+ int line = RNA_int_get(op->ptr, "line");
+ short nlines = txt_get_span(text->lines.first, text->lines.last) + 1;
- if(line < 1)
+ if (line < 1)
txt_move_toline(text, 1, 0);
- else if(line > nlines)
- txt_move_toline(text, nlines-1, 0);
+ else if (line > nlines)
+ txt_move_toline(text, nlines - 1, 0);
else
- txt_move_toline(text, line-1, 0);
+ txt_move_toline(text, line - 1, 0);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text);
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, text);
return OPERATOR_FINISHED;
}
static int text_jump_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- return WM_operator_props_dialog_popup(C,op,200,100);
+ return WM_operator_props_dialog_popup(C, op, 200, 100);
}
void TEXT_OT_jump(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Jump";
- ot->idname= "TEXT_OT_jump";
- ot->description= "Jump cursor to line";
+ ot->name = "Jump";
+ ot->idname = "TEXT_OT_jump";
+ ot->description = "Jump cursor to line";
/* api callbacks */
- ot->invoke= text_jump_invoke;
- ot->exec= text_jump_exec;
- ot->poll= text_edit_poll;
+ ot->invoke = text_jump_invoke;
+ ot->exec = text_jump_exec;
+ ot->poll = text_edit_poll;
/* properties */
RNA_def_int(ot->srna, "line", 1, 1, INT_MAX, "Line", "Line number to jump to", 1, 10000);
@@ -1976,7 +1995,7 @@ void TEXT_OT_jump(wmOperatorType *ot)
/******************* delete operator **********************/
-static EnumPropertyItem delete_type_items[]= {
+static EnumPropertyItem delete_type_items[] = {
{DEL_NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""},
{DEL_PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""},
{DEL_NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""},
@@ -1985,27 +2004,27 @@ static EnumPropertyItem delete_type_items[]= {
static int text_delete_exec(bContext *C, wmOperator *op)
{
- Text *text= CTX_data_edit_text(C);
- int type= RNA_enum_get(op->ptr, "type");
+ Text *text = CTX_data_edit_text(C);
+ int type = RNA_enum_get(op->ptr, "type");
text_drawcache_tag_update(CTX_wm_space_text(C), 0);
- if(type == DEL_PREV_WORD)
+ if (type == DEL_PREV_WORD)
txt_backspace_word(text);
- else if(type == DEL_PREV_CHAR)
+ else if (type == DEL_PREV_CHAR)
txt_backspace_char(text);
- else if(type == DEL_NEXT_WORD)
+ else if (type == DEL_NEXT_WORD)
txt_delete_word(text);
- else if(type == DEL_NEXT_CHAR)
+ else if (type == DEL_NEXT_CHAR)
txt_delete_char(text);
text_update_line_edited(text->curl);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
/* run the script while editing, evil but useful */
- if(CTX_wm_space_text(C)->live_edit)
+ if (CTX_wm_space_text(C)->live_edit)
text_run_script(C, NULL);
return OPERATOR_FINISHED;
@@ -2014,13 +2033,13 @@ static int text_delete_exec(bContext *C, wmOperator *op)
void TEXT_OT_delete(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Delete";
- ot->idname= "TEXT_OT_delete";
- ot->description= "Delete text by cursor position";
+ ot->name = "Delete";
+ ot->idname = "TEXT_OT_delete";
+ ot->description = "Delete text by cursor position";
/* api callbacks */
- ot->exec= text_delete_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_delete_exec;
+ ot->poll = text_edit_poll;
/* properties */
RNA_def_enum(ot->srna, "type", delete_type_items, DEL_NEXT_CHAR, "Type", "Which part of the text to delete");
@@ -2030,11 +2049,11 @@ void TEXT_OT_delete(wmOperatorType *ot)
static int text_toggle_overwrite_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceText *st= CTX_wm_space_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
- st->overwrite= !st->overwrite;
+ st->overwrite = !st->overwrite;
- WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, st->text);
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, st->text);
return OPERATOR_FINISHED;
}
@@ -2042,13 +2061,13 @@ static int text_toggle_overwrite_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_overwrite_toggle(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Toggle Overwrite";
- ot->idname= "TEXT_OT_overwrite_toggle";
- ot->description= "Toggle overwrite while typing";
+ ot->name = "Toggle Overwrite";
+ ot->idname = "TEXT_OT_overwrite_toggle";
+ ot->description = "Toggle overwrite while typing";
/* api callbacks */
- ot->exec= text_toggle_overwrite_exec;
- ot->poll= text_space_edit_poll;
+ ot->exec = text_toggle_overwrite_exec;
+ ot->poll = text_space_edit_poll;
}
/******************* scroll operator **********************/
@@ -2060,11 +2079,11 @@ static void txt_screen_skip(SpaceText *st, ARegion *ar, int lines)
st->top += lines;
- last= text_get_total_lines(st, ar);
- last= last - (st->viewlines/2);
+ last = text_get_total_lines(st, ar);
+ last = last - (st->viewlines / 2);
- if(st->top>last) st->top= last;
- if(st->top<0) st->top= 0;
+ if (st->top > last) st->top = last;
+ if (st->top < 0) st->top = 0;
}
/* quick enum for tsc->zone (scroller handles) */
@@ -2092,15 +2111,15 @@ static int text_scroll_poll(bContext *C)
static int text_scroll_exec(bContext *C, wmOperator *op)
{
- SpaceText *st= CTX_wm_space_text(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceText *st = CTX_wm_space_text(C);
+ ARegion *ar = CTX_wm_region(C);
- int lines= RNA_int_get(op->ptr, "lines");
+ int lines = RNA_int_get(op->ptr, "lines");
- if(lines == 0)
+ if (lines == 0)
return OPERATOR_CANCELLED;
- txt_screen_skip(st, ar, lines*U.wheellinescroll);
+ txt_screen_skip(st, ar, lines * U.wheellinescroll);
ED_area_tag_redraw(CTX_wm_area(C));
@@ -2109,56 +2128,56 @@ static int text_scroll_exec(bContext *C, wmOperator *op)
static void text_scroll_apply(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceText *st= CTX_wm_space_text(C);
- ARegion *ar= CTX_wm_region(C);
- TextScroll *tsc= op->customdata;
- int mval[2]= {event->x, event->y};
+ SpaceText *st = CTX_wm_space_text(C);
+ ARegion *ar = CTX_wm_region(C);
+ TextScroll *tsc = op->customdata;
+ int mval[2] = {event->x, event->y};
short txtdelta[2] = {0, 0};
text_update_character_width(st);
- if(tsc->first) {
- tsc->old[0]= mval[0];
- tsc->old[1]= mval[1];
- tsc->first= 0;
+ if (tsc->first) {
+ tsc->old[0] = mval[0];
+ tsc->old[1] = mval[1];
+ tsc->first = 0;
}
- tsc->delta[0]+= mval[0] - tsc->old[0];
- tsc->delta[1]+= mval[1] - tsc->old[1];
+ tsc->delta[0] += mval[0] - tsc->old[0];
+ tsc->delta[1] += mval[1] - tsc->old[1];
- if(!tsc->scrollbar) {
- txtdelta[0]= -tsc->delta[0]/st->cwidth;
- txtdelta[1]= tsc->delta[1]/st->lheight;
+ if (!tsc->scrollbar) {
+ txtdelta[0] = -tsc->delta[0] / st->cwidth;
+ txtdelta[1] = tsc->delta[1] / st->lheight;
- tsc->delta[0]%= st->cwidth;
- tsc->delta[1]%= st->lheight;
+ tsc->delta[0] %= st->cwidth;
+ tsc->delta[1] %= st->lheight;
}
else {
- txtdelta[1]= -tsc->delta[1]*st->pix_per_line;
- tsc->delta[1]+= txtdelta[1]/st->pix_per_line;
+ txtdelta[1] = -tsc->delta[1] * st->pix_per_line;
+ tsc->delta[1] += txtdelta[1] / st->pix_per_line;
}
- if(txtdelta[0] || txtdelta[1]) {
+ if (txtdelta[0] || txtdelta[1]) {
txt_screen_skip(st, ar, txtdelta[1]);
- if(st->wordwrap) {
- st->left= 0;
+ if (st->wordwrap) {
+ st->left = 0;
}
else {
- st->left+= txtdelta[0];
- if(st->left<0) st->left= 0;
+ st->left += txtdelta[0];
+ if (st->left < 0) st->left = 0;
}
ED_area_tag_redraw(CTX_wm_area(C));
}
- tsc->old[0]= mval[0];
- tsc->old[1]= mval[1];
+ tsc->old[0] = mval[0];
+ tsc->old[1] = mval[1];
}
static void scroll_exit(bContext *C, wmOperator *op)
{
- SpaceText *st= CTX_wm_space_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
st->flags &= ~ST_SCROLL_SELECT;
MEM_freeN(op->customdata);
@@ -2166,25 +2185,25 @@ static void scroll_exit(bContext *C, wmOperator *op)
static int text_scroll_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- TextScroll *tsc= op->customdata;
- SpaceText *st= CTX_wm_space_text(C);
- ARegion *ar= CTX_wm_region(C);
+ TextScroll *tsc = op->customdata;
+ SpaceText *st = CTX_wm_space_text(C);
+ ARegion *ar = CTX_wm_region(C);
- switch(event->type) {
+ switch (event->type) {
case MOUSEMOVE:
- if(tsc->zone == SCROLLHANDLE_BAR)
+ if (tsc->zone == SCROLLHANDLE_BAR)
text_scroll_apply(C, op, event);
break;
case LEFTMOUSE:
case RIGHTMOUSE:
case MIDDLEMOUSE:
- if(ELEM(tsc->zone, SCROLLHANDLE_MIN_OUTSIDE, SCROLLHANDLE_MAX_OUTSIDE)) {
+ if (ELEM(tsc->zone, SCROLLHANDLE_MIN_OUTSIDE, SCROLLHANDLE_MAX_OUTSIDE)) {
int last;
- st->top+= st->viewlines * (tsc->zone==SCROLLHANDLE_MIN_OUTSIDE ? 1 : -1);
+ st->top += st->viewlines * (tsc->zone == SCROLLHANDLE_MIN_OUTSIDE ? 1 : -1);
- last= text_get_total_lines(st, ar);
- last= last - (st->viewlines/2);
+ last = text_get_total_lines(st, ar);
+ last = last - (st->viewlines / 2);
CLAMP(st->top, 0, last);
@@ -2206,18 +2225,18 @@ static int text_scroll_cancel(bContext *C, wmOperator *op)
static int text_scroll_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceText *st= CTX_wm_space_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
TextScroll *tsc;
- if(RNA_struct_property_is_set(op->ptr, "lines"))
+ if (RNA_struct_property_is_set(op->ptr, "lines"))
return text_scroll_exec(C, op);
- tsc= MEM_callocN(sizeof(TextScroll), "TextScroll");
- tsc->first= 1;
- tsc->zone= SCROLLHANDLE_BAR;
- op->customdata= tsc;
+ tsc = MEM_callocN(sizeof(TextScroll), "TextScroll");
+ tsc->first = 1;
+ tsc->zone = SCROLLHANDLE_BAR;
+ op->customdata = tsc;
- st->flags|= ST_SCROLL_SELECT;
+ st->flags |= ST_SCROLL_SELECT;
if (event->type == MOUSEPAN) {
text_update_character_width(st);
@@ -2225,8 +2244,8 @@ static int text_scroll_invoke(bContext *C, wmOperator *op, wmEvent *event)
tsc->old[0] = event->x;
tsc->old[1] = event->y;
/* Sensitivity of scroll set to 4pix per line/char */
- tsc->delta[0] = (event->x - event->prevx)*st->cwidth/4;
- tsc->delta[1] = (event->y - event->prevy)*st->lheight/4;
+ tsc->delta[0] = (event->x - event->prevx) * st->cwidth / 4;
+ tsc->delta[1] = (event->y - event->prevy) * st->lheight / 4;
tsc->first = 0;
tsc->scrollbar = 0;
text_scroll_apply(C, op, event);
@@ -2242,22 +2261,22 @@ static int text_scroll_invoke(bContext *C, wmOperator *op, wmEvent *event)
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).*/
- ot->idname= "TEXT_OT_scroll";
- ot->description= "Scroll text screen";
+ ot->name = "Scroll";
+ /* 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";
/* api callbacks */
- ot->exec= text_scroll_exec;
- ot->invoke= text_scroll_invoke;
- ot->modal= text_scroll_modal;
- ot->cancel= text_scroll_cancel;
- ot->poll= text_scroll_poll;
+ ot->exec = text_scroll_exec;
+ ot->invoke = text_scroll_invoke;
+ ot->modal = text_scroll_modal;
+ ot->cancel = text_scroll_cancel;
+ ot->poll = text_scroll_poll;
/* flags */
- ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
+ ot->flag = OPTYPE_BLOCKING | OPTYPE_GRAB_POINTER;
/* properties */
RNA_def_int(ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll", -100, 100);
@@ -2268,14 +2287,14 @@ void TEXT_OT_scroll(wmOperatorType *ot)
static int text_region_scroll_poll(bContext *C)
{
/* same as text_region_edit_poll except it works on libdata too */
- SpaceText *st= CTX_wm_space_text(C);
- Text *text= CTX_data_edit_text(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceText *st = CTX_wm_space_text(C);
+ Text *text = CTX_data_edit_text(C);
+ ARegion *ar = CTX_wm_region(C);
- if(!st || !text)
+ if (!st || !text)
return 0;
- if(!ar || ar->regiontype != RGN_TYPE_WINDOW)
+ if (!ar || ar->regiontype != RGN_TYPE_WINDOW)
return 0;
return 1;
@@ -2283,38 +2302,38 @@ static int text_region_scroll_poll(bContext *C)
static int text_scroll_bar_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceText *st= CTX_wm_space_text(C);
- ARegion *ar= CTX_wm_region(C);
+ SpaceText *st = CTX_wm_space_text(C);
+ ARegion *ar = CTX_wm_region(C);
TextScroll *tsc;
- const int *mval= event->mval;
- int zone= -1;
+ const int *mval = event->mval;
+ int zone = -1;
- if(RNA_struct_property_is_set(op->ptr, "lines"))
+ if (RNA_struct_property_is_set(op->ptr, "lines"))
return text_scroll_exec(C, op);
/* verify we are in the right zone */
- if(mval[0]>st->txtbar.xmin && mval[0]<st->txtbar.xmax) {
- if(mval[1]>=st->txtbar.ymin && mval[1]<=st->txtbar.ymax) {
+ if (mval[0] > st->txtbar.xmin && mval[0] < st->txtbar.xmax) {
+ if (mval[1] >= st->txtbar.ymin && mval[1] <= st->txtbar.ymax) {
/* mouse inside scroll handle */
zone = SCROLLHANDLE_BAR;
}
- else if(mval[1]>TXT_SCROLL_SPACE && mval[1]<ar->winy-TXT_SCROLL_SPACE) {
- if(mval[1]<st->txtbar.ymin) zone= SCROLLHANDLE_MIN_OUTSIDE;
- else zone= SCROLLHANDLE_MAX_OUTSIDE;
+ else if (mval[1] > TXT_SCROLL_SPACE && mval[1] < ar->winy - TXT_SCROLL_SPACE) {
+ if (mval[1] < st->txtbar.ymin) zone = SCROLLHANDLE_MIN_OUTSIDE;
+ else zone = SCROLLHANDLE_MAX_OUTSIDE;
}
}
- if(zone == -1) {
+ if (zone == -1) {
/* we are outside slider - nothing to do */
return OPERATOR_PASS_THROUGH;
}
- tsc= MEM_callocN(sizeof(TextScroll), "TextScroll");
- tsc->first= 1;
- tsc->scrollbar= 1;
- tsc->zone= zone;
- op->customdata= tsc;
- st->flags|= ST_SCROLL_SELECT;
+ tsc = MEM_callocN(sizeof(TextScroll), "TextScroll");
+ tsc->first = 1;
+ tsc->scrollbar = 1;
+ tsc->zone = zone;
+ op->customdata = tsc;
+ st->flags |= ST_SCROLL_SELECT;
/* jump scroll, works in v2d but needs to be added here too :S */
if (event->type == MIDDLEMOUSE) {
@@ -2324,7 +2343,7 @@ static int text_scroll_bar_invoke(bContext *C, wmOperator *op, wmEvent *event)
tsc->delta[0] = 0;
tsc->delta[1] = 0;
tsc->first = 0;
- tsc->zone= SCROLLHANDLE_BAR;
+ tsc->zone = SCROLLHANDLE_BAR;
text_scroll_apply(C, op, event);
}
@@ -2336,21 +2355,21 @@ static int text_scroll_bar_invoke(bContext *C, wmOperator *op, wmEvent *event)
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).*/
- ot->idname= "TEXT_OT_scroll_bar";
- ot->description= "Scroll text screen";
+ ot->name = "Scrollbar";
+ /* 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";
/* api callbacks */
- ot->invoke= text_scroll_bar_invoke;
- ot->modal= text_scroll_modal;
- ot->cancel= text_scroll_cancel;
- ot->poll= text_region_scroll_poll;
+ ot->invoke = text_scroll_bar_invoke;
+ ot->modal = text_scroll_modal;
+ ot->cancel = text_scroll_cancel;
+ ot->poll = text_region_scroll_poll;
/* flags */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_BLOCKING;
/* properties */
RNA_def_int(ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll", -100, 100);
@@ -2368,9 +2387,9 @@ static int flatten_len(SpaceText *st, const char *str)
{
int i, total = 0;
- for(i = 0; str[i]; i += BLI_str_utf8_size(str+i)) {
- if(str[i]=='\t') {
- total += st->tabnumber - total%st->tabnumber;
+ for (i = 0; str[i]; i += BLI_str_utf8_size(str + i)) {
+ if (str[i] == '\t') {
+ total += st->tabnumber - total % st->tabnumber;
}
else total++;
}
@@ -2381,9 +2400,9 @@ static int flatten_len(SpaceText *st, const char *str)
static int flatten_index_to_offset(SpaceText *st, const char *str, int index)
{
int i, j;
- for (i= 0, j= 0; i < index; j += BLI_str_utf8_size(str+j))
- if(str[j]=='\t')
- i += st->tabnumber - i%st->tabnumber;
+ for (i = 0, j = 0; i < index; j += BLI_str_utf8_size(str + j))
+ if (str[j] == '\t')
+ i += st->tabnumber - i % st->tabnumber;
else
i++;
@@ -2397,10 +2416,11 @@ static TextLine *get_first_visible_line(SpaceText *st, ARegion *ar, int *y)
for (i = st->top; i > 0 && linep; ) {
int lines = text_get_visible_lines(st, ar, linep->line);
- if (i-lines < 0) {
+ if (i - lines < 0) {
*y += i;
break;
- } else {
+ }
+ else {
linep = linep->next;
i -= lines;
}
@@ -2419,18 +2439,18 @@ static void text_cursor_set_to_pos_wrapped(SpaceText *st, ARegion *ar, int x, in
/* Point to first visible line */
TextLine *linep = get_first_visible_line(st, ar, &y);
- while(loop && linep) {
+ while (loop && linep) {
int i = 0, start = 0, end = max; /* view */
int j = 0, curs = 0, endj = 0; /* mem */
int chop = 1; /* flags */
- for (; loop; j += BLI_str_utf8_size(linep->line+j)) {
+ for (; loop; j += BLI_str_utf8_size(linep->line + j)) {
int chars;
/* Mimic replacement of tabs */
ch = linep->line[j];
- if(ch == '\t') {
- chars = st->tabnumber - i%st->tabnumber;
+ if (ch == '\t') {
+ chars = st->tabnumber - i % st->tabnumber;
ch = ' ';
}
else chars = 1;
@@ -2443,34 +2463,34 @@ static void text_cursor_set_to_pos_wrapped(SpaceText *st, ARegion *ar, int x, in
break;
/* Exactly at the cursor */
}
- else if (y == 0 && i-start == x) {
+ else if (y == 0 && i - start == x) {
/* current position could be wrapped to next line */
/* this should be checked when end of current line would be reached */
- charp = curs= j;
+ charp = curs = j;
found = 1;
/* Prepare curs for next wrap */
}
- else if(i - end == x) {
+ else if (i - end == x) {
curs = j;
}
if (i - start >= max) {
if (found) {
/* exact cursor position was found, check if it's */
/* still on needed line (hasn't been wrapped) */
- if (charp > endj && !chop && ch!='\0') charp = endj;
+ if (charp > endj && !chop && ch != '\0') charp = endj;
loop = 0;
break;
}
- if(chop) endj = j;
+ if (chop) endj = j;
start = end;
end += max;
- if(j < linep->len)
+ if (j < linep->len)
y--;
chop = 1;
- if (y == 0 && i-start >= x) {
+ if (y == 0 && i - start >= x) {
charp = curs;
loop = 0;
break;
@@ -2482,7 +2502,7 @@ static void text_cursor_set_to_pos_wrapped(SpaceText *st, ARegion *ar, int x, in
break;
}
- if(y == 0 && i-start >= x) {
+ if (y == 0 && i - start >= x) {
charp = curs;
loop = 0;
break;
@@ -2494,12 +2514,12 @@ static void text_cursor_set_to_pos_wrapped(SpaceText *st, ARegion *ar, int x, in
i++;
}
- if(ch == '\0') break;
+ if (ch == '\0') break;
}
- if(!loop || found) break;
+ if (!loop || found) break;
- if(!linep->next) {
+ if (!linep->next) {
charp = linep->len;
break;
}
@@ -2515,24 +2535,24 @@ static void text_cursor_set_to_pos_wrapped(SpaceText *st, ARegion *ar, int x, in
}
if (linep && charp != -1) {
- if(sel) { text->sell = linep; text->selc = charp; }
+ if (sel) { text->sell = linep; text->selc = charp; }
else { text->curl = linep; text->curc = charp; }
}
}
static void text_cursor_set_to_pos(SpaceText *st, ARegion *ar, int x, int y, int sel)
{
- Text *text= st->text;
+ Text *text = st->text;
text_update_character_width(st);
- y= (ar->winy - 2 - y)/st->lheight;
+ y = (ar->winy - 2 - y) / st->lheight;
- if(st->showlinenrs) x-= TXT_OFFSET+TEXTXLOC;
- else x-= TXT_OFFSET;
+ if (st->showlinenrs) x -= TXT_OFFSET + TEXTXLOC;
+ else x -= TXT_OFFSET;
- if(x<0) x= 0;
- x = (x/st->cwidth) + st->left;
+ if (x < 0) x = 0;
+ x = text_pixel_x_to_index(st, x) + st->left;
- if(st->wordwrap) {
+ if (st->wordwrap) {
text_cursor_set_to_pos_wrapped(st, ar, x, y, sel);
}
else {
@@ -2540,105 +2560,105 @@ static void text_cursor_set_to_pos(SpaceText *st, ARegion *ar, int x, int y, int
int *charp;
int w;
- if(sel) { linep= &text->sell; charp= &text->selc; }
- else { linep= &text->curl; charp= &text->curc; }
+ if (sel) { linep = &text->sell; charp = &text->selc; }
+ else { linep = &text->curl; charp = &text->curc; }
- y-= txt_get_span(text->lines.first, *linep) - st->top;
+ y -= txt_get_span(text->lines.first, *linep) - st->top;
- if(y>0) {
- while(y-- != 0) if((*linep)->next) *linep= (*linep)->next;
+ if (y > 0) {
+ while (y-- != 0) if ((*linep)->next) *linep = (*linep)->next;
}
- else if(y<0) {
- while(y++ != 0) if((*linep)->prev) *linep= (*linep)->prev;
+ else if (y < 0) {
+ while (y++ != 0) if ((*linep)->prev) *linep = (*linep)->prev;
}
- w= flatten_len(st, (*linep)->line);
- if(x<w) *charp= flatten_index_to_offset(st, (*linep)->line, x);
- else *charp= (*linep)->len;
+ w = flatten_len(st, (*linep)->line);
+ if (x < w) *charp = flatten_index_to_offset(st, (*linep)->line, x);
+ else *charp = (*linep)->len;
}
- if(!sel) txt_pop_sel(text);
+ if (!sel) txt_pop_sel(text);
}
static void text_cursor_set_apply(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceText *st= CTX_wm_space_text(C);
- ARegion *ar= CTX_wm_region(C);
- SetSelection *ssel= op->customdata;
+ SpaceText *st = CTX_wm_space_text(C);
+ ARegion *ar = CTX_wm_region(C);
+ SetSelection *ssel = op->customdata;
- if(event->mval[1]<0 || event->mval[1]>ar->winy) {
- int d= (ssel->old[1]-event->mval[1])*st->pix_per_line;
- if(d) txt_screen_skip(st, ar, d);
+ if (event->mval[1] < 0 || event->mval[1] > ar->winy) {
+ int d = (ssel->old[1] - event->mval[1]) * st->pix_per_line;
+ if (d) txt_screen_skip(st, ar, d);
- text_cursor_set_to_pos(st, ar, event->mval[0], event->mval[1]<0?0:ar->winy, 1);
+ text_cursor_set_to_pos(st, ar, event->mval[0], event->mval[1] < 0 ? 0 : ar->winy, 1);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, st->text);
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, st->text);
}
- else if(!st->wordwrap && (event->mval[0]<0 || event->mval[0]>ar->winx)) {
- if(event->mval[0]>ar->winx) st->left++;
- else if(event->mval[0]<0 && st->left>0) st->left--;
+ else if (!st->wordwrap && (event->mval[0] < 0 || event->mval[0] > ar->winx)) {
+ if (event->mval[0] > ar->winx) st->left++;
+ else if (event->mval[0] < 0 && st->left > 0) st->left--;
text_cursor_set_to_pos(st, ar, event->mval[0], event->mval[1], 1);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, st->text);
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, st->text);
// XXX PIL_sleep_ms(10);
}
else {
text_cursor_set_to_pos(st, ar, event->mval[0], event->mval[1], 1);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, st->text);
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, st->text);
- ssel->old[0]= event->mval[0];
- ssel->old[1]= event->mval[1];
+ ssel->old[0] = event->mval[0];
+ ssel->old[1] = event->mval[1];
}
}
static void text_cursor_set_exit(bContext *C, wmOperator *op)
{
- SpaceText *st= CTX_wm_space_text(C);
- Text *text= st->text;
- SetSelection *ssel= op->customdata;
+ SpaceText *st = CTX_wm_space_text(C);
+ Text *text = st->text;
+ SetSelection *ssel = op->customdata;
int linep2, charp2;
char *buffer;
- if(txt_has_sel(text)) {
+ if (txt_has_sel(text)) {
buffer = txt_sel_to_buf(text);
WM_clipboard_text_set(buffer, 1);
MEM_freeN(buffer);
}
- linep2= txt_get_span(st->text->lines.first, st->text->sell);
- charp2= st->text->selc;
+ linep2 = txt_get_span(st->text->lines.first, st->text->sell);
+ charp2 = st->text->selc;
- if(ssel->sell!=linep2 || ssel->selc!=charp2)
+ if (ssel->sell != linep2 || ssel->selc != charp2)
txt_undo_add_toop(st->text, UNDO_STO, ssel->sell, ssel->selc, linep2, charp2);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, st->text);
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, st->text);
MEM_freeN(ssel);
}
static int text_set_selection_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceText *st= CTX_wm_space_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
SetSelection *ssel;
- if(event->mval[0]>=st->txtbar.xmin)
+ if (event->mval[0] >= st->txtbar.xmin)
return OPERATOR_PASS_THROUGH;
- op->customdata= MEM_callocN(sizeof(SetSelection), "SetCursor");
- ssel= op->customdata;
- ssel->selecting= RNA_boolean_get(op->ptr, "select");
+ op->customdata = MEM_callocN(sizeof(SetSelection), "SetCursor");
+ ssel = op->customdata;
+ ssel->selecting = RNA_boolean_get(op->ptr, "select");
- ssel->old[0]= event->mval[0];
- ssel->old[1]= event->mval[1];
+ ssel->old[0] = event->mval[0];
+ ssel->old[1] = event->mval[1];
- ssel->sell= txt_get_span(st->text->lines.first, st->text->sell);
- ssel->selc= st->text->selc;
+ ssel->sell = txt_get_span(st->text->lines.first, st->text->sell);
+ ssel->selc = st->text->selc;
WM_event_add_modal_handler(C, op);
@@ -2649,7 +2669,7 @@ static int text_set_selection_invoke(bContext *C, wmOperator *op, wmEvent *event
static int text_set_selection_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- switch(event->type) {
+ switch (event->type) {
case LEFTMOUSE:
case MIDDLEMOUSE:
case RIGHTMOUSE:
@@ -2672,15 +2692,15 @@ static int text_set_selection_cancel(bContext *C, wmOperator *op)
void TEXT_OT_selection_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Selection";
- ot->idname= "TEXT_OT_selection_set";
- ot->description= "Set cursor selection";
+ ot->name = "Set Selection";
+ ot->idname = "TEXT_OT_selection_set";
+ ot->description = "Set cursor selection";
/* api callbacks */
- ot->invoke= text_set_selection_invoke;
- ot->modal= text_set_selection_modal;
- ot->cancel= text_set_selection_cancel;
- ot->poll= text_region_edit_poll;
+ ot->invoke = text_set_selection_invoke;
+ ot->modal = text_set_selection_modal;
+ ot->cancel = text_set_selection_cancel;
+ ot->poll = text_region_edit_poll;
/* properties */
RNA_def_boolean(ot->srna, "select", 0, "Select", "Set selection end rather than cursor");
@@ -2690,31 +2710,31 @@ void TEXT_OT_selection_set(wmOperatorType *ot)
static int text_cursor_set_exec(bContext *C, wmOperator *op)
{
- SpaceText *st= CTX_wm_space_text(C);
- Text *text= st->text;
- ARegion *ar= CTX_wm_region(C);
- int x= RNA_int_get(op->ptr, "x");
- int y= RNA_int_get(op->ptr, "y");
+ SpaceText *st = CTX_wm_space_text(C);
+ Text *text = st->text;
+ ARegion *ar = CTX_wm_region(C);
+ int x = RNA_int_get(op->ptr, "x");
+ int y = RNA_int_get(op->ptr, "y");
int oldl, oldc;
- oldl= txt_get_span(text->lines.first, text->curl);
- oldc= text->curc;
+ oldl = txt_get_span(text->lines.first, text->curl);
+ oldc = text->curc;
text_cursor_set_to_pos(st, ar, x, y, 0);
txt_undo_add_toop(text, UNDO_CTO, oldl, oldc, txt_get_span(text->lines.first, text->curl), text->curc);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, st->text);
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, st->text);
return OPERATOR_PASS_THROUGH;
}
static int text_cursor_set_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- SpaceText *st= CTX_wm_space_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
- if(event->mval[0]>=st->txtbar.xmin)
+ if (event->mval[0] >= st->txtbar.xmin)
return OPERATOR_PASS_THROUGH;
RNA_int_set(op->ptr, "x", event->mval[0]);
@@ -2726,14 +2746,14 @@ static int text_cursor_set_invoke(bContext *C, wmOperator *op, wmEvent *event)
void TEXT_OT_cursor_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Cursor";
- ot->idname= "TEXT_OT_cursor_set";
- ot->description= "Set cursor position";
+ ot->name = "Set Cursor";
+ ot->idname = "TEXT_OT_cursor_set";
+ ot->description = "Set cursor position";
/* api callbacks */
- ot->invoke= text_cursor_set_invoke;
- ot->exec= text_cursor_set_exec;
- ot->poll= text_region_edit_poll;
+ ot->invoke = text_cursor_set_invoke;
+ ot->exec = text_cursor_set_exec;
+ ot->poll = text_region_edit_poll;
/* properties */
RNA_def_int(ot->srna, "x", 0, INT_MIN, INT_MAX, "X", "", INT_MIN, INT_MAX);
@@ -2744,37 +2764,37 @@ void TEXT_OT_cursor_set(wmOperatorType *ot)
static int text_line_number_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
- SpaceText *st= CTX_wm_space_text(C);
- Text *text= CTX_data_edit_text(C);
- ARegion *ar= CTX_wm_region(C);
- const int *mval= event->mval;
+ SpaceText *st = CTX_wm_space_text(C);
+ Text *text = CTX_data_edit_text(C);
+ ARegion *ar = CTX_wm_region(C);
+ const int *mval = event->mval;
double time;
- static int jump_to= 0;
- static double last_jump= 0;
+ static int jump_to = 0;
+ static double last_jump = 0;
text_update_character_width(st);
- if(!st->showlinenrs)
+ if (!st->showlinenrs)
return OPERATOR_PASS_THROUGH;
- if(!(mval[0]>2 && mval[0]<(TXT_OFFSET + TEXTXLOC) && mval[1]>2 && mval[1]<ar->winy-2))
+ if (!(mval[0] > 2 && mval[0] < (TXT_OFFSET + TEXTXLOC) && mval[1] > 2 && mval[1] < ar->winy - 2))
return OPERATOR_PASS_THROUGH;
- if(!(event->ascii>='0' && event->ascii<='9'))
+ if (!(event->ascii >= '0' && event->ascii <= '9'))
return OPERATOR_PASS_THROUGH;
time = PIL_check_seconds_timer();
- if(last_jump < time-1)
- jump_to= 0;
+ if (last_jump < time - 1)
+ jump_to = 0;
jump_to *= 10;
- jump_to += (int)(event->ascii-'0');
+ jump_to += (int)(event->ascii - '0');
- txt_move_toline(text, jump_to-1, 0);
- last_jump= time;
+ txt_move_toline(text, jump_to - 1, 0);
+ last_jump = time;
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text);
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, text);
return OPERATOR_FINISHED;
}
@@ -2782,21 +2802,21 @@ static int text_line_number_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
void TEXT_OT_line_number(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Line Number";
- ot->idname= "TEXT_OT_line_number";
- ot->description= "The current line number";
+ ot->name = "Line Number";
+ ot->idname = "TEXT_OT_line_number";
+ ot->description = "The current line number";
/* api callbacks */
- ot->invoke= text_line_number_invoke;
- ot->poll= text_region_edit_poll;
+ ot->invoke = text_line_number_invoke;
+ ot->poll = text_region_edit_poll;
}
/******************* insert operator **********************/
static int text_insert_exec(bContext *C, wmOperator *op)
{
- SpaceText *st= CTX_wm_space_text(C);
- Text *text= CTX_data_edit_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
+ Text *text = CTX_data_edit_text(C);
char *str;
int done = 0;
size_t i = 0;
@@ -2804,14 +2824,15 @@ static int text_insert_exec(bContext *C, wmOperator *op)
text_drawcache_tag_update(st, 0);
- str= RNA_string_get_alloc(op->ptr, "text", NULL, 0);
+ str = RNA_string_get_alloc(op->ptr, "text", NULL, 0);
- if(st && st->overwrite) {
+ if (st && st->overwrite) {
while (str[i]) {
code = BLI_str_utf8_as_unicode_step(str, &i);
done |= txt_replace_char(text, code);
}
- } else {
+ }
+ else {
while (str[i]) {
code = BLI_str_utf8_as_unicode_step(str, &i);
done |= txt_add_char(text, code);
@@ -2820,13 +2841,13 @@ static int text_insert_exec(bContext *C, wmOperator *op)
MEM_freeN(str);
- if(!done)
+ if (!done)
return OPERATOR_CANCELLED;
text_update_line_edited(text->curl);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
return OPERATOR_FINISHED;
}
@@ -2835,24 +2856,25 @@ static int text_insert_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
int ret;
- // if(!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
- if(!RNA_string_length(op->ptr, "text")) {
+ // if (!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
+ if (!RNA_string_length(op->ptr, "text")) {
/* if alt/ctrl/super are pressed pass through */
- if(event->ctrl || event->oskey) {
+ if (event->ctrl || event->oskey) {
return OPERATOR_PASS_THROUGH;
}
else {
- char str[BLI_UTF8_MAX+1];
+ char str[BLI_UTF8_MAX + 1];
size_t len;
if (event->utf8_buf[0]) {
len = BLI_str_utf8_size(event->utf8_buf);
memcpy(str, event->utf8_buf, len);
- } else {
+ }
+ else {
/* in theory, ghost can set value to extended ascii here */
len = BLI_str_utf8_from_unicode(event->ascii, str);
}
- str[len]= '\0';
+ str[len] = '\0';
RNA_string_set(op->ptr, "text", str);
}
}
@@ -2860,7 +2882,7 @@ static int text_insert_invoke(bContext *C, wmOperator *op, wmEvent *event)
ret = text_insert_exec(C, op);
/* run the script while editing, evil but useful */
- if(ret==OPERATOR_FINISHED && CTX_wm_space_text(C)->live_edit)
+ if (ret == OPERATOR_FINISHED && CTX_wm_space_text(C)->live_edit)
text_run_script(C, NULL);
return ret;
@@ -2868,114 +2890,117 @@ static int text_insert_invoke(bContext *C, wmOperator *op, wmEvent *event)
void TEXT_OT_insert(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
- ot->name= "Insert";
- ot->idname= "TEXT_OT_insert";
- ot->description= "Insert text at cursor position";
+ ot->name = "Insert";
+ ot->idname = "TEXT_OT_insert";
+ ot->description = "Insert text at cursor position";
/* api callbacks */
- ot->exec= text_insert_exec;
- ot->invoke= text_insert_invoke;
- ot->poll= text_edit_poll;
+ ot->exec = text_insert_exec;
+ ot->invoke = text_insert_invoke;
+ ot->poll = text_edit_poll;
/* properties */
- RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position");
+ prop = RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
/******************* find operator *********************/
/* mode */
-#define TEXT_FIND 0
-#define TEXT_REPLACE 1
-#define TEXT_MARK_ALL 2
+#define TEXT_FIND 0
+#define TEXT_REPLACE 1
+#define TEXT_MARK_ALL 2
static int text_find_and_replace(bContext *C, wmOperator *op, short mode)
{
- Main *bmain= CTX_data_main(C);
- SpaceText *st= CTX_wm_space_text(C);
- Text *start= NULL, *text= st->text;
- int flags, first= 1;
+ Main *bmain = CTX_data_main(C);
+ SpaceText *st = CTX_wm_space_text(C);
+ Text *start = NULL, *text = st->text;
+ int flags, first = 1;
int found = 0;
char *tmp;
- if(!st->findstr[0] || (mode == TEXT_REPLACE && !st->replacestr[0]))
+ if (!st->findstr[0] || (mode == TEXT_REPLACE && !st->replacestr[0]))
return OPERATOR_CANCELLED;
- flags= st->flags;
- if(flags & ST_FIND_ALL)
+ flags = st->flags;
+ if (flags & ST_FIND_ALL)
flags ^= ST_FIND_WRAP;
do {
- int proceed= 0;
+ int proceed = 0;
- if(first) {
- if(text->markers.first)
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ if (first) {
+ if (text->markers.first)
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
txt_clear_markers(text, TMARK_GRP_FINDALL, 0);
}
- first= 0;
+ first = 0;
/* Replace current */
- if(mode!=TEXT_FIND && txt_has_sel(text)) {
- tmp= txt_sel_to_buf(text);
+ if (mode != TEXT_FIND && txt_has_sel(text)) {
+ tmp = txt_sel_to_buf(text);
- if(flags & ST_MATCH_CASE) proceed= strcmp(st->findstr, tmp)==0;
- else proceed= BLI_strcasecmp(st->findstr, tmp)==0;
+ if (flags & ST_MATCH_CASE) proceed = strcmp(st->findstr, tmp) == 0;
+ else proceed = BLI_strcasecmp(st->findstr, tmp) == 0;
- if(proceed) {
- if(mode==TEXT_REPLACE) {
+ if (proceed) {
+ if (mode == TEXT_REPLACE) {
txt_insert_buf(text, st->replacestr);
- if(text->curl && text->curl->format) {
+ if (text->curl && text->curl->format) {
MEM_freeN(text->curl->format);
- text->curl->format= NULL;
+ text->curl->format = NULL;
}
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
text_drawcache_tag_update(CTX_wm_space_text(C), 1);
}
- else if(mode==TEXT_MARK_ALL) {
+ else if (mode == TEXT_MARK_ALL) {
unsigned char color[4];
UI_GetThemeColor4ubv(TH_SHADE2, color);
- if(txt_find_marker(text, text->curl, text->selc, TMARK_GRP_FINDALL, 0)) {
- if(tmp) MEM_freeN(tmp), tmp=NULL;
+ if (txt_find_marker(text, text->curl, text->selc, TMARK_GRP_FINDALL, 0)) {
+ if (tmp) MEM_freeN(tmp), tmp = NULL;
break;
}
txt_add_marker(text, text->curl, text->curc, text->selc, color, TMARK_GRP_FINDALL, TMARK_EDITALL);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
}
}
MEM_freeN(tmp);
- tmp= NULL;
+ tmp = NULL;
}
/* Find next */
- if(txt_find_string(text, st->findstr, flags & ST_FIND_WRAP, flags & ST_MATCH_CASE)) {
+ if (txt_find_string(text, st->findstr, flags & ST_FIND_WRAP, flags & ST_MATCH_CASE)) {
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text);
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, text);
}
- else if(flags & ST_FIND_ALL) {
- if(text==start) break;
- if(!start) start= text;
- if(text->id.next)
- text= st->text= text->id.next;
+ else if (flags & ST_FIND_ALL) {
+ if (text == start) break;
+ if (!start) start = text;
+ if (text->id.next)
+ text = st->text = text->id.next;
else
- text= st->text= bmain->text.first;
+ text = st->text = bmain->text.first;
txt_move_toline(text, 0, 0);
text_update_cursor_moved(C);
- WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text);
- first= 1;
+ WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, text);
+ first = 1;
}
else {
- if(!found && !proceed) BKE_reportf(op->reports, RPT_ERROR, "Text not found: %s", st->findstr);
+ if (!found && !proceed) BKE_reportf(op->reports, RPT_ERROR, "Text not found: %s", st->findstr);
break;
}
found = 1;
- } while(mode==TEXT_MARK_ALL);
+ } while (mode == TEXT_MARK_ALL);
return OPERATOR_FINISHED;
}
@@ -2988,13 +3013,13 @@ static int text_find_exec(bContext *C, wmOperator *op)
void TEXT_OT_find(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Find";
- ot->idname= "TEXT_OT_find";
- ot->description= "Find specified text";
+ ot->name = "Find";
+ ot->idname = "TEXT_OT_find";
+ ot->description = "Find specified text";
/* api callbacks */
- ot->exec= text_find_exec;
- ot->poll= text_space_edit_poll;
+ ot->exec = text_find_exec;
+ ot->poll = text_space_edit_poll;
}
/******************* replace operator *********************/
@@ -3007,13 +3032,13 @@ static int text_replace_exec(bContext *C, wmOperator *op)
void TEXT_OT_replace(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Replace";
- ot->idname= "TEXT_OT_replace";
- ot->description= "Replace text with the specified text";
+ ot->name = "Replace";
+ ot->idname = "TEXT_OT_replace";
+ ot->description = "Replace text with the specified text";
/* api callbacks */
- ot->exec= text_replace_exec;
- ot->poll= text_space_edit_poll;
+ ot->exec = text_replace_exec;
+ ot->poll = text_space_edit_poll;
}
/******************* mark all operator *********************/
@@ -3026,28 +3051,28 @@ static int text_mark_all_exec(bContext *C, wmOperator *op)
void TEXT_OT_mark_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mark All";
- ot->idname= "TEXT_OT_mark_all";
- ot->description= "Mark all specified text";
+ ot->name = "Mark All";
+ ot->idname = "TEXT_OT_mark_all";
+ ot->description = "Mark all specified text";
/* api callbacks */
- ot->exec= text_mark_all_exec;
- ot->poll= text_space_edit_poll;
+ ot->exec = text_mark_all_exec;
+ ot->poll = text_space_edit_poll;
}
/******************* find set selected *********************/
static int text_find_set_selected_exec(bContext *C, wmOperator *op)
{
- SpaceText *st= CTX_wm_space_text(C);
- Text *text= CTX_data_edit_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
+ Text *text = CTX_data_edit_text(C);
char *tmp;
- tmp= txt_sel_to_buf(text);
+ tmp = txt_sel_to_buf(text);
BLI_strncpy(st->findstr, tmp, ST_MAX_FIND_STR);
MEM_freeN(tmp);
- if(!st->findstr[0])
+ if (!st->findstr[0])
return OPERATOR_FINISHED;
return text_find_and_replace(C, op, TEXT_FIND);
@@ -3056,24 +3081,24 @@ static int text_find_set_selected_exec(bContext *C, wmOperator *op)
void TEXT_OT_find_set_selected(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Find Set Selected";
- ot->idname= "TEXT_OT_find_set_selected";
- ot->description= "Find specified text and set as selected";
+ ot->name = "Find Set Selected";
+ ot->idname = "TEXT_OT_find_set_selected";
+ ot->description = "Find specified text and set as selected";
/* api callbacks */
- ot->exec= text_find_set_selected_exec;
- ot->poll= text_space_edit_poll;
+ ot->exec = text_find_set_selected_exec;
+ ot->poll = text_space_edit_poll;
}
/******************* replace set selected *********************/
static int text_replace_set_selected_exec(bContext *C, wmOperator *UNUSED(op))
{
- SpaceText *st= CTX_wm_space_text(C);
- Text *text= CTX_data_edit_text(C);
+ SpaceText *st = CTX_wm_space_text(C);
+ Text *text = CTX_data_edit_text(C);
char *tmp;
- tmp= txt_sel_to_buf(text);
+ tmp = txt_sel_to_buf(text);
BLI_strncpy(st->replacestr, tmp, ST_MAX_FIND_STR);
MEM_freeN(tmp);
@@ -3083,29 +3108,30 @@ static int text_replace_set_selected_exec(bContext *C, wmOperator *UNUSED(op))
void TEXT_OT_replace_set_selected(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Replace Set Selected";
- ot->idname= "TEXT_OT_replace_set_selected";
- ot->description= "Replace text with specified text and set as selected";
+ ot->name = "Replace Set Selected";
+ ot->idname = "TEXT_OT_replace_set_selected";
+ ot->description = "Replace text with specified text and set as selected";
/* api callbacks */
- ot->exec= text_replace_set_selected_exec;
- ot->poll= text_space_edit_poll;
+ ot->exec = text_replace_set_selected_exec;
+ ot->poll = text_space_edit_poll;
}
/****************** resolve conflict operator ******************/
enum { RESOLVE_IGNORE, RESOLVE_RELOAD, RESOLVE_SAVE, RESOLVE_MAKE_INTERNAL };
-static EnumPropertyItem resolution_items[]= {
+static EnumPropertyItem resolution_items[] = {
{RESOLVE_IGNORE, "IGNORE", 0, "Ignore", ""},
{RESOLVE_RELOAD, "RELOAD", 0, "Reload", ""},
{RESOLVE_SAVE, "SAVE", 0, "Save", ""},
{RESOLVE_MAKE_INTERNAL, "MAKE_INTERNAL", 0, "Make Internal", ""},
- {0, NULL, 0, NULL, NULL}};
+ {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)
{
@@ -3113,24 +3139,24 @@ int text_file_modified(Text *text)
int result;
char file[FILE_MAX];
- if(!text || !text->name)
+ if (!text || !text->name)
return 0;
BLI_strncpy(file, text->name, FILE_MAX);
BLI_path_abs(file, G.main->name);
- if(!BLI_exists(file))
+ if (!BLI_exists(file))
return 2;
result = stat(file, &st);
- if(result == -1)
+ if (result == -1)
return -1;
- if((st.st_mode & S_IFMT) != S_IFREG)
+ if ((st.st_mode & S_IFMT) != S_IFREG)
return -1;
- if(st.st_mtime > text->mtime)
+ if (st.st_mtime > text->mtime)
return 1;
return 0;
@@ -3142,27 +3168,27 @@ static void text_ignore_modified(Text *text)
int result;
char file[FILE_MAX];
- if(!text || !text->name) return;
+ if (!text || !text->name) return;
BLI_strncpy(file, text->name, FILE_MAX);
BLI_path_abs(file, G.main->name);
- if(!BLI_exists(file)) return;
+ if (!BLI_exists(file)) return;
result = stat(file, &st);
- if(result == -1 || (st.st_mode & S_IFMT) != S_IFREG)
+ if (result == -1 || (st.st_mode & S_IFMT) != S_IFREG)
return;
- text->mtime= st.st_mtime;
+ text->mtime = st.st_mtime;
}
static int text_resolve_conflict_exec(bContext *C, wmOperator *op)
{
- Text *text= CTX_data_edit_text(C);
- int resolution= RNA_enum_get(op->ptr, "resolution");
+ Text *text = CTX_data_edit_text(C);
+ int resolution = RNA_enum_get(op->ptr, "resolution");
- switch(resolution) {
+ switch (resolution) {
case RESOLVE_RELOAD:
return text_reload_exec(C, op);
case RESOLVE_SAVE:
@@ -3179,24 +3205,24 @@ static int text_resolve_conflict_exec(bContext *C, wmOperator *op)
static int text_resolve_conflict_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
uiPopupMenu *pup;
uiLayout *layout;
- switch(text_file_modified(text)) {
+ switch (text_file_modified(text)) {
case 1:
- if(text->flags & TXT_ISDIRTY) {
+ if (text->flags & TXT_ISDIRTY) {
/* modified locally and externally, ahhh. offer more possibilites. */
- pup= uiPupMenuBegin(C, "File Modified Outside and Inside Blender", ICON_NONE);
- layout= uiPupMenuLayout(pup);
+ pup = uiPupMenuBegin(C, "File Modified Outside and Inside Blender", ICON_NONE);
+ layout = uiPupMenuLayout(pup);
uiItemEnumO_ptr(layout, op->type, "Reload from disk (ignore local changes)", 0, "resolution", RESOLVE_RELOAD);
uiItemEnumO_ptr(layout, op->type, "Save to disk (ignore outside changes)", 0, "resolution", RESOLVE_SAVE);
uiItemEnumO_ptr(layout, op->type, "Make text internal (separate copy)", 0, "resolution", RESOLVE_MAKE_INTERNAL);
uiPupMenuEnd(C, pup);
}
else {
- pup= uiPupMenuBegin(C, "File Modified Outside Blender", ICON_NONE);
- layout= uiPupMenuLayout(pup);
+ pup = uiPupMenuBegin(C, "File Modified Outside Blender", ICON_NONE);
+ layout = uiPupMenuLayout(pup);
uiItemEnumO_ptr(layout, op->type, "Reload from disk", 0, "resolution", RESOLVE_RELOAD);
uiItemEnumO_ptr(layout, op->type, "Make text internal (separate copy)", 0, "resolution", RESOLVE_MAKE_INTERNAL);
uiItemEnumO_ptr(layout, op->type, "Ignore", 0, "resolution", RESOLVE_IGNORE);
@@ -3204,8 +3230,8 @@ static int text_resolve_conflict_invoke(bContext *C, wmOperator *op, wmEvent *UN
}
break;
case 2:
- pup= uiPupMenuBegin(C, "File Deleted Outside Blender", ICON_NONE);
- layout= uiPupMenuLayout(pup);
+ pup = uiPupMenuBegin(C, "File Deleted Outside Blender", ICON_NONE);
+ layout = uiPupMenuLayout(pup);
uiItemEnumO_ptr(layout, op->type, "Make text internal", 0, "resolution", RESOLVE_MAKE_INTERNAL);
uiItemEnumO_ptr(layout, op->type, "Recreate file", 0, "resolution", RESOLVE_SAVE);
uiPupMenuEnd(C, pup);
@@ -3218,14 +3244,14 @@ static int text_resolve_conflict_invoke(bContext *C, wmOperator *op, wmEvent *UN
void TEXT_OT_resolve_conflict(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Resolve Conflict";
- ot->idname= "TEXT_OT_resolve_conflict";
- ot->description= "When external text is out of sync, resolve the conflict";
+ ot->name = "Resolve Conflict";
+ ot->idname = "TEXT_OT_resolve_conflict";
+ ot->description = "When external text is out of sync, resolve the conflict";
/* api callbacks */
- ot->exec= text_resolve_conflict_exec;
- ot->invoke= text_resolve_conflict_invoke;
- ot->poll= text_save_poll;
+ ot->exec = text_resolve_conflict_exec;
+ ot->invoke = text_resolve_conflict_invoke;
+ ot->poll = text_save_poll;
/* properties */
RNA_def_enum(ot->srna, "resolution", resolution_items, RESOLVE_IGNORE, "Resolution", "How to solve conflict due to differences in internal and external text");
@@ -3235,8 +3261,8 @@ void TEXT_OT_resolve_conflict(wmOperatorType *ot)
static int text_to_3d_object_exec(bContext *C, wmOperator *op)
{
- Text *text= CTX_data_edit_text(C);
- int split_lines= RNA_boolean_get(op->ptr, "split_lines");
+ Text *text = CTX_data_edit_text(C);
+ int split_lines = RNA_boolean_get(op->ptr, "split_lines");
ED_text_to_object(C, text, split_lines);
@@ -3246,16 +3272,16 @@ static int text_to_3d_object_exec(bContext *C, wmOperator *op)
void TEXT_OT_to_3d_object(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "To 3D Object";
- ot->idname= "TEXT_OT_to_3d_object";
- ot->description= "Create 3d text object from active text data block";
+ ot->name = "To 3D Object";
+ ot->idname = "TEXT_OT_to_3d_object";
+ ot->description = "Create 3d text object from active text data block";
/* api callbacks */
- ot->exec= text_to_3d_object_exec;
- ot->poll= text_edit_poll;
+ ot->exec = text_to_3d_object_exec;
+ ot->poll = text_edit_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "split_lines", 0, "Split Lines", "Create one object per line in the text");
@@ -3266,20 +3292,20 @@ void TEXT_OT_to_3d_object(wmOperatorType *ot)
void ED_text_undo_step(bContext *C, int step)
{
- Text *text= CTX_data_edit_text(C);
+ Text *text = CTX_data_edit_text(C);
- if(!text)
+ if (!text)
return;
- if(step==1)
+ if (step == 1)
txt_do_undo(text);
- else if(step==-1)
+ else if (step == -1)
txt_do_redo(text);
text_update_edited(text);
text_update_cursor_moved(C);
text_drawcache_tag_update(CTX_wm_space_text(C), 1);
- WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text);
+ WM_event_add_notifier(C, NC_TEXT | NA_EDITED, text);
}
diff --git a/source/blender/editors/space_text/text_python.c b/source/blender/editors/space_text/text_python.c
index efe744696df..c24af998835 100644
--- a/source/blender/editors/space_text/text_python.c
+++ b/source/blender/editors/space_text/text_python.c
@@ -55,49 +55,49 @@ int text_do_suggest_select(SpaceText *st, ARegion *ar)
int tgti, *top;
int mval[2] = {0, 0};
- if(!st || !st->text) return 0;
- if(!texttool_text_is_active(st->text)) return 0;
+ if (!st || !st->text) return 0;
+ if (!texttool_text_is_active(st->text)) return 0;
first = texttool_suggest_first();
last = texttool_suggest_last();
/* sel = texttool_suggest_selected(); */ /* UNUSED */
top = texttool_suggest_top();
- if(!last || !first)
+ if (!last || !first)
return 0;
/* Count the visible lines to the cursor */
- for(tmp=st->text->curl, l=-st->top; tmp; tmp=tmp->prev, l++);
- if(l<0) return 0;
+ for (tmp = st->text->curl, l = -st->top; tmp; tmp = tmp->prev, l++) ;
+ if (l < 0) return 0;
text_update_character_width(st);
- if(st->showlinenrs) {
- x = st->cwidth*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4;
+ if (st->showlinenrs) {
+ x = st->cwidth * (st->text->curc - st->left) + TXT_OFFSET + TEXTXLOC - 4;
}
else {
- x = st->cwidth*(st->text->curc-st->left) + TXT_OFFSET - 4;
+ x = st->cwidth * (st->text->curc - st->left) + TXT_OFFSET - 4;
}
- y = ar->winy - st->lheight*l - 2;
+ y = ar->winy - st->lheight * l - 2;
- w = SUGG_LIST_WIDTH*st->cwidth + 20;
- h = SUGG_LIST_SIZE*st->lheight + 8;
+ w = SUGG_LIST_WIDTH * st->cwidth + 20;
+ h = SUGG_LIST_SIZE * st->lheight + 8;
// XXX getmouseco_areawin(mval);
- if(mval[0]<x || x+w<mval[0] || mval[1]<y-h || y<mval[1])
+ if (mval[0] < x || x + w < mval[0] || mval[1] < y - h || y < mval[1])
return 0;
/* Work out which of the items is at the top of the visible list */
- for(i=0, item=first; i<*top && item->next; i++, item=item->next);
+ for (i = 0, item = first; i < *top && item->next; i++, item = item->next) ;
/* Work out the target item index in the visible list */
- tgti = (y-mval[1]-4) / st->lheight;
- if(tgti<0 || tgti>SUGG_LIST_SIZE)
+ tgti = (y - mval[1] - 4) / st->lheight;
+ if (tgti < 0 || tgti > SUGG_LIST_SIZE)
return 1;
- for(i=tgti; i>0 && item->next; i--, item=item->next);
- if(item)
+ for (i = tgti; i > 0 && item->next; i--, item = item->next) ;
+ if (item)
texttool_suggest_select(item);
return 1;
}
@@ -107,19 +107,19 @@ void text_pop_suggest_list(void)
SuggItem *item, *sel;
int *top, i;
- item= texttool_suggest_first();
- sel= texttool_suggest_selected();
- top= texttool_suggest_top();
+ item = texttool_suggest_first();
+ sel = texttool_suggest_selected();
+ top = texttool_suggest_top();
- i= 0;
- while(item && item != sel) {
- item= item->next;
+ i = 0;
+ while (item && item != sel) {
+ item = item->next;
i++;
}
- if(i > *top+SUGG_LIST_SIZE-1)
- *top= i-SUGG_LIST_SIZE+1;
- else if(i < *top)
- *top= i;
+ if (i > *top + SUGG_LIST_SIZE - 1)
+ *top = i - SUGG_LIST_SIZE + 1;
+ else if (i < *top)
+ *top = i;
}
static void get_suggest_prefix(Text *text, int offset)
@@ -127,53 +127,53 @@ static void get_suggest_prefix(Text *text, int offset)
int i, len;
char *line, tmp[256];
- if(!text) return;
- if(!texttool_text_is_active(text)) return;
+ if (!text) return;
+ if (!texttool_text_is_active(text)) return;
- line= text->curl->line;
- for(i=text->curc-1+offset; i>=0; i--)
- if(!text_check_identifier(line[i]))
+ line = text->curl->line;
+ for (i = text->curc - 1 + offset; i >= 0; i--)
+ if (!text_check_identifier(line[i]))
break;
i++;
- len= text->curc-i+offset;
- if(len > 255) {
+ len = text->curc - i + offset;
+ if (len > 255) {
printf("Suggestion prefix too long\n");
len = 255;
}
- BLI_strncpy(tmp, line+i, len);
- tmp[len]= '\0';
+ BLI_strncpy(tmp, line + i, len);
+ tmp[len] = '\0';
texttool_suggest_prefix(tmp);
}
static void confirm_suggestion(Text *text, int skipleft)
{
SuggItem *sel;
- int i, over=0;
+ int i, over = 0;
char *line;
- if(!text) return;
- if(!texttool_text_is_active(text)) return;
+ if (!text) return;
+ if (!texttool_text_is_active(text)) return;
sel = texttool_suggest_selected();
- if(!sel) return;
+ if (!sel) return;
- line= text->curl->line;
- i=text->curc-skipleft-1;
- while(i>=0) {
- if(!text_check_identifier(line[i]))
+ line = text->curl->line;
+ i = text->curc - skipleft - 1;
+ while (i >= 0) {
+ if (!text_check_identifier(line[i]))
break;
over++;
i--;
}
- for(i=0; i<skipleft; i++)
+ for (i = 0; i < skipleft; i++)
txt_move_left(text, 0);
- for(i=0; i<over; i++)
+ for (i = 0; i < over; i++)
txt_move_left(text, 1);
txt_insert_buf(text, sel->name);
- for(i=0; i<skipleft; i++)
+ for (i = 0; i < skipleft; i++)
txt_move_right(text, 0);
texttool_text_clear();
@@ -189,85 +189,85 @@ static void confirm_suggestion(Text *text, int skipleft)
#define LR_OSKEY 0
// XXX
-static int doc_scroll= 0;
+static int doc_scroll = 0;
-static short UNUSED_FUNCTION(do_texttools)(SpaceText *st, char ascii, unsigned short evnt, short val)
+static short UNUSED_FUNCTION(do_texttools) (SpaceText * st, char ascii, unsigned short evnt, short val)
{
- ARegion *ar= NULL; // XXX
- int qual= 0; // XXX
- int draw=0, tools=0, swallow=0, scroll=1;
- if(!texttool_text_is_active(st->text)) return 0;
- if(!st->text || st->text->id.lib) return 0;
-
- if(st->doplugins && texttool_text_is_active(st->text)) {
- if(texttool_suggest_first()) tools |= TOOL_SUGG_LIST;
- if(texttool_docs_get()) tools |= TOOL_DOCUMENT;
+ ARegion *ar = NULL; // XXX
+ int qual = 0; // XXX
+ int draw = 0, tools = 0, swallow = 0, scroll = 1;
+ if (!texttool_text_is_active(st->text)) return 0;
+ if (!st->text || st->text->id.lib) return 0;
+
+ if (st->doplugins && texttool_text_is_active(st->text)) {
+ if (texttool_suggest_first()) tools |= TOOL_SUGG_LIST;
+ if (texttool_docs_get()) tools |= TOOL_DOCUMENT;
}
- if(ascii) {
- if(tools & TOOL_SUGG_LIST) {
- if((ascii != '_' && ascii != '*' && ispunct(ascii)) || text_check_whitespace(ascii)) {
+ if (ascii) {
+ if (tools & TOOL_SUGG_LIST) {
+ if ((ascii != '_' && ascii != '*' && ispunct(ascii)) || text_check_whitespace(ascii)) {
confirm_suggestion(st->text, 0);
text_update_line_edited(st->text->curl);
}
- else if((st->overwrite && txt_replace_char(st->text, ascii)) || txt_add_char(st->text, ascii)) {
+ else if ((st->overwrite && txt_replace_char(st->text, ascii)) || txt_add_char(st->text, ascii)) {
get_suggest_prefix(st->text, 0);
text_pop_suggest_list();
- swallow= 1;
- draw= 1;
+ swallow = 1;
+ draw = 1;
}
}
- if(tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0, draw= 1;
+ if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll = 0, draw = 1;
}
- else if(val==1 && evnt) {
+ else if (val == 1 && evnt) {
switch (evnt) {
case LEFTMOUSE:
- if(text_do_suggest_select(st, ar))
- swallow= 1;
+ if (text_do_suggest_select(st, ar))
+ swallow = 1;
else {
- if(tools & TOOL_SUGG_LIST) texttool_suggest_clear();
- if(tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
+ if (tools & TOOL_SUGG_LIST) texttool_suggest_clear();
+ if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll = 0;
}
- draw= 1;
+ draw = 1;
break;
case MIDDLEMOUSE:
- if(text_do_suggest_select(st, ar)) {
+ if (text_do_suggest_select(st, ar)) {
confirm_suggestion(st->text, 0);
text_update_line_edited(st->text->curl);
- swallow= 1;
+ swallow = 1;
}
else {
- if(tools & TOOL_SUGG_LIST) texttool_suggest_clear();
- if(tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
+ if (tools & TOOL_SUGG_LIST) texttool_suggest_clear();
+ if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll = 0;
}
- draw= 1;
+ draw = 1;
break;
case ESCKEY:
- draw= swallow= 1;
- if(tools & TOOL_SUGG_LIST) texttool_suggest_clear();
- else if(tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
- else draw= swallow= 0;
+ draw = swallow = 1;
+ if (tools & TOOL_SUGG_LIST) texttool_suggest_clear();
+ else if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll = 0;
+ else draw = swallow = 0;
break;
case RETKEY:
- if(tools & TOOL_SUGG_LIST) {
+ if (tools & TOOL_SUGG_LIST) {
confirm_suggestion(st->text, 0);
text_update_line_edited(st->text->curl);
- swallow= 1;
- draw= 1;
+ swallow = 1;
+ draw = 1;
}
- if(tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0, draw= 1;
+ if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll = 0, draw = 1;
break;
case LEFTARROWKEY:
case BACKSPACEKEY:
- if(tools & TOOL_SUGG_LIST) {
- if(qual)
+ if (tools & TOOL_SUGG_LIST) {
+ if (qual)
texttool_suggest_clear();
else {
/* Work out which char we are about to delete/pass */
- if(st->text->curl && st->text->curc > 0) {
- char ch= st->text->curl->line[st->text->curc-1];
- if((ch=='_' || !ispunct(ch)) && !text_check_whitespace(ch)) {
+ if (st->text->curl && st->text->curc > 0) {
+ char ch = st->text->curl->line[st->text->curc - 1];
+ if ((ch == '_' || !ispunct(ch)) && !text_check_whitespace(ch)) {
get_suggest_prefix(st->text, -1);
text_pop_suggest_list();
}
@@ -278,17 +278,17 @@ static short UNUSED_FUNCTION(do_texttools)(SpaceText *st, char ascii, unsigned s
texttool_suggest_clear();
}
}
- if(tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
+ if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll = 0;
break;
case RIGHTARROWKEY:
- if(tools & TOOL_SUGG_LIST) {
- if(qual)
+ if (tools & TOOL_SUGG_LIST) {
+ if (qual)
texttool_suggest_clear();
else {
/* Work out which char we are about to pass */
- if(st->text->curl && st->text->curc < st->text->curl->len) {
- char ch= st->text->curl->line[st->text->curc+1];
- if((ch=='_' || !ispunct(ch)) && !text_check_whitespace(ch)) {
+ if (st->text->curl && st->text->curc < st->text->curl->len) {
+ char ch = st->text->curl->line[st->text->curc + 1];
+ if ((ch == '_' || !ispunct(ch)) && !text_check_whitespace(ch)) {
get_suggest_prefix(st->text, 1);
text_pop_suggest_list();
}
@@ -299,249 +299,253 @@ static short UNUSED_FUNCTION(do_texttools)(SpaceText *st, char ascii, unsigned s
texttool_suggest_clear();
}
}
- if(tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
+ if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll = 0;
break;
case PAGEDOWNKEY:
- scroll= SUGG_LIST_SIZE-1;
+ scroll = SUGG_LIST_SIZE - 1;
case WHEELDOWNMOUSE:
case DOWNARROWKEY:
- if(tools & TOOL_DOCUMENT) {
+ if (tools & TOOL_DOCUMENT) {
doc_scroll++;
- swallow= 1;
- draw= 1;
+ swallow = 1;
+ draw = 1;
break;
}
- else if(tools & TOOL_SUGG_LIST) {
+ else if (tools & TOOL_SUGG_LIST) {
SuggItem *sel = texttool_suggest_selected();
- if(!sel) {
+ if (!sel) {
texttool_suggest_select(texttool_suggest_first());
}
- else while(sel && sel!=texttool_suggest_last() && sel->next && scroll--) {
- texttool_suggest_select(sel->next);
- sel= sel->next;
+ else {
+ while (sel && sel != texttool_suggest_last() && sel->next && scroll--) {
+ texttool_suggest_select(sel->next);
+ sel = sel->next;
+ }
}
text_pop_suggest_list();
- swallow= 1;
- draw= 1;
+ swallow = 1;
+ draw = 1;
break;
}
case PAGEUPKEY:
- scroll= SUGG_LIST_SIZE-1;
+ scroll = SUGG_LIST_SIZE - 1;
case WHEELUPMOUSE:
case UPARROWKEY:
- if(tools & TOOL_DOCUMENT) {
- if(doc_scroll>0) doc_scroll--;
- swallow= 1;
- draw= 1;
+ if (tools & TOOL_DOCUMENT) {
+ if (doc_scroll > 0) doc_scroll--;
+ swallow = 1;
+ draw = 1;
break;
}
- else if(tools & TOOL_SUGG_LIST) {
+ else if (tools & TOOL_SUGG_LIST) {
SuggItem *sel = texttool_suggest_selected();
- while(sel && sel!=texttool_suggest_first() && sel->prev && scroll--) {
+ while (sel && sel != texttool_suggest_first() && sel->prev && scroll--) {
texttool_suggest_select(sel->prev);
- sel= sel->prev;
+ sel = sel->prev;
}
text_pop_suggest_list();
- swallow= 1;
- draw= 1;
+ swallow = 1;
+ draw = 1;
break;
}
case RIGHTSHIFTKEY:
case LEFTSHIFTKEY:
break;
default:
- if(tools & TOOL_SUGG_LIST) texttool_suggest_clear(), draw= 1;
- if(tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0, draw= 1;
+ if (tools & TOOL_SUGG_LIST) texttool_suggest_clear(), draw = 1;
+ if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll = 0, draw = 1;
}
}
- if(draw)
- {}; // XXX redraw_alltext();
-
+ if (draw) {
+ // XXX redraw_alltext();
+ }
+
return swallow;
}
#if 0
#ifdef WITH_PYTHON
- /* Run text plugin scripts if enabled */
- if(st->doplugins && event && val) {
- if(BPY_menu_do_shortcut(PYMENU_TEXTPLUGIN, event, qual)) {
- do_draw= 1;
- }
+/* Run text plugin scripts if enabled */
+if (st->doplugins && event && val) {
+ if (BPY_menu_do_shortcut(PYMENU_TEXTPLUGIN, event, qual)) {
+ do_draw = 1;
}
+}
#endif
- if(do_draw)
- ; // XXX redraw_alltext();
+if (do_draw)
+ ; // XXX redraw_alltext();
#endif
-static short UNUSED_FUNCTION(do_textmarkers)(SpaceText *st, char ascii, unsigned short evnt, short val)
+static short UNUSED_FUNCTION(do_textmarkers) (SpaceText * st, char ascii, unsigned short evnt, short val)
{
Text *text;
TextMarker *marker, *mrk, *nxt;
- int c, s, draw=0, swallow=0;
- int qual= 0; // XXX
+ int c, s, draw = 0, swallow = 0;
+ int qual = 0; // XXX
- text= st->text;
- if(!text || text->id.lib || text->curl != text->sell) return 0;
+ text = st->text;
+ if (!text || text->id.lib || text->curl != text->sell) return 0;
- marker= txt_find_marker(text, text->sell, text->selc, 0, 0);
- if(marker && (marker->start > text->curc || marker->end < text->curc))
- marker= NULL;
+ marker = txt_find_marker(text, text->sell, text->selc, 0, 0);
+ if (marker && (marker->start > text->curc || marker->end < text->curc))
+ marker = NULL;
- if(!marker) {
+ if (!marker) {
/* Find the next temporary marker */
- if(evnt==TABKEY) {
- int lineno= txt_get_span(text->lines.first, text->curl);
- mrk= text->markers.first;
- while(mrk) {
- if(!marker && (mrk->flags & TMARK_TEMP)) marker= mrk;
- if((mrk->flags & TMARK_TEMP) && (mrk->lineno > lineno || (mrk->lineno==lineno && mrk->end > text->curc))) {
- marker= mrk;
+ if (evnt == TABKEY) {
+ int lineno = txt_get_span(text->lines.first, text->curl);
+ mrk = text->markers.first;
+ while (mrk) {
+ if (!marker && (mrk->flags & TMARK_TEMP)) marker = mrk;
+ if ((mrk->flags & TMARK_TEMP) && (mrk->lineno > lineno || (mrk->lineno == lineno && mrk->end > text->curc))) {
+ marker = mrk;
break;
}
- mrk= mrk->next;
+ mrk = mrk->next;
}
- if(marker) {
+ if (marker) {
txt_move_to(text, marker->lineno, marker->start, 0);
txt_move_to(text, marker->lineno, marker->end, 1);
// XXX text_update_cursor_moved(C);
// XXX WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text);
- evnt= ascii= val= 0;
- draw= 1;
- swallow= 1;
+ evnt = ascii = val = 0;
+ draw = 1;
+ swallow = 1;
}
}
- else if(evnt==ESCKEY) {
- if(txt_clear_markers(text, 0, TMARK_TEMP)) swallow= 1;
- else if(txt_clear_markers(text, 0, 0)) swallow= 1;
+ else if (evnt == ESCKEY) {
+ if (txt_clear_markers(text, 0, TMARK_TEMP)) swallow = 1;
+ else if (txt_clear_markers(text, 0, 0)) swallow = 1;
else return 0;
- evnt= ascii= val= 0;
- draw= 1;
+ evnt = ascii = val = 0;
+ draw = 1;
}
- if(!swallow) return 0;
+ if (!swallow) return 0;
}
- if(ascii) {
- if(marker->flags & TMARK_EDITALL) {
- c= text->curc-marker->start;
- s= text->selc-marker->start;
- if(s<0 || s>marker->end-marker->start) return 0;
-
- mrk= txt_next_marker(text, marker);
- while(mrk) {
- nxt=txt_next_marker(text, mrk); /* mrk may become invalid */
- txt_move_to(text, mrk->lineno, mrk->start+c, 0);
- if(s!=c) txt_move_to(text, mrk->lineno, mrk->start+s, 1);
- if(st->overwrite) {
- if(txt_replace_char(text, ascii))
+ if (ascii) {
+ if (marker->flags & TMARK_EDITALL) {
+ c = text->curc - marker->start;
+ s = text->selc - marker->start;
+ if (s < 0 || s > marker->end - marker->start) return 0;
+
+ mrk = txt_next_marker(text, marker);
+ while (mrk) {
+ nxt = txt_next_marker(text, mrk); /* mrk may become invalid */
+ txt_move_to(text, mrk->lineno, mrk->start + c, 0);
+ if (s != c) txt_move_to(text, mrk->lineno, mrk->start + s, 1);
+ if (st->overwrite) {
+ if (txt_replace_char(text, ascii))
text_update_line_edited(st->text->curl);
}
else {
- if(txt_add_char(text, ascii)) {
+ if (txt_add_char(text, ascii)) {
text_update_line_edited(st->text->curl);
}
}
- if(mrk==marker || mrk==nxt) break;
- mrk=nxt;
+ if (mrk == marker || mrk == nxt) break;
+ mrk = nxt;
}
- swallow= 1;
- draw= 1;
+ swallow = 1;
+ draw = 1;
}
}
- else if(val) {
- switch(evnt) {
+ else if (val) {
+ switch (evnt) {
case BACKSPACEKEY:
- if(marker->flags & TMARK_EDITALL) {
- c= text->curc-marker->start;
- s= text->selc-marker->start;
- if(s<0 || s>marker->end-marker->start) return 0;
+ if (marker->flags & TMARK_EDITALL) {
+ c = text->curc - marker->start;
+ s = text->selc - marker->start;
+ if (s < 0 || s > marker->end - marker->start) return 0;
- mrk= txt_next_marker(text, marker);
- while(mrk) {
- nxt= txt_next_marker(text, mrk); /* mrk may become invalid */
- txt_move_to(text, mrk->lineno, mrk->start+c, 0);
- if(s!=c) txt_move_to(text, mrk->lineno, mrk->start+s, 1);
+ mrk = txt_next_marker(text, marker);
+ while (mrk) {
+ nxt = txt_next_marker(text, mrk); /* mrk may become invalid */
+ txt_move_to(text, mrk->lineno, mrk->start + c, 0);
+ if (s != c) txt_move_to(text, mrk->lineno, mrk->start + s, 1);
txt_backspace_char(text);
text_update_line_edited(st->text->curl);
- if(mrk==marker || mrk==nxt) break;
- mrk= nxt;
+ if (mrk == marker || mrk == nxt) break;
+ mrk = nxt;
}
- swallow= 1;
- draw= 1;
+ swallow = 1;
+ draw = 1;
}
break;
case DELKEY:
- if(marker->flags & TMARK_EDITALL) {
- c= text->curc-marker->start;
- s= text->selc-marker->start;
- if(s<0 || s>marker->end-marker->start) return 0;
+ if (marker->flags & TMARK_EDITALL) {
+ c = text->curc - marker->start;
+ s = text->selc - marker->start;
+ if (s < 0 || s > marker->end - marker->start) return 0;
- mrk= txt_next_marker(text, marker);
- while(mrk) {
- nxt= txt_next_marker(text, mrk); /* mrk may become invalid */
- txt_move_to(text, mrk->lineno, mrk->start+c, 0);
- if(s!=c) txt_move_to(text, mrk->lineno, mrk->start+s, 1);
+ mrk = txt_next_marker(text, marker);
+ while (mrk) {
+ nxt = txt_next_marker(text, mrk); /* mrk may become invalid */
+ txt_move_to(text, mrk->lineno, mrk->start + c, 0);
+ if (s != c) txt_move_to(text, mrk->lineno, mrk->start + s, 1);
txt_delete_char(text);
text_update_line_edited(st->text->curl);
- if(mrk==marker || mrk==nxt) break;
- mrk= nxt;
+ if (mrk == marker || mrk == nxt) break;
+ mrk = nxt;
}
- swallow= 1;
- draw= 1;
+ swallow = 1;
+ draw = 1;
}
break;
case TABKEY:
- if(qual & LR_SHIFTKEY) {
- nxt= marker->prev;
- if(!nxt) nxt= text->markers.last;
+ if (qual & LR_SHIFTKEY) {
+ nxt = marker->prev;
+ if (!nxt) nxt = text->markers.last;
}
else {
- nxt= marker->next;
- if(!nxt) nxt= text->markers.first;
+ nxt = marker->next;
+ if (!nxt) nxt = text->markers.first;
}
- if(marker->flags & TMARK_TEMP) {
- if(nxt==marker) nxt= NULL;
+ if (marker->flags & TMARK_TEMP) {
+ if (nxt == marker) nxt = NULL;
BLI_freelinkN(&text->markers, marker);
}
- mrk= nxt;
- if(mrk) {
+ mrk = nxt;
+ if (mrk) {
txt_move_to(text, mrk->lineno, mrk->start, 0);
txt_move_to(text, mrk->lineno, mrk->end, 1);
// XXX text_update_cursor_moved(C);
// XXX WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text);
}
- swallow= 1;
- draw= 1;
+ swallow = 1;
+ draw = 1;
break;
/* Events that should clear markers */
- case UKEY: if(!(qual & LR_ALTKEY)) break;
- case ZKEY: if(evnt==ZKEY && !(qual & LR_CTRLKEY)) break;
+ case UKEY: if (!(qual & LR_ALTKEY)) break;
+ case ZKEY: if (evnt == ZKEY && !(qual & LR_CTRLKEY)) break;
case RETKEY:
case ESCKEY:
- if(marker->flags & (TMARK_EDITALL | TMARK_TEMP))
+ if (marker->flags & (TMARK_EDITALL | TMARK_TEMP))
txt_clear_markers(text, marker->group, 0);
else
BLI_freelinkN(&text->markers, marker);
- swallow= 1;
- draw= 1;
+ swallow = 1;
+ draw = 1;
break;
case RIGHTMOUSE: /* Marker context menu? */
case LEFTMOUSE:
break;
case FKEY: /* Allow find */
- if(qual & LR_SHIFTKEY) swallow= 1;
+ if (qual & LR_SHIFTKEY) swallow = 1;
break;
default:
- if(qual!=0 && qual!=LR_SHIFTKEY)
- swallow= 1; /* Swallow all other shortcut events */
+ if (qual != 0 && qual != LR_SHIFTKEY)
+ swallow = 1; /* Swallow all other shortcut events */
}
}
- if(draw)
- {}; // XXX redraw_alltext();
+ if (draw) {
+ // XXX redraw_alltext();
+ }
return swallow;
}
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index bf1b1ddc18a..5e56dfa728e 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -106,7 +106,7 @@ static void time_draw_cache(SpaceTime *stime, Object *ob)
/* iterate over pointcaches on the active object,
* add spacetimecache and vertex array for each */
- for(pid=pidlist.first; pid; pid=pid->next) {
+ for (pid=pidlist.first; pid; pid=pid->next) {
float col[4], *fp;
int i, sta = pid->cache->startframe, end = pid->cache->endframe;
int len = (end - sta + 1)*4;
@@ -130,12 +130,12 @@ static void time_draw_cache(SpaceTime *stime, Object *ob)
break;
}
- if(pid->cache->cached_frames == NULL)
+ if (pid->cache->cached_frames == NULL)
continue;
/* make sure we have stc with correct array length */
- if(stc == NULL || MEM_allocN_len(stc->array) != len*2*sizeof(float)) {
- if(stc) {
+ if (stc == NULL || MEM_allocN_len(stc->array) != len*2*sizeof(float)) {
+ if (stc) {
MEM_freeN(stc->array);
}
else {
@@ -227,7 +227,7 @@ static void time_draw_cache(SpaceTime *stime, Object *ob)
BLI_freelistN(&pidlist);
/* free excessive caches */
- while(stc) {
+ while (stc) {
SpaceTimeCache *tmp = stc->next;
BLI_remlink(&stime->caches, stc);
MEM_freeN(stc->array);
@@ -380,7 +380,7 @@ static void time_refresh(const bContext *UNUSED(C), ScrArea *sa)
{
/* find the main timeline region and refresh cache display*/
ARegion *ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
- if(ar) {
+ if (ar) {
SpaceTime *stime = (SpaceTime *)sa->spacedata.first;
time_cache_refresh(stime);
}
@@ -416,8 +416,8 @@ static void time_listener(ScrArea *sa, wmNotifier *wmn)
for (ar= sa->regionbase.first; ar; ar= ar->next) {
if (ar->regiontype==RGN_TYPE_WINDOW) {
- ar->v2d.tot.xmin= (float)(SFRA - 4);
- ar->v2d.tot.xmax= (float)(EFRA + 4);
+ ar->v2d.tot.xmin = (float)(SFRA - 4);
+ ar->v2d.tot.xmax = (float)(EFRA + 4);
break;
}
}
@@ -449,7 +449,7 @@ static void time_main_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymap */
- keymap= WM_keymap_find(wm->defaultconf, "Timeline", SPACE_TIME, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Timeline", SPACE_TIME, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -511,7 +511,7 @@ static void time_main_area_listener(ARegion *ar, wmNotifier *wmn)
/* context changes */
switch(wmn->category) {
case NC_SPACE:
- if(wmn->data == ND_SPACE_TIME)
+ if (wmn->data == ND_SPACE_TIME)
ED_region_tag_redraw(ar);
break;
@@ -551,7 +551,7 @@ static void time_header_area_listener(ARegion *ar, wmNotifier *wmn)
/* context changes */
switch(wmn->category) {
case NC_SCREEN:
- if(wmn->data==ND_ANIMPLAY)
+ if (wmn->data==ND_ANIMPLAY)
ED_region_tag_redraw(ar);
break;
@@ -567,7 +567,7 @@ static void time_header_area_listener(ARegion *ar, wmNotifier *wmn)
}
case NC_SPACE:
- if(wmn->data == ND_SPACE_TIME)
+ if (wmn->data == ND_SPACE_TIME)
ED_region_tag_redraw(ar);
break;
}
@@ -599,10 +599,10 @@ static SpaceLink *time_new(const bContext *C)
BLI_addtail(&stime->regionbase, ar);
ar->regiontype= RGN_TYPE_WINDOW;
- ar->v2d.tot.xmin= (float)(SFRA - 4);
- ar->v2d.tot.ymin= 0.0f;
- ar->v2d.tot.xmax= (float)(EFRA + 4);
- ar->v2d.tot.ymax= 50.0f;
+ ar->v2d.tot.xmin = (float)(SFRA - 4);
+ ar->v2d.tot.ymin = 0.0f;
+ ar->v2d.tot.xmax = (float)(EFRA + 4);
+ ar->v2d.tot.ymax = 50.0f;
ar->v2d.cur= ar->v2d.tot;
diff --git a/source/blender/editors/space_time/time_ops.c b/source/blender/editors/space_time/time_ops.c
index 78d903a2997..1c1f7a69865 100644
--- a/source/blender/editors/space_time/time_ops.c
+++ b/source/blender/editors/space_time/time_ops.c
@@ -56,17 +56,20 @@ static int time_set_sfra_exec (bContext *C, wmOperator *UNUSED(op))
return OPERATOR_CANCELLED;
frame= CFRA;
- /* if 'end frame' (Preview Range or Actual) is less than 'frame',
- * clamp 'frame' to 'end frame'
- */
- if (PEFRA < frame) frame= PEFRA;
-
+
/* if Preview Range is defined, set the 'start' frame for that */
if (PRVRANGEON)
scene->r.psfra= frame;
else
scene->r.sfra= frame;
+ if (PEFRA < frame) {
+ if (PRVRANGEON)
+ scene->r.pefra= frame;
+ else
+ scene->r.efra= frame;
+ }
+
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
return OPERATOR_FINISHED;
@@ -75,16 +78,16 @@ static int time_set_sfra_exec (bContext *C, wmOperator *UNUSED(op))
static void TIME_OT_start_frame_set (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Start Frame";
- ot->idname= "TIME_OT_start_frame_set";
- ot->description="Set the start frame";
+ ot->name = "Set Start Frame";
+ ot->idname = "TIME_OT_start_frame_set";
+ ot->description = "Set the start frame";
/* api callbacks */
- ot->exec= time_set_sfra_exec;
- ot->poll= ED_operator_timeline_active;
+ ot->exec = time_set_sfra_exec;
+ ot->poll = ED_operator_timeline_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
@@ -98,16 +101,18 @@ static int time_set_efra_exec (bContext *C, wmOperator *UNUSED(op))
frame= CFRA;
- /* if 'start frame' (Preview Range or Actual) is greater than 'frame',
- * clamp 'frame' to 'end frame'
- */
- if (PSFRA > frame) frame= PSFRA;
-
/* if Preview Range is defined, set the 'end' frame for that */
if (PRVRANGEON)
scene->r.pefra= frame;
else
scene->r.efra= frame;
+
+ if (PSFRA > frame) {
+ if (PRVRANGEON)
+ scene->r.psfra= frame;
+ else
+ scene->r.sfra= frame;
+ }
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
@@ -117,16 +122,16 @@ static int time_set_efra_exec (bContext *C, wmOperator *UNUSED(op))
static void TIME_OT_end_frame_set (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set End Frame";
- ot->idname= "TIME_OT_end_frame_set";
- ot->description="Set the end frame";
+ ot->name = "Set End Frame";
+ ot->idname = "TIME_OT_end_frame_set";
+ ot->description = "Set the end frame";
/* api callbacks */
- ot->exec= time_set_efra_exec;
- ot->poll= ED_operator_timeline_active;
+ ot->exec = time_set_efra_exec;
+ ot->poll = ED_operator_timeline_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ************************ View All Operator *******************************/
@@ -138,12 +143,12 @@ static int time_view_all_exec (bContext *C, wmOperator *UNUSED(op))
View2D *v2d= (ar) ? &ar->v2d : NULL;
float extra;
- if ELEM(NULL, scene, ar)
+ if (ELEM(NULL, scene, ar))
return OPERATOR_CANCELLED;
/* set extents of view to start/end frames (Preview Range too) */
- v2d->cur.xmin= (float)PSFRA;
- v2d->cur.xmax= (float)PEFRA;
+ v2d->cur.xmin = (float)PSFRA;
+ v2d->cur.xmax = (float)PEFRA;
/* we need an extra "buffer" factor on either side so that the endpoints are visible */
extra= 0.01f * (v2d->cur.xmax - v2d->cur.xmin);
@@ -159,16 +164,16 @@ static int time_view_all_exec (bContext *C, wmOperator *UNUSED(op))
static void TIME_OT_view_all (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View All";
- ot->idname= "TIME_OT_view_all";
- ot->description= "Show the entire playable frame range";
+ ot->name = "View All";
+ ot->idname = "TIME_OT_view_all";
+ ot->description = "Show the entire playable frame range";
/* api callbacks */
- ot->exec= time_view_all_exec;
- ot->poll= ED_operator_timeline_active;
+ ot->exec = time_view_all_exec;
+ ot->poll = ED_operator_timeline_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* ************************** registration **********************************/
@@ -182,7 +187,7 @@ void time_operatortypes(void)
void time_keymap(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "Timeline", SPACE_TIME, 0);
+ wmKeyMap *keymap = WM_keymap_find(keyconf, "Timeline", SPACE_TIME, 0);
WM_keymap_add_item(keymap, "TIME_OT_start_frame_set", SKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "TIME_OT_end_frame_set", EKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/space_view3d/CMakeLists.txt b/source/blender/editors/space_view3d/CMakeLists.txt
index e78bad62ba5..1bba237ed5c 100644
--- a/source/blender/editors/space_view3d/CMakeLists.txt
+++ b/source/blender/editors/space_view3d/CMakeLists.txt
@@ -69,4 +69,8 @@ endif()
add_definitions(-DGLEW_STATIC)
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_editor_space_view3d "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/space_view3d/SConscript b/source/blender/editors/space_view3d/SConscript
index 53bd7828b63..e412927f8ca 100644
--- a/source/blender/editors/space_view3d/SConscript
+++ b/source/blender/editors/space_view3d/SConscript
@@ -16,4 +16,7 @@ if env['WITH_BF_GAMEENGINE']:
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
env.BlenderLib ( 'bf_editors_space_view3d', sources, Split(incs), defines = defs, libtype=['core'], priority=[40] )
diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c
index 553a04206f7..d0e344ef0d5 100644
--- a/source/blender/editors/space_view3d/drawanimviz.c
+++ b/source/blender/editors/space_view3d/drawanimviz.c
@@ -70,7 +70,7 @@
/* Set up drawing environment for drawing motion paths */
void draw_motion_paths_init(View3D *v3d, ARegion *ar)
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
@@ -79,15 +79,15 @@ void draw_motion_paths_init(View3D *v3d, ARegion *ar)
}
/* Draw the given motion path for an Object or a Bone
- * - assumes that the viewport has already been initialised properly
+ * - assumes that the viewport has already been initialized properly
* i.e. draw_motion_paths_init() has been called
*/
void draw_motion_path_instance(Scene *scene,
- Object *ob, bPoseChannel *pchan, bAnimVizSettings *avs, bMotionPath *mpath)
+ Object *ob, bPoseChannel *pchan, bAnimVizSettings *avs, bMotionPath *mpath)
{
//RegionView3D *rv3d= ar->regiondata;
bMotionPathVert *mpv, *mpv_start;
- int i, stepsize= avs->path_step;
+ int i, stepsize = avs->path_step;
int sfra, efra, len;
@@ -99,21 +99,21 @@ void draw_motion_path_instance(Scene *scene,
* the current frame to draw. However, this range is still
* restricted by the limits of the original path.
*/
- sfra= CFRA - avs->path_bc;
- efra= CFRA + avs->path_ac;
- if (sfra < mpath->start_frame) sfra= mpath->start_frame;
- if (efra > mpath->end_frame) efra= mpath->end_frame;
+ sfra = CFRA - avs->path_bc;
+ efra = CFRA + avs->path_ac;
+ if (sfra < mpath->start_frame) sfra = mpath->start_frame;
+ if (efra > mpath->end_frame) efra = mpath->end_frame;
- len= efra - sfra;
+ len = efra - sfra;
- sind= sfra - mpath->start_frame;
- mpv_start= (mpath->points + sind);
+ sind = sfra - mpath->start_frame;
+ mpv_start = (mpath->points + sind);
}
else {
- sfra= mpath->start_frame;
+ sfra = mpath->start_frame;
efra = sfra + mpath->length;
len = mpath->length;
- mpv_start= mpath->points;
+ mpv_start = mpath->points;
}
if (len <= 0) {
@@ -124,17 +124,17 @@ void draw_motion_path_instance(Scene *scene,
glShadeModel(GL_SMOOTH);
glBegin(GL_LINE_STRIP);
- for (i=0, mpv=mpv_start; i < len; i++, mpv++) {
- short sel= (pchan) ? (pchan->bone->flag & BONE_SELECTED) : (ob->flag & SELECT);
+ for (i = 0, mpv = mpv_start; i < len; i++, mpv++) {
+ short sel = (pchan) ? (pchan->bone->flag & BONE_SELECTED) : (ob->flag & SELECT);
float intensity; /* how faint */
/* set color
- * - more intense for active/selected bones, less intense for unselected bones
- * - black for before current frame, green for current frame, blue for after current frame
- * - intensity decreases as distance from current frame increases
+ * - more intense for active/selected bones, less intense for unselected bones
+ * - black for before current frame, green for current frame, blue for after current frame
+ * - intensity decreases as distance from current frame increases
*/
- #define SET_INTENSITY(A, B, C, min, max) (((1.0f - ((C - B) / (C - A))) * (max-min)) + min)
- if ((sfra+i) < CFRA) {
+ #define SET_INTENSITY(A, B, C, min, max) (((1.0f - ((C - B) / (C - A))) * (max - min)) + min)
+ if ((sfra + i) < CFRA) {
/* black - before cfra */
if (sel) {
// intensity= 0.5f;
@@ -146,7 +146,7 @@ void draw_motion_path_instance(Scene *scene,
}
UI_ThemeColorBlend(TH_WIRE, TH_BACK, intensity);
}
- else if ((sfra+i) > CFRA) {
+ else if ((sfra + i) > CFRA) {
/* blue - after cfra */
if (sel) {
//intensity = 0.5f;
@@ -161,10 +161,10 @@ void draw_motion_path_instance(Scene *scene,
else {
/* green - on cfra */
if (sel) {
- intensity= 0.5f;
+ intensity = 0.5f;
}
else {
- intensity= 0.99f;
+ intensity = 0.99f;
}
UI_ThemeColorBlendShade(TH_CFRAME, TH_BACK, intensity, 10);
}
@@ -179,62 +179,64 @@ void draw_motion_path_instance(Scene *scene,
glPointSize(1.0);
/* draw little black point at each frame
- * NOTE: this is not really visible/noticable
+ * NOTE: this is not really visible/noticeable
*/
glBegin(GL_POINTS);
- for (i=0, mpv=mpv_start; i < len; i++, mpv++)
+ for (i = 0, mpv = mpv_start; i < len; i++, mpv++)
glVertex3fv(mpv->co);
glEnd();
/* Draw little white dots at each framestep value */
UI_ThemeColor(TH_TEXT_HI);
glBegin(GL_POINTS);
- for (i=0, mpv=mpv_start; i < len; i+=stepsize, mpv+=stepsize)
+ for (i = 0, mpv = mpv_start; i < len; i += stepsize, mpv += stepsize)
glVertex3fv(mpv->co);
glEnd();
/* 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);
glBegin(GL_POINTS);
- mpv = mpv_start + (CFRA - sfra);
- glVertex3fv(mpv->co);
+ mpv = mpv_start + (CFRA - sfra);
+ glVertex3fv(mpv->co);
glEnd();
glPointSize(1.0f);
UI_ThemeColor(TH_TEXT_HI);
}
- // XXX, this isnt up to date but probably should be kept so.
+ // XXX, this isn't up to date but probably should be kept so.
invert_m4_m4(ob->imat, ob->obmat);
/* Draw frame numbers at each framestep value */
if (avs->path_viewflag & MOTIONPATH_VIEW_FNUMS) {
unsigned char col[4];
UI_GetThemeColor3ubv(TH_TEXT_HI, col);
- col[3]= 255;
+ col[3] = 255;
- for (i=0, mpv=mpv_start; i < len; i+=stepsize, mpv+=stepsize) {
+ for (i = 0, mpv = mpv_start; i < len; i += stepsize, mpv += stepsize) {
char numstr[32];
float co[3];
/* only draw framenum if several consecutive highlighted points don't occur on same point */
if (i == 0) {
- sprintf(numstr, "%d", (i+sfra));
+ sprintf(numstr, "%d", (i + sfra));
mul_v3_m4v3(co, ob->imat, mpv->co);
- view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col);
+ view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE | V3D_CACHE_TEXT_ASCII, col);
}
- else if ((i > stepsize) && (i < len-stepsize)) {
+ else if ((i > stepsize) && (i < len - stepsize)) {
bMotionPathVert *mpvP = (mpv - stepsize);
bMotionPathVert *mpvN = (mpv + stepsize);
- if ((equals_v3v3(mpv->co, mpvP->co)==0) || (equals_v3v3(mpv->co, mpvN->co)==0)) {
- sprintf(numstr, "%d", (sfra+i));
+ if ((equals_v3v3(mpv->co, mpvP->co) == 0) || (equals_v3v3(mpv->co, mpvN->co) == 0)) {
+ sprintf(numstr, "%d", (sfra + i));
mul_v3_m4v3(co, ob->imat, mpv->co);
- view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col);
+ view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE | V3D_CACHE_TEXT_ASCII, col);
}
}
}
@@ -244,7 +246,7 @@ void draw_motion_path_instance(Scene *scene,
if (avs->path_viewflag & MOTIONPATH_VIEW_KFRAS) {
unsigned char col[4];
- AnimData *adt= BKE_animdata_from_id(&ob->id);
+ AnimData *adt = BKE_animdata_from_id(&ob->id);
DLRBT_Tree keys;
/* build list of all keyframes in active action for object or pchan */
@@ -254,8 +256,8 @@ void draw_motion_path_instance(Scene *scene,
/* it is assumed that keyframes for bones are all grouped in a single group
* unless an option is set to always use the whole action
*/
- if ((pchan) && (avs->path_viewflag & MOTIONPATH_VIEW_KFACT)==0) {
- bActionGroup *agrp= action_groups_find_named(adt->action, pchan->name);
+ if ((pchan) && (avs->path_viewflag & MOTIONPATH_VIEW_KFACT) == 0) {
+ bActionGroup *agrp = action_groups_find_named(adt->action, pchan->name);
if (agrp) {
agroup_to_keylist(adt, agrp, &keys, NULL);
@@ -270,14 +272,14 @@ void draw_motion_path_instance(Scene *scene,
/* Draw slightly-larger yellow dots at each keyframe */
UI_GetThemeColor3ubv(TH_VERTEX_SELECT, col);
- col[3]= 255;
+ col[3] = 255;
glPointSize(4.0f); // XXX perhaps a bit too big
glColor3ubv(col);
glBegin(GL_POINTS);
- for (i=0, mpv=mpv_start; i < len; i++, mpv++) {
- float mframe= (float)(sfra + i);
+ for (i = 0, mpv = mpv_start; i < len; i++, mpv++) {
+ float mframe = (float)(sfra + i);
if (BLI_dlrbTree_search_exact(&keys, compare_ak_cfraPtr, &mframe))
glVertex3fv(mpv->co);
@@ -289,15 +291,15 @@ void draw_motion_path_instance(Scene *scene,
/* Draw frame numbers of keyframes */
if (avs->path_viewflag & MOTIONPATH_VIEW_KFNOS) {
float co[3];
- for (i=0, mpv=mpv_start; i < len; i++, mpv++) {
- float mframe= (float)(sfra + i);
+ for (i = 0, mpv = mpv_start; i < len; i++, mpv++) {
+ float mframe = (float)(sfra + i);
if (BLI_dlrbTree_search_exact(&keys, compare_ak_cfraPtr, &mframe)) {
char numstr[32];
- sprintf(numstr, "%d", (sfra+i));
+ sprintf(numstr, "%d", (sfra + i));
mul_v3_m4v3(co, ob->imat, mpv->co);
- view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col);
+ view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE | V3D_CACHE_TEXT_ASCII, col);
}
}
}
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index 705b3c52d4b..fec93b3b9aa 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -72,30 +72,30 @@
/* *************** Armature Drawing - Coloring API ***************************** */
/* global here is reset before drawing each bone */
-static ThemeWireColor *bcolor= NULL;
+static ThemeWireColor *bcolor = NULL;
/* values of colCode for set_pchan_glcolor */
enum {
- PCHAN_COLOR_NORMAL = 0, /* normal drawing */
- PCHAN_COLOR_SOLID, /* specific case where "solid" color is needed */
- PCHAN_COLOR_CONSTS, /* "constraint" colors (which may/may-not be suppressed) */
-
- PCHAN_COLOR_SPHEREBONE_BASE, /* for the 'stick' of sphere (envelope) bones */
- PCHAN_COLOR_SPHEREBONE_END, /* for the ends of sphere (envelope) bones */
- PCHAN_COLOR_LINEBONE /* for the middle of line-bones */
+ PCHAN_COLOR_NORMAL = 0, /* normal drawing */
+ PCHAN_COLOR_SOLID, /* specific case where "solid" color is needed */
+ PCHAN_COLOR_CONSTS, /* "constraint" colors (which may/may-not be suppressed) */
+
+ PCHAN_COLOR_SPHEREBONE_BASE, /* for the 'stick' of sphere (envelope) bones */
+ PCHAN_COLOR_SPHEREBONE_END, /* for the ends of sphere (envelope) bones */
+ PCHAN_COLOR_LINEBONE /* for the middle of line-bones */
};
/* This function sets the color-set for coloring a certain bone */
-static void set_pchan_colorset (Object *ob, bPoseChannel *pchan)
+static void set_pchan_colorset(Object *ob, bPoseChannel *pchan)
{
- bPose *pose= (ob) ? ob->pose : NULL;
- bArmature *arm= (ob) ? ob->data : NULL;
- bActionGroup *grp= NULL;
- short color_index= 0;
+ bPose *pose = (ob) ? ob->pose : NULL;
+ bArmature *arm = (ob) ? ob->data : NULL;
+ bActionGroup *grp = NULL;
+ short color_index = 0;
/* sanity check */
if (ELEM4(NULL, ob, arm, pose, pchan)) {
- bcolor= NULL;
+ bcolor = NULL;
return;
}
@@ -105,9 +105,9 @@ static void set_pchan_colorset (Object *ob, bPoseChannel *pchan)
* has been set to use one
*/
if (pchan->agrp_index) {
- grp= (bActionGroup *)BLI_findlink(&pose->agroups, (pchan->agrp_index - 1));
+ grp = (bActionGroup *)BLI_findlink(&pose->agroups, (pchan->agrp_index - 1));
if (grp)
- color_index= grp->customCol;
+ color_index = grp->customCol;
}
}
@@ -115,173 +115,181 @@ static void set_pchan_colorset (Object *ob, bPoseChannel *pchan)
* color set (based on the theme colors for 3d-view) is used.
*/
if (color_index > 0) {
- bTheme *btheme= UI_GetTheme();
- bcolor= &btheme->tarm[(color_index - 1)];
+ bTheme *btheme = UI_GetTheme();
+ bcolor = &btheme->tarm[(color_index - 1)];
}
else if (color_index == -1) {
/* use the group's own custom color set */
- bcolor= (grp)? &grp->cs : NULL;
+ bcolor = (grp) ? &grp->cs : NULL;
}
else
- bcolor= NULL;
+ bcolor = NULL;
}
/* This function is for brightening/darkening a given color (like UI_ThemeColorShade()) */
-static void cp_shade_color3ub (unsigned char cp[3], const int offset)
+static void cp_shade_color3ub(unsigned char cp[3], const int offset)
{
int r, g, b;
- r= offset + (int) cp[0];
+ r = offset + (int) cp[0];
CLAMP(r, 0, 255);
- g= offset + (int) cp[1];
+ g = offset + (int) cp[1];
CLAMP(g, 0, 255);
- b= offset + (int) cp[2];
+ b = offset + (int) cp[2];
CLAMP(b, 0, 255);
- cp[0]= r;
- cp[1]= g;
- cp[2]= b;
+ cp[0] = r;
+ cp[1] = g;
+ cp[2] = b;
}
/* This function sets the gl-color for coloring a certain bone (based on bcolor) */
-static short set_pchan_glColor (short colCode, int boneflag, short constflag)
+static short set_pchan_glColor(short colCode, int boneflag, short constflag)
{
switch (colCode) {
- case PCHAN_COLOR_NORMAL:
- {
- if (bcolor) {
- unsigned char cp[3];
+ case PCHAN_COLOR_NORMAL:
+ {
+ if (bcolor) {
+ unsigned char cp[3];
- if (boneflag & BONE_DRAW_ACTIVE) {
- copy_v3_v3_char((char *)cp, bcolor->active);
- if (!(boneflag & BONE_SELECTED)) {
- cp_shade_color3ub(cp, -80);
+ if (boneflag & BONE_DRAW_ACTIVE) {
+ copy_v3_v3_char((char *)cp, bcolor->active);
+ if (!(boneflag & BONE_SELECTED)) {
+ cp_shade_color3ub(cp, -80);
+ }
}
- }
- else if (boneflag & BONE_SELECTED) {
- copy_v3_v3_char((char *)cp, bcolor->select);
+ else if (boneflag & BONE_SELECTED) {
+ copy_v3_v3_char((char *)cp, bcolor->select);
+ }
+ else {
+ /* a bit darker than solid */
+ copy_v3_v3_char((char *)cp, bcolor->solid);
+ cp_shade_color3ub(cp, -50);
+ }
+
+ glColor3ubv(cp);
}
else {
- /* a bit darker than solid */
- copy_v3_v3_char((char *)cp, bcolor->solid);
- cp_shade_color3ub(cp, -50);
+ if ((boneflag & BONE_DRAW_ACTIVE) && (boneflag & BONE_SELECTED)) {
+ UI_ThemeColorShade(TH_BONE_POSE, 40);
+ }
+ else if (boneflag & BONE_DRAW_ACTIVE) {
+ UI_ThemeColorBlend(TH_WIRE, TH_BONE_POSE, 0.15f); /* unselected active */
+ }
+ else if (boneflag & BONE_SELECTED) {
+ UI_ThemeColor(TH_BONE_POSE);
+ }
+ else {
+ UI_ThemeColor(TH_WIRE);
+ }
}
-
- glColor3ubv(cp);
- }
- else {
- if (boneflag & BONE_DRAW_ACTIVE && boneflag & BONE_SELECTED) UI_ThemeColorShade(TH_BONE_POSE, 40);
- else if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColorBlend(TH_WIRE, TH_BONE_POSE, 0.15f); /* unselected active */
- else if (boneflag & BONE_SELECTED) UI_ThemeColor(TH_BONE_POSE);
- else UI_ThemeColor(TH_WIRE);
- }
-
- return 1;
- }
- break;
- case PCHAN_COLOR_SOLID:
- {
- if (bcolor) {
- glColor3ubv((unsigned char *)bcolor->solid);
+ return 1;
}
- else
- UI_ThemeColor(TH_BONE_SOLID);
-
- return 1;
- }
break;
- case PCHAN_COLOR_CONSTS:
- {
- if ((bcolor == NULL) || (bcolor->flag & TH_WIRECOLOR_CONSTCOLS)) {
- if (constflag & PCHAN_HAS_TARGET) glColor4ub(255, 150, 0, 80);
- else if (constflag & PCHAN_HAS_IK) glColor4ub(255, 255, 0, 80);
- else if (constflag & PCHAN_HAS_SPLINEIK) glColor4ub(200, 255, 0, 80);
- else if (constflag & PCHAN_HAS_CONST) glColor4ub(0, 255, 120, 80);
+ case PCHAN_COLOR_SOLID:
+ {
+ if (bcolor) {
+ glColor3ubv((unsigned char *)bcolor->solid);
+ }
+ else
+ UI_ThemeColor(TH_BONE_SOLID);
return 1;
}
- else
- return 0;
- }
break;
- case PCHAN_COLOR_SPHEREBONE_BASE:
- {
- if (bcolor) {
- unsigned char cp[3];
+ case PCHAN_COLOR_CONSTS:
+ {
+ if ((bcolor == NULL) || (bcolor->flag & TH_WIRECOLOR_CONSTCOLS)) {
+ if (constflag & PCHAN_HAS_TARGET) glColor4ub(255, 150, 0, 80);
+ else if (constflag & PCHAN_HAS_IK) glColor4ub(255, 255, 0, 80);
+ else if (constflag & PCHAN_HAS_SPLINEIK) glColor4ub(200, 255, 0, 80);
+ else if (constflag & PCHAN_HAS_CONST) glColor4ub(0, 255, 120, 80);
- if (boneflag & BONE_DRAW_ACTIVE) {
- copy_v3_v3_char((char *)cp, bcolor->active);
+ return 1;
}
- else if (boneflag & BONE_SELECTED) {
- copy_v3_v3_char((char *)cp, bcolor->select);
+ else
+ return 0;
+ }
+ break;
+
+ case PCHAN_COLOR_SPHEREBONE_BASE:
+ {
+ if (bcolor) {
+ unsigned char cp[3];
+
+ if (boneflag & BONE_DRAW_ACTIVE) {
+ copy_v3_v3_char((char *)cp, bcolor->active);
+ }
+ else if (boneflag & BONE_SELECTED) {
+ copy_v3_v3_char((char *)cp, bcolor->select);
+ }
+ else {
+ copy_v3_v3_char((char *)cp, bcolor->solid);
+ }
+
+ glColor3ubv(cp);
}
else {
- copy_v3_v3_char((char *)cp, bcolor->solid);
+ if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColorShade(TH_BONE_POSE, 40);
+ else if (boneflag & BONE_SELECTED) UI_ThemeColor(TH_BONE_POSE);
+ else UI_ThemeColor(TH_BONE_SOLID);
}
- glColor3ubv(cp);
- }
- else {
- if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColorShade(TH_BONE_POSE, 40);
- else if (boneflag & BONE_SELECTED) UI_ThemeColor(TH_BONE_POSE);
- else UI_ThemeColor(TH_BONE_SOLID);
+ return 1;
}
-
- return 1;
- }
break;
- case PCHAN_COLOR_SPHEREBONE_END:
- {
- if (bcolor) {
- unsigned char cp[3];
+ case PCHAN_COLOR_SPHEREBONE_END:
+ {
+ if (bcolor) {
+ unsigned char cp[3];
+
+ if (boneflag & BONE_DRAW_ACTIVE) {
+ copy_v3_v3_char((char *)cp, bcolor->active);
+ cp_shade_color3ub(cp, 10);
+ }
+ else if (boneflag & BONE_SELECTED) {
+ copy_v3_v3_char((char *)cp, bcolor->select);
+ cp_shade_color3ub(cp, -30);
+ }
+ else {
+ copy_v3_v3_char((char *)cp, bcolor->solid);
+ cp_shade_color3ub(cp, -30);
+ }
- if (boneflag & BONE_DRAW_ACTIVE) {
- copy_v3_v3_char((char *)cp, bcolor->active);
- cp_shade_color3ub(cp, 10);
- }
- else if (boneflag & BONE_SELECTED) {
- copy_v3_v3_char((char *)cp, bcolor->select);
- cp_shade_color3ub(cp, -30);
+ glColor3ubv(cp);
}
else {
- copy_v3_v3_char((char *)cp, bcolor->solid);
- cp_shade_color3ub(cp, -30);
+ if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColorShade(TH_BONE_POSE, 10);
+ else if (boneflag & BONE_SELECTED) UI_ThemeColorShade(TH_BONE_POSE, -30);
+ else UI_ThemeColorShade(TH_BONE_SOLID, -30);
}
-
- glColor3ubv(cp);
- }
- else {
- if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColorShade(TH_BONE_POSE, 10);
- else if (boneflag & BONE_SELECTED) UI_ThemeColorShade(TH_BONE_POSE, -30);
- else UI_ThemeColorShade(TH_BONE_SOLID, -30);
}
- }
break;
- case PCHAN_COLOR_LINEBONE:
- {
- /* inner part in background color or constraint */
- if ( (constflag) && ((bcolor==NULL) || (bcolor->flag & TH_WIRECOLOR_CONSTCOLS)) ) {
- if (constflag & PCHAN_HAS_TARGET) glColor3ub(255, 150, 0);
- else if (constflag & PCHAN_HAS_IK) glColor3ub(255, 255, 0);
- else if (constflag & PCHAN_HAS_SPLINEIK) glColor3ub(200, 255, 0);
- else if (constflag & PCHAN_HAS_CONST) glColor3ub(0, 255, 120);
- else if (constflag) UI_ThemeColor(TH_BONE_POSE); /* PCHAN_HAS_ACTION */
- }
- else {
- if (bcolor) {
- char *cp= bcolor->solid;
- glColor4ub(cp[0], cp[1], cp[2], 204);
+ case PCHAN_COLOR_LINEBONE:
+ {
+ /* inner part in background color or constraint */
+ if ( (constflag) && ((bcolor == NULL) || (bcolor->flag & TH_WIRECOLOR_CONSTCOLS)) ) {
+ if (constflag & PCHAN_HAS_TARGET) glColor3ub(255, 150, 0);
+ else if (constflag & PCHAN_HAS_IK) glColor3ub(255, 255, 0);
+ else if (constflag & PCHAN_HAS_SPLINEIK) glColor3ub(200, 255, 0);
+ else if (constflag & PCHAN_HAS_CONST) glColor3ub(0, 255, 120);
+ else if (constflag) UI_ThemeColor(TH_BONE_POSE); /* PCHAN_HAS_ACTION */
+ }
+ else {
+ if (bcolor) {
+ char *cp = bcolor->solid;
+ glColor4ub(cp[0], cp[1], cp[2], 204);
+ }
+ else
+ UI_ThemeColorShade(TH_BACK, -30);
}
- else
- UI_ThemeColorShade(TH_BACK, -30);
- }
- return 1;
- }
+ return 1;
+ }
break;
}
@@ -290,58 +298,66 @@ static short set_pchan_glColor (short colCode, int boneflag, short constflag)
static void set_ebone_glColor(const unsigned int boneflag)
{
- if (boneflag & BONE_DRAW_ACTIVE && boneflag & BONE_SELECTED) UI_ThemeColor(TH_EDGE_SELECT);
- else if (boneflag & BONE_DRAW_ACTIVE) UI_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, 0.15f); /* unselected active */
- else if (boneflag & BONE_SELECTED) UI_ThemeColorShade(TH_EDGE_SELECT, -20);
- else UI_ThemeColor(TH_WIRE);
+ if ((boneflag & BONE_DRAW_ACTIVE) && (boneflag & BONE_SELECTED)) {
+ UI_ThemeColor(TH_EDGE_SELECT);
+ }
+ else if (boneflag & BONE_DRAW_ACTIVE) {
+ UI_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, 0.15f); /* unselected active */
+ }
+ else if (boneflag & BONE_SELECTED) {
+ UI_ThemeColorShade(TH_EDGE_SELECT, -20);
+ }
+ else {
+ UI_ThemeColor(TH_WIRE);
+ }
}
/* *************** Armature drawing, helper calls for parts ******************* */
/* half the cube, in Y */
static float cube[8][3] = {
-{-1.0, 0.0, -1.0},
-{-1.0, 0.0, 1.0},
-{-1.0, 1.0, 1.0},
-{-1.0, 1.0, -1.0},
-{ 1.0, 0.0, -1.0},
-{ 1.0, 0.0, 1.0},
-{ 1.0, 1.0, 1.0},
-{ 1.0, 1.0, -1.0},
+ {-1.0, 0.0, -1.0},
+ {-1.0, 0.0, 1.0},
+ {-1.0, 1.0, 1.0},
+ {-1.0, 1.0, -1.0},
+ { 1.0, 0.0, -1.0},
+ { 1.0, 0.0, 1.0},
+ { 1.0, 1.0, 1.0},
+ { 1.0, 1.0, -1.0},
};
static void drawsolidcube_size(float xsize, float ysize, float zsize)
{
- static GLuint displist=0;
- float n[3]= {0.0f};
+ static GLuint displist = 0;
+ float n[3] = {0.0f};
glScalef(xsize, ysize, zsize);
- if (displist==0) {
- displist= glGenLists(1);
+ if (displist == 0) {
+ displist = glGenLists(1);
glNewList(displist, GL_COMPILE);
glBegin(GL_QUADS);
- n[0]= -1.0;
+ n[0] = -1.0;
glNormal3fv(n);
glVertex3fv(cube[0]); glVertex3fv(cube[1]); glVertex3fv(cube[2]); glVertex3fv(cube[3]);
- n[0]=0;
- n[1]= -1.0;
+ n[0] = 0;
+ n[1] = -1.0;
glNormal3fv(n);
glVertex3fv(cube[0]); glVertex3fv(cube[4]); glVertex3fv(cube[5]); glVertex3fv(cube[1]);
- n[1]=0;
- n[0]= 1.0;
+ n[1] = 0;
+ n[0] = 1.0;
glNormal3fv(n);
glVertex3fv(cube[4]); glVertex3fv(cube[7]); glVertex3fv(cube[6]); glVertex3fv(cube[5]);
- n[0]=0;
- n[1]= 1.0;
+ n[0] = 0;
+ n[1] = 1.0;
glNormal3fv(n);
glVertex3fv(cube[7]); glVertex3fv(cube[3]); glVertex3fv(cube[2]); glVertex3fv(cube[6]);
- n[1]=0;
- n[2]= 1.0;
+ n[1] = 0;
+ n[2] = 1.0;
glNormal3fv(n);
glVertex3fv(cube[1]); glVertex3fv(cube[5]); glVertex3fv(cube[6]); glVertex3fv(cube[2]);
- n[2]= -1.0;
+ n[2] = -1.0;
glNormal3fv(n);
glVertex3fv(cube[7]); glVertex3fv(cube[4]); glVertex3fv(cube[0]); glVertex3fv(cube[3]);
glEnd();
@@ -354,15 +370,15 @@ static void drawsolidcube_size(float xsize, float ysize, float zsize)
static void drawcube_size(float xsize, float ysize, float zsize)
{
- static GLuint displist=0;
+ static GLuint displist = 0;
if (displist == 0) {
- displist= glGenLists(1);
+ displist = glGenLists(1);
glNewList(displist, GL_COMPILE);
glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[0]); glVertex3fv(cube[1]);glVertex3fv(cube[2]); glVertex3fv(cube[3]);
- glVertex3fv(cube[0]); glVertex3fv(cube[4]);glVertex3fv(cube[5]); glVertex3fv(cube[6]);
+ glVertex3fv(cube[0]); glVertex3fv(cube[1]); glVertex3fv(cube[2]); glVertex3fv(cube[3]);
+ glVertex3fv(cube[0]); glVertex3fv(cube[4]); glVertex3fv(cube[5]); glVertex3fv(cube[6]);
glVertex3fv(cube[7]); glVertex3fv(cube[4]);
glEnd();
@@ -383,17 +399,17 @@ static void drawcube_size(float xsize, float ysize, float zsize)
static void draw_bonevert(void)
{
- static GLuint displist=0;
+ static GLuint displist = 0;
if (displist == 0) {
- GLUquadricObj *qobj;
+ GLUquadricObj *qobj;
- displist= glGenLists(1);
+ displist = glGenLists(1);
glNewList(displist, GL_COMPILE);
glPushMatrix();
- qobj = gluNewQuadric();
+ qobj = gluNewQuadric();
gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
gluDisk(qobj, 0.0, 0.05, 16, 1);
@@ -414,15 +430,15 @@ static void draw_bonevert(void)
static void draw_bonevert_solid(void)
{
- static GLuint displist=0;
+ static GLuint displist = 0;
if (displist == 0) {
- GLUquadricObj *qobj;
+ GLUquadricObj *qobj;
- displist= glGenLists(1);
+ displist = glGenLists(1);
glNewList(displist, GL_COMPILE);
- qobj = gluNewQuadric();
+ qobj = gluNewQuadric();
gluQuadricDrawStyle(qobj, GLU_FILL);
glShadeModel(GL_SMOOTH);
gluSphere(qobj, 0.05, 8, 5);
@@ -435,7 +451,7 @@ static void draw_bonevert_solid(void)
glCallList(displist);
}
-static float bone_octahedral_verts[6][3]= {
+static float bone_octahedral_verts[6][3] = {
{ 0.0f, 0.0f, 0.0f},
{ 0.1f, 0.1f, 0.1f},
{ 0.1f, 0.1f, -0.1f},
@@ -444,10 +460,10 @@ static float bone_octahedral_verts[6][3]= {
{ 0.0f, 1.0f, 0.0f}
};
-static unsigned int bone_octahedral_wire_sides[8]= {0, 1, 5, 3, 0, 4, 5, 2};
-static unsigned int bone_octahedral_wire_square[8]= {1, 2, 3, 4, 1};
+static unsigned int bone_octahedral_wire_sides[8] = {0, 1, 5, 3, 0, 4, 5, 2};
+static unsigned int bone_octahedral_wire_square[8] = {1, 2, 3, 4, 1};
-static unsigned int bone_octahedral_solid_tris[8][3]= {
+static unsigned int bone_octahedral_solid_tris[8][3] = {
{2, 1, 0}, /* bottom */
{3, 2, 0},
{4, 3, 0},
@@ -460,7 +476,7 @@ static unsigned int bone_octahedral_solid_tris[8][3]= {
};
/* aligned with bone_octahedral_solid_tris */
-static float bone_octahedral_solid_normals[8][3]= {
+static float bone_octahedral_solid_normals[8][3] = {
{ 0.70710683f, -0.70710683f, 0.00000000f},
{-0.00000000f, -0.70710683f, -0.70710683f},
{-0.70710683f, -0.70710683f, 0.00000000f},
@@ -473,23 +489,23 @@ static float bone_octahedral_solid_normals[8][3]= {
static void draw_bone_octahedral(void)
{
- static GLuint displist=0;
+ static GLuint displist = 0;
if (displist == 0) {
- displist= glGenLists(1);
+ displist = glGenLists(1);
glNewList(displist, GL_COMPILE);
/* Section 1, sides */
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, bone_octahedral_verts);
glDrawElements(GL_LINE_LOOP,
- sizeof(bone_octahedral_wire_sides)/sizeof(*bone_octahedral_wire_sides),
+ sizeof(bone_octahedral_wire_sides) / sizeof(*bone_octahedral_wire_sides),
GL_UNSIGNED_INT,
bone_octahedral_wire_sides);
/* Section 1, square */
glDrawElements(GL_LINE_LOOP,
- sizeof(bone_octahedral_wire_square)/sizeof(*bone_octahedral_wire_square),
+ sizeof(bone_octahedral_wire_square) / sizeof(*bone_octahedral_wire_square),
GL_UNSIGNED_INT,
bone_octahedral_wire_square);
glDisableClientState(GL_VERTEX_ARRAY);
@@ -502,17 +518,17 @@ static void draw_bone_octahedral(void)
static void draw_bone_solid_octahedral(void)
{
- static GLuint displist=0;
+ static GLuint displist = 0;
if (displist == 0) {
int i;
- displist= glGenLists(1);
+ displist = glGenLists(1);
glNewList(displist, GL_COMPILE);
#if 1
glBegin(GL_TRIANGLES);
- for (i= 0; i < 8; i++) {
+ for (i = 0; i < 8; i++) {
glNormal3fv(bone_octahedral_solid_normals[i]);
glVertex3fv(bone_octahedral_verts[bone_octahedral_solid_tris[i][0]]);
glVertex3fv(bone_octahedral_verts[bone_octahedral_solid_tris[i][1]]);
@@ -521,12 +537,12 @@ static void draw_bone_solid_octahedral(void)
glEnd();
-#else /* not working because each vert needs a different normal */
+#else /* not working because each vert needs a different normal */
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
glNormalPointer(GL_FLOAT, 0, bone_octahedral_solid_normals);
glVertexPointer(3, GL_FLOAT, 0, bone_octahedral_verts);
- glDrawElements(GL_TRIANGLES, sizeof(bone_octahedral_solid_tris)/sizeof(unsigned int),
+ glDrawElements(GL_TRIANGLES, sizeof(bone_octahedral_solid_tris) / sizeof(unsigned int),
GL_UNSIGNED_INT, bone_octahedral_solid_tris);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
@@ -544,7 +560,7 @@ static void draw_bone_solid_octahedral(void)
static void draw_bone_points(int dt, int armflag, unsigned int boneflag, int id)
{
/* Draw root point if we are not connected */
- if ((boneflag & BONE_CONNECTED)==0) {
+ if ((boneflag & BONE_CONNECTED) == 0) {
if (id != -1)
glLoadName(id | BONESEL_ROOT);
@@ -606,7 +622,7 @@ static float si[16] = {
0.10116832f
};
/* 16 values of cos function (still same result!) */
-static float co[16] ={
+static float co[16] = {
1.00000000f,
0.97952994f, 0.91895781f,
0.82076344f, 0.68896691f,
@@ -632,25 +648,25 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
ebone->length = len_v3v3(ebone->head, ebone->tail);
/*length= ebone->length;*/ /*UNUSED*/
- tail= ebone->rad_tail;
- dist= ebone->dist;
+ tail = ebone->rad_tail;
+ dist = ebone->dist;
if (ebone->parent && (ebone->flag & BONE_CONNECTED))
- head= ebone->parent->rad_tail;
+ head = ebone->parent->rad_tail;
else
- head= ebone->rad_head;
- headvec= ebone->head;
- tailvec= ebone->tail;
+ head = ebone->rad_head;
+ headvec = ebone->head;
+ tailvec = ebone->tail;
}
else {
/*length= pchan->bone->length;*/ /*UNUSED*/
- tail= pchan->bone->rad_tail;
- dist= pchan->bone->dist;
+ tail = pchan->bone->rad_tail;
+ dist = pchan->bone->dist;
if (pchan->parent && (pchan->bone->flag & BONE_CONNECTED))
- head= pchan->parent->bone->rad_tail;
+ head = pchan->parent->bone->rad_tail;
else
- head= pchan->bone->rad_head;
- headvec= pchan->pose_head;
- tailvec= pchan->pose_tail;
+ head = pchan->bone->rad_head;
+ headvec = pchan->pose_head;
+ tailvec = pchan->pose_tail;
}
/* ***** draw it ***** */
@@ -659,24 +675,24 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
sub_v3_v3v3(dirvec, tailvec, headvec);
mul_mat3_m4_v3(smat, dirvec);
/* clear zcomp */
- dirvec[2]= 0.0f;
+ dirvec[2] = 0.0f;
if (head != tail) {
- /* correcyion when viewing along the bones axis
- * it pops in and out but better then artifacts, [#23841] */
- float view_dist= len_v2(dirvec);
+ /* correction when viewing along the bones axis
+ * it pops in and out but better then artifacts, [#23841] */
+ float view_dist = len_v2(dirvec);
if (head - view_dist > tail) {
- tailvec= headvec;
+ tailvec = headvec;
tail = head;
zero_v3(dirvec);
- dirvec[0]= 0.00001; // XXX. weak but ok
+ dirvec[0] = 0.00001; // XXX. weak but ok
}
else if (tail - view_dist > head) {
- headvec= tailvec;
+ headvec = tailvec;
head = tail;
zero_v3(dirvec);
- dirvec[0]= 0.00001; // XXX. weak but ok
+ dirvec[0] = 0.00001; // XXX. weak but ok
}
}
@@ -692,10 +708,10 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
glBegin(GL_QUAD_STRIP);
- for (a=0; a<16; a++) {
- vec[0]= - *(si+a) * dirvec[0] + *(co+a) * norvec[0];
- vec[1]= - *(si+a) * dirvec[1] + *(co+a) * norvec[1];
- vec[2]= - *(si+a) * dirvec[2] + *(co+a) * norvec[2];
+ for (a = 0; a < 16; a++) {
+ vec[0] = -*(si + a) * dirvec[0] + *(co + a) * norvec[0];
+ vec[1] = -*(si + a) * dirvec[1] + *(co + a) * norvec[1];
+ vec[2] = -*(si + a) * dirvec[2] + *(co + a) * norvec[2];
madd_v3_v3v3fl(vec1, headvec, vec, head);
madd_v3_v3v3fl(vec2, headvec, vec, head + dist);
@@ -706,10 +722,10 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
glVertex3fv(vec2);
}
- for (a=15; a>=0; a--) {
- vec[0]= *(si+a) * dirvec[0] + *(co+a) * norvec[0];
- vec[1]= *(si+a) * dirvec[1] + *(co+a) * norvec[1];
- vec[2]= *(si+a) * dirvec[2] + *(co+a) * norvec[2];
+ for (a = 15; a >= 0; a--) {
+ vec[0] = *(si + a) * dirvec[0] + *(co + a) * norvec[0];
+ vec[1] = *(si + a) * dirvec[1] + *(co + a) * norvec[1];
+ vec[2] = *(si + a) * dirvec[2] + *(co + a) * norvec[2];
madd_v3_v3v3fl(vec1, tailvec, vec, tail);
madd_v3_v3v3fl(vec2, tailvec, vec, tail + dist);
@@ -721,9 +737,9 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
}
/* make it cyclic... */
- vec[0]= - *(si) * dirvec[0] + *(co) * norvec[0];
- vec[1]= - *(si) * dirvec[1] + *(co) * norvec[1];
- vec[2]= - *(si) * dirvec[2] + *(co) * norvec[2];
+ vec[0] = -*(si) * dirvec[0] + *(co) * norvec[0];
+ vec[1] = -*(si) * dirvec[1] + *(co) * norvec[1];
+ vec[2] = -*(si) * dirvec[2] + *(co) * norvec[2];
madd_v3_v3v3fl(vec1, headvec, vec, head);
madd_v3_v3v3fl(vec2, headvec, vec, head + dist);
@@ -752,23 +768,23 @@ static void draw_sphere_bone_wire(float smat[][4], float imat[][4],
ebone->length = len_v3v3(ebone->head, ebone->tail);
/*length= ebone->length;*/ /*UNUSED*/
- tail= ebone->rad_tail;
+ tail = ebone->rad_tail;
if (ebone->parent && (boneflag & BONE_CONNECTED))
- head= ebone->parent->rad_tail;
+ head = ebone->parent->rad_tail;
else
- head= ebone->rad_head;
- headvec= ebone->head;
- tailvec= ebone->tail;
+ head = ebone->rad_head;
+ headvec = ebone->head;
+ tailvec = ebone->tail;
}
else {
/*length= pchan->bone->length;*/ /*UNUSED*/
- tail= pchan->bone->rad_tail;
+ tail = pchan->bone->rad_tail;
if ((pchan->parent) && (boneflag & BONE_CONNECTED))
- head= pchan->parent->bone->rad_tail;
+ head = pchan->parent->bone->rad_tail;
else
- head= pchan->bone->rad_head;
- headvec= pchan->pose_head;
- tailvec= pchan->pose_tail;
+ head = pchan->bone->rad_head;
+ headvec = pchan->pose_head;
+ tailvec = pchan->pose_tail;
}
/* sphere root color */
@@ -780,7 +796,7 @@ static void draw_sphere_bone_wire(float smat[][4], float imat[][4],
set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag);
/* Draw root point if we are not connected */
- if ((boneflag & BONE_CONNECTED)==0) {
+ if ((boneflag & BONE_CONNECTED) == 0) {
if (id != -1)
glLoadName(id | BONESEL_ROOT);
@@ -809,7 +825,7 @@ static void draw_sphere_bone_wire(float smat[][4], float imat[][4],
/* move vector to viewspace */
mul_mat3_m4_v3(smat, dirvec);
/* clear zcomp */
- dirvec[2]= 0.0f;
+ dirvec[2] = 0.0f;
/* move vector back */
mul_mat3_m4_v3(imat, dirvec);
@@ -849,35 +865,35 @@ static void draw_sphere_bone_wire(float smat[][4], float imat[][4],
static void draw_sphere_bone(int dt, int armflag, int boneflag, short constflag, unsigned int id,
bPoseChannel *pchan, EditBone *ebone)
{
- GLUquadricObj *qobj;
+ GLUquadricObj *qobj;
float head, tail, length;
float fac1, fac2;
glPushMatrix();
- qobj = gluNewQuadric();
+ qobj = gluNewQuadric();
/* figure out the sizes of spheres */
if (ebone) {
- length= ebone->length;
- tail= ebone->rad_tail;
+ length = ebone->length;
+ tail = ebone->rad_tail;
if (ebone->parent && (boneflag & BONE_CONNECTED))
- head= ebone->parent->rad_tail;
+ head = ebone->parent->rad_tail;
else
- head= ebone->rad_head;
+ head = ebone->rad_head;
}
else {
- length= pchan->bone->length;
- tail= pchan->bone->rad_tail;
+ length = pchan->bone->length;
+ tail = pchan->bone->rad_tail;
if (pchan->parent && (boneflag & BONE_CONNECTED))
- head= pchan->parent->bone->rad_tail;
+ head = pchan->parent->bone->rad_tail;
else
- head= pchan->bone->rad_head;
+ head = pchan->bone->rad_head;
}
/* move to z-axis space */
glRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
- if (dt==OB_SOLID) {
+ if (dt == OB_SOLID) {
/* set up solid drawing */
glEnable(GL_COLOR_MATERIAL);
glEnable(GL_LIGHTING);
@@ -896,11 +912,11 @@ static void draw_sphere_bone(int dt, int armflag, int boneflag, short constflag,
}
else if (armflag & ARM_POSEMODE)
set_pchan_glColor(PCHAN_COLOR_SPHEREBONE_END, boneflag, constflag);
- else if (dt==OB_SOLID)
+ else if (dt == OB_SOLID)
UI_ThemeColorShade(TH_BONE_SOLID, -30);
/* Draw root point if we are not connected */
- if ((boneflag & BONE_CONNECTED)==0) {
+ if ((boneflag & BONE_CONNECTED) == 0) {
if (id != -1)
glLoadName(id | BONESEL_ROOT);
gluSphere(qobj, head, 16, 10);
@@ -929,38 +945,38 @@ static void draw_sphere_bone(int dt, int armflag, int boneflag, short constflag,
else if (dt == OB_SOLID)
UI_ThemeColor(TH_BONE_SOLID);
- fac1= (length-head)/length;
- fac2= (length-tail)/length;
+ fac1 = (length - head) / length;
+ fac2 = (length - tail) / length;
- if (length > (head+tail)) {
+ if (length > (head + tail)) {
if (id != -1)
- glLoadName (id | BONESEL_BONE);
+ glLoadName(id | BONESEL_BONE);
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(-1.0f, -1.0f);
glTranslatef(0.0f, 0.0f, head);
- gluCylinder(qobj, fac1*head + (1.0f-fac1)*tail, fac2*tail + (1.0f-fac2)*head, length-head-tail, 16, 1);
+ gluCylinder(qobj, fac1 * head + (1.0f - fac1) * tail, fac2 * tail + (1.0f - fac2) * head, length - head - tail, 16, 1);
glTranslatef(0.0f, 0.0f, -head);
glDisable(GL_POLYGON_OFFSET_FILL);
/* draw sphere on extrema */
- glTranslatef(0.0f, 0.0f, length-tail);
- gluSphere(qobj, fac2*tail + (1.0f-fac2)*head, 16, 10);
- glTranslatef(0.0f, 0.0f, -length+tail);
+ glTranslatef(0.0f, 0.0f, length - tail);
+ gluSphere(qobj, fac2 * tail + (1.0f - fac2) * head, 16, 10);
+ glTranslatef(0.0f, 0.0f, -length + tail);
glTranslatef(0.0f, 0.0f, head);
- gluSphere(qobj, fac1*head + (1.0f-fac1)*tail, 16, 10);
+ gluSphere(qobj, fac1 * head + (1.0f - fac1) * tail, 16, 10);
}
else {
/* 1 sphere in center */
- glTranslatef(0.0f, 0.0f, (head + length-tail)/2.0f);
- gluSphere(qobj, fac1*head + (1.0f-fac1)*tail, 16, 10);
+ glTranslatef(0.0f, 0.0f, (head + length - tail) / 2.0f);
+ gluSphere(qobj, fac1 * head + (1.0f - fac1) * tail, 16, 10);
}
/* restore */
- if (dt==OB_SOLID) {
+ if (dt == OB_SOLID) {
glShadeModel(GL_FLAT);
glDisable(GL_LIGHTING);
glDisable(GL_COLOR_MATERIAL);
@@ -970,11 +986,11 @@ static void draw_sphere_bone(int dt, int armflag, int boneflag, short constflag,
gluDeleteQuadric(qobj);
}
-static GLubyte bm_dot6[]= {0x0, 0x18, 0x3C, 0x7E, 0x7E, 0x3C, 0x18, 0x0};
-static GLubyte bm_dot8[]= {0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C};
+static GLubyte bm_dot6[] = {0x0, 0x18, 0x3C, 0x7E, 0x7E, 0x3C, 0x18, 0x0};
+static GLubyte bm_dot8[] = {0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C};
-static GLubyte bm_dot5[]= {0x0, 0x0, 0x10, 0x38, 0x7c, 0x38, 0x10, 0x0};
-static GLubyte bm_dot7[]= {0x0, 0x38, 0x7C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38};
+static GLubyte bm_dot5[] = {0x0, 0x0, 0x10, 0x38, 0x7c, 0x38, 0x10, 0x0};
+static GLubyte bm_dot7[] = {0x0, 0x38, 0x7C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38};
static void draw_line_bone(int armflag, int boneflag, short constflag, unsigned int id,
@@ -985,15 +1001,15 @@ static void draw_line_bone(int armflag, int boneflag, short constflag, unsigned
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
if (pchan)
- length= pchan->bone->length;
+ length = pchan->bone->length;
else
- length= ebone->length;
+ length = ebone->length;
glPushMatrix();
glScalef(length, length, length);
/* this chunk not in object mode */
- if (armflag & (ARM_EDITMODE|ARM_POSEMODE)) {
+ if (armflag & (ARM_EDITMODE | ARM_POSEMODE)) {
glLineWidth(4.0f);
if (armflag & ARM_POSEMODE)
set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag);
@@ -1002,9 +1018,9 @@ static void draw_line_bone(int armflag, int boneflag, short constflag, unsigned
}
/* Draw root point if we are not connected */
- if ((boneflag & BONE_CONNECTED)==0) {
- if (G.f & G_PICKSEL) { // no bitmap in selection mode, crashes 3d cards...
- glLoadName (id | BONESEL_ROOT);
+ if ((boneflag & BONE_CONNECTED) == 0) {
+ if (G.f & G_PICKSEL) { // no bitmap in selection mode, crashes 3d cards...
+ glLoadName(id | BONESEL_ROOT);
glBegin(GL_POINTS);
glVertex3f(0.0f, 0.0f, 0.0f);
glEnd();
@@ -1016,7 +1032,7 @@ static void draw_line_bone(int armflag, int boneflag, short constflag, unsigned
}
if (id != -1)
- glLoadName((GLuint) id|BONESEL_BONE);
+ glLoadName((GLuint) id | BONESEL_BONE);
glBegin(GL_LINES);
glVertex3f(0.0f, 0.0f, 0.0f);
@@ -1038,7 +1054,7 @@ static void draw_line_bone(int armflag, int boneflag, short constflag, unsigned
/* further we send no names */
if (id != -1)
- glLoadName(id & 0xFFFF); /* object tag, for bordersel optim */
+ glLoadName(id & 0xFFFF); /* object tag, for bordersel optim */
if (armflag & ARM_POSEMODE)
set_pchan_glColor(PCHAN_COLOR_LINEBONE, boneflag, constflag);
@@ -1047,8 +1063,8 @@ static void draw_line_bone(int armflag, int boneflag, short constflag, unsigned
glLineWidth(2.0);
/*Draw root point if we are not connected */
- if ((boneflag & BONE_CONNECTED)==0) {
- if ((G.f & G_PICKSEL)==0) {
+ if ((boneflag & BONE_CONNECTED) == 0) {
+ if ((G.f & G_PICKSEL) == 0) {
/* no bitmap in selection mode, crashes 3d cards... */
if (armflag & ARM_EDITMODE) {
if (boneflag & BONE_ROOTSEL) UI_ThemeColor(TH_VERTEX_SELECT);
@@ -1069,7 +1085,7 @@ static void draw_line_bone(int armflag, int boneflag, short constflag, unsigned
glEnd();
/* tip */
- if ((G.f & G_PICKSEL)==0) {
+ if ((G.f & G_PICKSEL) == 0) {
/* no bitmap in selection mode, crashes 3d cards... */
if (armflag & ARM_EDITMODE) {
if (boneflag & BONE_TIPSEL) UI_ThemeColor(TH_VERTEX_SELECT);
@@ -1086,27 +1102,27 @@ static void draw_line_bone(int armflag, int boneflag, short constflag, unsigned
static void draw_b_bone_boxes(int dt, bPoseChannel *pchan, float xwidth, float length, float zwidth)
{
- int segments= 0;
+ int segments = 0;
if (pchan)
- segments= pchan->bone->segments;
+ segments = pchan->bone->segments;
if ((segments > 1) && (pchan)) {
- float dlen= length/(float)segments;
- Mat4 *bbone= b_bone_spline_setup(pchan, 0);
+ float dlen = length / (float)segments;
+ Mat4 *bbone = b_bone_spline_setup(pchan, 0);
int a;
- for (a=0; a<segments; a++, bbone++) {
+ for (a = 0; a < segments; a++, bbone++) {
glPushMatrix();
glMultMatrixf(bbone->mat);
- if (dt==OB_SOLID) drawsolidcube_size(xwidth, dlen, zwidth);
+ if (dt == OB_SOLID) drawsolidcube_size(xwidth, dlen, zwidth);
else drawcube_size(xwidth, dlen, zwidth);
glPopMatrix();
}
}
else {
glPushMatrix();
- if (dt==OB_SOLID) drawsolidcube_size(xwidth, length, zwidth);
+ if (dt == OB_SOLID) drawsolidcube_size(xwidth, length, zwidth);
else drawcube_size(xwidth, length, zwidth);
glPopMatrix();
}
@@ -1118,14 +1134,14 @@ static void draw_b_bone(int dt, int armflag, int boneflag, short constflag, unsi
float xwidth, length, zwidth;
if (pchan) {
- xwidth= pchan->bone->xwidth;
- length= pchan->bone->length;
- zwidth= pchan->bone->zwidth;
+ xwidth = pchan->bone->xwidth;
+ length = pchan->bone->length;
+ zwidth = pchan->bone->zwidth;
}
else {
- xwidth= ebone->xwidth;
- length= ebone->length;
- zwidth= ebone->zwidth;
+ xwidth = ebone->xwidth;
+ length = ebone->length;
+ zwidth = ebone->zwidth;
}
/* draw points only if... */
@@ -1135,7 +1151,7 @@ static void draw_b_bone(int dt, int armflag, int boneflag, short constflag, unsi
glScalef(length, length, length);
draw_bone_points(dt, armflag, boneflag, id);
glPopMatrix();
- length*= 0.95f; // make vertices visible
+ length *= 0.95f; // make vertices visible
}
/* colors for modes */
@@ -1146,7 +1162,7 @@ static void draw_b_bone(int dt, int armflag, int boneflag, short constflag, unsi
set_pchan_glColor(PCHAN_COLOR_SOLID, boneflag, constflag);
}
else if (armflag & ARM_EDITMODE) {
- if (dt==OB_WIRE) {
+ if (dt == OB_WIRE) {
set_ebone_glColor(boneflag);
}
else
@@ -1154,7 +1170,7 @@ static void draw_b_bone(int dt, int armflag, int boneflag, short constflag, unsi
}
if (id != -1) {
- glLoadName ((GLuint) id|BONESEL_BONE);
+ glLoadName((GLuint) id | BONESEL_BONE);
}
/* set up solid drawing */
@@ -1198,11 +1214,11 @@ static void draw_b_bone(int dt, int armflag, int boneflag, short constflag, unsi
static void draw_wire_bone_segments(bPoseChannel *pchan, Mat4 *bbones, float length, int segments)
{
if ((segments > 1) && (pchan)) {
- float dlen= length/(float)segments;
+ float dlen = length / (float)segments;
Mat4 *bbone = bbones;
int a;
- for (a=0; a<segments; a++, bbone++) {
+ for (a = 0; a < segments; a++, bbone++) {
glPushMatrix();
glMultMatrixf(bbone->mat);
@@ -1234,14 +1250,14 @@ static void draw_wire_bone(int dt, int armflag, int boneflag, short constflag, u
float length;
if (pchan) {
- segments= pchan->bone->segments;
- length= pchan->bone->length;
+ segments = pchan->bone->segments;
+ length = pchan->bone->length;
if (segments > 1)
bbones = b_bone_spline_setup(pchan, 0);
}
else
- length= ebone->length;
+ length = ebone->length;
/* draw points only if... */
if (armflag & ARM_EDITMODE) {
@@ -1250,19 +1266,19 @@ static void draw_wire_bone(int dt, int armflag, int boneflag, short constflag, u
glScalef(length, length, length);
draw_bone_points(dt, armflag, boneflag, id);
glPopMatrix();
- length *= 0.95f; // make vertices visible
+ length *= 0.95f; // make vertices visible
}
/* this chunk not in object mode */
- if (armflag & (ARM_EDITMODE|ARM_POSEMODE)) {
+ if (armflag & (ARM_EDITMODE | ARM_POSEMODE)) {
if (id != -1)
- glLoadName((GLuint) id|BONESEL_BONE);
+ glLoadName((GLuint) id | BONESEL_BONE);
draw_wire_bone_segments(pchan, bbones, length, segments);
/* further we send no names */
if (id != -1)
- glLoadName(id & 0xFFFF); /* object tag, for bordersel optim */
+ glLoadName(id & 0xFFFF); /* object tag, for bordersel optim */
}
/* colors for modes */
@@ -1280,8 +1296,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);
@@ -1305,7 +1321,7 @@ static void draw_bone(int dt, int armflag, int boneflag, short constflag, unsign
/* now draw the bone itself */
if (id != -1) {
- glLoadName((GLuint) id|BONESEL_BONE);
+ glLoadName((GLuint) id | BONESEL_BONE);
}
/* wire? */
@@ -1350,7 +1366,7 @@ static void draw_bone(int dt, int armflag, int boneflag, short constflag, unsign
static void draw_custom_bone(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob,
int dt, int armflag, int boneflag, unsigned int id, float length)
{
- if (ob==NULL) return;
+ if (ob == NULL) return;
glScalef(length, length, length);
@@ -1360,7 +1376,7 @@ static void draw_custom_bone(Scene *scene, View3D *v3d, RegionView3D *rv3d, Obje
}
if (id != -1) {
- glLoadName((GLuint) id|BONESEL_BONE);
+ glLoadName((GLuint) id | BONESEL_BONE);
}
draw_object_instance(scene, v3d, rv3d, ob, dt, armflag & ARM_POSEMODE);
@@ -1372,15 +1388,15 @@ static void pchan_draw_IK_root_lines(bPoseChannel *pchan, short only_temp)
bConstraint *con;
bPoseChannel *parchan;
- for (con= pchan->constraints.first; con; con= con->next) {
+ for (con = pchan->constraints.first; con; con = con->next) {
if (con->enforce == 0.0f)
continue;
switch (con->type) {
case CONSTRAINT_TYPE_KINEMATIC:
{
- bKinematicConstraint *data = (bKinematicConstraint*)con->data;
- int segcount= 0;
+ bKinematicConstraint *data = (bKinematicConstraint *)con->data;
+ int segcount = 0;
/* if only_temp, only draw if it is a temporary ik-chain */
if ((only_temp) && !(data->flag & CONSTRAINT_IK_TEMP))
@@ -1390,18 +1406,18 @@ static void pchan_draw_IK_root_lines(bPoseChannel *pchan, short only_temp)
glBegin(GL_LINES);
/* exclude tip from chain? */
- if ((data->flag & CONSTRAINT_IK_TIP)==0)
- parchan= pchan->parent;
+ if ((data->flag & CONSTRAINT_IK_TIP) == 0)
+ parchan = pchan->parent;
else
- parchan= pchan;
+ parchan = pchan;
glVertex3fv(parchan->pose_tail);
/* Find the chain's root */
while (parchan->parent) {
segcount++;
- if (segcount==data->rootbone || segcount>255) break; // 255 is weak
- parchan= parchan->parent;
+ if (segcount == data->rootbone || segcount > 255) break; // 255 is weak
+ parchan = parchan->parent;
}
if (parchan)
glVertex3fv(parchan->pose_head);
@@ -1409,24 +1425,24 @@ static void pchan_draw_IK_root_lines(bPoseChannel *pchan, short only_temp)
glEnd();
setlinestyle(0);
}
- break;
+ break;
case CONSTRAINT_TYPE_SPLINEIK:
{
- bSplineIKConstraint *data = (bSplineIKConstraint*)con->data;
- int segcount= 0;
+ bSplineIKConstraint *data = (bSplineIKConstraint *)con->data;
+ int segcount = 0;
setlinestyle(3);
glBegin(GL_LINES);
- parchan= pchan;
+ parchan = pchan;
glVertex3fv(parchan->pose_tail);
/* Find the chain's root */
while (parchan->parent) {
segcount++;
// FIXME: revise the breaking conditions
- if (segcount==data->chainlen || segcount>255) break; // 255 is weak
- parchan= parchan->parent;
+ if (segcount == data->chainlen || segcount > 255) break; // 255 is weak
+ parchan = parchan->parent;
}
if (parchan) // XXX revise the breaking conditions to only stop at the tail?
glVertex3fv(parchan->pose_head);
@@ -1434,7 +1450,7 @@ static void pchan_draw_IK_root_lines(bPoseChannel *pchan, short only_temp)
glEnd();
setlinestyle(0);
}
- break;
+ break;
}
}
}
@@ -1443,12 +1459,12 @@ static void bgl_sphere_project(float ax, float az)
{
float dir[3], sine, q3;
- sine= 1.0f - ax*ax - az*az;
- q3= (sine < 0.0f)? 0.0f: (float)(2.0*sqrt(sine));
+ sine = 1.0f - ax * ax - az * az;
+ q3 = (sine < 0.0f) ? 0.0f : (float)(2.0 * sqrt(sine));
- dir[0]= -az*q3;
- dir[1]= 1.0f - 2.0f*sine;
- dir[2]= ax*q3;
+ dir[0] = -az * q3;
+ dir[1] = 1.0f - 2.0f * sine;
+ dir[2] = ax * q3;
glVertex3fv(dir);
}
@@ -1463,7 +1479,7 @@ static void draw_dof_ellipse(float ax, float az)
0.994521895368f, 1.0f
};
- int i, j, n=16;
+ int i, j, n = 16;
float x, z, px, pz;
glEnable(GL_BLEND);
@@ -1472,33 +1488,33 @@ static void draw_dof_ellipse(float ax, float az)
glColor4ub(70, 70, 70, 50);
glBegin(GL_QUADS);
- pz= 0.0f;
- for (i=1; i<n; i++) {
- z= staticSine[i];
+ pz = 0.0f;
+ for (i = 1; i < n; i++) {
+ z = staticSine[i];
- px= 0.0f;
- for (j=1; j<n-i+1; j++) {
+ px = 0.0f;
+ for (j = 1; j < n - i + 1; j++) {
x = staticSine[j];
- if (j == n-i) {
+ if (j == n - i) {
glEnd();
glBegin(GL_TRIANGLES);
- bgl_sphere_project(ax*px, az*z);
- bgl_sphere_project(ax*px, az*pz);
- bgl_sphere_project(ax*x, az*pz);
+ bgl_sphere_project(ax * px, az * z);
+ bgl_sphere_project(ax * px, az * pz);
+ bgl_sphere_project(ax * x, az * pz);
glEnd();
glBegin(GL_QUADS);
}
else {
- bgl_sphere_project(ax*x, az*z);
- bgl_sphere_project(ax*x, az*pz);
- bgl_sphere_project(ax*px, az*pz);
- bgl_sphere_project(ax*px, az*z);
+ bgl_sphere_project(ax * x, az * z);
+ bgl_sphere_project(ax * x, az * pz);
+ bgl_sphere_project(ax * px, az * pz);
+ bgl_sphere_project(ax * px, az * z);
}
- px= x;
+ px = x;
}
- pz= z;
+ pz = z;
}
glEnd();
@@ -1508,27 +1524,27 @@ static void draw_dof_ellipse(float ax, float az)
glColor3ub(0, 0, 0);
glBegin(GL_LINE_STRIP);
- for (i=0; i<n; i++)
- bgl_sphere_project(staticSine[n-i-1]*ax, staticSine[i]*az);
+ for (i = 0; i < n; i++)
+ bgl_sphere_project(staticSine[n - i - 1] * ax, staticSine[i] * az);
glEnd();
}
static void draw_pose_dofs(Object *ob)
{
- bArmature *arm= ob->data;
+ bArmature *arm = ob->data;
bPoseChannel *pchan;
Bone *bone;
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone= pchan->bone;
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ bone = pchan->bone;
- if ( (bone) && !(bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))) {
+ if ( (bone) && !(bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG))) {
if (bone->flag & BONE_SELECTED) {
if (bone->layer & arm->layer) {
- if (pchan->ikflag & (BONE_IK_XLIMIT|BONE_IK_ZLIMIT)) {
+ if (pchan->ikflag & (BONE_IK_XLIMIT | BONE_IK_ZLIMIT)) {
if (ED_pose_channel_in_IK_chain(ob, pchan)) {
float corner[4][3], posetrans[3], mat[4][4];
- float phi=0.0f, theta=0.0f, scale;
+ float phi = 0.0f, theta = 0.0f, scale;
int a, i;
/* in parent-bone pose, but own restspace */
@@ -1539,24 +1555,24 @@ static void draw_pose_dofs(Object *ob)
if (pchan->parent) {
copy_m4_m4(mat, pchan->parent->pose_mat);
- mat[3][0]= mat[3][1]= mat[3][2]= 0.0f;
+ mat[3][0] = mat[3][1] = mat[3][2] = 0.0f;
glMultMatrixf(mat);
}
copy_m4_m3(mat, pchan->bone->bone_mat);
glMultMatrixf(mat);
- scale= bone->length*pchan->size[1];
+ scale = bone->length * pchan->size[1];
glScalef(scale, scale, scale);
if (pchan->ikflag & BONE_IK_XLIMIT) {
if (pchan->ikflag & BONE_IK_ZLIMIT) {
float amin[3], amax[3];
- for (i=0; i<3; i++) {
+ for (i = 0; i < 3; i++) {
/* *0.5f here comes from M_PI/360.0f when rotations were still in degrees */
- amin[i]= (float)sin(pchan->limitmin[i]*0.5f);
- amax[i]= (float)sin(pchan->limitmax[i]*0.5f);
+ amin[i] = (float)sin(pchan->limitmin[i] * 0.5f);
+ amax[i] = (float)sin(pchan->limitmax[i] * 0.5f);
}
glScalef(1.0f, -1.0f, 1.0f);
@@ -1575,21 +1591,21 @@ static void draw_pose_dofs(Object *ob)
/* arcs */
if (pchan->ikflag & BONE_IK_ZLIMIT) {
/* OpenGL requires rotations in degrees; so we're taking the average angle here */
- theta= RAD2DEGF(0.5f * (pchan->limitmin[2]+pchan->limitmax[2]));
+ theta = RAD2DEGF(0.5f * (pchan->limitmin[2] + pchan->limitmax[2]));
glRotatef(theta, 0.0f, 0.0f, 1.0f);
- glColor3ub(50, 50, 255); // blue, Z axis limit
+ glColor3ub(50, 50, 255); // blue, Z axis limit
glBegin(GL_LINE_STRIP);
- for (a=-16; a<=16; a++) {
+ for (a = -16; a <= 16; a++) {
/* *0.5f here comes from M_PI/360.0f when rotations were still in degrees */
- float fac= ((float)a)/16.0f * 0.5f;
+ float fac = ((float)a) / 16.0f * 0.5f;
- phi= fac * (pchan->limitmax[2] - pchan->limitmin[2]);
+ phi = fac * (pchan->limitmax[2] - pchan->limitmin[2]);
- i= (a == -16) ? 0 : 1;
- corner[i][0]= (float)sin(phi);
- corner[i][1]= (float)cos(phi);
- corner[i][2]= 0.0f;
+ i = (a == -16) ? 0 : 1;
+ corner[i][0] = (float)sin(phi);
+ corner[i][1] = (float)cos(phi);
+ corner[i][2] = 0.0f;
glVertex3fv(corner[i]);
}
glEnd();
@@ -1599,20 +1615,20 @@ static void draw_pose_dofs(Object *ob)
if (pchan->ikflag & BONE_IK_XLIMIT) {
/* OpenGL requires rotations in degrees; so we're taking the average angle here */
- theta= RAD2DEGF(0.5f * (pchan->limitmin[0] + pchan->limitmax[0]));
+ theta = RAD2DEGF(0.5f * (pchan->limitmin[0] + pchan->limitmax[0]));
glRotatef(theta, 1.0f, 0.0f, 0.0f);
- glColor3ub(255, 50, 50); // Red, X axis limit
+ glColor3ub(255, 50, 50); // Red, X axis limit
glBegin(GL_LINE_STRIP);
- for (a=-16; a<=16; a++) {
+ for (a = -16; a <= 16; a++) {
/* *0.5f here comes from M_PI/360.0f when rotations were still in degrees */
- float fac= ((float)a)/16.0f * 0.5f;
- phi= (float)(0.5*M_PI) + fac * (pchan->limitmax[0] - pchan->limitmin[0]);
+ float fac = ((float)a) / 16.0f * 0.5f;
+ phi = (float)(0.5 * M_PI) + fac * (pchan->limitmax[0] - pchan->limitmin[0]);
- i= (a == -16) ? 2 : 3;
- corner[i][0]= 0.0f;
- corner[i][1]= (float)sin(phi);
- corner[i][2]= (float)cos(phi);
+ i = (a == -16) ? 2 : 3;
+ corner[i][0] = 0.0f;
+ corner[i][1] = (float)sin(phi);
+ corner[i][2] = (float)cos(phi);
glVertex3fv(corner[i]);
}
glEnd();
@@ -1643,19 +1659,19 @@ static void bone_matrix_translate_y(float mat[][4], float y)
static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt,
const short is_ghost, const short is_outline)
{
- RegionView3D *rv3d= ar->regiondata;
- Object *ob= base->object;
- bArmature *arm= ob->data;
+ RegionView3D *rv3d = ar->regiondata;
+ Object *ob = base->object;
+ bArmature *arm = ob->data;
bPoseChannel *pchan;
Bone *bone;
GLfloat tmp;
float smat[4][4], imat[4][4], bmat[4][4];
- int index= -1;
- short do_dashed= 3, draw_wire= 0;
+ int index = -1;
+ short do_dashed = 3, draw_wire = 0;
int flag;
/* being set below */
- arm->layer_used= 0;
+ arm->layer_used = 0;
/* hacky... prevent outline select from drawing dashed helplines */
glGetFloatv(GL_LINE_WIDTH, &tmp);
@@ -1663,10 +1679,10 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
if (v3d->flag & V3D_HIDE_HELPLINES) do_dashed &= ~2;
/* precalc inverse matrix for drawing screen aligned */
- if (arm->drawtype==ARM_ENVELOPE) {
+ if (arm->drawtype == ARM_ENVELOPE) {
/* precalc inverse matrix for drawing screen aligned */
copy_m4_m4(smat, rv3d->viewmatob);
- mul_mat3_m4_fl(smat, 1.0f/len_v3(ob->obmat[0]));
+ mul_mat3_m4_fl(smat, 1.0f / len_v3(ob->obmat[0]));
invert_m4_m4(imat, smat);
/* and draw blended distances */
@@ -1676,14 +1692,14 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone= pchan->bone;
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ bone = pchan->bone;
if (bone) {
/* 1) bone must be visible, 2) for OpenGL select-drawing cannot have unselectable [#27194]
* NOTE: this is the only case with NO_DEFORM==0 flag, as this is for envelope influence drawing
*/
- if ( (bone->flag & (BONE_HIDDEN_P|BONE_NO_DEFORM|BONE_HIDDEN_PG))==0 &&
- ((G.f & G_PICKSEL)==0 || (bone->flag & BONE_UNSELECTABLE)==0) )
+ if ( (bone->flag & (BONE_HIDDEN_P | BONE_NO_DEFORM | BONE_HIDDEN_PG)) == 0 &&
+ ((G.f & G_PICKSEL) == 0 || (bone->flag & BONE_UNSELECTABLE) == 0) )
{
if (bone->flag & (BONE_SELECTED)) {
if (bone->layer & arm->layer)
@@ -1706,15 +1722,15 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
/* if solid we draw that first, with selection codes, but without names, axes etc */
if (dt > OB_WIRE) {
if (arm->flag & ARM_POSEMODE)
- index= base->selcol;
+ index = base->selcol;
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone= pchan->bone;
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ bone = pchan->bone;
arm->layer_used |= bone->layer;
/* 1) bone must be visible, 2) for OpenGL select-drawing cannot have unselectable [#27194] */
- if ( (bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))==0 &&
- ((G.f & G_PICKSEL)==0 || (bone->flag & BONE_UNSELECTABLE)==0) )
+ if ( (bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0 &&
+ ((G.f & G_PICKSEL) == 0 || (bone->flag & BONE_UNSELECTABLE) == 0) )
{
if (bone->layer & arm->layer) {
int use_custom = (pchan->custom) && !(arm->flag & ARM_NO_CUSTOM);
@@ -1728,8 +1744,8 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
}
/* catch exception for bone with hidden parent */
- flag= bone->flag;
- if ( (bone->parent) && (bone->parent->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG)) )
+ flag = bone->flag;
+ if ( (bone->parent) && (bone->parent->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) )
flag &= ~BONE_CONNECTED;
/* set temporary flag for drawing bone as active, but only if selected */
@@ -1742,56 +1758,61 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
if (use_custom) {
/* if drawwire, don't try to draw in solid */
if (pchan->bone->flag & BONE_DRAWWIRE) {
- draw_wire= 1;
+ draw_wire = 1;
}
else {
draw_custom_bone(scene, v3d, rv3d, pchan->custom,
OB_SOLID, arm->flag, flag, index, bone->length);
}
}
- else if (arm->drawtype==ARM_LINE)
- ; /* nothing in solid */
- else if (arm->drawtype==ARM_WIRE)
- ; /* nothing in solid */
- else if (arm->drawtype==ARM_ENVELOPE)
+ else if (arm->drawtype == ARM_LINE) {
+ /* nothing in solid */
+ }
+ else if (arm->drawtype == ARM_WIRE) {
+ /* nothing in solid */
+ }
+ else if (arm->drawtype == ARM_ENVELOPE) {
draw_sphere_bone(OB_SOLID, arm->flag, flag, 0, index, pchan, NULL);
- else if (arm->drawtype==ARM_B_BONE)
+ }
+ else if (arm->drawtype == ARM_B_BONE) {
draw_b_bone(OB_SOLID, arm->flag, flag, 0, index, pchan, NULL);
- else
+ }
+ else {
draw_bone(OB_SOLID, arm->flag, flag, 0, index, bone->length);
+ }
glPopMatrix();
}
}
- if (index!= -1)
- index+= 0x10000; // pose bones count in higher 2 bytes only
+ if (index != -1)
+ index += 0x10000; // pose bones count in higher 2 bytes only
}
/* very very confusing... but in object mode, solid draw, we cannot do glLoadName yet,
* stick bones and/or wire custom-shapes are drawn in next loop
*/
- if (ELEM(arm->drawtype,ARM_LINE,ARM_WIRE)==0 && (draw_wire == 0)) {
+ if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE) == 0 && (draw_wire == 0)) {
/* object tag, for bordersel optim */
glLoadName(index & 0xFFFF);
- index= -1;
+ index = -1;
}
}
/* draw custom bone shapes as wireframes */
- if ( !(arm->flag & ARM_NO_CUSTOM) &&
- ((draw_wire) || (dt <= OB_WIRE)) )
+ if (!(arm->flag & ARM_NO_CUSTOM) &&
+ ((draw_wire) || (dt <= OB_WIRE)) )
{
if (arm->flag & ARM_POSEMODE)
- index= base->selcol;
+ index = base->selcol;
/* only draw custom bone shapes that need to be drawn as wires */
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone= pchan->bone;
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ bone = pchan->bone;
/* 1) bone must be visible, 2) for OpenGL select-drawing cannot have unselectable [#27194] */
- if ( (bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))==0 &&
- ((G.f & G_PICKSEL)==0 || (bone->flag & BONE_UNSELECTABLE)==0) )
+ if ( (bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0 &&
+ ((G.f & G_PICKSEL) == 0 || (bone->flag & BONE_UNSELECTABLE) == 0) )
{
if (bone->layer & arm->layer) {
if (pchan->custom) {
@@ -1812,19 +1833,19 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
else if (arm->flag & ARM_POSEMODE)
set_pchan_colorset(ob, pchan);
else {
- if ((scene->basact)==base) {
- if (base->flag & (SELECT+BA_WAS_SEL)) UI_ThemeColor(TH_ACTIVE);
+ if ((scene->basact) == base) {
+ if (base->flag & (SELECT + BA_WAS_SEL)) UI_ThemeColor(TH_ACTIVE);
else UI_ThemeColor(TH_WIRE);
}
else {
- if (base->flag & (SELECT+BA_WAS_SEL)) UI_ThemeColor(TH_SELECT);
+ if (base->flag & (SELECT + BA_WAS_SEL)) UI_ThemeColor(TH_SELECT);
else UI_ThemeColor(TH_WIRE);
}
}
/* catch exception for bone with hidden parent */
- flag= bone->flag;
- if ((bone->parent) && (bone->parent->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG)))
+ flag = bone->flag;
+ if ((bone->parent) && (bone->parent->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)))
flag &= ~BONE_CONNECTED;
/* set temporary flag for drawing bone as active, but only if selected */
@@ -1841,22 +1862,22 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
}
if (index != -1)
- index+= 0x10000; // pose bones count in higher 2 bytes only
+ index += 0x10000; // pose bones count in higher 2 bytes only
}
- /* stick or wire bones have not been drawn yet so dont clear object selection in this case */
- if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE)==0 && draw_wire) {
+ /* stick or wire bones have not been drawn yet so don't clear object selection in this case */
+ if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE) == 0 && draw_wire) {
/* object tag, for bordersel optim */
glLoadName(index & 0xFFFF);
- index= -1;
+ index = -1;
}
}
/* wire draw over solid only in posemode */
if ((dt <= OB_WIRE) || (arm->flag & ARM_POSEMODE) || ELEM(arm->drawtype, ARM_LINE, ARM_WIRE)) {
/* draw line check first. we do selection indices */
- if ELEM(arm->drawtype, ARM_LINE, ARM_WIRE) {
+ if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE)) {
if (arm->flag & ARM_POSEMODE)
- index= base->selcol;
+ index = base->selcol;
}
/* if solid && posemode, we draw again with polygonoffset */
else if ((dt > OB_WIRE) && (arm->flag & ARM_POSEMODE)) {
@@ -1865,26 +1886,26 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
else {
/* and we use selection indices if not done yet */
if (arm->flag & ARM_POSEMODE)
- index= base->selcol;
+ index = base->selcol;
}
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone= pchan->bone;
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ bone = pchan->bone;
arm->layer_used |= bone->layer;
/* 1) bone must be visible, 2) for OpenGL select-drawing cannot have unselectable [#27194] */
- if ( (bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))==0 &&
- ((G.f & G_PICKSEL)==0 || (bone->flag & BONE_UNSELECTABLE)==0) )
+ if ( (bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0 &&
+ ((G.f & G_PICKSEL) == 0 || (bone->flag & BONE_UNSELECTABLE) == 0) )
{
if (bone->layer & arm->layer) {
- const short constflag= pchan->constflag;
+ const short constflag = pchan->constflag;
if ((do_dashed & 1) && (pchan->parent)) {
/* Draw a line from our root to the parent's tip
* - only if V3D_HIDE_HELPLINES is enabled...
*/
- if ( (do_dashed & 2) && ((bone->flag & BONE_CONNECTED)==0) ) {
+ if ( (do_dashed & 2) && ((bone->flag & BONE_CONNECTED) == 0) ) {
if (arm->flag & ARM_POSEMODE) {
- glLoadName(index & 0xFFFF); // object tag, for bordersel optim
+ glLoadName(index & 0xFFFF); // object tag, for bordersel optim
UI_ThemeColor(TH_WIRE);
}
setlinestyle(3);
@@ -1896,13 +1917,13 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
}
/* Draw a line to IK root bone
- * - only if temporary chain (i.e. "autoik")
+ * - only if temporary chain (i.e. "autoik")
*/
if (arm->flag & ARM_POSEMODE) {
if (constflag & PCHAN_HAS_IK) {
if (bone->flag & BONE_SELECTED) {
if (constflag & PCHAN_HAS_TARGET) glColor3ub(200, 120, 0);
- else glColor3ub(200, 200, 50); // add theme!
+ else glColor3ub(200, 200, 50); // add theme!
glLoadName(index & 0xFFFF);
pchan_draw_IK_root_lines(pchan, !(do_dashed & 2));
@@ -1910,7 +1931,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
}
else if (constflag & PCHAN_HAS_SPLINEIK) {
if (bone->flag & BONE_SELECTED) {
- glColor3ub(150, 200, 50); // add theme!
+ glColor3ub(150, 200, 50); // add theme!
glLoadName(index & 0xFFFF);
pchan_draw_IK_root_lines(pchan, !(do_dashed & 2));
@@ -1924,8 +1945,8 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
glMultMatrixf(pchan->pose_mat);
/* catch exception for bone with hidden parent */
- flag= bone->flag;
- if ((bone->parent) && (bone->parent->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG)))
+ flag = bone->flag;
+ if ((bone->parent) && (bone->parent->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)))
flag &= ~BONE_CONNECTED;
/* set temporary flag for drawing bone as active, but only if selected */
@@ -1937,17 +1958,18 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
/* set color-set to use */
set_pchan_colorset(ob, pchan);
- if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM))
- ; // custom bone shapes should not be drawn here!
- else if (arm->drawtype==ARM_ENVELOPE) {
+ if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM)) {
+ /* custom bone shapes should not be drawn here! */
+ }
+ else if (arm->drawtype == ARM_ENVELOPE) {
if (dt < OB_SOLID)
draw_sphere_bone_wire(smat, imat, arm->flag, flag, constflag, index, pchan, NULL);
}
- else if (arm->drawtype==ARM_LINE)
+ else if (arm->drawtype == ARM_LINE)
draw_line_bone(arm->flag, flag, constflag, index, pchan, NULL);
- else if (arm->drawtype==ARM_WIRE)
+ else if (arm->drawtype == ARM_WIRE)
draw_wire_bone(dt, arm->flag, flag, constflag, index, pchan, NULL);
- else if (arm->drawtype==ARM_B_BONE)
+ else if (arm->drawtype == ARM_B_BONE)
draw_b_bone(OB_WIRE, arm->flag, flag, constflag, index, pchan, NULL);
else
draw_bone(OB_WIRE, arm->flag, flag, constflag, index, bone->length);
@@ -1958,10 +1980,10 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
/* pose bones count in higher 2 bytes only */
if (index != -1)
- index+= 0x10000;
+ index += 0x10000;
}
/* restore things */
- if (!ELEM(arm->drawtype, ARM_WIRE, ARM_LINE) && (dt>OB_WIRE) && (arm->flag & ARM_POSEMODE))
+ if (!ELEM(arm->drawtype, ARM_WIRE, ARM_LINE) && (dt > OB_WIRE) && (arm->flag & ARM_POSEMODE))
bglPolygonOffset(rv3d->dist, 0.0);
}
@@ -1973,31 +1995,31 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
draw_pose_dofs(ob);
/* finally names and axes */
- if (arm->flag & (ARM_DRAWNAMES|ARM_DRAWAXES) && is_outline == 0) {
+ if ((arm->flag & (ARM_DRAWNAMES | ARM_DRAWAXES)) && (is_outline == 0)) {
/* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */
if ((G.f & G_PICKSEL) == 0) {
float vec[3];
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;
+ col[3] = 255;
if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
- for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) {
- if ((pchan->bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))==0) {
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ if ((pchan->bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0) {
if (pchan->bone->layer & arm->layer) {
- if (arm->flag & (ARM_EDITMODE|ARM_POSEMODE)) {
- bone= pchan->bone;
+ if (arm->flag & (ARM_EDITMODE | ARM_POSEMODE)) {
+ bone = pchan->bone;
UI_GetThemeColor3ubv((bone->flag & BONE_SELECTED) ? TH_TEXT_HI : TH_TEXT, col);
}
else if (dt > OB_WIRE) {
UI_GetThemeColor3ubv(TH_TEXT, col);
}
- /* Draw names of bone */
+ /* Draw names of bone */
if (arm->flag & ARM_DRAWNAMES) {
mid_v3_v3v3(vec, pchan->pose_head, pchan->pose_tail);
view3d_cached_text_draw_add(vec, pchan->name, 10, 0, col);
@@ -2011,7 +2033,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
glMultMatrixf(bmat);
glColor3ubv(col);
- drawaxes(pchan->bone->length*0.25f, OB_ARROWS);
+ drawaxes(pchan->bone->length * 0.25f, OB_ARROWS);
glPopMatrix();
}
@@ -2027,13 +2049,13 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
/* in editmode, we don't store the bone matrix... */
static void get_matrix_editbone(EditBone *eBone, float bmat[][4])
{
- float delta[3];
- float mat[3][3];
+ float delta[3];
+ float mat[3][3];
/* Compose the parent transforms (i.e. their translations) */
sub_v3_v3v3(delta, eBone->tail, eBone->head);
- eBone->length = (float)sqrt(delta[0]*delta[0] + delta[1]*delta[1] +delta[2]*delta[2]);
+ eBone->length = (float)sqrt(delta[0] * delta[0] + delta[1] * delta[1] + delta[2] * delta[2]);
vec_roll_to_mat3(delta, eBone->roll, mat);
copy_m4_m3(bmat, mat);
@@ -2043,21 +2065,21 @@ static void get_matrix_editbone(EditBone *eBone, float bmat[][4])
static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
EditBone *eBone;
- bArmature *arm= ob->data;
+ bArmature *arm = ob->data;
float smat[4][4], imat[4][4], bmat[4][4];
unsigned int index;
int flag;
/* being set in code below */
- arm->layer_used= 0;
+ arm->layer_used = 0;
/* envelope (deform distance) */
- if (arm->drawtype==ARM_ENVELOPE) {
+ if (arm->drawtype == ARM_ENVELOPE) {
/* precalc inverse matrix for drawing screen aligned */
copy_m4_m4(smat, rv3d->viewmatob);
- mul_mat3_m4_fl(smat, 1.0f/len_v3(ob->obmat[0]));
+ mul_mat3_m4_fl(smat, 1.0f / len_v3(ob->obmat[0]));
invert_m4_m4(imat, smat);
/* and draw blended distances */
@@ -2066,10 +2088,10 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
- for (eBone=arm->edbo->first; eBone; eBone=eBone->next) {
+ for (eBone = arm->edbo->first; eBone; eBone = eBone->next) {
if (eBone->layer & arm->layer) {
- if ((eBone->flag & (BONE_HIDDEN_A|BONE_NO_DEFORM))==0) {
- if (eBone->flag & (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL))
+ if ((eBone->flag & (BONE_HIDDEN_A | BONE_NO_DEFORM)) == 0) {
+ if (eBone->flag & (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL))
draw_sphere_bone_dist(smat, imat, NULL, eBone);
}
}
@@ -2082,15 +2104,15 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
/* if solid we draw it first */
if ((dt > OB_WIRE) && (arm->drawtype != ARM_LINE)) {
- for (eBone=arm->edbo->first, index=0; eBone; eBone=eBone->next, index++) {
+ for (eBone = arm->edbo->first, index = 0; eBone; eBone = eBone->next, index++) {
if (eBone->layer & arm->layer) {
- if ((eBone->flag & BONE_HIDDEN_A)==0) {
+ if ((eBone->flag & BONE_HIDDEN_A) == 0) {
glPushMatrix();
get_matrix_editbone(eBone, bmat);
glMultMatrixf(bmat);
/* catch exception for bone with hidden parent */
- flag= eBone->flag;
+ flag = eBone->flag;
if ( (eBone->parent) && !EBONE_VISIBLE(arm, eBone->parent))
flag &= ~BONE_CONNECTED;
@@ -2098,11 +2120,11 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
if (eBone == arm->act_edbone)
flag |= BONE_DRAW_ACTIVE;
- if (arm->drawtype==ARM_ENVELOPE)
+ if (arm->drawtype == ARM_ENVELOPE)
draw_sphere_bone(OB_SOLID, arm->flag, flag, 0, index, NULL, eBone);
- else if (arm->drawtype==ARM_B_BONE)
+ else if (arm->drawtype == ARM_B_BONE)
draw_b_bone(OB_SOLID, arm->flag, flag, 0, index, NULL, eBone);
- else if (arm->drawtype==ARM_WIRE)
+ else if (arm->drawtype == ARM_WIRE)
draw_wire_bone(OB_SOLID, arm->flag, flag, 0, index, NULL, eBone);
else {
draw_bone(OB_SOLID, arm->flag, flag, 0, index, eBone->length);
@@ -2115,24 +2137,24 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
}
/* if wire over solid, set offset */
- index= -1;
+ index = -1;
glLoadName(-1);
- if ELEM(arm->drawtype, ARM_LINE, ARM_WIRE) {
+ if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE)) {
if (G.f & G_PICKSEL)
- index= 0;
+ index = 0;
}
else if (dt > OB_WIRE)
bglPolygonOffset(rv3d->dist, 1.0f);
else if (arm->flag & ARM_EDITMODE)
- index= 0; /* do selection codes */
+ index = 0; /* do selection codes */
- for (eBone=arm->edbo->first; eBone; eBone=eBone->next) {
+ for (eBone = arm->edbo->first; eBone; eBone = eBone->next) {
arm->layer_used |= eBone->layer;
if (eBone->layer & arm->layer) {
- if ((eBone->flag & BONE_HIDDEN_A)==0) {
+ if ((eBone->flag & BONE_HIDDEN_A) == 0) {
/* catch exception for bone with hidden parent */
- flag= eBone->flag;
+ flag = eBone->flag;
if ( (eBone->parent) && !EBONE_VISIBLE(arm, eBone->parent))
flag &= ~BONE_CONNECTED;
@@ -2151,7 +2173,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
if (arm->drawtype == ARM_LINE)
draw_line_bone(arm->flag, flag, 0, index, NULL, eBone);
- else if (arm->drawtype==ARM_WIRE)
+ else if (arm->drawtype == ARM_WIRE)
draw_wire_bone(OB_WIRE, arm->flag, flag, 0, index, NULL, eBone);
else if (arm->drawtype == ARM_B_BONE)
draw_b_bone(OB_WIRE, arm->flag, flag, 0, index, NULL, eBone);
@@ -2164,7 +2186,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
/* offset to parent */
if (eBone->parent) {
UI_ThemeColor(TH_WIRE);
- glLoadName (-1); // -1 here is OK!
+ glLoadName(-1); // -1 here is OK!
setlinestyle(3);
glBegin(GL_LINES);
@@ -2176,27 +2198,27 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
}
}
}
- if (index!=-1) index++;
+ if (index != -1) index++;
}
/* restore */
- if (index!=-1) glLoadName(-1);
- if ELEM(arm->drawtype,ARM_LINE,ARM_WIRE);
- else if (dt>OB_WIRE) bglPolygonOffset(rv3d->dist, 0.0f);
+ if (index != -1) glLoadName(-1);
+ if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE)) ;
+ else if (dt > OB_WIRE) bglPolygonOffset(rv3d->dist, 0.0f);
/* finally names and axes */
- if (arm->flag & (ARM_DRAWNAMES|ARM_DRAWAXES)) {
+ if (arm->flag & (ARM_DRAWNAMES | ARM_DRAWAXES)) {
// patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing
if ((G.f & G_PICKSEL) == 0) {
float vec[3];
unsigned char col[4];
- col[3]= 255;
+ col[3] = 255;
if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
- for (eBone=arm->edbo->first; eBone; eBone=eBone->next) {
+ for (eBone = arm->edbo->first; eBone; eBone = eBone->next) {
if (eBone->layer & arm->layer) {
- if ((eBone->flag & BONE_HIDDEN_A)==0) {
+ if ((eBone->flag & BONE_HIDDEN_A) == 0) {
UI_GetThemeColor3ubv((eBone->flag & BONE_SELECTED) ? TH_TEXT_HI : TH_TEXT, col);
@@ -2214,7 +2236,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
glMultMatrixf(bmat);
glColor3ubv(col);
- drawaxes(eBone->length*0.25f, OB_ARROWS);
+ drawaxes(eBone->length * 0.25f, OB_ARROWS);
glPopMatrix();
}
@@ -2237,15 +2259,15 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
*/
static void draw_pose_paths(Scene *scene, View3D *v3d, ARegion *ar, Object *ob)
{
- bAnimVizSettings *avs= &ob->pose->avs;
- bArmature *arm= ob->data;
+ bAnimVizSettings *avs = &ob->pose->avs;
+ bArmature *arm = ob->data;
bPoseChannel *pchan;
/* setup drawing environment for paths */
draw_motion_paths_init(v3d, ar);
/* draw paths where they exist and they releated bone is visible */
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
if ((pchan->bone->layer & arm->layer) && (pchan->mpath))
draw_motion_path_instance(scene, ob, pchan, avs, pchan->mpath);
}
@@ -2262,16 +2284,16 @@ static void draw_pose_paths(Scene *scene, View3D *v3d, ARegion *ar, Object *ob)
*/
static void ghost_poses_tag_unselected(Object *ob, short unset)
{
- bArmature *arm= ob->data;
- bPose *pose= ob->pose;
+ bArmature *arm = ob->data;
+ bPose *pose = ob->pose;
bPoseChannel *pchan;
/* don't do anything if no hiding any bones */
- if ((arm->flag & ARM_GHOST_ONLYSEL)==0)
+ if ((arm->flag & ARM_GHOST_ONLYSEL) == 0)
return;
/* loop over all pchans, adding/removing tags as appropriate */
- for (pchan= pose->chanbase.first; pchan; pchan= pchan->next) {
+ for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
if ((pchan->bone) && (arm->layer & pchan->bone->layer)) {
if (unset) {
/* remove tags from all pchans if cleaning up */
@@ -2279,7 +2301,7 @@ static void ghost_poses_tag_unselected(Object *ob, short unset)
}
else {
/* set tags on unselected pchans only */
- if ((pchan->bone->flag & BONE_SELECTED)==0)
+ if ((pchan->bone->flag & BONE_SELECTED) == 0)
pchan->bone->flag |= BONE_HIDDEN_PG;
}
}
@@ -2287,13 +2309,13 @@ static void ghost_poses_tag_unselected(Object *ob, short unset)
}
/* draw ghosts that occur within a frame range
- * note: object should be in posemode
+ * note: object should be in posemode
*/
static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
{
- Object *ob= base->object;
- AnimData *adt= BKE_animdata_from_id(&ob->id);
- bArmature *arm= ob->data;
+ Object *ob = base->object;
+ AnimData *adt = BKE_animdata_from_id(&ob->id);
+ bArmature *arm = ob->data;
bPose *posen, *poseo;
float start, end, stepsize, range, colfac;
int cfrao, flago, ipoflago;
@@ -2303,31 +2325,31 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base
if (end <= start)
return;
- stepsize= (float)(arm->ghostsize);
- range= (float)(end - start);
+ stepsize = (float)(arm->ghostsize);
+ range = (float)(end - start);
/* store values */
ob->mode &= ~OB_MODE_POSE;
- cfrao= CFRA;
- flago= arm->flag;
- arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES);
- ipoflago= ob->ipoflag;
+ cfrao = CFRA;
+ flago = arm->flag;
+ arm->flag &= ~(ARM_DRAWNAMES | ARM_DRAWAXES);
+ ipoflago = ob->ipoflag;
ob->ipoflag |= OB_DISABLE_PATH;
/* copy the pose */
- poseo= ob->pose;
+ poseo = ob->pose;
copy_pose(&posen, ob->pose, 1);
- ob->pose= posen;
- armature_rebuild_pose(ob, ob->data); /* child pointers for IK */
- ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */
+ ob->pose = posen;
+ armature_rebuild_pose(ob, ob->data); /* child pointers for IK */
+ ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */
glEnable(GL_BLEND);
if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
/* draw from first frame of range to last */
- for (CFRA= (int)start; CFRA < end; CFRA += (int)stepsize) {
+ for (CFRA = (int)start; CFRA < end; CFRA += (int)stepsize) {
colfac = (end - (float)CFRA) / range;
- UI_ThemeColorShadeAlpha(TH_WIRE, 0, -128-(int)(120.0*sqrt(colfac)));
+ UI_ThemeColorShadeAlpha(TH_WIRE, 0, -128 - (int)(120.0 * sqrt(colfac)));
BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
where_is_pose(scene, ob);
@@ -2336,16 +2358,16 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base
glDisable(GL_BLEND);
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
- ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */
+ ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */
free_pose(posen);
/* restore */
- CFRA= cfrao;
- ob->pose= poseo;
- arm->flag= flago;
+ CFRA = cfrao;
+ ob->pose = poseo;
+ arm->flag = flago;
armature_rebuild_pose(ob, ob->data);
ob->mode |= OB_MODE_POSE;
- ob->ipoflag= ipoflago;
+ ob->ipoflag = ipoflago;
}
/* draw ghosts on keyframes in action within range
@@ -2353,10 +2375,10 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base
*/
static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
{
- Object *ob= base->object;
- AnimData *adt= BKE_animdata_from_id(&ob->id);
- bAction *act= (adt) ? adt->action : NULL;
- bArmature *arm= ob->data;
+ Object *ob = base->object;
+ AnimData *adt = BKE_animdata_from_id(&ob->id);
+ bAction *act = (adt) ? adt->action : NULL;
+ bArmature *arm = ob->data;
bPose *posen, *poseo;
DLRBT_Tree keys;
ActKeyColumn *ak, *akn;
@@ -2373,9 +2395,9 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base *
action_to_keylist(adt, act, &keys, NULL);
BLI_dlrbTree_linkedlist_sync(&keys);
- range= 0;
- for (ak= keys.first; ak; ak= akn) {
- akn= ak->next;
+ range = 0;
+ for (ak = keys.first; ak; ak = akn) {
+ akn = ak->next;
if ((ak->cfra < start) || (ak->cfra > end))
BLI_freelinkN((ListBase *)&keys, ak);
@@ -2386,27 +2408,27 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base *
/* store values */
ob->mode &= ~OB_MODE_POSE;
- cfrao= CFRA;
- flago= arm->flag;
- arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES);
+ cfrao = CFRA;
+ flago = arm->flag;
+ arm->flag &= ~(ARM_DRAWNAMES | ARM_DRAWAXES);
ob->ipoflag |= OB_DISABLE_PATH;
/* copy the pose */
- poseo= ob->pose;
+ poseo = ob->pose;
copy_pose(&posen, ob->pose, 1);
- ob->pose= posen;
- armature_rebuild_pose(ob, ob->data); /* child pointers for IK */
- ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */
+ ob->pose = posen;
+ armature_rebuild_pose(ob, ob->data); /* child pointers for IK */
+ ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */
glEnable(GL_BLEND);
if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
/* draw from first frame of range to last */
- for (ak=keys.first, i=0; ak; ak=ak->next, i++) {
- colfac = i/range;
- UI_ThemeColorShadeAlpha(TH_WIRE, 0, -128-(int)(120.0*sqrt(colfac)));
+ for (ak = keys.first, i = 0; ak; ak = ak->next, i++) {
+ colfac = i / range;
+ UI_ThemeColorShadeAlpha(TH_WIRE, 0, -128 - (int)(120.0 * sqrt(colfac)));
- CFRA= (int)ak->cfra;
+ CFRA = (int)ak->cfra;
BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
where_is_pose(scene, ob);
@@ -2415,67 +2437,67 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base *
glDisable(GL_BLEND);
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
- ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */
+ ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */
BLI_dlrbTree_free(&keys);
free_pose(posen);
/* restore */
- CFRA= cfrao;
- ob->pose= poseo;
- arm->flag= flago;
+ CFRA = cfrao;
+ ob->pose = poseo;
+ arm->flag = flago;
armature_rebuild_pose(ob, ob->data);
ob->mode |= OB_MODE_POSE;
}
/* draw ghosts around current frame
- * - object is supposed to be armature in posemode
+ * - object is supposed to be armature in posemode
*/
static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
{
- Object *ob= base->object;
- AnimData *adt= BKE_animdata_from_id(&ob->id);
- bArmature *arm= ob->data;
+ Object *ob = base->object;
+ AnimData *adt = BKE_animdata_from_id(&ob->id);
+ bArmature *arm = ob->data;
bPose *posen, *poseo;
float cur, start, end, stepsize, range, colfac, actframe, ctime;
int cfrao, flago;
/* pre conditions, get an action with sufficient frames */
- if ELEM(NULL, adt, adt->action)
+ if (ELEM(NULL, adt, adt->action))
return;
calc_action_range(adt->action, &start, &end, 0);
if (start == end)
return;
- stepsize= (float)(arm->ghostsize);
- range= (float)(arm->ghostep)*stepsize + 0.5f; /* plus half to make the for loop end correct */
+ stepsize = (float)(arm->ghostsize);
+ range = (float)(arm->ghostep) * stepsize + 0.5f; /* plus half to make the for loop end correct */
/* store values */
ob->mode &= ~OB_MODE_POSE;
- cfrao= CFRA;
- actframe= BKE_nla_tweakedit_remap(adt, (float)CFRA, 0);
- flago= arm->flag;
- arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES);
+ cfrao = CFRA;
+ actframe = BKE_nla_tweakedit_remap(adt, (float)CFRA, 0);
+ flago = arm->flag;
+ arm->flag &= ~(ARM_DRAWNAMES | ARM_DRAWAXES);
/* copy the pose */
- poseo= ob->pose;
+ poseo = ob->pose;
copy_pose(&posen, ob->pose, 1);
- ob->pose= posen;
- armature_rebuild_pose(ob, ob->data); /* child pointers for IK */
- ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */
+ ob->pose = posen;
+ armature_rebuild_pose(ob, ob->data); /* child pointers for IK */
+ ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */
glEnable(GL_BLEND);
if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
/* draw from darkest blend to lowest */
- for (cur= stepsize; cur<range; cur+=stepsize) {
- ctime= cur - (float)fmod(cfrao, stepsize); /* ensures consistent stepping */
- colfac= ctime/range;
- UI_ThemeColorShadeAlpha(TH_WIRE, 0, -128-(int)(120.0*sqrt(colfac)));
+ for (cur = stepsize; cur < range; cur += stepsize) {
+ ctime = cur - (float)fmod(cfrao, stepsize); /* ensures consistent stepping */
+ colfac = ctime / range;
+ UI_ThemeColorShadeAlpha(TH_WIRE, 0, -128 - (int)(120.0 * sqrt(colfac)));
/* only within action range */
- if (actframe+ctime >= start && actframe+ctime <= end) {
- CFRA= (int)BKE_nla_tweakedit_remap(adt, actframe+ctime, NLATIME_CONVERT_MAP);
+ if (actframe + ctime >= start && actframe + ctime <= end) {
+ CFRA = (int)BKE_nla_tweakedit_remap(adt, actframe + ctime, NLATIME_CONVERT_MAP);
if (CFRA != cfrao) {
BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
@@ -2484,13 +2506,13 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
}
}
- ctime= cur + (float)fmod((float)cfrao, stepsize) - stepsize+1.0f; /* ensures consistent stepping */
- colfac= ctime/range;
- UI_ThemeColorShadeAlpha(TH_WIRE, 0, -128-(int)(120.0*sqrt(colfac)));
+ ctime = cur + (float)fmod((float)cfrao, stepsize) - stepsize + 1.0f; /* ensures consistent stepping */
+ colfac = ctime / range;
+ UI_ThemeColorShadeAlpha(TH_WIRE, 0, -128 - (int)(120.0 * sqrt(colfac)));
/* only within action range */
- if ((actframe-ctime >= start) && (actframe-ctime <= end)) {
- CFRA= (int)BKE_nla_tweakedit_remap(adt, actframe-ctime, NLATIME_CONVERT_MAP);
+ if ((actframe - ctime >= start) && (actframe - ctime <= end)) {
+ CFRA = (int)BKE_nla_tweakedit_remap(adt, actframe - ctime, NLATIME_CONVERT_MAP);
if (CFRA != cfrao) {
BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
@@ -2502,13 +2524,13 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
glDisable(GL_BLEND);
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
- ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */
+ ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */
free_pose(posen);
/* restore */
- CFRA= cfrao;
- ob->pose= poseo;
- arm->flag= flago;
+ CFRA = cfrao;
+ ob->pose = poseo;
+ arm->flag = flago;
armature_rebuild_pose(ob, ob->data);
ob->mode |= OB_MODE_POSE;
}
@@ -2518,22 +2540,22 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
/* called from drawobject.c, return 1 if nothing was drawn */
int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag, const short is_outline)
{
- Object *ob= base->object;
- bArmature *arm= ob->data;
- int retval= 0;
+ Object *ob = base->object;
+ bArmature *arm = ob->data;
+ int retval = 0;
if (v3d->flag2 & V3D_RENDER_OVERRIDE)
return 1;
- if (dt>OB_WIRE && !ELEM(arm->drawtype, ARM_LINE, ARM_WIRE)) {
+ if (dt > OB_WIRE && !ELEM(arm->drawtype, ARM_LINE, ARM_WIRE)) {
/* we use color for solid lighting */
glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR);
glEnable(GL_COLOR_MATERIAL);
- glColor3ub(255,255,255); // clear spec
+ glColor3ub(255, 255, 255); // clear spec
glDisable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW); // only for lighting...
+ glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW); // only for lighting...
}
/* arm->flag is being used to detect mode... */
@@ -2543,15 +2565,16 @@ int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, in
draw_ebones(v3d, ar, ob, dt);
arm->flag &= ~ARM_EDITMODE;
}
- else{
+ else {
/* Draw Pose */
if (ob->pose && ob->pose->chanbase.first) {
/* drawing posemode selection indices or colors only in these cases */
if (!(base->flag & OB_FROMDUPLI)) {
if (G.f & G_PICKSEL) {
-#if 0 /* nifty but actually confusing to allow bone selection out of posemode */
+#if 0
+ /* nifty but actually confusing to allow bone selection out of posemode */
if (OBACT && (OBACT->mode & OB_MODE_WEIGHT_PAINT)) {
- if (ob==modifiers_isDeformedByArmature(OBACT))
+ if (ob == modifiers_isDeformedByArmature(OBACT))
arm->flag |= ARM_POSEMODE;
}
else
@@ -2571,11 +2594,11 @@ int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, in
if (arm->ghostep)
draw_ghost_poses(scene, v3d, ar, base);
}
- if ((flag & DRAW_SCENESET)==0) {
- if (ob==OBACT)
+ if ((flag & DRAW_SCENESET) == 0) {
+ if (ob == OBACT)
arm->flag |= ARM_POSEMODE;
else if (OBACT && (OBACT->mode & OB_MODE_WEIGHT_PAINT)) {
- if (ob==modifiers_isDeformedByArmature(OBACT))
+ if (ob == modifiers_isDeformedByArmature(OBACT))
arm->flag |= ARM_POSEMODE;
}
draw_pose_paths(scene, v3d, ar, ob);
@@ -2586,9 +2609,11 @@ int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, in
arm->flag &= ~ARM_POSEMODE;
if (ob->mode & OB_MODE_POSE)
- UI_ThemeColor(TH_WIRE); /* restore, for extra draw stuff */
+ UI_ThemeColor(TH_WIRE); /* restore, for extra draw stuff */
+ }
+ else {
+ retval = 1;
}
- else retval= 1;
}
/* restore */
glFrontFace(GL_CCW);
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index e368d8c10b7..39f1552c8a6 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -71,7 +71,7 @@
#include "ED_mesh.h"
#include "ED_uvedit.h"
-#include "view3d_intern.h" // own include
+#include "view3d_intern.h" // own include
/* user data structures for derived mesh callbacks */
typedef struct drawMeshFaceSelect_userData {
@@ -96,8 +96,8 @@ typedef struct drawTFace_userData {
/* Flags for marked edges */
enum {
- eEdge_Visible = (1<<0),
- eEdge_Select = (1<<1),
+ eEdge_Visible = (1 << 0),
+ eEdge_Select = (1 << 1),
};
/* Creates a hash of edges to flags indicating selected/visible */
@@ -108,7 +108,7 @@ static void get_marked_edge_info__orFlags(EdgeHash *eh, int v0, int v1, int flag
if (!BLI_edgehash_haskey(eh, v0, v1))
BLI_edgehash_insert(eh, v0, v1, NULL);
- flags_p = (int*) BLI_edgehash_lookup_p(eh, v0, v1);
+ flags_p = (int *) BLI_edgehash_lookup_p(eh, v0, v1);
*flags_p |= flags;
}
@@ -120,7 +120,7 @@ static EdgeHash *get_tface_mesh_marked_edge_info(Mesh *me)
MLoop *ml_next;
int i, j;
- for (i=0; i<me->totpoly; i++) {
+ for (i = 0; i < me->totpoly; i++) {
mp = &me->mpoly[i];
if (!(mp->flag & ME_HIDE)) {
@@ -128,7 +128,7 @@ static EdgeHash *get_tface_mesh_marked_edge_info(Mesh *me)
if (mp->flag & ME_FACE_SEL) flags |= eEdge_Select;
ml = me->mloop + mp->loopstart;
- for (j=0; j<mp->totloop; j++, ml++) {
+ for (j = 0; j < mp->totloop; j++, ml++) {
ml_next = ME_POLY_LOOP_NEXT(me->mloop, mp, j);
get_marked_edge_info__orFlags(eh, ml->v, ml_next->v, flags);
}
@@ -139,42 +139,44 @@ 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;
+ Mesh *me = data->me;
MEdge *med = &me->medge[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;
+ 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 */
+ if (!(mface->flag & ME_HIDE) && !(mface->flag & ME_FACE_SEL))
+ 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)
@@ -200,20 +202,20 @@ static void draw_mesh_face_select(RegionView3D *rv3d, Mesh *me, DerivedMesh *dm)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
/* dull unselected faces so as not to get in the way of seeing color */
glColor4ub(96, 96, 96, 64);
- dm->drawMappedFacesTex(dm, draw_mesh_face_select__drawFaceOptsInv, NULL, (void*)me);
+ dm->drawMappedFacesTex(dm, draw_mesh_face_select__drawFaceOptsInv, NULL, (void *)me);
glDisable(GL_BLEND);
}
bglPolygonOffset(rv3d->dist, 1.0);
- /* Draw Stippled Outline for selected faces */
+ /* Draw Stippled Outline for selected faces */
glColor3ub(255, 255, 255);
setlinestyle(1);
dm->drawMappedEdges(dm, draw_mesh_face_select__setSelectOpts, &data);
setlinestyle(0);
- bglPolygonOffset(rv3d->dist, 0.0); // resets correctly now, even after calling accumulated offsets
+ bglPolygonOffset(rv3d->dist, 0.0); // resets correctly now, even after calling accumulated offsets
BLI_edgehash_free(data.eh, NULL);
}
@@ -222,10 +224,10 @@ static void draw_mesh_face_select(RegionView3D *rv3d, Mesh *me, DerivedMesh *dm)
static Material *give_current_material_or_def(Object *ob, int matnr)
{
- extern Material defmaterial; // render module abuse...
- Material *ma= give_current_material(ob, matnr);
+ extern Material defmaterial; // render module abuse...
+ Material *ma = give_current_material(ob, matnr);
- return ma?ma:&defmaterial;
+ return ma ? ma : &defmaterial;
}
/* Icky globals, fix with userdata parameter */
@@ -253,9 +255,9 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m
int lit = 0;
if (clearcache) {
- c_textured= c_lit= c_backculled= -1;
- c_texface= (MTFace*) -1;
- c_badtex= 0;
+ c_textured = c_lit = c_backculled = -1;
+ c_texface = (MTFace *) -1;
+ c_badtex = 0;
}
else {
textured = gtexdraw.istex;
@@ -282,34 +284,35 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m
else
textured = 0;
- if (backculled!=c_backculled) {
+ if (backculled != c_backculled) {
if (backculled) glEnable(GL_CULL_FACE);
else glDisable(GL_CULL_FACE);
- c_backculled= backculled;
+ c_backculled = backculled;
}
- if (textured!=c_textured || texface!=c_texface) {
- if (textured ) {
- c_badtex= !GPU_set_tpage(texface, !(litob->mode & OB_MODE_TEXTURE_PAINT), alphablend);
- }else {
+ if (textured != c_textured || texface != c_texface) {
+ if (textured) {
+ c_badtex = !GPU_set_tpage(texface, !(litob->mode & OB_MODE_TEXTURE_PAINT), alphablend);
+ }
+ else {
GPU_set_tpage(NULL, 0, 0);
- c_badtex= 0;
+ c_badtex = 0;
}
- c_textured= textured;
- c_texface= texface;
+ c_textured = textured;
+ c_texface = texface;
}
- if (c_badtex) lit= 0;
- if (lit!=c_lit || ma!=c_ma) {
+ if (c_badtex) lit = 0;
+ if (lit != c_lit || ma != c_ma) {
if (lit) {
float spec[4];
- if (!ma)ma= give_current_material_or_def(NULL, 0); //default material
+ if (!ma) ma = give_current_material_or_def(NULL, 0); //default material
- spec[0]= ma->spec*ma->specr;
- spec[1]= ma->spec*ma->specg;
- spec[2]= ma->spec*ma->specb;
- spec[3]= 1.0;
+ spec[0] = ma->spec * ma->specr;
+ spec[1] = ma->spec * ma->specg;
+ spec[2] = ma->spec * ma->specb;
+ spec[3] = 1.0;
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, spec);
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
@@ -321,7 +324,7 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m
glDisable(GL_LIGHTING);
glDisable(GL_COLOR_MATERIAL);
}
- c_lit= lit;
+ c_lit = lit;
}
return c_badtex;
@@ -337,25 +340,25 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O
/* texture draw is abused for mask selection mode, do this so wire draw
* with face selection in weight paint is not lit. */
if ((v3d->drawtype <= OB_WIRE) && (ob->mode & OB_MODE_WEIGHT_PAINT)) {
- solidtex= FALSE;
- Gtexdraw.islit= 0;
+ solidtex = FALSE;
+ Gtexdraw.islit = 0;
}
- else if (v3d->drawtype==OB_SOLID || ((ob->mode & OB_MODE_EDIT) && v3d->drawtype!=OB_TEXTURE)) {
+ else if (v3d->drawtype == OB_SOLID || ((ob->mode & OB_MODE_EDIT) && v3d->drawtype != OB_TEXTURE)) {
/* draw with default lights in solid draw mode and edit mode */
- solidtex= TRUE;
- Gtexdraw.islit= -1;
+ solidtex = TRUE;
+ Gtexdraw.islit = -1;
}
else {
/* draw with lights in the scene otherwise */
- solidtex= FALSE;
- Gtexdraw.islit= GPU_scene_object_lights(scene, ob, v3d->lay, rv3d->viewmat, !rv3d->is_persp);
+ solidtex = FALSE;
+ Gtexdraw.islit = GPU_scene_object_lights(scene, ob, v3d->lay, rv3d->viewmat, !rv3d->is_persp);
}
rgba_float_to_uchar(obcol, ob->col);
glCullFace(GL_BACK); glEnable(GL_CULL_FACE);
- if (solidtex || v3d->drawtype==OB_TEXTURE) istex= 1;
- else istex= 0;
+ if (solidtex || v3d->drawtype == OB_TEXTURE) istex = 1;
+ else istex = 0;
Gtexdraw.ob = ob;
Gtexdraw.istex = istex;
@@ -388,22 +391,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;
+ 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) {
+ 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 +421,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);
+ 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 */
+ else if (tface && (tface->mode & TF_OBCOL)) {
+ 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)
@@ -454,81 +461,81 @@ static void add_tface_color_layer(DerivedMesh *dm)
MTFace *tface = DM_get_poly_data_layer(dm, CD_MTFACE);
MFace *mface = dm->getTessFaceArray(dm);
MCol *finalCol;
- int i,j;
- MCol *mcol = dm->getTessFaceDataArray(dm, CD_WEIGHT_MCOL);
+ int i, j;
+ MCol *mcol = dm->getTessFaceDataArray(dm, CD_PREVIEW_MCOL);
if (!mcol)
mcol = dm->getTessFaceDataArray(dm, CD_MCOL);
- finalCol = MEM_mallocN(sizeof(MCol)*4*dm->getNumTessFaces(dm),"add_tface_color_layer");
- for (i=0;i<dm->getNumTessFaces(dm);i++) {
- Material *ma= give_current_material(Gtexdraw.ob, mface[i].mat_nr+1);
+ finalCol = MEM_mallocN(sizeof(MCol) * 4 * dm->getNumTessFaces(dm), "add_tface_color_layer");
+ for (i = 0; i < dm->getNumTessFaces(dm); i++) {
+ Material *ma = give_current_material(Gtexdraw.ob, mface[i].mat_nr + 1);
- if (ma && (ma->game.flag&GEMAT_INVISIBLE)) {
- if ( mcol )
- memcpy(&finalCol[i*4],&mcol[i*4],sizeof(MCol)*4);
+ if (ma && (ma->game.flag & GEMAT_INVISIBLE)) {
+ if (mcol)
+ memcpy(&finalCol[i * 4], &mcol[i * 4], sizeof(MCol) * 4);
else
- for (j=0;j<4;j++) {
- finalCol[i*4+j].b = 255;
- finalCol[i*4+j].g = 255;
- finalCol[i*4+j].r = 255;
+ for (j = 0; j < 4; j++) {
+ finalCol[i * 4 + j].b = 255;
+ finalCol[i * 4 + j].g = 255;
+ finalCol[i * 4 + j].r = 255;
}
}
else if (tface && mface && set_draw_settings_cached(0, tface, ma, Gtexdraw)) {
- for (j=0;j<4;j++) {
- finalCol[i*4+j].b = 255;
- finalCol[i*4+j].g = 0;
- finalCol[i*4+j].r = 255;
+ for (j = 0; j < 4; j++) {
+ finalCol[i * 4 + j].b = 255;
+ finalCol[i * 4 + j].g = 0;
+ finalCol[i * 4 + j].r = 255;
}
}
- else if (tface && tface->mode&TF_OBCOL) {
- for (j=0;j<4;j++) {
- finalCol[i*4+j].b = FTOCHAR(Gtexdraw.obcol[0]);
- finalCol[i*4+j].g = FTOCHAR(Gtexdraw.obcol[1]);
- finalCol[i*4+j].r = FTOCHAR(Gtexdraw.obcol[2]);
+ else if (tface && (tface->mode & TF_OBCOL)) {
+ for (j = 0; j < 4; j++) {
+ finalCol[i * 4 + j].b = FTOCHAR(Gtexdraw.obcol[0]);
+ finalCol[i * 4 + j].g = FTOCHAR(Gtexdraw.obcol[1]);
+ finalCol[i * 4 + j].r = FTOCHAR(Gtexdraw.obcol[2]);
}
}
else if (!mcol) {
if (tface) {
- for (j=0;j<4;j++) {
- finalCol[i*4+j].b = 255;
- finalCol[i*4+j].g = 255;
- finalCol[i*4+j].r = 255;
+ for (j = 0; j < 4; j++) {
+ finalCol[i * 4 + j].b = 255;
+ finalCol[i * 4 + j].g = 255;
+ finalCol[i * 4 + j].r = 255;
}
}
else {
float col[3];
- Material *ma= give_current_material(Gtexdraw.ob, mface[i].mat_nr+1);
+ Material *ma = give_current_material(Gtexdraw.ob, mface[i].mat_nr + 1);
if (ma) {
if (Gtexdraw.color_profile) linearrgb_to_srgb_v3_v3(col, &ma->r);
else copy_v3_v3(col, &ma->r);
- for (j=0;j<4;j++) {
- finalCol[i*4+j].b = FTOCHAR(col[0]);
- finalCol[i*4+j].g = FTOCHAR(col[1]);
- finalCol[i*4+j].r = FTOCHAR(col[2]);
+ for (j = 0; j < 4; j++) {
+ finalCol[i * 4 + j].b = FTOCHAR(col[0]);
+ finalCol[i * 4 + j].g = FTOCHAR(col[1]);
+ finalCol[i * 4 + j].r = FTOCHAR(col[2]);
}
}
else
- for (j=0;j<4;j++) {
- finalCol[i*4+j].b = 255;
- finalCol[i*4+j].g = 255;
- finalCol[i*4+j].r = 255;
+ for (j = 0; j < 4; j++) {
+ finalCol[i * 4 + j].b = 255;
+ finalCol[i * 4 + j].g = 255;
+ finalCol[i * 4 + j].r = 255;
}
}
}
else {
- for (j=0;j<4;j++) {
- finalCol[i*4+j].r = mcol[i*4+j].r;
- finalCol[i*4+j].g = mcol[i*4+j].g;
- finalCol[i*4+j].b = mcol[i*4+j].b;
+ for (j = 0; j < 4; j++) {
+ finalCol[i * 4 + j].r = mcol[i * 4 + j].r;
+ finalCol[i * 4 + j].g = mcol[i * 4 + j].g;
+ finalCol[i * 4 + j].b = mcol[i * 4 + j].b;
}
}
}
- CustomData_add_layer( &dm->faceData, CD_TEXTURE_MCOL, CD_ASSIGN, finalCol, dm->numTessFaceData );
+ 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,11 +545,11 @@ 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;
- MTFace mtf= {{{0}}};
+ MTFace mtf = {{{0}}};
int matnr = mpoly->mat_nr;
if (tpoly) {
@@ -553,17 +560,17 @@ 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);
+ BMFace *efa = EDBM_face_at_index(em, index);
- if (efa==NULL || BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
- return 0;
+ if (efa == NULL || BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
+ return DM_DRAW_OPTION_SKIP;
}
else {
- MTFace mtf= {{{0}}};
+ MTFace mtf = {{{0}}};
int matnr = efa->mat_nr;
if (data->has_mtface) {
@@ -571,33 +578,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;
+ Mesh *me = (Mesh *)userData;
if (me->mat && me->mpoly) {
- Material *ma= me->mat[me->mpoly[index].mat_nr];
+ 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;
+ 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)
@@ -608,7 +615,7 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl)
MTexPoly *mtpoly = me->mtpoly;
MLoopUV *mloopuv = me->mloopuv;
MLoopUV *luv;
- MLoopCol *mloopcol = me->mloopcol; /* why does mcol exist? */
+ MLoopCol *mloopcol = me->mloopcol; /* why does mcol exist? */
MLoopCol *lcol;
bProperty *prop = get_ob_property(ob, "Text");
@@ -616,7 +623,7 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl)
int a, totpoly = me->totpoly;
/* fake values to pass to GPU_render_text() */
- MCol tmp_mcol[4] = {{0}};
+ MCol tmp_mcol[4] = {{0}};
MCol *tmp_mcol_pt = mloopcol ? tmp_mcol : NULL;
MTFace tmp_tf = {{{0}}};
@@ -627,33 +634,33 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl)
/* don't draw when editing */
if (ob->mode & OB_MODE_EDIT)
return;
- else if (ob==OBACT)
+ else if (ob == OBACT)
if (paint_facesel_test(ob) || paint_vertsel_test(ob))
return;
ddm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
- for (a=0, mp=mface; a<totpoly ; a++, mtpoly++, mp++) {
- short matnr= mp->mat_nr;
- int mf_smooth= mp->flag & ME_SMOOTH;
+ for (a = 0, mp = mface; a < totpoly; a++, mtpoly++, mp++) {
+ short matnr = mp->mat_nr;
+ int mf_smooth = mp->flag & ME_SMOOTH;
Material *mat = me->mat[matnr];
- int mode= mat->game.flag;
+ int mode = mat->game.flag;
- if (!(mode&GEMAT_INVISIBLE) && (mode&GEMAT_TEXT) && mp->totloop >= 3) {
+ if (!(mode & GEMAT_INVISIBLE) && (mode & GEMAT_TEXT) && mp->totloop >= 3) {
/* get the polygon as a tri/quad */
int mp_vi[4];
float v1[3], v2[3], v3[3], v4[3];
char string[MAX_PROPSTRING];
- int characters, i, glattrib= -1, badtex= 0;
+ int characters, i, glattrib = -1, badtex = 0;
/* TEXFACE */
ME_MTEXFACE_CPY(&tmp_tf, mtpoly);
if (glsl) {
- GPU_enable_material(matnr+1, &gattribs);
+ GPU_enable_material(matnr + 1, &gattribs);
- for (i=0; i<gattribs.totlayer; i++) {
+ for (i = 0; i < gattribs.totlayer; i++) {
if (gattribs.layer[i].type == CD_MTFACE) {
glattrib = gattribs.layer[i].glindex;
break;
@@ -668,9 +675,9 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl)
}
mp_vi[0] = me->mloop[mp->loopstart + 0].v;
- mp_vi[1] = me->mloop[mp->loopstart + 1].v;
- mp_vi[2] = me->mloop[mp->loopstart + 2].v;
- mp_vi[3] = (mp->totloop >= 4) ? me->mloop[mp->loopstart + 3].v : 0;
+ mp_vi[1] = me->mloop[mp->loopstart + 1].v;
+ mp_vi[2] = me->mloop[mp->loopstart + 2].v;
+ mp_vi[3] = (mp->totloop >= 4) ? me->mloop[mp->loopstart + 3].v : 0;
/* UV */
luv = &mloopuv[mp->loopstart];
@@ -688,10 +695,7 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl)
lcol = &mloopcol[mp->loopstart];
for (j = 0; j <= totloop_clamp; j++, lcol++) {
- tmp_mcol[j].a = lcol->a;
- tmp_mcol[j].r = lcol->r;
- tmp_mcol[j].g = lcol->g;
- tmp_mcol[j].b = lcol->b;
+ MESH_MLOOPCOL_TO_MCOL(lcol, &tmp_mcol[j]);
}
}
@@ -717,13 +721,13 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl)
if (!mf_smooth) {
float nor[3];
- normal_tri_v3( nor,v1, v2, v3);
+ normal_tri_v3(nor, v1, v2, v3);
glNormal3fv(nor);
}
GPU_render_text(&tmp_tf, mode, string, characters,
- (unsigned int*)tmp_mcol_pt, v1, v2, v3, (mp->totloop >= 4 ? v4: NULL), glattrib);
+ (unsigned int *)tmp_mcol_pt, v1, v2, v3, (mp->totloop >= 4 ? v4 : NULL), glattrib);
}
}
@@ -745,7 +749,7 @@ static int compareDrawOptions(void *userData, int cur_index, int next_index)
static int compareDrawOptionsEm(void *userData, int cur_index, int next_index)
{
- drawEMTFMapped_userData *data= userData;
+ drawEMTFMapped_userData *data = userData;
if (data->mf && data->mf[cur_index].mat_nr != data->mf[next_index].mat_nr)
return 0;
@@ -758,7 +762,7 @@ static int compareDrawOptionsEm(void *userData, int cur_index, int next_index)
void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, DerivedMesh *dm, int draw_flags)
{
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
/* correct for negative scale */
if (ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CW);
@@ -767,22 +771,23 @@ void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
/* draw the textured mesh */
draw_textured_begin(scene, v3d, rv3d, ob);
- glColor4f(1.0f,1.0f,1.0f,1.0f);
+ glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
if (ob->mode & OB_MODE_EDIT) {
drawEMTFMapped_userData data;
- data.em= me->edit_btmesh;
- data.has_mcol= CustomData_has_layer(&me->edit_btmesh->bm->ldata, CD_MLOOPCOL);
- data.has_mtface= CustomData_has_layer(&me->edit_btmesh->bm->pdata, CD_MTEXPOLY);
- data.mf= DM_get_tessface_data_layer(dm, CD_MFACE);
- data.tf= DM_get_tessface_data_layer(dm, CD_MTFACE);
+ data.em = me->edit_btmesh;
+ data.has_mcol = CustomData_has_layer(&me->edit_btmesh->bm->ldata, CD_MLOOPCOL);
+ data.has_mtface = CustomData_has_layer(&me->edit_btmesh->bm->pdata, CD_MTEXPOLY);
+ data.mf = DM_get_tessface_data_layer(dm, CD_MFACE);
+ data.tf = DM_get_tessface_data_layer(dm, CD_MTFACE);
dm->drawMappedFacesTex(dm, draw_em_tf_mapped__set_draw, compareDrawOptionsEm, &data);
}
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);
}
@@ -796,7 +801,7 @@ void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
else {
drawTFace_userData userData;
- if (!CustomData_has_layer(&dm->faceData,CD_TEXTURE_MCOL))
+ if (!CustomData_has_layer(&dm->faceData, CD_TEXTURE_MCOL))
add_tface_color_layer(dm);
userData.mf = DM_get_tessface_data_layer(dm, CD_MFACE);
@@ -819,7 +824,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,31 +840,31 @@ 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);
}
static void tex_mat_set_texture_cb(void *userData, int mat_nr, void *attribs)
{
/* texture draw mode without GLSL */
- TexMatCallback *data= (TexMatCallback*)userData;
+ TexMatCallback *data = (TexMatCallback *)userData;
GPUVertexAttribs *gattribs = attribs;
Image *ima;
ImageUser *iuser;
bNode *node;
- int texture_set= 0;
+ int texture_set = 0;
/* draw image texture if we find one */
if (ED_object_get_active_image(data->ob, mat_nr, &ima, &iuser, &node)) {
/* get openl texture */
- int mipmap= 1;
- int bindcode= (ima)? GPU_verify_image(ima, iuser, 0, 0, mipmap): 0;
+ int mipmap = 1;
+ int bindcode = (ima) ? GPU_verify_image(ima, iuser, 0, 0, mipmap) : 0;
float zero[4] = {0.0f, 0.0f, 0.0f, 0.0f};
if (bindcode) {
- NodeTexBase *texbase= node->storage;
+ NodeTexBase *texbase = node->storage;
/* disable existing material */
GPU_disable_material();
@@ -881,12 +886,12 @@ static void tex_mat_set_texture_cb(void *userData, int mat_nr, void *attribs)
/* use active UV texture layer */
memset(gattribs, 0, sizeof(*gattribs));
- gattribs->layer[0].type= CD_MTFACE;
- gattribs->layer[0].name[0]= '\0';
- gattribs->layer[0].gltexco= 1;
- gattribs->totlayer= 1;
+ gattribs->layer[0].type = CD_MTFACE;
+ gattribs->layer[0].name[0] = '\0';
+ gattribs->layer[0].gltexco = 1;
+ gattribs->totlayer = 1;
- texture_set= 1;
+ texture_set = 1;
}
}
@@ -907,8 +912,8 @@ static void tex_mat_set_texture_cb(void *userData, int mat_nr, void *attribs)
static int tex_mat_set_face_mesh_cb(void *userData, int index)
{
/* faceselect mode face hiding */
- TexMatCallback *data= (TexMatCallback*)userData;
- Mesh *me = (Mesh*)data->me;
+ TexMatCallback *data = (TexMatCallback *)userData;
+ Mesh *me = (Mesh *)data->me;
MPoly *mp = &me->mpoly[index];
return !(mp->flag & ME_HIDE);
@@ -917,9 +922,9 @@ static int tex_mat_set_face_mesh_cb(void *userData, int index)
static int tex_mat_set_face_editmesh_cb(void *userData, int index)
{
/* editmode face hiding */
- TexMatCallback *data= (TexMatCallback*)userData;
- Mesh *me = (Mesh*)data->me;
- BMFace *efa= EDBM_get_face_for_index(me->edit_btmesh, index);
+ TexMatCallback *data = (TexMatCallback *)userData;
+ Mesh *me = (Mesh *)data->me;
+ BMFace *efa = EDBM_face_at_index(me->edit_btmesh, index);
return !BM_elem_flag_test(efa, BM_ELEM_HIDDEN);
}
@@ -939,35 +944,33 @@ 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;
+ Mesh *me = ob->data;
TexMatCallback data = {scene, ob, me, dm};
- int (*set_face_cb)(void*, int);
+ int (*set_face_cb)(void *, int);
int glsl;
/* face hiding callback depending on mode */
if (ob == scene->obedit)
- set_face_cb= tex_mat_set_face_editmesh_cb;
+ set_face_cb = tex_mat_set_face_editmesh_cb;
else if (draw_flags & DRAW_FACE_SELECT)
- set_face_cb= tex_mat_set_face_mesh_cb;
+ set_face_cb = tex_mat_set_face_mesh_cb;
else
- set_face_cb= NULL;
+ set_face_cb = NULL;
/* test if we can use glsl */
- glsl= (v3d->drawtype == OB_MATERIAL) && GPU_glsl_support();
+ glsl = (v3d->drawtype == OB_MATERIAL) && GPU_glsl_support();
GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, NULL);
if (glsl) {
/* draw glsl */
dm->drawMappedFacesMat(dm,
- tex_mat_set_material_cb,
- set_face_cb, &data);
+ tex_mat_set_material_cb,
+ set_face_cb, &data);
}
else {
float zero[4] = {0.0f, 0.0f, 0.0f, 0.0f};
@@ -978,8 +981,8 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *o
glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 0);
dm->drawMappedFacesMat(dm,
- tex_mat_set_texture_cb,
- set_face_cb, &data);
+ tex_mat_set_texture_cb,
+ set_face_cb, &data);
}
GPU_end_object_materials();
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 8c1a9985185..6d76da3b0e0 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -55,7 +55,8 @@
#include "BLI_rand.h"
#include "BLI_utildefines.h"
-#include "BKE_anim.h" //for the where_on_path function
+#include "BKE_anim.h" //for the where_on_path function
+#include "BKE_armature.h"
#include "BKE_camera.h"
#include "BKE_constraint.h" // for the get_constraint_target function
#include "BKE_curve.h"
@@ -106,18 +107,18 @@
#include "wm_subwindow.h"
#include "BLF_api.h"
-#include "view3d_intern.h" // own include
+#include "view3d_intern.h" // own include
/* this condition has been made more complex since editmode can draw textures */
#define CHECK_OB_DRAWTEXTURE(vd, dt) \
- ((ELEM(vd->drawtype, OB_TEXTURE, OB_MATERIAL) && dt>OB_SOLID) || \
- (vd->drawtype==OB_SOLID && vd->flag2 & V3D_SOLID_TEX))
+ ((ELEM(vd->drawtype, OB_TEXTURE, OB_MATERIAL) && dt > OB_SOLID) || \
+ (vd->drawtype == OB_SOLID && vd->flag2 & V3D_SOLID_TEX))
typedef enum eWireDrawMode {
- OBDRAW_WIRE_OFF= 0,
- OBDRAW_WIRE_ON= 1,
- OBDRAW_WIRE_ON_DEPTH= 2
+ OBDRAW_WIRE_OFF = 0,
+ OBDRAW_WIRE_ON = 1,
+ OBDRAW_WIRE_ON_DEPTH = 2
} eWireDrawMode;
/* user data structures for derived mesh callbacks */
@@ -193,11 +194,11 @@ static int check_ob_drawface_dot(Scene *sce, View3D *vd, char dt)
if ((vd->flag & V3D_ZBUF_SELECT) == 0)
return 1;
- /* if its drawing textures with zbuf sel, then dont draw dots */
- if (dt==OB_TEXTURE && vd->drawtype==OB_TEXTURE)
+ /* if its drawing textures with zbuf sel, then don't draw dots */
+ if (dt == OB_TEXTURE && vd->drawtype == OB_TEXTURE)
return 0;
- if (vd->drawtype>=OB_SOLID && vd->flag2 & V3D_SOLID_TEX)
+ if ((vd->drawtype >= OB_SOLID) && (vd->flag2 & V3D_SOLID_TEX))
return 0;
return 1;
@@ -208,10 +209,10 @@ static int check_ob_drawface_dot(Scene *sce, View3D *vd, char dt)
* */
static void view3d_project_short_clip(ARegion *ar, const float vec[3], short adr[2], int is_local)
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
float fx, fy, vec4[4];
- adr[0]= IS_CLIPPED;
+ adr[0] = IS_CLIPPED;
/* clipplanes in eye space */
if (rv3d->rflag & RV3D_CLIPPING) {
@@ -220,21 +221,21 @@ static void view3d_project_short_clip(ARegion *ar, const float vec[3], short adr
}
copy_v3_v3(vec4, vec);
- vec4[3]= 1.0;
+ vec4[3] = 1.0;
mul_m4_v4(rv3d->persmatob, vec4);
/* clipplanes in window space */
- if ( vec4[3] > (float)BL_NEAR_CLIP ) { /* is the NEAR clipping cutoff for picking */
- fx= (ar->winx/2)*(1 + vec4[0]/vec4[3]);
+ if (vec4[3] > (float)BL_NEAR_CLIP) { /* is the NEAR clipping cutoff for picking */
+ fx = (ar->winx / 2) * (1 + vec4[0] / vec4[3]);
- if ( fx>0 && fx<ar->winx) {
+ if (fx > 0 && fx < ar->winx) {
- fy= (ar->winy/2)*(1 + vec4[1]/vec4[3]);
+ fy = (ar->winy / 2) * (1 + vec4[1] / vec4[3]);
if (fy > 0.0f && fy < (float)ar->winy) {
- adr[0]= (short)floorf(fx);
- adr[1]= (short)floorf(fy);
+ adr[0] = (short)floorf(fx);
+ adr[1] = (short)floorf(fy);
}
}
}
@@ -243,28 +244,28 @@ static void view3d_project_short_clip(ARegion *ar, const float vec[3], short adr
/* BMESH NOTE: this function is unused in bmesh only */
/* only use while object drawing */
-static void UNUSED_FUNCTION(view3d_project_short_noclip)(ARegion *ar, const float vec[3], short adr[2])
+static void UNUSED_FUNCTION(view3d_project_short_noclip) (ARegion * ar, const float vec[3], short adr[2])
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
float fx, fy, vec4[4];
- adr[0]= IS_CLIPPED;
+ adr[0] = IS_CLIPPED;
copy_v3_v3(vec4, vec);
- vec4[3]= 1.0;
+ vec4[3] = 1.0;
mul_m4_v4(rv3d->persmatob, vec4);
- if ( vec4[3] > (float)BL_NEAR_CLIP ) { /* is the NEAR clipping cutoff for picking */
- fx= (ar->winx/2)*(1 + vec4[0]/vec4[3]);
+ if (vec4[3] > (float)BL_NEAR_CLIP) { /* is the NEAR clipping cutoff for picking */
+ fx = (ar->winx / 2) * (1 + vec4[0] / vec4[3]);
- if ( fx>-32700 && fx<32700) {
+ if (fx > -32700 && fx < 32700) {
- fy= (ar->winy/2)*(1 + vec4[1]/vec4[3]);
+ fy = (ar->winy / 2) * (1 + vec4[1] / vec4[3]);
if (fy > -32700.0f && fy < 32700.0f) {
- adr[0]= (short)floorf(fx);
- adr[1]= (short)floorf(fy);
+ adr[0] = (short)floorf(fx);
+ adr[1] = (short)floorf(fy);
}
}
}
@@ -273,10 +274,10 @@ static void UNUSED_FUNCTION(view3d_project_short_noclip)(ARegion *ar, const floa
/* same as view3d_project_short_clip but use persmat instead of persmatob for projection */
static void view3d_project_short_clip_persmat(ARegion *ar, const float vec[3], short adr[2], int is_local)
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
float fx, fy, vec4[4];
- adr[0]= IS_CLIPPED;
+ adr[0] = IS_CLIPPED;
/* clipplanes in eye space */
if (rv3d->rflag & RV3D_CLIPPING) {
@@ -285,21 +286,21 @@ static void view3d_project_short_clip_persmat(ARegion *ar, const float vec[3], s
}
copy_v3_v3(vec4, vec);
- vec4[3]= 1.0;
+ vec4[3] = 1.0;
mul_m4_v4(rv3d->persmat, vec4);
/* clipplanes in window space */
- if ( vec4[3] > (float)BL_NEAR_CLIP ) { /* is the NEAR clipping cutoff for picking */
- fx= (ar->winx/2)*(1 + vec4[0]/vec4[3]);
+ if (vec4[3] > (float)BL_NEAR_CLIP) { /* is the NEAR clipping cutoff for picking */
+ fx = (ar->winx / 2) * (1 + vec4[0] / vec4[3]);
- if ( fx>0 && fx<ar->winx) {
+ if (fx > 0 && fx < ar->winx) {
- fy= (ar->winy/2)*(1 + vec4[1]/vec4[3]);
+ fy = (ar->winy / 2) * (1 + vec4[1] / vec4[3]);
if (fy > 0.0f && fy < (float)ar->winy) {
- adr[0]= (short)floorf(fx);
- adr[1]= (short)floorf(fy);
+ adr[0] = (short)floorf(fx);
+ adr[1] = (short)floorf(fy);
}
}
}
@@ -316,7 +317,7 @@ int draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, int dt)
return 0;
if (!CHECK_OB_DRAWTEXTURE(v3d, dt))
return 0;
- if (ob==OBACT && (ob && ob->mode & OB_MODE_WEIGHT_PAINT))
+ if (ob == OBACT && (ob && ob->mode & OB_MODE_WEIGHT_PAINT))
return 0;
if (scene_use_new_shading_nodes(scene))
return 0;
@@ -335,14 +336,13 @@ static int check_alpha_pass(Base *base)
return (base->object->dtx & OB_DRAWTRANSP);
}
- /***/
-static unsigned int colortab[24]=
- {0x0, 0xFF88FF, 0xFFBBFF,
- 0x403000, 0xFFFF88, 0xFFFFBB,
- 0x104040, 0x66CCCC, 0x77CCCC,
- 0x104010, 0x55BB55, 0x66FF66,
- 0xFFFFFF
-};
+/***/
+static unsigned int colortab[24] =
+{0x0, 0xFF88FF, 0xFFBBFF,
+ 0x403000, 0xFFFF88, 0xFFFFBB,
+ 0x104040, 0x66CCCC, 0x77CCCC,
+ 0x104010, 0x55BB55, 0x66FF66,
+ 0xFFFFFF};
static float cube[8][3] = {
@@ -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
@@ -433,16 +433,16 @@ static const float cosval[CIRCLE_RESOL] = {
static void draw_xyz_wire(const float c[3], float size, int axis)
{
- float v1[3]= {0.f, 0.f, 0.f}, v2[3] = {0.f, 0.f, 0.f};
+ float v1[3] = {0.f, 0.f, 0.f}, v2[3] = {0.f, 0.f, 0.f};
float dim = size * 0.1f;
float dx[3], dy[3], dz[3];
- dx[0]=dim; dx[1]=0.f; dx[2]=0.f;
- dy[0]=0.f; dy[1]=dim; dy[2]=0.f;
- dz[0]=0.f; dz[1]=0.f; dz[2]=dim;
+ dx[0] = dim; dx[1] = 0.f; dx[2] = 0.f;
+ dy[0] = 0.f; dy[1] = dim; dy[2] = 0.f;
+ dz[0] = 0.f; dz[1] = 0.f; dz[2] = dim;
- switch(axis) {
- case 0: /* x axis */
+ switch (axis) {
+ case 0: /* x axis */
glBegin(GL_LINES);
/* bottom left to top right */
@@ -464,7 +464,7 @@ static void draw_xyz_wire(const float c[3], float size, int axis)
glEnd();
break;
- case 1: /* y axis */
+ case 1: /* y axis */
glBegin(GL_LINES);
/* bottom left to top right */
@@ -487,7 +487,7 @@ static void draw_xyz_wire(const float c[3], float size, int axis)
glEnd();
break;
- case 2: /* z axis */
+ case 2: /* z axis */
glBegin(GL_LINE_STRIP);
/* start at top left */
@@ -520,108 +520,110 @@ static void draw_xyz_wire(const float c[3], float size, int axis)
void drawaxes(float size, char drawtype)
{
int axis;
- float v1[3]= {0.0, 0.0, 0.0};
- float v2[3]= {0.0, 0.0, 0.0};
- float v3[3]= {0.0, 0.0, 0.0};
-
- switch(drawtype) {
+ float v1[3] = {0.0, 0.0, 0.0};
+ float v2[3] = {0.0, 0.0, 0.0};
+ float v3[3] = {0.0, 0.0, 0.0};
- case OB_PLAINAXES:
- for (axis=0; axis<3; axis++) {
+ switch (drawtype) {
+
+ case OB_PLAINAXES:
+ for (axis = 0; axis < 3; axis++) {
+ glBegin(GL_LINES);
+
+ v1[axis] = size;
+ v2[axis] = -size;
+ glVertex3fv(v1);
+ glVertex3fv(v2);
+
+ /* reset v1 & v2 to zero */
+ v1[axis] = v2[axis] = 0.0f;
+
+ glEnd();
+ }
+ break;
+ case OB_SINGLE_ARROW:
+
glBegin(GL_LINES);
-
- v1[axis]= size;
- v2[axis]= -size;
+ /* in positive z direction only */
+ v1[2] = size;
glVertex3fv(v1);
glVertex3fv(v2);
+ glEnd();
- /* reset v1 & v2 to zero */
- v1[axis]= v2[axis]= 0.0f;
+ /* square pyramid */
+ glBegin(GL_TRIANGLES);
+
+ v2[0] = size * 0.035f; v2[1] = size * 0.035f;
+ v3[0] = size * -0.035f; v3[1] = size * 0.035f;
+ v2[2] = v3[2] = size * 0.75f;
+
+ for (axis = 0; axis < 4; axis++) {
+ if (axis % 2 == 1) {
+ v2[0] = -v2[0];
+ v3[1] = -v3[1];
+ }
+ else {
+ v2[1] = -v2[1];
+ v3[0] = -v3[0];
+ }
+
+ glVertex3fv(v1);
+ glVertex3fv(v2);
+ glVertex3fv(v3);
- glEnd();
- }
- break;
- case OB_SINGLE_ARROW:
-
- glBegin(GL_LINES);
- /* in positive z direction only */
- v1[2]= size;
- glVertex3fv(v1);
- glVertex3fv(v2);
- glEnd();
-
- /* square pyramid */
- glBegin(GL_TRIANGLES);
-
- v2[0]= size * 0.035f; v2[1] = size * 0.035f;
- v3[0]= size * -0.035f; v3[1] = size * 0.035f;
- v2[2]= v3[2]= size * 0.75f;
-
- for (axis=0; axis<4; axis++) {
- if (axis % 2 == 1) {
- v2[0] = -v2[0];
- v3[1] = -v3[1];
- }
- else {
- v2[1] = -v2[1];
- v3[0] = -v3[0];
}
-
- glVertex3fv(v1);
- glVertex3fv(v2);
- glVertex3fv(v3);
-
- }
- glEnd();
-
- break;
- case OB_CUBE:
- drawcube_size(size);
- break;
-
- case OB_CIRCLE:
- drawcircle_size(size);
- break;
-
- case OB_EMPTY_SPHERE:
- draw_empty_sphere(size);
- break;
+ glEnd();
- case OB_EMPTY_CONE:
- draw_empty_cone(size);
- break;
+ break;
+ case OB_CUBE:
+ drawcube_size(size);
+ break;
- case OB_ARROWS:
- default:
- for (axis=0; axis<3; axis++) {
- const int arrow_axis= (axis==0) ? 1:0;
+ case OB_CIRCLE:
+ drawcircle_size(size);
+ break;
- glBegin(GL_LINES);
-
- v2[axis]= size;
- glVertex3fv(v1);
- glVertex3fv(v2);
+ case OB_EMPTY_SPHERE:
+ draw_empty_sphere(size);
+ break;
+
+ case OB_EMPTY_CONE:
+ draw_empty_cone(size);
+ break;
+
+ case OB_ARROWS:
+ default:
+ {
+ for (axis = 0; axis < 3; axis++) {
+ const int arrow_axis = (axis == 0) ? 1 : 0;
+
+ glBegin(GL_LINES);
+
+ v2[axis] = size;
+ glVertex3fv(v1);
+ glVertex3fv(v2);
- v1[axis]= size*0.85f;
- v1[arrow_axis]= -size*0.08f;
- glVertex3fv(v1);
- glVertex3fv(v2);
+ v1[axis] = size * 0.85f;
+ v1[arrow_axis] = -size * 0.08f;
+ glVertex3fv(v1);
+ glVertex3fv(v2);
- v1[arrow_axis]= size*0.08f;
- glVertex3fv(v1);
- glVertex3fv(v2);
-
- glEnd();
+ v1[arrow_axis] = size * 0.08f;
+ glVertex3fv(v1);
+ glVertex3fv(v2);
+
+ glEnd();
- v2[axis]+= size*0.125f;
-
- draw_xyz_wire(v2, size, axis);
-
-
- /* reset v1 & v2 to zero */
- v1[arrow_axis]= v1[axis]= v2[axis]= 0.0f;
+ v2[axis] += size * 0.125f;
+
+ draw_xyz_wire(v2, size, axis);
+
+
+ /* reset v1 & v2 to zero */
+ v1[arrow_axis] = v1[axis] = v2[axis] = 0.0f;
+ }
+ break;
}
- break;
}
}
@@ -629,7 +631,7 @@ void drawaxes(float size, char drawtype)
/* Function to draw an Image on a empty Object */
static void draw_empty_image(Object *ob)
{
- Image *ima = (Image*)ob->data;
+ Image *ima = (Image *)ob->data;
ImBuf *ibuf = ima ? BKE_image_get_ibuf(ima, NULL) : NULL;
float scale, ofs_x, ofs_y, sca_x, sca_y;
@@ -641,37 +643,37 @@ static void draw_empty_image(Object *ob)
/* Get the buffer dimensions so we can fallback to fake ones */
if (ibuf && ibuf->rect) {
- ima_x= ibuf->x;
- ima_y= ibuf->y;
+ ima_x = ibuf->x;
+ ima_y = ibuf->y;
}
else {
- ima_x= 1;
- ima_y= 1;
+ ima_x = 1;
+ ima_y = 1;
}
/* Get the image aspect even if the buffer is invalid */
if (ima) {
if (ima->aspx > ima->aspy) {
- sca_x= 1.0f;
- sca_y= ima->aspy / ima->aspx;
+ sca_x = 1.0f;
+ sca_y = ima->aspy / ima->aspx;
}
else if (ima->aspx < ima->aspy) {
- sca_x= ima->aspx / ima->aspy;
- sca_y= 1.0f;
+ sca_x = ima->aspx / ima->aspy;
+ sca_y = 1.0f;
}
else {
- sca_x= 1.0f;
- sca_y= 1.0f;
+ sca_x = 1.0f;
+ sca_y = 1.0f;
}
}
else {
- sca_x= 1.0f;
- sca_y= 1.0f;
+ sca_x = 1.0f;
+ sca_y = 1.0f;
}
/* Calculate the scale center based on objects origin */
- ofs_x= ob->ima_ofs[0] * ima_x;
- ofs_y= ob->ima_ofs[1] * ima_y;
+ ofs_x = ob->ima_ofs[0] * ima_x;
+ ofs_y = ob->ima_ofs[1] * ima_y;
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
@@ -680,7 +682,7 @@ static void draw_empty_image(Object *ob)
glTranslatef(0.0f, 0.0f, 0.0f);
/* Calculate Image scale */
- scale= (ob->empty_drawsize / (float)MAX2(ima_x * sca_x, ima_y * sca_y));
+ scale = (ob->empty_drawsize / (float)MAX2(ima_x * sca_x, ima_y * sca_y));
/* Set the object scale */
glScalef(scale * sca_x, scale * sca_y, 1.0f);
@@ -718,16 +720,16 @@ static void draw_empty_image(Object *ob)
static void circball_array_fill(float verts[CIRCLE_RESOL][3], const float cent[3], float rad, float tmat[][4])
{
float vx[3], vy[3];
- float *viter= (float *)verts;
+ float *viter = (float *)verts;
unsigned int a;
mul_v3_v3fl(vx, tmat[0], rad);
mul_v3_v3fl(vy, tmat[1], rad);
- for (a=0; a < CIRCLE_RESOL; a++, viter += 3) {
- viter[0]= cent[0] + sinval[a] * vx[0] + cosval[a] * vy[0];
- viter[1]= cent[1] + sinval[a] * vx[1] + cosval[a] * vy[1];
- viter[2]= cent[2] + sinval[a] * vx[2] + cosval[a] * vy[2];
+ for (a = 0; a < CIRCLE_RESOL; a++, viter += 3) {
+ viter[0] = cent[0] + sinval[a] * vx[0] + cosval[a] * vy[0];
+ viter[1] = cent[1] + sinval[a] * vx[1] + cosval[a] * vy[1];
+ viter[2] = cent[2] + sinval[a] * vx[2] + cosval[a] * vy[2];
}
}
@@ -746,16 +748,16 @@ void drawcircball(int mode, const float cent[3], float rad, float tmat[][4])
/* circle for object centers, special_color is for library or ob users */
static void drawcentercircle(View3D *v3d, RegionView3D *rv3d, const float co[3], int selstate, int special_color)
{
- const float size= ED_view3d_pixel_size(rv3d, co) * (float)U.obcenter_dia * 0.5f;
+ const float size = ED_view3d_pixel_size(rv3d, co) * (float)U.obcenter_dia * 0.5f;
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 */
- if (v3d->zbuf) glDepthFunc(GL_ALWAYS);
+ * but not checks for it, so centers remain visible independent order of drawing */
+ if (v3d->zbuf) glDepthFunc(GL_ALWAYS);
glEnable(GL_BLEND);
if (special_color) {
- if (selstate==ACTIVE || selstate==SELECT) glColor4ub(0x88, 0xFF, 0xFF, 155);
+ if (selstate == ACTIVE || selstate == SELECT) glColor4ub(0x88, 0xFF, 0xFF, 155);
else glColor4ub(0x55, 0xCC, 0xCC, 155);
}
@@ -778,17 +780,17 @@ 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);
- if (v3d->zbuf) glDepthFunc(GL_LEQUAL);
+ if (v3d->zbuf) glDepthFunc(GL_LEQUAL);
}
/* *********** text drawing for object/particles/armature ************* */
static ListBase CachedText[3];
-static int CachedTextLevel= 0;
+static int CachedTextLevel = 0;
typedef struct ViewCachedString {
struct ViewCachedString *next, *prev;
@@ -806,8 +808,8 @@ typedef struct ViewCachedString {
void view3d_cached_text_draw_begin(void)
{
- ListBase *strings= &CachedText[CachedTextLevel];
- strings->first= strings->last= NULL;
+ ListBase *strings = &CachedText[CachedTextLevel];
+ strings->first = strings->last = NULL;
CachedTextLevel++;
}
@@ -816,17 +818,17 @@ void view3d_cached_text_draw_add(const float co[3],
short xoffs, short flag,
const unsigned char col[4])
{
- int alloc_len= strlen(str) + 1;
- ListBase *strings= &CachedText[CachedTextLevel-1];
+ int alloc_len = strlen(str) + 1;
+ ListBase *strings = &CachedText[CachedTextLevel - 1];
/* TODO, replace with more efficient malloc, perhaps memarena per draw? */
- ViewCachedString *vos= MEM_callocN(sizeof(ViewCachedString) + alloc_len, "ViewCachedString");
+ ViewCachedString *vos = MEM_callocN(sizeof(ViewCachedString) + alloc_len, "ViewCachedString");
BLI_addtail(strings, vos);
copy_v3_v3(vos->vec, co);
- vos->col.pack= *((int *)col);
- vos->xoffs= xoffs;
- vos->flag= flag;
- vos->str_len= alloc_len-1;
+ vos->col.pack = *((int *)col);
+ vos->xoffs = xoffs;
+ vos->flag = flag;
+ vos->str_len = alloc_len - 1;
/* allocate past the end */
memcpy(++vos, str, alloc_len);
@@ -834,13 +836,13 @@ void view3d_cached_text_draw_add(const float co[3],
void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, float mat[][4])
{
- RegionView3D *rv3d= ar->regiondata;
- ListBase *strings= &CachedText[CachedTextLevel-1];
+ RegionView3D *rv3d = ar->regiondata;
+ ListBase *strings = &CachedText[CachedTextLevel - 1];
ViewCachedString *vos;
- int tot= 0;
+ int tot = 0;
/* project first and test */
- for (vos= strings->first; vos; vos= vos->next) {
+ for (vos = strings->first; vos; vos = vos->next) {
if (mat && !(vos->flag & V3D_CACHE_TEXT_WORLDSPACE))
mul_m4_v3(mat, vos->vec);
@@ -849,12 +851,12 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa
else
view3d_project_short_clip(ar, vos->vec, vos->sco, (vos->flag & V3D_CACHE_TEXT_LOCALCLIP) != 0);
- if (vos->sco[0]!=IS_CLIPPED)
+ if (vos->sco[0] != IS_CLIPPED)
tot++;
}
if (tot) {
- int col_pack_prev= 0;
+ int col_pack_prev = 0;
#if 0
bglMats mats; /* ZBuffer depth vars */
@@ -881,34 +883,34 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa
glDepthMask(0);
}
- for (vos= strings->first; vos; vos= vos->next) {
+ for (vos = strings->first; vos; vos = vos->next) {
/* too slow, reading opengl info while drawing is very bad,
* better to see if we can use the zbuffer while in pixel space - campbell */
#if 0
if (v3d->zbuf && (vos->flag & V3D_CACHE_TEXT_ZBUF)) {
gluProject(vos->vec[0], vos->vec[1], vos->vec[2], mats.modelview, mats.projection, (GLint *)mats.viewport, &ux, &uy, &uz);
- glReadPixels(ar->winrct.xmin+vos->mval[0]+vos->xoffs, ar->winrct.ymin+vos->mval[1], 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
+ glReadPixels(ar->winrct.xmin + vos->mval[0] + vos->xoffs, ar->winrct.ymin + vos->mval[1], 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
if (uz > depth)
continue;
}
#endif
- if (vos->sco[0]!=IS_CLIPPED) {
- const char *str= (char *)(vos+1);
+ if (vos->sco[0] != IS_CLIPPED) {
+ const char *str = (char *)(vos + 1);
if (col_pack_prev != vos->col.pack) {
glColor3ubv(vos->col.ub);
- col_pack_prev= vos->col.pack;
+ col_pack_prev = vos->col.pack;
}
((vos->flag & V3D_CACHE_TEXT_ASCII) ?
- BLF_draw_default_ascii :
- BLF_draw_default
- ) ( (float)vos->sco[0] + vos->xoffs,
- (float)vos->sco[1],
- (depth_write) ? 0.0f: 2.0f,
- str,
- vos->str_len);
+ BLF_draw_default_ascii :
+ BLF_draw_default
+ )( (float)vos->sco[0] + vos->xoffs,
+ (float)vos->sco[1],
+ (depth_write) ? 0.0f : 2.0f,
+ str,
+ vos->str_len);
}
}
@@ -939,21 +941,21 @@ static void drawcube(void)
{
glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[0]); glVertex3fv(cube[1]);glVertex3fv(cube[2]); glVertex3fv(cube[3]);
- glVertex3fv(cube[0]); glVertex3fv(cube[4]);glVertex3fv(cube[5]); glVertex3fv(cube[6]);
- glVertex3fv(cube[7]); glVertex3fv(cube[4]);
+ glVertex3fv(cube[0]); glVertex3fv(cube[1]); glVertex3fv(cube[2]); glVertex3fv(cube[3]);
+ glVertex3fv(cube[0]); glVertex3fv(cube[4]); glVertex3fv(cube[5]); glVertex3fv(cube[6]);
+ glVertex3fv(cube[7]); glVertex3fv(cube[4]);
glEnd();
glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[1]); glVertex3fv(cube[5]);
+ glVertex3fv(cube[1]); glVertex3fv(cube[5]);
glEnd();
glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[2]); glVertex3fv(cube[6]);
+ glVertex3fv(cube[2]); glVertex3fv(cube[6]);
glEnd();
glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[3]); glVertex3fv(cube[7]);
+ glVertex3fv(cube[3]); glVertex3fv(cube[7]);
glEnd();
}
@@ -963,25 +965,25 @@ static void drawcube(void)
static void drawcube_size(float size)
{
glBegin(GL_LINE_STRIP);
- glVertex3f(-size,-size,-size); glVertex3f(-size,-size,size);
- glVertex3f(-size,size,size); glVertex3f(-size,size,-size);
+ glVertex3f(-size, -size, -size); glVertex3f(-size, -size, size);
+ glVertex3f(-size, size, size); glVertex3f(-size, size, -size);
- glVertex3f(-size,-size,-size); glVertex3f(size,-size,-size);
- glVertex3f(size,-size,size); glVertex3f(size,size,size);
+ glVertex3f(-size, -size, -size); glVertex3f(size, -size, -size);
+ glVertex3f(size, -size, size); glVertex3f(size, size, size);
- glVertex3f(size,size,-size); glVertex3f(size,-size,-size);
+ glVertex3f(size, size, -size); glVertex3f(size, -size, -size);
glEnd();
glBegin(GL_LINE_STRIP);
- glVertex3f(-size,-size,size); glVertex3f(size,-size,size);
+ glVertex3f(-size, -size, size); glVertex3f(size, -size, size);
glEnd();
glBegin(GL_LINE_STRIP);
- glVertex3f(-size,size,size); glVertex3f(size,size,size);
+ glVertex3f(-size, size, size); glVertex3f(size, size, size);
glEnd();
glBegin(GL_LINE_STRIP);
- glVertex3f(-size,size,-size); glVertex3f(size,size,-size);
+ glVertex3f(-size, size, -size); glVertex3f(size, size, -size);
glEnd();
}
@@ -995,21 +997,21 @@ static void drawcube_size(const float size[3])
glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[0]); glVertex3fv(cube[1]);glVertex3fv(cube[2]); glVertex3fv(cube[3]);
- glVertex3fv(cube[0]); glVertex3fv(cube[4]);glVertex3fv(cube[5]); glVertex3fv(cube[6]);
- glVertex3fv(cube[7]); glVertex3fv(cube[4]);
+ glVertex3fv(cube[0]); glVertex3fv(cube[1]); glVertex3fv(cube[2]); glVertex3fv(cube[3]);
+ glVertex3fv(cube[0]); glVertex3fv(cube[4]); glVertex3fv(cube[5]); glVertex3fv(cube[6]);
+ glVertex3fv(cube[7]); glVertex3fv(cube[4]);
glEnd();
glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[1]); glVertex3fv(cube[5]);
+ glVertex3fv(cube[1]); glVertex3fv(cube[5]);
glEnd();
glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[2]); glVertex3fv(cube[6]);
+ glVertex3fv(cube[2]); glVertex3fv(cube[6]);
glEnd();
glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[3]); glVertex3fv(cube[7]);
+ glVertex3fv(cube[3]); glVertex3fv(cube[7]);
glEnd();
glPopMatrix();
@@ -1027,8 +1029,8 @@ static void drawshadbuflimits(Lamp *la, float mat[][4])
madd_v3_v3v3fl(end, mat[3], lavec, la->clipend);
glBegin(GL_LINE_STRIP);
- glVertex3fv(sta);
- glVertex3fv(end);
+ glVertex3fv(sta);
+ glVertex3fv(end);
glEnd();
glPointSize(3.0);
@@ -1044,20 +1046,20 @@ static void drawshadbuflimits(Lamp *la, float mat[][4])
static void spotvolume(float lvec[3], float vvec[3], const float inp)
{
/* camera is at 0,0,0 */
- float temp[3],plane[3],mat1[3][3],mat2[3][3],mat3[3][3],mat4[3][3],q[4],co,si,angle;
+ float temp[3], plane[3], mat1[3][3], mat2[3][3], mat3[3][3], mat4[3][3], q[4], co, si, angle;
normalize_v3(lvec);
- normalize_v3(vvec); /* is this the correct vector ? */
+ normalize_v3(vvec); /* is this the correct vector ? */
- cross_v3_v3v3(temp,vvec,lvec); /* equation for a plane through vvec en lvec */
- cross_v3_v3v3(plane,lvec,temp); /* a plane perpendicular to this, parrallel with lvec */
+ cross_v3_v3v3(temp, vvec, lvec); /* equation for a plane through vvec en lvec */
+ cross_v3_v3v3(plane, lvec, temp); /* a plane perpendicular to this, parrallel with lvec */
/* vectors are exactly aligned, use the X axis, this is arbitrary */
if (normalize_v3(plane) == 0.0f)
- plane[1]= 1.0f;
+ 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]);*/
@@ -1069,46 +1071,46 @@ static void spotvolume(float lvec[3], float vvec[3], const float inp)
q[3] = 0;
normalize_v3(&q[1]);
- angle = saacos(plane[2])/2.0f;
+ angle = saacos(plane[2]) / 2.0f;
co = cosf(angle);
- si = sqrtf(1-co*co);
+ si = sqrtf(1 - co * co);
q[0] = co;
q[1] *= si;
q[2] *= si;
q[3] = 0;
- quat_to_mat3(mat1,q);
+ quat_to_mat3(mat1, q);
/* rotate lamp vector now over acos(inp) degrees */
copy_v3_v3(vvec, lvec);
unit_m3(mat2);
co = inp;
- si = sqrtf(1.0f-inp*inp);
+ si = sqrtf(1.0f - inp * inp);
mat2[0][0] = co;
mat2[1][0] = -si;
mat2[0][1] = si;
mat2[1][1] = co;
- mul_m3_m3m3(mat3,mat2,mat1);
+ mul_m3_m3m3(mat3, mat2, mat1);
mat2[1][0] = si;
mat2[0][1] = -si;
- mul_m3_m3m3(mat4,mat2,mat1);
+ mul_m3_m3m3(mat4, mat2, mat1);
transpose_m3(mat1);
- mul_m3_m3m3(mat2,mat1,mat3);
- mul_m3_v3(mat2,lvec);
- mul_m3_m3m3(mat2,mat1,mat4);
- mul_m3_v3(mat2,vvec);
+ mul_m3_m3m3(mat2, mat1, mat3);
+ mul_m3_v3(mat2, lvec);
+ mul_m3_m3m3(mat2, mat1, mat4);
+ mul_m3_v3(mat2, vvec);
return;
}
static void draw_spot_cone(Lamp *la, float x, float z)
{
- z= fabs(z);
+ z = fabs(z);
glBegin(GL_TRIANGLE_FAN);
glVertex3f(0.0f, 0.0f, -x);
@@ -1124,9 +1126,9 @@ static void draw_spot_cone(Lamp *la, float x, float z)
float angle;
int a;
- for (a=0; a<33; a++) {
- angle= a*M_PI*2/(33-1);
- glVertex3f(z*cosf(angle), z*sinf(angle), 0);
+ for (a = 0; a < 33; a++) {
+ angle = a * M_PI * 2 / (33 - 1);
+ glVertex3f(z * cosf(angle), z * sinf(angle), 0);
}
}
@@ -1150,7 +1152,7 @@ static void draw_transp_spot_volume(Lamp *la, float x, float z)
/* draw front side lighting */
glCullFace(GL_BACK);
- glBlendFunc(GL_ONE, GL_ONE);
+ glBlendFunc(GL_ONE, GL_ONE);
glColor4f(0.2f, 0.2f, 0.2f, 1.0f);
draw_spot_cone(la, x, z);
@@ -1165,22 +1167,22 @@ static void draw_transp_spot_volume(Lamp *la, float x, float z)
static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int dt, int flag)
{
- Object *ob= base->object;
- const float pixsize= ED_view3d_pixel_size(rv3d, ob->obmat[3]);
- Lamp *la= ob->data;
- float vec[3], lvec[3], vvec[3], circrad, x,y,z;
+ Object *ob = base->object;
+ const float pixsize = ED_view3d_pixel_size(rv3d, ob->obmat[3]);
+ Lamp *la = ob->data;
+ float vec[3], lvec[3], vvec[3], circrad, x, y, z;
float lampsize;
float imat[4][4], curcol[4];
unsigned char col[4];
/* cone can't be drawn for duplicated lamps, because duplilist would be freed to */
/* the moment of view3d_draw_transp() call */
- const short is_view= (rv3d->persp==RV3D_CAMOB && v3d->camera == base->object);
- const short drawcone= ((dt > OB_WIRE) &&
- !(G.f & G_PICKSEL) &&
- (la->type == LA_SPOT) &&
- (la->mode & LA_SHOW_CONE) &&
- !(base->flag & OB_FROMDUPLI) &&
- !is_view);
+ const short is_view = (rv3d->persp == RV3D_CAMOB && v3d->camera == base->object);
+ const short drawcone = ((dt > OB_WIRE) &&
+ !(G.f & G_PICKSEL) &&
+ (la->type == LA_SPOT) &&
+ (la->mode & LA_SHOW_CONE) &&
+ !(base->flag & OB_FROMDUPLI) &&
+ !is_view);
if (drawcone && !v3d->transp) {
/* in this case we need to draw delayed */
@@ -1193,7 +1195,7 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
glLoadMatrixf(rv3d->viewmat);
/* lets calculate the scale: */
- lampsize= pixsize*((float)U.obcenter_dia*0.5f);
+ lampsize = pixsize * ((float)U.obcenter_dia * 0.5f);
/* and view aligned matrix: */
copy_m4_m4(imat, rv3d->viewinv);
@@ -1205,13 +1207,13 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
/* for AA effects */
glGetFloatv(GL_CURRENT_COLOR, curcol);
- curcol[3]= 0.6;
+ curcol[3] = 0.6;
glColor4fv(curcol);
if (lampsize > 0.0f) {
- if (ob->id.us>1) {
- if (ob==OBACT || (ob->flag & SELECT)) glColor4ub(0x88, 0xFF, 0xFF, 155);
+ if (ob->id.us > 1) {
+ if (ob == OBACT || (ob->flag & SELECT)) glColor4ub(0x88, 0xFF, 0xFF, 155);
else glColor4ub(0x77, 0xCC, 0xCC, 155);
}
@@ -1222,21 +1224,19 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
drawcircball(GL_POLYGON, vec, lampsize, imat);
/* restore */
- if (ob->id.us>1)
+ if (ob->id.us > 1)
glColor4fv(curcol);
-
+
/* Outer circle */
- circrad = 3.0f*lampsize;
+ circrad = 3.0f * lampsize;
setlinestyle(3);
drawcircball(GL_LINE_LOOP, vec, circrad, imat);
/* draw dashed outer circle if shadow is on. remember some lamps can't have certain shadows! */
- if (la->type!=LA_HEMI) {
- if ( (la->mode & LA_SHAD_RAY) ||
- ((la->mode & LA_SHAD_BUF) && (la->type==LA_SPOT))
- ) {
- drawcircball(GL_LINE_LOOP, vec, circrad + 3.0f*pixsize, imat);
+ if (la->type != LA_HEMI) {
+ if ((la->mode & LA_SHAD_RAY) || ((la->mode & LA_SHAD_BUF) && (la->type == LA_SPOT))) {
+ drawcircball(GL_LINE_LOOP, vec, circrad + 3.0f * pixsize, imat);
}
}
}
@@ -1246,12 +1246,12 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
}
/* draw the pretty sun rays */
- if (la->type==LA_SUN) {
+ if (la->type == LA_SUN) {
float v1[3], v2[3], mat[3][3];
short axis;
/* setup a 45 degree rotation matrix */
- vec_rot_to_mat3(mat, imat[2], (float)M_PI/4.0f);
+ vec_rot_to_mat3(mat, imat[2], (float)M_PI / 4.0f);
/* vectors */
mul_v3_v3fl(v1, imat[0], circrad * 1.2f);
@@ -1263,7 +1263,7 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
setlinestyle(3);
glBegin(GL_LINES);
- for (axis=0; axis<8; axis++) {
+ for (axis = 0; axis < 8; axis++) {
glVertex3fv(v1);
glVertex3fv(v2);
mul_m3_v3(mat, v1);
@@ -1273,32 +1273,32 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
glTranslatef(-vec[0], -vec[1], -vec[2]);
- }
+ }
- if (la->type==LA_LOCAL) {
+ if (la->type == LA_LOCAL) {
if (la->mode & LA_SPHERE) {
drawcircball(GL_LINE_LOOP, vec, la->dist, imat);
}
/* yafray: for photonlight also draw lightcone as for spot */
}
- glPopMatrix(); /* back in object space */
+ glPopMatrix(); /* back in object space */
zero_v3(vec);
if (is_view) {
/* skip drawing extra info */
}
- else if ((la->type==LA_SPOT) || (la->type==LA_YF_PHOTON)) {
- lvec[0]=lvec[1]= 0.0;
+ else if ((la->type == LA_SPOT) || (la->type == LA_YF_PHOTON)) {
+ lvec[0] = lvec[1] = 0.0;
lvec[2] = 1.0;
x = rv3d->persmat[0][2];
y = rv3d->persmat[1][2];
z = rv3d->persmat[2][2];
- vvec[0]= x*ob->obmat[0][0] + y*ob->obmat[0][1] + z*ob->obmat[0][2];
- vvec[1]= x*ob->obmat[1][0] + y*ob->obmat[1][1] + z*ob->obmat[1][2];
- vvec[2]= x*ob->obmat[2][0] + y*ob->obmat[2][1] + z*ob->obmat[2][2];
+ vvec[0] = x * ob->obmat[0][0] + y * ob->obmat[0][1] + z * ob->obmat[0][2];
+ vvec[1] = x * ob->obmat[1][0] + y * ob->obmat[1][1] + z * ob->obmat[1][2];
+ vvec[2] = x * ob->obmat[2][0] + y * ob->obmat[2][1] + z * ob->obmat[2][2];
- y = cosf(la->spotsize*(float)(M_PI/360.0));
+ y = cosf(la->spotsize * (float)(M_PI / 360.0));
spotvolume(lvec, vvec, y);
x = -la->dist;
mul_v3_fl(lvec, x);
@@ -1306,41 +1306,41 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
/* draw the angled sides of the cone */
glBegin(GL_LINE_STRIP);
- glVertex3fv(vvec);
- glVertex3fv(vec);
- glVertex3fv(lvec);
+ glVertex3fv(vvec);
+ glVertex3fv(vec);
+ glVertex3fv(lvec);
glEnd();
- z = x*sqrtf(1.0f - y*y);
+ z = x * sqrtf(1.0f - y * y);
x *= y;
/* draw the circle/square at the end of the cone */
- glTranslatef(0.0, 0.0 , x);
+ glTranslatef(0.0, 0.0, x);
if (la->mode & LA_SQUARE) {
float tvec[3];
- float z_abs= fabs(z);
+ float z_abs = fabs(z);
- tvec[0]= tvec[1]= z_abs;
- tvec[2]= 0.0;
+ tvec[0] = tvec[1] = z_abs;
+ tvec[2] = 0.0;
glBegin(GL_LINE_LOOP);
- glVertex3fv(tvec);
- tvec[1]= -z_abs; /* neg */
- glVertex3fv(tvec);
- tvec[0]= -z_abs; /* neg */
- glVertex3fv(tvec);
- tvec[1]= z_abs; /* pos */
- glVertex3fv(tvec);
+ glVertex3fv(tvec);
+ tvec[1] = -z_abs; /* neg */
+ glVertex3fv(tvec);
+ tvec[0] = -z_abs; /* neg */
+ glVertex3fv(tvec);
+ tvec[1] = z_abs; /* pos */
+ glVertex3fv(tvec);
glEnd();
}
else circ(0.0, 0.0, fabsf(z));
/* draw the circle/square representing spotbl */
- if (la->type==LA_SPOT) {
- float spotblcirc = fabs(z)*(1 - pow(la->spotblend, 2));
+ 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);
}
@@ -1349,32 +1349,32 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
draw_transp_spot_volume(la, x, z);
/* draw clip start, useful for wide cones where its not obvious where the start is */
- glTranslatef(0.0, 0.0 , -x); /* reverse translation above */
- if (la->type==LA_SPOT && (la->mode & LA_SHAD_BUF) ) {
+ glTranslatef(0.0, 0.0, -x); /* reverse translation above */
+ if (la->type == LA_SPOT && (la->mode & LA_SHAD_BUF) ) {
float lvec_clip[3];
float vvec_clip[3];
- float clipsta_fac= la->clipsta / -x;
+ float clipsta_fac = la->clipsta / -x;
interp_v3_v3v3(lvec_clip, vec, lvec, clipsta_fac);
interp_v3_v3v3(vvec_clip, vec, vvec, clipsta_fac);
glBegin(GL_LINE_STRIP);
- glVertex3fv(lvec_clip);
- glVertex3fv(vvec_clip);
+ glVertex3fv(lvec_clip);
+ glVertex3fv(vvec_clip);
glEnd();
}
}
- else if ELEM(la->type, LA_HEMI, LA_SUN) {
+ else if (ELEM(la->type, LA_HEMI, LA_SUN)) {
/* draw the line from the circle along the dist */
glBegin(GL_LINE_STRIP);
- vec[2] = -circrad;
- glVertex3fv(vec);
- vec[2]= -la->dist;
- glVertex3fv(vec);
+ vec[2] = -circrad;
+ glVertex3fv(vec);
+ vec[2] = -la->dist;
+ glVertex3fv(vec);
glEnd();
- if (la->type==LA_HEMI) {
+ if (la->type == LA_HEMI) {
/* draw the hemisphere curves */
short axis, steps, dir;
float outdist, zdist, mul;
@@ -1383,25 +1383,24 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
setlinestyle(4);
/* loop over the 4 compass points, and draw each arc as a LINE_STRIP */
- for (axis=0; axis<4; axis++) {
- float v[3]= {0.0, 0.0, 0.0};
+ for (axis = 0; axis < 4; axis++) {
+ float v[3] = {0.0, 0.0, 0.0};
zdist = 0.02;
glBegin(GL_LINE_STRIP);
- for (steps=0; steps<6; steps++) {
- if (axis == 0 || axis == 1) { /* x axis up, x axis down */
+ for (steps = 0; steps < 6; steps++) {
+ if (axis == 0 || axis == 1) { /* x axis up, x axis down */
/* make the arcs start at the edge of the energy circle */
- if (steps == 0) v[0] = dir*circrad;
- else v[0] = v[0] + dir*(steps*outdist);
+ if (steps == 0) v[0] = dir * circrad;
+ else v[0] = v[0] + dir * (steps * outdist);
}
- else if (axis == 2 || axis == 3) { /* y axis up, y axis down */
+ else if (axis == 2 || axis == 3) { /* y axis up, y axis down */
/* make the arcs start at the edge of the energy circle */
- if (steps == 0) v[1] = dir*circrad;
- else v[1] = v[1] + dir*(steps*outdist);
+ v[1] = (steps == 0) ? (dir * circrad) : (v[1] + dir * (steps * outdist));
}
-
- v[2] = v[2] - steps*zdist;
+
+ v[2] = v[2] - steps * zdist;
glVertex3fv(v);
@@ -1414,16 +1413,16 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
}
}
}
- else if (la->type==LA_AREA) {
+ else if (la->type == LA_AREA) {
setlinestyle(3);
- if (la->area_shape==LA_AREA_SQUARE)
- fdrawbox(-la->area_size*0.5f, -la->area_size*0.5f, la->area_size*0.5f, la->area_size*0.5f);
- else if (la->area_shape==LA_AREA_RECT)
- fdrawbox(-la->area_size*0.5f, -la->area_sizey*0.5f, la->area_size*0.5f, la->area_sizey*0.5f);
-
- glBegin(GL_LINE_STRIP);
- glVertex3f(0.0,0.0,-circrad);
- glVertex3f(0.0,0.0,-la->dist);
+ if (la->area_shape == LA_AREA_SQUARE)
+ fdrawbox(-la->area_size * 0.5f, -la->area_size * 0.5f, la->area_size * 0.5f, la->area_size * 0.5f);
+ else if (la->area_shape == LA_AREA_RECT)
+ fdrawbox(-la->area_size * 0.5f, -la->area_sizey * 0.5f, la->area_size * 0.5f, la->area_sizey * 0.5f);
+
+ glBegin(GL_LINE_STRIP);
+ glVertex3f(0.0, 0.0, -circrad);
+ glVertex3f(0.0, 0.0, -la->dist);
glEnd();
}
@@ -1439,21 +1438,21 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
UI_GetThemeColor4ubv(TH_LAMP, col);
glColor4ubv(col);
-
+
glEnable(GL_BLEND);
- if (vec[2]>0) vec[2] -= circrad;
+ if (vec[2] > 0) vec[2] -= circrad;
else vec[2] += circrad;
glBegin(GL_LINE_STRIP);
- glVertex3fv(vec);
- vec[2]= 0;
- glVertex3fv(vec);
+ glVertex3fv(vec);
+ vec[2] = 0;
+ glVertex3fv(vec);
glEnd();
glPointSize(2.0);
glBegin(GL_POINTS);
- glVertex3fv(vec);
+ glVertex3fv(vec);
glEnd();
glPointSize(1.0);
@@ -1482,7 +1481,7 @@ static void draw_limit_line(float sta, float end, unsigned int col)
/* yafray: draw camera focus point (cross, similar to aqsis code in tuhopuu) */
-/* qdn: now also enabled for Blender to set focus point for defocus composit node */
+/* qdn: now also enabled for Blender to set focus point for defocus composite node */
static void draw_focus_cross(float dist, float size)
{
glBegin(GL_LINES);
@@ -1495,22 +1494,22 @@ static void draw_focus_cross(float dist, float size)
#ifdef VIEW3D_CAMERA_BORDER_HACK
float view3d_camera_border_hack_col[4];
-short view3d_camera_border_hack_test= FALSE;
+short view3d_camera_border_hack_test = FALSE;
#endif
/* ****************** draw clip data *************** */
static void draw_bundle_sphere(void)
{
- static GLuint displist= 0;
+ static GLuint displist = 0;
if (displist == 0) {
GLUquadricObj *qobj;
- displist= glGenLists(1);
+ displist = glGenLists(1);
glNewList(displist, GL_COMPILE);
- qobj= gluNewQuadric();
+ qobj = gluNewQuadric();
gluQuadricDrawStyle(qobj, GLU_FILL);
glShadeModel(GL_SMOOTH);
gluSphere(qobj, 0.05, 8, 8);
@@ -1524,15 +1523,15 @@ static void draw_bundle_sphere(void)
}
static void draw_viewport_object_reconstruction(Scene *scene, Base *base, View3D *v3d,
- MovieClip *clip, MovieTrackingObject *tracking_object, int flag,
- int *global_track_index, int draw_selected)
+ MovieClip *clip, MovieTrackingObject *tracking_object, int flag,
+ int *global_track_index, int draw_selected)
{
- MovieTracking *tracking= &clip->tracking;
+ MovieTracking *tracking = &clip->tracking;
MovieTrackingTrack *track;
float mat[4][4], imat[4][4];
unsigned char col[4], scol[4];
- int tracknr= *global_track_index;
- ListBase *tracksbase= BKE_tracking_object_tracks(tracking, tracking_object);
+ int tracknr = *global_track_index;
+ ListBase *tracksbase = BKE_tracking_object_tracks(tracking, tracking_object);
UI_GetThemeColor4ubv(TH_TEXT, col);
UI_GetThemeColor4ubv(TH_SELECT, scol);
@@ -1543,8 +1542,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);
@@ -1559,82 +1558,82 @@ static void draw_viewport_object_reconstruction(Scene *scene, Base *base, View3D
glMultMatrixf(imat);
}
- for (track= tracksbase->first; track; track= track->next) {
- int selected= TRACK_SELECTED(track);
+ 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)
+ if ((track->flag & TRACK_HAS_BUNDLE) == 0)
continue;
- if (flag&DRAW_PICKING)
- glLoadName(base->selcol + (tracknr<<16));
+ if (flag & DRAW_PICKING)
+ glLoadName(base->selcol + (tracknr << 16));
glPushMatrix();
- glTranslatef(track->bundle_pos[0], track->bundle_pos[1], track->bundle_pos[2]);
- glScalef(v3d->bundle_size/0.05f, v3d->bundle_size/0.05f, v3d->bundle_size/0.05f);
+ glTranslatef(track->bundle_pos[0], track->bundle_pos[1], track->bundle_pos[2]);
+ glScalef(v3d->bundle_size / 0.05f, v3d->bundle_size / 0.05f, v3d->bundle_size / 0.05f);
- if (v3d->drawtype==OB_WIRE) {
- glDisable(GL_LIGHTING);
+ if (v3d->drawtype == OB_WIRE) {
+ glDisable(GL_LIGHTING);
+ if (selected) {
+ if (base == BASACT) UI_ThemeColor(TH_ACTIVE);
+ else UI_ThemeColor(TH_SELECT);
+ }
+ else {
+ if (track->flag & TRACK_CUSTOMCOLOR) glColor3fv(track->color);
+ else UI_ThemeColor(TH_WIRE);
+ }
+
+ drawaxes(0.05f, v3d->bundle_drawtype);
+
+ glEnable(GL_LIGHTING);
+ }
+ else if (v3d->drawtype > OB_WIRE) {
+ if (v3d->bundle_drawtype == OB_EMPTY_SPHERE) {
+ /* selection outline */
if (selected) {
- if (base==BASACT) UI_ThemeColor(TH_ACTIVE);
+ if (base == BASACT) UI_ThemeColor(TH_ACTIVE);
else UI_ThemeColor(TH_SELECT);
- }
- else {
- if (track->flag&TRACK_CUSTOMCOLOR) glColor3fv(track->color);
- else UI_ThemeColor(TH_WIRE);
- }
-
- drawaxes(0.05f, v3d->bundle_drawtype);
- glEnable(GL_LIGHTING);
- }
- else if (v3d->drawtype>OB_WIRE) {
- if (v3d->bundle_drawtype==OB_EMPTY_SPHERE) {
- /* selection outline */
- if (selected) {
- if (base==BASACT) UI_ThemeColor(TH_ACTIVE);
- else UI_ThemeColor(TH_SELECT);
+ glLineWidth(2.f);
+ glDisable(GL_LIGHTING);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- glLineWidth(2.f);
- glDisable(GL_LIGHTING);
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ draw_bundle_sphere();
- draw_bundle_sphere();
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ glEnable(GL_LIGHTING);
+ glLineWidth(1.f);
+ }
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- glEnable(GL_LIGHTING);
- glLineWidth(1.f);
- }
+ if (track->flag & TRACK_CUSTOMCOLOR) glColor3fv(track->color);
+ else UI_ThemeColor(TH_BUNDLE_SOLID);
- if (track->flag&TRACK_CUSTOMCOLOR) glColor3fv(track->color);
- else UI_ThemeColor(TH_BUNDLE_SOLID);
+ draw_bundle_sphere();
+ }
+ else {
+ glDisable(GL_LIGHTING);
- draw_bundle_sphere();
+ if (selected) {
+ if (base == BASACT) UI_ThemeColor(TH_ACTIVE);
+ else UI_ThemeColor(TH_SELECT);
}
else {
- glDisable(GL_LIGHTING);
-
- if (selected) {
- if (base==BASACT) UI_ThemeColor(TH_ACTIVE);
- else UI_ThemeColor(TH_SELECT);
- }
- else {
- if (track->flag&TRACK_CUSTOMCOLOR) glColor3fv(track->color);
- else UI_ThemeColor(TH_WIRE);
- }
+ if (track->flag & TRACK_CUSTOMCOLOR) glColor3fv(track->color);
+ else UI_ThemeColor(TH_WIRE);
+ }
- drawaxes(0.05f, v3d->bundle_drawtype);
+ drawaxes(0.05f, v3d->bundle_drawtype);
- glEnable(GL_LIGHTING);
- }
+ glEnable(GL_LIGHTING);
}
+ }
glPopMatrix();
- if ((flag & DRAW_PICKING)==0 && (v3d->flag2&V3D_SHOW_BUNDLENAME)) {
+ if ((flag & DRAW_PICKING) == 0 && (v3d->flag2 & V3D_SHOW_BUNDLENAME)) {
float pos[3];
unsigned char tcol[4];
@@ -1648,48 +1647,48 @@ static void draw_viewport_object_reconstruction(Scene *scene, Base *base, View3D
tracknr++;
}
- if ((flag & DRAW_PICKING)==0) {
- if ((v3d->flag2&V3D_SHOW_CAMERAPATH) && (tracking_object->flag&TRACKING_OBJECT_CAMERA)) {
+ if ((flag & DRAW_PICKING) == 0) {
+ if ((v3d->flag2 & V3D_SHOW_CAMERAPATH) && (tracking_object->flag & TRACKING_OBJECT_CAMERA)) {
MovieTrackingReconstruction *reconstruction;
- reconstruction= BKE_tracking_object_reconstruction(tracking, tracking_object);
+ reconstruction = BKE_tracking_object_reconstruction(tracking, tracking_object);
if (reconstruction->camnr) {
- MovieReconstructedCamera *camera= reconstruction->cameras;
- int a= 0;
+ MovieReconstructedCamera *camera = reconstruction->cameras;
+ int a = 0;
glDisable(GL_LIGHTING);
UI_ThemeColor(TH_CAMERA_PATH);
glLineWidth(2.0f);
glBegin(GL_LINE_STRIP);
- for (a= 0; a<reconstruction->camnr; a++, camera++) {
- glVertex3fv(camera->mat[3]);
- }
- glEnd();
+ for (a = 0; a < reconstruction->camnr; a++, camera++) {
+ glVertex3fv(camera->mat[3]);
+ }
+ glEnd();
- glLineWidth(1.0f);
- glEnable(GL_LIGHTING);
+ glLineWidth(1.0f);
+ glEnable(GL_LIGHTING);
}
}
}
glPopMatrix();
- *global_track_index= tracknr;
+ *global_track_index = tracknr;
}
static void draw_viewport_reconstruction(Scene *scene, Base *base, View3D *v3d, MovieClip *clip,
- int flag, int draw_selected)
+ int flag, int draw_selected)
{
- MovieTracking *tracking= &clip->tracking;
+ MovieTracking *tracking = &clip->tracking;
MovieTrackingObject *tracking_object;
float curcol[4];
- int global_track_index= 1;
+ int global_track_index = 1;
- if ((v3d->flag2&V3D_SHOW_RECONSTRUCTION)==0)
+ if ((v3d->flag2 & V3D_SHOW_RECONSTRUCTION) == 0)
return;
- if (v3d->flag2&V3D_RENDER_OVERRIDE)
+ if (v3d->flag2 & V3D_RENDER_OVERRIDE)
return;
glGetFloatv(GL_CURRENT_COLOR, curcol);
@@ -1699,12 +1698,12 @@ static void draw_viewport_reconstruction(Scene *scene, Base *base, View3D *v3d,
glEnable(GL_COLOR_MATERIAL);
glShadeModel(GL_SMOOTH);
- tracking_object= tracking->objects.first;
+ tracking_object = tracking->objects.first;
while (tracking_object) {
draw_viewport_object_reconstruction(scene, base, v3d, clip, tracking_object,
- flag, &global_track_index, draw_selected);
+ flag, &global_track_index, draw_selected);
- tracking_object= tracking_object->next;
+ tracking_object = tracking_object->next;
}
/* restore */
@@ -1714,7 +1713,7 @@ static void draw_viewport_reconstruction(Scene *scene, Base *base, View3D *v3d,
glColor4fv(curcol);
- if (flag&DRAW_PICKING)
+ if (flag & DRAW_PICKING)
glLoadName(base->selcol);
}
@@ -1723,13 +1722,13 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base
{
/* a standing up pyramid with (0,0,0) as top */
Camera *cam;
- Object *ob= base->object;
+ Object *ob = base->object;
float tvec[3];
float vec[4][3], asp[2], shift[2], scale[3];
int i;
float drawsize;
- const short is_view= (rv3d->persp==RV3D_CAMOB && ob==v3d->camera);
- MovieClip *clip= object_get_movieclip(scene, base->object, 0);
+ const short is_view = (rv3d->persp == RV3D_CAMOB && ob == v3d->camera);
+ MovieClip *clip = object_get_movieclip(scene, base->object, 0);
/* draw data for movie clip set as active for scene */
if (clip) {
@@ -1740,16 +1739,16 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base
#ifdef VIEW3D_CAMERA_BORDER_HACK
if (is_view && !(G.f & G_PICKSEL)) {
glGetFloatv(GL_CURRENT_COLOR, view3d_camera_border_hack_col);
- view3d_camera_border_hack_test= TRUE;
+ view3d_camera_border_hack_test = TRUE;
return;
}
#endif
- cam= ob->data;
+ cam = ob->data;
- scale[0]= 1.0f / len_v3(ob->obmat[0]);
- scale[1]= 1.0f / len_v3(ob->obmat[1]);
- scale[2]= 1.0f / len_v3(ob->obmat[2]);
+ scale[0] = 1.0f / len_v3(ob->obmat[0]);
+ scale[1] = 1.0f / len_v3(ob->obmat[1]);
+ scale[2] = 1.0f / len_v3(ob->obmat[2]);
camera_view_frame_ex(scene, cam, cam->drawsize, is_view, scale,
asp, shift, &drawsize, vec);
@@ -1782,36 +1781,36 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base
/* arrow on top */
- tvec[2]= vec[1][2]; /* copy the depth */
+ tvec[2] = vec[1][2]; /* copy the depth */
/* draw an outline arrow for inactive cameras and filled
* for active cameras. We actually draw both outline+filled
- * for active cameras so the wire can be seen side-on */
- for (i=0;i<2;i++) {
- if (i==0) glBegin(GL_LINE_LOOP);
- else if (i==1 && (ob == v3d->camera)) glBegin(GL_TRIANGLES);
+ * for active cameras so the wire can be seen side-on */
+ for (i = 0; i < 2; i++) {
+ if (i == 0) glBegin(GL_LINE_LOOP);
+ else if (i == 1 && (ob == v3d->camera)) glBegin(GL_TRIANGLES);
else break;
- tvec[0]= shift[0] + ((-0.7f * drawsize) * scale[0]);
- tvec[1]= shift[1] + ((drawsize * (asp[1] + 0.1f)) * scale[1]);
+ tvec[0] = shift[0] + ((-0.7f * drawsize) * scale[0]);
+ tvec[1] = shift[1] + ((drawsize * (asp[1] + 0.1f)) * scale[1]);
glVertex3fv(tvec); /* left */
- tvec[0]= shift[0] + ((0.7f * drawsize) * scale[0]);
+ tvec[0] = shift[0] + ((0.7f * drawsize) * scale[0]);
glVertex3fv(tvec); /* right */
- tvec[0]= shift[0];
- tvec[1]= shift[1] + ((1.1f * drawsize * (asp[1] + 0.7f)) * scale[1]);
+ tvec[0] = shift[0];
+ tvec[1] = shift[1] + ((1.1f * drawsize * (asp[1] + 0.7f)) * scale[1]);
glVertex3fv(tvec); /* top */
-
+
glEnd();
}
- if (flag==0) {
- if (cam->flag & (CAM_SHOWLIMITS+CAM_SHOWMIST)) {
+ if (flag == 0) {
+ if (cam->flag & (CAM_SHOWLIMITS + CAM_SHOWMIST)) {
float nobmat[4][4];
World *wrld;
-
+
/* draw in normalized object matrix space */
copy_m4_m4(nobmat, ob->obmat);
normalize_m4(nobmat);
@@ -1822,14 +1821,14 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base
if (cam->flag & CAM_SHOWLIMITS) {
draw_limit_line(cam->clipsta, cam->clipend, 0x77FFFF);
- /* qdn: was yafray only, now also enabled for Blender to be used with defocus composit node */
+ /* qdn: was yafray only, now also enabled for Blender to be used with defocus composite node */
draw_focus_cross(object_camera_dof_distance(ob), cam->drawsize);
}
- wrld= scene->world;
+ wrld = scene->world;
if (cam->flag & CAM_SHOWMIST)
- if (wrld) draw_limit_line(wrld->miststa, wrld->miststa+wrld->mistdist, 0xFFFFFF);
-
+ if (wrld) draw_limit_line(wrld->miststa, wrld->miststa + wrld->mistdist, 0xFFFFFF);
+
glPopMatrix();
}
}
@@ -1847,7 +1846,7 @@ static void drawspeaker(Scene *UNUSED(scene), View3D *UNUSED(v3d), RegionView3D
glEnable(GL_BLEND);
for (j = 0; j < 3; j++) {
- vec[2] = 0.25f * j -0.125f;
+ vec[2] = 0.25f * j - 0.125f;
glBegin(GL_LINE_LOOP);
for (i = 0; i < 16; i++) {
@@ -1868,7 +1867,7 @@ static void drawspeaker(Scene *UNUSED(scene), View3D *UNUSED(v3d), RegionView3D
vec[1] *= 0.5f;
}
- vec[2] = 0.25f * i -0.125f;
+ vec[2] = 0.25f * i - 0.125f;
glVertex3fv(vec);
}
glEnd();
@@ -1880,23 +1879,23 @@ static void drawspeaker(Scene *UNUSED(scene), View3D *UNUSED(v3d), RegionView3D
static void lattice_draw_verts(Lattice *lt, DispList *dl, short sel)
{
BPoint *bp = lt->def;
- float *co = dl?dl->verts:NULL;
+ float *co = dl ? dl->verts : NULL;
int u, v, w;
- UI_ThemeColor(sel?TH_VERTEX_SELECT:TH_VERTEX);
+ UI_ThemeColor(sel ? TH_VERTEX_SELECT : TH_VERTEX);
glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
bglBegin(GL_POINTS);
- for (w=0; w<lt->pntsw; w++) {
- int wxt = (w==0 || w==lt->pntsw-1);
- for (v=0; v<lt->pntsv; v++) {
- int vxt = (v==0 || v==lt->pntsv-1);
- for (u=0; u<lt->pntsu; u++, bp++, co+=3) {
- int uxt = (u==0 || u==lt->pntsu-1);
+ for (w = 0; w < lt->pntsw; w++) {
+ int wxt = (w == 0 || w == lt->pntsw - 1);
+ for (v = 0; v < lt->pntsv; v++) {
+ int vxt = (v == 0 || v == lt->pntsv - 1);
+ for (u = 0; u < lt->pntsu; u++, bp++, co += 3) {
+ int uxt = (u == 0 || u == lt->pntsu - 1);
if (!(lt->flag & LT_OUTSIDE) || uxt || vxt || wxt) {
- if (bp->hide==0) {
- if ((bp->f1 & SELECT)==sel) {
- bglVertex3fv(dl?co:bp->vec);
+ if (bp->hide == 0) {
+ if ((bp->f1 & SELECT) == sel) {
+ bglVertex3fv(dl ? co : bp->vec);
}
}
}
@@ -1905,24 +1904,24 @@ static void lattice_draw_verts(Lattice *lt, DispList *dl, short sel)
}
glPointSize(1.0);
- bglEnd();
+ bglEnd();
}
void lattice_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, BPoint *bp, int x, int y), void *userData)
{
- Object *obedit= vc->obedit;
- Lattice *lt= obedit->data;
+ Object *obedit = vc->obedit;
+ Lattice *lt = obedit->data;
BPoint *bp = lt->editlatt->latt->def;
DispList *dl = find_displist(&obedit->disp, DL_VERTS);
- float *co = dl?dl->verts:NULL;
- int i, N = lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
+ float *co = dl ? dl->verts : NULL;
+ int i, N = lt->editlatt->latt->pntsu * lt->editlatt->latt->pntsv * lt->editlatt->latt->pntsw;
short s[2] = {IS_CLIPPED, 0};
ED_view3d_clipping_local(vc->rv3d, obedit->obmat); /* for local clipping lookups */
- for (i=0; i<N; i++, bp++, co+=3) {
- if (bp->hide==0) {
- view3d_project_short_clip(vc->ar, dl?co:bp->vec, s, TRUE);
+ for (i = 0; i < N; i++, bp++, co += 3) {
+ if (bp->hide == 0) {
+ view3d_project_short_clip(vc->ar, dl ? co : bp->vec, s, TRUE);
if (s[0] != IS_CLIPPED)
func(userData, bp, s[0], s[1]);
}
@@ -1931,19 +1930,19 @@ void lattice_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, BPo
static void drawlattice__point(Lattice *lt, DispList *dl, int u, int v, int w, int use_wcol)
{
- int index = ((w*lt->pntsv + v)*lt->pntsu) + u;
+ int index = ((w * lt->pntsv + v) * lt->pntsu) + u;
if (use_wcol) {
float col[3];
- MDeformWeight *mdw= defvert_find_index (lt->dvert+index, use_wcol-1);
+ MDeformWeight *mdw = defvert_find_index(lt->dvert + index, use_wcol - 1);
- weight_to_rgb(col, mdw?mdw->weight:0.0f);
+ weight_to_rgb(col, mdw ? mdw->weight : 0.0f);
glColor3fv(col);
}
if (dl) {
- glVertex3fv(&dl->verts[index*3]);
+ glVertex3fv(&dl->verts[index * 3]);
}
else {
glVertex3fv(lt->def[index].vec);
@@ -1953,50 +1952,50 @@ static void drawlattice__point(Lattice *lt, DispList *dl, int u, int v, int w, i
/* lattice color is hardcoded, now also shows weightgroup values in edit mode */
static void drawlattice(Scene *scene, View3D *v3d, Object *ob)
{
- Lattice *lt= ob->data;
+ Lattice *lt = ob->data;
DispList *dl;
int u, v, w;
- int use_wcol= 0, is_edit= (lt->editlatt != NULL);
+ int use_wcol = 0, is_edit = (lt->editlatt != NULL);
/* now we default make displist, this will modifiers work for non animated case */
- if (ob->disp.first==NULL)
+ if (ob->disp.first == NULL)
lattice_calc_modifiers(scene, ob);
- dl= find_displist(&ob->disp, DL_VERTS);
+ dl = find_displist(&ob->disp, DL_VERTS);
if (is_edit) {
- lt= lt->editlatt->latt;
+ lt = lt->editlatt->latt;
cpack(0x004000);
if (ob->defbase.first && lt->dvert) {
- use_wcol= ob->actdef;
+ use_wcol = ob->actdef;
glShadeModel(GL_SMOOTH);
}
}
glBegin(GL_LINES);
- for (w=0; w<lt->pntsw; w++) {
- int wxt = (w==0 || w==lt->pntsw-1);
- for (v=0; v<lt->pntsv; v++) {
- int vxt = (v==0 || v==lt->pntsv-1);
- for (u=0; u<lt->pntsu; u++) {
- int uxt = (u==0 || u==lt->pntsu-1);
+ for (w = 0; w < lt->pntsw; w++) {
+ int wxt = (w == 0 || w == lt->pntsw - 1);
+ for (v = 0; v < lt->pntsv; v++) {
+ int vxt = (v == 0 || v == lt->pntsv - 1);
+ for (u = 0; u < lt->pntsu; u++) {
+ int uxt = (u == 0 || u == lt->pntsu - 1);
if (w && ((uxt || vxt) || !(lt->flag & LT_OUTSIDE))) {
- drawlattice__point(lt, dl, u, v, w-1, use_wcol);
+ drawlattice__point(lt, dl, u, v, w - 1, use_wcol);
drawlattice__point(lt, dl, u, v, w, use_wcol);
}
if (v && ((uxt || wxt) || !(lt->flag & LT_OUTSIDE))) {
- drawlattice__point(lt, dl, u, v-1, w, use_wcol);
+ drawlattice__point(lt, dl, u, v - 1, w, use_wcol);
drawlattice__point(lt, dl, u, v, w, use_wcol);
}
if (u && ((vxt || wxt) || !(lt->flag & LT_OUTSIDE))) {
- drawlattice__point(lt, dl, u-1, v, w, use_wcol);
+ drawlattice__point(lt, dl, u - 1, v, w, use_wcol);
drawlattice__point(lt, dl, u, v, w, use_wcol);
}
}
}
- }
+ }
glEnd();
/* restoration for weight colors */
@@ -2017,15 +2016,15 @@ static void drawlattice(Scene *scene, View3D *v3d, Object *ob)
/* Note! - foreach funcs should be called while drawing or directly after
* if not, ED_view3d_init_mats_rv3d() can be used for selection tools
- * but would not give correct results with dupli's for eg. which dont
- * use the object matrix in the useual way */
+ * but would not give correct results with dupli's for eg. which don't
+ * use the object matrix in the usual way */
static void mesh_foreachScreenVert__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
{
foreachScreenVert_userData *data = userData;
- BMVert *eve = EDBM_get_vert_for_index(data->vc.em, index);
+ BMVert *eve = EDBM_vert_at_index(data->vc.em, index);
if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
- short s[2]= {IS_CLIPPED, 0};
+ short s[2] = {IS_CLIPPED, 0};
if (data->clipVerts != V3D_CLIP_TEST_OFF) {
view3d_project_short_clip(data->vc.ar, co, s, TRUE);
@@ -2036,30 +2035,30 @@ static void mesh_foreachScreenVert__mapFunc(void *userData, int index, float *co
project_short_noclip(data->vc.ar, co2, s);
}
- if (s[0]!=IS_CLIPPED)
+ if (s[0] != IS_CLIPPED)
data->func(data->userData, eve, s[0], s[1], index);
}
}
void mesh_foreachScreenVert(
- ViewContext *vc,
- void (*func)(void *userData, BMVert *eve, int x, int y, int index),
- void *userData, eV3DClipTest clipVerts)
+ ViewContext *vc,
+ void (*func)(void *userData, BMVert *eve, int x, int y, int index),
+ void *userData, eV3DClipTest clipVerts)
{
foreachScreenVert_userData data;
DerivedMesh *dm = editbmesh_get_derived_cage(vc->scene, vc->obedit, vc->em, CD_MASK_BAREMESH);
- data.vc= *vc;
+ data.vc = *vc;
data.func = func;
data.userData = userData;
data.clipVerts = clipVerts;
if (clipVerts != V3D_CLIP_TEST_OFF)
- ED_view3d_clipping_local(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */
+ ED_view3d_clipping_local(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */
- EDBM_init_index_arrays(vc->em, 1, 0, 0);
+ EDBM_index_arrays_init(vc->em, 1, 0, 0);
dm->foreachMappedVert(dm, mesh_foreachScreenVert__mapFunc, &data);
- EDBM_free_index_arrays(vc->em);
+ EDBM_index_arrays_free(vc->em);
dm->release(dm);
}
@@ -2070,7 +2069,7 @@ static void drawSelectedVertices__mapFunc(void *userData, int index, float *co,
MVert *mv = &((MVert *)userData)[index];
if (!(mv->flag & ME_HIDE)) {
- const char sel= mv->flag & SELECT;
+ const char sel = mv->flag & SELECT;
// TODO define selected color
if (sel) {
@@ -2092,16 +2091,16 @@ static void drawSelectedVertices(DerivedMesh *dm, Mesh *me)
}
static int is_co_in_region(ARegion *ar, const short co[2])
{
- return ( (co[0] != IS_CLIPPED) && /* may be the only initialized value, check first */
- (co[0] >= 0) &&
- (co[0] < ar->winx) &&
- (co[1] >= 0) &&
- (co[1] < ar->winy));
+ return ((co[0] != IS_CLIPPED) && /* may be the only initialized value, check first */
+ (co[0] >= 0) &&
+ (co[0] < ar->winx) &&
+ (co[1] >= 0) &&
+ (co[1] < ar->winy));
}
static void mesh_foreachScreenEdge__mapFunc(void *userData, int index, float *v0co, float *v1co)
{
foreachScreenEdge_userData *data = userData;
- BMEdge *eed = EDBM_get_edge_for_index(data->vc.em, index);
+ BMEdge *eed = EDBM_edge_at_index(data->vc.em, index);
if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
short s[2][2];
@@ -2120,8 +2119,8 @@ static void mesh_foreachScreenEdge__mapFunc(void *userData, int index, float *v0
project_short_noclip(data->vc.ar, v2_co, s[1]);
if (data->clipVerts == V3D_CLIP_TEST_REGION) {
- if ( !is_co_in_region(data->vc.ar, s[0]) &&
- !is_co_in_region(data->vc.ar, s[1]))
+ if (!is_co_in_region(data->vc.ar, s[0]) &&
+ !is_co_in_region(data->vc.ar, s[1]))
{
return;
}
@@ -2133,24 +2132,24 @@ static void mesh_foreachScreenEdge__mapFunc(void *userData, int index, float *v0
}
void mesh_foreachScreenEdge(
- ViewContext *vc,
- void (*func)(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int index),
- void *userData, eV3DClipTest clipVerts)
+ ViewContext *vc,
+ void (*func)(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int index),
+ void *userData, eV3DClipTest clipVerts)
{
foreachScreenEdge_userData data;
DerivedMesh *dm = editbmesh_get_derived_cage(vc->scene, vc->obedit, vc->em, CD_MASK_BAREMESH);
- data.vc= *vc;
+ data.vc = *vc;
data.func = func;
data.userData = userData;
data.clipVerts = clipVerts;
if (clipVerts != V3D_CLIP_TEST_OFF)
- ED_view3d_clipping_local(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */
+ ED_view3d_clipping_local(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */
- EDBM_init_index_arrays(vc->em, 0, 1, 0);
+ EDBM_index_arrays_init(vc->em, 0, 1, 0);
dm->foreachMappedEdge(dm, mesh_foreachScreenEdge__mapFunc, &data);
- EDBM_free_index_arrays(vc->em);
+ EDBM_index_arrays_free(vc->em);
dm->release(dm);
}
@@ -2158,7 +2157,7 @@ void mesh_foreachScreenEdge(
static void mesh_foreachScreenFace__mapFunc(void *userData, int index, float *cent, float *UNUSED(no))
{
foreachScreenFace_userData *data = userData;
- BMFace *efa = EDBM_get_face_for_index(data->vc.em, index);
+ BMFace *efa = EDBM_face_at_index(data->vc.em, index);
if (efa && !BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
float cent2[3];
@@ -2174,46 +2173,46 @@ static void mesh_foreachScreenFace__mapFunc(void *userData, int index, float *ce
}
void mesh_foreachScreenFace(
- ViewContext *vc,
- void (*func)(void *userData, BMFace *efa, int x, int y, int index),
- void *userData)
+ ViewContext *vc,
+ void (*func)(void *userData, BMFace *efa, int x, int y, int index),
+ void *userData)
{
foreachScreenFace_userData data;
DerivedMesh *dm = editbmesh_get_derived_cage(vc->scene, vc->obedit, vc->em, CD_MASK_BAREMESH);
- data.vc= *vc;
+ data.vc = *vc;
data.func = func;
data.userData = userData;
//if (clipVerts)
ED_view3d_clipping_local(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */
- EDBM_init_index_arrays(vc->em, 0, 0, 1);
+ EDBM_index_arrays_init(vc->em, 0, 0, 1);
dm->foreachMappedFaceCenter(dm, mesh_foreachScreenFace__mapFunc, &data);
- EDBM_free_index_arrays(vc->em);
+ EDBM_index_arrays_free(vc->em);
dm->release(dm);
}
void nurbs_foreachScreenVert(
- ViewContext *vc,
- void (*func)(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y),
- void *userData)
+ ViewContext *vc,
+ void (*func)(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y),
+ void *userData)
{
- Curve *cu= vc->obedit->data;
+ Curve *cu = vc->obedit->data;
short s[2] = {IS_CLIPPED, 0};
Nurb *nu;
int i;
- ListBase *nurbs= curve_editnurbs(cu);
+ ListBase *nurbs = curve_editnurbs(cu);
ED_view3d_clipping_local(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */
- for (nu= nurbs->first; nu; nu=nu->next) {
+ for (nu = nurbs->first; nu; nu = nu->next) {
if (nu->type == CU_BEZIER) {
- for (i=0; i<nu->pntsu; i++) {
+ for (i = 0; i < nu->pntsu; i++) {
BezTriple *bezt = &nu->bezt[i];
- if (bezt->hide==0) {
+ if (bezt->hide == 0) {
if (cu->drawflag & CU_HIDE_HANDLES) {
view3d_project_short_clip(vc->ar, bezt->vec[1], s, TRUE);
@@ -2235,10 +2234,10 @@ void nurbs_foreachScreenVert(
}
}
else {
- for (i=0; i<nu->pntsu*nu->pntsv; i++) {
+ for (i = 0; i < nu->pntsu * nu->pntsv; i++) {
BPoint *bp = &nu->bp[i];
- if (bp->hide==0) {
+ if (bp->hide == 0) {
view3d_project_short_clip(vc->ar, bp->vec, s, TRUE);
if (s[0] != IS_CLIPPED)
func(userData, nu, bp, NULL, -1, s[0], s[1]);
@@ -2262,7 +2261,7 @@ void nurbs_foreachScreenVert(
static void draw_dm_face_normals__mapFunc(void *userData, int index, float *cent, float *no)
{
drawDMNormal_userData *data = userData;
- BMFace *efa = EDBM_get_face_for_index(data->em, index);
+ BMFace *efa = EDBM_face_at_index(data->em, index);
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
glVertex3fv(cent);
@@ -2285,10 +2284,10 @@ static void draw_dm_face_normals(BMEditMesh *em, Scene *scene, DerivedMesh *dm)
static void draw_dm_face_centers__mapFunc(void *userData, int index, float *cent, float *UNUSED(no))
{
- BMFace *efa = EDBM_get_face_for_index(((void **)userData)[0], index);
+ BMFace *efa = EDBM_face_at_index(((void **)userData)[0], index);
int sel = *(((int **)userData)[1]);
- if (efa && !BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && BM_elem_flag_test(efa, BM_ELEM_SELECT)==sel) {
+ if (efa && !BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && BM_elem_flag_test(efa, BM_ELEM_SELECT) == sel) {
bglVertex3fv(cent);
}
}
@@ -2304,7 +2303,7 @@ static void draw_dm_face_centers(BMEditMesh *em, DerivedMesh *dm, int sel)
static void draw_dm_vert_normals__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
{
drawDMNormal_userData *data = userData;
- BMVert *eve = EDBM_get_vert_for_index(data->em, index);
+ BMVert *eve = EDBM_vert_at_index(data->em, index);
if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
glVertex3fv(co);
@@ -2336,12 +2335,12 @@ static void draw_dm_vert_normals(BMEditMesh *em, Scene *scene, DerivedMesh *dm)
/* Draw verts with color set based on selection */
static void draw_dm_verts__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
{
- drawDMVerts_userData * data = userData;
- BMVert *eve = EDBM_get_vert_for_index(data->em, index);
+ drawDMVerts_userData *data = userData;
+ BMVert *eve = EDBM_vert_at_index(data->em, index);
- if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN) && BM_elem_flag_test(eve, BM_ELEM_SELECT)==data->sel) {
+ if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN) && BM_elem_flag_test(eve, BM_ELEM_SELECT) == data->sel) {
/* draw active larger - need to stop/start point drawing for this :/ */
- if (eve==data->eve_act) {
+ if (eve == data->eve_act) {
float size = UI_GetThemeValuef(TH_VERTEX_SIZE);
UI_ThemeColor4(TH_EDITMESH_ACTIVE);
@@ -2352,7 +2351,7 @@ static void draw_dm_verts__mapFunc(void *userData, int index, float *co, float *
bglVertex3fv(co);
bglEnd();
- UI_ThemeColor4(data->sel?TH_VERTEX_SELECT:TH_VERTEX);
+ UI_ThemeColor4(data->sel ? TH_VERTEX_SELECT : TH_VERTEX);
glPointSize(size);
bglBegin(GL_POINTS);
}
@@ -2374,18 +2373,18 @@ static void draw_dm_verts(BMEditMesh *em, DerivedMesh *dm, int sel, BMVert *eve_
bglEnd();
}
- /* Draw edges with color set based on selection */
-static int draw_dm_edges_sel__setDrawOptions(void *userData, int index)
+/* Draw edges with color set based on selection */
+static DMDrawOption draw_dm_edges_sel__setDrawOptions(void *userData, int index)
{
BMEdge *eed;
//unsigned char **cols = userData, *col;
- drawDMEdgesSel_userData * data = userData;
+ drawDMEdgesSel_userData *data = userData;
unsigned char *col;
- eed = EDBM_get_edge_for_index(data->em, index);
+ eed = EDBM_edge_at_index(data->em, index);
if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
- if (eed==data->eed_act) {
+ if (eed == data->eed_act) {
glColor4ubv(data->actCol);
}
else {
@@ -2396,18 +2395,19 @@ 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,
- unsigned char *selCol, unsigned char *actCol, BMEdge *eed_act)
+ unsigned char *selCol, unsigned char *actCol, BMEdge *eed_act)
{
drawDMEdgesSel_userData data;
@@ -2419,32 +2419,39 @@ static void draw_dm_edges_sel(BMEditMesh *em, DerivedMesh *dm, unsigned char *ba
dm->drawMappedEdges(dm, draw_dm_edges_sel__setDrawOptions, &data);
}
- /* Draw edges */
-static int draw_dm_edges__setDrawOptions(void *userData, int index)
+/* Draw edges */
+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_edge_at_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)
+/* Draw edges with color interpolated based on selection */
+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_edge_at_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)
{
- BMEdge *eed = EDBM_get_edge_for_index(((void**)userData)[0], index);
+ BMEdge *eed = EDBM_edge_at_index(((void **)userData)[0], index);
unsigned char **cols = userData;
- unsigned char *col0 = cols[(BM_elem_flag_test(eed->v1, BM_ELEM_SELECT))?2:1];
- unsigned char *col1 = cols[(BM_elem_flag_test(eed->v2, BM_ELEM_SELECT))?2:1];
+ unsigned char *col0 = cols[(BM_elem_flag_test(eed->v1, BM_ELEM_SELECT)) ? 2 : 1];
+ unsigned char *col1 = cols[(BM_elem_flag_test(eed->v2, BM_ELEM_SELECT)) ? 2 : 1];
- glColor4ub( col0[0] + (col1[0]-col0[0])*t,
- col0[1] + (col1[1]-col0[1])*t,
- col0[2] + (col1[2]-col0[2])*t,
- col0[3] + (col1[3]-col0[3])*t);
+ glColor4ub(col0[0] + (col1[0] - col0[0]) * t,
+ col0[1] + (col1[1] - col0[1]) * t,
+ col0[2] + (col1[2] - col0[2]) * t,
+ col0[3] + (col1[3] - col0[3]) * t);
}
static void draw_dm_edges_sel_interp(BMEditMesh *em, DerivedMesh *dm, unsigned char *baseCol, unsigned char *selCol)
@@ -2454,12 +2461,15 @@ static void draw_dm_edges_sel_interp(BMEditMesh *em, DerivedMesh *dm, unsigned c
dm->drawMappedEdgesInterp(dm, draw_dm_edges_sel_interp__setDrawOptions, draw_dm_edges_sel_interp__setDrawInterpOptions, cols);
}
- /* Draw only seam edges */
-static int draw_dm_edges_seams__setDrawOptions(void *userData, int index)
+/* Draw only seam edges */
+static DMDrawOption draw_dm_edges_seams__setDrawOptions(void *userData, int index)
{
- BMEdge *eed = EDBM_get_edge_for_index(userData, index);
+ BMEdge *eed = EDBM_edge_at_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)
@@ -2467,43 +2477,48 @@ static void draw_dm_edges_seams(BMEditMesh *em, DerivedMesh *dm)
dm->drawMappedEdges(dm, draw_dm_edges_seams__setDrawOptions, em);
}
- /* Draw only sharp edges */
-static int draw_dm_edges_sharp__setDrawOptions(void *userData, int index)
+/* Draw only sharp edges */
+static DMDrawOption draw_dm_edges_sharp__setDrawOptions(void *userData, int index)
{
- BMEdge *eed = EDBM_get_edge_for_index(userData, index);
+ BMEdge *eed = EDBM_edge_at_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);
}
- /* 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))
+/* Draw faces with color set based on selection
+ * return 2 for the active face so it renders with stipple enabled */
+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);
+ drawDMFacesSel_userData *data = userData;
+ BMFace *efa = EDBM_face_at_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[2]);
- return 2; /* stipple */
+ return DM_DRAW_OPTION_STIPPLE;
}
else {
- col = data->cols[BM_elem_flag_test(efa, BM_ELEM_SELECT)?1:0];
- if (col[3]==0) return 0;
+ col = data->cols[BM_elem_flag_test(efa, BM_ELEM_SELECT) ? 1 : 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)
@@ -2518,8 +2533,8 @@ static int draw_dm_faces_sel__compareDrawOptions(void *userData, int index, int
if (!data->orig_index)
return 0;
- efa= EDBM_get_face_for_index(data->em, data->orig_index[index]);
- next_efa= EDBM_get_face_for_index(data->em, data->orig_index[next_index]);
+ efa = EDBM_face_at_index(data->em, data->orig_index[index]);
+ next_efa = EDBM_face_at_index(data->em, data->orig_index[next_index]);
if (efa == next_efa)
return 1;
@@ -2527,10 +2542,10 @@ static int draw_dm_faces_sel__compareDrawOptions(void *userData, int index, int
if (efa == data->efa_act || next_efa == data->efa_act)
return 0;
- col = data->cols[BM_elem_flag_test(efa, BM_ELEM_SELECT)?1:0];
- next_col = data->cols[BM_elem_flag_test(next_efa, BM_ELEM_SELECT)?1:0];
+ col = data->cols[BM_elem_flag_test(efa, BM_ELEM_SELECT) ? 1 : 0];
+ next_col = data->cols[BM_elem_flag_test(next_efa, BM_ELEM_SELECT) ? 1 : 0];
- if (col[3]==0 || next_col[3]==0)
+ if (col[3] == 0 || next_col[3] == 0)
return 0;
return col == next_col;
@@ -2538,10 +2553,10 @@ static int draw_dm_faces_sel__compareDrawOptions(void *userData, int index, int
/* also draws the active face */
static void draw_dm_faces_sel(BMEditMesh *em, DerivedMesh *dm, unsigned char *baseCol,
- unsigned char *selCol, unsigned char *actCol, BMFace *efa_act)
+ unsigned char *selCol, unsigned char *actCol, BMFace *efa_act)
{
drawDMFacesSel_userData data;
- data.dm= dm;
+ data.dm = dm;
data.cols[0] = baseCol;
data.em = em;
data.cols[1] = selCol;
@@ -2552,21 +2567,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);
+ BMEdge *eed = EDBM_edge_at_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) {
+ 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)
@@ -2576,40 +2591,40 @@ 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);
+ BMEdge *eed = EDBM_edge_at_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) {
+ 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))
{
BMEditMesh *em = userData;
- BMVert *eve = EDBM_get_vert_for_index(userData, index);
+ BMVert *eve = EDBM_vert_at_index(userData, index);
float *bweight = (float *)CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_BWEIGHT);
if (!bweight)
return;
- if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN) && *bweight!=0.0f) {
+ if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN) && *bweight != 0.0f) {
UI_ThemeColorBlend(TH_VERTEX, TH_VERTEX_SELECT, *bweight);
bglVertex3fv(co);
}
}
static void draw_dm_bweights(BMEditMesh *em, Scene *scene, DerivedMesh *dm)
{
- ToolSettings *ts= scene->toolsettings;
+ ToolSettings *ts = scene->toolsettings;
if (ts->selectmode & SCE_SELECT_VERTEX) {
glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE) + 2);
@@ -2636,40 +2651,40 @@ static void draw_dm_bweights(BMEditMesh *em, Scene *scene, DerivedMesh *dm)
static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit,
BMEditMesh *em, DerivedMesh *cageDM, BMVert *eve_act)
{
- ToolSettings *ts= scene->toolsettings;
+ ToolSettings *ts = scene->toolsettings;
int sel;
- if (v3d->zbuf) glDepthMask(0); // disable write in zbuffer, zbuf select
+ if (v3d->zbuf) glDepthMask(0); // disable write in zbuffer, zbuf select
- for (sel=0; sel<2; sel++) {
+ for (sel = 0; sel < 2; sel++) {
unsigned char col[4], fcol[4];
int pass;
- UI_GetThemeColor3ubv(sel?TH_VERTEX_SELECT:TH_VERTEX, col);
- UI_GetThemeColor3ubv(sel?TH_FACE_DOT:TH_WIRE, fcol);
+ UI_GetThemeColor3ubv(sel ? TH_VERTEX_SELECT : TH_VERTEX, col);
+ UI_GetThemeColor3ubv(sel ? TH_FACE_DOT : TH_WIRE, fcol);
- for (pass=0; pass<2; pass++) {
+ for (pass = 0; pass < 2; pass++) {
float size = UI_GetThemeValuef(TH_VERTEX_SIZE);
float fsize = UI_GetThemeValuef(TH_FACEDOT_SIZE);
- if (pass==0) {
- if (v3d->zbuf && !(v3d->flag&V3D_ZBUF_SELECT)) {
+ if (pass == 0) {
+ if (v3d->zbuf && !(v3d->flag & V3D_ZBUF_SELECT)) {
glDisable(GL_DEPTH_TEST);
-
+
glEnable(GL_BLEND);
}
else {
continue;
}
- size = (size > 2.1f ? size/2.0f:size);
- fsize = (fsize > 2.1f ? fsize/2.0f:fsize);
+ size = (size > 2.1f ? size / 2.0f : size);
+ fsize = (fsize > 2.1f ? fsize / 2.0f : fsize);
col[3] = fcol[3] = 100;
}
else {
col[3] = fcol[3] = 255;
}
-
+
if (ts->selectmode & SCE_SELECT_VERTEX) {
glPointSize(size);
glColor4ubv(col);
@@ -2682,7 +2697,7 @@ static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit,
draw_dm_face_centers(em, cageDM, sel);
}
- if (pass==0) {
+ if (pass == 0) {
glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
}
@@ -2697,7 +2712,7 @@ static void draw_em_fancy_edges(BMEditMesh *em, Scene *scene, View3D *v3d,
Mesh *me, DerivedMesh *cageDM, short sel_only,
BMEdge *eed_act)
{
- ToolSettings *ts= scene->toolsettings;
+ ToolSettings *ts = scene->toolsettings;
int pass;
unsigned char wireCol[4], selCol[4], actCol[4];
@@ -2706,15 +2721,15 @@ static void draw_em_fancy_edges(BMEditMesh *em, Scene *scene, View3D *v3d,
UI_GetThemeColor4ubv(TH_WIRE, wireCol);
UI_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, actCol);
- /* when sel only is used, dont render wire, only selected, this is used for
+ /* when sel only is used, don't render wire, only selected, this is used for
* textured draw mode when the 'edges' option is disabled */
if (sel_only)
wireCol[3] = 0;
- for (pass=0; pass<2; pass++) {
- /* show wires in transparant when no zbuf clipping for select */
- if (pass==0) {
- if (v3d->zbuf && (v3d->flag & V3D_ZBUF_SELECT)==0) {
+ for (pass = 0; pass < 2; pass++) {
+ /* show wires in transparant when no zbuf clipping for select */
+ if (pass == 0) {
+ if (v3d->zbuf && (v3d->flag & V3D_ZBUF_SELECT) == 0) {
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
selCol[3] = 85;
@@ -2731,7 +2746,7 @@ static void draw_em_fancy_edges(BMEditMesh *em, Scene *scene, View3D *v3d,
if (ts->selectmode == SCE_SELECT_FACE) {
draw_dm_edges_sel(em, cageDM, wireCol, selCol, actCol, eed_act);
- }
+ }
else if ( (me->drawflag & ME_DRAWEDGES) || (ts->selectmode & SCE_SELECT_EDGE) ) {
if (cageDM->drawMappedEdgesInterp && (ts->selectmode & SCE_SELECT_VERTEX)) {
glShadeModel(GL_SMOOTH);
@@ -2749,7 +2764,7 @@ static void draw_em_fancy_edges(BMEditMesh *em, Scene *scene, View3D *v3d,
}
}
- if (pass==0) {
+ if (pass == 0) {
glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
}
@@ -2759,27 +2774,27 @@ static void draw_em_fancy_edges(BMEditMesh *em, Scene *scene, View3D *v3d,
static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitSettings *unit)
{
const short txt_flag = V3D_CACHE_TEXT_ASCII | V3D_CACHE_TEXT_LOCALCLIP;
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
float v1[3], v2[3], v3[3], vmid[3], fvec[3];
char numstr[32]; /* Stores the measurement display text here */
const char *conv_float; /* Use a float conversion matching the grid size */
- unsigned char col[4]= {0, 0, 0, 255}; /* color of the text to draw */
+ unsigned char col[4] = {0, 0, 0, 255}; /* color of the text to draw */
float area; /* area of the face */
- float grid= unit->system ? unit->scale_length : v3d->grid;
- const int do_split= unit->flag & USER_UNIT_OPT_SPLIT;
- const int do_global= v3d->flag & V3D_GLOBAL_STATS;
- const int do_moving= G.moving;
+ float grid = unit->system ? unit->scale_length : v3d->grid;
+ const int do_split = unit->flag & USER_UNIT_OPT_SPLIT;
+ const int do_global = v3d->flag & V3D_GLOBAL_STATS;
+ const int do_moving = G.moving;
BMIter iter;
int i;
/* make the precision of the pronted value proportionate to the gridsize */
- if (grid < 0.01f) conv_float= "%.6g";
- else if (grid < 0.1f) conv_float= "%.5g";
- else if (grid < 1.0f) conv_float= "%.4g";
- else if (grid < 10.0f) conv_float= "%.3g";
- else conv_float= "%.2g";
+ if (grid < 0.01f) conv_float = "%.6g";
+ else if (grid < 0.1f) conv_float = "%.5g";
+ else if (grid < 1.0f) conv_float = "%.4g";
+ else if (grid < 10.0f) conv_float = "%.3g";
+ else conv_float = "%.2g";
if (me->drawflag & ME_DRAWEXTRA_EDGELEN) {
BMEdge *eed;
@@ -2787,7 +2802,7 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitS
UI_GetThemeColor3ubv(TH_DRAWEXTRA_EDGELEN, col);
eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
- for (; eed; eed=BM_iter_step(&iter)) {
+ for (; eed; eed = BM_iter_step(&iter)) {
/* draw selected edges, or edges next to selected verts while draging */
if (BM_elem_flag_test(eed, BM_ELEM_SELECT) ||
(do_moving && (BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) ||
@@ -2819,20 +2834,20 @@ 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;
-#define DRAW_EM_MEASURE_STATS_FACEAREA() \
- if (BM_elem_flag_test(f, BM_ELEM_SELECT)) { \
- mul_v3_fl(vmid, 1.0/n); \
- if (unit->system) \
- bUnit_AsString(numstr, sizeof(numstr), area*unit->scale_length, \
- 3, unit->system, B_UNIT_LENGTH, do_split, FALSE); \
- else \
- BLI_snprintf(numstr, sizeof(numstr), conv_float, area); \
- view3d_cached_text_draw_add(vmid, numstr, 0, txt_flag, col); \
- }
+#define DRAW_EM_MEASURE_STATS_FACEAREA() \
+ if (BM_elem_flag_test(f, BM_ELEM_SELECT)) { \
+ mul_v3_fl(vmid, 1.0 / n); \
+ if (unit->system) \
+ bUnit_AsString(numstr, sizeof(numstr), area * unit->scale_length, \
+ 3, unit->system, B_UNIT_LENGTH, do_split, FALSE); \
+ else \
+ BLI_snprintf(numstr, sizeof(numstr), conv_float, area); \
+ view3d_cached_text_draw_add(vmid, numstr, 0, txt_flag, col); \
+ }
UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEAREA, col);
@@ -2878,15 +2893,16 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitS
for (efa = BM_iter_new(&iter, em->bm, BM_FACES_OF_MESH, NULL);
- efa; efa=BM_iter_step(&iter)) {
+ efa; efa = BM_iter_step(&iter))
+ {
BMIter liter;
BMLoop *loop;
BM_face_center_bounds_calc(em->bm, efa, vmid);
for (loop = BM_iter_new(&liter, em->bm, BM_LOOPS_OF_FACE, efa);
- loop; loop = BM_iter_step(&liter)) {
-
+ loop; loop = BM_iter_step(&liter))
+ {
float v1[3], v2[3], v3[3];
copy_v3_v3(v1, loop->prev->v->co);
@@ -2923,10 +2939,10 @@ static void draw_em_indices(BMEditMesh *em)
unsigned char col[4];
BMIter iter;
- BMesh *bm= em->bm;
+ BMesh *bm = em->bm;
/* For now, reuse appropriate theme colors from stats text colors */
- i= 0;
+ i = 0;
if (em->selectmode & SCE_SELECT_VERTEX) {
UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEANG, col);
BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
@@ -2939,7 +2955,7 @@ static void draw_em_indices(BMEditMesh *em)
}
if (em->selectmode & SCE_SELECT_EDGE) {
- i= 0;
+ i = 0;
UI_GetThemeColor3ubv(TH_DRAWEXTRA_EDGELEN, col);
BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
if (BM_elem_flag_test(e, BM_ELEM_SELECT)) {
@@ -2952,7 +2968,7 @@ static void draw_em_indices(BMEditMesh *em)
}
if (em->selectmode & SCE_SELECT_FACE) {
- i= 0;
+ i = 0;
UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEAREA, col);
BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
if (BM_elem_flag_test(f, BM_ELEM_SELECT)) {
@@ -2965,23 +2981,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);
+ BMFace *efa = EDBM_face_at_index(userData, index);
if (efa && !BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
- GPU_enable_material(efa->mat_nr+1, NULL);
- return 1;
+ GPU_enable_material(efa->mat_nr + 1, NULL);
+ 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);
+ BMFace *efa = EDBM_face_at_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,
@@ -2994,25 +3013,28 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
BMVert *eve_act = NULL;
if (em->bm->selected.last) {
- BMEditSelection *ese= 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 ) {
+ else if (ese->htype == BM_VERT) {
eve_act = (BMVert *)ese->ele;
}
}
- EDBM_init_index_arrays(em, 1, 1, 1);
+ EDBM_index_arrays_init(em, 1, 1, 1);
- if (dt>OB_WIRE) {
+ if (dt > OB_WIRE) {
if (CHECK_OB_DRAWTEXTURE(v3d, dt)) {
if (draw_glsl_material(scene, ob, v3d, dt)) {
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
+ glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
finalDM->drawMappedFacesGLSL(finalDM, GPU_enable_material,
draw_em_fancy__setGLSLFaceOpts, em);
@@ -3030,68 +3052,68 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, (me->flag & ME_TWOSIDED) ? GL_TRUE : GL_FALSE);
glEnable(GL_LIGHTING);
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
+ glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, GPU_enable_material, NULL, me->edit_btmesh, 0);
glFrontFace(GL_CCW);
glDisable(GL_LIGHTING);
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
}
-
+
// Setup for drawing wire over, disable zbuffer
// write to show selected edge wires better
UI_ThemeColor(TH_WIRE);
bglPolygonOffset(rv3d->dist, 1.0);
glDepthMask(0);
- }
+ }
else {
- if (cageDM!=finalDM) {
+ if (cageDM != finalDM) {
UI_ThemeColorBlend(TH_WIRE, TH_BACK, 0.7);
finalDM->drawEdges(finalDM, 1, 0);
}
}
- if (me->drawflag & ME_DRAWFACES) { /* transp faces */
+ if (me->drawflag & ME_DRAWFACES) { /* transp faces */
unsigned char col1[4], col2[4], col3[4];
-
+
UI_GetThemeColor4ubv(TH_FACE, col1);
UI_GetThemeColor4ubv(TH_FACE_SELECT, col2);
UI_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, col3);
glEnable(GL_BLEND);
- glDepthMask(0); // disable write in zbuffer, needed for nice transp
+ glDepthMask(0); // disable write in zbuffer, needed for nice transp
- /* dont draw unselected faces, only selected, this is MUCH nicer when texturing */
- if CHECK_OB_DRAWTEXTURE(v3d, dt)
+ /* don't draw unselected faces, only selected, this is MUCH nicer when texturing */
+ if (CHECK_OB_DRAWTEXTURE(v3d, dt))
col1[3] = 0;
draw_dm_faces_sel(em, cageDM, col1, col2, col3, efa_act);
glDisable(GL_BLEND);
- glDepthMask(1); // restore write in zbuffer
+ glDepthMask(1); // restore write in zbuffer
}
else if (efa_act) {
/* even if draw faces is off it would be nice to draw the stipple face
* Make all other faces zero alpha except for the active
* */
unsigned char col1[4], col2[4], col3[4];
- col1[3] = col2[3] = 0; /* dont draw */
+ col1[3] = col2[3] = 0; /* don't draw */
UI_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, col3);
glEnable(GL_BLEND);
- glDepthMask(0); // disable write in zbuffer, needed for nice transp
+ glDepthMask(0); // disable write in zbuffer, needed for nice transp
draw_dm_faces_sel(em, cageDM, col1, col2, col3, efa_act);
glDisable(GL_BLEND);
- glDepthMask(1); // restore write in zbuffer
+ glDepthMask(1); // restore write in zbuffer
}
/* here starts all fancy draw-extra over */
- if ((me->drawflag & ME_DRAWEDGES)==0 && CHECK_OB_DRAWTEXTURE(v3d, dt)) {
- /* we are drawing textures and 'ME_DRAWEDGES' is disabled, dont draw any edges */
+ if ((me->drawflag & ME_DRAWEDGES) == 0 && CHECK_OB_DRAWTEXTURE(v3d, dt)) {
+ /* we are drawing textures and 'ME_DRAWEDGES' is disabled, don't draw any edges */
/* only draw selected edges otherwise there is no way of telling if a face is selected */
draw_em_fancy_edges(em, scene, v3d, me, cageDM, 1, eed_act);
@@ -3101,23 +3123,23 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
if (me->drawflag & ME_DRAWSEAMS) {
UI_ThemeColor(TH_EDGE_SEAM);
glLineWidth(2);
-
+
draw_dm_edges_seams(em, cageDM);
-
- glColor3ub(0,0,0);
+
+ glColor3ub(0, 0, 0);
glLineWidth(1);
}
if (me->drawflag & ME_DRAWSHARP) {
UI_ThemeColor(TH_EDGE_SHARP);
glLineWidth(2);
-
+
draw_dm_edges_sharp(em, cageDM);
-
- glColor3ub(0,0,0);
+
+ glColor3ub(0, 0, 0);
glLineWidth(1);
}
-
+
if (me->drawflag & ME_DRAWCREASES && CustomData_has_layer(&em->bm->edata, CD_CREASE)) {
draw_dm_creases(em, cageDM);
}
@@ -3139,25 +3161,25 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
draw_dm_vert_normals(em, scene, cageDM);
}
- if ( (me->drawflag & (ME_DRAWEXTRA_EDGELEN|ME_DRAWEXTRA_FACEAREA|ME_DRAWEXTRA_FACEANG)) &&
+ if ( (me->drawflag & (ME_DRAWEXTRA_EDGELEN | ME_DRAWEXTRA_FACEAREA | ME_DRAWEXTRA_FACEANG)) &&
!(v3d->flag2 & V3D_RENDER_OVERRIDE))
{
draw_em_measure_stats(v3d, ob, em, &scene->unit);
}
- if ((G.f & G_DEBUG) && (me->drawflag & ME_DRAWEXTRA_INDICES) &&
+ if ((G.debug & G_DEBUG) && (me->drawflag & ME_DRAWEXTRA_INDICES) &&
!(v3d->flag2 & V3D_RENDER_OVERRIDE)) {
draw_em_indices(em);
}
}
- if (dt>OB_WIRE) {
+ if (dt > OB_WIRE) {
glDepthMask(1);
bglPolygonOffset(rv3d->dist, 0.0);
GPU_disable_material();
}
- EDBM_free_index_arrays(em);
+ EDBM_index_arrays_free(em);
}
/* Mesh drawing routines */
@@ -3165,14 +3187,16 @@ 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);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
dm->drawFacesSolid(dm, NULL, 0, GPU_enable_material);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
GPU_disable_material();
@@ -3180,28 +3204,22 @@ static void draw_mesh_object_outline(View3D *v3d, Object *ob, DerivedMesh *dm)
else {
dm->drawEdges(dm, 0, 1);
}
-
+
glLineWidth(1.0);
glDepthMask(1);
}
}
-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;
+ Object *ob = base->object;
Mesh *me = ob->data;
- Material *ma= give_current_material(ob, 1);
+ Material *ma = give_current_material(ob, 1);
const short hasHaloMat = (ma && (ma->material_type == MA_TYPE_HALO));
- eWireDrawMode draw_wire= OBDRAW_WIRE_OFF;
+ eWireDrawMode draw_wire = OBDRAW_WIRE_OFF;
int /* totvert,*/ totedge, totface;
- DerivedMesh *dm= mesh_get_derived_final(scene, ob, scene->customdata_mask);
- const short is_obact= (ob == OBACT);
+ DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
+ const short is_obact = (ob == OBACT);
int draw_flags = (is_obact && paint_facesel_test(ob)) ? DRAW_FACE_SELECT : 0;
if (!dm)
@@ -3209,15 +3227,15 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
/* Check to draw dynamic paint colors (or weights from WeightVG modifiers).
* Note: Last "preview-active" modifier in stack will win! */
- if (DM_get_tessface_data_layer(dm, CD_WEIGHT_MCOL) && modifiers_isPreview(ob))
+ if (DM_get_tessface_data_layer(dm, CD_PREVIEW_MCOL) && modifiers_isPreview(ob))
draw_flags |= DRAW_MODIFIERS_PREVIEW;
/* Unwanted combination */
if (draw_flags & DRAW_FACE_SELECT) {
- draw_wire= OBDRAW_WIRE_OFF;
+ draw_wire = OBDRAW_WIRE_OFF;
}
else if (ob->dtx & OB_DRAWWIRE) {
- draw_wire= OBDRAW_WIRE_ON_DEPTH; /* draw wire after solid using zoffset and depth buffer adjusment */
+ draw_wire = OBDRAW_WIRE_ON_DEPTH; /* draw wire after solid using zoffset and depth buffer adjusment */
}
/* totvert = dm->getNumVerts(dm); */ /*UNUSED*/
@@ -3225,25 +3243,25 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
totface = dm->getNumTessFaces(dm);
/* vertexpaint, faceselect wants this, but it doesnt work for shaded? */
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
+ glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
- if (dt==OB_BOUNDBOX) {
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0)
+ if (dt == OB_BOUNDBOX) {
+ if (((v3d->flag2 & V3D_RENDER_OVERRIDE) && v3d->drawtype >= OB_WIRE) == 0)
draw_bounding_volume(scene, ob, ob->boundtype);
}
- else if (hasHaloMat || (totface==0 && totedge==0)) {
+ else if (hasHaloMat || (totface == 0 && totedge == 0)) {
glPointSize(1.5);
dm->drawVerts(dm);
glPointSize(1.0);
}
- else if (dt==OB_WIRE || totface==0) {
- draw_wire= OBDRAW_WIRE_ON; /* draw wire only, no depth buffer stuff */
+ else if (dt == OB_WIRE || totface == 0) {
+ draw_wire = OBDRAW_WIRE_ON; /* draw wire only, no depth buffer stuff */
}
else if ( (draw_flags & DRAW_FACE_SELECT || (is_obact && ob->mode & OB_MODE_TEXTURE_PAINT)) ||
CHECK_OB_DRAWTEXTURE(v3d, dt))
{
if ( (v3d->flag & V3D_SELECT_OUTLINE) &&
- ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) &&
+ ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) &&
(base->flag & SELECT) &&
!(G.f & G_PICKSEL || (draw_flags & DRAW_FACE_SELECT)) &&
(draw_wire == OBDRAW_WIRE_OFF))
@@ -3252,7 +3270,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
}
if (draw_glsl_material(scene, ob, v3d, dt) && !(draw_flags & DRAW_MODIFIERS_PREVIEW)) {
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
+ glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
dm->drawFacesGLSL(dm, GPU_enable_material);
// if (get_ob_property(ob, "Text"))
@@ -3271,19 +3289,20 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
else
UI_ThemeColor(TH_WIRE);
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0)
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0)
dm->drawLooseEdges(dm);
}
}
- else if (dt==OB_SOLID) {
+ else if (dt == OB_SOLID) {
if (is_obact && ob->mode & OB_MODE_WEIGHT_PAINT) {
/* 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
+ glDepthMask(0); // disable write in zbuffer, selected edge wires show better
glEnable(GL_BLEND);
glColor4ub(255, 255, 255, 96);
@@ -3299,18 +3318,18 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
GPU_disable_material();
- /* since we already draw wire as wp guide, dont draw over the top */
- draw_wire= OBDRAW_WIRE_OFF;
+ /* since we already draw wire as wp guide, don't draw over the top */
+ draw_wire = OBDRAW_WIRE_OFF;
}
else if (draw_flags & DRAW_MODIFIERS_PREVIEW) {
/* for object selection draws no shade */
- if (flag & (DRAW_PICKING|DRAW_CONSTCOLOR)) {
+ if (flag & (DRAW_PICKING | DRAW_CONSTCOLOR)) {
dm->drawFacesSolid(dm, NULL, 0, GPU_enable_material);
}
else {
/* draw outline */
if ( (v3d->flag & V3D_SELECT_OUTLINE) &&
- ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) &&
+ ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) &&
(base->flag & SELECT) &&
(draw_wire == OBDRAW_WIRE_OFF) &&
(ob->sculpt == NULL))
@@ -3325,7 +3344,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
/* set default spec */
glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR);
- glEnable(GL_COLOR_MATERIAL); /* according manpages needed */
+ glEnable(GL_COLOR_MATERIAL); /* according manpages needed */
glColor3ub(120, 120, 120);
glDisable(GL_COLOR_MATERIAL);
/* diffuse */
@@ -3333,7 +3352,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);
@@ -3344,7 +3363,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
Paint *p;
if ( (v3d->flag & V3D_SELECT_OUTLINE) &&
- ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) &&
+ ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) &&
(base->flag & SELECT) &&
(draw_wire == OBDRAW_WIRE_OFF) &&
(ob->sculpt == NULL))
@@ -3355,12 +3374,12 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, (me->flag & ME_TWOSIDED) ? GL_TRUE : GL_FALSE);
glEnable(GL_LIGHTING);
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
+ glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
- if (ob->sculpt && (p=paint_get_active(scene))) {
+ if (ob->sculpt && (p = paint_get_active(scene))) {
float planes[4][4];
float (*fpl)[4] = NULL;
- int fast= (p->flags & PAINT_FAST_NAVIGATE) && (rv3d->rflag & RV3D_NAVIGATING);
+ int fast = (p->flags & PAINT_FAST_NAVIGATE) && (rv3d->rflag & RV3D_NAVIGATING);
if (ob->sculpt->partial_redraw) {
if (ar->do_draw & RGN_DRAW_PARTIAL) {
@@ -3388,11 +3407,11 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
else {
UI_ThemeColor(TH_WIRE);
}
- if (!ob->sculpt && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0)
+ if (!ob->sculpt && (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0)
dm->drawLooseEdges(dm);
}
}
- else if (dt==OB_PAINT) {
+ else if (dt == OB_PAINT) {
if (is_obact) {
if (ob && ob->mode & OB_MODE_WEIGHT_PAINT) {
/* enforce default material settings */
@@ -3400,7 +3419,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
/* but set default spec */
glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR);
- glEnable(GL_COLOR_MATERIAL); /* according manpages needed */
+ glEnable(GL_COLOR_MATERIAL); /* according manpages needed */
glColor3ub(120, 120, 120);
glDisable(GL_COLOR_MATERIAL);
/* diffuse */
@@ -3408,41 +3427,44 @@ 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);
GPU_disable_material();
}
- else if (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_TEXTURE_PAINT)) {
+ 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);
}
}
}
}
/* set default draw color back for wire or for draw-extra later on */
- if (dt!=OB_WIRE) {
+ if (dt != OB_WIRE) {
if (base->flag & SELECT) {
if (is_obact && ob->flag & OB_FROMGROUP)
UI_ThemeColor(TH_GROUP_ACTIVE);
else if (ob->flag & OB_FROMGROUP)
UI_ThemeColorShade(TH_GROUP_ACTIVE, -16);
- else if (flag!=DRAW_CONSTCOLOR)
+ else if (flag != DRAW_CONSTCOLOR)
UI_ThemeColor(is_obact ? TH_ACTIVE : TH_SELECT);
else
- glColor3ub(80,80,80);
+ glColor3ub(80, 80, 80);
}
else {
- if (ob->flag & OB_FROMGROUP)
+ if (ob->flag & OB_FROMGROUP)
UI_ThemeColor(TH_GROUP);
else {
- if (ob->dtx & OB_DRAWWIRE && flag==DRAW_CONSTCOLOR)
- glColor3ub(80,80,80);
+ if (ob->dtx & OB_DRAWWIRE && flag == DRAW_CONSTCOLOR)
+ glColor3ub(80, 80, 80);
else
UI_ThemeColor(TH_WIRE);
}
@@ -3450,7 +3472,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)) {
@@ -3471,15 +3493,15 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
* if draw wire is 1 then just drawing wire, no need for depth buffer stuff,
* otherwise this wire is to overlay solid mode faces so do some depth buffer tricks.
*/
- if (dt!=OB_WIRE && (draw_wire == OBDRAW_WIRE_ON_DEPTH)) {
+ if (dt != OB_WIRE && (draw_wire == OBDRAW_WIRE_ON_DEPTH)) {
bglPolygonOffset(rv3d->dist, 1.0);
- glDepthMask(0); // disable write in zbuffer, selected edge wires show better
+ glDepthMask(0); // disable write in zbuffer, selected edge wires show better
}
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_SOLID)==0)
- dm->drawEdges(dm, (dt==OB_WIRE || totface==0), me->drawflag & ME_ALLEDGES);
+ if (((v3d->flag2 & V3D_RENDER_OVERRIDE) && v3d->drawtype >= OB_SOLID) == 0)
+ dm->drawEdges(dm, (dt == OB_WIRE || totface == 0), me->drawflag & ME_ALLEDGES);
- if (dt!=OB_WIRE && (draw_wire == OBDRAW_WIRE_ON_DEPTH)) {
+ if (dt != OB_WIRE && (draw_wire == OBDRAW_WIRE_ON_DEPTH)) {
glDepthMask(1);
bglPolygonOffset(rv3d->dist, 0.0);
}
@@ -3500,39 +3522,39 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
/* returns 1 if nothing was drawn, for detecting to draw an object center */
static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, Base *base, int dt, int flag)
{
- Object *ob= base->object;
- Object *obedit= scene->obedit;
- Mesh *me= ob->data;
- BMEditMesh *em= me->edit_btmesh;
- int do_alpha_after= 0, drawlinked= 0, retval= 0, glsl, check_alpha, i;
+ Object *ob = base->object;
+ Object *obedit = scene->obedit;
+ Mesh *me = ob->data;
+ BMEditMesh *em = me->edit_btmesh;
+ int do_alpha_after = 0, drawlinked = 0, retval = 0, glsl, check_alpha, i;
/* If we are drawing shadows and any of the materials don't cast a shadow,
* then don't draw the object */
if (v3d->flag2 & V3D_RENDER_SHADOW) {
- for (i=0; i<ob->totcol; ++i) {
- Material *ma= give_current_material(ob, i);
+ for (i = 0; i < ob->totcol; ++i) {
+ Material *ma = give_current_material(ob, i);
if (ma && !(ma->mode & MA_SHADBUF)) {
return 1;
}
}
}
- if (obedit && ob!=obedit && ob->data==obedit->data) {
- if (ob_get_key(ob) || ob_get_key(obedit));
- else if (ob->modifiers.first || obedit->modifiers.first);
- else drawlinked= 1;
+ if (obedit && ob != obedit && ob->data == obedit->data) {
+ if (ob_get_key(ob) || ob_get_key(obedit)) {}
+ else if (ob->modifiers.first || obedit->modifiers.first) {}
+ else drawlinked = 1;
}
- if (ob==obedit || drawlinked) {
+ if (ob == obedit || drawlinked) {
DerivedMesh *finalDM, *cageDM;
- if (obedit!=ob)
+ if (obedit != ob)
finalDM = cageDM = editbmesh_get_derived_base(ob, em);
else
cageDM = editbmesh_get_derived_cage_and_final(scene, ob, em, &finalDM,
- scene->customdata_mask);
+ scene->customdata_mask);
- if (dt>OB_WIRE) {
+ if (dt > OB_WIRE) {
glsl = draw_glsl_material(scene, ob, v3d, dt);
GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, NULL);
@@ -3542,25 +3564,25 @@ static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
GPU_end_object_materials();
- if (obedit!=ob && finalDM)
+ if (obedit != ob && finalDM)
finalDM->release(finalDM);
}
else {
/* don't create boundbox here with mesh_get_bb(), the derived system will make it, puts deformed bb's OK */
- if (me->totpoly <= 4 || ED_view3d_boundbox_clip(rv3d, ob->obmat, (ob->bb)? ob->bb: me->bb)) {
+ if (me->totpoly <= 4 || ED_view3d_boundbox_clip(rv3d, ob->obmat, (ob->bb) ? ob->bb : me->bb)) {
glsl = draw_glsl_material(scene, ob, v3d, dt);
check_alpha = check_alpha_pass(base);
- if (dt==OB_SOLID || glsl) {
+ if (dt == OB_SOLID || glsl) {
GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl,
- (check_alpha)? &do_alpha_after: NULL);
+ (check_alpha) ? &do_alpha_after : NULL);
}
draw_mesh_fancy(scene, ar, v3d, rv3d, base, dt, flag);
GPU_end_object_materials();
- if (me->totvert==0) retval= 1;
+ if (me->totvert == 0) retval = 1;
}
}
@@ -3585,8 +3607,8 @@ static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
/* ************** DRAW DISPLIST ****************** */
-static int draw_index_wire= 1;
-static int index3_nors_incr= 1;
+static int draw_index_wire = 1;
+static int index3_nors_incr = 1;
/* returns 1 when nothing was drawn */
static int drawDispListwire(ListBase *dlbase)
@@ -3595,87 +3617,87 @@ static int drawDispListwire(ListBase *dlbase)
int parts, nr;
float *data;
- if (dlbase==NULL) return 1;
+ if (dlbase == NULL) return 1;
glEnableClientState(GL_VERTEX_ARRAY);
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- for (dl= dlbase->first; dl; dl= dl->next) {
- if (dl->parts==0 || dl->nr==0)
+ for (dl = dlbase->first; dl; dl = dl->next) {
+ if (dl->parts == 0 || dl->nr == 0)
continue;
- data= dl->verts;
-
- switch(dl->type) {
- case DL_SEGM:
-
- glVertexPointer(3, GL_FLOAT, 0, data);
-
- for (parts=0; parts<dl->parts; parts++)
- glDrawArrays(GL_LINE_STRIP, parts*dl->nr, dl->nr);
-
- break;
- case DL_POLY:
-
- glVertexPointer(3, GL_FLOAT, 0, data);
-
- for (parts=0; parts<dl->parts; parts++)
- glDrawArrays(GL_LINE_LOOP, parts*dl->nr, dl->nr);
-
- break;
- case DL_SURF:
-
- glVertexPointer(3, GL_FLOAT, 0, data);
-
- for (parts=0; parts<dl->parts; parts++) {
- if (dl->flag & DL_CYCL_U)
- glDrawArrays(GL_LINE_LOOP, parts*dl->nr, dl->nr);
- else
- glDrawArrays(GL_LINE_STRIP, parts*dl->nr, dl->nr);
- }
-
- for (nr=0; nr<dl->nr; nr++) {
- int ofs= 3*dl->nr;
-
- data= ( dl->verts )+3*nr;
- parts= dl->parts;
+ data = dl->verts;
+
+ switch (dl->type) {
+ case DL_SEGM:
+
+ glVertexPointer(3, GL_FLOAT, 0, data);
- if (dl->flag & DL_CYCL_V) glBegin(GL_LINE_LOOP);
- else glBegin(GL_LINE_STRIP);
+ for (parts = 0; parts < dl->parts; parts++)
+ glDrawArrays(GL_LINE_STRIP, parts * dl->nr, dl->nr);
- while (parts--) {
- glVertex3fv(data);
- data+=ofs;
+ break;
+ case DL_POLY:
+
+ glVertexPointer(3, GL_FLOAT, 0, data);
+
+ for (parts = 0; parts < dl->parts; parts++)
+ glDrawArrays(GL_LINE_LOOP, parts * dl->nr, dl->nr);
+
+ break;
+ case DL_SURF:
+
+ glVertexPointer(3, GL_FLOAT, 0, data);
+
+ for (parts = 0; parts < dl->parts; parts++) {
+ if (dl->flag & DL_CYCL_U)
+ glDrawArrays(GL_LINE_LOOP, parts * dl->nr, dl->nr);
+ else
+ glDrawArrays(GL_LINE_STRIP, parts * dl->nr, dl->nr);
}
- glEnd();
-
- /* (ton) this code crashes for me when resolv is 86 or higher... no clue */
+
+ for (nr = 0; nr < dl->nr; nr++) {
+ int ofs = 3 * dl->nr;
+
+ data = (dl->verts) + 3 * nr;
+ parts = dl->parts;
+
+ if (dl->flag & DL_CYCL_V) glBegin(GL_LINE_LOOP);
+ else glBegin(GL_LINE_STRIP);
+
+ while (parts--) {
+ glVertex3fv(data);
+ data += ofs;
+ }
+ glEnd();
+
+/* (ton) this code crashes for me when resolv is 86 or higher... no clue */
// glVertexPointer(3, GL_FLOAT, sizeof(float)*3*dl->nr, data + 3*nr);
// if (dl->flag & DL_CYCL_V)
// glDrawArrays(GL_LINE_LOOP, 0, dl->parts);
// else
// glDrawArrays(GL_LINE_STRIP, 0, dl->parts);
- }
- break;
-
- case DL_INDEX3:
- if (draw_index_wire) {
- glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- glDrawElements(GL_TRIANGLES, 3*dl->parts, GL_UNSIGNED_INT, dl->index);
- }
- break;
-
- case DL_INDEX4:
- if (draw_index_wire) {
- glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- glDrawElements(GL_QUADS, 4*dl->parts, GL_UNSIGNED_INT, dl->index);
- }
- break;
+ }
+ break;
+
+ case DL_INDEX3:
+ if (draw_index_wire) {
+ glVertexPointer(3, GL_FLOAT, 0, dl->verts);
+ glDrawElements(GL_TRIANGLES, 3 * dl->parts, GL_UNSIGNED_INT, dl->index);
+ }
+ break;
+
+ case DL_INDEX4:
+ if (draw_index_wire) {
+ glVertexPointer(3, GL_FLOAT, 0, dl->verts);
+ glDrawElements(GL_QUADS, 4 * dl->parts, GL_UNSIGNED_INT, dl->index);
+ }
+ break;
}
}
glDisableClientState(GL_VERTEX_ARRAY);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
return 0;
}
@@ -3687,7 +3709,7 @@ static void drawDispListsolid(ListBase *lb, Object *ob, int glsl)
float *data, curcol[4];
float *ndata;
- if (lb==NULL) return;
+ if (lb == NULL) return;
/* for drawing wire */
glGetFloatv(GL_CURRENT_COLOR, curcol);
@@ -3698,100 +3720,100 @@ static void drawDispListsolid(ListBase *lb, Object *ob, int glsl)
if (ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CW);
else glFrontFace(GL_CCW);
- if (ob->type==OB_MBALL) { // mball always smooth shaded
+ if (ob->type == OB_MBALL) { // mball always smooth shaded
glShadeModel(GL_SMOOTH);
}
- dl= lb->first;
+ dl = lb->first;
while (dl) {
- data= dl->verts;
- ndata= dl->nors;
+ data = dl->verts;
+ ndata = dl->nors;
- switch(dl->type) {
- case DL_SEGM:
- if (ob->type==OB_SURF) {
- int nr;
+ switch (dl->type) {
+ case DL_SEGM:
+ if (ob->type == OB_SURF) {
+ int nr;
- glDisable(GL_LIGHTING);
- glColor3fv(curcol);
-
- // glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- // glDrawArrays(GL_LINE_STRIP, 0, dl->nr);
+ glDisable(GL_LIGHTING);
+ glColor3fv(curcol);
- glBegin(GL_LINE_STRIP);
- for (nr= dl->nr; nr; nr--, data+=3)
- glVertex3fv(data);
- glEnd();
+ // glVertexPointer(3, GL_FLOAT, 0, dl->verts);
+ // glDrawArrays(GL_LINE_STRIP, 0, dl->nr);
- glEnable(GL_LIGHTING);
- }
- break;
- case DL_POLY:
- if (ob->type==OB_SURF) {
- int nr;
+ glBegin(GL_LINE_STRIP);
+ for (nr = dl->nr; nr; nr--, data += 3)
+ glVertex3fv(data);
+ glEnd();
- glDisable(GL_LIGHTING);
-
- /* for some reason glDrawArrays crashes here in half of the platforms (not osx) */
- //glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- //glDrawArrays(GL_LINE_LOOP, 0, dl->nr);
-
- glBegin(GL_LINE_LOOP);
- for (nr= dl->nr; nr; nr--, data+=3)
- glVertex3fv(data);
- glEnd();
-
- glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHTING);
+ }
break;
- }
- case DL_SURF:
-
- if (dl->index) {
- GPU_enable_material(dl->col+1, (glsl)? &gattribs: NULL);
-
- if (dl->rt & CU_SMOOTH) glShadeModel(GL_SMOOTH);
- else glShadeModel(GL_FLAT);
+ case DL_POLY:
+ if (ob->type == OB_SURF) {
+ int nr;
+
+ glDisable(GL_LIGHTING);
+
+ /* for some reason glDrawArrays crashes here in half of the platforms (not osx) */
+ //glVertexPointer(3, GL_FLOAT, 0, dl->verts);
+ //glDrawArrays(GL_LINE_LOOP, 0, dl->nr);
+
+ glBegin(GL_LINE_LOOP);
+ for (nr = dl->nr; nr; nr--, data += 3)
+ glVertex3fv(data);
+ glEnd();
+
+ glEnable(GL_LIGHTING);
+ break;
+ }
+ case DL_SURF:
+
+ if (dl->index) {
+ GPU_enable_material(dl->col + 1, (glsl) ? &gattribs : NULL);
+
+ if (dl->rt & CU_SMOOTH) glShadeModel(GL_SMOOTH);
+ else glShadeModel(GL_FLAT);
+
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glVertexPointer(3, GL_FLOAT, 0, dl->verts);
+ glNormalPointer(GL_FLOAT, 0, dl->nors);
+ glDrawElements(GL_QUADS, 4 * dl->totindex, GL_UNSIGNED_INT, dl->index);
+ glDisableClientState(GL_NORMAL_ARRAY);
+ }
+ break;
+
+ case DL_INDEX3:
+ GPU_enable_material(dl->col + 1, (glsl) ? &gattribs : NULL);
- glEnableClientState(GL_NORMAL_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- glNormalPointer(GL_FLOAT, 0, dl->nors);
- glDrawElements(GL_QUADS, 4*dl->totindex, GL_UNSIGNED_INT, dl->index);
- glDisableClientState(GL_NORMAL_ARRAY);
- }
- break;
- case DL_INDEX3:
- GPU_enable_material(dl->col+1, (glsl)? &gattribs: NULL);
-
- glVertexPointer(3, GL_FLOAT, 0, dl->verts);
-
- /* voor polys only one normal needed */
- if (index3_nors_incr) {
+ /* voor polys only one normal needed */
+ if (index3_nors_incr) {
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glNormalPointer(GL_FLOAT, 0, dl->nors);
+ }
+ else
+ glNormal3fv(ndata);
+
+ glDrawElements(GL_TRIANGLES, 3 * dl->parts, GL_UNSIGNED_INT, dl->index);
+
+ if (index3_nors_incr)
+ glDisableClientState(GL_NORMAL_ARRAY);
+
+ break;
+
+ case DL_INDEX4:
+ GPU_enable_material(dl->col + 1, (glsl) ? &gattribs : NULL);
+
glEnableClientState(GL_NORMAL_ARRAY);
+ glVertexPointer(3, GL_FLOAT, 0, dl->verts);
glNormalPointer(GL_FLOAT, 0, dl->nors);
- }
- else
- glNormal3fv(ndata);
-
- glDrawElements(GL_TRIANGLES, 3*dl->parts, GL_UNSIGNED_INT, dl->index);
-
- if (index3_nors_incr)
+ glDrawElements(GL_QUADS, 4 * dl->parts, GL_UNSIGNED_INT, dl->index);
glDisableClientState(GL_NORMAL_ARRAY);
- break;
-
- case DL_INDEX4:
- GPU_enable_material(dl->col+1, (glsl)? &gattribs: NULL);
-
- glEnableClientState(GL_NORMAL_ARRAY);
- glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- glNormalPointer(GL_FLOAT, 0, dl->nors);
- glDrawElements(GL_QUADS, 4*dl->parts, GL_UNSIGNED_INT, dl->index);
- glDisableClientState(GL_NORMAL_ARRAY);
-
- break;
+ break;
}
- dl= dl->next;
+ dl = dl->next;
}
glDisableClientState(GL_VERTEX_ARRAY);
@@ -3803,20 +3825,20 @@ static void drawDispListsolid(ListBase *lb, Object *ob, int glsl)
static void drawCurveDMWired(Object *ob)
{
DerivedMesh *dm = ob->derivedFinal;
- dm->drawEdges (dm, 1, 0);
+ dm->drawEdges(dm, 1, 0);
}
/* return 1 when nothing was drawn */
static int drawCurveDerivedMesh(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int dt)
{
- Object *ob= base->object;
+ Object *ob = base->object;
DerivedMesh *dm = ob->derivedFinal;
if (!dm) {
return 1;
}
- if (dt>OB_WIRE && dm->getNumTessFaces(dm)) {
+ if (dt > OB_WIRE && dm->getNumTessFaces(dm)) {
int glsl = draw_glsl_material(scene, ob, v3d, dt);
GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, NULL);
@@ -3831,8 +3853,8 @@ static int drawCurveDerivedMesh(Scene *scene, View3D *v3d, RegionView3D *rv3d, B
GPU_end_object_materials();
}
else {
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_SOLID)==0)
- drawCurveDMWired (ob);
+ if (((v3d->flag2 & V3D_RENDER_OVERRIDE) && v3d->drawtype >= OB_SOLID) == 0)
+ drawCurveDMWired(ob);
}
return 0;
@@ -3841,40 +3863,77 @@ static int drawCurveDerivedMesh(Scene *scene, View3D *v3d, RegionView3D *rv3d, B
/* returns 1 when nothing was drawn */
static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int dt)
{
- Object *ob= base->object;
- ListBase *lb=NULL;
+ Object *ob = base->object;
+ ListBase *lb = NULL;
DispList *dl;
Curve *cu;
- const short render_only= (v3d->flag2 & V3D_RENDER_OVERRIDE);
- const short solid= (dt > OB_WIRE);
- int retval= 0;
+ const short render_only = (v3d->flag2 & V3D_RENDER_OVERRIDE);
+ const short solid = (dt > OB_WIRE);
+ int retval = 0;
if (drawCurveDerivedMesh(scene, v3d, rv3d, base, dt) == 0) {
return 0;
}
- switch(ob->type) {
- case OB_FONT:
- case OB_CURVE:
- cu= ob->data;
-
- lb= &ob->disp;
-
- if (solid) {
- dl= lb->first;
- if (dl==NULL) return 1;
+ switch (ob->type) {
+ case OB_FONT:
+ case OB_CURVE:
+ cu = ob->data;
- if (dl->nors==NULL) addnormalsDispList(lb);
- index3_nors_incr= 0;
-
- if ( displist_has_faces(lb)==0) {
- if (!render_only) {
- draw_index_wire= 0;
- drawDispListwire(lb);
- draw_index_wire= 1;
+ lb = &ob->disp;
+
+ if (solid) {
+ dl = lb->first;
+ if (dl == NULL) return 1;
+
+ if (dl->nors == NULL) addnormalsDispList(lb);
+ index3_nors_incr = 0;
+
+ if (displist_has_faces(lb) == 0) {
+ if (!render_only) {
+ draw_index_wire = 0;
+ drawDispListwire(lb);
+ draw_index_wire = 1;
+ }
+ }
+ else {
+ if (draw_glsl_material(scene, ob, v3d, dt)) {
+ GPU_begin_object_materials(v3d, rv3d, scene, ob, 1, NULL);
+ drawDispListsolid(lb, ob, 1);
+ GPU_end_object_materials();
+ }
+ else {
+ GPU_begin_object_materials(v3d, rv3d, scene, ob, 0, NULL);
+ drawDispListsolid(lb, ob, 0);
+ GPU_end_object_materials();
+ }
+ if (cu->editnurb && cu->bevobj == NULL && cu->taperobj == NULL && cu->ext1 == 0.0f && cu->ext2 == 0.0f) {
+ cpack(0);
+ draw_index_wire = 0;
+ drawDispListwire(lb);
+ draw_index_wire = 1;
+ }
}
+ index3_nors_incr = 1;
}
else {
+ if (!render_only || (render_only && displist_has_faces(lb))) {
+ draw_index_wire = 0;
+ retval = drawDispListwire(lb);
+ draw_index_wire = 1;
+ }
+ }
+ break;
+ case OB_SURF:
+
+ lb = &ob->disp;
+
+ if (solid) {
+ dl = lb->first;
+ if (dl == NULL) return 1;
+
+ if (dl->nors == NULL) addnormalsDispList(lb);
+
if (draw_glsl_material(scene, ob, v3d, dt)) {
GPU_begin_object_materials(v3d, rv3d, scene, ob, 1, NULL);
drawDispListsolid(lb, ob, 1);
@@ -3885,74 +3944,37 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas
drawDispListsolid(lb, ob, 0);
GPU_end_object_materials();
}
- if (cu->editnurb && cu->bevobj==NULL && cu->taperobj==NULL && cu->ext1 == 0.0f && cu->ext2 == 0.0f) {
- cpack(0);
- draw_index_wire= 0;
- drawDispListwire(lb);
- draw_index_wire= 1;
- }
- }
- index3_nors_incr= 1;
- }
- else {
- if (!render_only || (render_only && displist_has_faces(lb))) {
- draw_index_wire= 0;
- retval= drawDispListwire(lb);
- draw_index_wire= 1;
- }
- }
- break;
- case OB_SURF:
-
- lb= &ob->disp;
-
- if (solid) {
- dl= lb->first;
- if (dl==NULL) return 1;
-
- if (dl->nors==NULL) addnormalsDispList(lb);
-
- if (draw_glsl_material(scene, ob, v3d, dt)) {
- GPU_begin_object_materials(v3d, rv3d, scene, ob, 1, NULL);
- drawDispListsolid(lb, ob, 1);
- GPU_end_object_materials();
}
else {
- GPU_begin_object_materials(v3d, rv3d, scene, ob, 0, NULL);
- drawDispListsolid(lb, ob, 0);
- GPU_end_object_materials();
+ retval = drawDispListwire(lb);
}
- }
- else {
- retval= drawDispListwire(lb);
- }
- break;
- case OB_MBALL:
-
- if ( is_basis_mball(ob)) {
- lb= &ob->disp;
- if (lb->first==NULL) makeDispListMBall(scene, ob);
- if (lb->first==NULL) return 1;
-
- if (solid) {
-
- if (draw_glsl_material(scene, ob, v3d, dt)) {
- GPU_begin_object_materials(v3d, rv3d, scene, ob, 1, NULL);
- drawDispListsolid(lb, ob, 1);
- GPU_end_object_materials();
+ break;
+ case OB_MBALL:
+
+ if (is_basis_mball(ob)) {
+ lb = &ob->disp;
+ if (lb->first == NULL) makeDispListMBall(scene, ob);
+ if (lb->first == NULL) return 1;
+
+ if (solid) {
+
+ if (draw_glsl_material(scene, ob, v3d, dt)) {
+ GPU_begin_object_materials(v3d, rv3d, scene, ob, 1, NULL);
+ drawDispListsolid(lb, ob, 1);
+ GPU_end_object_materials();
+ }
+ else {
+ GPU_begin_object_materials(v3d, rv3d, scene, ob, 0, NULL);
+ drawDispListsolid(lb, ob, 0);
+ GPU_end_object_materials();
+ }
}
else {
- GPU_begin_object_materials(v3d, rv3d, scene, ob, 0, NULL);
- drawDispListsolid(lb, ob, 0);
- GPU_end_object_materials();
+ /* MetaBalls use DL_INDEX4 type of DispList */
+ retval = drawDispListwire(lb);
}
}
- else{
- /* MetaBalls use DL_INDEX4 type of DispList */
- retval= drawDispListwire(lb);
- }
- }
- break;
+ break;
}
return retval;
@@ -3962,21 +3984,21 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas
static void draw_particle_arrays(int draw_as, int totpoint, int ob_dt, int select)
{
/* draw created data arrays */
- switch(draw_as) {
+ switch (draw_as) {
case PART_DRAW_AXIS:
case PART_DRAW_CROSS:
- glDrawArrays(GL_LINES, 0, 6*totpoint);
+ glDrawArrays(GL_LINES, 0, 6 * totpoint);
break;
case PART_DRAW_LINE:
- glDrawArrays(GL_LINES, 0, 2*totpoint);
+ glDrawArrays(GL_LINES, 0, 2 * totpoint);
break;
case PART_DRAW_BB:
- if (ob_dt<=OB_WIRE || select)
- glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
+ if (ob_dt <= OB_WIRE || select)
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
else
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- glDrawArrays(GL_QUADS, 0, 4*totpoint);
+ glDrawArrays(GL_QUADS, 0, 4 * totpoint);
break;
default:
glDrawArrays(GL_POINTS, 0, totpoint);
@@ -3989,7 +4011,7 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix
float vec[3], vec2[3];
float *vd = NULL;
float *cd = NULL;
- float ma_col[3]= {0.0f, 0.0f, 0.0f};
+ float ma_col[3] = {0.0f, 0.0f, 0.0f};
/* null only for PART_DRAW_CIRC */
if (pdd) {
@@ -4001,90 +4023,90 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix
}
}
- switch(draw_as) {
+ switch (draw_as) {
case PART_DRAW_DOT:
{
if (vd) {
- copy_v3_v3(vd,state->co); pdd->vd+=3;
+ copy_v3_v3(vd, state->co); pdd->vd += 3;
}
if (cd) {
copy_v3_v3(cd, pdd->ma_col);
- pdd->cd+=3;
+ pdd->cd += 3;
}
break;
}
case PART_DRAW_CROSS:
case PART_DRAW_AXIS:
{
- vec[0]=2.0f*pixsize;
- vec[1]=vec[2]=0.0;
- mul_qt_v3(state->rot,vec);
- if (draw_as==PART_DRAW_AXIS) {
+ vec[0] = 2.0f * pixsize;
+ vec[1] = vec[2] = 0.0;
+ mul_qt_v3(state->rot, vec);
+ if (draw_as == PART_DRAW_AXIS) {
if (cd) {
- cd[1]=cd[2]=cd[4]=cd[5]=0.0;
- cd[0]=cd[3]=1.0;
- cd[6]=cd[8]=cd[9]=cd[11]=0.0;
- cd[7]=cd[10]=1.0;
- cd[13]=cd[12]=cd[15]=cd[16]=0.0;
- cd[14]=cd[17]=1.0;
- pdd->cd+=18;
+ cd[1] = cd[2] = cd[4] = cd[5] = 0.0;
+ cd[0] = cd[3] = 1.0;
+ cd[6] = cd[8] = cd[9] = cd[11] = 0.0;
+ cd[7] = cd[10] = 1.0;
+ cd[13] = cd[12] = cd[15] = cd[16] = 0.0;
+ cd[14] = cd[17] = 1.0;
+ pdd->cd += 18;
}
- copy_v3_v3(vec2,state->co);
+ copy_v3_v3(vec2, state->co);
}
else {
if (cd) {
- cd[0]=cd[3]=cd[6]=cd[ 9]=cd[12]=cd[15]= ma_col[0];
- cd[1]=cd[4]=cd[7]=cd[10]=cd[13]=cd[16]= ma_col[1];
- cd[2]=cd[5]=cd[8]=cd[11]=cd[14]=cd[17]= ma_col[2];
- pdd->cd+=18;
+ cd[0] = cd[3] = cd[6] = cd[9] = cd[12] = cd[15] = ma_col[0];
+ cd[1] = cd[4] = cd[7] = cd[10] = cd[13] = cd[16] = ma_col[1];
+ cd[2] = cd[5] = cd[8] = cd[11] = cd[14] = cd[17] = ma_col[2];
+ pdd->cd += 18;
}
sub_v3_v3v3(vec2, state->co, vec);
}
add_v3_v3(vec, state->co);
- copy_v3_v3(pdd->vd,vec); pdd->vd+=3;
- copy_v3_v3(pdd->vd,vec2); pdd->vd+=3;
-
- vec[1]=2.0f*pixsize;
- vec[0]=vec[2]=0.0;
- mul_qt_v3(state->rot,vec);
- if (draw_as==PART_DRAW_AXIS) {
- copy_v3_v3(vec2,state->co);
- }
+ copy_v3_v3(pdd->vd, vec); pdd->vd += 3;
+ copy_v3_v3(pdd->vd, vec2); pdd->vd += 3;
+
+ vec[1] = 2.0f * pixsize;
+ vec[0] = vec[2] = 0.0;
+ mul_qt_v3(state->rot, vec);
+ if (draw_as == PART_DRAW_AXIS) {
+ copy_v3_v3(vec2, state->co);
+ }
else sub_v3_v3v3(vec2, state->co, vec);
add_v3_v3(vec, state->co);
- copy_v3_v3(pdd->vd,vec); pdd->vd+=3;
- copy_v3_v3(pdd->vd,vec2); pdd->vd+=3;
+ copy_v3_v3(pdd->vd, vec); pdd->vd += 3;
+ copy_v3_v3(pdd->vd, vec2); pdd->vd += 3;
- vec[2]=2.0f*pixsize;
- vec[0]=vec[1]=0.0;
- mul_qt_v3(state->rot,vec);
- if (draw_as==PART_DRAW_AXIS) {
- copy_v3_v3(vec2,state->co);
+ vec[2] = 2.0f * pixsize;
+ vec[0] = vec[1] = 0.0;
+ mul_qt_v3(state->rot, vec);
+ if (draw_as == PART_DRAW_AXIS) {
+ copy_v3_v3(vec2, state->co);
}
else sub_v3_v3v3(vec2, state->co, vec);
add_v3_v3(vec, state->co);
- copy_v3_v3(pdd->vd,vec); pdd->vd+=3;
- copy_v3_v3(pdd->vd,vec2); pdd->vd+=3;
+ copy_v3_v3(pdd->vd, vec); pdd->vd += 3;
+ copy_v3_v3(pdd->vd, vec2); pdd->vd += 3;
break;
}
case PART_DRAW_LINE:
{
- copy_v3_v3(vec,state->vel);
+ copy_v3_v3(vec, state->vel);
normalize_v3(vec);
if (draw & PART_DRAW_VEL_LENGTH)
- mul_v3_fl(vec,len_v3(state->vel));
- madd_v3_v3v3fl(pdd->vd, state->co, vec, -draw_line[0]); pdd->vd+=3;
- madd_v3_v3v3fl(pdd->vd, state->co, vec, draw_line[1]); pdd->vd+=3;
+ mul_v3_fl(vec, len_v3(state->vel));
+ madd_v3_v3v3fl(pdd->vd, state->co, vec, -draw_line[0]); pdd->vd += 3;
+ madd_v3_v3v3fl(pdd->vd, state->co, vec, draw_line[1]); pdd->vd += 3;
if (cd) {
- cd[0]=cd[3]= ma_col[0];
- cd[1]=cd[4]= ma_col[1];
- cd[2]=cd[5]= ma_col[2];
- pdd->cd+=6;
+ cd[0] = cd[3] = ma_col[0];
+ cd[1] = cd[4] = ma_col[1];
+ cd[2] = cd[5] = ma_col[2];
+ pdd->cd += 6;
}
break;
}
@@ -4097,10 +4119,10 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix
{
float xvec[3], yvec[3], zvec[3], bb_center[3];
if (cd) {
- cd[0]=cd[3]=cd[6]=cd[ 9]= ma_col[0];
- cd[1]=cd[4]=cd[7]=cd[10]= ma_col[1];
- cd[2]=cd[5]=cd[8]=cd[11]= ma_col[2];
- pdd->cd+=12;
+ cd[0] = cd[3] = cd[6] = cd[9] = ma_col[0];
+ cd[1] = cd[4] = cd[7] = cd[10] = ma_col[1];
+ cd[2] = cd[5] = cd[8] = cd[11] = ma_col[2];
+ pdd->cd += 12;
}
@@ -4110,21 +4132,21 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix
psys_make_billboard(bb, xvec, yvec, zvec, bb_center);
add_v3_v3v3(pdd->vd, bb_center, xvec);
- add_v3_v3(pdd->vd, yvec); pdd->vd+=3;
+ add_v3_v3(pdd->vd, yvec); pdd->vd += 3;
sub_v3_v3v3(pdd->vd, bb_center, xvec);
- add_v3_v3(pdd->vd, yvec); pdd->vd+=3;
+ add_v3_v3(pdd->vd, yvec); pdd->vd += 3;
sub_v3_v3v3(pdd->vd, bb_center, xvec);
- sub_v3_v3v3(pdd->vd, pdd->vd,yvec); pdd->vd+=3;
+ sub_v3_v3v3(pdd->vd, pdd->vd, yvec); pdd->vd += 3;
add_v3_v3v3(pdd->vd, bb_center, xvec);
- sub_v3_v3v3(pdd->vd, pdd->vd, yvec); pdd->vd+=3;
+ sub_v3_v3v3(pdd->vd, pdd->vd, yvec); pdd->vd += 3;
- copy_v3_v3(pdd->nd, zvec); pdd->nd+=3;
- copy_v3_v3(pdd->nd, zvec); pdd->nd+=3;
- copy_v3_v3(pdd->nd, zvec); pdd->nd+=3;
- copy_v3_v3(pdd->nd, zvec); pdd->nd+=3;
+ copy_v3_v3(pdd->nd, zvec); pdd->nd += 3;
+ copy_v3_v3(pdd->nd, zvec); pdd->nd += 3;
+ copy_v3_v3(pdd->nd, zvec); pdd->nd += 3;
+ copy_v3_v3(pdd->nd, zvec); pdd->nd += 3;
break;
}
}
@@ -4133,7 +4155,7 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix
/* mostly tries to use vertex arrays for speed */
/* 1. check that everything is ok & updated */
-/* 2. start initialising things */
+/* 2. start initializing things */
/* 3. initialize according to draw type */
/* 4. allocate drawing data arrays */
/* 5. start filling the arrays */
@@ -4142,37 +4164,37 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix
static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv3d,
Base *base, ParticleSystem *psys, int ob_dt)
{
- Object *ob=base->object;
+ Object *ob = base->object;
ParticleEditSettings *pset = PE_settings(scene);
ParticleSettings *part = psys->part;
ParticleData *pars = psys->particles;
ParticleData *pa;
- ParticleKey state, *states=NULL;
+ ParticleKey state, *states = NULL;
ParticleBillboardData bb;
- ParticleSimulationData sim= {NULL};
+ ParticleSimulationData sim = {NULL};
ParticleDrawData *pdd = psys->pdd;
Material *ma;
float vel[3], imat[4][4];
float timestep, pixsize_scale, pa_size, r_tilt, r_length;
float pa_time, pa_birthtime, pa_dietime, pa_health, intensity;
float cfra;
- float ma_col[3]= {0.0f, 0.0f, 0.0f};
- int a, totpart, totpoint=0, totve=0, drawn, draw_as, totchild=0;
- int select=ob->flag&SELECT, create_cdata=0, need_v=0;
+ float ma_col[3] = {0.0f, 0.0f, 0.0f};
+ int a, totpart, totpoint = 0, totve = 0, drawn, draw_as, totchild = 0;
+ int select = ob->flag & SELECT, create_cdata = 0, need_v = 0;
GLint polygonmode[2];
char numstr[32];
- unsigned char tcol[4]= {0, 0, 0, 255};
+ unsigned char tcol[4] = {0, 0, 0, 255};
/* 1. */
- if (part==NULL || !psys_check_enabled(ob, psys))
+ if (part == NULL || !psys_check_enabled(ob, psys))
return;
- if (pars==NULL) return;
+ if (pars == NULL) return;
/* don't draw normal paths in edit mode */
- if (psys_in_edit_mode(scene, psys) && (pset->flag & PE_DRAW_PART)==0)
+ if (psys_in_edit_mode(scene, psys) && (pset->flag & PE_DRAW_PART) == 0)
return;
-
+
if (part->draw_as == PART_DRAW_REND)
draw_as = part->ren_as;
else
@@ -4182,33 +4204,33 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
return;
/* 2. */
- sim.scene= scene;
- sim.ob= ob;
- sim.psys= psys;
- sim.psmd = psys_get_modifier(ob,psys);
+ sim.scene = scene;
+ sim.ob = ob;
+ sim.psys = psys;
+ sim.psmd = psys_get_modifier(ob, psys);
- if (part->phystype==PART_PHYS_KEYED) {
- if (psys->flag&PSYS_KEYED) {
+ if (part->phystype == PART_PHYS_KEYED) {
+ if (psys->flag & PSYS_KEYED) {
psys_count_keyed_targets(&sim);
- if (psys->totkeyed==0)
+ if (psys->totkeyed == 0)
return;
}
}
if (select) {
- select=0;
- if (psys_get_current(ob)==psys)
- select=1;
+ select = 0;
+ if (psys_get_current(ob) == psys)
+ select = 1;
}
- psys->flag|=PSYS_DRAWING;
+ psys->flag |= PSYS_DRAWING;
- if (part->type==PART_HAIR && !psys->childcache)
- totchild=0;
+ if (part->type == PART_HAIR && !psys->childcache)
+ totchild = 0;
else
- totchild=psys->totchild*part->disp/100;
+ totchild = psys->totchild * part->disp / 100;
- ma= give_current_material(ob,part->omat);
+ ma = give_current_material(ob, part->omat);
if (v3d->zbuf) glDepthMask(1);
@@ -4219,7 +4241,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
glColor3ubv(tcol);
- timestep= psys_get_timestep(&sim);
+ timestep = psys_get_timestep(&sim);
if ( (base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP) ) {
float mat[4][4];
@@ -4230,27 +4252,27 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
/* needed for text display */
invert_m4_m4(ob->imat, ob->obmat);
- totpart=psys->totpart;
+ totpart = psys->totpart;
- cfra= BKE_curframe(scene);
+ cfra = BKE_curframe(scene);
- if (draw_as==PART_DRAW_PATH && psys->pathcache==NULL && psys->childcache==NULL)
- draw_as=PART_DRAW_DOT;
+ if (draw_as == PART_DRAW_PATH && psys->pathcache == NULL && psys->childcache == NULL)
+ draw_as = PART_DRAW_DOT;
/* 3. */
- switch(draw_as) {
+ switch (draw_as) {
case PART_DRAW_DOT:
if (part->draw_size)
glPointSize(part->draw_size);
else
- glPointSize(2.0); /* default dot size */
+ glPointSize(2.0); /* default dot size */
break;
case PART_DRAW_CIRC:
/* calculate view aligned matrix: */
copy_m4_m4(imat, rv3d->viewinv);
normalize_v3(imat[0]);
normalize_v3(imat[1]);
- /* no break! */
+ /* no break! */
case PART_DRAW_CROSS:
case PART_DRAW_AXIS:
/* lets calculate the scale: */
@@ -4260,36 +4282,36 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
else
pixsize_scale = part->draw_size;
- if (draw_as==PART_DRAW_AXIS)
+ if (draw_as == PART_DRAW_AXIS)
create_cdata = 1;
break;
case PART_DRAW_OB:
- if (part->dup_ob==NULL)
- draw_as=PART_DRAW_DOT;
+ if (part->dup_ob == NULL)
+ draw_as = PART_DRAW_DOT;
else
- draw_as=0;
+ draw_as = 0;
break;
case PART_DRAW_GR:
- if (part->dup_group==NULL)
- draw_as=PART_DRAW_DOT;
+ if (part->dup_group == NULL)
+ draw_as = PART_DRAW_DOT;
else
- draw_as=0;
+ draw_as = 0;
break;
case PART_DRAW_BB:
- if (v3d->camera==NULL && part->bb_ob==NULL) {
+ if (v3d->camera == NULL && part->bb_ob == NULL) {
printf("Billboards need an active camera or a target object!\n");
- draw_as=part->draw_as=PART_DRAW_DOT;
+ draw_as = part->draw_as = PART_DRAW_DOT;
if (part->draw_size)
glPointSize(part->draw_size);
else
- glPointSize(2.0); /* default dot size */
+ glPointSize(2.0); /* default dot size */
}
else if (part->bb_ob)
- bb.ob=part->bb_ob;
+ bb.ob = part->bb_ob;
else
- bb.ob=v3d->camera;
+ bb.ob = v3d->camera;
bb.align = part->bb_align;
bb.anim = part->bb_anim;
@@ -4298,18 +4320,20 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
case PART_DRAW_PATH:
break;
case PART_DRAW_LINE:
- need_v=1;
+ need_v = 1;
break;
}
- if (part->draw & PART_DRAW_SIZE && part->draw_as!=PART_DRAW_CIRC) {
+ if (part->draw & PART_DRAW_SIZE && part->draw_as != PART_DRAW_CIRC) {
copy_m4_m4(imat, rv3d->viewinv);
normalize_v3(imat[0]);
normalize_v3(imat[1]);
}
if (ELEM3(draw_as, PART_DRAW_DOT, PART_DRAW_CROSS, PART_DRAW_LINE)
- && part->draw_col > PART_DRAW_COL_MAT)
+ && part->draw_col > PART_DRAW_COL_MAT)
+ {
create_cdata = 1;
+ }
if (!create_cdata && pdd && pdd->cdata) {
MEM_freeN(pdd->cdata);
@@ -4317,7 +4341,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
}
/* 4. */
- if (draw_as && ELEM(draw_as, PART_DRAW_PATH, PART_DRAW_CIRC)==0) {
+ if (draw_as && ELEM(draw_as, PART_DRAW_PATH, PART_DRAW_CIRC) == 0) {
int tot_vec_size = (totpart + totchild) * 3 * sizeof(float);
int create_ndata = 0;
@@ -4329,7 +4353,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
psys_make_temp_pointcache(ob, psys);
}
- switch(draw_as) {
+ switch (draw_as) {
case PART_DRAW_AXIS:
case PART_DRAW_CROSS:
tot_vec_size *= 6;
@@ -4364,14 +4388,14 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
else if (pdd->vedata) {
/* velocity data not needed, so free it */
MEM_freeN(pdd->vedata);
- pdd->vedata= NULL;
+ pdd->vedata = NULL;
}
- pdd->vd= pdd->vdata;
- pdd->ved= pdd->vedata;
- pdd->cd= pdd->cdata;
- pdd->nd= pdd->ndata;
- pdd->tot_vec_size= tot_vec_size;
+ pdd->vd = pdd->vdata;
+ pdd->ved = pdd->vedata;
+ pdd->cd = pdd->cdata;
+ pdd->nd = pdd->ndata;
+ pdd->tot_vec_size = tot_vec_size;
}
else if (psys->pdd) {
psys_free_pdd(psys);
@@ -4380,199 +4404,201 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
}
if (pdd) {
- pdd->ma_col= ma_col;
+ pdd->ma_col = ma_col;
}
- psys->lattice= psys_get_lattice(&sim);
+ psys->lattice = psys_get_lattice(&sim);
/* circles don't use drawdata, so have to add a special case here */
- if ((pdd || draw_as==PART_DRAW_CIRC) && draw_as!=PART_DRAW_PATH) {
-/* 5. */
- if (pdd && (pdd->flag & PARTICLE_DRAW_DATA_UPDATED)
- && (pdd->vedata || part->draw & (PART_DRAW_SIZE|PART_DRAW_NUM|PART_DRAW_HEALTH))==0) {
+ if ((pdd || draw_as == PART_DRAW_CIRC) && draw_as != PART_DRAW_PATH) {
+ /* 5. */
+ if (pdd && (pdd->flag & PARTICLE_DRAW_DATA_UPDATED) &&
+ (pdd->vedata || part->draw & (PART_DRAW_SIZE | PART_DRAW_NUM | PART_DRAW_HEALTH)) == 0)
+ {
totpoint = pdd->totpoint; /* draw data is up to date */
}
- else for (a=0,pa=pars; a<totpart+totchild; a++, pa++) {
- /* setup per particle individual stuff */
- if (a<totpart) {
- if (totchild && (part->draw&PART_DRAW_PARENT)==0) continue;
- if (pa->flag & PARS_NO_DISP || pa->flag & PARS_UNEXIST) continue;
-
- pa_time=(cfra-pa->time)/pa->lifetime;
- pa_birthtime=pa->time;
- pa_dietime = pa->dietime;
- pa_size=pa->size;
- if (part->phystype==PART_PHYS_BOIDS)
- pa_health = pa->boid->data.health;
- else
- pa_health = -1.0;
-
- r_tilt = 2.0f*(PSYS_FRAND(a + 21) - 0.5f);
- r_length = PSYS_FRAND(a + 22);
-
- if (part->draw_col > PART_DRAW_COL_MAT) {
- switch(part->draw_col) {
- case PART_DRAW_COL_VEL:
- intensity = len_v3(pa->state.vel)/part->color_vec_max;
- break;
- case PART_DRAW_COL_ACC:
- intensity = len_v3v3(pa->state.vel, pa->prev_state.vel) / ((pa->state.time - pa->prev_state.time) * part->color_vec_max);
- break;
- default:
- intensity= 1.0f; /* should never happen */
+ else {
+ for (a = 0, pa = pars; a < totpart + totchild; a++, pa++) {
+ /* setup per particle individual stuff */
+ if (a < totpart) {
+ if (totchild && (part->draw & PART_DRAW_PARENT) == 0) continue;
+ if (pa->flag & PARS_NO_DISP || pa->flag & PARS_UNEXIST) continue;
+
+ pa_time = (cfra - pa->time) / pa->lifetime;
+ pa_birthtime = pa->time;
+ pa_dietime = pa->dietime;
+ pa_size = pa->size;
+ if (part->phystype == PART_PHYS_BOIDS)
+ pa_health = pa->boid->data.health;
+ else
+ pa_health = -1.0;
+
+ r_tilt = 2.0f * (PSYS_FRAND(a + 21) - 0.5f);
+ r_length = PSYS_FRAND(a + 22);
+
+ if (part->draw_col > PART_DRAW_COL_MAT) {
+ switch (part->draw_col) {
+ case PART_DRAW_COL_VEL:
+ intensity = len_v3(pa->state.vel) / part->color_vec_max;
+ break;
+ case PART_DRAW_COL_ACC:
+ intensity = len_v3v3(pa->state.vel, pa->prev_state.vel) / ((pa->state.time - pa->prev_state.time) * part->color_vec_max);
+ break;
+ default:
+ intensity = 1.0f; /* should never happen */
+ }
+ CLAMP(intensity, 0.f, 1.f);
+ weight_to_rgb(ma_col, intensity);
}
- CLAMP(intensity, 0.f, 1.f);
- weight_to_rgb(ma_col, intensity);
}
- }
- else{
- ChildParticle *cpa= &psys->child[a-totpart];
-
- pa_time=psys_get_child_time(psys,cpa,cfra,&pa_birthtime,&pa_dietime);
- pa_size=psys_get_child_size(psys,cpa,cfra,NULL);
-
- pa_health = -1.0;
+ else {
+ ChildParticle *cpa = &psys->child[a - totpart];
- r_tilt = 2.0f*(PSYS_FRAND(a + 21) - 0.5f);
- r_length = PSYS_FRAND(a + 22);
- }
+ pa_time = psys_get_child_time(psys, cpa, cfra, &pa_birthtime, &pa_dietime);
+ pa_size = psys_get_child_size(psys, cpa, cfra, NULL);
- drawn = 0;
- if (part->draw_as == PART_DRAW_REND && part->trail_count > 1) {
- float length = part->path_end * (1.0f - part->randlength * r_length);
- int trail_count = part->trail_count * (1.0f - part->randlength * r_length);
- float ct = ((part->draw & PART_ABS_PATH_TIME) ? cfra : pa_time) - length;
- float dt = length / (trail_count ? (float)trail_count : 1.0f);
- int i=0;
+ pa_health = -1.0;
- ct+=dt;
- for (i=0; i < trail_count; i++, ct += dt) {
- float pixsize;
+ r_tilt = 2.0f * (PSYS_FRAND(a + 21) - 0.5f);
+ r_length = PSYS_FRAND(a + 22);
+ }
- if (part->draw & PART_ABS_PATH_TIME) {
- if (ct < pa_birthtime || ct > pa_dietime)
+ drawn = 0;
+ if (part->draw_as == PART_DRAW_REND && part->trail_count > 1) {
+ float length = part->path_end * (1.0f - part->randlength * r_length);
+ int trail_count = part->trail_count * (1.0f - part->randlength * r_length);
+ float ct = ((part->draw & PART_ABS_PATH_TIME) ? cfra : pa_time) - length;
+ float dt = length / (trail_count ? (float)trail_count : 1.0f);
+ int i = 0;
+
+ ct += dt;
+ for (i = 0; i < trail_count; i++, ct += dt) {
+ float pixsize;
+
+ if (part->draw & PART_ABS_PATH_TIME) {
+ if (ct < pa_birthtime || ct > pa_dietime)
+ continue;
+ }
+ else if (ct < 0.0f || ct > 1.0f)
continue;
- }
- else if (ct < 0.0f || ct > 1.0f)
- continue;
- state.time = (part->draw & PART_ABS_PATH_TIME) ? -ct : -(pa_birthtime + ct * (pa_dietime - pa_birthtime));
- psys_get_particle_on_path(&sim,a,&state,need_v);
-
- if (psys->parent)
- mul_m4_v3(psys->parent->obmat, state.co);
-
- /* create actiual particle data */
- if (draw_as == PART_DRAW_BB) {
- bb.offset[0] = part->bb_offset[0];
- bb.offset[1] = part->bb_offset[1];
- bb.size[0] = part->bb_size[0] * pa_size;
- if (part->bb_align==PART_BB_VEL) {
- float pa_vel = len_v3(state.vel);
- float head = part->bb_vel_head*pa_vel;
- float tail = part->bb_vel_tail*pa_vel;
- bb.size[1] = part->bb_size[1]*pa_size + head + tail;
- /* use offset to adjust the particle center. this is relative to size, so need to divide! */
- if (bb.size[1] > 0.0f)
- bb.offset[1] += (head-tail) / bb.size[1];
+ state.time = (part->draw & PART_ABS_PATH_TIME) ? -ct : -(pa_birthtime + ct * (pa_dietime - pa_birthtime));
+ psys_get_particle_on_path(&sim, a, &state, need_v);
+
+ if (psys->parent)
+ mul_m4_v3(psys->parent->obmat, state.co);
+
+ /* create actiual particle data */
+ if (draw_as == PART_DRAW_BB) {
+ bb.offset[0] = part->bb_offset[0];
+ bb.offset[1] = part->bb_offset[1];
+ bb.size[0] = part->bb_size[0] * pa_size;
+ if (part->bb_align == PART_BB_VEL) {
+ float pa_vel = len_v3(state.vel);
+ float head = part->bb_vel_head * pa_vel;
+ float tail = part->bb_vel_tail * pa_vel;
+ bb.size[1] = part->bb_size[1] * pa_size + head + tail;
+ /* use offset to adjust the particle center. this is relative to size, so need to divide! */
+ if (bb.size[1] > 0.0f)
+ bb.offset[1] += (head - tail) / bb.size[1];
+ }
+ else
+ bb.size[1] = part->bb_size[1] * pa_size;
+ bb.tilt = part->bb_tilt * (1.0f - part->bb_rand_tilt * r_tilt);
+ bb.time = ct;
}
- else
- bb.size[1] = part->bb_size[1] * pa_size;
- bb.tilt = part->bb_tilt * (1.0f - part->bb_rand_tilt * r_tilt);
- bb.time = ct;
- }
- pixsize = ED_view3d_pixel_size(rv3d, state.co) * pixsize_scale;
+ pixsize = ED_view3d_pixel_size(rv3d, state.co) * pixsize_scale;
- draw_particle(&state, draw_as, part->draw, pixsize, imat, part->draw_line, &bb, psys->pdd);
+ draw_particle(&state, draw_as, part->draw, pixsize, imat, part->draw_line, &bb, psys->pdd);
- totpoint++;
- drawn = 1;
+ totpoint++;
+ drawn = 1;
+ }
}
- }
- else
- {
- state.time=cfra;
- if (psys_get_particle_state(&sim,a,&state,0)) {
- float pixsize;
-
- if (psys->parent)
- mul_m4_v3(psys->parent->obmat, state.co);
-
- /* create actiual particle data */
- if (draw_as == PART_DRAW_BB) {
- bb.offset[0] = part->bb_offset[0];
- bb.offset[1] = part->bb_offset[1];
- bb.size[0] = part->bb_size[0] * pa_size;
- if (part->bb_align==PART_BB_VEL) {
- float pa_vel = len_v3(state.vel);
- float head = part->bb_vel_head*pa_vel;
- float tail = part->bb_vel_tail*pa_vel;
- bb.size[1] = part->bb_size[1]*pa_size + head + tail;
- /* use offset to adjust the particle center. this is relative to size, so need to divide! */
- if (bb.size[1] > 0.0f)
- bb.offset[1] += (head-tail) / bb.size[1];
+ else {
+ state.time = cfra;
+ if (psys_get_particle_state(&sim, a, &state, 0)) {
+ float pixsize;
+
+ if (psys->parent)
+ mul_m4_v3(psys->parent->obmat, state.co);
+
+ /* create actiual particle data */
+ if (draw_as == PART_DRAW_BB) {
+ bb.offset[0] = part->bb_offset[0];
+ bb.offset[1] = part->bb_offset[1];
+ bb.size[0] = part->bb_size[0] * pa_size;
+ if (part->bb_align == PART_BB_VEL) {
+ float pa_vel = len_v3(state.vel);
+ float head = part->bb_vel_head * pa_vel;
+ float tail = part->bb_vel_tail * pa_vel;
+ bb.size[1] = part->bb_size[1] * pa_size + head + tail;
+ /* use offset to adjust the particle center. this is relative to size, so need to divide! */
+ if (bb.size[1] > 0.0f)
+ bb.offset[1] += (head - tail) / bb.size[1];
+ }
+ else
+ bb.size[1] = part->bb_size[1] * pa_size;
+ bb.tilt = part->bb_tilt * (1.0f - part->bb_rand_tilt * r_tilt);
+ bb.time = pa_time;
}
- else
- bb.size[1] = part->bb_size[1] * pa_size;
- bb.tilt = part->bb_tilt * (1.0f - part->bb_rand_tilt * r_tilt);
- bb.time = pa_time;
- }
- pixsize = ED_view3d_pixel_size(rv3d, state.co) * pixsize_scale;
+ pixsize = ED_view3d_pixel_size(rv3d, state.co) * pixsize_scale;
- draw_particle(&state, draw_as, part->draw, pixsize, imat, part->draw_line, &bb, pdd);
+ draw_particle(&state, draw_as, part->draw, pixsize, imat, part->draw_line, &bb, pdd);
- totpoint++;
- drawn = 1;
+ totpoint++;
+ drawn = 1;
+ }
}
- }
-
- if (drawn) {
- /* additional things to draw for each particle */
- /* (velocity, size and number) */
- if ((part->draw & PART_DRAW_VEL) && pdd && pdd->vedata) {
- copy_v3_v3(pdd->ved,state.co);
- pdd->ved += 3;
- mul_v3_v3fl(vel, state.vel, timestep);
- add_v3_v3v3(pdd->ved, state.co, vel);
- pdd->ved+=3;
- totve++;
- }
+ if (drawn) {
+ /* additional things to draw for each particle */
+ /* (velocity, size and number) */
+ if ((part->draw & PART_DRAW_VEL) && pdd && pdd->vedata) {
+ copy_v3_v3(pdd->ved, state.co);
+ pdd->ved += 3;
+ mul_v3_v3fl(vel, state.vel, timestep);
+ add_v3_v3v3(pdd->ved, state.co, vel);
+ pdd->ved += 3;
+
+ totve++;
+ }
- if (part->draw & PART_DRAW_SIZE) {
- setlinestyle(3);
- drawcircball(GL_LINE_LOOP, state.co, pa_size, imat);
- setlinestyle(0);
- }
+ if (part->draw & PART_DRAW_SIZE) {
+ setlinestyle(3);
+ drawcircball(GL_LINE_LOOP, state.co, pa_size, imat);
+ setlinestyle(0);
+ }
- if ((part->draw & PART_DRAW_NUM || part->draw & PART_DRAW_HEALTH) &&
- (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0)
- {
- float vec_txt[3];
- char *val_pos= numstr;
- numstr[0]= '\0';
+ if ((part->draw & PART_DRAW_NUM || part->draw & PART_DRAW_HEALTH) &&
+ (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0)
+ {
+ float vec_txt[3];
+ char *val_pos = numstr;
+ numstr[0] = '\0';
- if (part->draw&PART_DRAW_NUM) {
- if (a < totpart && (part->draw & PART_DRAW_HEALTH) && (part->phystype==PART_PHYS_BOIDS)) {
- sprintf(val_pos, "%d:%.2f", a, pa_health);
+ if (part->draw & PART_DRAW_NUM) {
+ if (a < totpart && (part->draw & PART_DRAW_HEALTH) && (part->phystype == PART_PHYS_BOIDS)) {
+ sprintf(val_pos, "%d:%.2f", a, pa_health);
+ }
+ else {
+ sprintf(val_pos, "%d", a);
+ }
}
else {
- sprintf(val_pos, "%d", a);
- }
- }
- else {
- if (a < totpart && (part->draw & PART_DRAW_HEALTH) && (part->phystype==PART_PHYS_BOIDS)) {
- sprintf(val_pos, "%.2f", pa_health);
+ if (a < totpart && (part->draw & PART_DRAW_HEALTH) && (part->phystype == PART_PHYS_BOIDS)) {
+ sprintf(val_pos, "%.2f", pa_health);
+ }
}
- }
- /* in path drawing state.co is the end point */
- /* use worldspace beause object matrix is already applied */
- mul_v3_m4v3(vec_txt, ob->imat, state.co);
- view3d_cached_text_draw_add(vec_txt, numstr, 10, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, tcol);
+ /* in path drawing state.co is the end point */
+ /* use worldspace beause object matrix is already applied */
+ mul_v3_m4v3(vec_txt, ob->imat, state.co);
+ view3d_cached_text_draw_add(vec_txt, numstr, 10, V3D_CACHE_TEXT_WORLDSPACE | V3D_CACHE_TEXT_ASCII, tcol);
+ }
}
}
}
@@ -4582,9 +4608,9 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
glGetIntegerv(GL_POLYGON_MODE, polygonmode);
glEnableClientState(GL_VERTEX_ARRAY);
- if (draw_as==PART_DRAW_PATH) {
+ if (draw_as == PART_DRAW_PATH) {
ParticleCacheKey **cache, *path;
- float /* *cd2=NULL, */ /* UNUSED */ *cdata2=NULL;
+ float /* *cd2=NULL, */ /* UNUSED */ *cdata2 = NULL;
/* setup gl flags */
if (1) { //ob_dt > OB_WIRE) {
@@ -4597,23 +4623,25 @@ 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;
- else if (psys->pathcache==NULL)
- totpart=0;
+ if (totchild && (part->draw & PART_DRAW_PARENT) == 0)
+ totpart = 0;
+ else if (psys->pathcache == NULL)
+ totpart = 0;
/* draw actual/parent particles */
- cache=psys->pathcache;
- for (a=0, pa=psys->particles; a<totpart; a++, pa++) {
- path=cache[a];
+ cache = psys->pathcache;
+ for (a = 0, pa = psys->particles; a < totpart; a++, pa++) {
+ path = cache[a];
if (path->steps > 0) {
glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->co);
@@ -4628,9 +4656,9 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
}
/* draw child particles */
- cache=psys->childcache;
- for (a=0; a<totchild; a++) {
- path=cache[a];
+ cache = psys->childcache;
+ for (a = 0; a < totchild; a++) {
+ path = cache[a];
glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->co);
if (1) { //ob_dt > OB_WIRE) {
@@ -4652,23 +4680,23 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
if (cdata2)
MEM_freeN(cdata2);
- /* cd2= */ /* UNUSED */ cdata2=NULL;
+ /* cd2= */ /* UNUSED */ cdata2 = NULL;
glLineWidth(1.0f);
- if ((part->draw & PART_DRAW_NUM) && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
- cache=psys->pathcache;
+ if ((part->draw & PART_DRAW_NUM) && (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
+ cache = psys->pathcache;
- for (a=0, pa=psys->particles; a<totpart; a++, pa++) {
+ for (a = 0, pa = psys->particles; a < totpart; a++, pa++) {
float vec_txt[3];
BLI_snprintf(numstr, sizeof(numstr), "%i", a);
/* use worldspace beause object matrix is already applied */
mul_v3_m4v3(vec_txt, ob->imat, cache[a]->co);
- view3d_cached_text_draw_add(vec_txt, numstr, 10, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, tcol);
+ view3d_cached_text_draw_add(vec_txt, numstr, 10, V3D_CACHE_TEXT_WORLDSPACE | V3D_CACHE_TEXT_ASCII, tcol);
}
}
}
- else if (pdd && ELEM(draw_as, 0, PART_DRAW_CIRC)==0) {
+ else if (pdd && ELEM(draw_as, 0, PART_DRAW_CIRC) == 0) {
glDisableClientState(GL_COLOR_ARRAY);
/* enable point data array */
@@ -4700,12 +4728,12 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
/* enable other data arrays */
/* billboards are drawn this way */
- if (pdd->ndata && ob_dt>OB_WIRE) {
+ if (pdd->ndata && ob_dt > OB_WIRE) {
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(GL_FLOAT, 0, pdd->ndata);
glEnable(GL_LIGHTING);
}
- else{
+ else {
glDisableClientState(GL_NORMAL_ARRAY);
glDisable(GL_LIGHTING);
}
@@ -4727,7 +4755,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
glVertexPointer(3, GL_FLOAT, 0, pdd->vedata);
- glDrawArrays(GL_LINES, 0, 2*totve);
+ glDrawArrays(GL_LINES, 0, 2 * totve);
}
glPolygonMode(GL_FRONT, polygonmode[0]);
@@ -4753,12 +4781,12 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
if (psys->lattice) {
end_latt_deform(psys->lattice);
- psys->lattice= NULL;
+ psys->lattice = NULL;
}
if (pdd) {
/* drop references to stack memory */
- pdd->ma_col= NULL;
+ pdd->ma_col = NULL;
}
if ( (base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP) ) {
@@ -4783,7 +4811,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit)
PTCacheEditKey *key;
ParticleEditSettings *pset = PE_settings(scene);
int i, k, totpoint = edit->totpoint, timed = pset->flag & PE_FADE_TIME ? pset->fade_frames : 0;
- int steps=1;
+ int steps = 1;
float sel_col[3];
float nosel_col[3];
float *pathcol = NULL, *pcol;
@@ -4794,7 +4822,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit)
PE_hide_keys_time(scene, edit, CFRA);
/* opengl setup */
- if ((v3d->flag & V3D_ZBUF_SELECT)==0)
+ if ((v3d->flag & V3D_ZBUF_SELECT) == 0)
glDisable(GL_DEPTH_TEST);
/* get selection theme colors */
@@ -4805,7 +4833,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit)
if (timed) {
glEnable(GL_BLEND);
steps = (*edit->pathcache)->steps + 1;
- pathcol = MEM_callocN(steps*4*sizeof(float), "particle path color data");
+ pathcol = MEM_callocN(steps * 4 * sizeof(float), "particle path color data");
}
glEnableClientState(GL_VERTEX_ARRAY);
@@ -4820,18 +4848,18 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit)
glDisable(GL_LIGHTING);
}
- cache=edit->pathcache;
- for (i=0; i<totpoint; i++) {
+ cache = edit->pathcache;
+ for (i = 0; i < totpoint; i++) {
path = cache[i];
glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->co);
if (timed) {
- for (k=0, pcol=pathcol, pkey=path; k<steps; k++, pkey++, pcol+=4) {
+ for (k = 0, pcol = pathcol, pkey = path; k < steps; k++, pkey++, pcol += 4) {
copy_v3_v3(pcol, pkey->col);
- pcol[3] = 1.0f - fabsf((float)(CFRA) - pkey->time)/(float)pset->fade_frames;
+ pcol[3] = 1.0f - fabsf((float)(CFRA) -pkey->time) / (float)pset->fade_frames;
}
- glColorPointer(4, GL_FLOAT, 4*sizeof(float), pathcol);
+ glColorPointer(4, GL_FLOAT, 4 * sizeof(float), pathcol);
}
else
glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col);
@@ -4843,69 +4871,69 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit)
/* draw edit vertices */
- if (pset->selectmode!=SCE_SELECT_PATH) {
+ if (pset->selectmode != SCE_SELECT_PATH) {
glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
- if (pset->selectmode==SCE_SELECT_POINT) {
- float *pd=NULL,*pdata=NULL;
- float *cd=NULL,*cdata=NULL;
+ if (pset->selectmode == SCE_SELECT_POINT) {
+ float *pd = NULL, *pdata = NULL;
+ float *cd = NULL, *cdata = NULL;
int totkeys = 0;
- for (i=0, point=edit->points; i<totpoint; i++, point++)
+ for (i = 0, point = edit->points; i < totpoint; i++, point++)
if (!(point->flag & PEP_HIDE))
totkeys += point->totkey;
if (edit->points && !(edit->points->keys->flag & PEK_USE_WCO))
- pd=pdata=MEM_callocN(totkeys*3*sizeof(float), "particle edit point data");
- cd=cdata=MEM_callocN(totkeys*(timed?4:3)*sizeof(float), "particle edit color data");
+ pd = pdata = MEM_callocN(totkeys * 3 * sizeof(float), "particle edit point data");
+ cd = cdata = MEM_callocN(totkeys * (timed ? 4 : 3) * sizeof(float), "particle edit color data");
- for (i=0, point=edit->points; i<totpoint; i++, point++) {
+ for (i = 0, point = edit->points; i < totpoint; i++, point++) {
if (point->flag & PEP_HIDE)
continue;
- for (k=0, key=point->keys; k<point->totkey; k++, key++) {
+ for (k = 0, key = point->keys; k < point->totkey; k++, key++) {
if (pd) {
copy_v3_v3(pd, key->co);
pd += 3;
}
- if (key->flag&PEK_SELECT) {
- copy_v3_v3(cd,sel_col);
+ if (key->flag & PEK_SELECT) {
+ copy_v3_v3(cd, sel_col);
}
- else{
- copy_v3_v3(cd,nosel_col);
+ else {
+ copy_v3_v3(cd, nosel_col);
}
if (timed)
- *(cd+3) = 1.0f - fabsf((float)CFRA - *key->time)/(float)pset->fade_frames;
+ *(cd + 3) = 1.0f - fabsf((float)CFRA - *key->time) / (float)pset->fade_frames;
- cd += (timed?4:3);
+ cd += (timed ? 4 : 3);
}
}
- cd=cdata;
- pd=pdata;
- for (i=0, point=edit->points; i<totpoint; i++, point++) {
- if (point->flag & PEP_HIDE)
+ cd = cdata;
+ pd = pdata;
+ for (i = 0, point = edit->points; i < totpoint; i++, point++) {
+ if (point->flag & PEP_HIDE || point->totkey == 0)
continue;
if (point->keys->flag & PEK_USE_WCO)
glVertexPointer(3, GL_FLOAT, sizeof(PTCacheEditKey), point->keys->world_co);
else
- glVertexPointer(3, GL_FLOAT, 3*sizeof(float), pd);
+ glVertexPointer(3, GL_FLOAT, 3 * sizeof(float), pd);
- glColorPointer((timed?4:3), GL_FLOAT, (timed?4:3)*sizeof(float), cd);
+ glColorPointer((timed ? 4 : 3), GL_FLOAT, (timed ? 4 : 3) * sizeof(float), cd);
glDrawArrays(GL_POINTS, 0, point->totkey);
pd += pd ? 3 * point->totkey : 0;
- cd += (timed?4:3) * point->totkey;
+ cd += (timed ? 4 : 3) * point->totkey;
}
- if (pdata) { MEM_freeN(pdata); pd=pdata=NULL; }
- if (cdata) { MEM_freeN(cdata); cd=cdata=NULL; }
+ if (pdata) { MEM_freeN(pdata); pd = pdata = NULL; }
+ if (cdata) { MEM_freeN(cdata); cd = cdata = NULL; }
}
else if (pset->selectmode == SCE_SELECT_END) {
- for (i=0, point=edit->points; i<totpoint; i++, point++) {
- if ((point->flag & PEP_HIDE)==0) {
+ for (i = 0, point = edit->points; i < totpoint; i++, point++) {
+ if ((point->flag & PEP_HIDE) == 0 && point->totkey) {
key = point->keys + point->totkey - 1;
if (key->flag & PEK_SELECT)
glColor3fv(sel_col);
@@ -4932,13 +4960,13 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit)
glPointSize(1.0);
}
//static void ob_draw_RE_motion(float com[3],float rotscale[3][3],float tw,float th)
-static void ob_draw_RE_motion(float com[3],float rotscale[3][3],float itw,float ith,float drw_size)
+static void ob_draw_RE_motion(float com[3], float rotscale[3][3], float itw, float ith, float drw_size)
{
float tr[3][3];
- float root[3],tip[3];
- float tw,th;
+ float root[3], tip[3];
+ float tw, th;
/* take a copy for not spoiling original */
- copy_m3_m3(tr,rotscale);
+ copy_m3_m3(tr, rotscale);
tw = itw * drw_size;
th = ith * drw_size;
@@ -4946,50 +4974,50 @@ static void ob_draw_RE_motion(float com[3],float rotscale[3][3],float itw,float
glBegin(GL_LINES);
root[1] = root[2] = 0.0f;
root[0] = -drw_size;
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
+ glVertex3fv(root);
tip[1] = tip[2] = 0.0f;
tip[0] = drw_size;
- mul_m3_v3(tr,tip);
+ mul_m3_v3(tr, tip);
add_v3_v3(tip, com);
- glVertex3fv(tip);
+ glVertex3fv(tip);
glEnd();
- root[1] =0.0f; root[2] = tw;
+ root[1] = 0.0f; root[2] = tw;
root[0] = th;
glBegin(GL_LINES);
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
- glVertex3fv(tip);
+ glVertex3fv(root);
+ glVertex3fv(tip);
glEnd();
- root[1] =0.0f; root[2] = -tw;
+ root[1] = 0.0f; root[2] = -tw;
root[0] = th;
glBegin(GL_LINES);
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
- glVertex3fv(tip);
+ glVertex3fv(root);
+ glVertex3fv(tip);
glEnd();
root[1] = tw; root[2] = 0.0f;
root[0] = th;
glBegin(GL_LINES);
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
- glVertex3fv(tip);
+ glVertex3fv(root);
+ glVertex3fv(tip);
glEnd();
- root[1] =-tw; root[2] = 0.0f;
+ root[1] = -tw; root[2] = 0.0f;
root[0] = th;
glBegin(GL_LINES);
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
- glVertex3fv(tip);
+ glVertex3fv(root);
+ glVertex3fv(tip);
glEnd();
glColor4ub(0x00, 0x7F, 0x00, 155);
@@ -4997,100 +5025,100 @@ static void ob_draw_RE_motion(float com[3],float rotscale[3][3],float itw,float
glBegin(GL_LINES);
root[0] = root[2] = 0.0f;
root[1] = -drw_size;
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
+ glVertex3fv(root);
tip[0] = tip[2] = 0.0f;
tip[1] = drw_size;
- mul_m3_v3(tr,tip);
+ mul_m3_v3(tr, tip);
add_v3_v3(tip, com);
- glVertex3fv(tip);
+ glVertex3fv(tip);
glEnd();
- root[0] =0.0f; root[2] = tw;
+ root[0] = 0.0f; root[2] = tw;
root[1] = th;
glBegin(GL_LINES);
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
- glVertex3fv(tip);
+ glVertex3fv(root);
+ glVertex3fv(tip);
glEnd();
root[0] = 0.0f; root[2] = -tw;
root[1] = th;
glBegin(GL_LINES);
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
- glVertex3fv(tip);
+ glVertex3fv(root);
+ glVertex3fv(tip);
glEnd();
root[0] = tw; root[2] = 0.0f;
root[1] = th;
glBegin(GL_LINES);
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
- glVertex3fv(tip);
+ glVertex3fv(root);
+ glVertex3fv(tip);
glEnd();
- root[0] =-tw; root[2] = 0.0f;
+ root[0] = -tw; root[2] = 0.0f;
root[1] = th;
glBegin(GL_LINES);
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
- glVertex3fv(tip);
+ glVertex3fv(root);
+ glVertex3fv(tip);
glEnd();
glColor4ub(0x00, 0x00, 0x7F, 155);
glBegin(GL_LINES);
root[0] = root[1] = 0.0f;
root[2] = -drw_size;
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
+ glVertex3fv(root);
tip[0] = tip[1] = 0.0f;
tip[2] = drw_size;
- mul_m3_v3(tr,tip);
+ mul_m3_v3(tr, tip);
add_v3_v3(tip, com);
- glVertex3fv(tip);
+ glVertex3fv(tip);
glEnd();
- root[0] =0.0f; root[1] = tw;
+ root[0] = 0.0f; root[1] = tw;
root[2] = th;
glBegin(GL_LINES);
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
- glVertex3fv(tip);
+ glVertex3fv(root);
+ glVertex3fv(tip);
glEnd();
- root[0] =0.0f; root[1] = -tw;
+ root[0] = 0.0f; root[1] = -tw;
root[2] = th;
glBegin(GL_LINES);
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
- glVertex3fv(tip);
+ glVertex3fv(root);
+ glVertex3fv(tip);
glEnd();
root[0] = tw; root[1] = 0.0f;
root[2] = th;
glBegin(GL_LINES);
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
- glVertex3fv(tip);
+ glVertex3fv(root);
+ glVertex3fv(tip);
glEnd();
root[0] = -tw; root[1] = 0.0f;
root[2] = th;
glBegin(GL_LINES);
- mul_m3_v3(tr,root);
+ mul_m3_v3(tr, root);
add_v3_v3(root, com);
- glVertex3fv(root);
- glVertex3fv(tip);
+ glVertex3fv(root);
+ glVertex3fv(tip);
glEnd();
}
@@ -5104,47 +5132,47 @@ static void tekenhandlesN(Nurb *nu, short sel, short hide_handles)
if (nu->hide || hide_handles) return;
- glBegin(GL_LINES);
+ glBegin(GL_LINES);
if (nu->type == CU_BEZIER) {
#define TH_HANDLE_COL_TOT ((TH_HANDLE_SEL_FREE - TH_HANDLE_FREE) + 1)
- /* use MIN2 when indexing to ensure newer files dont read outside the array */
+ /* use MIN2 when indexing to ensure newer files don't read outside the array */
unsigned char handle_cols[TH_HANDLE_COL_TOT][3];
- const int basecol= sel ? TH_HANDLE_SEL_FREE : TH_HANDLE_FREE;
+ const int basecol = sel ? TH_HANDLE_SEL_FREE : TH_HANDLE_FREE;
- for (a=0; a < TH_HANDLE_COL_TOT; a++) {
+ for (a = 0; a < TH_HANDLE_COL_TOT; a++) {
UI_GetThemeColor3ubv(basecol + a, handle_cols[a]);
}
- bezt= nu->bezt;
- a= nu->pntsu;
+ bezt = nu->bezt;
+ a = nu->pntsu;
while (a--) {
- if (bezt->hide==0) {
- if ( (bezt->f2 & SELECT)==sel) {
- fp= bezt->vec[0];
+ if (bezt->hide == 0) {
+ if ( (bezt->f2 & SELECT) == sel) {
+ fp = bezt->vec[0];
- glColor3ubv(handle_cols[MIN2(bezt->h1, TH_HANDLE_COL_TOT-1)]);
+ glColor3ubv(handle_cols[MIN2(bezt->h1, TH_HANDLE_COL_TOT - 1)]);
glVertex3fv(fp);
- glVertex3fv(fp+3);
+ glVertex3fv(fp + 3);
- glColor3ubv(handle_cols[MIN2(bezt->h2, TH_HANDLE_COL_TOT-1)]);
- glVertex3fv(fp+3);
- glVertex3fv(fp+6);
+ glColor3ubv(handle_cols[MIN2(bezt->h2, TH_HANDLE_COL_TOT - 1)]);
+ glVertex3fv(fp + 3);
+ glVertex3fv(fp + 6);
}
- else if ( (bezt->f1 & SELECT)==sel) {
- fp= bezt->vec[0];
+ else if ( (bezt->f1 & SELECT) == sel) {
+ fp = bezt->vec[0];
- glColor3ubv(handle_cols[MIN2(bezt->h1, TH_HANDLE_COL_TOT-1)]);
- glVertex3fv(fp);
- glVertex3fv(fp+3);
+ glColor3ubv(handle_cols[MIN2(bezt->h1, TH_HANDLE_COL_TOT - 1)]);
+ glVertex3fv(fp);
+ glVertex3fv(fp + 3);
}
- else if ( (bezt->f3 & SELECT)==sel) {
- fp= bezt->vec[1];
+ else if ( (bezt->f3 & SELECT) == sel) {
+ fp = bezt->vec[1];
- glColor3ubv(handle_cols[MIN2(bezt->h2, TH_HANDLE_COL_TOT-1)]);
- glVertex3fv(fp);
- glVertex3fv(fp+3);
+ glColor3ubv(handle_cols[MIN2(bezt->h2, TH_HANDLE_COL_TOT - 1)]);
+ glVertex3fv(fp);
+ glVertex3fv(fp + 3);
}
}
bezt++;
@@ -5170,24 +5198,24 @@ static void tekenhandlesN_active(Nurb *nu)
glBegin(GL_LINES);
if (nu->type == CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
+ bezt = nu->bezt;
+ a = nu->pntsu;
while (a--) {
- if (bezt->hide==0) {
- fp= bezt->vec[0];
+ if (bezt->hide == 0) {
+ fp = bezt->vec[0];
glVertex3fv(fp);
- glVertex3fv(fp+3);
+ glVertex3fv(fp + 3);
- glVertex3fv(fp+3);
- glVertex3fv(fp+6);
+ glVertex3fv(fp + 3);
+ glVertex3fv(fp + 6);
}
bezt++;
}
}
glEnd();
- glColor3ub(0,0,0);
+ glColor3ub(0, 0, 0);
glLineWidth(1);
}
@@ -5200,22 +5228,22 @@ static void tekenvertsN(Nurb *nu, short sel, short hide_handles, void *lastsel)
if (nu->hide) return;
- if (sel) color= TH_VERTEX_SELECT;
- else color= TH_VERTEX;
+ if (sel) color = TH_VERTEX_SELECT;
+ else color = TH_VERTEX;
UI_ThemeColor(color);
- size= UI_GetThemeValuef(TH_VERTEX_SIZE);
+ size = UI_GetThemeValuef(TH_VERTEX_SIZE);
glPointSize(size);
bglBegin(GL_POINTS);
if (nu->type == CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
+ bezt = nu->bezt;
+ a = nu->pntsu;
while (a--) {
- if (bezt->hide==0) {
+ if (bezt->hide == 0) {
if (sel == 1 && bezt == lastsel) {
UI_ThemeColor(TH_LASTSEL_POINT);
bglVertex3fv(bezt->vec[1]);
@@ -5228,29 +5256,29 @@ static void tekenvertsN(Nurb *nu, short sel, short hide_handles, void *lastsel)
UI_ThemeColor(color);
}
else if (hide_handles) {
- if ((bezt->f2 & SELECT)==sel) bglVertex3fv(bezt->vec[1]);
+ if ((bezt->f2 & SELECT) == sel) bglVertex3fv(bezt->vec[1]);
}
else {
- if ((bezt->f1 & SELECT)==sel) bglVertex3fv(bezt->vec[0]);
- if ((bezt->f2 & SELECT)==sel) bglVertex3fv(bezt->vec[1]);
- if ((bezt->f3 & SELECT)==sel) bglVertex3fv(bezt->vec[2]);
+ if ((bezt->f1 & SELECT) == sel) bglVertex3fv(bezt->vec[0]);
+ if ((bezt->f2 & SELECT) == sel) bglVertex3fv(bezt->vec[1]);
+ if ((bezt->f3 & SELECT) == sel) bglVertex3fv(bezt->vec[2]);
}
}
bezt++;
}
}
else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
+ bp = nu->bp;
+ a = nu->pntsu * nu->pntsv;
while (a--) {
- if (bp->hide==0) {
+ if (bp->hide == 0) {
if (bp == lastsel) {
UI_ThemeColor(TH_LASTSEL_POINT);
bglVertex3fv(bp->vec);
UI_ThemeColor(color);
}
else {
- if ((bp->f1 & SELECT)==sel) bglVertex3fv(bp->vec);
+ if ((bp->f1 & SELECT) == sel) bglVertex3fv(bp->vec);
}
}
bp++;
@@ -5269,19 +5297,19 @@ static void editnurb_draw_active_poly(Nurb *nu)
UI_ThemeColor(TH_ACTIVE_SPLINE);
glLineWidth(2);
- bp= nu->bp;
- for (b=0; b<nu->pntsv; b++) {
+ bp = nu->bp;
+ for (b = 0; b < nu->pntsv; b++) {
if (nu->flagu & 1) glBegin(GL_LINE_LOOP);
else glBegin(GL_LINE_STRIP);
- for (a=0; a<nu->pntsu; a++, bp++) {
+ for (a = 0; a < nu->pntsu; a++, bp++) {
glVertex3fv(bp->vec);
}
glEnd();
}
- glColor3ub(0,0,0);
+ glColor3ub(0, 0, 0);
glLineWidth(1);
}
@@ -5294,39 +5322,39 @@ static void editnurb_draw_active_nurbs(Nurb *nu)
glLineWidth(2);
glBegin(GL_LINES);
- bp= nu->bp;
- for (b=0; b<nu->pntsv; b++) {
- bp1= bp;
+ bp = nu->bp;
+ for (b = 0; b < nu->pntsv; b++) {
+ bp1 = bp;
bp++;
- for (a=nu->pntsu-1; a>0; a--, bp++) {
- if (bp->hide==0 && bp1->hide==0) {
+ for (a = nu->pntsu - 1; a > 0; a--, bp++) {
+ if (bp->hide == 0 && bp1->hide == 0) {
glVertex3fv(bp->vec);
glVertex3fv(bp1->vec);
}
- bp1= bp;
+ bp1 = bp;
}
}
- if (nu->pntsv > 1) { /* surface */
+ if (nu->pntsv > 1) { /* surface */
- ofs= nu->pntsu;
- for (b=0; b<nu->pntsu; b++) {
- bp1= nu->bp+b;
- bp= bp1+ofs;
- for (a=nu->pntsv-1; a>0; a--, bp+=ofs) {
- if (bp->hide==0 && bp1->hide==0) {
+ ofs = nu->pntsu;
+ for (b = 0; b < nu->pntsu; b++) {
+ bp1 = nu->bp + b;
+ bp = bp1 + ofs;
+ for (a = nu->pntsv - 1; a > 0; a--, bp += ofs) {
+ if (bp->hide == 0 && bp1->hide == 0) {
glVertex3fv(bp->vec);
glVertex3fv(bp1->vec);
}
- bp1= bp;
+ bp1 = bp;
}
}
}
glEnd();
- glColor3ub(0,0,0);
+ glColor3ub(0, 0, 0);
glLineWidth(1);
}
@@ -5335,117 +5363,121 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel)
Nurb *nu;
BPoint *bp, *bp1;
int a, b, ofs, index;
- Curve *cu= (Curve*)ob->data;
+ Curve *cu = (Curve *)ob->data;
- index= 0;
- nu= nurb;
+ index = 0;
+ nu = nurb;
while (nu) {
- if (nu->hide==0) {
- switch(nu->type) {
- case CU_POLY:
- if (!sel && index== cu->actnu) {
- /* we should draw active spline highlight below everything */
- editnurb_draw_active_poly(nu);
- }
-
- UI_ThemeColor(TH_NURB_ULINE);
- bp= nu->bp;
- for (b=0; b<nu->pntsv; b++) {
- if (nu->flagu & 1) glBegin(GL_LINE_LOOP);
- else glBegin(GL_LINE_STRIP);
-
- for (a=0; a<nu->pntsu; a++, bp++) {
- glVertex3fv(bp->vec);
+ if (nu->hide == 0) {
+ switch (nu->type) {
+ case CU_POLY:
+ if (!sel && index == cu->actnu) {
+ /* we should draw active spline highlight below everything */
+ editnurb_draw_active_poly(nu);
}
- glEnd();
- }
- break;
- case CU_NURBS:
- if (!sel && index== cu->actnu) {
- /* we should draw active spline highlight below everything */
- editnurb_draw_active_nurbs(nu);
- }
+ UI_ThemeColor(TH_NURB_ULINE);
+ bp = nu->bp;
+ for (b = 0; b < nu->pntsv; b++) {
+ if (nu->flagu & 1) glBegin(GL_LINE_LOOP);
+ else glBegin(GL_LINE_STRIP);
- bp= nu->bp;
- for (b=0; b<nu->pntsv; b++) {
- bp1= bp;
- bp++;
- for (a=nu->pntsu-1; a>0; a--, bp++) {
- if (bp->hide==0 && bp1->hide==0) {
- if (sel) {
- if ( (bp->f1 & SELECT) && ( bp1->f1 & SELECT ) ) {
- UI_ThemeColor(TH_NURB_SEL_ULINE);
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(bp->vec);
- glVertex3fv(bp1->vec);
- glEnd();
- }
- }
- else {
- if ( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) );
- else {
- UI_ThemeColor(TH_NURB_ULINE);
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(bp->vec);
- glVertex3fv(bp1->vec);
- glEnd();
- }
- }
+ for (a = 0; a < nu->pntsu; a++, bp++) {
+ glVertex3fv(bp->vec);
}
- bp1= bp;
+
+ glEnd();
}
- }
- if (nu->pntsv > 1) { /* surface */
-
- ofs= nu->pntsu;
- for (b=0; b<nu->pntsu; b++) {
- bp1= nu->bp+b;
- bp= bp1+ofs;
- for (a=nu->pntsv-1; a>0; a--, bp+=ofs) {
- if (bp->hide==0 && bp1->hide==0) {
+ break;
+ case CU_NURBS:
+ if (!sel && index == cu->actnu) {
+ /* we should draw active spline highlight below everything */
+ editnurb_draw_active_nurbs(nu);
+ }
+
+ bp = nu->bp;
+ for (b = 0; b < nu->pntsv; b++) {
+ bp1 = bp;
+ bp++;
+ for (a = nu->pntsu - 1; a > 0; a--, bp++) {
+ if (bp->hide == 0 && bp1->hide == 0) {
if (sel) {
- if ( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) ) {
- UI_ThemeColor(TH_NURB_SEL_VLINE);
-
+ if ( (bp->f1 & SELECT) && (bp1->f1 & SELECT) ) {
+ UI_ThemeColor(TH_NURB_SEL_ULINE);
+
glBegin(GL_LINE_STRIP);
- glVertex3fv(bp->vec);
+ glVertex3fv(bp->vec);
glVertex3fv(bp1->vec);
glEnd();
}
}
else {
- if ( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) );
+ if ((bp->f1 & SELECT) && (bp1->f1 & SELECT)) {
+ /* pass */
+ }
else {
- UI_ThemeColor(TH_NURB_VLINE);
-
+ UI_ThemeColor(TH_NURB_ULINE);
+
glBegin(GL_LINE_STRIP);
- glVertex3fv(bp->vec);
+ glVertex3fv(bp->vec);
glVertex3fv(bp1->vec);
glEnd();
}
}
}
- bp1= bp;
+ bp1 = bp;
}
}
+ if (nu->pntsv > 1) { /* surface */
+
+ ofs = nu->pntsu;
+ for (b = 0; b < nu->pntsu; b++) {
+ bp1 = nu->bp + b;
+ bp = bp1 + ofs;
+ for (a = nu->pntsv - 1; a > 0; a--, bp += ofs) {
+ if (bp->hide == 0 && bp1->hide == 0) {
+ if (sel) {
+ if ( (bp->f1 & SELECT) && (bp1->f1 & SELECT) ) {
+ UI_ThemeColor(TH_NURB_SEL_VLINE);
+
+ glBegin(GL_LINE_STRIP);
+ glVertex3fv(bp->vec);
+ glVertex3fv(bp1->vec);
+ glEnd();
+ }
+ }
+ else {
+ if ((bp->f1 & SELECT) && (bp1->f1 & SELECT)) {
+ /* pass */
+ }
+ else {
+ UI_ThemeColor(TH_NURB_VLINE);
+
+ glBegin(GL_LINE_STRIP);
+ glVertex3fv(bp->vec);
+ glVertex3fv(bp1->vec);
+ glEnd();
+ }
+ }
+ }
+ bp1 = bp;
+ }
+ }
- }
- break;
+ }
+ break;
}
}
++index;
- nu= nu->next;
+ nu = nu->next;
}
}
static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, Nurb *nurb, int dt)
{
- ToolSettings *ts= scene->toolsettings;
- Object *ob= base->object;
+ ToolSettings *ts = scene->toolsettings;
+ Object *ob = base->object;
Curve *cu = ob->data;
Nurb *nu;
BevList *bl;
@@ -5459,8 +5491,8 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
/* first non-selected and active handles */
- index= 0;
- for (nu=nurb; nu; nu=nu->next) {
+ index = 0;
+ for (nu = nurb; nu; nu = nu->next) {
if (nu->type == CU_BEZIER) {
if (index == cu->actnu && !hide_handles)
tekenhandlesN_active(nu);
@@ -5471,36 +5503,36 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
draw_editnurb(ob, nurb, 0);
draw_editnurb(ob, nurb, 1);
/* selected handles */
- for (nu=nurb; nu; nu=nu->next) {
- if (nu->type == CU_BEZIER && (cu->drawflag & CU_HIDE_HANDLES)==0)
+ for (nu = nurb; nu; nu = nu->next) {
+ if (nu->type == CU_BEZIER && (cu->drawflag & CU_HIDE_HANDLES) == 0)
tekenhandlesN(nu, 1, hide_handles);
tekenvertsN(nu, 0, hide_handles, NULL);
}
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
- /* 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) {
+ /* direction vectors for 3d curve paths
+ * when at its lowest, don't render normals */
+ if ((cu->flag & CU_3D) && (ts->normalsize > 0.0015f) && (cu->drawflag & CU_HIDE_NORMALS) == 0) {
UI_ThemeColor(TH_WIRE);
- for (bl=cu->bev.first,nu=nurb; nu && bl; bl=bl->next,nu=nu->next) {
- BevPoint *bevp= (BevPoint *)(bl+1);
- int nr= bl->nr;
- int skip= nu->resolu/16;
+ for (bl = cu->bev.first, nu = nurb; nu && bl; bl = bl->next, nu = nu->next) {
+ BevPoint *bevp = (BevPoint *)(bl + 1);
+ int nr = bl->nr;
+ int skip = nu->resolu / 16;
- while (nr-->0) { /* accounts for empty bevel lists */
- const float fac= bevp->radius * ts->normalsize;
+ while (nr-- > 0) { /* accounts for empty bevel lists */
+ const float fac = bevp->radius * ts->normalsize;
float vec_a[3]; // Offset perpendicular to the curve
float vec_b[3]; // Delta along the curve
- vec_a[0]= fac;
- vec_a[1]= 0.0f;
- vec_a[2]= 0.0f;
+ vec_a[0] = fac;
+ vec_a[1] = 0.0f;
+ vec_a[2] = 0.0f;
- vec_b[0]= -fac;
- vec_b[1]= 0.0f;
- vec_b[2]= 0.0f;
+ vec_b[0] = -fac;
+ vec_b[1] = 0.0f;
+ vec_b[2] = 0.0f;
mul_qt_v3(bevp->quat, vec_a);
mul_qt_v3(bevp->quat, vec_b);
@@ -5516,7 +5548,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
glVertex3fv(vec_b);
glEnd();
- bevp += skip+1;
+ bevp += skip + 1;
nr -= skip;
}
}
@@ -5524,7 +5556,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
- for (nu=nurb; nu; nu=nu->next) {
+ for (nu = nurb; nu; nu = nu->next) {
tekenvertsN(nu, 1, hide_handles, cu->lastsel);
}
@@ -5532,20 +5564,20 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
}
/* draw a sphere for use as an empty drawtype */
-static void draw_empty_sphere (float size)
+static void draw_empty_sphere(float size)
{
- static GLuint displist=0;
+ static GLuint displist = 0;
if (displist == 0) {
- GLUquadricObj *qobj;
+ GLUquadricObj *qobj;
- displist= glGenLists(1);
+ displist = glGenLists(1);
glNewList(displist, GL_COMPILE);
glPushMatrix();
- qobj = gluNewQuadric();
- gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
+ qobj = gluNewQuadric();
+ gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
gluDisk(qobj, 0.0, 1, 16, 1);
glRotatef(90, 0, 1, 0);
@@ -5554,7 +5586,7 @@ static void draw_empty_sphere (float size)
glRotatef(90, 1, 0, 0);
gluDisk(qobj, 0.0, 1, 16, 1);
- gluDeleteQuadric(qobj);
+ gluDeleteQuadric(qobj);
glPopMatrix();
glEndList();
@@ -5562,54 +5594,54 @@ static void draw_empty_sphere (float size)
glScalef(size, size, size);
glCallList(displist);
- glScalef(1.0f/size, 1.0f/size, 1.0f/size);
+ glScalef(1.0f / size, 1.0f / size, 1.0f / size);
}
/* draw a cone for use as an empty drawtype */
-static void draw_empty_cone (float size)
+static void draw_empty_cone(float size)
{
- float cent=0;
+ float cent = 0;
float radius;
- GLUquadricObj *qobj = gluNewQuadric();
- gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
+ GLUquadricObj *qobj = gluNewQuadric();
+ gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
glPushMatrix();
radius = size;
- glTranslatef(cent,cent, cent);
+ glTranslatef(cent, cent, cent);
glScalef(radius, size * 2.0f, radius);
glRotatef(-90., 1.0, 0.0, 0.0);
gluCylinder(qobj, 1.0, 0.0, 1.0, 8, 1);
glPopMatrix();
- gluDeleteQuadric(qobj);
+ gluDeleteQuadric(qobj);
}
/* draw points on curve speed handles */
#if 0 // XXX old animation system stuff
static void curve_draw_speed(Scene *scene, Object *ob)
{
- Curve *cu= ob->data;
+ Curve *cu = ob->data;
IpoCurve *icu;
BezTriple *bezt;
float loc[4], dir[3];
int a;
- if (cu->ipo==NULL)
+ if (cu->ipo == NULL)
return;
- icu= cu->ipo->curve.first;
- if (icu==NULL || icu->totvert<2)
+ icu = cu->ipo->curve.first;
+ if (icu == NULL || icu->totvert < 2)
return;
- glPointSize( UI_GetThemeValuef(TH_VERTEX_SIZE) );
+ glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE) );
bglBegin(GL_POINTS);
- for (a=0, bezt= icu->bezt; a<icu->totvert; a++, bezt++) {
- if ( where_on_path(ob, bezt->vec[1][1], loc, dir)) {
- UI_ThemeColor((bezt->f2 & SELECT) && ob==OBACT?TH_VERTEX_SELECT:TH_VERTEX);
+ for (a = 0, bezt = icu->bezt; a < icu->totvert; a++, bezt++) {
+ if (where_on_path(ob, bezt->vec[1][1], loc, dir)) {
+ UI_ThemeColor((bezt->f2 & SELECT) && ob == OBACT ? TH_VERTEX_SELECT : TH_VERTEX);
bglVertex3fv(loc);
}
}
@@ -5637,14 +5669,14 @@ static void draw_textcurs(float textcurs[4][2])
static void drawspiral(const float cent[3], float rad, float tmat[][4], int start)
{
float vec[3], vx[3], vy[3];
- const float tot_inv= (1.0f / (float)CIRCLE_RESOL);
+ const float tot_inv = (1.0f / (float)CIRCLE_RESOL);
int a;
- char inverse= FALSE;
+ char inverse = FALSE;
float x, y, fac;
if (start < 0) {
inverse = TRUE;
- start= -start;
+ start = -start;
}
mul_v3_v3fl(vx, tmat[0], rad);
@@ -5652,47 +5684,47 @@ static void drawspiral(const float cent[3], float rad, float tmat[][4], int star
glBegin(GL_LINE_STRIP);
- if (inverse==0) {
+ if (inverse == 0) {
copy_v3_v3(vec, cent);
glVertex3fv(vec);
- for (a=0; a<CIRCLE_RESOL; a++) {
- if (a+start>=CIRCLE_RESOL)
- start=-a + 1;
+ for (a = 0; a < CIRCLE_RESOL; a++) {
+ if (a + start >= CIRCLE_RESOL)
+ start = -a + 1;
- fac= (float)a * tot_inv;
- x= sinval[a+start] * fac;
- y= cosval[a+start] * fac;
+ fac = (float)a * tot_inv;
+ x = sinval[a + start] * fac;
+ y = cosval[a + start] * fac;
- vec[0]= cent[0] + (x * vx[0] + y * vy[0]);
- vec[1]= cent[1] + (x * vx[1] + y * vy[1]);
- vec[2]= cent[2] + (x * vx[2] + y * vy[2]);
+ vec[0] = cent[0] + (x * vx[0] + y * vy[0]);
+ vec[1] = cent[1] + (x * vx[1] + y * vy[1]);
+ vec[2] = cent[2] + (x * vx[2] + y * vy[2]);
glVertex3fv(vec);
}
}
else {
- fac= (float)(CIRCLE_RESOL-1) * tot_inv;
- x= sinval[start] * fac;
- y= cosval[start] * fac;
+ fac = (float)(CIRCLE_RESOL - 1) * tot_inv;
+ x = sinval[start] * fac;
+ y = cosval[start] * fac;
- vec[0]= cent[0] + (x * vx[0] + y * vy[0]);
- vec[1]= cent[1] + (x * vx[1] + y * vy[1]);
- vec[2]= cent[2] + (x * vx[2] + y * vy[2]);
+ vec[0] = cent[0] + (x * vx[0] + y * vy[0]);
+ vec[1] = cent[1] + (x * vx[1] + y * vy[1]);
+ vec[2] = cent[2] + (x * vx[2] + y * vy[2]);
glVertex3fv(vec);
- for (a=0; a<CIRCLE_RESOL; a++) {
- if (a+start>=CIRCLE_RESOL)
- start=-a + 1;
+ for (a = 0; a < CIRCLE_RESOL; a++) {
+ if (a + start >= CIRCLE_RESOL)
+ start = -a + 1;
- fac= (float)(-a+(CIRCLE_RESOL-1)) * tot_inv;
- x= sinval[a+start] * fac;
- y= cosval[a+start] * fac;
+ fac = (float)(-a + (CIRCLE_RESOL - 1)) * tot_inv;
+ x = sinval[a + start] * fac;
+ y = cosval[a + start] * fac;
- vec[0]= cent[0] + (x * vx[0] + y * vy[0]);
- vec[1]= cent[1] + (x * vx[1] + y * vy[1]);
- vec[2]= cent[2] + (x * vx[2] + y * vy[2]);
+ vec[0] = cent[0] + (x * vx[0] + y * vy[0]);
+ vec[1] = cent[1] + (x * vx[1] + y * vy[1]);
+ vec[2] = cent[2] + (x * vx[2] + y * vy[2]);
glVertex3fv(vec);
}
}
@@ -5711,11 +5743,11 @@ static void drawcircle_size(float size)
glBegin(GL_LINE_LOOP);
/* coordinates are: cos(degrees*11.25)=x, sin(degrees*11.25)=y, 0.0f=z */
- for (degrees=0; degrees<CIRCLE_RESOL; degrees++) {
- x= cosval[degrees];
- y= sinval[degrees];
+ for (degrees = 0; degrees < CIRCLE_RESOL; degrees++) {
+ x = cosval[degrees];
+ y = sinval[degrees];
- glVertex3f(x*size, 0.0f, y*size);
+ glVertex3f(x * size, 0.0f, y * size);
}
glEnd();
@@ -5728,20 +5760,20 @@ static void drawtube(const float vec[3], float radius, float height, float tmat[
float cur[3];
drawcircball(GL_LINE_LOOP, vec, radius, tmat);
- copy_v3_v3(cur,vec);
- cur[2]+=height;
+ copy_v3_v3(cur, vec);
+ cur[2] += height;
drawcircball(GL_LINE_LOOP, cur, radius, tmat);
glBegin(GL_LINES);
- glVertex3f(vec[0]+radius,vec[1],vec[2]);
- glVertex3f(cur[0]+radius,cur[1],cur[2]);
- glVertex3f(vec[0]-radius,vec[1],vec[2]);
- glVertex3f(cur[0]-radius,cur[1],cur[2]);
- glVertex3f(vec[0],vec[1]+radius,vec[2]);
- glVertex3f(cur[0],cur[1]+radius,cur[2]);
- glVertex3f(vec[0],vec[1]-radius,vec[2]);
- glVertex3f(cur[0],cur[1]-radius,cur[2]);
+ glVertex3f(vec[0] + radius, vec[1], vec[2]);
+ glVertex3f(cur[0] + radius, cur[1], cur[2]);
+ glVertex3f(vec[0] - radius, vec[1], vec[2]);
+ glVertex3f(cur[0] - radius, cur[1], cur[2]);
+ glVertex3f(vec[0], vec[1] + radius, vec[2]);
+ glVertex3f(cur[0], cur[1] + radius, cur[2]);
+ glVertex3f(vec[0], vec[1] - radius, vec[2]);
+ glVertex3f(cur[0], cur[1] - radius, cur[2]);
glEnd();
}
/* needs fixing if non-identity matrice used */
@@ -5749,51 +5781,51 @@ static void drawcone(const float vec[3], float radius, float height, float tmat[
{
float cur[3];
- copy_v3_v3(cur,vec);
- cur[2]+=height;
+ copy_v3_v3(cur, vec);
+ cur[2] += height;
drawcircball(GL_LINE_LOOP, cur, radius, tmat);
glBegin(GL_LINES);
- glVertex3f(vec[0],vec[1],vec[2]);
- glVertex3f(cur[0]+radius,cur[1],cur[2]);
- glVertex3f(vec[0],vec[1],vec[2]);
- glVertex3f(cur[0]-radius,cur[1],cur[2]);
- glVertex3f(vec[0],vec[1],vec[2]);
- glVertex3f(cur[0],cur[1]+radius,cur[2]);
- glVertex3f(vec[0],vec[1],vec[2]);
- glVertex3f(cur[0],cur[1]-radius,cur[2]);
+ glVertex3f(vec[0], vec[1], vec[2]);
+ glVertex3f(cur[0] + radius, cur[1], cur[2]);
+ glVertex3f(vec[0], vec[1], vec[2]);
+ glVertex3f(cur[0] - radius, cur[1], cur[2]);
+ glVertex3f(vec[0], vec[1], vec[2]);
+ glVertex3f(cur[0], cur[1] + radius, cur[2]);
+ glVertex3f(vec[0], vec[1], vec[2]);
+ glVertex3f(cur[0], cur[1] - radius, cur[2]);
glEnd();
}
/* return 1 if nothing was drawn */
static int drawmball(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int dt)
{
- Object *ob= base->object;
+ Object *ob = base->object;
MetaBall *mb;
MetaElem *ml;
float imat[4][4];
- int code= 1;
+ int code = 1;
- mb= ob->data;
+ mb = ob->data;
if (mb->editelems) {
UI_ThemeColor(TH_WIRE);
- if ((G.f & G_PICKSEL)==0 ) drawDispList(scene, v3d, rv3d, base, dt);
- ml= mb->editelems->first;
+ if ((G.f & G_PICKSEL) == 0) drawDispList(scene, v3d, rv3d, base, dt);
+ ml = mb->editelems->first;
}
else {
- if ((base->flag & OB_FROMDUPLI)==0)
+ if ((base->flag & OB_FROMDUPLI) == 0)
drawDispList(scene, v3d, rv3d, base, dt);
- ml= mb->elems.first;
+ ml = mb->elems.first;
}
- if (ml==NULL) return 1;
+ if (ml == NULL) return 1;
if (v3d->flag2 & V3D_RENDER_OVERRIDE) return 0;
/* in case solid draw, reset wire colors */
if (ob->flag & SELECT) {
- if (ob==OBACT) UI_ThemeColor(TH_ACTIVE);
+ if (ob == OBACT) UI_ThemeColor(TH_ACTIVE);
else UI_ThemeColor(TH_SELECT);
}
else UI_ThemeColor(TH_WIRE);
@@ -5803,14 +5835,14 @@ static int drawmball(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
normalize_v3(imat[1]);
while (ml) {
-
+
/* draw radius */
if (mb->editelems) {
if ((ml->flag & SELECT) && (ml->flag & MB_SCALE_RAD)) cpack(0xA0A0F0);
else cpack(0x3030A0);
if (G.f & G_PICKSEL) {
- ml->selcol1= code;
+ ml->selcol1 = code;
glLoadName(code++);
}
}
@@ -5822,31 +5854,31 @@ static int drawmball(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
else cpack(0x30A030);
if (G.f & G_PICKSEL) {
- ml->selcol2= code;
+ ml->selcol2 = code;
glLoadName(code++);
}
- drawcircball(GL_LINE_LOOP, &(ml->x), ml->rad*atanf(ml->s)/(float)M_PI_2, imat);
+ drawcircball(GL_LINE_LOOP, &(ml->x), ml->rad * atanf(ml->s) / (float)M_PI_2, imat);
}
- ml= ml->next;
+ ml = ml->next;
}
return 0;
}
static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d)
{
- PartDeflect *pd= ob->pd;
+ PartDeflect *pd = ob->pd;
float imat[4][4], tmat[4][4];
- float vec[3]= {0.0, 0.0, 0.0};
+ float vec[3] = {0.0, 0.0, 0.0};
int curcol;
float size;
/* XXX why? */
- if (ob!=scene->obedit && (ob->flag & SELECT)) {
- if (ob==OBACT) curcol= TH_ACTIVE;
- else curcol= TH_SELECT;
+ if (ob != scene->obedit && (ob->flag & SELECT)) {
+ if (ob == OBACT) curcol = TH_ACTIVE;
+ else curcol = TH_SELECT;
}
- else curcol= TH_WIRE;
+ else curcol = TH_EMPTY;
/* scale size of circle etc with the empty drawsize */
if (ob->type == OB_EMPTY) size = ob->empty_drawsize;
@@ -5865,15 +5897,17 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d)
//if (has_ipo_code(ob->ipo, OB_PD_FSTR))
// force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, scene->r.cfra);
- //else
+ //else
+ {
force_val = pd->f_strength;
+ }
force_val *= 0.1f;
drawcircball(GL_LINE_LOOP, vec, size, tmat);
- vec[2]= 0.5f * force_val;
+ vec[2] = 0.5f * force_val;
drawcircball(GL_LINE_LOOP, vec, size, tmat);
- vec[2]= 1.0f * force_val;
+ vec[2] = 1.0f * force_val;
drawcircball(GL_LINE_LOOP, vec, size, tmat);
- vec[2]= 1.5f * force_val;
+ vec[2] = 1.5f * force_val;
drawcircball(GL_LINE_LOOP, vec, size, tmat);
vec[2] = 0.0f; /* reset vec for max dist circle */
@@ -5881,31 +5915,35 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d)
else if (pd->forcefield == PFIELD_FORCE) {
float ffall_val;
- //if (has_ipo_code(ob->ipo, OB_PD_FFALL))
+ //if (has_ipo_code(ob->ipo, OB_PD_FFALL))
// ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, scene->r.cfra);
- //else
+ //else
+ {
ffall_val = pd->f_power;
+ }
UI_ThemeColorBlend(curcol, TH_BACK, 0.5);
drawcircball(GL_LINE_LOOP, vec, size, imat);
UI_ThemeColorBlend(curcol, TH_BACK, 0.9f - 0.4f / powf(1.5f, ffall_val));
drawcircball(GL_LINE_LOOP, vec, size * 1.5f, imat);
UI_ThemeColorBlend(curcol, TH_BACK, 0.9f - 0.4f / powf(2.0f, ffall_val));
- drawcircball(GL_LINE_LOOP, vec, size*2.0f, imat);
+ drawcircball(GL_LINE_LOOP, vec, size * 2.0f, imat);
}
else if (pd->forcefield == PFIELD_VORTEX) {
float /*ffall_val,*/ force_val;
unit_m4(tmat);
- //if (has_ipo_code(ob->ipo, OB_PD_FFALL))
+ //if (has_ipo_code(ob->ipo, OB_PD_FFALL))
// ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, scene->r.cfra);
- //else
+ //else
// ffall_val = pd->f_power;
//if (has_ipo_code(ob->ipo, OB_PD_FSTR))
// force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, scene->r.cfra);
- //else
+ //else
+ {
force_val = pd->f_strength;
+ }
UI_ThemeColorBlend(curcol, TH_BACK, 0.7f);
if (force_val < 0) {
@@ -5917,15 +5955,17 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d)
drawspiral(vec, size, tmat, -16);
}
}
- else if (pd->forcefield == PFIELD_GUIDE && ob->type==OB_CURVE) {
- Curve *cu= ob->data;
+ else if (pd->forcefield == PFIELD_GUIDE && ob->type == OB_CURVE) {
+ Curve *cu = ob->data;
if ((cu->flag & CU_PATH) && cu->path && cu->path->data) {
float mindist, guidevec1[4], guidevec2[3];
//if (has_ipo_code(ob->ipo, OB_PD_FSTR))
// mindist = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, scene->r.cfra);
- //else
+ //else
+ {
mindist = pd->f_strength;
+ }
/*path end*/
setlinestyle(3);
@@ -5939,63 +5979,63 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d)
UI_ThemeColorBlend(curcol, TH_BACK, 0.5);
drawcircball(GL_LINE_LOOP, guidevec1, mindist, imat);
- copy_v3_v3(vec, guidevec1); /* max center */
+ copy_v3_v3(vec, guidevec1); /* max center */
}
}
setlinestyle(3);
UI_ThemeColorBlend(curcol, TH_BACK, 0.5);
- if (pd->falloff==PFIELD_FALL_SPHERE) {
+ if (pd->falloff == PFIELD_FALL_SPHERE) {
/* as last, guide curve alters it */
if (pd->flag & PFIELD_USEMAX)
- drawcircball(GL_LINE_LOOP, vec, pd->maxdist, imat);
+ drawcircball(GL_LINE_LOOP, vec, pd->maxdist, imat);
if (pd->flag & PFIELD_USEMIN)
drawcircball(GL_LINE_LOOP, vec, pd->mindist, imat);
}
- else if (pd->falloff==PFIELD_FALL_TUBE) {
- float radius,distance;
+ else if (pd->falloff == PFIELD_FALL_TUBE) {
+ float radius, distance;
unit_m4(tmat);
- vec[0]=vec[1]=0.0f;
- radius=(pd->flag&PFIELD_USEMAXR)?pd->maxrad:1.0f;
- distance=(pd->flag&PFIELD_USEMAX)?pd->maxdist:0.0f;
- vec[2]=distance;
- distance=(pd->flag&PFIELD_POSZ)?-distance:-2.0f*distance;
+ vec[0] = vec[1] = 0.0f;
+ radius = (pd->flag & PFIELD_USEMAXR) ? pd->maxrad : 1.0f;
+ distance = (pd->flag & PFIELD_USEMAX) ? pd->maxdist : 0.0f;
+ vec[2] = distance;
+ distance = (pd->flag & PFIELD_POSZ) ? -distance : -2.0f * distance;
- if (pd->flag & (PFIELD_USEMAX|PFIELD_USEMAXR))
- drawtube(vec,radius,distance,tmat);
+ if (pd->flag & (PFIELD_USEMAX | PFIELD_USEMAXR))
+ drawtube(vec, radius, distance, tmat);
- radius=(pd->flag&PFIELD_USEMINR)?pd->minrad:1.0f;
- distance=(pd->flag&PFIELD_USEMIN)?pd->mindist:0.0f;
- vec[2]=distance;
- distance=(pd->flag&PFIELD_POSZ)?-distance:-2.0f*distance;
+ radius = (pd->flag & PFIELD_USEMINR) ? pd->minrad : 1.0f;
+ distance = (pd->flag & PFIELD_USEMIN) ? pd->mindist : 0.0f;
+ vec[2] = distance;
+ distance = (pd->flag & PFIELD_POSZ) ? -distance : -2.0f * distance;
- if (pd->flag & (PFIELD_USEMIN|PFIELD_USEMINR))
- drawtube(vec,radius,distance,tmat);
+ if (pd->flag & (PFIELD_USEMIN | PFIELD_USEMINR))
+ drawtube(vec, radius, distance, tmat);
}
- else if (pd->falloff==PFIELD_FALL_CONE) {
- float radius,distance;
+ else if (pd->falloff == PFIELD_FALL_CONE) {
+ float radius, distance;
unit_m4(tmat);
- radius= DEG2RADF((pd->flag&PFIELD_USEMAXR) ? pd->maxrad : 1.0f);
- distance=(pd->flag&PFIELD_USEMAX)?pd->maxdist:0.0f;
+ radius = DEG2RADF((pd->flag & PFIELD_USEMAXR) ? pd->maxrad : 1.0f);
+ distance = (pd->flag & PFIELD_USEMAX) ? pd->maxdist : 0.0f;
- if (pd->flag & (PFIELD_USEMAX|PFIELD_USEMAXR)) {
- drawcone(vec, distance * sinf(radius),distance * cosf(radius), tmat);
- if ((pd->flag & PFIELD_POSZ)==0)
- drawcone(vec, distance * sinf(radius),-distance * cosf(radius),tmat);
+ if (pd->flag & (PFIELD_USEMAX | PFIELD_USEMAXR)) {
+ drawcone(vec, distance * sinf(radius), distance * cosf(radius), tmat);
+ if ((pd->flag & PFIELD_POSZ) == 0)
+ drawcone(vec, distance * sinf(radius), -distance * cosf(radius), tmat);
}
- radius= DEG2RADF((pd->flag&PFIELD_USEMINR) ? pd->minrad : 1.0f);
- distance=(pd->flag&PFIELD_USEMIN)?pd->mindist:0.0f;
+ radius = DEG2RADF((pd->flag & PFIELD_USEMINR) ? pd->minrad : 1.0f);
+ distance = (pd->flag & PFIELD_USEMIN) ? pd->mindist : 0.0f;
- if (pd->flag & (PFIELD_USEMIN|PFIELD_USEMINR)) {
- drawcone(vec,distance*sinf(radius),distance*cosf(radius),tmat);
- if ((pd->flag & PFIELD_POSZ)==0)
+ if (pd->flag & (PFIELD_USEMIN | PFIELD_USEMINR)) {
+ drawcone(vec, distance * sinf(radius), distance * cosf(radius), tmat);
+ if ((pd->flag & PFIELD_POSZ) == 0)
drawcone(vec, distance * sinf(radius), -distance * cosf(radius), tmat);
}
}
@@ -6005,8 +6045,8 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d)
static void draw_box(float vec[8][3])
{
glBegin(GL_LINE_STRIP);
- glVertex3fv(vec[0]); glVertex3fv(vec[1]);glVertex3fv(vec[2]); glVertex3fv(vec[3]);
- glVertex3fv(vec[0]); glVertex3fv(vec[4]);glVertex3fv(vec[5]); glVertex3fv(vec[6]);
+ glVertex3fv(vec[0]); glVertex3fv(vec[1]); glVertex3fv(vec[2]); glVertex3fv(vec[3]);
+ glVertex3fv(vec[0]); glVertex3fv(vec[4]); glVertex3fv(vec[5]); glVertex3fv(vec[6]);
glVertex3fv(vec[7]); glVertex3fv(vec[4]);
glEnd();
@@ -6021,20 +6061,20 @@ static void draw_box(float vec[8][3])
#if 0
static void get_local_bounds(Object *ob, float center[3], float size[3])
{
- BoundBox *bb= object_get_boundbox(ob);
+ BoundBox *bb = object_get_boundbox(ob);
- if (bb==NULL) {
+ if (bb == NULL) {
zero_v3(center);
copy_v3_v3(size, ob->size);
}
else {
- size[0]= 0.5*fabs(bb->vec[0][0] - bb->vec[4][0]);
- size[1]= 0.5*fabs(bb->vec[0][1] - bb->vec[2][1]);
- size[2]= 0.5*fabs(bb->vec[0][2] - bb->vec[1][2]);
-
- center[0]= (bb->vec[0][0] + bb->vec[4][0])/2.0;
- center[1]= (bb->vec[0][1] + bb->vec[2][1])/2.0;
- center[2]= (bb->vec[0][2] + bb->vec[1][2])/2.0;
+ size[0] = 0.5 * fabs(bb->vec[0][0] - bb->vec[4][0]);
+ size[1] = 0.5 * fabs(bb->vec[0][1] - bb->vec[2][1]);
+ size[2] = 0.5 * fabs(bb->vec[0][2] - bb->vec[1][2]);
+
+ center[0] = (bb->vec[0][0] + bb->vec[4][0]) / 2.0;
+ center[1] = (bb->vec[0][1] + bb->vec[2][1]) / 2.0;
+ center[2] = (bb->vec[0][2] + bb->vec[1][2]) / 2.0;
}
}
#endif
@@ -6042,68 +6082,71 @@ static void get_local_bounds(Object *ob, float center[3], float size[3])
static void draw_bb_quadric(BoundBox *bb, char type)
{
float size[3], cent[3];
- GLUquadricObj *qobj = gluNewQuadric();
+ GLUquadricObj *qobj = gluNewQuadric();
- gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
+ gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
- size[0]= 0.5f*fabsf(bb->vec[0][0] - bb->vec[4][0]);
- size[1]= 0.5f*fabsf(bb->vec[0][1] - bb->vec[2][1]);
- size[2]= 0.5f*fabsf(bb->vec[0][2] - bb->vec[1][2]);
-
- cent[0]= 0.5f*(bb->vec[0][0] + bb->vec[4][0]);
- cent[1]= 0.5f*(bb->vec[0][1] + bb->vec[2][1]);
- cent[2]= 0.5f*(bb->vec[0][2] + bb->vec[1][2]);
+ size[0] = 0.5f * fabsf(bb->vec[0][0] - bb->vec[4][0]);
+ size[1] = 0.5f * fabsf(bb->vec[0][1] - bb->vec[2][1]);
+ size[2] = 0.5f * fabsf(bb->vec[0][2] - bb->vec[1][2]);
+
+ cent[0] = 0.5f * (bb->vec[0][0] + bb->vec[4][0]);
+ cent[1] = 0.5f * (bb->vec[0][1] + bb->vec[2][1]);
+ cent[2] = 0.5f * (bb->vec[0][2] + bb->vec[1][2]);
glPushMatrix();
- if (type==OB_BOUND_SPHERE) {
+ if (type == OB_BOUND_SPHERE) {
glTranslatef(cent[0], cent[1], cent[2]);
glScalef(size[0], size[1], size[2]);
gluSphere(qobj, 1.0, 8, 5);
- }
- else if (type==OB_BOUND_CYLINDER) {
+ }
+ else if (type == OB_BOUND_CYLINDER) {
float radius = size[0] > size[1] ? size[0] : size[1];
- glTranslatef(cent[0], cent[1], cent[2]-size[2]);
+ glTranslatef(cent[0], cent[1], cent[2] - size[2]);
glScalef(radius, radius, 2.0f * size[2]);
gluCylinder(qobj, 1.0, 1.0, 1.0, 8, 1);
}
- else if (type==OB_BOUND_CONE) {
+ else if (type == OB_BOUND_CONE) {
float radius = size[0] > size[1] ? size[0] : size[1];
- glTranslatef(cent[0], cent[1], cent[2]-size[2]);
+ glTranslatef(cent[0], cent[1], cent[2] - size[2]);
glScalef(radius, radius, 2.0f * size[2]);
gluCylinder(qobj, 1.0, 0.0, 1.0, 8, 1);
}
glPopMatrix();
- gluDeleteQuadric(qobj);
+ gluDeleteQuadric(qobj);
}
static void draw_bounding_volume(Scene *scene, Object *ob, char type)
{
- BoundBox *bb= NULL;
+ BoundBox *bb = NULL;
- if (ob->type==OB_MESH) {
- bb= mesh_get_bb(ob);
+ if (ob->type == OB_MESH) {
+ bb = mesh_get_bb(ob);
}
- else if ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT) {
- bb= ob->bb ? ob->bb : ( (Curve *)ob->data )->bb;
+ else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
+ bb = ob->bb ? ob->bb : ( (Curve *)ob->data)->bb;
}
- else if (ob->type==OB_MBALL) {
+ else if (ob->type == OB_MBALL) {
if (is_basis_mball(ob)) {
- bb= ob->bb;
- if (bb==NULL) {
+ bb = ob->bb;
+ if (bb == NULL) {
makeDispListMBall(scene, ob);
- bb= ob->bb;
+ bb = ob->bb;
}
}
}
+ else if (ob->type == OB_ARMATURE) {
+ bb = BKE_armature_get_bb(ob);
+ }
else {
drawcube();
return;
}
- if (bb==NULL) return;
+ if (bb == NULL) return;
- if (type==OB_BOUND_BOX) draw_box(bb->vec);
+ if (type == OB_BOUND_BOX) draw_box(bb->vec);
else draw_bb_quadric(bb, type);
}
@@ -6112,29 +6155,29 @@ static void drawtexspace(Object *ob)
{
float vec[8][3], loc[3], size[3];
- if (ob->type==OB_MESH) {
+ if (ob->type == OB_MESH) {
mesh_get_texspace(ob->data, loc, NULL, size);
}
- else if ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT) {
- Curve *cu= ob->data;
+ else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
+ Curve *cu = ob->data;
copy_v3_v3(size, cu->size);
copy_v3_v3(loc, cu->loc);
}
- else if (ob->type==OB_MBALL) {
- MetaBall *mb= ob->data;
+ else if (ob->type == OB_MBALL) {
+ MetaBall *mb = ob->data;
copy_v3_v3(size, mb->size);
copy_v3_v3(loc, mb->loc);
}
else return;
- vec[0][0]=vec[1][0]=vec[2][0]=vec[3][0]= loc[0]-size[0];
- vec[4][0]=vec[5][0]=vec[6][0]=vec[7][0]= loc[0]+size[0];
+ vec[0][0] = vec[1][0] = vec[2][0] = vec[3][0] = loc[0] - size[0];
+ vec[4][0] = vec[5][0] = vec[6][0] = vec[7][0] = loc[0] + size[0];
- vec[0][1]=vec[1][1]=vec[4][1]=vec[5][1]= loc[1]-size[1];
- vec[2][1]=vec[3][1]=vec[6][1]=vec[7][1]= loc[1]+size[1];
+ vec[0][1] = vec[1][1] = vec[4][1] = vec[5][1] = loc[1] - size[1];
+ vec[2][1] = vec[3][1] = vec[6][1] = vec[7][1] = loc[1] + size[1];
- vec[0][2]=vec[3][2]=vec[4][2]=vec[7][2]= loc[2]-size[2];
- vec[1][2]=vec[2][2]=vec[5][2]=vec[6][2]= loc[2]+size[2];
+ vec[0][2] = vec[3][2] = vec[4][2] = vec[7][2] = loc[2] - size[2];
+ vec[1][2] = vec[2][2] = vec[5][2] = vec[6][2] = loc[2] + size[2];
setlinestyle(2);
@@ -6146,42 +6189,42 @@ static void drawtexspace(Object *ob)
/* draws wire outline */
static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
{
- RegionView3D *rv3d= ar->regiondata;
- Object *ob= base->object;
+ RegionView3D *rv3d = ar->regiondata;
+ Object *ob = base->object;
glLineWidth(2.0);
glDepthMask(0);
- if (ELEM3(ob->type, OB_FONT,OB_CURVE, OB_SURF)) {
+ if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
Curve *cu = ob->data;
DerivedMesh *dm = ob->derivedFinal;
- int hasfaces= 0;
+ int hasfaces = 0;
if (dm) {
- hasfaces= dm->getNumTessFaces(dm);
+ hasfaces = dm->getNumTessFaces(dm);
}
else {
- hasfaces= displist_has_faces(&ob->disp);
+ hasfaces = displist_has_faces(&ob->disp);
}
if (hasfaces && ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
- draw_index_wire= 0;
+ draw_index_wire = 0;
if (dm) {
draw_mesh_object_outline(v3d, ob, dm);
}
else {
drawDispListwire(&ob->disp);
}
- draw_index_wire= 1;
+ draw_index_wire = 1;
}
}
- else if (ob->type==OB_MBALL) {
+ else if (ob->type == OB_MBALL) {
if (is_basis_mball(ob)) {
- if ((base->flag & OB_FROMDUPLI)==0)
+ if ((base->flag & OB_FROMDUPLI) == 0)
drawDispListwire(&ob->disp);
}
}
- else if (ob->type==OB_ARMATURE) {
+ else if (ob->type == OB_ARMATURE) {
if (!(ob->mode & OB_MODE_POSE && base == scene->basact))
draw_armature(scene, v3d, ar, base, OB_WIRE, FALSE, TRUE);
}
@@ -6192,8 +6235,8 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
static void drawWireExtra(Scene *scene, RegionView3D *rv3d, Object *ob)
{
- if (ob!=scene->obedit && (ob->flag & SELECT)) {
- if (ob==OBACT) {
+ if (ob != scene->obedit && (ob->flag & SELECT)) {
+ if (ob == OBACT) {
if (ob->flag & OB_FROMGROUP) UI_ThemeColor(TH_GROUP_ACTIVE);
else UI_ThemeColor(TH_ACTIVE);
}
@@ -6207,7 +6250,7 @@ static void drawWireExtra(Scene *scene, RegionView3D *rv3d, Object *ob)
UI_ThemeColor(TH_GROUP);
else {
if (ob->dtx & OB_DRAWWIRE) {
- glColor3ub(80,80,80);
+ glColor3ub(80, 80, 80);
}
else {
UI_ThemeColor(TH_WIRE);
@@ -6216,13 +6259,13 @@ static void drawWireExtra(Scene *scene, RegionView3D *rv3d, Object *ob)
}
bglPolygonOffset(rv3d->dist, 1.0);
- glDepthMask(0); // disable write in zbuffer, selected edge wires show better
+ glDepthMask(0); // disable write in zbuffer, selected edge wires show better
if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
Curve *cu = ob->data;
if (ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
- if (ob->type==OB_CURVE)
- draw_index_wire= 0;
+ if (ob->type == OB_CURVE)
+ draw_index_wire = 0;
if (ob->derivedFinal) {
drawCurveDMWired(ob);
@@ -6231,11 +6274,11 @@ static void drawWireExtra(Scene *scene, RegionView3D *rv3d, Object *ob)
drawDispListwire(&ob->disp);
}
- if (ob->type==OB_CURVE)
- draw_index_wire= 1;
+ if (ob->type == OB_CURVE)
+ draw_index_wire = 1;
}
}
- else if (ob->type==OB_MBALL) {
+ else if (ob->type == OB_MBALL) {
if (is_basis_mball(ob)) {
drawDispListwire(&ob->disp);
}
@@ -6251,9 +6294,9 @@ static void draw_hooks(Object *ob)
ModifierData *md;
float vec[3];
- for (md=ob->modifiers.first; md; md=md->next) {
- if (md->type==eModifierType_Hook) {
- HookModifierData *hmd = (HookModifierData*) md;
+ for (md = ob->modifiers.first; md; md = md->next) {
+ if (md->type == eModifierType_Hook) {
+ HookModifierData *hmd = (HookModifierData *) md;
mul_v3_m4v3(vec, ob->obmat, hmd->cent);
@@ -6287,55 +6330,58 @@ static void drawRBpivot(bRigidBodyJointConstraint *data)
glGetFloatv(GL_CURRENT_COLOR, curcol);
rgb_float_to_uchar(tcol, curcol);
- tcol[3]= 255;
+ tcol[3] = 255;
- eul_to_mat4(mat,&data->axX);
- glLineWidth (4.0f);
+ eul_to_mat4(mat, &data->axX);
+ glLineWidth(4.0f);
setlinestyle(2);
- for (axis=0; axis<3; axis++) {
- float dir[3] = {0,0,0};
+ for (axis = 0; axis < 3; axis++) {
+ float dir[3] = {0, 0, 0};
float v[3];
copy_v3_v3(v, &data->pivX);
dir[axis] = 1.f;
glBegin(GL_LINES);
- mul_m4_v3(mat,dir);
+ mul_m4_v3(mat, dir);
add_v3_v3(v, dir);
glVertex3fv(&data->pivX);
- glVertex3fv(v);
+ glVertex3fv(v);
glEnd();
view3d_cached_text_draw_add(v, axis_str[axis], 0, V3D_CACHE_TEXT_ASCII, tcol);
}
- glLineWidth (1.0f);
+ glLineWidth(1.0f);
setlinestyle(0);
}
/* flag can be DRAW_PICKING and/or DRAW_CONSTCOLOR, DRAW_SCENESET */
void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
{
- static int warning_recursive= 0;
+ static int warning_recursive = 0;
ModifierData *md = NULL;
- Object *ob= base->object;
+ Object *ob = base->object;
Curve *cu;
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
float vec1[3], vec2[3];
- unsigned int col=0;
- int /*sel, drawtype,*/ colindex= 0;
- int i, selstart, selend, empty_object=0;
- short dt, dtx, zbufoff= 0;
- const short is_obact= (ob == OBACT);
+ unsigned int col = 0;
+ int /*sel, drawtype,*/ colindex = 0;
+ int i, selstart, selend, empty_object = 0;
+ short dt, dtx, zbufoff = 0;
+ const short is_obact = (ob == OBACT);
/* only once set now, will be removed too, should become a global standard */
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- if (ob!=scene->obedit) {
- if (ob->restrictflag & OB_RESTRICT_VIEW)
+ if (ob != scene->obedit) {
+ if (ob->restrictflag & OB_RESTRICT_VIEW) {
return;
- if ((ob->restrictflag & OB_RESTRICT_RENDER) &&
- (v3d->flag2 & V3D_RENDER_OVERRIDE))
+ }
+ else if ((ob->restrictflag & OB_RESTRICT_RENDER) &&
+ (v3d->flag2 & V3D_RENDER_OVERRIDE))
+ {
return;
+ }
}
/* XXX particles are not safe for simultaneous threaded render */
@@ -6343,7 +6389,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
return;
/* xray delay? */
- if ((flag & DRAW_PICKING)==0 && (base->flag & OB_FROMDUPLI)==0) {
+ if ((flag & DRAW_PICKING) == 0 && (base->flag & OB_FROMDUPLI) == 0) {
/* don't do xray in particle mode, need the z-buffer */
if (!(ob->mode & OB_MODE_PARTICLE_EDIT)) {
/* xray and transp are set when it is drawing the 2nd/3rd pass */
@@ -6361,8 +6407,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
/* if ( ((int)ob->ctime) != F_(scene->r.cfra)) where_is_object(scene, ob); */
/* draw motion paths (in view space) */
- if (ob->mpath && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
- bAnimVizSettings *avs= &ob->avs;
+ if (ob->mpath && (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
+ bAnimVizSettings *avs = &ob->avs;
/* setup drawing environment for paths */
draw_motion_paths_init(v3d, ar);
@@ -6384,25 +6430,25 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
* 'colortab[colindex]' and 'theme_id', colindex overrides theme_id.
*
* note: no theme yet for 'colindex' */
- int theme_id= TH_WIRE;
- int theme_shade= 0;
+ int theme_id = TH_WIRE;
+ int theme_shade = 0;
project_short(ar, ob->obmat[3], &base->sx);
- if ( (scene->obedit == NULL) &&
- (G.moving & G_TRANSFORM_OBJ) &&
- (base->flag & (SELECT+BA_WAS_SEL)))
+ if ((scene->obedit == NULL) &&
+ (G.moving & G_TRANSFORM_OBJ) &&
+ (base->flag & (SELECT + BA_WAS_SEL)))
{
- theme_id= TH_TRANSFORM;
+ theme_id = TH_TRANSFORM;
}
else {
/* Sets the 'colindex' */
if (ob->id.lib) {
- colindex= (base->flag & (SELECT+BA_WAS_SEL)) ? 4 : 3;
+ colindex = (base->flag & (SELECT + BA_WAS_SEL)) ? 4 : 3;
}
- else if (warning_recursive==1) {
- if (base->flag & (SELECT+BA_WAS_SEL)) {
- colindex= (scene->basact==base) ? 8 : 7;
+ else if (warning_recursive == 1) {
+ if (base->flag & (SELECT + BA_WAS_SEL)) {
+ colindex = (scene->basact == base) ? 8 : 7;
}
else {
colindex = 6;
@@ -6411,25 +6457,27 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
/* Sets the 'theme_id' or fallback to wire */
else {
if (ob->flag & OB_FROMGROUP) {
- if (base->flag & (SELECT+BA_WAS_SEL)) {
+ if (base->flag & (SELECT + BA_WAS_SEL)) {
/* uses darker active color for non-active + selected*/
- theme_id= TH_GROUP_ACTIVE;
+ theme_id = TH_GROUP_ACTIVE;
if (scene->basact != base) {
- theme_shade= -16;
+ theme_shade = -16;
}
}
else {
- theme_id= TH_GROUP;
+ theme_id = TH_GROUP;
}
}
else {
- if (base->flag & (SELECT+BA_WAS_SEL)) {
- theme_id= scene->basact == base ? TH_ACTIVE : TH_SELECT;
+ if (base->flag & (SELECT + BA_WAS_SEL)) {
+ theme_id = scene->basact == base ? TH_ACTIVE : TH_SELECT;
}
else {
- if (ob->type==OB_LAMP) theme_id= TH_LAMP;
- else if (ob->type==OB_SPEAKER) theme_id= TH_SPEAKER;
+ if (ob->type == OB_LAMP) theme_id = TH_LAMP;
+ else if (ob->type == OB_SPEAKER) theme_id = TH_SPEAKER;
+ else if (ob->type == OB_CAMERA) theme_id = TH_CAMERA;
+ else if (ob->type == OB_EMPTY) theme_id = TH_EMPTY;
/* fallback to TH_WIRE */
}
}
@@ -6439,56 +6487,56 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
/* finally set the color */
if (colindex == 0) {
if (theme_shade == 0) UI_ThemeColor(theme_id);
- else UI_ThemeColorShade(theme_id, theme_shade);
+ else UI_ThemeColorShade(theme_id, theme_shade);
}
else {
- col= colortab[colindex];
+ col = colortab[colindex];
cpack(col);
}
}
/* maximum drawtype */
- dt= v3d->drawtype;
- if (dt==OB_RENDER) dt= OB_SOLID;
- dt= MIN2(dt, ob->dt);
- if (v3d->zbuf==0 && dt>OB_WIRE) dt= OB_WIRE;
- dtx= 0;
+ dt = v3d->drawtype;
+ if (dt == OB_RENDER) dt = OB_SOLID;
+ dt = MIN2(dt, ob->dt);
+ if (v3d->zbuf == 0 && dt > OB_WIRE) dt = OB_WIRE;
+ dtx = 0;
/* faceselect exception: also draw solid when dt==wire, except in editmode */
- if (is_obact && (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) {
- if (ob->type==OB_MESH) {
+ if (is_obact && (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))) {
+ if (ob->type == OB_MESH) {
if (ob->mode & OB_MODE_EDIT) {
/* pass */
}
else {
- if (dt<OB_SOLID) {
- zbufoff= 1;
- dt= OB_SOLID;
+ if (dt < OB_SOLID) {
+ zbufoff = 1;
+ dt = OB_SOLID;
}
else {
- dt= OB_PAINT;
+ dt = OB_PAINT;
}
glEnable(GL_DEPTH_TEST);
}
}
else {
- if (dt<OB_SOLID) {
- dt= OB_SOLID;
+ if (dt < OB_SOLID) {
+ dt = OB_SOLID;
glEnable(GL_DEPTH_TEST);
- zbufoff= 1;
+ zbufoff = 1;
}
}
}
/* draw-extra supported for boundbox drawmode too */
- if (dt>=OB_BOUNDBOX ) {
+ if (dt >= OB_BOUNDBOX) {
- dtx= ob->dtx;
+ dtx = ob->dtx;
if (ob->mode & OB_MODE_EDIT) {
// the only 2 extra drawtypes alowed in editmode
- dtx= dtx & (OB_DRAWWIRE|OB_TEXSPACE);
+ dtx = dtx & (OB_DRAWWIRE | OB_TEXSPACE);
}
}
@@ -6496,27 +6544,27 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
/* bad exception, solve this! otherwise outline shows too late */
if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
/* still needed for curves hidden in other layers. depgraph doesnt handle that yet */
- if (ob->disp.first==NULL) makeDispListCurveTypes(scene, ob, 0);
+ if (ob->disp.first == NULL) makeDispListCurveTypes(scene, ob, 0);
}
/* draw outline for selected objects, mesh does itself */
- if ((v3d->flag & V3D_SELECT_OUTLINE) && ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) && ob->type!=OB_MESH) {
- if (dt>OB_WIRE && (ob->mode & OB_MODE_EDIT)==0 && (flag & DRAW_SCENESET)==0) {
- if (!(ob->dtx&OB_DRAWWIRE) && (ob->flag&SELECT) && !(flag&DRAW_PICKING)) {
+ if ((v3d->flag & V3D_SELECT_OUTLINE) && ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && ob->type != OB_MESH) {
+ if (dt > OB_WIRE && (ob->mode & OB_MODE_EDIT) == 0 && (flag & DRAW_SCENESET) == 0) {
+ if (!(ob->dtx & OB_DRAWWIRE) && (ob->flag & SELECT) && !(flag & DRAW_PICKING)) {
drawObjectSelect(scene, v3d, ar, base);
}
}
}
- switch( ob->type) {
+ switch (ob->type) {
case OB_MESH:
- empty_object= draw_mesh_object(scene, ar, v3d, rv3d, base, dt, flag);
- if (flag!=DRAW_CONSTCOLOR) dtx &= ~OB_DRAWWIRE; // mesh draws wire itself
+ empty_object = draw_mesh_object(scene, ar, v3d, rv3d, base, dt, flag);
+ if (flag != DRAW_CONSTCOLOR) dtx &= ~OB_DRAWWIRE; // mesh draws wire itself
break;
case OB_FONT:
- cu= ob->data;
+ cu = ob->data;
if (cu->editfont) {
draw_textcurs(cu->editfont->textcurs);
@@ -6539,17 +6587,17 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
vec1[1] += cu->linedist * cu->fsize;
vec2[1] -= cu->lines * cu->linedist * cu->fsize;
setlinestyle(3);
- glBegin(GL_LINE_STRIP);
- glVertex2fv(vec1);
- glVertex2fv(vec2);
+ glBegin(GL_LINE_STRIP);
+ glVertex2fv(vec1);
+ glVertex2fv(vec2);
glEnd();
setlinestyle(0);
}
setlinestyle(3);
- for (i=0; i<cu->totbox; i++) {
+ for (i = 0; i < cu->totbox; i++) {
if (cu->tb[i].w != 0.0f) {
- UI_ThemeColor(i == (cu->actbox-1) ? TH_ACTIVE : TH_WIRE);
+ UI_ThemeColor(i == (cu->actbox - 1) ? TH_ACTIVE : TH_WIRE);
vec1[0] = (cu->xof * cu->fsize) + cu->tb[i].x;
vec1[1] = (cu->yof * cu->fsize) + cu->tb[i].y + cu->fsize;
vec1[2] = 0.001;
@@ -6574,73 +6622,75 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
cpack(0xffffff);
set_inverted_drawing(1);
- for (i=0; i<(selend-selstart+1); i++) {
+ for (i = 0; i < (selend - selstart + 1); i++) {
SelBox *sb = &(cu->selboxes[i]);
- if (i<(selend-selstart)) {
- if (cu->selboxes[i+1].y == sb->y)
- selboxw= cu->selboxes[i+1].x - sb->x;
+ if (i < (selend - selstart)) {
+ if (cu->selboxes[i + 1].y == sb->y)
+ selboxw = cu->selboxes[i + 1].x - sb->x;
else
- selboxw= sb->w;
+ selboxw = sb->w;
}
else {
- selboxw= sb->w;
+ selboxw = sb->w;
}
glBegin(GL_QUADS);
glVertex3f(sb->x, sb->y, 0.001);
- glVertex3f(sb->x+selboxw, sb->y, 0.001);
- glVertex3f(sb->x+selboxw, sb->y+sb->h, 0.001);
- glVertex3f(sb->x, sb->y+sb->h, 0.001);
+ glVertex3f(sb->x + selboxw, sb->y, 0.001);
+ glVertex3f(sb->x + selboxw, sb->y + sb->h, 0.001);
+ glVertex3f(sb->x, sb->y + sb->h, 0.001);
glEnd();
}
set_inverted_drawing(0);
}
}
- else if (dt==OB_BOUNDBOX) {
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE) == 0) {
+ else if (dt == OB_BOUNDBOX) {
+ if (((v3d->flag2 & V3D_RENDER_OVERRIDE) && v3d->drawtype >= OB_WIRE) == 0) {
draw_bounding_volume(scene, ob, ob->boundtype);
}
}
else if (ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
- empty_object= drawDispList(scene, v3d, rv3d, base, dt);
+ empty_object = drawDispList(scene, v3d, rv3d, base, dt);
}
break;
case OB_CURVE:
case OB_SURF:
- cu= ob->data;
+ cu = ob->data;
if (cu->editnurb) {
- ListBase *nurbs= curve_editnurbs(cu);
+ ListBase *nurbs = curve_editnurbs(cu);
drawnurb(scene, v3d, rv3d, base, nurbs->first, dt);
}
- else if (dt==OB_BOUNDBOX) {
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0)
+ else if (dt == OB_BOUNDBOX) {
+ if (((v3d->flag2 & V3D_RENDER_OVERRIDE) && (v3d->drawtype >= OB_WIRE)) == 0) {
draw_bounding_volume(scene, ob, ob->boundtype);
+ }
}
else if (ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
- empty_object= drawDispList(scene, v3d, rv3d, base, dt);
+ empty_object = drawDispList(scene, v3d, rv3d, base, dt);
//XXX old animsys if (cu->path)
-// curve_draw_speed(scene, ob);
+// curve_draw_speed(scene, ob);
}
break;
case OB_MBALL:
{
- MetaBall *mb= ob->data;
+ MetaBall *mb = ob->data;
if (mb->editelems)
drawmball(scene, v3d, rv3d, base, dt);
- else if (dt==OB_BOUNDBOX) {
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0)
+ else if (dt == OB_BOUNDBOX) {
+ if (((v3d->flag2 & V3D_RENDER_OVERRIDE) && (v3d->drawtype >= OB_WIRE)) == 0) {
draw_bounding_volume(scene, ob, ob->boundtype);
+ }
}
- else
- empty_object= drawmball(scene, v3d, rv3d, base, dt);
+ else
+ empty_object = drawmball(scene, v3d, rv3d, base, dt);
break;
}
case OB_EMPTY:
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
if (ob->empty_drawtype == OB_EMPTY_IMAGE) {
draw_empty_image(ob);
}
@@ -6650,36 +6700,46 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
}
break;
case OB_LAMP:
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
drawlamp(scene, v3d, rv3d, base, dt, flag);
if (dtx || (base->flag & SELECT)) glMultMatrixf(ob->obmat);
}
break;
case OB_CAMERA:
- if ( (v3d->flag2 & V3D_RENDER_OVERRIDE)==0 ||
- (rv3d->persp==RV3D_CAMOB && v3d->camera==ob)) /* special exception for active camera */
- {
- drawcamera(scene, v3d, rv3d, base, flag);
- break;
- }
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0 ||
+ (rv3d->persp == RV3D_CAMOB && v3d->camera == ob)) /* special exception for active camera */
+ {
+ drawcamera(scene, v3d, rv3d, base, flag);
+ break;
+ }
case OB_SPEAKER:
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0)
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0)
drawspeaker(scene, v3d, rv3d, ob, flag);
break;
case OB_LATTICE:
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
drawlattice(scene, v3d, ob);
}
break;
case OB_ARMATURE:
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
- if (dt>OB_WIRE) GPU_enable_material(0, NULL); // we use default material
- empty_object= draw_armature(scene, v3d, ar, base, dt, flag, FALSE);
- if (dt>OB_WIRE) GPU_disable_material();
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
+ /* Do not allow boundbox in edit nor pose mode! */
+ if ((dt == OB_BOUNDBOX) && (ob->mode & (OB_MODE_EDIT | OB_MODE_POSE)))
+ dt = OB_WIRE;
+ if (dt == OB_BOUNDBOX) {
+ draw_bounding_volume(scene, ob, ob->boundtype);
+ }
+ else {
+ if (dt > OB_WIRE)
+ GPU_enable_material(0, NULL); /* we use default material */
+ empty_object = draw_armature(scene, v3d, ar, base, dt, flag, FALSE);
+ if (dt > OB_WIRE)
+ GPU_disable_material();
+ }
}
break;
default:
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
drawaxes(1.0, OB_ARROWS);
}
}
@@ -6687,17 +6747,17 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
if (ob->soft /*&& flag & OB_SBMOTION*/) {
- float mrt[3][3],msc[3][3],mtr[3][3];
- SoftBody *sb= NULL;
- float tipw = 0.5f, tiph = 0.5f,drawsize = 4.0f;
- if ((sb= ob->soft)) {
+ float mrt[3][3], msc[3][3], mtr[3][3];
+ SoftBody *sb = NULL;
+ float tipw = 0.5f, tiph = 0.5f, drawsize = 4.0f;
+ if ((sb = ob->soft)) {
if (sb->solverflags & SBSO_ESTIMATEIPO) {
glLoadMatrixf(rv3d->viewmat);
- copy_m3_m3(msc,sb->lscale);
- copy_m3_m3(mrt,sb->lrot);
- mul_m3_m3m3(mtr,mrt,msc);
- ob_draw_RE_motion(sb->lcom,mtr,tipw,tiph,drawsize);
+ copy_m3_m3(msc, sb->lscale);
+ copy_m3_m3(mrt, sb->lrot);
+ mul_m3_m3m3(mtr, mrt, msc);
+ ob_draw_RE_motion(sb->lcom, mtr, tipw, tiph, drawsize);
glMultMatrixf(ob->obmat);
}
}
@@ -6709,21 +6769,22 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
}
/* code for new particle system */
- if ( (warning_recursive==0) &&
- (ob->particlesystem.first) &&
- (flag & DRAW_PICKING)==0 &&
- (ob!=scene->obedit)
- ) {
+ if ((warning_recursive == 0) &&
+ (ob->particlesystem.first) &&
+ (flag & DRAW_PICKING) == 0 &&
+ (ob != scene->obedit)
+ )
+ {
ParticleSystem *psys;
- if (col || (ob->flag & SELECT)) cpack(0xFFFFFF); /* for visibility, also while wpaint */
+ if (col || (ob->flag & SELECT)) cpack(0xFFFFFF); /* for visibility, also while wpaint */
//glDepthMask(GL_FALSE);
glLoadMatrixf(rv3d->viewmat);
view3d_cached_text_draw_begin();
- for (psys=ob->particlesystem.first; psys; psys=psys->next) {
+ for (psys = ob->particlesystem.first; psys; psys = psys->next) {
/* run this so that possible child particles get cached */
if (ob->mode & OB_MODE_PARTICLE_EDIT && is_obact) {
PTCacheEdit *edit = PE_create_current(scene, ob);
@@ -6743,8 +6804,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
}
/* draw edit particles last so that they can draw over child particles */
- if ( (warning_recursive==0) &&
- (flag & DRAW_PICKING)==0 &&
+ if ( (warning_recursive == 0) &&
+ (flag & DRAW_PICKING) == 0 &&
(!scene->obedit))
{
@@ -6764,11 +6825,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);
@@ -6783,7 +6843,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
for (i = 0; i < scs->numpoints; i++)
{
- bglVertex3fv(&scs->points[3*i]);
+ bglVertex3fv(&scs->points[3 * i]);
}
bglEnd();
@@ -6795,16 +6855,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);
@@ -6819,7 +6878,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
float *density = smoke_get_density(smd->domain->fluid);
glLoadMatrixf(rv3d->viewmat);
- // glMultMatrixf(ob->obmat);
+ // glMultMatrixf(ob->obmat);
if (col || (ob->flag & SELECT)) cpack(0xFFFFFF);
glDepthMask(GL_FALSE);
@@ -6829,23 +6888,23 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
// glPointSize(3.0);
bglBegin(GL_POINTS);
- for (x = 0; x < smd->domain->res[0]; x++)
- for (y = 0; y < smd->domain->res[1]; y++)
- for (z = 0; z < smd->domain->res[2]; z++)
- {
- float tmp[3];
- int index = smoke_get_index(x, smd->domain->res[0], y, smd->domain->res[1], z);
-
- 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;
- tmp[1] += smd->domain->dx * y + smd->domain->dx * 0.5;
- tmp[2] += smd->domain->dx * z + smd->domain->dx * 0.5;
- color[0] = color[1] = color[2] = density[index];
- glColor3fv(color);
- bglVertex3fv(tmp);
+ for (x = 0; x < smd->domain->res[0]; x++) {
+ for (y = 0; y < smd->domain->res[1]; y++) {
+ for (z = 0; z < smd->domain->res[2]; z++) {
+ float tmp[3];
+ int index = smoke_get_index(x, smd->domain->res[0], y, smd->domain->res[1], z);
+
+ 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;
+ tmp[1] += smd->domain->dx * y + smd->domain->dx * 0.5;
+ tmp[2] += smd->domain->dx * z + smd->domain->dx * 0.5;
+ color[0] = color[1] = color[2] = density[index];
+ glColor3fv(color);
+ bglVertex3fv(tmp);
+ }
+ }
}
}
@@ -6858,8 +6917,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,
@@ -6871,21 +6929,19 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
}
}
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
-
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
bConstraint *con;
- 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)
+
+ 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);
}
}
if (ob->gameflag & OB_BOUNDS) {
- if (ob->boundtype!=ob->collision_boundtype || (dtx & OB_BOUNDBOX)==0) {
+ if (ob->boundtype != ob->collision_boundtype || (dtx & OB_BOUNDBOX) == 0) {
setlinestyle(2);
draw_bounding_volume(scene, ob, ob->collision_boundtype);
setlinestyle(0);
@@ -6893,7 +6949,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
}
/* draw extra: after normal draw because of makeDispList */
- if (dtx && (G.f & G_RENDER_OGL)==0) {
+ if (dtx && (G.f & G_RENDER_OGL) == 0) {
if (dtx & OB_AXIS) {
drawaxes(1.0f, OB_ARROWS);
@@ -6901,29 +6957,34 @@ 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 */
+ /* but, we also don't draw names for sets or duplicators */
if (flag == 0) {
- float zero[3]= {0,0,0};
+ float zero[3] = {0, 0, 0};
float curcol[4];
unsigned char tcol[4];
glGetFloatv(GL_CURRENT_COLOR, curcol);
rgb_float_to_uchar(tcol, curcol);
- tcol[3]= 255;
- view3d_cached_text_draw_add(zero, ob->id.name+2, 10, 0, tcol);
+ tcol[3] = 255;
+ view3d_cached_text_draw_add(zero, ob->id.name + 2, 10, 0, tcol);
}
}
/*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 (dt <= OB_SOLID && (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
if ((ob->gameflag & OB_DYNAMIC) ||
- ((ob->gameflag & OB_BOUNDS) && (ob->boundtype == OB_BOUND_SPHERE))) {
- float imat[4][4], vec[3]= {0.0f, 0.0f, 0.0f};
+ ((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);
@@ -6939,25 +7000,30 @@ 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))) {
- int do_draw_center= -1; /* defines below are zero or positive... */
+ if (!is_obact || !(ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))) {
+ int do_draw_center = -1; /* defines below are zero or positive... */
if (v3d->flag2 & V3D_RENDER_OVERRIDE) {
- /* dont draw */
+ /* don't draw */
}
- else if ((scene->basact)==base)
- do_draw_center= ACTIVE;
+ else if ((scene->basact) == base)
+ do_draw_center = ACTIVE;
else if (base->flag & SELECT)
- do_draw_center= SELECT;
+ do_draw_center = SELECT;
else if (empty_object || (v3d->flag & V3D_DRAW_CENTERS))
- do_draw_center= DESELECT;
+ do_draw_center = DESELECT;
if (do_draw_center != -1) {
if (flag & DRAW_PICKING) {
@@ -6965,26 +7031,26 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
glBegin(GL_POINTS);
glVertex3fv(ob->obmat[3]);
glEnd();
- }
- else if ((flag & DRAW_CONSTCOLOR)==0) {
+ }
+ else if ((flag & DRAW_CONSTCOLOR) == 0) {
/* we don't draw centers for duplicators and sets */
if (U.obcenter_dia > 0) {
/* check > 0 otherwise grease pencil can draw into the circle select which is annoying. */
- drawcentercircle(v3d, rv3d, ob->obmat[3], do_draw_center, ob->id.lib || ob->id.us>1);
+ drawcentercircle(v3d, rv3d, ob->obmat[3], do_draw_center, ob->id.lib || ob->id.us > 1);
}
}
}
}
/* not for sets, duplicators or picking */
- if (flag==0 && (v3d->flag & V3D_HIDE_HELPLINES)== 0 && (v3d->flag2 & V3D_RENDER_OVERRIDE)== 0) {
+ if (flag == 0 && (v3d->flag & V3D_HIDE_HELPLINES) == 0 && (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
ListBase *list;
/* draw hook center and offset line */
- if (ob!=scene->obedit) draw_hooks(ob);
+ if (ob != scene->obedit) draw_hooks(ob);
/* help lines and so */
- if (ob!=scene->obedit && ob->parent && (ob->parent->lay & v3d->lay)) {
+ if (ob != scene->obedit && ob->parent && (ob->parent->lay & v3d->lay)) {
setlinestyle(3);
glBegin(GL_LINES);
glVertex3fv(ob->obmat[3]);
@@ -7005,29 +7071,29 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
UI_make_axis_color(col1, col2, 'Z');
glColor3ubv(col2);
- cob= constraints_make_evalob(scene, ob, NULL, CONSTRAINT_OBTYPE_OBJECT);
+ cob = constraints_make_evalob(scene, ob, NULL, CONSTRAINT_OBTYPE_OBJECT);
- for (curcon = list->first; curcon; curcon=curcon->next) {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(curcon);
+ for (curcon = list->first; curcon; curcon = curcon->next) {
+ bConstraintTypeInfo *cti = constraint_get_typeinfo(curcon);
ListBase targets = {NULL, NULL};
bConstraintTarget *ct;
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;
+ Object *camob = NULL;
- if (cti->type==CONSTRAINT_TYPE_FOLLOWTRACK) {
- bFollowTrackConstraint *data= (bFollowTrackConstraint *)curcon->data;
+ if (cti->type == CONSTRAINT_TYPE_FOLLOWTRACK) {
+ bFollowTrackConstraint *data = (bFollowTrackConstraint *)curcon->data;
- camob= data->camera ? data->camera : scene->camera;
+ camob = data->camera ? data->camera : scene->camera;
}
- else if (cti->type==CONSTRAINT_TYPE_OBJECTSOLVER) {
- bObjectSolverConstraint *data= (bObjectSolverConstraint *)curcon->data;
+ else if (cti->type == CONSTRAINT_TYPE_OBJECTSOLVER) {
+ bObjectSolverConstraint *data = (bObjectSolverConstraint *)curcon->data;
- camob= data->camera ? data->camera : scene->camera;
+ camob = data->camera ? data->camera : scene->camera;
}
if (camob) {
@@ -7042,9 +7108,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
else if ((curcon->flag & CONSTRAINT_EXPAND) && (cti) && (cti->get_constraint_targets)) {
cti->get_constraint_targets(curcon, &targets);
- for (ct= targets.first; ct; ct= ct->next) {
+ for (ct = targets.first; ct; ct = ct->next) {
/* calculate target's matrix */
- if (cti->get_target_matrix)
+ if (cti->get_target_matrix)
cti->get_target_matrix(curcon, cob, ct, BKE_curframe(scene));
else
unit_m4(ct->matrix);
@@ -7078,7 +7144,7 @@ static void bbs_obmode_mesh_verts__mapFunc(void *userData, int index, float *co,
int offset = (intptr_t) data->offset;
if (!(mv->flag & ME_HIDE)) {
- WM_set_framebuffer_index_color(offset+index);
+ WM_set_framebuffer_index_color(offset + index);
bglVertex3fv(co);
}
}
@@ -7089,8 +7155,8 @@ static void bbs_obmode_mesh_verts(Object *ob, DerivedMesh *dm, int offset)
Mesh *me = ob->data;
MVert *mvert = me->mvert;
data.mvert = mvert;
- data.offset = (void*)(intptr_t) offset;
- glPointSize( UI_GetThemeValuef(TH_VERTEX_SIZE) );
+ data.offset = (void *)(intptr_t) offset;
+ glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE) );
bglBegin(GL_POINTS);
dm->foreachMappedVert(dm, bbs_obmode_mesh_verts__mapFunc, &data);
bglEnd();
@@ -7101,65 +7167,65 @@ static void bbs_mesh_verts__mapFunc(void *userData, int index, float *co, float
{
void **ptrs = userData;
int offset = (intptr_t) ptrs[0];
- BMVert *eve = EDBM_get_vert_for_index(ptrs[1], index);
+ BMVert *eve = EDBM_vert_at_index(ptrs[1], index);
if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
- WM_set_framebuffer_index_color(offset+index);
+ WM_set_framebuffer_index_color(offset + index);
bglVertex3fv(co);
}
}
static void bbs_mesh_verts(BMEditMesh *em, DerivedMesh *dm, int offset)
{
- void *ptrs[2] = {(void*)(intptr_t) offset, em};
+ void *ptrs[2] = {(void *)(intptr_t) offset, em};
- glPointSize( UI_GetThemeValuef(TH_VERTEX_SIZE) );
+ glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE) );
bglBegin(GL_POINTS);
dm->foreachMappedVert(dm, bbs_mesh_verts__mapFunc, ptrs);
bglEnd();
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];
- BMEdge *eed = EDBM_get_edge_for_index(ptrs[1], index);
+ BMEdge *eed = EDBM_edge_at_index(ptrs[1], index);
if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
- WM_set_framebuffer_index_color(offset+index);
- return 1;
+ WM_set_framebuffer_index_color(offset + index);
+ return DM_DRAW_OPTION_NORMAL;
}
else {
- return 0;
+ return DM_DRAW_OPTION_SKIP;
}
}
static void bbs_mesh_wire(BMEditMesh *em, DerivedMesh *dm, int offset)
{
- void *ptrs[2] = {(void*)(intptr_t) offset, em};
+ void *ptrs[2] = {(void *)(intptr_t) offset, em};
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);
+ BMFace *efa = EDBM_face_at_index(((void **)userData)[0], index);
if (efa && !BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
- if (((void**)userData)[1]) {
- WM_set_framebuffer_index_color(index+1);
+ 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;
}
}
static void bbs_mesh_solid__drawCenter(void *userData, int index, float *cent, float *UNUSED(no))
{
- BMFace *efa = EDBM_get_face_for_index(((void**)userData)[0], index);
+ BMFace *efa = EDBM_face_at_index(((void **)userData)[0], index);
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
- WM_set_framebuffer_index_color(index+1);
+ WM_set_framebuffer_index_color(index + 1);
bglVertex3fv(cent);
}
@@ -7173,12 +7239,12 @@ static void bbs_mesh_solid_EM(BMEditMesh *em, Scene *scene, View3D *v3d,
cpack(0);
if (facecol) {
- ptrs[1] = (void*)(intptr_t) 1;
+ ptrs[1] = (void *)(intptr_t) 1;
dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, GPU_enable_material, NULL, ptrs, 0);
if (check_ob_drawface_dot(scene, v3d, ob->dt)) {
glPointSize(UI_GetThemeValuef(TH_FACEDOT_SIZE));
-
+
bglBegin(GL_POINTS);
dm->foreachMappedFaceCenter(dm, bbs_mesh_solid__drawCenter, ptrs);
bglEnd();
@@ -7190,41 +7256,41 @@ 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;
+ WM_set_framebuffer_index_color(index + 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;
+ if (!(me->mpoly[index].flag & ME_HIDE)) {
+ WM_set_framebuffer_index_color(index + 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)
{
DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
- Mesh *me = (Mesh*)ob->data;
+ Mesh *me = (Mesh *)ob->data;
glColor3ub(0, 0, 0);
@@ -7238,72 +7304,74 @@ static void bbs_mesh_solid(Scene *scene, Object *ob)
void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob)
{
- ToolSettings *ts= scene->toolsettings;
+ ToolSettings *ts = scene->toolsettings;
glMultMatrixf(ob->obmat);
glClearDepth(1.0); glClear(GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
- switch( ob->type) {
- case OB_MESH:
- if (ob->mode & OB_MODE_EDIT) {
- Mesh *me= ob->data;
- BMEditMesh *em= me->edit_btmesh;
+ switch (ob->type) {
+ case OB_MESH:
+ if (ob->mode & OB_MODE_EDIT) {
+ Mesh *me = ob->data;
+ BMEditMesh *em = me->edit_btmesh;
- DerivedMesh *dm = editbmesh_get_derived_cage(scene, ob, em, CD_MASK_BAREMESH);
+ DerivedMesh *dm = editbmesh_get_derived_cage(scene, ob, em, CD_MASK_BAREMESH);
- EDBM_init_index_arrays(em, 1, 1, 1);
+ EDBM_index_arrays_init(em, 1, 1, 1);
- bbs_mesh_solid_EM(em, scene, v3d, ob, dm, ts->selectmode & SCE_SELECT_FACE);
- if (ts->selectmode & SCE_SELECT_FACE)
- bm_solidoffs = 1+em->bm->totface;
- else
- bm_solidoffs= 1;
-
- bglPolygonOffset(rv3d->dist, 1.0);
-
- // we draw edges always, for loop (select) tools
- bbs_mesh_wire(em, dm, bm_solidoffs);
- bm_wireoffs= bm_solidoffs + em->bm->totedge;
-
- // we draw verts if vert select mode or if in transform (for snap).
- if (ts->selectmode & SCE_SELECT_VERTEX || G.moving & G_TRANSFORM_EDIT) {
- bbs_mesh_verts(em, dm, bm_wireoffs);
- bm_vertoffs= bm_wireoffs + em->bm->totvert;
- }
- else bm_vertoffs= bm_wireoffs;
-
- bglPolygonOffset(rv3d->dist, 0.0);
+ bbs_mesh_solid_EM(em, scene, v3d, ob, dm, ts->selectmode & SCE_SELECT_FACE);
+ if (ts->selectmode & SCE_SELECT_FACE)
+ bm_solidoffs = 1 + em->bm->totface;
+ else
+ bm_solidoffs = 1;
- dm->release(dm);
+ bglPolygonOffset(rv3d->dist, 1.0);
- EDBM_free_index_arrays(em);
- }
- else {
- Mesh *me= ob->data;
- if ( (me->editflag & ME_EDIT_VERT_SEL) &&
- /* currently vertex select only supports weight paint */
- (ob->mode & OB_MODE_WEIGHT_PAINT))
- {
- DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
- glColor3ub(0, 0, 0);
+ // we draw edges always, for loop (select) tools
+ bbs_mesh_wire(em, dm, bm_solidoffs);
+ bm_wireoffs = bm_solidoffs + em->bm->totedge;
- dm->drawMappedFaces(dm, bbs_mesh_solid_hide2__setDrawOpts, GPU_enable_material, NULL, me, 0);
+ // we draw verts if vert select mode or if in transform (for snap).
+ if ((ts->selectmode & SCE_SELECT_VERTEX) || (G.moving & G_TRANSFORM_EDIT)) {
+ bbs_mesh_verts(em, dm, bm_wireoffs);
+ bm_vertoffs = bm_wireoffs + em->bm->totvert;
+ }
+ else {
+ bm_vertoffs = bm_wireoffs;
+ }
+
+ bglPolygonOffset(rv3d->dist, 0.0);
-
- bbs_obmode_mesh_verts(ob, dm, 1);
- bm_vertoffs = me->totvert+1;
dm->release(dm);
+
+ EDBM_index_arrays_free(em);
}
else {
- bbs_mesh_solid(scene, ob);
+ Mesh *me = ob->data;
+ if ((me->editflag & ME_EDIT_VERT_SEL) &&
+ /* currently vertex select only supports weight paint */
+ (ob->mode & OB_MODE_WEIGHT_PAINT))
+ {
+ DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
+ glColor3ub(0, 0, 0);
+
+ dm->drawMappedFaces(dm, bbs_mesh_solid_hide2__setDrawOpts, GPU_enable_material, NULL, me, 0);
+
+
+ bbs_obmode_mesh_verts(ob, dm, 1);
+ bm_vertoffs = me->totvert + 1;
+ dm->release(dm);
+ }
+ else {
+ bbs_mesh_solid(scene, ob);
+ }
}
- }
- break;
- case OB_CURVE:
- case OB_SURF:
- break;
+ break;
+ case OB_CURVE:
+ case OB_SURF:
+ break;
}
glLoadMatrixf(rv3d->viewmat);
@@ -7315,26 +7383,26 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
/* helper function for drawing object instances - meshes */
static void draw_object_mesh_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d,
- Object *ob, int dt, int outline)
+ Object *ob, int dt, int outline)
{
- Mesh *me= ob->data;
- DerivedMesh *dm=NULL, *edm=NULL;
+ Mesh *me = ob->data;
+ DerivedMesh *dm = NULL, *edm = NULL;
int glsl;
if (ob->mode & OB_MODE_EDIT)
- edm= editbmesh_get_derived_base(ob, me->edit_btmesh);
- else
+ edm = editbmesh_get_derived_base(ob, me->edit_btmesh);
+ else
dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
- if (dt<=OB_WIRE) {
+ if (dt <= OB_WIRE) {
if (dm)
dm->drawEdges(dm, 1, 0);
else if (edm)
- edm->drawEdges(edm, 1, 0);
+ edm->drawEdges(edm, 1, 0);
}
else {
if (outline)
- draw_mesh_object_outline(v3d, ob, dm?dm:edm);
+ draw_mesh_object_outline(v3d, ob, dm ? dm : edm);
if (dm) {
glsl = draw_glsl_material(scene, ob, v3d, dt);
@@ -7346,7 +7414,7 @@ static void draw_object_mesh_instance(Scene *scene, View3D *v3d, RegionView3D *r
glDisable(GL_COLOR_MATERIAL);
}
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
+ glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
glEnable(GL_LIGHTING);
if (dm) {
@@ -7365,9 +7433,9 @@ static void draw_object_mesh_instance(Scene *scene, View3D *v3d, RegionView3D *r
void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, int dt, int outline)
{
- if (ob == NULL)
+ if (ob == NULL)
return;
-
+
switch (ob->type) {
case OB_MESH:
draw_object_mesh_instance(scene, v3d, rv3d, ob, dt, outline);
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 9618e5aeef0..2289216c2a8 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -77,7 +77,7 @@
#include "BLF_api.h"
-#include "view3d_intern.h" // own include
+#include "view3d_intern.h" // own include
#ifdef _WIN32
@@ -90,38 +90,38 @@ static LARGE_INTEGER liFrequency;
static LARGE_INTEGER liStartTime;
static LARGE_INTEGER liCurrentTime;
-static void tstart ( void )
+static void tstart(void)
{
- QueryPerformanceFrequency ( &liFrequency );
- QueryPerformanceCounter ( &liStartTime );
+ QueryPerformanceFrequency(&liFrequency);
+ QueryPerformanceCounter(&liStartTime);
}
-static void tend ( void )
+static void tend(void)
{
- QueryPerformanceCounter ( &liCurrentTime );
+ QueryPerformanceCounter(&liCurrentTime);
}
-static double tval( void )
+static double tval(void)
{
- return ((double)( (liCurrentTime.QuadPart - liStartTime.QuadPart)* (double)1000.0/(double)liFrequency.QuadPart ));
+ return ((double)( (liCurrentTime.QuadPart - liStartTime.QuadPart) * (double)1000.0 / (double)liFrequency.QuadPart));
}
#else
#include <sys/time.h>
static struct timeval _tstart, _tend;
static struct timezone tz;
-static void tstart ( void )
+static void tstart(void)
{
- gettimeofday ( &_tstart, &tz );
+ gettimeofday(&_tstart, &tz);
}
-static void tend ( void )
+static void tend(void)
{
- gettimeofday ( &_tend,&tz );
+ gettimeofday(&_tend, &tz);
}
#if 0
static double tval()
{
double t1, t2;
- t1 = ( double ) _tstart.tv_sec*1000 + ( double ) _tstart.tv_usec/ ( 1000 );
- t2 = ( double ) _tend.tv_sec*1000 + ( double ) _tend.tv_usec/ ( 1000 );
- return t2-t1;
+ t1 = ( double ) _tstart.tv_sec * 1000 + ( double ) _tstart.tv_usec / (1000);
+ t2 = ( double ) _tend.tv_sec * 1000 + ( double ) _tend.tv_usec / (1000);
+ return t2 - t1;
}
#endif
#endif
@@ -134,13 +134,13 @@ static int intersect_edges(float *points, float a, float b, float c, float d, fl
float t;
int numpoints = 0;
- for (i=0; i<12; i++) {
- t = -(a*edges[i][0][0] + b*edges[i][0][1] + c*edges[i][0][2] + d)
- / (a*edges[i][1][0] + b*edges[i][1][1] + c*edges[i][1][2]);
- if ((t>0)&&(t<1)) {
- points[numpoints * 3 + 0] = edges[i][0][0] + edges[i][1][0]*t;
- points[numpoints * 3 + 1] = edges[i][0][1] + edges[i][1][1]*t;
- points[numpoints * 3 + 2] = edges[i][0][2] + edges[i][1][2]*t;
+ for (i = 0; i < 12; i++) {
+ t = -(a * edges[i][0][0] + b * edges[i][0][1] + c * edges[i][0][2] + d) /
+ (a * edges[i][1][0] + b * edges[i][1][1] + c * edges[i][1][2]);
+ if ((t > 0) && (t < 1)) {
+ points[numpoints * 3 + 0] = edges[i][0][0] + edges[i][1][0] * t;
+ points[numpoints * 3 + 1] = edges[i][0][1] + edges[i][1][1] * t;
+ points[numpoints * 3 + 2] = edges[i][0][2] + edges[i][1][2] * t;
numpoints++;
}
}
@@ -159,14 +159,14 @@ static int convex(float *p0, float *up, float *a, float *b)
void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3], float dx, GPUTexture *tex_shadow)
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
float viewnormal[3];
int i, j, n, good_index;
float d /*, d0 */ /* UNUSED */, dd, ds;
float *points = NULL;
int numpoints = 0;
- float cor[3] = {1.,1.,1.};
+ float cor[3] = {1., 1., 1.};
int gl_depth = 0, gl_blend = 0;
/* draw slices of smoke is adapted from c++ code authored
@@ -197,22 +197,22 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
/* Fragment program to calculate the view3d of smoke */
/* using 2 textures, density and shadow */
const char *text = "!!ARBfp1.0\n"
- "PARAM dx = program.local[0];\n"
- "PARAM darkness = program.local[1];\n"
- "PARAM f = {1.442695041, 1.442695041, 1.442695041, 0.01};\n"
- "TEMP temp, shadow, value;\n"
- "TEX temp, fragment.texcoord[0], texture[0], 3D;\n"
- "TEX shadow, fragment.texcoord[0], texture[1], 3D;\n"
- "MUL value, temp, darkness;\n"
- "MUL value, value, dx;\n"
- "MUL value, value, f;\n"
- "EX2 temp, -value.r;\n"
- "SUB temp.a, 1.0, temp.r;\n"
- "MUL temp.r, temp.r, shadow.r;\n"
- "MUL temp.g, temp.g, shadow.r;\n"
- "MUL temp.b, temp.b, shadow.r;\n"
- "MOV result.color, temp;\n"
- "END\n";
+ "PARAM dx = program.local[0];\n"
+ "PARAM darkness = program.local[1];\n"
+ "PARAM f = {1.442695041, 1.442695041, 1.442695041, 0.01};\n"
+ "TEMP temp, shadow, value;\n"
+ "TEX temp, fragment.texcoord[0], texture[0], 3D;\n"
+ "TEX shadow, fragment.texcoord[0], texture[1], 3D;\n"
+ "MUL value, temp, darkness;\n"
+ "MUL value, value, dx;\n"
+ "MUL value, value, f;\n"
+ "EX2 temp, -value.r;\n"
+ "SUB temp.a, 1.0, temp.r;\n"
+ "MUL temp.r, temp.r, shadow.r;\n"
+ "MUL temp.g, temp.g, shadow.r;\n"
+ "MUL temp.b, temp.b, shadow.r;\n"
+ "MOV result.color, temp;\n"
+ "END\n";
GLuint prog;
@@ -305,42 +305,42 @@ 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]);
normalize_v3(viewnormal);
// find cube vertex that is closest to the viewer
- for (i=0; i<8; i++) {
- float x,y,z;
+ for (i = 0; i < 8; i++) {
+ float x, y, z;
x = cv[i][0] - viewnormal[0];
y = cv[i][1] - viewnormal[1];
z = cv[i][2] - viewnormal[2];
- if ((x>=min[0])&&(x<=max[0])
- &&(y>=min[1])&&(y<=max[1])
- &&(z>=min[2])&&(z<=max[2])) {
+ if ((x >= min[0]) && (x <= max[0]) &&
+ (y >= min[1]) && (y <= max[1]) &&
+ (z >= min[2]) && (z <= max[2]))
+ {
break;
}
}
if (i >= 8) {
/* fallback, avoid using buffer over-run */
- i= 0;
+ i = 0;
}
// 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);
@@ -348,9 +348,9 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, (GLsizei)strlen(text), text);
// cell spacing
- glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, dx, dx, dx, 1.0);
+ glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, dx, dx, dx, 1.0);
// custom parameter for smoke style (higher = thicker)
- glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, 7.0, 7.0, 7.0, 1.0);
+ glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, 7.0, 7.0, 7.0, 1.0);
}
else
printf("Your gfx card does not support 3D View smoke drawing.\n");
@@ -362,9 +362,9 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
printf("No volume shadow\n");
if (!GPU_non_power_of_two_support()) {
- cor[0] = (float)res[0]/(float)power_of_2_max_i(res[0]);
- cor[1] = (float)res[1]/(float)power_of_2_max_i(res[1]);
- cor[2] = (float)res[2]/(float)power_of_2_max_i(res[2]);
+ cor[0] = (float)res[0] / (float)power_of_2_max_i(res[0]);
+ cor[1] = (float)res[1] / (float)power_of_2_max_i(res[1]);
+ cor[2] = (float)res[2] / (float)power_of_2_max_i(res[2]);
}
// our slices are defined by the plane equation a*x + b*y +c*z + d = 0
@@ -373,24 +373,24 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
// inserting previously found vertex into the plane equation
/* d0 = (viewnormal[0]*cv[i][0] + viewnormal[1]*cv[i][1] + viewnormal[2]*cv[i][2]); */ /* UNUSED */
- ds = (ABS(viewnormal[0])*size[0] + ABS(viewnormal[1])*size[1] + ABS(viewnormal[2])*size[2]);
+ ds = (ABS(viewnormal[0]) * size[0] + ABS(viewnormal[1]) * size[1] + ABS(viewnormal[2]) * size[2]);
dd = 0.05; // ds/512.0f;
n = 0;
good_index = i;
// printf("d0: %f, dd: %f, ds: %f\n\n", d0, dd, ds);
- points = MEM_callocN(sizeof(float)*12*3, "smoke_points_preview");
+ points = MEM_callocN(sizeof(float) * 12 * 3, "smoke_points_preview");
while (1) {
float p0[3];
float tmp_point[3], tmp_point2[3];
- if (dd*(float)n > ds)
+ if (dd * (float)n > ds)
break;
copy_v3_v3(tmp_point, viewnormal);
- mul_v3_fl(tmp_point, -dd*((ds/dd)-(float)n));
+ mul_v3_fl(tmp_point, -dd * ((ds / dd) - (float)n));
add_v3_v3v3(tmp_point2, cv[good_index], tmp_point);
d = dot_v3v3(tmp_point2, viewnormal);
@@ -406,12 +406,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 +438,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 +446,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..72b67c2a716 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -62,7 +62,7 @@
#include "UI_resources.h"
-#include "view3d_intern.h" // own include
+#include "view3d_intern.h" // own include
/* ******************** manage regions ********************* */
@@ -70,20 +70,20 @@ ARegion *view3d_has_buttons_region(ScrArea *sa)
{
ARegion *ar, *arnew;
- ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_UI);
if (ar) return ar;
/* add subdiv level; after header */
- ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
/* is error! */
- if (ar==NULL) return NULL;
+ if (ar == NULL) return NULL;
- arnew= MEM_callocN(sizeof(ARegion), "buttons for view3d");
+ arnew = MEM_callocN(sizeof(ARegion), "buttons for view3d");
BLI_insertlinkafter(&sa->regionbase, ar, arnew);
- arnew->regiontype= RGN_TYPE_UI;
- arnew->alignment= RGN_ALIGN_RIGHT;
+ arnew->regiontype = RGN_TYPE_UI;
+ arnew->alignment = RGN_ALIGN_RIGHT;
arnew->flag = RGN_FLAG_HIDDEN;
@@ -92,42 +92,42 @@ ARegion *view3d_has_buttons_region(ScrArea *sa)
ARegion *view3d_has_tools_region(ScrArea *sa)
{
- ARegion *ar, *artool=NULL, *arprops=NULL, *arhead;
+ ARegion *ar, *artool = NULL, *arprops = NULL, *arhead;
- for (ar= sa->regionbase.first; ar; ar= ar->next) {
- if (ar->regiontype==RGN_TYPE_TOOLS)
- artool= ar;
- if (ar->regiontype==RGN_TYPE_TOOL_PROPS)
- arprops= ar;
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar->regiontype == RGN_TYPE_TOOLS)
+ artool = ar;
+ if (ar->regiontype == RGN_TYPE_TOOL_PROPS)
+ arprops = ar;
}
/* tool region hide/unhide also hides props */
if (arprops && artool) return artool;
- if (artool==NULL) {
+ if (artool == NULL) {
/* add subdiv level; after header */
- for (arhead= sa->regionbase.first; arhead; arhead= arhead->next)
- if (arhead->regiontype==RGN_TYPE_HEADER)
+ for (arhead = sa->regionbase.first; arhead; arhead = arhead->next)
+ if (arhead->regiontype == RGN_TYPE_HEADER)
break;
/* is error! */
- if (arhead==NULL) return NULL;
+ if (arhead == NULL) return NULL;
- artool= MEM_callocN(sizeof(ARegion), "tools for view3d");
+ artool = MEM_callocN(sizeof(ARegion), "tools for view3d");
BLI_insertlinkafter(&sa->regionbase, arhead, artool);
- artool->regiontype= RGN_TYPE_TOOLS;
- artool->alignment= RGN_ALIGN_LEFT; //RGN_OVERLAP_LEFT;
+ artool->regiontype = RGN_TYPE_TOOLS;
+ artool->alignment = RGN_ALIGN_LEFT; //RGN_OVERLAP_LEFT;
artool->flag = RGN_FLAG_HIDDEN;
}
- if (arprops==NULL) {
+ if (arprops == NULL) {
/* add extra subdivided region for tool properties */
- arprops= MEM_callocN(sizeof(ARegion), "tool props for view3d");
+ arprops = MEM_callocN(sizeof(ARegion), "tool props for view3d");
BLI_insertlinkafter(&sa->regionbase, artool, arprops);
- arprops->regiontype= RGN_TYPE_TOOL_PROPS;
- arprops->alignment= RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV;
+ arprops->regiontype = RGN_TYPE_TOOL_PROPS;
+ arprops->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV;
}
return artool;
@@ -138,12 +138,12 @@ ARegion *view3d_has_tools_region(ScrArea *sa)
/* function to always find a regionview3d context inside 3D window */
RegionView3D *ED_view3d_context_rv3d(bContext *C)
{
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
- if (rv3d==NULL) {
+ if (rv3d == NULL) {
ScrArea *sa = CTX_wm_area(C);
if (sa && sa->spacetype == SPACE_VIEW3D) {
- ARegion *ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+ ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
if (ar) {
rv3d = ar->regiondata;
}
@@ -156,33 +156,33 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C)
* so return that, the caller can then access the ar->regiondata */
int ED_view3d_context_user_region(bContext *C, View3D **v3d_r, ARegion **ar_r)
{
- ScrArea *sa= CTX_wm_area(C);
+ ScrArea *sa = CTX_wm_area(C);
*v3d_r = NULL;
*ar_r = NULL;
- if (sa && sa->spacetype==SPACE_VIEW3D) {
- ARegion *ar= CTX_wm_region(C);
+ if (sa && sa->spacetype == SPACE_VIEW3D) {
+ ARegion *ar = CTX_wm_region(C);
View3D *v3d = (View3D *)sa->spacedata.first;
if (ar) {
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
if (rv3d && rv3d->viewlock == 0) {
*v3d_r = v3d;
*ar_r = ar;
return 1;
}
else {
- ARegion *ar_unlock_user= NULL;
- ARegion *ar_unlock= NULL;
- for (ar= sa->regionbase.first; ar; ar= ar->next) {
+ ARegion *ar_unlock_user = NULL;
+ ARegion *ar_unlock = NULL;
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
/* find the first unlocked rv3d */
if (ar->regiondata && ar->regiontype == RGN_TYPE_WINDOW) {
- rv3d= ar->regiondata;
+ rv3d = ar->regiondata;
if (rv3d->viewlock == 0) {
- ar_unlock= ar;
- if (rv3d->persp==RV3D_PERSP || rv3d->persp==RV3D_CAMOB) {
- ar_unlock_user= ar;
+ ar_unlock = ar;
+ if (rv3d->persp == RV3D_PERSP || rv3d->persp == RV3D_CAMOB) {
+ ar_unlock_user = ar;
break;
}
}
@@ -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);
}
@@ -243,24 +243,24 @@ void ED_view3d_init_mats_rv3d_gl(struct Object *ob, struct RegionView3D *rv3d)
static SpaceLink *view3d_new(const bContext *C)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
ARegion *ar;
View3D *v3d;
RegionView3D *rv3d;
- v3d= MEM_callocN(sizeof(View3D), "initview3d");
- v3d->spacetype= SPACE_VIEW3D;
- v3d->blockscale= 0.7f;
- v3d->lay= v3d->layact= 1;
+ v3d = MEM_callocN(sizeof(View3D), "initview3d");
+ v3d->spacetype = SPACE_VIEW3D;
+ v3d->blockscale = 0.7f;
+ v3d->lay = v3d->layact = 1;
if (scene) {
- v3d->lay= v3d->layact= scene->lay;
- v3d->camera= scene->camera;
+ v3d->lay = v3d->layact = scene->lay;
+ v3d->camera = scene->camera;
}
- v3d->scenelock= TRUE;
- v3d->grid= 1.0f;
- v3d->gridlines= 16;
+ v3d->scenelock = TRUE;
+ v3d->grid = 1.0f;
+ v3d->gridlines = 16;
v3d->gridsubdiv = 10;
- v3d->drawtype= OB_SOLID;
+ v3d->drawtype = OB_SOLID;
v3d->gridflag |= V3D_SHOW_X;
v3d->gridflag |= V3D_SHOW_Y;
@@ -270,60 +270,60 @@ static SpaceLink *view3d_new(const bContext *C)
v3d->flag |= V3D_SELECT_OUTLINE;
v3d->flag2 |= V3D_SHOW_RECONSTRUCTION;
- v3d->lens= 35.0f;
- v3d->near= 0.01f;
- v3d->far= 1000.0f;
+ v3d->lens = 35.0f;
+ v3d->near = 0.01f;
+ v3d->far = 1000.0f;
v3d->twflag |= U.tw_flag & V3D_USE_MANIPULATOR;
- v3d->twtype= V3D_MANIP_TRANSLATE;
- v3d->around= V3D_CENTROID;
+ v3d->twtype = V3D_MANIP_TRANSLATE;
+ v3d->around = V3D_CENTROID;
- v3d->bundle_size= 0.2f;
- v3d->bundle_drawtype= OB_PLAINAXES;
+ v3d->bundle_size = 0.2f;
+ v3d->bundle_drawtype = OB_PLAINAXES;
/* header */
- ar= MEM_callocN(sizeof(ARegion), "header for view3d");
+ ar = MEM_callocN(sizeof(ARegion), "header for view3d");
BLI_addtail(&v3d->regionbase, ar);
- ar->regiontype= RGN_TYPE_HEADER;
- ar->alignment= RGN_ALIGN_BOTTOM;
+ ar->regiontype = RGN_TYPE_HEADER;
+ ar->alignment = RGN_ALIGN_BOTTOM;
/* tool shelf */
- ar= MEM_callocN(sizeof(ARegion), "toolshelf for view3d");
+ ar = MEM_callocN(sizeof(ARegion), "toolshelf for view3d");
BLI_addtail(&v3d->regionbase, ar);
- ar->regiontype= RGN_TYPE_TOOLS;
- ar->alignment= RGN_ALIGN_LEFT;
+ ar->regiontype = RGN_TYPE_TOOLS;
+ ar->alignment = RGN_ALIGN_LEFT;
ar->flag = RGN_FLAG_HIDDEN;
/* tool properties */
- ar= MEM_callocN(sizeof(ARegion), "tool properties for view3d");
+ ar = MEM_callocN(sizeof(ARegion), "tool properties for view3d");
BLI_addtail(&v3d->regionbase, ar);
- ar->regiontype= RGN_TYPE_TOOL_PROPS;
- ar->alignment= RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV;
+ ar->regiontype = RGN_TYPE_TOOL_PROPS;
+ ar->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV;
ar->flag = RGN_FLAG_HIDDEN;
/* buttons/list view */
- ar= MEM_callocN(sizeof(ARegion), "buttons for view3d");
+ ar = MEM_callocN(sizeof(ARegion), "buttons for view3d");
BLI_addtail(&v3d->regionbase, ar);
- ar->regiontype= RGN_TYPE_UI;
- ar->alignment= RGN_ALIGN_RIGHT;
+ ar->regiontype = RGN_TYPE_UI;
+ ar->alignment = RGN_ALIGN_RIGHT;
ar->flag = RGN_FLAG_HIDDEN;
/* main area */
- ar= MEM_callocN(sizeof(ARegion), "main area for view3d");
+ ar = MEM_callocN(sizeof(ARegion), "main area for view3d");
BLI_addtail(&v3d->regionbase, ar);
- ar->regiontype= RGN_TYPE_WINDOW;
+ ar->regiontype = RGN_TYPE_WINDOW;
- ar->regiondata= MEM_callocN(sizeof(RegionView3D), "region view3d");
- rv3d= ar->regiondata;
- rv3d->viewquat[0]= 1.0f;
- rv3d->persp= RV3D_PERSP;
- rv3d->view= RV3D_VIEW_PERSPORTHO;
- rv3d->dist= 10.0;
+ ar->regiondata = MEM_callocN(sizeof(RegionView3D), "region view3d");
+ rv3d = ar->regiondata;
+ rv3d->viewquat[0] = 1.0f;
+ rv3d->persp = RV3D_PERSP;
+ rv3d->view = RV3D_VIEW_PERSPORTHO;
+ rv3d->dist = 10.0;
return (SpaceLink *)v3d;
}
@@ -331,12 +331,8 @@ static SpaceLink *view3d_new(const bContext *C)
/* not spacelink itself */
static void view3d_free(SpaceLink *sl)
{
- View3D *vd= (View3D *) 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);
@@ -353,18 +349,17 @@ static void view3d_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa))
static SpaceLink *view3d_duplicate(SpaceLink *sl)
{
- View3D *v3do= (View3D *)sl;
- View3D *v3dn= MEM_dupallocN(sl);
- BGpic *bgpic;
+ View3D *v3do = (View3D *)sl;
+ View3D *v3dn = MEM_dupallocN(sl);
/* clear or remove stuff from old */
// XXX BIF_view3d_previewrender_free(v3do);
if (v3do->localvd) {
- v3do->localvd= NULL;
- v3do->properties_storage= NULL;
- v3do->lay= v3dn->localvd->lay;
+ v3do->localvd = NULL;
+ v3do->properties_storage = NULL;
+ v3do->lay = v3dn->localvd->lay;
v3do->lay &= 0xFFFFFF;
}
@@ -374,11 +369,8 @@ 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;
+ v3dn->properties_storage = NULL;
return (SpaceLink *)v3dn;
}
@@ -392,76 +384,76 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar)
/* object ops. */
/* important to be before Pose keymap since they can both be enabled at once */
- keymap= WM_keymap_find(wm->defaultconf, "Face Mask", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Face Mask", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Weight Paint Vertex Selection", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Weight Paint Vertex Selection", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
/* pose is not modal, operator poll checks for this */
- keymap= WM_keymap_find(wm->defaultconf, "Pose", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Pose", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Object Mode", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Object Mode", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Image Paint", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Image Paint", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Vertex Paint", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Vertex Paint", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Weight Paint", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Weight Paint", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Sculpt", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Sculpt", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Mesh", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Mesh", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Curve", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Curve", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Armature", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Armature", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Pose", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Pose", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Metaball", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Metaball", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Lattice", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Lattice", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
/* armature sketching needs to take over mouse */
- keymap= WM_keymap_find(wm->defaultconf, "Armature Sketch", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Armature Sketch", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Particle", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Particle", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
/* editfont keymap swallows all... */
- keymap= WM_keymap_find(wm->defaultconf, "Font", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Font", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Object Non-modal", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Object Non-modal", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Frames", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Frames", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
/* own keymap, last so modes can override it */
- keymap= WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "3D View", SPACE_VIEW3D, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "3D View", SPACE_VIEW3D, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
/* add drop boxes */
- lb= WM_dropboxmap_find("View3D", SPACE_VIEW3D, RGN_TYPE_WINDOW);
+ lb = WM_dropboxmap_find("View3D", SPACE_VIEW3D, RGN_TYPE_WINDOW);
WM_event_add_dropbox_handler(&ar->handlers, lb);
@@ -469,9 +461,9 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar)
static int view3d_ob_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
- if (drag->type==WM_DRAG_ID) {
- ID *id= (ID *)drag->poin;
- if ( GS(id->name)==ID_OB )
+ if (drag->type == WM_DRAG_ID) {
+ ID *id = (ID *)drag->poin;
+ if (GS(id->name) == ID_OB)
return 1;
}
return 0;
@@ -479,9 +471,9 @@ static int view3d_ob_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSE
static int view3d_mat_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
- if (drag->type==WM_DRAG_ID) {
- ID *id= (ID *)drag->poin;
- if ( GS(id->name)==ID_MA )
+ if (drag->type == WM_DRAG_ID) {
+ ID *id = (ID *)drag->poin;
+ if (GS(id->name) == ID_MA)
return 1;
}
return 0;
@@ -489,13 +481,13 @@ static int view3d_mat_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUS
static int view3d_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
{
- if (drag->type==WM_DRAG_ID) {
- ID *id= (ID *)drag->poin;
- if ( GS(id->name)==ID_IM )
+ if (drag->type == WM_DRAG_ID) {
+ ID *id = (ID *)drag->poin;
+ if (GS(id->name) == ID_IM)
return 1;
}
- else if (drag->type==WM_DRAG_PATH) {
- if (ELEM(drag->icon, 0, ICON_FILE_IMAGE)) /* rule might not work? */
+ else if (drag->type == WM_DRAG_PATH) {
+ if (ELEM(drag->icon, 0, ICON_FILE_IMAGE)) /* rule might not work? */
return 1;
}
return 0;
@@ -504,7 +496,7 @@ static int view3d_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUS
static int view3d_ima_bg_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
{
- if ( ED_view3d_give_base_under_cursor(C, event->mval) ) {
+ if (ED_view3d_give_base_under_cursor(C, event->mval) ) {
return 0;
}
return view3d_ima_drop_poll(C, drag, event);
@@ -512,7 +504,7 @@ static int view3d_ima_bg_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
static int view3d_ima_ob_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
{
- if ( ED_view3d_give_base_under_cursor(C, event->mval) ) {
+ if (ED_view3d_give_base_under_cursor(C, event->mval) ) {
return view3d_ima_drop_poll(C, drag, event);
}
return 0;
@@ -520,30 +512,30 @@ static int view3d_ima_ob_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
static void view3d_ob_drop_copy(wmDrag *drag, wmDropBox *drop)
{
- ID *id= (ID *)drag->poin;
+ ID *id = (ID *)drag->poin;
PointerRNA ptr;
/* need to put name in sub-operator in macro */
- ptr= RNA_pointer_get(drop->ptr, "OBJECT_OT_add_named");
+ ptr = RNA_pointer_get(drop->ptr, "OBJECT_OT_add_named");
if (ptr.data)
- RNA_string_set(&ptr, "name", id->name+2);
+ RNA_string_set(&ptr, "name", id->name + 2);
else
- RNA_string_set(drop->ptr, "name", id->name+2);
+ RNA_string_set(drop->ptr, "name", id->name + 2);
}
static void view3d_id_drop_copy(wmDrag *drag, wmDropBox *drop)
{
- ID *id= (ID *)drag->poin;
+ ID *id = (ID *)drag->poin;
- RNA_string_set(drop->ptr, "name", id->name+2);
+ RNA_string_set(drop->ptr, "name", id->name + 2);
}
static void view3d_id_path_drop_copy(wmDrag *drag, wmDropBox *drop)
{
- ID *id= (ID *)drag->poin;
+ ID *id = (ID *)drag->poin;
if (id)
- RNA_string_set(drop->ptr, "name", id->name+2);
+ RNA_string_set(drop->ptr, "name", id->name + 2);
if (drag->path[0])
RNA_string_set(drop->ptr, "filepath", drag->path);
}
@@ -552,7 +544,7 @@ static void view3d_id_path_drop_copy(wmDrag *drag, wmDropBox *drop)
/* region dropbox definition */
static void view3d_dropboxes(void)
{
- ListBase *lb= WM_dropboxmap_find("View3D", SPACE_VIEW3D, RGN_TYPE_WINDOW);
+ ListBase *lb = WM_dropboxmap_find("View3D", SPACE_VIEW3D, RGN_TYPE_WINDOW);
WM_dropbox_add(lb, "OBJECT_OT_add_named_cursor", view3d_ob_drop_poll, view3d_ob_drop_copy);
WM_dropbox_add(lb, "OBJECT_OT_drop_named_material", view3d_mat_drop_poll, view3d_id_drop_copy);
@@ -565,7 +557,7 @@ static void view3d_dropboxes(void)
/* type callback, not region itself */
static void view3d_main_area_free(ARegion *ar)
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
if (rv3d) {
if (rv3d->localvd) MEM_freeN(rv3d->localvd);
@@ -583,7 +575,7 @@ static void view3d_main_area_free(ARegion *ar)
MEM_freeN(rv3d->depths);
}
MEM_freeN(rv3d);
- ar->regiondata= NULL;
+ ar->regiondata = NULL;
}
}
@@ -591,20 +583,20 @@ static void view3d_main_area_free(ARegion *ar)
static void *view3d_main_area_duplicate(void *poin)
{
if (poin) {
- RegionView3D *rv3d= poin, *new;
+ RegionView3D *rv3d = poin, *new;
- new= MEM_dupallocN(rv3d);
+ new = MEM_dupallocN(rv3d);
if (rv3d->localvd)
- new->localvd= MEM_dupallocN(rv3d->localvd);
+ new->localvd = MEM_dupallocN(rv3d->localvd);
if (rv3d->clipbb)
- new->clipbb= MEM_dupallocN(rv3d->clipbb);
+ new->clipbb = MEM_dupallocN(rv3d->clipbb);
- new->depths= NULL;
- new->ri= NULL;
- new->render_engine= NULL;
- new->gpd= NULL;
- new->sms= NULL;
- new->smooth_timer= NULL;
+ new->depths = NULL;
+ new->ri = NULL;
+ new->render_engine = NULL;
+ new->gpd = NULL;
+ new->sms = NULL;
+ new->smooth_timer = NULL;
return new;
}
@@ -613,28 +605,28 @@ static void *view3d_main_area_duplicate(void *poin)
static void view3d_recalc_used_layers(ARegion *ar, wmNotifier *wmn, Scene *scene)
{
- wmWindow *win= wmn->wm->winactive;
+ wmWindow *win = wmn->wm->winactive;
ScrArea *sa;
- unsigned int lay_used= 0;
+ unsigned int lay_used = 0;
Base *base;
if (!win) return;
- base= scene->base.first;
+ base = scene->base.first;
while (base) {
- lay_used |= base->lay & ((1<<20)-1); /* ignore localview */
+ lay_used |= base->lay & ((1 << 20) - 1); /* ignore localview */
- if (lay_used == (1<<20)-1)
+ if (lay_used == (1 << 20) - 1)
break;
- base= base->next;
+ base = base->next;
}
- for (sa= win->screen->areabase.first; sa; sa= sa->next) {
+ for (sa = win->screen->areabase.first; sa; sa = sa->next) {
if (sa->spacetype == SPACE_VIEW3D) {
if (BLI_findindex(&sa->regionbase, ar) != -1) {
- View3D *v3d= sa->spacedata.first;
- v3d->lay_used= lay_used;
+ View3D *v3d = sa->spacedata.first;
+ v3d->lay_used = lay_used;
break;
}
}
@@ -646,9 +638,9 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
bScreen *sc;
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_ANIMATION:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_KEYFRAME_PROP:
case ND_NLA_ACTCHANGE:
ED_region_tag_redraw(ar);
@@ -665,7 +657,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
}
break;
case NC_SCENE:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_LAYER_CONTENT:
view3d_recalc_used_layers(ar, wmn, wmn->reference);
ED_region_tag_redraw(ar);
@@ -688,7 +680,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
ED_region_tag_redraw(ar);
break;
case NC_OBJECT:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_BONE_ACTIVE:
case ND_BONE_SELECT:
case ND_TRANSFORM:
@@ -701,20 +693,20 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
ED_region_tag_redraw(ar);
break;
}
- switch(wmn->action) {
+ switch (wmn->action) {
case NA_ADDED:
ED_region_tag_redraw(ar);
break;
}
break;
case NC_GEOM:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_DATA:
case ND_SELECT:
ED_region_tag_redraw(ar);
break;
}
- switch(wmn->action) {
+ switch (wmn->action) {
case NA_EDITED:
ED_region_tag_redraw(ar);
break;
@@ -729,20 +721,20 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
ED_region_tag_redraw_overlay(ar);
break;
case NC_MATERIAL:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_SHADING_DRAW:
ED_region_tag_redraw(ar);
break;
}
break;
case NC_WORLD:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_WORLD_DRAW:
/* handled by space_view3d_listener() for v3d access */
break;
case ND_WORLD_STARS:
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
if (rv3d->persp == RV3D_CAMOB) {
ED_region_tag_redraw(ar);
}
@@ -750,7 +742,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
}
break;
case NC_LAMP:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_LIGHTING_DRAW:
ED_region_tag_redraw(ar);
break;
@@ -766,13 +758,13 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
ED_region_tag_redraw(ar);
break;
case NC_MOVIECLIP:
- if (wmn->data==ND_DISPLAY)
+ if (wmn->data == ND_DISPLAY)
ED_region_tag_redraw(ar);
break;
case NC_SPACE:
if (wmn->data == ND_SPACE_VIEW3D) {
if (wmn->subtype == NS_VIEW3D_GPU) {
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
rv3d->rflag |= RV3D_GPULIGHT_UPDATE;
}
ED_region_tag_redraw(ar);
@@ -783,7 +775,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
ED_region_tag_redraw(ar);
break;
case NC_SCREEN:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_GPENCIL:
case ND_ANIMPLAY:
case ND_SKETCH:
@@ -794,7 +786,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
case ND_SCREENSET:
/* screen was changed, need to update used layers due to NC_SCENE|ND_LAYER_CONTENT */
/* updates used layers only for View3D in active screen */
- sc= wmn->reference;
+ sc = wmn->reference;
view3d_recalc_used_layers(ar, wmn, sc->scene);
ED_region_tag_redraw(ar);
break;
@@ -807,7 +799,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
/* concept is to retrieve cursor type context-less */
static void view3d_main_area_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegion *UNUSED(ar))
{
- Scene *scene= win->screen->scene;
+ Scene *scene = win->screen->scene;
if (scene->obedit) {
WM_cursor_set(win, CURSOR_EDIT);
@@ -820,7 +812,7 @@ static void view3d_main_area_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegion
/* add handlers, stuff you only do once or on area/region changes */
static void view3d_header_area_init(wmWindowManager *wm, ARegion *ar)
{
- wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
+ wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
@@ -835,9 +827,9 @@ static void view3d_header_area_draw(const bContext *C, ARegion *ar)
static void view3d_header_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_SCENE:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_FRAME:
case ND_OB_ACTIVE:
case ND_OB_SELECT:
@@ -864,7 +856,7 @@ static void view3d_buttons_area_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap= WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -876,9 +868,9 @@ static void view3d_buttons_area_draw(const bContext *C, ARegion *ar)
static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_ANIMATION:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_KEYFRAME_PROP:
case ND_NLA_ACTCHANGE:
ED_region_tag_redraw(ar);
@@ -891,7 +883,7 @@ static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
}
break;
case NC_SCENE:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_FRAME:
case ND_OB_ACTIVE:
case ND_OB_SELECT:
@@ -903,14 +895,14 @@ static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
ED_region_tag_redraw(ar);
break;
}
- switch(wmn->action) {
+ switch (wmn->action) {
case NA_EDITED:
ED_region_tag_redraw(ar);
break;
}
break;
case NC_OBJECT:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_BONE_ACTIVE:
case ND_BONE_SELECT:
case ND_TRANSFORM:
@@ -923,7 +915,7 @@ static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
}
break;
case NC_GEOM:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_DATA:
case ND_SELECT:
ED_region_tag_redraw(ar);
@@ -938,7 +930,7 @@ static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
ED_region_tag_redraw(ar);
break;
case NC_BRUSH:
- if (wmn->action==NA_EDITED)
+ if (wmn->action == NA_EDITED)
ED_region_tag_redraw(ar);
break;
case NC_SPACE:
@@ -963,7 +955,7 @@ static void view3d_tools_area_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap= WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -975,7 +967,7 @@ static void view3d_tools_area_draw(const bContext *C, ARegion *ar)
static void view3d_props_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_WM:
if (wmn->data == ND_HISTORY)
ED_region_tag_redraw(ar);
@@ -997,9 +989,9 @@ static void space_view3d_listener(struct ScrArea *sa, struct wmNotifier *wmn)
View3D *v3d = sa->spacedata.first;
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_SCENE:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_WORLD:
if (v3d->flag2 & V3D_RENDER_OVERRIDE)
ED_area_tag_redraw_regiontype(sa, RGN_TYPE_WINDOW);
@@ -1007,7 +999,7 @@ static void space_view3d_listener(struct ScrArea *sa, struct wmNotifier *wmn)
}
break;
case NC_WORLD:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_WORLD_DRAW:
if (v3d->flag2 & V3D_RENDER_OVERRIDE)
ED_area_tag_redraw_regiontype(sa, RGN_TYPE_WINDOW);
@@ -1015,7 +1007,7 @@ static void space_view3d_listener(struct ScrArea *sa, struct wmNotifier *wmn)
}
break;
case NC_MATERIAL:
- switch(wmn->data) {
+ switch (wmn->data) {
case ND_NODES:
if (v3d->drawtype == OB_TEXTURE)
ED_area_tag_redraw_regiontype(sa, RGN_TYPE_WINDOW);
@@ -1043,25 +1035,26 @@ static void space_view3d_listener(struct ScrArea *sa, struct wmNotifier *wmn)
const char *view3d_context_dir[] = {
"selected_objects", "selected_bases", "selected_editable_objects",
"selected_editable_bases", "visible_objects", "visible_bases", "selectable_objects", "selectable_bases",
- "active_base", "active_object", NULL};
+ "active_base", "active_object", NULL
+};
static int view3d_context(const bContext *C, const char *member, bContextDataResult *result)
{
- View3D *v3d= CTX_wm_view3d(C);
- Scene *scene= CTX_data_scene(C);
+ View3D *v3d = CTX_wm_view3d(C);
+ Scene *scene = CTX_data_scene(C);
Base *base;
/* fallback to the scene layer, allows duplicate and other object operators to run outside the 3d view */
- unsigned int lay = v3d ? v3d->lay:scene->lay;
+ unsigned int lay = v3d ? v3d->lay : scene->lay;
if (CTX_data_dir(member)) {
CTX_data_dir_set(result, view3d_context_dir);
}
else if (CTX_data_equals(member, "selected_objects") || CTX_data_equals(member, "selected_bases")) {
- int selected_objects= CTX_data_equals(member, "selected_objects");
+ int selected_objects = CTX_data_equals(member, "selected_objects");
- for (base=scene->base.first; base; base=base->next) {
+ for (base = scene->base.first; base; base = base->next) {
if ((base->flag & SELECT) && (base->lay & lay)) {
- if ((base->object->restrictflag & OB_RESTRICT_VIEW)==0) {
+ if ((base->object->restrictflag & OB_RESTRICT_VIEW) == 0) {
if (selected_objects)
CTX_data_id_list_add(result, &base->object->id);
else
@@ -1073,12 +1066,12 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes
return 1;
}
else if (CTX_data_equals(member, "selected_editable_objects") || CTX_data_equals(member, "selected_editable_bases")) {
- int selected_editable_objects= CTX_data_equals(member, "selected_editable_objects");
+ int selected_editable_objects = CTX_data_equals(member, "selected_editable_objects");
- for (base=scene->base.first; base; base=base->next) {
+ for (base = scene->base.first; base; base = base->next) {
if ((base->flag & SELECT) && (base->lay & lay)) {
- if ((base->object->restrictflag & OB_RESTRICT_VIEW)==0) {
- if (0==object_is_libdata(base->object)) {
+ if ((base->object->restrictflag & OB_RESTRICT_VIEW) == 0) {
+ if (0 == object_is_libdata(base->object)) {
if (selected_editable_objects)
CTX_data_id_list_add(result, &base->object->id);
else
@@ -1091,11 +1084,11 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes
return 1;
}
else if (CTX_data_equals(member, "visible_objects") || CTX_data_equals(member, "visible_bases")) {
- int visible_objects= CTX_data_equals(member, "visible_objects");
+ int visible_objects = CTX_data_equals(member, "visible_objects");
- for (base=scene->base.first; base; base=base->next) {
+ for (base = scene->base.first; base; base = base->next) {
if (base->lay & lay) {
- if ((base->object->restrictflag & OB_RESTRICT_VIEW)==0) {
+ if ((base->object->restrictflag & OB_RESTRICT_VIEW) == 0) {
if (visible_objects)
CTX_data_id_list_add(result, &base->object->id);
else
@@ -1107,11 +1100,11 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes
return 1;
}
else if (CTX_data_equals(member, "selectable_objects") || CTX_data_equals(member, "selectable_bases")) {
- int selectable_objects= CTX_data_equals(member, "selectable_objects");
+ int selectable_objects = CTX_data_equals(member, "selectable_objects");
- for (base=scene->base.first; base; base=base->next) {
+ for (base = scene->base.first; base; base = base->next) {
if (base->lay & lay) {
- if ((base->object->restrictflag & OB_RESTRICT_VIEW)==0 && (base->object->restrictflag & OB_RESTRICT_SELECT)==0) {
+ if ((base->object->restrictflag & OB_RESTRICT_VIEW) == 0 && (base->object->restrictflag & OB_RESTRICT_SELECT) == 0) {
if (selectable_objects)
CTX_data_id_list_add(result, &base->object->id);
else
@@ -1124,14 +1117,14 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes
}
else if (CTX_data_equals(member, "active_base")) {
if (scene->basact && (scene->basact->lay & lay))
- if ((scene->basact->object->restrictflag & OB_RESTRICT_VIEW)==0)
+ if ((scene->basact->object->restrictflag & OB_RESTRICT_VIEW) == 0)
CTX_data_pointer_set(result, &scene->id, &RNA_ObjectBase, scene->basact);
return 1;
}
else if (CTX_data_equals(member, "active_object")) {
if (scene->basact && (scene->basact->lay & lay))
- if ((scene->basact->object->restrictflag & OB_RESTRICT_VIEW)==0)
+ if ((scene->basact->object->restrictflag & OB_RESTRICT_VIEW) == 0)
CTX_data_id_pointer_set(result, &scene->basact->object->id);
return 1;
@@ -1147,56 +1140,56 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes
/* only called once, from space/spacetypes.c */
void ED_spacetype_view3d(void)
{
- SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype view3d");
+ SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype view3d");
ARegionType *art;
- st->spaceid= SPACE_VIEW3D;
+ st->spaceid = SPACE_VIEW3D;
strncpy(st->name, "View3D", BKE_ST_MAXNAME);
- st->new= view3d_new;
- st->free= view3d_free;
- st->init= view3d_init;
+ st->new = view3d_new;
+ st->free = view3d_free;
+ st->init = view3d_init;
st->listener = space_view3d_listener;
- st->duplicate= view3d_duplicate;
- st->operatortypes= view3d_operatortypes;
- st->keymap= view3d_keymap;
- st->dropboxes= view3d_dropboxes;
- st->context= view3d_context;
+ st->duplicate = view3d_duplicate;
+ st->operatortypes = view3d_operatortypes;
+ st->keymap = view3d_keymap;
+ st->dropboxes = view3d_dropboxes;
+ st->context = view3d_context;
/* regions: main window */
- art= MEM_callocN(sizeof(ARegionType), "spacetype view3d main region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype view3d main region");
art->regionid = RGN_TYPE_WINDOW;
- art->keymapflag= ED_KEYMAP_GPENCIL;
- art->draw= view3d_main_area_draw;
- art->init= view3d_main_area_init;
- art->free= view3d_main_area_free;
- art->duplicate= view3d_main_area_duplicate;
- art->listener= view3d_main_area_listener;
- art->cursor= view3d_main_area_cursor;
- art->lock= 1; /* can become flag, see BKE_spacedata_draw_locks */
+ art->keymapflag = ED_KEYMAP_GPENCIL;
+ art->draw = view3d_main_area_draw;
+ art->init = view3d_main_area_init;
+ art->free = view3d_main_area_free;
+ art->duplicate = view3d_main_area_duplicate;
+ art->listener = view3d_main_area_listener;
+ art->cursor = view3d_main_area_cursor;
+ art->lock = 1; /* can become flag, see BKE_spacedata_draw_locks */
BLI_addhead(&st->regiontypes, art);
/* regions: listview/buttons */
- art= MEM_callocN(sizeof(ARegionType), "spacetype view3d buttons region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype view3d buttons region");
art->regionid = RGN_TYPE_UI;
- art->prefsizex= 180; // XXX
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES;
- art->listener= view3d_buttons_area_listener;
- art->init= view3d_buttons_area_init;
- art->draw= view3d_buttons_area_draw;
+ art->prefsizex = 180; // XXX
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
+ art->listener = view3d_buttons_area_listener;
+ art->init = view3d_buttons_area_init;
+ art->draw = view3d_buttons_area_draw;
BLI_addhead(&st->regiontypes, art);
view3d_buttons_register(art);
/* regions: tool(bar) */
- art= MEM_callocN(sizeof(ARegionType), "spacetype view3d tools region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype view3d tools region");
art->regionid = RGN_TYPE_TOOLS;
- art->prefsizex= 160; // XXX
- art->prefsizey= 50; // XXX
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES;
- art->listener= view3d_buttons_area_listener;
- art->init= view3d_tools_area_init;
- art->draw= view3d_tools_area_draw;
+ art->prefsizex = 160; // XXX
+ art->prefsizey = 50; // XXX
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
+ art->listener = view3d_buttons_area_listener;
+ art->init = view3d_tools_area_init;
+ art->draw = view3d_tools_area_draw;
BLI_addhead(&st->regiontypes, art);
#if 0
@@ -1205,27 +1198,27 @@ void ED_spacetype_view3d(void)
#endif
/* regions: tool properties */
- art= MEM_callocN(sizeof(ARegionType), "spacetype view3d tool properties region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype view3d tool properties region");
art->regionid = RGN_TYPE_TOOL_PROPS;
- art->prefsizex= 0;
- art->prefsizey= 120;
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES;
- art->listener= view3d_props_area_listener;
- art->init= view3d_tools_area_init;
- art->draw= view3d_tools_area_draw;
+ art->prefsizex = 0;
+ art->prefsizey = 120;
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
+ art->listener = view3d_props_area_listener;
+ art->init = view3d_tools_area_init;
+ art->draw = view3d_tools_area_draw;
BLI_addhead(&st->regiontypes, art);
view3d_tool_props_register(art);
/* regions: header */
- art= MEM_callocN(sizeof(ARegionType), "spacetype view3d header region");
+ art = MEM_callocN(sizeof(ARegionType), "spacetype view3d header region");
art->regionid = RGN_TYPE_HEADER;
- art->prefsizey= HEADERY;
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES|ED_KEYMAP_HEADER;
- art->listener= view3d_header_area_listener;
- art->init= view3d_header_area_init;
- art->draw= view3d_header_area_draw;
+ art->prefsizey = HEADERY;
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES | ED_KEYMAP_HEADER;
+ art->listener = view3d_header_area_listener;
+ art->init = view3d_header_area_init;
+ art->draw = view3d_header_area_draw;
BLI_addhead(&st->regiontypes, art);
BKE_spacetype_register(st);
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index 3c4e3b6009c..08d0afb1879 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,53 +79,53 @@
#include "UI_interface.h"
#include "UI_resources.h"
-#include "view3d_intern.h" // own include
+#include "view3d_intern.h" /* own include */
/* ******************* view3d space & buttons ************** */
-#define B_NOP 1
-#define B_REDR 2
-#define B_OBJECTPANELROT 1007
+#define B_NOP 1
+#define B_REDR 2
+#define B_OBJECTPANELROT 1007
#define B_OBJECTPANELMEDIAN 1008
-#define B_ARMATUREPANEL1 1009
-#define B_ARMATUREPANEL2 1010
+#define B_ARMATUREPANEL1 1009
+#define B_ARMATUREPANEL2 1010
#define B_OBJECTPANELPARENT 1011
-#define B_OBJECTPANEL 1012
-#define B_ARMATUREPANEL3 1013
-#define B_OBJECTPANELSCALE 1014
-#define B_OBJECTPANELDIMS 1015
-#define B_TRANSFORMSPACEADD 1016
-#define B_TRANSFORMSPACECLEAR 1017
-#define B_SETPT_AUTO 2125
-#define B_SETPT_VECTOR 2126
-#define B_SETPT_ALIGN 2127
-#define B_SETPT_FREE 2128
-#define B_RECALCMBALL 2501
-
-#define B_WEIGHT0_0 2840
-#define B_WEIGHT1_4 2841
-#define B_WEIGHT1_2 2842
-#define B_WEIGHT3_4 2843
-#define B_WEIGHT1_0 2844
-
-#define B_OPA1_8 2845
-#define B_OPA1_4 2846
-#define B_OPA1_2 2847
-#define B_OPA3_4 2848
-#define B_OPA1_0 2849
-
-#define B_CLR_WPAINT 2850
-
-#define B_RV3D_LOCKED 2900
-#define B_RV3D_BOXVIEW 2901
-#define B_RV3D_BOXCLIP 2902
-
-#define B_IDNAME 3000
+#define B_OBJECTPANEL 1012
+#define B_ARMATUREPANEL3 1013
+#define B_OBJECTPANELSCALE 1014
+#define B_OBJECTPANELDIMS 1015
+#define B_TRANSFORMSPACEADD 1016
+#define B_TRANSFORMSPACECLEAR 1017
+#define B_SETPT_AUTO 2125
+#define B_SETPT_VECTOR 2126
+#define B_SETPT_ALIGN 2127
+#define B_SETPT_FREE 2128
+#define B_RECALCMBALL 2501
+
+#define B_WEIGHT0_0 2840
+#define B_WEIGHT1_4 2841
+#define B_WEIGHT1_2 2842
+#define B_WEIGHT3_4 2843
+#define B_WEIGHT1_0 2844
+
+#define B_OPA1_8 2845
+#define B_OPA1_4 2846
+#define B_OPA1_2 2847
+#define B_OPA3_4 2848
+#define B_OPA1_0 2849
+
+#define B_CLR_WPAINT 2850
+
+#define B_RV3D_LOCKED 2900
+#define B_RV3D_BOXVIEW 2901
+#define B_RV3D_BOXCLIP 2902
+
+#define B_IDNAME 3000
/* 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];
@@ -131,38 +133,68 @@ typedef struct {
float *defweightp;
} TransformProperties;
+/* Helper function to compute a median changed value,
+ * when the value should be clamped in [0.0, 1.0].
+ * Returns either 0.0, 1.0 (both can be applied directly), a positive scale factor
+ * for scale down, or a negative one for scale up.
+ */
+static float compute_scale_factor(const float ve_median, const float median)
+{
+ if (ve_median <= 0.0f)
+ return 0.0f;
+ else if (ve_median >= 1.0f)
+ return 1.0f;
+ else {
+ /* Scale value to target median. */
+ float median_new = ve_median;
+ float median_orig = ve_median - median; /* Previous median value. */
+
+ /* In case of floating point error. */
+ CLAMP(median_orig, 0.0f, 1.0f);
+ CLAMP(median_new, 0.0f, 1.0f);
+
+ if (median_new <= median_orig) {
+ /* Scale down. */
+ return median_new / median_orig;
+ }
+ else {
+ /* Scale up, negative to indicate it... */
+ return -(1.0f - median_new) / (1.0f - median_orig);
+ }
+ }
+}
/* is used for both read and write... */
static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim)
{
- 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);
}
@@ -174,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++) {
- dg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr);
+
+ 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) {
@@ -248,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;
@@ -301,117 +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, "");
- uiBlockBeginAlign(block);
-
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 130, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, "");
- uiButSetUnitType(but, PROP_UNIT_LENGTH);
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 110, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, "");
- uiButSetUnitType(but, PROP_UNIT_LENGTH);
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 90, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, "");
- uiButSetUnitType(but, PROP_UNIT_LENGTH);
-
- if (totw==1) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 70, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, "");
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values");
- uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values");
- uiBlockEndAlign(block);
- if (totweight)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, "");
- if (totradius) {
- if (totradius==1) uiDefButR(block, NUM, 0, "Radius", 0, 20, 200, 20, &radius_ptr, "radius", 0, 0.0, 100.0, 10, 3, NULL);
- else uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs");
- }
- }
- else {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values");
- uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values");
- uiBlockEndAlign(block);
- if (totweight)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 40, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, "");
- if (totradius) {
- if (totradius==1) uiDefButR(block, NUM, 0, "Radius", 0, 40, 200, 20, &radius_ptr, "radius", 0, 0.0, 100.0, 10, 3, NULL);
- else uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 40, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs");
- }
- }
+ 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, "");
- uiBlockBeginAlign(block);
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 130, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, "");
- uiButSetUnitType(but, PROP_UNIT_LENGTH);
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 110, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, "");
- uiButSetUnitType(but, PROP_UNIT_LENGTH);
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 90, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, "");
- uiButSetUnitType(but, PROP_UNIT_LENGTH);
- if (totw==tot) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 70, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, "");
- uiBlockEndAlign(block);
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values");
- uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values");
- uiBlockEndAlign(block);
- if (totweight)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, "Weight is used for SoftBody Goal");
- if (totradius)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs");
- uiBlockEndAlign(block);
- }
- else {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values");
- uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values");
- uiBlockEndAlign(block);
- if (totweight)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 40, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, "Weight is used for SoftBody Goal");
- if (totradius)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs");
- uiBlockEndAlign(block);
- }
+ uiDefBut(block, LABEL, 0, IFACE_("Median:"), 0, 150, 200, 20, NULL, 0, 0, 0, 0, "");
}
- 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, "");
+ uiBlockBeginAlign(block);
+
+ /* 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, "");
+ uiButSetUnitType(but, PROP_UNIT_LENGTH);
+ but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 90, 200, 20,
+ &(tfp->ve_median[2]), -lim, lim, 10, 3, "");
+ uiButSetUnitType(but, PROP_UNIT_LENGTH);
+
+ if (totw == tot) {
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 70, 200, 20,
+ &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, "");
}
- 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, "");
+
+ uiBlockBeginAlign(block);
+ 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, 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, 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, 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, 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, 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, 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,60 +444,41 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
add_v3_v3(eve->co, median);
}
}
-
- EDBM_RecalcNormals(em);
+
+ EDBM_mesh_normals_update(em);
}
-
+
if (median[3] != 0.0f) {
BMEdge *eed;
- const float fixed_crease= (ve_median[3] <= 0.0f ? 0.0f : (ve_median[3] >= 1.0f ? 1.0f : FLT_MAX));
-
- if (fixed_crease != FLT_MAX) {
- /* simple case */
+ const float sca = compute_scale_factor(ve_median[3], median[3]);
+ if (ELEM(sca, 0.0f, 1.0f)) {
BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
float *crease = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_CREASE);
- if (!crease) break;
-
- *crease= fixed_crease;
+ if (crease) {
+ *crease = sca;
+ }
}
}
}
- else {
- /* scale crease to target median */
- float median_new= ve_median[3];
- float median_orig= ve_median[3] - median[3]; /* previous median value */
-
- /* incase of floating point error */
- CLAMP(median_orig, 0.0f, 1.0f);
- CLAMP(median_new, 0.0f, 1.0f);
-
- if (median_new < median_orig) {
- /* scale down */
- const float sca= median_new / median_orig;
-
- BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
- if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
- float *crease = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_CREASE);
-
- if (!crease) break;
-
+ else if (sca > 0.0f) {
+ BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
+ float *crease = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_CREASE);
+ if (crease) {
*crease *= sca;
CLAMP(*crease, 0.0f, 1.0f);
}
}
}
- else {
- /* scale up */
- const float sca= (1.0f - median_new) / (1.0f - median_orig);
-
- BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
- if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
- float *crease = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_CREASE);
- if (!crease) break;
-
- *crease = 1.0f - ((1.0f - *crease) * sca);
+ }
+ else {
+ BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
+ float *crease = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_CREASE);
+ if (crease) {
+ *crease = 1.0f + ((1.0f - *crease) * sca);
CLAMP(*crease, 0.0f, 1.0f);
}
}
@@ -487,81 +488,75 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
if (median[6] != 0.0f) {
BMEdge *eed;
- const float fixed_bweight = (ve_median[6] <= 0.0f ? 0.0f : (ve_median[6] >= 1.0f ? 1.0f : FLT_MAX));
-
- if (fixed_bweight != FLT_MAX) {
- /* simple case */
+ const float sca = compute_scale_factor(ve_median[6], median[6]);
+ if (ELEM(sca, 0.0f, 1.0f)) {
BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
float *bweight = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_BWEIGHT);
- if (!bweight) break;
-
- *bweight = fixed_bweight;
+ if (bweight) {
+ *bweight = sca;
+ }
}
}
}
- else {
- /* scale crease to target median */
- float median_new = ve_median[6];
- float median_orig = ve_median[6] - median[6]; /* previous median value */
-
- /* incase of floating point error */
- CLAMP(median_orig, 0.0f, 1.0f);
- CLAMP(median_new, 0.0f, 1.0f);
-
- if (median_new < median_orig) {
- /* scale down */
- const float sca = median_new / median_orig;
-
- BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
- if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
- float *bweight = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_BWEIGHT);
- if (!bweight) break;
-
+ else if (sca > 0.0f) {
+ BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
+ float *bweight = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_BWEIGHT);
+ if (bweight) {
*bweight *= sca;
CLAMP(*bweight, 0.0f, 1.0f);
}
}
}
- else {
- /* scale up */
- const float sca = (1.0f - median_new) / (1.0f - median_orig);
-
- BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
- if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
- float *bweight = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_BWEIGHT);
- if (!bweight) break;
-
- *bweight = 1.0f - ((1.0f - *bweight) * sca);
+ }
+ else {
+ BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
+ float *bweight = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_BWEIGHT);
+ if (bweight) {
+ *bweight = 1.0f + ((1.0f - *bweight) * sca);
CLAMP(*bweight, 0.0f, 1.0f);
}
}
}
}
}
- EDBM_RecalcNormals(em);
+ EDBM_mesh_normals_update(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);
add_v3_v3(bezt->vec[1], median);
add_v3_v3(bezt->vec[2], median);
- bezt->weight+= median[4];
- bezt->radius+= median[5];
+
+ if (median[4] != 0.0f) {
+ if (ELEM(scale_w, 0.0f, 1.0f)) {
+ bezt->weight = scale_w;
+ }
+ else {
+ bezt->weight = scale_w > 0.0f ? bezt->weight * scale_w :
+ 1.0f + ((1.0f - bezt->weight) * scale_w);
+ CLAMP(bezt->weight, 0.0f, 1.0f);
+ }
+ }
+
+ bezt->radius += median[5];
}
else {
if (bezt->f1 & SELECT) {
@@ -575,14 +570,25 @@ 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->weight+= median[4];
- bp->radius+= median[5];
+ bp->vec[3] += median[3];
+
+ if (median[4] != 0.0f) {
+ if (ELEM(scale_w, 0.0f, 1.0f)) {
+ bp->weight = scale_w;
+ }
+ else {
+ bp->weight = scale_w > 0.0f ? bp->weight * scale_w :
+ 1.0f + ((1.0f - bp->weight) * scale_w);
+ CLAMP(bp->weight, 0.0f, 1.0f);
+ }
+ }
+
+ bp->radius += median[5];
}
bp++;
}
@@ -590,26 +596,37 @@ 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;
-
- a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
- bp= lt->editlatt->latt->def;
+ const float scale_w = compute_scale_factor(ve_median[4], median[4]);
+
+ a = lt->editlatt->latt->pntsu * lt->editlatt->latt->pntsv * lt->editlatt->latt->pntsw;
+ bp = lt->editlatt->latt->def;
while (a--) {
if (bp->f1 & SELECT) {
add_v3_v3(bp->vec, median);
- bp->weight+= median[4];
+
+ if (median[4] != 0.0f) {
+ if (ELEM(scale_w, 0.0f, 1.0f)) {
+ bp->weight = scale_w;
+ }
+ else {
+ bp->weight = scale_w > 0.0f ? bp->weight * scale_w :
+ 1.0f + ((1.0f - bp->weight) * scale_w);
+ CLAMP(bp->weight, 0.0f, 1.0f);
+ }
+ }
}
bp++;
}
}
-
-// ED_undo_push(C, "Transform properties");
+
+/* ED_undo_push(C, "Transform properties"); */
}
}
#define B_VGRP_PNL_COPY 1
@@ -619,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;
@@ -631,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);
}
}
}
@@ -685,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);
@@ -720,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);
@@ -768,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) {
@@ -798,19 +813,20 @@ 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);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data);
}
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;
@@ -822,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;
@@ -840,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++) {
- dg = BLI_findlink (&ob->defbase, dw->def_nr);
+ 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);
}
}
@@ -866,162 +886,162 @@ 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);
+ 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);
-
- if (!pchan) {
- uiItemL(layout, "No Bone Active", ICON_NONE);
- return;
+/* row = uiLayoutRow(layout, 0); */
+
+ if (!pchan) {
+ 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) {
float quat[4];
/* convert to euler, passing through quats... */
axis_angle_to_quat(quat, pchan->rotAxis, pchan->rotAngle);
- quat_to_eul( tfp->ob_eul,quat);
+ quat_to_eul(tfp->ob_eul, quat);
}
else if (pchan->rotmode == ROT_MODE_QUAT)
- quat_to_eul( tfp->ob_eul,pchan->quat);
+ quat_to_eul(tfp->ob_eul, pchan->quat);
else
copy_v3_v3(tfp->ob_eul, pchan->eul);
- 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, "");
+ 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, "");
uiBlockBeginAlign(block);
-
- but= uiDefButF(block, NUM, B_ARMATUREPANEL2, "X:", 0, 220, 120, 19, pchan->loc, -lim, lim, 100, 3, "");
+
+ 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, "");
+ but = uiDefButF(block, NUM, B_ARMATUREPANEL2, "Y:", 0, 200, 120, 19, pchan->loc + 1, -lim, lim, 100, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
- but= uiDefButF(block, NUM, B_ARMATUREPANEL2, "Z:", 0, 180, 120, 19, pchan->loc+2, -lim, lim, 100, 3, "");
+ 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");
+ 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, "");
+
+ 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, "");
+ 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");
+ 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, "");
+
+ 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, "");
+ 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");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEZ, B_REDR, ICON_UNLOCKED, 125, 20, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects z Scale value from being Transformed");
+ 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");
+ uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEZ, B_REDR, ICON_UNLOCKED, 125, 20, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects z Scale value from being Transformed");
uiBlockEndAlign(block);
#endif
}
@@ -1030,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 */
@@ -1039,339 +1059,345 @@ 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);
- if (ebone->parent && ebone->flag & BONE_CONNECTED ) {
+ 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) {
-
- 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;
+ 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;
-
+ 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;
- else {
- DAG_scene_sort(bmain, scene);
- DAG_id_tag_update(&ob->id, OB_RECALC_OB);
+
+ case B_OBJECTPANELPARENT:
+ if (ob) {
+ if (ob->id.lib || BKE_object_parent_loop_check(ob->parent, ob))
+ ob->parent = NULL;
+ else {
+ DAG_scene_sort(bmain, scene);
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB);
+ }
}
- }
- break;
-
+ 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);
+
+ case B_ARMATUREPANEL2:
+ 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);
}
break;
- case B_TRANSFORMSPACEADD:
- {
- char names[sizeof(((TransformOrientation *)NULL)->name)]= "";
- BIF_createTransformOrientation(C, NULL, names, 1, 0);
- break;
- }
- case B_TRANSFORMSPACECLEAR:
- BIF_clearTransformOrientation(C);
- break;
-
-#if 0 // XXX
- case B_WEIGHT0_0:
- wpaint->weight = 0.0f;
- break;
-
- case B_WEIGHT1_4:
- wpaint->weight = 0.25f;
- break;
- case B_WEIGHT1_2:
- wpaint->weight = 0.5f;
- break;
- case B_WEIGHT3_4:
- wpaint->weight = 0.75f;
- break;
- case B_WEIGHT1_0:
- wpaint->weight = 1.0f;
- break;
-
- case B_OPA1_8:
- wpaint->a = 0.125f;
- break;
- case B_OPA1_4:
- wpaint->a = 0.25f;
- break;
- case B_OPA1_2:
- wpaint->a = 0.5f;
- break;
- case B_OPA3_4:
- wpaint->a = 0.75f;
- break;
- case B_OPA1_0:
- wpaint->a = 1.0f;
- break;
+
+ case B_TRANSFORMSPACECLEAR:
+ BIF_clearTransformOrientation(C);
+ break;
+
+#if 0 /* XXX */
+ case B_WEIGHT0_0:
+ wpaint->weight = 0.0f;
+ break;
+
+ case B_WEIGHT1_4:
+ wpaint->weight = 0.25f;
+ break;
+ case B_WEIGHT1_2:
+ wpaint->weight = 0.5f;
+ break;
+ case B_WEIGHT3_4:
+ wpaint->weight = 0.75f;
+ break;
+ case B_WEIGHT1_0:
+ wpaint->weight = 1.0f;
+ break;
+
+ case B_OPA1_8:
+ wpaint->a = 0.125f;
+ break;
+ case B_OPA1_4:
+ wpaint->a = 0.25f;
+ break;
+ case B_OPA1_2:
+ wpaint->a = 0.5f;
+ break;
+ case B_OPA3_4:
+ wpaint->a = 0.75f;
+ break;
+ case B_OPA1_0:
+ wpaint->a = 1.0f;
+ break;
#endif
- case B_CLR_WPAINT:
-// if (!multires_level1_test()) {
+ case B_CLR_WPAINT:
+/* if (!multires_level1_test()) { */
{
- bDeformGroup *defGroup = BLI_findlink(&ob->defbase, ob->actdef-1);
+ 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++)
- ED_vgroup_vert_remove (ob, defGroup, 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:
+
+ 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;
}
/* default for now */
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
}
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)) {
+ 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);
}
@@ -1382,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);
@@ -1417,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 1fdffbed42c..59a19782f1d 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -65,7 +65,7 @@
#include "BKE_movieclip.h"
#include "RE_engine.h"
-#include "RE_pipeline.h" // make_stars
+#include "RE_pipeline.h" // make_stars
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
@@ -92,7 +92,7 @@
#include "GPU_material.h"
#include "GPU_extensions.h"
-#include "view3d_intern.h" // own include
+#include "view3d_intern.h" // own include
@@ -102,7 +102,7 @@ static void star_stuff_init_func(void)
glPointSize(1.0);
glBegin(GL_POINTS);
}
-static void star_stuff_vertex_func(float* i)
+static void star_stuff_vertex_func(float*i)
{
glVertex3fv(i);
}
@@ -121,7 +121,7 @@ void circf(float x, float y, float rad)
glTranslatef(x, y, 0.);
- gluDisk( qobj, 0.0, rad, 32, 1);
+ gluDisk(qobj, 0.0, rad, 32, 1);
glPopMatrix();
@@ -138,7 +138,7 @@ void circ(float x, float y, float rad)
glTranslatef(x, y, 0.);
- gluDisk( qobj, 0.0, rad, 32, 1);
+ gluDisk(qobj, 0.0, rad, 32, 1);
glPopMatrix();
@@ -150,21 +150,21 @@ void circ(float x, float y, float rad)
static void view3d_draw_clipping(RegionView3D *rv3d)
{
- BoundBox *bb= rv3d->clipbb;
+ BoundBox *bb = rv3d->clipbb;
if (bb) {
- static unsigned int clipping_index[6][4]= {{0, 1, 2, 3},
- {0, 4, 5, 1},
- {4, 7, 6, 5},
- {7, 3, 2, 6},
- {1, 5, 6, 2},
- {7, 4, 0, 3}};
+ static unsigned int clipping_index[6][4] = {{0, 1, 2, 3},
+ {0, 4, 5, 1},
+ {4, 7, 6, 5},
+ {7, 3, 2, 6},
+ {1, 5, 6, 2},
+ {7, 4, 0, 3}};
UI_ThemeColorShade(TH_BACK, -8);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, bb->vec);
- glDrawElements(GL_QUADS, sizeof(clipping_index)/sizeof(unsigned int), GL_UNSIGNED_INT, clipping_index);
+ glDrawElements(GL_QUADS, sizeof(clipping_index) / sizeof(unsigned int), GL_UNSIGNED_INT, clipping_index);
glDisableClientState(GL_VERTEX_ARRAY);
}
@@ -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);
+ x += (wx);
+ y += (wy);
/* set fixed 'Y' */
- verts[0][1]= 0.0f;
- verts[1][1]= (float)ar->winy;
+ verts[0][1] = 0.0f;
+ 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);
@@ -247,11 +247,11 @@ 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[0][0] = 0.0f;
+ 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;
@@ -265,37 +265,34 @@ static void drawgrid_draw(ARegion *ar, float wx, float wy, float x, float y, flo
static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **grid_unit)
{
/* extern short bgpicmode; */
- RegionView3D *rv3d= ar->regiondata;
- float wx, wy, x, y, fw, fx, fy, dx;
- float vec4[4];
+ RegionView3D *rv3d = ar->regiondata;
+ 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);
+ wx = (ar->winx / 2.0); /* because of rounding errors, grid at wrong location */
+ wy = (ar->winy / 2.0);
- x= (wx)*fx/fw;
- y= (wy)*fy/fw;
+ x = (wx) * fx / fw;
+ y = (wy) * fy / fw;
- vec4[0]=vec4[1]= v3d->grid;
+ vec4[0] = vec4[1] = v3d->grid;
- vec4[2]= 0.0;
- vec4[3]= 1.0;
- mul_m4_v4(rv3d->persmat, vec4);
- fx= vec4[0];
- fy= vec4[1];
- fw= vec4[3];
+ vec4[2] = 0.0;
+ vec4[3] = 1.0;
+ mul_m4_v4d(rv3d->persmat, vec4);
+ fx = vec4[0];
+ fy = vec4[1];
+ fw = vec4[3];
- dx= fabs(x-(wx)*fx/fw);
- if (dx==0) dx= fabs(y-(wy)*fy/fw);
+ dx = fabs(x - (wx) * fx / fw);
+ if (dx == 0) dx = fabs(y - (wy) * fy / fw);
- glDepthMask(0); // disable write in zbuffer
+ glDepthMask(0); // disable write in zbuffer
/* check zoom out */
UI_ThemeColor(TH_GRID);
@@ -305,29 +302,29 @@ 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);
if (usys) {
- i= len;
+ 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))
+ if (dx_scalar < (GRID_MIN_PX * 2))
continue;
/* Store the smallest drawn grid size units name so users know how big each grid cell is */
- if (*grid_unit==NULL) {
- *grid_unit= bUnit_GetNameDisplay(usys, i);
- rv3d->gridview= (scalar * v3d->grid) / unit->scale_length;
+ if (*grid_unit == NULL) {
+ *grid_unit = bUnit_GetNameDisplay(usys, i);
+ rv3d->gridview = (scalar * v3d->grid) / unit->scale_length;
}
- blend_fac= 1-((GRID_MIN_PX*2)/dx_scalar);
+ blend_fac = 1 - ((GRID_MIN_PX * 2) / dx_scalar);
/* tweak to have the fade a bit nicer */
- blend_fac= (blend_fac * blend_fac) * 2.0f;
+ blend_fac = (blend_fac * blend_fac) * 2.0f;
CLAMP(blend_fac, 0.3f, 1.0f);
@@ -340,83 +337,83 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
else {
short sublines = v3d->gridsubdiv;
- if (dx<GRID_MIN_PX) {
- rv3d->gridview*= sublines;
- dx*= sublines;
-
- if (dx<GRID_MIN_PX) {
- rv3d->gridview*= sublines;
- dx*= sublines;
-
- if (dx<GRID_MIN_PX) {
- rv3d->gridview*= sublines;
- dx*=sublines;
- if (dx<GRID_MIN_PX);
+ if (dx < GRID_MIN_PX) {
+ rv3d->gridview *= sublines;
+ dx *= sublines;
+
+ if (dx < GRID_MIN_PX) {
+ rv3d->gridview *= sublines;
+ dx *= sublines;
+
+ if (dx < GRID_MIN_PX) {
+ rv3d->gridview *= sublines;
+ dx *= sublines;
+ if (dx < GRID_MIN_PX) ;
else {
UI_ThemeColor(TH_GRID);
drawgrid_draw(ar, wx, wy, x, y, dx);
}
}
- else { // start blending out
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/(GRID_MIN_PX*6));
+ else { // start blending out
+ UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX * 6));
drawgrid_draw(ar, wx, wy, x, y, dx);
UI_ThemeColor(TH_GRID);
- drawgrid_draw(ar, wx, wy, x, y, sublines*dx);
+ drawgrid_draw(ar, wx, wy, x, y, sublines * dx);
}
}
- else { // start blending out (GRID_MIN_PX < dx < (GRID_MIN_PX*10))
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/(GRID_MIN_PX*6));
+ else { // start blending out (GRID_MIN_PX < dx < (GRID_MIN_PX*10))
+ UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX * 6));
drawgrid_draw(ar, wx, wy, x, y, dx);
UI_ThemeColor(TH_GRID);
- drawgrid_draw(ar, wx, wy, x, y, sublines*dx);
+ drawgrid_draw(ar, wx, wy, x, y, sublines * dx);
}
}
else {
- if (dx>(GRID_MIN_PX*10)) { // start blending in
- rv3d->gridview/= sublines;
- dx/= sublines;
- if (dx>(GRID_MIN_PX*10)) { // start blending in
- rv3d->gridview/= sublines;
- dx/= sublines;
- if (dx>(GRID_MIN_PX*10)) {
+ if (dx > (GRID_MIN_PX * 10)) { // start blending in
+ rv3d->gridview /= sublines;
+ dx /= sublines;
+ if (dx > (GRID_MIN_PX * 10)) { // start blending in
+ rv3d->gridview /= sublines;
+ dx /= sublines;
+ if (dx > (GRID_MIN_PX * 10)) {
UI_ThemeColor(TH_GRID);
drawgrid_draw(ar, wx, wy, x, y, dx);
}
else {
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/(GRID_MIN_PX*6));
+ UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX * 6));
drawgrid_draw(ar, wx, wy, x, y, dx);
UI_ThemeColor(TH_GRID);
- drawgrid_draw(ar, wx, wy, x, y, dx*sublines);
+ drawgrid_draw(ar, wx, wy, x, y, dx * sublines);
}
}
else {
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/(GRID_MIN_PX*6));
+ UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX * 6));
drawgrid_draw(ar, wx, wy, x, y, dx);
UI_ThemeColor(TH_GRID);
- drawgrid_draw(ar, wx, wy, x, y, dx*sublines);
+ drawgrid_draw(ar, wx, wy, x, y, dx * sublines);
}
}
else {
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/(GRID_MIN_PX*6));
+ UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX * 6));
drawgrid_draw(ar, wx, wy, x, y, dx);
UI_ThemeColor(TH_GRID);
- drawgrid_draw(ar, wx, wy, x, y, dx*sublines);
+ drawgrid_draw(ar, wx, wy, x, y, dx * sublines);
}
}
}
- x+= (wx);
- y+= (wy);
+ x += (wx);
+ y += (wy);
UI_GetThemeColor3ubv(TH_GRID, col);
setlinestyle(0);
/* center cross */
/* horizontal line */
- if ( ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
+ if (ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
UI_make_axis_color(col, col2, 'Y');
else UI_make_axis_color(col, col2, 'X');
glColor3ubv(col2);
@@ -424,14 +421,14 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
fdrawline(0.0, y, (float)ar->winx, y);
/* vertical line */
- if ( ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
+ if (ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
UI_make_axis_color(col, col2, 'Y');
else UI_make_axis_color(col, col2, 'Z');
glColor3ubv(col2);
fdrawline(x, 0.0, x, (float)ar->winy);
- glDepthMask(1); // enable write in zbuffer
+ glDepthMask(1); // enable write in zbuffer
}
#undef GRID_MIN_PX
@@ -439,11 +436,11 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit)
{
float grid, grid_scale;
unsigned char col_grid[3];
- const int gridlines= v3d->gridlines/2;
+ const int gridlines = v3d->gridlines / 2;
- if (v3d->gridlines<3) return;
+ if (v3d->gridlines < 3) return;
- grid_scale= v3d->grid;
+ grid_scale = v3d->grid;
/* use 'grid_scale' instead of 'v3d->grid' from now on */
/* apply units */
@@ -454,53 +451,53 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit)
bUnit_GetSystem(&usys, &len, scene->unit.system, B_UNIT_LENGTH);
if (usys) {
- int i= bUnit_GetBaseUnit(usys);
- *grid_unit= bUnit_GetNameDisplay(usys, i);
+ int i = bUnit_GetBaseUnit(usys);
+ *grid_unit = bUnit_GetNameDisplay(usys, i);
grid_scale = (grid_scale * (float)bUnit_GetScaler(usys, i)) / scene->unit.scale_length;
}
}
- grid= gridlines * grid_scale;
+ grid = gridlines * grid_scale;
- if (v3d->zbuf && scene->obedit) glDepthMask(0); // for zbuffer-select
+ if (v3d->zbuf && scene->obedit) glDepthMask(0); // for zbuffer-select
UI_GetThemeColor3ubv(TH_GRID, col_grid);
/* draw the Y axis and/or grid lines */
if (v3d->gridflag & V3D_SHOW_FLOOR) {
- float vert[4][3]= {{0.0f}};
+ float vert[4][3] = {{0.0f}};
unsigned char col_bg[3];
unsigned char col_grid_emphasise[3], col_grid_light[3];
int a;
- int prev_emphasise= -1;
+ int prev_emphasise = -1;
UI_GetThemeColor3ubv(TH_BACK, col_bg);
/* emphasise division lines lighter instead of darker, if background is darker than grid */
UI_GetColorPtrShade3ubv(col_grid, col_grid_light, 10);
UI_GetColorPtrShade3ubv(col_grid, col_grid_emphasise,
- (((col_grid[0]+col_grid[1]+col_grid[2])+30) >
- (col_bg[0]+col_bg[1]+col_bg[2])) ? 20 : -10);
+ (((col_grid[0] + col_grid[1] + col_grid[2]) + 30) >
+ (col_bg[0] + col_bg[1] + col_bg[2])) ? 20 : -10);
/* set fixed axis */
- vert[0][0]= vert[2][1]= grid;
- vert[1][0]= vert[3][1]= -grid;
+ vert[0][0] = vert[2][1] = grid;
+ vert[1][0] = vert[3][1] = -grid;
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, vert);
- for (a= -gridlines;a<=gridlines;a++) {
- const float line= a * grid_scale;
- const int is_emphasise= (a % 10) == 0;
+ for (a = -gridlines; a <= gridlines; a++) {
+ const float line = a * grid_scale;
+ const int is_emphasise = (a % 10) == 0;
if (is_emphasise != prev_emphasise) {
glColor3ubv(is_emphasise ? col_grid_emphasise : col_grid_light);
- prev_emphasise= is_emphasise;
+ prev_emphasise = is_emphasise;
}
/* set variable axis */
- vert[0][1]= vert[1][1]=
- vert[2][0]= vert[3][0]= line;
+ vert[0][1] = vert[1][1] =
+ vert[2][0] = vert[3][0] = line;
glDrawArrays(GL_LINES, 0, 4);
}
@@ -514,21 +511,22 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit)
/* check for the 'show Z axis' preference */
if (v3d->gridflag & (V3D_SHOW_X | V3D_SHOW_Y | V3D_SHOW_Z)) {
int axis;
- for (axis= 0; axis < 3; axis++)
- if (v3d->gridflag & (V3D_SHOW_X << axis)) {
- float vert[3];
- unsigned char tcol[3];
-
- UI_make_axis_color(col_grid, tcol, 'X' + axis);
- glColor3ubv(tcol);
-
- glBegin(GL_LINE_STRIP);
- zero_v3(vert);
- vert[axis]= grid;
- glVertex3fv(vert );
- vert[axis]= -grid;
- glVertex3fv(vert);
- glEnd();
+ for (axis = 0; axis < 3; axis++) {
+ if (v3d->gridflag & (V3D_SHOW_X << axis)) {
+ float vert[3];
+ unsigned char tcol[3];
+
+ UI_make_axis_color(col_grid, tcol, 'X' + axis);
+ glColor3ubv(tcol);
+
+ glBegin(GL_LINE_STRIP);
+ zero_v3(vert);
+ vert[axis] = grid;
+ glVertex3fv(vert);
+ vert[axis] = -grid;
+ glVertex3fv(vert);
+ glEnd();
+ }
}
}
@@ -544,16 +542,16 @@ static void drawcursor(Scene *scene, ARegion *ar, View3D *v3d)
int mx, my, co[2];
int flag;
- /* we dont want the clipping for cursor */
- flag= v3d->flag;
- v3d->flag= 0;
+ /* we don't want the clipping for cursor */
+ flag = v3d->flag;
+ v3d->flag = 0;
project_int(ar, give_cursor(scene, v3d), co);
- v3d->flag= flag;
+ v3d->flag = flag;
mx = co[0];
my = co[1];
- if (mx!=IS_CLIPPED) {
+ if (mx != IS_CLIPPED) {
setlinestyle(0);
cpack(0xFF);
circ((float)mx, (float)my, 10.0);
@@ -563,10 +561,10 @@ static void drawcursor(Scene *scene, ARegion *ar, View3D *v3d)
setlinestyle(0);
cpack(0x0);
- sdrawline(mx-20, my, mx-5, my);
- sdrawline(mx+5, my, mx+20, my);
- sdrawline(mx, my-20, mx, my-5);
- sdrawline(mx, my+5, mx, my+20);
+ sdrawline(mx - 20, my, mx - 5, my);
+ sdrawline(mx + 5, my, mx + 20, my);
+ sdrawline(mx, my - 20, mx, my - 5);
+ sdrawline(mx, my + 5, mx, my + 20);
}
}
@@ -576,9 +574,9 @@ static void draw_view_axis(RegionView3D *rv3d)
{
const float k = U.rvisize; /* axis size */
const float toll = 0.5; /* used to see when view is quasi-orthogonal */
- const float start = k + 1.0f;/* axis center in screen coordinates, x=y */
+ const float start = k + 1.0f; /* axis center in screen coordinates, x=y */
float ydisp = 0.0; /* vertical displacement to allow obj info text */
- int bright = 25*(float)U.rvibright + 5; /* axis alpha (rvibright has range 0-10) */
+ int bright = 25 * (float)U.rvibright + 5; /* axis alpha (rvibright has range 0-10) */
float vec[3];
float dx, dy;
@@ -657,7 +655,7 @@ static void draw_rotation_guide(RegionView3D *rv3d)
float o[3]; // center of rotation
float end[3]; // endpoints for drawing
- float color[4] = {0.f ,0.4235f, 1.f, 1.f}; // bright blue so it matches device LEDs
+ float color[4] = {0.0f, 0.4235f, 1.0f, 1.0f}; // bright blue so it matches device LEDs
negate_v3_v3(o, rv3d->ofs);
@@ -696,7 +694,7 @@ static void draw_rotation_guide(RegionView3D *rv3d)
// -- draw ring around rotation center --
{
-#define ROT_AXIS_DETAIL 13
+#define ROT_AXIS_DETAIL 13
const float s = 0.05f * scale;
const float step = 2.f * (float)(M_PI / ROT_AXIS_DETAIL);
@@ -729,18 +727,18 @@ static void draw_rotation_guide(RegionView3D *rv3d)
}
glEnd();
-#undef ROT_AXIS_DETAIL
+#undef ROT_AXIS_DETAIL
}
color[3] = 1.f; // solid dot
}
else
- color[3] = 0.5f; // see-through dot
+ color[3] = 0.5f; // see-through dot
// -- draw rotation center --
glColor4fv(color);
glBegin(GL_POINTS);
- glVertex3fv(o);
+ glVertex3fv(o);
glEnd();
// find screen coordinates for rotation center, then draw pretty icon
@@ -757,12 +755,12 @@ static void draw_view_icon(RegionView3D *rv3d)
{
BIFIconID icon;
- if ( ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
- icon= ICON_AXIS_TOP;
- else if ( ELEM(rv3d->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
- icon= ICON_AXIS_FRONT;
- else if ( ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
- icon= ICON_AXIS_SIDE;
+ if (ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
+ icon = ICON_AXIS_TOP;
+ else if (ELEM(rv3d->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
+ icon = ICON_AXIS_FRONT;
+ else if (ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
+ icon = ICON_AXIS_SIDE;
else return;
glEnable(GL_BLEND);
@@ -804,7 +802,7 @@ static const char *view3d_get_name(View3D *v3d, RegionView3D *rv3d)
break;
default:
- if (rv3d->persp==RV3D_CAMOB) {
+ if (rv3d->persp == RV3D_CAMOB) {
if ((v3d->camera) && (v3d->camera->type == OB_CAMERA)) {
Camera *cam;
cam = v3d->camera->data;
@@ -825,63 +823,63 @@ static const char *view3d_get_name(View3D *v3d, RegionView3D *rv3d)
static void draw_viewport_name(ARegion *ar, View3D *v3d)
{
- RegionView3D *rv3d= ar->regiondata;
- const char *name= view3d_get_name(v3d, rv3d);
+ RegionView3D *rv3d = ar->regiondata;
+ const char *name = view3d_get_name(v3d, rv3d);
char tmpstr[24];
if (v3d->localvd) {
BLI_snprintf(tmpstr, sizeof(tmpstr), "%s (Local)", name);
- name= tmpstr;
+ name = tmpstr;
}
if (name) {
UI_ThemeColor(TH_TEXT_HI);
- BLF_draw_default_ascii(22, ar->winy-17, 0.0f, name, sizeof(tmpstr));
+ BLF_draw_default_ascii(22, ar->winy - 17, 0.0f, name, sizeof(tmpstr));
}
}
/* 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;
- short offset=30;
+ short offset = 30;
/* get name of marker on current frame (if available) */
- markern= scene_find_marker_name(scene, CFRA);
+ markern = scene_find_marker_name(scene, CFRA);
/* check if there is an object */
if (ob) {
/* name(s) to display depends on type of object */
- if (ob->type==OB_ARMATURE) {
- bArmature *arm= ob->data;
- char *name= NULL;
+ if (ob->type == OB_ARMATURE) {
+ bArmature *arm = ob->data;
+ char *name = NULL;
/* show name of active bone too (if possible) */
if (arm->edbo) {
if (arm->act_edbone)
- name= ((EditBone *)arm->act_edbone)->name;
+ name = ((EditBone *)arm->act_edbone)->name;
}
else if (ob->mode & OB_MODE_POSE) {
if (arm->act_bone) {
if (arm->act_bone->layer & arm->layer)
- name= arm->act_bone->name;
+ name = arm->act_bone->name;
}
}
if (name && markern)
- BLI_snprintf(info, sizeof(info), "(%d) %s %s <%s>", CFRA, ob->id.name+2, name, markern);
+ BLI_snprintf(info, sizeof(info), "(%d) %s %s <%s>", CFRA, ob->id.name + 2, name, markern);
else if (name)
- BLI_snprintf(info, sizeof(info), "(%d) %s %s", CFRA, ob->id.name+2, name);
+ BLI_snprintf(info, sizeof(info), "(%d) %s %s", CFRA, ob->id.name + 2, name);
else
- BLI_snprintf(info, sizeof(info), "(%d) %s", CFRA, ob->id.name+2);
+ BLI_snprintf(info, sizeof(info), "(%d) %s", CFRA, ob->id.name + 2);
}
else if (ELEM3(ob->type, OB_MESH, OB_LATTICE, OB_CURVE)) {
- Key *key= NULL;
+ Key *key = NULL;
KeyBlock *kb = NULL;
char shapes[MAX_NAME + 10];
@@ -889,7 +887,7 @@ static void draw_selected_name(Scene *scene, Object *ob)
shapes[0] = '\0';
key = ob_get_key(ob);
if (key) {
- kb = BLI_findlink(&key->block, ob->shapenr-1);
+ kb = BLI_findlink(&key->block, ob->shapenr - 1);
if (kb) {
BLI_snprintf(shapes, sizeof(shapes), ": %s ", kb->name);
if (ob->shapeflag == OB_SHAPE_LOCK) {
@@ -899,20 +897,20 @@ static void draw_selected_name(Scene *scene, Object *ob)
}
if (markern)
- BLI_snprintf(info, sizeof(info), "(%d) %s %s <%s>", CFRA, ob->id.name+2, shapes, markern);
+ BLI_snprintf(info, sizeof(info), "(%d) %s %s <%s>", CFRA, ob->id.name + 2, shapes, markern);
else
- BLI_snprintf(info, sizeof(info), "(%d) %s %s", CFRA, ob->id.name+2, shapes);
+ BLI_snprintf(info, sizeof(info), "(%d) %s %s", CFRA, ob->id.name + 2, shapes);
}
else {
/* standard object */
if (markern)
- BLI_snprintf(info, sizeof(info), "(%d) %s <%s>", CFRA, ob->id.name+2, markern);
+ BLI_snprintf(info, sizeof(info), "(%d) %s <%s>", CFRA, ob->id.name + 2, markern);
else
- BLI_snprintf(info, sizeof(info), "(%d) %s", CFRA, ob->id.name+2);
+ BLI_snprintf(info, sizeof(info), "(%d) %s", CFRA, ob->id.name + 2);
}
/* color depends on whether there is a keyframe */
- if (id_frame_has_keyframe((ID *)ob, /*BKE_curframe(scene)*/(float)(CFRA), ANIMFILTER_KEYS_LOCAL))
+ if (id_frame_has_keyframe((ID *)ob, /*BKE_curframe(scene)*/ (float)(CFRA), ANIMFILTER_KEYS_LOCAL))
UI_ThemeColor(TH_VERTEX_SELECT);
else
UI_ThemeColor(TH_TEXT_HI);
@@ -944,25 +942,25 @@ static void view3d_camera_border(Scene *scene, ARegion *ar, View3D *v3d, RegionV
camera_params_init(&params);
camera_params_from_view3d(&params, v3d, rv3d);
if (no_zoom)
- params.zoom= 1.0f;
+ params.zoom = 1.0f;
camera_params_compute_viewplane(&params, ar->winx, ar->winy, 1.0f, 1.0f);
- rect_view= params.viewplane;
+ rect_view = params.viewplane;
/* get camera viewplane */
camera_params_init(&params);
camera_params_from_object(&params, v3d->camera);
if (no_shift) {
- params.shiftx= 0.0f;
- params.shifty= 0.0f;
+ params.shiftx = 0.0f;
+ params.shifty = 0.0f;
}
camera_params_compute_viewplane(&params, scene->r.xsch, scene->r.ysch, scene->r.xasp, scene->r.yasp);
- rect_camera= params.viewplane;
+ rect_camera = params.viewplane;
/* get camera border within viewport */
- viewborder_r->xmin= ((rect_camera.xmin - rect_view.xmin)/(rect_view.xmax - rect_view.xmin))*ar->winx;
- viewborder_r->xmax= ((rect_camera.xmax - rect_view.xmin)/(rect_view.xmax - rect_view.xmin))*ar->winx;
- viewborder_r->ymin= ((rect_camera.ymin - rect_view.ymin)/(rect_view.ymax - rect_view.ymin))*ar->winy;
- viewborder_r->ymax= ((rect_camera.ymax - rect_view.ymin)/(rect_view.ymax - rect_view.ymin))*ar->winy;
+ viewborder_r->xmin = ((rect_camera.xmin - rect_view.xmin) / (rect_view.xmax - rect_view.xmin)) * ar->winx;
+ viewborder_r->xmax = ((rect_camera.xmax - rect_view.xmin) / (rect_view.xmax - rect_view.xmin)) * ar->winx;
+ viewborder_r->ymin = ((rect_camera.ymin - rect_view.ymin) / (rect_view.ymax - rect_view.ymin)) * ar->winy;
+ viewborder_r->ymax = ((rect_camera.ymax - rect_view.ymin) / (rect_view.ymax - rect_view.ymin)) * ar->winy;
}
void ED_view3d_calc_camera_border_size(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, float size_r[2])
@@ -970,8 +968,8 @@ void ED_view3d_calc_camera_border_size(Scene *scene, ARegion *ar, View3D *v3d, R
rctf viewborder;
view3d_camera_border(scene, ar, v3d, rv3d, &viewborder, TRUE, TRUE);
- size_r[0]= viewborder.xmax - viewborder.xmin;
- size_r[1]= viewborder.ymax - viewborder.ymin;
+ size_r[0] = viewborder.xmax - viewborder.xmin;
+ size_r[1] = viewborder.ymax - viewborder.ymin;
}
void ED_view3d_calc_camera_border(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d,
@@ -984,10 +982,10 @@ static void drawviewborder_grid3(float x1, float x2, float y1, float y2, float f
{
float x3, y3, x4, y4;
- x3= x1 + fac * (x2-x1);
- y3= y1 + fac * (y2-y1);
- x4= x1 + (1.0f - fac) * (x2-x1);
- y4= y1 + (1.0f - fac) * (y2-y1);
+ x3 = x1 + fac * (x2 - x1);
+ y3 = y1 + fac * (y2 - y1);
+ x4 = x1 + (1.0f - fac) * (x2 - x1);
+ y4 = y1 + (1.0f - fac) * (y2 - y1);
glBegin(GL_LINES);
glVertex2f(x1, y3);
@@ -1008,13 +1006,13 @@ static void drawviewborder_grid3(float x1, float x2, float y1, float y2, float f
static void drawviewborder_triangle(float x1, float x2, float y1, float y2, const char golden, const char dir)
{
float ofs;
- float w= x2 - x1;
- float h= y2 - y1;
+ float w = x2 - x1;
+ float h = y2 - y1;
glBegin(GL_LINES);
if (w > h) {
if (golden) {
- ofs = w * (1.0f-(1.0f/1.61803399f));
+ ofs = w * (1.0f - (1.0f / 1.61803399f));
}
else {
ofs = h * (h / w);
@@ -1032,7 +1030,7 @@ static void drawviewborder_triangle(float x1, float x2, float y1, float y2, cons
}
else {
if (golden) {
- ofs = h * (1.0f-(1.0f/1.61803399f));
+ ofs = h * (1.0f - (1.0f / 1.61803399f));
}
else {
ofs = w * (w / h);
@@ -1058,32 +1056,32 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
float x1i, x2i, y1i, y2i;
float x3, y3, x4, y4;
rctf viewborder;
- Camera *ca= NULL;
- RegionView3D *rv3d= (RegionView3D *)ar->regiondata;
+ Camera *ca = NULL;
+ RegionView3D *rv3d = (RegionView3D *)ar->regiondata;
- if (v3d->camera==NULL)
+ if (v3d->camera == NULL)
return;
- if (v3d->camera->type==OB_CAMERA)
+ if (v3d->camera->type == OB_CAMERA)
ca = v3d->camera->data;
ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &viewborder, FALSE);
/* the offsets */
- x1= viewborder.xmin;
- y1= viewborder.ymin;
- x2= viewborder.xmax;
- y2= viewborder.ymax;
+ x1 = viewborder.xmin;
+ y1 = viewborder.ymin;
+ x2 = viewborder.xmax;
+ y2 = viewborder.ymax;
/* apply offsets so the real 3D camera shows through */
/* note: quite un-scientific but without this bit extra
* 0.0001 on the lower left the 2D border sometimes
* obscures the 3D camera border */
- /* note: with VIEW3D_CAMERA_BORDER_HACK defined this error isn't noticable
- * but keep it here incase we need to remove the workaround */
- x1i= (int)(x1 - 1.0001f);
- y1i= (int)(y1 - 1.0001f);
- x2i= (int)(x2 + (1.0f-0.0001f));
- y2i= (int)(y2 + (1.0f-0.0001f));
+ /* note: with VIEW3D_CAMERA_BORDER_HACK defined this error isn't noticeable
+ * 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));
+ y2i = (int)(y2 + (1.0f - 0.0001f));
/* passepartout, specified in camera edit buttons */
if (ca && (ca->flag & CAM_SHOWPASSEPARTOUT) && ca->passepartalpha > 0.000001f) {
@@ -1091,7 +1089,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
glColor3f(0, 0, 0);
}
else {
- glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glColor4f(0, 0, 0, ca->passepartalpha);
}
@@ -1119,8 +1117,8 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
#ifdef VIEW3D_CAMERA_BORDER_HACK
if (view3d_camera_border_hack_test == TRUE) {
glColor4fv(view3d_camera_border_hack_col);
- glRectf(x1i+1, y1i+1, x2i-1, y2i-1);
- view3d_camera_border_hack_test= FALSE;
+ glRectf(x1i + 1, y1i + 1, x2i - 1, y2i - 1);
+ view3d_camera_border_hack_test = FALSE;
}
#endif
@@ -1139,10 +1137,10 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
if (scene->r.mode & R_BORDER) {
cpack(0);
- x3= x1+ scene->r.border.xmin*(x2-x1);
- y3= y1+ scene->r.border.ymin*(y2-y1);
- x4= x1+ scene->r.border.xmax*(x2-x1);
- y4= y1+ scene->r.border.ymax*(y2-y1);
+ x3 = x1 + scene->r.border.xmin * (x2 - x1);
+ y3 = y1 + scene->r.border.ymin * (y2 - y1);
+ x4 = x1 + scene->r.border.xmax * (x2 - x1);
+ y4 = y1 + scene->r.border.ymax * (y2 - y1);
cpack(0x4040FF);
glRectf(x3, y3, x4, y4);
@@ -1153,8 +1151,8 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
if (ca->dtx & CAM_DTX_CENTER) {
UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0);
- x3= x1+ 0.5f*(x2-x1);
- y3= y1+ 0.5f*(y2-y1);
+ x3 = x1 + 0.5f * (x2 - x1);
+ y3 = y1 + 0.5f * (y2 - y1);
glBegin(GL_LINES);
glVertex2f(x1, y3);
@@ -1179,12 +1177,12 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
if (ca->dtx & CAM_DTX_THIRDS) {
UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0);
- drawviewborder_grid3(x1, x2, y1, y2, 1.0f/3.0f);
+ drawviewborder_grid3(x1, x2, y1, y2, 1.0f / 3.0f);
}
if (ca->dtx & CAM_DTX_GOLDEN) {
UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0);
- drawviewborder_grid3(x1, x2, y1, y2, 1.0f-(1.0f/1.61803399f));
+ drawviewborder_grid3(x1, x2, y1, y2, 1.0f - (1.0f / 1.61803399f));
}
if (ca->dtx & CAM_DTX_GOLDEN_TRI_A) {
@@ -1208,15 +1206,15 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
}
if (ca->flag & CAM_SHOWTITLESAFE) {
- fac= 0.1;
+ fac = 0.1;
- a= fac*(x2-x1);
- x1+= a;
- x2-= a;
+ a = fac * (x2 - x1);
+ x1 += a;
+ x2 -= a;
- a= fac*(y2-y1);
- y1+= a;
- y2-= a;
+ a = fac * (y2 - y1);
+ y1 += a;
+ y2 -= a;
UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0);
@@ -1225,33 +1223,33 @@ 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 */
- float sizex= scene->r.xsch*scene->r.xasp;
- float sizey= scene->r.ysch*scene->r.yasp;
+ * 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);
- float sensor_x= ca->sensor_x;
- float sensor_y= (ca->sensor_fit == CAMERA_SENSOR_FIT_AUTO)? ca->sensor_x: ca->sensor_y;
+ float sensor_x = ca->sensor_x;
+ float sensor_y = (ca->sensor_fit == CAMERA_SENSOR_FIT_AUTO) ? ca->sensor_x : ca->sensor_y;
/* determine sensor plane */
rctf rect;
if (sensor_fit == CAMERA_SENSOR_FIT_HOR) {
- float sensor_scale = (x2i-x1i) / sensor_x;
+ float sensor_scale = (x2i - x1i) / sensor_x;
float sensor_height = sensor_scale * sensor_y;
- rect.xmin= x1i;
- rect.xmax= x2i;
- rect.ymin= (y1i + y2i)*0.5f - sensor_height*0.5f;
- rect.ymax= rect.ymin + sensor_height;
+ rect.xmin = x1i;
+ rect.xmax = x2i;
+ rect.ymin = (y1i + y2i) * 0.5f - sensor_height * 0.5f;
+ rect.ymax = rect.ymin + sensor_height;
}
else {
- float sensor_scale = (y2i-y1i) / sensor_y;
+ float sensor_scale = (y2i - y1i) / sensor_y;
float sensor_width = sensor_scale * sensor_x;
- rect.xmin= (x1i + x2i)*0.5f - sensor_width*0.5f;
- rect.xmax= rect.xmin + sensor_width;
- rect.ymin= y1i;
- rect.ymax= y2i;
+ rect.xmin = (x1i + x2i) * 0.5f - sensor_width * 0.5f;
+ rect.xmax = rect.xmin + sensor_width;
+ rect.ymin = y1i;
+ rect.ymax = y2i;
}
/* draw */
@@ -1266,7 +1264,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
/* camera name - draw in highlighted text color */
if (ca && (ca->flag & CAM_SHOWNAME)) {
UI_ThemeColor(TH_TEXT_HI);
- BLF_draw_default(x1i, y1i-15, 0.0f, v3d->camera->id.name+2, sizeof(v3d->camera->id.name)-2);
+ BLF_draw_default(x1i, y1i - 15, 0.0f, v3d->camera->id.name + 2, sizeof(v3d->camera->id.name) - 2);
UI_ThemeColor(TH_WIRE);
}
}
@@ -1275,30 +1273,30 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
struct Base *base = scene->basact;
int multisample_enabled;
rcti winrct;
BLI_assert(ar->regiontype == RGN_TYPE_WINDOW);
- if (base && (base->object->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT) ||
- paint_facesel_test(base->object)))
+ if (base && (base->object->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT) ||
+ paint_facesel_test(base->object)))
{
/* do nothing */
}
else if ((base && (base->object->mode & OB_MODE_TEXTURE_PAINT)) &&
- scene->toolsettings && (scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE))
+ scene->toolsettings && (scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE))
{
/* do nothing */
}
else if ((base && (base->object->mode & OB_MODE_PARTICLE_EDIT)) &&
- v3d->drawtype > OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT))
+ v3d->drawtype > OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT))
{
/* do nothing */
}
- else if (scene->obedit && v3d->drawtype>OB_WIRE &&
- (v3d->flag & V3D_ZBUF_SELECT)) {
+ else if (scene->obedit && v3d->drawtype > OB_WIRE &&
+ (v3d->flag & V3D_ZBUF_SELECT)) {
/* do nothing */
}
else {
@@ -1306,7 +1304,7 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
return;
}
- if ( !(v3d->flag & V3D_INVALID_BACKBUF) ) return;
+ if (!(v3d->flag & V3D_INVALID_BACKBUF) ) return;
// if (test) {
// if (qtest()) {
@@ -1315,12 +1313,12 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
// }
// }
- if (v3d->drawtype > OB_WIRE) v3d->zbuf= TRUE;
+ if (v3d->drawtype > OB_WIRE) v3d->zbuf = TRUE;
/* dithering and AA break color coding, so disable */
glDisable(GL_DITHER);
- multisample_enabled= glIsEnabled(GL_MULTISAMPLE_ARB);
+ multisample_enabled = glIsEnabled(GL_MULTISAMPLE_ARB);
if (multisample_enabled)
glDisable(GL_MULTISAMPLE_ARB);
@@ -1346,10 +1344,10 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
draw_object_backbufsel(scene, v3d, rv3d, base->object);
v3d->flag &= ~V3D_INVALID_BACKBUF;
- ar->swap= 0; /* mark invalid backbuf for wm draw */
+ ar->swap = 0; /* mark invalid backbuf for wm draw */
G.f &= ~G_BACKBUFSEL;
- v3d->zbuf= FALSE;
+ v3d->zbuf = FALSE;
glDisable(GL_DEPTH_TEST);
glEnable(GL_DITHER);
if (multisample_enabled)
@@ -1375,15 +1373,15 @@ unsigned int view3d_sample_backbuf(ViewContext *vc, int x, int y)
unsigned int col;
if (x >= vc->ar->winx || y >= vc->ar->winy) return 0;
- x+= vc->ar->winrct.xmin;
- y+= vc->ar->winrct.ymin;
+ x += vc->ar->winrct.xmin;
+ y += vc->ar->winrct.ymin;
view3d_validate_backbuf(vc);
glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col);
glReadBuffer(GL_BACK);
- if (ENDIAN_ORDER==B_ENDIAN) SWITCH_INT(col);
+ if (ENDIAN_ORDER == B_ENDIAN) SWITCH_INT(col);
return WM_framebuffer_to_index(col);
}
@@ -1397,47 +1395,47 @@ ImBuf *view3d_read_backbuf(ViewContext *vc, short xmin, short ymin, short xmax,
short xminc, yminc, xmaxc, ymaxc, xs, ys;
/* clip */
- if (xmin<0) xminc= 0; else xminc= xmin;
- if (xmax >= vc->ar->winx) xmaxc= vc->ar->winx-1; else xmaxc= xmax;
+ if (xmin < 0) xminc = 0; else xminc = xmin;
+ if (xmax >= vc->ar->winx) xmaxc = vc->ar->winx - 1; else xmaxc = xmax;
if (xminc > xmaxc) return NULL;
- if (ymin<0) yminc= 0; else yminc= ymin;
- if (ymax >= vc->ar->winy) ymaxc= vc->ar->winy-1; else ymaxc= ymax;
+ if (ymin < 0) yminc = 0; else yminc = ymin;
+ if (ymax >= vc->ar->winy) ymaxc = vc->ar->winy - 1; else ymaxc = ymax;
if (yminc > ymaxc) return NULL;
- ibuf= IMB_allocImBuf((xmaxc-xminc+1), (ymaxc-yminc+1), 32, IB_rect);
+ ibuf = IMB_allocImBuf((xmaxc - xminc + 1), (ymaxc - yminc + 1), 32, IB_rect);
view3d_validate_backbuf(vc);
glReadPixels(vc->ar->winrct.xmin + xminc,
vc->ar->winrct.ymin + yminc,
- (xmaxc-xminc + 1),
- (ymaxc-yminc + 1),
+ (xmaxc - xminc + 1),
+ (ymaxc - yminc + 1),
GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
glReadBuffer(GL_BACK);
- if (ENDIAN_ORDER==B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf);
+ if (ENDIAN_ORDER == B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf);
- a= (xmaxc-xminc+1)*(ymaxc-yminc+1);
- dr= ibuf->rect;
+ a = (xmaxc - xminc + 1) * (ymaxc - yminc + 1);
+ dr = ibuf->rect;
while (a--) {
- if (*dr) *dr= WM_framebuffer_to_index(*dr);
+ if (*dr) *dr = WM_framebuffer_to_index(*dr);
dr++;
}
/* put clipped result back, if needed */
- if (xminc==xmin && xmaxc==xmax && yminc==ymin && ymaxc==ymax)
+ if (xminc == xmin && xmaxc == xmax && yminc == ymin && ymaxc == ymax)
return ibuf;
- ibuf1= IMB_allocImBuf( (xmax-xmin+1),(ymax-ymin+1),32,IB_rect);
- rd= ibuf->rect;
- dr= ibuf1->rect;
-
- for (ys= ymin; ys<=ymax; ys++) {
- for (xs= xmin; xs<=xmax; xs++, dr++) {
- if ( xs>=xminc && xs<=xmaxc && ys>=yminc && ys<=ymaxc) {
- *dr= *rd;
+ ibuf1 = IMB_allocImBuf( (xmax - xmin + 1), (ymax - ymin + 1), 32, IB_rect);
+ rd = ibuf->rect;
+ dr = ibuf1->rect;
+
+ for (ys = ymin; ys <= ymax; ys++) {
+ for (xs = xmin; xs <= xmax; xs++, dr++) {
+ if (xs >= xminc && xs <= xmaxc && ys >= yminc && ys <= ymaxc) {
+ *dr = *rd;
rd++;
}
}
@@ -1448,59 +1446,59 @@ ImBuf *view3d_read_backbuf(ViewContext *vc, short xmin, short ymin, short xmax,
/* smart function to sample a rect spiralling outside, nice for backbuf selection */
unsigned int view3d_sample_backbuf_rect(ViewContext *vc, const int mval[2], int size,
- unsigned int min, unsigned int max, int *dist, short strict,
- void *handle, unsigned int (*indextest)(void *handle, unsigned int index))
+ unsigned int min, unsigned int max, int *dist, short strict,
+ void *handle, unsigned int (*indextest)(void *handle, unsigned int index))
{
struct ImBuf *buf;
unsigned int *bufmin, *bufmax, *tbuf;
int minx, miny;
int a, b, rc, nr, amount, dirvec[4][2];
- int distance=0;
+ int distance = 0;
unsigned int index = 0;
short indexok = 0;
- amount= (size-1)/2;
+ amount = (size - 1) / 2;
- minx = mval[0]-(amount+1);
- miny = mval[1]-(amount+1);
- buf = view3d_read_backbuf(vc, minx, miny, minx+size-1, miny+size-1);
+ minx = mval[0] - (amount + 1);
+ miny = mval[1] - (amount + 1);
+ buf = view3d_read_backbuf(vc, minx, miny, minx + size - 1, miny + size - 1);
if (!buf) return 0;
- rc= 0;
+ rc = 0;
- dirvec[0][0]= 1; dirvec[0][1]= 0;
- dirvec[1][0]= 0; dirvec[1][1]= -size;
- dirvec[2][0]= -1; dirvec[2][1]= 0;
- dirvec[3][0]= 0; dirvec[3][1]= size;
+ dirvec[0][0] = 1; dirvec[0][1] = 0;
+ dirvec[1][0] = 0; dirvec[1][1] = -size;
+ dirvec[2][0] = -1; dirvec[2][1] = 0;
+ dirvec[3][0] = 0; dirvec[3][1] = size;
bufmin = buf->rect;
tbuf = buf->rect;
- bufmax = buf->rect + size*size;
- tbuf+= amount*size+ amount;
+ bufmax = buf->rect + size * size;
+ tbuf += amount * size + amount;
- for (nr=1; nr<=size; nr++) {
+ for (nr = 1; nr <= size; nr++) {
- for (a=0; a<2; a++) {
- for (b=0; b<nr; b++, distance++) {
- if (*tbuf && *tbuf>=min && *tbuf<max) { //we got a hit
+ for (a = 0; a < 2; a++) {
+ for (b = 0; b < nr; b++, distance++) {
+ if (*tbuf && *tbuf >= min && *tbuf < max) { //we got a hit
if (strict) {
- indexok = indextest(handle, *tbuf - min+1);
+ indexok = indextest(handle, *tbuf - min + 1);
if (indexok) {
- *dist= (short) sqrt( (float)distance );
- index = *tbuf - min+1;
+ *dist = (short) sqrt( (float)distance);
+ index = *tbuf - min + 1;
goto exit;
}
}
- else{
- *dist= (short) sqrt( (float)distance ); // XXX, this distance is wrong -
- index = *tbuf - min+1; // messy yah, but indices start at 1
+ else {
+ *dist = (short) sqrt( (float)distance); // XXX, this distance is wrong -
+ index = *tbuf - min + 1; // messy yah, but indices start at 1
goto exit;
}
}
- tbuf+= (dirvec[rc][0]+dirvec[rc][1]);
+ tbuf += (dirvec[rc][0] + dirvec[rc][1]);
- if (tbuf<bufmin || tbuf>=bufmax) {
+ if (tbuf < bufmin || tbuf >= bufmax) {
goto exit;
}
}
@@ -1519,98 +1517,98 @@ exit:
static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d)
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
BGpic *bgpic;
Image *ima;
MovieClip *clip;
- ImBuf *ibuf= NULL, *freeibuf;
+ ImBuf *ibuf = NULL, *freeibuf;
float vec[4], fac, asp, zoomx, zoomy;
float x1, y1, x2, y2, cx, cy;
- for ( bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next ) {
+ for (bgpic = v3d->bgpicbase.first; bgpic; bgpic = bgpic->next) {
- if ( (bgpic->view == 0) || /* zero for any */
- (bgpic->view & (1<<rv3d->view)) || /* check agaist flags */
- (rv3d->persp==RV3D_CAMOB && bgpic->view == (1<<RV3D_VIEW_CAMERA))
- ) {
+ if ((bgpic->view == 0) || /* zero for any */
+ (bgpic->view & (1 << rv3d->view)) || /* check agaist flags */
+ (rv3d->persp == RV3D_CAMOB && bgpic->view == (1 << RV3D_VIEW_CAMERA)))
+ {
/* disable individual images */
- if ((bgpic->flag&V3D_BGPIC_DISABLED))
+ if ((bgpic->flag & V3D_BGPIC_DISABLED))
continue;
- freeibuf= NULL;
- if (bgpic->source==V3D_BGPIC_IMAGE) {
- ima= bgpic->ima;
- if (ima==NULL)
+ freeibuf = NULL;
+ if (bgpic->source == V3D_BGPIC_IMAGE) {
+ ima = bgpic->ima;
+ if (ima == NULL)
continue;
BKE_image_user_calc_frame(&bgpic->iuser, CFRA, 0);
- ibuf= BKE_image_get_ibuf(ima, &bgpic->iuser);
+ ibuf = BKE_image_get_ibuf(ima, &bgpic->iuser);
}
else {
- clip= NULL;
+ clip = NULL;
- if (bgpic->flag&V3D_BGPIC_CAMERACLIP) {
+ if (bgpic->flag & V3D_BGPIC_CAMERACLIP) {
if (scene->camera)
- clip= object_get_movieclip(scene, scene->camera, 1);
+ clip = object_get_movieclip(scene, scene->camera, 1);
}
- else clip= bgpic->clip;
+ else clip = bgpic->clip;
- if (clip==NULL)
+ if (clip == NULL)
continue;
BKE_movieclip_user_set_frame(&bgpic->cuser, CFRA);
- ibuf= BKE_movieclip_get_ibuf(clip, &bgpic->cuser);
+ 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. */
- freeibuf= ibuf;
+ * ibuf acquired from clip is referenced by cache system and should
+ * be dereferenced after usage. */
+ freeibuf = ibuf;
}
- if (ibuf==NULL)
+ if (ibuf == NULL)
continue;
- if ((ibuf->rect==NULL && ibuf->rect_float==NULL) || ibuf->channels!=4) { /* invalid image format */
+ if ((ibuf->rect == NULL && ibuf->rect_float == NULL) || ibuf->channels != 4) { /* invalid image format */
if (freeibuf)
IMB_freeImBuf(freeibuf);
continue;
}
- if (ibuf->rect==NULL)
+ if (ibuf->rect == NULL)
IMB_rect_from_float(ibuf);
- if (rv3d->persp==RV3D_CAMOB) {
+ if (rv3d->persp == RV3D_CAMOB) {
rctf vb;
ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &vb, FALSE);
- x1= vb.xmin;
- y1= vb.ymin;
- x2= vb.xmax;
- y2= vb.ymax;
+ x1 = vb.xmin;
+ y1 = vb.ymin;
+ x2 = vb.xmax;
+ y2 = vb.ymax;
}
else {
float sco[2];
- const float mval_f[2]= {1.0f, 0.0f};
+ const float mval_f[2] = {1.0f, 0.0f};
/* calc window coord */
initgrabz(rv3d, 0.0, 0.0, 0.0);
ED_view3d_win_to_delta(ar, mval_f, vec);
- fac= maxf(fabsf(vec[0]), maxf(fabsf(vec[1]), fabsf(vec[2]))); /* largest abs axis */
- fac= 1.0f/fac;
+ fac = maxf(fabsf(vec[0]), maxf(fabsf(vec[1]), fabsf(vec[2]))); /* largest abs axis */
+ fac = 1.0f / fac;
- asp= ( (float)ibuf->y)/(float)ibuf->x;
+ asp = ( (float)ibuf->y) / (float)ibuf->x;
- vec[0] = vec[1] = vec[2] = 0.0;
- ED_view3d_project_float(ar, vec, sco, rv3d->persmat);
+ zero_v3(vec);
+ ED_view3d_project_float_v2(ar, vec, sco, rv3d->persmat);
cx = sco[0];
cy = sco[1];
- x1= cx+ fac*(bgpic->xof-bgpic->size);
- y1= cy+ asp*fac*(bgpic->yof-bgpic->size);
- x2= cx+ fac*(bgpic->xof+bgpic->size);
- y2= cy+ asp*fac*(bgpic->yof+bgpic->size);
+ x1 = cx + fac * (bgpic->xof - bgpic->size);
+ y1 = cy + asp * fac * (bgpic->yof - bgpic->size);
+ x2 = cx + fac * (bgpic->xof + bgpic->size);
+ y2 = cy + asp * fac * (bgpic->yof + bgpic->size);
}
/* complete clip? */
@@ -1622,29 +1620,29 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d)
continue;
}
- zoomx= (x2-x1)/ibuf->x;
- zoomy= (y2-y1)/ibuf->y;
+ zoomx = (x2 - x1) / ibuf->x;
+ zoomy = (y2 - y1) / ibuf->y;
/* for some reason; zoomlevels down refuses to use GL_ALPHA_SCALE */
if (zoomx < 1.0f || zoomy < 1.0f) {
- float tzoom= MIN2(zoomx, zoomy);
- int mip= 0;
+ float tzoom = MIN2(zoomx, zoomy);
+ int mip = 0;
- if ((ibuf->userflags&IB_MIPMAP_INVALID) != 0) {
+ if ((ibuf->userflags & IB_MIPMAP_INVALID) != 0) {
IMB_remakemipmap(ibuf, 0);
- ibuf->userflags&= ~IB_MIPMAP_INVALID;
+ ibuf->userflags &= ~IB_MIPMAP_INVALID;
}
- else if (ibuf->mipmap[0]==NULL)
+ else if (ibuf->mipmap[0] == NULL)
IMB_makemipmap(ibuf, 0);
- while (tzoom < 1.0f && mip<8 && ibuf->mipmap[mip]) {
- tzoom*= 2.0f;
- zoomx*= 2.0f;
- zoomy*= 2.0f;
+ while (tzoom < 1.0f && mip < 8 && ibuf->mipmap[mip]) {
+ tzoom *= 2.0f;
+ zoomx *= 2.0f;
+ zoomy *= 2.0f;
mip++;
}
- if (mip>0)
- ibuf= ibuf->mipmap[mip-1];
+ if (mip > 0)
+ ibuf = ibuf->mipmap[mip - 1];
}
if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
@@ -1660,7 +1658,7 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d)
ED_region_pixelspace(ar);
glPixelZoom(zoomx, zoomy);
- glColor4f(1.0f, 1.0f, 1.0f, 1.0f-bgpic->blend);
+ glColor4f(1.0f, 1.0f, 1.0f, 1.0f - bgpic->blend);
glaDrawPixelsTex(x1, y1, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, ibuf->rect);
glPixelZoom(1.0, 1.0);
@@ -1693,10 +1691,10 @@ typedef struct View3DAfter {
/* temp storage of Objects that need to be drawn as last */
void add_view3d_after(ListBase *lb, Base *base, int flag)
{
- View3DAfter *v3da= MEM_callocN(sizeof(View3DAfter), "View 3d after");
+ View3DAfter *v3da = MEM_callocN(sizeof(View3DAfter), "View 3d after");
BLI_addtail(lb, v3da);
- v3da->base= base;
- v3da->flag= flag;
+ v3da->base = base;
+ v3da->flag = flag;
}
/* disables write in zbuffer and draws it over */
@@ -1705,15 +1703,15 @@ static void view3d_draw_transp(Scene *scene, ARegion *ar, View3D *v3d)
View3DAfter *v3da, *next;
glDepthMask(0);
- v3d->transp= TRUE;
+ v3d->transp = TRUE;
- for (v3da= v3d->afterdraw_transp.first; v3da; v3da= next) {
- next= v3da->next;
+ for (v3da = v3d->afterdraw_transp.first; v3da; v3da = next) {
+ next = v3da->next;
draw_object(scene, ar, v3d, v3da->base, v3da->flag);
BLI_remlink(&v3d->afterdraw_transp, v3da);
MEM_freeN(v3da);
}
- v3d->transp= FALSE;
+ v3d->transp = FALSE;
glDepthMask(1);
@@ -1727,14 +1725,14 @@ static void view3d_draw_xray(Scene *scene, ARegion *ar, View3D *v3d, int clear)
if (clear && v3d->zbuf)
glClear(GL_DEPTH_BUFFER_BIT);
- v3d->xray= TRUE;
- for (v3da= v3d->afterdraw_xray.first; v3da; v3da= next) {
- next= v3da->next;
+ v3d->xray = TRUE;
+ for (v3da = v3d->afterdraw_xray.first; v3da; v3da = next) {
+ next = v3da->next;
draw_object(scene, ar, v3d, v3da->base, v3da->flag);
BLI_remlink(&v3d->afterdraw_xray, v3da);
MEM_freeN(v3da);
}
- v3d->xray= FALSE;
+ v3d->xray = FALSE;
}
@@ -1746,37 +1744,37 @@ static void view3d_draw_xraytransp(Scene *scene, ARegion *ar, View3D *v3d, int c
if (clear && v3d->zbuf)
glClear(GL_DEPTH_BUFFER_BIT);
- v3d->xray= TRUE;
- v3d->transp= TRUE;
+ v3d->xray = TRUE;
+ v3d->transp = TRUE;
- for (v3da= v3d->afterdraw_xraytransp.first; v3da; v3da= next) {
- next= v3da->next;
+ for (v3da = v3d->afterdraw_xraytransp.first; v3da; v3da = next) {
+ next = v3da->next;
draw_object(scene, ar, v3d, v3da->base, v3da->flag);
BLI_remlink(&v3d->afterdraw_xraytransp, v3da);
MEM_freeN(v3da);
}
- v3d->transp= FALSE;
- v3d->xray= FALSE;
+ v3d->transp = FALSE;
+ v3d->xray = FALSE;
}
/* *********************** */
/*
- 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
int dupli_ob_sort(void *arg1, void *arg2)
{
- void *p1= ((DupliObject *)arg1)->ob;
- void *p2= ((DupliObject *)arg2)->ob;
+ void *p1 = ((DupliObject *)arg1)->ob;
+ void *p2 = ((DupliObject *)arg2)->ob;
int val = 0;
- if (p1 < p2) val = -1;
- else if (p1 > p2) val = 1;
+ if (p1 < p2) val = -1;
+ else if (p1 > p2) val = 1;
return val;
}
#endif
@@ -1785,40 +1783,40 @@ int dupli_ob_sort(void *arg1, void *arg2)
static DupliObject *dupli_step(DupliObject *dob)
{
while (dob && dob->no_draw)
- dob= dob->next;
+ dob = dob->next;
return dob;
}
static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int color)
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
ListBase *lb;
- DupliObject *dob_prev= NULL, *dob, *dob_next= NULL;
+ DupliObject *dob_prev = NULL, *dob, *dob_next = NULL;
Base tbase;
BoundBox bb, *bb_tmp; /* use a copy because draw_object, calls clear_mesh_caches */
- GLuint displist=0;
- short transflag, use_displist= -1; /* -1 is initialize */
+ GLuint displist = 0;
+ short transflag, use_displist = -1; /* -1 is initialize */
char dt, dtx;
if (base->object->restrictflag & OB_RESTRICT_VIEW) return;
- tbase.flag= OB_FROMDUPLI|base->flag;
- lb= object_duplilist(scene, base->object);
+ tbase.flag = OB_FROMDUPLI | base->flag;
+ lb = object_duplilist(scene, base->object);
// BLI_sortlist(lb, dupli_ob_sort); // might be nice to have if we have a dupli list with mixed objects.
- dob=dupli_step(lb->first);
- if (dob) dob_next= dupli_step(dob->next);
+ dob = dupli_step(lb->first);
+ if (dob) dob_next = dupli_step(dob->next);
- for ( ; dob ; dob_prev= dob, dob= dob_next, dob_next= dob_next ? dupli_step(dob_next->next) : NULL) {
- tbase.object= dob->ob;
+ for (; dob; dob_prev = dob, dob = dob_next, dob_next = dob_next ? dupli_step(dob_next->next) : NULL) {
+ tbase.object = dob->ob;
/* extra service: draw the duplicator in drawtype of parent */
/* MIN2 for the drawtype to allow bounding box objects in groups for lods */
- dt= tbase.object->dt; tbase.object->dt= MIN2(tbase.object->dt, base->object->dt);
- dtx= tbase.object->dtx; tbase.object->dtx= base->object->dtx;
+ dt = tbase.object->dt; tbase.object->dt = MIN2(tbase.object->dt, base->object->dt);
+ dtx = tbase.object->dtx; tbase.object->dtx = base->object->dtx;
/* negative scale flag has to propagate */
- transflag= tbase.object->transflag;
+ transflag = tbase.object->transflag;
if (base->object->transflag & OB_NEG_SCALE)
tbase.object->transflag ^= OB_NEG_SCALE;
@@ -1826,10 +1824,10 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas
/* generate displist, test for new object */
if (dob_prev && dob_prev->ob != dob->ob) {
- if (use_displist==1)
+ if (use_displist == 1)
glDeleteLists(displist, 1);
- use_displist= -1;
+ use_displist = -1;
}
/* generate displist */
@@ -1840,31 +1838,31 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas
* offset feature (used in group-duplicate.blend but no longer works in 2.5)
* so for now it should be ok to - campbell */
- if ( /* if this is the last no need to make a displist */
- (dob_next==NULL || dob_next->ob != dob->ob) ||
- /* lamp drawing messes with matrices, could be handled smarter... but this works */
- (dob->ob->type == OB_LAMP) ||
- (dob->type == OB_DUPLIGROUP && dob->animated) ||
- !(bb_tmp= object_get_boundbox(dob->ob)))
+ if (/* if this is the last no need to make a displist */
+ (dob_next == NULL || dob_next->ob != dob->ob) ||
+ /* lamp drawing messes with matrices, could be handled smarter... but this works */
+ (dob->ob->type == OB_LAMP) ||
+ (dob->type == OB_DUPLIGROUP && dob->animated) ||
+ !(bb_tmp = object_get_boundbox(dob->ob)))
{
// printf("draw_dupli_objects_color: skipping displist for %s\n", dob->ob->id.name+2);
- use_displist= 0;
+ use_displist = 0;
}
else {
// printf("draw_dupli_objects_color: using displist for %s\n", dob->ob->id.name+2);
- bb= *bb_tmp; /* must make a copy */
+ bb = *bb_tmp; /* must make a copy */
/* disable boundbox check for list creation */
object_boundbox_flag(dob->ob, OB_BB_DISABLED, 1);
/* need this for next part of code */
- unit_m4(dob->ob->obmat); /* obmat gets restored */
+ unit_m4(dob->ob->obmat); /* obmat gets restored */
- displist= glGenLists(1);
+ displist = glGenLists(1);
glNewList(displist, GL_COMPILE);
draw_object(scene, ar, v3d, &tbase, DRAW_CONSTCOLOR);
glEndList();
- use_displist= 1;
+ use_displist = 1;
object_boundbox_flag(dob->ob, OB_BB_DISABLED, 0);
}
}
@@ -1879,14 +1877,14 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas
draw_object(scene, ar, v3d, &tbase, DRAW_CONSTCOLOR);
}
- tbase.object->dt= dt;
- tbase.object->dtx= dtx;
- tbase.object->transflag= transflag;
+ tbase.object->dt = dt;
+ tbase.object->dtx = dtx;
+ tbase.object->transflag = transflag;
}
/* Transp afterdraw disabled, afterdraw only stores base pointers, and duplis can be same obj */
- free_object_duplilist(lb); /* does restore */
+ free_object_duplilist(lb); /* does restore */
if (use_displist)
glDeleteLists(displist, 1);
@@ -1895,12 +1893,12 @@ 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;
+ int color = (base->flag & SELECT) ? TH_SELECT : TH_WIRE;
/* debug */
- if (base->object->dup_group && base->object->dup_group->id.us<1)
- color= TH_REDALERT;
+ if (base->object->dup_group && base->object->dup_group->id.us < 1)
+ color = TH_REDALERT;
draw_dupli_objects_color(scene, ar, v3d, base, color);
}
@@ -1911,81 +1909,83 @@ void view3d_update_depths_rect(ARegion *ar, ViewDepths *d, rcti *rect)
rcti r;
/* clamp rect by area */
- r.xmin= 0;
- r.xmax= ar->winx-1;
- r.ymin= 0;
- r.ymax= ar->winy-1;
+ r.xmin = 0;
+ r.xmax = ar->winx - 1;
+ r.ymin = 0;
+ r.ymax = ar->winy - 1;
/* Constrain rect to depth bounds */
BLI_isect_rcti(&r, rect, rect);
/* assign values to compare with the ViewDepths */
- x= rect->xmin;
- y= rect->ymin;
+ x = rect->xmin;
+ y = rect->ymin;
- w= rect->xmax - rect->xmin;
- h= rect->ymax - rect->ymin;
+ w = rect->xmax - rect->xmin;
+ h = rect->ymax - rect->ymin;
if (w <= 0 || h <= 0) {
if (d->depths)
MEM_freeN(d->depths);
- d->depths= NULL;
+ d->depths = NULL;
- d->damaged= FALSE;
+ d->damaged = FALSE;
}
- else if ( d->w != w ||
- d->h != h ||
- d->x != x ||
- d->y != y ||
- d->depths==NULL
- ) {
- d->x= x;
- d->y= y;
- d->w= w;
- d->h= h;
+ else if (d->w != w ||
+ d->h != h ||
+ d->x != x ||
+ d->y != y ||
+ d->depths == NULL
+ )
+ {
+ d->x = x;
+ d->y = y;
+ d->w = w;
+ d->h = h;
if (d->depths)
MEM_freeN(d->depths);
- d->depths= MEM_mallocN(sizeof(float)*d->w*d->h,"View depths Subset");
+ d->depths = MEM_mallocN(sizeof(float) * d->w * d->h, "View depths Subset");
- d->damaged= TRUE;
+ d->damaged = TRUE;
}
if (d->damaged) {
- glReadPixels(ar->winrct.xmin+d->x,ar->winrct.ymin+d->y, d->w,d->h, GL_DEPTH_COMPONENT,GL_FLOAT, d->depths);
- glGetDoublev(GL_DEPTH_RANGE,d->depth_range);
- d->damaged= FALSE;
+ glReadPixels(ar->winrct.xmin + d->x, ar->winrct.ymin + d->y, d->w, d->h, GL_DEPTH_COMPONENT, GL_FLOAT, d->depths);
+ glGetDoublev(GL_DEPTH_RANGE, d->depth_range);
+ d->damaged = FALSE;
}
}
/* note, with nouveau drivers the glReadPixels() is very slow. [#24339] */
void ED_view3d_depth_update(ARegion *ar)
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
/* Create storage for, and, if necessary, copy depth buffer */
- if (!rv3d->depths) rv3d->depths= MEM_callocN(sizeof(ViewDepths),"ViewDepths");
+ if (!rv3d->depths) rv3d->depths = MEM_callocN(sizeof(ViewDepths), "ViewDepths");
if (rv3d->depths) {
- ViewDepths *d= rv3d->depths;
+ ViewDepths *d = rv3d->depths;
if (d->w != ar->winx ||
- d->h != ar->winy ||
- !d->depths) {
- d->w= ar->winx;
- d->h= ar->winy;
+ d->h != ar->winy ||
+ !d->depths)
+ {
+ d->w = ar->winx;
+ d->h = ar->winy;
if (d->depths)
MEM_freeN(d->depths);
- d->depths= MEM_mallocN(sizeof(float)*d->w*d->h,"View depths");
- d->damaged= 1;
+ d->depths = MEM_mallocN(sizeof(float) * d->w * d->h, "View depths");
+ d->damaged = 1;
}
if (d->damaged) {
- glReadPixels(ar->winrct.xmin,ar->winrct.ymin,d->w,d->h,
- GL_DEPTH_COMPONENT,GL_FLOAT, d->depths);
+ glReadPixels(ar->winrct.xmin, ar->winrct.ymin, d->w, d->h,
+ GL_DEPTH_COMPONENT, GL_FLOAT, d->depths);
- glGetDoublev(GL_DEPTH_RANGE,d->depth_range);
+ glGetDoublev(GL_DEPTH_RANGE, d->depth_range);
- d->damaged= 0;
+ d->damaged = 0;
}
}
}
@@ -1994,20 +1994,20 @@ void ED_view3d_depth_update(ARegion *ar)
float view3d_depth_near(ViewDepths *d)
{
/* convert to float for comparisons */
- const float near= (float)d->depth_range[0];
- const float far_real= (float)d->depth_range[1];
- float far= far_real;
+ const float near = (float)d->depth_range[0];
+ const float far_real = (float)d->depth_range[1];
+ float far = far_real;
- const float *depths= d->depths;
- float depth= FLT_MAX;
- int i= (int)d->w * (int)d->h; /* cast to avoid short overflow */
+ const float *depths = d->depths;
+ float depth = FLT_MAX;
+ int i = (int)d->w * (int)d->h; /* cast to avoid short overflow */
/* far is both the starting 'far' value
* and the closest value found. */
while (i--) {
- depth= *depths++;
+ depth = *depths++;
if ((depth < far) && (depth > near)) {
- far= depth;
+ far = depth;
}
}
@@ -2016,11 +2016,11 @@ float view3d_depth_near(ViewDepths *d)
void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d)
{
- short zbuf= v3d->zbuf;
- RegionView3D *rv3d= ar->regiondata;
+ short zbuf = v3d->zbuf;
+ RegionView3D *rv3d = ar->regiondata;
- setwinmatrixview3d(ar, v3d, NULL); /* 0= no pick rect */
- setviewmatrixview3d(scene, v3d, rv3d); /* note: calls where_is_object for camera... */
+ setwinmatrixview3d(ar, v3d, NULL); /* 0= no pick rect */
+ setviewmatrixview3d(scene, v3d, rv3d); /* note: calls where_is_object for camera... */
mult_m4_m4m4(rv3d->persmat, rv3d->winmat, rv3d->viewmat);
invert_m4_m4(rv3d->persinv, rv3d->persmat);
@@ -2030,32 +2030,32 @@ void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d)
glLoadMatrixf(rv3d->viewmat);
- v3d->zbuf= TRUE;
+ v3d->zbuf = TRUE;
glEnable(GL_DEPTH_TEST);
draw_gpencil_view3d(scene, v3d, ar, 1);
- v3d->zbuf= zbuf;
+ v3d->zbuf = zbuf;
}
-void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (* func)(void *))
+void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (*func)(void *))
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
Base *base;
- short zbuf= v3d->zbuf;
- short flag= v3d->flag;
- float glalphaclip= U.glalphaclip;
- int obcenter_dia= U.obcenter_dia;
+ short zbuf = v3d->zbuf;
+ short flag = v3d->flag;
+ float glalphaclip = U.glalphaclip;
+ int obcenter_dia = U.obcenter_dia;
/* temp set drawtype to solid */
/* Setting these temporarily is not nice */
v3d->flag &= ~V3D_SELECT_OUTLINE;
U.glalphaclip = 0.5; /* not that nice but means we wont zoom into billboards */
- U.obcenter_dia= 0;
+ U.obcenter_dia = 0;
- setwinmatrixview3d(ar, v3d, NULL); /* 0= no pick rect */
- setviewmatrixview3d(scene, v3d, rv3d); /* note: calls where_is_object for camera... */
+ setwinmatrixview3d(ar, v3d, NULL); /* 0= no pick rect */
+ setviewmatrixview3d(scene, v3d, rv3d); /* note: calls where_is_object for camera... */
mult_m4_m4m4(rv3d->persmat, rv3d->winmat, rv3d->viewmat);
invert_m4_m4(rv3d->persinv, rv3d->persmat);
@@ -2070,7 +2070,7 @@ void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (* func)(void *))
ED_view3d_clipping_set(rv3d);
}
- v3d->zbuf= TRUE;
+ v3d->zbuf = TRUE;
glEnable(GL_DEPTH_TEST);
/* draw set first */
@@ -2088,7 +2088,7 @@ void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (* func)(void *))
}
}
- for (base= scene->base.first; base; base= base->next) {
+ for (base = scene->base.first; base; base = base->next) {
if (v3d->lay & base->lay) {
if (func == NULL || func(base)) {
/* dupli drawing */
@@ -2100,15 +2100,15 @@ void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (* func)(void *))
}
}
- /* this isnt that nice, draw xray objects as if they are normal */
- if ( v3d->afterdraw_transp.first ||
- v3d->afterdraw_xray.first ||
- v3d->afterdraw_xraytransp.first
- ) {
+ /* this isn't that nice, draw xray objects as if they are normal */
+ if (v3d->afterdraw_transp.first ||
+ v3d->afterdraw_xray.first ||
+ v3d->afterdraw_xraytransp.first)
+ {
View3DAfter *v3da, *next;
int mask_orig;
- v3d->xray= TRUE;
+ v3d->xray = TRUE;
/* transp materials can change the depth mask, see #21388 */
glGetIntegerv(GL_DEPTH_WRITEMASK, &mask_orig);
@@ -2116,44 +2116,44 @@ void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (* func)(void *))
if (v3d->afterdraw_xray.first || v3d->afterdraw_xraytransp.first) {
glDepthFunc(GL_ALWAYS); /* always write into the depth bufer, overwriting front z values */
- for (v3da= v3d->afterdraw_xray.first; v3da; v3da= next) {
- next= v3da->next;
+ for (v3da = v3d->afterdraw_xray.first; v3da; v3da = next) {
+ next = v3da->next;
draw_object(scene, ar, v3d, v3da->base, 0);
}
glDepthFunc(GL_LEQUAL); /* Now write the depth buffer normally */
}
/* draw 3 passes, transp/xray/xraytransp */
- v3d->xray= FALSE;
- v3d->transp= TRUE;
- for (v3da= v3d->afterdraw_transp.first; v3da; v3da= next) {
- next= v3da->next;
+ v3d->xray = FALSE;
+ v3d->transp = TRUE;
+ for (v3da = v3d->afterdraw_transp.first; v3da; v3da = next) {
+ next = v3da->next;
draw_object(scene, ar, v3d, v3da->base, 0);
BLI_remlink(&v3d->afterdraw_transp, v3da);
MEM_freeN(v3da);
}
- v3d->xray= TRUE;
- v3d->transp= FALSE;
- for (v3da= v3d->afterdraw_xray.first; v3da; v3da= next) {
- next= v3da->next;
+ v3d->xray = TRUE;
+ v3d->transp = FALSE;
+ for (v3da = v3d->afterdraw_xray.first; v3da; v3da = next) {
+ next = v3da->next;
draw_object(scene, ar, v3d, v3da->base, 0);
BLI_remlink(&v3d->afterdraw_xray, v3da);
MEM_freeN(v3da);
}
- v3d->xray= TRUE;
- v3d->transp= TRUE;
- for (v3da= v3d->afterdraw_xraytransp.first; v3da; v3da= next) {
- next= v3da->next;
+ v3d->xray = TRUE;
+ v3d->transp = TRUE;
+ for (v3da = v3d->afterdraw_xraytransp.first; v3da; v3da = next) {
+ next = v3da->next;
draw_object(scene, ar, v3d, v3da->base, 0);
BLI_remlink(&v3d->afterdraw_xraytransp, v3da);
MEM_freeN(v3da);
}
- v3d->xray= FALSE;
- v3d->transp= FALSE;
+ v3d->xray = FALSE;
+ v3d->transp = FALSE;
glDepthMask(mask_orig);
}
@@ -2166,7 +2166,7 @@ void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (* func)(void *))
U.glalphaclip = glalphaclip;
v3d->flag = flag;
- U.obcenter_dia= obcenter_dia;
+ U.obcenter_dia = obcenter_dia;
}
typedef struct View3DShadow {
@@ -2178,7 +2178,7 @@ static void gpu_render_lamp_update(Scene *scene, View3D *v3d, Object *ob, Object
float obmat[][4], ListBase *shadows)
{
GPULamp *lamp;
- Lamp *la = (Lamp*)ob->data;
+ Lamp *la = (Lamp *)ob->data;
View3DShadow *shadow;
lamp = GPU_lamp_from_blender(scene, ob, par);
@@ -2188,7 +2188,7 @@ static void gpu_render_lamp_update(Scene *scene, View3D *v3d, Object *ob, Object
GPU_lamp_update_colors(lamp, la->r, la->g, la->b, la->energy);
if ((ob->lay & v3d->lay) && GPU_lamp_has_shadow_buffer(lamp)) {
- shadow= MEM_callocN(sizeof(View3DShadow), "View3DShadow");
+ shadow = MEM_callocN(sizeof(View3DShadow), "View3DShadow");
shadow->lamp = lamp;
BLI_addtail(shadows, shadow);
}
@@ -2203,11 +2203,11 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d)
Base *base;
Object *ob;
- shadows.first= shadows.last= NULL;
+ shadows.first = shadows.last = NULL;
/* update lamp transform and gather shadow lamps */
for (SETLOOPER(scene, sce_iter, base)) {
- ob= base->object;
+ ob = base->object;
if (ob->type == OB_LAMP)
gpu_render_lamp_update(scene, v3d, ob, NULL, ob->obmat, &shadows);
@@ -2216,8 +2216,8 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d)
DupliObject *dob;
ListBase *lb = object_duplilist(scene, ob);
- for (dob=lb->first; dob; dob=dob->next)
- if (dob->ob->type==OB_LAMP)
+ for (dob = lb->first; dob; dob = dob->next)
+ if (dob->ob->type == OB_LAMP)
gpu_render_lamp_update(scene, v3d, dob->ob, ob, dob->mat, &shadows);
free_object_duplilist(lb);
@@ -2225,16 +2225,16 @@ 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 */
- for (shadow=shadows.first; shadow; shadow=shadow->next) {
+ * 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];
- int drawtype, lay, winsize, flag2=v3d->flag2;
- ARegion ar= {NULL};
- RegionView3D rv3d= {{{0}}};
+ int drawtype, lay, winsize, flag2 = v3d->flag2;
+ ARegion ar = {NULL};
+ RegionView3D rv3d = {{{0}}};
- drawtype= v3d->drawtype;
- lay= v3d->lay;
+ drawtype = v3d->drawtype;
+ lay = v3d->lay;
v3d->drawtype = OB_SOLID;
v3d->lay &= GPU_lamp_shadow_layer(shadow->lamp);
@@ -2243,20 +2243,20 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d)
GPU_lamp_shadow_buffer_bind(shadow->lamp, viewmat, &winsize, winmat);
- ar.regiondata= &rv3d;
- ar.regiontype= RGN_TYPE_WINDOW;
- rv3d.persp= RV3D_CAMOB;
+ ar.regiondata = &rv3d;
+ ar.regiontype = RGN_TYPE_WINDOW;
+ rv3d.persp = RV3D_CAMOB;
copy_m4_m4(rv3d.winmat, winmat);
copy_m4_m4(rv3d.viewmat, viewmat);
invert_m4_m4(rv3d.viewinv, rv3d.viewmat);
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;
- v3d->lay= lay;
+ v3d->drawtype = drawtype;
+ v3d->lay = lay;
v3d->flag2 = flag2;
}
@@ -2267,10 +2267,10 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d)
CustomDataMask ED_view3d_datamask(Scene *scene, View3D *v3d)
{
- CustomDataMask mask= 0;
+ CustomDataMask mask = 0;
- if ( ELEM(v3d->drawtype, OB_TEXTURE, OB_MATERIAL) ||
- ((v3d->drawtype == OB_SOLID) && (v3d->flag2 & V3D_SOLID_TEX)))
+ if (ELEM(v3d->drawtype, OB_TEXTURE, OB_MATERIAL) ||
+ ((v3d->drawtype == OB_SOLID) && (v3d->flag2 & V3D_SOLID_TEX)))
{
mask |= CD_MASK_MTFACE | CD_MASK_MCOL;
@@ -2289,8 +2289,8 @@ CustomDataMask ED_view3d_datamask(Scene *scene, View3D *v3d)
CustomDataMask ED_view3d_object_datamask(Scene *scene)
{
- Object *ob= scene->basact ? scene->basact->object : NULL;
- CustomDataMask mask= 0;
+ Object *ob = scene->basact ? scene->basact->object : NULL;
+ CustomDataMask mask = 0;
if (ob) {
/* check if we need tfaces & mcols due to face select or texture paint */
@@ -2304,7 +2304,7 @@ CustomDataMask ED_view3d_object_datamask(Scene *scene)
}
if (ob->mode & OB_MODE_WEIGHT_PAINT) {
- mask |= CD_MASK_WEIGHT_MCOL;
+ mask |= CD_MASK_PREVIEW_MCOL;
}
}
@@ -2314,7 +2314,7 @@ CustomDataMask ED_view3d_object_datamask(Scene *scene)
/* goes over all modes and view3d settings */
CustomDataMask ED_view3d_screen_datamask(bScreen *screen)
{
- Scene *scene= screen->scene;
+ Scene *scene = screen->scene;
CustomDataMask mask = CD_MASK_BAREMESH;
ScrArea *sa;
@@ -2330,22 +2330,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 */
-
+ 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... */
-
+ 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);
@@ -2358,19 +2358,26 @@ static void view3d_main_area_setup_view(Scene *scene, View3D *v3d, ARegion *ar,
float v1[3], v2[3];
float len1, len2;
- v1[0]= rv3d->persmat[0][0];
- v1[1]= rv3d->persmat[1][0];
- v1[2]= rv3d->persmat[2][0];
+ v1[0] = rv3d->persmat[0][0];
+ v1[1] = rv3d->persmat[1][0];
+ v1[2] = rv3d->persmat[2][0];
- 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);
+ 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,27 +2387,29 @@ 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;
+ RegionView3D *rv3d = ar->regiondata;
Base *base;
float backcol[3];
int bwinx, bwiny;
rcti brect;
+ ImBuf *bg_ibuf = NULL;
glPushMatrix();
/* set temporary new size */
- bwinx= ar->winx;
- bwiny= ar->winy;
- brect= ar->winrct;
+ bwinx = ar->winx;
+ bwiny = ar->winy;
+ brect = ar->winrct;
- ar->winx= winx;
- ar->winy= winy;
- ar->winrct.xmin= 0;
- ar->winrct.ymin= 0;
- ar->winrct.xmax= winx;
- ar->winrct.ymax= winy;
+ ar->winx = winx;
+ ar->winy = winy;
+ ar->winrct.xmin = 0;
+ ar->winrct.ymin = 0;
+ ar->winrct.xmax = winx;
+ ar->winrct.ymax = winy;
/* set flags */
@@ -2414,19 +2423,66 @@ 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);
+ 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);
@@ -2436,11 +2492,11 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar,
/* set zbuffer */
if (v3d->drawtype > OB_WIRE) {
- v3d->zbuf= TRUE;
+ v3d->zbuf = TRUE;
glEnable(GL_DEPTH_TEST);
}
else
- v3d->zbuf= FALSE;
+ v3d->zbuf = FALSE;
if (rv3d->rflag & RV3D_CLIPPING)
ED_view3d_clipping_set(rv3d);
@@ -2451,7 +2507,7 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar,
for (SETLOOPER(scene->set, sce_iter, base)) {
if (v3d->lay & base->lay) {
UI_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f);
- draw_object(scene, ar, v3d, base, DRAW_CONSTCOLOR|DRAW_SCENESET);
+ draw_object(scene, ar, v3d, base, DRAW_CONSTCOLOR | DRAW_SCENESET);
if (base->object->transflag & OB_DUPLI)
draw_dupli_objects_color(scene, ar, v3d, base, TH_WIRE);
@@ -2460,7 +2516,7 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar,
}
/* then draw not selected and the duplis, but skip editmode object */
- for (base= scene->base.first; base; base= base->next) {
+ for (base = scene->base.first; base; base = base->next) {
if (v3d->lay & base->lay) {
/* dupli drawing */
if (base->object->transflag & OB_DUPLI)
@@ -2476,16 +2532,16 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar,
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
/* transp and X-ray afterdraw stuff */
- if (v3d->afterdraw_transp.first) view3d_draw_transp(scene, ar, v3d);
- if (v3d->afterdraw_xray.first) view3d_draw_xray(scene, ar, v3d, 1); // clears zbuffer if it is used!
- if (v3d->afterdraw_xraytransp.first) view3d_draw_xraytransp(scene, ar, v3d, 1);
+ if (v3d->afterdraw_transp.first) view3d_draw_transp(scene, ar, v3d);
+ if (v3d->afterdraw_xray.first) view3d_draw_xray(scene, ar, v3d, 1); // clears zbuffer if it is used!
+ if (v3d->afterdraw_xraytransp.first) view3d_draw_xraytransp(scene, ar, v3d, 1);
if (rv3d->rflag & RV3D_CLIPPING)
ED_view3d_clipping_disable();
/* cleanup */
if (v3d->zbuf) {
- v3d->zbuf= FALSE;
+ v3d->zbuf = FALSE;
glDisable(GL_DEPTH_TEST);
}
@@ -2499,8 +2555,8 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar,
GPU_free_images_anim();
/* restore size */
- ar->winx= bwinx;
- ar->winy= bwiny;
+ ar->winx = bwinx;
+ ar->winy = bwiny;
ar->winrct = brect;
glPopMatrix();
@@ -2513,9 +2569,9 @@ 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;
+ RegionView3D *rv3d = ar->regiondata;
ImBuf *ibuf;
GPUOffScreen *ofs;
@@ -2523,14 +2579,14 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar,
glPushAttrib(GL_LIGHTING_BIT);
/* bind */
- ofs= GPU_offscreen_create(sizex, sizey, err_out);
+ ofs = GPU_offscreen_create(sizex, sizey, err_out);
if (ofs == NULL)
return NULL;
GPU_offscreen_bind(ofs);
/* render 3d view */
- if (rv3d->persp==RV3D_CAMOB && v3d->camera) {
+ if (rv3d->persp == RV3D_CAMOB && v3d->camera) {
CameraParams params;
camera_params_init(&params);
@@ -2538,14 +2594,14 @@ 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 */
- ibuf= IMB_allocImBuf(sizex, sizey, 32, flag);
+ ibuf = IMB_allocImBuf(sizex, sizey, 32, flag);
if (ibuf->rect_float)
GPU_offscreen_read_pixels(ofs, GL_FLOAT, ibuf->rect_float);
@@ -2569,23 +2625,23 @@ 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};
- RegionView3D rv3d= {{{0}}};
+ View3D v3d = {NULL};
+ ARegion ar = {NULL};
+ RegionView3D rv3d = {{{0}}};
/* connect data */
- v3d.regionbase.first= v3d.regionbase.last= &ar;
- ar.regiondata= &rv3d;
- ar.regiontype= RGN_TYPE_WINDOW;
+ v3d.regionbase.first = v3d.regionbase.last = &ar;
+ ar.regiondata = &rv3d;
+ ar.regiontype = RGN_TYPE_WINDOW;
- v3d.camera= camera;
- v3d.lay= scene->lay;
+ v3d.camera = camera;
+ v3d.lay = scene->lay;
v3d.drawtype = drawtype;
v3d.flag2 = V3D_RENDER_OVERRIDE;
- rv3d.persp= RV3D_CAMOB;
+ rv3d.persp = RV3D_CAMOB;
copy_m4_m4(rv3d.viewinv, v3d.camera->obmat);
normalize_m4(rv3d.viewinv);
@@ -2600,15 +2656,15 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, Object *camera, int w
camera_params_compute_matrix(&params);
copy_m4_m4(rv3d.winmat, params.winmat);
- v3d.near= params.clipsta;
- v3d.far= params.clipend;
- v3d.lens= params.lens;
+ v3d.near = params.clipsta;
+ v3d.far = params.clipend;
+ v3d.lens = params.lens;
}
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);
}
@@ -2619,7 +2675,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, Object *camera, int w
*/
static void draw_viewport_fps(Scene *scene, ARegion *ar)
{
- ScreenFrameRateInfo *fpsi= scene->fps_info;
+ ScreenFrameRateInfo *fpsi = scene->fps_info;
float fps;
char printable[16];
int i, tot;
@@ -2631,11 +2687,11 @@ static void draw_viewport_fps(Scene *scene, ARegion *ar)
#if 0
/* this is too simple, better do an average */
- fps = (float)(1.0/(fpsi->lredrawtime-fpsi->redrawtime))
+ fps = (float)(1.0 / (fpsi->lredrawtime - fpsi->redrawtime))
#else
- fpsi->redrawtimes_fps[fpsi->redrawtime_index] = (float)(1.0/(fpsi->lredrawtime-fpsi->redrawtime));
+ fpsi->redrawtimes_fps[fpsi->redrawtime_index] = (float)(1.0 / (fpsi->lredrawtime - fpsi->redrawtime));
- for (i=0, tot=0, fps=0.0f ; i < REDRAW_FRAME_AVERAGE ; i++) {
+ for (i = 0, tot = 0, fps = 0.0f; i < REDRAW_FRAME_AVERAGE; i++) {
if (fpsi->redrawtimes_fps[i]) {
fps += fpsi->redrawtimes_fps[i];
tot++;
@@ -2652,44 +2708,53 @@ static void draw_viewport_fps(Scene *scene, ARegion *ar)
}
#endif
- /* is this more then half a frame behind? */
- if (fps+0.5f < (float)(FPS)) {
+ /* is this more then half a frame behind? */
+ if (fps + 0.5f < (float)(FPS)) {
UI_ThemeColor(TH_REDALERT);
BLI_snprintf(printable, sizeof(printable), "fps: %.2f", fps);
}
else {
UI_ThemeColor(TH_TEXT_HI);
- BLI_snprintf(printable, sizeof(printable), "fps: %i", (int)(fps+0.5f));
+ BLI_snprintf(printable, sizeof(printable), "fps: %i", (int)(fps + 0.5f));
}
- BLF_draw_default_ascii(22, ar->winy-17, 0.0f, printable, sizeof(printable));
+ BLF_draw_default_ascii(22, ar->winy - 17, 0.0f, printable, sizeof(printable));
}
static int view3d_main_area_draw_engine(const bContext *C, ARegion *ar)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
View3D *v3d = CTX_wm_view3d(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
RenderEngineType *type;
+ /* create render engine */
if (!rv3d->render_engine) {
- type= RE_engines_find(scene->r.engine);
+ type = RE_engines_find(scene->r.engine);
if (!(type->view_update && type->view_draw))
return 0;
- rv3d->render_engine= RE_engine_create(type);
+ rv3d->render_engine = RE_engine_create(type);
type->view_update(rv3d->render_engine, C);
}
+ /* setup view matrices */
view3d_main_area_setup_view(scene, v3d, ar, NULL, NULL);
+ /* background draw */
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
- glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
ED_region_pixelspace(ar);
- type= rv3d->render_engine->type;
+ /* render result draw */
+ if (v3d->flag & V3D_DISPBGPICS)
+ draw_bgpic(scene, ar, v3d);
+ else
+ fdrawcheckerboard(0, 0, ar->winx, ar->winy);
+
+ type = rv3d->render_engine->type;
type->view_draw(rv3d->render_engine, C);
return 1;
@@ -2706,9 +2771,9 @@ static void view3d_main_area_draw_engine_info(RegionView3D *rv3d, ARegion *ar)
/* warning: this function has duplicate drawing in ED_view3d_draw_offscreen() */
static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const char **grid_unit)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
View3D *v3d = CTX_wm_view3d(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
Base *base;
float backcol[3];
unsigned int lay_used;
@@ -2734,7 +2799,7 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const
else
UI_ThemeClearColor(TH_BACK);
- glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/* setup view matrices */
view3d_main_area_setup_view(scene, v3d, ar, NULL, NULL);
@@ -2746,37 +2811,39 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const
/* set zbuffer after we draw clipping region */
if (v3d->drawtype > OB_WIRE) {
- v3d->zbuf= TRUE;
+ v3d->zbuf = TRUE;
glEnable(GL_DEPTH_TEST);
}
else
- v3d->zbuf= FALSE;
+ 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;
+ rv3d->gridview = v3d->grid;
if ((rv3d->view == RV3D_VIEW_USER) || (rv3d->persp != RV3D_ORTHO)) {
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
drawfloor(scene, v3d, grid_unit);
}
- if (rv3d->persp==RV3D_CAMOB) {
+ if (rv3d->persp == RV3D_CAMOB) {
if (scene->world) {
if (scene->world->mode & WO_STARS) {
RE_make_stars(NULL, scene, star_stuff_init_func, star_stuff_vertex_func,
- star_stuff_term_func);
+ star_stuff_term_func);
}
}
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
if (v3d->flag & V3D_DISPBGPICS) draw_bgpic(scene, ar, v3d);
}
}
}
else {
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
ED_region_pixelspace(ar);
drawgrid(&scene->unit, ar, v3d, grid_unit);
/* XXX make function? replaces persp(1) */
@@ -2802,7 +2869,7 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const
if (v3d->lay & base->lay) {
UI_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f);
- draw_object(scene, ar, v3d, base, DRAW_CONSTCOLOR|DRAW_SCENESET);
+ draw_object(scene, ar, v3d, base, DRAW_CONSTCOLOR | DRAW_SCENESET);
if (base->object->transflag & OB_DUPLI) {
draw_dupli_objects_color(scene, ar, v3d, base, TH_WIRE);
@@ -2813,11 +2880,11 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const
/* Transp and X-ray afterdraw stuff for sets is done later */
}
- lay_used= 0;
+ lay_used = 0;
/* then draw not selected and the duplis, but skip editmode object */
- for (base= scene->base.first; base; base= base->next) {
- lay_used |= base->lay & ((1<<20)-1);
+ for (base = scene->base.first; base; base = base->next) {
+ lay_used |= base->lay & ((1 << 20) - 1);
if (v3d->lay & base->lay) {
@@ -2825,8 +2892,8 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const
if (base->object->transflag & OB_DUPLI) {
draw_dupli_objects(scene, ar, v3d, base);
}
- if ((base->flag & SELECT)==0) {
- if (base->object!=scene->obedit)
+ if ((base->flag & SELECT) == 0) {
+ if (base->object != scene->obedit)
draw_object(scene, ar, v3d, base, 0);
}
}
@@ -2834,23 +2901,23 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const
if (v3d->lay_used != lay_used) { /* happens when loading old files or loading with UI load */
/* find header and force tag redraw */
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar_header= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar_header = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
ED_region_tag_redraw(ar_header); /* can be NULL */
- v3d->lay_used= lay_used;
+ v3d->lay_used = lay_used;
}
/* draw selected and editmode */
- for (base= scene->base.first; base; base= base->next) {
+ for (base = scene->base.first; base; base = base->next) {
if (v3d->lay & base->lay) {
- if (base->object==scene->obedit || ( base->flag & SELECT) )
+ if (base->object == scene->obedit || (base->flag & SELECT) )
draw_object(scene, ar, v3d, base, 0);
}
}
// REEB_draw();
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
/* must be before xray draw which clears the depth buffer */
if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
draw_gpencil_view3d(scene, v3d, ar, 1);
@@ -2858,9 +2925,9 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const
}
/* Transp and X-ray afterdraw stuff */
- if (v3d->afterdraw_transp.first) view3d_draw_transp(scene, ar, v3d);
- if (v3d->afterdraw_xray.first) view3d_draw_xray(scene, ar, v3d, 1); // clears zbuffer if it is used!
- if (v3d->afterdraw_xraytransp.first) view3d_draw_xraytransp(scene, ar, v3d, 1);
+ if (v3d->afterdraw_transp.first) view3d_draw_transp(scene, ar, v3d);
+ if (v3d->afterdraw_xray.first) view3d_draw_xray(scene, ar, v3d, 1); // clears zbuffer if it is used!
+ if (v3d->afterdraw_xraytransp.first) view3d_draw_xraytransp(scene, ar, v3d, 1);
ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
@@ -2868,17 +2935,19 @@ 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;
+ v3d->zbuf = FALSE;
glDisable(GL_DEPTH_TEST);
}
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
BDR_drawSketch(C);
}
@@ -2890,20 +2959,20 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const
static void view3d_main_area_draw_info(const bContext *C, ARegion *ar, const char *grid_unit)
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
View3D *v3d = CTX_wm_view3d(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
- bScreen *screen= CTX_wm_screen(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
+ bScreen *screen = CTX_wm_screen(C);
Object *ob;
- if (rv3d->persp==RV3D_CAMOB)
+ if (rv3d->persp == RV3D_CAMOB)
drawviewborder(scene, ar, v3d);
- if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
/* draw grease-pencil stuff - needed to get paint-buffer shown too (since it's 2D) */
- // if (v3d->flag2 & V3D_DISPGP)
- draw_gpencil_view3d(scene, v3d, ar, 0);
+ // if (v3d->flag2 & V3D_DISPGP)
+ draw_gpencil_view3d(scene, v3d, ar, 0);
drawcursor(scene, ar, v3d);
}
@@ -2913,7 +2982,7 @@ static void view3d_main_area_draw_info(const bContext *C, ARegion *ar, const cha
else
draw_view_icon(rv3d);
- ob= OBACT;
+ ob = OBACT;
if (U.uiflag & USER_DRAWVIEWINFO)
draw_selected_name(scene, ob);
@@ -2930,14 +2999,14 @@ static void view3d_main_area_draw_info(const bContext *C, ARegion *ar, const cha
}
if (grid_unit) { /* draw below the viewport name */
- char numstr[32]= "";
+ char numstr[32] = "";
UI_ThemeColor(TH_TEXT_HI);
if (v3d->grid != 1.0f) {
BLI_snprintf(numstr, sizeof(numstr), "%s x %.4g", grid_unit, v3d->grid);
}
- BLF_draw_default_ascii(22, ar->winy-(USER_SHOW_VIEWPORTNAME?40:20), 0.0f,
+ BLF_draw_default_ascii(22, ar->winy - (USER_SHOW_VIEWPORTNAME ? 40 : 20), 0.0f,
numstr[0] ? numstr : grid_unit, sizeof(numstr));
}
}
@@ -2945,7 +3014,7 @@ static void view3d_main_area_draw_info(const bContext *C, ARegion *ar, const cha
void view3d_main_area_draw(const bContext *C, ARegion *ar)
{
View3D *v3d = CTX_wm_view3d(C);
- const char *grid_unit= NULL;
+ const char *grid_unit = NULL;
/* draw viewport using external renderer? */
if (!(v3d->drawtype == OB_RENDER && view3d_main_area_draw_engine(C, ar))) {
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 8d91962594f..4fdae8f8b24 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -77,7 +77,7 @@
#include "PIL_time.h" /* smoothview */
-#include "view3d_intern.h" // own include
+#include "view3d_intern.h" // own include
/* ********************** view3d_edit: view manipulations ********************* */
@@ -86,7 +86,7 @@ int ED_view3d_camera_lock_check(View3D *v3d, RegionView3D *rv3d)
return ((v3d->camera) &&
(v3d->camera->id.lib == NULL) &&
(v3d->flag2 & V3D_LOCK_CAMERA) &&
- (rv3d->persp==RV3D_CAMOB));
+ (rv3d->persp == RV3D_CAMOB));
}
void ED_view3d_camera_lock_init(View3D *v3d, RegionView3D *rv3d)
@@ -103,14 +103,14 @@ int ED_view3d_camera_lock_sync(View3D *v3d, RegionView3D *rv3d)
ObjectTfmProtectedChannels obtfm;
Object *root_parent;
- if ((U.uiflag & USER_CAM_LOCK_NO_PARENT)==0 && (root_parent= v3d->camera->parent)) {
+ if ((U.uiflag & USER_CAM_LOCK_NO_PARENT) == 0 && (root_parent = v3d->camera->parent)) {
Object *ob_update;
float view_mat[4][4];
float diff_mat[4][4];
float parent_mat[4][4];
while (root_parent->parent) {
- root_parent= root_parent->parent;
+ root_parent = root_parent->parent;
}
ED_view3d_to_m4(view_mat, rv3d->ofs, rv3d->viewquat, rv3d->dist);
@@ -124,11 +124,11 @@ int ED_view3d_camera_lock_sync(View3D *v3d, RegionView3D *rv3d)
object_apply_mat4(root_parent, parent_mat, TRUE, FALSE);
object_tfm_protected_restore(root_parent, &obtfm, root_parent->protectflag);
- ob_update= v3d->camera;
+ ob_update = v3d->camera;
while (ob_update) {
DAG_id_tag_update(&ob_update->id, OB_RECALC_OB);
- WM_main_add_notifier(NC_OBJECT|ND_TRANSFORM, ob_update);
- ob_update= ob_update->parent;
+ WM_main_add_notifier(NC_OBJECT | ND_TRANSFORM, ob_update);
+ ob_update = ob_update->parent;
}
}
else {
@@ -137,7 +137,7 @@ int ED_view3d_camera_lock_sync(View3D *v3d, RegionView3D *rv3d)
object_tfm_protected_restore(v3d->camera, &obtfm, v3d->camera->protectflag);
DAG_id_tag_update(&v3d->camera->id, OB_RECALC_OB);
- WM_main_add_notifier(NC_OBJECT|ND_TRANSFORM, v3d->camera);
+ WM_main_add_notifier(NC_OBJECT | ND_TRANSFORM, v3d->camera);
}
return TRUE;
@@ -155,73 +155,73 @@ static void view3d_boxview_clip(ScrArea *sa)
ARegion *ar;
BoundBox *bb = MEM_callocN(sizeof(BoundBox), "clipbb");
float clip[6][4];
- float x1= 0.0f, y1= 0.0f, z1= 0.0f, ofs[3] = {0.0f, 0.0f, 0.0f};
+ float x1 = 0.0f, y1 = 0.0f, z1 = 0.0f, ofs[3] = {0.0f, 0.0f, 0.0f};
int val;
/* create bounding box */
- for (ar= sa->regionbase.first; ar; ar= ar->next) {
- if (ar->regiontype==RGN_TYPE_WINDOW) {
- RegionView3D *rv3d= ar->regiondata;
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
+ RegionView3D *rv3d = ar->regiondata;
if (rv3d->viewlock & RV3D_BOXCLIP) {
if (ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM)) {
- if (ar->winx>ar->winy) x1= rv3d->dist;
- else x1= ar->winx*rv3d->dist/ar->winy;
+ if (ar->winx > ar->winy) x1 = rv3d->dist;
+ else x1 = ar->winx * rv3d->dist / ar->winy;
- if (ar->winx>ar->winy) y1= ar->winy*rv3d->dist/ar->winx;
- else y1= rv3d->dist;
+ if (ar->winx > ar->winy) y1 = ar->winy * rv3d->dist / ar->winx;
+ else y1 = rv3d->dist;
copy_v2_v2(ofs, rv3d->ofs);
}
else if (ELEM(rv3d->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK)) {
- ofs[2]= rv3d->ofs[2];
+ ofs[2] = rv3d->ofs[2];
- if (ar->winx>ar->winy) z1= ar->winy*rv3d->dist/ar->winx;
- else z1= rv3d->dist;
+ if (ar->winx > ar->winy) z1 = ar->winy * rv3d->dist / ar->winx;
+ else z1 = rv3d->dist;
}
}
}
}
- for (val=0; val<8; val++) {
+ for (val = 0; val < 8; val++) {
if (ELEM4(val, 0, 3, 4, 7))
- bb->vec[val][0]= -x1 - ofs[0];
+ bb->vec[val][0] = -x1 - ofs[0];
else
- bb->vec[val][0]= x1 - ofs[0];
+ bb->vec[val][0] = x1 - ofs[0];
if (ELEM4(val, 0, 1, 4, 5))
- bb->vec[val][1]= -y1 - ofs[1];
+ bb->vec[val][1] = -y1 - ofs[1];
else
- bb->vec[val][1]= y1 - ofs[1];
+ bb->vec[val][1] = y1 - ofs[1];
if (val > 3)
- bb->vec[val][2]= -z1 - ofs[2];
+ bb->vec[val][2] = -z1 - ofs[2];
else
- bb->vec[val][2]= z1 - ofs[2];
+ bb->vec[val][2] = z1 - ofs[2];
}
/* normals for plane equations */
- normal_tri_v3( clip[0],bb->vec[0], bb->vec[1], bb->vec[4]);
- normal_tri_v3( clip[1],bb->vec[1], bb->vec[2], bb->vec[5]);
- normal_tri_v3( clip[2],bb->vec[2], bb->vec[3], bb->vec[6]);
- normal_tri_v3( clip[3],bb->vec[3], bb->vec[0], bb->vec[7]);
- normal_tri_v3( clip[4],bb->vec[4], bb->vec[5], bb->vec[6]);
- normal_tri_v3( clip[5],bb->vec[0], bb->vec[2], bb->vec[1]);
+ normal_tri_v3(clip[0], bb->vec[0], bb->vec[1], bb->vec[4]);
+ normal_tri_v3(clip[1], bb->vec[1], bb->vec[2], bb->vec[5]);
+ normal_tri_v3(clip[2], bb->vec[2], bb->vec[3], bb->vec[6]);
+ normal_tri_v3(clip[3], bb->vec[3], bb->vec[0], bb->vec[7]);
+ normal_tri_v3(clip[4], bb->vec[4], bb->vec[5], bb->vec[6]);
+ normal_tri_v3(clip[5], bb->vec[0], bb->vec[2], bb->vec[1]);
/* then plane equations */
- for (val=0; val<6; val++) {
+ for (val = 0; val < 6; val++) {
clip[val][3] = -dot_v3v3(clip[val], bb->vec[val % 5]);
}
/* create bounding box */
- for (ar= sa->regionbase.first; ar; ar= ar->next) {
- if (ar->regiontype==RGN_TYPE_WINDOW) {
- RegionView3D *rv3d= ar->regiondata;
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
+ RegionView3D *rv3d = ar->regiondata;
if (rv3d->viewlock & RV3D_BOXCLIP) {
rv3d->rflag |= RV3D_CLIPPING;
memcpy(rv3d->clip, clip, sizeof(clip));
if (rv3d->clipbb) MEM_freeN(rv3d->clipbb);
- rv3d->clipbb= MEM_dupallocN(bb);
+ rv3d->clipbb = MEM_dupallocN(bb);
}
}
}
@@ -232,33 +232,33 @@ static void view3d_boxview_clip(ScrArea *sa)
static void view3d_boxview_sync(ScrArea *sa, ARegion *ar)
{
ARegion *artest;
- RegionView3D *rv3d= ar->regiondata;
- short clip= 0;
+ RegionView3D *rv3d = ar->regiondata;
+ short clip = 0;
- for (artest= sa->regionbase.first; artest; artest= artest->next) {
- if (artest!=ar && artest->regiontype==RGN_TYPE_WINDOW) {
- RegionView3D *rv3dtest= artest->regiondata;
+ for (artest = sa->regionbase.first; artest; artest = artest->next) {
+ if (artest != ar && artest->regiontype == RGN_TYPE_WINDOW) {
+ RegionView3D *rv3dtest = artest->regiondata;
if (rv3dtest->viewlock) {
- rv3dtest->dist= rv3d->dist;
+ rv3dtest->dist = rv3d->dist;
- if ( ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM) ) {
- if ( ELEM(rv3dtest->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
- rv3dtest->ofs[0]= rv3d->ofs[0];
- else if ( ELEM(rv3dtest->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
- rv3dtest->ofs[1]= rv3d->ofs[1];
+ if (ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM) ) {
+ if (ELEM(rv3dtest->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
+ rv3dtest->ofs[0] = rv3d->ofs[0];
+ else if (ELEM(rv3dtest->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
+ rv3dtest->ofs[1] = rv3d->ofs[1];
}
- else if ( ELEM(rv3d->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK) ) {
- if ( ELEM(rv3dtest->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
- rv3dtest->ofs[0]= rv3d->ofs[0];
- else if ( ELEM(rv3dtest->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
- rv3dtest->ofs[2]= rv3d->ofs[2];
+ else if (ELEM(rv3d->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK) ) {
+ if (ELEM(rv3dtest->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
+ rv3dtest->ofs[0] = rv3d->ofs[0];
+ else if (ELEM(rv3dtest->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
+ rv3dtest->ofs[2] = rv3d->ofs[2];
}
- else if ( ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT) ) {
- if ( ELEM(rv3dtest->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
- rv3dtest->ofs[1]= rv3d->ofs[1];
- if ( ELEM(rv3dtest->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
- rv3dtest->ofs[2]= rv3d->ofs[2];
+ else if (ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT) ) {
+ if (ELEM(rv3dtest->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
+ rv3dtest->ofs[1] = rv3d->ofs[1];
+ if (ELEM(rv3dtest->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
+ rv3dtest->ofs[2] = rv3d->ofs[2];
}
clip |= rv3dtest->viewlock & RV3D_BOXCLIP;
@@ -277,15 +277,15 @@ static void view3d_boxview_sync(ScrArea *sa, ARegion *ar)
void view3d_boxview_copy(ScrArea *sa, ARegion *ar)
{
ARegion *artest;
- RegionView3D *rv3d= ar->regiondata;
- short clip= 0;
+ RegionView3D *rv3d = ar->regiondata;
+ short clip = 0;
- for (artest= sa->regionbase.first; artest; artest= artest->next) {
- if (artest!=ar && artest->regiontype==RGN_TYPE_WINDOW) {
- RegionView3D *rv3dtest= artest->regiondata;
+ for (artest = sa->regionbase.first; artest; artest = artest->next) {
+ if (artest != ar && artest->regiontype == RGN_TYPE_WINDOW) {
+ RegionView3D *rv3dtest = artest->regiondata;
if (rv3dtest->viewlock) {
- rv3dtest->dist= rv3d->dist;
+ rv3dtest->dist = rv3d->dist;
copy_v3_v3(rv3dtest->ofs, rv3d->ofs);
ED_region_tag_redraw(artest);
@@ -302,39 +302,39 @@ 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;
- RegionView3D *rv3d= ar->regiondata;
+ 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 */
- viewlock= rv3d->viewlock;
+ * 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)
- viewlock= 0;
- else if ((viewlock & RV3D_BOXVIEW)==0) {
+ if ((viewlock & RV3D_LOCKED) == 0)
+ viewlock = 0;
+ else if ((viewlock & RV3D_BOXVIEW) == 0) {
viewlock &= ~RV3D_BOXCLIP;
- do_clip= TRUE;
+ do_clip = TRUE;
}
- 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 (do_clip && (viewlock & RV3D_BOXCLIP)==0) {
+ if (do_clip && (viewlock & RV3D_BOXCLIP) == 0) {
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 */
@@ -375,53 +375,54 @@ static void calctrackballvec(rcti *rect, int mx, int my, float vec[3])
{
float x, y, radius, d, z, t;
- radius= TRACKBALLSIZE;
+ radius = TRACKBALLSIZE;
/* normalize x and y */
- x= (rect->xmax + rect->xmin)/2 - mx;
- x/= (float)((rect->xmax - rect->xmin)/4);
- y= (rect->ymax + rect->ymin)/2 - my;
- y/= (float)((rect->ymax - rect->ymin)/2);
+ x = (rect->xmax + rect->xmin) / 2 - mx;
+ x /= (float)((rect->xmax - rect->xmin) / 4);
+ y = (rect->ymax + rect->ymin) / 2 - my;
+ y /= (float)((rect->ymax - rect->ymin) / 2);
- d = sqrt(x*x + y*y);
+ d = sqrt(x * x + y * y);
if (d < radius * (float)M_SQRT1_2) { /* Inside sphere */
- z= sqrt(radius*radius - d*d);
+ z = sqrt(radius * radius - d * d);
}
else { /* On hyperbola */
- t= radius / (float)M_SQRT2;
- z= t*t / d;
+ t = radius / (float)M_SQRT2;
+ z = t * t / d;
}
- vec[0]= x;
- vec[1]= y;
- vec[2]= -z; /* yah yah! */
+ vec[0] = x;
+ vec[1] = y;
+ vec[2] = -z; /* yah yah! */
}
static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event)
{
- static float lastofs[3] = {0,0,0};
+ static float lastofs[3] = {0, 0, 0};
RegionView3D *rv3d;
- ViewOpsData *vod= MEM_callocN(sizeof(ViewOpsData), "viewops data");
+ ViewOpsData *vod = MEM_callocN(sizeof(ViewOpsData), "viewops data");
/* store data */
- op->customdata= vod;
- vod->sa= CTX_wm_area(C);
- vod->ar= CTX_wm_region(C);
- vod->v3d= vod->sa->spacedata.first;
- vod->rv3d= rv3d= vod->ar->regiondata;
+ op->customdata = vod;
+ vod->sa = CTX_wm_area(C);
+ vod->ar = CTX_wm_region(C);
+ vod->v3d = vod->sa->spacedata.first;
+ vod->rv3d = rv3d = vod->ar->regiondata;
/* set the view from the camera, if view locking is enabled.
* we may want to make this optional but for now its needed always */
ED_view3d_camera_lock_init(vod->v3d, vod->rv3d);
- vod->dist0= rv3d->dist;
+ 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;
- vod->origy= vod->oldy= event->y;
- vod->origkey= event->type; /* the key that triggered the operator. */
- vod->use_dyn_ofs= (U.uiflag & USER_ORBIT_SELECTION) ? 1:0;
+ vod->origx = vod->oldx = event->x;
+ vod->origy = vod->oldy = event->y;
+ vod->origkey = event->type; /* the key that triggered the operator. */
+ vod->use_dyn_ofs = (U.uiflag & USER_ORBIT_SELECTION) ? 1 : 0;
copy_v3_v3(vod->ofs, rv3d->ofs);
if (vod->use_dyn_ofs) {
@@ -433,7 +434,7 @@ static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event)
view3d_operator_needs_opengl(C); /* needed for zbuf drawing */
- if ((vod->use_dyn_ofs=ED_view3d_autodist(CTX_data_scene(C), vod->ar, vod->v3d, event->mval, vod->dyn_ofs))) {
+ if ((vod->use_dyn_ofs = ED_view3d_autodist(CTX_data_scene(C), vod->ar, vod->v3d, event->mval, vod->dyn_ofs))) {
if (rv3d->is_persp) {
float my_origin[3]; /* original G.vd->ofs */
float my_pivot[3]; /* view */
@@ -443,10 +444,10 @@ static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event)
float mat[3][3];
float upvec[3];
- negate_v3_v3(my_origin, rv3d->ofs); /* ofs is flipped */
+ 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;
@@ -455,7 +456,7 @@ static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event)
mul_m3_v3(mat, upvec);
sub_v3_v3v3(my_pivot, rv3d->ofs, upvec);
- negate_v3(my_pivot); /* ofs is flipped */
+ negate_v3(my_pivot); /* ofs is flipped */
/* find a new ofs value that is along the view axis (rather than the mouse location) */
closest_to_line_v3(dvec, vod->dyn_ofs, my_pivot, my_origin);
@@ -475,17 +476,17 @@ static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event)
ED_view3d_win_to_vector(vod->ar, mval_f, vod->mousevec);
}
- /* lookup, we dont pass on v3d to prevent confusement */
- vod->grid= vod->v3d->grid;
- vod->far= vod->v3d->far;
+ /* lookup, we don't pass on v3d to prevent confusement */
+ vod->grid = vod->v3d->grid;
+ vod->far = vod->v3d->far;
calctrackballvec(&vod->ar->winrct, event->x, event->y, vod->trackvec);
initgrabz(rv3d, -rv3d->ofs[0], -rv3d->ofs[1], -rv3d->ofs[2]);
- vod->reverse= 1.0f;
+ vod->reverse = 1.0f;
if (rv3d->persmat[2][1] < 0.0f)
- vod->reverse= -1.0f;
+ vod->reverse = -1.0f;
rv3d->rflag |= RV3D_NAVIGATING;
}
@@ -496,18 +497,18 @@ static void viewops_data_free(bContext *C, wmOperator *op)
Paint *p = paint_get_active(CTX_data_scene(C));
if (op->customdata) {
- ViewOpsData *vod= op->customdata;
- ar= vod->ar;
+ ViewOpsData *vod = op->customdata;
+ ar = vod->ar;
vod->rv3d->rflag &= ~RV3D_NAVIGATING;
if (vod->timer)
WM_event_remove_timer(CTX_wm_manager(C), vod->timer->win, vod->timer);
MEM_freeN(vod);
- op->customdata= NULL;
+ op->customdata = NULL;
}
else {
- ar= CTX_wm_region(C);
+ ar = CTX_wm_region(C);
}
if (p && (p->flags & PAINT_FAST_NAVIGATE))
@@ -516,8 +517,6 @@ static void viewops_data_free(bContext *C, wmOperator *op)
/* ************************** viewrotate **********************************/
-static const float thres = 0.93f; //cos(20 deg);
-
#define COS45 0.7071068
#define SIN45 COS45
@@ -569,39 +568,40 @@ static const float snapquats[NUM_SNAP_QUATS][5] = {
};
enum {
- VIEW_PASS= 0,
+ VIEW_PASS = 0,
VIEW_APPLY,
VIEW_CONFIRM
};
/* NOTE: these defines are saved in keymap files, do not change values but just add new ones */
-#define VIEW_MODAL_CONFIRM 1 /* used for all view operations */
-#define VIEWROT_MODAL_AXIS_SNAP_ENABLE 2
-#define VIEWROT_MODAL_AXIS_SNAP_DISABLE 3
-#define VIEWROT_MODAL_SWITCH_ZOOM 4
-#define VIEWROT_MODAL_SWITCH_MOVE 5
-#define VIEWROT_MODAL_SWITCH_ROTATE 6
+#define VIEW_MODAL_CONFIRM 1 /* used for all view operations */
+#define VIEWROT_MODAL_AXIS_SNAP_ENABLE 2
+#define VIEWROT_MODAL_AXIS_SNAP_DISABLE 3
+#define VIEWROT_MODAL_SWITCH_ZOOM 4
+#define VIEWROT_MODAL_SWITCH_MOVE 5
+#define VIEWROT_MODAL_SWITCH_ROTATE 6
/* called in transform_ops.c, on each regeneration of keymaps */
void viewrotate_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
- {VIEW_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
+ {VIEW_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
- {VIEWROT_MODAL_AXIS_SNAP_ENABLE, "AXIS_SNAP_ENABLE", 0, "Enable Axis Snap", ""},
- {VIEWROT_MODAL_AXIS_SNAP_DISABLE, "AXIS_SNAP_DISABLE", 0, "Disable Axis Snap", ""},
+ {VIEWROT_MODAL_AXIS_SNAP_ENABLE, "AXIS_SNAP_ENABLE", 0, "Enable Axis Snap", ""},
+ {VIEWROT_MODAL_AXIS_SNAP_DISABLE, "AXIS_SNAP_DISABLE", 0, "Disable Axis Snap", ""},
- {VIEWROT_MODAL_SWITCH_ZOOM, "SWITCH_TO_ZOOM", 0, "Switch to Zoom"},
- {VIEWROT_MODAL_SWITCH_MOVE, "SWITCH_TO_MOVE", 0, "Switch to Move"},
+ {VIEWROT_MODAL_SWITCH_ZOOM, "SWITCH_TO_ZOOM", 0, "Switch to Zoom"},
+ {VIEWROT_MODAL_SWITCH_MOVE, "SWITCH_TO_MOVE", 0, "Switch to Move"},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}
+ };
- wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "View3D Rotate Modal");
+ wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "View3D Rotate Modal");
/* this function is called for each spacetype, only needs to add map once */
if (keymap) return;
- keymap= WM_modalkeymap_add(keyconf, "View3D Rotate Modal", modal_items);
+ keymap = WM_modalkeymap_add(keyconf, "View3D Rotate Modal", modal_items);
/* items for modal map */
WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_RELEASE, KM_ANY, 0, VIEW_MODAL_CONFIRM);
@@ -610,11 +610,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");
@@ -623,9 +624,9 @@ void viewrotate_modal_keymap(wmKeyConfig *keyconf)
static void viewrotate_apply(ViewOpsData *vod, int x, int y)
{
- RegionView3D *rv3d= vod->rv3d;
+ RegionView3D *rv3d = vod->rv3d;
- rv3d->view= RV3D_VIEW_USER; /* need to reset everytime because of view snapping */
+ rv3d->view = RV3D_VIEW_USER; /* need to reset everytime because of view snapping */
if (U.flag & USER_TRACKBALL) {
float phi, si, q1[4], dvec[3], newvec[3];
@@ -637,23 +638,22 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y)
si = len_v3(dvec);
si /= (float)(2.0 * TRACKBALLSIZE);
- cross_v3_v3v3(q1+1, vod->trackvec, newvec);
- normalize_v3(q1+1);
+ 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);
- mul_v3_fl(q1+1, sin(phi));
+ q1[0] = cos(phi);
+ mul_v3_fl(q1 + 1, sin(phi));
mul_qt_qtqt(vod->viewquat, q1, vod->oldquat);
if (vod->use_dyn_ofs) {
@@ -676,23 +676,23 @@ 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;
/* Get the 3x3 matrix and its inverse from the quaternion */
- quat_to_mat3( m,vod->viewquat);
- invert_m3_m3(m_inv,m);
+ quat_to_mat3(m, vod->viewquat);
+ invert_m3_m3(m_inv, m);
/* Determine the direction of the x vector (for rotating up and down) */
/* This can likely be computed directly from the quaternion. */
- mul_m3_v3(m_inv,xvec);
+ mul_m3_v3(m_inv, xvec);
/* Perform the up/down rotation */
phi = sensitivity * -(y - vod->oldy);
q1[0] = cos(phi);
- mul_v3_v3fl(q1+1, xvec, sin(phi));
+ mul_v3_v3fl(q1 + 1, xvec, sin(phi));
mul_qt_qtqt(vod->viewquat, vod->viewquat, q1);
if (vod->use_dyn_ofs) {
@@ -721,21 +721,21 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y)
if (vod->axis_snap) {
int i;
float viewquat_inv[4];
- float zaxis[3]={0,0,1};
+ float zaxis[3] = {0, 0, 1};
invert_qt_qt(viewquat_inv, vod->viewquat);
mul_qt_v3(viewquat_inv, zaxis);
- for (i = 0 ; i < NUM_SNAP_QUATS; i++) {
+ for (i = 0; i < NUM_SNAP_QUATS; i++) {
float view = (int)snapquats[i][4];
float viewquat_inv_test[4];
- float zaxis_test[3]={0,0,1};
+ float zaxis_test[3] = {0, 0, 1};
invert_qt_qt(viewquat_inv_test, snapquats[i]);
mul_qt_v3(viewquat_inv_test, zaxis_test);
- if (angle_v3v3(zaxis_test, zaxis) < DEG2RADF(45/3)) {
+ if (angle_v3v3(zaxis_test, zaxis) < DEG2RADF(45 / 3)) {
/* find the best roll */
float quat_roll[4], quat_final[4], quat_best[4];
float viewquat_align[4]; /* viewquat aligned to zaxis_test */
@@ -752,10 +752,10 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y)
invert_qt_qt(viewquat_align_inv, viewquat_align);
/* find best roll */
- for (j= 0; j<8; j++) {
+ for (j = 0; j < 8; j++) {
float angle;
- float xaxis1[3]={1,0,0};
- float xaxis2[3]={1,0,0};
+ float xaxis1[3] = {1, 0, 0};
+ float xaxis2[3] = {1, 0, 0};
float quat_final_inv[4];
axis_angle_to_quat(quat_roll, zaxis_test, (float)j * DEG2RADF(45.0f));
@@ -768,24 +768,24 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y)
invert_qt_qt(quat_final_inv, quat_final);
mul_qt_v3(viewquat_align_inv, xaxis1);
mul_qt_v3(quat_final_inv, xaxis2);
- angle= angle_v3v3(xaxis1, xaxis2);
+ angle = angle_v3v3(xaxis1, xaxis2);
if (angle <= best_angle) {
- best_angle= angle;
+ best_angle = angle;
copy_qt_qt(quat_best, quat_final);
- if (j) view= 0; /* view grid assumes certain up axis */
+ if (j) view = 0; /* view grid assumes certain up axis */
}
}
copy_qt_qt(vod->viewquat, quat_best);
- rv3d->view= view; /* if we snap to a rolled camera the grid is invalid */
+ rv3d->view = view; /* if we snap to a rolled camera the grid is invalid */
break;
}
}
}
- vod->oldx= x;
- vod->oldy= y;
+ vod->oldx = x;
+ vod->oldy = y;
/* avoid precision loss over time */
normalize_qt(vod->viewquat);
@@ -801,44 +801,44 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y)
static int viewrotate_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- ViewOpsData *vod= op->customdata;
- short event_code= VIEW_PASS;
+ ViewOpsData *vod = op->customdata;
+ short event_code = VIEW_PASS;
/* execute the events */
- if (event->type==MOUSEMOVE) {
- event_code= VIEW_APPLY;
+ if (event->type == MOUSEMOVE) {
+ event_code = VIEW_APPLY;
}
- else if (event->type==EVT_MODAL_MAP) {
+ else if (event->type == EVT_MODAL_MAP) {
switch (event->val) {
case VIEW_MODAL_CONFIRM:
- event_code= VIEW_CONFIRM;
+ event_code = VIEW_CONFIRM;
break;
case VIEWROT_MODAL_AXIS_SNAP_ENABLE:
- vod->axis_snap= TRUE;
- event_code= VIEW_APPLY;
+ vod->axis_snap = TRUE;
+ event_code = VIEW_APPLY;
break;
case VIEWROT_MODAL_AXIS_SNAP_DISABLE:
- vod->axis_snap= FALSE;
- event_code= VIEW_APPLY;
+ vod->axis_snap = FALSE;
+ event_code = VIEW_APPLY;
break;
case VIEWROT_MODAL_SWITCH_ZOOM:
WM_operator_name_call(C, "VIEW3D_OT_zoom", WM_OP_INVOKE_DEFAULT, NULL);
- event_code= VIEW_CONFIRM;
+ event_code = VIEW_CONFIRM;
break;
case VIEWROT_MODAL_SWITCH_MOVE:
WM_operator_name_call(C, "VIEW3D_OT_move", WM_OP_INVOKE_DEFAULT, NULL);
- event_code= VIEW_CONFIRM;
+ event_code = VIEW_CONFIRM;
break;
}
}
- else if (event->type==vod->origkey && event->val==KM_RELEASE) {
- event_code= VIEW_CONFIRM;
+ else if (event->type == vod->origkey && event->val == KM_RELEASE) {
+ event_code = VIEW_CONFIRM;
}
- if (event_code==VIEW_APPLY) {
+ if (event_code == VIEW_APPLY) {
viewrotate_apply(vod, event->x, event->y);
}
- else if (event_code==VIEW_CONFIRM) {
+ else if (event_code == VIEW_CONFIRM) {
ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
@@ -855,8 +855,8 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* makes op->customdata */
viewops_data_create(C, op, event);
- vod= op->customdata;
- rv3d= vod->rv3d;
+ vod = op->customdata;
+ rv3d = vod->rv3d;
if (rv3d->viewlock) { /* poll should check but in some cases fails, see poll func for details */
viewops_data_free(C, op);
@@ -868,10 +868,10 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event)
if (U.uiflag & USER_AUTOPERSP) {
if (!ED_view3d_camera_lock_check(vod->v3d, vod->rv3d)) {
- rv3d->persp= RV3D_PERSP;
+ rv3d->persp = RV3D_PERSP;
}
}
- else if (rv3d->persp==RV3D_CAMOB) {
+ else if (rv3d->persp == RV3D_CAMOB) {
/* changed since 2.4x, use the camera view */
if (vod->v3d->camera) {
@@ -879,7 +879,7 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
if (!ED_view3d_camera_lock_check(vod->v3d, vod->rv3d)) {
- rv3d->persp= rv3d->lpersp;
+ rv3d->persp = rv3d->lpersp;
}
}
ED_region_tag_redraw(vod->ar);
@@ -913,8 +913,8 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int view3d_camera_active_poll(bContext *C)
{
if (ED_operator_view3d_active(C)) {
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
- if (rv3d && rv3d->persp==RV3D_CAMOB) {
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
+ if (rv3d && rv3d->persp == RV3D_CAMOB) {
return 1;
}
}
@@ -930,7 +930,7 @@ static int view3d_camera_user_poll(bContext *C)
if (ED_view3d_context_user_region(C, &v3d, &ar)) {
RegionView3D *rv3d = ar->regiondata;
- if (rv3d->persp==RV3D_CAMOB) {
+ if (rv3d->persp == RV3D_CAMOB) {
return 1;
}
}
@@ -949,29 +949,29 @@ void VIEW3D_OT_rotate(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Rotate view";
+ ot->name = "Rotate view";
ot->description = "Rotate the view";
- ot->idname= "VIEW3D_OT_rotate";
+ ot->idname = "VIEW3D_OT_rotate";
/* api callbacks */
- ot->invoke= viewrotate_invoke;
- ot->modal= viewrotate_modal;
- ot->poll= ED_operator_region_view3d_active;
- ot->cancel= viewrotate_cancel;
+ ot->invoke = viewrotate_invoke;
+ ot->modal = viewrotate_modal;
+ ot->poll = ED_operator_region_view3d_active;
+ ot->cancel = viewrotate_cancel;
/* flags */
- ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
+ ot->flag = OPTYPE_BLOCKING | OPTYPE_GRAB_POINTER;
}
/* NDOF utility functions
* (should these functions live in this file?)
*/
-float ndof_to_axis_angle(struct wmNDOFMotionData* ndof, float axis[3])
+float ndof_to_axis_angle(struct wmNDOFMotionData*ndof, float axis[3])
{
return ndof->dt * normalize_v3_v3(axis, ndof->rvec);
}
-void ndof_to_quat(struct wmNDOFMotionData* ndof, float q[4])
+void ndof_to_quat(struct wmNDOFMotionData*ndof, float q[4])
{
float axis[3];
float angle;
@@ -990,8 +990,8 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event
return OPERATOR_CANCELLED;
else {
View3D *v3d = CTX_wm_view3d(C);
- RegionView3D* rv3d = CTX_wm_region_view3d(C);
- wmNDOFMotionData* ndof = (wmNDOFMotionData*) event->customdata;
+ RegionView3D*rv3d = CTX_wm_region_view3d(C);
+ wmNDOFMotionData*ndof = (wmNDOFMotionData *) event->customdata;
ED_view3d_camera_lock_init(v3d, rv3d);
@@ -1013,7 +1013,7 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event
/* #define DEBUG_NDOF_MOTION */
#ifdef DEBUG_NDOF_MOTION
printf("ndof: T=(%.2f,%.2f,%.2f) R=(%.2f,%.2f,%.2f) dt=%.3f delivered to 3D view\n",
- ndof->tx, ndof->ty, ndof->tz, ndof->rx, ndof->ry, ndof->rz, ndof->dt);
+ ndof->tx, ndof->ty, ndof->tz, ndof->rx, ndof->ry, ndof->rz, ndof->dt);
#endif
if (ndof->tz) {
@@ -1078,7 +1078,7 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event
/* turntable view code by John Aughey, adapted for 3D mouse by [mce] */
float angle, rot[4];
- float xvec[3] = {1,0,0};
+ float xvec[3] = {1, 0, 0};
/* Determine the direction of the x vector (for rotating up and down) */
mul_qt_v3(view_inv, xvec);
@@ -1088,7 +1088,7 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event
if (U.ndof_flag & NDOF_TILT_INVERT_AXIS)
angle = -angle;
rot[0] = cos(angle);
- mul_v3_v3fl(rot+1, xvec, sin(angle));
+ mul_v3_v3fl(rot + 1, xvec, sin(angle));
mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, rot);
/* Perform the orbital rotation */
@@ -1141,9 +1141,9 @@ static int ndof_pan_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
if (event->type != NDOF_MOTION)
return OPERATOR_CANCELLED;
else {
- View3D *v3d= CTX_wm_view3d(C);
- RegionView3D* rv3d = CTX_wm_region_view3d(C);
- wmNDOFMotionData* ndof = (wmNDOFMotionData*) event->customdata;
+ View3D *v3d = CTX_wm_view3d(C);
+ RegionView3D*rv3d = CTX_wm_region_view3d(C);
+ wmNDOFMotionData*ndof = (wmNDOFMotionData *) event->customdata;
ED_view3d_camera_lock_init(v3d, rv3d);
@@ -1159,7 +1159,7 @@ static int ndof_pan_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
float pan_vec[3] = {
ndof->tx, ndof->ty, 0
- };
+ };
/* "zoom in" or "translate"? depends on zoom mode in user settings? */
if (ndof->tz) {
@@ -1236,29 +1236,31 @@ void VIEW3D_OT_ndof_pan(struct wmOperatorType *ot)
void viewmove_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
- {VIEW_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
+ {VIEW_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
- {VIEWROT_MODAL_SWITCH_ZOOM, "SWITCH_TO_ZOOM", 0, "Switch to Zoom"},
- {VIEWROT_MODAL_SWITCH_ROTATE, "SWITCH_TO_ROTATE", 0, "Switch to Rotate"},
+ {VIEWROT_MODAL_SWITCH_ZOOM, "SWITCH_TO_ZOOM", 0, "Switch to Zoom"},
+ {VIEWROT_MODAL_SWITCH_ROTATE, "SWITCH_TO_ROTATE", 0, "Switch to Rotate"},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}
+ };
- wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "View3D Move Modal");
+ wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "View3D Move Modal");
/* this function is called for each spacetype, only needs to add map once */
if (keymap) return;
- keymap= WM_modalkeymap_add(keyconf, "View3D Move Modal", modal_items);
+ keymap = WM_modalkeymap_add(keyconf, "View3D Move Modal", modal_items);
/* items for modal map */
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");
@@ -1267,10 +1269,10 @@ void viewmove_modal_keymap(wmKeyConfig *keyconf)
static void viewmove_apply(ViewOpsData *vod, int x, int y)
{
- if ((vod->rv3d->persp==RV3D_CAMOB) && !ED_view3d_camera_lock_check(vod->v3d, vod->rv3d)) {
- const float zoomfac= BKE_screen_view3d_zoom_to_fac((float)vod->rv3d->camzoom) * 2.0f;
- vod->rv3d->camdx += (vod->oldx - x)/(vod->ar->winx * zoomfac);
- vod->rv3d->camdy += (vod->oldy - y)/(vod->ar->winy * zoomfac);
+ if ((vod->rv3d->persp == RV3D_CAMOB) && !ED_view3d_camera_lock_check(vod->v3d, vod->rv3d)) {
+ const float zoomfac = BKE_screen_view3d_zoom_to_fac((float)vod->rv3d->camzoom) * 2.0f;
+ vod->rv3d->camdx += (vod->oldx - x) / (vod->ar->winx * zoomfac);
+ vod->rv3d->camdy += (vod->oldy - y) / (vod->ar->winy * zoomfac);
CLAMP(vod->rv3d->camdx, -1.0f, 1.0f);
CLAMP(vod->rv3d->camdy, -1.0f, 1.0f);
}
@@ -1278,8 +1280,8 @@ static void viewmove_apply(ViewOpsData *vod, int x, int y)
float dvec[3];
float mval_f[2];
- mval_f[0]= x - vod->oldx;
- mval_f[1]= y - vod->oldy;
+ mval_f[0] = x - vod->oldx;
+ mval_f[1] = y - vod->oldy;
ED_view3d_win_to_delta(vod->ar, mval_f, dvec);
add_v3_v3(vod->rv3d->ofs, dvec);
@@ -1288,8 +1290,8 @@ static void viewmove_apply(ViewOpsData *vod, int x, int y)
view3d_boxview_sync(vod->sa, vod->ar);
}
- vod->oldx= x;
- vod->oldy= y;
+ vod->oldx = x;
+ vod->oldy = y;
ED_view3d_camera_lock_sync(vod->v3d, vod->rv3d);
@@ -1300,36 +1302,36 @@ static void viewmove_apply(ViewOpsData *vod, int x, int y)
static int viewmove_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- ViewOpsData *vod= op->customdata;
- short event_code= VIEW_PASS;
+ ViewOpsData *vod = op->customdata;
+ short event_code = VIEW_PASS;
/* execute the events */
- if (event->type==MOUSEMOVE) {
- event_code= VIEW_APPLY;
+ if (event->type == MOUSEMOVE) {
+ event_code = VIEW_APPLY;
}
- else if (event->type==EVT_MODAL_MAP) {
+ else if (event->type == EVT_MODAL_MAP) {
switch (event->val) {
case VIEW_MODAL_CONFIRM:
- event_code= VIEW_CONFIRM;
+ event_code = VIEW_CONFIRM;
break;
case VIEWROT_MODAL_SWITCH_ZOOM:
WM_operator_name_call(C, "VIEW3D_OT_zoom", WM_OP_INVOKE_DEFAULT, NULL);
- event_code= VIEW_CONFIRM;
+ event_code = VIEW_CONFIRM;
break;
case VIEWROT_MODAL_SWITCH_ROTATE:
WM_operator_name_call(C, "VIEW3D_OT_rotate", WM_OP_INVOKE_DEFAULT, NULL);
- event_code= VIEW_CONFIRM;
+ event_code = VIEW_CONFIRM;
break;
}
}
- else if (event->type==vod->origkey && event->val==KM_RELEASE) {
- event_code= VIEW_CONFIRM;
+ else if (event->type == vod->origkey && event->val == KM_RELEASE) {
+ event_code = VIEW_CONFIRM;
}
- if (event_code==VIEW_APPLY) {
+ if (event_code == VIEW_APPLY) {
viewmove_apply(vod, event->x, event->y);
}
- else if (event_code==VIEW_CONFIRM) {
+ else if (event_code == VIEW_CONFIRM) {
ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
@@ -1346,7 +1348,7 @@ static int viewmove_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* makes op->customdata */
viewops_data_create(C, op, event);
- vod= op->customdata;
+ vod = op->customdata;
if (event->type == MOUSEPAN) {
viewmove_apply(vod, event->prevx, event->prevy);
@@ -1375,18 +1377,18 @@ void VIEW3D_OT_move(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Move view";
+ ot->name = "Move view";
ot->description = "Move the view";
- ot->idname= "VIEW3D_OT_move";
+ ot->idname = "VIEW3D_OT_move";
/* api callbacks */
- ot->invoke= viewmove_invoke;
- ot->modal= viewmove_modal;
- ot->poll= ED_operator_view3d_active;
- ot->cancel= viewmove_cancel;
+ ot->invoke = viewmove_invoke;
+ ot->modal = viewmove_modal;
+ ot->poll = ED_operator_view3d_active;
+ ot->cancel = viewmove_cancel;
/* flags */
- ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
+ ot->flag = OPTYPE_BLOCKING | OPTYPE_GRAB_POINTER;
}
/* ************************ viewzoom ******************************** */
@@ -1396,29 +1398,30 @@ void VIEW3D_OT_move(wmOperatorType *ot)
void viewzoom_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
- {VIEW_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
+ {VIEW_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
- {VIEWROT_MODAL_SWITCH_ROTATE, "SWITCH_TO_ROTATE", 0, "Switch to Rotate"},
- {VIEWROT_MODAL_SWITCH_MOVE, "SWITCH_TO_MOVE", 0, "Switch to Move"},
+ {VIEWROT_MODAL_SWITCH_ROTATE, "SWITCH_TO_ROTATE", 0, "Switch to Rotate"},
+ {VIEWROT_MODAL_SWITCH_MOVE, "SWITCH_TO_MOVE", 0, "Switch to Move"},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}};
- wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "View3D Zoom Modal");
+ wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "View3D Zoom Modal");
/* this function is called for each spacetype, only needs to add map once */
if (keymap) return;
- keymap= WM_modalkeymap_add(keyconf, "View3D Zoom Modal", modal_items);
+ keymap = WM_modalkeymap_add(keyconf, "View3D Zoom Modal", modal_items);
/* items for modal map */
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");
@@ -1426,7 +1429,7 @@ void viewzoom_modal_keymap(wmKeyConfig *keyconf)
static void view_zoom_mouseloc(ARegion *ar, float dfac, int mx, int my)
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
if (U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
float dvec[3];
@@ -1440,8 +1443,8 @@ static void view_zoom_mouseloc(ARegion *ar, float dfac, int mx, int my)
/* Project cursor position into 3D space */
initgrabz(rv3d, tpos[0], tpos[1], tpos[2]);
- mval_f[0]= (float)(((mx - ar->winrct.xmin) * 2) - ar->winx) / 2.0f;
- mval_f[1]= (float)(((my - ar->winrct.ymin) * 2) - ar->winy) / 2.0f;
+ mval_f[0] = (float)(((mx - ar->winrct.xmin) * 2) - ar->winx) / 2.0f;
+ mval_f[1] = (float)(((my - ar->winrct.ymin) * 2) - ar->winy) / 2.0f;
ED_view3d_win_to_delta(ar, mval_f, dvec);
/* Calculate view target position for dolly */
@@ -1465,41 +1468,51 @@ 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;
+ 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 (viewzoom==USER_ZOOM_CONT) {
- double time= PIL_check_seconds_timer();
- float time_step= (float)(time - vod->timer_lastdraw);
+ 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);
float fac;
if (U.uiflag & USER_ZOOM_HORIZ) {
- fac= (float)(x - vod->origx);
+ fac = (float)(x - vod->origx);
}
else {
- fac= (float)(y - vod->origy);
+ fac = (float)(y - vod->origy);
}
if (zoom_invert) {
- fac= -fac;
+ fac = -fac;
}
// oldstyle zoom
zfac = 1.0f + ((fac / 20.0f) * time_step);
- vod->timer_lastdraw= time;
+ vod->timer_lastdraw = time;
}
- else if (viewzoom==USER_ZOOM_SCALE) {
+ else if (viewzoom == USER_ZOOM_SCALE) {
int ctr[2], len1, len2;
// method which zooms based on how far you move the mouse
- ctr[0] = (vod->ar->winrct.xmax + vod->ar->winrct.xmin)/2;
- ctr[1] = (vod->ar->winrct.ymax + vod->ar->winrct.ymin)/2;
+ ctr[0] = (vod->ar->winrct.xmax + vod->ar->winrct.xmin) / 2;
+ ctr[1] = (vod->ar->winrct.ymax + vod->ar->winrct.ymin) / 2;
- len1 = (int)sqrt((ctr[0] - x)*(ctr[0] - x) + (ctr[1] - y)*(ctr[1] - y)) + 5;
- len2 = (int)sqrt((ctr[0] - vod->origx)*(ctr[0] - vod->origx) + (ctr[1] - vod->origy)*(ctr[1] - vod->origy)) + 5;
+ len1 = (int)sqrt((ctr[0] - x) * (ctr[0] - x) + (ctr[1] - y) * (ctr[1] - y)) + 5;
+ len2 = (int)sqrt((ctr[0] - vod->origx) * (ctr[0] - vod->origx) + (ctr[1] - vod->origy) * (ctr[1] - vod->origy)) + 5;
- zfac = vod->dist0 * ((float)len2/len1) / vod->rv3d->dist;
+ zfac = vod->dist0 * ((float)len2 / len1) / vod->rv3d->dist;
}
- else { /* USER_ZOOM_DOLLY */
+ else { /* USER_ZOOM_DOLLY */
float len1, len2;
if (U.uiflag & USER_ZOOM_HORIZ) {
@@ -1514,16 +1527,24 @@ 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;
- if (vod->rv3d->dist>10.0f * vod->far) vod->rv3d->dist=10.0f * vod->far;
+ if (vod->rv3d->dist < 0.001f * vod->grid) vod->rv3d->dist = 0.001f * vod->grid;
+ if (vod->rv3d->dist > 10.0f * vod->far) vod->rv3d->dist = 10.0f * vod->far;
if (vod->rv3d->viewlock & RV3D_BOXVIEW)
view3d_boxview_sync(vod->sa, vod->ar);
@@ -1536,40 +1557,40 @@ static void viewzoom_apply(ViewOpsData *vod, int x, int y, const short viewzoom,
static int viewzoom_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- ViewOpsData *vod= op->customdata;
- short event_code= VIEW_PASS;
+ ViewOpsData *vod = op->customdata;
+ short event_code = VIEW_PASS;
/* execute the events */
if (event->type == TIMER && event->customdata == vod->timer) {
/* continuous zoom */
- event_code= VIEW_APPLY;
+ event_code = VIEW_APPLY;
}
- else if (event->type==MOUSEMOVE) {
- event_code= VIEW_APPLY;
+ else if (event->type == MOUSEMOVE) {
+ event_code = VIEW_APPLY;
}
- else if (event->type==EVT_MODAL_MAP) {
+ else if (event->type == EVT_MODAL_MAP) {
switch (event->val) {
case VIEW_MODAL_CONFIRM:
- event_code= VIEW_CONFIRM;
+ event_code = VIEW_CONFIRM;
break;
case VIEWROT_MODAL_SWITCH_MOVE:
WM_operator_name_call(C, "VIEW3D_OT_move", WM_OP_INVOKE_DEFAULT, NULL);
- event_code= VIEW_CONFIRM;
+ event_code = VIEW_CONFIRM;
break;
case VIEWROT_MODAL_SWITCH_ROTATE:
WM_operator_name_call(C, "VIEW3D_OT_rotate", WM_OP_INVOKE_DEFAULT, NULL);
- event_code= VIEW_CONFIRM;
+ event_code = VIEW_CONFIRM;
break;
}
}
- else if (event->type==vod->origkey && event->val==KM_RELEASE) {
- event_code= VIEW_CONFIRM;
+ else if (event->type == vod->origkey && event->val == KM_RELEASE) {
+ event_code = VIEW_CONFIRM;
}
- if (event_code==VIEW_APPLY) {
+ if (event_code == VIEW_APPLY) {
viewzoom_apply(vod, event->x, event->y, U.viewzoom, (U.uiflag & USER_ZOOM_INVERT) != 0);
}
- else if (event_code==VIEW_CONFIRM) {
+ else if (event_code == VIEW_CONFIRM) {
ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
@@ -1587,33 +1608,33 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
ARegion *ar;
short use_cam_zoom;
- int delta= RNA_int_get(op->ptr, "delta");
+ int delta = RNA_int_get(op->ptr, "delta");
int mx, my;
if (op->customdata) {
- ViewOpsData *vod= op->customdata;
+ ViewOpsData *vod = op->customdata;
- sa= vod->sa;
- ar= vod->ar;
+ sa = vod->sa;
+ ar = vod->ar;
}
else {
- sa= CTX_wm_area(C);
- ar= CTX_wm_region(C);
+ sa = CTX_wm_area(C);
+ ar = CTX_wm_region(C);
}
- v3d= sa->spacedata.first;
- rv3d= ar->regiondata;
+ v3d = sa->spacedata.first;
+ rv3d = ar->regiondata;
- mx= RNA_struct_property_is_set(op->ptr, "mx") ? RNA_int_get(op->ptr, "mx") : ar->winx / 2;
- my= RNA_struct_property_is_set(op->ptr, "my") ? RNA_int_get(op->ptr, "my") : ar->winy / 2;
+ mx = RNA_struct_property_is_set(op->ptr, "mx") ? RNA_int_get(op->ptr, "mx") : ar->winx / 2;
+ my = RNA_struct_property_is_set(op->ptr, "my") ? RNA_int_get(op->ptr, "my") : ar->winy / 2;
- use_cam_zoom= (rv3d->persp==RV3D_CAMOB) && !(rv3d->is_persp && ED_view3d_camera_lock_check(v3d, rv3d));
+ use_cam_zoom = (rv3d->persp == RV3D_CAMOB) && !(rv3d->is_persp && ED_view3d_camera_lock_check(v3d, rv3d));
if (delta < 0) {
/* this min and max is also in viewmove() */
if (use_cam_zoom) {
- rv3d->camzoom-= 10;
- if (rv3d->camzoom < RV3D_CAMZOOM_MIN) rv3d->camzoom= RV3D_CAMZOOM_MIN;
+ rv3d->camzoom -= 10.0f;
+ if (rv3d->camzoom < RV3D_CAMZOOM_MIN) rv3d->camzoom = RV3D_CAMZOOM_MIN;
}
else if (rv3d->dist < 10.0f * v3d->far) {
view_zoom_mouseloc(ar, 1.2f, mx, my);
@@ -1621,10 +1642,10 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
}
else {
if (use_cam_zoom) {
- rv3d->camzoom+= 10;
- if (rv3d->camzoom > RV3D_CAMZOOM_MAX) rv3d->camzoom= RV3D_CAMZOOM_MAX;
+ rv3d->camzoom += 10.0f;
+ if (rv3d->camzoom > RV3D_CAMZOOM_MAX) rv3d->camzoom = RV3D_CAMZOOM_MAX;
}
- else if (rv3d->dist> 0.001f * v3d->grid) {
+ else if (rv3d->dist > 0.001f * v3d->grid) {
view_zoom_mouseloc(ar, .83333f, mx, my);
}
}
@@ -1648,29 +1669,31 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
void viewdolly_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
- {VIEW_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
+ {VIEW_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
- {VIEWROT_MODAL_SWITCH_ROTATE, "SWITCH_TO_ROTATE", 0, "Switch to Rotate"},
- {VIEWROT_MODAL_SWITCH_MOVE, "SWITCH_TO_MOVE", 0, "Switch to Move"},
+ {VIEWROT_MODAL_SWITCH_ROTATE, "SWITCH_TO_ROTATE", 0, "Switch to Rotate"},
+ {VIEWROT_MODAL_SWITCH_MOVE, "SWITCH_TO_MOVE", 0, "Switch to Move"},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}
+ };
- wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "View3D Dolly Modal");
+ wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "View3D Dolly Modal");
/* this function is called for each spacetype, only needs to add map once */
if (keymap) return;
- keymap= WM_modalkeymap_add(keyconf, "View3D Dolly Modal", modal_items);
+ keymap = WM_modalkeymap_add(keyconf, "View3D Dolly Modal", modal_items);
/* items for modal map */
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");
@@ -1683,7 +1706,7 @@ static int viewzoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* makes op->customdata */
viewops_data_create(C, op, event);
- vod= op->customdata;
+ vod = op->customdata;
/* if one or the other zoom position aren't set, set from event */
if (!RNA_struct_property_is_set(op->ptr, "mx") || !RNA_struct_property_is_set(op->ptr, "my")) {
@@ -1715,8 +1738,8 @@ static int viewzoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
else {
if (U.viewzoom == USER_ZOOM_CONT) {
/* needs a timer to continue redrawing */
- vod->timer= WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f);
- vod->timer_lastdraw= PIL_check_seconds_timer();
+ vod->timer = WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f);
+ vod->timer_lastdraw = PIL_check_seconds_timer();
}
/* add temp handler */
@@ -1738,19 +1761,19 @@ static int viewzoom_cancel(bContext *C, wmOperator *op)
void VIEW3D_OT_zoom(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Zoom View";
+ ot->name = "Zoom View";
ot->description = "Zoom in/out in the view";
- ot->idname= "VIEW3D_OT_zoom";
+ ot->idname = "VIEW3D_OT_zoom";
/* api callbacks */
- ot->invoke= viewzoom_invoke;
- ot->exec= viewzoom_exec;
- ot->modal= viewzoom_modal;
- ot->poll= ED_operator_region_view3d_active;
- ot->cancel= viewzoom_cancel;
+ ot->invoke = viewzoom_invoke;
+ ot->exec = viewzoom_exec;
+ ot->modal = viewzoom_modal;
+ ot->poll = ED_operator_region_view3d_active;
+ ot->cancel = viewzoom_cancel;
/* flags */
- ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
+ ot->flag = OPTYPE_BLOCKING | OPTYPE_GRAB_POINTER;
RNA_def_int(ot->srna, "delta", 0, INT_MIN, INT_MAX, "Delta", "", INT_MIN, INT_MAX);
RNA_def_int(ot->srna, "mx", 0, 0, INT_MAX, "Zoom Position X", "", 0, INT_MAX);
@@ -1761,13 +1784,13 @@ void VIEW3D_OT_zoom(wmOperatorType *ot)
/* ************************ viewdolly ******************************** */
static void view_dolly_mouseloc(ARegion *ar, float orig_ofs[3], float dvec[3], float dfac)
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
madd_v3_v3v3fl(rv3d->ofs, orig_ofs, dvec, -(1.0f - dfac));
}
static void viewdolly_apply(ViewOpsData *vod, int x, int y, const short zoom_invert)
{
- float zfac=1.0;
+ float zfac = 1.0;
{
float len1, len2;
@@ -1800,36 +1823,36 @@ static void viewdolly_apply(ViewOpsData *vod, int x, int y, const short zoom_inv
static int viewdolly_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- ViewOpsData *vod= op->customdata;
- short event_code= VIEW_PASS;
+ ViewOpsData *vod = op->customdata;
+ short event_code = VIEW_PASS;
/* execute the events */
- if (event->type==MOUSEMOVE) {
- event_code= VIEW_APPLY;
+ if (event->type == MOUSEMOVE) {
+ event_code = VIEW_APPLY;
}
- else if (event->type==EVT_MODAL_MAP) {
+ else if (event->type == EVT_MODAL_MAP) {
switch (event->val) {
case VIEW_MODAL_CONFIRM:
- event_code= VIEW_CONFIRM;
+ event_code = VIEW_CONFIRM;
break;
case VIEWROT_MODAL_SWITCH_MOVE:
WM_operator_name_call(C, "VIEW3D_OT_move", WM_OP_INVOKE_DEFAULT, NULL);
- event_code= VIEW_CONFIRM;
+ event_code = VIEW_CONFIRM;
break;
case VIEWROT_MODAL_SWITCH_ROTATE:
WM_operator_name_call(C, "VIEW3D_OT_rotate", WM_OP_INVOKE_DEFAULT, NULL);
- event_code= VIEW_CONFIRM;
+ event_code = VIEW_CONFIRM;
break;
}
}
- else if (event->type==vod->origkey && event->val==KM_RELEASE) {
- event_code= VIEW_CONFIRM;
+ else if (event->type == vod->origkey && event->val == KM_RELEASE) {
+ event_code = VIEW_CONFIRM;
}
- if (event_code==VIEW_APPLY) {
+ if (event_code == VIEW_APPLY) {
viewdolly_apply(vod, event->x, event->y, (U.uiflag & USER_ZOOM_INVERT) != 0);
}
- else if (event_code==VIEW_CONFIRM) {
+ else if (event_code == VIEW_CONFIRM) {
ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
@@ -1847,24 +1870,24 @@ static int viewdolly_exec(bContext *C, wmOperator *op)
ARegion *ar;
float mousevec[3];
- int delta= RNA_int_get(op->ptr, "delta");
+ int delta = RNA_int_get(op->ptr, "delta");
if (op->customdata) {
- ViewOpsData *vod= op->customdata;
+ ViewOpsData *vod = op->customdata;
- sa= vod->sa;
- ar= vod->ar;
+ sa = vod->sa;
+ ar = vod->ar;
copy_v3_v3(mousevec, vod->mousevec);
}
else {
- sa= CTX_wm_area(C);
- ar= CTX_wm_region(C);
+ sa = CTX_wm_area(C);
+ ar = CTX_wm_region(C);
negate_v3_v3(mousevec, ((RegionView3D *)ar->regiondata)->viewinv[2]);
normalize_v3(mousevec);
}
/* v3d= sa->spacedata.first; */ /* UNUSED */
- rv3d= ar->regiondata;
+ rv3d = ar->regiondata;
/* overwrite the mouse vector with the view direction (zoom into the center) */
if ((U.uiflag & USER_ZOOM_TO_MOUSEPOS) == 0) {
@@ -1896,7 +1919,7 @@ static int viewdolly_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* makes op->customdata */
viewops_data_create(C, op, event);
- vod= op->customdata;
+ vod = op->customdata;
/* if one or the other zoom position aren't set, set from event */
if (!RNA_struct_property_is_set(op->ptr, "mx") || !RNA_struct_property_is_set(op->ptr, "my")) {
@@ -1945,14 +1968,14 @@ static int viewdolly_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* like ED_operator_region_view3d_active but check its not in ortho view */
static int viewdolly_poll(bContext *C)
{
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
if (rv3d) {
if (rv3d->persp == RV3D_PERSP) {
return 1;
}
else {
- View3D *v3d= CTX_wm_view3d(C);
+ View3D *v3d = CTX_wm_view3d(C);
if (ED_view3d_camera_lock_check(v3d, rv3d)) {
return 1;
}
@@ -1971,19 +1994,19 @@ static int viewdolly_cancel(bContext *C, wmOperator *op)
void VIEW3D_OT_dolly(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Dolly view";
+ ot->name = "Dolly view";
ot->description = "Dolly in/out in the view";
- ot->idname= "VIEW3D_OT_dolly";
+ ot->idname = "VIEW3D_OT_dolly";
/* api callbacks */
- ot->invoke= viewdolly_invoke;
- ot->exec= viewdolly_exec;
- ot->modal= viewdolly_modal;
- ot->poll= viewdolly_poll;
- ot->cancel= viewdolly_cancel;
+ ot->invoke = viewdolly_invoke;
+ ot->exec = viewdolly_exec;
+ ot->modal = viewdolly_modal;
+ ot->poll = viewdolly_poll;
+ ot->cancel = viewdolly_cancel;
/* flags */
- ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
+ ot->flag = OPTYPE_BLOCKING | OPTYPE_GRAB_POINTER;
RNA_def_int(ot->srna, "delta", 0, INT_MIN, INT_MAX, "Delta", "", INT_MIN, INT_MAX);
RNA_def_int(ot->srna, "mx", 0, 0, INT_MAX, "Zoom Position X", "", 0, INT_MAX);
@@ -1994,22 +2017,22 @@ void VIEW3D_OT_dolly(wmOperatorType *ot)
static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.4x */
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
View3D *v3d = CTX_wm_view3d(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
- Scene *scene= CTX_data_scene(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
+ Scene *scene = CTX_data_scene(C);
Base *base;
float *curs;
- const short skip_camera= ED_view3d_camera_lock_check(v3d, rv3d);
+ const short skip_camera = ED_view3d_camera_lock_check(v3d, rv3d);
- int center= RNA_boolean_get(op->ptr, "center");
+ int center = RNA_boolean_get(op->ptr, "center");
float size, min[3], max[3], afm[3];
- int ok= 1, onedone=0;
+ int ok = 1, onedone = 0;
if (center) {
/* in 2.4x this also move the cursor to (0, 0, 0) (with shift+c). */
- curs= give_cursor(scene, v3d);
+ curs = give_cursor(scene, v3d);
zero_v3(min);
zero_v3(max);
zero_v3(curs);
@@ -2018,9 +2041,9 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in
INIT_MINMAX(min, max);
}
- for (base= scene->base.first; base; base= base->next) {
+ for (base = scene->base.first; base; base = base->next) {
if (BASE_VISIBLE(v3d, base)) {
- onedone= 1;
+ onedone = 1;
if (skip_camera && base->object == v3d->camera) {
continue;
@@ -2042,27 +2065,27 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in
}
sub_v3_v3v3(afm, max, min);
- size= 0.7f*MAX3(afm[0], afm[1], afm[2]);
- if (size == 0.0f) ok= 0;
+ size = 0.7f * MAX3(afm[0], afm[1], afm[2]);
+ if (size == 0.0f) ok = 0;
if (ok) {
float new_dist;
float new_ofs[3];
new_dist = size;
- new_ofs[0]= -(min[0]+max[0])/2.0f;
- new_ofs[1]= -(min[1]+max[1])/2.0f;
- new_ofs[2]= -(min[2]+max[2])/2.0f;
+ new_ofs[0] = -(min[0] + max[0]) / 2.0f;
+ new_ofs[1] = -(min[1] + max[1]) / 2.0f;
+ new_ofs[2] = -(min[2] + max[2]) / 2.0f;
// correction for window aspect ratio
- if (ar->winy>2 && ar->winx>2) {
- size= (float)ar->winx/(float)ar->winy;
- if (size < 1.0f) size= 1.0f/size;
- new_dist*= size;
+ if (ar->winy > 2 && ar->winx > 2) {
+ size = (float)ar->winx / (float)ar->winy;
+ if (size < 1.0f) size = 1.0f / size;
+ new_dist *= size;
}
- if ((rv3d->persp==RV3D_CAMOB) && !ED_view3d_camera_lock_check(v3d, rv3d)) {
- rv3d->persp= RV3D_PERSP;
+ if ((rv3d->persp == RV3D_CAMOB) && !ED_view3d_camera_lock_check(v3d, rv3d)) {
+ rv3d->persp = RV3D_PERSP;
smooth_view(C, v3d, ar, v3d->camera, NULL, new_ofs, NULL, &new_dist, NULL);
}
else {
@@ -2071,7 +2094,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in
}
// XXX BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
return OPERATOR_FINISHED;
}
@@ -2080,16 +2103,16 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in
void VIEW3D_OT_view_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View All";
+ ot->name = "View All";
ot->description = "View all objects in scene";
- ot->idname= "VIEW3D_OT_view_all";
+ ot->idname = "VIEW3D_OT_view_all";
/* api callbacks */
- ot->exec= view3d_all_exec;
- ot->poll= ED_operator_region_view3d_active;
+ ot->exec = view3d_all_exec;
+ ot->poll = ED_operator_region_view3d_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
RNA_def_boolean(ot->srna, "center", 0, "Center", "");
}
@@ -2097,15 +2120,15 @@ void VIEW3D_OT_view_all(wmOperatorType *ot)
/* like a localview without local!, was centerview() in 2.4x */
static int viewselected_exec(bContext *C, wmOperator *UNUSED(op))
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
View3D *v3d = CTX_wm_view3d(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
- Scene *scene= CTX_data_scene(C);
- Object *ob= OBACT;
- Object *obedit= CTX_data_edit_object(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = OBACT;
+ Object *obedit = CTX_data_edit_object(C);
float size, min[3], max[3], afm[3];
- int ok=0, ok_dist=1;
- const short skip_camera= ED_view3d_camera_lock_check(v3d, rv3d);
+ int ok = 0, ok_dist = 1;
+ const short skip_camera = ED_view3d_camera_lock_check(v3d, rv3d);
/* SMOOTHVIEW */
float new_ofs[3];
@@ -2113,36 +2136,36 @@ static int viewselected_exec(bContext *C, wmOperator *UNUSED(op))
INIT_MINMAX(min, max);
- if (ob && ob->mode & OB_MODE_WEIGHT_PAINT) {
- /* hardcoded exception, we look for the one selected armature */
+ if (ob && (ob->mode & OB_MODE_WEIGHT_PAINT)) {
+ /* hard-coded exception, we look for the one selected armature */
/* this is weak code this way, we should make a generic active/selection callback interface once... */
Base *base;
- for (base=scene->base.first; base; base= base->next) {
+ for (base = scene->base.first; base; base = base->next) {
if (TESTBASELIB(v3d, base)) {
- if (base->object->type==OB_ARMATURE)
+ if (base->object->type == OB_ARMATURE)
if (base->object->mode & OB_MODE_POSE)
break;
}
}
if (base)
- ob= base->object;
+ ob = base->object;
}
if (obedit) {
- ok = minmax_verts(obedit, min, max); /* only selected */
+ ok = minmax_verts(obedit, min, max); /* only selected */
}
else if (ob && (ob->mode & OB_MODE_POSE)) {
if (ob->pose) {
- bArmature *arm= ob->data;
+ bArmature *arm = ob->data;
bPoseChannel *pchan;
float vec[3];
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
if (pchan->bone->flag & BONE_SELECTED) {
if (pchan->bone->layer & arm->layer) {
- bPoseChannel *pchan_tx= pchan->custom_tx ? pchan->custom_tx : pchan;
- ok= 1;
+ bPoseChannel *pchan_tx = pchan->custom_tx ? pchan->custom_tx : pchan;
+ ok = 1;
mul_v3_m4v3(vec, ob->obmat, pchan_tx->pose_head);
DO_MINMAX(vec, min, max);
mul_v3_m4v3(vec, ob->obmat, pchan_tx->pose_tail);
@@ -2153,14 +2176,14 @@ static int viewselected_exec(bContext *C, wmOperator *UNUSED(op))
}
}
else if (paint_facesel_test(ob)) {
- ok= paintface_minmax(ob, min, max);
+ ok = paintface_minmax(ob, min, max);
}
else if (ob && (ob->mode & OB_MODE_PARTICLE_EDIT)) {
- ok= PE_minmax(scene, min, max);
+ ok = PE_minmax(scene, min, max);
}
else {
Base *base;
- for (base= FIRSTBASE; base; base = base->next) {
+ for (base = FIRSTBASE; base; base = base->next) {
if (TESTBASE(v3d, base)) {
if (skip_camera && base->object == v3d->camera) {
@@ -2168,31 +2191,31 @@ static int viewselected_exec(bContext *C, wmOperator *UNUSED(op))
}
/* account for duplis */
- if (minmax_object_duplis(scene, base->object, min, max)==0)
- minmax_object(base->object, min, max); /* use if duplis not found */
+ if (minmax_object_duplis(scene, base->object, min, max) == 0)
+ minmax_object(base->object, min, max); /* use if duplis not found */
- ok= 1;
+ ok = 1;
}
}
}
- if (ok==0) return OPERATOR_FINISHED;
+ if (ok == 0) return OPERATOR_FINISHED;
sub_v3_v3v3(afm, max, min);
- size= MAX3(afm[0], afm[1], afm[2]);
+ size = MAX3(afm[0], afm[1], afm[2]);
if (!rv3d->is_persp) {
- if (size < 0.0001f) { /* if its a sinble point. dont even re-scale */
- ok_dist= 0;
+ if (size < 0.0001f) { /* if its a sinble point. don't even re-scale */
+ ok_dist = 0;
}
else {
/* perspective should be a bit farther away to look nice */
- size*= 0.7f;
+ size *= 0.7f;
}
}
else {
- if (size <= v3d->near*1.5f) {
- size= v3d->near*1.5f;
+ if (size <= v3d->near * 1.5f) {
+ size = v3d->near * 1.5f;
}
}
@@ -2202,14 +2225,14 @@ static int viewselected_exec(bContext *C, wmOperator *UNUSED(op))
new_dist = size;
/* correction for window aspect ratio */
- if (ar->winy>2 && ar->winx>2) {
- size= (float)ar->winx/(float)ar->winy;
- if (size<1.0f) size= 1.0f/size;
- new_dist*= size;
+ if (ar->winy > 2 && ar->winx > 2) {
+ size = (float)ar->winx / (float)ar->winy;
+ if (size < 1.0f) size = 1.0f / size;
+ new_dist *= size;
}
- if (rv3d->persp==RV3D_CAMOB && !ED_view3d_camera_lock_check(v3d, rv3d)) {
- rv3d->persp= RV3D_PERSP;
+ if (rv3d->persp == RV3D_CAMOB && !ED_view3d_camera_lock_check(v3d, rv3d)) {
+ rv3d->persp = RV3D_PERSP;
smooth_view(C, v3d, ar, v3d->camera, NULL, new_ofs, NULL, &new_dist, NULL);
}
else {
@@ -2227,26 +2250,26 @@ void VIEW3D_OT_view_selected(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Selected";
+ ot->name = "View Selected";
ot->description = "Move the view to the selection center";
- ot->idname= "VIEW3D_OT_view_selected";
+ ot->idname = "VIEW3D_OT_view_selected";
/* api callbacks */
- ot->exec= viewselected_exec;
- ot->poll= ED_operator_region_view3d_active;
+ ot->exec = viewselected_exec;
+ ot->poll = ED_operator_region_view3d_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
static int viewcenter_cursor_exec(bContext *C, wmOperator *UNUSED(op))
{
View3D *v3d = CTX_wm_view3d(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
- Scene *scene= CTX_data_scene(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
+ Scene *scene = CTX_data_scene(C);
if (rv3d) {
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
/* non camera center */
float new_ofs[3];
@@ -2262,21 +2285,21 @@ static int viewcenter_cursor_exec(bContext *C, wmOperator *UNUSED(op))
void VIEW3D_OT_view_center_cursor(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Center View to Cursor";
- ot->description= "Center the view so that the cursor is in the middle of the view";
- ot->idname= "VIEW3D_OT_view_center_cursor";
+ ot->name = "Center View to Cursor";
+ ot->description = "Center the view so that the cursor is in the middle of the view";
+ ot->idname = "VIEW3D_OT_view_center_cursor";
/* api callbacks */
- ot->exec= viewcenter_cursor_exec;
- ot->poll= ED_operator_view3d_active;
+ ot->exec = viewcenter_cursor_exec;
+ ot->poll = ED_operator_view3d_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) /* was view3d_home() in 2.4x */
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
float xfac, yfac;
float size[2];
@@ -2288,18 +2311,18 @@ static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) /* was
ED_view3d_context_user_region(C, &v3d, &ar);
rv3d = ar->regiondata;
- rv3d->camdx= rv3d->camdy= 0.0f;
+ rv3d->camdx = rv3d->camdy = 0.0f;
ED_view3d_calc_camera_border_size(scene, ar, v3d, rv3d, size);
/* 4px is just a little room from the edge of the area */
- xfac= (float)ar->winx / (float)(size[0] + 4);
- yfac= (float)ar->winy / (float)(size[1] + 4);
+ xfac = (float)ar->winx / (float)(size[0] + 4);
+ yfac = (float)ar->winy / (float)(size[1] + 4);
- rv3d->camzoom= BKE_screen_view3d_zoom_from_fac(MIN2(xfac, yfac));
+ rv3d->camzoom = BKE_screen_view3d_zoom_from_fac(MIN2(xfac, yfac));
CLAMP(rv3d->camzoom, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX);
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, CTX_wm_view3d(C));
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C));
return OPERATOR_FINISHED;
}
@@ -2307,16 +2330,16 @@ static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) /* was
void VIEW3D_OT_view_center_camera(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Camera Center";
+ ot->name = "View Camera Center";
ot->description = "Center the camera view";
- ot->idname= "VIEW3D_OT_view_center_camera";
+ ot->idname = "VIEW3D_OT_view_center_camera";
/* api callbacks */
- ot->exec= view3d_center_camera_exec;
- ot->poll= view3d_camera_user_poll;
+ ot->exec = view3d_center_camera_exec;
+ ot->poll = view3d_camera_user_poll;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
/* ********************* Set render border operator ****************** */
@@ -2324,26 +2347,26 @@ void VIEW3D_OT_view_center_camera(wmOperatorType *ot)
static int render_border_exec(bContext *C, wmOperator *op)
{
View3D *v3d = CTX_wm_view3d(C);
- ARegion *ar= CTX_wm_region(C);
- RegionView3D *rv3d= ED_view3d_context_rv3d(C);
- Scene *scene= CTX_data_scene(C);
+ ARegion *ar = CTX_wm_region(C);
+ RegionView3D *rv3d = ED_view3d_context_rv3d(C);
+ Scene *scene = CTX_data_scene(C);
rcti rect;
rctf vb;
/* get border select values using rna */
- 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");
+ 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");
/* calculate range */
ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &vb, FALSE);
- scene->r.border.xmin= ((float)rect.xmin-vb.xmin)/(vb.xmax-vb.xmin);
- scene->r.border.ymin= ((float)rect.ymin-vb.ymin)/(vb.ymax-vb.ymin);
- scene->r.border.xmax= ((float)rect.xmax-vb.xmin)/(vb.xmax-vb.xmin);
- scene->r.border.ymax= ((float)rect.ymax-vb.ymin)/(vb.ymax-vb.ymin);
+ scene->r.border.xmin = ((float)rect.xmin - vb.xmin) / (vb.xmax - vb.xmin);
+ scene->r.border.ymin = ((float)rect.ymin - vb.ymin) / (vb.ymax - vb.ymin);
+ scene->r.border.xmax = ((float)rect.xmax - vb.xmin) / (vb.xmax - vb.xmin);
+ scene->r.border.ymax = ((float)rect.ymax - vb.ymin) / (vb.ymax - vb.ymin);
/* actually set border */
CLAMP(scene->r.border.xmin, 0.0f, 1.0f);
@@ -2354,9 +2377,9 @@ static int render_border_exec(bContext *C, wmOperator *op)
/* drawing a border surrounding the entire camera view switches off border rendering
* or the border covers no pixels */
if ((scene->r.border.xmin <= 0.0f && scene->r.border.xmax >= 1.0f &&
- scene->r.border.ymin <= 0.0f && scene->r.border.ymax >= 1.0f) ||
- (scene->r.border.xmin == scene->r.border.xmax ||
- scene->r.border.ymin == scene->r.border.ymax ))
+ scene->r.border.ymin <= 0.0f && scene->r.border.ymax >= 1.0f) ||
+ (scene->r.border.xmin == scene->r.border.xmax ||
+ scene->r.border.ymin == scene->r.border.ymax))
{
scene->r.mode &= ~R_BORDER;
}
@@ -2364,7 +2387,7 @@ static int render_border_exec(bContext *C, wmOperator *op)
scene->r.mode |= R_BORDER;
}
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, NULL);
return OPERATOR_FINISHED;
@@ -2373,20 +2396,20 @@ static int render_border_exec(bContext *C, wmOperator *op)
void VIEW3D_OT_render_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Render Border";
+ ot->name = "Set Render Border";
ot->description = "Set the boundaries of the border render and enables border render";
- ot->idname= "VIEW3D_OT_render_border";
+ ot->idname = "VIEW3D_OT_render_border";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= render_border_exec;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = render_border_exec;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= view3d_camera_active_poll;
+ ot->poll = view3d_camera_active_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* rna */
RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
@@ -2399,10 +2422,10 @@ void VIEW3D_OT_render_border(wmOperatorType *ot)
static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
{
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
View3D *v3d = CTX_wm_view3d(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
- Scene *scene= CTX_data_scene(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
+ Scene *scene = CTX_data_scene(C);
/* Zooms in on a border drawn by the user */
rcti rect;
@@ -2414,17 +2437,17 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
/* ZBuffer depth vars */
bglMats mats;
- float depth_close= FLT_MAX;
+ float depth_close = FLT_MAX;
double cent[2], p[3];
/* note; otherwise opengl won't work */
view3d_operator_needs_opengl(C);
/* get border select values using rna */
- 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");
+ 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");
/* Get Z Depths, needed for perspective, nice for ortho */
bgl_get_mats(&mats);
@@ -2432,25 +2455,25 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
{
/* avoid allocating the whole depth buffer */
- ViewDepths depth_temp= {0};
+ ViewDepths depth_temp = {0};
/* avoid view3d_update_depths() for speed. */
view3d_update_depths_rect(ar, &depth_temp, &rect);
/* find the closest Z pixel */
- depth_close= view3d_depth_near(&depth_temp);
+ depth_close = view3d_depth_near(&depth_temp);
MEM_freeN(depth_temp.depths);
}
- cent[0] = (((double)rect.xmin)+((double)rect.xmax)) / 2;
- cent[1] = (((double)rect.ymin)+((double)rect.ymax)) / 2;
+ cent[0] = (((double)rect.xmin) + ((double)rect.xmax)) / 2;
+ cent[1] = (((double)rect.ymin) + ((double)rect.ymax)) / 2;
if (rv3d->is_persp) {
double p_corner[3];
/* no depths to use, we cant do anything! */
- if (depth_close==FLT_MAX) {
+ if (depth_close == FLT_MAX) {
BKE_report(op->reports, RPT_ERROR, "Depth Too Large");
return OPERATOR_CANCELLED;
}
@@ -2459,18 +2482,18 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
mats.modelview, mats.projection, (GLint *)mats.viewport,
&p[0], &p[1], &p[2])) ||
(!gluUnProject((double)rect.xmin, (double)rect.ymin, depth_close,
- mats.modelview, mats.projection, (GLint *)mats.viewport,
- &p_corner[0], &p_corner[1], &p_corner[2])))
+ mats.modelview, mats.projection, (GLint *)mats.viewport,
+ &p_corner[0], &p_corner[1], &p_corner[2])))
{
return OPERATOR_CANCELLED;
}
- dvec[0] = p[0]-p_corner[0];
- dvec[1] = p[1]-p_corner[1];
- dvec[2] = p[2]-p_corner[2];
+ dvec[0] = p[0] - p_corner[0];
+ dvec[1] = p[1] - p_corner[1];
+ dvec[2] = p[2] - p_corner[2];
new_dist = len_v3(dvec);
- if (new_dist <= v3d->near * 1.5f) new_dist= v3d->near * 1.5f;
+ if (new_dist <= v3d->near * 1.5f) new_dist = v3d->near * 1.5f;
new_ofs[0] = -p[0];
new_ofs[1] = -p[1];
@@ -2478,7 +2501,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
}
else { /* othographic */
- /* find the current window width and height */
+ /* find the current window width and height */
vb[0] = ar->winx;
vb[1] = ar->winy;
@@ -2500,20 +2523,20 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
initgrabz(rv3d, -new_ofs[0], -new_ofs[1], -new_ofs[2]);
- mval_f[0]= (rect.xmin + rect.xmax - vb[0]) / 2.0f;
- mval_f[1]= (rect.ymin + rect.ymax - vb[1]) / 2.0f;
+ mval_f[0] = (rect.xmin + rect.xmax - vb[0]) / 2.0f;
+ mval_f[1] = (rect.ymin + rect.ymax - vb[1]) / 2.0f;
ED_view3d_win_to_delta(ar, mval_f, dvec);
/* center the view to the center of the rectangle */
sub_v3_v3(new_ofs, dvec);
}
/* work out the ratios, so that everything selected fits when we zoom */
- xscale = ((rect.xmax-rect.xmin)/vb[0]);
- yscale = ((rect.ymax-rect.ymin)/vb[1]);
- scale = (xscale >= yscale)?xscale:yscale;
+ xscale = ((rect.xmax - rect.xmin) / vb[0]);
+ yscale = ((rect.ymax - rect.ymin) / vb[1]);
+ scale = (xscale >= yscale) ? xscale : yscale;
/* zoom in as required, or as far as we can go */
- new_dist = ((new_dist*scale) >= 0.001f * v3d->grid)? new_dist*scale:0.001f * v3d->grid;
+ new_dist = ((new_dist * scale) >= 0.001f * v3d->grid) ? new_dist * scale : 0.001f * v3d->grid;
}
smooth_view(C, v3d, ar, NULL, NULL, new_ofs, NULL, &new_dist, NULL);
@@ -2526,8 +2549,8 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
static int view3d_zoom_border_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- View3D *v3d= CTX_wm_view3d(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ View3D *v3d = CTX_wm_view3d(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
/* if in camera view do not exec the operator so we do not conflict with set render border*/
if ((rv3d->persp != RV3D_CAMOB) || ED_view3d_camera_lock_check(v3d, rv3d))
@@ -2539,20 +2562,20 @@ static int view3d_zoom_border_invoke(bContext *C, wmOperator *op, wmEvent *event
void VIEW3D_OT_zoom_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Border Zoom";
+ ot->name = "Border Zoom";
ot->description = "Zoom in the view to the nearest object contained in the border";
- ot->idname= "VIEW3D_OT_zoom_border";
+ ot->idname = "VIEW3D_OT_zoom_border";
/* api callbacks */
- ot->invoke= view3d_zoom_border_invoke;
- ot->exec= view3d_zoom_border_exec;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = view3d_zoom_border_invoke;
+ ot->exec = view3d_zoom_border_exec;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= ED_operator_region_view3d_active;
+ ot->poll = ED_operator_region_view3d_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
/* rna */
RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
@@ -2565,19 +2588,19 @@ void VIEW3D_OT_zoom_border(wmOperatorType *ot)
/* sets the view to 1:1 camera/render-pixel */
static void view3d_set_1_to_1_viewborder(Scene *scene, ARegion *ar, View3D *v3d)
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
float size[2];
- int im_width= (scene->r.size*scene->r.xsch)/100;
+ int im_width = (scene->r.size * scene->r.xsch) / 100;
ED_view3d_calc_camera_border_size(scene, ar, v3d, rv3d, size);
- rv3d->camzoom= BKE_screen_view3d_zoom_from_fac((float)im_width/size[0]);
+ rv3d->camzoom = BKE_screen_view3d_zoom_from_fac((float)im_width / size[0]);
CLAMP(rv3d->camzoom, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX);
}
static int view3d_zoom_1_to_1_camera_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
View3D *v3d;
ARegion *ar;
@@ -2587,7 +2610,7 @@ static int view3d_zoom_1_to_1_camera_exec(bContext *C, wmOperator *UNUSED(op))
view3d_set_1_to_1_viewborder(scene, ar, v3d);
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
return OPERATOR_FINISHED;
}
@@ -2595,16 +2618,16 @@ static int view3d_zoom_1_to_1_camera_exec(bContext *C, wmOperator *UNUSED(op))
void VIEW3D_OT_zoom_camera_1_to_1(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Zoom Camera 1:1";
+ ot->name = "Zoom Camera 1:1";
ot->description = "Match the camera to 1:1 to the render output";
- ot->idname= "VIEW3D_OT_zoom_camera_1_to_1";
+ ot->idname = "VIEW3D_OT_zoom_camera_1_to_1";
/* api callbacks */
- ot->exec= view3d_zoom_1_to_1_camera_exec;
- ot->poll= view3d_camera_user_poll;
+ ot->exec = view3d_zoom_1_to_1_camera_exec;
+ ot->poll = view3d_camera_user_poll;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
/* ********************* Changing view operator ****************** */
@@ -2617,7 +2640,8 @@ static EnumPropertyItem prop_view_items[] = {
{RV3D_VIEW_TOP, "TOP", 0, "Top", "View From the Top"},
{RV3D_VIEW_BOTTOM, "BOTTOM", 0, "Bottom", "View From the Bottom"},
{RV3D_VIEW_CAMERA, "CAMERA", 0, "Camera", "View From the active camera"},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}
+};
/* would like to make this a generic function - outside of transform */
@@ -2626,19 +2650,19 @@ static void axis_set_view(bContext *C, View3D *v3d, ARegion *ar,
float q1, float q2, float q3, float q4,
short view, int perspo, int align_active)
{
- RegionView3D *rv3d= ar->regiondata; /* no NULL check is needed, poll checks */
+ RegionView3D *rv3d = ar->regiondata; /* no NULL check is needed, poll checks */
float new_quat[4];
- new_quat[0]= q1; new_quat[1]= q2;
- new_quat[2]= q3; new_quat[3]= q4;
+ new_quat[0] = q1; new_quat[1] = q2;
+ new_quat[2] = q3; new_quat[3] = q4;
normalize_qt(new_quat);
if (align_active) {
/* align to active object */
- Object *obact= CTX_data_active_object(C);
- if (obact==NULL) {
+ Object *obact = CTX_data_active_object(C);
+ if (obact == NULL) {
/* no active object, ignore this option */
- align_active= FALSE;
+ align_active = FALSE;
}
else {
float obact_quat[4];
@@ -2647,28 +2671,32 @@ static void axis_set_view(bContext *C, View3D *v3d, ARegion *ar,
/* same as transform manipulator when normal is set */
ED_getTransformOrientationMatrix(C, twmat, FALSE);
- mat3_to_quat( obact_quat,twmat);
+ mat3_to_quat(obact_quat, twmat);
invert_qt(obact_quat);
mul_qt_qtqt(new_quat, new_quat, obact_quat);
- rv3d->view= view= RV3D_VIEW_USER;
+ rv3d->view = view = RV3D_VIEW_USER;
}
}
- if (align_active==FALSE) {
+ if (align_active == FALSE) {
/* normal operation */
if (rv3d->viewlock) {
/* only pass on if */
- if (rv3d->view==RV3D_VIEW_FRONT && view==RV3D_VIEW_BACK);
- else if (rv3d->view==RV3D_VIEW_BACK && view==RV3D_VIEW_FRONT);
- else if (rv3d->view==RV3D_VIEW_RIGHT && view==RV3D_VIEW_LEFT);
- else if (rv3d->view==RV3D_VIEW_LEFT && view==RV3D_VIEW_RIGHT);
- else if (rv3d->view==RV3D_VIEW_BOTTOM && view==RV3D_VIEW_TOP);
- else if (rv3d->view==RV3D_VIEW_TOP && view==RV3D_VIEW_BOTTOM);
- else return;
+
+ /* nice confusing if-block */
+ if (!((rv3d->view == RV3D_VIEW_FRONT && view == RV3D_VIEW_BACK) ||
+ (rv3d->view == RV3D_VIEW_BACK && view == RV3D_VIEW_FRONT) ||
+ (rv3d->view == RV3D_VIEW_RIGHT && view == RV3D_VIEW_LEFT) ||
+ (rv3d->view == RV3D_VIEW_LEFT && view == RV3D_VIEW_RIGHT) ||
+ (rv3d->view == RV3D_VIEW_BOTTOM && view == RV3D_VIEW_TOP) ||
+ (rv3d->view == RV3D_VIEW_TOP && view == RV3D_VIEW_BOTTOM)))
+ {
+ return;
+ }
}
- rv3d->view= view;
+ rv3d->view = view;
}
if (rv3d->viewlock) {
@@ -2676,17 +2704,17 @@ static void axis_set_view(bContext *C, View3D *v3d, ARegion *ar,
return;
}
- if (rv3d->persp==RV3D_CAMOB && v3d->camera) {
+ if (rv3d->persp == RV3D_CAMOB && v3d->camera) {
- if (U.uiflag & USER_AUTOPERSP) rv3d->persp= view ? RV3D_ORTHO : RV3D_PERSP;
- else if (rv3d->persp==RV3D_CAMOB) rv3d->persp= perspo;
+ if (U.uiflag & USER_AUTOPERSP) rv3d->persp = view ? RV3D_ORTHO : RV3D_PERSP;
+ else if (rv3d->persp == RV3D_CAMOB) rv3d->persp = perspo;
smooth_view(C, v3d, ar, v3d->camera, NULL, rv3d->ofs, new_quat, NULL, NULL);
}
else {
- if (U.uiflag & USER_AUTOPERSP) rv3d->persp= view ? RV3D_ORTHO : RV3D_PERSP;
- else if (rv3d->persp==RV3D_CAMOB) rv3d->persp= perspo;
+ if (U.uiflag & USER_AUTOPERSP) rv3d->persp = view ? RV3D_ORTHO : RV3D_PERSP;
+ else if (rv3d->persp == RV3D_CAMOB) rv3d->persp = perspo;
smooth_view(C, v3d, ar, NULL, NULL, NULL, new_quat, NULL, NULL);
}
@@ -2698,7 +2726,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
View3D *v3d;
ARegion *ar;
RegionView3D *rv3d;
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
static int perspo = RV3D_PERSP;
int viewnum, align_active, nextperspo;
@@ -2711,25 +2739,25 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
/* set this to zero, gets handled in axis_set_view */
if (rv3d->viewlock)
- align_active= 0;
+ align_active = 0;
/* Use this to test if we started out with a camera */
if (rv3d->persp == RV3D_CAMOB) {
- nextperspo= rv3d->lpersp;
+ nextperspo = rv3d->lpersp;
}
else {
- nextperspo= perspo;
+ nextperspo = perspo;
}
switch (viewnum) {
- case RV3D_VIEW_BOTTOM :
+ case RV3D_VIEW_BOTTOM:
axis_set_view(C, v3d, ar, 0.0, -1.0, 0.0, 0.0,
viewnum, nextperspo, align_active);
break;
case RV3D_VIEW_BACK:
- axis_set_view(C, v3d, ar, 0.0, 0.0, (float)-cos(M_PI/4.0), (float)-cos(M_PI/4.0),
+ axis_set_view(C, v3d, ar, 0.0, 0.0, (float)-cos(M_PI / 4.0), (float)-cos(M_PI / 4.0),
viewnum, nextperspo, align_active);
break;
@@ -2744,7 +2772,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
break;
case RV3D_VIEW_FRONT:
- axis_set_view(C, v3d, ar, (float)cos(M_PI/4.0), (float)-sin(M_PI/4.0), 0.0, 0.0,
+ axis_set_view(C, v3d, ar, (float)cos(M_PI / 4.0), (float)-sin(M_PI / 4.0), 0.0, 0.0,
viewnum, nextperspo, align_active);
break;
@@ -2754,24 +2782,24 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
break;
case RV3D_VIEW_CAMERA:
- if (rv3d->viewlock==0) {
+ if (rv3d->viewlock == 0) {
/* lastview - */
if (rv3d->persp != RV3D_CAMOB) {
- Object *ob= OBACT;
+ Object *ob = OBACT;
if (!rv3d->smooth_timer) {
/* store settings of current view before allowing overwriting with camera view
* only if we're not currently in a view transition */
copy_qt_qt(rv3d->lviewquat, rv3d->viewquat);
- rv3d->lview= rv3d->view;
- rv3d->lpersp= rv3d->persp;
+ rv3d->lview = rv3d->view;
+ rv3d->lpersp = rv3d->persp;
}
#if 0
- if (G.qual==LR_ALTKEY) {
+ if (G.qual == LR_ALTKEY) {
if (oldcamera && is_an_active_object(oldcamera)) {
- v3d->camera= oldcamera;
+ v3d->camera = oldcamera;
}
handle_view3d_lock();
}
@@ -2780,36 +2808,36 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
/* first get the default camera for the view lock type */
if (v3d->scenelock) {
/* sets the camera view if available */
- v3d->camera= scene->camera;
+ v3d->camera = scene->camera;
}
else {
/* use scene camera if one is not set (even though we're unlocked) */
- if (v3d->camera==NULL) {
- v3d->camera= scene->camera;
+ if (v3d->camera == NULL) {
+ v3d->camera = scene->camera;
}
}
- /* if the camera isnt found, check a number of options */
- if (v3d->camera==NULL && ob && ob->type==OB_CAMERA)
- v3d->camera= ob;
+ /* if the camera isn't found, check a number of options */
+ if (v3d->camera == NULL && ob && ob->type == OB_CAMERA)
+ v3d->camera = ob;
- if (v3d->camera==NULL)
- v3d->camera= scene_find_camera(scene);
+ if (v3d->camera == NULL)
+ v3d->camera = scene_find_camera(scene);
/* couldnt find any useful camera, bail out */
- if (v3d->camera==NULL)
+ if (v3d->camera == NULL)
return OPERATOR_CANCELLED;
- /* important these dont get out of sync for locked scenes */
+ /* important these don't get out of sync for locked scenes */
if (v3d->scenelock)
- scene->camera= v3d->camera;
+ scene->camera = v3d->camera;
/* finally do snazzy view zooming */
- rv3d->persp= RV3D_CAMOB;
+ rv3d->persp = RV3D_CAMOB;
smooth_view(C, v3d, ar, NULL, v3d->camera, rv3d->ofs, rv3d->viewquat, &rv3d->dist, &v3d->lens);
}
- else{
+ else {
/* return to settings of last view */
/* does smooth_view too */
axis_set_view(C, v3d, ar,
@@ -2819,11 +2847,11 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
}
break;
- default :
+ default:
break;
}
- if (rv3d->persp != RV3D_CAMOB) perspo= rv3d->persp;
+ if (rv3d->persp != RV3D_CAMOB) perspo = rv3d->persp;
return OPERATOR_FINISHED;
}
@@ -2831,20 +2859,24 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
void VIEW3D_OT_viewnumpad(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
- ot->name= "View numpad";
+ ot->name = "View numpad";
ot->description = "Set the view";
- ot->idname= "VIEW3D_OT_viewnumpad";
+ ot->idname = "VIEW3D_OT_viewnumpad";
/* api callbacks */
- ot->exec= viewnumpad_exec;
- ot->poll= ED_operator_rv3d_user_region_poll;
+ ot->exec = viewnumpad_exec;
+ ot->poll = ED_operator_rv3d_user_region_poll;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
- RNA_def_enum(ot->srna, "type", prop_view_items, 0, "View", "The Type of view");
- RNA_def_boolean(ot->srna, "align_active", 0, "Align Active", "Align to the active object's axis");
+ prop = RNA_def_enum(ot->srna, "type", prop_view_items, 0, "View", "The Type of view");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ prop = RNA_def_boolean(ot->srna, "align_active", 0, "Align Active", "Align to the active object's axis");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
static EnumPropertyItem prop_view_orbit_items[] = {
@@ -2852,7 +2884,8 @@ static EnumPropertyItem prop_view_orbit_items[] = {
{V3D_VIEW_STEPRIGHT, "ORBITRIGHT", 0, "Orbit Right", "Orbit the view around to the Right"},
{V3D_VIEW_STEPUP, "ORBITUP", 0, "Orbit Up", "Orbit the view Up"},
{V3D_VIEW_STEPDOWN, "ORBITDOWN", 0, "Orbit Down", "Orbit the view Down"},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}
+};
static int vieworbit_exec(bContext *C, wmOperator *op)
{
@@ -2868,31 +2901,31 @@ static int vieworbit_exec(bContext *C, wmOperator *op)
orbitdir = RNA_enum_get(op->ptr, "type");
- if (rv3d->viewlock==0) {
+ if (rv3d->viewlock == 0) {
if ((rv3d->persp != RV3D_CAMOB) || ED_view3d_camera_lock_check(v3d, rv3d)) {
if (orbitdir == V3D_VIEW_STEPLEFT || orbitdir == V3D_VIEW_STEPRIGHT) {
float si;
/* z-axis */
- phi= (float)(M_PI/360.0)*U.pad_rot_angle;
- if (orbitdir == V3D_VIEW_STEPRIGHT) phi= -phi;
- si= (float)sin(phi);
- q1[0]= (float)cos(phi);
- q1[1]= q1[2]= 0.0;
- q1[3]= si;
+ phi = (float)(M_PI / 360.0) * U.pad_rot_angle;
+ if (orbitdir == V3D_VIEW_STEPRIGHT) phi = -phi;
+ si = (float)sin(phi);
+ q1[0] = (float)cos(phi);
+ q1[1] = q1[2] = 0.0;
+ q1[3] = si;
mul_qt_qtqt(new_quat, rv3d->viewquat, q1);
- rv3d->view= RV3D_VIEW_USER;
+ rv3d->view = RV3D_VIEW_USER;
}
else if (orbitdir == V3D_VIEW_STEPDOWN || orbitdir == V3D_VIEW_STEPUP) {
/* horizontal axis */
- copy_v3_v3(q1+1, rv3d->viewinv[0]);
+ copy_v3_v3(q1 + 1, rv3d->viewinv[0]);
- normalize_v3(q1+1);
- phi= (float)(M_PI/360.0)*U.pad_rot_angle;
- if (orbitdir == V3D_VIEW_STEPDOWN) phi= -phi;
- q1[0]= (float)cos(phi);
- mul_v3_fl(q1+1, sin(phi));
+ normalize_v3(q1 + 1);
+ phi = (float)(M_PI / 360.0) * U.pad_rot_angle;
+ if (orbitdir == V3D_VIEW_STEPDOWN) phi = -phi;
+ q1[0] = (float)cos(phi);
+ mul_v3_fl(q1 + 1, sin(phi));
mul_qt_qtqt(new_quat, rv3d->viewquat, q1);
- rv3d->view= RV3D_VIEW_USER;
+ rv3d->view = RV3D_VIEW_USER;
}
smooth_view(C, CTX_wm_view3d(C), ar, NULL, NULL, NULL, new_quat, NULL, NULL);
@@ -2905,16 +2938,16 @@ static int vieworbit_exec(bContext *C, wmOperator *op)
void VIEW3D_OT_view_orbit(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Orbit";
+ ot->name = "View Orbit";
ot->description = "Orbit the view";
- ot->idname= "VIEW3D_OT_view_orbit";
+ ot->idname = "VIEW3D_OT_view_orbit";
/* api callbacks */
- ot->exec= vieworbit_exec;
- ot->poll= ED_operator_rv3d_user_region_poll;
+ ot->exec = vieworbit_exec;
+ ot->poll = ED_operator_rv3d_user_region_poll;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
RNA_def_enum(ot->srna, "type", prop_view_orbit_items, 0, "Orbit", "Direction of View Orbit");
}
@@ -2923,23 +2956,24 @@ static EnumPropertyItem prop_view_pan_items[] = {
{V3D_VIEW_PANRIGHT, "PANRIGHT", 0, "Pan Right", "Pan the view to the Right"},
{V3D_VIEW_PANUP, "PANUP", 0, "Pan Up", "Pan the view Up"},
{V3D_VIEW_PANDOWN, "PANDOWN", 0, "Pan Down", "Pan the view Down"},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}
+};
static int viewpan_exec(bContext *C, wmOperator *op)
{
- ARegion *ar= CTX_wm_region(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ ARegion *ar = CTX_wm_region(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
float vec[3];
- float mval_f[2]= {0.0f, 0.0f};
+ float mval_f[2] = {0.0f, 0.0f};
int pandir;
pandir = RNA_enum_get(op->ptr, "type");
initgrabz(rv3d, 0.0, 0.0, 0.0);
- if (pandir == V3D_VIEW_PANRIGHT) { mval_f[0]= -32.0f; ED_view3d_win_to_delta(ar, mval_f, vec); }
- else if (pandir == V3D_VIEW_PANLEFT) { mval_f[0]= 32.0f; ED_view3d_win_to_delta(ar, mval_f, vec); }
- else if (pandir == V3D_VIEW_PANUP) { mval_f[1]= -25.0f; ED_view3d_win_to_delta(ar, mval_f, vec); }
- else if (pandir == V3D_VIEW_PANDOWN) { mval_f[1]= 25.0f; ED_view3d_win_to_delta(ar, mval_f, vec); }
+ if (pandir == V3D_VIEW_PANRIGHT) { mval_f[0] = -32.0f; ED_view3d_win_to_delta(ar, mval_f, vec); }
+ else if (pandir == V3D_VIEW_PANLEFT) { mval_f[0] = 32.0f; ED_view3d_win_to_delta(ar, mval_f, vec); }
+ else if (pandir == V3D_VIEW_PANUP) { mval_f[1] = -25.0f; ED_view3d_win_to_delta(ar, mval_f, vec); }
+ else if (pandir == V3D_VIEW_PANDOWN) { mval_f[1] = 25.0f; ED_view3d_win_to_delta(ar, mval_f, vec); }
add_v3_v3(rv3d->ofs, vec);
if (rv3d->viewlock & RV3D_BOXVIEW)
@@ -2953,16 +2987,16 @@ static int viewpan_exec(bContext *C, wmOperator *op)
void VIEW3D_OT_view_pan(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Pan";
+ ot->name = "View Pan";
ot->description = "Pan the view";
- ot->idname= "VIEW3D_OT_view_pan";
+ ot->idname = "VIEW3D_OT_view_pan";
/* api callbacks */
- ot->exec= viewpan_exec;
- ot->poll= ED_operator_region_view3d_active;
+ ot->exec = viewpan_exec;
+ ot->poll = ED_operator_region_view3d_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
RNA_def_enum(ot->srna, "type", prop_view_pan_items, 0, "Pan", "Direction of View Pan");
}
@@ -2976,10 +3010,10 @@ static int viewpersportho_exec(bContext *C, wmOperator *UNUSED(op))
ED_view3d_context_user_region(C, &v3d_dummy, &ar);
rv3d = ar->regiondata;
- if (rv3d->viewlock==0) {
- if (rv3d->persp!=RV3D_ORTHO)
- rv3d->persp=RV3D_ORTHO;
- else rv3d->persp=RV3D_PERSP;
+ if (rv3d->viewlock == 0) {
+ if (rv3d->persp != RV3D_ORTHO)
+ rv3d->persp = RV3D_ORTHO;
+ else rv3d->persp = RV3D_PERSP;
ED_region_tag_redraw(ar);
}
@@ -2990,16 +3024,16 @@ static int viewpersportho_exec(bContext *C, wmOperator *UNUSED(op))
void VIEW3D_OT_view_persportho(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "View Persp/Ortho";
+ ot->name = "View Persp/Ortho";
ot->description = "Switch the current view from perspective/orthographic";
- ot->idname= "VIEW3D_OT_view_persportho";
+ ot->idname = "VIEW3D_OT_view_persportho";
/* api callbacks */
- ot->exec= viewpersportho_exec;
- ot->poll= ED_operator_rv3d_user_region_poll;
+ ot->exec = viewpersportho_exec;
+ ot->poll = ED_operator_rv3d_user_region_poll;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
@@ -3007,7 +3041,7 @@ void VIEW3D_OT_view_persportho(wmOperatorType *ot)
static BGpic *background_image_add(bContext *C)
{
- View3D *v3d= CTX_wm_view3d(C);
+ View3D *v3d = CTX_wm_view3d(C);
return ED_view3D_background_image_new(v3d);
}
@@ -3021,21 +3055,21 @@ static int background_image_add_exec(bContext *C, wmOperator *UNUSED(op))
static int background_image_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- View3D *v3d= CTX_wm_view3d(C);
- Image *ima= NULL;
+ View3D *v3d = CTX_wm_view3d(C);
+ Image *ima = NULL;
BGpic *bgpic;
- char name[MAX_ID_NAME-2];
+ char name[MAX_ID_NAME - 2];
/* check input variables */
if (RNA_struct_property_is_set(op->ptr, "filepath")) {
char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path);
- ima= BKE_add_image_file(path);
+ ima = BKE_add_image_file(path);
}
else if (RNA_struct_property_is_set(op->ptr, "name")) {
RNA_string_get(op->ptr, "name", name);
- ima= (Image *)find_id("IM", name);
+ ima = (Image *)find_id("IM", name);
}
bgpic = background_image_add(C);
@@ -3043,14 +3077,14 @@ static int background_image_add_invoke(bContext *C, wmOperator *op, wmEvent *UNU
if (ima) {
bgpic->ima = ima;
- if (ima->id.us==0) id_us_plus(&ima->id);
+ if (ima->id.us == 0) id_us_plus(&ima->id);
else id_lib_extern(&ima->id);
if (!(v3d->flag & V3D_DISPBGPICS))
v3d->flag |= V3D_DISPBGPICS;
}
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
return OPERATOR_FINISHED;
}
@@ -3059,7 +3093,7 @@ void VIEW3D_OT_background_image_add(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Add Background Image";
- ot->description= "Add a new background image";
+ ot->description = "Add a new background image";
ot->idname = "VIEW3D_OT_background_image_add";
/* api callbacks */
@@ -3071,7 +3105,7 @@ void VIEW3D_OT_background_image_add(wmOperatorType *ot)
ot->flag = 0;
/* properties */
- RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME-2, "Name", "Image name to assign");
+ RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME - 2, "Name", "Image name to assign");
RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file");
}
@@ -3081,11 +3115,11 @@ static int background_image_remove_exec(bContext *C, wmOperator *op)
{
View3D *v3d = CTX_wm_view3d(C);
int index = RNA_int_get(op->ptr, "index");
- BGpic *bgpic_rem= BLI_findlink(&v3d->bgpicbase, index);
+ BGpic *bgpic_rem = BLI_findlink(&v3d->bgpicbase, index);
if (bgpic_rem) {
ED_view3D_background_image_remove(v3d, bgpic_rem);
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
return OPERATOR_FINISHED;
}
else {
@@ -3098,7 +3132,7 @@ void VIEW3D_OT_background_image_remove(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Remove Background Image";
- ot->description= "Remove a background image from the 3D view";
+ ot->description = "Remove a background image from the 3D view";
ot->idname = "VIEW3D_OT_background_image_remove";
/* api callbacks */
@@ -3108,7 +3142,7 @@ void VIEW3D_OT_background_image_remove(wmOperatorType *ot)
/* flags */
ot->flag = 0;
- RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "Background image index to remove ", 0, INT_MAX);
+ RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "Background image index to remove", 0, INT_MAX);
}
/* ********************* set clipping operator ****************** */
@@ -3117,14 +3151,14 @@ static void calc_clipping_plane(float clip[6][4], BoundBox *clipbb)
{
int val;
- for (val=0; val<4; val++) {
+ for (val = 0; val < 4; val++) {
- normal_tri_v3( clip[val],clipbb->vec[val], clipbb->vec[val==3?0:val+1], clipbb->vec[val+4]);
+ normal_tri_v3(clip[val], clipbb->vec[val], clipbb->vec[val == 3 ? 0 : val + 1], clipbb->vec[val + 4]);
- clip[val][3]=
- - clip[val][0]*clipbb->vec[val][0]
- - clip[val][1]*clipbb->vec[val][1]
- - clip[val][2]*clipbb->vec[val][2];
+ /* TODO - this is just '-dot_v3v3(clip[val], clipbb->vec[val])' isnt it? - sould replace */
+ clip[val][3] = -clip[val][0] * clipbb->vec[val][0] -
+ clip[val][1] * clipbb->vec[val][1] -
+ clip[val][2] * clipbb->vec[val][2];
}
}
@@ -3136,7 +3170,7 @@ static void calc_local_clipping(float clip_local[][4], BoundBox *clipbb, float m
invert_m4_m4(imat, mat);
- for (i=0; i<8; i++) {
+ for (i = 0; i < 8; i++) {
mul_v3_m4v3(clipbb_local.vec[i], imat, clipbb->vec[i]);
}
@@ -3151,18 +3185,18 @@ void ED_view3d_clipping_local(RegionView3D *rv3d, float mat[][4])
static int view3d_clipping_exec(bContext *C, wmOperator *op)
{
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
ViewContext vc;
bglMats mats;
rcti rect;
- 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");
+ 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");
rv3d->rflag |= RV3D_CLIPPING;
- rv3d->clipbb= MEM_callocN(sizeof(BoundBox), "clipbb");
+ rv3d->clipbb = MEM_callocN(sizeof(BoundBox), "clipbb");
/* note; otherwise opengl won't work */
view3d_operator_needs_opengl(C);
@@ -3176,14 +3210,14 @@ static int view3d_clipping_exec(bContext *C, wmOperator *op)
static int view3d_clipping_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
- ARegion *ar= CTX_wm_region(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
+ ARegion *ar = CTX_wm_region(C);
if (rv3d->rflag & RV3D_CLIPPING) {
rv3d->rflag &= ~RV3D_CLIPPING;
ED_region_tag_redraw(ar);
if (rv3d->clipbb) MEM_freeN(rv3d->clipbb);
- rv3d->clipbb= NULL;
+ rv3d->clipbb = NULL;
return OPERATOR_FINISHED;
}
else {
@@ -3196,20 +3230,20 @@ void VIEW3D_OT_clip_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Clipping Border";
+ ot->name = "Clipping Border";
ot->description = "Set the view clipping border";
- ot->idname= "VIEW3D_OT_clip_border";
+ ot->idname = "VIEW3D_OT_clip_border";
/* api callbacks */
- ot->invoke= view3d_clipping_invoke;
- ot->exec= view3d_clipping_exec;
- ot->modal= WM_border_select_modal;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = view3d_clipping_invoke;
+ ot->exec = view3d_clipping_exec;
+ ot->modal = WM_border_select_modal;
+ ot->cancel = WM_border_select_cancel;
- ot->poll= ED_operator_region_view3d_active;
+ ot->poll = ED_operator_region_view3d_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
/* rna */
RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
@@ -3223,21 +3257,21 @@ void VIEW3D_OT_clip_border(wmOperatorType *ot)
/* mx my in region coords */
static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
- Scene *scene= CTX_data_scene(C);
- ARegion *ar= CTX_wm_region(C);
+ Scene *scene = CTX_data_scene(C);
+ ARegion *ar = CTX_wm_region(C);
View3D *v3d = CTX_wm_view3d(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
float dx, dy, fz, *fp = NULL, dvec[3], oldcurs[3];
int mval[2];
// short ctrl= 0; // XXX
int flip;
- fp= give_cursor(scene, v3d);
+ fp = give_cursor(scene, v3d);
// if (obedit && ctrl) lr_click= 1;
copy_v3_v3(oldcurs, fp);
project_int_noclip(ar, fp, mval);
- flip= initgrabz(rv3d, fp[0], fp[1], fp[2]);
+ flip = initgrabz(rv3d, fp[0], fp[1], fp[2]);
/* reset the depth based on the view offset */
if (flip) {
@@ -3245,20 +3279,20 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *eve
/* re initialize */
project_int_noclip(ar, fp, mval);
- flip= initgrabz(rv3d, fp[0], fp[1], fp[2]);
+ flip = initgrabz(rv3d, fp[0], fp[1], fp[2]);
(void)flip;
}
- if (mval[0]!=IS_CLIPPED) {
+ if (mval[0] != IS_CLIPPED) {
short depth_used = 0;
if (U.uiflag & USER_ORBIT_ZBUF) { /* maybe this should be accessed some other way */
view3d_operator_needs_opengl(C);
if (ED_view3d_autodist(scene, ar, v3d, event->mval, fp))
- depth_used= 1;
+ depth_used = 1;
}
- if (depth_used==0) {
+ if (depth_used == 0) {
float mval_f[2];
VECSUB2D(mval_f, mval, event->mval);
ED_view3d_win_to_delta(ar, mval_f, dvec);
@@ -3267,21 +3301,21 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *eve
}
else {
- dx= ((float)(event->mval[0]-(ar->winx/2)))*rv3d->zfac/(ar->winx/2);
- dy= ((float)(event->mval[1]-(ar->winy/2)))*rv3d->zfac/(ar->winy/2);
+ dx = ((float)(event->mval[0] - (ar->winx / 2))) * rv3d->zfac / (ar->winx / 2);
+ dy = ((float)(event->mval[1] - (ar->winy / 2))) * rv3d->zfac / (ar->winy / 2);
- fz= rv3d->persmat[0][3]*fp[0]+ rv3d->persmat[1][3]*fp[1]+ rv3d->persmat[2][3]*fp[2]+ rv3d->persmat[3][3];
- fz= fz/rv3d->zfac;
+ fz = rv3d->persmat[0][3] * fp[0] + rv3d->persmat[1][3] * fp[1] + rv3d->persmat[2][3] * fp[2] + rv3d->persmat[3][3];
+ fz = fz / rv3d->zfac;
- fp[0]= (rv3d->persinv[0][0]*dx + rv3d->persinv[1][0]*dy+ rv3d->persinv[2][0]*fz)-rv3d->ofs[0];
- fp[1]= (rv3d->persinv[0][1]*dx + rv3d->persinv[1][1]*dy+ rv3d->persinv[2][1]*fz)-rv3d->ofs[1];
- fp[2]= (rv3d->persinv[0][2]*dx + rv3d->persinv[1][2]*dy+ rv3d->persinv[2][2]*fz)-rv3d->ofs[2];
+ fp[0] = (rv3d->persinv[0][0] * dx + rv3d->persinv[1][0] * dy + rv3d->persinv[2][0] * fz) - rv3d->ofs[0];
+ fp[1] = (rv3d->persinv[0][1] * dx + rv3d->persinv[1][1] * dy + rv3d->persinv[2][1] * fz) - rv3d->ofs[1];
+ fp[2] = (rv3d->persinv[0][2] * dx + rv3d->persinv[1][2] * dy + rv3d->persinv[2][2] * fz) - rv3d->ofs[2];
}
if (v3d && v3d->localvd)
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
else
- WM_event_add_notifier(C, NC_SCENE|NA_EDITED, scene);
+ WM_event_add_notifier(C, NC_SCENE | NA_EDITED, scene);
return OPERATOR_FINISHED;
}
@@ -3290,17 +3324,17 @@ void VIEW3D_OT_cursor3d(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set 3D Cursor";
+ ot->name = "Set 3D Cursor";
ot->description = "Set the location of the 3D cursor";
- ot->idname= "VIEW3D_OT_cursor3d";
+ ot->idname = "VIEW3D_OT_cursor3d";
/* api callbacks */
- ot->invoke= set_3dcursor_invoke;
+ ot->invoke = set_3dcursor_invoke;
- ot->poll= ED_operator_view3d_active;
+ ot->poll = ED_operator_view3d_active;
/* flags */
-// ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+// ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* rna later */
@@ -3322,7 +3356,7 @@ static int manipulator_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* note; otherwise opengl won't work */
view3d_operator_needs_opengl(C);
- if (0==BIF_do_manipulator(C, event, op))
+ if (0 == BIF_do_manipulator(C, event, op))
return OPERATOR_PASS_THROUGH;
return OPERATOR_FINISHED;
@@ -3332,14 +3366,14 @@ void VIEW3D_OT_manipulator(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "3D Manipulator";
+ ot->name = "3D Manipulator";
ot->description = "Manipulate selected item by axis";
- ot->idname= "VIEW3D_OT_manipulator";
+ ot->idname = "VIEW3D_OT_manipulator";
/* api callbacks */
- ot->invoke= manipulator_invoke;
+ ot->invoke = manipulator_invoke;
- ot->poll= ED_operator_view3d_active;
+ ot->poll = ED_operator_view3d_active;
/* properties to pass to transform */
Transform_Properties(ot, P_CONSTRAINT);
@@ -3349,7 +3383,7 @@ static int enable_manipulator_invoke(bContext *C, wmOperator *op, wmEvent *UNUSE
{
View3D *v3d = CTX_wm_view3d(C);
- v3d->twtype=0;
+ v3d->twtype = 0;
if (RNA_boolean_get(op->ptr, "translate"))
v3d->twtype |= V3D_MANIP_TRANSLATE;
@@ -3358,26 +3392,31 @@ static int enable_manipulator_invoke(bContext *C, wmOperator *op, wmEvent *UNUSE
if (RNA_boolean_get(op->ptr, "scale"))
v3d->twtype |= V3D_MANIP_SCALE;
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
return OPERATOR_FINISHED;
}
void VIEW3D_OT_enable_manipulator(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
- ot->name= "Enable 3D Manipulator";
+ ot->name = "Enable 3D Manipulator";
ot->description = "Enable the transform manipulator for use";
- ot->idname= "VIEW3D_OT_enable_manipulator";
+ ot->idname = "VIEW3D_OT_enable_manipulator";
/* api callbacks */
- ot->invoke= enable_manipulator_invoke;
- ot->poll= ED_operator_view3d_active;
+ ot->invoke = enable_manipulator_invoke;
+ ot->poll = ED_operator_view3d_active;
/* rna later */
- RNA_def_boolean(ot->srna, "translate", 0, "Translate", "Enable the translate manipulator");
- RNA_def_boolean(ot->srna, "rotate", 0, "Rotate", "Enable the rotate manipulator");
- RNA_def_boolean(ot->srna, "scale", 0, "Scale", "Enable the scale manipulator");
+ prop = RNA_def_boolean(ot->srna, "translate", 0, "Translate", "Enable the translate manipulator");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ prop = RNA_def_boolean(ot->srna, "rotate", 0, "Rotate", "Enable the rotate manipulator");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ prop = RNA_def_boolean(ot->srna, "scale", 0, "Scale", "Enable the scale manipulator");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
/* ************************* below the line! *********************** */
@@ -3385,16 +3424,16 @@ void VIEW3D_OT_enable_manipulator(wmOperatorType *ot)
static float view_autodist_depth_margin(ARegion *ar, const int mval[2], int margin)
{
- ViewDepths depth_temp= {0};
+ ViewDepths depth_temp = {0};
rcti rect;
float depth_close;
- if (margin==0) {
+ if (margin == 0) {
/* Get Z Depths, needed for perspective, nice for ortho */
- rect.xmin= mval[0];
- rect.ymin= mval[1];
- rect.xmax= mval[0] + 1;
- rect.ymax= mval[1] + 1;
+ rect.xmin = mval[0];
+ rect.ymin = mval[1];
+ rect.xmax = mval[0] + 1;
+ rect.ymax = mval[1] + 1;
}
else {
rect.xmax = mval[0] + margin;
@@ -3405,7 +3444,7 @@ static float view_autodist_depth_margin(ARegion *ar, const int mval[2], int marg
}
view3d_update_depths_rect(ar, &depth_temp, &rect);
- depth_close= view3d_depth_near(&depth_temp);
+ depth_close = view3d_depth_near(&depth_temp);
if (depth_temp.depths) MEM_freeN(depth_temp.depths);
return depth_close;
}
@@ -3414,16 +3453,16 @@ static float view_autodist_depth_margin(ARegion *ar, const int mval[2], int marg
int ED_view3d_autodist(Scene *scene, ARegion *ar, View3D *v3d, const int mval[2], float mouse_worldloc[3])
{
bglMats mats; /* ZBuffer depth vars */
- float depth_close= FLT_MAX;
+ float depth_close = FLT_MAX;
double cent[2], p[3];
/* Get Z Depths, needed for perspective, nice for ortho */
bgl_get_mats(&mats);
draw_depth(scene, ar, v3d, NULL);
- depth_close= view_autodist_depth_margin(ar, mval, 4);
+ depth_close = view_autodist_depth_margin(ar, mval, 4);
- if (depth_close==FLT_MAX)
+ if (depth_close == FLT_MAX)
return 0;
cent[0] = (double)mval[0];
@@ -3444,13 +3483,13 @@ int ED_view3d_autodist(Scene *scene, ARegion *ar, View3D *v3d, const int mval[2]
int ED_view3d_autodist_init(Scene *scene, ARegion *ar, View3D *v3d, int mode) //, float *autodist )
{
/* Get Z Depths, needed for perspective, nice for ortho */
- switch(mode) {
- case 0:
- draw_depth(scene, ar, v3d, NULL);
- break;
- case 1:
- draw_depth_gpencil(scene, ar, v3d);
- break;
+ switch (mode) {
+ case 0:
+ draw_depth(scene, ar, v3d, NULL);
+ break;
+ case 1:
+ draw_depth_gpencil(scene, ar, v3d);
+ break;
}
return 1;
@@ -3466,11 +3505,11 @@ int ED_view3d_autodist_simple(ARegion *ar, const int mval[2], float mouse_worldl
/* Get Z Depths, needed for perspective, nice for ortho */
if (force_depth)
- depth= *force_depth;
+ depth = *force_depth;
else
- depth= view_autodist_depth_margin(ar, mval, margin);
+ depth = view_autodist_depth_margin(ar, mval, margin);
- if (depth==FLT_MAX)
+ if (depth == FLT_MAX)
return 0;
cent[0] = (double)mval[0];
@@ -3479,7 +3518,7 @@ int ED_view3d_autodist_simple(ARegion *ar, const int mval[2], float mouse_worldl
bgl_get_mats(&mats);
if (!gluUnProject(cent[0], cent[1], depth,
- mats.modelview, mats.projection, (GLint *)mats.viewport, &p[0], &p[1], &p[2]))
+ mats.modelview, mats.projection, (GLint *)mats.viewport, &p[0], &p[1], &p[2]))
{
return 0;
}
@@ -3492,9 +3531,9 @@ int ED_view3d_autodist_simple(ARegion *ar, const int mval[2], float mouse_worldl
int ED_view3d_autodist_depth(struct ARegion *ar, const int mval[2], int margin, float *depth)
{
- *depth= view_autodist_depth_margin(ar, mval, margin);
+ *depth = view_autodist_depth_margin(ar, mval, margin);
- return (*depth==FLT_MAX) ? 0:1;
+ return (*depth == FLT_MAX) ? 0 : 1;
}
static int depth_segment_cb(int x, int y, void *userData)
@@ -3503,13 +3542,13 @@ static int depth_segment_cb(int x, int y, void *userData)
int mval[2];
float depth;
- mval[0]= x;
- mval[1]= y;
+ mval[0] = x;
+ mval[1] = y;
- depth= view_autodist_depth_margin(data->ar, mval, data->margin);
+ depth = view_autodist_depth_margin(data->ar, mval, data->margin);
if (depth != FLT_MAX) {
- data->depth= depth;
+ data->depth = depth;
return 0;
}
else {
@@ -3524,25 +3563,26 @@ int ED_view3d_autodist_depth_seg(struct ARegion *ar, const int mval_sta[2], cons
int p1[2];
int p2[2];
- data.ar= ar;
- data.margin= margin;
- data.depth= FLT_MAX;
+ data.ar = ar;
+ data.margin = margin;
+ data.depth = FLT_MAX;
copy_v2_v2_int(p1, mval_sta);
copy_v2_v2_int(p2, mval_end);
plot_line_v2v2i(p1, p2, depth_segment_cb, &data);
- *depth= data.depth;
+ *depth = data.depth;
- return (*depth==FLT_MAX) ? 0:1;
+ 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 */
@@ -3560,9 +3600,9 @@ void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist)
float nmat[3][3];
float vec[3];
- vec[0]= 0.0f;
- vec[1]= 0.0f;
- vec[2]= -(*dist);
+ vec[0] = 0.0f;
+ vec[1] = 0.0f;
+ vec[2] = -(*dist);
copy_m3_m4(nmat, mat);
normalize_m3(nmat);
@@ -3574,8 +3614,8 @@ void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist)
void ED_view3d_to_m4(float mat[][4], const float ofs[3], const float quat[4], const float dist)
{
- float iviewquat[4]= {-quat[0], quat[1], quat[2], quat[3]};
- float dvec[3]= {0.0f, 0.0f, dist};
+ float iviewquat[4] = {-quat[0], quat[1], quat[2], quat[3]};
+ float dvec[3] = {0.0f, 0.0f, dist};
quat_to_mat4(mat, iviewquat);
mul_mat3_m4_v3(mat, dvec);
@@ -3593,7 +3633,7 @@ void ED_view3d_from_object(Object *ob, float ofs[3], float quat[4], float *dist,
camera_params_init(&params);
camera_params_from_object(&params, ob);
- *lens= params.lens;
+ *lens = params.lens;
}
}
@@ -3607,13 +3647,13 @@ void ED_view3d_to_object(Object *ob, const float ofs[3], const float quat[4], co
BGpic *ED_view3D_background_image_new(View3D *v3d)
{
- BGpic *bgpic= MEM_callocN(sizeof(BGpic), "Background Image");
+ BGpic *bgpic = MEM_callocN(sizeof(BGpic), "Background Image");
- bgpic->size= 5.0;
- bgpic->blend= 0.5;
- bgpic->iuser.fie_ima= 2;
- bgpic->iuser.ok= 1;
- bgpic->view= 0; /* 0 for all */
+ bgpic->size = 5.0;
+ bgpic->blend = 0.5;
+ bgpic->iuser.fie_ima = 2;
+ bgpic->iuser.ok = 1;
+ bgpic->view = 0; /* 0 for all */
bgpic->flag |= V3D_BGPIC_EXPANDED;
BLI_addtail(&v3d->bgpicbase, bgpic);
@@ -3625,24 +3665,18 @@ 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);
}
void ED_view3D_background_image_clear(View3D *v3d)
{
- BGpic *bgpic= v3d->bgpicbase.first;
+ BGpic *bgpic = v3d->bgpicbase.first;
while (bgpic) {
- BGpic *next_bgpic= bgpic->next;
+ BGpic *next_bgpic = bgpic->next;
ED_view3D_background_image_remove(v3d, bgpic);
- bgpic= next_bgpic;
+ bgpic = next_bgpic;
}
}
diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c
index c8c62d63e36..31beda3b3f9 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"
@@ -58,11 +56,10 @@
#include "PIL_time.h" /* smoothview */
-#include "view3d_intern.h" // own include
-
+#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,11 +169,12 @@ 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 */
+ wmNDOFMotionData*ndof; /* latest 3D mouse values */
/* fly state state */
float speed; /* the speed the view is moving per redraw */
@@ -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 done 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,67 +224,67 @@ 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();
}
/* FlyInfo->state */
-#define FLY_RUNNING 0
-#define FLY_CANCEL 1
-#define FLY_CONFIRM 2
+#define FLY_RUNNING 0
+#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)
{
- float upvec[3]; // tmp
+ 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;
+ fly->redraw = 1;
#endif
- fly->dvec_prev[0]= fly->dvec_prev[1]= fly->dvec_prev[2]= 0.0f;
+ zero_v3(fly->dvec_prev);
- 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;
+ ((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*/
+ /* 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,26 +437,27 @@ 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*/
+ /* 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);
- /*Done with correcting for the dist */
+ /* Done with correcting for the dist */
}
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 +465,6 @@ static int flyEnd(bContext *C, FlyInfo *fly)
if (fly->obtfm)
MEM_freeN(fly->obtfm);
-
if (fly->ndof)
MEM_freeN(fly->ndof);
@@ -481,20 +486,20 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
copy_v2_v2_int(fly->mval, event->mval);
}
else if (event->type == NDOF_MOTION) {
- // do these automagically get delivered? yes.
+ /* do these automagically get delivered? yes. */
// 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
+ /* start keeping track of 3D mouse position */
#ifdef NDOF_FLY_DEBUG
puts("start keeping track of 3D mouse position");
#endif
- // fall through...
+ /* fall through... */
case P_IN_PROGRESS:
- // update 3D mouse position
+ /* update 3D mouse position */
#ifdef NDOF_FLY_DEBUG
putchar('.'); fflush(stdout);
#endif
@@ -518,12 +523,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
- }
+ break; /* should always be one of the above 3 */
}
+ }
/* handle modal keymap first */
else if (event->type == EVT_MODAL_MAP) {
switch (event->val) {
@@ -539,18 +544,17 @@ 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);*/
- /*Mouse wheel delays range from 0.5==slow to 0.01==fast*/
+ /* Mouse wheel delays range from 0.5==slow to 0.01==fast */
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)
+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;
+ View3D*v3d = fly->v3d;
+ 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,26 +760,24 @@ 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 */
+ float mat[3][3]; /* 3x3 copy of the view matrix so we can move along the view axis */
+ float 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 */
+ float 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 */
+ float moffset[2]; /* mouse offset from the views center */
+ float tmp_quat[4]; /* used for rotating the view */
- int
-// cent_orig[2], /* view center */
-//XXX- can avoid using // cent[2], /* view center modified */
- xmargin, ymargin; /* x and y margin are define the safe area where the mouses movement wont rotate the view */
+// int cent_orig[2], /* view center */
+//XXX- can avoid using // cent[2], /* view center modified */
+ int xmargin, ymargin; /* x and y margin are define the safe area where the mouses movement wont rotate the view */
#ifdef NDOF_FLY_DEBUG
{
@@ -748,9 +786,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,65 +796,67 @@ 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
* moffset[0]/(ar->winx-xmargin*2) - window size minus margin (same for y)
*
- * the mouse moves isnt linear */
+ * the mouse moves isn't 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 don't fly too fast */
+ double time_current;
float time_redraw;
float time_redraw_clamped;
#ifdef NDOF_FLY_DRAW_TOOMUCH
- fly->redraw= 1;
+ 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;
/* 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 +868,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,22 +916,24 @@ 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*/
+ /* 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 */
@@ -901,45 +944,48 @@ static int flyApply(bContext *C, FlyInfo *fly)
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; /* don't 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 isn't applying x rot */
+ upvec[0] = 0;
+ upvec[1] = 0;
+ upvec[2] = 1;
mul_m3_v3(mat, upvec);
- /*make sure we have some z rolling*/
+ /* 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->use_freelook) {
+ if (fly->axis == -1) {
+ /* pause */
+ zero_v3(dvec_tmp);
+ }
+ else if (!fly->use_freelook) {
/* Normal operation */
/* define dvec, view direction vector */
- dvec_tmp[0]= dvec_tmp[1]= dvec_tmp[2]= 0.0f;
+ zero_v3(dvec_tmp);
/* 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 +1000,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 +1011,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);
@@ -983,28 +1029,30 @@ static int flyApply(bContext *C, FlyInfo *fly)
static int flyApply_ndof(bContext *C, FlyInfo *fly)
{
/* shorthand for oft-used variables */
- wmNDOFMotionData* ndof = fly->ndof;
+ wmNDOFMotionData *ndof = fly->ndof;
const float dt = ndof->dt;
- RegionView3D* rv3d = fly->rv3d;
+ 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);
+ int shouldTranslate = TRUE;
float view_inv[4];
invert_qt_qt(view_inv, rv3d->viewquat);
- rv3d->rot_angle = 0.f; // disable onscreen rotation doo-dad
+ rv3d->rot_angle = 0.0f; /* disable onscreen rotation doo-dad */
if (shouldTranslate) {
- const float forward_sensitivity = 1.f;
+ const float forward_sensitivity = 1.0f;
const float vertical_sensitivity = 0.4f;
- const float lateral_sensitivity = 0.6f;
+ const float lateral_sensitivity = 0.6f;
- float speed = 10.f; /* blender units per second */
+ float speed = 10.0f; /* blender units per second */
/* ^^ this is ok for default cube scene, but should scale with.. something */
float trans[3] = {lateral_sensitivity * ndof->tvec[0],
@@ -1016,7 +1064,7 @@ static int flyApply_ndof(bContext *C, FlyInfo *fly)
mul_v3_fl(trans, speed * dt);
- // transform motion from view to world coordinates
+ /* transform motion from view to world coordinates */
mul_qt_v3(view_inv, trans);
if (flag & NDOF_FLY_HELICOPTER) {
@@ -1024,16 +1072,16 @@ static int flyApply_ndof(bContext *C, FlyInfo *fly)
trans[2] = speed * dt * vertical_sensitivity * ndof->tvec[1];
}
- 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;
+ 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.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)) {
- // move center of view opposite of hand motion (this is camera mode, not object mode)
+ /* move center of view opposite of hand motion (this is camera mode, not object mode) */
sub_v3_v3(rv3d->ofs, trans);
shouldTranslate = TRUE;
}
@@ -1043,7 +1091,7 @@ static int flyApply_ndof(bContext *C, FlyInfo *fly)
}
if (shouldRotate) {
- const float turn_sensitivity = 1.f;
+ const float turn_sensitivity = 1.0f;
float rotation[4];
float axis[3];
@@ -1058,15 +1106,15 @@ static int flyApply_ndof(bContext *C, FlyInfo *fly)
/* transform rotation axis from view to world coordinates */
mul_qt_v3(view_inv, axis);
- // apply rotation to view
+ /* apply rotation to view */
axis_angle_to_quat(rotation, axis, angle);
mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, rotation);
if (flag & NDOF_LOCK_HORIZON) {
/* force an upright viewpoint
* TODO: make this less... sudden */
- float view_horizon[3] = {1.f, 0.f, 0.f}; /* view +x */
- float view_direction[3] = {0.f, 0.f, -1.f}; /* view -z (into screen) */
+ float view_horizon[3] = {1.0f, 0.0f, 0.0f}; /* view +x */
+ float view_direction[3] = {0.0f, 0.0f, -1.0f}; /* view -z (into screen) */
/* find new inverse since viewquat has changed */
invert_qt_qt(view_inv, rv3d->viewquat);
@@ -1099,7 +1147,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 +1155,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 +1185,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 +1193,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 +1215,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 +1233,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 29ef1f1b617..a3031bc3cfa 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -85,75 +85,76 @@
*/
/* view3d handler codes */
-#define VIEW3D_HANDLER_BACKGROUND 1
-#define VIEW3D_HANDLER_PROPERTIES 2
-#define VIEW3D_HANDLER_OBJECT 3
-#define VIEW3D_HANDLER_PREVIEW 4
-#define VIEW3D_HANDLER_MULTIRES 5
-#define VIEW3D_HANDLER_TRANSFORM 6
+#define VIEW3D_HANDLER_BACKGROUND 1
+#define VIEW3D_HANDLER_PROPERTIES 2
+#define VIEW3D_HANDLER_OBJECT 3
+#define VIEW3D_HANDLER_PREVIEW 4
+#define VIEW3D_HANDLER_MULTIRES 5
+#define VIEW3D_HANDLER_TRANSFORM 6
#define VIEW3D_HANDLER_GREASEPENCIL 7
-#define VIEW3D_HANDLER_BONESKETCH 8
+#define VIEW3D_HANDLER_BONESKETCH 8
/* end XXX ************* */
static void do_view3d_header_buttons(bContext *C, void *arg, int event);
#define B_SCENELOCK 101
-#define B_FULL 102
-#define B_HOME 103
-#define B_VIEWBUT 104
-#define B_PERSP 105
+#define B_FULL 102
+#define B_HOME 103
+#define B_VIEWBUT 104
+#define B_PERSP 105
#define B_MODESELECT 108
-#define B_SEL_VERT 110
-#define B_SEL_EDGE 111
-#define B_SEL_FACE 112
-#define B_MAN_TRANS 116
-#define B_MAN_ROT 117
-#define B_MAN_SCALE 118
-#define B_NDOF 119
-#define B_MAN_MODE 120
-#define B_REDR 122
-#define B_NOP 123
+#define B_SEL_VERT 110
+#define B_SEL_EDGE 111
+#define B_SEL_FACE 112
+#define B_MAN_TRANS 116
+#define B_MAN_ROT 117
+#define B_MAN_SCALE 118
+#define B_NDOF 119
+#define B_MAN_MODE 120
+#define B_REDR 122
+#define B_NOP 123
// XXX quickly ported across
static void handle_view3d_lock(bContext *C)
{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
- ScrArea *sa= CTX_wm_area(C);
- View3D *v3d= CTX_wm_view3d(C);
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
+ ScrArea *sa = CTX_wm_area(C);
+ View3D *v3d = CTX_wm_view3d(C);
if (v3d != NULL && sa != NULL) {
- if (v3d->localvd==NULL && v3d->scenelock && sa->spacetype==SPACE_VIEW3D) {
+ if (v3d->localvd == NULL && v3d->scenelock && sa->spacetype == SPACE_VIEW3D) {
/* copy to scene */
- scene->lay= v3d->lay;
- scene->layact= v3d->layact;
- scene->camera= v3d->camera;
+ scene->lay = v3d->lay;
+ 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 */
- WM_event_add_notifier(C, NC_SCENE|ND_LAYER, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_LAYER, scene);
}
}
}
-/* 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)
{
/* sanity check - when in editmode disallow switching the editmode layer off since its confusing
* an alternative would be to always draw the editmode object. */
- if (scene->obedit && (scene->obedit->lay & v3d->lay)==0) {
+ if (scene->obedit && (scene->obedit->lay & v3d->lay) == 0) {
int bit;
- for (bit=0; bit<32; bit++) {
- if (scene->obedit->lay & (1<<bit)) {
- v3d->lay |= 1<<bit;
+ for (bit = 0; bit < 32; bit++) {
+ if (scene->obedit->lay & (1 << bit)) {
+ v3d->lay |= 1 << bit;
break;
}
}
@@ -162,11 +163,11 @@ static void view3d_layers_editmode_ensure(Scene *scene, View3D *v3d)
static int view3d_layers_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- ScrArea *sa= CTX_wm_area(C);
- View3D *v3d= sa->spacedata.first;
- int nr= RNA_int_get(op->ptr, "nr");
- int toggle= RNA_boolean_get(op->ptr, "toggle");
+ Scene *scene = CTX_data_scene(C);
+ ScrArea *sa = CTX_wm_area(C);
+ View3D *v3d = sa->spacedata.first;
+ int nr = RNA_int_get(op->ptr, "nr");
+ int toggle = RNA_boolean_get(op->ptr, "toggle");
if (nr < 0)
return OPERATOR_CANCELLED;
@@ -174,16 +175,16 @@ static int view3d_layers_exec(bContext *C, wmOperator *op)
if (nr == 0) {
/* all layers */
if (!v3d->layact)
- v3d->layact= 1;
+ v3d->layact = 1;
- if (toggle && v3d->lay == ((1<<20)-1)) {
+ if (toggle && v3d->lay == ((1 << 20) - 1)) {
/* return to active layer only */
v3d->lay = v3d->layact;
view3d_layers_editmode_ensure(scene, v3d);
}
else {
- v3d->lay |= (1<<20)-1;
+ v3d->lay |= (1 << 20) - 1;
}
}
else {
@@ -191,24 +192,24 @@ static int view3d_layers_exec(bContext *C, wmOperator *op)
nr--;
if (RNA_boolean_get(op->ptr, "extend")) {
- if (toggle && v3d->lay & (1<<nr) && (v3d->lay & ~(1<<nr)))
- v3d->lay &= ~(1<<nr);
+ if (toggle && v3d->lay & (1 << nr) && (v3d->lay & ~(1 << nr)))
+ v3d->lay &= ~(1 << nr);
else
- v3d->lay |= (1<<nr);
+ v3d->lay |= (1 << nr);
}
else {
- v3d->lay = (1<<nr);
+ v3d->lay = (1 << nr);
}
view3d_layers_editmode_ensure(scene, v3d);
/* set active layer, ensure to always have one */
- if (v3d->lay & (1<<nr))
- v3d->layact= 1<<nr;
- else if ((v3d->lay & v3d->layact)==0) {
- for (bit=0; bit<32; bit++) {
- if (v3d->lay & (1<<bit)) {
- v3d->layact= 1<<bit;
+ if (v3d->lay & (1 << nr))
+ v3d->layact = 1 << nr;
+ else if ((v3d->lay & v3d->layact) == 0) {
+ for (bit = 0; bit < 32; bit++) {
+ if (v3d->lay & (1 << bit)) {
+ v3d->layact = 1 << bit;
break;
}
}
@@ -237,7 +238,7 @@ static int view3d_layers_invoke(bContext *C, wmOperator *op, wmEvent *event)
RNA_boolean_set(op->ptr, "extend", FALSE);
if (event->alt) {
- int nr= RNA_int_get(op->ptr, "nr") + 10;
+ int nr = RNA_int_get(op->ptr, "nr") + 10;
RNA_int_set(op->ptr, "nr", nr);
}
view3d_layers_exec(C, op);
@@ -247,23 +248,23 @@ static int view3d_layers_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int view3d_layers_poll(bContext *C)
{
- return (ED_operator_view3d_active(C) && CTX_wm_view3d(C)->localvd==NULL);
+ return (ED_operator_view3d_active(C) && CTX_wm_view3d(C)->localvd == NULL);
}
void VIEW3D_OT_layers(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Layers";
- ot->description= "Toggle layer(s) visibility";
- ot->idname= "VIEW3D_OT_layers";
+ ot->name = "Layers";
+ ot->description = "Toggle layer(s) visibility";
+ ot->idname = "VIEW3D_OT_layers";
/* api callbacks */
- ot->invoke= view3d_layers_invoke;
- ot->exec= view3d_layers_exec;
- ot->poll= view3d_layers_poll;
+ ot->invoke = view3d_layers_invoke;
+ ot->exec = view3d_layers_exec;
+ ot->poll = view3d_layers_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_int(ot->srna, "nr", 1, 0, 20, "Number", "The layer number to set, zero for all layers", 0, 20);
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Add this layer to the current view layers");
@@ -279,29 +280,29 @@ static int modeselect_addmode(char *str, const char *title, int id, int icon)
static char *view3d_modeselect_pup(Scene *scene)
{
- Object *ob= OBACT;
+ Object *ob = OBACT;
static char string[512];
- const char *title= IFACE_("Mode: %t");
+ const char *title = IFACE_("Mode: %t");
char *str = string;
BLI_strncpy(str, title, sizeof(string));
str += modeselect_addmode(str, N_("Object Mode"), OB_MODE_OBJECT, ICON_OBJECT_DATA);
- if (ob==NULL || ob->data==NULL) return string;
+ if (ob == NULL || ob->data == NULL) return string;
if (ob->id.lib) return string;
if (!((ID *)ob->data)->lib) {
/* if active object is editable */
if ( ((ob->type == OB_MESH)
- || (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT)
- || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) {
+ || (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT)
+ || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) {
str += modeselect_addmode(str, N_("Edit Mode"), OB_MODE_EDIT, ICON_EDITMODE_HLT);
}
else if (ob->type == OB_ARMATURE) {
if (ob->mode & OB_MODE_POSE)
- str += modeselect_addmode(str, N_("Edit Mode"), OB_MODE_EDIT|OB_MODE_POSE, ICON_EDITMODE_HLT);
+ str += modeselect_addmode(str, N_("Edit Mode"), OB_MODE_EDIT | OB_MODE_POSE, ICON_EDITMODE_HLT);
else
str += modeselect_addmode(str, N_("Edit Mode"), OB_MODE_EDIT, ICON_EDITMODE_HLT);
}
@@ -316,13 +317,13 @@ static char *view3d_modeselect_pup(Scene *scene)
}
/* if active object is an armature */
- if (ob->type==OB_ARMATURE) {
+ if (ob->type == OB_ARMATURE) {
str += modeselect_addmode(str, N_("Pose Mode"), OB_MODE_POSE, ICON_POSE_HLT);
}
- if ( ob->particlesystem.first ||
- modifiers_findByType(ob, eModifierType_Cloth) ||
- modifiers_findByType(ob, eModifierType_Softbody))
+ if (ob->particlesystem.first ||
+ modifiers_findByType(ob, eModifierType_Cloth) ||
+ modifiers_findByType(ob, eModifierType_Softbody))
{
str += modeselect_addmode(str, N_("Particle Mode"), OB_MODE_PARTICLE_EDIT, ICON_PARTICLEMODE);
}
@@ -333,97 +334,97 @@ static char *view3d_modeselect_pup(Scene *scene)
static void do_view3d_header_buttons(bContext *C, void *UNUSED(arg), int event)
{
- wmWindow *win= CTX_wm_window(C);
- ToolSettings *ts= CTX_data_tool_settings(C);
- ScrArea *sa= CTX_wm_area(C);
- View3D *v3d= sa->spacedata.first;
+ wmWindow *win = CTX_wm_window(C);
+ ToolSettings *ts = CTX_data_tool_settings(C);
+ ScrArea *sa = CTX_wm_area(C);
+ View3D *v3d = sa->spacedata.first;
Object *obedit = CTX_data_edit_object(C);
- BMEditMesh *em= NULL;
- int ctrl= win->eventstate->ctrl, shift= win->eventstate->shift;
+ BMEditMesh *em = NULL;
+ int ctrl = win->eventstate->ctrl, shift = win->eventstate->shift;
PointerRNA props_ptr;
- if (obedit && obedit->type==OB_MESH) {
- em= ((Mesh *)obedit->data)->edit_btmesh;
+ if (obedit && obedit->type == OB_MESH) {
+ em = BMEdit_FromObject(obedit);
}
/* watch it: if sa->win does not exist, check that when calling direct drawing routines */
- switch(event) {
- case B_REDR:
- ED_area_tag_redraw(sa);
- break;
-
- case B_MODESELECT:
- WM_operator_properties_create(&props_ptr, "OBJECT_OT_mode_set");
- RNA_enum_set(&props_ptr, "mode", v3d->modeselect);
- WM_operator_name_call(C, "OBJECT_OT_mode_set", WM_OP_EXEC_REGION_WIN, &props_ptr);
- WM_operator_properties_free(&props_ptr);
- break;
-
- case B_SEL_VERT:
- if (em) {
- if (shift==0 || em->selectmode==0)
- em->selectmode= SCE_SELECT_VERTEX;
- ts->selectmode= em->selectmode;
- EDBM_selectmode_set(em);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
- ED_undo_push(C, "Selectmode Set: Vertex");
- }
- break;
- case B_SEL_EDGE:
- if (em) {
- if (shift==0 || em->selectmode==0) {
- if ( (em->selectmode ^ SCE_SELECT_EDGE) == SCE_SELECT_VERTEX) {
- if (ctrl) EDBM_convertsel(em, SCE_SELECT_VERTEX,SCE_SELECT_EDGE);
+ switch (event) {
+ case B_REDR:
+ ED_area_tag_redraw(sa);
+ break;
+
+ case B_MODESELECT:
+ WM_operator_properties_create(&props_ptr, "OBJECT_OT_mode_set");
+ RNA_enum_set(&props_ptr, "mode", v3d->modeselect);
+ WM_operator_name_call(C, "OBJECT_OT_mode_set", WM_OP_EXEC_REGION_WIN, &props_ptr);
+ WM_operator_properties_free(&props_ptr);
+ break;
+
+ case B_SEL_VERT:
+ if (em) {
+ if (shift == 0 || em->selectmode == 0)
+ em->selectmode = SCE_SELECT_VERTEX;
+ ts->selectmode = em->selectmode;
+ EDBM_selectmode_set(em);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
+ ED_undo_push(C, "Selectmode Set: Vertex");
+ }
+ break;
+ case B_SEL_EDGE:
+ if (em) {
+ if (shift == 0 || em->selectmode == 0) {
+ if ( (em->selectmode ^ SCE_SELECT_EDGE) == SCE_SELECT_VERTEX) {
+ if (ctrl) EDBM_selectmode_convert(em, SCE_SELECT_VERTEX, SCE_SELECT_EDGE);
+ }
+ em->selectmode = SCE_SELECT_EDGE;
}
- em->selectmode = SCE_SELECT_EDGE;
+ ts->selectmode = em->selectmode;
+ EDBM_selectmode_set(em);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
+ ED_undo_push(C, "Selectmode Set: Edge");
}
- ts->selectmode= em->selectmode;
- EDBM_selectmode_set(em);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
- ED_undo_push(C, "Selectmode Set: Edge");
- }
- break;
- case B_SEL_FACE:
- if (em) {
- if ( shift==0 || em->selectmode==0) {
- if ( ((ts->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_VERTEX) || ((ts->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_EDGE)) {
- if (ctrl) EDBM_convertsel(em, (ts->selectmode ^ SCE_SELECT_FACE),SCE_SELECT_FACE);
+ break;
+ case B_SEL_FACE:
+ if (em) {
+ if (shift == 0 || em->selectmode == 0) {
+ if ( ((ts->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_VERTEX) || ((ts->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_EDGE)) {
+ if (ctrl) EDBM_selectmode_convert(em, (ts->selectmode ^ SCE_SELECT_FACE), SCE_SELECT_FACE);
+ }
+ em->selectmode = SCE_SELECT_FACE;
}
- em->selectmode = SCE_SELECT_FACE;
+ ts->selectmode = em->selectmode;
+ EDBM_selectmode_set(em);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
+ ED_undo_push(C, "Selectmode Set: Face");
}
- ts->selectmode= em->selectmode;
- EDBM_selectmode_set(em);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
- ED_undo_push(C, "Selectmode Set: Face");
- }
- break;
+ break;
- case B_MAN_TRANS:
- if ( shift==0 || v3d->twtype==0) {
- v3d->twtype= V3D_MANIP_TRANSLATE;
- }
- ED_area_tag_redraw(sa);
- break;
- case B_MAN_ROT:
- if ( shift==0 || v3d->twtype==0) {
- v3d->twtype= V3D_MANIP_ROTATE;
- }
- ED_area_tag_redraw(sa);
- break;
- case B_MAN_SCALE:
- if ( shift==0 || v3d->twtype==0) {
- v3d->twtype= V3D_MANIP_SCALE;
- }
- ED_area_tag_redraw(sa);
- break;
- case B_NDOF:
- ED_area_tag_redraw(sa);
- break;
- case B_MAN_MODE:
- ED_area_tag_redraw(sa);
- break;
- default:
- break;
+ case B_MAN_TRANS:
+ if (shift == 0 || v3d->twtype == 0) {
+ v3d->twtype = V3D_MANIP_TRANSLATE;
+ }
+ ED_area_tag_redraw(sa);
+ break;
+ case B_MAN_ROT:
+ if (shift == 0 || v3d->twtype == 0) {
+ v3d->twtype = V3D_MANIP_ROTATE;
+ }
+ ED_area_tag_redraw(sa);
+ break;
+ case B_MAN_SCALE:
+ if (shift == 0 || v3d->twtype == 0) {
+ v3d->twtype = V3D_MANIP_SCALE;
+ }
+ ED_area_tag_redraw(sa);
+ break;
+ case B_NDOF:
+ ED_area_tag_redraw(sa);
+ break;
+ case B_MAN_MODE:
+ ED_area_tag_redraw(sa);
+ break;
+ default:
+ break;
}
}
@@ -444,43 +445,43 @@ static int object_mode_icon(int mode)
void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
- uiBlock *block= uiLayoutGetBlock(layout);
+ uiBlock *block = uiLayoutGetBlock(layout);
uiBlockSetHandleFunc(block, do_view3d_header_buttons, NULL);
if (obedit && (obedit->type == OB_MESH)) {
- BMEditMesh *em= ((Mesh *)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
uiLayout *row;
- row= uiLayoutRow(layout, 1);
- block= uiLayoutGetBlock(row);
- uiDefIconButBitS(block, TOG, SCE_SELECT_VERTEX, B_SEL_VERT, ICON_VERTEXSEL, 0,0,UI_UNIT_X,UI_UNIT_Y, &em->selectmode, 1.0, 0.0, 0, 0, "Vertex select mode");
- uiDefIconButBitS(block, TOG, SCE_SELECT_EDGE, B_SEL_EDGE, ICON_EDGESEL, 0,0,UI_UNIT_X,UI_UNIT_Y, &em->selectmode, 1.0, 0.0, 0, 0, "Edge select mode");
- uiDefIconButBitS(block, TOG, SCE_SELECT_FACE, B_SEL_FACE, ICON_FACESEL, 0,0,UI_UNIT_X,UI_UNIT_Y, &em->selectmode, 1.0, 0.0, 0, 0, "Face select mode");
+ row = uiLayoutRow(layout, 1);
+ block = uiLayoutGetBlock(row);
+ uiDefIconButBitS(block, TOG, SCE_SELECT_VERTEX, B_SEL_VERT, ICON_VERTEXSEL, 0, 0, UI_UNIT_X, UI_UNIT_Y, &em->selectmode, 1.0, 0.0, 0, 0, "Vertex select - Shift-Click for multiple modes");
+ uiDefIconButBitS(block, TOG, SCE_SELECT_EDGE, B_SEL_EDGE, ICON_EDGESEL, 0, 0, UI_UNIT_X, UI_UNIT_Y, &em->selectmode, 1.0, 0.0, 0, 0, "Edge select - Shift-Click for multiple modes");
+ uiDefIconButBitS(block, TOG, SCE_SELECT_FACE, B_SEL_FACE, ICON_FACESEL, 0, 0, UI_UNIT_X, UI_UNIT_Y, &em->selectmode, 1.0, 0.0, 0, 0, "Face select - Shift-Click for multiple modes");
}
}
void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
{
- bScreen *screen= CTX_wm_screen(C);
- ScrArea *sa= CTX_wm_area(C);
- View3D *v3d= sa->spacedata.first;
- Scene *scene= CTX_data_scene(C);
- ToolSettings *ts= CTX_data_tool_settings(C);
+ bScreen *screen = CTX_wm_screen(C);
+ ScrArea *sa = CTX_wm_area(C);
+ View3D *v3d = sa->spacedata.first;
+ Scene *scene = CTX_data_scene(C);
+ ToolSettings *ts = CTX_data_tool_settings(C);
PointerRNA v3dptr, toolsptr, sceneptr;
- Object *ob= OBACT;
+ Object *ob = OBACT;
Object *obedit = CTX_data_edit_object(C);
uiBlock *block;
uiBut *but;
uiLayout *row;
- const float dpi_fac= UI_DPI_FAC;
+ const float dpi_fac = UI_DPI_FAC;
int is_paint = 0;
RNA_pointer_create(&screen->id, &RNA_SpaceView3D, v3d, &v3dptr);
RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &toolsptr);
RNA_pointer_create(&scene->id, &RNA_Scene, scene, &sceneptr);
- block= uiLayoutGetBlock(layout);
+ block = uiLayoutGetBlock(layout);
uiBlockSetHandleFunc(block, do_view3d_header_buttons, NULL);
/* other buttons: */
@@ -489,31 +490,31 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
/* mode */
if (ob) {
v3d->modeselect = ob->mode;
- is_paint = ELEM4(ob->mode, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT,OB_MODE_TEXTURE_PAINT);
+ is_paint = ELEM4(ob->mode, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, OB_MODE_TEXTURE_PAINT);
}
else {
v3d->modeselect = OB_MODE_OBJECT;
}
- row= uiLayoutRow(layout, 1);
- uiDefIconTextButS(block, MENU, B_MODESELECT, object_mode_icon(v3d->modeselect), view3d_modeselect_pup(scene) ,
- 0,0,126 * dpi_fac, UI_UNIT_Y, &(v3d->modeselect), 0, 0, 0, 0, TIP_("Mode"));
+ row = uiLayoutRow(layout, 1);
+ uiDefIconTextButS(block, MENU, B_MODESELECT, object_mode_icon(v3d->modeselect), view3d_modeselect_pup(scene),
+ 0, 0, 126 * dpi_fac, UI_UNIT_Y, &(v3d->modeselect), 0, 0, 0, 0, TIP_("Mode"));
/* Draw type */
uiItemR(layout, &v3dptr, "viewport_shade", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
- if (obedit==NULL && is_paint) {
+ if (obedit == NULL && is_paint) {
/* Manipulators aren't used in paint modes */
if (!ELEM(ob->mode, OB_MODE_SCULPT, OB_MODE_PARTICLE_EDIT)) {
/* masks aren't used for sculpt and particle painting */
PointerRNA meshptr;
RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr);
- if (ob->mode & (OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT)) {
+ if (ob->mode & (OB_MODE_TEXTURE_PAINT | OB_MODE_VERTEX_PAINT)) {
uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
}
else {
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
uiItemR(row, &meshptr, "use_paint_mask_vertex", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
}
@@ -522,26 +523,26 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
else {
const char *str_menu;
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, &v3dptr, "pivot_point", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
/* pose/object only however we want to allow in weight paint mode too
- * so dont be totally strict and just check not-editmode for now */
+ * so don't be totally strict and just check not-editmode for now */
if (obedit == NULL) {
uiItemR(row, &v3dptr, "use_pivot_point_align", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
}
/* Transform widget / manipulators */
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, &v3dptr, "show_manipulator", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
- block= uiLayoutGetBlock(row);
+ block = uiLayoutGetBlock(row);
if (v3d->twflag & V3D_USE_MANIPULATOR) {
- but= uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Translate manipulator mode"));
+ but = uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0, 0, UI_UNIT_X, UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Translate manipulator - Shift-Click for multiple modes"));
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
- but= uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Rotate manipulator mode"));
+ but = uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0, 0, UI_UNIT_X, UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Rotate manipulator - Shift-Click for multiple modes"));
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
- but= uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Scale manipulator mode"));
+ but = uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0, 0, UI_UNIT_X, UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Scale manipulator - Shift-Click for multiple modes"));
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
}
@@ -550,12 +551,12 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
}
str_menu = BIF_menustringTransformOrientation(C, "Orientation");
- but= uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, UI_UNIT_Y, &v3d->twmode, 0, 0, 0, 0, TIP_("Transform Orientation"));
+ but = uiDefButC(block, MENU, B_MAN_MODE, str_menu, 0, 0, 70 * dpi_fac, UI_UNIT_Y, &v3d->twmode, 0, 0, 0, 0, TIP_("Transform Orientation"));
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
MEM_freeN((void *)str_menu);
}
- if (obedit==NULL && v3d->localvd==NULL) {
+ if (obedit == NULL && v3d->localvd == NULL) {
unsigned int ob_lay = ob ? ob->lay : 0;
/* Layers */
diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h
index 4cf0c9d0c9b..168775deae2 100644
--- a/source/blender/editors/space_view3d/view3d_intern.h
+++ b/source/blender/editors/space_view3d/view3d_intern.h
@@ -199,7 +199,7 @@ extern const char *view3d_context_dir[]; /* doc access */
/* draw_volume.c */
void draw_volume(struct ARegion *ar, struct GPUTexture *tex, float *min, float *max, int res[3], float dx, struct GPUTexture *tex_shadow);
-/* workaround for trivial but noticable camera bug caused by imprecision
+/* workaround for trivial but noticeable camera bug caused by imprecision
* between view border calculation in 2D/3D space, workaround for bug [#28037].
* without this deifne we get the old behavior which is to try and align them
* both which _mostly_ works fine, but when the camera moves beyond ~1000 in
diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c
index 759f3edf20f..99da487f923 100644
--- a/source/blender/editors/space_view3d/view3d_ops.c
+++ b/source/blender/editors/space_view3d/view3d_ops.c
@@ -112,13 +112,13 @@ void view3d_keymap(wmKeyConfig *keyconf)
wmKeyMap *keymap;
wmKeyMapItem *kmi;
- keymap= WM_keymap_find(keyconf, "3D View Generic", SPACE_VIEW3D, 0);
+ keymap = WM_keymap_find(keyconf, "3D View Generic", SPACE_VIEW3D, 0);
WM_keymap_add_item(keymap, "VIEW3D_OT_properties", NKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "VIEW3D_OT_toolshelf", TKEY, KM_PRESS, 0, 0);
/* only for region 3D window */
- keymap= WM_keymap_find(keyconf, "3D View", SPACE_VIEW3D, 0);
+ keymap = WM_keymap_find(keyconf, "3D View", SPACE_VIEW3D, 0);
kmi = WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, KM_ANY, 0);
RNA_boolean_set(kmi->ptr, "release_confirm", TRUE);
@@ -132,7 +132,7 @@ void view3d_keymap(wmKeyConfig *keyconf)
WM_keymap_verify_item(keymap, "VIEW3D_OT_rotate", MIDDLEMOUSE, KM_PRESS, 0, 0);
WM_keymap_verify_item(keymap, "VIEW3D_OT_move", MIDDLEMOUSE, KM_PRESS, KM_SHIFT, 0);
WM_keymap_verify_item(keymap, "VIEW3D_OT_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0);
- WM_keymap_verify_item(keymap, "VIEW3D_OT_dolly", MIDDLEMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
+ WM_keymap_verify_item(keymap, "VIEW3D_OT_dolly", MIDDLEMOUSE, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
WM_keymap_verify_item(keymap, "VIEW3D_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0);
WM_keymap_verify_item(keymap, "VIEW3D_OT_view_center_cursor", PADPERIOD, KM_PRESS, KM_CTRL, 0);
@@ -190,28 +190,28 @@ void view3d_keymap(wmKeyConfig *keyconf)
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_pan", WHEELUPMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "type", V3D_VIEW_PANUP);
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_pan", WHEELDOWNMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "type", V3D_VIEW_PANDOWN);
- RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", WHEELUPMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0)->ptr, "type", V3D_VIEW_STEPLEFT);
- RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0)->ptr, "type", V3D_VIEW_STEPRIGHT);
- RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", WHEELUPMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0)->ptr, "type", V3D_VIEW_STEPUP);
- RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", WHEELDOWNMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0)->ptr, "type", V3D_VIEW_STEPDOWN);
+ RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", WHEELUPMOUSE, KM_PRESS, KM_CTRL | KM_ALT, 0)->ptr, "type", V3D_VIEW_STEPLEFT);
+ RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL | KM_ALT, 0)->ptr, "type", V3D_VIEW_STEPRIGHT);
+ RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", WHEELUPMOUSE, KM_PRESS, KM_SHIFT | KM_ALT, 0)->ptr, "type", V3D_VIEW_STEPUP);
+ RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", WHEELDOWNMOUSE, KM_PRESS, KM_SHIFT | KM_ALT, 0)->ptr, "type", V3D_VIEW_STEPDOWN);
/* active aligned, replaces '*' key in 2.4x */
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_FRONT);
RNA_boolean_set(kmi->ptr, "align_active", TRUE);
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_RIGHT);
RNA_boolean_set(kmi->ptr, "align_active", TRUE);
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_TOP);
RNA_boolean_set(kmi->ptr, "align_active", TRUE);
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_BACK);
RNA_boolean_set(kmi->ptr, "align_active", TRUE);
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_LEFT);
RNA_boolean_set(kmi->ptr, "align_active", TRUE);
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_BOTTOM);
RNA_boolean_set(kmi->ptr, "align_active", TRUE);
@@ -227,13 +227,13 @@ void view3d_keymap(wmKeyConfig *keyconf)
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", NDOF_BUTTON_BOTTOM, KM_PRESS, 0, 0)->ptr, "type", RV3D_VIEW_BOTTOM);
/* 3D mouse align */
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", NDOF_BUTTON_FRONT, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", NDOF_BUTTON_FRONT, KM_PRESS, KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_FRONT);
RNA_boolean_set(kmi->ptr, "align_active", TRUE);
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", NDOF_BUTTON_RIGHT, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", NDOF_BUTTON_RIGHT, KM_PRESS, KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_RIGHT);
RNA_boolean_set(kmi->ptr, "align_active", TRUE);
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", NDOF_BUTTON_TOP, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", NDOF_BUTTON_TOP, KM_PRESS, KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_TOP);
RNA_boolean_set(kmi->ptr, "align_active", TRUE);
@@ -275,34 +275,34 @@ void view3d_keymap(wmKeyConfig *keyconf)
RNA_boolean_set(kmi->ptr, "center", FALSE);
RNA_boolean_set(kmi->ptr, "object", FALSE);
RNA_boolean_set(kmi->ptr, "enumerate", FALSE);
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_boolean_set(kmi->ptr, "center", TRUE);
RNA_boolean_set(kmi->ptr, "object", TRUE); /* use Ctrl+Select for 2 purposes */
RNA_boolean_set(kmi->ptr, "enumerate", FALSE);
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_boolean_set(kmi->ptr, "center", FALSE);
RNA_boolean_set(kmi->ptr, "object", FALSE);
RNA_boolean_set(kmi->ptr, "enumerate", TRUE);
/* selection key-combinations */
- kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_boolean_set(kmi->ptr, "center", TRUE);
RNA_boolean_set(kmi->ptr, "object", FALSE);
RNA_boolean_set(kmi->ptr, "enumerate", FALSE);
- kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL | KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "extend", FALSE);
RNA_boolean_set(kmi->ptr, "center", TRUE);
RNA_boolean_set(kmi->ptr, "object", FALSE);
RNA_boolean_set(kmi->ptr, "enumerate", TRUE);
- kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT | KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_boolean_set(kmi->ptr, "center", FALSE);
RNA_boolean_set(kmi->ptr, "object", FALSE);
RNA_boolean_set(kmi->ptr, "enumerate", TRUE);
- kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL|KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT | KM_CTRL | KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
RNA_boolean_set(kmi->ptr, "center", TRUE);
RNA_boolean_set(kmi->ptr, "object", FALSE);
@@ -311,7 +311,7 @@ void view3d_keymap(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "VIEW3D_OT_select_border", BKEY, KM_PRESS, 0, 0);
kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "deselect", FALSE);
- kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT|KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT | KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "deselect", TRUE);
WM_keymap_add_item(keymap, "VIEW3D_OT_select_circle", CKEY, KM_PRESS, 0, 0);
@@ -319,7 +319,7 @@ void view3d_keymap(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "VIEW3D_OT_zoom_border", BKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap, "VIEW3D_OT_render_border", BKEY, KM_PRESS, KM_SHIFT, 0);
- WM_keymap_add_item(keymap, "VIEW3D_OT_camera_to_view", PAD0, KM_PRESS, KM_ALT|KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "VIEW3D_OT_camera_to_view", PAD0, KM_PRESS, KM_ALT | KM_CTRL, 0);
WM_keymap_add_item(keymap, "VIEW3D_OT_object_as_camera", PAD0, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_menu(keymap, "VIEW3D_MT_snap", SKEY, KM_PRESS, KM_SHIFT, 0);
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index dfd8b4a3568..5646570a623 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -88,18 +88,18 @@
#include "UI_interface.h"
#include "UI_resources.h"
-#include "view3d_intern.h" // own include
+#include "view3d_intern.h" // own include
// TODO: should return whether there is valid context to continue
void view3d_set_viewcontext(bContext *C, ViewContext *vc)
{
memset(vc, 0, sizeof(ViewContext));
- vc->ar= CTX_wm_region(C);
- vc->scene= CTX_data_scene(C);
- vc->v3d= CTX_wm_view3d(C);
- vc->rv3d= CTX_wm_region_view3d(C);
- vc->obact= CTX_data_active_object(C);
- vc->obedit= CTX_data_edit_object(C);
+ vc->ar = CTX_wm_region(C);
+ vc->scene = CTX_data_scene(C);
+ vc->v3d = CTX_wm_view3d(C);
+ vc->rv3d = CTX_wm_region_view3d(C);
+ vc->obact = CTX_data_active_object(C);
+ vc->obedit = CTX_data_edit_object(C);
}
int view3d_get_view_aligned_coordinate(ViewContext *vc, float fp[3], const int mval[2], const short do_fallback)
@@ -107,14 +107,14 @@ int view3d_get_view_aligned_coordinate(ViewContext *vc, float fp[3], const int m
float dvec[3];
int mval_cpy[2];
- mval_cpy[0]= mval[0];
- mval_cpy[1]= mval[1];
+ mval_cpy[0] = mval[0];
+ mval_cpy[1] = mval[1];
project_int_noclip(vc->ar, fp, mval_cpy);
initgrabz(vc->rv3d, fp[0], fp[1], fp[2]);
- if (mval_cpy[0]!=IS_CLIPPED) {
+ if (mval_cpy[0] != IS_CLIPPED) {
float mval_f[2];
VECSUB2D(mval_f, mval_cpy, mval);
ED_view3d_win_to_delta(vc->ar, mval_f, dvec);
@@ -151,8 +151,8 @@ void view3d_get_transformation(const ARegion *ar, RegionView3D *rv3d, Object *ob
for (i = 0; i < 4; ++i) {
for (j = 0; j < 4; ++j) {
- mats->projection[i*4+j] = rv3d->winmat[i][j];
- mats->modelview[i*4+j] = cpy[i][j];
+ mats->projection[i * 4 + j] = rv3d->winmat[i][j];
+ mats->modelview[i * 4 + j] = cpy[i][j];
}
}
@@ -166,48 +166,48 @@ void view3d_get_transformation(const ARegion *ar, RegionView3D *rv3d, Object *ob
/* local prototypes */
-static void EDBM_backbuf_checkAndSelectVerts(BMEditMesh *em, int select)
+static void edbm_backbuf_check_and_select_verts(BMEditMesh *em, int select)
{
BMVert *eve;
BMIter iter;
- int index= bm_wireoffs;
+ int index = bm_wireoffs;
eve = BM_iter_new(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
- for ( ; eve; eve=BM_iter_step(&iter), index++) {
+ for (; eve; eve = BM_iter_step(&iter), index++) {
if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
- if (EDBM_check_backbuf(index)) {
+ if (EDBM_backbuf_check(index)) {
BM_vert_select_set(em->bm, eve, select);
}
}
}
}
-static void EDBM_backbuf_checkAndSelectEdges(BMEditMesh *em, int select)
+static void edbm_backbuf_check_and_select_edges(BMEditMesh *em, int select)
{
BMEdge *eed;
BMIter iter;
- int index= bm_solidoffs;
+ int index = bm_solidoffs;
eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
- for ( ; eed; eed=BM_iter_step(&iter), index++) {
+ for (; eed; eed = BM_iter_step(&iter), index++) {
if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
- if (EDBM_check_backbuf(index)) {
+ if (EDBM_backbuf_check(index)) {
BM_edge_select_set(em->bm, eed, select);
}
}
}
}
-static void EDBM_backbuf_checkAndSelectFaces(BMEditMesh *em, int select)
+static void edbm_backbuf_check_and_select_faces(BMEditMesh *em, int select)
{
BMFace *efa;
BMIter iter;
- int index= 1;
+ int index = 1;
efa = BM_iter_new(&iter, em->bm, BM_FACES_OF_MESH, NULL);
- for ( ; efa; efa=BM_iter_step(&iter), index++) {
+ for (; efa; efa = BM_iter_step(&iter), index++) {
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
- if (EDBM_check_backbuf(index)) {
+ if (EDBM_backbuf_check(index)) {
BM_face_select_set(em->bm, efa, select);
}
}
@@ -216,16 +216,16 @@ static void EDBM_backbuf_checkAndSelectFaces(BMEditMesh *em, int select)
/* object mode, EM_ prefix is confusing here, rename? */
-static void EDBM_backbuf_checkAndSelectVerts_obmode(Mesh *me, int select)
+static void edbm_backbuf_check_and_select_verts_obmode(Mesh *me, int select)
{
MVert *mv = me->mvert;
int a;
if (mv) {
- for (a=1; a<=me->totvert; a++, mv++) {
- if (EDBM_check_backbuf(a)) {
+ for (a = 1; a <= me->totvert; a++, mv++) {
+ if (EDBM_backbuf_check(a)) {
if (!(mv->flag & ME_HIDE)) {
- mv->flag = select?(mv->flag|SELECT):(mv->flag&~SELECT);
+ mv->flag = select ? (mv->flag | SELECT) : (mv->flag & ~SELECT);
}
}
}
@@ -233,15 +233,15 @@ static void EDBM_backbuf_checkAndSelectVerts_obmode(Mesh *me, int select)
}
/* object mode, EM_ prefix is confusing here, rename? */
-static void EDBM_backbuf_checkAndSelectTFaces(Mesh *me, int select)
+static void edbm_backbuf_check_and_select_tfaces(Mesh *me, int select)
{
MPoly *mpoly = me->mpoly;
int a;
if (mpoly) {
- for (a=1; a<=me->totpoly; a++, mpoly++) {
- if (EDBM_check_backbuf(a)) {
- mpoly->flag = select?(mpoly->flag|ME_FACE_SEL):(mpoly->flag&~ME_FACE_SEL);
+ for (a = 1; a <= me->totpoly; a++, mpoly++) {
+ if (EDBM_backbuf_check(a)) {
+ mpoly->flag = select ? (mpoly->flag | ME_FACE_SEL) : (mpoly->flag & ~ME_FACE_SEL);
}
}
}
@@ -272,7 +272,7 @@ static int view3d_selectable_data(bContext *C)
if (ob->mode & OB_MODE_SCULPT) {
return 0;
}
- if ((ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)) &&
+ if ((ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT)) &&
!paint_facesel_test(ob) && !paint_vertsel_test(ob))
{
return 0;
@@ -298,19 +298,19 @@ static int edge_inside_rect(rcti *rect, short x1, short y1, short x2, short y2)
if (edge_fully_inside_rect(rect, x1, y1, x2, y2)) return 1;
/* check points completely out rect */
- if (x1<rect->xmin && x2<rect->xmin) return 0;
- if (x1>rect->xmax && x2>rect->xmax) return 0;
- if (y1<rect->ymin && y2<rect->ymin) return 0;
- if (y1>rect->ymax && y2>rect->ymax) return 0;
+ if (x1 < rect->xmin && x2 < rect->xmin) return 0;
+ if (x1 > rect->xmax && x2 > rect->xmax) return 0;
+ if (y1 < rect->ymin && y2 < rect->ymin) return 0;
+ if (y1 > rect->ymax && y2 > rect->ymax) return 0;
/* simple check lines intersecting. */
- d1= (y1-y2)*(x1- rect->xmin ) + (x2-x1)*(y1- rect->ymin );
- d2= (y1-y2)*(x1- rect->xmin ) + (x2-x1)*(y1- rect->ymax );
- d3= (y1-y2)*(x1- rect->xmax ) + (x2-x1)*(y1- rect->ymax );
- d4= (y1-y2)*(x1- rect->xmax ) + (x2-x1)*(y1- rect->ymin );
+ d1 = (y1 - y2) * (x1 - rect->xmin) + (x2 - x1) * (y1 - rect->ymin);
+ d2 = (y1 - y2) * (x1 - rect->xmin) + (x2 - x1) * (y1 - rect->ymax);
+ d3 = (y1 - y2) * (x1 - rect->xmax) + (x2 - x1) * (y1 - rect->ymax);
+ d4 = (y1 - y2) * (x1 - rect->xmax) + (x2 - x1) * (y1 - rect->ymin);
- if (d1<0 && d2<0 && d3<0 && d4<0) return 0;
- if (d1>0 && d2>0 && d3>0 && d4>0) return 0;
+ if (d1 < 0 && d2 < 0 && d3 < 0 && d4 < 0) return 0;
+ if (d1 > 0 && d2 > 0 && d3 > 0 && d4 > 0) return 0;
return 1;
}
@@ -322,47 +322,47 @@ static int edge_inside_rect(rcti *rect, short x1, short y1, short x2, short y2)
int lasso_inside(int mcords[][2], short moves, int sx, int sy)
{
/* we do the angle rule, define that all added angles should be about zero or 2*PI */
- float angletot=0.0, len, dot, ang, cross, fp1[2], fp2[2];
+ float angletot = 0.0, len, dot, ang, cross, fp1[2], fp2[2];
int a;
int *p1, *p2;
- if (sx==IS_CLIPPED)
+ if (sx == IS_CLIPPED)
return 0;
- p1= mcords[moves-1];
- p2= mcords[0];
+ p1 = mcords[moves - 1];
+ p2 = mcords[0];
/* first vector */
- fp1[0]= (float)(p1[0]-sx);
- fp1[1]= (float)(p1[1]-sy);
- len= sqrt(fp1[0]*fp1[0] + fp1[1]*fp1[1]);
- fp1[0]/= len;
- fp1[1]/= len;
+ fp1[0] = (float)(p1[0] - sx);
+ fp1[1] = (float)(p1[1] - sy);
+ len = sqrt(fp1[0] * fp1[0] + fp1[1] * fp1[1]);
+ fp1[0] /= len;
+ fp1[1] /= len;
- for (a=0; a<moves; a++) {
+ for (a = 0; a < moves; a++) {
/* second vector */
- fp2[0]= (float)(p2[0]-sx);
- fp2[1]= (float)(p2[1]-sy);
- len= sqrt(fp2[0]*fp2[0] + fp2[1]*fp2[1]);
- fp2[0]/= len;
- fp2[1]/= len;
+ fp2[0] = (float)(p2[0] - sx);
+ fp2[1] = (float)(p2[1] - sy);
+ len = sqrt(fp2[0] * fp2[0] + fp2[1] * fp2[1]);
+ fp2[0] /= len;
+ fp2[1] /= len;
/* dot and angle and cross */
- dot= fp1[0]*fp2[0] + fp1[1]*fp2[1];
- ang= fabs(saacos(dot));
+ dot = fp1[0] * fp2[0] + fp1[1] * fp2[1];
+ ang = fabs(saacos(dot));
- cross= (float)((p1[1]-p2[1])*(p1[0]-sx) + (p2[0]-p1[0])*(p1[1]-sy));
+ cross = (float)((p1[1] - p2[1]) * (p1[0] - sx) + (p2[0] - p1[0]) * (p1[1] - sy));
- if (cross<0.0f) angletot-= ang;
- else angletot+= ang;
+ if (cross < 0.0f) angletot -= ang;
+ else angletot += ang;
/* circulate */
- fp1[0]= fp2[0]; fp1[1]= fp2[1];
- p1= p2;
- p2= mcords[a+1];
+ fp1[0] = fp2[0]; fp1[1] = fp2[1];
+ p1 = p2;
+ p2 = mcords[a + 1];
}
- if ( fabs(angletot) > 4.0 ) return 1;
+ if (fabs(angletot) > 4.0) return 1;
return 0;
}
@@ -372,7 +372,7 @@ int lasso_inside_edge(int mcords[][2], short moves, int x0, int y0, int x1, int
int v1[2], v2[2];
int a;
- if (x0==IS_CLIPPED || x1==IS_CLIPPED)
+ if (x0 == IS_CLIPPED || x1 == IS_CLIPPED)
return 0;
v1[0] = x0, v1[1] = y0;
@@ -384,9 +384,9 @@ int lasso_inside_edge(int mcords[][2], short moves, int x0, int y0, int x1, int
/* no points in lasso, so we have to intersect with lasso edge */
- if ( isect_line_line_v2_int(mcords[0], mcords[moves-1], v1, v2) > 0) return 1;
- for (a=0; a<moves-1; a++) {
- if ( isect_line_line_v2_int(mcords[a], mcords[a+1], v1, v2) > 0) return 1;
+ if (isect_line_line_v2_int(mcords[0], mcords[moves - 1], v1, v2) > 0) return 1;
+ for (a = 0; a < moves - 1; a++) {
+ if (isect_line_line_v2_int(mcords[a], mcords[a + 1], v1, v2) > 0) return 1;
}
return 0;
@@ -394,19 +394,19 @@ 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;
float vec[3];
int sco1[2], sco2[2];
- bArmature *arm= ob->data;
+ bArmature *arm = ob->data;
- if (ob->type!=OB_ARMATURE || ob->pose==NULL) return;
+ if (ob->type != OB_ARMATURE || ob->pose == NULL) return;
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if (PBONE_VISIBLE(arm, pchan->bone) && (pchan->bone->flag & BONE_UNSELECTABLE)==0) {
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ if (PBONE_VISIBLE(arm, pchan->bone) && (pchan->bone->flag & BONE_UNSELECTABLE) == 0) {
mul_v3_m4v3(vec, ob->obmat, pchan->pose_head);
project_int(vc->ar, vec, sco1);
mul_v3_m4v3(vec, ob->obmat, pchan->pose_tail);
@@ -424,7 +424,7 @@ static void object_deselect_all_visible(Scene *scene, View3D *v3d)
{
Base *base;
- for (base= scene->base.first; base; base= base->next) {
+ for (base = scene->base.first; base; base = base->next) {
if (BASE_SELECTABLE(v3d, base)) {
ED_base_object_select(base, BA_DESELECT);
}
@@ -438,14 +438,14 @@ static void do_lasso_select_objects(ViewContext *vc, int mcords[][2], short move
if (extend == 0 && select)
object_deselect_all_visible(vc->scene, vc->v3d);
- for (base= vc->scene->base.first; base; base= base->next) {
+ for (base = vc->scene->base.first; base; base = base->next) {
if (BASE_SELECTABLE(vc->v3d, base)) { /* use this to avoid un-needed lasso lookups */
project_short(vc->ar, base->object->obmat[3], &base->sx);
if (lasso_inside(mcords, moves, base->sx, base->sy)) {
if (select) ED_base_object_select(base, BA_SELECT);
else ED_base_object_select(base, BA_DESELECT);
- base->object->flag= base->flag;
+ base->object->flag = base->flag;
}
if (base->object->mode & OB_MODE_POSE) {
do_lasso_select_pose(vc, base->object, mcords, moves, select);
@@ -458,14 +458,14 @@ static void lasso_select_boundbox(rcti *rect, int mcords[][2], short moves)
{
short a;
- rect->xmin= rect->xmax= mcords[0][0];
- rect->ymin= rect->ymax= mcords[0][1];
+ rect->xmin = rect->xmax = mcords[0][0];
+ rect->ymin = rect->ymax = mcords[0][1];
- for (a=1; a<moves; a++) {
- if (mcords[a][0]<rect->xmin) rect->xmin= mcords[a][0];
- else if (mcords[a][0]>rect->xmax) rect->xmax= mcords[a][0];
- if (mcords[a][1]<rect->ymin) rect->ymin= mcords[a][1];
- else if (mcords[a][1]>rect->ymax) rect->ymax= mcords[a][1];
+ for (a = 1; a < moves; a++) {
+ if (mcords[a][0] < rect->xmin) rect->xmin = mcords[a][0];
+ else if (mcords[a][0] > rect->xmax) rect->xmax = mcords[a][0];
+ if (mcords[a][1] < rect->ymin) rect->ymin = mcords[a][1];
+ else if (mcords[a][1] > rect->ymax) rect->ymax = mcords[a][1];
}
}
@@ -481,11 +481,11 @@ static void do_lasso_select_mesh__doSelectEdge(void *userData, BMEdge *eed, int
{
LassoSelectUserData *data = userData;
- if (EDBM_check_backbuf(bm_solidoffs+index)) {
- if (data->pass==0) {
- if ( edge_fully_inside_rect(data->rect, x0, y0, x1, y1) &&
- lasso_inside(data->mcords, data->moves, x0, y0) &&
- lasso_inside(data->mcords, data->moves, x1, y1)) {
+ if (EDBM_backbuf_check(bm_solidoffs + index)) {
+ if (data->pass == 0) {
+ if (edge_fully_inside_rect(data->rect, x0, y0, x1, y1) &&
+ lasso_inside(data->mcords, data->moves, x0, y0) &&
+ lasso_inside(data->mcords, data->moves, x1, y1)) {
BM_elem_select_set(data->vc->em->bm, eed, data->select);
data->done = 1;
}
@@ -509,16 +509,16 @@ static void do_lasso_select_mesh__doSelectFace(void *userData, BMFace *efa, int
static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
{
LassoSelectUserData data;
- ToolSettings *ts= vc->scene->toolsettings;
+ ToolSettings *ts = vc->scene->toolsettings;
rcti rect;
int bbsel;
lasso_select_boundbox(&rect, mcords, moves);
/* set editmesh */
- vc->em= ((Mesh *)vc->obedit->data)->edit_btmesh;
+ vc->em = BMEdit_FromObject(vc->obedit);
- data.vc= vc;
+ data.vc = vc;
data.rect = &rect;
data.mcords = mcords;
data.moves = moves;
@@ -529,15 +529,15 @@ static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves,
if (extend == 0 && select)
EDBM_flag_disable_all(vc->em, BM_ELEM_SELECT);
- /* for non zbuf projections, dont change the GL state */
+ /* for non zbuf projections, don't change the GL state */
ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
glLoadMatrixf(vc->rv3d->viewmat);
- bbsel= EDBM_mask_init_backbuf_border(vc, mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
+ bbsel = EDBM_backbuf_border_mask_init(vc, mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
if (ts->selectmode & SCE_SELECT_VERTEX) {
if (bbsel) {
- EDBM_backbuf_checkAndSelectVerts(vc->em, select);
+ edbm_backbuf_check_and_select_verts(vc->em, select);
}
else {
mesh_foreachScreenVert(vc, do_lasso_select_mesh__doSelectVert, &data, V3D_CLIP_TEST_RV3D_CLIPPING);
@@ -548,7 +548,7 @@ static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves,
data.pass = 0;
mesh_foreachScreenEdge(vc, do_lasso_select_mesh__doSelectEdge, &data, V3D_CLIP_TEST_OFF);
- if (data.done==0) {
+ if (data.done == 0) {
data.pass = 1;
mesh_foreachScreenEdge(vc, do_lasso_select_mesh__doSelectEdge, &data, V3D_CLIP_TEST_OFF);
}
@@ -556,14 +556,14 @@ static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves,
if (ts->selectmode & SCE_SELECT_FACE) {
if (bbsel) {
- EDBM_backbuf_checkAndSelectFaces(vc->em, select);
+ edbm_backbuf_check_and_select_faces(vc->em, select);
}
else {
mesh_foreachScreenFace(vc, do_lasso_select_mesh__doSelectFace, &data);
}
}
- EDBM_free_backbuf();
+ EDBM_backbuf_free();
EDBM_selectmode_flush(vc->em);
}
@@ -582,7 +582,7 @@ static void do_lasso_select_mesh_uv(int mcords[][2], short moves, short select)
if (draw_uvs_face_check()) { /* Face Center Sel */
float cent[2];
ok = 0;
- for (efa= em->faces.first; efa; efa= efa->next) {
+ for (efa = em->faces.first; efa; efa = efa->next) {
/* assume not touched */
efa->tmp.l = 0;
tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
@@ -600,11 +600,11 @@ static void do_lasso_select_mesh_uv(int mcords[][2], short moves, short select)
}
else { /* Vert Sel*/
- for (efa= em->faces.first; efa; efa= efa->next) {
+ for (efa = em->faces.first; efa; efa = efa->next) {
tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
if (uvedit_face_visible(scene, ima, efa, tf)) {
- nverts= efa->v4? 4: 3;
- for (i=0; i<nverts; i++) {
+ nverts = efa->v4 ? 4 : 3;
+ for (i = 0; i < nverts; i++) {
if ((select) != (simaUVSel_Check(efa, tf, i))) {
uvco_to_areaco_noclip(tf->uv[i], screenUV);
if (BLI_in_rcti(&rect, screenUV[0], screenUV[1]) && lasso_inside(mcords, moves, screenUV[0], screenUV[1])) {
@@ -622,7 +622,7 @@ static void do_lasso_select_mesh_uv(int mcords[][2], short moves, short select)
}
if (ok && G.sima->flag & SI_SYNC_UVSEL) {
if (select) EM_select_flush(vc->em);
- else EM_deselect_flush(vc->em);
+ else EM_deselect_flush(vc->em);
}
}
#endif
@@ -630,28 +630,28 @@ static void do_lasso_select_mesh_uv(int mcords[][2], short moves, short select)
static void do_lasso_select_curve__doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
{
LassoSelectUserData *data = userData;
- Object *obedit= data->vc->obedit;
- Curve *cu= (Curve*)obedit->data;
+ Object *obedit = data->vc->obedit;
+ Curve *cu = (Curve *)obedit->data;
if (lasso_inside(data->mcords, data->moves, x, y)) {
if (bp) {
- bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
+ bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
if (bp == cu->lastsel && !(bp->f1 & 1)) cu->lastsel = NULL;
}
else {
if (cu->drawflag & CU_HIDE_HANDLES) {
/* can only be beztindex==0 here since handles are hidden */
- bezt->f1 = bezt->f2 = bezt->f3 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT);
+ bezt->f1 = bezt->f2 = bezt->f3 = data->select ? (bezt->f2 | SELECT) : (bezt->f2 & ~SELECT);
}
else {
- if (beztindex==0) {
- bezt->f1 = data->select?(bezt->f1|SELECT):(bezt->f1&~SELECT);
+ if (beztindex == 0) {
+ bezt->f1 = data->select ? (bezt->f1 | SELECT) : (bezt->f1 & ~SELECT);
}
- else if (beztindex==1) {
- bezt->f2 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT);
+ else if (beztindex == 1) {
+ bezt->f2 = data->select ? (bezt->f2 | SELECT) : (bezt->f2 & ~SELECT);
}
else {
- bezt->f3 = data->select?(bezt->f3|SELECT):(bezt->f3&~SELECT);
+ bezt->f3 = data->select ? (bezt->f3 | SELECT) : (bezt->f3 & ~SELECT);
}
}
@@ -682,7 +682,7 @@ static void do_lasso_select_lattice__doSelect(void *userData, BPoint *bp, int x,
LassoSelectUserData *data = userData;
if (lasso_inside(data->mcords, data->moves, x, y)) {
- bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
+ bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
}
}
static void do_lasso_select_lattice(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
@@ -703,42 +703,42 @@ static void do_lasso_select_lattice(ViewContext *vc, int mcords[][2], short move
static void do_lasso_select_armature(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
{
- bArmature *arm= vc->obedit->data;
+ bArmature *arm = vc->obedit->data;
EditBone *ebone;
float vec[3];
short sco1[2], sco2[2], didpoint;
- int change= FALSE;
+ int change = FALSE;
- if (extend==0 && select)
+ if (extend == 0 && select)
ED_armature_deselect_all_visible(vc->obedit);
/* set editdata in vc */
- for (ebone= arm->edbo->first; ebone; ebone=ebone->next) {
- if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_UNSELECTABLE)==0) {
+ for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
+ if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_UNSELECTABLE) == 0) {
mul_v3_m4v3(vec, vc->obedit->obmat, ebone->head);
project_short(vc->ar, vec, sco1);
mul_v3_m4v3(vec, vc->obedit->obmat, ebone->tail);
project_short(vc->ar, vec, sco2);
- didpoint= 0;
+ didpoint = 0;
if (lasso_inside(mcords, moves, sco1[0], sco1[1])) {
if (select) ebone->flag |= BONE_ROOTSEL;
else ebone->flag &= ~BONE_ROOTSEL;
- didpoint= 1;
- change= TRUE;
+ didpoint = 1;
+ change = TRUE;
}
if (lasso_inside(mcords, moves, sco2[0], sco2[1])) {
if (select) ebone->flag |= BONE_TIPSEL;
else ebone->flag &= ~BONE_TIPSEL;
- didpoint= 1;
- change= TRUE;
+ didpoint = 1;
+ change = TRUE;
}
/* if one of points selected, we skip the bone itself */
- if (didpoint==0 && lasso_inside_edge(mcords, moves, sco1[0], sco1[1], sco2[0], sco2[1])) {
- if (select) ebone->flag |= BONE_TIPSEL|BONE_ROOTSEL|BONE_SELECTED;
- else ebone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
- change= TRUE;
+ if (didpoint == 0 && lasso_inside_edge(mcords, moves, sco1[0], sco1[1], sco2[0], sco2[1])) {
+ if (select) ebone->flag |= BONE_TIPSEL | BONE_ROOTSEL | BONE_SELECTED;
+ else ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
+ change = TRUE;
}
}
}
@@ -746,7 +746,7 @@ static void do_lasso_select_armature(ViewContext *vc, int mcords[][2], short mov
if (change) {
ED_armature_sync_selection(arm->edbo);
ED_armature_validate_active(arm);
- WM_main_add_notifier(NC_OBJECT|ND_BONE_SELECT, vc->obedit);
+ WM_main_add_notifier(NC_OBJECT | ND_BONE_SELECT, vc->obedit);
}
}
@@ -755,25 +755,25 @@ static void do_lasso_select_armature(ViewContext *vc, int mcords[][2], short mov
static void do_lasso_select_meta(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
{
- MetaBall *mb = (MetaBall*)vc->obedit->data;
+ MetaBall *mb = (MetaBall *)vc->obedit->data;
MetaElem *ml;
float vec[3];
short sco[2];
if (extend == 0 && select) {
- for (ml= mb->editelems->first; ml; ml= ml->next) {
+ for (ml = mb->editelems->first; ml; ml = ml->next) {
ml->flag &= ~SELECT;
}
}
- for (ml= mb->editelems->first; ml; ml= ml->next) {
+ for (ml = mb->editelems->first; ml; ml = ml->next) {
mul_v3_m4v3(vec, vc->obedit->obmat, &ml->x);
project_short(vc->ar, vec, sco);
if (lasso_inside(mcords, moves, sco[0], sco[1])) {
- if (select) ml->flag |= SELECT;
- else ml->flag &= ~SELECT;
+ if (select) ml->flag |= SELECT;
+ else ml->flag &= ~SELECT;
}
}
}
@@ -786,42 +786,41 @@ int do_paintvert_box_select(ViewContext *vc, rcti *rect, int select, int extend)
unsigned int *rt;
int a, index;
char *selar;
- int sx= rect->xmax-rect->xmin+1;
- int sy= rect->ymax-rect->ymin+1;
+ int sx = rect->xmax - rect->xmin + 1;
+ int sy = rect->ymax - rect->ymin + 1;
- me= vc->obact->data;
+ me = vc->obact->data;
- if (me==NULL || me->totvert==0 || sx*sy <= 0)
+ if (me == NULL || me->totvert == 0 || sx * sy <= 0)
return OPERATOR_CANCELLED;
- selar= MEM_callocN(me->totvert+1, "selar");
+ selar = MEM_callocN(me->totvert + 1, "selar");
if (extend == 0 && select)
paintvert_deselect_all_visible(vc->obact, SEL_DESELECT, FALSE);
view3d_validate_backbuf(vc);
- ibuf = IMB_allocImBuf(sx,sy,32,IB_rect);
+ ibuf = IMB_allocImBuf(sx, sy, 32, IB_rect);
rt = ibuf->rect;
- glReadPixels(rect->xmin+vc->ar->winrct.xmin, rect->ymin+vc->ar->winrct.ymin, sx, sy, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
- if (ENDIAN_ORDER==B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf);
+ glReadPixels(rect->xmin + vc->ar->winrct.xmin, rect->ymin + vc->ar->winrct.ymin, sx, sy, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
+ if (ENDIAN_ORDER == B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf);
- a= sx*sy;
+ a = sx * sy;
while (a--) {
if (*rt) {
- index= WM_framebuffer_to_index(*rt);
- if (index<=me->totvert) selar[index]= 1;
+ index = WM_framebuffer_to_index(*rt);
+ if (index <= me->totvert) selar[index] = 1;
}
rt++;
}
- mvert= me->mvert;
- for (a=1; a<=me->totvert; a++, mvert++) {
+ mvert = me->mvert;
+ for (a = 1; a <= me->totvert; a++, mvert++) {
if (selar[a]) {
- if (mvert->flag & ME_HIDE);
- else {
- if (select) mvert->flag |= SELECT;
- else mvert->flag &= ~SELECT;
+ if ((mvert->flag & ME_HIDE) == 0) {
+ if (select) mvert->flag |= SELECT;
+ else mvert->flag &= ~SELECT;
}
}
}
@@ -840,46 +839,46 @@ int do_paintvert_box_select(ViewContext *vc, rcti *rect, int select, int extend)
static void do_lasso_select_paintvert(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
{
- Object *ob= vc->obact;
- Mesh *me= ob?ob->data:NULL;
+ Object *ob = vc->obact;
+ Mesh *me = ob ? ob->data : NULL;
rcti rect;
- if (me==NULL || me->totvert==0)
+ if (me == NULL || me->totvert == 0)
return;
- if (extend==0 && select)
- paintvert_deselect_all_visible(ob, SEL_DESELECT, FALSE); /* flush selection at the end */
- bm_vertoffs= me->totvert+1; /* max index array */
+ if (extend == 0 && select)
+ paintvert_deselect_all_visible(ob, SEL_DESELECT, FALSE); /* flush selection at the end */
+ bm_vertoffs = me->totvert + 1; /* max index array */
lasso_select_boundbox(&rect, mcords, moves);
- EDBM_mask_init_backbuf_border(vc, mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
+ EDBM_backbuf_border_mask_init(vc, mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
- EDBM_backbuf_checkAndSelectVerts_obmode(me, select);
+ edbm_backbuf_check_and_select_verts_obmode(me, select);
- EDBM_free_backbuf();
+ EDBM_backbuf_free();
paintvert_flush_flags(ob);
}
static void do_lasso_select_paintface(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
{
- Object *ob= vc->obact;
- Mesh *me= ob?ob->data:NULL;
+ Object *ob = vc->obact;
+ Mesh *me = ob ? ob->data : NULL;
rcti rect;
- if (me==NULL || me->totpoly==0)
+ if (me == NULL || me->totpoly == 0)
return;
- if (extend==0 && select)
- paintface_deselect_all_visible(ob, SEL_DESELECT, FALSE); /* flush selection at the end */
+ if (extend == 0 && select)
+ paintface_deselect_all_visible(ob, SEL_DESELECT, FALSE); /* flush selection at the end */
- bm_vertoffs= me->totpoly+1; /* max index array */
+ bm_vertoffs = me->totpoly + 1; /* max index array */
lasso_select_boundbox(&rect, mcords, moves);
- EDBM_mask_init_backbuf_border(vc, mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
+ EDBM_backbuf_border_mask_init(vc, mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
- EDBM_backbuf_checkAndSelectTFaces(me, select);
+ edbm_backbuf_check_and_select_tfaces(me, select);
- EDBM_free_backbuf();
+ EDBM_backbuf_free();
paintface_flush_flags(ob);
}
@@ -897,10 +896,10 @@ static void do_lasso_select_node(int mcords[][2], short moves, short select)
lasso_select_boundbox(&rect, mcords, moves);
/* store selection in temp test flag */
- for (node= snode->edittree->nodes.first; node; node= node->next) {
+ for (node = snode->edittree->nodes.first; node; node = node->next) {
- node_centf[0] = (node->totr.xmin+node->totr.xmax)/2;
- node_centf[1] = (node->totr.ymin+node->totr.ymax)/2;
+ node_centf[0] = (node->totr.xmin + node->totr.xmax) / 2;
+ node_centf[1] = (node->totr.ymin + node->totr.ymax) / 2;
ipoco_to_areaco_noclip(G.v2d, node_centf, node_cent);
if (BLI_in_rcti(&rect, node_cent[0], node_cent[1]) && lasso_inside(mcords, moves, node_cent[0], node_cent[1])) {
@@ -920,75 +919,75 @@ static void view3d_lasso_select(bContext *C, ViewContext *vc, int mcords[][2], s
{
Object *ob = CTX_data_active_object(C);
- if (vc->obedit==NULL) { /* Object Mode */
+ if (vc->obedit == NULL) { /* Object Mode */
if (paint_facesel_test(ob))
do_lasso_select_paintface(vc, mcords, moves, extend, select);
else if (paint_vertsel_test(ob))
do_lasso_select_paintvert(vc, mcords, moves, extend, select);
- else if (ob && ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))
+ else if (ob && ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))
;
else if (ob && ob->mode & OB_MODE_PARTICLE_EDIT)
PE_lasso_select(C, mcords, moves, extend, select);
else {
do_lasso_select_objects(vc, mcords, moves, extend, select);
- WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, vc->scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, vc->scene);
}
}
else { /* Edit Mode */
- switch(vc->obedit->type) {
- case OB_MESH:
- do_lasso_select_mesh(vc, mcords, moves, extend, select);
- break;
- case OB_CURVE:
- case OB_SURF:
- do_lasso_select_curve(vc, mcords, moves, extend, select);
- break;
- case OB_LATTICE:
- do_lasso_select_lattice(vc, mcords, moves, extend, select);
- break;
- case OB_ARMATURE:
- do_lasso_select_armature(vc, mcords, moves, extend, select);
- break;
- case OB_MBALL:
- do_lasso_select_meta(vc, mcords, moves, extend, select);
- break;
- default:
- assert(!"lasso select on incorrect object type");
+ switch (vc->obedit->type) {
+ case OB_MESH:
+ do_lasso_select_mesh(vc, mcords, moves, extend, select);
+ break;
+ case OB_CURVE:
+ case OB_SURF:
+ do_lasso_select_curve(vc, mcords, moves, extend, select);
+ break;
+ case OB_LATTICE:
+ do_lasso_select_lattice(vc, mcords, moves, extend, select);
+ break;
+ case OB_ARMATURE:
+ do_lasso_select_armature(vc, mcords, moves, extend, select);
+ break;
+ case OB_MBALL:
+ do_lasso_select_meta(vc, mcords, moves, extend, select);
+ break;
+ default:
+ assert(!"lasso select on incorrect object type");
}
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, vc->obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc->obedit->data);
}
}
/* 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;
- int i= 0;
+ int i = 0;
int mcords[1024][2];
RNA_BEGIN(op->ptr, itemptr, "path") {
float loc[2];
RNA_float_get_array(&itemptr, "loc", loc);
- mcords[i][0]= (int)loc[0];
- mcords[i][1]= (int)loc[1];
+ mcords[i][0] = (int)loc[0];
+ mcords[i][1] = (int)loc[1];
i++;
- if (i>=1024) break;
+ if (i >= 1024) break;
}
RNA_END;
- if (i>1) {
+ if (i > 1) {
short extend, select;
view3d_operator_needs_opengl(C);
/* setup view context for argument to callbacks */
view3d_set_viewcontext(C, &vc);
- extend= RNA_boolean_get(op->ptr, "extend");
- select= !RNA_boolean_get(op->ptr, "deselect");
+ extend = RNA_boolean_get(op->ptr, "extend");
+ select = !RNA_boolean_get(op->ptr, "deselect");
view3d_lasso_select(C, &vc, mcords, i, extend, select);
return OPERATOR_FINISHED;
@@ -998,18 +997,18 @@ static int view3d_lasso_select_exec(bContext *C, wmOperator *op)
void VIEW3D_OT_select_lasso(wmOperatorType *ot)
{
- ot->name= "Lasso Select";
- ot->description= "Select items using lasso selection";
- ot->idname= "VIEW3D_OT_select_lasso";
+ ot->name = "Lasso Select";
+ ot->description = "Select items using lasso selection";
+ ot->idname = "VIEW3D_OT_select_lasso";
- ot->invoke= WM_gesture_lasso_invoke;
- ot->modal= WM_gesture_lasso_modal;
- ot->exec= view3d_lasso_select_exec;
- ot->poll= view3d_selectable_data;
- ot->cancel= WM_gesture_lasso_cancel;
+ ot->invoke = WM_gesture_lasso_invoke;
+ ot->modal = WM_gesture_lasso_modal;
+ ot->exec = view3d_lasso_select_exec;
+ ot->poll = view3d_selectable_data;
+ ot->cancel = WM_gesture_lasso_cancel;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
RNA_def_collection_runtime(ot->srna, "path", &RNA_OperatorMousePath, "Path", "");
RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect rather than select items");
@@ -1024,41 +1023,41 @@ void VIEW3D_OT_select_lasso(wmOperatorType *ot)
static unsigned int samplerect(unsigned int *buf, int size, unsigned int dontdo)
{
Base *base;
- unsigned int *bufmin,*bufmax;
- int a,b,rc,tel,len,dirvec[4][2],maxob;
- unsigned int retval=0;
+ unsigned int *bufmin, *bufmax;
+ int a, b, rc, tel, len, dirvec[4][2], maxob;
+ unsigned int retval = 0;
- base= LASTBASE;
- if (base==0) return 0;
- maxob= base->selcol;
+ base = LASTBASE;
+ if (base == 0) return 0;
+ maxob = base->selcol;
- len= (size-1)/2;
- rc= 0;
+ len = (size - 1) / 2;
+ rc = 0;
- dirvec[0][0]= 1;
- dirvec[0][1]= 0;
- dirvec[1][0]= 0;
- dirvec[1][1]= -size;
- dirvec[2][0]= -1;
- dirvec[2][1]= 0;
- dirvec[3][0]= 0;
- dirvec[3][1]= size;
+ dirvec[0][0] = 1;
+ dirvec[0][1] = 0;
+ dirvec[1][0] = 0;
+ dirvec[1][1] = -size;
+ dirvec[2][0] = -1;
+ dirvec[2][1] = 0;
+ dirvec[3][0] = 0;
+ dirvec[3][1] = size;
- bufmin= buf;
- bufmax= buf+ size*size;
- buf+= len*size+ len;
+ bufmin = buf;
+ bufmax = buf + size * size;
+ buf += len * size + len;
- for (tel=1;tel<=size;tel++) {
+ for (tel = 1; tel <= size; tel++) {
- for (a=0;a<2;a++) {
- for (b=0;b<tel;b++) {
+ for (a = 0; a < 2; a++) {
+ for (b = 0; b < tel; b++) {
- if (*buf && *buf<=maxob && *buf!=dontdo) return *buf;
- if ( *buf==dontdo ) retval= dontdo; /* if only color dontdo is available, still return dontdo */
+ if (*buf && *buf <= maxob && *buf != dontdo) return *buf;
+ if (*buf == dontdo) retval = dontdo; /* if only color dontdo is available, still return dontdo */
- buf+= (dirvec[rc][0]+dirvec[rc][1]);
+ buf += (dirvec[rc][0] + dirvec[rc][1]);
- if (buf<bufmin || buf>=bufmax) return retval;
+ if (buf < bufmin || buf >= bufmax) return retval;
}
rc++;
rc &= 3;
@@ -1073,62 +1072,62 @@ static unsigned int samplerect(unsigned int *buf, int size, unsigned int dontdo)
/* The max number of menu items in an object select menu */
typedef struct SelMenuItemF {
- char idname[MAX_ID_NAME-2];
+ char idname[MAX_ID_NAME - 2];
int icon;
} SelMenuItemF;
-#define SEL_MENU_SIZE 22
+#define SEL_MENU_SIZE 22
static SelMenuItemF object_mouse_select_menu_data[SEL_MENU_SIZE];
/* special (crappy) operator only for menu select */
static EnumPropertyItem *object_select_menu_enum_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
{
- EnumPropertyItem *item= NULL, item_tmp= {0};
- int totitem= 0;
- int i= 0;
+ EnumPropertyItem *item = NULL, item_tmp = {0};
+ int totitem = 0;
+ int i = 0;
- /* dont need context but avoid docgen using this */
+ /* don't need context but avoid docgen using this */
if (C == NULL || object_mouse_select_menu_data[i].idname[0] == '\0') {
return DummyRNA_NULL_items;
}
for (; i < SEL_MENU_SIZE && object_mouse_select_menu_data[i].idname[0] != '\0'; i++) {
- item_tmp.name= object_mouse_select_menu_data[i].idname;
- item_tmp.identifier= object_mouse_select_menu_data[i].idname;
- item_tmp.value= i;
- item_tmp.icon= object_mouse_select_menu_data[i].icon;
+ item_tmp.name = object_mouse_select_menu_data[i].idname;
+ item_tmp.identifier = object_mouse_select_menu_data[i].idname;
+ item_tmp.value = i;
+ item_tmp.icon = object_mouse_select_menu_data[i].icon;
RNA_enum_item_add(&item, &totitem, &item_tmp);
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
static int object_select_menu_exec(bContext *C, wmOperator *op)
{
- int name_index= RNA_enum_get(op->ptr, "name");
- short extend= RNA_boolean_get(op->ptr, "extend");
+ int name_index = RNA_enum_get(op->ptr, "name");
+ short extend = RNA_boolean_get(op->ptr, "extend");
short changed = 0;
- const char *name= object_mouse_select_menu_data[name_index].idname;
+ const char *name = object_mouse_select_menu_data[name_index].idname;
if (!extend) {
- CTX_DATA_BEGIN(C, Base*, base, selectable_bases) {
+ CTX_DATA_BEGIN(C, Base *, base, selectable_bases) {
if (base->flag & SELECT) {
ED_base_object_select(base, BA_DESELECT);
- changed= 1;
+ changed = 1;
}
}
CTX_DATA_END;
}
- CTX_DATA_BEGIN(C, Base*, base, selectable_bases) {
+ CTX_DATA_BEGIN(C, Base *, base, selectable_bases) {
/* this is a bit dodjy, there should only be ONE object with this name, but library objects can mess this up */
- if (strcmp(name, base->object->id.name+2)==0) {
+ if (strcmp(name, base->object->id.name + 2) == 0) {
ED_base_object_activate(C, base);
ED_base_object_select(base, BA_SELECT);
- changed= 1;
+ changed = 1;
}
}
CTX_DATA_END;
@@ -1138,7 +1137,7 @@ static int object_select_menu_exec(bContext *C, wmOperator *op)
/* undo? */
if (changed) {
- WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, CTX_data_scene(C));
return OPERATOR_FINISHED;
}
else {
@@ -1151,22 +1150,22 @@ void VIEW3D_OT_select_menu(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name= "Select Menu";
+ ot->name = "Select Menu";
ot->description = "Menu object selection";
- ot->idname= "VIEW3D_OT_select_menu";
+ ot->idname = "VIEW3D_OT_select_menu";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= object_select_menu_exec;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = object_select_menu_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* keyingset to use (dynamic enum) */
- prop= RNA_def_enum(ot->srna, "name", DummyRNA_NULL_items, 0, "Object Name", "");
+ prop = RNA_def_enum(ot->srna, "name", DummyRNA_NULL_items, 0, "Object Name", "");
RNA_def_enum_funcs(prop, object_select_menu_enum_itemf);
RNA_def_property_flag(prop, PROP_HIDDEN);
- ot->prop= prop;
+ ot->prop = prop;
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first");
}
@@ -1175,9 +1174,9 @@ static void deselectall_except(Scene *scene, Base *b) /* deselect all except b
{
Base *base;
- for (base= FIRSTBASE; base; base= base->next) {
+ for (base = FIRSTBASE; base; base = base->next) {
if (base->flag & SELECT) {
- if (b!=base) {
+ if (b != base) {
ED_base_object_select(base, BA_DESELECT);
}
}
@@ -1188,45 +1187,45 @@ static Base *object_mouse_select_menu(bContext *C, ViewContext *vc, unsigned int
{
short baseCount = 0;
short ok;
- LinkNode *linklist= NULL;
+ LinkNode *linklist = NULL;
- CTX_DATA_BEGIN(C, Base*, base, selectable_bases) {
- ok= FALSE;
+ CTX_DATA_BEGIN(C, Base *, base, selectable_bases) {
+ ok = FALSE;
/* two selection methods, the CTRL select uses max dist of 15 */
if (buffer) {
int a;
- for (a=0; a<hits; a++) {
+ for (a = 0; a < hits; a++) {
/* index was converted */
- if (base->selcol==buffer[ (4 * a) + 3 ])
- ok= TRUE;
+ if (base->selcol == buffer[(4 * a) + 3])
+ ok = TRUE;
}
}
else {
- int temp, dist=15;
+ int temp, dist = 15;
project_short(vc->ar, base->object->obmat[3], &base->sx);
- temp= abs(base->sx -mval[0]) + abs(base->sy -mval[1]);
+ temp = abs(base->sx - mval[0]) + abs(base->sy - mval[1]);
if (temp < dist)
- ok= TRUE;
+ ok = TRUE;
}
if (ok) {
baseCount++;
BLI_linklist_prepend(&linklist, base);
- if (baseCount==SEL_MENU_SIZE)
+ if (baseCount == SEL_MENU_SIZE)
break;
}
}
CTX_DATA_END;
- if (baseCount==0) {
+ if (baseCount == 0) {
return NULL;
}
if (baseCount == 1) {
- Base *base= (Base *)linklist->link;
+ Base *base = (Base *)linklist->link;
BLI_linklist_free(linklist, NULL);
return base;
}
@@ -1237,12 +1236,12 @@ static Base *object_mouse_select_menu(bContext *C, ViewContext *vc, unsigned int
memset(object_mouse_select_menu_data, 0, sizeof(object_mouse_select_menu_data));
- for (node = linklist, i = 0; node; node= node->next, i++) {
- Base *base=node->link;
- Object *ob= base->object;
- char *name= ob->id.name+2;
+ for (node = linklist, i = 0; node; node = node->next, i++) {
+ Base *base = node->link;
+ Object *ob = base->object;
+ char *name = ob->id.name + 2;
- BLI_strncpy(object_mouse_select_menu_data[i].idname, name, MAX_ID_NAME-2);
+ BLI_strncpy(object_mouse_select_menu_data[i].idname, name, MAX_ID_NAME - 2);
object_mouse_select_menu_data[i].icon = uiIconFromID(&ob->id);
}
@@ -1266,50 +1265,50 @@ static short mixed_bones_object_selectbuffer(ViewContext *vc, unsigned int *buff
{
rcti rect;
int offs;
- short a, hits15, hits9=0, hits5=0;
- short has_bones15=0, has_bones9=0, has_bones5=0;
-
- BLI_init_rcti(&rect, mval[0]-14, mval[0]+14, mval[1]-14, mval[1]+14);
- hits15= view3d_opengl_select(vc, buffer, MAXPICKBUF, &rect);
- if (hits15>0) {
- for (a=0; a<hits15; a++) if (buffer[4*a+3] & 0xFFFF0000) has_bones15= 1;
-
- offs= 4*hits15;
- BLI_init_rcti(&rect, mval[0]-9, mval[0]+9, mval[1]-9, mval[1]+9);
- hits9= view3d_opengl_select(vc, buffer+offs, MAXPICKBUF-offs, &rect);
- if (hits9>0) {
- for (a=0; a<hits9; a++) if (buffer[offs+4*a+3] & 0xFFFF0000) has_bones9= 1;
-
- offs+= 4*hits9;
- BLI_init_rcti(&rect, mval[0]-5, mval[0]+5, mval[1]-5, mval[1]+5);
- hits5= view3d_opengl_select(vc, buffer+offs, MAXPICKBUF-offs, &rect);
- if (hits5>0) {
- for (a=0; a<hits5; a++) if (buffer[offs+4*a+3] & 0xFFFF0000) has_bones5= 1;
+ short a, hits15, hits9 = 0, hits5 = 0;
+ short has_bones15 = 0, has_bones9 = 0, has_bones5 = 0;
+
+ BLI_init_rcti(&rect, mval[0] - 14, mval[0] + 14, mval[1] - 14, mval[1] + 14);
+ hits15 = view3d_opengl_select(vc, buffer, MAXPICKBUF, &rect);
+ if (hits15 > 0) {
+ for (a = 0; a < hits15; a++) if (buffer[4 * a + 3] & 0xFFFF0000) has_bones15 = 1;
+
+ offs = 4 * hits15;
+ BLI_init_rcti(&rect, mval[0] - 9, mval[0] + 9, mval[1] - 9, mval[1] + 9);
+ hits9 = view3d_opengl_select(vc, buffer + offs, MAXPICKBUF - offs, &rect);
+ if (hits9 > 0) {
+ for (a = 0; a < hits9; a++) if (buffer[offs + 4 * a + 3] & 0xFFFF0000) has_bones9 = 1;
+
+ offs += 4 * hits9;
+ BLI_init_rcti(&rect, mval[0] - 5, mval[0] + 5, mval[1] - 5, mval[1] + 5);
+ hits5 = view3d_opengl_select(vc, buffer + offs, MAXPICKBUF - offs, &rect);
+ if (hits5 > 0) {
+ for (a = 0; a < hits5; a++) if (buffer[offs + 4 * a + 3] & 0xFFFF0000) has_bones5 = 1;
}
}
if (has_bones5) {
- offs= 4*hits15 + 4*hits9;
- memcpy(buffer, buffer+offs, 4*offs);
+ offs = 4 * hits15 + 4 * hits9;
+ memcpy(buffer, buffer + offs, 4 * offs);
return hits5;
}
if (has_bones9) {
- offs= 4*hits15;
- memcpy(buffer, buffer+offs, 4*offs);
+ offs = 4 * hits15;
+ memcpy(buffer, buffer + offs, 4 * offs);
return hits9;
}
if (has_bones15) {
return hits15;
}
- if (hits5>0) {
- offs= 4*hits15 + 4*hits9;
- memcpy(buffer, buffer+offs, 4*offs);
+ if (hits5 > 0) {
+ offs = 4 * hits15 + 4 * hits9;
+ memcpy(buffer, buffer + offs, 4 * offs);
return hits5;
}
- if (hits9>0) {
- offs= 4*hits15;
- memcpy(buffer, buffer+offs, 4*offs);
+ if (hits9 > 0) {
+ offs = 4 * hits15;
+ memcpy(buffer, buffer + offs, 4 * offs);
return hits9;
}
return hits15;
@@ -1321,90 +1320,90 @@ static short mixed_bones_object_selectbuffer(ViewContext *vc, unsigned int *buff
/* returns basact */
static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int hits, const int mval[2], Base *startbase, int has_bones)
{
- Scene *scene= vc->scene;
- View3D *v3d= vc->v3d;
- Base *base, *basact= NULL;
- static int lastmval[2]={-100, -100};
- int a, donearest= 0;
+ Scene *scene = vc->scene;
+ View3D *v3d = vc->v3d;
+ Base *base, *basact = NULL;
+ static int lastmval[2] = {-100, -100};
+ int a, donearest = 0;
/* define if we use solid nearest select or not */
- if (v3d->drawtype>OB_WIRE) {
- donearest= 1;
- if ( ABS(mval[0]-lastmval[0])<3 && ABS(mval[1]-lastmval[1])<3) {
- if (!has_bones) /* hrms, if theres bones we always do nearest */
- donearest= 0;
+ if (v3d->drawtype > OB_WIRE) {
+ donearest = 1;
+ if (ABS(mval[0] - lastmval[0]) < 3 && ABS(mval[1] - lastmval[1]) < 3) {
+ if (!has_bones) /* hrms, if theres bones we always do nearest */
+ donearest = 0;
}
}
- lastmval[0]= mval[0]; lastmval[1]= mval[1];
+ lastmval[0] = mval[0]; lastmval[1] = mval[1];
if (donearest) {
- unsigned int min= 0xFFFFFFFF;
- int selcol= 0, notcol=0;
+ unsigned int min = 0xFFFFFFFF;
+ int selcol = 0, notcol = 0;
if (has_bones) {
/* we skip non-bone hits */
- for (a=0; a<hits; a++) {
- if ( min > buffer[4*a+1] && (buffer[4*a+3] & 0xFFFF0000) ) {
- min= buffer[4*a+1];
- selcol= buffer[4*a+3] & 0xFFFF;
+ for (a = 0; a < hits; a++) {
+ if (min > buffer[4 * a + 1] && (buffer[4 * a + 3] & 0xFFFF0000) ) {
+ min = buffer[4 * a + 1];
+ selcol = buffer[4 * a + 3] & 0xFFFF;
}
}
}
else {
/* only exclude active object when it is selected... */
- if (BASACT && (BASACT->flag & SELECT) && hits>1) notcol= BASACT->selcol;
+ if (BASACT && (BASACT->flag & SELECT) && hits > 1) notcol = BASACT->selcol;
- for (a=0; a<hits; a++) {
- if ( min > buffer[4*a+1] && notcol!=(buffer[4*a+3] & 0xFFFF)) {
- min= buffer[4*a+1];
- selcol= buffer[4*a+3] & 0xFFFF;
+ for (a = 0; a < hits; a++) {
+ if (min > buffer[4 * a + 1] && notcol != (buffer[4 * a + 3] & 0xFFFF)) {
+ min = buffer[4 * a + 1];
+ selcol = buffer[4 * a + 3] & 0xFFFF;
}
}
}
- base= FIRSTBASE;
+ base = FIRSTBASE;
while (base) {
if (BASE_SELECTABLE(v3d, base)) {
- if (base->selcol==selcol) break;
+ if (base->selcol == selcol) break;
}
- base= base->next;
+ base = base->next;
}
- if (base) basact= base;
+ if (base) basact = base;
}
else {
- base= startbase;
+ 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;
- if (base==startbase) break;
+ base = base->next;
+ if (base == NULL) base = FIRSTBASE;
+ if (base == startbase) break;
}
if (BASE_SELECTABLE(v3d, base)) {
- for (a=0; a<hits; a++) {
+ for (a = 0; a < hits; a++) {
if (has_bones) {
/* skip non-bone objects */
- if ((buffer[4*a+3] & 0xFFFF0000)) {
- if (base->selcol== (buffer[(4*a)+3] & 0xFFFF))
- basact= base;
+ if ((buffer[4 * a + 3] & 0xFFFF0000)) {
+ if (base->selcol == (buffer[(4 * a) + 3] & 0xFFFF))
+ basact = base;
}
}
else {
- if (base->selcol== (buffer[(4*a)+3] & 0xFFFF))
- basact= base;
+ if (base->selcol == (buffer[(4 * a) + 3] & 0xFFFF))
+ basact = base;
}
}
}
if (basact) break;
- base= base->next;
- if (base==NULL) base= FIRSTBASE;
- if (base==startbase) break;
+ base = base->next;
+ if (base == NULL) base = FIRSTBASE;
+ if (base == startbase) break;
}
}
@@ -1415,22 +1414,22 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
Base *ED_view3d_give_base_under_cursor(bContext *C, const int mval[2])
{
ViewContext vc;
- Base *basact= NULL;
- unsigned int buffer[4*MAXPICKBUF];
+ Base *basact = NULL;
+ unsigned int buffer[4 * MAXPICKBUF];
int hits;
/* setup view context for argument to callbacks */
view3d_operator_needs_opengl(C);
view3d_set_viewcontext(C, &vc);
- hits= mixed_bones_object_selectbuffer(&vc, buffer, mval);
+ hits = mixed_bones_object_selectbuffer(&vc, buffer, mval);
- if (hits>0) {
- int a, has_bones= 0;
+ if (hits > 0) {
+ int a, has_bones = 0;
- for (a=0; a<hits; a++) if (buffer[4*a+3] & 0xFFFF0000) has_bones= 1;
+ for (a = 0; a < hits; a++) if (buffer[4 * a + 3] & 0xFFFF0000) has_bones = 1;
- basact= mouse_select_eval_buffer(&vc, buffer, hits, mval, vc.scene->base.first, has_bones);
+ basact = mouse_select_eval_buffer(&vc, buffer, hits, mval, vc.scene->base.first, has_bones);
}
return basact;
@@ -1440,18 +1439,18 @@ static void deselect_all_tracks(MovieTracking *tracking)
{
MovieTrackingObject *object;
- object= tracking->objects.first;
+ object = tracking->objects.first;
while (object) {
- ListBase *tracksbase= BKE_tracking_object_tracks(tracking, object);
- MovieTrackingTrack *track= tracksbase->first;
+ ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object);
+ MovieTrackingTrack *track = tracksbase->first;
while (track) {
BKE_tracking_deselect_track(track, TRACK_AREA_ALL);
- track= track->next;
+ track = track->next;
}
- object= object->next;
+ object = object->next;
}
}
@@ -1459,11 +1458,11 @@ static void deselect_all_tracks(MovieTracking *tracking)
static int mouse_select(bContext *C, const int mval[2], short extend, short obcenter, short enumerate)
{
ViewContext vc;
- ARegion *ar= CTX_wm_region(C);
- View3D *v3d= CTX_wm_view3d(C);
- Scene *scene= CTX_data_scene(C);
- Base *base, *startbase=NULL, *basact=NULL, *oldbasact=NULL;
- int temp, a, dist=100;
+ ARegion *ar = CTX_wm_region(C);
+ View3D *v3d = CTX_wm_view3d(C);
+ Scene *scene = CTX_data_scene(C);
+ Base *base, *startbase = NULL, *basact = NULL, *oldbasact = NULL;
+ int temp, a, dist = 100;
int retval = 0;
short hits;
@@ -1471,8 +1470,8 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce
view3d_set_viewcontext(C, &vc);
/* always start list from basact in wire mode */
- startbase= FIRSTBASE;
- if (BASACT && BASACT->next) startbase= BASACT->next;
+ startbase = FIRSTBASE;
+ if (BASACT && BASACT->next) startbase = BASACT->next;
/* This block uses the control key to make the object selected by its center point rather than its contents */
/* in editmode do not activate */
@@ -1480,97 +1479,97 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce
/* note; shift+alt goes to group-flush-selecting */
if (enumerate) {
- basact= object_mouse_select_menu(C, &vc, NULL, 0, mval, extend);
+ basact = object_mouse_select_menu(C, &vc, NULL, 0, mval, extend);
}
else {
- base= startbase;
+ base = startbase;
while (base) {
if (BASE_SELECTABLE(v3d, base)) {
project_short(ar, base->object->obmat[3], &base->sx);
- temp= abs(base->sx -mval[0]) + abs(base->sy -mval[1]);
- if (base==BASACT) temp+=10;
- if (temp<dist ) {
+ temp = abs(base->sx - mval[0]) + abs(base->sy - mval[1]);
+ if (base == BASACT) temp += 10;
+ if (temp < dist) {
- dist= temp;
- basact= base;
+ dist = temp;
+ basact = base;
}
}
- base= base->next;
+ base = base->next;
- if (base==NULL) base= FIRSTBASE;
- if (base==startbase) break;
+ if (base == NULL) base = FIRSTBASE;
+ if (base == startbase) break;
}
}
}
else {
- unsigned int buffer[4*MAXPICKBUF];
+ unsigned int buffer[4 * MAXPICKBUF];
/* if objects have posemode set, the bones are in the same selection buffer */
- hits= mixed_bones_object_selectbuffer(&vc, buffer, mval);
+ hits = mixed_bones_object_selectbuffer(&vc, buffer, mval);
- if (hits>0) {
- int has_bones= 0;
+ if (hits > 0) {
+ int has_bones = 0;
/* note: bundles are handling in the same way as bones */
- for (a=0; a<hits; a++) if (buffer[4*a+3] & 0xFFFF0000) has_bones= 1;
+ for (a = 0; a < hits; a++) if (buffer[4 * a + 3] & 0xFFFF0000) has_bones = 1;
/* note; shift+alt goes to group-flush-selecting */
- if (has_bones==0 && enumerate) {
- basact= object_mouse_select_menu(C, &vc, buffer, hits, mval, extend);
+ if (has_bones == 0 && enumerate) {
+ basact = object_mouse_select_menu(C, &vc, buffer, hits, mval, extend);
}
else {
- basact= mouse_select_eval_buffer(&vc, buffer, hits, mval, startbase, has_bones);
+ basact = mouse_select_eval_buffer(&vc, buffer, hits, mval, startbase, has_bones);
}
if (has_bones && basact) {
- if (basact->object->type==OB_CAMERA) {
- if (BASACT==basact) {
+ if (basact->object->type == OB_CAMERA) {
+ if (BASACT == basact) {
int i, hitresult;
- int changed= 0;
+ int changed = 0;
- for (i=0; i< hits; i++) {
- hitresult= buffer[3+(i*4)];
+ for (i = 0; i < hits; i++) {
+ 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 */
- if (buffer[4*i+3] & 0xFFFF0000) {
- MovieClip *clip= object_get_movieclip(scene, basact->object, 0);
- MovieTracking *tracking= &clip->tracking;
+ * 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;
ListBase *tracksbase;
MovieTrackingTrack *track;
- track= BKE_tracking_indexed_track(&clip->tracking, hitresult >> 16, &tracksbase);
+ track = BKE_tracking_indexed_track(&clip->tracking, hitresult >> 16, &tracksbase);
if (TRACK_SELECTED(track) && extend) {
- changed= 0;
+ changed = 0;
BKE_tracking_deselect_track(track, TRACK_AREA_ALL);
}
else {
- int oldsel= TRACK_SELECTED(track) ? 1 : 0;
+ int oldsel = TRACK_SELECTED(track) ? 1 : 0;
if (!extend)
deselect_all_tracks(tracking);
BKE_tracking_select_track(tracksbase, track, TRACK_AREA_ALL, extend);
- if (oldsel!=(TRACK_SELECTED(track) ? 1 : 0))
- changed= 1;
+ if (oldsel != (TRACK_SELECTED(track) ? 1 : 0))
+ changed = 1;
}
- basact->flag|= SELECT;
- basact->object->flag= basact->flag;
+ basact->flag |= SELECT;
+ basact->object->flag = basact->flag;
- retval= 1;
+ retval = 1;
- WM_event_add_notifier(C, NC_MOVIECLIP|ND_SELECT, track);
- WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
+ WM_event_add_notifier(C, NC_MOVIECLIP | ND_SELECT, track);
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
break;
}
@@ -1578,32 +1577,32 @@ 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 */
- basact= mouse_select_eval_buffer(&vc, buffer, hits, mval, startbase, 0);
+ * allows to select object parented to reconstruction object */
+ basact = mouse_select_eval_buffer(&vc, buffer, hits, mval, startbase, 0);
}
}
}
- else if (ED_do_pose_selectbuffer(scene, basact, buffer, hits, extend) ) { /* then bone is found */
+ 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 */
- basact->flag|= SELECT;
- basact->object->flag= basact->flag;
+ * not-selected active object in posemode won't work well for tools */
+ basact->flag |= SELECT;
+ basact->object->flag = basact->flag;
retval = 1;
- WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, basact->object);
- WM_event_add_notifier(C, NC_OBJECT|ND_BONE_ACTIVE, basact->object);
+ WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, basact->object);
+ WM_event_add_notifier(C, NC_OBJECT | ND_BONE_ACTIVE, basact->object);
/* in weightpaint, we use selected bone to select vertexgroup, so no switch to new active object */
- if (BASACT && BASACT->object->mode & OB_MODE_WEIGHT_PAINT) {
+ if (BASACT && (BASACT->object->mode & OB_MODE_WEIGHT_PAINT)) {
/* prevent activating */
- basact= NULL;
+ basact = NULL;
}
}
/* prevent bone selecting to pass on to object selecting */
- if (basact==BASACT)
- basact= NULL;
+ if (basact == BASACT)
+ basact = NULL;
}
}
}
@@ -1620,7 +1619,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce
/* also prevent making it active on mouse selection */
else if (BASE_SELECTABLE(v3d, basact)) {
- oldbasact= BASACT;
+ oldbasact = BASACT;
if (!extend) {
deselectall_except(scene, basact);
@@ -1631,7 +1630,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce
}
else {
if (basact->flag & SELECT) {
- if (basact==oldbasact)
+ if (basact == oldbasact)
ED_base_object_select(basact, BA_DESELECT);
}
else ED_base_object_select(basact, BA_SELECT);
@@ -1642,7 +1641,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce
}
}
- WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
return retval;
@@ -1658,22 +1657,22 @@ typedef struct BoxSelectUserData {
int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, short x2, short y2)
{
- int radsq= rad*rad;
+ int radsq = rad * rad;
float v1[2], v2[2], v3[2];
/* check points in circle itself */
- if ( (x1-centx)*(x1-centx) + (y1-centy)*(y1-centy) <= radsq ) return 1;
- if ( (x2-centx)*(x2-centx) + (y2-centy)*(y2-centy) <= radsq ) return 1;
+ if ( (x1 - centx) * (x1 - centx) + (y1 - centy) * (y1 - centy) <= radsq) return 1;
+ if ( (x2 - centx) * (x2 - centx) + (y2 - centy) * (y2 - centy) <= radsq) return 1;
/* pointdistline */
- v3[0]= centx;
- v3[1]= centy;
- v1[0]= x1;
- v1[1]= y1;
- v2[0]= x2;
- v2[1]= y2;
+ v3[0] = centx;
+ v3[1] = centy;
+ v1[0] = x1;
+ v1[1] = y1;
+ v2[0] = x2;
+ v2[1] = y2;
- if ( dist_to_line_segment_v2(v3, v1, v2) < (float)rad ) return 1;
+ if (dist_to_line_segment_v2(v3, v1, v2) < (float)rad) return 1;
return 0;
}
@@ -1681,28 +1680,28 @@ int edge_inside_circle(short centx, short centy, short rad, short x1, short y1,
static void do_nurbs_box_select__doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
{
BoxSelectUserData *data = userData;
- Object *obedit= data->vc->obedit;
- Curve *cu= (Curve*)obedit->data;
+ Object *obedit = data->vc->obedit;
+ Curve *cu = (Curve *)obedit->data;
if (BLI_in_rcti(data->rect, x, y)) {
if (bp) {
- bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
+ bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
if (bp == cu->lastsel && !(bp->f1 & 1)) cu->lastsel = NULL;
}
else {
if (cu->drawflag & CU_HIDE_HANDLES) {
/* can only be beztindex==0 here since handles are hidden */
- bezt->f1 = bezt->f2 = bezt->f3 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT);
+ bezt->f1 = bezt->f2 = bezt->f3 = data->select ? (bezt->f2 | SELECT) : (bezt->f2 & ~SELECT);
}
else {
- if (beztindex==0) {
- bezt->f1 = data->select?(bezt->f1|SELECT):(bezt->f1&~SELECT);
+ if (beztindex == 0) {
+ bezt->f1 = data->select ? (bezt->f1 | SELECT) : (bezt->f1 & ~SELECT);
}
- else if (beztindex==1) {
- bezt->f2 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT);
+ else if (beztindex == 1) {
+ bezt->f2 = data->select ? (bezt->f2 | SELECT) : (bezt->f2 & ~SELECT);
}
else {
- bezt->f3 = data->select?(bezt->f3|SELECT):(bezt->f3&~SELECT);
+ bezt->f3 = data->select ? (bezt->f3 | SELECT) : (bezt->f3 & ~SELECT);
}
}
@@ -1732,14 +1731,14 @@ static void do_lattice_box_select__doSelect(void *userData, BPoint *bp, int x, i
BoxSelectUserData *data = userData;
if (BLI_in_rcti(data->rect, x, y)) {
- bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
+ bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
}
}
static int do_lattice_box_select(ViewContext *vc, rcti *rect, int select, int extend)
{
BoxSelectUserData data;
- data.vc= vc;
+ data.vc = vc;
data.rect = rect;
data.select = select;
@@ -1764,8 +1763,8 @@ static void do_mesh_box_select__doSelectEdge(void *userData, BMEdge *eed, int x0
{
BoxSelectUserData *data = userData;
- if (EDBM_check_backbuf(bm_solidoffs+index)) {
- if (data->pass==0) {
+ if (EDBM_backbuf_check(bm_solidoffs + index)) {
+ if (data->pass == 0) {
if (edge_fully_inside_rect(data->rect, x0, y0, x1, y1)) {
BM_elem_select_set(data->vc->em->bm, eed, data->select);
data->done = 1;
@@ -1789,10 +1788,10 @@ static void do_mesh_box_select__doSelectFace(void *userData, BMFace *efa, int x,
static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int extend)
{
BoxSelectUserData data;
- ToolSettings *ts= vc->scene->toolsettings;
+ ToolSettings *ts = vc->scene->toolsettings;
int bbsel;
- data.vc= vc;
+ data.vc = vc;
data.rect = rect;
data.select = select;
data.pass = 0;
@@ -1801,27 +1800,27 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten
if (extend == 0 && select)
EDBM_flag_disable_all(vc->em, BM_ELEM_SELECT);
- /* for non zbuf projections, dont change the GL state */
+ /* for non zbuf projections, don't change the GL state */
ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
glLoadMatrixf(vc->rv3d->viewmat);
- bbsel= EDBM_init_backbuf_border(vc, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
+ bbsel = EDBM_backbuf_border_init(vc, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
if (ts->selectmode & SCE_SELECT_VERTEX) {
if (bbsel) {
- EDBM_backbuf_checkAndSelectVerts(vc->em, select);
+ edbm_backbuf_check_and_select_verts(vc->em, select);
}
else {
mesh_foreachScreenVert(vc, do_mesh_box_select__doSelectVert, &data, V3D_CLIP_TEST_RV3D_CLIPPING);
}
}
if (ts->selectmode & SCE_SELECT_EDGE) {
- /* Does both bbsel and non-bbsel versions (need screen cos for both) */
+ /* Does both bbsel and non-bbsel versions (need screen cos for both) */
data.pass = 0;
mesh_foreachScreenEdge(vc, do_mesh_box_select__doSelectEdge, &data, V3D_CLIP_TEST_OFF);
- if (data.done==0) {
+ if (data.done == 0) {
data.pass = 1;
mesh_foreachScreenEdge(vc, do_mesh_box_select__doSelectEdge, &data, V3D_CLIP_TEST_OFF);
}
@@ -1829,14 +1828,14 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten
if (ts->selectmode & SCE_SELECT_FACE) {
if (bbsel) {
- EDBM_backbuf_checkAndSelectFaces(vc->em, select);
+ edbm_backbuf_check_and_select_faces(vc->em, select);
}
else {
mesh_foreachScreenFace(vc, do_mesh_box_select__doSelectFace, &data);
}
}
- EDBM_free_backbuf();
+ EDBM_backbuf_free();
EDBM_selectmode_flush(vc->em);
@@ -1845,33 +1844,33 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten
static int do_meta_box_select(ViewContext *vc, rcti *rect, int select, int extend)
{
- MetaBall *mb = (MetaBall*)vc->obedit->data;
+ MetaBall *mb = (MetaBall *)vc->obedit->data;
MetaElem *ml;
int a;
- unsigned int buffer[4*MAXPICKBUF];
+ unsigned int buffer[4 * MAXPICKBUF];
short hits;
- hits= view3d_opengl_select(vc, buffer, MAXPICKBUF, rect);
+ hits = view3d_opengl_select(vc, buffer, MAXPICKBUF, rect);
if (extend == 0 && select) {
- for (ml= mb->editelems->first; ml; ml= ml->next) {
+ for (ml = mb->editelems->first; ml; ml = ml->next) {
ml->flag &= ~SELECT;
}
}
- for (ml= mb->editelems->first; ml; ml= ml->next) {
- for (a=0; a<hits; a++) {
- if (ml->selcol1==buffer[ (4 * a) + 3 ]) {
+ for (ml = mb->editelems->first; ml; ml = ml->next) {
+ for (a = 0; a < hits; a++) {
+ if (ml->selcol1 == buffer[(4 * a) + 3]) {
ml->flag |= MB_SCALE_RAD;
- if (select) ml->flag |= SELECT;
- else ml->flag &= ~SELECT;
+ if (select) ml->flag |= SELECT;
+ else ml->flag &= ~SELECT;
break;
}
- if (ml->selcol2==buffer[ (4 * a) + 3 ]) {
+ if (ml->selcol2 == buffer[(4 * a) + 3]) {
ml->flag &= ~MB_SCALE_RAD;
- if (select) ml->flag |= SELECT;
- else ml->flag &= ~SELECT;
+ if (select) ml->flag |= SELECT;
+ else ml->flag &= ~SELECT;
break;
}
}
@@ -1882,45 +1881,45 @@ static int do_meta_box_select(ViewContext *vc, rcti *rect, int select, int exten
static int do_armature_box_select(ViewContext *vc, rcti *rect, short select, short extend)
{
- bArmature *arm= vc->obedit->data;
+ bArmature *arm = vc->obedit->data;
EditBone *ebone;
int a;
- unsigned int buffer[4*MAXPICKBUF];
+ unsigned int buffer[4 * MAXPICKBUF];
short hits;
- hits= view3d_opengl_select(vc, buffer, MAXPICKBUF, rect);
+ hits = view3d_opengl_select(vc, buffer, MAXPICKBUF, rect);
/* clear flag we use to detect point was affected */
- for (ebone= arm->edbo->first; ebone; ebone= ebone->next)
+ for (ebone = arm->edbo->first; ebone; ebone = ebone->next)
ebone->flag &= ~BONE_DONE;
- if (extend==0 && select)
+ if (extend == 0 && select)
ED_armature_deselect_all_visible(vc->obedit);
/* first we only check points inside the border */
- for (a=0; a<hits; a++) {
- int index = buffer[(4*a)+3];
- if (index!=-1) {
+ for (a = 0; a < hits; a++) {
+ int index = buffer[(4 * a) + 3];
+ if (index != -1) {
ebone = BLI_findlink(arm->edbo, index & ~(BONESEL_ANY));
- if ((ebone->flag & BONE_UNSELECTABLE)==0) {
+ if ((ebone->flag & BONE_UNSELECTABLE) == 0) {
if (index & BONESEL_TIP) {
ebone->flag |= BONE_DONE;
- if (select) ebone->flag |= BONE_TIPSEL;
- else ebone->flag &= ~BONE_TIPSEL;
+ if (select) ebone->flag |= BONE_TIPSEL;
+ else ebone->flag &= ~BONE_TIPSEL;
}
if (index & BONESEL_ROOT) {
ebone->flag |= BONE_DONE;
- if (select) ebone->flag |= BONE_ROOTSEL;
- else ebone->flag &= ~BONE_ROOTSEL;
+ if (select) ebone->flag |= BONE_ROOTSEL;
+ else ebone->flag &= ~BONE_ROOTSEL;
}
}
}
}
/* now we have to flush tag from parents... */
- for (ebone= arm->edbo->first; ebone; ebone= ebone->next) {
+ for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
if (ebone->parent && (ebone->flag & BONE_CONNECTED)) {
if (ebone->parent->flag & BONE_DONE)
ebone->flag |= BONE_DONE;
@@ -1928,17 +1927,17 @@ static int do_armature_box_select(ViewContext *vc, rcti *rect, short select, sho
}
/* only select/deselect entire bones when no points where in the rect */
- for (a=0; a<hits; a++) {
- int index = buffer[(4*a)+3];
- if (index!=-1) {
+ for (a = 0; a < hits; a++) {
+ int index = buffer[(4 * a) + 3];
+ if (index != -1) {
ebone = BLI_findlink(arm->edbo, index & ~(BONESEL_ANY));
if (index & BONESEL_BONE) {
- if ((ebone->flag & BONE_UNSELECTABLE)==0) {
+ if ((ebone->flag & BONE_UNSELECTABLE) == 0) {
if (!(ebone->flag & BONE_DONE)) {
if (select)
- ebone->flag |= (BONE_ROOTSEL|BONE_TIPSEL|BONE_SELECTED);
+ ebone->flag |= (BONE_ROOTSEL | BONE_TIPSEL | BONE_SELECTED);
else
- ebone->flag &= ~(BONE_ROOTSEL|BONE_TIPSEL|BONE_SELECTED);
+ ebone->flag &= ~(BONE_ROOTSEL | BONE_TIPSEL | BONE_SELECTED);
}
}
}
@@ -1953,24 +1952,24 @@ static int do_armature_box_select(ViewContext *vc, rcti *rect, short select, sho
static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, int select, int extend)
{
Bone *bone;
- Object *ob= vc->obact;
- unsigned int *vbuffer=NULL; /* selection buffer */
- unsigned int *col; /* color in buffer */
+ Object *ob = vc->obact;
+ unsigned int *vbuffer = NULL; /* selection buffer */
+ unsigned int *col; /* color in buffer */
int bone_only;
- int bone_selected=0;
- int totobj= MAXPICKBUF; // XXX solve later
+ int bone_selected = 0;
+ int totobj = MAXPICKBUF; // XXX solve later
short hits;
if ((ob) && (ob->mode & OB_MODE_POSE))
- bone_only= 1;
+ bone_only = 1;
else
- bone_only= 0;
+ bone_only = 0;
if (extend == 0 && select) {
if (bone_only) {
CTX_DATA_BEGIN(C, bPoseChannel *, pchan, visible_pose_bones) {
- if ((pchan->bone->flag & BONE_UNSELECTABLE)==0) {
- pchan->bone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
+ if ((pchan->bone->flag & BONE_UNSELECTABLE) == 0) {
+ pchan->bone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
}
}
CTX_DATA_END;
@@ -1981,44 +1980,44 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, i
}
/* selection buffer now has bones potentially too, so we add MAXPICKBUF */
- vbuffer = MEM_mallocN(4 * (totobj+MAXPICKBUF) * sizeof(unsigned int), "selection buffer");
- hits= view3d_opengl_select(vc, vbuffer, 4*(totobj+MAXPICKBUF), rect);
+ 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.
- */
-
- if (hits>0) { /* no need to loop if there's no hit */
+ * 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;
col = vbuffer + 3;
- for (base= vc->scene->base.first; base && hits; base= base->next) {
+ for (base = vc->scene->base.first; base && hits; base = base->next) {
if (BASE_SELECTABLE(vc->v3d, base)) {
- while (base->selcol == (*col & 0xFFFF)) { /* we got an object */
+ while (base->selcol == (*col & 0xFFFF)) { /* we got an object */
- if (*col & 0xFFFF0000) { /* we got a bone */
+ if (*col & 0xFFFF0000) { /* we got a bone */
bone = get_indexed_bone(base->object, *col & ~(BONESEL_ANY));
if (bone) {
if (select) {
- if ((bone->flag & BONE_UNSELECTABLE)==0) {
+ if ((bone->flag & BONE_UNSELECTABLE) == 0) {
bone->flag |= BONE_SELECTED;
- bone_selected=1;
+ bone_selected = 1;
// XXX select_actionchannel_by_name(base->object->action, bone->name, 1);
}
}
else {
- bArmature *arm= base->object->data;
+ bArmature *arm = base->object->data;
bone->flag &= ~BONE_SELECTED;
// XXX select_actionchannel_by_name(base->object->action, bone->name, 0);
- if (arm->act_bone==bone)
- arm->act_bone= NULL;
+ if (arm->act_bone == bone)
+ arm->act_bone = NULL;
}
}
@@ -2030,18 +2029,18 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, i
ED_base_object_select(base, BA_DESELECT);
}
- col+=4; /* next color */
+ col += 4; /* next color */
hits--;
- if (hits==0) break;
+ if (hits == 0) break;
}
}
if (bone_selected) {
- WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, base->object);
+ WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, base->object);
}
}
- WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, vc->scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, vc->scene);
}
MEM_freeN(vbuffer);
@@ -2056,74 +2055,74 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
short extend;
short select;
- int ret= OPERATOR_CANCELLED;
+ int ret = OPERATOR_CANCELLED;
view3d_operator_needs_opengl(C);
/* setup view context for argument to callbacks */
view3d_set_viewcontext(C, &vc);
- select= (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT);
- 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");
+ select = (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT);
+ 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");
extend = RNA_boolean_get(op->ptr, "extend");
if (vc.obedit) {
- switch(vc.obedit->type) {
- case OB_MESH:
- vc.em= ((Mesh *)vc.obedit->data)->edit_btmesh;
- ret= do_mesh_box_select(&vc, &rect, select, extend);
+ switch (vc.obedit->type) {
+ case OB_MESH:
+ vc.em = BMEdit_FromObject(vc.obedit);
+ ret = do_mesh_box_select(&vc, &rect, select, extend);
// if (EM_texFaceCheck())
- if (ret & OPERATOR_FINISHED) {
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, vc.obedit->data);
- }
- break;
- case OB_CURVE:
- case OB_SURF:
- ret= do_nurbs_box_select(&vc, &rect, select, extend);
- if (ret & OPERATOR_FINISHED) {
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, vc.obedit->data);
- }
- break;
- case OB_MBALL:
- ret= do_meta_box_select(&vc, &rect, select, extend);
- if (ret & OPERATOR_FINISHED) {
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, vc.obedit->data);
- }
- break;
- case OB_ARMATURE:
- ret= do_armature_box_select(&vc, &rect, select, extend);
- if (ret & OPERATOR_FINISHED) {
- WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, vc.obedit);
- }
- break;
- case OB_LATTICE:
- ret= do_lattice_box_select(&vc, &rect, select, extend);
- if (ret & OPERATOR_FINISHED) {
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, vc.obedit->data);
- }
- break;
- default:
- assert(!"border select on incorrect object type");
+ if (ret & OPERATOR_FINISHED) {
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit->data);
+ }
+ break;
+ case OB_CURVE:
+ case OB_SURF:
+ ret = do_nurbs_box_select(&vc, &rect, select, extend);
+ if (ret & OPERATOR_FINISHED) {
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit->data);
+ }
+ break;
+ case OB_MBALL:
+ ret = do_meta_box_select(&vc, &rect, select, extend);
+ if (ret & OPERATOR_FINISHED) {
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit->data);
+ }
+ break;
+ case OB_ARMATURE:
+ ret = do_armature_box_select(&vc, &rect, select, extend);
+ if (ret & OPERATOR_FINISHED) {
+ WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, vc.obedit);
+ }
+ break;
+ case OB_LATTICE:
+ ret = do_lattice_box_select(&vc, &rect, select, extend);
+ if (ret & OPERATOR_FINISHED) {
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit->data);
+ }
+ break;
+ default:
+ assert(!"border select on incorrect object type");
}
}
- else { /* no editmode, unified for bones and objects */
+ else { /* no editmode, unified for bones and objects */
if (vc.obact && vc.obact->mode & OB_MODE_SCULPT) {
/* pass */
}
else if (vc.obact && paint_facesel_test(vc.obact)) {
- ret= do_paintface_box_select(&vc, &rect, select, extend);
+ ret = do_paintface_box_select(&vc, &rect, select, extend);
}
else if (vc.obact && paint_vertsel_test(vc.obact)) {
- ret= do_paintvert_box_select(&vc, &rect, select, extend);
+ ret = do_paintvert_box_select(&vc, &rect, select, extend);
}
else if (vc.obact && vc.obact->mode & OB_MODE_PARTICLE_EDIT) {
- ret= PE_border_select(C, &rect, select, extend);
+ ret = PE_border_select(C, &rect, select, extend);
}
else { /* object mode with none active */
- ret= do_object_pose_box_select(C, &vc, &rect, select, extend);
+ ret = do_object_pose_box_select(C, &vc, &rect, select, extend);
}
}
@@ -2137,19 +2136,19 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
void VIEW3D_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Border Select";
- ot->description= "Select items using border selection";
- ot->idname= "VIEW3D_OT_select_border";
+ ot->name = "Border Select";
+ ot->description = "Select items using border selection";
+ ot->idname = "VIEW3D_OT_select_border";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= view3d_borderselect_exec;
- ot->modal= WM_border_select_modal;
- ot->poll= view3d_selectable_data;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = view3d_borderselect_exec;
+ ot->modal = WM_border_select_modal;
+ ot->poll = view3d_selectable_data;
+ ot->cancel = WM_border_select_cancel;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* rna */
WM_operator_properties_gesture_border(ot, TRUE);
@@ -2162,22 +2161,22 @@ static int vertsel_vert_pick(struct bContext *C, Mesh *me, const int mval[2], un
ViewContext vc;
view3d_set_viewcontext(C, &vc);
- if (!me || me->totvert==0)
+ if (!me || me->totvert == 0)
return 0;
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);
+ *index = view3d_sample_backbuf_rect(&vc, mval, size, 1, me->totvert + 1, &dist, 0, NULL, NULL);
}
else {
/* sample only on the exact position */
*index = view3d_sample_backbuf(&vc, mval[0], mval[1]);
}
- if ((*index)<=0 || (*index)>(unsigned int)me->totvert)
+ if ((*index) <= 0 || (*index) > (unsigned int)me->totvert)
return 0;
(*index)--;
@@ -2189,12 +2188,12 @@ static int vertsel_vert_pick(struct bContext *C, Mesh *me, const int mval[2], un
/* gets called via generic mouse select operator */
static int mouse_weight_paint_vertex_select(bContext *C, const int mval[2], short extend, Object *obact)
{
- Mesh* me= obact->data; /* already checked for NULL */
+ Mesh*me = obact->data; /* already checked for NULL */
unsigned int index = 0;
MVert *mv;
if (vertsel_vert_pick(C, me, mval, &index, 50)) {
- mv = me->mvert+index;
+ mv = me->mvert + index;
if (extend) {
mv->flag ^= SELECT;
}
@@ -2203,7 +2202,7 @@ static int mouse_weight_paint_vertex_select(bContext *C, const int mval[2], shor
mv->flag |= SELECT;
}
paintvert_flush_flags(obact);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obact->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obact->data);
return 1;
}
return 0;
@@ -2214,36 +2213,36 @@ static int mouse_weight_paint_vertex_select(bContext *C, const int mval[2], shor
static int view3d_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- Object *obedit= CTX_data_edit_object(C);
- Object *obact= CTX_data_active_object(C);
- short extend= RNA_boolean_get(op->ptr, "extend");
- short center= RNA_boolean_get(op->ptr, "center");
- short enumerate= RNA_boolean_get(op->ptr, "enumerate");
- short object= RNA_boolean_get(op->ptr, "object");
- int retval = 0;
+ Object *obedit = CTX_data_edit_object(C);
+ Object *obact = CTX_data_active_object(C);
+ short extend = RNA_boolean_get(op->ptr, "extend");
+ short center = RNA_boolean_get(op->ptr, "center");
+ short enumerate = RNA_boolean_get(op->ptr, "enumerate");
+ short object = RNA_boolean_get(op->ptr, "object");
+ int retval = 0;
view3d_operator_needs_opengl(C);
if (object) {
- obedit= NULL;
- obact= NULL;
+ obedit = NULL;
+ obact = NULL;
/* ack, this is incorrect but to do this correctly we would need an
* alternative editmode/objectmode keymap, this copies the functionality
* from 2.4x where Ctrl+Select in editmode does object select only */
- center= FALSE;
+ center = FALSE;
}
- if (obedit && object==FALSE) {
- if (obedit->type==OB_MESH)
+ if (obedit && object == FALSE) {
+ if (obedit->type == OB_MESH)
retval = mouse_mesh(C, event->mval, extend);
- else if (obedit->type==OB_ARMATURE)
+ else if (obedit->type == OB_ARMATURE)
retval = mouse_armature(C, event->mval, extend);
- else if (obedit->type==OB_LATTICE)
+ else if (obedit->type == OB_LATTICE)
retval = mouse_lattice(C, event->mval, extend);
else if (ELEM(obedit->type, OB_CURVE, OB_SURF))
retval = mouse_nurb(C, event->mval, extend);
- else if (obedit->type==OB_MBALL)
+ else if (obedit->type == OB_MBALL)
retval = mouse_mball(C, event->mval, extend);
}
@@ -2262,24 +2261,24 @@ static int view3d_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
* FINISHED to signal one operator worked
* */
if (retval)
- return OPERATOR_PASS_THROUGH|OPERATOR_FINISHED;
+ return OPERATOR_PASS_THROUGH | OPERATOR_FINISHED;
else
- return OPERATOR_PASS_THROUGH; /* nothing selected, just passthrough */
+ return OPERATOR_PASS_THROUGH; /* nothing selected, just passthrough */
}
void VIEW3D_OT_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Activate/Select";
- ot->description= "Activate/select item(s)";
- ot->idname= "VIEW3D_OT_select";
+ ot->name = "Activate/Select";
+ ot->description = "Activate/select item(s)";
+ ot->idname = "VIEW3D_OT_select";
/* api callbacks */
- ot->invoke= view3d_select_invoke;
- ot->poll= ED_operator_view3d_active;
+ ot->invoke = view3d_select_invoke;
+ ot->poll = ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first");
@@ -2302,9 +2301,9 @@ static void mesh_circle_doSelectVert(void *userData, BMVert *eve, int x, int y,
{
CircleSelectUserData *data = userData;
int mx = x - data->mval[0], my = y - data->mval[1];
- float r = sqrt(mx*mx + my*my);
+ float r = sqrt(mx * mx + my * my);
- if (r<=data->radius) {
+ if (r <= data->radius) {
BM_elem_select_set(data->vc->em->bm, eve, data->select);
}
}
@@ -2320,23 +2319,23 @@ static void mesh_circle_doSelectFace(void *userData, BMFace *efa, int x, int y,
{
CircleSelectUserData *data = userData;
int mx = x - data->mval[0], my = y - data->mval[1];
- float r = sqrt(mx*mx + my*my);
+ float r = sqrt(mx * mx + my * my);
- if (r<=data->radius) {
+ if (r <= data->radius) {
BM_elem_select_set(data->vc->em->bm, efa, data->select);
}
}
static void mesh_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
{
- ToolSettings *ts= vc->scene->toolsettings;
+ ToolSettings *ts = vc->scene->toolsettings;
int bbsel;
CircleSelectUserData data;
- bbsel= EDBM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0));
+ bbsel = EDBM_backbuf_circle_init(vc, mval[0], mval[1], (short)(rad + 1.0));
ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
- vc->em= ((Mesh *)vc->obedit->data)->edit_btmesh;
+ vc->em = BMEdit_FromObject(vc->obedit);
data.vc = vc;
data.select = select;
@@ -2346,7 +2345,7 @@ static void mesh_circle_select(ViewContext *vc, int select, const int mval[2], f
if (ts->selectmode & SCE_SELECT_VERTEX) {
if (bbsel) {
- EDBM_backbuf_checkAndSelectVerts(vc->em, select==LEFTMOUSE);
+ edbm_backbuf_check_and_select_verts(vc->em, select == LEFTMOUSE);
}
else {
mesh_foreachScreenVert(vc, mesh_circle_doSelectVert, &data, V3D_CLIP_TEST_RV3D_CLIPPING);
@@ -2355,7 +2354,7 @@ static void mesh_circle_select(ViewContext *vc, int select, const int mval[2], f
if (ts->selectmode & SCE_SELECT_EDGE) {
if (bbsel) {
- EDBM_backbuf_checkAndSelectEdges(vc->em, select==LEFTMOUSE);
+ edbm_backbuf_check_and_select_edges(vc->em, select == LEFTMOUSE);
}
else {
mesh_foreachScreenEdge(vc, mesh_circle_doSelectEdge, &data, V3D_CLIP_TEST_OFF);
@@ -2364,45 +2363,45 @@ static void mesh_circle_select(ViewContext *vc, int select, const int mval[2], f
if (ts->selectmode & SCE_SELECT_FACE) {
if (bbsel) {
- EDBM_backbuf_checkAndSelectFaces(vc->em, select==LEFTMOUSE);
+ edbm_backbuf_check_and_select_faces(vc->em, select == LEFTMOUSE);
}
else {
mesh_foreachScreenFace(vc, mesh_circle_doSelectFace, &data);
}
}
- EDBM_free_backbuf();
+ EDBM_backbuf_free();
EDBM_selectmode_flush(vc->em);
}
static void paint_facesel_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
{
- Object *ob= vc->obact;
- Mesh *me = ob?ob->data:NULL;
+ Object *ob = vc->obact;
+ Mesh *me = ob ? ob->data : NULL;
/* int bbsel; */ /* UNUSED */
if (me) {
- bm_vertoffs= me->totpoly+1; /* max index array */
+ bm_vertoffs = me->totpoly + 1; /* max index array */
- /* bbsel= */ /* UNUSED */ EDBM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0));
- EDBM_backbuf_checkAndSelectTFaces(me, select==LEFTMOUSE);
- EDBM_free_backbuf();
+ /* bbsel= */ /* UNUSED */ EDBM_backbuf_circle_init(vc, mval[0], mval[1], (short)(rad + 1.0));
+ edbm_backbuf_check_and_select_tfaces(me, select == LEFTMOUSE);
+ EDBM_backbuf_free();
}
}
static void paint_vertsel_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
{
- Object *ob= vc->obact;
- Mesh *me = ob?ob->data:NULL;
+ Object *ob = vc->obact;
+ Mesh *me = ob ? ob->data : NULL;
/* int bbsel; */ /* UNUSED */
/* CircleSelectUserData data = {NULL}; */ /* UNUSED */
if (me) {
- bm_vertoffs= me->totvert+1; /* max index array */
+ bm_vertoffs = me->totvert + 1; /* max index array */
- /* bbsel= */ /* UNUSED */ EDBM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0f));
- EDBM_backbuf_checkAndSelectVerts_obmode(me, select==LEFTMOUSE);
- EDBM_free_backbuf();
+ /* bbsel= */ /* UNUSED */ EDBM_backbuf_circle_init(vc, mval[0], mval[1], (short)(rad + 1.0f));
+ edbm_backbuf_check_and_select_verts_obmode(me, select == LEFTMOUSE);
+ EDBM_backbuf_free();
paintvert_flush_flags(ob);
}
@@ -2413,30 +2412,30 @@ static void nurbscurve_circle_doSelect(void *userData, Nurb *UNUSED(nu), BPoint
{
CircleSelectUserData *data = userData;
int mx = x - data->mval[0], my = y - data->mval[1];
- float r = sqrt(mx*mx + my*my);
- Object *obedit= data->vc->obedit;
- Curve *cu= (Curve*)obedit->data;
+ float r = sqrt(mx * mx + my * my);
+ Object *obedit = data->vc->obedit;
+ Curve *cu = (Curve *)obedit->data;
- if (r<=data->radius) {
+ if (r <= data->radius) {
if (bp) {
- bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
+ bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
if (bp == cu->lastsel && !(bp->f1 & 1)) cu->lastsel = NULL;
}
else {
if (cu->drawflag & CU_HIDE_HANDLES) {
/* can only be beztindex==0 here since handles are hidden */
- bezt->f1 = bezt->f2 = bezt->f3 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT);
+ bezt->f1 = bezt->f2 = bezt->f3 = data->select ? (bezt->f2 | SELECT) : (bezt->f2 & ~SELECT);
}
else {
- if (beztindex==0) {
- bezt->f1 = data->select?(bezt->f1|SELECT):(bezt->f1&~SELECT);
+ if (beztindex == 0) {
+ bezt->f1 = data->select ? (bezt->f1 | SELECT) : (bezt->f1 & ~SELECT);
}
- else if (beztindex==1) {
- bezt->f2 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT);
+ else if (beztindex == 1) {
+ bezt->f2 = data->select ? (bezt->f2 | SELECT) : (bezt->f2 & ~SELECT);
}
else {
- bezt->f3 = data->select?(bezt->f3|SELECT):(bezt->f3&~SELECT);
+ bezt->f3 = data->select ? (bezt->f3 | SELECT) : (bezt->f3 & ~SELECT);
}
}
@@ -2465,10 +2464,10 @@ static void latticecurve_circle_doSelect(void *userData, BPoint *bp, int x, int
{
CircleSelectUserData *data = userData;
int mx = x - data->mval[0], my = y - data->mval[1];
- float r = sqrt(mx*mx + my*my);
+ float r = sqrt(mx * mx + my * my);
- if (r<=data->radius) {
- bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
+ if (r <= data->radius) {
+ bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
}
}
static void lattice_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
@@ -2492,7 +2491,7 @@ static short pchan_circle_doSelectJoint(void *userData, bPoseChannel *pchan, int
{
CircleSelectUserData *data = userData;
int mx = x - data->mval[0], my = y - data->mval[1];
- float r = sqrt(mx*mx + my*my);
+ float r = sqrt(mx * mx + my * my);
if (r <= data->radius) {
if (data->select)
@@ -2509,7 +2508,7 @@ static void pose_circle_select(ViewContext *vc, int select, const int mval[2], f
bArmature *arm = vc->obact->data;
bPose *pose = vc->obact->pose;
bPoseChannel *pchan;
- int change= FALSE;
+ int change = FALSE;
/* set vc->edit data */
data.select = select;
@@ -2520,9 +2519,9 @@ 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;
+ short sco1[2], sco2[2], didpoint = 0;
float vec[3];
/* skip invisible bones */
@@ -2541,15 +2540,15 @@ static void pose_circle_select(ViewContext *vc, int select, const int mval[2], f
* - the call to check also does the selection already
*/
if (pchan_circle_doSelectJoint(&data, pchan, sco1[0], sco1[1]))
- didpoint= 1;
+ didpoint = 1;
if (pchan_circle_doSelectJoint(&data, pchan, sco2[0], sco2[1]))
- didpoint= 1;
+ didpoint = 1;
change |= didpoint;
}
if (change) {
- WM_main_add_notifier(NC_OBJECT|ND_BONE_SELECT, vc->obact);
+ WM_main_add_notifier(NC_OBJECT | ND_BONE_SELECT, vc->obact);
}
}
@@ -2557,7 +2556,7 @@ static short armature_circle_doSelectJoint(void *userData, EditBone *ebone, int
{
CircleSelectUserData *data = userData;
int mx = x - data->mval[0], my = y - data->mval[1];
- float r = sqrt(mx*mx + my*my);
+ float r = sqrt(mx * mx + my * my);
if (r <= data->radius) {
if (head) {
@@ -2579,9 +2578,9 @@ static short armature_circle_doSelectJoint(void *userData, EditBone *ebone, int
static void armature_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
{
CircleSelectUserData data;
- bArmature *arm= vc->obedit->data;
+ bArmature *arm = vc->obedit->data;
EditBone *ebone;
- int change= FALSE;
+ int change = FALSE;
/* set vc->edit data */
data.select = select;
@@ -2592,9 +2591,9 @@ 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
- for (ebone= arm->edbo->first; ebone; ebone=ebone->next) {
- short sco1[2], sco2[2], didpoint=0;
+ // 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];
/* project head location to screenspace */
@@ -2609,18 +2608,18 @@ static void armature_circle_select(ViewContext *vc, int select, const int mval[2
* - the call to check also does the selection already
*/
if (armature_circle_doSelectJoint(&data, ebone, sco1[0], sco1[1], 1))
- didpoint= 1;
+ didpoint = 1;
if (armature_circle_doSelectJoint(&data, ebone, sco2[0], sco2[1], 0))
- didpoint= 1;
+ didpoint = 1;
/* only if the endpoints didn't get selected, deal with the middle of the bone too */
// XXX should we just do this always?
- if ( (didpoint==0) && edge_inside_circle(mval[0], mval[1], rad, sco1[0], sco1[1], sco2[0], sco2[1]) ) {
+ if ( (didpoint == 0) && edge_inside_circle(mval[0], mval[1], rad, sco1[0], sco1[1], sco2[0], sco2[1]) ) {
if (select)
- ebone->flag |= BONE_TIPSEL|BONE_ROOTSEL|BONE_SELECTED;
+ ebone->flag |= BONE_TIPSEL | BONE_ROOTSEL | BONE_SELECTED;
else
- ebone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
- change= TRUE;
+ ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
+ change = TRUE;
}
change |= didpoint;
@@ -2629,7 +2628,7 @@ static void armature_circle_select(ViewContext *vc, int select, const int mval[2
if (change) {
ED_armature_sync_selection(arm->edbo);
ED_armature_validate_active(arm);
- WM_main_add_notifier(NC_OBJECT|ND_BONE_SELECT, vc->obedit);
+ WM_main_add_notifier(NC_OBJECT | ND_BONE_SELECT, vc->obedit);
}
}
@@ -2637,43 +2636,43 @@ static void armature_circle_select(ViewContext *vc, int select, const int mval[2
static void obedit_circle_select(ViewContext *vc, short select, const int mval[2], float rad)
{
- switch(vc->obedit->type) {
- case OB_MESH:
- mesh_circle_select(vc, select, mval, rad);
- break;
- case OB_CURVE:
- case OB_SURF:
- nurbscurve_circle_select(vc, select, mval, rad);
- break;
- case OB_LATTICE:
- lattice_circle_select(vc, select, mval, rad);
- break;
- case OB_ARMATURE:
- armature_circle_select(vc, select, mval, rad);
- break;
- default:
- return;
+ switch (vc->obedit->type) {
+ case OB_MESH:
+ mesh_circle_select(vc, select, mval, rad);
+ break;
+ case OB_CURVE:
+ case OB_SURF:
+ nurbscurve_circle_select(vc, select, mval, rad);
+ break;
+ case OB_LATTICE:
+ lattice_circle_select(vc, select, mval, rad);
+ break;
+ case OB_ARMATURE:
+ armature_circle_select(vc, select, mval, rad);
+ break;
+ default:
+ return;
}
}
/* not a real operator, only for circle test */
static int view3d_circle_select_exec(bContext *C, wmOperator *op)
{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= CTX_wm_region(C);
- Scene *scene= CTX_data_scene(C);
- Object *obact= CTX_data_active_object(C);
- View3D *v3d= sa->spacedata.first;
- int x= RNA_int_get(op->ptr, "x");
- int y= RNA_int_get(op->ptr, "y");
- int radius= RNA_int_get(op->ptr, "radius");
- int gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = CTX_wm_region(C);
+ Scene *scene = CTX_data_scene(C);
+ Object *obact = CTX_data_active_object(C);
+ View3D *v3d = sa->spacedata.first;
+ int x = RNA_int_get(op->ptr, "x");
+ int y = RNA_int_get(op->ptr, "y");
+ int radius = RNA_int_get(op->ptr, "radius");
+ int gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
int select;
- select= (gesture_mode==GESTURE_MODAL_SELECT);
+ select = (gesture_mode == GESTURE_MODAL_SELECT);
- if ( CTX_data_edit_object(C) || paint_facesel_test(obact) || paint_vertsel_test(obact) ||
- (obact && (obact->mode & (OB_MODE_PARTICLE_EDIT|OB_MODE_POSE))) )
+ if (CTX_data_edit_object(C) || paint_facesel_test(obact) || paint_vertsel_test(obact) ||
+ (obact && (obact->mode & (OB_MODE_PARTICLE_EDIT | OB_MODE_POSE))) )
{
ViewContext vc;
int mval[2];
@@ -2681,20 +2680,20 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
view3d_operator_needs_opengl(C);
view3d_set_viewcontext(C, &vc);
- mval[0]= x;
- mval[1]= y;
+ mval[0] = x;
+ mval[1] = y;
if (CTX_data_edit_object(C)) {
obedit_circle_select(&vc, select, mval, (float)radius);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obact->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obact->data);
}
else if (paint_facesel_test(obact)) {
paint_facesel_circle_select(&vc, select, mval, (float)radius);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obact->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obact->data);
}
else if (paint_vertsel_test(obact)) {
paint_vertsel_circle_select(&vc, select, mval, (float)radius);
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obact->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obact->data);
}
else if (obact->mode & OB_MODE_POSE)
pose_circle_select(&vc, select, mval, (float)radius);
@@ -2706,20 +2705,20 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
}
else {
Base *base;
- select= select?BA_SELECT:BA_DESELECT;
- for (base= FIRSTBASE; base; base= base->next) {
+ select = select ? BA_SELECT : BA_DESELECT;
+ for (base = FIRSTBASE; base; base = base->next) {
if (BASE_SELECTABLE(v3d, base)) {
project_short(ar, base->object->obmat[3], &base->sx);
- if (base->sx!=IS_CLIPPED) {
- int dx= base->sx-x;
- int dy= base->sy-y;
- if ( dx*dx + dy*dy < radius*radius)
+ if (base->sx != IS_CLIPPED) {
+ int dx = base->sx - x;
+ int dy = base->sy - y;
+ if (dx * dx + dy * dy < radius * radius)
ED_base_object_select(base, select);
}
}
}
- WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, CTX_data_scene(C));
}
return OPERATOR_FINISHED;
@@ -2727,18 +2726,18 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
void VIEW3D_OT_select_circle(wmOperatorType *ot)
{
- ot->name= "Circle Select";
- ot->description= "Select items using circle selection";
- ot->idname= "VIEW3D_OT_select_circle";
+ ot->name = "Circle Select";
+ ot->description = "Select items using circle selection";
+ ot->idname = "VIEW3D_OT_select_circle";
- ot->invoke= WM_gesture_circle_invoke;
- ot->modal= WM_gesture_circle_modal;
- ot->exec= view3d_circle_select_exec;
- ot->poll= view3d_selectable_data;
- ot->cancel= WM_gesture_circle_cancel;
+ ot->invoke = WM_gesture_circle_invoke;
+ ot->modal = WM_gesture_circle_modal;
+ ot->exec = view3d_circle_select_exec;
+ ot->poll = view3d_selectable_data;
+ ot->cancel = WM_gesture_circle_cancel;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
RNA_def_int(ot->srna, "x", 0, INT_MIN, INT_MAX, "X", "", INT_MIN, INT_MAX);
RNA_def_int(ot->srna, "y", 0, INT_MIN, INT_MAX, "Y", "", INT_MIN, INT_MAX);
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index 3f49df88ff8..ac94accf991 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -73,7 +73,7 @@
#include "view3d_intern.h"
-extern float originmat[3][3]; /* XXX object.c */
+extern float originmat[3][3]; /* XXX object.c */
/* ************************************************** */
/* ********************* old transform stuff ******** */
@@ -91,8 +91,8 @@ typedef struct TransVert {
/* SELECT == (1 << 0) */
#define TX_VERT_USE_MAPLOC (1 << 1)
-static TransVert *transvmain=NULL;
-static int tottrans= 0;
+static TransVert *transvmain = NULL;
+static int tottrans = 0;
/* copied from editobject.c, now uses (almost) proper depgraph */
static void special_transvert_update(Object *obedit)
@@ -100,21 +100,21 @@ static void special_transvert_update(Object *obedit)
if (obedit) {
DAG_id_tag_update(obedit->data, 0);
- if (obedit->type==OB_MESH) {
- Mesh *me= obedit->data;
- BM_mesh_normals_update(me->edit_btmesh->bm, TRUE); // does face centers too
+ if (obedit->type == OB_MESH) {
+ Mesh *me = obedit->data;
+ BM_mesh_normals_update(me->edit_btmesh->bm, TRUE); // does face centers too
}
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
- Curve *cu= obedit->data;
- ListBase *nurbs= curve_editnurbs(cu);
- Nurb *nu= nurbs->first;
+ Curve *cu = obedit->data;
+ ListBase *nurbs = curve_editnurbs(cu);
+ Nurb *nu = nurbs->first;
while (nu) {
/* keep handles' vectors unchanged */
if (nu->bezt) {
- int a= nu->pntsu;
- TransVert *tv= transvmain;
- BezTriple *bezt= nu->bezt;
+ int a = nu->pntsu;
+ TransVert *tv = transvmain;
+ BezTriple *bezt = nu->bezt;
while (a--) {
if (bezt->f1 & SELECT) tv++;
@@ -123,12 +123,12 @@ static void special_transvert_update(Object *obedit)
float v[3];
if (bezt->f1 & SELECT) {
- sub_v3_v3v3(v, (tv-1)->oldloc, tv->oldloc);
+ sub_v3_v3v3(v, (tv - 1)->oldloc, tv->oldloc);
add_v3_v3v3(bezt->vec[0], bezt->vec[1], v);
}
if (bezt->f3 & SELECT) {
- sub_v3_v3v3(v, (tv+1)->oldloc, tv->oldloc);
+ sub_v3_v3v3(v, (tv + 1)->oldloc, tv->oldloc);
add_v3_v3v3(bezt->vec[2], bezt->vec[1], v);
}
@@ -143,17 +143,17 @@ static void special_transvert_update(Object *obedit)
test2DNurb(nu);
testhandlesNurb(nu); /* test for bezier too */
- nu= nu->next;
+ nu = nu->next;
}
}
- else if (obedit->type==OB_ARMATURE) {
- bArmature *arm= obedit->data;
+ else if (obedit->type == OB_ARMATURE) {
+ bArmature *arm = obedit->data;
EditBone *ebo;
- TransVert *tv= transvmain;
- int a=0;
+ TransVert *tv = transvmain;
+ int a = 0;
/* Ensure all bone tails are correctly adjusted */
- for (ebo= arm->edbo->first; ebo; ebo=ebo->next) {
+ for (ebo = arm->edbo->first; ebo; ebo = ebo->next) {
/* adjust tip if both ends selected */
if ((ebo->flag & BONE_ROOTSEL) && (ebo->flag & BONE_TIPSEL)) {
if (tv) {
@@ -163,20 +163,20 @@ static void special_transvert_update(Object *obedit)
add_v3_v3(ebo->tail, diffvec);
a++;
- if (a<tottrans) tv++;
+ if (a < tottrans) tv++;
}
}
}
/* Ensure all bones are correctly adjusted */
- for (ebo= arm->edbo->first; ebo; ebo=ebo->next) {
+ for (ebo = arm->edbo->first; ebo; ebo = ebo->next) {
if ((ebo->flag & BONE_CONNECTED) && ebo->parent) {
/* If this bone has a parent tip that has been moved */
if (ebo->parent->flag & BONE_TIPSEL) {
copy_v3_v3(ebo->head, ebo->parent->tail);
}
/* If this bone has a parent tip that has NOT been moved */
- else{
+ else {
copy_v3_v3(ebo->parent->tail, ebo->head);
}
}
@@ -184,8 +184,8 @@ static void special_transvert_update(Object *obedit)
if (arm->flag & ARM_MIRROR_EDIT)
transform_armature_mirror_update(obedit);
}
- else if (obedit->type==OB_LATTICE) {
- Lattice *lt= obedit->data;
+ else if (obedit->type == OB_LATTICE) {
+ Lattice *lt = obedit->data;
if (lt->editlatt->latt->flag & LT_OUTSIDE)
outside_lattice(lt->editlatt->latt);
@@ -195,10 +195,10 @@ static void special_transvert_update(Object *obedit)
static void set_mapped_co(void *vuserdata, int index, float *co, float *UNUSED(no), short *UNUSED(no_s))
{
- void ** userdata = vuserdata;
+ void **userdata = vuserdata;
BMEditMesh *em = userdata[0];
TransVert *tv = userdata[1];
- BMVert *eve = EDBM_get_vert_for_index(em, index);
+ BMVert *eve = EDBM_vert_at_index(em, index);
if (BM_elem_index_get(eve) != -1 && !(tv[BM_elem_index_get(eve)].flag & TX_VERT_USE_MAPLOC)) {
copy_v3_v3(tv[BM_elem_index_get(eve)].maploc, co);
@@ -208,28 +208,28 @@ static void set_mapped_co(void *vuserdata, int index, float *co, float *UNUSED(n
/* copied from editobject.c, needs to be replaced with new transform code still */
/* mode flags: */
-#define TM_ALL_JOINTS 1 /* all joints (for bones only) */
-#define TM_SKIP_HANDLES 2 /* skip handles when control point is selected (for curves only) */
+#define TM_ALL_JOINTS 1 /* all joints (for bones only) */
+#define TM_SKIP_HANDLES 2 /* skip handles when control point is selected (for curves only) */
static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
{
Nurb *nu;
BezTriple *bezt;
BPoint *bp;
- TransVert *tv=NULL;
+ TransVert *tv = NULL;
MetaElem *ml;
BMVert *eve;
- EditBone *ebo;
+ EditBone *ebo;
float total, center[3], centroid[3];
int a;
- tottrans= 0; // global!
+ tottrans = 0; // global!
INIT_MINMAX(min, max);
- centroid[0]=centroid[1]=centroid[2]= 0.0;
+ zero_v3(centroid);
- if (obedit->type==OB_MESH) {
- Mesh *me= obedit->data;
- BMEditMesh *em= me->edit_btmesh;
+ if (obedit->type == OB_MESH) {
+ Mesh *me = obedit->data;
+ BMEditMesh *em = me->edit_btmesh;
BMesh *bm = em->bm;
BMIter iter;
void *userdata[2] = {em, NULL};
@@ -239,21 +239,22 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
* perhaps this could use its own array instead? - campbell */
// transform now requires awareness for select mode, so we tag the f1 flags in verts
- tottrans= 0;
+ tottrans = 0;
if (em->selectmode & SCE_SELECT_VERTEX) {
BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN) && BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
BM_elem_index_set(eve, 1); /* set_dirty! */
tottrans++;
}
- else BM_elem_index_set(eve, 0); /* set_dirty! */
+ else BM_elem_index_set(eve, 0); /* set_dirty! */
}
}
else if (em->selectmode & SCE_SELECT_EDGE) {
BMEdge *eed;
- BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL)
- BM_elem_index_set(eve, 0); /* set_dirty! */
+ BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ BM_elem_index_set(eve, 0); /* set_dirty! */
+ }
BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
@@ -262,14 +263,16 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
}
}
- BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL)
+ BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
if (BM_elem_index_get(eve)) tottrans++;
+ }
}
else {
BMFace *efa;
- BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL)
+ BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
BM_elem_index_set(eve, 0); /* set_dirty! */
+ }
BM_ITER(efa, &iter, bm, BM_FACES_OF_MESH, NULL) {
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
@@ -285,22 +288,22 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL)
if (BM_elem_index_get(eve)) tottrans++;
}
- /* for any of the 3 loops above which all dirty the indicies */
+ /* for any of the 3 loops above which all dirty the indices */
bm->elem_index_dirty |= BM_VERT;
/* and now make transverts */
if (tottrans) {
- tv=transvmain= MEM_callocN(tottrans*sizeof(TransVert), "maketransverts");
+ tv = transvmain = MEM_callocN(tottrans * sizeof(TransVert), "maketransverts");
a = 0;
BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
if (BM_elem_index_get(eve)) {
BM_elem_index_set(eve, a); /* set_dirty! */
copy_v3_v3(tv->oldloc, eve->co);
- tv->loc= eve->co;
- if (eve->no[0] != 0.0f || eve->no[1] != 0.0f ||eve->no[2] != 0.0f)
- tv->nor= eve->no; // note this is a hackish signal (ton)
- tv->flag= BM_elem_index_get(eve) & SELECT;
+ tv->loc = eve->co;
+ if (eve->no[0] != 0.0f || eve->no[1] != 0.0f || eve->no[2] != 0.0f)
+ tv->nor = eve->no; // note this is a hackish signal (ton)
+ tv->flag = BM_elem_index_get(eve) & SELECT;
tv++;
a++;
}
@@ -314,24 +317,24 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
}
if (transvmain && em->derivedCage) {
- EDBM_init_index_arrays(em, 1, 0, 0);
+ EDBM_index_arrays_init(em, 1, 0, 0);
em->derivedCage->foreachMappedVert(em->derivedCage, set_mapped_co, userdata);
- EDBM_free_index_arrays(em);
+ EDBM_index_arrays_free(em);
}
}
- else if (obedit->type==OB_ARMATURE) {
- bArmature *arm= obedit->data;
- int totmalloc= BLI_countlist(arm->edbo);
+ else if (obedit->type == OB_ARMATURE) {
+ bArmature *arm = obedit->data;
+ int totmalloc = BLI_countlist(arm->edbo);
totmalloc *= 2; /* probably overkill but bones can have 2 trans verts each */
- tv=transvmain= MEM_callocN(totmalloc*sizeof(TransVert), "maketransverts armature");
+ tv = transvmain = MEM_callocN(totmalloc * sizeof(TransVert), "maketransverts armature");
- for (ebo= arm->edbo->first; ebo; ebo=ebo->next) {
+ for (ebo = arm->edbo->first; ebo; ebo = ebo->next) {
if (ebo->layer & arm->layer) {
- short tipsel= (ebo->flag & BONE_TIPSEL);
- short rootsel= (ebo->flag & BONE_ROOTSEL);
- short rootok= (!(ebo->parent && (ebo->flag & BONE_CONNECTED) && ebo->parent->flag & BONE_TIPSEL));
+ short tipsel = (ebo->flag & BONE_TIPSEL);
+ short rootsel = (ebo->flag & BONE_ROOTSEL);
+ short rootok = (!(ebo->parent && (ebo->flag & BONE_CONNECTED) && (ebo->parent->flag & BONE_TIPSEL)));
if ((tipsel && rootsel) || (rootsel)) {
/* Don't add the tip (unless mode & TM_ALL_JOINTS, for getting all joints),
@@ -340,27 +343,27 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
*/
if (rootok) {
copy_v3_v3(tv->oldloc, ebo->head);
- tv->loc= ebo->head;
- tv->nor= NULL;
- tv->flag= 1;
+ tv->loc = ebo->head;
+ tv->nor = NULL;
+ tv->flag = 1;
tv++;
tottrans++;
}
if ((mode & TM_ALL_JOINTS) && (tipsel)) {
copy_v3_v3(tv->oldloc, ebo->tail);
- tv->loc= ebo->tail;
- tv->nor= NULL;
- tv->flag= 1;
+ tv->loc = ebo->tail;
+ tv->nor = NULL;
+ tv->flag = 1;
tv++;
tottrans++;
}
}
else if (tipsel) {
copy_v3_v3(tv->oldloc, ebo->tail);
- tv->loc= ebo->tail;
- tv->nor= NULL;
- tv->flag= 1;
+ tv->loc = ebo->tail;
+ tv->nor = NULL;
+ tv->flag = 1;
tv++;
tottrans++;
}
@@ -368,49 +371,49 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
}
}
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
- Curve *cu= obedit->data;
- int totmalloc= 0;
- ListBase *nurbs= curve_editnurbs(cu);
+ Curve *cu = obedit->data;
+ int totmalloc = 0;
+ ListBase *nurbs = curve_editnurbs(cu);
- for (nu= nurbs->first; nu; nu= nu->next) {
+ for (nu = nurbs->first; nu; nu = nu->next) {
if (nu->type == CU_BEZIER)
- totmalloc += 3*nu->pntsu;
+ totmalloc += 3 * nu->pntsu;
else
- totmalloc += nu->pntsu*nu->pntsv;
+ totmalloc += nu->pntsu * nu->pntsv;
}
- tv=transvmain= MEM_callocN(totmalloc*sizeof(TransVert), "maketransverts curve");
+ tv = transvmain = MEM_callocN(totmalloc * sizeof(TransVert), "maketransverts curve");
- nu= nurbs->first;
+ nu = nurbs->first;
while (nu) {
if (nu->type == CU_BEZIER) {
- a= nu->pntsu;
- bezt= nu->bezt;
+ a = nu->pntsu;
+ bezt = nu->bezt;
while (a--) {
- if (bezt->hide==0) {
- int skip_handle= 0;
+ if (bezt->hide == 0) {
+ int skip_handle = 0;
if (bezt->f2 & SELECT)
- skip_handle= mode & TM_SKIP_HANDLES;
+ skip_handle = mode & TM_SKIP_HANDLES;
if ((bezt->f1 & SELECT) && !skip_handle) {
copy_v3_v3(tv->oldloc, bezt->vec[0]);
- tv->loc= bezt->vec[0];
- tv->flag= bezt->f1 & SELECT;
+ tv->loc = bezt->vec[0];
+ tv->flag = bezt->f1 & SELECT;
tv++;
tottrans++;
}
if (bezt->f2 & SELECT) {
copy_v3_v3(tv->oldloc, bezt->vec[1]);
- tv->loc= bezt->vec[1];
- tv->val= &(bezt->alfa);
- tv->oldval= bezt->alfa;
- tv->flag= bezt->f2 & SELECT;
+ tv->loc = bezt->vec[1];
+ tv->val = &(bezt->alfa);
+ tv->oldval = bezt->alfa;
+ tv->flag = bezt->f2 & SELECT;
tv++;
tottrans++;
}
if ((bezt->f3 & SELECT) && !skip_handle) {
copy_v3_v3(tv->oldloc, bezt->vec[2]);
- tv->loc= bezt->vec[2];
- tv->flag= bezt->f3 & SELECT;
+ tv->loc = bezt->vec[2];
+ tv->flag = bezt->f3 & SELECT;
tv++;
tottrans++;
}
@@ -419,16 +422,16 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
}
}
else {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
+ a = nu->pntsu * nu->pntsv;
+ bp = nu->bp;
while (a--) {
- if (bp->hide==0) {
+ if (bp->hide == 0) {
if (bp->f1 & SELECT) {
copy_v3_v3(tv->oldloc, bp->vec);
- tv->loc= bp->vec;
- tv->val= &(bp->alfa);
- tv->oldval= bp->alfa;
- tv->flag= bp->f1 & SELECT;
+ tv->loc = bp->vec;
+ tv->val = &(bp->alfa);
+ tv->oldval = bp->alfa;
+ tv->flag = bp->f1 & SELECT;
tv++;
tottrans++;
}
@@ -436,44 +439,44 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
bp++;
}
}
- nu= nu->next;
+ nu = nu->next;
}
}
- else if (obedit->type==OB_MBALL) {
- MetaBall *mb= obedit->data;
- int totmalloc= BLI_countlist(mb->editelems);
+ else if (obedit->type == OB_MBALL) {
+ MetaBall *mb = obedit->data;
+ int totmalloc = BLI_countlist(mb->editelems);
- tv=transvmain= MEM_callocN(totmalloc*sizeof(TransVert), "maketransverts mball");
+ tv = transvmain = MEM_callocN(totmalloc * sizeof(TransVert), "maketransverts mball");
- ml= mb->editelems->first;
+ ml = mb->editelems->first;
while (ml) {
if (ml->flag & SELECT) {
- tv->loc= &ml->x;
+ tv->loc = &ml->x;
copy_v3_v3(tv->oldloc, tv->loc);
- tv->val= &(ml->rad);
- tv->oldval= ml->rad;
- tv->flag= 1;
+ tv->val = &(ml->rad);
+ tv->oldval = ml->rad;
+ tv->flag = 1;
tv++;
tottrans++;
}
- ml= ml->next;
+ ml = ml->next;
}
}
- else if (obedit->type==OB_LATTICE) {
- Lattice *lt= obedit->data;
+ else if (obedit->type == OB_LATTICE) {
+ Lattice *lt = obedit->data;
- bp= lt->editlatt->latt->def;
+ bp = lt->editlatt->latt->def;
- a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
+ a = lt->editlatt->latt->pntsu * lt->editlatt->latt->pntsv * lt->editlatt->latt->pntsw;
- tv=transvmain= MEM_callocN(a*sizeof(TransVert), "maketransverts latt");
+ tv = transvmain = MEM_callocN(a * sizeof(TransVert), "maketransverts latt");
while (a--) {
if (bp->f1 & SELECT) {
- if (bp->hide==0) {
+ if (bp->hide == 0) {
copy_v3_v3(tv->oldloc, bp->vec);
- tv->loc= bp->vec;
- tv->flag= bp->f1 & SELECT;
+ tv->loc = bp->vec;
+ tv->flag = bp->f1 & SELECT;
tv++;
tottrans++;
}
@@ -486,13 +489,13 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
/* prevent memory leak. happens for curves/latticies due to */
/* difficult condition of adding points to trans data */
MEM_freeN(transvmain);
- transvmain= NULL;
+ transvmain = NULL;
}
/* cent etc */
- tv= transvmain;
- total= 0.0;
- for (a=0; a<tottrans; a++, tv++) {
+ tv = transvmain;
+ total = 0.0;
+ for (a = 0; a < tottrans; a++, tv++) {
if (tv->flag & SELECT) {
add_v3_v3(centroid, tv->oldloc);
total += 1.0f;
@@ -500,7 +503,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
}
}
if (total != 0.0f) {
- mul_v3_fl(centroid, 1.0f/total);
+ mul_v3_fl(centroid, 1.0f / total);
}
mid_v3_v3v3(center, min, max);
@@ -510,34 +513,34 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
{
- Main *bmain= CTX_data_main(C);
- Object *obedit= CTX_data_edit_object(C);
- Scene *scene= CTX_data_scene(C);
- RegionView3D *rv3d= CTX_wm_region_data(C);
+ Main *bmain = CTX_data_main(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Scene *scene = CTX_data_scene(C);
+ RegionView3D *rv3d = CTX_wm_region_data(C);
TransVert *tv;
float gridf, imat[3][3], bmat[3][3], vec[3];
int a;
- gridf= rv3d->gridview;
+ gridf = rv3d->gridview;
if (obedit) {
- tottrans= 0;
+ tottrans = 0;
- if ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)
+ if (ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL))
make_trans_verts(obedit, bmat[0], bmat[1], 0);
- if (tottrans==0) return OPERATOR_CANCELLED;
+ if (tottrans == 0) return OPERATOR_CANCELLED;
copy_m3_m4(bmat, obedit->obmat);
invert_m3_m3(imat, bmat);
- tv= transvmain;
- for (a=0; a<tottrans; a++, tv++) {
+ tv = transvmain;
+ for (a = 0; a < tottrans; a++, tv++) {
copy_v3_v3(vec, tv->loc);
mul_m3_v3(bmat, vec);
add_v3_v3(vec, obedit->obmat[3]);
- vec[0]= gridf*floorf(0.5f+ vec[0]/gridf);
- vec[1]= gridf*floorf(0.5f+ vec[1]/gridf);
- vec[2]= gridf*floorf(0.5f+ vec[2]/gridf);
+ vec[0] = gridf * floorf(0.5f + vec[0] / gridf);
+ vec[1] = gridf * floorf(0.5f + vec[1] / gridf);
+ vec[2] = gridf * floorf(0.5f + vec[2] / gridf);
sub_v3_v3(vec, obedit->obmat[3]);
mul_m3_v3(imat, vec);
@@ -547,31 +550,31 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
special_transvert_update(obedit);
MEM_freeN(transvmain);
- transvmain= NULL;
+ transvmain = NULL;
}
else {
struct KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_LOCATION_ID);
- CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
+ CTX_DATA_BEGIN(C, Object *, ob, selected_editable_objects) {
if (ob->mode & OB_MODE_POSE) {
bPoseChannel *pchan;
- bArmature *arm= ob->data;
+ bArmature *arm = ob->data;
invert_m4_m4(ob->imat, ob->obmat);
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
if (pchan->bone->flag & BONE_SELECTED) {
if (pchan->bone->layer & arm->layer) {
- if ((pchan->bone->flag & BONE_CONNECTED)==0) {
+ if ((pchan->bone->flag & BONE_CONNECTED) == 0) {
float nLoc[3];
/* get nearest grid point to snap to */
copy_v3_v3(nLoc, pchan->pose_mat[3]);
/* We must operate in world space! */
mul_m4_v3(ob->obmat, nLoc);
- vec[0]= gridf * (float)(floor(0.5f+ nLoc[0]/gridf));
- vec[1]= gridf * (float)(floor(0.5f+ nLoc[1]/gridf));
- vec[2]= gridf * (float)(floor(0.5f+ nLoc[2]/gridf));
+ vec[0] = gridf * (float)(floor(0.5f + nLoc[0] / gridf));
+ vec[1] = gridf * (float)(floor(0.5f + nLoc[1] / gridf));
+ vec[2] = gridf * (float)(floor(0.5f + nLoc[2] / gridf));
/* Back in object space... */
mul_m4_v3(ob->imat, vec);
@@ -579,12 +582,12 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
armature_loc_pose_to_bone(pchan, vec, vec);
/* adjust location */
- if ((pchan->protectflag & OB_LOCK_LOCX)==0)
- pchan->loc[0]= vec[0];
- if ((pchan->protectflag & OB_LOCK_LOCY)==0)
- pchan->loc[1]= vec[1];
- if ((pchan->protectflag & OB_LOCK_LOCZ)==0)
- pchan->loc[2]= vec[2];
+ if ((pchan->protectflag & OB_LOCK_LOCX) == 0)
+ pchan->loc[0] = vec[0];
+ if ((pchan->protectflag & OB_LOCK_LOCY) == 0)
+ pchan->loc[1] = vec[1];
+ if ((pchan->protectflag & OB_LOCK_LOCZ) == 0)
+ pchan->loc[2] = vec[2];
/* auto-keyframing */
ED_autokeyframe_pchan(C, scene, ob, pchan, ks);
@@ -595,16 +598,16 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
}
}
}
- ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
+ ob->pose->flag |= (POSE_LOCKED | POSE_DO_UNLOCK);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
else {
ob->recalc |= OB_RECALC_OB;
- vec[0]= -ob->obmat[3][0]+gridf*floorf(0.5f+ ob->obmat[3][0]/gridf);
- vec[1]= -ob->obmat[3][1]+gridf*floorf(0.5f+ ob->obmat[3][1]/gridf);
- vec[2]= -ob->obmat[3][2]+gridf*floorf(0.5f+ ob->obmat[3][2]/gridf);
+ vec[0] = -ob->obmat[3][0] + gridf *floorf(0.5f + ob->obmat[3][0] / gridf);
+ vec[1] = -ob->obmat[3][1] + gridf *floorf(0.5f + ob->obmat[3][1] / gridf);
+ vec[2] = -ob->obmat[3][2] + gridf *floorf(0.5f + ob->obmat[3][2] / gridf);
if (ob->parent) {
where_is_object(scene, ob);
@@ -612,12 +615,12 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
invert_m3_m3(imat, originmat);
mul_m3_v3(imat, vec);
}
- if ((ob->protectflag & OB_LOCK_LOCX)==0)
- ob->loc[0]+= vec[0];
- if ((ob->protectflag & OB_LOCK_LOCY)==0)
- ob->loc[1]+= vec[1];
- if ((ob->protectflag & OB_LOCK_LOCZ)==0)
- ob->loc[2]+= vec[2];
+ if ((ob->protectflag & OB_LOCK_LOCX) == 0)
+ ob->loc[0] += vec[0];
+ if ((ob->protectflag & OB_LOCK_LOCY) == 0)
+ ob->loc[1] += vec[1];
+ if ((ob->protectflag & OB_LOCK_LOCZ) == 0)
+ ob->loc[2] += vec[2];
/* auto-keyframing */
ED_autokeyframe_object(C, scene, ob, ks);
@@ -627,7 +630,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
}
DAG_ids_flush_update(bmain, 0);
- WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
+ WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
return OPERATOR_FINISHED;
}
@@ -635,44 +638,44 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
void VIEW3D_OT_snap_selected_to_grid(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Snap Selection to Grid";
- ot->description= "Snap selected item(s) to nearest grid node";
- ot->idname= "VIEW3D_OT_snap_selected_to_grid";
+ ot->name = "Snap Selection to Grid";
+ ot->description = "Snap selected item(s) to nearest grid node";
+ ot->idname = "VIEW3D_OT_snap_selected_to_grid";
/* api callbacks */
- ot->exec= snap_sel_to_grid;
- ot->poll= ED_operator_region_view3d_active;
+ ot->exec = snap_sel_to_grid;
+ ot->poll = ED_operator_region_view3d_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* *************************************************** */
static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
{
- Main *bmain= CTX_data_main(C);
- Object *obedit= CTX_data_edit_object(C);
- Scene *scene= CTX_data_scene(C);
- View3D *v3d= CTX_wm_view3d(C);
+ Main *bmain = CTX_data_main(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Scene *scene = CTX_data_scene(C);
+ View3D *v3d = CTX_wm_view3d(C);
TransVert *tv;
float *curs, imat[3][3], bmat[3][3], vec[3];
int a;
- curs= give_cursor(scene, v3d);
+ curs = give_cursor(scene, v3d);
if (obedit) {
- tottrans= 0;
+ tottrans = 0;
- if ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)
+ if (ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL))
make_trans_verts(obedit, bmat[0], bmat[1], 0);
- if (tottrans==0) return OPERATOR_CANCELLED;
+ if (tottrans == 0) return OPERATOR_CANCELLED;
copy_m3_m4(bmat, obedit->obmat);
invert_m3_m3(imat, bmat);
- tv= transvmain;
- for (a=0; a<tottrans; a++, tv++) {
+ tv = transvmain;
+ for (a = 0; a < tottrans; a++, tv++) {
sub_v3_v3v3(vec, curs, obedit->obmat[3]);
mul_m3_v3(imat, vec);
copy_v3_v3(tv->loc, vec);
@@ -681,34 +684,34 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
special_transvert_update(obedit);
MEM_freeN(transvmain);
- transvmain= NULL;
+ transvmain = NULL;
}
else {
struct KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_LOCATION_ID);
- CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
+ CTX_DATA_BEGIN(C, Object *, ob, selected_editable_objects) {
if (ob->mode & OB_MODE_POSE) {
bPoseChannel *pchan;
- bArmature *arm= ob->data;
+ bArmature *arm = ob->data;
invert_m4_m4(ob->imat, ob->obmat);
copy_v3_v3(vec, curs);
mul_m4_v3(ob->imat, vec);
- for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) {
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
if (pchan->bone->flag & BONE_SELECTED) {
if (pchan->bone->layer & arm->layer) {
- if ((pchan->bone->flag & BONE_CONNECTED)==0) {
+ if ((pchan->bone->flag & BONE_CONNECTED) == 0) {
/* Get position in pchan (pose) space. */
armature_loc_pose_to_bone(pchan, vec, vec);
/* copy new position */
- if ((pchan->protectflag & OB_LOCK_LOCX)==0)
- pchan->loc[0]= vec[0];
- if ((pchan->protectflag & OB_LOCK_LOCY)==0)
- pchan->loc[1]= vec[1];
- if ((pchan->protectflag & OB_LOCK_LOCZ)==0)
- pchan->loc[2]= vec[2];
+ if ((pchan->protectflag & OB_LOCK_LOCX) == 0)
+ pchan->loc[0] = vec[0];
+ if ((pchan->protectflag & OB_LOCK_LOCY) == 0)
+ pchan->loc[1] = vec[1];
+ if ((pchan->protectflag & OB_LOCK_LOCZ) == 0)
+ pchan->loc[2] = vec[2];
/* auto-keyframing */
ED_autokeyframe_pchan(C, scene, ob, pchan, ks);
@@ -719,16 +722,16 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
}
}
}
- ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
+ ob->pose->flag |= (POSE_LOCKED | POSE_DO_UNLOCK);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
else {
ob->recalc |= OB_RECALC_OB;
- vec[0]= -ob->obmat[3][0] + curs[0];
- vec[1]= -ob->obmat[3][1] + curs[1];
- vec[2]= -ob->obmat[3][2] + curs[2];
+ vec[0] = -ob->obmat[3][0] + curs[0];
+ vec[1] = -ob->obmat[3][1] + curs[1];
+ vec[2] = -ob->obmat[3][2] + curs[2];
if (ob->parent) {
where_is_object(scene, ob);
@@ -736,12 +739,12 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
invert_m3_m3(imat, originmat);
mul_m3_v3(imat, vec);
}
- if ((ob->protectflag & OB_LOCK_LOCX)==0)
- ob->loc[0]+= vec[0];
- if ((ob->protectflag & OB_LOCK_LOCY)==0)
- ob->loc[1]+= vec[1];
- if ((ob->protectflag & OB_LOCK_LOCZ)==0)
- ob->loc[2]+= vec[2];
+ if ((ob->protectflag & OB_LOCK_LOCX) == 0)
+ ob->loc[0] += vec[0];
+ if ((ob->protectflag & OB_LOCK_LOCY) == 0)
+ ob->loc[1] += vec[1];
+ if ((ob->protectflag & OB_LOCK_LOCZ) == 0)
+ ob->loc[2] += vec[2];
/* auto-keyframing */
ED_autokeyframe_object(C, scene, ob, ks);
@@ -751,7 +754,7 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
}
DAG_ids_flush_update(bmain, 0);
- WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
+ WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
return OPERATOR_FINISHED;
}
@@ -759,35 +762,35 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
void VIEW3D_OT_snap_selected_to_cursor(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Snap Selection to Cursor";
- ot->description= "Snap selected item(s) to cursor";
- ot->idname= "VIEW3D_OT_snap_selected_to_cursor";
+ ot->name = "Snap Selection to Cursor";
+ ot->description = "Snap selected item(s) to cursor";
+ ot->idname = "VIEW3D_OT_snap_selected_to_cursor";
/* api callbacks */
- ot->exec= snap_sel_to_curs;
- ot->poll= ED_operator_view3d_active;
+ ot->exec = snap_sel_to_curs;
+ ot->poll = ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* *************************************************** */
static int snap_curs_to_grid(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- RegionView3D *rv3d= CTX_wm_region_data(C);
- View3D *v3d= CTX_wm_view3d(C);
+ Scene *scene = CTX_data_scene(C);
+ RegionView3D *rv3d = CTX_wm_region_data(C);
+ View3D *v3d = CTX_wm_view3d(C);
float gridf, *curs;
- gridf= rv3d->gridview;
- curs= give_cursor(scene, v3d);
+ gridf = rv3d->gridview;
+ curs = give_cursor(scene, v3d);
- curs[0]= gridf*floorf(0.5f+curs[0]/gridf);
- curs[1]= gridf*floorf(0.5f+curs[1]/gridf);
- curs[2]= gridf*floorf(0.5f+curs[2]/gridf);
+ curs[0] = gridf * floorf(0.5f + curs[0] / gridf);
+ curs[1] = gridf * floorf(0.5f + curs[1] / gridf);
+ curs[2] = gridf * floorf(0.5f + curs[2] / gridf);
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d); // hrm
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d); // hrm
return OPERATOR_FINISHED;
}
@@ -795,32 +798,32 @@ static int snap_curs_to_grid(bContext *C, wmOperator *UNUSED(op))
void VIEW3D_OT_snap_cursor_to_grid(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Snap Cursor to Grid";
- ot->description= "Snap cursor to nearest grid node";
- ot->idname= "VIEW3D_OT_snap_cursor_to_grid";
+ ot->name = "Snap Cursor to Grid";
+ ot->description = "Snap cursor to nearest grid node";
+ ot->idname = "VIEW3D_OT_snap_cursor_to_grid";
/* api callbacks */
- ot->exec= snap_curs_to_grid;
- ot->poll= ED_operator_region_view3d_active;
+ ot->exec = snap_curs_to_grid;
+ ot->poll = ED_operator_region_view3d_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* **************************************************** */
static void bundle_midpoint(Scene *scene, Object *ob, float vec[3])
{
- MovieClip *clip= object_get_movieclip(scene, ob, 0);
+ MovieClip *clip = object_get_movieclip(scene, ob, 0);
MovieTracking *tracking;
MovieTrackingObject *object;
- int ok= 0;
+ int ok = 0;
float min[3], max[3], mat[4][4], pos[3], cammat[4][4] = MAT4_UNITY;
if (!clip)
return;
- tracking= &clip->tracking;
+ tracking = &clip->tracking;
copy_m4_m4(cammat, ob->obmat);
@@ -828,9 +831,9 @@ static void bundle_midpoint(Scene *scene, Object *ob, float vec[3])
INIT_MINMAX(min, max);
- for (object= tracking->objects.first; object; object= object->next) {
- ListBase *tracksbase= BKE_tracking_object_tracks(tracking, object);
- MovieTrackingTrack *track= tracksbase->first;
+ for (object = tracking->objects.first; object; object = object->next) {
+ ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object);
+ MovieTrackingTrack *track = tracksbase->first;
float obmat[4][4];
if (object->flag & TRACKING_OBJECT_CAMERA) {
@@ -846,13 +849,13 @@ static void bundle_midpoint(Scene *scene, Object *ob, float vec[3])
}
while (track) {
- if ((track->flag&TRACK_HAS_BUNDLE) && TRACK_SELECTED(track)) {
- ok= 1;
+ if ((track->flag & TRACK_HAS_BUNDLE) && TRACK_SELECTED(track)) {
+ ok = 1;
mul_v3_m4v3(pos, obmat, track->bundle_pos);
DO_MINMAX(pos, min, max);
}
- track= track->next;
+ track = track->next;
}
}
@@ -863,30 +866,30 @@ static void bundle_midpoint(Scene *scene, Object *ob, float vec[3])
static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op))
{
- Object *obedit= CTX_data_edit_object(C);
- Scene *scene= CTX_data_scene(C);
- View3D *v3d= CTX_wm_view3d(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Scene *scene = CTX_data_scene(C);
+ View3D *v3d = CTX_wm_view3d(C);
TransVert *tv;
float *curs, bmat[3][3], vec[3], min[3], max[3], centroid[3];
int count, a;
- curs= give_cursor(scene, v3d);
+ curs = give_cursor(scene, v3d);
- count= 0;
+ count = 0;
INIT_MINMAX(min, max);
- centroid[0]= centroid[1]= centroid[2]= 0.0;
+ zero_v3(centroid);
if (obedit) {
- tottrans=0;
+ tottrans = 0;
- if ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)
- make_trans_verts(obedit, bmat[0], bmat[1], TM_ALL_JOINTS|TM_SKIP_HANDLES);
- if (tottrans==0) return OPERATOR_CANCELLED;
+ if (ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL))
+ make_trans_verts(obedit, bmat[0], bmat[1], TM_ALL_JOINTS | TM_SKIP_HANDLES);
+ if (tottrans == 0) return OPERATOR_CANCELLED;
copy_m3_m4(bmat, obedit->obmat);
- tv= transvmain;
- for (a=0; a<tottrans; a++, tv++) {
+ tv = transvmain;
+ for (a = 0; a < tottrans; a++, tv++) {
copy_v3_v3(vec, tv->loc);
mul_m3_v3(bmat, vec);
add_v3_v3(vec, obedit->obmat[3]);
@@ -894,23 +897,23 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op))
DO_MINMAX(vec, min, max);
}
- if (v3d->around==V3D_CENTROID) {
- mul_v3_fl(centroid, 1.0f/(float)tottrans);
+ if (v3d->around == V3D_CENTROID) {
+ mul_v3_fl(centroid, 1.0f / (float)tottrans);
copy_v3_v3(curs, centroid);
}
else {
mid_v3_v3v3(curs, min, max);
}
MEM_freeN(transvmain);
- transvmain= NULL;
+ transvmain = NULL;
}
else {
- Object *obact= CTX_data_active_object(C);
+ Object *obact = CTX_data_active_object(C);
if (obact && (obact->mode & OB_MODE_POSE)) {
- bArmature *arm= obact->data;
+ bArmature *arm = obact->data;
bPoseChannel *pchan;
- for (pchan = obact->pose->chanbase.first; pchan; pchan=pchan->next) {
+ for (pchan = obact->pose->chanbase.first; pchan; pchan = pchan->next) {
if (arm->layer & pchan->bone->layer) {
if (pchan->bone->flag & BONE_SELECTED) {
copy_v3_v3(vec, pchan->pose_head);
@@ -923,13 +926,13 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op))
}
}
else {
- CTX_DATA_BEGIN(C, Object*, ob, selected_objects) {
+ CTX_DATA_BEGIN(C, Object *, ob, selected_objects) {
copy_v3_v3(vec, ob->obmat[3]);
/* special case for camera -- snap to bundles */
- if (ob->type==OB_CAMERA) {
+ if (ob->type == OB_CAMERA) {
/* snap to bundles should happen only when bundles are visible */
- if (v3d->flag2&V3D_SHOW_RECONSTRUCTION) {
+ if (v3d->flag2 & V3D_SHOW_RECONSTRUCTION) {
bundle_midpoint(scene, ob, vec);
}
}
@@ -941,8 +944,8 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op))
CTX_DATA_END;
}
if (count) {
- if (v3d->around==V3D_CENTROID) {
- mul_v3_fl(centroid, 1.0f/(float)count);
+ if (v3d->around == V3D_CENTROID) {
+ mul_v3_fl(centroid, 1.0f / (float)count);
copy_v3_v3(curs, centroid);
}
else {
@@ -950,7 +953,7 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op))
}
}
}
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
return OPERATOR_FINISHED;
}
@@ -958,26 +961,26 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op))
void VIEW3D_OT_snap_cursor_to_selected(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Snap Cursor to Selected";
- ot->description= "Snap cursor to center of selected item(s)";
- ot->idname= "VIEW3D_OT_snap_cursor_to_selected";
+ ot->name = "Snap Cursor to Selected";
+ ot->description = "Snap cursor to center of selected item(s)";
+ ot->idname = "VIEW3D_OT_snap_cursor_to_selected";
/* api callbacks */
- ot->exec= snap_curs_to_sel;
- ot->poll= ED_operator_view3d_active;
+ ot->exec = snap_curs_to_sel;
+ ot->poll = ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* ********************************************** */
static int snap_curs_to_active(bContext *C, wmOperator *UNUSED(op))
{
- Object *obedit= CTX_data_edit_object(C);
- Object *obact= CTX_data_active_object(C);
- Scene *scene= CTX_data_scene(C);
- View3D *v3d= CTX_wm_view3d(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Object *obact = CTX_data_active_object(C);
+ Scene *scene = CTX_data_scene(C);
+ View3D *v3d = CTX_wm_view3d(C);
float *curs;
curs = give_cursor(scene, v3d);
@@ -985,10 +988,10 @@ static int snap_curs_to_active(bContext *C, wmOperator *UNUSED(op))
if (obedit) {
if (obedit->type == OB_MESH) {
/* check active */
- Mesh *me= obedit->data;
+ Mesh *me = obedit->data;
BMEditSelection ese;
- if (EDBM_get_actSelection(me->edit_btmesh, &ese)) {
+ if (EDBM_editselection_active_get(me->edit_btmesh, &ese)) {
EDBM_editselection_center(me->edit_btmesh, curs, &ese);
}
@@ -1001,39 +1004,37 @@ static int snap_curs_to_active(bContext *C, wmOperator *UNUSED(op))
}
}
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
return OPERATOR_FINISHED;
}
void VIEW3D_OT_snap_cursor_to_active(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Snap Cursor to Active";
- ot->description= "Snap cursor to active item";
- ot->idname= "VIEW3D_OT_snap_cursor_to_active";
+ ot->name = "Snap Cursor to Active";
+ ot->description = "Snap cursor to active item";
+ ot->idname = "VIEW3D_OT_snap_cursor_to_active";
/* api callbacks */
- ot->exec= snap_curs_to_active;
- ot->poll= ED_operator_view3d_active;
+ ot->exec = snap_curs_to_active;
+ ot->poll = ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* **************************************************** */
/*New Code - Snap Cursor to Center -*/
static int snap_curs_to_center(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- View3D *v3d= CTX_wm_view3d(C);
+ Scene *scene = CTX_data_scene(C);
+ View3D *v3d = CTX_wm_view3d(C);
float *curs;
- curs= give_cursor(scene, v3d);
+ curs = give_cursor(scene, v3d);
- curs[0]= 0.0;
- curs[1]= 0.0;
- curs[2]= 0.0;
+ zero_v3(curs);
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
return OPERATOR_FINISHED;
}
@@ -1041,16 +1042,16 @@ static int snap_curs_to_center(bContext *C, wmOperator *UNUSED(op))
void VIEW3D_OT_snap_cursor_to_center(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Snap Cursor to Center";
- ot->description= "Snap cursor to the Center";
- ot->idname= "VIEW3D_OT_snap_cursor_to_center";
+ ot->name = "Snap Cursor to Center";
+ ot->description = "Snap cursor to the Center";
+ ot->idname = "VIEW3D_OT_snap_cursor_to_center";
/* api callbacks */
- ot->exec= snap_curs_to_center;
- ot->poll= ED_operator_view3d_active;
+ ot->exec = snap_curs_to_center;
+ ot->poll = ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* **************************************************** */
@@ -1062,16 +1063,16 @@ int minmax_verts(Object *obedit, float *min, float *max)
float centroid[3], vec[3], bmat[3][3];
int a;
- tottrans=0;
- if ELEM5(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE)
+ tottrans = 0;
+ if (ELEM5(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE))
make_trans_verts(obedit, bmat[0], bmat[1], TM_ALL_JOINTS);
- if (tottrans==0) return 0;
+ if (tottrans == 0) return 0;
copy_m3_m4(bmat, obedit->obmat);
- tv= transvmain;
- for (a=0; a<tottrans; a++, tv++) {
+ tv = transvmain;
+ for (a = 0; a < tottrans; a++, tv++) {
copy_v3_v3(vec, (tv->flag & TX_VERT_USE_MAPLOC) ? tv->maploc : tv->loc);
mul_m3_v3(bmat, vec);
add_v3_v3(vec, obedit->obmat[3]);
@@ -1080,7 +1081,7 @@ int minmax_verts(Object *obedit, float *min, float *max)
}
MEM_freeN(transvmain);
- transvmain= NULL;
+ transvmain = NULL;
return 1;
}
diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c
index 355febcde5d..82ab6cd7193 100644
--- a/source/blender/editors/space_view3d/view3d_toolbar.c
+++ b/source/blender/editors/space_view3d/view3d_toolbar.c
@@ -64,7 +64,7 @@
#include "UI_interface.h"
#include "UI_resources.h"
-#include "view3d_intern.h" // own include
+#include "view3d_intern.h" // own include
/* ******************* view3d space & buttons ************** */
@@ -76,7 +76,7 @@ static void view3d_panel_operator_redo_buts(const bContext *C, Panel *pa, wmOper
static void view3d_panel_operator_redo_header(const bContext *C, Panel *pa)
{
- wmOperator *op= WM_operator_last_redo(C);
+ wmOperator *op = WM_operator_last_redo(C);
if (op) BLI_strncpy(pa->drawname, op->type->name, sizeof(pa->drawname));
else BLI_strncpy(pa->drawname, IFACE_("Operator"), sizeof(pa->drawname));
@@ -85,7 +85,7 @@ static void view3d_panel_operator_redo_header(const bContext *C, Panel *pa)
static void view3d_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOperator *op)
{
if (op->type->flag & OPTYPE_MACRO) {
- for (op= op->macro.first; op; op= op->next) {
+ for (op = op->macro.first; op; op = op->next) {
uiItemL(pa->layout, op->type->name, ICON_NONE);
view3d_panel_operator_redo_operator(C, pa, op);
}
@@ -98,15 +98,15 @@ static void view3d_panel_operator_redo_operator(const bContext *C, Panel *pa, wm
/* TODO de-duplicate redo panel functions - campbell */
static void view3d_panel_operator_redo(const bContext *C, Panel *pa)
{
- wmOperator *op= WM_operator_last_redo(C);
+ wmOperator *op = WM_operator_last_redo(C);
uiBlock *block;
- if (op==NULL)
+ if (op == NULL)
return;
- if (WM_operator_poll((bContext*)C, op->type) == 0)
+ if (WM_operator_poll((bContext *)C, op->type) == 0)
return;
- block= uiLayoutGetBlock(pa->layout);
+ block = uiLayoutGetBlock(pa->layout);
if (!WM_operator_check_ui_enabled(C, op->type->name))
uiLayoutSetEnabled(pa->layout, 0);
@@ -127,10 +127,10 @@ typedef struct CustomTool {
static void operator_call_cb(struct bContext *C, void *arg_listbase, void *arg2)
{
- wmOperatorType *ot= arg2;
+ wmOperatorType *ot = arg2;
if (ot) {
- CustomTool *ct= MEM_callocN(sizeof(CustomTool), "CustomTool");
+ CustomTool *ct = MEM_callocN(sizeof(CustomTool), "CustomTool");
BLI_addtail(arg_listbase, ct);
BLI_strncpy(ct->opname, ot->idname, OP_MAX_TYPENAME);
@@ -141,15 +141,15 @@ static void operator_call_cb(struct bContext *C, void *arg_listbase, void *arg2)
static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items)
{
- GHashIterator *iter= WM_operatortype_iter();
+ GHashIterator *iter = WM_operatortype_iter();
- for ( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
- wmOperatorType *ot= BLI_ghashIterator_getValue(iter);
+ for (; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+ wmOperatorType *ot = BLI_ghashIterator_getValue(iter);
if (BLI_strcasestr(ot->name, str)) {
- if (WM_operator_poll((bContext*)C, ot)) {
+ if (WM_operator_poll((bContext *)C, ot)) {
- if (0==uiSearchItemAdd(items, ot->name, ot, 0))
+ if (0 == uiSearchItemAdd(items, ot->name, ot, 0))
break;
}
}
@@ -163,31 +163,31 @@ static uiBlock *tool_search_menu(bContext *C, ARegion *ar, void *arg_listbase)
{
static char search[OP_MAX_TYPENAME];
wmEvent event;
- wmWindow *win= CTX_wm_window(C);
+ wmWindow *win = CTX_wm_window(C);
uiBlock *block;
uiBut *but;
/* clear initial search string, then all items show */
- search[0]= 0;
+ search[0] = 0;
- block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1);
+ block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
+ uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_RET_1);
/* fake button, it holds space for search items */
uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
- but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, "");
+ but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, "");
uiButSetSearchFunc(but, operator_search_cb, arg_listbase, operator_call_cb, NULL);
uiBoundsBlock(block, 6);
uiBlockSetDirection(block, UI_DOWN);
uiEndBlock(C, block);
- event= *(win->eventstate); /* XXX huh huh? make api call */
- event.type= EVT_BUT_OPEN;
- event.val= KM_PRESS;
- event.customdata= but;
- event.customdatafree= FALSE;
+ event = *(win->eventstate); /* XXX huh huh? make api call */
+ event.type = EVT_BUT_OPEN;
+ event.val = KM_PRESS;
+ event.customdata = but;
+ event.customdatafree = FALSE;
wm_event_add(win, &event);
return block;
@@ -196,25 +196,25 @@ static uiBlock *tool_search_menu(bContext *C, ARegion *ar, void *arg_listbase)
static void view3d_panel_tool_shelf(const bContext *C, Panel *pa)
{
- SpaceLink *sl= CTX_wm_space_data(C);
- SpaceType *st= NULL;
+ SpaceLink *sl = CTX_wm_space_data(C);
+ SpaceType *st = NULL;
uiLayout *col;
- const char *context= CTX_data_mode_string(C);
+ const char *context = CTX_data_mode_string(C);
if (sl)
- st= BKE_spacetype_from_id(sl->spacetype);
+ st = BKE_spacetype_from_id(sl->spacetype);
if (st && st->toolshelf.first) {
CustomTool *ct;
- for (ct= st->toolshelf.first; ct; ct= ct->next) {
- if (0==strncmp(context, ct->context, OP_MAX_TYPENAME)) {
- col= uiLayoutColumn(pa->layout, 1);
+ for (ct = st->toolshelf.first; ct; ct = ct->next) {
+ if (0 == strncmp(context, ct->context, OP_MAX_TYPENAME)) {
+ col = uiLayoutColumn(pa->layout, 1);
uiItemFullO(col, ct->opname, NULL, ICON_NONE, NULL, WM_OP_INVOKE_REGION_WIN, 0);
}
}
}
- col= uiLayoutColumn(pa->layout, 1);
+ col = uiLayoutColumn(pa->layout, 1);
uiDefBlockBut(uiLayoutGetBlock(pa->layout), tool_search_menu, &st->toolshelf, "Add Tool", 0, 0, UI_UNIT_X, UI_UNIT_Y, "Add Tool in shelf, gets saved in files");
}
@@ -223,10 +223,10 @@ void view3d_toolshelf_register(ARegionType *art)
{
PanelType *pt;
- pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel tools");
+ pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel tools");
strcpy(pt->idname, "VIEW3D_PT_tool_shelf");
strcpy(pt->label, "Tool Shelf");
- pt->draw= view3d_panel_tool_shelf;
+ pt->draw = view3d_panel_tool_shelf;
BLI_addtail(&art->paneltypes, pt);
}
@@ -234,11 +234,11 @@ void view3d_tool_props_register(ARegionType *art)
{
PanelType *pt;
- pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel last operator");
+ pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel last operator");
strcpy(pt->idname, "VIEW3D_PT_last_operator");
strcpy(pt->label, "Operator");
- pt->draw_header= view3d_panel_operator_redo_header;
- pt->draw= view3d_panel_operator_redo;
+ pt->draw_header = view3d_panel_operator_redo_header;
+ pt->draw = view3d_panel_operator_redo;
BLI_addtail(&art->paneltypes, pt);
}
@@ -246,8 +246,8 @@ void view3d_tool_props_register(ARegionType *art)
static int view3d_toolshelf(bContext *C, wmOperator *UNUSED(op))
{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= view3d_has_tools_region(sa);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = view3d_has_tools_region(sa);
if (ar)
ED_region_toggle_hidden(C, ar);
@@ -257,14 +257,14 @@ static int view3d_toolshelf(bContext *C, wmOperator *UNUSED(op))
void VIEW3D_OT_toolshelf(wmOperatorType *ot)
{
- ot->name= "Tool Shelf";
- ot->description= "Toggles tool shelf display";
- ot->idname= "VIEW3D_OT_toolshelf";
+ ot->name = "Tool Shelf";
+ ot->description = "Toggles tool shelf display";
+ ot->idname = "VIEW3D_OT_toolshelf";
- ot->exec= view3d_toolshelf;
- ot->poll= ED_operator_view3d_active;
+ ot->exec = view3d_toolshelf;
+ ot->poll = ED_operator_view3d_active;
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 847bd2e0b24..f6b03a5fac3 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -71,15 +71,15 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "view3d_intern.h" // own include
+#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);
- ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
view3d_region_operator_needs_opengl(win, ar);
}
@@ -87,10 +87,10 @@ void view3d_operator_needs_opengl(const bContext *C)
void view3d_region_operator_needs_opengl(wmWindow *win, ARegion *ar)
{
/* for debugging purpose, context should always be OK */
- if ((ar == NULL) || (ar->regiontype!=RGN_TYPE_WINDOW))
+ if ((ar == NULL) || (ar->regiontype != RGN_TYPE_WINDOW))
printf("view3d_region_operator_needs_opengl error, wrong region\n");
else {
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
wmSubWindowSet(win, ar->swinid);
glMatrixMode(GL_PROJECTION);
@@ -126,26 +126,26 @@ struct SmoothViewStore {
void smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Object *camera,
float *ofs, float *quat, float *dist, float *lens)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- wmWindow *win= CTX_wm_window(C);
- ScrArea *sa= CTX_wm_area(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
+ wmWindow *win = CTX_wm_window(C);
+ ScrArea *sa = CTX_wm_area(C);
- RegionView3D *rv3d= ar->regiondata;
- struct SmoothViewStore sms= {0};
- short ok= FALSE;
+ RegionView3D *rv3d = ar->regiondata;
+ struct SmoothViewStore sms = {0};
+ short ok = FALSE;
/* initialize sms */
copy_v3_v3(sms.new_ofs, rv3d->ofs);
copy_qt_qt(sms.new_quat, rv3d->viewquat);
- sms.new_dist= rv3d->dist;
- sms.new_lens= v3d->lens;
- sms.to_camera= 0;
+ sms.new_dist = rv3d->dist;
+ sms.new_lens = v3d->lens;
+ sms.to_camera = 0;
/* note on camera locking, this is a little confusing but works ok.
* we may be changing the view 'as if' there is no active camera, but infact
* there is an active camera which is locked to the view.
*
- * In the case where smooth view is moving _to_ a camera we dont want that
+ * In the case where smooth view is moving _to_ a camera we don't want that
* camera to be moved or changed, so only when the camera is not being set should
* we allow camera option locking to initialize the view settings from the camera.
*/
@@ -156,12 +156,12 @@ void smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Objec
/* store the options we want to end with */
if (ofs) copy_v3_v3(sms.new_ofs, ofs);
if (quat) copy_qt_qt(sms.new_quat, quat);
- if (dist) sms.new_dist= *dist;
- if (lens) sms.new_lens= *lens;
+ if (dist) sms.new_dist = *dist;
+ if (lens) sms.new_lens = *lens;
if (camera) {
ED_view3d_from_object(camera, sms.new_ofs, sms.new_quat, &sms.new_dist, &sms.new_lens);
- sms.to_camera= 1; /* restore view3d values in end */
+ sms.to_camera = 1; /* restore view3d values in end */
}
if (C && U.smooth_viewtx) {
@@ -179,35 +179,35 @@ 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 */
if (oldcamera) {
- sms.orig_dist= rv3d->dist; // below function does weird stuff with it...
+ sms.orig_dist = rv3d->dist; // below function does weird stuff with it...
ED_view3d_from_object(oldcamera, sms.orig_ofs, sms.orig_quat, &sms.orig_dist, &sms.orig_lens);
}
else {
copy_v3_v3(sms.orig_ofs, rv3d->ofs);
copy_qt_qt(sms.orig_quat, rv3d->viewquat);
- sms.orig_dist= rv3d->dist;
- sms.orig_lens= v3d->lens;
+ sms.orig_dist = rv3d->dist;
+ sms.orig_lens = v3d->lens;
}
/* grid draw as floor */
- if ((rv3d->viewlock & RV3D_LOCKED)==0) {
+ if ((rv3d->viewlock & RV3D_LOCKED) == 0) {
/* use existing if exists, means multiple calls to smooth view wont loose the original 'view' setting */
- sms.orig_view= rv3d->sms ? rv3d->sms->orig_view : rv3d->view;
- rv3d->view= RV3D_VIEW_USER;
+ sms.orig_view = rv3d->sms ? rv3d->sms->orig_view : rv3d->view;
+ rv3d->view = RV3D_VIEW_USER;
}
- sms.time_allowed= (double)U.smooth_viewtx / 1000.0;
+ 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 vec1[3] = {0, 0, 1}, vec2[3] = {0, 0, 1};
float q1[4], q2[4];
invert_qt_qt(q1, sms.new_quat);
@@ -221,26 +221,26 @@ void smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Objec
}
/* ensure it shows correct */
- if (sms.to_camera) rv3d->persp= RV3D_PERSP;
+ if (sms.to_camera) rv3d->persp = RV3D_PERSP;
rv3d->rflag |= RV3D_NAVIGATING;
/* keep track of running timer! */
- if (rv3d->sms==NULL)
- rv3d->sms= MEM_mallocN(sizeof(struct SmoothViewStore), "smoothview v3d");
- *rv3d->sms= sms;
+ if (rv3d->sms == NULL)
+ rv3d->sms = MEM_mallocN(sizeof(struct SmoothViewStore), "smoothview v3d");
+ *rv3d->sms = sms;
if (rv3d->smooth_timer)
WM_event_remove_timer(wm, win, rv3d->smooth_timer);
/* TIMER1 is hardcoded in keymap */
- rv3d->smooth_timer= WM_event_add_timer(wm, win, TIMER1, 1.0/100.0); /* max 30 frs/sec */
+ rv3d->smooth_timer = WM_event_add_timer(wm, win, TIMER1, 1.0 / 100.0); /* max 30 frs/sec */
- ok= TRUE;
+ ok = TRUE;
}
}
/* if we get here nothing happens */
if (ok == FALSE) {
- if (sms.to_camera==0) {
+ if (sms.to_camera == 0) {
copy_v3_v3(rv3d->ofs, sms.new_ofs);
copy_qt_qt(rv3d->viewquat, sms.new_quat);
rv3d->dist = sms.new_dist;
@@ -258,16 +258,16 @@ void smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Objec
static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
View3D *v3d = CTX_wm_view3d(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
- struct SmoothViewStore *sms= rv3d->sms;
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
+ struct SmoothViewStore *sms = rv3d->sms;
float step, step_inv;
/* escape if not our timer */
- if (rv3d->smooth_timer==NULL || rv3d->smooth_timer!=event->customdata)
+ if (rv3d->smooth_timer == NULL || rv3d->smooth_timer != event->customdata)
return OPERATOR_PASS_THROUGH;
if (sms->time_allowed != 0.0)
- step = (float)((rv3d->smooth_timer->duration)/sms->time_allowed);
+ step = (float)((rv3d->smooth_timer->duration) / sms->time_allowed);
else
step = 1.0f;
@@ -276,7 +276,7 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
/* if we went to camera, store the original */
if (sms->to_camera) {
- rv3d->persp= RV3D_CAMOB;
+ rv3d->persp = RV3D_CAMOB;
copy_v3_v3(rv3d->ofs, sms->orig_ofs);
copy_qt_qt(rv3d->viewquat, sms->orig_quat);
rv3d->dist = sms->orig_dist;
@@ -291,33 +291,33 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
ED_view3d_camera_lock_sync(v3d, rv3d);
}
- if ((rv3d->viewlock & RV3D_LOCKED)==0) {
- rv3d->view= sms->orig_view;
+ if ((rv3d->viewlock & RV3D_LOCKED) == 0) {
+ rv3d->view = sms->orig_view;
}
MEM_freeN(rv3d->sms);
- rv3d->sms= NULL;
+ rv3d->sms = NULL;
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), rv3d->smooth_timer);
- rv3d->smooth_timer= NULL;
+ rv3d->smooth_timer = NULL;
rv3d->rflag &= ~RV3D_NAVIGATING;
}
else {
int i;
/* ease in/out */
- if (step < 0.5f) step = (float)pow(step*2.0f, 2.0)/2.0f;
- else step = (float)1.0f-(powf(2.0f*(1.0f-step),2.0f)/2.0f);
+ if (step < 0.5f) step = (float)pow(step * 2.0f, 2.0) / 2.0f;
+ else step = (float)1.0f - (powf(2.0f * (1.0f - step), 2.0f) / 2.0f);
- step_inv = 1.0f-step;
+ step_inv = 1.0f - step;
- for (i=0; i<3; i++)
- rv3d->ofs[i] = sms->new_ofs[i] * step + sms->orig_ofs[i]*step_inv;
+ for (i = 0; i < 3; i++)
+ rv3d->ofs[i] = sms->new_ofs[i] * step + sms->orig_ofs[i] * step_inv;
interp_qt_qtqt(rv3d->viewquat, sms->orig_quat, sms->new_quat, step);
- rv3d->dist = sms->new_dist * step + sms->orig_dist*step_inv;
- v3d->lens = sms->new_lens * step + sms->orig_lens*step_inv;
+ rv3d->dist = sms->new_dist * step + sms->orig_dist * step_inv;
+ v3d->lens = sms->new_lens * step + sms->orig_lens * step_inv;
ED_view3d_camera_lock_sync(v3d, rv3d);
}
@@ -325,7 +325,7 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
if (rv3d->viewlock & RV3D_BOXVIEW)
view3d_boxview_copy(CTX_wm_area(C), CTX_wm_region(C));
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
return OPERATOR_FINISHED;
}
@@ -334,14 +334,14 @@ void VIEW3D_OT_smoothview(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Smooth View";
- ot->idname= "VIEW3D_OT_smoothview";
- ot->description="The time to animate the change of view (in milliseconds)";
+ ot->name = "Smooth View";
+ ot->idname = "VIEW3D_OT_smoothview";
+ ot->description = "The time to animate the change of view (in milliseconds)";
/* api callbacks */
- ot->invoke= view3d_smoothview_invoke;
+ ot->invoke = view3d_smoothview_invoke;
- ot->poll= ED_operator_view3d_active;
+ ot->poll = ED_operator_view3d_active;
}
/* ****************** change view operators ****************** */
@@ -349,13 +349,13 @@ void VIEW3D_OT_smoothview(wmOperatorType *ot)
static int view3d_camera_to_view_exec(bContext *C, wmOperator *UNUSED(op))
{
View3D *v3d = CTX_wm_view3d(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
ObjectTfmProtectedChannels obtfm;
copy_qt_qt(rv3d->lviewquat, rv3d->viewquat);
- rv3d->lview= rv3d->view;
+ rv3d->lview = rv3d->view;
if (rv3d->persp != RV3D_CAMOB) {
- rv3d->lpersp= rv3d->persp;
+ rv3d->lpersp = rv3d->persp;
}
object_tfm_protected_backup(v3d->camera, &obtfm);
@@ -367,7 +367,7 @@ static int view3d_camera_to_view_exec(bContext *C, wmOperator *UNUSED(op))
DAG_id_tag_update(&v3d->camera->id, OB_RECALC_OB);
rv3d->persp = RV3D_CAMOB;
- WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, v3d->camera);
+ WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, v3d->camera);
return OPERATOR_FINISHED;
@@ -375,9 +375,9 @@ static int view3d_camera_to_view_exec(bContext *C, wmOperator *UNUSED(op))
static int view3d_camera_to_view_poll(bContext *C)
{
- View3D *v3d= CTX_wm_view3d(C);
- if (v3d && v3d->camera && v3d->camera->id.lib==NULL) {
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ View3D *v3d = CTX_wm_view3d(C);
+ if (v3d && v3d->camera && v3d->camera->id.lib == NULL) {
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
if (rv3d && !rv3d->viewlock) {
return 1;
}
@@ -389,25 +389,25 @@ static int view3d_camera_to_view_poll(bContext *C)
void VIEW3D_OT_camera_to_view(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Align Camera To View";
- ot->description= "Set camera view to active view";
- ot->idname= "VIEW3D_OT_camera_to_view";
+ ot->name = "Align Camera To View";
+ ot->description = "Set camera view to active view";
+ ot->idname = "VIEW3D_OT_camera_to_view";
/* api callbacks */
- ot->exec= view3d_camera_to_view_exec;
- ot->poll= view3d_camera_to_view_poll;
+ ot->exec = view3d_camera_to_view_exec;
+ ot->poll = view3d_camera_to_view_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* unlike VIEW3D_OT_view_selected this is for framing a render and not
* meant to take into account vertex/bone selection for eg. */
static int view3d_camera_to_view_selected_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
View3D *v3d = CTX_wm_view3d(C);
- Object *camera_ob= v3d->camera;
+ Object *camera_ob = v3d->camera;
float r_co[3]; /* the new location to apply */
@@ -427,7 +427,7 @@ static int view3d_camera_to_view_selected_exec(bContext *C, wmOperator *UNUSED(o
/* notifiers */
DAG_id_tag_update(&camera_ob->id, OB_RECALC_OB);
- WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, camera_ob);
+ WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, camera_ob);
return OPERATOR_FINISHED;
}
else {
@@ -437,9 +437,9 @@ static int view3d_camera_to_view_selected_exec(bContext *C, wmOperator *UNUSED(o
static int view3d_camera_to_view_selected_poll(bContext *C)
{
- View3D *v3d= CTX_wm_view3d(C);
- if (v3d && v3d->camera && v3d->camera->id.lib==NULL) {
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ View3D *v3d = CTX_wm_view3d(C);
+ if (v3d && v3d->camera && v3d->camera->id.lib == NULL) {
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
if (rv3d) {
if (rv3d->is_persp == FALSE) {
CTX_wm_operator_poll_msg_set(C, "Only valid for a perspective camera view");
@@ -456,16 +456,16 @@ static int view3d_camera_to_view_selected_poll(bContext *C)
void VIEW3D_OT_camera_to_view_selected(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Camera Fit Frame to Selected";
- ot->description= "Move the camera so selected objects are framed";
- ot->idname= "VIEW3D_OT_camera_to_view_selected";
+ ot->name = "Camera Fit Frame to Selected";
+ ot->description = "Move the camera so selected objects are framed";
+ ot->idname = "VIEW3D_OT_camera_to_view_selected";
/* api callbacks */
- ot->exec= view3d_camera_to_view_selected_exec;
- ot->poll= view3d_camera_to_view_selected_poll;
+ ot->exec = view3d_camera_to_view_selected_exec;
+ ot->poll = view3d_camera_to_view_selected_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
@@ -475,7 +475,7 @@ static int view3d_setobjectascamera_exec(bContext *C, wmOperator *UNUSED(op))
ARegion *ar;
RegionView3D *rv3d;
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
/* no NULL check is needed, poll checks */
@@ -483,16 +483,16 @@ static int view3d_setobjectascamera_exec(bContext *C, wmOperator *UNUSED(op))
rv3d = ar->regiondata;
if (ob) {
- Object *camera_old= (rv3d->persp == RV3D_CAMOB) ? V3D_CAMERA_SCENE(scene, v3d) : NULL;
- rv3d->persp= RV3D_CAMOB;
- v3d->camera= ob;
+ Object *camera_old = (rv3d->persp == RV3D_CAMOB) ? V3D_CAMERA_SCENE(scene, v3d) : NULL;
+ rv3d->persp = RV3D_CAMOB;
+ v3d->camera = ob;
if (v3d->scenelock)
- scene->camera= ob;
+ scene->camera = ob;
if (camera_old != ob) /* unlikely but looks like a glitch when set to the same */
smooth_view(C, v3d, ar, camera_old, v3d->camera, rv3d->ofs, rv3d->viewquat, &rv3d->dist, &v3d->lens);
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, CTX_data_scene(C));
+ WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS | NC_OBJECT | ND_DRAW, CTX_data_scene(C));
}
return OPERATOR_FINISHED;
@@ -510,16 +510,16 @@ void VIEW3D_OT_object_as_camera(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Active Object as Camera";
- ot->description= "Set the active object as the active camera for this view or scene";
- ot->idname= "VIEW3D_OT_object_as_camera";
+ ot->name = "Set Active Object as Camera";
+ ot->description = "Set the active object as the active camera for this view or scene";
+ ot->idname = "VIEW3D_OT_object_as_camera";
/* api callbacks */
- ot->exec= view3d_setobjectascamera_exec;
- ot->poll= ED_operator_rv3d_user_region_poll;
+ ot->exec = view3d_setobjectascamera_exec;
+ ot->poll = ED_operator_rv3d_user_region_poll;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* ********************************** */
@@ -531,9 +531,9 @@ 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 */
- if (fabs(mats->modelview[0]) < 1e-6) mats->modelview[0]= 0.0;
- if (fabs(mats->modelview[5]) < 1e-6) mats->modelview[5]= 0.0;
+ * 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;
/* Set up viewport so that gluUnProject will give correct values */
mats->viewport[0] = 0;
@@ -541,42 +541,42 @@ void ED_view3d_calc_clipping(BoundBox *bb, float planes[4][4], bglMats *mats, co
/* four clipping planes and bounding volume */
/* first do the bounding volume */
- for (val=0; val<4; val++) {
- xs= (val==0||val==3)?rect->xmin:rect->xmax;
- ys= (val==0||val==1)?rect->ymin:rect->ymax;
+ for (val = 0; val < 4; val++) {
+ xs = (val == 0 || val == 3) ? rect->xmin : rect->xmax;
+ 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. */
- for (a=0; a<16; a++)
- ((float*)modelview)[a] = mats->modelview[a];
+ * 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);
/* then plane equations */
- for (val=0; val<4; val++) {
+ for (val = 0; val < 4; val++) {
- normal_tri_v3(planes[val], bb->vec[val], bb->vec[val==3?0:val+1], bb->vec[val+4]);
+ normal_tri_v3(planes[val], bb->vec[val], bb->vec[val == 3 ? 0 : val + 1], bb->vec[val + 4]);
if (flip_sign)
negate_v3(planes[val]);
- planes[val][3]= - planes[val][0]*bb->vec[val][0]
- - planes[val][1]*bb->vec[val][1]
- - planes[val][2]*bb->vec[val][2];
+ planes[val][3] = -planes[val][0] * bb->vec[val][0]
+ - planes[val][1] * bb->vec[val][1]
+ - planes[val][2] * bb->vec[val][2];
}
}
/* create intersection coordinates in view Z direction at mouse coordinates */
void ED_view3d_win_to_segment_clip(ARegion *ar, View3D *v3d, const float mval[2], float ray_start[3], float ray_end[3])
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
if (rv3d->is_persp) {
float vec[3];
@@ -602,7 +602,7 @@ void ED_view3d_win_to_segment_clip(ARegion *ar, View3D *v3d, const float mval[2]
/* clipping */
if (rv3d->rflag & RV3D_CLIPPING) {
int a;
- for (a=0; a<4; a++) {
+ for (a = 0; a < 4; a++) {
clip_line_plane(ray_start, ray_end, rv3d->clip[a]);
}
}
@@ -643,30 +643,30 @@ void ED_view3d_global_to_vector(RegionView3D *rv3d, const float coord[3], float
int initgrabz(RegionView3D *rv3d, float x, float y, float z)
{
- int flip= FALSE;
- if (rv3d==NULL) return flip;
- rv3d->zfac= rv3d->persmat[0][3]*x+ rv3d->persmat[1][3]*y+ rv3d->persmat[2][3]*z+ rv3d->persmat[3][3];
+ int flip = FALSE;
+ if (rv3d == NULL) return flip;
+ rv3d->zfac = rv3d->persmat[0][3] * x + rv3d->persmat[1][3] * y + rv3d->persmat[2][3] * z + rv3d->persmat[3][3];
if (rv3d->zfac < 0.0f)
- flip= TRUE;
+ 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;
+ if (rv3d->zfac < 0.0f) rv3d->zfac = -rv3d->zfac;
return flip;
}
void ED_view3d_win_to_3d(ARegion *ar, const float depth_pt[3], const float mval[2], float out[3])
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
float line_sta[3];
float line_end[3];
@@ -683,11 +683,11 @@ void ED_view3d_win_to_3d(ARegion *ar, const float depth_pt[3], const float mval[
}
}
else {
- const float dx= (2.0f * mval[0] / (float)ar->winx) - 1.0f;
- const float dy= (2.0f * mval[1] / (float)ar->winy) - 1.0f;
- line_sta[0]= (rv3d->persinv[0][0] * dx) + (rv3d->persinv[1][0] * dy) + rv3d->viewinv[3][0];
- line_sta[1]= (rv3d->persinv[0][1] * dx) + (rv3d->persinv[1][1] * dy) + rv3d->viewinv[3][1];
- line_sta[2]= (rv3d->persinv[0][2] * dx) + (rv3d->persinv[1][2] * dy) + rv3d->viewinv[3][2];
+ const float dx = (2.0f * mval[0] / (float)ar->winx) - 1.0f;
+ const float dy = (2.0f * mval[1] / (float)ar->winy) - 1.0f;
+ line_sta[0] = (rv3d->persinv[0][0] * dx) + (rv3d->persinv[1][0] * dy) + rv3d->viewinv[3][0];
+ line_sta[1] = (rv3d->persinv[0][1] * dx) + (rv3d->persinv[1][1] * dy) + rv3d->viewinv[3][1];
+ line_sta[2] = (rv3d->persinv[0][2] * dx) + (rv3d->persinv[1][2] * dy) + rv3d->viewinv[3][2];
add_v3_v3v3(line_end, line_sta, rv3d->viewinv[2]);
closest_to_line_v3(out, depth_pt, line_sta, line_end);
@@ -698,15 +698,15 @@ void ED_view3d_win_to_3d(ARegion *ar, const float depth_pt[3], const float mval[
/* only to detect delta motion */
void ED_view3d_win_to_delta(ARegion *ar, const float mval[2], float out[3])
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
float dx, dy;
- dx= 2.0f*mval[0]*rv3d->zfac/ar->winx;
- dy= 2.0f*mval[1]*rv3d->zfac/ar->winy;
+ dx = 2.0f * mval[0] * rv3d->zfac / ar->winx;
+ dy = 2.0f * mval[1] * rv3d->zfac / ar->winy;
- out[0]= (rv3d->persinv[0][0]*dx + rv3d->persinv[1][0]*dy);
- out[1]= (rv3d->persinv[0][1]*dx + rv3d->persinv[1][1]*dy);
- out[2]= (rv3d->persinv[0][2]*dx + rv3d->persinv[1][2]*dy);
+ out[0] = (rv3d->persinv[0][0] * dx + rv3d->persinv[1][0] * dy);
+ out[1] = (rv3d->persinv[0][1] * dx + rv3d->persinv[1][1] * dy);
+ out[2] = (rv3d->persinv[0][2] * dx + rv3d->persinv[1][2] * dy);
}
/* doesn't rely on initgrabz */
@@ -714,12 +714,12 @@ void ED_view3d_win_to_delta(ARegion *ar, const float mval[2], float out[3])
* the mouse cursor as a normalized vector */
void ED_view3d_win_to_vector(ARegion *ar, const float mval[2], float out[3])
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
if (rv3d->is_persp) {
- out[0]= 2.0f * (mval[0] / ar->winx) - 1.0f;
- out[1]= 2.0f * (mval[1] / ar->winy) - 1.0f;
- out[2]= -0.5f;
+ out[0] = 2.0f * (mval[0] / ar->winx) - 1.0f;
+ out[1] = 2.0f * (mval[1] / ar->winy) - 1.0f;
+ out[2] = -0.5f;
mul_project_m4_v3(rv3d->persinv, out);
sub_v3_v3(out, rv3d->viewinv[3]);
}
@@ -745,7 +745,7 @@ float ED_view3d_depth_read_cached(ViewContext *vc, int x, int y)
void ED_view3d_depth_tag_update(RegionView3D *rv3d)
{
if (rv3d->depths)
- rv3d->depths->damaged= 1;
+ rv3d->depths->damaged = 1;
}
void ED_view3d_ob_project_mat_get(RegionView3D *rv3d, Object *ob, float pmat[4][4])
@@ -757,32 +757,33 @@ 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;
+ 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];
- adr[1] = (float)(ar->winy/2.0f)+(ar->winy/2.0f)*vec4[1]/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 {
adr[0] = adr[1] = 0.0f;
@@ -790,23 +791,23 @@ 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;
+ 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];
- adr[1] = (float)(ar->winy/2.0f)+(ar->winy/2.0f)*vec4[1]/vec4[3];
- adr[2] = vec4[2]/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];
+ adr[2] = vec4[2] / vec4[3];
}
else {
- adr[0] = adr[1] = adr[2] = 0.0f;
+ zero_v3(adr);
}
}
@@ -816,41 +817,41 @@ int ED_view3d_boundbox_clip(RegionView3D *rv3d, float obmat[][4], BoundBox *bb)
float mat[4][4];
float vec[4], min, max;
- int a, flag= -1, fl;
+ int a, flag = -1, fl;
- if (bb==NULL) return 1;
+ if (bb == NULL) return 1;
if (bb->flag & OB_BB_DISABLED) return 1;
mult_m4_m4m4(mat, rv3d->persmat, obmat);
- for (a=0; a<8; a++) {
+ for (a = 0; a < 8; a++) {
copy_v3_v3(vec, bb->vec[a]);
- vec[3]= 1.0;
+ vec[3] = 1.0;
mul_m4_v4(mat, vec);
- max= vec[3];
- min= -vec[3];
+ max = vec[3];
+ min = -vec[3];
- fl= 0;
- if (vec[0] < min) fl+= 1;
- if (vec[0] > max) fl+= 2;
- if (vec[1] < min) fl+= 4;
- if (vec[1] > max) fl+= 8;
- if (vec[2] < min) fl+= 16;
- if (vec[2] > max) fl+= 32;
+ fl = 0;
+ if (vec[0] < min) fl += 1;
+ if (vec[0] > max) fl += 2;
+ if (vec[1] < min) fl += 4;
+ if (vec[1] > max) fl += 8;
+ if (vec[2] < min) fl += 16;
+ if (vec[2] > max) fl += 32;
flag &= fl;
- if (flag==0) return 1;
+ if (flag == 0) return 1;
}
return 0;
}
-void project_short(ARegion *ar, const float vec[3], short adr[2]) /* clips */
+void project_short(ARegion *ar, const float vec[3], short adr[2]) /* clips */
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
float fx, fy, vec4[4];
- adr[0]= IS_CLIPPED;
+ adr[0] = IS_CLIPPED;
if (rv3d->rflag & RV3D_CLIPPING) {
if (ED_view3d_clipping_test(rv3d, vec, FALSE)) {
@@ -859,19 +860,19 @@ void project_short(ARegion *ar, const float vec[3], short adr[2]) /* clips */
}
copy_v3_v3(vec4, vec);
- vec4[3]= 1.0;
+ vec4[3] = 1.0;
mul_m4_v4(rv3d->persmat, vec4);
- if ( vec4[3] > (float)BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */
- fx= (ar->winx/2)*(1 + vec4[0]/vec4[3]);
+ if (vec4[3] > (float)BL_NEAR_CLIP) { /* 0.001 is the NEAR clipping cutoff for picking */
+ fx = (ar->winx / 2) * (1 + vec4[0] / vec4[3]);
- if ( fx>0 && fx<ar->winx) {
+ if (fx > 0 && fx < ar->winx) {
- fy= (ar->winy/2)*(1 + vec4[1]/vec4[3]);
+ fy = (ar->winy / 2) * (1 + vec4[1] / vec4[3]);
if (fy > 0.0f && fy < (float)ar->winy) {
- adr[0]= (short)floor(fx);
- adr[1]= (short)floor(fy);
+ adr[0] = (short)floor(fx);
+ adr[1] = (short)floor(fy);
}
}
}
@@ -879,24 +880,24 @@ void project_short(ARegion *ar, const float vec[3], short adr[2]) /* clips */
void project_int(ARegion *ar, const float vec[3], int adr[2])
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
float fx, fy, vec4[4];
copy_v3_v3(vec4, vec);
- vec4[3]= 1.0;
- adr[0]= (int)2140000000.0f;
+ vec4[3] = 1.0;
+ adr[0] = (int)2140000000.0f;
mul_m4_v4(rv3d->persmat, vec4);
- if ( vec4[3] > (float)BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */
- fx= (ar->winx/2)*(1 + vec4[0]/vec4[3]);
+ if (vec4[3] > (float)BL_NEAR_CLIP) { /* 0.001 is the NEAR clipping cutoff for picking */
+ fx = (ar->winx / 2) * (1 + vec4[0] / vec4[3]);
- if ( fx>-2140000000.0f && fx<2140000000.0f) {
- fy= (ar->winy/2)*(1 + vec4[1]/vec4[3]);
+ if (fx > -2140000000.0f && fx < 2140000000.0f) {
+ fy = (ar->winy / 2) * (1 + vec4[1] / vec4[3]);
- if (fy>-2140000000.0f && fy<2140000000.0f) {
- adr[0]= (int)floor(fx);
- adr[1]= (int)floor(fy);
+ if (fy > -2140000000.0f && fy < 2140000000.0f) {
+ adr[0] = (int)floor(fx);
+ adr[1] = (int)floor(fy);
}
}
}
@@ -904,17 +905,17 @@ void project_int(ARegion *ar, const float vec[3], int adr[2])
void project_int_noclip(ARegion *ar, const float vec[3], int adr[2])
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
float fx, fy, vec4[4];
copy_v3_v3(vec4, vec);
- vec4[3]= 1.0;
+ vec4[3] = 1.0;
mul_m4_v4(rv3d->persmat, vec4);
- if ( fabs(vec4[3]) > BL_NEAR_CLIP ) {
- fx = (ar->winx/2)*(1 + vec4[0]/vec4[3]);
- fy = (ar->winy/2)*(1 + vec4[1]/vec4[3]);
+ if (fabs(vec4[3]) > BL_NEAR_CLIP) {
+ fx = (ar->winx / 2) * (1 + vec4[0] / vec4[3]);
+ fy = (ar->winy / 2) * (1 + vec4[1] / vec4[3]);
adr[0] = (int)floor(fx);
adr[1] = (int)floor(fy);
@@ -927,25 +928,25 @@ void project_int_noclip(ARegion *ar, const float vec[3], int adr[2])
void project_short_noclip(ARegion *ar, const float vec[3], short adr[2])
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
float fx, fy, vec4[4];
copy_v3_v3(vec4, vec);
- vec4[3]= 1.0;
- adr[0]= IS_CLIPPED;
+ vec4[3] = 1.0;
+ adr[0] = IS_CLIPPED;
mul_m4_v4(rv3d->persmat, vec4);
- if ( vec4[3] > (float)BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */
- fx= (ar->winx/2)*(1 + vec4[0]/vec4[3]);
+ if (vec4[3] > (float)BL_NEAR_CLIP) { /* 0.001 is the NEAR clipping cutoff for picking */
+ fx = (ar->winx / 2) * (1 + vec4[0] / vec4[3]);
- if ( fx>-32700 && fx<32700) {
+ if (fx > -32700 && fx < 32700) {
- fy= (ar->winy/2)*(1 + vec4[1]/vec4[3]);
+ fy = (ar->winy / 2) * (1 + vec4[1] / vec4[3]);
if (fy > -32700.0f && fy < 32700.0f) {
- adr[0]= (short)floor(fx);
- adr[1]= (short)floor(fy);
+ adr[0] = (short)floor(fx);
+ adr[1] = (short)floor(fy);
}
}
}
@@ -956,37 +957,37 @@ void apply_project_float(float persmat[4][4], int winx, int winy, const float ve
float vec4[4];
copy_v3_v3(vec4, vec);
- vec4[3]= 1.0;
- adr[0]= IS_CLIPPED;
+ vec4[3] = 1.0;
+ adr[0] = IS_CLIPPED;
mul_m4_v4(persmat, vec4);
if (vec4[3] > (float)BL_NEAR_CLIP) {
- adr[0] = (float)(winx/2.0f)+(winx/2.0f)*vec4[0]/vec4[3];
- adr[1] = (float)(winy/2.0f)+(winy/2.0f)*vec4[1]/vec4[3];
+ adr[0] = (float)(winx / 2.0f) + (winx / 2.0f) * vec4[0] / vec4[3];
+ adr[1] = (float)(winy / 2.0f) + (winy / 2.0f) * vec4[1] / vec4[3];
}
}
void project_float(ARegion *ar, const float vec[3], float adr[2])
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
apply_project_float(rv3d->persmat, ar->winx, ar->winy, vec, adr);
}
void project_float_noclip(ARegion *ar, const float vec[3], float adr[2])
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
float vec4[4];
copy_v3_v3(vec4, vec);
- vec4[3]= 1.0;
+ vec4[3] = 1.0;
mul_m4_v4(rv3d->persmat, vec4);
- if ( fabs(vec4[3]) > BL_NEAR_CLIP ) {
- 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];
+ if (fabs(vec4[3]) > BL_NEAR_CLIP) {
+ 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 {
adr[0] = ar->winx / 2.0f;
@@ -1002,8 +1003,8 @@ int ED_view3d_clip_range_get(View3D *v3d, RegionView3D *rv3d, float *clipsta, fl
camera_params_init(&params);
camera_params_from_view3d(&params, v3d, rv3d);
- if (clipsta) *clipsta= params.clipsta;
- if (clipend) *clipend= params.clipend;
+ if (clipsta) *clipsta = params.clipsta;
+ if (clipend) *clipend = params.clipend;
return params.is_ortho;
}
@@ -1018,22 +1019,22 @@ int ED_view3d_viewplane_get(View3D *v3d, RegionView3D *rv3d, int winx, int winy,
camera_params_from_view3d(&params, v3d, rv3d);
camera_params_compute_viewplane(&params, winx, winy, 1.0f, 1.0f);
- if (viewplane) *viewplane= params.viewplane;
- if (clipsta) *clipsta= params.clipsta;
- if (clipend) *clipend= params.clipend;
+ if (viewplane) *viewplane = params.viewplane;
+ if (clipsta) *clipsta = params.clipsta;
+ if (clipend) *clipend = params.clipend;
return params.is_ortho;
}
-void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect) /* rect: for picking */
+void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect) /* rect: for picking */
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
rctf viewplane;
float clipsta, clipend, x1, y1, x2, y2;
int orth;
- orth= ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, &viewplane, &clipsta, &clipend);
- rv3d->is_persp= !orth;
+ orth = ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, &viewplane, &clipsta, &clipend);
+ rv3d->is_persp = !orth;
#if 0
printf("%s: %d %d %f %f %f %f %f %f\n", __func__, winx, winy,
@@ -1041,20 +1042,20 @@ void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect) /* rect: for pick
clipsta, clipend);
#endif
- x1= viewplane.xmin;
- y1= viewplane.ymin;
- x2= viewplane.xmax;
- y2= viewplane.ymax;
-
- if (rect) { /* picking */
- rect->xmin/= (float)ar->winx;
- rect->xmin= x1+rect->xmin*(x2-x1);
- rect->ymin/= (float)ar->winy;
- rect->ymin= y1+rect->ymin*(y2-y1);
- rect->xmax/= (float)ar->winx;
- rect->xmax= x1+rect->xmax*(x2-x1);
- rect->ymax/= (float)ar->winy;
- rect->ymax= y1+rect->ymax*(y2-y1);
+ x1 = viewplane.xmin;
+ y1 = viewplane.ymin;
+ x2 = viewplane.xmax;
+ y2 = viewplane.ymax;
+
+ if (rect) { /* picking */
+ rect->xmin /= (float)ar->winx;
+ rect->xmin = x1 + rect->xmin * (x2 - x1);
+ rect->ymin /= (float)ar->winy;
+ rect->ymin = y1 + rect->ymin * (y2 - y1);
+ rect->xmax /= (float)ar->winx;
+ rect->xmax = x1 + rect->xmax * (x2 - x1);
+ rect->ymax /= (float)ar->winy;
+ rect->ymax = y1 + rect->ymax * (y2 - y1);
if (orth) wmOrtho(rect->xmin, rect->xmax, rect->ymin, rect->ymax, -clipend, clipend);
else wmFrustum(rect->xmin, rect->xmax, rect->ymin, rect->ymax, clipsta, clipend);
@@ -1066,7 +1067,7 @@ void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect) /* rect: for pick
}
/* update matrix in 3d view region */
- glGetFloatv(GL_PROJECTION_MATRIX, (float*)rv3d->winmat);
+ glGetFloatv(GL_PROJECTION_MATRIX, (float *)rv3d->winmat);
}
static void obmat_to_viewmat(View3D *v3d, RegionView3D *rv3d, Object *ob, short smooth)
@@ -1074,7 +1075,7 @@ static void obmat_to_viewmat(View3D *v3d, RegionView3D *rv3d, Object *ob, short
float bmat[4][4];
float tmat[3][3];
- rv3d->view= RV3D_VIEW_USER; /* dont show the grid */
+ rv3d->view = RV3D_VIEW_USER; /* don't show the grid */
copy_m4_m4(bmat, ob->obmat);
normalize_m4(bmat);
@@ -1084,82 +1085,82 @@ static void obmat_to_viewmat(View3D *v3d, RegionView3D *rv3d, Object *ob, short
copy_m3_m4(tmat, rv3d->viewmat);
if (smooth) {
float new_quat[4];
- if (rv3d->persp==RV3D_CAMOB && v3d->camera) {
+ if (rv3d->persp == RV3D_CAMOB && v3d->camera) {
/* were from a camera view */
float orig_ofs[3];
- float orig_dist= rv3d->dist;
- float orig_lens= v3d->lens;
+ float orig_dist = rv3d->dist;
+ float orig_lens = v3d->lens;
copy_v3_v3(orig_ofs, rv3d->ofs);
/* Switch from camera view */
- mat3_to_quat( new_quat,tmat);
+ mat3_to_quat(new_quat, tmat);
- rv3d->persp=RV3D_PERSP;
- rv3d->dist= 0.0;
+ rv3d->persp = RV3D_PERSP;
+ rv3d->dist = 0.0;
ED_view3d_from_object(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens);
smooth_view(NULL, NULL, NULL, NULL, NULL, orig_ofs, new_quat, &orig_dist, &orig_lens); // XXX
- rv3d->persp=RV3D_CAMOB; /* just to be polite, not needed */
+ rv3d->persp = RV3D_CAMOB; /* just to be polite, not needed */
}
else {
- mat3_to_quat( new_quat,tmat);
+ mat3_to_quat(new_quat, tmat);
smooth_view(NULL, NULL, NULL, NULL, NULL, NULL, new_quat, NULL, NULL); // XXX
}
}
else {
- mat3_to_quat( rv3d->viewquat,tmat);
+ mat3_to_quat(rv3d->viewquat, tmat);
}
}
-#define QUATSET(a, b, c, d, e) a[0]=b; a[1]=c; a[2]=d; a[3]=e;
+#define QUATSET(a, b, c, d, e) { a[0] = b; a[1] = c; a[2] = d; a[3] = e; } (void)0
int ED_view3d_lock(RegionView3D *rv3d)
{
- switch(rv3d->view) {
- case RV3D_VIEW_BOTTOM :
- QUATSET(rv3d->viewquat,0.0, -1.0, 0.0, 0.0);
- break;
+ switch (rv3d->view) {
+ case RV3D_VIEW_BOTTOM:
+ QUATSET(rv3d->viewquat, 0.0, -1.0, 0.0, 0.0);
+ break;
- case RV3D_VIEW_BACK:
- QUATSET(rv3d->viewquat,0.0, 0.0, (float)-cos(M_PI/4.0), (float)-cos(M_PI/4.0));
- break;
+ case RV3D_VIEW_BACK:
+ QUATSET(rv3d->viewquat, 0.0, 0.0, (float)-cos(M_PI / 4.0), (float)-cos(M_PI / 4.0));
+ break;
- case RV3D_VIEW_LEFT:
- QUATSET(rv3d->viewquat,0.5, -0.5, 0.5, 0.5);
- break;
+ case RV3D_VIEW_LEFT:
+ QUATSET(rv3d->viewquat, 0.5, -0.5, 0.5, 0.5);
+ break;
- case RV3D_VIEW_TOP:
- QUATSET(rv3d->viewquat,1.0, 0.0, 0.0, 0.0);
- break;
+ case RV3D_VIEW_TOP:
+ QUATSET(rv3d->viewquat, 1.0, 0.0, 0.0, 0.0);
+ break;
- case RV3D_VIEW_FRONT:
- QUATSET(rv3d->viewquat,(float)cos(M_PI/4.0), (float)-sin(M_PI/4.0), 0.0, 0.0);
- break;
+ case RV3D_VIEW_FRONT:
+ QUATSET(rv3d->viewquat, (float)cos(M_PI / 4.0), (float)-sin(M_PI / 4.0), 0.0, 0.0);
+ break;
- case RV3D_VIEW_RIGHT:
- QUATSET(rv3d->viewquat, 0.5, -0.5, -0.5, -0.5);
- break;
- default:
- return FALSE;
+ case RV3D_VIEW_RIGHT:
+ QUATSET(rv3d->viewquat, 0.5, -0.5, -0.5, -0.5);
+ break;
+ default:
+ return FALSE;
}
return TRUE;
}
-/* dont set windows active in here, is used by renderwin too */
+/* don't set windows active in here, is used by renderwin too */
void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d)
{
- if (rv3d->persp==RV3D_CAMOB) { /* obs/camera */
+ if (rv3d->persp == RV3D_CAMOB) { /* obs/camera */
if (v3d->camera) {
where_is_object(scene, v3d->camera);
obmat_to_viewmat(v3d, rv3d, v3d->camera, 0);
}
else {
- quat_to_mat4( rv3d->viewmat,rv3d->viewquat);
- rv3d->viewmat[3][2]-= rv3d->dist;
+ quat_to_mat4(rv3d->viewmat, rv3d->viewquat);
+ rv3d->viewmat[3][2] -= rv3d->dist;
}
}
else {
@@ -1167,41 +1168,41 @@ void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d)
if (rv3d->viewlock)
ED_view3d_lock(rv3d);
- quat_to_mat4( rv3d->viewmat,rv3d->viewquat);
- if (rv3d->persp==RV3D_PERSP) rv3d->viewmat[3][2]-= rv3d->dist;
+ quat_to_mat4(rv3d->viewmat, rv3d->viewquat);
+ if (rv3d->persp == RV3D_PERSP) rv3d->viewmat[3][2] -= rv3d->dist;
if (v3d->ob_centre) {
- Object *ob= v3d->ob_centre;
+ Object *ob = v3d->ob_centre;
float vec[3];
copy_v3_v3(vec, ob->obmat[3]);
- if (ob->type==OB_ARMATURE && v3d->ob_centre_bone[0]) {
- bPoseChannel *pchan= get_pose_channel(ob->pose, v3d->ob_centre_bone);
+ if (ob->type == OB_ARMATURE && v3d->ob_centre_bone[0]) {
+ bPoseChannel *pchan = get_pose_channel(ob->pose, v3d->ob_centre_bone);
if (pchan) {
copy_v3_v3(vec, pchan->pose_mat[3]);
mul_m4_v3(ob->obmat, vec);
}
}
- translate_m4( rv3d->viewmat,-vec[0], -vec[1], -vec[2]);
+ translate_m4(rv3d->viewmat, -vec[0], -vec[1], -vec[2]);
}
else if (v3d->ob_centre_cursor) {
float vec[3];
copy_v3_v3(vec, give_cursor(scene, v3d));
translate_m4(rv3d->viewmat, -vec[0], -vec[1], -vec[2]);
}
- else translate_m4( rv3d->viewmat,rv3d->ofs[0], rv3d->ofs[1], rv3d->ofs[2]);
+ else translate_m4(rv3d->viewmat, rv3d->ofs[0], rv3d->ofs[1], rv3d->ofs[2]);
}
}
-/* 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;
- View3D *v3d= vc->v3d;
- ARegion *ar= vc->ar;
+ Scene *scene = vc->scene;
+ View3D *v3d = vc->v3d;
+ ARegion *ar = vc->ar;
rctf rect;
short code, hits;
char dt, dtx;
@@ -1209,58 +1210,58 @@ short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int b
G.f |= G_PICKSEL;
/* case not a border select */
- if (input->xmin==input->xmax) {
- rect.xmin= input->xmin-12; // seems to be default value for bones only now
- rect.xmax= input->xmin+12;
- rect.ymin= input->ymin-12;
- rect.ymax= input->ymin+12;
+ if (input->xmin == input->xmax) {
+ rect.xmin = input->xmin - 12; // seems to be default value for bones only now
+ rect.xmax = input->xmin + 12;
+ rect.ymin = input->ymin - 12;
+ rect.ymax = input->ymin + 12;
}
else {
- rect.xmin= input->xmin;
- rect.xmax= input->xmax;
- rect.ymin= input->ymin;
- rect.ymax= input->ymax;
+ rect.xmin = input->xmin;
+ rect.xmax = input->xmax;
+ rect.ymin = input->ymin;
+ rect.ymax = input->ymax;
}
setwinmatrixview3d(ar, v3d, &rect);
mult_m4_m4m4(vc->rv3d->persmat, vc->rv3d->winmat, vc->rv3d->viewmat);
if (v3d->drawtype > OB_WIRE) {
- v3d->zbuf= TRUE;
+ v3d->zbuf = TRUE;
glEnable(GL_DEPTH_TEST);
}
if (vc->rv3d->rflag & RV3D_CLIPPING)
ED_view3d_clipping_set(vc->rv3d);
- glSelectBuffer( bufsize, (GLuint *)buffer);
+ glSelectBuffer(bufsize, (GLuint *)buffer);
glRenderMode(GL_SELECT);
- glInitNames(); /* these two calls whatfor? It doesnt work otherwise */
+ glInitNames(); /* these two calls whatfor? It doesnt work otherwise */
glPushName(-1);
- code= 1;
+ code = 1;
- if (vc->obedit && vc->obedit->type==OB_MBALL) {
- draw_object(scene, ar, v3d, BASACT, DRAW_PICKING|DRAW_CONSTCOLOR);
+ if (vc->obedit && vc->obedit->type == OB_MBALL) {
+ draw_object(scene, ar, v3d, BASACT, DRAW_PICKING | DRAW_CONSTCOLOR);
}
- else if ((vc->obedit && vc->obedit->type==OB_ARMATURE)) {
+ else if ((vc->obedit && vc->obedit->type == OB_ARMATURE)) {
/* if not drawing sketch, draw bones */
if (!BDR_drawSketchNames(vc)) {
- draw_object(scene, ar, v3d, BASACT, DRAW_PICKING|DRAW_CONSTCOLOR);
+ draw_object(scene, ar, v3d, BASACT, DRAW_PICKING | DRAW_CONSTCOLOR);
}
}
else {
Base *base;
- v3d->xray= TRUE; // otherwise it postpones drawing
- for (base= scene->base.first; base; base= base->next) {
+ v3d->xray = TRUE; // otherwise it postpones drawing
+ for (base = scene->base.first; base; base = base->next) {
if (base->lay & v3d->lay) {
if (base->object->restrictflag & OB_RESTRICT_SELECT)
- base->selcol= 0;
+ base->selcol = 0;
else {
- base->selcol= code;
+ base->selcol = code;
glLoadName(code);
- draw_object(scene, ar, v3d, base, DRAW_PICKING|DRAW_CONSTCOLOR);
+ draw_object(scene, ar, v3d, base, DRAW_PICKING | DRAW_CONSTCOLOR);
/* we draw group-duplicators for selection too */
if ((base->object->transflag & OB_DUPLI) && base->object->dup_group) {
@@ -1268,22 +1269,22 @@ short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int b
DupliObject *dob;
Base tbase;
- tbase.flag= OB_FROMDUPLI;
- lb= object_duplilist(scene, base->object);
+ tbase.flag = OB_FROMDUPLI;
+ lb = object_duplilist(scene, base->object);
- for (dob= lb->first; dob; dob= dob->next) {
- tbase.object= dob->ob;
+ for (dob = lb->first; dob; dob = dob->next) {
+ tbase.object = dob->ob;
copy_m4_m4(dob->ob->obmat, dob->mat);
/* extra service: draw the duplicator in drawtype of parent */
/* MIN2 for the drawtype to allow bounding box objects in groups for lods */
- dt= tbase.object->dt; tbase.object->dt= MIN2(tbase.object->dt, base->object->dt);
- dtx= tbase.object->dtx; tbase.object->dtx= base->object->dtx;
+ dt = tbase.object->dt; tbase.object->dt = MIN2(tbase.object->dt, base->object->dt);
+ dtx = tbase.object->dtx; tbase.object->dtx = base->object->dtx;
- draw_object(scene, ar, v3d, &tbase, DRAW_PICKING|DRAW_CONSTCOLOR);
+ draw_object(scene, ar, v3d, &tbase, DRAW_PICKING | DRAW_CONSTCOLOR);
- tbase.object->dt= dt;
- tbase.object->dtx= dtx;
+ tbase.object->dt = dt;
+ tbase.object->dtx = dtx;
copy_m4_m4(dob->ob->obmat, dob->omat);
}
@@ -1293,18 +1294,18 @@ short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int b
}
}
}
- v3d->xray= FALSE; // restore
+ v3d->xray = FALSE; // restore
}
- glPopName(); /* see above (pushname) */
- hits= glRenderMode(GL_RENDER);
+ glPopName(); /* see above (pushname) */
+ hits = glRenderMode(GL_RENDER);
G.f &= ~G_PICKSEL;
setwinmatrixview3d(ar, v3d, NULL);
mult_m4_m4m4(vc->rv3d->persmat, vc->rv3d->winmat, vc->rv3d->viewmat);
if (v3d->drawtype > OB_WIRE) {
- v3d->zbuf= 0;
+ v3d->zbuf = 0;
glDisable(GL_DEPTH_TEST);
}
// XXX persp(PERSP_WIN);
@@ -1312,7 +1313,7 @@ short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int b
if (vc->rv3d->rflag & RV3D_CLIPPING)
ED_view3d_clipping_disable();
- if (hits<0) printf("Too many objects in select buffer\n"); // XXX make error message
+ if (hits < 0) printf("Too many objects in select buffer\n"); // XXX make error message
return hits;
}
@@ -1325,64 +1326,64 @@ static unsigned int free_localbit(Main *bmain)
ScrArea *sa;
bScreen *sc;
- lay= 0;
+ lay = 0;
/* sometimes we loose a localview: when an area is closed */
/* check all areas: which localviews are in use? */
- for (sc= bmain->screen.first; sc; sc= sc->id.next) {
- for (sa= sc->areabase.first; sa; sa= sa->next) {
- SpaceLink *sl= sa->spacedata.first;
- for (; sl; sl= sl->next) {
- if (sl->spacetype==SPACE_VIEW3D) {
- View3D *v3d= (View3D*) sl;
+ for (sc = bmain->screen.first; sc; sc = sc->id.next) {
+ for (sa = sc->areabase.first; sa; sa = sa->next) {
+ SpaceLink *sl = sa->spacedata.first;
+ for (; sl; sl = sl->next) {
+ if (sl->spacetype == SPACE_VIEW3D) {
+ View3D *v3d = (View3D *) sl;
lay |= v3d->lay;
}
}
}
}
- if ( (lay & 0x01000000)==0) return 0x01000000;
- if ( (lay & 0x02000000)==0) return 0x02000000;
- if ( (lay & 0x04000000)==0) return 0x04000000;
- if ( (lay & 0x08000000)==0) return 0x08000000;
- if ( (lay & 0x10000000)==0) return 0x10000000;
- if ( (lay & 0x20000000)==0) return 0x20000000;
- if ( (lay & 0x40000000)==0) return 0x40000000;
- if ( (lay & 0x80000000)==0) return 0x80000000;
+ if ((lay & 0x01000000) == 0) return 0x01000000;
+ if ((lay & 0x02000000) == 0) return 0x02000000;
+ if ((lay & 0x04000000) == 0) return 0x04000000;
+ if ((lay & 0x08000000) == 0) return 0x08000000;
+ if ((lay & 0x10000000) == 0) return 0x10000000;
+ if ((lay & 0x20000000) == 0) return 0x20000000;
+ if ((lay & 0x40000000) == 0) return 0x40000000;
+ if ((lay & 0x80000000) == 0) return 0x80000000;
return 0;
}
int ED_view3d_scene_layer_set(int lay, const int *values, int *active)
{
- int i, tot= 0;
+ int i, tot = 0;
/* ensure we always have some layer selected */
- for (i=0; i<20; i++)
+ for (i = 0; i < 20; i++)
if (values[i])
tot++;
- if (tot==0)
+ if (tot == 0)
return lay;
- for (i=0; i<20; i++) {
+ for (i = 0; i < 20; i++) {
if (active) {
/* if this value has just been switched on, make that layer active */
- if (values[i] && (lay & (1<<i))==0) {
- *active = (1<<i);
+ if (values[i] && (lay & (1 << i)) == 0) {
+ *active = (1 << i);
}
}
- if (values[i]) lay |= (1<<i);
- else lay &= ~(1<<i);
+ if (values[i]) lay |= (1 << i);
+ else lay &= ~(1 << i);
}
/* ensure always an active layer */
- if (active && (lay & *active)==0) {
- for (i=0; i<20; i++) {
- if (lay & (1<<i)) {
- *active= 1<<i;
+ if (active && (lay & *active) == 0) {
+ for (i = 0; i < 20; i++) {
+ if (lay & (1 << i)) {
+ *active = 1 << i;
break;
}
}
@@ -1393,97 +1394,97 @@ int ED_view3d_scene_layer_set(int lay, const int *values, int *active)
static void initlocalview(Main *bmain, Scene *scene, ScrArea *sa)
{
- View3D *v3d= sa->spacedata.first;
+ View3D *v3d = sa->spacedata.first;
Base *base;
float size = 0.0, min[3], max[3], box[3];
unsigned int locallay;
- int ok=0;
+ int ok = 0;
if (v3d->localvd) return;
INIT_MINMAX(min, max);
- locallay= free_localbit(bmain);
+ locallay = free_localbit(bmain);
- if (locallay==0) {
- printf("Sorry, no more than 8 localviews\n"); // XXX error
- ok= 0;
+ if (locallay == 0) {
+ printf("Sorry, no more than 8 localviews\n"); // XXX error
+ ok = 0;
}
else {
if (scene->obedit) {
minmax_object(scene->obedit, min, max);
- ok= 1;
+ ok = 1;
BASACT->lay |= locallay;
- scene->obedit->lay= BASACT->lay;
+ scene->obedit->lay = BASACT->lay;
}
else {
- for (base= FIRSTBASE; base; base= base->next) {
+ for (base = FIRSTBASE; base; base = base->next) {
if (TESTBASE(v3d, base)) {
minmax_object(base->object, min, max);
base->lay |= locallay;
- base->object->lay= base->lay;
- ok= 1;
+ base->object->lay = base->lay;
+ ok = 1;
}
}
}
- box[0]= (max[0]-min[0]);
- box[1]= (max[1]-min[1]);
- box[2]= (max[2]-min[2]);
- size= MAX3(box[0], box[1], box[2]);
- if (size <= 0.01f) size= 0.01f;
+ box[0] = (max[0] - min[0]);
+ box[1] = (max[1] - min[1]);
+ box[2] = (max[2] - min[2]);
+ size = MAX3(box[0], box[1], box[2]);
+ if (size <= 0.01f) size = 0.01f;
}
if (ok) {
ARegion *ar;
- v3d->localvd= MEM_mallocN(sizeof(View3D), "localview");
+ v3d->localvd = MEM_mallocN(sizeof(View3D), "localview");
memcpy(v3d->localvd, v3d, sizeof(View3D));
- for (ar= sa->regionbase.first; ar; ar= ar->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
if (ar->regiontype == RGN_TYPE_WINDOW) {
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
- rv3d->localvd= MEM_mallocN(sizeof(RegionView3D), "localview region");
+ rv3d->localvd = MEM_mallocN(sizeof(RegionView3D), "localview region");
memcpy(rv3d->localvd, rv3d, sizeof(RegionView3D));
- rv3d->ofs[0]= -(min[0]+max[0])/2.0f;
- rv3d->ofs[1]= -(min[1]+max[1])/2.0f;
- rv3d->ofs[2]= -(min[2]+max[2])/2.0f;
+ rv3d->ofs[0] = -(min[0] + max[0]) / 2.0f;
+ rv3d->ofs[1] = -(min[1] + max[1]) / 2.0f;
+ rv3d->ofs[2] = -(min[2] + max[2]) / 2.0f;
- rv3d->dist= size;
+ rv3d->dist = size;
/* perspective should be a bit farther away to look nice */
- if (rv3d->persp==RV3D_ORTHO)
- rv3d->dist*= 0.7f;
+ if (rv3d->persp == RV3D_ORTHO)
+ rv3d->dist *= 0.7f;
// correction for window aspect ratio
- if (ar->winy>2 && ar->winx>2) {
- float asp= (float)ar->winx/(float)ar->winy;
- if (asp < 1.0f) asp= 1.0f/asp;
- rv3d->dist*= asp;
+ if (ar->winy > 2 && ar->winx > 2) {
+ float asp = (float)ar->winx / (float)ar->winy;
+ if (asp < 1.0f) asp = 1.0f / asp;
+ rv3d->dist *= asp;
}
- if (rv3d->persp==RV3D_CAMOB) rv3d->persp= RV3D_PERSP;
+ if (rv3d->persp == RV3D_CAMOB) rv3d->persp = RV3D_PERSP;
- v3d->cursor[0]= -rv3d->ofs[0];
- v3d->cursor[1]= -rv3d->ofs[1];
- v3d->cursor[2]= -rv3d->ofs[2];
+ v3d->cursor[0] = -rv3d->ofs[0];
+ v3d->cursor[1] = -rv3d->ofs[1];
+ v3d->cursor[2] = -rv3d->ofs[2];
}
}
- v3d->lay= locallay;
+ v3d->lay = locallay;
}
else {
/* clear flags */
- for (base= FIRSTBASE; base; base= base->next) {
- if ( base->lay & locallay ) {
- base->lay-= locallay;
- if (base->lay==0) base->lay= v3d->layact;
+ for (base = FIRSTBASE; base; base = base->next) {
+ if (base->lay & locallay) {
+ base->lay -= locallay;
+ if (base->lay == 0) base->lay = v3d->layact;
if (base->object != scene->obedit) base->flag |= SELECT;
- base->object->lay= base->lay;
+ base->object->lay = base->lay;
}
}
}
@@ -1493,37 +1494,37 @@ static void initlocalview(Main *bmain, Scene *scene, ScrArea *sa)
static void restore_localviewdata(ScrArea *sa, int free)
{
ARegion *ar;
- View3D *v3d= sa->spacedata.first;
+ View3D *v3d = sa->spacedata.first;
- if (v3d->localvd==NULL) return;
+ if (v3d->localvd == NULL) return;
- v3d->near= v3d->localvd->near;
- v3d->far= v3d->localvd->far;
- v3d->lay= v3d->localvd->lay;
- v3d->layact= v3d->localvd->layact;
- v3d->drawtype= v3d->localvd->drawtype;
- v3d->camera= v3d->localvd->camera;
+ v3d->near = v3d->localvd->near;
+ v3d->far = v3d->localvd->far;
+ v3d->lay = v3d->localvd->lay;
+ v3d->layact = v3d->localvd->layact;
+ v3d->drawtype = v3d->localvd->drawtype;
+ v3d->camera = v3d->localvd->camera;
if (free) {
MEM_freeN(v3d->localvd);
- v3d->localvd= NULL;
+ v3d->localvd = NULL;
}
- for (ar= sa->regionbase.first; ar; ar= ar->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
if (ar->regiontype == RGN_TYPE_WINDOW) {
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
if (rv3d->localvd) {
- rv3d->dist= rv3d->localvd->dist;
+ rv3d->dist = rv3d->localvd->dist;
copy_v3_v3(rv3d->ofs, rv3d->localvd->ofs);
copy_qt_qt(rv3d->viewquat, rv3d->localvd->viewquat);
- rv3d->view= rv3d->localvd->view;
- rv3d->persp= rv3d->localvd->persp;
- rv3d->camzoom= rv3d->localvd->camzoom;
+ rv3d->view = rv3d->localvd->view;
+ rv3d->persp = rv3d->localvd->persp;
+ rv3d->camzoom = rv3d->localvd->camzoom;
if (free) {
MEM_freeN(rv3d->localvd);
- rv3d->localvd= NULL;
+ rv3d->localvd = NULL;
}
}
}
@@ -1532,28 +1533,28 @@ static void restore_localviewdata(ScrArea *sa, int free)
static void endlocalview(Main *bmain, Scene *scene, ScrArea *sa)
{
- View3D *v3d= sa->spacedata.first;
+ View3D *v3d = sa->spacedata.first;
struct Base *base;
unsigned int locallay;
if (v3d->localvd) {
- locallay= v3d->lay & 0xFF000000;
+ locallay = v3d->lay & 0xFF000000;
restore_localviewdata(sa, 1); // 1 = free
/* for when in other window the layers have changed */
- if (v3d->scenelock) v3d->lay= scene->lay;
+ if (v3d->scenelock) v3d->lay = scene->lay;
- for (base= FIRSTBASE; base; base= base->next) {
- if ( base->lay & locallay ) {
- base->lay-= locallay;
- if (base->lay==0) base->lay= v3d->layact;
+ for (base = FIRSTBASE; base; base = base->next) {
+ if (base->lay & locallay) {
+ base->lay -= locallay;
+ if (base->lay == 0) base->lay = v3d->layact;
if (base->object != scene->obedit) {
base->flag |= SELECT;
base->object->flag |= SELECT;
}
- base->object->lay= base->lay;
+ base->object->lay = base->lay;
}
}
@@ -1563,7 +1564,7 @@ static void endlocalview(Main *bmain, Scene *scene, ScrArea *sa)
static int localview_exec(bContext *C, wmOperator *UNUSED(unused))
{
- View3D *v3d= CTX_wm_view3d(C);
+ View3D *v3d = CTX_wm_view3d(C);
if (v3d->localvd)
endlocalview(CTX_data_main(C), CTX_data_scene(C), CTX_wm_area(C));
@@ -1579,15 +1580,15 @@ void VIEW3D_OT_localview(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Local View";
- ot->description= "Toggle display of selected object(s) separately and centered in view";
- ot->idname= "VIEW3D_OT_localview";
+ ot->name = "Local View";
+ ot->description = "Toggle display of selected object(s) separately and centered in view";
+ ot->idname = "VIEW3D_OT_localview";
/* api callbacks */
- ot->exec= localview_exec;
- ot->flag= OPTYPE_UNDO; /* localview changes object layer bitflags */
+ ot->exec = localview_exec;
+ ot->flag = OPTYPE_UNDO; /* localview changes object layer bitflags */
- ot->poll= ED_operator_view3d_active;
+ ot->poll = ED_operator_view3d_active;
}
#ifdef WITH_GAMEENGINE
@@ -1602,9 +1603,9 @@ static void SaveState(bContext *C, wmWindow *win)
if (obact && obact->mode & OB_MODE_TEXTURE_PAINT)
GPU_paint_set_mipmap(1);
- queue_back= win->queue;
+ queue_back = win->queue;
- win->queue.first= win->queue.last= NULL;
+ win->queue.first = win->queue.last = NULL;
//XXX waitcursor(1);
}
@@ -1625,7 +1626,7 @@ static void RestoreState(bContext *C, wmWindow *win)
//XXX G.qual= 0;
if (win) /* check because closing win can set to NULL */
- win->queue= queue_back;
+ win->queue = queue_back;
GPU_state_init();
GPU_set_tpage(NULL, 0, 0);
@@ -1641,37 +1642,37 @@ static void game_set_commmandline_options(GameData *gm)
if ( (syshandle = SYS_GetSystem()) ) {
/* User defined settings */
- test= (U.gameflags & USER_DISABLE_MIPMAP);
+ test = (U.gameflags & USER_DISABLE_MIPMAP);
GPU_set_mipmap(!test);
SYS_WriteCommandLineInt(syshandle, "nomipmap", test);
/* File specific settings: */
/* Only test the first one. These two are switched
* simultaneously. */
- test= (gm->flag & GAME_SHOW_FRAMERATE);
+ test = (gm->flag & GAME_SHOW_FRAMERATE);
SYS_WriteCommandLineInt(syshandle, "show_framerate", test);
SYS_WriteCommandLineInt(syshandle, "show_profile", test);
test = (gm->flag & GAME_SHOW_DEBUG_PROPS);
SYS_WriteCommandLineInt(syshandle, "show_properties", test);
- test= (gm->flag & GAME_SHOW_PHYSICS);
+ test = (gm->flag & GAME_SHOW_PHYSICS);
SYS_WriteCommandLineInt(syshandle, "show_physics", test);
- test= (gm->flag & GAME_ENABLE_ALL_FRAMES);
+ test = (gm->flag & GAME_ENABLE_ALL_FRAMES);
SYS_WriteCommandLineInt(syshandle, "fixedtime", test);
- test= (gm->flag & GAME_ENABLE_ANIMATION_RECORD);
+ test = (gm->flag & GAME_ENABLE_ANIMATION_RECORD);
SYS_WriteCommandLineInt(syshandle, "animation_record", test);
- test= (gm->flag & GAME_IGNORE_DEPRECATION_WARNINGS);
+ test = (gm->flag & GAME_IGNORE_DEPRECATION_WARNINGS);
SYS_WriteCommandLineInt(syshandle, "ignore_deprecation_warnings", test);
- test= (gm->matmode == GAME_MAT_MULTITEX);
+ test = (gm->matmode == GAME_MAT_MULTITEX);
SYS_WriteCommandLineInt(syshandle, "blender_material", test);
- test= (gm->matmode == GAME_MAT_GLSL);
+ test = (gm->matmode == GAME_MAT_GLSL);
SYS_WriteCommandLineInt(syshandle, "blender_glsl_material", test);
- test= (gm->flag & GAME_DISPLAY_LISTS);
+ test = (gm->flag & GAME_DISPLAY_LISTS);
SYS_WriteCommandLineInt(syshandle, "displaylists", test);
@@ -1683,15 +1684,15 @@ 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;
- if (CTX_wm_area(C)==NULL) return 0;
+ if (CTX_wm_window(C) == NULL) return 0;
+ if (CTX_wm_screen(C) == NULL) return 0;
+ if (CTX_wm_area(C) == NULL) return 0;
- if (CTX_data_mode_enum(C)!=CTX_MODE_OBJECT)
+ if (CTX_data_mode_enum(C) != CTX_MODE_OBJECT)
return 0;
return 1;
@@ -1699,20 +1700,20 @@ static int game_engine_poll(bContext *C)
int ED_view3d_context_activate(bContext *C)
{
- bScreen *sc= CTX_wm_screen(C);
- ScrArea *sa= CTX_wm_area(C);
+ bScreen *sc = CTX_wm_screen(C);
+ ScrArea *sa = CTX_wm_area(C);
ARegion *ar;
/* sa can be NULL when called from python */
- if (sa==NULL || sa->spacetype != SPACE_VIEW3D)
- for (sa=sc->areabase.first; sa; sa= sa->next)
- if (sa->spacetype==SPACE_VIEW3D)
+ if (sa == NULL || sa->spacetype != SPACE_VIEW3D)
+ for (sa = sc->areabase.first; sa; sa = sa->next)
+ if (sa->spacetype == SPACE_VIEW3D)
break;
if (!sa)
return 0;
- for (ar=sa->regionbase.first; ar; ar=ar->next)
+ for (ar = sa->regionbase.first; ar; ar = ar->next)
if (ar->regiontype == RGN_TYPE_WINDOW)
break;
@@ -1730,9 +1731,9 @@ static int game_engine_exec(bContext *C, wmOperator *op)
{
#ifdef WITH_GAMEENGINE
Scene *startscene = CTX_data_scene(C);
- ScrArea /* *sa, */ /* UNUSED */ *prevsa= CTX_wm_area(C);
- ARegion *ar, *prevar= CTX_wm_region(C);
- wmWindow *prevwin= CTX_wm_window(C);
+ ScrArea /* *sa, */ /* UNUSED */ *prevsa = CTX_wm_area(C);
+ ARegion *ar, *prevar = CTX_wm_region(C);
+ wmWindow *prevwin = CTX_wm_window(C);
RegionView3D *rv3d;
rcti cam_frame;
@@ -1743,20 +1744,20 @@ 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);
+ rv3d = CTX_wm_region_view3d(C);
/* sa= CTX_wm_area(C); */ /* UNUSED */
- ar= CTX_wm_region(C);
+ ar = CTX_wm_region(C);
view3d_operator_needs_opengl(C);
game_set_commmandline_options(&startscene->gm);
if ((rv3d->persp == RV3D_CAMOB) &&
- (startscene->gm.framing.type == SCE_GAMEFRAMING_BARS) &&
- (startscene->gm.stereoflag != STEREO_DOME))
+ (startscene->gm.framing.type == SCE_GAMEFRAMING_BARS) &&
+ (startscene->gm.stereoflag != STEREO_DOME))
{
/* Letterbox */
rctf cam_framef;
@@ -1781,7 +1782,7 @@ static int game_engine_exec(bContext *C, wmOperator *op)
/* window wasnt closed while the BGE was running */
if (BLI_findindex(&CTX_wm_manager(C)->windows, prevwin) == -1) {
- prevwin= NULL;
+ prevwin = NULL;
CTX_wm_window_set(C, NULL);
}
@@ -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);
@@ -1813,14 +1814,14 @@ void VIEW3D_OT_game_start(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Start Game Engine";
- ot->description= "Start game engine";
- ot->idname= "VIEW3D_OT_game_start";
+ ot->name = "Start Game Engine";
+ ot->description = "Start game engine";
+ ot->idname = "VIEW3D_OT_game_start";
/* api callbacks */
- ot->exec= game_engine_exec;
+ ot->exec = game_engine_exec;
- ot->poll= game_engine_poll;
+ ot->poll = game_engine_poll;
}
/* ************************************** */
@@ -1830,42 +1831,42 @@ void view3d_align_axis_to_vector(View3D *v3d, RegionView3D *rv3d, int axisidx, f
float alignaxis[3] = {0.0, 0.0, 0.0};
float norm[3], axis[3], angle, new_quat[4];
- if (axisidx > 0) alignaxis[axisidx-1]= 1.0;
- else alignaxis[-axisidx-1]= -1.0;
+ if (axisidx > 0) alignaxis[axisidx - 1] = 1.0;
+ else alignaxis[-axisidx - 1] = -1.0;
normalize_v3_v3(norm, vec);
- angle= (float)acos(dot_v3v3(alignaxis, norm));
+ angle = (float)acos(dot_v3v3(alignaxis, norm));
cross_v3_v3v3(axis, alignaxis, norm);
- axis_angle_to_quat( new_quat,axis, -angle);
+ axis_angle_to_quat(new_quat, axis, -angle);
- rv3d->view= RV3D_VIEW_USER;
+ rv3d->view = RV3D_VIEW_USER;
- if (rv3d->persp==RV3D_CAMOB && v3d->camera) {
+ if (rv3d->persp == RV3D_CAMOB && v3d->camera) {
/* switch out of camera view */
float orig_ofs[3];
- float orig_dist= rv3d->dist;
- float orig_lens= v3d->lens;
+ float orig_dist = rv3d->dist;
+ float orig_lens = v3d->lens;
copy_v3_v3(orig_ofs, rv3d->ofs);
- rv3d->persp= RV3D_PERSP;
- rv3d->dist= 0.0;
+ rv3d->persp = RV3D_PERSP;
+ rv3d->dist = 0.0;
ED_view3d_from_object(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens);
smooth_view(NULL, NULL, NULL, NULL, NULL, orig_ofs, new_quat, &orig_dist, &orig_lens); // XXX
}
else {
- if (rv3d->persp==RV3D_CAMOB) rv3d->persp= RV3D_PERSP; /* switch out of camera mode */
+ if (rv3d->persp == RV3D_CAMOB) rv3d->persp = RV3D_PERSP; /* switch out of camera mode */
smooth_view(NULL, NULL, NULL, NULL, NULL, NULL, new_quat, NULL, NULL); // XXX
}
}
float ED_view3d_pixel_size(struct RegionView3D *rv3d, const float co[3])
{
- return (rv3d->persmat[3][3] + (
- rv3d->persmat[0][3]*co[0] +
- rv3d->persmat[1][3]*co[1] +
- rv3d->persmat[2][3]*co[2])
- ) * rv3d->pixsize;
+ return (rv3d->persmat[3][3] + (
+ rv3d->persmat[0][3] * co[0] +
+ rv3d->persmat[1][3] * co[1] +
+ rv3d->persmat[2][3] * co[2])
+ ) * rv3d->pixsize;
}
/* view matrix properties utilities */
@@ -1886,8 +1887,8 @@ void ED_view3d_operator_properties_viewmat(wmOperatorType *ot)
void ED_view3d_operator_properties_viewmat_set(bContext *C, wmOperator *op)
{
- ARegion *ar= CTX_wm_region(C);
- RegionView3D *rv3d= ED_view3d_context_rv3d(C);
+ ARegion *ar = CTX_wm_region(C);
+ RegionView3D *rv3d = ED_view3d_context_rv3d(C);
if (!RNA_struct_property_is_set(op->ptr, "region_width"))
RNA_int_set(op->ptr, "region_width", ar->winx);
diff --git a/source/blender/editors/transform/CMakeLists.txt b/source/blender/editors/transform/CMakeLists.txt
index 98461918151..05a4f6f4ce5 100644
--- a/source/blender/editors/transform/CMakeLists.txt
+++ b/source/blender/editors/transform/CMakeLists.txt
@@ -49,4 +49,8 @@ set(SRC
transform.h
)
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_editor_transform "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/transform/SConscript b/source/blender/editors/transform/SConscript
index 0cf3875aa2e..dbf6179035c 100644
--- a/source/blender/editors/transform/SConscript
+++ b/source/blender/editors/transform/SConscript
@@ -8,4 +8,9 @@ incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../render/extern/include'
incs += ' ../../gpu ../../makesrna ../../blenloader ../../bmesh'
-env.BlenderLib ( 'bf_editors_transform', sources, Split(incs), [], libtype=['core'], priority=[40] )
+defs = []
+
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
+env.BlenderLib ( 'bf_editors_transform', sources, Split(incs), defs, libtype=['core'], priority=[40] )
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index f8782f47ad2..374268dc735 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -104,7 +104,7 @@ static int doEdgeSlide(TransInfo *t, float perc);
void setTransformViewMatrices(TransInfo *t)
{
- if(t->spacetype==SPACE_VIEW3D && t->ar && t->ar->regiontype == RGN_TYPE_WINDOW) {
+ if (t->spacetype==SPACE_VIEW3D && t->ar && t->ar->regiontype == RGN_TYPE_WINDOW) {
RegionView3D *rv3d = t->ar->regiondata;
copy_m4_m4(t->viewmat, rv3d->viewmat);
@@ -136,51 +136,53 @@ 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 r_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, r_vec);
}
- else if(t->spacetype==SPACE_IMAGE) {
+ else if (t->spacetype==SPACE_IMAGE) {
float aspx, aspy;
- convertViewVec2D(t->view, vec, dx, dy);
+ convertViewVec2D(t->view, r_vec, dx, dy);
ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
- vec[0]*= aspx;
- vec[1]*= aspy;
+ r_vec[0] *= aspx;
+ r_vec[1] *= aspy;
}
- else if(ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) {
- convertViewVec2D(t->view, vec, dx, dy);
+ else if (ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) {
+ convertViewVec2D(t->view, r_vec, dx, dy);
}
- else if(ELEM(t->spacetype, SPACE_NODE, SPACE_SEQ)) {
- convertViewVec2D(&t->ar->v2d, vec, dx, dy);
+ else if (ELEM(t->spacetype, SPACE_NODE, SPACE_SEQ)) {
+ convertViewVec2D(&t->ar->v2d, r_vec, dx, dy);
}
- else if(t->spacetype==SPACE_CLIP) {
+ else if (t->spacetype==SPACE_CLIP) {
View2D *v2d = t->view;
float divx, divy;
- divx= v2d->mask.xmax-v2d->mask.xmin;
- divy= v2d->mask.ymax-v2d->mask.ymin;
+ divx = v2d->mask.xmax-v2d->mask.xmin;
+ divy = v2d->mask.ymax-v2d->mask.ymin;
- vec[0]= (v2d->cur.xmax-v2d->cur.xmin)*(dx)/divx;
- vec[1]= (v2d->cur.ymax-v2d->cur.ymin)*(dy)/divy;
- vec[2]= 0.0f;
+ r_vec[0] = (v2d->cur.xmax-v2d->cur.xmin)*(dx)/divx;
+ r_vec[1] = (v2d->cur.ymax-v2d->cur.ymin)*(dy)/divy;
+ r_vec[2] = 0.0f;
+ }
+ else {
+ printf("%s: called in an invalid context\n", __func__);
+ zero_v3(r_vec);
}
}
-void projectIntView(TransInfo *t, float *vec, int *adr)
+void projectIntView(TransInfo *t, const float vec[3], int adr[2])
{
if (t->spacetype==SPACE_VIEW3D) {
- if(t->ar->regiontype == RGN_TYPE_WINDOW)
+ if (t->ar->regiontype == RGN_TYPE_WINDOW)
project_int_noclip(t->ar, vec, adr);
}
- else if(t->spacetype==SPACE_IMAGE) {
+ else if (t->spacetype==SPACE_IMAGE) {
float aspx, aspy, v[2];
ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
@@ -189,7 +191,7 @@ void projectIntView(TransInfo *t, float *vec, int *adr)
UI_view2d_to_region_no_clip(t->view, v[0], v[1], adr, adr+1);
}
- else if(t->spacetype == SPACE_ACTION) {
+ else if (t->spacetype == SPACE_ACTION) {
int out[2] = {0, 0};
#if 0
SpaceAction *sact = t->sa->spacedata.first;
@@ -208,45 +210,50 @@ void projectIntView(TransInfo *t, float *vec, int *adr)
adr[0]= out[0];
adr[1]= out[1];
}
- else if(ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) {
+ else if (ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) {
int out[2] = {0, 0};
UI_view2d_to_region_no_clip((View2D *)t->view, vec[0], vec[1], out, out+1);
adr[0]= out[0];
adr[1]= out[1];
}
- else if(t->spacetype==SPACE_SEQ) { /* XXX not tested yet, but should work */
+ else if (t->spacetype==SPACE_SEQ) { /* XXX not tested yet, but should work */
int out[2] = {0, 0};
UI_view2d_to_region_no_clip((View2D *)t->view, vec[0], vec[1], out, out+1);
adr[0]= out[0];
adr[1]= out[1];
}
- else if(t->spacetype==SPACE_CLIP) {
+ else if (t->spacetype==SPACE_CLIP) {
UI_view2d_to_region_no_clip(t->view, vec[0], vec[1], adr, adr+1);
}
}
-void projectFloatView(TransInfo *t, float *vec, float *adr)
+void projectFloatView(TransInfo *t, const float vec[3], float adr[2])
{
- if (t->spacetype==SPACE_VIEW3D) {
- if(t->ar->regiontype == RGN_TYPE_WINDOW)
- project_float_noclip(t->ar, vec, adr);
- }
- else if(ELEM(t->spacetype, SPACE_IMAGE, SPACE_CLIP)) {
- int a[2];
-
- projectIntView(t, vec, a);
- adr[0]= a[0];
- adr[1]= a[1];
+ switch (t->spacetype) {
+ case SPACE_VIEW3D:
+ {
+ if (t->ar->regiontype == RGN_TYPE_WINDOW) {
+ project_float_noclip(t->ar, vec, adr);
+ return;
+ }
+ break;
+ }
+ case SPACE_IMAGE:
+ case SPACE_CLIP:
+ case SPACE_IPO:
+ case SPACE_NLA:
+ {
+ int a[2];
+ projectIntView(t, vec, a);
+ adr[0] = a[0];
+ adr[1] = a[1];
+ return;
+ }
}
- else if(ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) {
- int a[2];
- projectIntView(t, vec, a);
- adr[0]= a[0];
- adr[1]= a[1];
- }
+ zero_v2(adr);
}
void applyAspectRatio(TransInfo *t, float *vec)
@@ -255,7 +262,7 @@ void applyAspectRatio(TransInfo *t, float *vec)
SpaceImage *sima= t->sa->spacedata.first;
float aspx, aspy;
- if((sima->flag & SI_COORDFLOATS)==0) {
+ if ((sima->flag & SI_COORDFLOATS)==0) {
int width, height;
ED_space_image_size(sima, &width, &height);
@@ -275,7 +282,7 @@ void removeAspectRatio(TransInfo *t, float *vec)
SpaceImage *sima= t->sa->spacedata.first;
float aspx, aspy;
- if((sima->flag & SI_COORDFLOATS)==0) {
+ if ((sima->flag & SI_COORDFLOATS)==0) {
int width, height;
ED_space_image_size(sima, &width, &height);
@@ -294,7 +301,7 @@ static void viewRedrawForce(const bContext *C, TransInfo *t)
if (t->spacetype == SPACE_VIEW3D)
{
/* Do we need more refined tags? */
- if(t->flag & T_POSE)
+ if (t->flag & T_POSE)
WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL);
else
WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
@@ -316,24 +323,22 @@ 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) {
// XXX how to deal with lock?
SpaceImage *sima= (SpaceImage*)t->sa->spacedata.first;
- if(sima->lock) WM_event_add_notifier(C, NC_GEOM|ND_DATA, t->obedit->data);
+ if (sima->lock) WM_event_add_notifier(C, NC_GEOM|ND_DATA, t->obedit->data);
else ED_area_tag_redraw(t->sa);
}
else if (t->spacetype==SPACE_CLIP) {
- SpaceClip *sc= (SpaceClip*)t->sa->spacedata.first;
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = (SpaceClip*)t->sa->spacedata.first;
+ MovieClip *clip = ED_space_clip(sc);
/* objects could be parented to tracking data, so send this for viewport refresh */
WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
@@ -346,7 +351,7 @@ static void viewRedrawPost(bContext *C, TransInfo *t)
{
ED_area_headerprint(t->sa, NULL);
- if(t->spacetype == SPACE_VIEW3D) {
+ if (t->spacetype == SPACE_VIEW3D) {
/* if autokeying is enabled, send notifiers that keyframes were added */
if (IS_AUTOKEY_ON(t->scene))
WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
@@ -357,15 +362,15 @@ static void viewRedrawPost(bContext *C, TransInfo *t)
}
#if 0 // TRANSFORM_FIX_ME
- if(t->spacetype==SPACE_VIEW3D) {
+ if (t->spacetype==SPACE_VIEW3D) {
allqueue(REDRAWBUTSOBJECT, 0);
allqueue(REDRAWVIEW3D, 0);
}
- else if(t->spacetype==SPACE_IMAGE) {
+ else if (t->spacetype==SPACE_IMAGE) {
allqueue(REDRAWIMAGE, 0);
allqueue(REDRAWVIEW3D, 0);
}
- else if(ELEM3(t->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_IPO)) {
+ else if (ELEM3(t->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_IPO)) {
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
@@ -388,7 +393,7 @@ void BIF_selectOrientation(void)
val= pupmenu(str_menu);
MEM_freeN(str_menu);
- if(val >= 0) {
+ if (val >= 0) {
G.vd->twmode = val;
}
#endif
@@ -413,23 +418,27 @@ static void view_editmove(unsigned short UNUSED(event))
switch(event) {
case WHEELUPMOUSE:
- if( G.qual & LR_SHIFTKEY ) {
- if( G.qual & LR_ALTKEY ) {
+ if ( G.qual & LR_SHIFTKEY ) {
+ if ( G.qual & LR_ALTKEY ) {
G.qual &= ~LR_SHIFTKEY;
persptoetsen(PAD2);
G.qual |= LR_SHIFTKEY;
- } else {
+ }
+ else {
persptoetsen(PAD2);
}
- } else if( G.qual & LR_CTRLKEY ) {
- if( G.qual & LR_ALTKEY ) {
+ }
+ else if ( G.qual & LR_CTRLKEY ) {
+ if ( G.qual & LR_ALTKEY ) {
G.qual &= ~LR_CTRLKEY;
persptoetsen(PAD4);
G.qual |= LR_CTRLKEY;
- } else {
+ }
+ else {
persptoetsen(PAD4);
}
- } else if(U.uiflag & USER_WHEELZOOMDIR)
+ }
+ else if (U.uiflag & USER_WHEELZOOMDIR)
persptoetsen(PADMINUS);
else
persptoetsen(PADPLUSKEY);
@@ -437,23 +446,27 @@ static void view_editmove(unsigned short UNUSED(event))
refresh = 1;
break;
case WHEELDOWNMOUSE:
- if( G.qual & LR_SHIFTKEY ) {
- if( G.qual & LR_ALTKEY ) {
+ if ( G.qual & LR_SHIFTKEY ) {
+ if ( G.qual & LR_ALTKEY ) {
G.qual &= ~LR_SHIFTKEY;
persptoetsen(PAD8);
G.qual |= LR_SHIFTKEY;
- } else {
+ }
+ else {
persptoetsen(PAD8);
}
- } else if( G.qual & LR_CTRLKEY ) {
- if( G.qual & LR_ALTKEY ) {
+ }
+ else if ( G.qual & LR_CTRLKEY ) {
+ if ( G.qual & LR_ALTKEY ) {
G.qual &= ~LR_CTRLKEY;
persptoetsen(PAD6);
G.qual |= LR_CTRLKEY;
- } else {
+ }
+ else {
persptoetsen(PAD6);
}
- } else if(U.uiflag & USER_WHEELZOOMDIR)
+ }
+ else if (U.uiflag & USER_WHEELZOOMDIR)
persptoetsen(PADPLUSKEY);
else
persptoetsen(PADMINUS);
@@ -526,7 +539,7 @@ wmKeyMap* transform_modal_keymap(wmKeyConfig *keyconf)
wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Transform Modal Map");
/* this function is called for each spacetype, only needs to add map once */
- if(keymap) return NULL;
+ if (keymap) return NULL;
keymap= WM_modalkeymap_add(keyconf, "Transform Modal Map", modal_items);
@@ -605,15 +618,15 @@ int transformEvent(TransInfo *t, wmEvent *event)
break;
case TFM_MODAL_TRANSLATE:
/* only switch when... */
- if( ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) {
+ if ( ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) {
resetTransRestrictions(t);
restoreTransObjects(t);
initTranslation(t);
initSnapping(t, NULL); // need to reinit after mode change
t->redraw |= TREDRAW_HARD;
}
- else if(t->mode == TFM_TRANSLATION) {
- if(t->options&CTX_MOVIECLIP) {
+ else if (t->mode == TFM_TRANSLATION) {
+ if (t->options&CTX_MOVIECLIP) {
restoreTransObjects(t);
t->flag^= T_ALT_TRANSFORM;
@@ -623,8 +636,8 @@ int transformEvent(TransInfo *t, wmEvent *event)
break;
case TFM_MODAL_ROTATE:
/* only switch when... */
- if(!(t->options & CTX_TEXTURE) && !(t->options & CTX_MOVIECLIP)) {
- if( ELEM4(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) {
+ if (!(t->options & CTX_TEXTURE) && !(t->options & CTX_MOVIECLIP)) {
+ if ( ELEM4(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) {
resetTransRestrictions(t);
@@ -643,7 +656,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
break;
case TFM_MODAL_RESIZE:
/* only switch when... */
- if( ELEM3(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) {
+ if ( ELEM3(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) {
resetTransRestrictions(t);
restoreTransObjects(t);
initResize(t);
@@ -755,9 +768,9 @@ int transformEvent(TransInfo *t, wmEvent *event)
t->redraw |= TREDRAW_HARD;
break;
case TFM_MODAL_PROPSIZE_UP:
- if(t->flag & T_PROP_EDIT) {
+ if (t->flag & T_PROP_EDIT) {
t->prop_size*= 1.1f;
- if(t->spacetype==SPACE_VIEW3D && t->persp != RV3D_ORTHO)
+ if (t->spacetype==SPACE_VIEW3D && t->persp != RV3D_ORTHO)
t->prop_size= MIN2(t->prop_size, ((View3D *)t->view)->far);
calculatePropRatio(t);
}
@@ -858,7 +871,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
break;
case GKEY:
/* only switch when... */
- if( ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) {
+ if ( ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) {
resetTransRestrictions(t);
restoreTransObjects(t);
initTranslation(t);
@@ -868,7 +881,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
break;
case SKEY:
/* only switch when... */
- if( ELEM3(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) {
+ if ( ELEM3(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) {
resetTransRestrictions(t);
restoreTransObjects(t);
initResize(t);
@@ -878,8 +891,8 @@ int transformEvent(TransInfo *t, wmEvent *event)
break;
case RKEY:
/* only switch when... */
- if(!(t->options & CTX_TEXTURE) && !(t->options & CTX_MOVIECLIP)) {
- if( ELEM4(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) {
+ if (!(t->options & CTX_TEXTURE) && !(t->options & CTX_MOVIECLIP)) {
+ if ( ELEM4(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) {
resetTransRestrictions(t);
@@ -913,21 +926,25 @@ int transformEvent(TransInfo *t, wmEvent *event)
if (t->flag & T_2D_EDIT) {
if (cmode == 'X') {
stopConstraint(t);
- } else {
+ }
+ else {
setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS0), "along X");
}
- } else {
+ }
+ else {
if (cmode == 'X') {
if (t->con.orientation != V3D_MANIP_GLOBAL) {
stopConstraint(t);
- } else {
+ }
+ else {
short orientation = t->current_orientation != V3D_MANIP_GLOBAL ? t->current_orientation : V3D_MANIP_LOCAL;
if ((t->modifiers & MOD_CONSTRAINT_PLANE) == 0)
setUserConstraint(t, orientation, (CON_AXIS0), "along %s X");
else if (t->modifiers & MOD_CONSTRAINT_PLANE)
setUserConstraint(t, orientation, (CON_AXIS1|CON_AXIS2), "locking %s X");
}
- } else {
+ }
+ else {
if ((t->modifiers & MOD_CONSTRAINT_PLANE) == 0)
setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS0), "along %s X");
else if (t->modifiers & MOD_CONSTRAINT_PLANE)
@@ -942,21 +959,25 @@ int transformEvent(TransInfo *t, wmEvent *event)
if (t->flag & T_2D_EDIT) {
if (cmode == 'Y') {
stopConstraint(t);
- } else {
+ }
+ else {
setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS1), "along Y");
}
- } else {
+ }
+ else {
if (cmode == 'Y') {
if (t->con.orientation != V3D_MANIP_GLOBAL) {
stopConstraint(t);
- } else {
+ }
+ else {
short orientation = t->current_orientation != V3D_MANIP_GLOBAL ? t->current_orientation : V3D_MANIP_LOCAL;
if ((t->modifiers & MOD_CONSTRAINT_PLANE) == 0)
setUserConstraint(t, orientation, (CON_AXIS1), "along %s Y");
else if (t->modifiers & MOD_CONSTRAINT_PLANE)
setUserConstraint(t, orientation, (CON_AXIS0|CON_AXIS2), "locking %s Y");
}
- } else {
+ }
+ else {
if ((t->modifiers & MOD_CONSTRAINT_PLANE) == 0)
setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS1), "along %s Y");
else if (t->modifiers & MOD_CONSTRAINT_PLANE)
@@ -971,14 +992,16 @@ int transformEvent(TransInfo *t, wmEvent *event)
if (cmode == 'Z') {
if (t->con.orientation != V3D_MANIP_GLOBAL) {
stopConstraint(t);
- } else {
+ }
+ else {
short orientation = t->current_orientation != V3D_MANIP_GLOBAL ? t->current_orientation : V3D_MANIP_LOCAL;
if ((t->modifiers & MOD_CONSTRAINT_PLANE) == 0)
setUserConstraint(t, orientation, (CON_AXIS2), "along %s Z");
else if (t->modifiers & MOD_CONSTRAINT_PLANE)
setUserConstraint(t, orientation, (CON_AXIS0|CON_AXIS1), "locking %s Z");
}
- } else {
+ }
+ else {
if ((t->modifiers & MOD_CONSTRAINT_PLANE) == 0)
setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS2), "along %s Z");
else if (t->modifiers & MOD_CONSTRAINT_PLANE)
@@ -995,9 +1018,9 @@ int transformEvent(TransInfo *t, wmEvent *event)
}
break;
case PADPLUSKEY:
- if(event->alt && t->flag & T_PROP_EDIT) {
+ if (event->alt && t->flag & T_PROP_EDIT) {
t->prop_size *= 1.1f;
- if(t->spacetype==SPACE_VIEW3D && t->persp != RV3D_ORTHO)
+ if (t->spacetype==SPACE_VIEW3D && t->persp != RV3D_ORTHO)
t->prop_size= MIN2(t->prop_size, ((View3D *)t->view)->far);
calculatePropRatio(t);
}
@@ -1012,7 +1035,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
t->redraw= 1;
break;
case PADMINUS:
- if(event->alt && t->flag & T_PROP_EDIT) {
+ if (event->alt && t->flag & T_PROP_EDIT) {
t->prop_size*= 0.90909090f;
calculatePropRatio(t);
}
@@ -1055,7 +1078,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
break;
// case LEFTMOUSE:
// case RIGHTMOUSE:
-// if(WM_modal_tweak_exit(event, t->event_type))
+// if (WM_modal_tweak_exit(event, t->event_type))
//// if (t->options & CTX_TWEAK)
// t->state = TRANS_CONFIRM;
// break;
@@ -1200,7 +1223,7 @@ static void drawArc(float size, float angle_start, float angle_end, int segments
glBegin(GL_LINE_STRIP);
- for( angle = angle_start; angle < angle_end; angle += delta)
+ for ( angle = angle_start; angle < angle_end; angle += delta)
{
glVertex2f( cosf(angle) * size, sinf(angle) * size);
}
@@ -1213,7 +1236,7 @@ static int helpline_poll(bContext *C)
{
ARegion *ar= CTX_wm_region(C);
- if(ar && ar->regiontype==RGN_TYPE_WINDOW)
+ if (ar && ar->regiontype==RGN_TYPE_WINDOW)
return 1;
return 0;
}
@@ -1231,13 +1254,13 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata)
mval[1]= y;
copy_v3_v3(vecrot, t->center);
- if(t->flag & T_EDIT) {
+ if (t->flag & T_EDIT) {
Object *ob= t->obedit;
- if(ob) mul_m4_v3(ob->obmat, vecrot);
+ if (ob) mul_m4_v3(ob->obmat, vecrot);
}
- else if(t->flag & T_POSE) {
+ else if (t->flag & T_POSE) {
Object *ob=t->poseobj;
- if(ob) mul_m4_v3(ob->obmat, vecrot);
+ if (ob) mul_m4_v3(ob->obmat, vecrot);
}
projectFloatView(t, vecrot, cent); // no overflow in extreme cases
@@ -1431,7 +1454,8 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
/* do we check for parameter? */
if (t->modifiers & MOD_SNAP) {
ts->snap_flag |= SCE_SNAP;
- } else {
+ }
+ else {
ts->snap_flag &= ~SCE_SNAP;
}
@@ -1469,7 +1493,8 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
* */
if (t->con.mode & CON_APPLY) {
RNA_enum_set(op->ptr, "constraint_orientation", t->con.orientation);
- } else {
+ }
+ else {
RNA_enum_set(op->ptr, "constraint_orientation", t->current_orientation);
}
@@ -1504,7 +1529,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
if ( (prop = RNA_struct_find_property(op->ptr, "texture_space")) && RNA_property_is_set(op->ptr, prop))
{
- if(RNA_property_boolean_get(op->ptr, prop)) {
+ if (RNA_property_boolean_get(op->ptr, prop)) {
options |= CTX_TEXTURE;
}
}
@@ -1519,8 +1544,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;
}
@@ -1536,7 +1560,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
return 0;
}
- if(t->spacetype == SPACE_VIEW3D)
+ if (t->spacetype == SPACE_VIEW3D)
{
//calc_manipulator_stats(curarea);
initTransformOrientation(C, t);
@@ -1546,12 +1570,13 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
//t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL);
t->draw_handle_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), helpline_poll, drawHelpline, t);
}
- else if(t->spacetype == SPACE_IMAGE) {
+ else if (t->spacetype == SPACE_IMAGE) {
unit_m3(t->spacemtx);
t->draw_handle_view = ED_region_draw_cb_activate(t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW);
//t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL);
+ t->draw_handle_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), helpline_poll, drawHelpline, t);
}
- else if(t->spacetype == SPACE_CLIP) {
+ else if (t->spacetype == SPACE_CLIP) {
unit_m3(t->spacemtx);
t->draw_handle_view = ED_region_draw_cb_activate(t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW);
t->options |= CTX_MOVIECLIP;
@@ -1567,7 +1592,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
}
/* Stupid code to have Ctrl-Click on manipulator work ok */
- if(event)
+ if (event)
{
wmKeyMap *keymap = WM_keymap_active(CTX_wm_manager(C), op->type->modalkeymap);
wmKeyMapItem *kmi;
@@ -1641,7 +1666,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
case TFM_BONESIZE:
{ /* used for both B-Bone width (bonesize) as for deform-dist (envelope) */
bArmature *arm= t->poseobj->data;
- if(arm->drawtype==ARM_ENVELOPE)
+ if (arm->drawtype==ARM_ENVELOPE)
initBoneEnvelope(t);
else
initBoneSize(t);
@@ -1669,7 +1694,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
/* same as TFM_TIME_EXTEND, but we need the mode info for later
* so that duplicate-culling will work properly
*/
- if ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)
+ if (ELEM(t->spacetype, SPACE_IPO, SPACE_NLA))
initTranslation(t);
else
initTimeTranslate(t);
@@ -1681,7 +1706,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
* (for Graph/NLA Editors only since they uses 'standard' transforms to get 2D movement)
* depending on which editor this was called from
*/
- if ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)
+ if (ELEM(t->spacetype, SPACE_IPO, SPACE_NLA))
initTranslation(t);
else
initTimeTranslate(t);
@@ -1706,7 +1731,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
break;
}
- if(t->state == TRANS_CANCEL)
+ if (t->state == TRANS_CANCEL)
{
postTrans(C, t);
return 0;
@@ -1716,11 +1741,12 @@ 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)) {
+ if (RNA_property_array_check(prop)) {
RNA_float_get_array(op->ptr, "value", values);
- } else {
+ }
+ else {
values[0]= RNA_float_get(op->ptr, "value");
}
@@ -1779,7 +1805,8 @@ void transformApply(bContext *C, TransInfo *t)
viewRedrawForce(C, t);
}
t->redraw = TREDRAW_NOTHING;
- } else if (t->redraw & TREDRAW_SOFT) {
+ }
+ else if (t->redraw & TREDRAW_SOFT) {
viewRedrawForce(C, t);
}
@@ -1818,17 +1845,16 @@ int transformEnd(bContext *C, TransInfo *t)
if (t->state != TRANS_STARTING && t->state != TRANS_RUNNING)
{
/* handle restoring objects */
- if(t->state == TRANS_CANCEL)
+ if (t->state == TRANS_CANCEL)
{
/* exception, edge slide transformed UVs too */
- if(t->mode==TFM_EDGE_SLIDE)
+ if (t->mode==TFM_EDGE_SLIDE)
doEdgeSlide(t, 0.0f);
exit_code = OPERATOR_CANCELLED;
restoreTransObjects(t); // calls recalcData()
}
- else
- {
+ else {
exit_code = OPERATOR_FINISHED;
}
@@ -1843,11 +1869,11 @@ int transformEnd(bContext *C, TransInfo *t)
/* Undo as last, certainly after special_trans_update! */
- if(t->state == TRANS_CANCEL) {
-// if(t->undostr) ED_undo_push(C, t->undostr);
+ if (t->state == TRANS_CANCEL) {
+// if (t->undostr) ED_undo_push(C, t->undostr);
}
else {
-// if(t->undostr) ED_undo_push(C, t->undostr);
+// if (t->undostr) ED_undo_push(C, t->undostr);
// else ED_undo_push(C, transform_to_undostr(t));
}
t->undostr= NULL;
@@ -1864,31 +1890,31 @@ int transformEnd(bContext *C, TransInfo *t)
static void protectedTransBits(short protectflag, float *vec)
{
- if(protectflag & OB_LOCK_LOCX)
+ if (protectflag & OB_LOCK_LOCX)
vec[0]= 0.0f;
- if(protectflag & OB_LOCK_LOCY)
+ if (protectflag & OB_LOCK_LOCY)
vec[1]= 0.0f;
- if(protectflag & OB_LOCK_LOCZ)
+ if (protectflag & OB_LOCK_LOCZ)
vec[2]= 0.0f;
}
static void protectedSizeBits(short protectflag, float *size)
{
- if(protectflag & OB_LOCK_SCALEX)
+ if (protectflag & OB_LOCK_SCALEX)
size[0]= 1.0f;
- if(protectflag & OB_LOCK_SCALEY)
+ if (protectflag & OB_LOCK_SCALEY)
size[1]= 1.0f;
- if(protectflag & OB_LOCK_SCALEZ)
+ if (protectflag & OB_LOCK_SCALEZ)
size[2]= 1.0f;
}
static void protectedRotateBits(short protectflag, float *eul, float *oldeul)
{
- if(protectflag & OB_LOCK_ROTX)
+ if (protectflag & OB_LOCK_ROTX)
eul[0]= oldeul[0];
- if(protectflag & OB_LOCK_ROTY)
+ if (protectflag & OB_LOCK_ROTY)
eul[1]= oldeul[1];
- if(protectflag & OB_LOCK_ROTZ)
+ if (protectflag & OB_LOCK_ROTZ)
eul[2]= oldeul[2];
}
@@ -2076,8 +2102,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);
@@ -2121,7 +2147,7 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td)
continue;
/* only do conversion if necessary, to preserve quats and eulers */
- if(!dolimit) {
+ if (!dolimit) {
constraintob_from_transdata(&cob, td);
dolimit= 1;
}
@@ -2145,7 +2171,7 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td)
}
}
- if(dolimit) {
+ if (dolimit) {
/* copy results from cob->matrix */
if (td->ext->rotOrder == ROT_MODE_QUAT) {
/* quats */
@@ -2274,7 +2300,7 @@ void initWarp(TransInfo *t)
t->flag |= T_NO_CONSTRAINT;
/* we need min/max in view space */
- for(i = 0; i < t->total; i++) {
+ for (i = 0; i < t->total; i++) {
float center[3];
copy_v3_v3(center, t->data[i].center);
mul_m3_v3(t->data[i].mtx, center);
@@ -2365,7 +2391,7 @@ int Warp(TransInfo *t, const int UNUSED(mval[2]))
circumfac /= 2; /* only need 180 on each side to make 360 */
- for(i = 0; i < t->total; i++, td++) {
+ for (i = 0; i < t->total; i++, td++) {
float loc[3];
if (td->flag & TD_NOACTION)
break;
@@ -2447,12 +2473,11 @@ 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;
}
-
+
status = 1;
}
@@ -2502,7 +2527,7 @@ int Shear(TransInfo *t, const int UNUSED(mval[2]))
mul_m3_m3m3(tmat, smat, persmat);
mul_m3_m3m3(totmat, persinv, tmat);
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -2617,9 +2642,9 @@ static void TransMat3ToSize( float mat[][3], float smat[][3], float *size)
size[2]= normalize_v3(vec);
/* first tried with dotproduct... but the sign flip is crucial */
- if( VECSIGNFLIP(mat[0], smat[0]) ) size[0]= -size[0];
- if( VECSIGNFLIP(mat[1], smat[1]) ) size[1]= -size[1];
- if( VECSIGNFLIP(mat[2], smat[2]) ) size[2]= -size[2];
+ if ( VECSIGNFLIP(mat[0], smat[0]) ) size[0]= -size[0];
+ if ( VECSIGNFLIP(mat[1], smat[1]) ) size[1]= -size[1];
+ if ( VECSIGNFLIP(mat[2], smat[2]) ) size[2]= -size[2];
}
@@ -2671,7 +2696,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3])
protectedSizeBits(td->protectflag, fsize);
if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't resize objects itself
- if((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)) {
+ if ((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)) {
/* scale val and reset size */
*td->val = td->ival * (1 + (fsize[0] - 1) * td->factor);
@@ -2728,12 +2753,11 @@ int Resize(TransInfo *t, const int mval[2])
char str[200];
/* 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];
}
@@ -2765,7 +2789,7 @@ int Resize(TransInfo *t, const int mval[2])
headerResize(t, size, str);
- for(i = 0, td=t->data; i < t->total; i++, td++) {
+ for (i = 0, td=t->data; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -2782,7 +2806,7 @@ int Resize(TransInfo *t, const int mval[2])
if (t->con.applySize)
t->con.applySize(t, NULL, mat);
- for(i = 0, td=t->data; i < t->total; i++, td++)
+ for (i = 0, td=t->data; i < t->total; i++, td++)
ElementResize(t, td, mat);
}
@@ -2817,7 +2841,7 @@ void initToSphere(TransInfo *t)
t->flag |= T_NO_CONSTRAINT;
// Calculate average radius
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
t->val += len_v3v3(t->center, td->iloc);
}
@@ -2859,7 +2883,7 @@ int ToSphere(TransInfo *t, const int UNUSED(mval[2]))
}
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
float tratio;
if (td->flag & TD_NOACTION)
break;
@@ -2951,11 +2975,11 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
add_v3_v3v3(td->loc, td->iloc, vec);
- if(td->flag & TD_USEQUAT) {
+ if (td->flag & TD_USEQUAT) {
mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
mat3_to_quat( quat,fmat); // Actual transform
- if(td->ext->quat) {
+ if (td->ext->quat) {
mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat);
/* is there a reason not to have this here? -jahka */
@@ -2996,7 +3020,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
sub_v3_v3v3(vec, vec, td->center); // Translation needed from the initial location
/* special exception, see TD_PBONE_LOCAL_MTX definition comments */
- if(td->flag & TD_PBONE_LOCAL_MTX_P) {
+ if (td->flag & TD_PBONE_LOCAL_MTX_P) {
/* do nothing */
}
else if (td->flag & TD_PBONE_LOCAL_MTX_C) {
@@ -3146,7 +3170,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3])
vec_rot_to_mat3( mat,axis, angle);
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -3178,7 +3202,8 @@ int Rotation(TransInfo *t, const int UNUSED(mval[2]))
if ((t->con.mode & CON_APPLY) && t->con.applyRot) {
t->con.applyRot(t, NULL, t->axis, NULL);
- } else {
+ }
+ else {
/* reset axis if constraint is not set */
copy_v3_v3(t->axis, t->axis_orig);
}
@@ -3249,7 +3274,7 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a
mul_m3_m3m3(mat, smat, totmat);
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -3340,7 +3365,7 @@ void initTranslation(TransInfo *t)
t->num.flag = 0;
t->num.idx_max = t->idx_max;
- if(t->spacetype == SPACE_VIEW3D) {
+ if (t->spacetype == SPACE_VIEW3D) {
RegionView3D *rv3d = t->ar->regiondata;
if (rv3d) {
@@ -3349,7 +3374,7 @@ void initTranslation(TransInfo *t)
t->snap[2] = t->snap[1] * 0.1f;
}
}
- else if(ELEM(t->spacetype, SPACE_IMAGE, SPACE_CLIP)) {
+ else if (ELEM(t->spacetype, SPACE_IMAGE, SPACE_CLIP)) {
t->snap[0] = 0.0f;
t->snap[1] = 0.125f;
t->snap[2] = 0.0625f;
@@ -3381,10 +3406,10 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str)
applyAspectRatio(t, dvec);
dist = len_v3(vec);
- if(!(t->flag & T_2D_EDIT) && t->scene->unit.system) {
+ if (!(t->flag & T_2D_EDIT) && t->scene->unit.system) {
int i, do_split= t->scene->unit.flag & USER_UNIT_OPT_SPLIT ? 1:0;
- for(i=0; i<3; i++)
+ for (i=0; i<3; i++)
bUnit_AsString(&tvec[i*20], 20, dvec[i]*t->scene->unit.scale_length, 4, t->scene->unit.system, B_UNIT_LENGTH, do_split, 1);
}
else {
@@ -3394,17 +3419,17 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str)
}
}
- if(!(t->flag & T_2D_EDIT) && t->scene->unit.system)
+ if (!(t->flag & T_2D_EDIT) && t->scene->unit.system)
bUnit_AsString(distvec, sizeof(distvec), dist*t->scene->unit.scale_length, 4, t->scene->unit.system, B_UNIT_LENGTH, t->scene->unit.flag & USER_UNIT_OPT_SPLIT, 0);
- else if( dist > 1e10f || dist < -1e10f ) /* prevent string buffer overflow */
+ else if ( dist > 1e10f || dist < -1e10f ) /* prevent string buffer overflow */
sprintf(distvec, "%.4e", dist);
else
sprintf(distvec, "%.4f", dist);
- if(t->flag & T_AUTOIK) {
+ if (t->flag & T_AUTOIK) {
short chainlen= t->settings->autoik_chainlen;
- if(chainlen)
+ if (chainlen)
sprintf(autoik, "AutoIK-Len: %d", chainlen);
else
autoik[0]= '\0';
@@ -3425,7 +3450,7 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str)
}
}
else {
- if(t->flag & T_2D_EDIT)
+ if (t->flag & T_2D_EDIT)
spos += sprintf(spos, "Dx: %s Dy: %s (%s)%s %s", &tvec[0], &tvec[20], distvec, t->con.text, t->proptext);
else
spos += sprintf(spos, "Dx: %s Dy: %s Dz: %s (%s)%s %s %s", &tvec[0], &tvec[20], &tvec[40], distvec, t->con.text, t->proptext, &autoik[0]);
@@ -3443,7 +3468,7 @@ static void applyTranslation(TransInfo *t, float vec[3])
float tvec[3];
int i;
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -3451,10 +3476,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 +3493,7 @@ static void applyTranslation(TransInfo *t, float vec[3])
ElementRotation(t, td, mat, V3D_LOCAL);
}
- else
- {
+ else {
float mat[3][3];
unit_m3(mat);
@@ -3595,7 +3617,7 @@ int ShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
}
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -3665,7 +3687,7 @@ int Tilt(TransInfo *t, const int UNUSED(mval[2]))
sprintf(str, "Tilt: %.2f %s", RAD2DEGF(final), t->proptext);
}
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -3732,15 +3754,15 @@ int CurveShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
sprintf(str, "Shrink/Fatten: %3f", ratio);
}
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
if (td->flag & TD_SKIP)
continue;
- if(td->val) {
- //*td->val= ratio;
+ if (td->val) {
+ // *td->val= ratio;
*td->val= td->ival*ratio;
if (*td->val <= 0.0f) *td->val = 0.001f;
}
@@ -3803,7 +3825,7 @@ int PushPull(TransInfo *t, const int UNUSED(mval[2]))
t->con.applyRot(t, NULL, axis, NULL);
}
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -3873,7 +3895,7 @@ void initBevel(TransInfo *t)
int handleEventBevel(TransInfo *t, wmEvent *event)
{
if (event->val==KM_PRESS) {
- if(!G.editBMesh) return 0;
+ if (!G.editBMesh) return 0;
switch (event->type) {
case MIDDLEMOUSE:
@@ -3934,7 +3956,7 @@ int Bevel(TransInfo *t, const int UNUSED(mval[2]))
}
if (distance < 0) distance = -distance;
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->axismtx[1][0] > 0 && distance > td->axismtx[1][0]) {
d = td->axismtx[1][0];
}
@@ -4006,7 +4028,7 @@ int BevelWeight(TransInfo *t, const int UNUSED(mval[2]))
sprintf(str, "Bevel Weight: %.3f %s", weight, t->proptext);
}
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -4079,7 +4101,7 @@ int Crease(TransInfo *t, const int UNUSED(mval[2]))
sprintf(str, "Crease: %.3f %s", crease, t->proptext);
}
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -4174,12 +4196,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];
}
@@ -4202,7 +4222,7 @@ int BoneSize(TransInfo *t, const int mval[2])
headerBoneSize(t, size, str);
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -4264,7 +4284,7 @@ int BoneEnvelope(TransInfo *t, const int UNUSED(mval[2]))
sprintf(str, "Envelope: %3f", ratio);
}
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -4310,14 +4330,15 @@ 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;
if (l->e == nexte) {
if (i) {
mul_v3_fl(a, 1.0f / (float)i);
- } else {
+ }
+ else {
float f1[3], f2[3], f3[3];
sub_v3_v3v3(f1, BM_edge_other_vert(olde, v)->co, v->co);
@@ -4333,18 +4354,19 @@ static BMLoop *get_next_loop(BMesh *UNUSED(bm), BMVert *v, BMLoop *l,
copy_v3_v3(vec, a);
return l;
- } else {
+ }
+ else {
sub_v3_v3v3(n, BM_edge_other_vert(l->e, v)->co, v->co);
add_v3_v3v3(a, a, n);
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;
@@ -4364,7 +4386,7 @@ static int createSlideVerts(TransInfo *t)
BMEditMesh *em = me->edit_btmesh;
BMesh *bm = em->bm;
BMIter iter, iter2;
- BMEdge *e, *e1, *ee, *le;
+ BMEdge *e, *e1 /*, *ee, *le */ /* UNUSED */;
BMVert *v, *v2, *first;
BMLoop *l, *l1, *l2;
TransDataSlideVert *tempsv;
@@ -4376,13 +4398,14 @@ static int createSlideVerts(TransInfo *t)
ARegion *ar = t->ar;
float projectMat[4][4];
float start[3] = {0.0f, 0.0f, 0.0f}, dir[3], end[3] = {0.0f, 0.0f, 0.0f};
- float vec[3], vec2[3], lastvec[3], size, dis=0.0, z;
+ float vec[3], vec2[3], lastvec[3] /*, size, dis=0.0, z */ /* UNUSED */;
int numsel, i, j;
if (!v3d) {
- /*ok, let's try to survive this*/
+ /* ok, let's try to survive this */
unit_m4(projectMat);
- } else {
+ }
+ else {
ED_view3d_ob_project_mat_get(rv3d, t->obedit, projectMat);
}
@@ -4396,8 +4419,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++;
@@ -4405,15 +4428,20 @@ static int createSlideVerts(TransInfo *t)
}
if (numsel == 0 || numsel > 2) {
- return 0; //invalid edge selection
+ MEM_freeN(sld);
+ BMBVH_FreeBVH(btree);
+ return 0; /* invalid edge selection */
}
}
}
BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
if (BM_elem_flag_test(e, BM_ELEM_SELECT)) {
- if (BM_edge_face_count(e) != 2)
- return 0; //can only handle exactly 2 faces around each edge
+ if (BM_edge_face_count(e) != 2) {
+ MEM_freeN(sld);
+ BMBVH_FreeBVH(btree);
+ return 0; /* can only handle exactly 2 faces around each edge */
+ }
}
}
@@ -4429,8 +4457,11 @@ static int createSlideVerts(TransInfo *t)
}
}
- if (!j)
+ if (!j) {
+ MEM_freeN(sld);
+ BMBVH_FreeBVH(btree);
return 0;
+ }
tempsv = MEM_callocN(sizeof(TransDataSlideVert)*j, "tempsv");
@@ -4477,13 +4508,14 @@ 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 {
+ }
+ else {
l2 = NULL;
}
@@ -4498,11 +4530,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 +4549,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);
}
@@ -4550,18 +4582,18 @@ static int createSlideVerts(TransInfo *t)
sld->totsv = j;
/*find mouse vector*/
- dis = z = -1.0f;
- size = 50.0;
+ /* dis = z = -1.0f; */ /* UNUSED */
+ /* size = 50.0; */ /* UNUSED */
zero_v3(lastvec); zero_v3(dir);
- ee = le = NULL;
+ /* ee = le = NULL; */ /* UNUSED */
BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
if (BM_elem_flag_test(e, BM_ELEM_SELECT)) {
BMIter iter2;
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;
@@ -4576,14 +4608,16 @@ static int createSlideVerts(TransInfo *t)
if (tempsv[j].down) {
ED_view3d_project_float_v3(ar, tempsv[j].down->co, vec1, projectMat);
- } else {
+ }
+ else {
add_v3_v3v3(vec1, v->co, tempsv[j].downvec);
ED_view3d_project_float_v3(ar, vec1, vec1, projectMat);
}
if (tempsv[j].up) {
ED_view3d_project_float_v3(ar, tempsv[j].up->co, vec2, projectMat);
- } else {
+ }
+ else {
add_v3_v3v3(vec1, v->co, tempsv[j].upvec);
ED_view3d_project_float_v3(ar, vec2, vec2, projectMat);
}
@@ -4591,16 +4625,15 @@ static int createSlideVerts(TransInfo *t)
d = dist_to_line_segment_v2(mval, vec1, vec2);
if (dis2 == -1.0f || d < dis2) {
dis2 = d;
- ee = e2;
- size = len_v3v3(vec1, vec2);
+ /* ee = e2; */ /* UNUSED */
+ /* size = len_v3v3(vec1, vec2); */ /* UNUSED */
sub_v3_v3v3(dir, vec1, vec2);
}
}
}
}
}
-
- em->bm->ob = t->obedit;
+
bmesh_edit_begin(em->bm, BMO_OP_FLAG_UNTAN_MULTIRES);
/*create copies of faces for customdata projection*/
@@ -4670,7 +4703,7 @@ void projectSVData(TransInfo *t, int final)
/* BMESH_TODO, (t->settings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)
* currently all vertex data is interpolated which is nice mostly
- * except for shape keys where you dont want to modify UVs for eg.
+ * except for shape keys where you don't want to modify UVs for eg.
* current BMesh code doesnt make it easy to pick which data we interpolate
* - campbell */
@@ -4684,7 +4717,7 @@ void projectSVData(TransInfo *t, int final)
BMIter liter2;
BMFace *copyf, *copyf2;
BMLoop *l2;
- int sel, hide, do_vdata;
+ int sel, hide /*, do_vdata */ /* UNUSED */;
if (BLI_smallhash_haskey(&visit, (uintptr_t)f))
continue;
@@ -4692,8 +4725,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);
@@ -4702,26 +4735,30 @@ void projectSVData(TransInfo *t, int final)
/*project onto copied projection face*/
BM_ITER(l2, &liter2, em->bm, BM_LOOPS_OF_FACE, f) {
copyf = copyf2;
- do_vdata = l2->v==tempsv->v;
+ /* do_vdata = l2->v==tempsv->v; */ /* UNUSED */
if (BM_elem_flag_test(l2->e, BM_ELEM_SELECT) || BM_elem_flag_test(l2->prev->e, BM_ELEM_SELECT)) {
BMLoop *l3 = l2;
- do_vdata = 1;
+ /* do_vdata = 1; */ /* UNUSED */
if (!BM_elem_flag_test(l2->e, BM_ELEM_SELECT))
l3 = l3->prev;
if (sld->perc < 0.0 && BM_vert_in_face(l3->radial_next->f, tempsv->down)) {
copyf = BLI_smallhash_lookup(&sld->origfaces, (uintptr_t)l3->radial_next->f);
- } else if (sld->perc > 0.0 && BM_vert_in_face(l3->radial_next->f, tempsv->up)) {
+ }
+ else if (sld->perc > 0.0 && BM_vert_in_face(l3->radial_next->f, tempsv->up)) {
copyf = BLI_smallhash_lookup(&sld->origfaces, (uintptr_t)l3->radial_next->f);
}
if (!copyf)
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);
@@ -4731,20 +4768,22 @@ void projectSVData(TransInfo *t, int final)
}
}
- /*make sure face-attributes are correct (e.g. MTexPoly)*/
+ /* make sure face-attributes are correct (e.g. MTexPoly) */
BM_elem_attrs_copy(em->bm, em->bm, copyf2, f);
- /*restore selection and hidden flags*/
+ /* restore selection and hidden flags */
BM_elem_select_set(em->bm, f, sel);
- BM_elem_hide_set(em->bm, f, hide);
+ if (!hide) { /* this check is a workaround for bug, see note - [#30735], without this edge can be hidden and selected */
+ BM_elem_hide_set(em->bm, f, hide);
+ }
}
}
BLI_smallhash_release(&visit);
}
-void freeSlideTempFaces(SlideData *sld){
- if(sld->origfaces_init){
+void freeSlideTempFaces(SlideData *sld) {
+ if (sld->origfaces_init) {
SmallHashIter hiter;
BMFace *copyf;
@@ -4765,13 +4804,13 @@ void freeSlideVerts(TransInfo *t)
SlideData *sld = t->customData;
#if 0 /*BMESH_TODO*/
- if(me->drawflag & ME_DRAWEXTRA_EDGELEN) {
+ if (me->drawflag & ME_DRAWEXTRA_EDGELEN) {
TransDataSlideVert *tempsv;
LinkNode *look = sld->vertlist;
GHash *vertgh = sld->vhash;
- while(look) {
+ while (look) {
tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link);
- if(tempsv != NULL) {
+ if (tempsv != NULL) {
tempsv->up->f &= !SELECT;
tempsv->down->f &= !SELECT;
}
@@ -4783,19 +4822,8 @@ void freeSlideVerts(TransInfo *t)
if (!sld)
return;
- /*handle multires reprojection, done
- on transform completion since it's
- really slow -joeedh*/
- if (t->state != TRANS_CANCEL) {
- projectSVData(t, 1);
- } else {
- sld->perc = 0.0;
- projectSVData(t, 0);
- }
-
freeSlideTempFaces(sld);
- sld->em->bm->ob = t->obedit;
bmesh_edit_end(sld->em->bm, BMO_OP_FLAG_UNTAN_MULTIRES);
BLI_smallhash_release(&sld->vhash);
@@ -4815,7 +4843,7 @@ void initEdgeSlide(TransInfo *t)
t->mode = TFM_EDGE_SLIDE;
t->transform = EdgeSlide;
- if(!createSlideVerts(t)) {
+ if (!createSlideVerts(t)) {
t->state= TRANS_CANCEL;
return;
}
@@ -4865,7 +4893,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;
}
@@ -5002,7 +5033,7 @@ int BakeTime(TransInfo *t, const int mval[2])
float fac = 0.1f;
- if(t->mouse.precision) {
+ if (t->mouse.precision) {
/* calculate ratio for shiftkey pos, and for total, and blend these for precision */
time= (float)(t->center2d[0] - t->mouse.precision_mval[0]) * fac;
time+= 0.1f*((float)(t->center2d[0]*fac - mval[0]) -time);
@@ -5034,7 +5065,7 @@ int BakeTime(TransInfo *t, const int mval[2])
sprintf(str, "Time: %.3f %s", time, t->proptext);
}
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -5076,7 +5107,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
* */
@@ -5093,7 +5124,7 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2]))
sprintf(str, "Mirror%s", t->con.text);
- for(i = 0, td=t->data; i < t->total; i++, td++) {
+ for (i = 0, td=t->data; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -5107,13 +5138,12 @@ 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);
- for(i = 0, td=t->data; i < t->total; i++, td++) {
+ for (i = 0, td=t->data; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
@@ -5125,7 +5155,7 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- if(t->flag & T_2D_EDIT)
+ if (t->flag & T_2D_EDIT)
ED_area_headerprint(t->sa, "Select a mirror axis (X, Y)");
else
ED_area_headerprint(t->sa, "Select a mirror axis (X, Y, Z)");
@@ -5154,7 +5184,7 @@ int Align(TransInfo *t, const int UNUSED(mval[2]))
/* saving original center */
copy_v3_v3(center, t->center);
- for(i = 0 ; i < t->total; i++, td++)
+ for (i = 0 ; i < t->total; i++, td++)
{
float mat[3][3], invmat[3][3];
@@ -5169,7 +5199,7 @@ int Align(TransInfo *t, const int UNUSED(mval[2]))
copy_v3_v3(t->center, td->center);
}
else {
- if(t->settings->selectmode & SCE_SELECT_FACE) {
+ if (t->settings->selectmode & SCE_SELECT_FACE) {
copy_v3_v3(t->center, td->center);
}
}
@@ -5229,7 +5259,7 @@ static void applySeqSlide(TransInfo *t, float val[2])
TransData *td = t->data;
int i;
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
float tvec[2];
if (td->flag & TD_NOACTION)
@@ -5365,7 +5395,7 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d,
#if 0 /* 'doTime' disabled for now */
const Scene *scene= t->scene;
- const short doTime= 0; //getAnimEdit_DrawTime(t); // NOTE: this works, but may be confusing behaviour given the option's label, hence disabled
+ const short doTime= 0; //getAnimEdit_DrawTime(t); // NOTE: this works, but may be confusing behavior given the option's label, hence disabled
const double secf= FPS;
#endif
double val;
@@ -5446,7 +5476,7 @@ void initTimeTranslate(TransInfo *t)
t->num.flag = 0;
t->num.idx_max = t->idx_max;
- /* initialise snap like for everything else */
+ /* initialize snap like for everything else */
t->snap[0] = 0.0f;
t->snap[1] = t->snap[2] = 1.0f;
@@ -5584,7 +5614,8 @@ void initTimeSlide(TransInfo *t)
/* set flag for drawing stuff */
saction->flag |= SACTION_MOVING;
- } else {
+ }
+ else {
t->state = TRANS_CANCEL;
}
@@ -5600,7 +5631,7 @@ void initTimeSlide(TransInfo *t)
t->num.flag = 0;
t->num.idx_max = t->idx_max;
- /* initialise snap like for everything else */
+ /* initialize snap like for everything else */
t->snap[0] = 0.0f;
t->snap[1] = t->snap[2] = 1.0f;
@@ -5742,7 +5773,7 @@ void initTimeScale(TransInfo *t)
t->num.flag = 0;
t->num.idx_max = t->idx_max;
- /* initialise snap like for everything else */
+ /* initialize snap like for everything else */
t->snap[0] = 0.0f;
t->snap[1] = t->snap[2] = 1.0f;
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 545d2348f82..0bef33149d7 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;
@@ -444,9 +444,9 @@ void transformApply(struct bContext *C, TransInfo *t);
int transformEnd(struct bContext *C, TransInfo *t);
void setTransformViewMatrices(TransInfo *t);
-void convertViewVec(TransInfo *t, float *vec, int dx, int dy);
-void projectIntView(TransInfo *t, float *vec, int *adr);
-void projectFloatView(TransInfo *t, float *vec, float *adr);
+void convertViewVec(TransInfo *t, float r_vec[3], int dx, int dy);
+void projectIntView(TransInfo *t, const float vec[3], int adr[2]);
+void projectFloatView(TransInfo *t, const float vec[3], float adr[2]);
void applyAspectRatio(TransInfo *t, float *vec);
void removeAspectRatio(TransInfo *t, float *vec);
@@ -691,5 +691,6 @@ int getTransformOrientation(const struct bContext *C, float normal[3], float pla
void freeSlideTempFaces(SlideData *sld);
void freeSlideVerts(TransInfo *t);
+void projectSVData(TransInfo *t, int final);
#endif
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index bd34477c13f..18e9c1a47b8 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 */
@@ -187,21 +183,21 @@ static void postConstraintChecks(TransInfo *t, float vec[3], float pvec[3])
static void viewAxisCorrectCenter(TransInfo *t, float t_con_center[3])
{
- if(t->spacetype == SPACE_VIEW3D) {
+ if (t->spacetype == SPACE_VIEW3D) {
// View3D *v3d = t->sa->spacedata.first;
const float min_dist= 1.0f; // v3d->near;
float dir[3];
float l;
sub_v3_v3v3(dir, t_con_center, t->viewinv[3]);
- if(dot_v3v3(dir, t->viewinv[2]) < 0.0f) {
+ if (dot_v3v3(dir, t->viewinv[2]) < 0.0f) {
negate_v3(dir);
}
project_v3_v3v3(dir, dir, t->viewinv[2]);
l= len_v3(dir);
- if(l < min_dist) {
+ if (l < min_dist) {
float diff[3];
normalize_v3_v3(diff, t->viewinv[2]);
mul_v3_fl(diff, min_dist - l);
@@ -216,7 +212,7 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3
float norm[3], vec[3], factor, angle;
float t_con_center[3];
- if(in[0]==0.0f && in[1]==0.0f && in[2]==0.0f)
+ if (in[0]==0.0f && in[1]==0.0f && in[2]==0.0f)
return;
copy_v3_v3(t_con_center, t->con.center);
@@ -231,13 +227,13 @@ 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 */
- if(angle < 5.0f) {
+ * 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;
/* since camera distance is quite relative, use quadratic relationship. holding shift can compensate */
- if(factor<0.0f) factor*= -factor;
+ if (factor<0.0f) factor*= -factor;
else factor*= factor;
copy_v3_v3(out, axis);
@@ -265,10 +261,12 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3
copy_v3_v3(out, axis);
if (factor > 0) {
mul_v3_fl(out, 1000000000.0f);
- } else {
+ }
+ else {
mul_v3_fl(out, -1000000000.0f);
}
- } else {
+ }
+ else {
add_v3_v3v3(v2, t_con_center, axis);
add_v3_v3v3(v4, v, norm);
@@ -280,9 +278,9 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3
/* possible some values become nan when
* viewpoint and object are both zero */
- if(!finite(out[0])) out[0]= 0.0f;
- if(!finite(out[1])) out[1]= 0.0f;
- if(!finite(out[2])) out[2]= 0.0f;
+ if (!finite(out[0])) out[0]= 0.0f;
+ if (!finite(out[1])) out[1]= 0.0f;
+ if (!finite(out[2])) out[2]= 0.0f;
}
}
}
@@ -597,11 +595,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];
@@ -658,7 +656,7 @@ void drawConstraint(TransInfo *t)
/* nasty exception for Z constraint in camera view */
// TRANSFORM_FIX_ME
-// if((t->flag & T_OBJECT) && G.vd->camera==OBACT && G.vd->persp==V3D_CAMOB)
+// if ((t->flag & T_OBJECT) && G.vd->camera==OBACT && G.vd->persp==V3D_CAMOB)
// return;
if (tc->drawExtra) {
@@ -680,7 +678,7 @@ void drawConstraint(TransInfo *t)
glColor3ubv((GLubyte *)col2);
depth_test_enabled = glIsEnabled(GL_DEPTH_TEST);
- if(depth_test_enabled)
+ if (depth_test_enabled)
glDisable(GL_DEPTH_TEST);
setlinestyle(1);
@@ -690,7 +688,7 @@ void drawConstraint(TransInfo *t)
glEnd();
setlinestyle(0);
- if(depth_test_enabled)
+ if (depth_test_enabled)
glEnable(GL_DEPTH_TEST);
}
@@ -716,13 +714,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 +727,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 +751,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);
@@ -774,7 +768,7 @@ static void drawObjectConstraint(TransInfo *t)
td++;
- for(i=1;i<t->total;i++,td++) {
+ for (i=1;i<t->total;i++,td++) {
if (t->con.mode & CON_AXIS0) {
drawLine(t, td->ob->obmat[3], td->axismtx[0], 'X', 0);
}
@@ -896,12 +890,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 +1035,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 39a89940e17..c273d6a5b4c 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -56,6 +56,12 @@
#include "MEM_guardedalloc.h"
+#include "BLI_math.h"
+#include "BLI_blenlib.h"
+#include "BLI_array.h"
+#include "BLI_utildefines.h"
+#include "BLI_smallhash.h"
+
#include "BKE_DerivedMesh.h"
#include "BKE_action.h"
#include "BKE_armature.h"
@@ -103,16 +109,8 @@
#include "UI_view2d.h"
-#include "BLI_math.h"
-#include "BLI_blenlib.h"
-#include "BLI_array.h"
-#include "BLI_utildefines.h"
-#include "BLI_smallhash.h"
-
#include "RNA_access.h"
-extern ListBase editelems;
-
#include "transform.h"
#include "bmesh.h"
@@ -177,7 +175,7 @@ void sort_trans_data_dist(TransInfo *t)
TransData *start = t->data;
int i = 1;
- while(i < t->total && start->flag & TD_SELECTED) {
+ while (i < t->total && start->flag & TD_SELECTED) {
start++;
i++;
}
@@ -213,17 +211,17 @@ 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;
int a;
- for(a=0, tob= t->data; a<t->total; a++, tob++) {
+ for (a=0, tob= t->data; a<t->total; a++, tob++) {
tob->rdist= 0.0f; // init, it was mallocced
- if((tob->flag & TD_SELECTED)==0) {
+ if ((tob->flag & TD_SELECTED)==0) {
TransData *td;
int i;
float dist, vec[3];
@@ -231,7 +229,7 @@ static void set_prop_dist(TransInfo *t, short with_dist)
tob->rdist = -1.0f; // signal for next loop
for (i = 0, td= t->data; i < t->total; i++, td++) {
- if(td->flag & TD_SELECTED) {
+ if (td->flag & TD_SELECTED) {
sub_v3_v3v3(vec, tob->center, td->center);
mul_m3_v3(tob->mtx, vec);
dist = normalize_v3(vec);
@@ -271,7 +269,7 @@ static void createTransTexspace(TransInfo *t)
}
id = ob->data;
- if(id == NULL || !ELEM3( GS(id->name), ID_ME, ID_CU, ID_MB )) {
+ if (id == NULL || !ELEM3( GS(id->name), ID_ME, ID_CU, ID_MB )) {
t->total = 0;
return;
}
@@ -303,7 +301,7 @@ static void createTransTexspace(TransInfo *t)
static void createTransEdge(TransInfo *t)
{
- BMEditMesh *em = ((Mesh *)t->obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(t->obedit);
TransData *td = NULL;
BMEdge *eed;
BMIter iter;
@@ -321,7 +319,7 @@ static void createTransEdge(TransInfo *t)
if (countsel == 0)
return;
- if(propmode) {
+ if (propmode) {
t->total = count;
}
else {
@@ -334,7 +332,7 @@ static void createTransEdge(TransInfo *t)
invert_m3_m3(smtx, mtx);
BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
- if(!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && (BM_elem_flag_test(eed, BM_ELEM_SELECT) || propmode)) {
+ if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && (BM_elem_flag_test(eed, BM_ELEM_SELECT) || propmode)) {
float *bweight = CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_BWEIGHT);
float *crease = CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_CREASE);
@@ -373,13 +371,13 @@ static bKinematicConstraint *has_targetless_ik(bPoseChannel *pchan)
{
bConstraint *con= pchan->constraints.first;
- for(;con; con= con->next) {
- if(con->type==CONSTRAINT_TYPE_KINEMATIC && (con->enforce!=0.0f)) {
+ for (;con; con= con->next) {
+ if (con->type==CONSTRAINT_TYPE_KINEMATIC && (con->enforce!=0.0f)) {
bKinematicConstraint *data= con->data;
- if(data->tar==NULL)
+ if (data->tar==NULL)
return data;
- if(data->tar->type==OB_ARMATURE && data->subtarget[0]==0)
+ if (data->tar->type==OB_ARMATURE && data->subtarget[0]==0)
return data;
}
}
@@ -393,18 +391,18 @@ 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);
- if(data && (data->flag & CONSTRAINT_IK_AUTO)) {
+ if (data && (data->flag & CONSTRAINT_IK_AUTO)) {
/* fill the array with the bones of the chain (armature.c does same, keep it synced) */
segcount= 0;
/* exclude tip from chain? */
- if(!(data->flag & CONSTRAINT_IK_TIP))
+ if (!(data->flag & CONSTRAINT_IK_TIP))
parchan= pchan->parent;
else
parchan= pchan;
@@ -414,9 +412,9 @@ static short apply_targetless_ik(Object *ob)
chanlist[segcount]= parchan;
segcount++;
- if(segcount==data->rootbone || segcount>255) break; // 255 is weak
+ if (segcount==data->rootbone || segcount>255) break; // 255 is weak
}
- for(;segcount;segcount--) {
+ for (;segcount;segcount--) {
Bone *bone;
float rmat[4][4]/*, tmat[4][4], imat[4][4]*/;
@@ -431,7 +429,7 @@ static short apply_targetless_ik(Object *ob)
/* XXX Old code. Will remove it later. */
#if 0
- if(parchan->parent) {
+ if (parchan->parent) {
Bone *parbone= parchan->parent->bone;
float offs_bone[4][4];
@@ -445,7 +443,7 @@ static short apply_targetless_ik(Object *ob)
offs_bone[3][1]+= parbone->length;
/* pose_mat(b-1) * offs_bone */
- if(parchan->bone->flag & BONE_HINGE) {
+ if (parchan->bone->flag & BONE_HINGE) {
/* the rotation of the parent restposition */
copy_m4_m4(rmat, parbone->arm_mat); /* rmat used as temp */
@@ -456,7 +454,7 @@ static short apply_targetless_ik(Object *ob)
mult_m4_m4m4(tmat, rmat, offs_bone);
}
- else if(parchan->bone->flag & BONE_NO_SCALE) {
+ else if (parchan->bone->flag & BONE_NO_SCALE) {
mult_m4_m4m4(tmat, parchan->parent->pose_mat, offs_bone);
normalize_m4(tmat);
}
@@ -614,9 +612,9 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
copy_m3_m3(bmat, pchan->bone->bone_mat);
if (pchan->parent) {
- if(pchan->bone->flag & BONE_HINGE) {
+ if (pchan->bone->flag & BONE_HINGE) {
copy_m3_m4(pmat, pchan->parent->bone->arm_mat);
- if(!(pchan->bone->flag & BONE_NO_SCALE)) {
+ if (!(pchan->bone->flag & BONE_NO_SCALE)) {
float tsize[3], tsmat[3][3];
mat4_to_size(tsize, pchan->parent->pose_mat);
size_to_mat3(tsmat, tsize);
@@ -625,7 +623,7 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
}
else {
copy_m3_m4(pmat, pchan->parent->pose_mat);
- if(pchan->bone->flag & BONE_NO_SCALE)
+ if (pchan->bone->flag & BONE_NO_SCALE)
normalize_m3(pmat);
}
@@ -653,7 +651,7 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
/* exceptional case: rotate the pose bone which also applies transformation
* when a parentless bone has BONE_NO_LOCAL_LOCATION [] */
if (!ELEM(t->mode, TFM_TRANSLATION, TFM_RESIZE) && (pchan->bone->flag & BONE_NO_LOCAL_LOCATION)) {
- if(pchan->parent) {
+ if (pchan->parent) {
/* same as td->smtx but without pchan->bone->bone_mat */
td->flag |= TD_PBONE_LOCAL_MTX_C;
mul_m3_m3m3(td->ext->l_smtx, pchan->bone->bone_mat, td->smtx);
@@ -671,7 +669,7 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
if (t->mode==TFM_BONESIZE) {
bArmature *arm= t->poseobj->data;
- if(arm->drawtype==ARM_ENVELOPE) {
+ if (arm->drawtype==ARM_ENVELOPE) {
td->loc= NULL;
td->val= &bone->dist;
td->ival= bone->dist;
@@ -687,8 +685,8 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
/* in this case we can do target-less IK grabbing */
if (t->mode==TFM_TRANSLATION) {
bKinematicConstraint *data= has_targetless_ik(pchan);
- if(data) {
- if(data->flag & CONSTRAINT_IK_TIP) {
+ if (data) {
+ if (data->flag & CONSTRAINT_IK_TIP) {
copy_v3_v3(data->grabtarget, pchan->pose_tail);
}
else {
@@ -712,17 +710,18 @@ static void bone_children_clear_transflag(int mode, short around, ListBase *lb)
{
Bone *bone= lb->first;
- for(;bone;bone= bone->next) {
- if((bone->flag & BONE_HINGE) && (bone->flag & BONE_CONNECTED))
+ for (;bone;bone= bone->next) {
+ if ((bone->flag & BONE_HINGE) && (bone->flag & BONE_CONNECTED))
{
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;
}
@@ -758,28 +757,28 @@ int count_set_pose_transflags(int *out_mode, short around, Object *ob)
/* make sure no bone can be transformed when a parent is transformed */
/* since pchans are depsgraph sorted, the parents are in beginning of list */
- if(mode != TFM_BONESIZE) {
- for(pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ if (mode != TFM_BONESIZE) {
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
bone = pchan->bone;
- if(bone->flag & BONE_TRANSFORM)
+ if (bone->flag & BONE_TRANSFORM)
bone_children_clear_transflag(mode, around, &bone->childbase);
}
}
/* now count, and check if we have autoIK or have to switch from translate to rotate */
hastranslation = 0;
- for(pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
bone = pchan->bone;
- if(bone->flag & BONE_TRANSFORM) {
+ if (bone->flag & BONE_TRANSFORM) {
total++;
- if(mode == TFM_TRANSLATION) {
- if( has_targetless_ik(pchan)==NULL ) {
- if(pchan->parent && (pchan->bone->flag & BONE_CONNECTED)) {
- if(pchan->bone->flag & BONE_HINGE_CHILD_TRANSFORM)
+ if (mode == TFM_TRANSLATION) {
+ if ( has_targetless_ik(pchan)==NULL ) {
+ if (pchan->parent && (pchan->bone->flag & BONE_CONNECTED)) {
+ if (pchan->bone->flag & BONE_HINGE_CHILD_TRANSFORM)
hastranslation = 1;
}
- else if((pchan->protectflag & OB_LOCK_LOC)!=OB_LOCK_LOC)
+ else if ((pchan->protectflag & OB_LOCK_LOC)!=OB_LOCK_LOC)
hastranslation = 1;
}
else
@@ -789,7 +788,7 @@ int count_set_pose_transflags(int *out_mode, short around, Object *ob)
}
/* if there are no translatable bones, do rotation */
- if(mode == TFM_TRANSLATION && !hastranslation)
+ if (mode == TFM_TRANSLATION && !hastranslation)
{
*out_mode = TFM_ROTATION;
}
@@ -877,7 +876,7 @@ static void pose_grab_with_ik_clear(Object *ob)
continue;
}
pchan->constflag |= PCHAN_HAS_IK;
- if(data->tar==NULL || (data->tar->type==OB_ARMATURE && data->subtarget[0]==0))
+ if (data->tar==NULL || (data->tar->type==OB_ARMATURE && data->subtarget[0]==0))
pchan->constflag |= PCHAN_HAS_TARGET;
}
}
@@ -1068,7 +1067,7 @@ static void createTransPose(TransInfo *t, Object *ob)
/* set flags and count total (warning, can change transform to rotate) */
t->total = count_set_pose_transflags(&t->mode, t->around, ob);
- if(t->total == 0) return;
+ if (t->total == 0) return;
t->flag |= T_POSE;
t->poseobj= ob; /* we also allow non-active objects to be transformed, in weightpaint */
@@ -1076,7 +1075,7 @@ static void createTransPose(TransInfo *t, Object *ob)
/* init trans data */
td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransPoseBone");
tdx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "TransPoseBoneExt");
- for(i=0; i<t->total; i++, td++, tdx++) {
+ for (i=0; i<t->total; i++, td++, tdx++) {
td->ext= tdx;
td->val = NULL;
}
@@ -1090,12 +1089,12 @@ static void createTransPose(TransInfo *t, Object *ob)
}
}
- if(td != (t->data+t->total)) {
+ if (td != (t->data+t->total)) {
// XXX use transform operator reports
// BKE_report(op->reports, RPT_DEBUG, "Bone selection count error");
}
- /* initialise initial auto=ik chainlen's? */
+ /* initialize initial auto=ik chainlen's? */
if (ik_on) transform_autoik_update(t, 0);
}
@@ -1127,13 +1126,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,17 +1189,15 @@ 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)
+ if (arm->drawtype==ARM_ENVELOPE)
{
td->loc= NULL;
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 +1221,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 +1237,7 @@ static void createTransArmatureVerts(TransInfo *t)
td++;
}
}
- else
- {
+ else {
if (ebo->flag & BONE_TIPSEL)
{
copy_v3_v3(td->iloc, ebo->tail);
@@ -1312,15 +1305,15 @@ static void createTransMBallVerts(TransInfo *t)
int propmode = t->flag & T_PROP_EDIT;
/* count totals */
- for(ml= mb->editelems->first; ml; ml= ml->next) {
- if(ml->flag & SELECT) countsel++;
- if(propmode) count++;
+ for (ml= mb->editelems->first; ml; ml= ml->next) {
+ if (ml->flag & SELECT) countsel++;
+ if (propmode) count++;
}
/* note: in prop mode we need at least 1 selected */
if (countsel==0) return;
- if(propmode) t->total = count;
+ if (propmode) t->total = count;
else t->total = countsel;
td = t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(MBall EditMode)");
@@ -1329,13 +1322,13 @@ static void createTransMBallVerts(TransInfo *t)
copy_m3_m4(mtx, t->obedit->obmat);
invert_m3_m3(smtx, mtx);
- for(ml= mb->editelems->first; ml; ml= ml->next) {
- if(propmode || (ml->flag & SELECT)) {
+ for (ml= mb->editelems->first; ml; ml= ml->next) {
+ if (propmode || (ml->flag & SELECT)) {
td->loc= &ml->x;
copy_v3_v3(td->iloc, td->loc);
copy_v3_v3(td->center, td->loc);
- if(ml->flag & SELECT) td->flag= TD_SELECTED | TD_USEQUAT | TD_SINGLESIZE;
+ if (ml->flag & SELECT) td->flag= TD_SELECTED | TD_USEQUAT | TD_SINGLESIZE;
else td->flag= TD_USEQUAT;
copy_m3_m3(td->smtx, smtx);
@@ -1344,11 +1337,11 @@ static void createTransMBallVerts(TransInfo *t)
td->ext = tx;
/* Radius of MetaElem (mass of MetaElem influence) */
- if(ml->flag & MB_SCALE_RAD) {
+ if (ml->flag & MB_SCALE_RAD) {
td->val = &ml->rad;
td->ival = ml->rad;
}
- else{
+ else {
td->val = &ml->s;
td->ival = ml->s;
}
@@ -1381,7 +1374,7 @@ static void calc_distanceCurveVerts(TransData *head, TransData *tail)
td_near = td;
td->dist = 0.0f;
}
- else if(td_near) {
+ else if (td_near) {
float dist;
dist = len_v3v3(td_near->center, td->center);
if (dist < (td-1)->dist) {
@@ -1402,7 +1395,7 @@ static void calc_distanceCurveVerts(TransData *head, TransData *tail)
td_near = td;
td->dist = 0.0f;
}
- else if(td_near) {
+ else if (td_near) {
float dist;
dist = len_v3v3(td_near->center, td->center);
if (td->flag & TD_NOTCONNECTED || dist < td->dist || (td+1)->dist < td->dist) {
@@ -1426,7 +1419,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;
}
@@ -1447,31 +1440,32 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
ListBase *nurbs;
/* to be sure */
- if(cu->editnurb==NULL) return;
+ if (cu->editnurb==NULL) return;
/* count total of vertices, check identical as in 2nd loop for making transdata! */
nurbs= curve_editnurbs(cu);
- for(nu= nurbs->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
- for(a=0, bezt= nu->bezt; a<nu->pntsu; a++, bezt++) {
- if(bezt->hide==0) {
+ for (nu= nurbs->first; nu; nu= nu->next) {
+ if (nu->type == CU_BEZIER) {
+ for (a=0, bezt= nu->bezt; a<nu->pntsu; a++, bezt++) {
+ if (bezt->hide==0) {
if (hide_handles) {
- if(bezt->f2 & SELECT) countsel+=3;
- if(propmode) count+= 3;
- } else {
- if(bezt->f1 & SELECT) countsel++;
- if(bezt->f2 & SELECT) countsel++;
- if(bezt->f3 & SELECT) countsel++;
- if(propmode) count+= 3;
+ if (bezt->f2 & SELECT) countsel+=3;
+ if (propmode) count+= 3;
+ }
+ else {
+ if (bezt->f1 & SELECT) countsel++;
+ if (bezt->f2 & SELECT) countsel++;
+ if (bezt->f3 & SELECT) countsel++;
+ if (propmode) count+= 3;
}
}
}
}
else {
- for(a= nu->pntsu*nu->pntsv, bp= nu->bp; a>0; a--, bp++) {
- if(bp->hide==0) {
- if(propmode) count++;
- if(bp->f1 & SELECT) countsel++;
+ for (a= nu->pntsu*nu->pntsv, bp= nu->bp; a>0; a--, bp++) {
+ if (bp->hide==0) {
+ if (propmode) count++;
+ if (bp->f1 & SELECT) countsel++;
}
}
}
@@ -1479,7 +1473,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
/* note: in prop mode we need at least 1 selected */
if (countsel==0) return;
- if(propmode) t->total = count;
+ if (propmode) t->total = count;
else t->total = countsel;
t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(Curve EditMode)");
@@ -1487,15 +1481,15 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
invert_m3_m3(smtx, mtx);
td = t->data;
- for(nu= nurbs->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
+ for (nu= nurbs->first; nu; nu= nu->next) {
+ if (nu->type == CU_BEZIER) {
TransData *head, *tail;
head = tail = td;
- for(a=0, bezt= nu->bezt; a<nu->pntsu; a++, bezt++) {
- if(bezt->hide==0) {
+ for (a=0, bezt= nu->bezt; a<nu->pntsu; a++, bezt++) {
+ if (bezt->hide==0) {
TransDataCurveHandleFlags *hdata = NULL;
- if( propmode ||
+ if ( propmode ||
((bezt->f2 & SELECT) && hide_handles) ||
((bezt->f1 & SELECT) && hide_handles == 0)
) {
@@ -1503,10 +1497,11 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
td->loc= bezt->vec[0];
copy_v3_v3(td->center, bezt->vec[(hide_handles || bezt->f2 & SELECT) ? 1:0]);
if (hide_handles) {
- if(bezt->f2 & SELECT) td->flag= TD_SELECTED;
+ if (bezt->f2 & SELECT) td->flag= TD_SELECTED;
else td->flag= 0;
- } else {
- if(bezt->f1 & SELECT) td->flag= TD_SELECTED;
+ }
+ else {
+ if (bezt->f1 & SELECT) td->flag= TD_SELECTED;
else td->flag= 0;
}
td->ext = NULL;
@@ -1523,21 +1518,23 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
}
/* This is the Curve Point, the other two are handles */
- if(propmode || (bezt->f2 & SELECT)) {
+ if (propmode || (bezt->f2 & SELECT)) {
copy_v3_v3(td->iloc, bezt->vec[1]);
td->loc= bezt->vec[1];
copy_v3_v3(td->center, td->loc);
- if(bezt->f2 & SELECT) td->flag= TD_SELECTED;
+ if (bezt->f2 & SELECT) td->flag= TD_SELECTED;
else td->flag= 0;
td->ext = NULL;
if (t->mode==TFM_CURVE_SHRINKFATTEN) { /* || t->mode==TFM_RESIZE) {*/ /* TODO - make points scale */
td->val = &(bezt->radius);
td->ival = bezt->radius;
- } else if (t->mode==TFM_TILT) {
+ }
+ else if (t->mode==TFM_TILT) {
td->val = &(bezt->alfa);
td->ival = bezt->alfa;
- } else {
+ }
+ else {
td->val = NULL;
}
@@ -1554,7 +1551,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
count++;
tail++;
}
- if( propmode ||
+ if ( propmode ||
((bezt->f2 & SELECT) && hide_handles) ||
((bezt->f3 & SELECT) && hide_handles == 0)
) {
@@ -1562,10 +1559,11 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
td->loc= bezt->vec[2];
copy_v3_v3(td->center, bezt->vec[(hide_handles || bezt->f2 & SELECT) ? 1:2]);
if (hide_handles) {
- if(bezt->f2 & SELECT) td->flag= TD_SELECTED;
+ if (bezt->f2 & SELECT) td->flag= TD_SELECTED;
else td->flag= 0;
- } else {
- if(bezt->f3 & SELECT) td->flag= TD_SELECTED;
+ }
+ else {
+ if (bezt->f3 & SELECT) td->flag= TD_SELECTED;
else td->flag= 0;
}
td->ext = NULL;
@@ -1592,7 +1590,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
calc_distanceCurveVerts(head, tail-1);
/* TODO - in the case of tilt and radius we can also avoid allocating the initTransDataCurveHandles
- * but for now just dont change handle types */
+ * but for now just don't change handle types */
if (ELEM(t->mode, TFM_CURVE_SHRINKFATTEN, TFM_TILT) == 0) {
/* sets the handles based on their selection, do this after the data is copied to the TransData */
testhandlesNurb(nu);
@@ -1601,20 +1599,21 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
else {
TransData *head, *tail;
head = tail = td;
- for(a= nu->pntsu*nu->pntsv, bp= nu->bp; a>0; a--, bp++) {
- if(bp->hide==0) {
- if(propmode || (bp->f1 & SELECT)) {
+ for (a= nu->pntsu*nu->pntsv, bp= nu->bp; a>0; a--, bp++) {
+ if (bp->hide==0) {
+ if (propmode || (bp->f1 & SELECT)) {
copy_v3_v3(td->iloc, bp->vec);
td->loc= bp->vec;
copy_v3_v3(td->center, td->loc);
- if(bp->f1 & SELECT) td->flag= TD_SELECTED;
+ if (bp->f1 & SELECT) td->flag= TD_SELECTED;
else td->flag= 0;
td->ext = NULL;
if (t->mode==TFM_CURVE_SHRINKFATTEN || t->mode==TFM_RESIZE) {
td->val = &(bp->radius);
td->ival = bp->radius;
- } else {
+ }
+ else {
td->val = &(bp->alfa);
td->ival = bp->alfa;
}
@@ -1652,10 +1651,10 @@ static void createTransLatticeVerts(TransInfo *t)
bp = latt->def;
a = latt->pntsu * latt->pntsv * latt->pntsw;
- while(a--) {
- if(bp->hide==0) {
- if(bp->f1 & SELECT) countsel++;
- if(propmode) count++;
+ while (a--) {
+ if (bp->hide==0) {
+ if (bp->f1 & SELECT) countsel++;
+ if (propmode) count++;
}
bp++;
}
@@ -1663,7 +1662,7 @@ static void createTransLatticeVerts(TransInfo *t)
/* note: in prop mode we need at least 1 selected */
if (countsel==0) return;
- if(propmode) t->total = count;
+ if (propmode) t->total = count;
else t->total = countsel;
t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(Lattice EditMode)");
@@ -1673,13 +1672,13 @@ static void createTransLatticeVerts(TransInfo *t)
td = t->data;
bp = latt->def;
a = latt->pntsu * latt->pntsv * latt->pntsw;
- while(a--) {
- if(propmode || (bp->f1 & SELECT)) {
- if(bp->hide==0) {
+ while (a--) {
+ if (propmode || (bp->f1 & SELECT)) {
+ if (bp->hide==0) {
copy_v3_v3(td->iloc, bp->vec);
td->loc= bp->vec;
copy_v3_v3(td->center, td->loc);
- if(bp->f1 & SELECT) td->flag= TD_SELECTED;
+ if (bp->f1 & SELECT) td->flag= TD_SELECTED;
else td->flag= 0;
copy_m3_m3(td->smtx, smtx);
copy_m3_m3(td->mtx, mtx);
@@ -1713,33 +1712,33 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
int count = 0, hasselected = 0;
int propmode = t->flag & T_PROP_EDIT;
- if(edit==NULL || t->settings->particle.selectmode==SCE_SELECT_PATH) return;
+ if (edit==NULL || t->settings->particle.selectmode==SCE_SELECT_PATH) return;
psys = edit->psys;
- if(psys)
+ if (psys)
psmd = psys_get_modifier(ob,psys);
base->flag |= BA_HAS_RECALC_DATA;
- for(i=0, point=edit->points; i<edit->totpoint; i++, point++) {
+ for (i=0, point=edit->points; i<edit->totpoint; i++, point++) {
point->flag &= ~PEP_TRANSFORM;
transformparticle= 0;
- if((point->flag & PEP_HIDE)==0) {
- for(k=0, key=point->keys; k<point->totkey; k++, key++) {
- if((key->flag&PEK_HIDE)==0) {
- if(key->flag&PEK_SELECT) {
+ if ((point->flag & PEP_HIDE)==0) {
+ for (k=0, key=point->keys; k<point->totkey; k++, key++) {
+ if ((key->flag&PEK_HIDE)==0) {
+ if (key->flag&PEK_SELECT) {
hasselected= 1;
transformparticle= 1;
}
- else if(propmode)
+ else if (propmode)
transformparticle= 1;
}
}
}
- if(transformparticle) {
+ if (transformparticle) {
count += point->totkey;
point->flag |= PEP_TRANSFORM;
}
@@ -1751,7 +1750,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
t->total = count;
td = t->data = MEM_callocN(t->total * sizeof(TransData), "TransObData(Particle Mode)");
- if(t->mode == TFM_BAKE_TIME)
+ if (t->mode == TFM_BAKE_TIME)
tx = t->ext = MEM_callocN(t->total * sizeof(TransDataExtension), "Particle_TransExtension");
else
tx = t->ext = NULL;
@@ -1760,17 +1759,17 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
invert_m4_m4(ob->imat,ob->obmat);
- for(i=0, point=edit->points; i<edit->totpoint; i++, point++) {
+ for (i=0, point=edit->points; i<edit->totpoint; i++, point++) {
TransData *head, *tail;
head = tail = td;
- if(!(point->flag & PEP_TRANSFORM)) continue;
+ if (!(point->flag & PEP_TRANSFORM)) continue;
- if(psys && !(psys->flag & PSYS_GLOBAL_HAIR))
+ if (psys && !(psys->flag & PSYS_GLOBAL_HAIR))
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + i, mat);
- for(k=0, key=point->keys; k<point->totkey; k++, key++) {
- if(key->flag & PEK_USE_WCO) {
+ for (k=0, key=point->keys; k<point->totkey; k++, key++) {
+ if (key->flag & PEK_USE_WCO) {
copy_v3_v3(key->world_co, key->co);
mul_m4_v3(mat, key->world_co);
td->loc = key->world_co;
@@ -1781,34 +1780,34 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
copy_v3_v3(td->iloc, td->loc);
copy_v3_v3(td->center, td->loc);
- if(key->flag & PEK_SELECT)
+ if (key->flag & PEK_SELECT)
td->flag |= TD_SELECTED;
- else if(!propmode)
+ else if (!propmode)
td->flag |= TD_SKIP;
unit_m3(td->mtx);
unit_m3(td->smtx);
/* don't allow moving roots */
- if(k==0 && pset->flag & PE_LOCK_FIRST && (!psys || !(psys->flag & PSYS_GLOBAL_HAIR)))
+ if (k==0 && pset->flag & PE_LOCK_FIRST && (!psys || !(psys->flag & PSYS_GLOBAL_HAIR)))
td->protectflag |= OB_LOCK_LOC;
td->ob = ob;
td->ext = tx;
- if(t->mode == TFM_BAKE_TIME) {
+ if (t->mode == TFM_BAKE_TIME) {
td->val = key->time;
td->ival = *(key->time);
/* abuse size and quat for min/max values */
td->flag |= TD_NO_EXT;
- if(k==0) tx->size = NULL;
+ if (k==0) tx->size = NULL;
else tx->size = (key - 1)->time;
- if(k == point->totkey - 1) tx->quat = NULL;
+ if (k == point->totkey - 1) tx->quat = NULL;
else tx->quat = (key + 1)->time;
}
td++;
- if(tx)
+ if (tx)
tx++;
tail++;
}
@@ -1830,26 +1829,26 @@ void flushTransParticles(TransInfo *t)
float mat[4][4], imat[4][4], co[3];
int i, k, propmode = t->flag & T_PROP_EDIT;
- if(psys)
+ if (psys)
psmd = psys_get_modifier(ob, psys);
/* we do transform in world space, so flush world space position
* back to particle local space (only for hair particles) */
td= t->data;
- for(i=0, point=edit->points; i<edit->totpoint; i++, point++, td++) {
- if(!(point->flag & PEP_TRANSFORM)) continue;
+ for (i=0, point=edit->points; i<edit->totpoint; i++, point++, td++) {
+ if (!(point->flag & PEP_TRANSFORM)) continue;
- if(psys && !(psys->flag & PSYS_GLOBAL_HAIR)) {
+ if (psys && !(psys->flag & PSYS_GLOBAL_HAIR)) {
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + i, mat);
invert_m4_m4(imat,mat);
- for(k=0, key=point->keys; k<point->totkey; k++, key++) {
+ for (k=0, key=point->keys; k<point->totkey; k++, key++) {
copy_v3_v3(co, key->world_co);
mul_m4_v3(imat, co);
/* optimization for proportional edit */
- if(!propmode || !compare_v3v3(key->co, co, 0.0001f)) {
+ if (!propmode || !compare_v3v3(key->co, co, 0.0001f)) {
copy_v3_v3(key->co, co);
point->flag |= PEP_EDIT_RECALC;
}
@@ -1867,10 +1866,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;
@@ -1992,10 +1991,10 @@ static void VertsToTransData(TransInfo *t, TransData *td, BMEditMesh *em, BMVert
copy_v3_v3(td->center, td->loc);
- if(t->around==V3D_LOCAL) {
- if(em->selectmode & SCE_SELECT_FACE)
+ if (t->around==V3D_LOCAL) {
+ if (em->selectmode & SCE_SELECT_FACE)
get_face_center(td->center, em->bm, eve);
- else if(em->selectmode & SCE_SELECT_EDGE)
+ else if (em->selectmode & SCE_SELECT_EDGE)
get_edge_center(td->center, em->bm, eve);
}
copy_v3_v3(td->iloc, td->loc);
@@ -2022,7 +2021,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
{
ToolSettings *ts = CTX_data_tool_settings(C);
TransData *tob = NULL;
- BMEditMesh *em = ((Mesh *)t->obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(t->obedit);
BMesh *bm = em->bm;
BMVert *eve;
BMIter iter;
@@ -2038,7 +2037,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
if (t->flag & T_MIRROR)
{
- EDBM_CacheMirrorVerts(em, TRUE);
+ EDBM_verts_mirror_cache_begin(em, TRUE);
mirror = 1;
}
@@ -2051,19 +2050,19 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
* use the values for vertex mirror - campbell */
// transform now requires awareness for select mode, so we tag the f1 flags in verts
- if(selectmode & SCE_SELECT_VERTEX) {
+ if (selectmode & SCE_SELECT_VERTEX) {
BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
BM_elem_flag_set(eve, BM_ELEM_TAG, BM_elem_flag_test(eve, BM_ELEM_SELECT));
}
}
- else if(selectmode & SCE_SELECT_EDGE) {
+ else if (selectmode & SCE_SELECT_EDGE) {
BMEdge *eed;
eve = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL);
- for( ; eve; eve=BM_iter_step(&iter)) BM_elem_flag_disable(eve, BM_ELEM_TAG);
+ for ( ; eve; eve=BM_iter_step(&iter)) BM_elem_flag_disable(eve, BM_ELEM_TAG);
eed = BM_iter_new(&iter, bm, BM_EDGES_OF_MESH, NULL);
- for( ; eed; eed=BM_iter_step(&iter)) {
+ for ( ; eed; eed=BM_iter_step(&iter)) {
if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
BM_elem_flag_enable(eed->v1, BM_ELEM_TAG);
BM_elem_flag_enable(eed->v2, BM_ELEM_TAG);
@@ -2073,10 +2072,10 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
else {
BMFace *efa;
eve = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL);
- for( ; eve; eve=BM_iter_step(&iter)) BM_elem_flag_disable(eve, BM_ELEM_TAG);
+ for ( ; eve; eve=BM_iter_step(&iter)) BM_elem_flag_disable(eve, BM_ELEM_TAG);
efa = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, NULL);
- for( ; efa; efa=BM_iter_step(&iter)) {
+ for ( ; efa; efa=BM_iter_step(&iter)) {
if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
BMIter liter;
BMLoop *l;
@@ -2094,13 +2093,13 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
* verts*/
selstate = MEM_callocN(sizeof(*selstate) * bm->totvert, __func__);
eve = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL);
- for(a=0; eve; eve=BM_iter_step(&iter), a++) {
+ for (a=0; eve; eve=BM_iter_step(&iter), a++) {
if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
if (BM_elem_flag_test(eve, BM_ELEM_TAG)) {
selstate[a] = 1;
countsel++;
}
- if(propmode) count++;
+ if (propmode) count++;
}
}
@@ -2118,7 +2117,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
}
- if(propmode) {
+ if (propmode) {
t->total = count;
/* allocating scratch arrays */
@@ -2132,39 +2131,39 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
copy_m3_m4(mtx, t->obedit->obmat);
invert_m3_m3(smtx, mtx);
- if(propmode & T_PROP_CONNECTED) {
+ if (propmode & T_PROP_CONNECTED) {
editmesh_set_connectivity_distance(em, mtx, dists);
}
/* detect CrazySpace [tm] */
- if(modifiers_getCageIndex(t->scene, t->obedit, NULL, 1)>=0) {
- if(modifiers_isCorrectableDeformed(t->obedit)) {
+ 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) */
- if(totleft > 0) {
+ * 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");
crazyspace_set_quats_editmesh(em, (float*)defcos, mappedcos, quats); /* BMESH_TODO, abuses vertex index, should use an int array */
- if(mappedcos)
+ if (mappedcos)
MEM_freeN(mappedcos);
}
- if(defcos)
+ if (defcos)
MEM_freeN(defcos);
}
}
/* find out which half we do */
- if(mirror) {
+ if (mirror) {
eve = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL);
- for(a=0; eve; eve=BM_iter_step(&iter), a++) {
- if(!BM_elem_flag_test(eve, BM_ELEM_HIDDEN) && selstate[a] && eve->co[0]!=0.0f) {
- if(eve->co[0]<0.0f)
+ for (a=0; eve; eve=BM_iter_step(&iter), a++) {
+ if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN) && selstate[a] && eve->co[0]!=0.0f) {
+ if (eve->co[0]<0.0f)
{
t->mirror = -1;
mirror = -1;
@@ -2175,37 +2174,38 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
}
eve = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL);
- for(a=0; eve; eve=BM_iter_step(&iter), a++) {
- if(!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
- if(propmode || selstate[a]) {
+ for (a=0; eve; eve=BM_iter_step(&iter), a++) {
+ if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
+ if (propmode || selstate[a]) {
float *bweight = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_BWEIGHT);
VertsToTransData(t, tob, em, eve, bweight);
/* selected */
- if(selstate[a]) tob->flag |= TD_SELECTED;
+ if (selstate[a]) tob->flag |= TD_SELECTED;
/* active */
- if(eve == eve_act) tob->flag |= TD_ACTIVE;
+ if (eve == eve_act) tob->flag |= TD_ACTIVE;
- if(propmode) {
+ if (propmode) {
if (propmode & T_PROP_CONNECTED) {
tob->dist = dists[a];
- } else {
+ }
+ else {
tob->flag |= TD_NOTCONNECTED;
tob->dist = MAXFLOAT;
}
}
/* CrazySpace */
- if(defmats || (quats && BM_elem_index_get(eve) != -1)) {
+ if (defmats || (quats && BM_elem_index_get(eve) != -1)) {
float mat[3][3], qmat[3][3], imat[3][3];
/* use both or either quat and defmat correction */
- if(quats && BM_elem_index_get(eve) != -1) {
+ if (quats && BM_elem_index_get(eve) != -1) {
quat_to_mat3(qmat, quats + 4*BM_elem_index_get(eve));
- if(defmats)
+ if (defmats)
mul_serie_m3(mat, mtx, qmat, defmats[a],
NULL, NULL, NULL, NULL, NULL);
else
@@ -2225,9 +2225,9 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
}
/* Mirror? */
- if( (mirror>0 && tob->iloc[0]>0.0f) || (mirror<0 && tob->iloc[0]<0.0f)) {
- BMVert *vmir= EDBM_GetMirrorVert(em, eve); //t->obedit, em, eve, tob->iloc, a);
- if(vmir && vmir != eve) {
+ if ( (mirror>0 && tob->iloc[0]>0.0f) || (mirror<0 && tob->iloc[0]<0.0f)) {
+ BMVert *vmir= EDBM_verts_mirror_get(em, eve); //t->obedit, em, eve, tob->iloc, a);
+ if (vmir && vmir != eve) {
tob->extra = vmir;
}
}
@@ -2239,7 +2239,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
if (mirror != 0)
{
tob = t->data;
- for( a = 0; a < t->total; a++, tob++ )
+ for ( a = 0; a < t->total; a++, tob++ )
{
if (ABS(tob->loc[0]) <= 0.00001f)
{
@@ -2250,9 +2250,9 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
cleanup:
/* crazy space free */
- if(quats)
+ if (quats)
MEM_freeN(quats);
- if(defmats)
+ if (defmats)
MEM_freeN(defmats);
if (dists)
MEM_freeN(dists);
@@ -2260,7 +2260,7 @@ cleanup:
MEM_freeN(selstate);
if (t->flag & T_MIRROR) {
- EDBM_EndMirrorCache(em);
+ EDBM_verts_mirror_cache_end(em);
mirror = 1;
}
}
@@ -2272,13 +2272,13 @@ void flushTransNodes(TransInfo *t)
TransData2D *td;
/* flush to 2d vector from internally used 3d vector */
- for(a=0, td= t->data2d; a<t->total; a++, td++) {
+ for (a=0, td= t->data2d; a<t->total; a++, td++) {
td->loc2d[0]= td->loc[0];
td->loc2d[1]= td->loc[1];
}
/* handle intersection with noodles */
- if(t->total==1) {
+ if (t->total==1) {
ED_node_link_intersect_test(t->sa, 1);
}
@@ -2286,7 +2286,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
@@ -2308,7 +2308,7 @@ void flushTransSeq(TransInfo *t)
Sequence *seq_prev= NULL;
/* flush to 2d vector from internally used 3d vector */
- for(a=0, td= t->data, td2d= t->data2d; a<t->total; a++, td++, td2d++) {
+ for (a=0, td= t->data, td2d= t->data2d; a<t->total; a++, td++, td2d++) {
tdsq= (TransDataSeq *)td->extra;
seq= tdsq->seq;
old_start = seq->start;
@@ -2341,17 +2341,17 @@ void flushTransSeq(TransInfo *t)
}
if (seq != seq_prev) {
- if(seq->depth==0) {
+ if (seq->depth==0) {
/* Calculate this strip and all nested strips
* children are ALWAYS transformed first
- * so we dont need to do this in another loop. */
+ * so we don't need to do this in another loop. */
calc_sequence(t->scene, seq);
}
else {
calc_sequence_disp(t->scene, seq);
}
- if(tdsq->sel_flag == SELECT)
+ if (tdsq->sel_flag == SELECT)
seq_offset_animdata(t->scene, seq, seq->start - old_start);
}
seq_prev= seq;
@@ -2377,16 +2377,16 @@ void flushTransSeq(TransInfo *t)
/* need to do the overlap check in a new loop otherwise adjacent strips
* will not be updated and we'll get false positives */
seq_prev= NULL;
- for(a=0, td= t->data, td2d= t->data2d; a<t->total; a++, td++, td2d++) {
+ for (a=0, td= t->data, td2d= t->data2d; a<t->total; a++, td++, td2d++) {
tdsq= (TransDataSeq *)td->extra;
seq= tdsq->seq;
if (seq != seq_prev) {
- if(seq->depth==0) {
+ if (seq->depth==0) {
/* test overlap, displayes red outline */
seq->flag &= ~SEQ_OVERLAP;
- if( seq_test_overlap(seqbasep, seq) ) {
+ if ( seq_test_overlap(seqbasep, seq) ) {
seq->flag |= SEQ_OVERLAP;
}
}
@@ -2404,9 +2404,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;
@@ -2422,7 +2422,7 @@ static void UVsToTransData(SpaceImage *sima, TransData *td, TransData2D *td2d, f
td->ext= NULL; td->val= NULL;
- if(selected) {
+ if (selected) {
td->flag |= TD_SELECTED;
td->dist= 0.0;
}
@@ -2442,20 +2442,20 @@ static void createTransUVs(bContext *C, TransInfo *t)
TransData2D *td2d = NULL;
MTexPoly *tf;
MLoopUV *luv;
- BMEditMesh *em = ((Mesh *)t->obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(t->obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
int count=0, countsel=0;
int propmode = t->flag & T_PROP_EDIT;
- if(!ED_space_image_show_uvedit(sima, t->obedit)) return;
+ if (!ED_space_image_show_uvedit(sima, t->obedit)) return;
/* count */
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf)) {
+ if (!uvedit_face_visible(scene, ima, efa, tf)) {
BM_elem_flag_disable(efa, BM_ELEM_TAG);
continue;
}
@@ -2465,7 +2465,7 @@ static void createTransUVs(bContext *C, TransInfo *t)
if (uvedit_uv_selected(em, scene, l))
countsel++;
- if(propmode)
+ if (propmode)
count++;
}
}
@@ -2476,10 +2476,10 @@ 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)
+ if (sima->flag & SI_CLIP_UV)
t->flag |= T_CLIP_UV;
td= t->data;
@@ -2489,7 +2489,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;
@@ -2516,11 +2515,11 @@ void flushTransUVs(TransInfo *t)
invy= 1.0f/aspy;
/* flush to 2d vector from internally used 3d vector */
- for(a=0, td= t->data2d; a<t->total; a++, td++) {
+ for (a=0, td= t->data2d; a<t->total; a++, td++) {
td->loc2d[0]= td->loc[0]*invx;
td->loc2d[1]= td->loc[1]*invy;
- if((sima->flag & SI_PIXELSNAP) && (t->state != TRANS_CANCEL)) {
+ if ((sima->flag & SI_PIXELSNAP) && (t->state != TRANS_CANCEL)) {
td->loc2d[0]= (float)floor(width*td->loc2d[0] + 0.5f)/width;
td->loc2d[1]= (float)floor(height*td->loc2d[1] + 0.5f)/height;
}
@@ -2537,36 +2536,36 @@ int clipUVTransform(TransInfo *t, float *vec, int resize)
min[0]= min[1]= 0.0f;
max[0]= aspx; max[1]= aspy;
- for(a=0, td= t->data; a<t->total; a++, td++) {
+ for (a=0, td= t->data; a<t->total; a++, td++) {
DO_MINMAX2(td->loc, min, max);
}
- if(resize) {
- if(min[0] < 0.0f && t->center[0] > 0.0f && t->center[0] < aspx*0.5f)
+ if (resize) {
+ if (min[0] < 0.0f && t->center[0] > 0.0f && t->center[0] < aspx*0.5f)
vec[0] *= t->center[0]/(t->center[0] - min[0]);
- else if(max[0] > aspx && t->center[0] < aspx)
+ else if (max[0] > aspx && t->center[0] < aspx)
vec[0] *= (t->center[0] - aspx)/(t->center[0] - max[0]);
else
clipx= 0;
- if(min[1] < 0.0f && t->center[1] > 0.0f && t->center[1] < aspy*0.5f)
+ if (min[1] < 0.0f && t->center[1] > 0.0f && t->center[1] < aspy*0.5f)
vec[1] *= t->center[1]/(t->center[1] - min[1]);
- else if(max[1] > aspy && t->center[1] < aspy)
+ else if (max[1] > aspy && t->center[1] < aspy)
vec[1] *= (t->center[1] - aspy)/(t->center[1] - max[1]);
else
clipy= 0;
}
else {
- if(min[0] < 0.0f)
+ if (min[0] < 0.0f)
vec[0] -= min[0];
- else if(max[0] > aspx)
+ else if (max[0] > aspx)
vec[0] -= max[0]-aspx;
else
clipx= 0;
- if(min[1] < 0.0f)
+ if (min[1] < 0.0f)
vec[1] -= min[1];
- else if(max[1] > aspy)
+ else if (max[1] > aspy)
vec[1] -= max[1]-aspy;
else
clipy= 0;
@@ -3055,7 +3054,7 @@ static TransData *ActionFCurveToTransData(TransData *td, TransData2D **td2dv, FC
if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) {
TimeToTransData(td, bezt->vec[1], adt);
- /*set flags to move handles as necassary*/
+ /*set flags to move handles as necessary*/
td->flag |= TD_MOVEHANDLE1|TD_MOVEHANDLE2;
td2d->h1 = bezt->vec[0];
td2d->h2 = bezt->vec[2];
@@ -3175,7 +3174,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 +3230,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)
@@ -3274,7 +3273,7 @@ static void createTransActionData(bContext *C, TransInfo *t)
/* ********************* GRAPH EDITOR ************************* */
-/* Helper function for createTransGraphEditData, which is reponsible for associating
+/* Helper function for createTransGraphEditData, which is responsible for associating
* source data with transform data
*/
static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt, BezTriple *bezt,
@@ -3402,7 +3401,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 +3422,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 +3492,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)
@@ -3650,7 +3649,7 @@ static void sort_time_beztmaps (BeztMap *bezms, int totvert, const short UNUSED(
}
/* do we need to check if the handles need to be swapped?
- * optimisation: this only needs to be performed in the first loop
+ * optimization: this only needs to be performed in the first loop
*/
if (bezm->swapHs == 0) {
if ( (bezm->bezt->vec[0][0] > bezm->bezt->vec[1][0]) &&
@@ -3683,7 +3682,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 */
@@ -3719,9 +3718,9 @@ static void beztmap_to_data (TransInfo *t, FCurve *fcu, BeztMap *bezms, int totv
td2d->loc2d= (bezts + bezm->newIndex)->vec[1];
/* if only control point is selected, the handle pointers need to be updated as well */
- if(td2d->h1)
+ if (td2d->h1)
td2d->h1= (bezts + bezm->newIndex)->vec[0];
- if(td2d->h2)
+ if (td2d->h2)
td2d->h2= (bezts + bezm->newIndex)->vec[2];
adjusted[j] = 1;
@@ -3729,7 +3728,7 @@ static void beztmap_to_data (TransInfo *t, FCurve *fcu, BeztMap *bezms, int totv
/* the handle type pointer has to be updated too */
if (adjusted[j] && td->flag & TD_BEZTRIPLE && td->hdata) {
- if(bezm->swapHs == 1) {
+ if (bezm->swapHs == 1) {
td->hdata->h1 = &(bezts + bezm->newIndex)->h2;
td->hdata->h2 = &(bezts + bezm->newIndex)->h1;
}
@@ -3846,7 +3845,7 @@ void flushTransGraphData(TransInfo *t)
/* ******************* Sequencer Transform data ******************* */
/* This function applies the rules for transforming a strip so duplicate
- * checks dont need to be added in multiple places.
+ * checks don't need to be added in multiple places.
*
* recursive, count and flag MUST be set.
*
@@ -3898,7 +3897,8 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count
else *flag |= SEQ_LEFTSEL;
}
}
- } else {
+ }
+ else {
t->frame_side= 'B';
@@ -3918,7 +3918,8 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count
if ((seq->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL)) == (SEQ_LEFTSEL|SEQ_RIGHTSEL)) {
*flag= seq->flag;
*count= 2; /* we need 2 transdata's */
- } else {
+ }
+ else {
*flag= seq->flag;
*count= 1; /* selected or with a handle selected */
}
@@ -3926,7 +3927,7 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count
/* Recursive */
if ((seq->type == SEQ_META) && ((seq->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL)) == 0)) {
- /* if any handles are selected, dont recurse */
+ /* if any handles are selected, don't recurse */
*recursive = 1;
}
else {
@@ -3944,8 +3945,8 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count
#else
if (seq->type == SEQ_META) {
/* Meta's can only directly be moved between channels since they
- * dont have their start and length set directly (children affect that)
- * since this Meta is nested we dont need any of its data infact.
+ * don't have their start and length set directly (children affect that)
+ * since this Meta is nested we don't need any of its data infact.
* calc_sequence() will update its settings when run on the toplevel meta */
*flag= 0;
*count= 0;
@@ -4094,7 +4095,7 @@ static void freeSeqData(TransInfo *t)
{
Editing *ed= seq_give_editing(t->scene, FALSE);
- if(ed != NULL) {
+ if (ed != NULL) {
ListBase *seqbasep= ed->seqbasep;
TransData *td= t->data;
int a;
@@ -4111,7 +4112,7 @@ static void freeSeqData(TransInfo *t)
#if 0 // default 2.4 behavior
/* flush to 2d vector from internally used 3d vector */
- for(a=0; a<t->total; a++, td++) {
+ for (a=0; a<t->total; a++, td++) {
if ((seq != seq_prev) && (seq->depth==0) && (seq->flag & SEQ_OVERLAP)) {
seq= ((TransDataSeq *)td->extra)->seq;
shuffle_seq(seqbasep, seq);
@@ -4124,7 +4125,7 @@ static void freeSeqData(TransInfo *t)
{
int overlap= 0;
- for(a=0; a<t->total; a++, td++) {
+ for (a=0; a<t->total; a++, td++) {
seq_prev= NULL;
seq= ((TransDataSeq *)td->extra)->seq;
if ((seq != seq_prev) && (seq->depth==0) && (seq->flag & SEQ_OVERLAP)) {
@@ -4134,18 +4135,18 @@ static void freeSeqData(TransInfo *t)
seq_prev= seq;
}
- if(overlap) {
+ if (overlap) {
int has_effect= 0;
- for(seq= seqbasep->first; seq; seq= seq->next)
+ for (seq= seqbasep->first; seq; seq= seq->next)
seq->tmp= NULL;
td= t->data;
seq_prev= NULL;
- for(a=0; a<t->total; a++, td++) {
+ for (a=0; a<t->total; a++, td++) {
seq= ((TransDataSeq *)td->extra)->seq;
if ((seq != seq_prev)) {
/* check effects strips, we cant change their time */
- if((seq->type & SEQ_EFFECT) && seq->seq1) {
+ if ((seq->type & SEQ_EFFECT) && seq->seq1) {
has_effect= TRUE;
}
else {
@@ -4157,14 +4158,14 @@ static void freeSeqData(TransInfo *t)
shuffle_seq_time(seqbasep, t->scene);
- if(has_effect) {
+ if (has_effect) {
/* update effects strips based on strips just moved in time */
td= t->data;
seq_prev= NULL;
- for(a=0; a<t->total; a++, td++) {
+ for (a=0; a<t->total; a++, td++) {
seq= ((TransDataSeq *)td->extra)->seq;
if ((seq != seq_prev)) {
- if((seq->type & SEQ_EFFECT) && seq->seq1) {
+ if ((seq->type & SEQ_EFFECT) && seq->seq1) {
calc_sequence(t->scene, seq);
}
}
@@ -4173,11 +4174,11 @@ static void freeSeqData(TransInfo *t)
/* now if any effects _still_ overlap, we need to move them up */
td= t->data;
seq_prev= NULL;
- for(a=0; a<t->total; a++, td++) {
+ for (a=0; a<t->total; a++, td++) {
seq= ((TransDataSeq *)td->extra)->seq;
if ((seq != seq_prev)) {
- if((seq->type & SEQ_EFFECT) && seq->seq1) {
- if(seq_test_overlap(seqbasep, seq)) {
+ if ((seq->type & SEQ_EFFECT) && seq->seq1) {
+ if (seq_test_overlap(seqbasep, seq)) {
shuffle_seq(seqbasep, seq, t->scene);
}
}
@@ -4189,9 +4190,9 @@ static void freeSeqData(TransInfo *t)
}
#endif
- for(seq= seqbasep->first; seq; seq= seq->next) {
+ for (seq= seqbasep->first; seq; seq= seq->next) {
/* We might want to build a list of effects that need to be updated during transform */
- if(seq->type & SEQ_EFFECT) {
+ if (seq->type & SEQ_EFFECT) {
if (seq->seq1 && seq->seq1->flag & SELECT) calc_sequence(t->scene, seq);
else if (seq->seq2 && seq->seq2->flag & SELECT) calc_sequence(t->scene, seq);
else if (seq->seq3 && seq->seq3->flag & SELECT) calc_sequence(t->scene, seq);
@@ -4202,7 +4203,7 @@ static void freeSeqData(TransInfo *t)
}
else {
/* Cancelled, need to update the strips display */
- for(a=0; a<t->total; a++, td++) {
+ for (a=0; a<t->total; a++, td++) {
seq= ((TransDataSeq *)td->extra)->seq;
if ((seq != seq_prev) && (seq->depth==0)) {
calc_sequence_disp(t->scene, seq);
@@ -4212,9 +4213,9 @@ static void freeSeqData(TransInfo *t)
}
}
- if (t->customData) {
+ if ((t->customData != NULL) && (t->flag & T_FREE_CUSTOMDATA)) {
MEM_freeN(t->customData);
- t->customData= NULL;
+ t->customData = NULL;
}
if (t->data) {
MEM_freeN(t->data); // XXX postTrans usually does this
@@ -4258,12 +4259,12 @@ static void createTransSeqData(bContext *C, TransInfo *t)
#ifdef XXX_DURIAN_ANIM_TX_HACK
{
Sequence *seq;
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
+ for (seq= ed->seqbasep->first; seq; seq= seq->next) {
/* hack */
- if((seq->flag & SELECT)==0 && seq->type & SEQ_EFFECT) {
+ if ((seq->flag & SELECT)==0 && seq->type & SEQ_EFFECT) {
Sequence *seq_user;
int i;
- for(i=0; i<3; i++) {
+ for (i=0; i<3; i++) {
seq_user= *((&seq->seq1) + i);
if ( seq_user && (seq_user->flag & SELECT) &&
!(seq_user->flag & SEQ_LOCK) &&
@@ -4289,7 +4290,8 @@ static void createTransSeqData(bContext *C, TransInfo *t)
td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransSeq TransData");
td2d = t->data2d = MEM_callocN(t->total*sizeof(TransData2D), "TransSeq TransData2D");
- tdsq = t->customData= MEM_callocN(t->total*sizeof(TransDataSeq), "TransSeq TransDataSeq");
+ tdsq = t->customData = MEM_callocN(t->total*sizeof(TransDataSeq), "TransSeq TransDataSeq");
+ t->flag |= T_FREE_CUSTOMDATA;
@@ -4356,7 +4358,7 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
td->con= ob->constraints.first;
- /* hack: tempolarily disable tracking and/or constraints when getting
+ /* hack: temporarily disable tracking and/or constraints when getting
* object matrix, if tracking is on, or if constraints don't need
* inverse correction to stop it from screwing up space conversion
* matrix later
@@ -4459,13 +4461,13 @@ 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;
/* don't do it if we're not actually going to recalculate anything */
- if(t->mode == TFM_DUMMY)
+ if (t->mode == TFM_DUMMY)
return;
/* makes sure base flags and object flags are identical */
@@ -4473,23 +4475,23 @@ static void set_trans_object_base_flags(TransInfo *t)
/* handle pending update events, otherwise they got copied below */
for (base= scene->base.first; base; base= base->next) {
- if(base->object->recalc)
+ if (base->object->recalc)
object_handle_update(t->scene, base->object);
}
for (base= scene->base.first; base; base= base->next) {
base->flag &= ~BA_WAS_SEL;
- if(TESTBASELIB_BGMODE(v3d, scene, base)) {
+ if (TESTBASELIB_BGMODE(v3d, scene, base)) {
Object *ob= base->object;
Object *parsel= ob->parent;
/* if parent selected, deselect */
- while(parsel) {
- if(parsel->flag & SELECT) {
+ while (parsel) {
+ if (parsel->flag & SELECT) {
Base *parbase = object_in_scene(parsel, scene);
- if(parbase) { /* in rare cases this can fail */
- if TESTBASELIB_BGMODE(v3d, scene, parbase) {
+ if (parbase) { /* in rare cases this can fail */
+ if (TESTBASELIB_BGMODE(v3d, scene, parbase)) {
break;
}
}
@@ -4497,12 +4499,13 @@ static void set_trans_object_base_flags(TransInfo *t)
parsel= parsel->parent;
}
- if(parsel)
+ if (parsel)
{
/* rotation around local centers are allowed to propagate */
if ((t->mode == TFM_ROTATION || t->mode == TFM_TRACKBALL) && t->around == V3D_LOCAL) {
base->flag |= BA_TRANSFORM_CHILD;
- } else {
+ }
+ else {
base->flag &= ~SELECT;
base->flag |= BA_WAS_SEL;
}
@@ -4518,9 +4521,9 @@ static void set_trans_object_base_flags(TransInfo *t)
/* and we store them temporal in base (only used for transform code) */
/* this because after doing updates, the object->recalc is cleared */
for (base= scene->base.first; base; base= base->next) {
- if(base->object->recalc & OB_RECALC_OB)
+ if (base->object->recalc & OB_RECALC_OB)
base->flag |= BA_HAS_RECALC_OB;
- if(base->object->recalc & OB_RECALC_DATA)
+ if (base->object->recalc & OB_RECALC_DATA)
base->flag |= BA_HAS_RECALC_DATA;
}
}
@@ -4554,11 +4557,11 @@ static int count_proportional_objects(TransInfo *t)
{
/* mark all parents */
for (base= scene->base.first; base; base= base->next) {
- if(TESTBASELIB_BGMODE(v3d, scene, base)) {
+ if (TESTBASELIB_BGMODE(v3d, scene, base)) {
Object *parent = base->object->parent;
/* flag all parents */
- while(parent) {
+ while (parent) {
parent->flag |= BA_TRANSFORM_PARENT;
parent = parent->parent;
}
@@ -4598,9 +4601,9 @@ static int count_proportional_objects(TransInfo *t)
/* and we store them temporal in base (only used for transform code) */
/* this because after doing updates, the object->recalc is cleared */
for (base= scene->base.first; base; base= base->next) {
- if(base->object->recalc & OB_RECALC_OB)
+ if (base->object->recalc & OB_RECALC_OB)
base->flag |= BA_HAS_RECALC_OB;
- if(base->object->recalc & OB_RECALC_DATA)
+ if (base->object->recalc & OB_RECALC_DATA)
base->flag |= BA_HAS_RECALC_DATA;
}
@@ -4614,7 +4617,7 @@ static void clear_trans_object_base_flags(TransInfo *t)
for (base= sce->base.first; base; base = base->next)
{
- if(base->flag & BA_WAS_SEL)
+ if (base->flag & BA_WAS_SEL)
base->flag |= SELECT;
base->flag &= ~(BA_WAS_SEL|BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA|BA_TEMP_TAG|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT);
@@ -4739,7 +4742,7 @@ void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *o
float cfra= (float)CFRA;
short flag= 0;
- /* flag is initialised from UserPref keyframing settings
+ /* flag is initialized from UserPref keyframing settings
* - special exception for targetless IK - INSERTKEY_MATRIX keyframes should get
* visual keyframes even if flag not set, as it's not that useful otherwise
* (for quick animation recording)
@@ -4864,7 +4867,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,14 +4876,35 @@ 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){
+ if (t->mode == TFM_EDGE_SLIDE) {
SlideData *sld = t->customData;
+
+ /* handle multires re-projection, done
+ * on transform completion since it's
+ * really slow -joeedh */
+ projectSVData(t, TRUE);
+
+ /* free temporary faces to avoid automerging and deleting
+ * during cleanup - psy-fi */
freeSlideTempFaces(sld);
}
EDBM_automerge(t->scene, t->obedit, 1);
}
+#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;
+
+ sld->perc = 0.0;
+ projectSVData(t, FALSE);
+ }
+ }
+#endif
}
}
@@ -4892,12 +4916,12 @@ 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 */
- if(t->mode == TFM_SEQ_SLIDE) {
- if(t->frame_side == 'B')
+ if (t->mode == TFM_SEQ_SLIDE) {
+ if (t->frame_side == 'B')
ED_markers_post_apply_transform(&t->scene->markers, t->scene, TFM_TIME_TRANSLATE, t->values[0], t->frame_side);
}
else if (ELEM(t->frame_side, 'L', 'R')) {
@@ -4910,19 +4934,19 @@ 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 */
ED_node_link_intersect_test(t->sa, 0);
}
else if (t->spacetype == SPACE_CLIP) {
- SpaceClip *sc= t->sa->spacedata.first;
- MovieClip *clip= ED_space_clip(sc);
+ SpaceClip *sc = t->sa->spacedata.first;
+ MovieClip *clip = ED_space_clip(sc);
- if(t->scene->nodetree) {
+ 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);
}
@@ -4931,7 +4955,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first;
bAnimContext ac;
- /* initialise relevant anim-context 'context' data */
+ /* initialize relevant anim-context 'context' data */
if (ANIM_animdata_get_context(C, &ac) == 0)
return;
@@ -4952,11 +4976,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);
@@ -4983,11 +5007,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);
}
@@ -4996,11 +5020,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;
@@ -5016,7 +5040,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 */
@@ -5046,7 +5070,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
bAnimContext ac;
const short use_handle = !(sipo->flag & SIPO_NOHANDLES);
- /* initialise relevant anim-context 'context' data */
+ /* initialize relevant anim-context 'context' data */
if (ANIM_animdata_get_context(C, &ac) == 0)
return;
@@ -5065,11 +5089,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);
@@ -5090,13 +5114,13 @@ 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) {
bAnimContext ac;
- /* initialise relevant anim-context 'context' data */
+ /* initialize relevant anim-context 'context' data */
if (ANIM_animdata_get_context(C, &ac) == 0)
return;
@@ -5129,7 +5153,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
else if (t->obedit) {
if (t->obedit->type == OB_MESH)
{
- BMEditMesh *em = ((Mesh *)t->obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(t->obedit);
/* table needs to be created for each edit command, since vertices can move etc */
mesh_octree_table(t->obedit, em, NULL, 'e');
}
@@ -5142,7 +5166,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
ob= t->poseobj;
arm= ob->data;
- if((t->flag & T_AUTOIK) && (t->options & CTX_AUTOCONFIRM)) {
+ if ((t->flag & T_AUTOIK) && (t->options & CTX_AUTOCONFIRM)) {
/* when running transform non-interactively (operator exec),
* we need to update the pose otherwise no updates get called during
* transform and the auto-ik is not applied. see [#26164] */
@@ -5151,25 +5175,25 @@ 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 */
for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) {
bKinematicConstraint *data= has_targetless_ik(pchan);
- if(data) data->flag &= ~CONSTRAINT_IK_AUTO;
+ if (data) data->flag &= ~CONSTRAINT_IK_AUTO;
}
}
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);
}
@@ -5206,8 +5230,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
/* flag object caches as outdated */
BKE_ptcache_ids_from_object(&pidlist, ob, t->scene, MAX_DUPLI_RECUR);
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->type != PTCACHE_TYPE_PARTICLES) /* particles don't need reset on geometry change */
+ for (pid=pidlist.first; pid; pid=pid->next) {
+ if (pid->type != PTCACHE_TYPE_PARTICLES) /* particles don't need reset on geometry change */
pid->cache->flag |= PTCACHE_OUTDATED;
}
BLI_freelistN(&pidlist);
@@ -5223,7 +5247,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 */
@@ -5241,7 +5265,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
/* recalculating the frame positions means we loose our original transform if its not auto-keyed [#24451]
* this hack re-applies it, which is annoying, only alternatives are...
- * - dont recalc paths.
+ * - don't recalc paths.
* - have an object_handle_update() which gives is the new transform without touching the objects.
* - only recalc paths on auto-keying.
* - ED_objects_recalculate_paths could backup/restore transforms.
@@ -5256,7 +5280,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
#if 0 // TRANSFORM_FIX_ME
- if(resetslowpar)
+ if (resetslowpar)
reset_slowparents();
#endif
}
@@ -5272,7 +5296,7 @@ static void createTransObject(bContext *C, TransInfo *t)
/* count */
t->total= CTX_DATA_COUNT(C, selected_objects);
- if(!t->total) {
+ if (!t->total) {
/* clear here, main transform function escapes too */
clear_trans_object_base_flags(t);
return;
@@ -5376,7 +5400,7 @@ static void createTransNodeData(bContext *C, TransInfo *t)
SpaceNode *snode= t->sa->spacedata.first;
bNode *node;
- if(!snode->edittree) {
+ if (!snode->edittree) {
t->total= 0;
return;
}
@@ -5424,20 +5448,21 @@ typedef struct TransDataTracking {
short coord;
} TransDataTracking;
-static void markerToTransDataInit(TransData *td, TransData2D *td2d,
- TransDataTracking *tdt, MovieTrackingTrack *track, int area, float *loc, float *rel, float *off)
+static void markerToTransDataInit(TransData *td, TransData2D *td2d, TransDataTracking *tdt, MovieTrackingTrack *track,
+ int area, float *loc, float *rel, float *off)
{
- int anchor = area==TRACK_AREA_POINT && off;
+ int anchor = area == TRACK_AREA_POINT && off;
tdt->mode = transDataTracking_ModeTracks;
- if(anchor) {
+ if (anchor) {
td2d->loc[0] = rel[0]; /* hold original location */
td2d->loc[1] = rel[1];
tdt->loc= loc;
td2d->loc2d = loc; /* current location */
- } else {
+ }
+ else {
td2d->loc[0] = loc[0]; /* hold original location */
td2d->loc[1] = loc[1];
@@ -5445,60 +5470,61 @@ static void markerToTransDataInit(TransData *td, TransData2D *td2d,
}
td2d->loc[2] = 0.0f;
- tdt->relative= rel;
- tdt->area= area;
+ tdt->relative = rel;
+ tdt->area = area;
- tdt->markersnr= track->markersnr;
- tdt->markers= track->markers;
+ tdt->markersnr = track->markersnr;
+ tdt->markers = track->markers;
- if(rel) {
- if(!anchor) {
- td2d->loc[0]+= rel[0];
- td2d->loc[1]+= rel[1];
+ if (rel) {
+ if (!anchor) {
+ td2d->loc[0] += rel[0];
+ td2d->loc[1] += rel[1];
}
copy_v2_v2(tdt->srelative, rel);
}
- if(off)
+ if (off)
copy_v2_v2(tdt->soffset, off);
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;
- td->ext= NULL; td->val= NULL;
+ td->ext= NULL;
+ td->val= NULL;
td->flag |= TD_SELECTED;
- td->dist= 0.0;
+ td->dist = 0.0;
unit_m3(td->mtx);
unit_m3(td->smtx);
}
static void trackToTransData(SpaceClip *sc, TransData *td, TransData2D *td2d,
- TransDataTracking *tdt, MovieTrackingTrack *track)
+ TransDataTracking *tdt, MovieTrackingTrack *track)
{
- MovieTrackingMarker *marker= BKE_tracking_ensure_marker(track, sc->user.framenr);
+ MovieTrackingMarker *marker = BKE_tracking_ensure_marker(track, sc->user.framenr);
- tdt->flag= marker->flag;
- marker->flag&= ~(MARKER_DISABLED|MARKER_TRACKED);
+ tdt->flag = marker->flag;
+ marker->flag &= ~(MARKER_DISABLED|MARKER_TRACKED);
markerToTransDataInit(td++, td2d++, tdt++, track, TRACK_AREA_POINT, track->offset, marker->pos, track->offset);
- if(track->flag&SELECT)
+ if (track->flag & SELECT)
markerToTransDataInit(td++, td2d++, tdt++, track, TRACK_AREA_POINT, marker->pos, NULL, NULL);
- if(track->pat_flag&SELECT) {
+ if (track->pat_flag & SELECT) {
markerToTransDataInit(td++, td2d++, tdt++, track, TRACK_AREA_PAT, track->pat_min, marker->pos, NULL);
markerToTransDataInit(td++, td2d++, tdt++, track, TRACK_AREA_PAT, track->pat_max, marker->pos, NULL);
}
- if(track->search_flag&SELECT) {
+ if (track->search_flag & SELECT) {
markerToTransDataInit(td++, td2d++, tdt++, track, TRACK_AREA_SEARCH, track->search_min, marker->pos, NULL);
markerToTransDataInit(td++, td2d++, tdt++, track, TRACK_AREA_SEARCH, track->search_max, marker->pos, NULL);
}
@@ -5506,10 +5532,12 @@ static void trackToTransData(SpaceClip *sc, TransData *td, TransData2D *td2d,
static void transDataTrackingFree(TransInfo *t)
{
- TransDataTracking *tdt= t->customData;
+ TransDataTracking *tdt = t->customData;
+
+ if (tdt) {
+ if (tdt->smarkers)
+ MEM_freeN(tdt->smarkers);
- if(tdt) {
- if(tdt->smarkers) MEM_freeN(tdt->smarkers);
MEM_freeN(tdt);
}
}
@@ -5520,7 +5548,7 @@ static void createTransTrackingTracksData(bContext *C, TransInfo *t)
TransData2D *td2d;
SpaceClip *sc = CTX_wm_space_clip(C);
MovieClip *clip = ED_space_clip(sc);
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
MovieTrackingTrack *track;
MovieTrackingMarker *marker;
TransDataTracking *tdt;
@@ -5530,34 +5558,39 @@ static void createTransTrackingTracksData(bContext *C, TransInfo *t)
t->total = 0;
track = tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0) {
- marker= BKE_tracking_get_marker(track, framenr);
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED)==0) {
+ marker = BKE_tracking_get_marker(track, framenr);
t->total++; /* offset */
- if(track->flag&SELECT) t->total++;
- if(track->pat_flag&SELECT) t->total+= 2;
- if(track->search_flag&SELECT) t->total+= 2;
+ if (track->flag & SELECT)
+ t->total++;
+
+ if (track->pat_flag & SELECT)
+ t->total+= 2;
+
+ if (track->search_flag & SELECT)
+ t->total+= 2;
}
track = track->next;
}
- if(t->total==0)
+ if (t->total == 0)
return;
td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransTracking TransData");
td2d = t->data2d = MEM_callocN(t->total*sizeof(TransData2D), "TransTracking TransData2D");
tdt = t->customData = MEM_callocN(t->total*sizeof(TransDataTracking), "TransTracking TransDataTracking");
- t->customFree= transDataTrackingFree;
+ t->customFree = transDataTrackingFree;
/* create actual data */
track = tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0) {
- marker= BKE_tracking_get_marker(track, framenr);
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED) == 0) {
+ marker = BKE_tracking_get_marker(track, framenr);
trackToTransData(sc, td, td2d, tdt, track);
@@ -5566,20 +5599,29 @@ static void createTransTrackingTracksData(bContext *C, TransInfo *t)
td2d++;
tdt++;
- if((marker->flag&MARKER_DISABLED)==0) {
- if(track->flag&SELECT) {td++; td2d++; tdt++;}
- if(track->pat_flag&SELECT) {td+= 2; td2d+= 2;tdt+=2;}
+ if ((marker->flag & MARKER_DISABLED) == 0) {
+ if (track->flag & SELECT) {
+ td++;
+ td2d++;
+ tdt++;
+ }
+
+ if (track->pat_flag & SELECT) {
+ td += 2;
+ td2d += 2;
+ tdt +=2;
+ }
}
- if(track->search_flag&SELECT) {
- td+= 2;
- td2d+= 2;
- tdt+= 2;
+ if (track->search_flag & SELECT) {
+ td += 2;
+ td2d += 2;
+ tdt += 2;
- if(marker->flag&MARKER_DISABLED) {
- td+= 3;
- td2d+= 3;
- tdt+= 3;
+ if (marker->flag & MARKER_DISABLED) {
+ td += 3;
+ td2d += 3;
+ tdt += 3;
};
}
}
@@ -5589,7 +5631,7 @@ static void createTransTrackingTracksData(bContext *C, TransInfo *t)
}
static void markerToTransCurveDataInit(TransData *td, TransData2D *td2d, TransDataTracking *tdt,
- MovieTrackingMarker *marker, MovieTrackingMarker *prev_marker,
+ MovieTrackingMarker *marker, MovieTrackingMarker *prev_marker,
short coord, float size)
{
float frames_delta = (marker->framenr - prev_marker->framenr);
@@ -5611,16 +5653,17 @@ 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;
- td->ext= NULL; td->val= NULL;
+ td->ext= NULL;
+ td->val= NULL;
td->flag |= TD_SELECTED;
- td->dist= 0.0;
+ td->dist = 0.0;
unit_m3(td->mtx);
unit_m3(td->smtx);
@@ -5644,19 +5687,19 @@ static void createTransTrackingCurvesData(bContext *C, TransInfo *t)
t->total = 0;
track = tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED)==0) {
- for(i = 1; i < track->markersnr; i++) {
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED)==0) {
+ for (i = 1; i < track->markersnr; i++) {
marker = &track->markers[i];
prev_marker = &track->markers[i-1];
- if((marker->flag & MARKER_DISABLED) || (prev_marker->flag & MARKER_DISABLED))
+ if ((marker->flag & MARKER_DISABLED) || (prev_marker->flag & MARKER_DISABLED))
continue;
- if(marker->flag & MARKER_GRAPH_SEL_X)
+ if (marker->flag & MARKER_GRAPH_SEL_X)
t->total += 1;
- if(marker->flag & MARKER_GRAPH_SEL_Y)
+ if (marker->flag & MARKER_GRAPH_SEL_Y)
t->total += 1;
}
}
@@ -5664,7 +5707,7 @@ static void createTransTrackingCurvesData(bContext *C, TransInfo *t)
track = track->next;
}
- if(t->total==0)
+ if (t->total == 0)
return;
td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransTracking TransData");
@@ -5675,23 +5718,23 @@ static void createTransTrackingCurvesData(bContext *C, TransInfo *t)
/* create actual data */
track = tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED)==0) {
- for(i = 1; i < track->markersnr; i++) {
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED)==0) {
+ for (i = 1; i < track->markersnr; i++) {
marker = &track->markers[i];
prev_marker = &track->markers[i-1];
- if((marker->flag & MARKER_DISABLED) || (prev_marker->flag & MARKER_DISABLED))
+ if ((marker->flag & MARKER_DISABLED) || (prev_marker->flag & MARKER_DISABLED))
continue;
- if(marker->flag & MARKER_GRAPH_SEL_X) {
+ if (marker->flag & MARKER_GRAPH_SEL_X) {
markerToTransCurveDataInit(td, td2d, tdt, marker, &track->markers[i-1], 0, width);
td += 1;
td2d += 1;
tdt += 1;
}
- if(marker->flag & MARKER_GRAPH_SEL_Y) {
+ if (marker->flag & MARKER_GRAPH_SEL_Y) {
markerToTransCurveDataInit(td, td2d, tdt, marker, &track->markers[i-1], 1, height);
td += 1;
@@ -5713,13 +5756,13 @@ static void createTransTrackingData(bContext *C, TransInfo *t)
t->total = 0;
- if(!clip || !BKE_movieclip_has_frame(clip, &sc->user))
+ if (!clip || !BKE_movieclip_has_frame(clip, &sc->user))
return;
- if(!ELEM(t->mode, TFM_RESIZE, TFM_TRANSLATION))
+ if (!ELEM(t->mode, TFM_RESIZE, TFM_TRANSLATION))
return;
- if(ar->regiontype == RGN_TYPE_PREVIEW) {
+ if (ar->regiontype == RGN_TYPE_PREVIEW) {
/* transformation was called from graph editor */
createTransTrackingCurvesData(C, t);
}
@@ -5731,44 +5774,49 @@ static void createTransTrackingData(bContext *C, TransInfo *t)
static void cancelTransTracking(TransInfo *t)
{
TransDataTracking *tdt = t->customData;
- SpaceClip *sc= t->sa->spacedata.first;
- MovieClip *clip= ED_space_clip(sc);
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
+ SpaceClip *sc = t->sa->spacedata.first;
+ MovieClip *clip = ED_space_clip(sc);
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
MovieTrackingTrack *track;
MovieTrackingMarker *marker;
int a, framenr = sc->user.framenr;
- if(tdt->mode == transDataTracking_ModeTracks) {
+ if (tdt->mode == transDataTracking_ModeTracks) {
track = tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED)==0) {
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED)==0) {
marker = BKE_tracking_get_marker(track, framenr);
marker->flag = tdt->flag;
tdt++;
- if(track->flag&SELECT) tdt++;
- if(track->pat_flag&SELECT) tdt += 2;
- if(track->search_flag&SELECT) tdt += 2;
+ if (track->flag & SELECT)
+ tdt++;
+
+ if (track->pat_flag & SELECT)
+ tdt += 2;
+
+ if (track->search_flag & SELECT)
+ tdt += 2;
}
track = track->next;
}
}
- else if(tdt->mode == transDataTracking_ModeCurves) {
+ else if (tdt->mode == transDataTracking_ModeCurves) {
MovieTrackingMarker *prev_marker;
track = tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED)==0) {
- for(a = 1; a < track->markersnr; a++) {
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED)==0) {
+ for (a = 1; a < track->markersnr; a++) {
marker = &track->markers[a];
prev_marker = &track->markers[a-1];
- if((marker->flag & MARKER_DISABLED) || (prev_marker->flag & MARKER_DISABLED))
+ if ((marker->flag & MARKER_DISABLED) || (prev_marker->flag & MARKER_DISABLED))
continue;
- if(marker->flag & (MARKER_GRAPH_SEL_X|MARKER_GRAPH_SEL_Y)) {
+ if (marker->flag & (MARKER_GRAPH_SEL_X|MARKER_GRAPH_SEL_Y)) {
marker->flag = tdt->flag;
}
}
@@ -5786,19 +5834,19 @@ void flushTransTracking(TransInfo *t)
TransDataTracking *tdt;
int a;
- if(t->state == TRANS_CANCEL)
+ if (t->state == TRANS_CANCEL)
cancelTransTracking(t);
/* flush to 2d vector from internally used 3d vector */
- for(a=0, td= t->data, td2d= t->data2d, tdt= t->customData; a<t->total; a++, td2d++, td++, tdt++) {
- if(tdt->mode == transDataTracking_ModeTracks) {
- if(t->flag&T_ALT_TRANSFORM) {
- if(tdt->area==TRACK_AREA_POINT && tdt->relative) {
+ for (a=0, td= t->data, td2d= t->data2d, tdt= t->customData; a<t->total; a++, td2d++, td++, tdt++) {
+ if (tdt->mode == transDataTracking_ModeTracks) {
+ if (t->flag & T_ALT_TRANSFORM) {
+ if (tdt->area == TRACK_AREA_POINT && tdt->relative) {
float d[2], d2[2];
- if(!tdt->smarkers) {
- tdt->smarkers= MEM_callocN(sizeof(*tdt->smarkers)*tdt->markersnr, "flushTransTracking markers");
- for(a= 0; a<tdt->markersnr; a++)
+ if (!tdt->smarkers) {
+ tdt->smarkers = MEM_callocN(sizeof(*tdt->smarkers)*tdt->markersnr, "flushTransTracking markers");
+ for (a = 0; a < tdt->markersnr; a++)
copy_v2_v2(tdt->smarkers[a], tdt->markers[a].pos);
}
@@ -5807,22 +5855,22 @@ void flushTransTracking(TransInfo *t)
sub_v2_v2v2(d2, td2d->loc, tdt->srelative);
- for(a= 0; a<tdt->markersnr; a++)
+ for (a= 0; a<tdt->markersnr; a++)
add_v2_v2v2(tdt->markers[a].pos, tdt->smarkers[a], d2);
negate_v2_v2(td2d->loc2d, d);
}
}
- if(tdt->area!=TRACK_AREA_POINT || tdt->relative==0) {
+ if (tdt->area!=TRACK_AREA_POINT || tdt->relative==0) {
td2d->loc2d[0] = td2d->loc[0];
td2d->loc2d[1] = td2d->loc[1];
- if(tdt->relative)
+ if (tdt->relative)
sub_v2_v2(td2d->loc2d, tdt->relative);
}
}
- else if(tdt->mode == transDataTracking_ModeCurves) {
+ else if (tdt->mode == transDataTracking_ModeCurves) {
td2d->loc2d[tdt->coord] = tdt->prev_pos[tdt->coord] + td2d->loc[1] * tdt->scale;
}
}
@@ -5841,7 +5889,7 @@ void createTransData(bContext *C, TransInfo *t)
t->ext = NULL;
t->flag |= T_EDIT;
createTransEdge(t);
- if(t->data && t->flag & T_PROP_EDIT) {
+ if (t->data && t->flag & T_PROP_EDIT) {
sort_trans_data(t); // makes selected become first in array
set_prop_dist(t, 1);
sort_trans_data_dist(t);
@@ -5854,7 +5902,7 @@ void createTransData(bContext *C, TransInfo *t)
else if (t->spacetype == SPACE_IMAGE) {
t->flag |= T_POINTS|T_2D_EDIT;
createTransUVs(C, t);
- if(t->data && (t->flag & T_PROP_EDIT)) {
+ if (t->data && (t->flag & T_PROP_EDIT)) {
sort_trans_data(t); // makes selected become first in array
set_prop_dist(t, 1);
sort_trans_data_dist(t);
@@ -5884,7 +5932,7 @@ void createTransData(bContext *C, TransInfo *t)
}
#endif
}
- else if(t->spacetype == SPACE_NODE) {
+ else if (t->spacetype == SPACE_NODE) {
t->flag |= T_2D_EDIT|T_POINTS;
createTransNodeData(C, t);
if (t->data && (t->flag & T_PROP_EDIT)) {
@@ -5902,7 +5950,7 @@ void createTransData(bContext *C, TransInfo *t)
if (t->obedit->type == OB_MESH) {
createTransEditVerts(C, t);
}
- else if ELEM(t->obedit->type, OB_CURVE, OB_SURF) {
+ else if (ELEM(t->obedit->type, OB_CURVE, OB_SURF)) {
createTransCurveVerts(C, t);
}
else if (t->obedit->type==OB_LATTICE) {
@@ -5921,7 +5969,7 @@ void createTransData(bContext *C, TransInfo *t)
t->flag |= T_EDIT|T_POINTS;
- if(t->data && t->flag & T_PROP_EDIT) {
+ if (t->data && t->flag & T_PROP_EDIT) {
if (ELEM(t->obedit->type, OB_CURVE, OB_MESH)) {
sort_trans_data(t); // makes selected become first in array
set_prop_dist(t, 0);
@@ -5935,7 +5983,7 @@ void createTransData(bContext *C, TransInfo *t)
}
/* exception... hackish, we want bonesize to use bone orientation matrix (ton) */
- if(t->mode==TFM_BONESIZE) {
+ if (t->mode==TFM_BONESIZE) {
t->flag &= ~(T_EDIT|T_POINTS);
t->flag |= T_POSE;
t->poseobj = ob; /* <- tsk tsk, this is going to give issues one day */
@@ -5950,11 +5998,11 @@ void createTransData(bContext *C, TransInfo *t)
/* important that ob_armature can be set even when its not selected [#23412]
* lines below just check is also visible */
Object *ob_armature= modifiers_isDeformedByArmature(ob);
- if(ob_armature && ob_armature->mode & OB_MODE_POSE) {
+ if (ob_armature && ob_armature->mode & OB_MODE_POSE) {
Base *base_arm= object_in_scene(ob_armature, t->scene);
- if(base_arm) {
+ if (base_arm) {
View3D *v3d = t->view;
- if(BASE_VISIBLE(v3d, base_arm)) {
+ if (BASE_VISIBLE(v3d, base_arm)) {
createTransPose(t, ob_armature);
}
}
@@ -5966,7 +6014,7 @@ void createTransData(bContext *C, TransInfo *t)
createTransParticleVerts(C, t);
t->flag |= T_POINTS;
- if(t->data && t->flag & T_PROP_EDIT) {
+ if (t->data && t->flag & T_PROP_EDIT) {
sort_trans_data(t); // makes selected become first in array
set_prop_dist(t, 1);
sort_trans_data_dist(t);
@@ -5977,13 +6025,13 @@ void createTransData(bContext *C, TransInfo *t)
* transform ops redo clears sculpt/project undo stack.
*
* Could use 'OB_MODE_ALL_PAINT' since there are key conflicts,
- * transform + paint isnt well supported. */
+ * transform + paint isn't well supported. */
}
else {
createTransObject(C, t);
t->flag |= T_OBJECT;
- if(t->data && t->flag & T_PROP_EDIT) {
+ if (t->data && t->flag & T_PROP_EDIT) {
// selected objects are already first, no need to presort
set_prop_dist(t, 1);
sort_trans_data_dist(t);
@@ -5993,7 +6041,7 @@ void createTransData(bContext *C, TransInfo *t)
{
View3D *v3d = t->view;
RegionView3D *rv3d = CTX_wm_region_view3d(C);
- if(rv3d && (t->flag & T_OBJECT) && v3d->camera == OBACT && rv3d->persp==RV3D_CAMOB)
+ if (rv3d && (t->flag & T_OBJECT) && v3d->camera == OBACT && rv3d->persp==RV3D_CAMOB)
{
t->flag |= T_CAMERA;
}
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 13f45ff58b9..eb04ad04aa7 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -50,6 +50,11 @@
#include "DNA_modifier_types.h"
#include "DNA_movieclip_types.h"
+#include "BLI_math.h"
+#include "BLI_blenlib.h"
+#include "BLI_rand.h"
+#include "BLI_utildefines.h"
+
#include "RNA_access.h"
//#include "BIF_screen.h"
@@ -91,11 +96,6 @@
//#include "BDR_unwrapper.h"
-#include "BLI_math.h"
-#include "BLI_blenlib.h"
-#include "BLI_rand.h"
-#include "BLI_utildefines.h"
-
#include "WM_types.h"
#include "WM_api.h"
@@ -107,8 +107,6 @@
#include "transform.h"
-extern ListBase editelems;
-
/* ************************** Functions *************************** */
void getViewVector(TransInfo *t, float coord[3], float vec[3])
@@ -149,17 +147,17 @@ static void clipMirrorModifier(TransInfo *t, Object *ob)
if ((md->type==eModifierType_Mirror) && (md->mode & eModifierMode_Realtime)) {
MirrorModifierData *mmd = (MirrorModifierData*) md;
- if(mmd->flag & MOD_MIR_CLIPPING) {
+ if (mmd->flag & MOD_MIR_CLIPPING) {
axis = 0;
- if(mmd->flag & MOD_MIR_AXIS_X) {
+ if (mmd->flag & MOD_MIR_AXIS_X) {
axis |= 1;
tolerance[0] = mmd->tolerance;
}
- if(mmd->flag & MOD_MIR_AXIS_Y) {
+ if (mmd->flag & MOD_MIR_AXIS_Y) {
axis |= 2;
tolerance[1] = mmd->tolerance;
}
- if(mmd->flag & MOD_MIR_AXIS_Z) {
+ if (mmd->flag & MOD_MIR_AXIS_Z) {
axis |= 4;
tolerance[2] = mmd->tolerance;
}
@@ -176,7 +174,7 @@ static void clipMirrorModifier(TransInfo *t, Object *ob)
invert_m4_m4(imtx, mtx);
}
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
int clip;
float loc[3], iloc[3];
@@ -197,8 +195,8 @@ static void clipMirrorModifier(TransInfo *t, Object *ob)
}
clip = 0;
- if(axis & 1) {
- if(fabsf(iloc[0])<=tolerance[0] ||
+ if (axis & 1) {
+ if (fabsf(iloc[0])<=tolerance[0] ||
loc[0]*iloc[0]<0.0f)
{
loc[0]= 0.0f;
@@ -206,16 +204,16 @@ static void clipMirrorModifier(TransInfo *t, Object *ob)
}
}
- if(axis & 2) {
- if(fabs(iloc[1])<=tolerance[1] ||
+ if (axis & 2) {
+ if (fabs(iloc[1])<=tolerance[1] ||
loc[1]*iloc[1]<0.0f)
{
loc[1]= 0.0f;
clip = 1;
}
}
- if(axis & 4) {
- if(fabs(iloc[2])<=tolerance[2] ||
+ if (axis & 4) {
+ if (fabs(iloc[2])<=tolerance[2] ||
loc[2]*iloc[2]<0.0f)
{
loc[2]= 0.0f;
@@ -243,7 +241,7 @@ static void editbmesh_apply_to_mirror(TransInfo *t)
BMVert *eve;
int i;
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
break;
if (td->loc==NULL)
@@ -271,7 +269,7 @@ static void animrecord_check_state (Scene *scene, ID *id, wmTimer *animtimer)
ScreenAnimData *sad= (animtimer) ? animtimer->customdata : NULL;
/* sanity checks */
- if ELEM3(NULL, scene, id, sad)
+ if (ELEM3(NULL, scene, id, sad))
return;
/* check if we need a new strip if:
@@ -339,7 +337,7 @@ static void recalcData_actedit(TransInfo *t)
bAnimListElem *ale;
int filter;
- /* initialise relevant anim-context 'context' data from TransInfo data */
+ /* initialize relevant anim-context 'context' data from TransInfo data */
/* NOTE: sync this with the code in ANIM_animdata_get_context() */
ac.scene= t->scene;
ac.obact= OBACT;
@@ -389,7 +387,7 @@ static void recalcData_graphedit(TransInfo *t)
int dosort = 0;
- /* initialise relevant anim-context 'context' data from TransInfo data */
+ /* initialize relevant anim-context 'context' data from TransInfo data */
/* NOTE: sync this with the code in ANIM_animdata_get_context() */
scene= ac.scene= t->scene;
ac.obact= OBACT;
@@ -469,7 +467,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
@@ -500,7 +498,7 @@ static void recalcData_nla(TransInfo *t)
continue;
}
- /* firstly, check if the proposed transform locations would overlap with any neighbouring strips
+ /* firstly, check if the proposed transform locations would overlap with any neighboring strips
* (barring transitions) which are absolute barriers since they are not being moved
*
* this is done as a iterative procedure (done 5 times max for now)
@@ -512,7 +510,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;
@@ -629,7 +627,7 @@ static void recalcData_image(TransInfo *t)
SpaceImage *sima= t->sa->spacedata.first;
flushTransUVs(t);
- if(sima->flag & SI_LIVE_UNWRAP)
+ if (sima->flag & SI_LIVE_UNWRAP)
ED_uvedit_live_unwrap_re_solve();
DAG_id_tag_update(t->obedit->data, 0);
@@ -639,31 +637,31 @@ static void recalcData_image(TransInfo *t)
/* helper for recalcData() - for Movie Clip transforms */
static void recalcData_clip(TransInfo *t)
{
- SpaceClip *sc= t->sa->spacedata.first;
- MovieClip *clip= ED_space_clip(sc);
- ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking);
+ SpaceClip *sc = t->sa->spacedata.first;
+ MovieClip *clip = ED_space_clip(sc);
+ ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
MovieTrackingTrack *track;
flushTransTracking(t);
- track= tracksbase->first;
- while(track) {
- if(TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED)==0) {
+ track = tracksbase->first;
+ while (track) {
+ if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED)==0) {
if (t->mode == TFM_TRANSLATION) {
- if(TRACK_AREA_SELECTED(track, TRACK_AREA_PAT))
+ if (TRACK_AREA_SELECTED(track, TRACK_AREA_PAT))
BKE_tracking_clamp_track(track, CLAMP_PAT_POS);
- if(TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH))
+ if (TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH))
BKE_tracking_clamp_track(track, CLAMP_SEARCH_POS);
}
else if (t->mode == TFM_RESIZE) {
- if(TRACK_AREA_SELECTED(track, TRACK_AREA_PAT))
+ if (TRACK_AREA_SELECTED(track, TRACK_AREA_PAT))
BKE_tracking_clamp_track(track, CLAMP_PAT_DIM);
- if(TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH))
+ if (TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH))
BKE_tracking_clamp_track(track, CLAMP_SEARCH_DIM);
}
}
- track= track->next;
+ track = track->next;
}
DAG_id_tag_update(&clip->id, 0);
@@ -675,12 +673,12 @@ static void recalcData_view3d(TransInfo *t)
Base *base = t->scene->basact;
if (t->obedit) {
- if ELEM(t->obedit->type, OB_CURVE, OB_SURF) {
+ if (ELEM(t->obedit->type, OB_CURVE, OB_SURF)) {
Curve *cu= t->obedit->data;
ListBase *nurbs= curve_editnurbs(cu);
Nurb *nu= nurbs->first;
- if(t->state != TRANS_CANCEL) {
+ if (t->state != TRANS_CANCEL) {
clipMirrorModifier(t, t->obedit);
applyProject(t);
}
@@ -688,55 +686,55 @@ static void recalcData_view3d(TransInfo *t)
DAG_id_tag_update(t->obedit->data, 0); /* sets recalc flags */
if (t->state == TRANS_CANCEL) {
- while(nu) {
+ while (nu) {
calchandlesNurb(nu); /* Cant do testhandlesNurb here, it messes up the h1 and h2 flags */
nu= nu->next;
}
}
else {
/* Normal updating */
- while(nu) {
+ while (nu) {
test2DNurb(nu);
calchandlesNurb(nu);
nu= nu->next;
}
}
}
- else if(t->obedit->type==OB_LATTICE) {
+ else if (t->obedit->type==OB_LATTICE) {
Lattice *la= t->obedit->data;
- if(t->state != TRANS_CANCEL) {
+ if (t->state != TRANS_CANCEL) {
applyProject(t);
}
DAG_id_tag_update(t->obedit->data, 0); /* sets recalc flags */
- if(la->editlatt->latt->flag & LT_OUTSIDE) outside_lattice(la->editlatt->latt);
+ if (la->editlatt->latt->flag & LT_OUTSIDE) outside_lattice(la->editlatt->latt);
}
else if (t->obedit->type == OB_MESH) {
- BMEditMesh *em = ((Mesh*)t->obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(t->obedit);
/* mirror modifier clipping? */
- if(t->state != TRANS_CANCEL) {
+ if (t->state != TRANS_CANCEL) {
/* apply clipping after so we never project past the clip plane [#25423] */
applyProject(t);
clipMirrorModifier(t, t->obedit);
}
- if((t->options & CTX_NO_MIRROR) == 0 && (t->flag & T_MIRROR))
+ if ((t->options & CTX_NO_MIRROR) == 0 && (t->flag & T_MIRROR))
editbmesh_apply_to_mirror(t);
DAG_id_tag_update(t->obedit->data, 0); /* sets recalc flags */
- EDBM_RecalcNormals(em);
- BMEdit_RecalcTesselation(em);
+ EDBM_mesh_normals_update(em);
+ BMEdit_RecalcTessellation(em);
}
- else if(t->obedit->type==OB_ARMATURE) { /* no recalc flag, does pose */
+ else if (t->obedit->type==OB_ARMATURE) { /* no recalc flag, does pose */
bArmature *arm= t->obedit->data;
ListBase *edbo = arm->edbo;
EditBone *ebo;
TransData *td = t->data;
int i;
- if(t->state != TRANS_CANCEL) {
+ if (t->state != TRANS_CANCEL) {
applyProject(t);
}
@@ -747,27 +745,27 @@ static void recalcData_view3d(TransInfo *t)
/* If this bone has a parent tip that has been moved */
if (ebo->parent->flag & BONE_TIPSEL) {
copy_v3_v3 (ebo->head, ebo->parent->tail);
- if(t->mode==TFM_BONE_ENVELOPE) ebo->rad_head= ebo->parent->rad_tail;
+ if (t->mode==TFM_BONE_ENVELOPE) ebo->rad_head= ebo->parent->rad_tail;
}
/* If this bone has a parent tip that has NOT been moved */
- else{
+ else {
copy_v3_v3 (ebo->parent->tail, ebo->head);
- if(t->mode==TFM_BONE_ENVELOPE) ebo->parent->rad_tail= ebo->rad_head;
+ if (t->mode==TFM_BONE_ENVELOPE) ebo->parent->rad_tail= ebo->rad_head;
}
}
/* on extrude bones, oldlength==0.0f, so we scale radius of points */
ebo->length= len_v3v3(ebo->head, ebo->tail);
- if(ebo->oldlength==0.0f) {
+ if (ebo->oldlength==0.0f) {
ebo->rad_head= 0.25f*ebo->length;
ebo->rad_tail= 0.10f*ebo->length;
ebo->dist= 0.25f*ebo->length;
- if(ebo->parent) {
- if(ebo->rad_head > ebo->parent->rad_tail)
+ if (ebo->parent) {
+ if (ebo->rad_head > ebo->parent->rad_tail)
ebo->rad_head= ebo->parent->rad_tail;
}
}
- else if(t->mode!=TFM_BONE_ENVELOPE) {
+ else if (t->mode!=TFM_BONE_ENVELOPE) {
/* if bones change length, lets do that for the deform distance as well */
ebo->dist*= ebo->length/ebo->oldlength;
ebo->rad_head*= ebo->length/ebo->oldlength;
@@ -780,7 +778,7 @@ static void recalcData_view3d(TransInfo *t)
if (t->mode != TFM_BONE_ROLL)
{
/* fix roll */
- for(i = 0; i < t->total; i++, td++)
+ for (i = 0; i < t->total; i++, td++)
{
if (td->extra)
{
@@ -797,8 +795,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);
}
@@ -807,19 +804,18 @@ static void recalcData_view3d(TransInfo *t)
}
}
- if(arm->flag & ARM_MIRROR_EDIT)
+ if (arm->flag & ARM_MIRROR_EDIT)
transform_armature_mirror_update(t->obedit);
}
- else
- {
- if(t->state != TRANS_CANCEL) {
+ else {
+ if (t->state != TRANS_CANCEL) {
applyProject(t);
}
DAG_id_tag_update(t->obedit->data, 0); /* sets recalc flags */
}
}
- else if( (t->flag & T_POSE) && t->poseobj) {
+ else if ( (t->flag & T_POSE) && t->poseobj) {
Object *ob= t->poseobj;
bArmature *arm= ob->data;
@@ -844,8 +840,8 @@ static void recalcData_view3d(TransInfo *t)
else
where_is_pose(t->scene, ob);
}
- else if(base && (base->object->mode & OB_MODE_PARTICLE_EDIT) && PE_get_current(t->scene, base->object)) {
- if(t->state != TRANS_CANCEL) {
+ else if (base && (base->object->mode & OB_MODE_PARTICLE_EDIT) && PE_get_current(t->scene, base->object)) {
+ if (t->state != TRANS_CANCEL) {
applyProject(t);
}
flushTransParticles(t);
@@ -853,7 +849,7 @@ static void recalcData_view3d(TransInfo *t)
else {
int i;
- if(t->state != TRANS_CANCEL) {
+ if (t->state != TRANS_CANCEL) {
applyProject(t);
}
@@ -969,8 +965,8 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
/* moving: is shown in drawobject() (transform color) */
// TRANSFORM_FIX_ME
-// if(obedit || (t->flag & T_POSE) ) G.moving= G_TRANSFORM_EDIT;
-// else if(G.f & G_PARTICLEEDIT) G.moving= G_TRANSFORM_PARTICLE;
+// if (obedit || (t->flag & T_POSE) ) G.moving= G_TRANSFORM_EDIT;
+// else if (G.f & G_PARTICLEEDIT) G.moving= G_TRANSFORM_PARTICLE;
// else G.moving= G_TRANSFORM_OBJ;
t->scene = sce;
@@ -993,8 +989,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;
}
@@ -1034,7 +1029,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
/* Assign the space type, some exceptions for running in different mode */
- if(sa == NULL) {
+ if (sa == NULL) {
/* background mode */
t->spacetype= SPACE_EMPTY;
}
@@ -1048,7 +1043,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
}
- if(t->spacetype == SPACE_VIEW3D)
+ if (t->spacetype == SPACE_VIEW3D)
{
View3D *v3d = sa->spacedata.first;
@@ -1062,7 +1057,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
v3d->twtype = 0;
}
- if(v3d->flag & V3D_ALIGN) t->flag |= T_V3D_ALIGN;
+ if (v3d->flag & V3D_ALIGN) t->flag |= T_V3D_ALIGN;
t->around = v3d->around;
if (op && RNA_struct_find_property(op->ptr, "constraint_orientation") && RNA_struct_property_is_set(op->ptr, "constraint_orientation"))
@@ -1074,22 +1069,21 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
t->current_orientation = V3D_MANIP_GLOBAL;
}
}
- else
- {
+ else {
t->current_orientation = v3d->twmode;
}
/* exceptional case */
- if(t->around==V3D_LOCAL && (t->settings->selectmode & SCE_SELECT_FACE)) {
- if(ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL)) {
+ if (t->around==V3D_LOCAL && (t->settings->selectmode & SCE_SELECT_FACE)) {
+ if (ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL)) {
t->options |= CTX_NO_PET;
}
}
/* initialize UV transform from */
if (op && RNA_struct_find_property(op->ptr, "correct_uv")) {
- if(RNA_struct_property_is_set(op->ptr, "correct_uv")) {
- if(RNA_boolean_get(op->ptr, "correct_uv")) {
+ if (RNA_struct_property_is_set(op->ptr, "correct_uv")) {
+ if (RNA_boolean_get(op->ptr, "correct_uv")) {
t->settings->uvcalc_flag |= UVCALC_TRANSFORM_CORRECT;
}
else {
@@ -1102,28 +1096,24 @@ 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
- {
- if(ar) {
+ else {
+ if (ar) {
// XXX for now, get View2D from the active region
t->view = &ar->v2d;
// XXX for now, the center point is the midpoint of the data
@@ -1141,10 +1131,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 +1146,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 +1168,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 +1190,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 +1206,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;
}
}
@@ -1264,7 +1245,7 @@ void postTrans (bContext *C, TransInfo *t)
/* Can take over freeing t->data and data2d etc... */
t->customFree(t);
}
- else if (t->customData) {
+ else if ((t->customData != NULL) && (t->flag & T_FREE_CUSTOMDATA)) {
MEM_freeN(t->customData);
}
@@ -1273,7 +1254,7 @@ void postTrans (bContext *C, TransInfo *t)
int a;
/* free data malloced per trans-data */
- for(a=0, td= t->data; a<t->total; a++, td++) {
+ for (a=0, td= t->data; a<t->total; a++, td++) {
if (td->flag & TD_BEZTRIPLE)
MEM_freeN(td->hdata);
}
@@ -1288,12 +1269,12 @@ void postTrans (bContext *C, TransInfo *t)
t->data2d= NULL;
}
- if(t->spacetype==SPACE_IMAGE) {
+ if (t->spacetype==SPACE_IMAGE) {
SpaceImage *sima= t->sa->spacedata.first;
- if(sima->flag & SI_LIVE_UNWRAP)
+ if (sima->flag & SI_LIVE_UNWRAP)
ED_uvedit_live_unwrap_end(t->state == TRANS_CANCEL);
}
- else if(t->spacetype==SPACE_VIEW3D) {
+ else if (t->spacetype==SPACE_VIEW3D) {
View3D *v3d = t->sa->spacedata.first;
/* restore manipulator */
if (t->flag & T_MODAL) {
@@ -1337,10 +1318,10 @@ static void restoreElement(TransData *td)
if (td->ext->rot) {
copy_v3_v3(td->ext->rot, td->ext->irot);
}
- if(td->ext->rotAngle) {
+ if (td->ext->rotAngle) {
*td->ext->rotAngle= td->ext->irotAngle;
}
- if(td->ext->rotAxis) {
+ if (td->ext->rotAxis) {
copy_v3_v3(td->ext->rotAxis, td->ext->irotAxis);
}
/* XXX, drotAngle & drotAxis not used yet */
@@ -1424,7 +1405,7 @@ void calculateCenterCursor2D(TransInfo *t)
float aspx=1.0, aspy=1.0;
float *cursor= NULL;
- if(t->spacetype==SPACE_IMAGE) {
+ if (t->spacetype==SPACE_IMAGE) {
SpaceImage *sima= (SpaceImage *)t->sa->spacedata.first;
/* only space supported right now but may change */
ED_space_image_uv_aspect(sima, &aspx, &aspy);
@@ -1457,7 +1438,7 @@ void calculateCenterMedian(TransInfo *t)
int total = 0;
int i;
- for(i = 0; i < t->total; i++) {
+ for (i = 0; i < t->total; i++) {
if (t->data[i].flag & TD_SELECTED) {
if (!(t->data[i].flag & TD_NOCENTER))
{
@@ -1467,13 +1448,13 @@ 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;
}
}
- if(i)
+ if (i)
mul_v3_fl(partial, 1.0f / total);
copy_v3_v3(t->center, partial);
@@ -1485,7 +1466,7 @@ void calculateCenterBound(TransInfo *t)
float max[3];
float min[3];
int i;
- for(i = 0; i < t->total; i++) {
+ for (i = 0; i < t->total; i++) {
if (i) {
if (t->data[i].flag & TD_SELECTED) {
if (!(t->data[i].flag & TD_NOCENTER))
@@ -1493,9 +1474,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;
}
}
@@ -1520,9 +1501,9 @@ void calculateCenter(TransInfo *t)
calculateCenterMedian(t);
break;
case V3D_CURSOR:
- if(t->spacetype==SPACE_IMAGE)
+ if (t->spacetype==SPACE_IMAGE)
calculateCenterCursor2D(t);
- else if(t->spacetype==SPACE_IPO)
+ else if (t->spacetype==SPACE_IPO)
calculateCenterCursorGraph2D(t);
else
calculateCenterCursor(t);
@@ -1540,9 +1521,9 @@ void calculateCenter(TransInfo *t)
if (t->obedit) {
if (t->obedit && t->obedit->type == OB_MESH) {
BMEditSelection ese;
- BMEditMesh *em = ((Mesh*)t->obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(t->obedit);
- if (EDBM_get_actSelection(em, &ese)) {
+ if (EDBM_editselection_active_get(em, &ese)) {
EDBM_editselection_center(em, t->center, &ese);
calculateCenter2D(t);
break;
@@ -1561,12 +1542,11 @@ void calculateCenter(TransInfo *t)
} /* END EDIT MODE ACTIVE ELEMENT */
calculateCenterMedian(t);
- if((t->flag & (T_EDIT|T_POSE))==0)
+ if ((t->flag & (T_EDIT|T_POSE))==0)
{
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 +1557,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]);
@@ -1607,7 +1583,7 @@ void calculateCenter(TransInfo *t)
projectIntView(t, axis, t->center2d);
/* rotate only needs correct 2d center, grab needs initgrabz() value */
- if(t->mode==TFM_TRANSLATION)
+ if (t->mode==TFM_TRANSLATION)
{
copy_v3_v3(t->center, axis);
copy_v3_v3(t->con.center, t->center);
@@ -1616,10 +1592,9 @@ 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)) {
+ if (t->flag & (T_EDIT|T_POSE)) {
Object *ob= t->obedit?t->obedit:t->poseobj;
float vec[3];
@@ -1641,12 +1616,11 @@ void calculatePropRatio(TransInfo *t)
short connected = t->flag & T_PROP_CONNECTED;
if (t->flag & T_PROP_EDIT) {
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
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 +1631,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);
@@ -1736,7 +1710,7 @@ void calculatePropRatio(TransInfo *t)
}
}
else {
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
td->factor = 1.0;
}
t->proptext[0]= '\0';
diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c
index a4f03e76fd1..bd3fb20f77f 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;
}
@@ -243,15 +236,14 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2],
float dphi;
dphi = saacos((float)deler);
- if( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi;
+ if ( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi;
/* If the angle is zero, because of lack of precision close to the 1.0 value in acos
* 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;
@@ -264,14 +256,15 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2],
dy = dy1 - dy2;
dphi = sqrt(dx*dx + dy*dy);
- if( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi;
+ 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];
}
@@ -314,7 +307,7 @@ void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode)
/* TODO, holding R-key can cause mem leak, but this causes [#28903]
* disable for now. */
#if 0
- if(mi->data) {
+ if (mi->data) {
MEM_freeN(mi->data);
mi->data= NULL;
}
@@ -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 bd687ddfe40..c6b8403d54f 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -52,6 +52,9 @@
#include "DNA_scene_types.h"
#include "DNA_view3d_types.h"
+#include "BLI_math.h"
+#include "BLI_utildefines.h"
+
#include "RNA_access.h"
#include "BKE_action.h"
@@ -63,9 +66,6 @@
#include "BKE_pointcache.h"
#include "BKE_tessmesh.h"
-#include "BLI_math.h"
-#include "BLI_utildefines.h"
-
#include "BIF_gl.h"
#include "WM_api.h"
@@ -120,25 +120,25 @@ static void calc_tw_center(Scene *scene, float *co)
static void protectflag_to_drawflags(short protectflag, short *drawflags)
{
- if(protectflag & OB_LOCK_LOCX)
+ if (protectflag & OB_LOCK_LOCX)
*drawflags &= ~MAN_TRANS_X;
- if(protectflag & OB_LOCK_LOCY)
+ if (protectflag & OB_LOCK_LOCY)
*drawflags &= ~MAN_TRANS_Y;
- if(protectflag & OB_LOCK_LOCZ)
+ if (protectflag & OB_LOCK_LOCZ)
*drawflags &= ~MAN_TRANS_Z;
- if(protectflag & OB_LOCK_ROTX)
+ if (protectflag & OB_LOCK_ROTX)
*drawflags &= ~MAN_ROT_X;
- if(protectflag & OB_LOCK_ROTY)
+ if (protectflag & OB_LOCK_ROTY)
*drawflags &= ~MAN_ROT_Y;
- if(protectflag & OB_LOCK_ROTZ)
+ if (protectflag & OB_LOCK_ROTZ)
*drawflags &= ~MAN_ROT_Z;
- if(protectflag & OB_LOCK_SCALEX)
+ if (protectflag & OB_LOCK_SCALEX)
*drawflags &= ~MAN_SCALE_X;
- if(protectflag & OB_LOCK_SCALEY)
+ if (protectflag & OB_LOCK_SCALEY)
*drawflags &= ~MAN_SCALE_Y;
- if(protectflag & OB_LOCK_SCALEZ)
+ if (protectflag & OB_LOCK_SCALEZ)
*drawflags &= ~MAN_SCALE_Z;
}
@@ -147,7 +147,7 @@ static void stats_pose(Scene *scene, RegionView3D *rv3d, bPoseChannel *pchan)
{
Bone *bone= pchan->bone;
- if(bone) {
+ if (bone) {
if (bone->flag & BONE_TRANSFORM) {
calc_tw_center(scene, pchan->pose_head);
protectflag_to_drawflags(pchan->protectflag, &rv3d->twdrawflag);
@@ -202,13 +202,12 @@ 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) {
+ if (pchan) {
float mat[3][3], tmat[3][3], obmat[3][3];
- if(test_rotmode_euler(pchan->rotmode)) {
+ if (test_rotmode_euler(pchan->rotmode)) {
eulO_to_gimbal_axis(mat, pchan->eul, pchan->rotmode);
}
else if (pchan->rotmode == ROT_MODE_AXISANGLE) {
@@ -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);
@@ -245,18 +242,17 @@ int gimbal_axis(Object *ob, float gmat[][3])
}
}
else {
- if(test_rotmode_euler(ob->rotmode)) {
+ if (test_rotmode_euler(ob->rotmode)) {
eulO_to_gimbal_axis(gmat, ob->rot, ob->rotmode);
}
- else if(ob->rotmode == ROT_MODE_AXISANGLE) {
+ else if (ob->rotmode == ROT_MODE_AXISANGLE) {
axis_angle_to_gimbal_axis(gmat, ob->rotAxis, ob->rotAngle);
}
else { /* quat */
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);
@@ -291,20 +287,20 @@ int calc_manipulator_stats(const bContext *C)
rv3d->twdrawflag= 0xFFFF;
/* transform widget centroid/center */
- scene->twcent[0]= scene->twcent[1]= scene->twcent[2]= 0.0f;
INIT_MINMAX(scene->twmin, scene->twmax);
+ zero_v3(scene->twcent);
- if(obedit) {
+ if (obedit) {
ob= obedit;
- if((ob->lay & v3d->lay)==0) return 0;
+ if ((ob->lay & v3d->lay)==0) return 0;
- if(obedit->type==OB_MESH) {
- BMEditMesh *em = ((Mesh*)obedit->data)->edit_btmesh;
+ if (obedit->type==OB_MESH) {
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMEditSelection ese;
float vec[3]= {0,0,0};
/* USE LAST SELECTE WITH ACTIVE */
- if (v3d->around==V3D_ACTIVE && EDBM_get_actSelection(em, &ese)) {
+ if (v3d->around==V3D_ACTIVE && EDBM_editselection_active_get(em, &ese)) {
EDBM_editselection_center(em, vec, &ese);
calc_tw_center(scene, vec);
totsel= 1;
@@ -316,26 +312,26 @@ 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 */
- if(ts->selectmode & SCE_SELECT_VERTEX) {
+ * 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)) {
- if(BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
+ if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
+ if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
totsel++;
calc_tw_center(scene, eve->co);
}
}
}
}
- else if(ts->selectmode & SCE_SELECT_EDGE) {
+ else if (ts->selectmode & SCE_SELECT_EDGE) {
BMIter itersub;
BMEdge *eed;
BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
- if(!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
+ if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
/* check the vertex has a selected edge, only add it once */
BM_ITER(eed, &itersub, bm, BM_EDGES_OF_VERT, eve) {
- if(BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
+ if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
totsel++;
calc_tw_center(scene, eve->co);
break;
@@ -348,10 +344,10 @@ int calc_manipulator_stats(const bContext *C)
BMIter itersub;
BMFace *efa;
BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
- if(!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
+ if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
/* check the vertex has a selected face, only add it once */
BM_ITER(efa, &itersub, bm, BM_FACES_OF_VERT, eve) {
- if(BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
+ if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
totsel++;
calc_tw_center(scene, eve->co);
break;
@@ -366,7 +362,7 @@ int calc_manipulator_stats(const bContext *C)
bArmature *arm= obedit->data;
EditBone *ebo;
for (ebo= arm->edbo->first; ebo; ebo=ebo->next) {
- if(EBONE_VISIBLE(arm, ebo)) {
+ if (EBONE_VISIBLE(arm, ebo)) {
if (ebo->flag & BONE_TIPSEL) {
calc_tw_center(scene, ebo->tail);
totsel++;
@@ -381,7 +377,7 @@ int calc_manipulator_stats(const bContext *C)
}
}
}
- else if ELEM(obedit->type, OB_CURVE, OB_SURF) {
+ else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
Curve *cu= obedit->data;
float center[3];
@@ -396,11 +392,11 @@ int calc_manipulator_stats(const bContext *C)
ListBase *nurbs= curve_editnurbs(cu);
nu= nurbs->first;
- while(nu) {
- if(nu->type == CU_BEZIER) {
+ while (nu) {
+ if (nu->type == CU_BEZIER) {
bezt= nu->bezt;
a= nu->pntsu;
- while(a--) {
+ while (a--) {
/* exceptions
* if handles are hidden then only check the center points.
* If the center knot is selected then only use this as the center point.
@@ -416,11 +412,11 @@ int calc_manipulator_stats(const bContext *C)
totsel++;
}
else {
- if(bezt->f1) {
+ if (bezt->f1) {
calc_tw_center(scene, bezt->vec[0]);
totsel++;
}
- if(bezt->f3) {
+ if (bezt->f3) {
calc_tw_center(scene, bezt->vec[2]);
totsel++;
}
@@ -431,8 +427,8 @@ int calc_manipulator_stats(const bContext *C)
else {
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->f1 & SELECT) {
+ while (a--) {
+ if (bp->f1 & SELECT) {
calc_tw_center(scene, bp->vec);
totsel++;
}
@@ -443,13 +439,13 @@ int calc_manipulator_stats(const bContext *C)
}
}
}
- else if(obedit->type==OB_MBALL) {
+ else if (obedit->type==OB_MBALL) {
MetaBall *mb = (MetaBall*)obedit->data;
MetaElem *ml /* , *ml_sel=NULL */ /* UNUSED */;
ml= mb->editelems->first;
- while(ml) {
- if(ml->flag & SELECT) {
+ while (ml) {
+ if (ml->flag & SELECT) {
calc_tw_center(scene, &ml->x);
/* ml_sel = ml; */ /* UNUSED */
totsel++;
@@ -457,15 +453,15 @@ int calc_manipulator_stats(const bContext *C)
ml= ml->next;
}
}
- else if(obedit->type==OB_LATTICE) {
+ else if (obedit->type==OB_LATTICE) {
BPoint *bp;
Lattice *lt= obedit->data;
bp= lt->editlatt->latt->def;
a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
- while(a--) {
- if(bp->f1 & SELECT) {
+ while (a--) {
+ if (bp->f1 & SELECT) {
calc_tw_center(scene, bp->vec);
totsel++;
}
@@ -474,24 +470,24 @@ int calc_manipulator_stats(const bContext *C)
}
/* selection center */
- if(totsel) {
+ if (totsel) {
mul_v3_fl(scene->twcent, 1.0f/(float)totsel); // centroid!
mul_m4_v3(obedit->obmat, scene->twcent);
mul_m4_v3(obedit->obmat, scene->twmin);
mul_m4_v3(obedit->obmat, scene->twmax);
}
}
- else if(ob && (ob->mode & OB_MODE_POSE)) {
+ else if (ob && (ob->mode & OB_MODE_POSE)) {
bPoseChannel *pchan;
int mode = TFM_ROTATION; // mislead counting bones... bah. We don't know the manipulator mode, could be mixed
- if((ob->lay & v3d->lay)==0) return 0;
+ if ((ob->lay & v3d->lay)==0) return 0;
totsel = count_set_pose_transflags(&mode, 0, ob);
- if(totsel) {
+ if (totsel) {
/* use channels to get stats */
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
stats_pose(scene, rv3d, pchan);
}
@@ -501,22 +497,22 @@ int calc_manipulator_stats(const bContext *C)
mul_m4_v3(ob->obmat, scene->twmax);
}
}
- else if(ob && (ob->mode & OB_MODE_ALL_PAINT)) {
+ else if (ob && (ob->mode & OB_MODE_ALL_PAINT)) {
;
}
- else if(ob && ob->mode & OB_MODE_PARTICLE_EDIT) {
+ else if (ob && ob->mode & OB_MODE_PARTICLE_EDIT) {
PTCacheEdit *edit= PE_get_current(scene, ob);
PTCacheEditPoint *point;
PTCacheEditKey *ek;
int k;
- if(edit) {
+ if (edit) {
point = edit->points;
- for(a=0; a<edit->totpoint; a++,point++) {
- if(point->flag & PEP_HIDE) continue;
+ for (a=0; a<edit->totpoint; a++,point++) {
+ if (point->flag & PEP_HIDE) continue;
- for(k=0, ek=point->keys; k<point->totkey; k++, ek++) {
- if(ek->flag & PEK_SELECT) {
+ for (k=0, ek=point->keys; k<point->totkey; k++, ek++) {
+ if (ek->flag & PEK_SELECT) {
calc_tw_center(scene, ek->flag & PEK_USE_WCO ? ek->world_co : ek->co);
totsel++;
}
@@ -524,7 +520,7 @@ int calc_manipulator_stats(const bContext *C)
}
/* selection center */
- if(totsel)
+ if (totsel)
mul_v3_fl(scene->twcent, 1.0f/(float)totsel); // centroid!
}
}
@@ -532,11 +528,11 @@ int calc_manipulator_stats(const bContext *C)
/* we need the one selected object, if its not active */
ob= OBACT;
- if(ob && !(ob->flag & SELECT)) ob= NULL;
+ if (ob && !(ob->flag & SELECT)) ob= NULL;
- for(base= scene->base.first; base; base= base->next) {
- if TESTBASELIB(v3d, base) {
- if(ob==NULL)
+ for (base= scene->base.first; base; base= base->next) {
+ if (TESTBASELIB(v3d, base)) {
+ if (ob==NULL)
ob= base->object;
calc_tw_center(scene, base->object->obmat[3]);
protectflag_to_drawflags(base->object->protectflag, &rv3d->twdrawflag);
@@ -545,13 +541,13 @@ int calc_manipulator_stats(const bContext *C)
}
/* selection center */
- if(totsel) {
+ if (totsel) {
mul_v3_fl(scene->twcent, 1.0f/(float)totsel); // centroid!
}
}
/* global, local or normal orientation? */
- if(ob && totsel) {
+ if (ob && totsel) {
switch(v3d->twmode) {
@@ -568,7 +564,7 @@ int calc_manipulator_stats(const bContext *C)
/* if not gimbal, fall through to normal */
}
case V3D_MANIP_NORMAL:
- if(obedit || ob->mode & OB_MODE_POSE) {
+ if (obedit || ob->mode & OB_MODE_POSE) {
float mat[3][3];
ED_getTransformOrientationMatrix(C, mat, (v3d->around == V3D_ACTIVE));
copy_m4_m3(rv3d->twmat, mat);
@@ -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;
@@ -668,7 +664,7 @@ static void partial_donut(float radring, float radhole, int start, int end, int
float ring_delta, side_delta;
int i, j, docaps= 1;
- if(start==0 && end==nrings) docaps= 0;
+ if (start==0 && end==nrings) docaps= 0;
ring_delta= 2.0f*(float)M_PI/(float)nrings;
side_delta= 2.0f*(float)M_PI/(float)nsides;
@@ -677,15 +673,15 @@ static void partial_donut(float radring, float radhole, int start, int end, int
cos_theta= (float)cos(theta);
sin_theta= (float)sin(theta);
- for(i= nrings - 1; i >= 0; i--) {
+ for (i= nrings - 1; i >= 0; i--) {
theta1= theta + ring_delta;
cos_theta1= (float)cos(theta1);
sin_theta1= (float)sin(theta1);
- if(docaps && i==start) { // cap
+ if (docaps && i==start) { // cap
glBegin(GL_POLYGON);
phi= 0.0;
- for(j= nsides; j >= 0; j--) {
+ for (j= nsides; j >= 0; j--) {
float cos_phi, sin_phi, dist;
phi += side_delta;
@@ -697,10 +693,10 @@ static void partial_donut(float radring, float radhole, int start, int end, int
}
glEnd();
}
- if(i>=start && i<=end) {
+ if (i>=start && i<=end) {
glBegin(GL_QUAD_STRIP);
phi= 0.0;
- for(j= nsides; j >= 0; j--) {
+ for (j= nsides; j >= 0; j--) {
float cos_phi, sin_phi, dist;
phi += side_delta;
@@ -714,10 +710,10 @@ static void partial_donut(float radring, float radhole, int start, int end, int
glEnd();
}
- if(docaps && i==end) { // cap
+ if (docaps && i==end) { // cap
glBegin(GL_POLYGON);
phi= 0.0;
- for(j= nsides; j >= 0; j--) {
+ for (j= nsides; j >= 0; j--) {
float cos_phi, sin_phi, dist;
phi -= side_delta;
@@ -749,31 +745,31 @@ 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};
col[3]= alpha;
- if(colcode==MAN_GHOST) {
+ if (colcode==MAN_GHOST) {
col[3]= 70;
}
- else if(colcode==MAN_MOVECOL) {
+ else if (colcode==MAN_MOVECOL) {
UI_GetThemeColor3ubv(TH_TRANSFORM, col);
}
else {
switch(axis) {
case 'C':
UI_GetThemeColor3ubv(TH_TRANSFORM, col);
- if(v3d->twmode == V3D_MANIP_LOCAL) {
+ if (v3d->twmode == V3D_MANIP_LOCAL) {
col[0]= col[0]>200?255:col[0]+55;
col[1]= col[1]>200?255:col[1]+55;
col[2]= col[2]>200?255:col[2]+55;
}
- else if(v3d->twmode == V3D_MANIP_NORMAL) {
+ else if (v3d->twmode == V3D_MANIP_NORMAL) {
col[0]= col[0]<55?0:col[0]-55;
col[1]= col[1]<55?0:col[1]-55;
col[2]= col[2]<55?0:col[2]-55;
@@ -803,27 +799,27 @@ static void draw_manipulator_axes(View3D *v3d, RegionView3D *rv3d, int colcode,
{
/* axes */
- if(flagx) {
+ if (flagx) {
manipulator_setcolor(v3d, 'X', colcode, axisBlendAngle(rv3d->twangle[0]));
- if(flagx & MAN_SCALE_X) glLoadName(MAN_SCALE_X);
- else if(flagx & MAN_TRANS_X) glLoadName(MAN_TRANS_X);
+ if (flagx & MAN_SCALE_X) glLoadName(MAN_SCALE_X);
+ else if (flagx & MAN_TRANS_X) glLoadName(MAN_TRANS_X);
glBegin(GL_LINES);
glVertex3f(0.2f, 0.0f, 0.0f);
glVertex3f(1.0f, 0.0f, 0.0f);
glEnd();
}
- if(flagy) {
- if(flagy & MAN_SCALE_Y) glLoadName(MAN_SCALE_Y);
- else if(flagy & MAN_TRANS_Y) glLoadName(MAN_TRANS_Y);
+ if (flagy) {
+ if (flagy & MAN_SCALE_Y) glLoadName(MAN_SCALE_Y);
+ else if (flagy & MAN_TRANS_Y) glLoadName(MAN_TRANS_Y);
manipulator_setcolor(v3d, 'Y', colcode, axisBlendAngle(rv3d->twangle[1]));
glBegin(GL_LINES);
glVertex3f(0.0f, 0.2f, 0.0f);
glVertex3f(0.0f, 1.0f, 0.0f);
glEnd();
}
- if(flagz) {
- if(flagz & MAN_SCALE_Z) glLoadName(MAN_SCALE_Z);
- else if(flagz & MAN_TRANS_Z) glLoadName(MAN_TRANS_Z);
+ if (flagz) {
+ if (flagz & MAN_SCALE_Z) glLoadName(MAN_SCALE_Z);
+ else if (flagz & MAN_TRANS_Z) glLoadName(MAN_TRANS_Z);
manipulator_setcolor(v3d, 'Z', colcode, axisBlendAngle(rv3d->twangle[2]));
glBegin(GL_LINES);
glVertex3f(0.0f, 0.0f, 0.2f);
@@ -863,11 +859,11 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
int colcode;
int ortho;
- if(moving) colcode= MAN_MOVECOL;
+ if (moving) colcode= MAN_MOVECOL;
else colcode= MAN_RGB;
/* when called while moving in mixed mode, do not draw when... */
- if((drawflags & MAN_ROT_C)==0) return;
+ if ((drawflags & MAN_ROT_C)==0) return;
/* Init stuff */
glDisable(GL_DEPTH_TEST);
@@ -881,9 +877,9 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
glPushMatrix();
glTranslatef(rv3d->twmat[3][0], rv3d->twmat[3][1], rv3d->twmat[3][2]);
- if(arcs) {
+ 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);
}
@@ -891,28 +887,28 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
glRotatef( -360.0f*saacos(rv3d->viewquat[0])/(float)M_PI, rv3d->viewquat[1], rv3d->viewquat[2], rv3d->viewquat[3]);
/* Screen aligned help circle */
- if(arcs) {
- if((G.f & G_PICKSEL)==0) {
+ if (arcs) {
+ if ((G.f & G_PICKSEL)==0) {
UI_ThemeColorShade(TH_BACK, -30);
drawcircball(GL_LINE_LOOP, unitmat[3], size, unitmat);
}
}
/* Screen aligned trackball rot circle */
- if(drawflags & MAN_ROT_T) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_T);
+ if (drawflags & MAN_ROT_T) {
+ if (G.f & G_PICKSEL) glLoadName(MAN_ROT_T);
UI_ThemeColor(TH_TRANSFORM);
drawcircball(GL_LINE_LOOP, unitmat[3], 0.2f*size, unitmat);
}
/* Screen aligned view rot circle */
- if(drawflags & MAN_ROT_V) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_V);
+ if (drawflags & MAN_ROT_V) {
+ if (G.f & G_PICKSEL) glLoadName(MAN_ROT_V);
UI_ThemeColor(TH_TRANSFORM);
drawcircball(GL_LINE_LOOP, unitmat[3], 1.2f*size, unitmat);
- if(moving) {
+ if (moving) {
float vec[3];
vec[0]= 0; // XXX (float)(t->imval[0] - t->center2d[0]);
vec[1]= 0; // XXX (float)(t->imval[1] - t->center2d[1]);
@@ -931,7 +927,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
ortho = is_orthogonal_m4(rv3d->twmat);
/* apply the transform delta */
- if(moving) {
+ if (moving) {
copy_m4_m4(matt, rv3d->twmat); // to copy the parts outside of [3][3]
// XXX mul_m4_m3m4(matt, t->mat, rv3d->twmat);
if (ortho) {
@@ -947,11 +943,11 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
}
/* axes */
- if(arcs==0) {
- if(!(G.f & G_PICKSEL)) {
- if( (combo & V3D_MANIP_SCALE)==0) {
+ if (arcs==0) {
+ if (!(G.f & G_PICKSEL)) {
+ if ( (combo & V3D_MANIP_SCALE)==0) {
/* axis */
- if( (drawflags & MAN_ROT_X) || (moving && (drawflags & MAN_ROT_Z)) ) {
+ if ( (drawflags & MAN_ROT_X) || (moving && (drawflags & MAN_ROT_Z)) ) {
preOrthoFront(ortho, rv3d->twmat, 2);
manipulator_setcolor(v3d, 'X', colcode, 255);
glBegin(GL_LINES);
@@ -960,7 +956,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
glEnd();
postOrtho(ortho);
}
- if( (drawflags & MAN_ROT_Y) || (moving && (drawflags & MAN_ROT_X)) ) {
+ if ( (drawflags & MAN_ROT_Y) || (moving && (drawflags & MAN_ROT_X)) ) {
preOrthoFront(ortho, rv3d->twmat, 0);
manipulator_setcolor(v3d, 'Y', colcode, 255);
glBegin(GL_LINES);
@@ -969,7 +965,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
glEnd();
postOrtho(ortho);
}
- if( (drawflags & MAN_ROT_Z) || (moving && (drawflags & MAN_ROT_Y)) ) {
+ if ( (drawflags & MAN_ROT_Z) || (moving && (drawflags & MAN_ROT_Y)) ) {
preOrthoFront(ortho, rv3d->twmat, 1);
manipulator_setcolor(v3d, 'Z', colcode, 255);
glBegin(GL_LINES);
@@ -982,20 +978,20 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
}
}
- if(arcs==0 && moving) {
+ if (arcs==0 && moving) {
/* Z circle */
- if(drawflags & MAN_ROT_Z) {
+ if (drawflags & MAN_ROT_Z) {
preOrthoFront(ortho, matt, 2);
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
+ if (G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
manipulator_setcolor(v3d, 'Z', colcode, 255);
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
postOrtho(ortho);
}
/* X circle */
- if(drawflags & MAN_ROT_X) {
+ if (drawflags & MAN_ROT_X) {
preOrthoFront(ortho, matt, 0);
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
+ if (G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
glRotatef(90.0, 0.0, 1.0, 0.0);
manipulator_setcolor(v3d, 'X', colcode, 255);
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
@@ -1003,9 +999,9 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
postOrtho(ortho);
}
/* Y circle */
- if(drawflags & MAN_ROT_Y) {
+ if (drawflags & MAN_ROT_Y) {
preOrthoFront(ortho, matt, 1);
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
+ if (G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
glRotatef(-90.0, 1.0, 0.0, 0.0);
manipulator_setcolor(v3d, 'Y', colcode, 255);
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
@@ -1013,37 +1009,37 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
postOrtho(ortho);
}
- if(arcs) glDisable(GL_CLIP_PLANE0);
+ if (arcs) glDisable(GL_CLIP_PLANE0);
}
// donut arcs
- if(arcs) {
+ if (arcs) {
glEnable(GL_CLIP_PLANE0);
/* Z circle */
- if(drawflags & MAN_ROT_Z) {
+ if (drawflags & MAN_ROT_Z) {
preOrthoFront(ortho, rv3d->twmat, 2);
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
+ 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 */
- if(drawflags & MAN_ROT_X) {
+ if (drawflags & MAN_ROT_X) {
preOrthoFront(ortho, rv3d->twmat, 0);
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
+ 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);
}
/* Y circle */
- if(drawflags & MAN_ROT_Y) {
+ if (drawflags & MAN_ROT_Y) {
preOrthoFront(ortho, rv3d->twmat, 1);
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
+ 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);
}
@@ -1051,46 +1047,46 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
glDisable(GL_CLIP_PLANE0);
}
- if(arcs==0) {
+ if (arcs==0) {
/* Z handle on X axis */
- if(drawflags & MAN_ROT_Z) {
+ if (drawflags & MAN_ROT_Z) {
preOrthoFront(ortho, rv3d->twmat, 2);
glPushMatrix();
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
+ 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);
}
/* Y handle on X axis */
- if(drawflags & MAN_ROT_Y) {
+ if (drawflags & MAN_ROT_Y) {
preOrthoFront(ortho, rv3d->twmat, 1);
glPushMatrix();
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
+ if (G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
manipulator_setcolor(v3d, 'Y', colcode, 255);
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);
}
/* X handle on Z axis */
- if(drawflags & MAN_ROT_X) {
+ if (drawflags & MAN_ROT_X) {
preOrthoFront(ortho, rv3d->twmat, 0);
glPushMatrix();
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
+ if (G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
manipulator_setcolor(v3d, 'X', colcode, 255);
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);
@@ -1101,27 +1097,26 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
/* restore */
glLoadMatrixf(rv3d->viewmat);
gluDeleteQuadric(qobj);
- if(v3d->zbuf) glEnable(GL_DEPTH_TEST);
+ if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
}
static void drawsolidcube(float size)
{
static float cube[8][3] = {
- {-1.0, -1.0, -1.0},
- {-1.0, -1.0, 1.0},
- {-1.0, 1.0, 1.0},
- {-1.0, 1.0, -1.0},
- { 1.0, -1.0, -1.0},
- { 1.0, -1.0, 1.0},
- { 1.0, 1.0, 1.0},
- { 1.0, 1.0, -1.0}, };
- float n[3];
+ {-1.0, -1.0, -1.0},
+ {-1.0, -1.0, 1.0},
+ {-1.0, 1.0, 1.0},
+ {-1.0, 1.0, -1.0},
+ { 1.0, -1.0, -1.0},
+ { 1.0, -1.0, 1.0},
+ { 1.0, 1.0, 1.0},
+ { 1.0, 1.0, -1.0}, };
+ float n[3] = {0.0f};
glPushMatrix();
glScalef(size, size, size);
- n[0]=0; n[1]=0; n[2]=0;
glBegin(GL_QUADS);
n[0]= -1.0;
glNormal3fv(n);
@@ -1173,17 +1168,17 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving,
float cusize= cywid*0.75f, dz;
/* when called while moving in mixed mode, do not draw when... */
- if((drawflags & MAN_SCALE_C)==0) return;
+ if ((drawflags & MAN_SCALE_C)==0) return;
glDisable(GL_DEPTH_TEST);
/* not in combo mode */
- if( (combo & (V3D_MANIP_TRANSLATE|V3D_MANIP_ROTATE))==0) {
+ if ( (combo & (V3D_MANIP_TRANSLATE|V3D_MANIP_ROTATE))==0) {
float size, unitmat[4][4];
int shift= 0; // XXX
/* center circle, do not add to selection when shift is pressed (planar constraint) */
- if( (G.f & G_PICKSEL) && shift==0) glLoadName(MAN_SCALE_C);
+ if ( (G.f & G_PICKSEL) && shift==0) glLoadName(MAN_SCALE_C);
manipulator_setcolor(v3d, 'C', colcode, 255);
glPushMatrix();
@@ -1196,7 +1191,7 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving,
}
else dz= 1.0f-4.0f*cusize;
- if(moving) {
+ if (moving) {
float matt[4][4];
copy_m4_m4(matt, rv3d->twmat); // to copy the parts outside of [3][3]
@@ -1216,31 +1211,31 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving,
/* Z cube */
glTranslatef(0.0, 0.0, dz);
- if(drawflags & MAN_SCALE_Z) {
- if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_Z);
+ if (drawflags & MAN_SCALE_Z) {
+ if (G.f & G_PICKSEL) glLoadName(MAN_SCALE_Z);
manipulator_setcolor(v3d, 'Z', colcode, axisBlendAngle(rv3d->twangle[2]));
drawsolidcube(cusize);
}
/* X cube */
glTranslatef(dz, 0.0, -dz);
- if(drawflags & MAN_SCALE_X) {
- if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_X);
+ if (drawflags & MAN_SCALE_X) {
+ if (G.f & G_PICKSEL) glLoadName(MAN_SCALE_X);
manipulator_setcolor(v3d, 'X', colcode, axisBlendAngle(rv3d->twangle[0]));
drawsolidcube(cusize);
}
/* Y cube */
glTranslatef(-dz, dz, 0.0);
- if(drawflags & MAN_SCALE_Y) {
- if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_Y);
+ if (drawflags & MAN_SCALE_Y) {
+ if (G.f & G_PICKSEL) glLoadName(MAN_SCALE_Y);
manipulator_setcolor(v3d, 'Y', colcode, axisBlendAngle(rv3d->twangle[1]));
drawsolidcube(cusize);
}
/* if shiftkey, center point as last, for selectbuffer order */
- if(G.f & G_PICKSEL) {
+ if (G.f & G_PICKSEL) {
int shift= 0; // XXX
- if(shift) {
+ if (shift) {
glTranslatef(0.0, -dz, 0.0);
glLoadName(MAN_SCALE_C);
glBegin(GL_POINTS);
@@ -1252,7 +1247,7 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving,
/* restore */
glLoadMatrixf(rv3d->viewmat);
- if(v3d->zbuf) glEnable(GL_DEPTH_TEST);
+ if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
glFrontFace(GL_CCW);
}
@@ -1292,16 +1287,16 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int UNUS
int shift= 0; // XXX
/* when called while moving in mixed mode, do not draw when... */
- if((drawflags & MAN_TRANS_C)==0) return;
+ if ((drawflags & MAN_TRANS_C)==0) return;
- // XXX if(moving) glTranslatef(t->vec[0], t->vec[1], t->vec[2]);
+ // XXX if (moving) glTranslatef(t->vec[0], t->vec[1], t->vec[2]);
glDisable(GL_DEPTH_TEST);
qobj= gluNewQuadric();
gluQuadricDrawStyle(qobj, GLU_FILL);
/* center circle, do not add to selection when shift is pressed (planar constraint) */
- if( (G.f & G_PICKSEL) && shift==0) glLoadName(MAN_TRANS_C);
+ if ( (G.f & G_PICKSEL) && shift==0) glLoadName(MAN_TRANS_C);
manipulator_setcolor(v3d, 'C', colcode, 255);
glPushMatrix();
@@ -1317,26 +1312,26 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int UNUS
glLoadName(-1);
// translate drawn as last, only axis when no combo with scale, or for ghosting
- if((combo & V3D_MANIP_SCALE)==0 || colcode==MAN_GHOST)
+ if ((combo & V3D_MANIP_SCALE)==0 || colcode==MAN_GHOST)
draw_manipulator_axes(v3d, rv3d, colcode, drawflags & MAN_TRANS_X, drawflags & MAN_TRANS_Y, drawflags & MAN_TRANS_Z);
/* offset in combo mode, for rotate a bit more */
- if(combo & (V3D_MANIP_ROTATE)) dz= 1.0f+2.0f*cylen;
- else if(combo & (V3D_MANIP_SCALE)) dz= 1.0f+0.5f*cylen;
+ if (combo & (V3D_MANIP_ROTATE)) dz= 1.0f+2.0f*cylen;
+ else if (combo & (V3D_MANIP_SCALE)) dz= 1.0f+0.5f*cylen;
else dz= 1.0f;
/* Z Cone */
glTranslatef(0.0, 0.0, dz);
- if(drawflags & MAN_TRANS_Z) {
- if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_Z);
+ if (drawflags & MAN_TRANS_Z) {
+ if (G.f & G_PICKSEL) glLoadName(MAN_TRANS_Z);
manipulator_setcolor(v3d, 'Z', colcode, axisBlendAngle(rv3d->twangle[2]));
draw_cone(qobj, cylen, cywid);
}
/* X Cone */
glTranslatef(dz, 0.0, -dz);
- if(drawflags & MAN_TRANS_X) {
- if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_X);
+ if (drawflags & MAN_TRANS_X) {
+ if (G.f & G_PICKSEL) glLoadName(MAN_TRANS_X);
glRotatef(90.0, 0.0, 1.0, 0.0);
manipulator_setcolor(v3d, 'X', colcode, axisBlendAngle(rv3d->twangle[0]));
draw_cone(qobj, cylen, cywid);
@@ -1344,8 +1339,8 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int UNUS
}
/* Y Cone */
glTranslatef(-dz, dz, 0.0);
- if(drawflags & MAN_TRANS_Y) {
- if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_Y);
+ if (drawflags & MAN_TRANS_Y) {
+ if (G.f & G_PICKSEL) glLoadName(MAN_TRANS_Y);
glRotatef(-90.0, 1.0, 0.0, 0.0);
manipulator_setcolor(v3d, 'Y', colcode, axisBlendAngle(rv3d->twangle[1]));
draw_cone(qobj, cylen, cywid);
@@ -1354,7 +1349,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int UNUS
gluDeleteQuadric(qobj);
glLoadMatrixf(rv3d->viewmat);
- if(v3d->zbuf) glEnable(GL_DEPTH_TEST);
+ if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
}
@@ -1366,7 +1361,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
float cywid= 0.25f*cylen;
/* when called while moving in mixed mode, do not draw when... */
- if((drawflags & MAN_ROT_C)==0) return;
+ if ((drawflags & MAN_ROT_C)==0) return;
/* prepare for screen aligned draw */
glPushMatrix();
@@ -1377,14 +1372,14 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
qobj= gluNewQuadric();
/* Screen aligned view rot circle */
- if(drawflags & MAN_ROT_V) {
+ if (drawflags & MAN_ROT_V) {
float unitmat[4][4]= MAT4_UNITY;
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_V);
+ if (G.f & G_PICKSEL) glLoadName(MAN_ROT_V);
UI_ThemeColor(TH_TRANSFORM);
drawcircball(GL_LINE_LOOP, unitmat[3], 1.2f*size, unitmat);
- if(moving) {
+ if (moving) {
float vec[3];
vec[0]= 0; // XXX (float)(t->imval[0] - t->center2d[0]);
vec[1]= 0; // XXX (float)(t->imval[1] - t->center2d[1]);
@@ -1400,7 +1395,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
glPopMatrix();
/* apply the transform delta */
- if(moving) {
+ if (moving) {
float matt[4][4];
copy_m4_m4(matt, rv3d->twmat); // to copy the parts outside of [3][3]
// XXX if (t->flag & T_USES_MANIPULATOR) {
@@ -1415,10 +1410,10 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
glFrontFace(is_negative_m4(rv3d->twmat) ? GL_CW:GL_CCW);
/* axis */
- if( (G.f & G_PICKSEL)==0 ) {
+ if ( (G.f & G_PICKSEL)==0 ) {
// only draw axis when combo didn't draw scale axes
- if((combo & V3D_MANIP_SCALE)==0)
+ if ((combo & V3D_MANIP_SCALE)==0)
draw_manipulator_axes(v3d, rv3d, colcode, drawflags & MAN_ROT_X, drawflags & MAN_ROT_Y, drawflags & MAN_ROT_Z);
/* only has to be set when not in picking */
@@ -1427,15 +1422,15 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
/* Z cyl */
glTranslatef(0.0, 0.0, 1.0);
- if(drawflags & MAN_ROT_Z) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
+ if (drawflags & MAN_ROT_Z) {
+ if (G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
manipulator_setcolor(v3d, 'Z', colcode, 255);
draw_cylinder(qobj, cylen, cywid);
}
/* X cyl */
glTranslatef(1.0, 0.0, -1.0);
- if(drawflags & MAN_ROT_X) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
+ if (drawflags & MAN_ROT_X) {
+ if (G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
glRotatef(90.0, 0.0, 1.0, 0.0);
manipulator_setcolor(v3d, 'X', colcode, 255);
draw_cylinder(qobj, cylen, cywid);
@@ -1443,8 +1438,8 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
}
/* Y cylinder */
glTranslatef(-1.0, 1.0, 0.0);
- if(drawflags & MAN_ROT_Y) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
+ if (drawflags & MAN_ROT_Y) {
+ if (G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
glRotatef(-90.0, 1.0, 0.0, 0.0);
manipulator_setcolor(v3d, 'Y', colcode, 255);
draw_cylinder(qobj, cylen, cywid);
@@ -1455,7 +1450,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
gluDeleteQuadric(qobj);
glLoadMatrixf(rv3d->viewmat);
- if(v3d->zbuf) glEnable(GL_DEPTH_TEST);
+ if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
}
@@ -1475,15 +1470,15 @@ void BIF_draw_manipulator(const bContext *C)
RegionView3D *rv3d= ar->regiondata;
int totsel;
- if(!(v3d->twflag & V3D_USE_MANIPULATOR)) return;
-// if(G.moving && (G.moving & G_TRANSFORM_MANIP)==0) return;
+ if (!(v3d->twflag & V3D_USE_MANIPULATOR)) return;
+// if (G.moving && (G.moving & G_TRANSFORM_MANIP)==0) return;
-// if(G.moving==0) {
+// if (G.moving==0) {
{
v3d->twflag &= ~V3D_DRAW_MANIPULATOR;
totsel= calc_manipulator_stats(C);
- if(totsel==0) return;
+ if (totsel==0) return;
v3d->twflag |= V3D_DRAW_MANIPULATOR;
@@ -1494,9 +1489,9 @@ void BIF_draw_manipulator(const bContext *C)
rv3d->twmat[3][0]= (scene->twmin[0] + scene->twmax[0])/2.0f;
rv3d->twmat[3][1]= (scene->twmin[1] + scene->twmax[1])/2.0f;
rv3d->twmat[3][2]= (scene->twmin[2] + scene->twmax[2])/2.0f;
- if(v3d->around==V3D_ACTIVE && scene->obedit==NULL) {
+ if (v3d->around==V3D_ACTIVE && scene->obedit==NULL) {
Object *ob= OBACT;
- if(ob && !(ob->mode & OB_MODE_POSE))
+ if (ob && !(ob->mode & OB_MODE_POSE))
copy_v3_v3(rv3d->twmat[3], ob->obmat[3]);
}
break;
@@ -1515,23 +1510,23 @@ void BIF_draw_manipulator(const bContext *C)
test_manipulator_axis(C);
drawflags= rv3d->twdrawflag; /* set in calc_manipulator_stats */
- if(v3d->twflag & V3D_DRAW_MANIPULATOR) {
+ if (v3d->twflag & V3D_DRAW_MANIPULATOR) {
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
- if(v3d->twtype & V3D_MANIP_ROTATE) {
+ if (v3d->twtype & V3D_MANIP_ROTATE) {
- if(G.rt==3) {
- if(G.moving) draw_manipulator_rotate_cyl(v3d, rv3d, 1, drawflags, v3d->twtype, MAN_MOVECOL);
+ if (G.rt==3) {
+ if (G.moving) draw_manipulator_rotate_cyl(v3d, rv3d, 1, drawflags, v3d->twtype, MAN_MOVECOL);
else draw_manipulator_rotate_cyl(v3d, rv3d, 0, drawflags, v3d->twtype, MAN_RGB);
}
else
draw_manipulator_rotate(v3d, rv3d, 0 /* G.moving*/, drawflags, v3d->twtype);
}
- if(v3d->twtype & V3D_MANIP_SCALE) {
+ if (v3d->twtype & V3D_MANIP_SCALE) {
draw_manipulator_scale(v3d, rv3d, 0, drawflags, v3d->twtype, MAN_RGB);
}
- if(v3d->twtype & V3D_MANIP_TRANSLATE) {
+ if (v3d->twtype & V3D_MANIP_TRANSLATE) {
draw_manipulator_translate(v3d, rv3d, 0, drawflags, v3d->twtype, MAN_RGB);
}
@@ -1550,10 +1545,10 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, const int mval[2], fl
G.f |= G_PICKSEL;
- rect.xmin= mval[0]-hotspot;
- rect.xmax= mval[0]+hotspot;
- rect.ymin= mval[1]-hotspot;
- rect.ymax= mval[1]+hotspot;
+ rect.xmin = mval[0]-hotspot;
+ rect.xmax = mval[0]+hotspot;
+ rect.ymin = mval[1]-hotspot;
+ rect.ymax = mval[1]+hotspot;
setwinmatrixview3d(ar, v3d, &rect);
mult_m4_m4m4(rv3d->persmat, rv3d->winmat, rv3d->viewmat);
@@ -1564,13 +1559,13 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, const int mval[2], fl
glPushName(-2);
/* do the drawing */
- if(v3d->twtype & V3D_MANIP_ROTATE) {
- if(G.rt==3) draw_manipulator_rotate_cyl(v3d, rv3d, 0, MAN_ROT_C & rv3d->twdrawflag, v3d->twtype, MAN_RGB);
+ if (v3d->twtype & V3D_MANIP_ROTATE) {
+ if (G.rt==3) draw_manipulator_rotate_cyl(v3d, rv3d, 0, MAN_ROT_C & rv3d->twdrawflag, v3d->twtype, MAN_RGB);
else draw_manipulator_rotate(v3d, rv3d, 0, MAN_ROT_C & rv3d->twdrawflag, v3d->twtype);
}
- if(v3d->twtype & V3D_MANIP_SCALE)
+ if (v3d->twtype & V3D_MANIP_SCALE)
draw_manipulator_scale(v3d, rv3d, 0, MAN_SCALE_C & rv3d->twdrawflag, v3d->twtype, MAN_RGB);
- if(v3d->twtype & V3D_MANIP_TRANSLATE)
+ if (v3d->twtype & V3D_MANIP_TRANSLATE)
draw_manipulator_translate(v3d, rv3d, 0, MAN_TRANS_C & rv3d->twdrawflag, v3d->twtype, MAN_RGB);
glPopName();
@@ -1580,29 +1575,29 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, const int mval[2], fl
setwinmatrixview3d(ar, v3d, NULL);
mult_m4_m4m4(rv3d->persmat, rv3d->winmat, rv3d->viewmat);
- if(hits==1) return buffer[3];
- else if(hits>1) {
+ if (hits==1) return buffer[3];
+ else if (hits>1) {
GLuint val, dep, mindep=0, mindeprot=0, minval=0, minvalrot=0;
int a;
/* we compare the hits in buffer, but value centers highest */
/* we also store the rotation hits separate (because of arcs) and return hits on other widgets if there are */
- for(a=0; a<hits; a++) {
+ for (a=0; a<hits; a++) {
dep= buffer[4*a + 1];
val= buffer[4*a + 3];
- if(val==MAN_TRANS_C) return MAN_TRANS_C;
- else if(val==MAN_SCALE_C) return MAN_SCALE_C;
+ if (val==MAN_TRANS_C) return MAN_TRANS_C;
+ else if (val==MAN_SCALE_C) return MAN_SCALE_C;
else {
- if(val & MAN_ROT_C) {
- if(minvalrot==0 || dep<mindeprot) {
+ if (val & MAN_ROT_C) {
+ if (minvalrot==0 || dep<mindeprot) {
mindeprot= dep;
minvalrot= val;
}
}
else {
- if(minval==0 || dep<mindep) {
+ if (minval==0 || dep<mindep) {
mindep= dep;
minval= val;
}
@@ -1610,7 +1605,7 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, const int mval[2], fl
}
}
- if(minval)
+ if (minval)
return minval;
else
return minvalrot;
@@ -1629,26 +1624,26 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op)
int val;
int shift = event->shift;
- if(!(v3d->twflag & V3D_USE_MANIPULATOR)) return 0;
- if(!(v3d->twflag & V3D_DRAW_MANIPULATOR)) return 0;
+ if (!(v3d->twflag & V3D_USE_MANIPULATOR)) return 0;
+ if (!(v3d->twflag & V3D_DRAW_MANIPULATOR)) return 0;
/* Force orientation */
RNA_enum_set(op->ptr, "constraint_orientation", v3d->twmode);
// find the hotspots first test narrow hotspot
val= manipulator_selectbuf(sa, ar, event->mval, 0.5f*(float)U.tw_hotspot);
- if(val) {
+ if (val) {
// drawflags still global, for drawing call above
drawflags= manipulator_selectbuf(sa, ar, event->mval, 0.2f*(float)U.tw_hotspot);
- if(drawflags==0) drawflags= val;
+ if (drawflags==0) drawflags= val;
if (drawflags & MAN_TRANS_C) {
switch(drawflags) {
case MAN_TRANS_C:
break;
case MAN_TRANS_X:
- if(shift) {
+ if (shift) {
constraint_axis[1] = 1;
constraint_axis[2] = 1;
}
@@ -1656,7 +1651,7 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op)
constraint_axis[0] = 1;
break;
case MAN_TRANS_Y:
- if(shift) {
+ if (shift) {
constraint_axis[0] = 1;
constraint_axis[2] = 1;
}
@@ -1664,7 +1659,7 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op)
constraint_axis[1] = 1;
break;
case MAN_TRANS_Z:
- if(shift) {
+ if (shift) {
constraint_axis[0] = 1;
constraint_axis[1] = 1;
}
@@ -1679,7 +1674,7 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op)
else if (drawflags & MAN_SCALE_C) {
switch(drawflags) {
case MAN_SCALE_X:
- if(shift) {
+ if (shift) {
constraint_axis[1] = 1;
constraint_axis[2] = 1;
}
@@ -1687,7 +1682,7 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op)
constraint_axis[0] = 1;
break;
case MAN_SCALE_Y:
- if(shift) {
+ if (shift) {
constraint_axis[0] = 1;
constraint_axis[2] = 1;
}
@@ -1695,7 +1690,7 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op)
constraint_axis[1] = 1;
break;
case MAN_SCALE_Z:
- if(shift) {
+ if (shift) {
constraint_axis[0] = 1;
constraint_axis[1] = 1;
}
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 34ded8cdbf8..7c3bcb857eb 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -155,21 +155,21 @@ static int snap_type_exec(bContext *C, wmOperator *op)
static void TRANSFORM_OT_snap_type(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Snap Type";
- ot->description= "Set the snap element type";
- ot->idname= "TRANSFORM_OT_snap_type";
+ ot->name = "Snap Type";
+ ot->description = "Set the snap element type";
+ ot->idname = "TRANSFORM_OT_snap_type";
/* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= snap_type_exec;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = snap_type_exec;
- ot->poll= ED_operator_areaactive;
+ ot->poll = ED_operator_areaactive;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag = OPTYPE_UNDO;
/* props */
- ot->prop= RNA_def_enum(ot->srna, "type", snap_element_items, 0, "Type", "Set the snap element type");
+ ot->prop = RNA_def_enum(ot->srna, "type", snap_element_items, 0, "Type", "Set the snap element type");
}
@@ -203,7 +203,7 @@ static void TRANSFORM_OT_select_orientation(struct wmOperatorType *ot)
/* identifiers */
ot->name = "Select Orientation";
- ot->description= "Select transformation orientation";
+ ot->description = "Select transformation orientation";
ot->idname = "TRANSFORM_OT_select_orientation";
ot->flag = OPTYPE_UNDO;
@@ -245,7 +245,7 @@ static int delete_orientation_poll(bContext *C)
return 0;
- if(v3d) {
+ if (v3d) {
selected_index = (v3d->twmode - V3D_MANIP_CUSTOM);
}
@@ -256,7 +256,7 @@ static void TRANSFORM_OT_delete_orientation(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Delete Orientation";
- ot->description= "Delete transformation orientation";
+ ot->description = "Delete transformation orientation";
ot->idname = "TRANSFORM_OT_delete_orientation";
ot->flag = OPTYPE_UNDO;
@@ -291,7 +291,7 @@ static void TRANSFORM_OT_create_orientation(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Create Orientation";
- ot->description= "Create transformation orientation from selection";
+ ot->description = "Create transformation orientation from selection";
ot->idname = "TRANSFORM_OT_create_orientation";
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -341,7 +341,7 @@ static int transformops_data(bContext *C, wmOperator *op, wmEvent *event)
G.moving = 1;
/* store data */
- if(retval) {
+ if (retval) {
op->customdata = t;
}
else {
@@ -429,7 +429,7 @@ static int transform_invoke(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_CANCELLED;
}
- if(RNA_struct_property_is_set(op->ptr, "value")) {
+ if (RNA_struct_property_is_set(op->ptr, "value")) {
return transform_exec(C, op);
}
else {
@@ -517,7 +517,7 @@ void TRANSFORM_OT_translate(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Translate";
- ot->description= "Translate selected items";
+ ot->description = "Translate selected items";
ot->idname = OP_TRANSLATION;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -525,7 +525,7 @@ void TRANSFORM_OT_translate(struct wmOperatorType *ot)
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_screenactive;
RNA_def_float_vector_xyz(ot->srna, "value", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX);
@@ -537,7 +537,7 @@ void TRANSFORM_OT_resize(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Resize";
- ot->description= "Resize selected items";
+ ot->description = "Resize selected items";
ot->idname = OP_RESIZE;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -545,7 +545,7 @@ void TRANSFORM_OT_resize(struct wmOperatorType *ot)
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_screenactive;
RNA_def_float_vector(ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX);
@@ -558,7 +558,7 @@ void TRANSFORM_OT_trackball(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Trackball";
- ot->description= "Trackball style rotation of selected items";
+ ot->description = "Trackball style rotation of selected items";
ot->idname = OP_TRACKBALL;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -566,7 +566,7 @@ void TRANSFORM_OT_trackball(struct wmOperatorType *ot)
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_screenactive;
RNA_def_float_vector(ot->srna, "value", 2, VecOne, -FLT_MAX, FLT_MAX, "Angle", "", -FLT_MAX, FLT_MAX);
@@ -578,7 +578,7 @@ void TRANSFORM_OT_rotate(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Rotate";
- ot->description= "Rotate selected items";
+ ot->description = "Rotate selected items";
ot->idname = OP_ROTATION;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -586,7 +586,7 @@ void TRANSFORM_OT_rotate(struct wmOperatorType *ot)
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_screenactive;
RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI*2, M_PI*2);
@@ -598,10 +598,10 @@ 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" */
- ot->description= "Tilt selected control 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;
@@ -609,7 +609,7 @@ void TRANSFORM_OT_tilt(struct wmOperatorType *ot)
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_editcurve_3d;
RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI*2, M_PI*2);
@@ -621,7 +621,7 @@ void TRANSFORM_OT_warp(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Warp";
- ot->description= "Warp selected items around the cursor";
+ ot->description = "Warp selected items around the cursor";
ot->idname = OP_WARP;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -629,7 +629,7 @@ void TRANSFORM_OT_warp(struct wmOperatorType *ot)
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_screenactive;
RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI*2, M_PI*2);
@@ -642,7 +642,7 @@ void TRANSFORM_OT_shear(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Shear";
- ot->description= "Shear selected items along the horizontal screen axis";
+ ot->description = "Shear selected items along the horizontal screen axis";
ot->idname = OP_SHEAR;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -650,7 +650,7 @@ void TRANSFORM_OT_shear(struct wmOperatorType *ot)
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_screenactive;
RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
@@ -663,7 +663,7 @@ void TRANSFORM_OT_push_pull(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Push/Pull";
- ot->description= "Push/Pull selected items";
+ ot->description = "Push/Pull selected items";
ot->idname = OP_PUSH_PULL;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -671,7 +671,7 @@ void TRANSFORM_OT_push_pull(struct wmOperatorType *ot)
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_screenactive;
RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Distance", "", -FLT_MAX, FLT_MAX);
@@ -683,7 +683,7 @@ void TRANSFORM_OT_shrink_fatten(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Shrink/Fatten";
- ot->description= "Shrink/fatten selected vertices along normals";
+ ot->description = "Shrink/fatten selected vertices along normals";
ot->idname = OP_SHRINK_FATTEN;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -691,7 +691,7 @@ void TRANSFORM_OT_shrink_fatten(struct wmOperatorType *ot)
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_editmesh;
RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
@@ -704,7 +704,7 @@ void TRANSFORM_OT_tosphere(struct wmOperatorType *ot)
/* identifiers */
ot->name = "To Sphere";
//added "around mesh center" to differentiate between "MESH_OT_vertices_to_sphere()"
- ot->description= "Move selected vertices outward in a spherical shape around mesh center";
+ ot->description = "Move selected vertices outward in a spherical shape around mesh center";
ot->idname = OP_TOSPHERE;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -712,7 +712,7 @@ void TRANSFORM_OT_tosphere(struct wmOperatorType *ot)
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_screenactive;
RNA_def_float_factor(ot->srna, "value", 0, 0, 1, "Factor", "", 0, 1);
@@ -724,7 +724,7 @@ void TRANSFORM_OT_mirror(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Mirror";
- ot->description= "Mirror selected vertices around one or more axes";
+ ot->description = "Mirror selected vertices around one or more axes";
ot->idname = OP_MIRROR;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -732,7 +732,7 @@ void TRANSFORM_OT_mirror(struct wmOperatorType *ot)
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_screenactive;
Transform_Properties(ot, P_CONSTRAINT|P_PROPORTIONAL);
@@ -742,7 +742,7 @@ void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Edge Slide";
- ot->description= "Slide an edge loop along a mesh";
+ ot->description = "Slide an edge loop along a mesh";
ot->idname = OP_EDGE_SLIDE;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -750,7 +750,7 @@ void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot)
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_editmesh;
RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
@@ -762,7 +762,7 @@ void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Edge Crease";
- ot->description= "Change the crease of edges";
+ ot->description = "Change the crease of edges";
ot->idname = OP_EDGE_CREASE;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -770,7 +770,7 @@ void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot)
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_editmesh;
RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
@@ -782,7 +782,7 @@ void TRANSFORM_OT_seq_slide(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Sequence Slide";
- ot->description= "Slide a sequence strip in time";
+ ot->description = "Slide a sequence strip in time";
ot->idname = OP_SEQ_SLIDE;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -790,7 +790,7 @@ void TRANSFORM_OT_seq_slide(struct wmOperatorType *ot)
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_sequencer_active;
RNA_def_float_vector(ot->srna, "value", 2, VecOne, -FLT_MAX, FLT_MAX, "Angle", "", -FLT_MAX, FLT_MAX);
@@ -804,15 +804,15 @@ void TRANSFORM_OT_transform(struct wmOperatorType *ot)
/* identifiers */
ot->name = "Transform";
- ot->description= "Transform selected items by mode type";
+ ot->description = "Transform selected items by mode type";
ot->idname = "TRANSFORM_OT_transform";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
/* api callbacks */
ot->invoke = transform_invoke;
ot->exec = transform_exec;
ot->modal = transform_modal;
- ot->cancel = transform_cancel;
+ ot->cancel = transform_cancel;
ot->poll = ED_operator_screenactive;
prop= RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", "");
@@ -897,19 +897,19 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
break;
case SPACE_ACTION:
- kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "mode", TFM_TIME_TRANSLATE);
- kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
RNA_enum_set(kmi->ptr, "mode", TFM_TIME_TRANSLATE);
- kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND);
- kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "mode", TFM_TIME_SCALE);
- kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", TKEY, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", TKEY, KM_PRESS, KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "mode", TFM_TIME_SLIDE);
break;
case SPACE_IPO:
@@ -917,7 +917,7 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
- kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND);
WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
@@ -925,24 +925,24 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
break;
case SPACE_NLA:
- kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "mode", TFM_TRANSLATION);
- kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
RNA_enum_set(kmi->ptr, "mode", TFM_TRANSLATION);
- kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND);
- kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "mode", TFM_TIME_SCALE);
break;
case SPACE_NODE:
WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
- kmi= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_A, KM_ANY, 0, 0);
+ kmi = WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_A, KM_ANY, 0, 0);
RNA_boolean_set(kmi->ptr, "release_confirm", TRUE);
- kmi= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
+ kmi = WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
RNA_boolean_set(kmi->ptr, "release_confirm", TRUE);
WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
@@ -961,7 +961,7 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
WM_keymap_add_item(keymap, OP_SEQ_SLIDE, EVT_TWEAK_S, KM_ANY, 0, 0);
- kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND);
break;
case SPACE_IMAGE:
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 5f83bb4c29c..d822bb0aaf7 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -38,6 +38,9 @@
#include "DNA_screen_types.h"
#include "DNA_view3d_types.h"
+#include "BLI_math.h"
+#include "BLI_blenlib.h"
+#include "BLI_utildefines.h"
#include "BKE_armature.h"
#include "BKE_curve.h"
@@ -45,10 +48,6 @@
#include "BKE_tessmesh.h"
#include "BKE_report.h"
-#include "BLI_math.h"
-#include "BLI_blenlib.h"
-#include "BLI_utildefines.h"
-
#include "BLF_translation.h"
//#include "BIF_editmesh.h"
@@ -75,7 +74,7 @@ void BIF_clearTransformOrientation(bContext *C)
BLI_freelistN(transform_spaces);
// Need to loop over all view3d
- if(v3d && v3d->twmode >= V3D_MANIP_CUSTOM) {
+ if (v3d && v3d->twmode >= V3D_MANIP_CUSTOM) {
v3d->twmode = V3D_MANIP_GLOBAL; /* fallback to global */
}
}
@@ -122,8 +121,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 +142,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 +161,7 @@ TransformOrientation *createBoneSpace(bContext *C, ReportList *reports, char *na
return NULL;
}
- if (name[0] == 0)
- {
+ if (name[0] == 0) {
strcpy(name, "Bone");
}
@@ -188,8 +184,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 +194,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 +204,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 +247,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 +268,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));
@@ -308,7 +297,7 @@ void BIF_removeTransformOrientation(bContext *C, TransformOrientation *target)
for (i = 0, ts = transform_spaces->first; ts; ts = ts->next, i++) {
if (ts == target) {
View3D *v3d = CTX_wm_view3d(C);
- if(v3d) {
+ if (v3d) {
int selected_index = (v3d->twmode - V3D_MANIP_CUSTOM);
// Transform_fix_me NEED TO DO THIS FOR ALL VIEW3D
@@ -334,7 +323,7 @@ void BIF_removeTransformOrientationIndex(bContext *C, int index)
if (ts) {
View3D *v3d = CTX_wm_view3d(C);
- if(v3d) {
+ if (v3d) {
int selected_index = (v3d->twmode - V3D_MANIP_CUSTOM);
// Transform_fix_me NEED TO DO THIS FOR ALL VIEW3D
@@ -369,7 +358,7 @@ void BIF_selectTransformOrientation(bContext *C, TransformOrientation *target)
void BIF_selectTransformOrientationValue(bContext *C, int orientation)
{
View3D *v3d = CTX_wm_view3d(C);
- if(v3d) /* currently using generic poll */
+ if (v3d) /* currently using generic poll */
v3d->twmode = orientation;
}
@@ -392,19 +381,19 @@ EnumPropertyItem *BIF_enumTransformOrientation(bContext *C)
RNA_enum_item_add(&item, &totitem, &local);
RNA_enum_item_add(&item, &totitem, &view);
- if(C) {
+ if (C) {
scene= CTX_data_scene(C);
- 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 = "CUSTOM";
tmp.name= ts->name;
tmp.value = i++;
@@ -480,11 +469,11 @@ static int count_bone_select(bArmature *arm, ListBase *lb, int do_it)
int do_next;
int total = 0;
- for(bone= lb->first; bone; bone= bone->next) {
+ for (bone= lb->first; bone; bone= bone->next) {
bone->flag &= ~BONE_TRANSFORM;
do_next = do_it;
- if(do_it) {
- if(bone->layer & arm->layer) {
+ if (do_it) {
+ if (bone->layer & arm->layer) {
if (bone->flag & BONE_SELECTED) {
bone->flag |= BONE_TRANSFORM;
total++;
@@ -518,7 +507,7 @@ void initTransformOrientation(bContext *C, TransInfo *t)
}
/* no gimbal fallthrough to normal */
case V3D_MANIP_NORMAL:
- if(obedit || (ob && ob->mode & OB_MODE_POSE)) {
+ if (obedit || (ob && ob->mode & OB_MODE_POSE)) {
strcpy(t->spacename, "normal");
ED_getTransformOrientationMatrix(C, t->spacemtx, (v3d->around == V3D_ACTIVE));
break;
@@ -527,18 +516,18 @@ void initTransformOrientation(bContext *C, TransInfo *t)
case V3D_MANIP_LOCAL:
strcpy(t->spacename, "local");
- if(ob) {
+ if (ob) {
copy_m3_m4(t->spacemtx, ob->obmat);
normalize_m3(t->spacemtx);
- } else {
+ }
+ else {
unit_m3(t->spacemtx);
}
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];
@@ -547,8 +536,7 @@ void initTransformOrientation(bContext *C, TransInfo *t)
normalize_m3(mat);
copy_m3_m3(t->spacemtx, mat);
}
- else
- {
+ else {
unit_m3(t->spacemtx);
}
break;
@@ -570,8 +558,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... */
@@ -582,8 +569,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;
@@ -591,8 +577,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_editselection_active_get(em, &ese)) {
EDBM_editselection_normal(normal, &ese);
EDBM_editselection_plane(em, plane, &ese);
@@ -609,15 +594,13 @@ 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;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- if(BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
+ if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
add_v3_v3(normal, efa->no);
sub_v3_v3v3(vec,
BM_FACE_FIRST_LOOP(efa)->v->co,
@@ -628,8 +611,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];
@@ -654,13 +636,12 @@ 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;
BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
- if(BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
+ if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
sub_v3_v3v3(plane, eed->v2->co, eed->v1->co);
break;
}
@@ -669,13 +650,12 @@ 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;
BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
- if(BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
+ if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
/* use average vert normals as plane and edge vector as normal */
copy_v3_v3(plane, eed->v1->no);
add_v3_v3(plane, eed->v2->no);
@@ -685,8 +665,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;
@@ -707,8 +686,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) {
@@ -719,10 +697,10 @@ 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;
+
+ zero_v3(normal);
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
@@ -734,40 +712,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--)
+ 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]);
}
}
@@ -776,36 +746,29 @@ 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 */
@@ -820,16 +783,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);
@@ -845,37 +805,33 @@ 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;
totsel = count_bone_select(arm, &arm->bonebase, 1);
- if(totsel) {
+ if (totsel) {
float imat[3][3], mat[3][3];
/* use channels to get stats */
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
if (pchan->bone && pchan->bone->flag & BONE_TRANSFORM) {
add_v3_v3(normal, pchan->pose_mat[2]);
add_v3_v3(plane, pchan->pose_mat[1]);
@@ -894,17 +850,17 @@ 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 */
ob = OBACT;
- if(ob && !(ob->flag & SELECT)) ob = NULL;
+ if (ob && !(ob->flag & SELECT)) ob = NULL;
- for(base= scene->base.first; base; base= base->next) {
- if TESTBASELIB(v3d, base) {
- if(ob == NULL) {
+ for (base= scene->base.first; base; base= base->next) {
+ if (TESTBASELIB(v3d, base)) {
+ if (ob == NULL) {
ob= base->object;
break;
}
@@ -933,33 +889,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 b36670bafa5..ea21a636300 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -169,7 +169,8 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
for (p = t->tsnap.points.first; p; p = p->next) {
if (p == t->tsnap.selectedPoint) {
glColor4ubv(selectedCol);
- } else {
+ }
+ else {
glColor4ubv(col);
}
@@ -195,14 +196,12 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
glEnd();
}
- if(v3d->zbuf)
+ 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 +229,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
glTranslatef(-t->tsnap.snapPoint[0], -t->tsnap.snapPoint[1], 0.0f);
setlinestyle(0);
- */
+#endif
}
}
@@ -267,12 +266,12 @@ void applyProject(TransInfo *t)
float imat[4][4];
int i;
- if(t->flag & (T_EDIT|T_POSE)) {
+ if (t->flag & (T_EDIT|T_POSE)) {
Object *ob = t->obedit?t->obedit:t->poseobj;
invert_m4_m4(imat, ob->obmat);
}
- for(i = 0 ; i < t->total; i++, td++) {
+ for (i = 0 ; i < t->total; i++, td++) {
float iloc[3], loc[3], no[3];
float mval[2];
int dist = 1000;
@@ -289,8 +288,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]);
@@ -300,7 +298,7 @@ void applyProject(TransInfo *t)
if (snapObjectsTransform(t, mval, &dist, loc, no, t->tsnap.modeSelect))
{
-// if(t->flag & (T_EDIT|T_POSE)) {
+// if (t->flag & (T_EDIT|T_POSE)) {
// mul_m4_v3(imat, loc);
// }
//
@@ -328,8 +326,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 +386,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 +401,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 +420,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 +476,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;
}
@@ -580,7 +570,7 @@ int updateSelectedSnapPoint(TransInfo *t)
int closest_dist = 0;
int screen_loc[2];
- for( p = t->tsnap.points.first; p; p = p->next ) {
+ for ( p = t->tsnap.points.first; p; p = p->next ) {
int dx, dy;
int dist;
@@ -642,7 +632,8 @@ void getSnapPoint(TransInfo *t, float vec[3])
}
mul_v3_fl(vec, 1.0f / total);
- } else {
+ }
+ else {
copy_v3_v3(vec, t->tsnap.snapPoint);
}
}
@@ -692,7 +683,7 @@ static float RotationBetween(TransInfo *t, float p1[3], float p2[3])
float angle, start[3], end[3], center[3];
copy_v3_v3(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, center);
}
@@ -748,7 +739,7 @@ static float ResizeBetween(TransInfo *t, float p1[3], float p2[3])
float d1[3], d2[3], center[3], len_d1;
copy_v3_v3(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, center);
}
@@ -796,7 +787,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
depth_peels.first = depth_peels.last = NULL;
- peelObjectsTransForm(t, &depth_peels, mval);
+ peelObjectsTransForm(t, &depth_peels, mval, t->tsnap.modeSelect);
// if (LAST_SNAP_POINT_VALID)
// {
@@ -832,23 +823,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 +849,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 +868,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,20 +888,18 @@ 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];
UI_view2d_region_to_view(&t->ar->v2d, t->mval[0], t->mval[1], co, co+1);
- if(ED_uvedit_nearest_uv(t->scene, t->obedit, ima, co, t->tsnap.snapPoint))
+ if (ED_uvedit_nearest_uv(t->scene, t->obedit, ima, co, t->tsnap.snapPoint))
{
ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
t->tsnap.snapPoint[0] *= aspx;
@@ -924,8 +907,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
t->tsnap.status |= POINT_INIT;
}
- else
- {
+ else {
t->tsnap.status &= ~POINT_INIT;
}
}
@@ -939,7 +921,7 @@ static void TargetSnapCenter(TransInfo *t)
if ((t->tsnap.status & TARGET_INIT) == 0)
{
copy_v3_v3(t->tsnap.snapTarget, 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->tsnap.snapTarget);
}
@@ -957,7 +939,7 @@ static void TargetSnapActive(TransInfo *t)
TransData *active_td = NULL;
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++)
{
if (td->flag & TD_ACTIVE)
{
@@ -970,7 +952,7 @@ static void TargetSnapActive(TransInfo *t)
{
copy_v3_v3(t->tsnap.snapTarget, active_td->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->tsnap.snapTarget);
}
@@ -978,8 +960,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);
@@ -999,14 +980,14 @@ static void TargetSnapMedian(TransInfo *t)
t->tsnap.snapTarget[1] = 0;
t->tsnap.snapTarget[2] = 0;
- 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++)
{
add_v3_v3(t->tsnap.snapTarget, td->center);
}
mul_v3_fl(t->tsnap.snapTarget, 1.0 / i);
- 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->tsnap.snapTarget);
}
@@ -1026,7 +1007,7 @@ static void TargetSnapClosest(TransInfo *t)
if (t->flag & T_OBJECT)
{
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++)
{
struct BoundBox *bb = object_get_boundbox(td->ob);
@@ -1044,8 +1025,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 +1033,7 @@ static void TargetSnapClosest(TransInfo *t)
}
}
/* use element center otherwise */
- else
- {
+ else {
float loc[3];
float dist;
@@ -1071,17 +1050,15 @@ 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;
copy_v3_v3(loc, td->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, loc);
}
@@ -1303,7 +1280,7 @@ static int snapArmature(short snap_mode, ARegion *ar, Object *ob, bArmature *arm
mul_m4_v3(imat, ray_start_local);
mul_mat3_m4_v3(imat, ray_normal_local);
- if(arm->edbo)
+ if (arm->edbo)
{
EditBone *eBone;
@@ -1325,8 +1302,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;
@@ -1407,9 +1383,9 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
hit.index = -1;
hit.dist = *r_depth * (*r_depth == FLT_MAX ? 1.0f : local_scale);
- if(treeData.tree && BLI_bvhtree_ray_cast(treeData.tree, ray_start_local, ray_normal_local, 0.0f, &hit, treeData.raycast_callback, &treeData) != -1)
+ if (treeData.tree && BLI_bvhtree_ray_cast(treeData.tree, ray_start_local, ray_normal_local, 0.0f, &hit, treeData.raycast_callback, &treeData) != -1)
{
- if(hit.dist/local_scale <= *r_depth) {
+ if (hit.dist/local_scale <= *r_depth) {
*r_depth= hit.dist/local_scale;
copy_v3_v3(r_loc, hit.co);
copy_v3_v3(r_no, hit.no);
@@ -1436,10 +1412,10 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
if (em != NULL)
{
index_array = dm->getTessFaceDataArray(dm, CD_ORIGINDEX);
- EDBM_init_index_arrays(em, 0, 0, 1);
+ EDBM_index_arrays_init(em, 0, 0, 1);
}
- for( i = 0; i < totface; i++) {
+ for ( i = 0; i < totface; i++) {
BMFace *efa = NULL;
MFace *f = faces + i;
@@ -1447,27 +1423,24 @@ 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
- {
- efa = EDBM_get_face_for_index(em, index);
+ else {
+ efa = EDBM_face_at_index(em, index);
if (efa && BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
{
test = 0;
- } else if (efa) {
+ }
+ else if (efa) {
BMIter iter;
BMLoop *l;
@@ -1505,7 +1478,7 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
if (em != NULL)
{
- EDBM_free_index_arrays(em);
+ EDBM_index_arrays_free(em);
}
#endif
break;
@@ -1520,33 +1493,28 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
if (em != NULL)
{
index_array = dm->getVertDataArray(dm, CD_ORIGINDEX);
- EDBM_init_index_arrays(em, 1, 0, 0);
+ EDBM_index_arrays_init(em, 1, 0, 0);
}
- for( i = 0; i < totvert; i++) {
+ for ( i = 0; i < totvert; i++) {
BMVert *eve = NULL;
MVert *v = verts + i;
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
- {
- eve = EDBM_get_vert_for_index(em, index);
+ else {
+ eve = EDBM_vert_at_index(em, index);
if (eve && (BM_elem_flag_test(eve, BM_ELEM_HIDDEN) || BM_elem_flag_test(eve, BM_ELEM_SELECT)))
{
@@ -1564,7 +1532,7 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
if (em != NULL)
{
- EDBM_free_index_arrays(em);
+ EDBM_index_arrays_free(em);
}
break;
}
@@ -1580,10 +1548,10 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
if (em != NULL)
{
index_array = dm->getEdgeDataArray(dm, CD_ORIGINDEX);
- EDBM_init_index_arrays(em, 0, 1, 0);
+ EDBM_index_arrays_init(em, 0, 1, 0);
}
- for( i = 0; i < totedge; i++) {
+ for ( i = 0; i < totedge; i++) {
BMEdge *eed = NULL;
MEdge *e = edges + i;
@@ -1591,22 +1559,18 @@ 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
- {
- eed = EDBM_get_edge_for_index(em, index);
+ else {
+ eed = EDBM_edge_at_index(em, index);
if (eed && (BM_elem_flag_test(eed, BM_ELEM_HIDDEN) ||
BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) ||
@@ -1626,7 +1590,7 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh
if (em != NULL)
{
- EDBM_free_index_arrays(em);
+ EDBM_index_arrays_free(em);
}
break;
}
@@ -1648,14 +1612,12 @@ static int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, flo
BMEditMesh *em;
DerivedMesh *dm;
- if (editobject)
- {
- em = ((Mesh *)ob->data)->edit_btmesh;
+ 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 +1626,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 +1643,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 +1655,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,12 +1669,11 @@ 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);
- for(dupli_ob = lb->first; dupli_ob; dupli_ob = dupli_ob->next)
+ for (dupli_ob = lb->first; dupli_ob; dupli_ob = dupli_ob->next)
{
Object *dob = dupli_ob->ob;
@@ -1754,12 +1712,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 +1729,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;
}
@@ -1841,7 +1795,7 @@ static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4],
MFace *faces = dm->getTessFaceArray(dm);
int i;
- for( i = 0; i < totface; i++) {
+ for ( i = 0; i < totface; i++) {
MFace *f = faces + i;
float lambda;
int result;
@@ -1875,8 +1829,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) {
@@ -1912,7 +1865,7 @@ static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4],
return retval;
}
-static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, ListBase *depth_peels, const float mval[2])
+static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, ListBase *depth_peels, const float mval[2], SnapMode mode)
{
Base *base;
int retval = 0;
@@ -1920,33 +1873,30 @@ 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 0 //BMESH_TODO
+ if (ob->transflag & OB_DUPLI) {
DupliObject *dupli_ob;
ListBase *lb = object_duplilist(scene, ob);
- for(dupli_ob = lb->first; dupli_ob; dupli_ob = dupli_ob->next)
+ for (dupli_ob = lb->first; dupli_ob; dupli_ob = dupli_ob->next)
{
Object *dob = dupli_ob->ob;
if (dob->type == OB_MESH) {
-#if 0 //BMESH_TODO
EditMesh *em;
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);
@@ -1956,35 +1906,32 @@ static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, L
retval = retval || val;
dm->release(dm);
-#endif
}
}
free_object_duplilist(lb);
}
+#endif
if (ob->type == OB_MESH) {
- BMEditMesh *em;
- DerivedMesh *dm = NULL;
- int val;
+ int val = 0;
- if (ob != obedit)
- {
- dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
+ if (ob != obedit && ((mode == SNAP_NOT_SELECTED && (base->flag & (SELECT|BA_WAS_SEL)) == 0) || ELEM(mode, SNAP_ALL, SNAP_NOT_OBEDIT))) {
+ DerivedMesh *dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
val = peelDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, depth_peels);
+ dm->release(dm);
}
- else
- {
- em = ((Mesh *)ob->data)->edit_btmesh;
- dm = editbmesh_get_derived_cage(scene, obedit, em, CD_MASK_BAREMESH);
+ else if (ob == obedit && mode != SNAP_NOT_OBEDIT) {
+ BMEditMesh *em = BMEdit_FromObject(ob);
+ DerivedMesh *dm = editbmesh_get_derived_cage(scene, obedit, em, CD_MASK_BAREMESH);
val = peelDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, depth_peels);
+ dm->release(dm);
}
retval = retval || val;
- dm->release(dm);
}
}
}
@@ -1995,17 +1942,17 @@ static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, L
return retval;
}
-int peelObjectsTransForm(TransInfo *t, ListBase *depth_peels, const float mval[2])
+int peelObjectsTransForm(TransInfo *t, ListBase *depth_peels, const float mval[2], SnapMode mode)
{
- return peelObjects(t->scene, t->view, t->ar, t->obedit, depth_peels, mval);
+ return peelObjects(t->scene, t->view, t->ar, t->obedit, depth_peels, mval, mode);
}
-int peelObjectsContext(bContext *C, ListBase *depth_peels, const float mval[2])
+int peelObjectsContext(bContext *C, ListBase *depth_peels, const float mval[2], SnapMode mode)
{
ScrArea *sa = CTX_wm_area(C);
View3D *v3d = sa->spacedata.first;
- return peelObjects(CTX_data_scene(C), v3d, CTX_wm_region(C), CTX_data_edit_object(C), depth_peels, mval);
+ return peelObjects(CTX_data_scene(C), v3d, CTX_wm_region(C), CTX_data_edit_object(C), depth_peels, mval, mode);
}
/*================================================================*/
@@ -2048,7 +1995,7 @@ static void applyGrid(TransInfo *t, float *val, int max_index, float fac[3], Gea
int i;
float asp[3] = {1.0f, 1.0f, 1.0f}; // TODO: Remove hard coded limit here (3)
- if(max_index > 2) {
+ if (max_index > 2) {
printf("applyGrid: invalid index %d, clamping\n", max_index);
max_index= 2;
}
@@ -2058,7 +2005,7 @@ static void applyGrid(TransInfo *t, float *val, int max_index, float fac[3], Gea
return;
/* evil hack - snapping needs to be adapted for image aspect ratio */
- if((t->spacetype==SPACE_IMAGE) && (t->mode==TFM_TRANSLATION)) {
+ if ((t->spacetype==SPACE_IMAGE) && (t->mode==TFM_TRANSLATION)) {
ED_space_image_uv_aspect(t->sa->spacedata.first, asp, asp+1);
}
diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c
index 5ead0959d5c..d63ad7f58e6 100644
--- a/source/blender/editors/util/crazyspace.c
+++ b/source/blender/editors/util/crazyspace.c
@@ -38,15 +38,15 @@
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
+#include "BLI_utildefines.h"
+#include "BLI_math.h"
+
#include "BKE_DerivedMesh.h"
#include "BKE_modifier.h"
#include "BKE_multires.h"
#include "BKE_mesh.h"
#include "BKE_tessmesh.h"
-#include "BLI_utildefines.h"
-#include "BLI_math.h"
-
#include "ED_util.h"
typedef struct {
@@ -54,7 +54,7 @@ typedef struct {
short *flags;
} MappedUserData;
-#define TAN_MAKE_VEC(a, b, c) a[0]= b[0] + 0.2f*(b[0]-c[0]); a[1]= b[1] + 0.2f*(b[1]-c[1]); a[2]= b[2] + 0.2f*(b[2]-c[2])
+#define TAN_MAKE_VEC(a, b, c) a[0] = b[0] + 0.2f * (b[0] - c[0]); a[1] = b[1] + 0.2f * (b[1] - c[1]); a[2] = b[2] + 0.2f * (b[2] - c[2])
static void set_crazy_vertex_quat(float *quat, float *v1, float *v2, float *v3, float *def1, float *def2, float *def3)
{
float vecu[3], vecv[3];
@@ -62,11 +62,11 @@ static void set_crazy_vertex_quat(float *quat, float *v1, float *v2, float *v3,
TAN_MAKE_VEC(vecu, v1, v2);
TAN_MAKE_VEC(vecv, v1, v3);
- tri_to_quat( q1,v1, vecu, vecv);
+ tri_to_quat(q1, v1, vecu, vecv);
TAN_MAKE_VEC(vecu, def1, def2);
TAN_MAKE_VEC(vecv, def1, def3);
- tri_to_quat( q2,def1, vecu, vecv);
+ tri_to_quat(q2, def1, vecu, vecv);
sub_qt_qtqt(quat, q2, q1);
}
@@ -74,15 +74,15 @@ static void set_crazy_vertex_quat(float *quat, float *v1, float *v2, float *v3,
static void make_vertexcos__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
{
- MappedUserData *mappedData= (MappedUserData*)userData;
+ MappedUserData *mappedData = (MappedUserData *)userData;
float *vec = mappedData->vertexcos;
- vec+= 3*index;
- if(!mappedData->flags[index]) {
+ 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;
+ mappedData->flags[index] = 1;
}
}
@@ -91,11 +91,11 @@ static int modifiers_disable_subsurf_temporary(Object *ob)
ModifierData *md;
int disabled = 0;
- for(md=ob->modifiers.first; md; md=md->next)
- if(md->type==eModifierType_Subsurf)
- if(md->mode & eModifierMode_OnCage) {
+ for (md = ob->modifiers.first; md; md = md->next)
+ if (md->type == eModifierType_Subsurf)
+ if (md->mode & eModifierMode_OnCage) {
md->mode ^= eModifierMode_DisableTemporary;
- disabled= 1;
+ disabled = 1;
}
return disabled;
@@ -104,27 +104,27 @@ static int modifiers_disable_subsurf_temporary(Object *ob)
/* disable subsurf temporal, get mapped cos, and enable it */
float *crazyspace_get_mapped_editverts(Scene *scene, Object *obedit)
{
- Mesh *me= obedit->data;
+ Mesh *me = obedit->data;
DerivedMesh *dm;
float *vertexcos;
- int nverts= me->edit_btmesh->bm->totvert;
+ int nverts = me->edit_btmesh->bm->totvert;
short *flags;
MappedUserData userData;
/* disable subsurf temporal, get mapped cos, and enable it */
- if(modifiers_disable_subsurf_temporary(obedit)) {
+ if (modifiers_disable_subsurf_temporary(obedit)) {
/* need to make new derivemesh */
makeDerivedMesh(scene, obedit, me->edit_btmesh, CD_MASK_BAREMESH, 0);
}
/* now get the cage */
- dm= editbmesh_get_derived_cage(scene, obedit, me->edit_btmesh, CD_MASK_BAREMESH);
+ dm = editbmesh_get_derived_cage(scene, obedit, me->edit_btmesh, CD_MASK_BAREMESH);
- vertexcos= MEM_callocN(3*sizeof(float)*nverts, "vertexcos map");
- flags= MEM_callocN(sizeof(short)*nverts, "vertexcos flags");
+ vertexcos = MEM_callocN(3 * sizeof(float) * nverts, "vertexcos map");
+ flags = MEM_callocN(sizeof(short) * nverts, "vertexcos flags");
- userData.vertexcos= vertexcos;
- userData.flags= flags;
+ userData.vertexcos = vertexcos;
+ userData.flags = flags;
dm->foreachMappedVert(dm, make_vertexcos__mapFunc, &userData);
dm->release(dm);
@@ -143,31 +143,33 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float *origcos, float *mapped
BMIter iter, liter;
BMLoop *l;
float *v1, *v2, *v3, *co1, *co2, *co3;
- int *vert_table = MEM_callocN(sizeof(int)*em->bm->totvert, "vert_table");
+ int *vert_table = MEM_callocN(sizeof(int) * em->bm->totvert, "vert_table");
int index = 0;
BM_mesh_elem_index_ensure(em->bm, BM_VERT);
- BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
+ BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL)
+ {
if (!BM_elem_flag_test(v, BM_ELEM_SELECT) || BM_elem_flag_test(v, BM_ELEM_HIDDEN))
continue;
- BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_VERT, v) {
- BMLoop *l2 = BM_face_other_loop(l->e, l->f, v);
+ BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_VERT, 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);
- v2= mappedcos + 3*BM_elem_index_get(BM_edge_other_vert(l2->e, l->v));
- v3= mappedcos + 3*BM_elem_index_get(BM_edge_other_vert(l->e, l->v));
-
- co1= (origcos)? origcos + 3*BM_elem_index_get(l->v) : l->v->co;
- co2= (origcos)? origcos + 3*BM_elem_index_get(BM_edge_other_vert(l2->e, l->v)) : BM_edge_other_vert(l2->e, l->v)->co;
- co3= (origcos)? origcos + 3*BM_elem_index_get(BM_edge_other_vert(l->e, l->v)) : BM_edge_other_vert(l->e, l->v)->co;
+ v1 = mappedcos + 3 * BM_elem_index_get(l->v);
+ v2 = mappedcos + 3 * BM_elem_index_get(BM_edge_other_vert(l2->e, l->v));
+ v3 = mappedcos + 3 * BM_elem_index_get(BM_edge_other_vert(l->e, l->v));
+
+ co1 = (origcos) ? origcos + 3 * BM_elem_index_get(l->v) : l->v->co;
+ co2 = (origcos) ? origcos + 3 * BM_elem_index_get(BM_edge_other_vert(l2->e, l->v)) : BM_edge_other_vert(l2->e, l->v)->co;
+ co3 = (origcos) ? origcos + 3 * BM_elem_index_get(BM_edge_other_vert(l->e, l->v)) : BM_edge_other_vert(l->e, l->v)->co;
set_crazy_vertex_quat(quats, v1, v2, v3, co1, co2, co3);
- quats+= 4;
+ quats += 4;
- vert_table[BM_elem_index_get(l->v)] = index+1;
+ vert_table[BM_elem_index_get(l->v)] = index + 1;
index++;
break; /*just do one corner*/
@@ -177,9 +179,9 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float *origcos, float *mapped
index = 0;
BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
if (vert_table[index] != 0)
- BM_elem_index_set(v, vert_table[index]-1); /* set_dirty! */
+ BM_elem_index_set(v, vert_table[index] - 1); /* set_dirty! */
else
- BM_elem_index_set(v, -1); /* set_dirty! */
+ BM_elem_index_set(v, -1); /* set_dirty! */
index++;
}
@@ -191,69 +193,69 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float *origcos, float *mapped
BMEditFace *efa;
BMIter iter;
float *v1, *v2, *v3, *v4, *co1, *co2, *co3, *co4;
- intptr_t index= 0;
+ intptr_t index = 0;
/* two abused locations in vertices */
- for(eve= em->verts.first; eve; eve= eve->next, index++) {
+ for (eve = em->verts.first; eve; eve = eve->next, index++) {
eve->tmp.p = NULL;
- eve->prev= (EditVert *)index;
+ eve->prev = (EditVert *)index;
}
/* first store two sets of tangent vectors in vertices, we derive it just from the face-edges */
- for(efa= em->faces.first; efa; efa= efa->next) {
+ for (efa = em->faces.first; efa; efa = efa->next) {
/* retrieve mapped coordinates */
- v1= mappedcos + 3*(intptr_t)(efa->v1->prev);
- v2= mappedcos + 3*(intptr_t)(efa->v2->prev);
- v3= mappedcos + 3*(intptr_t)(efa->v3->prev);
+ v1 = mappedcos + 3 * (intptr_t)(efa->v1->prev);
+ v2 = mappedcos + 3 * (intptr_t)(efa->v2->prev);
+ v3 = mappedcos + 3 * (intptr_t)(efa->v3->prev);
- co1= (origcos)? origcos + 3*(intptr_t)(efa->v1->prev): efa->v1->co;
- co2= (origcos)? origcos + 3*(intptr_t)(efa->v2->prev): efa->v2->co;
- co3= (origcos)? origcos + 3*(intptr_t)(efa->v3->prev): efa->v3->co;
+ co1 = (origcos) ? origcos + 3 * (intptr_t)(efa->v1->prev) : efa->v1->co;
+ co2 = (origcos) ? origcos + 3 * (intptr_t)(efa->v2->prev) : efa->v2->co;
+ co3 = (origcos) ? origcos + 3 * (intptr_t)(efa->v3->prev) : efa->v3->co;
- if(efa->v2->tmp.p==NULL && efa->v2->f1) {
+ if (efa->v2->tmp.p == NULL && efa->v2->f1) {
set_crazy_vertex_quat(quats, co2, co3, co1, v2, v3, v1);
- efa->v2->tmp.p= (void*)quats;
- quats+= 4;
+ efa->v2->tmp.p = (void *)quats;
+ quats += 4;
}
- if(efa->v4) {
- v4= mappedcos + 3*(intptr_t)(efa->v4->prev);
- co4= (origcos)? origcos + 3*(intptr_t)(efa->v4->prev): efa->v4->co;
+ if (efa->v4) {
+ v4 = mappedcos + 3 * (intptr_t)(efa->v4->prev);
+ co4 = (origcos) ? origcos + 3 * (intptr_t)(efa->v4->prev) : efa->v4->co;
- if(efa->v1->tmp.p==NULL && efa->v1->f1) {
+ if (efa->v1->tmp.p == NULL && efa->v1->f1) {
set_crazy_vertex_quat(quats, co1, co2, co4, v1, v2, v4);
- efa->v1->tmp.p= (void*)quats;
- quats+= 4;
+ efa->v1->tmp.p = (void *)quats;
+ quats += 4;
}
- if(efa->v3->tmp.p==NULL && efa->v3->f1) {
+ if (efa->v3->tmp.p == NULL && efa->v3->f1) {
set_crazy_vertex_quat(quats, co3, co4, co2, v3, v4, v2);
- efa->v3->tmp.p= (void*)quats;
- quats+= 4;
+ efa->v3->tmp.p = (void *)quats;
+ quats += 4;
}
- if(efa->v4->tmp.p==NULL && efa->v4->f1) {
+ if (efa->v4->tmp.p == NULL && efa->v4->f1) {
set_crazy_vertex_quat(quats, co4, co1, co3, v4, v1, v3);
- efa->v4->tmp.p= (void*)quats;
- quats+= 4;
+ efa->v4->tmp.p = (void *)quats;
+ quats += 4;
}
}
else {
- if(efa->v1->tmp.p==NULL && efa->v1->f1) {
+ if (efa->v1->tmp.p == NULL && efa->v1->f1) {
set_crazy_vertex_quat(quats, co1, co2, co3, v1, v2, v3);
- efa->v1->tmp.p= (void*)quats;
- quats+= 4;
+ efa->v1->tmp.p = (void *)quats;
+ quats += 4;
}
- if(efa->v3->tmp.p==NULL && efa->v3->f1) {
+ if (efa->v3->tmp.p == NULL && efa->v3->f1) {
set_crazy_vertex_quat(quats, co3, co1, co2, v3, v1, v2);
- efa->v3->tmp.p= (void*)quats;
- quats+= 4;
+ efa->v3->tmp.p = (void *)quats;
+ quats += 4;
}
}
}
/* restore abused prev pointer */
- for(prev= NULL, eve= em->verts.first; eve; prev= eve, eve= eve->next)
- eve->prev= prev;
+ for (prev = NULL, eve = em->verts.first; eve; prev = eve, eve = eve->next)
+ eve->prev = prev;
#endif
}
@@ -266,61 +268,61 @@ void crazyspace_set_quats_mesh(Mesh *me, float *origcos, float *mappedcos, float
MFace *mface;
float *v1, *v2, *v3, *v4, *co1, *co2, *co3, *co4;
- mvert= me->mvert;
- for(i=0; i<me->totvert; i++, mvert++)
- mvert->flag&= ~ME_VERT_TMP_TAG;
+ mvert = me->mvert;
+ for (i = 0; i < me->totvert; i++, mvert++)
+ mvert->flag &= ~ME_VERT_TMP_TAG;
/* first store two sets of tangent vectors in vertices, we derive it just from the face-edges */
- mvert= me->mvert;
- mface= me->mface;
- for(i=0; i<me->totface; i++, mface++) {
+ mvert = me->mvert;
+ mface = me->mface;
+ for (i = 0; i < me->totface; i++, mface++) {
/* retrieve mapped coordinates */
- v1= mappedcos + 3*mface->v1;
- v2= mappedcos + 3*mface->v2;
- v3= mappedcos + 3*mface->v3;
+ v1 = mappedcos + 3 * mface->v1;
+ v2 = mappedcos + 3 * mface->v2;
+ v3 = mappedcos + 3 * mface->v3;
- co1= (origcos)? origcos + 3*mface->v1: mvert[mface->v1].co;
- co2= (origcos)? origcos + 3*mface->v2: mvert[mface->v2].co;
- co3= (origcos)? origcos + 3*mface->v3: mvert[mface->v3].co;
+ co1 = (origcos) ? origcos + 3 * mface->v1 : mvert[mface->v1].co;
+ co2 = (origcos) ? origcos + 3 * mface->v2 : mvert[mface->v2].co;
+ co3 = (origcos) ? origcos + 3 * mface->v3 : mvert[mface->v3].co;
- if((mvert[mface->v2].flag&ME_VERT_TMP_TAG)==0) {
- set_crazy_vertex_quat(&quats[mface->v2*4], co2, co3, co1, v2, v3, v1);
- mvert[mface->v2].flag|= ME_VERT_TMP_TAG;
+ if ((mvert[mface->v2].flag & ME_VERT_TMP_TAG) == 0) {
+ set_crazy_vertex_quat(&quats[mface->v2 * 4], co2, co3, co1, v2, v3, v1);
+ mvert[mface->v2].flag |= ME_VERT_TMP_TAG;
}
- if(mface->v4) {
- v4= mappedcos + 3*mface->v4;
- co4= (origcos)? origcos + 3*mface->v4: mvert[mface->v4].co;
+ if (mface->v4) {
+ v4 = mappedcos + 3 * mface->v4;
+ co4 = (origcos) ? origcos + 3 * mface->v4 : mvert[mface->v4].co;
- if((mvert[mface->v1].flag&ME_VERT_TMP_TAG)==0) {
- set_crazy_vertex_quat(&quats[mface->v1*4], co1, co2, co4, v1, v2, v4);
- mvert[mface->v1].flag|= ME_VERT_TMP_TAG;
+ if ((mvert[mface->v1].flag & ME_VERT_TMP_TAG) == 0) {
+ set_crazy_vertex_quat(&quats[mface->v1 * 4], co1, co2, co4, v1, v2, v4);
+ mvert[mface->v1].flag |= ME_VERT_TMP_TAG;
}
- if((mvert[mface->v3].flag&ME_VERT_TMP_TAG)==0) {
- set_crazy_vertex_quat(&quats[mface->v3*4], co3, co4, co2, v3, v4, v2);
- mvert[mface->v3].flag|= ME_VERT_TMP_TAG;
+ if ((mvert[mface->v3].flag & ME_VERT_TMP_TAG) == 0) {
+ set_crazy_vertex_quat(&quats[mface->v3 * 4], co3, co4, co2, v3, v4, v2);
+ mvert[mface->v3].flag |= ME_VERT_TMP_TAG;
}
- if((mvert[mface->v4].flag&ME_VERT_TMP_TAG)==0) {
- set_crazy_vertex_quat(&quats[mface->v4*4], co4, co1, co3, v4, v1, v3);
- mvert[mface->v4].flag|= ME_VERT_TMP_TAG;
+ if ((mvert[mface->v4].flag & ME_VERT_TMP_TAG) == 0) {
+ set_crazy_vertex_quat(&quats[mface->v4 * 4], co4, co1, co3, v4, v1, v3);
+ mvert[mface->v4].flag |= ME_VERT_TMP_TAG;
}
}
else {
- if((mvert[mface->v1].flag&ME_VERT_TMP_TAG)==0) {
- set_crazy_vertex_quat(&quats[mface->v1*4], co1, co2, co3, v1, v2, v3);
- mvert[mface->v1].flag|= ME_VERT_TMP_TAG;
+ if ((mvert[mface->v1].flag & ME_VERT_TMP_TAG) == 0) {
+ set_crazy_vertex_quat(&quats[mface->v1 * 4], co1, co2, co3, v1, v2, v3);
+ mvert[mface->v1].flag |= ME_VERT_TMP_TAG;
}
- if((mvert[mface->v3].flag&ME_VERT_TMP_TAG)==0) {
- set_crazy_vertex_quat(&quats[mface->v3*4], co3, co1, co2, v3, v1, v2);
- mvert[mface->v3].flag|= ME_VERT_TMP_TAG;
+ if ((mvert[mface->v3].flag & ME_VERT_TMP_TAG) == 0) {
+ set_crazy_vertex_quat(&quats[mface->v3 * 4], co3, co1, co2, v3, v1, v2);
+ mvert[mface->v3].flag |= ME_VERT_TMP_TAG;
}
}
}
}
int editbmesh_get_first_deform_matrices(Scene *scene, Object *ob, BMEditMesh *em,
- float (**deformmats)[3][3], float (**deformcos)[3])
+ float (**deformmats)[3][3], float (**deformcos)[3])
{
ModifierData *md;
DerivedMesh *dm;
@@ -334,40 +336,40 @@ 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 */
- for(i = 0; md && i <= cageIndex; i++, md = md->next) {
+ * 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);
- if(!editbmesh_modifier_is_enabled(scene, md, dm))
+ if (!editbmesh_modifier_is_enabled(scene, md, dm))
continue;
- if(mti->type==eModifierTypeType_OnlyDeform && mti->deformMatricesEM) {
- if(!defmats) {
- dm= getEditDerivedBMesh(em, ob, NULL);
- deformedVerts= editbmesh_get_vertex_cos(em, &numVerts);
- defmats= MEM_callocN(sizeof(*defmats)*numVerts, "defmats");
+ if (mti->type == eModifierTypeType_OnlyDeform && mti->deformMatricesEM) {
+ if (!defmats) {
+ dm = getEditDerivedBMesh(em, ob, NULL);
+ deformedVerts = editbmesh_get_vertex_cos(em, &numVerts);
+ defmats = MEM_callocN(sizeof(*defmats) * numVerts, "defmats");
- for(a=0; a<numVerts; a++)
+ for (a = 0; a < numVerts; a++)
unit_m3(defmats[a]);
}
mti->deformMatricesEM(md, ob, em, dm, deformedVerts, defmats,
- numVerts);
+ numVerts);
}
else
break;
}
- for(; md && i <= cageIndex; md = md->next, i++)
- if(editbmesh_modifier_is_enabled(scene, md, dm) && modifier_isCorrectableDeformed(md))
+ for (; md && i <= cageIndex; md = md->next, i++)
+ if (editbmesh_modifier_is_enabled(scene, md, dm) && modifier_isCorrectableDeformed(md))
numleft++;
- if(dm)
+ if (dm)
dm->release(dm);
- *deformmats= defmats;
- *deformcos= deformedVerts;
+ *deformmats = defmats;
+ *deformcos = deformedVerts;
return numleft;
}
@@ -376,99 +378,99 @@ int sculpt_get_first_deform_matrices(Scene *scene, Object *ob, float (**deformma
{
ModifierData *md;
DerivedMesh *dm;
- int a, numVerts= 0;
- float (*defmats)[3][3]= NULL, (*deformedVerts)[3]= NULL;
- MultiresModifierData *mmd= get_multires_modifier(scene, ob, 0);
+ int a, numVerts = 0;
+ float (*defmats)[3][3] = NULL, (*deformedVerts)[3] = NULL;
+ MultiresModifierData *mmd = get_multires_modifier(scene, ob, 0);
int has_multires = mmd != NULL && mmd->sculptlvl > 0;
- int numleft= 0;
+ int numleft = 0;
- if(has_multires) {
- *deformmats= NULL;
- *deformcos= NULL;
+ if (has_multires) {
+ *deformmats = NULL;
+ *deformcos = NULL;
return numleft;
}
- dm= NULL;
- md= modifiers_getVirtualModifierList(ob);
+ dm = NULL;
+ md = modifiers_getVirtualModifierList(ob);
- for(; md; md= md->next) {
- ModifierTypeInfo *mti= modifierType_getInfo(md->type);
+ for (; md; md = md->next) {
+ ModifierTypeInfo *mti = modifierType_getInfo(md->type);
- if(!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
+ if (!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
- if(mti->type==eModifierTypeType_OnlyDeform) {
- if(!defmats) {
- Mesh *me= (Mesh*)ob->data;
- dm= mesh_create_derived(me, ob, NULL);
- deformedVerts= mesh_getVertexCos(me, &numVerts);
- defmats= MEM_callocN(sizeof(*defmats)*numVerts, "defmats");
+ if (mti->type == eModifierTypeType_OnlyDeform) {
+ if (!defmats) {
+ Mesh *me = (Mesh *)ob->data;
+ dm = mesh_create_derived(me, ob, NULL);
+ deformedVerts = mesh_getVertexCos(me, &numVerts);
+ defmats = MEM_callocN(sizeof(*defmats) * numVerts, "defmats");
- for(a=0; a<numVerts; a++)
+ for (a = 0; a < numVerts; a++)
unit_m3(defmats[a]);
}
- if(mti->deformMatrices) mti->deformMatrices(md, ob, dm, deformedVerts, defmats, numVerts);
+ if (mti->deformMatrices) mti->deformMatrices(md, ob, dm, deformedVerts, defmats, numVerts);
else break;
}
}
- for(; md; md= md->next) {
- ModifierTypeInfo *mti= modifierType_getInfo(md->type);
+ for (; md; md = md->next) {
+ ModifierTypeInfo *mti = modifierType_getInfo(md->type);
- if(!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
+ if (!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
- if(mti->type==eModifierTypeType_OnlyDeform)
+ if (mti->type == eModifierTypeType_OnlyDeform)
numleft++;
}
- if(dm)
+ if (dm)
dm->release(dm);
- *deformmats= defmats;
- *deformcos= deformedVerts;
+ *deformmats = defmats;
+ *deformcos = deformedVerts;
return numleft;
}
void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3], float (**deformcos)[3])
{
- int totleft= sculpt_get_first_deform_matrices(scene, ob, deformmats, deformcos);
+ int totleft = sculpt_get_first_deform_matrices(scene, ob, deformmats, deformcos);
- if(totleft) {
+ 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);
- float *quats= NULL;
- int i, deformed= 0;
- ModifierData *md= modifiers_getVirtualModifierList(ob);
- Mesh *me= (Mesh*)ob->data;
+ float (*deformedVerts)[3] = *deformcos;
+ float (*origVerts)[3] = MEM_dupallocN(deformedVerts);
+ float *quats = NULL;
+ int i, deformed = 0;
+ ModifierData *md = modifiers_getVirtualModifierList(ob);
+ Mesh *me = (Mesh *)ob->data;
- for(; md; md= md->next) {
- ModifierTypeInfo *mti= modifierType_getInfo(md->type);
+ for (; md; md = md->next) {
+ ModifierTypeInfo *mti = modifierType_getInfo(md->type);
- if(!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
+ if (!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
- if(mti->type==eModifierTypeType_OnlyDeform) {
+ if (mti->type == eModifierTypeType_OnlyDeform) {
/* skip leading modifiers which have been already
- handled in sculpt_get_first_deform_matrices */
- if(mti->deformMatrices && !deformed)
+ * handled in sculpt_get_first_deform_matrices */
+ if (mti->deformMatrices && !deformed)
continue;
mti->deformVerts(md, ob, NULL, deformedVerts, me->totvert, 0, 0);
- deformed= 1;
+ deformed = 1;
}
}
- quats= MEM_mallocN(me->totvert*sizeof(float)*4, "crazy quats");
+ quats = MEM_mallocN(me->totvert * sizeof(float) * 4, "crazy quats");
- crazyspace_set_quats_mesh(me, (float*)origVerts, (float*)deformedVerts, quats);
+ crazyspace_set_quats_mesh(me, (float *)origVerts, (float *)deformedVerts, quats);
- for(i=0; i<me->totvert; i++) {
+ for (i = 0; i < me->totvert; i++) {
float qmat[3][3], tmat[3][3];
- quat_to_mat3(qmat, &quats[i*4]);
+ quat_to_mat3(qmat, &quats[i * 4]);
mul_m3_m3m3(tmat, qmat, (*deformmats)[i]);
copy_m3_m3((*deformmats)[i], tmat);
}
@@ -477,14 +479,14 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3
MEM_freeN(quats);
}
- if(!*deformmats) {
+ if (!*deformmats) {
int a, numVerts;
- Mesh *me= (Mesh*)ob->data;
+ Mesh *me = (Mesh *)ob->data;
- *deformcos= mesh_getVertexCos(me, &numVerts);
- *deformmats= MEM_callocN(sizeof(*(*deformmats))*numVerts, "defmats");
+ *deformcos = mesh_getVertexCos(me, &numVerts);
+ *deformmats = MEM_callocN(sizeof(*(*deformmats)) * numVerts, "defmats");
- for(a=0; a<numVerts; a++)
+ for (a = 0; a < numVerts; a++)
unit_m3((*deformmats)[a]);
}
}
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index 61b1dece957..5dce3d0a2fa 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -67,22 +67,22 @@
void ED_editors_init(bContext *C)
{
- Main *bmain= CTX_data_main(C);
- Scene *sce= CTX_data_scene(C);
- Object *ob, *obact= (sce && sce->basact)? sce->basact->object: NULL;
+ Main *bmain = CTX_data_main(C);
+ Scene *sce = CTX_data_scene(C);
+ Object *ob, *obact = (sce && sce->basact) ? sce->basact->object : NULL;
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. */
- for(ob=bmain->object.first; ob; ob=ob->id.next) {
- int mode= ob->mode;
+ * 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;
- if(mode && (mode != OB_MODE_POSE)) {
- ob->mode= 0;
- data= ob->data;
+ if (mode && (mode != OB_MODE_POSE)) {
+ ob->mode = 0;
+ data = ob->data;
- if(ob == obact && !ob->id.lib && !(data && data->lib))
+ if (ob == obact && !ob->id.lib && !(data && data->lib))
ED_object_toggle_modes(C, mode);
}
}
@@ -91,30 +91,30 @@ void ED_editors_init(bContext *C)
/* frees all editmode stuff */
void ED_editors_exit(bContext *C)
{
- Main *bmain= CTX_data_main(C);
+ Main *bmain = CTX_data_main(C);
Scene *sce;
- if(!bmain)
+ if (!bmain)
return;
/* frees all editmode undos */
undo_editmode_clear();
ED_undo_paint_free();
- for(sce=bmain->scene.first; sce; sce= sce->id.next) {
- if(sce->obedit) {
- Object *ob= sce->obedit;
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
+ if (sce->obedit) {
+ Object *ob = sce->obedit;
- if(ob) {
- if(ob->type==OB_MESH) {
- Mesh *me= ob->data;
- if(me->edit_btmesh) {
- EDBM_FreeEditBMesh(me->edit_btmesh);
+ if (ob) {
+ if (ob->type == OB_MESH) {
+ Mesh *me = ob->data;
+ if (me->edit_btmesh) {
+ EDBM_mesh_free(me->edit_btmesh);
MEM_freeN(me->edit_btmesh);
- me->edit_btmesh= NULL;
+ me->edit_btmesh = NULL;
}
}
- else if(ob->type==OB_ARMATURE) {
+ else if (ob->type == OB_ARMATURE) {
ED_armature_edit_free(ob);
}
}
@@ -135,17 +135,17 @@ void ED_editors_exit(bContext *C)
void apply_keyb_grid(int shift, int ctrl, float *val, float fac1, float fac2, float fac3, int invert)
{
/* fac1 is for 'nothing', fac2 for CTRL, fac3 for SHIFT */
- if(invert)
- ctrl= !ctrl;
+ if (invert)
+ ctrl = !ctrl;
- if(ctrl && shift) {
- if(fac3 != 0.0f) *val= fac3*floorf(*val/fac3 +0.5f);
+ if (ctrl && shift) {
+ if (fac3 != 0.0f) *val = fac3 * floorf(*val / fac3 + 0.5f);
}
- else if(ctrl) {
- if(fac2 != 0.0f) *val= fac2*floorf(*val/fac2 +0.5f);
+ else if (ctrl) {
+ if (fac2 != 0.0f) *val = fac2 * floorf(*val / fac2 + 0.5f);
}
else {
- if(fac1 != 0.0f) *val= fac1*floorf(*val/fac1 +0.5f);
+ if (fac1 != 0.0f) *val = fac1 * floorf(*val / fac1 + 0.5f);
}
}
@@ -154,7 +154,7 @@ int GetButStringLength(const char *str)
{
int rt;
- rt= UI_GetStringWidth(str);
+ rt = UI_GetStringWidth(str);
return rt + 15;
}
@@ -168,25 +168,25 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha
char line[FILE_MAX + 100];
wmOperatorType *ot = WM_operatortype_find(opname, 1);
- pup= uiPupMenuBegin(C, "Unpack file", ICON_NONE);
- layout= uiPupMenuLayout(pup);
+ pup = uiPupMenuBegin(C, "Unpack file", ICON_NONE);
+ layout = uiPupMenuLayout(pup);
strcpy(line, "Remove Pack");
- props_ptr= uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
RNA_enum_set(&props_ptr, "method", PF_REMOVE);
RNA_string_set(&props_ptr, "id", id_name);
- if(G.relbase_valid) {
+ if (G.relbase_valid) {
char local_name[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX];
BLI_strncpy(local_name, abs_name, sizeof(local_name));
BLI_splitdirstring(local_name, fi);
BLI_snprintf(local_name, sizeof(local_name), "//%s/%s", folder, fi);
- if(strcmp(abs_name, local_name)!=0) {
- switch(checkPackedFile(local_name, pf)) {
+ if (strcmp(abs_name, local_name) != 0) {
+ switch (checkPackedFile(local_name, pf)) {
case PF_NOFILE:
BLI_snprintf(line, sizeof(line), "Create %s", local_name);
- props_ptr= uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
RNA_enum_set(&props_ptr, "method", PF_WRITE_LOCAL);
RNA_string_set(&props_ptr, "id", id_name);
@@ -194,7 +194,7 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha
case PF_EQUAL:
BLI_snprintf(line, sizeof(line), "Use %s (identical)", local_name);
//uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_USE_LOCAL);
- props_ptr= uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
RNA_enum_set(&props_ptr, "method", PF_USE_LOCAL);
RNA_string_set(&props_ptr, "id", id_name);
@@ -202,13 +202,13 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha
case PF_DIFFERS:
BLI_snprintf(line, sizeof(line), "Use %s (differs)", local_name);
//uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_USE_LOCAL);
- props_ptr= uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
RNA_enum_set(&props_ptr, "method", PF_USE_LOCAL);
RNA_string_set(&props_ptr, "id", id_name);
BLI_snprintf(line, sizeof(line), "Overwrite %s", local_name);
//uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_WRITE_LOCAL);
- props_ptr= uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
RNA_enum_set(&props_ptr, "method", PF_WRITE_LOCAL);
RNA_string_set(&props_ptr, "id", id_name);
break;
@@ -216,31 +216,31 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha
}
}
- switch(checkPackedFile(abs_name, pf)) {
+ switch (checkPackedFile(abs_name, pf)) {
case PF_NOFILE:
BLI_snprintf(line, sizeof(line), "Create %s", abs_name);
//uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_WRITE_ORIGINAL);
- props_ptr= uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
RNA_enum_set(&props_ptr, "method", PF_WRITE_ORIGINAL);
RNA_string_set(&props_ptr, "id", id_name);
break;
case PF_EQUAL:
BLI_snprintf(line, sizeof(line), "Use %s (identical)", abs_name);
//uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_USE_ORIGINAL);
- props_ptr= uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
RNA_enum_set(&props_ptr, "method", PF_USE_ORIGINAL);
RNA_string_set(&props_ptr, "id", id_name);
break;
case PF_DIFFERS:
BLI_snprintf(line, sizeof(line), "Use %s (differs)", abs_name);
//uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_USE_ORIGINAL);
- props_ptr= uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
RNA_enum_set(&props_ptr, "method", PF_USE_ORIGINAL);
RNA_string_set(&props_ptr, "id", id_name);
BLI_snprintf(line, sizeof(line), "Overwrite %s", abs_name);
//uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_WRITE_ORIGINAL);
- props_ptr= uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
RNA_enum_set(&props_ptr, "method", PF_WRITE_ORIGINAL);
RNA_string_set(&props_ptr, "id", id_name);
break;
diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c
index 4776cf0af53..ac0f8306259 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 ***** */
@@ -85,113 +83,113 @@ static void error(const char *UNUSED(arg)) {}
/* ****** XXX ***** */
-#define MAXUNDONAME 64
+#define MAXUNDONAME 64
typedef struct UndoElem {
struct UndoElem *next, *prev;
- ID id; // copy of editmode object ID
- Object *ob; // pointer to edited object
- int type; // type of edited object
+ ID id; // copy of editmode object ID
+ Object *ob; // pointer to edited object
+ int type; // type of edited object
void *undodata;
uintptr_t undosize;
char name[MAXUNDONAME];
- void * (*getdata)(bContext *C);
+ void * (*getdata)(bContext * C);
void (*freedata)(void *);
void (*to_editmode)(void *, void *, void *);
void * (*from_editmode)(void *, void *);
int (*validate_undo)(void *, void *);
} UndoElem;
-static ListBase undobase={NULL, NULL};
-static UndoElem *curundo= NULL;
+static ListBase undobase = {NULL, NULL};
+static UndoElem *curundo = NULL;
/* ********************* xtern api calls ************* */
static void undo_restore(UndoElem *undo, void *editdata, void *obdata)
{
- if(undo) {
+ if (undo) {
undo->to_editmode(undo->undodata, editdata, obdata);
}
}
/* name can be a dynamic string */
void undo_editmode_push(bContext *C, const char *name,
- void * (*getdata)(bContext *C),
- void (*freedata)(void *),
- void (*to_editmode)(void *, void *, void *),
- void *(*from_editmode)(void *, void *),
- int (*validate_undo)(void *, void *))
+ void * (*getdata)(bContext * C),
+ void (*freedata)(void *),
+ void (*to_editmode)(void *, void *, void *),
+ void *(*from_editmode)(void *, void *),
+ int (*validate_undo)(void *, void *))
{
UndoElem *uel;
- Object *obedit= CTX_data_edit_object(C);
+ Object *obedit = CTX_data_edit_object(C);
void *editdata;
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) {
- uel= undobase.last;
+ while (undobase.last != curundo) {
+ uel = undobase.last;
uel->freedata(uel->undodata);
BLI_freelinkN(&undobase, uel);
}
/* make new */
- curundo= uel= MEM_callocN(sizeof(UndoElem), "undo editmode");
+ curundo = uel = MEM_callocN(sizeof(UndoElem), "undo editmode");
BLI_strncpy(uel->name, name, sizeof(uel->name));
BLI_addtail(&undobase, uel);
- uel->getdata= getdata;
- uel->freedata= freedata;
- uel->to_editmode= to_editmode;
- uel->from_editmode= from_editmode;
- uel->validate_undo= validate_undo;
+ uel->getdata = getdata;
+ uel->freedata = freedata;
+ uel->to_editmode = to_editmode;
+ uel->from_editmode = from_editmode;
+ uel->validate_undo = validate_undo;
/* limit amount to the maximum amount*/
- nr= 0;
- uel= undobase.last;
- while(uel) {
+ nr = 0;
+ uel = undobase.last;
+ while (uel) {
nr++;
- if(nr==U.undosteps) break;
- uel= uel->prev;
+ if (nr == U.undosteps) break;
+ uel = uel->prev;
}
- if(uel) {
- while(undobase.first!=uel) {
- UndoElem *first= undobase.first;
+ if (uel) {
+ while (undobase.first != uel) {
+ UndoElem *first = undobase.first;
first->freedata(first->undodata);
BLI_freelinkN(&undobase, first);
}
}
/* copy */
- memused= MEM_get_memory_in_use();
- editdata= getdata(C);
- curundo->undodata= curundo->from_editmode(editdata, obedit->data);
- curundo->undosize= MEM_get_memory_in_use() - memused;
- curundo->ob= obedit;
- curundo->id= obedit->id;
- curundo->type= obedit->type;
-
- if(U.undomemory != 0) {
+ memused = MEM_get_memory_in_use();
+ editdata = getdata(C);
+ curundo->undodata = curundo->from_editmode(editdata, obedit->data);
+ curundo->undosize = MEM_get_memory_in_use() - memused;
+ curundo->ob = obedit;
+ curundo->id = obedit->id;
+ curundo->type = obedit->type;
+
+ if (U.undomemory != 0) {
/* limit to maximum memory (afterwards, we can't know in advance) */
- totmem= 0;
- maxmem= ((uintptr_t)U.undomemory)*1024*1024;
-
- uel= undobase.last;
- while(uel && uel->prev) {
- totmem+= uel->undosize;
- if(totmem>maxmem) break;
- uel= uel->prev;
+ totmem = 0;
+ maxmem = ((uintptr_t)U.undomemory) * 1024 * 1024;
+
+ uel = undobase.last;
+ while (uel && uel->prev) {
+ totmem += uel->undosize;
+ if (totmem > maxmem) break;
+ uel = uel->prev;
}
- if(uel) {
- if(uel->prev && uel->prev->prev)
- uel= uel->prev;
+ if (uel) {
+ if (uel->prev && uel->prev->prev)
+ uel = uel->prev;
- while(undobase.first!=uel) {
- UndoElem *first= undobase.first;
+ while (undobase.first != uel) {
+ UndoElem *first = undobase.first;
first->freedata(first->undodata);
BLI_freelinkN(&undobase, first);
}
@@ -203,75 +201,75 @@ void undo_editmode_push(bContext *C, const char *name,
static void undo_clean_stack(bContext *C)
{
UndoElem *uel, *next;
- Object *obedit= CTX_data_edit_object(C);
+ Object *obedit = CTX_data_edit_object(C);
/* global undo changes pointers, so we also allow identical names */
/* side effect: when deleting/renaming object and start editing new one with same name */
- uel= undobase.first;
- while(uel) {
- void *editdata= uel->getdata(C);
- int isvalid= 0;
- next= uel->next;
+ uel = undobase.first;
+ while (uel) {
+ void *editdata = uel->getdata(C);
+ int isvalid = 0;
+ next = uel->next;
/* for when objects are converted, renamed, or global undo changes pointers... */
- if(uel->type==obedit->type) {
- if(strcmp(uel->id.name, obedit->id.name)==0) {
- if(uel->validate_undo==NULL)
- isvalid= 1;
- else if(uel->validate_undo(uel->undodata, editdata))
- isvalid= 1;
+ if (uel->type == obedit->type) {
+ if (strcmp(uel->id.name, obedit->id.name) == 0) {
+ if (uel->validate_undo == NULL)
+ isvalid = 1;
+ else if (uel->validate_undo(uel->undodata, editdata))
+ isvalid = 1;
}
}
- if(isvalid)
- uel->ob= obedit;
+ if (isvalid)
+ uel->ob = obedit;
else {
- if(uel == curundo)
- curundo= NULL;
+ if (uel == curundo)
+ curundo = NULL;
uel->freedata(uel->undodata);
BLI_freelinkN(&undobase, uel);
}
- uel= next;
+ uel = next;
}
- if(curundo == NULL) curundo= undobase.last;
+ if (curundo == NULL) curundo = undobase.last;
}
/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation */
void undo_editmode_step(bContext *C, int step)
{
- Object *obedit= CTX_data_edit_object(C);
+ Object *obedit = CTX_data_edit_object(C);
/* prevent undo to happen on wrong object, stack can be a mix */
undo_clean_stack(C);
- if(step==0) {
+ if (step == 0) {
undo_restore(curundo, curundo->getdata(C), obedit->data);
}
- else if(step==1) {
+ else if (step == 1) {
- if(curundo==NULL || curundo->prev==NULL) error("No more steps to undo");
+ if (curundo == NULL || curundo->prev == NULL) error("No more steps to undo");
else {
- if(G.f & G_DEBUG) printf("undo %s\n", curundo->name);
- curundo= curundo->prev;
+ if (G.debug & G_DEBUG) printf("undo %s\n", curundo->name);
+ curundo = curundo->prev;
undo_restore(curundo, curundo->getdata(C), obedit->data);
}
}
else {
/* curundo has to remain current situation! */
- if(curundo==NULL || curundo->next==NULL) error("No more steps to redo");
+ if (curundo == NULL || curundo->next == NULL) error("No more steps to redo");
else {
undo_restore(curundo->next, curundo->getdata(C), obedit->data);
- curundo= curundo->next;
- if(G.f & G_DEBUG) printf("redo %s\n", curundo->name);
+ curundo = curundo->next;
+ if (G.debug & G_DEBUG) printf("redo %s\n", curundo->name);
}
}
/* special case for editmesh, mode must be copied back to the scene */
- if(obedit->type == OB_MESH) {
+ if (obedit->type == OB_MESH) {
EDBM_selectmode_to_scene(C);
}
@@ -284,25 +282,25 @@ void undo_editmode_clear(void)
{
UndoElem *uel;
- uel= undobase.first;
- while(uel) {
+ uel = undobase.first;
+ while (uel) {
uel->freedata(uel->undodata);
- uel= uel->next;
+ uel = uel->next;
}
BLI_freelistN(&undobase);
- curundo= NULL;
+ curundo = NULL;
}
/* based on index nr it does a restore */
void undo_editmode_number(bContext *C, int nr)
{
UndoElem *uel;
- int a=1;
+ int a = 1;
- for(uel= undobase.first; uel; uel= uel->next, a++) {
- if(a==nr) break;
+ for (uel = undobase.first; uel; uel = uel->next, a++) {
+ if (a == nr) break;
}
- curundo= uel;
+ curundo = uel;
undo_editmode_step(C, 0);
}
@@ -310,12 +308,12 @@ void undo_editmode_name(bContext *C, const char *undoname)
{
UndoElem *uel;
- for(uel= undobase.last; uel; uel= uel->prev) {
- if(strcmp(undoname, uel->name)==0)
+ for (uel = undobase.last; uel; uel = uel->prev) {
+ if (strcmp(undoname, uel->name) == 0)
break;
}
- if(uel && uel->prev) {
- curundo= uel->prev;
+ if (uel && uel->prev) {
+ curundo = uel->prev;
undo_editmode_step(C, 0);
}
}
@@ -323,11 +321,11 @@ void undo_editmode_name(bContext *C, const char *undoname)
/* undoname optionally, if NULL it just checks for existing undo steps */
int undo_editmode_valid(const char *undoname)
{
- if(undoname) {
+ if (undoname) {
UndoElem *uel;
- for(uel= undobase.last; uel; uel= uel->prev) {
- if(strcmp(undoname, uel->name)==0)
+ for (uel = undobase.last; uel; uel = uel->prev) {
+ if (strcmp(undoname, uel->name) == 0)
break;
}
return uel != NULL;
@@ -345,12 +343,12 @@ const char *undo_editmode_get_name(bContext *C, int nr, int *active)
/* prevent wrong numbers to be returned */
undo_clean_stack(C);
- if(active) *active= 0;
+ if (active) *active = 0;
- uel= BLI_findlink(&undobase, nr);
- if(uel) {
- if(active && uel==curundo)
- *active= 1;
+ uel = BLI_findlink(&undobase, nr);
+ if (uel) {
+ if (active && uel == curundo)
+ *active = 1;
return uel->name;
}
return NULL;
@@ -359,7 +357,7 @@ const char *undo_editmode_get_name(bContext *C, int nr, int *active)
void *undo_editmode_get_prev(Object *ob)
{
- UndoElem *ue= undobase.last;
- if(ue && ue->prev && ue->prev->ob==ob) return ue->prev->undodata;
+ UndoElem *ue = undobase.last;
+ if (ue && ue->prev && ue->prev->ob == ob) return ue->prev->undodata;
return NULL;
}
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index 52422d37f29..c037508687b 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -30,8 +30,8 @@
*/
-#include <math.h> /* fabs */
-#include <stdio.h> /* for size_t */
+#include <math.h> /* fabs */
+#include <stdio.h> /* for size_t */
#include "BLI_utildefines.h"
#include "BLI_string.h"
@@ -46,19 +46,19 @@
void initNumInput(NumInput *n)
{
- n->flag =
- n->idx =
- n->idx_max =
+ n->flag =
+ n->idx =
+ n->idx_max =
n->inv[0] =
n->inv[1] =
n->inv[2] =
- n->ctrl[0] =
- n->ctrl[1] =
- n->ctrl[2] = 0;
+ n->ctrl[0] =
+ n->ctrl[1] =
+ n->ctrl[2] = 0;
- n->val[0] =
- n->val[1] =
- n->val[2] = 0.0f;
+ n->val[0] =
+ n->val[1] =
+ n->val[2] = 0.0f;
}
void outputNumInput(NumInput *n, char *str)
@@ -67,7 +67,7 @@ void outputNumInput(NumInput *n, char *str)
char inv[] = "1/";
short i, j;
- for (j=0; j<=n->idx_max; j++) {
+ for (j = 0; j <= n->idx_max; j++) {
/* if AFFECTALL and no number typed and cursor not on number, use first number */
if (n->flag & NUM_AFFECT_ALL && n->idx != j && n->ctrl[j] == 0)
i = 0;
@@ -84,35 +84,35 @@ void outputNumInput(NumInput *n, char *str)
else
inv[0] = 0;
- if( n->val[i] > 1e10f || n->val[i] < -1e10f )
- BLI_snprintf(&str[j*20], 20, "%s%.4e%c", inv, n->val[i], cur);
+ if (n->val[i] > 1e10f || n->val[i] < -1e10f)
+ BLI_snprintf(&str[j * 20], 20, "%s%.4e%c", inv, n->val[i], cur);
else
switch (n->ctrl[i]) {
- case 0:
- BLI_snprintf(&str[j*20], 20, "%sNONE%c", inv, cur);
- break;
- case 1:
- case -1:
- BLI_snprintf(&str[j*20], 20, "%s%.0f%c", inv, n->val[i], cur);
- break;
- case 10:
- case -10:
- BLI_snprintf(&str[j*20], 20, "%s%.f.%c", inv, n->val[i], cur);
- break;
- case 100:
- case -100:
- BLI_snprintf(&str[j*20], 20, "%s%.1f%c", inv, n->val[i], cur);
- break;
- case 1000:
- case -1000:
- BLI_snprintf(&str[j*20], 20, "%s%.2f%c", inv, n->val[i], cur);
- break;
- case 10000:
- case -10000:
- BLI_snprintf(&str[j*20], 20, "%s%.3f%c", inv, n->val[i], cur);
- break;
- default:
- BLI_snprintf(&str[j*20], 20, "%s%.4e%c", inv, n->val[i], cur);
+ case 0:
+ BLI_snprintf(&str[j * 20], 20, "%sNONE%c", inv, cur);
+ break;
+ case 1:
+ case -1:
+ BLI_snprintf(&str[j * 20], 20, "%s%.0f%c", inv, n->val[i], cur);
+ break;
+ case 10:
+ case -10:
+ BLI_snprintf(&str[j * 20], 20, "%s%.f.%c", inv, n->val[i], cur);
+ break;
+ case 100:
+ case -100:
+ BLI_snprintf(&str[j * 20], 20, "%s%.1f%c", inv, n->val[i], cur);
+ break;
+ case 1000:
+ case -1000:
+ BLI_snprintf(&str[j * 20], 20, "%s%.2f%c", inv, n->val[i], cur);
+ break;
+ case 10000:
+ case -10000:
+ BLI_snprintf(&str[j * 20], 20, "%s%.3f%c", inv, n->val[i], cur);
+ break;
+ default:
+ BLI_snprintf(&str[j * 20], 20, "%s%.4e%c", inv, n->val[i], cur);
}
}
}
@@ -121,7 +121,7 @@ short hasNumInput(NumInput *n)
{
short i;
- for (i=0; i<=n->idx_max; i++) {
+ for (i = 0; i <= n->idx_max; i++) {
if (n->ctrl[i])
return 1;
}
@@ -134,7 +134,7 @@ void applyNumInput(NumInput *n, float *vec)
short i, j;
if (hasNumInput(n)) {
- for (j=0; j<=n->idx_max; j++) {
+ for (j = 0; j <= n->idx_max; j++) {
/* if AFFECTALL and no number typed and cursor not on number, use first number */
if (n->flag & NUM_AFFECT_ALL && n->idx != j && n->ctrl[j] == 0)
i = 0;
@@ -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];
}
}
@@ -168,137 +166,138 @@ char handleNumInput(NumInput *n, wmEvent *event)
if (event->type == EVT_MODAL_MAP) {
switch (event->val) {
- case NUM_MODAL_INCREMENT_UP:
- if (!n->ctrl[idx])
- n->ctrl[idx] = 1;
+ case NUM_MODAL_INCREMENT_UP:
+ if (!n->ctrl[idx])
+ n->ctrl[idx] = 1;
- n->val[idx] += n->increment;
- break;
- case NUM_MODAL_INCREMENT_DOWN:
- if (!n->ctrl[idx])
- n->ctrl[idx] = 1;
+ n->val[idx] += n->increment;
+ break;
+ case NUM_MODAL_INCREMENT_DOWN:
+ if (!n->ctrl[idx])
+ n->ctrl[idx] = 1;
- n->val[idx] -= n->increment;
- break;
- default:
- return 0;
+ n->val[idx] -= n->increment;
+ break;
+ default:
+ return 0;
}
- } else {
+ }
+ else {
switch (event->type) {
- case BACKSPACEKEY:
- if (n->ctrl[idx] == 0) {
- n->val[0] =
- n->val[1] =
- n->val[2] = 0.0f;
- n->ctrl[0] =
- n->ctrl[1] =
- n->ctrl[2] = 0;
- n->inv[0] =
- n->inv[1] =
- n->inv[2] = 0;
- }
- else {
- n->val[idx] = 0.0f;
- n->ctrl[idx] = 0;
- n->inv[idx] = 0;
- }
- break;
- case PERIODKEY:
- case PADPERIOD:
- if (n->flag & NUM_NO_FRACTION)
- return 0;
-
- switch (n->ctrl[idx])
- {
- case 0:
- case 1:
- n->ctrl[idx] = 10;
- break;
- case -1:
- n->ctrl[idx] = -10;
- }
- break;
- case PADMINUS:
- if(event->alt)
+ case BACKSPACEKEY:
+ if (n->ctrl[idx] == 0) {
+ n->val[0] =
+ n->val[1] =
+ n->val[2] = 0.0f;
+ n->ctrl[0] =
+ n->ctrl[1] =
+ n->ctrl[2] = 0;
+ n->inv[0] =
+ n->inv[1] =
+ n->inv[2] = 0;
+ }
+ else {
+ n->val[idx] = 0.0f;
+ n->ctrl[idx] = 0;
+ n->inv[idx] = 0;
+ }
break;
- case MINUSKEY:
- if (n->flag & NUM_NO_NEGATIVE)
+ case PERIODKEY:
+ case PADPERIOD:
+ if (n->flag & NUM_NO_FRACTION)
+ return 0;
+
+ switch (n->ctrl[idx])
+ {
+ case 0:
+ case 1:
+ n->ctrl[idx] = 10;
+ break;
+ case -1:
+ n->ctrl[idx] = -10;
+ }
break;
+ case PADMINUS:
+ if (event->alt)
+ break;
+ case MINUSKEY:
+ if (n->flag & NUM_NO_NEGATIVE)
+ break;
- if (n->ctrl[idx]) {
- n->ctrl[idx] *= -1;
- n->val[idx] *= -1;
- }
- else
- n->ctrl[idx] = -1;
- break;
- case PADSLASHKEY:
- case SLASHKEY:
- if (n->flag & NUM_NO_FRACTION)
- return 0;
+ if (n->ctrl[idx]) {
+ n->ctrl[idx] *= -1;
+ n->val[idx] *= -1;
+ }
+ else
+ n->ctrl[idx] = -1;
+ break;
+ case PADSLASHKEY:
+ case SLASHKEY:
+ if (n->flag & NUM_NO_FRACTION)
+ return 0;
- n->inv[idx] = !n->inv[idx];
- break;
- case TABKEY:
- if (idx_max == 0)
- return 0;
+ n->inv[idx] = !n->inv[idx];
+ break;
+ case TABKEY:
+ if (idx_max == 0)
+ return 0;
- idx++;
- if (idx > idx_max)
- idx = 0;
- n->idx = idx;
- break;
- case PAD9:
- case NINEKEY:
- Val += 1.0f;
- case PAD8:
- case EIGHTKEY:
- Val += 1.0f;
- case PAD7:
- case SEVENKEY:
- Val += 1.0f;
- case PAD6:
- case SIXKEY:
- Val += 1.0f;
- case PAD5:
- case FIVEKEY:
- Val += 1.0f;
- case PAD4:
- case FOURKEY:
- Val += 1.0f;
- case PAD3:
- case THREEKEY:
- Val += 1.0f;
- case PAD2:
- case TWOKEY:
- Val += 1.0f;
- case PAD1:
- case ONEKEY:
- Val += 1.0f;
- case PAD0:
- case ZEROKEY:
- if (!n->ctrl[idx])
- n->ctrl[idx] = 1;
+ idx++;
+ if (idx > idx_max)
+ idx = 0;
+ n->idx = idx;
+ break;
+ case PAD9:
+ case NINEKEY:
+ Val += 1.0f;
+ case PAD8:
+ case EIGHTKEY:
+ Val += 1.0f;
+ case PAD7:
+ case SEVENKEY:
+ Val += 1.0f;
+ case PAD6:
+ case SIXKEY:
+ Val += 1.0f;
+ case PAD5:
+ case FIVEKEY:
+ Val += 1.0f;
+ case PAD4:
+ case FOURKEY:
+ Val += 1.0f;
+ case PAD3:
+ case THREEKEY:
+ Val += 1.0f;
+ case PAD2:
+ case TWOKEY:
+ Val += 1.0f;
+ case PAD1:
+ case ONEKEY:
+ Val += 1.0f;
+ case PAD0:
+ case ZEROKEY:
+ if (!n->ctrl[idx])
+ n->ctrl[idx] = 1;
- if (fabsf(n->val[idx]) > 9999999.0f);
- else if (n->ctrl[idx] == 1) {
- n->val[idx] *= 10;
- n->val[idx] += Val;
- }
- else if (n->ctrl[idx] == -1) {
- n->val[idx] *= 10;
- n->val[idx] -= Val;
- }
- else {
- /* float resolution breaks when over six digits after comma */
- if( ABS(n->ctrl[idx]) < 10000000) {
- n->val[idx] += Val / (float)n->ctrl[idx];
- n->ctrl[idx] *= 10;
+ if (fabsf(n->val[idx]) > 9999999.0f) ;
+ else if (n->ctrl[idx] == 1) {
+ n->val[idx] *= 10;
+ n->val[idx] += Val;
}
- }
- break;
- default:
- return 0;
+ else if (n->ctrl[idx] == -1) {
+ n->val[idx] *= 10;
+ n->val[idx] -= Val;
+ }
+ else {
+ /* float resolution breaks when over six digits after comma */
+ if (ABS(n->ctrl[idx]) < 10000000) {
+ n->val[idx] += Val / (float)n->ctrl[idx];
+ n->ctrl[idx] *= 10;
+ }
+ }
+ break;
+ default:
+ return 0;
}
}
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index 6ab68d2261e..ac264c1a6af 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -48,8 +48,6 @@
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_screen.h"
-#include "BKE_tessmesh.h" /* BMESH_EM_UNDO_RECALC_TESSFACE_WORKAROUND */
-
#include "ED_armature.h"
#include "ED_particle.h"
@@ -80,65 +78,52 @@
void ED_undo_push(bContext *C, const char *str)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- Object *obedit= CTX_data_edit_object(C);
- Object *obact= CTX_data_active_object(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Object *obact = CTX_data_active_object(C);
- if (G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("undo push %s\n", str);
- if(obedit) {
-
-#ifdef BMESH_EM_UNDO_RECALC_TESSFACE_WORKAROUND
- /* undo is causing tessface recalc, so without we need to do explicitly */
-
- if (U.undosteps == 0) {
- if (obedit->type == OB_MESH) {
- Mesh *me= obedit->data;
- BMEdit_RecalcTesselation(me->edit_btmesh);
- }
- }
-
-#endif /* BMESH_EM_UNDO_RECALC_TESSFACE_WORKAROUND */
-
+ if (obedit) {
if (U.undosteps == 0) return;
- if(obedit->type==OB_MESH)
+ if (obedit->type == OB_MESH)
undo_push_mesh(C, str);
- else if ELEM(obedit->type, OB_CURVE, OB_SURF)
+ else if (ELEM(obedit->type, OB_CURVE, OB_SURF))
undo_push_curve(C, str);
- else if (obedit->type==OB_FONT)
+ else if (obedit->type == OB_FONT)
undo_push_font(C, str);
- else if (obedit->type==OB_MBALL)
+ else if (obedit->type == OB_MBALL)
undo_push_mball(C, str);
- else if (obedit->type==OB_LATTICE)
+ else if (obedit->type == OB_LATTICE)
undo_push_lattice(C, str);
- else if (obedit->type==OB_ARMATURE)
+ else if (obedit->type == OB_ARMATURE)
undo_push_armature(C, str);
}
- else if(obact && obact->mode & OB_MODE_PARTICLE_EDIT) {
+ else if (obact && obact->mode & OB_MODE_PARTICLE_EDIT) {
if (U.undosteps == 0) return;
PE_undo_push(CTX_data_scene(C), str);
}
else {
- if(U.uiflag & USER_GLOBALUNDO)
+ if (U.uiflag & USER_GLOBALUNDO)
BKE_write_undo(C, str);
}
- if(wm->file_saved) {
- wm->file_saved= 0;
+ if (wm->file_saved) {
+ wm->file_saved = 0;
/* notifier that data changed, for save-over warning or header */
- WM_event_add_notifier(C, NC_WM|ND_DATACHANGED, NULL);
+ WM_event_add_notifier(C, NC_WM | ND_DATACHANGED, NULL);
}
}
/* note: also check undo_history_exec() in bottom if you change notifiers */
static int ed_undo_step(bContext *C, int step, const char *undoname)
{
- Object *obedit= CTX_data_edit_object(C);
- Object *obact= CTX_data_active_object(C);
- ScrArea *sa= CTX_wm_area(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Object *obact = CTX_data_active_object(C);
+ ScrArea *sa = CTX_wm_area(C);
/* undo during jobs are running can easily lead to freeing data using by jobs,
* or they can just lead to freezing job in some other cases */
@@ -147,16 +132,16 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
}
/* grease pencil can be can be used in plenty of spaces, so check it first */
- if(ED_gpencil_session_active()) {
+ if (ED_gpencil_session_active()) {
return ED_undo_gpencil_step(C, step, undoname);
}
- if(sa && sa->spacetype==SPACE_IMAGE) {
- SpaceImage *sima= (SpaceImage *)sa->spacedata.first;
+ if (sa && sa->spacetype == SPACE_IMAGE) {
+ SpaceImage *sima = (SpaceImage *)sa->spacedata.first;
- if((obact && obact->mode & OB_MODE_TEXTURE_PAINT) || sima->flag & SI_DRAWTOOL) {
- if(!ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step, undoname) && undoname)
- if(U.uiflag & USER_GLOBALUNDO)
+ if ((obact && obact->mode & OB_MODE_TEXTURE_PAINT) || sima->flag & SI_DRAWTOOL) {
+ if (!ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step, undoname) && undoname)
+ if (U.uiflag & USER_GLOBALUNDO)
BKE_undo_name(C, undoname);
WM_event_add_notifier(C, NC_WINDOW, NULL);
@@ -164,52 +149,52 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
}
}
- if(sa && sa->spacetype==SPACE_TEXT) {
+ if (sa && sa->spacetype == SPACE_TEXT) {
ED_text_undo_step(C, step);
}
- else if(obedit) {
- if ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE) {
- if(undoname)
+ else if (obedit) {
+ if (ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)) {
+ if (undoname)
undo_editmode_name(C, undoname);
else
undo_editmode_step(C, step);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, NULL);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, NULL);
}
}
else {
- int do_glob_undo= 0;
+ int do_glob_undo = 0;
- if(obact && obact->mode & OB_MODE_TEXTURE_PAINT) {
- if(!ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step, undoname))
- do_glob_undo= 1;
+ if (obact && obact->mode & OB_MODE_TEXTURE_PAINT) {
+ if (!ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step, undoname))
+ do_glob_undo = 1;
}
- else if(obact && obact->mode & OB_MODE_SCULPT) {
- if(!ED_undo_paint_step(C, UNDO_PAINT_MESH, step, undoname))
- do_glob_undo= 1;
+ else if (obact && obact->mode & OB_MODE_SCULPT) {
+ if (!ED_undo_paint_step(C, UNDO_PAINT_MESH, step, undoname))
+ do_glob_undo = 1;
}
- else if(obact && obact->mode & OB_MODE_PARTICLE_EDIT) {
- if(step==1)
+ else if (obact && obact->mode & OB_MODE_PARTICLE_EDIT) {
+ if (step == 1)
PE_undo(CTX_data_scene(C));
else
PE_redo(CTX_data_scene(C));
}
else {
- do_glob_undo= 1;
+ do_glob_undo = 1;
}
- if(do_glob_undo) {
- if(U.uiflag & USER_GLOBALUNDO) {
+ if (do_glob_undo) {
+ if (U.uiflag & USER_GLOBALUNDO) {
// note python defines not valid here anymore.
//#ifdef WITH_PYTHON
// XXX BPY_scripts_clear_pyobjects();
//#endif
- if(undoname)
+ if (undoname)
BKE_undo_name(C, undoname);
else
BKE_undo_step(C, step);
- WM_event_add_notifier(C, NC_SCENE|ND_LAYER_CONTENT, CTX_data_scene(C));
+ WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, CTX_data_scene(C));
}
}
@@ -244,23 +229,23 @@ void ED_undo_pop_op(bContext *C, wmOperator *op)
/* name optionally, function used to check for operator redo panel */
int ED_undo_valid(const bContext *C, const char *undoname)
{
- Object *obedit= CTX_data_edit_object(C);
- Object *obact= CTX_data_active_object(C);
- ScrArea *sa= CTX_wm_area(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Object *obact = CTX_data_active_object(C);
+ ScrArea *sa = CTX_wm_area(C);
- if(sa && sa->spacetype==SPACE_IMAGE) {
- SpaceImage *sima= (SpaceImage *)sa->spacedata.first;
+ if (sa && sa->spacetype == SPACE_IMAGE) {
+ SpaceImage *sima = (SpaceImage *)sa->spacedata.first;
- if((obact && obact->mode & OB_MODE_TEXTURE_PAINT) || sima->flag & SI_DRAWTOOL) {
+ if ((obact && obact->mode & OB_MODE_TEXTURE_PAINT) || sima->flag & SI_DRAWTOOL) {
return 1;
}
}
- if(sa && sa->spacetype==SPACE_TEXT) {
+ if (sa && sa->spacetype == SPACE_TEXT) {
return 1;
}
- else if(obedit) {
- if ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE) {
+ else if (obedit) {
+ if (ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)) {
return undo_editmode_valid(undoname);
}
}
@@ -268,19 +253,19 @@ int ED_undo_valid(const bContext *C, const char *undoname)
/* if below tests fail, global undo gets executed */
- if(obact && obact->mode & OB_MODE_TEXTURE_PAINT) {
- if( ED_undo_paint_valid(UNDO_PAINT_IMAGE, undoname) )
+ if (obact && obact->mode & OB_MODE_TEXTURE_PAINT) {
+ if (ED_undo_paint_valid(UNDO_PAINT_IMAGE, undoname) )
return 1;
}
- else if(obact && obact->mode & OB_MODE_SCULPT) {
- if( ED_undo_paint_valid(UNDO_PAINT_MESH, undoname) )
+ else if (obact && obact->mode & OB_MODE_SCULPT) {
+ if (ED_undo_paint_valid(UNDO_PAINT_MESH, undoname) )
return 1;
}
- else if(obact && obact->mode & OB_MODE_PARTICLE_EDIT) {
+ else if (obact && obact->mode & OB_MODE_PARTICLE_EDIT) {
return PE_undo_valid(CTX_data_scene(C));
}
- if(U.uiflag & USER_GLOBALUNDO) {
+ if (U.uiflag & USER_GLOBALUNDO) {
return BKE_undo_valid(undoname);
}
}
@@ -313,26 +298,26 @@ static int ed_redo_exec(bContext *C, wmOperator *UNUSED(op))
void ED_OT_undo(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Undo";
- ot->description= "Undo previous action";
- ot->idname= "ED_OT_undo";
+ ot->name = "Undo";
+ ot->description = "Undo previous action";
+ ot->idname = "ED_OT_undo";
/* api callbacks */
- ot->exec= ed_undo_exec;
- ot->poll= ED_operator_screenactive;
+ ot->exec = ed_undo_exec;
+ ot->poll = ED_operator_screenactive;
}
void ED_OT_undo_push(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Undo Push";
- ot->description= "Add an undo state (internal use only)";
- ot->idname= "ED_OT_undo_push";
+ ot->name = "Undo Push";
+ ot->description = "Add an undo state (internal use only)";
+ ot->idname = "ED_OT_undo_push";
/* api callbacks */
- ot->exec= ed_undo_push_exec;
+ ot->exec = ed_undo_push_exec;
- ot->flag= OPTYPE_INTERNAL;
+ ot->flag = OPTYPE_INTERNAL;
RNA_def_string(ot->srna, "message", "Add an undo step *function may be moved*", MAXUNDONAME, "Undo Message", "");
}
@@ -340,29 +325,29 @@ void ED_OT_undo_push(wmOperatorType *ot)
void ED_OT_redo(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Redo";
- ot->description= "Redo previous action";
- ot->idname= "ED_OT_redo";
+ ot->name = "Redo";
+ ot->description = "Redo previous action";
+ ot->idname = "ED_OT_redo";
/* api callbacks */
- ot->exec= ed_redo_exec;
- ot->poll= ED_operator_screenactive;
+ ot->exec = ed_redo_exec;
+ ot->poll = ED_operator_screenactive;
}
/* ui callbacks should call this rather than calling WM_operator_repeat() themselves */
int ED_undo_operator_repeat(bContext *C, struct wmOperator *op)
{
- int ret= 0;
+ int ret = 0;
- if(op) {
- wmWindowManager *wm= CTX_wm_manager(C);
- struct Scene *scene= CTX_data_scene(C);
+ if (op) {
+ wmWindowManager *wm = CTX_wm_manager(C);
+ struct Scene *scene = CTX_data_scene(C);
- ARegion *ar= CTX_wm_region(C);
- ARegion *ar1= BKE_area_find_region_type(CTX_wm_area(C), RGN_TYPE_WINDOW);
+ ARegion *ar = CTX_wm_region(C);
+ ARegion *ar1 = BKE_area_find_region_type(CTX_wm_area(C), RGN_TYPE_WINDOW);
- if(ar1)
+ if (ar1)
CTX_wm_region_set(C, ar1);
if ( (WM_operator_repeat_check(C, op)) &&
@@ -376,26 +361,26 @@ int ED_undo_operator_repeat(bContext *C, struct wmOperator *op)
{
int retval;
- if (G.f & G_DEBUG)
+ if (G.debug & G_DEBUG)
printf("redo_cb: operator redo %s\n", op->type->name);
ED_undo_pop_op(C, op);
- if(op->type->check) {
+ if (op->type->check) {
op->type->check(C, op); /* ignore return value since its running again anyway */
}
- retval= WM_operator_repeat(C, op);
- if((retval & OPERATOR_FINISHED)==0) {
- if (G.f & G_DEBUG)
+ retval = WM_operator_repeat(C, op);
+ if ((retval & OPERATOR_FINISHED) == 0) {
+ if (G.debug & G_DEBUG)
printf("redo_cb: operator redo failed: %s, return %d\n", op->type->name, retval);
ED_undo_redo(C);
}
else {
- ret= 1;
+ ret = 1;
}
}
else {
- if (G.f & G_DEBUG) {
+ if (G.debug & G_DEBUG) {
printf("redo_cb: WM_operator_repeat_check returned false %s\n", op->type->name);
}
}
@@ -404,7 +389,7 @@ int ED_undo_operator_repeat(bContext *C, struct wmOperator *op)
CTX_wm_region_set(C, ar);
}
else {
- if (G.f & G_DEBUG) {
+ if (G.debug & G_DEBUG) {
printf("redo_cb: ED_undo_operator_repeat called with NULL 'op'\n");
}
}
@@ -426,25 +411,25 @@ void ED_undo_operator_repeat_cb_evt(bContext *C, void *arg_op, int UNUSED(arg_ev
/* ************************** */
-#define UNDOSYSTEM_GLOBAL 1
-#define UNDOSYSTEM_EDITMODE 2
-#define UNDOSYSTEM_PARTICLE 3
+#define UNDOSYSTEM_GLOBAL 1
+#define UNDOSYSTEM_EDITMODE 2
+#define UNDOSYSTEM_PARTICLE 3
static int get_undo_system(bContext *C)
{
- Object *obedit= CTX_data_edit_object(C);
+ Object *obedit = CTX_data_edit_object(C);
/* find out which undo system */
- if(obedit) {
+ if (obedit) {
if (ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE))
return UNDOSYSTEM_EDITMODE;
}
else {
- Object *obact= CTX_data_active_object(C);
+ Object *obact = CTX_data_active_object(C);
- if(obact && obact->mode & OB_MODE_PARTICLE_EDIT)
+ if (obact && obact->mode & OB_MODE_PARTICLE_EDIT)
return UNDOSYSTEM_PARTICLE;
- else if(U.uiflag & USER_GLOBALUNDO)
+ else if (U.uiflag & USER_GLOBALUNDO)
return UNDOSYSTEM_GLOBAL;
}
@@ -454,29 +439,29 @@ static int get_undo_system(bContext *C)
/* create enum based on undo items */
static EnumPropertyItem *rna_undo_itemf(bContext *C, int undosys, int *totitem)
{
- EnumPropertyItem item_tmp= {0}, *item= NULL;
- int active, i= 0;
+ EnumPropertyItem item_tmp = {0}, *item = NULL;
+ int active, i = 0;
- while(TRUE) {
- const char *name= NULL;
+ while (TRUE) {
+ const char *name = NULL;
- if(undosys==UNDOSYSTEM_PARTICLE) {
- name= PE_undo_get_name(CTX_data_scene(C), i, &active);
+ if (undosys == UNDOSYSTEM_PARTICLE) {
+ name = PE_undo_get_name(CTX_data_scene(C), i, &active);
}
- else if(undosys==UNDOSYSTEM_EDITMODE) {
- name= undo_editmode_get_name(C, i, &active);
+ else if (undosys == UNDOSYSTEM_EDITMODE) {
+ name = undo_editmode_get_name(C, i, &active);
}
else {
- name= BKE_undo_get_name(i, &active);
+ name = BKE_undo_get_name(i, &active);
}
- if(name) {
- item_tmp.identifier= item_tmp.name= name;
- if(active)
- item_tmp.icon= ICON_RESTRICT_VIEW_OFF;
+ if (name) {
+ item_tmp.identifier = item_tmp.name = name;
+ if (active)
+ item_tmp.icon = ICON_RESTRICT_VIEW_OFF;
else
- item_tmp.icon= ICON_NONE;
- item_tmp.value= i++;
+ item_tmp.icon = ICON_NONE;
+ item_tmp.value = i++;
RNA_enum_item_add(&item, totitem, &item_tmp);
}
else
@@ -491,23 +476,23 @@ static EnumPropertyItem *rna_undo_itemf(bContext *C, int undosys, int *totitem)
static int undo_history_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- int undosys, totitem= 0;
+ int undosys, totitem = 0;
- undosys= get_undo_system(C);
+ undosys = get_undo_system(C);
- if(undosys) {
- EnumPropertyItem *item= rna_undo_itemf(C, undosys, &totitem);
+ if (undosys) {
+ EnumPropertyItem *item = rna_undo_itemf(C, undosys, &totitem);
- if(totitem > 0) {
- uiPopupMenu *pup= uiPupMenuBegin(C, op->type->name, ICON_NONE);
- uiLayout *layout= uiPupMenuLayout(pup);
- uiLayout *split= uiLayoutSplit(layout, 0, 0), *column = NULL;
+ if (totitem > 0) {
+ uiPopupMenu *pup = uiPupMenuBegin(C, op->type->name, ICON_NONE);
+ uiLayout *layout = uiPupMenuLayout(pup);
+ uiLayout *split = uiLayoutSplit(layout, 0, 0), *column = NULL;
int i, c;
- for(c=0, i=totitem-1; i >= 0; i--, c++) {
- if( (c % 20)==0 )
- column= uiLayoutColumn(split, 0);
- if(item[i].identifier)
+ for (c = 0, i = totitem - 1; i >= 0; i--, c++) {
+ if ( (c % 20) == 0)
+ column = uiLayoutColumn(split, 0);
+ if (item[i].identifier)
uiItemIntO(column, item[i].name, item[i].icon, op->type->idname, "item", item[i].value);
}
@@ -524,20 +509,20 @@ static int undo_history_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
/* note: also check ed_undo_step() in top if you change notifiers */
static int undo_history_exec(bContext *C, wmOperator *op)
{
- if(RNA_struct_property_is_set(op->ptr, "item")) {
- int undosys= get_undo_system(C);
- int item= RNA_int_get(op->ptr, "item");
+ if (RNA_struct_property_is_set(op->ptr, "item")) {
+ int undosys = get_undo_system(C);
+ int item = RNA_int_get(op->ptr, "item");
- if(undosys==UNDOSYSTEM_PARTICLE) {
+ if (undosys == UNDOSYSTEM_PARTICLE) {
PE_undo_number(CTX_data_scene(C), item);
}
- else if(undosys==UNDOSYSTEM_EDITMODE) {
- undo_editmode_number(C, item+1);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, NULL);
+ else if (undosys == UNDOSYSTEM_EDITMODE) {
+ undo_editmode_number(C, item + 1);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, NULL);
}
else {
BKE_undo_number(C, item);
- WM_event_add_notifier(C, NC_SCENE|ND_LAYER_CONTENT, CTX_data_scene(C));
+ WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, CTX_data_scene(C));
}
WM_event_add_notifier(C, NC_WINDOW, NULL);
@@ -549,14 +534,14 @@ static int undo_history_exec(bContext *C, wmOperator *op)
void ED_OT_undo_history(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Undo History";
- ot->description= "Redo specific action in history";
- ot->idname= "ED_OT_undo_history";
+ ot->name = "Undo History";
+ ot->description = "Redo specific action in history";
+ ot->idname = "ED_OT_undo_history";
/* api callbacks */
- ot->invoke= undo_history_invoke;
- ot->exec= undo_history_exec;
- ot->poll= ED_operator_screenactive;
+ ot->invoke = undo_history_invoke;
+ ot->exec = undo_history_exec;
+ ot->poll = ED_operator_screenactive;
RNA_def_int(ot->srna, "item", 0, 0, INT_MAX, "Item", "", 0, INT_MAX);
diff --git a/source/blender/editors/uvedit/uvedit_buttons.c b/source/blender/editors/uvedit/uvedit_buttons.c
index 20ff8b07bc6..ff673fa0eab 100644
--- a/source/blender/editors/uvedit/uvedit_buttons.c
+++ b/source/blender/editors/uvedit/uvedit_buttons.c
@@ -81,7 +81,7 @@ static int uvedit_center(Scene *scene, BMEditMesh *em, Image *UNUSED(ima), float
}
}
- if(tot > 0) {
+ if (tot > 0) {
center[0] /= tot;
center[1] /= tot;
}
@@ -112,27 +112,27 @@ static float uvedit_old_center[2];
static void uvedit_vertex_buttons(const bContext *C, uiBlock *block)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- Image *ima= sima->image;
+ SpaceImage *sima = CTX_wm_space_image(C);
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Image *ima = sima->image;
BMEditMesh *em;
float center[2];
int imx, imy, step, digits;
ED_space_image_size(sima, &imx, &imy);
- em= ((Mesh *)obedit->data)->edit_btmesh;
+ em = BMEdit_FromObject(obedit);
- if(uvedit_center(scene, em, ima, center)) {
+ if (uvedit_center(scene, em, ima, center)) {
copy_v2_v2(uvedit_old_center, center);
- if(!(sima->flag & SI_COORDFLOATS)) {
+ if (!(sima->flag & SI_COORDFLOATS)) {
uvedit_old_center[0] *= imx;
uvedit_old_center[1] *= imy;
}
- if(sima->flag & SI_COORDFLOATS) {
+ if (sima->flag & SI_COORDFLOATS) {
step= 1;
digits= 3;
}
@@ -158,15 +158,15 @@ static void do_uvedit_vertex(bContext *C, void *UNUSED(arg), int event)
float center[2], delta[2];
int imx, imy;
- if(event != B_UVEDIT_VERTEX)
+ if (event != B_UVEDIT_VERTEX)
return;
- em= ((Mesh *)obedit->data)->edit_btmesh;
+ em = BMEdit_FromObject(obedit);
ED_space_image_size(sima, &imx, &imy);
uvedit_center(scene, em, ima, center);
- if(sima->flag & SI_COORDFLOATS) {
+ if (sima->flag & SI_COORDFLOATS) {
delta[0]= uvedit_old_center[0] - center[0];
delta[1]= uvedit_old_center[1] - center[1];
}
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c
index ef09ec3c3e8..4690f11d9af 100644
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@ -112,10 +112,10 @@ static int draw_uvs_face_check(Scene *scene)
ToolSettings *ts= scene->toolsettings;
/* checks if we are selecting only faces */
- if(ts->uv_flag & UV_SYNC_SELECTION) {
- if(ts->selectmode == SCE_SELECT_FACE)
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
+ if (ts->selectmode == SCE_SELECT_FACE)
return 2;
- else if(ts->selectmode & SCE_SELECT_FACE)
+ else if (ts->selectmode & SCE_SELECT_FACE)
return 1;
else
return 0;
@@ -132,7 +132,7 @@ static void draw_uvs_shadow(Object *obedit)
BMIter iter, liter;
MLoopUV *luv;
- em= ((Mesh*)obedit->data)->edit_btmesh;
+ em = BMEdit_FromObject(obedit);
/* draws the grey mesh when painting */
glColor3ub(112, 112, 112);
@@ -152,7 +152,7 @@ static int draw_uvs_dm_shadow(DerivedMesh *dm)
{
/* draw shadow mesh - this is the mesh with the modifier applied */
- if(dm && dm->drawUVEdges && CustomData_has_layer(&dm->loopData, CD_MLOOPUV)) {
+ if (dm && dm->drawUVEdges && CustomData_has_layer(&dm->loopData, CD_MLOOPUV)) {
glColor3ub(112, 112, 112);
dm->drawUVEdges(dm);
return 1;
@@ -172,7 +172,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
BLI_array_declare(tf_uv);
BLI_array_declare(tf_uvorig);
float aspx, aspy, col[4], (*tf_uv)[2] = NULL, (*tf_uvorig)[2] = NULL;
- int i;
+ int i, j, nverts;
ED_space_image_uv_aspect(sima, &aspx, &aspy);
@@ -204,22 +204,22 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
//totuvarea += tf_area(tf, efa->v4!=0);
totuvarea += poly_uv_area(tf_uv, efa->len);
- if(uvedit_face_visible(scene, ima, efa, tf)) {
+ if (uvedit_face_visible(scene, ima, efa, tf)) {
BM_elem_flag_enable(efa, BM_ELEM_TAG);
}
else {
- if(tf == activetf)
+ if (tf == activetf)
activetf= NULL;
BM_elem_flag_disable(efa, BM_ELEM_TAG);
}
}
- if(totarea < FLT_EPSILON || totuvarea < FLT_EPSILON) {
+ if (totarea < FLT_EPSILON || totuvarea < FLT_EPSILON) {
col[0] = 1.0;
col[1] = col[2] = 0.0;
glColor3fv(col);
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- if(BM_elem_flag_test(efa, BM_ELEM_TAG)) {
+ if (BM_elem_flag_test(efa, BM_ELEM_TAG)) {
glBegin(GL_POLYGON);
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
@@ -231,7 +231,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
}
else {
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- if(BM_elem_flag_test(efa, BM_ELEM_TAG)) {
+ if (BM_elem_flag_test(efa, BM_ELEM_TAG)) {
area = BM_face_area_calc(em->bm, efa) / totarea;
BLI_array_empty(tf_uv);
@@ -253,9 +253,9 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
//uvarea = tf_area(tf, efa->v4!=0) / totuvarea;
uvarea = poly_uv_area(tf_uv, efa->len) / totuvarea;
- if(area < FLT_EPSILON || uvarea < FLT_EPSILON)
+ if (area < FLT_EPSILON || uvarea < FLT_EPSILON)
areadiff = 1.0f;
- else if(area>uvarea)
+ else if (area>uvarea)
areadiff = 1.0f-(uvarea/area);
else
areadiff = 1.0f-(area/uvarea);
@@ -276,152 +276,95 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
}
case SI_UVDT_STRETCH_ANGLE:
{
-#if 0 //BMESH_TODO
- float uvang1,uvang2,uvang3,uvang4;
- float ang1,ang2,ang3,ang4;
- float av1[3], av2[3], av3[3], av4[3]; /* use for 2d and 3d angle vectors */
+ float *uvang = NULL;
+ float *ang = NULL;
+ float (* av)[3] = NULL; /* use for 2d and 3d angle vectors */
+ float (* auv)[2] = NULL;
float a;
-
+
+ BLI_array_declare(uvang);
+ BLI_array_declare(ang);
+ BLI_array_declare(av);
+ BLI_array_declare(auv);
+
col[3] = 0.5; /* hard coded alpha, not that nice */
glShadeModel(GL_SMOOTH);
- for(efa= em->faces.first; efa; efa= efa->next) {
- tf= CustomData_em_get(&em->fdata, efa->head.data, CD_MTFACE);
+ BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
+ tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(uvedit_face_visible(scene, ima, efa, tf)) {
- efa->tmp.p = tf;
- uv_copy_aspect(tf->uv, tf_uv, aspx, aspy);
- if(efa->v4) {
-
-#if 0 /* Simple but slow, better reuse normalized vectors */
+ if (uvedit_face_visible(scene, ima, efa, tf)) {
+ nverts = efa->len;
+ BM_elem_flag_enable(efa, BM_ELEM_TAG);
+ BLI_array_empty(tf_uv);
+ BLI_array_empty(tf_uvorig);
+ BLI_array_empty(uvang);
+ BLI_array_empty(ang);
+ BLI_array_empty(av);
+ BLI_array_empty(auv);
+ BLI_array_growitems(tf_uv, nverts);
+ BLI_array_growitems(tf_uvorig, nverts);
+ BLI_array_growitems(uvang, nverts);
+ BLI_array_growitems(ang, nverts);
+ BLI_array_growitems(av, nverts);
+ BLI_array_growitems(auv, nverts);
+
+ BM_ITER_INDEX(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa, i) {
+ luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+ copy_v2_v2(tf_uvorig[i], luv->uv);
+ }
+
+ poly_copy_aspect(tf_uvorig, tf_uv, aspx, aspy, nverts);
+
+ j = nverts - 1;
+ BM_ITER_INDEX(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa, i) {
+ sub_v2_v2v2(auv[i], tf_uv[j], tf_uv[i]); normalize_v2(auv[i]);
+ sub_v3_v3v3(av[i], l->prev->v->co, l->v->co); normalize_v3(av[i]);
+ j = i;
+ }
+
+ for(i = 0; i < nverts; i++) {
+#if 0
+ /* Simple but slow, better reuse normalized vectors
+ * (Not ported to bmesh, copied for reference) */
uvang1 = RAD2DEG(angle_v2v2v2(tf_uv[3], tf_uv[0], tf_uv[1]));
ang1 = RAD2DEG(angle_v3v3v3(efa->v4->co, efa->v1->co, efa->v2->co));
-
- uvang2 = RAD2DEG(angle_v2v2v2(tf_uv[0], tf_uv[1], tf_uv[2]));
- ang2 = RAD2DEG(angle_v3v3v3(efa->v1->co, efa->v2->co, efa->v3->co));
-
- uvang3 = RAD2DEG(angle_v2v2v2(tf_uv[1], tf_uv[2], tf_uv[3]));
- ang3 = RAD2DEG(angle_v3v3v3(efa->v2->co, efa->v3->co, efa->v4->co));
-
- uvang4 = RAD2DEG(angle_v2v2v2(tf_uv[2], tf_uv[3], tf_uv[0]));
- ang4 = RAD2DEG(angle_v3v3v3(efa->v3->co, efa->v4->co, efa->v1->co));
#endif
-
- /* uv angles */
- sub_v2_v2v2(av1, tf_uv[3], tf_uv[0]); normalize_v2(av1);
- sub_v2_v2v2(av2, tf_uv[0], tf_uv[1]); normalize_v2(av2);
- sub_v2_v2v2(av3, tf_uv[1], tf_uv[2]); normalize_v2(av3);
- sub_v2_v2v2(av4, tf_uv[2], tf_uv[3]); normalize_v2(av4);
-
- /* This is the correct angle however we are only comparing angles
- * uvang1 = 90-((angle_normalized_v2v2(av1, av2) * RAD2DEGF(1.0f))-90);*/
- uvang1 = angle_normalized_v2v2(av1, av2);
- uvang2 = angle_normalized_v2v2(av2, av3);
- uvang3 = angle_normalized_v2v2(av3, av4);
- uvang4 = angle_normalized_v2v2(av4, av1);
-
- /* 3d angles */
- sub_v3_v3v3(av1, efa->v4->co, efa->v1->co); normalize_v3(av1);
- sub_v3_v3v3(av2, efa->v1->co, efa->v2->co); normalize_v3(av2);
- sub_v3_v3v3(av3, efa->v2->co, efa->v3->co); normalize_v3(av3);
- sub_v3_v3v3(av4, efa->v3->co, efa->v4->co); normalize_v3(av4);
-
- /* This is the correct angle however we are only comparing angles
- * ang1 = 90-((angle_normalized_v3v3(av1, av2) * RAD2DEGF(1.0f))-90);*/
- ang1 = angle_normalized_v3v3(av1, av2);
- ang2 = angle_normalized_v3v3(av2, av3);
- ang3 = angle_normalized_v3v3(av3, av4);
- ang4 = angle_normalized_v3v3(av4, av1);
-
- glBegin(GL_QUADS);
-
- /* This simple makes the angles display worse then they really are ;)
- * 1.0-powf((1.0-a), 2) */
-
- a = fabsf(uvang1-ang1)/(float)M_PI;
- weight_to_rgb(col, 1.0f-powf((1.0f-a), 2.0f));
- glColor3fv(col);
- glVertex2fv(tf->uv[0]);
- a = fabsf(uvang2-ang2)/(float)M_PI;
- weight_to_rgb(col, 1.0f-powf((1.0f-a), 2.0f));
- glColor3fv(col);
- glVertex2fv(tf->uv[1]);
- a = fabsf(uvang3-ang3)/(float)M_PI;
- weight_to_rgb(col, 1.0f-powf((1.0f-a), 2.0f));
- glColor3fv(col);
- glVertex2fv(tf->uv[2]);
- a = fabsf(uvang4-ang4)/(float)M_PI;
- weight_to_rgb(col, 1.0f-powf((1.0f-a), 2.0f));
- glColor3fv(col);
- glVertex2fv(tf->uv[3]);
-
+ uvang[i] = angle_normalized_v2v2(auv[i], auv[(i+1)%nverts]);
+ ang[i] = angle_normalized_v3v3(av[i], av[(i+1)%nverts]);
}
- else {
-#if 0 /* Simple but slow, better reuse normalized vectors */
- uvang1 = RAD2DEG(angle_v2v2v2(tf_uv[2], tf_uv[0], tf_uv[1]));
- ang1 = RAD2DEG(angle_v3v3v3(efa->v3->co, efa->v1->co, efa->v2->co));
-
- uvang2 = RAD2DEG(angle_v2v2v2(tf_uv[0], tf_uv[1], tf_uv[2]));
- ang2 = RAD2DEG(angle_v3v3v3(efa->v1->co, efa->v2->co, efa->v3->co));
-
- uvang3 = M_PI-(uvang1+uvang2);
- ang3 = M_PI-(ang1+ang2);
-#endif
-
- /* uv angles */
- sub_v2_v2v2(av1, tf_uv[2], tf_uv[0]); normalize_v2(av1);
- sub_v2_v2v2(av2, tf_uv[0], tf_uv[1]); normalize_v2(av2);
- sub_v2_v2v2(av3, tf_uv[1], tf_uv[2]); normalize_v2(av3);
-
- /* This is the correct angle however we are only comparing angles
- * uvang1 = 90-((angle_normalized_v2v2(av1, av2) * 180.0/M_PI)-90); */
- uvang1 = angle_normalized_v2v2(av1, av2);
- uvang2 = angle_normalized_v2v2(av2, av3);
- uvang3 = angle_normalized_v2v2(av3, av1);
-
- /* 3d angles */
- sub_v3_v3v3(av1, efa->v3->co, efa->v1->co); normalize_v3(av1);
- sub_v3_v3v3(av2, efa->v1->co, efa->v2->co); normalize_v3(av2);
- sub_v3_v3v3(av3, efa->v2->co, efa->v3->co); normalize_v3(av3);
- /* This is the correct angle however we are only comparing angles
- * ang1 = 90-((angle_normalized_v3v3(av1, av2) * 180.0/M_PI)-90); */
- ang1 = angle_normalized_v3v3(av1, av2);
- ang2 = angle_normalized_v3v3(av2, av3);
- ang3 = angle_normalized_v3v3(av3, av1);
-
- /* This simple makes the angles display worse then they really are ;)
- * 1.0f-powf((1.0-a), 2) */
-
- glBegin(GL_TRIANGLES);
- a = fabsf(uvang1-ang1)/(float)M_PI;
- weight_to_rgb(col, 1.0f-powf((1.0f-a), 2.0f));
- glColor3fv(col);
- glVertex2fv(tf->uv[0]);
- a = fabsf(uvang2-ang2)/(float)M_PI;
- weight_to_rgb(col, 1.0f-powf((1.0f-a), 2.0f));
- glColor3fv(col);
- glVertex2fv(tf->uv[1]);
- a = fabsf(uvang3-ang3)/(float)M_PI;
+
+ glBegin(GL_POLYGON);
+ BM_ITER_INDEX(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa, i) {
+ luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+ a = fabsf(uvang[i]-ang[i])/(float)M_PI;
weight_to_rgb(col, 1.0f-powf((1.0f-a), 2.0f));
glColor3fv(col);
- glVertex2fv(tf->uv[2]);
+ glVertex2fv(luv->uv);
}
glEnd();
}
else {
- if(tf == activetf)
+ if (tf == activetf)
activetf= NULL;
- efa->tmp.p = NULL;
+ BM_elem_flag_disable(efa, BM_ELEM_TAG);
}
}
glShadeModel(GL_FLAT);
- break;
-#endif
+ BLI_array_free(uvang);
+ BLI_array_free(ang);
+ BLI_array_free(av);
+ BLI_array_free(auv);
+
+ break;
}
}
+
+ BLI_array_free(tf_uv);
+ BLI_array_free(tf_uvorig);
}
static void draw_uvs_other(Scene *scene, Object *obedit, Image *curimage)
@@ -430,24 +373,24 @@ static void draw_uvs_other(Scene *scene, Object *obedit, Image *curimage)
glColor3ub(96, 96, 96);
- for(base=scene->base.first; base; base=base->next) {
+ for (base=scene->base.first; base; base=base->next) {
Object *ob= base->object;
- if(!(base->flag & SELECT)) continue;
- if(!(base->lay & scene->lay)) continue;
- if(ob->restrictflag & OB_RESTRICT_VIEW) continue;
+ if (!(base->flag & SELECT)) continue;
+ if (!(base->lay & scene->lay)) continue;
+ if (ob->restrictflag & OB_RESTRICT_VIEW) continue;
- if((ob->type==OB_MESH) && (ob!=obedit)) {
+ if ((ob->type==OB_MESH) && (ob!=obedit)) {
Mesh *me= ob->data;
- if(me->mtface) {
+ if (me->mtface) {
MPoly *mface= me->mpoly;
MTexPoly *tface= me->mtpoly;
MLoopUV *mloopuv;
int a, b;
- for(a=me->totpoly; a>0; a--, tface++, mface++) {
- if(tface->tpage == curimage) {
+ for (a=me->totpoly; a>0; a--, tface++, mface++) {
+ if (tface->tpage == curimage) {
glBegin(GL_LINE_LOOP);
mloopuv = me->mloopuv + mface->loopstart;
@@ -467,19 +410,19 @@ static void draw_uvs_texpaint(SpaceImage *sima, Scene *scene, Object *ob)
Mesh *me= ob->data;
Image *curimage = ED_space_image(sima);
- if(sima->flag & SI_DRAW_OTHER)
+ if (sima->flag & SI_DRAW_OTHER)
draw_uvs_other(scene, ob, curimage);
glColor3ub(112, 112, 112);
- if(me->mtface) {
+ if (me->mtface) {
MPoly *mface= me->mpoly;
MTexPoly *tface= me->mtpoly;
MLoopUV *mloopuv;
int a, b;
- for(a=me->totpoly; a>0; a--, tface++, mface++) {
- if(tface->tpage == curimage) {
+ for (a=me->totpoly; a>0; a--, tface++, mface++) {
+ if (tface->tpage == curimage) {
glBegin(GL_LINE_LOOP);
mloopuv = me->mloopuv + mface->loopstart;
@@ -512,18 +455,18 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
StitchPreviewer *stitch_preview = uv_get_stitch_previewer();
em= me->edit_btmesh;
- activetf= EDBM_get_active_mtexpoly(em, &efa_act, FALSE); /* will be set to NULL if hidden */
+ activetf= EDBM_mtexpoly_active_get(em, &efa_act, FALSE); /* will be set to NULL if hidden */
activef = BM_active_face_get(em->bm, FALSE);
ts= scene->toolsettings;
drawfaces= draw_uvs_face_check(scene);
- if(ts->uv_flag & UV_SYNC_SELECTION)
+ if (ts->uv_flag & UV_SYNC_SELECTION)
interpedges= (ts->selectmode & SCE_SELECT_VERTEX);
else
interpedges= (ts->uv_selectmode == UV_SELECT_VERTEX);
/* draw other uvs */
- if(sima->flag & SI_DRAW_OTHER) {
+ if (sima->flag & SI_DRAW_OTHER) {
Image *curimage= (activetf)? activetf->tpage: NULL;
draw_uvs_other(scene, obedit, curimage);
@@ -531,29 +474,29 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
/* 1. draw shadow mesh */
- if(sima->flag & SI_DRAWSHADOW) {
+ if (sima->flag & SI_DRAWSHADOW) {
/* first try existing derivedmesh */
- if(!draw_uvs_dm_shadow(em->derivedFinal)) {
+ if (!draw_uvs_dm_shadow(em->derivedFinal)) {
/* create one if it does not exist */
cagedm = editbmesh_get_derived_cage_and_final(scene, obedit, me->edit_btmesh, &finaldm, CD_MASK_BAREMESH|CD_MASK_MTFACE);
/* when sync selection is enabled, all faces are drawn (except for hidden)
* so if cage is the same as the final, theres no point in drawing this */
- if(!((ts->uv_flag & UV_SYNC_SELECTION) && (cagedm == finaldm)))
+ if (!((ts->uv_flag & UV_SYNC_SELECTION) && (cagedm == finaldm)))
draw_uvs_dm_shadow(finaldm);
/* release derivedmesh again */
- if(cagedm != finaldm) cagedm->release(cagedm);
+ if (cagedm != finaldm) cagedm->release(cagedm);
finaldm->release(finaldm);
}
}
/* 2. draw colored faces */
- if(sima->flag & SI_DRAW_STRETCH) {
+ if (sima->flag & SI_DRAW_STRETCH) {
draw_uvs_stretch(sima, scene, em, activetf);
}
- else if(!(sima->flag & SI_NO_DRAWFACES)) {
+ else if (!(sima->flag & SI_NO_DRAWFACES)) {
/* draw transparent faces */
UI_GetThemeColor4ubv(TH_FACE, col1);
UI_GetThemeColor4ubv(TH_FACE_SELECT, col2);
@@ -563,11 +506,11 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(uvedit_face_visible(scene, ima, efa, tf)) {
+ if (uvedit_face_visible(scene, ima, efa, tf)) {
BM_elem_flag_enable(efa, BM_ELEM_TAG);
- if(tf==activetf) continue; /* important the temp boolean is set above */
+ if (tf==activetf) continue; /* important the temp boolean is set above */
- if(uvedit_face_selected(scene, em, efa))
+ if (uvedit_face_selected(scene, em, efa))
glColor4ubv((GLubyte *)col2);
else
glColor4ubv((GLubyte *)col1);
@@ -580,7 +523,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
glEnd();
}
else {
- if(tf == activetf)
+ if (tf == activetf)
activetf= NULL;
BM_elem_flag_disable(efa, BM_ELEM_TAG);
}
@@ -593,11 +536,11 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(uvedit_face_visible(scene, ima, efa, tf)) {
+ if (uvedit_face_visible(scene, ima, efa, tf)) {
BM_elem_flag_enable(efa, BM_ELEM_TAG);
}
else {
- if(tf == activetf)
+ if (tf == activetf)
activetf= NULL;
BM_elem_flag_disable(efa, BM_ELEM_TAG);
}
@@ -607,7 +550,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
/* 3. draw active face stippled */
- if(activef) {
+ if (activef) {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
UI_ThemeColor4(TH_EDITMESH_ACTIVE);
@@ -628,7 +571,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
/* 4. draw edges */
- if(sima->flag & SI_SMOOTH_UV) {
+ if (sima->flag & SI_SMOOTH_UV) {
glEnable(GL_LINE_SMOOTH);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -641,7 +584,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
continue;
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(tf) {
+ if (tf) {
cpack(0x111111);
glBegin(GL_LINE_LOOP);
@@ -661,12 +604,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);
}
@@ -674,7 +619,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
break;
case SI_UVDT_BLACK: /* black/white */
case SI_UVDT_WHITE:
- if(sima->dt_uv==SI_UVDT_WHITE) glColor3f(1.0f, 1.0f, 1.0f);
+ if (sima->dt_uv==SI_UVDT_WHITE) glColor3f(1.0f, 1.0f, 1.0f);
else glColor3f(0.0f, 0.0f, 0.0f);
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
@@ -709,11 +654,11 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
col2[0] = col2[1] = col2[2] = 192; col2[3] = 255;
glColor4ubv((unsigned char *)col2);
- if(me->drawflag & ME_DRAWEDGES) {
+ if (me->drawflag & ME_DRAWEDGES) {
int sel, lastsel = -1;
UI_GetThemeColor4ubv(TH_VERTEX_SELECT, col1);
- if(interpedges) {
+ if (interpedges) {
glShadeModel(GL_SMOOTH);
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
@@ -741,7 +686,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
glBegin(GL_LINES);
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
sel = (uvedit_edge_selected(em, scene, l)? 1 : 0);
- if(sel != lastsel){
+ if (sel != lastsel) {
glColor4ubv(sel ? (GLubyte *)col1 : (GLubyte *)col2);
lastsel = sel;
}
@@ -772,14 +717,14 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
break;
}
- if(sima->flag & SI_SMOOTH_UV) {
+ if (sima->flag & SI_SMOOTH_UV) {
glDisable(GL_LINE_SMOOTH);
glDisable(GL_BLEND);
}
/* 5. draw face centers */
- if(drawfaces) {
+ if (drawfaces) {
float cent[2];
pointsize = UI_GetThemeValuef(TH_FACEDOT_SIZE);
@@ -793,7 +738,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
if (!BM_elem_flag_test(efa, BM_ELEM_TAG))
continue;
- if(!uvedit_face_selected(scene, em, efa)) {
+ if (!uvedit_face_selected(scene, em, efa)) {
poly_uv_center(em, efa, cent);
bglVertex2fv(cent);
}
@@ -808,7 +753,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
if (!BM_elem_flag_test(efa, BM_ELEM_TAG))
continue;
- if(uvedit_face_selected(scene, em, efa)) {
+ if (uvedit_face_selected(scene, em, efa)) {
poly_uv_center(em, efa, cent);
bglVertex2fv(cent);
}
@@ -818,7 +763,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
/* 6. draw uv vertices */
- if(drawfaces != 2) { /* 2 means Mesh Face Mode */
+ if (drawfaces != 2) { /* 2 means Mesh Face Mode */
/* unselected uvs */
UI_ThemeColor(TH_VERTEX);
pointsize = UI_GetThemeValuef(TH_VERTEX_SIZE);
@@ -831,7 +776,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- if(!uvedit_uv_selected(em, scene, l))
+ if (!uvedit_uv_selected(em, scene, l))
bglVertex2fv(luv->uv);
}
}
@@ -850,7 +795,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- if(luv->flag & MLOOPUV_PINNED)
+ if (luv->flag & MLOOPUV_PINNED)
bglVertex2fv(luv->uv);
}
}
@@ -868,7 +813,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- if(uvedit_uv_selected(em, scene, l))
+ if (uvedit_uv_selected(em, scene, l))
bglVertex2fv(luv->uv);
}
}
@@ -876,7 +821,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
}
/* finally draw stitch preview */
- if(stitch_preview) {
+ if (stitch_preview) {
int i, index = 0;
glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
glEnableClientState(GL_VERTEX_ARRAY);
@@ -889,7 +834,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
glDrawArrays(GL_TRIANGLES, 0, stitch_preview->num_static_tris*3);
glVertexPointer(2, GL_FLOAT, 0, stitch_preview->preview_polys);
- for(i = 0; i < stitch_preview->num_polys; i++){
+ for (i = 0; i < stitch_preview->num_polys; i++) {
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
UI_ThemeColor4(TH_STITCH_PREVIEW_FACE);
glDrawArrays(GL_POLYGON, index, stitch_preview->uvs_per_polygon[i]);
@@ -900,8 +845,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 */
@@ -930,15 +877,15 @@ void draw_uvedit_main(SpaceImage *sima, ARegion *ar, Scene *scene, Object *obedi
show_uvedit= ED_space_image_show_uvedit(sima, obedit);
show_uvshadow= ED_space_image_show_uvshadow(sima, obedit);
- if(show_uvedit || show_uvshadow || show_texpaint_uvshadow) {
- if(show_uvshadow)
+ if (show_uvedit || show_uvshadow || show_texpaint_uvshadow) {
+ if (show_uvshadow)
draw_uvs_shadow(obedit);
- else if(show_uvedit)
+ else if (show_uvedit)
draw_uvs(sima, scene, obedit);
else
draw_uvs_texpaint(sima, scene, obact);
- if(show_uvedit && !(toolsettings->use_uv_sculpt))
+ if (show_uvedit && !(toolsettings->use_uv_sculpt))
drawcursor_sima(sima, ar);
}
}
diff --git a/source/blender/editors/uvedit/uvedit_intern.h b/source/blender/editors/uvedit/uvedit_intern.h
index 0e2154006c1..fdcb5db1911 100644
--- a/source/blender/editors/uvedit/uvedit_intern.h
+++ b/source/blender/editors/uvedit/uvedit_intern.h
@@ -79,7 +79,7 @@ void uv_find_nearest_edge(struct Scene *scene, struct Image *ima, struct BMEditM
/* utility tool functions */
-struct UvElement *ED_get_uv_element(struct UvElementMap *map, struct BMFace *efa, struct BMLoop *l);
+struct UvElement *ED_uv_element_get(struct UvElementMap *map, struct BMFace *efa, struct BMLoop *l);
void uvedit_live_unwrap_update(struct SpaceImage *sima, struct Scene *scene, struct Object *obedit);
/* smart stitch */
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 3deb4636200..4bffc7098b3 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -94,11 +94,11 @@ int ED_uvedit_test(Object *obedit)
if (!obedit)
return 0;
- if(obedit->type != OB_MESH)
+ if (obedit->type != OB_MESH)
return 0;
- em = ((Mesh*)obedit->data)->edit_btmesh;
- ret = EDBM_texFaceCheck(em);
+ em = BMEdit_FromObject(obedit);
+ ret = EDBM_mtexpoly_check(em);
return ret;
}
@@ -116,10 +116,10 @@ static int UNUSED_FUNCTION(ED_operator_uvmap_mesh)(bContext *C)
{
Object *ob= CTX_data_active_object(C);
- if(ob && ob->type==OB_MESH) {
+ if (ob && ob->type==OB_MESH) {
Mesh *me = ob->data;
- if(CustomData_get_layer(&me->fdata, CD_MTFACE) != NULL)
+ if (CustomData_get_layer(&me->fdata, CD_MTFACE) != NULL)
return 1;
}
@@ -137,16 +137,16 @@ int ED_object_get_active_image(Object *ob, int mat_nr, Image **ima, ImageUser **
Material *ma= give_current_material(ob, mat_nr);
bNode *node= (ma && ma->use_nodes)? nodeGetActiveTexture(ma->nodetree): NULL;
- if(node && is_image_texture_node(node)) {
- if(ima) *ima= (Image*)node->id;
- if(iuser) *iuser= NULL;
- if(node_r) *node_r= node;
+ if (node && is_image_texture_node(node)) {
+ if (ima) *ima= (Image*)node->id;
+ if (iuser) *iuser= NULL;
+ if (node_r) *node_r= node;
return TRUE;
}
- if(ima) *ima= NULL;
- if(iuser) *iuser= NULL;
- if(node_r) *node_r= node;
+ if (ima) *ima= NULL;
+ if (iuser) *iuser= NULL;
+ if (node_r) *node_r= node;
return FALSE;
}
@@ -156,7 +156,7 @@ void ED_object_assign_active_image(Main *bmain, Object *ob, int mat_nr, Image *i
Material *ma= give_current_material(ob, mat_nr);
bNode *node= (ma && ma->use_nodes)? nodeGetActiveTexture(ma->nodetree): NULL;
- if(node && is_image_texture_node(node)) {
+ if (node && is_image_texture_node(node)) {
node->id= &ima->id;
ED_node_generic_update(bmain, ma->nodetree, node);
}
@@ -173,31 +173,31 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im
int update= 0;
/* skip assigning these procedural images... */
- if(ima && (ima->type==IMA_TYPE_R_RESULT || ima->type==IMA_TYPE_COMPOSITE))
+ if (ima && (ima->type==IMA_TYPE_R_RESULT || ima->type==IMA_TYPE_COMPOSITE))
return;
/* verify we have a mesh we can work with */
- if(!obedit || (obedit->type != OB_MESH))
+ if (!obedit || (obedit->type != OB_MESH))
return;
- em= ((Mesh*)obedit->data)->edit_btmesh;
- if(!em || !em->bm->totface) {
+ em = BMEdit_FromObject(obedit);
+ if (!em || !em->bm->totface) {
return;
}
- if(scene_use_new_shading_nodes(scene)) {
+ if (scene_use_new_shading_nodes(scene)) {
/* new shading system, assign image in material */
int sloppy= 1;
BMFace *efa= BM_active_face_get(em->bm, sloppy);
- if(efa)
- ED_object_assign_active_image(bmain, obedit, efa->mat_nr, ima);
+ if (efa)
+ ED_object_assign_active_image(bmain, obedit, efa->mat_nr + 1, ima);
}
else {
/* old shading system, assign image to selected faces */
/* ensure we have a uv map */
- if(!CustomData_has_layer(&em->bm->pdata, CD_MTEXPOLY)) {
+ if (!CustomData_has_layer(&em->bm->pdata, CD_MTEXPOLY)) {
BM_data_layer_add(em->bm, &em->bm->pdata, CD_MTEXPOLY);
BM_data_layer_add(em->bm, &em->bm->ldata, CD_MLOOPUV);
update= 1;
@@ -207,11 +207,11 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(uvedit_face_visible(scene, previma, efa, tf)) {
- if(ima) {
+ if (uvedit_face_visible(scene, previma, efa, tf)) {
+ if (ima) {
tf->tpage= ima;
- if(ima->id.us==0) id_us_plus(&ima->id);
+ if (ima->id.us==0) id_us_plus(&ima->id);
else id_lib_extern(&ima->id);
}
else {
@@ -223,7 +223,7 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im
}
/* and update depdency graph */
- if(update)
+ if (update)
DAG_id_tag_update(obedit->data, 0);
}
@@ -239,22 +239,22 @@ static int uvedit_set_tile(Object *obedit, Image *ima, int curtile)
MTexPoly *tf;
/* verify if we have something to do */
- if(!ima || !ED_uvedit_test(obedit))
+ if (!ima || !ED_uvedit_test(obedit))
return 0;
- if((ima->tpageflag & IMA_TILES) == 0)
+ if ((ima->tpageflag & IMA_TILES) == 0)
return 0;
/* skip assigning these procedural images... */
- if(ima->type==IMA_TYPE_R_RESULT || ima->type==IMA_TYPE_COMPOSITE)
+ if (ima->type==IMA_TYPE_R_RESULT || ima->type==IMA_TYPE_COMPOSITE)
return 0;
- em= ((Mesh*)obedit->data)->edit_btmesh;
+ em = BMEdit_FromObject(obedit);
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && BM_elem_flag_test(efa, BM_ELEM_SELECT))
+ if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && BM_elem_flag_test(efa, BM_ELEM_SELECT))
tf->tile= curtile; /* set tile index */
}
@@ -269,7 +269,7 @@ static void uvedit_pixel_to_float(SpaceImage *sima, float *dist, float pixeldist
{
int width, height;
- if(sima) {
+ if (sima) {
ED_space_image_size(sima, &width, &height);
}
else {
@@ -287,7 +287,7 @@ int uvedit_face_visible_nolocal(Scene *scene, BMFace *efa)
{
ToolSettings *ts= scene->toolsettings;
- if(ts->uv_flag & UV_SYNC_SELECTION)
+ if (ts->uv_flag & UV_SYNC_SELECTION)
return (BM_elem_flag_test(efa, BM_ELEM_HIDDEN)==0);
else
return (BM_elem_flag_test(efa, BM_ELEM_HIDDEN)==0 && BM_elem_flag_test(efa, BM_ELEM_SELECT));
@@ -297,7 +297,7 @@ int uvedit_face_visible(Scene *scene, Image *ima, BMFace *efa, MTexPoly *tf)
{
ToolSettings *ts= scene->toolsettings;
- if(ts->uv_flag & UV_SHOW_SAME_IMAGE)
+ if (ts->uv_flag & UV_SHOW_SAME_IMAGE)
return (tf->tpage==ima)? uvedit_face_visible_nolocal(scene, efa): 0;
else
return uvedit_face_visible_nolocal(scene, efa);
@@ -307,7 +307,7 @@ int uvedit_face_selected(Scene *scene, BMEditMesh *em, BMFace *efa)
{
ToolSettings *ts= scene->toolsettings;
- if(ts->uv_flag & UV_SYNC_SELECTION)
+ if (ts->uv_flag & UV_SYNC_SELECTION)
return (BM_elem_flag_test(efa, BM_ELEM_SELECT));
else {
BMLoop *l;
@@ -328,7 +328,7 @@ int uvedit_face_select(Scene *scene, BMEditMesh *em, BMFace *efa)
{
ToolSettings *ts= scene->toolsettings;
- if(ts->uv_flag & UV_SYNC_SELECTION)
+ if (ts->uv_flag & UV_SYNC_SELECTION)
BM_elem_select_set(em->bm, efa, TRUE);
else {
BMLoop *l;
@@ -350,7 +350,7 @@ int uvedit_face_deselect(Scene *scene, BMEditMesh *em, BMFace *efa)
{
ToolSettings *ts= scene->toolsettings;
- if(ts->uv_flag & UV_SYNC_SELECTION) {
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
BM_elem_select_set(em->bm, efa, FALSE);
}
else {
@@ -373,7 +373,7 @@ int uvedit_edge_selected(BMEditMesh *em, Scene *scene, BMLoop *l)
{
ToolSettings *ts= scene->toolsettings;
- if(ts->uv_flag & UV_SYNC_SELECTION) {
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
if (ts->selectmode & SCE_SELECT_FACE) {
return BM_elem_flag_test(l->f, BM_ELEM_SELECT);
}
@@ -400,10 +400,10 @@ void uvedit_edge_select(BMEditMesh *em, Scene *scene, BMLoop *l)
{
ToolSettings *ts= scene->toolsettings;
- if(ts->uv_flag & UV_SYNC_SELECTION) {
- if(ts->selectmode & SCE_SELECT_FACE)
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
+ if (ts->selectmode & SCE_SELECT_FACE)
BM_elem_select_set(em->bm, l->f, TRUE);
- else if(ts->selectmode & SCE_SELECT_EDGE)
+ else if (ts->selectmode & SCE_SELECT_EDGE)
BM_elem_select_set(em->bm, l->e, TRUE);
else {
BM_elem_select_set(em->bm, l->e->v1, TRUE);
@@ -426,10 +426,10 @@ void uvedit_edge_deselect(BMEditMesh *em, Scene *scene, BMLoop *l)
{
ToolSettings *ts= scene->toolsettings;
- if(ts->uv_flag & UV_SYNC_SELECTION) {
- if(ts->selectmode & SCE_SELECT_FACE)
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
+ if (ts->selectmode & SCE_SELECT_FACE)
BM_elem_select_set(em->bm, l->f, FALSE);
- else if(ts->selectmode & SCE_SELECT_EDGE)
+ else if (ts->selectmode & SCE_SELECT_EDGE)
BM_elem_select_set(em->bm, l->e, FALSE);
else {
BM_elem_select_set(em->bm, l->e->v1, FALSE);
@@ -451,8 +451,8 @@ int uvedit_uv_selected(BMEditMesh *em, Scene *scene, BMLoop *l)
{
ToolSettings *ts= scene->toolsettings;
- if(ts->uv_flag & UV_SYNC_SELECTION) {
- if(ts->selectmode & SCE_SELECT_FACE)
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
+ if (ts->selectmode & SCE_SELECT_FACE)
return BM_elem_flag_test(l->f, BM_ELEM_SELECT);
else
return BM_elem_flag_test(l->v, BM_ELEM_SELECT);
@@ -468,8 +468,8 @@ void uvedit_uv_select(BMEditMesh *em, Scene *scene, BMLoop *l)
{
ToolSettings *ts= scene->toolsettings;
- if(ts->uv_flag & UV_SYNC_SELECTION) {
- if(ts->selectmode & SCE_SELECT_FACE)
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
+ if (ts->selectmode & SCE_SELECT_FACE)
BM_elem_select_set(em->bm, l->f, TRUE);
else
BM_elem_select_set(em->bm, l->v, TRUE);
@@ -485,8 +485,8 @@ void uvedit_uv_deselect(BMEditMesh *em, Scene *scene, BMLoop *l)
{
ToolSettings *ts= scene->toolsettings;
- if(ts->uv_flag & UV_SYNC_SELECTION) {
- if(ts->selectmode & SCE_SELECT_FACE)
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
+ if (ts->selectmode & SCE_SELECT_FACE)
BM_elem_select_set(em->bm, l->f, FALSE);
else
BM_elem_select_set(em->bm, l->v, FALSE);
@@ -502,7 +502,7 @@ void uvedit_uv_deselect(BMEditMesh *em, Scene *scene, BMLoop *l)
void uvedit_live_unwrap_update(SpaceImage *sima, Scene *scene, Object *obedit)
{
- if(sima && (sima->flag & SI_LIVE_UNWRAP)) {
+ if (sima && (sima->flag & SI_LIVE_UNWRAP)) {
ED_uvedit_live_unwrap_begin(scene, obedit);
ED_uvedit_live_unwrap_re_solve();
ED_uvedit_live_unwrap_end(0);
@@ -529,7 +529,7 @@ void poly_uv_center(BMEditMesh *em, BMFace *f, float cent[2])
void uv_center(float uv[][2], float cent[2], int quad)
{
- if(quad) {
+ if (quad) {
cent[0] = (uv[0][0] + uv[1][0] + uv[2][0] + uv[3][0]) / 4.0f;
cent[1] = (uv[0][1] + uv[1][1] + uv[2][1] + uv[3][1]) / 4.0f;
}
@@ -541,7 +541,7 @@ void uv_center(float uv[][2], float cent[2], int quad)
float uv_area(float uv[][2], int quad)
{
- if(quad)
+ if (quad)
return area_tri_v2(uv[0], uv[1], uv[2]) + area_tri_v2(uv[0], uv[2], uv[3]);
else
return area_tri_v2(uv[0], uv[1], uv[2]);
@@ -552,7 +552,7 @@ float poly_uv_area(float uv[][2], int len)
//BMESH_TODO: make this not suck
//maybe use scanfill? I dunno.
- if(len >= 4)
+ if (len >= 4)
return area_tri_v2(uv[0], uv[1], uv[2]) + area_tri_v2(uv[0], uv[2], uv[3]);
else
return area_tri_v2(uv[0], uv[1], uv[2]);
@@ -586,7 +586,7 @@ void uv_copy_aspect(float uv_orig[][2], float uv[][2], float aspx, float aspy)
int ED_uvedit_minmax(Scene *scene, Image *ima, Object *obedit, float *min, float *max)
{
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@ -599,7 +599,7 @@ int ED_uvedit_minmax(Scene *scene, Image *ima, Object *obedit, float *min, float
sel= 0;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -616,7 +616,7 @@ int ED_uvedit_minmax(Scene *scene, Image *ima, Object *obedit, float *min, float
static int ED_uvedit_median(Scene *scene, Image *ima, Object *obedit, float co[3])
{
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@ -627,7 +627,7 @@ static int ED_uvedit_median(Scene *scene, Image *ima, Object *obedit, float co[3
zero_v3(co);
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -649,8 +649,8 @@ static int uvedit_center(Scene *scene, Image *ima, Object *obedit, float *cent,
float min[2], max[2];
int change= 0;
- if(mode==V3D_CENTER) { /* bounding box */
- if(ED_uvedit_minmax(scene, ima, obedit, min, max)) {
+ if (mode==V3D_CENTER) { /* bounding box */
+ if (ED_uvedit_minmax(scene, ima, obedit, min, max)) {
change = 1;
cent[0]= (min[0]+max[0])/2.0f;
@@ -658,13 +658,13 @@ static int uvedit_center(Scene *scene, Image *ima, Object *obedit, float *cent,
}
}
else {
- if(ED_uvedit_median(scene, ima, obedit, cent)) {
+ if (ED_uvedit_median(scene, ima, obedit, cent)) {
change = 1;
}
}
- if(change) {
+ if (change) {
return 1;
}
@@ -690,7 +690,7 @@ void uv_find_nearest_edge(Scene *scene, Image *ima, BMEditMesh *em, float co[2],
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
i = 0;
@@ -700,7 +700,7 @@ void uv_find_nearest_edge(Scene *scene, Image *ima, BMEditMesh *em, float co[2],
dist= dist_to_line_segment_v2(co, luv->uv, nextluv->uv);
- if(dist < mindist) {
+ if (dist < mindist) {
hit->tf= tf;
hit->efa= efa;
@@ -739,7 +739,7 @@ static void find_nearest_uv_face(Scene *scene, Image *ima, BMEditMesh *em, float
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
cent[0]= cent[1]= 0.0f;
@@ -753,7 +753,7 @@ static void find_nearest_uv_face(Scene *scene, Image *ima, BMEditMesh *em, float
cent[1] /= efa->len;
dist= fabs(co[0]- cent[0]) + fabs(co[1]- cent[1]);
- if(dist < mindist) {
+ if (dist < mindist) {
hit->tf= tf;
hit->efa= efa;
mindist= dist;
@@ -767,7 +767,7 @@ static int nearest_uv_between(BMEditMesh *em, BMFace *efa, int UNUSED(nverts), i
BMLoop *l;
MLoopUV *luv;
BMIter iter;
- float m[3], v1[3], v2[3], c1, c2, *uv1, *uv2, *uv3;
+ float m[3], v1[3], v2[3], c1, c2, *uv1, /* *uv2, */ /* UNUSED */ *uv3;
int id1, id2, i;
id1= (id+efa->len-1)%efa->len;
@@ -783,7 +783,7 @@ static int nearest_uv_between(BMEditMesh *em, BMFace *efa, int UNUSED(nverts), i
if (i == id1)
uv1 = luv->uv;
else if (i == id)
- uv2 = luv->uv;
+ ; /* uv2 = luv->uv; */ /* UNUSED */
else if (i == id2)
uv3 = luv->uv;
@@ -797,7 +797,7 @@ static int nearest_uv_between(BMEditMesh *em, BMFace *efa, int UNUSED(nverts), i
c1= v1[0]*m[1] - v1[1]*m[0];
c2= v1[0]*v2[1] - v1[1]*v2[0];
- if(c1*c2 < 0.0f)
+ if (c1*c2 < 0.0f)
return 0;
/* m and v1 on same side of v-v2? */
@@ -830,21 +830,21 @@ void uv_find_nearest_vert(Scene *scene, Image *ima, BMEditMesh *em,
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
i = 0;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- if(penalty && uvedit_uv_selected(em, scene, l))
+ if (penalty && uvedit_uv_selected(em, scene, l))
dist= fabs(co[0]-luv->uv[0])+penalty[0] + fabs(co[1]-luv->uv[1])+penalty[1];
else
dist= fabs(co[0]-luv->uv[0]) + fabs(co[1]-luv->uv[1]);
- if(dist<=mindist) {
- if(dist==mindist)
- if(!nearest_uv_between(em, efa, efa->len, i, co, luv->uv)) {
+ if (dist<=mindist) {
+ if (dist==mindist)
+ if (!nearest_uv_between(em, efa, efa->len, i, co, luv->uv)) {
i++;
continue;
}
@@ -868,7 +868,7 @@ void uv_find_nearest_vert(Scene *scene, Image *ima, BMEditMesh *em,
int ED_uvedit_nearest_uv(Scene *scene, Object *obedit, Image *ima, float co[2], float uv[2])
{
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@ -883,14 +883,14 @@ int ED_uvedit_nearest_uv(Scene *scene, Object *obedit, Image *ima, float co[2],
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
dist= fabs(co[0]-luv->uv[0]) + fabs(co[1]-luv->uv[1]);
- if(dist<=mindist) {
+ if (dist<=mindist) {
mindist= dist;
uv[0]= luv->uv[0];
@@ -910,14 +910,14 @@ static void uv_vertex_loop_flag(UvMapVert *first)
UvMapVert *iterv;
int count= 0;
- for(iterv=first; iterv; iterv=iterv->next) {
- if(iterv->separate && iterv!=first)
+ for (iterv=first; iterv; iterv=iterv->next) {
+ if (iterv->separate && iterv!=first)
break;
count++;
}
- if(count < 5)
+ if (count < 5)
first->flag= 1;
}
@@ -927,26 +927,26 @@ static UvMapVert *uv_vertex_map_get(UvVertMap *vmap, BMFace *efa, int a)
BMLoop *l;
l = BM_iter_at_index(NULL, BM_LOOPS_OF_FACE, efa, a);
- first= EDBM_get_uv_map_vert(vmap, BM_elem_index_get(l->v));
+ first= EDBM_uv_vert_map_at_index(vmap, BM_elem_index_get(l->v));
- for(iterv=first; iterv; iterv=iterv->next) {
- if(iterv->separate)
+ for (iterv=first; iterv; iterv=iterv->next) {
+ if (iterv->separate)
first= iterv;
- if(iterv->f == BM_elem_index_get(efa))
+ if (iterv->f == BM_elem_index_get(efa))
return first;
}
return NULL;
}
-UvElement *ED_get_uv_element(UvElementMap *map, BMFace *efa, BMLoop *l)
+UvElement *ED_uv_element_get(UvElementMap *map, BMFace *efa, BMLoop *l)
{
UvElement *element;
element = map->vert[BM_elem_index_get(l->v)];
- for(; element; element = element->next)
- if(element->face == efa)
+ for (; element; element = element->next)
+ if (element->face == efa)
return element;
return NULL;
@@ -959,18 +959,18 @@ static int uv_edge_tag_faces(BMEditMesh *em, UvMapVert *first1, UvMapVert *first
int tot = 0;
/* count number of faces this edge has */
- for(iterv1=first1; iterv1; iterv1=iterv1->next) {
- if(iterv1->separate && iterv1 != first1)
+ for (iterv1=first1; iterv1; iterv1=iterv1->next) {
+ if (iterv1->separate && iterv1 != first1)
break;
- for(iterv2=first2; iterv2; iterv2=iterv2->next) {
- if(iterv2->separate && iterv2 != first2)
+ for (iterv2=first2; iterv2; iterv2=iterv2->next) {
+ if (iterv2->separate && iterv2 != first2)
break;
- if(iterv1->f == iterv2->f) {
+ if (iterv1->f == iterv2->f) {
/* if face already tagged, don't do this edge */
- efa= EDBM_get_face_for_index(em, iterv1->f);
- if(BMO_elem_flag_test(em->bm, efa, EFA_F1_FLAG))
+ efa= EDBM_face_at_index(em, iterv1->f);
+ if (BMO_elem_flag_test(em->bm, efa, EFA_F1_FLAG))
return 0;
tot++;
@@ -979,22 +979,22 @@ static int uv_edge_tag_faces(BMEditMesh *em, UvMapVert *first1, UvMapVert *first
}
}
- if(*totface == 0) /* start edge */
+ if (*totface == 0) /* start edge */
*totface= tot;
- else if(tot != *totface) /* check for same number of faces as start edge */
+ else if (tot != *totface) /* check for same number of faces as start edge */
return 0;
/* tag the faces */
- for(iterv1=first1; iterv1; iterv1=iterv1->next) {
- if(iterv1->separate && iterv1 != first1)
+ for (iterv1=first1; iterv1; iterv1=iterv1->next) {
+ if (iterv1->separate && iterv1 != first1)
break;
- for(iterv2=first2; iterv2; iterv2=iterv2->next) {
- if(iterv2->separate && iterv2 != first2)
+ for (iterv2=first2; iterv2; iterv2=iterv2->next) {
+ if (iterv2->separate && iterv2 != first2)
break;
- if(iterv1->f == iterv2->f) {
- efa= EDBM_get_face_for_index(em, iterv1->f);
+ if (iterv1->f == iterv2->f) {
+ efa= EDBM_face_at_index(em, iterv1->f);
BMO_elem_flag_enable(em->bm, efa, EFA_F1_FLAG);
break;
}
@@ -1015,14 +1015,14 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit
int a, count, looking, nverts, starttotf, select;
/* setup */
- EDBM_init_index_arrays(em, 0, 0, 1);
- vmap= EDBM_make_uv_vert_map(em, 0, 0, limit);
+ EDBM_index_arrays_init(em, 0, 0, 1);
+ vmap= EDBM_uv_vert_map_create(em, 0, 0, limit);
BM_mesh_elem_index_ensure(em->bm, BM_VERT);
count = 0;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- if(!extend) {
+ if (!extend) {
uvedit_face_deselect(scene, em, efa);
}
@@ -1044,12 +1044,12 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit
starttotf= 0;
uv_edge_tag_faces(em, iterv1, iterv2, &starttotf);
- /* sorry, first edge isnt even ok */
- if(iterv1->flag==0 && iterv2->flag==0) looking= 0;
+ /* sorry, first edge isn't even ok */
+ if (iterv1->flag==0 && iterv2->flag==0) looking= 0;
else looking= 1;
/* iterate */
- while(looking) {
+ while (looking) {
looking= 0;
/* find correct valence edges which are not tagged yet, but connect to tagged one */
@@ -1057,9 +1057,9 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!BMO_elem_flag_test(em->bm, efa, EFA_F1_FLAG) && uvedit_face_visible(scene, ima, efa, tf)) {
+ if (!BMO_elem_flag_test(em->bm, efa, EFA_F1_FLAG) && uvedit_face_visible(scene, ima, efa, tf)) {
nverts= efa->len;
- for(a=0; a<nverts; a++) {
+ for (a=0; a<nverts; a++) {
/* check face not hidden and not tagged */
iterv1= uv_vertex_map_get(vmap, efa, a);
iterv2= uv_vertex_map_get(vmap, efa, (a+1)%nverts);
@@ -1068,8 +1068,8 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit
continue;
/* check if vertex is tagged and has right valence */
- if(iterv1->flag || iterv2->flag) {
- if(uv_edge_tag_faces(em, iterv1, iterv2, &starttotf)) {
+ if (iterv1->flag || iterv2->flag) {
+ if (uv_edge_tag_faces(em, iterv1, iterv2, &starttotf)) {
looking= 1;
BMO_elem_flag_enable(em->bm, efa, EFA_F1_FLAG);
@@ -1090,8 +1090,8 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit
iterv1->flag= 1;
iterv2->flag= 1;
- if(extend) {
- if(uvedit_uv_selected(em, scene, hit->l))
+ if (extend) {
+ if (uvedit_uv_selected(em, scene, hit->l))
select= 0;
else
select= 1;
@@ -1100,14 +1100,12 @@ 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);
- if(iterv1->flag) {
- if(select) uvedit_uv_select(em, scene, l);
+ if (iterv1->flag) {
+ if (select) uvedit_uv_select(em, scene, l);
else uvedit_uv_deselect(em, scene, l);
}
@@ -1116,8 +1114,8 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit
}
/* cleanup */
- EDBM_free_uv_vert_map(vmap);
- EDBM_free_index_arrays(em);
+ EDBM_uv_vert_map_free(vmap);
+ EDBM_index_arrays_free(em);
return (select)? 1: -1;
}
@@ -1133,25 +1131,24 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, float limit[
MLoopUV *luv;
UvVertMap *vmap;
UvMapVert *vlist, *iterv, *startv;
- int i, nverts, stacksize= 0, *stack;
+ int i, stacksize= 0, *stack;
unsigned int a;
char *flag;
- EDBM_init_index_arrays(em, 0, 0, 1); /* we can use this too */
- vmap= EDBM_make_uv_vert_map(em, 1, 1, limit);
+ EDBM_index_arrays_init(em, 0, 0, 1); /* we can use this too */
+ vmap= EDBM_uv_vert_map_create(em, 1, 1, limit);
- if(vmap == NULL)
+ if (vmap == NULL)
return;
stack= MEM_mallocN(sizeof(*stack)*(em->bm->totface+1), "UvLinkStack");
flag= MEM_callocN(sizeof(*flag)*em->bm->totface, "UvLinkFlag");
- if(!hit) {
- a = 0;
- BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
+ if (!hit) {
+ BM_ITER_INDEX(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL, a) {
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(uvedit_face_visible(scene, ima, efa, tf)) {
+ if (uvedit_face_visible(scene, ima, efa, tf)) {
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
@@ -1165,12 +1162,11 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, float limit[
}
}
}
- a++;
}
else {
a = 0;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- if(efa == hit->efa) {
+ if (efa == hit->efa) {
stack[stacksize]= a;
stacksize++;
flag[a]= 1;
@@ -1181,7 +1177,7 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, float limit[
}
}
- while(stacksize > 0) {
+ while (stacksize > 0) {
int j;
stacksize--;
@@ -1189,33 +1185,31 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, float limit[
j = 0;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- if(j==a)
+ if (j==a)
break;
j++;
}
- nverts= efa->len;
-
i = 0;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
/* make_uv_vert_map_EM sets verts tmp.l to the indices */
- vlist= EDBM_get_uv_map_vert(vmap, BM_elem_index_get(l->v));
+ vlist= EDBM_uv_vert_map_at_index(vmap, BM_elem_index_get(l->v));
startv= vlist;
- for(iterv=vlist; iterv; iterv=iterv->next) {
- if(iterv->separate)
+ for (iterv=vlist; iterv; iterv=iterv->next) {
+ if (iterv->separate)
startv= iterv;
- if(iterv->f == a)
+ if (iterv->f == a)
break;
}
- for(iterv=startv; iterv; iterv=iterv->next) {
- if((startv != iterv) && (iterv->separate))
+ for (iterv=startv; iterv; iterv=iterv->next) {
+ if ((startv != iterv) && (iterv->separate))
break;
- else if(!flag[iterv->f]) {
+ else if (!flag[iterv->f]) {
flag[iterv->f]= 1;
stack[stacksize]= iterv->f;
stacksize++;
@@ -1226,7 +1220,7 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, float limit[
}
}
- if(!extend) {
+ if (!extend) {
a = 0;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -1261,7 +1255,7 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, float limit[
a++;
}
- if(efa) {
+ if (efa) {
a = 0;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
if (!flag[a]) {
@@ -1299,8 +1293,8 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, float limit[
MEM_freeN(stack);
MEM_freeN(flag);
- EDBM_free_uv_vert_map(vmap);
- EDBM_free_index_arrays(em);
+ EDBM_uv_vert_map_free(vmap);
+ EDBM_index_arrays_free(em);
}
/* WATCH IT: this returns first selected UV,
@@ -1339,28 +1333,28 @@ static void weld_align_uv(bContext *C, int tool)
MLoopUV *luv;
float cent[2], min[2], max[2];
- scene= CTX_data_scene(C);
- obedit= CTX_data_edit_object(C);
- em= ((Mesh*)obedit->data)->edit_btmesh;
- ima= CTX_data_edit_image(C);
- sima= CTX_wm_space_image(C);
+ scene = CTX_data_scene(C);
+ obedit = CTX_data_edit_object(C);
+ em = BMEdit_FromObject(obedit);
+ ima = CTX_data_edit_image(C);
+ sima = CTX_wm_space_image(C);
INIT_MINMAX2(min, max);
- if(tool == 'a') {
+ if (tool == 'a') {
BMFace *efa;
BMLoop *l;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
if (uvedit_uv_selected(em, scene, l)) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- DO_MINMAX2(luv->uv, min, max)
+ DO_MINMAX2(luv->uv, min, max);
}
}
}
@@ -1370,13 +1364,13 @@ static void weld_align_uv(bContext *C, int tool)
uvedit_center(scene, ima, obedit, cent, 0);
- if(tool == 'x' || tool == 'w') {
+ if (tool == 'x' || tool == 'w') {
BMFace *efa;
BMLoop *l;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -1389,13 +1383,13 @@ static void weld_align_uv(bContext *C, int tool)
}
}
- if(tool == 'y' || tool == 'w') {
+ if (tool == 'y' || tool == 'w') {
BMFace *efa;
BMLoop *l;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -1408,7 +1402,7 @@ static void weld_align_uv(bContext *C, int tool)
}
}
- if(tool == 's' || tool == 't' || tool == 'u') {
+ if (tool == 's' || tool == 't' || tool == 'u') {
BMEdge *eed;
BMLoop *l;
BMVert *eve;
@@ -1468,7 +1462,7 @@ static void weld_align_uv(bContext *C, int tool)
/* walk over edges, building an array of verts in a line */
while (eve) {
BLI_array_append(eve_line, eve);
- /* dont touch again */
+ /* don't touch again */
BM_elem_flag_disable(eve, BM_ELEM_TAG);
eve_next = NULL;
@@ -1555,14 +1549,14 @@ static void UV_OT_align(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Align";
- ot->description= "Align selected UV vertices to an axis";
- ot->idname= "UV_OT_align";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Align";
+ ot->description = "Align selected UV vertices to an axis";
+ ot->idname = "UV_OT_align";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= align_exec;
- ot->poll= ED_operator_image_active; /* requires space image */;
+ ot->exec = align_exec;
+ ot->poll = ED_operator_image_active; /* requires space image */;
/* properties */
RNA_def_enum(ot->srna, "axis", axis_items, 'a', "Axis", "Axis to align UV locations on");
@@ -1580,14 +1574,14 @@ static int weld_exec(bContext *C, wmOperator *UNUSED(op))
static void UV_OT_weld(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Weld";
- ot->description= "Weld selected UV vertices together";
- ot->idname= "UV_OT_weld";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Weld";
+ ot->description = "Weld selected UV vertices together";
+ ot->idname = "UV_OT_weld";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= weld_exec;
- ot->poll= ED_operator_uvedit;
+ ot->exec = weld_exec;
+ ot->poll = ED_operator_uvedit;
}
@@ -1606,17 +1600,17 @@ static void select_all_perform(bContext *C, int action)
MTexPoly *tf;
MLoopUV *luv;
- scene= CTX_data_scene(C);
- ts= CTX_data_tool_settings(C);
- obedit= CTX_data_edit_object(C);
- em= ((Mesh*)obedit->data)->edit_btmesh;
- ima= CTX_data_edit_image(C);
+ scene = CTX_data_scene(C);
+ ts = CTX_data_tool_settings(C);
+ obedit = CTX_data_edit_object(C);
+ em = BMEdit_FromObject(obedit);
+ ima = CTX_data_edit_image(C);
- if(ts->uv_flag & UV_SYNC_SELECTION) {
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
switch (action) {
case SEL_TOGGLE:
- EDBM_toggle_select_all(((Mesh*)obedit->data)->edit_btmesh);
+ EDBM_select_toggle_all(BMEdit_FromObject(obedit));
break;
case SEL_SELECT:
EDBM_flag_enable_all(em, BM_ELEM_SELECT);
@@ -1626,6 +1620,7 @@ static void select_all_perform(bContext *C, int action)
break;
case SEL_INVERT:
EDBM_select_swap(em);
+ EDBM_selectmode_flush(em);
break;
}
}
@@ -1635,7 +1630,7 @@ static void select_all_perform(bContext *C, int action)
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -1653,7 +1648,7 @@ static void select_all_perform(bContext *C, int action)
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -1690,14 +1685,14 @@ static int select_all_exec(bContext *C, wmOperator *op)
static void UV_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select or Deselect All";
- ot->description= "Change selection of all UV vertices";
- ot->idname= "UV_OT_select_all";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "(De)select All";
+ ot->description = "Change selection of all UV vertices";
+ ot->idname = "UV_OT_select_all";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= select_all_exec;
- ot->poll= ED_operator_uvedit;
+ ot->exec = select_all_exec;
+ ot->poll = ED_operator_uvedit;
WM_operator_properties_select_all(ot);
}
@@ -1710,16 +1705,16 @@ static int sticky_select(float *limit, int hitv[4], int v, float *hituv[4], floa
/* this function test if some vertex needs to selected
* in addition to the existing ones due to sticky select */
- if(sticky == SI_STICKY_DISABLE)
+ if (sticky == SI_STICKY_DISABLE)
return 0;
- for(i=0; i<hitlen; i++) {
- if(hitv[i] == v) {
- if(sticky == SI_STICKY_LOC) {
- if(fabsf(hituv[i][0]-uv[0]) < limit[0] && fabsf(hituv[i][1]-uv[1]) < limit[1])
+ for (i=0; i<hitlen; i++) {
+ if (hitv[i] == v) {
+ if (sticky == SI_STICKY_LOC) {
+ if (fabsf(hituv[i][0]-uv[0]) < limit[0] && fabsf(hituv[i][1]-uv[1]) < limit[1])
return 1;
}
- else if(sticky == SI_STICKY_VERTEX)
+ else if (sticky == SI_STICKY_VERTEX)
return 1;
}
}
@@ -1729,12 +1724,12 @@ static int sticky_select(float *limit, int hitv[4], int v, float *hituv[4], floa
static int mouse_select(bContext *C, float co[2], int extend, int loop)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- Scene *scene= CTX_data_scene(C);
- ToolSettings *ts= CTX_data_tool_settings(C);
- Object *obedit= CTX_data_edit_object(C);
- Image *ima= CTX_data_edit_image(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ SpaceImage *sima = CTX_wm_space_image(C);
+ Scene *scene = CTX_data_scene(C);
+ ToolSettings *ts = CTX_data_tool_settings(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Image *ima = CTX_data_edit_image(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@ -1743,7 +1738,7 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
NearestHit hit;
int i, select = 1, selectmode, sticky, sync, *hitv=NULL, nvert;
BLI_array_declare(hitv);
- int flush = 0, hitlen=0; /* 0 == dont flush, 1 == sel, -1 == desel; only use when selection sync is enabled */
+ int flush = 0, hitlen=0; /* 0 == don't flush, 1 == sel, -1 == desel; only use when selection sync is enabled */
float limit[2], **hituv = NULL;
BLI_array_declare(hituv);
float penalty[2];
@@ -1758,12 +1753,12 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
uvedit_pixel_to_float(sima, penalty, 5.0f / sima->zoom);
/* retrieve operation mode */
- if(ts->uv_flag & UV_SYNC_SELECTION) {
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
sync= 1;
- if(ts->selectmode & SCE_SELECT_FACE)
+ if (ts->selectmode & SCE_SELECT_FACE)
selectmode= UV_SELECT_FACE;
- else if(ts->selectmode & SCE_SELECT_EDGE)
+ else if (ts->selectmode & SCE_SELECT_EDGE)
selectmode= UV_SELECT_EDGE;
else
selectmode= UV_SELECT_VERTEX;
@@ -1777,10 +1772,10 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
}
/* find nearest element */
- if(loop) {
+ if (loop) {
/* find edge */
uv_find_nearest_edge(scene, ima, em, co, &hit);
- if(hit.efa == NULL) {
+ if (hit.efa == NULL) {
BLI_array_free(hitv);
BLI_array_free(hituv);
return OPERATOR_CANCELLED;
@@ -1788,10 +1783,10 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
hitlen = 0;
}
- else if(selectmode == UV_SELECT_VERTEX) {
+ else if (selectmode == UV_SELECT_VERTEX) {
/* find vertex */
uv_find_nearest_vert(scene, ima, em, co, penalty, &hit);
- if(hit.efa == NULL) {
+ if (hit.efa == NULL) {
BLI_array_free(hitv);
BLI_array_free(hituv);
return OPERATOR_CANCELLED;
@@ -1800,7 +1795,7 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
/* mark 1 vertex as being hit */
BLI_array_growitems(hitv, hit.efa->len);
BLI_array_growitems(hituv, hit.efa->len);
- for(i=0; i<hit.efa->len; i++) {
+ for (i=0; i<hit.efa->len; i++) {
hitv[i]= 0xFFFFFFFF;
}
@@ -1809,10 +1804,10 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
hitlen = hit.efa->len;
}
- else if(selectmode == UV_SELECT_EDGE) {
+ else if (selectmode == UV_SELECT_EDGE) {
/* find edge */
uv_find_nearest_edge(scene, ima, em, co, &hit);
- if(hit.efa == NULL) {
+ if (hit.efa == NULL) {
BLI_array_free(hitv);
BLI_array_free(hituv);
return OPERATOR_CANCELLED;
@@ -1834,10 +1829,10 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
hitlen = hit.efa->len;
}
- else if(selectmode == UV_SELECT_FACE) {
+ else if (selectmode == UV_SELECT_FACE) {
/* find face */
find_nearest_uv_face(scene, ima, em, co, &hit);
- if(hit.efa == NULL) {
+ if (hit.efa == NULL) {
BLI_array_free(hitv);
BLI_array_free(hituv);
return OPERATOR_CANCELLED;
@@ -1860,10 +1855,10 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
hitlen = hit.efa->len;
}
- else if(selectmode == UV_SELECT_ISLAND) {
+ else if (selectmode == UV_SELECT_ISLAND) {
uv_find_nearest_vert(scene, ima, em, co, NULL, &hit);
- if(hit.efa==NULL) {
+ if (hit.efa==NULL) {
BLI_array_free(hitv);
BLI_array_free(hituv);
return OPERATOR_CANCELLED;
@@ -1879,16 +1874,16 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
}
/* do selection */
- if(loop) {
+ if (loop) {
flush= select_edgeloop(scene, ima, em, &hit, limit, extend);
}
- else if(selectmode == UV_SELECT_ISLAND) {
+ else if (selectmode == UV_SELECT_ISLAND) {
select_linked(scene, ima, em, limit, &hit, extend);
}
- else if(extend) {
- if(selectmode == UV_SELECT_VERTEX) {
+ else if (extend) {
+ if (selectmode == UV_SELECT_VERTEX) {
/* (de)select uv vertex */
- if(uvedit_uv_selected(em, scene, hit.l)) {
+ if (uvedit_uv_selected(em, scene, hit.l)) {
uvedit_uv_deselect(em, scene, hit.l);
select= 0;
}
@@ -1898,9 +1893,9 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
}
flush = 1;
}
- else if(selectmode == UV_SELECT_EDGE) {
+ else if (selectmode == UV_SELECT_EDGE) {
/* (de)select edge */
- if(uvedit_edge_selected(em, scene, hit.l)) {
+ if (uvedit_edge_selected(em, scene, hit.l)) {
uvedit_edge_deselect(em, scene, hit.l);
select= 0;
}
@@ -1910,9 +1905,9 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
}
flush = 1;
}
- else if(selectmode == UV_SELECT_FACE) {
+ else if (selectmode == UV_SELECT_FACE) {
/* (de)select face */
- if(uvedit_face_selected(scene, em, hit.efa)) {
+ if (uvedit_face_selected(scene, em, hit.efa)) {
uvedit_face_deselect(scene, em, hit.efa);
select= 0;
}
@@ -1924,20 +1919,20 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
}
/* (de)select sticky uv nodes */
- if(sticky != SI_STICKY_DISABLE) {
+ if (sticky != SI_STICKY_DISABLE) {
BM_mesh_elem_index_ensure(em->bm, BM_VERT);
/* deselect */
- if(select==0) {
+ if (select==0) {
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- if(sticky_select(limit, hitv, BM_elem_index_get(l->v), hituv, luv->uv, sticky, hitlen))
+ if (sticky_select(limit, hitv, BM_elem_index_get(l->v), hituv, luv->uv, sticky, hitlen))
uvedit_uv_deselect(em, scene, l);
}
}
@@ -1947,12 +1942,12 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
else {
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- if(sticky_select(limit, hitv, BM_elem_index_get(l->v), hituv, luv->uv, sticky, hitlen))
+ if (sticky_select(limit, hitv, BM_elem_index_get(l->v), hituv, luv->uv, sticky, hitlen))
uvedit_uv_select(em, scene, l);
}
}
@@ -1967,33 +1962,33 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
uvedit_face_deselect(scene, em, efa);
}
- if(selectmode == UV_SELECT_VERTEX) {
+ if (selectmode == UV_SELECT_VERTEX) {
/* select vertex */
uvedit_uv_select(em, scene, hit.l);
flush= 1;
}
- else if(selectmode == UV_SELECT_EDGE) {
+ else if (selectmode == UV_SELECT_EDGE) {
/* select edge */
uvedit_edge_select(em, scene, hit.l);
flush= 1;
}
- else if(selectmode == UV_SELECT_FACE) {
+ else if (selectmode == UV_SELECT_FACE) {
/* select face */
uvedit_face_select(scene, em, hit.efa);
}
/* select sticky uvs */
- if(sticky != SI_STICKY_DISABLE) {
+ if (sticky != SI_STICKY_DISABLE) {
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
- if(sticky == SI_STICKY_DISABLE) continue;
+ if (sticky == SI_STICKY_DISABLE) continue;
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- if(sticky_select(limit, hitv, BM_elem_index_get(l->v), hituv, luv->uv, sticky, hitlen))
+ if (sticky_select(limit, hitv, BM_elem_index_get(l->v), hituv, luv->uv, sticky, hitlen))
uvedit_uv_select(em, scene, l);
flush= 1;
@@ -2004,14 +1999,16 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
#if 0 /* BM_elem_select_set API handles all of this? */
- if(sync) {
+ if (sync) {
/* flush for mesh selection */
- if(ts->selectmode != SCE_SELECT_FACE) {
- if(flush==1) EDBM_select_flush(em);
- else if(flush==-1) EDBM_deselect_flush(em);
+ if (ts->selectmode != SCE_SELECT_FACE) {
+ if (flush==1) EDBM_select_flush(em);
+ else if (flush==-1) EDBM_deselect_flush(em);
}
}
-
+#else
+ (void)flush; /* flush is otherwise UNUSED */
+ (void)sync; /* sync is otherwise UNUSED */
#endif
DAG_id_tag_update(obedit->data, 0);
@@ -2049,15 +2046,15 @@ static int select_invoke(bContext *C, wmOperator *op, wmEvent *event)
static void UV_OT_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select";
- ot->description= "Select UV vertices";
- ot->idname= "UV_OT_select";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Select";
+ ot->description = "Select UV vertices";
+ ot->idname = "UV_OT_select";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= select_exec;
- ot->invoke= select_invoke;
- ot->poll= ED_operator_image_active; /* requires space image */;
+ ot->exec = select_exec;
+ ot->invoke = select_invoke;
+ ot->poll = ED_operator_image_active; /* requires space image */;
/* properties */
RNA_def_boolean(ot->srna, "extend", 0,
@@ -2094,15 +2091,15 @@ static int select_loop_invoke(bContext *C, wmOperator *op, wmEvent *event)
static void UV_OT_select_loop(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Loop Select";
- ot->description= "Select a loop of connected UV vertices";
- ot->idname= "UV_OT_select_loop";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Loop Select";
+ ot->description = "Select a loop of connected UV vertices";
+ ot->idname = "UV_OT_select_loop";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= select_loop_exec;
- ot->invoke= select_loop_invoke;
- ot->poll= ED_operator_image_active; /* requires space image */;
+ ot->exec = select_loop_exec;
+ ot->invoke = select_loop_invoke;
+ ot->poll = ED_operator_image_active; /* requires space image */;
/* properties */
RNA_def_boolean(ot->srna, "extend", 0,
@@ -2115,18 +2112,18 @@ static void UV_OT_select_loop(wmOperatorType *ot)
static int select_linked_internal(bContext *C, wmOperator *op, wmEvent *event, int pick)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- Scene *scene= CTX_data_scene(C);
- ToolSettings *ts= CTX_data_tool_settings(C);
- Object *obedit= CTX_data_edit_object(C);
- Image *ima= CTX_data_edit_image(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ SpaceImage *sima = CTX_wm_space_image(C);
+ Scene *scene = CTX_data_scene(C);
+ ToolSettings *ts = CTX_data_tool_settings(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Image *ima = CTX_data_edit_image(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
float limit[2];
int extend;
NearestHit hit, *hit_p= NULL;
- if(ts->uv_flag & UV_SYNC_SELECTION) {
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
BKE_report(op->reports, RPT_ERROR, "Can't select linked when sync selection is enabled");
return OPERATOR_CANCELLED;
}
@@ -2134,10 +2131,10 @@ static int select_linked_internal(bContext *C, wmOperator *op, wmEvent *event, i
extend= RNA_boolean_get(op->ptr, "extend");
uvedit_pixel_to_float(sima, limit, 0.05f);
- if(pick) {
+ if (pick) {
float co[2];
- if(event) {
+ if (event) {
/* invoke */
ARegion *ar= CTX_wm_region(C);
@@ -2169,14 +2166,14 @@ static int select_linked_exec(bContext *C, wmOperator *op)
static void UV_OT_select_linked(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Linked";
- ot->description= "Select all UV vertices linked to the active UV map";
- ot->idname= "UV_OT_select_linked";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Select Linked";
+ ot->description = "Select all UV vertices linked to the active UV map";
+ ot->idname = "UV_OT_select_linked";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= select_linked_exec;
- ot->poll= ED_operator_image_active; /* requires space image */
+ ot->exec = select_linked_exec;
+ ot->poll = ED_operator_image_active; /* requires space image */
/* properties */
RNA_def_boolean(ot->srna, "extend", 0,
@@ -2196,15 +2193,15 @@ static int select_linked_pick_exec(bContext *C, wmOperator *op)
static void UV_OT_select_linked_pick(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select Linked Pick";
- ot->description= "Select all UV vertices linked under the mouse";
- ot->idname= "UV_OT_select_linked_pick";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Select Linked Pick";
+ ot->description = "Select all UV vertices linked under the mouse";
+ ot->idname = "UV_OT_select_linked_pick";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->invoke= select_linked_pick_invoke;
- ot->exec= select_linked_pick_exec;
- ot->poll= ED_operator_image_active; /* requires space image */;
+ ot->invoke = select_linked_pick_invoke;
+ ot->exec = select_linked_pick_exec;
+ ot->poll = ED_operator_image_active; /* requires space image */;
/* properties */
RNA_def_boolean(ot->srna, "extend", 0,
@@ -2218,18 +2215,18 @@ static void UV_OT_select_linked_pick(wmOperatorType *ot)
static int unlink_selection_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- ToolSettings *ts= CTX_data_tool_settings(C);
- Object *obedit= CTX_data_edit_object(C);
- Image *ima= CTX_data_edit_image(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ Scene *scene = CTX_data_scene(C);
+ ToolSettings *ts = CTX_data_tool_settings(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Image *ima = CTX_data_edit_image(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
MTexPoly *tf;
MLoopUV *luv;
- if(ts->uv_flag & UV_SYNC_SELECTION) {
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
BKE_report(op->reports, RPT_ERROR, "Can't unlink selection when sync selection is enabled");
return OPERATOR_CANCELLED;
}
@@ -2238,7 +2235,7 @@ static int unlink_selection_exec(bContext *C, wmOperator *op)
int desel = 0;
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -2267,14 +2264,14 @@ static int unlink_selection_exec(bContext *C, wmOperator *op)
static void UV_OT_unlink_selected(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Unlink Selection";
- ot->description= "Unlink selected UV vertices from active UV map";
- ot->idname= "UV_OT_unlink_selected";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Unlink Selection";
+ ot->description = "Unlink selected UV vertices from active UV map";
+ ot->idname = "UV_OT_unlink_selected";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= unlink_selection_exec;
- ot->poll= ED_operator_uvedit;
+ ot->exec = unlink_selection_exec;
+ ot->poll = ED_operator_uvedit;
}
/* ******************** border select operator **************** */
@@ -2294,14 +2291,14 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
* This only needs to be done when the Mesh is not used for
* selection (so for sticky modes, vertex or location based). */
- ToolSettings *ts= CTX_data_tool_settings(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ ToolSettings *ts = CTX_data_tool_settings(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
/* MTexPoly *tf; */
- if((ts->uv_flag & UV_SYNC_SELECTION)==0 && sima->sticky == SI_STICKY_VERTEX) {
+ if ((ts->uv_flag & UV_SYNC_SELECTION)==0 && sima->sticky == SI_STICKY_VERTEX) {
/* Tag all verts as untouched, then touch the ones that have a face center
* in the loop and select all MLoopUV's that use a touched vert. */
BMVert *eve;
@@ -2332,7 +2329,7 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
}
}
}
- else if((ts->uv_flag & UV_SYNC_SELECTION)==0 && sima->sticky == SI_STICKY_LOC) {
+ else if ((ts->uv_flag & UV_SYNC_SELECTION)==0 && sima->sticky == SI_STICKY_LOC) {
BMFace *efa_vlist;
/* MTexPoly *tf_vlist; */ /* UNUSED */
UvMapVert *start_vlist=NULL, *vlist_iter;
@@ -2344,14 +2341,16 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
uvedit_pixel_to_float(sima, limit, 0.05);
- EDBM_init_index_arrays(em, 0, 0, 1);
- vmap= EDBM_make_uv_vert_map(em, 0, 0, limit);
+ EDBM_index_arrays_init(em, 0, 0, 1);
+ vmap= EDBM_uv_vert_map_create(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; */
-
- if(vmap == NULL) {
+ /* 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;
}
@@ -2361,18 +2360,18 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
/* tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
- if(select)
+ if (select)
uvedit_uv_select(em, scene, l);
else
uvedit_uv_deselect(em, scene, l);
- vlist_iter= EDBM_get_uv_map_vert(vmap, BM_elem_index_get(l->v));
+ vlist_iter= EDBM_uv_vert_map_at_index(vmap, BM_elem_index_get(l->v));
while (vlist_iter) {
- if(vlist_iter->separate)
+ if (vlist_iter->separate)
start_vlist = vlist_iter;
- if(efa_index == vlist_iter->f)
+ if (efa_index == vlist_iter->f)
break;
vlist_iter = vlist_iter->next;
@@ -2381,14 +2380,14 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
vlist_iter = start_vlist;
while (vlist_iter) {
- if(vlist_iter != start_vlist && vlist_iter->separate)
+ if (vlist_iter != start_vlist && vlist_iter->separate)
break;
- if(efa_index != vlist_iter->f) {
- efa_vlist = EDBM_get_face_for_index(em, vlist_iter->f);
+ if (efa_index != vlist_iter->f) {
+ efa_vlist = EDBM_face_at_index(em, vlist_iter->f);
/* tf_vlist = CustomData_bmesh_get(&em->bm->pdata, efa_vlist->head.data, CD_MTEXPOLY); */ /* UNUSED */
- if(select)
+ if (select)
uvedit_uv_select(em, scene, BM_iter_at_index(em->bm, BM_LOOPS_OF_FACE, efa_vlist, vlist_iter->tfindex));
else
uvedit_uv_deselect(em, scene, BM_iter_at_index(em->bm, BM_LOOPS_OF_FACE, efa_vlist, vlist_iter->tfindex));
@@ -2398,14 +2397,14 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
}
}
}
- EDBM_free_index_arrays(em);
- EDBM_free_uv_vert_map(vmap);
+ EDBM_index_arrays_free(em);
+ EDBM_uv_vert_map_free(vmap);
}
else { /* SI_STICKY_DISABLE or ts->uv_flag & UV_SYNC_SELECTION */
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
if (BM_elem_flag_test(efa, BM_ELEM_TAG)) {
- if(select)
+ if (select)
uvedit_face_select(scene, em, efa);
else
uvedit_face_deselect(scene, em, efa);
@@ -2416,13 +2415,13 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
static int border_select_exec(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- Scene *scene= CTX_data_scene(C);
- ToolSettings *ts= CTX_data_tool_settings(C);
- Object *obedit= CTX_data_edit_object(C);
- Image *ima= CTX_data_edit_image(C);
- ARegion *ar= CTX_wm_region(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ SpaceImage *sima = CTX_wm_space_image(C);
+ Scene *scene = CTX_data_scene(C);
+ ToolSettings *ts = CTX_data_tool_settings(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Image *ima = CTX_data_edit_image(C);
+ ARegion *ar = CTX_wm_region(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@ -2433,10 +2432,10 @@ static int border_select_exec(bContext *C, wmOperator *op)
int change, pinned, select, faces, extend;
/* 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");
+ 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, &rectf.xmin, &rectf.ymin);
UI_view2d_region_to_view(&ar->v2d, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
@@ -2446,16 +2445,16 @@ static int border_select_exec(bContext *C, wmOperator *op)
pinned= RNA_boolean_get(op->ptr, "pinned");
extend= RNA_boolean_get(op->ptr, "extend");
- if(!extend)
+ if (!extend)
select_all_perform(C, SEL_DESELECT);
- if(ts->uv_flag & UV_SYNC_SELECTION)
+ if (ts->uv_flag & UV_SYNC_SELECTION)
faces= (ts->selectmode == SCE_SELECT_FACE);
else
faces= (ts->uv_selectmode == UV_SELECT_FACE);
/* do actual selection */
- if(faces && !pinned) {
+ if (faces && !pinned) {
/* handle face selection mode */
float cent[2];
@@ -2466,9 +2465,9 @@ static int border_select_exec(bContext *C, wmOperator *op)
BM_elem_flag_disable(efa, BM_ELEM_TAG);
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(uvedit_face_visible(scene, ima, efa, tf)) {
+ if (uvedit_face_visible(scene, ima, efa, tf)) {
poly_uv_center(em, efa, cent);
- if(BLI_in_rctf(&rectf, cent[0], cent[1])) {
+ if (BLI_in_rctf(&rectf, cent[0], cent[1])) {
BM_elem_flag_enable(efa, BM_ELEM_TAG);
change = 1;
}
@@ -2476,7 +2475,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
}
/* (de)selects all tagged faces and deals with sticky modes */
- if(change)
+ if (change)
uv_faces_do_sticky(C, sima, scene, obedit, select);
}
else {
@@ -2485,22 +2484,23 @@ static int border_select_exec(bContext *C, wmOperator *op)
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tf))
+ if (!uvedit_face_visible(scene, ima, efa, tf))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- if(!pinned || (ts->uv_flag & UV_SYNC_SELECTION) ) {
+ if (!pinned || (ts->uv_flag & UV_SYNC_SELECTION) ) {
/* UV_SYNC_SELECTION - can't do pinned selection */
- if(BLI_in_rctf(&rectf, luv->uv[0], luv->uv[1])) {
- if(select) uvedit_uv_select(em, scene, l);
+ if (BLI_in_rctf(&rectf, luv->uv[0], luv->uv[1])) {
+ if (select) uvedit_uv_select(em, scene, l);
else uvedit_uv_deselect(em, scene, l);
}
- } else if(pinned) {
+ }
+ else if (pinned) {
if ((luv->flag & MLOOPUV_PINNED) &&
BLI_in_rctf(&rectf, luv->uv[0], luv->uv[1])) {
- if(select) uvedit_uv_select(em, scene, l);
+ if (select) uvedit_uv_select(em, scene, l);
else uvedit_uv_deselect(em, scene, l);
}
}
@@ -2508,12 +2508,12 @@ static int border_select_exec(bContext *C, wmOperator *op)
}
}
- if(change) {
+ if (change) {
/* make sure newly selected vert selection is updated*/
#if 0 /* BM_elem_select_set API handles all of this? */
- if(ts->uv_flag & UV_SYNC_SELECTION) {
- if(ts->selectmode != SCE_SELECT_FACE) {
- if(select) EDBM_select_flush(em);
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
+ if (ts->selectmode != SCE_SELECT_FACE) {
+ if (select) EDBM_select_flush(em);
else EDBM_deselect_flush(em);
}
}
@@ -2530,19 +2530,19 @@ static int border_select_exec(bContext *C, wmOperator *op)
static void UV_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Border Select";
- ot->description= "Select UV vertices using border selection";
- ot->idname= "UV_OT_select_border";
+ ot->name = "Border Select";
+ ot->description = "Select UV vertices using border selection";
+ ot->idname = "UV_OT_select_border";
/* api callbacks */
- ot->invoke= WM_border_select_invoke;
- ot->exec= border_select_exec;
- ot->modal= WM_border_select_modal;
- ot->poll= ED_operator_image_active; /* requires space image */;
- ot->cancel= WM_border_select_cancel;
+ ot->invoke = WM_border_select_invoke;
+ ot->exec = border_select_exec;
+ ot->modal = WM_border_select_modal;
+ ot->poll = ED_operator_image_active; /* requires space image */;
+ ot->cancel = WM_border_select_cancel;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "pinned", 0, "Pinned", "Border select pinned UVs only");
@@ -2565,19 +2565,19 @@ static void select_uv_inside_ellipse(BMEditMesh *em, SpaceImage *UNUSED(sima), S
y= (uv[1] - offset[1])*ell[1];
r2 = x*x + y*y;
- if(r2 < 1.0f) {
- if(select) uvedit_uv_select(em, scene, l);
+ if (r2 < 1.0f) {
+ if (select) uvedit_uv_select(em, scene, l);
else uvedit_uv_deselect(em, scene, l);
}
}
static int circle_select_exec(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
- ARegion *ar= CTX_wm_region(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
+ ARegion *ar = CTX_wm_region(C);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@ -2610,8 +2610,8 @@ static int circle_select_exec(bContext *C, wmOperator *op)
}
}
-#if 0 //I think the BM_elem_select_set api stuff handles all this as necassary?
- if(select) EM_select_flush(em);
+#if 0 //I think the BM_elem_select_set api stuff handles all this as necessary?
+ if (select) EM_select_flush(em);
else EM_deselect_flush(em);
#endif
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
@@ -2622,19 +2622,19 @@ static int circle_select_exec(bContext *C, wmOperator *op)
static void UV_OT_circle_select(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Circle Select";
- ot->description= "Select UV vertices using circle selection";
- ot->idname= "UV_OT_circle_select";
+ ot->name = "Circle Select";
+ ot->description = "Select UV vertices using circle selection";
+ ot->idname = "UV_OT_circle_select";
/* api callbacks */
- ot->invoke= WM_gesture_circle_invoke;
- ot->modal= WM_gesture_circle_modal;
- ot->exec= circle_select_exec;
- ot->poll= ED_operator_image_active; /* requires space image */;
- ot->cancel= WM_gesture_circle_cancel;
+ ot->invoke = WM_gesture_circle_invoke;
+ ot->modal = WM_gesture_circle_modal;
+ ot->exec = circle_select_exec;
+ ot->poll = ED_operator_image_active; /* requires space image */;
+ ot->cancel = WM_gesture_circle_cancel;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_int(ot->srna, "x", 0, INT_MIN, INT_MAX, "X", "", INT_MIN, INT_MAX);
@@ -2682,7 +2682,7 @@ static int snap_cursor_exec(bContext *C, wmOperator *op)
break;
}
- if(!change)
+ if (!change)
return OPERATOR_CANCELLED;
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_IMAGE, sima);
@@ -2698,14 +2698,14 @@ static void UV_OT_snap_cursor(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Snap Cursor";
- ot->description= "Snap cursor to target type";
- ot->idname= "UV_OT_snap_cursor";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Snap Cursor";
+ ot->description = "Snap cursor to target type";
+ ot->idname = "UV_OT_snap_cursor";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= snap_cursor_exec;
- ot->poll= ED_operator_image_active; /* requires space image */;
+ ot->exec = snap_cursor_exec;
+ ot->poll = ED_operator_image_active; /* requires space image */;
/* properties */
RNA_def_enum(ot->srna, "target", target_items, 0, "Target", "Target to snap the selected UVs to");
@@ -2715,7 +2715,7 @@ static void UV_OT_snap_cursor(wmOperatorType *ot)
static int snap_uvs_to_cursor(Scene *scene, Image *ima, Object *obedit, SpaceImage *sima)
{
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@ -2725,11 +2725,11 @@ static int snap_uvs_to_cursor(Scene *scene, Image *ima, Object *obedit, SpaceIma
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tface))
+ if (!uvedit_face_visible(scene, ima, efa, tface))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
- if(uvedit_uv_selected(em, scene, l)) {
+ if (uvedit_uv_selected(em, scene, l)) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
copy_v2_v2(luv->uv, sima->cursor);
change= 1;
@@ -2742,7 +2742,7 @@ static int snap_uvs_to_cursor(Scene *scene, Image *ima, Object *obedit, SpaceIma
static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obedit)
{
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@ -2767,10 +2767,11 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
* get unique indices and to count how much to malloc */
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tface)) {
+ if (!uvedit_face_visible(scene, ima, efa, tface)) {
BM_elem_flag_disable(efa, BM_ELEM_TAG);
continue;
- } else {
+ }
+ else {
BM_elem_flag_enable(efa, BM_ELEM_TAG);
}
@@ -2793,7 +2794,7 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
continue;
tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tface))
+ if (!uvedit_face_visible(scene, ima, efa, tface))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -2807,7 +2808,7 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
}
/* no other verts selected, bail out */
- if(!change) {
+ if (!change) {
MEM_freeN(coords);
MEM_freeN(usercount);
return change;
@@ -2819,7 +2820,7 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
continue;
tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tface))
+ if (!uvedit_face_visible(scene, ima, efa, tface))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -2839,14 +2840,14 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
static int snap_uvs_to_pixels(SpaceImage *sima, Scene *scene, Object *obedit)
{
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
- Image *ima= sima->image;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
+ Image *ima = sima->image;
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
MTexPoly *tface;
MLoopUV *luv;
- int width= 0, height= 0;
+ int width = 0, height = 0;
float w, h;
short change = 0;
@@ -2856,7 +2857,7 @@ static int snap_uvs_to_pixels(SpaceImage *sima, Scene *scene, Object *obedit)
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tface))
+ if (!uvedit_face_visible(scene, ima, efa, tface))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -2892,7 +2893,7 @@ static int snap_selection_exec(bContext *C, wmOperator *op)
break;
}
- if(!change)
+ if (!change)
return OPERATOR_CANCELLED;
uvedit_live_unwrap_update(sima, scene, obedit);
@@ -2911,14 +2912,14 @@ static void UV_OT_snap_selected(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Snap Selection";
- ot->description= "Snap selected UV vertices to target type";
- ot->idname= "UV_OT_snap_selected";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Snap Selection";
+ ot->description = "Snap selected UV vertices to target type";
+ ot->idname = "UV_OT_snap_selected";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= snap_selection_exec;
- ot->poll= ED_operator_image_active; /* requires space image */;
+ ot->exec = snap_selection_exec;
+ ot->poll = ED_operator_image_active; /* requires space image */;
/* properties */
RNA_def_enum(ot->srna, "target", target_items, 0, "Target", "Target to snap the selected UVs to");
@@ -2928,29 +2929,30 @@ static void UV_OT_snap_selected(wmOperatorType *ot)
static int pin_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- Image *ima= CTX_data_edit_image(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Image *ima = CTX_data_edit_image(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
MTexPoly *tface;
MLoopUV *luv;
- int clear= RNA_boolean_get(op->ptr, "clear");
+ int clear = RNA_boolean_get(op->ptr, "clear");
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tface))
+ if (!uvedit_face_visible(scene, ima, efa, tface))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- if(!clear) {
+ if (!clear) {
if (uvedit_uv_selected(em, scene, l))
luv->flag |= MLOOPUV_PINNED;
- } else {
+ }
+ else {
if (uvedit_uv_selected(em, scene, l))
luv->flag &= ~MLOOPUV_PINNED;
}
@@ -2965,14 +2967,14 @@ static int pin_exec(bContext *C, wmOperator *op)
static void UV_OT_pin(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Pin";
- ot->description= "Set/clear selected UV vertices as anchored between multiple unwrap operations";
- ot->idname= "UV_OT_pin";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Pin";
+ ot->description = "Set/clear selected UV vertices as anchored between multiple unwrap operations";
+ ot->idname = "UV_OT_pin";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= pin_exec;
- ot->poll= ED_operator_uvedit;
+ ot->exec = pin_exec;
+ ot->poll = ED_operator_uvedit;
/* properties */
RNA_def_boolean(ot->srna, "clear", 0, "Clear", "Clear pinning for the selection instead of setting it");
@@ -2982,10 +2984,10 @@ static void UV_OT_pin(wmOperatorType *ot)
static int select_pinned_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- Image *ima= CTX_data_edit_image(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Image *ima = CTX_data_edit_image(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@ -2994,7 +2996,7 @@ static int select_pinned_exec(bContext *C, wmOperator *UNUSED(op))
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if(!uvedit_face_visible(scene, ima, efa, tface))
+ if (!uvedit_face_visible(scene, ima, efa, tface))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -3013,34 +3015,34 @@ static int select_pinned_exec(bContext *C, wmOperator *UNUSED(op))
static void UV_OT_select_pinned(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Selected Pinned";
- ot->description= "Select all pinned UV vertices";
- ot->idname= "UV_OT_select_pinned";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Selected Pinned";
+ ot->description = "Select all pinned UV vertices";
+ ot->idname = "UV_OT_select_pinned";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= select_pinned_exec;
- ot->poll= ED_operator_uvedit;
+ ot->exec = select_pinned_exec;
+ ot->poll = ED_operator_uvedit;
}
/********************** hide operator *********************/
static int hide_exec(bContext *C, wmOperator *op)
{
- SpaceImage *sima= CTX_wm_space_image(C);
- ToolSettings *ts= CTX_data_tool_settings(C);
- Object *obedit= CTX_data_edit_object(C);
+ SpaceImage *sima = CTX_wm_space_image(C);
+ ToolSettings *ts = CTX_data_tool_settings(C);
+ Object *obedit = CTX_data_edit_object(C);
Scene *scene = CTX_data_scene(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
MLoopUV *luv;
- int swap= RNA_boolean_get(op->ptr, "unselected");
+ int swap = RNA_boolean_get(op->ptr, "unselected");
int facemode= sima ? sima->flag & SI_SELACTFACE : 0;
- if(ts->uv_flag & UV_SYNC_SELECTION) {
- EDBM_hide_mesh(em, swap);
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
+ EDBM_mesh_hide(em, swap);
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
@@ -3075,7 +3077,8 @@ static int hide_exec(bContext *C, wmOperator *op)
BM_elem_select_set(em->bm, efa, FALSE);
uvedit_face_deselect(scene, em, efa);
}
- } else if(em->selectmode == SCE_SELECT_FACE) {
+ }
+ else if (em->selectmode == SCE_SELECT_FACE) {
/*check if a UV is selected*/
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
@@ -3084,7 +3087,8 @@ static int hide_exec(bContext *C, wmOperator *op)
}
luv->flag &= ~MLOOPUV_VERTSEL;
}
- } else {
+ }
+ else {
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
if (luv->flag & MLOOPUV_VERTSEL) {
@@ -3097,7 +3101,7 @@ static int hide_exec(bContext *C, wmOperator *op)
}
- EDBM_validate_selections(em);
+ EDBM_editselection_validate(em);
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
@@ -3106,14 +3110,14 @@ static int hide_exec(bContext *C, wmOperator *op)
static void UV_OT_hide(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Hide Selected";
- ot->description= "Hide (un)selected UV vertices";
- ot->idname= "UV_OT_hide";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Hide Selected";
+ ot->description = "Hide (un)selected UV vertices";
+ ot->idname = "UV_OT_hide";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= hide_exec;
- ot->poll= ED_operator_uvedit;
+ ot->exec = hide_exec;
+ ot->poll = ED_operator_uvedit;
/* props */
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected");
@@ -3127,7 +3131,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
ToolSettings *ts= CTX_data_tool_settings(C);
Object *obedit= CTX_data_edit_object(C);
/*Scene *scene = CTX_data_scene(C);*/ /*UNUSED*/
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@ -3136,14 +3140,14 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
int stickymode= sima ? (sima->sticky != SI_STICKY_DISABLE) : 1;
/* call the mesh function if we are in mesh sync sel */
- if(ts->uv_flag & UV_SYNC_SELECTION) {
- EDBM_reveal_mesh(em);
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
+ EDBM_mesh_reveal(em);
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
}
- if(facemode) {
- if(em->selectmode == SCE_SELECT_FACE) {
+ if (facemode) {
+ if (em->selectmode == SCE_SELECT_FACE) {
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
BM_elem_select_set(em->bm, efa, TRUE);
@@ -3156,7 +3160,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
}
else {
/* enable adjacent faces to have disconnected UV selections if sticky is disabled */
- if(!stickymode) {
+ if (!stickymode) {
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
int totsel=0;
@@ -3174,7 +3178,8 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
}
}
}
- } else {
+ }
+ else {
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -3189,7 +3194,8 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
}
}
}
- } else if(em->selectmode == SCE_SELECT_FACE) {
+ }
+ else if (em->selectmode == SCE_SELECT_FACE) {
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -3200,7 +3206,8 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
BM_elem_select_set(em->bm, efa, TRUE);
}
}
- } else {
+ }
+ else {
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -3223,14 +3230,14 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
static void UV_OT_reveal(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reveal Hidden";
- ot->description= "Reveal all hidden UV vertices";
- ot->idname= "UV_OT_reveal";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Reveal Hidden";
+ ot->description = "Reveal all hidden UV vertices";
+ ot->idname = "UV_OT_reveal";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= reveal_exec;
- ot->poll= ED_operator_uvedit;
+ ot->exec = reveal_exec;
+ ot->poll = ED_operator_uvedit;
}
/******************** set 3d cursor operator ********************/
@@ -3240,7 +3247,7 @@ static int set_2d_cursor_exec(bContext *C, wmOperator *op)
SpaceImage *sima = CTX_wm_space_image(C);
float location[2];
- if(!sima)
+ if (!sima)
return OPERATOR_CANCELLED;
RNA_float_get_array(op->ptr, "location", location);
@@ -3266,17 +3273,17 @@ static int set_2d_cursor_invoke(bContext *C, wmOperator *op, wmEvent *event)
static void UV_OT_cursor_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set 2D Cursor";
- ot->description= "Set 2D cursor location";
- ot->idname= "UV_OT_cursor_set";
+ ot->name = "Set 2D Cursor";
+ ot->description = "Set 2D cursor location";
+ ot->idname = "UV_OT_cursor_set";
/* api callbacks */
- ot->exec= set_2d_cursor_exec;
- ot->invoke= set_2d_cursor_invoke;
- ot->poll= ED_operator_image_active; /* requires space image */;
+ ot->exec = set_2d_cursor_exec;
+ ot->invoke = set_2d_cursor_invoke;
+ ot->poll = ED_operator_image_active; /* requires space image */;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in normalised (0.0-1.0) coordinates", -10.0f, 10.0f);
@@ -3292,7 +3299,7 @@ static int set_tile_exec(bContext *C, wmOperator *op)
RNA_int_get_array(op->ptr, "tile", tile);
- if(uvedit_set_tile(obedit, ima, tile[0] + ima->xrep*tile[1])) {
+ if (uvedit_set_tile(obedit, ima, tile[0] + ima->xrep*tile[1])) {
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_IMAGE, NULL);
@@ -3310,12 +3317,12 @@ static int set_tile_invoke(bContext *C, wmOperator *op, wmEvent *event)
float fx, fy;
int tile[2];
- if(!ima || !(ima->tpageflag & IMA_TILES))
+ if (!ima || !(ima->tpageflag & IMA_TILES))
return OPERATOR_CANCELLED;
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fx, &fy);
- if(fx >= 0.0f && fy >= 0.0f && fx < 1.0f && fy < 1.0f) {
+ if (fx >= 0.0f && fy >= 0.0f && fx < 1.0f && fy < 1.0f) {
fx= fx*ima->xrep;
fy= fy*ima->yrep;
@@ -3332,17 +3339,17 @@ static int set_tile_invoke(bContext *C, wmOperator *op, wmEvent *event)
static void UV_OT_tile_set(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Tile";
- ot->description= "Set UV image tile coordinates";
- ot->idname= "UV_OT_tile_set";
+ ot->name = "Set Tile";
+ ot->description = "Set UV image tile coordinates";
+ ot->idname = "UV_OT_tile_set";
/* api callbacks */
- ot->exec= set_tile_exec;
- ot->invoke= set_tile_invoke;
- ot->poll= ED_operator_image_active; /* requires space image */;
+ ot->exec = set_tile_exec;
+ ot->invoke = set_tile_invoke;
+ ot->poll = ED_operator_image_active; /* requires space image */;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_int_vector(ot->srna, "tile", 2, NULL, 0, INT_MAX, "Tile", "Tile coordinate", 0, 10);
@@ -3366,13 +3373,13 @@ static int seams_from_islands_exec(bContext *C, wmOperator *op)
em = me->edit_btmesh;
bm = em->bm;
- if(!EDBM_texFaceCheck(em)) {
+ if (!EDBM_mtexpoly_check(em)) {
return OPERATOR_CANCELLED;
}
/* This code sets editvert->tmp.l to the index. This will be useful later on. */
- EDBM_init_index_arrays(em, 0, 0, 1);
- vmap = EDBM_make_uv_vert_map(em, 0, 0, limit);
+ EDBM_index_arrays_init(em, 0, 0, 1);
+ vmap = EDBM_uv_vert_map_create(em, 0, 0, limit);
BM_ITER(editedge, &iter, bm, BM_EDGES_OF_MESH, NULL) {
/* flags to determine if we uv is separated from first editface match */
@@ -3392,34 +3399,34 @@ static int seams_from_islands_exec(bContext *C, wmOperator *op)
UvMapVert *mv2cache = NULL, *mv2sep = NULL;
mvinit1 = vmap->vert[BM_elem_index_get(editedge->v1)];
- if(mark_seams)
+ if (mark_seams)
BM_elem_flag_disable(editedge, BM_ELEM_SEAM);
- for(mv1 = mvinit1; mv1 && !faces_separated; mv1 = mv1->next) {
- if(mv1->separate && commonFaces)
+ for (mv1 = mvinit1; mv1 && !faces_separated; mv1 = mv1->next) {
+ if (mv1->separate && commonFaces)
v1coincident = 0;
separated2 = 0;
- efa1 = EDBM_get_face_for_index(em, mv1->f);
+ efa1 = EDBM_face_at_index(em, mv1->f);
mvinit2 = vmap->vert[BM_elem_index_get(editedge->v2)];
- for(mv2 = mvinit2; mv2; mv2 = mv2->next) {
- if(mv2->separate)
+ for (mv2 = mvinit2; mv2; mv2 = mv2->next) {
+ if (mv2->separate)
mv2sep = mv2;
- efa2 = EDBM_get_face_for_index(em, mv2->f);
- if(efa1 == efa2) {
+ efa2 = EDBM_face_at_index(em, mv2->f);
+ if (efa1 == efa2) {
/* if v1 is not coincident no point in comparing */
- if(v1coincident) {
+ if (v1coincident) {
/* have we found previously anything? */
- if(mv2cache) {
+ if (mv2cache) {
/* flag seam unless proved to be coincident with previous hit */
separated2 = 1;
- for(mviter = mv2cache; mviter; mviter = mviter->next) {
- if(mviter->separate && mviter != mv2cache)
+ for (mviter = mv2cache; mviter; mviter = mviter->next) {
+ if (mviter->separate && mviter != mv2cache)
break;
/* coincident with previous hit, do not flag seam */
- if(mviter == mv2)
+ if (mviter == mv2)
separated2 = 0;
}
}
@@ -3432,7 +3439,7 @@ static int seams_from_islands_exec(bContext *C, wmOperator *op)
else
separated1 = 1;
- if(separated1 || separated2) {
+ if (separated1 || separated2) {
faces_separated = 1;
break;
}
@@ -3440,18 +3447,18 @@ static int seams_from_islands_exec(bContext *C, wmOperator *op)
}
}
- if(faces_separated) {
- if(mark_seams)
+ if (faces_separated) {
+ if (mark_seams)
BM_elem_flag_enable(editedge, BM_ELEM_SEAM);
- if(mark_sharp)
+ if (mark_sharp)
BM_elem_flag_disable(editedge, BM_ELEM_SMOOTH);
}
}
me->drawflag |= ME_DRAWSEAMS;
- EDBM_free_uv_vert_map(vmap);
- EDBM_free_index_arrays(em);
+ EDBM_uv_vert_map_free(vmap);
+ EDBM_index_arrays_free(em);
DAG_id_tag_update(&me->id, 0);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
@@ -3463,16 +3470,16 @@ static int seams_from_islands_exec(bContext *C, wmOperator *op)
static void UV_OT_seams_from_islands(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Seams From Islands";
- ot->description= "Set mesh seams according to island setup in the UV editor";
- ot->idname= "UV_OT_seams_from_islands";
+ ot->name = "Seams From Islands";
+ ot->description = "Set mesh seams according to island setup in the UV editor";
+ ot->idname = "UV_OT_seams_from_islands";
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= seams_from_islands_exec;
- ot->poll= ED_operator_uvedit;
+ ot->exec = seams_from_islands_exec;
+ ot->poll = ED_operator_uvedit;
RNA_def_boolean(ot->srna, "mark_seams", 1, "Mark Seams", "Mark boundary edges as seams");
RNA_def_boolean(ot->srna, "mark_sharp", 0, "Mark Sharp", "Mark boundary edges as sharp");
@@ -3492,7 +3499,7 @@ static int mark_seam_exec(bContext *C, wmOperator *UNUSED(op))
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
BM_ITER(loop, &liter, bm, BM_LOOPS_OF_FACE, efa) {
- if(uvedit_edge_selected(em, scene, loop)) {
+ if (uvedit_edge_selected(em, scene, loop)) {
BM_elem_flag_enable(loop, BM_ELEM_SEAM);
}
}
@@ -3500,7 +3507,7 @@ static int mark_seam_exec(bContext *C, wmOperator *UNUSED(op))
me->drawflag |= ME_DRAWSEAMS;
- if(scene->toolsettings->edge_mode_live_unwrap)
+ if (scene->toolsettings->edge_mode_live_unwrap)
ED_unwrap_lscm(scene, ob, FALSE);
DAG_id_tag_update(&me->id, 0);
@@ -3512,16 +3519,16 @@ static int mark_seam_exec(bContext *C, wmOperator *UNUSED(op))
static void UV_OT_mark_seam(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Mark Seams";
- ot->description= "Mark selected UV edges as seams";
- ot->idname= "UV_OT_mark_seam";
+ ot->name = "Mark Seams";
+ ot->description = "Mark selected UV edges as seams";
+ ot->idname = "UV_OT_mark_seam";
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= mark_seam_exec;
- ot->poll= ED_operator_uvedit;
+ ot->exec = mark_seam_exec;
+ ot->poll = ED_operator_uvedit;
}
@@ -3573,8 +3580,8 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf)
wmKeyMap *keymap;
wmKeyMapItem *kmi;
- keymap= WM_keymap_find(keyconf, "UV Editor", 0, 0);
- keymap->poll= ED_operator_uvedit_can_uv_sculpt;
+ keymap = WM_keymap_find(keyconf, "UV Editor", 0, 0);
+ keymap->poll = ED_operator_uvedit_can_uv_sculpt;
/* Uv sculpt toggle */
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", QKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index 68c8669ccc7..7d388e6206c 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;
@@ -800,12 +800,12 @@ static PBool p_edge_implicit_seam(PEdge *e, PEdge *ep)
uvp2 = ep->orig_uv;
}
- if((fabsf(uv1[0]-uvp1[0]) > limit[0]) || (fabsf(uv1[1]-uvp1[1]) > limit[1])) {
+ if ((fabsf(uv1[0]-uvp1[0]) > limit[0]) || (fabsf(uv1[1]-uvp1[1]) > limit[1])) {
e->flag |= PEDGE_SEAM;
ep->flag |= PEDGE_SEAM;
return P_TRUE;
}
- if((fabsf(uv2[0]-uvp2[0]) > limit[0]) || (fabsf(uv2[1]-uvp2[1]) > limit[1])) {
+ if ((fabsf(uv2[0]-uvp2[0]) > limit[0]) || (fabsf(uv2[1]-uvp2[1]) > limit[1])) {
e->flag |= PEDGE_SEAM;
ep->flag |= PEDGE_SEAM;
return P_TRUE;
@@ -866,7 +866,7 @@ static PBool p_edge_connect_pair(PHandle *handle, PEdge *e, PEdge ***stack, PBoo
{
PEdge *pair = NULL;
- if(!e->pair && p_edge_has_pair(handle, e, &pair, impl)) {
+ if (!e->pair && p_edge_has_pair(handle, e, &pair, impl)) {
if (e->vert == pair->vert)
p_face_flip(pair->face);
@@ -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;
@@ -1162,7 +1162,7 @@ static void p_chart_boundaries(PChart *chart, int *nboundaries, PEdge **outer)
be->flag |= PEDGE_DONE;
len += p_edge_length(be);
be = be->next->vert->edge;
- } while(be != e);
+ } while (be != e);
if (outer && (len > maxlen)) {
*outer = e;
@@ -1213,7 +1213,7 @@ static void p_chart_fill_boundary(PChart *chart, PEdge *be, int nedges)
e->u.heaplink = BLI_heap_insert(heap, angle, e);
e = p_boundary_edge_next(e);
- } while(e != be);
+ } while (e != be);
if (nedges == 2) {
/* no real boundary, but an isolated seam */
@@ -1297,7 +1297,7 @@ static void p_chart_fill_boundaries(PChart *chart, PEdge *outer)
be->flag |= PEDGE_FILLED;
be = be->next->vert->edge;
nedges++;
- } while(be != e);
+ } while (be != e);
if (e != outer)
p_chart_fill_boundary(chart, e, nedges);
@@ -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 {
@@ -2847,7 +2847,7 @@ static PBool p_chart_symmetry_pins(PChart *chart, PEdge *outer, PVert **pin1, PV
lastbe = be;
be = nextbe;
- } while(be != outer);
+ } while (be != outer);
/* make sure we also count a series of splits over the starting point */
if (cure && (cure != outer)) {
@@ -3180,7 +3180,7 @@ static void p_stretch_pin_boundary(PChart *chart)
{
PVert *v;
- for(v=chart->verts; v; v=v->nextlink)
+ for (v=chart->verts; v; v=v->nextlink)
if (v->edge->pair == NULL)
v->flag |= PVERT_PIN;
else
@@ -3261,8 +3261,8 @@ static void p_chart_stretch_minimize(PChart *chart, RNG *rng)
float orig_stretch, low, stretch_low, high, stretch_high, mid, stretch;
float orig_uv[2], dir[2], random_angle, trusted_radius;
- for(v=chart->verts; v; v=v->nextlink) {
- if((v->flag & PVERT_PIN) || !(v->flag & PVERT_SELECT))
+ for (v=chart->verts; v; v=v->nextlink) {
+ if ((v->flag & PVERT_PIN) || !(v->flag & PVERT_SELECT))
continue;
orig_stretch = p_stretch_compute_vertex(v);
@@ -3313,7 +3313,7 @@ static void p_chart_stretch_minimize(PChart *chart, RNG *rng)
}
/* no luck, stretch has increased, reset to old values */
- if(stretch >= orig_stretch)
+ if (stretch >= orig_stretch)
copy_v2_v2(v->uv, orig_uv);
}
}
@@ -3357,7 +3357,7 @@ static PBool p_chart_convex_hull(PChart *chart, PVert ***verts, int *nverts, int
do {
npoints++;
e = p_boundary_edge_next(e);
- } while(e != be);
+ } while (e != be);
p = points = (PVert**)MEM_mallocN(sizeof(PVert*)*npoints*2, "PCHullpoints");
U = (PVert**)MEM_mallocN(sizeof(PVert*)*npoints, "PCHullU");
@@ -3368,7 +3368,7 @@ static PBool p_chart_convex_hull(PChart *chart, PVert ***verts, int *nverts, int
*p = e->vert;
p++;
e = p_boundary_edge_next(e);
- } while(e != be);
+ } while (e != be);
qsort(points, npoints, sizeof(PVert*), p_compare_geometric_uv);
@@ -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];
@@ -3792,7 +3792,7 @@ static void p_smooth(PChart *chart)
nwheel++;
e = e->next->next->pair;
- } while(e && (e != v->edge));
+ } while (e && (e != v->edge));
v->u.distortion /= nwheel;
}
@@ -4344,7 +4344,7 @@ void param_pack(ParamHandle *handle, float margin)
if (phandle->ncharts == 0)
return;
- if(phandle->aspx != phandle->aspy)
+ if (phandle->aspx != phandle->aspy)
param_scale(handle, 1.0f/phandle->aspx, 1.0f/phandle->aspy);
/* we may not use all these boxes */
@@ -4372,12 +4372,12 @@ void param_pack(ParamHandle *handle, float margin)
box->h = chart->u.pack.size[1] + trans[1];
box->index = i; /* warning this index skips PCHART_NOPACK boxes */
- if(margin>0.0f)
+ if (margin>0.0f)
area += sqrt(box->w*box->h);
}
- if(margin>0.0f) {
- /* multiply the margin by the area to give predictable results not dependant on UV scale,
+ if (margin>0.0f) {
+ /* multiply the margin by the area to give predictable results not dependent on UV scale,
* ...Without using the area running pack multiple times also gives a bad feedback loop.
* multiply by 0.1 so the margin value from the UI can be from 0.0 to 1.0 but not give a massive margin */
margin = (margin*(float)area) * 0.1f;
@@ -4417,7 +4417,7 @@ void param_pack(ParamHandle *handle, float margin)
}
MEM_freeN(boxarray);
- if(phandle->aspx != phandle->aspy)
+ if (phandle->aspx != phandle->aspy)
param_scale(handle, phandle->aspx, phandle->aspy);
}
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 1fc1a0c7053..384581247a0 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -185,25 +185,24 @@ static StitchPreviewer * stitch_preview_init(void)
/* destructor...yeah this should be C++ :) */
static void stitch_preview_delete(void)
{
- if(_stitch_preview)
- {
- if(_stitch_preview->preview_polys){
+ if (_stitch_preview) {
+ if (_stitch_preview->preview_polys) {
MEM_freeN(_stitch_preview->preview_polys);
_stitch_preview->preview_polys = NULL;
}
- if(_stitch_preview->uvs_per_polygon){
+ if (_stitch_preview->uvs_per_polygon) {
MEM_freeN(_stitch_preview->uvs_per_polygon);
_stitch_preview->uvs_per_polygon = NULL;
}
- if(_stitch_preview->preview_stitchable){
+ if (_stitch_preview->preview_stitchable) {
MEM_freeN(_stitch_preview->preview_stitchable);
_stitch_preview->preview_stitchable = NULL;
}
- if(_stitch_preview->preview_unstitchable){
+ if (_stitch_preview->preview_unstitchable) {
MEM_freeN(_stitch_preview->preview_unstitchable);
_stitch_preview->preview_unstitchable = NULL;
}
- if(_stitch_preview->static_tris){
+ if (_stitch_preview->static_tris) {
MEM_freeN(_stitch_preview->static_tris);
_stitch_preview->static_tris = NULL;
}
@@ -230,7 +229,7 @@ static void stitch_update_header(StitchState *stitch_state, bContext *C)
char msg[HEADER_LENGTH];
ScrArea *sa= CTX_wm_area(C);
- if(sa) {
+ if (sa) {
BLI_snprintf(msg, HEADER_LENGTH, str,
stitch_state->snap_islands? "On" : "Off",
stitch_state->midpoints? "On": "Off",
@@ -243,9 +242,10 @@ static void stitch_update_header(StitchState *stitch_state, bContext *C)
static int getNumOfIslandUvs(UvElementMap *elementMap, int island)
{
- if(island == elementMap->totalIslands-1){
+ if (island == elementMap->totalIslands-1) {
return elementMap->totalUVs - elementMap->islandIndices[island];
- }else{
+ }
+ else {
return elementMap->islandIndices[island+1] - elementMap->islandIndices[island];
}
}
@@ -269,14 +269,14 @@ static int stitch_check_uvs_stitchable(UvElement *element, UvElement *element_it
float limit;
int do_limit;
- if(element_iter == element){
+ if (element_iter == element) {
return 0;
}
limit = state->limit_dist;
do_limit = state->use_limit;
- if(do_limit){
+ if (do_limit) {
MLoopUV *luv_orig, *luv_iter;
BMLoop *l_orig, *l_iter;
@@ -286,19 +286,23 @@ static int stitch_check_uvs_stitchable(UvElement *element, UvElement *element_it
l_iter = element_iter->l;
luv_iter = CustomData_bmesh_get(&state->em->bm->ldata, l_iter->head.data, CD_MLOOPUV);
- if(fabs(luv_orig->uv[0] - luv_iter->uv[0]) < limit
- && fabs(luv_orig->uv[1] - luv_iter->uv[1]) < limit){
+ if (fabs(luv_orig->uv[0] - luv_iter->uv[0]) < limit
+ && fabs(luv_orig->uv[1] - luv_iter->uv[1]) < limit) {
return 1;
- }else
+ }
+ else {
return 0;
- }else
+ }
+ }
+ else {
return 1;
+ }
}
static int stitch_check_uvs_state_stitchable(UvElement *element, UvElement *element_iter, StitchState *state)
{
- if((state->snap_islands && element->island == element_iter->island) ||
+ if ((state->snap_islands && element->island == element_iter->island) ||
(!state->midpoints && element->island == element_iter->island))
return 0;
@@ -312,12 +316,12 @@ static void stitch_calculate_island_snapping(StitchState *state, PreviewPosition
int i;
UvElement *element;
- for(i = 0; i < state->element_map->totalIslands; i++){
- if(island_stitch_data[i].addedForPreview){
+ for (i = 0; i < state->element_map->totalIslands; i++) {
+ if (island_stitch_data[i].addedForPreview) {
int numOfIslandUVs = 0, j;
/* check to avoid divide by 0 */
- if(island_stitch_data[i].num_rot_elements>0){
+ if (island_stitch_data[i].num_rot_elements>0) {
island_stitch_data[i].rotation /= island_stitch_data[i].num_rot_elements;
island_stitch_data[i].medianPoint[0] /= island_stitch_data[i].numOfElements;
island_stitch_data[i].medianPoint[1] /= island_stitch_data[i].numOfElements;
@@ -326,16 +330,16 @@ static void stitch_calculate_island_snapping(StitchState *state, PreviewPosition
island_stitch_data[i].translation[1] /= island_stitch_data[i].numOfElements;
numOfIslandUVs = getNumOfIslandUvs(state->element_map, i);
element = &state->element_map->buf[state->element_map->islandIndices[i]];
- for(j = 0; j < numOfIslandUVs; j++, element++){
+ for (j = 0; j < numOfIslandUVs; j++, element++) {
/* stitchable uvs have already been processed, don't process */
- if(!(element->flag & STITCH_PROCESSED)){
+ if (!(element->flag & STITCH_PROCESSED)) {
MLoopUV *luv;
BMLoop *l;
l = element->l;
luv = CustomData_bmesh_get(&state->em->bm->ldata, l->head.data, CD_MLOOPUV);
- if(final){
+ if (final) {
stitch_uv_rotate(island_stitch_data[i].rotation, island_stitch_data[i].medianPoint, luv->uv);
@@ -383,7 +387,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];
@@ -411,7 +415,7 @@ static void stitch_island_calculate_vert_rotation(UvElement *element, StitchStat
float rotation = 0;
BMLoop *l;
- if(element->island == state->static_island && !state->midpoints)
+ if (element->island == state->static_island && !state->midpoints)
return;
l = element->l;
@@ -420,8 +424,8 @@ static void stitch_island_calculate_vert_rotation(UvElement *element, StitchStat
element_iter = state->element_map->vert[index];
- for(; element_iter; element_iter = element_iter->next){
- if(element_iter->separate && stitch_check_uvs_state_stitchable(element, element_iter, state)){
+ for (; element_iter; element_iter = element_iter->next) {
+ if (element_iter->separate && stitch_check_uvs_state_stitchable(element, element_iter, state)) {
int index_tmp1, index_tmp2;
float normal[2];
/* easily possible*/
@@ -438,7 +442,7 @@ static void stitch_island_calculate_vert_rotation(UvElement *element, StitchStat
}
}
- if(state->midpoints)
+ if (state->midpoints)
rotation /= 2.0;
island_stitch_data[element->island].num_rot_elements++;
island_stitch_data[element->island].rotation += rotation;
@@ -447,26 +451,26 @@ static void stitch_island_calculate_vert_rotation(UvElement *element, StitchStat
static void stitch_state_delete(StitchState *stitch_state)
{
- if(stitch_state){
- if(stitch_state->element_map){
- EDBM_free_uv_element_map(stitch_state->element_map);
+ if (stitch_state) {
+ if (stitch_state->element_map) {
+ EDBM_uv_element_map_free(stitch_state->element_map);
}
- if(stitch_state->uvs){
+ if (stitch_state->uvs) {
MEM_freeN(stitch_state->uvs);
}
- if(stitch_state->selection_stack){
+ if (stitch_state->selection_stack) {
MEM_freeN(stitch_state->selection_stack);
}
- if(stitch_state->tris_per_island){
+ if (stitch_state->tris_per_island) {
MEM_freeN(stitch_state->tris_per_island);
}
- if(stitch_state->map){
+ if (stitch_state->map) {
MEM_freeN(stitch_state->map);
}
- if(stitch_state->normals){
+ if (stitch_state->normals) {
MEM_freeN(stitch_state->normals);
}
- if(stitch_state->edges){
+ if (stitch_state->edges) {
MEM_freeN(stitch_state->edges);
}
MEM_freeN(stitch_state);
@@ -487,12 +491,12 @@ static void determine_uv_stitchability(UvElement *element, StitchState *state, I
vert_index = BM_elem_index_get(l->v);
element_iter = state->element_map->vert[vert_index];
- for(; element_iter; element_iter = element_iter->next){
- if(element_iter->separate){
- if(element_iter == element){
+ for (; element_iter; element_iter = element_iter->next) {
+ if (element_iter->separate) {
+ if (element_iter == element) {
continue;
}
- if(stitch_check_uvs_stitchable(element, element_iter, state)){
+ if (stitch_check_uvs_stitchable(element, element_iter, state)) {
island_stitch_data[element_iter->island].stitchableCandidate = 1;
island_stitch_data[element->island].stitchableCandidate = 1;
element->flag |= STITCH_STITCHABLE_CANDIDATE;
@@ -507,8 +511,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;
@@ -518,27 +521,27 @@ static void stitch_set_face_preview_buffer_position(BMFace *efa, StitchPreviewer
/* setup face preview for all coincident uvs and their faces */
static void stitch_setup_face_preview_for_uv_group(UvElement *element, StitchState *state, IslandStitchData *island_stitch_data,
- PreviewPosition *preview_position){
+ PreviewPosition *preview_position) {
StitchPreviewer *preview = uv_get_stitch_previewer();
/* static island does not change so returning immediately */
- if(state->snap_islands && !state->midpoints && state->static_island == element->island)
+ if (state->snap_islands && !state->midpoints && state->static_island == element->island)
return;
- if(state->snap_islands){
+ if (state->snap_islands) {
island_stitch_data[element->island].addedForPreview = 1;
}
- do{
+ do {
stitch_set_face_preview_buffer_position(element->face, preview, preview_position);
element = element->next;
- }while(element && !element->separate);
+ } while (element && !element->separate);
}
/* checks if uvs are indeed stitchable and registers so that they can be shown in preview */
static void stitch_validate_stichability (UvElement *element, StitchState *state, IslandStitchData *island_stitch_data,
- PreviewPosition *preview_position){
+ PreviewPosition *preview_position) {
UvElement *element_iter;
StitchPreviewer *preview;
int vert_index;
@@ -551,12 +554,12 @@ static void stitch_validate_stichability (UvElement *element, StitchState *state
preview = uv_get_stitch_previewer();
element_iter = state->element_map->vert[vert_index];
- for(; element_iter; element_iter = element_iter->next){
- if(element_iter->separate){
- if(element_iter == element)
+ for (; element_iter; element_iter = element_iter->next) {
+ if (element_iter->separate) {
+ if (element_iter == element)
continue;
- if(stitch_check_uvs_state_stitchable(element, element_iter, state)){
- if((element_iter->island == state->static_island) || (element->island == state->static_island)){
+ if (stitch_check_uvs_state_stitchable(element, element_iter, state)) {
+ if ((element_iter->island == state->static_island) || (element->island == state->static_island)) {
element->flag |= STITCH_STITCHABLE;
preview->num_stitchable++;
stitch_setup_face_preview_for_uv_group(element, state, island_stitch_data, preview_position);
@@ -567,7 +570,7 @@ static void stitch_validate_stichability (UvElement *element, StitchState *state
}
/* this can happen if the uvs to be stitched are not on a stitchable island */
- if(!(element->flag & STITCH_STITCHABLE)){
+ if (!(element->flag & STITCH_STITCHABLE)) {
preview->num_unstitchable++;
}
}
@@ -591,17 +594,17 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
/* cleanup previous preview */
stitch_preview_delete();
preview = stitch_preview_init();
- if(preview == NULL)
+ if (preview == NULL)
return 0;
preview_position = MEM_mallocN(state->em->bm->totface*sizeof(*preview_position), "stitch_face_preview_position");
/* each face holds its position in the preview buffer in tmp. -1 is uninitialized */
- for(i = 0; i < state->em->bm->totface; i++){
+ for (i = 0; i < state->em->bm->totface; i++) {
preview_position[i].data_position = STITCH_NO_PREVIEW;
}
island_stitch_data = MEM_callocN(sizeof(*island_stitch_data)*state->element_map->totalIslands, "stitch_island_data");
- if(!island_stitch_data){
+ if (!island_stitch_data) {
return 0;
}
@@ -612,27 +615,28 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
* First determine stitchability of uvs *
*****************************************/
- for(i = 0; i < state->selection_size; i++){
+ for (i = 0; i < state->selection_size; i++) {
UvElement *element = state->selection_stack[i];
determine_uv_stitchability(element, state, island_stitch_data);
}
/* set static island to one that is added for preview */
state->static_island %= state->element_map->totalIslands;
- while(!(island_stitch_data[state->static_island].stitchableCandidate)){
+ while (!(island_stitch_data[state->static_island].stitchableCandidate)) {
state->static_island++;
state->static_island %= state->element_map->totalIslands;
/* this is entirely possible if for example limit stitching with no stitchable verts or no selection */
- if(state->static_island == previous_island)
+ if (state->static_island == previous_island)
break;
}
- for(i = 0; i < state->selection_size; i++){
+ for (i = 0; i < state->selection_size; i++) {
UvElement *element = state->selection_stack[i];
- if(element->flag & STITCH_STITCHABLE_CANDIDATE){
+ if (element->flag & STITCH_STITCHABLE_CANDIDATE) {
element->flag &= ~STITCH_STITCHABLE_CANDIDATE;
stitch_validate_stichability(element, state, island_stitch_data, preview_position);
- }else{
+ }
+ else {
/* add to preview for unstitchable */
preview->num_unstitchable++;
}
@@ -641,14 +645,14 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
/*****************************************
* Setup preview for stitchable islands *
*****************************************/
- if(state->snap_islands){
- for(i = 0; i < state->element_map->totalIslands; i++){
- if(island_stitch_data[i].addedForPreview){
+ if (state->snap_islands) {
+ for (i = 0; i < state->element_map->totalIslands; i++) {
+ if (island_stitch_data[i].addedForPreview) {
int numOfIslandUVs = 0, j;
UvElement *element;
numOfIslandUVs = getNumOfIslandUvs(state->element_map, i);
element = &state->element_map->buf[state->element_map->islandIndices[i]];
- for(j = 0; j < numOfIslandUVs; j++, element++){
+ for (j = 0; j < numOfIslandUVs; j++, element++) {
stitch_set_face_preview_buffer_position(element->face, preview, preview_position);
}
}
@@ -658,7 +662,7 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
/*********************************************************************
* Setup the preview buffers and fill them with the appropriate data *
*********************************************************************/
- if(!final){
+ if (!final) {
BMIter liter;
BMLoop *l;
MLoopUV *luv;
@@ -674,20 +678,20 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
preview->num_static_tris = state->tris_per_island[state->static_island];
/* will cause cancel and freeing of all data structures so OK */
- if(!preview->preview_polys || !preview->preview_stitchable || !preview->preview_unstitchable){
+ if (!preview->preview_polys || !preview->preview_stitchable || !preview->preview_unstitchable) {
return 0;
}
/* copy data from MTFaces to the preview display buffers */
BM_ITER(efa, &iter, state->em->bm, BM_FACES_OF_MESH, NULL) {
/* just to test if face was added for processing. uvs of inselected vertices will return NULL */
- UvElement *element = ED_get_uv_element(state->element_map, efa, BM_FACE_FIRST_LOOP(efa));
+ UvElement *element = ED_uv_element_get(state->element_map, efa, BM_FACE_FIRST_LOOP(efa));
- if(element){
+ if (element) {
int numoftris = efa->len - 2;
int index = BM_elem_index_get(efa);
int face_preview_pos = preview_position[index].data_position;
- if(face_preview_pos != STITCH_NO_PREVIEW){
+ if (face_preview_pos != STITCH_NO_PREVIEW) {
preview->uvs_per_polygon[preview_position[index].polycount_position] = efa->len;
BM_ITER_INDEX(l, &liter, state->em->bm, BM_LOOPS_OF_FACE, efa, i) {
luv = CustomData_bmesh_get(&state->em->bm->ldata, l->head.data, CD_MLOOPUV);
@@ -695,12 +699,12 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
}
}
- if(element->island == state->static_island){
+ if (element->island == state->static_island) {
BMLoop *fl = BM_FACE_FIRST_LOOP(efa);
MLoopUV *fuv = CustomData_bmesh_get(&state->em->bm->ldata, fl->head.data, CD_MLOOPUV);
BM_ITER_INDEX(l, &liter, state->em->bm, BM_LOOPS_OF_FACE, efa, i) {
- if(i < numoftris){
+ if (i < numoftris) {
/* using next since the first uv is already accounted for */
BMLoop *lnext = l->next;
MLoopUV *luvnext = CustomData_bmesh_get(&state->em->bm->ldata, lnext->next->head.data, CD_MLOOPUV);
@@ -710,16 +714,19 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
memcpy(preview->static_tris + buffer_index + 2, luv->uv, 2*sizeof(float));
memcpy(preview->static_tris + buffer_index + 4, luvnext->uv, 2*sizeof(float));
buffer_index += 6;
- }else break;
+ }
+ else {
+ break;
+ }
}
}
}
}
/* fill the appropriate preview buffers */
- for(i = 0; i < state->total_separate_uvs; i++){
+ for (i = 0; i < state->total_separate_uvs; i++) {
UvElement *element = (UvElement *)state->uvs[i];
- if(element->flag & STITCH_STITCHABLE){
+ if (element->flag & STITCH_STITCHABLE) {
l = element->l;
luv = CustomData_bmesh_get(&state->em->bm->ldata, l->head.data, CD_MLOOPUV);
@@ -727,7 +734,7 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
stitchBufferIndex++;
}
- else if(element->flag & STITCH_SELECTED){
+ else if (element->flag & STITCH_SELECTED) {
l = element->l;
luv = CustomData_bmesh_get(&state->em->bm->ldata, l->head.data, CD_MLOOPUV);
@@ -745,9 +752,9 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
uvfinal_map = MEM_mallocN(state->element_map->totalUVs*sizeof(*uvfinal_map), "stitch_uv_final_map");
/* first pass, calculate final position for stitchable uvs of the static island */
- for(i = 0; i < state->selection_size; i++){
+ for (i = 0; i < state->selection_size; i++) {
UvElement *element = state->selection_stack[i];
- if(element->flag & STITCH_STITCHABLE){
+ if (element->flag & STITCH_STITCHABLE) {
BMLoop *l;
MLoopUV *luv;
UvElement *element_iter;
@@ -761,20 +768,21 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
copy_v2_v2(final_position[i].uv, luv->uv);
final_position[i].count = 1;
- if(state->snap_islands && element->island == state->static_island && !stitch_midpoints)
+ if (state->snap_islands && element->island == state->static_island && !stitch_midpoints)
continue;
element_iter = state->element_map->vert[BM_elem_index_get(l->v)];
- for(;element_iter; element_iter = element_iter->next){
- if(element_iter->separate){
- if(stitch_check_uvs_state_stitchable(element, element_iter, state)){
+ for (;element_iter; element_iter = element_iter->next) {
+ if (element_iter->separate) {
+ if (stitch_check_uvs_state_stitchable(element, element_iter, state)) {
l = element_iter->l;
luv = CustomData_bmesh_get(&state->em->bm->ldata, l->head.data, CD_MLOOPUV);
- if(stitch_midpoints){
+ if (stitch_midpoints) {
add_v2_v2(final_position[i].uv, luv->uv);
final_position[i].count++;
- }else if(element_iter->island == state->static_island){
+ }
+ else if (element_iter->island == state->static_island) {
/* if multiple uvs on the static island exist,
* last checked remains. to disambiguate we need to limit or use
* edge stitch */
@@ -784,17 +792,17 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
}
}
}
- if(stitch_midpoints){
+ if (stitch_midpoints) {
final_position[i].uv[0] /= final_position[i].count;
final_position[i].uv[1] /= final_position[i].count;
}
}
/* second pass, calculate island rotation and translation before modifying any uvs */
- if(state->snap_islands){
- for(i = 0; i < state->selection_size; i++){
+ if (state->snap_islands) {
+ for (i = 0; i < state->selection_size; i++) {
UvElement *element = state->selection_stack[i];
- if(element->flag & STITCH_STITCHABLE){
+ if (element->flag & STITCH_STITCHABLE) {
BMLoop *l;
MLoopUV *luv;
@@ -812,18 +820,18 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
}
/* only calculate rotation when an edge has been fully selected */
- for(i = 0; i < state->total_boundary_edges; i++){
+ for (i = 0; i < state->total_boundary_edges; i++) {
UvEdge *edge = state->edges+i;
- if((state->uvs[edge->uv1]->flag & STITCH_STITCHABLE) && (state->uvs[edge->uv2]->flag & STITCH_STITCHABLE)){
+ if ((state->uvs[edge->uv1]->flag & STITCH_STITCHABLE) && (state->uvs[edge->uv2]->flag & STITCH_STITCHABLE)) {
stitch_island_calculate_edge_rotation(edge, state, final_position, uvfinal_map, island_stitch_data);
island_stitch_data[state->uvs[edge->uv1]->island].use_edge_rotation = 1;
}
}
- for(i = 0; i < state->selection_size; i++){
+ for (i = 0; i < state->selection_size; i++) {
UvElement *element = state->selection_stack[i];
- if(!island_stitch_data[element->island].use_edge_rotation){
- if(element->flag & STITCH_STITCHABLE){
+ if (!island_stitch_data[element->island].use_edge_rotation) {
+ if (element->flag & STITCH_STITCHABLE) {
stitch_island_calculate_vert_rotation(element, state, island_stitch_data);
}
}
@@ -832,12 +840,12 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
}
/* third pass, propagate changes to coincident uvs */
- for(i = 0; i < state->selection_size; i++){
+ for (i = 0; i < state->selection_size; i++) {
UvElement *element = state->selection_stack[i];
- if(element->flag & STITCH_STITCHABLE){
+ if (element->flag & STITCH_STITCHABLE) {
UvElement *element_iter = element;
/* propagate to coincident uvs */
- do{
+ do {
BMLoop *l;
MLoopUV *luv;
@@ -846,30 +854,31 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
element_iter->flag |= STITCH_PROCESSED;
/* either flush to preview or to the MTFace, if final */
- if(final){
+ if (final) {
copy_v2_v2(luv->uv, final_position[i].uv);
uvedit_uv_select(state->em, scene, l);
- }else {
+ }
+ else {
int face_preview_pos = preview_position[BM_elem_index_get(element_iter->face)].data_position;
- if(face_preview_pos != STITCH_NO_PREVIEW){
+ if (face_preview_pos != STITCH_NO_PREVIEW) {
copy_v2_v2(preview->preview_polys + face_preview_pos + 2*element_iter->tfindex,
final_position[i].uv);
}
}
/* end of calculations, keep only the selection flag */
- if( (!state->snap_islands) || ((!stitch_midpoints) && (element_iter->island == state->static_island))) {
+ if ( (!state->snap_islands) || ((!stitch_midpoints) && (element_iter->island == state->static_island))) {
element_iter->flag &= STITCH_SELECTED;
}
element_iter = element_iter->next;
- }while(element_iter && !element_iter->separate);
+ } while (element_iter && !element_iter->separate);
}
}
/* final pass, calculate Island translation/rotation if needed */
- if(state->snap_islands){
+ if (state->snap_islands) {
stitch_calculate_island_snapping(state, preview_position, preview, island_stitch_data, final);
}
@@ -881,7 +890,7 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
return 1;
}
-/* Stitch hash initialisation functions */
+/* Stitch hash initialization functions */
static unsigned int uv_edge_hash(const void *key)
{
UvEdge *edge = (UvEdge *)key;
@@ -895,7 +904,7 @@ static int uv_edge_compare(const void *a, const void *b)
UvEdge *edge1 = (UvEdge *)a;
UvEdge *edge2 = (UvEdge *)b;
- if((edge1->uv1 == edge2->uv1) && (edge1->uv2 == edge2->uv2)){
+ if ((edge1->uv1 == edge2->uv1) && (edge1->uv2 == edge2->uv2)) {
return 0;
}
return 1;
@@ -913,23 +922,24 @@ static void stitch_select_uv(UvElement *element, StitchState *state, int always_
element_iter = state->element_map->vert[BM_elem_index_get(l->v)];
/* first deselect all common uvs */
- for(; element_iter; element_iter = element_iter->next){
- if(element_iter->separate){
+ for (; element_iter; element_iter = element_iter->next) {
+ if (element_iter->separate) {
/* only separators go to selection */
- if(element_iter->flag & STITCH_SELECTED){
+ if (element_iter->flag & STITCH_SELECTED) {
int i;
- if(always_select)
+ if (always_select)
continue;
element_iter->flag &= ~STITCH_SELECTED;
- for(i = 0; i < state->selection_size; i++){
- if(selection_stack[i] == element_iter){
+ for (i = 0; i < state->selection_size; i++) {
+ if (selection_stack[i] == element_iter) {
(state->selection_size)--;
selection_stack[i] = selection_stack[state->selection_size];
break;
}
}
- }else{
+ }
+ else {
element_iter->flag |= STITCH_SELECTED;
selection_stack[state->selection_size++] = element_iter;
}
@@ -979,23 +989,24 @@ static int stitch_init(bContext *C, wmOperator *op)
op->customdata = state;
- if(!state)
+ if (!state)
return 0;
/* initialize state */
state->use_limit = RNA_boolean_get(op->ptr, "use_limit");
state->limit_dist = RNA_float_get(op->ptr, "limit");
- state->em = em = ((Mesh *)obedit->data)->edit_btmesh;
+ state->em = em = BMEdit_FromObject(obedit);
state->snap_islands = RNA_boolean_get(op->ptr, "snap_islands");
state->static_island = RNA_int_get(op->ptr, "static_island");
state->midpoints = RNA_boolean_get(op->ptr, "midpoint_snap");
/* in uv synch selection, all uv's are visible */
- if(ts->uv_flag & UV_SYNC_SELECTION){
- state->element_map = EDBM_make_uv_element_map(state->em, 0, 1);
- }else{
- state->element_map = EDBM_make_uv_element_map(state->em, 1, 1);
+ if (ts->uv_flag & UV_SYNC_SELECTION) {
+ state->element_map = EDBM_uv_element_map_create(state->em, 0, 1);
+ }
+ else {
+ state->element_map = EDBM_uv_element_map_create(state->em, 1, 1);
}
- if(!state->element_map){
+ if (!state->element_map) {
stitch_state_delete(state);
return 0;
}
@@ -1005,8 +1016,8 @@ static int stitch_init(bContext *C, wmOperator *op)
state->static_island %= state->element_map->totalIslands;
/* Count 'unique' uvs */
- for(i = 0; i < state->element_map->totalUVs; i++){
- if(state->element_map->buf[i].separate){
+ for (i = 0; i < state->element_map->totalUVs; i++) {
+ if (state->element_map->buf[i].separate) {
counter++;
}
}
@@ -1025,7 +1036,7 @@ static int stitch_init(bContext *C, wmOperator *op)
edgeHash = BLI_ghash_new(uv_edge_hash, uv_edge_compare, "stitch_edge_hash");
all_edges = MEM_mallocN(sizeof(*all_edges)*state->element_map->totalUVs, "stitch_all_edges");
- if(!state->selection_stack || !state->uvs || !map || !edgeHash || !all_edges){
+ if (!state->selection_stack || !state->uvs || !map || !edgeHash || !all_edges) {
stitch_state_delete(state);
return 0;
}
@@ -1033,10 +1044,10 @@ static int stitch_init(bContext *C, wmOperator *op)
/* So that we can use this as index for the UvElements */
counter = -1;
/* initialize the unique UVs and map */
- for(i = 0; i < em->bm->totvert; i++){
+ for (i = 0; i < em->bm->totvert; i++) {
UvElement *element = state->element_map->vert[i];
- for(; element; element = element->next){
- if(element->separate){
+ for (; element; element = element->next) {
+ if (element->separate) {
counter++;
state->uvs[counter] = element;
}
@@ -1052,9 +1063,9 @@ static int stitch_init(bContext *C, wmOperator *op)
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
- UvElement *element = ED_get_uv_element(state->element_map, efa, l);
+ UvElement *element = ED_uv_element_get(state->element_map, efa, l);
int offset1, itmp1 = element - state->element_map->buf;
- int offset2, itmp2 = ED_get_uv_element(state->element_map, efa, l->next) - state->element_map->buf;
+ int offset2, itmp2 = ED_uv_element_get(state->element_map, efa, l->next) - state->element_map->buf;
offset1 = map[itmp1];
offset2 = map[itmp2];
@@ -1063,20 +1074,20 @@ static int stitch_init(bContext *C, wmOperator *op)
all_edges[counter].element = element;
/* using an order policy, sort uvs according to address space. This avoids
* Having two different UvEdges with the same uvs on different positions */
- if(offset1 < offset2){
+ if (offset1 < offset2) {
all_edges[counter].uv1 = offset1;
all_edges[counter].uv2 = offset2;
}
- else{
+ else {
all_edges[counter].uv1 = offset2;
all_edges[counter].uv2 = offset1;
}
- if(BLI_ghash_haskey(edgeHash, &all_edges[counter])){
+ if (BLI_ghash_haskey(edgeHash, &all_edges[counter])) {
char *flag = BLI_ghash_lookup(edgeHash, &all_edges[counter]);
*flag = 0;
}
- else{
+ else {
BLI_ghash_insert(edgeHash, &all_edges[counter], &(all_edges[counter].flag));
all_edges[counter].flag = STITCH_BOUNDARY;
}
@@ -1088,14 +1099,14 @@ static int stitch_init(bContext *C, wmOperator *op)
ghi = BLI_ghashIterator_new(edgeHash);
total_edges = 0;
/* fill the edges with data */
- for(; !BLI_ghashIterator_isDone(ghi); BLI_ghashIterator_step(ghi)){
+ for (; !BLI_ghashIterator_isDone(ghi); BLI_ghashIterator_step(ghi)) {
UvEdge *edge = ((UvEdge *)BLI_ghashIterator_getKey(ghi));
- if(edge->flag & STITCH_BOUNDARY){
+ if (edge->flag & STITCH_BOUNDARY) {
total_edges++;
}
}
state->edges = edges = MEM_mallocN(sizeof(*edges)*total_edges, "stitch_edges");
- if(!ghi || !edges){
+ if (!ghi || !edges) {
MEM_freeN(all_edges);
stitch_state_delete(state);
return 0;
@@ -1104,9 +1115,9 @@ static int stitch_init(bContext *C, wmOperator *op)
state->total_boundary_edges = total_edges;
/* fill the edges with data */
- for(i = 0, BLI_ghashIterator_init(ghi, edgeHash); !BLI_ghashIterator_isDone(ghi); BLI_ghashIterator_step(ghi)){
+ for (i = 0, BLI_ghashIterator_init(ghi, edgeHash); !BLI_ghashIterator_isDone(ghi); BLI_ghashIterator_step(ghi)) {
UvEdge *edge = ((UvEdge *)BLI_ghashIterator_getKey(ghi));
- if(edge->flag & STITCH_BOUNDARY){
+ if (edge->flag & STITCH_BOUNDARY) {
edges[i++] = *((UvEdge *)BLI_ghashIterator_getKey(ghi));
}
}
@@ -1125,7 +1136,7 @@ static int stitch_init(bContext *C, wmOperator *op)
* a point "inside" the island, that can be provided by
* the opposite uv for a quad, or the next uv for a triangle. */
- for(i = 0; i < total_edges; i++){
+ for (i = 0; i < total_edges; i++) {
float normal[2];
stitch_calculate_edge_normal(em, edges + i, normal);
@@ -1142,31 +1153,32 @@ static int stitch_init(bContext *C, wmOperator *op)
state->selection_size = 0;
/* Load old selection if redoing operator with different settings */
- if(RNA_struct_property_is_set(op->ptr, "selection")){
+ if (RNA_struct_property_is_set(op->ptr, "selection")) {
int faceIndex, elementIndex;
UvElement *element;
- EDBM_init_index_arrays(em, 0, 0, 1);
+ EDBM_index_arrays_init(em, 0, 0, 1);
RNA_BEGIN(op->ptr, itemptr, "selection") {
faceIndex = RNA_int_get(&itemptr, "face_index");
elementIndex = RNA_int_get(&itemptr, "element_index");
- efa = EDBM_get_face_for_index(em, faceIndex);
- element = ED_get_uv_element(state->element_map, efa, BM_iter_at_index(NULL, BM_LOOPS_OF_FACE, efa, elementIndex));
+ efa = EDBM_face_at_index(em, faceIndex);
+ element = ED_uv_element_get(state->element_map, efa, BM_iter_at_index(NULL, BM_LOOPS_OF_FACE, efa, elementIndex));
stitch_select_uv(element, state, 1);
}
RNA_END;
- EDBM_free_index_arrays(em);
+ EDBM_index_arrays_free(em);
/* Clear the selection */
RNA_collection_clear(op->ptr, "selection");
- } else {
+ }
+ else {
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
i = 0;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
- if(uvedit_uv_selected(em, scene, l)){
- UvElement *element = ED_get_uv_element(state->element_map, efa, l);
+ if (uvedit_uv_selected(em, scene, l)) {
+ UvElement *element = ED_uv_element_get(state->element_map, efa, l);
stitch_select_uv(element, state, 1);
}
i++;
@@ -1174,23 +1186,23 @@ static int stitch_init(bContext *C, wmOperator *op)
}
}
- /***** initialise static island preview data *****/
+ /***** initialize static island preview data *****/
state->tris_per_island = MEM_mallocN(sizeof(*state->tris_per_island)*state->element_map->totalIslands,
"stitch island tris");
- for(i = 0; i < state->element_map->totalIslands; i++){
+ for (i = 0; i < state->element_map->totalIslands; i++) {
state->tris_per_island[i] = 0;
}
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- UvElement *element = ED_get_uv_element(state->element_map, efa, BM_FACE_FIRST_LOOP(efa));
+ UvElement *element = ED_uv_element_get(state->element_map, efa, BM_FACE_FIRST_LOOP(efa));
- if(element){
+ if (element) {
state->tris_per_island[element->island] += (efa->len > 2)? efa->len-2 : 0;
}
}
- if(!stitch_process_data(state, scene, 0)){
+ if (!stitch_process_data(state, scene, 0)) {
stitch_state_delete(state);
return 0;
}
@@ -1202,7 +1214,7 @@ static int stitch_init(bContext *C, wmOperator *op)
static int stitch_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
Object *obedit = CTX_data_edit_object(C);
- if(!stitch_init(C, op))
+ if (!stitch_init(C, op))
return OPERATOR_CANCELLED;
WM_event_add_modal_handler(C, op);
@@ -1224,7 +1236,7 @@ static void stitch_exit(bContext *C, wmOperator *op, int finished)
stitch_state = (StitchState *)op->customdata;
- if(finished){
+ if (finished) {
int i;
RNA_float_set(op->ptr, "limit", stitch_state->limit_dist);
@@ -1234,7 +1246,7 @@ static void stitch_exit(bContext *C, wmOperator *op, int finished)
RNA_boolean_set(op->ptr, "midpoint_snap", stitch_state->midpoints);
/* Store selection for re-execution of stitch */
- for(i = 0; i < stitch_state->selection_size; i++){
+ for (i = 0; i < stitch_state->selection_size; i++) {
PointerRNA itemptr;
UvElement *element = stitch_state->selection_stack[i];
@@ -1249,7 +1261,7 @@ static void stitch_exit(bContext *C, wmOperator *op, int finished)
uvedit_live_unwrap_update(sima, scene, obedit);
}
- if(sa)
+ if (sa)
ED_area_headerprint(sa, NULL);
DAG_id_tag_update(obedit->data, 0);
@@ -1273,12 +1285,13 @@ static int stitch_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- if(!stitch_init(C, op))
+ if (!stitch_init(C, op))
return OPERATOR_CANCELLED;
- if(stitch_process_data((StitchState *)op->customdata, scene, 1)){
+ if (stitch_process_data((StitchState *)op->customdata, scene, 1)) {
stitch_exit(C, op, 1);
return OPERATOR_FINISHED;
- }else {
+ }
+ else {
return stitch_cancel(C, op);
}
}
@@ -1294,14 +1307,13 @@ 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 */
/* This works due to setting of tmp in find nearest uv vert */
- UvElement *element = ED_get_uv_element(stitch_state->element_map, hit.efa, hit.l);
+ UvElement *element = ED_uv_element_get(stitch_state->element_map, hit.efa, hit.l);
stitch_select_uv(element, stitch_state, 0);
}
@@ -1314,7 +1326,7 @@ static int stitch_modal(bContext *C, wmOperator *op, wmEvent *event)
stitch_state = (StitchState *)op->customdata;
- switch(event->type){
+ switch(event->type) {
case MIDDLEMOUSE:
return OPERATOR_PASS_THROUGH;
@@ -1324,11 +1336,11 @@ static int stitch_modal(bContext *C, wmOperator *op, wmEvent *event)
case LEFTMOUSE:
- if(event->shift && (U.flag & USER_LMOUSESELECT)){
- if(event->val == KM_RELEASE){
+ if (event->shift && (U.flag & USER_LMOUSESELECT)) {
+ if (event->val == KM_RELEASE) {
stitch_select(C, scene, event, stitch_state);
- if(!stitch_process_data(stitch_state, scene, 0)){
+ if (!stitch_process_data(stitch_state, scene, 0)) {
return stitch_cancel(C, op);
}
}
@@ -1336,7 +1348,7 @@ static int stitch_modal(bContext *C, wmOperator *op, wmEvent *event)
}
case PADENTER:
case RETKEY:
- if(stitch_process_data(stitch_state, scene, 1)){
+ if (stitch_process_data(stitch_state, scene, 1)) {
stitch_exit(C, op, 1);
return OPERATOR_FINISHED;
}
@@ -1347,35 +1359,36 @@ static int stitch_modal(bContext *C, wmOperator *op, wmEvent *event)
/* Increase limit */
case PADPLUSKEY:
case WHEELUPMOUSE:
- if(event->alt){
+ if (event->alt) {
stitch_state->limit_dist += 0.01;
- if(!stitch_process_data(stitch_state, scene, 0)){
+ if (!stitch_process_data(stitch_state, scene, 0)) {
return stitch_cancel(C, op);
}
break;
}
- else{
+ else {
return OPERATOR_PASS_THROUGH;
}
/* Decrease limit */
case PADMINUS:
case WHEELDOWNMOUSE:
- if(event->alt){
+ if (event->alt) {
stitch_state->limit_dist -= 0.01;
stitch_state->limit_dist = MAX2(0.01, stitch_state->limit_dist);
- if(!stitch_process_data(stitch_state, scene, 0)){
+ if (!stitch_process_data(stitch_state, scene, 0)) {
return stitch_cancel(C, op);
}
break;
- }else{
+ }
+ else {
return OPERATOR_PASS_THROUGH;
}
/* Use Limit (Default off)*/
case LKEY:
- if(event->val == KM_PRESS){
+ if (event->val == KM_PRESS) {
stitch_state->use_limit = !stitch_state->use_limit;
- if(!stitch_process_data(stitch_state, scene, 0)){
+ if (!stitch_process_data(stitch_state, scene, 0)) {
return stitch_cancel(C, op);
}
break;
@@ -1383,11 +1396,11 @@ static int stitch_modal(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_RUNNING_MODAL;
case IKEY:
- if(event->val == KM_PRESS){
+ if (event->val == KM_PRESS) {
stitch_state->static_island++;
stitch_state->static_island %= stitch_state->element_map->totalIslands;
- if(!stitch_process_data(stitch_state, scene, 0)){
+ if (!stitch_process_data(stitch_state, scene, 0)) {
return stitch_cancel(C, op);
}
break;
@@ -1395,9 +1408,9 @@ static int stitch_modal(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_RUNNING_MODAL;
case MKEY:
- if(event->val == KM_PRESS){
+ if (event->val == KM_PRESS) {
stitch_state->midpoints = !stitch_state->midpoints;
- if(!stitch_process_data(stitch_state, scene, 0)){
+ if (!stitch_process_data(stitch_state, scene, 0)) {
return stitch_cancel(C, op);
}
}
@@ -1405,13 +1418,13 @@ static int stitch_modal(bContext *C, wmOperator *op, wmEvent *event)
/* Select geometry*/
case RIGHTMOUSE:
- if(!event->shift){
+ if (!event->shift) {
return stitch_cancel(C, op);
}
- if(event->val == KM_RELEASE && !(U.flag & USER_LMOUSESELECT)){
+ if (event->val == KM_RELEASE && !(U.flag & USER_LMOUSESELECT)) {
stitch_select(C, scene, event, stitch_state);
- if(!stitch_process_data(stitch_state, scene, 0)){
+ if (!stitch_process_data(stitch_state, scene, 0)) {
return stitch_cancel(C, op);
}
break;
@@ -1420,13 +1433,14 @@ static int stitch_modal(bContext *C, wmOperator *op, wmEvent *event)
/* snap islands on/off */
case SKEY:
- if(event->val == KM_PRESS){
+ if (event->val == KM_PRESS) {
stitch_state->snap_islands = !stitch_state->snap_islands;
- if(!stitch_process_data(stitch_state, scene, 0)){
+ if (!stitch_process_data(stitch_state, scene, 0)) {
return stitch_cancel(C, op);
}
break;
- } else
+ }
+ else
return OPERATOR_RUNNING_MODAL;
default:
@@ -1454,7 +1468,7 @@ void UV_OT_stitch(wmOperatorType *ot)
ot->modal = stitch_modal;
ot->exec = stitch_exec;
ot->cancel = stitch_cancel;
- ot->poll= ED_operator_uvedit;
+ ot->poll = ED_operator_uvedit;
/* properties */
RNA_def_boolean(ot->srna, "use_limit", 0, "Use Limit", "Stitch UVs within a specified limit distance");
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 7233efef20f..ac04e25216d 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -88,8 +88,8 @@
static int ED_uvedit_ensure_uvs(bContext *C, Scene *scene, Object *obedit)
{
- Main *bmain= CTX_data_main(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ Main *bmain = CTX_data_main(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMIter iter;
Image *ima;
@@ -98,33 +98,34 @@ static int ED_uvedit_ensure_uvs(bContext *C, Scene *scene, Object *obedit)
SpaceLink *slink;
SpaceImage *sima;
- if(ED_uvedit_test(obedit)) {
+ if (ED_uvedit_test(obedit)) {
return 1;
}
- if(em && em->bm->totface && !CustomData_has_layer(&em->bm->pdata, CD_MTEXPOLY)) {
+ if (em && em->bm->totface && !CustomData_has_layer(&em->bm->pdata, CD_MTEXPOLY)) {
BM_data_layer_add(em->bm, &em->bm->pdata, CD_MTEXPOLY);
BM_data_layer_add(em->bm, &em->bm->ldata, CD_MLOOPUV);
+ ED_mesh_uv_loop_reset_ex(C, obedit->data, 0);
}
- if(!ED_uvedit_test(obedit)) {
+ if (!ED_uvedit_test(obedit)) {
return 0;
}
ima= CTX_data_edit_image(C);
- if(!ima) {
+ if (!ima) {
/* no image in context in the 3d view, we find first image window .. */
sc= CTX_wm_screen(C);
- for(sa=sc->areabase.first; sa; sa=sa->next) {
+ for (sa=sc->areabase.first; sa; sa=sa->next) {
slink= sa->spacedata.first;
- if(slink->spacetype == SPACE_IMAGE) {
+ if (slink->spacetype == SPACE_IMAGE) {
sima= (SpaceImage*)slink;
ima= sima->image;
- if(ima) {
- if(ima->type==IMA_TYPE_R_RESULT || ima->type==IMA_TYPE_COMPOSITE)
+ if (ima) {
+ if (ima->type==IMA_TYPE_R_RESULT || ima->type==IMA_TYPE_COMPOSITE)
ima= NULL;
else
break;
@@ -133,7 +134,7 @@ static int ED_uvedit_ensure_uvs(bContext *C, Scene *scene, Object *obedit)
}
}
- if(ima)
+ if (ima)
ED_uvedit_assign_image(bmain, scene, obedit, ima, NULL);
/* select new UV's */
@@ -154,13 +155,13 @@ 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))
+ if (scene->toolsettings->uv_flag & UV_SYNC_SELECTION) {
+ if (BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
continue;
}
- else if(BM_elem_flag_test(efa, BM_ELEM_HIDDEN) || !BM_elem_flag_test(efa, BM_ELEM_SELECT))
+ else if (BM_elem_flag_test(efa, BM_ELEM_HIDDEN) || !BM_elem_flag_test(efa, BM_ELEM_SELECT))
continue;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -194,16 +195,16 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
handle = param_construct_begin();
- if(correct_aspect) {
+ if (correct_aspect) {
efa = BM_active_face_get(em->bm, TRUE);
- if(efa) {
+ if (efa) {
float aspx, aspy;
tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
ED_image_uv_aspect(tf->tpage, &aspx, &aspy);
- if(aspx!=aspy)
+ if (aspx!=aspy)
param_aspect_ratio(handle, aspx, aspy);
}
}
@@ -222,7 +223,7 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
float *uv[4];
int lsel;
- if((BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) || (sel && BM_elem_flag_test(efa, BM_ELEM_SELECT)==0))
+ if ((BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) || (sel && BM_elem_flag_test(efa, BM_ELEM_SELECT)==0))
continue;
/* tf= (MTexPoly *)CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */
@@ -305,9 +306,9 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
BLI_end_edgefill();
}
- if(!implicit) {
+ if (!implicit) {
BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
- if(BM_elem_flag_test(eed, BM_ELEM_SEAM)) {
+ if (BM_elem_flag_test(eed, BM_ELEM_SEAM)) {
ParamKey vkeys[2];
vkeys[0] = (ParamKey)BM_elem_index_get(eed->v1);
vkeys[1] = (ParamKey)BM_elem_index_get(eed->v2);
@@ -332,11 +333,11 @@ static void texface_from_original_index(BMFace *efa, int index, float **uv, Para
*pin = 0;
*select = 1;
- if(index == ORIGINDEX_NONE)
+ if (index == ORIGINDEX_NONE)
return;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
- if(BM_elem_index_get(l->v) == index) {
+ if (BM_elem_index_get(l->v) == index) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
*uv = luv->uv;
*pin = (luv->flag & MLOOPUV_PINNED)? 1 : 0;
@@ -345,7 +346,7 @@ static void texface_from_original_index(BMFace *efa, int index, float **uv, Para
}
}
-/* unwrap handle initialisation for subsurf aware-unwrapper. The many modifications required to make the original function(see above)
+/* unwrap handle initialization for subsurf aware-unwrapper. The many modifications required to make the original function(see above)
* work justified the existence of a new function. */
static ParamHandle *construct_param_handle_subsurfed(Scene *scene, BMEditMesh *em, short fill, short sel, short correct_aspect)
{
@@ -356,7 +357,7 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, BMEditMesh *e
BMFace *editFace;
int i;
- /* modifier initialisation data, will control what type of subdivision will happen*/
+ /* modifier initialization data, will control what type of subdivision will happen*/
SubsurfModifierData smd = {{0}};
/* Used to hold subsurfed Mesh */
DerivedMesh *derivedMesh, *initialDerived;
@@ -376,17 +377,17 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, BMEditMesh *e
handle = param_construct_begin();
- if(correct_aspect) {
+ if (correct_aspect) {
editFace = BM_active_face_get(em->bm, TRUE);
- if(editFace) {
+ if (editFace) {
MTexPoly *tf;
float aspx, aspy;
tf= CustomData_bmesh_get(&em->bm->pdata, editFace->head.data, CD_MTEXPOLY);
ED_image_uv_aspect(tf->tpage, &aspx, &aspy);
- if(aspx!=aspy)
+ if (aspx!=aspy)
param_aspect_ratio(handle, aspx, aspy);
}
}
@@ -416,25 +417,25 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, BMEditMesh *e
faceMap = MEM_mallocN(numOfFaces*sizeof(BMFace *), "unwrap_edit_face_map");
BM_mesh_elem_index_ensure(em->bm, BM_VERT);
- EDBM_init_index_arrays(em, 0, 1, 1);
+ EDBM_index_arrays_init(em, 0, 1, 1);
/* map subsurfed faces to original editFaces */
- for(i = 0; i < numOfFaces; i++)
- faceMap[i] = EDBM_get_face_for_index(em, origFaceIndices[i]);
+ for (i = 0; i < numOfFaces; i++)
+ faceMap[i] = EDBM_face_at_index(em, origFaceIndices[i]);
edgeMap = MEM_mallocN(numOfEdges*sizeof(BMEdge *), "unwrap_edit_edge_map");
/* map subsurfed edges to original editEdges */
- for(i = 0; i < numOfEdges; i++) {
+ for (i = 0; i < numOfEdges; i++) {
/* not all edges correspond to an old edge */
edgeMap[i] = (origEdgeIndices[i] != -1)?
- EDBM_get_edge_for_index(em, origEdgeIndices[i]) : NULL;
+ EDBM_edge_at_index(em, origEdgeIndices[i]) : NULL;
}
- EDBM_free_index_arrays(em);
+ EDBM_index_arrays_free(em);
/* Prepare and feed faces to the solver */
- for(i = 0; i < numOfFaces; i++) {
+ for (i = 0; i < numOfFaces; i++) {
ParamKey key, vkeys[4];
ParamBool pin[4], select[4];
float *co[4];
@@ -443,12 +444,12 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, BMEditMesh *e
face = subsurfedFaces+i;
- if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) {
- if(BM_elem_flag_test(origFace, BM_ELEM_HIDDEN))
+ if (scene->toolsettings->uv_flag & UV_SYNC_SELECTION) {
+ if (BM_elem_flag_test(origFace, BM_ELEM_HIDDEN))
continue;
}
else {
- if(BM_elem_flag_test(origFace, BM_ELEM_HIDDEN) || (sel && !BM_elem_flag_test(origFace, BM_ELEM_SELECT)))
+ if (BM_elem_flag_test(origFace, BM_ELEM_HIDDEN) || (sel && !BM_elem_flag_test(origFace, BM_ELEM_SELECT)))
continue;
}
@@ -475,8 +476,8 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, BMEditMesh *e
}
/* these are calculated from original mesh too */
- for(edge = subsurfedEdges, i = 0; i < numOfEdges; i++, edge++) {
- if((edgeMap[i] != NULL) && BM_elem_flag_test(edgeMap[i], BM_ELEM_SEAM)) {
+ for (edge = subsurfedEdges, i = 0; i < numOfEdges; i++, edge++) {
+ if ((edgeMap[i] != NULL) && BM_elem_flag_test(edgeMap[i], BM_ELEM_SEAM)) {
ParamKey vkeys[2];
vkeys[0] = (ParamKey)edge->v1;
vkeys[1] = (ParamKey)edge->v2;
@@ -509,14 +510,14 @@ typedef struct MinStretch {
static int minimize_stretch_init(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
MinStretch *ms;
- int fill_holes= RNA_boolean_get(op->ptr, "fill_holes");
- short implicit= 1;
+ int fill_holes = RNA_boolean_get(op->ptr, "fill_holes");
+ short implicit = 1;
- if(!uvedit_have_selection(scene, em, implicit)) {
+ if (!uvedit_have_selection(scene, em, implicit)) {
return 0;
}
@@ -531,7 +532,7 @@ static int minimize_stretch_init(bContext *C, wmOperator *op)
ms->lasttime= PIL_check_seconds_timer();
param_stretch_begin(ms->handle);
- if(ms->blend != 0.0f)
+ if (ms->blend != 0.0f)
param_stretch_blend(ms->handle, ms->blend);
op->customdata= ms;
@@ -550,12 +551,12 @@ static void minimize_stretch_iteration(bContext *C, wmOperator *op, int interact
ms->i++;
RNA_int_set(op->ptr, "iterations", ms->i);
- if(interactive && (PIL_check_seconds_timer() - ms->lasttime > 0.5)) {
+ if (interactive && (PIL_check_seconds_timer() - ms->lasttime > 0.5)) {
char str[100];
param_flush(ms->handle);
- if(sa) {
+ if (sa) {
BLI_snprintf(str, sizeof(str), "Minimize Stretch. Blend %.2f", ms->blend);
ED_area_headerprint(sa, str);
}
@@ -572,12 +573,12 @@ static void minimize_stretch_exit(bContext *C, wmOperator *op, int cancel)
MinStretch *ms= op->customdata;
ScrArea *sa= CTX_wm_area(C);
- if(sa)
+ if (sa)
ED_area_headerprint(sa, NULL);
- if(ms->timer)
+ if (ms->timer)
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), ms->timer);
- if(cancel)
+ if (cancel)
param_flush_restore(ms->handle);
else
param_flush(ms->handle);
@@ -596,11 +597,11 @@ static int minimize_stretch_exec(bContext *C, wmOperator *op)
{
int i, iterations;
- if(!minimize_stretch_init(C, op))
+ if (!minimize_stretch_init(C, op))
return OPERATOR_CANCELLED;
iterations= RNA_int_get(op->ptr, "iterations");
- for(i=0; i<iterations; i++)
+ for (i=0; i<iterations; i++)
minimize_stretch_iteration(C, op, 0);
minimize_stretch_exit(C, op, 0);
@@ -611,7 +612,7 @@ static int minimize_stretch_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(
{
MinStretch *ms;
- if(!minimize_stretch_init(C, op))
+ if (!minimize_stretch_init(C, op))
return OPERATOR_CANCELLED;
minimize_stretch_iteration(C, op, 1);
@@ -639,7 +640,7 @@ static int minimize_stretch_modal(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_FINISHED;
case PADPLUSKEY:
case WHEELUPMOUSE:
- if(ms->blend < 0.95f) {
+ if (ms->blend < 0.95f) {
ms->blend += 0.1f;
ms->lasttime= 0.0f;
RNA_float_set(op->ptr, "blend", ms->blend);
@@ -648,7 +649,7 @@ static int minimize_stretch_modal(bContext *C, wmOperator *op, wmEvent *event)
break;
case PADMINUS:
case WHEELDOWNMOUSE:
- if(ms->blend > 0.05f) {
+ if (ms->blend > 0.05f) {
ms->blend -= 0.1f;
ms->lasttime= 0.0f;
RNA_float_set(op->ptr, "blend", ms->blend);
@@ -656,17 +657,17 @@ static int minimize_stretch_modal(bContext *C, wmOperator *op, wmEvent *event)
}
break;
case TIMER:
- if(ms->timer == event->customdata) {
+ if (ms->timer == event->customdata) {
double start= PIL_check_seconds_timer();
do {
minimize_stretch_iteration(C, op, 1);
- } while(PIL_check_seconds_timer() - start < 0.01);
+ } while (PIL_check_seconds_timer() - start < 0.01);
}
break;
}
- if(ms->iterations && ms->i >= ms->iterations) {
+ if (ms->iterations && ms->i >= ms->iterations) {
minimize_stretch_exit(C, op, 0);
return OPERATOR_FINISHED;
}
@@ -684,17 +685,17 @@ static int minimize_stretch_cancel(bContext *C, wmOperator *op)
void UV_OT_minimize_stretch(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Minimize Stretch";
- ot->idname= "UV_OT_minimize_stretch";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_GRAB_POINTER|OPTYPE_BLOCKING;
- ot->description="Reduce UV stretching by relaxing angles";
+ ot->name = "Minimize Stretch";
+ ot->idname = "UV_OT_minimize_stretch";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_GRAB_POINTER|OPTYPE_BLOCKING;
+ ot->description = "Reduce UV stretching by relaxing angles";
/* api callbacks */
- ot->exec= minimize_stretch_exec;
- ot->invoke= minimize_stretch_invoke;
- ot->modal= minimize_stretch_modal;
- ot->cancel= minimize_stretch_cancel;
- ot->poll= ED_operator_uvedit;
+ ot->exec = minimize_stretch_exec;
+ ot->invoke = minimize_stretch_invoke;
+ ot->modal = minimize_stretch_modal;
+ ot->cancel = minimize_stretch_cancel;
+ ot->poll = ED_operator_uvedit;
/* properties */
RNA_def_boolean(ot->srna, "fill_holes", 1, "Fill Holes", "Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry");
@@ -706,17 +707,17 @@ void UV_OT_minimize_stretch(wmOperatorType *ot)
static int pack_islands_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
ParamHandle *handle;
- short implicit= 1;
+ short implicit = 1;
- if(!uvedit_have_selection(scene, em, implicit)) {
+ if (!uvedit_have_selection(scene, em, implicit)) {
return OPERATOR_CANCELLED;
}
- if(RNA_struct_property_is_set(op->ptr, "margin")) {
+ if (RNA_struct_property_is_set(op->ptr, "margin")) {
scene->toolsettings->uvcalc_margin= RNA_float_get(op->ptr, "margin");
}
else {
@@ -737,13 +738,13 @@ static int pack_islands_exec(bContext *C, wmOperator *op)
void UV_OT_pack_islands(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Pack Islands";
- ot->idname= "UV_OT_pack_islands";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Pack Islands";
+ ot->idname = "UV_OT_pack_islands";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= pack_islands_exec;
- ot->poll= ED_operator_uvedit;
+ ot->exec = pack_islands_exec;
+ ot->poll = ED_operator_uvedit;
/* properties */
RNA_def_float_factor(ot->srna, "margin", 0.0f, 0.0f, 1.0f, "Margin", "Space between islands", 0.0f, 1.0f);
@@ -753,13 +754,13 @@ void UV_OT_pack_islands(wmOperatorType *ot)
static int average_islands_scale_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
ParamHandle *handle;
- short implicit= 1;
+ short implicit = 1;
- if(!uvedit_have_selection(scene, em, implicit)) {
+ if (!uvedit_have_selection(scene, em, implicit)) {
return OPERATOR_CANCELLED;
}
@@ -777,13 +778,13 @@ static int average_islands_scale_exec(bContext *C, wmOperator *UNUSED(op))
void UV_OT_average_islands_scale(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Average Islands Scale";
- ot->idname= "UV_OT_average_islands_scale";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Average Islands Scale";
+ ot->idname = "UV_OT_average_islands_scale";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= average_islands_scale_exec;
- ot->poll= ED_operator_uvedit;
+ ot->exec = average_islands_scale_exec;
+ ot->poll = ED_operator_uvedit;
}
/**************** Live Unwrap *****************/
@@ -792,16 +793,16 @@ static ParamHandle *liveHandle = NULL;
void ED_uvedit_live_unwrap_begin(Scene *scene, Object *obedit)
{
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
short abf = scene->toolsettings->unwrapper == 0;
short fillholes = scene->toolsettings->uvcalc_flag & UVCALC_FILLHOLES;
short use_subsurf = scene->toolsettings->uvcalc_flag & UVCALC_USESUBSURF;
- if(!ED_uvedit_test(obedit)) {
+ if (!ED_uvedit_test(obedit)) {
return;
}
- if(use_subsurf)
+ if (use_subsurf)
liveHandle = construct_param_handle_subsurfed(scene, em, fillholes, 0, 1);
else
liveHandle = construct_param_handle(scene, em, 0, fillholes, 0, 1);
@@ -811,7 +812,7 @@ void ED_uvedit_live_unwrap_begin(Scene *scene, Object *obedit)
void ED_uvedit_live_unwrap_re_solve(void)
{
- if(liveHandle) {
+ if (liveHandle) {
param_lscm_solve(liveHandle);
param_flush(liveHandle);
}
@@ -819,9 +820,9 @@ void ED_uvedit_live_unwrap_re_solve(void)
void ED_uvedit_live_unwrap_end(short cancel)
{
- if(liveHandle) {
+ if (liveHandle) {
param_lscm_end(liveHandle);
- if(cancel)
+ if (cancel)
param_flush_restore(liveHandle);
param_delete(liveHandle);
liveHandle = NULL;
@@ -854,7 +855,7 @@ static void uv_map_transform_center(Scene *scene, View3D *v3d, float *result,
max[0]= max[1]= max[2]= -1e20f;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
- if(BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
+ if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
DO_MINMAX(l->v->co, min, max);
}
@@ -887,20 +888,20 @@ static void uv_map_rotation_matrix(float result[][4], RegionView3D *rv3d, Object
int k;
/* get rotation of the current view matrix */
- if(rv3d)
+ if (rv3d)
copy_m4_m4(viewmatrix, rv3d->viewmat);
else
unit_m4(viewmatrix);
/* but shifting */
- for(k=0; k<4; k++)
+ for (k=0; k<4; k++)
viewmatrix[3][k] =0.0f;
/* get rotation of the current object matrix */
copy_m4_m4(rotobj,ob->obmat);
/* but shifting */
- for(k=0; k<4; k++)
+ for (k=0; k<4; k++)
rotobj[3][k] =0.0f;
zero_m4(rotup);
@@ -930,11 +931,11 @@ static void uv_map_rotation_matrix(float result[][4], RegionView3D *rv3d, Object
static void uv_map_transform(bContext *C, wmOperator *op, float center[3], float rotmat[4][4])
{
/* context checks are messy here, making it work in both 3d view and uv editor */
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
- View3D *v3d= CTX_wm_view3d(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
+ View3D *v3d = CTX_wm_view3d(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
/* common operator properties */
int align= RNA_enum_get(op->ptr, "align");
int direction= RNA_enum_get(op->ptr, "direction");
@@ -943,18 +944,18 @@ static void uv_map_transform(bContext *C, wmOperator *op, float center[3], float
uv_map_transform_center(scene, v3d, center, obedit, em);
- if(direction == VIEW_ON_EQUATOR) {
+ if (direction == VIEW_ON_EQUATOR) {
upangledeg= 90.0f;
sideangledeg= 0.0f;
}
else {
upangledeg= 0.0f;
- if(align == POLAR_ZY) sideangledeg= 0.0f;
+ if (align == POLAR_ZY) sideangledeg= 0.0f;
else sideangledeg= 90.0f;
}
/* be compatible to the "old" sphere/cylinder mode */
- if(direction == ALIGN_TO_OBJECT)
+ if (direction == ALIGN_TO_OBJECT)
unit_m4(rotmat);
else
uv_map_rotation_matrix(rotmat, rv3d, obedit, upangledeg, sideangledeg, radius);
@@ -979,7 +980,7 @@ static void uv_transform_properties(wmOperatorType *ot, int radius)
"Direction of the sphere or cylinder");
RNA_def_enum(ot->srna, "align", align_items, VIEW_ON_EQUATOR, "Align",
"How to determine rotation around the pole");
- if(radius)
+ if (radius)
RNA_def_float(ot->srna, "radius", 1.0f, 0.0f, FLT_MAX, "Radius",
"Radius of the sphere or cylinder", 0.0001f, 100.0f);
}
@@ -989,23 +990,23 @@ 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);
}
- if(aspx == aspy)
+ if (aspx == aspy)
return;
- if(aspx > aspy) {
+ if (aspx > aspy) {
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 +1020,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;
@@ -1055,10 +1055,10 @@ static void uv_map_clip_correct(BMEditMesh *em, wmOperator *op)
int scale_to_bounds= RNA_boolean_get(op->ptr, "scale_to_bounds");
/* correct for image aspect ratio */
- if(correct_aspect)
+ if (correct_aspect)
correct_uv_aspect(em);
- if(scale_to_bounds) {
+ if (scale_to_bounds) {
INIT_MINMAX2(min, max);
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
@@ -1075,9 +1075,9 @@ static void uv_map_clip_correct(BMEditMesh *em, wmOperator *op)
dx= (max[0]-min[0]);
dy= (max[1]-min[1]);
- if(dx > 0.0f)
+ if (dx > 0.0f)
dx= 1.0f/dx;
- if(dy > 0.0f)
+ if (dy > 0.0f)
dy= 1.0f/dy;
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
@@ -1092,7 +1092,7 @@ static void uv_map_clip_correct(BMEditMesh *em, wmOperator *op)
}
}
}
- else if(clip_to_bounds) {
+ else if (clip_to_bounds) {
/* clipping and wrapping */
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
if (!BM_elem_flag_test(efa, BM_ELEM_SELECT))
@@ -1112,14 +1112,14 @@ static void uv_map_clip_correct(BMEditMesh *em, wmOperator *op)
/* assumes UV Map is checked, doesn't run update funcs */
void ED_unwrap_lscm(Scene *scene, Object *obedit, const short sel)
{
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
ParamHandle *handle;
const short fill_holes= scene->toolsettings->uvcalc_flag & UVCALC_FILLHOLES;
const short correct_aspect= !(scene->toolsettings->uvcalc_flag & UVCALC_NO_ASPECT_CORRECT);
const short use_subsurf = scene->toolsettings->uvcalc_flag & UVCALC_USESUBSURF;
- if(use_subsurf)
+ if (use_subsurf)
handle = construct_param_handle_subsurfed(scene, em, fill_holes, sel, correct_aspect);
else
handle= construct_param_handle(scene, em, 0, fill_holes, sel, correct_aspect);
@@ -1137,9 +1137,9 @@ void ED_unwrap_lscm(Scene *scene, Object *obedit, const short sel)
static int unwrap_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
int method = RNA_enum_get(op->ptr, "method");
int fill_holes = RNA_boolean_get(op->ptr, "fill_holes");
int correct_aspect = RNA_boolean_get(op->ptr, "correct_aspect");
@@ -1148,17 +1148,17 @@ static int unwrap_exec(bContext *C, wmOperator *op)
float obsize[3], unitsize[3] = {1.0f, 1.0f, 1.0f};
short implicit= 0;
- if(!uvedit_have_selection(scene, em, implicit)) {
+ if (!uvedit_have_selection(scene, em, implicit)) {
return OPERATOR_CANCELLED;
}
/* add uvs if they don't exist yet */
- if(!ED_uvedit_ensure_uvs(C, scene, obedit)) {
+ if (!ED_uvedit_ensure_uvs(C, scene, obedit)) {
return OPERATOR_CANCELLED;
}
mat4_to_size(obsize, obedit->obmat);
- if(!compare_v3v3(obsize, unitsize, 1e-4f))
+ if (!compare_v3v3(obsize, unitsize, 1e-4f))
BKE_report(op->reports, RPT_INFO, "Object scale is not 1.0. Unwrap will operate on a non-scaled version of the mesh.");
/* remember last method for live unwrap */
@@ -1166,13 +1166,13 @@ static int unwrap_exec(bContext *C, wmOperator *op)
scene->toolsettings->uv_subsurf_level = subsurf_level;
- if(fill_holes) scene->toolsettings->uvcalc_flag |= UVCALC_FILLHOLES;
+ if (fill_holes) scene->toolsettings->uvcalc_flag |= UVCALC_FILLHOLES;
else scene->toolsettings->uvcalc_flag &= ~UVCALC_FILLHOLES;
- if(correct_aspect) scene->toolsettings->uvcalc_flag &= ~UVCALC_NO_ASPECT_CORRECT;
+ if (correct_aspect) scene->toolsettings->uvcalc_flag &= ~UVCALC_NO_ASPECT_CORRECT;
else scene->toolsettings->uvcalc_flag |= UVCALC_NO_ASPECT_CORRECT;
- if(use_subsurf) scene->toolsettings->uvcalc_flag |= UVCALC_USESUBSURF;
+ if (use_subsurf) scene->toolsettings->uvcalc_flag |= UVCALC_USESUBSURF;
else scene->toolsettings->uvcalc_flag &= ~UVCALC_USESUBSURF;
/* execute unwrap */
@@ -1192,14 +1192,14 @@ void UV_OT_unwrap(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
/* identifiers */
- ot->name= "Unwrap";
- ot->description= "Unwrap the mesh of the object being edited";
- ot->idname= "UV_OT_unwrap";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Unwrap";
+ ot->description = "Unwrap the mesh of the object being edited";
+ ot->idname = "UV_OT_unwrap";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= unwrap_exec;
- ot->poll= ED_operator_uvmap;
+ ot->exec = unwrap_exec;
+ ot->poll = ED_operator_uvmap;
/* properties */
RNA_def_enum(ot->srna, "method", method_items, 0, "Method",
@@ -1217,13 +1217,13 @@ void UV_OT_unwrap(wmOperatorType *ot)
/**************** Project From View operator **************/
static int uv_from_view_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- Camera *camera= NULL;
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ Camera *camera = NULL;
+ BMEditMesh *em = BMEdit_FromObject(obedit);
ARegion *ar = CTX_wm_region(C);
- View3D *v3d= CTX_wm_view3d(C);
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
+ View3D *v3d = CTX_wm_view3d(C);
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@ -1231,7 +1231,7 @@ static int uv_from_view_exec(bContext *C, wmOperator *op)
float rotmat[4][4];
/* add uvs if they don't exist yet */
- if(!ED_uvedit_ensure_uvs(C, scene, obedit)) {
+ if (!ED_uvedit_ensure_uvs(C, scene, obedit)) {
return OPERATOR_CANCELLED;
}
@@ -1240,7 +1240,7 @@ static int uv_from_view_exec(bContext *C, wmOperator *op)
camera= v3d->camera->data;
}
- if(RNA_boolean_get(op->ptr, "orthographic")) {
+ if (RNA_boolean_get(op->ptr, "orthographic")) {
uv_map_rotation_matrix(rotmat, rv3d, obedit, 90.0f, 0.0f, 1.0f);
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
@@ -1256,7 +1256,7 @@ static int uv_from_view_exec(bContext *C, wmOperator *op)
else if (camera) {
struct UvCameraInfo *uci= project_camera_info(v3d->camera, obedit->obmat, scene->r.xsch, scene->r.ysch);
- if(uci) {
+ if (uci) {
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
if (!BM_elem_flag_test(efa, BM_ELEM_SELECT))
continue;
@@ -1296,7 +1296,7 @@ static int uv_from_view_poll(bContext *C)
{
RegionView3D *rv3d= CTX_wm_region_view3d(C);
- if(!ED_operator_uvmap(C))
+ if (!ED_operator_uvmap(C))
return 0;
return (rv3d != NULL);
@@ -1305,13 +1305,13 @@ static int uv_from_view_poll(bContext *C)
void UV_OT_from_view(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Project From View";
- ot->idname= "UV_OT_project_from_view";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Project From View";
+ ot->idname = "UV_OT_project_from_view";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= uv_from_view_exec;
- ot->poll= uv_from_view_poll;
+ ot->exec = uv_from_view_exec;
+ ot->poll = uv_from_view_poll;
/* properties */
RNA_def_boolean(ot->srna, "orthographic", 0, "Orthographic", "Use orthographic projection");
@@ -1344,13 +1344,13 @@ static int reset_exec(bContext *C, wmOperator *UNUSED(op))
void UV_OT_reset(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Reset";
- ot->idname= "UV_OT_reset";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Reset";
+ ot->idname = "UV_OT_reset";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= reset_exec;
- ot->poll= ED_operator_uvmap;
+ ot->exec = reset_exec;
+ ot->poll = ED_operator_uvmap;
}
/****************** Sphere Project operator ***************/
@@ -1365,7 +1365,7 @@ static void uv_sphere_project(float target[2], float source[3], float center[3],
map_to_sphere( &target[0], &target[1],pv[0], pv[1], pv[2]);
/* split line is always zero */
- if(target[0] >= 1.0f)
+ if (target[0] >= 1.0f)
target[0] -= 1.0f;
}
@@ -1387,14 +1387,14 @@ static void uv_map_mirror(BMEditMesh *em, BMFace *efa, MTexPoly *UNUSED(tf))
}
mi = 0;
- for(i=1; i<efa->len; i++)
- if(uvs[i][0] > uvs[mi][0])
+ for (i=1; i<efa->len; i++)
+ if (uvs[i][0] > uvs[mi][0])
mi = i;
- for(i=0; i<efa->len; i++) {
- if(i != mi) {
+ for (i=0; i<efa->len; i++) {
+ if (i != mi) {
dx = uvs[mi][0] - uvs[i][0];
- if(dx > 0.5f) uvs[i][0] += 1.0f;
+ if (dx > 0.5f) uvs[i][0] += 1.0f;
}
}
@@ -1403,9 +1403,9 @@ static void uv_map_mirror(BMEditMesh *em, BMFace *efa, MTexPoly *UNUSED(tf))
static int sphere_project_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@ -1414,7 +1414,7 @@ static int sphere_project_exec(bContext *C, wmOperator *op)
float center[3], rotmat[4][4];
/* add uvs if they don't exist yet */
- if(!ED_uvedit_ensure_uvs(C, scene, obedit)) {
+ if (!ED_uvedit_ensure_uvs(C, scene, obedit)) {
return OPERATOR_CANCELLED;
}
@@ -1445,13 +1445,13 @@ static int sphere_project_exec(bContext *C, wmOperator *op)
void UV_OT_sphere_project(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Sphere Projection";
- ot->idname= "UV_OT_sphere_project";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Sphere Projection";
+ ot->idname = "UV_OT_sphere_project";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= sphere_project_exec;
- ot->poll= ED_operator_uvmap;
+ ot->exec = sphere_project_exec;
+ ot->poll = ED_operator_uvmap;
/* properties */
uv_transform_properties(ot, 0);
@@ -1470,15 +1470,15 @@ static void uv_cylinder_project(float target[2], float source[3], float center[3
map_to_tube( &target[0], &target[1],pv[0], pv[1], pv[2]);
/* split line is always zero */
- if(target[0] >= 1.0f)
+ if (target[0] >= 1.0f)
target[0] -= 1.0f;
}
static int cylinder_project_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@ -1487,7 +1487,7 @@ static int cylinder_project_exec(bContext *C, wmOperator *op)
float center[3], rotmat[4][4];
/* add uvs if they don't exist yet */
- if(!ED_uvedit_ensure_uvs(C, scene, obedit)) {
+ if (!ED_uvedit_ensure_uvs(C, scene, obedit)) {
return OPERATOR_CANCELLED;
}
@@ -1518,13 +1518,13 @@ static int cylinder_project_exec(bContext *C, wmOperator *op)
void UV_OT_cylinder_project(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Cylinder Projection";
- ot->idname= "UV_OT_cylinder_project";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Cylinder Projection";
+ ot->idname = "UV_OT_cylinder_project";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= cylinder_project_exec;
- ot->poll= ED_operator_uvmap;
+ ot->exec = cylinder_project_exec;
+ ot->poll = ED_operator_uvmap;
/* properties */
uv_transform_properties(ot, 1);
@@ -1535,9 +1535,9 @@ void UV_OT_cylinder_project(wmOperatorType *ot)
static int cube_project_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@ -1547,7 +1547,7 @@ static int cube_project_exec(bContext *C, wmOperator *op)
int cox, coy;
/* add uvs if they don't exist yet */
- if(!ED_uvedit_ensure_uvs(C, scene, obedit)) {
+ if (!ED_uvedit_ensure_uvs(C, scene, obedit)) {
return OPERATOR_CANCELLED;
}
@@ -1596,13 +1596,13 @@ static int cube_project_exec(bContext *C, wmOperator *op)
void UV_OT_cube_project(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Cube Projection";
- ot->idname= "UV_OT_cube_project";
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->name = "Cube Projection";
+ ot->idname = "UV_OT_cube_project";
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= cube_project_exec;
- ot->poll= ED_operator_uvmap;
+ ot->exec = cube_project_exec;
+ ot->poll = ED_operator_uvmap;
/* properties */
RNA_def_float(ot->srna, "cube_size", 1.0f, 0.0f, FLT_MAX, "Cube Size", "Size of the cube to project on", 0.001f, 100.0f);
diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h
index b3a317364a9..cee9039e3f9 100644
--- a/source/blender/gpu/GPU_buffers.h
+++ b/source/blender/gpu/GPU_buffers.h
@@ -40,7 +40,9 @@
#endif
struct DerivedMesh;
+struct DMFlagMat;
struct DMGridData;
+struct CustomData;
struct GHash;
struct DMGridData;
struct GPUVertPointLink;
@@ -61,20 +63,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 +108,7 @@ typedef struct GPUDrawObject {
int totedge;
/* if there was a failure allocating some buffer, use old
- rendering code */
+ * rendering code */
int legacy;
} GPUDrawObject;
@@ -122,16 +124,16 @@ void GPU_global_buffer_pool_free(void);
GPUBuffer *GPU_buffer_alloc(int size);
void GPU_buffer_free(GPUBuffer *buffer);
-GPUDrawObject *GPU_drawobject_new( struct DerivedMesh *dm );
-void GPU_drawobject_free( struct DerivedMesh *dm );
+GPUDrawObject *GPU_drawobject_new(struct DerivedMesh *dm );
+void GPU_drawobject_free(struct DerivedMesh *dm );
/* called before drawing */
-void GPU_vertex_setup( struct DerivedMesh *dm );
-void GPU_normal_setup( struct DerivedMesh *dm );
-void GPU_uv_setup( struct DerivedMesh *dm );
-void GPU_color_setup( struct DerivedMesh *dm );
-void GPU_edge_setup( struct DerivedMesh *dm ); /* does not mix with other data */
-void GPU_uvedge_setup( struct DerivedMesh *dm );
+void GPU_vertex_setup(struct DerivedMesh *dm );
+void GPU_normal_setup(struct DerivedMesh *dm );
+void GPU_uv_setup(struct DerivedMesh *dm );
+void GPU_color_setup(struct DerivedMesh *dm );
+void GPU_edge_setup(struct DerivedMesh *dm ); /* does not mix with other data */
+void GPU_uvedge_setup(struct DerivedMesh *dm );
int GPU_attrib_element_size( GPUAttrib data[], int numdata );
void GPU_interleaved_attrib_setup( GPUBuffer *buffer, GPUAttrib data[], int numdata );
@@ -141,9 +143,7 @@ void *GPU_buffer_lock_stream( GPUBuffer *buffer );
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 );
+void GPU_color3_upload(struct DerivedMesh *dm, unsigned char *data );
/* switch color rendering on=1/off=0 */
void GPU_color_switch( int mode );
@@ -154,23 +154,26 @@ void GPU_buffer_draw_elements( GPUBuffer *elements, unsigned int mode, int start
void GPU_buffer_unbind(void);
/* used to check whether to use the old (without buffers) code */
-int GPU_buffer_legacy( struct DerivedMesh *dm );
+int GPU_buffer_legacy(struct DerivedMesh *dm );
/* Buffers for non-DerivedMesh drawing */
typedef struct GPU_Buffers GPU_Buffers;
GPU_Buffers *GPU_build_mesh_buffers(int (*face_vert_indices)[4],
- struct MFace *mface, int *face_indices, int totface);
+ struct MFace *mface, struct MVert *mvert,
+ 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);
+GPU_Buffers *GPU_build_grid_buffers(int *grid_indices, int totgrid,
+ unsigned int **grid_hidden, 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..869cc0444aa 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -38,6 +38,7 @@
#include "MEM_guardedalloc.h"
+#include "BLI_bitmap.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
@@ -46,6 +47,8 @@
#include "DNA_meshdata_types.h"
#include "BKE_DerivedMesh.h"
+#include "BKE_paint.h"
+#include "BKE_subsurf.h"
#include "DNA_userdef_types.h"
@@ -70,15 +73,15 @@ static GPUBufferState GLStates = 0;
static GPUAttrib attribData[MAX_GPU_ATTRIB_DATA] = { { -1, 0, 0 } };
/* stores recently-deleted buffers so that new buffers won't have to
- be recreated as often
-
- only one instance of this pool is created, stored in
- gpu_buffer_pool
-
- note that the number of buffers in the pool is usually limited to
- MAX_FREE_GPU_BUFFERS, but this limit may be exceeded temporarily
- when a GPUBuffer is released outside the main thread; due to OpenGL
- restrictions it cannot be immediately released
+ * be recreated as often
+ *
+ * only one instance of this pool is created, stored in
+ * gpu_buffer_pool
+ *
+ * note that the number of buffers in the pool is usually limited to
+ * MAX_FREE_GPU_BUFFERS, but this limit may be exceeded temporarily
+ * when a GPUBuffer is released outside the main thread; due to OpenGL
+ * restrictions it cannot be immediately released
*/
typedef struct GPUBufferPool {
/* number of allocated buffers stored */
@@ -95,7 +98,7 @@ static GPUBufferPool *gpu_buffer_pool_new(void)
GPUBufferPool *pool;
/* enable VBOs if supported */
- if(useVBOs == -1)
+ if (useVBOs == -1)
useVBOs = (GLEW_ARB_vertex_buffer_object ? 1 : 0);
pool = MEM_callocN(sizeof(GPUBufferPool), "GPUBuffer");
@@ -112,15 +115,15 @@ static void gpu_buffer_pool_remove_index(GPUBufferPool *pool, int index)
{
int i;
- if(!pool || index < 0 || index >= pool->totbuf)
+ if (!pool || index < 0 || index >= pool->totbuf)
return;
/* shift entries down, overwriting the buffer at `index' */
- for(i = index; i < pool->totbuf - 1; i++)
+ for (i = index; i < pool->totbuf - 1; i++)
pool->buffers[i] = pool->buffers[i+1];
/* clear the last entry */
- if(pool->totbuf > 0)
+ if (pool->totbuf > 0)
pool->buffers[pool->totbuf - 1] = NULL;
pool->totbuf--;
@@ -131,15 +134,15 @@ static void gpu_buffer_pool_delete_last(GPUBufferPool *pool)
{
GPUBuffer *last;
- if(pool->totbuf <= 0)
+ if (pool->totbuf <= 0)
return;
/* get the last entry */
- if(!(last = pool->buffers[pool->totbuf - 1]))
+ if (!(last = pool->buffers[pool->totbuf - 1]))
return;
/* delete the buffer's data */
- if(useVBOs)
+ if (useVBOs)
glDeleteBuffersARB(1, &last->id);
else
MEM_freeN(last->pointer);
@@ -154,10 +157,10 @@ static void gpu_buffer_pool_delete_last(GPUBufferPool *pool)
GPUBuffers */
static void gpu_buffer_pool_free(GPUBufferPool *pool)
{
- if(!pool)
+ if (!pool)
return;
- while(pool->totbuf)
+ while (pool->totbuf)
gpu_buffer_pool_delete_last(pool);
MEM_freeN(pool->buffers);
@@ -168,7 +171,7 @@ static GPUBufferPool *gpu_buffer_pool = NULL;
static GPUBufferPool *gpu_get_global_buffer_pool(void)
{
/* initialize the pool */
- if(!gpu_buffer_pool)
+ if (!gpu_buffer_pool)
gpu_buffer_pool = gpu_buffer_pool_new();
return gpu_buffer_pool;
@@ -198,21 +201,21 @@ GPUBuffer *GPU_buffer_alloc(int size)
/* check the global buffer pool for a recently-deleted buffer
that is at least as big as the request, but not more than
twice as big */
- for(i = 0; i < pool->totbuf; i++) {
+ for (i = 0; i < pool->totbuf; i++) {
bufsize = pool->buffers[i]->size;
/* check for an exact size match */
- if(bufsize == size) {
+ if (bufsize == size) {
bestfit = i;
break;
}
/* smaller buffers won't fit data and buffers at least
twice as big are a waste of memory */
- else if(bufsize > size && size > (bufsize / 2)) {
+ else if (bufsize > size && size > (bufsize / 2)) {
/* is it closer to the required size than the
last appropriate buffer found. try to save
memory */
- if(bestfit == -1 || pool->buffers[bestfit]->size > bufsize) {
+ if (bestfit == -1 || pool->buffers[bestfit]->size > bufsize) {
bestfit = i;
}
}
@@ -220,7 +223,7 @@ GPUBuffer *GPU_buffer_alloc(int size)
/* if an acceptable buffer was found in the pool, remove it
from the pool and return it */
- if(bestfit != -1) {
+ if (bestfit != -1) {
buf = pool->buffers[bestfit];
gpu_buffer_pool_remove_index(pool, bestfit);
return buf;
@@ -230,7 +233,7 @@ GPUBuffer *GPU_buffer_alloc(int size)
buf = MEM_callocN(sizeof(GPUBuffer), "GPUBuffer");
buf->size = size;
- if(useVBOs == 1) {
+ if (useVBOs == 1) {
/* create a new VBO and initialize it to the requested
size */
glGenBuffersARB(1, &buf->id);
@@ -245,11 +248,11 @@ GPUBuffer *GPU_buffer_alloc(int size)
out-of-memory errors? looks a bit iffy to me
though, at least on Linux I expect malloc() would
just overcommit. --nicholas */
- while(!buf->pointer && pool->totbuf > 0) {
+ while (!buf->pointer && pool->totbuf > 0) {
gpu_buffer_pool_delete_last(pool);
buf->pointer = MEM_mallocN(size, "GPUBuffer.pointer");
}
- if(!buf->pointer)
+ if (!buf->pointer)
return NULL;
}
@@ -257,14 +260,14 @@ 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)
{
GPUBufferPool *pool;
int i;
- if(!buffer)
+ if (!buffer)
return;
pool = gpu_get_global_buffer_pool();
@@ -273,16 +276,16 @@ void GPU_buffer_free(GPUBuffer *buffer)
if we are in the main thread. for e.g. rendering or baking it can
happen that we are in other thread and can't call OpenGL, in that
case cleanup will be done GPU_buffer_pool_free_unused */
- if(BLI_thread_is_main()) {
+ if (BLI_thread_is_main()) {
/* in main thread, safe to decrease size of pool back
down to MAX_FREE_GPU_BUFFERS */
- while(pool->totbuf >= MAX_FREE_GPU_BUFFERS)
+ while (pool->totbuf >= MAX_FREE_GPU_BUFFERS)
gpu_buffer_pool_delete_last(pool);
}
else {
/* outside of main thread, can't safely delete the
buffer, so increase pool size */
- if(pool->maxsize == pool->totbuf) {
+ if (pool->maxsize == pool->totbuf) {
pool->maxsize += MAX_FREE_GPU_BUFFERS;
pool->buffers = MEM_reallocN(pool->buffers,
sizeof(GPUBuffer*) * pool->maxsize);
@@ -290,7 +293,7 @@ void GPU_buffer_free(GPUBuffer *buffer)
}
/* shift pool entries up by one */
- for(i = pool->totbuf; i > 0; i--)
+ for (i = pool->totbuf; i > 0; i--)
pool->buffers[i] = pool->buffers[i-1];
/* insert the buffer into the beginning of the pool */
@@ -313,9 +316,9 @@ static void gpu_drawobject_add_vert_point(GPUDrawObject *gdo, int vert_index, in
lnk = &gdo->vert_points[vert_index];
/* if first link is in use, add a new link at the end */
- if(lnk->point_index != -1) {
+ if (lnk->point_index != -1) {
/* get last link */
- for(; lnk->next; lnk = lnk->next);
+ for (; lnk->next; lnk = lnk->next);
/* add a new link from the pool */
lnk = lnk->next = &gdo->vert_points_mem[gdo->vert_points_usage];
@@ -333,7 +336,7 @@ static void gpu_drawobject_add_triangle(GPUDrawObject *gdo,
int v1, int v2, int v3)
{
int i, v[3] = {v1, v2, v3};
- for(i = 0; i < 3; i++)
+ for (i = 0; i < 3; i++)
gpu_drawobject_add_vert_point(gdo, v[i], base_point_index + i);
gdo->triangle_to_mface[base_point_index / 3] = face_index;
}
@@ -354,14 +357,14 @@ static void gpu_drawobject_init_vert_points(GPUDrawObject *gdo, MFace *f, int to
/* build a map from the original material indices to the new
GPUBufferMaterial indices */
- for(i = 0; i < gdo->totmaterial; i++)
+ for (i = 0; i < gdo->totmaterial; i++)
mat_orig_to_new[gdo->materials[i].mat_nr] = i;
/* -1 indicates the link is not yet used */
- for(i = 0; i < gdo->totvert; i++)
+ for (i = 0; i < gdo->totvert; i++)
gdo->vert_points[i].point_index = -1;
- for(i = 0; i < totface; i++, f++) {
+ for (i = 0; i < totface; i++, f++) {
mat = &gdo->materials[mat_orig_to_new[f->mat_nr]];
/* add triangle */
@@ -370,7 +373,7 @@ static void gpu_drawobject_init_vert_points(GPUDrawObject *gdo, MFace *f, int to
mat->totpoint += 3;
/* add second triangle for quads */
- if(f->v4) {
+ if (f->v4) {
gpu_drawobject_add_triangle(gdo, mat->start + mat->totpoint,
i, f->v3, f->v4, f->v1);
mat->totpoint += 3;
@@ -378,8 +381,8 @@ static void gpu_drawobject_init_vert_points(GPUDrawObject *gdo, MFace *f, int to
}
/* map any unused vertices to loose points */
- for(i = 0; i < gdo->totvert; i++) {
- if(gdo->vert_points[i].point_index == -1) {
+ for (i = 0; i < gdo->totvert; i++) {
+ if (gdo->vert_points[i].point_index == -1) {
gdo->vert_points[i].point_index = gdo->tot_triangle_point + gdo->tot_loose_point;
gdo->tot_loose_point++;
}
@@ -401,7 +404,7 @@ GPUDrawObject *GPU_drawobject_new( DerivedMesh *dm )
/* get the number of points used by each material, treating
each quad as two triangles */
memset(points_per_mat, 0, sizeof(int)*MAX_MATERIALS);
- for(i = 0; i < totface; i++)
+ for (i = 0; i < totface; i++)
points_per_mat[mface[i].mat_nr] += mface[i].v4 ? 6 : 3;
/* create the GPUDrawObject */
@@ -410,8 +413,8 @@ GPUDrawObject *GPU_drawobject_new( DerivedMesh *dm )
gdo->totedge = dm->getNumEdges(dm);
/* count the number of materials used by this DerivedMesh */
- for(i = 0; i < MAX_MATERIALS; i++) {
- if(points_per_mat[i] > 0)
+ for (i = 0; i < MAX_MATERIALS; i++) {
+ if (points_per_mat[i] > 0)
gdo->totmaterial++;
}
@@ -420,8 +423,8 @@ GPUDrawObject *GPU_drawobject_new( DerivedMesh *dm )
"GPUDrawObject.materials");
/* initialize the materials array */
- for(i = 0, curmat = 0, curpoint = 0; i < MAX_MATERIALS; i++) {
- if(points_per_mat[i] > 0) {
+ for (i = 0, curmat = 0, curpoint = 0; i < MAX_MATERIALS; i++) {
+ if (points_per_mat[i] > 0) {
gdo->materials[curmat].start = curpoint;
gdo->materials[curmat].totpoint = 0;
gdo->materials[curmat].mat_nr = i;
@@ -446,7 +449,7 @@ void GPU_drawobject_free(DerivedMesh *dm)
{
GPUDrawObject *gdo;
- if(!dm || !(gdo = dm->drawObject))
+ if (!dm || !(gdo = dm->drawObject))
return;
MEM_freeN(gdo->materials);
@@ -483,16 +486,16 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object,
pool = gpu_get_global_buffer_pool();
/* alloc a GPUBuffer; fall back to legacy mode on failure */
- if(!(buffer = GPU_buffer_alloc(size)))
+ if (!(buffer = GPU_buffer_alloc(size)))
dm->drawObject->legacy = 1;
/* nothing to do for legacy mode */
- if(dm->drawObject->legacy)
+ if (dm->drawObject->legacy)
return NULL;
cur_index_per_mat = MEM_mallocN(sizeof(int)*object->totmaterial,
"GPU_buffer_setup.cur_index_per_mat");
- for(i = 0; i < object->totmaterial; i++) {
+ for (i = 0; i < object->totmaterial; i++) {
/* for each material, the current index to copy data to */
cur_index_per_mat[i] = object->materials[i].start * vector_size;
@@ -501,17 +504,17 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object,
mat_orig_to_new[object->materials[i].mat_nr] = i;
}
- if(useVBOs) {
+ if (useVBOs) {
success = 0;
- while(!success) {
+ while (!success) {
/* bind the buffer and discard previous data,
avoids stalling gpu */
glBindBufferARB(target, buffer->id);
glBufferDataARB(target, buffer->size, NULL, GL_STATIC_DRAW_ARB);
/* attempt to map the buffer */
- if(!(varray = glMapBufferARB(target, GL_WRITE_ONLY_ARB))) {
+ if (!(varray = glMapBufferARB(target, GL_WRITE_ONLY_ARB))) {
/* failed to map the buffer; delete it */
GPU_buffer_free(buffer);
gpu_buffer_pool_delete_last(pool);
@@ -519,14 +522,14 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object,
/* try freeing an entry from the pool
and reallocating the buffer */
- if(pool->totbuf > 0) {
+ if (pool->totbuf > 0) {
gpu_buffer_pool_delete_last(pool);
buffer = GPU_buffer_alloc(size);
}
/* allocation still failed; fall back
to legacy mode */
- if(!buffer) {
+ if (!buffer) {
dm->drawObject->legacy = 1;
success = 1;
}
@@ -537,10 +540,10 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object,
}
/* check legacy fallback didn't happen */
- if(dm->drawObject->legacy == 0) {
+ if (dm->drawObject->legacy == 0) {
uploaded = GL_FALSE;
/* attempt to upload the data to the VBO */
- while(uploaded == GL_FALSE) {
+ while (uploaded == GL_FALSE) {
(*copy_f)(dm, varray, cur_index_per_mat, mat_orig_to_new, user);
/* glUnmapBuffer returns GL_FALSE if
* the data store is corrupted; retry
@@ -552,7 +555,7 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object,
}
else {
/* VBO not supported, use vertex array fallback */
- if(buffer->pointer) {
+ if (buffer->pointer) {
varray = buffer->pointer;
(*copy_f)(dm, varray, cur_index_per_mat, mat_orig_to_new, user);
}
@@ -576,7 +579,7 @@ static void GPU_buffer_copy_vertex(DerivedMesh *dm, float *varray, int *index, i
f = dm->getTessFaceArray(dm);
totface= dm->getNumTessFaces(dm);
- for(i = 0; i < totface; i++, f++) {
+ for (i = 0; i < totface; i++, f++) {
start = index[mat_orig_to_new[f->mat_nr]];
/* v1 v2 v3 */
@@ -585,7 +588,7 @@ static void GPU_buffer_copy_vertex(DerivedMesh *dm, float *varray, int *index, i
copy_v3_v3(&varray[start+6], mvert[f->v3].co);
index[mat_orig_to_new[f->mat_nr]] += 9;
- if(f->v4) {
+ if (f->v4) {
/* v3 v4 v1 */
copy_v3_v3(&varray[start+9], mvert[f->v3].co);
copy_v3_v3(&varray[start+12], mvert[f->v4].co);
@@ -596,8 +599,8 @@ static void GPU_buffer_copy_vertex(DerivedMesh *dm, float *varray, int *index, i
/* copy loose points */
j = dm->drawObject->tot_triangle_point*3;
- for(i = 0; i < dm->drawObject->totvert; i++) {
- if(dm->drawObject->vert_points[i].point_index >= dm->drawObject->tot_triangle_point) {
+ for (i = 0; i < dm->drawObject->totvert; i++) {
+ if (dm->drawObject->vert_points[i].point_index >= dm->drawObject->tot_triangle_point) {
copy_v3_v3(&varray[j],mvert[i].co);
j+=3;
}
@@ -615,31 +618,31 @@ static void GPU_buffer_copy_normal(DerivedMesh *dm, float *varray, int *index, i
MFace *f = dm->getTessFaceArray(dm);
totface= dm->getNumTessFaces(dm);
- for(i = 0; i < totface; i++, f++) {
+ for (i = 0; i < totface; i++, f++) {
const int smoothnormal = (f->flag & ME_SMOOTH);
start = index[mat_orig_to_new[f->mat_nr]];
index[mat_orig_to_new[f->mat_nr]] += f->v4 ? 18 : 9;
- if(smoothnormal) {
+ if (smoothnormal) {
/* copy vertex normal */
normal_short_to_float_v3(&varray[start], mvert[f->v1].no);
normal_short_to_float_v3(&varray[start+3], mvert[f->v2].no);
normal_short_to_float_v3(&varray[start+6], mvert[f->v3].no);
- if(f->v4) {
+ if (f->v4) {
normal_short_to_float_v3(&varray[start+9], mvert[f->v3].no);
normal_short_to_float_v3(&varray[start+12], mvert[f->v4].no);
normal_short_to_float_v3(&varray[start+15], mvert[f->v1].no);
}
}
- else if(nors) {
+ else if (nors) {
/* copy cached face normal */
copy_v3_v3(&varray[start], &nors[i*3]);
copy_v3_v3(&varray[start+3], &nors[i*3]);
copy_v3_v3(&varray[start+6], &nors[i*3]);
- if(f->v4) {
+ if (f->v4) {
copy_v3_v3(&varray[start+9], &nors[i*3]);
copy_v3_v3(&varray[start+12], &nors[i*3]);
copy_v3_v3(&varray[start+15], &nors[i*3]);
@@ -647,7 +650,7 @@ static void GPU_buffer_copy_normal(DerivedMesh *dm, float *varray, int *index, i
}
else {
/* calculate face normal */
- if(f->v4)
+ if (f->v4)
normal_quad_v3(f_no, mvert[f->v1].co, mvert[f->v2].co, mvert[f->v3].co, mvert[f->v4].co);
else
normal_tri_v3(f_no, mvert[f->v1].co, mvert[f->v2].co, mvert[f->v3].co);
@@ -656,7 +659,7 @@ static void GPU_buffer_copy_normal(DerivedMesh *dm, float *varray, int *index, i
copy_v3_v3(&varray[start+3], f_no);
copy_v3_v3(&varray[start+6], f_no);
- if(f->v4) {
+ if (f->v4) {
copy_v3_v3(&varray[start+9], f_no);
copy_v3_v3(&varray[start+12], f_no);
copy_v3_v3(&varray[start+15], f_no);
@@ -673,12 +676,12 @@ static void GPU_buffer_copy_uv(DerivedMesh *dm, float *varray, int *index, int *
MTFace *mtface;
MFace *f;
- if(!(mtface = DM_get_tessface_data_layer(dm, CD_MTFACE)))
+ if (!(mtface = DM_get_tessface_data_layer(dm, CD_MTFACE)))
return;
f = dm->getTessFaceArray(dm);
totface = dm->getNumTessFaces(dm);
- for(i = 0; i < totface; i++, f++) {
+ for (i = 0; i < totface; i++, f++) {
start = index[mat_orig_to_new[f->mat_nr]];
/* v1 v2 v3 */
@@ -687,7 +690,7 @@ static void GPU_buffer_copy_uv(DerivedMesh *dm, float *varray, int *index, int *
copy_v2_v2(&varray[start+4],mtface[i].uv[2]);
index[mat_orig_to_new[f->mat_nr]] += 6;
- if(f->v4) {
+ if (f->v4) {
/* v3 v4 v1 */
copy_v2_v2(&varray[start+6],mtface[i].uv[2]);
copy_v2_v2(&varray[start+8],mtface[i].uv[3]);
@@ -706,7 +709,7 @@ static void GPU_buffer_copy_color3(DerivedMesh *dm, float *varray_, int *index,
MFace *f = dm->getTessFaceArray(dm);
totface= dm->getNumTessFaces(dm);
- for(i=0; i < totface; i++, f++) {
+ for (i=0; i < totface; i++, f++) {
int start = index[mat_orig_to_new[f->mat_nr]];
/* v1 v2 v3 */
@@ -715,7 +718,7 @@ static void GPU_buffer_copy_color3(DerivedMesh *dm, float *varray_, int *index,
copy_v3_v3_char(&varray[start+6], &mcol[i*12+6]);
index[mat_orig_to_new[f->mat_nr]] += 9;
- if(f->v4) {
+ if (f->v4) {
/* v3 v4 v1 */
copy_v3_v3_char(&varray[start+9], &mcol[i*12+6]);
copy_v3_v3_char(&varray[start+12], &mcol[i*12+9]);
@@ -741,7 +744,7 @@ static void GPU_buffer_copy_mcol(DerivedMesh *dm, float *varray_, int *index, in
MFace *f = dm->getTessFaceArray(dm);
totface= dm->getNumTessFaces(dm);
- for(i=0; i < totface; i++, f++) {
+ for (i=0; i < totface; i++, f++) {
int start = index[mat_orig_to_new[f->mat_nr]];
/* v1 v2 v3 */
@@ -750,7 +753,7 @@ static void GPU_buffer_copy_mcol(DerivedMesh *dm, float *varray_, int *index, in
copy_mcol_uc3(&varray[start+6], &mcol[i*16+8]);
index[mat_orig_to_new[f->mat_nr]] += 9;
- if(f->v4) {
+ if (f->v4) {
/* v3 v4 v1 */
copy_mcol_uc3(&varray[start+9], &mcol[i*16+8]);
copy_mcol_uc3(&varray[start+12], &mcol[i*16+12]);
@@ -769,7 +772,7 @@ static void GPU_buffer_copy_edge(DerivedMesh *dm, float *varray_, int *UNUSED(in
medge = dm->getEdgeArray(dm);
totedge = dm->getNumEdges(dm);
- for(i = 0; i < totedge; i++, medge++) {
+ for (i = 0; i < totedge; i++, medge++) {
varray[i*2] = dm->drawObject->vert_points[medge->v1].point_index;
varray[i*2+1] = dm->drawObject->vert_points[medge->v2].point_index;
}
@@ -780,10 +783,10 @@ static void GPU_buffer_copy_uvedge(DerivedMesh *dm, float *varray, int *UNUSED(i
MTFace *tf = DM_get_tessface_data_layer(dm, CD_MTFACE);
int i, j=0;
- if(!tf)
+ if (!tf)
return;
- for(i = 0; i < dm->numTessFaceData; i++, tf++) {
+ for (i = 0; i < dm->numTessFaceData; i++, tf++) {
MFace mf;
dm->getTessFace(dm,i,&mf);
@@ -793,11 +796,12 @@ static void GPU_buffer_copy_uvedge(DerivedMesh *dm, float *varray, int *UNUSED(i
copy_v2_v2(&varray[j+4],tf->uv[1]);
copy_v2_v2(&varray[j+6],tf->uv[2]);
- if(!mf.v4) {
+ if (!mf.v4) {
copy_v2_v2(&varray[j+8],tf->uv[2]);
copy_v2_v2(&varray[j+10],tf->uv[0]);
j+=12;
- } else {
+ }
+ else {
copy_v2_v2(&varray[j+8],tf->uv[2]);
copy_v2_v2(&varray[j+10],tf->uv[3]);
@@ -809,7 +813,7 @@ static void GPU_buffer_copy_uvedge(DerivedMesh *dm, float *varray, int *UNUSED(i
}
/* get the DerivedMesh's MCols; choose (in decreasing order of
- preference) from CD_ID_MCOL, CD_WEIGHT_MCOL, or CD_MCOL */
+ preference) from CD_ID_MCOL, CD_PREVIEW_MCOL, or CD_MCOL */
static MCol *gpu_buffer_color_type(DerivedMesh *dm)
{
MCol *c;
@@ -817,10 +821,10 @@ static MCol *gpu_buffer_color_type(DerivedMesh *dm)
type = CD_ID_MCOL;
c = DM_get_tessface_data_layer(dm, type);
- if(!c) {
- type = CD_WEIGHT_MCOL;
+ if (!c) {
+ type = CD_PREVIEW_MCOL;
c = DM_get_tessface_data_layer(dm, type);
- if(!c) {
+ if (!c) {
type = CD_MCOL;
c = DM_get_tessface_data_layer(dm, type);
}
@@ -891,11 +895,11 @@ static int gpu_buffer_size_from_type(DerivedMesh *dm, GPUBufferType type)
return sizeof(int)*2*dm->drawObject->totedge;
case GPU_BUFFER_UVEDGE:
/* each face gets 3 points, 3 edges per triangle, and
- each edge has its own, non-shared coords, so each
- tri corner needs minimum of 4 floats, quads used
- less so here we can over allocate and assume all
- tris. */
- return sizeof(float) * dm->drawObject->tot_triangle_point;
+ * each edge has its own, non-shared coords, so each
+ * tri corner needs minimum of 4 floats, quads used
+ * less so here we can over allocate and assume all
+ * tris. */
+ return sizeof(float) * 4 * dm->drawObject->tot_triangle_point;
default:
return -1;
}
@@ -911,12 +915,12 @@ static GPUBuffer *gpu_buffer_setup_type(DerivedMesh *dm, GPUBufferType type)
ts = &gpu_buffer_type_settings[type];
/* special handling for MCol and UV buffers */
- if(type == GPU_BUFFER_COLOR) {
- if(!(user_data = gpu_buffer_color_type(dm)))
+ if (type == GPU_BUFFER_COLOR) {
+ if (!(user_data = gpu_buffer_color_type(dm)))
return NULL;
}
- else if(type == GPU_BUFFER_UV) {
- if(!DM_get_tessface_data_layer(dm, CD_MTFACE))
+ else if (type == GPU_BUFFER_UV) {
+ if (!DM_get_tessface_data_layer(dm, CD_MTFACE))
return NULL;
}
@@ -933,11 +937,11 @@ static GPUBuffer *gpu_buffer_setup_common(DerivedMesh *dm, GPUBufferType type)
{
GPUBuffer **buf;
- if(!dm->drawObject)
+ if (!dm->drawObject)
dm->drawObject = GPU_drawobject_new(dm);
buf = gpu_drawobject_buffer_from_type(dm->drawObject, type);
- if(!(*buf))
+ if (!(*buf))
*buf = gpu_buffer_setup_type(dm, type);
return *buf;
@@ -945,11 +949,11 @@ static GPUBuffer *gpu_buffer_setup_common(DerivedMesh *dm, GPUBufferType type)
void GPU_vertex_setup(DerivedMesh *dm)
{
- if(!gpu_buffer_setup_common(dm, GPU_BUFFER_VERTEX))
+ if (!gpu_buffer_setup_common(dm, GPU_BUFFER_VERTEX))
return;
glEnableClientState(GL_VERTEX_ARRAY);
- if(useVBOs) {
+ if (useVBOs) {
glBindBufferARB(GL_ARRAY_BUFFER_ARB, dm->drawObject->points->id);
glVertexPointer(3, GL_FLOAT, 0, 0);
}
@@ -962,11 +966,11 @@ void GPU_vertex_setup(DerivedMesh *dm)
void GPU_normal_setup(DerivedMesh *dm)
{
- if(!gpu_buffer_setup_common(dm, GPU_BUFFER_NORMAL))
+ if (!gpu_buffer_setup_common(dm, GPU_BUFFER_NORMAL))
return;
glEnableClientState(GL_NORMAL_ARRAY);
- if(useVBOs) {
+ if (useVBOs) {
glBindBufferARB(GL_ARRAY_BUFFER_ARB, dm->drawObject->normals->id);
glNormalPointer(GL_FLOAT, 0, 0);
}
@@ -979,11 +983,11 @@ void GPU_normal_setup(DerivedMesh *dm)
void GPU_uv_setup(DerivedMesh *dm)
{
- if(!gpu_buffer_setup_common(dm, GPU_BUFFER_UV))
+ if (!gpu_buffer_setup_common(dm, GPU_BUFFER_UV))
return;
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- if(useVBOs) {
+ if (useVBOs) {
glBindBufferARB(GL_ARRAY_BUFFER_ARB, dm->drawObject->uv->id);
glTexCoordPointer(2, GL_FLOAT, 0, 0);
}
@@ -996,11 +1000,11 @@ void GPU_uv_setup(DerivedMesh *dm)
void GPU_color_setup(DerivedMesh *dm)
{
- if(!gpu_buffer_setup_common(dm, GPU_BUFFER_COLOR))
+ if (!gpu_buffer_setup_common(dm, GPU_BUFFER_COLOR))
return;
glEnableClientState(GL_COLOR_ARRAY);
- if(useVBOs) {
+ if (useVBOs) {
glBindBufferARB(GL_ARRAY_BUFFER_ARB, dm->drawObject->colors->id);
glColorPointer(3, GL_UNSIGNED_BYTE, 0, 0);
}
@@ -1013,14 +1017,14 @@ void GPU_color_setup(DerivedMesh *dm)
void GPU_edge_setup(DerivedMesh *dm)
{
- if(!gpu_buffer_setup_common(dm, GPU_BUFFER_EDGE))
+ if (!gpu_buffer_setup_common(dm, GPU_BUFFER_EDGE))
return;
- if(!gpu_buffer_setup_common(dm, GPU_BUFFER_VERTEX))
+ if (!gpu_buffer_setup_common(dm, GPU_BUFFER_VERTEX))
return;
glEnableClientState(GL_VERTEX_ARRAY);
- if(useVBOs) {
+ if (useVBOs) {
glBindBufferARB(GL_ARRAY_BUFFER_ARB, dm->drawObject->points->id);
glVertexPointer(3, GL_FLOAT, 0, 0);
}
@@ -1030,7 +1034,7 @@ void GPU_edge_setup(DerivedMesh *dm)
GLStates |= GPU_BUFFER_VERTEX_STATE;
- if(useVBOs)
+ if (useVBOs)
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, dm->drawObject->edges->id);
GLStates |= GPU_BUFFER_ELEMENT_STATE;
@@ -1038,11 +1042,11 @@ void GPU_edge_setup(DerivedMesh *dm)
void GPU_uvedge_setup(DerivedMesh *dm)
{
- if(!gpu_buffer_setup_common(dm, GPU_BUFFER_UVEDGE))
+ if (!gpu_buffer_setup_common(dm, GPU_BUFFER_UVEDGE))
return;
glEnableClientState(GL_VERTEX_ARRAY);
- if(useVBOs) {
+ if (useVBOs) {
glBindBufferARB(GL_ARRAY_BUFFER_ARB, dm->drawObject->uvedges->id);
glVertexPointer(2, GL_FLOAT, 0, 0);
}
@@ -1075,9 +1079,9 @@ int GPU_attrib_element_size(GPUAttrib data[], int numdata)
{
int i, elementsize = 0;
- for(i = 0; i < numdata; i++) {
+ for (i = 0; i < numdata; i++) {
int typesize = GPU_typesize(data[i].type);
- if(typesize != 0)
+ if (typesize != 0)
elementsize += typesize*data[i].size;
}
return elementsize;
@@ -1089,8 +1093,8 @@ void GPU_interleaved_attrib_setup(GPUBuffer *buffer, GPUAttrib data[], int numda
int elementsize;
intptr_t offset = 0;
- for(i = 0; i < MAX_GPU_ATTRIB_DATA; i++) {
- if(attribData[i].index != -1) {
+ for (i = 0; i < MAX_GPU_ATTRIB_DATA; i++) {
+ if (attribData[i].index != -1) {
glDisableVertexAttribArrayARB(attribData[i].index);
}
else
@@ -1098,9 +1102,9 @@ void GPU_interleaved_attrib_setup(GPUBuffer *buffer, GPUAttrib data[], int numda
}
elementsize = GPU_attrib_element_size(data, numdata);
- if(useVBOs) {
+ if (useVBOs) {
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buffer->id);
- for(i = 0; i < numdata; i++) {
+ for (i = 0; i < numdata; i++) {
glEnableVertexAttribArrayARB(data[i].index);
glVertexAttribPointerARB(data[i].index, data[i].size, data[i].type,
GL_FALSE, elementsize, (void *)offset);
@@ -1113,7 +1117,7 @@ void GPU_interleaved_attrib_setup(GPUBuffer *buffer, GPUAttrib data[], int numda
attribData[numdata].index = -1;
}
else {
- for(i = 0; i < numdata; i++) {
+ for (i = 0; i < numdata; i++) {
glEnableVertexAttribArrayARB(data[i].index);
glVertexAttribPointerARB(data[i].index, data[i].size, data[i].type,
GL_FALSE, elementsize, (char *)buffer->pointer + offset);
@@ -1127,16 +1131,16 @@ void GPU_buffer_unbind(void)
{
int i;
- if(GLStates & GPU_BUFFER_VERTEX_STATE)
+ if (GLStates & GPU_BUFFER_VERTEX_STATE)
glDisableClientState(GL_VERTEX_ARRAY);
- if(GLStates & GPU_BUFFER_NORMAL_STATE)
+ if (GLStates & GPU_BUFFER_NORMAL_STATE)
glDisableClientState(GL_NORMAL_ARRAY);
- if(GLStates & GPU_BUFFER_TEXCOORD_STATE)
+ if (GLStates & GPU_BUFFER_TEXCOORD_STATE)
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- if(GLStates & GPU_BUFFER_COLOR_STATE)
+ if (GLStates & GPU_BUFFER_COLOR_STATE)
glDisableClientState(GL_COLOR_ARRAY);
- if(GLStates & GPU_BUFFER_ELEMENT_STATE) {
- if(useVBOs) {
+ if (GLStates & GPU_BUFFER_ELEMENT_STATE) {
+ if (useVBOs) {
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
}
}
@@ -1144,24 +1148,24 @@ void GPU_buffer_unbind(void)
GPU_BUFFER_TEXCOORD_STATE | GPU_BUFFER_COLOR_STATE |
GPU_BUFFER_ELEMENT_STATE);
- for(i = 0; i < MAX_GPU_ATTRIB_DATA; i++) {
- if(attribData[i].index != -1) {
+ for (i = 0; i < MAX_GPU_ATTRIB_DATA; i++) {
+ if (attribData[i].index != -1) {
glDisableVertexAttribArrayARB(attribData[i].index);
}
else
break;
}
- if(useVBOs)
+ if (useVBOs)
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
}
/* confusion: code in cdderivedmesh calls both GPU_color_setup and
- GPU_color3_upload; both of these set the `colors' buffer, so seems
- like it will just needlessly overwrite? --nicholas */
+ * GPU_color3_upload; both of these set the `colors' buffer, so seems
+ * like it will just needlessly overwrite? --nicholas */
void GPU_color3_upload(DerivedMesh *dm, unsigned char *data)
{
- if(dm->drawObject == 0)
+ if (dm->drawObject == 0)
dm->drawObject = GPU_drawobject_new(dm);
GPU_buffer_free(dm->drawObject->colors);
@@ -1170,27 +1174,15 @@ 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) {
- if(!(GLStates & GPU_BUFFER_COLOR_STATE))
+ if (mode) {
+ if (!(GLStates & GPU_BUFFER_COLOR_STATE))
glEnableClientState(GL_COLOR_ARRAY);
GLStates |= GPU_BUFFER_COLOR_STATE;
}
else {
- if(GLStates & GPU_BUFFER_COLOR_STATE)
+ if (GLStates & GPU_BUFFER_COLOR_STATE)
glDisableClientState(GL_COLOR_ARRAY);
GLStates &= (!GPU_BUFFER_COLOR_STATE);
}
@@ -1201,10 +1193,10 @@ void GPU_color_switch(int mode)
int GPU_buffer_legacy(DerivedMesh *dm)
{
int test= (U.gameflags & USER_DISABLE_VBO);
- if(test)
+ if (test)
return 1;
- if(dm->drawObject == 0)
+ if (dm->drawObject == 0)
dm->drawObject = GPU_drawobject_new(dm);
return dm->drawObject->legacy;
}
@@ -1213,10 +1205,10 @@ void *GPU_buffer_lock(GPUBuffer *buffer)
{
float *varray;
- if(!buffer)
+ if (!buffer)
return 0;
- if(useVBOs) {
+ if (useVBOs) {
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buffer->id);
varray = glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
return varray;
@@ -1230,10 +1222,10 @@ void *GPU_buffer_lock_stream(GPUBuffer *buffer)
{
float *varray;
- if(!buffer)
+ if (!buffer)
return 0;
- if(useVBOs) {
+ if (useVBOs) {
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buffer->id);
/* discard previous data, avoid stalling gpu */
glBufferDataARB(GL_ARRAY_BUFFER_ARB, buffer->size, 0, GL_STREAM_DRAW_ARB);
@@ -1247,8 +1239,8 @@ void *GPU_buffer_lock_stream(GPUBuffer *buffer)
void GPU_buffer_unlock(GPUBuffer *buffer)
{
- if(useVBOs) {
- if(buffer) {
+ if (useVBOs) {
+ if (buffer) {
/* note: this operation can fail, could return
an error code from this function? */
glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
@@ -1289,21 +1281,23 @@ struct GPU_Buffers {
/* grid pointers */
DMGridData **grids;
+ const DMFlagMat *grid_flag_mats;
+ const BLI_bitmap *grid_hidden;
int *grid_indices;
int totgrid;
int gridsize;
+ int has_hidden;
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;
- if(buffers->vert_buf) {
+ if (buffers->vert_buf) {
/* Build VBO */
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buffers->vert_buf);
glBufferDataARB(GL_ARRAY_BUFFER_ARB,
@@ -1311,8 +1305,8 @@ void GPU_update_mesh_buffers(GPU_Buffers *buffers, MVert *mvert,
NULL, GL_STATIC_DRAW_ARB);
vert_data = glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
- if(vert_data) {
- for(i = 0; i < totvert; ++i) {
+ if (vert_data) {
+ for (i = 0; i < totvert; ++i) {
MVert *v = mvert + vert_indices[i];
VertexBufferFormat *out = vert_data + i;
@@ -1331,11 +1325,11 @@ 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],
- MFace *mface, int *face_indices,
+ MFace *mface, MVert *mvert,
+ int *face_indices,
int totface)
{
GPU_Buffers *buffers;
@@ -1345,14 +1339,17 @@ GPU_Buffers *GPU_build_mesh_buffers(int (*face_vert_indices)[4],
buffers = MEM_callocN(sizeof(GPU_Buffers), "GPU_Buffers");
buffers->index_type = GL_UNSIGNED_SHORT;
- /* Count the number of triangles */
- for(i = 0, tottri = 0; i < totface; ++i)
- tottri += mface[face_indices[i]].v4 ? 2 : 1;
+ /* Count the number of visible triangles */
+ for (i = 0, tottri = 0; i < totface; ++i) {
+ const MFace *f = &mface[face_indices[i]];
+ if (!paint_is_face_hidden(f, mvert))
+ tottri += f->v4 ? 2 : 1;
+ }
- if(GLEW_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO))
+ if (GLEW_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO))
glGenBuffersARB(1, &buffers->index_buf);
- if(buffers->index_buf) {
+ if (buffers->index_buf) {
/* Generate index buffer object */
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, buffers->index_buf);
glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB,
@@ -1360,17 +1357,21 @@ GPU_Buffers *GPU_build_mesh_buffers(int (*face_vert_indices)[4],
/* Fill the triangle buffer */
tri_data = glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
- if(tri_data) {
- for(i = 0; i < totface; ++i) {
- MFace *f = mface + face_indices[i];
+ if (tri_data) {
+ for (i = 0; i < totface; ++i) {
+ const MFace *f = mface + face_indices[i];
int v[3];
+ /* Skip hidden faces */
+ if (paint_is_face_hidden(f, mvert))
+ continue;
+
v[0]= 0;
v[1]= 1;
v[2]= 2;
- for(j = 0; j < (f->v4 ? 2 : 1); ++j) {
- for(k = 0; k < 3; ++k) {
+ for (j = 0; j < (f->v4 ? 2 : 1); ++j) {
+ for (k = 0; k < 3; ++k) {
*tri_data = face_vert_indices[i][v[k]];
++tri_data;
}
@@ -1389,7 +1390,7 @@ GPU_Buffers *GPU_build_mesh_buffers(int (*face_vert_indices)[4],
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
}
- if(buffers->index_buf)
+ if (buffers->index_buf)
glGenBuffersARB(1, &buffers->vert_buf);
buffers->tot_tri = tottri;
@@ -1402,7 +1403,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;
@@ -1410,23 +1411,25 @@ void GPU_update_grid_buffers(GPU_Buffers *buffers, DMGridData **grids,
totvert= gridsize*gridsize*totgrid;
/* Build VBO */
- if(buffers->vert_buf) {
+ 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,
NULL, GL_STATIC_DRAW_ARB);
vert_data = glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
- if(vert_data) {
- for(i = 0; i < totgrid; ++i) {
+ if (vert_data) {
+ for (i = 0; i < totgrid; ++i) {
DMGridData *grid= grids[grid_indices[i]];
memcpy(vert_data, grid, sizeof(DMGridData)*gridsize*gridsize);
- if(!smooth) {
+ if (!smooth) {
/* for flat shading, recalc normals and set the last vertex of
each quad in the index buffer to have the flat normal as
that is what opengl will use */
- for(j = 0; j < gridsize-1; ++j) {
- for(k = 0; k < gridsize-1; ++k) {
+ for (j = 0; j < gridsize-1; ++j) {
+ for (k = 0; k < gridsize-1; ++k) {
float fno[3];
normal_quad_v3(fno,
grid[(j+1)*gridsize + k].co,
@@ -1454,30 +1457,70 @@ 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);
}
+/* Returns the number of visible quads in the nodes' grids. */
+static int gpu_count_grid_quads(BLI_bitmap *grid_hidden,
+ int *grid_indices, int totgrid,
+ int gridsize)
+{
+ int gridarea = (gridsize-1) * (gridsize-1);
+ int i, x, y, totquad;
+
+ /* grid hidden layer is present, so have to check each grid for
+ visiblity */
+
+ for (i = 0, totquad = 0; i < totgrid; i++) {
+ const BLI_bitmap gh = grid_hidden[grid_indices[i]];
+
+ if (gh) {
+ /* grid hidden are present, have to check each element */
+ for (y = 0; y < gridsize-1; y++) {
+ for (x = 0; x < gridsize-1; x++) {
+ if (!paint_is_grid_face_hidden(gh, gridsize, x, y))
+ totquad++;
+ }
+ }
+ }
+ else
+ totquad += gridarea;
+ }
+
+ return totquad;
+}
+
/* Build the element array buffer of grid indices using either
unsigned shorts or unsigned ints. */
-#define FILL_QUAD_BUFFER(type_) \
+#define FILL_QUAD_BUFFER(type_, tot_quad_, buffer_) \
{ \
type_ *quad_data; \
int offset = 0; \
- int i, j, k; \
- \
+ int i, j, k; \
+ \
glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, \
- sizeof(type_) * totquad * 4, NULL, \
+ sizeof(type_) * (tot_quad_) * 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(j = 0; j < gridsize-1; ++j) { \
- for(k = 0; k < gridsize-1; ++k) { \
+ if (quad_data) { \
+ for (i = 0; i < totgrid; ++i) { \
+ BLI_bitmap gh = NULL; \
+ if (grid_hidden) \
+ gh = grid_hidden[(grid_indices)[i]]; \
+ \
+ for (j = 0; j < gridsize-1; ++j) { \
+ for (k = 0; k < gridsize-1; ++k) { \
+ /* Skip hidden grid face */ \
+ if (gh && \
+ paint_is_grid_face_hidden(gh, \
+ gridsize, k, j)) \
+ continue; \
+ \
*(quad_data++)= offset + j*gridsize + k+1; \
*(quad_data++)= offset + j*gridsize + k; \
*(quad_data++)= offset + (j+1)*gridsize + k; \
@@ -1490,66 +1533,132 @@ void GPU_update_grid_buffers(GPU_Buffers *buffers, DMGridData **grids,
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)
+{
+ static int prev_gridsize = -1;
+ static GLenum prev_index_type = 0;
+ static GLuint buffer = 0;
+ static unsigned prev_totquad;
+
+ /* used in the FILL_QUAD_BUFFER macro */
+ const BLI_bitmap *grid_hidden = NULL;
+ int *grid_indices = NULL;
+ int totgrid = 1;
+
+ /* 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;
+ }
+
+ /* VBO is already built */
+ if (buffer && prev_gridsize == gridsize) {
+ *index_type = prev_index_type;
+ *totquad = prev_totquad;
+ return buffer;
+ }
+
+ /* Build new VBO */
+ glGenBuffersARB(1, &buffer);
+ if (buffer) {
+ *totquad= (gridsize-1)*(gridsize-1);
+
+ glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, buffer);
+
+ if (gridsize * gridsize < USHRT_MAX) {
+ *index_type = GL_UNSIGNED_SHORT;
+ FILL_QUAD_BUFFER(unsigned short, *totquad, buffer);
+ }
+ else {
+ *index_type = GL_UNSIGNED_INT;
+ FILL_QUAD_BUFFER(unsigned int, *totquad, buffer);
+ }
+
+ glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
+ }
+
+ prev_gridsize = gridsize;
+ prev_index_type = *index_type;
+ prev_totquad = *totquad;
+ return buffer;
+}
+
+GPU_Buffers *GPU_build_grid_buffers(int *grid_indices, int totgrid,
+ BLI_bitmap *grid_hidden, int gridsize)
{
GPU_Buffers *buffers;
int totquad;
+ int fully_visible_totquad = (gridsize-1) * (gridsize-1) * totgrid;
buffers = MEM_callocN(sizeof(GPU_Buffers), "GPU_Buffers");
+ buffers->grid_hidden = grid_hidden;
+ buffers->gridsize = gridsize;
+ buffers->totgrid = totgrid;
/* Count the number of quads */
- totquad= (gridsize-1)*(gridsize-1)*totgrid;
+ totquad= gpu_count_grid_quads(grid_hidden, grid_indices, totgrid, gridsize);
- /* Generate index buffer object */
- if(GLEW_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO))
+ if (totquad == fully_visible_totquad) {
+ buffers->index_buf = gpu_get_grid_buffer(gridsize, &buffers->index_type, &buffers->tot_quad);
+ buffers->has_hidden = 0;
+ }
+ else if (GLEW_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO)) {
+ /* Build new VBO */
glGenBuffersARB(1, &buffers->index_buf);
+ if (buffers->index_buf) {
+ buffers->tot_quad= totquad;
- if(buffers->index_buf) {
- glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, buffers->index_buf);
+ glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, buffers->index_buf);
- if(totquad < USHRT_MAX) {
- buffers->index_type = GL_UNSIGNED_SHORT;
- FILL_QUAD_BUFFER(unsigned short);
- }
- else {
- buffers->index_type = GL_UNSIGNED_INT;
- FILL_QUAD_BUFFER(unsigned int);
+ if (totgrid * gridsize * gridsize < USHRT_MAX) {
+ buffers->index_type = GL_UNSIGNED_SHORT;
+ FILL_QUAD_BUFFER(unsigned short, totquad, buffers->index_buf);
+ }
+ else {
+ buffers->index_type = GL_UNSIGNED_INT;
+ FILL_QUAD_BUFFER(unsigned int, totquad, buffers->index_buf);
+ }
+
+ glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
}
- glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
+ buffers->has_hidden = 1;
}
- /* Build VBO */
- if(buffers->index_buf)
+ /* 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;
- for(i = 0; i < buffers->totface; ++i) {
+ for (i = 0; i < buffers->totface; ++i) {
MFace *f = buffers->mface + buffers->face_indices[i];
int S = f->v4 ? 4 : 3;
unsigned int *fv = &f->v1;
+ if (paint_is_face_hidden(f, buffers->mvert))
+ continue;
+
glBegin((f->v4)? GL_QUADS: GL_TRIANGLES);
- if(buffers->smooth) {
- for(j = 0; j < S; j++) {
+ if (smooth) {
+ for (j = 0; j < S; j++) {
glNormal3sv(mvert[fv[j]].no);
glVertex3fv(mvert[fv[j]].co);
}
@@ -1558,7 +1667,7 @@ static void gpu_draw_buffers_legacy_mesh(GPU_Buffers *buffers)
float fno[3];
/* calculate face normal */
- if(f->v4) {
+ if (f->v4) {
normal_quad_v3(fno, mvert[fv[0]].co, mvert[fv[1]].co,
mvert[fv[2]].co, mvert[fv[3]].co);
}
@@ -1566,7 +1675,7 @@ static void gpu_draw_buffers_legacy_mesh(GPU_Buffers *buffers)
normal_tri_v3(fno, mvert[fv[0]].co, mvert[fv[1]].co, mvert[fv[2]].co);
glNormal3fv(fno);
- for(j = 0; j < S; j++)
+ for (j = 0; j < S; j++)
glVertex3fv(mvert[fv[j]].co);
}
@@ -1574,19 +1683,58 @@ 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;
+ int i, j, x, y, gridsize = buffers->gridsize;
- if(buffers->smooth) {
- for(i = 0; i < buffers->totgrid; ++i) {
- DMGridData *grid = buffers->grids[buffers->grid_indices[i]];
+ for (i = 0; i < buffers->totgrid; ++i) {
+ int g = buffers->grid_indices[i];
+ const DMGridData *grid = buffers->grids[g];
+ BLI_bitmap gh = buffers->grid_hidden[g];
- for(y = 0; y < gridsize-1; y++) {
+ /* TODO: could use strips with hiding as well */
+
+ if (gh) {
+ glBegin(GL_QUADS);
+
+ for (y = 0; y < gridsize-1; y++) {
+ for (x = 0; x < gridsize-1; x++) {
+ const DMGridData *e[4] = {
+ &grid[y*gridsize + x],
+ &grid[(y+1)*gridsize + x],
+ &grid[(y+1)*gridsize + x+1],
+ &grid[y*gridsize + x+1]
+ };
+
+ /* skip face if any of its corners are hidden */
+ if (paint_is_grid_face_hidden(gh, gridsize, x, y))
+ continue;
+
+ if (smooth) {
+ for (j = 0; j < 4; j++) {
+ glNormal3fv(e[j]->no);
+ glVertex3fv(e[j]->co);
+ }
+ }
+ else {
+ float fno[3];
+ normal_quad_v3(fno, e[0]->co, e[1]->co, e[2]->co, e[3]->co);
+ glNormal3fv(fno);
+
+ for (j = 0; j < 4; j++)
+ glVertex3fv(e[j]->co);
+ }
+ }
+ }
+
+ glEnd();
+ }
+ else if (smooth) {
+ for (y = 0; y < gridsize-1; y++) {
glBegin(GL_QUAD_STRIP);
- for(x = 0; x < gridsize; x++) {
- DMGridData *a = &grid[y*gridsize + x];
- DMGridData *b = &grid[(y+1)*gridsize + x];
+ for (x = 0; x < gridsize; x++) {
+ const DMGridData *a = &grid[y*gridsize + x];
+ const DMGridData *b = &grid[(y+1)*gridsize + x];
glNormal3fv(a->no);
glVertex3fv(a->co);
@@ -1596,20 +1744,16 @@ static void gpu_draw_buffers_legacy_grids(GPU_Buffers *buffers)
glEnd();
}
}
- }
- else {
- for(i = 0; i < buffers->totgrid; ++i) {
- DMGridData *grid = buffers->grids[buffers->grid_indices[i]];
-
- for(y = 0; y < gridsize-1; y++) {
+ else {
+ for (y = 0; y < gridsize-1; y++) {
glBegin(GL_QUAD_STRIP);
- for(x = 0; x < gridsize; x++) {
- DMGridData *a = &grid[y*gridsize + x];
- DMGridData *b = &grid[(y+1)*gridsize + x];
+ for (x = 0; x < gridsize; x++) {
+ const DMGridData *a = &grid[y*gridsize + x];
+ const DMGridData *b = &grid[(y+1)*gridsize + x];
- if(x > 0) {
- DMGridData *c = &grid[y*gridsize + x-1];
- DMGridData *d = &grid[(y+1)*gridsize + x-1];
+ if (x > 0) {
+ const DMGridData *c = &grid[y*gridsize + x-1];
+ const DMGridData *d = &grid[(y+1)*gridsize + x-1];
float fno[3];
normal_quad_v3(fno, d->co, b->co, a->co, c->co);
glNormal3fv(fno);
@@ -1624,20 +1768,45 @@ 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)
{
- if(buffers->vert_buf && buffers->index_buf) {
+ 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);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buffers->vert_buf);
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));
+ if (buffers->tot_quad) {
+ unsigned offset = 0;
+ int i, last = buffers->has_hidden ? 1 : buffers->totgrid;
+ for (i = 0; i < last; 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);
- 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));
@@ -1653,20 +1822,20 @@ void GPU_draw_buffers(GPU_Buffers *buffers)
glDisableClientState(GL_NORMAL_ARRAY);
}
/* fallbacks if we are out of memory or VBO is disabled */
- else if(buffers->totface) {
- gpu_draw_buffers_legacy_mesh(buffers);
+ else if (buffers->totface) {
+ gpu_draw_buffers_legacy_mesh(buffers, smooth);
}
- else if(buffers->totgrid) {
- gpu_draw_buffers_legacy_grids(buffers);
+ else if (buffers->totgrid) {
+ gpu_draw_buffers_legacy_grids(buffers, smooth);
}
}
void GPU_free_buffers(GPU_Buffers *buffers)
{
- if(buffers) {
- if(buffers->vert_buf)
+ if (buffers) {
+ if (buffers->vert_buf)
glDeleteBuffersARB(1, &buffers->vert_buf);
- if(buffers->index_buf)
+ if (buffers->index_buf && (buffers->tot_tri || buffers->has_hidden))
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..14d6428bf50 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -72,13 +72,13 @@ 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)
{
- while(*str && *prefix) {
- if(*str != *prefix)
+ while (*str && *prefix) {
+ if (*str != *prefix)
return 0;
str++;
@@ -93,11 +93,11 @@ static char *gpu_str_skip_token(char *str, char *token, int max)
int len = 0;
/* skip a variable/function name */
- while(*str) {
- if(ELEM7(*str, ' ', '(', ')', ',', '\t', '\n', '\r'))
+ while (*str) {
+ if (ELEM7(*str, ' ', '(', ')', ',', '\t', '\n', '\r'))
break;
else {
- if(token && len < max-1) {
+ if (token && len < max-1) {
*token= *str;
token++;
len++;
@@ -106,13 +106,13 @@ static char *gpu_str_skip_token(char *str, char *token, int max)
}
}
- if(token)
+ if (token)
*token= '\0';
/* skip the next special characters:
* note the missing ')' */
- while(*str) {
- if(ELEM6(*str, ' ', '(', ',', '\t', '\n', '\r'))
+ while (*str) {
+ if (ELEM6(*str, ' ', '(', ',', '\t', '\n', '\r'))
str++;
else
break;
@@ -126,38 +126,38 @@ static void gpu_parse_functions_string(GHash *hash, char *code)
GPUFunction *function;
int i, type, qual;
- while((code = strstr(code, "void "))) {
+ while ((code = strstr(code, "void "))) {
function = MEM_callocN(sizeof(GPUFunction), "GPUFunction");
code = gpu_str_skip_token(code, NULL, 0);
code = gpu_str_skip_token(code, function->name, MAX_FUNCTION_NAME);
/* get parameters */
- while(*code && *code != ')') {
+ while (*code && *code != ')') {
/* test if it's an input or output */
qual = FUNCTION_QUAL_IN;
- if(gpu_str_prefix(code, "out "))
+ if (gpu_str_prefix(code, "out "))
qual = FUNCTION_QUAL_OUT;
- if(gpu_str_prefix(code, "inout "))
+ if (gpu_str_prefix(code, "inout "))
qual = FUNCTION_QUAL_INOUT;
- if((qual != FUNCTION_QUAL_IN) || gpu_str_prefix(code, "in "))
+ if ((qual != FUNCTION_QUAL_IN) || gpu_str_prefix(code, "in "))
code = gpu_str_skip_token(code, NULL, 0);
/* test for type */
type= 0;
- for(i=1; i<=16; i++) {
- if(GPU_DATATYPE_STR[i] && gpu_str_prefix(code, GPU_DATATYPE_STR[i])) {
+ for (i=1; i<=16; i++) {
+ if (GPU_DATATYPE_STR[i] && gpu_str_prefix(code, GPU_DATATYPE_STR[i])) {
type= i;
break;
}
}
- if(!type && gpu_str_prefix(code, "sampler2DShadow"))
+ if (!type && gpu_str_prefix(code, "sampler2DShadow"))
type= GPU_SHADOW2D;
- if(!type && gpu_str_prefix(code, "sampler2D"))
+ if (!type && gpu_str_prefix(code, "sampler2D"))
type= GPU_TEX2D;
- if(type) {
+ if (type) {
/* add paramater */
code = gpu_str_skip_token(code, NULL, 0);
code = gpu_str_skip_token(code, NULL, 0);
@@ -171,7 +171,7 @@ static void gpu_parse_functions_string(GHash *hash, char *code)
}
}
- if(function->name[0] == '\0' || function->totparam == 0) {
+ if (function->name[0] == '\0' || function->totparam == 0) {
fprintf(stderr, "GPU functions parse error.\n");
MEM_freeN(function);
break;
@@ -194,27 +194,27 @@ static char *gpu_generate_function_prototyps(GHash *hash)
* generated code, to avoid have to add the actual code & recompile all */
ghi = BLI_ghashIterator_new(hash);
- for(; !BLI_ghashIterator_isDone(ghi); BLI_ghashIterator_step(ghi)) {
+ for (; !BLI_ghashIterator_isDone(ghi); BLI_ghashIterator_step(ghi)) {
name = BLI_ghashIterator_getValue(ghi);
function = BLI_ghashIterator_getValue(ghi);
BLI_dynstr_appendf(ds, "void %s(", name);
- for(a=0; a<function->totparam; a++) {
- if(function->paramqual[a] == FUNCTION_QUAL_OUT)
+ for (a=0; a<function->totparam; a++) {
+ if (function->paramqual[a] == FUNCTION_QUAL_OUT)
BLI_dynstr_append(ds, "out ");
- else if(function->paramqual[a] == FUNCTION_QUAL_INOUT)
+ else if (function->paramqual[a] == FUNCTION_QUAL_INOUT)
BLI_dynstr_append(ds, "inout ");
- if(function->paramtype[a] == GPU_TEX2D)
+ if (function->paramtype[a] == GPU_TEX2D)
BLI_dynstr_append(ds, "sampler2D");
- else if(function->paramtype[a] == GPU_SHADOW2D)
+ else if (function->paramtype[a] == GPU_SHADOW2D)
BLI_dynstr_append(ds, "sampler2DShadow");
else
BLI_dynstr_append(ds, GPU_DATATYPE_STR[function->paramtype[a]]);
//BLI_dynstr_appendf(ds, " param%d", a);
- if(a != function->totparam-1)
+ if (a != function->totparam-1)
BLI_dynstr_append(ds, ", ");
}
BLI_dynstr_append(ds, ");\n");
@@ -231,7 +231,7 @@ static char *gpu_generate_function_prototyps(GHash *hash)
GPUFunction *GPU_lookup_function(const char *name)
{
- if(!FUNCTION_HASH) {
+ if (!FUNCTION_HASH) {
FUNCTION_HASH = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "GPU_lookup_function gh");
gpu_parse_functions_string(FUNCTION_HASH, glsl_material_library);
/*FUNCTION_PROTOTYPES = gpu_generate_function_prototyps(FUNCTION_HASH);
@@ -250,15 +250,15 @@ void GPU_codegen_exit(void)
{
extern Material defmaterial; // render module abuse...
- if(defmaterial.gpumaterial.first)
+ if (defmaterial.gpumaterial.first)
GPU_material_free(&defmaterial);
- if(FUNCTION_HASH) {
+ if (FUNCTION_HASH) {
BLI_ghash_free(FUNCTION_HASH, NULL, (GHashValFreeFP)MEM_freeN);
FUNCTION_HASH = NULL;
}
- if(glsl_material_library) {
+ if (glsl_material_library) {
MEM_freeN(glsl_material_library);
glsl_material_library = NULL;
}
@@ -324,9 +324,9 @@ static void codegen_print_datatype(DynStr *ds, int type, float *data)
BLI_dynstr_appendf(ds, "%s(", GPU_DATATYPE_STR[type]);
- for(i=0; i<type; i++) {
+ for (i=0; i<type; i++) {
BLI_dynstr_appendf(ds, "%f", data[i]);
- if(i == type-1)
+ if (i == type-1)
BLI_dynstr_append(ds, ")");
else
BLI_dynstr_append(ds, ", ");
@@ -337,7 +337,7 @@ static int codegen_input_has_texture(GPUInput *input)
{
if (input->link)
return 0;
- else if(input->ima)
+ else if (input->ima)
return 1;
else
return input->tex != NULL;
@@ -345,21 +345,21 @@ static int codegen_input_has_texture(GPUInput *input)
const char *GPU_builtin_name(GPUBuiltin builtin)
{
- if(builtin == GPU_VIEW_MATRIX)
+ if (builtin == GPU_VIEW_MATRIX)
return "unfviewmat";
- else if(builtin == GPU_OBJECT_MATRIX)
+ else if (builtin == GPU_OBJECT_MATRIX)
return "unfobmat";
- else if(builtin == GPU_INVERSE_VIEW_MATRIX)
+ else if (builtin == GPU_INVERSE_VIEW_MATRIX)
return "unfinvviewmat";
- else if(builtin == GPU_INVERSE_OBJECT_MATRIX)
+ else if (builtin == GPU_INVERSE_OBJECT_MATRIX)
return "unfinvobmat";
- else if(builtin == GPU_VIEW_POSITION)
+ else if (builtin == GPU_VIEW_POSITION)
return "varposition";
- else if(builtin == GPU_VIEW_NORMAL)
+ else if (builtin == GPU_VIEW_NORMAL)
return "varnormal";
- else if(builtin == GPU_OBCOLOR)
+ else if (builtin == GPU_OBCOLOR)
return "unfobcolor";
- else if(builtin == GPU_AUTO_BUMPSCALE)
+ else if (builtin == GPU_AUTO_BUMPSCALE)
return "unfobautobumpscale";
else
return "";
@@ -397,7 +397,7 @@ static void codegen_set_unique_ids(ListBase *nodes)
else
input->texid = GET_INT_FROM_POINTER(BLI_ghash_lookup(bindhash, input->link));
}
- else if(input->ima) {
+ else if (input->ima) {
/* input is texture from image, assign only one texid per
buffer to avoid sampling the same texture twice */
if (!BLI_ghash_haskey(bindhash, input->ima)) {
@@ -421,7 +421,7 @@ static void codegen_set_unique_ids(ListBase *nodes)
/* make sure this pixel is defined exactly once */
if (input->source == GPU_SOURCE_TEX_PIXEL) {
- if(input->ima) {
+ if (input->ima) {
if (!BLI_ghash_haskey(definehash, input->ima)) {
input->definetex = 1;
BLI_ghash_insert(definehash, input->ima, SET_INT_IN_POINTER(input->texid));
@@ -463,13 +463,13 @@ static void codegen_print_uniforms_functions(DynStr *ds, ListBase *nodes)
(input->textype == GPU_TEX2D)? "sampler2D": "sampler2DShadow",
input->texid);
}
- else if(input->source == GPU_SOURCE_BUILTIN) {
+ else if (input->source == GPU_SOURCE_BUILTIN) {
/* only define each builting uniform/varying once */
- if(!(builtins & input->builtin)) {
+ if (!(builtins & input->builtin)) {
builtins |= input->builtin;
name = GPU_builtin_name(input->builtin);
- if(gpu_str_prefix(name, "unf")) {
+ if (gpu_str_prefix(name, "unf")) {
BLI_dynstr_appendf(ds, "uniform %s %s;\n",
GPU_DATATYPE_STR[input->type], name);
}
@@ -480,7 +480,7 @@ static void codegen_print_uniforms_functions(DynStr *ds, ListBase *nodes)
}
}
else if (input->source == GPU_SOURCE_VEC_UNIFORM) {
- if(input->dynamicvec) {
+ if (input->dynamicvec) {
/* only create uniforms for dynamic vectors */
BLI_dynstr_appendf(ds, "uniform %s unf%d;\n",
GPU_DATATYPE_STR[input->type], input->id);
@@ -549,10 +549,10 @@ static void codegen_call_functions(DynStr *ds, ListBase *nodes, GPUOutput *final
codegen_convert_datatype(ds, input->link->output->type, input->type,
"tmp", input->link->output->id);
}
- else if(input->source == GPU_SOURCE_BUILTIN)
+ else if (input->source == GPU_SOURCE_BUILTIN)
BLI_dynstr_appendf(ds, "%s", GPU_builtin_name(input->builtin));
- else if(input->source == GPU_SOURCE_VEC_UNIFORM) {
- if(input->dynamicvec)
+ else if (input->source == GPU_SOURCE_VEC_UNIFORM) {
+ if (input->dynamicvec)
BLI_dynstr_appendf(ds, "unf%d", input->id);
else
BLI_dynstr_appendf(ds, "cons%d", input->id);
@@ -587,7 +587,7 @@ static char *code_generate_fragment(ListBase *nodes, GPUOutput *output, const ch
codegen_set_unique_ids(nodes);
codegen_print_uniforms_functions(ds, nodes);
- //if(G.f & G_DEBUG)
+ //if(G.debug & G_DEBUG)
// BLI_dynstr_appendf(ds, "/* %s */\n", name);
BLI_dynstr_append(ds, "void main(void)\n");
@@ -602,7 +602,7 @@ static char *code_generate_fragment(ListBase *nodes, GPUOutput *output, const ch
code = BLI_dynstr_get_cstring(ds);
BLI_dynstr_free(ds);
- //if(G.f & G_DEBUG) printf("%s\n", code);
+ //if(G.debug & G_DEBUG) printf("%s\n", code);
return code;
}
@@ -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);
}
@@ -646,7 +645,7 @@ static char *code_generate_vertex(ListBase *nodes)
BLI_dynstr_free(ds);
- //if(G.f & G_DEBUG) printf("%s\n", code);
+ //if(G.debug & G_DEBUG) printf("%s\n", code);
return code;
}
@@ -661,12 +660,12 @@ void GPU_code_generate_glsl_lib(void)
DynStr *ds;
/* only initialize the library once */
- if(glsl_material_library)
+ if (glsl_material_library)
return;
ds = BLI_dynstr_new();
- if(GPU_bicubic_bump_support()){
+ if (GPU_bicubic_bump_support()) {
BLI_dynstr_append(ds, "/* These are needed for high quality bump mapping */\n"
"#version 130\n"
"#extension GL_ARB_texture_query_lod: enable\n"
@@ -698,7 +697,7 @@ static void GPU_nodes_extract_dynamic_inputs(GPUPass *pass, ListBase *nodes)
memset(inputs, 0, sizeof(*inputs));
- if(!shader)
+ if (!shader)
return;
GPU_shader_bind(shader);
@@ -710,7 +709,7 @@ static void GPU_nodes_extract_dynamic_inputs(GPUPass *pass, ListBase *nodes)
/* attributes don't need to be bound, they already have
* an id that the drawing functions will use */
- if(input->source == GPU_SOURCE_ATTRIB ||
+ if (input->source == GPU_SOURCE_ATTRIB ||
input->source == GPU_SOURCE_BUILTIN)
continue;
@@ -722,18 +721,18 @@ static void GPU_nodes_extract_dynamic_inputs(GPUPass *pass, ListBase *nodes)
/* pass non-dynamic uniforms to opengl */
extract = 0;
- if(input->ima || input->tex) {
+ if (input->ima || input->tex) {
if (input->bindtex)
extract = 1;
}
- else if(input->dynamicvec)
+ else if (input->dynamicvec)
extract = 1;
- if(extract)
+ if (extract)
input->shaderloc = GPU_shader_get_uniform(shader, input->shadername);
/* extract nodes */
- if(extract) {
+ if (extract) {
BLI_remlink(&node->inputs, input);
BLI_addtail(inputs, input);
}
@@ -759,7 +758,7 @@ void GPU_pass_bind(GPUPass *pass, double time, int mipmap)
if (input->ima)
input->tex = GPU_texture_from_blender(input->ima, input->iuser, time, mipmap);
- if(input->tex && input->bindtex) {
+ if (input->tex && input->bindtex) {
GPU_texture_bind(input->tex, input->texid);
GPU_shader_uniform_texture(shader, input->shaderloc, input->tex);
}
@@ -777,7 +776,7 @@ void GPU_pass_update_uniforms(GPUPass *pass)
/* pass dynamic inputs to opengl, others were removed */
for (input=inputs->first; input; input=input->next)
- if(!(input->ima || input->tex))
+ if (!(input->ima || input->tex))
GPU_shader_uniform_vector(shader, input->shaderloc, input->type, 1,
input->dynamicvec);
}
@@ -792,7 +791,7 @@ void GPU_pass_unbind(GPUPass *pass)
return;
for (input=inputs->first; input; input=input->next) {
- if(input->tex && input->bindtex)
+ if (input->tex && input->bindtex)
GPU_texture_unbind(input->tex);
if (input->ima)
@@ -849,14 +848,14 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, int type)
GPUNode *outnode;
const char *name;
- if(link->output) {
+ if (link->output) {
outnode = link->output->node;
name = outnode->name;
- if(strcmp(name, "set_value")==0 || strcmp(name, "set_rgb")==0) {
+ if (strcmp(name, "set_value")==0 || strcmp(name, "set_rgb")==0) {
input = MEM_dupallocN(outnode->inputs.first);
input->type = type;
- if(input->link)
+ if (input->link)
input->link->users++;
BLI_addtail(&node->inputs, input);
return;
@@ -866,7 +865,7 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, int type)
input = MEM_callocN(sizeof(GPUInput), "GPUInput");
input->node = node;
- if(link->builtin) {
+ if (link->builtin) {
/* builtin uniform */
input->type = type;
input->source = GPU_SOURCE_BUILTIN;
@@ -874,14 +873,14 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, int type)
MEM_freeN(link);
}
- else if(link->output) {
+ else if (link->output) {
/* link to a node output */
input->type = type;
input->source = GPU_SOURCE_TEX_PIXEL;
input->link = link;
link->users++;
}
- else if(link->dynamictex) {
+ else if (link->dynamictex) {
/* dynamic texture, GPUTexture is updated/deleted externally */
input->type = type;
input->source = GPU_SOURCE_TEX;
@@ -893,7 +892,7 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, int type)
input->dynamicdata = link->ptr2;
MEM_freeN(link);
}
- else if(link->texture) {
+ else if (link->texture) {
/* small texture created on the fly, like for colorbands */
input->type = GPU_VEC4;
input->source = GPU_SOURCE_TEX;
@@ -906,7 +905,7 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, int type)
MEM_freeN(link->ptr1);
MEM_freeN(link);
}
- else if(link->image) {
+ else if (link->image) {
/* blender image */
input->type = GPU_VEC4;
input->source = GPU_SOURCE_TEX;
@@ -917,7 +916,7 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, int type)
input->textype = GPU_TEX2D;
MEM_freeN(link);
}
- else if(link->attribtype) {
+ else if (link->attribtype) {
/* vertex attribute */
input->type = type;
input->source = GPU_SOURCE_ATTRIB;
@@ -932,7 +931,7 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, int type)
input->source = GPU_SOURCE_VEC_UNIFORM;
memcpy(input->vec, link->ptr1, type*sizeof(float));
- if(link->dynamic) {
+ if (link->dynamic) {
input->dynamicvec= link->ptr1;
input->dynamictype= link->dynamictype;
input->dynamicdata= link->ptr2;
@@ -947,7 +946,7 @@ static void gpu_node_input_socket(GPUNode *node, GPUNodeStack *sock)
{
GPUNodeLink *link;
- if(sock->link) {
+ if (sock->link) {
gpu_node_input_link(node, sock->link, sock->type);
}
else {
@@ -980,10 +979,10 @@ static void GPU_inputs_free(ListBase *inputs)
{
GPUInput *input;
- for(input=inputs->first; input; input=input->next) {
- if(input->link)
+ for (input=inputs->first; input; input=input->next) {
+ if (input->link)
GPU_node_link_free(input->link);
- else if(input->tex && !input->dynamictex)
+ else if (input->tex && !input->dynamictex)
GPU_texture_free(input->tex);
}
@@ -1030,16 +1029,16 @@ static void gpu_nodes_get_vertex_attributes(ListBase *nodes, GPUVertexAttribs *a
memset(attribs, 0, sizeof(*attribs));
- for(node=nodes->first; node; node=node->next) {
- for(input=node->inputs.first; input; input=input->next) {
- if(input->source == GPU_SOURCE_ATTRIB) {
- for(a=0; a<attribs->totlayer; a++) {
- if(attribs->layer[a].type == input->attribtype &&
+ for (node=nodes->first; node; node=node->next) {
+ for (input=node->inputs.first; input; input=input->next) {
+ if (input->source == GPU_SOURCE_ATTRIB) {
+ for (a=0; a<attribs->totlayer; a++) {
+ if (attribs->layer[a].type == input->attribtype &&
strcmp(attribs->layer[a].name, input->attribname) == 0)
break;
}
- if(a == attribs->totlayer && a < GPU_MAX_ATTRIB) {
+ if (a == attribs->totlayer && a < GPU_MAX_ATTRIB) {
input->attribid = attribs->totlayer++;
input->attribfirst = 1;
@@ -1062,9 +1061,9 @@ static void gpu_nodes_get_builtin_flag(ListBase *nodes, int *builtin)
*builtin= 0;
- for(node=nodes->first; node; node=node->next)
- for(input=node->inputs.first; input; input=input->next)
- if(input->source == GPU_SOURCE_BUILTIN)
+ for (node=nodes->first; node; node=node->next)
+ for (input=node->inputs.first; input; input=input->next)
+ if (input->source == GPU_SOURCE_BUILTIN)
*builtin |= input->builtin;
}
@@ -1164,7 +1163,7 @@ int GPU_link(GPUMaterial *mat, const char *name, ...)
int i;
function = GPU_lookup_function(name);
- if(!function) {
+ if (!function) {
fprintf(stderr, "GPU failed to find function %s\n", name);
return 0;
}
@@ -1172,8 +1171,8 @@ int GPU_link(GPUMaterial *mat, const char *name, ...)
node = GPU_node_begin(name);
va_start(params, name);
- for(i=0; i<function->totparam; i++) {
- if(function->paramqual[i] != FUNCTION_QUAL_IN) {
+ for (i=0; i<function->totparam; i++) {
+ if (function->paramqual[i] != FUNCTION_QUAL_IN) {
linkptr= va_arg(params, GPUNodeLink**);
GPU_node_output(node, function->paramtype[i], "", linkptr);
}
@@ -1200,7 +1199,7 @@ int GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNode
int i, totin, totout;
function = GPU_lookup_function(name);
- if(!function) {
+ if (!function) {
fprintf(stderr, "GPU failed to find function %s\n", name);
return 0;
}
@@ -1209,24 +1208,24 @@ int GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNode
totin = 0;
totout = 0;
- if(in) {
- for(i = 0; in[i].type != GPU_NONE; i++) {
+ if (in) {
+ for (i = 0; in[i].type != GPU_NONE; i++) {
gpu_node_input_socket(node, &in[i]);
totin++;
}
}
- if(out) {
- for(i = 0; out[i].type != GPU_NONE; i++) {
+ if (out) {
+ for (i = 0; out[i].type != GPU_NONE; i++) {
GPU_node_output(node, out[i].type, out[i].name, &out[i].link);
totout++;
}
}
va_start(params, out);
- for(i=0; i<function->totparam; i++) {
- if(function->paramqual[i] != FUNCTION_QUAL_IN) {
- if(totout == 0) {
+ for (i=0; i<function->totparam; i++) {
+ if (function->paramqual[i] != FUNCTION_QUAL_IN) {
+ if (totout == 0) {
linkptr= va_arg(params, GPUNodeLink**);
GPU_node_output(node, function->paramtype[i], "", linkptr);
}
@@ -1234,9 +1233,9 @@ int GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNode
totout--;
}
else {
- if(totin == 0) {
+ if (totin == 0) {
link= va_arg(params, GPUNodeLink*);
- if(link->socket)
+ if (link->socket)
gpu_node_input_socket(node, link->socket);
else
gpu_node_input_link(node, link, function->paramtype[i]);
@@ -1260,11 +1259,11 @@ int GPU_link_changed(GPUNodeLink *link)
GPUInput *input;
const char *name;
- if(link->output) {
+ if (link->output) {
node = link->output->node;
name = node->name;
- if(strcmp(name, "set_value")==0 || strcmp(name, "set_rgb")==0) {
+ if (strcmp(name, "set_value")==0 || strcmp(name, "set_rgb")==0) {
input = node->inputs.first;
return (input->link != NULL);
}
@@ -1282,16 +1281,16 @@ static void gpu_nodes_tag(GPUNodeLink *link)
GPUNode *node;
GPUInput *input;
- if(!link->output)
+ if (!link->output)
return;
node = link->output->node;
- if(node->tag)
+ if (node->tag)
return;
node->tag= 1;
- for(input=node->inputs.first; input; input=input->next)
- if(input->link)
+ for (input=node->inputs.first; input; input=input->next)
+ if (input->link)
gpu_nodes_tag(input->link);
}
@@ -1299,15 +1298,15 @@ static void gpu_nodes_prune(ListBase *nodes, GPUNodeLink *outlink)
{
GPUNode *node, *next;
- for(node=nodes->first; node; node=node->next)
+ for (node=nodes->first; node; node=node->next)
node->tag= 0;
gpu_nodes_tag(outlink);
- for(node=nodes->first; node; node=next) {
+ for (node=nodes->first; node; node=next) {
next = node->next;
- if(!node->tag) {
+ if (!node->tag) {
BLI_remlink(nodes, node);
GPU_node_free(node);
}
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..01f000e3314 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -154,28 +154,28 @@ void GPU_render_text(MTFace *tface, int mode,
uv[2][1] = (tface->uv[2][1] - centery) * sizey + transy;
glBegin(GL_POLYGON);
- if(glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[0]);
+ if (glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[0]);
else glTexCoord2fv(uv[0]);
- if(col) gpu_mcol(col[0]);
+ if (col) gpu_mcol(col[0]);
glVertex3f(sizex * v1[0] + movex, sizey * v1[1] + movey, v1[2]);
- if(glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[1]);
+ if (glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[1]);
else glTexCoord2fv(uv[1]);
- if(col) gpu_mcol(col[1]);
+ if (col) gpu_mcol(col[1]);
glVertex3f(sizex * v2[0] + movex, sizey * v2[1] + movey, v2[2]);
- if(glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[2]);
+ if (glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[2]);
else glTexCoord2fv(uv[2]);
- if(col) gpu_mcol(col[2]);
+ if (col) gpu_mcol(col[2]);
glVertex3f(sizex * v3[0] + movex, sizey * v3[1] + movey, v3[2]);
- if(v4) {
+ if (v4) {
uv[3][0] = (tface->uv[3][0] - centerx) * sizex + transx;
uv[3][1] = (tface->uv[3][1] - centery) * sizey + transy;
- if(glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[3]);
+ if (glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[3]);
else glTexCoord2fv(uv[3]);
- if(col) gpu_mcol(col[3]);
+ if (col) gpu_mcol(col[3]);
glVertex3f(sizex * v4[0] + movex, sizey * v4[1] + movey, v4[2]);
}
glEnd();
@@ -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;
@@ -259,16 +263,16 @@ static GLenum gpu_get_mipmap_filter(int mag)
{
/* linearmipmap is off by default *when mipmapping is off,
* use unfiltered display */
- if(mag) {
- if(GTS.linearmipmap || GTS.domipmap)
+ if (mag) {
+ if (GTS.linearmipmap || GTS.domipmap)
return GL_LINEAR;
else
return GL_NEAREST;
}
else {
- if(GTS.linearmipmap)
+ if (GTS.linearmipmap)
return GL_LINEAR_MIPMAP_LINEAR;
- else if(GTS.domipmap)
+ else if (GTS.domipmap)
return GL_LINEAR_MIPMAP_NEAREST;
else
return GL_NEAREST;
@@ -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 */
@@ -302,10 +305,10 @@ static void gpu_make_repbind(Image *ima)
ImBuf *ibuf;
ibuf = BKE_image_get_ibuf(ima, NULL);
- if(ibuf==NULL)
+ if (ibuf==NULL)
return;
- if(ima->repbind) {
+ if (ima->repbind) {
glDeleteTextures(ima->totbind, (GLuint *)ima->repbind);
MEM_freeN(ima->repbind);
ima->repbind= NULL;
@@ -314,19 +317,19 @@ static void gpu_make_repbind(Image *ima)
ima->totbind= ima->xrep*ima->yrep;
- if(ima->totbind>1)
+ if (ima->totbind>1)
ima->repbind= MEM_callocN(sizeof(int)*ima->totbind, "repbind");
}
static void gpu_clear_tpage(void)
{
- if(GTS.lasttface==NULL)
+ if (GTS.lasttface==NULL)
return;
GTS.lasttface= NULL;
GTS.curtile= 0;
GTS.curima= NULL;
- if(GTS.curtilemode!=0) {
+ if (GTS.curtilemode!=0) {
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
@@ -345,17 +348,17 @@ static void gpu_clear_tpage(void)
static void gpu_set_alpha_blend(GPUBlendMode alphablend)
{
- if(alphablend == GPU_BLEND_SOLID) {
+ if (alphablend == GPU_BLEND_SOLID) {
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
- else if(alphablend==GPU_BLEND_ADD) {
+ else if (alphablend==GPU_BLEND_ADD) {
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
glDisable(GL_ALPHA_TEST);
}
- else if(ELEM(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ALPHA_SORT)) {
+ else if (ELEM(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ALPHA_SORT)) {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -363,7 +366,7 @@ static void gpu_set_alpha_blend(GPUBlendMode alphablend)
* turn off alpha test in this case */
/* added after 2.45 to clip alpha */
- if(U.glalphaclip == 1.0f) {
+ if (U.glalphaclip == 1.0f) {
glDisable(GL_ALPHA_TEST);
}
else {
@@ -371,7 +374,7 @@ static void gpu_set_alpha_blend(GPUBlendMode alphablend)
glAlphaFunc(GL_GREATER, U.glalphaclip);
}
}
- else if(alphablend==GPU_BLEND_CLIP) {
+ else if (alphablend==GPU_BLEND_CLIP) {
glDisable(GL_BLEND);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.5f);
@@ -381,7 +384,7 @@ static void gpu_set_alpha_blend(GPUBlendMode alphablend)
static void gpu_verify_alpha_blend(int alphablend)
{
/* verify alpha blending modes */
- if(GTS.alphablend == alphablend)
+ if (GTS.alphablend == alphablend)
return;
gpu_set_alpha_blend(alphablend);
@@ -424,83 +427,83 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
GTS.tileYRep = 0;
/* setting current tile according to frame */
- if(ima && (ima->tpageflag & IMA_TWINANIM))
+ if (ima && (ima->tpageflag & IMA_TWINANIM))
GTS.tile= ima->lastframe;
else
GTS.tile= tftile;
GTS.tile = MAX2(0, GTS.tile);
- if(ima) {
+ if (ima) {
GTS.tileXRep = ima->xrep;
GTS.tileYRep = ima->yrep;
}
/* if same image & tile, we're done */
- if(compare && ima == GTS.curima && GTS.curtile == GTS.tile &&
+ if (compare && ima == GTS.curima && GTS.curtile == GTS.tile &&
GTS.tilemode == GTS.curtilemode && GTS.curtileXRep == GTS.tileXRep &&
GTS.curtileYRep == GTS.tileYRep)
return (ima != NULL);
/* if tiling mode or repeat changed, change texture matrix to fit */
- if(GTS.tilemode!=GTS.curtilemode || GTS.curtileXRep!=GTS.tileXRep ||
+ if (GTS.tilemode!=GTS.curtilemode || GTS.curtileXRep!=GTS.tileXRep ||
GTS.curtileYRep != GTS.tileYRep) {
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
- if(ima && (ima->tpageflag & IMA_TILES))
+ if (ima && (ima->tpageflag & IMA_TILES))
glScalef(ima->xrep, ima->yrep, 1.0);
glMatrixMode(GL_MODELVIEW);
}
/* check if we have a valid image */
- if(ima==NULL || ima->ok==0)
+ if (ima==NULL || ima->ok==0)
return 0;
/* check if we have a valid image buffer */
ibuf= BKE_image_get_ibuf(ima, iuser);
- if(ibuf==NULL)
+ if (ibuf==NULL)
return 0;
- if(ibuf->rect_float) {
- if(U.use_16bit_textures) {
+ 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;
}
/* TODO unneeded when float images are correctly treated as linear always */
- if(ibuf->profile == IB_PROFILE_LINEAR_RGB)
+ if (ibuf->profile == IB_PROFILE_LINEAR_RGB)
do_color_management = TRUE;
- if(ibuf->rect==NULL)
+ if (ibuf->rect==NULL)
IMB_rect_from_float(ibuf);
}
/* currently, tpage refresh is used by ima sequences */
- if(ima->tpageflag & IMA_TPAGE_REFRESH) {
+ if (ima->tpageflag & IMA_TPAGE_REFRESH) {
GPU_free_image(ima);
ima->tpageflag &= ~IMA_TPAGE_REFRESH;
}
- if(GTS.tilemode) {
+ if (GTS.tilemode) {
/* tiled mode */
- if(ima->repbind==NULL) gpu_make_repbind(ima);
- if(GTS.tile>=ima->totbind) GTS.tile= 0;
+ if (ima->repbind==NULL) gpu_make_repbind(ima);
+ if (GTS.tile>=ima->totbind) GTS.tile= 0;
/* this happens when you change repeat buttons */
- if(ima->repbind) bind= &ima->repbind[GTS.tile];
+ if (ima->repbind) bind= &ima->repbind[GTS.tile];
else bind= &ima->bindcode;
- if(*bind==0) {
+ if (*bind==0) {
texwindx= ibuf->x/ima->xrep;
texwindy= ibuf->y/ima->yrep;
- if(GTS.tile>=ima->xrep*ima->yrep)
+ if (GTS.tile>=ima->xrep*ima->yrep)
GTS.tile= ima->xrep*ima->yrep-1;
texwinsy= GTS.tile / ima->xrep;
@@ -512,8 +515,8 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
tpx= texwindx;
tpy= texwindy;
- if(use_high_bit_depth) {
- if(do_color_management) {
+ if (use_high_bit_depth) {
+ if (do_color_management) {
srgb_frect = MEM_mallocN(ibuf->x*ibuf->y*sizeof(float)*4, "floar_buf_col_cor");
IMB_buffer_float_from_float(srgb_frect, ibuf->rect_float,
ibuf->channels, IB_PROFILE_SRGB, ibuf->profile, 0,
@@ -533,12 +536,12 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
/* regular image mode */
bind= &ima->bindcode;
- if(*bind==0) {
+ if (*bind==0) {
tpx= ibuf->x;
tpy= ibuf->y;
rect= ibuf->rect;
- if(use_high_bit_depth) {
- if(do_color_management) {
+ if (use_high_bit_depth) {
+ if (do_color_management) {
frect = srgb_frect = MEM_mallocN(ibuf->x*ibuf->y*sizeof(*srgb_frect)*4, "floar_buf_col_cor");
IMB_buffer_float_from_float(srgb_frect, ibuf->rect_float,
ibuf->channels, IB_PROFILE_SRGB, ibuf->profile, 0,
@@ -552,7 +555,7 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
}
}
- if(*bind != 0) {
+ if (*bind != 0) {
/* enable opengl drawing with textures */
glBindTexture(GL_TEXTURE_2D, *bind);
return *bind;
@@ -563,7 +566,7 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
/* for tiles, copy only part of image into buffer */
if (GTS.tilemode) {
- if(use_high_bit_depth) {
+ if (use_high_bit_depth) {
float *frectrow, *ftilerectrow;
ftilerect= MEM_mallocN(rectw*recth*sizeof(*ftilerect), "tilerect");
@@ -594,12 +597,12 @@ 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);
- if(use_high_bit_depth) {
+ if (use_high_bit_depth) {
fscalerect= MEM_mallocN(rectw*recth*sizeof(*fscalerect)*4, "fscalerect");
gluScaleImage(GL_RGBA, tpx, tpy, GL_FLOAT, frect, rectw, recth, GL_FLOAT, fscalerect);
@@ -618,7 +621,7 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
glBindTexture( GL_TEXTURE_2D, *bind);
if (!(gpu_get_mipmap() && mipmap)) {
- if(use_high_bit_depth)
+ if (use_high_bit_depth)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16, rectw, recth, 0, GL_RGBA, GL_FLOAT, frect);
else
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, rectw, recth, 0, GL_RGBA, GL_UNSIGNED_BYTE, rect);
@@ -626,7 +629,7 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1));
}
else {
- if(use_high_bit_depth)
+ if (use_high_bit_depth)
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA16, rectw, recth, GL_RGBA, GL_FLOAT, frect);
else
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, rectw, recth, GL_RGBA, GL_UNSIGNED_BYTE, rect);
@@ -674,7 +677,7 @@ int GPU_set_tpage(MTFace *tface, int mipmap, int alphablend)
Image *ima;
/* check if we need to clear the state */
- if(tface==NULL) {
+ if (tface==NULL) {
gpu_clear_tpage();
return 0;
}
@@ -685,7 +688,7 @@ int GPU_set_tpage(MTFace *tface, int mipmap, int alphablend)
gpu_verify_alpha_blend(alphablend);
gpu_verify_reflection(ima);
- if(GPU_verify_image(ima, NULL, tface->tile, 1, mipmap)) {
+ if (GPU_verify_image(ima, NULL, tface->tile, 1, mipmap)) {
GTS.curtile= GTS.tile;
GTS.curima= GTS.ima;
GTS.curtilemode= GTS.tilemode;
@@ -715,20 +718,20 @@ 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;
- if(!GTS.domipmap)
+ if (!GTS.domipmap)
return;
- if(mipmap) {
- for(ima=G.main->image.first; ima; ima=ima->id.next) {
- if(ima->bindcode) {
- if(ima->tpageflag & IMA_MIPMAP_COMPLETE) {
+ if (mipmap) {
+ for (ima=G.main->image.first; ima; ima=ima->id.next) {
+ if (ima->bindcode) {
+ if (ima->tpageflag & IMA_MIPMAP_COMPLETE) {
glBindTexture(GL_TEXTURE_2D, ima->bindcode);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gpu_get_mipmap_filter(0));
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1));
@@ -742,8 +745,8 @@ void GPU_paint_set_mipmap(int mipmap)
}
else {
- for(ima=G.main->image.first; ima; ima=ima->id.next) {
- if(ima->bindcode) {
+ for (ima=G.main->image.first; ima; ima=ima->id.next) {
+ if (ima->bindcode) {
glBindTexture(GL_TEXTURE_2D, ima->bindcode);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1));
@@ -776,7 +779,7 @@ void GPU_paint_update_image(Image *ima, int x, int y, int w, int h, int mipmap)
glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skip_rows);
/* if color correction is needed, we must update the part that needs updating. */
- if(ibuf->rect_float && (!U.use_16bit_textures || (ibuf->profile == IB_PROFILE_LINEAR_RGB))) {
+ if (ibuf->rect_float && (!U.use_16bit_textures || (ibuf->profile == IB_PROFILE_LINEAR_RGB))) {
float *buffer = MEM_mallocN(w*h*sizeof(float)*4, "temp_texpaint_float_buf");
IMB_partial_rect_from_float(ibuf, buffer, x, y, w, h);
@@ -786,7 +789,7 @@ void GPU_paint_update_image(Image *ima, int x, int y, int w, int h, int mipmap)
MEM_freeN(buffer);
- if(ima->tpageflag & IMA_MIPMAP_COMPLETE)
+ if (ima->tpageflag & IMA_MIPMAP_COMPLETE)
ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
return;
@@ -798,7 +801,7 @@ void GPU_paint_update_image(Image *ima, int x, int y, int w, int h, int mipmap)
glPixelStorei(GL_UNPACK_SKIP_PIXELS, x);
glPixelStorei(GL_UNPACK_SKIP_ROWS, y);
- if(ibuf->rect_float)
+ if (ibuf->rect_float)
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGBA,
GL_FLOAT, ibuf->rect_float);
else
@@ -809,7 +812,7 @@ void GPU_paint_update_image(Image *ima, int x, int y, int w, int h, int mipmap)
glPixelStorei(GL_UNPACK_SKIP_PIXELS, skip_pixels);
glPixelStorei(GL_UNPACK_SKIP_ROWS, skip_rows);
- if(ima->tpageflag & IMA_MIPMAP_COMPLETE)
+ if (ima->tpageflag & IMA_MIPMAP_COMPLETE)
ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
}
}
@@ -818,15 +821,15 @@ void GPU_update_images_framechange(void)
{
Image *ima;
- for(ima=G.main->image.first; ima; ima=ima->id.next) {
- if(ima->tpageflag & IMA_TWINANIM) {
- if(ima->twend >= ima->xrep*ima->yrep)
+ for (ima=G.main->image.first; ima; ima=ima->id.next) {
+ if (ima->tpageflag & IMA_TWINANIM) {
+ if (ima->twend >= ima->xrep*ima->yrep)
ima->twend= ima->xrep*ima->yrep-1;
/* check: is bindcode not in the array? free. (to do) */
ima->lastframe++;
- if(ima->lastframe > ima->twend)
+ if (ima->lastframe > ima->twend)
ima->lastframe= ima->twsta;
}
}
@@ -847,8 +850,8 @@ int GPU_update_image_time(Image *ima, double time)
if (ima->lastupdate > (float)time)
ima->lastupdate=(float)time;
- if(ima->tpageflag & IMA_TWINANIM) {
- if(ima->twend >= ima->xrep*ima->yrep) ima->twend= ima->xrep*ima->yrep-1;
+ if (ima->tpageflag & IMA_TWINANIM) {
+ if (ima->twend >= ima->xrep*ima->yrep) ima->twend= ima->xrep*ima->yrep-1;
/* check: is the bindcode not in the array? Then free. (still to do) */
@@ -859,8 +862,8 @@ int GPU_update_image_time(Image *ima, double time)
newframe = ima->lastframe+inc;
- if(newframe > (int)ima->twend) {
- if(ima->twend-ima->twsta != 0)
+ if (newframe > (int)ima->twend) {
+ if (ima->twend-ima->twsta != 0)
newframe = (int)ima->twsta-1 + (newframe-ima->twend)%(ima->twend-ima->twsta);
else
newframe = ima->twsta;
@@ -875,13 +878,12 @@ 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->domain->tex)
+ if (smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain) {
+ if (smd->domain->tex)
GPU_texture_free(smd->domain->tex);
smd->domain->tex = NULL;
- if(smd->domain->tex_shadow)
+ if (smd->domain->tex_shadow)
GPU_texture_free(smd->domain->tex_shadow);
smd->domain->tex_shadow = NULL;
}
@@ -890,9 +892,9 @@ void GPU_free_smoke(SmokeModifierData *smd)
void GPU_create_smoke(SmokeModifierData *smd, int highres)
{
#ifdef WITH_SMOKE
- if(smd->type & MOD_SMOKE_TYPE_DOMAIN && !smd->domain->tex && !highres)
+ if (smd->type & MOD_SMOKE_TYPE_DOMAIN && !smd->domain->tex && !highres)
smd->domain->tex = GPU_texture_create_3D(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2], smoke_get_density(smd->domain->fluid));
- else if(smd->type & MOD_SMOKE_TYPE_DOMAIN && !smd->domain->tex && highres)
+ else if (smd->type & MOD_SMOKE_TYPE_DOMAIN && !smd->domain->tex && highres)
smd->domain->tex = GPU_texture_create_3D(smd->domain->res_wt[0], smd->domain->res_wt[1], smd->domain->res_wt[2], smoke_turbulence_get_density(smd->domain->wt));
smd->domain->tex_shadow = GPU_texture_create_3D(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2], smd->domain->shadow);
@@ -918,13 +920,13 @@ void GPU_free_unused_buffers(void)
{
Image *ima;
- if(!BLI_thread_is_main())
+ if (!BLI_thread_is_main())
return;
BLI_lock_thread(LOCK_OPENGL);
/* images */
- for(ima=image_free_queue.first; ima; ima=ima->id.next)
+ for (ima=image_free_queue.first; ima; ima=ima->id.next)
GPU_free_image(ima);
BLI_freelistN(&image_free_queue);
@@ -938,25 +940,25 @@ void GPU_free_unused_buffers(void)
void GPU_free_image(Image *ima)
{
- if(!BLI_thread_is_main()) {
+ if (!BLI_thread_is_main()) {
gpu_queue_image_for_free(ima);
return;
}
/* free regular image binding */
- if(ima->bindcode) {
+ if (ima->bindcode) {
glDeleteTextures(1, (GLuint *)&ima->bindcode);
ima->bindcode= 0;
}
/* free glsl image binding */
- if(ima->gputexture) {
+ if (ima->gputexture) {
GPU_texture_free(ima->gputexture);
ima->gputexture= NULL;
}
/* free repeated image binding */
- if(ima->repbind) {
+ if (ima->repbind) {
glDeleteTextures(ima->totbind, (GLuint *)ima->repbind);
MEM_freeN(ima->repbind);
@@ -970,8 +972,8 @@ void GPU_free_images(void)
{
Image* ima;
- if(G.main)
- for(ima=G.main->image.first; ima; ima=ima->id.next)
+ if (G.main)
+ for (ima=G.main->image.first; ima; ima=ima->id.next)
GPU_free_image(ima);
}
@@ -980,9 +982,9 @@ void GPU_free_images_anim(void)
{
Image* ima;
- if(G.main)
- for(ima=G.main->image.first; ima; ima=ima->id.next)
- if(ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE))
+ if (G.main)
+ for (ima=G.main->image.first; ima; ima=ima->id.next)
+ if (ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE))
GPU_free_image(ima);
}
@@ -1023,11 +1025,11 @@ static struct GPUMaterialState {
/* fixed function material, alpha handed by caller */
static void gpu_material_to_fixed(GPUMaterialFixed *smat, const Material *bmat, const int gamma, const Object *ob, const int new_shading_nodes)
{
- if(new_shading_nodes || bmat->mode & MA_SHLESS) {
+ if (new_shading_nodes || bmat->mode & MA_SHLESS) {
copy_v3_v3(smat->diff, &bmat->r);
smat->diff[3]= 1.0;
- if(gamma)
+ if (gamma)
linearrgb_to_srgb_v3_v3(smat->diff, smat->diff);
zero_v4(smat->spec);
@@ -1037,14 +1039,14 @@ static void gpu_material_to_fixed(GPUMaterialFixed *smat, const Material *bmat,
mul_v3_v3fl(smat->diff, &bmat->r, bmat->ref + bmat->emit);
smat->diff[3]= 1.0; /* caller may set this to bmat->alpha */
- if(bmat->shade_flag & MA_OBCOLOR)
+ if (bmat->shade_flag & MA_OBCOLOR)
mul_v3_v3(smat->diff, ob->col);
mul_v3_v3fl(smat->spec, &bmat->specr, bmat->spec);
smat->spec[3]= 1.0; /* always 1 */
smat->hard= CLAMPIS(bmat->har, 0, 128);
- if(gamma) {
+ if (gamma) {
linearrgb_to_srgb_v3_v3(smat->diff, smat->diff);
linearrgb_to_srgb_v3_v3(smat->spec, smat->spec);
}
@@ -1053,10 +1055,10 @@ static void gpu_material_to_fixed(GPUMaterialFixed *smat, const Material *bmat,
static Material *gpu_active_node_material(Material *ma)
{
- if(ma && ma->use_nodes && ma->nodetree) {
+ if (ma && ma->use_nodes && ma->nodetree) {
bNode *node= nodeGetActiveID(ma->nodetree, ID_MA);
- if(node)
+ if (node)
return (Material *)node->id;
else
return NULL;
@@ -1088,16 +1090,16 @@ 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)
+ if (GMS.use_alpha_pass)
*do_alpha_after = 0;
- if(GMS.totmat > FIXEDMAT) {
+ if (GMS.totmat > FIXEDMAT) {
GMS.matbuf= MEM_callocN(sizeof(GPUMaterialFixed)*GMS.totmat, "GMS.matbuf");
GMS.gmatbuf= MEM_callocN(sizeof(*GMS.gmatbuf)*GMS.totmat, "GMS.matbuf");
GMS.alphablend= MEM_callocN(sizeof(*GMS.alphablend)*GMS.totmat, "GMS.matbuf");
@@ -1109,13 +1111,13 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
}
/* no materials assigned? */
- if(ob->totcol==0) {
+ if (ob->totcol==0) {
gpu_material_to_fixed(&GMS.matbuf[0], &defmaterial, 0, ob, new_shading_nodes);
/* do material 1 too, for displists! */
memcpy(&GMS.matbuf[1], &GMS.matbuf[0], sizeof(GPUMaterialFixed));
- if(glsl) {
+ if (glsl) {
GMS.gmatbuf[0]= &defmaterial;
GPU_material_from_blender(GMS.gscene, &defmaterial);
}
@@ -1124,16 +1126,16 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
}
/* setup materials */
- for(a=1; a<=ob->totcol; a++) {
+ for (a=1; a<=ob->totcol; a++) {
/* find a suitable material */
ma= give_current_material(ob, a);
- if(!glsl && !new_shading_nodes) ma= gpu_active_node_material(ma);
- if(ma==NULL) ma= &defmaterial;
+ if (!glsl && !new_shading_nodes) ma= gpu_active_node_material(ma);
+ if (ma==NULL) ma= &defmaterial;
/* create glsl material if requested */
gpumat = (glsl)? GPU_material_from_blender(GMS.gscene, ma): NULL;
- if(gpumat) {
+ if (gpumat) {
/* do glsl only if creating it succeed, else fallback */
GMS.gmatbuf[a]= ma;
alphablend = GPU_material_alpha_blend(gpumat, ob->col);
@@ -1142,7 +1144,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
/* fixed function opengl materials */
gpu_material_to_fixed(&GMS.matbuf[a], ma, gamma, ob, new_shading_nodes);
- if(GMS.use_alpha_pass) {
+ if (GMS.use_alpha_pass) {
GMS.matbuf[a].diff[3]= ma->alpha;
alphablend = (ma->alpha == 1.0f)? GPU_BLEND_SOLID: GPU_BLEND_ALPHA;
}
@@ -1154,8 +1156,8 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
/* setting do_alpha_after = 1 indicates this object needs to be
* drawn in a second alpha pass for improved blending */
- if(do_alpha_after && !GMS.is_alpha_pass)
- if(ELEM3(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ADD, GPU_BLEND_ALPHA_SORT))
+ if (do_alpha_after && !GMS.is_alpha_pass)
+ if (ELEM3(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ADD, GPU_BLEND_ALPHA_SORT))
*do_alpha_after= 1;
GMS.alphablend[a]= alphablend;
@@ -1172,7 +1174,7 @@ int GPU_enable_material(int nr, void *attribs)
GPUBlendMode alphablend;
/* no GPU_begin_object_materials, use default material */
- if(!GMS.matbuf) {
+ if (!GMS.matbuf) {
float diff[4], spec[4];
memset(&GMS, 0, sizeof(GMS));
@@ -1191,19 +1193,19 @@ int GPU_enable_material(int nr, void *attribs)
}
/* prevent index to use un-initialized array items */
- if(nr>=GMS.totmat)
+ if (nr>=GMS.totmat)
nr= 0;
- if(gattribs)
+ if (gattribs)
memset(gattribs, 0, sizeof(*gattribs));
/* keep current material */
- if(nr==GMS.lastmatnr)
+ if (nr==GMS.lastmatnr)
return GMS.lastretval;
/* unbind glsl material */
- if(GMS.gboundmat) {
- if(GMS.is_alpha_pass) glDepthMask(0);
+ if (GMS.gboundmat) {
+ if (GMS.is_alpha_pass) glDepthMask(0);
GPU_material_unbind(GPU_material_from_blender(GMS.gscene, GMS.gboundmat));
GMS.gboundmat= NULL;
}
@@ -1212,19 +1214,19 @@ int GPU_enable_material(int nr, void *attribs)
GMS.lastmatnr = nr;
GMS.lastretval = 1;
- if(GMS.use_alpha_pass) {
+ if (GMS.use_alpha_pass) {
GMS.lastretval = ELEM(GMS.alphablend[nr], GPU_BLEND_SOLID, GPU_BLEND_CLIP);
- if(GMS.is_alpha_pass)
+ if (GMS.is_alpha_pass)
GMS.lastretval = !GMS.lastretval;
}
else
GMS.lastretval = !GMS.is_alpha_pass;
- if(GMS.lastretval) {
+ if (GMS.lastretval) {
/* for alpha pass, use alpha blend */
alphablend = GMS.alphablend[nr];
- if(gattribs && GMS.gmatbuf[nr]) {
+ if (gattribs && GMS.gmatbuf[nr]) {
/* bind glsl material and get attributes */
Material *mat = GMS.gmatbuf[nr];
float auto_bump_scale;
@@ -1238,11 +1240,11 @@ 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 */
- if(mat->game.alpha_blend != GPU_BLEND_SOLID)
+ * we are already drawing in an alpha pass */
+ if (mat->game.alpha_blend != GPU_BLEND_SOLID)
alphablend= mat->game.alpha_blend;
- if(GMS.is_alpha_pass) glDepthMask(1);
+ if (GMS.is_alpha_pass) glDepthMask(1);
}
else {
/* or do fixed function opengl material */
@@ -1260,7 +1262,7 @@ int GPU_enable_material(int nr, void *attribs)
void GPU_set_material_alpha_blend(int alphablend)
{
- if(GMS.lastalphablend == alphablend)
+ if (GMS.lastalphablend == alphablend)
return;
gpu_set_alpha_blend(alphablend);
@@ -1277,8 +1279,8 @@ void GPU_disable_material(void)
GMS.lastmatnr= -1;
GMS.lastretval= 1;
- if(GMS.gboundmat) {
- if(GMS.is_alpha_pass) glDepthMask(0);
+ if (GMS.gboundmat) {
+ if (GMS.is_alpha_pass) glDepthMask(0);
GPU_material_unbind(GPU_material_from_blender(GMS.gscene, GMS.gboundmat));
GMS.gboundmat= NULL;
}
@@ -1290,7 +1292,7 @@ void GPU_end_object_materials(void)
{
GPU_disable_material();
- if(GMS.matbuf && GMS.matbuf != GMS.matbuf_fixed) {
+ if (GMS.matbuf && GMS.matbuf != GMS.matbuf_fixed) {
MEM_freeN(GMS.matbuf);
MEM_freeN(GMS.gmatbuf);
MEM_freeN(GMS.alphablend);
@@ -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);
@@ -1317,7 +1318,7 @@ int GPU_default_lights(void)
int a, count = 0;
/* initialize */
- if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) {
+ if (U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) {
U.light[0].flag= 1;
U.light[0].vec[0]= -0.3; U.light[0].vec[1]= 0.3; U.light[0].vec[2]= 0.9;
U.light[0].col[0]= 0.8; U.light[0].col[1]= 0.8; U.light[0].col[2]= 0.8;
@@ -1339,9 +1340,9 @@ int GPU_default_lights(void)
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_FALSE);
- for(a=0; a<8; a++) {
- if(a<3) {
- if(U.light[a].flag) {
+ for (a=0; a<8; a++) {
+ if (a<3) {
+ if (U.light[a].flag) {
glEnable(GL_LIGHT0+a);
normalize_v3_v3(position, U.light[a].vec);
@@ -1385,7 +1386,7 @@ int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[][4
float position[4], direction[4], energy[4];
/* disable all lights */
- for(count=0; count<8; count++)
+ for (count=0; count<8; count++)
glDisable(GL_LIGHT0+count);
/* view direction for specular is not compute correct by default in
@@ -1394,11 +1395,11 @@ int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[][4
count= 0;
- for(base=scene->base.first; base; base=base->next) {
- if(base->object->type!=OB_LAMP)
+ for (base=scene->base.first; base; base=base->next) {
+ if (base->object->type!=OB_LAMP)
continue;
- if(!(base->lay & lay) || !(base->lay & ob->lay))
+ if (!(base->lay & lay) || !(base->lay & ob->lay))
continue;
la= base->object->data;
@@ -1409,7 +1410,7 @@ int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[][4
where_is_object_simul(scene, base->object);
- if(la->type==LA_SUN) {
+ if (la->type==LA_SUN) {
/* sun lamp */
copy_v3_v3(direction, base->object->obmat[2]);
direction[3]= 0.0;
@@ -1426,7 +1427,7 @@ int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[][4
glLightf(GL_LIGHT0+count, GL_LINEAR_ATTENUATION, la->att1/la->dist);
glLightf(GL_LIGHT0+count, GL_QUADRATIC_ATTENUATION, la->att2/(la->dist*la->dist));
- if(la->type==LA_SPOT) {
+ if (la->type==LA_SPOT) {
/* spot lamp */
negate_v3_v3(direction, base->object->obmat[2]);
glLightfv(GL_LIGHT0+count, GL_SPOT_DIRECTION, direction);
@@ -1448,7 +1449,7 @@ int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[][4
glPopMatrix();
count++;
- if(count==8)
+ if (count==8)
break;
}
@@ -1510,9 +1511,9 @@ void GPU_state_init(void)
glDepthRange(0.0, 1.0);
a= 0;
- for(x=0; x<32; x++) {
- for(y=0; y<4; y++) {
- if( (x) & 1) pat[a++]= 0x88;
+ for (x=0; x<32; x++) {
+ for (y=0; y<4; y++) {
+ if ( (x) & 1) pat[a++]= 0x88;
else pat[a++]= 0x22;
}
}
@@ -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 */
@@ -1542,7 +1543,7 @@ static void gpu_get_print(const char *name, GLenum type)
glGetFloatv(type, value);
printf("%s: ", name);
- for(a=0; a<16; a++)
+ for (a=0; a<16; a++)
printf("%.2f ", value[a]);
printf("\n");
}
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index dfbb243aa7a..40e6a8b2a35 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;
@@ -99,7 +99,7 @@ void GPU_extensions_init(void)
const char *vendor, *renderer;
/* can't avoid calling this multiple times, see wm_window_add_ghostwindow */
- if(gpu_extensions_init) return;
+ if (gpu_extensions_init) return;
gpu_extensions_init= 1;
glewInit();
@@ -123,38 +123,38 @@ void GPU_extensions_init(void)
vendor = (const char*)glGetString(GL_VENDOR);
renderer = (const char*)glGetString(GL_RENDERER);
- if(strstr(vendor, "ATI")) {
+ if (strstr(vendor, "ATI")) {
GG.device = GPU_DEVICE_ATI;
GG.driver = GPU_DRIVER_OFFICIAL;
}
- else if(strstr(vendor, "NVIDIA")) {
+ else if (strstr(vendor, "NVIDIA")) {
GG.device = GPU_DEVICE_NVIDIA;
GG.driver = GPU_DRIVER_OFFICIAL;
}
- else if(strstr(vendor, "Intel") ||
+ else if (strstr(vendor, "Intel") ||
/* src/mesa/drivers/dri/intel/intel_context.c */
strstr(renderer, "Mesa DRI Intel") ||
strstr(renderer, "Mesa DRI Mobile Intel")) {
GG.device = GPU_DEVICE_INTEL;
GG.driver = GPU_DRIVER_OFFICIAL;
}
- else if(strstr(renderer, "Mesa DRI R") || (strstr(renderer, "Gallium ") && strstr(renderer, " on ATI "))) {
+ else if (strstr(renderer, "Mesa DRI R") || (strstr(renderer, "Gallium ") && strstr(renderer, " on ATI "))) {
GG.device = GPU_DEVICE_ATI;
GG.driver = GPU_DRIVER_OPENSOURCE;
}
- else if(strstr(renderer, "Nouveau") || strstr(vendor, "nouveau")) {
+ else if (strstr(renderer, "Nouveau") || strstr(vendor, "nouveau")) {
GG.device = GPU_DEVICE_NVIDIA;
GG.driver = GPU_DRIVER_OPENSOURCE;
}
- else if(strstr(vendor, "Mesa")) {
+ else if (strstr(vendor, "Mesa")) {
GG.device = GPU_DEVICE_SOFTWARE;
GG.driver = GPU_DRIVER_SOFTWARE;
}
- else if(strstr(vendor, "Microsoft")) {
+ else if (strstr(vendor, "Microsoft")) {
GG.device = GPU_DEVICE_SOFTWARE;
GG.driver = GPU_DRIVER_SOFTWARE;
}
- else if(strstr(renderer, "Apple Software Renderer")) {
+ else if (strstr(renderer, "Apple Software Renderer")) {
GG.device = GPU_DEVICE_SOFTWARE;
GG.driver = GPU_DRIVER_SOFTWARE;
}
@@ -163,12 +163,12 @@ void GPU_extensions_init(void)
GG.driver = GPU_DRIVER_ANY;
}
- if(GG.device == GPU_DEVICE_ATI) {
+ if (GG.device == GPU_DEVICE_ATI) {
/* ATI 9500 to X2300 cards support NPoT textures poorly
* Incomplete list http://dri.freedesktop.org/wiki/ATIRadeon
* New IDs from MESA's src/gallium/drivers/r300/r300_screen.c
*/
- if(strstr(renderer, "R3") || strstr(renderer, "RV3") ||
+ if (strstr(renderer, "R3") || strstr(renderer, "RV3") ||
strstr(renderer, "R4") || strstr(renderer, "RV4") ||
strstr(renderer, "RS4") || strstr(renderer, "RC4") ||
strstr(renderer, "R5") || strstr(renderer, "RV5") ||
@@ -179,16 +179,16 @@ void GPU_extensions_init(void)
GG.npotdisabled = 1;
}
- /* make sure double side isn't used by defautl and only getting enabled in places where it's
+ /* make sure double side isn't used by default and only getting enabled in places where it's
* really needed to prevent different unexpected behaviors like with intel gme965 card (sergey) */
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
- 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
}
@@ -205,7 +205,7 @@ int GPU_glsl_support(void)
int GPU_non_power_of_two_support(void)
{
- if(GG.npotdisabled)
+ if (GG.npotdisabled)
return 0;
return GLEW_ARB_texture_non_power_of_two;
@@ -220,7 +220,7 @@ int GPU_print_error(const char *str)
{
GLenum errCode;
- if (G.f & G_DEBUG) {
+ if (G.debug & G_DEBUG) {
if ((errCode = glGetError()) != GL_NO_ERROR) {
fprintf(stderr, "%s opengl error: %s\n", str, gluErrorString(errCode));
return 1;
@@ -260,7 +260,7 @@ static void GPU_print_framebuffer_error(GLenum status, char err_out[256])
break;
}
- if(err_out) {
+ if (err_out) {
BLI_snprintf(err_out, 256, "GPUFrameBuffer: framebuffer incomplete error %d '%s'",
(int)status, err);
}
@@ -318,7 +318,7 @@ static GPUTexture *GPU_texture_create_nD(int w, int h, int n, float *fpixels, in
GLenum type, format, internalformat;
void *pixels = NULL;
- if(depth && !GLEW_ARB_depth_texture)
+ if (depth && !GLEW_ARB_depth_texture)
return NULL;
tex = MEM_callocN(sizeof(GPUTexture), "GPUTexture");
@@ -332,7 +332,7 @@ static GPUTexture *GPU_texture_create_nD(int w, int h, int n, float *fpixels, in
glGenTextures(1, &tex->bindcode);
if (!tex->bindcode) {
- if(err_out) {
+ if (err_out) {
BLI_snprintf(err_out, 256, "GPUTexture: texture create failed: %d",
(int)glGetError());
}
@@ -352,7 +352,7 @@ static GPUTexture *GPU_texture_create_nD(int w, int h, int n, float *fpixels, in
tex->number = 0;
glBindTexture(tex->target, tex->bindcode);
- if(depth) {
+ if (depth) {
type = GL_UNSIGNED_BYTE;
format = GL_DEPTH_COMPONENT;
internalformat = GL_DEPTH_COMPONENT;
@@ -396,7 +396,7 @@ static GPUTexture *GPU_texture_create_nD(int w, int h, int n, float *fpixels, in
if (pixels)
MEM_freeN(pixels);
- if(depth) {
+ if (depth) {
glTexParameteri(tex->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(tex->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(tex->target, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE);
@@ -433,7 +433,7 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels)
void *pixels = NULL;
float vfBorderColor[4] = {0.0f, 0.0f, 0.0f, 0.0f};
- if(!GLEW_VERSION_1_2)
+ if (!GLEW_VERSION_1_2)
return NULL;
tex = MEM_callocN(sizeof(GPUTexture), "GPUTexture");
@@ -476,7 +476,7 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels)
GPU_print_error("3D glTexImage3D");
if (fpixels) {
- if(!GPU_non_power_of_two_support() && (w != tex->w || h != tex->h || depth != tex->depth)) {
+ if (!GPU_non_power_of_two_support() && (w != tex->w || h != tex->h || depth != tex->depth)) {
/* clear first to avoid unitialized pixels */
float *zero= MEM_callocN(sizeof(float)*tex->w*tex->h*tex->depth, "zero");
glTexSubImage3D(tex->target, 0, 0, 0, 0, tex->w, tex->h, tex->depth, format, type, zero);
@@ -516,13 +516,13 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, double time,
GPU_update_image_time(ima, time);
bindcode = GPU_verify_image(ima, iuser, 0, 0, mipmap);
- if(ima->gputexture) {
+ if (ima->gputexture) {
ima->gputexture->bindcode = bindcode;
glBindTexture(GL_TEXTURE_2D, lastbindcode);
return ima->gputexture;
}
- if(!bindcode) {
+ if (!bindcode) {
glBindTexture(GL_TEXTURE_2D, lastbindcode);
return NULL;
}
@@ -593,7 +593,7 @@ void GPU_texture_bind(GPUTexture *tex, int number)
return;
}
- if(number == -1)
+ if (number == -1)
return;
GPU_print_error("Pre Texture Bind");
@@ -618,7 +618,7 @@ void GPU_texture_unbind(GPUTexture *tex)
return;
}
- if(tex->number == -1)
+ if (tex->number == -1)
return;
GPU_print_error("Pre Texture Unbind");
@@ -714,7 +714,7 @@ int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, char err
GLenum status;
GLenum attachment;
- if(tex->depth)
+ if (tex->depth)
attachment = GL_DEPTH_ATTACHMENT_EXT;
else
attachment = GL_COLOR_ATTACHMENT0_EXT;
@@ -725,7 +725,7 @@ int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, char err
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, attachment,
tex->target, tex->bindcode, 0);
- if(tex->depth) {
+ if (tex->depth) {
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);
}
@@ -742,7 +742,7 @@ int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, char err
return 0;
}
- if(tex->depth)
+ if (tex->depth)
fb->depthtex = tex;
else
fb->colortex = tex;
@@ -756,15 +756,15 @@ void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, GPUTexture *tex)
{
GLenum attachment;
- if(!tex->fb)
+ if (!tex->fb)
return;
- if(GG.currentfb != tex->fb->object) {
+ if (GG.currentfb != tex->fb->object) {
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, tex->fb->object);
GG.currentfb = tex->fb->object;
}
- if(tex->depth) {
+ if (tex->depth) {
fb->depthtex = NULL;
attachment = GL_DEPTH_ATTACHMENT_EXT;
}
@@ -817,12 +817,12 @@ void GPU_framebuffer_texture_unbind(GPUFrameBuffer *UNUSED(fb), GPUTexture *UNUS
void GPU_framebuffer_free(GPUFrameBuffer *fb)
{
- if(fb->depthtex)
+ if (fb->depthtex)
GPU_framebuffer_texture_detach(fb, fb->depthtex);
- if(fb->colortex)
+ if (fb->colortex)
GPU_framebuffer_texture_detach(fb, fb->colortex);
- if(fb->object) {
+ if (fb->object) {
glDeleteFramebuffersEXT(1, &fb->object);
if (GG.currentfb == fb->object) {
@@ -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;
};
@@ -863,29 +863,29 @@ GPUOffScreen *GPU_offscreen_create(int width, int height, char err_out[256])
ofs->h= height;
ofs->fb = GPU_framebuffer_create();
- if(!ofs->fb) {
+ if (!ofs->fb) {
GPU_offscreen_free(ofs);
return NULL;
}
ofs->depth = GPU_texture_create_depth(width, height, err_out);
- if(!ofs->depth) {
+ if (!ofs->depth) {
GPU_offscreen_free(ofs);
return NULL;
}
- if(!GPU_framebuffer_texture_attach(ofs->fb, ofs->depth, err_out)) {
+ if (!GPU_framebuffer_texture_attach(ofs->fb, ofs->depth, err_out)) {
GPU_offscreen_free(ofs);
return NULL;
}
ofs->color = GPU_texture_create_2D(width, height, NULL, err_out);
- if(!ofs->color) {
+ if (!ofs->color) {
GPU_offscreen_free(ofs);
return NULL;
}
- if(!GPU_framebuffer_texture_attach(ofs->fb, ofs->color, err_out)) {
+ if (!GPU_framebuffer_texture_attach(ofs->fb, ofs->color, err_out)) {
GPU_offscreen_free(ofs);
return NULL;
}
@@ -897,11 +897,11 @@ GPUOffScreen *GPU_offscreen_create(int width, int height, char err_out[256])
void GPU_offscreen_free(GPUOffScreen *ofs)
{
- if(ofs->fb)
+ if (ofs->fb)
GPU_framebuffer_free(ofs->fb);
- if(ofs->color)
+ if (ofs->color)
GPU_texture_free(ofs->color);
- if(ofs->depth)
+ if (ofs->depth)
GPU_texture_free(ofs->depth);
MEM_freeN(ofs);
@@ -942,7 +942,7 @@ static void shader_print_errors(const char *task, char *log, const char *code)
fprintf(stderr, "GPUShader: %s error:\n", task);
- if(G.f & G_DEBUG) {
+ if (G.debug & G_DEBUG) {
c = code;
while ((c < end) && (pos = strchr(c, '\n'))) {
fprintf(stderr, "%2d ", line);
@@ -971,9 +971,9 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, /*GPU
shader = MEM_callocN(sizeof(GPUShader), "GPUShader");
- if(vertexcode)
+ if (vertexcode)
shader->vertex = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
- if(fragcode)
+ if (fragcode)
shader->fragment = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
shader->object = glCreateProgramObjectARB();
@@ -985,7 +985,7 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, /*GPU
return NULL;
}
- if(vertexcode) {
+ if (vertexcode) {
glAttachObjectARB(shader->object, shader->vertex);
glShaderSourceARB(shader->vertex, 1, (const char**)&vertexcode, NULL);
@@ -1001,10 +1001,10 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, /*GPU
}
}
- if(fragcode) {
+ if (fragcode) {
count = 0;
- if(libcode) fragsource[count++] = libcode;
- if(fragcode) fragsource[count++] = fragcode;
+ if (libcode) fragsource[count++] = libcode;
+ if (fragcode) fragsource[count++] = fragcode;
glAttachObjectARB(shader->object, shader->fragment);
glShaderSourceARB(shader->fragment, count, fragsource, NULL);
@@ -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);
@@ -1111,7 +1113,7 @@ int GPU_shader_get_uniform(GPUShader *shader, const char *name)
void GPU_shader_uniform_vector(GPUShader *UNUSED(shader), int location, int length, int arraysize, float *value)
{
- if(location == -1)
+ if (location == -1)
return;
GPU_print_error("Pre Uniform Vector");
@@ -1135,10 +1137,10 @@ void GPU_shader_uniform_texture(GPUShader *UNUSED(shader), int location, GPUText
return;
}
- if(tex->number == -1)
+ if (tex->number == -1)
return;
- if(location == -1)
+ if (location == -1)
return;
GPU_print_error("Pre Uniform Texture");
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index 0ddaf07c67e..906856cc64c 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -157,13 +157,13 @@ static void gpu_material_set_attrib_id(GPUMaterial *material)
attribs= &material->attribs;
pass= material->pass;
- if(!pass) {
+ if (!pass) {
attribs->totlayer = 0;
return;
}
shader= GPU_pass_shader(pass);
- if(!shader) {
+ if (!shader) {
attribs->totlayer = 0;
return;
}
@@ -172,11 +172,11 @@ static void gpu_material_set_attrib_id(GPUMaterial *material)
* in case the attrib does not get a valid index back, it was probably
* removed by the glsl compiler by dead code elimination */
- for(a=0, b=0; a<attribs->totlayer; a++) {
+ for (a=0, b=0; a<attribs->totlayer; a++) {
BLI_snprintf(name, sizeof(name), "att%d", attribs->layer[a].attribid);
attribs->layer[a].glindex = GPU_shader_get_attribute(shader, name);
- if(attribs->layer[a].glindex >= 0) {
+ if (attribs->layer[a].glindex >= 0) {
attribs->layer[b] = attribs->layer[a];
b++;
}
@@ -195,24 +195,24 @@ static int GPU_material_construct_end(GPUMaterial *material)
material->pass = GPU_generate_pass(&material->nodes, outlink,
&material->attribs, &material->builtins, material->ma->id.name);
- if(!material->pass)
+ if (!material->pass)
return 0;
gpu_material_set_attrib_id(material);
shader = GPU_pass_shader(material->pass);
- if(material->builtins & GPU_VIEW_MATRIX)
+ if (material->builtins & GPU_VIEW_MATRIX)
material->viewmatloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_VIEW_MATRIX));
- if(material->builtins & GPU_INVERSE_VIEW_MATRIX)
+ if (material->builtins & GPU_INVERSE_VIEW_MATRIX)
material->invviewmatloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_INVERSE_VIEW_MATRIX));
- if(material->builtins & GPU_OBJECT_MATRIX)
+ if (material->builtins & GPU_OBJECT_MATRIX)
material->obmatloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_OBJECT_MATRIX));
- if(material->builtins & GPU_INVERSE_OBJECT_MATRIX)
+ if (material->builtins & GPU_INVERSE_OBJECT_MATRIX)
material->invobmatloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_INVERSE_OBJECT_MATRIX));
- if(material->builtins & GPU_OBCOLOR)
+ if (material->builtins & GPU_OBCOLOR)
material->obcolloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_OBCOLOR));
- if(material->builtins & GPU_AUTO_BUMPSCALE)
+ if (material->builtins & GPU_AUTO_BUMPSCALE)
material->obautobumpscaleloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_AUTO_BUMPSCALE));
return 1;
}
@@ -225,18 +225,18 @@ void GPU_material_free(Material *ma)
LinkData *link;
LinkData *nlink, *mlink, *next;
- for(link=ma->gpumaterial.first; link; link=link->next) {
+ for (link=ma->gpumaterial.first; link; link=link->next) {
GPUMaterial *material = link->data;
- if(material->pass)
+ if (material->pass)
GPU_pass_free(material->pass);
- for(nlink=material->lamps.first; nlink; nlink=nlink->next) {
+ for (nlink=material->lamps.first; nlink; nlink=nlink->next) {
GPULamp *lamp = nlink->data;
- for(mlink=lamp->materials.first; mlink; mlink=next) {
+ for (mlink=lamp->materials.first; mlink; mlink=next) {
next = mlink->next;
- if(mlink->data == ma)
+ if (mlink->data == ma)
BLI_freelinkN(&lamp->materials, mlink);
}
}
@@ -251,15 +251,15 @@ void GPU_material_free(Material *ma)
void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double time, int mipmap)
{
- if(material->pass) {
+ if (material->pass) {
LinkData *nlink;
GPULamp *lamp;
/* handle layer lamps */
- for(nlink=material->lamps.first; nlink; nlink=nlink->next) {
+ for (nlink=material->lamps.first; nlink; nlink=nlink->next) {
lamp= nlink->data;
- if(!lamp->hide && (lamp->lay & viewlay) && (!(lamp->mode & LA_LAYER) || (lamp->lay & oblay))) {
+ if (!lamp->hide && (lamp->lay & viewlay) && (!(lamp->mode & LA_LAYER) || (lamp->lay & oblay))) {
lamp->dynenergy = lamp->energy;
copy_v3_v3(lamp->dyncol, lamp->col);
}
@@ -276,53 +276,53 @@ void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double tim
void GPU_material_bind_uniforms(GPUMaterial *material, float obmat[][4], float viewmat[][4], float viewinv[][4], float obcol[4], float autobumpscale)
{
- if(material->pass) {
+ if (material->pass) {
GPUShader *shader = GPU_pass_shader(material->pass);
LinkData *nlink;
GPULamp *lamp;
float invmat[4][4], col[4];
/* handle builtins */
- if(material->builtins & GPU_VIEW_MATRIX) {
+ if (material->builtins & GPU_VIEW_MATRIX) {
GPU_shader_uniform_vector(shader, material->viewmatloc, 16, 1, (float*)viewmat);
}
- if(material->builtins & GPU_INVERSE_VIEW_MATRIX) {
+ if (material->builtins & GPU_INVERSE_VIEW_MATRIX) {
GPU_shader_uniform_vector(shader, material->invviewmatloc, 16, 1, (float*)viewinv);
}
- if(material->builtins & GPU_OBJECT_MATRIX) {
+ if (material->builtins & GPU_OBJECT_MATRIX) {
GPU_shader_uniform_vector(shader, material->obmatloc, 16, 1, (float*)obmat);
}
- if(material->builtins & GPU_INVERSE_OBJECT_MATRIX) {
+ if (material->builtins & GPU_INVERSE_OBJECT_MATRIX) {
invert_m4_m4(invmat, obmat);
GPU_shader_uniform_vector(shader, material->invobmatloc, 16, 1, (float*)invmat);
}
- if(material->builtins & GPU_OBCOLOR) {
+ if (material->builtins & GPU_OBCOLOR) {
copy_v4_v4(col, obcol);
CLAMP(col[3], 0.0f, 1.0f);
GPU_shader_uniform_vector(shader, material->obcolloc, 4, 1, col);
}
- if(material->builtins & GPU_AUTO_BUMPSCALE) {
+ if (material->builtins & GPU_AUTO_BUMPSCALE) {
GPU_shader_uniform_vector(shader, material->obautobumpscaleloc, 1, 1, &autobumpscale);
}
/* update lamps */
- for(nlink=material->lamps.first; nlink; nlink=nlink->next) {
+ for (nlink=material->lamps.first; nlink; nlink=nlink->next) {
lamp= nlink->data;
- if(material->dynproperty & DYN_LAMP_VEC) {
+ if (material->dynproperty & DYN_LAMP_VEC) {
copy_v3_v3(lamp->dynvec, lamp->vec);
normalize_v3(lamp->dynvec);
negate_v3(lamp->dynvec);
mul_mat3_m4_v3(viewmat, lamp->dynvec);
}
- if(material->dynproperty & DYN_LAMP_CO) {
+ if (material->dynproperty & DYN_LAMP_CO) {
copy_v3_v3(lamp->dynco, lamp->co);
mul_m4_v3(viewmat, lamp->dynco);
}
- if(material->dynproperty & DYN_LAMP_IMAT)
+ if (material->dynproperty & DYN_LAMP_IMAT)
mult_m4_m4m4(lamp->dynimat, lamp->imat, viewinv);
- if(material->dynproperty & DYN_LAMP_PERSMAT)
+ if (material->dynproperty & DYN_LAMP_PERSMAT)
mult_m4_m4m4(lamp->dynpersmat, lamp->persmat, viewinv);
}
@@ -350,7 +350,7 @@ void GPU_material_vertex_attributes(GPUMaterial *material, GPUVertexAttribs *att
void GPU_material_output_link(GPUMaterial *material, GPUNodeLink *link)
{
- if(!material->outlink)
+ if (!material->outlink)
material->outlink= link;
}
@@ -361,7 +361,7 @@ void GPU_material_enable_alpha(GPUMaterial *material)
GPUBlendMode GPU_material_alpha_blend(GPUMaterial *material, float obcol[4])
{
- if(material->alpha || (material->obcolalpha && obcol[3] < 1.0f))
+ if (material->alpha || (material->obcolalpha && obcol[3] < 1.0f))
return GPU_BLEND_ALPHA;
else
return GPU_BLEND_SOLID;
@@ -385,7 +385,7 @@ static GPUNodeLink *lamp_get_visibility(GPUMaterial *mat, GPULamp *lamp, GPUNode
GPUNodeLink *visifac, *inpr;
/* from get_lamp_visibility */
- if(lamp->type==LA_SUN || lamp->type==LA_HEMI) {
+ if (lamp->type==LA_SUN || lamp->type==LA_HEMI) {
mat->dynproperty |= DYN_LAMP_VEC;
GPU_link(mat, "lamp_visibility_sun_hemi", GPU_dynamic_uniform(lamp->dynvec, GPU_DYNAMIC_LAMP_DYNVEC, lamp->ob), lv, dist, &visifac);
return visifac;
@@ -394,7 +394,7 @@ static GPUNodeLink *lamp_get_visibility(GPUMaterial *mat, GPULamp *lamp, GPUNode
mat->dynproperty |= DYN_LAMP_CO;
GPU_link(mat, "lamp_visibility_other", GPU_builtin(GPU_VIEW_POSITION), GPU_dynamic_uniform(lamp->dynco, GPU_DYNAMIC_LAMP_DYNCO, lamp->ob), lv, dist, &visifac);
- if(lamp->type==LA_AREA)
+ if (lamp->type==LA_AREA)
return visifac;
switch(lamp->falloff_type)
@@ -421,11 +421,11 @@ static GPUNodeLink *lamp_get_visibility(GPUMaterial *mat, GPULamp *lamp, GPUNode
break;
}
- if(lamp->mode & LA_SPHERE)
+ if (lamp->mode & LA_SPHERE)
GPU_link(mat, "lamp_visibility_sphere", GPU_uniform(&lamp->dist), *dist, visifac, &visifac);
- if(lamp->type == LA_SPOT) {
- if(lamp->mode & LA_SQUARE) {
+ if (lamp->type == LA_SPOT) {
+ if (lamp->mode & LA_SQUARE) {
mat->dynproperty |= DYN_LAMP_VEC|DYN_LAMP_IMAT;
GPU_link(mat, "lamp_visibility_spot_square", GPU_dynamic_uniform(lamp->dynvec, GPU_DYNAMIC_LAMP_DYNVEC, lamp->ob), GPU_dynamic_uniform((float*)lamp->dynimat, GPU_DYNAMIC_LAMP_DYNIMAT, lamp->ob), *lv, &inpr);
}
@@ -511,9 +511,9 @@ static void ramp_diffuse_result(GPUShadeInput *shi, GPUNodeLink **diff)
GPUMaterial *mat= shi->gpumat;
GPUNodeLink *fac;
- if(!(mat->scene->gm.flag & GAME_GLSL_NO_RAMPS)) {
- if(ma->ramp_col) {
- if(ma->rampin_col==MA_RAMP_IN_RESULT) {
+ if (!(mat->scene->gm.flag & GAME_GLSL_NO_RAMPS)) {
+ if (ma->ramp_col) {
+ if (ma->rampin_col==MA_RAMP_IN_RESULT) {
GPU_link(mat, "ramp_rgbtobw", *diff, &fac);
/* colorband + blend */
@@ -527,10 +527,10 @@ static void add_to_diffuse(GPUMaterial *mat, Material *ma, GPUShadeInput *shi, G
{
GPUNodeLink *fac, *tmp, *addcol;
- if(!(mat->scene->gm.flag & GAME_GLSL_NO_RAMPS) &&
+ if (!(mat->scene->gm.flag & GAME_GLSL_NO_RAMPS) &&
ma->ramp_col && (ma->mode & MA_RAMP_COL)) {
/* MA_RAMP_IN_RESULT is exceptional */
- if(ma->rampin_col==MA_RAMP_IN_RESULT) {
+ if (ma->rampin_col==MA_RAMP_IN_RESULT) {
addcol = shi->rgb;
}
else {
@@ -567,7 +567,7 @@ static void ramp_spec_result(GPUShadeInput *shi, GPUNodeLink **spec)
GPUMaterial *mat= shi->gpumat;
GPUNodeLink *fac;
- if(!(mat->scene->gm.flag & GAME_GLSL_NO_RAMPS) &&
+ if (!(mat->scene->gm.flag & GAME_GLSL_NO_RAMPS) &&
ma->ramp_spec && ma->rampin_spec==MA_RAMP_IN_RESULT) {
GPU_link(mat, "ramp_rgbtobw", *spec, &fac);
@@ -585,7 +585,7 @@ static void do_specular_ramp(GPUShadeInput *shi, GPUNodeLink *is, GPUNodeLink *t
*spec = shi->specrgb;
/* MA_RAMP_IN_RESULT is exception */
- if(ma->ramp_spec && (ma->rampin_spec!=MA_RAMP_IN_RESULT)) {
+ if (ma->ramp_spec && (ma->rampin_spec!=MA_RAMP_IN_RESULT)) {
/* input */
switch(ma->rampin_spec) {
@@ -623,7 +623,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
GPUNodeLink *outcol, *specfac, *t, *shadfac= NULL;
float one = 1.0f;
- if((lamp->mode & LA_ONLYSHADOW) && !(ma->mode & MA_SHADOW))
+ if ((lamp->mode & LA_ONLYSHADOW) && !(ma->mode & MA_SHADOW))
return;
vn= shi->vn;
@@ -636,14 +636,14 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
GPU_link(mat, "shade_inp", vn, lv, &inp);
- if(lamp->mode & LA_NO_DIFF) {
+ if (lamp->mode & LA_NO_DIFF) {
GPU_link(mat, "shade_is_no_diffuse", &is);
}
- else if(lamp->type == LA_HEMI) {
+ else if (lamp->type == LA_HEMI) {
GPU_link(mat, "shade_is_hemi", inp, &is);
}
else {
- if(lamp->type == LA_AREA) {
+ if (lamp->type == LA_AREA) {
float area[4][4]= {{0.0f}}, areasize= 0.0f;
mat->dynproperty |= DYN_LAMP_VEC|DYN_LAMP_CO;
@@ -653,34 +653,35 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
is= inp; /* Lambert */
- if(!(mat->scene->gm.flag & GAME_GLSL_NO_SHADERS)) {
- if(ma->diff_shader==MA_DIFF_ORENNAYAR)
+ if (!(mat->scene->gm.flag & GAME_GLSL_NO_SHADERS)) {
+ if (ma->diff_shader==MA_DIFF_ORENNAYAR)
GPU_link(mat, "shade_diffuse_oren_nayer", inp, vn, lv, view, GPU_uniform(&ma->roughness), &is);
- else if(ma->diff_shader==MA_DIFF_TOON)
+ else if (ma->diff_shader==MA_DIFF_TOON)
GPU_link(mat, "shade_diffuse_toon", vn, lv, view, GPU_uniform(&ma->param[0]), GPU_uniform(&ma->param[1]), &is);
- else if(ma->diff_shader==MA_DIFF_MINNAERT)
+ else if (ma->diff_shader==MA_DIFF_MINNAERT)
GPU_link(mat, "shade_diffuse_minnaert", inp, vn, view, GPU_uniform(&ma->darkness), &is);
- else if(ma->diff_shader==MA_DIFF_FRESNEL)
+ else if (ma->diff_shader==MA_DIFF_FRESNEL)
GPU_link(mat, "shade_diffuse_fresnel", vn, lv, view, GPU_uniform(&ma->param[0]), GPU_uniform(&ma->param[1]), &is);
}
}
- if(!(mat->scene->gm.flag & GAME_GLSL_NO_SHADERS))
- if(ma->shade_flag & MA_CUBIC)
+ if (!(mat->scene->gm.flag & GAME_GLSL_NO_SHADERS))
+ if (ma->shade_flag & MA_CUBIC)
GPU_link(mat, "shade_cubic", is, &is);
i = is;
GPU_link(mat, "shade_visifac", i, visifac, shi->refl, &i);
+#if 0
+ if (ma->mode & MA_TANGENT_VN)
+ GPU_link(mat, "shade_tangent_v_spec", GPU_attribute(CD_TANGENT, ""), &vn);
+#endif
- /*if(ma->mode & MA_TANGENT_VN)
- GPU_link(mat, "shade_tangent_v_spec", GPU_attribute(CD_TANGENT, ""), &vn);*/
-
- /* this replaces if(i > 0.0) conditional until that is supported */
+ /* 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);
- if((ma->mode & MA_SHADOW) && GPU_lamp_has_shadow_buffer(lamp)) {
- if(!(mat->scene->gm.flag & GAME_GLSL_NO_SHADOWS)) {
+ if ((ma->mode & MA_SHADOW) && GPU_lamp_has_shadow_buffer(lamp)) {
+ if (!(mat->scene->gm.flag & GAME_GLSL_NO_SHADOWS)) {
mat->dynproperty |= DYN_LAMP_PERSMAT;
GPU_link(mat, "test_shadowbuf",
@@ -689,15 +690,15 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
GPU_dynamic_uniform((float*)lamp->dynpersmat, GPU_DYNAMIC_LAMP_DYNPERSMAT, lamp->ob),
GPU_uniform(&lamp->bias), inp, &shadfac);
- if(lamp->mode & LA_ONLYSHADOW) {
+ if (lamp->mode & LA_ONLYSHADOW) {
GPU_link(mat, "shade_only_shadow", i, shadfac,
GPU_dynamic_uniform(&lamp->dynenergy, GPU_DYNAMIC_LAMP_DYNENERGY, lamp->ob), &shadfac);
- if(!(lamp->mode & LA_NO_DIFF))
+ if (!(lamp->mode & LA_NO_DIFF))
GPU_link(mat, "shade_only_shadow_diffuse", shadfac, shi->rgb,
shr->diff, &shr->diff);
- if(!(lamp->mode & LA_NO_SPEC))
+ if (!(lamp->mode & LA_NO_SPEC))
GPU_link(mat, "shade_only_shadow_specular", shadfac, shi->specrgb,
shr->spec, &shr->spec);
@@ -709,7 +710,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
GPU_link(mat, "math_multiply", i, shadfac, &i);
}
}
- else if((mat->scene->gm.flag & GAME_GLSL_NO_SHADOWS) && (lamp->mode & LA_ONLYSHADOW)) {
+ else if ((mat->scene->gm.flag & GAME_GLSL_NO_SHADOWS) && (lamp->mode & LA_ONLYSHADOW)) {
add_user_list(&mat->lamps, lamp);
add_user_list(&lamp->materials, shi->gpumat->ma);
return;
@@ -717,40 +718,40 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
else
GPU_link(mat, "set_value", GPU_uniform(&one), &shadfac);
- if(GPU_link_changed(shi->refl) || ma->ref != 0.0f) {
- if(!(lamp->mode & LA_NO_DIFF)) {
+ if (GPU_link_changed(shi->refl) || ma->ref != 0.0f) {
+ if (!(lamp->mode & LA_NO_DIFF)) {
GPUNodeLink *rgb;
GPU_link(mat, "shade_mul_value", i, GPU_dynamic_uniform(lamp->dyncol, GPU_DYNAMIC_LAMP_DYNCOL, lamp->ob), &rgb);
add_to_diffuse(mat, ma, shi, is, rgb, &shr->diff);
}
}
- if(mat->scene->gm.flag & GAME_GLSL_NO_SHADERS);
- else if(!(lamp->mode & LA_NO_SPEC) && !(lamp->mode & LA_ONLYSHADOW) &&
+ if (mat->scene->gm.flag & GAME_GLSL_NO_SHADERS);
+ else if (!(lamp->mode & LA_NO_SPEC) && !(lamp->mode & LA_ONLYSHADOW) &&
(GPU_link_changed(shi->spec) || ma->spec != 0.0f)) {
- if(lamp->type == LA_HEMI) {
+ if (lamp->type == LA_HEMI) {
GPU_link(mat, "shade_hemi_spec", vn, lv, view, GPU_uniform(&ma->spec), shi->har, visifac, &t);
GPU_link(mat, "shade_add_spec", t, GPU_dynamic_uniform(lamp->dyncol, GPU_DYNAMIC_LAMP_DYNCOL, lamp->ob), shi->specrgb, &outcol);
GPU_link(mat, "shade_add_clamped", shr->spec, outcol, &shr->spec);
}
else {
- if(ma->spec_shader==MA_SPEC_PHONG)
+ if (ma->spec_shader==MA_SPEC_PHONG)
GPU_link(mat, "shade_phong_spec", vn, lv, view, shi->har, &specfac);
- else if(ma->spec_shader==MA_SPEC_COOKTORR)
+ else if (ma->spec_shader==MA_SPEC_COOKTORR)
GPU_link(mat, "shade_cooktorr_spec", vn, lv, view, shi->har, &specfac);
- else if(ma->spec_shader==MA_SPEC_BLINN)
+ else if (ma->spec_shader==MA_SPEC_BLINN)
GPU_link(mat, "shade_blinn_spec", vn, lv, view, GPU_uniform(&ma->refrac), shi->har, &specfac);
- else if(ma->spec_shader==MA_SPEC_WARDISO)
+ else if (ma->spec_shader==MA_SPEC_WARDISO)
GPU_link(mat, "shade_wardiso_spec", vn, lv, view, GPU_uniform(&ma->rms), &specfac);
else
GPU_link(mat, "shade_toon_spec", vn, lv, view, GPU_uniform(&ma->param[2]), GPU_uniform(&ma->param[3]), &specfac);
- if(lamp->type==LA_AREA)
+ if (lamp->type==LA_AREA)
GPU_link(mat, "shade_spec_area_inp", specfac, inp, &specfac);
GPU_link(mat, "shade_spec_t", shadfac, shi->spec, visifac, specfac, &t);
- if(ma->mode & MA_RAMP_SPEC) {
+ if (ma->mode & MA_RAMP_SPEC) {
GPUNodeLink *spec;
do_specular_ramp(shi, specfac, t, &spec);
GPU_link(mat, "shade_add_spec", t, GPU_dynamic_uniform(lamp->dyncol, GPU_DYNAMIC_LAMP_DYNCOL, lamp->ob), spec, &outcol);
@@ -774,12 +775,12 @@ static void material_lights(GPUShadeInput *shi, GPUShadeResult *shr)
Scene *sce_iter;
GPULamp *lamp;
- for(SETLOOPER(shi->gpumat->scene, sce_iter, base)) {
+ for (SETLOOPER(shi->gpumat->scene, sce_iter, base)) {
ob= base->object;
- if(ob->type==OB_LAMP) {
+ if (ob->type==OB_LAMP) {
lamp = GPU_lamp_from_blender(shi->gpumat->scene, ob, NULL);
- if(lamp)
+ if (lamp)
shade_one_light(shi, shr, lamp);
}
@@ -787,14 +788,14 @@ static void material_lights(GPUShadeInput *shi, GPUShadeResult *shr)
DupliObject *dob;
ListBase *lb = object_duplilist(shi->gpumat->scene, ob);
- for(dob=lb->first; dob; dob=dob->next) {
+ for (dob=lb->first; dob; dob=dob->next) {
Object *ob_iter = dob->ob;
- if(ob_iter->type==OB_LAMP) {
+ if (ob_iter->type==OB_LAMP) {
copy_m4_m4(ob_iter->obmat, dob->mat);
lamp = GPU_lamp_from_blender(shi->gpumat->scene, ob_iter, ob);
- if(lamp)
+ if (lamp)
shade_one_light(shi, shr, lamp);
}
}
@@ -923,33 +924,33 @@ static void do_material_tex(GPUShadeInput *shi)
orn= texco_norm;
/* go over texture slots */
- for(tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
+ for (tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
/* separate tex switching */
- if(ma->septex & (1<<tex_nr)) continue;
+ if (ma->septex & (1<<tex_nr)) continue;
- if(ma->mtex[tex_nr]) {
+ if (ma->mtex[tex_nr]) {
mtex= ma->mtex[tex_nr];
tex= mtex->tex;
- if(tex == NULL) continue;
+ if (tex == NULL) continue;
/* which coords */
- if(mtex->texco==TEXCO_ORCO)
+ if (mtex->texco==TEXCO_ORCO)
texco= texco_orco;
- else if(mtex->texco==TEXCO_OBJECT)
+ else if (mtex->texco==TEXCO_OBJECT)
texco= texco_object;
- else if(mtex->texco==TEXCO_NORM)
+ else if (mtex->texco==TEXCO_NORM)
texco= orn;
- else if(mtex->texco==TEXCO_TANGENT)
+ else if (mtex->texco==TEXCO_TANGENT)
texco= texco_object;
- else if(mtex->texco==TEXCO_GLOB)
+ else if (mtex->texco==TEXCO_GLOB)
texco= texco_global;
- else if(mtex->texco==TEXCO_REFL) {
+ else if (mtex->texco==TEXCO_REFL) {
GPU_link(mat, "texco_refl", shi->vn, shi->view, &shi->ref);
texco= shi->ref;
}
- else if(mtex->texco==TEXCO_UV) {
- if(1) { //!(texco_uv && strcmp(mtex->uvname, lastuvname) == 0)) {
+ else if (mtex->texco==TEXCO_UV) {
+ if (1) { //!(texco_uv && strcmp(mtex->uvname, lastuvname) == 0)) {
GPU_link(mat, "texco_uv", GPU_attribute(CD_MTFACE, mtex->uvname), &texco_uv);
/*lastuvname = mtex->uvname;*/ /*UNUSED*/
}
@@ -959,133 +960,132 @@ static void do_material_tex(GPUShadeInput *shi)
continue;
/* in case of uv, this would just undo a multiplication in texco_uv */
- if(mtex->texco != TEXCO_UV)
+ if (mtex->texco != TEXCO_UV)
GPU_link(mat, "mtex_2d_mapping", texco, &texco);
- if(mtex->size[0] != 1.0f || mtex->size[1] != 1.0f || mtex->size[2] != 1.0f)
+ if (mtex->size[0] != 1.0f || mtex->size[1] != 1.0f || mtex->size[2] != 1.0f)
GPU_link(mat, "mtex_mapping_size", texco, GPU_uniform(mtex->size), &texco);
ofs[0] = mtex->ofs[0] + 0.5f - 0.5f*mtex->size[0];
ofs[1] = mtex->ofs[1] + 0.5f - 0.5f*mtex->size[1];
ofs[2] = 0.0f;
- if(ofs[0] != 0.0f || ofs[1] != 0.0f || ofs[2] != 0.0f)
+ if (ofs[0] != 0.0f || ofs[1] != 0.0f || ofs[2] != 0.0f)
GPU_link(mat, "mtex_mapping_ofs", texco, GPU_uniform(ofs), &texco);
talpha = 0;
- if(tex && tex->type == TEX_IMAGE && tex->ima) {
+ if (tex && tex->type == TEX_IMAGE && tex->ima) {
GPU_link(mat, "mtex_image", texco, GPU_image(tex->ima, &tex->iuser), &tin, &trgb);
rgbnor= TEX_RGB;
- if(tex->imaflag & TEX_USEALPHA)
+ if (tex->imaflag & TEX_USEALPHA)
talpha= 1;
}
else continue;
/* texture output */
- if((rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
+ if ((rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
GPU_link(mat, "mtex_rgbtoint", trgb, &tin);
rgbnor -= TEX_RGB;
}
- if(mtex->texflag & MTEX_NEGATIVE) {
- if(rgbnor & TEX_RGB)
+ if (mtex->texflag & MTEX_NEGATIVE) {
+ if (rgbnor & TEX_RGB)
GPU_link(mat, "mtex_rgb_invert", trgb, &trgb);
else
GPU_link(mat, "mtex_value_invert", tin, &tin);
}
- if(mtex->texflag & MTEX_STENCIL) {
- if(rgbnor & TEX_RGB)
+ if (mtex->texflag & MTEX_STENCIL) {
+ if (rgbnor & TEX_RGB)
GPU_link(mat, "mtex_rgb_stencil", stencil, trgb, &stencil, &trgb);
else
GPU_link(mat, "mtex_value_stencil", stencil, tin, &stencil, &tin);
}
/* mapping */
- if(mtex->mapto & (MAP_COL+MAP_COLSPEC)) {
+ if (mtex->mapto & (MAP_COL+MAP_COLSPEC)) {
/* stencil maps on the texture control slider, not texture intensity value */
- if((rgbnor & TEX_RGB)==0) {
+ if ((rgbnor & TEX_RGB)==0) {
GPU_link(mat, "set_rgb", GPU_uniform(&mtex->r), &tcol);
}
else {
GPU_link(mat, "set_rgba", trgb, &tcol);
- if(mtex->mapto & MAP_ALPHA)
+ if (mtex->mapto & MAP_ALPHA)
GPU_link(mat, "set_value", stencil, &tin);
- else if(talpha)
+ else if (talpha)
GPU_link(mat, "mtex_alpha_from_col", trgb, &tin);
else
GPU_link(mat, "set_value_one", &tin);
}
- if(tex->type==TEX_IMAGE)
- if(gpu_do_color_management(mat))
+ if (tex->type==TEX_IMAGE)
+ if (gpu_do_color_management(mat))
GPU_link(mat, "srgb_to_linearrgb", tcol, &tcol);
- if(mtex->mapto & MAP_COL) {
+ if (mtex->mapto & MAP_COL) {
GPUNodeLink *colfac;
- if(mtex->colfac == 1.0f) colfac = stencil;
+ if (mtex->colfac == 1.0f) colfac = stencil;
else GPU_link(mat, "math_multiply", GPU_uniform(&mtex->colfac), stencil, &colfac);
texture_rgb_blend(mat, tcol, shi->rgb, tin, colfac, mtex->blendtype, &shi->rgb);
}
- if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_COLSPEC)) {
+ if (!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_COLSPEC)) {
GPUNodeLink *colspecfac;
- if(mtex->colspecfac == 1.0f) colspecfac = stencil;
+ if (mtex->colspecfac == 1.0f) colspecfac = stencil;
else GPU_link(mat, "math_multiply", GPU_uniform(&mtex->colspecfac), stencil, &colspecfac);
texture_rgb_blend(mat, tcol, shi->specrgb, tin, colspecfac, mtex->blendtype, &shi->specrgb);
}
}
- if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_NORM)) {
- if(tex->type==TEX_IMAGE) {
+ if (!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_NORM)) {
+ if (tex->type==TEX_IMAGE) {
found_deriv_map = tex->imaflag & TEX_DERIVATIVEMAP;
- if(tex->imaflag & TEX_NORMALMAP) {
+ if (tex->imaflag & TEX_NORMALMAP) {
/* normalmap image */
GPU_link(mat, "mtex_normal", texco, GPU_image(tex->ima, &tex->iuser), &tnor );
- if(mtex->norfac < 0.0f)
+ 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);
- if(norfac == 1.0f && !GPU_link_changed(stencil)) {
+ if (norfac == 1.0f && !GPU_link_changed(stencil)) {
shi->vn = newnor;
}
else {
tnorfac = GPU_uniform(&norfac);
- if(GPU_link_changed(stencil))
+ if (GPU_link_changed(stencil))
GPU_link(mat, "math_multiply", tnorfac, stencil, &tnorfac);
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;
@@ -1099,16 +1099,16 @@ static void do_material_tex(GPUShadeInput *shi)
GPUNodeLink *dBs, *dBt, *fDet;
hScale = 0.1; // compatibility adjustment factor for all bumpspace types
- if( mtex->texflag & MTEX_BUMP_TEXTURESPACE )
+ if ( mtex->texflag & MTEX_BUMP_TEXTURESPACE )
hScale = 13.0f; // factor for scaling texspace bumps
- else if(found_deriv_map!=0)
+ else if (found_deriv_map!=0)
hScale = 1.0f;
// resolve texture resolution
- if( (mtex->texflag & MTEX_BUMP_TEXTURESPACE) || found_deriv_map ) {
+ if ( (mtex->texflag & MTEX_BUMP_TEXTURESPACE) || found_deriv_map ) {
ImBuf *ibuf= BKE_image_get_ibuf(tex->ima, &tex->iuser);
ima_x= 512.0f; ima_y= 512.f; // prevent calling textureSize, glsl 1.3 only
- if(ibuf) {
+ if (ibuf) {
ima_x= ibuf->x;
ima_y= ibuf->y;
aspect = ((float) ima_y) / ima_x;
@@ -1120,21 +1120,20 @@ 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);
}
tnorfac = GPU_uniform(&norfac);
- if(found_deriv_map)
+ if (found_deriv_map)
GPU_link(mat, "math_multiply", tnorfac, GPU_builtin(GPU_AUTO_BUMPSCALE), &tnorfac);
- if(GPU_link_changed(stencil))
+ if (GPU_link_changed(stencil))
GPU_link(mat, "math_multiply", tnorfac, stencil, &tnorfac);
- if( !init_done ) {
+ if ( !init_done ) {
// copy shi->vn to vNorg and vNacc, set magnitude to 1
GPU_link(mat, "mtex_bump_normals_init", shi->vn, &vNorg, &vNacc, &fPrevMagnitude);
iBumpSpacePrev = 0;
@@ -1142,17 +1141,17 @@ static void do_material_tex(GPUShadeInput *shi)
}
// find current bump space
- if( mtex->texflag & MTEX_BUMP_OBJECTSPACE )
+ if ( mtex->texflag & MTEX_BUMP_OBJECTSPACE )
iBumpSpace = 1;
- else if( mtex->texflag & MTEX_BUMP_TEXTURESPACE )
+ else if ( mtex->texflag & MTEX_BUMP_TEXTURESPACE )
iBumpSpace = 2;
else
iBumpSpace = 4; // ViewSpace
// re-initialize if bump space changed
- if( iBumpSpacePrev != iBumpSpace ) {
+ if ( iBumpSpacePrev != iBumpSpace ) {
- if( mtex->texflag & MTEX_BUMP_OBJECTSPACE )
+ if ( mtex->texflag & MTEX_BUMP_OBJECTSPACE )
GPU_link( mat, "mtex_bump_init_objspace",
surf_pos, vNorg,
GPU_builtin(GPU_VIEW_MATRIX), GPU_builtin(GPU_INVERSE_VIEW_MATRIX), GPU_builtin(GPU_OBJECT_MATRIX), GPU_builtin(GPU_INVERSE_OBJECT_MATRIX),
@@ -1160,7 +1159,7 @@ static void do_material_tex(GPUShadeInput *shi)
&fPrevMagnitude, &vNacc,
&vR1, &vR2, &fDet );
- else if( mtex->texflag & MTEX_BUMP_TEXTURESPACE )
+ else if ( mtex->texflag & MTEX_BUMP_TEXTURESPACE )
GPU_link( mat, "mtex_bump_init_texturespace",
surf_pos, vNorg,
fPrevMagnitude, vNacc,
@@ -1178,25 +1177,26 @@ static void do_material_tex(GPUShadeInput *shi)
}
- if(found_deriv_map) {
+ if (found_deriv_map) {
GPU_link( mat, "mtex_bump_deriv",
texco, GPU_image(tex->ima, &tex->iuser), GPU_uniform(&ima_x), GPU_uniform(&ima_y), tnorfac,
&dBs, &dBt );
}
- else if( mtex->texflag & MTEX_3TAP_BUMP )
+ else if ( mtex->texflag & MTEX_3TAP_BUMP )
GPU_link( mat, "mtex_bump_tap3",
texco, GPU_image(tex->ima, &tex->iuser), tnorfac,
&dBs, &dBt );
- else if( mtex->texflag & MTEX_5TAP_BUMP )
+ else if ( mtex->texflag & MTEX_5TAP_BUMP )
GPU_link( mat, "mtex_bump_tap5",
texco, GPU_image(tex->ima, &tex->iuser), tnorfac,
&dBs, &dBt );
- else if( mtex->texflag & MTEX_BICUBIC_BUMP ){
- if(GPU_bicubic_bump_support()){
+ else if ( mtex->texflag & MTEX_BICUBIC_BUMP ) {
+ if (GPU_bicubic_bump_support()) {
GPU_link( mat, "mtex_bump_bicubic",
texco, GPU_image(tex->ima, &tex->iuser), tnorfac,
&dBs, &dBt );
- }else{
+ }
+ else {
GPU_link( mat, "mtex_bump_tap5",
texco, GPU_image(tex->ima, &tex->iuser), tnorfac,
&dBs, &dBt );
@@ -1204,14 +1204,15 @@ static void do_material_tex(GPUShadeInput *shi)
}
- if( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) {
+ if ( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) {
float imag_tspace_dimension_y = aspect*imag_tspace_dimension_x;
GPU_link( mat, "mtex_bump_apply_texspace",
fDet, dBs, dBt, vR1, vR2,
GPU_image(tex->ima, &tex->iuser), texco,
GPU_uniform(&imag_tspace_dimension_x), GPU_uniform(&imag_tspace_dimension_y), vNacc,
&vNacc, &shi->vn );
- } else
+ }
+ else
GPU_link( mat, "mtex_bump_apply",
fDet, dBs, dBt, vR1, vR2, vNacc,
&vNacc, &shi->vn );
@@ -1222,64 +1223,64 @@ static void do_material_tex(GPUShadeInput *shi)
GPU_link(mat, "vec_math_negate", shi->vn, &orn);
}
- if((mtex->mapto & MAP_VARS)) {
- if(rgbnor & TEX_RGB) {
- if(talpha)
+ if ((mtex->mapto & MAP_VARS)) {
+ if (rgbnor & TEX_RGB) {
+ if (talpha)
GPU_link(mat, "mtex_alpha_from_col", trgb, &tin);
else
GPU_link(mat, "mtex_rgbtoint", trgb, &tin);
}
- if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_REF) {
+ if (!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_REF) {
GPUNodeLink *difffac;
- if(mtex->difffac == 1.0f) difffac = stencil;
+ if (mtex->difffac == 1.0f) difffac = stencil;
else GPU_link(mat, "math_multiply", GPU_uniform(&mtex->difffac), stencil, &difffac);
texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->refl, tin, difffac, mtex->blendtype, &shi->refl);
GPU_link(mat, "mtex_value_clamp_positive", shi->refl, &shi->refl);
}
- if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_SPEC) {
+ if (!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_SPEC) {
GPUNodeLink *specfac;
- if(mtex->specfac == 1.0f) specfac = stencil;
+ if (mtex->specfac == 1.0f) specfac = stencil;
else GPU_link(mat, "math_multiply", GPU_uniform(&mtex->specfac), stencil, &specfac);
texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->spec, tin, specfac, mtex->blendtype, &shi->spec);
GPU_link(mat, "mtex_value_clamp_positive", shi->spec, &shi->spec);
}
- if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_EMIT) {
+ if (!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_EMIT) {
GPUNodeLink *emitfac;
- if(mtex->emitfac == 1.0f) emitfac = stencil;
+ if (mtex->emitfac == 1.0f) emitfac = stencil;
else GPU_link(mat, "math_multiply", GPU_uniform(&mtex->emitfac), stencil, &emitfac);
texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->emit, tin, emitfac, mtex->blendtype, &shi->emit);
GPU_link(mat, "mtex_value_clamp_positive", shi->emit, &shi->emit);
}
- if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_HAR) {
+ if (!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_HAR) {
GPUNodeLink *hardfac;
- if(mtex->hardfac == 1.0f) hardfac = stencil;
+ if (mtex->hardfac == 1.0f) hardfac = stencil;
else GPU_link(mat, "math_multiply", GPU_uniform(&mtex->hardfac), stencil, &hardfac);
GPU_link(mat, "mtex_har_divide", shi->har, &shi->har);
texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->har, tin, hardfac, mtex->blendtype, &shi->har);
GPU_link(mat, "mtex_har_multiply_clamp", shi->har, &shi->har);
}
- if(mtex->mapto & MAP_ALPHA) {
+ if (mtex->mapto & MAP_ALPHA) {
GPUNodeLink *alphafac;
- if(mtex->alphafac == 1.0f) alphafac = stencil;
+ if (mtex->alphafac == 1.0f) alphafac = stencil;
else GPU_link(mat, "math_multiply", GPU_uniform(&mtex->alphafac), stencil, &alphafac);
texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->alpha, tin, alphafac, mtex->blendtype, &shi->alpha);
GPU_link(mat, "mtex_value_clamp", shi->alpha, &shi->alpha);
}
- if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_AMB) {
+ if (!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_AMB) {
GPUNodeLink *ambfac;
- if(mtex->ambfac == 1.0f) ambfac = stencil;
+ if (mtex->ambfac == 1.0f) ambfac = stencil;
else GPU_link(mat, "math_multiply", GPU_uniform(&mtex->ambfac), stencil, &ambfac);
texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->amb, tin, ambfac, mtex->blendtype, &shi->amb);
@@ -1310,7 +1311,7 @@ void GPU_shadeinput_set(GPUMaterial *mat, Material *ma, GPUShadeInput *shi)
GPU_link(mat, "set_value", GPU_uniform(&ma->amb), &shi->amb);
GPU_link(mat, "shade_view", GPU_builtin(GPU_VIEW_POSITION), &shi->view);
GPU_link(mat, "vcol_attribute", GPU_attribute(CD_MCOL, ""), &shi->vcol);
- if(gpu_do_color_management(mat))
+ if (gpu_do_color_management(mat))
GPU_link(mat, "srgb_to_linearrgb", shi->vcol, &shi->vcol);
GPU_link(mat, "texco_refl", shi->vn, shi->view, &shi->ref);
}
@@ -1325,23 +1326,23 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr)
memset(shr, 0, sizeof(*shr));
- if(ma->mode & MA_VERTEXCOLP)
+ if (ma->mode & MA_VERTEXCOLP)
shi->rgb = shi->vcol;
do_material_tex(shi);
- if((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP))
+ if ((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP))
GPU_material_enable_alpha(mat);
- if((mat->scene->gm.flag & GAME_GLSL_NO_LIGHTS) || (ma->mode & MA_SHLESS)) {
+ if ((mat->scene->gm.flag & GAME_GLSL_NO_LIGHTS) || (ma->mode & MA_SHLESS)) {
shr->combined = shi->rgb;
shr->alpha = shi->alpha;
GPU_link(mat, "set_rgb", shi->rgb, &shr->diff);
GPU_link(mat, "set_rgb_zero", &shr->spec);
}
else {
- if(GPU_link_changed(shi->emit) || ma->emit != 0.0f) {
- if((ma->mode & (MA_VERTEXCOL|MA_VERTEXCOLP))== MA_VERTEXCOL) {
+ if (GPU_link_changed(shi->emit) || ma->emit != 0.0f) {
+ if ((ma->mode & (MA_VERTEXCOL|MA_VERTEXCOLP))== MA_VERTEXCOL) {
GPU_link(mat, "shade_add", shi->emit, shi->vcol, &emit);
GPU_link(mat, "shade_mul", emit, shi->rgb, &shr->diff);
}
@@ -1358,9 +1359,9 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr)
shr->combined = shr->diff;
shr->alpha = shi->alpha;
- if(world) {
+ if (world) {
/* exposure correction */
- if(world->exp!=0.0f || world->range!=1.0f) {
+ if (world->exp!=0.0f || world->range!=1.0f) {
linfac= 1.0f + powf((2.0f*world->exp + 0.5f), -10);
logfac= logf((linfac-1.0f)/linfac)/world->range;
@@ -1374,26 +1375,26 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr)
}
/* ambient color */
- if(world->ambr!=0.0f || world->ambg!=0.0f || world->ambb!=0.0f) {
- if(GPU_link_changed(shi->amb) || ma->amb != 0.0f)
+ if (world->ambr!=0.0f || world->ambg!=0.0f || world->ambb!=0.0f) {
+ if (GPU_link_changed(shi->amb) || ma->amb != 0.0f)
GPU_link(mat, "shade_maddf", shr->combined, GPU_uniform(&ma->amb),
GPU_uniform(&world->ambr), &shr->combined);
}
}
- if(ma->mode & MA_RAMP_COL) ramp_diffuse_result(shi, &shr->combined);
- if(ma->mode & MA_RAMP_SPEC) ramp_spec_result(shi, &shr->spec);
+ if (ma->mode & MA_RAMP_COL) ramp_diffuse_result(shi, &shr->combined);
+ if (ma->mode & MA_RAMP_SPEC) ramp_spec_result(shi, &shr->spec);
- if(GPU_link_changed(shi->spec) || ma->spec != 0.0f)
+ if (GPU_link_changed(shi->spec) || ma->spec != 0.0f)
GPU_link(mat, "shade_add", shr->combined, shr->spec, &shr->combined);
}
GPU_link(mat, "mtex_alpha_to_col", shr->combined, shr->alpha, &shr->combined);
- if(ma->shade_flag & MA_OBCOLOR)
+ if (ma->shade_flag & MA_OBCOLOR)
GPU_link(mat, "shade_obcolor", shr->combined, GPU_builtin(GPU_OBCOLOR), &shr->combined);
- if(world && (world->mode & WO_MIST) && !(ma->mode & MA_NOMIST)) {
+ if (world && (world->mode & WO_MIST) && !(ma->mode & MA_NOMIST)) {
misttype = world->mistype;
GPU_link(mat, "shade_mist_factor", GPU_builtin(GPU_VIEW_POSITION),
@@ -1404,15 +1405,15 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr)
GPU_uniform(&world->horr), &shr->combined);
}
- if(!((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP))) {
- if(world && (GPU_link_changed(shr->alpha) || ma->alpha != 1.0f))
+ if (!((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP))) {
+ if (world && (GPU_link_changed(shr->alpha) || ma->alpha != 1.0f))
GPU_link(mat, "shade_world_mix", GPU_uniform(&world->horr),
shr->combined, &shr->combined);
GPU_link(mat, "shade_alpha_opaque", shr->combined, &shr->combined);
}
- if(ma->shade_flag & MA_OBCOLOR) {
+ if (ma->shade_flag & MA_OBCOLOR) {
mat->obcolalpha = 1;
GPU_link(mat, "shade_alpha_obcolor", shr->combined, GPU_builtin(GPU_OBCOLOR), &shr->combined);
}
@@ -1435,15 +1436,15 @@ GPUMaterial *GPU_material_from_blender(Scene *scene, Material *ma)
GPUNodeLink *outlink;
LinkData *link;
- for(link=ma->gpumaterial.first; link; link=link->next)
- if(((GPUMaterial*)link->data)->scene == scene)
+ for (link=ma->gpumaterial.first; link; link=link->next)
+ if (((GPUMaterial*)link->data)->scene == scene)
return link->data;
/* allocate material */
mat = GPU_material_construct_begin(ma);
mat->scene = scene;
- if(!(scene->gm.flag & GAME_GLSL_NO_NODES) && ma->nodetree && ma->use_nodes) {
+ if (!(scene->gm.flag & GAME_GLSL_NO_NODES) && ma->nodetree && ma->use_nodes) {
/* create nodes */
ntreeGPUMaterialNodes(ma->nodetree, mat);
}
@@ -1453,9 +1454,9 @@ GPUMaterial *GPU_material_from_blender(Scene *scene, Material *ma)
GPU_material_output_link(mat, outlink);
}
- if(!scene_use_new_shading_nodes(scene)) {
- if(gpu_do_color_management(mat))
- if(mat->outlink)
+ if (!scene_use_new_shading_nodes(scene)) {
+ if (gpu_do_color_management(mat))
+ if (mat->outlink)
GPU_link(mat, "linearrgb_to_srgb", mat->outlink, &mat->outlink);
}
@@ -1463,8 +1464,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;
@@ -1479,12 +1480,12 @@ void GPU_materials_free(void)
Material *ma;
extern Material defmaterial;
- for(ma=G.main->mat.first; ma; ma=ma->id.next)
+ for (ma=G.main->mat.first; ma; ma=ma->id.next)
GPU_material_free(ma);
GPU_material_free(&defmaterial);
- for(ob=G.main->object.first; ob; ob=ob->id.next)
+ for (ob=G.main->object.first; ob; ob=ob->id.next)
GPU_lamp_free(ob);
}
@@ -1509,7 +1510,7 @@ void GPU_lamp_update(GPULamp *lamp, int lay, int hide, float obmat[][4])
void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float energy)
{
lamp->energy = energy;
- if(lamp->mode & LA_NEG) lamp->energy= -lamp->energy;
+ if (lamp->mode & LA_NEG) lamp->energy= -lamp->energy;
lamp->col[0]= r* lamp->energy;
lamp->col[1]= g* lamp->energy;
@@ -1530,7 +1531,7 @@ static void gpu_lamp_from_blender(Scene *scene, Object *ob, Object *par, Lamp *l
lamp->type = la->type;
lamp->energy = la->energy;
- if(lamp->mode & LA_NEG) lamp->energy= -lamp->energy;
+ if (lamp->mode & LA_NEG) lamp->energy= -lamp->energy;
lamp->col[0]= la->r*lamp->energy;
lamp->col[1]= la->g*lamp->energy;
@@ -1539,8 +1540,8 @@ static void gpu_lamp_from_blender(Scene *scene, Object *ob, Object *par, Lamp *l
GPU_lamp_update(lamp, ob->lay, (ob->restrictflag & OB_RESTRICT_RENDER), ob->obmat);
lamp->spotsi= la->spotsize;
- if(lamp->mode & LA_HALO)
- if(lamp->spotsi > 170.0f)
+ if (lamp->mode & LA_HALO)
+ if (lamp->spotsi > 170.0f)
lamp->spotsi = 170.0f;
lamp->spotsi= cosf((float)M_PI*lamp->spotsi/360.0f);
lamp->spotbl= (1.0f - lamp->spotsi)*la->spotblend;
@@ -1572,11 +1573,11 @@ static void gpu_lamp_from_blender(Scene *scene, Object *ob, Object *par, Lamp *l
static void gpu_lamp_shadow_free(GPULamp *lamp)
{
- if(lamp->tex) {
+ if (lamp->tex) {
GPU_texture_free(lamp->tex);
lamp->tex= NULL;
}
- if(lamp->fb) {
+ if (lamp->fb) {
GPU_framebuffer_free(lamp->fb);
lamp->fb= NULL;
}
@@ -1588,10 +1589,10 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
GPULamp *lamp;
LinkData *link;
- for(link=ob->gpulamp.first; link; link=link->next) {
+ for (link=ob->gpulamp.first; link; link=link->next) {
lamp = (GPULamp*)link->data;
- if(lamp->par == par && lamp->scene == scene)
+ if (lamp->par == par && lamp->scene == scene)
return link->data;
}
@@ -1604,21 +1605,21 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
la = ob->data;
gpu_lamp_from_blender(scene, ob, par, la, lamp);
- if(la->type==LA_SPOT && (la->mode & LA_SHAD_BUF)) {
+ if (la->type==LA_SPOT && (la->mode & LA_SHAD_BUF)) {
/* opengl */
lamp->fb = GPU_framebuffer_create();
- if(!lamp->fb) {
+ if (!lamp->fb) {
gpu_lamp_shadow_free(lamp);
return lamp;
}
lamp->tex = GPU_texture_create_depth(lamp->size, lamp->size, NULL);
- if(!lamp->tex) {
+ if (!lamp->tex) {
gpu_lamp_shadow_free(lamp);
return lamp;
}
- if(!GPU_framebuffer_texture_attach(lamp->fb, lamp->tex, NULL)) {
+ if (!GPU_framebuffer_texture_attach(lamp->fb, lamp->tex, NULL)) {
gpu_lamp_shadow_free(lamp);
return lamp;
}
@@ -1636,15 +1637,15 @@ void GPU_lamp_free(Object *ob)
LinkData *nlink;
Material *ma;
- for(link=ob->gpulamp.first; link; link=link->next) {
+ for (link=ob->gpulamp.first; link; link=link->next) {
lamp = link->data;
- while(lamp->materials.first) {
+ while (lamp->materials.first) {
nlink = lamp->materials.first;
ma = nlink->data;
BLI_freelinkN(&lamp->materials, nlink);
- if(ma->gpumaterial.first)
+ if (ma->gpumaterial.first)
GPU_material_free(ma);
}
@@ -1707,7 +1708,7 @@ void GPU_lamp_shadow_buffer_unbind(GPULamp *lamp)
int GPU_lamp_shadow_layer(GPULamp *lamp)
{
- if(lamp->fb && lamp->tex && (lamp->mode & (LA_LAYER|LA_LAYER_SHADOW)))
+ if (lamp->fb && lamp->tex && (lamp->mode & (LA_LAYER|LA_LAYER_SHADOW)))
return lamp->lay;
else
return -1;
@@ -1740,19 +1741,19 @@ GPUShaderExport *GPU_shader_export(struct Scene *scene, struct Material *ma)
GLint lastbindcode;
int i, liblen, fraglen;
- if(!GPU_glsl_support())
+ if (!GPU_glsl_support())
return NULL;
mat = GPU_material_from_blender(scene, ma);
pass = (mat)? mat->pass: NULL;
- if(pass && pass->fragmentcode && pass->vertexcode) {
+ if (pass && pass->fragmentcode && pass->vertexcode) {
shader = MEM_callocN(sizeof(GPUShaderExport), "GPUShaderExport");
- for(input = pass->inputs.first; input; input = input->next) {
+ for (input = pass->inputs.first; input; input = input->next) {
uniform = MEM_callocN(sizeof(GPUInputUniform), "GPUInputUniform");
- if(input->ima) {
+ if (input->ima) {
/* image sampler uniform */
uniform->type = GPU_DYNAMIC_SAMPLER_2DIMAGE;
uniform->datatype = GPU_DATA_1I;
@@ -1760,7 +1761,7 @@ GPUShaderExport *GPU_shader_export(struct Scene *scene, struct Material *ma)
uniform->texnumber = input->texid;
BLI_strncpy(uniform->varname, input->shadername, sizeof(uniform->varname));
}
- else if(input->tex) {
+ else if (input->tex) {
/* generated buffer */
uniform->texnumber = input->texid;
uniform->datatype = GPU_DATA_1I;
@@ -1772,7 +1773,7 @@ GPUShaderExport *GPU_shader_export(struct Scene *scene, struct Material *ma)
uniform->lamp = input->dynamicdata;
break;
case GPU_TEX2D:
- if(GPU_texture_opengl_bindcode(input->tex)) {
+ if (GPU_texture_opengl_bindcode(input->tex)) {
uniform->type = GPU_DYNAMIC_SAMPLER_2DBUFFER;
glGetIntegerv(GL_TEXTURE_BINDING_2D, &lastbindcode);
glBindTexture(GL_TEXTURE_2D, GPU_texture_opengl_bindcode(input->tex));
@@ -1808,19 +1809,19 @@ GPUShaderExport *GPU_shader_export(struct Scene *scene, struct Material *ma)
break;
}
- if(uniform->type >= GPU_DYNAMIC_LAMP_FIRST && uniform->type <= GPU_DYNAMIC_LAMP_LAST)
+ if (uniform->type >= GPU_DYNAMIC_LAMP_FIRST && uniform->type <= GPU_DYNAMIC_LAMP_LAST)
uniform->lamp = input->dynamicdata;
}
- if(uniform->type != GPU_DYNAMIC_NONE)
+ if (uniform->type != GPU_DYNAMIC_NONE)
BLI_addtail(&shader->uniforms, uniform);
else
MEM_freeN(uniform);
}
/* process builtin uniform */
- for(i=0; builtins[i].gputype; i++) {
- if(mat->builtins & builtins[i].gputype) {
+ for (i=0; builtins[i].gputype; i++) {
+ if (mat->builtins & builtins[i].gputype) {
uniform = MEM_callocN(sizeof(GPUInputUniform), "GPUInputUniform");
uniform->type = builtins[i].dynamictype;
uniform->datatype = builtins[i].datatype;
@@ -1834,13 +1835,13 @@ GPUShaderExport *GPU_shader_export(struct Scene *scene, struct Material *ma)
liblen = (pass->libcode) ? strlen(pass->libcode) : 0;
fraglen = strlen(pass->fragmentcode);
shader->fragment = (char *)MEM_mallocN(liblen+fraglen+1, "GPUFragShader");
- if(pass->libcode)
+ if (pass->libcode)
memcpy(shader->fragment, pass->libcode, liblen);
memcpy(&shader->fragment[liblen], pass->fragmentcode, fraglen);
shader->fragment[liblen+fraglen] = 0;
// export the attribute
- for(i=0; i<mat->attribs.totlayer; i++) {
+ for (i=0; i<mat->attribs.totlayer; i++) {
attribute = MEM_callocN(sizeof(GPUInputAttribute), "GPUInputAttribute");
attribute->type = mat->attribs.layer[i].type;
attribute->number = mat->attribs.layer[i].glindex;
@@ -1863,7 +1864,7 @@ GPUShaderExport *GPU_shader_export(struct Scene *scene, struct Material *ma)
break;
}
- if(attribute->datatype != GPU_DATA_NONE)
+ if (attribute->datatype != GPU_DATA_NONE)
BLI_addtail(&shader->attributes, attribute);
else
MEM_freeN(attribute);
@@ -1880,19 +1881,19 @@ void GPU_free_shader_export(GPUShaderExport *shader)
{
GPUInputUniform *uniform;
- if(shader == NULL)
+ if (shader == NULL)
return;
- for(uniform = shader->uniforms.first; uniform; uniform=uniform->next)
- if(uniform->texpixels)
+ for (uniform = shader->uniforms.first; uniform; uniform=uniform->next)
+ if (uniform->texpixels)
MEM_freeN(uniform->texpixels);
BLI_freelistN(&shader->uniforms);
BLI_freelistN(&shader->attributes);
- if(shader->vertex)
+ if (shader->vertex)
MEM_freeN(shader->vertex);
- if(shader->fragment)
+ if (shader->fragment)
MEM_freeN(shader->fragment);
MEM_freeN(shader);
diff --git a/source/blender/ikplugin/intern/iksolver_plugin.c b/source/blender/ikplugin/intern/iksolver_plugin.c
index 34656daaa19..41700b96acc 100644
--- a/source/blender/ikplugin/intern/iksolver_plugin.c
+++ b/source/blender/ikplugin/intern/iksolver_plugin.c
@@ -65,8 +65,8 @@ static void initialize_posetree(struct Object *UNUSED(ob), bPoseChannel *pchan_t
int a, t, segcount= 0, size, newsize, *oldparent, parent;
/* find IK constraint, and validate it */
- for(con= pchan_tip->constraints.first; con; con= con->next) {
- if(con->type==CONSTRAINT_TYPE_KINEMATIC) {
+ for (con= pchan_tip->constraints.first; con; con= con->next) {
+ if (con->type==CONSTRAINT_TYPE_KINEMATIC) {
data=(bKinematicConstraint*)con->data;
if (data->flag & CONSTRAINT_IK_AUTO) break;
if (data->tar==NULL) continue;
@@ -74,36 +74,36 @@ static void initialize_posetree(struct Object *UNUSED(ob), bPoseChannel *pchan_t
if ((con->flag & (CONSTRAINT_DISABLE|CONSTRAINT_OFF))==0 && (con->enforce != 0.0f)) break;
}
}
- if(con==NULL) return;
+ if (con==NULL) return;
/* exclude tip from chain? */
- if(!(data->flag & CONSTRAINT_IK_TIP))
+ if (!(data->flag & CONSTRAINT_IK_TIP))
pchan_tip= pchan_tip->parent;
/* Find the chain's root & count the segments needed */
- for (curchan = pchan_tip; curchan; curchan=curchan->parent){
+ for (curchan = pchan_tip; curchan; curchan=curchan->parent) {
pchan_root = curchan;
curchan->flag |= POSE_CHAIN; // don't forget to clear this
chanlist[segcount]=curchan;
segcount++;
- if(segcount==data->rootbone || segcount>255) break; // 255 is weak
+ if (segcount==data->rootbone || segcount>255) break; // 255 is weak
}
if (!segcount) return;
/* setup the chain data */
/* we make tree-IK, unless all existing targets are in this chain */
- for(tree= pchan_root->iktree.first; tree; tree= tree->next) {
- for(target= tree->targets.first; target; target= target->next) {
+ for (tree= pchan_root->iktree.first; tree; tree= tree->next) {
+ for (target= tree->targets.first; target; target= target->next) {
curchan= tree->pchan[target->tip];
- if(curchan->flag & POSE_CHAIN)
+ if (curchan->flag & POSE_CHAIN)
curchan->flag &= ~POSE_CHAIN;
else
break;
}
- if(target) break;
+ if (target) break;
}
/* create a target */
@@ -111,7 +111,7 @@ static void initialize_posetree(struct Object *UNUSED(ob), bPoseChannel *pchan_t
target->con= con;
pchan_tip->flag &= ~POSE_CHAIN;
- if(tree==NULL) {
+ if (tree==NULL) {
/* make new tree */
tree= MEM_callocN(sizeof(PoseTree), "posetree");
@@ -123,7 +123,7 @@ static void initialize_posetree(struct Object *UNUSED(ob), bPoseChannel *pchan_t
tree->pchan= MEM_callocN(segcount*sizeof(void*), "ik tree pchan");
tree->parent= MEM_callocN(segcount*sizeof(int), "ik tree parent");
- for(a=0; a<segcount; a++) {
+ for (a=0; a<segcount; a++) {
tree->pchan[a]= chanlist[segcount-a-1];
tree->parent[a]= a-1;
}
@@ -144,19 +144,19 @@ static void initialize_posetree(struct Object *UNUSED(ob), bPoseChannel *pchan_t
for (;t<tree->totchannel && tree->pchan[t]!=chanlist[segcount-a-1];t++);
if (t>=tree->totchannel)
break;
- for(; a<size && t<tree->totchannel && tree->pchan[t]==chanlist[segcount-a-1]; a++, t++);
+ for (; a<size && t<tree->totchannel && tree->pchan[t]==chanlist[segcount-a-1]; a++, t++);
}
segcount= segcount-a;
target->tip= tree->totchannel + segcount - 1;
if (segcount > 0) {
- for(parent = a - 1; parent < tree->totchannel; parent++)
- if(tree->pchan[parent] == chanlist[segcount-1]->parent)
+ for (parent = a - 1; parent < tree->totchannel; parent++)
+ if (tree->pchan[parent] == chanlist[segcount-1]->parent)
break;
/* shouldn't happen, but could with dependency cycles */
- if(parent == tree->totchannel)
+ if (parent == tree->totchannel)
parent = a - 1;
/* resize array */
@@ -172,7 +172,7 @@ static void initialize_posetree(struct Object *UNUSED(ob), bPoseChannel *pchan_t
MEM_freeN(oldparent);
/* add new pose channels at the end, in reverse order */
- for(a=0; a<segcount; a++) {
+ for (a=0; a<segcount; a++) {
tree->pchan[tree->totchannel+a]= chanlist[segcount-a-1];
tree->parent[tree->totchannel+a]= tree->totchannel+a-1;
}
@@ -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];
@@ -256,20 +256,20 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
iktree= MEM_mallocN(sizeof(void*)*tree->totchannel, "ik tree");
- for(a=0; a<tree->totchannel; a++) {
+ for (a=0; a<tree->totchannel; a++) {
pchan= tree->pchan[a];
bone= pchan->bone;
/* set DoF flag */
flag= 0;
- if(!(pchan->ikflag & BONE_IK_NO_XDOF) && !(pchan->ikflag & BONE_IK_NO_XDOF_TEMP))
+ if (!(pchan->ikflag & BONE_IK_NO_XDOF) && !(pchan->ikflag & BONE_IK_NO_XDOF_TEMP))
flag |= IK_XDOF;
- if(!(pchan->ikflag & BONE_IK_NO_YDOF) && !(pchan->ikflag & BONE_IK_NO_YDOF_TEMP))
+ if (!(pchan->ikflag & BONE_IK_NO_YDOF) && !(pchan->ikflag & BONE_IK_NO_YDOF_TEMP))
flag |= IK_YDOF;
- if(!(pchan->ikflag & BONE_IK_NO_ZDOF) && !(pchan->ikflag & BONE_IK_NO_ZDOF_TEMP))
+ if (!(pchan->ikflag & BONE_IK_NO_ZDOF) && !(pchan->ikflag & BONE_IK_NO_ZDOF_TEMP))
flag |= IK_ZDOF;
- if(tree->stretch && (pchan->ikstretch > 0.0f)) {
+ if (tree->stretch && (pchan->ikstretch > 0.0f)) {
flag |= IK_TRANS_YDOF;
hasstretch = 1;
}
@@ -277,7 +277,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
seg= iktree[a]= IK_CreateSegment(flag);
/* find parent */
- if(a == 0)
+ if (a == 0)
parent= NULL;
else
parent= iktree[tree->parent[a]];
@@ -334,7 +334,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
IK_SetStiffness(seg, IK_Y, pchan->stiffness[1]);
IK_SetStiffness(seg, IK_Z, pchan->stiffness[2]);
- if(tree->stretch && (pchan->ikstretch > 0.0f)) {
+ if (tree->stretch && (pchan->ikstretch > 0.0f)) {
float ikstretch = pchan->ikstretch*pchan->ikstretch;
IK_SetStiffness(seg, IK_TRANS_Y, MIN2(1.0f-ikstretch, 0.99f));
IK_SetLimit(seg, IK_TRANS_Y, 0.001, 1e10);
@@ -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);
@@ -377,10 +377,10 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
copy_m3_m4(goalrot, goal);
/* same for pole vector target */
- if(data->poletar) {
+ if (data->poletar) {
get_constraint_target_matrix(scene, target->con, 1, CONSTRAINT_OBTYPE_OBJECT, ob, rootmat, 1.0);
- if(data->flag & CONSTRAINT_IK_SETANGLE) {
+ if (data->flag & CONSTRAINT_IK_SETANGLE) {
/* don't solve IK when we are setting the pole angle */
break;
}
@@ -395,7 +395,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
resultblend= 1;
resultinf= target->con->enforce;
- if(data->flag & CONSTRAINT_IK_GETANGLE) {
+ if (data->flag & CONSTRAINT_IK_GETANGLE) {
poleangledata= data;
data->flag &= ~CONSTRAINT_IK_GETANGLE;
}
@@ -429,14 +429,14 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
iktarget= iktree[target->tip];
- if(data->weight != 0.0f) {
- if(poleconstrain)
+ if (data->weight != 0.0f) {
+ if (poleconstrain)
IK_SolverSetPoleVectorConstraint(solver, iktarget, goalpos,
polepos, data->poleangle, (poleangledata == data));
IK_SolverAddGoal(solver, iktarget, goalpos, data->weight);
}
- if((data->flag & CONSTRAINT_IK_ROT) && (data->orientweight != 0.0f))
- if((data->flag & CONSTRAINT_IK_AUTO)==0)
+ if ((data->flag & CONSTRAINT_IK_ROT) && (data->orientweight != 0.0f))
+ if ((data->flag & CONSTRAINT_IK_AUTO)==0)
IK_SolverAddGoalOrientation(solver, iktarget, goalrot,
data->orientweight);
}
@@ -444,27 +444,27 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
/* solve */
IK_Solve(solver, 0.0f, tree->iterations);
- if(poleangledata)
+ if (poleangledata)
poleangledata->poleangle= IK_SolverGetPoleAngle(solver);
IK_FreeSolver(solver);
/* gather basis changes */
tree->basis_change= MEM_mallocN(sizeof(float[3][3])*tree->totchannel, "ik basis change");
- if(hasstretch)
+ if (hasstretch)
ikstretch= MEM_mallocN(sizeof(float)*tree->totchannel, "ik stretch");
- for(a=0; a<tree->totchannel; a++) {
+ for (a=0; a<tree->totchannel; a++) {
IK_GetBasisChange(iktree[a], tree->basis_change[a]);
- if(hasstretch) {
+ if (hasstretch) {
/* have to compensate for scaling received from parent */
float parentstretch, stretch;
pchan= tree->pchan[a];
parentstretch= (tree->parent[a] >= 0)? ikstretch[tree->parent[a]]: 1.0f;
- if(tree->stretch && (pchan->ikstretch > 0.0f)) {
+ if (tree->stretch && (pchan->ikstretch > 0.0f)) {
float trans[3], length;
IK_GetTranslationChange(iktree[a], trans);
@@ -482,7 +482,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
mul_v3_fl(tree->basis_change[a][2], stretch);
}
- if(resultblend && resultinf!=1.0f) {
+ if (resultblend && resultinf!=1.0f) {
unit_m3(identity);
blend_m3_m3m3(tree->basis_change[a], identity,
tree->basis_change[a], resultinf);
@@ -492,15 +492,15 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
}
MEM_freeN(iktree);
- if(ikstretch) MEM_freeN(ikstretch);
+ if (ikstretch) MEM_freeN(ikstretch);
}
static void free_posetree(PoseTree *tree)
{
BLI_freelistN(&tree->targets);
- if(tree->pchan) MEM_freeN(tree->pchan);
- if(tree->parent) MEM_freeN(tree->parent);
- if(tree->basis_change) MEM_freeN(tree->basis_change);
+ if (tree->pchan) MEM_freeN(tree->pchan);
+ if (tree->parent) MEM_freeN(tree->parent);
+ if (tree->basis_change) MEM_freeN(tree->basis_change);
MEM_freeN(tree);
}
@@ -511,8 +511,8 @@ void iksolver_initialize_tree(struct Scene *UNUSED(scene), struct Object *ob, fl
{
bPoseChannel *pchan;
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if(pchan->constflag & PCHAN_HAS_IK) // flag is set on editing constraints
+ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ if (pchan->constflag & PCHAN_HAS_IK) // flag is set on editing constraints
initialize_posetree(ob, pchan); // will attach it to root!
}
ob->pose->flag &= ~POSE_WAS_REBUILT;
@@ -520,7 +520,7 @@ void iksolver_initialize_tree(struct Scene *UNUSED(scene), struct Object *ob, fl
void iksolver_execute_tree(struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, float ctime)
{
- while(pchan->iktree.first) {
+ while (pchan->iktree.first) {
PoseTree *tree= pchan->iktree.first;
int a;
@@ -529,8 +529,8 @@ void iksolver_execute_tree(struct Scene *scene, struct Object *ob, struct bPose
return;
/* 4. walk over the tree for regular solving */
- for(a=0; a<tree->totchannel; a++) {
- if(!(tree->pchan[a]->flag & POSE_DONE)) // successive trees can set the flag
+ for (a=0; a<tree->totchannel; a++) {
+ if (!(tree->pchan[a]->flag & POSE_DONE)) // successive trees can set the flag
where_is_pose_bone(scene, ob, tree->pchan[a], ctime, 1);
// tell blender that this channel was controlled by IK, it's cleared on each where_is_pose()
tree->pchan[a]->flag |= POSE_CHAIN;
@@ -539,12 +539,12 @@ 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 */
- for(a=0; a<tree->totchannel; a++) {
+ * we need to calculate the original differences first */
+ for (a=0; a<tree->totchannel; a++) {
make_dmats(tree->pchan[a]);
}
- for(a=0; a<tree->totchannel; a++) {
+ for (a=0; a<tree->totchannel; a++) {
/* sets POSE_DONE */
where_is_ik_bone(tree->pchan[a], tree->basis_change[a]);
}
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp
index 51f68d819d4..ccfe2eaa862 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.cpp
+++ b/source/blender/ikplugin/intern/itasc_plugin.cpp
@@ -198,7 +198,7 @@ struct IK_Scene
// delete scene first
if (scene)
delete scene;
- for(std::vector<IK_Target*>::iterator it = targets.begin(); it != targets.end(); ++it)
+ for (std::vector<IK_Target*>::iterator it = targets.begin(); it != targets.end(); ++it)
delete (*it);
targets.clear();
if (channels)
@@ -245,21 +245,21 @@ static int initialize_chain(Object *ob, bPoseChannel *pchan_tip, bConstraint *co
data=(bKinematicConstraint*)con->data;
/* exclude tip from chain? */
- if(!(data->flag & CONSTRAINT_IK_TIP))
+ if (!(data->flag & CONSTRAINT_IK_TIP))
pchan_tip= pchan_tip->parent;
rootbone = data->rootbone;
/* Find the chain's root & count the segments needed */
- for (curchan = pchan_tip; curchan; curchan=curchan->parent){
+ for (curchan = pchan_tip; curchan; curchan=curchan->parent) {
pchan_root = curchan;
if (++segcount > 255) // 255 is weak
break;
- if(segcount==rootbone){
+ if (segcount==rootbone) {
// reached this end of the chain but if the chain is overlapping with a
// previous one, we must go back up to the root of the other chain
- if ((curchan->flag & POSE_CHAIN) && curchan->iktree.first == NULL){
+ if ((curchan->flag & POSE_CHAIN) && curchan->iktree.first == NULL) {
rootbone++;
continue;
}
@@ -268,7 +268,7 @@ static int initialize_chain(Object *ob, bPoseChannel *pchan_tip, bConstraint *co
if (curchan->iktree.first != NULL)
// Oh oh, there is already a chain starting from this channel and our chain is longer...
- // Should handle this by moving the previous chain up to the begining of our chain
+ // Should handle this by moving the previous chain up to the beginning of our chain
// For now we just stop here
break;
}
@@ -289,7 +289,7 @@ static int initialize_chain(Object *ob, bPoseChannel *pchan_tip, bConstraint *co
// by contruction there can be only one tree per channel and each channel can be part of at most one tree.
tree = (PoseTree*)pchan_root->iktree.first;
- if(tree==NULL) {
+ if (tree==NULL) {
/* make new tree */
tree= (PoseTree*)MEM_callocN(sizeof(PoseTree), "posetree");
@@ -299,7 +299,7 @@ static int initialize_chain(Object *ob, bPoseChannel *pchan_tip, bConstraint *co
tree->pchan= (bPoseChannel**)MEM_callocN(segcount*sizeof(void*), "ik tree pchan");
tree->parent= (int*)MEM_callocN(segcount*sizeof(int), "ik tree parent");
- for(a=0; a<segcount; a++) {
+ for (a=0; a<segcount; a++) {
tree->pchan[a]= chanlist[segcount-a-1];
tree->parent[a]= a-1;
}
@@ -322,19 +322,19 @@ static int initialize_chain(Object *ob, bPoseChannel *pchan_tip, bConstraint *co
for (;t<tree->totchannel && tree->pchan[t]!=chanlist[segcount-a-1];t++);
if (t>=tree->totchannel)
break;
- for(; a<size && t<tree->totchannel && tree->pchan[t]==chanlist[segcount-a-1]; a++, t++);
+ for (; a<size && t<tree->totchannel && tree->pchan[t]==chanlist[segcount-a-1]; a++, t++);
}
segcount= segcount-a;
target->tip= tree->totchannel + segcount - 1;
if (segcount > 0) {
- for(parent = a - 1; parent < tree->totchannel; parent++)
- if(tree->pchan[parent] == chanlist[segcount-1]->parent)
+ for (parent = a - 1; parent < tree->totchannel; parent++)
+ if (tree->pchan[parent] == chanlist[segcount-1]->parent)
break;
/* shouldn't happen, but could with dependency cycles */
- if(parent == tree->totchannel)
+ if (parent == tree->totchannel)
parent = a - 1;
/* resize array */
@@ -350,7 +350,7 @@ static int initialize_chain(Object *ob, bPoseChannel *pchan_tip, bConstraint *co
MEM_freeN(oldparent);
/* add new pose channels at the end, in reverse order */
- for(a=0; a<segcount; a++) {
+ for (a=0; a<segcount; a++) {
tree->pchan[tree->totchannel+a]= chanlist[segcount-a-1];
tree->parent[tree->totchannel+a]= tree->totchannel+a-1;
}
@@ -401,8 +401,8 @@ int initialize_scene(Object *ob, bPoseChannel *pchan_tip)
/* find all IK constraints and validate them */
treecount = 0;
- for(con= (bConstraint *)pchan_tip->constraints.first; con; con= (bConstraint *)con->next) {
- if(con->type==CONSTRAINT_TYPE_KINEMATIC) {
+ for (con= (bConstraint *)pchan_tip->constraints.first; con; con= (bConstraint *)con->next) {
+ if (con->type==CONSTRAINT_TYPE_KINEMATIC) {
if (constraint_valid(con))
treecount += initialize_chain(ob, pchan_tip, con);
}
@@ -428,13 +428,14 @@ static double EulerAngleFromMatrix(const KDL::Rotation& R, int axis)
if (t > 16.0*KDL::epsilon) {
if (axis == 0) return -KDL::atan2(R(1,2), R(2,2));
- else if(axis == 1) return KDL::atan2(-R(0,2), t);
- else return -KDL::atan2(R(0,1), R(0,0));
- } else {
+ else if (axis == 1) return KDL::atan2(-R(0,2), t);
+ else return -KDL::atan2(R(0,1), R(0,0));
+ }
+ else {
if (axis == 0) return -KDL::atan2(-R(2,1), R(1,1));
- else if(axis == 1) return KDL::atan2(-R(0,2), t);
- else return 0.0f;
- }
+ else if (axis == 1) return KDL::atan2(-R(0,2), t);
+ else return 0.0f;
+ }
}
static double ComputeTwist(const KDL::Rotation& R)
@@ -473,27 +474,29 @@ static void RemoveEulerAngleFromMatrix(KDL::Rotation& R, double angle, int axis)
static void GetEulerXZY(const KDL::Rotation& R, double& X,double& Z,double& Y)
{
if (fabs(R(0,1)) > 1.0 - KDL::epsilon ) {
- X = -KDL::sign(R(0,1)) * KDL::atan2(R(1,2), R(1,0));
- Z = -KDL::sign(R(0,1)) * KDL::PI / 2;
- Y = 0.0;
- } else {
- X = KDL::atan2(R(2,1), R(1,1));
- Z = KDL::atan2(-R(0,1), KDL::sqrt( KDL::sqr(R(0,0)) + KDL::sqr(R(0,2))));
- Y = KDL::atan2(R(0,2), R(0,0));
- }
+ X = -KDL::sign(R(0,1)) * KDL::atan2(R(1,2), R(1,0));
+ Z = -KDL::sign(R(0,1)) * KDL::PI / 2;
+ Y = 0.0;
+ }
+ else {
+ X = KDL::atan2(R(2,1), R(1,1));
+ Z = KDL::atan2(-R(0,1), KDL::sqrt( KDL::sqr(R(0,0)) + KDL::sqr(R(0,2))));
+ Y = KDL::atan2(R(0,2), R(0,0));
+ }
}
static void GetEulerXYZ(const KDL::Rotation& R, double& X,double& Y,double& Z)
{
if (fabs(R(0,2)) > 1.0 - KDL::epsilon ) {
- X = KDL::sign(R(0,2)) * KDL::atan2(-R(1,0), R(1,1));
- Y = KDL::sign(R(0,2)) * KDL::PI / 2;
- Z = 0.0;
- } else {
- X = KDL::atan2(-R(1,2), R(2,2));
- Y = KDL::atan2(R(0,2), KDL::sqrt( KDL::sqr(R(0,0)) + KDL::sqr(R(0,1))));
- Z = KDL::atan2(-R(0,1), R(0,0));
- }
+ X = KDL::sign(R(0,2)) * KDL::atan2(-R(1,0), R(1,1));
+ Y = KDL::sign(R(0,2)) * KDL::PI / 2;
+ Z = 0.0;
+ }
+ else {
+ X = KDL::atan2(-R(1,2), R(2,2));
+ Y = KDL::atan2(R(0,2), KDL::sqrt( KDL::sqr(R(0,0)) + KDL::sqr(R(0,1))));
+ Z = KDL::atan2(-R(0,1), R(0,0));
+ }
}
#endif
@@ -691,7 +694,8 @@ static bool copypose_callback(const iTaSC::Timestamp& timestamp, iTaSC::Constrai
values->action = iTaSC::ACT_ALPHA;
values++;
}
- } else {
+ }
+ else {
if (iktarget->controlType & iTaSC::CopyPose::CTL_POSITION) {
// update error
values->alpha = condata->weight;
@@ -745,7 +749,8 @@ static bool distance_callback(const iTaSC::Timestamp& timestamp, iTaSC::Constrai
// update weight according to mode
if (iktarget->blenderConstraint->flag & CONSTRAINT_OFF) {
values->alpha = 0.0;
- } else {
+ }
+ else {
switch (condata->mode) {
case LIMITDIST_INSIDE:
values->alpha = (values->values[0].y > condata->dist) ? condata->weight : 0.0;
@@ -868,7 +873,7 @@ static int convert_channels(IK_Scene *ikscene, PoseTree *tree)
int a, flag, njoint;
njoint = 0;
- for(a=0, ikchan = ikscene->channels; a<ikscene->numchan; ++a, ++ikchan) {
+ for (a=0, ikchan = ikscene->channels; a<ikscene->numchan; ++a, ++ikchan) {
pchan= tree->pchan[a];
ikchan->pchan = pchan;
ikchan->parent = (a>0) ? tree->parent[a] : -1;
@@ -876,47 +881,46 @@ static int convert_channels(IK_Scene *ikscene, PoseTree *tree)
/* set DoF flag */
flag = 0;
- if(!(pchan->ikflag & BONE_IK_NO_XDOF) && !(pchan->ikflag & BONE_IK_NO_XDOF_TEMP) &&
+ if (!(pchan->ikflag & BONE_IK_NO_XDOF) && !(pchan->ikflag & BONE_IK_NO_XDOF_TEMP) &&
(!(pchan->ikflag & BONE_IK_XLIMIT) || pchan->limitmin[0]<0.f || pchan->limitmax[0]>0.f))
flag |= IK_XDOF;
- if(!(pchan->ikflag & BONE_IK_NO_YDOF) && !(pchan->ikflag & BONE_IK_NO_YDOF_TEMP) &&
+ if (!(pchan->ikflag & BONE_IK_NO_YDOF) && !(pchan->ikflag & BONE_IK_NO_YDOF_TEMP) &&
(!(pchan->ikflag & BONE_IK_YLIMIT) || pchan->limitmin[1]<0.f || pchan->limitmax[1]>0.f))
flag |= IK_YDOF;
- if(!(pchan->ikflag & BONE_IK_NO_ZDOF) && !(pchan->ikflag & BONE_IK_NO_ZDOF_TEMP) &&
+ if (!(pchan->ikflag & BONE_IK_NO_ZDOF) && !(pchan->ikflag & BONE_IK_NO_ZDOF_TEMP) &&
(!(pchan->ikflag & BONE_IK_ZLIMIT) || pchan->limitmin[2]<0.f || pchan->limitmax[2]>0.f))
flag |= IK_ZDOF;
- if(tree->stretch && (pchan->ikstretch > 0.0)) {
+ if (tree->stretch && (pchan->ikstretch > 0.0)) {
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:
@@ -990,14 +994,15 @@ static void convert_pose(IK_Scene *ikscene)
// assume uniform scaling and take Y scale as general scale for the armature
scale = len_v3(ikscene->blArmature->obmat[1]);
rot = &ikscene->jointArray(0);
- for(joint=a=0, ikchan = ikscene->channels; a<ikscene->numchan && joint<ikscene->numjoint; ++a, ++ikchan) {
+ for (joint=a=0, ikchan = ikscene->channels; a<ikscene->numchan && joint<ikscene->numjoint; ++a, ++ikchan) {
pchan= ikchan->pchan;
bone= pchan->bone;
if (pchan->parent) {
unit_m4(bmat);
mul_m4_m4m3(bmat, pchan->parent->pose_mat, bone->bone_mat);
- } else {
+ }
+ else {
copy_m4_m4(bmat, bone->arm_mat);
}
invert_m4_m4(rmat, bmat);
@@ -1030,7 +1035,7 @@ static void rest_pose(IK_Scene *ikscene)
SetToZero(ikscene->jointArray);
// except for transY joints
rot = &ikscene->jointArray(0);
- for(joint=a=0, ikchan = ikscene->channels; a<ikscene->numchan && joint<ikscene->numjoint; ++a, ++ikchan) {
+ for (joint=a=0, ikchan = ikscene->channels; a<ikscene->numchan && joint<ikscene->numjoint; ++a, ++ikchan) {
pchan= ikchan->pchan;
bone= pchan->bone;
@@ -1077,7 +1082,8 @@ static IK_Scene* convert_tree(Scene *blscene, Object *ob, bPoseChannel *pchan)
if (!ikparam) {
// you must have our own copy
ikparam = &DefIKParam;
- } else if (ingame) {
+ }
+ else if (ingame) {
// tweak the param when in game to have efficient stepping
// using fixed substep is not effecient since frames in the GE are often
// shorter than in animation => move to auto step automatically and set
@@ -1121,12 +1127,13 @@ static IK_Scene* convert_tree(Scene *blscene, Object *ob, bPoseChannel *pchan)
// in the GE, set the initial joint angle to match the current pose
// this will update the jointArray in ikscene
convert_pose(ikscene);
- } else {
+ }
+ else {
// in Blender, the rest pose is always 0 for joints
rest_pose(ikscene);
}
rot = &ikscene->jointArray(0);
- for(a=0, ikchan = ikscene->channels; a<tree->totchannel; ++a, ++ikchan) {
+ for (a=0, ikchan = ikscene->channels; a<tree->totchannel; ++a, ++ikchan) {
pchan= ikchan->pchan;
bone= pchan->bone;
@@ -1394,7 +1401,8 @@ static IK_Scene* convert_tree(Scene *blscene, Object *ob, bPoseChannel *pchan)
// move to the tail and scale to get rest pose of armature base
copy_v3_v3(baseFrame[3], pchan->bone->arm_tail);
invert_m4_m4(invBaseFrame, baseFrame);
- } else {
+ }
+ else {
unit_m4(invBaseFrame);
}
// finally add the constraint
@@ -1492,7 +1500,7 @@ static void create_scene(Scene *scene, Object *ob)
bPoseChannel *pchan;
// create the IK scene
- for(pchan= (bPoseChannel *)ob->pose->chanbase.first; pchan; pchan= (bPoseChannel *)pchan->next) {
+ for (pchan= (bPoseChannel *)ob->pose->chanbase.first; pchan; pchan= (bPoseChannel *)pchan->next) {
// by construction there is only one tree
PoseTree *tree = (PoseTree*)pchan->iktree.first;
if (tree) {
@@ -1507,9 +1515,9 @@ static void create_scene(Scene *scene, Object *ob)
while(tree) {
BLI_remlink(&pchan->iktree, tree);
BLI_freelistN(&tree->targets);
- if(tree->pchan) MEM_freeN(tree->pchan);
- if(tree->parent) MEM_freeN(tree->parent);
- if(tree->basis_change) MEM_freeN(tree->basis_change);
+ if (tree->pchan) MEM_freeN(tree->pchan);
+ if (tree->parent) MEM_freeN(tree->parent);
+ if (tree->basis_change) MEM_freeN(tree->basis_change);
MEM_freeN(tree);
tree = (PoseTree*)pchan->iktree.first;
}
@@ -1520,7 +1528,7 @@ static void create_scene(Scene *scene, Object *ob)
static void init_scene(Object *ob)
{
if (ob->pose->ikdata) {
- for(IK_Scene* scene = ((IK_Data*)ob->pose->ikdata)->first;
+ for (IK_Scene* scene = ((IK_Data*)ob->pose->ikdata)->first;
scene != NULL;
scene = scene->next) {
scene->channels[0].pchan->flag |= POSE_IKTREE;
@@ -1539,9 +1547,10 @@ static void execute_scene(Scene* blscene, IK_Scene* ikscene, bItasc* ikparam, fl
ikchan->pchan->flag |= (POSE_DONE|POSE_CHAIN);
ikchan->jointValid = 0;
}
- } else {
+ }
+ else {
// in animation mode, we must get the bone position from action and constraints
- for(i=0, ikchan=ikscene->channels; i<ikscene->numchan; i++, ++ikchan) {
+ for (i=0, ikchan=ikscene->channels; i<ikscene->numchan; i++, ++ikchan) {
if (!(ikchan->pchan->flag & POSE_DONE))
where_is_pose_bone(blscene, ikscene->blArmature, ikchan->pchan, ctime, 1);
// tell blender that this channel was controlled by IK, it's cleared on each where_is_pose()
@@ -1590,7 +1599,8 @@ static void execute_scene(Scene* blscene, IK_Scene* ikscene, bItasc* ikparam, fl
// the cache is empty before this time, reiterate
if (ikparam->flag & ITASC_INITIAL_REITERATION)
reiterate = true;
- } else {
+ }
+ else {
// can take the cache as a start point.
sts -= cts;
timestep = sts/1000.0;
@@ -1701,8 +1711,8 @@ void itasc_initialize_tree(struct Scene *scene, Object *ob, float ctime)
itasc_clear_data(ob->pose);
// we should handle all the constraint and mark them all disabled
// for blender but we'll start with the IK constraint alone
- for(pchan= (bPoseChannel *)ob->pose->chanbase.first; pchan; pchan= (bPoseChannel *)pchan->next) {
- if(pchan->constflag & PCHAN_HAS_IK)
+ for (pchan= (bPoseChannel *)ob->pose->chanbase.first; pchan; pchan= (bPoseChannel *)pchan->next) {
+ if (pchan->constflag & PCHAN_HAS_IK)
count += initialize_scene(ob, pchan);
}
// if at least one tree, create the scenes from the PoseTree stored in the channels
@@ -1781,7 +1791,8 @@ void itasc_update_param(struct bPose *pose)
ikscene->scene->setParam(iTaSC::Scene::MAX_TIMESTEP, ikparam->maxstep);
ikscene->solver->setParam(iTaSC::Solver::DLS_QMAX, ikparam->maxvel);
ikscene->armature->setControlParameter(CONSTRAINT_ID_ALL, iTaSC::Armature::ID_JOINT, iTaSC::ACT_FEEDBACK, ikparam->feedback);
- } else {
+ }
+ else {
// in animation mode timestep is 1s by convention =>
// qmax becomes radiant and feedback becomes fraction of error gap corrected in one iteration
ikscene->scene->setParam(iTaSC::Scene::MIN_TIMESTEP, 1.0);
diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt
index 4c8a79e6372..aa4454562b4 100644
--- a/source/blender/imbuf/CMakeLists.txt
+++ b/source/blender/imbuf/CMakeLists.txt
@@ -104,6 +104,10 @@ set(SRC
if(WITH_IMAGE_OPENEXR)
add_definitions(-DWITH_OPENEXR)
+else()
+ list(APPEND SRC
+ intern/openexr/openexr_stub.cpp
+ )
endif()
if(WITH_IMAGE_TIFF)
@@ -176,4 +180,10 @@ if(WITH_IMAGE_HDR)
add_definitions(-DWITH_HDR)
endif()
+if(WIN32)
+ list(APPEND INC
+ ../../../intern/utfconv
+ )
+endif()
+
blender_add_lib(bf_imbuf "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h
index ee1580a3135..a0c737b44fc 100644
--- a/source/blender/imbuf/IMB_imbuf.h
+++ b/source/blender/imbuf/IMB_imbuf.h
@@ -30,33 +30,32 @@
*/
/**
- * @file IMB_imbuf.h
- * @brief IMage Buffer module.
+ * \brief IMage Buffer module.
*
* This module offers import/export of several graphical file formats.
- * @ingroup imbuf
+ * \ingroup imbuf
*
- * @page IMB Imbuf module external interface
+ * \page IMB Imbuf module external interface
*
*
- * @section about About the IMB module
+ * \section about About the IMB module
*
* External interface of the IMage Buffer module. This module offers
* import/export of several graphical file formats. It offers the
* ImBuf type as a common structure to refer to different graphical
* file formats, and to enable a uniform way of handling them.
*
- * @section issues Known issues with IMB
+ * \section issues Known issues with IMB
*
* - imbuf is written in C.
* - Endianness issues are dealt with internally.
* - 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
+ * \section dependencies Dependencies
*
* IMB needs:
* - \ref DNA module
@@ -64,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.
*/
@@ -73,51 +72,51 @@
/**
*
- * @attention defined in ???
+ * \attention defined in ???
*/
struct ImBuf;
/**
*
- * @attention defined in ???
+ * \attention defined in ???
*/
struct anim;
/**
*
- * @attention Defined in allocimbuf.c
+ * \attention Defined in allocimbuf.c
*/
void IMB_init(void);
void IMB_exit(void);
/**
*
- * @attention Defined in readimage.c
+ * \attention Defined in readimage.c
*/
struct ImBuf *IMB_ibImageFromMemory(unsigned char *mem, size_t size,
int flags, const char *descr);
/**
*
- * @attention Defined in readimage.c
+ * \attention Defined in readimage.c
*/
struct ImBuf *IMB_testiffname(const char *filepath, int flags);
/**
*
- * @attention Defined in readimage.c
+ * \attention Defined in readimage.c
*/
struct ImBuf *IMB_loadiffname(const char *filepath, int flags);
/**
*
- * @attention Defined in allocimbuf.c
+ * \attention Defined in allocimbuf.c
*/
void IMB_freeImBuf(struct ImBuf *ibuf);
/**
*
- * @attention Defined in allocimbuf.c
+ * \attention Defined in allocimbuf.c
*/
struct ImBuf *IMB_allocImBuf(unsigned int x, unsigned int y,
unsigned char d, unsigned int flags);
@@ -128,7 +127,7 @@ struct ImBuf *IMB_allocImBuf(unsigned int x, unsigned int y,
* (to delete an imbuf you have to call freeImBuf as many times as it
* is referenced)
*
- * @attention Defined in allocimbuf.c
+ * \attention Defined in allocimbuf.c
*/
void IMB_refImBuf(struct ImBuf *ibuf);
@@ -136,20 +135,20 @@ struct ImBuf * IMB_makeSingleUser(struct ImBuf *ibuf);
/**
*
- * @attention Defined in allocimbuf.c
+ * \attention Defined in allocimbuf.c
*/
struct ImBuf *IMB_dupImBuf(struct ImBuf *ibuf1);
/**
*
- * @attention Defined in allocimbuf.c
+ * \attention Defined in allocimbuf.c
*/
short addzbufImBuf(struct ImBuf *ibuf);
short addzbuffloatImBuf(struct ImBuf *ibuf);
/**
*
- * @attention Defined in rectop.c
+ * \attention Defined in rectop.c
*/
typedef enum IMB_BlendMode {
@@ -181,23 +180,22 @@ void IMB_rectblend(struct ImBuf *dbuf, struct ImBuf *sbuf, int destx,
/**
*
- * @attention Defined in indexer.c
+ * \attention Defined in indexer.c
*/
typedef enum IMB_Timecode_Type {
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;
@@ -231,7 +229,7 @@ void IMB_anim_index_rebuild(struct IndexBuildContext *context,
void IMB_anim_index_rebuild_finish(struct IndexBuildContext *context, short stop);
/**
- * Return the length (in frames) of the given @a anim.
+ * Return the length (in frames) of the given \a anim.
*/
int IMB_anim_get_duration(struct anim *anim, IMB_Timecode_Type tc);
@@ -245,7 +243,7 @@ int IMB_anim_get_fps(struct anim * anim,
/**
*
- * @attention Defined in anim_movie.c
+ * \attention Defined in anim_movie.c
*/
struct anim *IMB_open_anim(const char *name, int ib_flags, int streamindex);
void IMB_close_anim(struct anim *anim);
@@ -254,7 +252,7 @@ void IMB_close_anim_proxies(struct anim *anim);
/**
*
- * @attention Defined in anim_movie.c
+ * \attention Defined in anim_movie.c
*/
int ismovie(const char *filepath);
@@ -263,7 +261,7 @@ int IMB_anim_get_preseek(struct anim *anim);
/**
*
- * @attention Defined in anim_movie.c
+ * \attention Defined in anim_movie.c
*/
struct ImBuf *IMB_anim_absolute(
@@ -273,20 +271,20 @@ struct ImBuf *IMB_anim_absolute(
/**
*
- * @attention Defined in anim_movie.c
+ * \attention Defined in anim_movie.c
* fetches a define previewframe, usually half way into the movie
*/
struct ImBuf *IMB_anim_previewframe(struct anim *anim);
/**
*
- * @attention Defined in anim_movie.c
+ * \attention Defined in anim_movie.c
*/
void IMB_free_anim(struct anim *anim);
/**
*
- * @attention Defined in filter.c
+ * \attention Defined in filter.c
*/
#define FILTER_MASK_NULL 0
@@ -304,7 +302,7 @@ struct ImBuf *IMB_getmipmap(struct ImBuf *ibuf, int level);
/**
*
- * @attention Defined in cache.c
+ * \attention Defined in cache.c
*/
void IMB_tile_cache_params(int totthread, int maxmem);
@@ -313,63 +311,63 @@ void IMB_tiles_to_rect(struct ImBuf *ibuf);
/**
*
- * @attention Defined in filter.c
+ * \attention Defined in filter.c
*/
void IMB_filtery(struct ImBuf *ibuf);
/**
*
- * @attention Defined in scaling.c
+ * \attention Defined in scaling.c
*/
struct ImBuf *IMB_onehalf(struct ImBuf *ibuf1);
/**
*
- * @attention Defined in scaling.c
+ * \attention Defined in scaling.c
*/
struct ImBuf *IMB_scaleImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int newy);
/**
*
- * @attention Defined in scaling.c
+ * \attention Defined in scaling.c
*/
struct ImBuf *IMB_scalefastImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int newy);
/**
*
- * @attention Defined in writeimage.c
+ * \attention Defined in writeimage.c
*/
short IMB_saveiff(struct ImBuf *ibuf, const char *filepath, int flags);
/**
*
- * @attention Defined in util.c
+ * \attention Defined in util.c
*/
int IMB_ispic(const char *name);
/**
*
- * @attention Defined in util.c
+ * \attention Defined in util.c
*/
int IMB_isanim(const char *name);
/**
*
- * @attention Defined in util.c
+ * \attention Defined in util.c
*/
int imb_get_anim_type(const char *name);
/**
*
- * @attention Defined in divers.c
+ * \attention Defined in divers.c
*/
void IMB_de_interlace(struct ImBuf *ibuf);
void IMB_interlace(struct ImBuf *ibuf);
/* 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 */
@@ -377,6 +375,7 @@ void IMB_float_from_rect_simple(struct ImBuf *ibuf); /* no profile conversion */
void IMB_convert_profile(struct ImBuf *ibuf, int profile);
float *IMB_float_profile_ensure(struct ImBuf *ibuf, int profile, int *alloc);
void IMB_color_to_bw(struct ImBuf *ibuf);
+void IMB_saturation(struct ImBuf *ibuf, float sat);
/* converting pixel buffers */
void IMB_buffer_byte_from_float(unsigned char *rect_to, const float *rect_from,
@@ -397,13 +396,13 @@ void IMB_buffer_float_clamp(float *buf, int width, int height);
* Change the ordering of the color bytes pointed to by rect from
* rgba to abgr. size * 4 color bytes are reordered.
*
- * @attention Defined in imageprocess.c
+ * \attention Defined in imageprocess.c
*/
void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf);
/**
*
- * @attention defined in imageprocess.c
+ * \attention defined in imageprocess.c
*/
void bicubic_interpolation(struct ImBuf *in, struct ImBuf *out, float u, float v, int xout, int yout);
void neareast_interpolation(struct ImBuf *in, struct ImBuf *out, float u, float v, int xout, int yout);
@@ -416,51 +415,51 @@ void bilinear_interpolation_color_wrap(struct ImBuf *in, unsigned char *col, flo
/**
*
- * @attention defined in readimage.c
- * @deprecated Only here for backwards compatibility of the
- * @deprecated plugin system.
+ * \attention defined in readimage.c
+ * \deprecated Only here for backwards compatibility of the
+ * \deprecated plugin system.
*/
struct ImBuf *IMB_loadifffile(int file, int flags, const char *descr);
/**
*
- * @attention defined in scaling.c
+ * \attention defined in scaling.c
*/
struct ImBuf *IMB_half_x(struct ImBuf *ibuf1);
/**
*
- * @attention defined in scaling.c
+ * \attention defined in scaling.c
*/
struct ImBuf *IMB_double_fast_x(struct ImBuf *ibuf1);
/**
*
- * @attention defined in scaling.c
+ * \attention defined in scaling.c
*/
struct ImBuf *IMB_double_x(struct ImBuf *ibuf1);
/**
*
- * @attention defined in scaling.c
+ * \attention defined in scaling.c
*/
struct ImBuf *IMB_half_y(struct ImBuf *ibuf1);
/**
*
- * @attention defined in scaling.c
+ * \attention defined in scaling.c
*/
struct ImBuf *IMB_double_fast_y(struct ImBuf *ibuf1);
/**
*
- * @attention defined in scaling.c
+ * \attention defined in scaling.c
*/
struct ImBuf *IMB_double_y(struct ImBuf *ibuf1);
/**
*
- * @attention Defined in rotate.c
+ * \attention Defined in rotate.c
*/
void IMB_flipx(struct ImBuf *ibuf);
void IMB_flipy(struct ImBuf *ibuf);
@@ -471,14 +470,14 @@ void IMB_premultiply_alpha(struct ImBuf *ibuf);
/**
*
- * @attention Defined in allocimbuf.c
+ * \attention Defined in allocimbuf.c
*/
void IMB_freezbufImBuf(struct ImBuf *ibuf);
void IMB_freezbuffloatImBuf(struct ImBuf *ibuf);
/**
*
- * @attention Defined in rectop.c
+ * \attention Defined in rectop.c
*/
void IMB_rectfill(struct ImBuf *drect, const float col[4]);
void IMB_rectfill_area(struct ImBuf *ibuf, float *col, int x1, int y1, int x2, int y2);
diff --git a/source/blender/imbuf/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/IMB_thumbs.h b/source/blender/imbuf/IMB_thumbs.h
index 49e90134d21..76c09ec1486 100644
--- a/source/blender/imbuf/IMB_thumbs.h
+++ b/source/blender/imbuf/IMB_thumbs.h
@@ -57,7 +57,7 @@ typedef enum ThumbSource {
THB_SOURCE_BLEND
} ThumbSource;
-/* dont generate thumbs for images bigger then this (100mb) */
+/* don't generate thumbs for images bigger then this (100mb) */
#define THUMB_SIZE_MAX (100 * 1024*1024)
// IB_metadata
diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript
index eae9665d23b..b2b526ca17d 100644
--- a/source/blender/imbuf/SConscript
+++ b/source/blender/imbuf/SConscript
@@ -17,9 +17,12 @@ defs = []
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
+ incs += ' ../../../intern/utfconv'
if env['WITH_BF_OPENEXR']:
defs.append('WITH_OPENEXR')
+else:
+ sources.append(os.path.join('intern', 'openexr', 'openexr_stub.cpp'))
if env['WITH_BF_TIFF']:
defs.append('WITH_TIFF')
diff --git a/source/blender/imbuf/intern/IMB_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 3ae1015d6af..336a5f95082 100644
--- a/source/blender/imbuf/intern/IMB_metadata.h
+++ b/source/blender/imbuf/intern/IMB_metadata.h
@@ -42,41 +42,41 @@ 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 */
void IMB_metadata_free(struct ImBuf* img);
/** read the field from the image info into the field
- * @param img - the ImBuf that contains the image data
- * @param key - the key of the field
- * @param value - the data in the field, first one found with key is returned,
- memory has to be allocated by user.
- * @param len - length of value buffer allocated by user.
- * @return - 1 (true) if ImageInfo present and value for the key found, 0 (false) otherwise
+ * \param img - the ImBuf that contains the image data
+ * \param key - the key of the field
+ * \param value - the data in the field, first one found with key is returned,
+ * memory has to be allocated by user.
+ * \param len - length of value buffer allocated by user.
+ * \return - 1 (true) if ImageInfo present and value for the key found, 0 (false) otherwise
*/
int IMB_metadata_get_field(struct ImBuf* img, const char* key, char* value, int len);
/** set user data in the ImMetaData struct, which has to be allocated with IMB_metadata_create
* before calling this function.
- * @param img - the ImBuf that contains the image data
- * @param key - the key of the field
- * @param value - the data to be written to the field. zero terminated string
- * @return - 1 (true) if ImageInfo present, 0 (false) otherwise
+ * \param img - the ImBuf that contains the image data
+ * \param key - the key of the field
+ * \param value - the data to be written to the field. zero terminated string
+ * \return - 1 (true) if ImageInfo present, 0 (false) otherwise
*/
int IMB_metadata_add_field(struct ImBuf* img, const char* key, const char* value);
/** delete the key/field par in the ImMetaData struct.
- * @param img - the ImBuf that contains the image data
- * @param key - the key of the field
- * @return - 1 (true) if delete the key/field, 0 (false) otherwise
+ * \param img - the ImBuf that contains the image data
+ * \param key - the key of the field
+ * \return - 1 (true) if delete the key/field, 0 (false) otherwise
*/
int IMB_metadata_del_field(struct ImBuf *img, const char *key);
diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c
index d85251a8ccb..2cfdd7bc324 100644
--- a/source/blender/imbuf/intern/allocimbuf.c
+++ b/source/blender/imbuf/intern/allocimbuf.c
@@ -51,8 +51,8 @@ void imb_freemipmapImBuf(ImBuf *ibuf)
{
int a;
- for(a=1; a<ibuf->miptot; a++) {
- if(ibuf->mipmap[a-1])
+ for (a=1; a<ibuf->miptot; a++) {
+ if (ibuf->mipmap[a-1])
IMB_freeImBuf(ibuf->mipmap[a-1]);
ibuf->mipmap[a-1]= NULL;
}
@@ -63,9 +63,9 @@ void imb_freemipmapImBuf(ImBuf *ibuf)
/* any free rect frees mipmaps to be sure, creation is in render on first request */
void imb_freerectfloatImBuf(ImBuf *ibuf)
{
- if(ibuf==NULL) return;
+ if (ibuf==NULL) return;
- if(ibuf->rect_float && (ibuf->mall & IB_rectfloat)) {
+ if (ibuf->rect_float && (ibuf->mall & IB_rectfloat)) {
MEM_freeN(ibuf->rect_float);
ibuf->rect_float=NULL;
}
@@ -79,9 +79,9 @@ void imb_freerectfloatImBuf(ImBuf *ibuf)
/* any free rect frees mipmaps to be sure, creation is in render on first request */
void imb_freerectImBuf(ImBuf *ibuf)
{
- if(ibuf==NULL) return;
+ if (ibuf==NULL) return;
- if(ibuf->rect && (ibuf->mall & IB_rect))
+ if (ibuf->rect && (ibuf->mall & IB_rect))
MEM_freeN(ibuf->rect);
ibuf->rect= NULL;
@@ -94,12 +94,12 @@ void imb_freetilesImBuf(ImBuf *ibuf)
{
int tx, ty;
- if(ibuf==NULL) return;
+ if (ibuf==NULL) return;
- if(ibuf->tiles && (ibuf->mall & IB_tiles)) {
- for(ty=0; ty<ibuf->ytiles; ty++) {
- for(tx=0; tx<ibuf->xtiles; tx++) {
- if(ibuf->tiles[ibuf->xtiles*ty + tx]) {
+ if (ibuf->tiles && (ibuf->mall & IB_tiles)) {
+ for (ty=0; ty<ibuf->ytiles; ty++) {
+ for (tx=0; tx<ibuf->xtiles; tx++) {
+ if (ibuf->tiles[ibuf->xtiles*ty + tx]) {
imb_tile_cache_tile_free(ibuf, tx, ty);
MEM_freeN(ibuf->tiles[ibuf->xtiles*ty + tx]);
}
@@ -115,9 +115,9 @@ void imb_freetilesImBuf(ImBuf *ibuf)
static void freeencodedbufferImBuf(ImBuf *ibuf)
{
- if(ibuf==NULL) return;
+ if (ibuf==NULL) return;
- if(ibuf->encodedbuffer && (ibuf->mall & IB_mem))
+ if (ibuf->encodedbuffer && (ibuf->mall & IB_mem))
MEM_freeN(ibuf->encodedbuffer);
ibuf->encodedbuffer = NULL;
@@ -128,9 +128,9 @@ static void freeencodedbufferImBuf(ImBuf *ibuf)
void IMB_freezbufImBuf(ImBuf *ibuf)
{
- if(ibuf==NULL) return;
+ if (ibuf==NULL) return;
- if(ibuf->zbuf && (ibuf->mall & IB_zbuf))
+ if (ibuf->zbuf && (ibuf->mall & IB_zbuf))
MEM_freeN(ibuf->zbuf);
ibuf->zbuf= NULL;
@@ -139,9 +139,9 @@ void IMB_freezbufImBuf(ImBuf *ibuf)
void IMB_freezbuffloatImBuf(ImBuf *ibuf)
{
- if(ibuf==NULL) return;
+ if (ibuf==NULL) return;
- if(ibuf->zbuf_float && (ibuf->mall & IB_zbuffloat))
+ if (ibuf->zbuf_float && (ibuf->mall & IB_zbuffloat))
MEM_freeN(ibuf->zbuf_float);
ibuf->zbuf_float= NULL;
@@ -150,8 +150,8 @@ void IMB_freezbuffloatImBuf(ImBuf *ibuf)
void IMB_freeImBuf(ImBuf *ibuf)
{
- if(ibuf) {
- if(ibuf->refcounter > 0) {
+ if (ibuf) {
+ if (ibuf->refcounter > 0) {
ibuf->refcounter--;
}
else {
@@ -189,12 +189,12 @@ short addzbufImBuf(ImBuf *ibuf)
{
int size;
- if(ibuf==NULL) return FALSE;
+ if (ibuf==NULL) return FALSE;
IMB_freezbufImBuf(ibuf);
size = ibuf->x *ibuf->y *sizeof(unsigned int);
- if((ibuf->zbuf = MEM_mapallocN(size, "addzbufImBuf"))) {
+ if ((ibuf->zbuf = MEM_mapallocN(size, "addzbufImBuf"))) {
ibuf->mall |= IB_zbuf;
ibuf->flags |= IB_zbuf;
return TRUE;
@@ -207,12 +207,12 @@ short addzbuffloatImBuf(ImBuf *ibuf)
{
int size;
- if(ibuf==NULL) return FALSE;
+ if (ibuf==NULL) return FALSE;
IMB_freezbuffloatImBuf(ibuf);
size = ibuf->x *ibuf->y *sizeof(float);
- if((ibuf->zbuf_float = MEM_mapallocN(size, "addzbuffloatImBuf"))) {
+ if ((ibuf->zbuf_float = MEM_mapallocN(size, "addzbuffloatImBuf"))) {
ibuf->mall |= IB_zbuffloat;
ibuf->flags |= IB_zbuffloat;
return TRUE;
@@ -224,16 +224,16 @@ short addzbuffloatImBuf(ImBuf *ibuf)
short imb_addencodedbufferImBuf(ImBuf *ibuf)
{
- if(ibuf==NULL) return FALSE;
+ if (ibuf==NULL) return FALSE;
freeencodedbufferImBuf(ibuf);
- if(ibuf->encodedbuffersize == 0)
+ if (ibuf->encodedbuffersize == 0)
ibuf->encodedbuffersize = 10000;
ibuf->encodedsize = 0;
- if((ibuf->encodedbuffer = MEM_mallocN(ibuf->encodedbuffersize, "addencodedbufferImBuf"))) {
+ if ((ibuf->encodedbuffer = MEM_mallocN(ibuf->encodedbuffersize, "addencodedbufferImBuf"))) {
ibuf->mall |= IB_mem;
ibuf->flags |= IB_mem;
return TRUE;
@@ -248,22 +248,23 @@ short imb_enlargeencodedbufferImBuf(ImBuf *ibuf)
unsigned int newsize, encodedsize;
void *newbuffer;
- if(ibuf==NULL) return FALSE;
+ if (ibuf==NULL) return FALSE;
- if(ibuf->encodedbuffersize < ibuf->encodedsize) {
+ if (ibuf->encodedbuffersize < ibuf->encodedsize) {
printf("imb_enlargeencodedbufferImBuf: error in parameters\n");
return FALSE;
}
newsize = 2 *ibuf->encodedbuffersize;
- if(newsize < 10000) newsize = 10000;
+ if (newsize < 10000) newsize = 10000;
newbuffer = MEM_mallocN(newsize, "enlargeencodedbufferImBuf");
- if(newbuffer == NULL) return FALSE;
+ if (newbuffer == NULL) return FALSE;
- if(ibuf->encodedbuffer) {
+ if (ibuf->encodedbuffer) {
memcpy(newbuffer, ibuf->encodedbuffer, ibuf->encodedsize);
- } else {
+ }
+ else {
ibuf->encodedsize = 0;
}
@@ -284,16 +285,16 @@ short imb_addrectfloatImBuf(ImBuf *ibuf)
{
int size;
- if(ibuf==NULL) return FALSE;
+ if (ibuf==NULL) return FALSE;
- if(ibuf->rect_float)
+ if (ibuf->rect_float)
imb_freerectfloatImBuf(ibuf); /* frees mipmap too, hrm */
size = ibuf->x *ibuf->y;
size = size *4 *sizeof(float);
ibuf->channels= 4;
- if((ibuf->rect_float = MEM_mapallocN(size, "imb_addrectfloatImBuf"))) {
+ if ((ibuf->rect_float = MEM_mapallocN(size, "imb_addrectfloatImBuf"))) {
ibuf->mall |= IB_rectfloat;
ibuf->flags |= IB_rectfloat;
return TRUE;
@@ -307,20 +308,20 @@ short imb_addrectImBuf(ImBuf *ibuf)
{
int size;
- if(ibuf==NULL) return FALSE;
+ if (ibuf==NULL) return FALSE;
/* don't call imb_freerectImBuf, it frees mipmaps, this call is used only too give float buffers display */
- if(ibuf->rect && (ibuf->mall & IB_rect))
+ if (ibuf->rect && (ibuf->mall & IB_rect))
MEM_freeN(ibuf->rect);
ibuf->rect= NULL;
size = ibuf->x*ibuf->y;
size = size*sizeof(unsigned int);
- if((ibuf->rect = MEM_mapallocN(size, "imb_addrectImBuf"))) {
+ if ((ibuf->rect = MEM_mapallocN(size, "imb_addrectImBuf"))) {
ibuf->mall |= IB_rect;
ibuf->flags |= IB_rect;
- if(ibuf->planes > 32) return (addzbufImBuf(ibuf));
+ if (ibuf->planes > 32) return (addzbufImBuf(ibuf));
else return TRUE;
}
@@ -329,10 +330,10 @@ short imb_addrectImBuf(ImBuf *ibuf)
short imb_addtilesImBuf(ImBuf *ibuf)
{
- if(ibuf==NULL) return FALSE;
+ if (ibuf==NULL) return FALSE;
- if(!ibuf->tiles)
- if((ibuf->tiles = MEM_callocN(sizeof(unsigned int*)*ibuf->xtiles*ibuf->ytiles, "imb_tiles")))
+ if (!ibuf->tiles)
+ if ((ibuf->tiles = MEM_callocN(sizeof(unsigned int*)*ibuf->xtiles*ibuf->ytiles, "imb_tiles")))
ibuf->mall |= IB_tiles;
return (ibuf->tiles != NULL);
@@ -344,7 +345,7 @@ ImBuf *IMB_allocImBuf(unsigned int x, unsigned int y, uchar planes, unsigned int
ibuf = MEM_callocN(sizeof(ImBuf), "ImBuf_struct");
- if(ibuf) {
+ if (ibuf) {
ibuf->x= x;
ibuf->y= y;
ibuf->planes= planes;
@@ -352,29 +353,29 @@ ImBuf *IMB_allocImBuf(unsigned int x, unsigned int y, uchar planes, unsigned int
ibuf->channels= 4; /* float option, is set to other values when buffers get assigned */
ibuf->ppm[0]= ibuf->ppm[1]= 150.0 / 0.0254; /* 150dpi -> pixels-per-meter */
- if(flags & IB_rect) {
- if(imb_addrectImBuf(ibuf)==FALSE) {
+ if (flags & IB_rect) {
+ if (imb_addrectImBuf(ibuf)==FALSE) {
IMB_freeImBuf(ibuf);
return NULL;
}
}
- if(flags & IB_rectfloat) {
- if(imb_addrectfloatImBuf(ibuf)==FALSE) {
+ if (flags & IB_rectfloat) {
+ if (imb_addrectfloatImBuf(ibuf)==FALSE) {
IMB_freeImBuf(ibuf);
return NULL;
}
}
- if(flags & IB_zbuf) {
- if(addzbufImBuf(ibuf)==FALSE) {
+ if (flags & IB_zbuf) {
+ if (addzbufImBuf(ibuf)==FALSE) {
IMB_freeImBuf(ibuf);
return NULL;
}
}
- if(flags & IB_zbuffloat) {
- if(addzbuffloatImBuf(ibuf)==FALSE) {
+ if (flags & IB_zbuffloat) {
+ if (addzbuffloatImBuf(ibuf)==FALSE) {
IMB_freeImBuf(ibuf);
return NULL;
}
@@ -390,27 +391,27 @@ ImBuf *IMB_dupImBuf(ImBuf *ibuf1)
int flags = 0;
int a, x, y;
- if(ibuf1 == NULL) return NULL;
+ if (ibuf1 == NULL) return NULL;
- if(ibuf1->rect) flags |= IB_rect;
- if(ibuf1->rect_float) flags |= IB_rectfloat;
+ if (ibuf1->rect) flags |= IB_rect;
+ if (ibuf1->rect_float) flags |= IB_rectfloat;
x = ibuf1->x;
y = ibuf1->y;
- if(ibuf1->flags & IB_fields) y *= 2;
+ if (ibuf1->flags & IB_fields) y *= 2;
ibuf2 = IMB_allocImBuf(x, y, ibuf1->planes, flags);
- if(ibuf2 == NULL) return NULL;
+ if (ibuf2 == NULL) return NULL;
- if(flags & IB_rect)
+ if (flags & IB_rect)
memcpy(ibuf2->rect, ibuf1->rect, x *y *sizeof(int));
- if(flags & IB_rectfloat)
+ if (flags & IB_rectfloat)
memcpy(ibuf2->rect_float, ibuf1->rect_float, ibuf1->channels *x *y *sizeof(float));
- if(ibuf1->encodedbuffer) {
+ if (ibuf1->encodedbuffer) {
ibuf2->encodedbuffersize = ibuf1->encodedbuffersize;
- if(imb_addencodedbufferImBuf(ibuf2) == FALSE) {
+ if (imb_addencodedbufferImBuf(ibuf2) == FALSE) {
IMB_freeImBuf(ibuf2);
return NULL;
}
@@ -427,7 +428,7 @@ ImBuf *IMB_dupImBuf(ImBuf *ibuf1)
tbuf.encodedbuffer = ibuf2->encodedbuffer;
tbuf.zbuf= NULL;
tbuf.zbuf_float= NULL;
- for(a=0; a<IB_MIPMAP_LEVELS; a++)
+ for (a=0; a<IB_MIPMAP_LEVELS; a++)
tbuf.mipmap[a]= NULL;
// set malloc flag
@@ -464,7 +465,7 @@ static MEM_CacheLimiterC **get_imbuf_cache_limiter(void)
{
static MEM_CacheLimiterC *c = NULL;
- if(!c)
+ if (!c)
c = new_MEM_CacheLimiter(imbuf_cache_destructor, NULL);
return &c;
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index 8722ca8e90a..01a9a0a7303 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -45,8 +45,12 @@
#undef AVIIF_KEYFRAME // redefined in AVI_avi.h
#undef AVIIF_LIST // redefined in AVI_avi.h
-#define FIXCC(fcc) if (fcc == 0) fcc = mmioFOURCC('N', 'o', 'n', 'e'); \
- if (fcc == BI_RLE8) fcc = mmioFOURCC('R', 'l', 'e', '8');
+#define FIXCC(fcc) \
+ { \
+ if (fcc == 0) { fcc = mmioFOURCC('N', 'o', 'n', 'e'); } \
+ if (fcc == BI_RLE8) { fcc = mmioFOURCC('R', 'l', 'e', '8'); } \
+ }
+
#endif
#include <sys/types.h>
@@ -61,7 +65,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"
@@ -135,21 +139,23 @@ static int an_stringdec(const char *string, char* head, char *tail, unsigned sho
len=strlen(string);
nume = len;
- for(i=len-1;i>=0;i--){
+ for (i=len-1;i>=0;i--) {
if (string[i]==PATHSEPERATOR) break;
if (isdigit(string[i])) {
- if (found){
+ if (found) {
nums=i;
- } else{
+ }
+ else {
nume=i;
nums=i;
found=TRUE;
}
- } else{
+ }
+ else {
if (found) break;
}
}
- if (found){
+ if (found) {
strcpy(tail ,&string[nume+1]);
strcpy(head, string);
head[nums]= '\0';
@@ -188,7 +194,7 @@ static void free_anim_avi (struct anim *anim)
anim->pgf = NULL;
}
- for (i = 0; i < anim->avistreams; i++){
+ for (i = 0; i < anim->avistreams; i++) {
AVIStreamRelease(anim->pavi[i]);
}
anim->avistreams = 0;
@@ -243,6 +249,9 @@ void IMB_close_anim(struct anim * anim)
void IMB_close_anim_proxies(struct anim *anim)
{
+ if (anim == NULL)
+ return;
+
IMB_free_indices(anim);
}
@@ -315,7 +324,8 @@ static int startavi (struct anim *anim)
lpbi = (LPBITMAPINFOHEADER)abFormat;
anim->avi->header->Height = lpbi->biHeight;
anim->avi->header->Width = lpbi->biWidth;
- } else {
+ }
+ else {
FIXCC(avis.fccHandler);
FIXCC(avis.fccType);
printf("Can't find AVI decoder for type : %4.4hs/%4.4hs\n",
@@ -333,11 +343,13 @@ static int startavi (struct anim *anim)
//
if ((anim->avistreams == 0) || (firstvideo == -1)) {
avierror = AVI_ERROR_FORMAT;
- } else {
+ }
+ else {
avierror = AVI_ERROR_NONE;
anim->firstvideo = firstvideo;
}
- } else {
+ }
+ else {
AVIFileExit();
}
}
@@ -386,7 +398,8 @@ static ImBuf * avi_fetchibuf (struct anim *anim, int position)
//Oh brother...
}
}
- } else {
+ }
+ else {
#else
if (1) {
#endif
@@ -442,11 +455,11 @@ static int startffmpeg(struct anim * anim)
do_init_ffmpeg();
- if(av_open_input_file(&pFormatCtx, anim->name, NULL, 0, NULL)!=0) {
+ if (av_open_input_file(&pFormatCtx, anim->name, NULL, 0, NULL)!=0) {
return -1;
}
- if(av_find_stream_info(pFormatCtx)<0) {
+ if (av_find_stream_info(pFormatCtx)<0) {
av_close_input_file(pFormatCtx);
return -1;
}
@@ -457,7 +470,7 @@ static int startffmpeg(struct anim * anim)
/* Find the video stream */
videoStream = -1;
- for(i = 0; i < pFormatCtx->nb_streams; i++)
+ for (i = 0; i < pFormatCtx->nb_streams; i++)
if (pFormatCtx->streams[i]->codec->codec_type
== AVMEDIA_TYPE_VIDEO) {
if (streamcount > 0) {
@@ -468,7 +481,7 @@ static int startffmpeg(struct anim * anim)
break;
}
- if(videoStream==-1) {
+ if (videoStream==-1) {
av_close_input_file(pFormatCtx);
return -1;
}
@@ -477,14 +490,14 @@ static int startffmpeg(struct anim * anim)
/* Find the decoder for the video stream */
pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
- if(pCodec == NULL) {
+ if (pCodec == NULL) {
av_close_input_file(pFormatCtx);
return -1;
}
pCodecCtx->workaround_bugs = 1;
- if(avcodec_open(pCodecCtx, pCodec) < 0) {
+ if (avcodec_open(pCodecCtx, pCodec) < 0) {
av_close_input_file(pFormatCtx);
return -1;
}
@@ -554,7 +567,8 @@ static int startffmpeg(struct anim * anim)
if (pCodecCtx->has_b_frames) {
anim->preseek = 25; /* FIXME: detect gopsize ... */
- } else {
+ }
+ else {
anim->preseek = 0;
}
@@ -588,7 +602,7 @@ static int startffmpeg(struct anim * anim)
srcRange = srcRange || anim->pCodecCtx->color_range == AVCOL_RANGE_JPEG;
inv_table = sws_getCoefficients(anim->pCodecCtx->colorspace);
- if(sws_setColorspaceDetails(anim->img_convert_ctx, (int *)inv_table, srcRange,
+ if (sws_setColorspaceDetails(anim->img_convert_ctx, (int *)inv_table, srcRange,
table, dstRange, brightness, contrast, saturation)) {
printf("Warning: Could not set libswscale colorspace details.\n");
@@ -603,10 +617,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,9 +635,9 @@ 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){
+ && input->data[2]==0 && input->data[3]==0) {
fprintf(stderr, "ffmpeg_fetchibuf: "
"data not read properly...\n");
return;
@@ -646,7 +660,8 @@ static void ffmpeg_postprocess(struct anim * anim)
anim->pCodecCtx->height)
< 0) {
filter_y = TRUE;
- } else {
+ }
+ else {
input = anim->pFrameDeinterlaced;
}
}
@@ -701,7 +716,8 @@ static void ffmpeg_postprocess(struct anim * anim)
}
top -= 8 * w;
}
- } else {
+ }
+ else {
int * dstStride = anim->pFrameRGB->linesize;
uint8_t** dst = anim->pFrameRGB->data;
int dstStride2[4] = { -dstStride[0], 0, 0, 0 };
@@ -735,7 +751,7 @@ static int ffmpeg_decode_video_frame(struct anim * anim)
anim->next_packet.stream_index = -1;
}
- while((rval = av_read_frame(anim->pFormatCtx, &anim->next_packet)) >= 0) {
+ while ((rval = av_read_frame(anim->pFormatCtx, &anim->next_packet)) >= 0) {
av_log(anim->pFormatCtx,
AV_LOG_DEBUG,
"%sREAD: strID=%d (VID: %d) dts=%lld pts=%lld "
@@ -821,7 +837,8 @@ static void ffmpeg_decode_video_frame_scan(
if (anim->next_pts == pts_to_search) {
av_log(anim->pFormatCtx,
AV_LOG_DEBUG, "SCAN HAPPY: we found our PTS!\n");
- } else {
+ }
+ else {
av_log(anim->pFormatCtx,
AV_LOG_ERROR, "SCAN UNHAPPY: PTS not matched!\n");
}
@@ -900,7 +917,8 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
tc_index, anim->curposition);
pts_to_search = IMB_indexer_get_pts(
tc_index, new_frame_index);
- } else {
+ }
+ else {
pts_to_search = (long long)
floor(((double) position)
/ pts_time_base / frame_rate + 0.5);
@@ -917,7 +935,7 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
(long long int)pts_to_search,pts_time_base, frame_rate, st_time);
if (anim->last_frame &&
- anim->last_pts <= pts_to_search && anim->next_pts > pts_to_search){
+ anim->last_pts <= pts_to_search && anim->next_pts > pts_to_search) {
av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"FETCH: frame repeat: last: %lld next: %lld\n",
(long long int)anim->last_pts,
@@ -935,7 +953,8 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
"FETCH: within preseek interval (no index)\n");
ffmpeg_decode_video_frame_scan(anim, pts_to_search);
- } else if (tc_index &&
+ }
+ else if (tc_index &&
IMB_indexer_can_scan(tc_index, old_frame_index,
new_frame_index)) {
@@ -944,7 +963,8 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
"(index tells us)\n");
ffmpeg_decode_video_frame_scan(anim, pts_to_search);
- } else if (position != anim->curposition + 1) {
+ }
+ else if (position != anim->curposition + 1) {
long long pos;
int ret;
@@ -969,14 +989,16 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
-1,
pos, AVSEEK_FLAG_BYTE);
av_update_cur_dts(anim->pFormatCtx, v_st, dts);
- } else {
+ }
+ else {
av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"... using DTS pos\n");
ret = av_seek_frame(anim->pFormatCtx,
anim->videoStream,
dts, AVSEEK_FLAG_BACKWARD);
}
- } else {
+ }
+ else {
pos = (long long) (position - anim->preseek)
* AV_TIME_BASE / frame_rate;
@@ -1021,10 +1043,12 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
if (ret >= 0) {
ffmpeg_decode_video_frame_scan(anim, pts_to_search);
}
- } else if (position == 0 && anim->curposition == -1) {
+ }
+ else if (position == 0 && anim->curposition == -1) {
/* first frame without seeking special case... */
ffmpeg_decode_video_frame(anim);
- } else {
+ }
+ else {
av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"FETCH: no seek necessary, just continue...\n");
}
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c
index 77fc6bdf856..768aa518742 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;
@@ -78,7 +78,8 @@ static int checkbmp(unsigned char *mem)
if ((mem[0] == 'B') && (mem[1] == 'M')) {
/* skip fileheader */
mem += BMP_FILEHEADER_SIZE;
- } else {
+ }
+ else {
}
/* for systems where an int needs to be 4 bytes aligned */
@@ -129,13 +130,17 @@ 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 {
+ }
+ else {
ibuf = IMB_allocImBuf(x, y, depth, IB_rect);
bmp = mem + skip;
rect = (unsigned char *) ibuf->rect;
@@ -151,7 +156,8 @@ struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags)
rect += 4; bmp += 2;
}
- } else if (depth == 24) {
+ }
+ else if (depth == 24) {
for (i = y; i > 0; i--) {
int j;
for (j = x ; j > 0; j--) {
@@ -165,7 +171,8 @@ struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags)
/* for 24-bit images, rows are padded to multiples of 4 */
bmp += x % 4;
}
- } else if (depth == 32) {
+ }
+ else if (depth == 32) {
for (i = x * y; i > 0; i--) {
rect[0] = bmp[2];
rect[1] = bmp[1];
@@ -213,7 +220,7 @@ int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags)
bytesize = (ibuf->x * 3 + extrabytes) * ibuf->y;
data = (uchar *) ibuf->rect;
- ofile = fopen(name,"wb");
+ ofile = BLI_fopen(name,"wb");
if (!ofile) return 0;
putShortLSB(19778,ofile); /* "BM" */
diff --git a/source/blender/imbuf/intern/cache.c b/source/blender/imbuf/intern/cache.c
index 7213979b500..ba9b118d185 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
@@ -106,8 +106,8 @@ static int imb_global_tile_cmp(const void *a_p, const void *b_p)
const ImGlobalTile *a= a_p;
const ImGlobalTile *b= b_p;
- if(a->ibuf == b->ibuf && a->tx == b->tx && a->ty == b->ty) return 0;
- else if(a->ibuf < b->ibuf || a->tx < b->tx || a->ty < b->ty) return -1;
+ if (a->ibuf == b->ibuf && a->tx == b->tx && a->ty == b->ty) return 0;
+ else if (a->ibuf < b->ibuf || a->tx < b->tx || a->ty < b->ty) return -1;
else return 1;
}
@@ -123,8 +123,8 @@ static int imb_thread_tile_cmp(const void *a_p, const void *b_p)
const ImThreadTile *a= a_p;
const ImThreadTile *b= b_p;
- if(a->ibuf == b->ibuf && a->tx == b->tx && a->ty == b->ty) return 0;
- else if(a->ibuf < b->ibuf || a->tx < b->tx || a->ty < b->ty) return -1;
+ if (a->ibuf == b->ibuf && a->tx == b->tx && a->ty == b->ty) return 0;
+ else if (a->ibuf < b->ibuf || a->tx < b->tx || a->ty < b->ty) return -1;
else return 1;
}
@@ -164,9 +164,9 @@ void imb_tile_cache_tile_free(ImBuf *ibuf, int tx, int ty)
lookuptile.ty = ty;
gtile= BLI_ghash_lookup(GLOBAL_CACHE.tilehash, &lookuptile);
- if(gtile) {
+ if (gtile) {
/* in case another thread is loading this */
- while(gtile->loading)
+ while (gtile->loading)
;
BLI_ghash_remove(GLOBAL_CACHE.tilehash, gtile, NULL, NULL);
@@ -189,7 +189,7 @@ static void imb_thread_cache_init(ImThreadTileCache *cache)
cache->tilehash= BLI_ghash_new(imb_thread_tile_hash, imb_thread_tile_cmp, "imb_thread_cache_init gh");
/* pre-allocate all thread local tiles in unused list */
- for(a=0; a<IB_THREAD_CACHE_SIZE; a++) {
+ for (a=0; a<IB_THREAD_CACHE_SIZE; a++) {
ttile= BLI_memarena_alloc(GLOBAL_CACHE.memarena, sizeof(ImThreadTile));
BLI_addtail(&cache->unused, ttile);
}
@@ -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;
@@ -218,17 +218,17 @@ void imb_tile_cache_exit(void)
ImGlobalTile *gtile;
int a;
- if(GLOBAL_CACHE.initialized) {
- for(gtile=GLOBAL_CACHE.tiles.first; gtile; gtile=gtile->next)
+ if (GLOBAL_CACHE.initialized) {
+ for (gtile=GLOBAL_CACHE.tiles.first; gtile; gtile=gtile->next)
imb_global_cache_tile_unload(gtile);
- for(a=0; a<GLOBAL_CACHE.totthread; a++)
+ for (a=0; a<GLOBAL_CACHE.totthread; a++)
imb_thread_cache_exit(&GLOBAL_CACHE.thread_cache[a]);
- if(GLOBAL_CACHE.memarena)
+ if (GLOBAL_CACHE.memarena)
BLI_memarena_free(GLOBAL_CACHE.memarena);
- if(GLOBAL_CACHE.tilehash)
+ if (GLOBAL_CACHE.tilehash)
BLI_ghash_free(GLOBAL_CACHE.tilehash, NULL, NULL);
BLI_mutex_end(&GLOBAL_CACHE.mutex);
@@ -246,7 +246,7 @@ void IMB_tile_cache_params(int totthread, int maxmem)
totthread++;
/* lazy initialize cache */
- if(GLOBAL_CACHE.totthread == totthread && GLOBAL_CACHE.maxmem == maxmem)
+ if (GLOBAL_CACHE.totthread == totthread && GLOBAL_CACHE.maxmem == maxmem)
return;
imb_tile_cache_exit();
@@ -261,7 +261,7 @@ void IMB_tile_cache_params(int totthread, int maxmem)
GLOBAL_CACHE.maxmem= maxmem*1024*1024;
GLOBAL_CACHE.totthread= totthread;
- for(a=0; a<totthread; a++)
+ for (a=0; a<totthread; a++)
imb_thread_cache_init(&GLOBAL_CACHE.thread_cache[a]);
BLI_mutex_init(&GLOBAL_CACHE.mutex);
@@ -275,7 +275,7 @@ static ImGlobalTile *imb_global_cache_get_tile(ImBuf *ibuf, int tx, int ty, ImGl
BLI_mutex_lock(&GLOBAL_CACHE.mutex);
- if(replacetile)
+ if (replacetile)
replacetile->refcount--;
/* find tile in global cache */
@@ -284,29 +284,29 @@ static ImGlobalTile *imb_global_cache_get_tile(ImBuf *ibuf, int tx, int ty, ImGl
lookuptile.ty = ty;
gtile= BLI_ghash_lookup(GLOBAL_CACHE.tilehash, &lookuptile);
- if(gtile) {
+ 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);
- while(gtile->loading)
+ while (gtile->loading)
;
}
else {
/* not found, let's load it from disk */
/* first check if we hit the memory limit */
- if(GLOBAL_CACHE.maxmem && GLOBAL_CACHE.totmem > GLOBAL_CACHE.maxmem) {
+ if (GLOBAL_CACHE.maxmem && GLOBAL_CACHE.totmem > GLOBAL_CACHE.maxmem) {
/* find an existing tile to unload */
- for(gtile=GLOBAL_CACHE.tiles.last; gtile; gtile=gtile->prev)
- if(gtile->refcount == 0 && gtile->loading == 0)
+ for (gtile=GLOBAL_CACHE.tiles.last; gtile; gtile=gtile->prev)
+ if (gtile->refcount == 0 && gtile->loading == 0)
break;
}
- if(gtile) {
+ if (gtile) {
/* found a tile to unload */
imb_global_cache_tile_unload(gtile);
BLI_ghash_remove(GLOBAL_CACHE.tilehash, gtile, NULL, NULL);
@@ -314,7 +314,7 @@ static ImGlobalTile *imb_global_cache_get_tile(ImBuf *ibuf, int tx, int ty, ImGl
}
else {
/* allocate a new tile or reuse unused */
- if(GLOBAL_CACHE.unused.first) {
+ if (GLOBAL_CACHE.unused.first) {
gtile= GLOBAL_CACHE.unused.first;
BLI_remlink(&GLOBAL_CACHE.unused, gtile);
}
@@ -356,9 +356,9 @@ static unsigned int *imb_thread_cache_get_tile(ImThreadTileCache *cache, ImBuf *
int toffs= ibuf->xtiles*ty + tx;
/* test if it is already in our thread local cache */
- if((ttile=cache->tiles.first)) {
+ if ((ttile=cache->tiles.first)) {
/* check last used tile before going to hash */
- if(ttile->ibuf == ibuf && ttile->tx == tx && ttile->ty == ty)
+ if (ttile->ibuf == ibuf && ttile->tx == tx && ttile->ty == ty)
return ibuf->tiles[toffs];
/* find tile in hash */
@@ -366,7 +366,7 @@ static unsigned int *imb_thread_cache_get_tile(ImThreadTileCache *cache, ImBuf *
lookuptile.tx = tx;
lookuptile.ty = ty;
- if((ttile=BLI_ghash_lookup(cache->tilehash, &lookuptile))) {
+ if ((ttile=BLI_ghash_lookup(cache->tilehash, &lookuptile))) {
BLI_remlink(&cache->tiles, ttile);
BLI_addhead(&cache->tiles, ttile);
@@ -375,7 +375,7 @@ static unsigned int *imb_thread_cache_get_tile(ImThreadTileCache *cache, ImBuf *
}
/* not found, have to do slow lookup in global cache */
- if(cache->unused.first == NULL) {
+ if (cache->unused.first == NULL) {
ttile= cache->tiles.last;
replacetile= ttile->global;
BLI_remlink(&cache->tiles, ttile);
@@ -412,12 +412,12 @@ void IMB_tiles_to_rect(ImBuf *ibuf)
unsigned int *to, *from;
int a, tx, ty, y, w, h;
- for(a=0; a<ibuf->miptot; a++) {
+ for (a=0; a<ibuf->miptot; a++) {
mipbuf= IMB_getmipmap(ibuf, a);
/* don't call imb_addrectImBuf, it frees all mipmaps */
- if(!mipbuf->rect) {
- if((mipbuf->rect = MEM_mapallocN(ibuf->x*ibuf->y*sizeof(unsigned int), "imb_addrectImBuf"))) {
+ if (!mipbuf->rect) {
+ if ((mipbuf->rect = MEM_mapallocN(ibuf->x*ibuf->y*sizeof(unsigned int), "imb_addrectImBuf"))) {
mipbuf->mall |= IB_rect;
mipbuf->flags |= IB_rect;
}
@@ -425,10 +425,10 @@ void IMB_tiles_to_rect(ImBuf *ibuf)
break;
}
- for(ty=0; ty<mipbuf->ytiles; ty++) {
- for(tx=0; tx<mipbuf->xtiles; tx++) {
+ 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 */
@@ -439,7 +439,7 @@ void IMB_tiles_to_rect(ImBuf *ibuf)
w= (tx == mipbuf->xtiles-1)? mipbuf->x - tx*mipbuf->tilex: mipbuf->tilex;
h= (ty == mipbuf->ytiles-1)? mipbuf->y - ty*mipbuf->tiley: mipbuf->tiley;
- for(y=0; y<h; y++) {
+ for (y=0; y<h; y++) {
memcpy(to, from, sizeof(unsigned int)*w);
from += mipbuf->tilex;
to += mipbuf->x;
diff --git a/source/blender/imbuf/intern/cineon/cineon_dpx.c b/source/blender/imbuf/intern/cineon/cineon_dpx.c
index af964bb2bb3..a7d168d42a2 100644
--- a/source/blender/imbuf/intern/cineon/cineon_dpx.c
+++ b/source/blender/imbuf/intern/cineon/cineon_dpx.c
@@ -72,7 +72,7 @@ static struct ImBuf *imb_load_dpx_cineon(unsigned char *mem, int use_cineon, int
int width, height, depth;
float *frow;
- logImageSetVerbose((G.f & G_DEBUG) ? 1:0);
+ logImageSetVerbose((G.debug & G_DEBUG) ? 1:0);
image = logImageOpenFromMem(mem, size, use_cineon);
@@ -149,12 +149,12 @@ static int imb_save_dpx_cineon(ImBuf *ibuf, const char *filename, int use_cineon
return 0;
}
- logImageSetVerbose((G.f & G_DEBUG) ? 1:0);
+ logImageSetVerbose((G.debug & G_DEBUG) ? 1:0);
logImage = logImageCreate(filename, use_cineon, width, height, depth);
if (!logImage) return 0;
- if(logImageSetByteConversion(logImage, &conversion)==0) {
+ if (logImageSetByteConversion(logImage, &conversion)==0) {
printf("error setting args\n");
}
@@ -184,7 +184,7 @@ static int imb_save_dpx_cineon(ImBuf *ibuf, const char *filename, int use_cineon
MEM_freeN(line);
- if(is_alloc) {
+ if (is_alloc) {
MEM_freeN(fbuf);
}
@@ -204,7 +204,7 @@ int imb_is_cineon(unsigned char *buf)
ImBuf *imb_loadcineon(unsigned char *mem, size_t size, int flags)
{
- if(imb_is_cineon(mem))
+ if (imb_is_cineon(mem))
return imb_load_dpx_cineon(mem, 1, size, flags);
return NULL;
}
@@ -221,7 +221,7 @@ int imb_is_dpx(unsigned char *buf)
ImBuf *imb_loaddpx(unsigned char *mem, size_t size, int flags)
{
- if(imb_is_dpx(mem))
+ if (imb_is_dpx(mem))
return imb_load_dpx_cineon(mem, 0, size, flags);
return NULL;
}
diff --git a/source/blender/imbuf/intern/cineon/cineonlib.c b/source/blender/imbuf/intern/cineon/cineonlib.c
index b4da39ac41e..ae9f8e0fe97 100644
--- a/source/blender/imbuf/intern/cineon/cineonlib.c
+++ b/source/blender/imbuf/intern/cineon/cineonlib.c
@@ -38,6 +38,7 @@
#include <string.h> /* memset */
#include "BLI_utildefines.h"
+#include "BLI_fileops.h"
#include "cin_debug_stuff.h"
#include "logmemfile.h"
@@ -135,7 +136,8 @@ fillCineonImageInfo(CineonFile* cineon, CineonImageInformation* imageInfo) {
if (cineon->depth == 1) {
fillCineonChannelInfo(cineon, &imageInfo->channel[0], 0);
- } else if (cineon->depth == 3) {
+ }
+ else if (cineon->depth == 3) {
fillCineonChannelInfo(cineon, &imageInfo->channel[0], 1);
fillCineonChannelInfo(cineon, &imageInfo->channel[1], 2);
fillCineonChannelInfo(cineon, &imageInfo->channel[2], 3);
@@ -214,7 +216,8 @@ dumpCineonFormatInfo(CineonFormatInformation* formatInfo) {
d_printf("Packing %d,", formatInfo->packing);
if (formatInfo->packing & 0x80) {
d_printf(" multi pixel,");
- } else {
+ }
+ else {
d_printf(" single pixel,");
}
switch (formatInfo->packing & 0x7F) {
@@ -230,13 +233,15 @@ dumpCineonFormatInfo(CineonFormatInformation* formatInfo) {
d_printf("Sign %d,", formatInfo->signage);
if (formatInfo->signage) {
d_printf(" signed\n");
- } else {
+ }
+ else {
d_printf(" unsigned\n");
}
d_printf("Sense %d,", formatInfo->signage);
if (formatInfo->signage) {
d_printf(" negative\n");
- } else {
+ }
+ else {
d_printf(" positive\n");
}
d_printf("End of line padding %ld\n", (intptr_t)ntohl(formatInfo->line_padding));
@@ -335,10 +340,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;
}
@@ -360,7 +366,7 @@ cineonGetRowBytes(CineonFile* cineon, unsigned short* row, int y) {
/* extract required pixels */
for (pixelIndex = 0; pixelIndex < numPixels; ++pixelIndex) {
- if(cineon->params.doLogarithm)
+ if (cineon->params.doLogarithm)
row[pixelIndex] = cineon->lut10_16[cineon->pixelBuffer[pixelIndex]];
else
row[pixelIndex] = cineon->pixelBuffer[pixelIndex] << 6;
@@ -379,7 +385,7 @@ cineonSetRowBytes(CineonFile* cineon, const unsigned short* row, int y) {
/* put new pixels into pixelBuffer */
for (pixelIndex = 0; pixelIndex < numPixels; ++pixelIndex) {
- if(cineon->params.doLogarithm)
+ if (cineon->params.doLogarithm)
cineon->pixelBuffer[pixelIndex] = cineon->lut16_16[row[pixelIndex]];
else
cineon->pixelBuffer[pixelIndex] = row[pixelIndex] >> 6;
@@ -522,7 +528,7 @@ cineonOpen(const char* filename) {
cineon->memcursor = 0;
cineon->membuffersize = 0;
- cineon->file = fopen(filename, "rb");
+ cineon->file = BLI_fopen(filename, "rb");
if (cineon->file == 0) {
if (verbose) d_printf("Failed to open file \"%s\".\n", filename);
cineonClose(cineon);
@@ -602,7 +608,8 @@ int cineonIsMemFileCineon(unsigned char *mem)
if (num != ntohl(CINEON_FILE_MAGIC)) {
return 0;
- } else return 1;
+ }
+ else return 1;
}
CineonFile*
@@ -726,7 +733,7 @@ cineonCreate(const char* filename, int width, int height, int depth) {
cineon->lineBuffer = 0;
cineon->pixelBuffer = 0;
- cineon->file = fopen(filename, "wb");
+ cineon->file = BLI_fopen(filename, "wb");
if (cineon->file == 0) {
if (verbose) d_printf("Couldn't open file %s\n", filename);
cineonClose(cineon);
@@ -761,7 +768,8 @@ cineonCreate(const char* filename, int width, int height, int depth) {
shortFilename = strrchr(filename, '/');
if (shortFilename == 0) {
shortFilename = filename;
- } else {
+ }
+ else {
++shortFilename;
}
diff --git a/source/blender/imbuf/intern/cineon/dpxlib.c b/source/blender/imbuf/intern/cineon/dpxlib.c
index a63a2ea1dab..c9b9901a495 100644
--- a/source/blender/imbuf/intern/cineon/dpxlib.c
+++ b/source/blender/imbuf/intern/cineon/dpxlib.c
@@ -38,6 +38,7 @@
#include <string.h> /* memset */
#include "cin_debug_stuff.h"
#include "logmemfile.h"
+#include "BLI_fileops.h"
static void
fillDpxChannelInfo(DpxFile* dpx, DpxChannelInformation* chan, int des) {
@@ -141,7 +142,8 @@ fillDpxImageInfo(
if (dpx->depth == 1) {
fillDpxChannelInfo(dpx, &imageInfo->channel[0], 0);
- } else if (dpx->depth == 3) {
+ }
+ else if (dpx->depth == 3) {
fillDpxChannelInfo(dpx, &imageInfo->channel[0], 50);
}
}
@@ -269,7 +271,8 @@ dpxGetRowBytes(DpxFile* dpx, unsigned short* row, int y) {
dpx->pixelBuffer[pixelIndex+2] = t & 0x3ff;
pixelIndex += 3;
}
- } else /* if (dpx->depth == 3) */ {
+ }
+ else /* if (dpx->depth == 3) */ {
for (longIndex = 0; longIndex < readLongs; ++longIndex) {
unsigned int t = ntohl(dpx->lineBuffer[longIndex]);
t = t >> 2;
@@ -285,7 +288,7 @@ dpxGetRowBytes(DpxFile* dpx, unsigned short* row, int y) {
/* extract required pixels */
for (pixelIndex = 0; pixelIndex < numPixels; ++pixelIndex) {
- if(dpx->params.doLogarithm)
+ if (dpx->params.doLogarithm)
row[pixelIndex] = dpx->lut10_16[dpx->pixelBuffer[pixelIndex]];
else
row[pixelIndex] = dpx->pixelBuffer[pixelIndex] << 6;
@@ -328,7 +331,7 @@ dpxSetRowBytes(DpxFile* dpx, const unsigned short* row, int y) {
/* put new pixels into pixelBuffer */
for (pixelIndex = 0; pixelIndex < numPixels; ++pixelIndex) {
- if(dpx->params.doLogarithm)
+ if (dpx->params.doLogarithm)
dpx->pixelBuffer[dpx->pixelBufferUsed + pixelIndex] = dpx->lut16_16[row[pixelIndex]];
else
dpx->pixelBuffer[dpx->pixelBufferUsed + pixelIndex] = row[pixelIndex] >> 6;
@@ -350,7 +353,8 @@ dpxSetRowBytes(DpxFile* dpx, const unsigned short* row, int y) {
dpx->lineBuffer[longIndex] = htonl(t);
pixelIndex += 3;
}
- } else {
+ }
+ else {
for (longIndex = 0; longIndex < writeLongs; ++longIndex) {
unsigned int t = dpx->pixelBuffer[pixelIndex+2] << 2 |
(dpx->pixelBuffer[pixelIndex+1] << 12) |
@@ -401,7 +405,7 @@ intern_dpxOpen(int mode, const char* bytestuff, int bufsize) {
if (mode == LFREALFILE) {
filename = bytestuff;
- dpx->file = fopen(filename, "rb");
+ dpx->file = BLI_fopen(filename, "rb");
if (dpx->file == 0) {
if (verbose) d_printf("Failed to open file \"%s\".\n", filename);
dpxClose(dpx);
@@ -410,7 +414,8 @@ intern_dpxOpen(int mode, const char* bytestuff, int bufsize) {
dpx->membuffer = 0;
dpx->memcursor = 0;
dpx->membuffersize = 0;
- } else if (mode == LFMEMFILE) {
+ }
+ else if (mode == LFMEMFILE) {
dpx->membuffer = (unsigned char *)bytestuff;
dpx->memcursor = (unsigned char *)bytestuff;
dpx->membuffersize = bufsize;
@@ -589,7 +594,7 @@ dpxCreate(const char* filename, int width, int height, int depth) {
dpx->lineBuffer = 0;
dpx->pixelBuffer = 0;
- dpx->file = fopen(filename, "wb");
+ dpx->file = BLI_fopen(filename, "wb");
if (dpx->file == 0) {
if (verbose) d_printf("Couldn't open file %s\n", filename);
dpxClose(dpx);
@@ -624,7 +629,8 @@ dpxCreate(const char* filename, int width, int height, int depth) {
shortFilename = strrchr(filename, '/');
if (shortFilename == 0) {
shortFilename = filename;
- } else {
+ }
+ else {
++shortFilename;
}
initDpxMainHeader(dpx, &header, shortFilename);
@@ -687,7 +693,7 @@ dpxDump(const char* filename) {
DpxMainHeader header;
FILE* file;
- file = fopen(filename, "rb");
+ file = BLI_fopen(filename, "rb");
if (file == 0) {
d_printf("Failed to open file \"%s\".\n", filename);
return;
diff --git a/source/blender/imbuf/intern/cineon/logImageLib.c b/source/blender/imbuf/intern/cineon/logImageLib.c
index 123d0b42979..f97df005fc8 100644
--- a/source/blender/imbuf/intern/cineon/logImageLib.c
+++ b/source/blender/imbuf/intern/cineon/logImageLib.c
@@ -36,6 +36,7 @@
#include <netinet/in.h> /* htonl() */
#endif
#include <string.h> /* memset */
+#include "BLI_fileops.h"
#define MIN_GAMMA 0.01
#define MAX_GAMMA 99.9
@@ -55,7 +56,8 @@ logImageOpen(const char* filename, int cineon)
{
if (cineon) {
return cineonOpen(filename);
- } else {
+ }
+ else {
return dpxOpen(filename);
}
return 0;
@@ -66,7 +68,8 @@ logImageOpenFromMem(unsigned char *buffer, unsigned int size, int cineon)
{
if (cineon) {
return cineonOpenFromMem(buffer, size);
- } else {
+ }
+ else {
return dpxOpenFromMem(buffer, size);
}
return 0;
@@ -77,7 +80,8 @@ logImageCreate(const char* filename, int cineon, int width, int height, int dept
{
if (cineon) {
return cineonCreate(filename, width, height, depth);
- } else {
+ }
+ else {
return dpxCreate(filename, width, height, depth);
}
return 0;
@@ -154,7 +158,7 @@ logImageDump(const char* filename)
U32 magic;
- FILE* foo = fopen(filename, "rb");
+ FILE* foo = BLI_fopen(filename, "rb");
if (foo == 0) {
return;
}
@@ -170,7 +174,8 @@ logImageDump(const char* filename)
#if 0
cineonDump(filename);
#endif
- } else if (magic == ntohl(DPX_FILE_MAGIC)) {
+ }
+ else if (magic == ntohl(DPX_FILE_MAGIC)) {
dpxDump(filename);
}
}
diff --git a/source/blender/imbuf/intern/cineon/logmemfile.c b/source/blender/imbuf/intern/cineon/logmemfile.c
index d3a32774efd..3db4241cc14 100644
--- a/source/blender/imbuf/intern/cineon/logmemfile.c
+++ b/source/blender/imbuf/intern/cineon/logmemfile.c
@@ -39,10 +39,12 @@ int logimage_fseek(void* logfile, intptr_t offsett, int origin)
if (origin==SEEK_SET) {
if (offset > file->membuffersize) return 1;
file->memcursor = file->membuffer + offset;
- } else if (origin==SEEK_END) {
+ }
+ else if (origin==SEEK_END) {
if (offset > file->membuffersize) return 1;
file->memcursor = (file->membuffer + file->membuffersize) - offset;
- } else if (origin==SEEK_CUR) {
+ }
+ else if (origin==SEEK_CUR) {
uintptr_t pos = (uintptr_t)file->membuffer - (uintptr_t)file->memcursor;
if (pos + offset > file->membuffersize) return 1;
if (pos < 0) return 1;
@@ -68,8 +70,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/BlockDXT.cpp b/source/blender/imbuf/intern/dds/BlockDXT.cpp
index 2ea255234e5..f5e9e536e41 100644
--- a/source/blender/imbuf/intern/dds/BlockDXT.cpp
+++ b/source/blender/imbuf/intern/dds/BlockDXT.cpp
@@ -90,7 +90,7 @@ uint BlockDXT1::evaluatePalette(Color32 color_array[4]) const
// c.u |= (c.u >> 6) & 0x000300;
// color_array[1].u = c.u;
- if( col0.u > col1.u ) {
+ if ( col0.u > col1.u ) {
// Four-color block: derive the other two colors.
color_array[2].r = (2 * color_array[0].r + color_array[1].r) / 3;
color_array[2].g = (2 * color_array[0].g + color_array[1].g) / 3;
@@ -135,27 +135,27 @@ uint BlockDXT1::evaluatePaletteNV5x(Color32 color_array[4]) const
color_array[1].b = (3 * col1.b * 22) / 8;
color_array[1].a = 0xFF;
- int gdiff = color_array[1].g - color_array[0].g;
+ int gdiff = color_array[1].g - color_array[0].g;
- if( col0.u > col1.u ) {
+ if ( col0.u > col1.u ) {
// Four-color block: derive the other two colors.
- color_array[2].r = ((2 * col0.r + col1.r) * 22) / 8;
- color_array[2].g = (256 * color_array[0].g + gdiff / 4 + 128 + gdiff * 80) / 256;
- color_array[2].b = ((2 * col0.b + col1.b) * 22) / 8;
+ color_array[2].r = ((2 * col0.r + col1.r) * 22) / 8;
+ color_array[2].g = (256 * color_array[0].g + gdiff / 4 + 128 + gdiff * 80) / 256;
+ color_array[2].b = ((2 * col0.b + col1.b) * 22) / 8;
color_array[2].a = 0xFF;
- color_array[3].r = ((2 * col1.r + col0.r) * 22) / 8;
- color_array[3].g = (256 * color_array[1].g - gdiff / 4 + 128 - gdiff * 80) / 256;
- color_array[3].b = ((2 * col1.b + col0.b) * 22) / 8;
+ color_array[3].r = ((2 * col1.r + col0.r) * 22) / 8;
+ color_array[3].g = (256 * color_array[1].g - gdiff / 4 + 128 - gdiff * 80) / 256;
+ color_array[3].b = ((2 * col1.b + col0.b) * 22) / 8;
color_array[3].a = 0xFF;
return 4;
}
else {
// Three-color block: derive the other color.
- color_array[2].r = ((col0.r + col1.r) * 33) / 8;
- color_array[2].g = (256 * color_array[0].g + gdiff / 4 + 128 + gdiff * 128) / 256;
- color_array[2].b = ((col0.b + col1.b) * 33) / 8;
+ color_array[2].r = ((col0.r + col1.r) * 33) / 8;
+ color_array[2].g = (256 * color_array[0].g + gdiff / 4 + 128 + gdiff * 128) / 256;
+ color_array[2].b = ((col0.b + col1.b) * 33) / 8;
color_array[2].a = 0xFF;
// Set all components to 0 to match DXT specs.
@@ -227,8 +227,8 @@ void BlockDXT1::decodeBlock(ColorBlock * block) const
evaluatePalette(color_array);
// Write color block.
- for( uint j = 0; j < 4; j++ ) {
- for( uint i = 0; i < 4; i++ ) {
+ for ( uint j = 0; j < 4; j++ ) {
+ for ( uint i = 0; i < 4; i++ ) {
uint idx = (row[j] >> (2 * i)) & 3;
block->color(i, j) = color_array[idx];
}
@@ -242,8 +242,8 @@ void BlockDXT1::decodeBlockNV5x(ColorBlock * block) const
evaluatePaletteNV5x(color_array);
// Write color block.
- for( uint j = 0; j < 4; j++ ) {
- for( uint i = 0; i < 4; i++ ) {
+ for ( uint j = 0; j < 4; j++ ) {
+ for ( uint i = 0; i < 4; i++ ) {
uint idx = (row[j] >> (2 * i)) & 3;
block->color(i, j) = color_array[idx];
}
@@ -253,7 +253,7 @@ void BlockDXT1::decodeBlockNV5x(ColorBlock * block) const
void BlockDXT1::setIndices(int * idx)
{
indices = 0;
- for(uint i = 0; i < 16; i++) {
+ for (uint i = 0; i < 16; i++) {
indices |= (idx[i] & 3) << (2 * i);
}
}
@@ -423,7 +423,7 @@ void AlphaBlockDXT5::decodeBlock(ColorBlock * block) const
uint8 index_array[16];
indices(index_array);
- for(uint i = 0; i < 16; i++) {
+ for (uint i = 0; i < 16; i++) {
block->color(i).a = alpha_array[index_array[i]];
}
}
@@ -496,7 +496,7 @@ void BlockATI1::decodeBlock(ColorBlock * block) const
uint8 index_array[16];
alpha.indices(index_array);
- for(uint i = 0; i < 16; i++) {
+ for (uint i = 0; i < 16; i++) {
Color32 & c = block->color(i);
c.b = c.g = c.r = alpha_array[index_array[i]];
c.a = 255;
@@ -525,7 +525,7 @@ void BlockATI2::decodeBlock(ColorBlock * block) const
x.evaluatePalette(alpha_array);
x.indices(index_array);
- for(uint i = 0; i < 16; i++) {
+ for (uint i = 0; i < 16; i++) {
Color32 & c = block->color(i);
c.r = alpha_array[index_array[i]];
}
@@ -533,7 +533,7 @@ void BlockATI2::decodeBlock(ColorBlock * block) const
y.evaluatePalette(alpha_array);
y.indices(index_array);
- for(uint i = 0; i < 16; i++) {
+ for (uint i = 0; i < 16; i++) {
Color32 & c = block->color(i);
c.g = alpha_array[index_array[i]];
c.b = 0;
@@ -587,8 +587,8 @@ void BlockCTX1::decodeBlock(ColorBlock * block) const
evaluatePalette(color_array);
// Write color block.
- for( uint j = 0; j < 4; j++ ) {
- for( uint i = 0; i < 4; i++ ) {
+ for ( uint j = 0; j < 4; j++ ) {
+ for ( uint i = 0; i < 4; i++ ) {
uint idx = (row[j] >> (2 * i)) & 3;
block->color(i, j) = color_array[idx];
}
@@ -598,7 +598,7 @@ void BlockCTX1::decodeBlock(ColorBlock * block) const
void BlockCTX1::setIndices(int * idx)
{
indices = 0;
- for(uint i = 0; i < 16; i++) {
+ for (uint i = 0; i < 16; i++) {
indices |= (idx[i] & 3) << (2 * i);
}
}
diff --git a/source/blender/imbuf/intern/dds/ColorBlock.cpp b/source/blender/imbuf/intern/dds/ColorBlock.cpp
index b0c4d0a396e..42ef799cf3e 100644
--- a/source/blender/imbuf/intern/dds/ColorBlock.cpp
+++ b/source/blender/imbuf/intern/dds/ColorBlock.cpp
@@ -59,7 +59,7 @@ ColorBlock::ColorBlock()
/// Init the color block from an array of colors.
ColorBlock::ColorBlock(const uint * linearImage)
{
- for(uint i = 0; i < 16; i++) {
+ for (uint i = 0; i < 16; i++) {
color(i) = Color32(linearImage[i]);
}
}
@@ -67,7 +67,7 @@ ColorBlock::ColorBlock(const uint * linearImage)
/// Init the color block with the contents of the given block.
ColorBlock::ColorBlock(const ColorBlock & block)
{
- for(uint i = 0; i < 16; i++) {
+ for (uint i = 0; i < 16; i++) {
color(i) = block.color(i);
}
}
@@ -81,7 +81,7 @@ ColorBlock::ColorBlock(const Image * img, uint x, uint y)
void ColorBlock::init(const Image * img, uint x, uint y)
{
- init(img->width(), img->height(), (const uint *)img->pixels(), x, y);
+ init(img->width(), img->height(), (const uint *)img->pixels(), x, y);
}
void ColorBlock::init(uint w, uint h, const uint * data, uint x, uint y)
@@ -89,34 +89,34 @@ void ColorBlock::init(uint w, uint h, const uint * data, uint x, uint y)
const uint bw = min(w - x, 4U);
const uint bh = min(h - y, 4U);
- // Blocks that are smaller than 4x4 are handled by repeating the pixels.
- // @@ Thats only correct when block size is 1, 2 or 4, but not with 3. :(
- // @@ Ideally we should zero the weights of the pixels out of range.
+ // Blocks that are smaller than 4x4 are handled by repeating the pixels.
+ // @@ Thats only correct when block size is 1, 2 or 4, but not with 3. :(
+ // @@ Ideally we should zero the weights of the pixels out of range.
- for (uint i = 0; i < 4; i++)
- {
- const int by = i % bh;
+ for (uint i = 0; i < 4; i++)
+ {
+ const int by = i % bh;
- for (uint e = 0; e < 4; e++)
- {
- const int bx = e % bw;
- const uint idx = (y + by) * w + x + bx;
+ for (uint e = 0; e < 4; e++)
+ {
+ const int bx = e % bw;
+ const uint idx = (y + by) * w + x + bx;
- color(e, i).u = data[idx];
- }
- }
+ color(e, i).u = data[idx];
+ }
+ }
}
void ColorBlock::init(uint w, uint h, const float * data, uint x, uint y)
{
- const uint bw = min(w - x, 4U);
- const uint bh = min(h - y, 4U);
+ const uint bw = min(w - x, 4U);
+ const uint bh = min(h - y, 4U);
// Blocks that are smaller than 4x4 are handled by repeating the pixels.
// @@ Thats only correct when block size is 1, 2 or 4, but not with 3. :(
- // @@ Ideally we should zero the weights of the pixels out of range.
+ // @@ Ideally we should zero the weights of the pixels out of range.
- uint srcPlane = w * h;
+ uint srcPlane = w * h;
for (uint i = 0; i < 4; i++)
{
@@ -125,13 +125,13 @@ void ColorBlock::init(uint w, uint h, const float * data, uint x, uint y)
for (uint e = 0; e < 4; e++)
{
const uint bx = e % bw;
- const uint idx = ((y + by) * w + x + bx);
+ const uint idx = ((y + by) * w + x + bx);
Color32 & c = color(e, i);
- c.r = uint8(255 * clamp(data[idx + 0 * srcPlane], 0.0f, 1.0f)); // @@ Is this the right way to quantize floats to bytes?
- c.g = uint8(255 * clamp(data[idx + 1 * srcPlane], 0.0f, 1.0f));
- c.b = uint8(255 * clamp(data[idx + 2 * srcPlane], 0.0f, 1.0f));
- c.a = uint8(255 * clamp(data[idx + 3 * srcPlane], 0.0f, 1.0f));
+ c.r = uint8(255 * clamp(data[idx + 0 * srcPlane], 0.0f, 1.0f)); // @@ Is this the right way to quantize floats to bytes?
+ c.g = uint8(255 * clamp(data[idx + 1 * srcPlane], 0.0f, 1.0f));
+ c.b = uint8(255 * clamp(data[idx + 2 * srcPlane], 0.0f, 1.0f));
+ c.a = uint8(255 * clamp(data[idx + 3 * srcPlane], 0.0f, 1.0f));
}
}
}
@@ -181,7 +181,7 @@ bool ColorBlock::isSingleColorNoAlpha() const
{
Color32 c;
int i;
- for(i = 0; i < 16; i++)
+ for (i = 0; i < 16; i++)
{
if (m_color[i].a != 0) c = m_color[i];
}
@@ -189,7 +189,7 @@ bool ColorBlock::isSingleColorNoAlpha() const
Color32 mask(0xFF, 0xFF, 0xFF, 0x00);
uint u = c.u & mask.u;
- for(; i < 16; i++)
+ for (; i < 16; i++)
{
if (u != (m_color[i].u & mask.u))
{
@@ -207,16 +207,16 @@ bool ColorBlock::isSingleColorNoAlpha() const
uint count = 0;
// @@ This does not have to be o(n^2)
- for(int i = 0; i < 16; i++)
+ for (int i = 0; i < 16; i++)
{
bool unique = true;
- for(int j = 0; j < i; j++) {
- if( m_color[i] != m_color[j] ) {
+ for (int j = 0; j < i; j++) {
+ if ( m_color[i] != m_color[j] ) {
unique = false;
}
}
- if( unique ) {
+ if ( unique ) {
count++;
}
}
@@ -230,7 +230,7 @@ Color32 ColorBlock::averageColor() const
uint r, g, b, a;
r = g = b = a = 0;
- for(uint i = 0; i < 16; i++) {
+ for (uint i = 0; i < 16; i++) {
r += m_color[i].r;
g += m_color[i].g;
b += m_color[i].b;
@@ -258,10 +258,10 @@ void ColorBlock::diameterRange(Color32 * start, Color32 * end) const
Color32 c0, c1;
uint best_dist = 0;
- for(int i = 0; i < 16; i++) {
+ for (int i = 0; i < 16; i++) {
for (int j = i+1; j < 16; j++) {
uint dist = colorDistance(m_color[i], m_color[j]);
- if( dist > best_dist ) {
+ if ( dist > best_dist ) {
best_dist = dist;
c0 = m_color[i];
c1 = m_color[j];
@@ -281,7 +281,7 @@ void ColorBlock::luminanceRange(Color32 * start, Color32 * end) const
maxLuminance = minLuminance = colorLuminance(m_color[0]);
- for(uint i = 1; i < 16; i++)
+ for (uint i = 1; i < 16; i++)
{
uint luminance = colorLuminance(m_color[i]);
@@ -305,7 +305,7 @@ void ColorBlock::boundsRange(Color32 * start, Color32 * end) const
Color32 minColor(255, 255, 255);
Color32 maxColor(0, 0, 0);
- for(uint i = 0; i < 16; i++)
+ for (uint i = 0; i < 16; i++)
{
if (m_color[i].r < minColor.r) { minColor.r = m_color[i].r; }
if (m_color[i].g < minColor.g) { minColor.g = m_color[i].g; }
@@ -339,7 +339,7 @@ void ColorBlock::boundsRangeAlpha(Color32 * start, Color32 * end) const
Color32 minColor(255, 255, 255, 255);
Color32 maxColor(0, 0, 0, 0);
- for(uint i = 0; i < 16; i++)
+ for (uint i = 0; i < 16; i++)
{
if (m_color[i].r < minColor.r) { minColor.r = m_color[i].r; }
if (m_color[i].g < minColor.g) { minColor.g = m_color[i].g; }
@@ -377,14 +377,14 @@ void ColorBlock::boundsRangeAlpha(Color32 * start, Color32 * end) const
void ColorBlock::sortColorsByAbsoluteValue()
{
// Dummy selection sort.
- for( uint a = 0; a < 16; a++ ) {
+ for ( uint a = 0; a < 16; a++ ) {
uint max = a;
Color16 cmax(m_color[a]);
- for( uint b = a+1; b < 16; b++ ) {
+ for ( uint b = a+1; b < 16; b++ ) {
Color16 cb(m_color[b]);
- if( cb.u > cmax.u ) {
+ if ( cb.u > cmax.u ) {
max = b;
cmax = cb;
}
@@ -404,16 +404,16 @@ void ColorBlock::computeRange(Vector3::Arg axis, Color32 * start, Color32 * end)
float min, max;
min = max = dot(Vector3(m_color[0].r, m_color[0].g, m_color[0].b), axis);
- for(uint i = 1; i < 16; i++)
+ for (uint i = 1; i < 16; i++)
{
const Vector3 vec(m_color[i].r, m_color[i].g, m_color[i].b);
float val = dot(vec, axis);
- if( val < min ) {
+ if ( val < min ) {
mini = i;
min = val;
}
- else if( val > max ) {
+ else if ( val > max ) {
maxi = i;
max = val;
}
@@ -429,16 +429,16 @@ void ColorBlock::sortColors(const Vector3 & axis)
{
float luma_array[16];
- for(uint i = 0; i < 16; i++) {
+ for (uint i = 0; i < 16; i++) {
const Vector3 vec(m_color[i].r, m_color[i].g, m_color[i].b);
luma_array[i] = dot(vec, axis);
}
// Dummy selection sort.
- for( uint a = 0; a < 16; a++ ) {
+ for ( uint a = 0; a < 16; a++ ) {
uint min = a;
- for( uint b = a+1; b < 16; b++ ) {
- if( luma_array[b] < luma_array[min] ) {
+ for ( uint b = a+1; b < 16; b++ ) {
+ if ( luma_array[b] < luma_array[min] ) {
min = b;
}
}
@@ -454,7 +454,7 @@ float ColorBlock::volume() const
Box bounds;
bounds.clearBounds();
- for(int i = 0; i < 16; i++) {
+ for (int i = 0; i < 16; i++) {
const Vector3 point(m_color[i].r, m_color[i].g, m_color[i].b);
bounds.addPointToBounds(point);
}
diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
index f98f37e388c..e2874652f02 100644
--- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
+++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
@@ -803,7 +803,7 @@ void DDSHeader::swapBytes()
this->depth = POSH_LittleU32(this->depth);
this->mipmapcount = POSH_LittleU32(this->mipmapcount);
- for(int i = 0; i < 11; i++) {
+ for (int i = 0; i < 11; i++) {
this->reserved[i] = POSH_LittleU32(this->reserved[i]);
}
@@ -899,7 +899,7 @@ bool DirectDrawSurface::isValid() const
}
const uint required = (DDSD_WIDTH|DDSD_HEIGHT/*|DDSD_CAPS|DDSD_PIXELFORMAT*/);
- if( (header.flags & required) != required ) {
+ if ( (header.flags & required) != required ) {
return false;
}
@@ -909,7 +909,7 @@ bool DirectDrawSurface::isValid() const
/* in some files DDSCAPS_TEXTURE is missing: silently ignore */
/*
- if( !(header.caps.caps1 & DDSCAPS_TEXTURE) ) {
+ if ( !(header.caps.caps1 & DDSCAPS_TEXTURE) ) {
return false;
}
*/
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/dds/PixelFormat.h b/source/blender/imbuf/intern/dds/PixelFormat.h
index 9add62c4616..3c5cb34812c 100644
--- a/source/blender/imbuf/intern/dds/PixelFormat.h
+++ b/source/blender/imbuf/intern/dds/PixelFormat.h
@@ -63,7 +63,7 @@
namespace PixelFormat
{
- // Convert component @a c having @a inbits to the returned value having @a outbits.
+ // Convert component \a c having \a inbits to the returned value having \a outbits.
inline uint convert(uint c, uint inbits, uint outbits)
{
if (inbits == 0)
diff --git a/source/blender/imbuf/intern/dds/dds_api.cpp b/source/blender/imbuf/intern/dds/dds_api.cpp
index b7a3d0e43ba..071d94c2076 100644
--- a/source/blender/imbuf/intern/dds/dds_api.cpp
+++ b/source/blender/imbuf/intern/dds/dds_api.cpp
@@ -81,13 +81,13 @@ struct ImBuf *imb_load_dds(unsigned char *mem, size_t size, int flags)
Color32 pixel;
Color32 *pixels = 0;
- if(!imb_is_a_dds(mem))
+ if (!imb_is_a_dds(mem))
return (0);
/* check if DDS is valid and supported */
if (!dds.isValid()) {
/* no need to print error here, just testing if it is a DDS */
- if(flags & IB_test)
+ if (flags & IB_test)
return (0);
printf("DDS: not valid; header follows\n");
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c
index 45f58ee9d17..8f8c6311b30 100644
--- a/source/blender/imbuf/intern/divers.c
+++ b/source/blender/imbuf/intern/divers.c
@@ -118,7 +118,7 @@ DitherContext *create_dither_context(int w, float factor)
di->error_buf= MEM_callocN(4*(w+1)*sizeof(int), "dithering error");
di->e= di->error_buf;
- for(i=0; i<4; ++i)
+ for (i=0; i<4; ++i)
di->v[i]= di->v0[i]= di->v1[i]= 1024.0f*(BLI_frand()-0.5f);
return di;
@@ -134,7 +134,7 @@ static void dither_finish_row(DitherContext *di)
{
int i;
- for(i=0; i<4; i++)
+ for (i=0; i<4; i++)
di->v[i]= di->v0[i]= di->v1[i] = 0;
di->e= di->error_buf;
@@ -200,114 +200,114 @@ void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from,
BLI_assert(profile_from != IB_PROFILE_NONE);
BLI_init_srgb_conversion();
- if(dither)
+ if (dither)
di= create_dither_context(width, dither);
- for(y = 0; y < height; y++) {
- if(channels_from == 1) {
+ for (y = 0; y < height; y++) {
+ if (channels_from == 1) {
/* single channel input */
const float *from = rect_from + stride_from*y;
uchar *to = rect_to + stride_to*y*4;
- for(x = 0; x < width; x++, from++, to+=4)
+ for (x = 0; x < width; x++, from++, to+=4)
to[0] = to[1] = to[2] = to[3] = FTOCHAR(from[0]);
}
- else if(channels_from == 3) {
+ else if (channels_from == 3) {
/* RGB input */
const float *from = rect_from + stride_from*y*3;
uchar *to = rect_to + stride_to*y*4;
- if(profile_to == profile_from) {
+ if (profile_to == profile_from) {
/* no color space conversion */
- for(x = 0; x < width; x++, from+=3, to+=4) {
+ for (x = 0; x < width; x++, from+=3, to+=4) {
rgb_float_to_uchar(to, from);
to[3] = 255;
}
}
- else if(profile_to == IB_PROFILE_SRGB) {
+ else if (profile_to == IB_PROFILE_SRGB) {
/* convert from linear to sRGB */
- for(x = 0; x < width; x++, from+=3, to+=4) {
+ for (x = 0; x < width; x++, from+=3, to+=4) {
linearrgb_to_srgb_v3_v3(tmp, from);
rgb_float_to_uchar(to, tmp);
to[3] = 255;
}
}
- else if(profile_to == IB_PROFILE_LINEAR_RGB) {
+ else if (profile_to == IB_PROFILE_LINEAR_RGB) {
/* convert from sRGB to linear */
- for(x = 0; x < width; x++, from+=3, to+=4) {
+ for (x = 0; x < width; x++, from+=3, to+=4) {
srgb_to_linearrgb_v3_v3(tmp, from);
rgb_float_to_uchar(to, tmp);
to[3] = 255;
}
}
}
- else if(channels_from == 4) {
+ else if (channels_from == 4) {
/* RGBA input */
const float *from = rect_from + stride_from*y*4;
uchar *to = rect_to + stride_to*y*4;
- if(profile_to == profile_from) {
+ if (profile_to == profile_from) {
/* no color space conversion */
- if(dither) {
- for(x = 0; x < width; x++, from+=4, to+=4)
+ if (dither) {
+ for (x = 0; x < width; x++, from+=4, to+=4)
float_to_byte_dither_v4(to, from, di);
}
else {
- for(x = 0; x < width; x++, from+=4, to+=4)
+ for (x = 0; x < width; x++, from+=4, to+=4)
rgba_float_to_uchar(to, from);
}
}
- else if(profile_to == IB_PROFILE_SRGB) {
+ else if (profile_to == IB_PROFILE_SRGB) {
/* convert from linear to sRGB */
unsigned short us[4];
- if(dither && predivide) {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ if (dither && predivide) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
linearrgb_to_srgb_ushort4_predivide(us, from);
ushort_to_byte_dither_v4(to, us, di);
}
}
- else if(dither) {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ else if (dither) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
linearrgb_to_srgb_ushort4(us, from);
ushort_to_byte_dither_v4(to, us, di);
}
}
- else if(predivide) {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ else if (predivide) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
linearrgb_to_srgb_ushort4_predivide(us, from);
ushort_to_byte_v4(to, us);
}
}
else {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
linearrgb_to_srgb_ushort4(us, from);
ushort_to_byte_v4(to, us);
}
}
}
- else if(profile_to == IB_PROFILE_LINEAR_RGB) {
+ else if (profile_to == IB_PROFILE_LINEAR_RGB) {
/* convert from sRGB to linear */
- if(dither && predivide) {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ if (dither && predivide) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
srgb_to_linearrgb_predivide_v4(tmp, from);
float_to_byte_dither_v4(to, tmp, di);
}
}
- else if(dither) {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ else if (dither) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
srgb_to_linearrgb_v4(tmp, from);
float_to_byte_dither_v4(to, tmp, di);
}
}
- else if(predivide) {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ else if (predivide) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
srgb_to_linearrgb_predivide_v4(tmp, from);
rgba_float_to_uchar(to, tmp);
}
}
else {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
srgb_to_linearrgb_v4(tmp, from);
rgba_float_to_uchar(to, tmp);
}
@@ -315,11 +315,11 @@ void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from,
}
}
- if(dither)
+ if (dither)
dither_finish_row(di);
}
- if(dither)
+ if (dither)
clear_dither_context(di);
}
@@ -338,38 +338,38 @@ void IMB_buffer_float_from_byte(float *rect_to, const uchar *rect_from,
BLI_init_srgb_conversion();
/* RGBA input */
- for(y = 0; y < height; y++) {
+ for (y = 0; y < height; y++) {
const uchar *from = rect_from + stride_from*y*4;
float *to = rect_to + stride_to*y*4;
- if(profile_to == profile_from) {
+ if (profile_to == profile_from) {
/* no color space conversion */
- for(x = 0; x < width; x++, from+=4, to+=4)
+ for (x = 0; x < width; x++, from+=4, to+=4)
rgba_uchar_to_float(to, from);
}
- else if(profile_to == IB_PROFILE_LINEAR_RGB) {
+ else if (profile_to == IB_PROFILE_LINEAR_RGB) {
/* convert sRGB to linear */
- if(predivide) {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ if (predivide) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
srgb_to_linearrgb_uchar4_predivide(to, from);
}
}
else {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
srgb_to_linearrgb_uchar4(to, from);
}
}
}
- else if(profile_to == IB_PROFILE_SRGB) {
+ else if (profile_to == IB_PROFILE_SRGB) {
/* convert linear to sRGB */
- if(predivide) {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ if (predivide) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
rgba_uchar_to_float(tmp, from);
linearrgb_to_srgb_predivide_v4(to, tmp);
}
}
else {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
rgba_uchar_to_float(tmp, from);
linearrgb_to_srgb_v4(to, tmp);
}
@@ -389,74 +389,74 @@ void IMB_buffer_float_from_float(float *rect_to, const float *rect_from,
BLI_assert(profile_to != IB_PROFILE_NONE);
BLI_assert(profile_from != IB_PROFILE_NONE);
- if(channels_from==1) {
+ if (channels_from==1) {
/* single channel input */
- for(y = 0; y < height; y++) {
+ for (y = 0; y < height; y++) {
const float *from = rect_from + stride_from*y;
float *to = rect_to + stride_to*y*4;
- for(x = 0; x < width; x++, from++, to+=4)
+ for (x = 0; x < width; x++, from++, to+=4)
to[0] = to[1] = to[2] = to[3] = from[0];
}
}
- else if(channels_from == 3) {
+ else if (channels_from == 3) {
/* RGB input */
- for(y = 0; y < height; y++) {
+ for (y = 0; y < height; y++) {
const float *from = rect_from + stride_from*y*3;
float *to = rect_to + stride_to*y*4;
- if(profile_to == profile_from) {
+ if (profile_to == profile_from) {
/* no color space conversion */
- for(x = 0; x < width; x++, from+=3, to+=4) {
+ for (x = 0; x < width; x++, from+=3, to+=4) {
copy_v3_v3(to, from);
to[3] = 1.0f;
}
}
- else if(profile_to == IB_PROFILE_LINEAR_RGB) {
+ else if (profile_to == IB_PROFILE_LINEAR_RGB) {
/* convert from sRGB to linear */
- for(x = 0; x < width; x++, from+=3, to+=4) {
+ for (x = 0; x < width; x++, from+=3, to+=4) {
srgb_to_linearrgb_v3_v3(to, from);
to[3] = 1.0f;
}
}
- else if(profile_to == IB_PROFILE_SRGB) {
+ else if (profile_to == IB_PROFILE_SRGB) {
/* convert from linear to sRGB */
- for(x = 0; x < width; x++, from+=3, to+=4) {
+ for (x = 0; x < width; x++, from+=3, to+=4) {
linearrgb_to_srgb_v3_v3(to, from);
to[3] = 1.0f;
}
}
}
}
- else if(channels_from == 4) {
+ else if (channels_from == 4) {
/* RGBA input */
- for(y = 0; y < height; y++) {
+ for (y = 0; y < height; y++) {
const float *from = rect_from + stride_from*y*4;
float *to = rect_to + stride_to*y*4;
- if(profile_to == profile_from) {
+ if (profile_to == profile_from) {
/* same profile, copy */
memcpy(to, from, sizeof(float)*4*width);
}
- else if(profile_to == IB_PROFILE_LINEAR_RGB) {
+ else if (profile_to == IB_PROFILE_LINEAR_RGB) {
/* convert to sRGB to linear */
- if(predivide) {
- for(x = 0; x < width; x++, from+=4, to+=4)
+ if (predivide) {
+ for (x = 0; x < width; x++, from+=4, to+=4)
srgb_to_linearrgb_predivide_v4(to, from);
}
else {
- for(x = 0; x < width; x++, from+=4, to+=4)
+ for (x = 0; x < width; x++, from+=4, to+=4)
srgb_to_linearrgb_v4(to, from);
}
}
- else if(profile_to == IB_PROFILE_SRGB) {
+ else if (profile_to == IB_PROFILE_SRGB) {
/* convert from linear to sRGB */
- if(predivide) {
- for(x = 0; x < width; x++, from+=4, to+=4)
+ if (predivide) {
+ for (x = 0; x < width; x++, from+=4, to+=4)
linearrgb_to_srgb_predivide_v4(to, from);
}
else {
- for(x = 0; x < width; x++, from+=4, to+=4)
+ for (x = 0; x < width; x++, from+=4, to+=4)
linearrgb_to_srgb_v4(to, from);
}
}
@@ -477,42 +477,42 @@ void IMB_buffer_byte_from_byte(uchar *rect_to, const uchar *rect_from,
BLI_assert(profile_from != IB_PROFILE_NONE);
/* always RGBA input */
- for(y = 0; y < height; y++) {
+ for (y = 0; y < height; y++) {
const uchar *from = rect_from + stride_from*y*4;
uchar *to = rect_to + stride_to*y*4;
- if(profile_to == profile_from) {
+ if (profile_to == profile_from) {
/* same profile, copy */
memcpy(to, from, sizeof(uchar)*4*width);
}
- else if(profile_to == IB_PROFILE_LINEAR_RGB) {
+ else if (profile_to == IB_PROFILE_LINEAR_RGB) {
/* convert to sRGB to linear */
- if(predivide) {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ if (predivide) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
rgba_uchar_to_float(tmp, from);
srgb_to_linearrgb_predivide_v4(tmp, tmp);
rgba_float_to_uchar(to, tmp);
}
}
else {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
rgba_uchar_to_float(tmp, from);
srgb_to_linearrgb_v4(tmp, tmp);
rgba_float_to_uchar(to, tmp);
}
}
}
- else if(profile_to == IB_PROFILE_SRGB) {
+ else if (profile_to == IB_PROFILE_SRGB) {
/* convert from linear to sRGB */
- if(predivide) {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ if (predivide) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
rgba_uchar_to_float(tmp, from);
linearrgb_to_srgb_predivide_v4(tmp, tmp);
rgba_float_to_uchar(to, tmp);
}
}
else {
- for(x = 0; x < width; x++, from+=4, to+=4) {
+ for (x = 0; x < width; x++, from+=4, to+=4) {
rgba_uchar_to_float(tmp, from);
linearrgb_to_srgb_v4(tmp, tmp);
rgba_float_to_uchar(to, tmp);
@@ -530,17 +530,17 @@ void IMB_rect_from_float(ImBuf *ibuf)
int profile_from;
/* verify we have a float buffer */
- if(ibuf->rect_float==NULL)
+ if (ibuf->rect_float==NULL)
return;
/* create byte rect if it didn't exist yet */
- if(ibuf->rect==NULL)
+ if (ibuf->rect==NULL)
imb_addrectImBuf(ibuf);
/* determine profiles */
- if(ibuf->profile == IB_PROFILE_LINEAR_RGB)
+ if (ibuf->profile == IB_PROFILE_LINEAR_RGB)
profile_from = IB_PROFILE_LINEAR_RGB;
- else if(ELEM(ibuf->profile, IB_PROFILE_SRGB, IB_PROFILE_NONE))
+ else if (ELEM(ibuf->profile, IB_PROFILE_SRGB, IB_PROFILE_NONE))
profile_from = IB_PROFILE_SRGB;
else
BLI_assert(0);
@@ -563,17 +563,17 @@ void IMB_partial_rect_from_float(ImBuf *ibuf, float *buffer, int x, int y, int w
int profile_from;
/* verify we have a float buffer */
- if(ibuf->rect_float==NULL || buffer==NULL)
+ if (ibuf->rect_float==NULL || buffer==NULL)
return;
/* create byte rect if it didn't exist yet */
- if(ibuf->rect==NULL)
+ if (ibuf->rect==NULL)
imb_addrectImBuf(ibuf);
/* determine profiles */
- if(ibuf->profile == IB_PROFILE_LINEAR_RGB)
+ if (ibuf->profile == IB_PROFILE_LINEAR_RGB)
profile_from = IB_PROFILE_LINEAR_RGB;
- else if(ELEM(ibuf->profile, IB_PROFILE_SRGB, IB_PROFILE_NONE))
+ else if (ELEM(ibuf->profile, IB_PROFILE_SRGB, IB_PROFILE_NONE))
profile_from = IB_PROFILE_SRGB;
else
BLI_assert(0);
@@ -600,15 +600,15 @@ void IMB_float_from_rect(ImBuf *ibuf)
int profile_from;
/* verify if we byte and float buffers */
- if(ibuf->rect==NULL)
+ if (ibuf->rect==NULL)
return;
- if(ibuf->rect_float==NULL)
- if(imb_addrectfloatImBuf(ibuf) == 0)
+ if (ibuf->rect_float==NULL)
+ if (imb_addrectfloatImBuf(ibuf) == 0)
return;
/* determine profiles */
- if(ibuf->profile == IB_PROFILE_NONE)
+ if (ibuf->profile == IB_PROFILE_NONE)
profile_from = IB_PROFILE_LINEAR_RGB;
else
profile_from = IB_PROFILE_SRGB;
@@ -624,7 +624,7 @@ void IMB_float_from_rect_simple(ImBuf *ibuf)
{
int predivide= (ibuf->flags & IB_cm_predivide);
- if(ibuf->rect_float==NULL)
+ if (ibuf->rect_float==NULL)
imb_addrectfloatImBuf(ibuf);
IMB_buffer_float_from_byte(ibuf->rect_float, (uchar*)ibuf->rect,
@@ -637,22 +637,22 @@ void IMB_convert_profile(ImBuf *ibuf, int profile)
int predivide= (ibuf->flags & IB_cm_predivide);
int profile_from, profile_to;
- if(ibuf->profile == profile)
+ if (ibuf->profile == profile)
return;
/* determine profiles */
- if(ibuf->profile == IB_PROFILE_LINEAR_RGB)
+ if (ibuf->profile == IB_PROFILE_LINEAR_RGB)
profile_from = IB_PROFILE_LINEAR_RGB;
- else if(ELEM(ibuf->profile, IB_PROFILE_SRGB, IB_PROFILE_NONE))
+ else if (ELEM(ibuf->profile, IB_PROFILE_SRGB, IB_PROFILE_NONE))
profile_from = IB_PROFILE_SRGB;
else {
BLI_assert(0);
profile_from = IB_PROFILE_SRGB; /* dummy, should never happen */
}
- if(profile == IB_PROFILE_LINEAR_RGB)
+ if (profile == IB_PROFILE_LINEAR_RGB)
profile_to = IB_PROFILE_LINEAR_RGB;
- else if(ELEM(profile, IB_PROFILE_SRGB, IB_PROFILE_NONE))
+ else if (ELEM(profile, IB_PROFILE_SRGB, IB_PROFILE_NONE))
profile_to = IB_PROFILE_SRGB;
else {
BLI_assert(0);
@@ -660,13 +660,13 @@ void IMB_convert_profile(ImBuf *ibuf, int profile)
}
/* do conversion */
- if(ibuf->rect_float) {
+ if (ibuf->rect_float) {
IMB_buffer_float_from_float(ibuf->rect_float, ibuf->rect_float,
4, profile_to, profile_from, predivide,
ibuf->x, ibuf->y, ibuf->x, ibuf->x);
}
- if(ibuf->rect) {
+ if (ibuf->rect) {
IMB_buffer_byte_from_byte((uchar*)ibuf->rect, (uchar*)ibuf->rect,
profile_to, profile_from, predivide,
ibuf->x, ibuf->y, ibuf->x, ibuf->x);
@@ -684,21 +684,21 @@ float *IMB_float_profile_ensure(ImBuf *ibuf, int profile, int *alloc)
int profile_from, profile_to;
/* determine profiles */
- if(ibuf->profile == IB_PROFILE_NONE)
+ if (ibuf->profile == IB_PROFILE_NONE)
profile_from = IB_PROFILE_LINEAR_RGB;
else
profile_from = IB_PROFILE_SRGB;
- if(profile == IB_PROFILE_NONE)
+ if (profile == IB_PROFILE_NONE)
profile_to = IB_PROFILE_LINEAR_RGB;
else
profile_to = IB_PROFILE_SRGB;
- if(profile_from == profile_to) {
+ if (profile_from == profile_to) {
/* simple case, just allocate the buffer and return */
*alloc= 0;
- if(ibuf->rect_float == NULL)
+ if (ibuf->rect_float == NULL)
IMB_float_from_rect(ibuf);
return ibuf->rect_float;
@@ -708,7 +708,7 @@ float *IMB_float_profile_ensure(ImBuf *ibuf, int profile, int *alloc)
float *fbuf= MEM_mallocN(ibuf->x * ibuf->y * sizeof(float) * 4, "IMB_float_profile_ensure");
*alloc= 1;
- if(ibuf->rect_float == NULL) {
+ if (ibuf->rect_float == NULL) {
IMB_buffer_float_from_byte(fbuf, (uchar*)ibuf->rect,
profile_to, profile_from, predivide,
ibuf->x, ibuf->y, ibuf->x, ibuf->x);
@@ -732,13 +732,13 @@ void IMB_color_to_bw(ImBuf *ibuf)
uchar *rct= (uchar*)ibuf->rect;
int i;
- if(rctf) {
- for(i = ibuf->x * ibuf->y; i > 0; i--, rctf+=4)
+ if (rctf) {
+ for (i = ibuf->x * ibuf->y; i > 0; i--, rctf+=4)
rctf[0]= rctf[1]= rctf[2]= rgb_to_grayscale(rctf);
}
- if(rct) {
- for(i = ibuf->x * ibuf->y; i > 0; i--, rct+=4)
+ if (rct) {
+ for (i = ibuf->x * ibuf->y; i > 0; i--, rct+=4)
rct[0]= rct[1]= rct[2]= rgb_to_grayscale_byte(rct);
}
}
@@ -746,7 +746,34 @@ void IMB_color_to_bw(ImBuf *ibuf)
void IMB_buffer_float_clamp(float *buf, int width, int height)
{
int i, total = width*height*4;
- for(i = 0; i < total; i++){
+ for (i = 0; i < total; i++) {
buf[i] = MIN2(1.0, buf[i]);
}
}
+
+/**************************** alter saturation *****************************/
+
+void IMB_saturation(ImBuf * ibuf, float sat)
+{
+ int i;
+ unsigned char *rct= (unsigned char *)ibuf->rect;
+ float *rctf= ibuf->rect_float;
+ float hsv[3];
+
+ if (rct) {
+ float rgb[3];
+ for (i = ibuf->x * ibuf->y; i > 0; i--, rct+=4) {
+ rgb_uchar_to_float(rgb, rct);
+ rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+ hsv_to_rgb(hsv[0], hsv[1] * sat, hsv[2], rgb, rgb+1, rgb+2);
+ rgb_float_to_uchar(rct, rgb);
+ }
+ }
+
+ if (rctf) {
+ for (i = ibuf->x * ibuf->y; i > 0; i--, rctf+=4) {
+ rgb_to_hsv(rctf[0], rctf[1], rctf[2], hsv, hsv+1, hsv+2);
+ hsv_to_rgb(hsv[0], hsv[1] * sat, hsv[2], rctf, rctf+1, rctf+2);
+ }
+ }
+}
diff --git a/source/blender/imbuf/intern/filetype.c b/source/blender/imbuf/intern/filetype.c
index c03736f4b0a..59c10165974 100644
--- a/source/blender/imbuf/intern/filetype.c
+++ b/source/blender/imbuf/intern/filetype.c
@@ -77,7 +77,7 @@ ImFileType IMB_FILE_TYPES[]= {
{NULL, NULL, imb_is_a_hdr, imb_ftype_default, imb_loadhdr, imb_savehdr, NULL, IM_FTYPE_FLOAT, RADHDR},
#endif
#ifdef WITH_OPENEXR
- {NULL, NULL, imb_is_a_openexr, imb_ftype_default, imb_load_openexr, imb_save_openexr, NULL, IM_FTYPE_FLOAT, OPENEXR},
+ {imb_initopenexr, NULL, imb_is_a_openexr, imb_ftype_default, imb_load_openexr, imb_save_openexr, NULL, IM_FTYPE_FLOAT, OPENEXR},
#endif
#ifdef WITH_OPENJPEG
{NULL, NULL, imb_is_a_jp2, imb_ftype_default, imb_jp2_decode, imb_savejp2, NULL, IM_FTYPE_FLOAT, JP2},
@@ -94,8 +94,8 @@ void imb_filetypes_init(void)
{
ImFileType *type;
- for(type=IMB_FILE_TYPES; type->is_a; type++)
- if(type->init)
+ for (type=IMB_FILE_TYPES; type->is_a; type++)
+ if (type->init)
type->init();
}
@@ -103,8 +103,8 @@ void imb_filetypes_exit(void)
{
ImFileType *type;
- for(type=IMB_FILE_TYPES; type->is_a; type++)
- if(type->exit)
+ for (type=IMB_FILE_TYPES; type->is_a; type++)
+ if (type->exit)
type->exit();
}
diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c
index 29da7973654..0e6567d2c6b 100644
--- a/source/blender/imbuf/intern/filter.c
+++ b/source/blender/imbuf/intern/filter.c
@@ -54,10 +54,10 @@ static void filtrow(unsigned char *point, int x)
{
unsigned int c1,c2,c3,error;
- if (x>1){
+ if (x>1) {
c1 = c2 = *point;
error = 2;
- for(x--;x>0;x--){
+ for (x--;x>0;x--) {
c3 = point[4];
c1 += (c2<<1) + c3 + error;
error = c1 & 3;
@@ -74,9 +74,9 @@ static void filtrowf(float *point, int x)
{
float c1,c2,c3;
- if (x>1){
+ if (x>1) {
c1 = c2 = *point;
- for(x--;x>0;x--){
+ for (x--;x>0;x--) {
c3 = point[4];
c1 += (c2 * 2) + c3;
*point = 0.25f*c1;
@@ -95,11 +95,11 @@ static void filtcolum(unsigned char *point, int y, int skip)
unsigned int c1,c2,c3,error;
unsigned char *point2;
- if (y>1){
+ if (y>1) {
c1 = c2 = *point;
point2 = point;
error = 2;
- for(y--;y>0;y--){
+ for (y--;y>0;y--) {
point2 += skip;
c3 = *point2;
c1 += (c2<<1) + c3 +error;
@@ -117,10 +117,10 @@ static void filtcolumf(float *point, int y, int skip)
{
float c1,c2,c3, *point2;
- if (y>1){
+ if (y>1) {
c1 = c2 = *point;
point2 = point;
- for(y--;y>0;y--){
+ for (y--;y>0;y--) {
point2 += skip;
c3 = *point2;
c1 += (c2 * 2) + c3;
@@ -146,7 +146,7 @@ void IMB_filtery(struct ImBuf *ibuf)
y = ibuf->y;
skip = x<<2;
- for (;x>0;x--){
+ for (;x>0;x--) {
if (point) {
if (ibuf->planes > 24) filtcolum(point,y,skip);
point++;
@@ -184,7 +184,7 @@ void imb_filterx(struct ImBuf *ibuf)
y = ibuf->y;
skip = (x<<2) - 3;
- for (;y>0;y--){
+ for (;y>0;y--) {
if (point) {
if (ibuf->planes > 24) filtrow(point,x);
point++;
@@ -216,7 +216,7 @@ void IMB_filterN(ImBuf *out, ImBuf *in)
rowlen= in->x;
- for(y=0; y<in->y; y++) {
+ for (y=0; y<in->y; y++) {
/* setup rows */
row2= (char*)(in->rect + y*rowlen);
row1= (y == 0)? row2: row2 - 4*rowlen;
@@ -224,8 +224,8 @@ void IMB_filterN(ImBuf *out, ImBuf *in)
cp= (char *)(out->rect + y*rowlen);
- for(x=0; x<rowlen; x++) {
- if(x == 0) {
+ for (x=0; x<rowlen; x++) {
+ if (x == 0) {
r11 = row1;
r21 = row1;
r31 = row1;
@@ -236,7 +236,7 @@ void IMB_filterN(ImBuf *out, ImBuf *in)
r31 = row1-4;
}
- if(x == rowlen-1) {
+ if (x == rowlen-1) {
r13 = row1;
r23 = row1;
r33 = row1;
@@ -273,26 +273,27 @@ void IMB_mask_filter_extend(char *mask, int width, int height)
/* make a copy, to prevent flooding */
temprect= MEM_dupallocN(mask);
- for(y=1; y<=height; y++) {
+ for (y=1; y<=height; y++) {
/* setup rows */
row1= (char *)(temprect + (y-2)*rowlen);
row2= row1 + rowlen;
row3= row2 + rowlen;
- if(y==1)
+ if (y==1)
row1= row2;
- else if(y==height)
+ else if (y==height)
row3= row2;
- for(x=0; x<rowlen; x++) {
+ for (x=0; x<rowlen; x++) {
if (mask[((y-1)*rowlen)+x]==0) {
if (*row1 || *row2 || *row3 || *(row1+1) || *(row3+1) ) {
mask[((y-1)*rowlen)+x] = FILTER_MASK_MARGIN;
- } else if((x!=rowlen-1) && (*(row1+2) || *(row2+2) || *(row3+2)) ) {
+ }
+ else if ((x!=rowlen-1) && (*(row1+2) || *(row2+2) || *(row3+2)) ) {
mask[((y-1)*rowlen)+x] = FILTER_MASK_MARGIN;
}
}
- if(x!=0) {
+ if (x!=0) {
row1++; row2++; row3++;
}
}
@@ -305,18 +306,19 @@ void IMB_mask_clear(ImBuf *ibuf, char *mask, int val)
{
int x,y;
if (ibuf->rect_float) {
- for(x=0; x<ibuf->x; x++) {
- for(y=0; y<ibuf->y; y++) {
+ for (x=0; x<ibuf->x; x++) {
+ for (y=0; y<ibuf->y; y++) {
if (mask[ibuf->x*y + x] == val) {
float *col= ibuf->rect_float + 4*(ibuf->x*y + x);
col[0] = col[1] = col[2] = col[3] = 0.0f;
}
}
}
- } else {
+ }
+ else {
/* char buffer */
- for(x=0; x<ibuf->x; x++) {
- for(y=0; y<ibuf->y; y++) {
+ for (x=0; x<ibuf->x; x++) {
+ for (y=0; y<ibuf->y; y++) {
if (mask[ibuf->x*y + x] == val) {
char *col= (char *)(ibuf->rect + ibuf->x*y + x);
col[0] = col[1] = col[2] = col[3] = 0;
@@ -328,7 +330,7 @@ void IMB_mask_clear(ImBuf *ibuf, char *mask, int val)
static int filter_make_index(const int x, const int y, const int w, const int h)
{
- if(x<0 || x>=w || y<0 || y>=h) return -1; /* return bad index */
+ if (x<0 || x>=w || y<0 || y>=h) return -1; /* return bad index */
else return y*w+x;
}
@@ -336,13 +338,13 @@ static int check_pixel_assigned(const void *buffer, const char *mask, const int
{
int res = 0;
- if(index>=0) {
+ if (index>=0) {
const int alpha_index = depth*index+(depth-1);
- if(mask!=NULL) {
+ if (mask!=NULL) {
res = mask[index]!=0 ? 1 : 0;
}
- else if( (is_float && ((const float *) buffer)[alpha_index]!=0.0f) ||
+ else if ( (is_float && ((const float *) buffer)[alpha_index]!=0.0f) ||
(!is_float && ((const unsigned char *) buffer)[alpha_index]!=0) ) {
res=1;
}
@@ -372,26 +374,29 @@ void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter)
/* build a weights buffer */
n= 1;
- /*k= 0;
- for(i = -n; i <= n; i++)
- for(j = -n; j <= n; j++)
+
+#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;
/* run passes */
- for(r = 0; cannot_early_out == 1 && r < filter; r++) {
+ for (r = 0; cannot_early_out == 1 && r < filter; r++) {
int x, y;
cannot_early_out = 0;
- for(y= 0; y<height; y++) {
- for(x= 0; x<width; x++) {
+ for (y= 0; y<height; y++) {
+ for (x= 0; x<width; x++) {
const int index= filter_make_index(x, y, width, height);
/* only update unassigned pixels */
- if(!check_pixel_assigned(srcbuf, srcmask, index, depth, is_float)) {
+ if (!check_pixel_assigned(srcbuf, srcmask, index, depth, is_float)) {
float tmp[4];
float wsum=0;
float acc[4]={0,0,0,0};
@@ -401,24 +406,24 @@ void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter)
check_pixel_assigned(srcbuf, srcmask, filter_make_index(x+1, y, width, height), depth, is_float) ||
check_pixel_assigned(srcbuf, srcmask, filter_make_index(x, y-1, width, height), depth, is_float) ||
check_pixel_assigned(srcbuf, srcmask, filter_make_index(x, y+1, width, height), depth, is_float)) {
- for(i= -n; i<=n; i++) {
- for(j=-n; j<=n; j++) {
- if(i != 0 || j != 0) {
+ for (i= -n; i<=n; i++) {
+ for (j=-n; j<=n; j++) {
+ if (i != 0 || j != 0) {
const int tmpindex= filter_make_index(x+i, y+j, width, height);
- if(check_pixel_assigned(srcbuf, srcmask, tmpindex, depth, is_float)) {
- if(is_float) {
- for(c=0; c<depth; c++)
+ if (check_pixel_assigned(srcbuf, srcmask, tmpindex, depth, is_float)) {
+ if (is_float) {
+ for (c=0; c<depth; c++)
tmp[c] = ((const float *) srcbuf)[depth*tmpindex+c];
}
else {
- for(c=0; c<depth; c++)
+ for (c=0; c<depth; c++)
tmp[c] = (float) ((const unsigned char *) srcbuf)[depth*tmpindex+c];
}
wsum+= weight[k];
- for(c=0; c<depth; c++)
+ for (c=0; c<depth; c++)
acc[c]+= weight[k] * tmp[c];
}
}
@@ -426,21 +431,21 @@ void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter)
}
}
- if(wsum!=0) {
- for(c=0; c<depth; c++)
+ if (wsum!=0) {
+ for (c=0; c<depth; c++)
acc[c]/= wsum;
- if(is_float) {
- for(c=0; c<depth; c++)
+ if (is_float) {
+ for (c=0; c<depth; c++)
((float *) dstbuf)[depth*index+c] = acc[c];
}
else {
- for(c=0; c<depth; c++) {
+ for (c=0; c<depth; c++) {
((unsigned char *) dstbuf)[depth*index+c]= acc[c] > 255 ? 255 : (acc[c] < 0 ? 0 : ((unsigned char) (acc[c]+0.5f)));
}
}
- if(dstmask!=NULL) dstmask[index]=FILTER_MASK_MARGIN; /* assigned */
+ if (dstmask!=NULL) dstmask[index]=FILTER_MASK_MARGIN; /* assigned */
cannot_early_out = 1;
}
}
@@ -450,12 +455,12 @@ void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter)
/* keep the original buffer up to date. */
memcpy(srcbuf, dstbuf, bsize);
- if(dstmask!=NULL) memcpy(srcmask, dstmask, width*height);
+ if (dstmask!=NULL) memcpy(srcmask, dstmask, width*height);
}
/* free memory */
MEM_freeN(dstbuf);
- if(dstmask!=NULL) MEM_freeN(dstmask);
+ if (dstmask!=NULL) MEM_freeN(dstmask);
}
/* threadsafe version, only recreates existing maps */
@@ -466,11 +471,11 @@ void IMB_remakemipmap(ImBuf *ibuf, int use_filter)
ibuf->miptot= 1;
- while(curmap < IB_MIPMAP_LEVELS) {
+ while (curmap < IB_MIPMAP_LEVELS) {
- if(ibuf->mipmap[curmap]) {
+ if (ibuf->mipmap[curmap]) {
- if(use_filter) {
+ if (use_filter) {
ImBuf *nbuf= IMB_allocImBuf(hbuf->x, hbuf->y, 32, IB_rect);
IMB_filterN(nbuf, hbuf);
imb_onehalf_no_alloc(ibuf->mipmap[curmap], nbuf);
@@ -482,10 +487,10 @@ void IMB_remakemipmap(ImBuf *ibuf, int use_filter)
ibuf->miptot= curmap+2;
hbuf= ibuf->mipmap[curmap];
- if(hbuf)
+ if (hbuf)
hbuf->miplevel= curmap+1;
- if(!hbuf || (hbuf->x <= 2 && hbuf->y <= 2))
+ if (!hbuf || (hbuf->x <= 2 && hbuf->y <= 2))
break;
curmap++;
@@ -502,8 +507,8 @@ void IMB_makemipmap(ImBuf *ibuf, int use_filter)
ibuf->miptot= 1;
- while(curmap < IB_MIPMAP_LEVELS) {
- if(use_filter) {
+ while (curmap < IB_MIPMAP_LEVELS) {
+ if (use_filter) {
ImBuf *nbuf= IMB_allocImBuf(hbuf->x, hbuf->y, 32, IB_rect);
IMB_filterN(nbuf, hbuf);
ibuf->mipmap[curmap] = IMB_onehalf(nbuf);
@@ -516,7 +521,7 @@ void IMB_makemipmap(ImBuf *ibuf, int use_filter)
hbuf= ibuf->mipmap[curmap];
hbuf->miplevel= curmap+1;
- if(hbuf->x <= 2 && hbuf->y <= 2)
+ if (hbuf->x <= 2 && hbuf->y <= 2)
break;
curmap++;
@@ -534,18 +539,18 @@ void IMB_premultiply_rect(unsigned int *rect, char planes, int w, int h)
char *cp;
int x, y, val;
- if(planes == 24) { /* put alpha at 255 */
+ if (planes == 24) { /* put alpha at 255 */
cp= (char *)(rect);
- for(y=0; y<h; y++)
- for(x=0; x<w; x++, cp+=4)
+ for (y=0; y<h; y++)
+ for (x=0; x<w; x++, cp+=4)
cp[3]= 255;
}
else {
cp= (char *)(rect);
- for(y=0; y<h; y++) {
- for(x=0; x<w; x++, cp+=4) {
+ for (y=0; y<h; y++) {
+ for (x=0; x<w; x++, cp+=4) {
val= cp[3];
cp[0]= (cp[0]*val)>>8;
cp[1]= (cp[1]*val)>>8;
@@ -560,17 +565,17 @@ void IMB_premultiply_rect_float(float *rect_float, char planes, int w, int h)
float val, *cp;
int x, y;
- if(planes==24) { /* put alpha at 1.0 */
+ if (planes==24) { /* put alpha at 1.0 */
cp= rect_float;
- for(y=0; y<h; y++)
- for(x=0; x<w; x++, cp+=4)
+ for (y=0; y<h; y++)
+ for (x=0; x<w; x++, cp+=4)
cp[3]= 1.0;
}
else {
cp= rect_float;
- for(y=0; y<h; y++) {
- for(x=0; x<w; x++, cp+=4) {
+ for (y=0; y<h; y++) {
+ for (x=0; x<w; x++, cp+=4) {
val= cp[3];
cp[0]= cp[0]*val;
cp[1]= cp[1]*val;
@@ -583,13 +588,13 @@ void IMB_premultiply_rect_float(float *rect_float, char planes, int w, int h)
void IMB_premultiply_alpha(ImBuf *ibuf)
{
- if(ibuf==NULL)
+ if (ibuf==NULL)
return;
- if(ibuf->rect)
+ if (ibuf->rect)
IMB_premultiply_rect(ibuf->rect, ibuf->planes, ibuf->x, ibuf->y);
- if(ibuf->rect_float)
+ if (ibuf->rect_float)
IMB_premultiply_rect_float(ibuf->rect_float, ibuf->planes, ibuf->x, ibuf->y);
}
diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c
index 9dad21aa728..1976242ea4f 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 */
@@ -60,7 +62,7 @@ void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf)
if (ibuf->rect) {
size = ibuf->x * ibuf->y;
- while(size-- > 0) {
+ while (size-- > 0) {
rt= cp[0];
cp[0]= cp[3];
cp[3]= rt;
@@ -74,7 +76,7 @@ void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf)
if (ibuf->rect_float) {
size = ibuf->x * ibuf->y;
- while(size-- > 0) {
+ while (size-- > 0) {
rtf= cpf[0];
cpf[0]= cpf[3];
cpf[3]= rtf;
@@ -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);
@@ -151,33 +156,31 @@ void bicubic_interpolation_color(struct ImBuf *in, unsigned char *outI, float *o
wy[2] = P(b- 1);
wy[3] = P(b- 2);
- for(n= -1; n<= 2; n++){
+ 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;
}
}
}
@@ -186,8 +189,8 @@ void bicubic_interpolation_color(struct ImBuf *in, unsigned char *outI, float *o
#if 0
/* older, slower function, works the same as above */
- for(n= -1; n<= 2; n++){
- for(m= -1; m<= 2; m++){
+ for (n= -1; n<= 2; n++) {
+ for (m= -1; m<= 2; m++) {
x1= i+n;
y1= j+m;
if (x1>0 && x1 < in->x && y1>0 && y1<in->y) {
@@ -335,11 +338,11 @@ void bilinear_interpolation_color_wrap(struct ImBuf *in, unsigned char *outI, fl
if (x2<0 || x1>in->x-1 || y2<0 || y1>in->y-1) return;
/* wrap interpolation pixels - main difference from bilinear_interpolation_color */
- if(x1<0)x1= in->x+x1;
- if(y1<0)y1= in->y+y1;
+ if (x1<0)x1= in->x+x1;
+ if (y1<0)y1= in->y+y1;
- if(x2>=in->x)x2= x2-in->x;
- if(y2>=in->y)y2= y2-in->y;
+ if (x2>=in->x)x2= x2-in->x;
+ if (y2>=in->y)y2= y2-in->y;
if (outF) {
// sample including outside of edges of image
@@ -420,7 +423,8 @@ void neareast_interpolation_color(struct ImBuf *in, unsigned char *outI, float *
outF[2]= 0.0f;
outF[3]= 0.0f;
}
- } else {
+ }
+ else {
dataI= (unsigned char *)in->rect + in->x * y1 * 4 + 4*x1;
if (outI) {
outI[0]= dataI[0];
diff --git a/source/blender/imbuf/intern/imbuf_cocoa.m b/source/blender/imbuf/intern/imbuf_cocoa.m
index b79b1358ec2..db7f93423cb 100644
--- a/source/blender/imbuf/intern/imbuf_cocoa.m
+++ b/source/blender/imbuf/intern/imbuf_cocoa.m
@@ -53,12 +53,12 @@
* Loads any Core Graphics supported type
* Currently is : TIFF, BMP, JPEG, GIF, PNG, DIB, ICO, and various RAW formats
*
- * @param mem: Memory containing the bitmap image
- * @param size: Size of the mem buffer.
- * @param flags: If flags has IB_test set then the file is not actually loaded,
+ * \param mem: Memory containing the bitmap image
+ * \param size: Size of the mem buffer.
+ * \param flags: If flags has IB_test set then the file is not actually loaded,
* but all other operations take place.
*
- * @return: A newly allocated ImBuf structure if successful, otherwise NULL.
+ * \return: A newly allocated ImBuf structure if successful, otherwise NULL.
*/
struct ImBuf *imb_cocoaLoadImage(unsigned char *mem, int size, int flags)
{
@@ -197,11 +197,11 @@ struct ImBuf *imb_cocoaLoadImage(unsigned char *mem, int size, int flags)
*
* Accepted formats: TIFF, GIF, BMP, PNG, JPEG, JPEG2000
*
- * @param ibuf: Image buffer.
- * @param name: Name of the image file to create.
- * @param flags: Currently largely ignored.
+ * \param ibuf: Image buffer.
+ * \param name: Name of the image file to create.
+ * \param flags: Currently largely ignored.
*
- * @return: 1 if the function is successful, 0 on failure.
+ * \return: 1 if the function is successful, 0 on failure.
*/
#define FTOUSHORT(val) ((val >= 1.0f-0.5f/65535)? 65535: (val <= 0.0f)? 0: (unsigned short)(val*65535.0f + 0.5f))
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c
index 7a2977da473..e50f8e16ea5 100644
--- a/source/blender/imbuf/intern/indexer.c
+++ b/source/blender/imbuf/intern/indexer.c
@@ -61,14 +61,6 @@ static int tc_types[] = { IMB_TC_RECORD_RUN,
#define INDEX_FILE_VERSION 1
-/* ----------------------------------------------------------------------
- - special indexers
- ----------------------------------------------------------------------
- */
-
-extern void IMB_indexer_dv_new(anim_index_builder * idx);
-
-
/* ----------------------------------------------------------------------
- time code index functions
---------------------------------------------------------------------- */
@@ -89,7 +81,7 @@ anim_index_builder * IMB_index_builder_create(const char * name)
BLI_make_existing_file(rv->temp_name);
- rv->fp = fopen(rv->temp_name, "wb");
+ rv->fp = BLI_fopen(rv->temp_name, "wb");
if (!rv->fp) {
fprintf(stderr, "Couldn't open index target: %s! "
@@ -130,7 +122,8 @@ void IMB_index_builder_proc_frame(anim_index_builder * fp,
e.pts = pts;
fp->proc_frame(fp, buffer, data_size, &e);
- } else {
+ }
+ else {
IMB_index_builder_add_entry(fp, frameno, seek_pos,
seek_pos_dts, pts);
}
@@ -146,9 +139,10 @@ void IMB_index_builder_finish(anim_index_builder * fp, int rollback)
if (rollback) {
unlink(fp->temp_name);
- } else {
+ }
+ else {
unlink(fp->name);
- rename(fp->temp_name, fp->name);
+ BLI_rename(fp->temp_name, fp->name);
}
MEM_freeN(fp);
@@ -158,7 +152,7 @@ struct anim_index * IMB_indexer_open(const char * name)
{
char header[13];
struct anim_index * idx;
- FILE * fp = fopen(name, "rb");
+ FILE * fp = BLI_fopen(name, "rb");
int i;
if (!fp) {
@@ -268,14 +262,16 @@ int IMB_indexer_get_frame_index(struct anim_index * idx, int frameno)
first = middle;
++first;
len = len - half - 1;
- } else {
+ }
+ else {
len = half;
}
}
if (first == idx->num_entries) {
return idx->num_entries - 1;
- } else {
+ }
+ else {
return first;
}
}
@@ -369,7 +365,8 @@ static void get_index_dir(struct anim * anim, char * index_dir)
BLI_splitdirstring(index_dir, fname);
BLI_join_dirfile(index_dir, FILE_MAXDIR, index_dir, "BL_proxy");
BLI_join_dirfile(index_dir, FILE_MAXDIR, index_dir, fname);
- } else {
+ }
+ else {
BLI_strncpy(index_dir, anim->index_dir, FILE_MAXDIR);
}
}
@@ -513,7 +510,8 @@ static struct proxy_output_ctx * alloc_proxy_output_ffmpeg(
if (rv->codec->pix_fmts) {
rv->c->pix_fmt = rv->codec->pix_fmts[0];
- } else {
+ }
+ else {
rv->c->pix_fmt = PIX_FMT_YUVJ420P;
}
@@ -641,7 +639,8 @@ static int add_to_proxy_output_ffmpeg(
}
return 1;
- } else {
+ }
+ else {
return 0;
}
}
@@ -694,11 +693,12 @@ static void free_proxy_output_ffmpeg(struct proxy_output_ctx * ctx,
if (rollback) {
unlink(fname_tmp);
- } else {
+ }
+ else {
get_proxy_filename(ctx->anim, ctx->proxy_size,
fname, FALSE);
unlink(fname);
- rename(fname_tmp, fname);
+ BLI_rename(fname_tmp, fname);
}
MEM_freeN(ctx);
@@ -739,7 +739,7 @@ static IndexBuildContext *index_ffmpeg_create_context(struct anim *anim, IMB_Tim
memset(context->proxy_ctx, 0, sizeof(context->proxy_ctx));
memset(context->indexer, 0, sizeof(context->indexer));
- if(av_open_input_file(&context->iFormatCtx, anim->name, NULL, 0, NULL) != 0) {
+ if (av_open_input_file(&context->iFormatCtx, anim->name, NULL, 0, NULL) != 0) {
MEM_freeN(context);
return NULL;
}
@@ -755,7 +755,7 @@ static IndexBuildContext *index_ffmpeg_create_context(struct anim *anim, IMB_Tim
/* Find the video stream */
context->videoStream = -1;
for (i = 0; i < context->iFormatCtx->nb_streams; i++)
- if(context->iFormatCtx->streams[i]->codec->codec_type
+ if (context->iFormatCtx->streams[i]->codec->codec_type
== AVMEDIA_TYPE_VIDEO) {
if (streamcount > 0) {
streamcount--;
@@ -863,7 +863,7 @@ static int index_rebuild_ffmpeg(FFmpegIndexBuilderContext *context,
frame_rate = av_q2d(context->iStream->r_frame_rate);
pts_time_base = av_q2d(context->iStream->time_base);
- while(av_read_frame(context->iFormatCtx, &next_packet) >= 0) {
+ while (av_read_frame(context->iFormatCtx, &next_packet) >= 0) {
int frame_finished = 0;
float next_progress = (float)((int)floor(((double) next_packet.pos) * 100 /
((double) stream_size)+0.5)) / 100;
@@ -927,7 +927,7 @@ static int index_rebuild_ffmpeg(FFmpegIndexBuilderContext *context,
if (context->tcs_in_use & tc_types[i]) {
int tc_frameno = frameno;
- if(tc_types[i] == IMB_TC_RECORD_RUN_NO_GAPS)
+ if (tc_types[i] == IMB_TC_RECORD_RUN_NO_GAPS)
tc_frameno = frameno_gapless;
IMB_index_builder_proc_frame(
@@ -1056,7 +1056,8 @@ static void index_rebuild_fallback_finish(FallbackIndexBuilderContext *context,
if (stop) {
unlink(fname_tmp);
- } else {
+ }
+ else {
unlink(fname);
rename(fname_tmp, fname);
}
diff --git a/source/blender/imbuf/intern/indexer_dv.c b/source/blender/imbuf/intern/indexer_dv.c
index 4ccd8ec464d..f0c38f6db06 100644
--- a/source/blender/imbuf/intern/indexer_dv.c
+++ b/source/blender/imbuf/intern/indexer_dv.c
@@ -139,7 +139,8 @@ static void parse_packet(indexer_dv_context * This, unsigned char * p)
This->rec_curr_year = parse_bcd(&b, 8);
if (This->rec_curr_year < 25) {
This->rec_curr_year += 2000;
- } else {
+ }
+ else {
This->rec_curr_year += 1900;
}
This->got_record_date = 1;
@@ -201,7 +202,7 @@ static void parse_audio_headers(
{
int i;
- for(i = 0; i < 9; i++) {
+ for (i = 0; i < 9; i++) {
if (target[3] != 0xff) {
parse_packet(This, target + 3);
}
@@ -238,7 +239,8 @@ static void inc_frame(int * frame, time_t * t, int isPAL)
if (isPAL && *frame >= 25) {
(*t)++;
*frame = 0;
- } else if (!isPAL && *frame >= 30) {
+ }
+ else if (!isPAL && *frame >= 30) {
(*t)++;
*frame = 0;
}
@@ -308,7 +310,8 @@ static void proc_frame(indexer_dv_context * This,
if (This->ref_time_read < 0) {
This->ref_time_read = This->ref_time_read_new;
This->curr_frame = 0;
- } else {
+ }
+ else {
if (This->ref_time_read_new - This->ref_time_read == 1) {
This->curr_frame = 0;
This->ref_time_read = This->ref_time_read_new;
@@ -316,9 +319,11 @@ static void proc_frame(indexer_dv_context * This,
fill_gap(This, isPAL);
This->gap_frame = -1;
}
- } else if (This->ref_time_read_new == This->ref_time_read) {
+ }
+ else if (This->ref_time_read_new == This->ref_time_read) {
// do nothing
- } else {
+ }
+ else {
This->gap_start = This->ref_time_read;
This->gap_frame = This->curr_frame;
This->ref_time_read = This->ref_time_read_new;
@@ -347,7 +352,8 @@ static void indexer_dv_proc_frame(anim_index_builder * idx,
if (This->curr_frame >= 0) {
write_index(This, entry);
inc_frame(&This->curr_frame, &This->ref_time_read, isPAL);
- } else {
+ }
+ else {
This->backbuffer[This->fsize++] = *entry;
if (This->fsize >= 31) {
int i;
diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c
index 83351b5e0e4..e775d0f7bbd 100644
--- a/source/blender/imbuf/intern/iris.c
+++ b/source/blender/imbuf/intern/iris.c
@@ -196,7 +196,7 @@ static int writetab(FILE *outf, unsigned int *tab, int len)
{
int r = 0;
- while(len) {
+ while (len) {
r = putlong(outf,*tab++);
len -= 4;
}
@@ -205,7 +205,7 @@ static int writetab(FILE *outf, unsigned int *tab, int len)
static void readtab(FILE *inf, unsigned int *tab, int len)
{
- while(len) {
+ while (len) {
*tab++ = getlong(inf);
len -= 4;
}
@@ -216,13 +216,13 @@ static void test_endian_zbuf(struct ImBuf *ibuf)
int len;
int *zval;
- if( BIG_LONG(1) == 1 ) return;
- if(ibuf->zbuf == NULL) return;
+ if ( BIG_LONG(1) == 1 ) return;
+ if (ibuf->zbuf == NULL) return;
len= ibuf->x*ibuf->y;
zval= ibuf->zbuf;
- while(len--) {
+ while (len--) {
zval[0]= BIG_LONG(zval[0]);
zval++;
}
@@ -262,7 +262,7 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
(void)size; /* unused */
- if(!imb_is_a_iris(mem)) return NULL;
+ if (!imb_is_a_iris(mem)) return NULL;
/*printf("new iris\n");*/
@@ -270,14 +270,14 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
file_offset = 0;
readheader(inf, &image);
- if(image.imagic != IMAGIC) {
+ if (image.imagic != IMAGIC) {
fprintf(stderr,"longimagedata: bad magic number in image file\n");
return(NULL);
}
rle = ISRLE(image.type);
bpp = BPP(image.type);
- if(bpp != 1 && bpp != 2) {
+ if (bpp != 1 && bpp != 2) {
fprintf(stderr,"longimagedata: image must have 1 or 2 byte per pix chan\n");
return(NULL);
}
@@ -313,7 +313,7 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
}
cur = starttab[y+z*ysize];
}
- if(badorder)
+ if (badorder)
break;
}
@@ -325,9 +325,9 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
zbase = (unsigned int *)ibuf->zbuf;
if (badorder) {
- for(z=0; z<zsize; z++) {
+ for (z=0; z<zsize; z++) {
lptr = base;
- for(y=0; y<ysize; y++) {
+ for (y=0; y<ysize; y++) {
file_offset = starttab[y+z*ysize];
rledat = file_data + file_offset;
@@ -337,20 +337,21 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
lptr += xsize;
}
}
- } else {
+ }
+ else {
lptr = base;
zptr = zbase;
- for(y=0; y<ysize; y++) {
+ for (y=0; y<ysize; y++) {
- for(z=0; z<zsize; z++) {
+ for (z=0; z<zsize; z++) {
file_offset = starttab[y+z*ysize];
rledat = file_data + file_offset;
file_offset += lengthtab[y+z*ysize];
- if(z<4) expandrow((uchar *)lptr, rledat, 3-z);
- else if(z<8) expandrow((uchar *)zptr, rledat, 7-z);
+ if (z<4) expandrow((uchar *)lptr, rledat, 3-z);
+ else if (z<8) expandrow((uchar *)zptr, rledat, 7-z);
}
lptr += xsize;
zptr += xsize;
@@ -358,16 +359,17 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
}
- } else { /* bpp == 2 */
+ }
+ else { /* bpp == 2 */
ibuf = IMB_allocImBuf(xsize, ysize, 32, (flags & IB_rect)|IB_rectfloat);
fbase = ibuf->rect_float;
if (badorder) {
- for(z=0; z<zsize; z++) {
+ for (z=0; z<zsize; z++) {
fptr = fbase;
- for(y=0; y<ysize; y++) {
+ for (y=0; y<ysize; y++) {
file_offset = starttab[y+z*ysize];
rledat = file_data + file_offset;
@@ -377,12 +379,13 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
fptr += xsize * 4;
}
}
- } else {
+ }
+ else {
fptr = fbase;
- for(y=0; y<ysize; y++) {
+ for (y=0; y<ysize; y++) {
- for(z=0; z<zsize; z++) {
+ for (z=0; z<zsize; z++) {
file_offset = starttab[y+z*ysize];
@@ -400,7 +403,8 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
MEM_freeN(starttab);
MEM_freeN(lengthtab);
- } else {
+ }
+ else {
if (bpp == 1) {
ibuf = IMB_allocImBuf(xsize, ysize, 8 * zsize, IB_rect);
@@ -412,12 +416,12 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
file_offset = 512;
rledat = file_data + file_offset;
- for(z = 0; z < zsize; z++) {
+ for (z = 0; z < zsize; z++) {
- if(z<4) lptr = base;
- else if(z<8) lptr= zbase;
+ if (z<4) lptr = base;
+ else if (z<8) lptr= zbase;
- for(y = 0; y < ysize; y++) {
+ for (y = 0; y < ysize; y++) {
interleaverow((uchar *)lptr, rledat, 3-z, xsize);
rledat += xsize;
@@ -426,7 +430,8 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
}
}
- } else { /* bpp == 2 */
+ }
+ else { /* bpp == 2 */
ibuf = IMB_allocImBuf(xsize, ysize, 32, (flags & IB_rect)|IB_rectfloat);
@@ -435,11 +440,11 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
file_offset = 512;
rledat = file_data + file_offset;
- for(z = 0; z < zsize; z++) {
+ for (z = 0; z < zsize; z++) {
fptr = fbase;
- for(y = 0; y < ysize; y++) {
+ for (y = 0; y < ysize; y++) {
interleaverow2(fptr, rledat, 3-z, xsize);
rledat += xsize * 2;
@@ -455,14 +460,15 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
if (bpp == 1) {
uchar * rect;
- if (image.zsize == 1){
+ if (image.zsize == 1) {
rect = (uchar *) ibuf->rect;
for (x = ibuf->x * ibuf->y; x > 0; x--) {
rect[0] = 255;
rect[1] = rect[2] = rect[3];
rect += 4;
}
- } else if (image.zsize == 2){
+ }
+ else if (image.zsize == 2) {
/* grayscale with alpha */
rect = (uchar *) ibuf->rect;
for (x = ibuf->x * ibuf->y; x > 0; x--) {
@@ -470,7 +476,8 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
rect[1] = rect[2] = rect[3];
rect += 4;
}
- } else if (image.zsize == 3){
+ }
+ else if (image.zsize == 3) {
/* add alpha */
rect = (uchar *) ibuf->rect;
for (x = ibuf->x * ibuf->y; x > 0; x--) {
@@ -479,16 +486,18 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
}
}
- } else { /* bpp == 2 */
+ }
+ else { /* bpp == 2 */
- if (image.zsize == 1){
+ if (image.zsize == 1) {
fbase = ibuf->rect_float;
for (x = ibuf->x * ibuf->y; x > 0; x--) {
fbase[0] = 1;
fbase[1] = fbase[2] = fbase[3];
fbase += 4;
}
- } else if (image.zsize == 2){
+ }
+ else if (image.zsize == 2) {
/* grayscale with alpha */
fbase = ibuf->rect_float;
for (x = ibuf->x * ibuf->y; x > 0; x--) {
@@ -496,7 +505,8 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
fbase[1] = fbase[2] = fbase[3];
fbase += 4;
}
- } else if (image.zsize == 3){
+ }
+ else if (image.zsize == 3) {
/* add alpha */
fbase = ibuf->rect_float;
for (x = ibuf->x * ibuf->y; x > 0; x--) {
@@ -530,7 +540,7 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
static void interleaverow(unsigned char *lptr, unsigned char *cptr, int z, int n)
{
lptr += z;
- while(n--) {
+ while (n--) {
*lptr = *cptr++;
lptr += 4;
}
@@ -539,7 +549,7 @@ static void interleaverow(unsigned char *lptr, unsigned char *cptr, int z, int n
static void interleaverow2(float *lptr, unsigned char *cptr, int z, int n)
{
lptr += z;
- while(n--) {
+ while (n--) {
*lptr = ((cptr[0]<<8) | (cptr[1]<<0)) / (float)0xFFFF;
cptr += 2;
lptr += 4;
@@ -552,14 +562,14 @@ static void expandrow2(float *optr, unsigned char *iptr, int z)
float pixel_f;
optr += z;
- while(1) {
+ while (1) {
pixel = (iptr[0]<<8) | (iptr[1]<<0);
iptr += 2;
if ( !(count = (pixel & 0x7f)) )
return;
- if(pixel & 0x80) {
- while(count>=8) {
+ if (pixel & 0x80) {
+ while (count>=8) {
optr[0*4] = ((iptr[0]<<8) | (iptr[1]<<0))/(float)0xFFFF;
optr[1*4] = ((iptr[2]<<8) | (iptr[3]<<0))/(float)0xFFFF;
optr[2*4] = ((iptr[4]<<8) | (iptr[5]<<0))/(float)0xFFFF;
@@ -572,16 +582,17 @@ static void expandrow2(float *optr, unsigned char *iptr, int z)
iptr += 8*2;
count -= 8;
}
- while(count--) {
+ while (count--) {
*optr = ((iptr[0]<<8) | (iptr[1]<<0))/(float)0xFFFF;
iptr+=2;
optr+=4;
}
- } else {
+ }
+ else {
pixel_f = ((iptr[0]<<8) | (iptr[1]<<0))/(float)0xFFFF;
iptr += 2;
- while(count>=8) {
+ while (count>=8) {
optr[0*4] = pixel_f;
optr[1*4] = pixel_f;
optr[2*4] = pixel_f;
@@ -593,7 +604,7 @@ static void expandrow2(float *optr, unsigned char *iptr, int z)
optr += 8*4;
count -= 8;
}
- while(count--) {
+ while (count--) {
*optr = pixel_f;
optr+=4;
}
@@ -606,12 +617,12 @@ static void expandrow(unsigned char *optr, unsigned char *iptr, int z)
unsigned char pixel, count;
optr += z;
- while(1) {
+ while (1) {
pixel = *iptr++;
if ( !(count = (pixel & 0x7f)) )
return;
- if(pixel & 0x80) {
- while(count>=8) {
+ if (pixel & 0x80) {
+ while (count>=8) {
optr[0*4] = iptr[0];
optr[1*4] = iptr[1];
optr[2*4] = iptr[2];
@@ -624,13 +635,14 @@ static void expandrow(unsigned char *optr, unsigned char *iptr, int z)
iptr += 8;
count -= 8;
}
- while(count--) {
+ while (count--) {
*optr = *iptr++;
optr+=4;
}
- } else {
+ }
+ else {
pixel = *iptr++;
- while(count>=8) {
+ while (count>=8) {
optr[0*4] = pixel;
optr[1*4] = pixel;
optr[2*4] = pixel;
@@ -642,7 +654,7 @@ static void expandrow(unsigned char *optr, unsigned char *iptr, int z)
optr += 8*4;
count -= 8;
}
- while(count--) {
+ while (count--) {
*optr = pixel;
optr+=4;
}
@@ -674,8 +686,8 @@ static int output_iris(unsigned int *lptr, int xsize, int ysize, int zsize, cons
int rlebuflen, goodwrite;
goodwrite = 1;
- outf = fopen(name, "wb");
- if(!outf) return 0;
+ outf = BLI_fopen(name, "wb");
+ if (!outf) return 0;
tablen = ysize*zsize*sizeof(int);
@@ -689,7 +701,7 @@ static int output_iris(unsigned int *lptr, int xsize, int ysize, int zsize, cons
memset(image, 0, sizeof(IMAGE));
image->imagic = IMAGIC;
image->type = RLE(1);
- if(zsize>1)
+ if (zsize>1)
image->dim = 3;
else
image->dim = 2;
@@ -710,14 +722,14 @@ static int output_iris(unsigned int *lptr, int xsize, int ysize, int zsize, cons
len = compressrow((uchar *)lumbuf,rlebuf,CHANOFFSET(z),xsize);
}
else {
- if(z<4) {
+ if (z<4) {
len = compressrow((uchar *)lptr, rlebuf,CHANOFFSET(z),xsize);
}
- else if(z<8 && zptr) {
+ else if (z<8 && zptr) {
len = compressrow((uchar *)zptr, rlebuf,CHANOFFSET(z-4),xsize);
}
}
- if(len>rlebuflen) {
+ if (len>rlebuflen) {
fprintf(stderr,"output_iris: rlebuf is too small - bad poop\n");
exit(1);
}
@@ -727,7 +739,7 @@ static int output_iris(unsigned int *lptr, int xsize, int ysize, int zsize, cons
pos += len;
}
lptr += xsize;
- if(zptr) zptr += xsize;
+ if (zptr) zptr += xsize;
}
fseek(outf,512,SEEK_SET);
@@ -739,7 +751,7 @@ static int output_iris(unsigned int *lptr, int xsize, int ysize, int zsize, cons
MEM_freeN(rlebuf);
MEM_freeN(lumbuf);
fclose(outf);
- if(goodwrite)
+ if (goodwrite)
return 1;
else {
fprintf(stderr,"output_iris: not enough space for image!!\n");
@@ -752,7 +764,7 @@ static int output_iris(unsigned int *lptr, int xsize, int ysize, int zsize, cons
static void lumrow(unsigned char *rgbptr, unsigned char *lumptr, int n)
{
lumptr += CHANOFFSET(0);
- while(n--) {
+ while (n--) {
*lumptr = ILUM(rgbptr[OFFSET_R],rgbptr[OFFSET_G],rgbptr[OFFSET_B]);
lumptr += 4;
rgbptr += 4;
@@ -770,18 +782,18 @@ static int compressrow(unsigned char *lbuf, unsigned char *rlebuf, int z, int cn
ibufend = iptr+cnt*4;
optr = rlebuf;
- while(iptr<ibufend) {
+ while (iptr<ibufend) {
sptr = iptr;
iptr += 8;
- while((iptr<ibufend)&& ((iptr[-8]!=iptr[-4])||(iptr[-4]!=iptr[0])))
+ while ((iptr<ibufend)&& ((iptr[-8]!=iptr[-4])||(iptr[-4]!=iptr[0])))
iptr+=4;
iptr -= 8;
count = (iptr-sptr)/4;
- while(count) {
+ while (count) {
todo = count>126 ? 126:count;
count -= todo;
*optr++ = 0x80|todo;
- while(todo>8) {
+ while (todo>8) {
optr[0] = sptr[0*4];
optr[1] = sptr[1*4];
optr[2] = sptr[2*4];
@@ -795,7 +807,7 @@ static int compressrow(unsigned char *lbuf, unsigned char *rlebuf, int z, int cn
sptr += 8*4;
todo -= 8;
}
- while(todo--) {
+ while (todo--) {
*optr++ = *sptr;
sptr += 4;
}
@@ -803,10 +815,10 @@ static int compressrow(unsigned char *lbuf, unsigned char *rlebuf, int z, int cn
sptr = iptr;
cc = *iptr;
iptr += 4;
- while( (iptr<ibufend) && (*iptr == cc) )
+ while ( (iptr<ibufend) && (*iptr == cc) )
iptr += 4;
count = (iptr-sptr)/4;
- while(count) {
+ while (count) {
todo = count>126 ? 126:count;
count -= todo;
*optr++ = todo;
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index 3d88a24ba37..275d19d518c 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;
}
@@ -196,7 +195,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
ibuf= IMB_allocImBuf(w, h, planes, use_float ? IB_rectfloat : IB_rect);
if (ibuf==NULL) {
- if(dinfo)
+ if (dinfo)
opj_destroy_decompress(dinfo);
return NULL;
}
@@ -218,7 +217,8 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
else
rect_float[3]= 1.0f;
}
- } else {
+ }
+ else {
/* rgb or rgba 12bits+ */
for (i = 0; i < w * h; i++, rect_float+=4) {
index = w * h - ((i) / (w) + 1) * w + (i) % (w);
@@ -234,7 +234,8 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
}
}
- } else {
+ }
+ else {
unsigned char *rect= (unsigned char *)ibuf->rect;
if (image->numcomps < 3) {
@@ -249,7 +250,8 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
else
rect[3]= 255;
}
- } else {
+ }
+ else {
/* 8bit rgb or rgba */
for (i = 0; i < w * h; i++, rect+=4) {
int index = w * h - ((i) / (w) + 1) * w + (i) % (w);
@@ -267,7 +269,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
}
/* free remaining structures */
- if(dinfo) {
+ if (dinfo) {
opj_destroy_decompress(dinfo);
}
@@ -293,11 +295,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 +331,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;
@@ -366,13 +368,13 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *imag
int i;
float temp_rate;
- switch (parameters->cp_cinema){
+ switch (parameters->cp_cinema) {
case CINEMA2K_24:
case CINEMA2K_48:
- if(parameters->numresolution > 6){
+ if (parameters->numresolution > 6) {
parameters->numresolution = 6;
}
- if (!((image->comps[0].w == 2048) || (image->comps[0].h == 1080))){
+ if (!((image->comps[0].w == 2048) || (image->comps[0].h == 1080))) {
fprintf(stdout,"Image coordinates %d x %d is not 2K compliant.\nJPEG Digital Cinema Profile-3 "
"(2K profile) compliance requires that at least one of coordinates match 2048 x 1080\n",
image->comps[0].w,image->comps[0].h);
@@ -381,15 +383,16 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *imag
break;
case CINEMA4K_24:
- if(parameters->numresolution < 1){
- parameters->numresolution = 1;
- }else if(parameters->numresolution > 7){
- parameters->numresolution = 7;
- }
- if (!((image->comps[0].w == 4096) || (image->comps[0].h == 2160))){
- fprintf(stdout,"Image coordinates %d x %d is not 4K compliant.\nJPEG Digital Cinema Profile-4"
- "(4K profile) compliance requires that at least one of coordinates match 4096 x 2160\n",
- image->comps[0].w,image->comps[0].h);
+ if (parameters->numresolution < 1) {
+ parameters->numresolution = 1;
+ }
+ else if (parameters->numresolution > 7) {
+ parameters->numresolution = 7;
+ }
+ if (!((image->comps[0].w == 4096) || (image->comps[0].h == 2160))) {
+ fprintf(stdout,"Image coordinates %d x %d is not 4K compliant.\nJPEG Digital Cinema Profile-4"
+ "(4K profile) compliance requires that at least one of coordinates match 4096 x 2160\n",
+ image->comps[0].w,image->comps[0].h);
parameters->cp_rsiz = STD_RSIZ;
}
parameters->numpocs = initialise_4K_poc(parameters->POC,parameters->numresolution);
@@ -399,21 +402,23 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *imag
break;
}
- switch (parameters->cp_cinema){
+ switch (parameters->cp_cinema) {
case CINEMA2K_24:
case CINEMA4K_24:
- for(i=0 ; i<parameters->tcp_numlayers ; i++){
+ for (i=0 ; i<parameters->tcp_numlayers ; i++) {
temp_rate = 0;
- if (img_fol->rates[i]== 0){
+ if (img_fol->rates[i]== 0) {
parameters->tcp_rates[0]= ((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))/
(CINEMA_24_CS * 8 * image->comps[0].dx * image->comps[0].dy);
- }else{
+ }
+ else {
temp_rate =((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))/
(img_fol->rates[i] * 8 * image->comps[0].dx * image->comps[0].dy);
- if (temp_rate > CINEMA_24_CS ){
+ if (temp_rate > CINEMA_24_CS ) {
parameters->tcp_rates[i]= ((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))/
(CINEMA_24_CS * 8 * image->comps[0].dx * image->comps[0].dy);
- }else{
+ }
+ else {
parameters->tcp_rates[i]= img_fol->rates[i];
}
}
@@ -422,18 +427,20 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *imag
break;
case CINEMA2K_48:
- for(i=0 ; i<parameters->tcp_numlayers ; i++){
+ for (i=0 ; i<parameters->tcp_numlayers ; i++) {
temp_rate = 0;
- if (img_fol->rates[i]== 0){
+ if (img_fol->rates[i]== 0) {
parameters->tcp_rates[0]= ((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))/
(CINEMA_48_CS * 8 * image->comps[0].dx * image->comps[0].dy);
- }else{
+ }
+ else {
temp_rate =((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))/
(img_fol->rates[i] * 8 * image->comps[0].dx * image->comps[0].dy);
- if (temp_rate > CINEMA_48_CS ){
+ if (temp_rate > CINEMA_48_CS ) {
parameters->tcp_rates[0]= ((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))/
(CINEMA_48_CS * 8 * image->comps[0].dx * image->comps[0].dy);
- }else{
+ }
+ else {
parameters->tcp_rates[i]= img_fol->rates[i];
}
}
@@ -478,9 +485,9 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
parameters->cp_cinema= CINEMA2K_24;
}
}
- if (parameters->cp_cinema){
+ if (parameters->cp_cinema) {
img_fol.rates = (float*)MEM_mallocN(parameters->tcp_numlayers * sizeof(float), "jp2_rates");
- for(i=0; i< parameters->tcp_numlayers; i++){
+ for (i=0; i< parameters->tcp_numlayers; i++) {
img_fol.rates[i] = parameters->tcp_rates[i];
}
cinema_parameters(parameters);
@@ -509,7 +516,7 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
/* initialize image components */
memset(&cmptparm[0], 0, 4 * sizeof(opj_image_cmptparm_t));
- for(i = 0; i < numcomps; i++) {
+ for (i = 0; i < numcomps; i++) {
cmptparm[i].prec = prec;
cmptparm[i].bpp = prec;
cmptparm[i].sgnd = 0;
@@ -520,7 +527,7 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
}
/* create the image */
image = opj_image_create(numcomps, &cmptparm[0], color_space);
- if(!image) {
+ if (!image) {
printf("Error: opj_image_create() failed\n");
return NULL;
}
@@ -546,9 +553,9 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
switch (prec) {
case 8: /* Convert blenders float color channels to 8,12 or 16bit ints */
- for(y=h-1; y>=0; y--) {
+ for (y=h-1; y>=0; y--) {
y_row = y*w;
- for(x=0; x<w; x++, rect_float+=4) {
+ for (x=0; x<w; x++, rect_float+=4) {
i = y_row + x;
if (ibuf->profile == IB_PROFILE_LINEAR_RGB)
@@ -566,9 +573,9 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
break;
case 12:
- for(y=h-1; y>=0; y--) {
+ for (y=h-1; y>=0; y--) {
y_row = y*w;
- for(x=0; x<w; x++, rect_float+=4) {
+ for (x=0; x<w; x++, rect_float+=4) {
i = y_row + x;
if (ibuf->profile == IB_PROFILE_LINEAR_RGB)
@@ -585,9 +592,9 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
}
break;
case 16:
- for(y=h-1; y>=0; y--) {
+ for (y=h-1; y>=0; y--) {
y_row = y*w;
- for(x=0; x<w; x++, rect_float+=4) {
+ for (x=0; x<w; x++, rect_float+=4) {
i = y_row + x;
if (ibuf->profile == IB_PROFILE_LINEAR_RGB)
@@ -604,13 +611,14 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
}
break;
}
- } else {
+ }
+ else {
/* just use rect*/
switch (prec) {
case 8:
- for(y=h-1; y>=0; y--) {
+ for (y=h-1; y>=0; y--) {
y_row = y*w;
- for(x=0; x<w; x++, rect+=4) {
+ for (x=0; x<w; x++, rect+=4) {
i = y_row + x;
image->comps[0].data[i] = rect[0];
@@ -623,9 +631,9 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
break;
case 12: /* Up Sampling, a bit pointless but best write the bit depth requested */
- for(y=h-1; y>=0; y--) {
+ for (y=h-1; y>=0; y--) {
y_row = y*w;
- for(x=0; x<w; x++, rect+=4) {
+ for (x=0; x<w; x++, rect+=4) {
i = y_row + x;
image->comps[0].data[i]= UPSAMPLE_8_TO_12(rect[0]);
@@ -637,9 +645,9 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
}
break;
case 16:
- for(y=h-1; y>=0; y--) {
+ for (y=h-1; y>=0; y--) {
y_row = y*w;
- for(x=0; x<w; x++, rect+=4) {
+ for (x=0; x<w; x++, rect+=4) {
i = y_row + x;
image->comps[0].data[i]= UPSAMPLE_8_TO_16(rect[0]);
@@ -656,7 +664,7 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
/* Decide if MCT should be used */
parameters->tcp_mct = image->numcomps == 3 ? 1 : 0;
- if(parameters->cp_cinema){
+ if (parameters->cp_cinema) {
cinema_setup_encoder(parameters,image,&img_fol);
}
@@ -680,9 +688,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 +701,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;
@@ -732,7 +740,7 @@ int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags)
codestream_length = cio_tell(cio);
/* write the buffer to disk */
- f = fopen(name, "wb");
+ f = BLI_fopen(name, "wb");
if (!f) {
fprintf(stderr, "failed to open %s for writing\n", name);
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c
index 6c3b7594264..3f3ebc5872d 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;
@@ -158,7 +158,7 @@ static void skip_input_data(j_decompress_ptr cinfo, long num_bytes)
{
my_src_ptr src = (my_src_ptr) cinfo->src;
- if(num_bytes > 0) {
+ if (num_bytes > 0) {
// prevent skipping over file end
size_t skip_size = (size_t)num_bytes <= src->pub.bytes_in_buffer ? num_bytes : src->pub.bytes_in_buffer;
@@ -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));
}
@@ -373,8 +372,8 @@ static ImBuf * ibJpegImageFromCinfo(struct jpeg_decompress_struct * cinfo, int f
}
marker= cinfo->marker_list;
- while(marker) {
- if(marker->marker != JPEG_COM)
+ while (marker) {
+ if (marker->marker != JPEG_COM)
goto next_stamp_marker;
/*
@@ -386,7 +385,7 @@ static ImBuf * ibJpegImageFromCinfo(struct jpeg_decompress_struct * cinfo, int f
* That is why we need split it to the
* common key/value here.
*/
- if(strncmp((char *) marker->data, "Blender", 7)) {
+ if (strncmp((char *) marker->data, "Blender", 7)) {
/*
* Maybe the file have text that
* we don't know "what it's", in that
@@ -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);
@@ -433,7 +432,7 @@ next_stamp_marker:
}
jpeg_destroy((j_common_ptr) cinfo);
- if(ibuf) {
+ if (ibuf) {
ibuf->ftype = ibuf_ftype;
ibuf->profile = IB_PROFILE_SRGB;
}
@@ -448,7 +447,7 @@ ImBuf * imb_load_jpeg (unsigned char * buffer, size_t size, int flags)
struct my_error_mgr jerr;
ImBuf * ibuf;
- if(!imb_is_a_jpeg(buffer)) return NULL;
+ if (!imb_is_a_jpeg(buffer)) return NULL;
cinfo->err = jpeg_std_error(&jerr.pub);
jerr.pub.error_exit = jpeg_error;
@@ -489,11 +488,11 @@ static void write_jpeg(struct jpeg_compress_struct * cinfo, struct ImBuf * ibuf)
memcpy(neogeo + 6, &ibuf_ftype, 4);
jpeg_write_marker(cinfo, 0xe1, (JOCTET*) neogeo, 10);
- if(ibuf->metadata) {
+ if (ibuf->metadata) {
/* key + max value + "Blender" */
text= MEM_mallocN(530, "stamp info read");
iptr= ibuf->metadata;
- while(iptr) {
+ while (iptr) {
if (!strcmp (iptr->key, "None")) {
jpeg_write_marker(cinfo, JPEG_COM, (JOCTET *) iptr->value, strlen (iptr->value) + 1);
goto next_stamp_info;
@@ -521,11 +520,11 @@ next_stamp_info:
cinfo->input_components *
cinfo->image_width, "jpeg row_pointer");
- for(y = ibuf->y - 1; y >= 0; y--){
+ for (y = ibuf->y - 1; y >= 0; y--) {
rect = (uchar *) (ibuf->rect + y * ibuf->x);
buffer = row_pointer[0];
- switch(cinfo->in_color_space){
+ switch(cinfo->in_color_space) {
case JCS_RGB:
for (x = 0; x < ibuf->x; x++) {
*buffer++ = rect[0];
@@ -578,7 +577,7 @@ static int init_jpeg(FILE * outfile, struct jpeg_compress_struct * cinfo, struct
if (ibuf->planes == 32) cinfo->in_color_space = JCS_UNKNOWN;
#endif
- switch(cinfo->in_color_space){
+ switch(cinfo->in_color_space) {
case JCS_RGB:
cinfo->input_components = 3;
break;
@@ -609,7 +608,7 @@ static int save_stdjpeg(const char *name, struct ImBuf *ibuf)
struct jpeg_compress_struct _cinfo, *cinfo = &_cinfo;
struct my_error_mgr jerr;
- if ((outfile = fopen(name, "wb")) == NULL) return 0;
+ if ((outfile = BLI_fopen(name, "wb")) == NULL) return 0;
jpeg_default_quality = 75;
cinfo->err = jpeg_std_error(&jerr.pub);
@@ -643,7 +642,7 @@ static int save_vidjpeg(const char *name, struct ImBuf *ibuf)
struct jpeg_compress_struct _cinfo, *cinfo = &_cinfo;
struct my_error_mgr jerr;
- if ((outfile = fopen(name, "wb")) == NULL) return 0;
+ if ((outfile = BLI_fopen(name, "wb")) == NULL) return 0;
jpeg_default_quality = 90;
cinfo->err = jpeg_std_error(&jerr.pub);
@@ -713,7 +712,7 @@ static int save_maxjpeg(const char *name, struct ImBuf *ibuf)
struct jpeg_compress_struct _cinfo, *cinfo = &_cinfo;
struct my_error_mgr jerr;
- if ((outfile = fopen(name, "wb")) == NULL) return 0;
+ if ((outfile = BLI_fopen(name, "wb")) == NULL) return 0;
jpeg_default_quality = 100;
cinfo->err = jpeg_std_error(&jerr.pub);
diff --git a/source/blender/imbuf/intern/metadata.c b/source/blender/imbuf/intern/metadata.c
index 2b6fed59004..0da7358b55b 100644
--- a/source/blender/imbuf/intern/metadata.c
+++ b/source/blender/imbuf/intern/metadata.c
@@ -95,7 +95,8 @@ int IMB_metadata_add_field(struct ImBuf* img, const char* key, const char* value
if (!img->metadata) {
img->metadata = MEM_callocN(sizeof(ImMetaData), "ImMetaData");
info = img->metadata;
- } else {
+ }
+ else {
info = img->metadata;
last = info;
while (info) {
diff --git a/source/blender/imbuf/intern/moviecache.c b/source/blender/imbuf/intern/moviecache.c
index fd0a0372a9c..8b18be87b3c 100644
--- a/source/blender/imbuf/intern/moviecache.c
+++ b/source/blender/imbuf/intern/moviecache.c
@@ -77,29 +77,29 @@ typedef struct MovieCacheItem {
static unsigned int moviecache_hashhash(const void *keyv)
{
- MovieCacheKey *key= (MovieCacheKey*)keyv;
+ MovieCacheKey *key = (MovieCacheKey*)keyv;
return key->cache_owner->hashfp(key->userkey);
}
static int moviecache_hashcmp(const void *av, const void *bv)
{
- const MovieCacheKey *a= (MovieCacheKey*)av;
- const MovieCacheKey *b= (MovieCacheKey*)bv;
+ const MovieCacheKey *a = (MovieCacheKey*)av;
+ const MovieCacheKey *b = (MovieCacheKey*)bv;
return a->cache_owner->cmpfp(a->userkey, b->userkey);
}
static void moviecache_keyfree(void *val)
{
- MovieCacheKey *key= (MovieCacheKey*)val;
+ MovieCacheKey *key = (MovieCacheKey*)val;
BLI_mempool_free(key->cache_owner->keys_pool, key);
}
static void moviecache_valfree(void *val)
{
- MovieCacheItem *item= (MovieCacheItem*)val;
+ MovieCacheItem *item = (MovieCacheItem*)val;
if (item->ibuf) {
MEM_CacheLimiter_unmanage(item->c_handle);
@@ -114,13 +114,13 @@ static void check_unused_keys(MovieCache *cache)
GHashIterator *iter;
iter= BLI_ghashIterator_new(cache->hash);
- while(!BLI_ghashIterator_isDone(iter)) {
- MovieCacheKey *key= BLI_ghashIterator_getKey(iter);
- MovieCacheItem *item= BLI_ghashIterator_getValue(iter);
+ while (!BLI_ghashIterator_isDone(iter)) {
+ MovieCacheKey *key = BLI_ghashIterator_getKey(iter);
+ MovieCacheItem *item = BLI_ghashIterator_getValue(iter);
BLI_ghashIterator_step(iter);
- if(!item->ibuf)
+ if (!item->ibuf)
BLI_ghash_remove(cache->hash, key, moviecache_keyfree, moviecache_valfree);
}
@@ -129,20 +129,20 @@ static void check_unused_keys(MovieCache *cache)
static int compare_int(const void *av, const void *bv)
{
- const int *a= (int *)av;
- const int *b= (int *)bv;
- return *a-*b;
+ const int *a = (int *)av;
+ const int *b = (int *)bv;
+ return *a - *b;
}
static void IMB_moviecache_destructor(void *p)
{
- MovieCacheItem *item= (MovieCacheItem *) p;
+ MovieCacheItem *item = (MovieCacheItem *) p;
if (item && item->ibuf) {
IMB_freeImBuf(item->ibuf);
- item->ibuf= NULL;
- item->c_handle= NULL;
+ item->ibuf = NULL;
+ item->c_handle = NULL;
}
}
@@ -150,27 +150,27 @@ static void IMB_moviecache_destructor(void *p)
static size_t IMB_get_size_in_memory(ImBuf *ibuf)
{
int a;
- size_t size= 0, channel_size= 0;
+ size_t size = 0, channel_size = 0;
- size+= sizeof(ImBuf);
+ size += sizeof(ImBuf);
- if(ibuf->rect)
- channel_size+= sizeof(char);
+ if (ibuf->rect)
+ channel_size += sizeof(char);
- if(ibuf->rect_float)
- channel_size+= sizeof(float);
+ if (ibuf->rect_float)
+ channel_size += sizeof(float);
- size+= channel_size*ibuf->x*ibuf->y*ibuf->channels;
+ size += channel_size * ibuf->x * ibuf->y * ibuf->channels;
- if(ibuf->miptot) {
- for(a= 0; a<ibuf->miptot; a++) {
- if(ibuf->mipmap[a])
- size+= IMB_get_size_in_memory(ibuf->mipmap[a]);
+ if (ibuf->miptot) {
+ for (a = 0; a < ibuf->miptot; a++) {
+ if (ibuf->mipmap[a])
+ size += IMB_get_size_in_memory(ibuf->mipmap[a]);
}
}
- if(ibuf->tiles) {
- size+= sizeof(unsigned int)*ibuf->ytiles*ibuf->xtiles;
+ if (ibuf->tiles) {
+ size += sizeof(unsigned int)*ibuf->ytiles*ibuf->xtiles;
}
return size;
@@ -178,23 +178,23 @@ static size_t IMB_get_size_in_memory(ImBuf *ibuf)
static size_t get_item_size (void *p)
{
- size_t size= sizeof(MovieCacheItem);
- MovieCacheItem *item= (MovieCacheItem *) p;
+ size_t size = sizeof(MovieCacheItem);
+ MovieCacheItem *item = (MovieCacheItem *) p;
- if(item->ibuf)
- size+= IMB_get_size_in_memory(item->ibuf);
+ if (item->ibuf)
+ size += IMB_get_size_in_memory(item->ibuf);
return size;
}
void IMB_moviecache_init(void)
{
- limitor= new_MEM_CacheLimiter(IMB_moviecache_destructor, get_item_size);
+ limitor = new_MEM_CacheLimiter(IMB_moviecache_destructor, get_item_size);
}
void IMB_moviecache_destruct(void)
{
- if(limitor)
+ if (limitor)
delete_MEM_CacheLimiter(limitor);
}
@@ -203,17 +203,17 @@ struct MovieCache *IMB_moviecache_create(int keysize, GHashHashFP hashfp, GHashC
{
MovieCache *cache;
- cache= MEM_callocN(sizeof(MovieCache), "MovieCache");
- cache->keys_pool= BLI_mempool_create(sizeof(MovieCacheKey), 64, 64, FALSE, FALSE);
- cache->items_pool= BLI_mempool_create(sizeof(MovieCacheItem), 64, 64, FALSE, FALSE);
- cache->userkeys_pool= BLI_mempool_create(keysize, 64, 64, FALSE, FALSE);
- cache->hash= BLI_ghash_new(moviecache_hashhash, moviecache_hashcmp, "MovieClip ImBuf cache hash");
+ cache = MEM_callocN(sizeof(MovieCache), "MovieCache");
+ cache->keys_pool = BLI_mempool_create(sizeof(MovieCacheKey), 64, 64, 0);
+ cache->items_pool = BLI_mempool_create(sizeof(MovieCacheItem), 64, 64, 0);
+ cache->userkeys_pool = BLI_mempool_create(keysize, 64, 64, 0);
+ cache->hash = BLI_ghash_new(moviecache_hashhash, moviecache_hashcmp, "MovieClip ImBuf cache hash");
- cache->keysize= keysize;
- cache->hashfp= hashfp;
- cache->cmpfp= cmpfp;
- cache->getdatafp= getdatafp;
- cache->proxy= -1;
+ cache->keysize = keysize;
+ cache->hashfp = hashfp;
+ cache->cmpfp = cmpfp;
+ cache->getdatafp = getdatafp;
+ cache->proxy = -1;
return cache;
}
@@ -223,26 +223,26 @@ void IMB_moviecache_put(MovieCache *cache, void *userkey, ImBuf *ibuf)
MovieCacheKey *key;
MovieCacheItem *item;
- if(!limitor)
+ if (!limitor)
IMB_moviecache_init();
IMB_refImBuf(ibuf);
- key= BLI_mempool_alloc(cache->keys_pool);
- key->cache_owner= cache;
- key->userkey= BLI_mempool_alloc(cache->userkeys_pool);
+ key = BLI_mempool_alloc(cache->keys_pool);
+ key->cache_owner = cache;
+ key->userkey = BLI_mempool_alloc(cache->userkeys_pool);
memcpy(key->userkey, userkey, cache->keysize);
- item= BLI_mempool_alloc(cache->items_pool);
- item->ibuf= ibuf;
- item->cache_owner= cache;
- item->last_access= cache->curtime++;
- item->c_handle= NULL;
+ item = BLI_mempool_alloc(cache->items_pool);
+ item->ibuf = ibuf;
+ item->cache_owner = cache;
+ item->last_access = cache->curtime++;
+ item->c_handle = NULL;
BLI_ghash_remove(cache->hash, key, moviecache_keyfree, moviecache_valfree);
BLI_ghash_insert(cache->hash, key, item);
- item->c_handle= MEM_CacheLimiter_insert(limitor, item);
+ item->c_handle = MEM_CacheLimiter_insert(limitor, item);
MEM_CacheLimiter_ref(item->c_handle);
MEM_CacheLimiter_enforce_limits(limitor);
@@ -251,7 +251,7 @@ void IMB_moviecache_put(MovieCache *cache, void *userkey, ImBuf *ibuf)
/* cache limiter can't remove unused keys which points to destoryed values */
check_unused_keys(cache);
- if(cache->points) {
+ if (cache->points) {
MEM_freeN(cache->points);
cache->points= NULL;
}
@@ -262,14 +262,14 @@ ImBuf* IMB_moviecache_get(MovieCache *cache, void *userkey)
MovieCacheKey key;
MovieCacheItem *item;
- key.cache_owner= cache;
- key.userkey= userkey;
- item= (MovieCacheItem*)BLI_ghash_lookup(cache->hash, &key);
+ key.cache_owner = cache;
+ key.userkey = userkey;
+ item = (MovieCacheItem*)BLI_ghash_lookup(cache->hash, &key);
- if(item) {
- item->last_access= cache->curtime++;
+ if (item) {
+ item->last_access = cache->curtime++;
- if(item->ibuf) {
+ if (item->ibuf) {
MEM_CacheLimiter_touch(item->c_handle);
IMB_refImBuf(item->ibuf);
@@ -288,7 +288,7 @@ void IMB_moviecache_free(MovieCache *cache)
BLI_mempool_destroy(cache->items_pool);
BLI_mempool_destroy(cache->userkeys_pool);
- if(cache->points)
+ if (cache->points)
MEM_freeN(cache->points);
MEM_freeN(cache);
@@ -297,40 +297,41 @@ void IMB_moviecache_free(MovieCache *cache)
/* get segments of cached frames. useful for debugging cache policies */
void IMB_moviecache_get_cache_segments(MovieCache *cache, int proxy, int render_flags, int *totseg_r, int **points_r)
{
- *totseg_r= 0;
- *points_r= NULL;
+ *totseg_r = 0;
+ *points_r = NULL;
- if(!cache->getdatafp)
+ if (!cache->getdatafp)
return;
- if(cache->proxy!=proxy || cache->render_flags!=render_flags) {
- if(cache->points)
+ if (cache->proxy != proxy || cache->render_flags != render_flags) {
+ if (cache->points)
MEM_freeN(cache->points);
- cache->points= NULL;
+ cache->points = NULL;
}
- if(cache->points) {
- *totseg_r= cache->totseg;
- *points_r= cache->points;
- } else {
- int totframe= BLI_ghash_size(cache->hash);
- int *frames= MEM_callocN(totframe*sizeof(int), "movieclip cache frames");
- int a, totseg= 0;
+ if (cache->points) {
+ *totseg_r = cache->totseg;
+ *points_r = cache->points;
+ }
+ else {
+ int totframe = BLI_ghash_size(cache->hash);
+ int *frames = MEM_callocN(totframe*sizeof(int), "movieclip cache frames");
+ int a, totseg = 0;
GHashIterator *iter;
- iter= BLI_ghashIterator_new(cache->hash);
+ iter = BLI_ghashIterator_new(cache->hash);
a= 0;
- while(!BLI_ghashIterator_isDone(iter)) {
- MovieCacheKey *key= BLI_ghashIterator_getKey(iter);
- MovieCacheItem *item= BLI_ghashIterator_getValue(iter);
+ while (!BLI_ghashIterator_isDone(iter)) {
+ MovieCacheKey *key = BLI_ghashIterator_getKey(iter);
+ MovieCacheItem *item = BLI_ghashIterator_getValue(iter);
int framenr, curproxy, curflags;
- if(item->ibuf) {
+ if (item->ibuf) {
cache->getdatafp(key->userkey, &framenr, &curproxy, &curflags);
- if(curproxy==proxy && curflags==render_flags)
- frames[a++]= framenr;
+ if (curproxy == proxy && curflags == render_flags)
+ frames[a++] = framenr;
}
BLI_ghashIterator_step(iter);
@@ -341,40 +342,40 @@ void IMB_moviecache_get_cache_segments(MovieCache *cache, int proxy, int render_
qsort(frames, totframe, sizeof(int), compare_int);
/* count */
- for(a= 0; a<totframe; a++) {
- if(a && frames[a]-frames[a-1]!=1)
+ for (a = 0; a < totframe; a++) {
+ if (a && frames[a] - frames[a - 1] != 1)
totseg++;
- if(a==totframe-1)
+ if (a == totframe - 1)
totseg++;
}
- if(totseg) {
+ if (totseg) {
int b, *points;
- points= MEM_callocN(2*sizeof(int)*totseg, "movieclip cache segments");
+ points = MEM_callocN(2*sizeof(int)*totseg, "movieclip cache segments");
/* fill */
- for(a= 0, b= 0; a<totframe; a++) {
- if(a==0)
- points[b++]= frames[a];
+ for (a = 0, b = 0; a < totframe; a++) {
+ if (a == 0)
+ points[b++] = frames[a];
- if(a && frames[a]-frames[a-1]!=1) {
- points[b++]= frames[a-1];
- points[b++]= frames[a];
+ if (a && frames[a] - frames[a - 1] != 1) {
+ points[b++] = frames[a - 1];
+ points[b++] = frames[a];
}
- if(a==totframe-1)
- points[b++]= frames[a];
+ if (a == totframe - 1)
+ points[b++] = frames[a];
}
- *totseg_r= totseg;
- *points_r= points;
+ *totseg_r = totseg;
+ *points_r = points;
- cache->totseg= totseg;
- cache->points= points;
- cache->proxy= proxy;
- cache->render_flags= render_flags;
+ cache->totseg = totseg;
+ cache->points = points;
+ cache->proxy = proxy;
+ cache->render_flags = render_flags;
}
MEM_freeN(frames);
diff --git a/source/blender/imbuf/intern/openexr/SConscript b/source/blender/imbuf/intern/openexr/SConscript
index 082bb82c322..e590077db2b 100644
--- a/source/blender/imbuf/intern/openexr/SConscript
+++ b/source/blender/imbuf/intern/openexr/SConscript
@@ -15,4 +15,7 @@ incs += Split(env['BF_OPENEXR_INC'])
defs = ['WITH_OPENEXR']
+if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
+ incs.append(env['BF_PTHREADS_INC'])
+
env.BlenderLib ('bf_imbuf_openexr', source_files, incs, defs, libtype=['core','player'], priority = [225,180])
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index ad729b34d31..142ed335913 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>
@@ -51,6 +51,7 @@ _CRTIMP void __cdecl _invalid_parameter_noinfo(void)
#include "BLI_blenlib.h"
#include "BLI_math_color.h"
+#include "BLI_threads.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
@@ -93,7 +94,7 @@ _CRTIMP void __cdecl _invalid_parameter_noinfo(void)
using namespace Imf;
using namespace Imath;
-class Mem_IStream: public IStream
+class Mem_IStream: public Imf::IStream
{
public:
@@ -187,7 +188,7 @@ static void openexr_header_metadata(Header *header, struct ImBuf *ibuf)
{
ImMetaData* info;
- for(info= ibuf->metadata; info; info= info->next)
+ for (info= ibuf->metadata; info; info= info->next)
header->insert(info->key, StringAttribute(info->value));
}
@@ -211,7 +212,7 @@ static int imb_save_openexr_half(struct ImBuf *ibuf, const char *name, int flags
if (ibuf->planes==32 && channels >= 4)
header.channels().insert ("A", Channel (HALF));
if (write_zbuf) // z we do as float always
- header.channels().insert ("Z", Channel (FLOAT));
+ header.channels().insert ("Z", Channel (Imf::FLOAT));
FrameBuffer frameBuffer;
OutputFile *file = new OutputFile(name, header);
@@ -229,46 +230,29 @@ static int imb_save_openexr_half(struct ImBuf *ibuf, const char *name, int flags
if (ibuf->planes==32 && channels >= 4)
frameBuffer.insert ("A", Slice (HALF, (char *) &pixels[0].a, xstride, ystride));
if (write_zbuf)
- frameBuffer.insert ("Z", Slice (FLOAT, (char *)(ibuf->zbuf_float + (height-1)*width),
+ frameBuffer.insert ("Z", Slice (Imf::FLOAT, (char *)(ibuf->zbuf_float + (height-1)*width),
sizeof(float), sizeof(float) * -width));
- if(ibuf->rect_float) {
+ 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;
}
}
}
else {
unsigned char *from;
- if(ibuf->profile == IB_PROFILE_LINEAR_RGB) {
+ if (ibuf->profile == IB_PROFILE_LINEAR_RGB) {
for (int i = ibuf->y-1; i >= 0; i--)
{
from= (unsigned char *)ibuf->rect + channels*i*width;
@@ -332,13 +316,13 @@ static int imb_save_openexr_float(struct ImBuf *ibuf, const char *name, int flag
openexr_header_compression(&header, ibuf->ftype & OPENEXR_COMPRESS);
openexr_header_metadata(&header, ibuf);
- header.channels().insert ("R", Channel (FLOAT));
- header.channels().insert ("G", Channel (FLOAT));
- header.channels().insert ("B", Channel (FLOAT));
+ header.channels().insert ("R", Channel (Imf::FLOAT));
+ header.channels().insert ("G", Channel (Imf::FLOAT));
+ header.channels().insert ("B", Channel (Imf::FLOAT));
if (ibuf->planes==32 && channels >= 4)
- header.channels().insert ("A", Channel (FLOAT));
+ header.channels().insert ("A", Channel (Imf::FLOAT));
if (write_zbuf)
- header.channels().insert ("Z", Channel (FLOAT));
+ header.channels().insert ("Z", Channel (Imf::FLOAT));
FrameBuffer frameBuffer;
OutputFile *file = new OutputFile(name, header);
@@ -350,15 +334,15 @@ static int imb_save_openexr_float(struct ImBuf *ibuf, const char *name, int flag
rect[0]= ibuf->rect_float + channels*(height-1)*width;
rect[1]= rect[0]+1;
rect[2]= rect[0]+2;
- rect[3]= (channels >= 4)? rect[0]+3:rect[0]; /* red as alpha, is this needed since alpha isnt written? */
+ rect[3]= (channels >= 4)? rect[0]+3:rect[0]; /* red as alpha, is this needed since alpha isn't written? */
- frameBuffer.insert ("R", Slice (FLOAT, (char *)rect[0], xstride, ystride));
- frameBuffer.insert ("G", Slice (FLOAT, (char *)rect[1], xstride, ystride));
- frameBuffer.insert ("B", Slice (FLOAT, (char *)rect[2], xstride, ystride));
+ frameBuffer.insert ("R", Slice (Imf::FLOAT, (char *)rect[0], xstride, ystride));
+ frameBuffer.insert ("G", Slice (Imf::FLOAT, (char *)rect[1], xstride, ystride));
+ frameBuffer.insert ("B", Slice (Imf::FLOAT, (char *)rect[2], xstride, ystride));
if (ibuf->planes==32 && channels >= 4)
- frameBuffer.insert ("A", Slice (FLOAT, (char *)rect[3], xstride, ystride));
+ frameBuffer.insert ("A", Slice (Imf::FLOAT, (char *)rect[3], xstride, ystride));
if (write_zbuf)
- frameBuffer.insert ("Z", Slice (FLOAT, (char *) (ibuf->zbuf_float + (height-1)*width),
+ frameBuffer.insert ("Z", Slice (Imf::FLOAT, (char *) (ibuf->zbuf_float + (height-1)*width),
sizeof(float), sizeof(float) * -width));
file->setFrameBuffer (frameBuffer);
file->writePixels (height);
@@ -401,11 +385,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};
@@ -468,7 +452,7 @@ void IMB_exr_add_channel(void *handle, const char *layname, const char *passname
echan= (ExrChannel *)MEM_callocN(sizeof(ExrChannel), "exr tile channel");
- if(layname) {
+ if (layname) {
char lay[EXR_LAY_MAXNAME+1], pass[EXR_PASS_MAXNAME+1];
BLI_strncpy(lay, layname, EXR_LAY_MAXNAME);
BLI_strncpy(pass, passname, EXR_PASS_MAXNAME);
@@ -496,8 +480,8 @@ int IMB_exr_begin_write(void *handle, const char *filename, int width, int heigh
data->width= width;
data->height= height;
- for(echan= (ExrChannel *)data->channels.first; echan; echan= echan->next)
- header.channels().insert (echan->name, Channel (FLOAT));
+ for (echan= (ExrChannel *)data->channels.first; echan; echan= echan->next)
+ header.channels().insert (echan->name, Channel (Imf::FLOAT));
openexr_header_compression(&header, compress);
// openexr_header_metadata(&header, ibuf); // no imbuf. cant write
@@ -505,7 +489,7 @@ int IMB_exr_begin_write(void *handle, const char *filename, int width, int heigh
header.insert ("BlenderMultiChannel", StringAttribute ("Blender V2.55.1 and newer"));
- /* avoid crash/abort when we dont have permission to write here */
+ /* avoid crash/abort when we don't have permission to write here */
try {
data->ofile = new OutputFile(filename, header);
}
@@ -529,8 +513,8 @@ void IMB_exrtile_begin_write(void *handle, const char *filename, int mipmap, int
data->height= height;
data->mipmap= mipmap;
- for(echan= (ExrChannel *)data->channels.first; echan; echan= echan->next)
- header.channels().insert (echan->name, Channel (FLOAT));
+ for (echan= (ExrChannel *)data->channels.first; echan; echan= echan->next)
+ header.channels().insert (echan->name, Channel (Imf::FLOAT));
header.setTileDescription (TileDescription (tilex, tiley, (mipmap)? MIPMAP_LEVELS: ONE_LEVEL));
header.lineOrder() = RANDOM_Y;
@@ -546,9 +530,9 @@ int IMB_exr_begin_read(void *handle, const char *filename, int *width, int *heig
{
ExrHandle *data= (ExrHandle *)handle;
- if(BLI_exists(filename) && BLI_file_size(filename)>32) { /* 32 is arbitrary, but zero length files crashes exr */
+ if (BLI_exists(filename) && BLI_file_size(filename)>32) { /* 32 is arbitrary, but zero length files crashes exr */
data->ifile = new InputFile(filename);
- if(data->ifile) {
+ if (data->ifile) {
Box2i dw = data->ifile->header().dataWindow();
data->width= *width = dw.max.x - dw.min.x + 1;
data->height= *height = dw.max.y - dw.min.y + 1;
@@ -571,7 +555,7 @@ void IMB_exr_set_channel(void *handle, const char *layname, const char *passname
ExrChannel *echan;
char name[EXR_TOT_MAXNAME + 1];
- if(layname) {
+ if (layname) {
char lay[EXR_LAY_MAXNAME+1], pass[EXR_PASS_MAXNAME+1];
BLI_strncpy(lay, layname, EXR_LAY_MAXNAME);
BLI_strncpy(pass, passname, EXR_PASS_MAXNAME);
@@ -583,7 +567,7 @@ void IMB_exr_set_channel(void *handle, const char *layname, const char *passname
echan= (ExrChannel *)BLI_findstring(&data->channels, name, offsetof(ExrChannel, name));
- if(echan) {
+ if (echan) {
echan->xstride= xstride;
echan->ystride= ystride;
echan->rect= rect;
@@ -604,10 +588,10 @@ void IMB_exrtile_write_channels(void *handle, int partx, int party, int level)
FrameBuffer frameBuffer;
ExrChannel *echan;
- for(echan= (ExrChannel *)data->channels.first; echan; echan= echan->next) {
+ for (echan= (ExrChannel *)data->channels.first; echan; echan= echan->next) {
float *rect= echan->rect - echan->xstride*partx - echan->ystride*party;
- frameBuffer.insert (echan->name, Slice (FLOAT, (char *)rect,
+ frameBuffer.insert (echan->name, Slice (Imf::FLOAT, (char *)rect,
echan->xstride*sizeof(float), echan->ystride*sizeof(float)));
}
@@ -628,12 +612,12 @@ void IMB_exr_write_channels(void *handle)
FrameBuffer frameBuffer;
ExrChannel *echan;
- if(data->channels.first) {
- for(echan= (ExrChannel *)data->channels.first; echan; echan= echan->next) {
+ if (data->channels.first) {
+ for (echan= (ExrChannel *)data->channels.first; echan; echan= echan->next) {
/* last scanline, stride negative */
float *rect = echan->rect + echan->xstride*(data->height-1)*data->width;
- frameBuffer.insert (echan->name, Slice (FLOAT, (char *)rect,
+ frameBuffer.insert (echan->name, Slice (Imf::FLOAT, (char *)rect,
echan->xstride*sizeof(float), -echan->ystride*sizeof(float)));
}
@@ -660,14 +644,14 @@ void IMB_exr_read_channels(void *handle)
const StringAttribute *ta = data->ifile->header().findTypedAttribute <StringAttribute> ("BlenderMultiChannel");
short flip = (ta && strncmp(ta->value().c_str(), "Blender V2.43", 13)==0); /* 'previous multilayer attribute, flipped */
- for(echan= (ExrChannel *)data->channels.first; echan; echan= echan->next) {
+ for (echan= (ExrChannel *)data->channels.first; echan; echan= echan->next) {
- if(echan->rect) {
- if(flip)
- frameBuffer.insert (echan->name, Slice (FLOAT, (char *)echan->rect,
+ if (echan->rect) {
+ if (flip)
+ frameBuffer.insert (echan->name, Slice (Imf::FLOAT, (char *)echan->rect,
echan->xstride*sizeof(float), echan->ystride*sizeof(float)));
else
- frameBuffer.insert (echan->name, Slice (FLOAT, (char *)(echan->rect + echan->xstride*(data->height-1)*data->width),
+ frameBuffer.insert (echan->name, Slice (Imf::FLOAT, (char *)(echan->rect + echan->xstride*(data->height-1)*data->width),
echan->xstride*sizeof(float), -echan->ystride*sizeof(float)));
}
else
@@ -693,15 +677,15 @@ void IMB_exr_multilayer_convert(void *handle, void *base,
ExrLayer *lay;
ExrPass *pass;
- if(data->layers.first==NULL) {
+ if (data->layers.first==NULL) {
printf("cannot convert multilayer, no layers in handle\n");
return;
}
- for(lay= (ExrLayer *)data->layers.first; lay; lay= lay->next) {
+ for (lay= (ExrLayer *)data->layers.first; lay; lay= lay->next) {
void *laybase= addlayer(base, lay->name);
- if(laybase) {
- for(pass= (ExrPass *)lay->passes.first; pass; pass= pass->next) {
+ if (laybase) {
+ for (pass= (ExrPass *)lay->passes.first; pass; pass= pass->next) {
addpass(base, laybase, pass->name, pass->rect, pass->totchan, pass->chan_id);
pass->rect= NULL;
}
@@ -716,11 +700,11 @@ void IMB_exr_close(void *handle)
ExrLayer *lay;
ExrPass *pass;
- if(data->ifile)
+ if (data->ifile)
delete data->ifile;
- else if(data->ofile)
+ else if (data->ofile)
delete data->ofile;
- else if(data->tofile)
+ else if (data->tofile)
delete data->tofile;
data->ifile= NULL;
@@ -729,9 +713,9 @@ void IMB_exr_close(void *handle)
BLI_freelistN(&data->channels);
- for(lay= (ExrLayer *)data->layers.first; lay; lay= lay->next) {
- for(pass= (ExrPass *)lay->passes.first; pass; pass= pass->next)
- if(pass->rect)
+ for (lay= (ExrLayer *)data->layers.first; lay; lay= lay->next) {
+ for (pass= (ExrPass *)lay->passes.first; pass; pass= pass->next)
+ if (pass->rect)
MEM_freeN(pass->rect);
BLI_freelistN(&lay->passes);
}
@@ -747,11 +731,11 @@ static int imb_exr_split_channel_name(ExrChannel *echan, char *layname, char *pa
{
int plen, len= strlen(echan->name);
- if(len < 4) {
+ if (len < 4) {
printf("multilayer read: name too short: %s\n", echan->name);
return 0;
}
- if(echan->name[len-2]!='.') {
+ if (echan->name[len-2]!='.') {
printf("multilayer read: name has no Channel: %s\n", echan->name);
return 0;
}
@@ -759,19 +743,19 @@ static int imb_exr_split_channel_name(ExrChannel *echan, char *layname, char *pa
len-= 3;
while(len>=0) {
- if(echan->name[len]=='.')
+ if (echan->name[len]=='.')
break;
len--;
}
BLI_strncpy(passname, echan->name+len+1, EXR_PASS_MAXNAME);
plen= strlen(passname);
- if(plen < 3) {
+ if (plen < 3) {
printf("multilayer read: should not happen: %s\n", echan->name);
return 0;
}
passname[plen-2]= 0;
- if(len<1)
+ if (len<1)
layname[0]= 0;
else {
BLI_strncpy(layname, echan->name, EXR_LAY_MAXNAME);
@@ -785,7 +769,7 @@ static ExrLayer *imb_exr_get_layer(ListBase *lb, char *layname)
{
ExrLayer *lay= (ExrLayer *)BLI_findstring(lb, layname, offsetof(ExrLayer, name));
- if(lay==NULL) {
+ if (lay==NULL) {
lay= (ExrLayer *)MEM_callocN(sizeof(ExrLayer), "exr layer");
BLI_addtail(lb, lay);
BLI_strncpy(lay->name, layname, EXR_LAY_MAXNAME);
@@ -798,10 +782,10 @@ static ExrPass *imb_exr_get_pass(ListBase *lb, char *passname)
{
ExrPass *pass= (ExrPass *)BLI_findstring(lb, passname, offsetof(ExrPass, name));
- if(pass==NULL) {
+ if (pass==NULL) {
pass= (ExrPass *)MEM_callocN(sizeof(ExrPass), "exr pass");
- if(strcmp(passname, "Combined")==0)
+ if (strcmp(passname, "Combined")==0)
BLI_addhead(lb, pass);
else
BLI_addtail(lb, pass);
@@ -833,29 +817,29 @@ static ExrHandle *imb_exr_begin_read_mem(InputFile *file, int width, int height)
/* now try to sort out how to assign memory to the channels */
/* first build hierarchical layer list */
- for(echan= (ExrChannel *)data->channels.first; echan; echan= echan->next) {
- if( imb_exr_split_channel_name(echan, layname, passname) ) {
+ for (echan= (ExrChannel *)data->channels.first; echan; echan= echan->next) {
+ if ( imb_exr_split_channel_name(echan, layname, passname) ) {
ExrLayer *lay= imb_exr_get_layer(&data->layers, layname);
ExrPass *pass= imb_exr_get_pass(&lay->passes, passname);
pass->chan[pass->totchan]= echan;
pass->totchan++;
- if(pass->totchan>=EXR_PASS_MAXCHAN)
+ if (pass->totchan>=EXR_PASS_MAXCHAN)
break;
}
}
- if(echan) {
+ if (echan) {
printf("error, too many channels in one pass: %s\n", echan->name);
IMB_exr_close(data);
return NULL;
}
/* with some heuristics, try to merge the channels in buffers */
- for(lay= (ExrLayer *)data->layers.first; lay; lay= lay->next) {
- for(pass= (ExrPass *)lay->passes.first; pass; pass= pass->next) {
- if(pass->totchan) {
+ for (lay= (ExrLayer *)data->layers.first; lay; lay= lay->next) {
+ for (pass= (ExrPass *)lay->passes.first; pass; pass= pass->next) {
+ if (pass->totchan) {
pass->rect= (float *)MEM_mapallocN(width*height*pass->totchan*sizeof(float), "pass rect");
- if(pass->totchan==1) {
+ if (pass->totchan==1) {
echan= pass->chan[0];
echan->rect= pass->rect;
echan->xstride= 1;
@@ -868,14 +852,14 @@ static ExrHandle *imb_exr_begin_read_mem(InputFile *file, int width, int height)
memset(lookup, 0, sizeof(lookup));
/* we can have RGB(A), XYZ(W), UVA */
- if(pass->totchan==3 || pass->totchan==4) {
- if(pass->chan[0]->chan_id=='B' || pass->chan[1]->chan_id=='B' || pass->chan[2]->chan_id=='B') {
+ if (pass->totchan==3 || pass->totchan==4) {
+ if (pass->chan[0]->chan_id=='B' || pass->chan[1]->chan_id=='B' || pass->chan[2]->chan_id=='B') {
lookup[(unsigned int)'R']= 0;
lookup[(unsigned int)'G']= 1;
lookup[(unsigned int)'B']= 2;
lookup[(unsigned int)'A']= 3;
}
- else if(pass->chan[0]->chan_id=='Y' || pass->chan[1]->chan_id=='Y' || pass->chan[2]->chan_id=='Y') {
+ else if (pass->chan[0]->chan_id=='Y' || pass->chan[1]->chan_id=='Y' || pass->chan[2]->chan_id=='Y') {
lookup[(unsigned int)'X']= 0;
lookup[(unsigned int)'Y']= 1;
lookup[(unsigned int)'Z']= 2;
@@ -886,7 +870,7 @@ static ExrHandle *imb_exr_begin_read_mem(InputFile *file, int width, int height)
lookup[(unsigned int)'V']= 1;
lookup[(unsigned int)'A']= 2;
}
- for(a=0; a<pass->totchan; a++) {
+ for (a=0; a<pass->totchan; a++) {
echan= pass->chan[a];
echan->rect= pass->rect + lookup[(unsigned int)echan->chan_id];
echan->xstride= pass->totchan;
@@ -895,7 +879,7 @@ static ExrHandle *imb_exr_begin_read_mem(InputFile *file, int width, int height)
}
}
else { /* unknown */
- for(a=0; a<pass->totchan; a++) {
+ for (a=0; a<pass->totchan; a++) {
echan= pass->chan[a];
echan->rect= pass->rect + a;
echan->xstride= pass->totchan;
@@ -945,8 +929,8 @@ static const char *exr_rgba_channelname(InputFile *file, const char *chan)
/* const Channel &channel = i.channel(); */ /* Not used yet */
const char *str= i.name();
int len= strlen(str);
- if(len) {
- if(BLI_strcasecmp(chan, str+len-1)==0) {
+ if (len) {
+ if (BLI_strcasecmp(chan, str+len-1)==0) {
return str;
}
}
@@ -964,8 +948,8 @@ static int exr_has_zbuffer(InputFile *file)
static int exr_is_renderresult(InputFile *file)
{
const StringAttribute *comments= file->header().findTypedAttribute<StringAttribute>("BlenderMultiChannel");
- if(comments)
-// if(comments->value() == "Blender MultiChannel")
+ if (comments)
+// if (comments->value() == "Blender MultiChannel")
return 1;
return 0;
}
@@ -990,13 +974,13 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, size_t size, int flags)
//printf("OpenEXR-load: image data window %d %d %d %d\n",
// dw.min.x, dw.min.y, dw.max.x, dw.max.y);
- if(0) // debug
+ if (0) // debug
exr_print_filecontents(file);
is_multi= exr_is_renderresult(file);
/* do not make an ibuf when */
- if(is_multi && !(flags & IB_test) && !(flags & IB_multilayer))
+ if (is_multi && !(flags & IB_test) && !(flags & IB_multilayer))
{
printf("Error: can't process EXR multilayer file\n");
}
@@ -1010,11 +994,11 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, size_t size, int flags)
if (!(flags & IB_test))
{
- if(is_multi) /* only enters with IB_multilayer flag set */
+ if (is_multi) /* only enters with IB_multilayer flag set */
{
/* constructs channels for reading, allocates memory in channels */
ExrHandle *handle= imb_exr_begin_read_mem(file, width, height);
- if(handle) {
+ if (handle) {
IMB_exr_read_channels(handle);
ibuf->userdata= handle; /* potential danger, the caller has to check for this! */
return ibuf;
@@ -1034,23 +1018,23 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, size_t size, int flags)
first+= 4*(height-1)*width;
frameBuffer.insert ( exr_rgba_channelname(file, "R"),
- Slice (FLOAT, (char *) first, xstride, ystride));
+ Slice (Imf::FLOAT, (char *) first, xstride, ystride));
frameBuffer.insert ( exr_rgba_channelname(file, "G"),
- Slice (FLOAT, (char *) (first+1), xstride, ystride));
+ Slice (Imf::FLOAT, (char *) (first+1), xstride, ystride));
frameBuffer.insert ( exr_rgba_channelname(file, "B"),
- Slice (FLOAT, (char *) (first+2), xstride, ystride));
+ Slice (Imf::FLOAT, (char *) (first+2), xstride, ystride));
frameBuffer.insert ( exr_rgba_channelname(file, "A"),
- Slice (FLOAT, (char *) (first+3), xstride, ystride, 1, 1, 1.0f)); /* 1.0 is fill value */
+ Slice (Imf::FLOAT, (char *) (first+3), xstride, ystride, 1, 1, 1.0f)); /* 1.0 is fill value */
- if(exr_has_zbuffer(file))
+ if (exr_has_zbuffer(file))
{
float *firstz;
addzbuffloatImBuf(ibuf);
firstz= ibuf->zbuf_float - (dw.min.x - dw.min.y*width);
firstz+= (height-1)*width;
- frameBuffer.insert ("Z", Slice (FLOAT, (char *)firstz , sizeof(float), -width*sizeof(float)));
+ frameBuffer.insert ("Z", Slice (Imf::FLOAT, (char *)firstz , sizeof(float), -width*sizeof(float)));
}
file->setFrameBuffer (frameBuffer);
@@ -1063,7 +1047,7 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, size_t size, int flags)
//
// Disabling this because the sequencer frees immediate.
//
- // if(flag & IM_rect)
+ // if (flag & IM_rect)
// IMB_rect_from_float(ibuf);
}
}
@@ -1083,5 +1067,11 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, size_t size, int flags)
}
+void imb_initopenexr(void)
+{
+ int num_threads = BLI_system_thread_count();
+
+ setGlobalThreadCount(num_threads);
+}
} // export "C"
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.h b/source/blender/imbuf/intern/openexr/openexr_api.h
index 2b3a17ba47d..d12fe2fc49f 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.h
+++ b/source/blender/imbuf/intern/openexr/openexr_api.h
@@ -39,11 +39,13 @@ extern "C" {
#include <stdio.h>
- /**
+/**
* Test presence of OpenEXR file.
- * @param mem pointer to loaded OpenEXR bitstream
+ * \param mem pointer to loaded OpenEXR bitstream
*/
-
+
+void imb_initopenexr (void);
+
int imb_is_a_openexr (unsigned char *mem);
int imb_save_openexr (struct ImBuf *ibuf, const char *name, int flags);
diff --git a/source/blender/imbuf/intern/openexr/openexr_multi.h b/source/blender/imbuf/intern/openexr/openexr_multi.h
index 84e3da0baa7..88d8b09675b 100644
--- a/source/blender/imbuf/intern/openexr/openexr_multi.h
+++ b/source/blender/imbuf/intern/openexr/openexr_multi.h
@@ -36,14 +36,17 @@
/* 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
#define EXR_PASS_MAXCHAN 8
-#ifdef WITH_OPENEXR
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void * IMB_exr_get_handle (void);
void IMB_exr_add_channel (void *handle, const char *layname, const char *passname, int xstride, int ystride, float *rect);
@@ -64,36 +67,8 @@ void IMB_exr_multilayer_convert (void *handle, void *base,
void IMB_exr_close (void *handle);
-
-#else
-
-/* ugly... but we only use it on pipeline.c, render module, now */
-
-void * IMB_exr_get_handle (void) {return NULL;}
-void IMB_exr_add_channel (void *handle, const char *layname, const char *channame, int xstride, int ystride, float *rect) { (void)handle; (void)layname; (void)channame; (void)xstride; (void)ystride; (void)rect; }
-
-int IMB_exr_begin_read (void *handle, const char *filename, int *width, int *height) { (void)handle; (void)filename; (void)width; (void)height; return 0;}
-int IMB_exr_begin_write (void *handle, const char *filename, int width, int height, int compress) { (void)handle; (void)filename; (void)width; (void)height; (void)compress; return 0;}
-void IMB_exrtile_begin_write (void *handle, const char *filename, int mipmap, int width, int height, int tilex, int tiley) { (void)handle; (void)filename; (void)mipmap; (void)width; (void)height; (void)tilex; (void)tiley; }
-
-void IMB_exr_set_channel (void *handle, char *layname, const char *channame, int xstride, int ystride, float *rect) { (void)handle; (void)layname; (void)channame; (void)xstride; (void)ystride; (void)rect; }
-
-void IMB_exr_read_channels (void *handle) { (void)handle; }
-void IMB_exr_write_channels (void *handle) { (void)handle; }
-void IMB_exrtile_write_channels (void *handle, int partx, int party, int level) { (void)handle; (void)partx; (void)party; (void)level; }
-void IMB_exrtile_clear_channels (void *handle) { (void)handle; }
-
-void IMB_exr_multilayer_convert (void *handle, void *base,
- void * (*addlayer)(void *base, char *str),
- void (*addpass)(void *base, void *lay, char *str, float *rect, int totchan, char *chan_id))
- {
- (void)handle; (void)base; (void)addlayer; (void)addpass;
- }
-
-void IMB_exr_close (void *handle) { (void)handle; }
-
+#ifdef __cplusplus
+} // extern "C"
#endif
-
-
#endif /* __OPENEXR_MULTI_H */
diff --git a/source/blender/imbuf/intern/openexr/openexr_stub.cpp b/source/blender/imbuf/intern/openexr/openexr_stub.cpp
new file mode 100644
index 00000000000..e896fc58cf3
--- /dev/null
+++ b/source/blender/imbuf/intern/openexr/openexr_stub.cpp
@@ -0,0 +1,57 @@
+/*
+ * ***** BEGIN GPLLICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Copyright by Gernot Ziegler <gz@lysator.liu.se>.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Austin Benesh, Ton Roosendaal (float, half, speedup, cleanup...).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/imbuf/intern/openexr/openexr_stub.cpp
+ * \ingroup openexr
+ */
+
+#include "openexr_api.h"
+#include "openexr_multi.h"
+
+
+void * IMB_exr_get_handle (void) {return NULL;}
+void IMB_exr_add_channel (void *handle, const char *layname, const char *channame, int xstride, int ystride, float *rect) { (void)handle; (void)layname; (void)channame; (void)xstride; (void)ystride; (void)rect; }
+
+int IMB_exr_begin_read (void *handle, const char *filename, int *width, int *height) { (void)handle; (void)filename; (void)width; (void)height; return 0;}
+int IMB_exr_begin_write (void *handle, const char *filename, int width, int height, int compress) { (void)handle; (void)filename; (void)width; (void)height; (void)compress; return 0;}
+void IMB_exrtile_begin_write (void *handle, const char *filename, int mipmap, int width, int height, int tilex, int tiley) { (void)handle; (void)filename; (void)mipmap; (void)width; (void)height; (void)tilex; (void)tiley; }
+
+void IMB_exr_set_channel (void *handle, const char *layname, const char *channame, int xstride, int ystride, float *rect) { (void)handle; (void)layname; (void)channame; (void)xstride; (void)ystride; (void)rect; }
+
+void IMB_exr_read_channels (void *handle) { (void)handle; }
+void IMB_exr_write_channels (void *handle) { (void)handle; }
+void IMB_exrtile_write_channels (void *handle, int partx, int party, int level) { (void)handle; (void)partx; (void)party; (void)level; }
+void IMB_exrtile_clear_channels (void *handle) { (void)handle; }
+
+void IMB_exr_multilayer_convert (void *handle, void *base,
+ void * (*addlayer)(void *base, char *str),
+ void (*addpass)(void *base, void *lay, char *str, float *rect, int totchan, char *chan_id))
+ {
+ (void)handle; (void)base; (void)addlayer; (void)addpass;
+ }
+
+void IMB_exr_close (void *handle) { (void)handle; }
diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c
index 74047ae74f5..de935c7cc42 100644
--- a/source/blender/imbuf/intern/png.c
+++ b/source/blender/imbuf/intern/png.c
@@ -114,7 +114,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
compression= compression < 0 ? 0 : (compression > 9 ? 9 : compression);
/* for prints */
- if(flags & IB_mem)
+ if (flags & IB_mem)
name= "<memory>";
bytesperpixel = (ibuf->planes + 7) >> 3;
@@ -195,7 +195,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
Flush);
}
else {
- fp = fopen(name, "wb");
+ fp = BLI_fopen(name, "wb");
if (!fp) {
png_destroy_write_struct(&png_ptr, &info_ptr);
MEM_freeN(pixels);
@@ -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);
@@ -256,7 +256,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
}
- if(ibuf->ppm[0] > 0.0 && ibuf->ppm[1] > 0.0) {
+ if (ibuf->ppm[0] > 0.0 && ibuf->ppm[1] > 0.0) {
png_set_pHYs(png_ptr, info_ptr, (unsigned int)(ibuf->ppm[0] + 0.5), (unsigned int)(ibuf->ppm[1] + 0.5), PNG_RESOLUTION_METER);
}
@@ -366,7 +366,8 @@ struct ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags)
png_set_palette_to_rgb(png_ptr);
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
bytesperpixel = 4;
- } else {
+ }
+ else {
bytesperpixel = 3;
}
break;
@@ -392,8 +393,8 @@ struct ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags)
int unit_type;
png_uint_32 xres, yres;
- if(png_get_pHYs(png_ptr, info_ptr, &xres, &yres, &unit_type))
- if(unit_type == PNG_RESOLUTION_METER) {
+ if (png_get_pHYs(png_ptr, info_ptr, &xres, &yres, &unit_type))
+ if (unit_type == PNG_RESOLUTION_METER) {
ibuf->ppm[0]= xres;
ibuf->ppm[1]= yres;
}
@@ -470,7 +471,7 @@ struct ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags)
if (flags & IB_metadata) {
png_text* text_chunks;
int count = png_get_text(png_ptr, info_ptr, &text_chunks, NULL);
- for(i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
IMB_metadata_add_field(ibuf, text_chunks[i].key, text_chunks[i].text);
ibuf->flags |= IB_metadata;
}
diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c
index ec63a93ac69..524f96b72af 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>
@@ -43,7 +43,7 @@
#include "MEM_guardedalloc.h"
-#include "BLI_blenlib.h"
+#include "BLI_fileops.h"
#include "imbuf.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')) {
@@ -263,7 +262,8 @@ static int fwritecolrs(FILE* file, int width, int channels, unsigned char* ibufs
fcol[RED] = fpscan[j];
fcol[GRN] = (channels >= 2)? fpscan[j+1]: fpscan[j];
fcol[BLU] = (channels >= 3)? fpscan[j+2]: fpscan[j];
- } else {
+ }
+ else {
fcol[RED] = (float)ibufscan[j] / 255.f;
fcol[GRN] = (float)((channels >= 2)? ibufscan[j+1]: ibufscan[j]) / 255.f;
fcol[BLU] = (float)((channels >= 3)? ibufscan[j+2]: ibufscan[j]) / 255.f;
@@ -333,7 +333,7 @@ static void writeHeader(FILE *file, int width, int height)
int imb_savehdr(struct ImBuf *ibuf, const char *name, int flags)
{
- FILE* file = fopen(name, "wb");
+ FILE* file = BLI_fopen(name, "wb");
float *fp= NULL;
int y, width=ibuf->x, height=ibuf->y;
unsigned char *cp= NULL;
@@ -344,9 +344,9 @@ int imb_savehdr(struct ImBuf *ibuf, const char *name, int flags)
writeHeader(file, width, height);
- if(ibuf->rect)
+ if (ibuf->rect)
cp= (unsigned char *)ibuf->rect + ibuf->channels*(height-1)*width;
- if(ibuf->rect_float)
+ if (ibuf->rect_float)
fp= ibuf->rect_float + ibuf->channels*(height-1)*width;
for (y=height-1;y>=0;y--) {
@@ -355,8 +355,8 @@ int imb_savehdr(struct ImBuf *ibuf, const char *name, int flags)
printf("HDR write error\n");
return 0;
}
- if(cp) cp-= ibuf->channels*width;
- if(fp) fp-= ibuf->channels*width;
+ if (cp) cp-= ibuf->channels*width;
+ if (fp) fp-= ibuf->channels*width;
}
fclose(file);
diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c
index c2f73efa63f..61f90f7a97a 100644
--- a/source/blender/imbuf/intern/readimage.c
+++ b/source/blender/imbuf/intern/readimage.c
@@ -55,16 +55,16 @@ ImBuf *IMB_ibImageFromMemory(unsigned char *mem, size_t size, int flags, const c
ImBuf *ibuf;
ImFileType *type;
- if(mem == NULL) {
+ if (mem == NULL) {
fprintf(stderr, "%s: NULL pointer\n", __func__);
return NULL;
}
- for(type=IMB_FILE_TYPES; type->is_a; type++) {
- if(type->load) {
+ for (type=IMB_FILE_TYPES; type->is_a; type++) {
+ if (type->load) {
ibuf= type->load(mem, size, flags);
- if(ibuf) {
- if(flags & IB_premul) {
+ if (ibuf) {
+ if (flags & IB_premul) {
IMB_premultiply_alpha(ibuf);
ibuf->flags |= IB_premul;
}
@@ -85,19 +85,19 @@ ImBuf *IMB_loadifffile(int file, int flags, const char *descr)
unsigned char *mem;
size_t size;
- if(file == -1) return NULL;
+ if (file == -1) return NULL;
size= BLI_file_descriptor_size(file);
mem= mmap(NULL, size, PROT_READ, MAP_SHARED, file, 0);
- if(mem==(unsigned char*)-1) {
+ if (mem==(unsigned char*)-1) {
fprintf(stderr, "%s: couldn't get mapping %s\n", __func__, descr);
return NULL;
}
ibuf= IMB_ibImageFromMemory(mem, size, flags, descr);
- if(munmap(mem, size))
+ if (munmap(mem, size))
fprintf(stderr, "%s: couldn't unmap file %s\n", __func__, descr);
return ibuf;
@@ -106,12 +106,12 @@ ImBuf *IMB_loadifffile(int file, int flags, const char *descr)
static void imb_cache_filename(char *filename, const char *name, int flags)
{
/* read .tx instead if it exists and is not older */
- if(flags & IB_tilecache) {
+ if (flags & IB_tilecache) {
BLI_strncpy(filename, name, IB_FILENAME_SIZE);
- if(!BLI_replace_extension(filename, IB_FILENAME_SIZE, ".tx"))
+ if (!BLI_replace_extension(filename, IB_FILENAME_SIZE, ".tx"))
return;
- if(BLI_file_older(name, filename))
+ if (BLI_file_older(name, filename))
return;
}
@@ -126,17 +126,17 @@ ImBuf *IMB_loadiffname(const char *filepath, int flags)
imb_cache_filename(filepath_tx, filepath, flags);
- file = open(filepath_tx, O_BINARY|O_RDONLY);
- if(file < 0) return NULL;
+ file = BLI_open(filepath_tx, O_BINARY|O_RDONLY, 0);
+ if (file < 0) return NULL;
ibuf= IMB_loadifffile(file, flags, filepath_tx);
- if(ibuf) {
+ if (ibuf) {
BLI_strncpy(ibuf->name, filepath, sizeof(ibuf->name));
BLI_strncpy(ibuf->cachename, filepath_tx, sizeof(ibuf->cachename));
- for(a=1; a<ibuf->miptot; a++)
+ for (a=1; a<ibuf->miptot; a++)
BLI_strncpy(ibuf->mipmap[a-1]->cachename, filepath_tx, sizeof(ibuf->cachename));
- if(flags & IB_fields) IMB_de_interlace(ibuf);
+ if (flags & IB_fields) IMB_de_interlace(ibuf);
}
close(file);
@@ -152,12 +152,12 @@ ImBuf *IMB_testiffname(const char *filepath, int flags)
imb_cache_filename(filepath_tx, filepath, flags);
- file = open(filepath_tx,O_BINARY|O_RDONLY);
- if(file < 0) return NULL;
+ file = BLI_open(filepath_tx,O_BINARY|O_RDONLY,0);
+ if (file < 0) return NULL;
ibuf=IMB_loadifffile(file, flags|IB_test|IB_multilayer, filepath_tx);
- if(ibuf) {
+ if (ibuf) {
BLI_strncpy(ibuf->name, filepath, sizeof(ibuf->name));
BLI_strncpy(ibuf->cachename, filepath_tx, sizeof(ibuf->cachename));
}
@@ -173,21 +173,21 @@ static void imb_loadtilefile(ImBuf *ibuf, int file, int tx, int ty, unsigned int
unsigned char *mem;
size_t size;
- if(file == -1) return;
+ if (file == -1) return;
size= BLI_file_descriptor_size(file);
mem= mmap(NULL, size, PROT_READ, MAP_SHARED, file, 0);
- if(mem==(unsigned char*)-1) {
+ if (mem==(unsigned char*)-1) {
fprintf(stderr, "Couldn't get memory mapping for %s\n", ibuf->cachename);
return;
}
- for(type=IMB_FILE_TYPES; type->is_a; type++)
- if(type->load_tile && type->ftype(type, ibuf))
+ for (type=IMB_FILE_TYPES; type->is_a; type++)
+ if (type->load_tile && type->ftype(type, ibuf))
type->load_tile(ibuf, mem, size, tx, ty, rect);
- if(munmap(mem, size))
+ if (munmap(mem, size))
fprintf(stderr, "Couldn't unmap memory for %s.\n", ibuf->cachename);
}
@@ -195,8 +195,8 @@ void imb_loadtile(ImBuf *ibuf, int tx, int ty, unsigned int *rect)
{
int file;
- file = open(ibuf->cachename, O_BINARY|O_RDONLY);
- if(file < 0) return;
+ file = BLI_open(ibuf->cachename, O_BINARY|O_RDONLY, 0);
+ if (file < 0) return;
imb_loadtilefile(ibuf, file, tx, ty, rect);
diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c
index 97b94ae7b27..6ea84fd6717 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;
@@ -61,11 +61,11 @@ static void blend_color_add(char *cp, char *cp1, char *cp2, int fac)
int temp;
temp= cp1[0] + ((fac*cp2[0])/255);
- if(temp>254) cp[0]= 255; else cp[0]= temp;
+ if (temp>254) cp[0]= 255; else cp[0]= temp;
temp= cp1[1] + ((fac*cp2[1])/255);
- if(temp>254) cp[1]= 255; else cp[1]= temp;
+ if (temp>254) cp[1]= 255; else cp[1]= temp;
temp= cp1[2] + ((fac*cp2[2])/255);
- if(temp>254) cp[2]= 255; else cp[2]= temp;
+ if (temp>254) cp[2]= 255; else cp[2]= temp;
}
static void blend_color_sub(char *cp, char *cp1, char *cp2, int fac)
@@ -73,11 +73,11 @@ static void blend_color_sub(char *cp, char *cp1, char *cp2, int fac)
int temp;
temp= cp1[0] - ((fac*cp2[0])/255);
- if(temp<0) cp[0]= 0; else cp[0]= temp;
+ if (temp<0) cp[0]= 0; else cp[0]= temp;
temp= cp1[1] - ((fac*cp2[1])/255);
- if(temp<0) cp[1]= 0; else cp[1]= temp;
+ if (temp<0) cp[1]= 0; else cp[1]= temp;
temp= cp1[2] - ((fac*cp2[2])/255);
- if(temp<0) cp[2]= 0; else cp[2]= temp;
+ if (temp<0) cp[2]= 0; else cp[2]= temp;
}
static void blend_color_mul(char *cp, char *cp1, char *cp2, int fac)
@@ -92,8 +92,8 @@ 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 */
+ /* See if are lighter, if so mix, else don't do anything.
+ * 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];
@@ -105,8 +105,8 @@ 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 */
+ /* See if were darker, if so mix, else don't do anything.
+ * 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];
@@ -201,8 +201,8 @@ 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 */
+ /* See if are lighter, if so mix, else don't do anything.
+ * 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];
@@ -214,8 +214,8 @@ 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 */
+ /* See if were darker, if so mix, else don't do anything.
+ * 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];
@@ -348,7 +348,8 @@ void IMB_rectblend(struct ImBuf *dbuf, struct ImBuf *sbuf, int destx,
if (do_char) srect = sbuf->rect + srcy * sbuf->x + srcx;
if (do_float) srectf = sbuf->rect_float + (srcy * sbuf->x + srcx)*4;
srcskip = sbuf->x;
- } else {
+ }
+ else {
srect = drect;
srectf = drectf;
srcskip = destskip;
@@ -452,7 +453,7 @@ void IMB_rectfill(struct ImBuf *drect, const float col[4])
{
int num;
- if(drect->rect) {
+ if (drect->rect) {
unsigned int *rrect = drect->rect;
char ccol[4];
@@ -466,7 +467,7 @@ void IMB_rectfill(struct ImBuf *drect, const float col[4])
*rrect++ = *((unsigned int*)ccol);
}
- if(drect->rect_float) {
+ if (drect->rect_float) {
float *rrectf = drect->rect_float;
num = drect->x * drect->y;
@@ -514,7 +515,8 @@ void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height,
chr = FTOCHAR(col[0]);
chg = FTOCHAR(col[1]);
chb = FTOCHAR(col[2]);
- } else {
+ }
+ else {
fr = col[0]*a;
fg = col[1]*a;
fb = col[2]*a;
@@ -528,7 +530,8 @@ void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height,
pixel[1] = chg;
pixel[2] = chb;
pixel[3] = 255;
- } else {
+ }
+ else {
int alphatest;
pixel[0] = (char)((fr + ((float)pixel[0]*aich))*255.0f);
pixel[1] = (char)((fg + ((float)pixel[1]*aich))*255.0f);
@@ -550,7 +553,8 @@ void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height,
pixel[1] = col[1];
pixel[2] = col[2];
pixel[3] = 1.0f;
- } else {
+ }
+ else {
float alphatest;
pixel[0] = (col[0]*a) + (pixel[0]*ai);
pixel[1] = (col[1]*a) + (pixel[1]*ai);
diff --git a/source/blender/imbuf/intern/rotate.c b/source/blender/imbuf/intern/rotate.c
index 7ca7445569f..8914d4ee64d 100644
--- a/source/blender/imbuf/intern/rotate.c
+++ b/source/blender/imbuf/intern/rotate.c
@@ -62,7 +62,7 @@ void IMB_flipy(struct ImBuf * ibuf)
y >>= 1;
- for(;y>0;y--) {
+ for (;y>0;y--) {
memcpy(line, top, x*sizeof(int));
memcpy(top, bottom, x*sizeof(int));
memcpy(bottom, line, x*sizeof(int));
@@ -85,7 +85,7 @@ void IMB_flipy(struct ImBuf * ibuf)
y >>= 1;
- for(;y>0;y--) {
+ for (;y>0;y--) {
memcpy(linef, topf, 4*x*sizeof(float));
memcpy(topf, bottomf, 4*x*sizeof(float));
memcpy(bottomf, linef, 4*x*sizeof(float));
@@ -108,16 +108,16 @@ void IMB_flipx(struct ImBuf * ibuf)
y = ibuf->y;
if (ibuf->rect) {
- for(yi=y-1;yi>=0;yi--) {
- for(xr=x-1, xl=0; xr>=xl; xr--, xl++) {
+ for (yi=y-1;yi>=0;yi--) {
+ for (xr=x-1, xl=0; xr>=xl; xr--, xl++) {
SWAP(unsigned int, ibuf->rect[(x*yi)+xr], ibuf->rect[(x*yi)+xl]);
}
}
}
if (ibuf->rect_float) {
- for(yi=y-1;yi>=0;yi--) {
- for(xr=x-1, xl=0; xr>=xl; xr--, xl++) {
+ for (yi=y-1;yi>=0;yi--) {
+ for (xr=x-1, xl=0; xr>=xl; xr--, xl++) {
memcpy(&px_f, &ibuf->rect_float[((x*yi)+xr)*4], 4*sizeof(float));
memcpy(&ibuf->rect_float[((x*yi)+xr)*4], &ibuf->rect_float[((x*yi)+xl)*4], 4*sizeof(float));
memcpy(&ibuf->rect_float[((x*yi)+xl)*4], &px_f, 4*sizeof(float));
diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c
index c131d385874..a7b994beef9 100644
--- a/source/blender/imbuf/intern/scaling.c
+++ b/source/blender/imbuf/intern/scaling.c
@@ -76,10 +76,10 @@ struct ImBuf *IMB_half_x(struct ImBuf *ibuf1)
_p1f = ibuf1->rect_float;
destf= ibuf2->rect_float;
- for(y=ibuf2->y;y>0;y--) {
+ for (y=ibuf2->y;y>0;y--) {
p1 = _p1;
p1f = _p1f;
- for(x = ibuf2->x; x>0; x--) {
+ for (x = ibuf2->x; x>0; x--) {
if (do_rect) {
a = *(p1++);
b = *(p1++);
@@ -136,7 +136,7 @@ struct ImBuf *IMB_double_fast_x(struct ImBuf *ibuf1)
p1f = (float *)ibuf1->rect_float;
destf = (float *)ibuf2->rect_float;
- for(i = ibuf1->y * ibuf1->x; i > 0; i--) {
+ for (i = ibuf1->y * ibuf1->x; i > 0; i--) {
if (do_rect) {
col = *p1++;
*dest++ = col;
@@ -195,7 +195,7 @@ struct ImBuf *IMB_half_y(struct ImBuf *ibuf1)
_p1f = (float *) ibuf1->rect_float;
destf= (float *) ibuf2->rect_float;
- for(y=ibuf2->y; y>0; y--) {
+ for (y=ibuf2->y; y>0; y--) {
if (do_rect) {
p1 = _p1;
p2 = _p1 + (ibuf1->x << 2);
@@ -204,7 +204,7 @@ struct ImBuf *IMB_half_y(struct ImBuf *ibuf1)
p1f = _p1f;
p2f = _p1f + (ibuf1->x << 2);
}
- for(x = ibuf2->x; x > 0; x--) {
+ for (x = ibuf2->x; x > 0; x--) {
if (do_rect) {
a = *(p1++);
b = *(p1++);
@@ -263,15 +263,15 @@ struct ImBuf *IMB_double_fast_y(struct ImBuf *ibuf1)
p1f = (float *) ibuf1->rect_float;
dest1f= (float *) ibuf2->rect_float;
- for(y = ibuf1->y; y > 0; y--) {
+ for (y = ibuf1->y; y > 0; y--) {
if (do_rect) {
dest2 = dest1 + ibuf2->x;
- for(x = ibuf2->x; x > 0; x--) *dest1++ = *dest2++ = *p1++;
+ for (x = ibuf2->x; x > 0; x--) *dest1++ = *dest2++ = *p1++;
dest1 = dest2;
}
if (do_float) {
dest2f = dest1f + (4*ibuf2->x);
- for(x = ibuf2->x * 4; x > 0; x--) *dest1f++ = *dest2f++ = *p1f++;
+ for (x = ibuf2->x * 4; x > 0; x--) *dest1f++ = *dest2f++ = *p1f++;
dest1f = dest2f;
}
}
@@ -301,7 +301,7 @@ void imb_onehalf_no_alloc(struct ImBuf *ibuf2, struct ImBuf *ibuf1)
const short do_rect= (ibuf1->rect != NULL);
const short do_float= (ibuf1->rect_float != NULL) && (ibuf2->rect_float != NULL);
- if(do_rect && (ibuf2->rect == NULL)) {
+ if (do_rect && (ibuf2->rect == NULL)) {
imb_addrectImBuf(ibuf2);
}
@@ -310,10 +310,10 @@ void imb_onehalf_no_alloc(struct ImBuf *ibuf2, struct ImBuf *ibuf1)
p1 = (uchar *) ibuf1->rect;
dest=(uchar *) ibuf2->rect;
- for(y=ibuf2->y;y>0;y--) {
+ for (y=ibuf2->y;y>0;y--) {
if (do_rect) p2 = p1 + (ibuf1->x << 2);
if (do_float) p2f = p1f + (ibuf1->x << 2);
- for(x=ibuf2->x;x>0;x--) {
+ for (x=ibuf2->x;x>0;x--) {
if (do_rect) {
dest[0] = (p1[0] + p2[0] + p1[4] + p2[4]) >> 2;
dest[1] = (p1[1] + p2[1] + p1[5] + p2[5]) >> 2;
@@ -335,7 +335,7 @@ void imb_onehalf_no_alloc(struct ImBuf *ibuf2, struct ImBuf *ibuf1)
}
if (do_rect) p1=p2;
if (do_float) p1f=p2f;
- if(ibuf1->x & 1) {
+ if (ibuf1->x & 1) {
if (do_rect) p1+=4;
if (do_float) p1f+=4;
}
@@ -567,7 +567,8 @@ static void q_scale_byte(unsigned char* in, unsigned char* out, int in_width,
if (dst_width > in_width && dst_height > in_height) {
enlarge_picture_byte(in, out, in_width, in_height,
dst_width, dst_height);
- } else if (dst_width < in_width && dst_height < in_height) {
+ }
+ else if (dst_width < in_width && dst_height < in_height) {
shrink_picture_byte(in, out, in_width, in_height,
dst_width, dst_height);
}
@@ -767,33 +768,34 @@ static void q_scale_float(float* in, float* out, int in_width,
if (dst_width > in_width && dst_height > in_height) {
enlarge_picture_float(in, out, in_width, in_height,
dst_width, dst_height);
- } else if (dst_width < in_width && dst_height < in_height) {
+ }
+ else if (dst_width < in_width && dst_height < in_height) {
shrink_picture_float(in, out, in_width, in_height,
dst_width, dst_height);
}
}
-/* 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 +1475,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 */
@@ -1511,7 +1513,7 @@ struct ImBuf *IMB_scalefastImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned
if (newx == ibuf->x && newy == ibuf->y) return(ibuf);
- if(do_rect) {
+ if (do_rect) {
_newrect = MEM_mallocN(newx * newy * sizeof(int), "scalefastimbuf");
if (_newrect==NULL) return(ibuf);
newrect = _newrect;
@@ -1531,7 +1533,7 @@ struct ImBuf *IMB_scalefastImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned
ofsy = 32768;
for (y = newy; y > 0; y--) {
- if(do_rect) {
+ if (do_rect) {
rect = ibuf->rect;
rect += (ofsy >> 16) * ibuf->x;
}
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c
index 895f922a0da..7aceb695d00 100644
--- a/source/blender/imbuf/intern/targa.c
+++ b/source/blender/imbuf/intern/targa.c
@@ -126,18 +126,18 @@ static short makebody_tga(ImBuf * ibuf, FILE * file, int (*out)(unsigned int, FI
last = *rect++;
this = *rect++;
copy = last^this;
- while (bytes > 0){
- if (copy){
- do{
+ while (bytes > 0) {
+ if (copy) {
+ do {
last = this;
this = *rect++;
- if (last == this){
- if (this == rect[-3]){ /* three the same? */
+ if (last == this) {
+ if (this == rect[-3]) { /* three the same? */
bytes --; /* set bytes */
break;
}
}
- }while (--bytes != 0);
+ } while (--bytes != 0);
copy = rect-rectstart;
copy --;
@@ -146,22 +146,23 @@ static short makebody_tga(ImBuf * ibuf, FILE * file, int (*out)(unsigned int, FI
temp = rect;
rect = rectstart;
- while (copy){
+ while (copy) {
last = copy;
if (copy>=128) last = 128;
copy -= last;
if (fputc(last-1,file) == EOF) return(0);
- do{
+ do {
if (out(*rect++,file) == EOF) return(0);
- }while(--last != 0);
+ } while (--last != 0);
}
rectstart = rect;
rect = temp;
last = this;
copy = FALSE;
- } else {
- while (*rect++ == this){ /* seek for first different byte */
+ }
+ else {
+ while (*rect++ == this) { /* seek for first different byte */
if (--bytes == 0) break; /* oor end of line */
}
rect --;
@@ -170,14 +171,16 @@ static short makebody_tga(ImBuf * ibuf, FILE * file, int (*out)(unsigned int, FI
bytes --;
this = *rect++;
- while (copy){
- if (copy>128){
+ while (copy) {
+ if (copy>128) {
if (fputc(255,file) == EOF) return(0);
copy -= 128;
- } else {
- if (copy == 1){
+ }
+ else {
+ if (copy == 1) {
if (fputc(0,file) == EOF) return(0);
- } else if (fputc(127 + copy,file) == EOF) return(0);
+ }
+ else if (fputc(127 + copy,file) == EOF) return(0);
copy = 0;
}
if (out(last,file) == EOF) return(0);
@@ -201,28 +204,31 @@ static int dumptarga(struct ImBuf * ibuf, FILE * file)
rect = (uchar *) ibuf->rect;
if (ibuf->planes <= 8) {
- while(size > 0){
+ while (size > 0) {
if (putc(*rect, file) == EOF) return (0);
size--;
rect += 4;
}
- } else if (ibuf->planes <= 16) {
- while(size > 0){
+ }
+ else if (ibuf->planes <= 16) {
+ while (size > 0) {
putc(rect[0], file);
if (putc(rect[1], file) == EOF) return (0);
size--;
rect += 4;
}
- } else if (ibuf->planes <= 24) {
- while(size > 0){
+ }
+ else if (ibuf->planes <= 24) {
+ while (size > 0) {
putc(rect[2], file);
putc(rect[1], file);
if (putc(rect[0], file) == EOF) return (0);
size--;
rect += 4;
}
- } else if (ibuf->planes <= 32) {
- while(size > 0){
+ }
+ else if (ibuf->planes <= 32) {
+ while (size > 0) {
putc(rect[2], file);
putc(rect[1], file);
putc(rect[0], file);
@@ -230,7 +236,8 @@ static int dumptarga(struct ImBuf * ibuf, FILE * file)
size--;
rect += 4;
}
- } else return (0);
+ }
+ else return (0);
return (1);
}
@@ -245,9 +252,10 @@ int imb_savetarga(struct ImBuf * ibuf, const char *name, int flags)
(void)flags; /* unused */
buf[16] = (ibuf->planes + 0x7 ) & ~0x7;
- if (ibuf->planes > 8 ){
+ if (ibuf->planes > 8 ) {
buf[2] = 10;
- } else{
+ }
+ else {
buf[2] = 11;
}
@@ -268,7 +276,7 @@ int imb_savetarga(struct ImBuf * ibuf, const char *name, int flags)
if (ibuf->planes==32) {
buf[17] |= 0x08;
}
- fildes = fopen(name,"wb");
+ fildes = BLI_fopen(name,"wb");
if (!fildes) return 0;
if (fwrite(buf, 1, 18,fildes) != 18) {
@@ -278,8 +286,9 @@ int imb_savetarga(struct ImBuf * ibuf, const char *name, int flags)
if (ibuf->ftype == RAWTGA) {
ok = dumptarga(ibuf, fildes);
- } else {
- switch((ibuf->planes + 7) >> 3){
+ }
+ else {
+ switch((ibuf->planes + 7) >> 3) {
case 1:
ok = makebody_tga(ibuf, fildes, tga_out1);
break;
@@ -317,7 +326,7 @@ static int checktarga(TARGA *tga, unsigned char *mem)
tga->imgdes = mem[17];
if (tga->maptyp > 1) return(0);
- switch (tga->imgtyp){
+ switch (tga->imgtyp) {
case 1: /* raw cmap */
case 2: /* raw rgb */
case 3: /* raw b&w */
@@ -346,7 +355,7 @@ int imb_is_a_targa(unsigned char *buf)
static void complete_partial_load(struct ImBuf *ibuf, unsigned int *rect)
{
int size = (ibuf->x * ibuf->y) - (rect - ibuf->rect);
- if(size) {
+ if (size) {
printf("decodetarga: incomplete file, %.1f%% missing\n", 100*((float)size / (ibuf->x * ibuf->y)));
/* not essential but makes displaying partially rendered TGA's less ugly */
@@ -375,18 +384,18 @@ static void decodetarga(struct ImBuf *ibuf, unsigned char *mem, size_t mem_size,
cp[0] = 0xff;
cp[1] = cp[2] = 0;
- while(size > 0){
+ while (size > 0) {
count = *mem++;
- if(mem>mem_end)
+ if (mem>mem_end)
goto partial_load;
if (count >= 128) {
/*if (count == 128) printf("TARGA: 128 in file !\n");*/
count -= 127;
- if (psize & 2){
- if (psize & 1){
+ if (psize & 2) {
+ if (psize & 1) {
/* order = bgra */
cp[0] = mem[3];
cp[1] = mem[0];
@@ -394,19 +403,22 @@ static void decodetarga(struct ImBuf *ibuf, unsigned char *mem, size_t mem_size,
cp[3] = mem[2];
/*col = (mem[3] << 24) + (mem[0] << 16) + (mem[1] << 8) + mem[2];*/
mem += 4;
- } else{
+ }
+ else {
cp[1] = mem[0];
cp[2] = mem[1];
cp[3] = mem[2];
/*col = 0xff000000 + (mem[0] << 16) + (mem[1] << 8) + mem[2];*/
mem += 3;
}
- } else{
- if (psize & 1){
+ }
+ else {
+ if (psize & 1) {
cp[0] = mem[0];
cp[1] = mem[1];
mem += 2;
- } else{
+ }
+ else {
col = *mem++;
}
}
@@ -418,13 +430,14 @@ static void decodetarga(struct ImBuf *ibuf, unsigned char *mem, size_t mem_size,
count--;
}
}
- } else{
+ }
+ else {
count ++;
size -= count;
if (size >= 0) {
- while (count > 0){
- if (psize & 2){
- if (psize & 1){
+ while (count > 0) {
+ if (psize & 2) {
+ if (psize & 1) {
/* order = bgra */
cp[0] = mem[3];
cp[1] = mem[0];
@@ -432,30 +445,33 @@ static void decodetarga(struct ImBuf *ibuf, unsigned char *mem, size_t mem_size,
cp[3] = mem[2];
/*col = (mem[3] << 24) + (mem[0] << 16) + (mem[1] << 8) + mem[2];*/
mem += 4;
- } else{
+ }
+ else {
cp[1] = mem[0];
cp[2] = mem[1];
cp[3] = mem[2];
/*col = 0xff000000 + (mem[0] << 16) + (mem[1] << 8) + mem[2];*/
mem += 3;
}
- } else{
- if (psize & 1){
+ }
+ else {
+ if (psize & 1) {
cp[0] = mem[0];
cp[1] = mem[1];
mem += 2;
- } else{
+ }
+ else {
col = *mem++;
}
}
*rect++ = col;
count --;
- if(mem>mem_end)
+ if (mem>mem_end)
goto partial_load;
}
- if(mem>mem_end)
+ if (mem>mem_end)
goto partial_load;
}
}
@@ -486,12 +502,12 @@ static void ldtarga(struct ImBuf * ibuf,unsigned char * mem, size_t mem_size, in
cp[0] = 0xff;
cp[1] = cp[2] = 0;
- while(size > 0){
- if(mem>mem_end)
+ while (size > 0) {
+ if (mem>mem_end)
goto partial_load;
- if (psize & 2){
- if (psize & 1){
+ if (psize & 2) {
+ if (psize & 1) {
/* order = bgra */
cp[0] = mem[3];
cp[1] = mem[0];
@@ -499,7 +515,8 @@ static void ldtarga(struct ImBuf * ibuf,unsigned char * mem, size_t mem_size, in
cp[3] = mem[2];
/*col = (mem[3] << 24) + (mem[0] << 16) + (mem[1] << 8) + mem[2];*/
mem += 4;
- } else{
+ }
+ else {
/* set alpha for 24 bits colors */
cp[1] = mem[0];
cp[2] = mem[1];
@@ -507,12 +524,14 @@ static void ldtarga(struct ImBuf * ibuf,unsigned char * mem, size_t mem_size, in
/*col = 0xff000000 + (mem[0] << 16) + (mem[1] << 8) + mem[2];*/
mem += 3;
}
- } else{
- if (psize & 1){
+ }
+ else {
+ if (psize & 1) {
cp[0] = mem[0];
cp[1] = mem[1];
mem += 2;
- } else{
+ }
+ else {
col = *mem++;
}
}
@@ -547,7 +566,7 @@ struct ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags)
cp[0] = 0xff;
cp[1] = cp[2] = 0;
- if (tga.mapsize){
+ if (tga.mapsize) {
/* load color map */
/*mincol = tga.maporig;*/ /*UNUSED*/
maxcol = tga.mapsize;
@@ -592,13 +611,13 @@ struct ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags)
if (flags & IB_test) return (ibuf);
if (tga.imgtyp != 1 && tga.imgtyp != 9) { /* happens sometimes (beuh) */
- if(cmap) {
+ if (cmap) {
MEM_freeN(cmap);
cmap= NULL;
}
}
- switch(tga.imgtyp){
+ switch(tga.imgtyp) {
case 1:
case 2:
case 3:
@@ -617,10 +636,10 @@ struct ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags)
break;
}
- if(cmap) {
+ if (cmap) {
/* apply color map */
rect = ibuf->rect;
- for(size = ibuf->x * ibuf->y; size>0; --size, ++rect) {
+ for (size = ibuf->x * ibuf->y; size>0; --size, ++rect) {
col = *rect;
if (col >= 0 && col < maxcol) *rect = cmap[col];
}
@@ -630,7 +649,7 @@ struct ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags)
if (tga.pixsize == 16) {
rect = ibuf->rect;
- for (size = ibuf->x * ibuf->y; size > 0; --size, ++rect){
+ for (size = ibuf->x * ibuf->y; size > 0; --size, ++rect) {
col = *rect;
cp = (uchar*)rect;
mem = (uchar*)&col;
@@ -646,14 +665,14 @@ struct ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags)
ibuf->planes = 24;
}
- if (tga.imgtyp == 3 || tga.imgtyp == 11){
+ if (tga.imgtyp == 3 || tga.imgtyp == 11) {
uchar *crect;
unsigned int *lrect, col;
crect = (uchar *) ibuf->rect;
lrect = (unsigned int *) ibuf->rect;
- for (size = ibuf->x * ibuf->y; size > 0; size --){
+ for (size = ibuf->x * ibuf->y; size > 0; size --) {
col = *lrect++;
crect[0] = 255;
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index 808bcbed751..f5c22b67c1b 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -61,6 +61,7 @@
#include <process.h> /* getpid */
#include <direct.h> /* chdir */
#include "BLI_winstuff.h"
+#include "utfconv.h"
#else
#include <unistd.h>
#endif
@@ -70,8 +71,12 @@
static int get_thumb_dir( char* dir , ThumbSize size)
{
#ifdef WIN32
+ wchar_t dir_16 [MAX_PATH];
/* yes, applications shouldn't store data there, but so does GIMP :)*/
- SHGetSpecialFolderPath(0, dir, CSIDL_PROFILE, 0);
+ SHGetSpecialFolderPathW(0, dir_16, CSIDL_PROFILE, 0);
+ conv_utf_16_to_8(dir_16,dir,FILE_MAX);
+
+
#else
const char* home = getenv("HOME");
if (!home) return 0;
@@ -144,7 +149,8 @@ static void escape_uri_string (const char *string, char* escaped_string, int len
*q++ = '%'; /* means hex coming */
*q++ = hex[c >> 4];
*q++ = hex[c & 15];
- } else {
+ }
+ else {
*q++ = *p;
}
}
@@ -167,7 +173,7 @@ static void to_hex_char(char* hexbytes, const unsigned char* bytes, int len)
/** ----- end of adapted code from glib --- */
-static int uri_from_filename( const char *path, char *uri )
+static int uri_from_filename(const char *path, char *uri)
{
char orig_uri[URI_MAX];
const char* dirstart = path;
@@ -251,8 +257,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;
@@ -275,9 +281,9 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im
}
/* exception, skip images over 100mb */
- if(source == THB_SOURCE_IMAGE) {
+ if (source == THB_SOURCE_IMAGE) {
const size_t size= BLI_file_size(path);
- if(size != -1 && size > THUMB_SIZE_MAX) {
+ if (size != -1 && size > THUMB_SIZE_MAX) {
// printf("file too big: %d, skipping %s\n", (int)size, path);
return NULL;
}
@@ -295,12 +301,13 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im
if (size == THB_FAIL) {
img = IMB_allocImBuf(1,1,32, IB_rect | IB_metadata);
if (!img) return NULL;
- } else {
+ }
+ else {
if (THB_SOURCE_IMAGE == source || THB_SOURCE_BLEND == source) {
/* only load if we didnt give an image */
- if(img==NULL) {
- if(THB_SOURCE_BLEND == source) {
+ if (img==NULL) {
+ if (THB_SOURCE_BLEND == source) {
img = IMB_loadblend_thumb(path);
}
else {
@@ -314,14 +321,16 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im
BLI_snprintf(cwidth, sizeof(cwidth), "%d", img->x);
BLI_snprintf(cheight, sizeof(cheight), "%d", img->y);
}
- } else if (THB_SOURCE_MOVIE == source) {
+ }
+ else if (THB_SOURCE_MOVIE == source) {
struct anim * anim = NULL;
anim = IMB_open_anim(path, IB_rect | IB_metadata, 0);
if (anim != NULL) {
img = IMB_anim_absolute(anim, 0, IMB_TC_NONE, IMB_PROXY_NONE);
if (img == NULL) {
printf("not an anim; %s\n", path);
- } else {
+ }
+ else {
IMB_freeImBuf(img);
img = IMB_anim_previewframe(anim);
}
@@ -344,8 +353,8 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im
ey = (short)scaledy;
/* save some time by only scaling byte buf */
- if(img->rect_float) {
- if(img->rect == NULL) {
+ if (img->rect_float) {
+ if (img->rect == NULL) {
IMB_rect_from_float(img);
}
@@ -438,7 +447,8 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source)
if (thumbpath_from_uri(uri, thumb, sizeof(thumb), size)) {
if (BLI_path_ncmp(path, thumb, sizeof(thumb)) == 0) {
img = IMB_loadiffname(path, IB_rect);
- } else {
+ }
+ else {
img = IMB_loadiffname(thumb, IB_rect | IB_metadata);
if (img) {
char mtime[40];
@@ -446,7 +456,8 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source)
/* illegal thumb, forget it! */
IMB_freeImBuf(img);
img = NULL;
- } else {
+ }
+ else {
time_t t = atol(mtime);
if (st.st_mtime != t) {
/* recreate all thumbs */
@@ -456,7 +467,7 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source)
IMB_thumb_delete(path, THB_LARGE);
IMB_thumb_delete(path, THB_FAIL);
img = IMB_thumb_create(path, size, source, NULL);
- if(!img){
+ if (!img) {
/* thumb creation failed, write fail thumb */
img = IMB_thumb_create(path, THB_FAIL, source, NULL);
if (img) {
@@ -467,9 +478,10 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source)
}
}
}
- } else {
+ }
+ else {
img = IMB_thumb_create(path, size, source, NULL);
- if(!img){
+ if (!img) {
/* thumb creation failed, write fail thumb */
img = IMB_thumb_create(path, THB_FAIL, source, NULL);
if (img) {
diff --git a/source/blender/imbuf/intern/thumbs_blend.c b/source/blender/imbuf/intern/thumbs_blend.c
index 037b4ab63c0..2d477a5f43d 100644
--- a/source/blender/imbuf/intern/thumbs_blend.c
+++ b/source/blender/imbuf/intern/thumbs_blend.c
@@ -30,6 +30,7 @@
#include "zlib.h"
#include "BLI_utildefines.h"
+#include "BLI_fileops.h"
#include "BKE_utildefines.h"
#include "BKE_global.h"
@@ -41,7 +42,7 @@
#include "MEM_guardedalloc.h"
/* extracts the thumbnail from between the 'REND' and the 'GLOB'
- * chunks of the header, dont use typical blend loader because its too slow */
+ * chunks of the header, don't use typical blend loader because its too slow */
static ImBuf *loadblend_thumb(gzFile gzfile)
{
@@ -52,31 +53,31 @@ static ImBuf *loadblend_thumb(gzFile gzfile)
int sizeof_bhead;
/* read the blend file header */
- if(gzread(gzfile, buf, 12) != 12)
+ if (gzread(gzfile, buf, 12) != 12)
return NULL;
- if(strncmp(buf, "BLENDER", 7))
+ if (strncmp(buf, "BLENDER", 7))
return NULL;
- if(buf[7]=='-')
+ if (buf[7]=='-')
pointer_size= 8;
- else if(buf[7]=='_')
+ else if (buf[7]=='_')
pointer_size= 4;
else
return NULL;
sizeof_bhead = 16 + pointer_size;
- if(buf[8]=='V')
+ if (buf[8]=='V')
endian= B_ENDIAN; /* big: PPC */
- else if(buf[8]=='v')
+ else if (buf[8]=='v')
endian= L_ENDIAN; /* little: x86 */
else
return NULL;
endian_switch = ((ENDIAN_ORDER != endian)) ? 1 : 0;
- while(gzread(gzfile, bhead, sizeof_bhead) == sizeof_bhead) {
- if(endian_switch)
+ while (gzread(gzfile, bhead, sizeof_bhead) == sizeof_bhead) {
+ if (endian_switch)
SWITCH_INT(bhead[1]); /* length */
if (bhead[0]==REND) {
@@ -88,14 +89,14 @@ static ImBuf *loadblend_thumb(gzFile gzfile)
}
/* using 'TEST' since new names segfault when loading in old blenders */
- if(bhead[0] == TEST) {
+ if (bhead[0] == TEST) {
ImBuf *img= NULL;
int size[2];
- if(gzread(gzfile, size, sizeof(size)) != sizeof(size))
+ if (gzread(gzfile, size, sizeof(size)) != sizeof(size))
return NULL;
- if(endian_switch) {
+ if (endian_switch) {
SWITCH_INT(size[0]);
SWITCH_INT(size[1]);
}
@@ -103,13 +104,13 @@ static ImBuf *loadblend_thumb(gzFile gzfile)
bhead[1] -= sizeof(int) * 2;
/* inconsistent image size, quit early */
- if(bhead[1] != size[0] * size[1] * sizeof(int))
+ if (bhead[1] != size[0] * size[1] * sizeof(int))
return NULL;
/* finally malloc and read the data */
img= IMB_allocImBuf(size[0], size[1], 32, IB_rect | IB_metadata);
- if(gzread(gzfile, img->rect, bhead[1]) != bhead[1]) {
+ if (gzread(gzfile, img->rect, bhead[1]) != bhead[1]) {
IMB_freeImBuf(img);
img= NULL;
}
@@ -123,9 +124,8 @@ static ImBuf *loadblend_thumb(gzFile gzfile)
ImBuf *IMB_loadblend_thumb(const char *path)
{
gzFile gzfile;
-
/* not necessarily a gzip */
- gzfile = gzopen(path, "rb");
+ gzfile = BLI_gzopen(path, "rb");
if (NULL == gzfile ) {
return NULL;
@@ -151,7 +151,7 @@ void IMB_overlayblend_thumb(unsigned int *thumb, int width, int height, float as
int margin_r = width - MARGIN;
int margin_t = height - MARGIN;
- if(aspect < 1.0f) {
+ if (aspect < 1.0f) {
margin_l= (int)((width - ((float)width * aspect)) / 2.0f);
margin_l += MARGIN;
CLAMP(margin_l, MARGIN, (width/2));
@@ -168,18 +168,19 @@ void IMB_overlayblend_thumb(unsigned int *thumb, int width, int height, float as
int x, y;
int stride_x= (margin_r - margin_l) - 2;
- for(y=0; y < height; y++) {
- for(x=0; x < width; x++, px+=4) {
+ for (y=0; y < height; y++) {
+ for (x=0; x < width; x++, px+=4) {
int hline= 0, vline= 0;
- if((x > margin_l && x < margin_r) && (y > margin_b && y < margin_t)) {
+ if ((x > margin_l && x < margin_r) && (y > margin_b && y < margin_t)) {
/* interior. skip */
x += stride_x;
px += stride_x * 4;
- } else if( (hline=(((x == margin_l || x == margin_r)) && y >= margin_b && y <= margin_t)) ||
- (vline=(((y == margin_b || y == margin_t)) && x >= margin_l && x <= margin_r))
- ) {
+ }
+ else if ((hline=(((x == margin_l || x == margin_r)) && y >= margin_b && y <= margin_t)) ||
+ (vline=(((y == margin_b || y == margin_t)) && x >= margin_l && x <= margin_r)))
+ {
/* dashed line */
- if((hline && y % 2) || (vline && x % 2)) {
+ if ((hline && y % 2) || (vline && x % 2)) {
px[0]= px[1]= px[2]= 0;
px[3] = 255;
}
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index 6fe2a3b8bc2..f81fb740ff0 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -85,7 +85,7 @@ typedef struct ImbTIFFMemFile {
toff_t offset; /* Current offset within the file. */
tsize_t size; /* Size of the TIFF file. */
} ImbTIFFMemFile;
-#define IMB_TIFF_GET_MEMFILE(x) ((ImbTIFFMemFile*)(x));
+#define IMB_TIFF_GET_MEMFILE(x) ((ImbTIFFMemFile*)(x))
@@ -113,11 +113,11 @@ static int imb_tiff_DummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize)
/**
* Reads data from an in-memory TIFF file.
*
- * @param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile).
- * @param data: Buffer to contain data (treat as void*).
- * @param n: Number of bytes to read.
+ * \param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile).
+ * \param data: Buffer to contain data (treat as void*).
+ * \param n: Number of bytes to read.
*
- * @return: Number of bytes actually read.
+ * \return: Number of bytes actually read.
* 0 = EOF.
*/
static tsize_t imb_tiff_ReadProc(thandle_t handle, tdata_t data, tsize_t n)
@@ -128,23 +128,23 @@ static tsize_t imb_tiff_ReadProc(thandle_t handle, tdata_t data, tsize_t n)
/* get the pointer to the in-memory file */
mfile = IMB_TIFF_GET_MEMFILE(handle);
- if(!mfile || !mfile->mem) {
+ if (!mfile || !mfile->mem) {
fprintf(stderr, "imb_tiff_ReadProc: !mfile || !mfile->mem!\n");
return 0;
}
/* find the actual number of bytes to read (copy) */
nCopy = n;
- if((tsize_t)mfile->offset >= mfile->size)
+ if ((tsize_t)mfile->offset >= mfile->size)
nRemaining = 0;
else
nRemaining = mfile->size - mfile->offset;
- if(nCopy > nRemaining)
+ if (nCopy > nRemaining)
nCopy = nRemaining;
/* on EOF, return immediately and read (copy) nothing */
- if(nCopy <= 0)
+ if (nCopy <= 0)
return (0);
/* all set -> do the read (copy) */
@@ -177,15 +177,15 @@ static tsize_t imb_tiff_WriteProc(thandle_t handle, tdata_t data, tsize_t n)
/**
* Seeks to a new location in an in-memory TIFF file.
*
- * @param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile).
- * @param ofs: Offset value (interpreted according to whence below).
- * @param whence: This can be one of three values:
+ * \param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile).
+ * \param ofs: Offset value (interpreted according to whence below).
+ * \param whence: This can be one of three values:
* SEEK_SET - The offset is set to ofs bytes.
* SEEK_CUR - The offset is set to its current location plus ofs bytes.
* SEEK_END - (This is unsupported and will return -1, indicating an
* error).
*
- * @return: Resulting offset location within the file, measured in bytes from
+ * \return: Resulting offset location within the file, measured in bytes from
* the beginning of the file. (-1) indicates an error.
*/
static toff_t imb_tiff_SeekProc(thandle_t handle, toff_t ofs, int whence)
@@ -195,7 +195,7 @@ static toff_t imb_tiff_SeekProc(thandle_t handle, toff_t ofs, int whence)
/* get the pointer to the in-memory file */
mfile = IMB_TIFF_GET_MEMFILE(handle);
- if(!mfile || !mfile->mem) {
+ if (!mfile || !mfile->mem) {
fprintf(stderr, "imb_tiff_SeekProc: !mfile || !mfile->mem!\n");
return (-1);
}
@@ -231,9 +231,9 @@ static toff_t imb_tiff_SeekProc(thandle_t handle, toff_t ofs, int whence)
* are made to access the file after that point. However, no such
* attempts should ever be made (in theory).
*
- * @param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile).
+ * \param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile).
*
- * @return: 0
+ * \return: 0
*/
static int imb_tiff_CloseProc(thandle_t handle)
{
@@ -241,7 +241,7 @@ static int imb_tiff_CloseProc(thandle_t handle)
/* get the pointer to the in-memory file */
mfile = IMB_TIFF_GET_MEMFILE(handle);
- if(!mfile || !mfile->mem) {
+ if (!mfile || !mfile->mem) {
fprintf(stderr,"imb_tiff_CloseProc: !mfile || !mfile->mem!\n");
return (0);
}
@@ -259,7 +259,7 @@ static int imb_tiff_CloseProc(thandle_t handle)
/**
* Returns the size of an in-memory TIFF file in bytes.
*
- * @return: Size of file (in bytes).
+ * \return: Size of file (in bytes).
*/
static toff_t imb_tiff_SizeProc(thandle_t handle)
{
@@ -267,7 +267,7 @@ static toff_t imb_tiff_SizeProc(thandle_t handle)
/* get the pointer to the in-memory file */
mfile = IMB_TIFF_GET_MEMFILE(handle);
- if(!mfile || !mfile->mem) {
+ if (!mfile || !mfile->mem) {
fprintf(stderr,"imb_tiff_SizeProc: !mfile || !mfile->mem!\n");
return (0);
}
@@ -361,7 +361,7 @@ static void imb_read_tiff_resolution(ImBuf *ibuf, TIFF *image)
TIFFGetFieldDefaulted(image, TIFFTAG_XRESOLUTION, &xres);
TIFFGetFieldDefaulted(image, TIFFTAG_YRESOLUTION, &yres);
- if(unit == RESUNIT_CENTIMETER) {
+ if (unit == RESUNIT_CENTIMETER) {
ibuf->ppm[0]= (double)xres * 100.0;
ibuf->ppm[1]= (double)yres * 100.0;
}
@@ -397,10 +397,12 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul)
if (bitspersample == 32) {
ib_flag = IB_rectfloat;
fbuf = (float *)_TIFFmalloc(scanline);
- } else if (bitspersample == 16) {
+ }
+ else if (bitspersample == 16) {
ib_flag = IB_rectfloat;
sbuf = (unsigned short *)_TIFFmalloc(scanline);
- } else {
+ }
+ else {
ib_flag = IB_rect;
}
@@ -419,13 +421,15 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul)
success |= TIFFReadScanline(image, fbuf, row, 0);
scanline_contig_32bit(tmpibuf->rect_float+ib_offset, fbuf, ibuf->x, spp);
- } else if (bitspersample == 16) {
+ }
+ else if (bitspersample == 16) {
success |= TIFFReadScanline(image, sbuf, row, 0);
scanline_contig_16bit(tmpibuf->rect_float+ib_offset, sbuf, ibuf->x, spp);
}
}
/* separate channels: RRRGGGBBB */
- } else if (config == PLANARCONFIG_SEPARATE) {
+ }
+ else if (config == PLANARCONFIG_SEPARATE) {
/* imbufs always have 4 channels of data, so we iterate over all of them
* but only fill in from the TIFF scanline where necessary. */
@@ -440,7 +444,8 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul)
success |= TIFFReadScanline(image, fbuf, row, chan);
scanline_separate_32bit(tmpibuf->rect_float+ib_offset, fbuf, ibuf->x, chan);
- } else if (bitspersample == 16) {
+ }
+ else if (bitspersample == 16) {
if (chan == 3 && spp == 3) /* fill alpha if only RGB TIFF */
memset(sbuf, 65535, sizeof(sbuf));
else
@@ -457,14 +462,14 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul)
else if (bitspersample == 16)
_TIFFfree(sbuf);
- if(success) {
+ if (success) {
ibuf->profile = (bitspersample==32)?IB_PROFILE_LINEAR_RGB:IB_PROFILE_SRGB;
// Code seems to be not needed for 16 bits tif, on PPC G5 OSX (ton)
- if(bitspersample < 16)
- if(ENDIAN_ORDER == B_ENDIAN)
+ if (bitspersample < 16)
+ if (ENDIAN_ORDER == B_ENDIAN)
IMB_convert_rgba_to_abgr(tmpibuf);
- if(premul) {
+ if (premul) {
IMB_premultiply_alpha(tmpibuf);
ibuf->flags |= IB_premul;
}
@@ -487,7 +492,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul)
void imb_inittiff(void)
{
- if (!(G.f & G_DEBUG))
+ if (!(G.debug & G_DEBUG))
TIFFSetErrorHandler(NULL);
}
@@ -495,12 +500,12 @@ void imb_inittiff(void)
* Loads a TIFF file.
*
*
- * @param mem: Memory containing the TIFF file.
- * @param size: Size of the mem buffer.
- * @param flags: If flags has IB_test set then the file is not actually loaded,
+ * \param mem: Memory containing the TIFF file.
+ * \param size: Size of the mem buffer.
+ * \param flags: If flags has IB_test set then the file is not actually loaded,
* but all other operations take place.
*
- * @return: A newly allocated ImBuf structure if successful, otherwise NULL.
+ * \return: A newly allocated ImBuf structure if successful, otherwise NULL.
*/
ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags)
{
@@ -514,16 +519,16 @@ ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags)
int ib_depth;
/* check whether or not we have a TIFF file */
- if(size < IMB_TIFF_NCB) {
+ if (size < IMB_TIFF_NCB) {
fprintf(stderr, "imb_loadtiff: size < IMB_TIFF_NCB\n");
return NULL;
}
- if(imb_is_a_tiff(mem) == 0)
+ if (imb_is_a_tiff(mem) == 0)
return NULL;
image = imb_tiff_client_open(&memFile, mem, size);
- if(image == NULL) {
+ if (image == NULL) {
printf("imb_loadtiff: could not open TIFF IO layer.\n");
return NULL;
}
@@ -536,7 +541,7 @@ ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags)
ib_depth = (spp==3)?24:32;
ibuf = IMB_allocImBuf(width, height, ib_depth, 0);
- if(ibuf) {
+ if (ibuf) {
ibuf->ftype = TIF;
}
else {
@@ -548,26 +553,26 @@ ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags)
}
/* if testing, we're done */
- if(flags & IB_test) {
+ if (flags & IB_test) {
TIFFClose(image);
return ibuf;
}
/* 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 */
- if(flags & IB_tilecache) {
+ * 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);
- if(format && strcmp(format, "Plain Texture")==0 && TIFFIsTiled(image)) {
+ if (format && strcmp(format, "Plain Texture")==0 && TIFFIsTiled(image)) {
int numlevel = TIFFNumberOfDirectories(image);
/* create empty mipmap levels in advance */
- for(level=0; level<numlevel; level++) {
- if(!TIFFSetDirectory(image, level))
+ for (level=0; level<numlevel; level++) {
+ if (!TIFFSetDirectory(image, level))
break;
- if(level > 0) {
+ if (level > 0) {
width= (width > 1)? width/2: 1;
height= (height > 1)? height/2: 1;
@@ -576,7 +581,7 @@ ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags)
hbuf->ftype= ibuf->ftype;
ibuf->mipmap[level-1] = hbuf;
- if(flags & IB_premul)
+ if (flags & IB_premul)
hbuf->flags |= IB_premul;
}
else
@@ -598,7 +603,7 @@ ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags)
}
/* read pixels */
- if(!(ibuf->flags & IB_tilecache) && !imb_read_tiff_pixels(ibuf, image, 0)) {
+ if (!(ibuf->flags & IB_tilecache) && !imb_read_tiff_pixels(ibuf, image, 0)) {
fprintf(stderr, "imb_loadtiff: Failed to read tiff image.\n");
TIFFClose(image);
return NULL;
@@ -619,23 +624,23 @@ void imb_loadtiletiff(ImBuf *ibuf, unsigned char *mem, size_t size, int tx, int
image = imb_tiff_client_open(&memFile, mem, size);
- if(image == NULL) {
+ if (image == NULL) {
printf("imb_loadtiff: could not open TIFF IO layer for loading mipmap level.\n");
return;
}
- if(TIFFSetDirectory(image, ibuf->miplevel)) { /* allocate the image buffer */
+ if (TIFFSetDirectory(image, ibuf->miplevel)) { /* allocate the image buffer */
TIFFGetField(image, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(image, TIFFTAG_IMAGELENGTH, &height);
- if(width == ibuf->x && height == ibuf->y) {
- if(rect) {
+ if (width == ibuf->x && height == ibuf->y) {
+ if (rect) {
/* tiff pixels are bottom to top, tiles are top to bottom */
- if(TIFFReadRGBATile(image, tx*ibuf->tilex, (ibuf->ytiles - 1 - ty)*ibuf->tiley, rect) == 1) {
- if(ibuf->tiley > ibuf->y)
+ if (TIFFReadRGBATile(image, tx*ibuf->tilex, (ibuf->ytiles - 1 - ty)*ibuf->tiley, rect) == 1) {
+ if (ibuf->tiley > ibuf->y)
memmove(rect, rect+ibuf->tilex*(ibuf->tiley - ibuf->y), sizeof(int)*ibuf->tilex*ibuf->y);
- if(ibuf->flags & IB_premul)
+ if (ibuf->flags & IB_premul)
IMB_premultiply_rect(rect, 32, ibuf->tilex, ibuf->tiley);
}
else
@@ -661,11 +666,11 @@ void imb_loadtiletiff(ImBuf *ibuf, unsigned char *mem, size_t size, int tx, int
* Blender by setting "Premul" alpha handling. Other alpha conventions are
* not strictly correct, but are permitted anyhow.
*
- * @param ibuf: Image buffer.
- * @param name: Name of the TIFF file to create.
- * @param flags: Currently largely ignored.
+ * \param ibuf: Image buffer.
+ * \param name: Name of the TIFF file to create.
+ * \param flags: Currently largely ignored.
*
- * @return: 1 if the function is successful, 0 on failure.
+ * \return: 1 if the function is successful, 0 on failure.
*/
int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
@@ -686,20 +691,20 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
* the TIFF writer supports 1, 3 or 4 bytes per pixel, corresponding
* to gray, RGB, RGBA respectively. */
samplesperpixel = (uint16)((ibuf->planes + 7) >> 3);
- if((samplesperpixel > 4) || (samplesperpixel == 2)) {
+ if ((samplesperpixel > 4) || (samplesperpixel == 2)) {
fprintf(stderr,
"imb_savetiff: unsupported number of bytes per "
"pixel: %d\n", samplesperpixel);
return (0);
}
- if((ibuf->ftype & TIF_16BIT) && ibuf->rect_float)
+ if ((ibuf->ftype & TIF_16BIT) && ibuf->rect_float)
bitspersample = 16;
else
bitspersample = 8;
/* open TIFF file for writing */
- if(flags & IB_mem) {
+ if (flags & IB_mem) {
/* bork at the creation of a TIFF in memory */
fprintf(stderr,
"imb_savetiff: creation of in-memory TIFF files is "
@@ -710,7 +715,7 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
/* create image as a file */
image = TIFFOpen(name, "w");
}
- if(image == NULL) {
+ if (image == NULL) {
fprintf(stderr,
"imb_savetiff: could not open TIFF for writing.\n");
return (0);
@@ -718,14 +723,14 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
/* allocate array for pixel data */
npixels = ibuf->x * ibuf->y;
- if(bitspersample == 16)
+ if (bitspersample == 16)
pixels16 = (unsigned short*)_TIFFmalloc(npixels *
samplesperpixel * sizeof(unsigned short));
else
pixels = (unsigned char*)_TIFFmalloc(npixels *
samplesperpixel * sizeof(unsigned char));
- if(pixels == NULL && pixels16 == NULL) {
+ if (pixels == NULL && pixels16 == NULL) {
fprintf(stderr,
"imb_savetiff: could not allocate pixels array.\n");
TIFFClose(image);
@@ -733,7 +738,7 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
}
/* setup pointers */
- if(bitspersample == 16) {
+ if (bitspersample == 16) {
fromf = ibuf->rect_float;
to16 = pixels16;
}
@@ -746,31 +751,31 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
TIFFSetField(image, TIFFTAG_BITSPERSAMPLE, bitspersample);
TIFFSetField(image, TIFFTAG_SAMPLESPERPIXEL, samplesperpixel);
- if(samplesperpixel == 4) {
+ if (samplesperpixel == 4) {
/* RGBA images */
TIFFSetField(image, TIFFTAG_EXTRASAMPLES, 1,
extraSampleTypes);
TIFFSetField(image, TIFFTAG_PHOTOMETRIC,
PHOTOMETRIC_RGB);
}
- else if(samplesperpixel == 3) {
+ else if (samplesperpixel == 3) {
/* RGB images */
TIFFSetField(image, TIFFTAG_PHOTOMETRIC,
PHOTOMETRIC_RGB);
}
- else if(samplesperpixel == 1) {
+ else if (samplesperpixel == 1) {
/* greyscale images, 1 channel */
TIFFSetField(image, TIFFTAG_PHOTOMETRIC,
PHOTOMETRIC_MINISBLACK);
}
/* copy pixel data. While copying, we flip the image vertically. */
- for(x = 0; x < ibuf->x; x++) {
- for(y = 0; y < ibuf->y; y++) {
+ for (x = 0; x < ibuf->x; x++) {
+ for (y = 0; y < ibuf->y; y++) {
from_i = 4*(y*ibuf->x+x);
to_i = samplesperpixel*((ibuf->y-y-1)*ibuf->x+x);
- if(pixels16) {
+ if (pixels16) {
/* convert from float source */
float rgb[3];
@@ -790,7 +795,7 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
}
}
else {
- for(i = 0; i < samplesperpixel; i++, to_i++, from_i++)
+ for (i = 0; i < samplesperpixel; i++, to_i++, from_i++)
to[to_i] = from[from_i];
}
}
@@ -805,7 +810,7 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
TIFFSetField(image, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
- if(ibuf->ppm[0] > 0.0 && ibuf->ppm[1] > 0.0) {
+ if (ibuf->ppm[0] > 0.0 && ibuf->ppm[1] > 0.0) {
xres= (float)(ibuf->ppm[0] * 0.0254);
yres= (float)(ibuf->ppm[1] * 0.0254);
}
@@ -816,20 +821,20 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
TIFFSetField(image, TIFFTAG_XRESOLUTION, xres);
TIFFSetField(image, TIFFTAG_YRESOLUTION, yres);
TIFFSetField(image, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH);
- if(TIFFWriteEncodedStrip(image, 0,
+ if (TIFFWriteEncodedStrip(image, 0,
(bitspersample == 16)? (unsigned char*)pixels16: pixels,
ibuf->x*ibuf->y*samplesperpixel*bitspersample/8) == -1) {
fprintf(stderr,
"imb_savetiff: Could not write encoded TIFF.\n");
TIFFClose(image);
- if(pixels) _TIFFfree(pixels);
- if(pixels16) _TIFFfree(pixels16);
+ if (pixels) _TIFFfree(pixels);
+ if (pixels16) _TIFFfree(pixels16);
return (1);
}
/* close the TIFF file */
TIFFClose(image);
- if(pixels) _TIFFfree(pixels);
- if(pixels16) _TIFFfree(pixels16);
+ if (pixels) _TIFFfree(pixels);
+ if (pixels16) _TIFFfree(pixels16);
return (1);
}
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index 47dad378eb7..9c5b39e180d 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -152,17 +152,17 @@ static int IMB_ispic_name(const char *name)
struct stat st;
int fp, buf[10];
- if(UTIL_DEBUG) printf("IMB_ispic_name: loading %s\n", name);
+ if (UTIL_DEBUG) printf("IMB_ispic_name: loading %s\n", name);
- if(stat(name,&st) == -1)
+ if (stat(name,&st) == -1)
return FALSE;
- if(((st.st_mode) & S_IFMT) != S_IFREG)
+ if (((st.st_mode) & S_IFMT) != S_IFREG)
return FALSE;
- if((fp = open(name,O_BINARY|O_RDONLY)) < 0)
+ if ((fp = BLI_open(name,O_BINARY|O_RDONLY, 0)) < 0)
return FALSE;
- if(read(fp, buf, 32) != 32) {
+ if (read(fp, buf, 32) != 32) {
close(fp);
return FALSE;
}
@@ -170,11 +170,11 @@ static int IMB_ispic_name(const char *name)
close(fp);
/* XXX move this exception */
- if((BIG_LONG(buf[0]) & 0xfffffff0) == 0xffd8ffe0)
+ if ((BIG_LONG(buf[0]) & 0xfffffff0) == 0xffd8ffe0)
return JPG;
- for(type=IMB_FILE_TYPES; type->is_a; type++)
- if(type->is_a((uchar*)buf))
+ for (type=IMB_FILE_TYPES; type->is_a; type++)
+ if (type->is_a((uchar*)buf))
return type->filetype;
return FALSE;
@@ -182,8 +182,8 @@ static int IMB_ispic_name(const char *name)
int IMB_ispic(const char *filename)
{
- if(U.uiflag & USER_FILTERFILEEXTS) {
- if( (BLI_testextensie_array(filename, imb_ext_image)) ||
+ if (U.uiflag & USER_FILTERFILEEXTS) {
+ if ( (BLI_testextensie_array(filename, imb_ext_image)) ||
(G.have_quicktime && BLI_testextensie_array(filename, imb_ext_image_qt))
) {
return IMB_ispic_name(filename);
@@ -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);
}
}
@@ -233,10 +231,10 @@ void do_init_ffmpeg(void)
ffmpeg_init = 1;
av_register_all();
avdevice_register_all();
-
- if ((G.f & G_DEBUG) == 0) {
+ if ((G.debug & G_DEBUG_FFMPEG) == 0) {
silence_log_ffmpeg(1);
- } else {
+ }
+ else {
silence_log_ffmpeg(0);
}
}
@@ -252,7 +250,7 @@ static int isffmpeg (const char *filename)
do_init_ffmpeg();
- if( BLI_testextensie(filename, ".swf") ||
+ if ( BLI_testextensie(filename, ".swf") ||
BLI_testextensie(filename, ".jpg") ||
BLI_testextensie(filename, ".png") ||
BLI_testextensie(filename, ".dds") ||
@@ -262,24 +260,24 @@ static int isffmpeg (const char *filename)
BLI_testextensie(filename, ".cin") ||
BLI_testextensie(filename, ".wav")) return 0;
- if(av_open_input_file(&pFormatCtx, filename, NULL, 0, NULL)!=0) {
- if(UTIL_DEBUG) fprintf(stderr, "isffmpeg: av_open_input_file failed\n");
+ if (av_open_input_file(&pFormatCtx, filename, NULL, 0, NULL)!=0) {
+ if (UTIL_DEBUG) fprintf(stderr, "isffmpeg: av_open_input_file failed\n");
return 0;
}
- if(av_find_stream_info(pFormatCtx)<0) {
- if(UTIL_DEBUG) fprintf(stderr, "isffmpeg: av_find_stream_info failed\n");
+ if (av_find_stream_info(pFormatCtx)<0) {
+ if (UTIL_DEBUG) fprintf(stderr, "isffmpeg: av_find_stream_info failed\n");
av_close_input_file(pFormatCtx);
return 0;
}
- if(UTIL_DEBUG) av_dump_format(pFormatCtx, 0, filename, 0);
+ if (UTIL_DEBUG) av_dump_format(pFormatCtx, 0, filename, 0);
/* Find the first video stream */
videoStream=-1;
- for(i=0; i<pFormatCtx->nb_streams; i++)
- if(pFormatCtx->streams[i] &&
+ for (i=0; i<pFormatCtx->nb_streams; i++)
+ if (pFormatCtx->streams[i] &&
pFormatCtx->streams[i]->codec &&
(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO))
{
@@ -287,7 +285,7 @@ static int isffmpeg (const char *filename)
break;
}
- if(videoStream==-1) {
+ if (videoStream==-1) {
av_close_input_file(pFormatCtx);
return 0;
}
@@ -296,12 +294,12 @@ static int isffmpeg (const char *filename)
/* Find the decoder for the video stream */
pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
- if(pCodec==NULL) {
+ if (pCodec==NULL) {
av_close_input_file(pFormatCtx);
return 0;
}
- if(avcodec_open(pCodecCtx, pCodec)<0) {
+ if (avcodec_open(pCodecCtx, pCodec)<0) {
av_close_input_file(pFormatCtx);
return 0;
}
@@ -331,7 +329,7 @@ int imb_get_anim_type(const char * name)
int type;
struct stat st;
- if(UTIL_DEBUG) printf("in getanimtype: %s\n", name);
+ if (UTIL_DEBUG) printf("in getanimtype: %s\n", name);
#ifndef _WIN32
# ifdef WITH_QUICKTIME
@@ -372,9 +370,9 @@ int IMB_isanim(const char *filename)
{
int type;
- if(U.uiflag & USER_FILTERFILEEXTS) {
- if (G.have_quicktime){
- if( BLI_testextensie(filename, ".avi")
+ if (U.uiflag & USER_FILTERFILEEXTS) {
+ if (G.have_quicktime) {
+ if ( BLI_testextensie(filename, ".avi")
|| BLI_testextensie(filename, ".flc")
|| BLI_testextensie(filename, ".dv")
|| BLI_testextensie(filename, ".r3d")
@@ -382,11 +380,13 @@ int IMB_isanim(const char *filename)
|| BLI_testextensie(filename, ".movie")
|| BLI_testextensie(filename, ".mv")) {
type = imb_get_anim_type(filename);
- } else {
+ }
+ else {
return(FALSE);
}
- } else { // no quicktime
- if( BLI_testextensie(filename, ".avi")
+ }
+ else { // no quicktime
+ if ( BLI_testextensie(filename, ".avi")
|| BLI_testextensie(filename, ".dv")
|| BLI_testextensie(filename, ".r3d")
|| BLI_testextensie(filename, ".mv")) {
@@ -396,7 +396,8 @@ int IMB_isanim(const char *filename)
return(FALSE);
}
}
- } else { // no FILTERFILEEXTS
+ }
+ else { // no FILTERFILEEXTS
type = imb_get_anim_type(filename);
}
diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c
index 8fbed6da32b..60fc7db6465 100644
--- a/source/blender/imbuf/intern/writeimage.c
+++ b/source/blender/imbuf/intern/writeimage.c
@@ -44,13 +44,13 @@ short IMB_saveiff(struct ImBuf *ibuf, const char *name, int flags)
{
ImFileType *type;
- if(ibuf == NULL) return (FALSE);
+ if (ibuf == NULL) return (FALSE);
ibuf->flags = flags;
- for(type=IMB_FILE_TYPES; type->is_a; type++) {
- if(type->save && type->ftype(type, ibuf)) {
- if(!(type->flag & IM_FTYPE_FLOAT)) {
- if(ibuf->rect==NULL && ibuf->rect_float)
+ for (type=IMB_FILE_TYPES; type->is_a; type++) {
+ if (type->save && type->ftype(type, ibuf)) {
+ if (!(type->flag & IM_FTYPE_FLOAT)) {
+ if (ibuf->rect==NULL && ibuf->rect_float)
IMB_rect_from_float(ibuf);
}
return type->save(ibuf, name, flags);
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index eb8d06fc9f2..1737f3b79e6 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 058c72be639..16e04021c63 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -226,7 +226,7 @@ typedef struct bPoseChannel {
float pose_head[3]; /* actually pose_mat[3] */
float pose_tail[3]; /* also used for drawing help lines... */
- float limitmin[3], limitmax[3]; /* DOF constraint */
+ float limitmin[3], limitmax[3]; /* DOF constraint, note! - these are stored in degrees, not radians */
float stiffness[3]; /* DOF stiffness */
float ikstretch;
float ikrotweight; /* weight of joint rotation constraint */
@@ -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.
*
@@ -511,7 +511,7 @@ typedef enum eAction_Flags {
/* Storage for Dopesheet/Grease-Pencil Editor data */
typedef struct bDopeSheet {
ID *source; /* currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil) */
- ListBase chanbase; /* cache for channels (only initialised when pinned) */ // XXX not used!
+ ListBase chanbase; /* cache for channels (only initialized when pinned) */ // XXX not used!
struct Group *filter_grp; /* object group for ADS_FILTER_ONLYOBGROUP filtering option */
char searchstr[64]; /* string to search for in displayed names of F-Curves for ADS_FILTER_BY_FCU_NAME filtering option */
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 ae31bea4981..fd4b86a4155 100644
--- a/source/blender/makesdna/DNA_anim_types.h
+++ b/source/blender/makesdna/DNA_anim_types.h
@@ -373,7 +373,7 @@ typedef struct ChannelDriver {
* which relates the target 'variables' in some way to yield a single usable value
*/
char expression[256]; /* expression to compile for evaluation */
- void *expr_comp; /* PyObject - compiled expression, dont save this */
+ void *expr_comp; /* PyObject - compiled expression, don't save this */
float curval; /* result of previous evaluation */
float influence; /* influence of driver on result */ // XXX to be implemented... this is like the constraint influence setting
@@ -408,7 +408,7 @@ typedef enum eDriver_Flags {
//DRIVER_FLAG_LAYERING = (1<<2),
/* use when the expression needs to be recompiled */
DRIVER_FLAG_RECOMPILE = (1<<3),
- /* the names are cached so they dont need have python unicode versions created each time */
+ /* the names are cached so they don't need have python unicode versions created each time */
DRIVER_FLAG_RENAMEVAR = (1<<4),
/* intermediate values of driver should be shown in the UI for debugging purposes */
DRIVER_FLAG_SHOWDEBUG = (1<<5)
@@ -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.
@@ -559,7 +559,7 @@ typedef struct NlaStrip {
ListBase strips; /* 'Child' strips (used for 'meta' strips) */
bAction *act; /* Action that is referenced by this strip (strip is 'user' of the action) */
- AnimMapper *remap; /* Remapping info this strip (for tweaking correspondance of action with context) */
+ AnimMapper *remap; /* Remapping info this strip (for tweaking correspondence of action with context) */
ListBase fcurves; /* F-Curves for controlling this strip's influence and timing */ // TODO: move out?
ListBase modifiers; /* F-Curve modifiers to be applied to the entire strip's referenced F-Curves */
@@ -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.
@@ -752,7 +752,7 @@ typedef enum eKSP_Grouping {
* be keyframed together, providing a convenient way for animators
* to insert keyframes without resorting to Auto-Keyframing.
*
- * A few 'generic' (non-absolute and dependant on templates) KeyingSets
+ * A few 'generic' (non-absolute and dependent on templates) KeyingSets
* are defined 'built-in' to facilitate easy animating for the casual
* animator without the need to add extra steps to the rigging process.
*/
@@ -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..8b254b3b044 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 */
@@ -113,7 +113,7 @@ typedef struct bArmature {
} bArmature;
/* armature->flag */
-/* dont use bit 7, was saved in files to disable stuff */
+/* don't use bit 7, was saved in files to disable stuff */
typedef enum eArmature_Flag {
ARM_RESTPOS = (1<<0),
ARM_DRAWXRAY = (1<<1), /* XRAY is here only for backwards converting */
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 454008c73a7..0d06b55f1d3 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -102,58 +102,65 @@ typedef struct Brush {
} Brush;
/* Brush.flag */
-#define BRUSH_AIRBRUSH (1<<0)
-#define BRUSH_TORUS (1<<1)
-#define BRUSH_ALPHA_PRESSURE (1<<2)
-#define BRUSH_SIZE_PRESSURE (1<<3)
-#define BRUSH_JITTER_PRESSURE (1<<4) /* was BRUSH_RAD_PRESSURE */
-#define BRUSH_SPACING_PRESSURE (1<<5)
-#define BRUSH_FIXED_TEX (1<<6)
-#define BRUSH_RAKE (1<<7)
-#define BRUSH_ANCHORED (1<<8)
-#define BRUSH_DIR_IN (1<<9)
-#define BRUSH_SPACE (1<<10)
-#define BRUSH_SMOOTH_STROKE (1<<11)
-#define BRUSH_PERSISTENT (1<<12)
-#define BRUSH_ACCUMULATE (1<<13)
-#define BRUSH_LOCK_ALPHA (1<<14)
-#define BRUSH_ORIGINAL_NORMAL (1<<15)
-#define BRUSH_OFFSET_PRESSURE (1<<16)
-#define BRUSH_SPACE_ATTEN (1<<18)
-#define BRUSH_ADAPTIVE_SPACE (1<<19)
-#define BRUSH_LOCK_SIZE (1<<20)
-#define BRUSH_TEXTURE_OVERLAY (1<<21)
-#define BRUSH_EDGE_TO_EDGE (1<<22)
-#define BRUSH_RESTORE_MESH (1<<23)
-#define BRUSH_INVERSE_SMOOTH_PRESSURE (1<<24)
-#define BRUSH_RANDOM_ROTATION (1<<25)
-#define BRUSH_PLANE_TRIM (1<<26)
-#define BRUSH_FRONTFACE (1<<27)
-#define BRUSH_CUSTOM_ICON (1<<28)
-
-/* temporary flag which sets up autmatically for correct
- * brush drawing when inverted modal operator is running */
-#define BRUSH_INVERTED (1<<29)
+typedef enum BrushFlags {
+ BRUSH_AIRBRUSH = (1<<0),
+ BRUSH_TORUS = (1<<1),
+ BRUSH_ALPHA_PRESSURE = (1<<2),
+ BRUSH_SIZE_PRESSURE = (1<<3),
+ BRUSH_JITTER_PRESSURE = (1<<4),
+ BRUSH_SPACING_PRESSURE = (1<<5),
+ BRUSH_FIXED_TEX = (1<<6),
+ BRUSH_RAKE = (1<<7),
+ BRUSH_ANCHORED = (1<<8),
+ BRUSH_DIR_IN = (1<<9),
+ BRUSH_SPACE = (1<<10),
+ BRUSH_SMOOTH_STROKE = (1<<11),
+ BRUSH_PERSISTENT = (1<<12),
+ BRUSH_ACCUMULATE = (1<<13),
+ BRUSH_LOCK_ALPHA = (1<<14),
+ BRUSH_ORIGINAL_NORMAL = (1<<15),
+ BRUSH_OFFSET_PRESSURE = (1<<16),
+ BRUSH_SPACE_ATTEN = (1<<18),
+ BRUSH_ADAPTIVE_SPACE = (1<<19),
+ BRUSH_LOCK_SIZE = (1<<20),
+ BRUSH_TEXTURE_OVERLAY = (1<<21),
+ BRUSH_EDGE_TO_EDGE = (1<<22),
+ BRUSH_RESTORE_MESH = (1<<23),
+ BRUSH_INVERSE_SMOOTH_PRESSURE = (1<<24),
+ BRUSH_RANDOM_ROTATION = (1<<25),
+ BRUSH_PLANE_TRIM = (1<<26),
+ BRUSH_FRONTFACE = (1<<27),
+ BRUSH_CUSTOM_ICON = (1<<28),
+
+ /* temporary flag which sets up automatically for correct brush
+ * drawing when inverted modal operator is running */
+ BRUSH_INVERTED = (1<<29)
+} BrushFlags;
/* Brush.sculpt_tool */
-#define SCULPT_TOOL_DRAW 1
-#define SCULPT_TOOL_SMOOTH 2
-#define SCULPT_TOOL_PINCH 3
-#define SCULPT_TOOL_INFLATE 4
-#define SCULPT_TOOL_GRAB 5
-#define SCULPT_TOOL_LAYER 6
-#define SCULPT_TOOL_FLATTEN 7
-#define SCULPT_TOOL_CLAY 8
-#define SCULPT_TOOL_FILL 9
-#define SCULPT_TOOL_SCRAPE 10
-#define SCULPT_TOOL_NUDGE 11
-#define SCULPT_TOOL_THUMB 12
-#define SCULPT_TOOL_SNAKE_HOOK 13
-#define SCULPT_TOOL_ROTATE 14
-//#define SCULPT_TOOL_WAX 15 // XXX: reuse this slot later
-#define SCULPT_TOOL_CREASE 16
-#define SCULPT_TOOL_BLOB 17
-#define SCULPT_TOOL_CLAY_TUBES 18
+typedef enum BrushSculptTool {
+ SCULPT_TOOL_DRAW = 1,
+ SCULPT_TOOL_SMOOTH = 2,
+ SCULPT_TOOL_PINCH = 3,
+ SCULPT_TOOL_INFLATE = 4,
+ SCULPT_TOOL_GRAB = 5,
+ SCULPT_TOOL_LAYER = 6,
+ SCULPT_TOOL_FLATTEN = 7,
+ SCULPT_TOOL_CLAY = 8,
+ SCULPT_TOOL_FILL = 9,
+ SCULPT_TOOL_SCRAPE = 10,
+ SCULPT_TOOL_NUDGE = 11,
+ SCULPT_TOOL_THUMB = 12,
+ SCULPT_TOOL_SNAKE_HOOK = 13,
+ SCULPT_TOOL_ROTATE = 14,
+
+ /* slot 15 is free for use */
+ /* SCULPT_TOOL_ = 15, */
+
+ SCULPT_TOOL_CREASE = 16,
+ SCULPT_TOOL_BLOB = 17,
+ SCULPT_TOOL_CLAY_STRIPS = 18
+} BrushSculptTool;
/* ImagePaintSettings.tool */
#define PAINT_TOOL_DRAW 0
diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h
index 4618b99f6b6..112247f3d66 100644
--- a/source/blender/makesdna/DNA_camera_types.h
+++ b/source/blender/makesdna/DNA_camera_types.h
@@ -58,8 +58,8 @@ typedef struct Camera {
float shiftx, shifty;
/* yafray: dof params */
- /* qdn: yafray var 'YF_dofdist' now enabled for defocus composit node as well.
- The name was not changed so that no other files need to be modified */
+ /* qdn: yafray var 'YF_dofdist' now enabled for defocus composite node as well.
+ * The name was not changed so that no other files need to be modified */
float YF_dofdist;
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 d5b9477f7f6..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 */
@@ -125,7 +125,7 @@ typedef struct Nurb {
short mat_nr; /* index into material list */
short hide, flag;
short pntsu, pntsv; /* number of points in the U or V directions */
- short resolu, resolv; /* tesselation resolution in the U or V directions */
+ short resolu, resolv; /* tessellation resolution in the U or V directions */
short orderu, orderv;
short flagu, flagv;
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index d7358a4df1e..9898f9715a0 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 */
@@ -94,7 +94,7 @@ typedef struct CustomData {
#define CD_MLOOPCOL 17
#define CD_TANGENT 18
#define CD_MDISPS 19
-#define CD_WEIGHT_MCOL 20 /* for displaying weightpaint colors */
+#define CD_PREVIEW_MCOL 20 /* for displaying weightpaint colors */
#define CD_ID_MCOL 21
#define CD_TEXTURE_MCOL 22
#define CD_CLOTH_ORCO 23
@@ -108,7 +108,7 @@ typedef struct CustomData {
#define CD_BWEIGHT 29
#define CD_CREASE 30
#define CD_ORIGSPACE_MLOOP 31
-#define CD_WEIGHT_MLOOPCOL 32
+#define CD_PREVIEW_MLOOPCOL 32
#define CD_BM_ELEM_PYPTR 33
/* BMESH ONLY END */
@@ -135,7 +135,7 @@ typedef struct CustomData {
#define CD_MASK_MLOOPCOL (1 << CD_MLOOPCOL)
#define CD_MASK_TANGENT (1 << CD_TANGENT)
#define CD_MASK_MDISPS (1 << CD_MDISPS)
-#define CD_MASK_WEIGHT_MCOL (1 << CD_WEIGHT_MCOL)
+#define CD_MASK_PREVIEW_MCOL (1 << CD_PREVIEW_MCOL)
#define CD_MASK_CLOTH_ORCO (1 << CD_CLOTH_ORCO)
#define CD_MASK_RECAST (1 << CD_RECAST)
@@ -147,7 +147,7 @@ typedef struct CustomData {
#define CD_MASK_BWEIGHT (1 << CD_BWEIGHT)
#define CD_MASK_CREASE (1 << CD_CREASE)
#define CD_MASK_ORIGSPACE_MLOOP (1 << CD_ORIGSPACE_MLOOP)
-#define CD_MASK_WEIGHT_MLOOPCOL (1LL << CD_WEIGHT_MLOOPCOL)
+#define CD_MASK_PREVIEW_MLOOPCOL (1LL << CD_PREVIEW_MLOOPCOL)
#define CD_MASK_BM_ELEM_PYPTR (1LL << CD_BM_ELEM_PYPTR)
/* BMESH ONLY END */
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_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 6f3014c0961..3de5372d848 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -132,7 +132,7 @@ typedef struct bGPdata {
int flag; /* settings for this datablock */
/* not-saved stroke buffer data (only used during paint-session)
- * - buffer must be initialised before use, but freed after
+ * - buffer must be initialized before use, but freed after
* whole paint operation is over
*/
short sbuffer_size; /* number of elements currently in cache */
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index b58ae921200..2b3719a10b5 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;
@@ -168,7 +168,7 @@ typedef struct Material {
float sss_front, sss_back;
short sss_flag, sss_preset;
- int mapto_textured; /* render-time cache to optimise texture lookups */
+ int mapto_textured; /* render-time cache to optimize texture lookups */
short shadowonly_flag; /* "shadowsonly" type */
short index; /* custom index for render passes */
@@ -206,7 +206,7 @@ typedef struct Material {
/* maximum number of materials per material array.
* (on object, mesh, lamp, etc.). limited by
* short mat_nr in verts, faces.
- * -1 becayse for active material we store the index + 1 */
+ * -1 because for active material we store the index + 1 */
#define MAXMAT (32767-1)
/* material_type */
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index c6eeccadc62..1934ae8aa3a 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -77,17 +77,17 @@ typedef struct Mesh {
struct MLoopCol *mloopcol;
/* END BMESH ONLY */
- /*mface stores the tesselation (triangulation) of the mesh,
- real faces are now stored in nface.*/
- struct MFace *mface; /* array of mesh object mode faces for tesselation */
- struct MTFace *mtface; /* store tesselation face UV's and texture here */
+ /* 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 */
struct MVert *mvert; /* array of verts */
struct MEdge *medge; /* array of edges */
struct MDeformVert *dvert; /* deformgroup vertices */
- /* array of colors for the tesselated faces, must be number of tesselated
- faces * 4 in length */
+ /* array of colors for the tessellated faces, must be number of tessellated
+ * faces * 4 in length */
struct MCol *mcol;
struct MSticky *msticky;
struct Mesh *texcomesh;
@@ -194,27 +194,6 @@ typedef struct TFace {
/* debug only option */
#define ME_DRAWEXTRA_INDICES (1 << 13)
-/* 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
@@ -227,6 +206,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 9f1dbcc1b86..2de89a31ab0 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -38,7 +38,7 @@
struct Bone;
struct Image;
-/*tesselation face, see MLoop/MPoly for the real face data*/
+/*tessellation face, see MLoop/MPoly for the real face data*/
typedef struct MFace {
unsigned int v1, v2, v3, v4;
short mat_nr;
@@ -68,15 +68,15 @@ typedef struct MVert {
char flag, bweight;
} MVert;
-/* tesselation vertex color data.
+/* tessellation vertex color data.
* at the moment alpha is abused for vertex painting
* and not used for transparency, note that red and blue are swapped */
typedef struct MCol {
char a, r, g, b;
} MCol;
-/*new face structure, replaces MFace, which is now
- only used for storing tesselations.*/
+/* 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*/
@@ -122,9 +122,30 @@ typedef struct MLoopUV {
/* at the moment alpha is abused for vertex painting
* and not used for transparency, note that red and blue are swapped */
typedef struct MLoopCol {
- char a, r, g, b;
+ char r, g, b, a;
} MLoopCol;
+#define MESH_MLOOPCOL_FROM_MCOL(_mloopcol, _mcol) \
+{ \
+ MLoopCol *mloopcol__tmp = _mloopcol; \
+ const MCol *mcol__tmp = _mcol; \
+ mloopcol__tmp->r = mcol__tmp->b; \
+ mloopcol__tmp->g = mcol__tmp->g; \
+ mloopcol__tmp->b = mcol__tmp->r; \
+ mloopcol__tmp->a = mcol__tmp->a; \
+} (void)0
+
+
+#define MESH_MLOOPCOL_TO_MCOL(_mloopcol, _mcol) \
+{ \
+ const MLoopCol *mloopcol__tmp = _mloopcol; \
+ MCol *mcol__tmp = _mcol; \
+ mcol__tmp->b = mloopcol__tmp->r; \
+ mcol__tmp->g = mloopcol__tmp->g; \
+ mcol__tmp->r = mloopcol__tmp->b; \
+ mcol__tmp->a = mloopcol__tmp->a; \
+} (void)0
+
typedef struct MSticky {
float co[2];
} MSticky;
@@ -134,7 +155,7 @@ typedef struct MSelect {
int type; /* EDITVERT/EDITEDGE/EDITFACE */
} MSelect;
-/*tesselation uv face data*/
+/*tessellation uv face data*/
typedef struct MTFace {
float uv[4][2];
struct Image *tpage;
@@ -164,8 +185,14 @@ typedef struct OrigSpaceLoop {
typedef struct MDisps {
/* Strange bug in SDNA: if disps pointer comes first, it fails to see totdisp */
int totdisp;
- char pad[4];
+ int level;
float (*disps)[3];
+
+ /* Used for hiding parts of a multires mesh. Essentially the multires
+ equivalent of MVert.flag's ME_HIDE bit.
+
+ This is a bitmap, keep in sync with type used in BLI_bitmap.h */
+ unsigned int *hidden;
} MDisps;
/** Multires structs kept for compatibility with old files **/
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 c0cda33f8d8..6c1d9892ba2 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -135,6 +135,8 @@ typedef struct LatticeModifierData {
struct Object *object;
char name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */
+ float strength;
+ char pad[4];
} LatticeModifierData;
typedef struct CurveModifierData {
@@ -191,33 +193,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;
@@ -809,12 +811,6 @@ typedef struct OceanModifierData {
#define MOD_OCEAN_GENERATE_NORMALS 2
-/* BMESH_ONLY */
-typedef struct NgonInterpModifierData {
- ModifierData modifier;
- int resolution, pad0;
-} NgonInterpModifierData;
-
typedef struct WarpModifierData {
ModifierData modifier;
/* keep in sync with MappingInfoModifierData */
@@ -1051,7 +1047,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..ed7310ff883 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,11 +78,13 @@ 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;
+ int flag;
+
+ int len; /* lenght of movie */
} MovieClip;
typedef struct MovieClipScopes {
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 93891a9edfa..6caf0a7d8b2 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -114,7 +114,7 @@ typedef struct bNodeSocket {
/* sock->struct_type */
#define SOCK_STRUCT_NONE 0 /* default, type is defined by sock->type only */
-#define SOCK_STRUCT_OUTPUT_MULTI_FILE 1 /* multi file output node socket */
+#define SOCK_STRUCT_OUTPUT_FILE 1 /* file output node socket */
/* socket side (input/output) */
#define SOCK_IN 1
@@ -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 */
@@ -358,14 +358,17 @@ typedef struct NodeImageFile {
int sfra, efra;
} NodeImageFile;
+/* XXX first struct fields should match NodeImageFile to ensure forward compatibility */
typedef struct NodeImageMultiFile {
char base_path[1024]; /* 1024 = FILE_MAX */
+ ImageFormatData format;
+ int sfra DNA_DEPRECATED, efra DNA_DEPRECATED; /* XXX old frame rand values from NodeImageFile for forward compatibility */
int active_input; /* selected input in details view list */
int pad;
} NodeImageMultiFile;
typedef struct NodeImageMultiFileSocket {
- short use_render_format; /* use global render settings instead of own format */
- short pad1;
+ short use_render_format DNA_DEPRECATED;
+ short use_node_format; /* use overall node image format */
int pad2;
ImageFormatData format;
} NodeImageMultiFileSocket;
@@ -472,7 +475,7 @@ typedef struct NodeTexChecker {
typedef struct NodeTexEnvironment {
NodeTexBase base;
- int color_space, pad;
+ int color_space, projection;
} NodeTexEnvironment;
typedef struct NodeTexGradient {
@@ -579,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..6fefd2d672f 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;
@@ -398,7 +401,7 @@ typedef struct SoftBody {
#define PTCACHE_FRAMES_SKIPPED 256
#define PTCACHE_EXTERNAL 512
#define PTCACHE_READ_INFO 1024
-/* dont use the filename of the blendfile the data is linked from (write a local cache) */
+/* don't use the filename of the blendfile the data is linked from (write a local cache) */
#define PTCACHE_IGNORE_LIBPATH 2048
/* high resolution cache is saved for smoke for backwards compatibility, so set this flag to know it's a "fake" cache */
#define PTCACHE_FAKE_SMOKE (1<<12)
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 83307cc2fc6..86a2bb60cc9 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -353,7 +353,7 @@ typedef struct DupliObject {
#define OB_NO_CONSTRAINTS 8192 /* runtime constraints disable */
/* (short) ipoflag */
-/* XXX: many old flags for features removed due to incompatability
+/* XXX: many old flags for features removed due to incompatibility
* with new system and/or other design issues were here
*/
/* for stride/path editing (XXX: NEEDS REVIEW) */
@@ -439,13 +439,14 @@ typedef struct DupliObject {
// #define OB_RADIO 2048 /* deprecated */
#define OB_FROMGROUP 4096
+/* WARNING - when adding flags check on PSYS_RECALC */
/* ob->recalc (flag bits!) */
-#define OB_RECALC_OB 1
-#define OB_RECALC_DATA 2
- /* time flag is set when time changes need recalc, so baked systems can ignore it */
-#define OB_RECALC_TIME 4
- /* only use for matching any flag, NOT as an argument since more flags may be added. */
-#define OB_RECALC_ALL (OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME)
+#define OB_RECALC_OB (1 << 0)
+#define OB_RECALC_DATA (1 << 1)
+/* time flag is set when time changes need recalc, so baked systems can ignore it */
+#define OB_RECALC_TIME (1 << 2)
+/* only use for matching any flag, NOT as an argument since more flags may be added. */
+#define OB_RECALC_ALL (OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME)
/* controller state */
#define OB_MAX_STATES 30
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index 220ee69b442..58ffcf6480e 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -321,7 +321,7 @@ typedef struct ParticleSystem
#define PART_TRAND 128
#define PART_EDISTR 256 /* particle/face from face areas */
-//#define PART_STICKY 512 /*collided particles can stick to collider*/
+#define PART_ROTATIONS 512 /* calculate particle rotations (and store them in pointcache) */
#define PART_DIE_ON_COL (1<<12)
#define PART_SIZE_DEFL (1<<13) /* swept sphere deflections */
#define PART_ROT_DYN (1<<14) /* dynamic rotation */
@@ -463,8 +463,13 @@ typedef struct ParticleSystem
#define PART_ROT_OB_Z 8
/* part->avemode */
-#define PART_AVE_SPIN 1
+#define PART_AVE_VELOCITY 1
#define PART_AVE_RAND 2
+#define PART_AVE_HORIZONTAL 3
+#define PART_AVE_VERTICAL 4
+#define PART_AVE_GLOBAL_X 5
+#define PART_AVE_GLOBAL_Y 6
+#define PART_AVE_GLOBAL_Z 7
/* part->reactevent */
#define PART_EVENT_DEATH 0
@@ -476,13 +481,13 @@ typedef struct ParticleSystem
#define PART_CHILD_FACES 2
/* psys->recalc */
-/* starts from 8 so that the first bits can be ob->recalc */
-#define PSYS_RECALC_REDO 8 /* only do pathcache etc */
-#define PSYS_RECALC_RESET 16 /* reset everything including pointcache */
-#define PSYS_RECALC_TYPE 32 /* handle system type change */
-#define PSYS_RECALC_CHILD 64 /* only child settings changed */
-#define PSYS_RECALC_PHYS 128 /* physics type changed */
-#define PSYS_RECALC 248
+/* starts from (1 << 3) so that the first bits can be ob->recalc */
+#define PSYS_RECALC_REDO (1 << 3) /* only do pathcache etc */
+#define PSYS_RECALC_RESET (1 << 4) /* reset everything including pointcache */
+#define PSYS_RECALC_TYPE (1 << 5) /* handle system type change */
+#define PSYS_RECALC_CHILD (1 << 6) /* only child settings changed */
+#define PSYS_RECALC_PHYS (1 << 7) /* physics type changed */
+#define PSYS_RECALC (PSYS_RECALC_REDO | PSYS_RECALC_RESET | PSYS_RECALC_TYPE | PSYS_RECALC_CHILD | PSYS_RECALC_PHYS)
/* psys->flag */
#define PSYS_CURRENT 1
@@ -498,7 +503,8 @@ typedef struct ParticleSystem
#define PSYS_KEYED 1024
#define PSYS_EDITED 2048
//#define PSYS_PROTECT_CACHE 4096 /* deprecated */
-#define PSYS_DISABLED 8192
+#define PSYS_DISABLED 8192
+#define PSYS_OB_ANIM_RESTORE 16384 /* runtime flag */
/* pars->flag */
#define PARS_UNEXIST 1
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index e2875d01118..79ed1186c1a 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -614,7 +614,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 */
@@ -837,11 +837,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;
@@ -861,12 +862,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;
@@ -995,7 +996,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;
@@ -1086,7 +1087,7 @@ typedef struct Scene {
void *fps_info; /* (runtime) info/cache used for presenting playback framerate info to the user */
- /* none of the dependancy graph vars is mean to be saved */
+ /* none of the dependency graph vars is mean to be saved */
struct DagForest *theDag;
short dagisvalid, dagflags;
short recalc; /* recalc = counterpart of ob->recalc */
diff --git a/source/blender/makesdna/DNA_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_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index cff4e539e6e..7aa37b547f4 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -40,6 +40,7 @@
struct Ipo;
struct Scene;
struct bSound;
+struct MovieClip;
/* strlens; 256= FILE_MAXFILE, 768= FILE_MAXDIR */
@@ -88,9 +89,11 @@ typedef struct StripProxy {
typedef struct Strip {
struct Strip *next, *prev;
- int rt, len, us, done;
+ int us, done;
int startstill, endstill;
- StripElem *stripdata;
+ StripElem *stripdata; /* only used as an array in IMAGE sequences(!),
+ and as a 1-element array in MOVIE sequences,
+ NULL for all other strip-types */
char dir[768];
StripProxy *proxy;
StripCrop *crop;
@@ -137,10 +140,11 @@ typedef struct Sequence {
int startdisp, enddisp; /*starting and ending points in the sequence*/
float sat;
float mul, handsize;
- /* is sfra needed anymore? - it looks like its only used in one place */
- int sfra; /* starting frame according to the timeline of the scene. */
- int anim_preseek;
- int streamindex; /* streamindex for movie or sound files with several streams */
+
+ short anim_preseek;
+ short streamindex; /* streamindex for movie or sound files with several streams */
+ int multicam_source; /* for multicam source selection */
+ int clip_flag; /* MOVIECLIP render flags */
Strip *strip;
@@ -148,7 +152,9 @@ typedef struct Sequence {
struct Scene *scene;
struct Object *scene_camera; /* override scene camera */
- struct anim *anim;
+ struct anim *anim; /* for MOVIE strips */
+ struct MovieClip *clip; /* for MOVIECLIP strips */
+
float effect_fader;
float speed_fader;
@@ -164,8 +170,6 @@ typedef struct Sequence {
float volume;
float pitch, pan; /* pitch (-0.1..10), pan -2..2 */
- int scenenr; /* for scene selection */
- int multicam_source; /* for multicam source selection */
float strobe;
void *effectdata; /* Struct pointer for effect settings */
@@ -173,9 +177,12 @@ typedef struct Sequence {
int anim_startofs; /* only use part of animation file */
int anim_endofs; /* is subtle different to startofs / endofs */
+
int blend_mode;
float blend_opacity;
+ /* is sfra needed anymore? - it looks like its only used in one place */
+ int sfra, pad; /* starting frame according to the timeline of the scene. */
} Sequence;
typedef struct MetaStack {
@@ -292,7 +299,7 @@ typedef struct SpeedControlVars {
/* convenience define for all selection flags */
#define SEQ_ALLSEL (SELECT+SEQ_LEFTSEL+SEQ_RIGHTSEL)
-/* deprecated, dont use a flag anymore*/
+/* deprecated, don't use a flag anymore*/
/*#define SEQ_ACTIVE 1048576*/
#define SEQ_COLOR_BALANCE_INVERSE_GAIN 1
@@ -321,6 +328,7 @@ typedef struct SpeedControlVars {
#define SEQ_RAM_SOUND 4
#define SEQ_HD_SOUND 5
#define SEQ_SOUND 4
+#define SEQ_MOVIECLIP 6
#define SEQ_EFFECT 8
#define SEQ_CROSS 8
@@ -346,6 +354,9 @@ typedef struct SpeedControlVars {
#define STRIPELEM_PREVIEW_DONE 1
+#define SEQ_MOVIECLIP_RENDER_UNDISTORTED (1<<0)
+#define SEQ_MOVIECLIP_RENDER_STABILIZED (1<<1)
+
#define SEQ_BLEND_REPLACE 0
/* all other BLEND_MODEs are simple SEQ_EFFECT ids and therefore identical
* to the table above. (Only those effects that handle _exactly_ two inputs,
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..940a5bbb20e 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;
@@ -348,7 +348,7 @@ typedef struct Script {
char scriptname[1024]; /* 1024 = FILE_MAX */
char scriptarg[256]; /* 1024 = FILE_MAX */
} Script;
-#define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0;
+#define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0
typedef struct SpaceScript {
SpaceLink *next, *prev;
@@ -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;
@@ -635,7 +635,7 @@ enum FileSortTypeE {
/* filesel types */
#define FILE_UNIX 8
-#define FILE_BLENDER 8 /* dont display relative paths */
+#define FILE_BLENDER 8 /* don't display relative paths */
#define FILE_SPECIAL 9
#define FILE_LOADLIB 1
@@ -693,7 +693,7 @@ enum FileSortTypeE {
/* SpaceImage->sticky
* Note DISABLE should be 0, however would also need to re-arrange icon order,
- * also, sticky loc is the default mode so this means we dont need to 'do_versons' */
+ * also, sticky loc is the default mode so this means we don't need to 'do_versons' */
#define SI_STICKY_LOC 0
#define SI_STICKY_DISABLE 1
#define SI_STICKY_VERTEX 2
@@ -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_texture_types.h b/source/blender/makesdna/DNA_texture_types.h
index c6ffec2aff7..c026c2018fd 100644
--- a/source/blender/makesdna/DNA_texture_types.h
+++ b/source/blender/makesdna/DNA_texture_types.h
@@ -97,9 +97,9 @@ typedef struct MTex {
#ifndef DNA_USHORT_FIX
#define DNA_USHORT_FIX
/**
- * @deprecated This typedef serves to avoid badly typed functions when
- * @deprecated compiling while delivering a proper dna.c. Do not use
- * @deprecated it in any case.
+ * \deprecated This typedef serves to avoid badly typed functions when
+ * \deprecated compiling while delivering a proper dna.c. Do not use
+ * \deprecated it in any case.
*/
typedef unsigned short dna_ushort_fix;
#endif
@@ -232,7 +232,7 @@ typedef struct Tex {
/* newnoise: distorted noise amount, musgrave & voronoi ouput scale */
float dist_amount, ns_outscale;
- /* newnoise: voronoi nearest neighbour weights, minkovsky exponent, distance metric & color type */
+ /* newnoise: voronoi nearest neighbor weights, minkovsky exponent, distance metric & color type */
float vn_w1;
float vn_w2;
float vn_w3;
diff --git a/source/blender/makesdna/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 d64c3133001..40c4a7fab9d 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -151,7 +151,7 @@ typedef struct ThemeUI {
uiWidgetColors wcol_regular, wcol_tool, wcol_text;
uiWidgetColors wcol_radio, wcol_option, wcol_toggle;
uiWidgetColors wcol_num, wcol_numslider;
- uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item;
+ uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item, wcol_tooltip;
uiWidgetColors wcol_box, wcol_scroll, wcol_progress, wcol_list_item;
uiWidgetStateColors wcol_state;
@@ -205,7 +205,7 @@ typedef struct ThemeSpace {
char grid[4];
char wire[4], select[4];
- char lamp[4], speaker[4], pad2[4];
+ char lamp[4], speaker[4], empty[4],camera[4], pad[8];
char active[4], group[4], group_active[4], transform[4];
char vertex[4], vertex_select[4];
char edge[4], edge_select[4];
@@ -236,7 +236,7 @@ typedef struct ThemeSpace {
char syntaxl[4], syntaxn[4], syntaxb[4]; // syntax for textwindow and nodes
char syntaxv[4], syntaxc[4];
- char movie[4], image[4], scene[4], audio[4]; // for sequence editor
+ char movie[4], movieclip[4], image[4], scene[4], audio[4]; // for sequence editor
char effect[4], plugin[4], transition[4], meta[4];
char editmesh_active[4];
@@ -422,6 +422,9 @@ typedef struct UserDef {
int compute_device_type;
int compute_device_id;
+
+ float fcu_inactive_alpha; /* opacity of inactive F-Curves in F-Curve Editor */
+ float pad;
} UserDef;
extern UserDef U; /* from blenkernel blender.c */
@@ -510,6 +513,7 @@ extern UserDef U; /* from blenkernel blender.c */
#define USER_SPLASH_DISABLE (1 << 27)
#define USER_HIDE_RECENT (1 << 28)
#define USER_SHOW_THUMBNAILS (1 << 29)
+#define USER_QUIT_PROMPT (1 << 30)
/* Auto-Keying mode */
/* AUTOKEY_ON is a bitflag */
@@ -617,13 +621,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..c86d9d17b1f 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -85,7 +85,7 @@ enum ReportListFlags {
RPT_PRINT = 1,
RPT_STORE = 2,
RPT_FREE = 4,
- RPT_OP_HOLD = 8 /* dont move them into the operator global list (caller will use) */
+ RPT_OP_HOLD = 8 /* don't move them into the operator global list (caller will use) */
};
#
#
@@ -98,7 +98,7 @@ typedef struct Report {
const char *message;
} Report;
-/* saved in the wm, dont remove */
+/* saved in the wm, don't remove */
typedef struct ReportList {
ListBase list;
int printlevel; /* ReportType */
@@ -159,7 +159,7 @@ typedef struct wmWindowManager {
typedef struct wmWindow {
struct wmWindow *next, *prev;
- void *ghostwin; /* dont want to include ghost.h stuff */
+ void *ghostwin; /* don't want to include ghost.h stuff */
int winid; /* winid also in screens, is for retrieving this window after read */
@@ -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/DNA_world_types.h b/source/blender/makesdna/DNA_world_types.h
index 5482566ac41..b3c10406d4c 100644
--- a/source/blender/makesdna/DNA_world_types.h
+++ b/source/blender/makesdna/DNA_world_types.h
@@ -66,7 +66,7 @@ typedef struct World {
/**
* Exposure= mult factor. unused now, but maybe back later. Kept in to be upward compat.
* New is exp/range control. linfac & logfac are constants... don't belong in
- * file, but allocating 8 bytes for temp mem isnt useful either.
+ * file, but allocating 8 bytes for temp mem isn't useful either.
*/
float exposure, exp, range;
float linfac, logfac;
diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c
index 9c2289b2edd..ef7a2746d37 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, dependant 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);
@@ -178,11 +178,11 @@ int DNA_elem_array_size(const char *astr, int len)
memcpy(str, astr, len+1);
- for(a=0; a<len; a++) {
- if( str[a]== '[' ) {
+ for (a=0; a<len; a++) {
+ if ( str[a]== '[' ) {
cp= &(str[a+1]);
}
- else if( str[a]==']' && cp) {
+ else if ( str[a]==']' && cp) {
str[a]= 0;
mul*= atoi(cp);
}
@@ -226,17 +226,17 @@ static int elementsize(SDNA *sdna, short type, short name)
namelen= strlen(cp);
/* is it a pointer or function pointer? */
- if(ispointer(cp)) {
+ if (ispointer(cp)) {
/* has the naam an extra length? (array) */
mul= 1;
- if( cp[namelen-1]==']') mul= DNA_elem_array_size(cp, namelen);
+ if ( cp[namelen-1]==']') mul= DNA_elem_array_size(cp, namelen);
len= sdna->pointerlen*mul;
}
- else if( sdna->typelens[type] ) {
+ else if ( sdna->typelens[type] ) {
/* has the naam an extra length? (array) */
mul= 1;
- if( cp[namelen-1]==']') mul= DNA_elem_array_size(cp, namelen);
+ if ( cp[namelen-1]==']') mul= DNA_elem_array_size(cp, namelen);
len= mul*sdna->typelens[type];
@@ -258,7 +258,7 @@ static void printstruct(SDNA *sdna, short strnr)
nr= sp[1];
sp+= 2;
- for(b=0; b< nr; b++, sp+= 2) {
+ for (b=0; b< nr; b++, sp+= 2) {
printf(" %s %s\n", sdna->types[sp[0]], sdna->names[sp[1]]);
}
}
@@ -270,11 +270,11 @@ static short *findstruct_name(SDNA *sdna, const char *str)
short *sp= NULL;
- for(a=0; a<sdna->nr_structs; a++) {
+ for (a=0; a<sdna->nr_structs; a++) {
sp= sdna->structs[a];
- if(strcmp( sdna->types[ sp[0] ], str )==0) return sp;
+ if (strcmp( sdna->types[ sp[0] ], str )==0) return sp;
}
return NULL;
@@ -284,9 +284,9 @@ int DNA_struct_find_nr(SDNA *sdna, const char *str)
{
short *sp= NULL;
- if(sdna->lastfind<sdna->nr_structs) {
+ if (sdna->lastfind<sdna->nr_structs) {
sp= sdna->structs[sdna->lastfind];
- if(strcmp( sdna->types[ sp[0] ], str )==0) return sdna->lastfind;
+ if (strcmp( sdna->types[ sp[0] ], str )==0) return sdna->lastfind;
}
#ifdef WITH_DNA_GHASH
@@ -295,11 +295,11 @@ int DNA_struct_find_nr(SDNA *sdna, const char *str)
{
int a;
- for(a=0; a<sdna->nr_structs; a++) {
+ for (a=0; a<sdna->nr_structs; a++) {
sp= sdna->structs[a];
- if(strcmp( sdna->types[ sp[0] ], str )==0) {
+ if (strcmp( sdna->types[ sp[0] ], str )==0) {
sdna->lastfind= a;
return a;
}
@@ -325,16 +325,16 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
data= (int *)sdna->data;
strcpy(str, "SDNA");
- if( *data == *verg ) {
+ if ( *data == *verg ) {
data++;
/* load names array */
strcpy(str, "NAME");
- if( *data == *verg ) {
+ if ( *data == *verg ) {
data++;
- if(do_endian_swap) sdna->nr_names= le_int(*data);
+ if (do_endian_swap) sdna->nr_names= le_int(*data);
else sdna->nr_names= *data;
data++;
@@ -347,20 +347,20 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
nr= 0;
cp= (char *)data;
- while(nr<sdna->nr_names) {
+ while (nr<sdna->nr_names) {
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 */
- if(*cp == '[' && strcmp(cp, "[3]")==0) {
- if(nr && strcmp(sdna->names[nr-1], "Cvi") == 0) {
+ * "[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]";
gravity_fix= nr;
}
}
- while( *cp) cp++;
+ while ( *cp) cp++;
cp++;
nr++;
}
@@ -371,10 +371,10 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
/* load type names array */
data= (int *)cp;
strcpy(str, "TYPE");
- if( *data == *verg ) {
+ if ( *data == *verg ) {
data++;
- if(do_endian_swap) sdna->nr_types= le_int(*data);
+ if (do_endian_swap) sdna->nr_types= le_int(*data);
else sdna->nr_types= *data;
data++;
@@ -387,18 +387,18 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
nr= 0;
cp= (char *)data;
- while(nr<sdna->nr_types) {
+ while (nr<sdna->nr_types) {
sdna->types[nr]= cp;
/* this is a patch, to change struct names without a conflict with SDNA */
/* be careful to use it, in this case for a system-struct (opengl/X) */
- if( *cp == 'b') {
+ if ( *cp == 'b') {
/* struct Screen was already used by X, 'bScreen' replaces the old IrisGL 'Screen' struct */
- if( strcmp("bScreen", cp)==0 ) sdna->types[nr]= cp+1;
+ if ( strcmp("bScreen", cp)==0 ) sdna->types[nr]= cp+1;
}
- while( *cp) cp++;
+ while ( *cp) cp++;
cp++;
nr++;
}
@@ -409,16 +409,16 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
/* load typelen array */
data= (int *)cp;
strcpy(str, "TLEN");
- if( *data == *verg ) {
+ if ( *data == *verg ) {
data++;
sp= (short *)data;
sdna->typelens= sp;
- if(do_endian_swap) {
+ if (do_endian_swap) {
short a, *spo= sp;
a= sdna->nr_types;
- while(a--) {
+ while (a--) {
spo[0]= le_short(spo[0]);
spo++;
}
@@ -430,15 +430,15 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
printf("TLEN error in SDNA file\n");
return;
}
- if(sdna->nr_types & 1) sp++; /* prevent BUS error */
+ if (sdna->nr_types & 1) sp++; /* prevent BUS error */
/* load struct array */
data= (int *)sp;
strcpy(str, "STRC");
- if( *data == *verg ) {
+ if ( *data == *verg ) {
data++;
- if(do_endian_swap) sdna->nr_structs= le_int(*data);
+ if (do_endian_swap) sdna->nr_structs= le_int(*data);
else sdna->nr_structs= *data;
data++;
@@ -451,10 +451,10 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
nr= 0;
sp= (short *)data;
- while(nr<sdna->nr_structs) {
+ while (nr<sdna->nr_structs) {
sdna->structs[nr]= sp;
- if(do_endian_swap) {
+ if (do_endian_swap) {
short a;
sp[0]= le_short(sp[0]);
@@ -462,7 +462,7 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
a= sp[1];
sp+= 2;
- while(a--) {
+ while (a--) {
sp[0]= le_short(sp[0]);
sp[1]= le_short(sp[1]);
sp+= 2;
@@ -481,17 +481,17 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
sdna->pointerlen= sdna->typelens[ sp[0] ]/2;
- if(sp[1]!=2 || (sdna->pointerlen!=4 && sdna->pointerlen!=8)) {
+ if (sp[1]!=2 || (sdna->pointerlen!=4 && sdna->pointerlen!=8)) {
printf("ListBase struct error! Needs it to calculate pointerize.\n");
exit(0);
/* well, at least sizeof(ListBase) is error proof! (ton) */
}
/* second part of gravity problem, setting "gravity" type to void */
- if(gravity_fix > -1) {
- for(nr=0; nr<sdna->nr_structs; nr++) {
+ if (gravity_fix > -1) {
+ for (nr=0; nr<sdna->nr_structs; nr++) {
sp= sdna->structs[nr];
- if(strcmp(sdna->types[sp[0]], "ClothSimSettings") == 0)
+ if (strcmp(sdna->types[sp[0]], "ClothSimSettings") == 0)
sp[10]= SDNA_TYPE_VOID;
}
}
@@ -500,7 +500,7 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
/* create a ghash lookup to speed up */
sdna->structs_map= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "init_structDNA gh");
- for(nr = 0; nr < sdna->nr_structs; nr++) {
+ for (nr = 0; nr < sdna->nr_structs; nr++) {
sp= sdna->structs[nr];
BLI_ghash_insert(sdna->structs_map, (void *)sdna->types[sp[0]], (void *)(nr + 1));
}
@@ -537,15 +537,15 @@ static void recurs_test_compflags(SDNA *sdna, char *compflags, int structnr)
sp= sdna->structs[structnr];
typenr= sp[0];
- for(a=0; a<sdna->nr_structs; a++) {
- if(a!=structnr && compflags[a]==1) {
+ for (a=0; a<sdna->nr_structs; a++) {
+ if (a!=structnr && compflags[a]==1) {
sp= sdna->structs[a];
elems= sp[1];
sp+= 2;
- for(b=0; b<elems; b++, sp+=2) {
- if(sp[0]==typenr) {
+ for (b=0; b<elems; b++, sp+=2) {
+ if (sp[0]==typenr) {
cp= sdna->names[ sp[1] ];
- if(!ispointer(cp)) {
+ if (!ispointer(cp)) {
compflags[a]= 2;
recurs_test_compflags(sdna, compflags, a);
}
@@ -578,7 +578,7 @@ char *DNA_struct_get_compareflags(SDNA *sdna, SDNA *newsdna)
const char *str1, *str2;
char *compflags;
- if(sdna->nr_structs==0) {
+ if (sdna->nr_structs==0) {
printf("error: file without SDNA\n");
return NULL;
}
@@ -589,42 +589,42 @@ char *DNA_struct_get_compareflags(SDNA *sdna, SDNA *newsdna)
* the structs in 'newsdna'
*/
- for(a=0; a<sdna->nr_structs; a++) {
+ for (a=0; a<sdna->nr_structs; a++) {
spold= sdna->structs[a];
/* search for type in cur */
spcur= findstruct_name(newsdna, sdna->types[spold[0]]);
- if(spcur) {
+ if (spcur) {
compflags[a]= 2;
/* compare length and amount of elems */
- if( spcur[1] == spold[1]) {
- if( newsdna->typelens[spcur[0]] == sdna->typelens[spold[0]] ) {
+ if ( spcur[1] == spold[1]) {
+ if ( newsdna->typelens[spcur[0]] == sdna->typelens[spold[0]] ) {
/* same length, same amount of elems, now per type and name */
b= spold[1];
spold+= 2;
spcur+= 2;
- while(b > 0) {
+ while (b > 0) {
str1= newsdna->types[spcur[0]];
str2= sdna->types[spold[0]];
- if(strcmp(str1, str2)!=0) break;
+ if (strcmp(str1, str2)!=0) break;
str1= newsdna->names[spcur[1]];
str2= sdna->names[spold[1]];
- if(strcmp(str1, str2)!=0) break;
+ if (strcmp(str1, str2)!=0) break;
/* same type and same name, now pointersize */
- if(ispointer(str1)) {
- if(sdna->pointerlen!=newsdna->pointerlen) break;
+ if (ispointer(str1)) {
+ if (sdna->pointerlen!=newsdna->pointerlen) break;
}
b--;
spold+= 2;
spcur+= 2;
}
- if(b==0) compflags[a]= 1;
+ if (b==0) compflags[a]= 1;
}
}
@@ -640,18 +640,18 @@ char *DNA_struct_get_compareflags(SDNA *sdna, SDNA *newsdna)
/* Because structs can be inside structs, we recursively
* set flags when a struct is altered
*/
- for(a=0; a<sdna->nr_structs; a++) {
- if(compflags[a]==2) recurs_test_compflags(sdna, compflags, a);
+ for (a=0; a<sdna->nr_structs; a++) {
+ if (compflags[a]==2) recurs_test_compflags(sdna, compflags, a);
}
-/*
- for(a=0; a<sdna->nr_structs; a++) {
- if(compflags[a]==2) {
+#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;
}
@@ -659,16 +659,16 @@ char *DNA_struct_get_compareflags(SDNA *sdna, SDNA *newsdna)
static eSDNA_Type sdna_type_nr(const char *dna_type)
{
if ((strcmp(dna_type, "char")==0) || (strcmp(dna_type, "const char")==0)) return SDNA_TYPE_CHAR;
- else if((strcmp(dna_type, "uchar")==0) || (strcmp(dna_type, "unsigned char")==0)) return SDNA_TYPE_UCHAR;
- else if( strcmp(dna_type, "short")==0) return SDNA_TYPE_SHORT;
- else if((strcmp(dna_type, "ushort")==0)||(strcmp(dna_type, "unsigned short")==0)) return SDNA_TYPE_USHORT;
- else if( strcmp(dna_type, "int")==0) return SDNA_TYPE_INT;
- else if( strcmp(dna_type, "long")==0) return SDNA_TYPE_LONG;
- else if((strcmp(dna_type, "ulong")==0)||(strcmp(dna_type, "unsigned long")==0)) return SDNA_TYPE_ULONG;
- else if( strcmp(dna_type, "float")==0) return SDNA_TYPE_FLOAT;
- else if( strcmp(dna_type, "double")==0) return SDNA_TYPE_DOUBLE;
- else if( strcmp(dna_type, "int64_t")==0) return SDNA_TYPE_INT64;
- else if( strcmp(dna_type, "uint64_t")==0) return SDNA_TYPE_UINT64;
+ else if ((strcmp(dna_type, "uchar")==0) || (strcmp(dna_type, "unsigned char")==0)) return SDNA_TYPE_UCHAR;
+ else if ( strcmp(dna_type, "short")==0) return SDNA_TYPE_SHORT;
+ else if ((strcmp(dna_type, "ushort")==0)||(strcmp(dna_type, "unsigned short")==0)) return SDNA_TYPE_USHORT;
+ else if ( strcmp(dna_type, "int")==0) return SDNA_TYPE_INT;
+ else if ( strcmp(dna_type, "long")==0) return SDNA_TYPE_LONG;
+ else if ((strcmp(dna_type, "ulong")==0)||(strcmp(dna_type, "unsigned long")==0)) return SDNA_TYPE_ULONG;
+ else if ( strcmp(dna_type, "float")==0) return SDNA_TYPE_FLOAT;
+ else if ( strcmp(dna_type, "double")==0) return SDNA_TYPE_DOUBLE;
+ else if ( strcmp(dna_type, "int64_t")==0) return SDNA_TYPE_INT64;
+ else if ( strcmp(dna_type, "uint64_t")==0) return SDNA_TYPE_UINT64;
else return -1; /* invalid! */
}
@@ -691,7 +691,7 @@ static void cast_elem(const char *ctype, const char *otype, const char *name, ch
oldlen= DNA_elem_type_size(otypenr);
curlen= DNA_elem_type_size(ctypenr);
- while(arrlen>0) {
+ while (arrlen>0) {
switch(otypenr) {
case SDNA_TYPE_CHAR:
val= *olddata; break;
@@ -733,10 +733,10 @@ static void cast_elem(const char *ctype, const char *otype, const char *name, ch
case SDNA_TYPE_ULONG:
*( (unsigned int *)curdata)= val; break;
case SDNA_TYPE_FLOAT:
- if(otypenr<2) val/= 255;
+ if (otypenr<2) val/= 255;
*( (float *)curdata)= val; break;
case SDNA_TYPE_DOUBLE:
- if(otypenr<2) val/= 255;
+ if (otypenr<2) val/= 255;
*( (double *)curdata)= val; break;
case SDNA_TYPE_INT64:
*( (int64_t *)curdata)= val; break;
@@ -761,12 +761,12 @@ static void cast_pointer(int curlen, int oldlen, const char *name, char *curdata
arrlen= DNA_elem_array_size(name, strlen(name));
- while(arrlen>0) {
+ while (arrlen>0) {
- if(curlen==oldlen) {
+ if (curlen==oldlen) {
memcpy(curdata, olddata, curlen);
}
- else if(curlen==4 && oldlen==8) {
+ else if (curlen==4 && oldlen==8) {
#ifdef WIN32
lval= *( (__int64 *)olddata );
#else
@@ -774,7 +774,7 @@ static void cast_pointer(int curlen, int oldlen, const char *name, char *curdata
#endif
*((int *)curdata) = lval>>3; /* is of course gambling! */
}
- else if(curlen==8 && oldlen==4) {
+ else if (curlen==8 && oldlen==4) {
#ifdef WIN32
*( (__int64 *)curdata ) = *((int *)olddata);
#else
@@ -783,7 +783,7 @@ static void cast_pointer(int curlen, int oldlen, const char *name, char *curdata
}
else {
/* for debug */
- printf("errpr: illegal pointersize! \n");
+ printf("errpr: illegal pointersize!\n");
}
olddata+= oldlen;
@@ -799,10 +799,10 @@ static int elem_strcmp(const char *name, const char *oname)
/* strcmp without array part */
- while(1) {
- if(name[a] != oname[a]) return 1;
- if(name[a]=='[') break;
- if(name[a]==0) break;
+ while (1) {
+ if (name[a] != oname[a]) return 1;
+ if (name[a]=='[') break;
+ if (name[a]==0) break;
a++;
}
return 0;
@@ -818,16 +818,16 @@ static char *find_elem(SDNA *sdna, const char *type, const char *name, short *ol
/* in old is the old struct */
elemcount= old[1];
old+= 2;
- for(a=0; a<elemcount; a++, old+=2) {
+ for (a=0; a<elemcount; a++, old+=2) {
otype= sdna->types[old[0]];
oname= sdna->names[old[1]];
len= elementsize(sdna, old[0], old[1]);
- if( elem_strcmp(name, oname)==0 ) { /* naam equal */
- if( strcmp(type, otype)==0 ) { /* type equal */
- if(sppo) *sppo= old;
+ if ( elem_strcmp(name, oname)==0 ) { /* naam equal */
+ if ( strcmp(type, otype)==0 ) { /* type equal */
+ if (sppo) *sppo= old;
return olddata;
}
@@ -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;
@@ -858,53 +858,53 @@ static void reconstruct_elem(SDNA *newsdna, SDNA *oldsdna,
/* is 'name' an array? */
cp= name;
array= 0;
- while( *cp && *cp!='[') {
+ while ( *cp && *cp!='[') {
cp++; array++;
}
- if( *cp!= '[' ) array= 0;
+ if ( *cp!= '[' ) array= 0;
/* in old is the old struct */
elemcount= old[1];
old+= 2;
- for(a=0; a<elemcount; a++, old+=2) {
+ for (a=0; a<elemcount; a++, old+=2) {
otype= oldsdna->types[old[0]];
oname= oldsdna->names[old[1]];
len= elementsize(oldsdna, old[0], old[1]);
- if( strcmp(name, oname)==0 ) { /* name equal */
+ if ( strcmp(name, oname)==0 ) { /* name equal */
- if(ispointer(name)) { /* pointer of functionpointer afhandelen */
+ if (ispointer(name)) { /* pointer of functionpointer afhandelen */
cast_pointer(newsdna->pointerlen, oldsdna->pointerlen, name, curdata, olddata);
}
- else if( strcmp(type, otype)==0 ) { /* type equal */
+ else if ( strcmp(type, otype)==0 ) { /* type equal */
memcpy(curdata, olddata, len);
}
else cast_elem(type, otype, name, curdata, olddata);
return;
}
- else if(array) { /* name is an array */
+ else if (array) { /* name is an array */
- if(oname[array]=='[' && strncmp(name, oname, array)==0 ) { /* basis equal */
+ if (oname[array]=='[' && strncmp(name, oname, array)==0 ) { /* basis equal */
cursize= DNA_elem_array_size(name, strlen(name));
oldsize= DNA_elem_array_size(oname, strlen(oname));
- if(ispointer(name)) { /* handle pointer or functionpointer */
- if(cursize>oldsize) cast_pointer(newsdna->pointerlen, oldsdna->pointerlen, oname, curdata, olddata);
+ if (ispointer(name)) { /* handle pointer or functionpointer */
+ if (cursize>oldsize) cast_pointer(newsdna->pointerlen, oldsdna->pointerlen, oname, curdata, olddata);
else cast_pointer(newsdna->pointerlen, oldsdna->pointerlen, name, curdata, olddata);
}
- else if(name[0]=='*' || strcmp(type, otype)==0 ) { /* type equal */
+ else if (name[0]=='*' || strcmp(type, otype)==0 ) { /* type equal */
mul= len/oldsize;
mul*= (cursize < oldsize)? cursize: oldsize;
memcpy(curdata, olddata, mul);
/* terminate strings */
- if(oldsize > cursize && strcmp(type, "char")==0)
+ if (oldsize > cursize && strcmp(type, "char")==0)
curdata[mul-1]= 0;
}
else {
- if(cursize>oldsize) cast_elem(type, otype, oname, curdata, olddata);
+ if (cursize>oldsize) cast_elem(type, otype, oname, curdata, olddata);
else cast_elem(type, otype, name, curdata, olddata);
}
return;
@@ -926,10 +926,10 @@ static void reconstruct_struct(SDNA *newsdna, SDNA *oldsdna,
char *type, *cpo, *cpc;
const char *name, *nameo;
- if(oldSDNAnr== -1) return;
- if(curSDNAnr== -1) return;
+ if (oldSDNAnr== -1) return;
+ if (curSDNAnr== -1) return;
- if( compflags[oldSDNAnr]==1 ) { /* if recursive: test for equal */
+ if ( compflags[oldSDNAnr]==1 ) { /* if recursive: test for equal */
spo= oldsdna->structs[oldSDNAnr];
elen= oldsdna->typelens[ spo[0] ];
@@ -947,19 +947,19 @@ static void reconstruct_struct(SDNA *newsdna, SDNA *oldsdna,
spc+= 2;
cpc= cur;
- for(a=0; a<elemcount; a++, spc+=2) {
+ for (a=0; a<elemcount; a++, spc+=2) {
type= newsdna->types[spc[0]];
name= newsdna->names[spc[1]];
elen= elementsize(newsdna, spc[0], spc[1]);
/* test: is type a struct? */
- if(spc[0]>=firststructtypenr && !ispointer(name)) {
+ if (spc[0]>=firststructtypenr && !ispointer(name)) {
/* where does the old struct data start (and is there an old one?) */
cpo= find_elem(oldsdna, type, name, spo, data, &sppo);
- if(cpo) {
+ if (cpo) {
oldSDNAnr= DNA_struct_find_nr(oldsdna, type);
curSDNAnr= DNA_struct_find_nr(newsdna, type);
@@ -973,14 +973,14 @@ static void reconstruct_struct(SDNA *newsdna, SDNA *oldsdna,
elen/= mul;
eleno/= mulo;
- while(mul--) {
+ while (mul--) {
reconstruct_struct(newsdna, oldsdna, compflags, oldSDNAnr, cpo, curSDNAnr, cpc);
cpo+= eleno;
cpc+= elen;
/* new struct array larger than old */
mulo--;
- if(mulo<=0) break;
+ if (mulo<=0) break;
}
}
else cpc+= elen;
@@ -1004,7 +1004,7 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
char *type, *cpo, *cur, cval;
const char *name;
- if(oldSDNAnr== -1) return;
+ if (oldSDNAnr== -1) return;
firststructtypenr= *(oldsdna->structs[0]);
spo= spc= oldsdna->structs[oldSDNAnr];
@@ -1014,7 +1014,7 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
spc+= 2;
cur= data;
- for(a=0; a<elemcount; a++, spc+=2) {
+ for (a=0; a<elemcount; a++, spc+=2) {
type= oldsdna->types[spc[0]];
name= oldsdna->names[spc[1]];
@@ -1022,16 +1022,16 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
elen= elementsize(oldsdna, spc[0], spc[1]);
/* test: is type a struct? */
- if(spc[0]>=firststructtypenr && !ispointer(name)) {
+ if (spc[0]>=firststructtypenr && !ispointer(name)) {
/* where does the old data start (is there one?) */
cpo= find_elem(oldsdna, type, name, spo, data, NULL);
- if(cpo) {
+ if (cpo) {
oldSDNAnr= DNA_struct_find_nr(oldsdna, type);
mul= DNA_elem_array_size(name, strlen(name));
elena= elen/mul;
- while(mul--) {
+ while (mul--) {
DNA_struct_switch_endian(oldsdna, oldSDNAnr, cpo);
cpo += elena;
}
@@ -1039,12 +1039,12 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
}
else {
- if(ispointer(name)) {
- if(oldsdna->pointerlen==8) {
+ if (ispointer(name)) {
+ if (oldsdna->pointerlen==8) {
mul= DNA_elem_array_size(name, strlen(name));
cpo= cur;
- while(mul--) {
+ while (mul--) {
cval= cpo[0]; cpo[0]= cpo[7]; cpo[7]= cval;
cval= cpo[1]; cpo[1]= cpo[6]; cpo[6]= cval;
cval= cpo[2]; cpo[2]= cpo[5]; cpo[5]= cval;
@@ -1063,17 +1063,17 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
/* exception: variable called blocktype/ipowin: derived from ID_ */
skip= 0;
- if(name[0]=='b' && name[1]=='l') {
- if(strcmp(name, "blocktype")==0) skip= 1;
+ if (name[0]=='b' && name[1]=='l') {
+ if (strcmp(name, "blocktype")==0) skip= 1;
}
- else if(name[0]=='i' && name[1]=='p') {
- if(strcmp(name, "ipowin")==0) skip= 1;
+ else if (name[0]=='i' && name[1]=='p') {
+ if (strcmp(name, "ipowin")==0) skip= 1;
}
- if(skip==0) {
+ if (skip==0) {
mul= DNA_elem_array_size(name, strlen(name));
cpo= cur;
- while(mul--) {
+ while (mul--) {
cval= cpo[0];
cpo[0]= cpo[1];
cpo[1]= cval;
@@ -1089,7 +1089,7 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
mul= DNA_elem_array_size(name, strlen(name));
cpo= cur;
- while(mul--) {
+ while (mul--) {
cval= cpo[0];
cpo[0]= cpo[3];
cpo[3]= cval;
@@ -1104,7 +1104,7 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
{
mul= DNA_elem_array_size(name, strlen(name));
cpo= cur;
- while(mul--) {
+ while (mul--) {
cval= cpo[0]; cpo[0]= cpo[7]; cpo[7]= cval;
cval= cpo[1]; cpo[1]= cpo[6]; cpo[6]= cval;
cval= cpo[2]; cpo[2]= cpo[5]; cpo[5]= cval;
@@ -1132,18 +1132,18 @@ void *DNA_struct_reconstruct(SDNA *newsdna, SDNA *oldsdna, char *compflags, int
curSDNAnr= DNA_struct_find_nr(newsdna, type);
/* init data and alloc */
- if(curSDNAnr >= 0) {
+ if (curSDNAnr >= 0) {
spc= newsdna->structs[curSDNAnr];
curlen= newsdna->typelens[ spc[0] ];
}
- if(curlen==0) {
+ if (curlen==0) {
return NULL;
}
cur= MEM_callocN( blocks*curlen, "reconstruct");
cpc= cur;
cpo= data;
- for(a=0; a<blocks; a++) {
+ for (a=0; a<blocks; a++) {
reconstruct_struct(newsdna, oldsdna, compflags, oldSDNAnr, cpo, curSDNAnr, cpc);
cpc+= curlen;
cpo+= oldlen;
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 2fa52776453..ae6432dcbe4 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>
@@ -148,9 +146,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:
@@ -229,11 +227,19 @@ 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++) {
- if(strcmp(str, types[nr])==0) {
+ for (nr=0; nr<nr_types; nr++) {
+ if (strcmp(str, types[nr])==0) {
if (len) {
typelens[nr]= len;
alphalens[nr] = len;
@@ -243,7 +249,7 @@ static int add_type(const char *str, int len)
}
/* append new type */
- if(nr_types==0) cp= typedata;
+ if (nr_types==0) cp= typedata;
else {
cp= types[nr_types-1]+strlen(types[nr_types-1])+1;
}
@@ -252,7 +258,7 @@ static int add_type(const char *str, int len)
typelens[nr_types]= len;
alphalens[nr_types]= len;
- if(nr_types>=maxnr) {
+ if (nr_types>=maxnr) {
printf("too many types\n");
return nr_types-1;
}
@@ -279,13 +285,13 @@ static int add_name(const char *str)
additional_slen_offset = 0;
- if(str[0]==0 /* || (str[1]==0) */) return -1;
+ if (str[0]==0 /* || (str[1]==0) */) return -1;
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");
@@ -306,16 +312,16 @@ static int add_name(const char *str)
j++; /* j beyond closing brace ? */
while ((str[j] != 0) && (str[j] != ')' )) {
- if (debugSDNA > 3) printf("seen %c ( %d) \n", str[j], str[j]);
+ if (debugSDNA > 3) printf("seen %c ( %d)\n", str[j], str[j]);
j++;
}
- if (debugSDNA > 3) printf("seen %c ( %d) \n"
+ if (debugSDNA > 3) printf("seen %c ( %d)\n"
"special after offset%d\n",
str[j], str[j], j);
if (!isfuncptr) {
/* multidimensional array pointer case */
- if(str[j] == 0) {
+ if (str[j] == 0) {
if (debugSDNA > 3) printf("offsetting for multidim array pointer\n");
}
else
@@ -331,10 +337,12 @@ static int add_name(const char *str)
}
if (debugSDNA > 3) printf("extra offset %d\n", k);
additional_slen_offset = k;
- } else if (str[j] == ')' ) {
+ }
+ else if (str[j] == ')' ) {
if (debugSDNA > 3) printf("offsetting for brace\n");
; /* don't get extra offset */
- } else {
+ }
+ else {
printf("Error during tokening function pointer argument list\n");
}
@@ -362,7 +370,8 @@ static int add_name(const char *str)
buf[i+5] = 'd';
buf[i+6] = ')';
buf[i+7] = 0;
- } else {
+ }
+ else {
buf[i] = ')';
buf[i+1] = '(';
buf[i+2] = ')';
@@ -371,27 +380,28 @@ static int add_name(const char *str)
/* now precede with buf*/
if (debugSDNA > 3) printf("\t\t\t\t\tProposing fp name %s\n", buf);
name = buf;
- } else {
+ }
+ else {
/* normal field: old code */
name = str;
}
/* search name array */
- for(nr=0; nr<nr_names; nr++) {
- if(strcmp(name, names[nr])==0) {
+ for (nr=0; nr<nr_names; nr++) {
+ if (strcmp(name, names[nr])==0) {
return nr;
}
}
/* append new type */
- if(nr_names==0) cp= namedata;
+ if (nr_names==0) cp= namedata;
else {
cp= names[nr_names-1]+strlen(names[nr_names-1])+1;
}
strcpy(cp, name);
names[nr_names]= cp;
- if(nr_names>=maxnr) {
+ if (nr_names>=maxnr) {
printf("too many names\n");
return nr_names-1;
}
@@ -405,7 +415,7 @@ static short *add_struct(int namecode)
int len;
short *sp;
- if(nr_structs==0) {
+ if (nr_structs==0) {
structs[0]= structdata;
}
else {
@@ -417,7 +427,7 @@ static short *add_struct(int namecode)
sp= structs[nr_structs];
sp[0]= namecode;
- if(nr_structs>=maxnr) {
+ if (nr_structs>=maxnr) {
printf("too many structs\n");
return sp;
}
@@ -443,10 +453,11 @@ static int preprocess_include(char *maindata, int len)
cp= temp;
a= len;
comment = 0;
- while(a--) {
- if(cp[0]=='/' && cp[1]=='/') {
+ while (a--) {
+ if (cp[0]=='/' && cp[1]=='/') {
comment = 1;
- } else if (*cp<32) {
+ }
+ else if (*cp<32) {
comment = 0;
}
if (comment || *cp<32 || *cp>128 ) *cp= 32;
@@ -460,21 +471,21 @@ static int preprocess_include(char *maindata, int len)
newlen= 0;
comment= 0;
a= len;
- while(a--) {
+ while (a--) {
- if(cp[0]=='/' && cp[1]=='*') {
+ if (cp[0]=='/' && cp[1]=='*') {
comment= 1;
cp[0]=cp[1]= 32;
}
- if(cp[0]=='*' && cp[1]=='/') {
+ if (cp[0]=='*' && cp[1]=='/') {
comment= 0;
cp[0]=cp[1]= 32;
}
/* do not copy when: */
- if(comment);
- else if( cp[0]==' ' && cp[1]==' ' );
- else if( cp[-1]=='*' && cp[0]==' ' ); /* pointers with a space */
+ if (comment);
+ else if ( cp[0]==' ' && cp[1]==' ' );
+ else if ( cp[-1]=='*' && cp[0]==' ' ); /* pointers with a space */
/* skip special keywords */
else if (strncmp("DNA_DEPRECATED", cp, 14)==0) {
@@ -533,8 +544,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;
@@ -551,29 +562,33 @@ static int convert_include(char *filename)
/* we look for '{' and then back to 'struct' */
count= 0;
overslaan= 0;
- while(count<filelen) {
+ while (count<filelen) {
/* code for skipping a struct: two hashes on 2 lines. (preprocess added a space) */
- if(md[0]=='#' && md[1]==' ' && md[2]=='#') {
+ if (md[0]=='#' && md[1]==' ' && md[2]=='#') {
overslaan= 1;
}
- if(md[0]=='{') {
+ if (md[0]=='{') {
md[0]= 0;
- if(overslaan) {
+ if (overslaan) {
overslaan= 0;
}
else {
- if(md[-1]==' ') md[-1]= 0;
+ if (md[-1]==' ') md[-1]= 0;
md1= md-2;
- while( *md1!=32) md1--; /* to beginning of word */
+ while ( *md1!=32) md1--; /* to beginning of word */
md1++;
/* we've got a struct name when... */
- if( strncmp(md1-7, "struct", 6)==0 ) {
+ if ( strncmp(md1-7, "struct", 6)==0 ) {
+
+ strct = add_type(md1, 0);
+ if (strct == -1) {
+ printf("File '%s' contains struct we cant parse \"%s\"\n", filename, md1);
+ return 1;
+ }
-
- strct= add_type(md1, 0);
structpoin= add_struct(strct);
sp= structpoin+2;
@@ -581,26 +596,30 @@ static int convert_include(char *filename)
/* first lets make it all nice strings */
md1= md+1;
- while(*md1 != '}') {
- if(md1>mainend) break;
+ while (*md1 != '}') {
+ if (md1>mainend) break;
- if(*md1==',' || *md1==' ') *md1= 0;
+ if (*md1==',' || *md1==' ') *md1= 0;
md1++;
}
/* read types and names until first character that is not '}' */
md1= md+1;
- while( *md1 != '}' ) {
- if(md1>mainend) break;
+ while ( *md1 != '}' ) {
+ if (md1>mainend) break;
/* skip when it says 'struct' or 'unsigned' or 'const' */
- if(*md1) {
- if( strncmp(md1, "struct", 6)==0 ) md1+= 7;
- if( strncmp(md1, "unsigned", 8)==0 ) md1+= 9;
- if( strncmp(md1, "const", 5)==0 ) md1+= 6;
+ if (*md1) {
+ if ( strncmp(md1, "struct", 6)==0 ) md1+= 7;
+ if ( strncmp(md1, "unsigned", 8)==0 ) md1+= 9;
+ if ( strncmp(md1, "const", 5)==0 ) md1+= 6;
/* 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);
@@ -608,15 +627,15 @@ static int convert_include(char *filename)
/* read until ';' */
- while( *md1 != ';' ) {
- if(md1>mainend) break;
+ while ( *md1 != ';' ) {
+ if (md1>mainend) break;
- if(*md1) {
+ if (*md1) {
/* We've got a name. slen needs
* correction for function
* pointers! */
slen= (int) strlen(md1);
- if( md1[slen-1]==';' ) {
+ if ( md1[slen-1]==';' ) {
md1[slen-1]= 0;
@@ -674,11 +693,11 @@ static int arraysize(char *astr, int len)
memcpy(str, astr, len+1);
- for(a=0; a<len; a++) {
- if( str[a]== '[' ) {
+ for (a=0; a<len; a++) {
+ if ( str[a]== '[' ) {
cp= &(str[a+1]);
}
- else if( str[a]==']' && cp) {
+ else if ( str[a]==']' && cp) {
str[a]= 0;
/* if 'cp' is a preprocessor definition, it will evaluate to 0,
* the caller needs to check for this case and throw an error */
@@ -696,17 +715,17 @@ static int calculate_structlens(int firststruct)
char *cp;
int has_pointer, dna_error = 0;
- while(unknown) {
+ while (unknown) {
lastunknown= unknown;
unknown= 0;
/* check all structs... */
- for(a=0; a<nr_structs; a++) {
+ for (a=0; a<nr_structs; a++) {
structpoin= structs[a];
structtype= structpoin[0];
/* when length is not known... */
- if(typelens[structtype]==0) {
+ if (typelens[structtype]==0) {
sp= structpoin+2;
len= 0;
@@ -714,17 +733,17 @@ static int calculate_structlens(int firststruct)
has_pointer = 0;
/* check all elements in struct */
- for(b=0; b<structpoin[1]; b++, sp+=2) {
+ for (b=0; b<structpoin[1]; b++, sp+=2) {
type= sp[0];
cp= names[sp[1]];
namelen= (int) strlen(cp);
/* is it a pointer or function pointer? */
- if(cp[0]=='*' || cp[1]=='*') {
+ if (cp[0]=='*' || cp[1]=='*') {
has_pointer = 1;
/* has the name an extra length? (array) */
mul= 1;
- if( cp[namelen-1]==']') mul= arraysize(cp, namelen);
+ if ( cp[namelen-1]==']') mul= arraysize(cp, namelen);
if (mul == 0) {
printf("Zero array size found or could not parse %s: '%.*s'\n", types[structtype], namelen + 1, cp);
@@ -732,12 +751,13 @@ static int calculate_structlens(int firststruct)
}
/* 4-8 aligned/ */
- if(sizeof(void *) == 4) {
+ if (sizeof(void *) == 4) {
if (len % 4) {
printf("Align pointer error in struct (len4): %s %s\n", types[structtype], cp);
dna_error = 1;
}
- } else {
+ }
+ else {
if (len % 8) {
printf("Align pointer error in struct (len8): %s %s\n", types[structtype], cp);
dna_error = 1;
@@ -752,14 +772,16 @@ static int calculate_structlens(int firststruct)
len += sizeof(void *) * mul;
alphalen += 8 * mul;
- } else if(cp[0]=='[') {
+ }
+ else if (cp[0]=='[') {
/* parsing can cause names "var" and "[3]" to be found for "float var [3]" ... */
printf("Parse error in struct, invalid member name: %s %s\n", types[structtype], cp);
dna_error = 1;
- } else if( typelens[type] ) {
+ }
+ else if ( typelens[type] ) {
/* has the name an extra length? (array) */
mul= 1;
- if( cp[namelen-1]==']') mul= arraysize(cp, namelen);
+ if ( cp[namelen-1]==']') mul= arraysize(cp, namelen);
if (mul == 0) {
printf("Zero array size found or could not parse %s: '%.*s'\n", types[structtype], namelen + 1, cp);
@@ -767,19 +789,19 @@ static int calculate_structlens(int firststruct)
}
/* struct alignment */
- if(type >= firststruct) {
- if(sizeof(void *)==8 && (len % 8) ) {
+ if (type >= firststruct) {
+ if (sizeof(void *)==8 && (len % 8) ) {
printf("Align struct error: %s %s\n", types[structtype],cp);
dna_error = 1;
}
}
/* 2-4 aligned/ */
- if(typelens[type]>3 && (len % 4) ) {
+ if (typelens[type]>3 && (len % 4) ) {
printf("Align 4 error in struct: %s %s (add %d padding bytes)\n", types[structtype], cp, len%4);
dna_error = 1;
}
- else if(typelens[type]==2 && (len % 2) ) {
+ else if (typelens[type]==2 && (len % 2) ) {
printf("Align 2 error in struct: %s %s (add %d padding bytes)\n", types[structtype], cp, len%2);
dna_error = 1;
}
@@ -787,7 +809,8 @@ static int calculate_structlens(int firststruct)
len += mul*typelens[type];
alphalen += mul * alphalens[type];
- } else {
+ }
+ else {
len= 0;
alphalen = 0;
break;
@@ -796,7 +819,8 @@ static int calculate_structlens(int firststruct)
if (len==0) {
unknown++;
- } else {
+ }
+ else {
typelens[structtype]= len;
alphalens[structtype]= alphalen;
// two ways to detect if a struct contains a pointer:
@@ -808,7 +832,7 @@ static int calculate_structlens(int firststruct)
}
}
- if(len % 4) {
+ if (len % 4) {
printf("Sizeerror 4 in struct: %s (add %d bytes)\n", types[structtype], len%4);
dna_error = 1;
}
@@ -817,35 +841,35 @@ static int calculate_structlens(int firststruct)
}
}
- if(unknown==lastunknown) break;
+ if (unknown==lastunknown) break;
}
- if(unknown) {
+ if (unknown) {
printf("ERROR: still %d structs unknown\n", unknown);
if (debugSDNA) {
- printf("*** Known structs : \n");
+ printf("*** Known structs :\n");
- for(a=0; a<nr_structs; a++) {
+ for (a=0; a<nr_structs; a++) {
structpoin= structs[a];
structtype= structpoin[0];
/* length unknown */
- if(typelens[structtype]!=0) {
+ if (typelens[structtype]!=0) {
printf(" %s\n", types[structtype]);
}
}
}
- printf("*** Unknown structs : \n");
+ printf("*** Unknown structs :\n");
- for(a=0; a<nr_structs; a++) {
+ for (a=0; a<nr_structs; a++) {
structpoin= structs[a];
structtype= structpoin[0];
- /* length unkown yet */
- if(typelens[structtype]==0) {
+ /* length unknown yet */
+ if (typelens[structtype]==0) {
printf(" %s\n", types[structtype]);
}
}
@@ -882,12 +906,12 @@ void printStructLenghts(void)
short *structpoin;
printf("\n\n*** All detected structs:\n");
- while(unknown) {
+ while (unknown) {
/*lastunknown= unknown;*/ /*UNUSED*/
unknown= 0;
/* check all structs... */
- for(a=0; a<nr_structs; a++) {
+ for (a=0; a<nr_structs; a++) {
structpoin= structs[a];
structtype= structpoin[0];
printf("\t%s\t:%d\n", types[structtype], typelens[structtype]);
@@ -911,7 +935,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! */
@@ -965,31 +988,30 @@ static int make_structDNA(char *baseDirectory, FILE *file)
}
/* FOR DEBUG */
- if (debugSDNA > 1)
- {
+ if (debugSDNA > 1) {
int a,b;
/* short *elem; */
short num_types;
printf("nr_names %d nr_types %d nr_structs %d\n", nr_names, nr_types, nr_structs);
- for(a=0; a<nr_names; a++) {
- printf(" %s \n", names[a]);
+ for (a=0; a<nr_names; a++) {
+ printf(" %s\n", names[a]);
}
printf("\n");
sp= typelens;
- for(a=0; a<nr_types; a++, sp++) {
+ for (a=0; a<nr_types; a++, sp++) {
printf(" %s %d\n", types[a], *sp);
}
printf("\n");
- for(a=0; a<nr_structs; a++) {
+ for (a=0; a<nr_structs; a++) {
sp= structs[a];
printf(" struct %s elems: %d size: %d\n", types[sp[0]], sp[1],typelens[sp[0]]);
num_types = sp[1];
sp+= 2;
/* ? num_types was elem? */
- for(b=0; b< num_types; b++, sp+= 2) {
+ for (b=0; b< num_types; b++, sp+= 2) {
printf(" %s %s\n", types[sp[0]], names[sp[1]]);
}
}
@@ -999,7 +1021,7 @@ static int make_structDNA(char *baseDirectory, FILE *file)
if (debugSDNA > -1) printf("Writing file ... ");
- if(nr_names==0 || nr_structs==0);
+ if (nr_names==0 || nr_structs==0);
else {
strcpy(str, "SDNA");
dna_write(file, str, 4);
@@ -1036,7 +1058,7 @@ static int make_structDNA(char *baseDirectory, FILE *file)
dna_write(file, str, 4);
len= 2*nr_types;
- if(nr_types & 1) len+= 2;
+ if (nr_types & 1) len+= 2;
dna_write(file, typelens, len);
/* WRITE STRUCTS */
@@ -1059,7 +1081,7 @@ static int make_structDNA(char *baseDirectory, FILE *file)
int a;
fp= fopen("padding.c", "w");
- if(fp==NULL);
+ if (fp==NULL);
else {
// add all include files defined in the global array
@@ -1067,11 +1089,11 @@ static int make_structDNA(char *baseDirectory, FILE *file)
fprintf(fp, "#include \"%s%s\"\n", baseDirectory, includefiles[i]);
}
- fprintf(fp, "main(){\n");
+ fprintf(fp, "main() {\n");
sp = typelens;
sp += firststruct;
- for(a=firststruct; a<nr_types; a++, sp++) {
- if(*sp) {
+ for (a=firststruct; a<nr_types; a++, sp++) {
+ if (*sp) {
fprintf(fp, "\tif(sizeof(struct %s) - %d) printf(\"ALIGN ERROR:", types[a], *sp);
fprintf(fp, "%%d %s %d ", types[a], *sp);
fprintf(fp, "\\n\", sizeof(struct %s) - %d);\n", types[a], *sp);
@@ -1120,17 +1142,20 @@ int main(int argc, char ** argv)
if (argc!=2 && argc!=3) {
printf("Usage: %s outfile.c [base directory]\n", argv[0]);
return_status = 1;
- } else {
+ }
+ else {
file = fopen(argv[1], "w");
if (!file) {
printf ("Unable to open file: %s\n", argv[1]);
return_status = 1;
- } else {
+ }
+ else {
char baseDirectory[256];
if (argc==3) {
strcpy(baseDirectory, argv[2]);
- } else {
+ }
+ else {
strcpy(baseDirectory, BASE_HEADER);
}
@@ -1140,7 +1165,8 @@ int main(int argc, char ** argv)
fclose(file);
make_bad_file(argv[1], __LINE__);
return_status = 1;
- } else {
+ }
+ else {
fprintf(file, "};\n");
fprintf(file, "int DNAlen= sizeof(DNAstr);\n");
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 67d27af8b41..84301c8000f 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -311,8 +311,8 @@ extern StructRNA RNA_MeshColorLayer;
extern StructRNA RNA_MeshLoopColorLayer;
extern StructRNA RNA_MeshDeformModifier;
extern StructRNA RNA_MeshEdge;
-extern StructRNA RNA_MeshFace;
extern StructRNA RNA_MeshPolygon;
+extern StructRNA RNA_MeshTessFace;
extern StructRNA RNA_MeshLoop;
extern StructRNA RNA_MeshFloatProperty;
extern StructRNA RNA_MeshFloatPropertyLayer;
@@ -336,6 +336,7 @@ extern StructRNA RNA_MotionPath;
extern StructRNA RNA_MotionPathVert;
extern StructRNA RNA_MouseSensor;
extern StructRNA RNA_MovieSequence;
+extern StructRNA RNA_MovieClipSequence;
extern StructRNA RNA_MovieTrackingObject;
extern StructRNA RNA_MulticamSequence;
extern StructRNA RNA_MultiresModifier;
@@ -347,7 +348,7 @@ extern StructRNA RNA_NlaTrack;
extern StructRNA RNA_Node;
extern StructRNA RNA_NodeForLoop;
extern StructRNA RNA_NodeGroup;
-extern StructRNA RNA_NodeImageMultiFileSocket;
+extern StructRNA RNA_NodeImageFileSocket;
extern StructRNA RNA_NodeLink;
extern StructRNA RNA_NodeSocket;
extern StructRNA RNA_NodeSocketPanel;
@@ -951,6 +952,13 @@ int RNA_property_is_idprop(PropertyRNA *prop);
/* python compatible string representation of this property, (must be freed!) */
char *RNA_property_as_string(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop);
char *RNA_pointer_as_string(struct bContext *C, PointerRNA *ptr);
+char *RNA_pointer_as_string_keywords_ex(struct bContext *C, PointerRNA *ptr, PointerRNA *ptr_default,
+ const short skip_optional_value, const short all_args,
+ PropertyRNA *iterprop);
+char *RNA_pointer_as_string_keywords(struct bContext *C, PointerRNA *ptr, PointerRNA *ptr_default,
+ const short skip_optional_value, const short all_args);
+char *RNA_function_as_string_keywords(struct bContext *C, FunctionRNA *func, PointerRNA *ptr_default,
+ const short as_function, const short all_args);
/* Function */
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h
index 95f988b470b..9939d0839e6 100644
--- a/source/blender/makesrna/RNA_define.h
+++ b/source/blender/makesrna/RNA_define.h
@@ -66,6 +66,8 @@ void RNA_def_struct_ui_icon(StructRNA *srna, int icon);
void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext);
void RNA_struct_free(BlenderRNA *brna, StructRNA *srna);
+void RNA_def_struct_translation_context(StructRNA *srna, const char *context);
+
/* Compact Property Definitions */
typedef void StructOrFunctionRNA;
@@ -100,10 +102,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_enum_types.h b/source/blender/makesrna/RNA_enum_types.h
index a333d9ace12..b544c59a403 100644
--- a/source/blender/makesrna/RNA_enum_types.h
+++ b/source/blender/makesrna/RNA_enum_types.h
@@ -136,5 +136,8 @@ EnumPropertyItem *RNA_image_itemf(struct bContext *C, struct PointerRNA *ptr, st
EnumPropertyItem *RNA_image_local_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int *free);
EnumPropertyItem *RNA_scene_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int *free);
EnumPropertyItem *RNA_scene_local_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int *free);
+EnumPropertyItem *RNA_movieclip_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int *free);
+EnumPropertyItem *RNA_movieclip_local_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int *free);
+
#endif /* __RNA_ENUM_TYPES_H__ */
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 2782aa8aca5..6f8e7656a83 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -280,6 +280,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 1bb2daee096..02917f1bce8 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,45 +60,45 @@
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; \
} \
remove(tmpfile); \
- return 1; \
+ return 1 \
/* 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,40 +108,40 @@ 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;
}
- /* XXX, trick to work around dependancy problem
+ /* XXX, trick to work around dependency problem
* assumes dep_files is in the same dir as makesrna.c, which is true for now. */
- if(1) {
+ 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,8 +303,9 @@ 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)
- fprintf(f, " %s *data= (%s*)(((%s*)ptr->data)->%s);\n", dp->dnastructname, dp->dnastructname, 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 +322,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 +336,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 +347,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 +358,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 +367,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 +375,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 +390,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 +402,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 +414,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 +438,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 +453,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,52 +464,55 @@ 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);
}
-static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
+static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp,
+ const char *manualfunc)
{
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;
+ __func__, srna->identifier, prop->identifier, dp->dnatype,
+ RNA_property_typename(prop->type));
+ 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;
+ __func__, srna->identifier, prop->identifier, dp->dnatype,
+ RNA_property_typename(prop->type));
+ DefRNA.error = 1;
return NULL;
}
}
@@ -518,29 +520,30 @@ 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);
+ fprintf(f, " %s(value, data->%s, sizeof(data->%s));\n", string_copy_func,
+ dp->dnaname, dp->dnaname);
}
fprintf(f, "}\n\n");
break;
@@ -548,80 +551,99 @@ 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)
- fprintf(f, " return rna_pointer_inherit_refine(ptr, &RNA_%s, &data->%s);\n", (const char*)pprop->type, dp->dnaname);
+ 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);
+ fprintf(f, " return rna_pointer_inherit_refine(ptr, &RNA_%s, data->%s);\n",
+ (const char*)pprop->type, dp->dnaname);
}
fprintf(f, "}\n\n");
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 ||
- 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);
- else
+ 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);
+ }
+ else {
fprintf(f, " return %s(iter);\n", manualfunc);
+ }
}
fprintf(f, "}\n\n");
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, "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");
+ fprintf(f, " for (i=0; i<len; i++) {\n");
MEM_freeN(lenfunc);
}
else {
fprintf(f, " int i;\n\n");
- fprintf(f, " for(i=0; i<%u; i++) {\n", prop->totarraylength);
+ fprintf(f, " for (i=0; i<%u; i++) {\n", prop->totarraylength);
}
- 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);
+ 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) {
- fprintf(f, " values[i]= %s((data->%s[i] & ", (dp->booleannegative)? "!": "", dp->dnaname);
+ 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))
- fprintf(f, " values[i]= (%s)(data->%s[i]*(1.0f/255.0f));\n", rna_type_type(prop), dp->dnaname);
- 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);
+ 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) {
+ 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);
+ }
}
fprintf(f, " }\n");
}
@@ -631,23 +653,24 @@ 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");
}
else
- fprintf(f, " return (%s)%s(data->%s);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname);
+ fprintf(f, " return (%s)%s(data->%s);\n", rna_type_type(prop),
+ (dp->booleannegative)? "!": "", dp->dnaname);
}
fprintf(f, "}\n\n");
@@ -661,31 +684,31 @@ 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) {
- 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));
+ if (prop->type == PROP_FLOAT) {
+ FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
+ if (fprop->range) {
+ fprintf(f, " float prop_clamp_min = -FLT_MAX, prop_clamp_max = FLT_MAX, prop_soft_min, prop_soft_max;\n");
+ fprintf(f, " %s(ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max);\n", rna_function_string(fprop->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));
+ else if (prop->type == PROP_INT) {
+ IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
+ if (iprop->range) {
+ fprintf(f, " int prop_clamp_min = INT_MIN, prop_clamp_max = INT_MAX, prop_soft_min, prop_soft_max;\n");
+ fprintf(f, " %s(ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max);\n", rna_function_string(iprop->range));
}
}
}
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 +718,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,55 +735,57 @@ 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");
}
-static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
+static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp,
+ const char *manualfunc)
{
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);
+ fprintf(f, " %s(data->%s, value, sizeof(data->%s));\n", string_copy_func,
+ dp->dnaname, dp->dnaname);
}
fprintf(f, "}\n\n");
break;
@@ -768,28 +793,28 @@ 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");
+ fprintf(f, " if (id==value.data) return;\n\n");
}
- if(prop->flag & PROP_ID_REFCOUNT) {
- fprintf(f, "\n if(data->%s)\n", dp->dnaname);
+ 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, " 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)) {
- fprintf(f, " if(value.data)\n");
+ 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,60 +826,65 @@ 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, "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);
- fprintf(f, " for(i=0; i<len; i++) {\n");
+ fprintf(f, " for (i=0; i<len; i++) {\n");
MEM_freeN(lenfunc);
}
else {
fprintf(f, " int i;\n\n");
rna_clamp_value_range(f, prop);
- fprintf(f, " for(i=0; i<%u; i++) {\n", prop->totarraylength);
+ fprintf(f, " for (i=0; i<%u; i++) {\n", prop->totarraylength);
}
- 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);
+ 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);
}
else {
- fprintf(f, " (&data->%s)[i]= %s", dp->dnaname, (dp->booleannegative)? "!": "");
+ fprintf(f, " (&data->%s)[i]= %s", dp->dnaname, (dp->booleannegative) ? "!" : "");
rna_clamp_value(f, prop, 1);
}
}
else {
- if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
- fprintf(f, " if(%svalues[i]) data->%s[i] |= ", (dp->booleannegative)? "!": "", dp->dnaname);
+ 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");
fprintf(f, " else data->%s[i] &= ~", dp->dnaname);
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)
- fprintf(f, " ((%s*)data->%s)[i]= %s", dp->dnatype, dp->dnaname, (dp->booleannegative)? "!": "");
+ 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)? "!": "");
+ fprintf(f, " (data->%s)[i]= %s", dp->dnaname, (dp->booleannegative) ? "!" : "");
rna_clamp_value(f, prop, 1);
}
}
@@ -866,20 +896,20 @@ 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) {
- fprintf(f, " if(%svalue) data->%s |= ", (dp->booleannegative)? "!": "", dp->dnaname);
+ 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");
fprintf(f, " else data->%s &= ~", dp->dnaname);
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");
@@ -887,7 +917,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
}
else {
rna_clamp_value_range(f, prop);
- fprintf(f, " data->%s= %s", dp->dnaname, (dp->booleannegative)? "!": "");
+ fprintf(f, " data->%s= %s", dp->dnaname, (dp->booleannegative) ? "!" : "");
rna_clamp_value(f, prop, 0);
}
}
@@ -899,28 +929,29 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
return func;
}
-static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
+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 +960,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);
@@ -959,57 +990,60 @@ static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA
return func;
}
-static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
+static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp,
+ const char *manualfunc)
{
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)
- 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);
+ 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);
+ 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, "\n if (iter->valid)\n");
fprintf(f, " iter->ptr= %s(iter);\n", getfunc);
fprintf(f, "}\n\n");
@@ -1018,31 +1052,32 @@ static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA *
return func;
}
-static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc, const char *nextfunc)
+static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp,
+ const char *manualfunc, const char *nextfunc)
{
/* note on indices, this is for external functions and ignores skipped values.
* 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;
@@ -1052,19 +1087,19 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
fprintf(f, " CollectionPropertyIterator iter;\n\n");
fprintf(f, " %s_%s_begin(&iter, ptr);\n\n", srna->identifier, rna_safe_id(prop->identifier));
- fprintf(f, " if(iter.valid){\n");
+ 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, " if (index < 0 || index >= internal->length) {\n");
fprintf(f, "#ifdef __GNUC__\n");
fprintf(f, " printf(\"Array iterator out of range: %%s (index %%d)\\n\", __func__, index);\n");
fprintf(f, "#else\n");
fprintf(f, " printf(\"Array iterator out of range: (index %%d)\\n\", index);\n");
fprintf(f, "#endif\n");
fprintf(f, " }\n");
- fprintf(f, " else if(internal->skip) {\n");
- fprintf(f, " while(index-- > 0 && iter.valid) {\n");
+ fprintf(f, " else if (internal->skip) {\n");
+ fprintf(f, " while (index-- > 0 && iter.valid) {\n");
fprintf(f, " rna_iterator_array_next(&iter);\n");
fprintf(f, " }\n");
fprintf(f, " found= (index == -1 && iter.valid);\n");
@@ -1074,22 +1109,22 @@ 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");
+ fprintf(f, " if (internal->skip) {\n");
+ fprintf(f, " while (index-- > 0 && iter.valid) {\n");
fprintf(f, " rna_iterator_listbase_next(&iter);\n");
fprintf(f, " }\n");
fprintf(f, " found= (index == -1 && iter.valid);\n");
fprintf(f, " }\n");
fprintf(f, " else {\n");
- fprintf(f, " while(index-- > 0 && internal->link)\n");
+ fprintf(f, " while (index-- > 0 && internal->link)\n");
fprintf(f, " internal->link= internal->link->next;\n");
fprintf(f, " found= (index == -1 && internal->link);\n");
fprintf(f, " }\n");
}
- fprintf(f, " if(found) *r_ptr = %s_%s_get(&iter);\n", srna->identifier, rna_safe_id(prop->identifier));
+ fprintf(f, " if (found) *r_ptr = %s_%s_get(&iter);\n", srna->identifier, rna_safe_id(prop->identifier));
fprintf(f, " }\n\n");
fprintf(f, " %s_%s_end(&iter);\n\n", srna->identifier, rna_safe_id(prop->identifier));
@@ -1097,17 +1132,20 @@ 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)
- 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);
+ 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);
+ 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)
- fprintf(f, "\n return rna_listbase_lookup_int(ptr, &RNA_%s, &data->%s, index);\n", item_type, dp->dnaname);
+ 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);
}
@@ -1118,25 +1156,26 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
return func;
}
-static char *rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
+static char *rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp,
+ const char *manualfunc)
{
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, "\n if (iter->valid)\n");
fprintf(f, " iter->ptr= %s(iter);\n", getfunc);
fprintf(f, "}\n\n");
@@ -1144,18 +1183,19 @@ static char *rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *p
return func;
}
-static char *rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
+static char *rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp,
+ const char *manualfunc)
{
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 +1204,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 +1242,133 @@ 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 +1380,90 @@ 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])
- fprintf(f, "\t%s_%s_%s = %d,\n", srna->identifier, prop->identifier, eprop->item[i].identifier, eprop->item[i].value);
+ 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,50 +1475,51 @@ 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])
- fprintf(f, "\t\t%s_%s = %d,\n", rna_safe_id(prop->identifier), eprop->item[i].identifier, eprop->item[i].value);
+ 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,21 +1532,23 @@ 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)
- fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (const char*)cprop->item_type, srna->identifier, rna_safe_id(prop->identifier));
+ 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));
+ fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier,
+ rna_safe_id(prop->identifier));
break;
}
}
@@ -1515,35 +1560,39 @@ 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)
- fprintf(f, "\tBOOLEAN_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
+ 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)
- fprintf(f, "\tINT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
+ 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)
- fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
+ else if (prop->totarraylength)
+ fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength,
+ rna_safe_id(prop->identifier));
break;
}
case PROP_ENUM: {
- fprintf(f, "\tENUM_PROPERTY(%s_enum, %s, %s)", rna_safe_id(prop->identifier), srna->identifier, rna_safe_id(prop->identifier));
+ fprintf(f, "\tENUM_PROPERTY(%s_enum, %s, %s)", rna_safe_id(prop->identifier), srna->identifier,
+ rna_safe_id(prop->identifier));
break;
}
@@ -1552,21 +1601,26 @@ 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)
- fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", (const char*)pprop->type, srna->identifier, rna_safe_id(prop->identifier));
+ 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));
+ 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);
+ 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 +1636,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,156 +1653,160 @@ 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= "*";
- /* PROP_THICK_WRAP strings are pre-allocated on the ParameterList stack, but type name for string props is already char*, so leave empty */
+ 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)
fprintf(f, "\tint %s%s_len;\n", pout ? "*" : "", dparm->prop->identifier);
- fprintf(f, "\t%s%s %s%s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, dparm->prop->identifier);
+ 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 */
+ /* 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);
if (!pout)
fprintf(f, "%s", valstr);
- fprintf(f, "((%s%s%s)%s);\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, data_str);
+ 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 +1816,18 @@ 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))? "*": "";
- 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);
+ 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 +1835,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 +1877,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 +1900,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 +1928,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 don't 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 +1941,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 +1959,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 +1970,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,19 +1986,21 @@ 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)
- fprintf(f, "%s%s rna_%s_%s;\n", "extern ", rna_property_structname(prop->type), base->identifier, prop->identifier);
- base= base->base;
+ 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;
}
- if(srna->cont.properties.first)
+ if (srna->cont.properties.first)
fprintf(f, "\n");
- 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);
+ 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 +2008,11 @@ static void rna_generate_parameter_prototypes(BlenderRNA *brna, StructRNA *srna,
{
PropertyRNA *parm;
- 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);
+ 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 +2021,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 +2052,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,74 +2070,76 @@ 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)
- fprintf(f, "%s%s %s[%u]", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier, dparm->prop->totarraylength);
+ 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);
+ fprintf(f, "%s%s %s%s", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop),
+ ptrstr, dparm->prop->identifier);
}
@@ -2085,15 +2150,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);
@@ -2103,45 +2168,46 @@ static void rna_generate_static_function_prototypes(BlenderRNA *brna, StructRNA
fprintf(f, "\n");
}
-static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, PropertyRNA *prop)
+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) {
- fprintf(f, "static EnumPropertyItem rna_%s%s_%s_items[%d] = {\n\t", srna->identifier, strnest, prop->identifier, eprop->totitem+1);
+ 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 +2215,43 @@ 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;
+ __func__, srna->identifier, errnest, prop->identifier,
+ eprop->defaultvalue & ~totflag);
+ 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) {
- fprintf(f, "static int rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, 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 +2260,19 @@ 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) {
- fprintf(f, "static int rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, 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 +2281,19 @@ 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) {
- fprintf(f, "static float rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, 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");
}
@@ -2235,11 +2305,14 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
break;
}
- fprintf(f, "%s%s rna_%s%s_%s = {\n", (prop->flag & PROP_EXPORT)? "": "", rna_property_structname(prop->type), srna->identifier, strnest, prop->identifier);
+ 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);
@@ -2248,42 +2321,73 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
rna_print_c_string(f, prop->description); fprintf(f, ",\n\t");
fprintf(f, "%d,\n", prop->icon);
rna_print_c_string(f, prop->translation_context); fprintf(f, ",\n\t");
- 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);
+ 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);
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;
- 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);
+ 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);
else fprintf(f, "NULL\n");
break;
}
case PROP_INT: {
- 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));
+ 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, ", ");
rna_int_print(f, iprop->hardmin); fprintf(f, ", ");
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;
- 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));
+ 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, ", ");
rna_float_print(f, fprop->hardmin); fprintf(f, ", ");
@@ -2291,20 +2395,28 @@ 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;
- fprintf(f, "\t%s, %s, %s, %d, ", rna_function_string(sprop->get), rna_function_string(sprop->length), rna_function_string(sprop->set), sprop->maxlength);
+ 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;
- 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)
+ 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)
fprintf(f, "rna_%s%s_%s_items, ", srna->identifier, strnest, prop->identifier);
else
fprintf(f, "NULL, ");
@@ -2312,16 +2424,27 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
break;
}
case PROP_POINTER: {
- 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);
+ 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);
else fprintf(f, "NULL\n");
break;
}
case PROP_COLLECTION: {
- 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);
+ 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);
else fprintf(f, "NULL\n");
break;
}
@@ -2329,7 +2452,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 +2467,34 @@ 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);
- else fprintf(f, "\t{NULL, ");
- if(func->cont.prev) fprintf(f, "(FunctionRNA*)&rna_%s_%s_func,\n", srna->identifier, ((FunctionRNA*)func->cont.prev)->identifier);
- else fprintf(f, "NULL,\n");
+ 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);
+ 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,12 +2502,14 @@ 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);
- 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);
+ else
+ fprintf(f, "\tNULL\n");
fprintf(f, "};\n");
fprintf(f, "\n");
@@ -2386,19 +2517,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);
@@ -2407,28 +2538,30 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
rna_print_c_string(f, srna->name);
fprintf(f, ", ");
rna_print_c_string(f, srna->description);
+ fprintf(f, ", ");
+ rna_print_c_string(f, srna->translation_context);
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 +2571,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 +2596,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},
@@ -2520,7 +2653,7 @@ static RNAProcessItem PROCESS_ITEMS[]= {
{"rna_userdef.c", NULL, RNA_def_userdef},
{"rna_vfont.c", NULL, RNA_def_vfont},
{"rna_wm.c", "rna_wm_api.c", RNA_def_wm},
- {"rna_world.c", NULL, RNA_def_world},
+ {"rna_world.c", NULL, RNA_def_world},
{"rna_movieclip.c", NULL, RNA_def_movieclip},
{"rna_tracking.c", NULL, RNA_def_tracking},
{NULL, NULL}};
@@ -2531,9 +2664,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");
@@ -2559,38 +2694,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");
@@ -2608,8 +2743,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");
@@ -2618,7 +2754,8 @@ static void rna_generate_header(BlenderRNA *brna, FILE *f)
fprintf(f, "#define FOREACH_BEGIN(property, sptr, itemptr) \\\n");
fprintf(f, " { \\\n");
fprintf(f, " CollectionPropertyIterator rna_macro_iter; \\\n");
- fprintf(f, " for(property##_begin(&rna_macro_iter, sptr); rna_macro_iter.valid; property##_next(&rna_macro_iter)) { \\\n");
+ fprintf(f, " for (property##_begin(&rna_macro_iter, sptr); rna_macro_iter.valid; "
+ "property##_next(&rna_macro_iter)) { \\\n");
fprintf(f, " itemptr= rna_macro_iter.ptr;\n\n");
fprintf(f, "#define FOREACH_END(property) \\\n");
@@ -2626,18 +2763,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);
}
@@ -2711,7 +2848,8 @@ static const char *cpp_classes = ""
"\n"
" Array() {}\n"
" Array(const Array<T, Tsize>& other) { memcpy(data, other.data, sizeof(T)*Tsize); }\n"
-" const Array<T, Tsize>& operator=(const Array<T, Tsize>& other) { memcpy(data, other.data, sizeof(T)*Tsize); return *this; }\n"
+" const Array<T, Tsize>& operator=(const Array<T, Tsize>& other) { memcpy(data, other.data, sizeof(T)*Tsize); "
+"return *this; }\n"
"\n"
" operator T*() { return data; }\n"
"};\n"
@@ -2724,7 +2862,7 @@ static const char *cpp_classes = ""
"class CollectionIterator {\n"
"public:\n"
" CollectionIterator() : t(iter.ptr), init(false) { iter.valid= false; }\n"
-" ~CollectionIterator(void) { if(init) Tend(&iter); };\n"
+" ~CollectionIterator(void) { if (init) Tend(&iter); };\n"
"\n"
" operator bool(void)\n"
" { return iter.valid != 0; }\n"
@@ -2732,14 +2870,17 @@ static const char *cpp_classes = ""
"\n"
" T& operator*(void) { return t; }\n"
" T* operator->(void) { return &t; }\n"
-" bool operator==(const CollectionIterator<T, Tbegin, Tnext, Tend>& other) { return iter.valid == other.iter.valid; }\n"
-" bool operator!=(const CollectionIterator<T, Tbegin, Tnext, Tend>& other) { return iter.valid != other.iter.valid; }\n"
+" bool operator==(const CollectionIterator<T, Tbegin, Tnext, Tend>& other) "
+"{ return iter.valid == other.iter.valid; }\n"
+" bool operator!=(const CollectionIterator<T, Tbegin, Tnext, Tend>& other) "
+"{ return iter.valid != other.iter.valid; }\n"
"\n"
" void begin(const Pointer& ptr)\n"
-" { if(init) Tend(&iter); Tbegin(&iter, (PointerRNA*)&ptr.ptr); t = T(iter.ptr); init = true; }\n"
+" { if (init) Tend(&iter); Tbegin(&iter, (PointerRNA*)&ptr.ptr); t = T(iter.ptr); init = true; }\n"
"\n"
"private:\n"
-" const CollectionIterator<T, Tbegin, Tnext, Tend>& operator=(const CollectionIterator<T, Tbegin, Tnext, Tend>& copy) {}\n"
+" const CollectionIterator<T, Tbegin, Tnext, Tend>& operator="
+"(const CollectionIterator<T, Tbegin, Tnext, Tend>& copy) {}\n"
""
" CollectionPropertyIterator iter;\n"
" T t;\n"
@@ -2770,8 +2911,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");
@@ -2781,25 +2923,26 @@ 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)
+ 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)
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");
}
@@ -2807,8 +2950,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");
@@ -2819,7 +2962,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);
}
@@ -2834,15 +2977,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;
}
}
@@ -2853,22 +2996,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);
}
}
@@ -2877,33 +3020,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);
}
@@ -2912,20 +3055,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);
}
}
@@ -2948,18 +3091,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 de0cd6d9c59..6992d992cca 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -40,7 +40,7 @@
#include "rna_internal.h"
-/* enum of ID-block types
+/* enum of ID-block types
* NOTE: need to keep this in line with the other defines for these
*/
EnumPropertyItem id_type_items[] = {
@@ -84,30 +84,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;
}
@@ -116,41 +116,41 @@ 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_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_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;
@@ -185,7 +185,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));
}
@@ -197,13 +197,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);
}
@@ -219,7 +219,9 @@ void rna_PropertyGroup_unregister(Main *UNUSED(bmain), StructRNA *type)
RNA_struct_free(&BLENDER_RNA, type);
}
-StructRNA *rna_PropertyGroup_register(Main *UNUSED(bmain), ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc UNUSED(call), StructFreeFunc UNUSED(free))
+StructRNA *rna_PropertyGroup_register(Main *UNUSED(bmain), ReportList *reports, void *data, const char *identifier,
+ StructValidateFunc validate, StructCallbackFunc UNUSED(call),
+ StructFreeFunc UNUSED(free))
{
PointerRNA dummyptr;
@@ -227,19 +229,20 @@ 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) {
- BKE_reportf(reports, RPT_ERROR, "registering id property class: '%s' is too long, maximum length is " STRINGIFY(MAX_IDPROP_NAME), identifier);
+ 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)
@@ -251,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;
}
@@ -262,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(flag & ~(OB_RECALC_ALL|PSYS_RECALC)) {
+#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;
@@ -298,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; /* don't 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;
}
@@ -330,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);
}
@@ -343,56 +350,57 @@ 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_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");
@@ -404,7 +412,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");
@@ -412,11 +420,11 @@ static void rna_def_ID_properties(BlenderRNA *brna)
RNA_def_struct_refine_func(srna, "rna_PropertyGroup_refine");
/* 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
+ * however this isn't 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);
}
@@ -429,21 +437,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);
}
@@ -459,13 +467,15 @@ 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);
- RNA_def_struct_ui_text(srna, "ID", "Base type for datablocks, defining a unique name, linking from other libraries and garbage collection");
+ 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);
@@ -473,55 +483,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");
@@ -532,29 +542,29 @@ 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", "");
+ RNA_def_property_ui_text(prop, "Parent", "");
}
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);
@@ -564,4 +574,3 @@ void RNA_def_ID(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 0df8a625caf..d5363b33fe9 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,51 +456,37 @@ 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);
-#endif
-
- return description;
+ return TIP_(description);
}
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;
-
-#ifdef WITH_INTERNATIONAL
- if(BLF_translate_iface()) {
- if(prop->translation_context)
- name = BLF_pgettext(prop->translation_context, name);
- else
- name = BLF_gettext(name);
- }
-#endif
+ name = ((IDProperty*)prop)->name;
- return name;
+ return CTX_IFACE_(prop->translation_context, name);
}
/* Structs */
@@ -510,7 +496,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;
@@ -523,12 +509,12 @@ const char *RNA_struct_identifier(StructRNA *type)
const char *RNA_struct_ui_name(StructRNA *type)
{
- return type->name;
+ return CTX_IFACE_(type->translation_context, type->name);
}
int RNA_struct_ui_icon(StructRNA *type)
{
- if(type)
+ if (type)
return type->icon;
else
return ICON_DOT;
@@ -536,7 +522,7 @@ int RNA_struct_ui_icon(StructRNA *type)
const char *RNA_struct_ui_description(StructRNA *type)
{
- return type->description;
+ return TIP_(type->description);
}
PropertyRNA *RNA_struct_name_property(StructRNA *type)
@@ -572,11 +558,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 +577,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 +590,20 @@ 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 +613,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 +633,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 +665,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 +680,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 +709,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 +735,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 +745,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 +808,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 +828,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 +851,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 +867,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 +900,157 @@ 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);
+ int softmin, softmax;
- 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) {
- iprop->range(ptr, hardmin, hardmax);
+ if (iprop->range) {
+ *hardmin = INT_MIN;
+ *hardmax = INT_MAX;
+
+ iprop->range(ptr, hardmin, hardmax, &softmin, &softmax);
}
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) {
- iprop->range(ptr, &hardmin, &hardmax);
- *softmin= MAX2(iprop->softmin, hardmin);
- *softmax= MIN2(iprop->softmax, hardmax);
- }
- else {
- *softmin= iprop->softmin;
- *softmax= iprop->softmax;
+ *softmin = iprop->softmin;
+ *softmax = iprop->softmax;
+
+ if (iprop->range) {
+ hardmin = INT_MIN;
+ hardmax = INT_MAX;
+
+ iprop->range(ptr, &hardmin, &hardmax, softmin, softmax);
+
+ *softmin = MAX2(*softmin, hardmin);
+ *softmax = MIN2(*softmax, hardmax);
}
- *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);
+ float softmin, softmax;
- 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) {
- fprop->range(ptr, hardmin, hardmax);
+ if (fprop->range) {
+ *hardmin = -FLT_MAX;
+ *hardmax = FLT_MAX;
+
+ fprop->range(ptr, hardmin, hardmax, &softmin, &softmax);
}
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)
+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) {
- fprop->range(ptr, &hardmin, &hardmax);
- *softmin= MAX2(fprop->softmin, hardmin);
- *softmax= MIN2(fprop->softmax, hardmax);
- }
- else {
- *softmin= fprop->softmin;
- *softmax= fprop->softmax;
+ *softmin = fprop->softmin;
+ *softmax = fprop->softmax;
+
+ if (fprop->range) {
+ hardmin = -FLT_MAX;
+ hardmax = FLT_MAX;
+
+ fprop->range(ptr, &hardmin, &hardmax, softmin, softmax);
+
+ *softmin = MAX2(*softmin, hardmin);
+ *softmax = MIN2(*softmax, hardmax);
}
- *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 +1059,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 +1078,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 +1095,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 +1124,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;
@@ -1147,102 +1149,106 @@ EnumPropertyItem DummyRNA_DEFAULT_items[] = {
{0, NULL, 0, NULL, NULL}
};
-void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free)
+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;
}
}
-void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free)
+void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop,
+ EnumPropertyItem **item, int *totitem, int *free)
{
RNA_property_enum_items(C, ptr, prop, item, totitem, free);
#ifdef WITH_INTERNATIONAL
- if(BLF_translate_iface()) {
+ /* Note: keep directly using BLF_gettext here, has we have already done tests like BLF_translate_iface... */
+ if (BLF_translate_iface()) {
int i;
EnumPropertyItem *nitem;
- if(*free) {
- nitem= *item;
- } else {
- int totitem= 0;
+ if (*free) {
+ nitem = *item;
+ }
+ else {
+ 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 +1256,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 +1266,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 +1290,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;
}
@@ -1292,15 +1298,16 @@ int RNA_enum_description(EnumPropertyItem *item, const int value, const char **d
return 0;
}
-int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
-{
- EnumPropertyItem *item= NULL;
+int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value,
+ const char **identifier)
+{
+ 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 +1316,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;
@@ -1324,15 +1331,16 @@ int RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, cons
return 0;
}
-int RNA_property_enum_bitflag_identifiers(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
+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 +1365,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 +1377,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 +1388,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 +1409,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);
@@ -1418,20 +1426,24 @@ int RNA_property_animated(PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop))
/* this function is to check if its possible to create a valid path from the ID
- * its slow so dont call in a loop */
+ * its slow so don't 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);
+ if (RNA_path_resolve(&id_ptr, path, &r_ptr, &r_prop) == TRUE) {
+ ret = (prop == r_prop);
+ }
+ else {
+ ret = FALSE;
+ }
MEM_freeN(path);
}
@@ -1442,15 +1454,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 +1473,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);
@@ -1475,7 +1487,7 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR
/* must keep in sync with 'rna_property_update'
* note, its possible this returns a false positive in the case of PROP_CONTEXT_UPDATE
- * but this isnt likely to be a performance problem. */
+ * but this isn't likely to be a performance problem. */
int RNA_property_update_check(PropertyRNA *prop)
{
return (prop->magic != RNA_MAGIC || prop->update || prop->noteflag);
@@ -1530,7 +1542,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 +1580,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 +1614,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 +1630,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 +1684,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 +1707,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 +1744,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 +1767,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 +1777,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 +1793,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 +1816,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 +1832,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 +1840,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 +1884,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 +1922,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 +1945,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 +1982,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 +2005,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 +2027,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 +2047,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 +2067,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 +2075,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 +2130,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 +2168,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 +2192,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 +2240,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 +2263,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 +2273,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 +2289,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 +2312,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 +2344,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 +2363,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 +2372,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 +2389,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 +2397,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 +2434,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 +2449,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 +2458,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 +2473,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 +2508,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 +2517,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 +2548,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 +2566,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 +2579,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 +2602,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 +2617,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 +2632,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 +2668,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 +2678,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 +2705,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 +2748,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 +2764,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 +2788,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 +2815,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 +2833,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 +2845,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 +2872,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 +2886,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 +2903,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 +2916,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 +2951,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 +2967,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 +2979,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 +3010,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 +3022,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 +3034,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);
@@ -3032,64 +3044,66 @@ int RNA_raw_type_sizeof(RawPropertyType type)
}
}
-static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname, void *inarray, RawPropertyType intype, int inlen, int set)
+static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname,
+ void *inarray, RawPropertyType intype, int inlen, int set)
{
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) {
- BKE_reportf(reports, RPT_ERROR, "Array length mismatch (expected %d, got %d)", out.len*arraylen, in.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 +3115,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 +3128,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 +3189,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 +3213,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 +3248,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 +3273,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 +3295,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 +3321,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
}
RNA_PROP_END;
- if(tmparray)
+ if (tmparray)
MEM_freeN(tmparray);
return !err;
@@ -3334,12 +3348,14 @@ RawPropertyType RNA_property_raw_type(PropertyRNA *prop)
return prop->rawtype;
}
-int RNA_property_collection_raw_get(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname, void *array, RawPropertyType type, int len)
+int RNA_property_collection_raw_get(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname,
+ void *array, RawPropertyType type, int len)
{
return rna_raw_access(reports, ptr, prop, propname, array, type, len, 0);
}
-int RNA_property_collection_raw_set(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname, void *array, RawPropertyType type, int len)
+int RNA_property_collection_raw_set(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname,
+ void *array, RawPropertyType type, int len)
{
return rna_raw_access(reports, ptr, prop, propname, array, type, len, 1);
}
@@ -3350,36 +3366,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,67 +3403,68 @@ 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);
}
-void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, int free_ptr, IteratorSkipFunc skip)
+void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length,
+ int free_ptr, IteratorSkipFunc skip)
{
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 +3472,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 +3496,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 +3536,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 +3606,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 +3689,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 +3705,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 +3744,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 +3798,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 +3837,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 +3850,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 +3902,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 +3945,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 +3953,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;
}
}
@@ -3999,12 +4016,13 @@ static char *rna_path_from_ID_to_idpgroup(PointerRNA *ptr)
BLI_assert(ptr->id.data != NULL);
/* TODO, Support Bones/PoseBones. no pointers stored to the bones from here, only the ID. See example in [#25746]
- * unless this is added only way to find this is to also search all bones and pose bones of an armature or object */
+ * 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,30 +4032,30 @@ 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;
- /* find the property in the struct we're nested in that references this struct, and
+ /* find the property in the struct we're nested in that references this struct, and
* 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 +4074,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 +4100,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 +4113,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 +4123,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 +4133,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 +4143,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 +4156,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 +4166,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 +4176,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 +4186,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 +4199,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 +4209,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 +4219,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 +4229,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 +4242,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 +4252,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 +4268,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 +4293,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 +4305,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 +4317,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 +4329,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 +4355,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 +4368,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 +4378,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 +4392,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 +4404,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 +4414,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 +4424,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 +4434,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 +4444,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 +4457,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 +4468,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 +4482,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 +4490,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 +4501,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);
@@ -4496,7 +4514,7 @@ char *RNA_pointer_as_string(bContext *C, PointerRNA *ptr)
}
RNA_STRUCT_END;
- BLI_dynstr_append(dynstr, "}");
+ BLI_dynstr_append(dynstr, "}");
cstring = BLI_dynstr_get_cstring(dynstr);
@@ -4504,56 +4522,169 @@ char *RNA_pointer_as_string(bContext *C, PointerRNA *ptr)
return cstring;
}
+
+/* context and ptr_default can be NULL */
+char *RNA_pointer_as_string_keywords_ex(bContext *C, PointerRNA *ptr, PointerRNA *ptr_default,
+ const short as_function, const short all_args,
+ PropertyRNA *iterprop)
+{
+ const char *arg_name = NULL;
+
+ PropertyRNA *prop;
+
+ DynStr *dynstr= BLI_dynstr_new();
+ char *cstring, *buf;
+ int first_iter = TRUE, ok = TRUE;
+ int flag;
+
+ /* only to get the orginal props for comparisons */
+ PropertyRNA *prop_default;
+ char *buf_default;
+
+ RNA_PROP_BEGIN(ptr, propptr, iterprop) {
+ prop = propptr.data;
+
+ flag = RNA_property_flag(prop);
+
+ if (as_function && (flag & PROP_OUTPUT)) {
+ continue;
+ }
+
+ arg_name = RNA_property_identifier(prop);
+
+ if (strcmp(arg_name, "rna_type") == 0) {
+ continue;
+ }
+
+ if (as_function && (flag & PROP_REQUIRED)) {
+ /* required args don't have useful defaults */
+ BLI_dynstr_appendf(dynstr, first_iter ? "%s":", %s", arg_name);
+ first_iter = FALSE;
+ }
+ else {
+ if (as_function && RNA_property_type(prop) == PROP_POINTER) {
+ /* don't expand pointers for functions */
+ if (flag & PROP_NEVER_NULL) {
+ /* we cant really do the right thing here. arg=arg?, hrmf! */
+ buf = BLI_strdup(arg_name);
+ }
+ else {
+ buf = BLI_strdup("None");
+ }
+ }
+ else {
+ buf = RNA_property_as_string(C, ptr, prop);
+ }
+
+ ok = TRUE;
+
+ if (all_args == FALSE && ptr_default) {
+ /* not verbose, so only add in attributes that use non-default values
+ * slow but good for tooltips */
+ prop_default= RNA_struct_find_property(ptr_default, arg_name);
+
+ if (prop_default) {
+ buf_default= RNA_property_as_string(C, ptr_default, prop_default);
+
+ if (strcmp(buf, buf_default) == 0)
+ ok = FALSE; /* values match, don't bother printing */
+
+ MEM_freeN(buf_default);
+ }
+ }
+ if (ok) {
+ BLI_dynstr_appendf(dynstr, first_iter ? "%s=%s":", %s=%s", arg_name, buf);
+ first_iter = FALSE;
+ }
+
+ MEM_freeN(buf);
+ }
+ }
+ RNA_PROP_END;
+
+ cstring = BLI_dynstr_get_cstring(dynstr);
+ BLI_dynstr_free(dynstr);
+ return cstring;
+}
+
+char *RNA_pointer_as_string_keywords(bContext *C, PointerRNA *ptr, PointerRNA *ptr_default,
+ const short as_function, const short all_args)
+{
+ PropertyRNA *iterprop;
+
+ iterprop = RNA_struct_iterator_property(ptr->type);
+
+ return RNA_pointer_as_string_keywords_ex(C, ptr, ptr_default, as_function, all_args,
+ iterprop);
+}
+
+char *RNA_function_as_string_keywords(bContext *C, FunctionRNA *func, PointerRNA *ptr_default,
+ const short as_function, const short all_args)
+{
+ PointerRNA funcptr;
+ PropertyRNA *iterprop;
+
+ RNA_pointer_create(NULL, &RNA_Function, func, &funcptr);
+
+ iterprop = RNA_struct_find_property(&funcptr, "parameters");
+
+ RNA_struct_iterator_property(funcptr.type);
+
+ return RNA_pointer_as_string_keywords_ex(C, &funcptr, ptr_default, as_function, all_args,
+ iterprop);
+}
+
char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
{
int type = RNA_property_type(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++) {
- BLI_dynstr_appendf(dynstr, i?", %s":"%s", RNA_property_boolean_get_index(ptr, prop, i) ? "True" : "False");
+ 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 +4695,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);
@@ -4576,35 +4707,41 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
}
case PROP_ENUM:
{
- /* string arrays dont exist */
+ /* string arrays don't exist */
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;
- int free;
-
- BLI_dynstr_append(dynstr, "{");
-
- RNA_property_enum_items(C, ptr, prop, &item, NULL, &free);
- if(item) {
- short is_first= TRUE;
- for (; item->identifier; item++) {
- if(item->identifier[0] && item->value & val) {
- BLI_dynstr_appendf(dynstr, is_first ? "'%s'" : ", '%s'", item->identifier);
- is_first= FALSE;
+ if (val) {
+ 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;
+ for (; item->identifier; item++) {
+ if (item->identifier[0] && item->value & val) {
+ BLI_dynstr_appendf(dynstr, is_first ? "'%s'" : ", '%s'", item->identifier);
+ is_first = FALSE;
+ }
}
- }
- if(free) {
- MEM_freeN(item);
+ if (free) {
+ MEM_freeN(item);
+ }
}
- }
- BLI_dynstr_append(dynstr, "}");
+ BLI_dynstr_append(dynstr, "}");
+ }
+ else {
+ /* annoying exception, don't confuse with dictionary syntax above: {} */
+ BLI_dynstr_append(dynstr, "set()");
+ }
}
- 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 +4751,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 +4763,16 @@ 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 +4834,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 +4902,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 +4913,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 +4953,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 +4987,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 +5003,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 +5018,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 +5032,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 +5066,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 +5083,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;
@@ -4959,45 +5097,48 @@ int RNA_function_call(bContext *C, ReportList *reports, PointerRNA *ptr, Functio
return -1;
}
-int RNA_function_call_lookup(bContext *C, ReportList *reports, PointerRNA *ptr, const char *identifier, ParameterList *parms)
+int RNA_function_call_lookup(bContext *C, ReportList *reports, PointerRNA *ptr, const char *identifier,
+ ParameterList *parms)
{
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;
}
-int RNA_function_call_direct(bContext *C, ReportList *reports, PointerRNA *ptr, FunctionRNA *func, const char *format, ...)
+int RNA_function_call_direct(bContext *C, ReportList *reports, PointerRNA *ptr, FunctionRNA *func,
+ const char *format, ...)
{
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);
return ret;
}
-int RNA_function_call_direct_lookup(bContext *C, ReportList *reports, PointerRNA *ptr, const char *identifier, const char *format, ...)
+int RNA_function_call_direct_lookup(bContext *C, ReportList *reports, PointerRNA *ptr, const char *identifier,
+ const char *format, ...)
{
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 +5151,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 +5175,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 +5189,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 +5203,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 +5217,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 +5241,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 +5271,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 +5288,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);
@@ -5169,45 +5310,46 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop
return 0;
}
-int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *ptr, FunctionRNA *func, const char *format, va_list args)
+int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *ptr, FunctionRNA *func,
+ const char *format, va_list args)
{
PointerRNA funcptr;
ParameterList parms;
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 +5357,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 +5376,68 @@ 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 +5448,46 @@ 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 +5505,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 +5518,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 +5533,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 +5553,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 +5573,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 +5599,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 +5615,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 +5626,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 +5634,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 +5654,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 +5674,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 82a7d276817..1159a1ba20e 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,13 @@ 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)
+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");
@@ -104,7 +105,8 @@ static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, const ch
/* annoying, check if this exists */
if (verify_fcurve(act, group, data_path, index, 0)) {
- BKE_reportf(reports, RPT_ERROR, "F-Curve '%s[%d]' already exists in action '%s'", data_path, index, act->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "F-Curve '%s[%d]' already exists in action '%s'", data_path,
+ index, act->id.name+2);
return NULL;
}
return verify_fcurve(act, group, data_path, index, 1);
@@ -114,7 +116,8 @@ static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, FCurve *
{
if (fcu->grp) {
if (BLI_findindex(&act->groups, fcu->grp) == -1) {
- BKE_reportf(reports, RPT_ERROR, "F-Curve's ActionGroup '%s' not found in action '%s'", fcu->grp->name, act->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "F-Curve's ActionGroup '%s' not found in action '%s'",
+ fcu->grp->name, act->id.name+2);
return;
}
@@ -135,8 +138,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 +158,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)
+static void rna_Action_active_pose_marker_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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);
}
@@ -202,7 +205,7 @@ int rna_Action_id_poll(PointerRNA *ptr, PointerRNA value)
bAction *act = (bAction *)value.id.data;
if (act) {
- /* there can still be actions that will have undefined id-root
+ /* there can still be actions that will have undefined id-root
* (i.e. floating "action-library" members) which we will not
* be able to resolve an idroot for automatically, so let these through
*/
@@ -222,7 +225,7 @@ int rna_Action_actedit_assign_poll(PointerRNA *ptr, PointerRNA value)
bAction *act = (bAction *)value.id.data;
if (act) {
- /* there can still be actions that will have undefined id-root
+ /* there can still be actions that will have undefined id-root
* (i.e. floating "action-library" members) which we will not
* be able to resolve an idroot for automatically, so let these through
*/
@@ -251,173 +254,181 @@ 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)");
+ 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_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_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_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_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_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_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_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_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);
@@ -429,11 +440,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);
@@ -442,34 +453,34 @@ static void rna_def_action_group(BlenderRNA *brna)
* defined like a standard ListBase. Adding/removing channels from this list needs
* extreme care, otherwise the F-Curve list running through adjacent groups does
* not match up with the one stored in the Action, resulting in curves which do not
- * show up in animation editors. In extreme cases, animation may also selectively
- * fail to play back correctly.
+ * show up in animation editors. In extreme cases, animation may also selectively
+ * fail to play back correctly.
*
* 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);
@@ -484,23 +495,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);
}
@@ -512,26 +523,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);
}
@@ -544,33 +555,35 @@ 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_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_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");
}
@@ -579,40 +592,44 @@ 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);
+ /* 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);
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");
+ 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");
/* API calls */
RNA_api_action(srna);
diff --git a/source/blender/makesrna/intern/rna_action_api.c b/source/blender/makesrna/intern/rna_action_api.c
index 07c42cf0d20..7e95aaab31b 100644
--- a/source/blender/makesrna/intern/rna_action_api.c
+++ b/source/blender/makesrna/intern/rna_action_api.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): Arystanbek Dyussenov
*
* ***** END GPL LICENSE BLOCK *****
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index 6098e885df5..c24b78a155c 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,11 +341,13 @@ 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
+ }
+ else {
aa->flag &= ~ACT_IPOADD;
+ }
}
static void rna_ActionActuator_force_set(struct PointerRNA *ptr, int value)
@@ -353,19 +355,20 @@ 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
+ }
+ else {
aa->flag &= ~ACT_IPOFORCE;
+ }
}
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 +403,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,19 +422,20 @@ 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 {
+ }
+ else {
/* can't use ob from ptr->id.data because that enum is also used by operators */
ob = CTX_data_active_object(C);
}
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 +459,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 +504,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 +534,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 +569,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 +581,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 +600,87 @@ 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_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_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_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_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_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 +693,132 @@ 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_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_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_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 +826,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 +882,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 +901,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 +924,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 +936,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 +946,86 @@ 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_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 +1036,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 +1044,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 +1083,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 +1091,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 +1099,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 +1110,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 +1118,182 @@ 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);
- RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_limitmin_get", "rna_ConstraintActuator_limitmin_set", NULL);
+ 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);
- RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_limitmax_get", "rna_ConstraintActuator_limitmax_set", NULL);
+ 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);
- RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_distance_get", "rna_ConstraintActuator_distance_set", NULL);
+ 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_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_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);
- RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_fhheight_get", "rna_ConstraintActuator_fhheight_set", NULL);
+ 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_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 +1304,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 +1312,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,64 +1320,65 @@ 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);
- RNA_def_property_ui_text(prop, "Mesh", "Replace the existing, when left blank 'Phys' will remake the existing physics mesh");
+ RNA_def_property_ui_text(prop, "Mesh",
+ "Replace the existing, when left blank 'Phys' will remake the existing physics mesh");
/* note: custom set function is ONLY to avoid rna setting a user for this. */
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 +1386,28 @@ 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_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 +1418,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", ""},
@@ -1397,26 +1427,26 @@ static void rna_def_scene_actuator(BlenderRNA *brna)
{ACT_SCENE_REMOVE, "REMOVE", 0, "Remove Scene", ""},
{ACT_SCENE_SUSPEND, "SUSPEND", 0, "Suspend Scene", ""},
{ACT_SCENE_RESUME, "RESUME", 0, "Resume Scene", ""},
- {0, NULL, 0, NULL, NULL}};
+ {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 +1474,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", ""},
@@ -1455,24 +1485,26 @@ static void rna_def_random_actuator(BlenderRNA *brna)
{ACT_RANDOM_FLOAT_UNIFORM, "FLOAT_UNIFORM", 0, "Float Uniform", ""},
{ACT_RANDOM_FLOAT_NORMAL, "FLOAT_NORMAL", 0, "Float Normal", ""},
{ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL, "FLOAT_NEGATIVE_EXPONENTIAL", 0, "Float Neg. Exp.", ""},
- {0, NULL, 0, NULL, NULL}};
+ {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_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 +1513,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 +1601,38 @@ 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_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 +1643,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 +1656,23 @@ 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);
- RNA_def_property_ui_text(prop, "File", "Load this blend file, use the \"//\" prefix for a path relative to the current blend file");
+ 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,23 +1680,28 @@ 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_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_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_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 +1710,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 +1726,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 +1770,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 +1793,14 @@ 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_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 +1811,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 +1823,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 +1842,49 @@ 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_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_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 +1897,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 +1926,61 @@ 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_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 +1988,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 +2003,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 +2068,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);
@@ -2056,4 +2110,3 @@ void RNA_def_actuator(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_actuator_api.c b/source/blender/makesrna/intern/rna_actuator_api.c
index dd289c2b8c4..68b2c4f8b52 100644
--- a/source/blender/makesrna/intern/rna_actuator_api.c
+++ b/source/blender/makesrna/intern/rna_actuator_api.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) 2010 Blender Foundation.
* All rights reserved.
*
- *
+ *
* Contributor(s):
*
* ***** END GPL LICENSE BLOCK *****
@@ -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..94ea79099c2 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;
@@ -178,7 +178,8 @@ static void rna_KeyingSetInfo_unregister(Main *bmain, StructRNA *type)
ANIM_keyingset_info_unregister(bmain, ksi);
}
-static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
+static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, void *data, const char *identifier,
+ StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
KeyingSetInfo dummyksi = {NULL};
KeyingSetInfo *ksi;
@@ -186,7 +187,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 +195,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 +206,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 +233,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 +275,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,52 +298,52 @@ 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)
+static void rna_KeyingSet_active_ksPath_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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);
}
-static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset, ReportList *reports,
+static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset, ReportList *reports,
ID *id, const char rna_path[], int index, int group_method, const char group_name[])
{
KS_Path *ksp = NULL;
@@ -355,8 +357,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 +376,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 +391,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 +423,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 +447,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;
}
@@ -459,12 +461,16 @@ static void rna_def_common_keying_flags(StructRNA *srna, short reg)
PropertyRNA *prop;
static EnumPropertyItem keying_flag_items[] = {
- {INSERTKEY_NEEDED, "INSERTKEY_NEEDED", 0, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves"},
- {INSERTKEY_MATRIX, "INSERTKEY_VISUAL", 0, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'"},
- {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"},
+ {INSERTKEY_NEEDED, "INSERTKEY_NEEDED", 0, "Insert Keyframes - Only Needed",
+ "Only insert keyframes where they're needed in the relevant F-Curves"},
+ {INSERTKEY_MATRIX, "INSERTKEY_VISUAL", 0, "Insert Keyframes - Visual",
+ "Insert keyframes based on 'visual transforms'"},
+ {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 +479,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 +493,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 +501,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 +559,61 @@ 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_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 */
- 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);
- RNA_def_property_string_funcs(prop, "rna_ksPath_RnaPath_get", "rna_ksPath_RnaPath_length", "rna_ksPath_RnaPath_set");
+ 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_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 */
/* Keyframing Settings */
rna_def_common_keying_flags(srna, 0);
@@ -607,23 +631,24 @@ 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
+ /* XXX hopefully this is long enough */
+ parm = RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property");
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,29 +662,31 @@ 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_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_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,34 +695,49 @@ 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)");
+ RNA_def_property_ui_text(prop, "Absolute",
+ "Keying Set defines specific paths/settings to be keyframed "
+ "(i.e. is not reliant on context info)");
/* Keyframing Flags */
rna_def_common_keying_flags(srna, 0);
@@ -705,6 +747,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 +759,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 +777,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 +792,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,10 +812,10 @@ 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");
+ RNA_def_property_ui_text(prop, "Animation Data", "Animation data for this datablock");
}
void rna_def_animdata(BlenderRNA *brna)
@@ -780,11 +823,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,35 +835,39 @@ 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);
- RNA_def_property_flag(prop, PROP_EDITABLE); /* this flag as well as the dynamic test must be defined for this to be editable... */
+ prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
+ /* this flag as well as the dynamic test must be defined for this to be editable... */
+ RNA_def_property_flag(prop, PROP_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");
RNA_def_property_ui_text(prop, "Action", "Active Action for this datablock");
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_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_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);
- RNA_def_property_ui_text(prop, "Action Influence", "Amount the Active Action contributes to the result of the NLA stack");
+ RNA_def_property_ui_text(prop, "Action Influence",
+ "Amount the Active Action contributes to the result of the NLA stack");
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 +875,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..c3c4a1355fd 100644
--- a/source/blender/makesrna/intern/rna_animation_api.c
+++ b/source/blender/makesrna/intern/rna_animation_api.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): Joshua Leung
*
* ***** END GPL LICENSE BLOCK *****
@@ -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,13 +70,14 @@ 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");
- 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");
+ 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);
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c
index 29133db8101..f7065307d87 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,9 +90,9 @@ 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");
+ RNA_def_property_ui_text(prop, "Motion Path", "Motion Path for this element");
}
static void rna_def_animviz_motionpath_vert(BlenderRNA *brna)
@@ -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,39 @@ 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_ui_text(prop, "Use Bone Heads", "For PoseBone paths, use the bone head location when calculating this path");
+ 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,54 +170,64 @@ 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_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_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_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_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_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)");
+ 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)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
}
@@ -225,85 +236,97 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- 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"},
+ 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_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)");
+ RNA_def_property_ui_text(prop, "Frame Step",
+ "Number of frames between paths 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, "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_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_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_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)");
+ 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)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
}
@@ -313,10 +336,10 @@ 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");
+ RNA_def_property_ui_text(prop, "Animation Visualisation", "Animation data for this datablock");
}
static void rna_def_animviz(BlenderRNA *brna)
@@ -324,19 +347,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..208d69f82b8 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, (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);
+ }
}
-// 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,177 @@ 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_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);
+ /* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */
+ /*RNA_def_property_range(prop, 0, 1000); */
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);
+ /* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */
+ /*RNA_def_property_range(prop, 0, 1000); */
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 +581,78 @@ 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_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 +666,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 +704,45 @@ 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
+ /* TODO - this could be made writable also */
+ RNA_def_property_float_funcs(prop, "rna_EditBone_matrix_get", NULL, NULL);
RNA_api_armature_edit_bone(srna);
@@ -742,16 +756,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 +773,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 +786,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);
}
@@ -816,7 +830,8 @@ static void rna_def_armature(BlenderRNA *brna)
{ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Display bones as octahedral shape (default)"},
{ARM_LINE, "STICK", 0, "Stick", "Display bones as simple 2D lines with dots"},
{ARM_B_BONE, "BBONE", 0, "B-Bone", "Display bones as boxes, showing subdivision and B-Splines"},
- {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", "Display bones as extruded spheres, showing deformation influence volume"},
+ {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope",
+ "Display bones as extruded spheres, showing deformation influence volume"},
{ARM_WIRE, "WIRE", 0, "Wire", "Display bones as thin wires, showing subdivision and B-Splines"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_vdeformer[] = {
@@ -829,12 +844,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 +859,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,86 +914,90 @@ 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",
- "Protected layers in Proxy Instances are restored to Proxy settings on file reload and undo");
+ "Protected layers in Proxy Instances are restored to Proxy settings "
+ "on file reload and undo");
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");
-
+#if 0
+ 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");
+#endif
+
/* 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 +1006,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 +1014,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 +1023,15 @@ 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)");
+ "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..4a872dca952 100644
--- a/source/blender/makesrna/intern/rna_armature_api.c
+++ b/source/blender/makesrna/intern/rna_armature_api.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): Campbell Barton
*
* ***** END GPL LICENSE BLOCK *****
@@ -44,13 +44,14 @@
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)
{
float scale = (bone->flag & BONE_MULT_VG_ENV) == BONE_MULT_VG_ENV ? bone->weight : 1.0f;
- return distfactor_to_bone(vec, bone->arm_head, bone->arm_tail, bone->rad_head * scale, bone->rad_tail * scale, bone->dist * scale);
+ return distfactor_to_bone(vec, bone->arm_head, bone->arm_tail, bone->rad_head * scale,
+ bone->rad_tail * scale, bone->dist * scale);
}
#else
@@ -60,10 +61,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 +73,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..1e77959a971 100644
--- a/source/blender/makesrna/intern/rna_boid.c
+++ b/source/blender/makesrna/intern/rna_boid.c
@@ -46,23 +46,31 @@
#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"},
+ {eBoidRuleType_AvoidCollision, "AVOID_COLLISION", 0, "Avoid Collision",
+ "Manoeuvre to avoid collisions with other boids and deflector objects in "
+ "near future"},
{eBoidRuleType_Separate, "SEPARATE", 0, "Separate", "Keep from going through other boids"},
{eBoidRuleType_Flock, "FLOCK", 0, "Flock", "Move to center of neighbors and match their velocity"},
{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"},
+#if 0
+ {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"},
+#endif
{0, NULL, 0, NULL, NULL}};
-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"},
+EnumPropertyItem boidruleset_type_items[] = {
+ {eBoidRulesetType_Fuzzy, "FUZZY", 0, "Fuzzy",
+ "Rules are gone through top to bottom (only the first rule which effect is 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"},
{0, NULL, 0, NULL, NULL}};
@@ -76,7 +84,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 +98,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 +115,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 +137,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)
+static void rna_BoidState_active_boid_rule_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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 +174,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 +188,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 +197,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 +208,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)
+static void rna_BoidSettings_active_boid_state_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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 +240,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 +259,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 +280,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 +306,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 +330,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 +361,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 +385,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 +405,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 +454,41 @@ 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);
- 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");
+ 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 +502,150 @@ 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);
- 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");
+ 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_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_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_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_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..4649ae3f87d 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}};
@@ -51,6 +51,7 @@ static EnumPropertyItem prop_direction_items[]= {
EnumPropertyItem brush_sculpt_tool_items[] = {
{SCULPT_TOOL_BLOB, "BLOB", ICON_BRUSH_BLOB, "Blob", ""},
{SCULPT_TOOL_CLAY, "CLAY", ICON_BRUSH_CLAY, "Clay", ""},
+ {SCULPT_TOOL_CLAY_STRIPS, "CLAY_STRIPS", ICON_BRUSH_CLAY_STRIPS, "Clay Strips", ""},
{SCULPT_TOOL_CREASE, "CREASE",ICON_BRUSH_CREASE, "Crease", ""},
{SCULPT_TOOL_DRAW, "DRAW", ICON_BRUSH_SCULPT_DRAW, "Draw", ""},
{SCULPT_TOOL_FILL, "FILL", ICON_BRUSH_FILL, "Fill", ""},
@@ -100,14 +101,134 @@ EnumPropertyItem brush_image_tool_items[] = {
#include "WM_api.h"
+static int rna_SculptCapabilities_has_accumulate_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return ELEM6(br->sculpt_tool,
+ SCULPT_TOOL_BLOB, SCULPT_TOOL_CLAY, SCULPT_TOOL_CREASE,
+ SCULPT_TOOL_DRAW, SCULPT_TOOL_INFLATE, SCULPT_TOOL_LAYER);
+}
+
+static int rna_SculptCapabilities_has_auto_smooth_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return br->sculpt_tool != SCULPT_TOOL_SMOOTH;
+}
+
+static int rna_SculptCapabilities_has_height_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return br->sculpt_tool == SCULPT_TOOL_LAYER;
+}
+
+static int rna_SculptCapabilities_has_jitter_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return (!(br->flag & BRUSH_ANCHORED) &&
+ !(br->flag & BRUSH_RESTORE_MESH) &&
+ !ELEM4(br->sculpt_tool,
+ SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
+ SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
+}
+
+static int rna_SculptCapabilities_has_normal_weight_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK);
+}
+
+static int rna_SculptCapabilities_has_persistence_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return br->sculpt_tool == SCULPT_TOOL_LAYER;
+}
+
+static int rna_SculptCapabilities_has_pinch_factor_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return ELEM(br->sculpt_tool, SCULPT_TOOL_BLOB, SCULPT_TOOL_CREASE);
+}
+
+static int rna_SculptCapabilities_has_plane_offset_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return ELEM5(br->sculpt_tool, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_STRIPS,
+ SCULPT_TOOL_FILL, SCULPT_TOOL_FLATTEN, SCULPT_TOOL_SCRAPE);
+}
+
+static int rna_SculptCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return ((br->mtex.brush_map_mode == MTEX_MAP_MODE_FIXED) &&
+ !(br->flag & BRUSH_ANCHORED) &&
+ !ELEM4(br->sculpt_tool,
+ SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
+ SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
+}
+
+static int rna_SculptCapabilities_has_sculpt_plane_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return !ELEM3(br->sculpt_tool, SCULPT_TOOL_INFLATE, SCULPT_TOOL_PINCH,
+ SCULPT_TOOL_SMOOTH);
+}
+
+static int rna_SculptCapabilities_has_secondary_color_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return ELEM10(br->sculpt_tool,
+ SCULPT_TOOL_BLOB, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_STRIPS,
+ SCULPT_TOOL_CREASE, SCULPT_TOOL_DRAW, SCULPT_TOOL_FILL,
+ SCULPT_TOOL_FLATTEN, SCULPT_TOOL_INFLATE, SCULPT_TOOL_PINCH,
+ SCULPT_TOOL_SCRAPE);
+}
+
+static int rna_SculptCapabilities_has_smooth_stroke_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return (!(br->flag & BRUSH_ANCHORED) &&
+ !(br->flag & BRUSH_RESTORE_MESH) &&
+ !ELEM4(br->sculpt_tool,
+ SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
+ SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
+}
+
+static int rna_SculptCapabilities_has_space_attenuation_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return ((br->flag & BRUSH_SPACE) &&
+ !ELEM4(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
+ SCULPT_TOOL_SMOOTH, SCULPT_TOOL_SNAKE_HOOK));
+}
+
+static int rna_SculptCapabilities_has_spacing_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return (!(br->flag & BRUSH_ANCHORED) &&
+ !ELEM4(br->sculpt_tool,
+ SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
+ SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
+}
+
+static int rna_SculptCapabilities_has_strength_get(PointerRNA *ptr)
+{
+ Brush *br = (Brush*)ptr->data;
+ return !ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK);
+}
+
+static PointerRNA rna_Brush_sculpt_capabilities_get(PointerRNA *ptr)
+{
+ return rna_pointer_inherit_refine(ptr, &RNA_SculptCapabilities, ptr->id.data);
+}
+
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 +238,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 +290,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 +299,41 @@ 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 *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,23 +376,62 @@ 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", "");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
}
+static void rna_def_sculpt_capabilities(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = RNA_def_struct(brna, "SculptCapabilities", NULL);
+ RNA_def_struct_sdna(srna, "Brush");
+ RNA_def_struct_nested(brna, srna, "Brush");
+ RNA_def_struct_ui_text(srna, "Sculpt Capabilities",
+ "Read-only indications of which brush operations "
+ "are supported by the current sculpt tool");
+
+#define BRUSH_CAPABILITY(prop_name_, ui_name_) \
+ prop = RNA_def_property(srna, #prop_name_, \
+ PROP_BOOLEAN, PROP_NONE); \
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
+ RNA_def_property_boolean_funcs(prop, "rna_SculptCapabilities_" \
+ #prop_name_ "_get", NULL); \
+ RNA_def_property_ui_text(prop, ui_name_, NULL)
+
+ BRUSH_CAPABILITY(has_accumulate, "Has Accumulate");
+ BRUSH_CAPABILITY(has_auto_smooth, "Has Auto Smooth");
+ BRUSH_CAPABILITY(has_height, "Has Height");
+ BRUSH_CAPABILITY(has_jitter, "Has Jitter");
+ BRUSH_CAPABILITY(has_normal_weight, "Has Crease/Pinch Factor");
+ BRUSH_CAPABILITY(has_persistence, "Has Persistence");
+ BRUSH_CAPABILITY(has_pinch_factor, "Has Pinch Factor");
+ BRUSH_CAPABILITY(has_plane_offset, "Has Plane Offset");
+ BRUSH_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
+ BRUSH_CAPABILITY(has_sculpt_plane, "Has Sculpt Plane");
+ BRUSH_CAPABILITY(has_secondary_color, "Has Secondary Color");
+ BRUSH_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
+ BRUSH_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
+ BRUSH_CAPABILITY(has_spacing, "Has Spacing");
+ BRUSH_CAPABILITY(has_strength, "Has Strength");
+
+#undef SCULPT_CAPABILITY
+}
+
static void rna_def_brush(BlenderRNA *brna)
{
StructRNA *srna;
@@ -314,115 +475,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,50 +591,52 @@ 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);
RNA_def_property_ui_range(prop, -0.5f, 0.5f, 0.001, 0.001);
- 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_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_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,225 +645,237 @@ 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_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_attenuation", 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_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_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_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");
+ 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");
+ 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);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_update");
+
+ /* brush capabilities (mode-dependent) */
+ prop = RNA_def_property(srna, "sculpt_capabilities", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
+ RNA_def_property_struct_type(prop, "SculptCapabilities");
+ RNA_def_property_pointer_funcs(prop, "rna_Brush_sculpt_capabilities_get", NULL, NULL, NULL);
+ RNA_def_property_ui_text(prop, "Sculpt Capabilities", "Brush's capabilities in sculpt mode");
}
@@ -719,47 +894,49 @@ 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)
{
rna_def_brush(brna);
+ rna_def_sculpt_capabilities(brna);
rna_def_brush_texture_slot(brna);
rna_def_operator_stroke_element(brna);
}
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index 6f6a4baec92..180479d6f63 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,142 +143,144 @@ 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_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_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);
/* 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);
@@ -290,4 +292,3 @@ void RNA_def_camera(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_camera_api.c b/source/blender/makesrna/intern/rna_camera_api.c
index 2af0524861a..14391e74239 100644
--- a/source/blender/makesrna/intern/rna_camera_api.c
+++ b/source/blender/makesrna/intern/rna_camera_api.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
@@ -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..2f6a31ff8ee 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,46 @@ 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_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_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_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 +266,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 +286,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 +300,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 +321,74 @@ 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_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);
- RNA_def_property_string_funcs(prop, "rna_ClothSettings_struct_vgroup_get", "rna_ClothSettings_struct_vgroup_length",
+ 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_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_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 +447,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 +467,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 +488,31 @@ 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)");
+ "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");
@@ -517,4 +525,3 @@ void RNA_def_cloth(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index 60144e0cf7f..ed2283dedab 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -55,11 +55,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;
@@ -67,16 +67,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);
@@ -84,52 +84,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)
+static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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)
+static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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)
+static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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)
+static void rna_CurveMapping_clipmaxy_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- CurveMapping *cumap= (CurveMapping*)ptr->data;
+ CurveMapping *cumap = (CurveMapping*)ptr->data;
- *min= cumap->clipr.ymin;
- *max= 100.0f;
+ *min = cumap->clipr.ymin;
+ *max = 100.0f;
}
@@ -137,14 +137,14 @@ 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 */
+ case ID_MA: /* material has 2 cases - diffuse and specular */
{
- Material *ma= (Material*)id;
+ Material *ma = (Material*)id;
- if (ptr->data == ma->ramp_col)
+ if (ptr->data == ma->ramp_col)
return BLI_strdup("diffuse_ramp");
else if (ptr->data == ma->ramp_spec)
return BLI_strdup("specular_ramp");
@@ -164,32 +164,32 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
char *path = NULL;
int index;
- /* helper macro for use here to try and get the path
+ /* helper macro for use here to try and get the path
* - this calls the standard code for getting a path to a texture...
*/
#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) {
@@ -204,13 +204,13 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
}
break;
- // TODO: node trees need special attention
- case ID_NT:
+ /* 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;
@@ -239,12 +239,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);
@@ -255,7 +255,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);
}
@@ -264,7 +264,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);
@@ -276,16 +276,16 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
}
}
-static void rna_ColorRamp_eval(struct ColorBand *coba, float position, float color[4])
+void rna_ColorRamp_eval(struct ColorBand *coba, float position, float color[4])
{
do_colorband(coba, position, color);
}
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;
@@ -294,14 +294,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;
}
@@ -317,24 +317,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");
}
@@ -349,18 +349,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", "");
@@ -371,50 +371,54 @@ static void rna_def_curvemapping(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- 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");
+ 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);
- 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);
+ 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");
@@ -426,18 +430,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");
@@ -451,7 +455,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");
@@ -460,16 +464,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);
}
@@ -487,26 +491,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);
@@ -517,10 +521,11 @@ 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);
+ prop = RNA_def_float_color(func, "color", 4, NULL, -FLT_MAX, FLT_MAX, "Color", "Color at given position",
+ -FLT_MAX, FLT_MAX);
RNA_def_property_flag(prop, PROP_THICK_WRAP);
RNA_def_function_output(func, prop);
}
@@ -538,10 +543,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");
@@ -561,38 +566,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");
@@ -611,4 +616,3 @@ void RNA_def_color(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 8a1c56abedf..6519b9ad5a0 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", ""},
@@ -60,12 +60,15 @@ EnumPropertyItem constraint_type_items[] ={
{CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", ICON_CONSTRAINT_DATA, "Transformation", ""},
{0, "", 0, "Tracking", ""},
{CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", ICON_CONSTRAINT_DATA, "Clamp To", ""},
- {CONSTRAINT_TYPE_DAMPTRACK, "DAMPED_TRACK", ICON_CONSTRAINT_DATA, "Damped Track", "Tracking by taking the shortest path"},
+ {CONSTRAINT_TYPE_DAMPTRACK, "DAMPED_TRACK", ICON_CONSTRAINT_DATA, "Damped Track",
+ "Tracking by taking the shortest path"},
{CONSTRAINT_TYPE_KINEMATIC, "IK", ICON_CONSTRAINT_DATA, "Inverse Kinematics", ""},
- {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", ICON_CONSTRAINT_DATA, "Locked Track", "Tracking along a single axis"},
+ {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", ICON_CONSTRAINT_DATA, "Locked Track",
+ "Tracking along a single axis"},
{CONSTRAINT_TYPE_SPLINEIK, "SPLINE_IK", ICON_CONSTRAINT_DATA, "Spline IK", ""},
{CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO",ICON_CONSTRAINT_DATA, "Stretch To", ""},
- {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", ICON_CONSTRAINT_DATA, "Track To", "Legacy tracking constraint prone to twisting artifacts"},
+ {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", ICON_CONSTRAINT_DATA, "Track To",
+ "Legacy tracking constraint prone to twisting artifacts"},
{0, "", 0, "Relationship", ""},
{CONSTRAINT_TYPE_ACTION, "ACTION", ICON_CONSTRAINT_DATA, "Action", ""},
{CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", ICON_CONSTRAINT_DATA, "Child Of", ""},
@@ -78,24 +81,39 @@ EnumPropertyItem constraint_type_items[] ={
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem target_space_pchan_items[] = {
- {CONSTRAINT_SPACE_WORLD, "WORLD", 0, "World Space", "The transformation of the target is evaluated relative to the world coordinate system"},
- {CONSTRAINT_SPACE_POSE, "POSE", 0, "Pose Space", "The transformation of the target is only evaluated in the Pose Space, the target armature object transformation is ignored"},
- {CONSTRAINT_SPACE_PARLOCAL, "LOCAL_WITH_PARENT", 0, "Local With Parent", "The transformation of the target bone is evaluated relative its local coordinate system, with the parent transformation added"},
- {CONSTRAINT_SPACE_LOCAL, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"},
+ {CONSTRAINT_SPACE_WORLD, "WORLD", 0, "World Space",
+ "The transformation of the target is evaluated relative to the world "
+ "coordinate system"},
+ {CONSTRAINT_SPACE_POSE, "POSE", 0, "Pose Space",
+ "The transformation of the target is only evaluated in the Pose Space, "
+ "the target armature object transformation is ignored"},
+ {CONSTRAINT_SPACE_PARLOCAL, "LOCAL_WITH_PARENT", 0, "Local With Parent",
+ "The transformation of the target bone is evaluated relative its local "
+ "coordinate system, with the parent transformation added"},
+ {CONSTRAINT_SPACE_LOCAL, "LOCAL", 0, "Local Space",
+ "The transformation of the target is evaluated relative to its local "
+ "coordinate system"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem owner_space_pchan_items[] = {
- {CONSTRAINT_SPACE_WORLD, "WORLD", 0, "World Space", "The constraint is applied relative to the world coordinate system"},
- {CONSTRAINT_SPACE_POSE, "POSE", 0, "Pose Space", "The constraint is applied in Pose Space, the object transformation is ignored"},
- {CONSTRAINT_SPACE_PARLOCAL, "LOCAL_WITH_PARENT", 0, "Local With Parent", "The constraint is applied relative to the local coordinate system of the object, with the parent transformation added"},
- {CONSTRAINT_SPACE_LOCAL, "LOCAL", 0, "Local Space", "The constraint is applied relative to the local coordinate sytem of the object"},
+ {CONSTRAINT_SPACE_WORLD, "WORLD", 0, "World Space",
+ "The constraint is applied relative to the world coordinate system"},
+ {CONSTRAINT_SPACE_POSE, "POSE", 0, "Pose Space",
+ "The constraint is applied in Pose Space, the object transformation is ignored"},
+ {CONSTRAINT_SPACE_PARLOCAL, "LOCAL_WITH_PARENT", 0, "Local With Parent",
+ "The constraint is applied relative to the local coordinate system of the object, "
+ "with the parent transformation added"},
+ {CONSTRAINT_SPACE_LOCAL, "LOCAL", 0, "Local Space",
+ "The constraint is applied relative to the local coordinate sytem of the object"},
{0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
static EnumPropertyItem space_object_items[] = {
- {CONSTRAINT_SPACE_WORLD, "WORLD", 0, "World Space", "The transformation of the target is evaluated relative to the world coordinate system"},
- {CONSTRAINT_SPACE_LOCAL, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"},
+ {CONSTRAINT_SPACE_WORLD, "WORLD", 0, "World Space",
+ "The transformation of the target is evaluated relative to the world coordinate system"},
+ {CONSTRAINT_SPACE_LOCAL, "LOCAL", 0, "Local Space",
+ "The transformation of the target is evaluated relative to its local coordinate system"},
{0, NULL, 0, NULL, NULL}};
#include "BKE_animsys.h"
@@ -107,9 +125,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:
@@ -139,7 +157,7 @@ static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
case CONSTRAINT_TYPE_RIGIDBODYJOINT:
return &RNA_RigidBodyJointConstraint;
case CONSTRAINT_TYPE_CLAMPTO:
- return &RNA_ClampToConstraint;
+ return &RNA_ClampToConstraint;
case CONSTRAINT_TYPE_TRANSFORM:
return &RNA_TransformConstraint;
case CONSTRAINT_TYPE_ROTLIMIT:
@@ -173,7 +191,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,29 +202,30 @@ 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 */
if (list)
- unique_constraint_name(con, list);
+ unique_constraint_name(con, list);
}
/* fix all the animation data which may link to this */
- BKE_all_animdata_fix_paths_rename("constraints", oldname, con->name);
+ BKE_all_animdata_fix_paths_rename(NULL, "constraints", oldname, con->name);
}
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)
- printf("rna_Constraint_path: internal error, constraint '%s' not found in object '%s'\n", con->name, ob->id.name);
+ 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 +244,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 +258,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;
@@ -251,88 +270,91 @@ 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))
+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;
}
-static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
+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;
}
return space_object_items;
}
-static void rna_ActionConstraint_minmax_range(PointerRNA *ptr, float *min, float *max)
+static void rna_ActionConstraint_minmax_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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;
- } else {
- *min= -1000.f;
- *max= 1000.f;
+ *min = -180.0f;
+ *max = 180.0f;
+ }
+ else {
+ *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 +367,41 @@ 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;
+ }
+ else {
+ 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;
+ }
+ else {
+ 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,25 +412,32 @@ 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;
+ }
+ else {
+ data->camera = NULL;
}
}
#else
EnumPropertyItem constraint_distance_items[] = {
- {LIMITDIST_INSIDE, "LIMITDIST_INSIDE", 0, "Inside", "The object is constrained inside a virtual sphere around the target object, with a radius defined by the limit distance"},
- {LIMITDIST_OUTSIDE, "LIMITDIST_OUTSIDE", 0, "Outside", "The object is constrained outside a virtual sphere around the target object, with a radius defined by the limit distance"},
- {LIMITDIST_ONSURFACE, "LIMITDIST_ONSURFACE", 0, "On Surface", "The object is constrained on the surface of a virtual sphere around the target object, with a radius defined by the limit distance"},
+ {LIMITDIST_INSIDE, "LIMITDIST_INSIDE", 0, "Inside",
+ "The object is constrained inside a virtual sphere around the target object, "
+ "with a radius defined by the limit distance"},
+ {LIMITDIST_OUTSIDE, "LIMITDIST_OUTSIDE", 0, "Outside",
+ "The object is constrained outside a virtual sphere around the target object, "
+ "with a radius defined by the limit distance"},
+ {LIMITDIST_ONSURFACE, "LIMITDIST_ONSURFACE", 0, "On Surface",
+ "The object is constrained on the surface of a virtual sphere around the target object, "
+ "with a radius defined by the limit distance"},
{0, NULL, 0, NULL, NULL}
};
@@ -416,91 +447,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");
- RNA_def_struct_ui_text(srna, "Child Of Constraint", "Create constraint-based parent-child relationship");
- RNA_def_struct_sdna_from(srna, "bChildOfConstraint", "data");
+ 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 +544,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 +579,147 @@ 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_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 +746,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 +790,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 +853,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 +909,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 +957,18 @@ 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");
- RNA_def_struct_ui_text(srna, "Maintain Volume Constraint", "Maintain a constant volume along a single scaling axis");
+ 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 +980,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 +1016,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 +1070,54 @@ 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_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 +1145,35 @@ 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");
- RNA_def_struct_ui_text(srna, "Locked Track Constraint", "Point toward the target along the track axis, while locking the other axis");
+ 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 +1200,53 @@ 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_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 +1269,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");
@@ -1285,73 +1322,75 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna)
static EnumPropertyItem pivot_items[] = {
{CONSTRAINT_RB_BALL, "BALL", 0, "Ball", "Allow rotations around all axes"},
{CONSTRAINT_RB_HINGE, "HINGE", 0, "Hinge", "Work in one plane, allow rotations around one axis only"},
- {CONSTRAINT_RB_CONETWIST, "CONE_TWIST", 0, "Cone Twist", "Allow rotations around all axes with limits for the cone and twist axes"},
- {CONSTRAINT_RB_GENERIC6DOF, "GENERIC_6_DOF", 0, "Generic 6 DoF", "No constraints by default, limits can be set individually"},
+ {CONSTRAINT_RB_CONETWIST, "CONE_TWIST", 0, "Cone Twist",
+ "Allow rotations around all axes with limits for the cone and twist axes"},
+ {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 +1398,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 +1497,25 @@ 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");
- RNA_def_struct_ui_text(srna, "Clamp To Constraint", "Constrains an object's location to the nearest point along the target path");
+ 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 +1538,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 +1666,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 +1747,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 +1813,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 +1894,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");
@@ -1899,45 +1939,48 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem type_items[] = {
- {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACE", 0, "Nearest Surface Point", "Shrink the location to the nearest target surface"},
- {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", "Shrink the location to the nearest target surface along a given axis"},
- {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrink the location to the nearest target vertex"},
+ {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACE", 0, "Nearest Surface Point",
+ "Shrink the location to the nearest target surface"},
+ {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project",
+ "Shrink the location to the nearest target surface along a given axis"},
+ {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");
- RNA_def_struct_ui_text(srna, "Shrinkwrap Constraint", "Create constraint-based shrinkwrap relationship");
+ 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 +2000,29 @@ 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");
- RNA_def_struct_ui_text(srna, "Damped Track Constraint", "Point toward target by taking the shortest rotation path");
+ 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");
@@ -1992,62 +2036,73 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna)
static EnumPropertyItem splineik_xz_scale_mode[] = {
{CONSTRAINT_SPLINEIK_XZS_NONE, "NONE", 0, "None", "Don't scale the X and Z axes (Default)"},
- {CONSTRAINT_SPLINEIK_XZS_ORIGINAL, "BONE_ORIGINAL", 0, "Bone Original", "Use the original scaling of the bones"},
- {CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC, "VOLUME_PRESERVE", 0, "Volume Preservation", "Scale of the X and Z axes is the inverse of the Y-Scale"},
+ {CONSTRAINT_SPLINEIK_XZS_ORIGINAL, "BONE_ORIGINAL", 0, "Bone Original",
+ "Use the original scaling of the bones"},
+ {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
+ /* TODO: this should really check the max length of the chain the constraint is attached to */
+ RNA_def_property_range(prop, 1, 255);
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?
+ /* XXX: this update goes wrong... needs extra flush? */
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
/* 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);
- RNA_def_property_ui_text(prop, "Joint Bindings", "(EXPERIENCED USERS ONLY) The relative positions of the joints along the chain as percentages");
+ RNA_def_property_float_funcs(prop, "rna_SplineIKConstraint_joint_bindings_get",
+ "rna_SplineIKConstraint_joint_bindings_set", NULL);
+ RNA_def_property_ui_text(prop, "Joint Bindings",
+ "(EXPERIENCED USERS ONLY) The relative positions of the joints along the chain, "
+ "as percentages");
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_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_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");
+ RNA_def_property_ui_text(prop, "XZ Scale Mode",
+ "Method used for determining the scaling of the X and Z axes of the bones");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
@@ -2058,18 +2113,21 @@ static void rna_def_constraint_pivot(BlenderRNA *brna)
static EnumPropertyItem pivot_rotAxis_items[] = {
{PIVOTCON_AXIS_NONE, "ALWAYS_ACTIVE", 0, "Always", "Use the pivot point in every rotation"},
- {PIVOTCON_AXIS_X_NEG, "NX", 0, "-X Rot", "Use the pivot point in the negative rotation range around the X-axis"},
- {PIVOTCON_AXIS_Y_NEG, "NY", 0, "-Y Rot", "Use the pivot point in the negative rotation range around the Y-axis"},
- {PIVOTCON_AXIS_Z_NEG, "NZ", 0, "-Z Rot", "Use the pivot point in the negative rotation range around the Z-axis"},
+ {PIVOTCON_AXIS_X_NEG, "NX", 0, "-X Rot",
+ "Use the pivot point in the negative rotation range around the X-axis"},
+ {PIVOTCON_AXIS_Y_NEG, "NY", 0, "-Y Rot",
+ "Use the pivot point in the negative rotation range around the Y-axis"},
+ {PIVOTCON_AXIS_Z_NEG, "NZ", 0, "-Z Rot",
+ "Use the pivot point in the negative rotation range around the Z-axis"},
{PIVOTCON_AXIS_X, "X", 0, "X Rot", "Use the pivot point in the positive rotation range around the X-axis"},
{PIVOTCON_AXIS_Y, "Y", 0, "Y Rot", "Use the pivot point in the positive rotation range around the Y-axis"},
{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 +2135,33 @@ 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_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_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,56 +2173,60 @@ 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_ui_text(prop, "Camera",
+ "Camera to which motion is parented (if empty active scene camera is used)");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_Constraint_followTrack_camera_set", NULL, "rna_Constraint_cameraObject_poll");
+ 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_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);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_Constraint_followTrack_depthObject_set", NULL, "rna_Constraint_followTrack_depthObject_poll");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Constraint_followTrack_depthObject_set", NULL,
+ "rna_Constraint_followTrack_depthObject_poll");
}
static void rna_def_constraint_camera_solver(BlenderRNA *brna)
@@ -2169,19 +2234,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,36 +2257,38 @@ 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_ui_text(prop, "Camera",
+ "Camera to which motion is parented (if empty active scene camera is used)");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_Constraint_objectSolver_camera_set", NULL, "rna_Constraint_cameraObject_poll");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Constraint_objectSolver_camera_set", NULL,
+ "rna_Constraint_cameraObject_poll");
}
/* base struct for constraints */
@@ -2231,80 +2298,83 @@ 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)");
+ 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");
+ 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");
+ RNA_def_property_ui_text(prop, "Rot error",
+ "Amount of residual error in radiant for constraints that work on orientation");
/* pointers */
rna_def_constrainttarget(brna);
@@ -2340,4 +2410,3 @@ void RNA_def_constraint(BlenderRNA *brna)
}
#endif
-
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..fa18c92b86a 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,62 +186,67 @@ 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_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_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_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");
- RNA_def_property_collection_funcs(prop, "rna_Controller_actuators_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_dereference_get", "rna_Controller_actuators_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_Controller_actuators_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_dereference_get",
+ "rna_Controller_actuators_length", NULL, NULL, NULL);
/* 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,60 +254,64 @@ 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");
+ 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);
- 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)");
+ 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_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");
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_controller_api.c b/source/blender/makesrna/intern/rna_controller_api.c
index 5f766e28005..6fe90e1721b 100644
--- a/source/blender/makesrna/intern/rna_controller_api.c
+++ b/source/blender/makesrna/intern/rna_controller_api.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) 2010 Blender Foundation.
* All rights reserved.
*
- *
+ *
* Contributor(s):
*
* ***** END GPL LICENSE BLOCK *****
@@ -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..17023e391a2 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,40 +243,41 @@ 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)
+static void rna_Curve_material_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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)
+static void rna_Curve_active_textbox_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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);
}
-static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
+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,21 +285,22 @@ 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;
- rna_iterator_array_begin(iter, (void*)nu->bp, sizeof(BPoint), nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu, 0, NULL);
+ 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);
}
static void rna_Curve_update_data_id(Main *UNUSED(bmain), Scene *UNUSED(scene), ID *id)
@@ -320,10 +322,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 +333,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 +344,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 */
@@ -351,15 +353,16 @@ static void rna_Curve_bevelObject_set(PointerRNA *ptr, PointerRNA value)
if (ob->type == OB_CURVE && ob->data != cu) {
cu->bevobj = ob;
}
- } else {
+ }
+ else {
cu->bevobj = NULL;
}
}
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 +375,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 +386,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 */
@@ -392,20 +395,21 @@ static void rna_Curve_taperObject_set(PointerRNA *ptr, PointerRNA value)
if (ob->type == OB_CURVE && ob->data != cu) {
cu->taperobj = ob;
}
- } else {
+ }
+ else {
cu->taperobj = NULL;
}
}
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 +417,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,54 +432,58 @@ 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() */
+ /* don't know why this is +4, just duplicating load_editText() */
+ cu->strinfo = MEM_callocN((len+4) *sizeof(CharInfo), "strinfo");
- //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 {
+ }
+ else {
nurbs_knot_calc_u(nu);
}
@@ -484,7 +492,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 +501,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 +511,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,12 +521,13 @@ 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 {
+ else if (number == 0) {
+ /* do nothing */
+ }
+ else {
addNurbPoints(nu, number);
@@ -531,12 +540,13 @@ 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 {
+ else if (number == 0) {
+ /* do nothing */
+ }
+ else {
addNurbPointsBezier(nu, number);
/* update */
@@ -548,26 +558,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 +586,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 +605,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 +615,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 +630,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 +657,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 +680,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 +692,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 +703,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 +757,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 +840,44 @@ 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_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");
+ 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_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 +889,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 +908,144 @@ 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_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 +1056,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 +1092,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 +1118,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 +1128,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 +1140,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 +1154,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 +1181,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 +1215,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,40 +1257,43 @@ 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"},
+ {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
/* this way we get editmode nurbs too, keyframe in editmode */
- RNA_def_property_collection_funcs(prop, "rna_Curve_splines_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_Curve_splines_begin", "rna_iterator_listbase_next",
+ "rna_iterator_listbase_end", "rna_iterator_listbase_get",
+ NULL, NULL, NULL, NULL);
#endif
RNA_def_property_struct_type(prop, "Spline");
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,135 +1301,143 @@ 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_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)");
+ 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)");
+ 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_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);
RNA_def_property_ui_text(prop, "Bevel Object", "Curve object name that defines the bevel shape");
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");
+ 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);
RNA_def_property_ui_text(prop, "Taper Object", "Curve object name that defines the taper (width)");
RNA_def_property_update(prop, 0, "rna_Curve_update_deps");
- RNA_def_property_pointer_funcs(prop, "rna_Curve_taperObject_get", "rna_Curve_taperObject_set", NULL, "rna_Curve_otherObject_poll");
+ RNA_def_property_pointer_funcs(prop, "rna_Curve_taperObject_get", "rna_Curve_taperObject_set", NULL,
+ "rna_Curve_otherObject_poll");
/* 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_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_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 +1452,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,135 +1478,151 @@ 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");
+ 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_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_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_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_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_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_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_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)");
+ RNA_def_property_ui_text(prop, "Character Index",
+ "Location of this character in the text data (only for text curves)");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
RNA_def_struct_path_func(srna, "rna_Curve_spline_path");
@@ -1598,4 +1641,3 @@ void RNA_def_curve(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 2ea21baf257..651b6fd9c16 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)
@@ -508,42 +508,42 @@ void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
PropertyRNA *parm, *nextparm;
/*
- if(srna->flag & STRUCT_RUNTIME) {
- if(RNA_struct_py_type_get(srna)) {
+ if (srna->flag & STRUCT_RUNTIME) {
+ if (RNA_struct_py_type_get(srna)) {
fprintf(stderr, "%s '%s' freed while holding a python reference\n", __func__, srna->identifier);
}
} */
- 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,114 @@ 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);
+ 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 +725,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 +786,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 +810,72 @@ 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;
+}
+
+void RNA_def_struct_translation_context(StructRNA *srna, const char *context)
+{
+ srna->translation_context = context;
}
/* Property Definition */
@@ -876,74 +883,75 @@ 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;
+ fprintf(stderr, "%s: property identifier \"%s.%s\" - %s\n", __func__,
+ CONTAINER_RNA_ID(cont), identifier, error);
+ 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 +960,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 +1052,82 @@ 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) {
- fprintf(stderr, "%s: \"%s.%s\", array length must be zero of greater.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ if (length<0) {
+ fprintf(stderr, "%s: \"%s.%s\", array length must be zero of greater.\n", __func__,
+ srna->identifier, prop->identifier);
+ DefRNA.error = 1;
return;
}
- 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;
+ 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;
return;
}
- 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;
+ 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;
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;
+ fprintf(stderr, "%s: \"%s.%s\", only boolean/int/float can be array.\n",
+ __func__, srna->identifier, prop->identifier);
+ 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;
+ 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;
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;
+ fprintf(stderr, "%s: \"%s.%s\", only boolean/int/float can be array.\n",
+ __func__, srna->identifier, prop->identifier);
+ 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 +1140,154 @@ 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;
+ fprintf(stderr, "%s: \"%s.%s\", invalid type for ui range.\n",
+ __func__, srna->identifier, prop->identifier);
+ 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;
+ fprintf(stderr, "%s: \"%s.%s\", invalid type for struct type.\n",
+ __func__, srna->identifier, prop->identifier);
+ 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;
+ fprintf(stderr, "%s: \"%s.%s\", invalid type for struct type.\n",
+ __func__, srna->identifier, prop->identifier);
+ 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;
}
}
@@ -1279,185 +1296,188 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item
break;
}
default:
- fprintf(stderr, "%s: \"%s.%s\", invalid type for struct type.\n", __func__, srna->identifier, prop->identifier);
- DefRNA.error= 1;
+ fprintf(stderr, "%s: \"%s.%s\", invalid type for struct type.\n",
+ __func__, srna->identifier, prop->identifier);
+ 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) {
- fprintf(stderr, "%s: \"%s.%s\", default includes unused bits (%d).\n", __func__, srna->identifier, prop->identifier, eprop->defaultvalue & ~totflag);
- DefRNA.error= 1;
+ 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;
}
}
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;
+ fprintf(stderr, "%s: \"%s.%s\", default is not in items.\n",
+ __func__, srna->identifier, prop->identifier);
+ DefRNA.error = 1;
}
}
}
@@ -1466,7 +1486,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 +1499,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,128 +1555,133 @@ 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) {
- 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;
+ 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;
return;
}
}
- dp->booleanbit= bit;
+ dp->booleanbit = bit;
}
}
-void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int booleanbit)
+void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname,
+ const char *propname, int booleanbit)
{
PropertyDefRNA *dp;
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) {
- 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;
+ 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;
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 */
- 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;
+ 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;
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 +1691,28 @@ 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) {
- fprintf(stderr, "%s: \"%s.%s\", array not supported for enum type.\n", __func__, structname, propname);
- DefRNA.error= 1;
+ if (!DefRNA.silent) {
+ fprintf(stderr, "%s: \"%s.%s\", array not supported for enum type.\n",
+ __func__, structname, propname);
+ DefRNA.error = 1;
}
}
}
@@ -1698,34 +1724,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,98 +1759,101 @@ 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) {
- fprintf(stderr, "%s: \"%s.%s\", array not supported for pointer type.\n", __func__, structname, propname);
- DefRNA.error= 1;
+ if (!DefRNA.silent) {
+ fprintf(stderr, "%s: \"%s.%s\", array not supported for pointer type.\n",
+ __func__, structname, propname);
+ DefRNA.error = 1;
}
}
}
}
-void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
+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) {
- fprintf(stderr, "%s: \"%s.%s\", array of collections not supported.\n", __func__, structname, propname);
- DefRNA.error= 1;
+ if (!DefRNA.silent) {
+ fprintf(stderr, "%s: \"%s.%s\", array of collections not supported.\n",
+ __func__, structname, propname);
+ 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,471 +1861,477 @@ 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)
+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)
+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)
+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);
return prop;
}
-PropertyRNA *RNA_def_boolean_array(StructOrFunctionRNA *cont_, const char *identifier, int len, int *default_value,
- const char *ui_name, const char *ui_description)
+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;
}
-PropertyRNA *RNA_def_boolean_layer(StructOrFunctionRNA *cont_, const char *identifier, int len, int *default_value,
- const char *ui_name, const char *ui_description)
+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;
}
-PropertyRNA *RNA_def_boolean_layer_member(StructOrFunctionRNA *cont_, const char *identifier, int len, int *default_value,
- const char *ui_name, const char *ui_description)
+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;
}
-PropertyRNA *RNA_def_boolean_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, int *default_value,
- const char *ui_name, const char *ui_description)
+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;
}
-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)
+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);
return prop;
}
-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)
+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);
return prop;
}
-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)
+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);
return prop;
}
-PropertyRNA *RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen,
- const char *ui_name, const char *ui_description)
+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;
}
-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)
+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;
}
-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)
+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;
}
-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)
+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;
}
-PropertyRNA *RNA_def_string_translate(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen,
- const char *ui_name, const char *ui_description)
+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;
}
-PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value,
- const char *ui_name, const char *ui_description)
+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);
@@ -2304,20 +2339,20 @@ PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, co
}
/* same as above but sets 'PROP_ENUM_FLAG' before setting the default value */
-PropertyRNA *RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value,
- const char *ui_name, const char *ui_description)
+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,68 +2361,73 @@ 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)
+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);
return prop;
}
-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)
+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);
return prop;
}
-PropertyRNA *RNA_def_float_vector_xyz(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_vector_xyz(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 *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;
}
-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)
+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);
@@ -2395,58 +2435,61 @@ 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)
+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);
return prop;
}
-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)
+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);
return prop;
}
-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_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);
@@ -2454,14 +2497,15 @@ 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)
+ 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);
@@ -2469,14 +2513,15 @@ 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)
+ 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);
@@ -2484,12 +2529,12 @@ 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)
+ 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);
@@ -2497,12 +2542,12 @@ 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)
+ 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);
@@ -2510,12 +2555,12 @@ 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)
+ 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);
@@ -2523,12 +2568,12 @@ 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)
+ 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 +2588,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 +2620,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 +2637,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;
@@ -2609,40 +2654,42 @@ FunctionRNA *RNA_def_function_runtime(StructRNA *srna, const char *identifier, C
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
{
if (ret->flag & PROP_DYNAMIC) {
- fprintf(stderr, "%s: \"%s.%s\", dynamic values are not allowed as strict returns, use RNA_def_function_output instead.\n", __func__, func->identifier, ret->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", dynamic values are not allowed as strict returns, "
+ "use RNA_def_function_output instead.\n", __func__, func->identifier, ret->identifier);
return;
}
else if (ret->arraydimension) {
- fprintf(stderr, "%s: \"%s.%s\", arrays are not allowed as strict returns, use RNA_def_function_output instead.\n", __func__, func->identifier, ret->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", arrays are not allowed as strict returns, "
+ "use RNA_def_function_output instead.\n", __func__, func->identifier, ret->identifier);
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 +2714,20 @@ 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
+ }
+ 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 +2742,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 +2758,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 +2783,18 @@ 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 on first match - does this break anything?
+ * (is quick hack to get object->parent_type working ok for armature/lattice) */
+ break;
}
}
}
@@ -2760,111 +2810,116 @@ 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) {
+ /* 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) {
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;
-
- 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);
+ 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);
}
}
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 +2931,56 @@ 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;
-
- 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);
+ 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);
}
- 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 +2991,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 +3008,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 +3028,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..b3e89a4e5f8 100644
--- a/source/blender/makesrna/intern/rna_dynamicpaint.c
+++ b/source/blender/makesrna/intern/rna_dynamicpaint.c
@@ -1,4 +1,4 @@
-/**
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -6,11 +6,25 @@
* 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): Miika Hämäläinen
*
* ***** END GPL LICENSE BLOCK *****
*/
+/** \file blender/makesrna/intern/rna_dynamicpaint.c
+ * \ingroup RNA
+ */
+
+
#include <stdlib.h>
#include <limits.h>
@@ -45,7 +59,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 +67,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 +75,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 +116,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 +154,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 +168,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)
+static void rna_Surface_active_point_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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 +213,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;
}
@@ -211,13 +225,14 @@ 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)
+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 +280,17 @@ 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_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 +307,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 +332,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 +356,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 +376,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 +399,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 +443,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 +451,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 +478,137 @@ 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)");
+ 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 +618,23 @@ 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_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 +642,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,10 +709,12 @@ 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);
- 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);
+ * 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");
rna_def_canvas_surfaces(brna, prop);
@@ -739,89 +759,95 @@ 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_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");
+ 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_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)");
+ 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)");
+ 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_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 +855,62 @@ 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_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_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_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 +918,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 +939,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 98c6b269b5f..c7eeb633e25 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 */
@@ -351,11 +351,11 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value)
}
else if (value.data && (pid != vid)) {
/* id's differ, cant do this, should raise an error */
- printf("ERROR: ID's differ - ptr=%p vs value=%p \n", pid, vid);
+ printf("ERROR: ID's differ - ptr=%p vs value=%p\n", pid, vid);
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,10 +369,10 @@ 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
+ /* can only change group if we have info about the action the F-Curve is in
* (i.e. for drivers or random F-Curves, this cannot be done)
*/
if (act == NULL) {
@@ -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,46 +447,46 @@ 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;
}
-static void rna_FModifier_start_frame_range(PointerRNA *ptr, float *min, float *max)
+static void rna_FModifier_start_frame_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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)
+static void rna_FModifier_end_frame_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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)
+static void rna_FModifier_blending_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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)
+static void rna_FModifierLimits_minx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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)
+static void rna_FModifierLimits_maxx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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)
+static void rna_FModifierLimits_miny_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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)
+static void rna_FModifierLimits_maxy_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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)
+static void rna_FModifierStepped_start_frame_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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)
+static void rna_FModifierStepped_end_frame_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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--) {
- /* defaults, no userprefs gives pradictable results for API */
- bezt->f1= bezt->f2= bezt->f3= SELECT;
- bezt->ipo= BEZT_IPO_BEZ;
- bezt->h1= bezt->h2= HD_AUTO_ANIM;
+ 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++;
}
}
@@ -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;
@@ -633,37 +633,37 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
static EnumPropertyItem generator_mode_items[] = {
{FCM_GENERATOR_POLYNOMIAL, "POLYNOMIAL", 0, "Expanded Polynomial", ""},
- {FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", 0, "Factorised Polynomial", ""},
+ {FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", 0, "Factorized Polynomial", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "FModifierGenerator", "FModifier");
+ 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,32 +731,32 @@ 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");
- /* min/max extents
+ /* min/max extents
* - 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);
@@ -802,37 +802,40 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna)
{FCM_EXTRAPOLATE_NONE, "NONE", 0, "No Cycles", "Don't do anything"},
{FCM_EXTRAPOLATE_CYCLIC, "REPEAT", 0, "Repeat Motion", "Repeat keyframe range as-is"},
{FCM_EXTRAPOLATE_CYCLIC_OFFSET, "REPEAT_OFFSET", 0, "Repeat with Offset",
- "Repeat keyframe range, but with offset based on gradient between start and end values"},
+ "Repeat keyframe range, but with offset based on gradient between "
+ "start and end values"},
{FCM_EXTRAPOLATE_MIRROR, "MIRROR", 0, "Repeat Mirrored",
"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_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_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 +844,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 +858,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 +921,33 @@ 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_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 +961,42 @@ 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");
+ "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 +1012,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 +1056,55 @@ 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_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_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_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);
-}
+}
/* *********************** */
@@ -1122,24 +1130,26 @@ static void rna_def_drivertarget(BlenderRNA *brna)
{DTAR_FLAG_LOCALSPACE, "TRANSFORM_SPACE", 0, "Transform Space",
"Transforms don't include parenting/restpose or constraints"},
{DTAR_FLAG_LOCALSPACE|DTAR_FLAG_LOCAL_CONSTS, "LOCAL_SPACE", 0, "Local Space",
- "Transforms include effects of constraints but not parenting/restpose"},
+ "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");
/* note: custom set function is ONLY to avoid rna setting a user for this. */
RNA_def_property_pointer_funcs(prop, NULL, "rna_DriverTarget_id_set", "rna_DriverTarget_id_typef", NULL);
RNA_def_property_ui_text(prop, "ID",
- "ID-block that the specific property used can be found from (id_type property must be set first)");
+ "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 +1159,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");
@@ -1180,34 +1190,36 @@ static void rna_def_drivervar(BlenderRNA *brna)
static EnumPropertyItem prop_type_items[] = {
{DVAR_TYPE_SINGLE_PROP, "SINGLE_PROP", 0, "Single Property", "Use the value from some RNA property (Default)"},
- {DVAR_TYPE_TRANSFORM_CHAN, "TRANSFORMS", 0, "Transform Channel", "Final transformation value of object or bone"},
+ {DVAR_TYPE_TRANSFORM_CHAN, "TRANSFORMS", 0, "Transform Channel",
+ "Final transformation value of object or bone"},
{DVAR_TYPE_ROT_DIFF, "ROTATION_DIFF", 0, "Rotational Difference", "Use the angle between two bones"},
{DVAR_TYPE_LOC_DIFF, "LOC_DIFF", 0, "Distance", "Distance between two bones or objects"},
{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 +1230,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 +1270,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 +1316,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");
@@ -1324,47 +1336,47 @@ static void rna_def_fpoint(BlenderRNA *brna)
/* duplicate of BezTriple in rna_curve.c
- * but with F-Curve specific options updates/functionality
+ * but with F-Curve specific options updates/functionality
*/
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 +1384,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 +1420,34 @@ 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_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 +1466,32 @@ 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 +1514,24 @@ 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
+ /* XXX need an update callback for this so that animation gets evaluated */
+ RNA_def_property_update(prop, NC_ANIMATION, NULL);
/* 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 +1539,93 @@ 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);
- RNA_def_property_string_funcs(prop, "rna_FCurve_RnaPath_get", "rna_FCurve_RnaPath_length", "rna_FCurve_RnaPath_set");
+ 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
+ /* XXX need an update callback for this to that animation gets evaluated */
+ RNA_def_property_update(prop, NC_ANIMATION, NULL);
/* called 'index' when given as function arg */
- 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
+ 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");
+ /* XXX need an update callback for this so that animation gets evaluated */
+ RNA_def_property_update(prop, NC_ANIMATION, NULL);
/* 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);
+ 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);
+ 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");
+ "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..1f8b827f320 100644
--- a/source/blender/makesrna/intern/rna_fcurve_api.c
+++ b/source/blender/makesrna/intern/rna_fcurve_api.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): Joshua Leung
*
* ***** END GPL LICENSE BLOCK *****
@@ -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..057f82a44e9 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);
}
@@ -218,21 +218,26 @@ static void rna_def_fluidsim_slip(StructRNA *srna)
PropertyRNA *prop;
static EnumPropertyItem slip_items[] = {
- {OB_FSBND_NOSLIP, "NOSLIP", 0, "No Slip", "Obstacle causes zero normal and tangential velocity (=sticky), default for all (only option for moving objects)"},
- {OB_FSBND_PARTSLIP, "PARTIALSLIP", 0, "Partial Slip", "Mix between no-slip and free-slip (non moving objects only!)"},
- {OB_FSBND_FREESLIP, "FREESLIP", 0, "Free Slip", "Obstacle only causes zero normal velocity (=not sticky, non moving objects only!)"},
+ {OB_FSBND_NOSLIP, "NOSLIP", 0, "No Slip",
+ "Obstacle causes zero normal and tangential velocity (=sticky), default for all "
+ "(only option for moving objects)"},
+ {OB_FSBND_PARTSLIP, "PARTIALSLIP", 0, "Partial Slip",
+ "Mix between no-slip and free-slip (non moving objects only!)"},
+ {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");
+ 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");
}
static void rna_def_fluid_mesh_vertices(BlenderRNA *brna)
@@ -240,12 +245,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,158 +276,174 @@ 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");
+ 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_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_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");
+ 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");
+ 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)");
+ 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)");
+ 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);
- RNA_def_property_ui_text(prop, "Compressibility", "Allowed compressibility due to gravitational force for standing fluid (directly affects simulation step size)");
+ RNA_def_property_ui_text(prop, "Compressibility",
+ "Allowed compressibility due to gravitational force for standing fluid "
+ "(directly affects simulation step size)");
/* domain boundary settings */
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)");
+ 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 !)");
+ 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);
+ 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);
rna_def_fluid_mesh_vertices(brna);
}
@@ -436,23 +457,25 @@ 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)");
+ 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)");
}
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 +485,15 @@ 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_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,19 +505,23 @@ 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");
+ RNA_def_struct_ui_text(srna, "Obstacle Fluid Simulation Settings",
+ "Fluid simulation settings for obstacles in the simulation");
rna_def_fluidsim_active(srna);
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);
- RNA_def_property_ui_text(prop, "Impact Factor", "This is an unphysical value for moving objects - it controls the impact an obstacle has on the fluid, =0 behaves a bit like outflow (deleting fluid), =1 is default, while >1 results in high forces (can be used to tweak total mass)");
+ RNA_def_property_ui_text(prop, "Impact Factor",
+ "This is an unphysical value for moving objects - it controls the impact an obstacle "
+ "has on the fluid, =0 behaves a bit like outflow (deleting fluid), =1 is default, "
+ "while >1 results in high forces (can be used to tweak total mass)");
}
static void rna_def_fluidsim_inflow(BlenderRNA *brna)
@@ -501,32 +529,35 @@ 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_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)");
+ RNA_def_property_ui_text(prop, "Local Coordinates",
+ "Use local coordinates for inflow (e.g. for rotating objects)");
}
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");
+ RNA_def_struct_ui_text(srna, "Outflow Fluid Simulation Settings",
+ "Fluid simulation settings for objects removing fluids from the simulation");
rna_def_fluidsim_active(srna);
rna_def_fluidsim_volume(srna);
@@ -537,33 +568,39 @@ 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");
+ 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");
+ 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)");
+ 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 +612,54 @@ 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_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");
+ 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");
+ 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)");
+ 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");
@@ -631,31 +673,37 @@ void RNA_def_fluidsim(BlenderRNA *brna)
static EnumPropertyItem prop_fluid_type_items[] = {
{OB_FLUIDSIM_ENABLE, "NONE", 0, "None", ""},
- {OB_FLUIDSIM_DOMAIN, "DOMAIN", 0, "Domain", "Bounding box of this object represents the computational domain of the fluid simulation"},
+ {OB_FLUIDSIM_DOMAIN, "DOMAIN", 0, "Domain",
+ "Bounding box of this object represents the computational domain of the "
+ "fluid simulation"},
{OB_FLUIDSIM_FLUID, "FLUID", 0, "Fluid", "Object represents a volume of fluid in the simulation"},
{OB_FLUIDSIM_OBSTACLE, "OBSTACLE", 0, "Obstacle", "Object is a fixed obstacle"},
{OB_FLUIDSIM_INFLOW, "INFLOW", 0, "Inflow", "Object adds fluid to the simulation"},
{OB_FLUIDSIM_OUTFLOW, "OUTFLOW", 0, "Outflow", "Object removes fluid from the simulation"},
- {OB_FLUIDSIM_PARTICLE, "PARTICLE", 0, "Particle", "Object is made a particle system to display particles generated by a fluidsim domain object"},
- {OB_FLUIDSIM_CONTROL, "CONTROL", 0, "Control", "Object is made a fluid control mesh, which influences the fluid"},
+ {OB_FLUIDSIM_PARTICLE, "PARTICLE", 0, "Particle",
+ "Object is made a particle system to display particles generated by a "
+ "fluidsim domain object"},
+ {OB_FLUIDSIM_CONTROL, "CONTROL", 0, "Control",
+ "Object is made a fluid control mesh, which influences the fluid"},
{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");
+ 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..53ef1bdbf82 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 */
- /*
- prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+#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..a34b3b5fed8 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,24 @@ 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 */
+ /* this is done on save/load in readfile.c, removed if no objects are in the group */
+ RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
- 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");
@@ -137,4 +138,3 @@ void RNA_def_group(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index 7059c001283..792635ba5ae 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -42,10 +42,10 @@
#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 File", "Movie file"},
+ {IMA_SRC_MOVIE, "MOVIE", 0, "Movie", "Movie file"},
{IMA_SRC_GENERATED, "GENERATED", 0, "Generated", "Generated image"},
{IMA_SRC_VIEWER, "VIEWER", 0, "Viewer", "Compositing node viewer"},
{0, NULL, 0, NULL, NULL}};
@@ -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");
}
@@ -152,13 +152,14 @@ char *rna_ImageUser_path(PointerRNA *ptr)
return BLI_strdup("");
}
-static EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
+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,41 +170,41 @@ 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);
- if(ibuf)
+ if (ibuf)
ibuf->ftype= ftype;
*/
/* 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 +214,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 +233,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 +252,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 +267,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 +288,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 +306,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 +330,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 +361,53 @@ static void rna_def_imageuser(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- 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");
+ 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_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,205 +417,214 @@ 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_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_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");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+ prop = RNA_def_property(srna, "render_slot", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_range(prop, 0, IMA_MAX_RENDER_SLOT - 1);
+ RNA_def_property_ui_text(prop, "Render Slot", "The current render slot displayed, only for viewer type images");
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+
/*
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");
@@ -629,4 +641,3 @@ void RNA_def_image(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c
index b28adeafbc8..1b50db36a3d 100644
--- a/source/blender/makesrna/intern/rna_image_api.c
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -1,11 +1,11 @@
/*
- *
+ *
* ***** 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.
+ * 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
@@ -19,7 +19,7 @@
* The Original Code is Copyright (C) 2009 Blender Foundation.
* All rights reserved.
*
- *
+ *
* Contributor(s): Arystanbek Dyussenov
*
* ***** END GPL LICENSE BLOCK *****
@@ -82,41 +82,42 @@ 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);
- } else {
+ }
+ else {
BKE_reportf(reports, RPT_ERROR, "Scene not in context, couldn't get save parameters");
}
}
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 +138,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 +152,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 +169,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 +185,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;
}
@@ -207,7 +208,7 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int filter, int
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (GLint)filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, (GLint)mag);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ibuf->x, ibuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ibuf->x, ibuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
error = (int)glGetError();
}
@@ -234,35 +235,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 +271,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 4c66da1fdbb..155c9c67e4a 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -188,7 +188,9 @@ void rna_def_animviz_common(struct StructRNA *srna);
void rna_def_motionpath_common(struct StructRNA *srna);
void rna_def_texmat_common(struct StructRNA *srna, const char *texspace_editable);
-void rna_def_mtex_common(struct BlenderRNA *brna, struct StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *activeeditable, const char *structname, const char *structname_slots, const char *update);
+void rna_def_mtex_common(struct BlenderRNA *brna, struct StructRNA *srna, const char *begin, const char *activeget,
+ const char *activeset, const char *activeeditable, const char *structname,
+ const char *structname_slots, const char *update);
void rna_def_render_layer_common(struct StructRNA *srna, int scene);
void rna_ID_name_get(struct PointerRNA *ptr, char *value);
@@ -199,7 +201,9 @@ struct IDProperty *rna_ID_idprops(struct PointerRNA *ptr, int create);
void rna_ID_fake_user_set(struct PointerRNA *ptr, int value);
struct IDProperty *rna_PropertyGroup_idprops(struct PointerRNA *ptr, int create);
void rna_PropertyGroup_unregister(struct Main *bmain, struct StructRNA *type);
-struct StructRNA *rna_PropertyGroup_register(struct Main *bmain, struct ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free);
+struct StructRNA *rna_PropertyGroup_register(struct Main *bmain, struct ReportList *reports, void *data,
+ const char *identifier, StructValidateFunc validate,
+ StructCallbackFunc call, StructFreeFunc free);
struct StructRNA* rna_PropertyGroup_refine(struct PointerRNA *ptr);
void rna_object_vgroup_name_index_get(struct PointerRNA *ptr, char *value, int index);
@@ -338,10 +342,11 @@ 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 */
+ /* array length with no skip functins applied, take care not to compare against index from animsys
+ * or python indices */
int length;
/* optional skip function, when set the array as viewed by rna can contain only a subset of the members.
@@ -349,7 +354,8 @@ typedef struct ArrayIterator {
IteratorSkipFunc skip;
} ArrayIterator;
-void rna_iterator_array_begin(struct CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, int free_ptr, IteratorSkipFunc skip);
+void rna_iterator_array_begin(struct CollectionPropertyIterator *iter, void *ptr, int itemsize, int length,
+ int free_ptr, IteratorSkipFunc skip);
void rna_iterator_array_next(struct CollectionPropertyIterator *iter);
void *rna_iterator_array_get(struct CollectionPropertyIterator *iter);
void *rna_iterator_array_dereference_get(struct CollectionPropertyIterator *iter);
@@ -377,7 +383,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_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h
index 997f9d084c5..ccfb83b61e3 100644
--- a/source/blender/makesrna/intern/rna_internal_types.h
+++ b/source/blender/makesrna/intern/rna_internal_types.h
@@ -77,18 +77,19 @@ typedef int (*PropIntGetFunc)(struct PointerRNA *ptr);
typedef void (*PropIntSetFunc)(struct PointerRNA *ptr, int value);
typedef void (*PropIntArrayGetFunc)(struct PointerRNA *ptr, int *values);
typedef void (*PropIntArraySetFunc)(struct PointerRNA *ptr, const int *values);
-typedef void (*PropIntRangeFunc)(struct PointerRNA *ptr, int *min, int *max);
+typedef void (*PropIntRangeFunc)(struct PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax);
typedef float (*PropFloatGetFunc)(struct PointerRNA *ptr);
typedef void (*PropFloatSetFunc)(struct PointerRNA *ptr, float value);
typedef void (*PropFloatArrayGetFunc)(struct PointerRNA *ptr, float *values);
typedef void (*PropFloatArraySetFunc)(struct PointerRNA *ptr, const float *values);
-typedef void (*PropFloatRangeFunc)(struct PointerRNA *ptr, float *min, float *max);
+typedef void (*PropFloatRangeFunc)(struct PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax);
typedef void (*PropStringGetFunc)(struct PointerRNA *ptr, char *value);
typedef int (*PropStringLengthFunc)(struct PointerRNA *ptr);
typedef void (*PropStringSetFunc)(struct PointerRNA *ptr, const char *value);
typedef int (*PropEnumGetFunc)(struct PointerRNA *ptr);
typedef void (*PropEnumSetFunc)(struct PointerRNA *ptr, int value);
-typedef EnumPropertyItem *(*PropEnumItemFunc)(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int *free);
+typedef EnumPropertyItem *(*PropEnumItemFunc)(struct bContext *C, struct PointerRNA *ptr,
+ struct PropertyRNA *prop, int *free);
typedef PointerRNA (*PropPointerGetFunc)(struct PointerRNA *ptr);
typedef StructRNA* (*PropPointerTypeFunc)(struct PointerRNA *ptr);
typedef void (*PropPointerSetFunc)(struct PointerRNA *ptr, const PointerRNA value);
@@ -312,6 +313,8 @@ struct StructRNA {
const char *name;
/* single line description, displayed in the tooltip for example */
const char *description;
+ /* context for translation */
+ const char *translation_context;
/* icon ID */
int icon;
@@ -331,21 +334,21 @@ struct StructRNA {
struct StructRNA *nested;
/* function to give the more specific type */
- StructRefineFunc refine;
+ StructRefineFunc refine;
/* function to find path to this struct in an ID */
- StructPathFunc path;
+ StructPathFunc path;
/* function to register/unregister subclasses */
- StructRegisterFunc reg;
- StructUnregisterFunc unreg;
+ StructRegisterFunc reg;
+ StructUnregisterFunc unreg;
StructInstanceFunc instance;
/* callback to get id properties */
IDPropertiesFunc idproperties;
/* functions of this struct */
- ListBase functions;
+ ListBase functions;
};
/* Blender RNA
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index 08836cc1865..304af04ec27 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,64 +78,64 @@ 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));
}
/* fix all the animation data which may link to this */
- BKE_all_animdata_fix_paths_rename("key_blocks", oldname, kb->name);
+ BKE_all_animdata_fix_paths_rename(NULL, "key_blocks", oldname, kb->name);
}
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)
+static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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 */
#define SHAPEKEY_SLIDER_TOL 0.001f
-static void rna_ShapeKey_slider_min_range(PointerRNA *ptr, float *min, float *max)
+static void rna_ShapeKey_slider_min_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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;
- float min, max;
+ KeyBlock *data = (KeyBlock*)ptr->data;
+ float min, max, softmin, softmax;
- rna_ShapeKey_slider_min_range(ptr, &min, &max);
+ rna_ShapeKey_slider_min_range(ptr, &min, &max, &softmin, &softmax);
CLAMP(value, min, max);
data->slidermin = value;
}
-static void rna_ShapeKey_slider_max_range(PointerRNA *ptr, float *min, float *max)
+static void rna_ShapeKey_slider_max_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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;
- float min, max;
+ KeyBlock *data = (KeyBlock*)ptr->data;
+ float min, max, softmin, softmax;
- rna_ShapeKey_slider_max_range(ptr, &min, &max);
+ rna_ShapeKey_slider_max_range(ptr, &min, &max, &softmin, &softmax);
CLAMP(value, min, max);
data->slidermax = value;
}
@@ -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);
}
@@ -372,7 +372,7 @@ static KeyBlock *rna_ShapeKeyData_find_keyblock(Key *key, float *point)
if (ELEM(NULL, key, point))
return NULL;
- /* we'll need to manually search through the keyblocks and check
+ /* we'll need to manually search through the keyblocks and check
* if the point is somewhere in the middle of each block's data
*/
for (kb = key->block.first; kb; kb = kb->next) {
@@ -390,7 +390,7 @@ static KeyBlock *rna_ShapeKeyData_find_keyblock(Key *key, float *point)
return kb;
}
- /* determine where end of array is
+ /* determine where end of array is
* - elemsize is in bytes, so use char* cast to get array in terms of bytes
*/
end = (float *)((char *)start + (key->elemsize * kb->totelem));
@@ -408,7 +408,7 @@ static KeyBlock *rna_ShapeKeyData_find_keyblock(Key *key, float *point)
static int rna_ShapeKeyPoint_get_index(Key *key, KeyBlock *kb, float *point)
{
- /* if we frame the data array and point pointers as char*, then the difference between
+ /* if we frame the data array and point pointers as char*, then the difference between
* them will be in bytes. Thus, dividing through by key->elemsize (number of bytes per point)
* gives us the offset of point from start of array.
*/
@@ -426,7 +426,7 @@ static char *rna_ShapeKeyPoint_path(PointerRNA *ptr)
float *point = (float *)ptr->data;
/* if we can get a key block, we can construct a path */
- kb = rna_ShapeKeyData_find_keyblock(key, point);
+ kb = rna_ShapeKeyData_find_keyblock(key, point);
if (kb) {
int index = rna_ShapeKeyPoint_get_index(key, kb, point);
@@ -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,64 @@ 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 */
+ /* there's nothing type specific here, so this is fine for now */
+ 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");
- 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 */
+ /* there's nothing type specific here, so this is fine for now */
+ 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_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_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_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
- prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
+ /* 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,74 +518,77 @@ 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);
+ /* 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);
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_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", "");
- RNA_def_property_collection_funcs(prop, "rna_ShapeKey_data_begin", NULL, NULL, "rna_ShapeKey_data_get", "rna_ShapeKey_data_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_ShapeKey_data_begin", NULL, NULL, "rna_ShapeKey_data_get",
+ "rna_ShapeKey_data_length", NULL, NULL, NULL);
}
static void rna_def_key(BlenderRNA *brna)
@@ -587,37 +596,38 @@ 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");
+ RNA_def_property_ui_text(prop, "Slurph",
+ "Create a delay (in frames) in applying keypositions, first vertex goes first");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
}
@@ -629,4 +639,3 @@ void RNA_def_key(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
index 7de2d550875..671bee80523 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,81 @@ 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_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 +330,61 @@ 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_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 +410,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 +464,60 @@ 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_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_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_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 +527,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 +546,48 @@ 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_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");
@@ -594,9 +601,14 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
static EnumPropertyItem prop_shadbuftype_items[] = {
{LA_SHADBUF_REGULAR , "REGULAR", 0, "Classical", "Classic shadow buffer"},
- {LA_SHADBUF_HALFWAY, "HALFWAY", 0, "Classic-Halfway", "Regular buffer, averaging the closest and 2nd closest Z value to reducing bias artifacts"},
- {LA_SHADBUF_IRREGULAR, "IRREGULAR", 0, "Irregular", "Irregular buffer produces sharp shadow always, but it doesn't show up for raytracing"},
- {LA_SHADBUF_DEEP, "DEEP", 0, "Deep", "Deep shadow buffer supports transparency and better filtering, at the cost of more memory usage and processing time"},
+ {LA_SHADBUF_HALFWAY, "HALFWAY", 0, "Classic-Halfway",
+ "Regular buffer, averaging the closest and 2nd closest Z value to reducing "
+ "bias artifacts"},
+ {LA_SHADBUF_IRREGULAR, "IRREGULAR", 0, "Irregular",
+ "Irregular buffer produces sharp shadow always, but it doesn't show up for raytracing"},
+ {LA_SHADBUF_DEEP, "DEEP", 0, "Deep",
+ "Deep shadow buffer supports transparency and better filtering, at the cost of "
+ "more memory usage and processing time"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_shadbuffiltertype_items[] = {
@@ -611,7 +623,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 +631,120 @@ 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_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_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 */
+ /* only for deg/rad conversion */
+ RNA_def_property_float_funcs(prop, "rna_Lamp_spot_size_get", "rna_Lamp_spot_size_set", NULL);
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_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_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_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_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 +756,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 +764,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 +777,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);
@@ -775,4 +795,3 @@ void RNA_def_lamp(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c
index 9fe6b236961..5d8d8c7bd02 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,25 +218,27 @@ 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);
- 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);
+ 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 +254,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 +266,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 +274,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,43 +282,44 @@ 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_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");
/* pointers */
@@ -330,4 +333,3 @@ void RNA_def_lattice(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index dc1faa29be2..e616a632147 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);
}
@@ -257,8 +257,8 @@ static void rna_Main_movieclips_begin(CollectionPropertyIterator *iter, PointerR
static PointerRNA rna_Test_test_get(PointerRNA *ptr)
{
- PointerRNA ret= *ptr;
- ret.type= &RNA_Test;
+ PointerRNA ret = *ptr;
+ ret.type = &RNA_Test;
return ret;
}
@@ -286,17 +286,19 @@ 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},
{"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks", RNA_def_main_materials},
- {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks", RNA_def_main_node_groups},
+ {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks",
+ RNA_def_main_node_groups},
{"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks", RNA_def_main_meshes},
{"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks", RNA_def_main_lamps},
{"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks", RNA_def_main_libraries},
{"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks", RNA_def_main_screens},
- {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks", RNA_def_main_window_managers},
+ {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks",
+ RNA_def_main_window_managers},
{"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks", RNA_def_main_images},
{"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks", RNA_def_main_lattices},
{"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks", RNA_def_main_curves} ,
@@ -311,45 +313,52 @@ void RNA_def_main(BlenderRNA *brna)
{"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks", RNA_def_main_texts},
{"speakers", "Speaker", "rna_Main_speaker_begin", "Speakers", "Speaker datablocks", RNA_def_main_speakers},
{"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks", RNA_def_main_sounds},
- {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks", RNA_def_main_armatures},
+ {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks",
+ RNA_def_main_armatures},
{"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks", RNA_def_main_actions},
- {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks", RNA_def_main_particles},
- {"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks", RNA_def_main_gpencil},
- {"movieclips", "MovieClip", "rna_Main_movieclips_begin", "Movie Clips", "Movie Clip datablocks", RNA_def_main_movieclips},
+ {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks",
+ RNA_def_main_particles},
+ {"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks",
+ RNA_def_main_gpencil},
+ {"movieclips", "MovieClip", "rna_Main_movieclips_begin", "Movie Clips", "Movie Clip datablocks",
+ RNA_def_main_movieclips},
{NULL, NULL, NULL, NULL, NULL, NULL}};
int i;
- 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");
+ 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_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);
}
@@ -359,7 +368,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);
@@ -369,4 +378,3 @@ void RNA_def_main(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index a62da4c3f7e..92e65f26100 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.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 *****
@@ -97,13 +97,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",
@@ -118,20 +118,20 @@ Scene *rna_Main_scenes_new(Main *UNUSED(bmain), const char *name)
}
void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports, struct Scene *scene)
{
- /* dont call free_libblock(...) directly */
+ /* don't 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);
}
@@ -139,38 +139,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;
@@ -180,10 +180,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;
@@ -191,7 +191,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);
}
@@ -203,13 +203,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",
@@ -227,7 +227,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",
@@ -238,13 +238,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",
@@ -255,14 +255,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",
@@ -273,8 +273,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;
}
@@ -282,10 +282,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");
@@ -293,7 +293,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",
@@ -304,13 +304,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",
@@ -319,13 +319,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",
@@ -334,16 +334,16 @@ 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",
+ BKE_reportf(reports, RPT_ERROR, "Metaball \"%s\" must have zero users to be removed, found %d",
mb->id.name+2, ID_REAL_USERS(mb));
}
@@ -351,10 +351,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");
@@ -363,7 +363,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",
@@ -374,14 +374,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",
@@ -396,7 +396,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",
@@ -411,7 +411,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",
@@ -431,13 +431,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",
@@ -461,10 +461,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");
@@ -473,13 +473,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",
@@ -490,14 +490,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",
@@ -514,7 +514,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",
@@ -527,11 +527,12 @@ 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)
- BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unable to load movie clip");
+ if (!clip)
+ BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath,
+ errno ? strerror(errno) : "Unable to load movie clip");
return clip;
}
@@ -630,29 +631,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);
}
@@ -665,25 +666,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);
}
@@ -696,33 +697,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);
}
@@ -735,29 +736,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);
}
@@ -775,31 +776,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);
}
@@ -811,29 +812,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);
}
@@ -845,31 +846,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);
}
@@ -882,15 +883,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);
}
@@ -903,15 +904,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);
}
@@ -924,15 +925,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);
}
@@ -944,44 +945,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);
}
@@ -994,29 +995,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);
}
@@ -1028,31 +1029,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);
}
@@ -1064,29 +1065,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");
+ 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);
}
@@ -1098,30 +1099,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);
}
@@ -1133,31 +1134,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);
}
@@ -1169,29 +1170,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);
}
@@ -1204,29 +1205,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);
}
@@ -1239,28 +1240,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);
}
@@ -1273,29 +1274,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);
}
@@ -1308,38 +1309,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);
}
@@ -1352,17 +1353,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);
}
@@ -1375,29 +1376,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);
}
@@ -1409,29 +1410,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);
}
@@ -1443,29 +1444,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);
}
@@ -1478,15 +1479,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);
}
@@ -1498,29 +1499,28 @@ 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);
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 21b9c830435..7802241a25b 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -49,7 +49,8 @@ static EnumPropertyItem prop_texture_coordinates_items[] = {
{TEXCO_WINDOW, "WINDOW", 0, "Window", "Use screen coordinates as texture coordinates"},
{TEXCO_NORM, "NORMAL", 0, "Normal", "Use normal vector as texture coordinates"},
{TEXCO_REFL, "REFLECTION", 0, "Reflection", "Use reflection vector as texture coordinates"},
-{TEXCO_STRESS, "STRESS", 0, "Stress", "Use the difference of edge lengths compared to original coordinates of the mesh"},
+{TEXCO_STRESS, "STRESS", 0, "Stress",
+ "Use the difference of edge lengths compared to original coordinates of the mesh"},
{TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Use the optional tangent vector as texture coordinates"},
{0, NULL, 0, NULL, NULL}};
@@ -70,8 +71,8 @@ EnumPropertyItem ramp_blend_items[] = {
{MA_RAMP_SAT, "SATURATION", 0, "Saturation", ""},
{MA_RAMP_VAL, "VALUE", 0, "Value", ""},
{MA_RAMP_COLOR, "COLOR", 0, "Color", ""},
-{MA_RAMP_SOFT, "SOFT_LIGHT", 0, "Soft Light", ""},
-{MA_RAMP_LINEAR, "LINEAR_LIGHT", 0, "Linear Light", ""},
+{MA_RAMP_SOFT, "SOFT_LIGHT", 0, "Soft Light", ""},
+{MA_RAMP_LINEAR, "LINEAR_LIGHT", 0, "Linear Light", ""},
{0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
@@ -90,7 +91,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 +106,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 +144,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)
+static void rna_MaterialStrand_start_size_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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)
+static void rna_MaterialStrand_end_size_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- 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 +238,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 +254,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 +287,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 +310,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 +333,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 +358,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 */
@@ -419,8 +420,9 @@ static void rna_def_material_mtex(BlenderRNA *brna)
{MTEX_COMPAT_BUMP, "BUMP_COMPATIBLE", 0, "Compatible", ""},
{MTEX_3TAP_BUMP, "BUMP_LOW_QUALITY", 0, "Low Quality", "Use 3 tap filtering"},
{MTEX_5TAP_BUMP, "BUMP_MEDIUM_QUALITY", 0, "Medium Quality", "Use 5 tap filtering"},
- {MTEX_BICUBIC_BUMP, "BUMP_BEST_QUALITY", 0, "Best Quality", "Use bicubic filtering (requires OpenGL 3.0+, "
- "it will fall back on medium setting for other systems)"},
+ {MTEX_BICUBIC_BUMP, "BUMP_BEST_QUALITY", 0,
+ "Best Quality", "Use bicubic filtering (requires OpenGL 3.0+, it will fall back on "
+ "medium setting for other systems)"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_bump_space_items[] = {
@@ -429,299 +431,300 @@ 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");
+ "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 +732,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");
@@ -756,48 +759,50 @@ static void rna_def_material_gamesettings(BlenderRNA *brna)
{GEMAT_SOLID, "OPAQUE", 0, "Opaque", "Render color of textured face as color"},
{GEMAT_ADD, "ADD", 0, "Add", "Render face transparent and add color of face"},
{GEMAT_CLIP, "CLIP", 0, "Alpha Clip", "Use the image alpha values clipped with no blending (binary alpha)"},
- {GEMAT_ALPHA, "ALPHA", 0, "Alpha Blend", "Render polygon transparent, depending on alpha channel of the texture"},
- {GEMAT_ALPHA_SORT, "ALPHA_SORT", 0, "Alpha Sort", "Sort faces for correct alpha drawing (slow, use Alpha Clip instead when possible)"},
+ {GEMAT_ALPHA, "ALPHA", 0, "Alpha Blend",
+ "Render polygon transparent, depending on alpha channel of the texture"},
+ {GEMAT_ALPHA_SORT, "ALPHA_SORT", 0, "Alpha Sort",
+ "Sort faces for correct alpha drawing (slow, use Alpha Clip instead when possible)"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_face_orientation_items[] = {
{GEMAT_NORMAL,"NORMAL",0,"Normal","No tranformation"},
{GEMAT_HALO, "HALO", 0, "Halo", "Screen aligned billboard"},
{GEMAT_BILLBOARD, "BILLBOARD", 0, "Billboard", "Billboard with Z-axis constraint"},
- {GEMAT_SHADOW, "SHADOW", 0, "Shadow", "Faces are used for shadow"},
+ {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 +818,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 +921,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 +978,56 @@ 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");
+ "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 +1035,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 +1049,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 +1063,44 @@ 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");
+ 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 +1108,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 +1122,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 +1130,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 +1153,74 @@ 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_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");
+ "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 +1228,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 +1250,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,23 +1272,24 @@ 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");
+ RNA_def_property_ui_text(prop, "Asymmetry",
+ "Back scattering (-1.0) to Forward scattering (1.0) and the range in between");
RNA_def_property_update(prop, 0, "rna_Material_update");
}
@@ -1289,124 +1299,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 +1427,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 +1505,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 +1522,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 +1558,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 +1629,40 @@ 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");
+ "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 +1702,216 @@ 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");
+ "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_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)");
+ "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 +1919,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 +1994,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");
@@ -2005,7 +2019,8 @@ void RNA_def_material(BlenderRNA *brna)
}
-static void rna_def_texture_slots(BlenderRNA *brna, PropertyRNA *cprop, const char *structname, const char *structname_slots)
+static void rna_def_texture_slots(BlenderRNA *brna, PropertyRNA *cprop, const char *structname,
+ const char *structname_slots)
{
StructRNA *srna;
@@ -2013,26 +2028,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 +2058,23 @@ 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_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");
@@ -2066,5 +2082,3 @@ void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin,
}
#endif
-
-
diff --git a/source/blender/makesrna/intern/rna_material_api.c b/source/blender/makesrna/intern/rna_material_api.c
index f563f53744b..e6118f6c527 100644
--- a/source/blender/makesrna/intern/rna_material_api.c
+++ b/source/blender/makesrna/intern/rna_material_api.c
@@ -6,7 +6,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
@@ -20,7 +20,7 @@
* The Original Code is Copyright (C) 2009 Blender Foundation.
* All rights reserved.
*
- *
+ *
* Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
@@ -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 abf307e5f77..2421cebeaf3 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);
@@ -224,90 +225,92 @@ static float rna_MeshPolygon_area_get(PointerRNA *ptr)
return mesh_calc_poly_area(mp, me->mloop+mp->loopstart, me->mvert, NULL);
}
-static void rna_MeshFace_normal_get(PointerRNA *ptr, float *values)
+static void rna_MeshTessFace_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)
+static float rna_MeshTessFace_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[0] = (&mcol->r)[0] / 255.0f;
+ values[1] = (&mcol->r)[1] / 255.0f;
+ values[2] = (&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)[0] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255));
+ (&mcol->r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255));
+ (&mcol->r)[2] = (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);
}
@@ -463,45 +466,44 @@ static void rna_MeshVertex_groups_begin(CollectionPropertyIterator *iter, Pointe
rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL);
}
-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);
-}
-
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) - CustomData_get_layer_index(data, type);
- if(value == 0)
+ if (value == 0)
return;
- if(render) CustomData_set_layer_render_index(data, type, n);
- else CustomData_set_layer_active_index(data, type, n);
+ if (render) CustomData_set_layer_render(data, type, n);
+ else CustomData_set_layer_active(data, type, n);
+
+ /* sync loop layer */
+ if (type == CD_MTEXPOLY) {
+ CustomData *ldata = rna_mesh_ldata(ptr);
+ if (render) CustomData_set_layer_render(ldata, CD_MLOOPUV, n);
+ else CustomData_set_layer_active(ldata, CD_MLOOPUV, 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 +548,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 +590,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 +607,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 +649,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 +664,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(MCol) * 4, 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,8 +701,8 @@ 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;
- rna_iterator_array_begin(iter, layer->data, sizeof(CD_MLOOPCOL), me->totloop, 0, NULL);
+ CustomDataLayer *layer = (CustomDataLayer*)ptr->data;
+ rna_iterator_array_begin(iter, layer->data, sizeof(MLoopCol), me->totloop, 0, NULL);
}
static int rna_MeshLoopColorLayer_data_length(PointerRNA *ptr)
@@ -733,7 +735,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 +743,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 +755,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 +773,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 +793,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 +804,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 +824,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,29 +833,48 @@ 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)
+ if (id->us == 0)
id_us_plus(id);
else
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)
@@ -859,45 +883,45 @@ static float rna_Mesh_auto_smooth_angle_get(PointerRNA *ptr)
return DEG2RADF((float)me->smoothresh);
}
-static int rna_MeshFace_verts_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
+static int rna_MeshTessFace_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)
+static void rna_MeshTessFace_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)
+static void rna_MeshTessFace_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,47 +929,54 @@ 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;
}
}
+static void rna_MeshPoly_material_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
+{
+ Mesh *me = rna_mesh(ptr);
+ *min = 0;
+ *max = me->totcol-1;
+ *max = MAX2(0, *max);
+}
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)
+static int rna_MeshTessFace_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 +985,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;
@@ -971,9 +1002,9 @@ static char *rna_MeshPolygon_path(PointerRNA *ptr)
return BLI_sprintfN("polygons[%d]", (int)((MPoly*)ptr->data - rna_mesh(ptr)->mpoly));
}
-static char *rna_MeshFace_path(PointerRNA *ptr)
+static char *rna_MeshTessFace_path(PointerRNA *ptr)
{
- return BLI_sprintfN("faces[%d]", (int)((MFace*)ptr->data - rna_mesh(ptr)->mface));
+ return BLI_sprintfN("tessfaces[%d]", (int)((MFace *)ptr->data - rna_mesh(ptr)->mface));
}
static char *rna_MeshEdge_path(PointerRNA *ptr)
@@ -1009,10 +1040,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 +1058,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 +1076,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,18 +1172,47 @@ 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);
return ptr;
}
+static PointerRNA rna_Mesh_tessface_vertex_color_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 colors's in editmode");
+ return PointerRNA_NULL;
+ }
+
+ if (me->mpoly) {
+ BKE_report(reports, RPT_ERROR, "Can't add tessface colors's when MPoly's exist");
+ return PointerRNA_NULL;
+ }
+
+ index = ED_mesh_color_add(C, NULL, NULL, me, name, FALSE);
+
+ if (index != -1) {
+ fdata = rna_mesh_fdata_helper(me);
+ cdl = &fdata->layers[CustomData_get_layer_index_n(fdata, CD_MCOL, index)];
+ }
+
+ RNA_pointer_create(&me->id, &RNA_MeshColorLayer, cdl, &ptr);
+ return ptr;
+}
+
static PointerRNA rna_Mesh_int_property_new(struct Mesh *me, struct bContext *C, const char *name)
{
PointerRNA ptr;
@@ -1202,18 +1262,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_tessface_uv_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 +1313,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 +1321,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 +1338,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,57 +1387,57 @@ 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, "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");
@@ -1355,62 +1448,62 @@ static void rna_def_mface(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "MeshFace", NULL);
+ srna = RNA_def_struct(brna, "MeshTessFace", 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_text(srna, "Mesh TessFace", "TessFace in a Mesh datablock");
+ RNA_def_struct_path_func(srna, "rna_MeshTessFace_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");
- RNA_def_property_int_funcs(prop, "rna_MeshFace_verts_get", "rna_MeshFace_verts_set", NULL);
+ RNA_def_property_dynamic_array_funcs(prop, "rna_MeshTessFace_verts_get_length");
+ RNA_def_property_int_funcs(prop, "rna_MeshTessFace_verts_get", "rna_MeshTessFace_verts_set", NULL);
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_int_funcs(prop, NULL, NULL, "rna_MeshPoly_material_index_range"); /* reuse for tessface is ok */
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_MeshFace_normal_get", NULL, NULL);
+ RNA_def_property_float_funcs(prop, "rna_MeshTessFace_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_float_funcs(prop, "rna_MeshTessFace_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_int_funcs(prop, "rna_MeshTessFace_index_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Index", "Index number of the vertex");
}
@@ -1420,21 +1513,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");
@@ -1445,64 +1538,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 indicies, 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, don't 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_int_funcs(prop, NULL, NULL, "rna_MeshPoly_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");
@@ -1514,30 +1610,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", "");
}
@@ -1546,94 +1644,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");
@@ -1641,7 +1740,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");
@@ -1653,70 +1752,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");
@@ -1728,12 +1830,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");
}
@@ -1743,61 +1845,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);
@@ -1810,41 +1915,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);
@@ -1858,80 +1966,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_ui_text(srna, "Mesh Float Property Layer", "User defined layer of floating point 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");
@@ -1942,31 +2059,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", "");
@@ -1980,21 +2098,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
@@ -2004,49 +2122,49 @@ 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
}
/* mesh.faces */
-static void rna_def_mesh_faces(BlenderRNA *brna, PropertyRNA *cprop)
+static void rna_def_mesh_tessfaces(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
PropertyRNA *prop;
FunctionRNA *func;
-// PropertyRNA *parm;
+/* PropertyRNA *parm; */
- RNA_def_property_srna(cprop, "MeshFaces");
- srna= RNA_def_struct(brna, "MeshFaces", NULL);
+ RNA_def_property_srna(cprop, "MeshTessFaces");
+ srna = RNA_def_struct(brna, "MeshTessFaces", 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_tessfaces_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
@@ -2063,17 +2181,11 @@ 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);
- 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);
}
@@ -2086,18 +2198,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);
}
@@ -2109,22 +2221,33 @@ 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);
+
+ /* eventually deprecate this */
+ func = RNA_def_function(srna, "new", "rna_Mesh_tessface_vertex_color_new");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
+ 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", "MeshColorLayer", "", "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, "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");
}
@@ -2138,34 +2261,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");
}
@@ -2175,23 +2300,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");
}
@@ -2205,15 +2332,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);
}
@@ -2227,15 +2354,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);
}
@@ -2249,15 +2376,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);
}
@@ -2268,22 +2395,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_tessface_uv_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");
}
@@ -2298,34 +2437,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");
}
@@ -2335,53 +2476,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, "tessfaces", 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);
+ RNA_def_property_struct_type(prop, "MeshTessFace");
+ RNA_def_property_ui_text(prop, "TessFaces", "Tessellation faces of the mesh (derived from polygons)");
+ rna_def_mesh_tessfaces(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_property_ui_text(prop, "Loops", "Loops of the mesh (polygon corners)");
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);
@@ -2389,37 +2531,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);
@@ -2427,39 +2574,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);
@@ -2467,7 +2619,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);
@@ -2475,7 +2627,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);
@@ -2483,7 +2635,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);
@@ -2491,41 +2643,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");
@@ -2534,7 +2690,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);
@@ -2542,115 +2698,122 @@ 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_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 9bee359bbf5..41b232fdf8b 100644
--- a/source/blender/makesrna/intern/rna_mesh_api.c
+++ b/source/blender/makesrna/intern/rna_mesh_api.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 *****
@@ -57,30 +57,34 @@ 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, "calc_tessface", "ED_mesh_calc_tessface");
+ RNA_def_function_ui_description(func, "Calculate face tessellation (supports editmode too)");
+
+ 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..932a69680af 100644
--- a/source/blender/makesrna/intern/rna_mesh_utils.h
+++ b/source/blender/makesrna/intern/rna_mesh_utils.h
@@ -1,4 +1,4 @@
-/*
+/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -35,77 +35,112 @@
/* 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, \
+ int *softmin, int *softmax) \
+ { \
+ 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; \
+ int layer_index = CustomData_get_layer_index(data, layer_type); \
+ for (layer = data->layers, a = 0; layer_index + a < data->totlayer; layer++, a++) { \
+ if (value.data == layer) { \
+ CustomData_set_layer_##active_type(data, layer_type, a); \
+ \
+ /* keep loops in sync */ \
+ if (layer_type == CD_MTEXPOLY) { \
+ CustomData *ldata = rna_mesh_ldata_helper(me); \
+ CustomData_set_layer_##active_type(ldata, CD_MLOOPUV, 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); \
+ /* keep loops in sync */ \
+ if (layer_type == CD_MTEXPOLY) { \
+ CustomData *ldata = rna_mesh_ldata_helper(me); \
+ CustomData_set_layer_##active_type(ldata, CD_MLOOPUV, 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 5f33eac3e8f..5fb432c9e8f 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,12 +128,12 @@ 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) {
- BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" does not contain spline given", mb->id.name+2);
+ 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_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,56 @@ 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");
+ 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_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 +340,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 b448040e978..8b2bf6197dd 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -54,12 +54,13 @@
#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", ""},
{eModifierType_WeightVGMix, "VERTEX_WEIGHT_MIX", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Mix", ""},
- {eModifierType_WeightVGProximity, "VERTEX_WEIGHT_PROXIMITY", ICON_MOD_VERTEX_WEIGHT, "Vertex Weight Proximity", ""},
+ {eModifierType_WeightVGProximity, "VERTEX_WEIGHT_PROXIMITY", ICON_MOD_VERTEX_WEIGHT,
+ "Vertex Weight Proximity", ""},
{0, "", 0, "Generate", ""},
{eModifierType_Array, "ARRAY", ICON_MOD_ARRAY, "Array", ""},
{eModifierType_Bevel, "BEVEL", ICON_MOD_BEVEL, "Bevel", ""},
@@ -114,15 +115,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 +211,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,12 +222,12 @@ 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);
}
/* fix all the animation data which may link to this */
- BKE_all_animdata_fix_paths_rename("modifiers", oldname, md->name);
+ BKE_all_animdata_fix_paths_rename(NULL, "modifiers", oldname, md->name);
}
static char *rna_Modifier_path(PointerRNA *ptr)
@@ -248,32 +249,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 +286,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 +295,103 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
break;
}
- // update dependancy since a domain - other type switch could have happened
+ /* update dependency since a domain - other type switch could have happened */
rna_Modifier_dependency_update(bmain, scene, ptr);
}
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 +399,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 +416,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));
}
@@ -470,37 +470,37 @@ static void rna_WeightVGModifier_mask_uvlayer_set(PointerRNA *ptr, const char *v
}
}
-static void rna_MultiresModifier_level_range(PointerRNA *ptr, int *min, int *max)
+static void rna_MultiresModifier_level_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
MultiresModifierData *mmd = (MultiresModifierData*)ptr->data;
*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 +508,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 +568,16 @@ 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 +607,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 +671,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 +680,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 +689,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 +704,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 +739,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 +751,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");
@@ -784,30 +785,31 @@ static void rna_def_modifier_generic_map_info(StructRNA *srna)
static EnumPropertyItem prop_texture_coordinates_items[] = {
{MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Local", "Use the local coordinate system for the texture coordinates"},
{MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", "Use the global coordinate system for the texture coordinates"},
- {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", "Use the linked object's local coordinate system for the texture coordinates"},
+ {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object",
+ "Use the linked object's local coordinate system for the texture coordinates"},
{MOD_DISP_MAP_UV, "UV", 0, "UV", "Use UV coordinates for the texture coordinates"},
{0, NULL, 0, NULL, NULL}};
PropertyRNA *prop;
- 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 +832,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 +886,53 @@ 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");
+ 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);
- RNA_def_property_string_funcs(prop, "rna_MultiresModifier_filepath_get", "rna_MultiresModifier_filepath_length", "rna_MultiresModifier_filepath_set");
+ 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,22 +943,29 @@ 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_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");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ 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, 0, 1, 10, 2);
+ RNA_def_property_ui_text(prop, "Strength", "Strength of modifier effect");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
static void rna_def_modifier_curve(BlenderRNA *brna)
@@ -971,24 +982,25 @@ 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_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 +1012,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 +1045,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 +1109,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,120 +1132,123 @@ 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_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);
- RNA_def_property_ui_text(prop, "Narrowness", "Distance between the top and the base of a wave, the higher the value, the more narrow the wave");
+ RNA_def_property_ui_text(prop, "Narrowness",
+ "Distance between the top and the base of a wave, the higher the value, "
+ "the more narrow the wave");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
rna_def_modifier_generic_map_info(srna);
@@ -1244,44 +1259,46 @@ 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_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_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,35 +1309,37 @@ 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_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_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");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
@@ -1330,18 +1349,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);
@@ -1354,23 +1373,24 @@ static void rna_def_modifier_boolean(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_operation_items[] = {
- {eBooleanModifierOp_Intersect, "INTERSECT", 0, "Intersect", "Keep the part of the mesh that intersects with the other selected object"},
+ {eBooleanModifierOp_Intersect, "INTERSECT", 0, "Intersect",
+ "Keep the part of the mesh that intersects with the other selected object"},
{eBooleanModifierOp_Union, "UNION", 0, "Union", "Combine two meshes in an additive way"},
{eBooleanModifierOp_Difference, "DIFFERENCE", 0, "Difference", "Combine two meshes in a subtractive way"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "BooleanModifier", "Modifier");
+ 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");
@@ -1383,35 +1403,36 @@ static void rna_def_modifier_array(BlenderRNA *brna)
static EnumPropertyItem prop_fit_type_items[] = {
{MOD_ARR_FIXEDCOUNT, "FIXED_COUNT", 0, "Fixed Count", "Duplicate the object a certain number of times"},
- {MOD_ARR_FITLENGTH, "FIT_LENGTH", 0, "Fit Length", "Duplicate the object as many times as fits in a certain length"},
+ {MOD_ARR_FITLENGTH, "FIT_LENGTH", 0, "Fit Length",
+ "Duplicate the object as many times as fits in a certain length"},
{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 +1440,40 @@ 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_TRANSLATION causes units to be used which we don't want */
+ prop = RNA_def_property(srna, "relative_offset_displace", PROP_FLOAT, PROP_NONE);
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_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 +1481,27 @@ 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_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 +1513,31 @@ 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);
- RNA_def_property_float_funcs(prop, "rna_EdgeSplitModifier_split_angle_get", "rna_EdgeSplitModifier_split_angle_set", NULL);
+ 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");
@@ -1526,35 +1552,38 @@ static void rna_def_modifier_displace(BlenderRNA *brna)
{MOD_DISP_DIR_X, "X", 0, "X", "Use the texture's intensity value to displace in the X direction"},
{MOD_DISP_DIR_Y, "Y", 0, "Y", "Use the texture's intensity value to displace in the Y direction"},
{MOD_DISP_DIR_Z, "Z", 0, "Z", "Use the texture's intensity value to displace in the Z direction"},
- {MOD_DISP_DIR_NOR, "NORMAL", 0, "Normal", "Use the texture's intensity value to displace in the normal direction"},
- {MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ", "Use the texture's RGB values to displace the mesh in the XYZ direction"},
+ {MOD_DISP_DIR_NOR, "NORMAL", 0, "Normal",
+ "Use the texture's intensity value to displace in the normal direction"},
+ {MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ",
+ "Use the texture's RGB values to displace the mesh in the XYZ direction"},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "DisplaceModifier", "Modifier");
+ 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_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 +1596,72 @@ 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_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,42 +1674,43 @@ 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_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");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
@@ -1695,68 +1726,71 @@ 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);
- RNA_def_property_ui_text(prop, "Object", "Control object: if available, its location determines the center of the effect");
+ 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_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 +1808,48 @@ 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_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 +1861,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 +1884,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 +1965,47 @@ 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);
- RNA_def_property_string_funcs(prop, "rna_ExplodeModifier_vgroup_get", "rna_ExplodeModifier_vgroup_length", "rna_ExplodeModifier_vgroup_set");
+ 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 +2017,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 +2049,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 +2078,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 +2103,13 @@ static void rna_def_modifier_collision(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "CollisionModifier", "Modifier");
- RNA_def_struct_ui_text(srna, "Collision Modifier", "Collision modifier defining modifier stack position used for collision");
+ 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);
@@ -2086,7 +2124,9 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
static EnumPropertyItem prop_limit_method_items[] = {
{0, "NONE", 0, "None", "Bevel the entire mesh by a constant amount"},
{BME_BEVEL_ANGLE, "ANGLE", 0, "Angle", "Only bevel edges with sharp enough angles between faces"},
- {BME_BEVEL_WEIGHT, "WEIGHT", 0, "Weight", "Use bevel weights to determine how much bevel is applied; apply them separately in vert/edge select mode"},
+ {BME_BEVEL_WEIGHT, "WEIGHT", 0, "Weight",
+ "Use bevel weights to determine how much bevel is applied; "
+ "apply them separately in vert/edge select mode"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_edge_weight_method_items[] = {
@@ -2095,42 +2135,43 @@ 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);
- RNA_def_property_float_funcs(prop, "rna_BevelModifier_angle_limit_get", "rna_BevelModifier_angle_limit_set", NULL);
+ 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);
@@ -2138,17 +2179,18 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Angle", "Angle above which to bevel edges");
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 */
+#ifdef USE_BM_BEVEL_OP_AS_MOD
+ 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_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");
- /* END BMESH_BRANCH ONLY */
+#endif
}
@@ -2158,9 +2200,12 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem shrink_type_items[] = {
- {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACEPOINT", 0, "Nearest Surface Point", "Shrink the mesh to the nearest target surface"},
- {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", "Shrink the mesh to the nearest target surface along a given axis"},
- {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrink the mesh to the nearest target vertex"},
+ {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACEPOINT", 0, "Nearest Surface Point",
+ "Shrink the mesh to the nearest target surface"},
+ {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project",
+ "Shrink the mesh to the nearest target surface along a given axis"},
+ {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex",
+ "Shrink the mesh to the nearest target vertex"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem shrink_face_cull_items[] = {
@@ -2169,83 +2214,89 @@ 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");
- RNA_def_struct_ui_text(srna, "Shrinkwrap Modifier", "Shrink wrapping modifier to shrink wrap and object to a target");
+ 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_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_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_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 +2307,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 +2328,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");
@@ -2315,43 +2366,45 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna)
{MOD_SIMPLEDEFORM_MODE_TWIST, "TWIST", 0, "Twist", "Rotate around the Z axis of the modifier space"},
{MOD_SIMPLEDEFORM_MODE_BEND, "BEND", 0, "Bend", "Bend the mesh over the Z axis of the modifier space"},
{MOD_SIMPLEDEFORM_MODE_TAPER, "TAPER", 0, "Taper", "Linearly scale along Z axis of the modifier space"},
- {MOD_SIMPLEDEFORM_MODE_STRETCH, "STRETCH", 0, "Stretch", "Stretch the object along the Z axis of the modifier space"},
+ {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");
- RNA_def_struct_ui_text(srna, "SimpleDeform Modifier", "Simple deformation modifier to apply effects such as twisting and bending");
+ 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 +2412,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,8 +2427,9 @@ static void rna_def_modifier_surface(BlenderRNA *brna)
{
StructRNA *srna;
- 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");
+ 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 +2439,93 @@ static void rna_def_modifier_solidify(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- 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");
+ 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_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_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_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_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 +2535,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 +2544,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 +2633,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 +2692,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 +2741,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);
@@ -2706,55 +2766,56 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem weightvg_mix_set_items[] = {
- {MOD_WVG_SET_ALL, "ALL", 0, "All", "Affect all vertices (might add some to VGroup A)"},
- {MOD_WVG_SET_A, "A", 0, "VGroup A", "Affect vertices in VGroup A"},
- {MOD_WVG_SET_B, "B", 0, "VGroup B", "Affect vertices in VGroup B (might add some to VGroup A)"},
- {MOD_WVG_SET_OR, "OR", 0, "VGroup A or B", "Affect vertices in at least one of both VGroups (might add some to VGroup A)"},
- {MOD_WVG_SET_AND, "AND", 0, "VGroup A and B", "Affect vertices in both groups"},
+ {MOD_WVG_SET_ALL, "ALL", 0, "All", "Affect all vertices (might add some to VGroup A)"},
+ {MOD_WVG_SET_A, "A", 0, "VGroup A", "Affect vertices in VGroup A"},
+ {MOD_WVG_SET_B, "B", 0, "VGroup B", "Affect vertices in VGroup B (might add some to VGroup A)"},
+ {MOD_WVG_SET_OR, "OR", 0, "VGroup A or B",
+ "Affect vertices in at least one of both VGroups (might add some to VGroup A)"},
+ {MOD_WVG_SET_AND, "AND", 0, "VGroup A and B", "Affect vertices in both groups"},
{0, NULL, 0, NULL, NULL}};
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 +2855,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 +2884,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,50 +2913,57 @@ 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"},
+ {MOD_REMESH_SHARP_FEATURES, "SHARP", 0, "Sharp",
+ "Output a surface that reproduces sharp edges and corners from the input mesh"},
{0, NULL, 0, NULL, NULL}};
StructRNA *srna;
PropertyRNA *prop;
- 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");
+ 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_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_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_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 +2974,40 @@ static void rna_def_modifier_ocean(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem geometry_items[]= {
- {MOD_OCEAN_GEOM_GENERATE, "GENERATE", 0, "Generate", "Generate ocean surface geometry at the specified resolution"},
+ 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)"},
+#if 0
+ {MOD_OCEAN_GEOM_SIM_ONLY, "SIM_ONLY", 0, "Sim Only",
+ "Leaves geometry unchanged, but still runs simulation (to be used from texture)"},
+#endif
{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 +3015,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 +3023,20 @@ 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_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 +3044,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,59 +3158,61 @@ 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", "Realtime display of a modifier");
+ RNA_def_property_ui_text(prop, "Realtime", "Display modifier in realtime");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0);
- 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_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);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c
index a640f996b1a..ca06793cd49 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,12 +73,15 @@ 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"},
- {IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)", "Interpolate a global timestamp using the record date and time written by recording device"},
- {IMB_TC_RECORD_RUN_NO_GAPS, "FREE_RUN_NO_GAPS", 0, "Free Run No Gaps", "Record run, but ignore timecode, changes in framerate or dropouts"},
+ {IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)",
+ "Interpolate a global timestamp using the record date and time "
+ "written by recording device"},
+ {IMB_TC_RECORD_RUN_NO_GAPS, "FREE_RUN_NO_GAPS", 0, "Free Run No Gaps",
+ "Record run, but ignore timecode, changes in framerate or dropouts"},
{0, NULL, 0, NULL, NULL}};
srna = RNA_def_struct(brna, "MovieClipProxy", NULL);
@@ -86,70 +89,71 @@ 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");
+ 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 +161,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 +181,26 @@ 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);
- RNA_def_struct_ui_text(srna, "Movie Clip User", "Parameters defining how a MovieClip datablock is used by another datablock");
+ 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_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 +210,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 +220,40 @@ 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_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 +262,21 @@ 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_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..8d262c58f9b 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,16 +94,16 @@ 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
+ /* clamp value to lie within valid limits
* - cannot start past the end of the strip + some flexibility threshold
* - cannot start before the previous strip (if present) ends
* -> but if it was a transition, we could go up to the start 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,15 +124,15 @@ 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
+ * - must not have zero or negative length strip, so cannot start before the first frame
* + some minimum-strip-length threshold
* - cannot end later than the start of the next strip (if present)
* -> but if it was a transition, we could go up to the start of the end - some flexibility threshold
@@ -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,30 @@ 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;
+ /* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */
+ CLAMP(value, 0.0001f, 1000.0f);
+ data->scale = value;
/* adjust the strip extents in response to this */
BKE_nlastrip_recalculate_bounds(data);
@@ -182,11 +183,12 @@ 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;
+ /* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */
+ CLAMP(value, 0.01f, 1000.0f);
+ data->repeat = value;
/* adjust the strip extents in response to this */
BKE_nlastrip_recalculate_bounds(data);
@@ -194,30 +196,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 +247,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 +272,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 +285,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 */
@@ -294,7 +296,8 @@ static void rna_NlaStrip_animated_time_set(PointerRNA *ptr, int value)
data->flag &= ~NLASTRIP_FLAG_USR_TIME;
}
-static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *reports, const char *UNUSED(name), int start, bAction *action)
+static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *reports, const char *UNUSED(name),
+ int start, bAction *action)
{
NlaStrip *strip = add_nlastrip(action);
@@ -307,12 +310,13 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo
strip->start = start;
if (BKE_nlastrips_add_strip(&track->strips, strip) == 0) {
- BKE_reportf(reports, RPT_ERROR, "Unable to add strip. Track doesn't have any space to accommodate this new strip");
+ BKE_reportf(reports, RPT_ERROR,
+ "Unable to add strip. Track doesn't have any space to accommodate this new strip");
free_nlastrip(NULL, strip);
return NULL;
}
- /* create dummy AnimData block so that BKE_nlastrip_validate_name()
+ /* create dummy AnimData block so that BKE_nlastrip_validate_name()
* can be used to ensure a valid name, as we don't have one here...
* - only the nla_tracks list is needed there, which we aim to reverse engineer here...
*/
@@ -343,7 +347,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;
}
@@ -357,14 +361,18 @@ static void rna_NlaStrip_remove(NlaTrack *track, bContext *C, ReportList *report
/* enum defines exported for rna_animation.c */
EnumPropertyItem nla_mode_blend_items[] = {
- {NLASTRIP_MODE_REPLACE, "REPLACE", 0, "Replace", "Result strip replaces the accumulated results by amount specified by influence"},
+ {NLASTRIP_MODE_REPLACE, "REPLACE", 0, "Replace",
+ "Result strip replaces the accumulated results by amount specified by influence"},
{NLASTRIP_MODE_ADD, "ADD", 0, "Add", "Weighted result of strip is added to the accumulated results"},
- {NLASTRIP_MODE_SUBTRACT, "SUBTRACT", 0, "Subtract", "Weighted result of strip is removed from the accumulated results"},
- {NLASTRIP_MODE_MULTIPLY, "MULITPLY", 0, "Multiply", "Weighted result of strip is multiplied with the accumulated results"},
+ {NLASTRIP_MODE_SUBTRACT, "SUBTRACT", 0, "Subtract",
+ "Weighted result of strip is removed from the accumulated results"},
+ {NLASTRIP_MODE_MULTIPLY, "MULITPLY", 0, "Multiply",
+ "Weighted result of strip is multiplied with the accumulated results"},
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem nla_mode_extend_items[] = {
{NLASTRIP_EXTEND_NOTHING, "NOTHING", 0, "Nothing", "Strip has no influence past its extents"},
- {NLASTRIP_EXTEND_HOLD, "HOLD", 0, "Hold", "Hold the first frame if no previous strips in track, and always hold last frame"},
+ {NLASTRIP_EXTEND_HOLD, "HOLD", 0, "Hold",
+ "Hold the first frame if no previous strips in track, and always hold last frame"},
{NLASTRIP_EXTEND_HOLD_FORWARD, "HOLD_FORWARD", 0, "Hold Forward", "Only hold last frame"},
{0, NULL, 0, NULL, NULL}};
@@ -382,173 +390,185 @@ 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_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);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_editable_func(prop, "rna_NlaStrip_action_editable");
RNA_def_property_ui_text(prop, "Action", "Action referenced by this strip");
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);
- RNA_def_property_float_sdna(prop, NULL, "repeat");
+ 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... */
+ /* these limits have currently be chosen arbitarily, but could be extended
+ * (minimum should still be > 0 though) if needed... */
+ RNA_def_property_range(prop, 0.1f, 1000.0f);
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);
- RNA_def_property_float_sdna(prop, NULL, "scale");
+ 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 */
+ /* these limits can be extended, but beyond this, we can get some crazy+annoying bugs
+ * due to numeric errors */
+ RNA_def_property_range(prop, 0.0001f, 1000.0f);
RNA_def_property_ui_text(prop, "Scale", "Scaling factor for action");
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)");
+ 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_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_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);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */
+ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ /* can be made editable by hooking it up to the necessary NLA API methods */
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
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_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,16 +578,17 @@ 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);
+ 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);
parm = RNA_def_pointer(func, "action", "Action", "", "Action to assign to this strip");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
@@ -587,47 +608,51 @@ 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);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */
+ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ /* can be made editable by hooking it up to the necessary NLA API methods */
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
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);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */
+ prop = RNA_def_property(srna, "is_solo", PROP_BOOLEAN, PROP_NONE);
+ /* can be made editable by hooking it up to the necessary NLA API methods */
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
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_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 a6a8d9f9a35..b14f2b7fb90 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,37 +240,33 @@ 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; \
}
- if (sock->struct_type == SOCK_STRUCT_NONE) {
+ switch (sock->struct_type) {
+ case SOCK_STRUCT_NONE:
switch (sock->type) {
case SOCK_FLOAT:
NODE_DEFINE_SUBTYPES_FLOAT
- break;
+ break;
case SOCK_INT:
NODE_DEFINE_SUBTYPES_INT
- break;
+ break;
case SOCK_BOOLEAN:
return &RNA_NodeSocketBoolean;
- break;
case SOCK_VECTOR:
NODE_DEFINE_SUBTYPES_VECTOR
- break;
+ break;
case SOCK_RGBA:
return &RNA_NodeSocketRGBA;
- break;
case SOCK_SHADER:
return &RNA_NodeSocketShader;
}
- }
- else {
- switch (sock->struct_type) {
- case SOCK_STRUCT_OUTPUT_MULTI_FILE:
- return &RNA_NodeImageMultiFileSocket;
- }
+ break;
+ case SOCK_STRUCT_OUTPUT_FILE:
+ return &RNA_NodeImageFileSocket;
}
#undef SUBTYPE
@@ -281,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;
@@ -312,54 +308,36 @@ 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;
}
-static void rna_Image_start_frame_set(PointerRNA *ptr, int value)
-{
- bNode *node= (bNode*)ptr->data;
- NodeImageFile *image = node->storage;
-
- CLAMP(value, MINFRAME, image->efra);
- image->sfra= value;
-}
-
-static void rna_Image_end_frame_set(PointerRNA *ptr, int value)
-{
- bNode *node= (bNode*)ptr->data;
- NodeImageFile *image = node->storage;
-
- CLAMP(value, image->sfra, MAXFRAME);
- image->efra= value;
-}
-
static void rna_Node_scene_set(PointerRNA *ptr, PointerRNA value)
{
- bNode *node= (bNode*)ptr->data;
+ 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);
}
@@ -373,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);
@@ -390,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);
@@ -401,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);
@@ -411,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 */
@@ -423,13 +401,13 @@ static void rna_Node_name_set(PointerRNA *ptr, const char *value)
nodeUniqueName(ntree, node);
/* fix all the animation data which may link to this */
- BKE_all_animdata_fix_paths_rename("nodes", oldname, node->name);
+ BKE_all_animdata_fix_paths_rename(NULL, "nodes", oldname, node->name);
}
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))
@@ -438,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);
@@ -451,42 +429,42 @@ 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);
}
#endif
-static void rna_NodeSocketInt_range(PointerRNA *ptr, int *min, int *max)
+static void rna_NodeSocketInt_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- bNodeSocket *sock= (bNodeSocket*)ptr->data;
- bNodeSocketValueInt *val= (bNodeSocketValueInt*)sock->default_value;
- *min = val->min;
- *max = val->max;
+ bNodeSocket *sock = (bNodeSocket*)ptr->data;
+ bNodeSocketValueInt *val = (bNodeSocketValueInt*)sock->default_value;
+ *softmin = val->min;
+ *softmax = val->max;
}
-static void rna_NodeSocketFloat_range(PointerRNA *ptr, float *min, float *max)
+static void rna_NodeSocketFloat_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- bNodeSocket *sock= (bNodeSocket*)ptr->data;
- bNodeSocketValueFloat *val= (bNodeSocketValueFloat*)sock->default_value;
- *min = val->min;
- *max = val->max;
+ bNodeSocket *sock = (bNodeSocket*)ptr->data;
+ bNodeSocketValueFloat *val = (bNodeSocketValueFloat*)sock->default_value;
+ *softmin = val->min;
+ *softmax = val->max;
}
-static void rna_NodeSocketVector_range(PointerRNA *ptr, float *min, float *max)
+static void rna_NodeSocketVector_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
- bNodeSocket *sock= (bNodeSocket*)ptr->data;
- bNodeSocketValueVector *val= (bNodeSocketValueVector*)sock->default_value;
- *min = val->min;
- *max = val->max;
+ bNodeSocket *sock = (bNodeSocket*)ptr->data;
+ bNodeSocketValueVector *val = (bNodeSocketValueVector*)sock->default_value;
+ *softmin = val->min;
+ *softmax = 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);
@@ -496,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);
@@ -513,11 +491,12 @@ static EnumPropertyItem *renderresult_layers_add_enum(RenderLayer *rl)
return item;
}
-static EnumPropertyItem *rna_Node_image_layer_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
+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;
@@ -525,16 +504,17 @@ 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)
+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;
@@ -542,49 +522,50 @@ 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)
+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:
@@ -592,12 +573,13 @@ static EnumPropertyItem *rna_Node_channel_itemf(bContext *UNUSED(C), PointerRNA
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
-static bNode *rna_NodeTree_node_new(bNodeTree *ntree, bContext *UNUSED(C), ReportList *reports, int type, bNodeTree *group)
+static bNode *rna_NodeTree_node_new(bNodeTree *ntree, bContext *C, ReportList *reports,
+ int type, bNodeTree *group)
{
bNode *node;
bNodeTemplate ntemp;
@@ -609,6 +591,8 @@ static bNode *rna_NodeTree_node_new(bNodeTree *ntree, bContext *UNUSED(C), Repor
ntemp.type = type;
ntemp.ngroup = group;
+ ntemp.scene = CTX_data_scene(C);
+ ntemp.main = CTX_data_main(C);
node = nodeAddNode(ntree, &ntemp);
if (node == NULL) {
@@ -626,21 +610,22 @@ static bNode *rna_NodeTree_node_new(bNodeTree *ntree, bContext *UNUSED(C), Repor
return node;
}
-static bNode *rna_NodeTree_node_composite_new(bNodeTree *ntree, bContext *C, ReportList *reports, int type, bNodeTree *group)
+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);
}
@@ -651,10 +636,11 @@ static bNode *rna_NodeTree_node_composite_new(bNodeTree *ntree, bContext *C, Rep
return node;
}
-static bNode *rna_NodeTree_node_texture_new(bNodeTree *ntree, bContext *C, ReportList *reports, int type, bNodeTree *group)
+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);
@@ -681,17 +667,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*/
@@ -702,7 +688,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);
@@ -716,9 +702,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);
@@ -743,14 +729,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);
@@ -760,7 +746,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);
@@ -771,7 +757,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);
@@ -787,7 +773,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. */
@@ -811,7 +797,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. */
@@ -951,15 +937,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;
@@ -1038,7 +1024,7 @@ static void def_whileloop(StructRNA *srna)
static void def_frame(StructRNA *srna)
{
-// PropertyRNA *prop;
+/* PropertyRNA *prop; */
}
@@ -1187,37 +1173,38 @@ 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 */
+ /* Not PROP_XYZ, this is now in radians, no more degrees */
+ prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
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");
@@ -1256,12 +1243,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");
@@ -1285,11 +1272,21 @@ 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);
@@ -1299,20 +1296,29 @@ 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;
@@ -1327,7 +1333,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");
@@ -1341,7 +1347,8 @@ static void def_sh_tex_gradient(StructRNA *srna)
{SHD_BLEND_EASING, "EASING", 0, "Easing", "Create a progression easing from one step to the next"},
{SHD_BLEND_DIAGONAL, "DIAGONAL", 0, "Diagonal", "Create a diagonal progression"},
{SHD_BLEND_SPHERICAL, "SPHERICAL", 0, "Spherical", "Create a spherical progression"},
- {SHD_BLEND_QUADRATIC_SPHERE, "QUADRATIC_SPHERE", 0, "Quadratic sphere", "Create a quadratic progression in the shape of a sphere"},
+ {SHD_BLEND_QUADRATIC_SPHERE, "QUADRATIC_SPHERE", 0, "Quadratic sphere",
+ "Create a quadratic progression in the shape of a sphere"},
{SHD_BLEND_RADIAL, "RADIAL", 0, "Radial", "Create a radial progression"},
{0, NULL, 0, NULL, NULL}};
@@ -1350,7 +1357,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");
@@ -1375,7 +1382,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");
@@ -1397,7 +1404,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", "");
@@ -1416,7 +1423,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", "");
@@ -1435,7 +1442,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", "");
@@ -1459,7 +1466,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", "");
@@ -1652,7 +1659,8 @@ static void def_cmp_vector_blur(StructRNA *srna)
prop = RNA_def_property(srna, "speed_min", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "minspeed");
RNA_def_property_range(prop, 0, 1024);
- RNA_def_property_ui_text(prop, "Min Speed", "Minimum speed for a pixel to be blurred (used to separate background from foreground)");
+ RNA_def_property_ui_text(prop, "Min Speed",
+ "Minimum speed for a pixel to be blurred (used to separate background from foreground)");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "speed_max", PROP_INT, PROP_NONE);
@@ -1664,7 +1672,8 @@ static void def_cmp_vector_blur(StructRNA *srna)
prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fac");
RNA_def_property_range(prop, 0.0f, 2.0f);
- RNA_def_property_ui_text(prop, "Blur Factor", "Scaling factor for motion vectors (actually, 'shutter speed', in frames)");
+ RNA_def_property_ui_text(prop, "Blur Factor",
+ "Scaling factor for motion vectors (actually, 'shutter speed', in frames)");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "use_curved", PROP_BOOLEAN, PROP_NONE);
@@ -1723,13 +1732,16 @@ static void def_cmp_image(StructRNA *srna)
prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
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"); /* copied from the rna_image.c */
+ /* copied from the rna_image.c */
+ 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, NC_NODE|NA_EDITED, "rna_Node_update");
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"); /* copied from the rna_image.c */
+ /* copied from the rna_image.c */
+ RNA_def_property_ui_text(prop, "Offset", "Offset the number of the frame to use in the animation");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
@@ -1739,10 +1751,11 @@ static void def_cmp_image(StructRNA *srna)
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"); /* copied from the rna_image.c */
+ /* copied from the rna_image.c */
+ RNA_def_property_ui_text(prop, "Auto-Refresh", "Always refresh image on frame changes");
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");
@@ -1762,7 +1775,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");
@@ -1770,61 +1783,29 @@ static void def_cmp_render_layers(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
}
-static void def_cmp_output_file(StructRNA *srna)
-{
- PropertyRNA *prop;
-
- RNA_def_struct_sdna_from(srna, "NodeImageFile", "storage");
-
- prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
- RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "File Path", "Output path for the image, same functionality as render output");
- RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
-
- prop= RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE);
- RNA_def_property_flag(prop, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "im_format");
- RNA_def_property_struct_type(prop, "ImageFormatSettings");
- RNA_def_property_ui_text(prop, "Image Format", "");
-
- prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "sfra");
- RNA_def_property_int_funcs(prop, NULL, "rna_Image_start_frame_set", NULL);
- RNA_def_property_range(prop, MINFRAMEF, MAXFRAMEF);
- RNA_def_property_ui_text(prop, "Start Frame", "");
- RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
-
- prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "efra");
- RNA_def_property_int_funcs(prop, NULL, "rna_Image_end_frame_set", NULL);
- RNA_def_property_range(prop, MINFRAMEF, MAXFRAMEF);
- RNA_def_property_ui_text(prop, "End Frame", "");
- RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
-}
-
-static void rna_def_cmp_output_multi_file_socket(BlenderRNA *brna)
+static void rna_def_cmp_output_file_socket(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- srna = RNA_def_struct(brna, "NodeImageMultiFileSocket", "NodeSocketRGBA");
+ srna = RNA_def_struct(brna, "NodeImageFileSocket", "NodeSocketRGBA");
RNA_def_struct_sdna(srna, "bNodeSocket");
RNA_def_struct_path_func(srna, "rna_NodeSocket_path");
- RNA_def_struct_ui_text(srna, "Node Image Multi File Socket", "Socket data of multi file output node");
+ RNA_def_struct_ui_text(srna, "Node Image File Socket", "Socket data of file output node");
RNA_def_struct_ui_icon(srna, ICON_PLUG);
RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL);
RNA_def_struct_sdna_from(srna, "NodeImageMultiFileSocket", "storage");
- prop = RNA_def_property(srna, "use_render_format", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "use_render_format", 1);
- RNA_def_property_ui_text(prop, "Use Render Format", "");
+ prop = RNA_def_property(srna, "use_node_format", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "use_node_format", 1);
+ RNA_def_property_ui_text(prop, "Use Node Format", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_NodeSocket_update");
prop = RNA_def_property(srna, "format", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ImageFormatSettings");
}
-static void def_cmp_output_multi_file(StructRNA *srna)
+static void def_cmp_output_file(StructRNA *srna)
{
PropertyRNA *prop;
@@ -1845,6 +1826,9 @@ static void def_cmp_output_multi_file(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "active_input");
RNA_def_property_ui_text(prop, "Active Input Index", "Active input index in details view list");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "format", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "ImageFormatSettings");
}
static void def_cmp_dilate_erode(StructRNA *srna)
@@ -2113,7 +2097,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");
@@ -2211,7 +2195,8 @@ static void def_cmp_double_edge_mask(StructRNA * srna)
static EnumPropertyItem InnerEdgeMode_items[] = {
{0, "ALL", 0, "All", "All pixels on inner mask edge are considered during mask calculation"},
- {1, "ADJACENT_ONLY", 0, "Adjacent Only", "Only inner mask pixels adjacent to outer mask pixels are considered during mask calculation"},
+ {1, "ADJACENT_ONLY", 0, "Adjacent Only",
+ "Only inner mask pixels adjacent to outer mask pixels are considered during mask calculation"},
{0, NULL, 0, NULL, NULL}
};
@@ -2261,7 +2246,7 @@ static void def_cmp_defocus(StructRNA *srna)
RNA_def_property_ui_text(prop, "Bokeh Type", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- /* TODO: angle in degrees */
+ /* TODO: angle in degrees */
prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "rotation");
RNA_def_property_range(prop, 0.0f, DEG2RADF(90.0f));
@@ -2277,7 +2262,9 @@ static void def_cmp_defocus(StructRNA *srna)
prop = RNA_def_property(srna, "f_stop", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fstop");
RNA_def_property_range(prop, 0.0f, 128.0f);
- RNA_def_property_ui_text(prop, "fStop", "Amount of focal blur, 128=infinity=perfect focus, half the value doubles the blur radius");
+ RNA_def_property_ui_text(prop, "fStop",
+ "Amount of focal blur, 128=infinity=perfect focus, half the value doubles "
+ "the blur radius");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "blur_max", PROP_FLOAT, PROP_NONE);
@@ -2289,7 +2276,8 @@ static void def_cmp_defocus(StructRNA *srna)
prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bthresh");
RNA_def_property_range(prop, 0.0f, 100.0f);
- RNA_def_property_ui_text(prop, "Threshold", "CoC radius threshold, prevents background bleed on in-focus midground, 0=off");
+ RNA_def_property_ui_text(prop, "Threshold",
+ "CoC radius threshold, prevents background bleed on in-focus midground, 0=off");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "use_preview", PROP_BOOLEAN, PROP_NONE);
@@ -2305,13 +2293,17 @@ static void def_cmp_defocus(StructRNA *srna)
prop = RNA_def_property(srna, "use_zbuffer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "no_zbuf", 1);
- RNA_def_property_ui_text(prop, "Use Z-Buffer", "Disable when using an image as input instead of actual z-buffer (auto enabled if node not image based, eg. time node)");
+ RNA_def_property_ui_text(prop, "Use Z-Buffer",
+ "Disable when using an image as input instead of actual z-buffer "
+ "(auto enabled if node not image based, eg. time node)");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "z_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scale");
RNA_def_property_range(prop, 0.0f, 1000.0f);
- RNA_def_property_ui_text(prop, "Z-Scale", "Scale the Z input when not using a z-buffer, controls maximum blur designated by the color white or input value 1");
+ RNA_def_property_ui_text(prop, "Z-Scale",
+ "Scale the Z input when not using a z-buffer, controls maximum blur designated "
+ "by the color white or input value 1");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
}
@@ -2470,7 +2462,7 @@ static void def_cmp_bilateral_blur(StructRNA *srna)
prop = RNA_def_property(srna, "sigma_space", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sigma_space");
RNA_def_property_range(prop, 0.01f, 30.0f);
- RNA_def_property_ui_text(prop, "Space Sigma", "");
+ RNA_def_property_ui_text(prop, "Space Sigma", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
}
@@ -2519,7 +2511,9 @@ static void def_cmp_glare(StructRNA *srna)
prop = RNA_def_property(srna, "quality", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "quality");
RNA_def_property_enum_items(prop, quality_items);
- RNA_def_property_ui_text(prop, "Quality", "If not set to high quality, the effect will be applied to a low-res copy of the source image");
+ RNA_def_property_ui_text(prop, "Quality",
+ "If not set to high quality, the effect will be applied to a low-res copy "
+ "of the source image");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
@@ -2531,19 +2525,23 @@ static void def_cmp_glare(StructRNA *srna)
prop = RNA_def_property(srna, "color_modulation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colmod");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Color Modulation", "Amount of Color Modulation, modulates colors of streaks and ghosts for a spectral dispersion effect");
+ RNA_def_property_ui_text(prop, "Color Modulation",
+ "Amount of Color Modulation, modulates colors of streaks and ghosts for "
+ "a spectral dispersion effect");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "mix", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mix");
RNA_def_property_range(prop, -1.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Mix", "-1 is original image only, 0 is exact 50/50 mix, 1 is processed image only");
+ RNA_def_property_ui_text(prop, "Mix",
+ "-1 is original image only, 0 is exact 50/50 mix, 1 is processed image only");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "threshold");
RNA_def_property_range(prop, 0.0f, 1000.0f);
- RNA_def_property_ui_text(prop, "Threshold", "The glare filter will only be applied to pixels brighter than this value");
+ RNA_def_property_ui_text(prop, "Threshold",
+ "The glare filter will only be applied to pixels brighter than this value");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "streaks", PROP_INT, PROP_NONE);
@@ -2572,7 +2570,8 @@ static void def_cmp_glare(StructRNA *srna)
prop = RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "size");
RNA_def_property_range(prop, 6, 9);
- RNA_def_property_ui_text(prop, "Size", "Glow/glare size (not actual size; relative to initial size of bright area of pixels)");
+ RNA_def_property_ui_text(prop, "Size",
+ "Glow/glare size (not actual size; relative to initial size of bright area of pixels)");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
/* TODO */
@@ -2604,7 +2603,8 @@ static void def_cmp_tonemap(StructRNA *srna)
prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "offset");
RNA_def_property_range(prop, 0.001f, 10.0f);
- RNA_def_property_ui_text(prop, "Offset", "Normally always 1, but can be used as an extra control to alter the brightness curve");
+ RNA_def_property_ui_text(prop, "Offset",
+ "Normally always 1, but can be used as an extra control to alter the brightness curve");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
@@ -2646,7 +2646,8 @@ static void def_cmp_lensdist(StructRNA *srna)
prop = RNA_def_property(srna, "use_projector", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "proj", 1);
- RNA_def_property_ui_text(prop, "Projector", "Enable/disable projector mode (the effect is applied in horizontal direction only)");
+ RNA_def_property_ui_text(prop, "Projector",
+ "Enable/disable projector mode (the effect is applied in horizontal direction only)");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "use_jitter", PROP_BOOLEAN, PROP_NONE);
@@ -2656,7 +2657,8 @@ static void def_cmp_lensdist(StructRNA *srna)
prop = RNA_def_property(srna, "use_fit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "fit", 1);
- RNA_def_property_ui_text(prop, "Fit", "For positive distortion factor only: scale image such that black areas are not visible");
+ RNA_def_property_ui_text(prop, "Fit",
+ "For positive distortion factor only: scale image such that black areas are not visible");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
}
@@ -2666,8 +2668,8 @@ static void def_cmp_colorbalance(StructRNA *srna)
static float default_1[3] = {1.f, 1.f, 1.f};
static EnumPropertyItem type_items[] = {
- {0, "LIFT_GAMMA_GAIN", 0, "Lift/Gamma/Gain", ""},
- {1, "OFFSET_POWER_SLOPE", 0, "Offset/Power/Slope (ASC-CDL)", "ASC-CDL standard color correction"},
+ {0, "LIFT_GAMMA_GAIN", 0, "Lift/Gamma/Gain", ""},
+ {1, "OFFSET_POWER_SLOPE", 0, "Offset/Power/Slope (ASC-CDL)", "ASC-CDL standard color correction"},
{0, NULL, 0, NULL, NULL}};
prop = RNA_def_property(srna, "correction_method", PROP_ENUM, PROP_NONE);
@@ -2968,28 +2970,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");
}
@@ -3000,27 +3002,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");
}
@@ -3031,27 +3033,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");
}
@@ -3062,27 +3064,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");
}
@@ -3107,7 +3109,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");
@@ -3115,7 +3117,8 @@ static void rna_def_node_socket(BlenderRNA *brna)
prop = RNA_def_property(srna, "group_socket", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "groupsock");
RNA_def_property_struct_type(prop, "NodeSocket");
- RNA_def_property_ui_text(prop, "Group Socket", "For group nodes, the group input or output socket this corresponds to");
+ RNA_def_property_ui_text(prop, "Group Socket",
+ "For group nodes, the group input or output socket this corresponds to");
prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SOCK_COLLAPSED);
@@ -3126,8 +3129,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[] = {
@@ -3303,28 +3306,29 @@ 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);
}
@@ -3334,7 +3338,8 @@ static void rna_def_nodetree(BlenderRNA *brna)
PropertyRNA *prop;
srna = RNA_def_struct(brna, "NodeTree", "ID");
- RNA_def_struct_ui_text(srna, "Node Tree", "Node tree consisting of linked nodes used for shading, textures and compositing");
+ RNA_def_struct_ui_text(srna, "Node Tree",
+ "Node tree consisting of linked nodes used for shading, textures and compositing");
RNA_def_struct_sdna(srna, "bNodeTree");
RNA_def_struct_ui_icon(srna, ICON_NODETREE);
RNA_def_struct_refine_func(srna, "rna_NodeTree_refine");
@@ -3350,7 +3355,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");
@@ -3401,7 +3406,8 @@ static void rna_def_shader_nodetree(BlenderRNA *brna)
PropertyRNA *prop;
srna = RNA_def_struct(brna, "ShaderNodeTree", "NodeTree");
- RNA_def_struct_ui_text(srna, "Shader Node Tree", "Node tree consisting of linked nodes used for materials (and other shading datablocks)");
+ RNA_def_struct_ui_text(srna, "Shader Node Tree",
+ "Node tree consisting of linked nodes used for materials (and other shading datablocks)");
RNA_def_struct_sdna(srna, "bNodeTree");
RNA_def_struct_ui_icon(srna, ICON_NODETREE);
@@ -3437,7 +3443,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);
}
@@ -3450,7 +3456,8 @@ void RNA_def_nodetree(BlenderRNA *brna)
/* Generate RNA definitions for all socket subtypes */
#define SUBTYPE(socktype, stypename, id, idname) \
- rna_def_node_socket_subtype(brna, SOCK_##socktype, PROP_##id, "NodeSocket"#stypename#idname, #idname" "#stypename" Node Socket");
+ rna_def_node_socket_subtype(brna, SOCK_##socktype, PROP_##id, "NodeSocket"#stypename#idname, \
+ #idname" "#stypename" Node Socket");
NODE_DEFINE_SUBTYPES
#undef SUBTYPE
rna_def_node_socket_subtype(brna, SOCK_BOOLEAN, 0, "NodeSocketBoolean", "Boolean Node Socket");
@@ -3477,7 +3484,7 @@ void RNA_def_nodetree(BlenderRNA *brna)
define_specific_node(brna, NODE_FRAME, def_frame);
/* special socket types */
- rna_def_cmp_output_multi_file_socket(brna);
+ rna_def_cmp_output_file_socket(brna);
}
/* clean up macro definition */
diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h
index b336f864012..745a956d831 100644
--- a/source/blender/makesrna/intern/rna_nodetree_types.h
+++ b/source/blender/makesrna/intern/rna_nodetree_types.h
@@ -113,7 +113,6 @@ DefNode( CompositorNode, CMP_NODE_IMAGE, def_cmp_image, "IMAGE
DefNode( CompositorNode, CMP_NODE_R_LAYERS, def_cmp_render_layers, "R_LAYERS", RLayers, "Render Layers", "" )
DefNode( CompositorNode, CMP_NODE_COMPOSITE, 0, "COMPOSITE", Composite, "Composite", "" )
DefNode( CompositorNode, CMP_NODE_OUTPUT_FILE, def_cmp_output_file, "OUTPUT_FILE", OutputFile, "Output File", "" )
-DefNode( CompositorNode, CMP_NODE_OUTPUT_MULTI_FILE, def_cmp_output_multi_file, "OUTPUT_MULTI_FILE", OutputMultiFile, "Output Multi File", "" )
DefNode( CompositorNode, CMP_NODE_TEXTURE, def_texture, "TEXTURE", Texture, "Texture", "" )
DefNode( CompositorNode, CMP_NODE_TRANSLATE, 0, "TRANSLATE", Translate, "Translate", "" )
DefNode( CompositorNode, CMP_NODE_ZCOMBINE, def_cmp_zcombine, "ZCOMBINE", Zcombine, "Z Combine", "" )
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index ed443f47eb3..d06dfdb8e7f 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -46,6 +46,8 @@
#include "DNA_scene_types.h"
#include "DNA_meta_types.h"
+#include "BLI_utildefines.h"
+
#include "BKE_tessmesh.h"
#include "BKE_group.h" /* needed for object_in_group() */
@@ -71,7 +73,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 +87,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}};
@@ -161,16 +163,16 @@ static void rna_Object_internal_update(Main *UNUSED(bmain), Scene *UNUSED(scene)
static void rna_Object_matrix_world_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- /* dont use compat so we get predictable rotation */
+ /* don't use compat so we get predictable rotation */
object_apply_mat4(ptr->id.data, ((Object *)ptr->id.data)->obmat, FALSE, TRUE);
rna_Object_internal_update(bmain, scene, ptr);
}
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 +184,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);
@@ -196,19 +198,19 @@ static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16])
copy_m4_m4(ob->obmat, (float(*)[4])values);
}
- /* dont use compat so we get predictable rotation */
+ /* don't use compat so we get predictable rotation */
object_apply_mat4(ob, ob->obmat, FALSE, FALSE);
}
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 +222,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);
+ EDBM_mesh_load(ob);
+ EDBM_mesh_make(scene->toolsettings, scene, ob);
+ BMEdit_RecalcTessellation(((Mesh*)ob->data)->edit_btmesh);
break;
case OB_CURVE:
case OB_SURF:
@@ -257,7 +260,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 +268,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 +276,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 +294,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 +339,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 +380,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 +396,33 @@ 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)
+ /* special hack: prevents this overriding others */
+ RNA_enum_items_add_value(&item, &totitem, &parent_type_items[4], PARSKEL);
+ else if (par->type == OB_ARMATURE) {
+ /* special hack: prevents this being overrided */
+ RNA_enum_items_add_value(&item, &totitem, &parent_type_items[3], PARSKEL);
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 +430,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 +446,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,
@@ -464,202 +469,203 @@ static void rna_Object_dup_group_set(PointerRNA *ptr, PointerRNA value)
if (object_in_group(ob, grp) == 0)
ob->dup_group = grp;
else
- BKE_report(NULL, RPT_ERROR, "Cannot set dupli-group as object belongs in group being instanced thus causing a cycle");
+ BKE_report(NULL, RPT_ERROR,
+ "Cannot set dupli-group as object belongs in group being instanced thus causing a cycle");
}
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)
+static void rna_Object_active_vertex_group_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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)
+static void rna_Object_active_material_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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);
}
-static void rna_Object_active_particle_system_index_range(PointerRNA *ptr, int *min, int *max)
+static void rna_Object_active_particle_system_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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 +673,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 +732,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 +747,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 +762,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 +783,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 +838,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,26 +863,33 @@ 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)) {
if (ob->gameflag & OB_OCCLUDER) {
ob->body_type = OB_BODY_TYPE_OCCLUDER;
- } else if (ob->gameflag & OB_NAVMESH){
+ }
+ else if (ob->gameflag & OB_NAVMESH) {
ob->body_type = OB_BODY_TYPE_NAVMESH;
- } else {
+ }
+ else {
ob->body_type = OB_BODY_TYPE_NO_COLLISION;
}
- } else if (ob->gameflag & OB_SENSOR) {
+ }
+ else if (ob->gameflag & OB_SENSOR) {
ob->body_type = OB_BODY_TYPE_SENSOR;
- } else if (!(ob->gameflag & OB_DYNAMIC)) {
+ }
+ else if (!(ob->gameflag & OB_DYNAMIC)) {
ob->body_type = OB_BODY_TYPE_STATIC;
- } else if (!(ob->gameflag & (OB_RIGID_BODY|OB_SOFT_BODY))) {
+ }
+ else if (!(ob->gameflag & (OB_RIGID_BODY|OB_SOFT_BODY))) {
ob->body_type = OB_BODY_TYPE_DYNAMIC;
- } else if (ob->gameflag & OB_RIGID_BODY) {
+ }
+ else if (ob->gameflag & OB_RIGID_BODY) {
ob->body_type = OB_BODY_TYPE_RIGID;
- } else {
+ }
+ else {
ob->body_type = OB_BODY_TYPE_SOFT;
/* create the structure here because we display soft body buttons in the main panel */
if (!ob->bsoft)
@@ -888,9 +901,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 +946,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 +967,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 +980,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,151 +1000,151 @@ 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;
}
}
}
-static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, int *max)
+static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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 +1156,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;
}
@@ -1165,7 +1177,8 @@ static void rna_Object_constraints_clear(Object *object)
WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, object);
}
-static ModifierData *rna_Object_modifier_new(Object *object, bContext *C, ReportList *reports, const char *name, int type)
+static ModifierData *rna_Object_modifier_new(Object *object, bContext *C, ReportList *reports,
+ const char *name, int type)
{
return ED_object_modifier_add(reports, CTX_data_main(C), CTX_data_scene(C), object, name, type);
}
@@ -1186,9 +1199,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 +1238,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 +1253,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,10 +1268,10 @@ 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;
+ return weight;
}
/* generic poll functions */
@@ -1289,7 +1302,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 +1317,53 @@ 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] */
+ /* update data because modifiers may use [#24761] */
+ RNA_def_property_update(prop, NC_GEOM|ND_DATA|NA_RENAME, "rna_Object_internal_update_data");
- 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] */
+ /* update data because modifiers may use [#24761] */
+ RNA_def_property_update(prop, NC_GEOM|ND_DATA|NA_RENAME, "rna_Object_internal_update_data");
- 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 +1381,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);
@@ -1402,12 +1417,13 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
{OB_BODY_TYPE_RIGID, "RIGID_BODY", 0, "Rigid Body", "Linear and angular physics"},
{OB_BODY_TYPE_SOFT, "SOFT_BODY", 0, "Soft Body", "Soft body"},
{OB_BODY_TYPE_OCCLUDER, "OCCLUDE", 0, "Occlude", "Occluder for optimizing scene rendering"},
- {OB_BODY_TYPE_SENSOR, "SENSOR", 0, "Sensor",
- "Collision Sensor, detects static and dynamic objects but not the other collision sensor objects"},
+ {OB_BODY_TYPE_SENSOR, "SENSOR", 0, "Sensor",
+ "Collision Sensor, detects static and dynamic objects but not the other "
+ "collision sensor objects"},
{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 +1431,211 @@ 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_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");
+ "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,37 +1650,38 @@ 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_pointer_funcs(prop, "rna_Object_active_constraint_get",
+ "rna_Object_active_constraint_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Constraint", "Active Object constraint");
/* 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 +1694,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 +1745,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,38 +1780,39 @@ 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",
+ RNA_def_property_int_funcs(prop, "rna_Object_active_vertex_group_index_get",
+ "rna_Object_active_vertex_group_index_set",
"rna_Object_active_vertex_group_index_range");
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");
}
@@ -1829,10 +1849,11 @@ static void rna_def_object(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem drawtype_items[] = {
- {OB_BOUNDBOX, "BOUNDS", 0, "Bounds", "Draw the bounding box of the object"},
+ {OB_BOUNDBOX, "BOUNDS", 0, "Bounds", "Draw the bounds of the object"},
{OB_WIRE, "WIRE", 0, "Wire", "Draw the object as a wireframe"},
{OB_SOLID, "SOLID", 0, "Solid", "Draw the object as a solid (if solid drawing is enabled in the viewport)"},
- {OB_TEXTURE, "TEXTURED", 0, "Textured", "Draw the object with textures (if textures are enabled in the viewport)"},
+ {OB_TEXTURE, "TEXTURED", 0, "Textured",
+ "Draw the object with textures (if textures are enabled in the viewport)"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem boundtype_items[] = {
@@ -1850,7 +1871,8 @@ 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 +1888,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,48 +1922,50 @@ 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);
RNA_def_property_ui_text(prop, "Bounding Box",
- "Object's bounding box in object-space coordinates, all values are -1.0 when not available");
+ "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 +1973,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 +1982,29 @@ 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! */
+ /* don't dereference pointer! */
+ RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL, NULL);
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_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 +2013,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,28 +2030,29 @@ 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_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");
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_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 +2060,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 +2069,35 @@ 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);
+ /* FIXME: this is not a single field any more! (drotAxis and drotAngle) */
+ RNA_def_property_float_sdna(prop, NULL, "dquat");
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 +2105,34 @@ 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 +2140,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 +2164,109 @@ 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");
+ 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 +2279,143 @@ 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_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_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_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,39 +2423,40 @@ 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_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_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 +2468,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 +2503,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..09e7d1d9be5 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.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 *****
@@ -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);
@@ -155,22 +155,23 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
/* copies the data */
tmpmesh = copy_mesh( ob->data );
/* if not getting the original caged mesh, get final derived mesh */
- } else {
+ }
+ else {
/* Make a dummy mesh, saves copying */
DerivedMesh *dm;
/* CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL; */
CustomDataMask mask = CD_MASK_MESH; /* this seems more suitable, exporter,
- for example, needs CD_MASK_MDEFORMVERT */
+ * for example, needs CD_MASK_MDEFORMVERT */
/* Write the display mesh into the dummy mesh */
if (render)
- dm = mesh_create_derived_render( sce, ob, mask );
+ dm = mesh_create_derived_render(sce, ob, mask);
else
- dm = mesh_create_derived_view( sce, ob, mask );
+ dm = mesh_create_derived_view(sce, ob, mask);
- tmpmesh = add_mesh( "Mesh" );
- DM_to_mesh( dm, tmpmesh, ob );
- dm->release( dm );
+ tmpmesh = add_mesh("Mesh");
+ DM_to_mesh(dm, tmpmesh, ob);
+ dm->release(dm);
}
break;
@@ -184,11 +185,11 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
case OB_SURF:
case OB_FONT:
case OB_CURVE:
- tmpmesh->totcol = tmpcu->totcol;
+ 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 +208,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 +221,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 +265,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 +309,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 +323,17 @@ 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)
+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,8 +352,9 @@ int rna_Object_is_visible(Object *ob, Scene *sce)
return !(ob->restrictflag & OB_RESTRICT_VIEW) && (ob->lay & sce->lay);
}
-/*
-static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int *indices, int totindex, float weight, int assignmode)
+#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) {
BKE_report(reports, RPT_ERROR, "Object should be of MESH type");
@@ -370,13 +373,13 @@ static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int
return;
}
- // makes a set of dVerts corresponding to the mVerts
- if (!me->dvert)
+ /* 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 +387,15 @@ 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)
+/* BMESH_TODO, return polygon index, not tessface */
+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 +403,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 +412,15 @@ 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,23 +428,26 @@ 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)
+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) {
- BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for finding nearest point", ob->id.name+2);
+ 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;
}
/* 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) {
- BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for finding nearest point", ob->id.name+2);
+ 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;
}
else {
@@ -447,24 +456,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 +490,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);
@@ -527,124 +536,129 @@ void RNA_api_object(StructRNA *srna)
static EnumPropertyItem mesh_dm_info_items[] = {
{0, "SOURCE", 0, "Source", "Source mesh"},
{1, "DEFORM", 0, "Deform", "Objects deform mesh"},
- {2, "FINAL", 0, "Final", "Objects final mesh"},
+ {2, "FINAL", 0, "Final", "Objects final mesh"},
{0, NULL, 0, NULL, NULL}
};
#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 +670,10 @@ void RNA_api_object_base(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- 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", "", "");
+ 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", "", "");
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..7a4361d1504 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)
+static void rna_Cache_active_point_cache_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
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;
}
@@ -289,21 +289,21 @@ static void rna_Cache_active_point_cache_index_set(struct PointerRNA *ptr, int v
BLI_freelistN(&pidlist);
}
-static void rna_PointCache_frame_step_range(PointerRNA *ptr, int *min, int *max)
+static void rna_PointCache_frame_step_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
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;
@@ -568,9 +570,10 @@ static char *rna_FieldSettings_path(PointerRNA *ptr)
return BLI_sprintfN("force_field_1");
else if (part->pd2 == pd)
return BLI_sprintfN("force_field_2");
- } else {
+ }
+ 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 +602,15 @@ 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;
+ }
+ else {
+ Object *ob = (Object*)ptr->id.data;
ModifierData *md;
/* check softbody modifier */
@@ -643,10 +647,10 @@ 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);
+ return BLI_sprintfN("modifiers[\"%s\"].canvas_settings.canvas_surfaces[\"%s\"]"
+ ".effector_weights", md->name, surface->name);
}
}
}
@@ -656,13 +660,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 +674,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 +682,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 +692,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,16 +727,17 @@ 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);
- RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", "rna_Cache_active_point_cache_index_set",
+ 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", "");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change");
@@ -749,94 +754,95 @@ 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_iterator_listbase_end", "rna_iterator_listbase_get",
+ NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_ui_text(prop, "Point Cache List", "Point cache list");
rna_def_ptcache_point_caches(brna, prop);
@@ -847,54 +853,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 +908,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 +939,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 +965,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);
@@ -1060,12 +1066,14 @@ static void rna_def_field(BlenderRNA *brna)
{0, "NONE", 0, "None", ""},
{PFIELD_FORCE, "FORCE", ICON_FORCE_FORCE, "Force", "Radial field toward the center of object"},
{PFIELD_WIND, "WIND", ICON_FORCE_WIND, "Wind", "Constant force along the force object's local Z axis"},
- {PFIELD_VORTEX, "VORTEX", ICON_FORCE_VORTEX, "Vortex", "Spiraling force that twists the force object's local Z axis"},
+ {PFIELD_VORTEX, "VORTEX", ICON_FORCE_VORTEX, "Vortex",
+ "Spiraling force that twists the force object's local Z axis"},
{PFIELD_MAGNET, "MAGNET", ICON_FORCE_MAGNETIC, "Magnetic", "Forcefield depends on the speed of the particles"},
{PFIELD_HARMONIC, "HARMONIC", ICON_FORCE_HARMONIC, "Harmonic",
"The source of this force field is the zero point of a harmonic oscillator"},
{PFIELD_CHARGE, "CHARGE", ICON_FORCE_CHARGE, "Charge",
- "Spherical forcefield based on the charge of particles, only influences other charge force fields"},
+ "Spherical forcefield based on the charge of particles, "
+ "only influences other charge force fields"},
{PFIELD_LENNARDJ, "LENNARDJ", ICON_FORCE_LENNARDJONES, "Lennard-Jones",
"Forcefield based on the Lennard-Jones potential"},
{PFIELD_TEXTURE, "TEXTURE", ICON_FORCE_TEXTURE, "Texture", "Forcefield based on a texture"},
@@ -1109,7 +1117,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 +1125,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 +1151,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 +1159,178 @@ 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_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 +1338,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 +1376,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 +1415,35 @@ 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");
+ 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");
+ 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 +1453,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 +1486,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 +1502,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 +1542,41 @@ 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_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_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 +1584,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 +1639,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 +1667,50 @@ 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");
+ "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");
+ "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 +1720,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 +1739,51 @@ 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);
- RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_stiff_quads_get", "rna_SoftBodySettings_stiff_quads_set");
+ 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);
- RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_edge_collision_get", "rna_SoftBodySettings_edge_collision_set");
+ 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);
- RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_face_collision_get", "rna_SoftBodySettings_face_collision_set");
+ 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);
- RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_self_collision_get", "rna_SoftBodySettings_self_collision_set");
+ 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..18bbf2bca12 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -132,18 +132,19 @@ EnumPropertyItem part_hair_ren_as_items[] = {
#include "BKE_texture.h"
/* use for object space hair get/set */
-static void rna_ParticleHairKey_location_object_info(PointerRNA *ptr, ParticleSystemModifierData **psmd_pt, ParticleData **pa_pt)
+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 +160,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 +182,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 +210,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 +242,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 +290,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 +300,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 +334,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 +351,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 +365,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 +373,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 +395,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 +410,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 +427,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;
@@ -469,17 +470,17 @@ static float rna_PartSetting_linelentail_get(struct PointerRNA *ptr)
ParticleSettings *settings = (ParticleSettings*)ptr->data;
return settings->draw_line[0];
}
-static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, float *max)
+static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
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,49 +498,50 @@ 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));
- BLI_uniquename(&ob->particlesystem, part, "ParticleSystem", '.', offsetof(ParticleSystem, name), sizeof(part->name));
+ BLI_uniquename(&ob->particlesystem, part, "ParticleSystem", '.', offsetof(ParticleSystem, name),
+ sizeof(part->name));
}
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)
+static void rna_ParticleSystem_active_particle_target_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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 +549,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 +562,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 +589,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 +616,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 +625,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 +636,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)
+static void rna_ParticleDupliWeight_active_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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 +689,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,47 +712,51 @@ 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");
}
-static EnumPropertyItem *rna_Particle_from_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *UNUSED(free))
+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;
}
-static EnumPropertyItem *rna_Particle_dist_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
+static EnumPropertyItem *rna_Particle_dist_itemf(bContext *UNUSED(C), PointerRNA *ptr,
+ PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
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;
}
-static EnumPropertyItem *rna_Particle_draw_as_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
+static EnumPropertyItem *rna_Particle_draw_as_itemf(bContext *UNUSED(C), PointerRNA *ptr,
+ PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
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;
}
-static EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
+static EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *UNUSED(C), PointerRNA *ptr,
+ PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
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 +764,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 +816,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,21 +912,24 @@ 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);
+ 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");
+ RNA_def_property_ui_text(prop, "Location",
+ "Location of the hair key in its internal coordinate system, "
+ "relative to the emitting face");
}
static void rna_def_particle_key(BlenderRNA *brna)
@@ -931,40 +940,41 @@ 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");
+ 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 +983,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 +996,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,15 +1096,17 @@ 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);
- RNA_def_property_string_funcs(prop, "rna_ParticleDupliWeight_name_get", "rna_ParticleDupliWeight_name_length", NULL);
+ 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_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 +1120,65 @@ 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_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_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_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_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 +1186,22 @@ 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_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,36 +1209,39 @@ 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);
- RNA_def_property_ui_text(prop, "Buoyancy", "Artificial buoyancy force in negative gravity direction based on pressure differences inside the fluid");
+ RNA_def_property_ui_text(prop, "Buoyancy",
+ "Artificial buoyancy force in negative gravity direction based on pressure "
+ "differences inside the fluid");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* 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_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");
@@ -1237,7 +1257,8 @@ static void rna_def_particle_settings_mtex(BlenderRNA *brna)
{TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"},
{TEXCO_UV, "UV", 0, "UV", "Use UV coordinates for texture coordinates"},
{TEXCO_ORCO, "ORCO", 0, "Generated", "Use the original undeformed coordinates of the object"},
- {TEXCO_STRAND, "STRAND", 0, "Strand / Particle", "Use normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"},
+ {TEXCO_STRAND, "STRAND", 0, "Strand / Particle",
+ "Use normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_mapping_items[] = {
@@ -1268,183 +1289,185 @@ 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");
+ 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_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 +1481,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}
};
@@ -1487,7 +1510,12 @@ static void rna_def_particle_settings(BlenderRNA *brna)
static EnumPropertyItem ave_mode_items[] = {
{0, "NONE", 0, "None", ""},
- {PART_AVE_SPIN, "SPIN", 0, "Spin", ""},
+ {PART_AVE_VELOCITY, "VELOCITY", 0, "Velocity", ""},
+ {PART_AVE_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", ""},
+ {PART_AVE_VERTICAL, "VERTICAL", 0, "Vertical", ""},
+ {PART_AVE_GLOBAL_X, "GLOBAL_X", 0, "Global X", ""},
+ {PART_AVE_GLOBAL_Y, "GLOBAL_Y", 0, "Global Y", ""},
+ {PART_AVE_GLOBAL_Z, "GLOBAL_Z", 0, "Global Z", ""},
{PART_AVE_RAND, "RAND", 0, "Random", ""} ,
{0, NULL, 0, NULL, NULL}
};
@@ -1506,7 +1534,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,137 +1599,145 @@ 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);
rna_def_mtex_common(brna, srna, "rna_ParticleSettings_mtex_begin", "rna_ParticleSettings_active_texture_get",
- "rna_ParticleSettings_active_texture_set", NULL, "ParticleSettingsTextureSlot", "ParticleSettingsTextureSlots", "rna_Particle_reset");
+ "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_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_rotations", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ROTATIONS);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_ui_text(prop, "Rotations", "Calculate particle rotations");
+ RNA_def_property_update(prop, 0, "rna_Particle_reset");
+
+ 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_ui_text(prop, "Dynamic", "Particle rotations are effected by collisions and effectors");
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 +1745,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 +1755,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_ui_text(prop, "Orientation axis", "Particle orientation axis (does not affect Explode modifier's results)");
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_ui_text(prop, "Angular Velocity Axis", "What axis is used to change particle rotation with time");
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 +1784,234 @@ 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_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 +2019,62 @@ 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");
+ 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 +2083,65 @@ 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);
- 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))");
+ 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_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 +2152,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 +2167,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,87 +2181,90 @@ 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_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);
RNA_def_property_ui_range(prop, -100, 100, 1, 3);
- RNA_def_property_ui_text(prop, "Object Aligned", "Let the emitter object orientation give the particle a starting speed");
+ 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_ui_text(prop, "Angular Velocity", "Angular velocity amount (in radians per second)");
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_ui_text(prop, "Phase", "Rotation around the chosen orientation axis");
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_ui_text(prop, "Random Orientation", "Randomize particle orientation");
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_ui_text(prop, "Random Phase", "Randomize rotation around the chosen orientation axis");
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 +2272,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 +2293,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 +2379,152 @@ 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_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_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 +2532,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 +2540,37 @@ 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);
- RNA_def_property_int_funcs(prop, "rna_ParticleDupliWeight_active_index_get", "rna_ParticleDupliWeight_active_index_set", "rna_ParticleDupliWeight_active_index_range");
+ 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 +2578,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", "");
+ 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 +2598,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 +2627,43 @@ 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_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 +2676,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 +2688,46 @@ 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);
- RNA_def_property_ui_text(prop, "Child Seed", "Offset in the random number table for child particles, to get a different randomized result");
+ 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 +2735,56 @@ 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_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_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);
- 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");
+ 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 +2792,175 @@ 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 isn't 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);
- RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_0", "rna_ParticleVGroup_name_len_0", "rna_ParticleVGroup_name_set_0");
+ 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);
- RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_1", "rna_ParticleVGroup_name_len_1", "rna_ParticleVGroup_name_set_1");
+ 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);
- RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_2", "rna_ParticleVGroup_name_len_2", "rna_ParticleVGroup_name_set_2");
+ 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);
- RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_3", "rna_ParticleVGroup_name_len_3", "rna_ParticleVGroup_name_set_3");
+ 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);
- RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_4", "rna_ParticleVGroup_name_len_4", "rna_ParticleVGroup_name_set_4");
+ 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);
- RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_5", "rna_ParticleVGroup_name_len_5", "rna_ParticleVGroup_name_set_5");
+ 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_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);
- RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_6", "rna_ParticleVGroup_name_len_6", "rna_ParticleVGroup_name_set_6");
+ 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_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);
- RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_7", "rna_ParticleVGroup_name_len_7", "rna_ParticleVGroup_name_set_7");
+ 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_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);
- RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_8", "rna_ParticleVGroup_name_len_8", "rna_ParticleVGroup_name_set_8");
+ 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);
- RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_9", "rna_ParticleVGroup_name_len_9", "rna_ParticleVGroup_name_set_9");
+ 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);
- RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_10", "rna_ParticleVGroup_name_len_10", "rna_ParticleVGroup_name_set_10");
+ 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);
- RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_11", "rna_ParticleVGroup_name_len_11", "rna_ParticleVGroup_name_set_11");
+ 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_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 +2968,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 +2988,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..b6153162fc7 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -45,7 +45,8 @@
-// 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 +87,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 +108,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,22 +120,19 @@ 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));
}
else {
- /* init custom colors with a generic multi-color rgb set, if not initialised already (for custom color set) */
+ /* init custom colors with a generic multi-color rgb set, if not initialized 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;
-
- SETCOL(grp->cs.solid, 0xff, 0x00, 0x00, 255);
- SETCOL(grp->cs.select, 0x81, 0xe6, 0x14, 255);
- SETCOL(grp->cs.active, 0x18, 0xb6, 0xe0, 255);
-
- #undef SETCOL
+ rgba_char_args_set(grp->cs.solid, 0xff, 0x00, 0x00, 255);
+ rgba_char_args_set(grp->cs.select, 0x81, 0xe6, 0x14, 255);
+ rgba_char_args_set(grp->cs.active, 0x18, 0xb6, 0xe0, 255);
}
}
}
@@ -142,8 +140,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 +151,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 +163,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 +179,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 +195,41 @@ 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);
+ 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 +241,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 +261,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 +304,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 +328,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)
+static void rna_PoseChannel_bone_group_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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)
+static void rna_Pose_active_bone_group_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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 +510,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 +534,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 +549,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 +564,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 +585,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 +598,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,32 +652,33 @@ 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 :) */
+ /* NOTE: the DNA data is not really a pointer, but this code works :) */
+ RNA_def_property_pointer_sdna(prop, NULL, "cs");
RNA_def_property_ui_text(prop, "Colors", "Copy of the colors associated with the group's color set");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
}
@@ -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,89 @@ 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
+ /* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
+ 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, "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
+ /* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
+ 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, "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
+ /* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
+ RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
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
+ /* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
+ 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, "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
+ /* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
+ RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
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
+ /* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
+ RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
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,157 +860,158 @@ 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);
- RNA_def_property_ui_text(prop, "Pose Matrix", "Final 4x4 matrix after constraints and drivers are applied (object space)");
+ RNA_def_property_ui_text(prop, "Pose Matrix",
+ "Final 4x4 matrix after constraints and drivers are applied (object space)");
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 +1019,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,16 +1028,17 @@ 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);
- RNA_def_property_ui_text(prop, "Custom Shape Transform", "Bone that defines the display transform of this custom shape");
+ RNA_def_property_ui_text(prop, "Custom Shape Transform",
+ "Bone that defines the display transform of this custom shape");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
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,16 +1048,17 @@ 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);
+ RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_bone_group_get",
+ "rna_PoseChannel_bone_group_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Bone Group", "Bone Group this pose channel belongs to");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
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 +1066,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 +1074,9 @@ 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 +1084,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,16 +1105,18 @@ 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"},
+ "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"},
+ "The solver reiterates (converges) on the first frame but not on "
+ "subsequent frame"},
{ITASC_INITIAL_REITERATION|ITASC_REITERATION, "ALWAYS", 0, "Always",
"The solver reiterates (converges) on all frames"},
{0, NULL, 0, NULL, NULL}};
@@ -1112,35 +1124,36 @@ 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_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 +1161,46 @@ 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");
+ "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)");
+ "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 +1208,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,16 +1222,17 @@ 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);
- RNA_def_property_ui_text(prop, "IK Solver", "IK solver for which these parameters are defined, 0 for Legacy, 1 for iTaSC");
+ RNA_def_property_ui_text(prop, "IK Solver",
+ "IK solver for which these parameters are defined, 0 for Legacy, 1 for iTaSC");
}
/* pose.bone_groups */
@@ -1225,22 +1241,23 @@ 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_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 +1271,27 @@ 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 */
+ /* can be removed, only for fast lookup */
+ RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, "rna_PoseBones_lookup_string", NULL);
+
/* 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 +1299,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..14f7b7c74f5 100644
--- a/source/blender/makesrna/intern/rna_pose_api.c
+++ b/source/blender/makesrna/intern/rna_pose_api.c
@@ -1,11 +1,11 @@
/*
- *
+ *
* ***** 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.
+ * 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
@@ -19,7 +19,7 @@
* The Original Code is Copyright (C) 2009 Blender Foundation.
* All rights reserved.
*
- *
+ *
* Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
@@ -53,7 +53,8 @@ static float rna_PoseBone_do_envelope(bPoseChannel *chan, float *vec)
float scale = (bone->flag & BONE_MULT_VG_ENV) == BONE_MULT_VG_ENV ? bone->weight : 1.0f;
- return distfactor_to_bone(vec, chan->pose_head, chan->pose_tail, bone->rad_head * scale, bone->rad_tail * scale, bone->dist * scale);
+ return distfactor_to_bone(vec, chan->pose_head, chan->pose_tail, bone->rad_head * scale,
+ bone->rad_tail * scale, bone->dist * scale);
}
#else
@@ -68,13 +69,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..3eac129a195 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..22e9bbf6dda 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);
@@ -143,50 +143,51 @@ static void rna_RenderEngine_unregister(Main *UNUSED(bmain), StructRNA *type)
RNA_struct_free(&BLENDER_RNA, type);
}
-static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
+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));
+ 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 +202,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 +270,32 @@ 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");
+ 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 +308,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,29 +387,32 @@ 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",
- "Filename to load into this render tile, must be no smaller than the render result");
+ 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);
+ 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);
RNA_define_verify_sdna(1);
}
@@ -418,13 +423,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 +441,13 @@ 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);
+ 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 +461,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 +490,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 +530,4 @@ 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..e9f35debe72 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -129,6 +129,16 @@ static int rna_Struct_name_length(PointerRNA *ptr)
return strlen(((StructRNA*)ptr->data)->name);
}
+static void rna_Struct_translation_context_get(PointerRNA *ptr, char *value)
+{
+ strcpy(value, ((StructRNA*)ptr->data)->translation_context ? ((StructRNA*)ptr->data)->translation_context : "");
+}
+
+static int rna_Struct_translation_context_length(PointerRNA *ptr)
+{
+ return ((StructRNA*)ptr->data)->translation_context ? strlen(((StructRNA*)ptr->data)->translation_context) : 0;
+}
+
static PointerRNA rna_Struct_base_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((StructRNA*)ptr->data)->base);
@@ -150,24 +160,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 +186,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 +196,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);
@@ -204,7 +214,8 @@ static void rna_inheritance_next_level_restart(CollectionPropertyIterator *iter,
}
}
-static void rna_inheritance_properties_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
+static void rna_inheritance_properties_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb,
+ IteratorSkipFunc skip)
{
rna_iterator_listbase_begin(iter, lb, skip);
rna_inheritance_next_level_restart(iter, skip, 0);
@@ -216,7 +227,8 @@ static void rna_inheritance_properties_listbase_next(CollectionPropertyIterator
rna_inheritance_next_level_restart(iter, skip, 0);
}
-static void rna_inheritance_functions_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
+static void rna_inheritance_functions_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb,
+ IteratorSkipFunc skip)
{
rna_iterator_listbase_begin(iter, lb, skip);
rna_inheritance_next_level_restart(iter, skip, 1);
@@ -230,10 +242,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 +254,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 +272,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 +284,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 +301,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 +313,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 +329,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 +357,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 +420,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 +438,355 @@ 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
+ /* don't 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)
+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 +800,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 +848,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 +873,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 +914,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 +944,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 +956,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,54 +975,65 @@ 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, "translation_context", PROP_STRING, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_string_funcs(prop, "rna_Struct_translation_context_get",
+ "rna_Struct_translation_context_length", NULL);
+ RNA_def_property_ui_text(prop, "Translation Context", "Translation context of the struct's name");
+
+ 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");
+ 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_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);
+ 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);
RNA_def_property_ui_text(prop, "Functions", "");
}
@@ -1040,107 +1064,109 @@ 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");
+ 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's name");
- 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");
+ 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,52 +1177,56 @@ 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_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");
+ 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)");
+ RNA_def_property_ui_text(prop, "No Self",
+ "Function does not pass its self as an argument (becomes a class method in python)");
}
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 +1241,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 +1263,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 +1313,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 +1333,50 @@ 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_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_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_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 +1386,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,61 +1408,64 @@ 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");
- RNA_def_struct_ui_text(srna, "Enum Definition", "RNA enumeration property definition, to choose from a number of predefined options");
+ 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");
- RNA_def_struct_ui_text(srna, "Collection Definition", "RNA collection property to define lists, arrays and mappings");
+ 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);
/* Function */
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",
+ RNA_def_property_collection_funcs(prop, "rna_BlenderRNA_structs_begin", "rna_iterator_listbase_next",
+ "rna_iterator_listbase_end", "rna_iterator_listbase_get",
/* included for speed, can be removed */
#if 0
- 0,0,0,0);
+ NULL, NULL, NULL, NULL);
#else
- "rna_BlenderRNA_structs_length", "rna_BlenderRNA_structs_lookup_int", "rna_BlenderRNA_structs_lookup_string", NULL);
+ "rna_BlenderRNA_structs_length", "rna_BlenderRNA_structs_lookup_int",
+ "rna_BlenderRNA_structs_lookup_string", NULL);
#endif
RNA_def_property_ui_text(prop, "Structs", "");
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index ea4ba6139d3..94bcda6a1e1 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -54,7 +54,7 @@
#ifdef WITH_FFMPEG
#include "BKE_writeffmpeg.h"
-#include <libavcodec/avcodec.h>
+#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#endif
@@ -84,7 +84,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"},
@@ -98,7 +98,8 @@ EnumPropertyItem proportional_falloff_items[] ={
EnumPropertyItem proportional_editing_items[] = {
{PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", "Proportional Editing disabled"},
{PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", "Proportional Editing enabled"},
- {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", "Proportional Editing using connected geometry only"},
+ {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected",
+ "Proportional Editing using connected geometry only"},
{0, NULL, 0, NULL, NULL}};
/* keep for operators, not used here */
@@ -122,11 +123,13 @@ EnumPropertyItem snap_element_items[] = {
*/
#define R_IMF_ENUM_BMP {R_IMF_IMTYPE_BMP, "BMP", ICON_FILE_IMAGE, "BMP", "Output image in bitmap format"},
-#define R_IMF_ENUM_IRIS {R_IMF_IMTYPE_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", "Output image in (old!) SGI IRIS format"},
+#define R_IMF_ENUM_IRIS {R_IMF_IMTYPE_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", \
+ "Output image in (old!) SGI IRIS format"},
#define R_IMF_ENUM_PNG {R_IMF_IMTYPE_PNG, "PNG", ICON_FILE_IMAGE, "PNG", "Output image in PNG format"},
#define R_IMF_ENUM_JPEG {R_IMF_IMTYPE_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", "Output image in JPEG format"},
#define R_IMF_ENUM_TAGA {R_IMF_IMTYPE_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", "Output image in Targa format"},
-#define R_IMF_ENUM_TAGA_RAW {R_IMF_IMTYPE_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", "Output image in uncompressed Targa format"},
+#define R_IMF_ENUM_TAGA_RAW {R_IMF_IMTYPE_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", \
+ "Output image in uncompressed Targa format"},
#ifdef WITH_DDS
@@ -136,13 +139,15 @@ EnumPropertyItem snap_element_items[] = {
#endif
#ifdef WITH_OPENJPEG
-# define R_IMF_ENUM_JPEG2K {R_IMF_IMTYPE_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", "Output image in JPEG 2000 format"},
+# define R_IMF_ENUM_JPEG2K {R_IMF_IMTYPE_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", \
+ "Output image in JPEG 2000 format"},
#else
# define R_IMF_ENUM_JPEG2K
#endif
#ifdef WITH_CINEON
-# define R_IMF_ENUM_CINEON {R_IMF_IMTYPE_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", "Output image in Cineon format"},
+# define R_IMF_ENUM_CINEON {R_IMF_IMTYPE_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", \
+ "Output image in Cineon format"},
# define R_IMF_ENUM_DPX {R_IMF_IMTYPE_DPX, "DPX",ICON_FILE_IMAGE, "DPX", "Output image in DPX format"},
#else
# define R_IMF_ENUM_CINEON
@@ -150,15 +155,19 @@ EnumPropertyItem snap_element_items[] = {
#endif
#ifdef WITH_OPENEXR
-# define R_IMF_ENUM_EXR_MULTI {R_IMF_IMTYPE_MULTILAYER, "OPEN_EXR_MULTILAYER", ICON_FILE_IMAGE, "OpenEXR MultiLayer", "Output image in multilayer OpenEXR format"},
-# define R_IMF_ENUM_EXR {R_IMF_IMTYPE_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", "Output image in OpenEXR format"},
+# define R_IMF_ENUM_EXR_MULTI {R_IMF_IMTYPE_MULTILAYER, "OPEN_EXR_MULTILAYER", ICON_FILE_IMAGE, \
+ "OpenEXR MultiLayer", \
+ "Output image in multilayer OpenEXR format"},
+# define R_IMF_ENUM_EXR {R_IMF_IMTYPE_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", \
+ "Output image in OpenEXR format"},
#else
# define R_IMF_ENUM_EXR_MULTI
# define R_IMF_ENUM_EXR
#endif
#ifdef WITH_HDR
-# define R_IMF_ENUM_HDR {R_IMF_IMTYPE_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", "Output image in Radiance HDR format"},
+# define R_IMF_ENUM_HDR {R_IMF_IMTYPE_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", \
+ "Output image in Radiance HDR format"},
#else
# define R_IMF_ENUM_HDR
#endif
@@ -192,7 +201,7 @@ EnumPropertyItem image_only_type_items[] = {
IMAGE_TYPE_ITEMS_IMAGE_ONLY
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}};
EnumPropertyItem image_type_items[] = {
{0, "", 0, "Image", NULL},
@@ -201,7 +210,8 @@ 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
+ /* XXX Missing codec menu */
+ {R_IMF_IMTYPE_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", "Output video in AVI format"},
#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"},
@@ -225,7 +235,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)"},
@@ -291,12 +301,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;
}
}
@@ -306,7 +316,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);
@@ -314,7 +324,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)) {
@@ -322,15 +332,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;
+ /* when linking to an inactive scene don't touch the layer */
+ if (scene == scene_act)
+ ob->lay = base->lay;
ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
@@ -344,17 +354,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);
@@ -362,7 +372,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);
@@ -372,7 +382,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;
@@ -380,43 +390,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);
+}
+
+static int rna_Scene_active_layer_get(PointerRNA *ptr)
+{
+ Scene *scene = (Scene*)ptr->data;
- scene->lay= ED_view3d_scene_layer_set(scene->lay, values, &scene->layact);
+ 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);
}
@@ -440,52 +457,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, 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, 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;
@@ -497,84 +522,84 @@ 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
* - active_keyingset-1 since 0 is reserved for 'none'
- * - don't clamp, otherwise can never set builtins types as active...
+ * - don't clamp, otherwise can never set builtins types as active...
*/
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;
}
/* get KeyingSet index stuff for list of Keying Sets editing UI
* - value+1 since 0 is reserved for 'none'
*/
-static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
+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
+ /* start going over the scene KeyingSets first, while we still have pointer to it
* but only if we have any Keying Sets to use...
*/
if (scene->keyingsets.first)
@@ -585,16 +610,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);
}
@@ -605,9 +630,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();
@@ -615,14 +640,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;
@@ -630,34 +655,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,
@@ -666,9 +691,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;
}
}
@@ -676,8 +701,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
@@ -691,7 +716,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;
}
@@ -703,22 +728,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;
@@ -731,15 +756,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;
}
@@ -748,22 +773,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) {
@@ -776,8 +801,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 {
@@ -787,8 +812,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 {
@@ -797,7 +822,7 @@ static EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf(bContext *C,
}
RNA_enum_item_end(&item, &totitem);
- *free= 1;
+ *free = 1;
return item;
}
@@ -805,17 +830,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);
}
@@ -837,28 +862,28 @@ 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;
+ return item;
}
#ifdef USE_QTKIT
@@ -879,26 +904,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;
-}
+ return item;
+}
#endif
#endif
@@ -927,28 +952,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)
+static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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);
@@ -956,28 +981,30 @@ 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);
return srl;
}
-static void rna_RenderLayer_remove(ID *id, RenderData *UNUSED(rd), Main *bmain, ReportList *reports, SceneRenderLayer *srl)
+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);
+ BKE_reportf(reports, RPT_ERROR, "RenderLayer '%s' could not be removed from scene '%s'",
+ srl->name, scene->id.name+2);
}
else {
WM_main_add_notifier(NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -986,10 +1013,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));
}
@@ -997,31 +1024,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;
@@ -1034,7 +1061,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);
}
@@ -1042,15 +1069,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);
@@ -1066,18 +1093,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);
}
}
@@ -1091,17 +1118,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;
@@ -1109,49 +1136,51 @@ 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)
+static void rna_SceneRenderLayer_pass_update(Main *bmain, Scene *activescene, PointerRNA *ptr)
{
- Scene *scene= (Scene*)ptr->id.data;
+ Scene *scene = (Scene*)ptr->id.data;
- if(scene->nodetree)
+ if (scene->nodetree)
ntreeCompositForceHidden(scene->nodetree, scene);
+
+ rna_Scene_glsl_update(bmain, activescene, ptr);
}
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);
+ 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);
}
}
@@ -1160,12 +1189,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);
@@ -1177,17 +1206,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);
}
}
@@ -1197,7 +1226,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);
@@ -1206,21 +1235,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;
@@ -1230,25 +1259,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;
}
@@ -1264,7 +1292,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;
@@ -1274,15 +1302,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);
@@ -1314,15 +1342,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 {
@@ -1338,7 +1366,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)
@@ -1347,7 +1375,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
@@ -1357,8 +1385,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);
}
@@ -1366,10 +1394,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);
}
@@ -1380,16 +1408,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);
@@ -1407,8 +1435,8 @@ static void rna_def_tool_settings(BlenderRNA *brna)
{UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"},
{0, NULL, 0, NULL, NULL}};
- /* the construction of this enum is quite special - everything is stored as bitflags,
- * with 1st position only for for on/off (and exposed as boolean), while others are mutually
+ /* the construction of this enum is quite special - everything is stored as bitflags,
+ * with 1st position only for for on/off (and exposed as boolean), while others are mutually
* exclusive options but which will only have any effect when autokey is enabled
*/
static EnumPropertyItem auto_key_items[] = {
@@ -1438,10 +1466,10 @@ static void rna_def_tool_settings(BlenderRNA *brna)
{EDGE_MODE_TAG_BEVEL, "BEVEL", 0, "Tag Bevel", ""},
{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", "");
@@ -1459,124 +1487,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);
@@ -1585,138 +1613,139 @@ static void rna_def_tool_settings(BlenderRNA *brna)
/* Grease Pencil */
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_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... */
/* 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);
@@ -1727,54 +1756,56 @@ 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");
+ 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");
}
static void rna_def_unit_settings(BlenderRNA *brna)
@@ -1793,29 +1824,29 @@ 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");
+ RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs (e.g. 1m 0cm)");
RNA_def_property_update(prop, NC_WINDOW, NULL);
}
@@ -1823,325 +1854,327 @@ 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");
+ 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");
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, "rna_Scene_glsl_update");
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, "rna_Scene_glsl_update");
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, "rna_Scene_glsl_update");
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);
+ 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, "rna_Scene_glsl_update");
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);
/* 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);
}
@@ -2150,85 +2183,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");
@@ -2240,7 +2273,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", ""},
@@ -2248,15 +2281,16 @@ 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",
- "Show the entire viewport in the display window, viewing more horizontally or vertically"},
+ "Show the entire viewport in the display window, viewing more horizontally "
+ "or vertically"},
{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", ""},
@@ -2264,7 +2298,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", ""},
@@ -2273,7 +2307,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"},
@@ -2281,14 +2315,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"},
@@ -2300,66 +2334,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);
@@ -2367,19 +2401,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",
@@ -2387,37 +2421,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_tesselation", PROP_INT, PROP_NONE);
+ prop = RNA_def_property(srna, "dome_tessellation", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dome.res");
RNA_def_property_ui_range(prop, 1, 8, 1, 1);
RNA_def_property_ui_text(prop, "Tessellation", "Tessellation level - check the generated mesh in wireframe mode");
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);
@@ -2425,27 +2459,28 @@ 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_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);
@@ -2454,7 +2489,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);
@@ -2463,7 +2498,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);
@@ -2472,7 +2507,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);
@@ -2482,17 +2517,18 @@ 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
- 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
+ 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 */
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",
@@ -2500,110 +2536,117 @@ 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");
+ 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");
+ 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");
+ 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");
+ 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");
+ 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_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_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");
@@ -2617,7 +2660,7 @@ static void rna_def_scene_render_layer(BlenderRNA *brna)
{
StructRNA *srna;
- 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);
@@ -2634,37 +2677,38 @@ 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_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);
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
- 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);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer");
- RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
- 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);
}
@@ -2688,20 +2732,21 @@ 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_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");
@@ -2710,7 +2755,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");
@@ -2718,36 +2763,36 @@ 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);
- /* format spesific */
+ /* format specific */
#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");
@@ -2758,17 +2803,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);
@@ -2776,24 +2821,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");
@@ -2897,7 +2942,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);
@@ -2925,7 +2970,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");
@@ -2953,7 +2998,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);
@@ -2961,15 +3006,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);
@@ -3062,12 +3107,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");
@@ -3081,7 +3126,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"},
@@ -3091,21 +3136,21 @@ 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"},
- {R_OUTPUT_NONE, "NONE", 0, "Keep UI", "Images are rendered without forcing UI changes, optionally showing result"},
+ {R_OUTPUT_NONE, "NONE", 0, "Keep UI", "Images are rendered without forcing UI changes"},
{0, NULL, 0, NULL, NULL}};
/* Bake */
- 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"},
@@ -3120,14 +3165,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)"},
@@ -3176,34 +3221,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);
@@ -3211,54 +3256,56 @@ 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_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);
- RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
+ RNA_def_property_ui_text(prop, "Pixel Aspect Y",
+ "Vertical aspect ratio - for anamorphic or non-square pixel output");
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);
@@ -3266,14 +3313,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);
@@ -3281,74 +3328,75 @@ 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 localy on each primitive "
+ "Vertex coordinates are stored locally on each primitive "
"(increases memory usage, but may have impact on speed)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- 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_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",
@@ -3356,89 +3404,91 @@ 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_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");
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);
RNA_def_property_ui_text(prop, "Threads",
- "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
+ "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);
@@ -3446,7 +3496,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",
@@ -3454,78 +3504,81 @@ 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");
+ "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_ui_text(prop, "Color Unpremultiply",
+ "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);
@@ -3533,28 +3586,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 texture from memory after render, to save memory before compositing");
+ "Free all image textures from memory after render, to save memory before compositing");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_COMP_FREE);
- RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory");
+ RNA_def_property_ui_text(prop, "Free Unused Nodes",
+ "Free Nodes that are not used while compositing, to save memory");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "use_save_buffers", PROP_BOOLEAN, PROP_NONE);
+ 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",
@@ -3562,7 +3616,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",
@@ -3570,13 +3624,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 "
@@ -3585,149 +3639,153 @@ 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");
+ 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)");
+ 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");
+ 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_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);
@@ -3736,91 +3794,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");
@@ -3838,25 +3896,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);
@@ -3873,15 +3931,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);
@@ -3898,26 +3956,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");
}
@@ -3931,31 +3989,34 @@ 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_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_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",
"Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
@@ -3967,22 +4028,24 @@ 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_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_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",
"Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
@@ -3995,15 +4058,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", "");
}
@@ -4033,20 +4096,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);
@@ -4054,26 +4117,27 @@ 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_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", "");
@@ -4081,29 +4145,37 @@ 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);
+ /* this seems to be too much trouble with depsgraph updates/etc. currently (20110420) */
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
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_ui_text(prop, "Layers", "Visible layers - Shift-Click to select multiple layers");
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);
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_current_frame_set", NULL);
- RNA_def_property_ui_text(prop, "Current Frame", "Current Frame, to update animation data from python frame_set() instead");
+ 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);
@@ -4111,7 +4183,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);
@@ -4119,32 +4191,34 @@ 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);
RNA_def_property_ui_range(prop, 1, 100, 1, 0);
- RNA_def_property_ui_text(prop, "Frame Step", "Number of frames to skip forward while rendering/playing back each frame");
+ RNA_def_property_ui_text(prop, "Frame Step",
+ "Number of frames to skip forward while rendering/playing back each frame");
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");
RNA_def_property_ui_text(prop, "Use Preview Range",
- "Use an alternative start/end frame for UI playback, rather than the scene start/end frame");
+ "Use an alternative start/end frame for UI playback, "
+ "rather than the scene start/end frame");
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);
@@ -4152,7 +4226,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);
@@ -4161,7 +4235,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",
@@ -4169,12 +4243,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");
@@ -4182,32 +4256,34 @@ 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);
- 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);
+ 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",
"All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene)");
@@ -4215,85 +4291,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");
@@ -4301,19 +4377,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");
@@ -4321,13 +4397,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");
@@ -4350,4 +4426,3 @@ void RNA_def_scene(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index 6d588632c95..08ed7625a01 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.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): Joshua Leung, Arystanbek Dyussenov
*
* ***** END GPL LICENSE BLOCK *****
@@ -52,14 +52,14 @@
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);
scene_camera_switch_update(scene);
- /* cant use NC_SCENE|ND_FRAME because this casues wm_event_do_notifiers to call
+ /* cant use NC_SCENE|ND_FRAME because this casues wm_event_do_notifiers to call
* scene_update_for_newframe which will loose any un-keyed changes [#24690] */
/* WM_main_add_notifier(NC_SCENE|ND_FRAME, scene); */
@@ -74,10 +74,11 @@ 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 +99,24 @@ 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");
- RNA_def_function_ui_description(func, "Update data tagged to be updated from previous access to data or operators");
+ 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,15 +127,14 @@ 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);
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index fa1f6c72430..67a4bafb8ee 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.debug & 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 67304997571..c8aa5ebaaca 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
- * dependant on the cache being updated which can happen after this UI
+ * dependent on the cache being updated which can happen after this UI
* draws causing a glitch [#28883] */
- ParticleSystem *psys= psys_get_current(ob);
+ 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,52 @@ 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");
+ 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");
+ 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 +296,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 +307,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 +335,52 @@ 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");
+ 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 +406,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 +416,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", "");
@@ -565,4 +568,3 @@ void RNA_def_sculpt_paint(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c
index 4413eee9395..ff336ba6693 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,13 +140,14 @@ 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;
- } else {
+ }
+ else {
/* can't use ob from ptr->id.data because that enum is also used by operators */
ob = CTX_data_active_object(C);
}
@@ -156,11 +156,11 @@ 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);
}
}
- RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_COLLISION);
+ RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_COLLISION);
RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_DELAY);
RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_JOYSTICK);
RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_KEYBOARD);
@@ -174,14 +174,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 +192,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 +203,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 +214,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,73 +279,78 @@ 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_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_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");
- RNA_def_property_collection_funcs(prop, "rna_Sensor_controllers_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_dereference_get", "rna_Sensor_controllers_length", NULL, NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_Sensor_controllers_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_dereference_get",
+ "rna_Sensor_controllers_length", NULL, NULL, NULL);
RNA_api_sensor(srna);
@@ -354,7 +359,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 +368,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 +395,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 +406,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 +422,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 +441,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 +486,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 +494,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 +529,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 +537,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 +568,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,23 +584,28 @@ 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);
- RNA_def_property_ui_text(prop, "Delay", "Delay in number of logic tics before the positive trigger (default 60 per second)");
+ 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);
- RNA_def_property_ui_text(prop, "Duration", "If >0, delay in number of logic tics before the negative trigger following the positive trigger");
+ 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_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 +614,49 @@ static void rna_def_collision_sensor(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- 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");
+ 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 +665,28 @@ 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");
- RNA_def_struct_ui_text(srna, "Radar Sensor", "Sensor to detect objects in a cone shaped radar emanating from the current object");
+ 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 +698,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 +712,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 +721,54 @@ 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");
- RNA_def_struct_ui_text(srna, "Ray Sensor", "Sensor to detect intersections with a ray emanating from the current object");
+ 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_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,12 +780,14 @@ 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);
- RNA_def_property_ui_text(prop, "Subject", "Optional subject filter: only accept messages with this subject, or empty to accept all");
+ 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 +796,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 +822,69 @@ 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_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");
@@ -893,4 +913,3 @@ void RNA_def_sensor(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_sensor_api.c b/source/blender/makesrna/intern/rna_sensor_api.c
index bb1afd81007..fd0c6f622ff 100644
--- a/source/blender/makesrna/intern/rna_sensor_api.c
+++ b/source/blender/makesrna/intern/rna_sensor_api.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) 2010 Blender Foundation.
* All rights reserved.
*
- *
+ *
* Contributor(s):
*
* ***** END GPL LICENSE BLOCK *****
@@ -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..2ed2f295cb6 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -37,6 +37,7 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
+#include "DNA_movieclip_types.h"
#include "BKE_animsys.h"
#include "BKE_global.h"
@@ -53,9 +54,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 +64,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 +74,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 don't 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 +110,27 @@ static int rna_SequenceEditor_elements_length(PointerRNA *ptr)
static void rna_SequenceEditor_elements_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Sequence *seq= (Sequence*)ptr->data;
- rna_iterator_array_begin(iter, (void*)seq->strip->stripdata, sizeof(StripElem), rna_SequenceEditor_elements_length(ptr), 0, NULL);
+ 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 +138,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 +148,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 +158,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 +169,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 +180,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 +189,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 +202,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,73 +218,77 @@ 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;
}
}
- } else {
+ }
+ else {
seq->flag ^= SEQ_USE_COLOR_BALANCE;
}
}
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 {
+ }
+ else {
seq->flag ^= SEQ_USE_PROXY;
}
}
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 {
+ }
+ else {
seq->flag ^= SEQ_USE_TRANSFORM;
}
}
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 {
+ }
+ else {
seq->flag ^= SEQ_USE_CROP;
}
}
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 +296,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 +316,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 +327,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 +349,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;
@@ -371,18 +377,18 @@ static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
/* fix all the animation data which may link to this */
- /* 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)
- BKE_animdata_fix_paths_rename(&scene->id, adt, "sequence_editor.sequences_all", oldname, seq->name+2, 0, 0, 1);
+ /* don't rename everywhere because these are per scene */
+ /* BKE_all_animdata_fix_paths_rename(NULL, "sequence_editor.sequences_all", oldname, seq->name+2); */
+ adt = BKE_animdata_from_id(&scene->id);
+ if (adt)
+ BKE_animdata_fix_paths_rename(&scene->id, adt, NULL, "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:
@@ -391,6 +397,8 @@ static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr)
return &RNA_SceneSequence;
case SEQ_MOVIE:
return &RNA_MovieSequence;
+ case SEQ_MOVIECLIP:
+ return &RNA_MovieClipSequence;
case SEQ_SOUND:
return &RNA_SoundSequence;
case SEQ_CROSS:
@@ -425,9 +433,9 @@ 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...
+ /* sequencer data comes from scene...
* TODO: would be nice to make SequenceEditor data a datablock of its own (for shorter paths)
*/
if (seq->name+2)
@@ -438,8 +446,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 +455,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.
@@ -461,19 +469,20 @@ static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
sound_update_scene_sound(seq->scene_sound, seq->sound);
}
- BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir), sizeof(seq->strip->stripdata->name));
+ BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir),
+ sizeof(seq->strip->stripdata->name));
}
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 +491,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,42 +513,43 @@ 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);
}
/*static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
{
Sequence *seq= (Sequence*)(ptr->data);
- BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir), sizeof(seq->strip->stripdata->name));
+ BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir),
+ sizeof(seq->strip->stripdata->name));
}
static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
@@ -550,25 +560,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 +586,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 +594,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 +605,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 +623,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 +636,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 +666,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 +700,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 +741,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 +766,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 +802,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 +823,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"},
@@ -822,8 +832,8 @@ static void rna_def_strip_proxy(BlenderRNA *brna)
{SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)",
"Interpolate a global timestamp using the "
"record date and time written by recording device"},
- {SEQ_PROXY_TC_RECORD_RUN_NO_GAPS, "FREE_RUN_NO_GAPS", 0, "Free Run No Gaps",
- "Record run, but ignore timecode, "
+ {SEQ_PROXY_TC_RECORD_RUN_NO_GAPS, "RECORD_RUN_NO_GAPS", 0, "Record Run No Gaps",
+ "Like record run, but ignore timecode, "
"changes in framerate or dropouts"},
{0, NULL, 0, NULL, NULL}};
@@ -831,51 +841,52 @@ 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_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 +903,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,40 +952,41 @@ static void rna_def_sequence(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static const EnumPropertyItem seq_type_items[]= {
- {SEQ_IMAGE, "IMAGE", 0, "Image", ""},
- {SEQ_META, "META", 0, "Meta", ""},
- {SEQ_SCENE, "SCENE", 0, "Scene", ""},
- {SEQ_MOVIE, "MOVIE", 0, "Movie", ""},
+ static const EnumPropertyItem seq_type_items[] = {
+ {SEQ_IMAGE, "IMAGE", 0, "Image", ""},
+ {SEQ_META, "META", 0, "Meta", ""},
+ {SEQ_SCENE, "SCENE", 0, "Scene", ""},
+ {SEQ_MOVIE, "MOVIE", 0, "Movie", ""},
+ {SEQ_MOVIECLIP, "MOVIECLIP", 0, "Clip", ""},
{SEQ_SOUND, "SOUND", 0, "Sound", ""},
- {SEQ_CROSS, "CROSS", 0, "Cross", ""},
- {SEQ_ADD, "ADD", 0, "Add", ""},
- {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
- {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
- {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
- {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
- {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
- {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
- {SEQ_PLUGIN, "PLUGIN", 0, "Plugin", ""},
- {SEQ_WIPE, "WIPE", 0, "Wipe", ""},
- {SEQ_GLOW, "GLOW", 0, "Glow", ""},
- {SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
- {SEQ_COLOR, "COLOR", 0, "Color", ""},
- {SEQ_SPEED, "SPEED", 0, "Speed", ""},
+ {SEQ_CROSS, "CROSS", 0, "Cross", ""},
+ {SEQ_ADD, "ADD", 0, "Add", ""},
+ {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
+ {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
+ {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
+ {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
+ {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
+ {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
+ {SEQ_PLUGIN, "PLUGIN", 0, "Plugin", ""},
+ {SEQ_WIPE, "WIPE", 0, "Wipe", ""},
+ {SEQ_GLOW, "GLOW", 0, "Glow", ""},
+ {SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
+ {SEQ_COLOR, "COLOR", 0, "Color", ""},
+ {SEQ_SPEED, "SPEED", 0, "Speed", ""},
{SEQ_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""},
{SEQ_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem blend_mode_items[]= {
- {SEQ_BLEND_REPLACE, "REPLACE", 0, "Replace", ""},
- {SEQ_CROSS, "CROSS", 0, "Cross", ""},
- {SEQ_ADD, "ADD", 0, "Add", ""},
- {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
- {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
- {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
- {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
- {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
- {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
+ static const EnumPropertyItem blend_mode_items[] = {
+ {SEQ_BLEND_REPLACE, "REPLACE", 0, "Replace", ""},
+ {SEQ_CROSS, "CROSS", 0, "Cross", ""},
+ {SEQ_ADD, "ADD", 0, "Add", ""},
+ {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
+ {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
+ {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
+ {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
+ {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
+ {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
{0, NULL, 0, NULL, NULL}};
srna = RNA_def_struct(brna, "Sequence", NULL);
@@ -982,57 +994,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 +1052,126 @@ 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");
+ 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_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");
+ /* overlap tests and calc_seq_disp */
+ RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL);
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_ui_text(prop, "End Frame",
+ "End frame displayed in the sequence editor after offsets are applied");
+ /* overlap tests and calc_seq_disp */
+ RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL);
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
+ /* stupid 0-100 -> 0-1 */
+ RNA_def_property_float_funcs(prop, "rna_Sequence_opacity_get", "rna_Sequence_opacity_set", NULL);
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_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_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,42 +1188,45 @@ 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);
+ 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);
+ 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_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);
RNA_def_property_ui_text(prop, "Active Strip", "Sequencer's active strip");
}
@@ -1209,81 +1235,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 +1318,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 +1342,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,16 +1367,18 @@ 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", "");
- 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);
+ 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);
rna_def_filter_video(srna);
rna_def_proxy(srna);
@@ -1385,12 +1413,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 +1438,28 @@ 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_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);
+ 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");
@@ -1439,44 +1470,69 @@ static void rna_def_movie(BlenderRNA *brna)
rna_def_input(srna);
}
+static void rna_def_movieclip(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = RNA_def_struct(brna, "MovieClipSequence", "Sequence");
+ RNA_def_struct_ui_text(srna, "MovieClip Sequence", "Sequence strip to load a video from the clip editor");
+ RNA_def_struct_sdna(srna, "Sequence");
+
+ prop = RNA_def_property(srna, "undistort", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "clip_flag", SEQ_MOVIECLIP_RENDER_UNDISTORTED);
+ RNA_def_property_ui_text(prop, "Undistort Clip", "Use the undistorted version of the clip");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+
+ prop = RNA_def_property(srna, "stabilize2d", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "clip_flag", SEQ_MOVIECLIP_RENDER_STABILIZED);
+ RNA_def_property_ui_text(prop, "Stabilize 2D Clip", "Use the 2D stabilized version of the clip");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
+
+ rna_def_filter_video(srna);
+ rna_def_input(srna);
+}
+
+
static void rna_def_sound(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SoundSequence", "Sequence");
- RNA_def_struct_ui_text(srna, "Sound Sequence", "Sequence strip defining a sound to be played over a period of time");
+ 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_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length",
"rna_Sequence_filepath_set");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_filepath_update");
@@ -1488,7 +1544,8 @@ static void rna_def_effect(BlenderRNA *brna)
StructRNA *srna;
srna = RNA_def_struct(brna, "EffectSequence", "Sequence");
- RNA_def_struct_ui_text(srna, "Effect Sequence", "Sequence strip applying an effect on the images created by other strips");
+ RNA_def_struct_ui_text(srna, "Effect Sequence",
+ "Sequence strip applying an effect on the images created by other strips");
RNA_def_struct_sdna(srna, "Sequence");
rna_def_filter_video(srna);
@@ -1501,10 +1558,11 @@ static void rna_def_multicam(BlenderRNA *brna)
PropertyRNA *prop;
srna = RNA_def_struct(brna, "MulticamSequence", "Sequence");
- RNA_def_struct_ui_text(srna, "Multicam Select Sequence", "Sequence strip to perform multicam editing: select channel from below");
+ 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,10 +1576,11 @@ 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");
+ RNA_def_struct_ui_text(srna, "Adjustment Layer Sequence",
+ "Sequence strip to perform filter adjustments to layers below");
RNA_def_struct_sdna(srna, "Sequence");
rna_def_filter_video(srna);
@@ -1535,10 +1594,11 @@ static void rna_def_plugin(BlenderRNA *brna)
PropertyRNA *prop;
srna = RNA_def_struct(brna, "PluginSequence", "EffectSequence");
- RNA_def_struct_ui_text(srna, "Plugin Sequence", "Sequence strip applying an effect, loaded from an external plugin");
+ 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,17 +1612,17 @@ static void rna_def_wipe(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static const EnumPropertyItem wipe_type_items[]= {
- {0, "SINGLE", 0, "Single", ""},
- {1, "DOUBLE", 0, "Double", ""},
+ static const EnumPropertyItem wipe_type_items[] = {
+ {0, "SINGLE", 0, "Single", ""},
+ {1, "DOUBLE", 0, "Double", ""},
/* not used yet {2, "BOX", 0, "Box", ""}, */
/* not used yet {3, "CROSS", 0, "Cross", ""}, */
- {4, "IRIS", 0, "Iris", ""},
- {5, "CLOCK", 0, "Clock", ""},
+ {4, "IRIS", 0, "Iris", ""},
+ {5, "CLOCK", 0, "Clock", ""},
{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 +1632,32 @@ 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_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 +1673,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,66 +1714,67 @@ 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}
};
srna = RNA_def_struct(brna, "TransformSequence", "EffectSequence");
- RNA_def_struct_ui_text(srna, "Transform Sequence", "Sequence strip applying affine transformations to other strips");
+ 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 +1790,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 +1805,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");
@@ -1781,6 +1843,7 @@ void RNA_def_sequencer(BlenderRNA *brna)
rna_def_meta(brna);
rna_def_scene(brna);
rna_def_movie(brna);
+ rna_def_movieclip(brna);
rna_def_sound(brna);
rna_def_effect(brna);
rna_def_multicam(brna);
@@ -1794,4 +1857,3 @@ void RNA_def_sequencer(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c
index 98eb302b620..e47ec23bef5 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,17 @@ 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"));
+ 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..dfd3f5d8428 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);
}
@@ -120,7 +120,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
static EnumPropertyItem prop_noise_type_items[] = {
{MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""},
#ifdef WITH_FFTW3
- {MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""},
+ {MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""},
#endif
/* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */
{0, NULL, 0, NULL, NULL}};
@@ -132,7 +132,8 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
static EnumPropertyItem smoke_domain_colli_items[] = {
{SM_BORDER_OPEN, "BORDEROPEN", 0, "Open", "Smoke doesn't collide with any border"},
- {SM_BORDER_VERTICAL, "BORDERVERTICAL", 0, "Vertically Open", "Smoke doesn't collide with top and bottom sides"},
+ {SM_BORDER_VERTICAL, "BORDERVERTICAL", 0, "Vertically Open",
+ "Smoke doesn't collide with top and bottom sides"},
{SM_BORDER_CLOSED, "BORDERCLOSED", 0, "Collide All", "Smoke collides with every side"},
{0, NULL, 0, NULL, NULL}};
@@ -141,129 +142,132 @@ 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_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_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_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 +286,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);
@@ -344,4 +348,3 @@ void RNA_def_smoke(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c
index f5984d2f940..18499fa52fe 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,30 +71,31 @@ 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_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");
}
@@ -104,5 +105,3 @@ void RNA_def_sound(BlenderRNA *brna)
}
#endif
-
-
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index c7e28851084..42e83e662d1 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -76,7 +76,8 @@ EnumPropertyItem space_type_items[] = {
static EnumPropertyItem draw_channels_items[] = {
{0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
- {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"},
+ {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha",
+ "Draw image with RGB colors and alpha transparency"},
{SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
{SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer",
"Draw Z-buffer associated with image (mapped from camera clip start to end)"},
@@ -87,7 +88,8 @@ static EnumPropertyItem transform_orientation_items[] = {
{V3D_MANIP_LOCAL, "LOCAL", 0, "Local", "Align the transformation axes to the selected objects' local space"},
{V3D_MANIP_GIMBAL, "GIMBAL", 0, "Gimbal", "Align each axis to the Euler rotation axis as used for input"},
{V3D_MANIP_NORMAL, "NORMAL", 0, "Normal",
- "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"},
+ "Align the transformation axes to average normal of selected elements "
+ "(bone Y axis for pose mode)"},
{V3D_MANIP_VIEW, "VIEW", 0, "View", "Align the transformation axes to the window"},
{V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
{0, NULL, 0, NULL, NULL}};
@@ -136,9 +138,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 +183,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 +236,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 +252,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 +277,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 +310,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 +320,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 +332,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 +352,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 +377,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 +391,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 +413,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 +424,82 @@ 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);
}
-static EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
+/* 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 +520,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,61 +548,62 @@ 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);
- } else {
+ }
+ else {
int w, h;
ED_space_image_size(sima, &w, &h);
@@ -586,11 +614,12 @@ 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);
- } else {
+ }
+ else {
int w, h;
ED_space_image_size(sima, &w, &h);
@@ -601,12 +630,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 +644,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 +660,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 +689,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 +705,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 +732,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)
+static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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 +821,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 +844,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 +855,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 +877,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,9 +889,9 @@ 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
+ /* after changing view mode, must force recalculation of F-Curve colors
* which can only be achieved using refresh as opposed to redraw
*/
ED_area_tag_refresh(sa);
@@ -870,31 +899,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 +951,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 +970,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 +990,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 +999,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 +1021,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 +1054,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 +1097,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 +1111,52 @@ 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_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 +1165,24 @@ 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_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");
@@ -1169,7 +1200,8 @@ static void rna_def_space_outliner(BlenderRNA *brna)
{SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", "Display datablocks in visible layers"},
{SO_SELECTED, "SELECTED", 0, "Selected", "Display datablocks of selected objects"},
{SO_ACTIVE, "ACTIVE", 0, "Active", "Display datablocks of active object"},
- {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types", "Display datablocks of all objects of same type as selected object"},
+ {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types",
+ "Display datablocks of all objects of same type as selected object"},
{SO_GROUPS, "GROUPS", 0, "Groups", "Display groups and their datablocks"},
{SO_LIBRARIES, "LIBRARIES", 0, "Libraries", "Display libraries"},
{SO_SEQUENCE, "SEQUENCE", 0, "Sequence", "Display sequence datablocks"},
@@ -1178,32 +1210,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);
@@ -1214,7 +1246,7 @@ static void rna_def_background_image(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- /* note: combinations work but dont flip so arnt that useful */
+ /* note: combinations work but don't flip so arnt that useful */
static EnumPropertyItem bgpic_axis_items[] = {
{0, "", 0, "X Axis", ""},
{(1<<RV3D_VIEW_LEFT), "LEFT", 0, "Left", "Show background image while looking to the left"},
@@ -1239,81 +1271,82 @@ 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_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 +1359,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,14 +1382,16 @@ 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",
"Pivot around bounding box center of selected object(s)"},
{V3D_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
- {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Origins", "Pivot around each object's own origin"},
- {V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point", "Pivot around the median point of selected objects"},
+ {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION,
+ "Individual Origins", "Pivot around each object's own origin"},
+ {V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point",
+ "Pivot around the median point of selected objects"},
{V3D_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", "Pivot around active object"},
{0, NULL, 0, NULL, NULL}};
@@ -1376,205 +1411,215 @@ 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_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");
+ 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_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_float_default(prop, 0.1f);
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_float_default(prop, 1000.0f);
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_float_default(prop, 1.0f);
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_int_default(prop, 16);
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_int_default(prop, 10);
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_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_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,138 +1627,150 @@ 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);
+ RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_location_get",
+ "rna_RegionView3D_view_location_set", NULL);
#endif
RNA_def_property_ui_text(prop, "View Location", "View pivot location");
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
RNA_def_property_array(prop, 4);
- RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_rotation_get", "rna_RegionView3D_view_rotation_set", NULL);
+ RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_rotation_get",
+ "rna_RegionView3D_view_rotation_set", NULL);
#endif
RNA_def_property_ui_text(prop, "View Rotation", "Rotation in quaternions (keep normalized)");
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,42 +1801,43 @@ 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. */
- RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_set", "rna_SpaceProperties_pin_id_typef", NULL);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_set",
+ "rna_SpaceProperties_pin_id_typef", NULL);
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 +1847,59 @@ 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_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 +1907,51 @@ 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");
+ 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,84 +1987,87 @@ 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_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_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_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");
+ RNA_def_property_ui_text(prop, "Proxy render size",
+ "Draw preview using full resolution or different proxy resolutions");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
}
@@ -2013,98 +2076,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 +2178,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 +2187,43 @@ 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_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_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 +2231,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");
@@ -2201,7 +2266,8 @@ static void rna_def_space_graph(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem mode_items[] = {
- {SIPO_MODE_ANIMATION, "FCURVES", ICON_IPO, "F-Curve Editor", "Edit animation/keyframes displayed as 2D curves"},
+ {SIPO_MODE_ANIMATION, "FCURVES", ICON_IPO, "F-Curve Editor",
+ "Edit animation/keyframes displayed as 2D curves"},
{SIPO_MODE_DRIVERS, "DRIVERS", ICON_DRIVER, "Drivers", "Edit drivers"},
{0, NULL, 0, NULL, NULL}};
@@ -2210,105 +2276,109 @@ 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_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_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)");
+ "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);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", 0); /* XXX: hack to make this compile, since this property doesn't actually exist*/
+ prop = RNA_def_property(srna, "has_ghost_curves", PROP_BOOLEAN, PROP_NONE);
+ /* XXX: hack to make this compile, since this property doesn't actually exist*/
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", 0);
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");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
@@ -2319,41 +2389,42 @@ 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_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,55 +2436,57 @@ 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);
+ /* view settings */
+ 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_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_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_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_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_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_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_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_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 +2497,15 @@ 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);
- RNA_def_property_string_funcs(prop, "rna_ConsoleLine_body_get", "rna_ConsoleLine_body_length", "rna_ConsoleLine_body_set");
+ 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 +2516,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");
@@ -2491,101 +2565,103 @@ static void rna_def_fileselect_params(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem file_sort_items[] = {
- {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_SORTALPHA, "Sort alphabetically", "Sort the file list alphabetically"},
- {FILE_SORT_EXTENSION, "FILE_SORT_EXTENSION", ICON_SORTBYEXT, "Sort by extension", "Sort the file list by extension"},
+ {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_SORTALPHA, "Sort alphabetically",
+ "Sort the file list alphabetically"},
+ {FILE_SORT_EXTENSION, "FILE_SORT_EXTENSION", ICON_SORTBYEXT, "Sort by extension",
+ "Sort the file list by extension"},
{FILE_SORT_TIME, "FILE_SORT_TIME", ICON_SORTTIME, "Sort by time", "Sort files by modification time"},
{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_ui_icon(prop, ICON_FILE_TEXT, 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 +2673,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,35 +2697,35 @@ 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);
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
}
static void rna_def_space_userpref(BlenderRNA *brna)
@@ -2657,11 +2733,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 +2766,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 +2822,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 +2844,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);
@@ -2839,7 +2915,8 @@ static void rna_def_space_clip(BlenderRNA *brna)
static EnumPropertyItem mode_items[] = {
{SC_MODE_TRACKING, "TRACKING", ICON_ANIM_DATA, "Tracking", "Show tracking and solving tools"},
- {SC_MODE_RECONSTRUCTION, "RECONSTRUCTION", ICON_SNAP_FACE, "Reconstruction", "Show tracking/reconstruction tools"},
+ {SC_MODE_RECONSTRUCTION, "RECONSTRUCTION", ICON_SNAP_FACE, "Reconstruction",
+ "Show tracking/reconstruction tools"},
{SC_MODE_DISTORTION, "DISTORTION", ICON_GRID, "Distortion", "Show distortion tools"},
{0, NULL, 0, NULL, NULL}};
@@ -2848,170 +2925,175 @@ 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");
- RNA_def_property_ui_text(prop, "Movie Clip User", "Parameters defining which frame of the movie clip is displayed");
+ RNA_def_property_ui_text(prop, "Movie Clip User",
+ "Parameters defining which frame of the movie clip is displayed");
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);
- RNA_def_property_ui_text(prop, "Lock to Time Cursor", "Lock curves view to time cursor during playback and tracking");
+ 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_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_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);
/* ** 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..8bc545f34b7 100644
--- a/source/blender/makesrna/intern/rna_test.c
+++ b/source/blender/makesrna/intern/rna_test.c
@@ -47,66 +47,69 @@
#ifdef UNIT_TEST
-#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 type prefix ## marr MARRAY_DIM; \
- static type prefix ## dmarr DYNAMIC_MARRAY_DIM; \
- static int prefix ## dmarr_len= sizeof(prefix ## dmarr);
-
-#define DEF_GET_SET(type, arr) \
- void rna_Test_ ## arr ## _get(PointerRNA *ptr, type *values) \
- { \
- memcpy(values, arr, sizeof(arr)); \
- } \
- \
- void rna_Test_ ## arr ## _set(PointerRNA *ptr, const type *values) \
- { \
- memcpy(arr, values, sizeof(arr)); \
- }
-
-#define DEF_GET_SET_LEN(arr, max) \
- static int rna_Test_ ## arr ## _get_length(PointerRNA *ptr) \
- { \
- return arr ## _len; \
- } \
- \
- static int rna_Test_ ## arr ## _set_length(PointerRNA *ptr, int length) \
- { \
- if (length > max) \
- return 0; \
- \
- arr ## _len= length; \
- \
- return 1; \
- } \
-
-DEF_VARS(float, f)
-DEF_VARS(int, i)
-DEF_VARS(int, b)
-
-DEF_GET_SET(float, farr)
-DEF_GET_SET(int, iarr)
-DEF_GET_SET(int, barr)
-
-DEF_GET_SET(float, fmarr)
-DEF_GET_SET(int, imarr)
-DEF_GET_SET(int, bmarr)
-
-DEF_GET_SET(float, fdarr)
-DEF_GET_SET_LEN(fdarr, DYNAMIC_ARRAY_SIZE)
-DEF_GET_SET(int, idarr)
-DEF_GET_SET_LEN(idarr, DYNAMIC_ARRAY_SIZE)
-DEF_GET_SET(int, bdarr)
-DEF_GET_SET_LEN(bdarr, DYNAMIC_ARRAY_SIZE)
-
-DEF_GET_SET(float, fdmarr)
-DEF_GET_SET_LEN(fdmarr, DYNAMIC_MARRAY_SIZE(float))
-DEF_GET_SET(int, idmarr)
-DEF_GET_SET_LEN(idmarr, DYNAMIC_MARRAY_SIZE(int))
-DEF_GET_SET(int, bdmarr)
-DEF_GET_SET_LEN(bdmarr, DYNAMIC_MARRAY_SIZE(int))
+#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 type prefix ## marr MARRAY_DIM; \
+ static type prefix ## dmarr DYNAMIC_MARRAY_DIM; \
+ static int prefix ## dmarr_len = sizeof(prefix ## dmarr); \
+ (void)0
+
+#define DEF_GET_SET(type, arr) \
+ void rna_Test_ ## arr ## _get(PointerRNA * ptr, type * values) \
+ { \
+ memcpy(values, arr, sizeof(arr)); \
+ } \
+ \
+ void rna_Test_ ## arr ## _set(PointerRNA * ptr, const type * values) \
+ { \
+ memcpy(arr, values, sizeof(arr)); \
+ } \
+ (void)0
+
+#define DEF_GET_SET_LEN(arr, max) \
+ static int rna_Test_ ## arr ## _get_length(PointerRNA * ptr) \
+ { \
+ return arr ## _len; \
+ } \
+ \
+ static int rna_Test_ ## arr ## _set_length(PointerRNA * ptr, int length) \
+ { \
+ if (length > max) \
+ return 0; \
+ \
+ arr ## _len = length; \
+ \
+ return 1; \
+ } \
+ (void)0
+
+DEF_VARS(float, f);
+DEF_VARS(int, i);
+DEF_VARS(int, b);
+
+DEF_GET_SET(float, farr);
+DEF_GET_SET(int, iarr);
+DEF_GET_SET(int, barr);
+
+DEF_GET_SET(float, fmarr);
+DEF_GET_SET(int, imarr);
+DEF_GET_SET(int, bmarr);
+
+DEF_GET_SET(float, fdarr);
+DEF_GET_SET_LEN(fdarr, DYNAMIC_ARRAY_SIZE);
+DEF_GET_SET(int, idarr);
+DEF_GET_SET_LEN(idarr, DYNAMIC_ARRAY_SIZE);
+DEF_GET_SET(int, bdarr);
+DEF_GET_SET_LEN(bdarr, DYNAMIC_ARRAY_SIZE);
+
+DEF_GET_SET(float, fdmarr);
+DEF_GET_SET_LEN(fdmarr, DYNAMIC_MARRAY_SIZE(float));
+DEF_GET_SET(int, idmarr);
+DEF_GET_SET_LEN(idmarr, DYNAMIC_MARRAY_SIZE(int));
+DEF_GET_SET(int, bdmarr);
+DEF_GET_SET_LEN(bdmarr, DYNAMIC_MARRAY_SIZE(int));
#endif
@@ -117,66 +120,67 @@ 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");
@@ -185,6 +189,4 @@ void RNA_def_test(BlenderRNA *brna)
#endif
}
-#endif /* RNA_RUNTIME */
-
-
+#endif /* RNA_RUNTIME */
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index 9e3611b4cc5..36ee361de2c 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,66 @@ 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\"");
+ 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");
+ 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");
+ 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..6a3dee72849 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"},
@@ -91,8 +91,8 @@ EnumPropertyItem blend_type_items[] = {
{MTEX_BLEND_SAT, "SATURATION", 0, "Saturation", ""},
{MTEX_BLEND_VAL, "VALUE", 0, "Value", ""},
{MTEX_BLEND_COLOR, "COLOR", 0, "Color", ""},
- {MTEX_SOFT_LIGHT, "SOFT_LIGHT", 0, "Soft Light", ""},
- {MTEX_LIN_LIGHT , "LINEAR_LIGHT", 0, "Linear Light", ""},
+ {MTEX_SOFT_LIGHT, "SOFT_LIGHT", 0, "Soft Light", ""},
+ {MTEX_LIN_LIGHT , "LINEAR_LIGHT", 0, "Linear Light", ""},
{0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
@@ -113,11 +113,11 @@ 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;
+ return &RNA_BlendTexture;
case TEX_CLOUDS:
return &RNA_CloudsTexture;
case TEX_DISTNOISE:
@@ -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,39 +212,39 @@ 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)) {
- case ID_MA:
+ 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);
break;
- case ID_WO:
+ case ID_WO:
WM_main_add_notifier(NC_WORLD, id);
break;
- case ID_LA:
+ case ID_LA:
WM_main_add_notifier(NC_LAMP|ND_LIGHTING, id);
break;
- case ID_BR:
+ case ID_BR:
WM_main_add_notifier(NC_BRUSH, id);
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,50 @@ 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)
+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 +349,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 +368,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 +408,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 +422,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 +465,64 @@ 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 */
+ /* Not PROP_XYZ, this is now in radians, no more degrees */
+ prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
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 +533,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 +587,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 +608,54 @@ 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_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");
@@ -660,47 +663,49 @@ static void rna_def_mtex(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
}
-static void rna_def_filter_common(StructRNA *srna)
+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)");
+ "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)");
+ "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 +729,69 @@ 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");
+ 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_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 +837,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 +898,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 +965,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 +1027,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);
@@ -1050,26 +1057,27 @@ static void rna_def_texture_blend(BlenderRNA *brna)
{TEX_EASE, "EASING", 0, "Easing", "Create a progression easing from one step to the next"},
{TEX_DIAG, "DIAGONAL", 0, "Diagonal", "Create a diagonal progression"},
{TEX_SPHERE, "SPHERICAL", 0, "Spherical", "Create a spherical progression"},
- {TEX_HALO, "QUADRATIC_SPHERE", 0, "Quadratic sphere", "Create a quadratic progression in the shape of a sphere"},
+ {TEX_HALO, "QUADRATIC_SPHERE", 0, "Quadratic sphere",
+ "Create a quadratic progression in the shape of a sphere"},
{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 +1096,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 +1137,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 +1156,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);
@@ -1228,9 +1236,9 @@ static void rna_def_texture_image(BlenderRNA *brna)
#if 0
/* XXX: did this as an array, but needs better descriptions than "1 2 3 4"
- perhaps a new subtype could be added?
+ 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 +1247,55 @@ 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_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 +1305,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 +1317,26 @@ 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_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 +1358,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 +1454,67 @@ 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_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 +1526,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 +1570,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[] = {
@@ -1593,144 +1604,146 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem turbulence_influence_items[] = {
- {TEX_PD_NOISE_STATIC, "STATIC", 0, "Static", "Noise patterns will remain unchanged, faster and suitable for stills"},
- {TEX_PD_NOISE_VEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", "Turbulent noise driven by particle velocity"},
+ {TEX_PD_NOISE_STATIC, "STATIC", 0, "Static",
+ "Noise patterns will remain unchanged, faster and suitable for stills"},
+ {TEX_PD_NOISE_VEL, "PARTICLE_VELOCITY", 0, "Particle Velocity",
+ "Turbulent noise driven by particle velocity"},
{TEX_PD_NOISE_AGE, "PARTICLE_AGE", 0, "Particle Age",
"Turbulent noise driven by the particle's age between birth and death"},
{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");
@@ -1743,18 +1756,21 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem interpolation_type_items[] = {
- {TEX_VD_NEARESTNEIGHBOR, "NEREASTNEIGHBOR", 0, "Nearest Neighbor", "No interpolation, fast but blocky and low quality"},
+ {TEX_VD_NEARESTNEIGHBOR, "NEREASTNEIGHBOR", 0, "Nearest Neighbor",
+ "No interpolation, fast but blocky and low quality"},
{TEX_VD_LINEAR, "TRILINEAR", 0, "Linear", "Good smoothness and speed"},
{TEX_VD_QUADRATIC, "QUADRATIC", 0, "Quadratic", "Mid-range quality and speed"},
{TEX_VD_TRICUBIC_CATROM, "TRICUBIC_CATROM", 0, "Cubic Catmull-Rom", "High quality interpolation, but slower"},
- {TEX_VD_TRICUBIC_BSPLINE, "TRICUBIC_BSPLINE", 0, "Cubic B-Spline", "Smoothed high quality interpolation, but slower"},
+ {TEX_VD_TRICUBIC_BSPLINE, "TRICUBIC_BSPLINE", 0, "Cubic B-Spline",
+ "Smoothed high quality interpolation, but slower"},
{0, NULL, 0, NULL, NULL}};
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_IMAGE_SEQUENCE, "IMAGE_SEQUENCE", 0, "Image Sequence", "Generate voxels from a sequence of image slices"},
+ /*{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,90 +1786,91 @@ 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_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 +1881,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 +1922,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..034696b43c5 100644
--- a/source/blender/makesrna/intern/rna_texture_api.c
+++ b/source/blender/makesrna/intern/rna_texture_api.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
@@ -43,7 +43,8 @@
#include "RE_pipeline.h"
#include "RE_shader_ext.h"
-void save_envmap(struct EnvMap *env, bContext *C, ReportList *reports, const char* filepath, struct Scene *scene, float layout[12])
+void save_envmap(struct EnvMap *env, bContext *C, ReportList *reports, const char* filepath,
+ struct Scene *scene, float layout[12])
{
if (scene == NULL) {
scene = CTX_data_scene(C);
@@ -59,7 +60,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 +69,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 +85,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 +105,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..a33e415ce11 100644
--- a/source/blender/makesrna/intern/rna_timeline.c
+++ b/source/blender/makesrna/intern/rna_timeline.c
@@ -37,6 +37,14 @@
#ifdef RNA_RUNTIME
+#include "WM_api.h"
+
+static void rna_TimelineMarker_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
+{
+ WM_main_add_notifier(NC_SCENE|ND_MARKERS, NULL);
+ WM_main_add_notifier(NC_ANIMATION|ND_MARKERS, NULL);
+}
+
#else
static void rna_def_timeline_marker(BlenderRNA *brna)
@@ -44,27 +52,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);
+ RNA_def_property_update(prop, 0, "rna_TimelineMarker_update");
- 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);
+ RNA_def_property_update(prop, 0, "rna_TimelineMarker_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", 1 /*SELECT*/);
RNA_def_property_ui_text(prop, "Select", "Marker selection state");
- RNA_def_property_update(prop, NC_ANIMATION, NULL);
+ RNA_def_property_update(prop, 0, "rna_TimelineMarker_update");
#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..5fe13336e83 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)
+static void rna_tracking_active_object_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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,54 +188,54 @@ 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)
- BKE_tracking_clamp_track(track, CLAMP_PYRAMID_LEVELS);
- else
- BKE_tracking_clamp_track(track, CLAMP_SEARCH_DIM);
+ if (track->tracker == TRACKER_KLT)
+ BKE_tracking_clamp_track(track, CLAMP_PYRAMID_LEVELS);
+ else
+ BKE_tracking_clamp_track(track, CLAMP_SEARCH_DIM);
}
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)
+static void rna_tracking_stabTracks_active_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
- 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);
@@ -485,7 +485,8 @@ void rna_trackingMarkers_delete_frame(MovieTrackingTrack *track, int framenr)
#else
static EnumPropertyItem tracker_items[] = {
- {TRACKER_KLT, "KLT", 0, "KLT", "Kanade–Lucas–Tomasi tracker which works with most of video clips, a bit slower than SAD"},
+ {TRACKER_KLT, "KLT", 0, "KLT",
+ "Kanade–Lucas–Tomasi tracker which works with most of video clips, a bit slower than SAD"},
{TRACKER_SAD, "SAD", 0, "SAD", "Sum of Absolute Differences tracker which can be used when KLT tracker fails"},
{TRACKER_HYBRID, "Hybrid", 0, "Hybrid", "A hybrid tracker that uses SAD for rough tracking, KLT for refinement."},
{0, NULL, 0, NULL, NULL}};
@@ -495,7 +496,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)
{
@@ -520,43 +521,49 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
static EnumPropertyItem refine_items[] = {
{0, "NONE", 0, "Nothing", "Do not refine camera intrinsics"},
{REFINE_FOCAL_LENGTH, "FOCAL_LENGTH", 0, "Focal Length", "Refine focal length"},
- {REFINE_FOCAL_LENGTH|REFINE_RADIAL_DISTORTION_K1, "FOCAL_LENGTH_RADIAL_K1", 0, "Focal length, K1", "Refine focal length and radial distortion K1"},
+ {REFINE_FOCAL_LENGTH|REFINE_RADIAL_DISTORTION_K1, "FOCAL_LENGTH_RADIAL_K1", 0, "Focal length, K1",
+ "Refine focal length and radial distortion K1"},
{REFINE_FOCAL_LENGTH|
REFINE_RADIAL_DISTORTION_K1|
- REFINE_RADIAL_DISTORTION_K2, "FOCAL_LENGTH_RADIAL_K1_K2", 0, "Focal length, K1, K2", "Refine focal length and radial distortion K1 and K2"},
+ REFINE_RADIAL_DISTORTION_K2, "FOCAL_LENGTH_RADIAL_K1_K2", 0, "Focal length, K1, K2",
+ "Refine focal length and radial distortion K1 and K2"},
{REFINE_FOCAL_LENGTH|
REFINE_PRINCIPAL_POINT|
REFINE_RADIAL_DISTORTION_K1|
- REFINE_RADIAL_DISTORTION_K2,
- "FOCAL_LENGTH_PRINCIPAL_POINT_RADIAL_K1_K2", 0, "Focal Length, Optical Center, K1, K2", "Refine focal length, optical center and radial distortion K1 and K2"},
+ REFINE_RADIAL_DISTORTION_K2, "FOCAL_LENGTH_PRINCIPAL_POINT_RADIAL_K1_K2", 0,
+ "Focal Length, Optical Center, K1, K2",
+ "Refine focal length, optical center and radial distortion K1 and K2"},
{REFINE_FOCAL_LENGTH|
- REFINE_PRINCIPAL_POINT, "FOCAL_LENGTH_PRINCIPAL_POINT", 0, "Focal Length, Optical Center", "Refine focal length and optical center"},
+ REFINE_PRINCIPAL_POINT, "FOCAL_LENGTH_PRINCIPAL_POINT", 0, "Focal Length, Optical Center",
+ "Refine focal length and optical center"},
{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)");
+ 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 +572,65 @@ 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");
+ 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");
+ 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 +638,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,16 +647,18 @@ 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");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "Correlation", "Default minimal value of correlation between matched pattern and reference which is still treated as successful tracking");
+ 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 +666,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 +674,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 +694,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 +713,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 +726,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 +735,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 +743,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 +751,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 +759,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 +781,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 +796,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 +808,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,33 +828,34 @@ 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",
- "Frame number to find marker for", MINFRAME, MAXFRAME);
+ 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",
- "Frame number to insert marker to", MINFRAME, MAXFRAME);
+ 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);
+ "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",
- "Frame number to delete marker from", MINFRAME, MAXFRAME);
+ 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 +866,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,41 +880,49 @@ 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");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_ui_text(prop, "Pattern Min", "Left-bottom corner of pattern area in normalized coordinates relative to marker position");
+ 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");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_ui_text(prop, "Pattern Max", "Right-bottom corner of pattern area in normalized coordinates relative to marker position");
+ RNA_def_property_ui_text(prop, "Pattern Max",
+ "Right-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");
/* 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");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_ui_text(prop, "Search Min", "Left-bottom corner of search area in normalized coordinates relative to marker position");
+ 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");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_ui_text(prop, "Search Max", "Right-bottom corner of search area in normalized coordinates relative to marker position");
+ RNA_def_property_ui_text(prop, "Search Max",
+ "Right-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");
/* 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,15 +930,16 @@ 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);
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");
+ 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 +947,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 +955,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,15 +964,17 @@ 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);
RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "Correlation", "Minimal value of correlation between matched pattern and reference which is still treated as successful tracking");
+ 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 +983,101 @@ 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_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 +1094,80 @@ 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);
- 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);
+ 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",
+ NULL, NULL, NULL, NULL);
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_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_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 +1186,25 @@ static void rna_def_reconstructedCamera(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- 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");
+ 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 +1217,24 @@ static void rna_def_trackingReconstruction(BlenderRNA *brna)
rna_def_reconstructedCamera(brna);
- srna= RNA_def_struct(brna, "MovieTrackingReconstruction", NULL);
- RNA_def_struct_ui_text(srna, "Movie tracking reconstruction data", "Match-moving reconstruction data from tracker");
+ 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 +1246,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 +1270,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 +1293,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 +1305,27 @@ 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);
- 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);
+ 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",
+ NULL, NULL, NULL, NULL);
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,24 +1344,25 @@ 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_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);
RNA_def_property_ui_text(prop, "Active Object", "Active object in this tracking data object");
}
@@ -1347,45 +1381,50 @@ 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);
- 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);
+ 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",
+ NULL, NULL, NULL, NULL);
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);
- 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);
+ 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",
+ NULL, NULL, NULL, NULL);
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");
+ RNA_def_property_int_funcs(prop, "rna_tracking_active_object_index_get", "rna_tracking_active_object_index_set",
+ "rna_tracking_active_object_index_range");
RNA_def_property_ui_text(prop, "Active Object Index", "Index of active object");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
}
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 1bfed372626..a70eac58142 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..b4b8ee07924 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.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 *****
@@ -38,12 +38,14 @@
#ifdef RNA_RUNTIME
-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)
+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 +63,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 +86,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 +95,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 +109,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 +133,44 @@ 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_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_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 +185,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 +222,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 +264,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 +305,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 +388,57 @@ 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,47 +448,47 @@ 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
+#endif
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 919ee215f29..0490282f617 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,9 +197,9 @@ 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
+ /* 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
* things from getting too blown out
*/
@@ -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;
}
@@ -331,16 +331,17 @@ 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)
+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,19 +352,20 @@ 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;
}
-static EnumPropertyItem *rna_userdef_compute_device_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
+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 +379,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 +414,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 +465,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 +475,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");
@@ -486,74 +488,74 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "ThemeFontStyle");
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 +566,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 +611,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 +634,111 @@ 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_tooltip", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
+ RNA_def_property_ui_text(prop, "Tooltip 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 +748,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 +819,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 +848,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 +859,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 +870,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 +890,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");
@@ -914,22 +920,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");
@@ -940,80 +946,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", "");
@@ -1021,20 +1027,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", "");
@@ -1048,63 +1054,73 @@ 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, "camera", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Camera", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop = RNA_def_property(srna, "empty", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Empty", "");
+ 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");
@@ -1114,64 +1130,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", "");
@@ -1186,7 +1202,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");
@@ -1194,23 +1210,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", "");
@@ -1219,46 +1235,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", "");
@@ -1272,7 +1288,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");
@@ -1280,37 +1296,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", "");
@@ -1324,19 +1340,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");
@@ -1348,7 +1364,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");
@@ -1363,38 +1379,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", "");
@@ -1407,7 +1423,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");
@@ -1423,62 +1439,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", "");
@@ -1492,7 +1508,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");
@@ -1500,55 +1516,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);
@@ -1563,14 +1579,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");
@@ -1584,14 +1600,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");
@@ -1604,19 +1620,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", "");
@@ -1630,7 +1646,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");
@@ -1639,48 +1655,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", "");
@@ -1694,89 +1710,101 @@ 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, "movieclip_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_float_sdna(prop, NULL, "movieclip");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Clip Strip", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ 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", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop = RNA_def_property(srna, "preview_back", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_float_sdna(prop, NULL, "preview_back");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Preview Background", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
}
static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
@@ -1786,7 +1814,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");
@@ -1794,72 +1822,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", "");
@@ -1873,7 +1901,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");
@@ -1881,42 +1909,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", "");
@@ -1928,31 +1956,32 @@ 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_ui_text(prop, "Colored Constraints",
+ "Allow the use of colors indicating constraints/keyed status");
RNA_def_property_update(prop, 0, "rna_userdef_update");
}
@@ -1963,83 +1992,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_ui_text(prop, "Selected Marker", "Color of selected 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");
@@ -2056,7 +2085,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", ""},
@@ -2072,131 +2101,132 @@ 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 */
+ /* XXX: for now putting this in presets is silly - its just Default */
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
- 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");
@@ -2208,12 +2238,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);
}
@@ -2255,30 +2285,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");
@@ -2298,13 +2328,14 @@ static void rna_def_userdef_view(BlenderRNA *brna)
{USER_TIMECODE_MILLISECONDS, "MILLISECONDS", 0, "Compact with Milliseconds",
"Similar to SMPTE (Compact), except that instead of frames, "
"milliseconds are shown instead"},
- {USER_TIMECODE_SECONDS_ONLY, "SECONDS_ONLY", 0, "Only Seconds", "Direct conversion of frame numbers to seconds"},
+ {USER_TIMECODE_SECONDS_ONLY, "SECONDS_ONLY", 0, "Only Seconds",
+ "Direct conversion of frame numbers to seconds"},
{0, NULL, 0, NULL, NULL}};
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);
@@ -2313,185 +2344,194 @@ 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");
+ prop = RNA_def_property(srna, "quit_dialog", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_QUIT_PROMPT);
+ RNA_def_property_ui_text(prop, "Prompt Quit",
+ "Asks for confirmation when quitting through the window close button");
+
/* 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");
+ "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");
+ 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");
+ "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_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);
@@ -2510,17 +2550,18 @@ 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"},
+ {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);
@@ -2528,171 +2569,186 @@ 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");
+ "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");
+ 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");
+ "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);
+ /* auto keyframing */
+ 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)");
+ "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");
+ 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");
+ RNA_def_property_ui_text(prop, "Allow Negative Frames",
+ "Current frame number can be manually set to a negative value");
+
+ /* fcurve opacity */
+ prop = RNA_def_property(srna, "fcurve_unselected_alpha", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "fcu_inactive_alpha");
+ RNA_def_property_range(prop, 0.001f, 1.0f);
+ RNA_def_property_ui_text(prop, "Unselected F-Curve Visibility",
+ "Amount that unselected F-Curves stand out from the background (Graph Editor)");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
/* 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");
+ 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");
}
@@ -2713,7 +2769,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", ""},
@@ -2741,19 +2797,19 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{2, "OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage"},
#endif
#ifdef WITH_JACK
- {3, "JACK", 0, "Jack", "Jack device - open source pro audio, recommended for pro audio users"},
+ {3, "JACK", 0, "Jack", "JACK - Audio Connection Kit, recommended for pro audio users"},
#endif
{0, NULL, 0, NULL, NULL}};
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}};
@@ -2779,7 +2835,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{USER_DRAW_AUTOMATIC, "AUTOMATIC", 0, "Automatic", "Automatically set based on graphics card and driver"},
{USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer",
"Use a third buffer for minimal redraws at the cost of more memory"},
- {USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws"},
+ {USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap",
+ "Redraw all overlapping regions, minimal memory usage but more redraws"},
{USER_DRAW_OVERLAP_FLIP, "OVERLAP_FLIP", 0, "Overlap Flip",
"Redraw all overlapping regions, minimal memory usage but more redraws "
"(for graphics drivers that do flipping)"},
@@ -2812,7 +2869,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{ 0, "", 0, "In progress", ""},
/* using the utf8 flipped form of Arabic (العربية) */
{21, "ARABIC", 0, "Arabic (ﺔﻴﺑﺮﻌﻟﺍ)", "ar_EG"},
- {12, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese (Português do Brasil)", "pt_BR"},
+ {12, "BRAZILIAN_PORTUGUESE", 0, "Portuguese (Português)", "pt"},
{22, "BULGARIAN", 0, "Bulgarian (Български)", "bg_BG"},
{10, "CATALAN", 0, "Catalan (Català)", "ca_AD"},
{16, "CROATIAN", 0, "Croatian (Hrvatski)", "hr_HR"},
@@ -2823,7 +2880,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{23, "GREEK", 0, "Greek (Ελληνικά)", "el_GR"},
{27, "INDONESIAN", 0, "Indonesian (Bahasa indonesia)", "id_ID"},
{ 2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"},
- {29, "KYRGYZ", 0, "Kyrgyz (Kyrgyz tili)", "ki"},
+ {29, "KYRGYZ", 0, "Kyrgyz (Кыргыз тили)", "ki_KG"},
{24, "KOREAN", 0, "Korean (한국 언어)", "ko_KR"},
{25, "NEPALI", 0, "Nepali (नेपाली)", "ne_NP"},
/* using the utf8 flipped form of Persian (فارسی) */
@@ -2842,7 +2899,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);
@@ -2850,220 +2907,228 @@ 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");
+ 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_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)");
+ "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 */
+ RNA_def_property_ui_text(prop, "VBOs",
+ "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
+ /* this isn't essential but nice to check if VBO draws any differently */
+ RNA_def_property_update(prop, NC_WINDOW, 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_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)");
+ 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);
RNA_def_property_ui_text(prop, "Anisotropic Filter",
- "Quality of the anisotropic filtering (values greater than 1.0 enable anisotropic filtering)");
+ "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");
+ 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);
@@ -3090,7 +3155,8 @@ static void rna_def_userdef_input(BlenderRNA *brna)
static EnumPropertyItem view_zoom_styles[] = {
{USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down"},
{USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zoom in and out based on vertical mouse movement"},
- {USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zoom in and out like scaling the view, mouse movements relative to center"},
+ {USER_ZOOM_SCALE, "SCALE", 0, "Scale",
+ "Zoom in and out like scaling the view, mouse movements relative to center"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem view_zoom_axes[] = {
@@ -3098,142 +3164,147 @@ 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)");
+ "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");
+ 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");
+ 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)");
+ 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");
+ 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");
+ 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");
}
@@ -3244,7 +3315,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"},
@@ -3253,85 +3324,88 @@ 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");
+ 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");
+ 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");
+ 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");
@@ -3339,31 +3413,33 @@ 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_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");
+ RNA_def_property_ui_text(prop, "Save Preview Images",
+ "Enables automatic saving of preview images in the .blend file");
}
void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
@@ -3373,21 +3449,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);
}
@@ -3409,28 +3485,29 @@ 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_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", "");
@@ -3438,31 +3515,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..80dad69f124 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", ""},
@@ -357,7 +357,7 @@ EnumPropertyItem event_type_items[] = {
{NDOF_BUTTON_A, "NDOF_BUTTON_A", 0, "NDOF Button A", ""},
{NDOF_BUTTON_B, "NDOF_BUTTON_B", 0, "NDOF Button B", ""},
{NDOF_BUTTON_C, "NDOF_BUTTON_C", 0, "NDOF Button C", ""},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}};
EnumPropertyItem keymap_propvalue_items[] = {
{0, "NONE", 0, "", ""},
@@ -377,7 +377,9 @@ EnumPropertyItem operator_flag_items[] = {
{OPTYPE_UNDO, "UNDO", 0, "Undo", "Push an undo event (needed for operator redo)"},
{OPTYPE_BLOCKING, "BLOCKING", 0, "Blocking", "Block anything else from using the cursor"},
{OPTYPE_MACRO, "MACRO", 0, "Macro", "Use to check if an operator is a macro"},
- {OPTYPE_GRAB_POINTER, "GRAB_POINTER", 0, "Grab Pointer", "Use so the operator grabs the mouse focus, enables wrapping when continuous grab is enabled"},
+ {OPTYPE_GRAB_POINTER, "GRAB_POINTER", 0, "Grab Pointer",
+ "Use so the operator grabs the mouse focus, enables wrapping when continuous grab "
+ "is enabled"},
{OPTYPE_PRESET, "PRESET", 0, "Preset", "Display a preset button with the operators settings"},
{OPTYPE_INTERNAL, "INTERNAL", 0, "Internal", "Removes the operator from search results"},
{0, NULL, 0, NULL, NULL}};
@@ -386,7 +388,8 @@ 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
+ /* used as a flag */
+ {OPERATOR_PASS_THROUGH, "PASS_THROUGH", 0, "Pass Through", "Do nothing and pass the event on"},
{0, NULL, 0, NULL, NULL}};
/* flag/enum */
@@ -420,13 +423,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 +437,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 +447,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 +457,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;
+ /* utf8 buf isn't \0 terminated */
+ 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,15 +512,16 @@ 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 */
+ /* invalid value is checked on assignment so we don't need to account for this */
+ return BLI_str_utf8_size(event->utf8_buf);
}
else {
return 0;
@@ -526,77 +530,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;
@@ -606,38 +610,44 @@ 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))
+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))
+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;
- else return event_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;
}
-static EnumPropertyItem *rna_KeyMapItem_propvalue_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
+static EnumPropertyItem *rna_KeyMapItem_propvalue_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop),
+ int *UNUSED(free))
{
wmWindowManager *wm = CTX_wm_manager(C);
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 +678,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 +728,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 +742,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 +764,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 +780,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 +801,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 +834,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 +859,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 +885,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 +910,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 +918,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 +937,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 +945,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 +961,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 +982,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);
@@ -992,25 +1002,26 @@ void macro_wrapper(wmOperatorType *ot, void *userdata);
static char _operator_idname[OP_MAX_TYPENAME];
static char _operator_name[OP_MAX_TYPENAME];
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)
+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,34 +1029,37 @@ 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 {
- BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', at position %d", identifier, _operator_idname, i);
+ BKE_reportf(reports, RPT_ERROR,
+ "registering operator class: '%s', invalid bl_idname '%s', at position %d",
+ identifier, _operator_idname, i);
return NULL;
}
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);
+ (int)sizeof(dummyop.idname) - 3);
return NULL;
}
- if(dot != 1) {
- BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', "
- "must contain 1 '.' character", identifier, _operator_idname);
+ 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 +1070,10 @@ 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 */
+ /* 2 terminators and 3 to convert a.b -> A_OT_b */
+ ch = MEM_callocN(sizeof(char) * (idlen + namelen + desclen), "_operator_idname");
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 +1085,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 +1094,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 */
@@ -1106,22 +1121,23 @@ void **rna_Operator_instance(PointerRNA *ptr)
return &op->py_instance;
}
-static StructRNA *rna_MacroOperator_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
+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 +1146,10 @@ 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 */
+ /* 2 terminators and 3 to convert a.b -> A_OT_b */
+ ch = MEM_callocN(sizeof(char) * (idlen + namelen + desclen), "_operator_idname");
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 +1158,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 +1166,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 +1175,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 +1194,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 +1242,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 +1250,54 @@ 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");
+ 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_' */
+ /* else it uses the pointer size!. -3 because '.' -> '_OT_' */
+ RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME-3);
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 +1305,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,52 +1316,54 @@ static void rna_def_macro_operator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- 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");
+ 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");
#ifdef WITH_PYTHON
- RNA_def_struct_register_funcs(srna, "rna_MacroOperator_register", "rna_Operator_unregister", "rna_Operator_instance");
+ 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 +1377,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 +1399,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 +1417,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 +1431,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 +1464,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");
+ 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 +1524,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 +1554,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,30 +1575,35 @@ 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_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");
+ 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");
+ 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");
RNA_api_keyconfigs(srna);
}
@@ -1587,25 +1613,26 @@ static void rna_def_windowmanager(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- 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");
+ 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 +1645,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 +1657,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 +1679,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 +1701,50 @@ 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");
+ 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,122 +1753,124 @@ 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");
+ RNA_def_property_string_funcs(prop, "rna_wmKeyMapItem_idname_get", "rna_wmKeyMapItem_idname_length",
+ "rna_wmKeyMapItem_idname_set");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
/* 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_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);
RNA_api_keymapitem(srna);
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 35f12114a4e..bad122ab761 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.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 *****
@@ -59,7 +59,7 @@ static void rna_Operator_report(wmOperator *op, int type, const char *msg)
BKE_report(op->reports, type, msg);
}
-/* since event isnt needed... */
+/* since event isn't needed... */
static void rna_Operator_enum_search_invoke(bContext *C, wmOperator *op)
{
WM_enum_search_invoke(C, op, NULL);
@@ -82,11 +82,12 @@ void rna_event_timer_remove(struct wmWindowManager *wm, wmTimer *timer)
WM_event_remove_timer(wm, timer->win, 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)
+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 +97,21 @@ 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)
+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 +126,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);
}
@@ -141,7 +144,8 @@ static wmKeyMap *rna_keymap_new(wmKeyConfig *keyconf, const char *idname, int sp
{
if (modal == 0) {
return WM_keymap_find(keyconf, idname, spaceid, regionid);
- } else {
+ }
+ else {
return WM_modalkeymap_add(keyconf, idname, NULL); /* items will be lazy init */
}
}
@@ -172,21 +176,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 +200,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");
+ "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 +259,85 @@ 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?
+ /* better name? */
+ parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", "");
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?
+ /* better name? */
+ parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", "");
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?
+ /* better name? */
+ parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", "");
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?
+ /* better name? */
+ parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", "");
RNA_def_function_return(func, parm);
}
@@ -339,35 +347,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 +383,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 +402,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 +414,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 +428,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 +445,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 +465,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 +494,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 087716adbe3..9bc1fa2e9e3 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,64 @@ 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_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 +239,150 @@ 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_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_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_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_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_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_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 neighbouring pixels for speedup");
+ RNA_def_property_ui_text(prop, "Pixel Cache",
+ "Cache AO results in pixels and interpolate over neighboring pixels for speedup");
RNA_def_property_update(prop, 0, "rna_World_update");
- prop= RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
+ 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_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 +400,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 +448,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 */
+ RNA_def_property_update(prop, 0, "rna_World_draw_update"); /* use normal update since this isn't 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,19 +488,20 @@ 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");
- RNA_def_struct_ui_text(srna, "World", "World datablock describing the environment and ambient lighting of a scene");
+ 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);
rna_def_animdata_common(srna);
@@ -495,7 +509,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 +518,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/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt
index 96a8a4216d4..90ae423f8a3 100644
--- a/source/blender/modifiers/CMakeLists.txt
+++ b/source/blender/modifiers/CMakeLists.txt
@@ -30,6 +30,7 @@ set(INC
../blenkernel
../blenkernel/intern
../blenlib
+ ../blenfont
../blenloader
../makesdna
../makesrna
@@ -139,6 +140,10 @@ if(WITH_GAMEENGINE)
)
endif()
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
if(WITH_OPENMP)
add_definitions(-DPARALLEL=1)
endif()
diff --git a/source/blender/modifiers/MOD_modifiertypes.h b/source/blender/modifiers/MOD_modifiertypes.h
index ba2ec56d76a..ea5574a378e 100644
--- a/source/blender/modifiers/MOD_modifiertypes.h
+++ b/source/blender/modifiers/MOD_modifiertypes.h
@@ -74,7 +74,6 @@ extern ModifierTypeInfo modifierType_WeightVGMix;
extern ModifierTypeInfo modifierType_WeightVGProximity;
extern ModifierTypeInfo modifierType_DynamicPaint;
extern ModifierTypeInfo modifierType_Remesh;
-extern ModifierTypeInfo modifierType_NgonInterp;
/* MOD_util.c */
void modifier_type_init(ModifierTypeInfo *types[]);
diff --git a/source/blender/modifiers/SConscript b/source/blender/modifiers/SConscript
index 4ab3874d6fe..2b506cce2cf 100644
--- a/source/blender/modifiers/SConscript
+++ b/source/blender/modifiers/SConscript
@@ -6,7 +6,7 @@ sources = env.Glob('intern/*.c')
incs = '. ./intern'
incs += ' #/intern/guardedalloc #/intern/decimation/extern #/intern/bsp/extern #/intern/elbeem/extern #/extern/glew/include'
incs += ' ../render/extern/include ../blenloader ../bmesh'
-incs += ' ../include ../blenlib ../makesdna ../makesrna ../blenkernel ../blenkernel/intern'
+incs += ' ../include ../blenlib ../blenfont ../makesdna ../makesrna ../blenkernel ../blenkernel/intern'
incs += ' ../gpu'
incs += ' ' + env['BF_ZLIB_INC']
@@ -33,6 +33,9 @@ if env['WITH_BF_GAMEENGINE']:
incs += ' #/extern/recastnavigation'
defs.append('WITH_GAMEENGINE')
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
env.BlenderLib ( libname = 'bf_modifiers', sources = sources,
includes = Split(incs), defines=defs,
libtype=['core','player'], priority = [80, 40] )
diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c
index 7260e39e982..fd9730238f5 100644
--- a/source/blender/modifiers/intern/MOD_armature.c
+++ b/source/blender/modifiers/intern/MOD_armature.c
@@ -129,7 +129,7 @@ static void deformVerts(ModifierData *md, Object *ob,
numVerts, amd->deformflag, (float(*)[3])amd->prevCos, amd->defgrp_name);
/* free cache */
- if(amd->prevCos) {
+ if (amd->prevCos) {
MEM_freeN(amd->prevCos);
amd->prevCos= NULL;
}
@@ -142,7 +142,7 @@ static void deformVertsEM(
ArmatureModifierData *amd = (ArmatureModifierData*) md;
DerivedMesh *dm = derivedData;
- if(!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE);
+ if (!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE);
modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
@@ -150,12 +150,12 @@ static void deformVertsEM(
numVerts, amd->deformflag, (float(*)[3])amd->prevCos, amd->defgrp_name);
/* free cache */
- if(amd->prevCos) {
+ if (amd->prevCos) {
MEM_freeN(amd->prevCos);
amd->prevCos= NULL;
}
- if(!derivedData) dm->release(dm);
+ if (!derivedData) dm->release(dm);
}
static void deformMatricesEM(
@@ -166,12 +166,12 @@ static void deformMatricesEM(
ArmatureModifierData *amd = (ArmatureModifierData*) md;
DerivedMesh *dm = derivedData;
- if(!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE);
+ if (!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE);
armature_deform_verts(amd->object, ob, dm, vertexCos, defMats, numVerts,
amd->deformflag, NULL, amd->defgrp_name);
- if(!derivedData) dm->release(dm);
+ if (!derivedData) dm->release(dm);
}
static void deformMatrices(ModifierData *md, Object *ob, DerivedMesh *derivedData,
@@ -180,12 +180,12 @@ static void deformMatrices(ModifierData *md, Object *ob, DerivedMesh *derivedDat
ArmatureModifierData *amd = (ArmatureModifierData*) md;
DerivedMesh *dm = derivedData;
- if(!derivedData) dm = CDDM_from_mesh((Mesh*)ob->data, ob);
+ if (!derivedData) dm = CDDM_from_mesh((Mesh*)ob->data, ob);
armature_deform_verts(amd->object, ob, dm, vertexCos, defMats, numVerts,
amd->deformflag, NULL, amd->defgrp_name);
- if(!derivedData) dm->release(dm);
+ if (!derivedData) dm->release(dm);
}
ModifierTypeInfo modifierType_Armature = {
diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c
index 9eeffcc1488..ba74eba04a5 100644
--- a/source/blender/modifiers/intern/MOD_array.c
+++ b/source/blender/modifiers/intern/MOD_array.c
@@ -66,11 +66,11 @@ 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;
+ zero_v3(amd->offset);
amd->scale[0] = 1;
amd->scale[1] = amd->scale[2] = 0;
amd->length = 0;
@@ -149,19 +149,64 @@ static float vertarray_size(MVert *mvert, int numVerts, int axis)
float min_co, max_co;
/* if there are no vertices, width is 0 */
- if(numVerts == 0) return 0;
+ if (numVerts == 0) return 0;
/* find the minimum and maximum coordinates on the desired axis */
min_co = max_co = mvert->co[axis];
++mvert;
- for(i = 1; i < numVerts; ++i, ++mvert) {
- if(mvert->co[axis] < min_co) min_co = mvert->co[axis];
- if(mvert->co[axis] > max_co) max_co = mvert->co[axis];
+ for (i = 1; i < numVerts; ++i, ++mvert) {
+ if (mvert->co[axis] < min_co) min_co = mvert->co[axis];
+ if (mvert->co[axis] > max_co) max_co = mvert->co[axis];
}
return max_co - min_co;
}
+static int *find_doubles_index_map(BMesh *bm, BMOperator *dupe_op,
+ const ArrayModifierData *amd,
+ int *index_map_length)
+{
+ BMOperator find_op;
+ BMOIter oiter;
+ BMVert *v, *v2;
+ BMElem *ele;
+ int *index_map, i;
+
+ BMO_op_initf(bm, &find_op,
+ "finddoubles verts=%av dist=%f keepverts=%s",
+ amd->merge_dist, dupe_op, "geom");
+
+ BMO_op_exec(bm, &find_op);
+
+ i = 0;
+ BMO_ITER(ele, &oiter, bm, dupe_op, "geom", BM_ALL) {
+ BM_elem_index_set(ele, i); /* set_dirty */
+ i++;
+ }
+
+ BMO_ITER(ele, &oiter, bm, dupe_op, "newout", BM_ALL) {
+ BM_elem_index_set(ele, i); /* set_dirty */
+ i++;
+ }
+ /* above loops over all, so set all to dirty, if this is somehow
+ * setting valid values, this line can be remvoed - campbell */
+ bm->elem_index_dirty |= BM_VERT | BM_EDGE | BM_FACE;
+
+ (*index_map_length) = i;
+ index_map = MEM_callocN(sizeof(int) * (*index_map_length), "index_map");
+
+ /*element type argument doesn't do anything here*/
+ BMO_ITER(v, &oiter, bm, &find_op, "targetmapout", 0) {
+ v2 = BMO_iter_map_value_p(&oiter);
+
+ index_map[BM_elem_index_get(v)] = BM_elem_index_get(v2) + 1;
+ }
+
+ BMO_op_finish(bm, &find_op);
+
+ return index_map;
+}
+
/* Used for start/end cap.
*
* this function expects all existing vertices to be tagged,
@@ -169,29 +214,97 @@ static float vertarray_size(MVert *mvert, int numVerts, int axis)
*
* All verts will be tagged on exit.
*/
-static void bm_merge_dm_transform(BMesh* bm, DerivedMesh *dm, float mat[4][4])
+static void bm_merge_dm_transform(BMesh* bm, DerivedMesh *dm, float mat[4][4],
+ const ArrayModifierData *amd,
+ BMOperator *dupe_op,
+ const char *dupe_slot_name,
+ BMOperator *weld_op)
{
- BMVert *v;
+ BMVert *v, *v2;
BMIter iter;
DM_to_bmesh_ex(dm, bm);
- /* transform all verts */
- BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
- if (!BM_elem_flag_test(v, BM_ELEM_TAG)) {
- mul_m4_v3(mat, v->co);
- BM_elem_flag_enable(v, BM_ELEM_TAG);
+ if (amd->flags & MOD_ARR_MERGE) {
+ /* if merging is enabled, find doubles */
+
+ BMOIter oiter;
+ BMOperator find_op;
+
+ BMO_op_initf(bm, &find_op,
+ "finddoubles verts=%Hv dist=%f keepverts=%s",
+ BM_ELEM_TAG, amd->merge_dist,
+ dupe_op, dupe_slot_name);
+
+ /* append the dupe's geom to the findop input verts */
+ BMO_slot_buffer_append(&find_op, "verts", dupe_op, dupe_slot_name);
+
+ /* transform and tag verts */
+ BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ if (!BM_elem_flag_test(v, BM_ELEM_TAG)) {
+ mul_m4_v3(mat, v->co);
+ BM_elem_flag_enable(v, BM_ELEM_TAG);
+ }
+ }
+
+ BMO_op_exec(bm, &find_op);
+
+ /* add new merge targets to weld operator */
+ BMO_ITER(v, &oiter, bm, &find_op, "targetmapout", 0) {
+ v2 = BMO_iter_map_value_p(&oiter);
+ BMO_slot_map_ptr_insert(bm, weld_op, "targetmap", v, v2);
+ }
+
+ BMO_op_finish(bm, &find_op);
+ }
+ else {
+ /* transform and tag verts */
+ BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ if (!BM_elem_flag_test(v, BM_ELEM_TAG)) {
+ mul_m4_v3(mat, v->co);
+ BM_elem_flag_enable(v, BM_ELEM_TAG);
+ }
}
}
}
+static void merge_first_last(BMesh* bm,
+ const ArrayModifierData *amd,
+ BMOperator *dupe_first,
+ BMOperator *dupe_last,
+ BMOperator *weld_op)
+{
+ BMOperator find_op;
+ BMOIter oiter;
+ BMVert *v, *v2;
+
+ BMO_op_initf(bm, &find_op,
+ "finddoubles verts=%s dist=%f keepverts=%s",
+ dupe_first, "geom", amd->merge_dist,
+ dupe_first, "geom");
+
+ /* append the last dupe's geom to the findop input verts */
+ BMO_slot_buffer_append(&find_op, "verts", dupe_last, "newout");
+
+ BMO_op_exec(bm, &find_op);
+
+ /* add new merge targets to weld operator */
+ BMO_ITER(v, &oiter, bm, &find_op, "targetmapout", 0) {
+ v2 = BMO_iter_map_value_p(&oiter);
+ BMO_slot_map_ptr_insert(bm, weld_op, "targetmap", v, v2);
+ }
+
+ BMO_op_finish(bm, &find_op);
+}
+
static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
- Scene *scene, Object *ob, DerivedMesh *dm,
- int UNUSED(initFlags))
+ Scene *scene, Object *ob, DerivedMesh *dm,
+ int UNUSED(initFlags))
{
DerivedMesh *result;
- BMEditMesh *em = DM_to_editbmesh(ob, dm, NULL, FALSE);
- BMOperator op, oldop, weldop;
+ BMEditMesh *em = DM_to_editbmesh(dm, NULL, FALSE);
+ BMOperator first_dupe_op, dupe_op, old_dupe_op, weld_op;
+ BMVert **first_geom = NULL;
int i, j, indexLen;
/* offset matrix */
float offset[4][4];
@@ -204,9 +317,9 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
MVert *src_mvert;
/* need to avoid infinite recursion here */
- if(amd->start_cap && amd->start_cap != ob)
+ if (amd->start_cap && amd->start_cap != ob)
start_cap = mesh_get_derived_final(scene, amd->start_cap, CD_MASK_MESH);
- if(amd->end_cap && amd->end_cap != ob)
+ if (amd->end_cap && amd->end_cap != ob)
end_cap = mesh_get_derived_final(scene, amd->end_cap, CD_MASK_MESH);
unit_m4(offset);
@@ -214,19 +327,19 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
src_mvert = dm->getVertArray(dm);
maxVerts = dm->getNumVerts(dm);
- if(amd->offset_type & MOD_ARR_OFF_CONST)
+ if (amd->offset_type & MOD_ARR_OFF_CONST)
add_v3_v3v3(offset[3], offset[3], amd->offset);
- if(amd->offset_type & MOD_ARR_OFF_RELATIVE) {
- for(j = 0; j < 3; j++)
+ if (amd->offset_type & MOD_ARR_OFF_RELATIVE) {
+ for (j = 0; j < 3; j++)
offset[3][j] += amd->scale[j] * vertarray_size(src_mvert,
maxVerts, j);
}
- if((amd->offset_type & MOD_ARR_OFF_OBJ) && (amd->offset_ob)) {
+ if ((amd->offset_type & MOD_ARR_OFF_OBJ) && (amd->offset_ob)) {
float obinv[4][4];
float result_mat[4][4];
- if(ob)
+ if (ob)
invert_m4_m4(obinv, ob->obmat);
else
unit_m4(obinv);
@@ -237,171 +350,171 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
copy_m4_m4(offset, result_mat);
}
- /* calculate the offset matrix of the final copy (for merging) */
- unit_m4(final_offset);
-
- for(j=0; j < count - 1; j++) {
- mult_m4_m4m4(tmp_mat, offset, final_offset);
- copy_m4_m4(final_offset, tmp_mat);
- }
-
- if(amd->fit_type == MOD_ARR_FITCURVE && amd->curve_ob) {
+ if (amd->fit_type == MOD_ARR_FITCURVE && amd->curve_ob) {
Curve *cu = amd->curve_ob->data;
- if(cu) {
+ if (cu) {
float tmp_mat[3][3];
float scale;
object_to_mat3(amd->curve_ob, tmp_mat);
scale = mat3_to_scale(tmp_mat);
- if(!cu->path) {
+ if (!cu->path) {
cu->flag |= CU_PATH; // needed for path & bevlist
makeDispListCurveTypes(scene, amd->curve_ob, 0);
}
- if(cu->path)
+ if (cu->path)
length = scale*cu->path->totdist;
}
}
/* calculate the maximum number of copies which will fit within the
- prescribed length */
- if(amd->fit_type == MOD_ARR_FITLENGTH
+ * 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)
+ 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 */
count = 1;
}
- if(count < 1)
+ if (count < 1)
count = 1;
+ /* calculate the offset matrix of the final copy (for merging) */
+ unit_m4(final_offset);
+
+ for (j=0; j < count - 1; j++) {
+ mult_m4_m4m4(tmp_mat, offset, final_offset);
+ copy_m4_m4(final_offset, tmp_mat);
+ }
+
/* 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);
- BMO_op_init(em->bm, &weldop, "weldverts");
- BMO_op_initf(em->bm, &op, "dupe geom=%avef");
- oldop = op;
- for (j=0; j < count - 1; j++) {
- BMVert *v, *v2;
- BMOpSlot *s1;
- BMOpSlot *s2;
-
- BMO_op_initf(em->bm, &op, "dupe geom=%s", &oldop, j==0 ? "geom" : "newout");
- BMO_op_exec(em->bm, &op);
+ if (amd->flags & MOD_ARR_MERGE)
+ BMO_op_init(em->bm, &weld_op, "weldverts");
- s1 = BMO_slot_get(&op, "geom");
- s2 = BMO_slot_get(&op, "newout");
+ BMO_op_initf(em->bm, &dupe_op, "dupe geom=%avef");
+ first_dupe_op = dupe_op;
- BMO_op_callf(em->bm, "transform mat=%m4 verts=%s", offset, &op, "newout");
+ for (j=0; j < count - 1; j++) {
+ BMVert *v, *v2, *v3;
+ BMOpSlot *geom_slot;
+ BMOpSlot *newout_slot;
+ BMOIter oiter;
- #define _E(s, i) ((BMVert **)(s)->data.buf)[i]
+ if (j != 0)
+ BMO_op_initf(em->bm, &dupe_op, "dupe geom=%s", &old_dupe_op, "newout");
+ BMO_op_exec(em->bm, &dupe_op);
- /*calculate merge mapping*/
- if (j == 0) {
- BMOperator findop;
- BMOIter oiter;
- BMVert *v, *v2;
- BMElem *ele;
+ geom_slot = BMO_slot_get(&dupe_op, "geom");
+ newout_slot = BMO_slot_get(&dupe_op, "newout");
- BMO_op_initf(em->bm, &findop,
- "finddoubles verts=%av dist=%f keepverts=%s",
- amd->merge_dist, &op, "geom");
+ if ((amd->flags & MOD_ARR_MERGEFINAL) && j == 0) {
+ int first_geom_bytes = sizeof(BMVert*) * geom_slot->len;
+
+ /* make a copy of the initial geometry ordering so the
+ last duplicate can be merged into it */
+ first_geom = MEM_mallocN(first_geom_bytes, "first_geom");
+ memcpy(first_geom, geom_slot->data.buf, first_geom_bytes);
+ }
- i = 0;
- BMO_ITER(ele, &oiter, em->bm, &op, "geom", BM_ALL) {
- BM_elem_index_set(ele, i); /* set_dirty */
- i++;
- }
+ /* apply transformation matrix */
+ BMO_ITER(v, &oiter, em->bm, &dupe_op, "newout", BM_VERT) {
+ mul_m4_v3(offset, v->co);
+ }
- BMO_ITER(ele, &oiter, em->bm, &op, "newout", BM_ALL) {
- BM_elem_index_set(ele, i); /* set_dirty */
- i++;
+ if (amd->flags & MOD_ARR_MERGE) {
+ /*calculate merge mapping*/
+ if (j == 0) {
+ indexMap = find_doubles_index_map(em->bm, &dupe_op,
+ amd, &indexLen);
}
- /* above loops over all, so set all to dirty, if this is somehow
- * setting valid values, this line can be remvoed - campbell */
- em->bm->elem_index_dirty |= BM_VERT | BM_EDGE | BM_FACE;
+ #define _E(s, i) ((BMVert **)(s)->data.buf)[i]
- BMO_op_exec(em->bm, &findop);
+ for (i=0; i<indexLen; i++) {
+ if (!indexMap[i]) continue;
- indexLen = i;
- indexMap = MEM_callocN(sizeof(int)*indexLen, "indexMap");
+ /* merge v (from 'newout') into v2 (from old 'geom') */
+ v = _E(newout_slot, i - geom_slot->len);
+ v2 = _E(geom_slot, indexMap[i]-1);
- /*element type argument doesn't do anything here*/
- BMO_ITER(v, &oiter, em->bm, &findop, "targetmapout", 0) {
- v2 = BMO_iter_map_value_p(&oiter);
+ /* check in case the target vertex (v2) is already marked
+ for merging */
+ while((v3 = BMO_slot_map_ptr_get(em->bm, &weld_op, "targetmap", v2)))
+ v2 = v3;
- indexMap[BM_elem_index_get(v)] = BM_elem_index_get(v2)+1;
+ BMO_slot_map_ptr_insert(em->bm, &weld_op, "targetmap", v, v2);
}
- BMO_op_finish(em->bm, &findop);
+ #undef _E
}
- /*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++) {
- if (!indexMap[i]) continue;
-
- v = E(i);
- v2 = E(indexMap[i]-1);
-
- BMO_slot_map_ptr_insert(em->bm, &weldop, "targetmap", v, v2);
- }
-
- #undef E
- #undef _E
-
- BMO_op_finish(em->bm, &oldop);
- oldop = op;
+ /* already copied earlier, but after executation more slot
+ memory may be allocated */
+ if (j == 0)
+ first_dupe_op = dupe_op;
+
+ if (j >= 2)
+ BMO_op_finish(em->bm, &old_dupe_op);
+ old_dupe_op = dupe_op;
}
- if (j > 0) BMO_op_finish(em->bm, &op);
+ if ((amd->flags & MOD_ARR_MERGE) &&
+ (amd->flags & MOD_ARR_MERGEFINAL) &&
+ (count > 1))
+ {
+ /* Merge first and last copies. Note that we can't use the
+ * indexMap for this because (unless the array is forming a
+ * loop) the offset between first and last is different from
+ * dupe X to dupe X+1. */
- /* BMESH_TODO - cap ends are not welded, even though weld is called after */
+ merge_first_last(em->bm, amd, &first_dupe_op, &dupe_op, &weld_op);
+ }
/* start capping */
- if ((start_cap || end_cap) &&
-
- /* BMESH_TODO - theres a bug in DM_to_bmesh_ex() when in editmode!
- * this needs investigation, but for now at least dont crash */
- ob->mode != OB_MODE_EDIT
-
- )
- {
- BM_mesh_elem_flag_enable_all(em->bm, BM_VERT, BM_ELEM_TAG);
+ if (start_cap || end_cap) {
+ BM_mesh_elem_flag_enable_all(em->bm, BM_VERT, BM_ELEM_TAG, FALSE);
if (start_cap) {
float startoffset[4][4];
invert_m4_m4(startoffset, offset);
- bm_merge_dm_transform(em->bm, start_cap, startoffset);
+ bm_merge_dm_transform(em->bm, start_cap, startoffset, amd,
+ &first_dupe_op, "geom", &weld_op);
}
if (end_cap) {
float endoffset[4][4];
mult_m4_m4m4(endoffset, offset, final_offset);
- bm_merge_dm_transform(em->bm, end_cap, endoffset);
+ bm_merge_dm_transform(em->bm, end_cap, endoffset, amd,
+ &dupe_op, count == 1 ? "geom" : "newout", &weld_op);
}
}
/* done capping */
- if (amd->flags & MOD_ARR_MERGE)
- BMO_op_exec(em->bm, &weldop);
+ /* free remaining dupe operators */
+ BMO_op_finish(em->bm, &first_dupe_op);
+ if (count > 2)
+ BMO_op_finish(em->bm, &dupe_op);
- BMO_op_finish(em->bm, &weldop);
+ /* run merge operator */
+ if (amd->flags & MOD_ARR_MERGE) {
+ BMO_op_exec(em->bm, &weld_op);
+ BMO_op_finish(em->bm, &weld_op);
+ }
/* Bump the stack level back down to match the adjustment up above */
BMO_pop(em->bm);
@@ -409,9 +522,21 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
BLI_assert(em->looptris == NULL);
result = CDDM_from_BMEditMesh(em, NULL, FALSE, FALSE);
+ if ((amd->offset_type & MOD_ARR_OFF_OBJ) && (amd->offset_ob)) {
+ /* Update normals in case offset object has rotation. */
+
+ /* BMESH_TODO: check if normal recalc needed under any other
+ conditions? */
+
+ CDDM_calc_normals(result);
+ }
+
BMEdit_Free(em);
MEM_freeN(em);
- MEM_freeN(indexMap);
+ if (indexMap)
+ MEM_freeN(indexMap);
+ if (first_geom)
+ MEM_freeN(first_geom);
return result;
}
diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c
index 92584800f98..95447302d6c 100644
--- a/source/blender/modifiers/intern/MOD_bevel.c
+++ b/source/blender/modifiers/intern/MOD_bevel.c
@@ -83,19 +83,19 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
CustomDataMask dataMask = 0;
/* ask for vertexgroups if we need them */
- if(bmd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
+ if (bmd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
return dataMask;
}
#define EDGE_MARK 1
+#ifdef USE_BM_BEVEL_OP_AS_MOD
/* BMESH_TODO
*
* this bevel calls the operator which is missing many of the options
* which the bevel modifier in trunk has.
- * - width is interpreted as percent (not distance)
* - no vertex bevel
* - no weight bevel
*
@@ -105,10 +105,10 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
* note: this code is very close to MOD_edgesplit.c.
* note: if 0'd code from trunk included below.
*/
-static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob,
- DerivedMesh *dm,
- int UNUSED(useRenderParams),
- int UNUSED(isFinalCalc))
+static DerivedMesh *applyModifier(ModifierData *md, struct Object *UNUSED(ob),
+ DerivedMesh *dm,
+ int UNUSED(useRenderParams),
+ int UNUSED(isFinalCalc))
{
DerivedMesh *result;
BMesh *bm;
@@ -118,7 +118,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob,
BevelModifierData *bmd = (BevelModifierData*) md;
float threshold = cos((bmd->bevel_angle + 0.00001) * M_PI / 180.0);
- em = DM_to_editbmesh(ob, dm, NULL, FALSE);
+ em = DM_to_editbmesh(dm, NULL, FALSE);
bm = em->bm;
BM_mesh_normals_update(bm, FALSE);
@@ -157,7 +157,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob,
}
-#if 0 /* from trunk, see note above */
+#else /* from trunk, see note above */
static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
DerivedMesh *derivedData,
@@ -165,26 +165,32 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
int UNUSED(isFinalCalc))
{
DerivedMesh *result;
- BME_Mesh *bm;
+ BMEditMesh *em;
/*bDeformGroup *def;*/
int /*i,*/ options, defgrp_index = -1;
BevelModifierData *bmd = (BevelModifierData*) md;
- options = bmd->flags|bmd->val_flags|bmd->lim_flags|bmd->e_flags;
+ 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);
- result = BME_bmesh_to_derivedmesh(bm,derivedData);
- BME_free_mesh(bm);
+ em = DM_to_editbmesh(derivedData, NULL, FALSE);
+ BME_bevel(em, bmd->value, bmd->res, options, defgrp_index, bmd->bevel_angle, NULL, FALSE);
+ BLI_assert(em->looptris == NULL);
+ result = CDDM_from_BMEditMesh(em, NULL, TRUE, FALSE);
+ BMEdit_Free(em);
+ MEM_freeN(em);
+ /* until we allow for dirty normal flag, always calc,
+ * note: calculating on the CDDM is faster then the BMesh equivalent */
CDDM_calc_normals(result);
return result;
diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c
index 72e54754498..e4e89db403d 100644
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@ -38,6 +38,7 @@
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_modifier.h"
@@ -82,7 +83,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
{
BooleanModifierData *bmd = (BooleanModifierData*) md;
- if(bmd->object) {
+ if (bmd->object) {
DagNode *curNode = dag_get_node(forest, bmd->object);
dag_add_relation(forest, curNode, obNode,
@@ -95,14 +96,14 @@ static DerivedMesh *get_quick_derivedMesh(DerivedMesh *derivedData, DerivedMesh
{
DerivedMesh *result = NULL;
- if(derivedData->getNumPolys(derivedData) == 0 || dm->getNumPolys(dm) == 0) {
+ if (derivedData->getNumPolys(derivedData) == 0 || dm->getNumPolys(dm) == 0) {
switch(operation) {
case eBooleanModifierOp_Intersect:
result = CDDM_new(0, 0, 0, 0, 0);
break;
case eBooleanModifierOp_Union:
- if(derivedData->getNumPolys(derivedData)) result = derivedData;
+ if (derivedData->getNumPolys(derivedData)) result = derivedData;
else result = CDDM_copy(dm);
break;
@@ -124,20 +125,20 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
BooleanModifierData *bmd = (BooleanModifierData*) md;
DerivedMesh *dm;
- if(!bmd->object)
+ if (!bmd->object)
return derivedData;
dm = bmd->object->derivedFinal;
- if(dm) {
+ if (dm) {
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 modifiers operation (sergey) */
result = get_quick_derivedMesh(derivedData, dm, bmd->operation);
- if(result == NULL) {
+ if (result == NULL) {
DM_ensure_tessface(dm); /* BMESH - UNTIL MODIFIER IS UPDATED FOR MPoly */
DM_ensure_tessface(derivedData); /* BMESH - UNTIL MODIFIER IS UPDATED FOR MPoly */
@@ -151,11 +152,11 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
/* if new mesh returned, return it; otherwise there was
- * an error, so delete the modifier object */
- if(result)
+ * an error, so delete the modifier object */
+ if (result)
return result;
else
- modifier_setError(md, "Can't execute boolean operation.");
+ modifier_setError(md, "%s", TIP_("Can't execute boolean operation."));
}
return derivedData;
diff --git a/source/blender/modifiers/intern/MOD_boolean_util.c b/source/blender/modifiers/intern/MOD_boolean_util.c
index fe2a074bf87..8341bc67107 100644
--- a/source/blender/modifiers/intern/MOD_boolean_util.c
+++ b/source/blender/modifiers/intern/MOD_boolean_util.c
@@ -185,17 +185,19 @@ static void FaceIt_Fill(CSG_IteratorPtr it, CSG_IFace *face)
/* reverse face vertices if necessary */
face->vertex_index[1] = mface->v2;
- if( face_it->flip == 0 ) {
+ if ( face_it->flip == 0 ) {
face->vertex_index[0] = mface->v1;
face->vertex_index[2] = mface->v3;
- } else {
+ }
+ else {
face->vertex_index[2] = mface->v1;
face->vertex_index[0] = mface->v3;
}
if (mface->v4) {
face->vertex_index[3] = mface->v4;
face->vertex_number = 4;
- } else {
+ }
+ else {
face->vertex_number = 3;
}
@@ -234,17 +236,22 @@ static void FaceIt_Construct(
if (ob->size[0] < 0.0f) {
if (ob->size[1] < 0.0f && ob->size[2] < 0.0f) {
it->flip = 1;
- } else if (ob->size[1] >= 0.0f && ob->size[2] >= 0.0f) {
+ }
+ else if (ob->size[1] >= 0.0f && ob->size[2] >= 0.0f) {
it->flip = 1;
- } else {
+ }
+ else {
it->flip = 0;
}
- } else {
+ }
+ else {
if (ob->size[1] < 0.0f && ob->size[2] < 0.0f) {
it->flip = 0;
- } else if (ob->size[1] >= 0.0f && ob->size[2] >= 0.0f) {
+ }
+ else if (ob->size[1] >= 0.0f && ob->size[2] >= 0.0f) {
it->flip = 0;
- } else {
+ }
+ else {
it->flip = 1;
}
}
@@ -333,7 +340,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,
@@ -354,9 +361,9 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
// create a new DerivedMesh
result = CDDM_new(vertex_it->num_elements, 0, face_it->num_elements, 0, 0);
- CustomData_merge(&dm1->faceData, &result->faceData, CD_MASK_DERIVEDMESH,
+ CustomData_merge(&dm1->faceData, &result->faceData, CD_MASK_DERIVEDMESH & ~(CD_MASK_NORMAL | CD_MASK_POLYINDEX | CD_MASK_ORIGINDEX),
CD_DEFAULT, face_it->num_elements);
- CustomData_merge(&dm2->faceData, &result->faceData, CD_MASK_DERIVEDMESH,
+ CustomData_merge(&dm2->faceData, &result->faceData, CD_MASK_DERIVEDMESH & ~(CD_MASK_NORMAL | CD_MASK_POLYINDEX | CD_MASK_ORIGINDEX),
CD_DEFAULT, face_it->num_elements);
// step through the vertex iterators:
@@ -382,7 +389,7 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
origindex_layer = result->getTessFaceDataArray(result, CD_ORIGINDEX);
// step through the face iterators
- for(i = 0; !face_it->Done(face_it->it); i++) {
+ for (i = 0; !face_it->Done(face_it->it); i++) {
Mesh *orig_me;
Object *orig_ob;
Material *orig_mat;
@@ -411,7 +418,7 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
mface->v4 = (csgface.vertex_number == 4)? csgface.vertex_index[3]: 0;
// set material, based on lookup in hash table
- orig_mat= give_current_material(orig_ob, mface->mat_nr+1);
+ orig_mat = give_current_material(orig_ob, mface->mat_nr + 1);
if (mat && orig_mat) {
if (!BLI_ghash_haskey(material_hash, orig_mat)) {
@@ -422,8 +429,8 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
else
mface->mat_nr = GET_INT_FROM_POINTER(BLI_ghash_lookup(material_hash, orig_mat));
}
- else if(orig_mat) {
- if(orig_ob == ob1) {
+ else if (orig_mat) {
+ if (orig_ob == ob1) {
// No need to change materian index for faces from left operand
}
else {
@@ -433,8 +440,8 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
int a;
mat_nr = 0;
- for(a = 0; a < ob1->totcol; a++) {
- if(give_current_material(ob1, a+1) == orig_mat) {
+ for (a = 0; a < ob1->totcol; a++) {
+ if (give_current_material(ob1, a+1) == orig_mat) {
mat_nr = a;
break;
}
@@ -456,7 +463,7 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
test_index_face(mface, &result->faceData, i, csgface.vertex_number);
- if(origindex_layer && orig_ob == ob2)
+ if (origindex_layer && orig_ob == ob2)
origindex_layer[i] = ORIGINDEX_NONE;
}
@@ -466,6 +473,17 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
CDDM_calc_edges_tessface(result);
CDDM_tessfaces_to_faces(result); /*builds ngon faces from tess (mface) faces*/
+
+ /* this fixes shading issues but SHOULD NOT.
+ * TODO, find out why face normals are wrong & flicker - campbell */
+#if 0
+ DM_debug_print(result);
+
+ CustomData_free(&result->faceData, result->numTessFaceData);
+ result->numTessFaceData = 0;
+ DM_ensure_tessface(result);
+#endif
+
CDDM_calc_normals(result);
return result;
@@ -586,9 +604,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..ddfb793bd5d 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,
@@ -172,7 +172,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
else if (numEdges_dst) {
MEdge *medge, *me;
- if(bmd->randomize)
+ if (bmd->randomize)
BLI_array_randomize(edgeMap, sizeof(*edgeMap),
numEdge_src, bmd->seed);
@@ -183,17 +183,16 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
for (i = 0; i < numEdges_dst; i++) {
me = medge + edgeMap[i];
- if(!BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me->v1))) {
+ if (!BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me->v1))) {
BLI_ghash_insert(vertHash, SET_INT_IN_POINTER(me->v1),
SET_INT_IN_POINTER(BLI_ghash_size(vertHash)));
}
- if(!BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me->v2))) {
+ if (!BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me->v2))) {
BLI_ghash_insert(vertHash, SET_INT_IN_POINTER(me->v2), SET_INT_IN_POINTER(BLI_ghash_size(vertHash)));
}
}
- /* 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..15940112527 100644
--- a/source/blender/modifiers/intern/MOD_cast.c
+++ b/source/blender/modifiers/intern/MOD_cast.c
@@ -86,7 +86,7 @@ static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
flag = cmd->flag & (MOD_CAST_X|MOD_CAST_Y|MOD_CAST_Z);
- if((cmd->fac == 0.0f) || flag == 0) return 1;
+ if ((cmd->fac == 0.0f) || flag == 0) return 1;
return 0;
}
@@ -97,7 +97,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
CustomDataMask dataMask = 0;
/* ask for vertexgroups if we need them */
- if(cmd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
+ if (cmd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
return dataMask;
}
@@ -154,10 +154,10 @@ 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) {
+ if (flag & MOD_CAST_USE_OB_TRANSFORM) {
invert_m4_m4(ctrl_ob->imat, ctrl_ob->obmat);
mult_m4_m4m4(mat, ctrl_ob->imat, ob->obmat);
invert_m4_m4(imat, mat);
@@ -171,21 +171,21 @@ 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) {
+ if (flag & MOD_CAST_SIZE_FROM_RADIUS) {
len = cmd->radius;
}
else {
len = cmd->size;
}
- if(len <= 0) {
+ if (len <= 0) {
for (i = 0; i < numVerts; i++) {
len += len_v3v3(center, vertexCos[i]);
}
@@ -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;
@@ -207,10 +207,11 @@ static void sphere_do(
float weight;
copy_v3_v3(tmp_co, vertexCos[i]);
- if(ctrl_ob) {
- if(flag & MOD_CAST_USE_OB_TRANSFORM) {
+ if (ctrl_ob) {
+ if (flag & MOD_CAST_USE_OB_TRANSFORM) {
mul_m4_v3(mat, tmp_co);
- } else {
+ }
+ else {
sub_v3_v3(tmp_co, center);
}
}
@@ -239,10 +240,11 @@ static void sphere_do(
if (flag & MOD_CAST_Z)
tmp_co[2] = fac*vec[2]*len + facm*tmp_co[2];
- if(ctrl_ob) {
- if(flag & MOD_CAST_USE_OB_TRANSFORM) {
+ if (ctrl_ob) {
+ if (flag & MOD_CAST_USE_OB_TRANSFORM) {
mul_m4_v3(imat, tmp_co);
- } else {
+ }
+ else {
add_v3_v3(tmp_co, center);
}
}
@@ -257,10 +259,11 @@ static void sphere_do(
float tmp_co[3];
copy_v3_v3(tmp_co, vertexCos[i]);
- if(ctrl_ob) {
- if(flag & MOD_CAST_USE_OB_TRANSFORM) {
+ if (ctrl_ob) {
+ if (flag & MOD_CAST_USE_OB_TRANSFORM) {
mul_m4_v3(mat, tmp_co);
- } else {
+ }
+ else {
sub_v3_v3(tmp_co, center);
}
}
@@ -283,10 +286,11 @@ static void sphere_do(
if (flag & MOD_CAST_Z)
tmp_co[2] = fac*vec[2]*len + facm*tmp_co[2];
- if(ctrl_ob) {
- if(flag & MOD_CAST_USE_OB_TRANSFORM) {
+ if (ctrl_ob) {
+ if (flag & MOD_CAST_USE_OB_TRANSFORM) {
mul_m4_v3(imat, tmp_co);
- } else {
+ }
+ else {
add_v3_v3(tmp_co, center);
}
}
@@ -321,15 +325,15 @@ 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) {
- if(flag & MOD_CAST_USE_OB_TRANSFORM) {
+ if (flag & MOD_CAST_USE_OB_TRANSFORM) {
invert_m4_m4(ctrl_ob->imat, ctrl_ob->obmat);
mult_m4_m4m4(mat, ctrl_ob->imat, ob->obmat);
invert_m4_m4(imat, mat);
@@ -339,25 +343,27 @@ static void cuboid_do(
mul_v3_m4v3(center, ob->imat, ctrl_ob->obmat[3]);
}
- if((flag & MOD_CAST_SIZE_FROM_RADIUS) && has_radius) {
- for(i = 0; i < 3; i++) {
+ if ((flag & MOD_CAST_SIZE_FROM_RADIUS) && has_radius) {
+ for (i = 0; i < 3; i++) {
min[i] = -cmd->radius;
max[i] = cmd->radius;
}
- } else if(!(flag & MOD_CAST_SIZE_FROM_RADIUS) && cmd->size > 0) {
- for(i = 0; i < 3; i++) {
+ }
+ else if (!(flag & MOD_CAST_SIZE_FROM_RADIUS) && cmd->size > 0) {
+ for (i = 0; i < 3; i++) {
min[i] = -cmd->size;
max[i] = cmd->size;
}
- } else {
+ }
+ 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 +399,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++) {
@@ -406,10 +412,11 @@ static void cuboid_do(
float tmp_co[3];
copy_v3_v3(tmp_co, vertexCos[i]);
- if(ctrl_ob) {
- if(flag & MOD_CAST_USE_OB_TRANSFORM) {
+ if (ctrl_ob) {
+ if (flag & MOD_CAST_USE_OB_TRANSFORM) {
mul_m4_v3(mat, tmp_co);
- } else {
+ }
+ else {
sub_v3_v3(tmp_co, center);
}
}
@@ -421,7 +428,7 @@ static void cuboid_do(
}
for (j = 0; j < dvert[i].totweight; ++j) {
- if(dvert[i].dw[j].def_nr == defgrp_index) {
+ if (dvert[i].dw[j].def_nr == defgrp_index) {
dw = &dvert[i].dw[j];
break;
}
@@ -434,10 +441,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 +478,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 */
@@ -482,10 +489,11 @@ static void cuboid_do(
if (flag & MOD_CAST_Z)
tmp_co[2] = facm * tmp_co[2] + fac * tmp_co[2] * fbb;
- if(ctrl_ob) {
- if(flag & MOD_CAST_USE_OB_TRANSFORM) {
+ if (ctrl_ob) {
+ if (flag & MOD_CAST_USE_OB_TRANSFORM) {
mul_m4_v3(imat, tmp_co);
- } else {
+ }
+ else {
add_v3_v3(tmp_co, center);
}
}
@@ -502,10 +510,11 @@ static void cuboid_do(
float tmp_co[3];
copy_v3_v3(tmp_co, vertexCos[i]);
- if(ctrl_ob) {
- if(flag & MOD_CAST_USE_OB_TRANSFORM) {
+ if (ctrl_ob) {
+ if (flag & MOD_CAST_USE_OB_TRANSFORM) {
mul_m4_v3(mat, tmp_co);
- } else {
+ }
+ else {
sub_v3_v3(tmp_co, center);
}
}
@@ -550,10 +559,11 @@ static void cuboid_do(
if (flag & MOD_CAST_Z)
tmp_co[2] = facm * tmp_co[2] + fac * tmp_co[2] * fbb;
- if(ctrl_ob) {
- if(flag & MOD_CAST_USE_OB_TRANSFORM) {
+ if (ctrl_ob) {
+ if (flag & MOD_CAST_USE_OB_TRANSFORM) {
mul_m4_v3(imat, tmp_co);
- } else {
+ }
+ else {
add_v3_v3(tmp_co, center);
}
}
@@ -576,11 +586,12 @@ static void deformVerts(ModifierData *md, Object *ob,
if (cmd->type == MOD_CAST_TYPE_CUBOID) {
cuboid_do(cmd, ob, dm, vertexCos, numVerts);
- } else { /* MOD_CAST_TYPE_SPHERE or MOD_CAST_TYPE_CYLINDER */
+ }
+ else { /* MOD_CAST_TYPE_SPHERE or MOD_CAST_TYPE_CYLINDER */
sphere_do(cmd, ob, dm, vertexCos, numVerts);
}
- if(dm != derivedData)
+ if (dm != derivedData)
dm->release(dm);
}
@@ -593,11 +604,12 @@ static void deformVertsEM(
if (cmd->type == MOD_CAST_TYPE_CUBOID) {
cuboid_do(cmd, ob, dm, vertexCos, numVerts);
- } else { /* MOD_CAST_TYPE_SPHERE or MOD_CAST_TYPE_CYLINDER */
+ }
+ else { /* MOD_CAST_TYPE_SPHERE or MOD_CAST_TYPE_CYLINDER */
sphere_do(cmd, ob, dm, vertexCos, numVerts);
}
- if(dm != derivedData)
+ if (dm != derivedData)
dm->release(dm);
}
diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c
index 51ba9103976..d5d8439c749 100644
--- a/source/blender/modifiers/intern/MOD_cloth.c
+++ b/source/blender/modifiers/intern/MOD_cloth.c
@@ -61,7 +61,7 @@ static void initData(ModifierData *md)
clmd->point_cache = BKE_ptcache_add(&clmd->ptcaches);
/* check for alloc failing */
- if(!clmd->sim_parms || !clmd->coll_parms || !clmd->point_cache)
+ if (!clmd->sim_parms || !clmd->coll_parms || !clmd->point_cache)
return;
cloth_init (clmd);
@@ -75,16 +75,15 @@ 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)
+ if (!clmd->sim_parms || !clmd->coll_parms)
return;
}
dm = get_dm(ob, NULL, derivedData, NULL, 0);
- if(dm == derivedData)
+ if (dm == derivedData)
dm = CDDM_copy(dm);
CDDM_apply_vert_coords(dm, vertexCos);
@@ -93,7 +92,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
clothModifier_do(clmd, md->scene, ob, dm, vertexCos);
- if(result) {
+ if (result) {
result->getVertCos(result, vertexCos);
result->release(result);
}
@@ -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");
}
@@ -132,10 +125,10 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
CustomDataMask dataMask = 0;
ClothModifierData *clmd = (ClothModifierData*)md;
- if(cloth_uses_vgroup(clmd))
+ if (cloth_uses_vgroup(clmd))
dataMask |= CD_MASK_MDEFORMVERT;
- if(clmd->sim_parms->shapekey_rest != 0)
+ if (clmd->sim_parms->shapekey_rest != 0)
dataMask |= CD_MASK_CLOTH_ORCO;
return dataMask;
@@ -146,20 +139,20 @@ static void copyData(ModifierData *md, ModifierData *target)
ClothModifierData *clmd = (ClothModifierData*) md;
ClothModifierData *tclmd = (ClothModifierData*) target;
- if(tclmd->sim_parms) {
- if(tclmd->sim_parms->effector_weights)
+ if (tclmd->sim_parms) {
+ if (tclmd->sim_parms->effector_weights)
MEM_freeN(tclmd->sim_parms->effector_weights);
MEM_freeN(tclmd->sim_parms);
}
- if(tclmd->coll_parms)
+ if (tclmd->coll_parms)
MEM_freeN(tclmd->coll_parms);
BKE_ptcache_free_list(&tclmd->ptcaches);
tclmd->point_cache = NULL;
tclmd->sim_parms = MEM_dupallocN(clmd->sim_parms);
- if(clmd->sim_parms->effector_weights)
+ if (clmd->sim_parms->effector_weights)
tclmd->sim_parms->effector_weights = MEM_dupallocN(clmd->sim_parms->effector_weights);
tclmd->coll_parms = MEM_dupallocN(clmd->coll_parms);
tclmd->point_cache = BKE_ptcache_copy_list(&tclmd->ptcaches, &clmd->ptcaches);
@@ -175,19 +168,18 @@ static void freeData(ModifierData *md)
{
ClothModifierData *clmd = (ClothModifierData*) md;
- if (clmd)
- {
- if(G.rt > 0)
+ if (clmd) {
+ if (G.rt > 0)
printf("clothModifier_freeData\n");
cloth_free_modifier_extern (clmd);
- if(clmd->sim_parms) {
- if(clmd->sim_parms->effector_weights)
+ if (clmd->sim_parms) {
+ if (clmd->sim_parms->effector_weights)
MEM_freeN(clmd->sim_parms->effector_weights);
MEM_freeN(clmd->sim_parms);
}
- if(clmd->coll_parms)
+ if (clmd->coll_parms)
MEM_freeN(clmd->coll_parms);
BKE_ptcache_free_list(&clmd->ptcaches);
@@ -200,11 +192,11 @@ static void foreachIDLink(ModifierData *md, Object *ob,
{
ClothModifierData *clmd = (ClothModifierData*) md;
- if(clmd->coll_parms) {
+ if (clmd->coll_parms) {
walk(userData, ob, (ID **)&clmd->coll_parms->group);
}
- if(clmd->sim_parms && clmd->sim_parms->effector_weights) {
+ if (clmd->sim_parms && clmd->sim_parms->effector_weights) {
walk(userData, ob, (ID **)&clmd->sim_parms->effector_weights->group);
}
}
diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c
index 1476c792169..b3faf6c140a 100644
--- a/source/blender/modifiers/intern/MOD_collision.c
+++ b/source/blender/modifiers/intern/MOD_collision.c
@@ -73,19 +73,19 @@ static void freeData(ModifierData *md)
if (collmd)
{
- if(collmd->bvhtree)
+ if (collmd->bvhtree)
BLI_bvhtree_free(collmd->bvhtree);
- if(collmd->x)
+ if (collmd->x)
MEM_freeN(collmd->x);
- if(collmd->xnew)
+ if (collmd->xnew)
MEM_freeN(collmd->xnew);
- if(collmd->current_x)
+ if (collmd->current_x)
MEM_freeN(collmd->current_x);
- if(collmd->current_xnew)
+ if (collmd->current_xnew)
MEM_freeN(collmd->current_xnew);
- if(collmd->current_v)
+ if (collmd->current_v)
MEM_freeN(collmd->current_v);
- if(collmd->mfaces)
+ if (collmd->mfaces)
MEM_freeN(collmd->mfaces);
collmd->x = NULL;
@@ -117,16 +117,16 @@ static void deformVerts(ModifierData *md, Object *ob,
MVert *tempVert = NULL;
/* if possible use/create DerivedMesh */
- if(derivedData) dm = CDDM_copy(derivedData);
- else if(ob->type==OB_MESH) dm = CDDM_from_mesh(ob->data, ob);
+ if (derivedData) dm = CDDM_copy(derivedData);
+ else if (ob->type==OB_MESH) dm = CDDM_from_mesh(ob->data, ob);
- if(!ob->pd)
+ if (!ob->pd)
{
printf("CollisionModifier deformVerts: Should not happen!\n");
return;
}
- if(dm)
+ if (dm)
{
float current_time = 0;
unsigned int numverts = 0;
@@ -136,20 +136,20 @@ static void deformVerts(ModifierData *md, Object *ob,
current_time = BKE_curframe(md->scene);
- if(G.rt > 0)
+ if (G.rt > 0)
printf("current_time %f, collmd->time_xnew %f\n", current_time, collmd->time_xnew);
numverts = dm->getNumVerts ( dm );
- if((current_time > collmd->time_xnew)|| (BKE_ptcache_get_continue_physics()))
+ if ((current_time > collmd->time_xnew)|| (BKE_ptcache_get_continue_physics()))
{
unsigned int i;
// check if mesh has changed
- if(collmd->x && (numverts != collmd->numverts))
+ if (collmd->x && (numverts != collmd->numverts))
freeData((ModifierData *)collmd);
- if(collmd->time_xnew == -1000) // first time
+ if (collmd->time_xnew == -1000) // first time
{
collmd->x = dm->dupVertArray(dm); // frame start position
@@ -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,38 +203,32 @@ 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);
}
}
}
- if(dm)
+ if (dm)
dm->release(dm);
}
diff --git a/source/blender/modifiers/intern/MOD_curve.c b/source/blender/modifiers/intern/MOD_curve.c
index 0ff37c6fa76..f516f971dc0 100644
--- a/source/blender/modifiers/intern/MOD_curve.c
+++ b/source/blender/modifiers/intern/MOD_curve.c
@@ -73,7 +73,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
CustomDataMask dataMask = 0;
/* ask for vertexgroups if we need them */
- if(cmd->name[0]) dataMask |= CD_MASK_MDEFORMVERT;
+ if (cmd->name[0]) dataMask |= CD_MASK_MDEFORMVERT;
return dataMask;
}
@@ -131,11 +131,11 @@ static void deformVertsEM(
{
DerivedMesh *dm = derivedData;
- if(!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE);
+ if (!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE);
deformVerts(md, ob, dm, vertexCos, numVerts, 0, 0);
- if(!derivedData) dm->release(dm);
+ if (!derivedData) dm->release(dm);
}
diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c
index bc7771d86b0..f55faf9c183 100644
--- a/source/blender/modifiers/intern/MOD_decimate.c
+++ b/source/blender/modifiers/intern/MOD_decimate.c
@@ -38,6 +38,8 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "MEM_guardedalloc.h"
#include "BKE_mesh.h"
@@ -95,9 +97,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
if (mf->v4) numTris++;
}
- if(numTris<3) {
- modifier_setError(md,
- "Modifier requires more than 3 input faces (triangles).");
+ if (numTris<3) {
+ modifier_setError(md, "%s", TIP_("Modifier requires more than 3 input faces (triangles)."));
dm = CDDM_copy(dm);
return dm;
}
@@ -108,7 +109,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
lod.vertex_num= totvert;
lod.face_num= numTris;
- for(a=0; a<totvert; a++) {
+ for (a=0; a<totvert; a++) {
MVert *mv = &mvert[a];
float *vbCo = &lod.vertex_buffer[a*3];
float *vbNo = &lod.vertex_normal_buffer[a*3];
@@ -118,14 +119,14 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
}
numTris = 0;
- for(a=0; a<totface; a++) {
+ for (a=0; a<totface; a++) {
MFace *mf = &mface[a];
int *tri = &lod.triangle_index_buffer[3*numTris++];
tri[0]= mf->v1;
tri[1]= mf->v2;
tri[2]= mf->v3;
- if(mf->v4) {
+ if (mf->v4) {
tri = &lod.triangle_index_buffer[3*numTris++];
tri[0]= mf->v1;
tri[1]= mf->v3;
@@ -134,15 +135,15 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
}
dmd->faceCount = 0;
- if(LOD_LoadMesh(&lod) ) {
- if( LOD_PreprocessMesh(&lod) ) {
+ if (LOD_LoadMesh(&lod) ) {
+ if ( LOD_PreprocessMesh(&lod) ) {
/* we assume the decim_faces tells how much to reduce */
- while(lod.face_num > numTris*dmd->percent) {
- if( LOD_CollapseEdge(&lod)==0) break;
+ while (lod.face_num > numTris*dmd->percent) {
+ if ( LOD_CollapseEdge(&lod)==0) break;
}
- if(lod.vertex_num>2) {
+ if (lod.vertex_num>2) {
result = CDDM_new(lod.vertex_num, 0, lod.face_num, 0, 0);
dmd->faceCount = lod.face_num;
}
@@ -150,16 +151,16 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
result = CDDM_new(lod.vertex_num, 0, 0, 0, 0);
mvert = CDDM_get_verts(result);
- for(a=0; a<lod.vertex_num; a++) {
+ for (a=0; a<lod.vertex_num; a++) {
MVert *mv = &mvert[a];
float *vbCo = &lod.vertex_buffer[a*3];
copy_v3_v3(mv->co, vbCo);
}
- if(lod.vertex_num>2) {
+ if (lod.vertex_num>2) {
mface = CDDM_get_tessfaces(result);
- for(a=0; a<lod.face_num; a++) {
+ for (a=0; a<lod.face_num; a++) {
MFace *mf = &mface[a];
int *tri = &lod.triangle_index_buffer[a*3];
mf->v1 = tri[0];
@@ -172,12 +173,12 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
CDDM_calc_edges_tessface(result);
}
else
- modifier_setError(md, "Out of memory.");
+ modifier_setError(md, "%s", TIP_("Out of memory."));
LOD_FreeDecimationData(&lod);
}
else
- modifier_setError(md, "Non-manifold mesh as input.");
+ modifier_setError(md, "%s", TIP_("Non-manifold mesh as input."));
MEM_freeN(lod.vertex_buffer);
MEM_freeN(lod.vertex_normal_buffer);
diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c
index e0972ff2d32..f3d7a24e517 100644
--- a/source/blender/modifiers/intern/MOD_displace.c
+++ b/source/blender/modifiers/intern/MOD_displace.c
@@ -87,10 +87,10 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
CustomDataMask dataMask = 0;
/* ask for vertexgroups if we need them */
- if(dmd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
+ if (dmd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
/* ask for UV coordinates if we need them */
- if(dmd->texmapping == MOD_DISP_MAP_UV) dataMask |= CD_MASK_MTFACE;
+ if (dmd->texmapping == MOD_DISP_MAP_UV) dataMask |= CD_MASK_MTFACE;
return dataMask;
}
@@ -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;
}
}
@@ -153,7 +151,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
{
DisplaceModifierData *dmd = (DisplaceModifierData*) md;
- if(dmd->map_object && dmd->texmapping == MOD_DISP_MAP_OBJECT) {
+ if (dmd->map_object && dmd->texmapping == MOD_DISP_MAP_OBJECT) {
DagNode *curNode = dag_get_node(forest, dmd->map_object);
dag_add_relation(forest, curNode, obNode,
@@ -161,7 +159,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
}
- if(dmd->texmapping == MOD_DISP_MAP_GLOBAL)
+ if (dmd->texmapping == MOD_DISP_MAP_GLOBAL)
dag_add_relation(forest, obNode, obNode,
DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Displace Modifier");
@@ -179,8 +177,8 @@ static void displaceModifier_do(
float (*tex_co)[3];
float weight= 1.0f; /* init value unused but some compilers may complain */
- if(!dmd->texture) return;
- if(dmd->strength == 0.0f) return;
+ if (!dmd->texture) return;
+ if (dmd->strength == 0.0f) return;
mvert = CDDM_get_verts(dm);
modifier_get_vgroup(ob, dm, dmd->defgrp_name, &dvert, &defgrp_index);
@@ -189,13 +187,13 @@ static void displaceModifier_do(
"displaceModifier_do tex_co");
get_texture_coords((MappingInfoModifierData *)dmd, ob, dm, vertexCos, tex_co, numVerts);
- for(i = 0; i < numVerts; ++i) {
+ for (i = 0; i < numVerts; ++i) {
TexResult texres;
float delta = 0, strength = dmd->strength;
- if(dvert) {
+ if (dvert) {
weight= defvert_find_weight(dvert + i, defgrp_index);
- if(weight == 0.0f) continue;
+ if (weight == 0.0f) continue;
}
texres.nor = NULL;
@@ -203,7 +201,7 @@ static void displaceModifier_do(
delta = texres.tin - dmd->midlevel;
- if(dvert) strength *= weight;
+ if (dvert) strength *= weight;
delta *= strength;
CLAMP(delta, -10000, 10000);
@@ -246,7 +244,7 @@ static void deformVerts(ModifierData *md, Object *ob,
displaceModifier_do((DisplaceModifierData *)md, ob, dm,
vertexCos, numVerts);
- if(dm != derivedData)
+ if (dm != derivedData)
dm->release(dm);
}
@@ -259,7 +257,7 @@ static void deformVertsEM(
displaceModifier_do((DisplaceModifierData *)md, ob, dm,
vertexCos, numVerts);
- if(dm != derivedData)
+ if (dm != derivedData)
dm->release(dm);
}
diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c
index c7b4d41e646..5005e2c010d 100644
--- a/source/blender/modifiers/intern/MOD_dynamicpaint.c
+++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c
@@ -75,7 +75,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
if (pmd->canvas) {
DynamicPaintSurface *surface = pmd->canvas->surfaces.first;
- for(; surface; surface=surface->next) {
+ for (; surface; surface=surface->next) {
/* tface */
if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ ||
surface->init_color_type == MOD_DPAINT_INITIAL_TEXTURE) {
@@ -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");
}
@@ -145,10 +143,10 @@ static void foreachIDLink(ModifierData *md, Object *ob,
{
DynamicPaintModifierData *pmd = (DynamicPaintModifierData*) md;
- if(pmd->canvas) {
+ if (pmd->canvas) {
DynamicPaintSurface *surface = pmd->canvas->surfaces.first;
- for(; surface; surface=surface->next) {
+ for (; surface; surface=surface->next) {
walk(userData, ob, (ID **)&surface->brush_group);
walk(userData, ob, (ID **)&surface->init_texture);
}
diff --git a/source/blender/modifiers/intern/MOD_edgesplit.c b/source/blender/modifiers/intern/MOD_edgesplit.c
index 1e275862b5c..6ffacba3b68 100644
--- a/source/blender/modifiers/intern/MOD_edgesplit.c
+++ b/source/blender/modifiers/intern/MOD_edgesplit.c
@@ -57,7 +57,7 @@
#define EDGE_MARK 1
-static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd, Object *ob)
+static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd, Object *UNUSED(ob))
{
DerivedMesh *result;
BMesh *bm;
@@ -66,7 +66,7 @@ static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd, Obj
BMEdge *e;
float threshold = cos((emd->split_angle + 0.00001) * M_PI / 180.0);
- em = DM_to_editbmesh(ob, dm, NULL, FALSE);
+ em = DM_to_editbmesh(dm, NULL, FALSE);
bm = em->bm;
BM_mesh_normals_update(bm, FALSE);
@@ -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);
+ }
}
}
}
@@ -98,6 +103,8 @@ static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd, Obj
BMO_pop(bm);
+ /* BM_mesh_validate(bm); */ /* for troubleshooting */
+
BLI_assert(em->looptris == NULL);
result = CDDM_from_BMEditMesh(em, NULL, TRUE, FALSE);
BMEdit_Free(em);
@@ -110,8 +117,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;
}
@@ -128,7 +134,7 @@ static void copyData(ModifierData *md, ModifierData *target)
static DerivedMesh *edgesplitModifier_do(EdgeSplitModifierData *emd,
Object *ob, DerivedMesh *dm)
{
- if(!(emd->flags & (MOD_EDGESPLIT_FROMANGLE | MOD_EDGESPLIT_FROMFLAG)))
+ if (!(emd->flags & (MOD_EDGESPLIT_FROMANGLE | MOD_EDGESPLIT_FROMFLAG)))
return dm;
return doEdgeSplit(dm, emd, ob);
@@ -143,7 +149,7 @@ static DerivedMesh *applyModifier(
result = edgesplitModifier_do(emd, ob, derivedData);
- if(result != derivedData)
+ if (result != derivedData)
CDDM_calc_normals(result);
return result;
diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c
index 89e47094108..32d88fe28bc 100644
--- a/source/blender/modifiers/intern/MOD_explode.c
+++ b/source/blender/modifiers/intern/MOD_explode.c
@@ -67,7 +67,7 @@ static void freeData(ModifierData *md)
{
ExplodeModifierData *emd= (ExplodeModifierData*) md;
- if(emd->facepa) MEM_freeN(emd->facepa);
+ if (emd->facepa) MEM_freeN(emd->facepa);
}
static void copyData(ModifierData *md, ModifierData *target)
{
@@ -88,7 +88,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
ExplodeModifierData *emd= (ExplodeModifierData*) md;
CustomDataMask dataMask = 0;
- if(emd->vgroup)
+ if (emd->vgroup)
dataMask |= CD_MASK_MDEFORMVERT;
return dataMask;
@@ -115,7 +115,7 @@ static void createFacepa(ExplodeModifierData *emd,
BLI_srandom(psys->seed);
- if(emd->facepa)
+ if (emd->facepa)
MEM_freeN(emd->facepa);
facepa = emd->facepa = MEM_callocN(sizeof(int)*totface, "explode_facepa");
@@ -123,21 +123,21 @@ static void createFacepa(ExplodeModifierData *emd,
vertpa = MEM_callocN(sizeof(int)*totvert, "explode_vertpa");
/* initialize all faces & verts to no particle */
- for(i=0; i<totface; i++)
+ for (i=0; i<totface; i++)
facepa[i]=totpart;
for (i=0; i<totvert; i++)
vertpa[i]=totpart;
/* set protected verts */
- if(emd->vgroup){
+ if (emd->vgroup) {
MDeformVert *dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
- if(dvert){
+ if (dvert) {
const int defgrp_index= emd->vgroup-1;
- for(i=0; i<totvert; i++, dvert++){
+ for (i=0; i<totvert; i++, dvert++) {
float val = BLI_frand();
val = (1.0f-emd->protect)*val + emd->protect*0.5f;
- if(val < defvert_find_weight(dvert, defgrp_index))
+ if (val < defvert_find_weight(dvert, defgrp_index))
vertpa[i] = -1;
}
}
@@ -145,17 +145,17 @@ static void createFacepa(ExplodeModifierData *emd,
/* make tree of emitter locations */
tree=BLI_kdtree_new(totpart);
- for(p=0,pa=psys->particles; p<totpart; p++,pa++){
+ for (p=0,pa=psys->particles; p<totpart; p++,pa++) {
psys_particle_on_emitter(psmd,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,NULL,NULL,NULL,NULL,NULL);
BLI_kdtree_insert(tree, p, co, NULL);
}
BLI_kdtree_balance(tree);
/* set face-particle-indexes to nearest particle to face center */
- for(i=0,fa=mface; i<totface; i++,fa++){
+ for (i=0,fa=mface; i<totface; i++,fa++) {
add_v3_v3v3(center,mvert[fa->v1].co,mvert[fa->v2].co);
add_v3_v3(center, mvert[fa->v3].co);
- if(fa->v4){
+ if (fa->v4) {
add_v3_v3(center, mvert[fa->v4].co);
mul_v3_fl(center,0.25);
}
@@ -167,19 +167,19 @@ static void createFacepa(ExplodeModifierData *emd,
v1=vertpa[fa->v1];
v2=vertpa[fa->v2];
v3=vertpa[fa->v3];
- if(fa->v4)
+ if (fa->v4)
v4=vertpa[fa->v4];
- if(v1>=0 && v2>=0 && v3>=0 && (fa->v4==0 || v4>=0))
+ if (v1>=0 && v2>=0 && v3>=0 && (fa->v4==0 || v4>=0))
facepa[i]=p;
- if(v1>=0) vertpa[fa->v1]=p;
- if(v2>=0) vertpa[fa->v2]=p;
- if(v3>=0) vertpa[fa->v3]=p;
- if(fa->v4 && v4>=0) vertpa[fa->v4]=p;
+ if (v1>=0) vertpa[fa->v1]=p;
+ if (v2>=0) vertpa[fa->v2]=p;
+ if (v3>=0) vertpa[fa->v3]=p;
+ if (fa->v4 && v4>=0) vertpa[fa->v4]=p;
}
- if(vertpa) MEM_freeN(vertpa);
+ if (vertpa) MEM_freeN(vertpa);
BLI_kdtree_free(tree);
}
@@ -205,13 +205,14 @@ static MFace *get_dface(DerivedMesh *dm, DerivedMesh *split, int cur, int i, MFa
}
#define SET_VERTS(a, b, c, d) \
- v[0]=mf->v##a; uv[0]=a-1; \
- v[1]=mf->v##b; uv[1]=b-1; \
- v[2]=mf->v##c; uv[2]=c-1; \
- v[3]=mf->v##d; uv[3]=d-1;
+ v[0] = mf->v##a; uv[0]=a-1; \
+ v[1] = mf->v##b; uv[1]=b-1; \
+ v[2] = mf->v##c; uv[2]=c-1; \
+ v[3] = mf->v##d; uv[3]=d-1; \
+ (void)0
-#define GET_ES(v1, v2) edgecut_get(eh, v1, v2);
-#define INT_UV(uvf, c0, c1) interp_v2_v2v2(uvf, mf->uv[c0], mf->uv[c1], 0.5f);
+#define GET_ES(v1, v2) edgecut_get(eh, v1, v2)
+#define INT_UV(uvf, c0, c1) interp_v2_v2v2(uvf, mf->uv[c0], mf->uv[c1], 0.5f)
static void remap_faces_3_6_9_12(DerivedMesh *dm, DerivedMesh *split, MFace *mf, int *facepa, int *vertpa, int i, EdgeHash *eh, int cur, int v1, int v2, int v3, int v4)
{
@@ -221,15 +222,15 @@ static void remap_faces_3_6_9_12(DerivedMesh *dm, DerivedMesh *split, MFace *mf,
facepa[cur] = vertpa[v1];
df1->v1 = v1;
- df1->v2 = GET_ES(v1, v2)
- df1->v3 = GET_ES(v2, v3)
+ df1->v2 = GET_ES(v1, v2);
+ df1->v3 = GET_ES(v2, v3);
df1->v4 = v3;
df1->flag |= ME_FACE_SEL;
facepa[cur+1] = vertpa[v2];
- df2->v1 = GET_ES(v1, v2)
+ df2->v1 = GET_ES(v1, v2);
df2->v2 = v2;
- df2->v3 = GET_ES(v2, v3)
+ df2->v3 = GET_ES(v2, v3);
df2->v4 = 0;
df2->flag &= ~ME_FACE_SEL;
@@ -246,7 +247,7 @@ static void remap_uvs_3_6_9_12(DerivedMesh *dm, DerivedMesh *split, int numlayer
MTFace *mf, *df1, *df2, *df3;
int l;
- for(l=0; l<numlayer; l++) {
+ for (l=0; l<numlayer; l++) {
mf = CustomData_get_layer_n(&split->faceData, CD_MTFACE, l);
df1 = mf+cur;
df2 = df1 + 1;
@@ -255,13 +256,13 @@ static void remap_uvs_3_6_9_12(DerivedMesh *dm, DerivedMesh *split, int numlayer
mf += i;
copy_v2_v2(df1->uv[0], mf->uv[c0]);
- INT_UV(df1->uv[1], c0, c1)
- INT_UV(df1->uv[2], c1, c2)
+ INT_UV(df1->uv[1], c0, c1);
+ INT_UV(df1->uv[2], c1, c2);
copy_v2_v2(df1->uv[3], mf->uv[c2]);
- INT_UV(df2->uv[0], c0, c1)
+ INT_UV(df2->uv[0], c0, c1);
copy_v2_v2(df2->uv[1], mf->uv[c1]);
- INT_UV(df2->uv[2], c1, c2)
+ INT_UV(df2->uv[2], c1, c2);
copy_v2_v2(df3->uv[0], mf->uv[c0]);
copy_v2_v2(df3->uv[1], mf->uv[c2]);
@@ -277,13 +278,13 @@ static void remap_faces_5_10(DerivedMesh *dm, DerivedMesh *split, MFace *mf, int
facepa[cur] = vertpa[v1];
df1->v1 = v1;
df1->v2 = v2;
- df1->v3 = GET_ES(v2, v3)
- df1->v4 = GET_ES(v1, v4)
+ df1->v3 = GET_ES(v2, v3);
+ df1->v4 = GET_ES(v1, v4);
df1->flag |= ME_FACE_SEL;
facepa[cur+1] = vertpa[v3];
- df2->v1 = GET_ES(v1, v4)
- df2->v2 = GET_ES(v2, v3)
+ df2->v1 = GET_ES(v1, v4);
+ df2->v2 = GET_ES(v2, v3);
df2->v3 = v3;
df2->v4 = v4;
df2->flag |= ME_FACE_SEL;
@@ -294,7 +295,7 @@ static void remap_uvs_5_10(DerivedMesh *dm, DerivedMesh *split, int numlayer, in
MTFace *mf, *df1, *df2;
int l;
- for(l=0; l<numlayer; l++) {
+ for (l=0; l<numlayer; l++) {
mf = CustomData_get_layer_n(&split->faceData, CD_MTFACE, l);
df1 = mf+cur;
df2 = df1 + 1;
@@ -303,11 +304,11 @@ static void remap_uvs_5_10(DerivedMesh *dm, DerivedMesh *split, int numlayer, in
copy_v2_v2(df1->uv[0], mf->uv[c0]);
copy_v2_v2(df1->uv[1], mf->uv[c1]);
- INT_UV(df1->uv[2], c1, c2)
- INT_UV(df1->uv[3], c0, c3)
+ INT_UV(df1->uv[2], c1, c2);
+ INT_UV(df1->uv[3], c0, c3);
- INT_UV(df2->uv[0], c0, c3)
- INT_UV(df2->uv[1], c1, c2)
+ INT_UV(df2->uv[0], c0, c3);
+ INT_UV(df2->uv[1], c1, c2);
copy_v2_v2(df2->uv[2], mf->uv[c2]);
copy_v2_v2(df2->uv[3], mf->uv[c3]);
@@ -323,29 +324,29 @@ static void remap_faces_15(DerivedMesh *dm, DerivedMesh *split, MFace *mf, int *
facepa[cur] = vertpa[v1];
df1->v1 = v1;
- df1->v2 = GET_ES(v1, v2)
- df1->v3 = GET_ES(v1, v3)
- df1->v4 = GET_ES(v1, v4)
+ df1->v2 = GET_ES(v1, v2);
+ df1->v3 = GET_ES(v1, v3);
+ df1->v4 = GET_ES(v1, v4);
df1->flag |= ME_FACE_SEL;
facepa[cur+1] = vertpa[v2];
- df2->v1 = GET_ES(v1, v2)
+ df2->v1 = GET_ES(v1, v2);
df2->v2 = v2;
- df2->v3 = GET_ES(v2, v3)
- df2->v4 = GET_ES(v1, v3)
+ df2->v3 = GET_ES(v2, v3);
+ df2->v4 = GET_ES(v1, v3);
df2->flag |= ME_FACE_SEL;
facepa[cur+2] = vertpa[v3];
- df3->v1 = GET_ES(v1, v3)
- df3->v2 = GET_ES(v2, v3)
+ df3->v1 = GET_ES(v1, v3);
+ df3->v2 = GET_ES(v2, v3);
df3->v3 = v3;
- df3->v4 = GET_ES(v3, v4)
+ df3->v4 = GET_ES(v3, v4);
df3->flag |= ME_FACE_SEL;
facepa[cur+3] = vertpa[v4];
- df4->v1 = GET_ES(v1, v4)
- df4->v2 = GET_ES(v1, v3)
- df4->v3 = GET_ES(v3, v4)
+ df4->v1 = GET_ES(v1, v4);
+ df4->v2 = GET_ES(v1, v3);
+ df4->v3 = GET_ES(v3, v4);
df4->v4 = v4;
df4->flag |= ME_FACE_SEL;
}
@@ -355,7 +356,7 @@ static void remap_uvs_15(DerivedMesh *dm, DerivedMesh *split, int numlayer, int
MTFace *mf, *df1, *df2, *df3, *df4;
int l;
- for(l=0; l<numlayer; l++) {
+ for (l=0; l<numlayer; l++) {
mf = CustomData_get_layer_n(&split->faceData, CD_MTFACE, l);
df1 = mf+cur;
df2 = df1 + 1;
@@ -365,23 +366,23 @@ static void remap_uvs_15(DerivedMesh *dm, DerivedMesh *split, int numlayer, int
mf += i;
copy_v2_v2(df1->uv[0], mf->uv[c0]);
- INT_UV(df1->uv[1], c0, c1)
- INT_UV(df1->uv[2], c0, c2)
- INT_UV(df1->uv[3], c0, c3)
+ INT_UV(df1->uv[1], c0, c1);
+ INT_UV(df1->uv[2], c0, c2);
+ INT_UV(df1->uv[3], c0, c3);
- INT_UV(df2->uv[0], c0, c1)
+ INT_UV(df2->uv[0], c0, c1);
copy_v2_v2(df2->uv[1], mf->uv[c1]);
- INT_UV(df2->uv[2], c1, c2)
- INT_UV(df2->uv[3], c0, c2)
+ INT_UV(df2->uv[2], c1, c2);
+ INT_UV(df2->uv[3], c0, c2);
- INT_UV(df3->uv[0], c0, c2)
- INT_UV(df3->uv[1], c1, c2)
+ INT_UV(df3->uv[0], c0, c2);
+ INT_UV(df3->uv[1], c1, c2);
copy_v2_v2(df3->uv[2], mf->uv[c2]);
- INT_UV(df3->uv[3], c2, c3)
+ INT_UV(df3->uv[3], c2, c3);
- INT_UV(df4->uv[0], c0, c3)
- INT_UV(df4->uv[1], c0, c2)
- INT_UV(df4->uv[2], c2, c3)
+ INT_UV(df4->uv[0], c0, c3);
+ INT_UV(df4->uv[1], c0, c2);
+ INT_UV(df4->uv[2], c2, c3);
copy_v2_v2(df4->uv[3], mf->uv[c3]);
}
}
@@ -394,21 +395,21 @@ static void remap_faces_7_11_13_14(DerivedMesh *dm, DerivedMesh *split, MFace *m
facepa[cur] = vertpa[v1];
df1->v1 = v1;
- df1->v2 = GET_ES(v1, v2)
- df1->v3 = GET_ES(v2, v3)
- df1->v4 = GET_ES(v1, v4)
+ df1->v2 = GET_ES(v1, v2);
+ df1->v3 = GET_ES(v2, v3);
+ df1->v4 = GET_ES(v1, v4);
df1->flag |= ME_FACE_SEL;
facepa[cur+1] = vertpa[v2];
- df2->v1 = GET_ES(v1, v2)
+ df2->v1 = GET_ES(v1, v2);
df2->v2 = v2;
- df2->v3 = GET_ES(v2, v3)
+ df2->v3 = GET_ES(v2, v3);
df2->v4 = 0;
df2->flag &= ~ME_FACE_SEL;
facepa[cur+2] = vertpa[v4];
- df3->v1 = GET_ES(v1, v4)
- df3->v2 = GET_ES(v2, v3)
+ df3->v1 = GET_ES(v1, v4);
+ df3->v2 = GET_ES(v2, v3);
df3->v3 = v3;
df3->v4 = v4;
df3->flag |= ME_FACE_SEL;
@@ -419,7 +420,7 @@ static void remap_uvs_7_11_13_14(DerivedMesh *dm, DerivedMesh *split, int numlay
MTFace *mf, *df1, *df2, *df3;
int l;
- for(l=0; l<numlayer; l++) {
+ for (l=0; l<numlayer; l++) {
mf = CustomData_get_layer_n(&split->faceData, CD_MTFACE, l);
df1 = mf+cur;
df2 = df1 + 1;
@@ -428,16 +429,16 @@ static void remap_uvs_7_11_13_14(DerivedMesh *dm, DerivedMesh *split, int numlay
mf += i;
copy_v2_v2(df1->uv[0], mf->uv[c0]);
- INT_UV(df1->uv[1], c0, c1)
- INT_UV(df1->uv[2], c1, c2)
- INT_UV(df1->uv[3], c0, c3)
+ INT_UV(df1->uv[1], c0, c1);
+ INT_UV(df1->uv[2], c1, c2);
+ INT_UV(df1->uv[3], c0, c3);
- INT_UV(df2->uv[0], c0, c1)
+ INT_UV(df2->uv[0], c0, c1);
copy_v2_v2(df2->uv[1], mf->uv[c1]);
- INT_UV(df2->uv[2], c1, c2)
+ INT_UV(df2->uv[2], c1, c2);
- INT_UV(df3->uv[0], c0, c3)
- INT_UV(df3->uv[1], c1, c2)
+ INT_UV(df3->uv[0], c0, c3);
+ INT_UV(df3->uv[1], c1, c2);
copy_v2_v2(df3->uv[2], mf->uv[c2]);
copy_v2_v2(df3->uv[3], mf->uv[c3]);
}
@@ -450,16 +451,16 @@ static void remap_faces_19_21_22(DerivedMesh *dm, DerivedMesh *split, MFace *mf,
facepa[cur] = vertpa[v1];
df1->v1 = v1;
- df1->v2 = GET_ES(v1, v2)
- df1->v3 = GET_ES(v1, v3)
+ df1->v2 = GET_ES(v1, v2);
+ df1->v3 = GET_ES(v1, v3);
df1->v4 = 0;
df1->flag &= ~ME_FACE_SEL;
facepa[cur+1] = vertpa[v2];
- df2->v1 = GET_ES(v1, v2)
+ df2->v1 = GET_ES(v1, v2);
df2->v2 = v2;
df2->v3 = v3;
- df2->v4 = GET_ES(v1, v3)
+ df2->v4 = GET_ES(v1, v3);
df2->flag |= ME_FACE_SEL;
}
@@ -468,7 +469,7 @@ static void remap_uvs_19_21_22(DerivedMesh *dm, DerivedMesh *split, int numlayer
MTFace *mf, *df1, *df2;
int l;
- for(l=0; l<numlayer; l++) {
+ for (l=0; l<numlayer; l++) {
mf = CustomData_get_layer_n(&split->faceData, CD_MTFACE, l);
df1 = mf+cur;
df2 = df1 + 1;
@@ -476,13 +477,13 @@ static void remap_uvs_19_21_22(DerivedMesh *dm, DerivedMesh *split, int numlayer
mf += i;
copy_v2_v2(df1->uv[0], mf->uv[c0]);
- INT_UV(df1->uv[1], c0, c1)
- INT_UV(df1->uv[2], c0, c2)
+ INT_UV(df1->uv[1], c0, c1);
+ INT_UV(df1->uv[2], c0, c2);
- INT_UV(df2->uv[0], c0, c1)
+ INT_UV(df2->uv[0], c0, c1);
copy_v2_v2(df2->uv[1], mf->uv[c1]);
copy_v2_v2(df2->uv[2], mf->uv[c2]);
- INT_UV(df2->uv[3], c0, c2)
+ INT_UV(df2->uv[3], c0, c2);
}
}
@@ -494,21 +495,21 @@ static void remap_faces_23(DerivedMesh *dm, DerivedMesh *split, MFace *mf, int *
facepa[cur] = vertpa[v1];
df1->v1 = v1;
- df1->v2 = GET_ES(v1, v2)
- df1->v3 = GET_ES(v2, v3)
- df1->v4 = GET_ES(v1, v3)
+ df1->v2 = GET_ES(v1, v2);
+ df1->v3 = GET_ES(v2, v3);
+ df1->v4 = GET_ES(v1, v3);
df1->flag |= ME_FACE_SEL;
facepa[cur+1] = vertpa[v2];
- df2->v1 = GET_ES(v1, v2)
+ df2->v1 = GET_ES(v1, v2);
df2->v2 = v2;
- df2->v3 = GET_ES(v2, v3)
+ df2->v3 = GET_ES(v2, v3);
df2->v4 = 0;
df2->flag &= ~ME_FACE_SEL;
facepa[cur+2] = vertpa[v3];
- df3->v1 = GET_ES(v1, v3)
- df3->v2 = GET_ES(v2, v3)
+ df3->v1 = GET_ES(v1, v3);
+ df3->v2 = GET_ES(v2, v3);
df3->v3 = v3;
df3->v4 = 0;
df3->flag &= ~ME_FACE_SEL;
@@ -519,7 +520,7 @@ static void remap_uvs_23(DerivedMesh *dm, DerivedMesh *split, int numlayer, int
MTFace *mf, *df1, *df2;
int l;
- for(l=0; l<numlayer; l++) {
+ for (l=0; l<numlayer; l++) {
mf = CustomData_get_layer_n(&split->faceData, CD_MTFACE, l);
df1 = mf+cur;
df2 = df1 + 1;
@@ -527,16 +528,16 @@ static void remap_uvs_23(DerivedMesh *dm, DerivedMesh *split, int numlayer, int
mf += i;
copy_v2_v2(df1->uv[0], mf->uv[c0]);
- INT_UV(df1->uv[1], c0, c1)
- INT_UV(df1->uv[2], c1, c2)
- INT_UV(df1->uv[3], c0, c2)
+ INT_UV(df1->uv[1], c0, c1);
+ INT_UV(df1->uv[2], c1, c2);
+ INT_UV(df1->uv[3], c0, c2);
- INT_UV(df2->uv[0], c0, c1)
+ INT_UV(df2->uv[0], c0, c1);
copy_v2_v2(df2->uv[1], mf->uv[c1]);
- INT_UV(df2->uv[2], c1, c2)
+ INT_UV(df2->uv[2], c1, c2);
- INT_UV(df2->uv[0], c0, c2)
- INT_UV(df2->uv[1], c1, c2)
+ INT_UV(df2->uv[0], c0, c2);
+ INT_UV(df2->uv[1], c1, c2);
copy_v2_v2(df2->uv[2], mf->uv[c2]);
}
}
@@ -569,7 +570,7 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
vertpa[mf->v1]=facepa[i];
vertpa[mf->v2]=facepa[i];
vertpa[mf->v3]=facepa[i];
- if(mf->v4)
+ if (mf->v4)
vertpa[mf->v4]=facepa[i];
}
@@ -579,37 +580,37 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
v2=vertpa[mf->v2];
v3=vertpa[mf->v3];
- if(v1!=v2){
+ if (v1!=v2) {
BLI_edgehash_insert(edgehash, mf->v1, mf->v2, NULL);
(*fs) |= 1;
}
- if(v2!=v3){
+ if (v2!=v3) {
BLI_edgehash_insert(edgehash, mf->v2, mf->v3, NULL);
(*fs) |= 2;
}
- if(mf->v4){
+ if (mf->v4) {
v4=vertpa[mf->v4];
- if(v3!=v4){
+ if (v3!=v4) {
BLI_edgehash_insert(edgehash, mf->v3, mf->v4, NULL);
(*fs) |= 4;
}
- if(v1!=v4){
+ if (v1!=v4) {
BLI_edgehash_insert(edgehash, mf->v1, mf->v4, NULL);
(*fs) |= 8;
}
/* mark center vertex as a fake edge split */
- if(*fs == 15)
+ if (*fs == 15)
BLI_edgehash_insert(edgehash, mf->v1, mf->v3, NULL);
}
else {
(*fs) |= 16; /* mark face as tri */
- if(v1!=v3){
+ if (v1!=v3) {
BLI_edgehash_insert(edgehash, mf->v1, mf->v3, NULL);
(*fs) |= 4;
}
@@ -619,21 +620,21 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
/* count splits & create indexes for new verts */
ehi= BLI_edgehashIterator_new(edgehash);
totesplit=totvert;
- for(; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
+ for (; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
BLI_edgehashIterator_setValue(ehi, SET_INT_IN_POINTER(totesplit));
totesplit++;
}
BLI_edgehashIterator_free(ehi);
/* count new faces due to splitting */
- for(i=0,fs=facesplit; i<totface; i++,fs++)
+ for (i=0,fs=facesplit; i<totface; i++,fs++)
totfsplit += add_faces[*fs];
splitdm= CDDM_from_template(dm, totesplit, 0, totface+totfsplit, 0, 0);
numlayer = CustomData_number_of_layers(&splitdm->faceData, CD_MTFACE);
/* copy new faces & verts (is it really this painful with custom data??) */
- for(i=0; i<totvert; i++){
+ for (i=0; i<totvert; i++) {
MVert source;
MVert *dest;
dm->getVert(dm, i, &source);
@@ -655,7 +656,7 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
/* create new verts */
ehi= BLI_edgehashIterator_new(edgehash);
- for(; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
+ for (; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
BLI_edgehashIterator_getKey(ehi, &ed_v1, &ed_v2);
esplit= GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi));
mv=CDDM_get_vert(splitdm, ed_v2);
@@ -675,7 +676,7 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
/* create new faces */
curdupface=0;//=totface;
//curdupin=totesplit;
- for(i=0,fs=facesplit; i<totface; i++,fs++){
+ for (i=0,fs=facesplit; i<totface; i++,fs++) {
mf = dm->getTessFaceData(dm, i, CD_MFACE);
switch(*fs) {
@@ -683,30 +684,30 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
case 10:
case 11:
case 15:
- SET_VERTS(1, 2, 3, 4)
+ SET_VERTS(1, 2, 3, 4);
break;
case 5:
case 6:
case 7:
- SET_VERTS(2, 3, 4, 1)
+ SET_VERTS(2, 3, 4, 1);
break;
case 9:
case 13:
- SET_VERTS(4, 1, 2, 3)
+ SET_VERTS(4, 1, 2, 3);
break;
case 12:
case 14:
- SET_VERTS(3, 4, 1, 2)
+ SET_VERTS(3, 4, 1, 2);
break;
case 21:
case 23:
- SET_VERTS(1, 2, 3, 4)
+ SET_VERTS(1, 2, 3, 4);
break;
case 19:
- SET_VERTS(2, 3, 1, 4)
+ SET_VERTS(2, 3, 1, 4);
break;
case 22:
- SET_VERTS(3, 1, 2, 4)
+ SET_VERTS(3, 1, 2, 4);
break;
}
@@ -716,18 +717,18 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
case 9:
case 12:
remap_faces_3_6_9_12(dm, splitdm, mf, facepa, vertpa, i, edgehash, curdupface, v[0], v[1], v[2], v[3]);
- if(numlayer)
+ if (numlayer)
remap_uvs_3_6_9_12(dm, splitdm, numlayer, i, curdupface, uv[0], uv[1], uv[2], uv[3]);
break;
case 5:
case 10:
remap_faces_5_10(dm, splitdm, mf, facepa, vertpa, i, edgehash, curdupface, v[0], v[1], v[2], v[3]);
- if(numlayer)
+ if (numlayer)
remap_uvs_5_10(dm, splitdm, numlayer, i, curdupface, uv[0], uv[1], uv[2], uv[3]);
break;
case 15:
remap_faces_15(dm, splitdm, mf, facepa, vertpa, i, edgehash, curdupface, v[0], v[1], v[2], v[3]);
- if(numlayer)
+ if (numlayer)
remap_uvs_15(dm, splitdm, numlayer, i, curdupface, uv[0], uv[1], uv[2], uv[3]);
break;
case 7:
@@ -735,19 +736,19 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
case 13:
case 14:
remap_faces_7_11_13_14(dm, splitdm, mf, facepa, vertpa, i, edgehash, curdupface, v[0], v[1], v[2], v[3]);
- if(numlayer)
+ if (numlayer)
remap_uvs_7_11_13_14(dm, splitdm, numlayer, i, curdupface, uv[0], uv[1], uv[2], uv[3]);
break;
case 19:
case 21:
case 22:
remap_faces_19_21_22(dm, splitdm, mf, facepa, vertpa, i, edgehash, curdupface, v[0], v[1], v[2]);
- if(numlayer)
+ if (numlayer)
remap_uvs_19_21_22(dm, splitdm, numlayer, i, curdupface, uv[0], uv[1], uv[2]);
break;
case 23:
remap_faces_23(dm, splitdm, mf, facepa, vertpa, i, edgehash, curdupface, v[0], v[1], v[2]);
- if(numlayer)
+ if (numlayer)
remap_uvs_23(dm, splitdm, numlayer, i, curdupface, uv[0], uv[1], uv[2]);
break;
case 0:
@@ -755,7 +756,7 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
df1 = get_dface(dm, splitdm, curdupface, i, mf);
facepa[curdupface] = vertpa[mf->v1];
- if(df1->v4)
+ if (df1->v4)
df1->flag |= ME_FACE_SEL;
else
df1->flag &= ~ME_FACE_SEL;
@@ -765,7 +766,7 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
curdupface += add_faces[*fs]+1;
}
- for(i=0; i<curdupface; i++) {
+ for (i=0; i<curdupface; i++) {
mf = CDDM_get_tessface(splitdm, i);
test_index_face(mf, &splitdm->faceData, i, (mf->flag & ME_FACE_SEL ? 4 : 3));
}
@@ -774,6 +775,7 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
MEM_freeN(facesplit);
MEM_freeN(vertpa);
+ CDDM_calc_edges_tessface(splitdm);
CDDM_tessfaces_to_faces(splitdm); /*builds ngon faces from tess (mface) faces*/
return splitdm;
@@ -818,13 +820,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;
}
@@ -832,7 +834,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
/* do mindex + totvert to ensure the vertex index to be the first
* with BLI_edgehashIterator_getKey */
- if(facepa[i]==totpart || cfra < (pars+facepa[i])->time)
+ if (facepa[i]==totpart || cfra < (pars+facepa[i])->time)
mindex = totvert+totpart;
else
mindex = totvert+facepa[i];
@@ -843,13 +845,13 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
BLI_edgehash_insert(vertpahash, mf->v1, mindex, NULL);
BLI_edgehash_insert(vertpahash, mf->v2, mindex, NULL);
BLI_edgehash_insert(vertpahash, mf->v3, mindex, NULL);
- if(mf->v4)
+ if (mf->v4)
BLI_edgehash_insert(vertpahash, mf->v4, mindex, NULL);
}
/* make new vertice indexes & count total vertices after duplication */
ehi= BLI_edgehashIterator_new(vertpahash);
- for(; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
+ for (; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
BLI_edgehashIterator_setValue(ehi, SET_INT_IN_POINTER(totdup));
totdup++;
}
@@ -867,7 +869,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
/* duplicate & displace vertices */
ehi= BLI_edgehashIterator_new(vertpahash);
- for(; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
+ for (; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
MVert source;
MVert *dest;
@@ -882,7 +884,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
DM_copy_vert_data(dm, explode, ed_v1, v, 1);
*dest = source;
- if(ed_v2 != totpart) {
+ if (ed_v2 != totpart) {
/* get particle */
pa= pars + ed_v2;
@@ -900,7 +902,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
sub_qt_qtqt(rot, state.rot, birth.rot);
mul_qt_v3(rot, vertco);
- if(emd->flag & eExplodeFlag_PaSize)
+ if (emd->flag & eExplodeFlag_PaSize)
mul_v3_fl(vertco,pa->size);
add_v3_v3(vertco, state.co);
@@ -915,13 +917,12 @@ 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;
- if(pa->alive==PARS_ALIVE && (emd->flag&eExplodeFlag_Alive)==0) continue;
- if(pa->alive==PARS_DEAD && (emd->flag&eExplodeFlag_Dead)==0) continue;
+ if (pa->alive==PARS_UNBORN && (emd->flag&eExplodeFlag_Unborn)==0) continue;
+ if (pa->alive==PARS_ALIVE && (emd->flag&eExplodeFlag_Alive)==0) continue;
+ if (pa->alive==PARS_DEAD && (emd->flag&eExplodeFlag_Dead)==0) continue;
}
dm->getTessFace(dm,i,&source);
@@ -929,7 +930,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
orig_v4 = source.v4;
- if(facepa[i]!=totpart && cfra < pa->time)
+ if (facepa[i]!=totpart && cfra < pa->time)
mindex = totvert+totpart;
else
mindex = totvert+facepa[i];
@@ -937,7 +938,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
source.v1 = edgecut_get(vertpahash, source.v1, mindex);
source.v2 = edgecut_get(vertpahash, source.v2, mindex);
source.v3 = edgecut_get(vertpahash, source.v3, mindex);
- if(source.v4)
+ if (source.v4)
source.v4 = edgecut_get(vertpahash, source.v4, mindex);
DM_copy_tessface_data(dm,explode,i,u,1);
@@ -945,7 +946,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
*mf = source;
/* override uv channel for particle age */
- if(mtface) {
+ if (mtface) {
float age = (cfra - pa->time)/pa->lifetime;
/* Clamp to this range to avoid flipping to the other side of the coordinates. */
CLAMP(age, 0.001f, 0.999f);
@@ -968,7 +969,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
CDDM_tessfaces_to_faces(explode);
CDDM_calc_normals(explode);
- if(psmd->psys->lattice){
+ if (psmd->psys->lattice) {
end_latt_deform(psmd->psys->lattice);
psmd->psys->lattice= NULL;
}
@@ -981,8 +982,8 @@ static ParticleSystemModifierData * findPrecedingParticlesystem(Object *ob, Modi
ModifierData *md;
ParticleSystemModifierData *psmd= NULL;
- for (md=ob->modifiers.first; emd!=md; md=md->next){
- if(md->type==eModifierType_ParticleSystem)
+ for (md=ob->modifiers.first; emd!=md; md=md->next) {
+ if (md->type==eModifierType_ParticleSystem)
psmd= (ParticleSystemModifierData*) md;
}
return psmd;
@@ -998,29 +999,29 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
DM_ensure_tessface(dm); /* BMESH - UNTIL MODIFIER IS UPDATED FOR MPoly */
- if(psmd){
+ if (psmd) {
ParticleSystem * psys=psmd->psys;
- if(psys==NULL || psys->totpart==0) return derivedData;
- if(psys->part==NULL || psys->particles==NULL) return derivedData;
- if(psmd->dm==NULL) return derivedData;
+ if (psys==NULL || psys->totpart==0) return derivedData;
+ if (psys->part==NULL || psys->particles==NULL) return derivedData;
+ if (psmd->dm==NULL) return derivedData;
/* 1. find faces to be exploded if needed */
- if(emd->facepa == NULL
+ if (emd->facepa == NULL
|| psmd->flag&eParticleSystemFlag_Pars
|| emd->flag&eExplodeFlag_CalcFaces
|| MEM_allocN_len(emd->facepa)/sizeof(int) != dm->getNumTessFaces(dm))
{
- if(psmd->flag & eParticleSystemFlag_Pars)
+ if (psmd->flag & eParticleSystemFlag_Pars)
psmd->flag &= ~eParticleSystemFlag_Pars;
- if(emd->flag & eExplodeFlag_CalcFaces)
+ if (emd->flag & eExplodeFlag_CalcFaces)
emd->flag &= ~eExplodeFlag_CalcFaces;
createFacepa(emd,psmd,derivedData);
}
/* 2. create new mesh */
- if(emd->flag & eExplodeFlag_EdgeCut){
+ if (emd->flag & eExplodeFlag_EdgeCut) {
int *facepa = emd->facepa;
DerivedMesh *splitdm=cutEdges(emd,dm);
DerivedMesh *explode=explodeMesh(emd, psmd, md->scene, ob, splitdm);
diff --git a/source/blender/modifiers/intern/MOD_fluidsim.c b/source/blender/modifiers/intern/MOD_fluidsim.c
index 8bf56193a28..9a80f241a00 100644
--- a/source/blender/modifiers/intern/MOD_fluidsim.c
+++ b/source/blender/modifiers/intern/MOD_fluidsim.c
@@ -68,7 +68,7 @@ static void copyData(ModifierData *md, ModifierData *target)
FluidsimModifierData *fluidmd= (FluidsimModifierData*) md;
FluidsimModifierData *tfluidmd= (FluidsimModifierData*) target;
- if(tfluidmd->fss)
+ if (tfluidmd->fss)
MEM_freeN(tfluidmd->fss);
tfluidmd->fss = MEM_dupallocN(fluidmd->fss);
@@ -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..9cd656c3621 100644
--- a/source/blender/modifiers/intern/MOD_fluidsim_util.c
+++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c
@@ -66,13 +66,13 @@
void fluidsim_init(FluidsimModifierData *fluidmd)
{
#ifdef WITH_MOD_FLUID
- if(fluidmd)
+ if (fluidmd)
{
FluidsimSettings *fss = MEM_callocN(sizeof(FluidsimSettings), "fluidsimsettings");
fluidmd->fss = fss;
- if(!fss)
+ if (!fss)
return;
fss->fmd = fluidmd;
@@ -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;
}
@@ -185,7 +184,7 @@ static DerivedMesh *fluidsim_read_obj(const char *filename, const MPoly *mp_exam
// ------------------------------------------------
// get numverts + numfaces first
// ------------------------------------------------
- gzf = gzopen(filename, "rb");
+ gzf = BLI_gzopen(filename, "rb");
if (!gzf)
{
return NULL;
@@ -200,24 +199,24 @@ static DerivedMesh *fluidsim_read_obj(const char *filename, const MPoly *mp_exam
// read number of normals
- if(gotBytes)
+ if (gotBytes)
gotBytes = gzread(gzf, &wri, sizeof(wri));
// skip normals
gotBytes = gzseek(gzf, numverts * 3 * sizeof(float), SEEK_CUR) != -1;
/* get no. of triangles */
- if(gotBytes)
+ if (gotBytes)
gotBytes = gzread(gzf, &wri, sizeof(wri));
numfaces = wri;
- gzclose( gzf );
+ gzclose(gzf);
// ------------------------------------------------
- if(!numfaces || !numverts || !gotBytes)
+ if (!numfaces || !numverts || !gotBytes)
return NULL;
- gzf = gzopen(filename, "rb");
+ gzf = BLI_gzopen(filename, "rb");
if (!gzf)
{
return NULL;
@@ -225,9 +224,9 @@ static DerivedMesh *fluidsim_read_obj(const char *filename, const MPoly *mp_exam
dm = CDDM_new(numverts, 0, 0, numfaces * 3, numfaces);
- if(!dm)
+ if (!dm)
{
- gzclose( gzf );
+ gzclose(gzf);
return NULL;
}
@@ -237,30 +236,30 @@ static DerivedMesh *fluidsim_read_obj(const char *filename, const MPoly *mp_exam
// read vertex position from file
mv = CDDM_get_verts(dm);
- for(i=0; i<numverts; i++, mv++)
+ for (i=0; i<numverts; i++, mv++)
gotBytes = gzread(gzf, mv->co, sizeof(float) * 3);
// should be the same as numverts
gotBytes = gzread(gzf, &wri, sizeof(wri));
- if(wri != numverts)
+ if (wri != numverts)
{
- if(dm)
+ if (dm)
dm->release(dm);
- gzclose( gzf );
+ gzclose(gzf);
return NULL;
}
normals = MEM_callocN(sizeof(short) * numverts * 3, "fluid_tmp_normals" );
- if(!normals)
+ if (!normals)
{
- if(dm)
+ if (dm)
dm->release(dm);
- gzclose( gzf );
+ gzclose(gzf);
return NULL;
}
// read normals from file (but don't save them yet)
- for(i=numverts, no_s= normals; i>0; i--, no_s += 3)
+ for (i=numverts, no_s= normals; i>0; i--, no_s += 3)
{
gotBytes = gzread(gzf, no, sizeof(float) * 3);
normal_float_to_short_v3(no_s, no);
@@ -269,11 +268,11 @@ static DerivedMesh *fluidsim_read_obj(const char *filename, const MPoly *mp_exam
/* read no. of triangles */
gotBytes = gzread(gzf, &wri, sizeof(wri));
- if(wri!=numfaces) {
+ if (wri!=numfaces) {
printf("Fluidsim: error in reading data from file.\n");
- if(dm)
+ if (dm)
dm->release(dm);
- gzclose( gzf );
+ gzclose(gzf);
MEM_freeN(normals);
return NULL;
}
@@ -281,7 +280,7 @@ static DerivedMesh *fluidsim_read_obj(const char *filename, const MPoly *mp_exam
// read triangles from file
mp = CDDM_get_polys(dm);
ml = CDDM_get_loops(dm);
- for(i=0; i < numfaces; i++, mp++, ml += 3)
+ for (i=0; i < numfaces; i++, mp++, ml += 3)
{
int face[3];
@@ -300,7 +299,7 @@ static DerivedMesh *fluidsim_read_obj(const char *filename, const MPoly *mp_exam
}
- gzclose( gzf );
+ gzclose(gzf);
CDDM_calc_edges(dm);
@@ -320,7 +319,7 @@ void fluid_get_bb(MVert *mvert, int totvert, float obmat[][4],
int i;
float vec[3];
- if(totvert == 0) {
+ if (totvert == 0) {
zero_v3(start);
zero_v3(size);
return;
@@ -331,25 +330,25 @@ void fluid_get_bb(MVert *mvert, int totvert, float obmat[][4],
bbsx = vec[0]; bbsy = vec[1]; bbsz = vec[2];
bbex = vec[0]; bbey = vec[1]; bbez = vec[2];
- for(i = 1; i < totvert; i++) {
+ for (i = 1; i < totvert; i++) {
copy_v3_v3(vec, mvert[i].co);
mul_m4_v3(obmat, vec);
- if(vec[0] < bbsx){ bbsx= vec[0]; }
- if(vec[1] < bbsy){ bbsy= vec[1]; }
- if(vec[2] < bbsz){ bbsz= vec[2]; }
- if(vec[0] > bbex){ bbex= vec[0]; }
- if(vec[1] > bbey){ bbey= vec[1]; }
- if(vec[2] > bbez){ bbez= vec[2]; }
+ if (vec[0] < bbsx) { bbsx= vec[0]; }
+ if (vec[1] < bbsy) { bbsy= vec[1]; }
+ if (vec[2] < bbsz) { bbsz= vec[2]; }
+ if (vec[0] > bbex) { bbex= vec[0]; }
+ if (vec[1] > bbey) { bbey= vec[1]; }
+ if (vec[2] > bbez) { bbez= vec[2]; }
}
// return values...
- if(start) {
+ if (start) {
start[0] = bbsx;
start[1] = bbsy;
start[2] = bbsz;
}
- if(size) {
+ if (size) {
size[0] = bbex-bbsx;
size[1] = bbey-bbsy;
size[2] = bbez-bbsz;
@@ -366,7 +365,7 @@ void fluid_estimate_memory(Object *ob, FluidsimSettings *fss, char *value)
value[0]= '\0';
- if(ob->type == OB_MESH) {
+ if (ob->type == OB_MESH) {
/* use mesh bounding box and object scaling */
mesh= ob->data;
@@ -389,15 +388,15 @@ static void fluidsim_read_vel_cache(FluidsimModifierData *fluidmd, DerivedMesh *
// mesh and vverts have to be valid from loading...
- if(fss->meshVelocities)
+ if (fss->meshVelocities)
MEM_freeN(fss->meshVelocities);
- if(len<7)
+ if (len<7)
{
return;
}
- if(fss->domainNovecgen>0) return;
+ if (fss->domainNovecgen>0) return;
fss->meshVelocities = MEM_callocN(sizeof(FluidVertexVelocity)*dm->getNumVerts(dm), "Fluidsim_velocities");
fss->totvert = totvert;
@@ -410,7 +409,7 @@ static void fluidsim_read_vel_cache(FluidsimModifierData *fluidmd, DerivedMesh *
filename[len-5] = 'e';
filename[len-4] = 'l';
- gzf = gzopen(filename, "rb");
+ gzf = BLI_gzopen(filename, "rb");
if (!gzf)
{
MEM_freeN(fss->meshVelocities);
@@ -419,16 +418,16 @@ static void fluidsim_read_vel_cache(FluidsimModifierData *fluidmd, DerivedMesh *
}
gzread(gzf, &wri, sizeof( wri ));
- if(wri != totvert)
+ if (wri != totvert)
{
MEM_freeN(fss->meshVelocities);
fss->meshVelocities = NULL;
return;
}
- for(i=0; i<totvert;i++)
+ for (i=0; i<totvert;i++)
{
- for(j=0; j<3; j++)
+ for (j=0; j<3; j++)
{
gzread(gzf, &wrf, sizeof( wrf ));
velarray[i].vel[j] = wrf;
@@ -448,9 +447,10 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim
MPoly *mpoly;
MPoly mp_example = {0};
- if(!useRenderParams) {
+ if (!useRenderParams) {
displaymode = fss->guiDisplayMode;
- } else {
+ }
+ else {
displaymode = fss->renderDisplayMode;
}
@@ -484,15 +484,15 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim
dm = fluidsim_read_obj(targetFile, &mp_example);
- if(!dm)
+ if (!dm)
{
// switch, abort background rendering when fluidsim mesh is missing
const char *strEnvName2 = "BLENDER_ELBEEMBOBJABORT"; // from blendercall.cpp
- if(G.background==1) {
- if(getenv(strEnvName2)) {
+ if (G.background==1) {
+ if (getenv(strEnvName2)) {
int elevel = atoi(getenv(strEnvName2));
- if(elevel>0) {
+ if (elevel>0) {
printf("Env. var %s set, fluid sim mesh '%s' not found, aborting render...\n",strEnvName2, targetFile);
exit(1);
}
@@ -506,13 +506,11 @@ 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
- {
- if(fss->meshVelocities)
+ else {
+ if (fss->meshVelocities)
MEM_freeN(fss->meshVelocities);
fss->meshVelocities = NULL;
@@ -535,11 +533,11 @@ DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene,
framenr= (int)scene->r.cfra;
// only handle fluidsim domains
- if(fluidmd && fluidmd->fss && (fluidmd->fss->type != OB_FLUIDSIM_DOMAIN))
+ if (fluidmd && fluidmd->fss && (fluidmd->fss->type != OB_FLUIDSIM_DOMAIN))
return dm;
// sanity check
- if(!fluidmd || (fluidmd && !fluidmd->fss))
+ if (!fluidmd || (fluidmd && !fluidmd->fss))
return dm;
fss = fluidmd->fss;
@@ -548,15 +546,14 @@ 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);
}
/* try to read from cache */
/* if the frame is there, fine, otherwise don't do anything */
- if((result = fluidsim_read_cache(ob, dm, fluidmd, framenr, useRenderParams)))
+ if ((result = fluidsim_read_cache(ob, dm, fluidmd, framenr, useRenderParams)))
return result;
return dm;
diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c
index 97e406c6960..d8fbb6f468f 100644
--- a/source/blender/modifiers/intern/MOD_hook.c
+++ b/source/blender/modifiers/intern/MOD_hook.c
@@ -81,8 +81,8 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
CustomDataMask dataMask = 0;
/* ask for vertexgroups if we need them */
- if(hmd->name[0]) dataMask |= CD_MASK_MDEFORMVERT;
- if(hmd->indexar) dataMask |= CD_MASK_ORIGINDEX;
+ if (hmd->name[0]) dataMask |= CD_MASK_MDEFORMVERT;
+ if (hmd->indexar) dataMask |= CD_MASK_ORIGINDEX;
return dataMask;
}
@@ -130,12 +130,12 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
static float hook_falloff(float *co_1, float *co_2, const float falloff_squared, float fac)
{
- if(falloff_squared) {
+ if (falloff_squared) {
float len_squared = len_squared_v3v3(co_1, co_2);
- if(len_squared > falloff_squared) {
+ if (len_squared > falloff_squared) {
return 0.0f;
}
- else if(len_squared > 0.0f) {
+ else if (len_squared > 0.0f) {
return fac * (1.0f - (len_squared / falloff_squared));
}
}
@@ -178,28 +178,28 @@ static void deformVerts_do(HookModifierData *hmd, Object *ob, DerivedMesh *dm,
* not correct them on exit editmode. - zr
*/
- if(hmd->force == 0.0f) {
+ if (hmd->force == 0.0f) {
/* do nothing, avoid annoying checks in the loop */
}
- else if(hmd->indexar) { /* vertex indices? */
+ else if (hmd->indexar) { /* vertex indices? */
const float fac_orig= hmd->force;
float fac;
const int *origindex_ar;
/* if DerivedMesh is present and has original index data, use it */
- if(dm && (origindex_ar= dm->getVertDataArray(dm, CD_ORIGINDEX))) {
- for(i= 0, index_pt= hmd->indexar; i < hmd->totindex; i++, index_pt++) {
- if(*index_pt < numVerts) {
+ if (dm && (origindex_ar= dm->getVertDataArray(dm, CD_ORIGINDEX))) {
+ for (i= 0, index_pt= hmd->indexar; i < hmd->totindex; i++, index_pt++) {
+ if (*index_pt < numVerts) {
int j;
- for(j = 0; j < numVerts; j++) {
- if(origindex_ar[j] == *index_pt) {
+ for (j = 0; j < numVerts; j++) {
+ if (origindex_ar[j] == *index_pt) {
float *co = vertexCos[j];
- if((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
- if(dvert)
+ if ((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
+ if (dvert)
fac *= defvert_find_weight(dvert+j, defgrp_index);
- if(fac) {
+ if (fac) {
mul_v3_m4v3(vec, mat, co);
interp_v3_v3v3(co, co, vec, fac);
}
@@ -210,14 +210,14 @@ static void deformVerts_do(HookModifierData *hmd, Object *ob, DerivedMesh *dm,
}
}
else { /* missing dm or ORIGINDEX */
- for(i= 0, index_pt= hmd->indexar; i < hmd->totindex; i++, index_pt++) {
- if(*index_pt < numVerts) {
+ for (i= 0, index_pt= hmd->indexar; i < hmd->totindex; i++, index_pt++) {
+ if (*index_pt < numVerts) {
float *co = vertexCos[*index_pt];
- if((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
- if(dvert)
+ if ((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
+ if (dvert)
fac *= defvert_find_weight(dvert+(*index_pt), defgrp_index);
- if(fac) {
+ if (fac) {
mul_v3_m4v3(vec, mat, co);
interp_v3_v3v3(co, co, vec, fac);
}
@@ -226,16 +226,16 @@ static void deformVerts_do(HookModifierData *hmd, Object *ob, DerivedMesh *dm,
}
}
}
- else if(dvert) { /* vertex group hook */
+ else if (dvert) { /* vertex group hook */
const float fac_orig= hmd->force;
- for(i = 0; i < max_dvert; i++, dvert++) {
+ for (i = 0; i < max_dvert; i++, dvert++) {
float fac;
float *co = vertexCos[i];
- if((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
+ if ((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) {
fac *= defvert_find_weight(dvert, defgrp_index);
- if(fac) {
+ if (fac) {
mul_v3_m4v3(vec, mat, co);
interp_v3_v3v3(co, co, vec, fac);
}
@@ -251,12 +251,12 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
HookModifierData *hmd = (HookModifierData*) md;
DerivedMesh *dm = derivedData;
/* We need a valid dm for meshes when a vgroup is set... */
- if(!dm && ob->type == OB_MESH && hmd->name[0] != '\0')
+ if (!dm && ob->type == OB_MESH && hmd->name[0] != '\0')
dm = get_dm(ob, NULL, dm, NULL, 0);
deformVerts_do(hmd, ob, dm, vertexCos, numVerts);
- if(derivedData != dm)
+ if (derivedData != dm)
dm->release(dm);
}
@@ -266,12 +266,12 @@ static void deformVertsEM(ModifierData *md, Object *ob, struct BMEditMesh *editD
HookModifierData *hmd = (HookModifierData*) md;
DerivedMesh *dm = derivedData;
/* We need a valid dm for meshes when a vgroup is set... */
- if(!dm && ob->type == OB_MESH && hmd->name[0] != '\0')
+ if (!dm && ob->type == OB_MESH && hmd->name[0] != '\0')
dm = get_dm(ob, editData, dm, NULL, 0);
deformVerts_do(hmd, ob, dm, vertexCos, numVerts);
- if(derivedData != dm)
+ if (derivedData != dm)
dm->release(dm);
}
diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c
index 00a634e8838..ca700d4d8f2 100644
--- a/source/blender/modifiers/intern/MOD_lattice.c
+++ b/source/blender/modifiers/intern/MOD_lattice.c
@@ -40,7 +40,6 @@
#include "BLI_utildefines.h"
#include "BLI_string.h"
-
#include "BKE_cdderivedmesh.h"
#include "BKE_lattice.h"
#include "BKE_modifier.h"
@@ -49,6 +48,11 @@
#include "MOD_util.h"
+static void initData(ModifierData *md)
+{
+ LatticeModifierData *lmd = (LatticeModifierData*) md;
+ lmd->strength = 1.0f;
+}
static void copyData(ModifierData *md, ModifierData *target)
{
@@ -65,7 +69,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
CustomDataMask dataMask = 0;
/* ask for vertexgroups if we need them */
- if(lmd->name[0]) dataMask |= CD_MASK_MDEFORMVERT;
+ if (lmd->name[0]) dataMask |= CD_MASK_MDEFORMVERT;
return dataMask;
}
@@ -94,7 +98,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
{
LatticeModifierData *lmd = (LatticeModifierData*) md;
- if(lmd->object) {
+ if (lmd->object) {
DagNode *latNode = dag_get_node(forest, lmd->object);
dag_add_relation(forest, latNode, obNode,
@@ -115,7 +119,7 @@ static void deformVerts(ModifierData *md, Object *ob,
modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
lattice_deform_verts(lmd->object, ob, derivedData,
- vertexCos, numVerts, lmd->name);
+ vertexCos, numVerts, lmd->name, lmd->strength);
}
static void deformVertsEM(
@@ -124,11 +128,11 @@ static void deformVertsEM(
{
DerivedMesh *dm = derivedData;
- if(!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE);
+ if (!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE);
deformVerts(md, ob, dm, vertexCos, numVerts, 0, 0);
- if(!derivedData) dm->release(dm);
+ if (!derivedData) dm->release(dm);
}
@@ -146,7 +150,7 @@ ModifierTypeInfo modifierType_Lattice = {
/* deformMatricesEM */ NULL,
/* applyModifier */ NULL,
/* applyModifierEM */ NULL,
- /* initData */ NULL,
+ /* initData */ initData,
/* requiredDataMask */ requiredDataMask,
/* freeData */ NULL,
/* isDisabled */ isDisabled,
diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c
index edef19fd032..da4a489838f 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);
@@ -209,7 +203,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
for (j= dv->totweight; j > 0; j--, dw++) {
if (dw->def_nr < defbase_tot) {
if (bone_select_array[dw->def_nr]) {
- if(dw->weight != 0.0f) {
+ if (dw->weight != 0.0f) {
break;
}
}
@@ -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_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c
index 84d1b3c92ad..08626e55231 100644
--- a/source/blender/modifiers/intern/MOD_meshdeform.c
+++ b/source/blender/modifiers/intern/MOD_meshdeform.c
@@ -39,6 +39,7 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_global.h"
@@ -65,14 +66,14 @@ static void freeData(ModifierData *md)
{
MeshDeformModifierData *mmd = (MeshDeformModifierData*) md;
- if(mmd->bindinfluences) MEM_freeN(mmd->bindinfluences);
- if(mmd->bindoffsets) MEM_freeN(mmd->bindoffsets);
- if(mmd->bindcagecos) MEM_freeN(mmd->bindcagecos);
- if(mmd->dyngrid) MEM_freeN(mmd->dyngrid);
- if(mmd->dyninfluences) MEM_freeN(mmd->dyninfluences);
- if(mmd->dynverts) MEM_freeN(mmd->dynverts);
- if(mmd->bindweights) MEM_freeN(mmd->bindweights); /* deprecated */
- if(mmd->bindcos) MEM_freeN(mmd->bindcos); /* deprecated */
+ if (mmd->bindinfluences) MEM_freeN(mmd->bindinfluences);
+ if (mmd->bindoffsets) MEM_freeN(mmd->bindoffsets);
+ if (mmd->bindcagecos) MEM_freeN(mmd->bindcagecos);
+ if (mmd->dyngrid) MEM_freeN(mmd->dyngrid);
+ if (mmd->dyninfluences) MEM_freeN(mmd->dyninfluences);
+ if (mmd->dynverts) MEM_freeN(mmd->dynverts);
+ if (mmd->bindweights) MEM_freeN(mmd->bindweights); /* deprecated */
+ if (mmd->bindcos) MEM_freeN(mmd->bindcos); /* deprecated */
}
static void copyData(ModifierData *md, ModifierData *target)
@@ -90,7 +91,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
CustomDataMask dataMask = 0;
/* ask for vertexgroups if we need them */
- if(mmd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
+ if (mmd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
return dataMask;
}
@@ -140,20 +141,20 @@ static float meshdeform_dynamic_bind(MeshDeformModifierData *mmd, float (*dco)[3
totweight= 0.0f;
size= mmd->dyngridsize;
- for(i=0; i<3; i++) {
+ for (i=0; i<3; i++) {
gridvec[i]= (vec[i] - mmd->dyncellmin[i] - mmd->dyncellwidth*0.5f)/mmd->dyncellwidth;
ivec[i]= (int)gridvec[i];
dvec[i]= gridvec[i] - ivec[i];
}
- for(i=0; i<8; i++) {
- if(i & 1) { x= ivec[0]+1; wx= dvec[0]; }
+ for (i=0; i<8; i++) {
+ if (i & 1) { x= ivec[0]+1; wx= dvec[0]; }
else { x= ivec[0]; wx= 1.0f-dvec[0]; }
- if(i & 2) { y= ivec[1]+1; wy= dvec[1]; }
+ if (i & 2) { y= ivec[1]+1; wy= dvec[1]; }
else { y= ivec[1]; wy= 1.0f-dvec[1]; }
- if(i & 4) { z= ivec[2]+1; wz= dvec[2]; }
+ if (i & 4) { z= ivec[2]+1; wz= dvec[2]; }
else { z= ivec[2]; wz= 1.0f-dvec[2]; }
CLAMP(x, 0, size-1);
@@ -165,7 +166,7 @@ static float meshdeform_dynamic_bind(MeshDeformModifierData *mmd, float (*dco)[3
cell= &mmd->dyngrid[a];
inf= mmd->dyninfluences + cell->offset;
- for(j=0; j<cell->totinfluence; j++, inf++) {
+ for (j=0; j<cell->totinfluence; j++, inf++) {
cageco= dco[inf->vertex];
cageweight= weight*inf->weight;
co[0] += cageweight*cageco[0];
@@ -196,13 +197,13 @@ static void meshdeformModifier_do(
int a, b, totvert, totcagevert, defgrp_index;
float (*cagecos)[3];
- if(!mmd->object || (!mmd->bindcagecos && !mmd->bindfunc))
+ if (!mmd->object || (!mmd->bindcagecos && !mmd->bindfunc))
return;
/* get cage derivedmesh */
- if(em) {
+ if (em) {
tmpdm= editbmesh_get_derived_cage_and_final(md->scene, ob, em, &cagedm, 0);
- if(tmpdm)
+ if (tmpdm)
tmpdm->release(tmpdm);
}
else
@@ -210,14 +211,14 @@ static void meshdeformModifier_do(
/* if we don't have one computed, use derivedmesh from data
* without any modifiers */
- if(!cagedm) {
+ if (!cagedm) {
cagedm= get_dm(mmd->object, NULL, NULL, NULL, 0);
- if(cagedm)
+ if (cagedm)
cagedm->needsFree= 1;
}
- if(!cagedm) {
- modifier_setError(md, "Can't get mesh from cage object.");
+ if (!cagedm) {
+ modifier_setError(md, "%s", TIP_("Can't get mesh from cage object."));
return;
}
@@ -229,11 +230,11 @@ static void meshdeformModifier_do(
copy_m3_m4(icagemat, iobmat);
/* bind weights if needed */
- if(!mmd->bindcagecos) {
+ if (!mmd->bindcagecos) {
static int recursive = 0;
/* progress bar redraw can make this recursive .. */
- if(!recursive) {
+ if (!recursive) {
recursive = 1;
mmd->bindfunc(md->scene, mmd, (float*)vertexCos, numVerts, cagemat);
recursive = 0;
@@ -244,17 +245,18 @@ static void meshdeformModifier_do(
totvert= numVerts;
totcagevert= cagedm->getNumVerts(cagedm);
- if(mmd->totvert != totvert) {
- modifier_setError(md, "Verts changed from %d to %d.", mmd->totvert, totvert);
+ if (mmd->totvert != totvert) {
+ modifier_setError(md, TIP_("Verts changed from %d to %d."), mmd->totvert, totvert);
cagedm->release(cagedm);
return;
}
else if (mmd->totcagevert != totcagevert) {
- modifier_setError(md, "Cage verts changed from %d to %d.", mmd->totcagevert, totcagevert);
+ modifier_setError(md, TIP_("Cage verts changed from %d to %d."), mmd->totcagevert, totcagevert);
cagedm->release(cagedm);
return;
- } else if (mmd->bindcagecos == NULL) {
- modifier_setError(md, "Bind data missing.");
+ }
+ else if (mmd->bindcagecos == NULL) {
+ modifier_setError(md, "%s", TIP_("Bind data missing."));
cagedm->release(cagedm);
return;
}
@@ -268,11 +270,11 @@ static void meshdeformModifier_do(
bindcagecos= (float(*)[3])mmd->bindcagecos;
dco= MEM_callocN(sizeof(*dco)*totcagevert, "MDefDco");
- for(a=0; a<totcagevert; a++) {
+ for (a=0; a<totcagevert; a++) {
/* get cage vertex in world space with binding transform */
copy_v3_v3(co, cagecos[a]);
- if(G.rt != 527) {
+ if (G.rt != 527) {
mul_m4_v3(mmd->bindmat, co);
/* compute difference with world space bind coord */
sub_v3_v3v3(dco[a], co, bindcagecos[a]);
@@ -286,12 +288,12 @@ static void meshdeformModifier_do(
/* do deformation */
fac= 1.0f;
- for(b=0; b<totvert; b++) {
- if(mmd->flag & MOD_MDEF_DYNAMIC_BIND)
- if(!mmd->dynverts[b])
+ for (b=0; b<totvert; b++) {
+ if (mmd->flag & MOD_MDEF_DYNAMIC_BIND)
+ if (!mmd->dynverts[b])
continue;
- if(dvert) {
+ if (dvert) {
fac= defvert_find_weight(&dvert[b], defgrp_index);
if (mmd->flag & MOD_MDEF_INVERT_VGROUP) {
@@ -303,7 +305,7 @@ static void meshdeformModifier_do(
}
}
- if(mmd->flag & MOD_MDEF_DYNAMIC_BIND) {
+ if (mmd->flag & MOD_MDEF_DYNAMIC_BIND) {
/* transform coordinate into cage's local space */
mul_v3_m4v3(co, cagemat, vertexCos[b]);
totweight= meshdeform_dynamic_bind(mmd, dco, co);
@@ -312,17 +314,17 @@ static void meshdeformModifier_do(
totweight= 0.0f;
zero_v3(co);
- for(a=offsets[b]; a<offsets[b+1]; a++) {
+ for (a=offsets[b]; a<offsets[b+1]; a++) {
weight= influences[a].weight;
madd_v3_v3fl(co, dco[influences[a].vertex], weight);
totweight += weight;
}
}
- if(totweight > 0.0f) {
+ if (totweight > 0.0f) {
mul_v3_fl(co, fac/totweight);
mul_m3_v3(icagemat, co);
- if(G.rt != 527)
+ if (G.rt != 527)
add_v3_v3(vertexCos[b], co);
else
copy_v3_v3(vertexCos[b], co);
@@ -348,7 +350,7 @@ static void deformVerts(ModifierData *md, Object *ob,
meshdeformModifier_do(md, ob, dm, vertexCos, numVerts);
- if(dm && dm != derivedData)
+ if (dm && dm != derivedData)
dm->release(dm);
}
@@ -362,7 +364,7 @@ static void deformVertsEM(ModifierData *md, Object *ob,
meshdeformModifier_do(md, ob, dm, vertexCos, numVerts);
- if(dm && dm != derivedData)
+ if (dm && dm != derivedData)
dm->release(dm);
}
@@ -375,18 +377,18 @@ void modifier_mdef_compact_influences(ModifierData *md)
int totinfluence, totvert, totcagevert, a, b;
weights= mmd->bindweights;
- if(!weights)
+ if (!weights)
return;
totvert= mmd->totvert;
totcagevert= mmd->totcagevert;
/* count number of influences above threshold */
- for(b=0; b<totvert; b++) {
- for(a=0; a<totcagevert; a++) {
+ for (b=0; b<totvert; b++) {
+ for (a=0; a<totcagevert; a++) {
weight= weights[a + b*totcagevert];
- if(weight > MESHDEFORM_MIN_INFLUENCE)
+ if (weight > MESHDEFORM_MIN_INFLUENCE)
mmd->totinfluence++;
}
}
@@ -398,23 +400,23 @@ void modifier_mdef_compact_influences(ModifierData *md)
/* write influences */
totinfluence= 0;
- for(b=0; b<totvert; b++) {
+ for (b=0; b<totvert; b++) {
mmd->bindoffsets[b]= totinfluence;
totweight= 0.0f;
/* sum total weight */
- for(a=0; a<totcagevert; a++) {
+ for (a=0; a<totcagevert; a++) {
weight= weights[a + b*totcagevert];
- if(weight > MESHDEFORM_MIN_INFLUENCE)
+ if (weight > MESHDEFORM_MIN_INFLUENCE)
totweight += weight;
}
/* assign weights normalized */
- for(a=0; a<totcagevert; a++) {
+ for (a=0; a<totcagevert; a++) {
weight= weights[a + b*totcagevert];
- if(weight > MESHDEFORM_MIN_INFLUENCE) {
+ if (weight > MESHDEFORM_MIN_INFLUENCE) {
mmd->bindinfluences[totinfluence].weight= weight/totweight;
mmd->bindinfluences[totinfluence].vertex= a;
totinfluence++;
diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c
index 6552ff38645..1284d5a6769 100644
--- a/source/blender/modifiers/intern/MOD_mirror.c
+++ b/source/blender/modifiers/intern/MOD_mirror.c
@@ -84,7 +84,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
{
MirrorModifierData *mmd = (MirrorModifierData*) md;
- if(mmd->mirror_ob) {
+ if (mmd->mirror_ob) {
DagNode *latNode = dag_get_node(forest, mmd->mirror_ob);
dag_add_relation(forest, latNode, obNode,
@@ -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
@@ -162,7 +162,7 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
}
/* copy customdata to new geometry,
- * copy from its self becayse this data may have been created in the checks above */
+ * copy from its self because this data may have been created in the checks above */
DM_copy_vert_data(result, result, 0, maxVerts, maxVerts);
DM_copy_edge_data(result, result, 0, maxEdges, maxEdges);
/* loops are copied later */
@@ -272,8 +272,12 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
flip_map= defgroup_flip_map(ob, &flip_map_len, FALSE);
if (flip_map) {
- for (i = maxVerts; i-- > 0; dvert++) {
- defvert_flip(dvert, flip_map, flip_map_len);
+ for (i = 0; i < maxVerts; dvert++, i++) {
+ /* merged vertices get both groups, others get flipped */
+ if (do_vtargetmap && (vtargetmap[i] != -1))
+ defvert_flip_merged(dvert, flip_map, flip_map_len);
+ else
+ defvert_flip(dvert, flip_map, flip_map_len);
}
MEM_freeN(flip_map);
@@ -298,18 +302,18 @@ static DerivedMesh *mirrorModifier__doMirror(MirrorModifierData *mmd,
DerivedMesh *result = dm;
/* check which axes have been toggled and mirror accordingly */
- if(mmd->flag & MOD_MIR_AXIS_X) {
+ if (mmd->flag & MOD_MIR_AXIS_X) {
result = doMirrorOnAxis(mmd, ob, result, 0);
}
- if(mmd->flag & MOD_MIR_AXIS_Y) {
+ if (mmd->flag & MOD_MIR_AXIS_Y) {
DerivedMesh *tmp = result;
result = doMirrorOnAxis(mmd, ob, result, 1);
- if(tmp != dm) tmp->release(tmp); /* free intermediate results */
+ if (tmp != dm) tmp->release(tmp); /* free intermediate results */
}
- if(mmd->flag & MOD_MIR_AXIS_Z) {
+ if (mmd->flag & MOD_MIR_AXIS_Z) {
DerivedMesh *tmp = result;
result = doMirrorOnAxis(mmd, ob, result, 2);
- if(tmp != dm) tmp->release(tmp); /* free intermediate results */
+ if (tmp != dm) tmp->release(tmp); /* free intermediate results */
}
return result;
@@ -325,7 +329,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
result = mirrorModifier__doMirror(mmd, ob, derivedData);
- if(result != derivedData)
+ if (result != derivedData)
CDDM_calc_normals(result);
return result;
diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c
index 769ad864d98..57268d04947 100644
--- a/source/blender/modifiers/intern/MOD_multires.c
+++ b/source/blender/modifiers/intern/MOD_multires.c
@@ -36,12 +36,14 @@
#include <stddef.h>
#include "DNA_mesh_types.h"
+#include "DNA_object_types.h"
#include "BKE_cdderivedmesh.h"
+#include "BKE_mesh.h"
#include "BKE_multires.h"
#include "BKE_modifier.h"
#include "BKE_paint.h"
-#include "BKE_particle.h"
+#include "BKE_subsurf.h"
#include "MOD_util.h"
@@ -71,34 +73,48 @@ static void copyData(ModifierData *md, ModifierData *target)
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm,
int useRenderParams, int isFinalCalc)
{
- SculptSession *ss= ob->sculpt;
- int sculpting= (ob->mode & OB_MODE_SCULPT) && ss;
MultiresModifierData *mmd = (MultiresModifierData*)md;
DerivedMesh *result;
Mesh *me= (Mesh*)ob->data;
- if(mmd->totlvl) {
- if(!CustomData_get_layer(&me->ldata, CD_MDISPS)) {
+ if (mmd->totlvl) {
+ if (!CustomData_get_layer(&me->ldata, CD_MDISPS)) {
/* multires always needs a displacement layer */
CustomData_add_layer(&me->ldata, CD_MDISPS, CD_CALLOC, NULL, me->totloop);
}
}
- result = multires_dm_create_from_derived(mmd, 0, dm, ob, useRenderParams, isFinalCalc);
+ result = multires_dm_create_from_derived(mmd, 0, dm, ob, useRenderParams);
- if(result == dm)
+ if (result == dm)
return dm;
- if(useRenderParams || !isFinalCalc) {
- DerivedMesh *cddm= CDDM_copy(result);
+ if (useRenderParams || !isFinalCalc) {
+ DerivedMesh *cddm;
+
+ cddm= CDDM_copy(result);
+
+ /* copy hidden flag to vertices */
+ if (!useRenderParams) {
+ struct MDisps *mdisps;
+ mdisps = CustomData_get_layer(&me->ldata, CD_MDISPS);
+ if (mdisps) {
+ subsurf_copy_grid_hidden(result, me->mpoly,
+ cddm->getVertArray(cddm),
+ mdisps);
+
+ mesh_flush_hidden_from_verts(cddm->getVertArray(cddm),
+ cddm->getLoopArray(cddm),
+ cddm->getEdgeArray(cddm),
+ cddm->getNumEdges(cddm),
+ cddm->getPolyArray(cddm),
+ cddm->getNumPolys(cddm));
+ }
+ }
+
result->release(result);
result= cddm;
}
- else if(sculpting) {
- /* would be created on the fly too, just nicer this
- way on first stroke after e.g. switching levels */
- ss->pbvh= result->getPBVH(ob, result);
- }
return result;
}
diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c
index b3553c04cf4..4119f49dcdb 100644
--- a/source/blender/modifiers/intern/MOD_ocean.c
+++ b/source/blender/modifiers/intern/MOD_ocean.c
@@ -240,7 +240,7 @@ static void dm_get_bounds(DerivedMesh *dm, float *sx, float *sy, float *ox, floa
copy_v3_v3(min, mvert->co);
copy_v3_v3(max, mvert->co);
- for(v=1; v<totvert; v++, mvert++) {
+ for (v=1; v<totvert; v++, mvert++) {
min[0]=MIN2(min[0],mvert->co[0]);
min[1]=MIN2(min[1],mvert->co[1]);
min[2]=MIN2(min[2],mvert->co[2]);
@@ -352,7 +352,7 @@ static DerivedMesh *generate_ocean_geometry(OceanModifierData *omd)
/* add uvs */
cdlayer= CustomData_number_of_layers(&result->loopData, CD_MLOOPUV);
- if(cdlayer < MAX_MTFACE) {
+ if (cdlayer < MAX_MTFACE) {
MLoopUV *mloopuvs= CustomData_add_layer(&result->loopData, CD_MLOOPUV, CD_CALLOC, NULL, num_faces * 4);
if (mloopuvs) { /* unlikely to fail */
@@ -455,7 +455,7 @@ static DerivedMesh *doOcean(ModifierData *md, Object *ob,
if (omd->flag & MOD_OCEAN_GENERATE_FOAM) {
int cdlayer= CustomData_number_of_layers(&dm->loopData, CD_MLOOPCOL);
- if(cdlayer < MAX_MCOL) {
+ if (cdlayer < MAX_MCOL) {
MLoopCol *mloopcols= CustomData_add_layer_named(&dm->loopData, CD_MLOOPCOL, CD_CALLOC, NULL, num_faces * 4, omd->foamlayername);
if (mloopcols) { /* unlikely to fail */
@@ -540,7 +540,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
result = doOcean(md, ob, derivedData, 0);
- if(result != derivedData)
+ if (result != derivedData)
CDDM_calc_normals(result);
return result;
diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c
index 3f600947b1a..628104295f7 100644
--- a/source/blender/modifiers/intern/MOD_particleinstance.c
+++ b/source/blender/modifiers/intern/MOD_particleinstance.c
@@ -126,27 +126,27 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
trackneg=((ob->trackflag>2)?1:0);
- if(pimd->ob==ob){
+ if (pimd->ob==ob) {
pimd->ob= NULL;
return derivedData;
}
- if(pimd->ob){
+ if (pimd->ob) {
psys = BLI_findlink(&pimd->ob->particlesystem,pimd->psys-1);
- if(psys==NULL || psys->totpart==0)
+ if (psys==NULL || psys->totpart==0)
return derivedData;
}
else return derivedData;
- if(pimd->flag & eParticleInstanceFlag_Parents)
+ if (pimd->flag & eParticleInstanceFlag_Parents)
totpart+=psys->totpart;
- if(pimd->flag & eParticleInstanceFlag_Children){
- if(totpart==0)
+ if (pimd->flag & eParticleInstanceFlag_Children) {
+ if (totpart==0)
first_particle=psys->totpart;
totpart+=psys->totchild;
}
- if(totpart==0)
+ if (totpart==0)
return derivedData;
sim.scene = md->scene;
@@ -154,20 +154,20 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
sim.psys = psys;
sim.psmd = psys_get_modifier(pimd->ob, psys);
- if(pimd->flag & eParticleInstanceFlag_UseSize) {
+ if (pimd->flag & eParticleInstanceFlag_UseSize) {
int p;
float *si;
si = size = MEM_callocN(totpart * sizeof(float), "particle size array");
- if(pimd->flag & eParticleInstanceFlag_Parents) {
- for(p=0, pa= psys->particles; p<psys->totpart; p++, pa++, si++)
+ if (pimd->flag & eParticleInstanceFlag_Parents) {
+ for (p=0, pa= psys->particles; p<psys->totpart; p++, pa++, si++)
*si = pa->size;
}
- if(pimd->flag & eParticleInstanceFlag_Children) {
+ if (pimd->flag & eParticleInstanceFlag_Children) {
ChildParticle *cpa = psys->child;
- for(p=0; p<psys->totchild; p++, cpa++, si++) {
+ for (p=0; p<psys->totchild; p++, cpa++, si++) {
*si = psys_get_child_size(psys, cpa, 0.0f, NULL);
}
}
@@ -183,7 +183,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
psys->lattice=psys_get_lattice(&sim);
- if(psys->flag & (PSYS_HAIR_DONE|PSYS_KEYED) || psys->pointcache->flag & PTCACHE_BAKED){
+ if (psys->flag & (PSYS_HAIR_DONE|PSYS_KEYED) || psys->pointcache->flag & PTCACHE_BAKED) {
float min_r[3], max_r[3];
INIT_MINMAX(min_r, max_r);
@@ -197,7 +197,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
mvert=result->getVertArray(result);
orig_mvert=dm->getVertArray(dm);
- for(i=0; i<maxvert; i++){
+ for (i=0; i<maxvert; i++) {
MVert *inMV;
MVert *mv = mvert + i;
ParticleKey state;
@@ -212,20 +212,20 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
mv->co[(axis+1)%3]=temp_co[(track+1)%3];
mv->co[(axis+2)%3]=temp_co[(track+2)%3];
- if((psys->flag & (PSYS_HAIR_DONE|PSYS_KEYED) || psys->pointcache->flag & PTCACHE_BAKED) && pimd->flag & eParticleInstanceFlag_Path){
+ if ((psys->flag & (PSYS_HAIR_DONE|PSYS_KEYED) || psys->pointcache->flag & PTCACHE_BAKED) && pimd->flag & eParticleInstanceFlag_Path) {
float ran = 0.0f;
- if(pimd->random_position != 0.0f) {
+ if (pimd->random_position != 0.0f) {
BLI_srandom(psys->seed + (i/totvert)%totpart);
ran = pimd->random_position * BLI_frand();
}
- if(pimd->flag & eParticleInstanceFlag_KeepShape) {
+ if (pimd->flag & eParticleInstanceFlag_KeepShape) {
state.time = pimd->position * (1.0f - ran);
}
else {
state.time=(mv->co[axis]-min_co)/(max_co-min_co) * pimd->position * (1.0f - ran);
- if(trackneg)
+ if (trackneg)
state.time=1.0f-state.time;
mv->co[axis] = 0.0;
@@ -236,7 +236,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
normalize_v3(state.vel);
/* TODO: incremental rotations somehow */
- if(state.vel[axis] < -0.9999f || state.vel[axis] > 0.9999f) {
+ if (state.vel[axis] < -0.9999f || state.vel[axis] > 0.9999f) {
state.rot[0] = 1;
state.rot[1] = state.rot[2] = state.rot[3] = 0.0f;
}
@@ -251,13 +251,13 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
}
}
- else{
+ else {
state.time=-1.0;
psys_get_particle_state(&sim, first_particle + i/totvert, &state,1);
}
mul_qt_v3(state.rot,mv->co);
- if(pimd->flag & eParticleInstanceFlag_UseSize)
+ if (pimd->flag & eParticleInstanceFlag_UseSize)
mul_v3_fl(mv->co, size[i/totvert]);
add_v3_v3(mv->co, state.co);
}
@@ -265,31 +265,36 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
mface=result->getTessFaceArray(result);
orig_mface=dm->getTessFaceArray(dm);
- for(i=0; i<maxface; i++){
+ for (i=0; i<maxface; i++) {
MFace *inMF;
MFace *mf = mface + i;
- if(pimd->flag & eParticleInstanceFlag_Parents){
- if(i/totface>=psys->totpart){
- if(psys->part->childtype==PART_CHILD_PARTICLES)
+ if (pimd->flag & eParticleInstanceFlag_Parents) {
+ if (i/totface>=psys->totpart) {
+ if (psys->part->childtype==PART_CHILD_PARTICLES) {
pa=psys->particles+(psys->child+i/totface-psys->totpart)->parent;
- else
+ }
+ else {
pa= NULL;
+ }
}
- else
+ else {
pa=pars+i/totface;
+ }
}
- else{
- if(psys->part->childtype==PART_CHILD_PARTICLES)
+ else {
+ if (psys->part->childtype==PART_CHILD_PARTICLES) {
pa=psys->particles+(psys->child+i/totface)->parent;
- else
+ }
+ else {
pa= NULL;
+ }
}
- if(pa){
- if(pa->alive==PARS_UNBORN && (pimd->flag&eParticleInstanceFlag_Unborn)==0) continue;
- if(pa->alive==PARS_ALIVE && (pimd->flag&eParticleInstanceFlag_Alive)==0) continue;
- if(pa->alive==PARS_DEAD && (pimd->flag&eParticleInstanceFlag_Dead)==0) continue;
+ if (pa) {
+ if (pa->alive==PARS_UNBORN && (pimd->flag&eParticleInstanceFlag_Unborn)==0) continue;
+ if (pa->alive==PARS_ALIVE && (pimd->flag&eParticleInstanceFlag_Alive)==0) continue;
+ if (pa->alive==PARS_DEAD && (pimd->flag&eParticleInstanceFlag_Dead)==0) continue;
}
inMF = orig_mface + i%totface;
@@ -299,18 +304,19 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
mf->v1+=(i/totface)*totvert;
mf->v2+=(i/totface)*totvert;
mf->v3+=(i/totface)*totvert;
- if(mf->v4)
+ if (mf->v4) {
mf->v4+=(i/totface)*totvert;
+ }
}
CDDM_calc_edges_tessface(result);
- if(psys->lattice){
+ if (psys->lattice) {
end_latt_deform(psys->lattice);
psys->lattice= NULL;
}
- if(size)
+ if (size)
MEM_freeN(size);
CDDM_tessfaces_to_faces(result); /*builds ngon faces from tess (mface) faces*/
diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c
index 10e43afebe2..d93779fc07d 100644
--- a/source/blender/modifiers/intern/MOD_particlesystem.c
+++ b/source/blender/modifiers/intern/MOD_particlesystem.c
@@ -59,7 +59,7 @@ static void freeData(ModifierData *md)
{
ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md;
- if(psmd->dm){
+ if (psmd->dm) {
psmd->dm->needsFree = 1;
psmd->dm->release(psmd->dm);
psmd->dm = NULL;
@@ -67,7 +67,7 @@ static void freeData(ModifierData *md)
/* ED_object_modifier_remove may have freed this first before calling
* modifier_free (which calls this function) */
- if(psmd->psys)
+ if (psmd->psys)
psmd->psys->flag |= PSYS_DELETE;
}
static void copyData(ModifierData *md, ModifierData *target)
@@ -90,28 +90,28 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
MTex *mtex;
int i;
- if(!psmd->psys->part)
+ if (!psmd->psys->part)
return 0;
- for(i=0; i<MAX_MTEX; i++) {
+ for (i=0; i<MAX_MTEX; i++) {
mtex = psmd->psys->part->mtex[i];
- if(mtex && mtex->mapto && (mtex->texco & TEXCO_UV))
+ if (mtex && mtex->mapto && (mtex->texco & TEXCO_UV))
dataMask |= CD_MASK_MTFACE;
}
- if(psmd->psys->part->tanfac != 0.0f)
+ if (psmd->psys->part->tanfac != 0.0f)
dataMask |= CD_MASK_MTFACE;
/* ask for vertexgroups if we need them */
- for(i=0; i<PSYS_TOT_VG; i++){
- if(psmd->psys->vgroup[i]){
+ for (i=0; i<PSYS_TOT_VG; i++) {
+ if (psmd->psys->vgroup[i]) {
dataMask |= CD_MASK_MDEFORMVERT;
break;
}
}
/* 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;
@@ -132,29 +132,29 @@ static void deformVerts(ModifierData *md, Object *ob,
ParticleSystem * psys= NULL;
int needsFree=0;
- if(ob->particlesystem.first)
+ if (ob->particlesystem.first)
psys=psmd->psys;
else
return;
- if(!psys_check_enabled(ob, psys))
+ if (!psys_check_enabled(ob, psys))
return;
- if(dm==NULL) {
+ if (dm==NULL) {
dm= get_dm(ob, NULL, NULL, vertexCos, 1);
- if(!dm)
+ if (!dm)
return;
needsFree= 1;
}
/* clear old dm */
- if(psmd->dm){
+ if (psmd->dm) {
psmd->dm->needsFree = 1;
psmd->dm->release(psmd->dm);
}
- else if(psmd->flag & eParticleSystemFlag_file_loaded) {
+ else if (psmd->flag & eParticleSystemFlag_file_loaded) {
/* in file read dm just wasn't saved in file so no need to reset everything */
psmd->flag &= ~eParticleSystemFlag_file_loaded;
}
@@ -168,7 +168,7 @@ static void deformVerts(ModifierData *md, Object *ob,
CDDM_apply_vert_coords(psmd->dm, vertexCos);
CDDM_calc_normals(psmd->dm);
- if(needsFree){
+ if (needsFree) {
dm->needsFree = 1;
dm->release(dm);
}
@@ -177,9 +177,9 @@ static void deformVerts(ModifierData *md, Object *ob,
psmd->dm->needsFree = 0;
/* report change in mesh structure */
- if(psmd->dm->getNumVerts(psmd->dm)!=psmd->totdmvert ||
+ if (psmd->dm->getNumVerts(psmd->dm)!=psmd->totdmvert ||
psmd->dm->getNumEdges(psmd->dm)!=psmd->totdmedge ||
- psmd->dm->getNumTessFaces(psmd->dm)!=psmd->totdmface){
+ psmd->dm->getNumTessFaces(psmd->dm)!=psmd->totdmface) {
psys->recalc |= PSYS_RECALC_RESET;
@@ -188,7 +188,7 @@ static void deformVerts(ModifierData *md, Object *ob,
psmd->totdmface= psmd->dm->getNumTessFaces(psmd->dm);
}
- if(psys) {
+ if (psys) {
psmd->flag &= ~eParticleSystemFlag_psys_updated;
particle_system_update(md->scene, ob, psys);
psmd->flag |= eParticleSystemFlag_psys_updated;
@@ -204,11 +204,11 @@ static void deformVertsEM(
{
DerivedMesh *dm = derivedData;
- if(!derivedData) dm = CDDM_from_editmesh(editData, ob->data);
+ if (!derivedData) dm = CDDM_from_editmesh(editData, ob->data);
deformVerts(md, ob, dm, vertexCos, numVerts);
- if(!derivedData) dm->release(dm);
+ if (!derivedData) dm->release(dm);
}
#endif
diff --git a/source/blender/modifiers/intern/MOD_remesh.c b/source/blender/modifiers/intern/MOD_remesh.c
index ec893a3bf44..ea3912afad5 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;
@@ -101,7 +101,7 @@ static void *dualcon_alloc_output(int totvert, int totquad)
{
DualConOutput *output;
- if(!(output = MEM_callocN(sizeof(DualConOutput),
+ if (!(output = MEM_callocN(sizeof(DualConOutput),
"DualConOutput")))
return NULL;
@@ -135,7 +135,7 @@ static void dualcon_add_quad(void *output_v, const int vert_indices[4])
cur_poly->loopstart = output->curface * 4;
cur_poly->totloop = 4;
- for(i = 0; i < 4; i++)
+ for (i = 0; i < 4; i++)
mloop[output->curface * 4 + i].v = vert_indices[i];
output->curface++;
@@ -160,7 +160,7 @@ static DerivedMesh *applyModifier(ModifierData *md,
init_dualcon_mesh(&input, dm);
- if(rmd->flag & MOD_REMESH_FLOOD_FILL)
+ if (rmd->flag & MOD_REMESH_FLOOD_FILL)
flags |= DUALCON_FLOOD_FILL;
switch(rmd->mode) {
diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c
index 92e50d36b1b..ae21d3d66ad 100644
--- a/source/blender/modifiers/intern/MOD_screw.c
+++ b/source/blender/modifiers/intern/MOD_screw.c
@@ -175,7 +175,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
ScrewVertConnect *vc, *vc_tmp, *vert_connect= NULL;
- /* dont do anything? */
+ /* don't do anything? */
if (!totvert)
return CDDM_from_template(dm, 0, 0, 0, 0, 0);
@@ -207,11 +207,11 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
normalize_v3(axis_vec);
/* screw */
- if(ltmd->flag & MOD_SCREW_OBJECT_OFFSET) {
+ if (ltmd->flag & MOD_SCREW_OBJECT_OFFSET) {
/* find the offset along this axis relative to this objects matrix */
float totlen = len_v3(mtx_tx[3]);
- if(totlen != 0.0f) {
+ if (totlen != 0.0f) {
float zero[3]={0.0f, 0.0f, 0.0f};
float cp[3];
screw_ofs= closest_to_line_v3(cp, mtx_tx[3], zero, axis_vec);
@@ -224,7 +224,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* angle */
#if 0 // cant incluide this, not predictable enough, though quite fun,.
- if(ltmd->flag & MOD_SCREW_OBJECT_ANGLE) {
+ if (ltmd->flag & MOD_SCREW_OBJECT_ANGLE) {
float mtx3_tx[3][3];
copy_m3_m4(mtx3_tx, mtx_tx);
@@ -248,7 +248,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
cross_v3_v3v3(axis_tmp, cross1, c2);
normalize_v3(axis_tmp);
- if(len_v3v3(axis_tmp, axis_vec) > 1.0f)
+ if (len_v3v3(axis_tmp, axis_vec) > 1.0f)
angle= -angle;
}
@@ -276,7 +276,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (fabsf(screw_ofs) <= (FLT_EPSILON*100.0f) && fabsf(fabsf(angle) - ((float)M_PI * 2.0f)) <= (FLT_EPSILON*100.0f)) {
close= 1;
step_tot--;
- if(step_tot < 3) step_tot= 3;
+ if (step_tot < 3) step_tot= 3;
maxVerts = totvert * step_tot; /* -1 because we're joining back up */
maxEdges = (totvert * step_tot) + /* these are the edges between new verts */
@@ -287,7 +287,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
else {
close= 0;
- if(step_tot < 3) step_tot= 3;
+ if (step_tot < 3) step_tot= 3;
maxVerts = totvert * step_tot; /* -1 because we're joining back up */
maxEdges = (totvert * (step_tot-1)) + /* these are the edges between new verts */
@@ -333,7 +333,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
med_new->flag= med_orig->flag & ~ME_LOOSEEDGE;
}
- if(ltmd->flag & MOD_SCREW_NORMAL_CALC) {
+ if (ltmd->flag & MOD_SCREW_NORMAL_CALC) {
/*
* Normal Calculation (for face flipping)
* Sort edge verts for correct face flipping
@@ -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,
@@ -388,7 +388,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
vc->v[0]= vc->v[1]= -1;
mul_m4_v3(mtx_tx, vc->co);
- /* length in 2d, dont sqrt because this is only for comparison */
+ /* length in 2d, don't sqrt because this is only for comparison */
vc->dist = vc->co[other_axis_1]*vc->co[other_axis_1] +
vc->co[other_axis_2]*vc->co[other_axis_2];
@@ -405,7 +405,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
vc->e[0]= vc->e[1]= NULL;
vc->v[0]= vc->v[1]= -1;
- /* length in 2d, dont sqrt because this is only for comparison */
+ /* length in 2d, don't sqrt because this is only for comparison */
vc->dist = vc->co[other_axis_1]*vc->co[other_axis_1] +
vc->co[other_axis_2]*vc->co[other_axis_2];
@@ -426,7 +426,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
vc->e[1]= med_new;
}
else {
- vc->v[0]= vc->v[1]= -2; /* erro value - dont use, 3 edges on vert */
+ vc->v[0]= vc->v[1]= -2; /* erro value - don't use, 3 edges on vert */
}
vc= &vert_connect[med_new->v2];
@@ -441,7 +441,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
vc->e[1]= med_new;
}
else {
- vc->v[0]= vc->v[1]= -2; /* erro value - dont use, 3 edges on vert */
+ vc->v[0]= vc->v[1]= -2; /* erro value - don't use, 3 edges on vert */
}
}
@@ -459,7 +459,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/*printf("Loop on connected vert: %i\n", i);*/
- for(j=0; j<2; j++) {
+ for (j=0; j<2; j++) {
/*printf("\tSide: %i\n", j);*/
screwvert_iter_init(&lt_iter, vert_connect, i, j);
if (j == 1) {
@@ -543,25 +543,28 @@ 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;
/* if its closed, we only need 1 loop */
- for(j=ed_loop_closed; j<2; j++) {
+ for (j=ed_loop_closed; j<2; j++) {
/*printf("Ordering Side J %i\n", j);*/
screwvert_iter_init(&lt_iter, vert_connect, v_best, j);
@@ -584,7 +587,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (ed_loop_flip == 0) {
/*printf("\t\t\tFlipping 0\n");*/
SWAP(unsigned int, lt_iter.e->v1, lt_iter.e->v2);
- }/* else {
+ }
+ /* else {
printf("\t\t\tFlipping Not 0\n");
}*/
}
@@ -592,13 +596,16 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (ed_loop_flip == 1) {
/*printf("\t\t\tFlipping 1\n");*/
SWAP(unsigned int, lt_iter.e->v1, lt_iter.e->v2);
- }/* else {
+ }
+ /* else {
printf("\t\t\tFlipping Not 1\n");
}*/
- }/* else {
+ }
+ /* else {
printf("\t\tIncorrect edge topology");
}*/
- }/* else {
+ }
+ /* else {
printf("\t\tNo Edge at this point\n");
}*/
screwvert_iter_step(&lt_iter);
@@ -611,7 +618,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
* we know the surrounding edges are ordered correctly now
* so its safe to create vertex normals.
*
- * calculate vertex normals that can be propodated on lathing
+ * calculate vertex normals that can be propagated on lathing
* use edge connectivity work this out */
if (vc->v[0] >= 0) {
if (vc->v[1] >= 0) {
@@ -636,7 +643,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
else {
/* only 1 edge connected - same as above except
- * dont need to average edge direction */
+ * don't need to average edge direction */
if (vc->e && vc->e[0]->v2 == i) {
sub_v3_v3v3(tmp_vec1, mvert_new[i].co, mvert_new[vc->v[0]].co);
}
@@ -697,7 +704,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
copy_m3_m4(mat3, mat);
}
- if(screw_ofs)
+ if (screw_ofs)
madd_v3_v3fl(mat[3], axis_vec, screw_ofs * ((float)step / (float)(step_tot-1)));
/* copy a slice */
@@ -708,7 +715,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
for (j=0; j<totvert; j++, mv_new_base++, mv_new++) {
/* set normal */
- if(vert_connect) {
+ if (vert_connect) {
mul_v3_m3v3(nor_tx, mat3, vert_connect[j].no);
/* set the normal now its transformed */
@@ -741,7 +748,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
/* we can avoid if using vert alloc trick */
- if(vert_connect) {
+ if (vert_connect) {
MEM_freeN(vert_connect);
vert_connect= NULL;
}
@@ -773,7 +780,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
for (step=0; step < step_tot-1; step++) {
/* new face */
- if(do_flip) {
+ if (do_flip) {
ml_new[3].v = i1;
ml_new[2].v = i2;
ml_new[1].v = i2 + totvert;
@@ -819,7 +826,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* close the loop*/
if (close) {
- if(do_flip) {
+ if (do_flip) {
ml_new[3].v = i1;
ml_new[2].v = i2;
ml_new[1].v = med_new_firstloop->v2;
@@ -887,7 +894,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
#endif
- if((ltmd->flag & MOD_SCREW_NORMAL_CALC) == 0) {
+ if ((ltmd->flag & MOD_SCREW_NORMAL_CALC) == 0) {
/* BMESH_TODO, we only need to get vertex normals here, this is way overkill */
CDDM_calc_normals(result);
}
@@ -903,7 +910,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
{
ScrewModifierData *ltmd= (ScrewModifierData*) md;
- if(ltmd->ob_axis) {
+ if (ltmd->ob_axis) {
DagNode *curNode= dag_get_node(forest, ltmd->ob_axis);
dag_add_relation(forest, curNode, obNode,
diff --git a/source/blender/modifiers/intern/MOD_shapekey.c b/source/blender/modifiers/intern/MOD_shapekey.c
index 8a93a8a6d6f..a91019b0228 100644
--- a/source/blender/modifiers/intern/MOD_shapekey.c
+++ b/source/blender/modifiers/intern/MOD_shapekey.c
@@ -58,9 +58,9 @@ static void deformVerts(ModifierData *md, Object *ob,
KeyBlock *kb= ob_get_keyblock(ob);
float (*deformedVerts)[3];
- if(kb && kb->totelem == numVerts) {
+ if (kb && kb->totelem == numVerts) {
deformedVerts= (float(*)[3])do_ob_key(md->scene, ob);
- if(deformedVerts) {
+ if (deformedVerts) {
memcpy(vertexCos, deformedVerts, sizeof(float)*3*numVerts);
MEM_freeN(deformedVerts);
}
@@ -76,13 +76,13 @@ static void deformMatrices(ModifierData *md, Object *ob, DerivedMesh *derivedDat
(void)vertexCos; /* unused */
- if(kb && kb->totelem==numVerts && kb!=key->refkey) {
+ if (kb && kb->totelem==numVerts && kb!=key->refkey) {
int a;
- if(ob->shapeflag & OB_SHAPE_LOCK) scale_m3_fl(scale, 1);
+ if (ob->shapeflag & OB_SHAPE_LOCK) scale_m3_fl(scale, 1);
else scale_m3_fl(scale, kb->curval);
- for(a=0; a<numVerts; a++)
+ for (a=0; a<numVerts; a++)
copy_m3_m3(defMats[a], scale);
}
@@ -97,7 +97,7 @@ static void deformVertsEM(ModifierData *md, Object *ob,
{
Key *key= ob_get_key(ob);
- if(key && key->type == KEY_RELATIVE)
+ if (key && key->type == KEY_RELATIVE)
deformVerts(md, ob, derivedData, vertexCos, numVerts, 0, 0);
}
@@ -114,11 +114,11 @@ static void deformMatricesEM(ModifierData *UNUSED(md), Object *ob,
(void)vertexCos; /* unused */
- if(kb && kb->totelem==numVerts && kb!=key->refkey) {
+ if (kb && kb->totelem==numVerts && kb!=key->refkey) {
int a;
scale_m3_fl(scale, kb->curval);
- for(a=0; a<numVerts; a++)
+ for (a=0; a<numVerts; a++)
copy_m3_m3(defMats[a], scale);
}
}
diff --git a/source/blender/modifiers/intern/MOD_shrinkwrap.c b/source/blender/modifiers/intern/MOD_shrinkwrap.c
index 1d68e201dc0..33736b7e426 100644
--- a/source/blender/modifiers/intern/MOD_shrinkwrap.c
+++ b/source/blender/modifiers/intern/MOD_shrinkwrap.c
@@ -83,10 +83,10 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
CustomDataMask dataMask = 0;
/* ask for vertexgroups if we need them */
- if(smd->vgroup_name[0])
+ if (smd->vgroup_name[0])
dataMask |= CD_MASK_MDEFORMVERT;
- if(smd->shrinkType == MOD_SHRINKWRAP_PROJECT
+ if (smd->shrinkType == MOD_SHRINKWRAP_PROJECT
&& smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL)
dataMask |= CD_MASK_MVERT;
@@ -119,12 +119,12 @@ static void deformVerts(ModifierData *md, Object *ob,
CustomDataMask dataMask = requiredDataMask(ob, md);
/* ensure we get a CDDM with applied vertex coords */
- if(dataMask)
+ if (dataMask)
dm= get_cddm(ob, NULL, dm, vertexCos);
shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, ob, dm, vertexCos, numVerts);
- if(dm != derivedData)
+ if (dm != derivedData)
dm->release(dm);
}
@@ -134,12 +134,12 @@ static void deformVertsEM(ModifierData *md, Object *ob, struct BMEditMesh *editD
CustomDataMask dataMask = requiredDataMask(ob, md);
/* ensure we get a CDDM with applied vertex coords */
- if(dataMask)
+ if (dataMask)
dm= get_cddm(ob, editData, dm, vertexCos);
shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, ob, dm, vertexCos, numVerts);
- if(dm != derivedData)
+ if (dm != derivedData)
dm->release(dm);
}
diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c
index 4485346bf55..6c1325b0bde 100644
--- a/source/blender/modifiers/intern/MOD_simpledeform.c
+++ b/source/blender/modifiers/intern/MOD_simpledeform.c
@@ -58,8 +58,8 @@
static void axis_limit(int axis, const float limits[2], float co[3], float dcut[3])
{
float val = co[axis];
- if(limits[0] > val) val = limits[0];
- if(limits[1] < val) val = limits[1];
+ if (limits[0] > val) val = limits[0];
+ if (limits[1] < val) val = limits[1];
dcut[axis] = co[axis] - val;
co[axis] = val;
@@ -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];
@@ -164,24 +157,21 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object
MDeformVert *dvert;
//Safe-check
- if(smd->origin == ob) smd->origin = NULL; //No self references
+ if (smd->origin == ob) smd->origin = NULL; //No self references
- if(smd->limit[0] < 0.0f) smd->limit[0] = 0.0f;
- if(smd->limit[0] > 1.0f) smd->limit[0] = 1.0f;
+ if (smd->limit[0] < 0.0f) smd->limit[0] = 0.0f;
+ if (smd->limit[0] > 1.0f) smd->limit[0] = 1.0f;
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);
}
@@ -195,12 +185,12 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object
float lower = FLT_MAX;
float upper = -FLT_MAX;
- for(i=0; i<numVerts; i++)
+ for (i=0; i<numVerts; i++)
{
float tmp[3];
copy_v3_v3(tmp, vertexCos[i]);
- if(transf) space_transform_apply(transf, tmp);
+ if (transf) space_transform_apply(transf, tmp);
lower = MIN2(lower, tmp[limit_axis]);
upper = MAX2(upper, tmp[limit_axis]);
@@ -226,30 +216,30 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object
return; //No simpledeform mode?
}
- for(i=0; i<numVerts; i++)
+ for (i=0; i<numVerts; i++)
{
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
- {
- 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);
+ /* 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);
}
axis_limit(limit_axis, smd_limit, co, dcut);
simpleDeform_callback(smd_factor, dcut, co); //Apply deform
interp_v3_v3v3(vertexCos[i], vertexCos[i], co, weight); //Use vertex weight has coef of linear interpolation
- if(transf) space_transform_invert(transf, vertexCos[i]);
+ if (transf) space_transform_invert(transf, vertexCos[i]);
}
}
}
@@ -291,7 +281,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
CustomDataMask dataMask = 0;
/* ask for vertexgroups if we need them */
- if(smd->vgroup_name[0])
+ if (smd->vgroup_name[0])
dataMask |= CD_MASK_MDEFORMVERT;
return dataMask;
@@ -325,13 +315,13 @@ 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 */
- if(dataMask)
+ * mesh_calc_modifiers pass a NULL derivedData */
+ if (dataMask)
dm= get_dm(ob, NULL, dm, NULL, 0);
SimpleDeformModifier_do((SimpleDeformModifierData*)md, ob, dm, vertexCos, numVerts);
- if(dm != derivedData)
+ if (dm != derivedData)
dm->release(dm);
}
@@ -345,13 +335,13 @@ 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 */
- if(dataMask)
+ * mesh_calc_modifiers pass a NULL derivedData */
+ if (dataMask)
dm= get_dm(ob, editData, dm, NULL, 0);
SimpleDeformModifier_do((SimpleDeformModifierData*)md, ob, dm, vertexCos, numVerts);
- if(dm != derivedData)
+ if (dm != derivedData)
dm->release(dm);
}
diff --git a/source/blender/modifiers/intern/MOD_smoke.c b/source/blender/modifiers/intern/MOD_smoke.c
index 9b03816ed04..706c9817a0a 100644
--- a/source/blender/modifiers/intern/MOD_smoke.c
+++ b/source/blender/modifiers/intern/MOD_smoke.c
@@ -93,7 +93,7 @@ static void deformVerts(ModifierData *md, Object *ob,
smokeModifier_do(smd, md->scene, ob, dm);
- if(dm != derivedData)
+ if (dm != derivedData)
dm->release(dm);
}
@@ -109,37 +109,45 @@ 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 || smd->domain->coll_group) {
GroupObject *go = NULL;
- 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)))
- {
- DagNode *curNode = dag_get_node(forest, go->ob);
- dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Smoke Flow");
+ if (smd->domain->fluid_group)
+ 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) {
+ DagNode *curNode = dag_get_node(forest, go->ob);
+ dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Smoke Flow");
+ }
+ }
+ }
+
+ if (smd->domain->coll_group)
+ for (go = smd->domain->coll_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_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 Coll");
+ }
}
}
- }
}
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) || ((smd2->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");
+ dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Smoke Flow/Coll");
}
}
}
@@ -151,12 +159,12 @@ static void foreachIDLink(ModifierData *md, Object *ob,
{
SmokeModifierData *smd = (SmokeModifierData*) md;
- if(smd->type==MOD_SMOKE_TYPE_DOMAIN && smd->domain) {
+ if (smd->type==MOD_SMOKE_TYPE_DOMAIN && smd->domain) {
walk(userData, ob, (ID **)&smd->domain->coll_group);
walk(userData, ob, (ID **)&smd->domain->fluid_group);
walk(userData, ob, (ID **)&smd->domain->eff_group);
- if(smd->domain->effector_weights) {
+ if (smd->domain->effector_weights) {
walk(userData, ob, (ID **)&smd->domain->effector_weights->group);
}
}
diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c
index 01b012655d0..b909e1f6512 100644
--- a/source/blender/modifiers/intern/MOD_smooth.c
+++ b/source/blender/modifiers/intern/MOD_smooth.c
@@ -78,7 +78,7 @@ static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
flag = smd->flag & (MOD_SMOOTH_X|MOD_SMOOTH_Y|MOD_SMOOTH_Z);
/* disable if modifier is off for X, Y and Z or if factor is 0 */
- if((smd->fac == 0.0f) || flag == 0) return 1;
+ if ((smd->fac == 0.0f) || flag == 0) return 1;
return 0;
}
@@ -89,7 +89,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
CustomDataMask dataMask = 0;
/* ask for vertexgroups if we need them */
- if(smd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
+ if (smd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
return dataMask;
}
@@ -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];
@@ -221,7 +221,7 @@ static void deformVerts(
smoothModifier_do((SmoothModifierData *)md, ob, dm,
vertexCos, numVerts);
- if(dm != derivedData)
+ if (dm != derivedData)
dm->release(dm);
}
@@ -234,7 +234,7 @@ static void deformVertsEM(
smoothModifier_do((SmoothModifierData *)md, ob, dm,
vertexCos, numVerts);
- if(dm != derivedData)
+ if (dm != derivedData)
dm->release(dm);
}
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 78178387ee9..5a749902a0c 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -77,14 +77,14 @@ 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) {
+ if (!face_nors) {
calc_face_nors = 1;
face_nors = CustomData_add_layer(&dm->polyData, CD_NORMAL, CD_CALLOC, NULL, numFaces);
}
@@ -119,11 +119,11 @@ static void dm_calc_normal(DerivedMesh *dm, float (*temp_nors)[3])
}
/* --- end define --- */
- for(i = 0; i < numFaces; i++, mp++) {
+ for (i = 0; i < numFaces; i++, mp++) {
int j;
f_no = face_nors[i];
- if(calc_face_nors)
+ if (calc_face_nors)
mesh_calc_poly_normal(mp, mloop+mp->loopstart, mvert, f_no);
ml = mloop + mp->loopstart;
@@ -132,7 +132,7 @@ static void dm_calc_normal(DerivedMesh *dm, float (*temp_nors)[3])
}
}
- for(edge_iter = BLI_edgehashIterator_new(edge_hash); !BLI_edgehashIterator_isDone(edge_iter); BLI_edgehashIterator_step(edge_iter)) {
+ for (edge_iter = BLI_edgehashIterator_new(edge_hash); !BLI_edgehashIterator_isDone(edge_iter); BLI_edgehashIterator_step(edge_iter)) {
/* Get the edge vert indices, and edge value (the face indices that use it)*/
BLI_edgehashIterator_getKey(edge_iter, &ed_v1, &ed_v2);
edge_ref = BLI_edgehashIterator_getValue(edge_iter);
@@ -143,7 +143,8 @@ static void dm_calc_normal(DerivedMesh *dm, float (*temp_nors)[3])
add_v3_v3v3(edge_normal, face_nors[edge_ref->f1], face_nors[edge_ref->f2]);
normalize_v3(edge_normal);
mul_v3_fl(edge_normal, angle_normalized_v3v3(face_nors[edge_ref->f1], face_nors[edge_ref->f2]));
- } else {
+ }
+ else {
/* only one face attached to that edge */
/* an edge without another attached- the weight on this is
* undefined, M_PI/2 is 90d in radians and that seems good enough */
@@ -158,8 +159,8 @@ static void dm_calc_normal(DerivedMesh *dm, float (*temp_nors)[3])
}
/* normalize vertex normals and assign */
- for(i = 0; i < numVerts; i++, mv++) {
- if(normalize_v3(temp_nors[i]) == 0.0f) {
+ for (i = 0; i < numVerts; i++, mv++) {
+ if (normalize_v3(temp_nors[i]) == 0.0f) {
normal_short_to_float_v3(temp_nors[i], mv->no);
}
}
@@ -192,7 +193,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
CustomDataMask dataMask = 0;
/* ask for vertexgroups if we need them */
- if(smd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
+ if (smd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
return dataMask;
}
@@ -257,17 +258,17 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
orig_mloop = dm->getLoopArray(dm);
orig_mpoly = dm->getPolyArray(dm);
- if(smd->flag & MOD_SOLIDIFY_RIM) {
+ if (smd->flag & MOD_SOLIDIFY_RIM) {
EdgeHash *edgehash = BLI_edgehash_new();
EdgeHashIterator *ehi;
unsigned int v1, v2;
int eidx;
- for(i=0, mv=orig_mvert; i<numVerts; i++, mv++) {
+ for (i=0, mv=orig_mvert; i<numVerts; i++, mv++) {
mv->flag &= ~ME_VERT_TMP_TAG;
}
- for(i=0, ed=orig_medge; i<numEdges; i++, ed++) {
+ for (i=0, ed=orig_medge; i<numEdges; i++, ed++) {
BLI_edgehash_insert(edgehash, ed->v1, ed->v2, SET_INT_IN_POINTER(i));
}
@@ -279,7 +280,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
const unsigned int ml_v1 = _v1; \
const unsigned int ml_v2 = _v2; \
eidx= GET_INT_FROM_POINTER(BLI_edgehash_lookup(edgehash, ml_v1, ml_v2)); \
- if(edge_users[eidx] == INVALID_UNUSED) { \
+ if (edge_users[eidx] == INVALID_UNUSED) { \
ed= orig_medge + eidx; \
edge_users[eidx] = (ml_v1 < ml_v2) == (ed->v1 < ed->v2) ? i : (i + numFaces); \
edge_order[eidx] = edge_ord; \
@@ -307,9 +308,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
#undef INVALID_PAIR
ehi= BLI_edgehashIterator_new(edgehash);
- for(; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
+ for (; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
eidx= GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi));
- if(edge_users[eidx] >= 0) {
+ if (edge_users[eidx] >= 0) {
BLI_edgehashIterator_getKey(ehi, &v1, &v2);
orig_mvert[v1].flag |= ME_VERT_TMP_TAG;
orig_mvert[v2].flag |= ME_VERT_TMP_TAG;
@@ -320,8 +321,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
BLI_edgehashIterator_free(ehi);
- for(i=0, mv=orig_mvert; i<numVerts; i++, mv++) {
- if(mv->flag & ME_VERT_TMP_TAG) {
+ for (i=0, mv=orig_mvert; i<numVerts; i++, mv++) {
+ if (mv->flag & ME_VERT_TMP_TAG) {
old_vert_arr[i] = BLI_array_count(new_vert_arr);
BLI_array_append(new_vert_arr, i);
newEdges++;
@@ -333,7 +334,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
BLI_edgehash_free(edgehash, NULL);
}
- if(smd->flag & MOD_SOLIDIFY_NORMAL_CALC) {
+ if (smd->flag & MOD_SOLIDIFY_NORMAL_CALC) {
vert_nors= MEM_callocN(sizeof(float) * numVerts * 3, "mod_solid_vno_hq");
dm_calc_normal(dm, vert_nors);
}
@@ -372,7 +373,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
mp->loopstart+(mp->totloop-j-1)+dm->numLoopData, 1);
}
- if(mat_ofs) {
+ if (mat_ofs) {
mp->mat_nr += mat_ofs;
CLAMP(mp->mat_nr, 0, mat_nr_max);
}
@@ -395,25 +396,25 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
}
- for(i=0, ed=medge+numEdges; i<numEdges; i++, ed++) {
+ for (i=0, ed=medge+numEdges; i<numEdges; i++, ed++) {
ed->v1 += numVerts;
ed->v2 += numVerts;
}
- /* note, copied vertex layers dont have flipped normals yet. do this after applying offset */
- if((smd->flag & MOD_SOLIDIFY_EVEN) == 0) {
+ /* note, copied vertex layers don't have flipped normals yet. do this after applying offset */
+ if ((smd->flag & MOD_SOLIDIFY_EVEN) == 0) {
/* no even thickness, very simple */
float scalar_short;
float scalar_short_vgroup;
- if(ofs_new != 0.0f) {
+ if (ofs_new != 0.0f) {
scalar_short= scalar_short_vgroup= ofs_new / 32767.0f;
mv= mvert + ((ofs_new >= ofs_orig) ? 0 : numVerts);
dv= dvert;
- for(i=0; i<numVerts; i++, mv++) {
- if(dv) {
- if(defgrp_invert) scalar_short_vgroup = 1.0f - defvert_find_weight(dv, defgrp_index);
+ for (i=0; i<numVerts; i++, mv++) {
+ if (dv) {
+ if (defgrp_invert) scalar_short_vgroup = 1.0f - defvert_find_weight(dv, defgrp_index);
else scalar_short_vgroup = defvert_find_weight(dv, defgrp_index);
scalar_short_vgroup= (offset_fac_vg + (scalar_short_vgroup * offset_fac_vg_inv)) * scalar_short;
dv++;
@@ -422,13 +423,13 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
}
- if(ofs_orig != 0.0f) {
+ if (ofs_orig != 0.0f) {
scalar_short= scalar_short_vgroup= ofs_orig / 32767.0f;
mv= mvert + ((ofs_new >= ofs_orig) ? numVerts : 0); /* same as above but swapped, intentional use of 'ofs_new' */
dv= dvert;
- for(i=0; i<numVerts; i++, mv++) {
- if(dv) {
- if(defgrp_invert) scalar_short_vgroup = 1.0f - defvert_find_weight(dv, defgrp_index);
+ for (i=0; i<numVerts; i++, mv++) {
+ if (dv) {
+ if (defgrp_invert) scalar_short_vgroup = 1.0f - defvert_find_weight(dv, defgrp_index);
else scalar_short_vgroup = defvert_find_weight(dv, defgrp_index);
scalar_short_vgroup= (offset_fac_vg + (scalar_short_vgroup * offset_fac_vg_inv)) * scalar_short;
dv++;
@@ -451,14 +452,14 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
int j, vidx;
face_nors = CustomData_get_layer(&dm->polyData, CD_NORMAL);
- if(!face_nors) {
+ if (!face_nors) {
face_nors = CustomData_add_layer(&dm->polyData, CD_NORMAL, CD_CALLOC, NULL, dm->numPolyData);
face_nors_calc= 1;
}
- if(vert_nors==NULL) {
+ if (vert_nors==NULL) {
vert_nors= MEM_mallocN(sizeof(float) * numVerts * 3, "mod_solid_vno");
- for(i=0, mv=mvert; i<numVerts; i++, mv++) {
+ for (i=0, mv=mvert; i<numVerts; i++, mv++) {
normal_short_to_float_v3(vert_nors[i], mv->no);
}
}
@@ -491,19 +492,19 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
BLI_array_free(face_angles);
/* vertex group support */
- if(dvert) {
+ if (dvert) {
float scalar;
dv= dvert;
- if(defgrp_invert) {
- for(i=0; i<numVerts; i++, dv++) {
+ if (defgrp_invert) {
+ for (i=0; i<numVerts; i++, dv++) {
scalar= 1.0f - defvert_find_weight(dv, defgrp_index);
scalar= offset_fac_vg + (scalar * offset_fac_vg_inv);
vert_angles[i] *= scalar;
}
}
else {
- for(i=0; i<numVerts; i++, dv++) {
+ for (i=0; i<numVerts; i++, dv++) {
scalar= defvert_find_weight(dv, defgrp_index);
scalar= offset_fac_vg + (scalar * offset_fac_vg_inv);
vert_angles[i] *= scalar;
@@ -511,21 +512,21 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
}
- if(ofs_new) {
+ if (ofs_new) {
mv= mvert + ((ofs_new >= ofs_orig) ? 0 : numVerts);
- for(i=0; i<numVerts; i++, mv++) {
- if(vert_accum[i]) { /* zero if unselected */
+ for (i=0; i<numVerts; i++, mv++) {
+ if (vert_accum[i]) { /* zero if unselected */
madd_v3_v3fl(mv->co, vert_nors[i], ofs_new * (vert_angles[i] / vert_accum[i]));
}
}
}
- if(ofs_orig) {
+ if (ofs_orig) {
mv= mvert + ((ofs_new >= ofs_orig) ? numVerts : 0); /* same as above but swapped, intentional use of 'ofs_new' */
- for(i=0; i<numVerts; i++, mv++) {
- if(vert_accum[i]) { /* zero if unselected */
+ for (i=0; i<numVerts; i++, mv++) {
+ if (vert_accum[i]) { /* zero if unselected */
madd_v3_v3fl(mv->co, vert_nors[i], ofs_orig * (vert_angles[i] / vert_accum[i]));
}
}
@@ -534,18 +535,18 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
MEM_freeN(vert_angles);
}
- if(vert_nors)
+ if (vert_nors)
MEM_freeN(vert_nors);
/* flip vertex normals for copied verts */
mv= mvert + numVerts;
- for(i=0; i<numVerts; i++, mv++) {
+ for (i=0; i<numVerts; i++, mv++) {
mv->no[0]= -mv->no[0];
mv->no[1]= -mv->no[1];
mv->no[2]= -mv->no[2];
}
- if(smd->flag & MOD_SOLIDIFY_RIM) {
+ if (smd->flag & MOD_SOLIDIFY_RIM) {
int *origindex;
/* bugger, need to re-calculate the normals for the new edge faces.
@@ -569,14 +570,14 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* add faces & edges */
origindex= result->getEdgeDataArray(result, CD_ORIGINDEX);
ed= medge + (numEdges * 2);
- for(i=0; i<newEdges; i++, ed++) {
+ for (i=0; i<newEdges; i++, ed++) {
ed->v1= new_vert_arr[i];
ed->v2= new_vert_arr[i] + numVerts;
ed->flag |= ME_EDGEDRAW;
origindex[numEdges * 2 + i]= ORIGINDEX_NONE;
- if(crease_rim)
+ if (crease_rim)
ed->crease= crease_rim;
}
@@ -587,12 +588,12 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
mp = mpoly + (numFaces * 2);
ml = mloop + (numLoops * 2);
j = 0;
- for(i=0; i<newFaces; i++, mp++) {
+ for (i=0; i<newFaces; i++, mp++) {
int eidx= new_edge_arr[i];
int fidx= edge_users[eidx];
int flip, k1, k2;
- if(fidx >= numFaces) {
+ if (fidx >= numFaces) {
fidx -= numFaces;
flip= 1;
}
@@ -620,7 +621,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
CustomData_copy_data(&dm->loopData, &result->loopData, k2, numLoops*2+j+2, 1);
CustomData_copy_data(&dm->loopData, &result->loopData, k1, numLoops*2+j+3, 1);
- if(flip) {
+ if (flip) {
ml[j].v = ed->v1;
ml[j++].e = eidx;
@@ -653,18 +654,18 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
/* use the next material index if option enabled */
- if(mat_ofs_rim) {
+ if (mat_ofs_rim) {
mp->mat_nr += mat_ofs_rim;
CLAMP(mp->mat_nr, 0, mat_nr_max);
}
- if(crease_outer) {
+ if (crease_outer) {
/* crease += crease_outer; without wrapping */
unsigned char *cr= (unsigned char *)&(ed->crease);
int tcr= *cr + crease_outer;
*cr= tcr > 255 ? 255 : tcr;
}
- if(crease_inner) {
+ if (crease_inner) {
/* crease += crease_inner; without wrapping */
unsigned char *cr= (unsigned char *)&(medge[numEdges + eidx].crease);
int tcr= *cr + crease_inner;
@@ -685,7 +686,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
#ifdef SOLIDIFY_SIDE_NORMALS
ed= medge + (numEdges * 2);
- for(i=0; i<newEdges; i++, ed++) {
+ for (i=0; i<newEdges; i++, ed++) {
float nor_cpy[3];
short *nor_short;
int j;
@@ -693,7 +694,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* note, only the first vertex (lower half of the index) is calculated */
normalize_v3_v3(nor_cpy, edge_vert_nos[ed->v1]);
- for(j=0; j<2; j++) { /* loop over both verts of the edge */
+ for (j=0; j<2; j++) { /* loop over both verts of the edge */
nor_short= mvert[*(&ed->v1 + j)].no;
normal_short_to_float_v3(nor, nor_short);
add_v3_v3(nor, nor_cpy);
diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c
index 5d6d6c2e82c..be1ceeee317 100644
--- a/source/blender/modifiers/intern/MOD_subsurf.c
+++ b/source/blender/modifiers/intern/MOD_subsurf.c
@@ -73,10 +73,10 @@ static void freeData(ModifierData *md)
{
SubsurfModifierData *smd = (SubsurfModifierData*) md;
- if(smd->mCache) {
+ if (smd->mCache) {
ccgSubSurf_free(smd->mCache);
}
- if(smd->emCache) {
+ if (smd->emCache) {
ccgSubSurf_free(smd->emCache);
}
}
@@ -100,7 +100,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
result = subsurf_make_derived_from_derived(derivedData, smd,
useRenderParams, NULL, isFinalCalc, 0, (ob->flag & OB_MODE_EDIT));
- if(useRenderParams || !isFinalCalc) {
+ if (useRenderParams || !isFinalCalc) {
DerivedMesh *cddm= CDDM_copy(result);
result->release(result);
result= cddm;
diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c
index 7e85acd47e9..86e11aca5b7 100644
--- a/source/blender/modifiers/intern/MOD_surface.c
+++ b/source/blender/modifiers/intern/MOD_surface.c
@@ -59,21 +59,20 @@ static void initData(ModifierData *md)
static void freeData(ModifierData *md)
{
SurfaceModifierData *surmd = (SurfaceModifierData*) md;
-
- if (surmd)
- {
- if(surmd->bvhtree) {
+
+ if (surmd) {
+ if (surmd->bvhtree) {
free_bvhtree_from_mesh(surmd->bvhtree);
MEM_freeN(surmd->bvhtree);
}
- if(surmd->dm)
+ if (surmd->dm)
surmd->dm->release(surmd->dm);
- if(surmd->x)
+ if (surmd->x)
MEM_freeN(surmd->x);
- if(surmd->v)
+ if (surmd->v)
MEM_freeN(surmd->v);
surmd->bvhtree = NULL;
@@ -95,21 +94,19 @@ static void deformVerts(ModifierData *md, Object *ob,
{
SurfaceModifierData *surmd = (SurfaceModifierData*) md;
- if(surmd->dm)
+ if (surmd->dm)
surmd->dm->release(surmd->dm);
/* if possible use/create DerivedMesh */
- if(derivedData) surmd->dm = CDDM_copy(derivedData);
+ 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;
@@ -120,12 +117,12 @@ static void deformVerts(ModifierData *md, Object *ob,
numverts = surmd->dm->getNumVerts ( surmd->dm );
- if(numverts != surmd->numverts || surmd->x == NULL || surmd->v == NULL || md->scene->r.cfra != surmd->cfra+1) {
- if(surmd->x) {
+ if (numverts != surmd->numverts || surmd->x == NULL || surmd->v == NULL || md->scene->r.cfra != surmd->cfra+1) {
+ if (surmd->x) {
MEM_freeN(surmd->x);
surmd->x = NULL;
}
- if(surmd->v) {
+ if (surmd->v) {
MEM_freeN(surmd->v);
surmd->v = NULL;
}
@@ -139,11 +136,11 @@ static void deformVerts(ModifierData *md, Object *ob,
}
/* convert to global coordinates and calculate velocity */
- for(i = 0, x = surmd->x, v = surmd->v; i<numverts; i++, x++, v++) {
+ for (i = 0, x = surmd->x, v = surmd->v; i<numverts; i++, x++, v++) {
vec = CDDM_get_vert(surmd->dm, i)->co;
mul_m4_v3(ob->obmat, vec);
- if(init)
+ if (init)
v->co[0] = v->co[1] = v->co[2] = 0.0f;
else
sub_v3_v3v3(v->co, vec, x->co);
@@ -153,12 +150,12 @@ static void deformVerts(ModifierData *md, Object *ob,
surmd->cfra = md->scene->r.cfra;
- if(surmd->bvhtree)
+ if (surmd->bvhtree)
free_bvhtree_from_mesh(surmd->bvhtree);
else
surmd->bvhtree = MEM_callocN(sizeof(BVHTreeFromMesh), "BVHTreeFromMesh");
- if(surmd->dm->getNumTessFaces(surmd->dm))
+ if (surmd->dm->getNumTessFaces(surmd->dm))
bvhtree_from_mesh_faces(surmd->bvhtree, surmd->dm, 0.0, 2, 6);
else
bvhtree_from_mesh_edges(surmd->bvhtree, surmd->dm, 0.0, 2, 6);
diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c
index 5f8c29944bd..17ff4dd1842 100644
--- a/source/blender/modifiers/intern/MOD_util.c
+++ b/source/blender/modifiers/intern/MOD_util.c
@@ -65,10 +65,10 @@ 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
- */
- if(result_type & TEX_RGB)
+ * 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);
else
@@ -84,16 +84,16 @@ void get_texture_coords(MappingInfoModifierData *dmd, Object *ob,
int texmapping = dmd->texmapping;
float mapob_imat[4][4];
- if(texmapping == MOD_DISP_MAP_OBJECT) {
- if(dmd->map_object)
+ if (texmapping == MOD_DISP_MAP_OBJECT) {
+ if (dmd->map_object)
invert_m4_m4(mapob_imat, dmd->map_object->obmat);
else /* if there is no map object, default to local */
texmapping = MOD_DISP_MAP_LOCAL;
}
/* UVs need special handling, since they come from faces */
- if(texmapping == MOD_DISP_MAP_UV) {
- if(CustomData_has_layer(&dm->loopData, CD_MLOOPUV)) {
+ if (texmapping == MOD_DISP_MAP_UV) {
+ if (CustomData_has_layer(&dm->loopData, CD_MLOOPUV)) {
MPoly *mpoly = dm->getPolyArray(dm);
MPoly *mp;
MLoop *mloop = dm->getLoopArray(dm);
@@ -107,7 +107,7 @@ void get_texture_coords(MappingInfoModifierData *dmd, Object *ob,
mloop_uv = CustomData_get_layer_named(&dm->loopData, CD_MLOOPUV, uvname);
/* verts are given the UV from the first face that uses them */
- for(i = 0, mp = mpoly; i < numPolys; ++i, ++mp) {
+ for (i = 0, mp = mpoly; i < numPolys; ++i, ++mp) {
unsigned int fidx= mp->totloop - 1;
do {
@@ -126,11 +126,12 @@ void get_texture_coords(MappingInfoModifierData *dmd, Object *ob,
MEM_freeN(done);
return;
- } else /* if there are no UVs, default to local */
+ }
+ else /* if there are no UVs, default to local */
texmapping = MOD_DISP_MAP_LOCAL;
}
- for(i = 0; i < numVerts; ++i, ++co, ++texco) {
+ for (i = 0; i < numVerts; ++i, ++co, ++texco) {
switch(texmapping) {
case MOD_DISP_MAP_LOCAL:
copy_v3_v3(*texco, *co);
@@ -148,9 +149,9 @@ void get_texture_coords(MappingInfoModifierData *dmd, Object *ob,
void modifier_vgroup_cache(ModifierData *md, float (*vertexCos)[3])
{
- while((md=md->next) && md->type==eModifierType_Armature) {
+ while ((md=md->next) && md->type==eModifierType_Armature) {
ArmatureModifierData *amd = (ArmatureModifierData*) md;
- if(amd->multi && amd->prevCos==NULL)
+ if (amd->multi && amd->prevCos==NULL)
amd->prevCos= MEM_dupallocN(vertexCos);
else
break;
@@ -161,10 +162,10 @@ void modifier_vgroup_cache(ModifierData *md, float (*vertexCos)[3])
/* returns a cdderivedmesh if dm == NULL or is another type of derivedmesh */
DerivedMesh *get_cddm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm, float (*vertexCos)[3])
{
- if(dm && dm->type == DM_TYPE_CDDM)
+ if (dm && dm->type == DM_TYPE_CDDM)
return dm;
- if(!dm) {
+ if (!dm) {
dm= get_dm(ob, em, dm, vertexCos, 0);
}
else {
@@ -172,7 +173,7 @@ DerivedMesh *get_cddm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm, float
CDDM_apply_vert_coords(dm, vertexCos);
}
- if(dm)
+ if (dm)
CDDM_calc_normals(dm);
return dm;
@@ -181,22 +182,22 @@ DerivedMesh *get_cddm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm, float
/* returns a derived mesh if dm == NULL, for deforming modifiers that need it */
DerivedMesh *get_dm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm, float (*vertexCos)[3], int orco)
{
- if(dm)
+ if (dm)
return dm;
- if(ob->type==OB_MESH) {
- if(em) dm= CDDM_from_BMEditMesh(em, ob->data, FALSE, FALSE);
+ if (ob->type==OB_MESH) {
+ if (em) dm= CDDM_from_BMEditMesh(em, ob->data, FALSE, FALSE);
else dm = CDDM_from_mesh((struct Mesh *)(ob->data), ob);
- if(vertexCos) {
+ if (vertexCos) {
CDDM_apply_vert_coords(dm, vertexCos);
//CDDM_calc_normals(dm);
}
- if(orco)
+ if (orco)
DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, get_mesh_orco_verts(ob));
}
- else if(ELEM3(ob->type,OB_FONT,OB_CURVE,OB_SURF)) {
+ else if (ELEM3(ob->type,OB_FONT,OB_CURVE,OB_SURF)) {
dm= CDDM_from_curve(ob);
}
@@ -208,10 +209,10 @@ void modifier_get_vgroup(Object *ob, DerivedMesh *dm, const char *name, MDeformV
*defgrp_index = defgroup_name_index(ob, name);
*dvert = NULL;
- if(*defgrp_index >= 0) {
- if(ob->type == OB_LATTICE)
+ if (*defgrp_index >= 0) {
+ if (ob->type == OB_LATTICE)
*dvert = lattice_get_deform_verts(ob);
- else if(dm)
+ else if (dm)
*dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
}
}
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c
index e5fa0a323df..1b96c586cbf 100644
--- a/source/blender/modifiers/intern/MOD_uvproject.c
+++ b/source/blender/modifiers/intern/MOD_uvproject.c
@@ -61,7 +61,7 @@ static void initData(ModifierData *md)
UVProjectModifierData *umd = (UVProjectModifierData*) md;
int i;
- for(i = 0; i < MOD_UVPROJECT_MAXPROJECTORS; ++i)
+ for (i = 0; i < MOD_UVPROJECT_MAXPROJECTORS; ++i)
umd->projectors[i] = NULL;
umd->image = NULL;
umd->flags = 0;
@@ -76,7 +76,7 @@ static void copyData(ModifierData *md, ModifierData *target)
UVProjectModifierData *tumd = (UVProjectModifierData*) target;
int i;
- for(i = 0; i < MOD_UVPROJECT_MAXPROJECTORS; ++i)
+ for (i = 0; i < MOD_UVPROJECT_MAXPROJECTORS; ++i)
tumd->projectors[i] = umd->projectors[i];
tumd->image = umd->image;
tumd->flags = umd->flags;
@@ -104,7 +104,7 @@ static void foreachObjectLink(ModifierData *md, Object *ob,
UVProjectModifierData *umd = (UVProjectModifierData*) md;
int i;
- for(i = 0; i < MOD_UVPROJECT_MAXPROJECTORS; ++i)
+ for (i = 0; i < MOD_UVPROJECT_MAXPROJECTORS; ++i)
walk(userData, ob, &umd->projectors[i]);
}
@@ -127,8 +127,8 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
UVProjectModifierData *umd = (UVProjectModifierData*) md;
int i;
- for(i = 0; i < umd->num_projectors; ++i) {
- if(umd->projectors[i]) {
+ for (i = 0; i < umd->num_projectors; ++i) {
+ if (umd->projectors[i]) {
DagNode *curNode = dag_get_node(forest, umd->projectors[i]);
dag_add_relation(forest, curNode, obNode,
@@ -167,21 +167,21 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
aspect = aspx / aspy;
- for(i = 0; i < umd->num_projectors; ++i)
- if(umd->projectors[i])
+ for (i = 0; i < umd->num_projectors; ++i)
+ if (umd->projectors[i])
projectors[num_projectors++].ob = umd->projectors[i];
- if(num_projectors == 0) return dm;
+ if (num_projectors == 0) return dm;
/* make sure there are UV Maps available */
- if(!CustomData_has_layer(&dm->loopData, CD_MLOOPUV)) return dm;
+ if (!CustomData_has_layer(&dm->loopData, CD_MLOOPUV)) return dm;
/* make sure we're using an existing layer */
CustomData_validate_layer_name(&dm->loopData, CD_MLOOPUV, umd->uvlayer_name, uvname);
/* calculate a projection matrix and normal for each projector */
- for(i = 0; i < num_projectors; ++i) {
+ for (i = 0; i < num_projectors; ++i) {
float tmpmat[4][4];
float offsetmat[4][4];
Camera *cam = NULL;
@@ -190,10 +190,10 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
projectors[i].uci= NULL;
- if(projectors[i].ob->type == OB_CAMERA) {
+ if (projectors[i].ob->type == OB_CAMERA) {
cam = (Camera *)projectors[i].ob->data;
- if(cam->flag & CAM_PANORAMA) {
+ if (cam->flag & CAM_PANORAMA) {
projectors[i].uci= project_camera_info(projectors[i].ob, NULL, aspx, aspy);
project_camera_info_scale(projectors[i].uci, scax, scay);
free_uci= 1;
@@ -204,7 +204,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
float scale= (cam->type == CAM_PERSP) ? cam->clipsta * sensor / cam->lens : cam->ortho_scale;
float xmax, xmin, ymax, ymin;
- if(sensor_fit==CAMERA_SENSOR_FIT_HOR) {
+ if (sensor_fit==CAMERA_SENSOR_FIT_HOR) {
xmax = 0.5f * scale;
ymax = xmax / aspect;
}
@@ -222,17 +222,19 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
ymin *= scay;
ymax *= scay;
- if(cam->type == CAM_PERSP) {
+ if (cam->type == CAM_PERSP) {
float perspmat[4][4];
perspective_m4( perspmat,xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend);
mult_m4_m4m4(tmpmat, perspmat, projectors[i].projmat);
- } else { /* if(cam->type == CAM_ORTHO) */
+ }
+ else { /* if (cam->type == CAM_ORTHO) */
float orthomat[4][4];
orthographic_m4( orthomat,xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend);
mult_m4_m4m4(tmpmat, orthomat, projectors[i].projmat);
}
}
- } else {
+ }
+ else {
copy_m4_m4(tmpmat, projectors[i].projmat);
}
@@ -282,22 +284,22 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
dm->getVertCos(dm, coords);
/* convert coords to world space */
- for(i = 0, co = coords; i < numVerts; ++i, ++co)
+ for (i = 0, co = coords; i < numVerts; ++i, ++co)
mul_m4_v3(ob->obmat, *co);
/* if only one projector, project coords to UVs */
- if(num_projectors == 1 && projectors[0].uci==NULL)
- for(i = 0, co = coords; i < numVerts; ++i, ++co)
+ if (num_projectors == 1 && projectors[0].uci==NULL)
+ for (i = 0, co = coords; i < numVerts; ++i, ++co)
mul_project_m4_v3(projectors[0].projmat, *co);
mpoly = dm->getPolyArray(dm);
mloop = dm->getLoopArray(dm);
/* apply coords as UVs, and apply image if tfaces are new */
- for(i = 0, mp = mpoly; i < numPolys; ++i, ++mp, ++mt) {
- if(override_image || !image || (mtexpoly == NULL || mt->tpage == image)) {
- if(num_projectors == 1) {
- if(projectors[0].uci) {
+ for (i = 0, mp = mpoly; i < numPolys; ++i, ++mp, ++mt) {
+ if (override_image || !image || (mtexpoly == NULL || mt->tpage == image)) {
+ if (num_projectors == 1) {
+ if (projectors[0].uci) {
unsigned int fidx= mp->totloop - 1;
do {
unsigned int lidx= mp->loopstart + fidx;
@@ -314,10 +316,9 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
copy_v2_v2(mloop_uv[lidx].uv, coords[vidx]);
} while (fidx--);
}
- } else {
- /* multiple projectors, select the closest to face normal
- * direction
- */
+ }
+ else {
+ /* multiple projectors, select the closest to face normal direction */
float face_no[3];
int j;
Projector *best_projector;
@@ -327,21 +328,21 @@ 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];
- for(j = 1; j < num_projectors; ++j) {
+ for (j = 1; j < num_projectors; ++j) {
float tmp_dot = dot_v3v3(projectors[j].normal,
face_no);
- if(tmp_dot > best_dot) {
+ if (tmp_dot > best_dot) {
best_dot = tmp_dot;
best_projector = &projectors[j];
}
}
- if(best_projector->uci) {
+ if (best_projector->uci) {
unsigned int fidx= mp->totloop - 1;
do {
unsigned int lidx= mp->loopstart + fidx;
@@ -365,21 +366,25 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
}
}
- if(override_image && mtexpoly) {
+ if (override_image && mtexpoly) {
mt->tpage = image;
}
}
MEM_freeN(coords);
- if(free_uci) {
+ if (free_uci) {
int j;
- for(j = 0; j < num_projectors; ++j) {
- if(projectors[j].uci) {
+ for (j = 0; j < num_projectors; ++j) {
+ if (projectors[j].uci) {
MEM_freeN(projectors[j].uci);
}
}
}
+
+ /* Mark tessellated CD layers as dirty. */
+ dm->dirty |= DM_DIRTY_TESS_CDLAYERS;
+
return dm;
}
diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c
index 4d058197be5..a318d9b68af 100644
--- a/source/blender/modifiers/intern/MOD_warp.c
+++ b/source/blender/modifiers/intern/MOD_warp.c
@@ -88,11 +88,11 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
CustomDataMask dataMask = 0;
/* ask for vertexgroups if we need them */
- if(wmd->defgrp_name[0]) dataMask |= (CD_MASK_MDEFORMVERT);
+ if (wmd->defgrp_name[0]) dataMask |= (CD_MASK_MDEFORMVERT);
dataMask |= (CD_MASK_MDEFORMVERT);
/* ask for UV coordinates if we need them */
- if(wmd->texmapping == MOD_DISP_MAP_UV) dataMask |= (1 << CD_MTFACE);
+ if (wmd->texmapping == MOD_DISP_MAP_UV) dataMask |= (1 << CD_MTFACE);
return dataMask;
}
@@ -101,7 +101,7 @@ static int dependsOnTime(ModifierData *md)
{
WarpModifierData *wmd = (WarpModifierData *)md;
- if(wmd->texture) {
+ if (wmd->texture) {
return BKE_texture_dependsOnTime(wmd->texture);
}
else {
@@ -153,7 +153,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *UN
{
WarpModifierData *wmd = (WarpModifierData*) md;
- if(wmd->object_from && wmd->object_to) {
+ if (wmd->object_from && wmd->object_to) {
DagNode *fromNode = dag_get_node(forest, wmd->object_from);
DagNode *toNode = dag_get_node(forest, wmd->object_to);
@@ -161,7 +161,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *UN
dag_add_relation(forest, toNode, obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Warp Modifier2");
}
- if((wmd->texmapping == MOD_DISP_MAP_OBJECT) && wmd->map_object) {
+ if ((wmd->texmapping == MOD_DISP_MAP_OBJECT) && wmd->map_object) {
DagNode *curNode = dag_get_node(forest, wmd->map_object);
dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Warp Modifier3");
}
@@ -187,12 +187,12 @@ static void warpModifier_do(WarpModifierData *wmd, Object *ob,
float (*tex_co)[3]= NULL;
- if(!(wmd->object_from && wmd->object_to))
+ if (!(wmd->object_from && wmd->object_to))
return;
modifier_get_vgroup(ob, dm, wmd->defgrp_name, &dvert, &defgrp_index);
- if(wmd->curfalloff==NULL) /* should never happen, but bad lib linking could cause it */
+ if (wmd->curfalloff==NULL) /* should never happen, but bad lib linking could cause it */
wmd->curfalloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
invert_m4_m4(obinv, ob->obmat);
@@ -207,7 +207,7 @@ static void warpModifier_do(WarpModifierData *wmd, Object *ob,
unit_m4(mat_unit);
- if(strength < 0.0f) {
+ if (strength < 0.0f) {
float loc[3];
strength = -strength;
@@ -219,24 +219,24 @@ static void warpModifier_do(WarpModifierData *wmd, Object *ob,
}
weight= strength;
- if(wmd->texture) {
+ if (wmd->texture) {
tex_co = MEM_mallocN(sizeof(*tex_co) * numVerts, "warpModifier_do tex_co");
get_texture_coords((MappingInfoModifierData *)wmd, ob, dm, vertexCos, tex_co, numVerts);
}
- for(i = 0; i < numVerts; i++) {
+ for (i = 0; i < numVerts; i++) {
float *co = vertexCos[i];
- if(wmd->falloff_type==eWarp_Falloff_None ||
+ if (wmd->falloff_type==eWarp_Falloff_None ||
((fac=len_v3v3(co, mat_from[3])) < wmd->falloff_radius && (fac=(wmd->falloff_radius-fac)/wmd->falloff_radius)) ) {
/* skip if no vert group found */
- if(dvert && defgrp_index >= 0) {
+ if (dvert && defgrp_index >= 0) {
dv = &dvert[i];
- if(dv) {
+ if (dv) {
weight = defvert_find_weight(dv, defgrp_index) * strength;
- if(weight <= 0.0f) /* Should never occure... */
+ if (weight <= 0.0f) /* Should never occure... */
continue;
}
}
@@ -272,7 +272,7 @@ static void warpModifier_do(WarpModifierData *wmd, Object *ob,
fac *= weight;
- if(tex_co) {
+ if (tex_co) {
TexResult texres;
texres.nor = NULL;
get_texture_value(wmd->texture, tex_co[i], &texres);
@@ -282,11 +282,11 @@ static void warpModifier_do(WarpModifierData *wmd, Object *ob,
/* into the 'from' objects space */
mul_m4_v3(mat_from_inv, co);
- if(fac >= 1.0f) {
+ if (fac >= 1.0f) {
mul_m4_v3(mat_final, co);
}
- else if(fac > 0.0f) {
- if(wmd->flag & MOD_WARP_VOLUME_PRESERVE) {
+ else if (fac > 0.0f) {
+ if (wmd->flag & MOD_WARP_VOLUME_PRESERVE) {
/* interpolate the matrix for nicer locations */
blend_m4_m4m4(tmat, mat_unit, mat_final, fac);
mul_m4_v3(tmat, co);
@@ -303,7 +303,7 @@ static void warpModifier_do(WarpModifierData *wmd, Object *ob,
}
}
- if(tex_co)
+ if (tex_co)
MEM_freeN(tex_co);
}
@@ -319,14 +319,14 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
DerivedMesh *dm= NULL;
int use_dm= warp_needs_dm((WarpModifierData *)md);
- if(use_dm) {
+ if (use_dm) {
dm= get_cddm(ob, NULL, derivedData, vertexCos);
}
warpModifier_do((WarpModifierData *)md, ob, dm, vertexCos, numVerts);
- if(use_dm) {
- if(dm != derivedData) dm->release(dm);
+ if (use_dm) {
+ if (dm != derivedData) dm->release(dm);
}
}
@@ -336,15 +336,15 @@ static void deformVertsEM(ModifierData *md, Object *ob, struct BMEditMesh *editD
DerivedMesh *dm = derivedData;
int use_dm= warp_needs_dm((WarpModifierData *)md);
- if(use_dm) {
- if(!derivedData)
+ if (use_dm) {
+ if (!derivedData)
dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE);
}
deformVerts(md, ob, dm, vertexCos, numVerts, 0, 0);
- if(use_dm) {
- if(!derivedData) dm->release(dm);
+ if (use_dm) {
+ if (!derivedData) dm->release(dm);
}
}
diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c
index 15f78e15073..87c0df3e12f 100644
--- a/source/blender/modifiers/intern/MOD_wave.c
+++ b/source/blender/modifiers/intern/MOD_wave.c
@@ -138,14 +138,14 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
{
WaveModifierData *wmd = (WaveModifierData*) md;
- if(wmd->objectcenter) {
+ if (wmd->objectcenter) {
DagNode *curNode = dag_get_node(forest, wmd->objectcenter);
dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA,
"Wave Modifier");
}
- if(wmd->map_object) {
+ if (wmd->map_object) {
DagNode *curNode = dag_get_node(forest, wmd->map_object);
dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA,
@@ -160,11 +160,11 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
/* ask for UV coordinates if we need them */
- if(wmd->texture && wmd->texmapping == MOD_DISP_MAP_UV)
+ if (wmd->texture && wmd->texmapping == MOD_DISP_MAP_UV)
dataMask |= CD_MASK_MTFACE;
/* ask for vertexgroups if we need them */
- if(wmd->defgrp_name[0])
+ if (wmd->defgrp_name[0])
dataMask |= CD_MASK_MDEFORMVERT;
return dataMask;
@@ -187,10 +187,10 @@ static void waveModifier_do(WaveModifierData *md,
const float falloff= wmd->falloff;
float falloff_fac= 1.0f; /* when falloff == 0.0f this stays at 1.0f */
- if(wmd->flag & MOD_WAVE_NORM && ob->type == OB_MESH)
+ if (wmd->flag & MOD_WAVE_NORM && ob->type == OB_MESH)
mvert = dm->getVertArray(dm);
- if(wmd->objectcenter){
+ if (wmd->objectcenter) {
float mat[4][4];
/* get the control object's location in local coordinates */
invert_m4_m4(ob->imat, ob->obmat);
@@ -203,32 +203,32 @@ static void waveModifier_do(WaveModifierData *md,
/* get the index of the deform group */
modifier_get_vgroup(ob, dm, wmd->defgrp_name, &dvert, &defgrp_index);
- if(wmd->damp == 0) wmd->damp = 10.0f;
+ if (wmd->damp == 0) wmd->damp = 10.0f;
- if(wmd->lifetime != 0.0f) {
+ if (wmd->lifetime != 0.0f) {
float x = ctime - wmd->timeoffs;
- if(x > wmd->lifetime) {
+ if (x > wmd->lifetime) {
lifefac = x - wmd->lifetime;
- if(lifefac > wmd->damp) lifefac = 0.0;
+ if (lifefac > wmd->damp) lifefac = 0.0;
else lifefac =
(float)(wmd->height * (1.0f - sqrtf(lifefac / wmd->damp)));
}
}
- if(wmd->texture) {
+ if (wmd->texture) {
tex_co = MEM_mallocN(sizeof(*tex_co) * numVerts,
"waveModifier_do tex_co");
get_texture_coords((MappingInfoModifierData *)wmd, ob, dm, vertexCos, tex_co, numVerts);
}
- if(lifefac != 0.0f) {
+ if (lifefac != 0.0f) {
/* avoid divide by zero checks within the loop */
float falloff_inv= falloff ? 1.0f / falloff : 1.0f;
int i;
- for(i = 0; i < numVerts; i++) {
+ for (i = 0; i < numVerts; i++) {
float *co = vertexCos[i];
float x = co[0] - wmd->startx;
float y = co[1] - wmd->starty;
@@ -236,11 +236,11 @@ static void waveModifier_do(WaveModifierData *md,
float def_weight= 1.0f;
/* get weights */
- if(dvert) {
+ if (dvert) {
def_weight= defvert_find_weight(&dvert[i], defgrp_index);
/* if this vert isn't in the vgroup, don't deform it */
- if(def_weight == 0.0f) {
+ if (def_weight == 0.0f) {
continue;
}
}
@@ -260,12 +260,12 @@ static void waveModifier_do(WaveModifierData *md,
/* this way it makes nice circles */
amplit -= (ctime - wmd->timeoffs) * wmd->speed;
- if(wmd->flag & MOD_WAVE_CYCL) {
+ if (wmd->flag & MOD_WAVE_CYCL) {
amplit = (float)fmodf(amplit - wmd->width, 2.0f * wmd->width)
+ wmd->width;
}
- if(falloff != 0.0f) {
+ if (falloff != 0.0f) {
float dist = 0.0f;
switch(wmd_axis) {
@@ -285,12 +285,12 @@ static void waveModifier_do(WaveModifierData *md,
}
/* GAUSSIAN */
- if((falloff_fac != 0.0f) && (amplit > -wmd->width) && (amplit < wmd->width)) {
+ if ((falloff_fac != 0.0f) && (amplit > -wmd->width) && (amplit < wmd->width)) {
amplit = amplit * wmd->narrow;
amplit = (float)(1.0f / expf(amplit * amplit) - minfac);
/*apply texture*/
- if(wmd->texture) {
+ if (wmd->texture) {
TexResult texres;
texres.nor = NULL;
get_texture_value(wmd->texture, tex_co[i], &texres);
@@ -300,15 +300,15 @@ static void waveModifier_do(WaveModifierData *md,
/*apply weight & falloff */
amplit *= def_weight * falloff_fac;
- if(mvert) {
+ if (mvert) {
/* move along normals */
- if(wmd->flag & MOD_WAVE_NORM_X) {
+ if (wmd->flag & MOD_WAVE_NORM_X) {
co[0] += (lifefac * amplit) * mvert[i].no[0] / 32767.0f;
}
- if(wmd->flag & MOD_WAVE_NORM_Y) {
+ if (wmd->flag & MOD_WAVE_NORM_Y) {
co[1] += (lifefac * amplit) * mvert[i].no[1] / 32767.0f;
}
- if(wmd->flag & MOD_WAVE_NORM_Z) {
+ if (wmd->flag & MOD_WAVE_NORM_Z) {
co[2] += (lifefac * amplit) * mvert[i].no[2] / 32767.0f;
}
}
@@ -320,7 +320,7 @@ static void waveModifier_do(WaveModifierData *md,
}
}
- if(wmd->texture) MEM_freeN(tex_co);
+ if (wmd->texture) MEM_freeN(tex_co);
}
static void deformVerts(ModifierData *md, Object *ob,
@@ -333,14 +333,14 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *dm= derivedData;
WaveModifierData *wmd = (WaveModifierData *)md;
- if(wmd->flag & MOD_WAVE_NORM)
+ if (wmd->flag & MOD_WAVE_NORM)
dm= get_cddm(ob, NULL, dm, vertexCos);
- else if(wmd->texture || wmd->defgrp_name[0])
+ else if (wmd->texture || wmd->defgrp_name[0])
dm= get_dm(ob, NULL, dm, NULL, 0);
waveModifier_do(wmd, md->scene, ob, dm, vertexCos, numVerts);
- if(dm != derivedData)
+ if (dm != derivedData)
dm->release(dm);
}
@@ -351,14 +351,14 @@ static void deformVertsEM(
DerivedMesh *dm= derivedData;
WaveModifierData *wmd = (WaveModifierData *)md;
- if(wmd->flag & MOD_WAVE_NORM)
+ if (wmd->flag & MOD_WAVE_NORM)
dm= get_cddm(ob, editData, dm, vertexCos);
- else if(wmd->texture || wmd->defgrp_name[0])
+ else if (wmd->texture || wmd->defgrp_name[0])
dm= get_dm(ob, editData, dm, NULL, 0);
waveModifier_do(wmd, md->scene, ob, dm, vertexCos, numVerts);
- if(dm != derivedData)
+ if (dm != derivedData)
dm->release(dm);
}
diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c
index 9794635e428..47a2aeaf4a2 100644
--- a/source/blender/modifiers/intern/MOD_weightvg_util.c
+++ b/source/blender/modifiers/intern/MOD_weightvg_util.c
@@ -52,7 +52,7 @@
#include "MOD_weightvg_util.h"
#include "RE_shader_ext.h" /* Texture masking. */
-/* Maps new_w weights in place, using either one of the predifined functions, or a custom curve.
+/* Maps new_w weights in place, using either one of the predefined functions, or a custom curve.
* Return values are in new_w.
* If indices is not NULL, it must be a table of same length as org_w and new_w, mapping to the real
* vertex index (in case the weight tables do not cover the whole vertices...).
@@ -64,14 +64,14 @@ void weightvg_do_map(int num, float *new_w, short falloff_type, CurveMapping *cm
/* Return immediately, if we have nothing to do! */
/* Also security checks... */
- if(((falloff_type == MOD_WVG_MAPPING_CURVE) && (cmap == NULL))
+ if (((falloff_type == MOD_WVG_MAPPING_CURVE) && (cmap == NULL))
|| !ELEM7(falloff_type, MOD_WVG_MAPPING_CURVE, MOD_WVG_MAPPING_SHARP, MOD_WVG_MAPPING_SMOOTH,
MOD_WVG_MAPPING_ROOT, MOD_WVG_MAPPING_SPHERE, MOD_WVG_MAPPING_RANDOM,
MOD_WVG_MAPPING_STEP))
return;
/* Map each weight (vertex) to its new value, accordingly to the chosen mode. */
- for(i = 0; i < num; ++i) {
+ for (i = 0; i < num; ++i) {
float fac = new_w[i];
/* Code borrowed from the warp modifier. */
@@ -109,7 +109,7 @@ void weightvg_do_map(int num, float *new_w, short falloff_type, CurveMapping *cm
* Return values are in org_w.
* If indices is not NULL, it must be a table of same length as org_w and new_w, mapping to the real
* vertex index (in case the weight tables do not cover the whole vertices...).
- * XXX The standard “factor” value is assumed in [0.0, 1.0] range. Else, weird results might appear.
+ * XXX The standard "factor" value is assumed in [0.0, 1.0] range. Else, weird results might appear.
*/
void weightvg_do_mask(int num, const int *indices, float *org_w, const float *new_w,
Object *ob, DerivedMesh *dm, float fact, const char defgrp_name[MAX_VGROUP_NAME],
@@ -146,7 +146,7 @@ void weightvg_do_mask(int num, const int *indices, float *org_w, const float *ne
MEM_freeN(v_co);
/* For each weight (vertex), make the mix between org and new weights. */
- for(i = 0; i < num; ++i) {
+ for (i = 0; i < num; ++i) {
int idx = indices ? indices[i] : i;
TexResult texres;
float h, s, v; /* For HSV color space. */
@@ -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
@@ -237,7 +237,7 @@ void weightvg_update_vg(MDeformVert *dvert, int defgrp_idx, MDeformWeight **dws,
{
int i;
- for(i = 0; i < num; i++) {
+ for (i = 0; i < num; i++) {
float w = weights[i];
MDeformVert *dv = &dvert[indices ? indices[i] : i];
MDeformWeight *dw = dws ? dws[i] : defvert_find_index(dv, defgrp_idx);
@@ -246,8 +246,8 @@ void weightvg_update_vg(MDeformVert *dvert, int defgrp_idx, MDeformWeight **dws,
CLAMP(w, 0.0f, 1.0f);
/* If the vertex is in this vgroup, remove it if needed, or just update it. */
- if(dw != NULL) {
- if(do_rem && w < rem_thresh) {
+ if (dw != NULL) {
+ if (do_rem && w < rem_thresh) {
defvert_remove_group(dv, dw);
}
else {
@@ -255,7 +255,7 @@ void weightvg_update_vg(MDeformVert *dvert, int defgrp_idx, MDeformWeight **dws,
}
}
/* Else, add it if needed! */
- else if(do_add && w > add_thresh) {
+ else if (do_add && w > add_thresh) {
defvert_add_index_notest(dv, defgrp_idx, w);
}
}
diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.h b/source/blender/modifiers/intern/MOD_weightvg_util.h
index 5572628fd3f..57ba115c04e 100644
--- a/source/blender/modifiers/intern/MOD_weightvg_util.h
+++ b/source/blender/modifiers/intern/MOD_weightvg_util.h
@@ -58,7 +58,7 @@ struct Tex;
*/
#define MOD_WVG_ZEROFLOOR 1.0e-32f
-/* Maps new_w weights in place, using either one of the predifined functions, or a custom curve.
+/* Maps new_w weights in place, using either one of the predefined functions, or a custom curve.
* Return values are in new_w.
* If indices is not NULL, it must be a table of same length as org_w and new_w, mapping to the real
* vertex index (in case the weight tables do not cover the whole vertices...).
@@ -70,14 +70,14 @@ void weightvg_do_map(int num, float *new_w, short mode, struct CurveMapping *cma
* Return values are in org_w.
* If indices is not NULL, it must be a table of same length as org_w and new_w, mapping to the real
* vertex index (in case the weight tables do not cover the whole vertices...).
- * XXX The standard “factor” value is assumed in [0.0, 1.0] range. Else, weird results might appear.
+ * XXX The standard "factor" value is assumed in [0.0, 1.0] range. Else, weird results might appear.
*/
void weightvg_do_mask(int num, const int *indices, float *org_w, const float *new_w, Object *ob,
DerivedMesh *dm, float fact, const char defgrp_name[MAX_VGROUP_NAME], Tex *texture,
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/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c
index 45c934654d0..d6bcca5524a 100644
--- a/source/blender/modifiers/intern/MOD_weightvgedit.c
+++ b/source/blender/modifiers/intern/MOD_weightvgedit.c
@@ -111,10 +111,10 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
dataMask |= CD_MASK_MDEFORMVERT;
/* Ask for UV coordinates if we need them. */
- if(wmd->mask_tex_mapping == MOD_DISP_MAP_UV)
+ if (wmd->mask_tex_mapping == MOD_DISP_MAP_UV)
dataMask |= CD_MASK_MTFACE;
- /* No need to ask for CD_WEIGHT_MCOL... */
+ /* No need to ask for CD_PREVIEW_MLOOPCOL... */
return dataMask;
}
@@ -123,7 +123,7 @@ static int dependsOnTime(ModifierData *md)
{
WeightVGEditModifierData *wmd = (WeightVGEditModifierData*) md;
- if(wmd->mask_texture)
+ if (wmd->mask_texture)
return BKE_texture_dependsOnTime(wmd->mask_texture);
return 0;
}
@@ -156,14 +156,14 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *UN
WeightVGEditModifierData *wmd = (WeightVGEditModifierData*) md;
DagNode *curNode;
- if(wmd->mask_tex_map_obj && wmd->mask_tex_mapping == MOD_DISP_MAP_OBJECT) {
+ if (wmd->mask_tex_map_obj && wmd->mask_tex_mapping == MOD_DISP_MAP_OBJECT) {
curNode = dag_get_node(forest, wmd->mask_tex_map_obj);
dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA,
"WeightVGEdit Modifier");
}
- if(wmd->mask_tex_mapping == MOD_DISP_MAP_GLOBAL)
+ if (wmd->mask_tex_mapping == MOD_DISP_MAP_GLOBAL)
dag_add_relation(forest, obNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA,
"WeightVGEdit Modifier");
}
@@ -211,15 +211,15 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
dvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MDEFORMVERT, numVerts);
/* If no vertices were ever added to an object's vgroup, dvert might be NULL. */
- if(!dvert)
+ if (!dvert)
/* If this modifier is not allowed to add vertices, just return. */
- if(!do_add)
+ if (!do_add)
return dm;
/* Else, add a valid data layer! */
dvert = CustomData_add_layer_named(&dm->vertData, CD_MDEFORMVERT, CD_CALLOC,
NULL, numVerts, wmd->defgrp_name);
/* Ultimate security check. */
- if(!dvert)
+ if (!dvert)
return dm;
/* Get org weights, assuming 0.0 for vertices not in given vgroup. */
@@ -228,7 +228,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
dw = MEM_mallocN(sizeof(MDeformWeight*) * numVerts, "WeightVGEdit Modifier, dw");
for (i = 0; i < numVerts; i++) {
dw[i] = defvert_find_index(&dvert[i], defgrp_idx);
- if(dw[i]) {
+ if (dw[i]) {
org_w[i] = new_w[i] = dw[i]->weight;
}
else {
@@ -252,7 +252,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
/* If weight preview enabled... */
#if 0 /* XXX Currently done in mod stack :/ */
- if(do_prev)
+ if (do_prev)
DM_update_weight_mcol(ob, dm, 0, org_w, 0, NULL);
#endif
diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c
index 81a6ecc99e5..cf4f9b31a7f 100644
--- a/source/blender/modifiers/intern/MOD_weightvgmix.c
+++ b/source/blender/modifiers/intern/MOD_weightvgmix.c
@@ -153,10 +153,10 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
dataMask |= CD_MASK_MDEFORMVERT;
/* Ask for UV coordinates if we need them. */
- if(wmd->mask_tex_mapping == MOD_DISP_MAP_UV)
+ if (wmd->mask_tex_mapping == MOD_DISP_MAP_UV)
dataMask |= CD_MASK_MTFACE;
- /* No need to ask for CD_WEIGHT_MCOL... */
+ /* No need to ask for CD_PREVIEW_MLOOPCOL... */
return dataMask;
}
@@ -165,7 +165,7 @@ static int dependsOnTime(ModifierData *md)
{
WeightVGMixModifierData *wmd = (WeightVGMixModifierData*) md;
- if(wmd->mask_texture)
+ if (wmd->mask_texture)
return BKE_texture_dependsOnTime(wmd->mask_texture);
return 0;
}
@@ -198,14 +198,14 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *UN
WeightVGMixModifierData *wmd = (WeightVGMixModifierData*) md;
DagNode *curNode;
- if(wmd->mask_tex_map_obj && wmd->mask_tex_mapping == MOD_DISP_MAP_OBJECT) {
+ if (wmd->mask_tex_map_obj && wmd->mask_tex_mapping == MOD_DISP_MAP_OBJECT) {
curNode = dag_get_node(forest, wmd->mask_tex_map_obj);
dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA,
"WeightVGMix Modifier");
}
- if(wmd->mask_tex_mapping == MOD_DISP_MAP_GLOBAL)
+ if (wmd->mask_tex_mapping == MOD_DISP_MAP_GLOBAL)
dag_add_relation(forest, obNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA,
"WeightVGMix Modifier");
}
@@ -258,15 +258,15 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
dvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MDEFORMVERT, numVerts);
/* If no vertices were ever added to an object's vgroup, dvert might be NULL. */
- if(!dvert)
+ if (!dvert)
/* If not affecting all vertices, just return. */
- if(wmd->mix_set != MOD_WVG_SET_ALL)
+ if (wmd->mix_set != MOD_WVG_SET_ALL)
return dm;
/* Else, add a valid data layer! */
dvert = CustomData_add_layer_named(&dm->vertData, CD_MDEFORMVERT, CD_CALLOC,
NULL, numVerts, wmd->defgrp_name_a);
/* Ultimate security check. */
- if(!dvert)
+ if (!dvert)
return dm;
/* Find out which vertices to work on. */
@@ -278,7 +278,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
/* All vertices in first vgroup. */
for (i = 0; i < numVerts; i++) {
MDeformWeight *dw = defvert_find_index(&dvert[i], defgrp_idx);
- if(dw) {
+ if (dw) {
tdw1[numIdx] = dw;
tdw2[numIdx] = defvert_find_index(&dvert[i], defgrp_idx2);
tidx[numIdx++] = i;
@@ -289,7 +289,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
/* All vertices in second vgroup. */
for (i = 0; i < numVerts; i++) {
MDeformWeight *dw = defvert_find_index(&dvert[i], defgrp_idx2);
- if(dw) {
+ if (dw) {
tdw1[numIdx] = defvert_find_index(&dvert[i], defgrp_idx);
tdw2[numIdx] = dw;
tidx[numIdx++] = i;
@@ -301,7 +301,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
for (i = 0; i < numVerts; i++) {
MDeformWeight *adw = defvert_find_index(&dvert[i], defgrp_idx);
MDeformWeight *bdw = defvert_find_index(&dvert[i], defgrp_idx2);
- if(adw || bdw) {
+ if (adw || bdw) {
tdw1[numIdx] = adw;
tdw2[numIdx] = bdw;
tidx[numIdx++] = i;
@@ -313,7 +313,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
for (i = 0; i < numVerts; i++) {
MDeformWeight *adw = defvert_find_index(&dvert[i], defgrp_idx);
MDeformWeight *bdw = defvert_find_index(&dvert[i], defgrp_idx2);
- if(adw && bdw) {
+ if (adw && bdw) {
tdw1[numIdx] = adw;
tdw2[numIdx] = bdw;
tidx[numIdx++] = i;
@@ -330,7 +330,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
numIdx = -1;
break;
}
- if(numIdx == 0) {
+ if (numIdx == 0) {
/* Use no vertices! Hence, return org data. */
MEM_freeN(tdw1);
MEM_freeN(tdw2);
@@ -380,7 +380,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
/* If weight preview enabled... */
#if 0 /* XXX Currently done in mod stack :/ */
- if(do_prev)
+ if (do_prev)
DM_update_weight_mcol(ob, dm, 0, org_w, numIdx, indices);
#endif
diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c
index ec9b2b80d83..241fcd05eab 100644
--- a/source/blender/modifiers/intern/MOD_weightvgproximity.c
+++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c
@@ -80,7 +80,7 @@ static void get_vert2geom_distance(int numVerts, float (*v_cos)[3],
if (dist_v) {
/* Create a bvh-tree of the given target's verts. */
bvhtree_from_mesh_verts(&treeData_v, target, 0.0, 2, 6);
- if(treeData_v.tree == NULL) {
+ if (treeData_v.tree == NULL) {
OUT_OF_MEMORY();
return;
}
@@ -88,7 +88,7 @@ static void get_vert2geom_distance(int numVerts, float (*v_cos)[3],
if (dist_e) {
/* Create a bvh-tree of the given target's edges. */
bvhtree_from_mesh_edges(&treeData_e, target, 0.0, 2, 6);
- if(treeData_e.tree == NULL) {
+ if (treeData_e.tree == NULL) {
OUT_OF_MEMORY();
return;
}
@@ -96,7 +96,7 @@ static void get_vert2geom_distance(int numVerts, float (*v_cos)[3],
if (dist_f) {
/* Create a bvh-tree of the given target's faces. */
bvhtree_from_mesh_faces(&treeData_f, target, 0.0, 2, 6);
- if(treeData_f.tree == NULL) {
+ if (treeData_f.tree == NULL) {
OUT_OF_MEMORY();
return;
}
@@ -165,7 +165,7 @@ static void get_vert2ob_distance(int numVerts, float (*v_cos)[3], float *dist,
float v_wco[3];
unsigned int i= numVerts;
- while(i-- > 0) {
+ while (i-- > 0) {
/* Get world-coordinates of the vertex (constraints and anim included). */
mul_v3_m4v3(v_wco, ob->obmat, v_cos[i]);
/* Return distance between both coordinates. */
@@ -183,33 +183,33 @@ static float get_ob2ob_distance(const Object* ob, const Object* obr)
}
/**
- * Maps distances to weights, with an optionnal “smoothing” mapping.
+ * Maps distances to weights, with an optionnal "smoothing" mapping.
*/
void do_map(float *weights, const int nidx, const float min_d, const float max_d, short mode)
{
const float range_inv= 1.0f / (max_d - min_d); /* invert since multiplication is faster */
unsigned int i= nidx;
- if(max_d == min_d) {
+ if (max_d == min_d) {
while (i-- > 0) {
weights[i] = (weights[i] >= max_d) ? 1.0f : 0.0f; /* "Step" behavior... */
}
}
- else if(max_d > min_d) {
+ else if (max_d > min_d) {
while (i-- > 0) {
if (weights[i] >= max_d) weights[i]= 1.0f; /* most likely case first */
- else if(weights[i] <= min_d) weights[i]= 0.0f;
+ else if (weights[i] <= min_d) weights[i]= 0.0f;
else weights[i]= (weights[i] - min_d) * range_inv;
}
}
else {
while (i-- > 0) {
if (weights[i] <= max_d) weights[i]= 1.0f; /* most likely case first */
- else if(weights[i] >= min_d) weights[i]= 0.0f;
+ else if (weights[i] >= min_d) weights[i]= 0.0f;
else weights[i]= (weights[i] - min_d) * range_inv;
}
}
- if(!ELEM(mode, MOD_WVG_MAPPING_NONE, MOD_WVG_MAPPING_CURVE)) {
+ if (!ELEM(mode, MOD_WVG_MAPPING_NONE, MOD_WVG_MAPPING_CURVE)) {
weightvg_do_map(nidx, weights, mode, NULL);
}
}
@@ -264,10 +264,10 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
dataMask |= CD_MASK_MDEFORMVERT;
/* Ask for UV coordinates if we need them. */
- if(wmd->mask_tex_mapping == MOD_DISP_MAP_UV)
+ if (wmd->mask_tex_mapping == MOD_DISP_MAP_UV)
dataMask |= CD_MASK_MTFACE;
- /* No need to ask for CD_WEIGHT_MCOL... */
+ /* No need to ask for CD_PREVIEW_MLOOPCOL... */
return dataMask;
}
@@ -276,7 +276,7 @@ static int dependsOnTime(ModifierData *md)
{
WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData*) md;
- if(wmd->mask_texture)
+ if (wmd->mask_texture)
return BKE_texture_dependsOnTime(wmd->mask_texture);
return 0;
}
@@ -316,14 +316,14 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *UN
"WeightVGProximity Modifier");
}
- if(wmd->mask_tex_map_obj && wmd->mask_tex_mapping == MOD_DISP_MAP_OBJECT) {
+ if (wmd->mask_tex_map_obj && wmd->mask_tex_mapping == MOD_DISP_MAP_OBJECT) {
curNode = dag_get_node(forest, wmd->mask_tex_map_obj);
dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA,
"WeightVGProximity Modifier");
}
- if(wmd->mask_tex_mapping == MOD_DISP_MAP_GLOBAL)
+ if (wmd->mask_tex_mapping == MOD_DISP_MAP_GLOBAL)
dag_add_relation(forest, obNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA,
"WeightVGProximity Modifier");
}
@@ -385,7 +385,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
dvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MDEFORMVERT, numVerts);
/* If no vertices were ever added to an object's vgroup, dvert might be NULL.
* As this modifier never add vertices to vgroup, just return. */
- if(!dvert)
+ if (!dvert)
return dm;
/* Find out which vertices to work on (all vertices in vgroup), and get their relevant weight.
@@ -395,20 +395,20 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
tdw = MEM_mallocN(sizeof(MDeformWeight*) * numVerts, "WeightVGProximity Modifier, tdw");
for (i = 0; i < numVerts; i++) {
MDeformWeight *_dw = defvert_find_index(&dvert[i], defgrp_idx);
- if(_dw) {
+ if (_dw) {
tidx[numIdx] = i;
tw[numIdx] = _dw->weight;
tdw[numIdx++] = _dw;
}
}
/* If no vertices found, return org data! */
- if(numIdx == 0) {
+ if (numIdx == 0) {
MEM_freeN(tidx);
MEM_freeN(tw);
MEM_freeN(tdw);
return dm;
}
- if(numIdx != numVerts) {
+ if (numIdx != numVerts) {
indices = MEM_mallocN(sizeof(int) * numIdx, "WeightVGProximity Modifier, indices");
memcpy(indices, tidx, sizeof(int) * numIdx);
org_w = MEM_mallocN(sizeof(float) * numIdx, "WeightVGProximity Modifier, org_w");
@@ -427,7 +427,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
/* Get our vertex coordinates. */
v_cos = MEM_mallocN(sizeof(float[3]) * numIdx, "WeightVGProximity Modifier, v_cos");
- if(numIdx != numVerts) {
+ if (numIdx != numVerts) {
/* XXX In some situations, this code can be up to about 50 times more performant
* than simply using getVertCo for each affected vertex...
*/
@@ -443,7 +443,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
/* Compute wanted distances. */
if (wmd->proximity_mode == MOD_WVG_PROXIMITY_OBJECT) {
const float dist = get_ob2ob_distance(ob, obr);
- for(i = 0; i < numIdx; i++)
+ for (i = 0; i < numIdx; i++)
new_w[i] = dist;
}
else if (wmd->proximity_mode == MOD_WVG_PROXIMITY_GEOMETRY) {
@@ -477,17 +477,17 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
space_transform_setup(&loc2trgt, ob, obr);
get_vert2geom_distance(numIdx, v_cos, dists_v, dists_e, dists_f,
target_dm, &loc2trgt);
- for(i = 0; i < numIdx; i++) {
+ for (i = 0; i < numIdx; i++) {
new_w[i] = dists_v ? dists_v[i] : FLT_MAX;
- if(dists_e)
+ if (dists_e)
new_w[i] = minf(dists_e[i], new_w[i]);
- if(dists_f)
+ if (dists_f)
new_w[i] = minf(dists_f[i], new_w[i]);
}
- if(free_target_dm) target_dm->release(target_dm);
- if(dists_v) MEM_freeN(dists_v);
- if(dists_e) MEM_freeN(dists_e);
- if(dists_f) MEM_freeN(dists_f);
+ if (free_target_dm) target_dm->release(target_dm);
+ if (dists_v) MEM_freeN(dists_v);
+ if (dists_e) MEM_freeN(dists_e);
+ if (dists_f) MEM_freeN(dists_f);
}
/* Else, fall back to default obj2vert behavior. */
else {
@@ -512,7 +512,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
/* If weight preview enabled... */
#if 0 /* XXX Currently done in mod stack :/ */
- if(do_prev)
+ if (do_prev)
DM_update_weight_mcol(ob, dm, 0, org_w, numIdx, indices);
#endif
@@ -520,7 +520,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
MEM_freeN(org_w);
MEM_freeN(new_w);
MEM_freeN(dw);
- if(indices)
+ if (indices)
MEM_freeN(indices);
MEM_freeN(v_cos);
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index b458ae3a77d..9bcbc91265c 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -222,4 +222,12 @@ if(WITH_PYTHON)
add_definitions(-DWITH_PYTHON)
endif()
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
+if(WITH_IMAGE_OPENEXR)
+ add_definitions(-DWITH_OPENEXR)
+endif()
+
blender_add_lib(bf_nodes "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/nodes/NOD_composite.h b/source/blender/nodes/NOD_composite.h
index e2bbaea8c7f..284b89bc095 100644
--- a/source/blender/nodes/NOD_composite.h
+++ b/source/blender/nodes/NOD_composite.h
@@ -55,7 +55,6 @@ void register_node_type_cmp_composite(struct bNodeTreeType *ttype);
void register_node_type_cmp_viewer(struct bNodeTreeType *ttype);
void register_node_type_cmp_splitviewer(struct bNodeTreeType *ttype);
void register_node_type_cmp_output_file(struct bNodeTreeType *ttype);
-void register_node_type_cmp_output_multi_file(struct bNodeTreeType *ttype);
void register_node_type_cmp_view_levels(struct bNodeTreeType *ttype);
void register_node_type_cmp_curve_rgb(struct bNodeTreeType *ttype);
diff --git a/source/blender/nodes/SConscript b/source/blender/nodes/SConscript
index d7dbed51282..fcf00bdef78 100644
--- a/source/blender/nodes/SConscript
+++ b/source/blender/nodes/SConscript
@@ -26,6 +26,9 @@ if env['WITH_BF_PYTHON']:
if env['BF_DEBUG']:
defs.append('_DEBUG')
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
if env['OURPLATFORM'] == 'linux':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c
index 0ebed7105f0..7bd0d03322d 100644
--- a/source/blender/nodes/composite/node_composite_tree.c
+++ b/source/blender/nodes/composite/node_composite_tree.c
@@ -63,8 +63,8 @@
static void foreach_nodetree(Main *main, void *calldata, bNodeTreeCallback func)
{
Scene *sce;
- for(sce= main->scene.first; sce; sce= sce->id.next) {
- if(sce->nodetree) {
+ for (sce= main->scene.first; sce; sce= sce->id.next) {
+ if (sce->nodetree) {
func(calldata, &sce->id, sce->nodetree);
}
}
@@ -88,8 +88,8 @@ static void free_node_cache(bNodeTree *UNUSED(ntree), bNode *node)
{
bNodeSocket *sock;
- for(sock= node->outputs.first; sock; sock= sock->next) {
- if(sock->cache) {
+ for (sock= node->outputs.first; sock; sock= sock->next) {
+ if (sock->cache) {
free_compbuf(sock->cache);
sock->cache= NULL;
}
@@ -99,7 +99,7 @@ static void free_node_cache(bNodeTree *UNUSED(ntree), bNode *node)
static void free_cache(bNodeTree *ntree)
{
bNode *node;
- for(node= ntree->nodes.first; node; node= node->next)
+ for (node= ntree->nodes.first; node; node= node->next)
free_node_cache(ntree, node);
}
@@ -107,8 +107,8 @@ static void update_node(bNodeTree *ntree, bNode *node)
{
bNodeSocket *sock;
- for(sock= node->outputs.first; sock; sock= sock->next) {
- if(sock->cache) {
+ for (sock= node->outputs.first; sock; sock= sock->next) {
+ if (sock->cache) {
//free_compbuf(sock->cache);
//sock->cache= NULL;
}
@@ -126,23 +126,23 @@ static void localize(bNodeTree *localtree, bNodeTree *ntree)
bNode *node, *node_next;
bNodeSocket *sock;
- for(node= ntree->nodes.first; node; node= node->next) {
+ for (node= ntree->nodes.first; node; node= node->next) {
/* ensure new user input gets handled ok */
node->need_exec= 0;
/* move over the compbufs */
/* right after ntreeCopyTree() oldsock pointers are valid */
- if(ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
- if(node->id) {
- if(node->flag & NODE_DO_OUTPUT)
+ if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
+ if (node->id) {
+ if (node->flag & NODE_DO_OUTPUT)
node->new_node->id= (ID *)copy_image((Image *)node->id);
else
node->new_node->id= NULL;
}
}
- for(sock= node->outputs.first; sock; sock= sock->next) {
+ for (sock= node->outputs.first; sock; sock= sock->next) {
sock->new_sock->cache= sock->cache;
compbuf_set_node(sock->new_sock->cache, node->new_node);
@@ -177,11 +177,11 @@ static void local_sync(bNodeTree *localtree, bNodeTree *ntree)
bNode *lnode;
/* move over the compbufs and previews */
- for(lnode= localtree->nodes.first; lnode; lnode= lnode->next) {
- if( (lnode->exec & NODE_READY) && !(lnode->exec & NODE_SKIPPED) ) {
- if(ntreeNodeExists(ntree, lnode->new_node)) {
+ for (lnode= localtree->nodes.first; lnode; lnode= lnode->next) {
+ if ( (lnode->exec & NODE_READY) && !(lnode->exec & NODE_SKIPPED) ) {
+ if (ntreeNodeExists(ntree, lnode->new_node)) {
- if(lnode->preview && lnode->preview->rect) {
+ if (lnode->preview && lnode->preview->rect) {
nodeFreePreview(lnode->new_node);
lnode->new_node->preview= lnode->preview;
lnode->preview= NULL;
@@ -197,28 +197,28 @@ static void local_merge(bNodeTree *localtree, bNodeTree *ntree)
bNodeSocket *lsock;
/* move over the compbufs and previews */
- for(lnode= localtree->nodes.first; lnode; lnode= lnode->next) {
- if(ntreeNodeExists(ntree, lnode->new_node)) {
- if(ELEM(lnode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
- if(lnode->id && (lnode->flag & NODE_DO_OUTPUT)) {
+ for (lnode= localtree->nodes.first; lnode; lnode= lnode->next) {
+ if (ntreeNodeExists(ntree, lnode->new_node)) {
+ if (ELEM(lnode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
+ if (lnode->id && (lnode->flag & NODE_DO_OUTPUT)) {
/* image_merge does sanity check for pointers */
BKE_image_merge((Image *)lnode->new_node->id, (Image *)lnode->id);
}
}
- else if(lnode->type==CMP_NODE_MOVIEDISTORTION) {
+ else if (lnode->type==CMP_NODE_MOVIEDISTORTION) {
/* special case for distortion node: distortion context is allocating in exec function
and to achive much better performance on further calls this context should be
copied back to original node */
- if(lnode->storage) {
- if(lnode->new_node->storage)
+ if (lnode->storage) {
+ if (lnode->new_node->storage)
BKE_tracking_distortion_destroy(lnode->new_node->storage);
lnode->new_node->storage= BKE_tracking_distortion_copy(lnode->storage);
}
}
- for(lsock= lnode->outputs.first; lsock; lsock= lsock->next) {
- if(ntreeOutputExists(lnode->new_node, lsock->new_sock)) {
+ for (lsock= lnode->outputs.first; lsock; lsock= lsock->next) {
+ if (ntreeOutputExists(lnode->new_node, lsock->new_sock)) {
lsock->new_sock->cache= lsock->cache;
compbuf_set_node(lsock->new_sock->cache, lnode->new_node);
lsock->cache= NULL;
@@ -276,21 +276,21 @@ struct bNodeTreeExec *ntreeCompositBeginExecTree(bNodeTree *ntree, int use_tree_
exec = ntree_exec_begin(ntree);
- for(node= exec->nodetree->nodes.first; node; node= node->next) {
+ for (node= exec->nodetree->nodes.first; node; node= node->next) {
/* initialize needed for groups */
node->exec= 0;
- for(sock= node->outputs.first; sock; sock= sock->next) {
+ for (sock= node->outputs.first; sock; sock= sock->next) {
bNodeStack *ns= node_get_socket_stack(exec->stack, sock);
- if(ns && sock->cache) {
+ if (ns && sock->cache) {
ns->data= sock->cache;
sock->cache= NULL;
}
}
/* cannot initialize them while using in threads */
- if(ELEM4(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT)) {
+ if (ELEM4(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT)) {
curvemapping_initialize(node->storage);
- if(node->type==CMP_NODE_CURVE_RGB)
+ if (node->type==CMP_NODE_CURVE_RGB)
curvemapping_premultiply(node->storage, 0);
}
}
@@ -310,22 +310,22 @@ struct bNodeTreeExec *ntreeCompositBeginExecTree(bNodeTree *ntree, int use_tree_
*/
void ntreeCompositEndExecTree(bNodeTreeExec *exec, int use_tree_data)
{
- if(exec) {
+ if (exec) {
bNodeTree *ntree= exec->nodetree;
bNode *node;
bNodeStack *ns;
- for(node= exec->nodetree->nodes.first; node; node= node->next) {
+ for (node= exec->nodetree->nodes.first; node; node= node->next) {
bNodeSocket *sock;
- for(sock= node->outputs.first; sock; sock= sock->next) {
+ for (sock= node->outputs.first; sock; sock= sock->next) {
ns = node_get_socket_stack(exec->stack, sock);
- if(ns && ns->data) {
+ if (ns && ns->data) {
sock->cache= ns->data;
ns->data= NULL;
}
}
- if(node->type==CMP_NODE_CURVE_RGB)
+ if (node->type==CMP_NODE_CURVE_RGB)
curvemapping_premultiply(node->storage, 1);
node->need_exec= 0;
@@ -347,14 +347,14 @@ static int node_only_value(bNode *node)
{
bNodeSocket *sock;
- if(ELEM3(node->type, CMP_NODE_TIME, CMP_NODE_VALUE, CMP_NODE_RGB))
+ if (ELEM3(node->type, CMP_NODE_TIME, CMP_NODE_VALUE, CMP_NODE_RGB))
return 1;
/* doing this for all node types goes wrong. memory free errors */
- if(node->inputs.first && node->type==CMP_NODE_MAP_VALUE) {
+ if (node->inputs.first && node->type==CMP_NODE_MAP_VALUE) {
int retval= 1;
- for(sock= node->inputs.first; sock; sock= sock->next) {
- if(sock->link)
+ for (sock= node->inputs.first; sock; sock= sock->next) {
+ if (sock->link)
retval &= node_only_value(sock->link->fromnode);
}
return retval;
@@ -378,7 +378,7 @@ static void *exec_composite_node(void *nodeexec_v)
node_get_stack(node, thd->stack, nsin, nsout);
- if(node->typeinfo->execfunc)
+ if (node->typeinfo->execfunc)
node->typeinfo->execfunc(thd->rd, node, nsin, nsout);
else if (node->typeinfo->newexecfunc)
node->typeinfo->newexecfunc(thd->rd, 0, node, nodeexec->data, nsin, nsout);
@@ -399,13 +399,13 @@ static int setExecutableNodes(bNodeTreeExec *exec, ThreadData *thd)
int n, totnode= 0, group_edit= 0;
/* if we are in group edit, viewer nodes get skipped when group has viewer */
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->type==NODE_GROUP && (node->flag & NODE_GROUP_EDIT))
- if(ntreeHasType((bNodeTree *)node->id, CMP_NODE_VIEWER))
+ for (node= ntree->nodes.first; node; node= node->next)
+ if (node->type==NODE_GROUP && (node->flag & NODE_GROUP_EDIT))
+ if (ntreeHasType((bNodeTree *)node->id, CMP_NODE_VIEWER))
group_edit= 1;
/* NB: using the exec data list here to have valid dependency sort */
- for(n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
+ for (n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
int a;
node = nodeexec->node;
@@ -413,9 +413,9 @@ static int setExecutableNodes(bNodeTreeExec *exec, ThreadData *thd)
/* test the outputs */
/* skip value-only nodes (should be in type!) */
- if(!node_only_value(node)) {
- for(a=0, sock= node->outputs.first; sock; sock= sock->next, a++) {
- if(nsout[a]->data==NULL && nsout[a]->hasoutput) {
+ if (!node_only_value(node)) {
+ for (a=0, sock= node->outputs.first; sock; sock= sock->next, a++) {
+ if (nsout[a]->data==NULL && nsout[a]->hasoutput) {
node->need_exec= 1;
break;
}
@@ -423,18 +423,18 @@ static int setExecutableNodes(bNodeTreeExec *exec, ThreadData *thd)
}
/* test the inputs */
- for(a=0, sock= node->inputs.first; sock; sock= sock->next, a++) {
+ for (a=0, sock= node->inputs.first; sock; sock= sock->next, a++) {
/* skip viewer nodes in bg render or group edit */
- if( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER) && (G.background || group_edit))
+ if ( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER) && (G.background || group_edit))
node->need_exec= 0;
/* is sock in use? */
- else if(sock->link) {
+ else if (sock->link) {
bNodeLink *link= sock->link;
/* this is the test for a cyclic case */
- if(link->fromnode==NULL || link->tonode==NULL);
- else if(link->fromnode->level >= link->tonode->level && link->tonode->level!=0xFFF) {
- if(link->fromnode->need_exec) {
+ if (link->fromnode==NULL || link->tonode==NULL);
+ else if (link->fromnode->level >= link->tonode->level && link->tonode->level!=0xFFF) {
+ if (link->fromnode->need_exec) {
node->need_exec= 1;
break;
}
@@ -446,11 +446,11 @@ static int setExecutableNodes(bNodeTreeExec *exec, ThreadData *thd)
}
}
- if(node->need_exec) {
+ if (node->need_exec) {
/* free output buffers */
- for(a=0, sock= node->outputs.first; sock; sock= sock->next, a++) {
- if(nsout[a]->data) {
+ for (a=0, sock= node->outputs.first; sock; sock= sock->next, a++) {
+ if (nsout[a]->data) {
free_compbuf(nsout[a]->data);
nsout[a]->data= NULL;
}
@@ -470,11 +470,11 @@ static int setExecutableNodes(bNodeTreeExec *exec, ThreadData *thd)
/* last step: set the stack values for only-value nodes */
/* just does all now, compared to a full buffer exec this is nothing */
- if(totnode) {
- for(n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
+ if (totnode) {
+ for (n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
node = nodeexec->node;
- if(node->need_exec==0 && node_only_value(node)) {
- if(node->typeinfo->execfunc) {
+ if (node->need_exec==0 && node_only_value(node)) {
+ if (node->typeinfo->execfunc) {
node_get_stack(node, exec->stack, nsin, nsout);
node->typeinfo->execfunc(thd->rd, node, nsin, nsout);
}
@@ -499,31 +499,31 @@ static void freeExecutableNode(bNodeTreeExec *exec)
int n;
/* set exec flag for finished nodes that might need freed */
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type!=CMP_NODE_R_LAYERS)
- if(node->exec & NODE_FINISHED)
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->type!=CMP_NODE_R_LAYERS)
+ if (node->exec & NODE_FINISHED)
node->exec |= NODE_FREEBUFS;
}
/* clear this flag for input links that are not done yet.
* Using the exec data for valid dependency sort.
*/
- for(n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
+ for (n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
node = nodeexec->node;
- if((node->exec & NODE_FINISHED)==0) {
- for(sock= node->inputs.first; sock; sock= sock->next)
- if(sock->link)
+ if ((node->exec & NODE_FINISHED)==0) {
+ for (sock= node->inputs.first; sock; sock= sock->next)
+ if (sock->link)
sock->link->fromnode->exec &= ~NODE_FREEBUFS;
}
}
/* now we can free buffers */
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->exec & NODE_FREEBUFS) {
- for(sock= node->outputs.first; sock; sock= sock->next) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->exec & NODE_FREEBUFS) {
+ for (sock= node->outputs.first; sock; sock= sock->next) {
bNodeStack *ns= node_get_socket_stack(exec->stack, sock);
- if(ns && ns->data) {
+ if (ns && ns->data) {
free_compbuf(ns->data);
ns->data= NULL;
- // printf("freed buf node %s \n", node->name);
+ // printf("freed buf node %s\n", node->name);
}
}
}
@@ -536,15 +536,15 @@ static bNodeExec *getExecutableNode(bNodeTreeExec *exec)
bNodeSocket *sock;
int n;
- for(n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
- if(nodeexec->node->exec==0) {
+ for (n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
+ if (nodeexec->node->exec==0) {
/* input sockets should be ready */
- for(sock= nodeexec->node->inputs.first; sock; sock= sock->next) {
- if(sock->link && sock->link->fromnode)
- if((sock->link->fromnode->exec & NODE_READY)==0)
+ for (sock= nodeexec->node->inputs.first; sock; sock= sock->next) {
+ if (sock->link && sock->link->fromnode)
+ if ((sock->link->fromnode->exec & NODE_READY)==0)
break;
}
- if(sock==NULL)
+ if (sock==NULL)
return nodeexec;
}
}
@@ -556,12 +556,12 @@ static void ntree_composite_texnode(bNodeTree *ntree, int init)
{
bNode *node;
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_TEXTURE && node->id) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->type==CMP_NODE_TEXTURE && node->id) {
Tex *tex= (Tex *)node->id;
- if(tex->nodetree && tex->use_nodes) {
+ if (tex->nodetree && tex->use_nodes) {
/* has internal flag to detect it only does it once */
- if(init) {
+ if (init) {
if (!tex->nodetree->execdata)
tex->nodetree->execdata = ntreeTexBeginExecTree(tex->nodetree, 1);
}
@@ -584,11 +584,11 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview)
int totnode, curnode, rendering= 1, n;
bNodeTreeExec *exec;
- if(ntree==NULL) return;
+ if (ntree==NULL) return;
exec = ntree->execdata;
- if(do_preview)
+ if (do_preview)
ntreeInitPreview(ntree, 0, 0);
if (!ntree->execdata) {
@@ -598,7 +598,7 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview)
ntree_composite_texnode(ntree, 1);
/* prevent unlucky accidents */
- if(G.background)
+ if (G.background)
rd->scemode &= ~R_COMP_CROP;
/* setup callerdata for thread callback */
@@ -613,15 +613,15 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview)
BLI_init_threads(&threads, exec_composite_node, rd->threads);
- while(rendering) {
+ while (rendering) {
- if(BLI_available_threads(&threads)) {
+ if (BLI_available_threads(&threads)) {
nodeexec= getExecutableNode(exec);
- if(nodeexec) {
+ if (nodeexec) {
node = nodeexec->node;
- if(ntree->progress && totnode)
+ if (ntree->progress && totnode)
ntree->progress(ntree->prh, (1.0f - curnode/(float)totnode));
- if(ntree->stats_draw) {
+ if (ntree->stats_draw) {
char str[128];
BLI_snprintf(str, sizeof(str), "Compositing %d %s", curnode, node->name);
ntree->stats_draw(ntree->sdh, str);
@@ -640,21 +640,21 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview)
rendering= 0;
/* test for ESC */
- if(ntree->test_break && ntree->test_break(ntree->tbh)) {
- for(node= ntree->nodes.first; node; node= node->next)
+ if (ntree->test_break && ntree->test_break(ntree->tbh)) {
+ for (node= ntree->nodes.first; node; node= node->next)
node->exec |= NODE_READY;
}
/* check for ready ones, and if we need to continue */
- for(n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
+ for (n=0, nodeexec=exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
node = nodeexec->node;
- if(node->exec & NODE_READY) {
- if((node->exec & NODE_FINISHED)==0) {
+ if (node->exec & NODE_READY) {
+ if ((node->exec & NODE_FINISHED)==0) {
BLI_remove_thread(&threads, nodeexec); /* this waits for running thread to finish btw */
node->exec |= NODE_FINISHED;
/* freeing unused buffers */
- if(rd->scemode & R_COMP_FREE)
+ if (rd->scemode & R_COMP_FREE)
freeExecutableNode(exec);
}
}
@@ -675,10 +675,10 @@ static void force_hidden_passes(bNode *node, int passflag)
{
bNodeSocket *sock;
- for(sock= node->outputs.first; sock; sock= sock->next)
+ for (sock= node->outputs.first; sock; sock= sock->next)
sock->flag &= ~SOCK_UNAVAIL;
- if(!(passflag & SCE_PASS_COMBINED)) {
+ if (!(passflag & SCE_PASS_COMBINED)) {
sock= BLI_findlink(&node->outputs, RRES_OUT_IMAGE);
sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_ALPHA);
@@ -686,60 +686,60 @@ static void force_hidden_passes(bNode *node, int passflag)
}
sock= BLI_findlink(&node->outputs, RRES_OUT_Z);
- if(!(passflag & SCE_PASS_Z)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_Z)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_NORMAL);
- if(!(passflag & SCE_PASS_NORMAL)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_NORMAL)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_VEC);
- if(!(passflag & SCE_PASS_VECTOR)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_VECTOR)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_UV);
- if(!(passflag & SCE_PASS_UV)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_UV)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_RGBA);
- if(!(passflag & SCE_PASS_RGBA)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_RGBA)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_DIFF);
- if(!(passflag & SCE_PASS_DIFFUSE)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_DIFFUSE)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_SPEC);
- if(!(passflag & SCE_PASS_SPEC)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_SPEC)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_SHADOW);
- if(!(passflag & SCE_PASS_SHADOW)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_SHADOW)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_AO);
- if(!(passflag & SCE_PASS_AO)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_AO)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_REFLECT);
- if(!(passflag & SCE_PASS_REFLECT)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_REFLECT)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_REFRACT);
- if(!(passflag & SCE_PASS_REFRACT)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_REFRACT)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_INDIRECT);
- if(!(passflag & SCE_PASS_INDIRECT)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_INDIRECT)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_INDEXOB);
- if(!(passflag & SCE_PASS_INDEXOB)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_INDEXOB)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_INDEXMA);
- if(!(passflag & SCE_PASS_INDEXMA)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_INDEXMA)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_MIST);
- if(!(passflag & SCE_PASS_MIST)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_MIST)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_EMIT);
- if(!(passflag & SCE_PASS_EMIT)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_EMIT)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_ENV);
- if(!(passflag & SCE_PASS_ENVIRONMENT)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_ENVIRONMENT)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_DIFF_DIRECT);
- if(!(passflag & SCE_PASS_DIFFUSE_DIRECT)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_DIFFUSE_DIRECT)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_DIFF_INDIRECT);
- if(!(passflag & SCE_PASS_DIFFUSE_INDIRECT)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_DIFFUSE_INDIRECT)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_DIFF_COLOR);
- if(!(passflag & SCE_PASS_DIFFUSE_COLOR)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_DIFFUSE_COLOR)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_GLOSSY_DIRECT);
- if(!(passflag & SCE_PASS_GLOSSY_DIRECT)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_GLOSSY_DIRECT)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_GLOSSY_INDIRECT);
- if(!(passflag & SCE_PASS_GLOSSY_INDIRECT)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_GLOSSY_INDIRECT)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_GLOSSY_COLOR);
- if(!(passflag & SCE_PASS_GLOSSY_COLOR)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_GLOSSY_COLOR)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_TRANSM_DIRECT);
- if(!(passflag & SCE_PASS_TRANSM_DIRECT)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_TRANSM_DIRECT)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_TRANSM_INDIRECT);
- if(!(passflag & SCE_PASS_TRANSM_INDIRECT)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_TRANSM_INDIRECT)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_TRANSM_COLOR);
- if(!(passflag & SCE_PASS_TRANSM_COLOR)) sock->flag |= SOCK_UNAVAIL;
+ if (!(passflag & SCE_PASS_TRANSM_COLOR)) sock->flag |= SOCK_UNAVAIL;
sock= BLI_findlink(&node->outputs, RRES_OUT_TRANSM_COLOR);
}
@@ -748,27 +748,27 @@ void ntreeCompositForceHidden(bNodeTree *ntree, Scene *curscene)
{
bNode *node;
- if(ntree==NULL) return;
+ if (ntree==NULL) return;
- for(node= ntree->nodes.first; node; node= node->next) {
- if( node->type==CMP_NODE_R_LAYERS) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if ( node->type==CMP_NODE_R_LAYERS) {
Scene *sce= node->id?(Scene *)node->id:curscene;
SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1);
- if(srl)
+ if (srl)
force_hidden_passes(node, srl->passflag);
}
- else if( node->type==CMP_NODE_IMAGE) {
+ else if ( node->type==CMP_NODE_IMAGE) {
Image *ima= (Image *)node->id;
- if(ima) {
- if(ima->rr) {
+ if (ima) {
+ if (ima->rr) {
ImageUser *iuser= node->storage;
RenderLayer *rl= BLI_findlink(&ima->rr->layers, iuser->layer);
- if(rl)
+ if (rl)
force_hidden_passes(node, rl->passflag);
else
force_hidden_passes(node, RRES_OUT_IMAGE|RRES_OUT_ALPHA);
}
- else if(ima->type!=IMA_TYPE_MULTILAYER) { /* if ->rr not yet read we keep inputs */
+ else if (ima->type!=IMA_TYPE_MULTILAYER) { /* if ->rr not yet read we keep inputs */
force_hidden_passes(node, RRES_OUT_IMAGE|RRES_OUT_ALPHA|RRES_OUT_Z);
}
else
@@ -787,14 +787,14 @@ void ntreeCompositTagRender(Scene *curscene)
{
Scene *sce;
- for(sce= G.main->scene.first; sce; sce= sce->id.next) {
- if(sce->nodetree) {
+ for (sce= G.main->scene.first; sce; sce= sce->id.next) {
+ if (sce->nodetree) {
bNode *node;
- for(node= sce->nodetree->nodes.first; node; node= node->next) {
- if(node->id==(ID *)curscene || node->type==CMP_NODE_COMPOSITE)
+ for (node= sce->nodetree->nodes.first; node; node= node->next) {
+ if (node->id==(ID *)curscene || node->type==CMP_NODE_COMPOSITE)
nodeUpdate(sce->nodetree, node);
- else if(node->type==CMP_NODE_TEXTURE) /* uses scene sizex/sizey */
+ else if (node->type==CMP_NODE_TEXTURE) /* uses scene sizex/sizey */
nodeUpdate(sce->nodetree, node);
}
}
@@ -856,31 +856,31 @@ int ntreeCompositTagAnimated(bNodeTree *ntree)
bNode *node;
int tagged= 0;
- if(ntree==NULL) return 0;
+ if (ntree==NULL) return 0;
- for(node= ntree->nodes.first; node; node= node->next) {
+ for (node= ntree->nodes.first; node; node= node->next) {
tagged = node_animation_properties(ntree, node);
/* otherwise always tag these node types */
- if(node->type==CMP_NODE_IMAGE) {
+ if (node->type==CMP_NODE_IMAGE) {
Image *ima= (Image *)node->id;
- if(ima && ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
+ if (ima && ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
nodeUpdate(ntree, node);
tagged= 1;
}
}
- else if(node->type==CMP_NODE_TIME) {
+ else if (node->type==CMP_NODE_TIME) {
nodeUpdate(ntree, node);
tagged= 1;
}
/* here was tag render layer, but this is called after a render, so re-composites fail */
- else if(node->type==NODE_GROUP) {
- if( ntreeCompositTagAnimated((bNodeTree *)node->id) ) {
+ else if (node->type==NODE_GROUP) {
+ if ( ntreeCompositTagAnimated((bNodeTree *)node->id) ) {
nodeUpdate(ntree, node);
}
}
- else if(ELEM(node->type, CMP_NODE_MOVIECLIP, CMP_NODE_TRANSFORM)) {
+ else if (ELEM(node->type, CMP_NODE_MOVIECLIP, CMP_NODE_TRANSFORM)) {
nodeUpdate(ntree, node);
tagged= 1;
}
@@ -895,10 +895,10 @@ void ntreeCompositTagGenerators(bNodeTree *ntree)
{
bNode *node;
- if(ntree==NULL) return;
+ if (ntree==NULL) return;
- for(node= ntree->nodes.first; node; node= node->next) {
- if( ELEM(node->type, CMP_NODE_R_LAYERS, CMP_NODE_IMAGE))
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if ( ELEM(node->type, CMP_NODE_R_LAYERS, CMP_NODE_IMAGE))
nodeUpdate(ntree, node);
}
}
@@ -908,11 +908,11 @@ void ntreeCompositClearTags(bNodeTree *ntree)
{
bNode *node;
- if(ntree==NULL) return;
+ if (ntree==NULL) return;
- for(node= ntree->nodes.first; node; node= node->next) {
+ for (node= ntree->nodes.first; node; node= node->next) {
node->need_exec= 0;
- if(node->type==NODE_GROUP)
+ if (node->type==NODE_GROUP)
ntreeCompositClearTags((bNodeTree *)node->id);
}
}
diff --git a/source/blender/nodes/composite/node_composite_util.c b/source/blender/nodes/composite/node_composite_util.c
index f51cd008904..ab3a363e703 100644
--- a/source/blender/nodes/composite/node_composite_util.c
+++ b/source/blender/nodes/composite/node_composite_util.c
@@ -42,21 +42,21 @@ CompBuf *alloc_compbuf(int sizex, int sizey, int type, int alloc)
cbuf->yrad= sizey/2;
cbuf->type= type;
- if(alloc) {
- if(cbuf->type==CB_RGBA)
+ if (alloc) {
+ if (cbuf->type==CB_RGBA)
cbuf->rect= MEM_mapallocN(4*sizeof(float)*sizex*sizey, "compbuf RGBA rect");
- else if(cbuf->type==CB_VEC3)
+ else if (cbuf->type==CB_VEC3)
cbuf->rect= MEM_mapallocN(3*sizeof(float)*sizex*sizey, "compbuf Vector3 rect");
- else if(cbuf->type==CB_VEC2)
+ else if (cbuf->type==CB_VEC2)
cbuf->rect= MEM_mapallocN(2*sizeof(float)*sizex*sizey, "compbuf Vector2 rect");
else
cbuf->rect= MEM_mapallocN(sizeof(float)*sizex*sizey, "compbuf Fac rect");
cbuf->malloc= 1;
}
- cbuf->disprect.xmin= 0;
- cbuf->disprect.ymin= 0;
- cbuf->disprect.xmax= sizex;
- cbuf->disprect.ymax= sizey;
+ cbuf->disprect.xmin = 0;
+ cbuf->disprect.ymin = 0;
+ cbuf->disprect.xmax = sizex;
+ cbuf->disprect.ymax = sizey;
return cbuf;
}
@@ -64,7 +64,7 @@ CompBuf *alloc_compbuf(int sizex, int sizey, int type, int alloc)
CompBuf *dupalloc_compbuf(CompBuf *cbuf)
{
CompBuf *dupbuf= alloc_compbuf(cbuf->x, cbuf->y, cbuf->type, 1);
- if(dupbuf) {
+ if (dupbuf) {
memcpy(dupbuf->rect, cbuf->rect, cbuf->type*sizeof(float)*cbuf->x*cbuf->y);
dupbuf->xof= cbuf->xof;
@@ -79,15 +79,15 @@ CompBuf *pass_on_compbuf(CompBuf *cbuf)
CompBuf *dupbuf= (cbuf)? alloc_compbuf(cbuf->x, cbuf->y, cbuf->type, 0): NULL;
CompBuf *lastbuf;
- if(dupbuf) {
+ if (dupbuf) {
dupbuf->rect= cbuf->rect;
dupbuf->xof= cbuf->xof;
dupbuf->yof= cbuf->yof;
dupbuf->malloc= 0;
/* get last buffer in list, and append dupbuf */
- for(lastbuf= cbuf; lastbuf; lastbuf= lastbuf->next)
- if(lastbuf->next==NULL)
+ for (lastbuf= cbuf; lastbuf; lastbuf= lastbuf->next)
+ if (lastbuf->next==NULL)
break;
lastbuf->next= dupbuf;
dupbuf->prev= lastbuf;
@@ -99,13 +99,13 @@ CompBuf *pass_on_compbuf(CompBuf *cbuf)
void free_compbuf(CompBuf *cbuf)
{
/* check referencing, then remove from list and set malloc tag */
- if(cbuf->prev || cbuf->next) {
- if(cbuf->prev)
+ if (cbuf->prev || cbuf->next) {
+ if (cbuf->prev)
cbuf->prev->next= cbuf->next;
- if(cbuf->next)
+ if (cbuf->next)
cbuf->next->prev= cbuf->prev;
- if(cbuf->malloc) {
- if(cbuf->prev)
+ if (cbuf->malloc) {
+ if (cbuf->prev)
cbuf->prev->malloc= 1;
else
cbuf->next->malloc= 1;
@@ -113,7 +113,7 @@ void free_compbuf(CompBuf *cbuf)
}
}
- if(cbuf->malloc && cbuf->rect)
+ if (cbuf->malloc && cbuf->rect)
MEM_freeN(cbuf->rect);
MEM_freeN(cbuf);
@@ -138,16 +138,16 @@ CompBuf *get_cropped_compbuf(rcti *drect, float *rectf, int rectx, int recty, in
float *outfp;
int dx, y;
- if(disprect.xmax>rectx) disprect.xmax= rectx;
- if(disprect.ymax>recty) disprect.ymax= recty;
- if(disprect.xmin>= disprect.xmax) return NULL;
- if(disprect.ymin>= disprect.ymax) return NULL;
+ if (disprect.xmax>rectx) disprect.xmax = rectx;
+ if (disprect.ymax>recty) disprect.ymax = recty;
+ if (disprect.xmin>= disprect.xmax) return NULL;
+ if (disprect.ymin>= disprect.ymax) return NULL;
cbuf= alloc_compbuf(disprect.xmax-disprect.xmin, disprect.ymax-disprect.ymin, type, 1);
outfp= cbuf->rect;
rectf += type*(disprect.ymin*rectx + disprect.xmin);
dx= type*cbuf->x;
- for(y=cbuf->y; y>0; y--, outfp+=dx, rectf+=type*rectx)
+ for (y=cbuf->y; y>0; y--, outfp+=dx, rectf+=type*rectx)
memcpy(outfp, rectf, sizeof(float)*dx);
return cbuf;
@@ -160,7 +160,7 @@ CompBuf *scalefast_compbuf(CompBuf *inbuf, int newx, int newy)
int x, y, c, pixsize= inbuf->type;
int ofsx, ofsy, stepx, stepy;
- if(inbuf->x==newx && inbuf->y==newy)
+ if (inbuf->x==newx && inbuf->y==newy)
return dupalloc_compbuf(inbuf);
outbuf= alloc_compbuf(newx, newy, inbuf->type, 1);
@@ -170,7 +170,7 @@ CompBuf *scalefast_compbuf(CompBuf *inbuf, int newx, int newy)
stepy = (65536.0 * (inbuf->y - 1.0) / (newy - 1.0)) + 0.5;
ofsy = 32768;
- for (y = newy; y > 0 ; y--){
+ for (y = newy; y > 0 ; y--) {
rectf = inbuf->rect;
rectf += pixsize * (ofsy >> 16) * inbuf->x;
@@ -180,7 +180,7 @@ CompBuf *scalefast_compbuf(CompBuf *inbuf, int newx, int newy)
for (x = newx ; x>0 ; x--) {
rf= rectf + pixsize*(ofsx >> 16);
- for(c=0; c<pixsize; c++)
+ for (c=0; c<pixsize; c++)
newrectf[c] = rf[c];
newrectf+= pixsize;
@@ -194,65 +194,65 @@ CompBuf *scalefast_compbuf(CompBuf *inbuf, int newx, int newy)
void typecheck_compbuf_color(float *out, float *in, int outtype, int intype)
{
- if(intype == outtype) {
+ if (intype == outtype) {
memcpy(out, in, sizeof(float)*outtype);
}
- else if(outtype==CB_VAL) {
- if(intype==CB_VEC2) {
+ else if (outtype==CB_VAL) {
+ if (intype==CB_VEC2) {
*out= 0.5f*(in[0]+in[1]);
}
- else if(intype==CB_VEC3) {
+ else if (intype==CB_VEC3) {
*out= 0.333333f*(in[0]+in[1]+in[2]);
}
- else if(intype==CB_RGBA) {
+ else if (intype==CB_RGBA) {
*out= in[0]*0.35f + in[1]*0.45f + in[2]*0.2f;
}
}
- else if(outtype==CB_VEC2) {
- if(intype==CB_VAL) {
+ else if (outtype==CB_VEC2) {
+ if (intype==CB_VAL) {
out[0]= in[0];
out[1]= in[0];
}
- else if(intype==CB_VEC3) {
+ else if (intype==CB_VEC3) {
out[0]= in[0];
out[1]= in[1];
}
- else if(intype==CB_RGBA) {
+ else if (intype==CB_RGBA) {
out[0]= in[0];
out[1]= in[1];
}
}
- else if(outtype==CB_VEC3) {
- if(intype==CB_VAL) {
+ else if (outtype==CB_VEC3) {
+ if (intype==CB_VAL) {
out[0]= in[0];
out[1]= in[0];
out[2]= in[0];
}
- else if(intype==CB_VEC2) {
+ else if (intype==CB_VEC2) {
out[0]= in[0];
out[1]= in[1];
out[2]= 0.0f;
}
- else if(intype==CB_RGBA) {
+ else if (intype==CB_RGBA) {
out[0]= in[0];
out[1]= in[1];
out[2]= in[2];
}
}
- else if(outtype==CB_RGBA) {
- if(intype==CB_VAL) {
+ else if (outtype==CB_RGBA) {
+ if (intype==CB_VAL) {
out[0]= in[0];
out[1]= in[0];
out[2]= in[0];
out[3]= 1.0f;
}
- else if(intype==CB_VEC2) {
+ else if (intype==CB_VEC2) {
out[0]= in[0];
out[1]= in[1];
out[2]= 0.0f;
out[3]= 1.0f;
}
- else if(intype==CB_VEC3) {
+ else if (intype==CB_VEC3) {
out[0]= in[0];
out[1]= in[1];
out[2]= in[2];
@@ -263,7 +263,7 @@ void typecheck_compbuf_color(float *out, float *in, int outtype, int intype)
CompBuf *typecheck_compbuf(CompBuf *inbuf, int type)
{
- if(inbuf && inbuf->type!=type) {
+ if (inbuf && inbuf->type!=type) {
CompBuf *outbuf;
float *inrf, *outrf;
int x;
@@ -274,7 +274,7 @@ CompBuf *typecheck_compbuf(CompBuf *inbuf, int type)
outbuf->xof= inbuf->xof;
outbuf->yof= inbuf->yof;
- if(inbuf->rect_procedural) {
+ if (inbuf->rect_procedural) {
outbuf->rect_procedural= inbuf->rect_procedural;
copy_v3_v3(outbuf->procedural_size, inbuf->procedural_size);
copy_v3_v3(outbuf->procedural_offset, inbuf->procedural_offset);
@@ -287,82 +287,82 @@ CompBuf *typecheck_compbuf(CompBuf *inbuf, int type)
outrf= outbuf->rect;
x= inbuf->x*inbuf->y;
- if(type==CB_VAL) {
- if(inbuf->type==CB_VEC2) {
- for(; x>0; x--, outrf+= 1, inrf+= 2)
+ if (type==CB_VAL) {
+ if (inbuf->type==CB_VEC2) {
+ for (; x>0; x--, outrf+= 1, inrf+= 2)
*outrf= 0.5f*(inrf[0]+inrf[1]);
}
- else if(inbuf->type==CB_VEC3) {
- for(; x>0; x--, outrf+= 1, inrf+= 3)
+ else if (inbuf->type==CB_VEC3) {
+ for (; x>0; x--, outrf+= 1, inrf+= 3)
*outrf= 0.333333f*(inrf[0]+inrf[1]+inrf[2]);
}
- else if(inbuf->type==CB_RGBA) {
- for(; x>0; x--, outrf+= 1, inrf+= 4)
+ else if (inbuf->type==CB_RGBA) {
+ for (; x>0; x--, outrf+= 1, inrf+= 4)
*outrf= inrf[0]*0.35f + inrf[1]*0.45f + inrf[2]*0.2f;
}
}
- else if(type==CB_VEC2) {
- if(inbuf->type==CB_VAL) {
- for(; x>0; x--, outrf+= 2, inrf+= 1) {
+ else if (type==CB_VEC2) {
+ if (inbuf->type==CB_VAL) {
+ for (; x>0; x--, outrf+= 2, inrf+= 1) {
outrf[0]= inrf[0];
outrf[1]= inrf[0];
}
}
- else if(inbuf->type==CB_VEC3) {
- for(; x>0; x--, outrf+= 2, inrf+= 3) {
+ else if (inbuf->type==CB_VEC3) {
+ for (; x>0; x--, outrf+= 2, inrf+= 3) {
outrf[0]= inrf[0];
outrf[1]= inrf[1];
}
}
- else if(inbuf->type==CB_RGBA) {
- for(; x>0; x--, outrf+= 2, inrf+= 4) {
+ else if (inbuf->type==CB_RGBA) {
+ for (; x>0; x--, outrf+= 2, inrf+= 4) {
outrf[0]= inrf[0];
outrf[1]= inrf[1];
}
}
}
- else if(type==CB_VEC3) {
- if(inbuf->type==CB_VAL) {
- for(; x>0; x--, outrf+= 3, inrf+= 1) {
+ else if (type==CB_VEC3) {
+ if (inbuf->type==CB_VAL) {
+ for (; x>0; x--, outrf+= 3, inrf+= 1) {
outrf[0]= inrf[0];
outrf[1]= inrf[0];
outrf[2]= inrf[0];
}
}
- else if(inbuf->type==CB_VEC2) {
- for(; x>0; x--, outrf+= 3, inrf+= 2) {
+ else if (inbuf->type==CB_VEC2) {
+ for (; x>0; x--, outrf+= 3, inrf+= 2) {
outrf[0]= inrf[0];
outrf[1]= inrf[1];
outrf[2]= 0.0f;
}
}
- else if(inbuf->type==CB_RGBA) {
- for(; x>0; x--, outrf+= 3, inrf+= 4) {
+ else if (inbuf->type==CB_RGBA) {
+ for (; x>0; x--, outrf+= 3, inrf+= 4) {
outrf[0]= inrf[0];
outrf[1]= inrf[1];
outrf[2]= inrf[2];
}
}
}
- else if(type==CB_RGBA) {
- if(inbuf->type==CB_VAL) {
- for(; x>0; x--, outrf+= 4, inrf+= 1) {
+ else if (type==CB_RGBA) {
+ if (inbuf->type==CB_VAL) {
+ for (; x>0; x--, outrf+= 4, inrf+= 1) {
outrf[0]= inrf[0];
outrf[1]= inrf[0];
outrf[2]= inrf[0];
outrf[3]= 1.0f;
}
}
- else if(inbuf->type==CB_VEC2) {
- for(; x>0; x--, outrf+= 4, inrf+= 2) {
+ else if (inbuf->type==CB_VEC2) {
+ for (; x>0; x--, outrf+= 4, inrf+= 2) {
outrf[0]= inrf[0];
outrf[1]= inrf[1];
outrf[2]= 0.0f;
outrf[3]= 1.0f;
}
}
- else if(inbuf->type==CB_VEC3) {
- for(; x>0; x--, outrf+= 4, inrf+= 3) {
+ else if (inbuf->type==CB_VEC3) {
+ for (; x>0; x--, outrf+= 4, inrf+= 3) {
outrf[0]= inrf[0];
outrf[1]= inrf[1];
outrf[2]= inrf[2];
@@ -378,8 +378,8 @@ CompBuf *typecheck_compbuf(CompBuf *inbuf, int type)
float *compbuf_get_pixel(CompBuf *cbuf, float *defcol, float *use, int x, int y, int xrad, int yrad)
{
- if(cbuf) {
- if(cbuf->rect_procedural) {
+ if (cbuf) {
+ if (cbuf->rect_procedural) {
cbuf->rect_procedural(cbuf, use, (float)x/(float)xrad, (float)y/(float)yrad);
return use;
}
@@ -390,8 +390,8 @@ float *compbuf_get_pixel(CompBuf *cbuf, float *defcol, float *use, int x, int y,
x-= cbuf->xof;
y-= cbuf->yof;
- if(y<-cbuf->yrad || y>= -cbuf->yrad+cbuf->y) return col;
- if(x<-cbuf->xrad || x>= -cbuf->xrad+cbuf->x) return col;
+ if (y<-cbuf->yrad || y>= -cbuf->yrad+cbuf->y) return col;
+ if (x<-cbuf->xrad || x>= -cbuf->xrad+cbuf->x) return col;
return cbuf->rect + cbuf->type*( (cbuf->yrad+y)*cbuf->x + (cbuf->xrad+x) );
}
@@ -407,7 +407,7 @@ static CompBuf *composit_check_compbuf(CompBuf *cbuf, int type, CompBuf *outbuf)
CompBuf *dbuf= typecheck_compbuf(cbuf, type);
/* if same as output and translated, duplicate so pixels don't interfere */
- if(dbuf == outbuf && !dbuf->rect_procedural && (dbuf->xof || dbuf->yof))
+ if (dbuf == outbuf && !dbuf->rect_procedural && (dbuf->xof || dbuf->yof))
dbuf= dupalloc_compbuf(dbuf);
return dbuf;
@@ -428,14 +428,14 @@ void composit1_pixel_processor(bNode *node, CompBuf *out, CompBuf *src_buf, floa
xrad= out->xrad;
yrad= out->yrad;
- for(y= -yrad; y<-yrad+out->y; y++) {
- for(x= -xrad; x<-xrad+out->x; x++, outfp+=out->type) {
+ for (y= -yrad; y<-yrad+out->y; y++) {
+ for (x= -xrad; x<-xrad+out->x; x++, outfp+=out->type) {
srcfp= compbuf_get_pixel(src_use, src_col, color, x, y, xrad, yrad);
func(node, outfp, srcfp);
}
}
- if(src_use!=src_buf)
+ if (src_use!=src_buf)
free_compbuf(src_use);
}
@@ -455,17 +455,17 @@ void composit2_pixel_processor(bNode *node, CompBuf *out, CompBuf *src_buf, floa
xrad= out->xrad;
yrad= out->yrad;
- for(y= -yrad; y<-yrad+out->y; y++) {
- for(x= -xrad; x<-xrad+out->x; x++, outfp+=out->type) {
+ for (y= -yrad; y<-yrad+out->y; y++) {
+ for (x= -xrad; x<-xrad+out->x; x++, outfp+=out->type) {
srcfp= compbuf_get_pixel(src_use, src_col, color, x, y, xrad, yrad);
facfp= compbuf_get_pixel(fac_use, fac, color, x, y, xrad, yrad);
func(node, outfp, srcfp, facfp);
}
}
- if(src_use!=src_buf)
+ if (src_use!=src_buf)
free_compbuf(src_use);
- if(fac_use!=fac_buf)
+ if (fac_use!=fac_buf)
free_compbuf(fac_use);
}
@@ -486,8 +486,8 @@ void composit3_pixel_processor(bNode *node, CompBuf *out, CompBuf *src1_buf, flo
xrad= out->xrad;
yrad= out->yrad;
- for(y= -yrad; y<-yrad+out->y; y++) {
- for(x= -xrad; x<-xrad+out->x; x++, outfp+=out->type) {
+ for (y= -yrad; y<-yrad+out->y; y++) {
+ for (x= -xrad; x<-xrad+out->x; x++, outfp+=out->type) {
src1fp= compbuf_get_pixel(src1_use, src1_col, color, x, y, xrad, yrad);
src2fp= compbuf_get_pixel(src2_use, src2_col, color, x, y, xrad, yrad);
facfp= compbuf_get_pixel(fac_use, fac, color, x, y, xrad, yrad);
@@ -496,11 +496,11 @@ void composit3_pixel_processor(bNode *node, CompBuf *out, CompBuf *src1_buf, flo
}
}
- if(src1_use!=src1_buf)
+ if (src1_use!=src1_buf)
free_compbuf(src1_use);
- if(src2_use!=src2_buf)
+ if (src2_use!=src2_buf)
free_compbuf(src2_use);
- if(fac_use!=fac_buf)
+ if (fac_use!=fac_buf)
free_compbuf(fac_use);
}
@@ -523,8 +523,8 @@ void composit4_pixel_processor(bNode *node, CompBuf *out, CompBuf *src1_buf, flo
xrad= out->xrad;
yrad= out->yrad;
- for(y= -yrad; y<-yrad+out->y; y++) {
- for(x= -xrad; x<-xrad+out->x; x++, outfp+=out->type) {
+ for (y= -yrad; y<-yrad+out->y; y++) {
+ for (x= -xrad; x<-xrad+out->x; x++, outfp+=out->type) {
src1fp= compbuf_get_pixel(src1_use, src1_col, color, x, y, xrad, yrad);
src2fp= compbuf_get_pixel(src2_use, src2_col, color, x, y, xrad, yrad);
fac1fp= compbuf_get_pixel(fac1_use, fac1, color, x, y, xrad, yrad);
@@ -534,13 +534,13 @@ void composit4_pixel_processor(bNode *node, CompBuf *out, CompBuf *src1_buf, flo
}
}
- if(src1_use!=src1_buf)
+ if (src1_use!=src1_buf)
free_compbuf(src1_use);
- if(src2_use!=src2_buf)
+ if (src2_use!=src2_buf)
free_compbuf(src2_use);
- if(fac1_use!=fac1_buf)
+ if (fac1_use!=fac1_buf)
free_compbuf(fac1_use);
- if(fac2_use!=fac2_buf)
+ if (fac2_use!=fac2_buf)
free_compbuf(fac2_use);
}
@@ -562,7 +562,7 @@ CompBuf *valbuf_from_rgbabuf(CompBuf *cbuf, int channel)
rectf= cbuf->rect + channel;
- for(tot= cbuf->x*cbuf->y; tot>0; tot--, valf++, rectf+=4)
+ for (tot= cbuf->x*cbuf->y; tot>0; tot--, valf++, rectf+=4)
*valf= *rectf;
return valbuf;
@@ -580,8 +580,8 @@ static CompBuf *generate_procedural_preview(CompBuf *cbuf, int newx, int newy)
xrad= outbuf->xrad;
yrad= outbuf->yrad;
- for(y= -yrad; y<-yrad+outbuf->y; y++)
- for(x= -xrad; x<-xrad+outbuf->x; x++, outfp+=outbuf->type)
+ for (y= -yrad; y<-yrad+outbuf->y; y++)
+ for (x= -xrad; x<-xrad+outbuf->x; x++, outfp+=outbuf->type)
cbuf->rect_procedural(cbuf, outfp, (float)x/(float)xrad, (float)y/(float)yrad);
return outbuf;
@@ -597,14 +597,14 @@ void generate_preview(void *data, bNode *node, CompBuf *stackbuf)
int dither= 0;
unsigned char *rect;
- if(preview && stackbuf) {
+ if (preview && stackbuf) {
CompBuf *cbuf, *stackbuf_use;
- if(stackbuf->rect==NULL && stackbuf->rect_procedural==NULL) return;
+ if (stackbuf->rect==NULL && stackbuf->rect_procedural==NULL) return;
stackbuf_use= typecheck_compbuf(stackbuf, CB_RGBA);
- if(stackbuf->x > stackbuf->y) {
+ if (stackbuf->x > stackbuf->y) {
xsize= 140;
ysize= (140*stackbuf->y)/stackbuf->x;
}
@@ -613,7 +613,7 @@ void generate_preview(void *data, bNode *node, CompBuf *stackbuf)
xsize= (140*stackbuf->x)/stackbuf->y;
}
- if(stackbuf_use->rect_procedural)
+ if (stackbuf_use->rect_procedural)
cbuf= generate_procedural_preview(stackbuf_use, xsize, ysize);
else
cbuf= scalefast_compbuf(stackbuf_use, xsize, ysize);
@@ -626,12 +626,12 @@ void generate_preview(void *data, bNode *node, CompBuf *stackbuf)
xsize, ysize, xsize, xsize);
free_compbuf(cbuf);
- if(stackbuf_use!=stackbuf)
+ if (stackbuf_use!=stackbuf)
free_compbuf(stackbuf_use);
BLI_lock_thread(LOCK_PREVIEW);
- if(preview->rect)
+ if (preview->rect)
MEM_freeN(preview->rect);
preview->xsize= xsize;
preview->ysize= ysize;
@@ -705,21 +705,21 @@ void gamma_correct_compbuf(CompBuf *img, int inversed)
float *drect;
int x;
- if(img->type!=CB_RGBA) return;
+ if (img->type!=CB_RGBA) return;
drect= img->rect;
- if(inversed) {
- for(x=img->x*img->y; x>0; x--, drect+=4) {
- if(drect[0]>0.0f) drect[0]= sqrt(drect[0]); else drect[0]= 0.0f;
- if(drect[1]>0.0f) drect[1]= sqrt(drect[1]); else drect[1]= 0.0f;
- if(drect[2]>0.0f) drect[2]= sqrt(drect[2]); else drect[2]= 0.0f;
+ if (inversed) {
+ for (x=img->x*img->y; x>0; x--, drect+=4) {
+ if (drect[0]>0.0f) drect[0]= sqrt(drect[0]); else drect[0]= 0.0f;
+ if (drect[1]>0.0f) drect[1]= sqrt(drect[1]); else drect[1]= 0.0f;
+ if (drect[2]>0.0f) drect[2]= sqrt(drect[2]); else drect[2]= 0.0f;
}
}
else {
- for(x=img->x*img->y; x>0; x--, drect+=4) {
- if(drect[0]>0.0f) drect[0]*= drect[0]; else drect[0]= 0.0f;
- if(drect[1]>0.0f) drect[1]*= drect[1]; else drect[1]= 0.0f;
- if(drect[2]>0.0f) drect[2]*= drect[2]; else drect[2]= 0.0f;
+ for (x=img->x*img->y; x>0; x--, drect+=4) {
+ if (drect[0]>0.0f) drect[0]*= drect[0]; else drect[0]= 0.0f;
+ if (drect[1]>0.0f) drect[1]*= drect[1]; else drect[1]= 0.0f;
+ if (drect[2]>0.0f) drect[2]*= drect[2]; else drect[2]= 0.0f;
}
}
}
@@ -729,12 +729,12 @@ void premul_compbuf(CompBuf *img, int inversed)
float *drect;
int x;
- if(img->type!=CB_RGBA) return;
+ if (img->type!=CB_RGBA) return;
drect= img->rect;
- if(inversed) {
- for(x=img->x*img->y; x>0; x--, drect+=4) {
- if(fabsf(drect[3]) < 1e-5f) {
+ if (inversed) {
+ for (x=img->x*img->y; x>0; x--, drect+=4) {
+ if (fabsf(drect[3]) < 1e-5f) {
drect[0]= 0.0f;
drect[1]= 0.0f;
drect[2]= 0.0f;
@@ -747,7 +747,7 @@ void premul_compbuf(CompBuf *img, int inversed)
}
}
else {
- for(x=img->x*img->y; x>0; x--, drect+=4) {
+ for (x=img->x*img->y; x>0; x--, drect+=4) {
drect[0] *= drect[3];
drect[1] *= drect[3];
drect[2] *= drect[3];
@@ -881,12 +881,12 @@ static void FHT2D(fREAL *data, unsigned int Mx, unsigned int My,
else { // rectangular
unsigned int k, Nym = Ny-1, stm = 1 << (Mx + My);
for (i=0; stm>0; i++) {
- #define pred(k) (((k & Nym) << Mx) + (k >> My))
- for (j=pred(i); j>i; j=pred(j));
+ #define PRED(k) (((k & Nym) << Mx) + (k >> My))
+ for (j=PRED(i); j>i; j=PRED(j));
if (j < i) continue;
- for (k=i, j=pred(i); j!=i; k=j, j=pred(j), stm--)
+ for (k=i, j=PRED(i); j!=i; k=j, j=PRED(j), stm--)
{ t=data[j], data[j]=data[k], data[k]=t; }
- #undef pred
+ #undef PRED
stm--;
}
}
@@ -1104,11 +1104,11 @@ void convolve(CompBuf* dst, CompBuf* in1, CompBuf* in2)
// sets fcol to pixelcolor at (x, y)
void qd_getPixel(CompBuf* src, int x, int y, float* col)
{
- if(src->rect_procedural) {
+ if (src->rect_procedural) {
float bc[4];
src->rect_procedural(src, bc, (float)x/(float)src->xrad, (float)y/(float)src->yrad);
- switch(src->type){
+ switch(src->type) {
/* these fallthrough to get all the channels */
case CB_RGBA: col[3]=bc[3];
case CB_VEC3: col[2]=bc[2];
@@ -1118,7 +1118,7 @@ void qd_getPixel(CompBuf* src, int x, int y, float* col)
}
else if ((x >= 0) && (x < src->x) && (y >= 0) && (y < src->y)) {
float* bc = &src->rect[(x + y*src->x)*src->type];
- switch(src->type){
+ switch(src->type) {
/* these fallthrough to get all the channels */
case CB_RGBA: col[3]=bc[3];
case CB_VEC3: col[2]=bc[2];
@@ -1127,7 +1127,7 @@ void qd_getPixel(CompBuf* src, int x, int y, float* col)
}
}
else {
- switch(src->type){
+ switch(src->type) {
/* these fallthrough to get all the channels */
case CB_RGBA: col[3]=0.0;
case CB_VEC3: col[2]=0.0;
@@ -1142,7 +1142,7 @@ void qd_setPixel(CompBuf* src, int x, int y, float* col)
{
if ((x >= 0) && (x < src->x) && (y >= 0) && (y < src->y)) {
float* bc = &src->rect[(x + y*src->x)*src->type];
- switch(src->type){
+ switch(src->type) {
/* these fallthrough to get all the channels */
case CB_RGBA: bc[3]=col[3];
case CB_VEC3: bc[2]=col[2];
diff --git a/source/blender/nodes/composite/nodes/node_composite_alphaOver.c b/source/blender/nodes/composite/nodes/node_composite_alphaOver.c
index 3a783f0f32d..5a716e18660 100644
--- a/source/blender/nodes/composite/nodes/node_composite_alphaOver.c
+++ b/source/blender/nodes/composite/nodes/node_composite_alphaOver.c
@@ -48,10 +48,10 @@ static void do_alphaover_premul(bNode *UNUSED(node), float *out, float *src, flo
{
/* Zero alpha values should still permit an add of RGB data */
- if(over[3]<0.0f) {
+ if (over[3]<0.0f) {
copy_v4_v4(out, src);
}
- else if(fac[0]==1.0f && over[3]>=1.0f) {
+ else if (fac[0]==1.0f && over[3]>=1.0f) {
copy_v4_v4(out, over);
}
else {
@@ -68,10 +68,10 @@ static void do_alphaover_premul(bNode *UNUSED(node), float *out, float *src, flo
static void do_alphaover_key(bNode *UNUSED(node), float *out, float *src, float *over, float *fac)
{
- if(over[3]<=0.0f) {
+ if (over[3]<=0.0f) {
copy_v4_v4(out, src);
}
- else if(fac[0]==1.0f && over[3]>=1.0f) {
+ else if (fac[0]==1.0f && over[3]>=1.0f) {
copy_v4_v4(out, over);
}
else {
@@ -89,10 +89,10 @@ static void do_alphaover_key(bNode *UNUSED(node), float *out, float *src, float
static void do_alphaover_mixed(bNode *node, float *out, float *src, float *over, float *fac)
{
- if(over[3]<=0.0f) {
+ if (over[3]<=0.0f) {
copy_v4_v4(out, src);
}
- else if(fac[0]==1.0f && over[3]>=1.0f) {
+ else if (fac[0]==1.0f && over[3]>=1.0f) {
copy_v4_v4(out, over);
}
else {
@@ -115,11 +115,11 @@ static void node_composit_exec_alphaover(void *UNUSED(data), bNode *node, bNodeS
{
/* stack order in: col col */
/* stack order out: col */
- if(out[0]->hasoutput==0)
+ if (out[0]->hasoutput==0)
return;
/* input no image? then only color operation */
- if(in[1]->data==NULL && in[2]->data==NULL) {
+ if (in[1]->data==NULL && in[2]->data==NULL) {
do_alphaover_premul(node, out[0]->vec, in[1]->vec, in[2]->vec, in[0]->vec);
}
else {
@@ -128,9 +128,9 @@ static void node_composit_exec_alphaover(void *UNUSED(data), bNode *node, bNodeS
CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
NodeTwoFloats *ntf= node->storage;
- if(ntf->x != 0.0f)
+ if (ntf->x != 0.0f)
composit3_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, in[0]->data, in[0]->vec, do_alphaover_mixed, CB_RGBA, CB_RGBA, CB_VAL);
- else if(node->custom1)
+ else if (node->custom1)
composit3_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, in[0]->data, in[0]->vec, do_alphaover_key, CB_RGBA, CB_RGBA, CB_VAL);
else
composit3_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, in[0]->data, in[0]->vec, do_alphaover_premul, CB_RGBA, CB_RGBA, CB_VAL);
diff --git a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
index c6462e2870c..f42fd83c13d 100644
--- a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
+++ b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
@@ -48,7 +48,8 @@ static bNodeSocketTemplate cmp_node_bilateralblur_out[]= {
mean1[0] = src[0]; \
mean1[1] = src[1]; \
mean1[2] = src[2]; \
- mean1[3] = src[3];
+ mean1[3] = src[3]; \
+ (void)0
/* finds color distances */
#define COLOR_DISTANCE_C3(c1, c2) \
@@ -66,25 +67,28 @@ static bNodeSocketTemplate cmp_node_bilateralblur_out[]= {
(double)COLOR_DISTANCE_C3(ref, ref_color ) * i2sigma_color; \
w = 1.0/(w*w + 1); \
mean0 += w; \
- mean1[0] += (double)temp_color[0]*w; \
- mean1[1] += (double)temp_color[1]*w; \
- mean1[2] += (double)temp_color[2]*w; \
- mean1[3] += (double)temp_color[3]*w;
+ mean1[0] += (double)temp_color[0] * w; \
+ mean1[1] += (double)temp_color[1] * w; \
+ mean1[2] += (double)temp_color[2] * w; \
+ mean1[3] += (double)temp_color[3] * w; \
+ (void)0
/* write blurred values to image */
#define UPDATE_OUTPUT_C3 \
mean0 = 1.0/mean0; \
- dest[x*pix + 0] = mean1[0]*mean0; \
- dest[x*pix + 1] = mean1[1]*mean0; \
- dest[x*pix + 2] = mean1[2]*mean0; \
- dest[x*pix + 3] = mean1[3]*mean0;
+ dest[x * pix + 0] = mean1[0] * mean0; \
+ dest[x * pix + 1] = mean1[1] * mean0; \
+ dest[x * pix + 2] = mean1[2] * mean0; \
+ dest[x * pix + 3] = mean1[3] * mean0; \
+ (void)0
-/* initializes deltas for fast access to neighbour pixels */
+/* initializes deltas for fast access to neighbor pixels */
#define INIT_3X3_DELTAS( deltas, step, nch ) \
((deltas)[0] = (nch), (deltas)[1] = -(step) + (nch), \
(deltas)[2] = -(step), (deltas)[3] = -(step) - (nch), \
(deltas)[4] = -(nch), (deltas)[5] = (step) - (nch), \
- (deltas)[6] = (step), (deltas)[7] = (step) + (nch));
+ (deltas)[6] = (step), (deltas)[7] = (step) + (nch)); \
+ (void)0
/* code of this node was heavily inspired by the smooth function of opencv library.
@@ -102,10 +106,10 @@ static void node_composit_exec_bilateralblur(void *UNUSED(data), bNode *node, bN
int deltas[8];
short found_determinator= 0;
- if(img == NULL || out[0]->hasoutput == 0)
+ if (img == NULL || out[0]->hasoutput == 0)
return;
- if(img->type != CB_RGBA) {
+ if (img->type != CB_RGBA) {
img= typecheck_compbuf(in[0]->data, CB_RGBA);
}
@@ -114,9 +118,9 @@ static void node_composit_exec_bilateralblur(void *UNUSED(data), bNode *node, bN
pix= img->type;
step= pix * imgx;
- if(refimg) {
- if(refimg->x == imgx && refimg->y == imgy) {
- if(ELEM3(refimg->type, CB_VAL, CB_VEC2, CB_VEC3)) {
+ if (refimg) {
+ if (refimg->x == imgx && refimg->y == imgy) {
+ if (ELEM3(refimg->type, CB_VAL, CB_VEC2, CB_VEC3)) {
refimg= typecheck_compbuf(in[1]->data, CB_RGBA);
found_determinator= 1;
}
@@ -147,23 +151,23 @@ static void node_composit_exec_bilateralblur(void *UNUSED(data), bNode *node, bN
weight_tab[1] = weight_tab[3] = weight_tab[5] = weight_tab[7] = i2sigma_space * 2;
/* iterations */
- for(i= 0; i < nbbd->iter; i++) {
+ for (i= 0; i < nbbd->iter; i++) {
src= source->rect;
ref= refimg->rect;
dest= new->rect;
/*goes through image, there are more loops for 1st/last line and all other lines*/
/*kernel element accumulates surrounding colors, which are then written with the update_output function*/
- for(x= 0; x < imgx; x++, src+= pix, ref+= pix) {
+ for (x= 0; x < imgx; x++, src+= pix, ref+= pix) {
INIT_C3;
KERNEL_ELEMENT_C3(6);
- if(x > 0) {
+ if (x > 0) {
KERNEL_ELEMENT_C3(5);
KERNEL_ELEMENT_C3(4);
}
- if(x < imgx - 1) {
+ if (x < imgx - 1) {
KERNEL_ELEMENT_C3(7);
KERNEL_ELEMENT_C3(0);
}
@@ -173,7 +177,7 @@ static void node_composit_exec_bilateralblur(void *UNUSED(data), bNode *node, bN
dest+= step;
- for(y= 1; y < imgy - 1; y++, dest+= step, src+= pix, ref+= pix) {
+ for (y= 1; y < imgy - 1; y++, dest+= step, src+= pix, ref+= pix) {
x= 0;
INIT_C3;
@@ -189,7 +193,7 @@ static void node_composit_exec_bilateralblur(void *UNUSED(data), bNode *node, bN
src+= pix;
ref+= pix;
- for(x= 1; x < imgx - 1; x++, src+= pix, ref+= pix) {
+ for (x= 1; x < imgx - 1; x++, src+= pix, ref+= pix) {
INIT_C3;
KERNEL_ELEMENT_C3(0);
@@ -215,16 +219,16 @@ static void node_composit_exec_bilateralblur(void *UNUSED(data), bNode *node, bN
UPDATE_OUTPUT_C3;
}
- for(x= 0; x < imgx; x++, src+= pix, ref+= pix) {
+ for (x= 0; x < imgx; x++, src+= pix, ref+= pix) {
INIT_C3;
KERNEL_ELEMENT_C3(2);
- if(x > 0) {
+ if (x > 0) {
KERNEL_ELEMENT_C3(3);
KERNEL_ELEMENT_C3(4);
}
- if(x < imgx - 1) {
+ if (x < imgx - 1) {
KERNEL_ELEMENT_C3(1);
KERNEL_ELEMENT_C3(0);
}
@@ -232,16 +236,16 @@ static void node_composit_exec_bilateralblur(void *UNUSED(data), bNode *node, bN
UPDATE_OUTPUT_C3;
}
- if(node->exec & NODE_BREAK) break;
+ if (node->exec & NODE_BREAK) break;
SWAP(CompBuf, *source, *new);
}
- if(img != in[0]->data)
+ if (img != in[0]->data)
free_compbuf(img);
- if(found_determinator == 1) {
- if(refimg != in[1]->data)
+ if (found_determinator == 1) {
+ if (refimg != in[1]->data)
free_compbuf(refimg);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_blur.c b/source/blender/nodes/composite/nodes/node_composite_blur.c
index fad80723ca3..354bb458ea9 100644
--- a/source/blender/nodes/composite/nodes/node_composite_blur.c
+++ b/source/blender/nodes/composite/nodes/node_composite_blur.c
@@ -61,7 +61,7 @@ static float *make_gausstab(int filtertype, int rad)
}
sum= 1.0f/sum;
- for(i=0; i<n; i++)
+ for (i=0; i<n; i++)
gausstab[i]*= sum;
return gausstab;
@@ -101,14 +101,14 @@ static void blur_single_image(bNode *node, CompBuf *new, CompBuf *img, float sca
work= alloc_compbuf(imgx, imgy, img->type, 1); /* allocs */
/* horizontal */
- if(nbd->sizex == 0) {
+ if (nbd->sizex == 0) {
memcpy(work->rect, img->rect, sizeof(float) * img->type * imgx * imgy);
}
else {
rad = scale*(float)nbd->sizex;
- if(rad>imgx/2)
+ if (rad>imgx/2)
rad= imgx/2;
- else if(rad<1)
+ else if (rad<1)
rad= 1;
gausstab= make_gausstab(nbd->filtertype, rad);
@@ -130,7 +130,7 @@ static void blur_single_image(bNode *node, CompBuf *new, CompBuf *img, float sca
val= gausstabcent[i];
sum+= val;
rval += val * (*src++);
- if(pix==4) {
+ if (pix==4) {
gval += val * (*src++);
bval += val * (*src++);
aval += val * (*src++);
@@ -138,13 +138,13 @@ static void blur_single_image(bNode *node, CompBuf *new, CompBuf *img, float sca
}
sum= 1.0f/sum;
*dest++ = rval*sum;
- if(pix==4) {
+ if (pix==4) {
*dest++ = gval*sum;
*dest++ = bval*sum;
*dest++ = aval*sum;
}
}
- if(node->exec & NODE_BREAK)
+ if (node->exec & NODE_BREAK)
break;
}
@@ -152,14 +152,14 @@ static void blur_single_image(bNode *node, CompBuf *new, CompBuf *img, float sca
MEM_freeN(gausstab);
}
- if(nbd->sizey == 0) {
+ if (nbd->sizey == 0) {
memcpy(new->rect, work->rect, sizeof(float) * img->type * imgx * imgy);
}
else {
rad = scale*(float)nbd->sizey;
- if(rad>imgy/2)
+ if (rad>imgy/2)
rad= imgy/2;
- else if(rad<1)
+ else if (rad<1)
rad= 1;
gausstab= make_gausstab(nbd->filtertype, rad);
@@ -182,7 +182,7 @@ static void blur_single_image(bNode *node, CompBuf *new, CompBuf *img, float sca
val= gausstabcent[i];
sum+= val;
rval += val * src[0];
- if(pix==4) {
+ if (pix==4) {
gval += val * src[1];
bval += val * src[2];
aval += val * src[3];
@@ -191,14 +191,14 @@ static void blur_single_image(bNode *node, CompBuf *new, CompBuf *img, float sca
}
sum= 1.0f/sum;
dest[0] = rval*sum;
- if(pix==4) {
+ if (pix==4) {
dest[1] = gval*sum;
dest[2] = bval*sum;
dest[3] = aval*sum;
}
dest+= bigstep;
}
- if(node->exec & NODE_BREAK)
+ if (node->exec & NODE_BREAK)
break;
}
MEM_freeN(gausstab);
@@ -225,21 +225,21 @@ static void bloom_with_reference(CompBuf *new, CompBuf *img, CompBuf *UNUSED(ref
/* horizontal */
radx = (float)nbd->sizex;
- if(radx>imgx/2)
+ if (radx>imgx/2)
radx= imgx/2;
- else if(radx<1)
+ else if (radx<1)
radx= 1;
/* vertical */
rady = (float)nbd->sizey;
- if(rady>imgy/2)
+ if (rady>imgy/2)
rady= imgy/2;
- else if(rady<1)
+ else if (rady<1)
rady= 1;
x= MAX2(radx, rady);
maintabs= MEM_mallocN(x*sizeof(void *), "gauss array");
- for(i= 0; i<x; i++)
+ for (i= 0; i<x; i++)
maintabs[i]= make_bloomtab(i+1);
/* vars to store before we go */
@@ -258,12 +258,12 @@ static void bloom_with_reference(CompBuf *new, CompBuf *img, CompBuf *UNUSED(ref
int refradx= (int)(radxf*0.3f*src[3]*(src[0]+src[1]+src[2]));
int refrady= (int)(radyf*0.3f*src[3]*(src[0]+src[1]+src[2]));
- if(refradx>radx) refradx= radx;
- else if(refradx<1) refradx= 1;
- if(refrady>rady) refrady= rady;
- else if(refrady<1) refrady= 1;
+ if (refradx>radx) refradx= radx;
+ else if (refradx<1) refradx= 1;
+ if (refrady>rady) refrady= rady;
+ else if (refrady<1) refrady= 1;
- if(refradx==1 && refrady==1) {
+ if (refradx==1 && refrady==1) {
wb= wbuf->rect + ( y*imgx + x);
dest= new->rect + 4*( y*imgx + x);
wb[0]+= 1.0f;
@@ -306,7 +306,7 @@ static void bloom_with_reference(CompBuf *new, CompBuf *img, CompBuf *UNUSED(ref
x= imgx*imgy;
dest= new->rect;
wb= wbuf->rect;
- while(x--) {
+ while (x--) {
val= 1.0f/wb[0];
dest[0]*= val;
dest[1]*= val;
@@ -319,7 +319,7 @@ static void bloom_with_reference(CompBuf *new, CompBuf *img, CompBuf *UNUSED(ref
free_compbuf(wbuf);
x= MAX2(radx, rady);
- for(i= 0; i<x; i++)
+ for (i= 0; i<x; i++)
MEM_freeN(maintabs[i]);
MEM_freeN(maintabs);
@@ -331,9 +331,9 @@ static float hexagon_filter(float fi, float fj)
fi= fabs(fi);
fj= fabs(fj);
- if(fj>0.33f) {
+ if (fj>0.33f) {
fj= (fj-0.33f)/0.66f;
- if(fi+fj>1.0f)
+ if (fi+fj>1.0f)
return 0.0f;
else
return 1.0f;
@@ -357,16 +357,16 @@ static void bokeh_single_image(bNode *node, CompBuf *new, CompBuf *img, float fa
/* horizontal */
radxf = fac*(float)nbd->sizex;
- if(radxf>imgx/2.0f)
+ if (radxf>imgx/2.0f)
radxf= imgx/2.0f;
- else if(radxf<1.0f)
+ else if (radxf<1.0f)
radxf= 1.0f;
/* vertical */
radyf = fac*(float)nbd->sizey;
- if(radyf>imgy/2.0f)
+ if (radyf>imgy/2.0f)
radyf= imgy/2.0f;
- else if(radyf<1.0f)
+ else if (radyf<1.0f)
radyf= 1.0f;
radx= ceil(radxf);
@@ -378,8 +378,8 @@ static void bokeh_single_image(bNode *node, CompBuf *new, CompBuf *img, float fa
gausstab= MEM_mallocN(sizeof(float)*n, "filter tab");
dgauss= gausstab;
val= 0.0f;
- for(j=-rady; j<=rady; j++) {
- for(i=-radx; i<=radx; i++, dgauss++) {
+ for (j=-rady; j<=rady; j++) {
+ for (i=-radx; i<=radx; i++, dgauss++) {
float fj= (float)j/radyf;
float fi= (float)i/radxf;
float dist= sqrt(fj*fj + fi*fi);
@@ -391,17 +391,17 @@ static void bokeh_single_image(bNode *node, CompBuf *new, CompBuf *img, float fa
}
}
- if(val!=0.0f) {
+ if (val!=0.0f) {
val= 1.0f/val;
- for(j= n -1; j>=0; j--)
+ for (j= n -1; j>=0; j--)
gausstab[j]*= val;
}
else gausstab[4]= 1.0f;
for (y = -rady+1; y < imgy+rady-1; y++) {
- if(y<=0) srcd= img->rect;
- else if(y<imgy) srcd+= pix*imgx;
+ if (y<=0) srcd= img->rect;
+ else if (y<imgy) srcd+= pix*imgx;
else srcd= img->rect + pix*(imgy-1)*imgx;
for (x = -radx+1; x < imgx+radx-1 ; x++) {
@@ -413,8 +413,8 @@ static void bokeh_single_image(bNode *node, CompBuf *new, CompBuf *img, float fa
float *destd= new->rect + pix*( (y + minyr)*imgx + x + minxr);
float *dgausd= gausstab + (minyr+rady)*(2*radx+1) + minxr+radx;
- if(x<=0) src= srcd;
- else if(x<imgx) src+= pix;
+ if (x<=0) src= srcd;
+ else if (x<imgx) src+= pix;
else src= srcd + pix*(imgx-1);
for (i= minyr; i <=maxyr; i++, destd+= pix*imgx, dgausd+= 2*radx + 1) {
@@ -422,9 +422,9 @@ static void bokeh_single_image(bNode *node, CompBuf *new, CompBuf *img, float fa
dgauss= dgausd;
for (j= minxr; j <=maxxr; j++, dest+=pix, dgauss++) {
val= *dgauss;
- if(val!=0.0f) {
+ if (val!=0.0f) {
dest[0] += val * src[0];
- if(pix>1) {
+ if (pix>1) {
dest[1] += val * src[1];
dest[2] += val * src[2];
dest[3] += val * src[3];
@@ -433,7 +433,7 @@ static void bokeh_single_image(bNode *node, CompBuf *new, CompBuf *img, float fa
}
}
}
- if(node->exec & NODE_BREAK)
+ if (node->exec & NODE_BREAK)
break;
}
@@ -459,7 +459,7 @@ static void blur_with_reference(bNode *node, CompBuf *new, CompBuf *img, CompBuf
float proccol[4]; /* local color if compbuf is procedural */
int refradx, refrady;
- if(ref->x!=img->x || ref->y!=img->y)
+ if (ref->x!=img->x || ref->y!=img->y)
return;
ref_use= typecheck_compbuf(ref, CB_VAL);
@@ -470,9 +470,9 @@ static void blur_with_reference(bNode *node, CompBuf *new, CompBuf *img, CompBuf
blurbuf->yof= ref_use->yof;
blurd= blurbuf->rect;
refd= ref_use->rect;
- for(x= imgx*imgy; x>0; x--, refd++, blurd++) {
- if(refd[0]<0.0f) blurd[0]= 0.0f;
- else if(refd[0]>1.0f) blurd[0]= 1.0f;
+ for (x= imgx*imgy; x>0; x--, refd++, blurd++) {
+ if (refd[0]<0.0f) blurd[0]= 0.0f;
+ else if (refd[0]>1.0f) blurd[0]= 1.0f;
else blurd[0]= refd[0];
}
@@ -480,21 +480,21 @@ static void blur_with_reference(bNode *node, CompBuf *new, CompBuf *img, CompBuf
/* horizontal */
radx = (float)nbd->sizex;
- if(radx>imgx/2)
+ if (radx>imgx/2)
radx= imgx/2;
- else if(radx<1)
+ else if (radx<1)
radx= 1;
/* vertical */
rady = (float)nbd->sizey;
- if(rady>imgy/2)
+ if (rady>imgy/2)
rady= imgy/2;
- else if(rady<1)
+ else if (rady<1)
rady= 1;
x= MAX2(radx, rady);
maintabs= MEM_mallocN(x*sizeof(void *), "gauss array");
- for(i= 0; i<x; i++)
+ for (i= 0; i<x; i++)
maintabs[i]= make_gausstab(nbd->filtertype, i+1);
dest= new->rect;
@@ -507,14 +507,14 @@ static void blur_with_reference(bNode *node, CompBuf *new, CompBuf *img, CompBuf
refradx= (int)(refd[0]*radxf);
refrady= (int)(refd[0]*radyf);
- if(refradx>radx) refradx= radx;
- else if(refradx<1) refradx= 1;
- if(refrady>rady) refrady= rady;
- else if(refrady<1) refrady= 1;
+ if (refradx>radx) refradx= radx;
+ else if (refradx<1) refradx= 1;
+ if (refrady>rady) refrady= rady;
+ else if (refrady<1) refrady= 1;
- if(refradx==1 && refrady==1) {
+ if (refradx==1 && refrady==1) {
src= img->rect + pix*( y*imgx + x);
- if(pix==1)
+ if (pix==1)
dest[0]= src[0];
else
copy_v4_v4(dest, src);
@@ -541,7 +541,7 @@ static void blur_with_reference(bNode *node, CompBuf *new, CompBuf *img, CompBuf
val= gausstabcenty[i]*gausstabcentx[j];
sum+= val;
rval += val * src[0];
- if(pix>1) {
+ if (pix>1) {
gval += val * src[1];
bval += val * src[2];
aval += val * src[3];
@@ -550,25 +550,25 @@ static void blur_with_reference(bNode *node, CompBuf *new, CompBuf *img, CompBuf
}
sum= 1.0f/sum;
dest[0] = rval*sum;
- if(pix>1) {
+ if (pix>1) {
dest[1] = gval*sum;
dest[2] = bval*sum;
dest[3] = aval*sum;
}
}
}
- if(node->exec & NODE_BREAK)
+ if (node->exec & NODE_BREAK)
break;
}
free_compbuf(blurbuf);
x= MAX2(radx, rady);
- for(i= 0; i<x; i++)
+ for (i= 0; i<x; i++)
MEM_freeN(maintabs[i]);
MEM_freeN(maintabs);
- if(ref_use!=ref)
+ if (ref_use!=ref)
free_compbuf(ref_use);
}
@@ -577,15 +577,15 @@ static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bN
CompBuf *new, *img= in[0]->data;
NodeBlurData *nbd= node->storage;
- if(img==NULL) return;
+ if (img==NULL) return;
/* store image in size that is needed for absolute/relative conversions on ui level */
nbd->image_in_width= img->x;
nbd->image_in_height= img->y;
- if(out[0]->hasoutput==0) return;
+ if (out[0]->hasoutput==0) return;
- if(nbd->relative) {
+ if (nbd->relative) {
if (nbd->aspect==CMP_NODE_BLUR_ASPECT_NONE) {
nbd->sizex= (int)(nbd->percentx*0.01f*nbd->image_in_width);
nbd->sizey= (int)(nbd->percenty*0.01f*nbd->image_in_height);
@@ -635,14 +635,15 @@ static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bN
}
out[0]->data = new;
- } else {
+ }
+ else {
/* All non fast gauss blur methods */
- if(img->type==CB_VEC2 || img->type==CB_VEC3) {
+ if (img->type==CB_VEC2 || img->type==CB_VEC3) {
img= typecheck_compbuf(in[0]->data, CB_RGBA);
}
/* if fac input, we do it different */
- if(in[1]->data) {
+ if (in[1]->data) {
CompBuf *gammabuf;
/* make output size of input image */
@@ -652,7 +653,7 @@ static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bN
new->xof = img->xof;
new->yof = img->yof;
- if(nbd->gamma) {
+ if (nbd->gamma) {
gammabuf= dupalloc_compbuf(img);
gamma_correct_compbuf(gammabuf, 0);
}
@@ -660,11 +661,11 @@ static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bN
blur_with_reference(node, new, gammabuf, in[1]->data);
- if(nbd->gamma) {
+ if (nbd->gamma) {
gamma_correct_compbuf(new, 1);
free_compbuf(gammabuf);
}
- if(node->exec & NODE_BREAK) {
+ if (node->exec & NODE_BREAK) {
free_compbuf(new);
new= NULL;
}
@@ -672,7 +673,7 @@ static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bN
}
else {
- if(in[1]->vec[0]<=0.001f) { /* time node inputs can be a tiny value */
+ if (in[1]->vec[0]<=0.001f) { /* time node inputs can be a tiny value */
new= pass_on_compbuf(img);
}
else {
@@ -685,31 +686,31 @@ static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bN
new->xof = img->xof;
new->yof = img->yof;
- if(nbd->gamma) {
+ if (nbd->gamma) {
gammabuf= dupalloc_compbuf(img);
gamma_correct_compbuf(gammabuf, 0);
}
else gammabuf= img;
- if(nbd->bokeh)
+ if (nbd->bokeh)
bokeh_single_image(node, new, gammabuf, in[1]->vec[0]);
- else if(1)
+ else if (1)
blur_single_image(node, new, gammabuf, in[1]->vec[0]);
else /* bloom experimental... */
bloom_with_reference(new, gammabuf, NULL, in[1]->vec[0], nbd);
- if(nbd->gamma) {
+ if (nbd->gamma) {
gamma_correct_compbuf(new, 1);
free_compbuf(gammabuf);
}
- if(node->exec & NODE_BREAK) {
+ if (node->exec & NODE_BREAK) {
free_compbuf(new);
new= NULL;
}
}
out[0]->data= new;
}
- if(img!=in[0]->data)
+ if (img!=in[0]->data)
free_compbuf(img);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_brightness.c b/source/blender/nodes/composite/nodes/node_composite_brightness.c
index d935d9af7f7..caae5f313cd 100644
--- a/source/blender/nodes/composite/nodes/node_composite_brightness.c
+++ b/source/blender/nodes/composite/nodes/node_composite_brightness.c
@@ -61,18 +61,16 @@ 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);
}
- for(c=0; c<3; c++){
+ for (c=0; c<3; c++) {
i = in[c];
v = a*i + b;
out[c] = v;
@@ -81,15 +79,15 @@ static void do_brightnesscontrast(bNode *UNUSED(node), float *out, float *in, fl
static void node_composit_exec_brightcontrast(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
{
- if(out[0]->hasoutput==0)
+ if (out[0]->hasoutput==0)
return;
- if(in[0]->data) {
+ if (in[0]->data) {
CompBuf *stackbuf, *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
stackbuf= dupalloc_compbuf(cbuf);
composit3_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, do_brightnesscontrast, CB_RGBA, CB_VAL, CB_VAL);
out[0]->data = stackbuf;
- if(cbuf != in[0]->data)
+ if (cbuf != in[0]->data)
free_compbuf(cbuf);
}
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_channelMatte.c b/source/blender/nodes/composite/nodes/node_composite_channelMatte.c
index 785786dacbe..132b1659fa5 100644
--- a/source/blender/nodes/composite/nodes/node_composite_channelMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_channelMatte.c
@@ -105,10 +105,10 @@ static void do_channel_matte(bNode *node, float *out, float *in)
alpha=1-alpha;
/* test range*/
- if(alpha>c->t1) {
+ if (alpha>c->t1) {
alpha=in[3]; /*whatever it was prior */
}
- else if(alpha<c->t2){
+ else if (alpha<c->t2) {
alpha=0.0;
}
else {/*blend */
@@ -130,9 +130,9 @@ static void node_composit_exec_channel_matte(void *data, bNode *node, bNodeStack
CompBuf *cbuf;
CompBuf *outbuf;
- if(in[0]->hasinput==0) return;
- if(in[0]->data==NULL) return;
- if(out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
+ if (in[0]->hasinput==0) return;
+ if (in[0]->data==NULL) return;
+ if (out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
cbuf=typecheck_compbuf(in[0]->data, CB_RGBA);
@@ -177,10 +177,10 @@ static void node_composit_exec_channel_matte(void *data, bNode *node, bNodeStack
generate_preview(data, node, outbuf);
out[0]->data=outbuf;
- if(out[1]->hasoutput)
+ if (out[1]->hasoutput)
out[1]->data=valbuf_from_rgbabuf(outbuf, CHAN_A);
- if(cbuf!=in[0]->data)
+ if (cbuf!=in[0]->data)
free_compbuf(cbuf);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c b/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
index b6f490a0320..2df8e1b6139 100644
--- a/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
@@ -111,14 +111,14 @@ static void do_chroma_key(bNode *node, float *out, float *in)
out[1]=in[1];
out[2]=in[2];
- if(kfg>0.0f) { /* found a pixel that is within key color */
+ if (kfg>0.0f) { /* found a pixel that is within key color */
alpha=(1.0f-kfg)*(c->fstrength);
beta=atan2(z,x);
angle2=c->t2; /* t2 is radians. */
/* if beta is within the cutoff angle */
- if(fabsf(beta) < (angle2/2.0f)) {
+ if (fabsf(beta) < (angle2/2.0f)) {
alpha=0.0;
}
@@ -144,9 +144,9 @@ static void node_composit_exec_chroma_matte(void *data, bNode *node, bNodeStack
CompBuf *chromabuf;
NodeChroma *c;
- if(in[0]->hasinput==0) return;
- if(in[0]->data==NULL) return;
- if(out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
+ if (in[0]->hasinput==0) return;
+ if (in[0]->data==NULL) return;
+ if (out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
@@ -166,12 +166,12 @@ static void node_composit_exec_chroma_matte(void *data, bNode *node, bNodeStack
composit1_pixel_processor(node, chromabuf, chromabuf, in[0]->vec, do_ycca_to_rgba_normalized, CB_RGBA);
out[0]->data= chromabuf;
- if(out[1]->hasoutput)
+ if (out[1]->hasoutput)
out[1]->data= valbuf_from_rgbabuf(chromabuf, CHAN_A);
generate_preview(data, node, chromabuf);
- if(cbuf!=in[0]->data)
+ if (cbuf!=in[0]->data)
free_compbuf(cbuf);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c
index 2d56c9e5973..12b6e802555 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c
@@ -54,7 +54,7 @@ static void do_color_key(bNode *node, float *out, float *in)
copy_v3_v3(out, in);
- if(
+ if (
/* do hue last because it needs to wrap, and does some more checks */
/* sat */ (fabsf(in[1]-c->key[1]) < c->t2) &&
@@ -79,9 +79,9 @@ static void node_composit_exec_color_matte(void *data, bNode *node, bNodeStack *
CompBuf *colorbuf;
NodeChroma *c;
- if(in[0]->hasinput==0) return;
- if(in[0]->data==NULL) return;
- if(out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
+ if (in[0]->hasinput==0) return;
+ if (in[0]->data==NULL) return;
+ if (out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
@@ -103,12 +103,12 @@ static void node_composit_exec_color_matte(void *data, bNode *node, bNodeStack *
composit1_pixel_processor(node, colorbuf, colorbuf, in[0]->vec, do_hsva_to_rgba, CB_RGBA);
out[0]->data= colorbuf;
- if(out[1]->hasoutput)
+ if (out[1]->hasoutput)
out[1]->data= valbuf_from_rgbabuf(colorbuf, CHAN_A);
generate_preview(data, node, colorbuf);
- if(cbuf!=in[0]->data)
+ if (cbuf!=in[0]->data)
free_compbuf(cbuf);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
index af6a295cf7f..46d7c620aa8 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
+++ b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
@@ -33,7 +33,7 @@
#include "node_composite_util.h"
-#define avg(a,b) ((a+b)/2)
+#define AVG(a, b) ((a + b) / 2)
/* ******************* Color Spill Supression ********************************* */
static bNodeSocketTemplate cmp_node_color_spill_in[]={
@@ -96,7 +96,7 @@ static void do_average_spillmap_red(bNode *node, float* out, float *in)
{
NodeColorspill *ncs;
ncs=node->storage;
- out[0]=in[0]-(ncs->limscale * avg(in[1], in[2]) );
+ out[0]=in[0]-(ncs->limscale * AVG(in[1], in[2]) );
}
static void do_average_spillmap_red_fac(bNode *node, float* out, float *in, float *fac)
@@ -104,14 +104,14 @@ static void do_average_spillmap_red_fac(bNode *node, float* out, float *in, floa
NodeColorspill *ncs;
ncs=node->storage;
- out[0] = *fac * (in[0]-(ncs->limscale * avg(in[1], in[2]) ));
+ out[0] = *fac * (in[0]-(ncs->limscale * AVG(in[1], in[2]) ));
}
static void do_average_spillmap_green(bNode *node, float* out, float *in)
{
NodeColorspill *ncs;
ncs=node->storage;
- out[0]=in[1]-(ncs->limscale * avg(in[0], in[2]) );
+ out[0]=in[1]-(ncs->limscale * AVG(in[0], in[2]) );
}
static void do_average_spillmap_green_fac(bNode *node, float* out, float *in, float *fac)
@@ -119,14 +119,14 @@ static void do_average_spillmap_green_fac(bNode *node, float* out, float *in, fl
NodeColorspill *ncs;
ncs=node->storage;
- out[0] = *fac * (in[0]-(ncs->limscale * avg(in[0], in[2]) ));
+ out[0] = *fac * (in[0]-(ncs->limscale * AVG(in[0], in[2]) ));
}
static void do_average_spillmap_blue(bNode *node, float* out, float *in)
{
NodeColorspill *ncs;
ncs=node->storage;
- out[0]=in[2]-(ncs->limscale * avg(in[0], in[1]) );
+ out[0]=in[2]-(ncs->limscale * AVG(in[0], in[1]) );
}
static void do_average_spillmap_blue_fac(bNode *node, float* out, float *in, float *fac)
@@ -134,14 +134,14 @@ static void do_average_spillmap_blue_fac(bNode *node, float* out, float *in, flo
NodeColorspill *ncs;
ncs=node->storage;
- out[0] = *fac * (in[0]-(ncs->limscale * avg(in[0], in[1]) ));
+ out[0] = *fac * (in[0]-(ncs->limscale * AVG(in[0], in[1]) ));
}
static void do_apply_spillmap_red(bNode *node, float* out, float *in, float *map)
{
NodeColorspill *ncs;
ncs=node->storage;
- if(map[0]>0) {
+ if (map[0]>0) {
out[0]=in[0]-(ncs->uspillr*map[0]);
out[1]=in[1]+(ncs->uspillg*map[0]);
out[2]=in[2]+(ncs->uspillb*map[0]);
@@ -157,7 +157,7 @@ static void do_apply_spillmap_green(bNode *node, float* out, float *in, float *m
{
NodeColorspill *ncs;
ncs=node->storage;
- if(map[0]>0) {
+ if (map[0]>0) {
out[0]=in[0]+(ncs->uspillr*map[0]);
out[1]=in[1]-(ncs->uspillg*map[0]);
out[2]=in[2]+(ncs->uspillb*map[0]);
@@ -173,7 +173,7 @@ static void do_apply_spillmap_blue(bNode *node, float* out, float *in, float *ma
{
NodeColorspill *ncs;
ncs=node->storage;
- if(map[0]>0) {
+ if (map[0]>0) {
out[0]=in[0]+(ncs->uspillr*map[0]);
out[1]=in[1]+(ncs->uspillg*map[0]);
out[2]=in[2]-(ncs->uspillb*map[0]);
@@ -197,9 +197,9 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod
ncs=node->storage;
/* early out for missing connections */
- if(out[0]->hasoutput==0 ) return;
- if(in[0]->hasinput==0) return;
- if(in[0]->data==NULL) return;
+ if (out[0]->hasoutput==0 ) return;
+ if (in[0]->hasinput==0) return;
+ if (in[0]->data==NULL) return;
cbuf=typecheck_compbuf(in[0]->data, CB_RGBA);
/* mask= */ /* UNUSED */ typecheck_compbuf(in[1]->data, CB_VAL);
@@ -216,7 +216,8 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod
{
if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) {
composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_simple_spillmap_red, CB_RGBA);
- } else {
+ }
+ else {
composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_simple_spillmap_red_fac, CB_RGBA, CB_VAL);
}
break;
@@ -225,13 +226,14 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod
{
if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) {
composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_red, CB_RGBA);
- } else {
+ }
+ else {
composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_average_spillmap_red_fac, CB_RGBA, CB_VAL);
}
break;
}
}
- if(ncs->unspill==0) {
+ if (ncs->unspill==0) {
ncs->uspillr=1.0f;
ncs->uspillg=0.0f;
ncs->uspillb=0.0f;
@@ -247,7 +249,8 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod
{
if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) {
composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_simple_spillmap_green, CB_RGBA);
- } else {
+ }
+ else {
composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_simple_spillmap_green_fac, CB_RGBA, CB_VAL);
}
break;
@@ -256,13 +259,14 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod
{
if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) {
composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_green, CB_RGBA);
- } else {
+ }
+ else {
composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_average_spillmap_green_fac, CB_RGBA, CB_VAL);
}
break;
}
}
- if(ncs->unspill==0) {
+ if (ncs->unspill==0) {
ncs->uspillr=0.0f;
ncs->uspillg=1.0f;
ncs->uspillb=0.0f;
@@ -278,7 +282,8 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod
{
if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) {
composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_simple_spillmap_blue, CB_RGBA);
- } else {
+ }
+ else {
composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_simple_spillmap_blue_fac, CB_RGBA, CB_VAL);
}
break;
@@ -287,13 +292,14 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod
{
if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) {
composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_blue, CB_RGBA);
- } else {
+ }
+ else {
composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_average_spillmap_blue_fac, CB_RGBA, CB_VAL);
}
break;
}
}
- if(ncs->unspill==0) {
+ if (ncs->unspill==0) {
ncs->uspillr=0.0f;
ncs->uspillg=0.0f;
ncs->uspillb=1.0f;
@@ -307,7 +313,7 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod
out[0]->data=rgbbuf;
- if(cbuf!=in[0]->data)
+ if (cbuf!=in[0]->data)
free_compbuf(cbuf);
free_compbuf(spillmap);
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
index 26d7aa0a3a0..f77e4cd9c4e 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
+++ b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
@@ -69,7 +69,7 @@ DO_INLINE float colorbalance_cdl(float in, float offset, float power, float slop
/* note: lift_lgg is just 2-lift, gamma_inv is 1.0/gamma */
DO_INLINE float colorbalance_lgg(float in, float lift_lgg, float gamma_inv, float gain)
{
- /* 1:1 match with the sequencer with linear/srgb conversions, the conversion isnt pretty
+ /* 1:1 match with the sequencer with linear/srgb conversions, the conversion isn'tisn't pretty
* but best keep it this way, sice testing for durian shows a similar calculation
* without lin/srgb conversions gives bad results (over-saturated shadows) with colors
* slightly below 1.0. some correction can be done but it ends up looking bad for shadows or lighter tones - campbell */
@@ -130,9 +130,9 @@ static void node_composit_exec_colorbalance(void *UNUSED(data), bNode *node, bNo
/* stack order input: fac, image */
/* stack order output: image */
- if(out[0]->hasoutput==0) return;
+ if (out[0]->hasoutput==0) return;
- if(in[0]->vec[0] == 0.f && in[0]->data == NULL) {
+ if (in[0]->vec[0] == 0.f && in[0]->data == NULL) {
out[0]->data = pass_on_compbuf(cbuf);
return;
}
@@ -158,7 +158,8 @@ static void node_composit_exec_colorbalance(void *UNUSED(data), bNode *node, bNo
else {
composit2_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[0]->data, in[0]->vec, do_colorbalance_lgg_fac, CB_RGBA, CB_VAL);
}
- } else {
+ }
+ else {
/* offset/power/slope : ASC-CDL */
if ((in[0]->data==NULL) && (in[0]->vec[0] >= 1.f)) {
composit1_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, do_colorbalance_cdl, CB_RGBA);
diff --git a/source/blender/nodes/composite/nodes/node_composite_composite.c b/source/blender/nodes/composite/nodes/node_composite_composite.c
index 73a84676caa..9b1e5e451c4 100644
--- a/source/blender/nodes/composite/nodes/node_composite_composite.c
+++ b/source/blender/nodes/composite/nodes/node_composite_composite.c
@@ -48,27 +48,27 @@ static void node_composit_exec_composite(void *data, bNode *node, bNodeStack **i
/* image assigned to output */
/* stack order input sockets: col, alpha, z */
- if(node->flag & NODE_DO_OUTPUT) { /* only one works on out */
+ if (node->flag & NODE_DO_OUTPUT) { /* only one works on out */
Scene *scene= (Scene *)node->id;
RenderData *rd= data;
- if(scene && (rd->scemode & R_DOCOMP)) {
+ if (scene && (rd->scemode & R_DOCOMP)) {
Render *re= RE_GetRender(scene->id.name);
RenderResult *rr= RE_AcquireResultWrite(re);
- if(rr) {
+ if (rr) {
CompBuf *outbuf, *zbuf=NULL;
- if(rr->rectf)
+ if (rr->rectf)
MEM_freeN(rr->rectf);
outbuf= alloc_compbuf(rr->rectx, rr->recty, CB_RGBA, 1);
- if(in[1]->data==NULL)
+ if (in[1]->data==NULL)
composit1_pixel_processor(node, outbuf, in[0]->data, in[0]->vec, do_copy_rgba, CB_RGBA);
else
composit2_pixel_processor(node, outbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, do_copy_a_rgba, CB_RGBA, CB_VAL);
- if(in[2]->data) {
- if(rr->rectz)
+ if (in[2]->data) {
+ if (rr->rectz)
MEM_freeN(rr->rectz);
zbuf= alloc_compbuf(rr->rectx, rr->recty, CB_VAL, 1);
composit1_pixel_processor(node, zbuf, in[2]->data, in[2]->vec, do_copy_value, CB_VAL);
@@ -93,7 +93,7 @@ static void node_composit_exec_composite(void *data, bNode *node, bNodeStack **i
RE_ReleaseResult(re);
}
}
- if(in[0]->data)
+ if (in[0]->data)
generate_preview(data, node, in[0]->data);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_crop.c b/source/blender/nodes/composite/nodes/node_composite_crop.c
index 3697f3e4c5c..242bc8396d7 100644
--- a/source/blender/nodes/composite/nodes/node_composite_crop.c
+++ b/source/blender/nodes/composite/nodes/node_composite_crop.c
@@ -45,7 +45,7 @@ static bNodeSocketTemplate cmp_node_crop_out[]= {
static void node_composit_exec_crop(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
{
- if(in[0]->data) {
+ if (in[0]->data) {
NodeTwoXYs *ntxy= node->storage;
CompBuf *cbuf= in[0]->data;
CompBuf *stackbuf;
@@ -53,7 +53,7 @@ static void node_composit_exec_crop(void *UNUSED(data), bNode *node, bNodeStack
float *srcfp, *outfp;
rcti outputrect;
- if(node->custom2) {
+ if (node->custom2) {
ntxy->x1= cbuf->x* ntxy->fac_x1;
ntxy->x2= cbuf->x* ntxy->fac_x2;
ntxy->y1= cbuf->y* ntxy->fac_y1;
@@ -61,16 +61,16 @@ static void node_composit_exec_crop(void *UNUSED(data), bNode *node, bNodeStack
}
/* check input image size */
- if(cbuf->x <= ntxy->x1 + 1)
+ if (cbuf->x <= ntxy->x1 + 1)
ntxy->x1= cbuf->x - 1;
- if(cbuf->y <= ntxy->y1 + 1)
+ if (cbuf->y <= ntxy->y1 + 1)
ntxy->y1= cbuf->y - 1;
- if(cbuf->x <= ntxy->x2 + 1)
+ if (cbuf->x <= ntxy->x2 + 1)
ntxy->x2= cbuf->x - 1;
- if(cbuf->y <= ntxy->y2 + 1)
+ if (cbuf->y <= ntxy->y2 + 1)
ntxy->y2= cbuf->y - 1;
/* figure out the minimums and maximums */
@@ -79,7 +79,7 @@ static void node_composit_exec_crop(void *UNUSED(data), bNode *node, bNodeStack
outputrect.ymax=MAX2(ntxy->y1, ntxy->y2) + 1;
outputrect.ymin=MIN2(ntxy->y1, ntxy->y2);
- if(node->custom1) {
+ if (node->custom1) {
/* this option crops the image size too */
stackbuf= get_cropped_compbuf(&outputrect, cbuf->rect, cbuf->x, cbuf->y, cbuf->type);
}
@@ -89,10 +89,10 @@ static void node_composit_exec_crop(void *UNUSED(data), bNode *node, bNodeStack
stackbuf = alloc_compbuf(cbuf->x, cbuf->y, cbuf->type, 1);
/* select the cropped part of the image and set it to the output */
- for(y=outputrect.ymin; y<outputrect.ymax; y++){
+ for (y=outputrect.ymin; y<outputrect.ymax; y++) {
srcfp= cbuf->rect + (y * cbuf->x + outputrect.xmin) * cbuf->type;
outfp= stackbuf->rect + (y * stackbuf->x + outputrect.xmin) * stackbuf->type;
- for(x=outputrect.xmin; x<outputrect.xmax; x++, outfp+= stackbuf->type, srcfp+= cbuf->type)
+ for (x=outputrect.xmin; x<outputrect.xmax; x++, outfp+= stackbuf->type, srcfp+= cbuf->type)
memcpy(outfp, srcfp, sizeof(float)*stackbuf->type);
}
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_curves.c b/source/blender/nodes/composite/nodes/node_composite_curves.c
index 81424586a11..d17a7bf5dc8 100644
--- a/source/blender/nodes/composite/nodes/node_composite_curves.c
+++ b/source/blender/nodes/composite/nodes/node_composite_curves.c
@@ -47,7 +47,7 @@ static void node_composit_exec_curves_time(void *data, bNode *node, bNodeStack *
/* stack order output: fac */
float fac= 0.0f;
- if(node->custom1 < node->custom2)
+ if (node->custom1 < node->custom2)
fac= (rd->cfra - node->custom1)/(float)(node->custom2-node->custom1);
fac= curvemapping_evaluateF(node->storage, 0, fac);
@@ -140,9 +140,9 @@ static void do_curves(bNode *node, float *out, float *in)
static void do_curves_fac(bNode *node, float *out, float *in, float *fac)
{
- if(*fac >= 1.0f)
+ if (*fac >= 1.0f)
curvemapping_evaluate_premulRGBF(node->storage, out, in);
- else if(*fac <= 0.0f) {
+ else if (*fac <= 0.0f) {
copy_v3_v3(out, in);
}
else {
@@ -160,11 +160,11 @@ static void node_composit_exec_curve_rgb(void *UNUSED(data), bNode *node, bNodeS
/* stack order input: fac, image, black level, white level */
/* stack order output: image */
- if(out[0]->hasoutput==0)
+ if (out[0]->hasoutput==0)
return;
/* input no image? then only color operation */
- if(in[1]->data==NULL) {
+ if (in[1]->data==NULL) {
curvemapping_evaluateRGBF(node->storage, out[0]->vec, in[1]->vec);
}
else {
@@ -174,7 +174,7 @@ static void node_composit_exec_curve_rgb(void *UNUSED(data), bNode *node, bNodeS
curvemapping_set_black_white(node->storage, in[2]->vec, in[3]->vec);
- if(in[0]->data==NULL && in[0]->vec[0] == 1.0f)
+ if (in[0]->data==NULL && in[0]->vec[0] == 1.0f)
composit1_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, do_curves, CB_RGBA);
else
composit2_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[0]->data, in[0]->vec, do_curves_fac, CB_RGBA, CB_VAL);
diff --git a/source/blender/nodes/composite/nodes/node_composite_defocus.c b/source/blender/nodes/composite/nodes/node_composite_defocus.c
index 1e7c8e8b58c..fc6e6847f34 100644
--- a/source/blender/nodes/composite/nodes/node_composite_defocus.c
+++ b/source/blender/nodes/composite/nodes/node_composite_defocus.c
@@ -376,7 +376,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf,
wts->rect[px] = 0.f;
}
// esc set by main calling process
- if(node->exec & NODE_BREAK)
+ if (node->exec & NODE_BREAK)
break;
}
}
@@ -385,9 +385,9 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf,
// main loop
#ifndef __APPLE__ /* can crash on Mac, see bug #22856, disabled for now */
#ifdef __INTEL_COMPILER /* icc doesn't like the compound statement -- internal error: 0_1506 */
- #pragma omp parallel for private(y) if(!nqd->preview) schedule(guided)
+ #pragma omp parallel for private(y) if (!nqd->preview) schedule(guided)
#else
- #pragma omp parallel for private(y) if(!nqd->preview && img->y*img->x > 16384) schedule(guided)
+ #pragma omp parallel for private(y) if (!nqd->preview && img->y*img->x > 16384) schedule(guided)
#endif
#endif
for (y=0; y<img->y; y++) {
@@ -400,7 +400,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf,
#pragma omp critical
{
if (((ydone & 7)==0) || (ydone==(img->y-1))) {
- if(G.background==0) {
+ if (G.background==0) {
printf("\rdefocus: Processing Line %d of %d ... ", ydone+1, img->y);
fflush(stdout);
}
@@ -411,7 +411,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf,
// esc set by main calling process. don't break because openmp doesn't
// allow it, just continue and do nothing
- if(node->exec & NODE_BREAK)
+ if (node->exec & NODE_BREAK)
continue;
zp = y * img->x;
@@ -462,7 +462,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf,
// (eg. aa disk blur without test: 112 sec, vs with test: 176 sec...)
// iff center blur radius > threshold
// and if overlap pixel in focus, do nothing, else add color/weigbt
- // (threshold constant is dependant on amount of blur)
+ // (threshold constant is dependent on amount of blur)
#define TESTBG1(c, w) {\
if (ct_crad > nqd->bthresh) {\
if (crad->rect[p] > nqd->bthresh) {\
@@ -850,7 +850,7 @@ static void node_composit_exec_defocus(void *UNUSED(data), bNode *node, bNodeSta
premul_compbuf(new, 0);
free_compbuf(old);
}
- if(node->exec & NODE_BREAK) {
+ if (node->exec & NODE_BREAK) {
free_compbuf(new);
new= NULL;
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
index eae59dea3f4..027786d8b22 100644
--- a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
@@ -63,15 +63,15 @@ static void do_diff_matte(bNode *node, float *outColor, float *inColor1, float *
copy_v3_v3(outColor, inColor1);
/*make 100% transparent*/
- if(difference < tolerence) {
+ if (difference < tolerence) {
outColor[3]=0.0;
}
/*in the falloff region, make partially transparent */
- else if(difference < falloff+tolerence) {
+ else if (difference < falloff+tolerence) {
difference=difference-tolerence;
alpha=difference/falloff;
/*only change if more transparent than before */
- if(alpha < inColor1[3]) {
+ if (alpha < inColor1[3]) {
outColor[3]=alpha;
}
else { /* leave as before */
@@ -92,16 +92,16 @@ static void node_composit_exec_diff_matte(void *data, bNode *node, bNodeStack **
/* NodeChroma *c; */ /* UNUSED */
/*is anything connected?*/
- if(out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
+ if (out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
/*must have an image imput*/
- if(in[0]->data==NULL) return;
+ if (in[0]->data==NULL) return;
imbuf1=typecheck_compbuf(in[0]->data, CB_RGBA);
/* if there's an image, use that, if not use the color */
- if(in[1]->data) {
+ if (in[1]->data) {
imbuf2=typecheck_compbuf(in[1]->data, CB_RGBA);
}
@@ -112,14 +112,14 @@ static void node_composit_exec_diff_matte(void *data, bNode *node, bNodeStack **
composit2_pixel_processor(node, outbuf, imbuf1, in[0]->vec, imbuf2, in[1]->vec, do_diff_matte, CB_RGBA, CB_RGBA);
out[0]->data=outbuf;
- if(out[1]->hasoutput)
+ if (out[1]->hasoutput)
out[1]->data=valbuf_from_rgbabuf(outbuf, CHAN_A);
generate_preview(data, node, outbuf);
- if(imbuf1!=in[0]->data)
+ if (imbuf1!=in[0]->data)
free_compbuf(imbuf1);
- if(imbuf2!=in[1]->data)
+ if (imbuf2!=in[1]->data)
free_compbuf(imbuf2);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_dilate.c b/source/blender/nodes/composite/nodes/node_composite_dilate.c
index f8abf96e742..ee857dd0007 100644
--- a/source/blender/nodes/composite/nodes/node_composite_dilate.c
+++ b/source/blender/nodes/composite/nodes/node_composite_dilate.c
@@ -117,11 +117,11 @@ static void node_composit_exec_dilateerode(void *UNUSED(data), bNode *node, bNod
{
/* stack order in: mask */
/* stack order out: mask */
- if(out[0]->hasoutput==0)
+ if (out[0]->hasoutput==0)
return;
/* input no image? then only color operation */
- if(in[0]->data==NULL) {
+ if (in[0]->data==NULL) {
out[0]->vec[0] = out[0]->vec[1] = out[0]->vec[2] = 0.0f;
out[0]->vec[3] = 0.0f;
}
@@ -134,12 +134,13 @@ static void node_composit_exec_dilateerode(void *UNUSED(data), bNode *node, bNod
if (node->custom2 > 0) { // positive, dilate
for (i = 0; i < node->custom2; i++)
morpho_dilate(stackbuf);
- } else if (node->custom2 < 0) { // negative, erode
+ }
+ else if (node->custom2 < 0) { // negative, erode
for (i = 0; i > node->custom2; i--)
morpho_erode(stackbuf);
}
- if(cbuf!=in[0]->data)
+ if (cbuf!=in[0]->data)
free_compbuf(cbuf);
out[0]->data= stackbuf;
diff --git a/source/blender/nodes/composite/nodes/node_composite_directionalblur.c b/source/blender/nodes/composite/nodes/node_composite_directionalblur.c
index d0f7feccf2e..f65b3312bea 100644
--- a/source/blender/nodes/composite/nodes/node_composite_directionalblur.c
+++ b/source/blender/nodes/composite/nodes/node_composite_directionalblur.c
@@ -68,37 +68,37 @@ static CompBuf *dblur(bNode *node, CompBuf *img, int iterations, int wrap,
rot= itsc * spin;
/* blur the image */
- for(i= 0; i < iterations; ++i) {
+ for (i= 0; i < iterations; ++i) {
const float cs= cosf(rot), ss= sinf(rot);
const float isc= 1.f / (1.f + sc);
unsigned int x, y;
float col[4]= {0,0,0,0};
- for(y= 0; y < img->y; ++y) {
+ for (y= 0; y < img->y; ++y) {
const float v= isc * (y - center_y_pix) + ty;
- for(x= 0; x < img->x; ++x) {
+ for (x= 0; x < img->x; ++x) {
const float u= isc * (x - center_x_pix) + tx;
unsigned int p= (x + y * img->x) * img->type;
getpix(tmp, cs * u + ss * v + center_x_pix, cs * v - ss * u + center_y_pix, col);
/* mix img and transformed tmp */
- for(j= 0; j < 4; ++j) {
+ for (j= 0; j < 4; ++j) {
img->rect[p + j]= 0.5f * (img->rect[p + j] + col[j]);
}
}
}
/* copy img to tmp */
- if(i != (iterations - 1))
+ if (i != (iterations - 1))
memcpy(tmp->rect, img->rect, sizeof(float) * img->x * img->y * img->type);
/* double transformations */
tx *= 2.f, ty *= 2.f;
sc *= 2.f, rot *= 2.f;
- if(node->exec & NODE_BREAK) break;
+ if (node->exec & NODE_BREAK) break;
}
free_compbuf(tmp);
@@ -112,7 +112,7 @@ static void node_composit_exec_dblur(void *UNUSED(data), bNode *node, bNodeStack
NodeDBlurData *ndbd= node->storage;
CompBuf *new, *img= in[0]->data;
- if((img == NULL) || (out[0]->hasoutput == 0)) return;
+ if ((img == NULL) || (out[0]->hasoutput == 0)) return;
if (img->type != CB_RGBA)
new = typecheck_compbuf(img, CB_RGBA);
diff --git a/source/blender/nodes/composite/nodes/node_composite_displace.c b/source/blender/nodes/composite/nodes/node_composite_displace.c
index ad7c1fa589e..6e4bbc632ea 100644
--- a/source/blender/nodes/composite/nodes/node_composite_displace.c
+++ b/source/blender/nodes/composite/nodes/node_composite_displace.c
@@ -66,8 +66,8 @@ static void do_displace(bNode *node, CompBuf *stackbuf, CompBuf *cbuf, CompBuf *
ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0);
ibuf->rect_float= cbuf->rect;
- for(y=0; y < stackbuf->y; y++) {
- for(x=0; x < stackbuf->x; x++) {
+ for (y=0; y < stackbuf->y; y++) {
+ for (x=0; x < stackbuf->x; x++) {
/* calc pixel coordinates */
qd_getPixel(vecbuf, x-vecbuf->xof, y-vecbuf->yof, vec);
@@ -117,10 +117,10 @@ static void do_displace(bNode *node, CompBuf *stackbuf, CompBuf *cbuf, CompBuf *
ibuf_sample(ibuf, u, v, dxt, dyt, col);
qd_setPixel(stackbuf, x, y, col);
- if(node->exec & NODE_BREAK) break;
+ if (node->exec & NODE_BREAK) break;
}
- if(node->exec & NODE_BREAK) break;
+ if (node->exec & NODE_BREAK) break;
}
IMB_freeImBuf(ibuf);
@@ -133,8 +133,8 @@ static void do_displace(bNode *node, CompBuf *stackbuf, CompBuf *cbuf, CompBuf *
float vec[3];
float col[3];
- for(y=0; y < stackbuf->y; y++) {
- for(x=0; x < stackbuf->x; x++) {
+ for (y=0; y < stackbuf->y; y++) {
+ for (x=0; x < stackbuf->x; x++) {
qd_getPixel(vecbuf, x, y, vec);
dx = vec[0] * (xscale[0]);
@@ -153,10 +153,10 @@ static void do_displace(bNode *node, CompBuf *stackbuf, CompBuf *cbuf, CompBuf *
static void node_composit_exec_displace(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
{
- if(out[0]->hasoutput==0)
+ if (out[0]->hasoutput==0)
return;
- if(in[0]->data && in[1]->data) {
+ if (in[0]->data && in[1]->data) {
CompBuf *cbuf= in[0]->data;
CompBuf *vecbuf= in[1]->data;
CompBuf *xbuf= in[2]->data;
@@ -175,9 +175,9 @@ static void node_composit_exec_displace(void *UNUSED(data), bNode *node, bNodeSt
out[0]->data= stackbuf;
- if(cbuf!=in[0]->data)
+ if (cbuf!=in[0]->data)
free_compbuf(cbuf);
- if(vecbuf!=in[1]->data)
+ if (vecbuf!=in[1]->data)
free_compbuf(vecbuf);
}
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c b/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
index 292bb66613d..7aaaa7ed9b4 100644
--- a/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
@@ -62,15 +62,15 @@ static void do_distance_matte(bNode *node, float *out, float *in)
copy_v3_v3(out, in);
/*make 100% transparent */
- if(distance < tolerence) {
+ if (distance < tolerence) {
out[3]=0.0;
}
/*in the falloff region, make partially transparent */
- else if(distance < falloff+tolerence){
+ else if (distance < falloff+tolerence) {
distance=distance-tolerence;
alpha=distance/falloff;
/*only change if more transparent than before */
- if(alpha < in[3]) {
+ if (alpha < in[3]) {
out[3]=alpha;
}
else { /* leave as before */
@@ -93,9 +93,9 @@ static void node_composit_exec_distance_matte(void *data, bNode *node, bNodeStac
NodeChroma *c;
/*is anything connected?*/
- if(out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
+ if (out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
/*must have an image imput*/
- if(in[0]->data==NULL) return;
+ if (in[0]->data==NULL) return;
inbuf=typecheck_compbuf(in[0]->data, CB_RGBA);
@@ -112,11 +112,11 @@ static void node_composit_exec_distance_matte(void *data, bNode *node, bNodeStac
out[0]->data=workbuf;
- if(out[1]->hasoutput)
+ if (out[1]->hasoutput)
out[1]->data=valbuf_from_rgbabuf(workbuf, CHAN_A);
generate_preview(data, node, workbuf);
- if(inbuf!=in[0]->data)
+ if (inbuf!=in[0]->data)
free_compbuf(inbuf);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c b/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c
index 7b2e682e968..966d8f8a21a 100644
--- a/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c
+++ b/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c
@@ -33,1025 +33,1112 @@
static bNodeSocketTemplate cmp_node_doubleedgemask_in[]= {
- { SOCK_FLOAT, 1, "Inner Mask", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_NONE}, // inner mask socket definition
- { SOCK_FLOAT, 1, "Outer Mask", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_NONE}, // outer mask socket definition
- { -1, 0, "" } // input socket array terminator
+ { SOCK_FLOAT, 1, "Inner Mask", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_NONE}, // inner mask socket definition
+ { SOCK_FLOAT, 1, "Outer Mask", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_NONE}, // outer mask socket definition
+ { -1, 0, "" } // input socket array terminator
};
static bNodeSocketTemplate cmp_node_doubleedgemask_out[]= {
- { SOCK_FLOAT, 0, "Mask"}, // output socket definition
- { -1, 0, "" } // output socket array terminator
+ { SOCK_FLOAT, 0, "Mask"}, // output socket definition
+ { -1, 0, "" } // output socket array terminator
};
static void do_adjacentKeepBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize)
{
- int x;
- unsigned int isz=0; // inner edge size
- unsigned int osz=0; // outer edge size
- unsigned int gsz=0; // gradient fill area size
- /* Test the four corners */
- /* upper left corner */
- x=t-rw+1;
- // test if inner mask is filled
- if(limask[x]){
- // test if pixel underneath, or to the right, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+1] && lomask[x+1])){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
- /* upper right corner */
- x=t;
- // test if inner mask is filled
- if(limask[x]){
- // test if pixel underneath, or to the left, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x-rw] && lomask[x-rw]) || (!limask[x-1] && lomask[x-1])){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
- /* lower left corner */
- x=0;
- // test if inner mask is filled
- if(limask[x]){
- // test if pixel above, or to the right, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x+rw] && lomask[x+rw]) || (!limask[x+1] && lomask[x+1])){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
- /* lower right corner */
- x=rw-1;
- // test if inner mask is filled
- if(limask[x]){
- // test if pixel above, or to the left, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x+rw] && lomask[x+rw]) || (!limask[x-1] && lomask[x-1])){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
-
- /* Test the TOP row of pixels in buffer, except corners */
- for(x= t-1; x>=(t-rw)+2; x--) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if pixel to the right, or to the left, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
- }
-
- /* Test the BOTTOM row of pixels in buffer, except corners */
- for(x= rw-2; x; x--) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if pixel to the right, or to the left, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
- }
- /* Test the LEFT edge of pixels in buffer, except corners */
- for(x= t-(rw<<1)+1; x>=rw; x-=rw) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if pixel underneath, or above, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
- }
-
- /* Test the RIGHT edge of pixels in buffer, except corners */
- for(x= t-rw; x>rw; x-=rw) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if pixel underneath, or above, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
- }
-
- rsize[0]=isz; // fill in our return sizes for edges + fill
- rsize[1]=osz;
- rsize[2]=gsz;
+ int x;
+ unsigned int isz=0; // inner edge size
+ unsigned int osz=0; // outer edge size
+ unsigned int gsz=0; // gradient fill area size
+ /* Test the four corners */
+ /* upper left corner */
+ x=t-rw+1;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel underneath, or to the right, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+1] && lomask[x+1])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ /* upper right corner */
+ x=t;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel underneath, or to the left, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x-1] && lomask[x-1])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ /* lower left corner */
+ x=0;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel above, or to the right, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x+rw] && lomask[x+rw]) || (!limask[x+1] && lomask[x+1])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ /* lower right corner */
+ x=rw-1;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel above, or to the left, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x+rw] && lomask[x+rw]) || (!limask[x-1] && lomask[x-1])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+
+ /* Test the TOP row of pixels in buffer, except corners */
+ for (x= t-1; x>=(t-rw)+2; x--) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel to the right, or to the left, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ }
+
+ /* Test the BOTTOM row of pixels in buffer, except corners */
+ for (x= rw-2; x; x--) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel to the right, or to the left, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ }
+ /* Test the LEFT edge of pixels in buffer, except corners */
+ for (x= t-(rw<<1)+1; x>=rw; x-=rw) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel underneath, or above, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ }
+
+ /* Test the RIGHT edge of pixels in buffer, except corners */
+ for (x= t-rw; x>rw; x-=rw) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel underneath, or above, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ }
+
+ rsize[0]=isz; // fill in our return sizes for edges + fill
+ rsize[1]=osz;
+ rsize[2]=gsz;
}
static void do_adjacentBleedBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize)
{
- int x;
- unsigned int isz=0; // inner edge size
- unsigned int osz=0; // outer edge size
- unsigned int gsz=0; // gradient fill area size
- /* Test the four corners */
- /* upper left corner */
- x=t-rw+1;
- // test if inner mask is filled
- if(limask[x]){
- // test if pixel underneath, or to the right, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+1] && lomask[x+1])){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- if(!lomask[x-rw] || !lomask[x+1]) { // test if outer mask is empty underneath or to the right
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- /* upper right corner */
- x=t;
- // test if inner mask is filled
- if(limask[x]){
- // test if pixel underneath, or to the left, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x-rw] && lomask[x-rw]) || (!limask[x-1] && lomask[x-1])){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- if(!lomask[x-rw] || !lomask[x-1]) { // test if outer mask is empty underneath or to the left
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- /* lower left corner */
- x=0;
- // test if inner mask is filled
- if(limask[x]){
- // test if pixel above, or to the right, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x+rw] && lomask[x+rw]) || (!limask[x+1] && lomask[x+1])){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- if(!lomask[x+rw] || !lomask[x+1]) { // test if outer mask is empty above or to the right
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- /* lower right corner */
- x=rw-1;
- // test if inner mask is filled
- if(limask[x]){
- // test if pixel above, or to the left, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x+rw] && lomask[x+rw]) || (!limask[x-1] && lomask[x-1])){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- if(!lomask[x+rw] || !lomask[x-1]) { // test if outer mask is empty above or to the left
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- /* Test the TOP row of pixels in buffer, except corners */
- for(x= t-1; x>=(t-rw)+2; x--) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if pixel to the left, or to the right, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- if(!lomask[x-1] || !lomask[x+1]) { // test if outer mask is empty to the left or to the right
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- }
-
- /* Test the BOTTOM row of pixels in buffer, except corners */
- for(x= rw-2; x; x--) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if pixel to the left, or to the right, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- if(!lomask[x-1] || !lomask[x+1]) { // test if outer mask is empty to the left or to the right
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- }
- /* Test the LEFT edge of pixels in buffer, except corners */
- for(x= t-(rw<<1)+1; x>=rw; x-=rw) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if pixel underneath, or above, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- if(!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- }
-
- /* Test the RIGHT edge of pixels in buffer, except corners */
- for(x= t-rw; x>rw; x-=rw) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if pixel underneath, or above, are empty in the inner mask,
- // but filled in the outer mask
- if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- if(!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- }
-
- rsize[0]=isz; // fill in our return sizes for edges + fill
- rsize[1]=osz;
- rsize[2]=gsz;
+ int x;
+ unsigned int isz=0; // inner edge size
+ unsigned int osz=0; // outer edge size
+ unsigned int gsz=0; // gradient fill area size
+ /* Test the four corners */
+ /* upper left corner */
+ x=t-rw+1;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel underneath, or to the right, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+1] && lomask[x+1])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x-rw] || !lomask[x+1]) { // test if outer mask is empty underneath or to the right
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ /* upper right corner */
+ x=t;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel underneath, or to the left, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x-1] && lomask[x-1])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x-rw] || !lomask[x-1]) { // test if outer mask is empty underneath or to the left
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ /* lower left corner */
+ x=0;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel above, or to the right, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x+rw] && lomask[x+rw]) || (!limask[x+1] && lomask[x+1])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x+rw] || !lomask[x+1]) { // test if outer mask is empty above or to the right
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ /* lower right corner */
+ x=rw-1;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel above, or to the left, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x+rw] && lomask[x+rw]) || (!limask[x-1] && lomask[x-1])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x+rw] || !lomask[x-1]) { // test if outer mask is empty above or to the left
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ /* Test the TOP row of pixels in buffer, except corners */
+ for (x= t-1; x>=(t-rw)+2; x--) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel to the left, or to the right, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x-1] || !lomask[x+1]) { // test if outer mask is empty to the left or to the right
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ }
+
+ /* Test the BOTTOM row of pixels in buffer, except corners */
+ for (x= rw-2; x; x--) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel to the left, or to the right, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x-1] || !lomask[x+1]) { // test if outer mask is empty to the left or to the right
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ }
+ /* Test the LEFT edge of pixels in buffer, except corners */
+ for (x= t-(rw<<1)+1; x>=rw; x-=rw) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel underneath, or above, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ }
+
+ /* Test the RIGHT edge of pixels in buffer, except corners */
+ for (x= t-rw; x>rw; x-=rw) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if pixel underneath, or above, are empty in the inner mask,
+ // but filled in the outer mask
+ if ((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ }
+
+ rsize[0]=isz; // fill in our return sizes for edges + fill
+ rsize[1]=osz;
+ rsize[2]=gsz;
}
static void do_allKeepBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize)
{
- int x;
- unsigned int isz=0; // inner edge size
- unsigned int osz=0; // outer edge size
- unsigned int gsz=0; // gradient fill area size
- /* Test the four corners */
- /* upper left corner */
- x=t-rw+1;
- // test if inner mask is filled
- if(limask[x]){
- // test if the inner mask is empty underneath or to the right
- if(!limask[x-rw] || !limask[x+1]){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
- /* upper right corner */
- x=t;
- // test if inner mask is filled
- if(limask[x]){
- // test if the inner mask is empty underneath or to the left
- if(!limask[x-rw] || !limask[x-1]){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
- /* lower left corner */
- x=0;
- // test if inner mask is filled
- if(limask[x]){
- // test if inner mask is empty above or to the right
- if(!limask[x+rw] || !limask[x+1]){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
- /* lower right corner */
- x=rw-1;
- // test if inner mask is filled
- if(limask[x]){
- // test if inner mask is empty above or to the left
- if(!limask[x+rw] || !limask[x-1]){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
-
- /* Test the TOP row of pixels in buffer, except corners */
- for(x= t-1; x>=(t-rw)+2; x--) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if inner mask is empty to the left or to the right
- if(!limask[x-1] || !limask[x+1]) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
- }
-
- /* Test the BOTTOM row of pixels in buffer, except corners */
- for(x= rw-2; x; x--) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if inner mask is empty to the left or to the right
- if(!limask[x-1] || !limask[x+1]) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
- }
- /* Test the LEFT edge of pixels in buffer, except corners */
- for(x= t-(rw<<1)+1; x>=rw; x-=rw) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if inner mask is empty underneath or above
- if(!limask[x-rw] || !limask[x+rw]) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
- }
-
- /* Test the RIGHT edge of pixels in buffer, except corners */
- for(x= t-rw; x>rw; x-=rw) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if inner mask is empty underneath or above
- if(!limask[x-rw] || !limask[x+rw]) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- }
- }
-
- rsize[0]=isz; // fill in our return sizes for edges + fill
- rsize[1]=osz;
- rsize[2]=gsz;
+ int x;
+ unsigned int isz=0; // inner edge size
+ unsigned int osz=0; // outer edge size
+ unsigned int gsz=0; // gradient fill area size
+ /* Test the four corners */
+ /* upper left corner */
+ x=t-rw+1;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if the inner mask is empty underneath or to the right
+ if (!limask[x-rw] || !limask[x+1]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ /* upper right corner */
+ x=t;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if the inner mask is empty underneath or to the left
+ if (!limask[x-rw] || !limask[x-1]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ /* lower left corner */
+ x=0;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if inner mask is empty above or to the right
+ if (!limask[x+rw] || !limask[x+1]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ /* lower right corner */
+ x=rw-1;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if inner mask is empty above or to the left
+ if (!limask[x+rw] || !limask[x-1]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+
+ /* Test the TOP row of pixels in buffer, except corners */
+ for (x= t-1; x>=(t-rw)+2; x--) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if inner mask is empty to the left or to the right
+ if (!limask[x-1] || !limask[x+1]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ }
+
+ /* Test the BOTTOM row of pixels in buffer, except corners */
+ for (x= rw-2; x; x--) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if inner mask is empty to the left or to the right
+ if (!limask[x-1] || !limask[x+1]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ }
+ /* Test the LEFT edge of pixels in buffer, except corners */
+ for (x= t-(rw<<1)+1; x>=rw; x-=rw) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if inner mask is empty underneath or above
+ if (!limask[x-rw] || !limask[x+rw]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ }
+
+ /* Test the RIGHT edge of pixels in buffer, except corners */
+ for (x= t-rw; x>rw; x-=rw) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if inner mask is empty underneath or above
+ if (!limask[x-rw] || !limask[x+rw]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ }
+
+ rsize[0]=isz; // fill in our return sizes for edges + fill
+ rsize[1]=osz;
+ rsize[2]=gsz;
}
static void do_allBleedBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize)
{
- int x;
- unsigned int isz=0; // inner edge size
- unsigned int osz=0; // outer edge size
- unsigned int gsz=0; // gradient fill area size
- /* Test the four corners */
- /* upper left corner */
- x=t-rw+1;
- // test if inner mask is filled
- if(limask[x]){
- // test if the inner mask is empty underneath or to the right
- if(!limask[x-rw] || !limask[x+1]){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- if(!lomask[x-rw] || !lomask[x+1]) { // test if outer mask is empty underneath or to the right
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- /* upper right corner */
- x=t;
- // test if inner mask is filled
- if(limask[x]){
- // test if the inner mask is empty underneath or to the left
- if(!limask[x-rw] || !limask[x-1]){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- if(!lomask[x-rw] || !lomask[x-1]) { // test if outer mask is empty above or to the left
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- /* lower left corner */
- x=0;
- // test if inner mask is filled
- if(limask[x]){
- // test if inner mask is empty above or to the right
- if(!limask[x+rw] || !limask[x+1]){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- if(!lomask[x+rw] || !lomask[x+1]) { // test if outer mask is empty underneath or to the right
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- /* lower right corner */
- x=rw-1;
- // test if inner mask is filled
- if(limask[x]){
- // test if inner mask is empty above or to the left
- if(!limask[x+rw] || !limask[x-1]){
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled
- if(!lomask[x+rw] || !lomask[x-1]) { // test if outer mask is empty underneath or to the left
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- /* Test the TOP row of pixels in buffer, except corners */
- for(x= t-1; x>=(t-rw)+2; x--) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if inner mask is empty to the left or to the right
- if(!limask[x-1] || !limask[x+1]) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- if(!lomask[x-1] || !lomask[x+1]) { // test if outer mask is empty to the left or to the right
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- }
-
- /* Test the BOTTOM row of pixels in buffer, except corners */
- for(x= rw-2; x; x--) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if inner mask is empty to the left or to the right
- if(!limask[x-1] || !limask[x+1]) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- if(!lomask[x-1] || !lomask[x+1]) { // test if outer mask is empty to the left or to the right
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- }
- /* Test the LEFT edge of pixels in buffer, except corners */
- for(x= t-(rw<<1)+1; x>=rw; x-=rw) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if inner mask is empty underneath or above
- if(!limask[x-rw] || !limask[x+rw]) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- if(!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- }
-
- /* Test the RIGHT edge of pixels in buffer, except corners */
- for(x= t-rw; x>rw; x-=rw) {
- // test if inner mask is filled
- if(limask[x]) {
- // test if inner mask is empty underneath or above
- if(!limask[x-rw] || !limask[x+rw]) {
- isz++; // increment inner edge size
- lres[x]=4; // flag pixel as inner edge
- } else {
- res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
- }
- } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled
- if(!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
- osz++; // increment outer edge size
- lres[x]=3; // flag pixel as outer edge
- } else {
- gsz++; // increment the gradient pixel count
- lres[x]=2; // flag pixel as gradient
- }
- }
- }
-
- rsize[0]=isz; // fill in our return sizes for edges + fill
- rsize[1]=osz;
- rsize[2]=gsz;
+ int x;
+ unsigned int isz=0; // inner edge size
+ unsigned int osz=0; // outer edge size
+ unsigned int gsz=0; // gradient fill area size
+ /* Test the four corners */
+ /* upper left corner */
+ x=t-rw+1;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if the inner mask is empty underneath or to the right
+ if (!limask[x-rw] || !limask[x+1]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x-rw] || !lomask[x+1]) { // test if outer mask is empty underneath or to the right
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ /* upper right corner */
+ x=t;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if the inner mask is empty underneath or to the left
+ if (!limask[x-rw] || !limask[x-1]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x-rw] || !lomask[x-1]) { // test if outer mask is empty above or to the left
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ /* lower left corner */
+ x=0;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if inner mask is empty above or to the right
+ if (!limask[x+rw] || !limask[x+1]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x+rw] || !lomask[x+1]) { // test if outer mask is empty underneath or to the right
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ /* lower right corner */
+ x=rw-1;
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if inner mask is empty above or to the left
+ if (!limask[x+rw] || !limask[x-1]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x+rw] || !lomask[x-1]) { // test if outer mask is empty underneath or to the left
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ /* Test the TOP row of pixels in buffer, except corners */
+ for (x= t-1; x>=(t-rw)+2; x--) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if inner mask is empty to the left or to the right
+ if (!limask[x-1] || !limask[x+1]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x-1] || !lomask[x+1]) { // test if outer mask is empty to the left or to the right
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ }
+
+ /* Test the BOTTOM row of pixels in buffer, except corners */
+ for (x= rw-2; x; x--) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if inner mask is empty to the left or to the right
+ if (!limask[x-1] || !limask[x+1]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x-1] || !lomask[x+1]) { // test if outer mask is empty to the left or to the right
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ }
+ /* Test the LEFT edge of pixels in buffer, except corners */
+ for (x= t-(rw<<1)+1; x>=rw; x-=rw) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if inner mask is empty underneath or above
+ if (!limask[x-rw] || !limask[x+rw]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ }
+
+ /* Test the RIGHT edge of pixels in buffer, except corners */
+ for (x= t-rw; x>rw; x-=rw) {
+ // test if inner mask is filled
+ if (limask[x]) {
+ // test if inner mask is empty underneath or above
+ if (!limask[x-rw] || !limask[x+rw]) {
+ isz++; // increment inner edge size
+ lres[x]=4; // flag pixel as inner edge
+ }
+ else {
+ res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge
+ }
+ }
+ else if (lomask[x]) { // inner mask was empty, test if outer mask is filled
+ if (!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above
+ osz++; // increment outer edge size
+ lres[x]=3; // flag pixel as outer edge
+ }
+ else {
+ gsz++; // increment the gradient pixel count
+ lres[x]=2; // flag pixel as gradient
+ }
+ }
+ }
+
+ rsize[0]=isz; // fill in our return sizes for edges + fill
+ rsize[1]=osz;
+ rsize[2]=gsz;
}
static void do_allEdgeDetection(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize, unsigned int in_isz, unsigned int in_osz, unsigned int in_gsz)
{
- int x; // x = pixel loop counter
- int a; // a = pixel loop counter
- int dx; // dx = delta x
- int pix_prevRow; // pix_prevRow = pixel one row behind the one we are testing in a loop
- int pix_nextRow; // pix_nextRow = pixel one row in front of the one we are testing in a loop
- int pix_prevCol; // pix_prevCol = pixel one column behind the one we are testing in a loop
- int pix_nextCol; // pix_nextCol = pixel one column in front of the one we are testing in a loop
- /* Test all rows between the FIRST and LAST rows, excluding left and right edges */
- for(x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw,dx-=rw) {
- a=x-2;
- pix_prevRow=a+rw;
- pix_nextRow=a-rw;
- pix_prevCol=a+1;
- pix_nextCol=a-1;
- while(a>dx-2) {
- if(!limask[a]) { // if the inner mask is empty
- if(lomask[a]) { // if the outer mask is full
- /*
- Next we test all 4 directions around the current pixel: next/prev/up/down
- The test ensures that the outer mask is empty and that the inner mask
- is also empty. If both conditions are true for any one of the 4 adjacent pixels
- then the current pixel is counted as being a true outer edge pixel.
- */
- if((!lomask[pix_nextCol] && !limask[pix_nextCol]) ||
- (!lomask[pix_prevCol] && !limask[pix_prevCol]) ||
- (!lomask[pix_nextRow] && !limask[pix_nextRow]) ||
- (!lomask[pix_prevRow] && !limask[pix_prevRow]))
+ int x; // x = pixel loop counter
+ int a; // a = pixel loop counter
+ int dx; // dx = delta x
+ int pix_prevRow; // pix_prevRow = pixel one row behind the one we are testing in a loop
+ int pix_nextRow; // pix_nextRow = pixel one row in front of the one we are testing in a loop
+ int pix_prevCol; // pix_prevCol = pixel one column behind the one we are testing in a loop
+ int pix_nextCol; // pix_nextCol = pixel one column in front of the one we are testing in a loop
+ /* Test all rows between the FIRST and LAST rows, excluding left and right edges */
+ for (x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw,dx-=rw) {
+ a=x-2;
+ pix_prevRow=a+rw;
+ pix_nextRow=a-rw;
+ pix_prevCol=a+1;
+ pix_nextCol=a-1;
+ while (a>dx-2) {
+ if (!limask[a]) { // if the inner mask is empty
+ if (lomask[a]) { // if the outer mask is full
+ /*
+ * Next we test all 4 directions around the current pixel: next/prev/up/down
+ * The test ensures that the outer mask is empty and that the inner mask
+ * is also empty. If both conditions are true for any one of the 4 adjacent pixels
+ * then the current pixel is counted as being a true outer edge pixel.
+ */
+ if ((!lomask[pix_nextCol] && !limask[pix_nextCol]) ||
+ (!lomask[pix_prevCol] && !limask[pix_prevCol]) ||
+ (!lomask[pix_nextRow] && !limask[pix_nextRow]) ||
+ (!lomask[pix_prevRow] && !limask[pix_prevRow]))
{
- in_osz++; // increment the outer boundary pixel count
- lres[a]=3; // flag pixel as part of outer edge
- } else { // it's not a boundary pixel, but it is a gradient pixel
- in_gsz++; // increment the gradient pixel count
- lres[a]=2; // flag pixel as gradient
- }
- }
-
- } else {
- if(!limask[pix_nextCol] || !limask[pix_prevCol] || !limask[pix_nextRow] || !limask[pix_prevRow]) {
- in_isz++; // increment the inner boundary pixel count
- lres[a]=4; // flag pixel as part of inner edge
- } else {
- res[a]=1.0f; // pixel is part of inner mask, but not at an edge
- }
- }
- a--;
- pix_prevRow--;
- pix_nextRow--;
- pix_prevCol--;
- pix_nextCol--;
- }
- }
-
- rsize[0]=in_isz; // fill in our return sizes for edges + fill
- rsize[1]=in_osz;
- rsize[2]=in_gsz;
+ in_osz++; // increment the outer boundary pixel count
+ lres[a]=3; // flag pixel as part of outer edge
+ }
+ else { // it's not a boundary pixel, but it is a gradient pixel
+ in_gsz++; // increment the gradient pixel count
+ lres[a]=2; // flag pixel as gradient
+ }
+ }
+
+ }
+ else {
+ if (!limask[pix_nextCol] || !limask[pix_prevCol] || !limask[pix_nextRow] || !limask[pix_prevRow]) {
+ in_isz++; // increment the inner boundary pixel count
+ lres[a]=4; // flag pixel as part of inner edge
+ }
+ else {
+ res[a]=1.0f; // pixel is part of inner mask, but not at an edge
+ }
+ }
+ a--;
+ pix_prevRow--;
+ pix_nextRow--;
+ pix_prevCol--;
+ pix_nextCol--;
+ }
+ }
+
+ rsize[0]=in_isz; // fill in our return sizes for edges + fill
+ rsize[1]=in_osz;
+ rsize[2]=in_gsz;
}
static void do_adjacentEdgeDetection(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize, unsigned int in_isz, unsigned int in_osz, unsigned int in_gsz)
{
- int x; // x = pixel loop counter
- int a; // a = pixel loop counter
- int dx; // dx = delta x
- int pix_prevRow; // pix_prevRow = pixel one row behind the one we are testing in a loop
- int pix_nextRow; // pix_nextRow = pixel one row in front of the one we are testing in a loop
- int pix_prevCol; // pix_prevCol = pixel one column behind the one we are testing in a loop
- int pix_nextCol; // pix_nextCol = pixel one column in front of the one we are testing in a loop
- /* Test all rows between the FIRST and LAST rows, excluding left and right edges */
- for(x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw,dx-=rw) {
- a=x-2;
- pix_prevRow=a+rw;
- pix_nextRow=a-rw;
- pix_prevCol=a+1;
- pix_nextCol=a-1;
- while(a>dx-2) {
- if(!limask[a]) { // if the inner mask is empty
- if(lomask[a]) { // if the outer mask is full
- /*
- Next we test all 4 directions around the current pixel: next/prev/up/down
- The test ensures that the outer mask is empty and that the inner mask
- is also empty. If both conditions are true for any one of the 4 adjacent pixels
- then the current pixel is counted as being a true outer edge pixel.
- */
- if((!lomask[pix_nextCol] && !limask[pix_nextCol]) ||
- (!lomask[pix_prevCol] && !limask[pix_prevCol]) ||
- (!lomask[pix_nextRow] && !limask[pix_nextRow]) ||
- (!lomask[pix_prevRow] && !limask[pix_prevRow]))
+ int x; // x = pixel loop counter
+ int a; // a = pixel loop counter
+ int dx; // dx = delta x
+ int pix_prevRow; // pix_prevRow = pixel one row behind the one we are testing in a loop
+ int pix_nextRow; // pix_nextRow = pixel one row in front of the one we are testing in a loop
+ int pix_prevCol; // pix_prevCol = pixel one column behind the one we are testing in a loop
+ int pix_nextCol; // pix_nextCol = pixel one column in front of the one we are testing in a loop
+ /* Test all rows between the FIRST and LAST rows, excluding left and right edges */
+ for (x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw,dx-=rw) {
+ a=x-2;
+ pix_prevRow=a+rw;
+ pix_nextRow=a-rw;
+ pix_prevCol=a+1;
+ pix_nextCol=a-1;
+ while (a>dx-2) {
+ if (!limask[a]) { // if the inner mask is empty
+ if (lomask[a]) { // if the outer mask is full
+ /*
+ * Next we test all 4 directions around the current pixel: next/prev/up/down
+ * The test ensures that the outer mask is empty and that the inner mask
+ * is also empty. If both conditions are true for any one of the 4 adjacent pixels
+ * then the current pixel is counted as being a true outer edge pixel.
+ */
+ if ((!lomask[pix_nextCol] && !limask[pix_nextCol]) ||
+ (!lomask[pix_prevCol] && !limask[pix_prevCol]) ||
+ (!lomask[pix_nextRow] && !limask[pix_nextRow]) ||
+ (!lomask[pix_prevRow] && !limask[pix_prevRow]))
{
- in_osz++; // increment the outer boundary pixel count
- lres[a]=3; // flag pixel as part of outer edge
- } else { // it's not a boundary pixel, but it is a gradient pixel
- in_gsz++; // increment the gradient pixel count
- lres[a]=2; // flag pixel as gradient
- }
- }
-
- } else {
- if((!limask[pix_nextCol] && lomask[pix_nextCol]) ||
- (!limask[pix_prevCol] && lomask[pix_prevCol]) ||
- (!limask[pix_nextRow] && lomask[pix_nextRow]) ||
- (!limask[pix_prevRow] && lomask[pix_prevRow]))
+ in_osz++; // increment the outer boundary pixel count
+ lres[a]=3; // flag pixel as part of outer edge
+ }
+ else { // it's not a boundary pixel, but it is a gradient pixel
+ in_gsz++; // increment the gradient pixel count
+ lres[a]=2; // flag pixel as gradient
+ }
+ }
+
+ }
+ else {
+ if ((!limask[pix_nextCol] && lomask[pix_nextCol]) ||
+ (!limask[pix_prevCol] && lomask[pix_prevCol]) ||
+ (!limask[pix_nextRow] && lomask[pix_nextRow]) ||
+ (!limask[pix_prevRow] && lomask[pix_prevRow]))
{
- in_isz++; // increment the inner boundary pixel count
- lres[a]=4; // flag pixel as part of inner edge
- } else {
- res[a]=1.0f; // pixel is part of inner mask, but not at an edge
- }
- }
- a--;
- pix_prevRow--; // advance all four "surrounding" pixel pointers
- pix_nextRow--;
- pix_prevCol--;
- pix_nextCol--;
- }
- }
-
- rsize[0]=in_isz; // fill in our return sizes for edges + fill
- rsize[1]=in_osz;
- rsize[2]=in_gsz;
+ in_isz++; // increment the inner boundary pixel count
+ lres[a]=4; // flag pixel as part of inner edge
+ }
+ else {
+ res[a]=1.0f; // pixel is part of inner mask, but not at an edge
+ }
+ }
+ a--;
+ pix_prevRow--; // advance all four "surrounding" pixel pointers
+ pix_nextRow--;
+ pix_prevCol--;
+ pix_nextCol--;
+ }
+ }
+
+ rsize[0]=in_isz; // fill in our return sizes for edges + fill
+ rsize[1]=in_osz;
+ rsize[2]=in_gsz;
}
static void do_createEdgeLocationBuffer(unsigned int t, unsigned int rw, unsigned int *lres, float *res, unsigned short *gbuf, unsigned int *innerEdgeOffset, unsigned int *outerEdgeOffset, unsigned int isz, unsigned int gsz)
{
- int x; // x = pixel loop counter
- int a; // a = temporary pixel index buffer loop counter
- unsigned int ud; // ud = unscaled edge distance
- unsigned int dmin; // dmin = minimun edge distance
-
- unsigned int rsl; // long used for finding fast 1.0/sqrt
- unsigned int gradientFillOffset;
- unsigned int innerAccum=0; // for looping inner edge pixel indexes, represents current position from offset
- unsigned int outerAccum=0; // for looping outer edge pixel indexes, represents current position from offset
- unsigned int gradientAccum=0; // for looping gradient pixel indexes, represents current position from offset
- /*
- Here we compute the size of buffer needed to hold (row,col) coordinates
- for each pixel previously determined to be either gradient, inner edge,
- or outer edge.
-
- Allocation is done by requesting 4 bytes "sizeof(int)" per pixel, even
- though gbuf[] is declared as unsigned short* (2 bytes) because we don't
- store the pixel indexes, we only store x,y location of pixel in buffer.
-
- This does make the assumption that x and y can fit in 16 unsigned bits
- so if Blender starts doing renders greater than 65536 in either direction
- this will need to allocate gbuf[] as unsigned int* and allocate 8 bytes
- per flagged pixel.
-
- In general, the buffer on-screen:
-
- Example: 9 by 9 pixel block
-
- . = pixel non-white in both outer and inner mask
- o = pixel white in outer, but not inner mask, adjacent to "." pixel
- g = pixel white in outer, but not inner mask, not adjacent to "." pixel
- i = pixel white in inner mask, adjacent to "g" or "." pixel
- F = pixel white in inner mask, only adjacent to other pixels white in the inner mask
-
-
- ......... <----- pixel #80
- ..oooo...
- .oggggo..
- .oggiggo.
- .ogiFigo.
- .oggiggo.
- .oggggo..
- ..oooo...
- pixel #00 -----> .........
-
- gsz = 18 (18 "g" pixels above)
- isz = 4 (4 "i" pixels above)
- osz = 18 (18 "o" pixels above)
-
-
- The memory in gbuf[] after filling will look like this:
-
- gradientFillOffset (0 pixels) innerEdgeOffset (18 pixels) outerEdgeOffset (22 pixels)
- / / /
- / / /
- |X Y X Y X Y X Y > <X Y X Y > <X Y X Y X Y > <X Y X Y | <- (x,y)
- +--------------------------------> <----------------> <------------------------> <----------------+
- |0 2 4 6 8 10 12 14 > ... <68 70 72 74 > ... <80 82 84 86 88 90 > ... <152 154 156 158 | <- bytes
- +--------------------------------> <----------------> <------------------------> <----------------+
- |g0 g0 g1 g1 g2 g2 g3 g3 > <g17 g17 i0 i0 > <i2 i2 i3 i3 o0 o0 > <o16 o16 o17 o17 | <- pixel
- / / /
- / / /
- / / /
- +---------- gradientAccum (18) ---------+ +--- innerAccum (22) ---+ +--- outerAccum (40) ---+
-
-
- Ultimately we do need the pixel's memory buffer index to set the output
- pixel color, but it's faster to reconstruct the memory buffer location
- each iteration of the final gradient calculation than it is to deconstruct
- a memory location into x,y pairs each round.
-*/
-
-
- gradientFillOffset=0; // since there are likely "more" of these, put it first. :)
- *innerEdgeOffset=gradientFillOffset+gsz; // set start of inner edge indexes
- *outerEdgeOffset=(*innerEdgeOffset)+isz; // set start of outer edge indexes
- /* set the accumulators to correct positions */ // set up some accumulator variables for loops
- gradientAccum = gradientFillOffset; // each accumulator variable starts at its respective
- innerAccum = *innerEdgeOffset; // section's offset so when we start filling, each
- outerAccum = *outerEdgeOffset; // section fills up it's allocated space in gbuf
- //uses dmin=row, rsl=col
- for(x=0,dmin=0; x<t; x+=rw,dmin++) {
- for(rsl=0; rsl<rw; rsl++) {
- a=x+rsl;
- if(lres[a]==2) { // it is a gradient pixel flagged by 2
- ud=gradientAccum<<1; // double the index to reach correct unsigned short location
- gbuf[ud]=dmin; // insert pixel's row into gradient pixel location buffer
- gbuf[ud+1]=rsl; // insert pixel's column into gradient pixel location buffer
- gradientAccum++; // increment gradient index buffer pointer
- } else if(lres[a]==3) { // it is an outer edge pixel flagged by 3
- ud=outerAccum<<1; // double the index to reach correct unsigned short location
- gbuf[ud]=dmin; // insert pixel's row into outer edge pixel location buffer
- gbuf[ud+1]=rsl; // insert pixel's column into outer edge pixel location buffer
- outerAccum++; // increment outer edge index buffer pointer
- res[a]=0.0f; // set output pixel intensity now since it won't change later
- } else if(lres[a]==4) { // it is an inner edge pixel flagged by 4
- ud=innerAccum<<1; // double int index to reach correct unsigned short location
- gbuf[ud]=dmin; // insert pixel's row into inner edge pixel location buffer
- gbuf[ud+1]=rsl; // insert pixel's column into inner edge pixel location buffer
- innerAccum++; // increment inner edge index buffer pointer
- res[a]=1.0f; // set output pixel intensity now since it won't change later
- }
- }
- }
+ int x; // x = pixel loop counter
+ int a; // a = temporary pixel index buffer loop counter
+ unsigned int ud; // ud = unscaled edge distance
+ unsigned int dmin; // dmin = minimun edge distance
+
+ unsigned int rsl; // long used for finding fast 1.0/sqrt
+ unsigned int gradientFillOffset;
+ unsigned int innerAccum=0; // for looping inner edge pixel indexes, represents current position from offset
+ unsigned int outerAccum=0; // for looping outer edge pixel indexes, represents current position from offset
+ unsigned int gradientAccum=0; // for looping gradient pixel indexes, represents current position from offset
+ /*
+ * Here we compute the size of buffer needed to hold (row,col) coordinates
+ * for each pixel previously determined to be either gradient, inner edge,
+ * or outer edge.
+ *
+ * Allocation is done by requesting 4 bytes "sizeof(int)" per pixel, even
+ * though gbuf[] is declared as unsigned short* (2 bytes) because we don't
+ * store the pixel indexes, we only store x,y location of pixel in buffer.
+ *
+ * This does make the assumption that x and y can fit in 16 unsigned bits
+ * so if Blender starts doing renders greater than 65536 in either direction
+ * this will need to allocate gbuf[] as unsigned int* and allocate 8 bytes
+ * per flagged pixel.
+ *
+ * In general, the buffer on-screen:
+ *
+ * Example: 9 by 9 pixel block
+ *
+ * . = pixel non-white in both outer and inner mask
+ * o = pixel white in outer, but not inner mask, adjacent to "." pixel
+ * g = pixel white in outer, but not inner mask, not adjacent to "." pixel
+ * i = pixel white in inner mask, adjacent to "g" or "." pixel
+ * F = pixel white in inner mask, only adjacent to other pixels white in the inner mask
+ *
+ *
+ * ......... <----- pixel #80
+ * ..oooo...
+ * .oggggo..
+ * .oggiggo.
+ * .ogiFigo.
+ * .oggiggo.
+ * .oggggo..
+ * ..oooo...
+ * pixel #00 -----> .........
+ *
+ * gsz = 18 (18 "g" pixels above)
+ * isz = 4 (4 "i" pixels above)
+ * osz = 18 (18 "o" pixels above)
+ *
+ *
+ * The memory in gbuf[] after filling will look like this:
+ *
+ * gradientFillOffset (0 pixels) innerEdgeOffset (18 pixels) outerEdgeOffset (22 pixels)
+ * / / /
+ * / / /
+ * |X Y X Y X Y X Y > <X Y X Y > <X Y X Y X Y > <X Y X Y | <- (x,y)
+ * +--------------------------------> <----------------> <------------------------> <----------------+
+ * |0 2 4 6 8 10 12 14 > ... <68 70 72 74 > ... <80 82 84 86 88 90 > ... <152 154 156 158 | <- bytes
+ * +--------------------------------> <----------------> <------------------------> <----------------+
+ * |g0 g0 g1 g1 g2 g2 g3 g3 > <g17 g17 i0 i0 > <i2 i2 i3 i3 o0 o0 > <o16 o16 o17 o17 | <- pixel
+ * / / /
+ * / / /
+ * / / /
+ * +---------- gradientAccum (18) ---------+ +--- innerAccum (22) ---+ +--- outerAccum (40) ---+
+ *
+ *
+ * Ultimately we do need the pixel's memory buffer index to set the output
+ * pixel color, but it's faster to reconstruct the memory buffer location
+ * each iteration of the final gradient calculation than it is to deconstruct
+ * a memory location into x,y pairs each round.
+ */
+
+
+ gradientFillOffset=0; // since there are likely "more" of these, put it first. :)
+ *innerEdgeOffset=gradientFillOffset+gsz; // set start of inner edge indexes
+ *outerEdgeOffset=(*innerEdgeOffset)+isz; // set start of outer edge indexes
+ /* set the accumulators to correct positions */ // set up some accumulator variables for loops
+ gradientAccum = gradientFillOffset; // each accumulator variable starts at its respective
+ innerAccum = *innerEdgeOffset; // section's offset so when we start filling, each
+ outerAccum = *outerEdgeOffset; // section fills up it's allocated space in gbuf
+ //uses dmin=row, rsl=col
+ for (x=0,dmin=0; x<t; x+=rw,dmin++) {
+ for (rsl=0; rsl<rw; rsl++) {
+ a=x+rsl;
+ if (lres[a]==2) { // it is a gradient pixel flagged by 2
+ ud=gradientAccum<<1; // double the index to reach correct unsigned short location
+ gbuf[ud]=dmin; // insert pixel's row into gradient pixel location buffer
+ gbuf[ud+1]=rsl; // insert pixel's column into gradient pixel location buffer
+ gradientAccum++; // increment gradient index buffer pointer
+ }
+ else if (lres[a]==3) { // it is an outer edge pixel flagged by 3
+ ud=outerAccum<<1; // double the index to reach correct unsigned short location
+ gbuf[ud]=dmin; // insert pixel's row into outer edge pixel location buffer
+ gbuf[ud+1]=rsl; // insert pixel's column into outer edge pixel location buffer
+ outerAccum++; // increment outer edge index buffer pointer
+ res[a]=0.0f; // set output pixel intensity now since it won't change later
+ }
+ else if (lres[a]==4) { // it is an inner edge pixel flagged by 4
+ ud=innerAccum<<1; // double int index to reach correct unsigned short location
+ gbuf[ud]=dmin; // insert pixel's row into inner edge pixel location buffer
+ gbuf[ud+1]=rsl; // insert pixel's column into inner edge pixel location buffer
+ innerAccum++; // increment inner edge index buffer pointer
+ res[a]=1.0f; // set output pixel intensity now since it won't change later
+ }
+ }
+ }
}
static void do_fillGradientBuffer(unsigned int rw, float *res, unsigned short *gbuf, unsigned int isz, unsigned int osz, unsigned int gsz, unsigned int innerEdgeOffset, unsigned int outerEdgeOffset)
{
- int x; // x = pixel loop counter
- int a; // a = temporary pixel index buffer loop counter
- int fsz; // size of the frame
- unsigned int rsl; // long used for finding fast 1.0/sqrt
- float rsf; // float used for finding fast 1.0/sqrt
- const float rsopf = 1.5f; // constant float used for finding fast 1.0/sqrt
-
- unsigned int gradientFillOffset;
- unsigned int t;
- unsigned int ud; // ud = unscaled edge distance
- unsigned int dmin; // dmin = minimun edge distance
- float odist; // odist = current outer edge distance
- float idist; // idist = current inner edge distance
- int dx; // dx = X-delta (used for distance proportion calculation)
- int dy; // dy = Y-delta (used for distance proportion calculation)
-
- /*
- The general algorithm used to color each gradient pixel is:
-
- 1.) Loop through all gradient pixels.
- A.) For each gradient pixel:
- a.) Loop though all outside edge pixels, looking for closest one
- to the gradient pixel we are in.
- b.) Loop through all inside edge pixels, looking for closest one
- to the gradient pixel we are in.
- c.) Find proportion of distance from gradient pixel to inside edge
- pixel compared to sum of distance to inside edge and distance to
- outside edge.
-
- In an image where:
- . = blank (black) pixels, not covered by inner mask or outer mask
- + = desired gradient pixels, covered only by outer mask
- * = white full mask pixels, covered by at least inner mask
-
- ...............................
- ...............+++++++++++.....
- ...+O++++++..++++++++++++++....
- ..+++\++++++++++++++++++++.....
- .+++++G+++++++++*******+++.....
- .+++++|+++++++*********+++.....
- .++***I****************+++.....
- .++*******************+++......
- .+++*****************+++.......
- ..+++***************+++........
- ....+++**********+++...........
- ......++++++++++++.............
- ...............................
-
- O = outside edge pixel
- \
- G = gradient pixel
- |
- I = inside edge pixel
-
- __
- *note that IO does not need to be a straight line, in fact
- many cases can arise where straight lines do not work
- correctly.
-
- __ __ __
- d.) Pixel color is assigned as |GO| / ( |GI| + |GO| )
-
- The implementation does not compute distance, but the reciprocal of the
- distance. This is done to avoid having to compute a square root, as a
- reciprocal square root can be computed faster. Therefore, the code computes
- pixel color as |GI| / (|GI| + |GO|). Since these are reciprocals, GI serves the
- purpose of GO for the proportion calculation.
-
- For the purposes of the minimun distance comparisons, we only check
- the sums-of-squares against eachother, since they are in the same
- mathematical sort-order as if we did go ahead and take square roots
-
- Loop through all gradient pixels.
- */
-
- for(x= gsz-1; x>=0; x--) {
- gradientFillOffset=x<<1;
- t=gbuf[gradientFillOffset]; // calculate column of pixel indexed by gbuf[x]
- fsz=gbuf[gradientFillOffset+1]; // calculate row of pixel indexed by gbuf[x]
- dmin=0xffffffff; // reset min distance to edge pixel
- for(a=outerEdgeOffset+osz-1; a>=outerEdgeOffset; a--) { // loop through all outer edge buffer pixels
- ud=a<<1;
- dy=t-gbuf[ud]; // set dx to gradient pixel column - outer edge pixel row
- dx=fsz-gbuf[ud+1]; // set dy to gradient pixel row - outer edge pixel column
- ud=dx*dx+dy*dy; // compute sum of squares
- if(ud<dmin) { // if our new sum of squares is less than the current minimum
- dmin=ud; // set a new minimum equal to the new lower value
- }
- }
- odist=(float)(dmin); // cast outer min to a float
- rsf=odist*0.5f; //
- rsl=*(unsigned int*)&odist; // use some peculiar properties of the way bits are stored
- rsl=0x5f3759df-(rsl>>1); // in floats vs. unsigned ints to compute an approximate
- odist=*(float*)&rsl; // reciprocal square root
- odist=odist*(rsopf-(rsf*odist*odist)); // -- ** this line can be iterated for more accuracy ** --
- dmin=0xffffffff; // reset min distance to edge pixel
- for(a= innerEdgeOffset+isz-1; a>=innerEdgeOffset; a--) { // loop through all inside edge pixels
- ud=a<<1;
- dy=t-gbuf[ud]; // compute delta in Y from gradient pixel to inside edge pixel
- dx=fsz-gbuf[ud+1]; // compute delta in X from gradient pixel to inside edge pixel
- ud=dx*dx+dy*dy; // compute sum of squares
- if(ud<dmin) { // if our new sum of squares is less than the current minimum we've found
- dmin=ud; // set a new minimum equal to the new lower value
- }
- }
- idist=(float)(dmin); // cast inner min to a float
- rsf=idist*0.5f; //
- rsl=*(unsigned int*)&idist; //
- rsl=0x5f3759df-(rsl>>1); // see notes above
- idist=*(float*)&rsl; //
- idist=idist*(rsopf-(rsf*idist*idist)); //
- /*
- Note once again that since we are using reciprocals of distance values our
- proportion is already the correct intensity, and does not need to be
- subracted from 1.0 like it would have if we used real distances.
- */
-
- /*
- Here we reconstruct the pixel's memory location in the CompBuf by
- Pixel Index = Pixel Column + ( Pixel Row * Row Width )
- */
- res[gbuf[gradientFillOffset+1]+(gbuf[gradientFillOffset]*rw)]=(idist/(idist+odist)); //set intensity
- }
+ int x; // x = pixel loop counter
+ int a; // a = temporary pixel index buffer loop counter
+ int fsz; // size of the frame
+ unsigned int rsl; // long used for finding fast 1.0/sqrt
+ float rsf; // float used for finding fast 1.0/sqrt
+ const float rsopf = 1.5f; // constant float used for finding fast 1.0/sqrt
+
+ unsigned int gradientFillOffset;
+ unsigned int t;
+ unsigned int ud; // ud = unscaled edge distance
+ unsigned int dmin; // dmin = minimun edge distance
+ float odist; // odist = current outer edge distance
+ float idist; // idist = current inner edge distance
+ int dx; // dx = X-delta (used for distance proportion calculation)
+ int dy; // dy = Y-delta (used for distance proportion calculation)
+ /*
+ * The general algorithm used to color each gradient pixel is:
+ *
+ * 1.) Loop through all gradient pixels.
+ * A.) For each gradient pixel:
+ * a.) Loop though all outside edge pixels, looking for closest one
+ * to the gradient pixel we are in.
+ * b.) Loop through all inside edge pixels, looking for closest one
+ * to the gradient pixel we are in.
+ * c.) Find proportion of distance from gradient pixel to inside edge
+ * pixel compared to sum of distance to inside edge and distance to
+ * outside edge.
+ *
+ * In an image where:
+ * . = blank (black) pixels, not covered by inner mask or outer mask
+ * + = desired gradient pixels, covered only by outer mask
+ * * = white full mask pixels, covered by at least inner mask
+ *
+ * ...............................
+ * ...............+++++++++++.....
+ * ...+O++++++..++++++++++++++....
+ * ..+++\++++++++++++++++++++.....
+ * .+++++G+++++++++*******+++.....
+ * .+++++|+++++++*********+++.....
+ * .++***I****************+++.....
+ * .++*******************+++......
+ * .+++*****************+++.......
+ * ..+++***************+++........
+ * ....+++**********+++...........
+ * ......++++++++++++.............
+ * ...............................
+ *
+ * O = outside edge pixel
+ * \
+ * G = gradient pixel
+ * |
+ * I = inside edge pixel
+ *
+ * __
+ * *note that IO does not need to be a straight line, in fact
+ * many cases can arise where straight lines do not work
+ * correctly.
+ *
+ * __ __ __
+ * d.) Pixel color is assigned as |GO| / ( |GI| + |GO| )
+ *
+ * The implementation does not compute distance, but the reciprocal of the
+ * distance. This is done to avoid having to compute a square root, as a
+ * reciprocal square root can be computed faster. Therefore, the code computes
+ * pixel color as |GI| / (|GI| + |GO|). Since these are reciprocals, GI serves the
+ * purpose of GO for the proportion calculation.
+ *
+ * For the purposes of the minimun distance comparisons, we only check
+ * the sums-of-squares against each other, since they are in the same
+ * mathematical sort-order as if we did go ahead and take square roots
+ *
+ * Loop through all gradient pixels.
+ */
+
+ for (x= gsz-1; x>=0; x--) {
+ gradientFillOffset=x<<1;
+ t=gbuf[gradientFillOffset]; // calculate column of pixel indexed by gbuf[x]
+ fsz=gbuf[gradientFillOffset+1]; // calculate row of pixel indexed by gbuf[x]
+ dmin=0xffffffff; // reset min distance to edge pixel
+ for (a=outerEdgeOffset+osz-1; a>=outerEdgeOffset; a--) { // loop through all outer edge buffer pixels
+ ud=a<<1;
+ dy=t-gbuf[ud]; // set dx to gradient pixel column - outer edge pixel row
+ dx=fsz-gbuf[ud+1]; // set dy to gradient pixel row - outer edge pixel column
+ ud=dx*dx+dy*dy; // compute sum of squares
+ if (ud<dmin) { // if our new sum of squares is less than the current minimum
+ dmin=ud; // set a new minimum equal to the new lower value
+ }
+ }
+ odist=(float)(dmin); // cast outer min to a float
+ rsf=odist*0.5f; //
+ rsl=*(unsigned int*)&odist; // use some peculiar properties of the way bits are stored
+ rsl=0x5f3759df-(rsl>>1); // in floats vs. unsigned ints to compute an approximate
+ odist=*(float*)&rsl; // reciprocal square root
+ odist=odist*(rsopf-(rsf*odist*odist)); // -- ** this line can be iterated for more accuracy ** --
+ dmin=0xffffffff; // reset min distance to edge pixel
+ for (a= innerEdgeOffset+isz-1; a>=innerEdgeOffset; a--) { // loop through all inside edge pixels
+ ud=a<<1;
+ dy=t-gbuf[ud]; // compute delta in Y from gradient pixel to inside edge pixel
+ dx=fsz-gbuf[ud+1]; // compute delta in X from gradient pixel to inside edge pixel
+ ud=dx*dx+dy*dy; // compute sum of squares
+ if (ud<dmin) { // if our new sum of squares is less than the current minimum we've found
+ dmin=ud; // set a new minimum equal to the new lower value
+ }
+ }
+ idist=(float)(dmin); // cast inner min to a float
+ rsf=idist*0.5f; //
+ rsl=*(unsigned int*)&idist; //
+ rsl=0x5f3759df-(rsl>>1); // see notes above
+ idist=*(float*)&rsl; //
+ idist=idist*(rsopf-(rsf*idist*idist)); //
+ /*
+ * Note once again that since we are using reciprocals of distance values our
+ * proportion is already the correct intensity, and does not need to be
+ * subracted from 1.0 like it would have if we used real distances.
+ */
+
+ /*
+ * Here we reconstruct the pixel's memory location in the CompBuf by
+ * Pixel Index = Pixel Column + ( Pixel Row * Row Width )
+ */
+ res[gbuf[gradientFillOffset+1]+(gbuf[gradientFillOffset]*rw)]=(idist/(idist+odist)); //set intensity
+ }
}
@@ -1059,136 +1146,139 @@ static void do_fillGradientBuffer(unsigned int rw, float *res, unsigned short *g
static void node_composit_exec_doubleedgemask(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
{
- float *imask; // imask = pointer to inner mask pixel buffer
- float *omask; // omask = pointer to outer mask pixel buffer
- float *res; // res = pointer to output mask
-
- unsigned int *lres; // lres = unsigned int pointer to output pixel buffer (for bit operations)
- unsigned int *limask; // limask = unsigned int pointer to inner mask (for bit operations)
- unsigned int *lomask; // lomask = unsigned int pointer to outer mask (for bit operations)
-
- int rw; // rw = pixel row width
- int t; // t = total number of pixels in buffer - 1 (used for loop starts)
- int fsz; // size of the frame
-
- unsigned int isz=0; // size (in pixels) of inside edge pixel index buffer
- unsigned int osz=0; // size (in pixels) of outside edge pixel index buffer
- unsigned int gsz=0; // size (in pixels) of gradient pixel index buffer
- unsigned int rsize[3]; // size storage to pass to helper functions
- unsigned int innerEdgeOffset=0; // offset into final buffer where inner edge pixel indexes start
- unsigned int outerEdgeOffset=0; // offset into final buffer where outer edge pixel indexes start
-
- unsigned short *gbuf; // gradient/inner/outer pixel location index buffer
-
- CompBuf *cbuf; // pointer, will be set to inner mask data
- CompBuf *dbuf; // pointer, will be set to outer mask data
- CompBuf *stackbuf; // pointer, will get allocated as output buffer
-
- if(out[0]->hasoutput==0) { // if the node's output socket is not connected to anything...
- return; // do not execute any further, just exit the node immediately
- }
-
- if(in[0]->data && in[1]->data) { // if both input sockets have some data coming in...
- cbuf= in[0]->data; // get a pointer to the inner mask data
- dbuf= in[1]->data; // get a pointer to the outer mask data
- if(cbuf->type!=CB_VAL || dbuf->type!=CB_VAL) { // if either input socket has an incorrect data type coming in
- return; // exit the node immediately
- }
-
- t=(cbuf->x*cbuf->y)-1; // determine size of the frame
-
- stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); // allocate the output buffer
-
- imask= cbuf->rect; // set the inner mask
- omask= dbuf->rect; // set the outer mask
- res= stackbuf->rect; // set output pointer
- lres= (unsigned int*)res; // unsigned int pointer to output buffer (for bit level ops)
- limask=(unsigned int*)imask; // unsigned int pointer to input mask (for bit level ops)
- lomask=(unsigned int*)omask; // unsigned int pointer to output mask (for bit level ops)
- rw= cbuf->x; // width of a row of pixels
-
-
- /*
- The whole buffer is broken up into 4 parts. The four CORNERS, the FIRST and LAST rows, the
- LEFT and RIGHT edges (excluding the corner pixels), and all OTHER rows.
- This allows for quick computation of outer edge pixels where
- a screen edge pixel is marked to be gradient.
-
- The pixel type (gradient vs inner-edge vs outer-edge) tests change
- depending on the user selected "Inner Edge Mode" and the user selected
- "Buffer Edge Mode" on the node's GUI. There are 4 sets of basically the
- same algorithm:
-
- 1.) Inner Edge -> Adjacent Only
- Buffer Edge -> Keep Inside
-
- 2.) Inner Edge -> Adjacent Only
- Buffer Edge -> Bleed Out
-
- 3.) Inner Edge -> All
- Buffer Edge -> Keep Inside
-
- 4.) Inner Edge -> All
- Buffer Edge -> Bleed Out
-
- Each version has slightly different criteria for detecting an edge pixel.
- */
- if(node->custom2) { // if "adjacent only" inner edge mode is turned on
- if(node->custom1) { // if "keep inside" buffer edge mode is turned on
- do_adjacentKeepBorders(t,rw,limask,lomask,lres,res,rsize);
- }else{ // "bleed out" buffer edge mode is turned on
- do_adjacentBleedBorders(t,rw,limask,lomask,lres,res,rsize);
- }
- isz=rsize[0]; // set up inner edge, outer edge, and gradient buffer sizes after border pass
- osz=rsize[1];
- gsz=rsize[2];
- // detect edges in all non-border pixels in the buffer
- do_adjacentEdgeDetection(t,rw,limask,lomask,lres,res,rsize,isz,osz,gsz);
- }else{ // "all" inner edge mode is turned on
- if(node->custom1) { // if "keep inside" buffer edge mode is turned on
- do_allKeepBorders(t,rw,limask,lomask,lres,res,rsize);
- }else{ // "bleed out" buffer edge mode is turned on
- do_allBleedBorders(t,rw,limask,lomask,lres,res,rsize);
- }
- isz=rsize[0]; // set up inner edge, outer edge, and gradient buffer sizes after border pass
- osz=rsize[1];
- gsz=rsize[2];
- // detect edges in all non-border pixels in the buffer
- do_allEdgeDetection(t,rw,limask,lomask,lres,res,rsize,isz,osz,gsz);
- }
-
- isz=rsize[0]; // set edge and gradient buffer sizes once again...
- osz=rsize[1]; // the sizes in rsize[] may have been modified
- gsz=rsize[2]; // by the do_*EdgeDetection() function.
-
- // quick check for existance of edges in the buffer...
- // if we don't have any one of the three sizes, the other two make no difference visually,
- // so we can just pass the inner input buffer back as output.
- if(!gsz || !isz || !osz) {
- out[0]->data= stackbuf; // point the node output buffer to our filled buffer
- return;
- }
-
-
- fsz=gsz+isz+osz; // calculate size of pixel index buffer needed
- gbuf= MEM_mallocN(fsz*sizeof(int), "grd buf"); // allocate edge/gradient pixel index buffer
-
- do_createEdgeLocationBuffer(t,rw,lres,res,gbuf,&innerEdgeOffset,&outerEdgeOffset,isz,gsz);
- do_fillGradientBuffer(rw,res,gbuf,isz,osz,gsz,innerEdgeOffset,outerEdgeOffset);
-
- MEM_freeN(gbuf); // free the gradient index buffer
- out[0]->data= stackbuf; // point the node output buffer to our filled buffer
- }
+ float *imask; // imask = pointer to inner mask pixel buffer
+ float *omask; // omask = pointer to outer mask pixel buffer
+ float *res; // res = pointer to output mask
+
+ unsigned int *lres; // lres = unsigned int pointer to output pixel buffer (for bit operations)
+ unsigned int *limask; // limask = unsigned int pointer to inner mask (for bit operations)
+ unsigned int *lomask; // lomask = unsigned int pointer to outer mask (for bit operations)
+
+ int rw; // rw = pixel row width
+ int t; // t = total number of pixels in buffer - 1 (used for loop starts)
+ int fsz; // size of the frame
+
+ unsigned int isz=0; // size (in pixels) of inside edge pixel index buffer
+ unsigned int osz=0; // size (in pixels) of outside edge pixel index buffer
+ unsigned int gsz=0; // size (in pixels) of gradient pixel index buffer
+ unsigned int rsize[3]; // size storage to pass to helper functions
+ unsigned int innerEdgeOffset=0; // offset into final buffer where inner edge pixel indexes start
+ unsigned int outerEdgeOffset=0; // offset into final buffer where outer edge pixel indexes start
+
+ unsigned short *gbuf; // gradient/inner/outer pixel location index buffer
+
+ CompBuf *cbuf; // pointer, will be set to inner mask data
+ CompBuf *dbuf; // pointer, will be set to outer mask data
+ CompBuf *stackbuf; // pointer, will get allocated as output buffer
+
+ if (out[0]->hasoutput==0) { // if the node's output socket is not connected to anything...
+ return; // do not execute any further, just exit the node immediately
+ }
+
+ if (in[0]->data && in[1]->data) { // if both input sockets have some data coming in...
+ cbuf= in[0]->data; // get a pointer to the inner mask data
+ dbuf= in[1]->data; // get a pointer to the outer mask data
+ if (cbuf->type!=CB_VAL || dbuf->type!=CB_VAL) { // if either input socket has an incorrect data type coming in
+ return; // exit the node immediately
+ }
+
+ t=(cbuf->x*cbuf->y)-1; // determine size of the frame
+
+ stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); // allocate the output buffer
+
+ imask= cbuf->rect; // set the inner mask
+ omask= dbuf->rect; // set the outer mask
+ res= stackbuf->rect; // set output pointer
+ lres= (unsigned int*)res; // unsigned int pointer to output buffer (for bit level ops)
+ limask=(unsigned int*)imask; // unsigned int pointer to input mask (for bit level ops)
+ lomask=(unsigned int*)omask; // unsigned int pointer to output mask (for bit level ops)
+ rw= cbuf->x; // width of a row of pixels
+
+
+ /*
+ * The whole buffer is broken up into 4 parts. The four CORNERS, the FIRST and LAST rows, the
+ * LEFT and RIGHT edges (excluding the corner pixels), and all OTHER rows.
+ * This allows for quick computation of outer edge pixels where
+ * a screen edge pixel is marked to be gradient.
+ *
+ * The pixel type (gradient vs inner-edge vs outer-edge) tests change
+ * depending on the user selected "Inner Edge Mode" and the user selected
+ * "Buffer Edge Mode" on the node's GUI. There are 4 sets of basically the
+ * same algorithm:
+ *
+ * 1.) Inner Edge -> Adjacent Only
+ * Buffer Edge -> Keep Inside
+ *
+ * 2.) Inner Edge -> Adjacent Only
+ * Buffer Edge -> Bleed Out
+ *
+ * 3.) Inner Edge -> All
+ * Buffer Edge -> Keep Inside
+ *
+ * 4.) Inner Edge -> All
+ * Buffer Edge -> Bleed Out
+ *
+ * Each version has slightly different criteria for detecting an edge pixel.
+ */
+ if (node->custom2) { // if "adjacent only" inner edge mode is turned on
+ if (node->custom1) { // if "keep inside" buffer edge mode is turned on
+ do_adjacentKeepBorders(t,rw,limask,lomask,lres,res,rsize);
+ }
+ else { // "bleed out" buffer edge mode is turned on
+ do_adjacentBleedBorders(t,rw,limask,lomask,lres,res,rsize);
+ }
+ isz=rsize[0]; // set up inner edge, outer edge, and gradient buffer sizes after border pass
+ osz=rsize[1];
+ gsz=rsize[2];
+ // detect edges in all non-border pixels in the buffer
+ do_adjacentEdgeDetection(t,rw,limask,lomask,lres,res,rsize,isz,osz,gsz);
+ }
+ else { // "all" inner edge mode is turned on
+ if (node->custom1) { // if "keep inside" buffer edge mode is turned on
+ do_allKeepBorders(t,rw,limask,lomask,lres,res,rsize);
+ }
+ else { // "bleed out" buffer edge mode is turned on
+ do_allBleedBorders(t,rw,limask,lomask,lres,res,rsize);
+ }
+ isz=rsize[0]; // set up inner edge, outer edge, and gradient buffer sizes after border pass
+ osz=rsize[1];
+ gsz=rsize[2];
+ // detect edges in all non-border pixels in the buffer
+ do_allEdgeDetection(t,rw,limask,lomask,lres,res,rsize,isz,osz,gsz);
+ }
+
+ isz=rsize[0]; // set edge and gradient buffer sizes once again...
+ osz=rsize[1]; // the sizes in rsize[] may have been modified
+ gsz=rsize[2]; // by the do_*EdgeDetection() function.
+
+ // quick check for existance of edges in the buffer...
+ // if we don't have any one of the three sizes, the other two make no difference visually,
+ // so we can just pass the inner input buffer back as output.
+ if (!gsz || !isz || !osz) {
+ out[0]->data= stackbuf; // point the node output buffer to our filled buffer
+ return;
+ }
+
+
+ fsz=gsz+isz+osz; // calculate size of pixel index buffer needed
+ gbuf= MEM_mallocN(fsz*sizeof(int), "grd buf"); // allocate edge/gradient pixel index buffer
+
+ do_createEdgeLocationBuffer(t,rw,lres,res,gbuf,&innerEdgeOffset,&outerEdgeOffset,isz,gsz);
+ do_fillGradientBuffer(rw,res,gbuf,isz,osz,gsz,innerEdgeOffset,outerEdgeOffset);
+
+ MEM_freeN(gbuf); // free the gradient index buffer
+ out[0]->data= stackbuf; // point the node output buffer to our filled buffer
+ }
}
void register_node_type_cmp_doubleedgemask(bNodeTreeType *ttype)
{
- static bNodeType ntype; // allocate a node type data structure
+ static bNodeType ntype; // allocate a node type data structure
- node_type_base(ttype, &ntype, CMP_NODE_DOUBLEEDGEMASK, "Double Edge Mask", NODE_CLASS_MATTE, NODE_OPTIONS);
- node_type_socket_templates(&ntype, cmp_node_doubleedgemask_in, cmp_node_doubleedgemask_out);
- node_type_size(&ntype, 210, 210, 210);
- node_type_exec(&ntype, node_composit_exec_doubleedgemask);
+ node_type_base(ttype, &ntype, CMP_NODE_DOUBLEEDGEMASK, "Double Edge Mask", NODE_CLASS_MATTE, NODE_OPTIONS);
+ node_type_socket_templates(&ntype, cmp_node_doubleedgemask_in, cmp_node_doubleedgemask_out);
+ node_type_size(&ntype, 210, 210, 210);
+ node_type_exec(&ntype, node_composit_exec_doubleedgemask);
- nodeRegisterType(ttype, &ntype);
+ nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_filter.c b/source/blender/nodes/composite/nodes/node_composite_filter.c
index 94a109de8f2..6d470467cb0 100644
--- a/source/blender/nodes/composite/nodes/node_composite_filter.c
+++ b/source/blender/nodes/composite/nodes/node_composite_filter.c
@@ -51,24 +51,24 @@ static void do_filter_edge(CompBuf *out, CompBuf *in, float *filter, float fac)
rowlen= in->x;
- for(y=0; y<in->y; y++) {
+ for (y=0; y<in->y; y++) {
/* setup rows */
- if(y==0) row1= in->rect;
+ if (y==0) row1= in->rect;
else row1= in->rect + pix*(y-1)*rowlen;
row2= in->rect + y*pix*rowlen;
- if(y==in->y-1) row3= row2;
+ if (y==in->y-1) row3= row2;
else row3= row2 + pix*rowlen;
fp= out->rect + pix*y*rowlen;
- if(pix==CB_RGBA) {
+ if (pix==CB_RGBA) {
copy_v4_v4(fp, row2);
fp+= pix;
- for(x=2; x<rowlen; x++) {
- for(c=0; c<3; c++) {
+ for (x=2; x<rowlen; x++) {
+ for (c=0; c<3; c++) {
f1= filter[0]*row1[0] + filter[1]*row1[4] + filter[2]*row1[8] + filter[3]*row2[0] + filter[4]*row2[4] + filter[5]*row2[8] + filter[6]*row3[0] + filter[7]*row3[4] + filter[8]*row3[8];
f2= filter[0]*row1[0] + filter[3]*row1[4] + filter[6]*row1[8] + filter[1]*row2[0] + filter[4]*row2[4] + filter[7]*row2[8] + filter[2]*row3[0] + filter[5]*row3[4] + filter[8]*row3[8];
fp[0]= mfac*row2[4] + fac*sqrt(f1*f1 + f2*f2);
@@ -80,9 +80,9 @@ static void do_filter_edge(CompBuf *out, CompBuf *in, float *filter, float fac)
}
copy_v4_v4(fp, row2+4);
}
- else if(pix==CB_VAL) {
+ else if (pix==CB_VAL) {
fp+= pix;
- for(x=2; x<rowlen; x++) {
+ for (x=2; x<rowlen; x++) {
f1= filter[0]*row1[0] + filter[1]*row1[1] + filter[2]*row1[2] + filter[3]*row2[0] + filter[4]*row2[1] + filter[5]*row2[2] + filter[6]*row3[0] + filter[7]*row3[1] + filter[8]*row3[2];
f2= filter[0]*row1[0] + filter[3]*row1[1] + filter[6]*row1[2] + filter[1]*row2[0] + filter[4]*row2[1] + filter[7]*row2[2] + filter[2]*row3[0] + filter[5]*row3[1] + filter[8]*row3[2];
fp[0]= mfac*row2[1] + fac*sqrt(f1*f1 + f2*f2);
@@ -101,35 +101,35 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac)
rowlen= in->x;
- for(y=0; y<in->y; y++) {
+ for (y=0; y<in->y; y++) {
/* setup rows */
- if(y==0) row1= in->rect;
+ if (y==0) row1= in->rect;
else row1= in->rect + pixlen*(y-1)*rowlen;
row2= in->rect + y*pixlen*rowlen;
- if(y==in->y-1) row3= row2;
+ if (y==in->y-1) row3= row2;
else row3= row2 + pixlen*rowlen;
fp= out->rect + pixlen*(y)*rowlen;
- if(pixlen==1) {
+ if (pixlen==1) {
fp[0]= row2[0];
fp+= 1;
- for(x=2; x<rowlen; x++) {
+ for (x=2; x<rowlen; x++) {
fp[0]= mfac*row2[1] + fac*(filter[0]*row1[0] + filter[1]*row1[1] + filter[2]*row1[2] + filter[3]*row2[0] + filter[4]*row2[1] + filter[5]*row2[2] + filter[6]*row3[0] + filter[7]*row3[1] + filter[8]*row3[2]);
fp++; row1++; row2++; row3++;
}
fp[0]= row2[1];
}
- else if(pixlen==2) {
+ else if (pixlen==2) {
fp[0]= row2[0];
fp[1]= row2[1];
fp+= 2;
- for(x=2; x<rowlen; x++) {
- for(c=0; c<2; c++) {
+ for (x=2; x<rowlen; x++) {
+ for (c=0; c<2; c++) {
fp[0]= mfac*row2[2] + fac*(filter[0]*row1[0] + filter[1]*row1[2] + filter[2]*row1[4] + filter[3]*row2[0] + filter[4]*row2[2] + filter[5]*row2[4] + filter[6]*row3[0] + filter[7]*row3[2] + filter[8]*row3[4]);
fp++; row1++; row2++; row3++;
}
@@ -137,12 +137,12 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac)
fp[0]= row2[2];
fp[1]= row2[3];
}
- else if(pixlen==3) {
+ else if (pixlen==3) {
copy_v3_v3(fp, row2);
fp+= 3;
- for(x=2; x<rowlen; x++) {
- for(c=0; c<3; c++) {
+ for (x=2; x<rowlen; x++) {
+ for (c=0; c<3; c++) {
fp[0]= mfac*row2[3] + fac*(filter[0]*row1[0] + filter[1]*row1[3] + filter[2]*row1[6] + filter[3]*row2[0] + filter[4]*row2[3] + filter[5]*row2[6] + filter[6]*row3[0] + filter[7]*row3[3] + filter[8]*row3[6]);
fp++; row1++; row2++; row3++;
}
@@ -153,8 +153,8 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac)
copy_v4_v4(fp, row2);
fp+= 4;
- for(x=2; x<rowlen; x++) {
- for(c=0; c<4; c++) {
+ for (x=2; x<rowlen; x++) {
+ for (c=0; c<4; c++) {
fp[0]= mfac*row2[4] + fac*(filter[0]*row1[0] + filter[1]*row1[4] + filter[2]*row1[8] + filter[3]*row2[0] + filter[4]*row2[4] + filter[5]*row2[8] + filter[6]*row3[0] + filter[7]*row3[4] + filter[8]*row3[8]);
fp++; row1++; row2++; row3++;
}
@@ -175,12 +175,12 @@ static void node_composit_exec_filter(void *data, bNode *node, bNodeStack **in,
float kirsch[9]= {5,5,5,-3,-3,-3,-2,-2,-2};
float shadow[9]= {1,2,1,0,1,0,-1,-2,-1};
- if(out[0]->hasoutput==0) return;
+ if (out[0]->hasoutput==0) return;
/* stack order in: Image */
/* stack order out: Image */
- if(in[1]->data) {
+ if (in[1]->data) {
/* make output size of first available input image */
CompBuf *cbuf= in[1]->data;
CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, cbuf->type, 1); /* allocs */
diff --git a/source/blender/nodes/composite/nodes/node_composite_flip.c b/source/blender/nodes/composite/nodes/node_composite_flip.c
index 974a14037eb..3c297299edc 100644
--- a/source/blender/nodes/composite/nodes/node_composite_flip.c
+++ b/source/blender/nodes/composite/nodes/node_composite_flip.c
@@ -45,7 +45,7 @@ static bNodeSocketTemplate cmp_node_flip_out[]= {
static void node_composit_exec_flip(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
{
- if(in[0]->data) {
+ if (in[0]->data) {
CompBuf *cbuf= in[0]->data;
CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, cbuf->type, 1); /* note, this returns zero'd image */
int i, src_pix, src_width, src_height, srcydelt, outydelt, x, y;
@@ -59,20 +59,20 @@ static void node_composit_exec_flip(void *UNUSED(data), bNode *node, bNodeStack
srcydelt= src_width*src_pix;
outydelt= srcydelt;
- if(node->custom1) { /*set up output pointer for y flip*/
+ if (node->custom1) { /*set up output pointer for y flip*/
outfp+= (src_height-1)*outydelt;
outydelt= -outydelt;
}
- for(y=0; y<src_height; y++) {
- if(node->custom1 == 1) { /* no x flip so just copy line*/
+ for (y=0; y<src_height; y++) {
+ if (node->custom1 == 1) { /* no x flip so just copy line*/
memcpy(outfp, srcfp, sizeof(float) * src_pix * src_width);
srcfp+=srcydelt;
}
else {
outfp += (src_width-1)*src_pix;
- for(x=0; x<src_width; x++) {
- for(i=0; i<src_pix; i++) {
+ for (x=0; x<src_width; x++) {
+ for (i=0; i<src_pix; i++) {
outfp[i]= srcfp[i];
}
outfp -= src_pix;
diff --git a/source/blender/nodes/composite/nodes/node_composite_gamma.c b/source/blender/nodes/composite/nodes/node_composite_gamma.c
index 90135b5cf35..ae793b44f2c 100644
--- a/source/blender/nodes/composite/nodes/node_composite_gamma.c
+++ b/source/blender/nodes/composite/nodes/node_composite_gamma.c
@@ -48,7 +48,7 @@ static bNodeSocketTemplate cmp_node_gamma_out[]= {
static void do_gamma(bNode *UNUSED(node), float *out, float *in, float *fac)
{
int i=0;
- for(i=0; i<3; i++) {
+ for (i=0; i<3; i++) {
/* check for negative to avoid nan's */
out[i] = (in[i] > 0.0f)? powf(in[i],fac[0]): in[i];
}
@@ -58,10 +58,10 @@ static void node_composit_exec_gamma(void *UNUSED(data), bNode *node, bNodeStack
{
/* stack order in: Fac, Image */
/* stack order out: Image */
- if(out[0]->hasoutput==0) return;
+ if (out[0]->hasoutput==0) return;
/* input no image? then only color operation */
- if(in[0]->data==NULL) {
+ if (in[0]->data==NULL) {
do_gamma(node, out[0]->vec, in[0]->vec, in[1]->vec);
}
else {
diff --git a/source/blender/nodes/composite/nodes/node_composite_glare.c b/source/blender/nodes/composite/nodes/node_composite_glare.c
index d4e15f780e5..42760ddfc4e 100644
--- a/source/blender/nodes/composite/nodes/node_composite_glare.c
+++ b/source/blender/nodes/composite/nodes/node_composite_glare.c
@@ -436,7 +436,8 @@ static void node_composit_exec_glare(void *UNUSED(data), bNode *node, bNodeStack
if (img->type != CB_RGBA) {
new = typecheck_compbuf(img, CB_RGBA);
src = typecheck_compbuf(img, CB_RGBA);
- } else {
+ }
+ else {
new = dupalloc_compbuf(img);
src = dupalloc_compbuf(img);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
index c4598717e00..7349d1dd4bf 100644
--- a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
+++ b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
@@ -48,12 +48,12 @@ static void do_hue_sat_fac(bNode *node, float *out, float *in, float *fac)
{
NodeHueSat *nhs= node->storage;
- if(*fac!=0.0f && (nhs->hue!=0.5f || nhs->sat!=1.0f || nhs->val!=1.0f)) {
+ if (*fac!=0.0f && (nhs->hue!=0.5f || nhs->sat!=1.0f || nhs->val!=1.0f)) {
float col[3], hsv[3], mfac= 1.0f - *fac;
rgb_to_hsv(in[0], in[1], in[2], hsv, hsv+1, hsv+2);
hsv[0]+= (nhs->hue - 0.5f);
- if(hsv[0]>1.0f) hsv[0]-=1.0f; else if(hsv[0]<0.0f) hsv[0]+= 1.0f;
+ if (hsv[0]>1.0f) hsv[0]-=1.0f; else if (hsv[0]<0.0f) hsv[0]+= 1.0f;
hsv[1]*= nhs->sat;
hsv[2]*= nhs->val;
hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
@@ -72,10 +72,10 @@ static void node_composit_exec_hue_sat(void *UNUSED(data), bNode *node, bNodeSta
{
/* stack order in: Fac, Image */
/* stack order out: Image */
- if(out[0]->hasoutput==0) return;
+ if (out[0]->hasoutput==0) return;
/* input no image? then only color operation */
- if(in[1]->data==NULL) {
+ if (in[1]->data==NULL) {
do_hue_sat_fac(node, out[0]->vec, in[1]->vec, in[0]->vec);
}
else {
@@ -88,7 +88,7 @@ static void node_composit_exec_hue_sat(void *UNUSED(data), bNode *node, bNodeSta
out[0]->data= stackbuf;
/* get rid of intermediary cbuf if it's extra */
- if(stackbuf!=cbuf)
+ if (stackbuf!=cbuf)
free_compbuf(cbuf);
}
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_huecorrect.c b/source/blender/nodes/composite/nodes/node_composite_huecorrect.c
index 6b0849b2391..23d04a28276 100644
--- a/source/blender/nodes/composite/nodes/node_composite_huecorrect.c
+++ b/source/blender/nodes/composite/nodes/node_composite_huecorrect.c
@@ -109,16 +109,16 @@ static void node_composit_exec_huecorrect(void *UNUSED(data), bNode *node, bNode
/* stack order input: fac, image, black level, white level */
/* stack order output: image */
- if(out[0]->hasoutput==0)
+ if (out[0]->hasoutput==0)
return;
- if(in[0]->vec[0] == 0.f && in[0]->data == NULL) {
+ if (in[0]->vec[0] == 0.f && in[0]->data == NULL) {
out[0]->data = pass_on_compbuf(cbuf);
return;
}
/* input no image? then only color operation */
- if(in[1]->data==NULL) {
+ if (in[1]->data==NULL) {
do_huecorrect_fac(node, out[0]->vec, in[1]->vec, in[0]->vec);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_idMask.c b/source/blender/nodes/composite/nodes/node_composite_idMask.c
index 0600e44b0d0..c1dba471f20 100644
--- a/source/blender/nodes/composite/nodes/node_composite_idMask.c
+++ b/source/blender/nodes/composite/nodes/node_composite_idMask.c
@@ -52,15 +52,15 @@ static void do_idmask(CompBuf *stackbuf, CompBuf *cbuf, float idnr)
char *abuf= MEM_mapallocN(cbuf->x*cbuf->y, "anti ali buf");
rect= cbuf->rect;
- for(x= cbuf->x*cbuf->y - 1; x>=0; x--)
- if(rect[x]==idnr)
+ for (x= cbuf->x*cbuf->y - 1; x>=0; x--)
+ if (rect[x]==idnr)
abuf[x]= 255;
antialias_tagbuf(cbuf->x, cbuf->y, abuf);
rect= stackbuf->rect;
- for(x= cbuf->x*cbuf->y - 1; x>=0; x--)
- if(abuf[x]>1)
+ for (x= cbuf->x*cbuf->y - 1; x>=0; x--)
+ if (abuf[x]>1)
rect[x]= (1.0f/255.0f)*(float)abuf[x];
MEM_freeN(abuf);
@@ -74,8 +74,8 @@ static void do_idmask_fsa(CompBuf *stackbuf, CompBuf *cbuf, float idnr)
rect= cbuf->rect;
rs= stackbuf->rect;
- for(x= cbuf->x*cbuf->y - 1; x>=0; x--)
- if(rect[x]==idnr)
+ for (x= cbuf->x*cbuf->y - 1; x>=0; x--)
+ if (rect[x]==idnr)
rs[x]= 1.0f;
}
@@ -85,19 +85,19 @@ static void node_composit_exec_idmask(void *data, bNode *node, bNodeStack **in,
{
RenderData *rd= data;
- if(out[0]->hasoutput==0)
+ if (out[0]->hasoutput==0)
return;
- if(in[0]->data) {
+ if (in[0]->data) {
CompBuf *cbuf= in[0]->data;
CompBuf *stackbuf;
- if(cbuf->type!=CB_VAL)
+ if (cbuf->type!=CB_VAL)
return;
stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); /* allocs */;
- if((rd->scemode & R_FULL_SAMPLE) || node->custom2 == 0)
+ if ((rd->scemode & R_FULL_SAMPLE) || node->custom2 == 0)
do_idmask_fsa(stackbuf, cbuf, (float)node->custom1);
else
do_idmask(stackbuf, cbuf, (float)node->custom1);
diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c
index 997bd72d5c4..44efbc6f9db 100644
--- a/source/blender/nodes/composite/nodes/node_composite_image.c
+++ b/source/blender/nodes/composite/nodes/node_composite_image.c
@@ -75,8 +75,8 @@ float *node_composit_get_float_buffer(RenderData *rd, ImBuf *ibuf, int *alloc)
*alloc= FALSE;
- if(rd->color_mgt_flag & R_COLOR_MANAGEMENT) {
- if(ibuf->profile != IB_PROFILE_NONE) {
+ if (rd->color_mgt_flag & R_COLOR_MANAGEMENT) {
+ if (ibuf->profile != IB_PROFILE_NONE) {
rect= ibuf->rect_float;
}
else {
@@ -90,7 +90,7 @@ float *node_composit_get_float_buffer(RenderData *rd, ImBuf *ibuf, int *alloc)
}
}
else {
- if(ibuf->profile == IB_PROFILE_NONE) {
+ if (ibuf->profile == IB_PROFILE_NONE) {
rect= ibuf->rect_float;
}
else {
@@ -119,7 +119,7 @@ static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *i
int alloc= FALSE;
ibuf= BKE_image_get_ibuf(ima, iuser);
- if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) {
+ if (ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) {
return NULL;
}
@@ -129,7 +129,7 @@ static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *i
/* now we need a float buffer from the image with matching color management */
/* XXX weak code, multilayer is excluded from this */
- if(ibuf->channels == 4 && ima->rr==NULL) {
+ if (ibuf->channels == 4 && ima->rr==NULL) {
rect= node_composit_get_float_buffer(rd, ibuf, &alloc);
}
else {
@@ -141,9 +141,9 @@ static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *i
type= ibuf->channels;
- if(rd->scemode & R_COMP_CROP) {
+ if (rd->scemode & R_COMP_CROP) {
stackbuf= get_cropped_compbuf(&rd->disprect, rect, ibuf->x, ibuf->y, type);
- if(alloc)
+ if (alloc)
MEM_freeN(rect);
}
else {
@@ -176,8 +176,8 @@ static CompBuf *node_composit_get_zimage(bNode *node, RenderData *rd)
ImBuf *ibuf= BKE_image_get_ibuf((Image *)node->id, node->storage);
CompBuf *zbuf= NULL;
- if(ibuf && ibuf->zbuf_float) {
- if(rd->scemode & R_COMP_CROP) {
+ if (ibuf && ibuf->zbuf_float) {
+ if (rd->scemode & R_COMP_CROP) {
zbuf= get_cropped_compbuf(&rd->disprect, ibuf->zbuf_float, ibuf->x, ibuf->y, CB_VAL);
}
else {
@@ -194,11 +194,11 @@ static CompBuf *compbuf_multilayer_get(RenderData *rd, RenderLayer *rl, Image *i
RenderPass *rpass;
short index;
- for(index=0, rpass= rl->passes.first; rpass; rpass= rpass->next, index++)
- if(rpass->passtype==passtype)
+ for (index=0, rpass= rl->passes.first; rpass; rpass= rpass->next, index++)
+ if (rpass->passtype==passtype)
break;
- if(rpass) {
+ if (rpass) {
CompBuf *cbuf;
iuser->pass= index;
@@ -212,58 +212,58 @@ static CompBuf *compbuf_multilayer_get(RenderData *rd, RenderLayer *rl, Image *i
static void outputs_multilayer_get(RenderData *rd, RenderLayer *rl, bNodeStack **out, Image *ima, ImageUser *iuser)
{
- if(out[RRES_OUT_Z]->hasoutput)
+ if (out[RRES_OUT_Z]->hasoutput)
out[RRES_OUT_Z]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_Z);
- if(out[RRES_OUT_VEC]->hasoutput)
+ if (out[RRES_OUT_VEC]->hasoutput)
out[RRES_OUT_VEC]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_VECTOR);
- if(out[RRES_OUT_NORMAL]->hasoutput)
+ if (out[RRES_OUT_NORMAL]->hasoutput)
out[RRES_OUT_NORMAL]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_NORMAL);
- if(out[RRES_OUT_UV]->hasoutput)
+ if (out[RRES_OUT_UV]->hasoutput)
out[RRES_OUT_UV]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_UV);
- if(out[RRES_OUT_RGBA]->hasoutput)
+ if (out[RRES_OUT_RGBA]->hasoutput)
out[RRES_OUT_RGBA]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_RGBA);
- if(out[RRES_OUT_DIFF]->hasoutput)
+ if (out[RRES_OUT_DIFF]->hasoutput)
out[RRES_OUT_DIFF]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_DIFFUSE);
- if(out[RRES_OUT_SPEC]->hasoutput)
+ if (out[RRES_OUT_SPEC]->hasoutput)
out[RRES_OUT_SPEC]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_SPEC);
- if(out[RRES_OUT_SHADOW]->hasoutput)
+ if (out[RRES_OUT_SHADOW]->hasoutput)
out[RRES_OUT_SHADOW]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_SHADOW);
- if(out[RRES_OUT_AO]->hasoutput)
+ if (out[RRES_OUT_AO]->hasoutput)
out[RRES_OUT_AO]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_AO);
- if(out[RRES_OUT_REFLECT]->hasoutput)
+ if (out[RRES_OUT_REFLECT]->hasoutput)
out[RRES_OUT_REFLECT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_REFLECT);
- if(out[RRES_OUT_REFRACT]->hasoutput)
+ if (out[RRES_OUT_REFRACT]->hasoutput)
out[RRES_OUT_REFRACT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_REFRACT);
- if(out[RRES_OUT_INDIRECT]->hasoutput)
+ if (out[RRES_OUT_INDIRECT]->hasoutput)
out[RRES_OUT_INDIRECT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_INDIRECT);
- if(out[RRES_OUT_INDEXOB]->hasoutput)
+ if (out[RRES_OUT_INDEXOB]->hasoutput)
out[RRES_OUT_INDEXOB]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_INDEXOB);
- if(out[RRES_OUT_INDEXMA]->hasoutput)
+ if (out[RRES_OUT_INDEXMA]->hasoutput)
out[RRES_OUT_INDEXMA]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_INDEXMA);
- if(out[RRES_OUT_MIST]->hasoutput)
+ if (out[RRES_OUT_MIST]->hasoutput)
out[RRES_OUT_MIST]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_MIST);
- if(out[RRES_OUT_EMIT]->hasoutput)
+ if (out[RRES_OUT_EMIT]->hasoutput)
out[RRES_OUT_EMIT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_EMIT);
- if(out[RRES_OUT_ENV]->hasoutput)
+ if (out[RRES_OUT_ENV]->hasoutput)
out[RRES_OUT_ENV]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_ENVIRONMENT);
- if(out[RRES_OUT_DIFF_DIRECT]->hasoutput)
+ if (out[RRES_OUT_DIFF_DIRECT]->hasoutput)
out[RRES_OUT_DIFF_DIRECT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_DIFFUSE_DIRECT);
- if(out[RRES_OUT_DIFF_INDIRECT]->hasoutput)
+ if (out[RRES_OUT_DIFF_INDIRECT]->hasoutput)
out[RRES_OUT_DIFF_INDIRECT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_DIFFUSE_INDIRECT);
- if(out[RRES_OUT_DIFF_COLOR]->hasoutput)
+ if (out[RRES_OUT_DIFF_COLOR]->hasoutput)
out[RRES_OUT_DIFF_COLOR]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_DIFFUSE_COLOR);
- if(out[RRES_OUT_GLOSSY_DIRECT]->hasoutput)
+ if (out[RRES_OUT_GLOSSY_DIRECT]->hasoutput)
out[RRES_OUT_GLOSSY_DIRECT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_GLOSSY_DIRECT);
- if(out[RRES_OUT_GLOSSY_INDIRECT]->hasoutput)
+ if (out[RRES_OUT_GLOSSY_INDIRECT]->hasoutput)
out[RRES_OUT_GLOSSY_INDIRECT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_GLOSSY_INDIRECT);
- if(out[RRES_OUT_GLOSSY_COLOR]->hasoutput)
+ if (out[RRES_OUT_GLOSSY_COLOR]->hasoutput)
out[RRES_OUT_GLOSSY_COLOR]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_GLOSSY_COLOR);
- if(out[RRES_OUT_TRANSM_DIRECT]->hasoutput)
+ if (out[RRES_OUT_TRANSM_DIRECT]->hasoutput)
out[RRES_OUT_TRANSM_DIRECT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_TRANSM_DIRECT);
- if(out[RRES_OUT_TRANSM_INDIRECT]->hasoutput)
+ if (out[RRES_OUT_TRANSM_INDIRECT]->hasoutput)
out[RRES_OUT_TRANSM_INDIRECT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_TRANSM_INDIRECT);
- if(out[RRES_OUT_TRANSM_COLOR]->hasoutput)
+ if (out[RRES_OUT_TRANSM_COLOR]->hasoutput)
out[RRES_OUT_TRANSM_COLOR]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_TRANSM_COLOR);
}
@@ -273,7 +273,7 @@ static void node_composit_exec_image(void *data, bNode *node, bNodeStack **UNUSE
/* image assigned to output */
/* stack order input sockets: col, alpha */
- if(node->id) {
+ if (node->id) {
RenderData *rd= data;
Image *ima= (Image *)node->id;
ImageUser *iuser= (ImageUser *)node->storage;
@@ -283,13 +283,13 @@ static void node_composit_exec_image(void *data, bNode *node, bNodeStack **UNUSE
BKE_image_user_calc_frame(iuser, rd->cfra, 0);
/* force a load, we assume iuser index will be set OK anyway */
- if(ima->type==IMA_TYPE_MULTILAYER)
+ if (ima->type==IMA_TYPE_MULTILAYER)
BKE_image_get_ibuf(ima, iuser);
- if(ima->type==IMA_TYPE_MULTILAYER && ima->rr) {
+ if (ima->type==IMA_TYPE_MULTILAYER && ima->rr) {
RenderLayer *rl= BLI_findlink(&ima->rr->layers, iuser->layer);
- if(rl) {
+ if (rl) {
out[0]->data= stackbuf= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_COMBINED);
/* go over all layers */
@@ -325,14 +325,14 @@ static void node_composit_exec_image(void *data, bNode *node, bNodeStack **UNUSE
/* put image on stack */
out[0]->data= stackbuf;
- if(out[2]->hasoutput)
+ if (out[2]->hasoutput)
out[2]->data= node_composit_get_zimage(node, rd);
}
}
/* alpha and preview for both types */
- if(stackbuf) {
- if(out[1]->hasoutput)
+ if (stackbuf) {
+ if (out[1]->hasoutput)
out[1]->data= valbuf_from_rgbabuf(stackbuf, CHAN_A);
generate_preview(data, node, stackbuf);
@@ -370,18 +370,18 @@ void register_node_type_cmp_image(bNodeTreeType *ttype)
static CompBuf *compbuf_from_pass(RenderData *rd, RenderLayer *rl, int rectx, int recty, int passcode)
{
float *fp= RE_RenderLayerGetPass(rl, passcode);
- if(fp) {
+ if (fp) {
CompBuf *buf;
int buftype= CB_VEC3;
- if(ELEM4(passcode, SCE_PASS_Z, SCE_PASS_INDEXOB, SCE_PASS_MIST, SCE_PASS_INDEXMA))
+ if (ELEM4(passcode, SCE_PASS_Z, SCE_PASS_INDEXOB, SCE_PASS_MIST, SCE_PASS_INDEXMA))
buftype= CB_VAL;
- else if(passcode==SCE_PASS_VECTOR)
+ else if (passcode==SCE_PASS_VECTOR)
buftype= CB_VEC4;
- else if(ELEM(passcode, SCE_PASS_COMBINED, SCE_PASS_RGBA))
+ else if (ELEM(passcode, SCE_PASS_COMBINED, SCE_PASS_RGBA))
buftype= CB_RGBA;
- if(rd->scemode & R_COMP_CROP)
+ if (rd->scemode & R_COMP_CROP)
buf= get_cropped_compbuf(&rd->disprect, fp, rectx, recty, buftype);
else {
buf= alloc_compbuf(rectx, recty, buftype, 0);
@@ -394,58 +394,58 @@ static CompBuf *compbuf_from_pass(RenderData *rd, RenderLayer *rl, int rectx, in
static void node_composit_rlayers_out(RenderData *rd, RenderLayer *rl, bNodeStack **out, int rectx, int recty)
{
- if(out[RRES_OUT_Z]->hasoutput)
+ if (out[RRES_OUT_Z]->hasoutput)
out[RRES_OUT_Z]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_Z);
- if(out[RRES_OUT_VEC]->hasoutput)
+ if (out[RRES_OUT_VEC]->hasoutput)
out[RRES_OUT_VEC]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_VECTOR);
- if(out[RRES_OUT_NORMAL]->hasoutput)
+ if (out[RRES_OUT_NORMAL]->hasoutput)
out[RRES_OUT_NORMAL]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_NORMAL);
- if(out[RRES_OUT_UV]->hasoutput)
+ if (out[RRES_OUT_UV]->hasoutput)
out[RRES_OUT_UV]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_UV);
- if(out[RRES_OUT_RGBA]->hasoutput)
+ if (out[RRES_OUT_RGBA]->hasoutput)
out[RRES_OUT_RGBA]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_RGBA);
- if(out[RRES_OUT_DIFF]->hasoutput)
+ if (out[RRES_OUT_DIFF]->hasoutput)
out[RRES_OUT_DIFF]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_DIFFUSE);
- if(out[RRES_OUT_SPEC]->hasoutput)
+ if (out[RRES_OUT_SPEC]->hasoutput)
out[RRES_OUT_SPEC]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_SPEC);
- if(out[RRES_OUT_SHADOW]->hasoutput)
+ if (out[RRES_OUT_SHADOW]->hasoutput)
out[RRES_OUT_SHADOW]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_SHADOW);
- if(out[RRES_OUT_AO]->hasoutput)
+ if (out[RRES_OUT_AO]->hasoutput)
out[RRES_OUT_AO]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_AO);
- if(out[RRES_OUT_REFLECT]->hasoutput)
+ if (out[RRES_OUT_REFLECT]->hasoutput)
out[RRES_OUT_REFLECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_REFLECT);
- if(out[RRES_OUT_REFRACT]->hasoutput)
+ if (out[RRES_OUT_REFRACT]->hasoutput)
out[RRES_OUT_REFRACT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_REFRACT);
- if(out[RRES_OUT_INDIRECT]->hasoutput)
+ if (out[RRES_OUT_INDIRECT]->hasoutput)
out[RRES_OUT_INDIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDIRECT);
- if(out[RRES_OUT_INDEXOB]->hasoutput)
+ if (out[RRES_OUT_INDEXOB]->hasoutput)
out[RRES_OUT_INDEXOB]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDEXOB);
- if(out[RRES_OUT_INDEXMA]->hasoutput)
+ if (out[RRES_OUT_INDEXMA]->hasoutput)
out[RRES_OUT_INDEXMA]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDEXMA);
- if(out[RRES_OUT_MIST]->hasoutput)
+ if (out[RRES_OUT_MIST]->hasoutput)
out[RRES_OUT_MIST]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_MIST);
- if(out[RRES_OUT_EMIT]->hasoutput)
+ if (out[RRES_OUT_EMIT]->hasoutput)
out[RRES_OUT_EMIT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_EMIT);
- if(out[RRES_OUT_ENV]->hasoutput)
+ if (out[RRES_OUT_ENV]->hasoutput)
out[RRES_OUT_ENV]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_ENVIRONMENT);
- if(out[RRES_OUT_DIFF_DIRECT]->hasoutput)
+ if (out[RRES_OUT_DIFF_DIRECT]->hasoutput)
out[RRES_OUT_DIFF_DIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_DIFFUSE_DIRECT);
- if(out[RRES_OUT_DIFF_INDIRECT]->hasoutput)
+ if (out[RRES_OUT_DIFF_INDIRECT]->hasoutput)
out[RRES_OUT_DIFF_INDIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_DIFFUSE_INDIRECT);
- if(out[RRES_OUT_DIFF_COLOR]->hasoutput)
+ if (out[RRES_OUT_DIFF_COLOR]->hasoutput)
out[RRES_OUT_DIFF_COLOR]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_DIFFUSE_COLOR);
- if(out[RRES_OUT_GLOSSY_DIRECT]->hasoutput)
+ if (out[RRES_OUT_GLOSSY_DIRECT]->hasoutput)
out[RRES_OUT_GLOSSY_DIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_GLOSSY_DIRECT);
- if(out[RRES_OUT_GLOSSY_INDIRECT]->hasoutput)
+ if (out[RRES_OUT_GLOSSY_INDIRECT]->hasoutput)
out[RRES_OUT_GLOSSY_INDIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_GLOSSY_INDIRECT);
- if(out[RRES_OUT_GLOSSY_COLOR]->hasoutput)
+ if (out[RRES_OUT_GLOSSY_COLOR]->hasoutput)
out[RRES_OUT_GLOSSY_COLOR]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_GLOSSY_COLOR);
- if(out[RRES_OUT_TRANSM_DIRECT]->hasoutput)
+ if (out[RRES_OUT_TRANSM_DIRECT]->hasoutput)
out[RRES_OUT_TRANSM_DIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_TRANSM_DIRECT);
- if(out[RRES_OUT_TRANSM_INDIRECT]->hasoutput)
+ if (out[RRES_OUT_TRANSM_INDIRECT]->hasoutput)
out[RRES_OUT_TRANSM_INDIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_TRANSM_INDIRECT);
- if(out[RRES_OUT_TRANSM_COLOR]->hasoutput)
+ if (out[RRES_OUT_TRANSM_COLOR]->hasoutput)
out[RRES_OUT_TRANSM_COLOR]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_TRANSM_COLOR);
}
@@ -456,24 +456,24 @@ static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **UNU
RenderData *rd= data;
RenderResult *rr= NULL;
- if(re)
+ if (re)
rr= RE_AcquireResultRead(re);
- if(rr) {
+ if (rr) {
SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1);
- if(srl) {
+ if (srl) {
RenderLayer *rl= RE_GetRenderLayer(rr, srl->name);
- if(rl && rl->rectf) {
+ if (rl && rl->rectf) {
CompBuf *stackbuf;
/* we put render rect on stack, cbuf knows rect is from other ibuf when freed! */
- if(rd->scemode & R_COMP_CROP)
+ if (rd->scemode & R_COMP_CROP)
stackbuf= get_cropped_compbuf(&rd->disprect, rl->rectf, rr->rectx, rr->recty, CB_RGBA);
else {
stackbuf= alloc_compbuf(rr->rectx, rr->recty, CB_RGBA, 0);
stackbuf->rect= rl->rectf;
}
- if(stackbuf==NULL) {
+ if (stackbuf==NULL) {
printf("Error; Preview Panel in UV Window returns zero sized image\n");
}
else {
@@ -483,7 +483,7 @@ static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **UNU
/* put on stack */
out[RRES_OUT_IMAGE]->data= stackbuf;
- if(out[RRES_OUT_ALPHA]->hasoutput)
+ if (out[RRES_OUT_ALPHA]->hasoutput)
out[RRES_OUT_ALPHA]->data= valbuf_from_rgbabuf(stackbuf, CHAN_A);
node_composit_rlayers_out(rd, rl, out, rr->rectx, rr->recty);
@@ -494,7 +494,7 @@ static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **UNU
}
}
- if(re)
+ if (re)
RE_ReleaseResult(re);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_invert.c b/source/blender/nodes/composite/nodes/node_composite_invert.c
index 4fda90e0a1e..8f3a6fc2e25 100644
--- a/source/blender/nodes/composite/nodes/node_composite_invert.c
+++ b/source/blender/nodes/composite/nodes/node_composite_invert.c
@@ -45,14 +45,16 @@ static bNodeSocketTemplate cmp_node_invert_out[]= {
static void do_invert(bNode *node, float *out, float *in)
{
- if(node->custom1 & CMP_CHAN_RGB) {
+ if (node->custom1 & CMP_CHAN_RGB) {
out[0] = 1.0f - in[0];
out[1] = 1.0f - in[1];
out[2] = 1.0f - in[2];
- } else
+ }
+ else {
copy_v3_v3(out, in);
+ }
- if(node->custom1 & CMP_CHAN_A)
+ if (node->custom1 & CMP_CHAN_A)
out[3] = 1.0f - in[3];
else
out[3] = in[3];
@@ -67,12 +69,12 @@ static void do_invert_fac(bNode *node, float *out, float *in, float *fac)
/* blend inverted result against original input with fac */
facm = 1.0f - fac[0];
- if(node->custom1 & CMP_CHAN_RGB) {
+ if (node->custom1 & CMP_CHAN_RGB) {
col[0] = fac[0]*col[0] + (facm*in[0]);
col[1] = fac[0]*col[1] + (facm*in[1]);
col[2] = fac[0]*col[2] + (facm*in[2]);
}
- if(node->custom1 & CMP_CHAN_A)
+ if (node->custom1 & CMP_CHAN_A)
col[3] = fac[0]*col[3] + (facm*in[3]);
copy_v4_v4(out, col);
@@ -84,10 +86,10 @@ static void node_composit_exec_invert(void *UNUSED(data), bNode *node, bNodeStac
/* stack order out: Image */
float *fac= in[0]->vec;
- if(out[0]->hasoutput==0) return;
+ if (out[0]->hasoutput==0) return;
/* input no image? then only color operation */
- if(in[1]->data==NULL && in[0]->data==NULL) {
+ if (in[1]->data==NULL && in[0]->data==NULL) {
do_invert_fac(node, out[0]->vec, in[1]->vec, fac);
}
else {
@@ -105,7 +107,8 @@ static void node_composit_exec_invert(void *UNUSED(data), bNode *node, bNodeStac
out[0]->data= stackbuf;
return;
- } else {
+ }
+ else {
out[0]->data = pass_on_compbuf(cbuf);
return;
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_levels.c b/source/blender/nodes/composite/nodes/node_composite_levels.c
index 9417e504a1b..ec6d2006296 100644
--- a/source/blender/nodes/composite/nodes/node_composite_levels.c
+++ b/source/blender/nodes/composite/nodes/node_composite_levels.c
@@ -57,13 +57,13 @@ static void fill_bins(bNode* node, CompBuf* in, int* bins)
int x,y;
/*fill bins */
- for(y=0; y<in->y; y++) {
- for(x=0; x<in->x; x++) {
+ for (y=0; y<in->y; y++) {
+ for (x=0; x<in->x; x++) {
/* get the pixel */
qd_getPixel(in, x, y, value);
- if(value[3] > 0.0f) { /* don't count transparent pixels */
+ if (value[3] > 0.0f) { /* don't count transparent pixels */
switch(node->custom1) {
case 1: { /* all colors */
rgb_tobw(value[0],value[1],value[2], &value[0]);
@@ -97,8 +97,8 @@ static void fill_bins(bNode* node, CompBuf* in, int* bins)
} /*end switch */
/*clip*/
- if(ivalue<0) ivalue=0;
- if(ivalue>255) ivalue=255;
+ if (ivalue<0) ivalue=0;
+ if (ivalue>255) ivalue=255;
/*put in the correct bin*/
bins[ivalue]+=1;
@@ -114,13 +114,13 @@ static float brightness_mean(bNode* node, CompBuf* in)
int x,y;
float value[4];
- for(x=0; x< in->x; x++) {
- for(y=0; y < in->y; y++) {
+ for (x=0; x< in->x; x++) {
+ for (y=0; y < in->y; y++) {
/* get the pixel */
qd_getPixel(in, x, y, value);
- if(value[3] > 0.0f) { /* don't count transparent pixels */
+ if (value[3] > 0.0f) { /* don't count transparent pixels */
numPixels++;
switch(node->custom1)
{
@@ -166,13 +166,13 @@ static float brightness_standard_deviation(bNode* node, CompBuf* in, float mean)
int x,y;
float value[4];
- for(x=0; x< in->x; x++) {
- for(y=0; y < in->y; y++) {
+ for (x=0; x< in->x; x++) {
+ for (y=0; y < in->y; y++) {
/* get the pixel */
qd_getPixel(in, x, y, value);
- if(value[3] > 0.0f) { /* don't count transparent pixels */
+ if (value[3] > 0.0f) { /* don't count transparent pixels */
numPixels++;
switch(node->custom1)
{
@@ -224,18 +224,18 @@ static void draw_histogram(bNode *node, CompBuf *out, int* bins)
/* find max value */
max=0;
- for(x=0; x<256; x++) {
- if(bins[x]>max) max=bins[x];
+ for (x=0; x<256; x++) {
+ if (bins[x]>max) max=bins[x];
}
/*draw histogram in buffer */
- for(x=0; x<out->x; x++) {
- for(y=0;y<out->y; y++) {
+ for (x=0; x<out->x; x++) {
+ for (y=0;y<out->y; y++) {
/* get normalized value (0..255) */
value=((float)bins[x]/(float)max)*255.0f;
- if(y < (int)value) { /*if the y value is below the height of the bar for this line then draw with the color */
+ if (y < (int)value) { /*if the y value is below the height of the bar for this line then draw with the color */
switch (node->custom1) {
case 1: { /* draw in black */
color[0]=0.0; color[1]=0.0; color[2]=0.0; color[3]=1.0;
@@ -259,7 +259,7 @@ static void draw_histogram(bNode *node, CompBuf *out, int* bins)
}
}
}
- else{
+ else {
color[0]=0.8; color[1]=0.8; color[2]=0.8; color[3]=1.0;
}
@@ -277,14 +277,14 @@ static void node_composit_exec_view_levels(void *data, bNode *node, bNodeStack *
int bins[256];
int x;
- if(in[0]->hasinput==0) return;
- if(in[0]->data==NULL) return;
+ if (in[0]->hasinput==0) return;
+ if (in[0]->data==NULL) return;
histogram=alloc_compbuf(256, 256, CB_RGBA, 1);
cbuf=typecheck_compbuf(in[0]->data, CB_RGBA);
/*initalize bins*/
- for(x=0; x<256; x++) {
+ for (x=0; x<256; x++) {
bins[x]=0;
}
@@ -303,14 +303,14 @@ static void node_composit_exec_view_levels(void *data, bNode *node, bNodeStack *
printf("Std Dev: %f\n", std_dev);
*/
- if(out[0]->hasoutput)
+ if (out[0]->hasoutput)
out[0]->vec[0]= mean;
- if(out[1]->hasoutput)
+ if (out[1]->hasoutput)
out[1]->vec[0]= std_dev;
generate_preview(data, node, histogram);
- if(cbuf!=in[0]->data)
+ if (cbuf!=in[0]->data)
free_compbuf(cbuf);
free_compbuf(histogram);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c b/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
index ad5e9d423e5..85c291fd9ec 100644
--- a/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
@@ -51,10 +51,10 @@ static void do_luma_matte(bNode *node, float *out, float *in)
float alpha;
/* test range*/
- if(in[0]>c->t1) {
+ if (in[0]>c->t1) {
alpha=1.0;
}
- else if(in[0]<c->t2){
+ else if (in[0]<c->t2) {
alpha=0.0;
}
else {/*blend */
@@ -76,9 +76,9 @@ static void node_composit_exec_luma_matte(void *data, bNode *node, bNodeStack **
CompBuf *cbuf;
CompBuf *outbuf;
- if(in[0]->hasinput==0) return;
- if(in[0]->data==NULL) return;
- if(out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
+ if (in[0]->hasinput==0) return;
+ if (in[0]->data==NULL) return;
+ if (out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
cbuf=typecheck_compbuf(in[0]->data, CB_RGBA);
@@ -92,7 +92,7 @@ static void node_composit_exec_luma_matte(void *data, bNode *node, bNodeStack **
out[0]->data=outbuf;
if (out[1]->hasoutput)
out[1]->data=valbuf_from_rgbabuf(outbuf, CHAN_A);
- if(cbuf!=in[0]->data)
+ if (cbuf!=in[0]->data)
free_compbuf(cbuf);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_mapUV.c b/source/blender/nodes/composite/nodes/node_composite_mapUV.c
index 1ca729c8393..7d62e6b8030 100644
--- a/source/blender/nodes/composite/nodes/node_composite_mapUV.c
+++ b/source/blender/nodes/composite/nodes/node_composite_mapUV.c
@@ -64,10 +64,10 @@ static void do_mapuv(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *uvbuf, float thr
sx= stackbuf->x;
sy= stackbuf->y;
- for(y=0; y<sy; y++) {
- for(x=0; x<sx; x++, out+=4, uv+=3, uvnext+=3, uvprev+=3) {
- if(x>0 && x<sx-1 && y>0 && y<sy-1) {
- if(uv[2]!=0.0f) {
+ for (y=0; y<sy; y++) {
+ for (x=0; x<sx; x++, out+=4, uv+=3, uvnext+=3, uvprev+=3) {
+ if (x>0 && x<sx-1 && y>0 && y<sy-1) {
+ if (uv[2]!=0.0f) {
float uv_l, uv_r;
/* adaptive sampling, red (U) channel */
@@ -113,16 +113,16 @@ static void do_mapuv(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *uvbuf, float thr
/* UV to alpha threshold */
alpha= 1.0f - threshold*(dx+dy);
- if(alpha<0.0f) alpha= 0.0f;
+ if (alpha<0.0f) alpha= 0.0f;
else alpha*= uv[2];
/* should use mipmap */
- if(dx > 0.20f) dx= 0.20f;
- if(dy > 0.20f) dy= 0.20f;
+ if (dx > 0.20f) dx= 0.20f;
+ if (dy > 0.20f) dy= 0.20f;
ibuf_sample(ibuf, uv[0], uv[1], dx, dy, out);
/* premul */
- if(alpha<1.0f) {
+ if (alpha<1.0f) {
out[0]*= alpha;
out[1]*= alpha;
out[2]*= alpha;
@@ -139,10 +139,10 @@ static void do_mapuv(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *uvbuf, float thr
static void node_composit_exec_mapuv(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
{
- if(out[0]->hasoutput==0)
+ if (out[0]->hasoutput==0)
return;
- if(in[0]->data && in[1]->data) {
+ if (in[0]->data && in[1]->data) {
CompBuf *cbuf= in[0]->data;
CompBuf *uvbuf= in[1]->data;
CompBuf *stackbuf;
@@ -155,9 +155,9 @@ static void node_composit_exec_mapuv(void *UNUSED(data), bNode *node, bNodeStack
out[0]->data= stackbuf;
- if(cbuf!=in[0]->data)
+ if (cbuf!=in[0]->data)
free_compbuf(cbuf);
- if(uvbuf!=in[1]->data)
+ if (uvbuf!=in[1]->data)
free_compbuf(uvbuf);
}
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_mapValue.c b/source/blender/nodes/composite/nodes/node_composite_mapValue.c
index 380aa0b716b..2fd115261f8 100644
--- a/source/blender/nodes/composite/nodes/node_composite_mapValue.c
+++ b/source/blender/nodes/composite/nodes/node_composite_mapValue.c
@@ -47,11 +47,11 @@ static void do_map_value(bNode *node, float *out, float *src)
TexMapping *texmap= node->storage;
out[0]= (src[0] + texmap->loc[0])*texmap->size[0];
- if(texmap->flag & TEXMAP_CLIP_MIN)
- if(out[0]<texmap->min[0])
+ if (texmap->flag & TEXMAP_CLIP_MIN)
+ if (out[0]<texmap->min[0])
out[0]= texmap->min[0];
- if(texmap->flag & TEXMAP_CLIP_MAX)
- if(out[0]>texmap->max[0])
+ if (texmap->flag & TEXMAP_CLIP_MAX)
+ if (out[0]>texmap->max[0])
out[0]= texmap->max[0];
}
@@ -59,10 +59,10 @@ static void node_composit_exec_map_value(void *UNUSED(data), bNode *node, bNodeS
{
/* stack order in: valbuf */
/* stack order out: valbuf */
- if(out[0]->hasoutput==0) return;
+ if (out[0]->hasoutput==0) return;
/* input no image? then only value operation */
- if(in[0]->data==NULL) {
+ if (in[0]->data==NULL) {
do_map_value(node, out[0]->vec, in[0]->vec);
}
else {
diff --git a/source/blender/nodes/composite/nodes/node_composite_math.c b/source/blender/nodes/composite/nodes/node_composite_math.c
index 6c2cbb9a92b..6f3d2f6baaf 100644
--- a/source/blender/nodes/composite/nodes/node_composite_math.c
+++ b/source/blender/nodes/composite/nodes/node_composite_math.c
@@ -59,7 +59,7 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
break;
case 3: /* Divide */
{
- if(in2[0]==0) /* We don't want to divide by zero. */
+ if (in2[0]==0) /* We don't want to divide by zero. */
out[0]= 0.0;
else
out[0]= in[0] / in2[0];
@@ -77,7 +77,7 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
case 7: /* Arc-Sine */
{
/* Can't do the impossible... */
- if(in[0] <= 1 && in[0] >= -1 )
+ if (in[0] <= 1 && in[0] >= -1 )
out[0]= asin(in[0]);
else
out[0]= 0.0;
@@ -86,7 +86,7 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
case 8: /* Arc-Cosine */
{
/* Can't do the impossible... */
- if( in[0] <= 1 && in[0] >= -1 )
+ if ( in[0] <= 1 && in[0] >= -1 )
out[0]= acos(in[0]);
else
out[0]= 0.0;
@@ -98,14 +98,16 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
case 10: /* Power */
{
/* Only raise negative numbers by full integers */
- if( in[0] >= 0 ) {
+ if ( in[0] >= 0 ) {
out[0]= pow(in[0], in2[0]);
- } else {
+ }
+ else {
float y_mod_1 = fmod(in2[0], 1);
/* if input value is not nearly an integer, fall back to zero, nicer than straight rounding */
if (y_mod_1 > 0.999f || y_mod_1 < 0.001f) {
out[0]= powf(in[0], floorf(in2[0] + 0.5f));
- } else {
+ }
+ else {
out[0] = 0.0f;
}
}
@@ -114,7 +116,7 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
case 11: /* Logarithm */
{
/* Don't want any imaginary numbers... */
- if( in[0] > 0 && in2[0] > 0 )
+ if ( in[0] > 0 && in2[0] > 0 )
out[0]= log(in[0]) / log(in2[0]);
else
out[0]= 0.0;
@@ -122,7 +124,7 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
break;
case 12: /* Minimum */
{
- if( in[0] < in2[0] )
+ if ( in[0] < in2[0] )
out[0]= in[0];
else
out[0]= in2[0];
@@ -130,7 +132,7 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
break;
case 13: /* Maximum */
{
- if( in[0] > in2[0] )
+ if ( in[0] > in2[0] )
out[0]= in[0];
else
out[0]= in2[0];
@@ -139,7 +141,7 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
case 14: /* Round */
{
/* round by the second value */
- if( in2[0] != 0.0f )
+ if ( in2[0] != 0.0f )
out[0]= floorf(in[0] / in2[0] + 0.5f) * in2[0];
else
out[0]= floorf(in[0] + 0.5f);
@@ -147,7 +149,7 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
break;
case 15: /* Less Than */
{
- if( in[0] < in2[0] )
+ if ( in[0] < in2[0] )
out[0]= 1.0f;
else
out[0]= 0.0f;
@@ -155,7 +157,7 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
break;
case 16: /* Greater Than */
{
- if( in[0] > in2[0] )
+ if ( in[0] > in2[0] )
out[0]= 1.0f;
else
out[0]= 0.0f;
@@ -171,16 +173,16 @@ static void node_composit_exec_math(void *UNUSED(data), bNode *node, bNodeStack
CompBuf *stackbuf;
/* check for inputs and outputs for early out*/
- if(out[0]->hasoutput==0) return;
+ if (out[0]->hasoutput==0) return;
/* no image-color operation */
- if(in[0]->data==NULL && in[1]->data==NULL) {
+ if (in[0]->data==NULL && in[1]->data==NULL) {
do_math(node, out[0]->vec, in[0]->vec, in[1]->vec);
return;
}
/*create output based on first input */
- if(cbuf) {
+ if (cbuf) {
stackbuf=alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);
}
/* and if it doesn't exist use the second input since we
diff --git a/source/blender/nodes/composite/nodes/node_composite_mixrgb.c b/source/blender/nodes/composite/nodes/node_composite_mixrgb.c
index 0296fa417d6..6539e81beec 100644
--- a/source/blender/nodes/composite/nodes/node_composite_mixrgb.c
+++ b/source/blender/nodes/composite/nodes/node_composite_mixrgb.c
@@ -48,7 +48,7 @@ static void do_mix_rgb(bNode *node, float *out, float *in1, float *in2, float *f
float col[3];
copy_v3_v3(col, in1);
- if(node->custom2)
+ if (node->custom2)
ramp_blend(node->custom1, col, in2[3]*fac[0], in2);
else
ramp_blend(node->custom1, col, fac[0], in2);
@@ -62,10 +62,10 @@ static void node_composit_exec_mix_rgb(void *data, bNode *node, bNodeStack **in,
/* stack order out: Image */
float *fac= in[0]->vec;
- if(out[0]->hasoutput==0) return;
+ if (out[0]->hasoutput==0) return;
/* input no image? then only color operation */
- if(in[1]->data==NULL && in[2]->data==NULL) {
+ if (in[1]->data==NULL && in[2]->data==NULL) {
do_mix_rgb(node, out[0]->vec, in[1]->vec, in[2]->vec, fac);
}
else {
diff --git a/source/blender/nodes/composite/nodes/node_composite_movieclip.c b/source/blender/nodes/composite/nodes/node_composite_movieclip.c
index 1f449f8c16a..dd2c169fe9a 100644
--- a/source/blender/nodes/composite/nodes/node_composite_movieclip.c
+++ b/source/blender/nodes/composite/nodes/node_composite_movieclip.c
@@ -44,27 +44,30 @@ 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;
}
/* now we need a float buffer from the image with matching color management */
- if(ibuf->channels == 4) {
+ if (ibuf->channels == 4) {
rect= node_composit_get_float_buffer(rd, ibuf, &alloc);
}
else {
@@ -73,16 +76,16 @@ static CompBuf *node_composit_get_movieclip(RenderData *rd, MovieClip *clip, Mov
}
/* done coercing into the correct color management */
- if(!alloc) {
+ if (!alloc) {
rect= MEM_dupallocN(rect);
alloc= 1;
}
type= ibuf->channels;
- if(rd->scemode & R_COMP_CROP) {
+ if (rd->scemode & R_COMP_CROP) {
stackbuf= get_cropped_compbuf(&rd->disprect, rect, ibuf->x, ibuf->y, type);
- if(alloc)
+ if (alloc)
MEM_freeN(rect);
}
else {
@@ -99,7 +102,7 @@ static CompBuf *node_composit_get_movieclip(RenderData *rd, MovieClip *clip, Mov
static void node_composit_exec_movieclip(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out)
{
- if(node->id) {
+ if (node->id) {
RenderData *rd= data;
MovieClip *clip= (MovieClip *)node->id;
MovieClipUser *user= (MovieClipUser *)node->storage;
@@ -115,7 +118,7 @@ static void node_composit_exec_movieclip(void *data, bNode *node, bNodeStack **U
/* put image on stack */
out[0]->data= stackbuf;
- if(stab->flag&TRACKING_2D_STABILIZATION) {
+ if (stab->flag&TRACKING_2D_STABILIZATION) {
float loc[2], scale, angle;
BKE_tracking_stabilization_data(&clip->tracking, rd->cfra, stackbuf->x, stackbuf->y,
diff --git a/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c b/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c
index bc3f648a374..d9f0da9b8aa 100644
--- a/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c
+++ b/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c
@@ -30,6 +30,8 @@
* \ingroup cmpnodes
*/
+#include "BLF_translation.h"
+
#include "node_composite_util.h"
@@ -47,8 +49,8 @@ static bNodeSocketTemplate cmp_node_moviedistortion_out[]= {
static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
{
- if(in[0]->data) {
- if(node->id) {
+ if (in[0]->data) {
+ if (node->id) {
MovieClip *clip= (MovieClip *)node->id;
CompBuf *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 0);
@@ -56,7 +58,7 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0);
- if(ibuf) {
+ if (ibuf) {
RenderData *rd= data;
ImBuf *obuf;
MovieTracking *tracking= &clip->tracking;
@@ -70,10 +72,10 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
BKE_movieclip_get_size(clip, &user, &width, &height);
- if(!node->storage)
+ if (!node->storage)
node->storage= BKE_tracking_distortion_create();
- if(node->custom1==0)
+ if (node->custom1==0)
obuf= BKE_tracking_distortion_exec(node->storage, tracking, ibuf, width, height, overscan, 1);
else
obuf= BKE_tracking_distortion_exec(node->storage, tracking, ibuf, width, height, overscan, 0);
@@ -91,9 +93,10 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
/* pass on output and free */
out[0]->data= stackbuf;
- if(cbuf!=in[0]->data)
+ if (cbuf!=in[0]->data)
free_compbuf(cbuf);
- } else {
+ }
+ else {
CompBuf *cbuf= in[0]->data;
CompBuf *stackbuf= pass_on_compbuf(cbuf);
@@ -104,15 +107,15 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
static const char *label(bNode *node)
{
- if(node->custom1==0)
- return "Undistortion";
+ if (node->custom1==0)
+ return IFACE_("Undistortion");
else
- return "Distortion";
+ return IFACE_("Distortion");
}
static void storage_free(bNode *node)
{
- if(node->storage)
+ if (node->storage)
BKE_tracking_distortion_destroy(node->storage);
node->storage= NULL;
@@ -120,7 +123,7 @@ static void storage_free(bNode *node)
static void storage_copy(bNode *orig_node, bNode *new_node)
{
- if(orig_node->storage)
+ if (orig_node->storage)
new_node->storage= BKE_tracking_distortion_copy(orig_node->storage);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_normal.c b/source/blender/nodes/composite/nodes/node_composite_normal.c
index fbbd58932ea..e9b5f10172c 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 */
@@ -63,12 +63,12 @@ static void node_composit_exec_normal(void *UNUSED(data), bNode *node, bNodeStac
/* stack order output: normal, value */
/* input no image? then only vector op */
- if(in[0]->data==NULL) {
+ if (in[0]->data==NULL) {
copy_v3_v3(out[0]->vec, nor);
/* render normals point inside... the widget points outside */
out[1]->vec[0]= -dot_v3v3(out[0]->vec, in[0]->vec);
}
- else if(out[1]->hasoutput) {
+ else if (out[1]->hasoutput) {
/* make output size of input image */
CompBuf *cbuf= in[0]->data;
CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); /* allocs */
diff --git a/source/blender/nodes/composite/nodes/node_composite_normalize.c b/source/blender/nodes/composite/nodes/node_composite_normalize.c
index 455966e4f38..69386c3b816 100644
--- a/source/blender/nodes/composite/nodes/node_composite_normalize.c
+++ b/source/blender/nodes/composite/nodes/node_composite_normalize.c
@@ -65,10 +65,10 @@ static void node_composit_exec_normalize(void *UNUSED(data), bNode *node, bNodeS
{
/* stack order in: valbuf */
/* stack order out: valbuf */
- if(out[0]->hasoutput==0) return;
+ if (out[0]->hasoutput==0) return;
/* Input has no image buffer? Then pass the value */
- if(in[0]->data==NULL) {
+ if (in[0]->data==NULL) {
copy_v4_v4(out[0]->vec, in[0]->vec);
}
else {
@@ -93,7 +93,8 @@ static void node_composit_exec_normalize(void *UNUSED(data), bNode *node, bNodeS
if ((max-min) != 0.0f) {
mult = 1.0f/(max-min);
composit3_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, NULL, &min, NULL, &mult, do_normalize, CB_VAL, CB_VAL, CB_VAL);
- } else {
+ }
+ else {
memcpy(stackbuf->rect, cbuf->rect, sizeof(float) * cbuf->x * cbuf->y);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_outputFile.c b/source/blender/nodes/composite/nodes/node_composite_outputFile.c
index 66075f1bba4..2eb68c787fb 100644
--- a/source/blender/nodes/composite/nodes/node_composite_outputFile.c
+++ b/source/blender/nodes/composite/nodes/node_composite_outputFile.c
@@ -37,126 +37,50 @@
#include "node_composite_util.h"
-/* **************** OUTPUT FILE ******************** */
-static bNodeSocketTemplate cmp_node_output_file_in[]= {
- { SOCK_RGBA, 1, "Image", 0.0f, 0.0f, 0.0f, 1.0f},
- { SOCK_FLOAT, 1, "Z", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
- { -1, 0, "" }
-};
+#include "IMB_imbuf.h"
+#include "IMB_imbuf_types.h"
-static void node_composit_exec_output_file(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out))
-{
- /* image assigned to output */
- /* stack order input sockets: col, alpha */
-
- if(in[0]->data) {
- RenderData *rd= data;
- NodeImageFile *nif= node->storage;
- if(nif->sfra!=nif->efra && (rd->cfra<nif->sfra || rd->cfra>nif->efra)) {
- return; /* BAIL OUT RETURN */
- }
- else if (!G.rendering) {
- /* only output files when rendering a sequence -
- * otherwise, it overwrites the output files just
- * scrubbing through the timeline when the compositor updates */
- return;
- } else {
- Main *bmain= G.main; /* TODO, have this passed along */
- CompBuf *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
- ImBuf *ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0);
- char string[FILE_MAX];
-
- ibuf->rect_float= cbuf->rect;
- ibuf->dither= rd->dither_intensity;
-
- if (rd->color_mgt_flag & R_COLOR_MANAGEMENT)
- ibuf->profile = IB_PROFILE_LINEAR_RGB;
-
- if(in[1]->data) {
- CompBuf *zbuf= in[1]->data;
- if(zbuf->type==CB_VAL && zbuf->x==cbuf->x && zbuf->y==cbuf->y) {
- nif->im_format.flag |= R_IMF_FLAG_ZBUF;
- ibuf->zbuf_float= zbuf->rect;
- }
- }
-
- BKE_makepicstring(string, nif->name, bmain->name, rd->cfra, nif->im_format.imtype, (rd->scemode & R_EXTENSION), TRUE);
-
- if(0 == BKE_write_ibuf(ibuf, string, &nif->im_format))
- printf("Cannot save Node File Output to %s\n", string);
- else
- printf("Saved: %s\n", string);
-
- IMB_freeImBuf(ibuf);
-
- generate_preview(data, node, cbuf);
-
- if(in[0]->data != cbuf)
- free_compbuf(cbuf);
- }
- }
-}
+#include "intern/openexr/openexr_multi.h"
-static void node_composit_init_output_file(bNodeTree *UNUSED(ntree), bNode* node, bNodeTemplate *ntemp)
-{
- RenderData *rd = &ntemp->scene->r;
- NodeImageFile *nif= MEM_callocN(sizeof(NodeImageFile), "node image file");
- node->storage= nif;
-
- BLI_strncpy(nif->name, rd->pic, sizeof(nif->name));
- nif->im_format= rd->im_format;
- if (BKE_imtype_is_movie(nif->im_format.imtype)) {
- nif->im_format.imtype= R_IMF_IMTYPE_OPENEXR;
- }
- nif->sfra= rd->sfra;
- nif->efra= rd->efra;
-}
-
-void register_node_type_cmp_output_file(bNodeTreeType *ttype)
-{
- static bNodeType ntype;
-
- node_type_base(ttype, &ntype, CMP_NODE_OUTPUT_FILE, "File Output", NODE_CLASS_OUTPUT, NODE_PREVIEW|NODE_OPTIONS);
- node_type_socket_templates(&ntype, cmp_node_output_file_in, NULL);
- node_type_size(&ntype, 140, 80, 300);
- node_type_init(&ntype, node_composit_init_output_file);
- node_type_storage(&ntype, "NodeImageFile", node_free_standard_storage, node_copy_standard_storage);
- node_type_exec(&ntype, node_composit_exec_output_file);
-
- nodeRegisterType(ttype, &ntype);
-}
-
-
-/* =============================================================================== */
+/* **************** OUTPUT FILE ******************** */
-void ntreeCompositOutputMultiFileAddSocket(bNodeTree *ntree, bNode *node, ImageFormatData *im_format)
+bNodeSocket *ntreeCompositOutputFileAddSocket(bNodeTree *ntree, bNode *node, const char *name, ImageFormatData *im_format)
{
- bNodeSocket *sock = nodeAddSocket(ntree, node, SOCK_IN, "", SOCK_RGBA);
+ NodeImageMultiFile *nimf = node->storage;
+ bNodeSocket *sock = nodeAddSocket(ntree, node, SOCK_IN, name, SOCK_RGBA);
/* create format data for the input socket */
NodeImageMultiFileSocket *sockdata = MEM_callocN(sizeof(NodeImageMultiFileSocket), "socket image format");
sock->storage = sockdata;
- sock->struct_type = SOCK_STRUCT_OUTPUT_MULTI_FILE;
+ sock->struct_type = SOCK_STRUCT_OUTPUT_FILE;
- if(im_format) {
+ if (im_format) {
sockdata->format= *im_format;
if (BKE_imtype_is_movie(sockdata->format.imtype)) {
sockdata->format.imtype= R_IMF_IMTYPE_OPENEXR;
}
}
- /* use render data format by default */
- sockdata->use_render_format = 1;
+ /* use node data format by default */
+ sockdata->use_node_format = 1;
+
+ nimf->active_input = BLI_findindex(&node->inputs, sock);
+
+ return sock;
}
-int ntreeCompositOutputMultiFileRemoveActiveSocket(bNodeTree *ntree, bNode *node)
+int ntreeCompositOutputFileRemoveActiveSocket(bNodeTree *ntree, bNode *node)
{
NodeImageMultiFile *nimf = node->storage;
bNodeSocket *sock = BLI_findlink(&node->inputs, nimf->active_input);
+ int totinputs = BLI_countlist(&node->inputs);
if (!sock)
return 0;
+ if (nimf->active_input == totinputs-1)
+ --nimf->active_input;
+
/* free format data */
MEM_freeN(sock->storage);
@@ -164,19 +88,25 @@ int ntreeCompositOutputMultiFileRemoveActiveSocket(bNodeTree *ntree, bNode *node
return 1;
}
-static void init_output_multi_file(bNodeTree *ntree, bNode* node, bNodeTemplate *ntemp)
+static void init_output_file(bNodeTree *ntree, bNode* node, bNodeTemplate *ntemp)
{
- RenderData *rd = &ntemp->scene->r;
NodeImageMultiFile *nimf= MEM_callocN(sizeof(NodeImageMultiFile), "node image multi file");
+ ImageFormatData *format = NULL;
node->storage= nimf;
- BLI_strncpy(nimf->base_path, rd->pic, sizeof(nimf->base_path));
+ if (ntemp->scene) {
+ RenderData *rd = &ntemp->scene->r;
+ BLI_strncpy(nimf->base_path, rd->pic, sizeof(nimf->base_path));
+ nimf->format = rd->im_format;
+
+ format = &rd->im_format;
+ }
/* add one socket by default */
- ntreeCompositOutputMultiFileAddSocket(ntree, node, &rd->im_format);
+ ntreeCompositOutputFileAddSocket(ntree, node, "Image", format);
}
-void free_output_multi_file(bNode *node)
+static void free_output_file(bNode *node)
{
bNodeSocket *sock;
@@ -188,7 +118,7 @@ void free_output_multi_file(bNode *node)
MEM_freeN(node->storage);
}
-void copy_output_multi_file(struct bNode *node, struct bNode *target)
+static void copy_output_file(struct bNode *node, struct bNode *target)
{
bNodeSocket *sock, *newsock;
@@ -200,69 +130,209 @@ void copy_output_multi_file(struct bNode *node, struct bNode *target)
}
}
-static void exec_output_multi_file(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out))
+static void update_output_file(bNodeTree *UNUSED(ntree), bNode *node)
{
- RenderData *rd= data;
+ bNodeSocket *sock;
+
+ /* automatically update the socket type based on linked input */
+ for (sock=node->inputs.first; sock; sock=sock->next) {
+ if (sock->link) {
+ int linktype = sock->link->fromsock->type;
+ if (linktype != sock->type)
+ nodeSocketSetType(sock, linktype);
+ }
+ }
+}
+
+/* write input data into individual files */
+static void exec_output_file_singlelayer(RenderData *rd, bNode *node, bNodeStack **in)
+{
+ Main *bmain= G.main; /* TODO, have this passed along */
NodeImageMultiFile *nimf= node->storage;
bNodeSocket *sock;
int i;
+ int has_preview = 0;
for (sock=node->inputs.first, i=0; sock; sock=sock->next, ++i) {
- if (!in[i]->data)
- continue;
-
- if (!G.rendering) {
- /* only output files when rendering a sequence -
- * otherwise, it overwrites the output files just
- * scrubbing through the timeline when the compositor updates */
- return;
- } else {
- Main *bmain= G.main; /* TODO, have this passed along */
+ if (in[i]->data) {
NodeImageMultiFileSocket *sockdata = sock->storage;
- CompBuf *cbuf= typecheck_compbuf(in[i]->data, CB_RGBA);
- ImBuf *ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0);
- ImageFormatData *format = (sockdata->use_render_format ? &rd->im_format : &sockdata->format);
+ ImageFormatData *format = (sockdata->use_node_format ? &nimf->format : &sockdata->format);
char path[FILE_MAX];
- char string[FILE_MAX];
+ char filename[FILE_MAX];
+ CompBuf *cbuf;
+ ImBuf *ibuf;
+
+ switch (format->planes) {
+ case R_IMF_PLANES_BW:
+ cbuf = typecheck_compbuf(in[i]->data, CB_VAL);
+ break;
+ case R_IMF_PLANES_RGB:
+ cbuf = typecheck_compbuf(in[i]->data, CB_VEC3);
+ break;
+ case R_IMF_PLANES_RGBA:
+ cbuf = typecheck_compbuf(in[i]->data, CB_RGBA);
+ break;
+ }
- ibuf->rect_float= cbuf->rect;
- ibuf->dither= rd->dither_intensity;
+ ibuf = IMB_allocImBuf(cbuf->x, cbuf->y, format->planes, 0);
+ /* XXX have to set this explicitly it seems */
+ switch (format->planes) {
+ case R_IMF_PLANES_BW: ibuf->channels = 1; break;
+ case R_IMF_PLANES_RGB: ibuf->channels = 3; break;
+ case R_IMF_PLANES_RGBA: ibuf->channels = 4; break;
+ }
+ ibuf->rect_float = cbuf->rect;
+ ibuf->dither = rd->dither_intensity;
if (rd->color_mgt_flag & R_COLOR_MANAGEMENT)
ibuf->profile = IB_PROFILE_LINEAR_RGB;
/* get full path */
BLI_join_dirfile(path, FILE_MAX, nimf->base_path, sock->name);
+ BKE_makepicstring(filename, path, bmain->name, rd->cfra, format->imtype, (rd->scemode & R_EXTENSION), TRUE);
- BKE_makepicstring(string, path, bmain->name, rd->cfra, format->imtype, (rd->scemode & R_EXTENSION), TRUE);
-
- if(0 == BKE_write_ibuf(ibuf, string, format))
- printf("Cannot save Node File Output to %s\n", string);
+ if (0 == BKE_write_ibuf(ibuf, filename, format))
+ printf("Cannot save Node File Output to %s\n", filename);
else
- printf("Saved: %s\n", string);
+ printf("Saved: %s\n", filename);
- IMB_freeImBuf(ibuf);
+ IMB_freeImBuf(ibuf);
- #if 0 /* XXX not used yet */
- generate_preview(data, node, cbuf);
- #endif
+ /* simply pick the first valid input for preview */
+ if (!has_preview) {
+ generate_preview(rd, node, cbuf);
+ has_preview = 1;
+ }
- if(in[i]->data != cbuf)
+ if (in[i]->data != cbuf)
free_compbuf(cbuf);
}
}
}
-void register_node_type_cmp_output_multi_file(bNodeTreeType *ttype)
+/* write input data into layers */
+static void exec_output_file_multilayer(RenderData *rd, bNode *node, bNodeStack **in)
+{
+ Main *bmain= G.main; /* TODO, have this passed along */
+ NodeImageMultiFile *nimf= node->storage;
+ void *exrhandle= IMB_exr_get_handle();
+ char filename[FILE_MAX];
+ bNodeSocket *sock;
+ int i;
+ /* Must have consistent pixel size for exr file, simply take the first valid input size. */
+ int rectx = -1;
+ int recty = -1;
+ int has_preview = 0;
+
+ BKE_makepicstring(filename, nimf->base_path, bmain->name, rd->cfra, R_IMF_IMTYPE_MULTILAYER, (rd->scemode & R_EXTENSION), TRUE);
+ BLI_make_existing_file(filename);
+
+ for (sock=node->inputs.first, i=0; sock; sock=sock->next, ++i) {
+ if (in[i]->data) {
+ CompBuf *cbuf = in[i]->data;
+ char layname[EXR_LAY_MAXNAME];
+ char channelname[EXR_PASS_MAXNAME];
+ char *channelname_ext;
+
+ if (cbuf->rect_procedural) {
+ printf("Error writing multilayer EXR: Procedural buffer not supported\n");
+ continue;
+ }
+ if (rectx < 0) {
+ rectx = cbuf->x;
+ recty = cbuf->y;
+ }
+ else if (cbuf->x != rectx || cbuf->y != recty) {
+ printf("Error: Multilayer EXR output node %s expects same resolution for all input buffers. Layer %s skipped.\n", node->name, sock->name);
+ continue;
+ }
+
+ BLI_strncpy(layname, sock->name, sizeof(layname));
+ BLI_strncpy(channelname, sock->name, sizeof(channelname)-2);
+ channelname_ext = channelname + strlen(channelname);
+
+ /* create channels */
+ switch (cbuf->type) {
+ case CB_VAL:
+ strcpy(channelname_ext, ".V");
+ IMB_exr_add_channel(exrhandle, layname, channelname, 1, rectx, cbuf->rect);
+ break;
+ case CB_VEC2:
+ strcpy(channelname_ext, ".X");
+ IMB_exr_add_channel(exrhandle, layname, channelname, 2, 2*rectx, cbuf->rect);
+ strcpy(channelname_ext, ".Y");
+ IMB_exr_add_channel(exrhandle, layname, channelname, 2, 2*rectx, cbuf->rect+1);
+ break;
+ case CB_VEC3:
+ strcpy(channelname_ext, ".X");
+ IMB_exr_add_channel(exrhandle, layname, channelname, 3, 3*rectx, cbuf->rect);
+ strcpy(channelname_ext, ".Y");
+ IMB_exr_add_channel(exrhandle, layname, channelname, 3, 3*rectx, cbuf->rect+1);
+ strcpy(channelname_ext, ".Z");
+ IMB_exr_add_channel(exrhandle, layname, channelname, 3, 3*rectx, cbuf->rect+2);
+ break;
+ case CB_RGBA:
+ strcpy(channelname_ext, ".R");
+ IMB_exr_add_channel(exrhandle, layname, channelname, 4, 4*rectx, cbuf->rect);
+ strcpy(channelname_ext, ".G");
+ IMB_exr_add_channel(exrhandle, layname, channelname, 4, 4*rectx, cbuf->rect+1);
+ strcpy(channelname_ext, ".B");
+ IMB_exr_add_channel(exrhandle, layname, channelname, 4, 4*rectx, cbuf->rect+2);
+ strcpy(channelname_ext, ".A");
+ IMB_exr_add_channel(exrhandle, layname, channelname, 4, 4*rectx, cbuf->rect+3);
+ break;
+ }
+
+ /* simply pick the first valid input for preview */
+ if (!has_preview) {
+ generate_preview(rd, node, cbuf);
+ has_preview = 1;
+ }
+ }
+ }
+
+ /* when the filename has no permissions, this can fail */
+ if (IMB_exr_begin_write(exrhandle, filename, rectx, recty, nimf->format.exr_codec)) {
+ IMB_exr_write_channels(exrhandle);
+ }
+ else {
+ /* TODO, get the error from openexr's exception */
+ /* XXX nice way to do report? */
+ printf("Error Writing Render Result, see console\n");
+ }
+
+ IMB_exr_close(exrhandle);
+}
+
+static void exec_output_file(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out))
+{
+ RenderData *rd= data;
+ NodeImageMultiFile *nimf= node->storage;
+
+ if (!G.rendering) {
+ /* only output files when rendering a sequence -
+ * otherwise, it overwrites the output files just
+ * scrubbing through the timeline when the compositor updates */
+ return;
+ }
+
+ if (nimf->format.imtype==R_IMF_IMTYPE_MULTILAYER)
+ exec_output_file_multilayer(rd, node, in);
+ else
+ exec_output_file_singlelayer(rd, node, in);
+}
+
+void register_node_type_cmp_output_file(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(ttype, &ntype, CMP_NODE_OUTPUT_MULTI_FILE, "Multi File Output", NODE_CLASS_OUTPUT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, CMP_NODE_OUTPUT_FILE, "File Output", NODE_CLASS_OUTPUT, NODE_OPTIONS|NODE_PREVIEW);
node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 140, 80, 300);
- node_type_init(&ntype, init_output_multi_file);
- node_type_storage(&ntype, "NodeImageMultiFile", free_output_multi_file, copy_output_multi_file);
- node_type_exec(&ntype, exec_output_multi_file);
+ node_type_init(&ntype, init_output_file);
+ node_type_storage(&ntype, "NodeImageMultiFile", free_output_file, copy_output_file);
+ node_type_update(&ntype, update_output_file, NULL);
+ node_type_exec(&ntype, exec_output_file);
nodeRegisterType(ttype, &ntype);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_premulkey.c b/source/blender/nodes/composite/nodes/node_composite_premulkey.c
index bf934fcd0f7..3d8b0108bbb 100644
--- a/source/blender/nodes/composite/nodes/node_composite_premulkey.c
+++ b/source/blender/nodes/composite/nodes/node_composite_premulkey.c
@@ -46,17 +46,17 @@ static bNodeSocketTemplate cmp_node_premulkey_out[]= {
static void node_composit_exec_premulkey(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
{
- if(out[0]->hasoutput==0)
+ if (out[0]->hasoutput==0)
return;
- if(in[0]->data) {
+ if (in[0]->data) {
CompBuf *stackbuf, *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
stackbuf= dupalloc_compbuf(cbuf);
premul_compbuf(stackbuf, node->custom1 == 1);
out[0]->data = stackbuf;
- if(cbuf != in[0]->data)
+ if (cbuf != in[0]->data)
free_compbuf(cbuf);
}
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_rotate.c b/source/blender/nodes/composite/nodes/node_composite_rotate.c
index 141fcef457f..6952817248d 100644
--- a/source/blender/nodes/composite/nodes/node_composite_rotate.c
+++ b/source/blender/nodes/composite/nodes/node_composite_rotate.c
@@ -48,10 +48,10 @@ static bNodeSocketTemplate cmp_node_rotate_out[]= {
static void node_composit_exec_rotate(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
{
- if(out[0]->hasoutput==0)
+ if (out[0]->hasoutput==0)
return;
- if(in[0]->data) {
+ if (in[0]->data) {
CompBuf *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* note, this returns zero'd image */
float rad, u, v, s, c, centx, centy, miny, maxy, minx, maxx;
@@ -75,14 +75,14 @@ static void node_composit_exec_rotate(void *UNUSED(data), bNode *node, bNodeStac
ibuf=IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0);
obuf=IMB_allocImBuf(stackbuf->x, stackbuf->y, 32, 0);
- if(ibuf && obuf){
+ if (ibuf && obuf) {
ibuf->rect_float=cbuf->rect;
obuf->rect_float=stackbuf->rect;
- for(y=miny; y<maxy; y++) {
+ for (y=miny; y<maxy; y++) {
yo= y+(int)centy;
- for(x=minx; x<maxx;x++) {
+ for (x=minx; x<maxx;x++) {
u=c*x + y*s + centx;
v=-s*x + c*y + centy;
xo= x+(int)centx;
@@ -115,7 +115,7 @@ static void node_composit_exec_rotate(void *UNUSED(data), bNode *node, bNodeStac
/* pass on output and free */
out[0]->data= stackbuf;
- if(cbuf!=in[0]->data) {
+ if (cbuf!=in[0]->data) {
free_compbuf(cbuf);
}
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_scale.c b/source/blender/nodes/composite/nodes/node_composite_scale.c
index 188449df5fb..38cce50904b 100644
--- a/source/blender/nodes/composite/nodes/node_composite_scale.c
+++ b/source/blender/nodes/composite/nodes/node_composite_scale.c
@@ -49,27 +49,28 @@ static bNodeSocketTemplate cmp_node_scale_out[]= {
/* node->custom1 stores if input values are absolute or relative scale */
static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
{
- if(out[0]->hasoutput==0)
+ if (out[0]->hasoutput==0)
return;
- if(in[0]->data) {
+ if (in[0]->data) {
RenderData *rd= data;
CompBuf *stackbuf, *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
ImBuf *ibuf;
int newx, newy;
- if(node->custom1==CMP_SCALE_RELATIVE) {
+ if (node->custom1==CMP_SCALE_RELATIVE) {
newx= MAX2((int)(in[1]->vec[0]*cbuf->x), 1);
newy= MAX2((int)(in[2]->vec[0]*cbuf->y), 1);
}
- else if(node->custom1==CMP_SCALE_SCENEPERCENT) {
+ else if (node->custom1==CMP_SCALE_SCENEPERCENT) {
newx = cbuf->x * (rd->size / 100.0f);
newy = cbuf->y * (rd->size / 100.0f);
}
else if (node->custom1==CMP_SCALE_RENDERPERCENT) {
newx= (rd->xsch * rd->size)/100;
newy= (rd->ysch * rd->size)/100;
- } else { /* CMP_SCALE_ABSOLUTE */
+ }
+ else { /* CMP_SCALE_ABSOLUTE */
newx= MAX2((int)in[1]->vec[0], 1);
newy= MAX2((int)in[2]->vec[0], 1);
}
@@ -77,11 +78,11 @@ static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, b
newy= MIN2(newy, CMP_SCALE_MAX);
ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0);
- if(ibuf) {
+ if (ibuf) {
ibuf->rect_float= cbuf->rect;
IMB_scaleImBuf(ibuf, newx, newy);
- if(ibuf->rect_float == cbuf->rect) {
+ if (ibuf->rect_float == cbuf->rect) {
/* no scaling happened. */
stackbuf= pass_on_compbuf(in[0]->data);
}
@@ -105,7 +106,7 @@ static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, b
}
out[0]->data= stackbuf;
- if(cbuf!=in[0]->data)
+ if (cbuf!=in[0]->data)
free_compbuf(cbuf);
}
else if (node->custom1==CMP_SCALE_ABSOLUTE) {
@@ -120,7 +121,7 @@ static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, b
fp = stackbuf->rect;
a = stackbuf->x * stackbuf->y;
- while(a--) {
+ while (a--) {
copy_v4_v4(fp, in[0]->vec);
fp += 4;
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
index d742a916fdf..6dac2d16401 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
@@ -64,7 +64,7 @@ static void node_composit_exec_sephsva(void *UNUSED(data), bNode *node, bNodeSta
/* stack order in: col */
/* input no image? then only color operation */
- if(in[0]->data==NULL) {
+ if (in[0]->data==NULL) {
float h, s, v;
rgb_to_hsv(in[0]->vec[0], in[0]->vec[1], in[0]->vec[2], &h, &s, &v);
@@ -83,17 +83,17 @@ static void node_composit_exec_sephsva(void *UNUSED(data), bNode *node, bNodeSta
composit1_pixel_processor(node, cbuf2, cbuf2, in[0]->vec, do_sephsva, CB_RGBA);
/* separate each of those channels */
- if(out[0]->hasoutput)
+ if (out[0]->hasoutput)
out[0]->data= valbuf_from_rgbabuf(cbuf2, CHAN_R);
- if(out[1]->hasoutput)
+ if (out[1]->hasoutput)
out[1]->data= valbuf_from_rgbabuf(cbuf2, CHAN_G);
- if(out[2]->hasoutput)
+ if (out[2]->hasoutput)
out[2]->data= valbuf_from_rgbabuf(cbuf2, CHAN_B);
- if(out[3]->hasoutput)
+ if (out[3]->hasoutput)
out[3]->data= valbuf_from_rgbabuf(cbuf2, CHAN_A);
/*not used anymore */
- if(cbuf2!=cbuf)
+ if (cbuf2!=cbuf)
free_compbuf(cbuf2);
free_compbuf(cbuf);
}
@@ -141,11 +141,10 @@ static void node_composit_exec_combhsva(void *UNUSED(data), bNode *node, bNodeSt
/* stack order out: 1 rgba channels */
/* stack order in: 4 value channels */
- /* input no image? then only color operation */
- if((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) {
- out[0]->vec[0] = in[0]->vec[0];
- out[0]->vec[1] = in[1]->vec[0];
- out[0]->vec[2] = in[2]->vec[0];
+ /* input no image? then only color operation in HSV */
+ if ((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) {
+ hsv_to_rgb(in[0]->vec[0], in[1]->vec[0], in[2]->vec[0],
+ &out[0]->vec[0], &out[0]->vec[1], &out[0]->vec[2]);
out[0]->vec[3] = in[3]->vec[0];
}
else {
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c
index 1f0b504f161..be4a8ac76fe 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c
@@ -51,7 +51,7 @@ static void node_composit_exec_seprgba(void *UNUSED(data), bNode *UNUSED(node),
/* stack order in: col */
/* input no image? then only color operation */
- if(in[0]->data==NULL) {
+ if (in[0]->data==NULL) {
out[0]->vec[0] = in[0]->vec[0];
out[1]->vec[0] = in[0]->vec[1];
out[2]->vec[0] = in[0]->vec[2];
@@ -62,16 +62,16 @@ static void node_composit_exec_seprgba(void *UNUSED(data), bNode *UNUSED(node),
CompBuf *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
/* don't do any pixel processing, just copy the stack directly (faster, I presume) */
- if(out[0]->hasoutput)
+ if (out[0]->hasoutput)
out[0]->data= valbuf_from_rgbabuf(cbuf, CHAN_R);
- if(out[1]->hasoutput)
+ if (out[1]->hasoutput)
out[1]->data= valbuf_from_rgbabuf(cbuf, CHAN_G);
- if(out[2]->hasoutput)
+ if (out[2]->hasoutput)
out[2]->data= valbuf_from_rgbabuf(cbuf, CHAN_B);
- if(out[3]->hasoutput)
+ if (out[3]->hasoutput)
out[3]->data= valbuf_from_rgbabuf(cbuf, CHAN_A);
- if(cbuf!=in[0]->data)
+ if (cbuf!=in[0]->data)
free_compbuf(cbuf);
}
@@ -118,7 +118,7 @@ static void node_composit_exec_combrgba(void *UNUSED(data), bNode *node, bNodeSt
/* stack order in: 4 value channels */
/* input no image? then only color operation */
- if((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) {
+ if ((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) {
out[0]->vec[0] = in[0]->vec[0];
out[0]->vec[1] = in[1]->vec[0];
out[0]->vec[2] = in[2]->vec[0];
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
index a5f827b094d..b12f08bb13d 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
@@ -88,7 +88,7 @@ static void do_sepycca_jfif(bNode *UNUSED(node), float *out, float *in)
static void node_composit_exec_sepycca(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
{
/* input no image? then only color operation */
- if(in[0]->data==NULL) {
+ if (in[0]->data==NULL) {
float y, cb, cr;
switch(node->custom1)
@@ -132,17 +132,17 @@ static void node_composit_exec_sepycca(void *UNUSED(data), bNode *node, bNodeSta
}
/* separate each of those channels */
- if(out[0]->hasoutput)
+ if (out[0]->hasoutput)
out[0]->data= valbuf_from_rgbabuf(cbuf2, CHAN_R);
- if(out[1]->hasoutput)
+ if (out[1]->hasoutput)
out[1]->data= valbuf_from_rgbabuf(cbuf2, CHAN_G);
- if(out[2]->hasoutput)
+ if (out[2]->hasoutput)
out[2]->data= valbuf_from_rgbabuf(cbuf2, CHAN_B);
- if(out[3]->hasoutput)
+ if (out[3]->hasoutput)
out[3]->data= valbuf_from_rgbabuf(cbuf2, CHAN_A);
/*not used anymore */
- if(cbuf2!=cbuf)
+ if (cbuf2!=cbuf)
free_compbuf(cbuf2);
free_compbuf(cbuf);
}
@@ -235,7 +235,7 @@ static void node_composit_exec_combycca(void *UNUSED(data), bNode *node, bNodeSt
/* stack order in: 4 value channels */
/* input no image? then only color operation */
- if((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) {
+ if ((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) {
float y = in[0]->vec[0] * 255;
float cb = in[1]->vec[0] * 255;
float cr = in[2]->vec[0] * 255;
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
index 2a2f64a5209..8dd551643f5 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
@@ -64,7 +64,7 @@ static void node_composit_exec_sepyuva(void *UNUSED(data), bNode *node, bNodeSta
/* stack order in: col */
/* input no image? then only color operation */
- if(in[0]->data==NULL) {
+ if (in[0]->data==NULL) {
float y, u, v;
rgb_to_yuv(in[0]->vec[0], in[0]->vec[1], in[0]->vec[2], &y, &u, &v);
@@ -83,17 +83,17 @@ static void node_composit_exec_sepyuva(void *UNUSED(data), bNode *node, bNodeSta
composit1_pixel_processor(node, cbuf2, cbuf2, in[0]->vec, do_sepyuva, CB_RGBA);
/* separate each of those channels */
- if(out[0]->hasoutput)
+ if (out[0]->hasoutput)
out[0]->data= valbuf_from_rgbabuf(cbuf2, CHAN_R);
- if(out[1]->hasoutput)
+ if (out[1]->hasoutput)
out[1]->data= valbuf_from_rgbabuf(cbuf2, CHAN_G);
- if(out[2]->hasoutput)
+ if (out[2]->hasoutput)
out[2]->data= valbuf_from_rgbabuf(cbuf2, CHAN_B);
- if(out[3]->hasoutput)
+ if (out[3]->hasoutput)
out[3]->data= valbuf_from_rgbabuf(cbuf2, CHAN_A);
/*not used anymore */
- if(cbuf2!=cbuf)
+ if (cbuf2!=cbuf)
free_compbuf(cbuf2);
free_compbuf(cbuf);
}
@@ -143,7 +143,7 @@ static void node_composit_exec_combyuva(void *UNUSED(data), bNode *node, bNodeSt
/* stack order in: 4 value channels */
/* input no image? then only color operation */
- if((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) {
+ if ((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) {
out[0]->vec[0] = in[0]->vec[0];
out[0]->vec[1] = in[1]->vec[0];
out[0]->vec[2] = in[2]->vec[0];
diff --git a/source/blender/nodes/composite/nodes/node_composite_setalpha.c b/source/blender/nodes/composite/nodes/node_composite_setalpha.c
index 6c24185bb88..646bcc47617 100644
--- a/source/blender/nodes/composite/nodes/node_composite_setalpha.c
+++ b/source/blender/nodes/composite/nodes/node_composite_setalpha.c
@@ -49,7 +49,7 @@ static void node_composit_exec_setalpha(void *UNUSED(data), bNode *node, bNodeSt
/* stack order in: col, alpha */
/* input no image? then only color operation */
- if(in[0]->data==NULL && in[1]->data==NULL) {
+ if (in[0]->data==NULL && in[1]->data==NULL) {
out[0]->vec[0] = in[0]->vec[0];
out[0]->vec[1] = in[0]->vec[1];
out[0]->vec[2] = in[0]->vec[2];
@@ -60,7 +60,7 @@ static void node_composit_exec_setalpha(void *UNUSED(data), bNode *node, bNodeSt
CompBuf *cbuf= in[0]->data?in[0]->data:in[1]->data;
CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
- if(in[1]->data==NULL && in[1]->vec[0]==1.0f) {
+ if (in[1]->data==NULL && in[1]->vec[0]==1.0f) {
/* pass on image */
composit1_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, do_copy_rgb, CB_RGBA);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_splitViewer.c b/source/blender/nodes/composite/nodes/node_composite_splitViewer.c
index 16356098fe6..c2263053987 100644
--- a/source/blender/nodes/composite/nodes/node_composite_splitViewer.c
+++ b/source/blender/nodes/composite/nodes/node_composite_splitViewer.c
@@ -41,7 +41,7 @@ static bNodeSocketTemplate cmp_node_splitviewer_in[]= {
static void do_copy_split_rgba(bNode *UNUSED(node), float *out, float *in1, float *in2, float *fac)
{
- if(*fac==0.0f) {
+ if (*fac==0.0f) {
copy_v4_v4(out, in1);
}
else {
@@ -54,10 +54,10 @@ static void node_composit_exec_splitviewer(void *data, bNode *node, bNodeStack *
/* image assigned to output */
/* stack order input sockets: image image */
- if(in[0]->data==NULL || in[1]->data==NULL)
+ if (in[0]->data==NULL || in[1]->data==NULL)
return;
- if(node->id && (node->flag & NODE_DO_OUTPUT)) { /* only one works on out */
+ if (node->id && (node->flag & NODE_DO_OUTPUT)) { /* only one works on out */
Image *ima= (Image *)node->id;
RenderData *rd= data;
ImBuf *ibuf;
@@ -73,7 +73,7 @@ static void node_composit_exec_splitviewer(void *data, bNode *node, bNodeStack *
/* always returns for viewer image, but we check nevertheless */
ibuf= BKE_image_acquire_ibuf(ima, node->storage, &lock);
- if(ibuf==NULL) {
+ if (ibuf==NULL) {
printf("node_composit_exec_viewer error\n");
BKE_image_release_ibuf(ima, lock);
return;
@@ -100,7 +100,7 @@ static void node_composit_exec_splitviewer(void *data, bNode *node, bNodeStack *
/* Check which offset mode is selected and limit offset if needed */
- if(node->custom2 == 0) {
+ if (node->custom2 == 0) {
offset = buf1->x / 100.0f * node->custom1;
CLAMP(offset, 0, buf1->x);
}
@@ -109,17 +109,17 @@ static void node_composit_exec_splitviewer(void *data, bNode *node, bNodeStack *
CLAMP(offset, 0, buf1->y);
}
- if(node->custom2 == 0) {
- for(y=0; y<buf1->y; y++) {
+ if (node->custom2 == 0) {
+ for (y=0; y<buf1->y; y++) {
float *fac= mask->rect + y*buf1->x;
- for(x=offset; x>0; x--, fac++)
+ for (x=offset; x>0; x--, fac++)
*fac= 1.0f;
}
}
else {
- for(y=0; y<offset; y++) {
+ for (y=0; y<offset; y++) {
float *fac= mask->rect + y*buf1->x;
- for(x=buf1->x; x>0; x--, fac++)
+ for (x=buf1->x; x>0; x--, fac++)
*fac= 1.0f;
}
}
@@ -132,9 +132,9 @@ static void node_composit_exec_splitviewer(void *data, bNode *node, bNodeStack *
free_compbuf(cbuf);
free_compbuf(mask);
- if(in[0]->data != buf1)
+ if (in[0]->data != buf1)
free_compbuf(buf1);
- if(in[1]->data != buf2)
+ if (in[1]->data != buf2)
free_compbuf(buf2);
}
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c b/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c
index f41751b3e15..0eac85c4030 100644
--- a/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c
+++ b/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c
@@ -47,7 +47,7 @@ static bNodeSocketTemplate cmp_node_stabilize2d_out[]= {
static void node_composit_exec_stabilize2d(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
{
- if(in[0]->data && node->id) {
+ if (in[0]->data && node->id) {
RenderData *rd= data;
MovieClip *clip= (MovieClip *)node->id;
CompBuf *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
@@ -61,7 +61,7 @@ static void node_composit_exec_stabilize2d(void *data, bNode *node, bNodeStack *
/* pass on output and free */
out[0]->data= stackbuf;
- if(cbuf!=in[0]->data)
+ if (cbuf!=in[0]->data)
free_compbuf(cbuf);
}
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_texture.c b/source/blender/nodes/composite/nodes/node_composite_texture.c
index 7f8f14bcfc5..562e2b2737e 100644
--- a/source/blender/nodes/composite/nodes/node_composite_texture.c
+++ b/source/blender/nodes/composite/nodes/node_composite_texture.c
@@ -60,19 +60,19 @@ static void texture_procedural(CompBuf *cbuf, float *out, float xco, float yco)
retval= multitex_ext((Tex *)node->id, vec, NULL, NULL, 0, &texres);
- if(type==CB_VAL) {
- if(texres.talpha)
+ if (type==CB_VAL) {
+ if (texres.talpha)
col[0]= texres.ta;
else
col[0]= texres.tin;
}
- else if(type==CB_RGBA) {
- if(texres.talpha)
+ else if (type==CB_RGBA) {
+ if (texres.talpha)
col[3]= texres.ta;
else
col[3]= texres.tin;
- if((retval & TEX_RGB)) {
+ if ((retval & TEX_RGB)) {
col[0]= texres.tr;
col[1]= texres.tg;
col[2]= texres.tb;
@@ -92,7 +92,7 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in,
{
/* outputs: value, color, normal */
- if(node->id) {
+ if (node->id) {
RenderData *rd= data;
short sizex, sizey;
@@ -113,7 +113,7 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in,
sizex = (rd->size*rd->xsch)/100;
sizey = (rd->size*rd->ysch)/100;
- if(out[0]->hasoutput) {
+ if (out[0]->hasoutput) {
CompBuf *stackbuf= alloc_compbuf(sizex, sizey, CB_VAL, 1); /* alloc */
stackbuf->rect_procedural= texture_procedural;
@@ -126,7 +126,7 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in,
out[0]->data= stackbuf;
}
- if(out[1]->hasoutput) {
+ if (out[1]->hasoutput) {
CompBuf *stackbuf= alloc_compbuf(sizex, sizey, CB_RGBA, 1); /* alloc */
stackbuf->rect_procedural= texture_procedural;
diff --git a/source/blender/nodes/composite/nodes/node_composite_tonemap.c b/source/blender/nodes/composite/nodes/node_composite_tonemap.c
index 9b34e117496..baa5ba046dd 100644
--- a/source/blender/nodes/composite/nodes/node_composite_tonemap.c
+++ b/source/blender/nodes/composite/nodes/node_composite_tonemap.c
@@ -142,7 +142,7 @@ static void node_composit_exec_tonemap(void *UNUSED(data), bNode *node, bNodeSta
out[0]->data = new;
- if(img!=in[0]->data)
+ if (img!=in[0]->data)
free_compbuf(img);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_transform.c b/source/blender/nodes/composite/nodes/node_composite_transform.c
index a016f3d1d96..a610d8a66c4 100644
--- a/source/blender/nodes/composite/nodes/node_composite_transform.c
+++ b/source/blender/nodes/composite/nodes/node_composite_transform.c
@@ -77,14 +77,14 @@ CompBuf* node_composit_transform(CompBuf *cbuf, float x, float y, float angle, f
ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0);
obuf= IMB_allocImBuf(stackbuf->x, stackbuf->y, 32, 0);
- if(ibuf && obuf) {
+ if (ibuf && obuf) {
int i, j;
ibuf->rect_float= cbuf->rect;
obuf->rect_float= stackbuf->rect;
- for(j=0; j<cbuf->y; j++) {
- for(i=0; i<cbuf->x;i++) {
+ for (j=0; j<cbuf->y; j++) {
+ for (i=0; i<cbuf->x;i++) {
float vec[3]= {i, j, 0};
mul_v3_m4v3(vec, mat, vec);
@@ -113,7 +113,7 @@ CompBuf* node_composit_transform(CompBuf *cbuf, float x, float y, float angle, f
static void node_composit_exec_transform(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
{
- if(in[0]->data) {
+ if (in[0]->data) {
CompBuf *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
CompBuf *stackbuf;
@@ -122,7 +122,7 @@ static void node_composit_exec_transform(void *UNUSED(data), bNode *node, bNodeS
/* pass on output and free */
out[0]->data= stackbuf;
- if(cbuf!=in[0]->data)
+ if (cbuf!=in[0]->data)
free_compbuf(cbuf);
}
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_translate.c b/source/blender/nodes/composite/nodes/node_composite_translate.c
index 073b035add0..970e2c79f14 100644
--- a/source/blender/nodes/composite/nodes/node_composite_translate.c
+++ b/source/blender/nodes/composite/nodes/node_composite_translate.c
@@ -48,7 +48,7 @@ static bNodeSocketTemplate cmp_node_translate_out[]= {
static void node_composit_exec_translate(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **in, bNodeStack **out)
{
- if(in[0]->data) {
+ if (in[0]->data) {
CompBuf *cbuf= in[0]->data;
CompBuf *stackbuf= pass_on_compbuf(cbuf);
diff --git a/source/blender/nodes/composite/nodes/node_composite_valToRgb.c b/source/blender/nodes/composite/nodes/node_composite_valToRgb.c
index 30f624641d1..86986f6038d 100644
--- a/source/blender/nodes/composite/nodes/node_composite_valToRgb.c
+++ b/source/blender/nodes/composite/nodes/node_composite_valToRgb.c
@@ -54,12 +54,12 @@ static void node_composit_exec_valtorgb(void *UNUSED(data), bNode *node, bNodeSt
/* stack order in: fac */
/* stack order out: col, alpha */
- if(out[0]->hasoutput==0 && out[1]->hasoutput==0)
+ if (out[0]->hasoutput==0 && out[1]->hasoutput==0)
return;
- if(node->storage) {
+ if (node->storage) {
/* input no image? then only color operation */
- if(in[0]->data==NULL) {
+ if (in[0]->data==NULL) {
do_colorband(node->storage, in[0]->vec[0], out[0]->vec);
}
else {
@@ -71,7 +71,7 @@ static void node_composit_exec_valtorgb(void *UNUSED(data), bNode *node, bNodeSt
out[0]->data= stackbuf;
- if(out[1]->hasoutput)
+ if (out[1]->hasoutput)
out[1]->data= valbuf_from_rgbabuf(stackbuf, CHAN_A);
}
@@ -119,11 +119,11 @@ static void node_composit_exec_rgbtobw(void *UNUSED(data), bNode *node, bNodeSta
/* stack order out: bw */
/* stack order in: col */
- if(out[0]->hasoutput==0)
+ if (out[0]->hasoutput==0)
return;
/* input no image? then only color operation */
- if(in[0]->data==NULL) {
+ if (in[0]->data==NULL) {
do_rgbtobw(node, out[0]->vec, in[0]->vec);
}
else {
diff --git a/source/blender/nodes/composite/nodes/node_composite_vecBlur.c b/source/blender/nodes/composite/nodes/node_composite_vecBlur.c
index 69f896e9bb5..1d4662aa87b 100644
--- a/source/blender/nodes/composite/nodes/node_composite_vecBlur.c
+++ b/source/blender/nodes/composite/nodes/node_composite_vecBlur.c
@@ -52,21 +52,21 @@ static void node_composit_exec_vecblur(void *UNUSED(data), bNode *node, bNodeSta
NodeBlurData *nbd= node->storage;
CompBuf *new, *img= in[0]->data, *vecbuf= in[2]->data, *zbuf= in[1]->data;
- if(img==NULL || vecbuf==NULL || zbuf==NULL || out[0]->hasoutput==0)
+ if (img==NULL || vecbuf==NULL || zbuf==NULL || out[0]->hasoutput==0)
return;
- if(vecbuf->x!=img->x || vecbuf->y!=img->y) {
+ if (vecbuf->x!=img->x || vecbuf->y!=img->y) {
printf("ERROR: cannot do different sized vecbuf yet\n");
return;
}
- if(vecbuf->type!=CB_VEC4) {
+ if (vecbuf->type!=CB_VEC4) {
printf("ERROR: input should be vecbuf\n");
return;
}
- if(zbuf->type!=CB_VAL) {
+ if (zbuf->type!=CB_VAL) {
printf("ERROR: input should be zbuf\n");
return;
}
- if(zbuf->x!=img->x || zbuf->y!=img->y) {
+ if (zbuf->x!=img->x || zbuf->y!=img->y) {
printf("ERROR: cannot do different sized zbuf yet\n");
return;
}
@@ -81,7 +81,7 @@ static void node_composit_exec_vecblur(void *UNUSED(data), bNode *node, bNodeSta
out[0]->data= new;
- if(img!=in[0]->data)
+ if (img!=in[0]->data)
free_compbuf(img);
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_viewer.c b/source/blender/nodes/composite/nodes/node_composite_viewer.c
index f1a6cae62ab..f9b1e55f29f 100644
--- a/source/blender/nodes/composite/nodes/node_composite_viewer.c
+++ b/source/blender/nodes/composite/nodes/node_composite_viewer.c
@@ -47,7 +47,7 @@ static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in,
/* image assigned to output */
/* stack order input sockets: col, alpha, z */
- if(node->id && (node->flag & NODE_DO_OUTPUT)) { /* only one works on out */
+ if (node->id && (node->flag & NODE_DO_OUTPUT)) { /* only one works on out */
RenderData *rd= data;
Image *ima= (Image *)node->id;
ImBuf *ibuf;
@@ -59,7 +59,7 @@ static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in,
/* always returns for viewer image, but we check nevertheless */
ibuf= BKE_image_acquire_ibuf(ima, node->storage, &lock);
- if(ibuf==NULL) {
+ if (ibuf==NULL) {
printf("node_composit_exec_viewer error\n");
BKE_image_release_ibuf(ima, lock);
return;
@@ -72,7 +72,7 @@ static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in,
/* get size */
tbuf= in[0]->data?in[0]->data:(in[1]->data?in[1]->data:in[2]->data);
- if(tbuf==NULL) {
+ if (tbuf==NULL) {
rectx= 320; recty= 256;
}
else {
@@ -92,14 +92,14 @@ static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in,
cbuf->rect= ibuf->rect_float;
/* when no alpha, we can simply copy */
- if(in[1]->data==NULL) {
+ if (in[1]->data==NULL) {
composit1_pixel_processor(node, cbuf, in[0]->data, in[0]->vec, do_copy_rgba, CB_RGBA);
}
else
composit2_pixel_processor(node, cbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, do_copy_a_rgba, CB_RGBA, CB_VAL);
/* zbuf option */
- if(in[2]->data) {
+ if (in[2]->data) {
CompBuf *zbuf= alloc_compbuf(rectx, recty, CB_VAL, 1);
ibuf->zbuf_float= zbuf->rect;
ibuf->mall |= IB_zbuffloat;
@@ -117,7 +117,7 @@ static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in,
free_compbuf(cbuf);
}
- else if(in[0]->data) {
+ else if (in[0]->data) {
generate_preview(data, node, in[0]->data);
}
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_zcombine.c b/source/blender/nodes/composite/nodes/node_composite_zcombine.c
index 57b0b7bbf14..64342751e84 100644
--- a/source/blender/nodes/composite/nodes/node_composite_zcombine.c
+++ b/source/blender/nodes/composite/nodes/node_composite_zcombine.c
@@ -53,7 +53,7 @@ static void do_zcombine(bNode *node, float *out, float *src1, float *z1, float *
float alpha;
float malpha;
- if(*z1 <= *z2) {
+ if (*z1 <= *z2) {
if (node->custom1) {
// use alpha in combine operation
alpha= src1[3];
@@ -83,16 +83,16 @@ static void do_zcombine(bNode *node, float *out, float *src1, float *z1, float *
copy_v4_v4(out, src1);
}
- if(node->custom2)
+ if (node->custom2)
*z1= *z2;
}
}
static void do_zcombine_mask(bNode *node, float *out, float *z1, float *z2)
{
- if(*z1 > *z2) {
+ if (*z1 > *z2) {
*out= 1.0f;
- if(node->custom2)
+ if (node->custom2)
*z1= *z2;
}
}
@@ -145,24 +145,24 @@ static void node_composit_exec_zcombine(void *data, bNode *node, bNodeStack **in
/* stack order in: col z col z */
/* stack order out: col z */
- if(out[0]->hasoutput==0 && out[1]->hasoutput==0)
+ if (out[0]->hasoutput==0 && out[1]->hasoutput==0)
return;
/* no input image; do nothing now */
- if(in[0]->data==NULL) {
+ if (in[0]->data==NULL) {
return;
}
- if(out[1]->hasoutput) {
+ if (out[1]->hasoutput) {
/* copy or make a buffer for for the first z value, here we write result in */
- if(in[1]->data)
+ if (in[1]->data)
zbuf= dupalloc_compbuf(in[1]->data);
else {
float *zval;
int tot= cbuf->x*cbuf->y;
zbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);
- for(zval= zbuf->rect; tot; tot--, zval++)
+ for (zval= zbuf->rect; tot; tot--, zval++)
*zval= in[1]->vec[0];
}
/* lazy coder hack */
@@ -174,7 +174,7 @@ static void node_composit_exec_zcombine(void *data, bNode *node, bNodeStack **in
zbuf= in[1]->data;
}
- if(rd->scemode & R_FULL_SAMPLE) {
+ if (rd->scemode & R_FULL_SAMPLE) {
/* make output size of first input image */
CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); // allocs
@@ -199,16 +199,16 @@ static void node_composit_exec_zcombine(void *data, bNode *node, bNodeStack **in
/* convert to char */
aabuf= MEM_mallocN(cbuf->x*cbuf->y, "aa buf");
fp= mbuf->rect;
- for(x= cbuf->x*cbuf->y-1; x>=0; x--)
- if(fp[x]==0.0f) aabuf[x]= 0;
+ for (x= cbuf->x*cbuf->y-1; x>=0; x--)
+ if (fp[x]==0.0f) aabuf[x]= 0;
else aabuf[x]= 255;
antialias_tagbuf(cbuf->x, cbuf->y, aabuf);
/* convert to float */
fp= mbuf->rect;
- for(x= cbuf->x*cbuf->y-1; x>=0; x--)
- if(aabuf[x]>1)
+ for (x= cbuf->x*cbuf->y-1; x>=0; x--)
+ if (aabuf[x]>1)
fp[x]= (1.0f/255.0f)*(float)aabuf[x];
composit3_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[2]->data, in[2]->vec, mbuf, NULL,
diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c
index e5571b19614..d2ec5ee032b 100644
--- a/source/blender/nodes/intern/node_common.c
+++ b/source/blender/nodes/intern/node_common.c
@@ -40,6 +40,8 @@
#include "BLI_string.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_action.h"
#include "BKE_animsys.h"
#include "BKE_global.h"
@@ -103,7 +105,7 @@ bNodeSocket *node_group_add_extern_socket(bNodeTree *UNUSED(ntree), ListBase *lb
sock->default_value = node_socket_make_default_value(sock->type);
node_socket_copy_default_value(sock->type, sock->default_value, gsock->default_value);
- if(lb)
+ if (lb)
BLI_addtail(lb, sock);
return sock;
@@ -123,42 +125,42 @@ bNode *node_group_make_from_selected(bNodeTree *ntree)
INIT_MINMAX2(min, max);
/* is there something to group? also do some clearing */
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->flag & NODE_SELECT) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->flag & NODE_SELECT) {
/* no groups in groups */
- if(node->type==NODE_GROUP)
+ if (node->type==NODE_GROUP)
return NULL;
DO_MINMAX2( (&node->locx), min, max);
totnode++;
}
node->done= 0;
}
- if(totnode==0) return NULL;
+ if (totnode==0) return NULL;
/* check if all connections are OK, no unselected node has both
inputs and outputs to a selection */
- for(link= ntree->links.first; link; link= link->next) {
- if(link->fromnode && link->tonode && link->fromnode->flag & NODE_SELECT)
+ for (link= ntree->links.first; link; link= link->next) {
+ if (link->fromnode && link->tonode && link->fromnode->flag & NODE_SELECT)
link->tonode->done |= 1;
- if(link->fromnode && link->tonode && link->tonode->flag & NODE_SELECT)
+ if (link->fromnode && link->tonode && link->tonode->flag & NODE_SELECT)
link->fromnode->done |= 2;
}
- for(node= ntree->nodes.first; node; node= node->next) {
- if((node->flag & NODE_SELECT)==0)
- if(node->done==3)
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if ((node->flag & NODE_SELECT)==0)
+ if (node->done==3)
break;
}
- if(node)
+ if (node)
return NULL;
/* OK! new nodetree */
ngroup= ntreeAddTree("NodeGroup", ntree->type, NODE_GROUP);
/* move nodes over */
- for(node= ntree->nodes.first; node; node= nextn) {
+ for (node= ntree->nodes.first; node; node= nextn) {
nextn= node->next;
- if(node->flag & NODE_SELECT) {
+ if (node->flag & NODE_SELECT) {
/* keep track of this node's RNA "base" path (the part of the pat identifying the node)
* if the old nodetree has animation data which potentially covers this node
*/
@@ -208,20 +210,20 @@ bNode *node_group_make_from_selected(bNodeTree *ntree)
gnode->locy= 0.5f*(min[1]+max[1]);
/* relink external sockets */
- for(link= ntree->links.first; link; link= linkn) {
+ for (link= ntree->links.first; link; link= linkn) {
linkn= link->next;
- if(link->fromnode && link->tonode && (link->fromnode->flag & link->tonode->flag & NODE_SELECT)) {
+ if (link->fromnode && link->tonode && (link->fromnode->flag & link->tonode->flag & NODE_SELECT)) {
BLI_remlink(&ntree->links, link);
BLI_addtail(&ngroup->links, link);
}
- else if(link->tonode && (link->tonode->flag & NODE_SELECT)) {
+ else if (link->tonode && (link->tonode->flag & NODE_SELECT)) {
gsock = node_group_expose_socket(ngroup, link->tosock, SOCK_IN);
link->tosock->link = nodeAddLink(ngroup, NULL, gsock, link->tonode, link->tosock);
link->tosock = node_group_add_extern_socket(ntree, &gnode->inputs, SOCK_IN, gsock);
link->tonode = gnode;
}
- else if(link->fromnode && (link->fromnode->flag & NODE_SELECT)) {
+ else if (link->fromnode && (link->fromnode->flag & NODE_SELECT)) {
/* search for existing group node socket */
for (gsock=ngroup->outputs.first; gsock; gsock=gsock->next)
if (gsock->link && gsock->link->fromsock==link->fromsock)
@@ -256,10 +258,10 @@ int node_group_ungroup(bNodeTree *ntree, bNode *gnode)
ListBase anim_basepaths = {NULL, NULL};
ngroup= (bNodeTree *)gnode->id;
- if(ngroup==NULL) return 0;
+ if (ngroup==NULL) return 0;
/* clear new pointers, set in copytree */
- for(node= ntree->nodes.first; node; node= node->next)
+ for (node= ntree->nodes.first; node; node= node->next)
node->new_node= NULL;
/* wgroup is a temporary copy of the NodeTree we're merging in
@@ -269,7 +271,7 @@ int node_group_ungroup(bNodeTree *ntree, bNode *gnode)
wgroup= ntreeCopyTree(ngroup);
/* add the nodes into the ntree */
- for(node= wgroup->nodes.first; node; node= nextn) {
+ for (node= wgroup->nodes.first; node; node= nextn) {
nextn= node->next;
/* keep track of this node's RNA "base" path (the part of the pat identifying the node)
@@ -297,7 +299,7 @@ int node_group_ungroup(bNodeTree *ntree, bNode *gnode)
}
/* restore external links to and from the gnode */
- for(link= ntree->links.first; link; link= link->next) {
+ for (link= ntree->links.first; link; link= link->next) {
if (link->fromnode==gnode) {
if (link->fromsock->groupsock) {
bNodeSocket *gsock= link->fromsock->groupsock;
@@ -324,13 +326,13 @@ int node_group_ungroup(bNodeTree *ntree, bNode *gnode)
}
}
/* remove internal output links, these are not used anymore */
- for(link=wgroup->links.first; link; link= linkn) {
+ for (link=wgroup->links.first; link; link= linkn) {
linkn = link->next;
if (!link->tonode)
nodeRemLink(wgroup, link);
}
/* restore links from internal nodes */
- for(link= wgroup->links.first; link; link= link->next) {
+ for (link= wgroup->links.first; link; link= link->next) {
/* indicates link to group input */
if (!link->fromnode) {
/* NB: can't use find_group_node_input here,
@@ -353,7 +355,7 @@ int node_group_ungroup(bNodeTree *ntree, bNode *gnode)
}
/* add internal links to the ntree */
- for(link= wgroup->links.first; link; link= linkn) {
+ for (link= wgroup->links.first; link; link= linkn) {
linkn= link->next;
BLI_remlink(&wgroup->links, link);
BLI_addtail(&ntree->links, link);
@@ -487,7 +489,7 @@ void node_group_remove_socket(bNodeTree *ngroup, bNodeSocket *gsock, int in_out)
/* groups display their internal tree name as label */
const char *node_group_label(bNode *node)
{
- return (node->id)? node->id->name+2: "Missing Datablock";
+ return (node->id)? node->id->name+2: IFACE_("Missing Datablock");
}
int node_group_valid(bNodeTree *ntree, bNodeTemplate *ntemp)
@@ -541,11 +543,11 @@ static bNodeSocket *group_verify_socket(bNodeTree *ntree, ListBase *lb, int in_o
if (gsock->flag & SOCK_INTERNAL)
return NULL;
- for(sock= lb->first; sock; sock= sock->next) {
- if(sock->own_index==gsock->own_index)
+ for (sock= lb->first; sock; sock= sock->next) {
+ if (sock->own_index==gsock->own_index)
break;
}
- if(sock) {
+ if (sock) {
sock->groupsock = gsock;
BLI_strncpy(sock->name, gsock->name, sizeof(sock->name));
@@ -613,7 +615,7 @@ struct bNodeTree *node_group_edit_set(bNode *node, int edit)
if (edit) {
bNodeTree *ngroup= (bNodeTree*)node->id;
if (ngroup) {
- if(ngroup->id.lib)
+ if (ngroup->id.lib)
ntreeMakeLocal(ngroup);
node->flag |= NODE_GROUP_EDIT;
diff --git a/source/blender/nodes/intern/node_exec.c b/source/blender/nodes/intern/node_exec.c
index eaf19ad71b6..3b757e753a4 100644
--- a/source/blender/nodes/intern/node_exec.c
+++ b/source/blender/nodes/intern/node_exec.c
@@ -55,13 +55,13 @@ void node_get_stack(bNode *node, bNodeStack *stack, bNodeStack **in, bNodeStack
/* build pointer stack */
if (in) {
- for(sock= node->inputs.first; sock; sock= sock->next) {
+ for (sock= node->inputs.first; sock; sock= sock->next) {
*(in++) = node_get_socket_stack(stack, sock);
}
}
if (out) {
- for(sock= node->outputs.first; sock; sock= sock->next) {
+ for (sock= node->outputs.first; sock; sock= sock->next) {
*(out++) = node_get_socket_stack(stack, sock);
}
}
@@ -135,7 +135,7 @@ bNodeTreeExec *ntree_exec_begin(bNodeTree *ntree)
bNode **nodelist;
int totnodes, n;
- if((ntree->init & NTREE_TYPE_INIT)==0)
+ if ((ntree->init & NTREE_TYPE_INIT)==0)
ntreeInitTypes(ntree);
/* get a dependency-sorted list of nodes */
@@ -147,10 +147,10 @@ bNodeTreeExec *ntree_exec_begin(bNodeTree *ntree)
exec->nodetree = ntree;
/* group inputs essentially work as outputs */
- for(gsock=ntree->inputs.first; gsock; gsock = gsock->next)
+ for (gsock=ntree->inputs.first; gsock; gsock = gsock->next)
node_init_output_index(gsock, &index);
/* set stack indexes */
- for(n=0; n < totnodes; ++n) {
+ for (n=0; n < totnodes; ++n) {
node = nodelist[n];
node->stack_index = index;
@@ -162,7 +162,7 @@ bNodeTreeExec *ntree_exec_begin(bNodeTree *ntree)
node_init_output_index(sock, &index);
}
/* group outputs essentially work as inputs */
- for(gsock=ntree->outputs.first; gsock; gsock = gsock->next)
+ for (gsock=ntree->outputs.first; gsock; gsock = gsock->next)
node_init_input_index(gsock, &index);
/* allocated exec data pointers for nodes */
@@ -181,13 +181,13 @@ bNodeTreeExec *ntree_exec_begin(bNodeTree *ntree)
/* ns = */ setup_stack(exec->stack, sock);
}
/* prepare all internal nodes for execution */
- for(n=0, nodeexec= exec->nodeexec; n < totnodes; ++n, ++nodeexec) {
+ for (n=0, nodeexec= exec->nodeexec; n < totnodes; ++n, ++nodeexec) {
node = nodeexec->node = nodelist[n];
/* tag inputs */
for (sock=node->inputs.first; sock; sock=sock->next) {
/* disable the node if an input link is invalid */
- if(sock->link && !(sock->link->flag & NODE_LINK_VALID))
+ if (sock->link && !(sock->link->flag & NODE_LINK_VALID))
node->need_exec= 0;
ns = setup_stack(exec->stack, sock);
@@ -199,7 +199,7 @@ bNodeTreeExec *ntree_exec_begin(bNodeTree *ntree)
/* ns = */ setup_stack(exec->stack, sock);
}
- if(node->typeinfo->initexecfunc)
+ if (node->typeinfo->initexecfunc)
nodeexec->data = node->typeinfo->initexecfunc(node);
}
/* prepare group tree outputs */
@@ -222,7 +222,7 @@ void ntree_exec_end(bNodeTreeExec *exec)
if (exec->stack)
MEM_freeN(exec->stack);
- for(n=0, nodeexec= exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
+ for (n=0, nodeexec= exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
if (nodeexec->node->typeinfo->freeexecfunc)
nodeexec->node->typeinfo->freeexecfunc(nodeexec->node, nodeexec->data);
}
@@ -240,8 +240,8 @@ bNodeThreadStack *ntreeGetThreadStack(bNodeTreeExec *exec, int thread)
ListBase *lb= &exec->threadstack[thread];
bNodeThreadStack *nts;
- for(nts=lb->first; nts; nts=nts->next) {
- if(!nts->used) {
+ for (nts=lb->first; nts; nts=nts->next) {
+ if (!nts->used) {
nts->used= 1;
break;
}
@@ -272,15 +272,15 @@ void ntreeExecNodes(bNodeTreeExec *exec, void *callerdata, int thread)
/* nodes are presorted, so exec is in order of list */
- for(n=0, nodeexec= exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
+ for (n=0, nodeexec= exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
node = nodeexec->node;
- if(node->need_exec) {
+ if (node->need_exec) {
node_get_stack(node, exec->stack, nsin, nsout);
/* Handle muted nodes...
* If the mute func is not set, assume the node should never be muted,
* and hence execute it!
*/
- if(node->typeinfo->execfunc)
+ if (node->typeinfo->execfunc)
node->typeinfo->execfunc(callerdata, node, nsin, nsout);
else if (node->typeinfo->newexecfunc)
node->typeinfo->newexecfunc(callerdata, thread, node, nodeexec->data, nsin, nsout);
@@ -298,15 +298,15 @@ void ntreeExecThreadNodes(bNodeTreeExec *exec, bNodeThreadStack *nts, void *call
/* nodes are presorted, so exec is in order of list */
- for(n=0, nodeexec= exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
+ for (n=0, nodeexec= exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
node = nodeexec->node;
- if(node->need_exec) {
+ if (node->need_exec) {
node_get_stack(node, nts->stack, nsin, nsout);
/* Handle muted nodes...
* If the mute func is not set, assume the node should never be muted,
* and hence execute it!
*/
- if(node->typeinfo->execfunc)
+ if (node->typeinfo->execfunc)
node->typeinfo->execfunc(callerdata, node, nsin, nsout);
else if (node->typeinfo->newexecfunc)
node->typeinfo->newexecfunc(callerdata, thread, node, nodeexec->data, nsin, nsout);
diff --git a/source/blender/nodes/intern/node_socket.c b/source/blender/nodes/intern/node_socket.c
index f03aff8fb92..94b9d364418 100644
--- a/source/blender/nodes/intern/node_socket.c
+++ b/source/blender/nodes/intern/node_socket.c
@@ -160,7 +160,7 @@ static bNodeSocketType node_socket_type_mesh = {
void node_socket_type_init(bNodeSocketType *types[])
{
- #define INIT_TYPE(name) types[node_socket_type_##name.type] = &node_socket_type_##name;
+ #define INIT_TYPE(name) types[node_socket_type_##name.type] = &node_socket_type_##name
INIT_TYPE(float);
INIT_TYPE(vector);
@@ -485,13 +485,13 @@ static bNodeSocket *verify_socket_template(bNodeTree *ntree, bNode *node, int in
{
bNodeSocket *sock;
- for(sock= socklist->first; sock; sock= sock->next) {
- if(!(sock->flag & SOCK_DYNAMIC) && strncmp(sock->name, stemp->name, NODE_MAXSTR)==0)
+ for (sock= socklist->first; sock; sock= sock->next) {
+ if (!(sock->flag & SOCK_DYNAMIC) && strncmp(sock->name, stemp->name, NODE_MAXSTR)==0)
break;
}
- if(sock) {
+ if (sock) {
sock->type= stemp->type; /* in future, read this from tydefs! */
- if(stemp->limit==0) sock->limit= 0xFFF;
+ if (stemp->limit==0) sock->limit= 0xFFF;
else sock->limit= stemp->limit;
sock->flag |= stemp->flag;
@@ -550,7 +550,7 @@ static void verify_socket_template_list(bNodeTree *ntree, bNode *node, int in_ou
bNodeSocketTemplate *stemp;
/* no inputs anymore? */
- if(stemp_first==NULL) {
+ if (stemp_first==NULL) {
for (sock = (bNodeSocket*)socklist->first; sock; sock=nextsock) {
nextsock = sock->next;
if (!(sock->flag & SOCK_DYNAMIC))
@@ -560,7 +560,7 @@ static void verify_socket_template_list(bNodeTree *ntree, bNode *node, int in_ou
else {
/* step by step compare */
stemp= stemp_first;
- while(stemp->type != -1) {
+ while (stemp->type != -1) {
stemp->sock= verify_socket_template(ntree, node, in_out, socklist, stemp);
stemp++;
}
@@ -578,14 +578,14 @@ static void verify_socket_template_list(bNodeTree *ntree, bNode *node, int in_ou
* so we can add static sockets infront of it.
*/
sock = socklist->first;
- while(stemp->type != -1) {
+ while (stemp->type != -1) {
/* put static sockets infront of dynamic */
BLI_insertlinkbefore(socklist, sock, stemp->sock);
stemp++;
}
}
else {
- while(stemp->type != -1) {
+ while (stemp->type != -1) {
BLI_addtail(socklist, stemp->sock);
stemp++;
}
@@ -600,7 +600,7 @@ void node_verify_socket_templates(bNodeTree *ntree, bNode *node)
* This also prevents group node sockets from being removed, without the need to explicitly
* check the node type here.
*/
- if(ntype && ((ntype->inputs && ntype->inputs[0].type>=0) || (ntype->outputs && ntype->outputs[0].type>=0))) {
+ if (ntype && ((ntype->inputs && ntype->inputs[0].type>=0) || (ntype->outputs && ntype->outputs[0].type>=0))) {
verify_socket_template_list(ntree, node, SOCK_IN, &node->inputs, ntype->inputs);
verify_socket_template_list(ntree, node, SOCK_OUT, &node->outputs, ntype->outputs);
}
diff --git a/source/blender/nodes/intern/node_util.c b/source/blender/nodes/intern/node_util.c
index 19b3ba63f9a..1c38bdf39d7 100644
--- a/source/blender/nodes/intern/node_util.c
+++ b/source/blender/nodes/intern/node_util.c
@@ -36,6 +36,8 @@
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_colortools.h"
#include "BKE_node.h"
@@ -74,69 +76,95 @@ const char *node_blend_label(bNode *node)
{
const char *name;
RNA_enum_name(ramp_blend_items, node->custom1, &name);
- return name;
+ return IFACE_(name);
}
const char *node_math_label(bNode *node)
{
const char *name;
RNA_enum_name(node_math_items, node->custom1, &name);
- return name;
+ return IFACE_(name);
}
const char *node_vect_math_label(bNode *node)
{
const char *name;
RNA_enum_name(node_vec_math_items, node->custom1, &name);
- return name;
+ return IFACE_(name);
}
const char *node_filter_label(bNode *node)
{
const char *name;
RNA_enum_name(node_filter_items, node->custom1, &name);
- return name;
+ return IFACE_(name);
}
ListBase node_internal_connect_default(bNodeTree *ntree, bNode *node)
{
- static int types[] = { SOCK_FLOAT, SOCK_VECTOR, SOCK_RGBA };
- bNodeLink *link;
- bNodeSocket *fromsock, *tosock;
ListBase ret;
- int in, out, i;
+ bNodeSocket *fromsock_first=NULL, *tosock_first=NULL; /* used for fallback link if no other reconnections are found */
+ int datatype;
+ int num_links_in = 0, num_links_out = 0, num_reconnect = 0;
ret.first = ret.last = NULL;
/* Security check! */
- if(!ntree)
+ if (!ntree)
return ret;
- /* Connect the first input of each type with first output of the same type. */
-
- for (i=0; i < 3; ++i) {
- /* find input socket */
- for (in=0, fromsock=node->inputs.first; fromsock; in++, fromsock=fromsock->next) {
- if (fromsock->type==types[i] && nodeCountSocketLinks(ntree, fromsock) > 0)
+ for (datatype=0; datatype < NUM_SOCKET_TYPES; ++datatype) {
+ bNodeSocket *fromsock=NULL, *tosock=NULL;
+ bNodeLink *link;
+
+ /* Connect the first input of each type with outputs of the same type. */
+
+ for (link=ntree->links.first; link; link=link->next) {
+ if (link->tonode == node && link->tosock->type == datatype) {
+ fromsock = link->tosock;
+ ++num_links_in;
+ if (!fromsock_first)
+ fromsock_first = fromsock;
break;
- }
- if (fromsock) {
- for (out=0, tosock=node->outputs.first; tosock; out++, tosock=tosock->next) {
- if (tosock->type==types[i] && (nodeCountSocketLinks(ntree, tosock) > 0))
- break;
}
- if (tosock) {
- link = MEM_callocN(sizeof(bNodeLink), "internal node link");
- link->fromnode = node;
- link->fromsock = fromsock;
- link->tonode = node;
- link->tosock = tosock;
- /* internal link is always valid */
- link->flag |= NODE_LINK_VALID;
- BLI_addtail(&ret, link);
+ }
+
+ for (link=ntree->links.first; link; link=link->next) {
+ if (link->fromnode == node && link->fromsock->type == datatype) {
+ tosock = link->fromsock;
+ ++num_links_out;
+ if (!tosock_first)
+ tosock_first = tosock;
+
+ if (fromsock) {
+ bNodeLink *ilink = MEM_callocN(sizeof(bNodeLink), "internal node link");
+ ilink->fromnode = node;
+ ilink->fromsock = fromsock;
+ ilink->tonode = node;
+ ilink->tosock = tosock;
+ /* internal link is always valid */
+ ilink->flag |= NODE_LINK_VALID;
+ BLI_addtail(&ret, ilink);
+
+ ++num_reconnect;
+ }
}
}
}
-
+
+ /* if there is one input and one output link, but no reconnections by type,
+ * simply connect those two sockets.
+ */
+ if (num_reconnect==0 && num_links_in==1 && num_links_out==1) {
+ bNodeLink *ilink = MEM_callocN(sizeof(bNodeLink), "internal node link");
+ ilink->fromnode = node;
+ ilink->fromsock = fromsock_first;
+ ilink->tonode = node;
+ ilink->tosock = tosock_first;
+ /* internal link is always valid */
+ ilink->flag |= NODE_LINK_VALID;
+ BLI_addtail(&ret, ilink);
+ }
+
return ret;
}
diff --git a/source/blender/nodes/intern/node_util.h b/source/blender/nodes/intern/node_util.h
index 98afc319214..6f167e35262 100644
--- a/source/blender/nodes/intern/node_util.h
+++ b/source/blender/nodes/intern/node_util.h
@@ -65,7 +65,7 @@ ListBase node_internal_connect_default(struct bNodeTree *ntree, struct bNode *no
#endif
-// this is needed for inlining behaviour
+// this is needed for inlining behavior
#if defined _WIN32
# define DO_INLINE __inline
#elif defined (__sun) || defined (__sun__)
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c
index b1e1989da86..c028ca83664 100644
--- a/source/blender/nodes/shader/node_shader_tree.c
+++ b/source/blender/nodes/shader/node_shader_tree.c
@@ -65,16 +65,16 @@ static void foreach_nodetree(Main *main, void *calldata, bNodeTreeCallback func)
Lamp *la;
World *wo;
- for(ma= main->mat.first; ma; ma= ma->id.next)
- if(ma->nodetree)
+ for (ma= main->mat.first; ma; ma= ma->id.next)
+ if (ma->nodetree)
func(calldata, &ma->id, ma->nodetree);
- for(la= main->lamp.first; la; la= la->id.next)
- if(la->nodetree)
+ for (la= main->lamp.first; la; la= la->id.next)
+ if (la->nodetree)
func(calldata, &la->id, la->nodetree);
- for(wo= main->world.first; wo; wo= wo->id.next)
- if(wo->nodetree)
+ for (wo= main->world.first; wo; wo= wo->id.next)
+ if (wo->nodetree)
func(calldata, &wo->id, wo->nodetree);
}
@@ -83,7 +83,7 @@ static void foreach_nodeclass(Scene *scene, void *calldata, bNodeClassCallback f
func(calldata, NODE_CLASS_INPUT, IFACE_("Input"));
func(calldata, NODE_CLASS_OUTPUT, IFACE_("Output"));
- if(scene_use_new_shading_nodes(scene)) {
+ if (scene_use_new_shading_nodes(scene)) {
func(calldata, NODE_CLASS_SHADER, IFACE_("Shader"));
func(calldata, NODE_CLASS_TEXTURE, IFACE_("Texture"));
}
@@ -115,12 +115,12 @@ static void local_sync(bNodeTree *localtree, bNodeTree *ntree)
bNode *lnode;
/* copy over contents of previews */
- for(lnode= localtree->nodes.first; lnode; lnode= lnode->next) {
- if(ntreeNodeExists(ntree, lnode->new_node)) {
+ for (lnode= localtree->nodes.first; lnode; lnode= lnode->next) {
+ if (ntreeNodeExists(ntree, lnode->new_node)) {
bNode *node= lnode->new_node;
- if(node->preview && node->preview->rect) {
- if(lnode->preview && lnode->preview->rect) {
+ if (node->preview && node->preview->rect) {
+ if (lnode->preview && lnode->preview->rect) {
int xsize= node->preview->xsize;
int ysize= node->preview->ysize;
memcpy(node->preview->rect, lnode->preview->rect, 4*xsize + xsize*ysize*sizeof(char)*4);
@@ -202,7 +202,7 @@ bNodeTreeExec *ntreeShaderBeginExecTree(bNodeTree *ntree, int use_tree_data)
/* allocate the thread stack listbase array */
exec->threadstack= MEM_callocN(BLENDER_MAX_THREADS*sizeof(ListBase), "thread stack array");
- for(node= exec->nodetree->nodes.first; node; node= node->next)
+ for (node= exec->nodetree->nodes.first; node; node= node->next)
node->need_exec= 1;
if (use_tree_data) {
@@ -220,14 +220,14 @@ bNodeTreeExec *ntreeShaderBeginExecTree(bNodeTree *ntree, int use_tree_data)
*/
void ntreeShaderEndExecTree(bNodeTreeExec *exec, int use_tree_data)
{
- if(exec) {
+ if (exec) {
bNodeTree *ntree= exec->nodetree;
bNodeThreadStack *nts;
int a;
- if(exec->threadstack) {
- for(a=0; a<BLENDER_MAX_THREADS; a++) {
- for(nts=exec->threadstack[a].first; nts; nts=nts->next)
+ if (exec->threadstack) {
+ for (a=0; a<BLENDER_MAX_THREADS; a++) {
+ for (nts=exec->threadstack[a].first; nts; nts=nts->next)
if (nts->stack) MEM_freeN(nts->stack);
BLI_freelistN(&exec->threadstack[a]);
}
@@ -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;
@@ -266,7 +266,7 @@ void ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr)
/* ensure execdata is only initialized once */
if (!exec) {
BLI_lock_thread(LOCK_NODES);
- if(!ntree->execdata)
+ if (!ntree->execdata)
ntree->execdata = ntreeShaderBeginExecTree(ntree, 1);
BLI_unlock_thread(LOCK_NODES);
@@ -277,10 +277,10 @@ void ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr)
ntreeExecThreadNodes(exec, nts, &scd, shi->thread);
ntreeReleaseThreadStack(nts);
- // @note: set material back to preserved material
+ // \note: set material back to preserved material
shi->mat = mat;
/* better not allow negative for now */
- if(shr->combined[0]<0.0f) shr->combined[0]= 0.0f;
- if(shr->combined[1]<0.0f) shr->combined[1]= 0.0f;
- if(shr->combined[2]<0.0f) shr->combined[2]= 0.0f;
+ if (shr->combined[0]<0.0f) shr->combined[0]= 0.0f;
+ if (shr->combined[1]<0.0f) shr->combined[1]= 0.0f;
+ if (shr->combined[2]<0.0f) shr->combined[2]= 0.0f;
}
diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c
index 1a9a0fc4b3e..90c62bc47ac 100644
--- a/source/blender/nodes/shader/node_shader_util.c
+++ b/source/blender/nodes/shader/node_shader_util.c
@@ -42,14 +42,14 @@ void nodestack_get_vec(float *in, short type_in, bNodeStack *ns)
{
float *from= ns->vec;
- if(type_in==SOCK_FLOAT) {
- if(ns->sockettype==SOCK_FLOAT)
+ if (type_in==SOCK_FLOAT) {
+ if (ns->sockettype==SOCK_FLOAT)
*in= *from;
else
*in= 0.333333f*(from[0]+from[1]+from[2]);
}
- else if(type_in==SOCK_VECTOR) {
- if(ns->sockettype==SOCK_FLOAT) {
+ else if (type_in==SOCK_VECTOR) {
+ if (ns->sockettype==SOCK_FLOAT) {
in[0]= from[0];
in[1]= from[0];
in[2]= from[0];
@@ -59,10 +59,10 @@ void nodestack_get_vec(float *in, short type_in, bNodeStack *ns)
}
}
else { /* type_in==SOCK_RGBA */
- if(ns->sockettype==SOCK_RGBA) {
+ if (ns->sockettype==SOCK_RGBA) {
copy_v4_v4(in, from);
}
- else if(ns->sockettype==SOCK_FLOAT) {
+ else if (ns->sockettype==SOCK_FLOAT) {
in[0]= from[0];
in[1]= from[0];
in[2]= from[0];
@@ -84,22 +84,23 @@ void ntreeShaderGetTexcoMode(bNodeTree *ntree, int r_mode, short *texco, int *mo
bNodeSocket *sock;
int a;
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type==SH_NODE_TEXTURE) {
- if((r_mode & R_OSA) && node->id) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->type==SH_NODE_TEXTURE) {
+ if ((r_mode & R_OSA) && node->id) {
Tex *tex= (Tex *)node->id;
- if ELEM3(tex->type, TEX_IMAGE, TEX_PLUGIN, TEX_ENVMAP)
+ if (ELEM3(tex->type, TEX_IMAGE, TEX_PLUGIN, TEX_ENVMAP)) {
*texco |= TEXCO_OSA|NEED_UV;
+ }
}
/* usability exception... without input we still give the node orcos */
sock= node->inputs.first;
- if(sock==NULL || sock->link==NULL)
+ if (sock==NULL || sock->link==NULL)
*texco |= TEXCO_ORCO|NEED_UV;
}
- else if(node->type==SH_NODE_GEOMETRY) {
+ else if (node->type==SH_NODE_GEOMETRY) {
/* note; sockets always exist for the given type! */
- for(a=0, sock= node->outputs.first; sock; sock= sock->next, a++) {
- if(sock->flag & SOCK_IN_USE) {
+ for (a=0, sock= node->outputs.first; sock; sock= sock->next, a++) {
+ if (sock->flag & SOCK_IN_USE) {
switch(a) {
case GEOM_OUT_GLOB:
*texco |= TEXCO_GLOB|NEED_UV; break;
@@ -125,17 +126,17 @@ void ntreeShaderGetTexcoMode(bNodeTree *ntree, int r_mode, short *texco, int *mo
/* nodes that use ID data get synced with local data */
void nodeShaderSynchronizeID(bNode *node, int copyto)
{
- if(node->id==NULL) return;
+ if (node->id==NULL) return;
- if(ELEM(node->type, SH_NODE_MATERIAL, SH_NODE_MATERIAL_EXT)) {
+ if (ELEM(node->type, SH_NODE_MATERIAL, SH_NODE_MATERIAL_EXT)) {
bNodeSocket *sock;
Material *ma= (Material *)node->id;
int a;
- /* hrmf, case in loop isnt super fast, but we dont edit 100s of material at same time either! */
- for(a=0, sock= node->inputs.first; sock; sock= sock->next, a++) {
- if(!nodeSocketIsHidden(sock)) {
- if(copyto) {
+ /* hrmf, case in loop isn't super fast, but we don't edit 100s of material at same time either! */
+ for (a=0, sock= node->inputs.first; sock; sock= sock->next, a++) {
+ if (!nodeSocketIsHidden(sock)) {
+ if (copyto) {
switch(a) {
case MAT_IN_COLOR:
copy_v3_v3(&ma->r, ((bNodeSocketValueRGBA*)sock->default_value)->value); break;
@@ -210,7 +211,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.
*/
@@ -249,19 +250,19 @@ bNode *nodeGetActiveTexture(bNodeTree *ntree)
/* this is the node we texture paint and draw in textured draw */
bNode *node;
- if(!ntree)
+ if (!ntree)
return NULL;
/* check for group edit */
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->flag & NODE_GROUP_EDIT)
+ for (node= ntree->nodes.first; node; node= node->next)
+ if (node->flag & NODE_GROUP_EDIT)
break;
- if(node)
+ if (node)
ntree= (bNodeTree*)node->id;
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->flag & NODE_ACTIVE_TEXTURE)
+ for (node= ntree->nodes.first; node; node= node->next)
+ if (node->flag & NODE_ACTIVE_TEXTURE)
return node;
return NULL;
@@ -280,31 +281,31 @@ void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, int do_outputs)
stack= exec->stack;
- for(n=0, nodeexec= exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
+ for (n=0, nodeexec= exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
node = nodeexec->node;
doit = 0;
/* for groups, only execute outputs for edited group */
- if(node->typeinfo->nclass==NODE_CLASS_OUTPUT) {
- if(do_outputs && (node->flag & NODE_DO_OUTPUT))
+ if (node->typeinfo->nclass==NODE_CLASS_OUTPUT) {
+ if (do_outputs && (node->flag & NODE_DO_OUTPUT))
doit = 1;
}
else
doit = 1;
if (doit) {
- if(node->typeinfo->gpufunc) {
+ if (node->typeinfo->gpufunc) {
node_get_stack(node, stack, nsin, nsout);
gpu_stack_from_data_list(gpuin, &node->inputs, nsin);
gpu_stack_from_data_list(gpuout, &node->outputs, nsout);
- if(node->typeinfo->gpufunc(mat, node, gpuin, gpuout))
+ if (node->typeinfo->gpufunc(mat, node, gpuin, gpuout))
data_from_gpu_stack_list(&node->outputs, nsout, gpuout);
}
- else if(node->typeinfo->gpuextfunc) {
+ else if (node->typeinfo->gpuextfunc) {
node_get_stack(node, stack, nsin, nsout);
gpu_stack_from_data_list(gpuin, &node->inputs, nsin);
gpu_stack_from_data_list(gpuout, &node->outputs, nsout);
- if(node->typeinfo->gpuextfunc(mat, node, nodeexec->data, gpuin, gpuout))
+ if (node->typeinfo->gpuextfunc(mat, node, nodeexec->data, gpuin, gpuout))
data_from_gpu_stack_list(&node->outputs, nsout, gpuout);
}
}
@@ -318,7 +319,7 @@ void node_shader_gpu_tex_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in
float domin= (texmap->flag & TEXMAP_CLIP_MIN) != 0;
float domax= (texmap->flag & TEXMAP_CLIP_MAX) != 0;
- if(domin || domax || !(texmap->flag & TEXMAP_UNIT_MATRIX)) {
+ if (domin || domax || !(texmap->flag & TEXMAP_UNIT_MATRIX)) {
GPUNodeLink *tmat = GPU_uniform((float*)texmap->mat);
GPUNodeLink *tmin = GPU_uniform(texmap->min);
GPUNodeLink *tmax = GPU_uniform(texmap->max);
diff --git a/source/blender/nodes/shader/nodes/node_shader_camera.c b/source/blender/nodes/shader/nodes/node_shader_camera.c
index 3ec75dfa4fd..69a6a5c04a9 100644
--- a/source/blender/nodes/shader/nodes/node_shader_camera.c
+++ b/source/blender/nodes/shader/nodes/node_shader_camera.c
@@ -43,7 +43,7 @@ static bNodeSocketTemplate sh_node_camera_out[]= {
static void node_shader_exec_camera(void *data, bNode *UNUSED(node), bNodeStack **UNUSED(in), bNodeStack **out)
{
- if(data) {
+ if (data) {
ShadeInput *shi= ((ShaderCallData *)data)->shi; /* Data we need for shading. */
copy_v3_v3(out[0]->vec, shi->co); /* get view vector */
diff --git a/source/blender/nodes/shader/nodes/node_shader_curves.c b/source/blender/nodes/shader/nodes/node_shader_curves.c
index d30434f4e32..50bf4c58e4d 100644
--- a/source/blender/nodes/shader/nodes/node_shader_curves.c
+++ b/source/blender/nodes/shader/nodes/node_shader_curves.c
@@ -106,7 +106,7 @@ static void node_shader_exec_curve_rgb(void *UNUSED(data), bNode *node, bNodeSta
/* stack order output: vec */
nodestack_get_vec(vec, SOCK_VECTOR, in[1]);
curvemapping_evaluateRGBF(node->storage, out[0]->vec, vec);
- if(in[0]->vec[0] != 1.0f) {
+ if (in[0]->vec[0] != 1.0f) {
interp_v3_v3v3(out[0]->vec, vec, out[0]->vec, *in[0]->vec);
}
}
diff --git a/source/blender/nodes/shader/nodes/node_shader_dynamic.c b/source/blender/nodes/shader/nodes/node_shader_dynamic.c
index e55b1b164df..5a6a92b5e27 100644
--- a/source/blender/nodes/shader/nodes/node_shader_dynamic.c
+++ b/source/blender/nodes/shader/nodes/node_shader_dynamic.c
@@ -83,7 +83,7 @@ static bNodeType *node_dynamic_find_typeinfo(ListBase *list, ID *id)
{
bNodeType *ntype = list->first;
- while(ntype) {
+ while (ntype) {
if (ntype->type == NODE_DYNAMIC && ntype->id == id)
break;
ntype = ntype->next;
@@ -459,7 +459,8 @@ static int node_dynamic_parse(struct bNode *node)
if (!pyresult) {
if (BTST(node->custom1, NODE_DYNAMIC_LOADED)) {
node_dynamic_disable(node);
- } else {
+ }
+ else {
node_dynamic_disable_all_by_id(node->id);
}
node_dynamic_pyerror_print(node);
@@ -574,7 +575,8 @@ static void node_dynamic_setup(bNode *node)
}
else { nodeMakeDynamicType(node); }
- } else {
+ }
+ else {
node_dynamic_rem_all_links(node->typeinfo);
node_dynamic_free_typeinfo_sockets(node->typeinfo);
node_dynamic_update_socket_links(node, NULL);
@@ -654,7 +656,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 +720,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_geom.c b/source/blender/nodes/shader/nodes/node_shader_geom.c
index cf6f400ee2a..37ab8ac3f5b 100644
--- a/source/blender/nodes/shader/nodes/node_shader_geom.c
+++ b/source/blender/nodes/shader/nodes/node_shader_geom.c
@@ -53,17 +53,17 @@ static bNodeSocketTemplate sh_node_geom_out[]= {
/* node execute callback */
static void node_shader_exec_geom(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out)
{
- if(data) {
+ if (data) {
ShadeInput *shi= ((ShaderCallData *)data)->shi;
NodeGeometry *ngeo= (NodeGeometry*)node->storage;
ShadeInputUV *suv= &shi->uv[shi->actuv];
static float defaultvcol[4] = {1.0f, 1.0f, 1.0f, 1.0f};
int i;
- if(ngeo->uvname[0]) {
+ if (ngeo->uvname[0]) {
/* find uv map by name */
- for(i = 0; i < shi->totuv; i++) {
- if(strcmp(shi->uv[i].name, ngeo->uvname)==0) {
+ for (i = 0; i < shi->totuv; i++) {
+ if (strcmp(shi->uv[i].name, ngeo->uvname)==0) {
suv= &shi->uv[i];
break;
}
@@ -82,9 +82,9 @@ static void node_shader_exec_geom(void *data, bNode *node, bNodeStack **UNUSED(i
/* find vertex color layer by name */
ShadeInputCol *scol= &shi->col[0];
- if(ngeo->colname[0]) {
- for(i = 0; i < shi->totcol; i++) {
- if(strcmp(shi->col[i].name, ngeo->colname)==0) {
+ if (ngeo->colname[0]) {
+ for (i = 0; i < shi->totcol; i++) {
+ if (strcmp(shi->col[i].name, ngeo->colname)==0) {
scol= &shi->col[i];
break;
}
@@ -100,7 +100,7 @@ static void node_shader_exec_geom(void *data, bNode *node, bNodeStack **UNUSED(i
out[GEOM_OUT_VCOL_ALPHA]->vec[0]= 1.0f;
}
- if(shi->osatex) {
+ if (shi->osatex) {
out[GEOM_OUT_GLOB]->data= shi->dxgl;
out[GEOM_OUT_GLOB]->datatype= NS_OSA_VECTORS;
out[GEOM_OUT_LOCAL]->data= shi->dxco;
diff --git a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c
index 0f85196a45d..12b97e65be8 100644
--- a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c
+++ b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c
@@ -50,12 +50,12 @@ static bNodeSocketTemplate sh_node_hue_sat_out[]= {
/* note: it would be possible to use CMP version for both nodes */
static void do_hue_sat_fac(bNode *UNUSED(node), float *out, float *hue, float *sat, float *val, float *in, float *fac)
{
- if(*fac!=0.0f && (*hue!=0.5f || *sat!=1.0f || *val!=1.0f)) {
+ if (*fac!=0.0f && (*hue!=0.5f || *sat!=1.0f || *val!=1.0f)) {
float col[3], hsv[3], mfac= 1.0f - *fac;
rgb_to_hsv(in[0], in[1], in[2], hsv, hsv+1, hsv+2);
hsv[0]+= (*hue - 0.5f);
- if(hsv[0]>1.0f) hsv[0]-=1.0f; else if(hsv[0]<0.0f) hsv[0]+= 1.0f;
+ if (hsv[0]>1.0f) hsv[0]-=1.0f; else if (hsv[0]<0.0f) hsv[0]+= 1.0f;
hsv[1]*= *sat;
hsv[2]*= *val;
hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
diff --git a/source/blender/nodes/shader/nodes/node_shader_mapping.c b/source/blender/nodes/shader/nodes/node_shader_mapping.c
index c2a58d49161..b7b080fa2df 100644
--- a/source/blender/nodes/shader/nodes/node_shader_mapping.c
+++ b/source/blender/nodes/shader/nodes/node_shader_mapping.c
@@ -54,15 +54,15 @@ static void node_shader_exec_mapping(void *UNUSED(data), bNode *node, bNodeStack
nodestack_get_vec(vec, SOCK_VECTOR, in[0]);
mul_m4_v3(texmap->mat, vec);
- if(texmap->flag & TEXMAP_CLIP_MIN) {
- if(vec[0]<texmap->min[0]) vec[0]= texmap->min[0];
- if(vec[1]<texmap->min[1]) vec[1]= texmap->min[1];
- if(vec[2]<texmap->min[2]) vec[2]= texmap->min[2];
+ if (texmap->flag & TEXMAP_CLIP_MIN) {
+ if (vec[0]<texmap->min[0]) vec[0]= texmap->min[0];
+ if (vec[1]<texmap->min[1]) vec[1]= texmap->min[1];
+ if (vec[2]<texmap->min[2]) vec[2]= texmap->min[2];
}
- if(texmap->flag & TEXMAP_CLIP_MAX) {
- if(vec[0]>texmap->max[0]) vec[0]= texmap->max[0];
- if(vec[1]>texmap->max[1]) vec[1]= texmap->max[1];
- if(vec[2]>texmap->max[2]) vec[2]= texmap->max[2];
+ if (texmap->flag & TEXMAP_CLIP_MAX) {
+ if (vec[0]>texmap->max[0]) vec[0]= texmap->max[0];
+ if (vec[1]>texmap->max[1]) vec[1]= texmap->max[1];
+ if (vec[2]>texmap->max[2]) vec[2]= texmap->max[2];
}
}
diff --git a/source/blender/nodes/shader/nodes/node_shader_material.c b/source/blender/nodes/shader/nodes/node_shader_material.c
index decd3bb225f..279bbfa8d1b 100644
--- a/source/blender/nodes/shader/nodes/node_shader_material.c
+++ b/source/blender/nodes/shader/nodes/node_shader_material.c
@@ -78,7 +78,7 @@ static bNodeSocketTemplate sh_node_material_ext_out[]= {
static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
{
- if(data && node->id) {
+ if (data && node->id) {
ShadeResult shrnode;
ShadeInput *shi;
ShaderCallData *shcd= data;
@@ -103,17 +103,17 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in,
shi->har= shi->mat->har;
/* write values */
- if(hasinput[MAT_IN_COLOR])
+ if (hasinput[MAT_IN_COLOR])
nodestack_get_vec(&shi->r, SOCK_VECTOR, in[MAT_IN_COLOR]);
- if(hasinput[MAT_IN_SPEC])
+ if (hasinput[MAT_IN_SPEC])
nodestack_get_vec(&shi->specr, SOCK_VECTOR, in[MAT_IN_SPEC]);
- if(hasinput[MAT_IN_REFL])
+ if (hasinput[MAT_IN_REFL])
nodestack_get_vec(&shi->refl, SOCK_FLOAT, in[MAT_IN_REFL]);
/* retrieve normal */
- if(hasinput[MAT_IN_NORMAL]) {
+ if (hasinput[MAT_IN_NORMAL]) {
nodestack_get_vec(shi->vn, SOCK_VECTOR, in[MAT_IN_NORMAL]);
normalize_v3(shi->vn);
}
@@ -121,24 +121,24 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in,
copy_v3_v3(shi->vn, shi->vno);
/* custom option to flip normal */
- if(node->custom1 & SH_NODE_MAT_NEG) {
+ if (node->custom1 & SH_NODE_MAT_NEG) {
negate_v3(shi->vn);
}
if (node->type == SH_NODE_MATERIAL_EXT) {
- if(hasinput[MAT_IN_MIR])
+ if (hasinput[MAT_IN_MIR])
nodestack_get_vec(&shi->mirr, SOCK_VECTOR, in[MAT_IN_MIR]);
- if(hasinput[MAT_IN_AMB])
+ if (hasinput[MAT_IN_AMB])
nodestack_get_vec(&shi->amb, SOCK_FLOAT, in[MAT_IN_AMB]);
- if(hasinput[MAT_IN_EMIT])
+ if (hasinput[MAT_IN_EMIT])
nodestack_get_vec(&shi->emit, SOCK_FLOAT, in[MAT_IN_EMIT]);
- if(hasinput[MAT_IN_SPECTRA])
+ if (hasinput[MAT_IN_SPECTRA])
nodestack_get_vec(&shi->spectra, SOCK_FLOAT, in[MAT_IN_SPECTRA]);
- if(hasinput[MAT_IN_RAY_MIRROR])
+ if (hasinput[MAT_IN_RAY_MIRROR])
nodestack_get_vec(&shi->ray_mirror, SOCK_FLOAT, in[MAT_IN_RAY_MIRROR]);
- if(hasinput[MAT_IN_ALPHA])
+ if (hasinput[MAT_IN_ALPHA])
nodestack_get_vec(&shi->alpha, SOCK_FLOAT, in[MAT_IN_ALPHA]);
- if(hasinput[MAT_IN_TRANSLUCENCY])
+ if (hasinput[MAT_IN_TRANSLUCENCY])
nodestack_get_vec(&shi->translucency, SOCK_FLOAT, in[MAT_IN_TRANSLUCENCY]);
}
@@ -147,13 +147,13 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in,
shi->nodes= 0;
/* write to outputs */
- if(node->custom1 & SH_NODE_MAT_DIFF) {
+ if (node->custom1 & SH_NODE_MAT_DIFF) {
copy_v3_v3(col, shrnode.combined);
- if(!(node->custom1 & SH_NODE_MAT_SPEC)) {
+ if (!(node->custom1 & SH_NODE_MAT_SPEC)) {
sub_v3_v3(col, shrnode.spec);
}
}
- else if(node->custom1 & SH_NODE_MAT_SPEC) {
+ else if (node->custom1 & SH_NODE_MAT_SPEC) {
copy_v3_v3(col, shrnode.spec);
}
else
@@ -161,13 +161,13 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in,
col[3]= shrnode.alpha;
- if(shi->do_preview)
+ if (shi->do_preview)
nodeAddToPreview(node, col, shi->xs, shi->ys, shi->do_manage);
copy_v3_v3(out[MAT_OUT_COLOR]->vec, col);
out[MAT_OUT_ALPHA]->vec[0]= shrnode.alpha;
- if(node->custom1 & SH_NODE_MAT_NEG) {
+ if (node->custom1 & SH_NODE_MAT_NEG) {
shi->vn[0]= -shi->vn[0];
shi->vn[1]= -shi->vn[1];
shi->vn[2]= -shi->vn[2];
@@ -185,7 +185,7 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in,
}
/* copy passes, now just active node */
- if(node->flag & NODE_ACTIVE_ID) {
+ if (node->flag & NODE_ACTIVE_ID) {
float combined[4], alpha;
copy_v4_v4(combined, shcd->shr->combined);
@@ -218,7 +218,7 @@ static GPUNodeLink *gpu_get_input_link(GPUNodeStack *in)
static int gpu_shader_material(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
{
- if(node->id) {
+ if (node->id) {
GPUShadeInput shi;
GPUShadeResult shr;
bNodeSocket *sock;
@@ -235,47 +235,47 @@ static int gpu_shader_material(GPUMaterial *mat, bNode *node, GPUNodeStack *in,
GPU_shadeinput_set(mat, (Material*)node->id, &shi);
/* write values */
- if(hasinput[MAT_IN_COLOR])
+ if (hasinput[MAT_IN_COLOR])
shi.rgb = gpu_get_input_link(&in[MAT_IN_COLOR]);
- if(hasinput[MAT_IN_SPEC])
+ if (hasinput[MAT_IN_SPEC])
shi.specrgb = gpu_get_input_link(&in[MAT_IN_SPEC]);
- if(hasinput[MAT_IN_REFL])
+ if (hasinput[MAT_IN_REFL])
shi.refl = gpu_get_input_link(&in[MAT_IN_REFL]);
/* retrieve normal */
- if(hasinput[MAT_IN_NORMAL]) {
+ if (hasinput[MAT_IN_NORMAL]) {
GPUNodeLink *tmp;
shi.vn = gpu_get_input_link(&in[MAT_IN_NORMAL]);
GPU_link(mat, "vec_math_normalize", shi.vn, &shi.vn, &tmp);
}
/* custom option to flip normal */
- if(node->custom1 & SH_NODE_MAT_NEG)
+ if (node->custom1 & SH_NODE_MAT_NEG)
GPU_link(mat, "vec_math_negate", shi.vn, &shi.vn);
if (node->type == SH_NODE_MATERIAL_EXT) {
- if(hasinput[MAT_IN_AMB])
+ if (hasinput[MAT_IN_AMB])
shi.amb= gpu_get_input_link(&in[MAT_IN_AMB]);
- if(hasinput[MAT_IN_EMIT])
+ if (hasinput[MAT_IN_EMIT])
shi.emit= gpu_get_input_link(&in[MAT_IN_EMIT]);
- if(hasinput[MAT_IN_ALPHA])
+ if (hasinput[MAT_IN_ALPHA])
shi.alpha= gpu_get_input_link(&in[MAT_IN_ALPHA]);
}
GPU_shaderesult_set(&shi, &shr); /* clears shr */
/* write to outputs */
- if(node->custom1 & SH_NODE_MAT_DIFF) {
+ if (node->custom1 & SH_NODE_MAT_DIFF) {
out[MAT_OUT_COLOR].link= shr.combined;
- if(!(node->custom1 & SH_NODE_MAT_SPEC)) {
+ if (!(node->custom1 & SH_NODE_MAT_SPEC)) {
GPUNodeLink *link;
GPU_link(mat, "vec_math_sub", shr.combined, shr.spec, &out[MAT_OUT_COLOR].link, &link);
}
}
- else if(node->custom1 & SH_NODE_MAT_SPEC) {
+ else if (node->custom1 & SH_NODE_MAT_SPEC) {
out[MAT_OUT_COLOR].link= shr.spec;
}
else
@@ -285,7 +285,7 @@ static int gpu_shader_material(GPUMaterial *mat, bNode *node, GPUNodeStack *in,
out[MAT_OUT_ALPHA].link = shr.alpha; //
- if(node->custom1 & SH_NODE_MAT_NEG)
+ if (node->custom1 & SH_NODE_MAT_NEG)
GPU_link(mat, "vec_math_negate", shi.vn, &shi.vn);
out[MAT_OUT_NORMAL].link = shi.vn;
diff --git a/source/blender/nodes/shader/nodes/node_shader_math.c b/source/blender/nodes/shader/nodes/node_shader_math.c
index c9234c626aa..44df496f5d6 100644
--- a/source/blender/nodes/shader/nodes/node_shader_math.c
+++ b/source/blender/nodes/shader/nodes/node_shader_math.c
@@ -35,8 +35,8 @@
/* **************** SCALAR MATH ******************** */
static bNodeSocketTemplate sh_node_math_in[]= {
- { SOCK_FLOAT, 1, "Value", 0.5f, 0.5f, 0.5f, 1.0f, -100.0f, 100.0f, PROP_NONE},
- { SOCK_FLOAT, 1, "Value", 0.5f, 0.5f, 0.5f, 1.0f, -100.0f, 100.0f, PROP_NONE},
+ { SOCK_FLOAT, 1, "Value", 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE},
+ { SOCK_FLOAT, 1, "Value", 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE},
{ -1, 0, "" }
};
@@ -48,7 +48,7 @@ static bNodeSocketTemplate sh_node_math_out[]= {
static void node_shader_exec_math(void *UNUSED(data), bNode *node, bNodeStack **in,
bNodeStack **out)
{
- switch(node->custom1){
+ switch(node->custom1) {
case 0: /* Add */
out[0]->vec[0]= in[0]->vec[0] + in[1]->vec[0];
@@ -61,7 +61,7 @@ bNodeStack **out)
break;
case 3: /* Divide */
{
- if(in[1]->vec[0]==0) /* We don't want to divide by zero. */
+ if (in[1]->vec[0]==0) /* We don't want to divide by zero. */
out[0]->vec[0]= 0.0;
else
out[0]->vec[0]= in[0]->vec[0] / in[1]->vec[0];
@@ -69,7 +69,7 @@ bNodeStack **out)
break;
case 4: /* Sine */
{
- if(in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */
+ if (in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */
out[0]->vec[0]= sin(in[0]->vec[0]);
else
out[0]->vec[0]= sin(in[1]->vec[0]);
@@ -77,7 +77,7 @@ bNodeStack **out)
break;
case 5: /* Cosine */
{
- if(in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */
+ if (in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */
out[0]->vec[0]= cos(in[0]->vec[0]);
else
out[0]->vec[0]= cos(in[1]->vec[0]);
@@ -85,7 +85,7 @@ bNodeStack **out)
break;
case 6: /* Tangent */
{
- if(in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */
+ if (in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */
out[0]->vec[0]= tan(in[0]->vec[0]);
else
out[0]->vec[0]= tan(in[1]->vec[0]);
@@ -93,16 +93,16 @@ bNodeStack **out)
break;
case 7: /* Arc-Sine */
{
- if(in[0]->hasinput || !in[1]->hasinput) { /* This one only takes one input, so we've got to choose. */
+ if (in[0]->hasinput || !in[1]->hasinput) { /* This one only takes one input, so we've got to choose. */
/* Can't do the impossible... */
- if( in[0]->vec[0] <= 1 && in[0]->vec[0] >= -1 )
+ if ( in[0]->vec[0] <= 1 && in[0]->vec[0] >= -1 )
out[0]->vec[0]= asin(in[0]->vec[0]);
else
out[0]->vec[0]= 0.0;
}
else {
/* Can't do the impossible... */
- if( in[1]->vec[0] <= 1 && in[1]->vec[0] >= -1 )
+ if ( in[1]->vec[0] <= 1 && in[1]->vec[0] >= -1 )
out[0]->vec[0]= asin(in[1]->vec[0]);
else
out[0]->vec[0]= 0.0;
@@ -111,16 +111,16 @@ bNodeStack **out)
break;
case 8: /* Arc-Cosine */
{
- if(in[0]->hasinput || !in[1]->hasinput) { /* This one only takes one input, so we've got to choose. */
+ if (in[0]->hasinput || !in[1]->hasinput) { /* This one only takes one input, so we've got to choose. */
/* Can't do the impossible... */
- if( in[0]->vec[0] <= 1 && in[0]->vec[0] >= -1 )
+ if ( in[0]->vec[0] <= 1 && in[0]->vec[0] >= -1 )
out[0]->vec[0]= acos(in[0]->vec[0]);
else
out[0]->vec[0]= 0.0;
}
else {
/* Can't do the impossible... */
- if( in[1]->vec[0] <= 1 && in[1]->vec[0] >= -1 )
+ if ( in[1]->vec[0] <= 1 && in[1]->vec[0] >= -1 )
out[0]->vec[0]= acos(in[1]->vec[0]);
else
out[0]->vec[0]= 0.0;
@@ -129,7 +129,7 @@ bNodeStack **out)
break;
case 9: /* Arc-Tangent */
{
- if(in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */
+ if (in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */
out[0]->vec[0]= atan(in[0]->vec[0]);
else
out[0]->vec[0]= atan(in[1]->vec[0]);
@@ -138,7 +138,7 @@ bNodeStack **out)
case 10: /* Power */
{
/* Don't want any imaginary numbers... */
- if( in[0]->vec[0] >= 0 )
+ if ( in[0]->vec[0] >= 0 )
out[0]->vec[0]= pow(in[0]->vec[0], in[1]->vec[0]);
else
out[0]->vec[0]= 0.0;
@@ -147,7 +147,7 @@ bNodeStack **out)
case 11: /* Logarithm */
{
/* Don't want any imaginary numbers... */
- if( in[0]->vec[0] > 0 && in[1]->vec[0] > 0 )
+ if ( in[0]->vec[0] > 0 && in[1]->vec[0] > 0 )
out[0]->vec[0]= log(in[0]->vec[0]) / log(in[1]->vec[0]);
else
out[0]->vec[0]= 0.0;
@@ -155,7 +155,7 @@ bNodeStack **out)
break;
case 12: /* Minimum */
{
- if( in[0]->vec[0] < in[1]->vec[0] )
+ if ( in[0]->vec[0] < in[1]->vec[0] )
out[0]->vec[0]= in[0]->vec[0];
else
out[0]->vec[0]= in[1]->vec[0];
@@ -163,7 +163,7 @@ bNodeStack **out)
break;
case 13: /* Maximum */
{
- if( in[0]->vec[0] > in[1]->vec[0] )
+ if ( in[0]->vec[0] > in[1]->vec[0] )
out[0]->vec[0]= in[0]->vec[0];
else
out[0]->vec[0]= in[1]->vec[0];
@@ -171,7 +171,7 @@ bNodeStack **out)
break;
case 14: /* Round */
{
- if(in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */
+ if (in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */
out[0]->vec[0]= (in[0]->vec[0]<0)?(int)(in[0]->vec[0] - 0.5f):(int)(in[0]->vec[0] + 0.5f);
else
out[0]->vec[0]= (in[1]->vec[0]<0)?(int)(in[1]->vec[0] - 0.5f):(int)(in[1]->vec[0] + 0.5f);
@@ -179,7 +179,7 @@ bNodeStack **out)
break;
case 15: /* Less Than */
{
- if( in[0]->vec[0] < in[1]->vec[0] )
+ if ( in[0]->vec[0] < in[1]->vec[0] )
out[0]->vec[0]= 1.0f;
else
out[0]->vec[0]= 0.0f;
@@ -187,7 +187,7 @@ bNodeStack **out)
break;
case 16: /* Greater Than */
{
- if( in[0]->vec[0] > in[1]->vec[0] )
+ if ( in[0]->vec[0] > in[1]->vec[0] )
out[0]->vec[0]= 1.0f;
else
out[0]->vec[0]= 0.0f;
@@ -224,7 +224,7 @@ static int gpu_shader_math(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUN
case 8:
case 9:
case 14:
- if(in[0].hasinput || !in[1].hasinput)
+ if (in[0].hasinput || !in[1].hasinput)
GPU_stack_link(mat, names[node->custom1], NULL, out, GPU_socket(&in[0]));
else
GPU_stack_link(mat, names[node->custom1], NULL, out, GPU_socket(&in[1]));
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..14a115a8353 100644
--- a/source/blender/nodes/shader/nodes/node_shader_output.c
+++ b/source/blender/nodes/shader/nodes/node_shader_output.c
@@ -41,7 +41,7 @@ static bNodeSocketTemplate sh_node_output_in[]= {
static void node_shader_exec_output(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out))
{
- if(data) {
+ if (data) {
ShadeInput *shi= ((ShaderCallData *)data)->shi;
float col[4];
@@ -49,12 +49,12 @@ static void node_shader_exec_output(void *data, bNode *node, bNodeStack **in, bN
nodestack_get_vec(col, SOCK_VECTOR, in[0]);
nodestack_get_vec(col+3, SOCK_FLOAT, in[1]);
- if(shi->do_preview) {
+ if (shi->do_preview) {
nodeAddToPreview(node, col, shi->xs, shi->ys, shi->do_manage);
node->lasty= shi->ys;
}
- if(node->flag & NODE_DO_OUTPUT) {
+ if (node->flag & NODE_DO_OUTPUT) {
ShadeResult *shr= ((ShaderCallData *)data)->shr;
copy_v4_v4(shr->combined, col);
@@ -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_checker.c b/source/blender/nodes/shader/nodes/node_shader_tex_checker.c
index 551b70d9b8a..2fff2bab1d4 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_checker.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_checker.c
@@ -54,7 +54,7 @@ static void node_shader_init_tex_checker(bNodeTree *UNUSED(ntree), bNode* node,
static int node_shader_gpu_tex_checker(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
{
- if(!in[0].link)
+ if (!in[0].link)
in[0].link = GPU_attribute(CD_ORCO, "");
node_shader_gpu_tex_mapping(mat, node, in, out);
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..852c056dc28 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;
}
@@ -54,13 +55,13 @@ static int node_shader_gpu_tex_environment(GPUMaterial *mat, bNode *node, GPUNod
Image *ima= (Image*)node->id;
ImageUser *iuser= NULL;
- if(!ima) {
+ if (!ima) {
float black[4] = {0.0f, 0.0f, 0.0f, 1.0f};
GPUNodeLink *vec = GPU_uniform(black);
return GPU_stack_link(mat, "set_rgba", out, out, vec);
}
- if(!in[0].link)
+ if (!in[0].link)
in[0].link = GPU_builtin(GPU_VIEW_POSITION);
node_shader_gpu_tex_mapping(mat, node, in, out);
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c
index a2403b6bdec..769cf845b42 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c
@@ -52,7 +52,7 @@ static void node_shader_init_tex_gradient(bNodeTree *UNUSED(ntree), bNode* node,
static int node_shader_gpu_tex_gradient(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
{
- if(!in[0].link)
+ if (!in[0].link)
in[0].link = GPU_attribute(CD_ORCO, "");
node_shader_gpu_tex_mapping(mat, node, in, out);
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..28dcada3d33 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_image.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.c
@@ -36,6 +36,7 @@ static bNodeSocketTemplate sh_node_tex_image_in[]= {
static bNodeSocketTemplate sh_node_tex_image_out[]= {
{ SOCK_RGBA, 0, "Color", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+ { SOCK_FLOAT, 0, "Alpha", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
{ -1, 0, "" }
};
@@ -44,7 +45,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;
}
@@ -54,13 +55,13 @@ static int node_shader_gpu_tex_image(GPUMaterial *mat, bNode *node, GPUNodeStack
Image *ima= (Image*)node->id;
ImageUser *iuser= NULL;
- if(!ima) {
+ if (!ima) {
float black[4] = {0.0f, 0.0f, 0.0f, 1.0f};
GPUNodeLink *vec = GPU_uniform(black);
return GPU_stack_link(mat, "set_rgba", out, out, vec);
}
- if(!in[0].link)
+ if (!in[0].link)
in[0].link = GPU_attribute(CD_MTFACE, "");
node_shader_gpu_tex_mapping(mat, node, in, out);
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_magic.c b/source/blender/nodes/shader/nodes/node_shader_tex_magic.c
index 3a270220667..e2c0cfc020f 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_magic.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_magic.c
@@ -57,7 +57,7 @@ static int node_shader_gpu_tex_magic(GPUMaterial *mat, bNode *node, GPUNodeStack
NodeTexMagic *tex = (NodeTexMagic*)node->storage;
float depth = tex->depth;
- if(!in[0].link)
+ if (!in[0].link)
in[0].link = GPU_attribute(CD_ORCO, "");
node_shader_gpu_tex_mapping(mat, node, in, out);
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c
index 015b78687fd..9fe3e652eea 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c
@@ -58,7 +58,7 @@ static void node_shader_init_tex_musgrave(bNodeTree *UNUSED(ntree), bNode* node,
static int node_shader_gpu_tex_musgrave(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
{
- if(!in[0].link)
+ if (!in[0].link)
in[0].link = GPU_attribute(CD_ORCO, "");
node_shader_gpu_tex_mapping(mat, node, in, out);
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_noise.c b/source/blender/nodes/shader/nodes/node_shader_tex_noise.c
index bb365cf5a33..2667d2a5867 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.c
@@ -54,7 +54,7 @@ static void node_shader_init_tex_noise(bNodeTree *UNUSED(ntree), bNode* node, bN
static int node_shader_gpu_tex_noise(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
{
- if(!in[0].link)
+ if (!in[0].link)
in[0].link = GPU_attribute(CD_ORCO, "");
node_shader_gpu_tex_mapping(mat, node, in, out);
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_sky.c b/source/blender/nodes/shader/nodes/node_shader_tex_sky.c
index a4131f3ca6c..b4855faaf94 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_sky.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_sky.c
@@ -54,7 +54,7 @@ static void node_shader_init_tex_sky(bNodeTree *UNUSED(ntree), bNode* node, bNod
static int node_shader_gpu_tex_sky(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
{
- if(!in[0].link)
+ if (!in[0].link)
in[0].link = GPU_attribute(CD_ORCO, "");
node_shader_gpu_tex_mapping(mat, node, in, out);
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c
index 9adaab22b03..eebd4886c59 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c
@@ -53,7 +53,7 @@ static void node_shader_init_tex_voronoi(bNodeTree *UNUSED(ntree), bNode* node,
static int node_shader_gpu_tex_voronoi(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
{
- if(!in[0].link)
+ if (!in[0].link)
in[0].link = GPU_attribute(CD_ORCO, "");
node_shader_gpu_tex_mapping(mat, node, in, out);
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_wave.c b/source/blender/nodes/shader/nodes/node_shader_tex_wave.c
index d359a407bc0..3e079ffc4f4 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_wave.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_wave.c
@@ -56,7 +56,7 @@ static void node_shader_init_tex_wave(bNodeTree *UNUSED(ntree), bNode* node, bNo
static int node_shader_gpu_tex_wave(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
{
- if(!in[0].link)
+ if (!in[0].link)
in[0].link = GPU_attribute(CD_ORCO, "");
node_shader_gpu_tex_mapping(mat, node, in, out);
diff --git a/source/blender/nodes/shader/nodes/node_shader_texture.c b/source/blender/nodes/shader/nodes/node_shader_texture.c
index 02818496dab..8b6386fe2f6 100644
--- a/source/blender/nodes/shader/nodes/node_shader_texture.c
+++ b/source/blender/nodes/shader/nodes/node_shader_texture.c
@@ -48,7 +48,7 @@ static bNodeSocketTemplate sh_node_texture_out[]= {
static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
{
- if(data && node->id) {
+ if (data && node->id) {
ShadeInput *shi= ((ShaderCallData *)data)->shi;
TexResult texres;
bNodeSocket *sock_vector= node->inputs.first;
@@ -65,14 +65,14 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b
texres.tr= texres.tg= texres.tb= 0.0f;
/* don't use in[0]->hasinput, see material node for explanation */
- if(sock_vector->link) {
+ if (sock_vector->link) {
nodestack_get_vec(vec, SOCK_VECTOR, in[0]);
- if(in[0]->datatype==NS_OSA_VECTORS) {
+ if (in[0]->datatype==NS_OSA_VECTORS) {
float *fp= in[0]->data;
retval= multitex_nodes((Tex *)node->id, vec, fp, fp+3, shi->osatex, &texres, thread, which_output, NULL, NULL);
}
- else if(in[0]->datatype==NS_OSA_VALUES) {
+ else if (in[0]->datatype==NS_OSA_VALUES) {
float *fp= in[0]->data;
float dxt[3], dyt[3];
@@ -89,18 +89,18 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b
}
/* stupid exception */
- if( ((Tex *)node->id)->type==TEX_STUCCI) {
+ if ( ((Tex *)node->id)->type==TEX_STUCCI) {
texres.tin= 0.5f + 0.7f*texres.nor[0];
CLAMP(texres.tin, 0.0f, 1.0f);
}
/* intensity and color need some handling */
- if(texres.talpha)
+ if (texres.talpha)
out[0]->vec[0]= texres.ta;
else
out[0]->vec[0]= texres.tin;
- if((retval & TEX_RGB)==0) {
+ if ((retval & TEX_RGB)==0) {
out[1]->vec[0]= out[0]->vec[0];
out[1]->vec[1]= out[0]->vec[0];
out[1]->vec[2]= out[0]->vec[0];
@@ -115,7 +115,7 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b
copy_v3_v3(out[2]->vec, nor);
- if(shi->do_preview)
+ if (shi->do_preview)
nodeAddToPreview(node, out[1]->vec, shi->xs, shi->ys, shi->do_manage);
}
@@ -125,7 +125,7 @@ static int gpu_shader_texture(GPUMaterial *mat, bNode *node, GPUNodeStack *in, G
{
Tex *tex = (Tex*)node->id;
- if(tex && tex->type == TEX_IMAGE && tex->ima) {
+ if (tex && tex->type == TEX_IMAGE && tex->ima) {
GPUNodeLink *texlink = GPU_image(tex->ima, NULL);
return GPU_stack_link(mat, "texture_image", in, out, texlink);
}
diff --git a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c
index f0a94928985..7e513135203 100644
--- a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c
+++ b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c
@@ -48,7 +48,7 @@ static void node_shader_exec_valtorgb(void *UNUSED(data), bNode *node, bNodeStac
/* stack order in: fac */
/* stack order out: col, alpha */
- if(node->storage) {
+ if (node->storage) {
float fac;
nodestack_get_vec(&fac, SOCK_FLOAT, in[0]);
@@ -76,7 +76,7 @@ void register_node_type_sh_valtorgb(bNodeTreeType *ttype)
static bNodeType ntype;
node_type_base(ttype, &ntype, SH_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
- node_type_compatibility(&ntype, NODE_OLD_SHADING);
+ node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_valtorgb_in, sh_node_valtorgb_out);
node_type_size(&ntype, 240, 200, 300);
node_type_init(&ntype, node_shader_init_valtorgb);
diff --git a/source/blender/nodes/shader/nodes/node_shader_vectMath.c b/source/blender/nodes/shader/nodes/node_shader_vectMath.c
index 75dbff11b6e..a0fe67d591d 100644
--- a/source/blender/nodes/shader/nodes/node_shader_vectMath.c
+++ b/source/blender/nodes/shader/nodes/node_shader_vectMath.c
@@ -36,8 +36,8 @@
/* **************** VECTOR MATH ******************** */
static bNodeSocketTemplate sh_node_vect_math_in[]= {
- { SOCK_VECTOR, 1, "Vector", 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 1.0f, PROP_NONE},
- { SOCK_VECTOR, 1, "Vector", 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 1.0f, PROP_NONE},
+ { SOCK_VECTOR, 1, "Vector", 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE},
+ { SOCK_VECTOR, 1, "Vector", 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE},
{ -1, 0, "" }
};
@@ -54,39 +54,39 @@ static void node_shader_exec_vect_math(void *UNUSED(data), bNode *node, bNodeSta
nodestack_get_vec(vec1, SOCK_VECTOR, in[0]);
nodestack_get_vec(vec2, SOCK_VECTOR, in[1]);
- if(node->custom1 == 0) { /* Add */
+ if (node->custom1 == 0) { /* Add */
out[0]->vec[0]= vec1[0] + vec2[0];
out[0]->vec[1]= vec1[1] + vec2[1];
out[0]->vec[2]= vec1[2] + vec2[2];
out[1]->vec[0]= (fabs(out[0]->vec[0]) + fabs(out[0]->vec[0]) + fabs(out[0]->vec[0])) / 3;
}
- else if(node->custom1 == 1) { /* Subtract */
+ else if (node->custom1 == 1) { /* Subtract */
out[0]->vec[0]= vec1[0] - vec2[0];
out[0]->vec[1]= vec1[1] - vec2[1];
out[0]->vec[2]= vec1[2] - vec2[2];
out[1]->vec[0]= (fabs(out[0]->vec[0]) + fabs(out[0]->vec[0]) + fabs(out[0]->vec[0])) / 3;
}
- else if(node->custom1 == 2) { /* Average */
+ else if (node->custom1 == 2) { /* Average */
out[0]->vec[0]= vec1[0] + vec2[0];
out[0]->vec[1]= vec1[1] + vec2[1];
out[0]->vec[2]= vec1[2] + vec2[2];
out[1]->vec[0] = normalize_v3( out[0]->vec );
}
- else if(node->custom1 == 3) { /* Dot product */
+ else if (node->custom1 == 3) { /* Dot product */
out[1]->vec[0]= (vec1[0] * vec2[0]) + (vec1[1] * vec2[1]) + (vec1[2] * vec2[2]);
}
- else if(node->custom1 == 4) { /* Cross product */
+ else if (node->custom1 == 4) { /* Cross product */
out[0]->vec[0]= (vec1[1] * vec2[2]) - (vec1[2] * vec2[1]);
out[0]->vec[1]= (vec1[2] * vec2[0]) - (vec1[0] * vec2[2]);
out[0]->vec[2]= (vec1[0] * vec2[1]) - (vec1[1] * vec2[0]);
out[1]->vec[0] = normalize_v3( out[0]->vec );
}
- else if(node->custom1 == 5) { /* Normalize */
- if(in[0]->hasinput || !in[1]->hasinput) { /* This one only takes one input, so we've got to choose. */
+ else if (node->custom1 == 5) { /* Normalize */
+ if (in[0]->hasinput || !in[1]->hasinput) { /* This one only takes one input, so we've got to choose. */
out[0]->vec[0]= vec1[0];
out[0]->vec[1]= vec1[1];
out[0]->vec[2]= vec1[2];
@@ -118,7 +118,7 @@ static int gpu_shader_vect_math(GPUMaterial *mat, bNode *node, GPUNodeStack *in,
GPU_socket(&in[0]), GPU_socket(&in[1]));
break;
case 5:
- if(in[0].hasinput || !in[1].hasinput)
+ if (in[0].hasinput || !in[1].hasinput)
GPU_stack_link(mat, names[node->custom1], NULL, out, GPU_socket(&in[0]));
else
GPU_stack_link(mat, names[node->custom1], NULL, out, GPU_socket(&in[1]));
diff --git a/source/blender/nodes/texture/node_texture_tree.c b/source/blender/nodes/texture/node_texture_tree.c
index 2795cbd3e5a..add9fdb0b30 100644
--- a/source/blender/nodes/texture/node_texture_tree.c
+++ b/source/blender/nodes/texture/node_texture_tree.c
@@ -57,8 +57,8 @@
static void foreach_nodetree(Main *main, void *calldata, bNodeTreeCallback func)
{
Tex *tx;
- for(tx= main->tex.first; tx; tx= tx->id.next) {
- if(tx->nodetree) {
+ for (tx= main->tex.first; tx; tx= tx->id.next) {
+ if (tx->nodetree) {
func(calldata, &tx->id, tx->nodetree);
}
}
@@ -97,12 +97,12 @@ static void local_sync(bNodeTree *localtree, bNodeTree *ntree)
bNode *lnode;
/* copy over contents of previews */
- for(lnode= localtree->nodes.first; lnode; lnode= lnode->next) {
- if(ntreeNodeExists(ntree, lnode->new_node)) {
+ for (lnode= localtree->nodes.first; lnode; lnode= lnode->next) {
+ if (ntreeNodeExists(ntree, lnode->new_node)) {
bNode *node= lnode->new_node;
- if(node->preview && node->preview->rect) {
- if(lnode->preview && lnode->preview->rect) {
+ if (node->preview && node->preview->rect) {
+ if (lnode->preview && lnode->preview->rect) {
int xsize= node->preview->xsize;
int ysize= node->preview->ysize;
memcpy(node->preview->rect, lnode->preview->rect, 4*xsize + xsize*ysize*sizeof(char)*4);
@@ -135,15 +135,15 @@ int ntreeTexTagAnimated(bNodeTree *ntree)
{
bNode *node;
- if(ntree==NULL) return 0;
+ if (ntree==NULL) return 0;
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type==TEX_NODE_CURVE_TIME) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->type==TEX_NODE_CURVE_TIME) {
nodeUpdate(ntree, node);
return 1;
}
- else if(node->type==NODE_GROUP) {
- if( ntreeTexTagAnimated((bNodeTree *)node->id) ) {
+ else if (node->type==NODE_GROUP) {
+ if ( ntreeTexTagAnimated((bNodeTree *)node->id) ) {
return 1;
}
}
@@ -174,7 +174,7 @@ bNodeTreeExec *ntreeTexBeginExecTree(bNodeTree *ntree, int use_tree_data)
/* allocate the thread stack listbase array */
exec->threadstack= MEM_callocN(BLENDER_MAX_THREADS*sizeof(ListBase), "thread stack array");
- for(node= exec->nodetree->nodes.first; node; node= node->next)
+ for (node= exec->nodetree->nodes.first; node; node= node->next)
node->need_exec= 1;
if (use_tree_data) {
@@ -194,10 +194,10 @@ static void tex_free_delegates(bNodeTreeExec *exec)
bNodeStack *ns;
int th, a;
- for(th=0; th<BLENDER_MAX_THREADS; th++)
- for(nts=exec->threadstack[th].first; nts; nts=nts->next)
- for(ns= nts->stack, a=0; a<exec->stacksize; a++, ns++)
- if(ns->data && !ns->is_copy)
+ for (th=0; th<BLENDER_MAX_THREADS; th++)
+ for (nts=exec->threadstack[th].first; nts; nts=nts->next)
+ for (ns= nts->stack, a=0; a<exec->stacksize; a++, ns++)
+ if (ns->data && !ns->is_copy)
MEM_freeN(ns->data);
}
@@ -206,16 +206,16 @@ static void tex_free_delegates(bNodeTreeExec *exec)
*/
void ntreeTexEndExecTree(bNodeTreeExec *exec, int use_tree_data)
{
- if(exec) {
+ if (exec) {
bNodeTree *ntree= exec->nodetree;
bNodeThreadStack *nts;
int a;
- if(exec->threadstack) {
+ if (exec->threadstack) {
tex_free_delegates(exec);
- for(a=0; a<BLENDER_MAX_THREADS; a++) {
- for(nts=exec->threadstack[a].first; nts; nts=nts->next)
+ for (a=0; a<BLENDER_MAX_THREADS; a++) {
+ for (nts=exec->threadstack[a].first; nts; nts=nts->next)
if (nts->stack) MEM_freeN(nts->stack);
BLI_freelistN(&exec->threadstack[a]);
}
@@ -246,7 +246,7 @@ int ntreeTexExecTree(
int preview,
ShadeInput *shi,
MTex *mtex
-){
+) {
TexCallData data;
float *nor= texres->nor;
int retval = TEX_INT;
@@ -268,7 +268,7 @@ int ntreeTexExecTree(
/* ensure execdata is only initialized once */
if (!exec) {
BLI_lock_thread(LOCK_NODES);
- if(!nodes->execdata)
+ if (!nodes->execdata)
ntreeTexBeginExecTree(nodes, 1);
BLI_unlock_thread(LOCK_NODES);
@@ -279,7 +279,7 @@ int ntreeTexExecTree(
ntreeExecThreadNodes(exec, nts, &data, thread);
ntreeReleaseThreadStack(nts);
- if(texres->nor) retval |= TEX_NOR;
+ if (texres->nor) retval |= TEX_NOR;
retval |= TEX_RGB;
/* confusing stuff; the texture output node sets this to NULL to indicate no normal socket was set
however, the texture code checks this for other reasons (namely, a normal is required for material) */
diff --git a/source/blender/nodes/texture/node_texture_util.c b/source/blender/nodes/texture/node_texture_util.c
index c3d298d1ecd..255ed9e51fc 100644
--- a/source/blender/nodes/texture/node_texture_util.c
+++ b/source/blender/nodes/texture/node_texture_util.c
@@ -53,10 +53,10 @@
static void tex_call_delegate(TexDelegate *dg, float *out, TexParams *params, short thread)
{
- if(dg->node->need_exec) {
+ if (dg->node->need_exec) {
dg->fn(out, params, dg->node, dg->in, thread);
- if(dg->cdata->do_preview)
+ if (dg->cdata->do_preview)
tex_do_preview(dg->node, params->previewco, out);
}
}
@@ -64,10 +64,10 @@ static void tex_call_delegate(TexDelegate *dg, float *out, TexParams *params, sh
static void tex_input(float *out, int sz, bNodeStack *in, TexParams *params, short thread)
{
TexDelegate *dg = in->data;
- if(dg) {
+ if (dg) {
tex_call_delegate(dg, in->vec, params, thread);
- if(in->hasoutput && in->sockettype == SOCK_FLOAT)
+ if (in->hasoutput && in->sockettype == SOCK_FLOAT)
in->vec[1] = in->vec[2] = in->vec[0];
}
memcpy(out, in->vec, sz * sizeof(float));
@@ -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;
@@ -119,7 +118,7 @@ void tex_do_preview(bNode *node, float *co, float *col)
{
bNodePreview *preview= node->preview;
- if(preview) {
+ if (preview) {
int xs= ((co[0] + 1.0f)*0.5f)*preview->xsize;
int ys= ((co[1] + 1.0f)*0.5f)*preview->ysize;
@@ -130,7 +129,7 @@ void tex_do_preview(bNode *node, float *co, float *col)
void tex_output(bNode *node, bNodeStack **in, bNodeStack *out, TexFn texfn, TexCallData *cdata)
{
TexDelegate *dg;
- if(!out->data)
+ if (!out->data)
/* Freed in tex_end_exec (node.c) */
dg = out->data = MEM_mallocN(sizeof(TexDelegate), "tex delegate");
else
@@ -146,21 +145,21 @@ void tex_output(bNode *node, bNodeStack **in, bNodeStack *out, TexFn texfn, TexC
void ntreeTexCheckCyclics(struct bNodeTree *ntree)
{
bNode *node;
- for(node= ntree->nodes.first; node; node= node->next) {
+ 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) {
+ if (node->custom1) {
node->custom2 = 1;
node->custom1 = 0;
- } else {
+ }
+ else {
Tex *tex = (Tex *)node->id;
node->custom2 = 0;
node->custom1 = 1;
- if(tex->use_nodes && tex->nodetree) {
+ if (tex->use_nodes && tex->nodetree) {
ntreeTexCheckCyclics(tex->nodetree);
}
node->custom1 = 0;
diff --git a/source/blender/nodes/texture/nodes/node_texture_bricks.c b/source/blender/nodes/texture/nodes/node_texture_bricks.c
index 9e76309bce9..ac8799762bd 100644
--- a/source/blender/nodes/texture/nodes/node_texture_bricks.c
+++ b/source/blender/nodes/texture/nodes/node_texture_bricks.c
@@ -91,7 +91,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
rownum = (int)floor(y / row_height);
- if( node->custom1 && node->custom2 ) {
+ if ( node->custom1 && node->custom2 ) {
brick_width *= ((int)(rownum) % node->custom2 ) ? 1.0f : node->custom4; /* squash */
offset = ((int)(rownum) % node->custom1 ) ? 0 : (brick_width*node->custom3); /* offset */
}
@@ -104,11 +104,12 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
tint = noise((rownum << 16) + (bricknum & 0xFFFF)) + bias;
CLAMP(tint,0.0f,1.0f);
- if( ins_x < mortar_thickness || ins_y < mortar_thickness ||
+ if ( ins_x < mortar_thickness || ins_y < mortar_thickness ||
ins_x > (brick_width - mortar_thickness) ||
ins_y > (row_height - mortar_thickness) ) {
copy_v4_v4( out, mortar );
- } else {
+ }
+ else {
copy_v4_v4( out, bricks1 );
ramp_blend( MA_RAMP_BLEND, out, tint, bricks2 );
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_checker.c b/source/blender/nodes/texture/nodes/node_texture_checker.c
index 6b5848270ba..c96a73d09f2 100644
--- a/source/blender/nodes/texture/nodes/node_texture_checker.c
+++ b/source/blender/nodes/texture/nodes/node_texture_checker.c
@@ -57,9 +57,10 @@ static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **
int yi = (int)fabs(floor(0.00001f + y / sz));
int zi = (int)fabs(floor(0.00001f + z / sz));
- if( (xi % 2 == yi % 2) == (zi % 2) ) {
+ if ( (xi % 2 == yi % 2) == (zi % 2) ) {
tex_input_rgba(out, in[0], p, thread);
- } else {
+ }
+ else {
tex_input_rgba(out, in[1], p, thread);
}
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_compose.c b/source/blender/nodes/texture/nodes/node_texture_compose.c
index 5256db98d78..a3ac196ab12 100644
--- a/source/blender/nodes/texture/nodes/node_texture_compose.c
+++ b/source/blender/nodes/texture/nodes/node_texture_compose.c
@@ -48,7 +48,7 @@ static bNodeSocketTemplate outputs[]= {
static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread)
{
int i;
- for(i = 0; i < 4; i++)
+ for (i = 0; i < 4; i++)
out[i] = tex_input_value(in[i], p, thread);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_curves.c b/source/blender/nodes/texture/nodes/node_texture_curves.c
index 08e7efc1606..0f7213a5be0 100644
--- a/source/blender/nodes/texture/nodes/node_texture_curves.c
+++ b/source/blender/nodes/texture/nodes/node_texture_curves.c
@@ -46,7 +46,7 @@ static void time_colorfn(float *out, TexParams *p, bNode *node, bNodeStack **UNU
/* stack order output: fac */
float fac= 0.0f;
- if(node->custom1 < node->custom2)
+ if (node->custom1 < node->custom2)
fac = (p->cfra - node->custom1)/(float)(node->custom2-node->custom1);
fac = curvemapping_evaluateF(node->storage, 0, fac);
diff --git a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c
index e566fb0298a..d5a957a3b28 100644
--- a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c
+++ b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c
@@ -49,16 +49,16 @@ static bNodeSocketTemplate outputs[]= {
static void do_hue_sat_fac(bNode *UNUSED(node), float *out, float hue, float sat, float val, float *in, float fac)
{
- if(fac != 0 && (hue != 0.5f || sat != 1 || val != 1)) {
+ if (fac != 0 && (hue != 0.5f || sat != 1 || val != 1)) {
float col[3], hsv[3], mfac= 1.0f - fac;
rgb_to_hsv(in[0], in[1], in[2], hsv, hsv+1, hsv+2);
hsv[0]+= (hue - 0.5f);
- if(hsv[0]>1.0f) hsv[0]-=1.0f; else if(hsv[0]<0.0f) hsv[0]+= 1.0f;
+ if (hsv[0]>1.0f) hsv[0]-=1.0f; else if (hsv[0]<0.0f) hsv[0]+= 1.0f;
hsv[1]*= sat;
- if(hsv[1]>1.0f) hsv[1]= 1.0f; else if(hsv[1]<0.0f) hsv[1]= 0.0f;
+ if (hsv[1]>1.0f) hsv[1]= 1.0f; else if (hsv[1]<0.0f) hsv[1]= 0.0f;
hsv[2]*= val;
- if(hsv[2]>1.0f) hsv[2]= 1.0f; else if(hsv[2]<0.0f) hsv[2]= 0.0f;
+ if (hsv[2]>1.0f) hsv[2]= 1.0f; else if (hsv[2]<0.0f) hsv[2]= 0.0f;
hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
out[0]= mfac*in[0] + fac*col[0];
diff --git a/source/blender/nodes/texture/nodes/node_texture_image.c b/source/blender/nodes/texture/nodes/node_texture_image.c
index 0acfe62ed82..d0bc30089e2 100644
--- a/source/blender/nodes/texture/nodes/node_texture_image.c
+++ b/source/blender/nodes/texture/nodes/node_texture_image.c
@@ -45,9 +45,9 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **UNUSED(i
Image *ima= (Image *)node->id;
ImageUser *iuser= (ImageUser *)node->storage;
- if( ima ) {
+ if ( ima ) {
ImBuf *ibuf = BKE_image_get_ibuf(ima, iuser);
- if( ibuf ) {
+ if ( ibuf ) {
float xsize, ysize;
float xoff, yoff;
int px, py;
@@ -61,19 +61,19 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **UNUSED(i
px = (int)( (x-xoff) * xsize );
py = (int)( (y-yoff) * ysize );
- if( (!xsize) || (!ysize) ) return;
+ if ( (!xsize) || (!ysize) ) return;
- if( !ibuf->rect_float ) {
+ if ( !ibuf->rect_float ) {
BLI_lock_thread(LOCK_IMAGE);
- if( !ibuf->rect_float )
+ if ( !ibuf->rect_float )
IMB_float_from_rect(ibuf);
BLI_unlock_thread(LOCK_IMAGE);
}
- while( px < 0 ) px += ibuf->x;
- while( py < 0 ) py += ibuf->y;
- while( px >= ibuf->x ) px -= ibuf->x;
- while( py >= ibuf->y ) py -= ibuf->y;
+ while ( px < 0 ) px += ibuf->x;
+ while ( py < 0 ) py += ibuf->y;
+ while ( px >= ibuf->x ) px -= ibuf->x;
+ while ( py >= ibuf->y ) py -= ibuf->y;
result = ibuf->rect_float + py*ibuf->x*4 + px*4;
copy_v4_v4( out, result );
diff --git a/source/blender/nodes/texture/nodes/node_texture_math.c b/source/blender/nodes/texture/nodes/node_texture_math.c
index 4659aa2b6c0..29d154df884 100644
--- a/source/blender/nodes/texture/nodes/node_texture_math.c
+++ b/source/blender/nodes/texture/nodes/node_texture_math.c
@@ -51,7 +51,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
float in0 = tex_input_value(in[0], p, thread);
float in1 = tex_input_value(in[1], p, thread);
- switch(node->custom1){
+ switch(node->custom1) {
case 0: /* Add */
*out= in0 + in1;
@@ -64,7 +64,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
break;
case 3: /* Divide */
{
- if(in1==0) /* We don't want to divide by zero. */
+ if (in1==0) /* We don't want to divide by zero. */
*out= 0.0;
else
*out= in0 / in1;
@@ -88,7 +88,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
case 7: /* Arc-Sine */
{
/* Can't do the impossible... */
- if( in0 <= 1 && in0 >= -1 )
+ if ( in0 <= 1 && in0 >= -1 )
*out= asin(in0);
else
*out= 0.0;
@@ -97,7 +97,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
case 8: /* Arc-Cosine */
{
/* Can't do the impossible... */
- if( in0 <= 1 && in0 >= -1 )
+ if ( in0 <= 1 && in0 >= -1 )
*out= acos(in0);
else
*out= 0.0;
@@ -111,13 +111,15 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
case 10: /* Power */
{
/* Only raise negative numbers by full integers */
- if( in0 >= 0 ) {
+ if ( in0 >= 0 ) {
out[0]= pow(in0, in1);
- } else {
+ }
+ else {
float y_mod_1 = fmod(in1, 1);
if (y_mod_1 > 0.999f || y_mod_1 < 0.001f) {
*out = pow(in0, floor(in1 + 0.5f));
- } else {
+ }
+ else {
*out = 0.0;
}
}
@@ -126,7 +128,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
case 11: /* Logarithm */
{
/* Don't want any imaginary numbers... */
- if( in0 > 0 && in1 > 0 )
+ if ( in0 > 0 && in1 > 0 )
*out= log(in0) / log(in1);
else
*out= 0.0;
@@ -134,7 +136,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
break;
case 12: /* Minimum */
{
- if( in0 < in1 )
+ if ( in0 < in1 )
*out= in0;
else
*out= in1;
@@ -142,7 +144,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
break;
case 13: /* Maximum */
{
- if( in0 > in1 )
+ if ( in0 > in1 )
*out= in0;
else
*out= in1;
@@ -156,7 +158,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
case 15: /* Less Than */
{
- if( in0 < in1 )
+ if ( in0 < in1 )
*out= 1.0f;
else
*out= 0.0f;
@@ -165,7 +167,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
case 16: /* Greater Than */
{
- if( in0 > in1 )
+ if ( in0 > in1 )
*out= 1.0f;
else
*out= 0.0f;
diff --git a/source/blender/nodes/texture/nodes/node_texture_output.c b/source/blender/nodes/texture/nodes/node_texture_output.c
index 36b31a864a5..2b899fde593 100644
--- a/source/blender/nodes/texture/nodes/node_texture_output.c
+++ b/source/blender/nodes/texture/nodes/node_texture_output.c
@@ -46,11 +46,11 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o
TexCallData *cdata = (TexCallData *)data;
TexResult *target = cdata->target;
- if(cdata->do_preview) {
+ if (cdata->do_preview) {
TexParams params;
params_from_cdata(&params, cdata);
- if(in[1] && in[1]->hasinput && !in[0]->hasinput)
+ if (in[1] && in[1]->hasinput && !in[0]->hasinput)
tex_input_rgba(&target->tr, in[1], &params, cdata->thread);
else
tex_input_rgba(&target->tr, in[0], &params, cdata->thread);
@@ -58,7 +58,7 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o
}
else {
/* 0 means don't care, so just use first */
- if(cdata->which_output == node->custom1 || (cdata->which_output == 0 && node->custom1 == 1)) {
+ if (cdata->which_output == node->custom1 || (cdata->which_output == 0 && node->custom1 == 1)) {
TexParams params;
params_from_cdata(&params, cdata);
@@ -67,8 +67,8 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o
target->tin = (target->tr + target->tg + target->tb) / 3.0f;
target->talpha = 1;
- if(target->nor) {
- if(in[1] && in[1]->hasinput)
+ if (target->nor) {
+ if (in[1] && in[1]->hasinput)
tex_input_vec(target->nor, in[1], &params, cdata->thread);
else
target->nor = NULL;
@@ -87,23 +87,24 @@ static void unique_name(bNode *node)
char *name = tno->name;
i = node;
- while(i->prev) i = i->prev;
- for(; i; i=i->next) {
- if(
+ while (i->prev) i = i->prev;
+ for (; i; i=i->next) {
+ if (
i == node ||
i->type != TEX_NODE_OUTPUT ||
strcmp(name, ((TexNodeOutput*)(i->storage))->name)
)
continue;
- if(!new_name) {
+ if (!new_name) {
int len = strlen(name);
- if(len >= 4 && sscanf(name + len - 4, ".%03d", &suffix) == 1) {
+ if (len >= 4 && sscanf(name + len - 4, ".%03d", &suffix) == 1) {
new_len = len;
- } else {
+ }
+ else {
suffix = 0;
new_len = len + 4;
- if(new_len > (sizeof(tno->name) - 1))
+ if (new_len > (sizeof(tno->name) - 1))
new_len = (sizeof(tno->name) - 1);
}
@@ -114,7 +115,7 @@ static void unique_name(bNode *node)
sprintf(new_name + new_len - 4, ".%03d", ++suffix);
}
- if(new_name) {
+ if (new_name) {
strcpy(tno->name, new_name);
MEM_freeN(new_name);
}
@@ -126,13 +127,13 @@ static void assign_index(struct bNode *node)
int index = 1;
tnode = node;
- while(tnode->prev)
+ while (tnode->prev)
tnode = tnode->prev;
check_index:
- for(; tnode; tnode= tnode->next)
- if(tnode->type == TEX_NODE_OUTPUT && tnode != node)
- if(tnode->custom1 == index) {
+ for (; tnode; tnode= tnode->next)
+ if (tnode->type == TEX_NODE_OUTPUT && tnode != node)
+ if (tnode->custom1 == index) {
index ++;
goto check_index;
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c
index efc8228c01c..348827bd26c 100644
--- a/source/blender/nodes/texture/nodes/node_texture_proc.c
+++ b/source/blender/nodes/texture/nodes/node_texture_proc.c
@@ -62,7 +62,7 @@ static void do_proc(float *result, TexParams *p, float *col1, float *col2, char
TexResult texres;
int textype;
- if(is_normal) {
+ if (is_normal) {
texres.nor = result;
}
else
@@ -71,10 +71,10 @@ static void do_proc(float *result, TexParams *p, float *col1, float *col2, char
textype = multitex_nodes(tex, p->co, p->dxt, p->dyt, p->osatex,
&texres, thread, 0, p->shi, p->mtex);
- if(is_normal)
+ if (is_normal)
return;
- if(textype & TEX_RGB) {
+ if (textype & TEX_RGB) {
copy_v4_v4(result, &texres.tr);
}
else {
@@ -108,7 +108,7 @@ static int count_outputs(bNode *node)
{
bNodeSocket *sock;
int num = 0;
- for(sock= node->outputs.first; sock; sock= sock->next) {
+ for (sock= node->outputs.first; sock; sock= sock->next) {
num++;
}
return num;
@@ -132,8 +132,8 @@ static int count_outputs(bNode *node)
static void name##_exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) \
{ \
int outs = count_outputs(node); \
- if(outs >= 1) tex_output(node, in, out[0], &name##_colorfn, data); \
- if(outs >= 2) tex_output(node, in, out[1], &name##_normalfn, data); \
+ if (outs >= 1) tex_output(node, in, out[0], &name##_colorfn, data); \
+ if (outs >= 2) tex_output(node, in, out[1], &name##_normalfn, data); \
}
@@ -289,7 +289,7 @@ static void init(bNodeTree *UNUSED(ntree), bNode* node, bNodeTemplate *UNUSED(nt
default_tex(tex);
tex->type = node->type - TEX_NODE_PROC;
- if(tex->type == TEX_WOOD)
+ if (tex->type == TEX_WOOD)
tex->stype = TEX_BANDNOISE;
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_texture.c b/source/blender/nodes/texture/nodes/node_texture_texture.c
index d408b874b84..bf93231c306 100644
--- a/source/blender/nodes/texture/nodes/node_texture_texture.c
+++ b/source/blender/nodes/texture/nodes/node_texture_texture.c
@@ -63,11 +63,11 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
zero_v3(dyt);
}
- if(node->custom2 || node->need_exec==0) {
+ if (node->custom2 || node->need_exec==0) {
/* this node refers to its own texture tree! */
copy_v4_v4(out, (fabs(co[0] - co[1]) < .01) ? white : red );
}
- else if(nodetex) {
+ else if (nodetex) {
TexResult texres;
int textype;
float nor[] = {0,0,0};
@@ -80,7 +80,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
textype = multitex_nodes(nodetex, co, dxt, dyt, p->osatex,
&texres, thread, 0, p->shi, p->mtex);
- if(textype & TEX_RGB) {
+ if (textype & TEX_RGB) {
copy_v4_v4(out, &texres.tr);
}
else {
diff --git a/source/blender/nodes/texture/nodes/node_texture_valToRgb.c b/source/blender/nodes/texture/nodes/node_texture_valToRgb.c
index c0efa43c14f..1d282b4d4cc 100644
--- a/source/blender/nodes/texture/nodes/node_texture_valToRgb.c
+++ b/source/blender/nodes/texture/nodes/node_texture_valToRgb.c
@@ -45,7 +45,7 @@ static bNodeSocketTemplate valtorgb_out[]= {
static void valtorgb_colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
- if(node->storage) {
+ if (node->storage) {
float fac = tex_input_value(in[0], p, thread);
do_colorband(node->storage, fac, out);
diff --git a/source/blender/nodes/texture/nodes/node_texture_viewer.c b/source/blender/nodes/texture/nodes/node_texture_viewer.c
index 401e72761e3..0d7a04b06e2 100644
--- a/source/blender/nodes/texture/nodes/node_texture_viewer.c
+++ b/source/blender/nodes/texture/nodes/node_texture_viewer.c
@@ -46,7 +46,7 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o
{
TexCallData *cdata = (TexCallData *)data;
- if(cdata->do_preview) {
+ if (cdata->do_preview) {
TexParams params;
float col[4];
params_from_cdata(&params, cdata);
diff --git a/source/blender/python/bmesh/CMakeLists.txt b/source/blender/python/bmesh/CMakeLists.txt
index 2b5a58171b6..40bde7161b6 100644
--- a/source/blender/python/bmesh/CMakeLists.txt
+++ b/source/blender/python/bmesh/CMakeLists.txt
@@ -33,13 +33,17 @@ set(INC_SYS
set(SRC
bmesh_py_api.c
- bmesh_py_select.c
bmesh_py_types.c
+ bmesh_py_types_customdata.c
+ bmesh_py_types_meshdata.c
+ bmesh_py_types_select.c
bmesh_py_utils.c
bmesh_py_api.h
- bmesh_py_select.h
bmesh_py_types.h
+ bmesh_py_types_customdata.h
+ bmesh_py_types_meshdata.h
+ bmesh_py_types_select.h
bmesh_py_utils.h
)
diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c
index b6064c452fe..77276df49f2 100644
--- a/source/blender/python/bmesh/bmesh_py_api.c
+++ b/source/blender/python/bmesh/bmesh_py_api.c
@@ -31,13 +31,16 @@
#include <Python.h>
+#include "BLI_utildefines.h"
+
#include "bmesh.h"
#include "bmesh_py_types.h"
-#include "bmesh_py_utils.h"
-#include "bmesh_py_select.h"
+#include "bmesh_py_types_select.h"
+#include "bmesh_py_types_customdata.h"
+#include "bmesh_py_types_meshdata.h"
-#include "BLI_utildefines.h"
+#include "bmesh_py_utils.h"
#include "BKE_tessmesh.h"
@@ -47,36 +50,68 @@
#include "bmesh_py_api.h" /* own include */
-PyDoc_STRVAR(bpy_bm_from_mesh_doc,
-".. method:: from_mesh(mesh)\n"
+
+PyDoc_STRVAR(bpy_bm_new_doc,
+".. method:: new()\n"
+"\n"
+" :return: Return a new, empty BMesh.\n"
+" :rtype: :class:`bmesh.types.BMesh`\n"
+);
+
+static PyObject *bpy_bm_new(PyObject *UNUSED(self))
+{
+ BMesh *bm;
+
+ bm = BM_mesh_create(&bm_mesh_allocsize_default);
+
+ return BPy_BMesh_CreatePyObject(bm, BPY_BMFLAG_NOP);
+}
+
+PyDoc_STRVAR(bpy_bm_from_edit_mesh_doc,
+".. method:: from_edit_mesh(mesh)\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_from_mesh(PyObject *UNUSED(self), PyObject *value)
+static PyObject *bpy_bm_from_edit_mesh(PyObject *UNUSED(self), PyObject *value)
{
+ BMesh *bm;
Mesh *me = PyC_RNA_AsPointer(value, "Mesh");
- /* temp! */
- if (!me->edit_btmesh) {
+ if (me == NULL) {
+ return NULL;
+ }
+
+ if (me->edit_btmesh == NULL) {
PyErr_SetString(PyExc_ValueError,
- "Mesh is not in editmode");
+ "The mesh must be in editmode");
return NULL;
}
- return BPy_BMesh_CreatePyObject(me->edit_btmesh->bm);
+ bm = me->edit_btmesh->bm;
+
+ return BPy_BMesh_CreatePyObject(bm, BPY_BMFLAG_IS_WRAPPED);
}
static struct PyMethodDef BPy_BM_methods[] = {
- {"from_mesh", (PyCFunction)bpy_bm_from_mesh, METH_O, bpy_bm_from_mesh_doc},
- {NULL, NULL, 0, NULL}
+ {"new", (PyCFunction)bpy_bm_new, METH_NOARGS, bpy_bm_new_doc},
+ {"from_edit_mesh", (PyCFunction)bpy_bm_from_edit_mesh, METH_O, bpy_bm_from_edit_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"
+"\n"
+"\n"
+".. include:: include__bmesh.rst\n"
);
static struct PyModuleDef BPy_BM_module_def = {
PyModuleDef_HEAD_INIT,
@@ -97,17 +132,18 @@ PyObject *BPyInit_bmesh(void)
PyObject *sys_modules = PySys_GetObject("modules"); /* not pretty */
BPy_BM_init_types();
- BPy_BM_init_select_types();
-
+ BPy_BM_init_types_select();
+ BPy_BM_init_types_customdata();
+ BPy_BM_init_types_meshdata();
mod = PyModule_Create(&BPy_BM_module_def);
/* bmesh.types */
- PyModule_AddObject(mod, "types", (submodule=BPyInit_bmesh_types()));
+ PyModule_AddObject(mod, "types", (submodule = BPyInit_bmesh_types()));
PyDict_SetItemString(sys_modules, "bmesh.types", submodule);
Py_INCREF(submodule);
- PyModule_AddObject(mod, "utils", (submodule=BPyInit_bmesh_utils()));
+ PyModule_AddObject(mod, "utils", (submodule = BPyInit_bmesh_utils()));
PyDict_SetItemString(sys_modules, "bmesh.utils", submodule);
Py_INCREF(submodule);
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index 1145fbbd452..4b4dc7caa7f 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -31,7 +31,13 @@
#include "BLI_math.h"
+#include "DNA_mesh_types.h"
+#include "DNA_object_types.h"
+#include "DNA_material_types.h"
+
+#include "BKE_depsgraph.h"
#include "BKE_customdata.h"
+#include "BKE_DerivedMesh.h"
#include "bmesh.h"
@@ -39,8 +45,10 @@
#include "../generic/py_capi_utils.h"
-#include "bmesh_py_select.h"
#include "bmesh_py_types.h" /* own include */
+#include "bmesh_py_types_select.h"
+#include "bmesh_py_types_customdata.h"
+#include "bmesh_py_types_meshdata.h"
/* Common Flags
* ************ */
@@ -173,7 +181,7 @@ static int bpy_bm_elem_index_set(BPy_BMElem *self, PyObject *value, void *UNUSED
}
}
-/* type spesific get/sets
+/* type specific get/sets
* ---------------------- */
@@ -181,22 +189,42 @@ static int bpy_bm_elem_index_set(BPy_BMElem *self, PyObject *value, void *UNUSED
* ^^^^ */
/* doc-strings for all uses of this funcion */
-PyDoc_STRVAR(bpy_bmesh_verts_doc,
-"This meshes vert sequence (read-only).\n\n:type: :class:`BMElemSeq`"
-);
-PyDoc_STRVAR(bpy_bmesh_edges_doc,
-"This meshes edge sequence (read-only).\n\n:type: :class:`BMElemSeq`"
+
+PyDoc_STRVAR(bpy_bmvertseq_doc,
+"This meshes vert sequence (read-only).\n\n:type: :class:`BMVertSeq`"
);
-PyDoc_STRVAR(bpy_bmesh_faces_doc,
-"This meshes face sequence (read-only).\n\n:type: :class:`BMElemSeq`"
+static PyObject *bpy_bmvertseq_get(BPy_BMesh *self, void *UNUSED(closure))
+{
+ BPY_BM_CHECK_OBJ(self);
+ return BPy_BMVertSeq_CreatePyObject(self->bm);
+}
+
+PyDoc_STRVAR(bpy_bmedgeseq_doc,
+"This meshes edge sequence (read-only).\n\n:type: :class:`BMEdgeSeq`"
);
+static PyObject *bpy_bmedgeseq_get(BPy_BMesh *self, void *UNUSED(closure))
+{
+ BPY_BM_CHECK_OBJ(self);
+ return BPy_BMEdgeSeq_CreatePyObject(self->bm);
+}
-static PyObject *bpy_bmelemseq_get(BPy_BMesh *self, void *itype)
+PyDoc_STRVAR(bpy_bmfaceseq_doc,
+"This meshes face sequence (read-only).\n\n:type: :class:`BMFaceSeq`"
+);
+static PyObject *bpy_bmfaceseq_get(BPy_BMesh *self, void *UNUSED(closure))
{
BPY_BM_CHECK_OBJ(self);
- return BPy_BMElemSeq_CreatePyObject(self->bm, NULL, GET_INT_FROM_POINTER(itype));
+ return BPy_BMFaceSeq_CreatePyObject(self->bm);
}
+PyDoc_STRVAR(bpy_bmloopseq_doc,
+"This meshes face sequence (read-only).\n\n:type: :class:`BMLoopSeq`"
+);
+static PyObject *bpy_bmloopseq_get(BPy_BMesh *self, void *UNUSED(closure))
+{
+ BPY_BM_CHECK_OBJ(self);
+ return BPy_BMLoopSeq_CreatePyObject(self->bm);
+}
/* vert */
PyDoc_STRVAR(bpy_bmvert_link_edges_doc,
@@ -248,6 +276,15 @@ static PyObject *bpy_bm_is_valid_get(BPy_BMGeneric *self)
return PyBool_FromLong(BPY_BM_IS_VALID(self));
}
+PyDoc_STRVAR(bpy_bmesh_is_wrapped_doc,
+"True when this mesh is owned by blender (typically the editmode BMesh).\n\n:type: boolean"
+);
+static PyObject *bpy_bmesh_is_wrapped_get(BPy_BMesh *self)
+{
+ BPY_BM_CHECK_OBJ(self);
+
+ return PyBool_FromLong(self->flag & BPY_BMFLAG_IS_WRAPPED);
+}
PyDoc_STRVAR(bpy_bmesh_select_mode_doc,
"The selection mode, values can be {'VERT', 'EDGE', 'FACE'}, can't be assigned an empty set.\n\n:type: set"
@@ -288,12 +325,11 @@ static PyObject *bpy_bmesh_select_history_get(BPy_BMesh *self)
return BPy_BMEditSel_CreatePyObject(self->bm);
}
-static int bpy_bmesh_select_history_set(BPy_BMesh *self, PyObject *UNUSED(value))
+static int bpy_bmesh_select_history_set(BPy_BMesh *self, PyObject *value)
{
BPY_BM_CHECK_INT(self);
- PyErr_SetString(PyExc_NotImplementedError, "not yet functional");
- return -1;
+ return BPy_BMEditSel_Assign(self, value);
}
/* Vert
@@ -349,7 +385,7 @@ PyDoc_STRVAR(bpy_bmvert_is_manifold_doc,
static PyObject *bpy_bmvert_is_manifold_get(BPy_BMVert *self)
{
BPY_BM_CHECK_OBJ(self);
- return PyBool_FromLong(BM_vert_is_manifold(self->bm, self->v));
+ return PyBool_FromLong(BM_vert_is_manifold(self->v));
}
@@ -359,7 +395,7 @@ PyDoc_STRVAR(bpy_bmvert_is_wire_doc,
static PyObject *bpy_bmvert_is_wire_get(BPy_BMVert *self)
{
BPY_BM_CHECK_OBJ(self);
- return PyBool_FromLong(BM_vert_is_wire(self->bm, self->v));
+ return PyBool_FromLong(BM_vert_is_wire(self->v));
}
@@ -372,7 +408,7 @@ PyDoc_STRVAR(bpy_bmedge_is_manifold_doc,
static PyObject *bpy_bmedge_is_manifold_get(BPy_BMEdge *self)
{
BPY_BM_CHECK_OBJ(self);
- return PyBool_FromLong(BM_edge_is_manifold(self->bm, self->e));
+ return PyBool_FromLong(BM_edge_is_manifold(self->e));
}
@@ -382,7 +418,7 @@ PyDoc_STRVAR(bpy_bmedge_is_wire_doc,
static PyObject *bpy_bmedge_is_wire_get(BPy_BMEdge *self)
{
BPY_BM_CHECK_OBJ(self);
- return PyBool_FromLong(BM_edge_is_wire(self->bm, self->e));
+ return PyBool_FromLong(BM_edge_is_wire(self->e));
}
@@ -420,6 +456,40 @@ static int bpy_bmface_normal_set(BPy_BMFace *self, PyObject *value)
}
}
+PyDoc_STRVAR(bpy_bmface_material_index_doc,
+"The faces material index.\n\n:type: int"
+);
+static PyObject *bpy_bmface_material_index_get(BPy_BMFace *self)
+{
+ BPY_BM_CHECK_OBJ(self);
+ return PyLong_FromLong(self->f->mat_nr);
+}
+
+static int bpy_bmface_material_index_set(BPy_BMFace *self, PyObject *value)
+{
+ int param;
+
+ BPY_BM_CHECK_INT(self);
+
+ param = PyLong_AsLong(value);
+
+ if (param == -1 && PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "expected an int type");
+ return -1;
+ }
+ else if ((param < 0) || (param > MAXMAT)) {
+ /* normally we clamp but in this case raise an error */
+ PyErr_SetString(PyExc_ValueError,
+ "material index outside of usable range (0 - 32766)");
+ return -1;
+ }
+ else {
+ self->f->mat_nr = (short)param;
+ return 0;
+ }
+}
+
/* Loop
* ^^^^ */
@@ -470,17 +540,32 @@ static PyObject *bpy_bmloop_link_loop_prev_get(BPy_BMLoop *self)
return BPy_BMLoop_CreatePyObject(self->bm, self->l->prev);
}
+/* ElemSeq
+ * ^^^^^^^ */
+
+/* note: use for bmvert/edge/face/loop seq's use these, not bmelemseq directly */
+PyDoc_STRVAR(bpy_bmelemseq_layers_doc,
+"blah blah (read-only).\n\n:type: :class:`BMLayerAccess`"
+);
+static PyObject *bpy_bmelemseq_layers_get(BPy_BMElemSeq *self, void *htype)
+{
+ BPY_BM_CHECK_OBJ(self);
+
+ return BPy_BMLayerAccess_CreatePyObject(self->bm, GET_INT_FROM_POINTER(htype));
+}
static PyGetSetDef bpy_bmesh_getseters[] = {
- {(char *)"verts", (getter)bpy_bmelemseq_get, (setter)NULL, (char *)bpy_bmesh_verts_doc, (void *)BM_VERTS_OF_MESH},
- {(char *)"edges", (getter)bpy_bmelemseq_get, (setter)NULL, (char *)bpy_bmesh_edges_doc, (void *)BM_EDGES_OF_MESH},
- {(char *)"faces", (getter)bpy_bmelemseq_get, (setter)NULL, (char *)bpy_bmesh_faces_doc, (void *)BM_FACES_OF_MESH},
+ {(char *)"verts", (getter)bpy_bmvertseq_get, (setter)NULL, (char *)bpy_bmvertseq_doc, NULL},
+ {(char *)"edges", (getter)bpy_bmedgeseq_get, (setter)NULL, (char *)bpy_bmedgeseq_doc, NULL},
+ {(char *)"faces", (getter)bpy_bmfaceseq_get, (setter)NULL, (char *)bpy_bmfaceseq_doc, NULL},
+ {(char *)"loops", (getter)bpy_bmloopseq_get, (setter)NULL, (char *)bpy_bmloopseq_doc, NULL},
{(char *)"select_mode", (getter)bpy_bmesh_select_mode_get, (setter)bpy_bmesh_select_mode_set, (char *)bpy_bmesh_select_mode_doc, NULL},
{(char *)"select_history", (getter)bpy_bmesh_select_history_get, (setter)bpy_bmesh_select_history_set, (char *)bpy_bmesh_select_history_doc, NULL},
/* readonly checks */
- {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
+ {(char *)"is_wrapped", (getter)bpy_bmesh_is_wrapped_get, (setter)NULL, (char *)bpy_bmesh_is_wrapped_doc, NULL}, /* as with mathutils */
+ {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
@@ -544,6 +629,8 @@ static PyGetSetDef bpy_bmface_getseters[] = {
{(char *)"normal", (getter)bpy_bmface_normal_get, (setter)bpy_bmface_normal_set, (char *)bpy_bmface_normal_doc, NULL},
+ {(char *)"material_index", (getter)bpy_bmface_material_index_get, (setter)bpy_bmface_material_index_set, (char *)bpy_bmface_material_index_doc, NULL},
+
/* connectivity data */
{(char *)"verts", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmface_verts_doc, (void *)BM_VERTS_OF_FACE},
{(char *)"edges", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmface_edges_doc, (void *)BM_EDGES_OF_FACE},
@@ -578,6 +665,23 @@ static PyGetSetDef bpy_bmloop_getseters[] = {
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
+static PyGetSetDef bpy_bmvertseq_getseters[] = {
+ {(char *)"layers", (getter)bpy_bmelemseq_layers_get, (setter)NULL, (char *)bpy_bmelemseq_layers_doc, (void *)BM_VERT},
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+};
+static PyGetSetDef bpy_bmedgeseq_getseters[] = {
+ {(char *)"layers", (getter)bpy_bmelemseq_layers_get, (setter)NULL, (char *)bpy_bmelemseq_layers_doc, (void *)BM_EDGE},
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+};
+static PyGetSetDef bpy_bmfaceseq_getseters[] = {
+ {(char *)"layers", (getter)bpy_bmelemseq_layers_get, (setter)NULL, (char *)bpy_bmelemseq_layers_doc, (void *)BM_FACE},
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+};
+static PyGetSetDef bpy_bmloopseq_getseters[] = {
+ {(char *)"layers", (getter)bpy_bmelemseq_layers_get, (setter)NULL, (char *)bpy_bmelemseq_layers_doc, (void *)BM_LOOP},
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+};
+
/* Methods
* ======= */
@@ -586,6 +690,195 @@ static PyGetSetDef bpy_bmloop_getseters[] = {
/* Mesh
* ---- */
+PyDoc_STRVAR(bpy_bmesh_copy_doc,
+".. method:: copy()\n"
+"\n"
+" :return: A copy of this BMesh.\n"
+" :rtype: :class:`BMesh`\n"
+);
+static PyObject *bpy_bmesh_copy(BPy_BMesh *self)
+{
+ BMesh *bm;
+ BMesh *bm_copy;
+
+ BPY_BM_CHECK_OBJ(self);
+
+ bm = self->bm;
+
+ bm_copy = BM_mesh_copy(bm);
+
+ if (bm_copy) {
+ return BPy_BMesh_CreatePyObject(bm_copy, BPY_BMFLAG_NOP);
+ }
+ else {
+ PyErr_SetString(PyExc_SystemError, "Unable to copy BMesh, internal error");
+ return NULL;
+ }
+}
+
+PyDoc_STRVAR(bpy_bmesh_clear_doc,
+".. method:: clear()\n"
+"\n"
+" Clear all mesh data.\n"
+);
+static PyObject *bpy_bmesh_clear(BPy_BMesh *self)
+{
+ BMesh *bm;
+
+ BPY_BM_CHECK_OBJ(self);
+
+ bm = self->bm;
+
+ BM_mesh_clear(bm);
+
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(bpy_bmesh_free_doc,
+".. method:: free()\n"
+"\n"
+" Explicitly free the BMesh data from memory, causing exceptions on further access.\n"
+"\n"
+" .. note::\n"
+"\n"
+" The BMesh is freed automatically, typically when the script finishes executing.\n"
+" However in some cases its hard to predict when this will be and its useful to\n"
+" explicitly free the data.\n"
+);
+static PyObject *bpy_bmesh_free(BPy_BMesh *self)
+{
+ if (self->bm) {
+ BMesh *bm = self->bm;
+
+ if ((self->flag & BPY_BMFLAG_IS_WRAPPED) == 0) {
+ BM_mesh_free(bm);
+ }
+
+ bpy_bm_generic_invalidate((BPy_BMGeneric *)self);
+ }
+
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(bpy_bmesh_to_mesh_doc,
+".. method:: to_mesh(mesh)\n"
+"\n"
+" Writes this BMesh data into an existing Mesh datablock.\n"
+"\n"
+" :arg mesh: The mesh data to write into.\n"
+" :type mesh: :class:`Mesh`\n"
+);
+static PyObject *bpy_bmesh_to_mesh(BPy_BMesh *self, PyObject *args)
+{
+ PyObject *py_mesh;
+ Mesh *me;
+ BMesh *bm;
+
+ BPY_BM_CHECK_OBJ(self);
+
+ if (!PyArg_ParseTuple(args, "O:to_mesh", &py_mesh) ||
+ !(me = PyC_RNA_AsPointer(py_mesh, "Mesh")))
+ {
+ return NULL;
+ }
+
+ /* we could allow this but its almost certainly _not_ what script authors want */
+ if (me->edit_btmesh) {
+ PyErr_Format(PyExc_ValueError,
+ "to_mesh(): Mesh '%s' is in editmode", me->id.name + 2);
+ return NULL;
+ }
+
+ bm = self->bm;
+
+ BM_mesh_bm_to_me(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;
+}
+
+/* note: rna_Object_to_mesh() also has apply_modifiers arg that works the same way */
+PyDoc_STRVAR(bpy_bmesh_from_object_doc,
+".. method:: from_object(mesh, apply_modifiers=True)\n"
+"\n"
+" Initialize this bmesh from existing object datablock.\n"
+"\n"
+" :arg object: The object data to load.\n"
+" :type object: :class:`Object`\n"
+" :arg apply_modifiers: Use the final display mesh rather then the deformed cage.\n"
+" :type apply_modifiers: boolean\n"
+);
+static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args)
+{
+ PyObject *py_object;
+ Object *ob;
+ BMesh *bm;
+ int apply_modifiers = TRUE;
+ DerivedMesh *dm;
+
+ BPY_BM_CHECK_OBJ(self);
+
+ if (!PyArg_ParseTuple(args, "O|i:from_object", &py_object, &apply_modifiers) ||
+ !(ob = PyC_RNA_AsPointer(py_object, "Object")))
+ {
+ return NULL;
+ }
+
+ dm = apply_modifiers ? ob->derivedFinal : ob->derivedDeform;
+
+ if (dm == NULL) {
+ PyErr_Format(PyExc_ValueError,
+ "from_object(...): Object '%s' has no usable mesh data", ob->id.name + 2);
+ return NULL;
+ }
+
+ bm = self->bm;
+
+ DM_to_bmesh_ex(dm, bm);
+
+ Py_RETURN_NONE;
+}
+
+
+PyDoc_STRVAR(bpy_bmesh_from_mesh_doc,
+".. method:: from_mesh(mesh, use_shape_key=False, shape_key_index=0)\n"
+"\n"
+" Initialize this bmesh from existing mesh datablock.\n"
+"\n"
+" :arg mesh: The mesh data to load.\n"
+" :type mesh: :class:`Mesh`\n"
+" :arg use_shape_key: Use the locations from a shape key.\n"
+" :type use_shape_key: boolean\n"
+" :arg shape_key_index: The shape key index to use.\n"
+" :type shape_key_index: int\n"
+);
+static PyObject *bpy_bmesh_from_mesh(BPy_BMesh *self, PyObject *args, PyObject *kw)
+{
+ static const char *kwlist[] = {"mesh", "use_shape_key", "shape_key_index", NULL};
+ BMesh *bm;
+ PyObject *py_mesh;
+ Mesh *me;
+ int use_shape_key = FALSE;
+ int shape_key_index = 0;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kw, "O|ii:from_mesh", (char **)kwlist,
+ &py_mesh, &use_shape_key, &shape_key_index) ||
+ !(me = PyC_RNA_AsPointer(py_mesh, "Mesh")))
+ {
+ return NULL;
+ }
+
+ bm = self->bm;
+
+ BM_mesh_bm_from_me(bm, me, use_shape_key, shape_key_index + 1);
+
+ Py_RETURN_NONE;
+}
+
+
PyDoc_STRVAR(bpy_bmesh_select_flush_mode_doc,
".. method:: select_flush_mode()\n"
"\n"
@@ -734,6 +1027,11 @@ PyDoc_STRVAR(bpy_bm_elem_select_set_doc,
"\n"
" :arg select: Select or de-select.\n"
" :type select: boolean\n"
+"\n"
+" .. note::\n"
+"\n"
+" Currently this only flushes down, so selecting a face will select all its vertices but de-selecting a vertex "
+" won't de-select all the faces that use it, before finishing with a mesh typically flushing is still needed.\n"
);
static PyObject *bpy_bm_elem_select_set(BPy_BMElem *self, PyObject *value)
{
@@ -836,9 +1134,13 @@ static PyObject *bpy_bmvert_copy_from_vert_interp(BPy_BMVert *self, PyObject *ar
Py_ssize_t vert_seq_len; /* always 2 */
vert_array = BPy_BMElem_PySeq_As_Array(&bm, vert_seq, 2, 2,
- &vert_seq_len, &BPy_BMVert_Type,
+ &vert_seq_len, BM_VERT,
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);
@@ -895,7 +1197,7 @@ PyDoc_STRVAR(bpy_bmvert_calc_edge_angle_doc,
static PyObject *bpy_bmvert_calc_edge_angle(BPy_BMVert *self)
{
BPY_BM_CHECK_OBJ(self);
- return PyFloat_FromDouble(BM_vert_edge_angle(self->bm, self->v));
+ return PyFloat_FromDouble(BM_vert_edge_angle(self->v));
}
@@ -917,18 +1219,28 @@ static PyObject *bpy_bmvert_normal_update(BPy_BMVert *self)
/* Edge
* ---- */
+PyDoc_STRVAR(bpy_bmedge_calc_length_doc,
+".. method:: calc_length()\n"
+"\n"
+" :return: The length between both verts.\n"
+" :rtype: float\n"
+);
+static PyObject *bpy_bmedge_calc_length(BPy_BMEdge *self)
+{
+ BPY_BM_CHECK_OBJ(self);
+ return PyFloat_FromDouble(len_v3v3(self->e->v1->co, self->e->v2->co));
+}
+
PyDoc_STRVAR(bpy_bmedge_calc_face_angle_doc,
".. method:: calc_face_angle()\n"
"\n"
-" Return the angle between 2 connected faces.\n"
-"\n"
-" :return: The angle between both faces in radians.\n"
+" :return: The angle between 2 connected faces in radians.\n"
" :rtype: float\n"
);
static PyObject *bpy_bmedge_calc_face_angle(BPy_BMEdge *self)
{
BPY_BM_CHECK_OBJ(self);
- return PyFloat_FromDouble(BM_edge_face_angle(self->bm, self->e));
+ return PyFloat_FromDouble(BM_edge_face_angle(self->e));
}
@@ -957,7 +1269,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;
}
@@ -1186,25 +1498,69 @@ static PyObject *bpy_bmloop_copy_from_face_interp(BPy_BMLoop *self, PyObject *ar
}
-PyDoc_STRVAR(bpy_bmloop_calc_face_angle_doc,
-".. method:: calc_face_angle()\n"
+PyDoc_STRVAR(bpy_bmloop_calc_angle_doc,
+".. method:: calc_angle()\n"
"\n"
-" Return angle at this loops corner of the face.\n"
+" Return the angle at this loops corner of the face.\n"
" This is calculated so sharper corners give lower angles.\n"
"\n"
" :return: The angle in radians.\n"
" :rtype: float\n"
);
-static PyObject *bpy_bmloop_calc_face_angle(BPy_BMLoop *self)
+static PyObject *bpy_bmloop_calc_angle(BPy_BMLoop *self)
+{
+ BPY_BM_CHECK_OBJ(self);
+ return PyFloat_FromDouble(BM_loop_face_angle(self->l));
+}
+
+PyDoc_STRVAR(bpy_bmloop_calc_normal_doc,
+".. method:: calc_normal()\n"
+"\n"
+" Return normal at this loops corner of the face.\n"
+" Falls back to the face normal for straignt lines.\n"
+"\n"
+" :return: a normalized vector.\n"
+" :rtype: :class:`mathutils.Vector`\n"
+);
+static PyObject *bpy_bmloop_calc_normal(BPy_BMLoop *self)
{
+ float vec[3];
BPY_BM_CHECK_OBJ(self);
- return PyFloat_FromDouble(BM_loop_face_angle(self->bm, self->l));
+ BM_loop_face_normal(self->l, vec);
+ return Vector_CreatePyObject(vec, 3, Py_NEW, NULL);
}
+PyDoc_STRVAR(bpy_bmloop_calc_tangent_doc,
+".. method:: calc_tangent()\n"
+"\n"
+" Return the tangent at this loops corner of the face (pointing inward into the face).\n"
+" Falls back to the face normal for straignt lines.\n"
+"\n"
+" :return: a normalized vector.\n"
+" :rtype: :class:`mathutils.Vector`\n"
+);
+static PyObject *bpy_bmloop_calc_tangent(BPy_BMLoop *self)
+{
+ float vec[3];
+ BPY_BM_CHECK_OBJ(self);
+ BM_loop_face_tangent(self->l, vec);
+ return Vector_CreatePyObject(vec, 3, Py_NEW, NULL);
+}
/* Vert Seq
* -------- */
-
+PyDoc_STRVAR(bpy_bmvertseq_new_doc,
+".. method:: new(co=(0.0, 0.0, 0.0), example=None)\n"
+"\n"
+" Create a new vertex.\n"
+"\n"
+" :arg co: The initial location of the vertex (optional argument).\n"
+" :type co: float triplet\n"
+" :arg example: Existing vert to initialize settings.\n"
+" :type example: :class:`BMVert`\n"
+" :return: The newly created edge.\n"
+" :rtype: :class:`BMVert`\n"
+);
static PyObject *bpy_bmvertseq_new(BPy_BMElemSeq *self, PyObject *args)
{
PyObject *py_co = NULL;
@@ -1250,7 +1606,18 @@ static PyObject *bpy_bmvertseq_new(BPy_BMElemSeq *self, PyObject *args)
/* Edge Seq
* -------- */
-
+PyDoc_STRVAR(bpy_bmedgeseq_new_doc,
+".. method:: new(verts, example=None)\n"
+"\n"
+" Create a new edge from a given pair of verts.\n"
+"\n"
+" :arg verts: Vertex pair.\n"
+" :type verts: pair of :class:`BMVert`\n"
+" :arg example: Existing edge to initialize settings (optional argument).\n"
+" :type example: :class:`BMEdge`\n"
+" :return: The newly created edge.\n"
+" :rtype: :class:`BMEdge`\n"
+);
static PyObject *bpy_bmedgeseq_new(BPy_BMElemSeq *self, PyObject *args)
{
PyObject *vert_seq;
@@ -1276,9 +1643,13 @@ static PyObject *bpy_bmedgeseq_new(BPy_BMElemSeq *self, PyObject *args)
}
vert_array = BPy_BMElem_PySeq_As_Array(&bm, vert_seq, 2, 2,
- &vert_seq_len, &BPy_BMVert_Type,
+ &vert_seq_len, BM_VERT,
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");
@@ -1308,7 +1679,18 @@ cleanup:
/* Face Seq
* -------- */
-
+PyDoc_STRVAR(bpy_bmfaceseq_new_doc,
+".. method:: new(verts, example=None)\n"
+"\n"
+" Create a new face from a given set of verts.\n"
+"\n"
+" :arg verts: Sequence of 3 or more verts.\n"
+" :type verts: :class:`BMVert`\n"
+" :arg example: Existing face to initialize settings (optional argument).\n"
+" :type example: :class:`BMFace`\n"
+" :return: The newly created face.\n"
+" :rtype: :class:`BMFace`\n"
+);
static PyObject *bpy_bmfaceseq_new(BPy_BMElemSeq *self, PyObject *args)
{
PyObject *vert_seq;
@@ -1339,9 +1721,13 @@ static PyObject *bpy_bmfaceseq_new(BPy_BMElemSeq *self, PyObject *args)
}
vert_array = BPy_BMElem_PySeq_As_Array(&bm, vert_seq, 3, PY_SSIZE_T_MAX,
- &vert_seq_len, &BPy_BMVert_Type,
+ &vert_seq_len, BM_VERT,
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,
@@ -1355,7 +1741,7 @@ static PyObject *bpy_bmfaceseq_new(BPy_BMElemSeq *self, PyObject *args)
edge_array = (BMEdge **)PyMem_MALLOC(vert_seq_len * sizeof(BMEdge **));
/* ensure edges */
- for (i = vert_seq_len - 1, i_next = 0; i_next < vert_seq_len; (i=i_next++)) {
+ for (i = vert_seq_len - 1, i_next = 0; i_next < vert_seq_len; (i = i_next++)) {
edge_array[i] = BM_edge_create(bm, vert_array[i], vert_array[i_next], NULL, TRUE);
}
@@ -1384,60 +1770,11 @@ cleanup:
/* Elem Seq
* -------- */
-/* eek - 3 docstrings in 1!, we might need to split up this seq at some point */
-PyDoc_STRVAR(bpy_bmelemseq_new_doc,
-".. method:: new(co=(0.0, 0.0, 0.0), example=None)\n"
-"\n"
-" *Vertex Sequence*\n"
-"\n"
-" :arg co: The initial location of the vertex (optional argument).\n"
-" :type co: float triplet\n"
-" :arg example: Existing vert to initialize settings.\n"
-" :type example: :class:`BMVert`\n"
-" :return: The newly created edge.\n"
-" :rtype: :class:`BMVert`\n"
-"\n"
-"\n"
-".. method:: new(verts, example=None)\n"
-"\n"
-" *Edge Sequence*\n"
-"\n"
-" :arg verts: Vertex pair.\n"
-" :type verts: pair of :class:`BMVert`\n"
-" :arg example: Existing edge to initialize settings (optional argument).\n"
-" :type example: :class:`BMEdge`\n"
-" :return: The newly created edge.\n"
-" :rtype: :class:`BMEdge`\n"
-"\n"
-".. method:: new(verts, example=None)\n"
-"\n"
-" *Face Sequence*\n"
-"\n"
-" Create a new vert/edge/face.\n"
+PyDoc_STRVAR(bpy_bmvertseq_remove_doc,
+".. method:: remove(vert)\n"
"\n"
-" :arg verts: Sequence of 3 or more verts.\n"
-" :type verts: :class:`BMVert`\n"
-" :arg example: Existing face to initialize settings (optional argument).\n"
-" :type example: :class:`BMFace`\n"
-" :return: The newly created face.\n"
-" :rtype: :class:`BMFace`\n"
+" Remove a vert.\n"
);
-static PyObject *bpy_bmelemseq_new(BPy_BMElemSeq *self, PyObject *args)
-{
- switch ((BMIterType)self->itype) {
- case BM_VERTS_OF_MESH:
- return bpy_bmvertseq_new(self, args);
- case BM_EDGES_OF_MESH:
- return bpy_bmedgeseq_new(self, args);
- case BM_FACES_OF_MESH:
- return bpy_bmfaceseq_new(self, args);
- default:
- PyErr_SetString(PyExc_TypeError,
- ".new(...): function is not valid for this sequence");
- return NULL;
- }
-}
-
static PyObject *bpy_bmvertseq_remove(BPy_BMElemSeq *self, BPy_BMVert *value)
{
BPY_BM_CHECK_OBJ(self);
@@ -1452,7 +1789,7 @@ static PyObject *bpy_bmvertseq_remove(BPy_BMElemSeq *self, BPy_BMVert *value)
if (value->bm != bm) {
PyErr_SetString(PyExc_ValueError,
- "faces.remove(vert): vertex is from another mesh");
+ "verts.remove(vert): vert is from another mesh");
return NULL;
}
@@ -1463,6 +1800,11 @@ static PyObject *bpy_bmvertseq_remove(BPy_BMElemSeq *self, BPy_BMVert *value)
}
}
+PyDoc_STRVAR(bpy_bmedgeseq_remove_doc,
+".. method:: remove(edge)\n"
+"\n"
+" Remove a edge.\n"
+);
static PyObject *bpy_bmedgeseq_remove(BPy_BMElemSeq *self, BPy_BMEdge *value)
{
BPY_BM_CHECK_OBJ(self);
@@ -1477,7 +1819,7 @@ static PyObject *bpy_bmedgeseq_remove(BPy_BMElemSeq *self, BPy_BMEdge *value)
if (value->bm != bm) {
PyErr_SetString(PyExc_ValueError,
- "faces.remove(vert): vertex is from another mesh");
+ "edges.remove(edge): edge is from another mesh");
return NULL;
}
@@ -1488,6 +1830,11 @@ static PyObject *bpy_bmedgeseq_remove(BPy_BMElemSeq *self, BPy_BMEdge *value)
}
}
+PyDoc_STRVAR(bpy_bmfaceseq_remove_doc,
+".. method:: remove(face)\n"
+"\n"
+" Remove a face.\n"
+);
static PyObject *bpy_bmfaceseq_remove(BPy_BMElemSeq *self, BPy_BMFace *value)
{
BPY_BM_CHECK_OBJ(self);
@@ -1502,7 +1849,7 @@ static PyObject *bpy_bmfaceseq_remove(BPy_BMElemSeq *self, BPy_BMFace *value)
if (value->bm != bm) {
PyErr_SetString(PyExc_ValueError,
- "faces.remove(vert): vertex is from another mesh");
+ "faces.remove(face): face is from another mesh");
return NULL;
}
@@ -1513,30 +1860,18 @@ static PyObject *bpy_bmfaceseq_remove(BPy_BMElemSeq *self, BPy_BMFace *value)
}
}
-
-PyDoc_STRVAR(bpy_bmelemseq_remove_doc,
-".. method:: remove(elem)\n"
+PyDoc_STRVAR(bpy_bmedgeseq_get__method_doc,
+".. method:: get(verts, fallback=None)\n"
+"\n"
+" Return a edge which uses the **verts** passed.\n"
"\n"
-" Remove a vert/edge/face.\n"
+" :arg verts: Sequence of verts.\n"
+" :type verts: :class:`BMVert`\n"
+" :arg fallback: Return this value if nothing is found.\n"
+" :return: The edge found or None\n"
+" :rtype: :class:`BMEdge`\n"
);
-static PyObject *bpy_bmelemseq_remove(BPy_BMElemSeq *self, PyObject *value)
-{
- switch ((BMIterType)self->itype) {
- case BM_VERTS_OF_MESH:
- return bpy_bmvertseq_remove(self, (BPy_BMVert *)value);
- case BM_EDGES_OF_MESH:
- return bpy_bmedgeseq_remove(self, (BPy_BMEdge *)value);
- case BM_FACES_OF_MESH:
- return bpy_bmfaceseq_remove(self, (BPy_BMFace *)value);
- default:
- PyErr_SetString(PyExc_TypeError,
- ".remove(item): function is not valid for this sequence");
- return NULL;
- }
-}
-
-
-static PyObject *bpy_bmedgeseq_get(BPy_BMElemSeq *self, PyObject *args)
+static PyObject *bpy_bmedgeseq_get__method(BPy_BMElemSeq *self, PyObject *args)
{
PyObject *vert_seq;
PyObject *fallback = Py_None; /* optional */
@@ -1557,14 +1892,14 @@ static PyObject *bpy_bmedgeseq_get(BPy_BMElemSeq *self, PyObject *args)
PyObject *ret = NULL;
vert_array = BPy_BMElem_PySeq_As_Array(&bm, vert_seq, 2, 2,
- &vert_seq_len, &BPy_BMVert_Type,
+ &vert_seq_len, BM_VERT,
TRUE, TRUE, "edges.get(...)");
if (vert_array == NULL) {
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 {
@@ -1577,8 +1912,18 @@ static PyObject *bpy_bmedgeseq_get(BPy_BMElemSeq *self, PyObject *args)
}
}
-
-static PyObject *bpy_bmfaceseq_get(BPy_BMElemSeq *self, PyObject *args)
+PyDoc_STRVAR(bpy_bmfaceseq_get__method_doc,
+".. method:: get(verts, fallback=None)\n"
+"\n"
+" Return a face which uses the **verts** passed.\n"
+"\n"
+" :arg verts: Sequence of verts.\n"
+" :type verts: :class:`BMVert`\n"
+" :arg fallback: Return this value if nothing is found.\n"
+" :return: The face found or None\n"
+" :rtype: :class:`BMFace`\n"
+);
+static PyObject *bpy_bmfaceseq_get__method(BPy_BMElemSeq *self, PyObject *args)
{
PyObject *vert_seq;
PyObject *fallback = Py_None; /* optional */
@@ -1599,7 +1944,7 @@ static PyObject *bpy_bmfaceseq_get(BPy_BMElemSeq *self, PyObject *args)
PyObject *ret = NULL;
vert_array = BPy_BMElem_PySeq_As_Array(&bm, vert_seq, 1, PY_SSIZE_T_MAX,
- &vert_seq_len, &BPy_BMVert_Type,
+ &vert_seq_len, BM_VERT,
TRUE, TRUE, "faces.get(...)");
if (vert_array == NULL) {
@@ -1619,31 +1964,6 @@ static PyObject *bpy_bmfaceseq_get(BPy_BMElemSeq *self, PyObject *args)
}
}
-
-PyDoc_STRVAR(bpy_bmelemseq_get__method_doc,
-".. method:: get(verts, fallback=None)\n"
-"\n"
-" Return a face/edge which uses the **verts** passed.\n"
-"\n"
-" :arg verts: Sequence of verts.\n"
-" :type verts: :class:`BMVert`\n"
-" :arg fallback: Return this value if nothing is found.\n"
-);
-static PyObject *bpy_bmelemseq_get__method(BPy_BMElemSeq *self, PyObject *args)
-{
- switch ((BMIterType)self->itype) {
- case BM_EDGES_OF_MESH:
- return bpy_bmedgeseq_get(self, args);
- case BM_FACES_OF_MESH:
- return bpy_bmfaceseq_get(self, args);
- default:
- PyErr_SetString(PyExc_TypeError,
- ".get(item): function is not valid for this sequence");
- return NULL;
- }
-}
-
-
PyDoc_STRVAR(bpy_bmelemseq_index_update_doc,
".. method:: index_update()\n"
"\n"
@@ -1690,7 +2010,7 @@ static PyObject *bpy_bmelemseq_index_update(BPy_BMElemSeq *self)
}
if (htype & (BM_VERT | BM_EDGE | BM_FACE)) {
- /* since this isnt the normal vert/edge/face loops,
+ /* since this isn't the normal vert/edge/face loops,
* we're setting dirty values here. so tag as dirty. */
bm->elem_index_dirty |= htype;
}
@@ -1704,6 +2024,17 @@ static PyObject *bpy_bmelemseq_index_update(BPy_BMElemSeq *self)
static struct PyMethodDef bpy_bmesh_methods[] = {
+ /* utility */
+ {"copy", (PyCFunction)bpy_bmesh_copy, METH_NOARGS, bpy_bmesh_copy_doc},
+ {"clear", (PyCFunction)bpy_bmesh_clear, METH_NOARGS, bpy_bmesh_clear_doc},
+ {"free", (PyCFunction)bpy_bmesh_free, METH_NOARGS, bpy_bmesh_free_doc},
+
+ /* conversion */
+ {"from_object", (PyCFunction)bpy_bmesh_from_object, METH_VARARGS | METH_KEYWORDS, bpy_bmesh_from_object_doc},
+ {"from_mesh", (PyCFunction)bpy_bmesh_from_mesh, METH_VARARGS | METH_KEYWORDS, bpy_bmesh_from_mesh_doc},
+ {"to_mesh", (PyCFunction)bpy_bmesh_to_mesh, METH_VARARGS, bpy_bmesh_to_mesh_doc},
+
+ /* meshdata */
{"select_flush_mode", (PyCFunction)bpy_bmesh_select_flush_mode, METH_NOARGS, bpy_bmesh_select_flush_mode_doc},
{"select_flush", (PyCFunction)bpy_bmesh_select_flush, METH_O, bpy_bmesh_select_flush_doc},
{"normal_update", (PyCFunction)bpy_bmesh_normal_update, METH_VARARGS, bpy_bmesh_normal_update_doc},
@@ -1732,6 +2063,7 @@ static struct PyMethodDef bpy_bmedge_methods[] = {
{"other_vert", (PyCFunction)bpy_bmedge_other_vert, METH_O, bpy_bmedge_other_vert_doc},
+ {"calc_length", (PyCFunction)bpy_bmedge_calc_length, METH_NOARGS, bpy_bmedge_calc_length_doc},
{"calc_face_angle", (PyCFunction)bpy_bmedge_calc_face_angle, METH_NOARGS, bpy_bmedge_calc_face_angle_doc},
{"normal_update", (PyCFunction)bpy_bmedge_normal_update, METH_NOARGS, bpy_bmedge_normal_update_doc},
@@ -1761,24 +2093,61 @@ static struct PyMethodDef bpy_bmloop_methods[] = {
{"copy_from", (PyCFunction)bpy_bm_elem_copy_from, METH_O, bpy_bm_elem_copy_from_doc},
{"copy_from_face_interp", (PyCFunction)bpy_bmloop_copy_from_face_interp, METH_O, bpy_bmloop_copy_from_face_interp_doc},
- {"calc_angle", (PyCFunction)bpy_bmloop_calc_face_angle, METH_NOARGS, bpy_bmloop_calc_face_angle_doc},
+ {"calc_angle", (PyCFunction)bpy_bmloop_calc_angle, METH_NOARGS, bpy_bmloop_calc_angle_doc},
+ {"calc_normal", (PyCFunction)bpy_bmloop_calc_normal, METH_NOARGS, bpy_bmloop_calc_normal_doc},
+ {"calc_tangent", (PyCFunction)bpy_bmloop_calc_tangent, METH_NOARGS, bpy_bmloop_calc_tangent_doc},
{NULL, NULL, 0, NULL}
};
static struct PyMethodDef bpy_bmelemseq_methods[] = {
- {"new", (PyCFunction)bpy_bmelemseq_new, METH_VARARGS, bpy_bmelemseq_new_doc},
- {"remove", (PyCFunction)bpy_bmelemseq_remove, METH_O, bpy_bmelemseq_remove_doc},
+ /* odd function, initializes index values */
+ {"index_update", (PyCFunction)bpy_bmelemseq_index_update, METH_NOARGS, bpy_bmelemseq_index_update_doc},
+ {NULL, NULL, 0, NULL}
+};
+
+static struct PyMethodDef bpy_bmvertseq_methods[] = {
+ {"new", (PyCFunction)bpy_bmvertseq_new, METH_VARARGS, bpy_bmvertseq_new_doc},
+ {"remove", (PyCFunction)bpy_bmvertseq_remove, METH_O, bpy_bmvertseq_remove_doc},
+
+ /* odd function, initializes index values */
+ {"index_update", (PyCFunction)bpy_bmelemseq_index_update, METH_NOARGS, bpy_bmelemseq_index_update_doc},
+ {NULL, NULL, 0, NULL}
+};
+
+static struct PyMethodDef bpy_bmedgeseq_methods[] = {
+ {"new", (PyCFunction)bpy_bmedgeseq_new, METH_VARARGS, bpy_bmedgeseq_new_doc},
+ {"remove", (PyCFunction)bpy_bmedgeseq_remove, METH_O, bpy_bmedgeseq_remove_doc},
+ /* 'bpy_bmelemseq_get' for different purpose */
+ {"get", (PyCFunction)bpy_bmedgeseq_get__method, METH_VARARGS, bpy_bmedgeseq_get__method_doc},
+
+ /* odd function, initializes index values */
+ {"index_update", (PyCFunction)bpy_bmelemseq_index_update, METH_NOARGS, bpy_bmelemseq_index_update_doc},
+ {NULL, NULL, 0, NULL}
+};
+
+static struct PyMethodDef bpy_bmfaceseq_methods[] = {
+ {"new", (PyCFunction)bpy_bmfaceseq_new, METH_VARARGS, bpy_bmfaceseq_new_doc},
+ {"remove", (PyCFunction)bpy_bmfaceseq_remove, METH_O, bpy_bmfaceseq_remove_doc},
/* 'bpy_bmelemseq_get' for different purpose */
- {"get", (PyCFunction)bpy_bmelemseq_get__method, METH_VARARGS, bpy_bmelemseq_get__method_doc},
+ {"get", (PyCFunction)bpy_bmfaceseq_get__method, METH_VARARGS, bpy_bmfaceseq_get__method_doc},
/* odd function, initializes index values */
{"index_update", (PyCFunction)bpy_bmelemseq_index_update, METH_NOARGS, bpy_bmelemseq_index_update_doc},
{NULL, NULL, 0, NULL}
};
+static struct PyMethodDef bpy_bmloopseq_methods[] = {
+ /* odd function, initializes index values */
+ {"index_update", (PyCFunction)bpy_bmelemseq_index_update, METH_NOARGS, bpy_bmelemseq_index_update_doc},
+ {NULL, NULL, 0, NULL}
+};
+
/* Sequences
* ========= */
+/* BMElemSeq / Iter
+ * ---------------- */
+
static PyTypeObject *bpy_bm_itype_as_pytype(const char itype)
{
/* should cover all types */
@@ -1916,7 +2285,7 @@ static PyObject *bpy_bmelemseq_subscript_slice(BPy_BMElemSeq *self, Py_ssize_t s
static PyObject *bpy_bmelemseq_subscript(BPy_BMElemSeq *self, PyObject *key)
{
- /* dont need error check here */
+ /* don't need error check here */
if (PyIndex_Check(key)) {
Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError);
if (i == -1 && PyErr_Occurred())
@@ -1987,6 +2356,23 @@ static int bpy_bmelemseq_contains(BPy_BMElemSeq *self, PyObject *value)
return 0;
}
+/* BMElem (customdata)
+ * ------------------- */
+
+static PyObject *bpy_bmelem_subscript(BPy_BMElem *self, BPy_BMLayerItem *key)
+{
+ BPY_BM_CHECK_OBJ(self);
+
+ return BPy_BMLayerItem_GetItem(self, key);
+}
+
+static int bpy_bmelem_ass_subscript(BPy_BMElem *self, BPy_BMLayerItem *key, PyObject *value)
+{
+ BPY_BM_CHECK_INT(self);
+
+ return BPy_BMLayerItem_SetItem(self, key, value);
+}
+
static PySequenceMethods bpy_bmelemseq_as_sequence = {
(lenfunc)bpy_bmelemseq_length, /* sq_length */
NULL, /* sq_concat */
@@ -2006,6 +2392,13 @@ static PyMappingMethods bpy_bmelemseq_as_mapping = {
(objobjargproc)NULL, /* mp_ass_subscript */
};
+/* for customdata access */
+static PyMappingMethods bpy_bm_elem_as_mapping = {
+ (lenfunc)NULL, /* mp_length */ /* keep this empty, messes up 'if elem: ...' test */
+ (binaryfunc)bpy_bmelem_subscript, /* mp_subscript */
+ (objobjargproc)bpy_bmelem_ass_subscript, /* mp_ass_subscript */
+};
+
/* Iterator
* -------- */
@@ -2040,12 +2433,19 @@ static void bpy_bmesh_dealloc(BPy_BMesh *self)
{
BMesh *bm = self->bm;
- BM_data_layer_free(bm, &bm->vdata, CD_BM_ELEM_PYPTR);
- BM_data_layer_free(bm, &bm->edata, CD_BM_ELEM_PYPTR);
- BM_data_layer_free(bm, &bm->pdata, CD_BM_ELEM_PYPTR);
- BM_data_layer_free(bm, &bm->ldata, CD_BM_ELEM_PYPTR);
+ /* have have been freed by bmesh */
+ if (bm) {
+ BM_data_layer_free(bm, &bm->vdata, CD_BM_ELEM_PYPTR);
+ BM_data_layer_free(bm, &bm->edata, CD_BM_ELEM_PYPTR);
+ BM_data_layer_free(bm, &bm->pdata, CD_BM_ELEM_PYPTR);
+ BM_data_layer_free(bm, &bm->ldata, CD_BM_ELEM_PYPTR);
+
+ bm->py_handle = NULL;
- bm->py_handle = NULL;
+ if ((self->flag & BPY_BMFLAG_IS_WRAPPED) == 0) {
+ BM_mesh_free(bm);
+ }
+ }
PyObject_DEL(self);
}
@@ -2156,8 +2556,9 @@ static PyObject *bpy_bmvert_repr(BPy_BMVert *self)
BMesh *bm = self->bm;
if (bm) {
+ BMVert *v = self->v;
return PyUnicode_FromFormat("<BMVert(%p), index=%d>",
- self->v, BM_elem_index_get(self->v));
+ v, BM_elem_index_get(v));
}
else {
return PyUnicode_FromFormat("<BMVert dead at %p>", self);
@@ -2169,10 +2570,11 @@ static PyObject *bpy_bmedge_repr(BPy_BMEdge *self)
BMesh *bm = self->bm;
if (bm) {
+ BMEdge *e = self->e;
return PyUnicode_FromFormat("<BMEdge(%p), index=%d, verts=(%p/%d, %p/%d)>",
- self->e, BM_elem_index_get(self->e),
- self->e->v1, BM_elem_index_get(self->e->v1),
- self->e->v2, BM_elem_index_get(self->e->v2));
+ e, BM_elem_index_get(e),
+ e->v1, BM_elem_index_get(e->v1),
+ e->v2, BM_elem_index_get(e->v2));
}
else {
return PyUnicode_FromFormat("<BMEdge dead at %p>", self);
@@ -2184,9 +2586,10 @@ static PyObject *bpy_bmface_repr(BPy_BMFace *self)
BMesh *bm = self->bm;
if (bm) {
+ BMFace *f = self->f;
return PyUnicode_FromFormat("<BMFace(%p), index=%d, totverts=%d>",
- self->f, BM_elem_index_get(self->f),
- self->f->len);
+ f, BM_elem_index_get(f),
+ f->len);
}
else {
return PyUnicode_FromFormat("<BMFace dead at %p>", self);
@@ -2198,11 +2601,12 @@ static PyObject *bpy_bmloop_repr(BPy_BMLoop *self)
BMesh *bm = self->bm;
if (bm) {
+ BMLoop *l = self->l;
return PyUnicode_FromFormat("<BMLoop(%p), index=%d, vert=%p/%d, edge=%p/%d, face=%p/%d>",
- self->l, BM_elem_index_get(self->l),
- self->l->v, BM_elem_index_get(self->l->v),
- self->l->e, BM_elem_index_get(self->l->e),
- self->l->f, BM_elem_index_get(self->l->f));
+ l, BM_elem_index_get(l),
+ l->v, BM_elem_index_get(l->v),
+ l->e, BM_elem_index_get(l->e),
+ l->f, BM_elem_index_get(l->f));
}
else {
return PyUnicode_FromFormat("<BMLoop dead at %p>", self);
@@ -2218,6 +2622,10 @@ PyTypeObject BPy_BMEdge_Type = {{{0}}};
PyTypeObject BPy_BMFace_Type = {{{0}}};
PyTypeObject BPy_BMLoop_Type = {{{0}}};
PyTypeObject BPy_BMElemSeq_Type = {{{0}}};
+PyTypeObject BPy_BMVertSeq_Type = {{{0}}};
+PyTypeObject BPy_BMEdgeSeq_Type = {{{0}}};
+PyTypeObject BPy_BMFaceSeq_Type = {{{0}}};
+PyTypeObject BPy_BMLoopSeq_Type = {{{0}}};
PyTypeObject BPy_BMIter_Type = {{{0}}};
@@ -2230,6 +2638,10 @@ void BPy_BM_init_types(void)
BPy_BMFace_Type.tp_basicsize = sizeof(BPy_BMFace);
BPy_BMLoop_Type.tp_basicsize = sizeof(BPy_BMLoop);
BPy_BMElemSeq_Type.tp_basicsize = sizeof(BPy_BMElemSeq);
+ BPy_BMVertSeq_Type.tp_basicsize = sizeof(BPy_BMElemSeq);
+ BPy_BMEdgeSeq_Type.tp_basicsize = sizeof(BPy_BMElemSeq);
+ BPy_BMFaceSeq_Type.tp_basicsize = sizeof(BPy_BMElemSeq);
+ BPy_BMLoopSeq_Type.tp_basicsize = sizeof(BPy_BMElemSeq);
BPy_BMIter_Type.tp_basicsize = sizeof(BPy_BMIter);
@@ -2239,6 +2651,10 @@ void BPy_BM_init_types(void)
BPy_BMFace_Type.tp_name = "BMFace";
BPy_BMLoop_Type.tp_name = "BMLoop";
BPy_BMElemSeq_Type.tp_name = "BMElemSeq";
+ BPy_BMVertSeq_Type.tp_name = "BMVertSeq";
+ BPy_BMEdgeSeq_Type.tp_name = "BMEdgeSeq";
+ BPy_BMFaceSeq_Type.tp_name = "BMFaceSeq";
+ BPy_BMLoopSeq_Type.tp_name = "BMLoopSeq";
BPy_BMIter_Type.tp_name = "BMIter";
@@ -2248,6 +2664,10 @@ void BPy_BM_init_types(void)
BPy_BMFace_Type.tp_doc = bpy_bmface_doc;
BPy_BMLoop_Type.tp_doc = bpy_bmloop_doc;
BPy_BMElemSeq_Type.tp_doc = bpy_bmelemseq_doc;
+ BPy_BMVertSeq_Type.tp_doc = NULL;
+ BPy_BMEdgeSeq_Type.tp_doc = NULL;
+ BPy_BMFaceSeq_Type.tp_doc = NULL;
+ BPy_BMLoopSeq_Type.tp_doc = NULL;
BPy_BMIter_Type.tp_doc = bpy_bmiter_doc;
@@ -2257,6 +2677,10 @@ void BPy_BM_init_types(void)
BPy_BMFace_Type.tp_repr = (reprfunc)bpy_bmface_repr;
BPy_BMLoop_Type.tp_repr = (reprfunc)bpy_bmloop_repr;
BPy_BMElemSeq_Type.tp_repr = NULL;
+ BPy_BMVertSeq_Type.tp_repr = NULL;
+ BPy_BMEdgeSeq_Type.tp_repr = NULL;
+ BPy_BMFaceSeq_Type.tp_repr = NULL;
+ BPy_BMLoopSeq_Type.tp_repr = NULL;
BPy_BMIter_Type.tp_repr = NULL;
@@ -2266,6 +2690,10 @@ void BPy_BM_init_types(void)
BPy_BMFace_Type.tp_getset = bpy_bmface_getseters;
BPy_BMLoop_Type.tp_getset = bpy_bmloop_getseters;
BPy_BMElemSeq_Type.tp_getset = NULL;
+ BPy_BMVertSeq_Type.tp_getset = bpy_bmvertseq_getseters;
+ BPy_BMEdgeSeq_Type.tp_getset = bpy_bmedgeseq_getseters;
+ BPy_BMFaceSeq_Type.tp_getset = bpy_bmfaceseq_getseters;
+ BPy_BMLoopSeq_Type.tp_getset = bpy_bmloopseq_getseters;
BPy_BMIter_Type.tp_getset = NULL;
@@ -2275,6 +2703,10 @@ void BPy_BM_init_types(void)
BPy_BMFace_Type.tp_methods = bpy_bmface_methods;
BPy_BMLoop_Type.tp_methods = bpy_bmloop_methods;
BPy_BMElemSeq_Type.tp_methods = bpy_bmelemseq_methods;
+ BPy_BMVertSeq_Type.tp_methods = bpy_bmvertseq_methods;
+ BPy_BMEdgeSeq_Type.tp_methods = bpy_bmedgeseq_methods;
+ BPy_BMFaceSeq_Type.tp_methods = bpy_bmfaceseq_methods;
+ BPy_BMLoopSeq_Type.tp_methods = bpy_bmloopseq_methods;
BPy_BMIter_Type.tp_methods = NULL;
@@ -2284,16 +2716,39 @@ void BPy_BM_init_types(void)
BPy_BMFace_Type.tp_hash = bpy_bm_elem_hash;
BPy_BMLoop_Type.tp_hash = bpy_bm_elem_hash;
BPy_BMElemSeq_Type.tp_hash = NULL;
+ BPy_BMVertSeq_Type.tp_hash = NULL;
+ BPy_BMEdgeSeq_Type.tp_hash = NULL;
+ BPy_BMFaceSeq_Type.tp_hash = NULL;
+ BPy_BMLoopSeq_Type.tp_hash = NULL;
BPy_BMIter_Type.tp_hash = NULL;
BPy_BMElemSeq_Type.tp_as_sequence = &bpy_bmelemseq_as_sequence;
+ BPy_BMVertSeq_Type.tp_as_sequence = &bpy_bmelemseq_as_sequence;
+ BPy_BMEdgeSeq_Type.tp_as_sequence = &bpy_bmelemseq_as_sequence;
+ BPy_BMFaceSeq_Type.tp_as_sequence = &bpy_bmelemseq_as_sequence;
+ BPy_BMLoopSeq_Type.tp_as_sequence = NULL; /* this is not a seq really, only for layer access */
BPy_BMElemSeq_Type.tp_as_mapping = &bpy_bmelemseq_as_mapping;
+ BPy_BMVertSeq_Type.tp_as_mapping = &bpy_bmelemseq_as_mapping;
+ BPy_BMEdgeSeq_Type.tp_as_mapping = &bpy_bmelemseq_as_mapping;
+ BPy_BMFaceSeq_Type.tp_as_mapping = &bpy_bmelemseq_as_mapping;
+ BPy_BMLoopSeq_Type.tp_as_mapping = NULL; /* this is not a seq really, only for layer access */
+
+ /* layer access */
+ BPy_BMVert_Type.tp_as_mapping = &bpy_bm_elem_as_mapping;
+ BPy_BMEdge_Type.tp_as_mapping = &bpy_bm_elem_as_mapping;
+ BPy_BMFace_Type.tp_as_mapping = &bpy_bm_elem_as_mapping;
+ BPy_BMLoop_Type.tp_as_mapping = &bpy_bm_elem_as_mapping;
BPy_BMElemSeq_Type.tp_iter = (getiterfunc)bpy_bmelemseq_iter;
+ BPy_BMVertSeq_Type.tp_iter = (getiterfunc)bpy_bmelemseq_iter;
+ BPy_BMEdgeSeq_Type.tp_iter = (getiterfunc)bpy_bmelemseq_iter;
+ BPy_BMFaceSeq_Type.tp_iter = (getiterfunc)bpy_bmelemseq_iter;
+ BPy_BMLoopSeq_Type.tp_iter = NULL; /* no mapping */
/* 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;
@@ -2301,24 +2756,22 @@ void BPy_BM_init_types(void)
BPy_BMFace_Type.tp_dealloc = (destructor)bpy_bmface_dealloc;
BPy_BMLoop_Type.tp_dealloc = (destructor)bpy_bmloop_dealloc;
BPy_BMElemSeq_Type.tp_dealloc = (destructor)bpy_bmelemseq_dealloc;
+ BPy_BMVertSeq_Type.tp_dealloc = (destructor)bpy_bmelemseq_dealloc;
+ BPy_BMEdgeSeq_Type.tp_dealloc = (destructor)bpy_bmelemseq_dealloc;
+ BPy_BMFaceSeq_Type.tp_dealloc = (destructor)bpy_bmelemseq_dealloc;
+ BPy_BMLoopSeq_Type.tp_dealloc = (destructor)bpy_bmelemseq_dealloc;
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.tp_flags = Py_TPFLAGS_DEFAULT;
BPy_BMVert_Type.tp_flags = Py_TPFLAGS_DEFAULT;
BPy_BMEdge_Type.tp_flags = Py_TPFLAGS_DEFAULT;
BPy_BMFace_Type.tp_flags = Py_TPFLAGS_DEFAULT;
BPy_BMLoop_Type.tp_flags = Py_TPFLAGS_DEFAULT;
BPy_BMElemSeq_Type.tp_flags = Py_TPFLAGS_DEFAULT;
+ BPy_BMVertSeq_Type.tp_flags = Py_TPFLAGS_DEFAULT;
+ BPy_BMEdgeSeq_Type.tp_flags = Py_TPFLAGS_DEFAULT;
+ BPy_BMFaceSeq_Type.tp_flags = Py_TPFLAGS_DEFAULT;
+ BPy_BMLoopSeq_Type.tp_flags = Py_TPFLAGS_DEFAULT;
BPy_BMIter_Type.tp_flags = Py_TPFLAGS_DEFAULT;
@@ -2328,6 +2781,10 @@ void BPy_BM_init_types(void)
PyType_Ready(&BPy_BMFace_Type);
PyType_Ready(&BPy_BMLoop_Type);
PyType_Ready(&BPy_BMElemSeq_Type);
+ PyType_Ready(&BPy_BMVertSeq_Type);
+ PyType_Ready(&BPy_BMEdgeSeq_Type);
+ PyType_Ready(&BPy_BMFaceSeq_Type);
+ PyType_Ready(&BPy_BMLoopSeq_Type);
PyType_Ready(&BPy_BMIter_Type);
}
@@ -2352,20 +2809,36 @@ PyObject *BPyInit_bmesh_types(void)
submodule = PyModule_Create(&BPy_BM_types_module_def);
-#define mod_type_add(s, t) \
+#define MODULE_TYPE_ADD(s, t) \
PyModule_AddObject(s, t.tp_name, (PyObject *)&t); Py_INCREF((PyObject *)&t)
- mod_type_add(submodule, BPy_BMesh_Type);
- mod_type_add(submodule, BPy_BMVert_Type);
- mod_type_add(submodule, BPy_BMEdge_Type);
- mod_type_add(submodule, BPy_BMFace_Type);
- mod_type_add(submodule, BPy_BMLoop_Type);
- mod_type_add(submodule, BPy_BMElemSeq_Type);
- mod_type_add(submodule, BPy_BMIter_Type);
- mod_type_add(submodule, BPy_BMEditSelSeq_Type);
- mod_type_add(submodule, BPy_BMEditSelIter_Type);
-
-#undef mod_type_add
+ /* bmesh_py_types.c */
+ MODULE_TYPE_ADD(submodule, BPy_BMesh_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMVert_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMEdge_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMFace_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMLoop_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMElemSeq_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMVertSeq_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMEdgeSeq_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMFaceSeq_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMLoopSeq_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMIter_Type);
+ /* bmesh_py_types_select.c */
+ MODULE_TYPE_ADD(submodule, BPy_BMEditSelSeq_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMEditSelIter_Type);
+ /* bmesh_py_types_customdata.c */
+ MODULE_TYPE_ADD(submodule, BPy_BMLayerAccessVert_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMLayerAccessEdge_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMLayerAccessFace_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMLayerAccessLoop_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMLayerCollection_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMLayerItem_Type);
+ /* bmesh_py_types_meshdata.c */
+ MODULE_TYPE_ADD(submodule, BPy_BMLoopUV_Type);
+ MODULE_TYPE_ADD(submodule, BPy_BMDeformVert_Type);
+
+#undef MODULE_TYPE_ADD
return submodule;
}
@@ -2373,7 +2846,7 @@ PyObject *BPyInit_bmesh_types(void)
/* Utility Functions
* ***************** */
-PyObject *BPy_BMesh_CreatePyObject(BMesh *bm)
+PyObject *BPy_BMesh_CreatePyObject(BMesh *bm, int flag)
{
BPy_BMesh *self;
@@ -2384,6 +2857,9 @@ PyObject *BPy_BMesh_CreatePyObject(BMesh *bm)
else {
self = PyObject_New(BPy_BMesh, &BPy_BMesh_Type);
self->bm = bm;
+ self->flag = flag;
+
+ bm->py_handle = self; /* point back */
BM_data_layer_add(bm, &bm->vdata, CD_BM_ELEM_PYPTR);
BM_data_layer_add(bm, &bm->edata, CD_BM_ELEM_PYPTR);
@@ -2510,6 +2986,42 @@ PyObject *BPy_BMElemSeq_CreatePyObject(BMesh *bm, BPy_BMElem *py_ele, const char
return (PyObject *)self;
}
+PyObject *BPy_BMVertSeq_CreatePyObject(BMesh *bm)
+{
+ BPy_BMElemSeq *self = PyObject_New(BPy_BMElemSeq, &BPy_BMVertSeq_Type);
+ self->bm = bm;
+ self->py_ele = NULL; /* unused */
+ self->itype = BM_VERTS_OF_MESH;
+ return (PyObject *)self;
+}
+
+PyObject *BPy_BMEdgeSeq_CreatePyObject(BMesh *bm)
+{
+ BPy_BMElemSeq *self = PyObject_New(BPy_BMElemSeq, &BPy_BMEdgeSeq_Type);
+ self->bm = bm;
+ self->py_ele = NULL; /* unused */
+ self->itype = BM_EDGES_OF_MESH;
+ return (PyObject *)self;
+}
+
+PyObject *BPy_BMFaceSeq_CreatePyObject(BMesh *bm)
+{
+ BPy_BMElemSeq *self = PyObject_New(BPy_BMElemSeq, &BPy_BMFaceSeq_Type);
+ self->bm = bm;
+ self->py_ele = NULL; /* unused */
+ self->itype = BM_FACES_OF_MESH;
+ return (PyObject *)self;
+}
+
+PyObject *BPy_BMLoopSeq_CreatePyObject(BMesh *bm)
+{
+ BPy_BMElemSeq *self = PyObject_New(BPy_BMElemSeq, &BPy_BMLoopSeq_Type);
+ self->bm = bm;
+ self->py_ele = NULL; /* unused */
+ self->itype = 0; /* should never be passed to the iterator function */
+ return (PyObject *)self;
+}
+
PyObject *BPy_BMIter_CreatePyObject(BMesh *bm)
{
BPy_BMIter *self = PyObject_New(BPy_BMIter, &BPy_BMIter_Type);
@@ -2543,8 +3055,8 @@ int bpy_bm_generic_valid_check(BPy_BMGeneric *self)
}
else {
PyErr_Format(PyExc_ReferenceError,
- "BMesh data of type %.200s has been removed",
- Py_TYPE(self)->tp_name);
+ "BMesh data of type %.200s has been removed",
+ Py_TYPE(self)->tp_name);
return -1;
}
}
@@ -2560,7 +3072,7 @@ void bpy_bm_generic_invalidate(BPy_BMGeneric *self)
* The 'bm_r' value is assigned when empty, and used when set.
*/
void *BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_ssize_t max, Py_ssize_t *r_size,
- PyTypeObject *type,
+ const char htype,
const char do_unique_check, const char do_bm_check,
const char *error_prefix)
{
@@ -2568,7 +3080,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 {
@@ -2594,24 +3106,24 @@ void *BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_
for (i = 0; i < seq_len; i++) {
item = (BPy_BMElem *)PySequence_Fast_GET_ITEM(seq_fast, i);
- if (Py_TYPE(item) != type) {
+ if (!BPy_BMElem_CheckHType(Py_TYPE(item), htype)) {
PyErr_Format(PyExc_TypeError,
- "%s: expected '%.200', not '%.200s'",
- error_prefix, type->tp_name, Py_TYPE(item)->tp_name);
+ "%s: expected %.200s, not '%.200s'",
+ error_prefix, BPy_BMElem_StringFromHType(htype), Py_TYPE(item)->tp_name);
goto err_cleanup;
}
else if (!BPY_BM_IS_VALID(item)) {
PyErr_Format(PyExc_TypeError,
"%s: %d %s has been removed",
- error_prefix, i, type->tp_name);
+ error_prefix, i, Py_TYPE(item)->tp_name);
goto err_cleanup;
}
/* 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);
+ error_prefix, i, BPy_BMElem_StringFromHType(htype));
goto err_cleanup;
}
@@ -2634,14 +3146,14 @@ void *BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_
ok = FALSE;
}
- /* ensure we dont leave this enabled */
+ /* ensure we don't leave this enabled */
BM_elem_flag_disable(alloc[i], BM_ELEM_INTERNAL_TAG);
}
if (ok == FALSE) {
PyErr_Format(PyExc_ValueError,
- "%s: found the same %s used multiple times",
- error_prefix, type->tp_name);
+ "%s: found the same %.200s used multiple times",
+ error_prefix, BPy_BMElem_StringFromHType(htype));
goto err_cleanup;
}
}
@@ -2657,3 +3169,47 @@ 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;
+}
+
+int BPy_BMElem_CheckHType(PyTypeObject *type, const char htype)
+{
+ return (((htype & BM_VERT) && (type == &BPy_BMVert_Type)) ||
+ ((htype & BM_EDGE) && (type == &BPy_BMEdge_Type)) ||
+ ((htype & BM_FACE) && (type == &BPy_BMFace_Type)) ||
+ ((htype & BM_LOOP) && (type == &BPy_BMLoop_Type)));
+}
+
+/**
+ * Use for error strings only, not thread safe,
+ *
+ * \return a sting like '(BMVert/BMEdge/BMFace/BMLoop)'
+ */
+char *BPy_BMElem_StringFromHType_ex(const char htype, char ret[32])
+{
+ /* zero to ensure string is always NULL terminated */
+ char *ret_ptr = ret;
+ if (htype & BM_VERT) ret_ptr += sprintf(ret_ptr, "/%s", BPy_BMVert_Type.tp_name);
+ if (htype & BM_EDGE) ret_ptr += sprintf(ret_ptr, "/%s", BPy_BMEdge_Type.tp_name);
+ if (htype & BM_FACE) ret_ptr += sprintf(ret_ptr, "/%s", BPy_BMFace_Type.tp_name);
+ if (htype & BM_LOOP) ret_ptr += sprintf(ret_ptr, "/%s", BPy_BMLoop_Type.tp_name);
+ ret[0] = '(';
+ *ret_ptr = ')';
+ return ret;
+}
+char *BPy_BMElem_StringFromHType(const char htype)
+{
+ /* zero to ensure string is always NULL terminated */
+ static char ret[32];
+ return BPy_BMElem_StringFromHType_ex(htype, ret);
+}
diff --git a/source/blender/python/bmesh/bmesh_py_types.h b/source/blender/python/bmesh/bmesh_py_types.h
index d7deb41c4e3..0a94b346485 100644
--- a/source/blender/python/bmesh/bmesh_py_types.h
+++ b/source/blender/python/bmesh/bmesh_py_types.h
@@ -35,7 +35,13 @@ extern PyTypeObject BPy_BMVert_Type;
extern PyTypeObject BPy_BMEdge_Type;
extern PyTypeObject BPy_BMFace_Type;
extern PyTypeObject BPy_BMLoop_Type;
+
extern PyTypeObject BPy_BMElemSeq_Type;
+extern PyTypeObject BPy_BMVertSeq_Type;
+extern PyTypeObject BPy_BMEdgeSeq_Type;
+extern PyTypeObject BPy_BMFaceSeq_Type;
+extern PyTypeObject BPy_BMLoopSeq_Type;
+
extern PyTypeObject BPy_BMIter_Type;
#define BPy_BMesh_Check(v) (Py_TYPE(v) == &BPy_BMesh_Type)
@@ -44,6 +50,10 @@ extern PyTypeObject BPy_BMIter_Type;
#define BPy_BMFace_Check(v) (Py_TYPE(v) == &BPy_BMFace_Type)
#define BPy_BMLoop_Check(v) (Py_TYPE(v) == &BPy_BMLoop_Type)
#define BPy_BMElemSeq_Check(v) (Py_TYPE(v) == &BPy_BMElemSeq_Type)
+#define BPy_BMVertSeq_Check(v) (Py_TYPE(v) == &BPy_BMVertSeq_Type)
+#define BPy_BMEdgeSeq_Check(v) (Py_TYPE(v) == &BPy_BMEdgeSeq_Type)
+#define BPy_BMFaceSeq_Check(v) (Py_TYPE(v) == &BPy_BMFaceSeq_Type)
+#define BPy_BMLoopSeq_Check(v) (Py_TYPE(v) == &BPy_BMLoopSeq_Type)
#define BPy_BMIter_Check(v) (Py_TYPE(v) == &BPy_BMIter_Type)
/* cast from _any_ bmesh type - they all have BMesh first */
@@ -62,6 +72,7 @@ typedef struct BPy_BMElem {
typedef struct BPy_BMesh {
PyObject_VAR_HEAD
struct BMesh *bm; /* keep first */
+ int flag;
} BPy_BMesh;
/* element types */
@@ -92,6 +103,13 @@ typedef struct BPy_BMLoop {
/* iterators */
+/* used for ...
+ * - BPy_BMElemSeq_Type
+ * - BPy_BMVertSeq_Type
+ * - BPy_BMEdgeSeq_Type
+ * - BPy_BMFaceSeq_Type
+ * - BPy_BMLoopSeq_Type
+ */
typedef struct BPy_BMElemSeq {
PyObject_VAR_HEAD
struct BMesh *bm; /* keep first */
@@ -101,7 +119,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;
@@ -119,12 +137,21 @@ void BPy_BM_init_types(void);
PyObject *BPyInit_bmesh_types(void);
-PyObject *BPy_BMesh_CreatePyObject(BMesh *bm);
+enum {
+ BPY_BMFLAG_NOP = 0, /* do nothing */
+ BPY_BMFLAG_IS_WRAPPED = 1 /* the mesh is owned by editmode */
+};
+
+PyObject *BPy_BMesh_CreatePyObject(BMesh *bm, int flag);
PyObject *BPy_BMVert_CreatePyObject(BMesh *bm, BMVert *v);
PyObject *BPy_BMEdge_CreatePyObject(BMesh *bm, BMEdge *e);
PyObject *BPy_BMFace_CreatePyObject(BMesh *bm, BMFace *f);
PyObject *BPy_BMLoop_CreatePyObject(BMesh *bm, BMLoop *l);
PyObject *BPy_BMElemSeq_CreatePyObject(BMesh *bm, BPy_BMElem *py_ele, const char itype);
+PyObject *BPy_BMVertSeq_CreatePyObject(BMesh *bm);
+PyObject *BPy_BMEdgeSeq_CreatePyObject(BMesh *bm);
+PyObject *BPy_BMFaceSeq_CreatePyObject(BMesh *bm);
+PyObject *BPy_BMLoopSeq_CreatePyObject(BMesh *bm);
PyObject *BPy_BMIter_CreatePyObject(BMesh *bm);
PyObject *BPy_BMElem_CreatePyObject(BMesh *bm, BMHeader *ele); /* just checks type and creates v/e/f/l */
@@ -133,10 +160,16 @@ int bpy_bm_generic_valid_check(BPy_BMGeneric *self);
void bpy_bm_generic_invalidate(BPy_BMGeneric *self);
void *BPy_BMElem_PySeq_As_Array(BMesh **r_bm, PyObject *seq, Py_ssize_t min, Py_ssize_t max, Py_ssize_t *r_size,
- PyTypeObject *type,
+ const char htype,
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);
+int BPy_BMElem_CheckHType(PyTypeObject *type, const char htype);
+char *BPy_BMElem_StringFromHType_ex(const char htype, char ret[32]);
+char *BPy_BMElem_StringFromHType(const char htype);
+
+
#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_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c
new file mode 100644
index 00000000000..5d9c07269e8
--- /dev/null
+++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c
@@ -0,0 +1,950 @@
+/*
+ * ***** 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) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/python/bmesh/bmesh_py_types_customdata.c
+ * \ingroup pybmesh
+ *
+ * This file defines the types for 'BMesh.verts/edges/faces/loops.layers'
+ * customdata layer access.
+ */
+
+#include <Python.h>
+
+#include "BLI_string.h"
+#include "BLI_math_vector.h"
+
+#include "bmesh.h"
+
+#include "bmesh_py_types.h"
+#include "bmesh_py_types_customdata.h"
+#include "bmesh_py_types_meshdata.h"
+
+#include "../mathutils/mathutils.h"
+
+#include "BKE_customdata.h"
+
+#include "DNA_meshdata_types.h"
+
+static CustomData *bpy_bm_customdata_get(BMesh *bm, char htype)
+{
+ switch (htype) {
+ case BM_VERT: return &bm->vdata;
+ case BM_EDGE: return &bm->edata;
+ case BM_FACE: return &bm->pdata;
+ case BM_LOOP: return &bm->ldata;
+ }
+
+ BLI_assert(0);
+ return NULL;
+}
+
+static CustomDataLayer *bpy_bmlayeritem_get(BPy_BMLayerItem *self)
+{
+ CustomData *data = bpy_bm_customdata_get(self->bm, self->htype);
+ return &data->layers[CustomData_get_layer_index_n(data, self->type, self->index)];
+}
+
+/* py-type definitions
+ * ******************* */
+
+/* getseters
+ * ========= */
+
+/* used for many different types */
+
+PyDoc_STRVAR(bpy_bmlayeraccess_collection__float_doc,
+"Generic float custom-data layer.\n\ntype: :class:`BMLayerCollection`"
+);
+PyDoc_STRVAR(bpy_bmlayeraccess_collection__int_doc,
+"Generic int custom-data layer.\n\ntype: :class:`BMLayerCollection`"
+);
+PyDoc_STRVAR(bpy_bmlayeraccess_collection__string_doc,
+"Generic string custom-data layer (exposed as bytes, 255 max length).\n\ntype: :class:`BMLayerCollection`"
+);
+PyDoc_STRVAR(bpy_bmlayeraccess_collection__deform_doc,
+"Vertex deform weight :class:`BMDeformVert` (TODO).\n\ntype: :class:`BMLayerCollection`" // TYPE DOESN'T EXIST YET
+);
+PyDoc_STRVAR(bpy_bmlayeraccess_collection__shape_doc,
+"Vertex shapekey absolute location (as a 3D Vector).\n\n:type: :class:`BMLayerCollection`"
+);
+PyDoc_STRVAR(bpy_bmlayeraccess_collection__bevel_weight_doc,
+"Bevel weight float in [0 - 1].\n\n:type: :class:`BMLayerCollection`"
+);
+PyDoc_STRVAR(bpy_bmlayeraccess_collection__crease_doc,
+"Edge crease for subsurf - float in [0 - 1].\n\n:type: :class:`BMLayerCollection`"
+);
+PyDoc_STRVAR(bpy_bmlayeraccess_collection__tex_doc,
+"Accessor for :class:`BMTexPoly` layer (TODO).\n\ntype: :class:`BMLayerCollection`" // TYPE DOESN'T EXIST YET
+);
+PyDoc_STRVAR(bpy_bmlayeraccess_collection__uv_doc,
+"Accessor for :class:`BMLoopUV` UV (as a 2D Vector).\n\ntype: :class:`BMLayerCollection`"
+);
+PyDoc_STRVAR(bpy_bmlayeraccess_collection__color_doc,
+"Accessor for vertex color layer.\n\ntype: :class:`BMLayerCollection`"
+);
+
+static PyObject *bpy_bmlayeraccess_collection_get(BPy_BMLayerAccess *self, void *flag)
+{
+ const int type = (int)GET_INT_FROM_POINTER(flag);
+
+ BPY_BM_CHECK_OBJ(self);
+
+ return BPy_BMLayerCollection_CreatePyObject(self->bm, self->htype, type);
+}
+
+
+PyDoc_STRVAR(bpy_bmlayercollection_active_doc,
+"This meshes vert sequence (read-only).\n\n:type: :class:`BMVertSeq`"
+);
+static PyObject *bpy_bmlayercollection_active_get(BPy_BMLayerItem *self, void *UNUSED(flag))
+{
+ CustomData *data;
+ int index;
+
+ BPY_BM_CHECK_OBJ(self);
+
+ data = bpy_bm_customdata_get(self->bm, self->htype);
+ index = CustomData_get_active_layer_index(data, self->type);
+
+ if (index != -1) {
+ return BPy_BMLayerItem_CreatePyObject(self->bm, self->htype, self->type, index);
+ }
+ else {
+ Py_RETURN_NONE;
+ }
+}
+
+PyDoc_STRVAR(bpy_bmlayercollection_name_doc,
+"The layers unique name (read-only).\n\n:type: string"
+);
+static PyObject *bpy_bmlayeritem_name_get(BPy_BMLayerItem *self, void *UNUSED(flag))
+{
+ CustomDataLayer *layer;
+
+ BPY_BM_CHECK_OBJ(self);
+
+ layer = bpy_bmlayeritem_get(self);
+ return PyUnicode_FromString(layer->name);
+}
+
+static PyGetSetDef bpy_bmlayeraccess_vert_getseters[] = {
+ {(char *)"deform", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__deform_doc, (void *)CD_MDEFORMVERT},
+
+ {(char *)"float", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__float_doc, (void *)CD_PROP_FLT},
+ {(char *)"int", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__int_doc, (void *)CD_PROP_INT},
+ {(char *)"string", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__string_doc, (void *)CD_PROP_STR},
+
+ {(char *)"shape", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__shape_doc, (void *)CD_SHAPEKEY},
+ {(char *)"bevel_weight", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__bevel_weight_doc, (void *)CD_BWEIGHT},
+
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+};
+
+static PyGetSetDef bpy_bmlayeraccess_edge_getseters[] = {
+ {(char *)"float", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__float_doc, (void *)CD_PROP_FLT},
+ {(char *)"int", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__int_doc, (void *)CD_PROP_INT},
+ {(char *)"string", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__string_doc, (void *)CD_PROP_STR},
+
+ {(char *)"bevel_weight", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__bevel_weight_doc, (void *)CD_BWEIGHT},
+ {(char *)"crease", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__crease_doc, (void *)CD_CREASE},
+
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+};
+
+static PyGetSetDef bpy_bmlayeraccess_face_getseters[] = {
+ {(char *)"float", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__float_doc, (void *)CD_PROP_FLT},
+ {(char *)"int", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__int_doc, (void *)CD_PROP_INT},
+ {(char *)"string", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__string_doc, (void *)CD_PROP_STR},
+
+ {(char *)"tex", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__tex_doc, (void *)CD_MTEXPOLY},
+
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+};
+
+static PyGetSetDef bpy_bmlayeraccess_loop_getseters[] = {
+ {(char *)"float", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__float_doc, (void *)CD_PROP_FLT},
+ {(char *)"int", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__int_doc, (void *)CD_PROP_INT},
+ {(char *)"string", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__string_doc, (void *)CD_PROP_STR},
+
+ {(char *)"uv", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__uv_doc, (void *)CD_MLOOPUV},
+ {(char *)"color", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__color_doc, (void *)CD_MLOOPCOL},
+
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+};
+
+
+static PyGetSetDef bpy_bmlayercollection_getseters[] = {
+ /* BMESH_TODO, make writeable */
+ {(char *)"active", (getter)bpy_bmlayercollection_active_get, (setter)NULL, (char *)bpy_bmlayercollection_active_doc, NULL},
+
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+};
+
+static PyGetSetDef bpy_bmlayeritem_getseters[] = {
+ /* BMESH_TODO, make writeable */
+ {(char *)"name", (getter)bpy_bmlayeritem_name_get, (setter)NULL, (char *)bpy_bmlayercollection_name_doc, NULL},
+
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+};
+
+
+/* Methods
+ * ======= */
+
+/* BMLayerCollection
+ * ----------------- */
+
+PyDoc_STRVAR(bpy_bmlayercollection_keys_doc,
+".. method:: keys()\n"
+"\n"
+" Return the identifiers of collection members\n"
+" (matching pythons dict.keys() functionality).\n"
+"\n"
+" :return: the identifiers for each member of this collection.\n"
+" :rtype: list of strings\n"
+);
+static PyObject *bpy_bmlayercollection_keys(BPy_BMLayerCollection *self)
+{
+ PyObject *ret;
+ PyObject *item;
+ int index;
+ CustomData *data;
+
+ BPY_BM_CHECK_OBJ(self);
+
+ data = bpy_bm_customdata_get(self->bm, self->htype);
+ index = CustomData_get_layer_index(data, self->type);
+
+ ret = PyList_New(0);
+
+ if (index != -1) {
+ int tot = CustomData_number_of_layers(data, self->type);
+ for ( ; tot-- > 0; index++) {
+ item = PyUnicode_FromString(data->layers[index].name);
+ PyList_Append(ret, item);
+ Py_DECREF(item);
+ }
+ }
+
+ return ret;
+}
+
+PyDoc_STRVAR(bpy_bmlayercollection_values_doc,
+".. method:: items()\n"
+"\n"
+" Return the identifiers of collection members\n"
+" (matching pythons dict.items() functionality).\n"
+"\n"
+" :return: (key, value) pairs for each member of this collection.\n"
+" :rtype: list of tuples\n"
+);
+static PyObject *bpy_bmlayercollection_values(BPy_BMLayerCollection *self)
+{
+ PyObject *ret;
+ PyObject *item;
+ int index;
+ CustomData *data;
+
+ BPY_BM_CHECK_OBJ(self);
+
+ data = bpy_bm_customdata_get(self->bm, self->htype);
+ index = CustomData_get_layer_index(data, self->type);
+
+ ret = PyList_New(0);
+
+ if (index != -1) {
+ int tot = CustomData_number_of_layers(data, self->type);
+ for ( ; tot-- > 0; index++) {
+ item = PyTuple_New(2);
+ PyTuple_SET_ITEM(item, 0, PyUnicode_FromString(data->layers[index].name));
+ PyTuple_SET_ITEM(item, 1, BPy_BMLayerItem_CreatePyObject(self->bm, self->htype, self->type, index));
+ PyList_Append(ret, item);
+ Py_DECREF(item);
+ }
+ }
+
+ return ret;
+}
+
+PyDoc_STRVAR(bpy_bmlayercollection_items_doc,
+".. method:: values()\n"
+"\n"
+" Return the values of collection\n"
+" (matching pythons dict.values() functionality).\n"
+"\n"
+" :return: the members of this collection.\n"
+" :rtype: list\n"
+);
+static PyObject *bpy_bmlayercollection_items(BPy_BMLayerCollection *self)
+{
+ PyObject *ret;
+ PyObject *item;
+ int index;
+ CustomData *data;
+
+ BPY_BM_CHECK_OBJ(self);
+
+ data = bpy_bm_customdata_get(self->bm, self->htype);
+ index = CustomData_get_layer_index(data, self->type);
+
+ ret = PyList_New(0);
+
+ if (index != -1) {
+ int tot = CustomData_number_of_layers(data, self->type);
+ for ( ; tot-- > 0; index++) {
+ item = BPy_BMLayerItem_CreatePyObject(self->bm, self->htype, self->type, index);
+ PyList_Append(ret, item);
+ Py_DECREF(item);
+ }
+ }
+
+ return ret;
+}
+
+PyDoc_STRVAR(bpy_bmlayercollection_get_doc,
+".. method:: get(key, default=None)\n"
+"\n"
+" Returns the value of the layer matching the key or default\n"
+" when not found (matches pythons dictionary function of the same name).\n"
+"\n"
+" :arg key: The key associated with the layer.\n"
+" :type key: string\n"
+" :arg default: Optional argument for the value to return if\n"
+" *key* is not found.\n"
+" :type default: Undefined\n"
+);
+static PyObject *bpy_bmlayercollection_get(BPy_BMLayerCollection *self, PyObject *args)
+{
+ const char *key;
+ PyObject *def = Py_None;
+
+ BPY_BM_CHECK_OBJ(self);
+
+ if (!PyArg_ParseTuple(args, "s|O:get", &key, &def)) {
+ return NULL;
+ }
+ else {
+ CustomData *data;
+ int index;
+
+ data = bpy_bm_customdata_get(self->bm, self->htype);
+ index = CustomData_get_named_layer_index(data, self->type, key);
+
+ if (index != -1) {
+ return BPy_BMLayerItem_CreatePyObject(self->bm, self->htype, self->type, index);
+ }
+ }
+
+ return Py_INCREF(def), def;
+}
+
+static struct PyMethodDef bpy_bmelemseq_methods[] = {
+ {"keys", (PyCFunction)bpy_bmlayercollection_keys, METH_NOARGS, bpy_bmlayercollection_keys_doc},
+ {"values", (PyCFunction)bpy_bmlayercollection_values, METH_NOARGS, bpy_bmlayercollection_values_doc},
+ {"items", (PyCFunction)bpy_bmlayercollection_items, METH_NOARGS, bpy_bmlayercollection_items_doc},
+ {"get", (PyCFunction)bpy_bmlayercollection_get, METH_VARARGS, bpy_bmlayercollection_get_doc},
+
+ /* for later! */
+#if 0
+
+ {"new", (PyCFunction)bpy_bmlayercollection_new, METH_O, bpy_bmlayercollection_new_doc},
+ {"remove", (PyCFunction)bpy_bmlayercollection_new, METH_O, bpy_bmlayercollection_remove_doc},
+#endif
+ {NULL, NULL, 0, NULL}
+};
+
+
+
+/* Sequences
+ * ========= */
+
+static Py_ssize_t bpy_bmlayercollection_length(BPy_BMLayerCollection *self)
+{
+ CustomData *data;
+
+ BPY_BM_CHECK_INT(self);
+
+ data = bpy_bm_customdata_get(self->bm, self->htype);
+
+ return CustomData_number_of_layers(data, self->type);
+}
+
+static PyObject *bpy_bmlayercollection_subscript_str(BPy_BMLayerCollection *self, const char *keyname)
+{
+ CustomData *data;
+ int index;
+
+ BPY_BM_CHECK_OBJ(self);
+
+ data = bpy_bm_customdata_get(self->bm, self->htype);
+ index = CustomData_get_named_layer_index(data, self->type, keyname);
+
+ if (index != -1) {
+ return BPy_BMLayerItem_CreatePyObject(self->bm, self->htype, self->type, index);
+ }
+ else {
+ PyErr_Format(PyExc_KeyError,
+ "BMLayerCollection[key]: key \"%.200s\" not found", keyname);
+ return NULL;
+ }
+}
+
+static PyObject *bpy_bmlayercollection_subscript_int(BPy_BMLayerCollection *self, int keynum)
+{
+ Py_ssize_t len;
+ BPY_BM_CHECK_OBJ(self);
+
+ len = bpy_bmlayercollection_length(self);
+
+ if (keynum < 0) keynum += len;
+ if (keynum >= 0) {
+ if (keynum < len) {
+ return BPy_BMLayerItem_CreatePyObject(self->bm, self->htype, self->type, keynum);
+ }
+ }
+
+ PyErr_Format(PyExc_IndexError,
+ "BMLayerCollection[index]: index %d out of range", keynum);
+ return NULL;
+}
+
+static PyObject *bpy_bmlayercollection_subscript_slice(BPy_BMLayerCollection *self, Py_ssize_t start, Py_ssize_t stop)
+{
+ Py_ssize_t len = bpy_bmlayercollection_length(self);
+ int count = 0;
+
+ PyObject *tuple;
+
+ BPY_BM_CHECK_OBJ(self);
+
+ if (start >= start) start = len - 1;
+ if (stop >= stop) stop = len - 1;
+
+ tuple = PyTuple_New(stop - start);
+
+ for (count = start; count < stop; count++) {
+ PyTuple_SET_ITEM(tuple, count - start, BPy_BMLayerItem_CreatePyObject(self->bm, self->htype, self->type, count));
+ }
+
+ return tuple;
+}
+
+static PyObject *bpy_bmlayercollection_subscript(BPy_BMLayerCollection *self, PyObject *key)
+{
+ /* don't need error check here */
+ if (PyUnicode_Check(key)) {
+ return bpy_bmlayercollection_subscript_str(self, _PyUnicode_AsString(key));
+ }
+ else if (PyIndex_Check(key)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError);
+ if (i == -1 && PyErr_Occurred())
+ return NULL;
+ return bpy_bmlayercollection_subscript_int(self, i);
+ }
+ else if (PySlice_Check(key)) {
+ PySliceObject *key_slice = (PySliceObject *)key;
+ Py_ssize_t step = 1;
+
+ if (key_slice->step != Py_None && !_PyEval_SliceIndex(key, &step)) {
+ return NULL;
+ }
+ else if (step != 1) {
+ PyErr_SetString(PyExc_TypeError,
+ "BMLayerCollection[slice]: slice steps not supported");
+ return NULL;
+ }
+ else if (key_slice->start == Py_None && key_slice->stop == Py_None) {
+ return bpy_bmlayercollection_subscript_slice(self, 0, PY_SSIZE_T_MAX);
+ }
+ else {
+ Py_ssize_t start = 0, stop = PY_SSIZE_T_MAX;
+
+ /* avoid PySlice_GetIndicesEx because it needs to know the length ahead of time. */
+ if (key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start)) return NULL;
+ if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) return NULL;
+
+ if (start < 0 || stop < 0) {
+ /* only get the length for negative values */
+ Py_ssize_t len = bpy_bmlayercollection_length(self);
+ if (start < 0) start += len;
+ if (stop < 0) start += len;
+ }
+
+ if (stop - start <= 0) {
+ return PyTuple_New(0);
+ }
+ else {
+ return bpy_bmlayercollection_subscript_slice(self, start, stop);
+ }
+ }
+ }
+ else {
+ PyErr_SetString(PyExc_AttributeError,
+ "BMLayerCollection[key]: invalid key, key must be an int");
+ return NULL;
+ }
+}
+
+static int bpy_bmlayercollection_contains(BPy_BMLayerCollection *self, PyObject *value)
+{
+ const char *keyname = _PyUnicode_AsString(value);
+ CustomData *data;
+ int index;
+
+ BPY_BM_CHECK_INT(self);
+
+ if (keyname == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "BMLayerCollection.__contains__: expected a string");
+ return -1;
+ }
+
+ data = bpy_bm_customdata_get(self->bm, self->htype);
+ index = CustomData_get_named_layer_index(data, self->type, keyname);
+
+ return (index != -1) ? 1 : 0;
+}
+
+static PySequenceMethods bpy_bmlayercollection_as_sequence = {
+ (lenfunc)bpy_bmlayercollection_length, /* sq_length */
+ NULL, /* sq_concat */
+ NULL, /* sq_repeat */
+ (ssizeargfunc)bpy_bmlayercollection_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_bmlayercollection_contains, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
+};
+
+static PyMappingMethods bpy_bmlayercollection_as_mapping = {
+ (lenfunc)bpy_bmlayercollection_length, /* mp_length */
+ (binaryfunc)bpy_bmlayercollection_subscript, /* mp_subscript */
+ (objobjargproc)NULL, /* mp_ass_subscript */
+};
+
+/* Iterator
+ * -------- */
+
+static PyObject *bpy_bmlayercollection_iter(BPy_BMLayerCollection *self)
+{
+ /* fake it with a list iterator */
+ PyObject *ret;
+ PyObject *iter = NULL;
+
+ BPY_BM_CHECK_OBJ(self);
+
+ ret = bpy_bmlayercollection_subscript_slice(self, 0, PY_SSIZE_T_MIN);
+
+ if (ret) {
+ iter = PyObject_GetIter(ret);
+ Py_DECREF(ret);
+ }
+
+ return iter;
+}
+
+PyDoc_STRVAR(bpy_bmlayeraccess_type_doc,
+"Exposes custom-data layer attributes."
+);
+
+PyDoc_STRVAR(bpy_bmlayercollection_type_doc,
+"Gives access to a collection of custom-data layers of the same type and behaves like python dictionaries, "
+"except for the ability to do list like index access."
+);
+
+PyDoc_STRVAR(bpy_bmlayeritem_type_doc,
+"Exposes a single custom data layer, "
+"their main purpose is for use as item accessors to custom-data when used with vert/edge/face/loop data."
+);
+
+
+PyTypeObject BPy_BMLayerAccessVert_Type = {{{0}}}; /* bm.verts.layers */
+PyTypeObject BPy_BMLayerAccessEdge_Type = {{{0}}}; /* bm.edges.layers */
+PyTypeObject BPy_BMLayerAccessFace_Type = {{{0}}}; /* bm.faces.layers */
+PyTypeObject BPy_BMLayerAccessLoop_Type = {{{0}}}; /* bm.loops.layers */
+PyTypeObject BPy_BMLayerCollection_Type = {{{0}}}; /* bm.loops.layers.uv */
+PyTypeObject BPy_BMLayerItem_Type = {{{0}}}; /* bm.loops.layers.uv["UVMap"] */
+
+
+PyObject *BPy_BMLayerAccess_CreatePyObject(BMesh *bm, const char htype)
+{
+ BPy_BMLayerAccess *self;
+ PyTypeObject *type;
+
+ switch (htype) {
+ case BM_VERT: type = &BPy_BMLayerAccessVert_Type; break;
+ case BM_EDGE: type = &BPy_BMLayerAccessEdge_Type; break;
+ case BM_FACE: type = &BPy_BMLayerAccessFace_Type; break;
+ case BM_LOOP: type = &BPy_BMLayerAccessLoop_Type; break;
+ default:
+ {
+ BLI_assert(0);
+ type = NULL;
+ break;
+ }
+ }
+
+ self = PyObject_New(BPy_BMLayerAccess, type);
+ self->bm = bm;
+ self->htype = htype;
+ return (PyObject *)self;
+}
+
+PyObject *BPy_BMLayerCollection_CreatePyObject(BMesh *bm, const char htype, int type)
+{
+ BPy_BMLayerCollection *self = PyObject_New(BPy_BMLayerCollection, &BPy_BMLayerCollection_Type);
+ self->bm = bm;
+ self->htype = htype;
+ self->type = type;
+ return (PyObject *)self;
+}
+
+PyObject *BPy_BMLayerItem_CreatePyObject(BMesh *bm, const char htype, int type, int index)
+{
+ BPy_BMLayerItem *self = PyObject_New(BPy_BMLayerItem, &BPy_BMLayerItem_Type);
+ self->bm = bm;
+ self->htype = htype;
+ self->type = type;
+ self->index = index;
+ return (PyObject *)self;
+}
+
+
+void BPy_BM_init_types_customdata(void)
+{
+ BPy_BMLayerAccessVert_Type.tp_basicsize = sizeof(BPy_BMLayerAccess);
+ BPy_BMLayerAccessEdge_Type.tp_basicsize = sizeof(BPy_BMLayerAccess);
+ BPy_BMLayerAccessFace_Type.tp_basicsize = sizeof(BPy_BMLayerAccess);
+ BPy_BMLayerAccessLoop_Type.tp_basicsize = sizeof(BPy_BMLayerAccess);
+ BPy_BMLayerCollection_Type.tp_basicsize = sizeof(BPy_BMLayerCollection);
+ BPy_BMLayerItem_Type.tp_basicsize = sizeof(BPy_BMLayerItem);
+
+ BPy_BMLayerAccessVert_Type.tp_name = "BMLayerAccessVert";
+ BPy_BMLayerAccessEdge_Type.tp_name = "BMLayerAccessEdge";
+ BPy_BMLayerAccessFace_Type.tp_name = "BMLayerAccessFace";
+ BPy_BMLayerAccessLoop_Type.tp_name = "BMLayerAccessLoop";
+ BPy_BMLayerCollection_Type.tp_name = "BMLayerCollection";
+ BPy_BMLayerItem_Type.tp_name = "BMLayerItem";
+
+ /* todo */
+ BPy_BMLayerAccessVert_Type.tp_doc = bpy_bmlayeraccess_type_doc;
+ BPy_BMLayerAccessEdge_Type.tp_doc = bpy_bmlayeraccess_type_doc;
+ BPy_BMLayerAccessFace_Type.tp_doc = bpy_bmlayeraccess_type_doc;
+ BPy_BMLayerAccessLoop_Type.tp_doc = bpy_bmlayeraccess_type_doc;
+ BPy_BMLayerCollection_Type.tp_doc = bpy_bmlayercollection_type_doc;
+ BPy_BMLayerItem_Type.tp_doc = bpy_bmlayeritem_type_doc;
+
+ BPy_BMLayerAccessVert_Type.tp_repr = (reprfunc)NULL;
+ BPy_BMLayerAccessEdge_Type.tp_repr = (reprfunc)NULL;
+ BPy_BMLayerAccessFace_Type.tp_repr = (reprfunc)NULL;
+ BPy_BMLayerAccessLoop_Type.tp_repr = (reprfunc)NULL;
+ BPy_BMLayerCollection_Type.tp_repr = (reprfunc)NULL;
+ BPy_BMLayerItem_Type.tp_repr = (reprfunc)NULL;
+
+ BPy_BMLayerAccessVert_Type.tp_getset = bpy_bmlayeraccess_vert_getseters;
+ BPy_BMLayerAccessEdge_Type.tp_getset = bpy_bmlayeraccess_edge_getseters;
+ BPy_BMLayerAccessFace_Type.tp_getset = bpy_bmlayeraccess_face_getseters;
+ BPy_BMLayerAccessLoop_Type.tp_getset = bpy_bmlayeraccess_loop_getseters;
+ BPy_BMLayerCollection_Type.tp_getset = bpy_bmlayercollection_getseters;
+ BPy_BMLayerItem_Type.tp_getset = bpy_bmlayeritem_getseters;
+
+
+// BPy_BMLayerAccess_Type.tp_methods = bpy_bmeditselseq_methods;
+ BPy_BMLayerCollection_Type.tp_methods = bpy_bmelemseq_methods;
+
+ BPy_BMLayerCollection_Type.tp_as_sequence = &bpy_bmlayercollection_as_sequence;
+
+ BPy_BMLayerCollection_Type.tp_as_mapping = &bpy_bmlayercollection_as_mapping;
+
+ BPy_BMLayerCollection_Type.tp_iter = (getiterfunc)bpy_bmlayercollection_iter;
+
+ BPy_BMLayerAccessVert_Type.tp_dealloc = NULL;
+ BPy_BMLayerAccessEdge_Type.tp_dealloc = NULL;
+ BPy_BMLayerAccessFace_Type.tp_dealloc = NULL;
+ BPy_BMLayerAccessLoop_Type.tp_dealloc = NULL;
+ BPy_BMLayerCollection_Type.tp_dealloc = NULL;
+ BPy_BMLayerItem_Type.tp_dealloc = NULL;
+
+
+
+ BPy_BMLayerAccessVert_Type.tp_flags = Py_TPFLAGS_DEFAULT;
+ BPy_BMLayerAccessEdge_Type.tp_flags = Py_TPFLAGS_DEFAULT;
+ BPy_BMLayerAccessFace_Type.tp_flags = Py_TPFLAGS_DEFAULT;
+ BPy_BMLayerAccessLoop_Type.tp_flags = Py_TPFLAGS_DEFAULT;
+ BPy_BMLayerCollection_Type.tp_flags = Py_TPFLAGS_DEFAULT;
+ BPy_BMLayerItem_Type.tp_flags = Py_TPFLAGS_DEFAULT;
+
+ PyType_Ready(&BPy_BMLayerAccessVert_Type);
+ PyType_Ready(&BPy_BMLayerAccessEdge_Type);
+ PyType_Ready(&BPy_BMLayerAccessFace_Type);
+ PyType_Ready(&BPy_BMLayerAccessLoop_Type);
+ PyType_Ready(&BPy_BMLayerCollection_Type);
+ PyType_Ready(&BPy_BMLayerItem_Type);
+}
+
+
+/* Per Element Get/Set
+ * ******************* */
+
+/**
+ * helper function for get/set, NULL return means the error is set
+ */
+static void *bpy_bmlayeritem_ptr_get(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer)
+{
+ void *value;
+ BMElem *ele = py_ele->ele;
+ CustomData *data;
+
+ /* error checking */
+ if (UNLIKELY(!BPy_BMLayerItem_Check(py_layer))) {
+ PyErr_SetString(PyExc_AttributeError,
+ "BMElem[key]: invalid key, must be a BMLayerItem");
+ return NULL;
+ }
+ else if (UNLIKELY(py_ele->bm != py_layer->bm)) {
+ PyErr_SetString(PyExc_ValueError,
+ "BMElem[layer]: layer is from another mesh");
+ return NULL;
+ }
+ else if (UNLIKELY(ele->head.htype != py_layer->htype)) {
+ char namestr_1[32], namestr_2[32];
+ PyErr_Format(PyExc_ValueError,
+ "Layer/Element type mismatch, expected %.200s got layer type %.200s",
+ BPy_BMElem_StringFromHType_ex(ele->head.htype, namestr_1),
+ BPy_BMElem_StringFromHType_ex(py_layer->htype, namestr_2));
+ return NULL;
+ }
+
+ data = bpy_bm_customdata_get(py_layer->bm, py_layer->htype);
+
+ value = CustomData_bmesh_get_n(data, ele->head.data, py_layer->type, py_layer->index);
+
+ if (UNLIKELY(value == NULL)) {
+ /* this should be fairly unlikely but possible if layers move about after we get them */
+ PyErr_SetString(PyExc_KeyError,
+ "BMElem[key]: layer not found");
+ return NULL;
+ }
+ else {
+ return value;
+ }
+}
+
+
+/**
+ *\brief BMElem.__getitem__()
+ *
+ * assume all error checks are done, eg:
+ *
+ * uv = vert[uv_layer]
+ */
+PyObject *BPy_BMLayerItem_GetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer)
+{
+ void *value = bpy_bmlayeritem_ptr_get(py_ele, py_layer);
+ PyObject *ret;
+
+ if (UNLIKELY(value == NULL)) {
+ return NULL;
+ }
+
+ switch (py_layer->type) {
+ case CD_MDEFORMVERT:
+ {
+ ret = BPy_BMDeformVert_CreatePyObject(value);
+ break;
+ }
+ case CD_PROP_FLT:
+ {
+ ret = PyFloat_FromDouble(*(float *)value);
+ break;
+ }
+ case CD_PROP_INT:
+ {
+ ret = PyLong_FromSsize_t((Py_ssize_t)(*(int *)value));
+ break;
+ }
+ case CD_PROP_STR:
+ {
+ MStringProperty *mstring = value;
+ ret = PyBytes_FromStringAndSize(mstring->s, BLI_strnlen(mstring->s, sizeof(mstring->s)));
+ break;
+ }
+ case CD_MTEXPOLY:
+ {
+ ret = Py_NotImplemented; /* TODO */
+ Py_INCREF(ret);
+ break;
+ }
+ case CD_MLOOPUV:
+ {
+ ret = BPy_BMLoopUV_CreatePyObject(value);
+ break;
+ }
+ case CD_MLOOPCOL:
+ {
+ ret = BPy_BMLoopColor_CreatePyObject(value);
+ break;
+ }
+ case CD_SHAPEKEY:
+ {
+ ret = Vector_CreatePyObject((float *)value, 3, Py_WRAP, NULL);
+ break;
+ }
+ case CD_BWEIGHT:
+ {
+ ret = PyFloat_FromDouble(*(float *)value);
+ break;
+ }
+ case CD_CREASE:
+ {
+ ret = PyFloat_FromDouble(*(float *)value);
+ break;
+ }
+ default:
+ {
+ ret = Py_NotImplemented; /* TODO */
+ Py_INCREF(ret);
+ break;
+ }
+ }
+
+ return ret;
+}
+
+int BPy_BMLayerItem_SetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer, PyObject *py_value)
+{
+ int ret = 0;
+ void *value = bpy_bmlayeritem_ptr_get(py_ele, py_layer);
+
+ if (UNLIKELY(value == NULL)) {
+ return -1;
+ }
+
+ switch (py_layer->type) {
+ case CD_MDEFORMVERT:
+ {
+ ret = BPy_BMDeformVert_AssignPyObject(value, py_value);
+ break;
+ }
+ case CD_PROP_FLT:
+ {
+ float tmp_val = PyFloat_AsDouble(py_value);
+ if (UNLIKELY(tmp_val == -1 && PyErr_Occurred())) {
+ PyErr_Format(PyExc_TypeError, "expected a float, not a %.200s", Py_TYPE(py_value)->tp_name);
+ ret = -1;
+ }
+ else {
+ *(float *)value = tmp_val;
+ }
+ break;
+ }
+ case CD_PROP_INT:
+ {
+ int tmp_val = PyLong_AsSsize_t(py_value);
+ if (UNLIKELY(tmp_val == -1 && PyErr_Occurred())) {
+ PyErr_Format(PyExc_TypeError, "expected an int, not a %.200s", Py_TYPE(py_value)->tp_name);
+ ret = -1;
+ }
+ else {
+ *(int *)value = tmp_val;
+ }
+ break;
+ }
+ case CD_PROP_STR:
+ {
+ MStringProperty *mstring = value;
+ const char *tmp_val = PyBytes_AsString(py_value);
+ if (UNLIKELY(tmp_val == NULL)) {
+ PyErr_Format(PyExc_TypeError, "expected bytes, not a %.200s", Py_TYPE(py_value)->tp_name);
+ ret = -1;
+ }
+ else {
+ BLI_strncpy(mstring->s, tmp_val, sizeof(mstring->s));
+ }
+ break;
+ }
+ case CD_MTEXPOLY:
+ {
+ PyErr_SetString(PyExc_AttributeError, "readonly"); /* could make this writeable later */
+ ret = -1;
+ break;
+ }
+ case CD_MLOOPUV:
+ {
+ ret = BPy_BMLoopUV_AssignPyObject(value, py_value);
+ break;
+ }
+ case CD_MLOOPCOL:
+ {
+ ret = BPy_BMLoopColor_AssignPyObject(value, py_value);
+ break;
+ }
+ case CD_SHAPEKEY:
+ {
+ float tmp_val[3];
+ if (UNLIKELY(mathutils_array_parse(tmp_val, 3, 3, py_value, "BMVert[shape] = value") == -1)) {
+ ret = -1;
+ }
+ else {
+ copy_v3_v3((float *)value, tmp_val);
+ }
+ break;
+ }
+ case CD_BWEIGHT:
+ {
+ float tmp_val = PyFloat_AsDouble(py_value);
+ if (UNLIKELY(tmp_val == -1 && PyErr_Occurred())) {
+ PyErr_Format(PyExc_TypeError, "expected a float, not a %.200s", Py_TYPE(py_value)->tp_name);
+ ret = -1;
+ }
+ else {
+ *(float *)value = CLAMPIS(tmp_val, 0.0f, 1.0f);
+ }
+ break;
+ }
+ case CD_CREASE:
+ {
+ float tmp_val = PyFloat_AsDouble(py_value);
+ if (UNLIKELY(tmp_val == -1 && PyErr_Occurred())) {
+ PyErr_Format(PyExc_TypeError, "expected a float, not a %.200s", Py_TYPE(py_value)->tp_name);
+ ret = -1;
+ }
+ else {
+ *(float *)value = CLAMPIS(tmp_val, 0.0f, 1.0f);
+ }
+ break;
+ }
+ default:
+ {
+ PyErr_SetString(PyExc_AttributeError, "readonly / unsupported type");
+ ret = -1;
+ break;
+ }
+ }
+
+ return ret;
+}
diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.h b/source/blender/python/bmesh/bmesh_py_types_customdata.h
new file mode 100644
index 00000000000..b16b2806235
--- /dev/null
+++ b/source/blender/python/bmesh/bmesh_py_types_customdata.h
@@ -0,0 +1,81 @@
+/*
+ * ***** 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) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/python/bmesh/bmesh_py_types_customdata.h
+ * \ingroup pybmesh
+ */
+
+#ifndef __BMESH_PY_TYPES_CUSTOMDATA_H__
+#define __BMESH_PY_TYPES_CUSTOMDATA_H__
+
+/* all use BPy_BMLayerAccess struct */
+extern PyTypeObject BPy_BMLayerAccessVert_Type;
+extern PyTypeObject BPy_BMLayerAccessEdge_Type;
+extern PyTypeObject BPy_BMLayerAccessFace_Type;
+extern PyTypeObject BPy_BMLayerAccessLoop_Type;
+
+extern PyTypeObject BPy_BMLayerCollection_Type;
+extern PyTypeObject BPy_BMLayerItem_Type;
+
+#define BPy_BMLayerAccess_Check(v) (Py_TYPE(v) == &BPy_BMLayerAccess_Type)
+#define BPy_BMLayerCollection_Check(v) (Py_TYPE(v) == &BPy_BMLayerCollection_Type)
+#define BPy_BMLayerItem_Check(v) (Py_TYPE(v) == &BPy_BMLayerItem_Type)
+
+/* all layers for vert/edge/face/loop */
+typedef struct BPy_BMLayerAccess {
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
+ char htype;
+} BPy_BMLayerAccess;
+
+/* access different layer types deform/uv/vertexcolor */
+typedef struct BPy_BMLayerCollection {
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
+ char htype;
+ int type; /* customdata type - CD_XXX */
+} BPy_BMLayerCollection;
+
+/* access a specific layer directly */
+typedef struct BPy_BMLayerItem {
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
+ char htype;
+ int type; /* customdata type - CD_XXX */
+ int index; /* index of this layer type */
+} BPy_BMLayerItem;
+
+PyObject *BPy_BMLayerAccess_CreatePyObject(BMesh *bm, const char htype);
+PyObject *BPy_BMLayerCollection_CreatePyObject(BMesh *bm, const char htype, int type);
+PyObject *BPy_BMLayerItem_CreatePyObject(BMesh *bm, const char htype, int type, int index);
+
+void BPy_BM_init_types_customdata(void);
+
+/* __getitem__ / __setitem__ */
+PyObject *BPy_BMLayerItem_GetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer);
+int BPy_BMLayerItem_SetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer, PyObject *value);
+
+
+#endif /* __BMESH_PY_TYPES_CUSTOMDATA_H__ */
diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
new file mode 100644
index 00000000000..9972ff288b2
--- /dev/null
+++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
@@ -0,0 +1,603 @@
+/*
+ * ***** 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) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/python/bmesh/bmesh_py_types_meshdata.c
+ * \ingroup pybmesh
+ *
+ * This file defines customdata types which can't be accessed as primitive
+ * python types such as MDeformVert, MLoopUV, MTexPoly
+ */
+
+#include <Python.h>
+
+#include "../mathutils/mathutils.h"
+
+#include "DNA_meshdata_types.h"
+
+#include "BLI_utildefines.h"
+#include "BLI_math_vector.h"
+
+#include "BKE_deform.h"
+
+#include "bmesh_py_types_meshdata.h"
+
+/* Mesh Loop UV
+ * ************ */
+
+#define BPy_BMLoopUV_Check(v) (Py_TYPE(v) == &BPy_BMLoopUV_Type)
+
+typedef struct BPy_BMLoopUV {
+ PyObject_VAR_HEAD
+ MLoopUV *data;
+} BPy_BMLoopUV;
+
+PyDoc_STRVAR(bpy_bmloopuv_uv_doc,
+"Loops UV (as a 2D Vector).\n\n:type: :class:`mathutils.Vector`"
+);
+static PyObject *bpy_bmloopuv_uv_get(BPy_BMLoopUV *self, void *UNUSED(closure))
+{
+ return Vector_CreatePyObject(self->data->uv, 2, Py_WRAP, NULL);
+}
+
+static int bpy_bmloopuv_uv_set(BPy_BMLoopUV *self, PyObject *value, void *UNUSED(closure))
+{
+ float tvec[2];
+ if (mathutils_array_parse(tvec, 2, 2, value, "BMLoopUV.uv") != -1) {
+ copy_v2_v2(self->data->uv, tvec);
+ return 0;
+ }
+ else {
+ return -1;
+ }
+}
+
+PyDoc_STRVAR(bpy_bmloopuv_flag__pin_uv_doc,
+"UV pin state.\n\n:type: boolean"
+);
+PyDoc_STRVAR(bpy_bmloopuv_flag__select_doc,
+"UV select state.\n\n:type: boolean"
+);
+PyDoc_STRVAR(bpy_bmloopuv_flag__select_edge_doc,
+"UV edge select state.\n\n:type: boolean"
+);
+
+
+static PyObject *bpy_bmloopuv_flag_get(BPy_BMLoopUV *self, void *flag_p)
+{
+ const int flag = GET_INT_FROM_POINTER(flag_p);
+ return PyBool_FromLong(self->data->flag & flag);
+}
+
+static int bpy_bmloopuv_flag_set(BPy_BMLoopUV *self, PyObject *value, void *flag_p)
+{
+ const int flag = GET_INT_FROM_POINTER(flag_p);
+
+ switch (PyLong_AsLong(value)) {
+ case TRUE:
+ self->data->flag |= flag;
+ return 0;
+ case FALSE:
+ self->data->flag &= ~flag;
+ return 0;
+ default:
+ PyErr_SetString(PyExc_TypeError,
+ "expected a boolean type 0/1");
+ return -1;
+ }
+}
+
+static PyGetSetDef bpy_bmloopuv_getseters[] = {
+ /* attributes match rna_def_mloopuv */
+ {(char *)"uv", (getter)bpy_bmloopuv_uv_get, (setter)bpy_bmloopuv_uv_set, (char *)bpy_bmloopuv_uv_doc, NULL},
+ {(char *)"pin_uv", (getter)bpy_bmloopuv_flag_get, (setter)bpy_bmloopuv_flag_set, (char *)bpy_bmloopuv_flag__pin_uv_doc, (void *)MLOOPUV_PINNED},
+ {(char *)"select", (getter)bpy_bmloopuv_flag_get, (setter)bpy_bmloopuv_flag_set, (char *)bpy_bmloopuv_flag__select_doc, (void *)MLOOPUV_VERTSEL},
+ {(char *)"select_edge", (getter)bpy_bmloopuv_flag_get, (setter)bpy_bmloopuv_flag_set, (char *)bpy_bmloopuv_flag__select_edge_doc, (void *)MLOOPUV_EDGESEL},
+
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+};
+
+PyTypeObject BPy_BMLoopUV_Type = {{{0}}}; /* bm.loops.layers.uv.active */
+
+static void bm_init_types_bmloopuv(void)
+{
+ BPy_BMLoopUV_Type.tp_basicsize = sizeof(BPy_BMLoopUV);
+
+ BPy_BMLoopUV_Type.tp_name = "BMLoopUV";
+
+ BPy_BMLoopUV_Type.tp_doc = NULL; // todo
+
+ BPy_BMLoopUV_Type.tp_getset = bpy_bmloopuv_getseters;
+
+ BPy_BMLoopUV_Type.tp_flags = Py_TPFLAGS_DEFAULT;
+
+ PyType_Ready(&BPy_BMLoopUV_Type);
+}
+
+int BPy_BMLoopUV_AssignPyObject(struct MLoopUV *mloopuv, PyObject *value)
+{
+ if (UNLIKELY(!BPy_BMLoopUV_Check(value))) {
+ PyErr_Format(PyExc_TypeError, "expected BMLoopUV, not a %.200s", Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ else {
+ *((MLoopUV *)mloopuv) = *(((BPy_BMLoopUV *)value)->data);
+ return 0;
+ }
+}
+
+PyObject *BPy_BMLoopUV_CreatePyObject(struct MLoopUV *mloopuv)
+{
+ BPy_BMLoopUV *self = PyObject_New(BPy_BMLoopUV, &BPy_BMLoopUV_Type);
+ self->data = mloopuv;
+ return (PyObject *)self;
+}
+
+/* --- End Mesh Loop UV --- */
+
+/* Mesh Loop Color
+ * *************** */
+
+/* This simply provices a color wrapper for
+ * color which uses mathutils callbacks for mathutils.Color
+ */
+
+#define MLOOPCOL_FROM_CAPSULE(color_capsule) \
+ ((MLoopCol *)PyCapsule_GetPointer(color_capsule, NULL))
+
+static void mloopcol_to_float(const MLoopCol *mloopcol, float col_r[3])
+{
+ rgb_uchar_to_float(col_r, (unsigned char *)&mloopcol->r);
+}
+
+static void mloopcol_from_float(MLoopCol *mloopcol, const float col[3])
+{
+ rgb_float_to_uchar((unsigned char *)&mloopcol->r, col);
+}
+
+static unsigned char mathutils_bmloopcol_cb_index = -1;
+
+static int mathutils_bmloopcol_check(BaseMathObject *UNUSED(bmo))
+{
+ /* always ok */
+ return 0;
+}
+
+static int mathutils_bmloopcol_get(BaseMathObject *bmo, int UNUSED(subtype))
+{
+ MLoopCol *mloopcol = MLOOPCOL_FROM_CAPSULE(bmo->cb_user);
+ mloopcol_to_float(mloopcol, bmo->data);
+ return 0;
+}
+
+static int mathutils_bmloopcol_set(BaseMathObject *bmo, int UNUSED(subtype))
+{
+ MLoopCol *mloopcol = MLOOPCOL_FROM_CAPSULE(bmo->cb_user);
+ mloopcol_from_float(mloopcol, bmo->data);
+ return 0;
+}
+
+static int mathutils_bmloopcol_get_index(BaseMathObject *bmo, int subtype, int UNUSED(index))
+{
+ /* lazy, avoid repeteing the case statement */
+ if (mathutils_bmloopcol_get(bmo, subtype) == -1)
+ return -1;
+ return 0;
+}
+
+static int mathutils_bmloopcol_set_index(BaseMathObject *bmo, int subtype, int index)
+{
+ const float f = bmo->data[index];
+
+ /* lazy, avoid repeteing the case statement */
+ if (mathutils_bmloopcol_get(bmo, subtype) == -1)
+ return -1;
+
+ bmo->data[index] = f;
+ return mathutils_bmloopcol_set(bmo, subtype);
+}
+
+Mathutils_Callback mathutils_bmloopcol_cb = {
+ mathutils_bmloopcol_check,
+ mathutils_bmloopcol_get,
+ mathutils_bmloopcol_set,
+ mathutils_bmloopcol_get_index,
+ mathutils_bmloopcol_set_index
+};
+
+static void bm_init_types_bmloopcol(void)
+{
+ /* pass */
+ mathutils_bmloopcol_cb_index = Mathutils_RegisterCallback(&mathutils_bmloopcol_cb);
+}
+
+int BPy_BMLoopColor_AssignPyObject(struct MLoopCol *mloopcol, PyObject *value)
+{
+ float tvec[3];
+ if (mathutils_array_parse(tvec, 3, 3, value, "BMLoopCol") != -1) {
+ mloopcol_from_float(mloopcol, tvec);
+ return 0;
+ }
+ else {
+ return -1;
+ }
+}
+
+PyObject *BPy_BMLoopColor_CreatePyObject(struct MLoopCol *data)
+{
+ PyObject *color_capsule;
+ color_capsule = PyCapsule_New(data, NULL, NULL);
+ return Color_CreatePyObject_cb(color_capsule, mathutils_bmloopcol_cb_index, 0);
+}
+
+#undef MLOOPCOL_FROM_CAPSULE
+
+/* --- End Mesh Loop Color --- */
+
+
+/* Mesh Deform Vert
+ * **************** */
+
+/**
+ * This is python type wraps a deform vert as a python dictionary,
+ * hiding the #MDeformWeight on access, since the mapping is very close, eg:
+ *
+ * C:
+ * weight = defvert_find_weight(dv, group_nr);
+ * defvert_remove_group(dv, dw)
+ *
+ * Py:
+ * weight = dv[group_nr]
+ * del dv[group_nr]
+ *
+ * \note: there is nothing BMesh spesific here,
+ * its only that BMesh is the only part of blender that uses a hand written api like this.
+ * This type could eventually be used to access lattice weights.
+ *
+ * \note: Many of blender-api's dict-like-wrappers act like ordered dicts,
+ * This is intentional _not_ ordered, the weights can be in any order and it wont matter,
+ * the order should not be used in the api in any meaningful way (as with a python dict)
+ * only expose as mapping, not a sequence.
+ */
+
+#define BPy_BMDeformVert_Check(v) (Py_TYPE(v) == &BPy_BMDeformVert_Type)
+
+typedef struct BPy_BMDeformVert {
+ PyObject_VAR_HEAD
+ MDeformVert *data;
+} BPy_BMDeformVert;
+
+
+/* Mapping Protocols
+ * ================= */
+
+static int bpy_bmdeformvert_len(BPy_BMDeformVert *self)
+{
+ return self->data->totweight;
+}
+
+static PyObject *bpy_bmdeformvert_subscript(BPy_BMDeformVert *self, PyObject *key)
+{
+ if (PyIndex_Check(key)) {
+ int i;
+ i = PyNumber_AsSsize_t(key, PyExc_IndexError);
+ if (i == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+ else {
+ MDeformWeight *dw = defvert_find_index(self->data, i);
+
+ if (dw == NULL) {
+ PyErr_SetString(PyExc_KeyError, "BMDeformVert[key] = x: "
+ "key not found");
+ return NULL;
+ }
+ else {
+ return PyFloat_FromDouble(dw->weight);
+ }
+ }
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "BMDeformVert keys must be integers, not %.200s",
+ Py_TYPE(key)->tp_name);
+ return NULL;
+ }
+}
+
+static int bpy_bmdeformvert_ass_subscript(BPy_BMDeformVert *self, PyObject *key, PyObject *value)
+{
+ if (PyIndex_Check(key)) {
+ int i;
+
+ i = PyNumber_AsSsize_t(key, PyExc_IndexError);
+ if (i == -1 && PyErr_Occurred()) {
+ return -1;
+ }
+
+ if (value) {
+ /* dvert[group_index] = 0.5 */
+ if (i < 0) {
+ PyErr_SetString(PyExc_KeyError, "BMDeformVert[key] = x: "
+ "weight keys can't be negative");
+ return -1;
+ }
+ else {
+ MDeformWeight *dw = defvert_verify_index(self->data, i);
+ const float f = PyFloat_AsDouble(value);
+ if (f == -1 && PyErr_Occurred()) { // parsed key not a number
+ PyErr_SetString(PyExc_TypeError,
+ "BMDeformVert[key] = x: "
+ "argument not a number");
+ return -1;
+ }
+
+ dw->weight = CLAMPIS(f, 0.0f, 1.0f);
+ }
+ }
+ else {
+ /* del dvert[group_index] */
+ MDeformWeight *dw = defvert_find_index(self->data, i);
+
+ if (dw == NULL) {
+ PyErr_SetString(PyExc_KeyError, "del BMDeformVert[key]: "
+ "key not found");
+ }
+ defvert_remove_group(self->data, dw);
+ }
+
+ return 0;
+
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "BMDeformVert keys must be integers, not %.200s",
+ Py_TYPE(key)->tp_name);
+ return -1;
+ }
+}
+
+static int bpy_bmdeformvert_contains(BPy_BMDeformVert *self, PyObject *value)
+{
+ const int key = PyLong_AsSsize_t(value);
+
+ if (key == -1 && PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "BMDeformVert.__contains__: expected an int");
+ return -1;
+ }
+
+ return (defvert_find_index(self->data, key) != NULL) ? 1 : 0;
+}
+
+/* only defined for __contains__ */
+static PySequenceMethods bpy_bmdeformvert_as_sequence = {
+ (lenfunc)bpy_bmdeformvert_len, /* sq_length */
+ NULL, /* sq_concat */
+ NULL, /* sq_repeat */
+
+ /* note: if this is set PySequence_Check() returns True,
+ * but in this case we dont want to be treated as a seq */
+ NULL, /* sq_item */
+
+ NULL, /* sq_slice */
+ NULL, /* sq_ass_item */
+ NULL, /* *was* sq_ass_slice */
+ (objobjproc)bpy_bmdeformvert_contains, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
+};
+
+static PyMappingMethods bpy_bmdeformvert_as_mapping = {
+ (lenfunc)bpy_bmdeformvert_len,
+ (binaryfunc)bpy_bmdeformvert_subscript,
+ (objobjargproc)bpy_bmdeformvert_ass_subscript
+};
+
+/* Methods
+ * ======= */
+
+PyDoc_STRVAR(bpy_bmdeformvert_keys_doc,
+".. method:: keys()\n"
+"\n"
+" Return the group indices used by this vertex\n"
+" (matching pythons dict.keys() functionality).\n"
+"\n"
+" :return: the deform group this vertex uses\n"
+" :rtype: list of ints\n"
+);
+static PyObject *bpy_bmdeformvert_keys(BPy_BMDeformVert *self)
+{
+ PyObject *ret;
+ int i;
+ MDeformWeight *dw = self->data->dw;
+
+ ret = PyList_New(self->data->totweight);
+ for (i = 0; i < self->data->totweight; i++, dw++) {
+ PyList_SET_ITEM(ret, i, PyLong_FromSsize_t(dw->def_nr));
+ }
+
+ return ret;
+}
+
+PyDoc_STRVAR(bpy_bmdeformvert_values_doc,
+".. method:: items()\n"
+"\n"
+" Return (group, weight) pairs for this vertex\n"
+" (matching pythons dict.items() functionality).\n"
+"\n"
+" :return: (key, value) pairs for each deform weight of this vertex.\n"
+" :rtype: list of tuples\n"
+);
+static PyObject *bpy_bmdeformvert_values(BPy_BMDeformVert *self)
+{
+ PyObject *ret;
+ int i;
+ MDeformWeight *dw = self->data->dw;
+
+ ret = PyList_New(self->data->totweight);
+ for (i = 0; i < self->data->totweight; i++, dw++) {
+ PyList_SET_ITEM(ret, i, PyFloat_FromDouble(dw->weight));
+ }
+
+ return ret;
+}
+
+PyDoc_STRVAR(bpy_bmdeformvert_items_doc,
+".. method:: values()\n"
+"\n"
+" Return the weights of the deform vertex\n"
+" (matching pythons dict.values() functionality).\n"
+"\n"
+" :return: The weights that influence this vertex\n"
+" :rtype: list of floats\n"
+);
+static PyObject *bpy_bmdeformvert_items(BPy_BMDeformVert *self)
+{
+ PyObject *ret;
+ PyObject *item;
+ int i;
+ MDeformWeight *dw = self->data->dw;
+
+ ret = PyList_New(self->data->totweight);
+ for (i = 0; i < self->data->totweight; i++, dw++) {
+ item = PyTuple_New(2);
+
+ PyTuple_SET_ITEM(item, 0, PyLong_FromSsize_t(dw->def_nr));
+ PyTuple_SET_ITEM(item, 1, PyFloat_FromDouble(dw->weight));
+
+ PyList_SET_ITEM(ret, i, item);
+ }
+
+ return ret;
+}
+
+PyDoc_STRVAR(bpy_bmdeformvert_get_doc,
+".. method:: get(key, default=None)\n"
+"\n"
+" Returns the deform weight matching the key or default\n"
+" when not found (matches pythons dictionary function of the same name).\n"
+"\n"
+" :arg key: The key associated with deform weight.\n"
+" :type key: int\n"
+" :arg default: Optional argument for the value to return if\n"
+" *key* is not found.\n"
+" :type default: Undefined\n"
+);
+static PyObject *bpy_bmdeformvert_get(BPy_BMDeformVert *self, PyObject *args)
+{
+ int key;
+ PyObject *def = Py_None;
+
+ if (!PyArg_ParseTuple(args, "i|O:get", &key, &def)) {
+ return NULL;
+ }
+ else {
+ MDeformWeight *dw = defvert_find_index(self->data, key);
+
+ if (dw) {
+ return PyFloat_FromDouble(dw->weight);
+ }
+ else {
+ return Py_INCREF(def), def;
+ }
+ }
+}
+
+
+PyDoc_STRVAR(bpy_bmdeformvert_clear_doc,
+".. method:: clear()\n"
+"\n"
+" Clears all weights.\n"
+);
+static PyObject *bpy_bmdeformvert_clear(BPy_BMDeformVert *self)
+{
+ defvert_clear(self->data);
+
+ Py_RETURN_NONE;
+}
+
+static struct PyMethodDef bpy_bmdeformvert_methods[] = {
+ {"keys", (PyCFunction)bpy_bmdeformvert_keys, METH_NOARGS, bpy_bmdeformvert_keys_doc},
+ {"values", (PyCFunction)bpy_bmdeformvert_values, METH_NOARGS, bpy_bmdeformvert_values_doc},
+ {"items", (PyCFunction)bpy_bmdeformvert_items, METH_NOARGS, bpy_bmdeformvert_items_doc},
+ {"get", (PyCFunction)bpy_bmdeformvert_get, METH_VARARGS, bpy_bmdeformvert_get_doc},
+ /* BMESH_TODO pop, popitem, update */
+ {"clear", (PyCFunction)bpy_bmdeformvert_clear, METH_NOARGS, bpy_bmdeformvert_clear_doc},
+ {NULL, NULL, 0, NULL}
+};
+
+PyTypeObject BPy_BMDeformVert_Type = {{{0}}}; /* bm.loops.layers.uv.active */
+
+static void bm_init_types_bmdvert(void)
+{
+ BPy_BMDeformVert_Type.tp_basicsize = sizeof(BPy_BMDeformVert);
+
+ BPy_BMDeformVert_Type.tp_name = "BMDeformVert";
+
+ BPy_BMDeformVert_Type.tp_doc = NULL; // todo
+
+ BPy_BMDeformVert_Type.tp_as_sequence = &bpy_bmdeformvert_as_sequence;
+ BPy_BMDeformVert_Type.tp_as_mapping = &bpy_bmdeformvert_as_mapping;
+
+ BPy_BMDeformVert_Type.tp_methods = bpy_bmdeformvert_methods;
+
+ BPy_BMDeformVert_Type.tp_flags = Py_TPFLAGS_DEFAULT;
+
+ PyType_Ready(&BPy_BMDeformVert_Type);
+}
+
+int BPy_BMDeformVert_AssignPyObject(struct MDeformVert *dvert, PyObject *value)
+{
+ if (UNLIKELY(!BPy_BMDeformVert_Check(value))) {
+ PyErr_Format(PyExc_TypeError, "expected BMDeformVert, not a %.200s", Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ else {
+ MDeformVert *dvert_src = ((BPy_BMDeformVert *)value)->data;
+ if (LIKELY(dvert != dvert_src)) {
+ defvert_copy(dvert, dvert_src);
+ }
+ return 0;
+ }
+}
+
+PyObject *BPy_BMDeformVert_CreatePyObject(struct MDeformVert *dvert)
+{
+ BPy_BMDeformVert *self = PyObject_New(BPy_BMDeformVert, &BPy_BMDeformVert_Type);
+ self->data = dvert;
+ return (PyObject *)self;
+}
+
+/* --- End Mesh Deform Vert --- */
+
+
+/* call to init all types */
+void BPy_BM_init_types_meshdata(void)
+{
+ bm_init_types_bmloopuv();
+ bm_init_types_bmloopcol();
+ bm_init_types_bmdvert();
+}
+
diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.h b/source/blender/python/bmesh/bmesh_py_types_meshdata.h
new file mode 100644
index 00000000000..4636f800ed3
--- /dev/null
+++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.h
@@ -0,0 +1,59 @@
+/*
+ * ***** 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) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/python/bmesh/bmesh_py_types_meshdata.h
+ * \ingroup pybmesh
+ */
+
+#ifndef __BMESH_PY_TYPES_MESHDATA_H__
+#define __BMESH_PY_TYPES_MESHDATA_H__
+
+extern PyTypeObject BPy_BMLoopUV_Type;
+extern PyTypeObject BPy_BMDeformVert_Type;
+
+#define BPy_BMLoopUV_Check(v) (Py_TYPE(v) == &BPy_BMLoopUV_Type)
+
+typedef struct BPy_BMGenericMeshData {
+ PyObject_VAR_HEAD
+ void *data;
+} BPy_BMGenericMeshData;
+
+struct MLoopUV;
+struct MLoopCol;
+struct MDeformVert;
+
+int BPy_BMLoopUV_AssignPyObject(struct MLoopUV *data, PyObject *value);
+PyObject *BPy_BMLoopUV_CreatePyObject(struct MLoopUV *data);
+
+int BPy_BMLoopColor_AssignPyObject(struct MLoopCol *data, PyObject *value);
+PyObject *BPy_BMLoopColor_CreatePyObject(struct MLoopCol *data);
+
+int BPy_BMDeformVert_AssignPyObject(struct MDeformVert *dvert, PyObject *value);
+PyObject *BPy_BMDeformVert_CreatePyObject(struct MDeformVert *dvert);
+
+
+void BPy_BM_init_types_meshdata(void);
+
+#endif /* __BMESH_PY_TYPES_MESHDATA_H__ */
diff --git a/source/blender/python/bmesh/bmesh_py_select.c b/source/blender/python/bmesh/bmesh_py_types_select.c
index 5630b4ac712..4f3501944b0 100644
--- a/source/blender/python/bmesh/bmesh_py_select.c
+++ b/source/blender/python/bmesh/bmesh_py_types_select.c
@@ -23,21 +23,25 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/python/bmesh/bmesh_py_api.c
+/** \file blender/python/bmesh/bmesh_py_types_select.c
* \ingroup pybmesh
*
- * This file defines the 'bmesh' module.
+ * This file defines the types for 'BMesh.select_history'
+ * sequence and iterator.
+ *
+ * select_history is very loosely based on pytons set() type,
+ * since items can only exist once. however they do have an order.
*/
#include <Python.h>
+#include "BLI_utildefines.h"
+#include "BLI_listbase.h"
+
#include "bmesh.h"
#include "bmesh_py_types.h"
-#include "bmesh_py_select.h"
-
-#include "BLI_utildefines.h"
-#include "BLI_listbase.h"
+#include "bmesh_py_types_select.h"
#include "BKE_tessmesh.h"
@@ -47,14 +51,119 @@
#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 */
};
+PyDoc_STRVAR(bpy_bmeditselseq_validate_doc,
+".. method:: validate()\n"
+"\n"
+" Ensures all elements in the selection history are selected.\n"
+);
+static PyObject *bpy_bmeditselseq_validate(BPy_BMEditSelSeq *self)
+{
+ BPY_BM_CHECK_OBJ(self);
+ BM_select_history_validate(self->bm);
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(bpy_bmeditselseq_clear_doc,
+".. method:: clear()\n"
+"\n"
+" Empties the selection history.\n"
+);
+static PyObject *bpy_bmeditselseq_clear(BPy_BMEditSelSeq *self)
+{
+ BPY_BM_CHECK_OBJ(self);
+ BM_select_history_clear(self->bm);
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(bpy_bmeditselseq_add_doc,
+".. method:: add(element)\n"
+"\n"
+" Add an element to the selection history (no action taken if its already added).\n"
+);
+static PyObject *bpy_bmeditselseq_add(BPy_BMEditSelSeq *self, BPy_BMElem *value)
+{
+ BPY_BM_CHECK_OBJ(self);
+
+ if ((BPy_BMVert_Check(value) ||
+ BPy_BMEdge_Check(value) ||
+ BPy_BMFace_Check(value)) == FALSE)
+ {
+ PyErr_Format(PyExc_TypeError,
+ "Expected a BMVert/BMedge/BMFace not a %.200s", Py_TYPE(value)->tp_name);
+ return NULL;
+ }
+
+ BPY_BM_CHECK_OBJ(value);
+
+ if (self->bm != value->bm) {
+ PyErr_SetString(PyExc_ValueError,
+ "Element is not from this mesh");
+ return NULL;
+ }
+
+ BM_select_history_store(self->bm, value->ele);
+
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(bpy_bmeditselseq_remove_doc,
+".. method:: remove(element)\n"
+"\n"
+" Remove an element from the selection history.\n"
+);
+static PyObject *bpy_bmeditselseq_remove(BPy_BMEditSelSeq *self, BPy_BMElem *value)
+{
+ BPY_BM_CHECK_OBJ(self);
+
+ if ((BPy_BMVert_Check(value) ||
+ BPy_BMEdge_Check(value) ||
+ BPy_BMFace_Check(value)) == FALSE)
+ {
+ PyErr_Format(PyExc_TypeError,
+ "Expected a BMVert/BMedge/BMFace not a %.200s", Py_TYPE(value)->tp_name);
+ return NULL;
+ }
+
+ BPY_BM_CHECK_OBJ(value);
+
+ if ((self->bm != value->bm) ||
+ (BM_select_history_remove(self->bm, value->ele) == FALSE))
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "Element not found in selection history");
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
static struct PyMethodDef bpy_bmeditselseq_methods[] = {
- // {"select_flush_mode", (PyCFunction)bpy_bmesh_select_flush_mode, METH_NOARGS, bpy_bmesh_select_flush_mode_doc},
+ {"validate", (PyCFunction)bpy_bmeditselseq_validate, METH_NOARGS, bpy_bmeditselseq_validate_doc},
+ {"clear", (PyCFunction)bpy_bmeditselseq_clear, METH_NOARGS, bpy_bmeditselseq_clear_doc},
+
+ {"add", (PyCFunction)bpy_bmeditselseq_add, METH_O, bpy_bmeditselseq_add_doc},
+ {"remove", (PyCFunction)bpy_bmeditselseq_remove, METH_O, bpy_bmeditselseq_remove_doc},
{NULL, NULL, 0, NULL}
};
@@ -71,19 +180,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)
@@ -132,7 +247,7 @@ static PyObject *bpy_bmeditselseq_subscript_slice(BPy_BMEditSelSeq *self, Py_ssi
static PyObject *bpy_bmeditselseq_subscript(BPy_BMEditSelSeq *self, PyObject *key)
{
- /* dont need error check here */
+ /* don't need error check here */
if (PyIndex_Check(key)) {
Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError);
if (i == -1 && PyErr_Occurred())
@@ -191,36 +306,28 @@ static int bpy_bmeditselseq_contains(BPy_BMEditSelSeq *self, PyObject *value)
value_bm_ele = (BPy_BMElem *)value;
if (value_bm_ele->bm == self->bm) {
- BMEditSelection *ese_test;
- BMElem *ele;
-
- ele = value_bm_ele->ele;
- for (ese_test = self->bm->selected.first; ese_test; ese_test = ese_test->next) {
- if (ele == ese_test->ele) {
- return 1;
- }
- }
+ return BM_select_history_check(self->bm, value_bm_ele->ele);
}
return 0;
}
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 */
};
@@ -252,7 +359,7 @@ static PyObject *bpy_bmeditseliter_next(BPy_BMEditSelIter *self)
}
}
-PyTypeObject BPy_BMEditSelSeq_Type = {{{0}}};
+PyTypeObject BPy_BMEditSelSeq_Type = {{{0}}};
PyTypeObject BPy_BMEditSelIter_Type = {{{0}}};
@@ -272,7 +379,7 @@ PyObject *BPy_BMEditSelIter_CreatePyObject(BMesh *bm)
return (PyObject *)self;
}
-void BPy_BM_init_select_types(void)
+void BPy_BM_init_types_select(void)
{
BPy_BMEditSelSeq_Type.tp_basicsize = sizeof(BPy_BMEditSelSeq);
BPy_BMEditSelIter_Type.tp_basicsize = sizeof(BPy_BMEditSelIter);
@@ -310,3 +417,38 @@ void BPy_BM_init_select_types(void)
PyType_Ready(&BPy_BMEditSelSeq_Type);
PyType_Ready(&BPy_BMEditSelIter_Type);
}
+
+
+/* utility function */
+
+/**
+ * \note doesnt actually check selection.
+ */
+int BPy_BMEditSel_Assign(BPy_BMesh *self, PyObject *value)
+{
+ BMesh *bm;
+ Py_ssize_t value_len;
+ Py_ssize_t i;
+ BMElem **value_array = NULL;
+
+ BPY_BM_CHECK_INT(self);
+
+ bm = self->bm;
+
+ value_array = BPy_BMElem_PySeq_As_Array(&bm, value, 0, PY_SSIZE_T_MAX,
+ &value_len, BM_VERT | BM_EDGE | BM_FACE,
+ TRUE, TRUE, "BMesh.select_history = value");
+
+ if (value_array == NULL) {
+ return -1;
+ }
+
+ BM_select_history_clear(bm);
+
+ for (i = 0; i < value_len; i++) {
+ BM_select_history_store_notest(bm, value_array[i]);
+ }
+
+ PyMem_FREE(value_array);
+ return 0;
+}
diff --git a/source/blender/python/bmesh/bmesh_py_select.h b/source/blender/python/bmesh/bmesh_py_types_select.h
index d1bfcdcb6b3..4741e229400 100644
--- a/source/blender/python/bmesh/bmesh_py_select.h
+++ b/source/blender/python/bmesh/bmesh_py_types_select.h
@@ -23,12 +23,14 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/python/bmesh/bmesh_py_select.h
+/** \file blender/python/bmesh/bmesh_py_types_select.h
* \ingroup pybmesh
*/
-#ifndef __BMESH_PY_SELECT_H__
-#define __BMESH_PY_SELECT_H__
+#ifndef __BMESH_PY_TYPES_SELECT_H__
+#define __BMESH_PY_TYPES_SELECT_H__
+
+struct BPy_BMesh;
extern PyTypeObject BPy_BMEditSelSeq_Type;
extern PyTypeObject BPy_BMEditSelIter_Type;
@@ -47,9 +49,10 @@ typedef struct BPy_BMEditSelIter {
struct BMEditSelection *ese;
} BPy_BMEditSelIter;
-void BPy_BM_init_select_types(void);
+void BPy_BM_init_types_select(void);
PyObject *BPy_BMEditSel_CreatePyObject(BMesh *bm);
PyObject *BPy_BMEditSelIter_CreatePyObject(BMesh *bm);
+int BPy_BMEditSel_Assign(struct BPy_BMesh *self, PyObject *value);
#endif /* __BMESH_PY_SELECT_H__ */
diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c
index a8d90522c15..bbec871a44b 100644
--- a/source/blender/python/bmesh/bmesh_py_utils.c
+++ b/source/blender/python/bmesh/bmesh_py_utils.c
@@ -32,12 +32,14 @@
#include <Python.h>
+#include "BLI_utildefines.h"
+
+#include "MEM_guardedalloc.h"
+
#include "bmesh.h"
#include "bmesh_py_types.h"
-#include "BLI_utildefines.h"
-
#include "bmesh_py_utils.h" /* own include */
@@ -47,11 +49,11 @@ PyDoc_STRVAR(bpy_bm_utils_vert_collapse_edge_doc,
" Collapse a vertex into an edge.\n"
"\n"
" :arg vert: The vert that will be collapsed.\n"
-" :type vert: :class:`BMVert`\n"
+" :type vert: :class:`bmesh.types.BMVert`\n"
" :arg edge: The edge to collapse into.\n"
-" :type edge: :class:`BMEdge`\n"
+" :type edge: :class:`bmesh.types.BMEdge`\n"
" :return: The resulting edge from the collapse operation.\n"
-" :rtype: :class:`BMEdge`\n"
+" :rtype: :class:`bmesh.types.BMEdge`\n"
);
static PyObject *bpy_bm_utils_vert_collapse_edge(PyObject *UNUSED(self), PyObject *args)
{
@@ -107,13 +109,13 @@ PyDoc_STRVAR(bpy_bm_utils_vert_collapse_faces_doc,
" Split an edge, return the newly created data.\n"
"\n"
" :arg vert: The vert that will be collapsed.\n"
-" :type vert: :class:`BMVert`\n"
+" :type vert: :class:`bmesh.types.BMVert`\n"
" :arg edge: The edge to collapse into.\n"
-" :type edge: :class:`BMEdge`\n"
+" :type edge: :class:`bmesh.types.BMEdge`\n"
" :arg fac: The factor to use when merging customdata [0 - 1].\n"
" :type fac: float\n"
" :return: The resulting edge from the collapse operation.\n"
-" :rtype: :class:`BMEdge`\n"
+" :rtype: :class:`bmesh.types.BMEdge`\n"
);
static PyObject *bpy_bm_utils_vert_collapse_faces(PyObject *UNUSED(self), PyObject *args)
{
@@ -173,7 +175,7 @@ PyDoc_STRVAR(bpy_bm_utils_vert_dissolve_doc,
" Dissolve this vertex (will be removed).\n"
"\n"
" :arg vert: The vert to be dissolved.\n"
-" :type vert: :class:`BMVert`\n"
+" :type vert: :class:`bmesh.types.BMVert`\n"
" :return: True when the vertex dissolve is successful.\n"
" :rtype: boolean\n"
);
@@ -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:`bmesh.types.BMVert`\n"
+" :arg edges: The edges to separated.\n"
+" :type edges: :class:`bmesh.types.BMEdge`\n"
+" :return: The newly separated verts (including the vertex passed).\n"
+" :rtype: tuple of :class:`bmesh.types.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, BM_EDGE,
+ 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"
@@ -203,9 +266,9 @@ PyDoc_STRVAR(bpy_bm_utils_edge_split_doc,
" Split an edge, return the newly created data.\n"
"\n"
" :arg edge: The edge to split.\n"
-" :type edge: :class:`BMEdge`\n"
+" :type edge: :class:`bmesh.types.BMEdge`\n"
" :arg vert: One of the verts on the edge, defines the split direction.\n"
-" :type vert: :class:`BMVert`\n"
+" :type vert: :class:`bmesh.types.BMVert`\n"
" :arg fac: The point on the edge where the new vert will be created [0 - 1].\n"
" :type fac: float\n"
" :return: The newly created (edge, vert) pair.\n"
@@ -266,11 +329,11 @@ PyDoc_STRVAR(bpy_bm_utils_edge_rotate_doc,
" If rotating the edge fails, None will be returned.\n"
"\n"
" :arg edge: The edge to rotate.\n"
-" :type edge: :class:`BMEdge`\n"
+" :type edge: :class:`bmesh.types.BMEdge`\n"
" :arg ccw: When True the edge will be rotated counter clockwise.\n"
" :type ccw: boolean\n"
" :return: The newly rotated edge.\n"
-" :rtype: :class:`BMEdge`\n"
+" :rtype: :class:`bmesh.types.BMEdge`\n"
);
static PyObject *bpy_bm_utils_edge_rotate(PyObject *UNUSED(self), PyObject *args)
{
@@ -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);
@@ -308,13 +371,13 @@ PyDoc_STRVAR(bpy_bm_utils_face_split_doc,
" Split an edge, return the newly created data.\n"
"\n"
" :arg face: The face to cut.\n"
-" :type face: :class:`BMFace`\n"
+" :type face: :class:`bmesh.types.BMFace`\n"
" :arg vert_a: First vertex to cut in the face (face must contain the vert).\n"
-" :type vert_a: :class:`BMVert`\n"
+" :type vert_a: :class:`bmesh.types.BMVert`\n"
" :arg vert_b: Second vertex to cut in the face (face must contain the vert).\n"
-" :type vert_b: :class:`BMVert`\n"
+" :type vert_b: :class:`bmesh.types.BMVert`\n"
" :arg edge_example: Optional edge argument, newly created edge will copy settings from this one.\n"
-" :type edge_example: :class:`BMEdge`\n"
+" :type edge_example: :class:`bmesh.types.BMEdge`\n"
);
static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args)
{
@@ -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);
@@ -385,9 +448,9 @@ PyDoc_STRVAR(bpy_bm_utils_face_join_doc,
" Joins a sequence of faces.\n"
"\n"
" :arg faces: Sequence of faces.\n"
-" :type faces: :class:`BMFace`\n"
+" :type faces: :class:`bmesh.types.BMFace`\n"
" :return: The newly created face or None on failure.\n"
-" :rtype: :class:`BMFace`\n"
+" :rtype: :class:`bmesh.types.BMFace`\n"
);
static PyObject *bpy_bm_utils_face_join(PyObject *UNUSED(self), PyObject *value)
{
@@ -397,7 +460,7 @@ static PyObject *bpy_bm_utils_face_join(PyObject *UNUSED(self), PyObject *value)
BMFace *f_new;
face_array = BPy_BMElem_PySeq_As_Array(&bm, value, 2, PY_SSIZE_T_MAX,
- &face_seq_len, &BPy_BMFace_Type,
+ &face_seq_len, BM_FACE,
TRUE, TRUE, "face_join(...)");
if (face_array == NULL) {
@@ -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,13 +482,75 @@ 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:`bmesh.types.BMFace`\n"
+" :arg vert: A vertex in the face to separate.\n"
+" :type vert: :class:`bmesh.types.BMVert`\n"
+" :return vert: The newly created vertex or None of failure.\n"
+" :rtype vert: :class:`bmesh.types.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"
" Flip the faces direction.\n"
"\n"
" :arg face: Face to flip.\n"
-" :type face: :class:`BMFace`\n"
+" :type face: :class:`bmesh.types.BMFace`\n"
);
static PyObject *bpy_bm_utils_face_flip(PyObject *UNUSED(self), BPy_BMFace *value)
{
@@ -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:`bmesh.types.BMFace`\n"
+" :return vert: The newly created vertex or None of failure.\n"
+" :rtype vert: :class:`bmesh.types.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.c b/source/blender/python/generic/bgl.c
index e32444976dd..3d695e4b270 100644
--- a/source/blender/python/generic/bgl.c
+++ b/source/blender/python/generic/bgl.c
@@ -56,16 +56,16 @@ static PyObject *Buffer_subscript(Buffer *self, PyObject *item);
static int Buffer_ass_subscript(Buffer *self, PyObject *item, PyObject *value);
static PySequenceMethods Buffer_SeqMethods = {
- (lenfunc) Buffer_len, /*sq_length */
- (binaryfunc) NULL, /*sq_concat */
- (ssizeargfunc) NULL, /*sq_repeat */
- (ssizeargfunc) Buffer_item, /*sq_item */
- (ssizessizeargfunc) NULL, /*sq_slice, deprecated, handled in Buffer_item */
- (ssizeobjargproc) Buffer_ass_item, /*sq_ass_item */
- (ssizessizeobjargproc) NULL, /*sq_ass_slice, deprecated handled in Buffer_ass_item */
- (objobjproc) NULL, /* sq_contains */
- (binaryfunc) NULL, /* sq_inplace_concat */
- (ssizeargfunc) NULL, /* sq_inplace_repeat */
+ (lenfunc) Buffer_len, /*sq_length */
+ (binaryfunc) NULL, /*sq_concat */
+ (ssizeargfunc) NULL, /*sq_repeat */
+ (ssizeargfunc) Buffer_item, /*sq_item */
+ (ssizessizeargfunc) NULL, /*sq_slice, deprecated, handled in Buffer_item */
+ (ssizeobjargproc) Buffer_ass_item, /*sq_ass_item */
+ (ssizessizeobjargproc) NULL, /*sq_ass_slice, deprecated handled in Buffer_ass_item */
+ (objobjproc) NULL, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
};
@@ -80,10 +80,10 @@ static PyObject *Buffer_repr(Buffer *self);
static PyObject *Buffer_to_list(Buffer *self)
{
- int i, len= self->dimensions[0];
- PyObject *list= PyList_New(len);
+ int i, len = self->dimensions[0];
+ PyObject *list = PyList_New(len);
- for (i=0; i<len; i++) {
+ for (i = 0; i < len; i++) {
PyList_SET_ITEM(list, i, Buffer_item(self, i));
}
@@ -95,17 +95,17 @@ static PyObject *Buffer_to_list_recursive(Buffer *self)
PyObject *list;
if (self->ndimensions > 1) {
- int i, len= self->dimensions[0];
- list= PyList_New(len);
+ int i, len = self->dimensions[0];
+ list = PyList_New(len);
- for (i=0; i<len; i++) {
- Buffer *sub= (Buffer *)Buffer_item(self, i);
+ for (i = 0; i < len; i++) {
+ Buffer *sub = (Buffer *)Buffer_item(self, i);
PyList_SET_ITEM(list, i, Buffer_to_list_recursive(sub));
Py_DECREF(sub);
}
}
else {
- list= Buffer_to_list(self);
+ list = Buffer_to_list(self);
}
return list;
@@ -113,10 +113,10 @@ static PyObject *Buffer_to_list_recursive(Buffer *self)
static PyObject *Buffer_dimensions(Buffer *self, void *UNUSED(arg))
{
- PyObject *list= PyList_New(self->ndimensions);
+ PyObject *list = PyList_New(self->ndimensions);
int i;
- for (i= 0; i<self->ndimensions; i++) {
+ for (i = 0; i < self->ndimensions; i++) {
PyList_SET_ITEM(list, i, PyLong_FromLong(self->dimensions[i]));
}
@@ -125,13 +125,13 @@ static PyObject *Buffer_dimensions(Buffer *self, void *UNUSED(arg))
static PyMethodDef Buffer_methods[] = {
{"to_list", (PyCFunction)Buffer_to_list_recursive, METH_NOARGS,
- "return the buffer as a list"},
+ "return the buffer as a list"},
{NULL, NULL, 0, NULL}
};
static PyGetSetDef Buffer_getseters[] = {
{(char *)"dimensions", (getter)Buffer_dimensions, NULL, NULL, NULL},
- {NULL, NULL, NULL, NULL, NULL}
+ {NULL, NULL, NULL, NULL, NULL}
};
@@ -144,11 +144,11 @@ PyTypeObject BGL_bufferType = {
(printfunc)NULL, /*tp_print */
NULL, /*tp_getattr */
NULL, /*tp_setattr */
- NULL, /*tp_compare */
- (reprfunc) Buffer_repr, /*tp_repr */
- NULL, /*tp_as_number */
- &Buffer_SeqMethods, /*tp_as_sequence */
- &Buffer_AsMapping, /* PyMappingMethods *tp_as_mapping; */
+ NULL, /*tp_compare */
+ (reprfunc) Buffer_repr, /*tp_repr */
+ NULL, /*tp_as_number */
+ &Buffer_SeqMethods, /*tp_as_sequence */
+ &Buffer_AsMapping, /* PyMappingMethods *tp_as_mapping; */
/* More standard operations (here for binary compatibility) */
@@ -187,22 +187,22 @@ PyTypeObject BGL_bufferType = {
Buffer_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
Buffer_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /*tp_base*/
- NULL, /*tp_dict*/
- NULL, /*tp_descr_get*/
- NULL, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- NULL, /*tp_init*/
- NULL, /*tp_alloc*/
- Buffer_new, /*tp_new*/
- NULL, /*tp_free*/
- NULL, /*tp_is_gc*/
- NULL, /*tp_bases*/
- NULL, /*tp_mro*/
- NULL, /*tp_cache*/
- NULL, /*tp_subclasses*/
- NULL, /*tp_weaklist*/
- NULL /*tp_del*/
+ NULL, /*tp_base*/
+ NULL, /*tp_dict*/
+ NULL, /*tp_descr_get*/
+ NULL, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ NULL, /*tp_init*/
+ NULL, /*tp_alloc*/
+ Buffer_new, /*tp_new*/
+ NULL, /*tp_free*/
+ NULL, /*tp_is_gc*/
+ NULL, /*tp_bases*/
+ NULL, /*tp_mro*/
+ NULL, /*tp_cache*/
+ NULL, /*tp_subclasses*/
+ NULL, /*tp_weaklist*/
+ NULL /*tp_del*/
};
#define BGL_Wrap(nargs, funcname, ret, arg_list) \
@@ -239,16 +239,16 @@ static PyObject *Method_##funcname (PyObject *UNUSED(self), PyObject *args) \
int BGL_typeSize(int type)
{
switch (type) {
- case GL_BYTE:
- return sizeof(char);
- case GL_SHORT:
- return sizeof(short);
- case GL_INT:
- return sizeof(int);
- case GL_FLOAT:
- return sizeof(float);
- case GL_DOUBLE:
- return sizeof(double);
+ case GL_BYTE:
+ return sizeof(char);
+ case GL_SHORT:
+ return sizeof(short);
+ case GL_INT:
+ return sizeof(int);
+ case GL_FLOAT:
+ return sizeof(float);
+ case GL_DOUBLE:
+ return sizeof(double);
}
return -1;
}
@@ -256,42 +256,43 @@ int BGL_typeSize(int type)
Buffer *BGL_MakeBuffer(int type, int ndimensions, int *dimensions, void *initbuffer)
{
Buffer *buffer;
- void *buf= NULL;
+ void *buf = NULL;
int i, size, length;
-
- length= 1;
- for (i=0; i<ndimensions; i++)
- length*= dimensions[i];
-
- size= BGL_typeSize(type);
-
- buf= MEM_mallocN(length*size, "Buffer buffer");
-
- buffer= (Buffer *) PyObject_NEW(Buffer, &BGL_bufferType);
- buffer->parent= NULL;
- buffer->ndimensions= ndimensions;
- buffer->dimensions= MEM_mallocN(ndimensions*sizeof(int), "Buffer dimensions");
- memcpy(buffer->dimensions, dimensions, ndimensions*sizeof(int));
- buffer->type= type;
- buffer->buf.asvoid= buf;
+
+ length = 1;
+ for (i = 0; i < ndimensions; i++) {
+ length *= dimensions[i];
+ }
+
+ size = BGL_typeSize(type);
+
+ buf = MEM_mallocN(length * size, "Buffer buffer");
+
+ buffer = (Buffer *)PyObject_NEW(Buffer, &BGL_bufferType);
+ buffer->parent = NULL;
+ buffer->ndimensions = ndimensions;
+ buffer->dimensions = MEM_mallocN(ndimensions * sizeof(int), "Buffer dimensions");
+ memcpy(buffer->dimensions, dimensions, ndimensions * sizeof(int));
+ buffer->type = type;
+ buffer->buf.asvoid = buf;
if (initbuffer) {
- memcpy(buffer->buf.asvoid, initbuffer, length*size);
+ memcpy(buffer->buf.asvoid, initbuffer, length * size);
}
else {
- memset(buffer->buf.asvoid, 0, length*size);
+ memset(buffer->buf.asvoid, 0, length * size);
}
return buffer;
}
-#define MAX_DIMENSIONS 256
+#define MAX_DIMENSIONS 256
static PyObject *Buffer_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds)
{
- PyObject *length_ob= NULL, *init= NULL;
+ PyObject *length_ob = NULL, *init = NULL;
Buffer *buffer;
int dimensions[MAX_DIMENSIONS];
-
+
int type;
Py_ssize_t i, ndimensions = 0;
@@ -312,15 +313,15 @@ static PyObject *Buffer_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject
}
if (PyLong_Check(length_ob)) {
- ndimensions= 1;
- if (((dimensions[0]= PyLong_AsLong(length_ob)) < 1)) {
+ ndimensions = 1;
+ if (((dimensions[0] = PyLong_AsLong(length_ob)) < 1)) {
PyErr_SetString(PyExc_AttributeError,
"dimensions must be between 1 and "STRINGIFY(MAX_DIMENSIONS));
return NULL;
}
}
else if (PySequence_Check(length_ob)) {
- ndimensions= PySequence_Size(length_ob);
+ ndimensions = PySequence_Size(length_ob);
if (ndimensions > MAX_DIMENSIONS) {
PyErr_SetString(PyExc_AttributeError,
"too many dimensions, max is "STRINGIFY(MAX_DIMENSIONS));
@@ -331,11 +332,13 @@ static PyObject *Buffer_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject
"sequence must have at least one dimension");
return NULL;
}
- for (i=0; i<ndimensions; i++) {
- PyObject *ob= PySequence_GetItem(length_ob, i);
+ for (i = 0; i < ndimensions; i++) {
+ PyObject *ob = PySequence_GetItem(length_ob, i);
- if (!PyLong_Check(ob)) dimensions[i]= 1;
- else dimensions[i]= PyLong_AsLong(ob);
+ if (!PyLong_Check(ob))
+ dimensions[i] = 1;
+ else
+ dimensions[i] = PyLong_AsLong(ob);
Py_DECREF(ob);
if (dimensions[i] < 1) {
@@ -351,16 +354,16 @@ static PyObject *Buffer_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject
"or an int, not a %.200s", Py_TYPE(length_ob)->tp_name);
return NULL;
}
-
- buffer= BGL_MakeBuffer(type, ndimensions, dimensions, NULL);
+
+ buffer = BGL_MakeBuffer(type, ndimensions, dimensions, NULL);
if (init && ndimensions) {
if (Buffer_ass_slice(buffer, 0, dimensions[0], init)) {
Py_DECREF(buffer);
return NULL;
}
}
-
- return (PyObject *) buffer;
+
+ return (PyObject *)buffer;
}
/*@ Buffer sequence methods */
@@ -377,12 +380,12 @@ static PyObject *Buffer_item(Buffer *self, int i)
return NULL;
}
- if (self->ndimensions==1) {
+ if (self->ndimensions == 1) {
switch (self->type) {
- case GL_BYTE: return Py_BuildValue("b", self->buf.asbyte[i]);
- case GL_SHORT: return Py_BuildValue("h", self->buf.asshort[i]);
- case GL_INT: return Py_BuildValue("i", self->buf.asint[i]);
- case GL_FLOAT: return PyFloat_FromDouble(self->buf.asfloat[i]);
+ case GL_BYTE: return Py_BuildValue("b", self->buf.asbyte[i]);
+ case GL_SHORT: return Py_BuildValue("h", self->buf.asshort[i]);
+ case GL_INT: return Py_BuildValue("i", self->buf.asint[i]);
+ case GL_FLOAT: return PyFloat_FromDouble(self->buf.asfloat[i]);
case GL_DOUBLE: return Py_BuildValue("d", self->buf.asdouble[i]);
}
}
@@ -390,26 +393,24 @@ static PyObject *Buffer_item(Buffer *self, int i)
Buffer *newbuf;
int j, length, size;
- length= 1;
- for (j=1; j < self->ndimensions; j++) {
+ length = 1;
+ for (j = 1; j < self->ndimensions; j++) {
length *= self->dimensions[j];
}
- size= BGL_typeSize(self->type);
+ size = BGL_typeSize(self->type);
- newbuf= (Buffer *) PyObject_NEW(Buffer, &BGL_bufferType);
+ newbuf = (Buffer *)PyObject_NEW(Buffer, &BGL_bufferType);
Py_INCREF(self);
- newbuf->parent= (PyObject *)self;
+ newbuf->parent = (PyObject *)self;
- newbuf->ndimensions= self->ndimensions - 1;
- newbuf->type= self->type;
- newbuf->buf.asvoid= self->buf.asbyte + i*length*size;
- newbuf->dimensions= MEM_mallocN(newbuf->ndimensions*sizeof(int),
- "Buffer dimensions");
- memcpy(newbuf->dimensions, self->dimensions+1,
- newbuf->ndimensions*sizeof(int));
+ newbuf->ndimensions = self->ndimensions - 1;
+ newbuf->type = self->type;
+ newbuf->buf.asvoid = self->buf.asbyte + i * length * size;
+ newbuf->dimensions = MEM_mallocN(newbuf->ndimensions * sizeof(int), "Buffer dimensions");
+ memcpy(newbuf->dimensions, self->dimensions + 1, newbuf->ndimensions * sizeof(int));
- return (PyObject *) newbuf;
+ return (PyObject *)newbuf;
}
return NULL;
@@ -420,14 +421,14 @@ static PyObject *Buffer_slice(Buffer *self, int begin, int end)
PyObject *list;
int count;
- if (begin < 0) begin= 0;
- if (end > self->dimensions[0]) end= self->dimensions[0];
- if (begin > end) begin= end;
+ if (begin < 0) begin = 0;
+ if (end > self->dimensions[0]) end = self->dimensions[0];
+ if (begin > end) begin = end;
- list= PyList_New(end-begin);
+ list = PyList_New(end - begin);
- for (count= begin; count<end; count++) {
- PyList_SET_ITEM(list, count-begin, Buffer_item(self, count));
+ for (count = begin; count < end; count++) {
+ PyList_SET_ITEM(list, count - begin, Buffer_item(self, count));
}
return list;
}
@@ -440,11 +441,11 @@ static int Buffer_ass_item(Buffer *self, int i, PyObject *v)
return -1;
}
- if (self->ndimensions!=1) {
- Buffer *row= (Buffer *)Buffer_item(self, i);
+ if (self->ndimensions != 1) {
+ Buffer *row = (Buffer *)Buffer_item(self, i);
if (row) {
- int ret= Buffer_ass_slice(row, 0, self->dimensions[1], v);
+ int ret = Buffer_ass_slice(row, 0, self->dimensions[1], v);
Py_DECREF(row);
return ret;
}
@@ -454,29 +455,23 @@ static int Buffer_ass_item(Buffer *self, int i, PyObject *v)
}
switch (self->type) {
- case GL_BYTE:
- return PyArg_Parse(v, "b:Expected ints", &self->buf.asbyte[i]) ? 0:-1;
- case GL_SHORT:
- return PyArg_Parse(v, "h:Expected ints", &self->buf.asshort[i]) ? 0:-1;
- case GL_INT:
- return PyArg_Parse(v, "i:Expected ints", &self->buf.asint[i]) ? 0:-1;
- case GL_FLOAT:
- return PyArg_Parse(v, "f:Expected floats", &self->buf.asfloat[i]) ? 0:-1;
- case GL_DOUBLE:
- return PyArg_Parse(v, "d:Expected floats", &self->buf.asdouble[i]) ? 0:-1;
- default:
- return 0; /* should never happen */
+ case GL_BYTE: return PyArg_Parse(v, "b:Expected ints", &self->buf.asbyte[i]) ? 0 : -1;
+ case GL_SHORT: return PyArg_Parse(v, "h:Expected ints", &self->buf.asshort[i]) ? 0 : -1;
+ case GL_INT: return PyArg_Parse(v, "i:Expected ints", &self->buf.asint[i]) ? 0 : -1;
+ case GL_FLOAT: return PyArg_Parse(v, "f:Expected floats", &self->buf.asfloat[i]) ? 0 : -1;
+ case GL_DOUBLE: return PyArg_Parse(v, "d:Expected floats", &self->buf.asdouble[i]) ? 0 : -1;
+ default: return 0; /* should never happen */
}
}
static int Buffer_ass_slice(Buffer *self, int begin, int end, PyObject *seq)
{
PyObject *item;
- int count, err=0;
+ int count, err = 0;
- if (begin < 0) begin= 0;
- if (end > self->dimensions[0]) end= self->dimensions[0];
- if (begin > end) begin= end;
+ if (begin < 0) begin = 0;
+ if (end > self->dimensions[0]) end = self->dimensions[0];
+ if (begin > end) begin = end;
if (!PySequence_Check(seq)) {
PyErr_Format(PyExc_TypeError,
@@ -487,23 +482,25 @@ static int Buffer_ass_slice(Buffer *self, int begin, int end, PyObject *seq)
}
/* re-use count var */
- if ((count= PySequence_Size(seq)) != (end - begin)) {
+ if ((count = PySequence_Size(seq)) != (end - begin)) {
PyErr_Format(PyExc_TypeError,
"buffer[:] = value, size mismatch in assignment. "
"Expected: %d (given: %d)", count, end - begin);
return -1;
}
- for (count= begin; count < end; count++) {
- item= PySequence_GetItem(seq, count - begin);
+ for (count = begin; count < end; count++) {
+ item = PySequence_GetItem(seq, count - begin);
if (item) {
- err= Buffer_ass_item(self, count, item);
+ err = Buffer_ass_item(self, count, item);
Py_DECREF(item);
}
else {
- err= -1;
+ err = -1;
+ }
+ if (err) {
+ break;
}
- if (err) break;
}
return err;
}
@@ -580,8 +577,12 @@ static int Buffer_ass_subscript(Buffer *self, PyObject *item, PyObject *value)
static void Buffer_dealloc(Buffer *self)
{
- if (self->parent) Py_DECREF(self->parent);
- else MEM_freeN (self->buf.asvoid);
+ if (self->parent) {
+ Py_DECREF(self->parent);
+ }
+ else {
+ MEM_freeN(self->buf.asvoid);
+ }
MEM_freeN(self->dimensions);
@@ -591,19 +592,20 @@ static void Buffer_dealloc(Buffer *self)
static PyObject *Buffer_repr(Buffer *self)
{
- PyObject *list= Buffer_to_list_recursive(self);
+ PyObject *list = Buffer_to_list_recursive(self);
PyObject *repr;
- const char *typestr= "UNKNOWN";
+ const char *typestr;
switch (self->type) {
- case GL_BYTE: typestr= "GL_BYTE"; break;
- case GL_SHORT: typestr= "GL_SHORT"; break;
- case GL_INT: typestr= "GL_BYTE"; break;
- case GL_FLOAT: typestr= "GL_FLOAT"; break;
- case GL_DOUBLE: typestr= "GL_DOUBLE"; break;
+ case GL_BYTE: typestr = "GL_BYTE"; break;
+ case GL_SHORT: typestr = "GL_SHORT"; break;
+ case GL_INT: typestr = "GL_BYTE"; break;
+ case GL_FLOAT: typestr = "GL_FLOAT"; break;
+ case GL_DOUBLE: typestr = "GL_DOUBLE"; break;
+ default: typestr = "UNKNOWN"; break;
}
- repr= PyUnicode_FromFormat("Buffer(%s, %R)", typestr, list);
+ repr = PyUnicode_FromFormat("Buffer(%s, %R)", typestr, list);
Py_DECREF(list);
return repr;
@@ -616,7 +618,7 @@ BGL_Wrap(3, AreTexturesResident, GLboolean, (GLsizei, GLuintP, GLbooleanP))
BGL_Wrap(1, Begin, void, (GLenum))
BGL_Wrap(2, BindTexture, void, (GLenum, GLuint))
BGL_Wrap(7, Bitmap, void, (GLsizei, GLsizei, GLfloat,
- GLfloat, GLfloat, GLfloat, GLubyteP))
+ GLfloat, GLfloat, GLfloat, GLubyteP))
BGL_Wrap(2, BlendFunc, void, (GLenum, GLenum))
BGL_Wrap(1, CallList, void, (GLuint))
BGL_Wrap(3, CallLists, void, (GLsizei, GLenum, GLvoidP))
@@ -698,7 +700,7 @@ BGL_Wrap(2, Fogi, void, (GLenum, GLint))
BGL_Wrap(2, Fogiv, void, (GLenum, GLintP))
BGL_Wrap(1, FrontFace, void, (GLenum))
BGL_Wrap(6, Frustum, void, (GLdouble, GLdouble,
- GLdouble, GLdouble, GLdouble, GLdouble))
+ GLdouble, GLdouble, GLdouble, GLdouble))
BGL_Wrap(1, GenLists, GLuint, (GLsizei))
BGL_Wrap(2, GenTextures, void, (GLsizei, GLuintP))
BGL_Wrap(2, GetBooleanv, void, (GLenum, GLbooleanP))
@@ -717,7 +719,7 @@ BGL_Wrap(3, GetMaterialiv, void, (GLenum, GLenum, GLintP))
BGL_Wrap(2, GetPixelMapfv, void, (GLenum, GLfloatP))
BGL_Wrap(2, GetPixelMapuiv, void, (GLenum, GLuintP))
BGL_Wrap(2, GetPixelMapusv, void, (GLenum, GLushortP))
-BGL_Wrap(1, GetPolygonStipple,void, (GLubyteP))
+BGL_Wrap(1, GetPolygonStipple, void, (GLubyteP))
BGL_Wrap(1, GetString, GLstring, (GLenum))
BGL_Wrap(3, GetTexEnvfv, void, (GLenum, GLenum, GLfloatP))
BGL_Wrap(3, GetTexEnviv, void, (GLenum, GLenum, GLintP))
@@ -760,19 +762,19 @@ BGL_Wrap(1, LoadMatrixf, void, (GLfloatP))
BGL_Wrap(1, LoadName, void, (GLuint))
BGL_Wrap(1, LogicOp, void, (GLenum))
BGL_Wrap(6, Map1d, void, (GLenum, GLdouble, GLdouble,
- GLint, GLint, GLdoubleP))
+ GLint, GLint, GLdoubleP))
BGL_Wrap(6, Map1f, void, (GLenum, GLfloat, GLfloat,
- GLint, GLint, GLfloatP))
+ GLint, GLint, GLfloatP))
BGL_Wrap(10, Map2d, void, (GLenum, GLdouble, GLdouble,
- GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdoubleP))
+ GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdoubleP))
BGL_Wrap(10, Map2f, void, (GLenum, GLfloat, GLfloat,
- GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloatP))
+ GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloatP))
BGL_Wrap(3, MapGrid1d, void, (GLint, GLdouble, GLdouble))
BGL_Wrap(3, MapGrid1f, void, (GLint, GLfloat, GLfloat))
BGL_Wrap(6, MapGrid2d, void, (GLint, GLdouble, GLdouble,
- GLint, GLdouble, GLdouble))
+ GLint, GLdouble, GLdouble))
BGL_Wrap(6, MapGrid2f, void, (GLint, GLfloat, GLfloat,
- GLint, GLfloat, GLfloat))
+ GLint, GLfloat, GLfloat))
BGL_Wrap(3, Materialf, void, (GLenum, GLenum, GLfloat))
BGL_Wrap(3, Materialfv, void, (GLenum, GLenum, GLfloatP))
BGL_Wrap(3, Materiali, void, (GLenum, GLenum, GLint))
@@ -792,7 +794,7 @@ BGL_Wrap(1, Normal3iv, void, (GLintP))
BGL_Wrap(3, Normal3s, void, (GLshort, GLshort, GLshort))
BGL_Wrap(1, Normal3sv, void, (GLshortP))
BGL_Wrap(6, Ortho, void, (GLdouble, GLdouble,
- GLdouble, GLdouble, GLdouble, GLdouble))
+ GLdouble, GLdouble, GLdouble, GLdouble))
BGL_Wrap(1, PassThrough, void, (GLfloat))
BGL_Wrap(3, PixelMapfv, void, (GLenum, GLint, GLfloatP))
BGL_Wrap(3, PixelMapuiv, void, (GLenum, GLint, GLuintP))
@@ -841,7 +843,7 @@ BGL_Wrap(4, RasterPos4s, void, (GLshort, GLshort, GLshort, GLshort))
BGL_Wrap(1, RasterPos4sv, void, (GLshortP))
BGL_Wrap(1, ReadBuffer, void, (GLenum))
BGL_Wrap(7, ReadPixels, void, (GLint, GLint, GLsizei,
- GLsizei, GLenum, GLenum, GLvoidP))
+ GLsizei, GLenum, GLenum, GLvoidP))
BGL_Wrap(4, Rectd, void, (GLdouble, GLdouble, GLdouble, GLdouble))
BGL_Wrap(2, Rectdv, void, (GLdoubleP, GLdoubleP))
BGL_Wrap(4, Rectf, void, (GLfloat, GLfloat, GLfloat, GLfloat))
@@ -904,9 +906,9 @@ BGL_Wrap(3, TexGenfv, void, (GLenum, GLenum, GLfloatP))
BGL_Wrap(3, TexGeni, void, (GLenum, GLenum, GLint))
BGL_Wrap(3, TexGeniv, void, (GLenum, GLenum, GLintP))
BGL_Wrap(8, TexImage1D, void, (GLenum, GLint, GLint,
- GLsizei, GLint, GLenum, GLenum, GLvoidP))
+ GLsizei, GLint, GLenum, GLenum, GLvoidP))
BGL_Wrap(9, TexImage2D, void, (GLenum, GLint, GLint,
- GLsizei, GLsizei, GLint, GLenum, GLenum, GLvoidP))
+ GLsizei, GLsizei, GLint, GLenum, GLenum, GLvoidP))
BGL_Wrap(3, TexParameterf, void, (GLenum, GLenum, GLfloat))
BGL_Wrap(3, TexParameterfv, void, (GLenum, GLenum, GLfloatP))
BGL_Wrap(3, TexParameteri, void, (GLenum, GLenum, GLint))
@@ -938,12 +940,12 @@ BGL_Wrap(1, Vertex4iv, void, (GLintP))
BGL_Wrap(4, Vertex4s, void, (GLshort, GLshort, GLshort, GLshort))
BGL_Wrap(1, Vertex4sv, void, (GLshortP))
BGL_Wrap(4, Viewport, void, (GLint, GLint, GLsizei, GLsizei))
-BGLU_Wrap(4, Perspective, void, (GLdouble, GLdouble, GLdouble, GLdouble))
-BGLU_Wrap(9, LookAt, void, (GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble))
-BGLU_Wrap(4, Ortho2D, void, (GLdouble, GLdouble, GLdouble, GLdouble))
-BGLU_Wrap(5, PickMatrix, void, (GLdouble, GLdouble, GLdouble, GLdouble, GLintP))
-BGLU_Wrap(9, Project, GLint, (GLdouble, GLdouble, GLdouble, GLdoubleP, GLdoubleP, GLintP, GLdoubleP, GLdoubleP, GLdoubleP))
-BGLU_Wrap(9, UnProject, GLint, (GLdouble, GLdouble, GLdouble, GLdoubleP, GLdoubleP, GLintP, GLdoubleP, GLdoubleP, GLdoubleP))
+BGLU_Wrap(4, Perspective, void, (GLdouble, GLdouble, GLdouble, GLdouble))
+BGLU_Wrap(9, LookAt, void, (GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble))
+BGLU_Wrap(4, Ortho2D, void, (GLdouble, GLdouble, GLdouble, GLdouble))
+BGLU_Wrap(5, PickMatrix, void, (GLdouble, GLdouble, GLdouble, GLdouble, GLintP))
+BGLU_Wrap(9, Project, GLint, (GLdouble, GLdouble, GLdouble, GLdoubleP, GLdoubleP, GLintP, GLdoubleP, GLdoubleP, GLdoubleP))
+BGLU_Wrap(9, UnProject, GLint, (GLdouble, GLdouble, GLdouble, GLdoubleP, GLdoubleP, GLintP, GLdoubleP, GLdoubleP, GLdoubleP))
#undef MethodDef
#define MethodDef(func) {"gl"#func, Method_##func, METH_VARARGS, "no string"}
@@ -1296,21 +1298,20 @@ static struct PyModuleDef BGL_module_def = {
PyObject *BPyInit_bgl(void)
{
PyObject *submodule, *dict, *item;
- submodule= PyModule_Create(&BGL_module_def);
- dict= PyModule_GetDict(submodule);
-
- if (PyType_Ready(&BGL_bufferType) < 0)
- return NULL; /* should never happen */
+ submodule = PyModule_Create(&BGL_module_def);
+ dict = PyModule_GetDict(submodule);
+ if (PyType_Ready(&BGL_bufferType) < 0)
+ return NULL; /* should never happen */
PyModule_AddObject(submodule, "Buffer", (PyObject *)&BGL_bufferType);
Py_INCREF((PyObject *)&BGL_bufferType);
-#define EXPP_ADDCONST(x) PyDict_SetItemString(dict, #x, item=PyLong_FromLong((int)x)); Py_DECREF(item)
+#define EXPP_ADDCONST(x) PyDict_SetItemString(dict, #x, item = PyLong_FromLong((int)x)); Py_DECREF(item)
/* So, for example:
* EXPP_ADDCONST(GL_CURRENT_BIT) becomes
- * PyDict_SetItemString(dict, "GL_CURRENT_BIT", item=PyLong_FromLong(GL_CURRENT_BIT)); Py_DECREF(item) */
+ * PyDict_SetItemString(dict, "GL_CURRENT_BIT", item = PyLong_FromLong(GL_CURRENT_BIT)); Py_DECREF(item) */
EXPP_ADDCONST(GL_CURRENT_BIT);
EXPP_ADDCONST(GL_POINT_BIT);
@@ -1795,4 +1796,3 @@ PyObject *BPyInit_bgl(void)
return submodule;
}
-
diff --git a/source/blender/python/generic/bgl.h b/source/blender/python/generic/bgl.h
index e23f4c2e86d..1a7036daf45 100644
--- a/source/blender/python/generic/bgl.h
+++ b/source/blender/python/generic/bgl.h
@@ -44,10 +44,10 @@ PyObject *BPyInit_bgl(void);
/*@ Create a buffer object */
/*@ dimensions is an array of ndimensions integers representing the size of each dimension */
/*@ initbuffer if not NULL holds a contiguous buffer with the correct format from which the buffer will be initialized */
-struct _Buffer *BGL_MakeBuffer( int type, int ndimensions, int *dimensions, void *initbuffer );
+struct _Buffer *BGL_MakeBuffer(int type, int ndimensions, int *dimensions, void *initbuffer);
/*@ Return the size of buffer element, type must be one of GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT or GL_DOUBLE */
/*@ returns -1 otherwise */
-int BGL_typeSize( int type );
+int BGL_typeSize(int type);
/*@ Buffer Object */
/*@ For Python access to OpenGL functions requiring a pointer. */
@@ -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 */
@@ -312,23 +312,23 @@ extern PyTypeObject BGL_bufferType;
#define ret_ret_void return Py_INCREF(Py_None), Py_None
#define ret_def_GLint int ret_int
-#define ret_set_GLint ret_int=
+#define ret_set_GLint ret_int =
#define ret_ret_GLint return PyLong_FromLong(ret_int)
#define ret_def_GLuint unsigned int ret_uint
-#define ret_set_GLuint ret_uint=
+#define ret_set_GLuint ret_uint =
#define ret_ret_GLuint return PyLong_FromLong((long) ret_uint)
#define ret_def_GLenum unsigned int ret_uint
-#define ret_set_GLenum ret_uint=
+#define ret_set_GLenum ret_uint =
#define ret_ret_GLenum return PyLong_FromLong((long) ret_uint)
#define ret_def_GLboolean unsigned char ret_bool
-#define ret_set_GLboolean ret_bool=
+#define ret_set_GLboolean ret_bool =
#define ret_ret_GLboolean return PyLong_FromLong((long) ret_bool)
-#define ret_def_GLstring const unsigned char *ret_str;
-#define ret_set_GLstring ret_str=
+#define ret_def_GLstring const unsigned char *ret_str
+#define ret_set_GLstring ret_str =
#define ret_ret_GLstring \
if (ret_str) { \
diff --git a/source/blender/python/generic/blf_py_api.c b/source/blender/python/generic/blf_py_api.c
index a4373e46e23..5b5438defee 100644
--- a/source/blender/python/generic/blf_py_api.c
+++ b/source/blender/python/generic/blf_py_api.c
@@ -182,7 +182,7 @@ static PyObject *py_blf_dimensions(PyObject *UNUSED(self), PyObject *args)
BLF_width_and_height(fontid, text, &r_width, &r_height);
- ret= PyTuple_New(2);
+ ret = PyTuple_New(2);
PyTuple_SET_ITEM(ret, 0, PyFloat_FromDouble(r_width));
PyTuple_SET_ITEM(ret, 1, PyFloat_FromDouble(r_height));
return ret;
@@ -356,7 +356,7 @@ PyDoc_STRVAR(py_blf_load_doc,
);
static PyObject *py_blf_load(PyObject *UNUSED(self), PyObject *args)
{
- char* filename;
+ char *filename;
if (!PyArg_ParseTuple(args, "s:blf.load", &filename))
return NULL;
@@ -374,7 +374,7 @@ PyDoc_STRVAR(py_blf_unload_doc,
);
static PyObject *py_blf_unload(PyObject *UNUSED(self), PyObject *args)
{
- char* filename;
+ char *filename;
if (!PyArg_ParseTuple(args, "s:blf.unload", &filename))
return NULL;
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c
index ecf65275483..ad97d741f9b 100644
--- a/source/blender/python/generic/bpy_internal_import.c
+++ b/source/blender/python/generic/bpy_internal_import.c
@@ -47,7 +47,7 @@
#include "BLI_string.h"
#include "BLI_utildefines.h"
- /* UNUSED */
+/* UNUSED */
#include "BKE_text.h" /* txt_to_buf */
#include "BKE_main.h"
@@ -101,7 +101,7 @@ void bpy_text_filename_get(char *fn, size_t fn_len, Text *text)
PyObject *bpy_text_import(Text *text)
{
char *buf = NULL;
- char modulename[MAX_ID_NAME+2];
+ char modulename[MAX_ID_NAME + 2];
int len;
if (!text->compiled) {
@@ -244,12 +244,12 @@ 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);
- if (newmodule) {/* found module as blender text, ignore above exception */
+ if (newmodule) { /* found module as blender text, ignore above exception */
PyErr_Clear();
Py_XDECREF(exception);
Py_XDECREF(err);
@@ -287,10 +287,10 @@ static PyObject *blender_reload(PyObject *UNUSED(self), PyObject *module)
return newmodule;
/* no file, try importing from memory */
- PyErr_Fetch(&exception, &err, &tb); /*restore for probable later use */
+ PyErr_Fetch(&exception, &err, &tb); /*restore for probable later use */
newmodule = bpy_text_reimport(module, &found);
- if (newmodule) {/* found module as blender text, ignore above exception */
+ if (newmodule) { /* found module as blender text, ignore above exception */
PyErr_Clear();
Py_XDECREF(exception);
Py_XDECREF(err);
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index 4cff5cbca95..63b8d90b510 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -74,21 +74,21 @@ static PyObject *idprop_py_from_idp_int(IDProperty *prop)
static PyObject *idprop_py_from_idp_float(IDProperty *prop)
{
- return PyFloat_FromDouble((double)(*(float*)(&prop->data.val)));
+ return PyFloat_FromDouble((double)(*(float *)(&prop->data.val)));
}
static PyObject *idprop_py_from_idp_double(IDProperty *prop)
{
- return PyFloat_FromDouble((*(double*)(&prop->data.val)));
+ return PyFloat_FromDouble((*(double *)(&prop->data.val)));
}
static PyObject *idprop_py_from_idp_group(ID *id, IDProperty *prop, IDProperty *parent)
{
- BPy_IDProperty *group= PyObject_New(BPy_IDProperty, &BPy_IDGroup_Type);
+ BPy_IDProperty *group = PyObject_New(BPy_IDProperty, &BPy_IDGroup_Type);
group->id = id;
group->prop = prop;
group->parent = parent; /* can be NULL */
- return (PyObject*) group;
+ return (PyObject *)group;
}
static PyObject *idprop_py_from_idp_array(ID *id, IDProperty *prop)
@@ -96,13 +96,13 @@ static PyObject *idprop_py_from_idp_array(ID *id, IDProperty *prop)
BPy_IDProperty *array = PyObject_New(BPy_IDProperty, &BPy_IDArray_Type);
array->id = id;
array->prop = prop;
- return (PyObject*) array;
+ return (PyObject *)array;
}
static PyObject *idprop_py_from_idp_idparray(ID *id, IDProperty *prop)
{
PyObject *seq = PyList_New(prop->len), *wrap;
- IDProperty *array= IDP_IDPArray(prop);
+ IDProperty *array = IDP_IDPArray(prop);
int i;
if (!seq) {
@@ -112,8 +112,8 @@ static PyObject *idprop_py_from_idp_idparray(ID *id, IDProperty *prop)
return NULL;
}
- for (i=0; i<prop->len; i++) {
- wrap= BPy_IDGroup_WrapData(id, array++, prop);
+ for (i = 0; i < prop->len; i++) {
+ wrap = BPy_IDGroup_WrapData(id, array++, prop);
if (!wrap) /* BPy_IDGroup_MapDataToPy sets the error */
return NULL;
@@ -134,28 +134,20 @@ static Py_hash_t BPy_IDGroup_hash(BPy_IDProperty *self)
static PyObject *BPy_IDGroup_repr(BPy_IDProperty *self)
{
- return PyUnicode_FromFormat( "<bpy id property from \"%s\">", self->id->name);
+ return PyUnicode_FromFormat("<bpy id property from \"%s\">", self->id->name);
}
PyObject *BPy_IDGroup_WrapData(ID *id, IDProperty *prop, IDProperty *parent)
{
switch (prop->type) {
- case IDP_STRING:
- return idprop_py_from_idp_string(prop);
- case IDP_INT:
- return idprop_py_from_idp_int(prop);
- case IDP_FLOAT:
- return idprop_py_from_idp_float(prop);
- case IDP_DOUBLE:
- return idprop_py_from_idp_double(prop);
- case IDP_GROUP:
- return idprop_py_from_idp_group(id, prop, parent);
- case IDP_ARRAY:
- return idprop_py_from_idp_array(id, prop);
- case IDP_IDPARRAY: /* this could be better a internal type */
- return idprop_py_from_idp_idparray(id, prop);
- default:
- Py_RETURN_NONE;
+ case IDP_STRING: return idprop_py_from_idp_string(prop);
+ case IDP_INT: return idprop_py_from_idp_int(prop);
+ case IDP_FLOAT: return idprop_py_from_idp_float(prop);
+ case IDP_DOUBLE: return idprop_py_from_idp_double(prop);
+ case IDP_GROUP: return idprop_py_from_idp_group(id, prop, parent);
+ case IDP_ARRAY: return idprop_py_from_idp_array(id, prop);
+ case IDP_IDPARRAY: return idprop_py_from_idp_idparray(id, prop); /* this could be better a internal type */
+ default: Py_RETURN_NONE;
}
}
@@ -174,10 +166,10 @@ static int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject
#ifdef USE_STRING_COERCE
{
int alloc_len;
- PyObject *value_coerce= NULL;
+ PyObject *value_coerce = NULL;
- st= (char *)PyC_UnicodeAsByte(value, &value_coerce);
- alloc_len= strlen(st) + 1;
+ st = (char *)PyC_UnicodeAsByte(value, &value_coerce);
+ alloc_len = strlen(st) + 1;
st = _PyUnicode_AsString(value);
IDP_ResizeArray(prop, alloc_len);
@@ -186,7 +178,7 @@ static int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject
}
#else
st = _PyUnicode_AsString(value);
- IDP_ResizeArray(prop, strlen(st)+1);
+ IDP_ResizeArray(prop, strlen(st) + 1);
strcpy(IDP_Array(prop), st);
#endif
@@ -195,8 +187,8 @@ static int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject
case IDP_INT:
{
- int ivalue= PyLong_AsSsize_t(value);
- if (ivalue==-1 && PyErr_Occurred()) {
+ int ivalue = PyLong_AsSsize_t(value);
+ if (ivalue == -1 && PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError, "expected an int type");
return -1;
}
@@ -205,22 +197,22 @@ static int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject
}
case IDP_FLOAT:
{
- float fvalue= (float)PyFloat_AsDouble(value);
- if (fvalue==-1 && PyErr_Occurred()) {
+ float fvalue = (float)PyFloat_AsDouble(value);
+ if (fvalue == -1 && PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError, "expected a float");
return -1;
}
- *(float*)&self->prop->data.val = fvalue;
+ *(float *)&self->prop->data.val = fvalue;
break;
}
case IDP_DOUBLE:
{
- double dvalue= PyFloat_AsDouble(value);
- if (dvalue==-1 && PyErr_Occurred()) {
+ double dvalue = PyFloat_AsDouble(value);
+ if (dvalue == -1 && PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError, "expected a float");
return -1;
}
- *(double*)&self->prop->data.val = dvalue;
+ *(double *)&self->prop->data.val = dvalue;
break;
}
default:
@@ -266,7 +258,7 @@ static PyObject *BPy_IDGroup_GetType(BPy_IDProperty *self)
static PyGetSetDef BPy_IDGroup_getseters[] = {
{(char *)"name", (getter)BPy_IDGroup_GetName, (setter)BPy_IDGroup_SetName, (char *)"The name of this Group.", NULL},
- {NULL, NULL, NULL, NULL, NULL}
+ {NULL, NULL, NULL, NULL, NULL}
};
static Py_ssize_t BPy_IDGroup_Map_Len(BPy_IDProperty *self)
@@ -289,16 +281,16 @@ static PyObject *BPy_IDGroup_Map_GetItem(BPy_IDProperty *self, PyObject *item)
return NULL;
}
- name= _PyUnicode_AsString(item);
+ name = _PyUnicode_AsString(item);
if (name == NULL) {
PyErr_SetString(PyExc_TypeError, "only strings are allowed as keys of ID properties");
return NULL;
}
- idprop= IDP_GetPropertyFromGroup(self->prop, name);
+ idprop = IDP_GetPropertyFromGroup(self->prop, name);
- if (idprop==NULL) {
+ if (idprop == NULL) {
PyErr_SetString(PyExc_KeyError, "key not in subgroup dict");
return NULL;
}
@@ -306,21 +298,21 @@ static PyObject *BPy_IDGroup_Map_GetItem(BPy_IDProperty *self, PyObject *item)
return BPy_IDGroup_WrapData(self->id, idprop, self->prop);
}
-/*returns NULL on success, error string on failure*/
+/* returns NULL on success, error string on failure */
static int idp_sequence_type(PyObject *seq)
{
PyObject *item;
- int type= IDP_INT;
+ int type = IDP_INT;
Py_ssize_t i, len = PySequence_Size(seq);
- for (i=0; i < len; i++) {
+ for (i = 0; i < len; i++) {
item = PySequence_GetItem(seq, i);
if (PyFloat_Check(item)) {
if (type == IDP_IDPARRAY) { /* mixed dict/int */
Py_DECREF(item);
return -1;
}
- type= IDP_DOUBLE;
+ type = IDP_DOUBLE;
}
else if (PyLong_Check(item)) {
if (type == IDP_IDPARRAY) { /* mixed dict/int */
@@ -333,7 +325,7 @@ static int idp_sequence_type(PyObject *seq)
Py_DECREF(item);
return -1;
}
- type= IDP_IDPARRAY;
+ type = IDP_IDPARRAY;
}
else {
Py_XDECREF(item);
@@ -353,7 +345,7 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
IDProperty *prop = NULL;
IDPropertyTemplate val = {0};
- const char *name= "";
+ const char *name = "";
if (name_obj) {
Py_ssize_t name_size;
@@ -373,7 +365,7 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
}
else if (PyUnicode_Check(ob)) {
#ifdef USE_STRING_COERCE
- PyObject *value_coerce= NULL;
+ PyObject *value_coerce = NULL;
val.string.str = (char *)PyC_UnicodeAsByte(ob, &value_coerce);
val.string.subtype = IDP_STRING_SUB_UTF8;
prop = IDP_New(IDP_STRING, &val, name);
@@ -384,56 +376,56 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
#endif
}
else if (PyBytes_Check(ob)) {
- val.string.str= PyBytes_AS_STRING(ob);
- val.string.len= PyBytes_GET_SIZE(ob);
- val.string.subtype= IDP_STRING_SUB_BYTE;
+ val.string.str = PyBytes_AS_STRING(ob);
+ val.string.len = PyBytes_GET_SIZE(ob);
+ val.string.subtype = IDP_STRING_SUB_BYTE;
prop = IDP_New(IDP_STRING, &val, name);
//prop = IDP_NewString(PyBytes_AS_STRING(ob), name, PyBytes_GET_SIZE(ob));
- //prop->subtype= IDP_STRING_SUB_BYTE;
+ //prop->subtype = IDP_STRING_SUB_BYTE;
}
else if (PySequence_Check(ob)) {
PyObject *item;
int i;
- if ((val.array.type= idp_sequence_type(ob)) == -1)
+ 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);
switch (val.array.type) {
- case IDP_DOUBLE:
- prop = IDP_New(IDP_ARRAY, &val, name);
- for (i=0; i<val.array.len; i++) {
- item = PySequence_GetItem(ob, i);
- ((double*)IDP_Array(prop))[i] = (float)PyFloat_AsDouble(item);
- Py_DECREF(item);
- }
- break;
- case IDP_INT:
- prop = IDP_New(IDP_ARRAY, &val, name);
- for (i=0; i<val.array.len; i++) {
- item = PySequence_GetItem(ob, i);
- ((int*)IDP_Array(prop))[i] = (int)PyLong_AsSsize_t(item);
- Py_DECREF(item);
- }
- break;
- case IDP_IDPARRAY:
- prop= IDP_NewIDPArray(name);
- for (i=0; i<val.array.len; i++) {
- const char *error;
- item = PySequence_GetItem(ob, i);
- error= BPy_IDProperty_Map_ValidateAndCreate(NULL, prop, item);
- Py_DECREF(item);
-
- if (error)
- return error;
- }
- break;
+ case IDP_DOUBLE:
+ prop = IDP_New(IDP_ARRAY, &val, name);
+ for (i = 0; i < val.array.len; i++) {
+ item = PySequence_GetItem(ob, i);
+ ((double *)IDP_Array(prop))[i] = (float)PyFloat_AsDouble(item);
+ Py_DECREF(item);
+ }
+ break;
+ case IDP_INT:
+ prop = IDP_New(IDP_ARRAY, &val, name);
+ for (i = 0; i < val.array.len; i++) {
+ item = PySequence_GetItem(ob, i);
+ ((int *)IDP_Array(prop))[i] = (int)PyLong_AsSsize_t(item);
+ Py_DECREF(item);
+ }
+ break;
+ case IDP_IDPARRAY:
+ prop = IDP_NewIDPArray(name);
+ for (i = 0; i < val.array.len; i++) {
+ const char *error;
+ item = PySequence_GetItem(ob, i);
+ error = BPy_IDProperty_Map_ValidateAndCreate(NULL, prop, item);
+ Py_DECREF(item);
+
+ if (error)
+ return error;
+ }
+ break;
}
}
else if (PyMapping_Check(ob)) {
@@ -443,11 +435,11 @@ 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++) {
+ for (i = 0; i < len; i++) {
key = PySequence_GetItem(keys, i);
pval = PySequence_GetItem(vals, i);
if (!PyUnicode_Check(key)) {
@@ -476,7 +468,7 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
}
else return "invalid property value";
- if (group->type==IDP_IDPARRAY) {
+ if (group->type == IDP_IDPARRAY) {
IDP_AppendArray(group, prop);
// IDP_FreeProperty(item); // IDP_AppendArray does a shallow copy (memcpy), only free memory
MEM_freeN(prop);
@@ -518,7 +510,7 @@ int BPy_Wrap_SetMapItem(IDProperty *prop, PyObject *key, PyObject *val)
err = BPy_IDProperty_Map_ValidateAndCreate(key, prop, val);
if (err) {
- PyErr_SetString(PyExc_KeyError, err );
+ PyErr_SetString(PyExc_KeyError, err);
return -1;
}
@@ -538,107 +530,107 @@ static PyObject *BPy_IDGroup_iter(BPy_IDProperty *self)
iter->mode = IDPROP_ITER_KEYS;
iter->cur = self->prop->data.group.first;
Py_XINCREF(iter);
- return (PyObject*) iter;
+ return (PyObject *)iter;
}
/* for simple, non nested types this is the same as BPy_IDGroup_WrapData */
static PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop)
{
switch (prop->type) {
- case IDP_STRING:
- return idprop_py_from_idp_string(prop);
- case IDP_INT:
- return idprop_py_from_idp_int(prop);
- case IDP_FLOAT:
- return idprop_py_from_idp_float(prop);
- case IDP_DOUBLE:
- return idprop_py_from_idp_double(prop);
- case IDP_ARRAY:
- {
- PyObject *seq = PyList_New(prop->len);
- int i;
-
- if (!seq) {
- PyErr_Format(PyExc_RuntimeError,
- "%s: IDP_ARRAY: PyList_New(%d) failed",
- __func__, prop->len);
- return NULL;
- }
-
- switch (prop->subtype) {
+ case IDP_STRING:
+ return idprop_py_from_idp_string(prop);
+ case IDP_INT:
+ return idprop_py_from_idp_int(prop);
case IDP_FLOAT:
- {
- float *array= (float*)IDP_Array(prop);
- for (i=0; i<prop->len; i++) {
- PyList_SET_ITEM(seq, i, PyFloat_FromDouble(array[i]));
- }
- break;
- }
+ return idprop_py_from_idp_float(prop);
case IDP_DOUBLE:
+ return idprop_py_from_idp_double(prop);
+ case IDP_ARRAY:
{
- double *array= (double*)IDP_Array(prop);
- for (i=0; i<prop->len; i++) {
- PyList_SET_ITEM(seq, i, PyFloat_FromDouble(array[i]));
- }
- break;
- }
- case IDP_INT:
- {
- int *array= (int*)IDP_Array(prop);
- for (i=0; i<prop->len; i++) {
- PyList_SET_ITEM(seq, i, PyLong_FromLong(array[i]));
+ PyObject *seq = PyList_New(prop->len);
+ int i;
+
+ if (!seq) {
+ PyErr_Format(PyExc_RuntimeError,
+ "%s: IDP_ARRAY: PyList_New(%d) failed",
+ __func__, prop->len);
+ return NULL;
}
- break;
- }
- default:
- PyErr_Format(PyExc_RuntimeError,
- "%s: invalid/corrupt array type '%d'!",
- __func__, prop->subtype);
- Py_DECREF(seq);
- return NULL;
- }
- return seq;
- }
- case IDP_IDPARRAY:
- {
- PyObject *seq = PyList_New(prop->len), *wrap;
- IDProperty *array= IDP_IDPArray(prop);
- int i;
+ switch (prop->subtype) {
+ case IDP_FLOAT:
+ {
+ float *array = (float *)IDP_Array(prop);
+ for (i = 0; i < prop->len; i++) {
+ PyList_SET_ITEM(seq, i, PyFloat_FromDouble(array[i]));
+ }
+ break;
+ }
+ case IDP_DOUBLE:
+ {
+ double *array = (double *)IDP_Array(prop);
+ for (i = 0; i < prop->len; i++) {
+ PyList_SET_ITEM(seq, i, PyFloat_FromDouble(array[i]));
+ }
+ break;
+ }
+ case IDP_INT:
+ {
+ int *array = (int *)IDP_Array(prop);
+ for (i = 0; i < prop->len; i++) {
+ PyList_SET_ITEM(seq, i, PyLong_FromLong(array[i]));
+ }
+ break;
+ }
+ default:
+ PyErr_Format(PyExc_RuntimeError,
+ "%s: invalid/corrupt array type '%d'!",
+ __func__, prop->subtype);
+ Py_DECREF(seq);
+ return NULL;
+ }
- if (!seq) {
- PyErr_Format(PyExc_RuntimeError,
- "%s: IDP_IDPARRAY: PyList_New(%d) failed",
- __func__, prop->len);
- return NULL;
+ return seq;
}
+ case IDP_IDPARRAY:
+ {
+ PyObject *seq = PyList_New(prop->len), *wrap;
+ IDProperty *array = IDP_IDPArray(prop);
+ int i;
+
+ if (!seq) {
+ PyErr_Format(PyExc_RuntimeError,
+ "%s: IDP_IDPARRAY: PyList_New(%d) failed",
+ __func__, prop->len);
+ return NULL;
+ }
- for (i=0; i<prop->len; i++) {
- wrap= BPy_IDGroup_MapDataToPy(array++);
+ for (i = 0; i < prop->len; i++) {
+ wrap = BPy_IDGroup_MapDataToPy(array++);
- if (!wrap) /* BPy_IDGroup_MapDataToPy sets the error */
- return NULL;
+ if (!wrap) /* BPy_IDGroup_MapDataToPy sets the error */
+ return NULL;
- PyList_SET_ITEM(seq, i, wrap);
+ PyList_SET_ITEM(seq, i, wrap);
+ }
+ return seq;
}
- return seq;
- }
- case IDP_GROUP:
- {
- PyObject *dict = PyDict_New(), *wrap;
- IDProperty *loop;
+ case IDP_GROUP:
+ {
+ PyObject *dict = PyDict_New(), *wrap;
+ IDProperty *loop;
- for (loop=prop->data.group.first; loop; loop=loop->next) {
- wrap = BPy_IDGroup_MapDataToPy(loop);
+ for (loop = prop->data.group.first; loop; loop = loop->next) {
+ wrap = BPy_IDGroup_MapDataToPy(loop);
- if (!wrap) /* BPy_IDGroup_MapDataToPy sets the error */
- return NULL;
+ if (!wrap) /* BPy_IDGroup_MapDataToPy sets the error */
+ return NULL;
- PyDict_SetItemString(dict, loop->name, wrap);
- Py_DECREF(wrap);
+ PyDict_SetItemString(dict, loop->name, wrap);
+ Py_DECREF(wrap);
+ }
+ return dict;
}
- return dict;
- }
}
PyErr_Format(PyExc_RuntimeError,
@@ -660,15 +652,15 @@ static PyObject *BPy_IDGroup_Pop(BPy_IDProperty *self, PyObject *value)
return NULL;
}
- idprop= IDP_GetPropertyFromGroup(self->prop, name);
+ idprop = IDP_GetPropertyFromGroup(self->prop, name);
if (idprop) {
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;
}
@@ -687,7 +679,7 @@ static PyObject *BPy_IDGroup_IterItems(BPy_IDProperty *self)
iter->mode = IDPROP_ITER_ITEMS;
iter->cur = self->prop->data.group.first;
Py_XINCREF(iter);
- return (PyObject*) iter;
+ return (PyObject *)iter;
}
/* utility function */
@@ -698,7 +690,7 @@ static void BPy_IDGroup_CorrectListLen(IDProperty *prop, PyObject *seq, int len,
printf("%s: ID Property Error found and corrected!\n", func);
/*fill rest of list with valid references to None*/
- for (j=len; j<prop->len; j++) {
+ for (j = len; j < prop->len; j++) {
Py_INCREF(Py_None);
PyList_SET_ITEM(seq, j, Py_None);
}
@@ -713,11 +705,13 @@ PyObject *BPy_Wrap_GetKeys(IDProperty *prop)
IDProperty *loop;
int i;
- for (i=0, loop=prop->data.group.first; loop && (i < prop->len); loop=loop->next, i++)
+ for (i = 0, loop = prop->data.group.first; loop && (i < prop->len); loop = loop->next, i++)
PyList_SET_ITEM(list, i, PyUnicode_FromString(loop->name));
/* if the id prop is corrupt, count the remaining */
- for (; loop; loop=loop->next, i++) {}
+ for ( ; loop; loop = loop->next, i++) {
+ /* pass */
+ }
if (i != prop->len) { /* if the loop didnt finish, we know the length is wrong */
BPy_IDGroup_CorrectListLen(prop, list, i, __func__);
@@ -735,7 +729,7 @@ PyObject *BPy_Wrap_GetValues(ID *id, IDProperty *prop)
IDProperty *loop;
int i;
- for (i=0, loop=prop->data.group.first; loop; loop=loop->next, i++) {
+ for (i = 0, loop = prop->data.group.first; loop; loop = loop->next, i++) {
PyList_SET_ITEM(list, i, BPy_IDGroup_WrapData(id, loop, prop));
}
@@ -755,8 +749,8 @@ PyObject *BPy_Wrap_GetItems(ID *id, IDProperty *prop)
IDProperty *loop;
int i;
- for (i=0, loop=prop->data.group.first; loop; loop=loop->next, i++) {
- PyObject *item= PyTuple_New(2);
+ for (i = 0, loop = prop->data.group.first; loop; loop = loop->next, i++) {
+ PyObject *item = PyTuple_New(2);
PyTuple_SET_ITEM(item, 0, PyUnicode_FromString(loop->name));
PyTuple_SET_ITEM(item, 1, BPy_IDGroup_WrapData(id, loop, prop));
PyList_SET_ITEM(seq, i, item);
@@ -799,13 +793,13 @@ static int BPy_IDGroup_Contains(BPy_IDProperty *self, PyObject *value)
return -1;
}
- return IDP_GetPropertyFromGroup(self->prop, name) ? 1:0;
+ return IDP_GetPropertyFromGroup(self->prop, name) ? 1 : 0;
}
static PyObject *BPy_IDGroup_Update(BPy_IDProperty *self, PyObject *value)
{
PyObject *pkey, *pval;
- Py_ssize_t i=0;
+ Py_ssize_t i = 0;
if (!PyDict_Check(value)) {
PyErr_Format(PyExc_TypeError,
@@ -829,18 +823,18 @@ static PyObject *BPy_IDGroup_to_dict(BPy_IDProperty *self)
/* Matches python dict.get(key, [default]) */
-static PyObject* BPy_IDGroup_Get(BPy_IDProperty *self, PyObject *args)
+static PyObject *BPy_IDGroup_Get(BPy_IDProperty *self, PyObject *args)
{
IDProperty *idprop;
char *key;
- PyObject* def = Py_None;
+ PyObject *def = Py_None;
if (!PyArg_ParseTuple(args, "s|O:get", &key, &def))
return NULL;
- idprop= IDP_GetPropertyFromGroup(self->prop, key);
+ idprop = IDP_GetPropertyFromGroup(self->prop, key);
if (idprop) {
- PyObject* pyobj = BPy_IDGroup_WrapData(self->id, idprop, self->prop);
+ PyObject *pyobj = BPy_IDGroup_WrapData(self->id, idprop, self->prop);
if (pyobj)
return pyobj;
}
@@ -851,64 +845,64 @@ static PyObject* BPy_IDGroup_Get(BPy_IDProperty *self, PyObject *args)
static struct PyMethodDef BPy_IDGroup_methods[] = {
{"pop", (PyCFunction)BPy_IDGroup_Pop, METH_O,
- "pop an item from the group; raises KeyError if the item doesn't exist"},
+ "pop an item from the group; raises KeyError if the item doesn't exist"},
{"iteritems", (PyCFunction)BPy_IDGroup_IterItems, METH_NOARGS,
- "iterate through the items in the dict; behaves like dictionary method iteritems"},
+ "iterate through the items in the dict; behaves like dictionary method iteritems"},
{"keys", (PyCFunction)BPy_IDGroup_GetKeys, METH_NOARGS,
- "get the keys associated with this group as a list of strings"},
+ "get the keys associated with this group as a list of strings"},
{"values", (PyCFunction)BPy_IDGroup_GetValues, METH_NOARGS,
- "get the values associated with this group"},
+ "get the values associated with this group"},
{"items", (PyCFunction)BPy_IDGroup_GetItems, METH_NOARGS,
- "get the items associated with this group"},
+ "get the items associated with this group"},
{"update", (PyCFunction)BPy_IDGroup_Update, METH_O,
- "updates the values in the group with the values of another or a dict"},
+ "updates the values in the group with the values of another or a dict"},
{"get", (PyCFunction)BPy_IDGroup_Get, METH_VARARGS,
- "idprop.get(k[,d]) -> idprop[k] if k in idprop, else d. d defaults to None"},
+ "idprop.get(k[,d]) -> idprop[k] if k in idprop, else d. d defaults to None"},
{"to_dict", (PyCFunction)BPy_IDGroup_to_dict, METH_NOARGS,
- "return a purely python version of the group"},
+ "return a purely python version of the group"},
{NULL, NULL, 0, NULL}
};
static PySequenceMethods BPy_IDGroup_Seq = {
- (lenfunc) BPy_IDGroup_Map_Len, /* lenfunc sq_length */
- NULL, /* binaryfunc sq_concat */
- NULL, /* ssizeargfunc sq_repeat */
- NULL, /* ssizeargfunc sq_item */ /* TODO - setting this will allow PySequence_Check to return True */
- NULL, /* intintargfunc ***was_sq_slice*** */
- NULL, /* intobjargproc sq_ass_item */
- NULL, /* ssizeobjargproc ***was_sq_ass_slice*** */
- (objobjproc) BPy_IDGroup_Contains, /* objobjproc sq_contains */
- NULL, /* binaryfunc sq_inplace_concat */
- NULL, /* ssizeargfunc sq_inplace_repeat */
+ (lenfunc) BPy_IDGroup_Map_Len, /* lenfunc sq_length */
+ NULL, /* binaryfunc sq_concat */
+ NULL, /* ssizeargfunc sq_repeat */
+ NULL, /* ssizeargfunc sq_item */ /* TODO - setting this will allow PySequence_Check to return True */
+ NULL, /* intintargfunc ***was_sq_slice*** */
+ NULL, /* intobjargproc sq_ass_item */
+ NULL, /* ssizeobjargproc ***was_sq_ass_slice*** */
+ (objobjproc) BPy_IDGroup_Contains, /* objobjproc sq_contains */
+ NULL, /* binaryfunc sq_inplace_concat */
+ NULL, /* ssizeargfunc sq_inplace_repeat */
};
static PyMappingMethods BPy_IDGroup_Mapping = {
- (lenfunc)BPy_IDGroup_Map_Len, /*inquiry mp_length */
- (binaryfunc)BPy_IDGroup_Map_GetItem,/*binaryfunc mp_subscript */
- (objobjargproc)BPy_IDGroup_Map_SetItem, /*objobjargproc mp_ass_subscript */
+ (lenfunc)BPy_IDGroup_Map_Len, /*inquiry mp_length */
+ (binaryfunc)BPy_IDGroup_Map_GetItem, /*binaryfunc mp_subscript */
+ (objobjargproc)BPy_IDGroup_Map_SetItem, /*objobjargproc mp_ass_subscript */
};
PyTypeObject BPy_IDGroup_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
/* For printing, in format "<module>.<name>" */
- "Blender IDProperty", /* char *tp_name; */
- sizeof(BPy_IDProperty), /* int tp_basicsize; */
+ "Blender IDProperty", /* char *tp_name; */
+ sizeof(BPy_IDProperty), /* int tp_basicsize; */
0, /* tp_itemsize; For allocation */
/* Methods to implement standard operations */
- NULL, /* destructor tp_dealloc; */
+ NULL, /* destructor tp_dealloc; */
NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
+ NULL, /* getattrfunc tp_getattr; */
+ NULL, /* setattrfunc tp_setattr; */
NULL, /* cmpfunc tp_compare; */
(reprfunc)BPy_IDGroup_repr, /* reprfunc tp_repr; */
/* Method suites for standard classes */
NULL, /* PyNumberMethods *tp_as_number; */
- &BPy_IDGroup_Seq, /* PySequenceMethods *tp_as_sequence; */
- &BPy_IDGroup_Mapping, /* PyMappingMethods *tp_as_mapping; */
+ &BPy_IDGroup_Seq, /* PySequenceMethods *tp_as_sequence; */
+ &BPy_IDGroup_Mapping, /* PyMappingMethods *tp_as_mapping; */
/* More standard operations (here for binary compatibility) */
@@ -921,29 +915,29 @@ PyTypeObject BPy_IDGroup_Type = {
/* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */
- /*** Flags to define presence of optional/expanded features ***/
+ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
+ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */
/* delete references to contained objects */
NULL, /* inquiry tp_clear; */
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
NULL, /* richcmpfunc tp_richcompare; */
- /*** weak reference enabler ***/
+ /*** weak reference enabler ***/
0, /* long tp_weaklistoffset; */
- /*** Added in release 2.2 ***/
+ /*** Added in release 2.2 ***/
/* Iterators */
(getiterfunc)BPy_IDGroup_iter, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */
- /*** Attribute descriptor and subclassing stuff ***/
+ /*** Attribute descriptor and subclassing stuff ***/
BPy_IDGroup_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
BPy_IDGroup_getseters, /* struct PyGetSetDef *tp_getset; */
@@ -955,17 +949,17 @@ static PyTypeObject *idp_array_py_type(BPy_IDArray *self, short *is_double)
{
switch (self->prop->subtype) {
case IDP_FLOAT:
- *is_double= 0;
+ *is_double = 0;
return &PyFloat_Type;
case IDP_DOUBLE:
- *is_double= 1;
+ *is_double = 1;
return &PyFloat_Type;
case IDP_INT:
- *is_double= 0;
+ *is_double = 0;
return &PyLong_Type;
}
- *is_double= 0;
+ *is_double = 0;
return NULL;
}
@@ -977,12 +971,9 @@ static PyObject *BPy_IDArray_repr(BPy_IDArray *self)
static PyObject *BPy_IDArray_GetType(BPy_IDArray *self)
{
switch (self->prop->subtype) {
- case IDP_FLOAT:
- return PyUnicode_FromString("f");
- case IDP_DOUBLE:
- return PyUnicode_FromString("d");
- case IDP_INT:
- return PyUnicode_FromString("i");
+ case IDP_FLOAT: return PyUnicode_FromString("f");
+ case IDP_DOUBLE: return PyUnicode_FromString("d");
+ case IDP_INT: return PyUnicode_FromString("i");
}
PyErr_Format(PyExc_RuntimeError,
@@ -993,7 +984,7 @@ static PyObject *BPy_IDArray_GetType(BPy_IDArray *self)
}
static PyGetSetDef BPy_IDArray_getseters[] = {
- /* matches pythons array.typecode */
+ /* matches pythons array.typecode */
{(char *)"typecode", (getter)BPy_IDArray_GetType, (setter)NULL, (char *)"The type of the data in the array, is an int.", NULL},
{NULL, NULL, NULL, NULL, NULL},
};
@@ -1005,7 +996,7 @@ static PyObject *BPy_IDArray_to_list(BPy_IDArray *self)
static PyMethodDef BPy_IDArray_methods[] = {
{"to_list", (PyCFunction)BPy_IDArray_to_list, METH_NOARGS,
- "return the array as a list"},
+ "return the array as a list"},
{NULL, NULL, 0, NULL}
};
@@ -1023,11 +1014,11 @@ static PyObject *BPy_IDArray_GetItem(BPy_IDArray *self, int index)
switch (self->prop->subtype) {
case IDP_FLOAT:
- return PyFloat_FromDouble(((float*)IDP_Array(self->prop))[index]);
+ return PyFloat_FromDouble(((float *)IDP_Array(self->prop))[index]);
case IDP_DOUBLE:
- return PyFloat_FromDouble(((double*)IDP_Array(self->prop))[index]);
+ return PyFloat_FromDouble(((double *)IDP_Array(self->prop))[index]);
case IDP_INT:
- return PyLong_FromLong((long)((int*)IDP_Array(self->prop))[index]);
+ return PyLong_FromLong((long)((int *)IDP_Array(self->prop))[index]);
}
PyErr_Format(PyExc_RuntimeError,
@@ -1050,46 +1041,46 @@ static int BPy_IDArray_SetItem(BPy_IDArray *self, int index, PyObject *value)
switch (self->prop->subtype) {
case IDP_FLOAT:
- f= (float)PyFloat_AsDouble(value);
- if (f==-1 && PyErr_Occurred()) {
+ f = (float)PyFloat_AsDouble(value);
+ if (f == -1 && PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError, "expected a float");
return -1;
}
- ((float*)IDP_Array(self->prop))[index] = f;
+ ((float *)IDP_Array(self->prop))[index] = f;
break;
case IDP_DOUBLE:
- d= PyFloat_AsDouble(value);
- if (d==-1 && PyErr_Occurred()) {
+ d = PyFloat_AsDouble(value);
+ if (d == -1 && PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError, "expected a float");
return -1;
}
- ((double*)IDP_Array(self->prop))[index] = d;
+ ((double *)IDP_Array(self->prop))[index] = d;
break;
case IDP_INT:
- i= PyLong_AsSsize_t(value);
- if (i==-1 && PyErr_Occurred()) {
+ i = PyLong_AsSsize_t(value);
+ if (i == -1 && PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError, "expected an int type");
return -1;
}
- ((int*)IDP_Array(self->prop))[index] = i;
+ ((int *)IDP_Array(self->prop))[index] = i;
break;
}
return 0;
}
static PySequenceMethods BPy_IDArray_Seq = {
- (lenfunc) BPy_IDArray_Len, /* inquiry sq_length */
- NULL, /* binaryfunc sq_concat */
- NULL, /* intargfunc sq_repeat */
- (ssizeargfunc)BPy_IDArray_GetItem, /* intargfunc sq_item */
- NULL, /* intintargfunc sq_slice */
- (ssizeobjargproc)BPy_IDArray_SetItem,/* intobjargproc sq_ass_item */
- NULL, /* intintobjargproc sq_ass_slice */
- NULL, /* objobjproc sq_contains */
- /* Added in release 2.0 */
- NULL, /* binaryfunc sq_inplace_concat */
- NULL, /* intargfunc sq_inplace_repeat */
+ (lenfunc) BPy_IDArray_Len, /* inquiry sq_length */
+ NULL, /* binaryfunc sq_concat */
+ NULL, /* intargfunc sq_repeat */
+ (ssizeargfunc)BPy_IDArray_GetItem, /* intargfunc sq_item */
+ NULL, /* intintargfunc sq_slice */
+ (ssizeobjargproc)BPy_IDArray_SetItem, /* intobjargproc sq_ass_item */
+ NULL, /* intintobjargproc sq_ass_slice */
+ NULL, /* objobjproc sq_contains */
+ /* Added in release 2.0 */
+ NULL, /* binaryfunc sq_inplace_concat */
+ NULL, /* intargfunc sq_inplace_repeat */
};
@@ -1097,21 +1088,21 @@ static PySequenceMethods BPy_IDArray_Seq = {
/* sequence slice (get): idparr[a:b] */
static PyObject *BPy_IDArray_slice(BPy_IDArray *self, int begin, int end)
{
- IDProperty *prop= self->prop;
+ IDProperty *prop = self->prop;
PyObject *tuple;
int count;
CLAMP(begin, 0, prop->len);
- if (end<0) end= prop->len+end+1;
+ if (end < 0) end = prop->len + end + 1;
CLAMP(end, 0, prop->len);
- begin= MIN2(begin, end);
+ begin = MIN2(begin, end);
- tuple= PyTuple_New(end - begin);
+ tuple = PyTuple_New(end - begin);
switch (prop->subtype) {
case IDP_FLOAT:
{
- float *array= (float*)IDP_Array(prop);
+ float *array = (float *)IDP_Array(prop);
for (count = begin; count < end; count++) {
PyTuple_SET_ITEM(tuple, count - begin, PyFloat_FromDouble(array[count]));
}
@@ -1119,7 +1110,7 @@ static PyObject *BPy_IDArray_slice(BPy_IDArray *self, int begin, int end)
}
case IDP_DOUBLE:
{
- double *array= (double*)IDP_Array(prop);
+ double *array = (double *)IDP_Array(prop);
for (count = begin; count < end; count++) {
PyTuple_SET_ITEM(tuple, count - begin, PyFloat_FromDouble(array[count]));
}
@@ -1127,7 +1118,7 @@ static PyObject *BPy_IDArray_slice(BPy_IDArray *self, int begin, int end)
}
case IDP_INT:
{
- int *array= (int*)IDP_Array(prop);
+ int *array = (int *)IDP_Array(prop);
for (count = begin; count < end; count++) {
PyTuple_SET_ITEM(tuple, count - begin, PyLong_FromLong(array[count]));
}
@@ -1140,10 +1131,10 @@ static PyObject *BPy_IDArray_slice(BPy_IDArray *self, int begin, int end)
/* sequence slice (set): idparr[a:b] = value */
static int BPy_IDArray_ass_slice(BPy_IDArray *self, int begin, int end, PyObject *seq)
{
- IDProperty *prop= self->prop;
- short is_double= 0;
- const PyTypeObject *py_type= idp_array_py_type(self, &is_double);
- const size_t elem_size= is_double ? sizeof(double) : sizeof(float);
+ IDProperty *prop = self->prop;
+ short is_double = 0;
+ const PyTypeObject *py_type = idp_array_py_type(self, &is_double);
+ const size_t elem_size = is_double ? sizeof(double) : sizeof(float);
size_t alloc_len;
size_t size;
void *vec;
@@ -1153,9 +1144,9 @@ static int BPy_IDArray_ass_slice(BPy_IDArray *self, int begin, int end, PyObject
begin = MIN2(begin, end);
size = (end - begin);
- alloc_len= size * elem_size;
+ alloc_len = size * elem_size;
- vec= MEM_mallocN(alloc_len, "array assignment"); /* NOTE: we count on int/float being the same size here */
+ vec = MEM_mallocN(alloc_len, "array assignment"); /* NOTE: we count on int/float being the same size here */
if (PyC_AsArray(vec, seq, size, py_type, is_double, "slice assignment: ") == -1) {
MEM_freeN(vec);
return -1;
@@ -1167,7 +1158,7 @@ static int BPy_IDArray_ass_slice(BPy_IDArray *self, int begin, int end, PyObject
return 0;
}
-static PyObject *BPy_IDArray_subscript(BPy_IDArray* self, PyObject* item)
+static PyObject *BPy_IDArray_subscript(BPy_IDArray *self, PyObject *item)
{
if (PyIndex_Check(item)) {
Py_ssize_t i;
@@ -1203,7 +1194,7 @@ static PyObject *BPy_IDArray_subscript(BPy_IDArray* self, PyObject* item)
}
}
-static int BPy_IDArray_ass_subscript(BPy_IDArray* self, PyObject* item, PyObject* value)
+static int BPy_IDArray_ass_subscript(BPy_IDArray *self, PyObject *item, PyObject *value)
{
if (PyIndex_Check(item)) {
Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
@@ -1250,7 +1241,7 @@ PyTypeObject BPy_IDArray_Type = {
/* Methods to implement standard operations */
- NULL, /* destructor tp_dealloc; */
+ NULL, /* destructor tp_dealloc; */
NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
@@ -1260,12 +1251,12 @@ PyTypeObject BPy_IDArray_Type = {
/* Method suites for standard classes */
NULL, /* PyNumberMethods *tp_as_number; */
- &BPy_IDArray_Seq, /* PySequenceMethods *tp_as_sequence; */
+ &BPy_IDArray_Seq, /* PySequenceMethods *tp_as_sequence; */
&BPy_IDArray_AsMapping, /* PyMappingMethods *tp_as_mapping; */
/* More standard operations (here for binary compatibility) */
- NULL, /* hashfunc tp_hash; */
+ NULL, /* hashfunc tp_hash; */
NULL, /* ternaryfunc tp_call; */
NULL, /* reprfunc tp_str; */
NULL, /* getattrofunc tp_getattro; */
@@ -1274,31 +1265,31 @@ PyTypeObject BPy_IDArray_Type = {
/* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */
- /*** Flags to define presence of optional/expanded features ***/
+ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
+ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */
/* delete references to contained objects */
NULL, /* inquiry tp_clear; */
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
NULL, /* richcmpfunc tp_richcompare; */
- /*** weak reference enabler ***/
+ /*** weak reference enabler ***/
0, /* long tp_weaklistoffset; */
- /*** Added in release 2.2 ***/
+ /*** Added in release 2.2 ***/
/* Iterators */
NULL, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_IDArray_methods, /* struct PyMethodDef *tp_methods; */
+ /*** Attribute descriptor and subclassing stuff ***/
+ BPy_IDArray_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
BPy_IDArray_getseters, /* struct PyGetSetDef *tp_getset; */
NULL, /* struct _typeobject *tp_base; */
@@ -1324,12 +1315,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);
@@ -1337,12 +1322,14 @@ static PyObject *IDGroup_Iter_repr(BPy_IDGroup_Iter *self)
static PyObject *BPy_Group_Iter_Next(BPy_IDGroup_Iter *self)
{
- IDProperty *cur=NULL;
- PyObject *ret;
if (self->cur) {
+ PyObject *ret;
+ IDProperty *cur;
+
cur = self->cur;
self->cur = self->cur->next;
+
if (self->mode == IDPROP_ITER_ITEMS) {
ret = PyTuple_New(2);
PyTuple_SET_ITEM(ret, 0, PyUnicode_FromString(cur->name));
@@ -1363,22 +1350,22 @@ PyTypeObject BPy_IDGroup_Iter_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
/* For printing, in format "<module>.<name>" */
"Blender IDGroup_Iter", /* char *tp_name; */
- sizeof( BPy_IDGroup_Iter ), /* int tp_basicsize; */
+ sizeof(BPy_IDGroup_Iter), /* int tp_basicsize; */
0, /* tp_itemsize; For allocation */
/* Methods to implement standard operations */
- NULL, /* destructor tp_dealloc; */
+ NULL, /* destructor tp_dealloc; */
NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) IDGroup_Iter_repr, /* reprfunc tp_repr; */
+ (reprfunc) IDGroup_Iter_repr, /* reprfunc tp_repr; */
/* Method suites for standard classes */
NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
+ NULL, /* PySequenceMethods *tp_as_sequence; */
NULL, /* PyMappingMethods *tp_as_mapping; */
/* More standard operations (here for binary compatibility) */
@@ -1392,27 +1379,27 @@ PyTypeObject BPy_IDGroup_Iter_Type = {
/* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */
- /*** Flags to define presence of optional/expanded features ***/
+ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
+ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */
/* delete references to contained objects */
NULL, /* inquiry tp_clear; */
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
NULL, /* richcmpfunc tp_richcompare; */
- /*** weak reference enabler ***/
+ /*** weak reference enabler ***/
0, /* long tp_weaklistoffset; */
- /*** Added in release 2.2 ***/
+ /*** 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..0e5122787b8 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);
@@ -67,29 +67,29 @@ int PyC_AsArray(void *array, PyObject *value, const Py_ssize_t length,
/* for each type */
if (type == &PyFloat_Type) {
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));
+ double *array_double = array;
+ for (i = 0; i < length; 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));
+ float *array_float = array;
+ for (i = 0; i < length; i++) {
+ array_float[i] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value_fast, i));
}
}
}
else if (type == &PyLong_Type) {
/* 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));
+ int *array_int = array;
+ for (i = 0; i < length; 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);
+ int *array_bool = array;
+ for (i = 0; i < length; i++) {
+ array_bool[i] = (PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value_fast, i)) != 0);
}
}
else {
@@ -117,7 +117,7 @@ int PyC_AsArray(void *array, PyObject *value, const Py_ssize_t length,
void PyC_ObSpit(const char *name, PyObject *var)
{
fprintf(stderr, "<%s> : ", name);
- if (var==NULL) {
+ if (var == NULL) {
fprintf(stderr, "<NIL>");
}
else {
@@ -156,10 +156,10 @@ void PyC_FileAndNum(const char **filename, int *lineno)
{
PyFrameObject *frame;
- if (filename) *filename= NULL;
- if (lineno) *lineno = -1;
+ if (filename) *filename = NULL;
+ if (lineno) *lineno = -1;
- if (!(frame= PyThreadState_GET()->frame)) {
+ if (!(frame = PyThreadState_GET()->frame)) {
return;
}
@@ -172,16 +172,16 @@ void PyC_FileAndNum(const char **filename, int *lineno)
if (filename && *filename == NULL) {
/* try an alternative method to get the filename - module based
* references below are all borrowed (double checked) */
- PyObject *mod_name= PyDict_GetItemString(PyEval_GetGlobals(), "__name__");
+ PyObject *mod_name = PyDict_GetItemString(PyEval_GetGlobals(), "__name__");
if (mod_name) {
- PyObject *mod= PyDict_GetItem(PyImport_GetModuleDict(), mod_name);
+ PyObject *mod = PyDict_GetItem(PyImport_GetModuleDict(), mod_name);
if (mod) {
- *filename= PyModule_GetFilename(mod);
+ *filename = PyModule_GetFilename(mod);
}
/* unlikely, fallback */
if (*filename == NULL) {
- *filename= _PyUnicode_AsString(mod_name);
+ *filename = _PyUnicode_AsString(mod_name);
}
}
}
@@ -204,13 +204,13 @@ void PyC_FileAndNum_Safe(const char **filename, int *lineno)
PyObject *PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...)
{
Py_ssize_t i;
- PyObject *item= o;
+ PyObject *item = o;
char *attr;
va_list vargs;
va_start(vargs, n);
- for (i=0; i<n; i++) {
+ for (i = 0; i < n; i++) {
attr = va_arg(vargs, char *);
item = PyObject_GetAttrString(item, attr);
@@ -238,7 +238,7 @@ PyObject *PyC_Err_Format_Prefix(PyObject *exception_type_prefix, const char *for
va_list args;
va_start(args, format);
- error_value_prefix= PyUnicode_FromFormatV(format, args); /* can fail and be NULL */
+ error_value_prefix = PyUnicode_FromFormatV(format, args); /* can fail and be NULL */
va_end(args);
if (PyErr_Occurred()) {
@@ -271,22 +271,22 @@ PyObject *PyC_Err_Format_Prefix(PyObject *exception_type_prefix, const char *for
PyObject *PyC_ExceptionBuffer(void)
{
- PyObject *traceback_mod= NULL;
- PyObject *format_tb_func= NULL;
- PyObject *ret= NULL;
+ PyObject *traceback_mod = NULL;
+ PyObject *format_tb_func = NULL;
+ PyObject *ret = NULL;
- if (! (traceback_mod= PyImport_ImportModule("traceback")) ) {
+ if (!(traceback_mod = PyImport_ImportModule("traceback"))) {
goto error_cleanup;
}
- else if (! (format_tb_func= PyObject_GetAttrString(traceback_mod, "format_exc"))) {
+ else if (!(format_tb_func = PyObject_GetAttrString(traceback_mod, "format_exc"))) {
goto error_cleanup;
}
- ret= PyObject_CallObject(format_tb_func, NULL);
+ ret = PyObject_CallObject(format_tb_func, NULL);
if (ret == Py_None) {
Py_DECREF(ret);
- ret= NULL;
+ ret = NULL;
}
error_cleanup:
@@ -303,8 +303,8 @@ PyObject *PyC_ExceptionBuffer(void)
PyObject *stderr_backup = PySys_GetObject("stderr"); /* borrowed */
PyObject *string_io = NULL;
PyObject *string_io_buf = NULL;
- PyObject *string_io_mod= NULL;
- PyObject *string_io_getvalue= NULL;
+ PyObject *string_io_mod = NULL;
+ PyObject *string_io_getvalue = NULL;
PyObject *error_type, *error_value, *error_traceback;
@@ -319,20 +319,20 @@ PyObject *PyC_ExceptionBuffer(void)
* string_io = io.StringIO()
*/
- if (! (string_io_mod= PyImport_ImportModule("io")) ) {
+ if (!(string_io_mod = PyImport_ImportModule("io"))) {
goto error_cleanup;
}
- else if (! (string_io = PyObject_CallMethod(string_io_mod, (char *)"StringIO", NULL))) {
+ else if (!(string_io = PyObject_CallMethod(string_io_mod, (char *)"StringIO", NULL))) {
goto error_cleanup;
}
- else if (! (string_io_getvalue= PyObject_GetAttrString(string_io, "getvalue"))) {
+ else if (!(string_io_getvalue = PyObject_GetAttrString(string_io, "getvalue"))) {
goto error_cleanup;
}
- Py_INCREF(stdout_backup); // since these were borrowed we dont want them freed when replaced.
+ Py_INCREF(stdout_backup); // since these were borrowed we don't 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);
@@ -374,7 +374,7 @@ const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce)
{
const char *result;
- result= _PyUnicode_AsString(py_str);
+ result = _PyUnicode_AsString(py_str);
if (result) {
/* 99% of the time this is enough but we better support non unicode
@@ -387,7 +387,7 @@ const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce)
if (PyBytes_Check(py_str)) {
return PyBytes_AS_STRING(py_str);
}
- else if ((*coerce= PyUnicode_EncodeFSDefault(py_str))) {
+ else if ((*coerce = PyUnicode_EncodeFSDefault(py_str))) {
return PyBytes_AS_STRING(*coerce);
}
else {
@@ -399,7 +399,7 @@ const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce)
PyObject *PyC_UnicodeFromByteAndSize(const char *str, Py_ssize_t size)
{
- PyObject *result= PyUnicode_FromStringAndSize(str, size);
+ PyObject *result = PyUnicode_FromStringAndSize(str, size);
if (result) {
/* 99% of the time this is enough but we better support non unicode
* chars since blender doesnt limit this */
@@ -408,7 +408,7 @@ PyObject *PyC_UnicodeFromByteAndSize(const char *str, Py_ssize_t size)
else {
PyErr_Clear();
/* this means paths will always be accessible once converted, on all OS's */
- result= PyUnicode_DecodeFSDefaultAndSize(str, size);
+ result = PyUnicode_DecodeFSDefaultAndSize(str, size);
return result;
}
}
@@ -419,26 +419,28 @@ 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;
- PyObject *mod_main= PyModule_New("__main__");
+ PyInterpreterState *interp = PyThreadState_GET()->interp;
+ PyObject *mod_main = PyModule_New("__main__");
PyDict_SetItemString(interp->modules, "__main__", mod_main);
Py_DECREF(mod_main); /* sys.modules owns now */
PyModule_AddStringConstant(mod_main, "__name__", "__main__");
- if (filename)
- PyModule_AddStringConstant(mod_main, "__file__", filename); /* __file__ only for nice UI'ness */
+ if (filename) {
+ /* __file__ mainly for nice UI'ness */
+ PyModule_AddObject(mod_main, "__file__", PyUnicode_DecodeFSDefault(filename));
+ }
PyModule_AddObject(mod_main, "__builtins__", interp->builtins);
Py_INCREF(interp->builtins); /* AddObject steals a reference */
return PyModule_GetDict(mod_main);
@@ -447,14 +449,14 @@ PyObject *PyC_DefaultNameSpace(const char *filename)
/* restore MUST be called after this */
void PyC_MainModule_Backup(PyObject **main_mod)
{
- PyInterpreterState *interp= PyThreadState_GET()->interp;
- *main_mod= PyDict_GetItemString(interp->modules, "__main__");
- Py_XINCREF(*main_mod); /* dont free */
+ PyInterpreterState *interp = PyThreadState_GET()->interp;
+ *main_mod = PyDict_GetItemString(interp->modules, "__main__");
+ Py_XINCREF(*main_mod); /* don't free */
}
void PyC_MainModule_Restore(PyObject *main_mod)
{
- PyInterpreterState *interp= PyThreadState_GET()->interp;
+ PyInterpreterState *interp = PyThreadState_GET()->interp;
PyDict_SetItemString(interp->modules, "__main__", main_mod);
Py_XDECREF(main_mod);
}
@@ -462,7 +464,7 @@ void PyC_MainModule_Restore(PyObject *main_mod)
/* must be called before Py_Initialize, expects output of BLI_get_folder(BLENDER_PYTHON, NULL) */
void PyC_SetHomePath(const char *py_path_bundle)
{
- if (py_path_bundle==NULL) {
+ if (py_path_bundle == NULL) {
/* Common enough to have bundled *nix python but complain on OSX/Win */
#if defined(__APPLE__) || defined(_WIN32)
fprintf(stderr, "Warning! bundled python not found and is expected on this platform. "
@@ -475,7 +477,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 +485,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);
}
@@ -506,37 +508,37 @@ void PyC_SetHomePath(const char *py_path_bundle)
/* Would be nice if python had this built in */
void PyC_RunQuicky(const char *filepath, int n, ...)
{
- FILE *fp= fopen(filepath, "r");
+ FILE *fp = fopen(filepath, "r");
if (fp) {
- PyGILState_STATE gilstate= PyGILState_Ensure();
+ PyGILState_STATE gilstate = PyGILState_Ensure();
va_list vargs;
- int *sizes= PyMem_MALLOC(sizeof(int) * (n / 2));
+ int *sizes = PyMem_MALLOC(sizeof(int) * (n / 2));
int i;
PyObject *py_dict = PyC_DefaultNameSpace(filepath);
- PyObject *values= PyList_New(n / 2); /* namespace owns this, dont free */
+ PyObject *values = PyList_New(n / 2); /* namespace owns this, don't free */
PyObject *py_result, *ret;
- PyObject *struct_mod= PyImport_ImportModule("struct");
- PyObject *calcsize= PyObject_GetAttrString(struct_mod, "calcsize"); /* struct.calcsize */
- PyObject *pack= PyObject_GetAttrString(struct_mod, "pack"); /* struct.pack */
- PyObject *unpack= PyObject_GetAttrString(struct_mod, "unpack"); /* struct.unpack */
+ PyObject *struct_mod = PyImport_ImportModule("struct");
+ PyObject *calcsize = PyObject_GetAttrString(struct_mod, "calcsize"); /* struct.calcsize */
+ PyObject *pack = PyObject_GetAttrString(struct_mod, "pack"); /* struct.pack */
+ PyObject *unpack = PyObject_GetAttrString(struct_mod, "unpack"); /* struct.unpack */
Py_DECREF(struct_mod);
va_start(vargs, n);
- for (i=0; i * 2<n; i++) {
+ for (i = 0; i * 2 < n; i++) {
char *format = va_arg(vargs, char *);
void *ptr = va_arg(vargs, void *);
- ret= PyObject_CallFunction(calcsize, (char *)"s", format);
+ ret = PyObject_CallFunction(calcsize, (char *)"s", format);
if (ret) {
- sizes[i]= PyLong_AsSsize_t(ret);
+ sizes[i] = PyLong_AsSsize_t(ret);
Py_DECREF(ret);
ret = PyObject_CallFunction(unpack, (char *)"sy#", format, (char *)ptr, sizes[i]);
}
@@ -549,12 +551,12 @@ void PyC_RunQuicky(const char *filepath, int n, ...)
PyList_SET_ITEM(values, i, Py_None); /* hold user */
Py_INCREF(Py_None);
- sizes[i]= 0;
+ sizes[i] = 0;
}
else {
if (PyTuple_GET_SIZE(ret) == 1) {
/* convenience, convert single tuples into single values */
- PyObject *tmp= PyTuple_GET_ITEM(ret, 0);
+ PyObject *tmp = PyTuple_GET_ITEM(ret, 0);
Py_INCREF(tmp);
Py_DECREF(ret);
ret = tmp;
@@ -576,29 +578,29 @@ void PyC_RunQuicky(const char *filepath, int n, ...)
/* we could skip this but then only slice assignment would work
* better not be so strict */
- values= PyDict_GetItemString(py_dict, "values");
+ values = PyDict_GetItemString(py_dict, "values");
if (values && PyList_Check(values)) {
- /* dont use the result */
+ /* don't use the result */
Py_DECREF(py_result);
- py_result= NULL;
+ py_result = NULL;
/* now get the values back */
va_start(vargs, n);
- for (i=0; i*2 <n; i++) {
+ for (i = 0; i * 2 < n; i++) {
char *format = va_arg(vargs, char *);
void *ptr = va_arg(vargs, void *);
PyObject *item;
PyObject *item_new;
/* prepend the string formatting and remake the tuple */
- item= PyList_GET_ITEM(values, i);
+ item = PyList_GET_ITEM(values, i);
if (PyTuple_CheckExact(item)) {
- int ofs= PyTuple_GET_SIZE(item);
- item_new= PyTuple_New(ofs + 1);
+ int ofs = PyTuple_GET_SIZE(item);
+ item_new = PyTuple_New(ofs + 1);
while (ofs--) {
- PyObject *member= PyTuple_GET_ITEM(item, ofs);
+ PyObject *member = PyTuple_GET_ITEM(item, ofs);
PyTuple_SET_ITEM(item_new, ofs + 1, member);
Py_INCREF(member);
}
@@ -606,7 +608,7 @@ void PyC_RunQuicky(const char *filepath, int n, ...)
PyTuple_SET_ITEM(item_new, 0, PyUnicode_FromString(format));
}
else {
- item_new= Py_BuildValue("sO", format, item);
+ item_new = Py_BuildValue("sO", format, item);
}
ret = PyObject_Call(pack, item_new, NULL);
@@ -650,8 +652,8 @@ void PyC_RunQuicky(const char *filepath, int n, ...)
/* generic function to avoid depending on RNA */
void *PyC_RNA_AsPointer(PyObject *value, const char *type_name)
{
- PyObject* as_pointer;
- PyObject* pointer;
+ PyObject *as_pointer;
+ PyObject *pointer;
if (!strcmp(Py_TYPE(value)->tp_name, type_name) &&
(as_pointer = PyObject_GetAttrString(value, "as_pointer")) != NULL &&
@@ -705,8 +707,8 @@ char *PyC_FlagSet_AsString(PyC_FlagSet *item)
int PyC_FlagSet_ValueFromID_int(PyC_FlagSet *item, const char *identifier, int *value)
{
- for( ; item->identifier; item++) {
- if(strcmp(item->identifier, identifier) == 0) {
+ for ( ; item->identifier; item++) {
+ if (strcmp(item->identifier, identifier) == 0) {
*value = item->value;
return 1;
}
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index e0e3dd5519c..1e2e2bf6b2b 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -52,7 +52,7 @@
#include "MEM_guardedalloc.h"
- /* external util modules */
+/* external util modules */
#include "../generic/idprop_py_api.h"
#include "../generic/bgl.h"
#include "../generic/blf_py_api.h"
@@ -71,12 +71,17 @@ PyDoc_STRVAR(bpy_script_paths_doc,
static PyObject *bpy_script_paths(PyObject *UNUSED(self))
{
PyObject *ret = PyTuple_New(2);
+ PyObject *item;
char *path;
path = BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, NULL);
- PyTuple_SET_ITEM(ret, 0, PyUnicode_FromString(path?path:""));
+ item = PyUnicode_DecodeFSDefault(path ? path : "");
+ BLI_assert(item != NULL);
+ PyTuple_SET_ITEM(ret, 0, item);
path = BLI_get_folder(BLENDER_USER_SCRIPTS, NULL);
- PyTuple_SET_ITEM(ret, 1, PyUnicode_FromString(path?path:""));
+ item = PyUnicode_DecodeFSDefault(path ? path : "");
+ BLI_assert(item != NULL);
+ PyTuple_SET_ITEM(ret, 1, item);
return ret;
}
@@ -200,17 +205,17 @@ static PyObject *bpy_resource_path(PyObject *UNUSED(self), PyObject *args, PyObj
path = BLI_get_folder_version(folder_id, (major * 100) + minor, FALSE);
- return PyUnicode_DecodeFSDefault(path);
+ return PyUnicode_DecodeFSDefault(path ? path : "");
}
static PyMethodDef meth_bpy_script_paths =
{"script_paths", (PyCFunction)bpy_script_paths, METH_NOARGS, bpy_script_paths_doc};
static PyMethodDef meth_bpy_blend_paths =
- {"blend_paths", (PyCFunction)bpy_blend_paths, METH_VARARGS|METH_KEYWORDS, bpy_blend_paths_doc};
+ {"blend_paths", (PyCFunction)bpy_blend_paths, METH_VARARGS | METH_KEYWORDS, bpy_blend_paths_doc};
static PyMethodDef meth_bpy_user_resource =
- {"user_resource", (PyCFunction)bpy_user_resource, METH_VARARGS|METH_KEYWORDS, NULL};
+ {"user_resource", (PyCFunction)bpy_user_resource, METH_VARARGS | METH_KEYWORDS, NULL};
static PyMethodDef meth_bpy_resource_path =
- {"resource_path", (PyCFunction)bpy_resource_path, METH_VARARGS|METH_KEYWORDS, bpy_resource_path_doc};
+ {"resource_path", (PyCFunction)bpy_resource_path, METH_VARARGS | METH_KEYWORDS, bpy_resource_path_doc};
static PyObject *bpy_import_test(const char *modname)
@@ -227,9 +232,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;
@@ -274,7 +279,7 @@ void BPy_init_modules(void)
PyModule_AddObject(mod, "data", BPY_rna_module()); /* imports bpy_types by running this */
bpy_import_test("bpy_types");
PyModule_AddObject(mod, "props", BPY_rna_props());
- /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */
+ /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */
PyModule_AddObject(mod, "ops", BPY_operator_module());
PyModule_AddObject(mod, "app", BPY_app_struct());
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index 0641c220001..44979700d94 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()) {
@@ -162,24 +166,26 @@ static PyObject *make_app_info(void)
* they are not static */
PyDoc_STRVAR(bpy_app_debug_doc,
-"Boolean, set when blender is running in debug mode (started with --debug)"
+"Boolean, for debug info (started with --debug / --debug_* matching this attribute name)"
);
-static PyObject *bpy_app_debug_get(PyObject *UNUSED(self), void *UNUSED(closure))
+static PyObject *bpy_app_debug_get(PyObject *UNUSED(self), void *closure)
{
- return PyBool_FromLong(G.f & G_DEBUG);
+ const int flag = GET_INT_FROM_POINTER(closure);
+ return PyBool_FromLong(G.debug & flag);
}
-static int bpy_app_debug_set(PyObject *UNUSED(self), PyObject *value, void *UNUSED(closure))
+static int bpy_app_debug_set(PyObject *UNUSED(self), PyObject *value, void *closure)
{
- int param = PyObject_IsTrue(value);
+ const int flag = GET_INT_FROM_POINTER(closure);
+ const int param = PyObject_IsTrue(value);
if (param < 0) {
PyErr_SetString(PyExc_TypeError, "bpy.app.debug can only be True/False");
return -1;
}
- if (param) G.f |= G_DEBUG;
- else G.f &= ~G_DEBUG;
+ if (param) G.debug |= flag;
+ else G.debug &= ~flag;
return 0;
}
@@ -219,10 +225,11 @@ PyDoc_STRVAR(bpy_app_driver_dict_doc,
);
static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(closure))
{
- if (bpy_pydriver_Dict == NULL)
+ if (bpy_pydriver_Dict == NULL) {
if (bpy_pydriver_create_dict() != 0) {
PyErr_SetString(PyExc_RuntimeError, "bpy.app.driver_namespace failed to create dictionary");
return NULL;
+ }
}
Py_INCREF(bpy_pydriver_Dict);
@@ -231,7 +238,12 @@ static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(cl
static PyGetSetDef bpy_app_getsets[] = {
- {(char *)"debug", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, NULL},
+ {(char *)"debug", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG},
+ {(char *)"debug_ffmpeg", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_FFMPEG},
+ {(char *)"debug_python", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_PYTHON},
+ {(char *)"debug_events", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_EVENTS},
+ {(char *)"debug_wm", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_WM},
+
{(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)bpy_app_debug_value_doc, NULL},
{(char *)"tempdir", bpy_app_tempdir_get, NULL, (char *)bpy_app_tempdir_doc, NULL},
{(char *)"driver_namespace", bpy_app_driver_dict_get, NULL, (char *)bpy_app_driver_dict_doc, NULL},
diff --git a/source/blender/python/intern/bpy_app_ffmpeg.c b/source/blender/python/intern/bpy_app_ffmpeg.c
index 778334c9600..44bba4c098f 100644
--- a/source/blender/python/intern/bpy_app_ffmpeg.c
+++ b/source/blender/python/intern/bpy_app_ffmpeg.c
@@ -88,16 +88,18 @@ static PyObject *make_ffmpeg_info(void)
PyStructSequence_SET_ITEM(ffmpeg_info, pos++, obj)
#ifdef WITH_FFMPEG
- #define FFMPEG_LIB_VERSION(lib) \
+# define FFMPEG_LIB_VERSION(lib) { \
curversion = lib ## _version(); \
SetObjItem(Py_BuildValue("(iii)", \
- curversion >> 16, (curversion >> 8) % 256, curversion % 256)); \
+ curversion >> 16, (curversion >> 8) % 256, curversion % 256)); \
SetObjItem(PyUnicode_FromFormat("%2d, %2d, %2d", \
- curversion >> 16, (curversion >> 8) % 256, curversion % 256));
+ curversion >> 16, (curversion >> 8) % 256, curversion % 256)); \
+} (void)0
#else
- #define FFMPEG_LIB_VERSION(lib) \
+# define FFMPEG_LIB_VERSION(lib) { \
SetStrItem("Unknown"); \
- SetStrItem("Unknown");
+ SetStrItem("Unknown"); \
+} (void)0
#endif
#ifdef WITH_FFMPEG
diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c
index 721bce51693..5128cf0b924 100644
--- a/source/blender/python/intern/bpy_app_handlers.c
+++ b/source/blender/python/intern/bpy_app_handlers.c
@@ -47,6 +47,8 @@ static PyStructSequence_Field app_cb_info_fields[] = {
{(char *)"render_pre", (char *)"Callback list - on render (before)"},
{(char *)"render_post", (char *)"Callback list - on render (after)"},
{(char *)"render_stats", (char *)"Callback list - on printing render statistics"},
+ {(char *)"render_complete", (char *)"Callback list - on completion of render job"},
+ {(char *)"render_cancel", (char *)"Callback list - on cancelling a render job"},
{(char *)"load_pre", (char *)"Callback list - on loading a new blend file (before)"},
{(char *)"load_post", (char *)"Callback list - on loading a new blend file (after)"},
{(char *)"save_pre", (char *)"Callback list - on saving a blend file (before)"},
@@ -68,11 +70,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 */
@@ -116,51 +118,51 @@ static PyObject *bpy_app_handlers_persistent_new(PyTypeObject *UNUSED(type), PyO
static PyTypeObject BPyPersistent_Type = {
#if defined(_MSC_VER) || defined(FREE_WINDOWS)
- PyVarObject_HEAD_INIT(NULL, 0)
+ PyVarObject_HEAD_INIT(NULL, 0)
#else
- PyVarObject_HEAD_INIT(&PyType_Type, 0)
+ PyVarObject_HEAD_INIT(&PyType_Type, 0)
#endif
- "persistent", /* tp_name */
- 0, /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- 0, /* tp_dealloc */
- 0, /* tp_print */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_reserved */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
- Py_TPFLAGS_BASETYPE, /* tp_flags */
- 0, /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- 0, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- bpy_app_handlers_persistent_new, /* tp_new */
- 0, /* tp_free */
+ "persistent", /* tp_name */
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ /* methods */
+ 0, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_reserved */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_BASETYPE, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ bpy_app_handlers_persistent_new, /* tp_new */
+ 0, /* tp_free */
};
static PyObject *py_cb_array[BLI_CB_EVT_TOT] = {NULL};
@@ -235,7 +237,7 @@ void BPY_app_handlers_reset(const short do_all)
int pos = 0;
if (do_all) {
- for (pos = 0; pos < BLI_CB_EVT_TOT; pos++) {
+ for (pos = 0; pos < BLI_CB_EVT_TOT; pos++) {
/* clear list */
PyList_SetSlice(py_cb_array[pos], 0, PY_SSIZE_T_MAX, NULL);
}
@@ -254,10 +256,10 @@ void BPY_app_handlers_reset(const short do_all)
for (i = PyList_GET_SIZE(ls) - 1; i >= 0; i--) {
- if ( (PyFunction_Check((item = PyList_GET_ITEM(ls, i)))) &&
- (dict_ptr = _PyObject_GetDictPtr(item)) &&
- (*dict_ptr) &&
- (PyDict_GetItem(*dict_ptr, perm_id_str) != NULL))
+ if ((PyFunction_Check((item = PyList_GET_ITEM(ls, i)))) &&
+ (dict_ptr = _PyObject_GetDictPtr(item)) &&
+ (*dict_ptr) &&
+ (PyDict_GetItem(*dict_ptr, perm_id_str) != NULL))
{
/* keep */
}
@@ -277,13 +279,12 @@ void BPY_app_handlers_reset(const short do_all)
void bpy_app_generic_callback(struct Main *UNUSED(main), struct ID *id, void *arg)
{
PyObject *cb_list = py_cb_array[GET_INT_FROM_POINTER(arg)];
- Py_ssize_t cb_list_len;
- if ((cb_list_len = PyList_GET_SIZE(cb_list)) > 0) {
+ if (PyList_GET_SIZE(cb_list) > 0) {
PyGILState_STATE gilstate = PyGILState_Ensure();
- PyObject* args = PyTuple_New(1); // save python creating each call
- PyObject* func;
- PyObject* ret;
+ PyObject *args = PyTuple_New(1); // save python creating each call
+ PyObject *func;
+ PyObject *ret;
Py_ssize_t pos;
/* setup arguments */
@@ -297,8 +298,9 @@ void bpy_app_generic_callback(struct Main *UNUSED(main), struct ID *id, void *ar
Py_INCREF(Py_None);
}
- // Iterate the list and run the callbacks
- for (pos = 0; pos < cb_list_len; pos++) {
+ /* Iterate the list and run the callbacks
+ * note: don't store the list size since the scripts may remove themselves */
+ for (pos = 0; pos < PyList_GET_SIZE(cb_list); pos++) {
func = PyList_GET_ITEM(cb_list, pos);
ret = PyObject_Call(func, args, NULL);
if (ret == NULL) {
diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c
index 95b00b18f43..e2acef7bb73 100644
--- a/source/blender/python/intern/bpy_driver.c
+++ b/source/blender/python/intern/bpy_driver.c
@@ -70,7 +70,7 @@ int bpy_pydriver_create_dict(void)
mod = PyImport_ImportModule("math");
if (mod) {
- PyDict_Merge(d, PyModule_GetDict(mod), 0); /* 0 - dont overwrite existing values */
+ PyDict_Merge(d, PyModule_GetDict(mod), 0); /* 0 - don't overwrite existing values */
Py_DECREF(mod);
}
@@ -159,14 +159,14 @@ static void pydriver_error(ChannelDriver *driver)
/* This evals py driver expressions, 'expr' is a Python expression that
* should evaluate to a float number, which is returned.
*
- * (old)note: PyGILState_Ensure() isnt always called because python can call
+ * (old)note: PyGILState_Ensure() isn't always called because python can call
* the bake operator which intern starts a thread which calls scene update
* which does a driver update. to avoid a deadlock check PYC_INTERPRETER_ACTIVE
* if PyGILState_Ensure() is needed - see [#27683]
*
* (new)note: checking if python is running is not threadsafe [#28114]
* now release the GIL on python operator execution instead, using
- * PyEval_SaveThread() / PyEval_RestoreThread() so we dont lock up blender.
+ * PyEval_SaveThread() / PyEval_RestoreThread() so we don't lock up blender.
*/
float BPY_driver_exec(ChannelDriver *driver, const float evaltime)
{
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 413b29e7e2d..7b362e56c73 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -52,6 +52,7 @@
#include "DNA_text_types.h"
#include "BLI_path_util.h"
+#include "BLI_fileops.h"
#include "BLI_math_base.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
@@ -77,7 +78,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 */
@@ -85,10 +86,10 @@ BPy_StructRNA *bpy_context_module = NULL; /* for fast access */
#ifdef TIME_PY_RUN
#include "PIL_time.h"
-static int bpy_timer_count = 0;
-static double bpy_timer; /* time since python starts */
-static double bpy_timer_run; /* time for each python script run */
-static double bpy_timer_run_tot; /* accumulate python runs */
+static int bpy_timer_count = 0;
+static double bpy_timer; /* time since python starts */
+static double bpy_timer_run; /* time for each python script run */
+static double bpy_timer_run_tot; /* accumulate python runs */
#endif
/* use for updating while a python script runs - in case of file load */
@@ -96,7 +97,7 @@ void bpy_context_update(bContext *C)
{
BPy_SetContext(C);
bpy_import_main_set(CTX_data_main(C));
- BPY_modules_update(C); /* can give really bad results if this isnt here */
+ BPY_modules_update(C); /* can give really bad results if this isn't here */
}
void bpy_context_set(bContext *C, PyGILState_STATE *gilstate)
@@ -183,7 +184,7 @@ extern PyObject *AUD_initPython(void);
/* defined in cycles module */
static PyObject *CCL_initPython(void)
{
- return (PyObject*)CCL_python_module_init();
+ return (PyObject *)CCL_python_module_init();
}
#endif
@@ -194,8 +195,8 @@ static struct _inittab bpy_internal_modules[] = {
{(char *)"bgl", BPyInit_bgl},
{(char *)"blf", BPyInit_blf},
{(char *)"bmesh", BPyInit_bmesh},
- // {(char *)"bmesh.types", BPyInit_bmesh_types},
- // {(char *)"bmesh.utils", BPyInit_bmesh_utils},
+ // {(char *)"bmesh.types", BPyInit_bmesh_types},
+ // {(char *)"bmesh.utils", BPyInit_bmesh_utils},
#ifdef WITH_AUDASPACE
{(char *)"aud", AUD_initPython},
#endif
@@ -238,7 +239,7 @@ void BPY_python_start(int argc, const char **argv)
Py_Initialize();
// PySys_SetArgv(argc, argv); // broken in py3, not a huge deal
- /* sigh, why do python guys not have a char** version anymore? :( */
+ /* sigh, why do python guys not have a (char **) version anymore? */
{
int i;
PyObject *py_argv = PyList_New(argc);
@@ -307,10 +308,10 @@ void BPY_python_end(void)
printf("tot exec: %d, ", bpy_timer_count);
printf("tot run: %.4fsec, ", bpy_timer_run_tot);
if (bpy_timer_count > 0)
- printf("average run: %.6fsec, ", (bpy_timer_run_tot/bpy_timer_count));
+ printf("average run: %.6fsec, ", (bpy_timer_run_tot / bpy_timer_count));
if (bpy_timer > 0.0)
- printf("tot usage %.4f%%", (bpy_timer_run_tot/bpy_timer) * 100.0);
+ printf("tot usage %.4f%%", (bpy_timer_run_tot / bpy_timer) * 100.0);
printf("\n");
@@ -366,7 +367,7 @@ static int python_script_exec(bContext *C, const char *fn, struct Text *text,
char fn_dummy[FILE_MAXDIR];
bpy_text_filename_get(fn_dummy, sizeof(fn_dummy), text);
- if (text->compiled == NULL) { /* if it wasn't already compiled, do it now */
+ if (text->compiled == NULL) { /* if it wasn't already compiled, do it now */
char *buf = txt_to_buf(text);
text->compiled = Py_CompileString(buf, fn_dummy, Py_file_input);
@@ -388,7 +389,7 @@ static int python_script_exec(bContext *C, const char *fn, struct Text *text,
}
else {
- FILE *fp = fopen(fn, "r");
+ FILE *fp = BLI_fopen(fn, "r");
if (fp) {
py_dict = PyC_DefaultNameSpace(fn);
@@ -497,7 +498,7 @@ int BPY_button_exec(bContext *C, const char *expr, double *value, const short ve
mod = PyImport_ImportModule("math");
if (mod) {
- PyDict_Merge(py_dict, PyModule_GetDict(mod), 0); /* 0 - dont overwrite existing values */
+ PyDict_Merge(py_dict, PyModule_GetDict(mod), 0); /* 0 - don't overwrite existing values */
Py_DECREF(mod);
}
else { /* highly unlikely but possibly */
@@ -671,11 +672,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);
}
@@ -691,11 +692,11 @@ int BPY_context_member_get(bContext *C, const char *member, bContextDataResult *
}
if (done == 0) {
- if (item) printf("PyContext '%s' not a valid type\n", member);
- else printf("PyContext '%s' not found\n", member);
+ if (item) printf("PyContext '%s' not a valid type\n", member);
+ else printf("PyContext '%s' not found\n", member);
}
else {
- if (G.f & G_DEBUG) {
+ if (G.debug & G_DEBUG_PYTHON) {
printf("PyContext '%s' found\n", member);
}
}
@@ -705,7 +706,7 @@ int BPY_context_member_get(bContext *C, const char *member, bContextDataResult *
#ifdef WITH_PYTHON_MODULE
#include "BLI_fileops.h"
-/* TODO, reloading the module isnt functional at the moment. */
+/* TODO, reloading the module isn't functional at the moment. */
static void bpy_module_free(void *mod);
extern int main_python_enter(int argc, const char **argv);
@@ -782,7 +783,7 @@ PyInit_bpy(void)
* we may end up having to rename this module so there is no naming conflict here eg:
* 'from blender import bpy'
*
- * 3) we dont know the filename at this point, workaround by assigning a dummy value
+ * 3) we don't know the filename at this point, workaround by assigning a dummy value
* which calls back when its freed so the real loading can take place.
*/
diff --git a/source/blender/python/intern/bpy_interface_atexit.c b/source/blender/python/intern/bpy_interface_atexit.c
index 53775e7d893..db97d361c73 100644
--- a/source/blender/python/intern/bpy_interface_atexit.c
+++ b/source/blender/python/intern/bpy_interface_atexit.c
@@ -62,7 +62,7 @@ static void atexit_func_call(const char *func_name, PyObject *atexit_func_arg)
PyObject *ret;
PyTuple_SET_ITEM(args, 0, atexit_func_arg);
- Py_INCREF(atexit_func_arg); /* only incref so we dont dec'ref along with 'args' */
+ Py_INCREF(atexit_func_arg); /* only incref so we don't dec'ref along with 'args' */
ret = PyObject_CallObject(atexit_func, args);
@@ -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_library.c b/source/blender/python/intern/bpy_library.c
index ed3b758a6b4..a5350b984c1 100644
--- a/source/blender/python/intern/bpy_library.c
+++ b/source/blender/python/intern/bpy_library.c
@@ -62,7 +62,7 @@
#endif
typedef struct {
- PyObject_HEAD /* required python macro */
+ PyObject_HEAD /* required python macro */
/* collection iterator specific parts */
char relpath[FILE_MAX];
char abspath[FILE_MAX]; /* absolute path */
@@ -92,75 +92,75 @@ static void bpy_lib_dealloc(BPy_Library *self)
static PyTypeObject bpy_lib_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
- "bpy_lib", /* tp_name */
- sizeof(BPy_Library), /* tp_basicsize */
- 0, /* tp_itemsize */
+ "bpy_lib", /* tp_name */
+ sizeof(BPy_Library), /* tp_basicsize */
+ 0, /* tp_itemsize */
/* methods */
- (destructor)bpy_lib_dealloc,/* tp_dealloc */
+ (destructor)bpy_lib_dealloc, /* tp_dealloc */
NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
+ NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
- NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */
- NULL, /* tp_repr */
+ NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */
+ NULL, /* tp_repr */
/* Method suites for standard classes */
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
+ NULL, /* PyNumberMethods *tp_as_number; */
+ NULL, /* PySequenceMethods *tp_as_sequence; */
+ NULL, /* PyMappingMethods *tp_as_mapping; */
/* More standard operations (here for binary compatibility) */
- NULL, /* hashfunc tp_hash; */
+ NULL, /* hashfunc tp_hash; */
NULL, /* ternaryfunc tp_call; */
NULL, /* reprfunc tp_str; */
/* will only use these if this is a subtype of a py class */
- NULL /*PyObject_GenericGetAttr is assigned later */, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
+ NULL /*PyObject_GenericGetAttr is assigned later */, /* getattrofunc tp_getattro; */
+ NULL, /* setattrofunc tp_setattro; */
/* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */
- /*** Flags to define presence of optional/expanded features ***/
+ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
+ NULL, /* char *tp_doc; Documentation string */
+ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */
/* delete references to contained objects */
NULL, /* inquiry tp_clear; */
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
NULL, /* subclassed */ /* richcmpfunc tp_richcompare; */
- /*** weak reference enabler ***/
+ /*** weak reference enabler ***/
0,
- /*** Added in release 2.2 ***/
+ /*** Added in release 2.2 ***/
/* Iterators */
- NULL, /* getiterfunc tp_iter; */
+ NULL, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */
- /*** Attribute descriptor and subclassing stuff ***/
- bpy_lib_methods, /* struct PyMethodDef *tp_methods; */
+ /*** Attribute descriptor and subclassing stuff ***/
+ bpy_lib_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
- NULL, /* struct PyGetSetDef *tp_getset; */
+ NULL, /* struct PyGetSetDef *tp_getset; */
NULL, /* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */
NULL, /* descrgetfunc tp_descr_get; */
NULL, /* descrsetfunc tp_descr_set; */
- offsetof(BPy_Library, dict),/* long tp_dictoffset; */
+ offsetof(BPy_Library, dict), /* long tp_dictoffset; */
NULL, /* initproc tp_init; */
NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
+ NULL, /* newfunc tp_new; */
/* Low-level free-memory routine */
NULL, /* freefunc tp_free; */
/* For PyObject_IS_GC */
NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
+ NULL, /* PyObject *tp_bases; */
/* method resolution order */
NULL, /* PyObject *tp_mro; */
NULL, /* PyObject *tp_cache; */
@@ -170,23 +170,23 @@ static PyTypeObject bpy_lib_Type = {
};
PyDoc_STRVAR(bpy_lib_load_doc,
-".. method:: load(filepath, link=False, relative=False)\n"
-"\n"
-" Returns a context manager which exposes 2 library objects on entering.\n"
-" Each object has attributes matching bpy.data which are lists of strings to be linked.\n"
-"\n"
-" :arg filepath: The path to a blend file.\n"
-" :type filepath: string\n"
-" :arg link: When False reference to the original file is lost.\n"
-" :type link: bool\n"
-" :arg relative: When True the path is stored relative to the open blend file.\n"
-" :type relative: bool\n"
-);
+ ".. method:: load(filepath, link=False, relative=False)\n"
+ "\n"
+ " Returns a context manager which exposes 2 library objects on entering.\n"
+ " Each object has attributes matching bpy.data which are lists of strings to be linked.\n"
+ "\n"
+ " :arg filepath: The path to a blend file.\n"
+ " :type filepath: string\n"
+ " :arg link: When False reference to the original file is lost.\n"
+ " :type link: bool\n"
+ " :arg relative: When True the path is stored relative to the open blend file.\n"
+ " :type relative: bool\n"
+ );
static PyObject *bpy_lib_load(PyObject *UNUSED(self), PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"filepath", "link", "relative", NULL};
BPy_Library *ret;
- const char* filename = NULL;
+ const char *filename = NULL;
int is_rel = 0, is_link = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|ii:load", (char **)kwlist, &filename, &is_link, &is_rel))
@@ -199,8 +199,8 @@ static PyObject *bpy_lib_load(PyObject *UNUSED(self), PyObject *args, PyObject *
BLI_path_abs(ret->abspath, G.main->name);
ret->blo_handle = NULL;
- ret->flag= (is_link ? FILE_LINK : 0) |
- (is_rel ? FILE_RELPATH : 0);
+ ret->flag = ((is_link ? FILE_LINK : 0) |
+ (is_rel ? FILE_RELPATH : 0));
ret->dict = PyDict_New();
@@ -222,7 +222,7 @@ static PyObject *_bpy_names(BPy_Library *self, int blocktype)
PyList_SET_ITEM(list, counter, PyUnicode_FromString((char *)l->link));
counter++;
}
- BLI_linklist_free(names, free); /* free linklist *and* each node's data */
+ BLI_linklist_free(names, free); /* free linklist *and* each node's data */
}
else {
list = PyList_New(0);
@@ -401,7 +401,8 @@ static PyObject *bpy_lib_exit(BPy_Library *self, PyObject *UNUSED(args))
BLO_blendhandle_close(self->blo_handle);
self->blo_handle = NULL;
- { /* copied from wm_operator.c */
+ /* copied from wm_operator.c */
+ {
/* mark all library linked objects to be updated */
recalc_all_library_objects(G.main);
@@ -426,12 +427,12 @@ static PyObject *bpy_lib_dir(BPy_Library *self)
int bpy_lib_init(PyObject *mod_par)
{
static PyMethodDef load_meth = {"load", (PyCFunction)bpy_lib_load,
- METH_STATIC|METH_VARARGS|METH_KEYWORDS,
- bpy_lib_load_doc};
+ METH_STATIC | METH_VARARGS | METH_KEYWORDS,
+ bpy_lib_load_doc};
PyModule_AddObject(mod_par, "_library_load", PyCFunction_New(&load_meth, NULL));
- /* some compilers dont like accessing this directly, delay assignment */
+ /* some compilers don't like accessing this directly, delay assignment */
bpy_lib_Type.tp_getattro = PyObject_GenericGetAttr;
if (PyType_Ready(&bpy_lib_Type) < 0)
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index 6a6e6595ed4..8f5a9fec86b 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -65,11 +65,11 @@
static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args)
{
wmOperatorType *ot;
- char *opname;
- PyObject *context_dict = NULL; /* optional args */
- PyObject *context_dict_back;
- char *context_str = NULL;
- PyObject *ret;
+ char *opname;
+ PyObject *context_dict = NULL; /* optional args */
+ PyObject *context_dict_back;
+ char *context_str = NULL;
+ PyObject *ret;
int context = WM_OP_EXEC_DEFAULT;
@@ -139,11 +139,11 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
PointerRNA ptr;
int operator_ret = OPERATOR_CANCELLED;
- char *opname;
- char *context_str = NULL;
- PyObject *kw = NULL; /* optional args */
- PyObject *context_dict = NULL; /* optional args */
- PyObject *context_dict_back;
+ char *opname;
+ char *context_str = NULL;
+ PyObject *kw = NULL; /* optional args */
+ PyObject *context_dict = NULL; /* optional args */
+ PyObject *context_dict_back;
/* note that context is an int, python does the conversion in this case */
int context = WM_OP_EXEC_DEFAULT;
@@ -225,7 +225,7 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
ReportList *reports;
reports = MEM_mallocN(sizeof(ReportList), "wmOperatorReportList");
- BKE_reports_init(reports, RPT_STORE | RPT_OP_HOLD); /* own so these dont move into global reports */
+ BKE_reports_init(reports, RPT_STORE | RPT_OP_HOLD); /* own so these don't move into global reports */
#ifdef BPY_RELEASE_GIL
/* release GIL, since a thread could be started from an operator
@@ -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);
}
}
@@ -307,8 +306,8 @@ static PyObject *pyop_as_string(PyObject *UNUSED(self), PyObject *args)
wmOperatorType *ot;
PointerRNA ptr;
- char *opname;
- PyObject *kw = NULL; /* optional args */
+ char *opname;
+ PyObject *kw = NULL; /* optional args */
int all_args = 1;
int error_val = 0;
@@ -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);
@@ -463,7 +462,7 @@ static struct PyModuleDef bpy_ops_module = {
PyModuleDef_HEAD_INIT,
"_bpy.ops",
NULL,
- -1,/* multiple "initialization" just copies the module dict. */
+ -1, /* multiple "initialization" just copies the module dict. */
bpy_ops_methods,
NULL, NULL, NULL, NULL
};
diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c
index 39780e7e257..1caec294aa0 100644
--- a/source/blender/python/intern/bpy_operator_wrap.c
+++ b/source/blender/python/intern/bpy_operator_wrap.c
@@ -69,7 +69,8 @@ void operator_wrapper(wmOperatorType *ot, void *userdata)
operator_properties_init(ot);
- { /* XXX - not nice, set the first enum as searchable, should have a way for python to set */
+ /* XXX - not nice, set the first enum as searchable, should have a way for python to set */
+ {
PointerRNA ptr;
PropertyRNA *prop;
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index 414ebe47e97..4d0c05f6582 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}};
@@ -155,10 +155,10 @@ static void printf_func_error(PyObject *py_func)
/* use py style error */
fprintf(stderr, "File \"%s\", line %d, in %s\n",
- _PyUnicode_AsString(f_code->co_filename),
- f_code->co_firstlineno,
- _PyUnicode_AsString(((PyFunctionObject *)py_func)->func_name)
- );
+ _PyUnicode_AsString(f_code->co_filename),
+ f_code->co_firstlineno,
+ _PyUnicode_AsString(((PyFunctionObject *)py_func)->func_name)
+ );
}
/* operators and classes use this so it can store the args given but defer
@@ -372,7 +372,7 @@ static int bpy_struct_id_used(StructRNA *srna, char *identifier)
/* Function that sets RNA, NOTE - self is NULL when called from python,
* but being abused from C so we can pass the srna along.
- * This isnt incorrect since its a python object - but be careful */
+ * This isn't incorrect since its a python object - but be careful */
PyDoc_STRVAR(BPy_BoolProperty_doc,
".. function:: BoolProperty(name=\"\", "
"description=\"\", "
@@ -399,7 +399,7 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
if (srna) {
static const char *kwlist[] = {"attr", "name", "description", "default",
- "options", "subtype", "update", NULL};
+ "options", "subtype", "update", NULL};
const char *id = NULL, *name = NULL, *description = "";
int id_len;
int def = 0;
@@ -475,7 +475,7 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject
if (srna) {
static const char *kwlist[] = {"attr", "name", "description", "default",
- "options", "subtype", "size", "update", NULL};
+ "options", "subtype", "size", "update", NULL};
const char *id = NULL, *name = NULL, *description = "";
int id_len;
int def[PYRNA_STACK_ARRAY] = {0};
@@ -561,7 +561,7 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
if (srna) {
static const char *kwlist[] = {"attr", "name", "description", "default",
- "min", "max", "soft_min", "soft_max",
+ "min", "max", "soft_min", "soft_max",
"step", "options", "subtype", "update", NULL};
const char *id = NULL, *name = NULL, *description = "";
int id_len;
@@ -642,8 +642,8 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject
if (srna) {
static const char *kwlist[] = {"attr", "name", "description", "default",
- "min", "max", "soft_min", "soft_max",
- "step", "options", "subtype", "size", "update", NULL};
+ "min", "max", "soft_min", "soft_max",
+ "step", "options", "subtype", "size", "update", NULL};
const char *id = NULL, *name = NULL, *description = "";
int id_len;
int min = INT_MIN, max = INT_MAX, soft_min = INT_MIN, soft_max = INT_MAX, step = 1;
@@ -736,8 +736,8 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
if (srna) {
static const char *kwlist[] = {"attr", "name", "description", "default",
- "min", "max", "soft_min", "soft_max",
- "step", "precision", "options", "subtype", "unit", "update", NULL};
+ "min", "max", "soft_min", "soft_max",
+ "step", "precision", "options", "subtype", "unit", "update", NULL};
const char *id = NULL, *name = NULL, *description = "";
int id_len;
float min = -FLT_MAX, max = FLT_MAX, soft_min = -FLT_MAX, soft_max = FLT_MAX, step = 3, def = 0.0f;
@@ -829,8 +829,8 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
if (srna) {
static const char *kwlist[] = {"attr", "name", "description", "default",
- "min", "max", "soft_min", "soft_max",
- "step", "precision", "options", "subtype", "unit", "size", "update", NULL};
+ "min", "max", "soft_min", "soft_max",
+ "step", "precision", "options", "subtype", "unit", "size", "update", NULL};
const char *id = NULL, *name = NULL, *description = "";
int id_len;
float min = -FLT_MAX, max = FLT_MAX, soft_min = -FLT_MAX, soft_max = FLT_MAX, step = 3;
@@ -924,7 +924,7 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw
if (srna) {
static const char *kwlist[] = {"attr", "name", "description", "default",
- "maxlen", "options", "subtype", "update", NULL};
+ "maxlen", "options", "subtype", "update", NULL};
const char *id = NULL, *name = NULL, *description = "", *def = "";
int id_len;
int maxlen = 0;
@@ -952,7 +952,7 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw
}
prop = RNA_def_property(srna, id, PROP_STRING, subtype);
- if (maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen + 1); /* +1 since it includes null terminator */
+ if (maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen + 1); /* +1 since it includes null terminator */
if (def) RNA_def_property_string_default(prop, def);
RNA_def_property_ui_text(prop, name ? name : id, description);
@@ -1033,14 +1033,14 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
item = PySequence_Fast_GET_ITEM(seq_fast, i);
- if ( (PyTuple_CheckExact(item)) &&
- (item_size = PyTuple_GET_SIZE(item)) &&
- (item_size == 3 || item_size == 4) &&
- (tmp.identifier = _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 0), &id_str_size)) &&
- (tmp.name = _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 1), &name_str_size)) &&
- (tmp.description = _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 2), &desc_str_size)) &&
- /* TODO, number isnt ensured to be unique from the script author */
- (item_size < 4 || py_long_as_int(PyTuple_GET_ITEM(item, 3), &tmp.value) != -1))
+ if ((PyTuple_CheckExact(item)) &&
+ (item_size = PyTuple_GET_SIZE(item)) &&
+ (item_size == 3 || item_size == 4) &&
+ (tmp.identifier = _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 0), &id_str_size)) &&
+ (tmp.name = _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 1), &name_str_size)) &&
+ (tmp.description = _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 2), &desc_str_size)) &&
+ /* TODO, number isn't ensured to be unique from the script author */
+ (item_size < 4 || py_long_as_int(PyTuple_GET_ITEM(item, 3), &tmp.value) != -1))
{
if (is_enum_flag) {
if (item_size < 4) {
@@ -1110,7 +1110,7 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
* annoying because it works most of the time without this. */
{
EnumPropertyItem *items_dup = MEM_mallocN((sizeof(EnumPropertyItem) * (seq_len + 1)) + (sizeof(char) * totbuf),
- "enum_items_from_py2");
+ "enum_items_from_py2");
EnumPropertyItem *items_ptr = items_dup;
char *buf = ((char *)items_dup) + (sizeof(EnumPropertyItem) * (seq_len + 1));
memcpy(items_dup, items, sizeof(EnumPropertyItem) * (seq_len + 1));
@@ -1162,7 +1162,7 @@ static EnumPropertyItem *bpy_props_enum_itemf(struct bContext *C, PointerRNA *pt
int defvalue_dummy = 0;
if (!(items_fast = PySequence_Fast(items, "EnumProperty(...): "
- "return value from the callback was not a sequence")))
+ "return value from the callback was not a sequence")))
{
err = -1;
}
@@ -1230,7 +1230,7 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
if (srna) {
static const char *kwlist[] = {"attr", "items", "name", "description", "default",
- "options", "update", NULL};
+ "options", "update", NULL};
const char *id = NULL, *name = NULL, *description = "";
PyObject *def = NULL;
int id_len;
@@ -1260,7 +1260,7 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
}
/* items can be a list or a callable */
- if (PyFunction_Check(items)) { /* dont use PyCallable_Check because we need the function code for errors */
+ if (PyFunction_Check(items)) { /* don't use PyCallable_Check because we need the function code for errors */
PyCodeObject *f_code = (PyCodeObject *)PyFunction_GET_CODE(items);
if (f_code->co_argcount != 2) {
PyErr_Format(PyExc_ValueError,
@@ -1281,7 +1281,7 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
}
else {
if (!(items_fast = PySequence_Fast(items, "EnumProperty(...): "
- "expected a sequence of tuples for the enum items or a function")))
+ "expected a sequence of tuples for the enum items or a function")))
{
return NULL;
}
@@ -1531,18 +1531,18 @@ static PyObject *BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw
}
static struct PyMethodDef props_methods[] = {
- {"BoolProperty", (PyCFunction)BPy_BoolProperty, METH_VARARGS|METH_KEYWORDS, BPy_BoolProperty_doc},
- {"BoolVectorProperty", (PyCFunction)BPy_BoolVectorProperty, METH_VARARGS|METH_KEYWORDS, BPy_BoolVectorProperty_doc},
- {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, BPy_IntProperty_doc},
- {"IntVectorProperty", (PyCFunction)BPy_IntVectorProperty, METH_VARARGS|METH_KEYWORDS, BPy_IntVectorProperty_doc},
- {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, BPy_FloatProperty_doc},
- {"FloatVectorProperty", (PyCFunction)BPy_FloatVectorProperty, METH_VARARGS|METH_KEYWORDS, BPy_FloatVectorProperty_doc},
- {"StringProperty", (PyCFunction)BPy_StringProperty, METH_VARARGS|METH_KEYWORDS, BPy_StringProperty_doc},
- {"EnumProperty", (PyCFunction)BPy_EnumProperty, METH_VARARGS|METH_KEYWORDS, BPy_EnumProperty_doc},
- {"PointerProperty", (PyCFunction)BPy_PointerProperty, METH_VARARGS|METH_KEYWORDS, BPy_PointerProperty_doc},
- {"CollectionProperty", (PyCFunction)BPy_CollectionProperty, METH_VARARGS|METH_KEYWORDS, BPy_CollectionProperty_doc},
-
- {"RemoveProperty", (PyCFunction)BPy_RemoveProperty, METH_VARARGS|METH_KEYWORDS, BPy_RemoveProperty_doc},
+ {"BoolProperty", (PyCFunction)BPy_BoolProperty, METH_VARARGS | METH_KEYWORDS, BPy_BoolProperty_doc},
+ {"BoolVectorProperty", (PyCFunction)BPy_BoolVectorProperty, METH_VARARGS | METH_KEYWORDS, BPy_BoolVectorProperty_doc},
+ {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS | METH_KEYWORDS, BPy_IntProperty_doc},
+ {"IntVectorProperty", (PyCFunction)BPy_IntVectorProperty, METH_VARARGS | METH_KEYWORDS, BPy_IntVectorProperty_doc},
+ {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS | METH_KEYWORDS, BPy_FloatProperty_doc},
+ {"FloatVectorProperty", (PyCFunction)BPy_FloatVectorProperty, METH_VARARGS | METH_KEYWORDS, BPy_FloatVectorProperty_doc},
+ {"StringProperty", (PyCFunction)BPy_StringProperty, METH_VARARGS | METH_KEYWORDS, BPy_StringProperty_doc},
+ {"EnumProperty", (PyCFunction)BPy_EnumProperty, METH_VARARGS | METH_KEYWORDS, BPy_EnumProperty_doc},
+ {"PointerProperty", (PyCFunction)BPy_PointerProperty, METH_VARARGS | METH_KEYWORDS, BPy_PointerProperty_doc},
+ {"CollectionProperty", (PyCFunction)BPy_CollectionProperty, METH_VARARGS | METH_KEYWORDS, BPy_CollectionProperty_doc},
+
+ {"RemoveProperty", (PyCFunction)BPy_RemoveProperty, METH_VARARGS | METH_KEYWORDS, BPy_RemoveProperty_doc},
{NULL, NULL, 0, NULL}
};
@@ -1551,7 +1551,7 @@ static struct PyModuleDef props_module = {
"bpy.props",
"This module defines properties to extend blenders internal data, the result of these functions"
" is used to assign properties to classes registered with blender and can't be used directly.",
- -1,/* multiple "initialization" just copies the module dict. */
+ -1, /* multiple "initialization" just copies the module dict. */
props_methods,
NULL, NULL, NULL, NULL
};
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 2072070102a..53f9e46ba13 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -85,7 +85,7 @@
#define USE_MATHUTILS
#define USE_STRING_COERCE
-static PyObject* pyrna_struct_Subtype(PointerRNA *ptr);
+static PyObject *pyrna_struct_Subtype(PointerRNA *ptr);
static PyObject *pyrna_prop_collection_values(BPy_PropertyRNA *self);
#define BPY_DOC_ID_PROP_TYPE_NOTE \
@@ -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
@@ -372,7 +372,7 @@ static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, Po
static short pyrna_rotation_euler_order_get(PointerRNA *ptr, PropertyRNA **prop_eul_order, short order_fallback);
/* bpyrna vector/euler/quat callbacks */
-static int mathutils_rna_array_cb_index = -1; /* index for our callbacks */
+static unsigned char mathutils_rna_array_cb_index = -1; /* index for our callbacks */
/* subtype not used much yet */
#define MATHUTILS_CB_SUBTYPE_EUL 0
@@ -508,16 +508,16 @@ static int mathutils_rna_vector_set_index(BaseMathObject *bmo, int UNUSED(subtyp
}
static Mathutils_Callback mathutils_rna_array_cb = {
- (BaseMathCheckFunc) mathutils_rna_generic_check,
- (BaseMathGetFunc) mathutils_rna_vector_get,
- (BaseMathSetFunc) mathutils_rna_vector_set,
- (BaseMathGetIndexFunc) mathutils_rna_vector_get_index,
- (BaseMathSetIndexFunc) mathutils_rna_vector_set_index
+ (BaseMathCheckFunc) mathutils_rna_generic_check,
+ (BaseMathGetFunc) mathutils_rna_vector_get,
+ (BaseMathSetFunc) mathutils_rna_vector_set,
+ (BaseMathGetIndexFunc) mathutils_rna_vector_get_index,
+ (BaseMathSetIndexFunc) mathutils_rna_vector_set_index
};
/* bpyrna matrix callbacks */
-static int mathutils_rna_matrix_cb_index = -1; /* index for our callbacks */
+static unsigned char mathutils_rna_matrix_cb_index = -1; /* index for our callbacks */
static int mathutils_rna_matrix_get(BaseMathObject *bmo, int UNUSED(subtype))
{
@@ -622,91 +622,91 @@ PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop)
if (totdim == 1 || (totdim == 2 && subtype == PROP_MATRIX)) {
if (!is_thick)
- ret = pyrna_prop_CreatePyObject(ptr, prop); /* owned by the mathutils PyObject */
+ ret = pyrna_prop_CreatePyObject(ptr, prop); /* owned by the mathutils PyObject */
switch (subtype) {
- case PROP_ALL_VECTOR_SUBTYPES:
- if (len >= 2 && len <= 4) {
- if (is_thick) {
- ret = Vector_CreatePyObject(NULL, len, Py_NEW, NULL);
- RNA_property_float_get_array(ptr, prop, ((VectorObject *)ret)->vec);
- }
- else {
- PyObject *vec_cb = Vector_CreatePyObject_cb(ret, len, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_VEC);
- Py_DECREF(ret); /* the vector owns now */
- ret = vec_cb; /* return the vector instead */
- }
- }
- break;
- case PROP_MATRIX:
- if (len == 16) {
- if (is_thick) {
- ret = Matrix_CreatePyObject(NULL, 4, 4, Py_NEW, NULL);
- RNA_property_float_get_array(ptr, prop, ((MatrixObject *)ret)->matrix);
- }
- else {
- PyObject *mat_cb = Matrix_CreatePyObject_cb(ret, 4,4, mathutils_rna_matrix_cb_index, FALSE);
- Py_DECREF(ret); /* the matrix owns now */
- ret = mat_cb; /* return the matrix instead */
- }
- }
- else if (len == 9) {
- if (is_thick) {
- ret = Matrix_CreatePyObject(NULL, 3, 3, Py_NEW, NULL);
- RNA_property_float_get_array(ptr, prop, ((MatrixObject *)ret)->matrix);
- }
- else {
- PyObject *mat_cb = Matrix_CreatePyObject_cb(ret, 3,3, mathutils_rna_matrix_cb_index, FALSE);
- Py_DECREF(ret); /* the matrix owns now */
- ret = mat_cb; /* return the matrix instead */
- }
- }
- break;
- case PROP_EULER:
- case PROP_QUATERNION:
- if (len == 3) { /* euler */
- if (is_thick) {
- /* attempt to get order, only needed for thick types since wrapped with update via callbacks */
- PropertyRNA *prop_eul_order = NULL;
- short order = pyrna_rotation_euler_order_get(ptr, &prop_eul_order, EULER_ORDER_XYZ);
-
- ret = Euler_CreatePyObject(NULL, order, Py_NEW, NULL); // TODO, get order from RNA
- RNA_property_float_get_array(ptr, prop, ((EulerObject *)ret)->eul);
+ case PROP_ALL_VECTOR_SUBTYPES:
+ if (len >= 2 && len <= 4) {
+ if (is_thick) {
+ ret = Vector_CreatePyObject(NULL, len, Py_NEW, NULL);
+ RNA_property_float_get_array(ptr, prop, ((VectorObject *)ret)->vec);
+ }
+ else {
+ PyObject *vec_cb = Vector_CreatePyObject_cb(ret, len, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_VEC);
+ Py_DECREF(ret); /* the vector owns now */
+ ret = vec_cb; /* return the vector instead */
+ }
}
- else {
- /* order will be updated from callback on use */
- PyObject *eul_cb = Euler_CreatePyObject_cb(ret, EULER_ORDER_XYZ, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_EUL); // TODO, get order from RNA
- Py_DECREF(ret); /* the euler owns now */
- ret = eul_cb; /* return the euler instead */
+ break;
+ case PROP_MATRIX:
+ if (len == 16) {
+ if (is_thick) {
+ ret = Matrix_CreatePyObject(NULL, 4, 4, Py_NEW, NULL);
+ RNA_property_float_get_array(ptr, prop, ((MatrixObject *)ret)->matrix);
+ }
+ else {
+ PyObject *mat_cb = Matrix_CreatePyObject_cb(ret, 4, 4, mathutils_rna_matrix_cb_index, FALSE);
+ Py_DECREF(ret); /* the matrix owns now */
+ ret = mat_cb; /* return the matrix instead */
+ }
}
- }
- else if (len == 4) {
- if (is_thick) {
- ret = Quaternion_CreatePyObject(NULL, Py_NEW, NULL);
- RNA_property_float_get_array(ptr, prop, ((QuaternionObject *)ret)->quat);
+ else if (len == 9) {
+ if (is_thick) {
+ ret = Matrix_CreatePyObject(NULL, 3, 3, Py_NEW, NULL);
+ RNA_property_float_get_array(ptr, prop, ((MatrixObject *)ret)->matrix);
+ }
+ else {
+ PyObject *mat_cb = Matrix_CreatePyObject_cb(ret, 3, 3, mathutils_rna_matrix_cb_index, FALSE);
+ Py_DECREF(ret); /* the matrix owns now */
+ ret = mat_cb; /* return the matrix instead */
+ }
}
- else {
- PyObject *quat_cb = Quaternion_CreatePyObject_cb(ret, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_QUAT);
- Py_DECREF(ret); /* the quat owns now */
- ret = quat_cb; /* return the quat instead */
+ break;
+ case PROP_EULER:
+ case PROP_QUATERNION:
+ if (len == 3) { /* euler */
+ if (is_thick) {
+ /* attempt to get order, only needed for thick types since wrapped with update via callbacks */
+ PropertyRNA *prop_eul_order = NULL;
+ short order = pyrna_rotation_euler_order_get(ptr, &prop_eul_order, EULER_ORDER_XYZ);
+
+ ret = Euler_CreatePyObject(NULL, order, Py_NEW, NULL); // TODO, get order from RNA
+ RNA_property_float_get_array(ptr, prop, ((EulerObject *)ret)->eul);
+ }
+ else {
+ /* order will be updated from callback on use */
+ PyObject *eul_cb = Euler_CreatePyObject_cb(ret, EULER_ORDER_XYZ, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_EUL); // TODO, get order from RNA
+ Py_DECREF(ret); /* the euler owns now */
+ ret = eul_cb; /* return the euler instead */
+ }
}
- }
- break;
- case PROP_COLOR:
- case PROP_COLOR_GAMMA:
- if (len == 3) { /* color */
- if (is_thick) {
- ret = Color_CreatePyObject(NULL, Py_NEW, NULL); // TODO, get order from RNA
- RNA_property_float_get_array(ptr, prop, ((ColorObject *)ret)->col);
+ else if (len == 4) {
+ if (is_thick) {
+ ret = Quaternion_CreatePyObject(NULL, Py_NEW, NULL);
+ RNA_property_float_get_array(ptr, prop, ((QuaternionObject *)ret)->quat);
+ }
+ else {
+ PyObject *quat_cb = Quaternion_CreatePyObject_cb(ret, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_QUAT);
+ Py_DECREF(ret); /* the quat owns now */
+ ret = quat_cb; /* return the quat instead */
+ }
}
- else {
- PyObject *col_cb = Color_CreatePyObject_cb(ret, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_COLOR);
- Py_DECREF(ret); /* the color owns now */
- ret = col_cb; /* return the color instead */
+ break;
+ case PROP_COLOR:
+ case PROP_COLOR_GAMMA:
+ if (len == 3) { /* color */
+ if (is_thick) {
+ ret = Color_CreatePyObject(NULL, Py_NEW, NULL); // TODO, get order from RNA
+ RNA_property_float_get_array(ptr, prop, ((ColorObject *)ret)->col);
+ }
+ else {
+ PyObject *col_cb = Color_CreatePyObject_cb(ret, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_COLOR);
+ Py_DECREF(ret); /* the color owns now */
+ ret = col_cb; /* return the color instead */
+ }
}
- }
- default:
- break;
+ default:
+ break;
}
}
@@ -756,15 +756,15 @@ int pyrna_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int
static int pyrna_struct_compare(BPy_StructRNA *a, BPy_StructRNA *b)
{
- return ( (a->ptr.data == b->ptr.data) &&
- (a->ptr.type == b->ptr.type)) ? 0 : -1;
+ return (((a->ptr.data == b->ptr.data) &&
+ (a->ptr.type == b->ptr.type)) ? 0 : -1);
}
static int pyrna_prop_compare(BPy_PropertyRNA *a, BPy_PropertyRNA *b)
{
- return ( (a->prop == b->prop) &&
+ return (((a->prop == b->prop) &&
(a->ptr.data == b->ptr.data) &&
- (a->ptr.type == b->ptr.type) ) ? 0 : -1;
+ (a->ptr.type == b->ptr.type)) ? 0 : -1);
}
static PyObject *pyrna_struct_richcmp(PyObject *a, PyObject *b, int op)
@@ -776,21 +776,21 @@ static PyObject *pyrna_struct_richcmp(PyObject *a, PyObject *b, int op)
ok = pyrna_struct_compare((BPy_StructRNA *)a, (BPy_StructRNA *)b);
switch (op) {
- case Py_NE:
- ok = !ok; /* pass through */
- case Py_EQ:
- res = ok ? Py_False : Py_True;
- break;
+ case Py_NE:
+ ok = !ok; /* pass through */
+ case Py_EQ:
+ res = ok ? Py_False : Py_True;
+ break;
- case Py_LT:
- case Py_LE:
- case Py_GT:
- case Py_GE:
- res = Py_NotImplemented;
- break;
- default:
- PyErr_BadArgument();
- return NULL;
+ case Py_LT:
+ case Py_LE:
+ case Py_GT:
+ case Py_GE:
+ res = Py_NotImplemented;
+ break;
+ default:
+ PyErr_BadArgument();
+ return NULL;
}
return Py_INCREF(res), res;
@@ -805,21 +805,21 @@ static PyObject *pyrna_prop_richcmp(PyObject *a, PyObject *b, int op)
ok = pyrna_prop_compare((BPy_PropertyRNA *)a, (BPy_PropertyRNA *)b);
switch (op) {
- case Py_NE:
- ok = !ok; /* pass through */
- case Py_EQ:
- res = ok ? Py_False : Py_True;
- break;
+ case Py_NE:
+ ok = !ok; /* pass through */
+ case Py_EQ:
+ res = ok ? Py_False : Py_True;
+ break;
- case Py_LT:
- case Py_LE:
- case Py_GT:
- case Py_GE:
- res = Py_NotImplemented;
- break;
- default:
- PyErr_BadArgument();
- return NULL;
+ case Py_LT:
+ case Py_LE:
+ case Py_GT:
+ case Py_GE:
+ res = Py_NotImplemented;
+ break;
+ default:
+ PyErr_BadArgument();
+ return NULL;
}
return Py_INCREF(res), res;
@@ -840,8 +840,8 @@ static PyObject *pyrna_struct_str(BPy_StructRNA *self)
name = RNA_struct_name_get_alloc(&self->ptr, NULL, 0, NULL);
if (name) {
ret = PyUnicode_FromFormat("<bpy_struct, %.200s(\"%.200s\")>",
- RNA_struct_identifier(self->ptr.type),
- name);
+ RNA_struct_identifier(self->ptr.type),
+ name);
MEM_freeN((void *)name);
return ret;
}
@@ -858,30 +858,30 @@ static PyObject *pyrna_struct_repr(BPy_StructRNA *self)
PyObject *ret;
if (id == NULL || !PYRNA_STRUCT_IS_VALID(self))
- return pyrna_struct_str(self); /* fallback */
+ return pyrna_struct_str(self); /* fallback */
tmp_str = PyUnicode_FromString(id->name + 2);
if (RNA_struct_is_ID(self->ptr.type)) {
ret = PyUnicode_FromFormat("bpy.data.%s[%R]",
- BKE_idcode_to_name_plural(GS(id->name)),
- tmp_str);
+ BKE_idcode_to_name_plural(GS(id->name)),
+ tmp_str);
}
else {
const char *path;
path = RNA_path_from_ID_to_struct(&self->ptr);
if (path) {
ret = PyUnicode_FromFormat("bpy.data.%s[%R].%s",
- BKE_idcode_to_name_plural(GS(id->name)),
- tmp_str,
- path);
+ BKE_idcode_to_name_plural(GS(id->name)),
+ tmp_str,
+ path);
MEM_freeN((void *)path);
}
else { /* cant find, print something sane */
ret = PyUnicode_FromFormat("bpy.data.%s[%R]...%s",
- BKE_idcode_to_name_plural(GS(id->name)),
- tmp_str,
- RNA_struct_identifier(self->ptr.type));
+ BKE_idcode_to_name_plural(GS(id->name)),
+ tmp_str,
+ RNA_struct_identifier(self->ptr.type));
}
}
@@ -912,7 +912,7 @@ static PyObject *pyrna_prop_str(BPy_PropertyRNA *self)
int len = -1;
char *c = type_fmt;
- while ((*c++= tolower(*type_id++))) {}
+ while ((*c++ = tolower(*type_id++))) {}
if (type == PROP_COLLECTION) {
len = pyrna_prop_collection_length(self);
@@ -932,10 +932,10 @@ static PyObject *pyrna_prop_str(BPy_PropertyRNA *self)
if (name) {
ret = PyUnicode_FromFormat("<bpy_%.200s, %.200s.%.200s(\"%.200s\")>",
- type_fmt,
- RNA_struct_identifier(self->ptr.type),
- RNA_property_identifier(self->prop),
- name);
+ type_fmt,
+ RNA_struct_identifier(self->ptr.type),
+ RNA_property_identifier(self->prop),
+ name);
MEM_freeN((void *)name);
return ret;
}
@@ -965,23 +965,23 @@ static PyObject *pyrna_prop_repr(BPy_PropertyRNA *self)
PYRNA_PROP_CHECK_OBJ(self);
if (id == NULL)
- return pyrna_prop_str(self); /* fallback */
+ return pyrna_prop_str(self); /* fallback */
tmp_str = PyUnicode_FromString(id->name + 2);
path = RNA_path_from_ID_to_property(&self->ptr, self->prop);
if (path) {
ret = PyUnicode_FromFormat("bpy.data.%s[%R].%s",
- BKE_idcode_to_name_plural(GS(id->name)),
- tmp_str,
- path);
+ BKE_idcode_to_name_plural(GS(id->name)),
+ tmp_str,
+ path);
MEM_freeN((void *)path);
}
else { /* cant find, print something sane */
ret = PyUnicode_FromFormat("bpy.data.%s[%R]...%s",
- BKE_idcode_to_name_plural(GS(id->name)),
- tmp_str,
- RNA_property_identifier(self->prop));
+ BKE_idcode_to_name_plural(GS(id->name)),
+ tmp_str,
+ RNA_property_identifier(self->prop));
}
Py_DECREF(tmp_str);
@@ -1284,19 +1284,19 @@ 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),
- ptr_name, RNA_property_identifier(prop));
+ "matches no enum in '%s', '%s', '%s'\n",
+ val, RNA_struct_identifier(ptr->type),
+ ptr_name, RNA_property_identifier(prop));
-#if 0 // gives python decoding errors while generating docs :(
+#if 0 // gives python decoding errors while generating docs :(
char error_str[256];
BLI_snprintf(error_str, sizeof(error_str),
- "RNA Warning: Current value \"%d\" "
- "matches no enum in '%s', '%s', '%s'",
- val, RNA_struct_identifier(ptr->type),
- ptr_name, RNA_property_identifier(prop));
+ "RNA Warning: Current value \"%d\" "
+ "matches no enum in '%s', '%s', '%s'",
+ val, RNA_struct_identifier(ptr->type),
+ ptr_name, RNA_property_identifier(prop));
PyErr_Warn(PyExc_RuntimeWarning, error_str);
#endif
@@ -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
}
}
@@ -1331,73 +1331,73 @@ PyObject *pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
/* see if we can coorce into a python type - PropertyType */
switch (type) {
- case PROP_BOOLEAN:
- ret = PyBool_FromLong(RNA_property_boolean_get(ptr, prop));
- break;
- case PROP_INT:
- ret = PyLong_FromSsize_t((Py_ssize_t)RNA_property_int_get(ptr, prop));
- break;
- case PROP_FLOAT:
- ret = PyFloat_FromDouble(RNA_property_float_get(ptr, prop));
- break;
- case PROP_STRING:
- {
- const int subtype = RNA_property_subtype(prop);
- const char *buf;
- int buf_len;
- char buf_fixed[32];
+ case PROP_BOOLEAN:
+ ret = PyBool_FromLong(RNA_property_boolean_get(ptr, prop));
+ break;
+ case PROP_INT:
+ ret = PyLong_FromSsize_t((Py_ssize_t)RNA_property_int_get(ptr, prop));
+ break;
+ case PROP_FLOAT:
+ ret = PyFloat_FromDouble(RNA_property_float_get(ptr, prop));
+ break;
+ case PROP_STRING:
+ {
+ const int subtype = RNA_property_subtype(prop);
+ const char *buf;
+ int buf_len;
+ char buf_fixed[32];
- buf = RNA_property_string_get_alloc(ptr, prop, buf_fixed, sizeof(buf_fixed), &buf_len);
+ buf = RNA_property_string_get_alloc(ptr, prop, buf_fixed, sizeof(buf_fixed), &buf_len);
#ifdef USE_STRING_COERCE
- /* only file paths get special treatment, they may contain non utf-8 chars */
- if (subtype == PROP_BYTESTRING) {
- ret = PyBytes_FromStringAndSize(buf, buf_len);
- }
- else if (ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
- ret = PyC_UnicodeFromByteAndSize(buf, buf_len);
- }
- else {
- ret = PyUnicode_FromStringAndSize(buf, buf_len);
- }
+ /* only file paths get special treatment, they may contain non utf-8 chars */
+ if (subtype == PROP_BYTESTRING) {
+ ret = PyBytes_FromStringAndSize(buf, buf_len);
+ }
+ else if (ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
+ ret = PyC_UnicodeFromByteAndSize(buf, buf_len);
+ }
+ else {
+ ret = PyUnicode_FromStringAndSize(buf, buf_len);
+ }
#else // USE_STRING_COERCE
- if (subtype == PROP_BYTESTRING) {
- ret = PyBytes_FromStringAndSize(buf, buf_len);
- }
- else {
- ret = PyUnicode_FromStringAndSize(buf, buf_len);
- }
+ if (subtype == PROP_BYTESTRING) {
+ ret = PyBytes_FromStringAndSize(buf, buf_len);
+ }
+ else {
+ ret = PyUnicode_FromStringAndSize(buf, buf_len);
+ }
#endif // USE_STRING_COERCE
- if (buf_fixed != buf) {
- MEM_freeN((void *)buf);
+ if (buf_fixed != buf) {
+ MEM_freeN((void *)buf);
+ }
+ break;
}
- break;
- }
- case PROP_ENUM:
- {
- ret = pyrna_enum_to_py(ptr, prop, RNA_property_enum_get(ptr, prop));
- break;
- }
- case PROP_POINTER:
- {
- PointerRNA newptr;
- newptr = RNA_property_pointer_get(ptr, prop);
- if (newptr.data) {
- ret = pyrna_struct_CreatePyObject(&newptr);
+ case PROP_ENUM:
+ {
+ ret = pyrna_enum_to_py(ptr, prop, RNA_property_enum_get(ptr, prop));
+ break;
}
- else {
- ret = Py_None;
- Py_INCREF(ret);
+ case PROP_POINTER:
+ {
+ PointerRNA newptr;
+ newptr = RNA_property_pointer_get(ptr, prop);
+ if (newptr.data) {
+ ret = pyrna_struct_CreatePyObject(&newptr);
+ }
+ else {
+ ret = Py_None;
+ Py_INCREF(ret);
+ }
+ break;
}
- break;
- }
- case PROP_COLLECTION:
- ret = pyrna_prop_CreatePyObject(ptr, prop);
- break;
- default:
- PyErr_Format(PyExc_TypeError,
- "bpy_struct internal error: unknown type '%d' (pyrna_prop_to_py)", type);
- ret = NULL;
- break;
+ case PROP_COLLECTION:
+ ret = pyrna_prop_CreatePyObject(ptr, prop);
+ break;
+ default:
+ PyErr_Format(PyExc_TypeError,
+ "bpy_struct internal error: unknown type '%d' (pyrna_prop_to_py)", type);
+ ret = NULL;
+ break;
}
return ret;
@@ -1412,7 +1412,7 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, int all_args, const cha
const char *arg_name = NULL;
PyObject *item;
- totkw = kw ? PyDict_Size(kw):0;
+ totkw = kw ? PyDict_Size(kw) : 0;
RNA_STRUCT_BEGIN(ptr, prop) {
arg_name = RNA_property_identifier(prop);
@@ -1470,7 +1470,7 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, int all_args, const cha
static PyObject *pyrna_func_to_py(PointerRNA *ptr, FunctionRNA *func)
{
- BPy_FunctionRNA* pyfunc = (BPy_FunctionRNA *) PyObject_NEW(BPy_FunctionRNA, &pyrna_func_Type);
+ BPy_FunctionRNA *pyfunc = (BPy_FunctionRNA *) PyObject_NEW(BPy_FunctionRNA, &pyrna_func_Type);
pyfunc->ptr = *ptr;
pyfunc->func = func;
return (PyObject *)pyfunc;
@@ -1494,298 +1494,310 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
/* see if we can coorce into a python type - PropertyType */
switch (type) {
- case PROP_BOOLEAN:
- {
- int param;
- /* prefer not to have an exception here
- * however so many poll functions return None or a valid Object.
- * its a hassle to convert these into a bool before returning, */
- if (RNA_property_flag(prop) & PROP_OUTPUT)
- param = PyObject_IsTrue(value);
- else
- param = PyLong_AsLong(value);
+ case PROP_BOOLEAN:
+ {
+ int param;
+ /* prefer not to have an exception here
+ * however so many poll functions return None or a valid Object.
+ * its a hassle to convert these into a bool before returning, */
+ if (RNA_property_flag(prop) & PROP_OUTPUT)
+ param = PyObject_IsTrue(value);
+ else
+ param = PyLong_AsLong(value);
- if (param < 0) {
- PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s expected True/False or 0/1, not %.200s",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop), Py_TYPE(value)->tp_name);
- return -1;
- }
- else {
- if (data) *((int *)data)= param;
- else RNA_property_boolean_set(ptr, prop, param);
- }
- break;
- }
- case PROP_INT:
- {
- int overflow;
- long param = PyLong_AsLongAndOverflow(value, &overflow);
- if (overflow || (param > INT_MAX) || (param < INT_MIN)) {
- PyErr_Format(PyExc_ValueError,
- "%.200s %.200s.%.200s value not in 'int' range "
- "(" STRINGIFY(INT_MIN) ", " STRINGIFY(INT_MAX) ")",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop));
- return -1;
- }
- else if (param == -1 && PyErr_Occurred()) {
- PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s expected an int type, not %.200s",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop), Py_TYPE(value)->tp_name);
- return -1;
- }
- else {
- int param_i = (int)param;
- RNA_property_int_clamp(ptr, prop, &param_i);
- if (data) *((int *)data)= param_i;
- else RNA_property_int_set(ptr, prop, param_i);
+ if (param < 0) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s %.200s.%.200s expected True/False or 0/1, not %.200s",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop), Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ else {
+ if (data) *((int *)data) = param;
+ else RNA_property_boolean_set(ptr, prop, param);
+ }
+ break;
}
- break;
- }
- case PROP_FLOAT:
- {
- float param = PyFloat_AsDouble(value);
- if (PyErr_Occurred()) {
- PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s expected a float type, not %.200s",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop), Py_TYPE(value)->tp_name);
- return -1;
+ case PROP_INT:
+ {
+ int overflow;
+ long param = PyLong_AsLongAndOverflow(value, &overflow);
+ if (overflow || (param > INT_MAX) || (param < INT_MIN)) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s %.200s.%.200s value not in 'int' range "
+ "(" STRINGIFY(INT_MIN) ", " STRINGIFY(INT_MAX) ")",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop));
+ return -1;
+ }
+ else if (param == -1 && PyErr_Occurred()) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s %.200s.%.200s expected an int type, not %.200s",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop), Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ else {
+ int param_i = (int)param;
+ RNA_property_int_clamp(ptr, prop, &param_i);
+ if (data) *((int *)data) = param_i;
+ else RNA_property_int_set(ptr, prop, param_i);
+ }
+ break;
}
- else {
- RNA_property_float_clamp(ptr, prop, (float *)&param);
- if (data) *((float *)data)= param;
- else RNA_property_float_set(ptr, prop, param);
+ case PROP_FLOAT:
+ {
+ float param = PyFloat_AsDouble(value);
+ if (PyErr_Occurred()) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s %.200s.%.200s expected a float type, not %.200s",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop), Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ else {
+ RNA_property_float_clamp(ptr, prop, (float *)&param);
+ if (data) *((float *)data) = param;
+ else RNA_property_float_set(ptr, prop, param);
+ }
+ break;
}
- break;
- }
- case PROP_STRING:
- {
- const int subtype = RNA_property_subtype(prop);
- const char *param;
+ case PROP_STRING:
+ {
+ const int subtype = RNA_property_subtype(prop);
+ const char *param;
- if (subtype == PROP_BYTESTRING) {
+ if (subtype == PROP_BYTESTRING) {
+
+ /* Byte String */
- /* Byte String */
+ param = PyBytes_AsString(value);
- param = PyBytes_AsString(value);
+ if (param == NULL) {
+ if (PyBytes_Check(value)) {
+ /* there was an error assigning a string type,
+ * rather than setting a new error, prefix the existing one
+ */
+ PyC_Err_Format_Prefix(PyExc_TypeError,
+ "%.200s %.200s.%.200s error assigning bytes",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop));
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s %.200s.%.200s expected a bytes type, not %.200s",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop), Py_TYPE(value)->tp_name);
+ }
- if (param == NULL) {
- if (PyBytes_Check(value)) {
- /* there was an error assigning a string type,
- * rather than setting a new error, prefix the existing one
- */
- PyC_Err_Format_Prefix(PyExc_TypeError,
- "%.200s %.200s.%.200s error assigning bytes",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop));
+ return -1;
}
else {
- PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s expected a bytes type, not %.200s",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop), Py_TYPE(value)->tp_name);
+ /* same as unicode */
+ if (data) *((char **)data) = (char *)param; /*XXX, this is suspect but needed for function calls, need to see if theres a better way */
+ else RNA_property_string_set(ptr, prop, param);
}
-
- return -1;
}
else {
- /* same as unicode */
- if (data) *((char **)data)= (char *)param; /*XXX, this is suspect but needed for function calls, need to see if theres a better way */
- else RNA_property_string_set(ptr, prop, param);
- }
- }
- else {
- /* Unicode String */
+ /* Unicode String */
#ifdef USE_STRING_COERCE
- PyObject *value_coerce = NULL;
- if (ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
- /* TODO, get size */
- param = PyC_UnicodeAsByte(value, &value_coerce);
- }
- else {
- param = _PyUnicode_AsString(value);
-#ifdef WITH_INTERNATIONAL
- if (subtype == PROP_TRANSLATE) {
- param = IFACE_(param);
+ PyObject *value_coerce = NULL;
+ if (ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
+ /* TODO, get size */
+ param = PyC_UnicodeAsByte(value, &value_coerce);
}
+ else {
+ param = _PyUnicode_AsString(value);
+#ifdef WITH_INTERNATIONAL
+ if (subtype == PROP_TRANSLATE) {
+ param = IFACE_(param);
+ }
#endif // WITH_INTERNATIONAL
- }
+ }
#else // USE_STRING_COERCE
- param = _PyUnicode_AsString(value);
+ param = _PyUnicode_AsString(value);
#endif // USE_STRING_COERCE
- if (param == NULL) {
- if (PyUnicode_Check(value)) {
- /* there was an error assigning a string type,
- * rather than setting a new error, prefix the existing one
- */
- PyC_Err_Format_Prefix(PyExc_TypeError,
- "%.200s %.200s.%.200s error assigning string",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop));
+ if (param == NULL) {
+ if (PyUnicode_Check(value)) {
+ /* there was an error assigning a string type,
+ * rather than setting a new error, prefix the existing one
+ */
+ PyC_Err_Format_Prefix(PyExc_TypeError,
+ "%.200s %.200s.%.200s error assigning string",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop));
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s %.200s.%.200s expected a string type, not %.200s",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop), Py_TYPE(value)->tp_name);
+ }
+
+ return -1;
}
else {
- PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s expected a string type, not %.200s",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop), Py_TYPE(value)->tp_name);
+ /* same as bytes */
+ if (data) *((char **)data) = (char *)param; /*XXX, this is suspect but needed for function calls, need to see if theres a better way */
+ else RNA_property_string_set(ptr, prop, param);
}
-
- return -1;
- }
- else {
- /* same as bytes */
- if (data) *((char **)data)= (char *)param; /*XXX, this is suspect but needed for function calls, need to see if theres a better way */
- else RNA_property_string_set(ptr, prop, param);
- }
#ifdef USE_STRING_COERCE
- Py_XDECREF(value_coerce);
+ Py_XDECREF(value_coerce);
#endif // USE_STRING_COERCE
+ }
+ break;
}
- break;
- }
- case PROP_ENUM:
- {
- int val = 0;
+ case PROP_ENUM:
+ {
+ int val = 0;
- /* type checkins is done by each function */
- if (RNA_property_flag(prop) & PROP_ENUM_FLAG) {
- /* set of enum items, concatenate all values with OR */
- if (pyrna_prop_to_enum_bitfield(ptr, prop, value, &val, error_prefix) < 0) {
- return -1;
+ /* type checkins is done by each function */
+ if (RNA_property_flag(prop) & PROP_ENUM_FLAG) {
+ /* set of enum items, concatenate all values with OR */
+ if (pyrna_prop_to_enum_bitfield(ptr, prop, value, &val, error_prefix) < 0) {
+ return -1;
+ }
}
- }
- else {
- /* simple enum string */
- if (pyrna_string_to_enum(value, ptr, prop, &val, error_prefix) < 0) {
- return -1;
+ else {
+ /* simple enum string */
+ if (pyrna_string_to_enum(value, ptr, prop, &val, error_prefix) < 0) {
+ return -1;
+ }
}
- }
-
- if (data) *((int *)data)= val;
- else RNA_property_enum_set(ptr, prop, val);
- break;
- }
- case PROP_POINTER:
- {
- PyObject *value_new = NULL;
-
- StructRNA *ptr_type = RNA_property_pointer_type(ptr, prop);
- int flag = RNA_property_flag(prop);
+ if (data) *((int *)data) = val;
+ else RNA_property_enum_set(ptr, prop, val);
- /* this is really nasty!, so we can fake the operator having direct properties eg:
- * layout.prop(self, "filepath")
- * ... which infact should be
- * layout.prop(self.properties, "filepath")
- *
- * we need to do this trick.
- * if the prop is not an operator type and the pyobject is an operator,
- * use its properties in place of its self.
- *
- * this is so bad that its almost a good reason to do away with fake 'self.properties -> self' class mixing
- * if this causes problems in the future it should be removed.
- */
- if ((ptr_type == &RNA_AnyType) &&
- (BPy_StructRNA_Check(value)) &&
- (RNA_struct_is_a(((BPy_StructRNA *)value)->ptr.type, &RNA_Operator))
- ) {
- value = PyObject_GetAttrString(value, "properties");
- value_new = value;
+ break;
}
+ case PROP_POINTER:
+ {
+ PyObject *value_new = NULL;
+
+ StructRNA *ptr_type = RNA_property_pointer_type(ptr, prop);
+ int flag = RNA_property_flag(prop);
+
+ /* this is really nasty!, so we can fake the operator having direct properties eg:
+ * layout.prop(self, "filepath")
+ * ... which infact should be
+ * layout.prop(self.properties, "filepath")
+ *
+ * we need to do this trick.
+ * if the prop is not an operator type and the pyobject is an operator,
+ * use its properties in place of its self.
+ *
+ * this is so bad that its almost a good reason to do away with fake 'self.properties -> self' class mixing
+ * if this causes problems in the future it should be removed.
+ */
+ if ((ptr_type == &RNA_AnyType) &&
+ (BPy_StructRNA_Check(value)) &&
+ (RNA_struct_is_a(((BPy_StructRNA *)value)->ptr.type, &RNA_Operator)))
+ {
+ value = PyObject_GetAttrString(value, "properties");
+ value_new = value;
+ }
- /* if property is an OperatorProperties pointer and value is a map,
- * forward back to pyrna_pydict_to_props */
- if (RNA_struct_is_a(ptr_type, &RNA_OperatorProperties) && PyDict_Check(value)) {
- PointerRNA opptr = RNA_property_pointer_get(ptr, prop);
- return pyrna_pydict_to_props(&opptr, value, 0, error_prefix);
- }
+ /* if property is an OperatorProperties pointer and value is a map,
+ * forward back to pyrna_pydict_to_props */
+ if (RNA_struct_is_a(ptr_type, &RNA_OperatorProperties) && PyDict_Check(value)) {
+ PointerRNA opptr = RNA_property_pointer_get(ptr, prop);
+ return pyrna_pydict_to_props(&opptr, value, 0, error_prefix);
+ }
- /* another exception, allow to pass a collection as an RNA property */
- if (Py_TYPE(value) == &pyrna_prop_collection_Type) { /* ok to ignore idprop collections */
- PointerRNA c_ptr;
- BPy_PropertyRNA *value_prop = (BPy_PropertyRNA *)value;
- if (RNA_property_collection_type_get(&value_prop->ptr, value_prop->prop, &c_ptr)) {
- value = pyrna_struct_CreatePyObject(&c_ptr);
- value_new = value;
+ /* another exception, allow to pass a collection as an RNA property */
+ if (Py_TYPE(value) == &pyrna_prop_collection_Type) { /* ok to ignore idprop collections */
+ PointerRNA c_ptr;
+ BPy_PropertyRNA *value_prop = (BPy_PropertyRNA *)value;
+ if (RNA_property_collection_type_get(&value_prop->ptr, value_prop->prop, &c_ptr)) {
+ value = pyrna_struct_CreatePyObject(&c_ptr);
+ value_new = value;
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s %.200s.%.200s collection has no type, "
+ "cant be used as a %.200s type",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop), RNA_struct_identifier(ptr_type));
+ return -1;
+ }
}
- else {
+
+ if (!BPy_StructRNA_Check(value) && value != Py_None) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s %.200s.%.200s expected a %.200s type, not %.200s",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop), RNA_struct_identifier(ptr_type),
+ Py_TYPE(value)->tp_name);
+ Py_XDECREF(value_new); return -1;
+ }
+ else if ((flag & PROP_NEVER_NULL) && value == Py_None) {
PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s collection has no type, "
- "cant be used as a %.200s type",
+ "%.200s %.200s.%.200s does not support a 'None' assignment %.200s type",
error_prefix, RNA_struct_identifier(ptr->type),
RNA_property_identifier(prop), RNA_struct_identifier(ptr_type));
- return -1;
+ Py_XDECREF(value_new); return -1;
}
- }
-
- if (!BPy_StructRNA_Check(value) && value != Py_None) {
- PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s expected a %.200s type, not %.200s",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop), RNA_struct_identifier(ptr_type),
- Py_TYPE(value)->tp_name);
- Py_XDECREF(value_new); return -1;
- }
- else if ((flag & PROP_NEVER_NULL) && value == Py_None) {
- PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s does not support a 'None' assignment %.200s type",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop), RNA_struct_identifier(ptr_type));
- Py_XDECREF(value_new); return -1;
- }
- else if ((value != Py_None) &&
- ((flag & PROP_ID_SELF_CHECK) && ptr->id.data == ((BPy_StructRNA *)value)->ptr.id.data))
- {
- PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s ID type does not support assignment to its self",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop));
- Py_XDECREF(value_new); return -1;
- }
- else {
- BPy_StructRNA *param = (BPy_StructRNA *)value;
- int raise_error = FALSE;
- if (data) {
-
- if (flag & PROP_RNAPTR) {
- if (value == Py_None)
- memset(data, 0, sizeof(PointerRNA));
- else
- *((PointerRNA *)data)= param->ptr;
- }
- else if (value == Py_None) {
- *((void **)data)= NULL;
- }
- else if (RNA_struct_is_a(param->ptr.type, ptr_type)) {
- *((void **)data)= param->ptr.data;
- }
- else {
- raise_error = TRUE;
- }
+ else if ((value != Py_None) &&
+ ((flag & PROP_ID_SELF_CHECK) && ptr->id.data == ((BPy_StructRNA *)value)->ptr.id.data))
+ {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s %.200s.%.200s ID type does not support assignment to its self",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop));
+ Py_XDECREF(value_new); return -1;
}
else {
- /* data == NULL, assign to RNA */
- if (value == Py_None) {
- PointerRNA valueptr = {{NULL}};
- RNA_property_pointer_set(ptr, prop, valueptr);
- }
- else if (RNA_struct_is_a(param->ptr.type, ptr_type)) {
- RNA_property_pointer_set(ptr, prop, param->ptr);
+ BPy_StructRNA *param = (BPy_StructRNA *)value;
+ int raise_error = FALSE;
+ if (data) {
+
+ if (flag & PROP_RNAPTR) {
+ if (value == Py_None)
+ memset(data, 0, sizeof(PointerRNA));
+ else
+ *((PointerRNA *)data) = param->ptr;
+ }
+ else if (value == Py_None) {
+ *((void **)data) = NULL;
+ }
+ else if (RNA_struct_is_a(param->ptr.type, ptr_type)) {
+ *((void **)data) = param->ptr.data;
+ }
+ else {
+ raise_error = TRUE;
+ }
}
else {
+ /* data == NULL, assign to RNA */
+ if (value == Py_None) {
+ PointerRNA valueptr = {{NULL}};
+ RNA_property_pointer_set(ptr, prop, valueptr);
+ }
+ else if (RNA_struct_is_a(param->ptr.type, ptr_type)) {
+ RNA_property_pointer_set(ptr, prop, param->ptr);
+ }
+ else {
+ PointerRNA tmp;
+ RNA_pointer_create(NULL, ptr_type, NULL, &tmp);
+ PyErr_Format(PyExc_TypeError,
+ "%.200s %.200s.%.200s expected a %.200s type. not %.200s",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop), RNA_struct_identifier(tmp.type),
+ RNA_struct_identifier(param->ptr.type));
+ Py_XDECREF(value_new); return -1;
+ }
+ }
+
+ if (raise_error) {
PointerRNA tmp;
RNA_pointer_create(NULL, ptr_type, NULL, &tmp);
PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s expected a %.200s type. not %.200s",
+ "%.200s %.200s.%.200s expected a %.200s type, not %.200s",
error_prefix, RNA_struct_identifier(ptr->type),
RNA_property_identifier(prop), RNA_struct_identifier(tmp.type),
RNA_struct_identifier(param->ptr.type));
@@ -1793,98 +1805,86 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
}
}
- if (raise_error) {
- PointerRNA tmp;
- RNA_pointer_create(NULL, ptr_type, NULL, &tmp);
- PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s expected a %.200s type, not %.200s",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop), RNA_struct_identifier(tmp.type),
- RNA_struct_identifier(param->ptr.type));
- Py_XDECREF(value_new); return -1;
- }
- }
-
- Py_XDECREF(value_new);
-
- break;
- }
- case PROP_COLLECTION:
- {
- Py_ssize_t seq_len, i;
- PyObject *item;
- PointerRNA itemptr;
- ListBase *lb;
- CollectionPointerLink *link;
+ Py_XDECREF(value_new);
- lb = (data) ? (ListBase *)data : NULL;
-
- /* convert a sequence of dict's into a collection */
- if (!PySequence_Check(value)) {
- PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s expected a sequence for an RNA collection, not %.200s",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop), Py_TYPE(value)->tp_name);
- return -1;
+ break;
}
+ case PROP_COLLECTION:
+ {
+ Py_ssize_t seq_len, i;
+ PyObject *item;
+ PointerRNA itemptr;
+ ListBase *lb;
+ CollectionPointerLink *link;
- seq_len = PySequence_Size(value);
- for (i = 0; i < seq_len; i++) {
- item = PySequence_GetItem(value, i);
+ lb = (data) ? (ListBase *)data : NULL;
- if (item == NULL) {
+ /* convert a sequence of dict's into a collection */
+ if (!PySequence_Check(value)) {
PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s failed to get sequence index '%d' for an RNA collection",
+ "%.200s %.200s.%.200s expected a sequence for an RNA collection, not %.200s",
error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop), i);
- Py_XDECREF(item);
+ RNA_property_identifier(prop), Py_TYPE(value)->tp_name);
return -1;
}
- if (PyDict_Check(item) == 0) {
- PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s expected a each sequence "
- "member to be a dict for an RNA collection, not %.200s",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop), Py_TYPE(item)->tp_name);
- Py_XDECREF(item);
- return -1;
- }
+ seq_len = PySequence_Size(value);
+ for (i = 0; i < seq_len; i++) {
+ item = PySequence_GetItem(value, i);
- if (lb) {
- link = MEM_callocN(sizeof(CollectionPointerLink), "PyCollectionPointerLink");
- link->ptr = itemptr;
- BLI_addtail(lb, link);
- }
- else
- RNA_property_collection_add(ptr, prop, &itemptr);
+ if (item == NULL) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s %.200s.%.200s failed to get sequence index '%d' for an RNA collection",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop), i);
+ Py_XDECREF(item);
+ return -1;
+ }
+
+ if (PyDict_Check(item) == 0) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s %.200s.%.200s expected a each sequence "
+ "member to be a dict for an RNA collection, not %.200s",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop), Py_TYPE(item)->tp_name);
+ Py_XDECREF(item);
+ return -1;
+ }
- if (pyrna_pydict_to_props(&itemptr, item, 1, "Converting a python list to an RNA collection") == -1) {
- PyObject *msg = PyC_ExceptionBuffer();
- const char *msg_char = _PyUnicode_AsString(msg);
+ if (lb) {
+ link = MEM_callocN(sizeof(CollectionPointerLink), "PyCollectionPointerLink");
+ link->ptr = itemptr;
+ BLI_addtail(lb, link);
+ }
+ else
+ RNA_property_collection_add(ptr, prop, &itemptr);
- PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s error converting a member of a collection "
- "from a dicts into an RNA collection, failed with: %s",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop), msg_char);
+ if (pyrna_pydict_to_props(&itemptr, item, 1, "Converting a python list to an RNA collection") == -1) {
+ PyObject *msg = PyC_ExceptionBuffer();
+ const char *msg_char = _PyUnicode_AsString(msg);
+ PyErr_Format(PyExc_TypeError,
+ "%.200s %.200s.%.200s error converting a member of a collection "
+ "from a dicts into an RNA collection, failed with: %s",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop), msg_char);
+
+ Py_DECREF(item);
+ Py_DECREF(msg);
+ return -1;
+ }
Py_DECREF(item);
- Py_DECREF(msg);
- return -1;
}
- Py_DECREF(item);
- }
- break;
- }
- default:
- PyErr_Format(PyExc_AttributeError,
- "%.200s %.200s.%.200s unknown property type (pyrna_py_to_prop)",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop));
- return -1;
- break;
+ break;
+ }
+ default:
+ PyErr_Format(PyExc_AttributeError,
+ "%.200s %.200s.%.200s unknown property type (pyrna_py_to_prop)",
+ error_prefix, RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop));
+ return -1;
+ break;
}
}
@@ -1920,7 +1920,7 @@ static int pyrna_py_to_prop_array_index(BPy_PropertyArrayRNA *self, int index, P
else {
/* see if we can coerce into a python type - PropertyType */
switch (RNA_property_type(prop)) {
- case PROP_BOOLEAN:
+ case PROP_BOOLEAN:
{
int param = PyLong_AsLong(value);
@@ -1933,7 +1933,7 @@ static int pyrna_py_to_prop_array_index(BPy_PropertyArrayRNA *self, int index, P
}
break;
}
- case PROP_INT:
+ case PROP_INT:
{
int param = PyLong_AsLong(value);
if (param == -1 && PyErr_Occurred()) {
@@ -1946,7 +1946,7 @@ static int pyrna_py_to_prop_array_index(BPy_PropertyArrayRNA *self, int index, P
}
break;
}
- case PROP_FLOAT:
+ case PROP_FLOAT:
{
float param = PyFloat_AsDouble(value);
if (PyErr_Occurred()) {
@@ -1959,10 +1959,10 @@ static int pyrna_py_to_prop_array_index(BPy_PropertyArrayRNA *self, int index, P
}
break;
}
- default:
- PyErr_SetString(PyExc_AttributeError, "not an array type");
- ret = -1;
- break;
+ default:
+ PyErr_SetString(PyExc_AttributeError, "not an array type");
+ ret = -1;
+ break;
}
}
@@ -2172,9 +2172,9 @@ int pyrna_prop_collection_subscript_str_lib_pair_ptr(BPy_PropertyRNA *self, PyOb
if (lib == NULL) {
if (err_not_found) {
PyErr_Format(PyExc_KeyError,
- "%s: lib name '%.240s' "
- "does not reference a valid library",
- err_prefix, keylib_str);
+ "%s: lib name '%.240s' "
+ "does not reference a valid library",
+ err_prefix, keylib_str);
return -1;
}
else {
@@ -2300,7 +2300,7 @@ static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, Po
}
else {
switch (RNA_property_type(prop)) {
- case PROP_FLOAT:
+ case PROP_FLOAT:
{
float values_stack[PYRNA_STACK_ARRAY];
float *values;
@@ -2309,30 +2309,30 @@ static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, Po
RNA_property_float_get_array(ptr, prop, values);
for (count = start; count < stop; count++)
- PyTuple_SET_ITEM(tuple, count-start, PyFloat_FromDouble(values[count]));
+ PyTuple_SET_ITEM(tuple, count - start, PyFloat_FromDouble(values[count]));
if (values != values_stack) {
PyMem_FREE(values);
}
break;
}
- case PROP_BOOLEAN:
+ case PROP_BOOLEAN:
{
int values_stack[PYRNA_STACK_ARRAY];
int *values;
- if (length > PYRNA_STACK_ARRAY) { values = PyMem_MALLOC(sizeof(int) * length); }
+ if (length > PYRNA_STACK_ARRAY) { values = PyMem_MALLOC(sizeof(int) * length); }
else { values = values_stack; }
RNA_property_boolean_get_array(ptr, prop, values);
for (count = start; count < stop; count++)
- PyTuple_SET_ITEM(tuple, count-start, PyBool_FromLong(values[count]));
+ PyTuple_SET_ITEM(tuple, count - start, PyBool_FromLong(values[count]));
if (values != values_stack) {
PyMem_FREE(values);
}
break;
}
- case PROP_INT:
+ case PROP_INT:
{
int values_stack[PYRNA_STACK_ARRAY];
int *values;
@@ -2341,19 +2341,19 @@ static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, Po
RNA_property_int_get_array(ptr, prop, values);
for (count = start; count < stop; count++)
- PyTuple_SET_ITEM(tuple, count-start, PyLong_FromSsize_t(values[count]));
+ PyTuple_SET_ITEM(tuple, count - start, PyLong_FromSsize_t(values[count]));
if (values != values_stack) {
PyMem_FREE(values);
}
break;
}
- default:
- BLI_assert(!"Invalid array type");
+ default:
+ BLI_assert(!"Invalid array type");
- PyErr_SetString(PyExc_TypeError, "not an array type");
- Py_DECREF(tuple);
- tuple = NULL;
+ PyErr_SetString(PyExc_TypeError, "not an array type");
+ Py_DECREF(tuple);
+ tuple = NULL;
}
}
return tuple;
@@ -2392,7 +2392,7 @@ static PyObject *pyrna_prop_collection_subscript(BPy_PropertyRNA *self, PyObject
/* avoid PySlice_GetIndicesEx because it needs to know the length ahead of time. */
if (key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start)) return NULL;
- if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) return NULL;
+ if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) return NULL;
if (start < 0 || stop < 0) {
/* only get the length for negative values */
@@ -2470,7 +2470,7 @@ static int pyrna_prop_collection_type_check(BPy_PropertyRNA *self, PyObject *val
}
/* note: currently this is a copy of 'pyrna_prop_collection_subscript' with
- * large blocks commented, we may support slice/key indicies later */
+ * large blocks commented, we may support slice/key indices later */
static int pyrna_prop_collection_ass_subscript(BPy_PropertyRNA *self, PyObject *key, PyObject *value)
{
PYRNA_PROP_CHECK_INT(self);
@@ -2517,8 +2517,8 @@ static int pyrna_prop_collection_ass_subscript(BPy_PropertyRNA *self, PyObject *
Py_ssize_t start = 0, stop = PY_SSIZE_T_MAX;
/* avoid PySlice_GetIndicesEx because it needs to know the length ahead of time. */
- if (key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start)) return NULL;
- if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) return NULL;
+ if (key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start)) return NULL;
+ if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) return NULL;
if (start < 0 || stop < 0) {
/* only get the length for negative values */
@@ -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())
@@ -2616,10 +2618,10 @@ static int prop_subscript_ass_array_slice(PointerRNA *ptr, PropertyRNA *prop,
return -1;
}
- if (PySequence_Fast_GET_SIZE(value) != stop-start) {
+ 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;
}
@@ -2638,7 +2640,7 @@ static int prop_subscript_ass_array_slice(PointerRNA *ptr, PropertyRNA *prop,
RNA_property_float_get_array(ptr, prop, values);
for (count = start; count < stop; count++) {
- fval = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, count-start));
+ fval = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, count - start));
CLAMP(fval, min, max);
values[count] = fval;
}
@@ -2658,7 +2660,7 @@ static int prop_subscript_ass_array_slice(PointerRNA *ptr, PropertyRNA *prop,
RNA_property_boolean_get_array(ptr, prop, values);
for (count = start; count < stop; count++)
- values[count] = PyLong_AsLong(PySequence_Fast_GET_ITEM(value, count-start));
+ values[count] = PyLong_AsLong(PySequence_Fast_GET_ITEM(value, count - start));
if (PyErr_Occurred()) ret = -1;
else RNA_property_boolean_set_array(ptr, prop, values);
@@ -2672,14 +2674,14 @@ static int prop_subscript_ass_array_slice(PointerRNA *ptr, PropertyRNA *prop,
int min, max;
RNA_property_int_range(ptr, prop, &min, &max);
- if (length > PYRNA_STACK_ARRAY) { values = values_alloc = PyMem_MALLOC(sizeof(int) * length); }
+ if (length > PYRNA_STACK_ARRAY) { values = values_alloc = PyMem_MALLOC(sizeof(int) * length); }
else { values = values_stack; }
if (start != 0 || stop != length) /* partial assignment? - need to get the array */
RNA_property_int_get_array(ptr, prop, values);
for (count = start; count < stop; count++) {
- ival = PyLong_AsLong(PySequence_Fast_GET_ITEM(value, count-start));
+ ival = PyLong_AsLong(PySequence_Fast_GET_ITEM(value, count - start));
CLAMP(ival, min, max);
values[count] = ival;
}
@@ -2778,15 +2780,15 @@ static int pyrna_prop_array_ass_subscript(BPy_PropertyArrayRNA *self, PyObject *
/* for slice only */
static PyMappingMethods pyrna_prop_array_as_mapping = {
- (lenfunc) pyrna_prop_array_length, /* mp_length */
- (binaryfunc) pyrna_prop_array_subscript, /* mp_subscript */
- (objobjargproc) pyrna_prop_array_ass_subscript, /* mp_ass_subscript */
+ (lenfunc) pyrna_prop_array_length, /* mp_length */
+ (binaryfunc) pyrna_prop_array_subscript, /* mp_subscript */
+ (objobjargproc) pyrna_prop_array_ass_subscript, /* mp_ass_subscript */
};
static PyMappingMethods pyrna_prop_collection_as_mapping = {
- (lenfunc) pyrna_prop_collection_length, /* mp_length */
- (binaryfunc) pyrna_prop_collection_subscript, /* mp_subscript */
- (objobjargproc) pyrna_prop_collection_ass_subscript, /* mp_ass_subscript */
+ (lenfunc) pyrna_prop_collection_length, /* mp_length */
+ (binaryfunc) pyrna_prop_collection_subscript, /* mp_subscript */
+ (objobjargproc) pyrna_prop_collection_ass_subscript, /* mp_ass_subscript */
};
/* only for fast bool's, large structs, assign nb_bool on init */
@@ -2869,44 +2871,44 @@ static int pyrna_struct_contains(BPy_StructRNA *self, PyObject *value)
if (!group)
return 0;
- return IDP_GetPropertyFromGroup(group, name) ? 1:0;
+ return IDP_GetPropertyFromGroup(group, name) ? 1 : 0;
}
static PySequenceMethods pyrna_prop_array_as_sequence = {
- (lenfunc)pyrna_prop_array_length, /* Cant set the len otherwise it can evaluate as false */
- NULL, /* sq_concat */
- NULL, /* sq_repeat */
+ (lenfunc)pyrna_prop_array_length, /* Cant set the len otherwise it can evaluate as false */
+ NULL, /* sq_concat */
+ NULL, /* sq_repeat */
(ssizeargfunc)pyrna_prop_array_subscript_int, /* sq_item */ /* Only set this so PySequence_Check() returns True */
- NULL, /* sq_slice */
- (ssizeobjargproc)prop_subscript_ass_array_int, /* sq_ass_item */
- NULL, /* *was* sq_ass_slice */
- (objobjproc)pyrna_prop_array_contains, /* sq_contains */
+ NULL, /* sq_slice */
+ (ssizeobjargproc)prop_subscript_ass_array_int, /* sq_ass_item */
+ NULL, /* *was* sq_ass_slice */
+ (objobjproc)pyrna_prop_array_contains, /* sq_contains */
(binaryfunc) NULL, /* sq_inplace_concat */
(ssizeargfunc) NULL, /* sq_inplace_repeat */
};
static PySequenceMethods pyrna_prop_collection_as_sequence = {
- (lenfunc)pyrna_prop_collection_length, /* Cant set the len otherwise it can evaluate as false */
- NULL, /* sq_concat */
- NULL, /* sq_repeat */
+ (lenfunc)pyrna_prop_collection_length, /* Cant set the len otherwise it can evaluate as false */
+ NULL, /* sq_concat */
+ NULL, /* sq_repeat */
(ssizeargfunc)pyrna_prop_collection_subscript_int, /* sq_item */ /* Only set this so PySequence_Check() returns True */
- NULL, /* *was* sq_slice */
+ NULL, /* *was* sq_slice */
(ssizeobjargproc)/* pyrna_prop_collection_ass_subscript_int */ NULL /* let mapping take this one */, /* sq_ass_item */
- NULL, /* *was* sq_ass_slice */
- (objobjproc)pyrna_prop_collection_contains, /* sq_contains */
+ NULL, /* *was* sq_ass_slice */
+ (objobjproc)pyrna_prop_collection_contains, /* sq_contains */
(binaryfunc) NULL, /* sq_inplace_concat */
(ssizeargfunc) NULL, /* sq_inplace_repeat */
};
static PySequenceMethods pyrna_struct_as_sequence = {
- NULL, /* Cant set the len otherwise it can evaluate as false */
- NULL, /* sq_concat */
- NULL, /* sq_repeat */
- NULL, /* sq_item */ /* Only set this so PySequence_Check() returns True */
- NULL, /* *was* sq_slice */
- NULL, /* sq_ass_item */
- NULL, /* *was* sq_ass_slice */
- (objobjproc)pyrna_struct_contains, /* sq_contains */
+ NULL, /* Cant set the len otherwise it can evaluate as false */
+ NULL, /* sq_concat */
+ NULL, /* sq_repeat */
+ NULL, /* sq_item */ /* Only set this so PySequence_Check() returns True */
+ NULL, /* *was* sq_slice */
+ NULL, /* sq_ass_item */
+ NULL, /* *was* sq_ass_slice */
+ (objobjproc)pyrna_struct_contains, /* sq_contains */
(binaryfunc) NULL, /* sq_inplace_concat */
(ssizeargfunc) NULL, /* sq_inplace_repeat */
};
@@ -2969,9 +2971,9 @@ static int pyrna_struct_ass_subscript(BPy_StructRNA *self, PyObject *key, PyObje
}
static PyMappingMethods pyrna_struct_as_mapping = {
- (lenfunc) NULL, /* mp_length */
- (binaryfunc) pyrna_struct_subscript, /* mp_subscript */
- (objobjargproc) pyrna_struct_ass_subscript, /* mp_ass_subscript */
+ (lenfunc) NULL, /* mp_length */
+ (binaryfunc) pyrna_struct_subscript, /* mp_subscript */
+ (objobjargproc) pyrna_struct_ass_subscript, /* mp_ass_subscript */
};
PyDoc_STRVAR(pyrna_struct_keys_doc,
@@ -3280,25 +3282,42 @@ static PyObject *pyrna_struct_type_recast(BPy_StructRNA *self)
return pyrna_struct_CreatePyObject(&r_ptr);
}
+static void pyrna_dir_members_py__add_keys(PyObject *list, PyObject *dict)
+{
+ PyObject *list_tmp;
+
+ list_tmp = PyDict_Keys(dict);
+ PyList_SetSlice(list, INT_MAX, INT_MAX, list_tmp);
+ Py_DECREF(list_tmp);
+}
+
static void pyrna_dir_members_py(PyObject *list, PyObject *self)
{
PyObject *dict;
PyObject **dict_ptr;
- PyObject *list_tmp;
dict_ptr = _PyObject_GetDictPtr((PyObject *)self);
if (dict_ptr && (dict = *dict_ptr)) {
- list_tmp = PyDict_Keys(dict);
- PyList_SetSlice(list, INT_MAX, INT_MAX, list_tmp);
- Py_DECREF(list_tmp);
+ pyrna_dir_members_py__add_keys(list, dict);
}
dict = ((PyTypeObject *)Py_TYPE(self))->tp_dict;
if (dict) {
- list_tmp = PyDict_Keys(dict);
- PyList_SetSlice(list, INT_MAX, INT_MAX, list_tmp);
- Py_DECREF(list_tmp);
+ pyrna_dir_members_py__add_keys(list, dict);
+ }
+
+ /* since this is least common case, handle it last */
+ if (BPy_PropertyRNA_Check(self)) {
+ BPy_PropertyRNA *self_prop = (BPy_PropertyRNA *)self;
+ PointerRNA r_ptr;
+
+ if (RNA_property_collection_type_get(&self_prop->ptr, self_prop->prop, &r_ptr)) {
+ PyObject *cls = pyrna_struct_Subtype(&r_ptr); /* borrows */
+ dict = ((PyTypeObject *)cls)->tp_dict;
+ pyrna_dir_members_py__add_keys(list, dict);
+ Py_DECREF(cls);
+ }
}
}
@@ -3359,7 +3378,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);
@@ -3444,16 +3463,16 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname)
if (done == 1) { /* found */
switch (newtype) {
- case CTX_DATA_TYPE_POINTER:
- if (newptr.data == NULL) {
- ret = Py_None;
- Py_INCREF(ret);
- }
- else {
- ret = pyrna_struct_CreatePyObject(&newptr);
- }
- break;
- case CTX_DATA_TYPE_COLLECTION:
+ case CTX_DATA_TYPE_POINTER:
+ if (newptr.data == NULL) {
+ ret = Py_None;
+ Py_INCREF(ret);
+ }
+ else {
+ ret = pyrna_struct_CreatePyObject(&newptr);
+ }
+ break;
+ case CTX_DATA_TYPE_COLLECTION:
{
CollectionPointerLink *link;
PyObject *linkptr;
@@ -3467,14 +3486,14 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname)
}
}
break;
- default:
- /* should never happen */
- BLI_assert(!"Invalid context type");
-
- PyErr_Format(PyExc_AttributeError,
- "bpy_struct: Context type invalid %d, can't get \"%.200s\" from context",
- newtype, name);
- ret = NULL;
+ default:
+ /* should never happen */
+ BLI_assert(!"Invalid context type");
+
+ PyErr_Format(PyExc_AttributeError,
+ "bpy_struct: Context type invalid %d, can't get \"%.200s\" from context",
+ newtype, name);
+ ret = NULL;
}
}
else if (done == -1) { /* found but not set */
@@ -3496,7 +3515,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
@@ -3523,10 +3542,10 @@ static int pyrna_struct_pydict_contains(PyObject *self, PyObject *pyname)
//--------------- setattr-------------------------------------------
static int pyrna_is_deferred_prop(const PyObject *value)
{
- return PyTuple_CheckExact(value) &&
- PyTuple_GET_SIZE(value) == 2 &&
- PyCFunction_Check(PyTuple_GET_ITEM(value, 0)) &&
- PyDict_CheckExact(PyTuple_GET_ITEM(value, 1));
+ return PyTuple_CheckExact(value) &&
+ PyTuple_GET_SIZE(value) == 2 &&
+ PyCFunction_Check(PyTuple_GET_ITEM(value, 0)) &&
+ PyDict_CheckExact(PyTuple_GET_ITEM(value, 1));
}
#if 0
@@ -3576,14 +3595,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 +3712,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);
@@ -3768,8 +3787,10 @@ static PyObject *pyrna_prop_collection_getattro(BPy_PropertyRNA *self, PyObject
PyErr_Fetch(&error_type, &error_value, &error_traceback);
PyErr_Clear();
- cls = pyrna_struct_Subtype(&r_ptr); /* borrows */
+ cls = pyrna_struct_Subtype(&r_ptr);
ret = PyObject_GenericGetAttr(cls, pyname);
+ Py_DECREF(cls);
+
/* restore the original error */
if (ret == NULL) {
PyErr_Restore(error_type, error_value, error_traceback);
@@ -3848,6 +3869,13 @@ static PyObject *pyrna_prop_collection_idprop_remove(BPy_PropertyRNA *self, PyOb
Py_RETURN_NONE;
}
+static PyObject *pyrna_prop_collection_idprop_clear(BPy_PropertyRNA *self)
+{
+ RNA_property_collection_clear(&self->ptr, self->prop);
+
+ Py_RETURN_NONE;
+}
+
static PyObject *pyrna_prop_collection_idprop_move(BPy_PropertyRNA *self, PyObject *args)
{
int key = 0, pos = 0;
@@ -3917,6 +3945,12 @@ static PyGetSetDef pyrna_struct_getseters[] = {
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
+static PyObject *pyrna_func_doc_get(BPy_FunctionRNA *self, void *closure);
+
+static PyGetSetDef pyrna_func_getseters[] = {
+ {(char *)"__doc__", (getter)pyrna_func_doc_get, (setter)NULL, NULL, NULL},
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+};
PyDoc_STRVAR(pyrna_prop_collection_keys_doc,
".. method:: keys()\n"
@@ -3925,7 +3959,7 @@ PyDoc_STRVAR(pyrna_prop_collection_keys_doc,
" (matching pythons dict.keys() functionality).\n"
"\n"
" :return: the identifiers for each member of this collection.\n"
-" :rtype: list of stings\n"
+" :rtype: list of strings\n"
);
static PyObject *pyrna_prop_collection_keys(BPy_PropertyRNA *self)
{
@@ -4032,7 +4066,7 @@ static PyObject *pyrna_struct_get(BPy_StructRNA *self, PyObject *args)
IDProperty *group, *idprop;
const char *key;
- PyObject* def = Py_None;
+ PyObject *def = Py_None;
PYRNA_STRUCT_CHECK_OBJ(self);
@@ -4090,7 +4124,7 @@ static PyObject *pyrna_prop_collection_get(BPy_PropertyRNA *self, PyObject *args
PointerRNA newptr;
PyObject *key_ob;
- PyObject* def = Py_None;
+ PyObject *def = Py_None;
PYRNA_PROP_CHECK_OBJ(self);
@@ -4105,7 +4139,7 @@ static PyObject *pyrna_prop_collection_get(BPy_PropertyRNA *self, PyObject *args
}
else if (PyTuple_Check(key_ob)) {
PyObject *ret = pyrna_prop_collection_subscript_str_lib_pair(self, key_ob,
- "bpy_prop_collection.get((id, lib))", FALSE);
+ "bpy_prop_collection.get((id, lib))", FALSE);
if (ret) {
return ret;
}
@@ -4164,34 +4198,33 @@ static PyObject *pyrna_prop_collection_find(BPy_PropertyRNA *self, PyObject *key
return PyLong_FromSsize_t(index);
}
-static void foreach_attr_type( BPy_PropertyRNA *self, const char *attr,
- /* values to assign */
- RawPropertyType *raw_type, int *attr_tot, int *attr_signed)
+static void foreach_attr_type(BPy_PropertyRNA *self, const char *attr,
+ /* values to assign */
+ RawPropertyType *raw_type, int *attr_tot, int *attr_signed)
{
PropertyRNA *prop;
*raw_type = PROP_RAW_UNSET;
*attr_tot = 0;
*attr_signed = FALSE;
- /* note: this is fail with zero length lists, so dont let this get caled in that case */
+ /* note: this is fail with zero length lists, so don't let this get caled in that case */
RNA_PROP_BEGIN(&self->ptr, itemptr, self->prop) {
prop = RNA_struct_find_property(&itemptr, attr);
*raw_type = RNA_property_raw_type(prop);
*attr_tot = RNA_property_array_length(&itemptr, prop);
- *attr_signed = (RNA_property_subtype(prop) == PROP_UNSIGNED) ? FALSE:TRUE;
+ *attr_signed = (RNA_property_subtype(prop) == PROP_UNSIGNED) ? FALSE : TRUE;
break;
}
RNA_PROP_END;
}
/* pyrna_prop_collection_foreach_get/set both use this */
-static int foreach_parse_args(
- BPy_PropertyRNA *self, PyObject *args,
+static int foreach_parse_args(BPy_PropertyRNA *self, PyObject *args,
- /*values to assign */
- const char **attr, PyObject **seq, int *tot, int *size,
- RawPropertyType *raw_type, int *attr_tot, int *attr_signed
- )
+ /* values to assign */
+ const char **attr, PyObject **seq, int *tot, int *size,
+ RawPropertyType *raw_type, int *attr_tot, int *attr_signed
+ )
{
#if 0
int array_tot;
@@ -4212,7 +4245,7 @@ static int foreach_parse_args(
foreach_attr_type(self, *attr, raw_type, attr_tot, attr_signed);
*size = RNA_raw_type_sizeof(*raw_type);
-#if 0 // works fine but not strictly needed, we could allow RNA_property_collection_raw_* to do the checks
+#if 0 // works fine but not strictly needed, we could allow RNA_property_collection_raw_* to do the checks
if ((*attr_tot) < 1)
*attr_tot = 1;
@@ -4234,7 +4267,7 @@ static int foreach_parse_args(
#endif
}
- /* check 'attr_tot' otherwise we dont know if any values were set
+ /* check 'attr_tot' otherwise we don't know if any values were set
* this isn't ideal because it means running on an empty list may fail silently when its not compatible. */
if (*size == 0 && *attr_tot != 0) {
PyErr_SetString(PyExc_AttributeError, "attribute does not support foreach method");
@@ -4245,24 +4278,24 @@ static int foreach_parse_args(
static int foreach_compat_buffer(RawPropertyType raw_type, int attr_signed, const char *format)
{
- char f = format ? *format:'B'; /* B is assumed when not set */
+ char f = format ? *format : 'B'; /* B is assumed when not set */
switch (raw_type) {
- case PROP_RAW_CHAR:
- if (attr_signed) return (f == 'b') ? 1:0;
- else return (f == 'B') ? 1:0;
- case PROP_RAW_SHORT:
- if (attr_signed) return (f == 'h') ? 1:0;
- else return (f == 'H') ? 1:0;
- case PROP_RAW_INT:
- if (attr_signed) return (f == 'i') ? 1:0;
- else return (f == 'I') ? 1:0;
- case PROP_RAW_FLOAT:
- return (f == 'f') ? 1:0;
- case PROP_RAW_DOUBLE:
- return (f == 'd') ? 1:0;
- case PROP_RAW_UNSET:
- return 0;
+ case PROP_RAW_CHAR:
+ if (attr_signed) return (f == 'b') ? 1 : 0;
+ else return (f == 'B') ? 1 : 0;
+ case PROP_RAW_SHORT:
+ if (attr_signed) return (f == 'h') ? 1 : 0;
+ else return (f == 'H') ? 1 : 0;
+ case PROP_RAW_INT:
+ if (attr_signed) return (f == 'i') ? 1 : 0;
+ else return (f == 'I') ? 1 : 0;
+ case PROP_RAW_FLOAT:
+ return (f == 'f') ? 1 : 0;
+ case PROP_RAW_DOUBLE:
+ return (f == 'd') ? 1 : 0;
+ case PROP_RAW_UNSET:
+ return 0;
}
return 0;
@@ -4312,25 +4345,25 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
for ( ; i < tot; i++) {
item = PySequence_GetItem(seq, i);
switch (raw_type) {
- case PROP_RAW_CHAR:
- ((char *)array)[i] = (char)PyLong_AsLong(item);
- break;
- case PROP_RAW_SHORT:
- ((short *)array)[i] = (short)PyLong_AsLong(item);
- break;
- case PROP_RAW_INT:
- ((int *)array)[i] = (int)PyLong_AsLong(item);
- break;
- case PROP_RAW_FLOAT:
- ((float *)array)[i] = (float)PyFloat_AsDouble(item);
- break;
- case PROP_RAW_DOUBLE:
- ((double *)array)[i] = (double)PyFloat_AsDouble(item);
- break;
- case PROP_RAW_UNSET:
- /* should never happen */
- BLI_assert(!"Invalid array type - set");
- break;
+ case PROP_RAW_CHAR:
+ ((char *)array)[i] = (char)PyLong_AsLong(item);
+ break;
+ case PROP_RAW_SHORT:
+ ((short *)array)[i] = (short)PyLong_AsLong(item);
+ break;
+ case PROP_RAW_INT:
+ ((int *)array)[i] = (int)PyLong_AsLong(item);
+ break;
+ case PROP_RAW_FLOAT:
+ ((float *)array)[i] = (float)PyFloat_AsDouble(item);
+ break;
+ case PROP_RAW_DOUBLE:
+ ((double *)array)[i] = (double)PyFloat_AsDouble(item);
+ break;
+ case PROP_RAW_UNSET:
+ /* should never happen */
+ BLI_assert(!"Invalid array type - set");
+ break;
}
Py_DECREF(item);
@@ -4362,32 +4395,32 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
ok = RNA_property_collection_raw_get(NULL, &self->ptr, self->prop, attr, array, raw_type, tot);
- if (!ok) i = tot; /* skip the loop */
+ if (!ok) i = tot; /* skip the loop */
for ( ; i < tot; i++) {
switch (raw_type) {
- case PROP_RAW_CHAR:
- item = PyLong_FromSsize_t((Py_ssize_t) ((char *)array)[i]);
- break;
- case PROP_RAW_SHORT:
- item = PyLong_FromSsize_t((Py_ssize_t) ((short *)array)[i]);
- break;
- case PROP_RAW_INT:
- item = PyLong_FromSsize_t((Py_ssize_t) ((int *)array)[i]);
- break;
- case PROP_RAW_FLOAT:
- item = PyFloat_FromDouble((double) ((float *)array)[i]);
- break;
- case PROP_RAW_DOUBLE:
- item = PyFloat_FromDouble((double) ((double *)array)[i]);
- break;
- default: /* PROP_RAW_UNSET */
- /* should never happen */
- BLI_assert(!"Invalid array type - get");
- item = Py_None;
- Py_INCREF(item);
- break;
+ case PROP_RAW_CHAR:
+ item = PyLong_FromSsize_t((Py_ssize_t) ((char *)array)[i]);
+ break;
+ case PROP_RAW_SHORT:
+ item = PyLong_FromSsize_t((Py_ssize_t) ((short *)array)[i]);
+ break;
+ case PROP_RAW_INT:
+ item = PyLong_FromSsize_t((Py_ssize_t) ((int *)array)[i]);
+ break;
+ case PROP_RAW_FLOAT:
+ item = PyFloat_FromDouble((double) ((float *)array)[i]);
+ break;
+ case PROP_RAW_DOUBLE:
+ item = PyFloat_FromDouble((double) ((double *)array)[i]);
+ break;
+ default: /* PROP_RAW_UNSET */
+ /* should never happen */
+ BLI_assert(!"Invalid array type - get");
+ item = Py_None;
+ Py_INCREF(item);
+ break;
}
PySequence_SetItem(seq, i, item);
@@ -4510,8 +4543,8 @@ static struct PyMethodDef pyrna_struct_methods[] = {
{"as_pointer", (PyCFunction)pyrna_struct_as_pointer, METH_NOARGS, pyrna_struct_as_pointer_doc},
/* bpy_rna_anim.c */
- {"keyframe_insert", (PyCFunction)pyrna_struct_keyframe_insert, METH_VARARGS|METH_KEYWORDS, pyrna_struct_keyframe_insert_doc},
- {"keyframe_delete", (PyCFunction)pyrna_struct_keyframe_delete, METH_VARARGS|METH_KEYWORDS, pyrna_struct_keyframe_delete_doc},
+ {"keyframe_insert", (PyCFunction)pyrna_struct_keyframe_insert, METH_VARARGS | METH_KEYWORDS, pyrna_struct_keyframe_insert_doc},
+ {"keyframe_delete", (PyCFunction)pyrna_struct_keyframe_delete, METH_VARARGS | METH_KEYWORDS, pyrna_struct_keyframe_delete_doc},
{"driver_add", (PyCFunction)pyrna_struct_driver_add, METH_VARARGS, pyrna_struct_driver_add_doc},
{"driver_remove", (PyCFunction)pyrna_struct_driver_remove, METH_VARARGS, pyrna_struct_driver_remove_doc},
@@ -4522,7 +4555,7 @@ static struct PyMethodDef pyrna_struct_methods[] = {
{"type_recast", (PyCFunction)pyrna_struct_type_recast, METH_NOARGS, pyrna_struct_type_recast_doc},
{"__dir__", (PyCFunction)pyrna_struct_dir, METH_NOARGS, NULL},
- /* experemental */
+ /* experimental */
{"callback_add", (PyCFunction)pyrna_callback_add, METH_VARARGS, NULL},
{"callback_remove", (PyCFunction)pyrna_callback_remove, METH_VARARGS, NULL},
{NULL, NULL, 0, NULL}
@@ -4554,6 +4587,7 @@ static struct PyMethodDef pyrna_prop_collection_methods[] = {
static struct PyMethodDef pyrna_prop_collection_idprop_methods[] = {
{"add", (PyCFunction)pyrna_prop_collection_idprop_add, METH_NOARGS, NULL},
{"remove", (PyCFunction)pyrna_prop_collection_idprop_remove, METH_O, NULL},
+ {"clear", (PyCFunction)pyrna_prop_collection_idprop_clear, METH_NOARGS, NULL},
{"move", (PyCFunction)pyrna_prop_collection_idprop_move, METH_VARARGS, NULL},
{NULL, NULL, 0, NULL}
};
@@ -4571,14 +4605,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.
*/
@@ -4652,154 +4686,154 @@ static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *dat
/* kazanbas: TODO make multidim sequences here */
switch (type) {
- case PROP_BOOLEAN:
- ret = PyTuple_New(len);
- for (a = 0; a < len; a++)
- PyTuple_SET_ITEM(ret, a, PyBool_FromLong(((int *)data)[a]));
- break;
- case PROP_INT:
- ret = PyTuple_New(len);
- for (a = 0; a < len; a++)
- PyTuple_SET_ITEM(ret, a, PyLong_FromSsize_t((Py_ssize_t)((int *)data)[a]));
- break;
- case PROP_FLOAT:
- switch (RNA_property_subtype(prop)) {
+ case PROP_BOOLEAN:
+ ret = PyTuple_New(len);
+ for (a = 0; a < len; a++)
+ PyTuple_SET_ITEM(ret, a, PyBool_FromLong(((int *)data)[a]));
+ break;
+ case PROP_INT:
+ ret = PyTuple_New(len);
+ for (a = 0; a < len; a++)
+ PyTuple_SET_ITEM(ret, a, PyLong_FromSsize_t((Py_ssize_t)((int *)data)[a]));
+ break;
+ case PROP_FLOAT:
+ switch (RNA_property_subtype(prop)) {
#ifdef USE_MATHUTILS
- case PROP_ALL_VECTOR_SUBTYPES:
- ret = Vector_CreatePyObject(data, len, Py_NEW, NULL);
- break;
- case PROP_MATRIX:
- if (len == 16) {
- ret = Matrix_CreatePyObject(data, 4, 4, Py_NEW, NULL);
+ case PROP_ALL_VECTOR_SUBTYPES:
+ ret = Vector_CreatePyObject(data, len, Py_NEW, NULL);
break;
- }
- else if (len == 9) {
- ret = Matrix_CreatePyObject(data, 3, 3, Py_NEW, NULL);
- break;
- }
- /* pass through */
+ case PROP_MATRIX:
+ if (len == 16) {
+ ret = Matrix_CreatePyObject(data, 4, 4, Py_NEW, NULL);
+ break;
+ }
+ else if (len == 9) {
+ ret = Matrix_CreatePyObject(data, 3, 3, Py_NEW, NULL);
+ break;
+ }
+ /* pass through */
#endif
- default:
- ret = PyTuple_New(len);
- for (a = 0; a < len; a++)
- PyTuple_SET_ITEM(ret, a, PyFloat_FromDouble(((float *)data)[a]));
+ default:
+ ret = PyTuple_New(len);
+ for (a = 0; a < len; a++)
+ PyTuple_SET_ITEM(ret, a, PyFloat_FromDouble(((float *)data)[a]));
- }
- break;
- default:
- PyErr_Format(PyExc_TypeError,
- "RNA Error: unknown array type \"%d\" (pyrna_param_to_py)",
- type);
- ret = NULL;
- break;
+ }
+ break;
+ default:
+ PyErr_Format(PyExc_TypeError,
+ "RNA Error: unknown array type \"%d\" (pyrna_param_to_py)",
+ type);
+ ret = NULL;
+ break;
}
}
else {
/* see if we can coorce into a python type - PropertyType */
switch (type) {
- case PROP_BOOLEAN:
- ret = PyBool_FromLong(*(int *)data);
- break;
- case PROP_INT:
- ret = PyLong_FromSsize_t((Py_ssize_t)*(int *)data);
- break;
- case PROP_FLOAT:
- ret = PyFloat_FromDouble(*(float *)data);
- break;
- case PROP_STRING:
- {
- char *data_ch;
- PyObject *value_coerce = NULL;
- const int subtype = RNA_property_subtype(prop);
+ case PROP_BOOLEAN:
+ ret = PyBool_FromLong(*(int *)data);
+ break;
+ case PROP_INT:
+ ret = PyLong_FromSsize_t((Py_ssize_t)*(int *)data);
+ break;
+ case PROP_FLOAT:
+ ret = PyFloat_FromDouble(*(float *)data);
+ break;
+ case PROP_STRING:
+ {
+ char *data_ch;
+ PyObject *value_coerce = NULL;
+ const int subtype = RNA_property_subtype(prop);
- if (flag & PROP_THICK_WRAP)
- data_ch = (char *)data;
- else
- data_ch = *(char **)data;
+ if (flag & PROP_THICK_WRAP)
+ data_ch = (char *)data;
+ else
+ data_ch = *(char **)data;
#ifdef USE_STRING_COERCE
- if (subtype == PROP_BYTESTRING) {
- ret = PyBytes_FromString(data_ch);
- }
- else if (ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
- ret = PyC_UnicodeFromByte(data_ch);
- }
- else {
- ret = PyUnicode_FromString(data_ch);
- }
+ if (subtype == PROP_BYTESTRING) {
+ ret = PyBytes_FromString(data_ch);
+ }
+ else if (ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
+ ret = PyC_UnicodeFromByte(data_ch);
+ }
+ else {
+ ret = PyUnicode_FromString(data_ch);
+ }
#else
- if (subtype == PROP_BYTESTRING) {
- ret = PyBytes_FromString(buf);
- }
- else {
- ret = PyUnicode_FromString(data_ch);
- }
+ if (subtype == PROP_BYTESTRING) {
+ ret = PyBytes_FromString(buf);
+ }
+ else {
+ ret = PyUnicode_FromString(data_ch);
+ }
#endif
#ifdef USE_STRING_COERCE
- Py_XDECREF(value_coerce);
+ Py_XDECREF(value_coerce);
#endif
- break;
- }
- case PROP_ENUM:
- {
- ret = pyrna_enum_to_py(ptr, prop, *(int *)data);
- break;
- }
- case PROP_POINTER:
- {
- PointerRNA newptr;
- StructRNA *ptype = RNA_property_pointer_type(ptr, prop);
-
- if (flag & PROP_RNAPTR) {
- /* in this case we get the full ptr */
- newptr = *(PointerRNA *)data;
+ break;
}
- else {
- if (RNA_struct_is_ID(ptype)) {
- RNA_id_pointer_create(*(void **)data, &newptr);
+ case PROP_ENUM:
+ {
+ ret = pyrna_enum_to_py(ptr, prop, *(int *)data);
+ break;
+ }
+ case PROP_POINTER:
+ {
+ PointerRNA newptr;
+ StructRNA *ptype = RNA_property_pointer_type(ptr, prop);
+
+ if (flag & PROP_RNAPTR) {
+ /* in this case we get the full ptr */
+ newptr = *(PointerRNA *)data;
}
else {
- /* note: this is taken from the function's ID pointer
- * and will break if a function returns a pointer from
- * another ID block, watch this! - it should at least be
- * easy to debug since they are all ID's */
- RNA_pointer_create(ptr->id.data, ptype, *(void **)data, &newptr);
+ if (RNA_struct_is_ID(ptype)) {
+ RNA_id_pointer_create(*(void **)data, &newptr);
+ }
+ else {
+ /* note: this is taken from the function's ID pointer
+ * and will break if a function returns a pointer from
+ * another ID block, watch this! - it should at least be
+ * easy to debug since they are all ID's */
+ RNA_pointer_create(ptr->id.data, ptype, *(void **)data, &newptr);
+ }
}
- }
- if (newptr.data) {
- ret = pyrna_struct_CreatePyObject(&newptr);
- }
- else {
- ret = Py_None;
- Py_INCREF(ret);
+ if (newptr.data) {
+ ret = pyrna_struct_CreatePyObject(&newptr);
+ }
+ else {
+ ret = Py_None;
+ Py_INCREF(ret);
+ }
+ break;
}
- break;
- }
- case PROP_COLLECTION:
- {
- ListBase *lb = (ListBase *)data;
- CollectionPointerLink *link;
- PyObject *linkptr;
+ case PROP_COLLECTION:
+ {
+ ListBase *lb = (ListBase *)data;
+ CollectionPointerLink *link;
+ PyObject *linkptr;
- ret = PyList_New(0);
+ ret = PyList_New(0);
- for (link = lb->first; link; link = link->next) {
- linkptr = pyrna_struct_CreatePyObject(&link->ptr);
- PyList_Append(ret, linkptr);
- Py_DECREF(linkptr);
- }
+ for (link = lb->first; link; link = link->next) {
+ linkptr = pyrna_struct_CreatePyObject(&link->ptr);
+ PyList_Append(ret, linkptr);
+ Py_DECREF(linkptr);
+ }
- break;
- }
- default:
- PyErr_Format(PyExc_TypeError,
- "RNA Error: unknown type \"%d\" (pyrna_param_to_py)",
- type);
- ret = NULL;
- break;
+ break;
+ }
+ default:
+ PyErr_Format(PyExc_TypeError,
+ "RNA Error: unknown type \"%d\" (pyrna_param_to_py)",
+ type);
+ ret = NULL;
+ break;
}
}
@@ -4866,7 +4900,7 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject
}
/* for testing */
- /*
+#if 0
{
const char *fn;
int lineno;
@@ -4874,7 +4908,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
@@ -4927,7 +4961,7 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject
item = small_dict_get_item_string(kw, RNA_property_identifier(parm)); /* borrow ref */
#endif
if (item)
- kw_tot++; /* make sure invalid keywords are not given */
+ kw_tot++; /* make sure invalid keywords are not given */
kw_arg = TRUE;
}
@@ -4991,7 +5025,7 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject
/* Check if we gave args that don't exist in the function
* printing the error is slow but it should only happen when developing.
* the if below is quick, checking if it passed less keyword args then we gave.
- * (Dont overwrite the error if we have one, otherwise can skip important messages and confuse with args)
+ * (Don't overwrite the error if we have one, otherwise can skip important messages and confuse with args)
*/
if (err == 0 && kw && (pykw_len > kw_tot)) {
PyObject *key, *value;
@@ -5104,14 +5138,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
@@ -5129,6 +5163,22 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject
Py_RETURN_NONE;
}
+static PyObject *pyrna_func_doc_get(BPy_FunctionRNA *self, void *UNUSED(closure))
+{
+ PyObject *ret;
+ char *args;
+
+ args = RNA_function_as_string_keywords(NULL, self->func, NULL, TRUE, TRUE);
+
+ ret = PyUnicode_FromFormat("%.200s.%.200s(%.200s)\n%s",
+ RNA_struct_identifier(self->ptr.type),
+ RNA_function_identifier(self->func),
+ args, RNA_function_ui_description(self->func));
+
+ MEM_freeN(args);
+
+ return ret;
+}
/* subclasses of pyrna_struct_Type which support idprop definitions use this as a metaclass */
/* note: tp_base member is set to &PyType_Type on init */
@@ -5163,30 +5213,30 @@ PyTypeObject pyrna_struct_meta_idprop_Type = {
/* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */
- /*** Flags to define presence of optional/expanded features ***/
+ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
+ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */
/* delete references to contained objects */
NULL, /* inquiry tp_clear; */
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
NULL, /* richcmpfunc tp_richcompare; */
- /*** weak reference enabler ***/
+ /*** weak reference enabler ***/
0, /* long tp_weaklistoffset; */
- /*** Added in release 2.2 ***/
+ /*** Added in release 2.2 ***/
/* Iterators */
NULL, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */
- /*** Attribute descriptor and subclassing stuff ***/
+ /*** Attribute descriptor and subclassing stuff ***/
NULL, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
NULL, /* struct PyGetSetDef *tp_getset; */
@@ -5223,7 +5273,7 @@ PyTypeObject pyrna_struct_Type = {
sizeof(BPy_StructRNA), /* tp_basicsize */
0, /* tp_itemsize */
/* methods */
- (destructor) pyrna_struct_dealloc,/* tp_dealloc */
+ (destructor) pyrna_struct_dealloc, /* tp_dealloc */
NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
@@ -5247,11 +5297,11 @@ PyTypeObject pyrna_struct_Type = {
/* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */
- /*** Flags to define presence of optional/expanded features ***/
+ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
+ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */
#ifdef USE_PYRNA_STRUCT_REFERENCE
(traverseproc) pyrna_struct_traverse, /* traverseproc tp_traverse; */
@@ -5265,22 +5315,22 @@ PyTypeObject pyrna_struct_Type = {
NULL, /* inquiry tp_clear; */
#endif /* !USE_PYRNA_STRUCT_REFERENCE */
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
(richcmpfunc)pyrna_struct_richcmp, /* richcmpfunc tp_richcompare; */
- /*** weak reference enabler ***/
+ /*** weak reference enabler ***/
#ifdef USE_WEAKREFS
offsetof(BPy_StructRNA, in_weakreflist), /* long tp_weaklistoffset; */
#else
0,
#endif
- /*** Added in release 2.2 ***/
+ /*** Added in release 2.2 ***/
/* Iterators */
NULL, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */
- /*** Attribute descriptor and subclassing stuff ***/
+ /*** Attribute descriptor and subclassing stuff ***/
pyrna_struct_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
pyrna_struct_getseters, /* struct PyGetSetDef *tp_getset; */
@@ -5338,37 +5388,37 @@ PyTypeObject pyrna_prop_Type = {
/* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */
- /*** Flags to define presence of optional/expanded features ***/
+ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
+ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */
/* delete references to contained objects */
NULL, /* inquiry tp_clear; */
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- (richcmpfunc)pyrna_prop_richcmp, /* richcmpfunc tp_richcompare; */
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
+ (richcmpfunc)pyrna_prop_richcmp, /* richcmpfunc tp_richcompare; */
- /*** weak reference enabler ***/
+ /*** weak reference enabler ***/
#ifdef USE_WEAKREFS
- offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */
+ offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */
#else
0,
#endif
- /*** Added in release 2.2 ***/
+ /*** Added in release 2.2 ***/
/* Iterators */
NULL, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */
- /*** Attribute descriptor and subclassing stuff ***/
+ /*** Attribute descriptor and subclassing stuff ***/
pyrna_prop_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
- pyrna_prop_getseters, /* struct PyGetSetDef *tp_getset; */
+ pyrna_prop_getseters, /* struct PyGetSetDef *tp_getset; */
NULL, /* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */
NULL, /* descrgetfunc tp_descr_get; */
@@ -5393,7 +5443,7 @@ PyTypeObject pyrna_prop_Type = {
PyTypeObject pyrna_prop_array_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
"bpy_prop_array", /* tp_name */
- sizeof(BPy_PropertyArrayRNA), /* tp_basicsize */
+ sizeof(BPy_PropertyArrayRNA), /* tp_basicsize */
0, /* tp_itemsize */
/* methods */
(destructor)pyrna_prop_array_dealloc, /* tp_dealloc */
@@ -5401,7 +5451,7 @@ PyTypeObject pyrna_prop_array_Type = {
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */
- NULL,/* subclassed */ /* tp_repr */
+ NULL, /* subclassed */ /* tp_repr */
/* Method suites for standard classes */
@@ -5422,33 +5472,33 @@ PyTypeObject pyrna_prop_array_Type = {
/* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */
- /*** Flags to define presence of optional/expanded features ***/
+ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
+ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */
/* delete references to contained objects */
NULL, /* inquiry tp_clear; */
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
NULL, /* subclassed */ /* richcmpfunc tp_richcompare; */
- /*** weak reference enabler ***/
+ /*** weak reference enabler ***/
#ifdef USE_WEAKREFS
- offsetof(BPy_PropertyArrayRNA, in_weakreflist), /* long tp_weaklistoffset; */
+ offsetof(BPy_PropertyArrayRNA, in_weakreflist), /* long tp_weaklistoffset; */
#else
0,
#endif
- /*** Added in release 2.2 ***/
+ /*** Added in release 2.2 ***/
/* Iterators */
- (getiterfunc)pyrna_prop_array_iter, /* getiterfunc tp_iter; */
+ (getiterfunc)pyrna_prop_array_iter, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */
- /*** Attribute descriptor and subclassing stuff ***/
+ /*** Attribute descriptor and subclassing stuff ***/
pyrna_prop_array_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */
@@ -5505,34 +5555,34 @@ PyTypeObject pyrna_prop_collection_Type = {
/* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */
- /*** Flags to define presence of optional/expanded features ***/
+ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
+ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */
/* delete references to contained objects */
NULL, /* inquiry tp_clear; */
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
NULL, /* subclassed */ /* richcmpfunc tp_richcompare; */
- /*** weak reference enabler ***/
+ /*** weak reference enabler ***/
#ifdef USE_WEAKREFS
offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */
#else
0,
#endif
- /*** Added in release 2.2 ***/
+ /*** Added in release 2.2 ***/
/* Iterators */
(getiterfunc)pyrna_prop_collection_iter, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */
- /*** Attribute descriptor and subclassing stuff ***/
+ /*** Attribute descriptor and subclassing stuff ***/
pyrna_prop_collection_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */
@@ -5590,38 +5640,38 @@ static PyTypeObject pyrna_prop_collection_idprop_Type = {
/* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */
- /*** Flags to define presence of optional/expanded features ***/
+ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
+ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */
/* delete references to contained objects */
NULL, /* inquiry tp_clear; */
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
NULL, /* subclassed */ /* richcmpfunc tp_richcompare; */
- /*** weak reference enabler ***/
+ /*** weak reference enabler ***/
#ifdef USE_WEAKREFS
offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */
#else
0,
#endif
- /*** Added in release 2.2 ***/
+ /*** Added in release 2.2 ***/
/* Iterators */
NULL, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */
- /*** Attribute descriptor and subclassing stuff ***/
+ /*** Attribute descriptor and subclassing stuff ***/
pyrna_prop_collection_idprop_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */
- &pyrna_prop_collection_Type,/* struct _typeobject *tp_base; */
+ &pyrna_prop_collection_Type, /* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */
NULL, /* descrgetfunc tp_descr_get; */
NULL, /* descrsetfunc tp_descr_set; */
@@ -5675,37 +5725,37 @@ PyTypeObject pyrna_func_Type = {
/* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */
- /*** Flags to define presence of optional/expanded features ***/
+ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
+ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */
/* delete references to contained objects */
NULL, /* inquiry tp_clear; */
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
NULL, /* richcmpfunc tp_richcompare; */
- /*** weak reference enabler ***/
+ /*** weak reference enabler ***/
#ifdef USE_WEAKREFS
- offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */
+ offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */
#else
0,
#endif
- /*** Added in release 2.2 ***/
+ /*** Added in release 2.2 ***/
/* Iterators */
NULL, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */
- /*** Attribute descriptor and subclassing stuff ***/
+ /*** Attribute descriptor and subclassing stuff ***/
NULL, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
- NULL, /* struct PyGetSetDef *tp_getset; */
+ pyrna_func_getseters, /* struct PyGetSetDef *tp_getset; */
NULL, /* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */
NULL, /* descrgetfunc tp_descr_get; */
@@ -5750,7 +5800,7 @@ PyTypeObject pyrna_prop_collection_iter_Type = {
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */
- NULL,/* subclassed */ /* tp_repr */
+ NULL, /* subclassed */ /* tp_repr */
/* Method suites for standard classes */
@@ -5775,28 +5825,28 @@ PyTypeObject pyrna_prop_collection_iter_Type = {
/* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */
- /*** Flags to define presence of optional/expanded features ***/
+ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
+ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */
NULL, /* traverseproc tp_traverse; */
/* delete references to contained objects */
NULL, /* inquiry tp_clear; */
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
NULL, /* subclassed */ /* richcmpfunc tp_richcompare; */
- /*** weak reference enabler ***/
+ /*** weak reference enabler ***/
#ifdef USE_WEAKREFS
offsetof(BPy_PropertyCollectionIterRNA, in_weakreflist), /* long tp_weaklistoffset; */
#else
0,
#endif
- /*** Added in release 2.2 ***/
+ /*** Added in release 2.2 ***/
/* Iterators */
#if defined(_MSC_VER) || defined(FREE_WINDOWS)
NULL, /* defer assignment */
@@ -5805,7 +5855,7 @@ PyTypeObject pyrna_prop_collection_iter_Type = {
#endif
(iternextfunc) pyrna_prop_collection_iter_next, /* iternextfunc tp_iternext; */
- /*** Attribute descriptor and subclassing stuff ***/
+ /*** Attribute descriptor and subclassing stuff ***/
NULL, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
NULL, /* struct PyGetSetDef *tp_getset; */
@@ -5920,10 +5970,10 @@ static void pyrna_subtype_set_rna(PyObject *newclass, StructRNA *srna)
/* done with rna instance */
}
-static PyObject* pyrna_srna_Subtype(StructRNA *srna);
+static PyObject *pyrna_srna_Subtype(StructRNA *srna);
/* return a borrowed reference */
-static PyObject* pyrna_srna_PyBase(StructRNA *srna) //, PyObject *bpy_types_dict)
+static PyObject *pyrna_srna_PyBase(StructRNA *srna) //, PyObject *bpy_types_dict)
{
/* Assume RNA_struct_py_type_get(srna) was already checked */
StructRNA *base;
@@ -5934,7 +5984,7 @@ static PyObject* pyrna_srna_PyBase(StructRNA *srna) //, PyObject *bpy_types_dict
base = RNA_struct_base(srna);
if (base && base != srna) {
- /*/printf("debug subtype %s %p\n", RNA_struct_identifier(srna), srna); */
+ /* printf("debug subtype %s %p\n", RNA_struct_identifier(srna), srna); */
py_base = pyrna_srna_Subtype(base); //, bpy_types_dict);
Py_DECREF(py_base); /* srna owns, this is only to pass as an arg */
}
@@ -5950,7 +6000,7 @@ static PyObject* pyrna_srna_PyBase(StructRNA *srna) //, PyObject *bpy_types_dict
* return a borrowed reference */
static PyObject *bpy_types_dict = NULL;
-static PyObject* pyrna_srna_ExternalType(StructRNA *srna)
+static PyObject *pyrna_srna_ExternalType(StructRNA *srna)
{
const char *idname = RNA_struct_identifier(srna);
PyObject *newclass;
@@ -5991,7 +6041,7 @@ static PyObject* pyrna_srna_ExternalType(StructRNA *srna)
newclass = NULL;
}
else {
- if (G.f & G_DEBUG)
+ if (G.debug & G_DEBUG_PYTHON)
fprintf(stderr, "SRNA Subclassed: '%s'\n", idname);
}
}
@@ -6000,28 +6050,28 @@ static PyObject* pyrna_srna_ExternalType(StructRNA *srna)
return newclass;
}
-static PyObject* pyrna_srna_Subtype(StructRNA *srna)
+static PyObject *pyrna_srna_Subtype(StructRNA *srna)
{
PyObject *newclass = NULL;
- /* stupid/simple case */
+ /* stupid/simple case */
if (srna == NULL) {
newclass = NULL; /* Nothing to do */
- } /* the class may have already been declared & allocated */
+ } /* the class may have already been declared & allocated */
else if ((newclass = RNA_struct_py_type_get(srna))) {
Py_INCREF(newclass);
- } /* check if bpy_types.py module has the class defined in it */
+ } /* check if bpy_types.py module has the class defined in it */
else if ((newclass = pyrna_srna_ExternalType(srna))) {
pyrna_subtype_set_rna(newclass, srna);
Py_INCREF(newclass);
- } /* create a new class instance with the C api
- * mainly for the purposing of matching the C/rna type hierarchy */
+ } /* create a new class instance with the C api
+ * 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);
@@ -6033,8 +6083,8 @@ static PyObject* pyrna_srna_Subtype(StructRNA *srna)
// if (!descr) descr = "(no docs)";
// "__doc__", descr
- if ( RNA_struct_idprops_check(srna) &&
- !PyObject_IsSubclass(py_base, (PyObject *)&pyrna_struct_meta_idprop_Type))
+ if (RNA_struct_idprops_check(srna) &&
+ !PyObject_IsSubclass(py_base, (PyObject *)&pyrna_struct_meta_idprop_Type))
{
metaclass = (PyObject *)&pyrna_struct_meta_idprop_Type;
}
@@ -6043,8 +6093,8 @@ static PyObject* pyrna_srna_Subtype(StructRNA *srna)
}
/* always use O not N when calling, N causes refcount errors */
- newclass = PyObject_CallFunction(metaclass, (char *)"s(O){sss()}",
- idname, py_base, "__module__","bpy.types", "__slots__");
+ newclass = PyObject_CallFunction(metaclass, (char *)"s(O) {sss()}",
+ idname, py_base, "__module__", "bpy.types", "__slots__");
/* newclass will now have 2 ref's, ???, probably 1 is internal since decrefing here segfaults */
@@ -6080,7 +6130,7 @@ static StructRNA *srna_from_ptr(PointerRNA *ptr)
}
/* always returns a new ref, be sure to decref when done */
-static PyObject* pyrna_struct_Subtype(PointerRNA *ptr)
+static PyObject *pyrna_struct_Subtype(PointerRNA *ptr)
{
return pyrna_srna_Subtype(srna_from_ptr(ptr));
}
@@ -6500,15 +6550,17 @@ static int deferred_register_prop(StructRNA *srna, PyObject *key, PyObject *item
py_ret = PyObject_Call(py_func, args_fake, py_kw);
- Py_DECREF(args_fake); /* free's py_srna_cobject too */
-
if (py_ret) {
Py_DECREF(py_ret);
+ Py_DECREF(args_fake); /* free's py_srna_cobject too */
}
else {
+ /* _must_ print before decreffing args_fake */
PyErr_Print();
PyErr_Clear();
+ Py_DECREF(args_fake); /* free's py_srna_cobject too */
+
// PyC_LineSpit();
PyErr_Format(PyExc_ValueError,
"bpy_struct \"%.200s\" registration error: "
@@ -6521,8 +6573,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();
}
}
@@ -6582,10 +6636,10 @@ static int pyrna_deferred_register_class_recursive(StructRNA *srna, PyTypeObject
*
* So only scan base classes which are not subclasses if blender types.
* This best fits having 'mix-in' classes for operators and render engines.
- * */
+ */
if (py_superclass != &PyBaseObject_Type &&
- !PyObject_IsSubclass((PyObject *)py_superclass, (PyObject *)&pyrna_struct_Type)
- ) {
+ !PyObject_IsSubclass((PyObject *)py_superclass, (PyObject *)&pyrna_struct_Type))
+ {
ret = pyrna_deferred_register_class_recursive(srna, py_superclass);
if (ret != 0) {
@@ -6600,7 +6654,7 @@ static int pyrna_deferred_register_class_recursive(StructRNA *srna, PyTypeObject
int pyrna_deferred_register_class(StructRNA *srna, PyObject *py_class)
{
- /* Panels and Menus dont need this
+ /* Panels and Menus don't need this
* save some time and skip the checks here */
if (!RNA_struct_idprops_register_check(srna))
return 0;
@@ -6698,7 +6752,7 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun
func_arg_count = rna_function_arg_count(func);
- if (func_arg_count >= 0) { /* -1 if we dont care*/
+ if (func_arg_count >= 0) { /* -1 if we don't care*/
arg_count = ((PyCodeObject *)PyFunction_GET_CODE(item))->co_argcount;
/* note, the number of args we check for and the number of args we give to
@@ -6735,24 +6789,24 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun
/* Sneaky workaround to use the class name as the bl_idname */
#define BPY_REPLACEMENT_STRING(rna_attr, py_attr) \
- if (strcmp(identifier, rna_attr) == 0) { \
- item = PyObject_GetAttrString(py_class, py_attr); \
- if (item && item != Py_None) { \
- if (pyrna_py_to_prop(dummyptr, prop, NULL, \
- item, "validating class:") != 0) \
- { \
- Py_DECREF(item); \
- return -1; \
- } \
- } \
- Py_XDECREF(item); \
+ if (strcmp(identifier, rna_attr) == 0) { \
+ item = PyObject_GetAttrString(py_class, py_attr); \
+ if (item && item != Py_None) { \
+ if (pyrna_py_to_prop(dummyptr, prop, NULL, \
+ item, "validating class:") != 0) \
+ { \
+ Py_DECREF(item); \
+ return -1; \
} \
+ } \
+ Py_XDECREF(item); \
+ } \
BPY_REPLACEMENT_STRING("bl_idname", "__name__");
BPY_REPLACEMENT_STRING("bl_description", "__doc__");
-#undef BPY_REPLACEMENT_STRING
+#undef BPY_REPLACEMENT_STRING
if (item == NULL && (((flag & PROP_REGISTER_OPTIONAL) != PROP_REGISTER_OPTIONAL))) {
PyErr_Format(PyExc_AttributeError,
@@ -6801,8 +6855,8 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
const char *func_id = RNA_function_identifier(func);
/* testing, for correctness, not operator and not draw function */
const short is_readonly = ((strncmp("draw", func_id, 4) == 0) || /* draw or draw_header */
- /*strstr("render", func_id) ||*/
- !is_operator);
+ /*strstr("render", func_id) ||*/
+ !is_operator);
#endif
py_class = RNA_struct_py_type_get(ptr->type);
@@ -6884,9 +6938,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.
@@ -6951,7 +7008,7 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
}
#ifdef USE_PEDANTIC_WRITE
- rna_disallow_writes = is_readonly ? TRUE:FALSE;
+ rna_disallow_writes = is_readonly ? TRUE : FALSE;
#endif
/* *** Main Caller *** */
@@ -7007,8 +7064,7 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
if (err == -1) {
PyC_Err_Format_Prefix(PyExc_RuntimeError,
"class %.200s, function %.200s: incompatible return value ",
- RNA_struct_identifier(ptr->type), RNA_function_identifier(func)
- );
+ RNA_struct_identifier(ptr->type), RNA_function_identifier(func));
}
}
else if (ret_len > 1) {
@@ -7039,8 +7095,8 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
/* only useful for single argument returns, we'll need another list loop for multiple */
if (flag & PROP_OUTPUT) {
err = pyrna_py_to_prop(&funcptr, parm, iter.data,
- PyTuple_GET_ITEM(ret, i++),
- "calling class function:");
+ PyTuple_GET_ITEM(ret, i++),
+ "calling class function:");
if (err) {
break;
}
@@ -7056,10 +7112,10 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
if (err != 0) {
ReportList *reports;
/* alert the user, else they wont know unless they see the console. */
- if ( (!is_static) &&
- (ptr->data) &&
- (RNA_struct_is_a(ptr->type, &RNA_Operator)) &&
- (is_valid_wm == (CTX_wm_manager(C) != NULL)))
+ if ((!is_static) &&
+ (ptr->data) &&
+ (RNA_struct_is_a(ptr->type, &RNA_Operator)) &&
+ (is_valid_wm == (CTX_wm_manager(C) != NULL)))
{
wmOperator *op = ptr->data;
reports = op->reports;
@@ -7097,7 +7153,7 @@ static void bpy_class_free(void *pyob_ptr)
PyErr_Clear();
#if 0 /* needs further investigation, too annoying so quiet for now */
- if (G.f&G_DEBUG) {
+ if (G.debug & G_DEBUG_PYTHON) {
if (self->ob_refcnt > 1) {
PyC_ObSpit("zombie class - ref should be 1", self);
}
@@ -7154,7 +7210,7 @@ void pyrna_free_types(void)
void *py_ptr = RNA_struct_py_type_get(srna);
if (py_ptr) {
-#if 0 // XXX - should be able to do this but makes python crash on exit
+#if 0 // XXX - should be able to do this but makes python crash on exit
bpy_class_free(py_ptr);
#endif
RNA_struct_py_type_set(srna, NULL);
@@ -7228,14 +7284,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);
@@ -7269,7 +7325,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.
@@ -7334,7 +7390,7 @@ PyDoc_STRVAR(pyrna_unregister_class_doc,
" before unregistering.\n"
);
PyMethodDef meth_bpy_unregister_class = {
- "unregister_class", pyrna_unregister_class, METH_O, pyrna_unregister_class_doc
+ "unregister_class", pyrna_unregister_class, METH_O, pyrna_unregister_class_doc
};
static PyObject *pyrna_unregister_class(PyObject *UNUSED(self), PyObject *py_class)
{
@@ -7350,11 +7406,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,
@@ -7394,7 +7452,7 @@ static PyObject *pyrna_unregister_class(PyObject *UNUSED(self), PyObject *py_cla
}
/* should happen all the time but very slow */
- if (G.f & G_DEBUG) {
+ if (G.debug & G_DEBUG_PYTHON) {
/* remove all properties using this class */
StructRNA *srna_iter;
PointerRNA ptr_rna;
@@ -7431,7 +7489,7 @@ static PyObject *pyrna_unregister_class(PyObject *UNUSED(self), PyObject *py_cla
PyDict_DelItem(((PyTypeObject *)py_class)->tp_dict, bpy_intern_str_bl_rna);
if (PyErr_Occurred())
- PyErr_Clear(); //return NULL;
+ PyErr_Clear(); //return NULL;
Py_RETURN_NONE;
}
diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c
index 4b4d0ff3535..b7a45897668 100644
--- a/source/blender/python/intern/bpy_rna_anim.c
+++ b/source/blender/python/intern/bpy_rna_anim.c
@@ -149,8 +149,8 @@ static int pyrna_struct_anim_args_parse(
/* internal use for insert and delete */
static int pyrna_struct_keyframe_parse(
- PointerRNA *ptr, PyObject *args, PyObject *kw, const char *parse_str, const char *error_prefix,
- const char **path_full, int *index, float *cfra, const char **group_name) /* return values */
+ PointerRNA *ptr, PyObject *args, PyObject *kw, const char *parse_str, const char *error_prefix,
+ const char **path_full, int *index, float *cfra, const char **group_name) /* return values */
{
static const char *kwlist[] = {"data_path", "index", "frame", "group", NULL};
const char *path;
@@ -195,8 +195,8 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb
PYRNA_STRUCT_CHECK_OBJ(self);
if (pyrna_struct_keyframe_parse(&self->ptr, args, kw,
- "s|ifs:bpy_struct.keyframe_insert()", "bpy_struct.keyframe_insert()",
- &path_full, &index, &cfra, &group_name) == -1)
+ "s|ifs:bpy_struct.keyframe_insert()", "bpy_struct.keyframe_insert()",
+ &path_full, &index, &cfra, &group_name) == -1)
{
return NULL;
}
@@ -243,9 +243,9 @@ PyObject *pyrna_struct_keyframe_delete(BPy_StructRNA *self, PyObject *args, PyOb
PYRNA_STRUCT_CHECK_OBJ(self);
if (pyrna_struct_keyframe_parse(&self->ptr, args, kw,
- "s|ifs:bpy_struct.keyframe_delete()",
- "bpy_struct.keyframe_insert()",
- &path_full, &index, &cfra, &group_name) == -1)
+ "s|ifs:bpy_struct.keyframe_delete()",
+ "bpy_struct.keyframe_insert()",
+ &path_full, &index, &cfra, &group_name) == -1)
{
return NULL;
}
@@ -327,7 +327,7 @@ PyObject *pyrna_struct_driver_add(BPy_StructRNA *self, PyObject *args)
ret = pyrna_struct_CreatePyObject(&tptr);
}
- WM_event_add_notifier(BPy_GetContext(), NC_ANIMATION|ND_FCURVES_ORDER, NULL);
+ WM_event_add_notifier(BPy_GetContext(), NC_ANIMATION | ND_FCURVES_ORDER, NULL);
}
else {
/* XXX, should be handled by reports, */
@@ -380,7 +380,7 @@ PyObject *pyrna_struct_driver_remove(BPy_StructRNA *self, PyObject *args)
if (BPy_reports_to_error(&reports, PyExc_RuntimeError, TRUE) == -1)
return NULL;
- WM_event_add_notifier(BPy_GetContext(), NC_ANIMATION|ND_FCURVES_ORDER, NULL);
+ WM_event_add_notifier(BPy_GetContext(), NC_ANIMATION | ND_FCURVES_ORDER, NULL);
return PyBool_FromLong(result);
}
diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c
index a74d0417ca2..5c59c1e620a 100644
--- a/source/blender/python/intern/bpy_rna_array.c
+++ b/source/blender/python/intern/bpy_rna_array.c
@@ -45,27 +45,27 @@
#define MAX_ARRAY_DIMENSION 10
typedef void (*ItemConvertFunc)(PyObject *, char *);
-typedef int (*ItemTypeCheckFunc)(PyObject *);
+typedef int (*ItemTypeCheckFunc)(PyObject *);
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. */
static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[],
- ItemTypeCheckFunc check_item_type, const char *item_type_str, const char *error_prefix)
+ ItemTypeCheckFunc check_item_type, const char *item_type_str, const char *error_prefix)
{
Py_ssize_t i;
@@ -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++;
@@ -550,21 +550,21 @@ int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, char *param_data,
{
int ret;
switch (RNA_property_type(prop)) {
- case PROP_FLOAT:
- ret = py_to_array(py, ptr, prop, param_data, py_float_check, "float", sizeof(float),
- py_to_float, (RNA_SetArrayFunc)RNA_property_float_set_array, error_prefix);
- break;
- case PROP_INT:
- ret = py_to_array(py, ptr, prop, param_data, py_int_check, "int", sizeof(int),
- py_to_int, (RNA_SetArrayFunc)RNA_property_int_set_array, error_prefix);
- break;
- case PROP_BOOLEAN:
- ret = py_to_array(py, ptr, prop, param_data, py_bool_check, "boolean", sizeof(int),
- py_to_bool, (RNA_SetArrayFunc)RNA_property_boolean_set_array, error_prefix);
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "not an array type");
- ret = -1;
+ case PROP_FLOAT:
+ ret = py_to_array(py, ptr, prop, param_data, py_float_check, "float", sizeof(float),
+ py_to_float, (RNA_SetArrayFunc)RNA_property_float_set_array, error_prefix);
+ break;
+ case PROP_INT:
+ ret = py_to_array(py, ptr, prop, param_data, py_int_check, "int", sizeof(int),
+ py_to_int, (RNA_SetArrayFunc)RNA_property_int_set_array, error_prefix);
+ break;
+ case PROP_BOOLEAN:
+ ret = py_to_array(py, ptr, prop, param_data, py_bool_check, "boolean", sizeof(int),
+ py_to_bool, (RNA_SetArrayFunc)RNA_property_boolean_set_array, error_prefix);
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError, "not an array type");
+ ret = -1;
}
return ret;
@@ -575,21 +575,21 @@ int pyrna_py_to_array_index(PointerRNA *ptr, PropertyRNA *prop, int arraydim, in
{
int ret;
switch (RNA_property_type(prop)) {
- case PROP_FLOAT:
- ret = py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index,
- py_float_check, "float", py_to_float, float_set_index, error_prefix);
- break;
- case PROP_INT:
- ret = py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index,
- py_int_check, "int", py_to_int, int_set_index, error_prefix);
- break;
- case PROP_BOOLEAN:
- ret = py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index,
- py_bool_check, "boolean", py_to_bool, bool_set_index, error_prefix);
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "not an array type");
- ret = -1;
+ case PROP_FLOAT:
+ ret = py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index,
+ py_float_check, "float", py_to_float, float_set_index, error_prefix);
+ break;
+ case PROP_INT:
+ ret = py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index,
+ py_int_check, "int", py_to_int, int_set_index, error_prefix);
+ break;
+ case PROP_BOOLEAN:
+ ret = py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index,
+ py_bool_check, "boolean", py_to_bool, bool_set_index, error_prefix);
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError, "not an array type");
+ ret = -1;
}
return ret;
@@ -600,18 +600,18 @@ PyObject *pyrna_array_index(PointerRNA *ptr, PropertyRNA *prop, int index)
PyObject *item;
switch (RNA_property_type(prop)) {
- case PROP_FLOAT:
- item = PyFloat_FromDouble(RNA_property_float_get_index(ptr, prop, index));
- break;
- case PROP_BOOLEAN:
- item = PyBool_FromLong(RNA_property_boolean_get_index(ptr, prop, index));
- break;
- case PROP_INT:
- item = PyLong_FromSsize_t(RNA_property_int_get_index(ptr, prop, index));
- break;
- default:
- PyErr_SetString(PyExc_TypeError, "not an array type");
- item = NULL;
+ case PROP_FLOAT:
+ item = PyFloat_FromDouble(RNA_property_float_get_index(ptr, prop, index));
+ break;
+ case PROP_BOOLEAN:
+ item = PyBool_FromLong(RNA_property_boolean_get_index(ptr, prop, index));
+ break;
+ case PROP_INT:
+ item = PyLong_FromSsize_t(RNA_property_int_get_index(ptr, prop, index));
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError, "not an array type");
+ item = NULL;
}
return item;
@@ -664,7 +664,7 @@ PyObject *pyrna_py_from_array_index(BPy_PropertyArrayRNA *self, PointerRNA *ptr,
len = RNA_property_multi_array_length(ptr, prop, arraydim);
if (index >= len || index < 0) {
/* this shouldn't happen because higher level funcs must check for invalid index */
- if (G.f & G_DEBUG) printf("pyrna_py_from_array_index: invalid index %d for array with length=%d\n", index, len);
+ if (G.debug & G_DEBUG_PYTHON) printf("pyrna_py_from_array_index: invalid index %d for array with length=%d\n", index, len);
PyErr_SetString(PyExc_IndexError, "out of range");
return NULL;
@@ -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_rna_callback.c b/source/blender/python/intern/bpy_rna_callback.c
index 7704ab2a417..13532b24e55 100644
--- a/source/blender/python/intern/bpy_rna_callback.c
+++ b/source/blender/python/intern/bpy_rna_callback.c
@@ -137,7 +137,7 @@ PyObject *pyrna_callback_remove(BPy_StructRNA *self, PyObject *args)
ED_region_draw_cb_exit(((ARegion *)self->ptr.data)->type, handle);
}
- /* dont allow reuse */
+ /* don't allow reuse */
PyCapsule_SetName(py_handle, RNA_CAPSULE_ID_INVALID);
Py_RETURN_NONE;
diff --git a/source/blender/python/intern/bpy_traceback.c b/source/blender/python/intern/bpy_traceback.c
index e3272c9da1a..f7aa6e0880b 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)
@@ -39,7 +42,7 @@ static const char *traceback_filepath(PyTracebackObject *tb, PyObject **coerce)
/* copied from pythonrun.c, 3.2.0 */
static int
parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
- int *lineno, int *offset, const char **text)
+ int *lineno, int *offset, const char **text)
{
long hold;
PyObject *v;
@@ -47,11 +50,11 @@ parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
/* old style errors */
if (PyTuple_Check(err))
return PyArg_ParseTuple(err, "O(ziiz)", message, filename,
- lineno, offset, text);
+ lineno, offset, text);
/* new style errors. `err' is an instance */
- if (! (v = PyObject_GetAttrString(err, "msg")))
+ if (!(v = PyObject_GetAttrString(err, "msg")))
goto finally;
*message = v;
@@ -59,7 +62,7 @@ parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
goto finally;
if (v == Py_None)
*filename = NULL;
- else if (! (*filename = _PyUnicode_AsString(v)))
+ else if (!(*filename = _PyUnicode_AsString(v)))
goto finally;
Py_DECREF(v);
@@ -93,7 +96,7 @@ parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
if (v == Py_None)
*text = NULL;
else if (!PyUnicode_Check(v) ||
- !(*text = _PyUnicode_AsString(v)))
+ !(*text = _PyUnicode_AsString(v)))
goto finally;
Py_DECREF(v);
return 1;
@@ -119,7 +122,7 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset)
/* no traceback available when SyntaxError.
* python has no api's to this. reference parse_syntax_error() from pythonrun.c */
PyErr_NormalizeException(&exception, &value, (PyObject **)&tb);
- PyErr_Restore(exception, value, (PyObject *)tb); /* takes away reference! */
+ PyErr_Restore(exception, value, (PyObject *)tb); /* takes away reference! */
if (value) { /* should always be true */
PyObject *message;
@@ -127,9 +130,9 @@ 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 */
}
else {
@@ -143,7 +146,7 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset)
}
else {
PyErr_NormalizeException(&exception, &value, (PyObject **)&tb);
- PyErr_Restore(exception, value, (PyObject *)tb); /* takes away reference! */
+ PyErr_Restore(exception, value, (PyObject *)tb); /* takes away reference! */
PyErr_Print();
for (tb = (PyTracebackObject *)PySys_GetObject("last_traceback");
@@ -152,12 +155,13 @@ 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) ||
+ ((tb_filepath[0] == '\\' || tb_filepath[0] == '/') && BLI_path_cmp(tb_filepath + 1, filepath) == 0));
Py_DECREF(coerce);
if (match) {
*lineno = tb->tb_lineno;
- break;
+ /* used to break here, but better find the inner most line */
}
}
}
diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c
index ec7eff1756a..01495c793a8 100644
--- a/source/blender/python/intern/bpy_util.c
+++ b/source/blender/python/intern/bpy_util.c
@@ -37,9 +37,9 @@
#include "../generic/py_capi_utils.h"
-static bContext* __py_context = NULL;
-bContext* BPy_GetContext(void) { return __py_context; }
-void BPy_SetContext(bContext *C) { __py_context = C; }
+static bContext* __py_context = NULL;
+bContext *BPy_GetContext(void) { return __py_context; }
+void BPy_SetContext(bContext *C) { __py_context = C; }
char *BPy_enum_as_string(EnumPropertyItem *item)
{
@@ -49,7 +49,7 @@ char *BPy_enum_as_string(EnumPropertyItem *item)
for (e = item; item->identifier; item++) {
if (item->identifier[0])
- BLI_dynstr_appendf(dynstr, (e == item)?"'%s'":", '%s'", item->identifier);
+ BLI_dynstr_appendf(dynstr, (e == item) ? "'%s'" : ", '%s'", item->identifier);
}
cstring = BLI_dynstr_get_cstring(dynstr);
diff --git a/source/blender/python/intern/gpu.c b/source/blender/python/intern/gpu.c
index 9c1fc07108a..e5f45ca7736 100644
--- a/source/blender/python/intern/gpu.c
+++ b/source/blender/python/intern/gpu.c
@@ -60,24 +60,24 @@
#include "gpu.h"
-#define PY_MODULE_ADD_CONSTANT(module, name) PyModule_AddIntConstant(module, #name, name)
+#define PY_MODULE_ADD_CONSTANT(module, name) PyModule_AddIntConstant(module, # name, name)
PyDoc_STRVAR(M_gpu_doc,
- "This module provides access to the GLSL shader.");
-
+"This module provides access to the GLSL shader."
+);
static struct PyModuleDef gpumodule = {
PyModuleDef_HEAD_INIT,
"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. */
- NULL, NULL, NULL, NULL, NULL
+ * or -1 if the module keeps state in global variables. */
+ NULL, NULL, NULL, NULL, NULL
};
PyMODINIT_FUNC
PyInit_gpu(void)
{
- PyObject* m;
+ PyObject *m;
m = PyModule_Create(&gpumodule);
if (m == NULL)
@@ -116,35 +116,35 @@ PyInit_gpu(void)
return m;
}
-#define PY_DICT_ADD_STRING(d,s,f) \
- val = PyUnicode_FromString(s->f); \
- PyDict_SetItemString(d, #f, val); \
+#define PY_DICT_ADD_STRING(d, s, f) \
+ val = PyUnicode_FromString(s->f); \
+ PyDict_SetItemString(d, # f, val); \
Py_DECREF(val)
-#define PY_DICT_ADD_LONG(d,s,f) \
- val = PyLong_FromLong(s->f); \
- PyDict_SetItemString(d, #f, val); \
+#define PY_DICT_ADD_LONG(d, s, f) \
+ val = PyLong_FromLong(s->f); \
+ PyDict_SetItemString(d, # f, val); \
Py_DECREF(val)
-#define PY_DICT_ADD_ID(d,s,f) \
- RNA_id_pointer_create((struct ID*)s->f, &tptr); \
- val = pyrna_struct_CreatePyObject(&tptr); \
- PyDict_SetItemString(d, #f, val); \
+#define PY_DICT_ADD_ID(d, s, f) \
+ RNA_id_pointer_create((struct ID *)s->f, &tptr); \
+ val = pyrna_struct_CreatePyObject(&tptr); \
+ PyDict_SetItemString(d, # f, val); \
Py_DECREF(val)
-#define PY_OBJ_ADD_ID(d,s,f) \
- val = PyUnicode_FromString(&s->f->id.name[2]); \
- PyObject_SetAttrString(d, #f, val); \
+#define PY_OBJ_ADD_ID(d, s, f) \
+ val = PyUnicode_FromString(&s->f->id.name[2]); \
+ PyObject_SetAttrString(d, # f, val); \
Py_DECREF(val)
-#define PY_OBJ_ADD_LONG(d,s,f) \
- val = PyLong_FromLong(s->f); \
- PyObject_SetAttrString(d, #f, val); \
+#define PY_OBJ_ADD_LONG(d, s, f) \
+ val = PyLong_FromLong(s->f); \
+ PyObject_SetAttrString(d, # f, val); \
Py_DECREF(val)
-#define PY_OBJ_ADD_STRING(d,s,f) \
- val = PyUnicode_FromString(s->f); \
- PyObject_SetAttrString(d, #f, val); \
+#define PY_OBJ_ADD_STRING(d, s, f) \
+ val = PyUnicode_FromString(s->f); \
+ PyObject_SetAttrString(d, # f, val); \
Py_DECREF(val)
PyDoc_STRVAR(GPU_export_shader_doc,
@@ -155,14 +155,14 @@ PyDoc_STRVAR(GPU_export_shader_doc,
" :return: Dictionary defining the shader, uniforms and attributes.\n"
" :rtype: Dict"
);
-static PyObject* GPU_export_shader(PyObject* UNUSED(self), PyObject *args, PyObject *kwds)
+static PyObject *GPU_export_shader(PyObject *UNUSED(self), PyObject *args, PyObject *kwds)
{
- PyObject* pyscene;
- PyObject* pymat;
- PyObject* result;
- PyObject* dict;
- PyObject* val;
- PyObject* seq;
+ PyObject *pyscene;
+ PyObject *pymat;
+ PyObject *result;
+ PyObject *dict;
+ PyObject *val;
+ PyObject *seq;
int i;
Scene *scene;
@@ -174,7 +174,7 @@ static PyObject* GPU_export_shader(PyObject* UNUSED(self), PyObject *args, PyObj
static const char *kwlist[] = {"scene", "material", NULL};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO:export_shader", (char**)(kwlist), &pyscene, &pymat))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO:export_shader", (char **)(kwlist), &pyscene, &pymat))
return NULL;
scene = (Scene *)PyC_RNA_AsPointer(pyscene, "Scene");
@@ -196,33 +196,34 @@ static PyObject* GPU_export_shader(PyObject* UNUSED(self), PyObject *args, PyObj
// build a dictionary
result = PyDict_New();
if (shader->fragment) {
- PY_DICT_ADD_STRING(result,shader,fragment);
+ PY_DICT_ADD_STRING(result, shader, fragment);
}
if (shader->vertex) {
- PY_DICT_ADD_STRING(result,shader,vertex);
+ PY_DICT_ADD_STRING(result, shader, vertex);
}
seq = PyList_New(BLI_countlist(&shader->uniforms));
- for (i=0, uniform=shader->uniforms.first; uniform; uniform=uniform->next, i++) {
+ for (i = 0, uniform = shader->uniforms.first; uniform; uniform = uniform->next, i++) {
dict = PyDict_New();
- PY_DICT_ADD_STRING(dict,uniform,varname);
- PY_DICT_ADD_LONG(dict,uniform,datatype);
- PY_DICT_ADD_LONG(dict,uniform,type);
+ PY_DICT_ADD_STRING(dict, uniform, varname);
+ PY_DICT_ADD_LONG(dict, uniform, datatype);
+ PY_DICT_ADD_LONG(dict, uniform, type);
if (uniform->lamp) {
- PY_DICT_ADD_ID(dict,uniform,lamp);
+ PY_DICT_ADD_ID(dict, uniform, lamp);
}
if (uniform->image) {
- PY_DICT_ADD_ID(dict,uniform,image);
+ PY_DICT_ADD_ID(dict, uniform, image);
}
if (uniform->type == GPU_DYNAMIC_SAMPLER_2DBUFFER ||
- uniform->type == GPU_DYNAMIC_SAMPLER_2DIMAGE ||
- uniform->type == GPU_DYNAMIC_SAMPLER_2DSHADOW) {
- PY_DICT_ADD_LONG(dict,uniform,texnumber);
+ uniform->type == GPU_DYNAMIC_SAMPLER_2DIMAGE ||
+ uniform->type == GPU_DYNAMIC_SAMPLER_2DSHADOW)
+ {
+ PY_DICT_ADD_LONG(dict, uniform, texnumber);
}
if (uniform->texpixels) {
val = PyByteArray_FromStringAndSize((const char *)uniform->texpixels, uniform->texsize * 4);
PyDict_SetItemString(dict, "texpixels", val);
Py_DECREF(val);
- PY_DICT_ADD_LONG(dict,uniform,texsize);
+ PY_DICT_ADD_LONG(dict, uniform, texsize);
}
PyList_SET_ITEM(seq, i, dict);
}
@@ -230,15 +231,15 @@ static PyObject* GPU_export_shader(PyObject* UNUSED(self), PyObject *args, PyObj
Py_DECREF(seq);
seq = PyList_New(BLI_countlist(&shader->attributes));
- for (i=0, attribute=shader->attributes.first; attribute; attribute=attribute->next, i++) {
+ for (i = 0, attribute = shader->attributes.first; attribute; attribute = attribute->next, i++) {
dict = PyDict_New();
- PY_DICT_ADD_STRING(dict,attribute,varname);
- PY_DICT_ADD_LONG(dict,attribute,datatype);
- PY_DICT_ADD_LONG(dict,attribute,type);
- PY_DICT_ADD_LONG(dict,attribute,number);
+ PY_DICT_ADD_STRING(dict, attribute, varname);
+ PY_DICT_ADD_LONG(dict, attribute, datatype);
+ PY_DICT_ADD_LONG(dict, attribute, type);
+ PY_DICT_ADD_LONG(dict, attribute, number);
if (attribute->name) {
if (attribute->name[0] != 0) {
- PY_DICT_ADD_STRING(dict,attribute,name);
+ PY_DICT_ADD_STRING(dict, attribute, name);
}
else {
val = PyLong_FromLong(0);
@@ -260,9 +261,9 @@ static PyMethodDef meth_export_shader[] = {
{"export_shader", (PyCFunction)GPU_export_shader, METH_VARARGS | METH_KEYWORDS, GPU_export_shader_doc}
};
-PyObject* GPU_initPython(void)
+PyObject *GPU_initPython(void)
{
- PyObject* module = PyInit_gpu();
+ PyObject *module = PyInit_gpu();
PyModule_AddObject(module, "export_shader", (PyObject *)PyCFunction_New(meth_export_shader, NULL));
PyDict_SetItemString(PyImport_GetModuleDict(), "gpu", module);
diff --git a/source/blender/python/intern/gpu.h b/source/blender/python/intern/gpu.h
index bffbae13ba2..68e7fa4aa9e 100644
--- a/source/blender/python/intern/gpu.h
+++ b/source/blender/python/intern/gpu.h
@@ -32,5 +32,5 @@
/**
* Initalizes the gpu Python module.
*/
-PyObject* GPU_initPython(void);
+PyObject *GPU_initPython(void);
diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c
index e6be81f88a3..5f9e68f07d8 100644
--- a/source/blender/python/mathutils/mathutils.c
+++ b/source/blender/python/mathutils/mathutils.c
@@ -52,8 +52,8 @@ static int mathutils_array_parse_fast(float *array,
i = size;
do {
i--;
- if ( ((array[i] = PyFloat_AsDouble((item = PySequence_Fast_GET_ITEM(value_fast, i)))) == -1.0f) &&
- PyErr_Occurred())
+ if (((array[i] = PyFloat_AsDouble((item = PySequence_Fast_GET_ITEM(value_fast, i)))) == -1.0f) &&
+ PyErr_Occurred())
{
PyErr_Format(PyExc_TypeError,
"%.200s: sequence index %d expected a number, "
@@ -75,17 +75,17 @@ int mathutils_array_parse(float *array, int array_min, int array_max, PyObject *
#if 1 /* approx 6x speedup for mathutils types */
- if ( (size = VectorObject_Check(value) ? ((VectorObject *)value)->size : 0) ||
- (size = EulerObject_Check(value) ? 3 : 0) ||
- (size = QuaternionObject_Check(value) ? 4 : 0) ||
- (size = ColorObject_Check(value) ? 3 : 0))
+ if ((size = VectorObject_Check(value) ? ((VectorObject *)value)->size : 0) ||
+ (size = EulerObject_Check(value) ? 3 : 0) ||
+ (size = QuaternionObject_Check(value) ? 4 : 0) ||
+ (size = ColorObject_Check(value) ? 3 : 0))
{
if (BaseMath_ReadCallback((BaseMathObject *)value) == -1) {
return -1;
}
if (size > array_max || size < array_min) {
- if (array_max == array_min) {
+ if (array_max == array_min) {
PyErr_Format(PyExc_ValueError,
"%.200s: sequence size is %d, expected %d",
error_prefix, size, array_max);
@@ -115,15 +115,15 @@ int mathutils_array_parse(float *array, int array_min, int array_max, PyObject *
size = PySequence_Fast_GET_SIZE(value_fast);
if (size > array_max || size < array_min) {
- if (array_max == array_min) {
+ if (array_max == array_min) {
PyErr_Format(PyExc_ValueError,
- "%.200s: sequence size is %d, expected %d",
- error_prefix, size, array_max);
+ "%.200s: sequence size is %d, expected %d",
+ error_prefix, size, array_max);
}
else {
PyErr_Format(PyExc_ValueError,
- "%.200s: sequence size is %d, expected [%d - %d]",
- error_prefix, size, array_min, array_max);
+ "%.200s: sequence size is %d, expected [%d - %d]",
+ error_prefix, size, array_min, array_max);
}
Py_DECREF(value_fast);
return -1;
@@ -139,10 +139,10 @@ int mathutils_array_parse_alloc(float **array, int array_min, PyObject *value, c
#if 1 /* approx 6x speedup for mathutils types */
- if ( (size = VectorObject_Check(value) ? ((VectorObject *)value)->size : 0) ||
- (size = EulerObject_Check(value) ? 3 : 0) ||
- (size = QuaternionObject_Check(value) ? 4 : 0) ||
- (size = ColorObject_Check(value) ? 3 : 0))
+ if ((size = VectorObject_Check(value) ? ((VectorObject *)value)->size : 0) ||
+ (size = EulerObject_Check(value) ? 3 : 0) ||
+ (size = QuaternionObject_Check(value) ? 4 : 0) ||
+ (size = ColorObject_Check(value) ? 3 : 0))
{
if (BaseMath_ReadCallback((BaseMathObject *)value) == -1) {
return -1;
@@ -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))) {
@@ -239,25 +239,26 @@ int mathutils_any_to_rotmat(float rmat[3][3], PyObject *value, const char *error
/* Utility functions */
// LomontRRDCompare4, Ever Faster Float Comparisons by Randy Dillon
-#define SIGNMASK(i) (-(int)(((unsigned int)(i))>>31))
+#define SIGNMASK(i) (-(int)(((unsigned int)(i)) >> 31))
int EXPP_FloatsAreEqual(float af, float bf, int maxDiff)
-{ // solid, fast routine across all platforms
- // with constant time behavior
+{
+ /* solid, fast routine across all platforms
+ * with constant time behavior */
int ai = *(int *)(&af);
int bi = *(int *)(&bf);
- int test = SIGNMASK(ai^bi);
+ int test = SIGNMASK(ai ^ bi);
int diff, v1, v2;
assert((0 == test) || (0xFFFFFFFF == test));
diff = (ai ^ (test & 0x7fffffff)) - bi;
v1 = maxDiff + diff;
v2 = maxDiff - diff;
- return (v1|v2) >= 0;
+ return (v1 | v2) >= 0;
}
/*---------------------- 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;
@@ -281,21 +282,31 @@ PyObject *mathutils_dynstr_to_py(struct DynStr *ds)
return ret;
}
+/* silly function, we dont use arg. just check its compatible with __deepcopy__ */
+int mathutils_deepcopy_args_check(PyObject *args)
+{
+ PyObject *dummy_pydict;
+ return PyArg_ParseTuple(args, "|O!:__deepcopy__", &PyDict_Type, &dummy_pydict) != 0;
+}
+
/* Mathutils Callbacks */
/* for mathutils internal use only, eventually should re-alloc but to start with we only have a few users */
-static Mathutils_Callback *mathutils_callbacks[8] = {NULL};
+#define MATHUTILS_TOT_CB 8
+static Mathutils_Callback *mathutils_callbacks[MATHUTILS_TOT_CB] = {NULL};
-int Mathutils_RegisterCallback(Mathutils_Callback *cb)
+unsigned char Mathutils_RegisterCallback(Mathutils_Callback *cb)
{
- int i;
+ unsigned char i;
/* find the first free slot */
for (i = 0; mathutils_callbacks[i]; i++) {
if (mathutils_callbacks[i] == cb) /* already registered? */
return i;
}
-
+
+ BLI_assert(i < MATHUTILS_TOT_CB);
+
mathutils_callbacks[i] = cb;
return i;
}
@@ -373,7 +384,7 @@ PyObject *BaseMathObject_owner_get(BaseMathObject *self, void *UNUSED(closure))
char BaseMathObject_is_wrapped_doc[] = "True when this object wraps external data (read-only).\n\n:type: boolean";
PyObject *BaseMathObject_is_wrapped_get(BaseMathObject *self, void *UNUSED(closure))
{
- return PyBool_FromLong((self->wrapped == Py_WRAP) ? 1:0);
+ return PyBool_FromLong((self->wrapped == Py_WRAP) ? 1 : 0);
}
int BaseMathObject_traverse(BaseMathObject *self, visitproc visit, void *arg)
@@ -442,14 +453,14 @@ PyMODINIT_FUNC PyInit_mathutils(void)
submodule = PyModule_Create(&M_Mathutils_module_def);
/* each type has its own new() function */
- PyModule_AddObject(submodule, "Vector", (PyObject *)&vector_Type);
- PyModule_AddObject(submodule, "Matrix", (PyObject *)&matrix_Type);
- PyModule_AddObject(submodule, "Euler", (PyObject *)&euler_Type);
- PyModule_AddObject(submodule, "Quaternion", (PyObject *)&quaternion_Type);
- PyModule_AddObject(submodule, "Color", (PyObject *)&color_Type);
+ PyModule_AddObject(submodule, "Vector", (PyObject *)&vector_Type);
+ PyModule_AddObject(submodule, "Matrix", (PyObject *)&matrix_Type);
+ PyModule_AddObject(submodule, "Euler", (PyObject *)&euler_Type);
+ PyModule_AddObject(submodule, "Quaternion", (PyObject *)&quaternion_Type);
+ PyModule_AddObject(submodule, "Color", (PyObject *)&color_Type);
/* submodule */
- PyModule_AddObject(submodule, "geometry", (item = PyInit_mathutils_geometry()));
+ PyModule_AddObject(submodule, "geometry", (item = PyInit_mathutils_geometry()));
/* XXX, python doesnt do imports with this usefully yet
* 'from mathutils.geometry import PolyFill'
* ...fails without this. */
@@ -457,7 +468,7 @@ PyMODINIT_FUNC PyInit_mathutils(void)
Py_INCREF(item);
/* Noise submodule */
- PyModule_AddObject(submodule, "noise", (item = PyInit_mathutils_noise()));
+ PyModule_AddObject(submodule, "noise", (item = PyInit_mathutils_noise()));
PyDict_SetItemString(sys_modules, "mathutils.noise", item);
Py_INCREF(item);
diff --git a/source/blender/python/mathutils/mathutils.h b/source/blender/python/mathutils/mathutils.h
index 854cb2e962a..b98928eb79d 100644
--- a/source/blender/python/mathutils/mathutils.h
+++ b/source/blender/python/mathutils/mathutils.h
@@ -67,8 +67,8 @@ typedef struct {
#include "mathutils_geometry.h"
#include "mathutils_noise.h"
-PyObject *BaseMathObject_owner_get( BaseMathObject * self, void * );
-PyObject *BaseMathObject_is_wrapped_get( BaseMathObject *self, void * );
+PyObject *BaseMathObject_owner_get(BaseMathObject * self, void *);
+PyObject *BaseMathObject_is_wrapped_get(BaseMathObject *self, void *);
int BaseMathObject_traverse(BaseMathObject *self, visitproc visit, void *arg);
int BaseMathObject_clear(BaseMathObject *self);
@@ -98,7 +98,7 @@ struct Mathutils_Callback {
BaseMathSetIndexFunc set_index;
};
-int Mathutils_RegisterCallback(Mathutils_Callback *cb);
+unsigned char Mathutils_RegisterCallback(Mathutils_Callback *cb);
int _BaseMathObject_ReadCallback(BaseMathObject *self);
int _BaseMathObject_WriteCallback(BaseMathObject *self);
@@ -124,5 +124,6 @@ int column_vector_multiplication(float rvec[4], VectorObject *vec, MatrixObject
/* dynstr as python string utility funcions */
PyObject *mathutils_dynstr_to_py(struct DynStr *ds);
+int mathutils_deepcopy_args_check(PyObject *args);
#endif /* __MATHUTILS_H__ */
diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c
index 7f3f811c41a..9b06214b8ec 100644
--- a/source/blender/python/mathutils/mathutils_Color.c
+++ b/source/blender/python/mathutils/mathutils_Color.c
@@ -50,17 +50,17 @@ static PyObject *Color_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
}
switch (PyTuple_GET_SIZE(args)) {
- case 0:
- break;
- case 1:
- if ((mathutils_array_parse(col, COLOR_SIZE, COLOR_SIZE, PyTuple_GET_ITEM(args, 0), "mathutils.Color()")) == -1)
+ case 0:
+ break;
+ case 1:
+ if ((mathutils_array_parse(col, COLOR_SIZE, COLOR_SIZE, PyTuple_GET_ITEM(args, 0), "mathutils.Color()")) == -1)
+ return NULL;
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError,
+ "mathutils.Color(): "
+ "more then a single arg given");
return NULL;
- break;
- default:
- PyErr_SetString(PyExc_TypeError,
- "mathutils.Color(): "
- "more then a single arg given");
- return NULL;
}
return Color_CreatePyObject(col, Py_NEW, type);
}
@@ -107,6 +107,12 @@ static PyObject *Color_copy(ColorObject *self)
return Color_CreatePyObject(self->col, Py_NEW, Py_TYPE(self));
}
+static PyObject *Color_deepcopy(ColorObject *self, PyObject *args)
+{
+ if (!mathutils_deepcopy_args_check(args))
+ return NULL;
+ return Color_copy(self);
+}
//----------------------------print object (internal)--------------
//print the object to screen
@@ -159,21 +165,21 @@ static PyObject *Color_richcmpr(PyObject *a, PyObject *b, int op)
}
switch (op) {
- case Py_NE:
- ok = !ok; /* pass through */
- case Py_EQ:
- res = ok ? Py_False : Py_True;
- break;
-
- case Py_LT:
- case Py_LE:
- case Py_GT:
- case Py_GE:
- res = Py_NotImplemented;
- break;
- default:
- PyErr_BadArgument();
- return NULL;
+ case Py_NE:
+ ok = !ok; /* pass through */
+ case Py_EQ:
+ res = ok ? Py_False : Py_True;
+ break;
+
+ case Py_LT:
+ case Py_LE:
+ case Py_GT:
+ case Py_GE:
+ res = Py_NotImplemented;
+ break;
+ default:
+ PyErr_BadArgument();
+ return NULL;
}
return Py_INCREF(res), res;
@@ -194,7 +200,7 @@ static PyObject *Color_item(ColorObject *self, int i)
if (i < 0 || i >= COLOR_SIZE) {
PyErr_SetString(PyExc_IndexError,
- "color[attribute]: "
+ "color[item]: "
"array index out of range");
return NULL;
}
@@ -213,15 +219,15 @@ static int Color_ass_item(ColorObject *self, int i, PyObject *value)
if (f == -1 && PyErr_Occurred()) { // parsed item not a number
PyErr_SetString(PyExc_TypeError,
- "color[attribute] = x: "
+ "color[item] = x: "
"argument not a number");
return -1;
}
- if (i < 0) i= COLOR_SIZE - i;
+ if (i < 0) i = COLOR_SIZE - i;
if (i < 0 || i >= COLOR_SIZE) {
- PyErr_SetString(PyExc_IndexError, "color[attribute] = x: "
+ PyErr_SetString(PyExc_IndexError, "color[item] = x: "
"array assignment index out of range");
return -1;
}
@@ -358,16 +364,16 @@ static int Color_ass_subscript(ColorObject *self, PyObject *item, PyObject *valu
//-----------------PROTCOL DECLARATIONS--------------------------
static PySequenceMethods Color_SeqMethods = {
- (lenfunc) Color_len, /* sq_length */
- (binaryfunc) NULL, /* sq_concat */
- (ssizeargfunc) NULL, /* sq_repeat */
- (ssizeargfunc) Color_item, /* sq_item */
- NULL, /* sq_slice, deprecated */
- (ssizeobjargproc) Color_ass_item, /* sq_ass_item */
- NULL, /* sq_ass_slice, deprecated */
- (objobjproc) NULL, /* sq_contains */
- (binaryfunc) NULL, /* sq_inplace_concat */
- (ssizeargfunc) NULL, /* sq_inplace_repeat */
+ (lenfunc) Color_len, /* sq_length */
+ (binaryfunc) NULL, /* sq_concat */
+ (ssizeargfunc) NULL, /* sq_repeat */
+ (ssizeargfunc) Color_item, /* sq_item */
+ NULL, /* sq_slice, deprecated */
+ (ssizeobjargproc) Color_ass_item, /* sq_ass_item */
+ NULL, /* sq_ass_slice, deprecated */
+ (objobjproc) NULL, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
};
static PyMappingMethods Color_AsMapping = {
@@ -490,12 +496,12 @@ static PyObject *Color_mul(PyObject *v1, PyObject *v2)
ColorObject *color1 = NULL, *color2 = NULL;
float scalar;
- if ColorObject_Check(v1) {
+ if (ColorObject_Check(v1)) {
color1 = (ColorObject *)v1;
if (BaseMath_ReadCallback(color1) == -1)
return NULL;
}
- if ColorObject_Check(v2) {
+ if (ColorObject_Check(v2)) {
color2 = (ColorObject *)v2;
if (BaseMath_ReadCallback(color2) == -1)
return NULL;
@@ -504,7 +510,7 @@ static PyObject *Color_mul(PyObject *v1, PyObject *v2)
/* make sure v1 is always the vector */
if (color1 && color2) {
- /* col * col, dont support yet! */
+ /* col * col, don't support yet! */
}
else if (color1) {
if (((scalar = PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) == 0) { /* COLOR * FLOAT */
@@ -532,7 +538,7 @@ static PyObject *Color_div(PyObject *v1, PyObject *v2)
ColorObject *color1 = NULL;
float scalar;
- if ColorObject_Check(v1) {
+ if (ColorObject_Check(v1)) {
color1 = (ColorObject *)v1;
if (BaseMath_ReadCallback(color1) == -1)
return NULL;
@@ -619,7 +625,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];
@@ -633,40 +639,40 @@ static PyObject *Color_neg(ColorObject *self)
static PyNumberMethods Color_NumMethods = {
- (binaryfunc) Color_add, /*nb_add*/
- (binaryfunc) Color_sub, /*nb_subtract*/
- (binaryfunc) Color_mul, /*nb_multiply*/
- NULL, /*nb_remainder*/
- NULL, /*nb_divmod*/
- NULL, /*nb_power*/
+ (binaryfunc) Color_add, /*nb_add*/
+ (binaryfunc) Color_sub, /*nb_subtract*/
+ (binaryfunc) Color_mul, /*nb_multiply*/
+ NULL, /*nb_remainder*/
+ NULL, /*nb_divmod*/
+ NULL, /*nb_power*/
(unaryfunc) Color_neg, /*nb_negative*/
- (unaryfunc) NULL, /*tp_positive*/
- (unaryfunc) NULL, /*tp_absolute*/
- (inquiry) NULL, /*tp_bool*/
- (unaryfunc) NULL, /*nb_invert*/
- NULL, /*nb_lshift*/
- (binaryfunc)NULL, /*nb_rshift*/
- NULL, /*nb_and*/
- NULL, /*nb_xor*/
- NULL, /*nb_or*/
- NULL, /*nb_int*/
- NULL, /*nb_reserved*/
- NULL, /*nb_float*/
- Color_iadd, /* nb_inplace_add */
- Color_isub, /* nb_inplace_subtract */
- Color_imul, /* nb_inplace_multiply */
- NULL, /* nb_inplace_remainder */
- NULL, /* nb_inplace_power */
- NULL, /* nb_inplace_lshift */
- NULL, /* nb_inplace_rshift */
- NULL, /* nb_inplace_and */
- NULL, /* nb_inplace_xor */
- NULL, /* nb_inplace_or */
- NULL, /* nb_floor_divide */
- Color_div, /* nb_true_divide */
- NULL, /* nb_inplace_floor_divide */
- Color_idiv, /* nb_inplace_true_divide */
- NULL, /* nb_index */
+ (unaryfunc) NULL, /*tp_positive*/
+ (unaryfunc) NULL, /*tp_absolute*/
+ (inquiry) NULL, /*tp_bool*/
+ (unaryfunc) NULL, /*nb_invert*/
+ NULL, /*nb_lshift*/
+ (binaryfunc)NULL, /*nb_rshift*/
+ NULL, /*nb_and*/
+ NULL, /*nb_xor*/
+ NULL, /*nb_or*/
+ NULL, /*nb_int*/
+ NULL, /*nb_reserved*/
+ NULL, /*nb_float*/
+ Color_iadd, /* nb_inplace_add */
+ Color_isub, /* nb_inplace_subtract */
+ Color_imul, /* nb_inplace_multiply */
+ NULL, /* nb_inplace_remainder */
+ NULL, /* nb_inplace_power */
+ NULL, /* nb_inplace_lshift */
+ NULL, /* nb_inplace_rshift */
+ NULL, /* nb_inplace_and */
+ NULL, /* nb_inplace_xor */
+ NULL, /* nb_inplace_or */
+ NULL, /* nb_floor_divide */
+ Color_div, /* nb_true_divide */
+ NULL, /* nb_inplace_floor_divide */
+ Color_idiv, /* nb_inplace_true_divide */
+ NULL, /* nb_index */
};
/* color channel, vector.r/g/b */
@@ -679,7 +685,7 @@ static PyObject *Color_channel_get(ColorObject *self, void *type)
return Color_item(self, GET_INT_FROM_POINTER(type));
}
-static int Color_channel_set(ColorObject *self, PyObject *value, void * type)
+static int Color_channel_set(ColorObject *self, PyObject *value, void *type)
{
return Color_ass_item(self, GET_INT_FROM_POINTER(type), value);
}
@@ -702,7 +708,7 @@ static PyObject *Color_channel_hsv_get(ColorObject *self, void *type)
return PyFloat_FromDouble(hsv[i]);
}
-static int Color_channel_hsv_set(ColorObject *self, PyObject *value, void * type)
+static int Color_channel_hsv_set(ColorObject *self, PyObject *value, void *type)
{
float hsv[3];
int i = GET_INT_FROM_POINTER(type);
@@ -789,8 +795,9 @@ static PyGetSetDef Color_getseters[] = {
//-----------------------METHOD DEFINITIONS ----------------------
static struct PyMethodDef Color_methods[] = {
- {"__copy__", (PyCFunction) Color_copy, METH_NOARGS, Color_copy_doc},
{"copy", (PyCFunction) Color_copy, METH_NOARGS, Color_copy_doc},
+ {"__copy__", (PyCFunction) Color_copy, METH_NOARGS, Color_copy_doc},
+ {"__deepcopy__", (PyCFunction) Color_deepcopy, METH_VARARGS, Color_copy_doc},
{NULL, NULL, 0, NULL}
};
@@ -800,64 +807,64 @@ PyDoc_STRVAR(color_doc,
);
PyTypeObject color_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
- "mathutils.Color", //tp_name
- sizeof(ColorObject), //tp_basicsize
- 0, //tp_itemsize
- (destructor)BaseMathObject_dealloc, //tp_dealloc
- NULL, //tp_print
- NULL, //tp_getattr
- NULL, //tp_setattr
- NULL, //tp_compare
- (reprfunc) Color_repr, //tp_repr
- &Color_NumMethods, //tp_as_number
- &Color_SeqMethods, //tp_as_sequence
- &Color_AsMapping, //tp_as_mapping
- NULL, //tp_hash
- NULL, //tp_call
- (reprfunc) Color_str, //tp_str
- NULL, //tp_getattro
- NULL, //tp_setattro
- NULL, //tp_as_buffer
+ "mathutils.Color", //tp_name
+ sizeof(ColorObject), //tp_basicsize
+ 0, //tp_itemsize
+ (destructor)BaseMathObject_dealloc, //tp_dealloc
+ NULL, //tp_print
+ NULL, //tp_getattr
+ NULL, //tp_setattr
+ NULL, //tp_compare
+ (reprfunc) Color_repr, //tp_repr
+ &Color_NumMethods, //tp_as_number
+ &Color_SeqMethods, //tp_as_sequence
+ &Color_AsMapping, //tp_as_mapping
+ NULL, //tp_hash
+ NULL, //tp_call
+ (reprfunc) Color_str, //tp_str
+ NULL, //tp_getattro
+ NULL, //tp_setattro
+ NULL, //tp_as_buffer
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, //tp_flags
color_doc, //tp_doc
- (traverseproc)BaseMathObject_traverse, //tp_traverse
- (inquiry)BaseMathObject_clear, //tp_clear
- (richcmpfunc)Color_richcmpr, //tp_richcompare
- 0, //tp_weaklistoffset
- NULL, //tp_iter
- NULL, //tp_iternext
- Color_methods, //tp_methods
- NULL, //tp_members
- Color_getseters, //tp_getset
- NULL, //tp_base
- NULL, //tp_dict
- NULL, //tp_descr_get
- NULL, //tp_descr_set
- 0, //tp_dictoffset
- NULL, //tp_init
- NULL, //tp_alloc
- Color_new, //tp_new
- NULL, //tp_free
- NULL, //tp_is_gc
- NULL, //tp_bases
- NULL, //tp_mro
- NULL, //tp_cache
- NULL, //tp_subclasses
- NULL, //tp_weaklist
- NULL //tp_del
+ (traverseproc)BaseMathObject_traverse, //tp_traverse
+ (inquiry)BaseMathObject_clear, //tp_clear
+ (richcmpfunc)Color_richcmpr, //tp_richcompare
+ 0, //tp_weaklistoffset
+ NULL, //tp_iter
+ NULL, //tp_iternext
+ Color_methods, //tp_methods
+ NULL, //tp_members
+ Color_getseters, //tp_getset
+ NULL, //tp_base
+ NULL, //tp_dict
+ NULL, //tp_descr_get
+ NULL, //tp_descr_set
+ 0, //tp_dictoffset
+ NULL, //tp_init
+ NULL, //tp_alloc
+ Color_new, //tp_new
+ NULL, //tp_free
+ NULL, //tp_is_gc
+ NULL, //tp_bases
+ NULL, //tp_mro
+ NULL, //tp_cache
+ NULL, //tp_subclasses
+ NULL, //tp_weaklist
+ NULL //tp_del
};
//------------------------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;
- self = base_type ? (ColorObject *)base_type->tp_alloc(base_type, 0) :
- (ColorObject *)PyObject_GC_New(ColorObject, &color_Type);
+ self = base_type ? (ColorObject *)base_type->tp_alloc(base_type, 0) :
+ (ColorObject *)PyObject_GC_New(ColorObject, &color_Type);
if (self) {
/* init callbacks as NULL */
@@ -885,14 +892,15 @@ PyObject *Color_CreatePyObject(float *col, int type, PyTypeObject *base_type)
return (PyObject *)self;
}
-PyObject *Color_CreatePyObject_cb(PyObject *cb_user, int cb_type, int cb_subtype)
+PyObject *Color_CreatePyObject_cb(PyObject *cb_user,
+ unsigned char cb_type, unsigned char cb_subtype)
{
ColorObject *self = (ColorObject *)Color_CreatePyObject(NULL, Py_NEW, NULL);
if (self) {
Py_INCREF(cb_user);
- self->cb_user = cb_user;
- self->cb_type = (unsigned char)cb_type;
- self->cb_subtype = (unsigned char)cb_subtype;
+ self->cb_user = cb_user;
+ self->cb_type = cb_type;
+ self->cb_subtype = cb_subtype;
PyObject_GC_Track(self);
}
diff --git a/source/blender/python/mathutils/mathutils_Color.h b/source/blender/python/mathutils/mathutils_Color.h
index 786afeed5da..2bf6ba2ef1f 100644
--- a/source/blender/python/mathutils/mathutils_Color.h
+++ b/source/blender/python/mathutils/mathutils_Color.h
@@ -42,13 +42,14 @@ 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);
-PyObject *Color_CreatePyObject_cb(PyObject *cb_user, int cb_type, int cb_subtype);
+PyObject *Color_CreatePyObject(float *col, int type, PyTypeObject *base_type);
+PyObject *Color_CreatePyObject_cb(PyObject *cb_user,
+ unsigned char cb_type, unsigned char cb_subtype);
#endif /* __MATHUTILS_COLOR_H__ */
diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c
index 66caed50aa9..4e3b5f8d52e 100644
--- a/source/blender/python/mathutils/mathutils_Euler.c
+++ b/source/blender/python/mathutils/mathutils_Euler.c
@@ -61,16 +61,16 @@ static PyObject *Euler_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return NULL;
switch (PyTuple_GET_SIZE(args)) {
- case 0:
- break;
- case 2:
- if ((order = euler_order_from_string(order_str, "mathutils.Euler()")) == -1)
- return NULL;
+ case 0:
+ break;
+ case 2:
+ if ((order = euler_order_from_string(order_str, "mathutils.Euler()")) == -1)
+ return NULL;
/* intentionally pass through */
- case 1:
- if (mathutils_array_parse(eul, EULER_SIZE, EULER_SIZE, seq, "mathutils.Euler()") == -1)
- return NULL;
- break;
+ case 1:
+ if (mathutils_array_parse(eul, EULER_SIZE, EULER_SIZE, seq, "mathutils.Euler()") == -1)
+ return NULL;
+ break;
}
return Euler_CreatePyObject(eul, order, Py_NEW, type);
}
@@ -86,12 +86,12 @@ short euler_order_from_string(const char *str, const char *error_prefix)
{
if ((str[0] && str[1] && str[2] && str[3] == '\0')) {
switch (*((PY_INT32_T *)str)) {
- case 'X'|'Y'<<8|'Z'<<16: return EULER_ORDER_XYZ;
- case 'X'|'Z'<<8|'Y'<<16: return EULER_ORDER_XZY;
- case 'Y'|'X'<<8|'Z'<<16: return EULER_ORDER_YXZ;
- case 'Y'|'Z'<<8|'X'<<16: return EULER_ORDER_YZX;
- case 'Z'|'X'<<8|'Y'<<16: return EULER_ORDER_ZXY;
- case 'Z'|'Y'<<8|'X'<<16: return EULER_ORDER_ZYX;
+ case 'X' | 'Y' << 8 | 'Z' << 16: return EULER_ORDER_XYZ;
+ case 'X' | 'Z' << 8 | 'Y' << 16: return EULER_ORDER_XZY;
+ case 'Y' | 'X' << 8 | 'Z' << 16: return EULER_ORDER_YXZ;
+ case 'Y' | 'Z' << 8 | 'X' << 16: return EULER_ORDER_YZX;
+ case 'Z' | 'X' << 8 | 'Y' << 16: return EULER_ORDER_ZXY;
+ case 'Z' | 'Y' << 8 | 'X' << 16: return EULER_ORDER_ZYX;
}
}
@@ -164,7 +164,7 @@ static PyObject *Euler_to_matrix(EulerObject *self)
eulO_to_mat3((float (*)[3])mat, self->eul, self->order);
- return Matrix_CreatePyObject(mat, 3, 3 , Py_NEW, NULL);
+ return Matrix_CreatePyObject(mat, 3, 3, Py_NEW, NULL);
}
PyDoc_STRVAR(Euler_zero_doc,
@@ -299,6 +299,12 @@ static PyObject *Euler_copy(EulerObject *self)
return Euler_CreatePyObject(self->eul, self->order, Py_NEW, Py_TYPE(self));
}
+static PyObject *Euler_deepcopy(EulerObject *self, PyObject *args)
+{
+ if (!mathutils_deepcopy_args_check(args))
+ return NULL;
+ return Euler_copy(self);
+}
//----------------------------print object (internal)--------------
//print the object to screen
@@ -349,21 +355,21 @@ static PyObject *Euler_richcmpr(PyObject *a, PyObject *b, int op)
}
switch (op) {
- case Py_NE:
- ok = !ok; /* pass through */
- case Py_EQ:
- res = ok ? Py_False : Py_True;
- break;
-
- case Py_LT:
- case Py_LE:
- case Py_GT:
- case Py_GE:
- res = Py_NotImplemented;
- break;
- default:
- PyErr_BadArgument();
- return NULL;
+ case Py_NE:
+ ok = !ok; /* pass through */
+ case Py_EQ:
+ res = ok ? Py_False : Py_True;
+ break;
+
+ case Py_LT:
+ case Py_LE:
+ case Py_GT:
+ case Py_GE:
+ res = Py_NotImplemented;
+ break;
+ default:
+ PyErr_BadArgument();
+ return NULL;
}
return Py_INCREF(res), res;
@@ -550,16 +556,16 @@ static int Euler_ass_subscript(EulerObject *self, PyObject *item, PyObject *valu
//-----------------PROTCOL DECLARATIONS--------------------------
static PySequenceMethods Euler_SeqMethods = {
- (lenfunc) Euler_len, /* sq_length */
- (binaryfunc) NULL, /* sq_concat */
- (ssizeargfunc) NULL, /* sq_repeat */
- (ssizeargfunc) Euler_item, /* sq_item */
- (ssizessizeargfunc) NULL, /* sq_slice, deprecated */
- (ssizeobjargproc) Euler_ass_item, /* sq_ass_item */
- (ssizessizeobjargproc) NULL, /* sq_ass_slice, deprecated */
- (objobjproc) NULL, /* sq_contains */
- (binaryfunc) NULL, /* sq_inplace_concat */
- (ssizeargfunc) NULL, /* sq_inplace_repeat */
+ (lenfunc) Euler_len, /* sq_length */
+ (binaryfunc) NULL, /* sq_concat */
+ (ssizeargfunc) NULL, /* sq_repeat */
+ (ssizeargfunc) Euler_item, /* sq_item */
+ (ssizessizeargfunc) NULL, /* sq_slice, deprecated */
+ (ssizeobjargproc) Euler_ass_item, /* sq_ass_item */
+ (ssizessizeobjargproc) NULL, /* sq_ass_slice, deprecated */
+ (objobjproc) NULL, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
};
static PyMappingMethods Euler_AsMapping = {
@@ -632,8 +638,9 @@ static struct PyMethodDef Euler_methods[] = {
{"rotate_axis", (PyCFunction) Euler_rotate_axis, METH_VARARGS, Euler_rotate_axis_doc},
{"rotate", (PyCFunction) Euler_rotate, METH_O, Euler_rotate_doc},
{"make_compatible", (PyCFunction) Euler_make_compatible, METH_O, Euler_make_compatible_doc},
- {"__copy__", (PyCFunction) Euler_copy, METH_NOARGS, Euler_copy_doc},
{"copy", (PyCFunction) Euler_copy, METH_NOARGS, Euler_copy_doc},
+ {"__copy__", (PyCFunction) Euler_copy, METH_NOARGS, Euler_copy_doc},
+ {"__deepcopy__", (PyCFunction) Euler_deepcopy, METH_VARARGS, Euler_copy_doc},
{NULL, NULL, 0, NULL}
};
@@ -643,64 +650,64 @@ PyDoc_STRVAR(euler_doc,
);
PyTypeObject euler_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
- "mathutils.Euler", //tp_name
- sizeof(EulerObject), //tp_basicsize
- 0, //tp_itemsize
- (destructor)BaseMathObject_dealloc, //tp_dealloc
- NULL, //tp_print
- NULL, //tp_getattr
- NULL, //tp_setattr
- NULL, //tp_compare
- (reprfunc) Euler_repr, //tp_repr
- NULL, //tp_as_number
- &Euler_SeqMethods, //tp_as_sequence
- &Euler_AsMapping, //tp_as_mapping
- NULL, //tp_hash
- NULL, //tp_call
- (reprfunc) Euler_str, //tp_str
- NULL, //tp_getattro
- NULL, //tp_setattro
- NULL, //tp_as_buffer
+ "mathutils.Euler", //tp_name
+ sizeof(EulerObject), //tp_basicsize
+ 0, //tp_itemsize
+ (destructor)BaseMathObject_dealloc, //tp_dealloc
+ NULL, //tp_print
+ NULL, //tp_getattr
+ NULL, //tp_setattr
+ NULL, //tp_compare
+ (reprfunc) Euler_repr, //tp_repr
+ NULL, //tp_as_number
+ &Euler_SeqMethods, //tp_as_sequence
+ &Euler_AsMapping, //tp_as_mapping
+ NULL, //tp_hash
+ NULL, //tp_call
+ (reprfunc) Euler_str, //tp_str
+ NULL, //tp_getattro
+ NULL, //tp_setattro
+ NULL, //tp_as_buffer
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, //tp_flags
euler_doc, //tp_doc
- (traverseproc)BaseMathObject_traverse, //tp_traverse
- (inquiry)BaseMathObject_clear, //tp_clear
- (richcmpfunc)Euler_richcmpr, //tp_richcompare
- 0, //tp_weaklistoffset
- NULL, //tp_iter
- NULL, //tp_iternext
- Euler_methods, //tp_methods
- NULL, //tp_members
- Euler_getseters, //tp_getset
- NULL, //tp_base
- NULL, //tp_dict
- NULL, //tp_descr_get
- NULL, //tp_descr_set
- 0, //tp_dictoffset
- NULL, //tp_init
- NULL, //tp_alloc
- Euler_new, //tp_new
- NULL, //tp_free
- NULL, //tp_is_gc
- NULL, //tp_bases
- NULL, //tp_mro
- NULL, //tp_cache
- NULL, //tp_subclasses
- NULL, //tp_weaklist
- NULL //tp_del
+ (traverseproc)BaseMathObject_traverse, //tp_traverse
+ (inquiry)BaseMathObject_clear, //tp_clear
+ (richcmpfunc)Euler_richcmpr, //tp_richcompare
+ 0, //tp_weaklistoffset
+ NULL, //tp_iter
+ NULL, //tp_iternext
+ Euler_methods, //tp_methods
+ NULL, //tp_members
+ Euler_getseters, //tp_getset
+ NULL, //tp_base
+ NULL, //tp_dict
+ NULL, //tp_descr_get
+ NULL, //tp_descr_set
+ 0, //tp_dictoffset
+ NULL, //tp_init
+ NULL, //tp_alloc
+ Euler_new, //tp_new
+ NULL, //tp_free
+ NULL, //tp_is_gc
+ NULL, //tp_bases
+ NULL, //tp_mro
+ NULL, //tp_cache
+ NULL, //tp_subclasses
+ NULL, //tp_weaklist
+ NULL //tp_del
};
//------------------------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;
- self = base_type ? (EulerObject *)base_type->tp_alloc(base_type, 0) :
- (EulerObject *)PyObject_GC_New(EulerObject, &euler_Type);
+ self = base_type ? (EulerObject *)base_type->tp_alloc(base_type, 0) :
+ (EulerObject *)PyObject_GC_New(EulerObject, &euler_Type);
if (self) {
/* init callbacks as NULL */
@@ -732,14 +739,15 @@ PyObject *Euler_CreatePyObject(float *eul, short order, int type, PyTypeObject *
return (PyObject *)self;
}
-PyObject *Euler_CreatePyObject_cb(PyObject *cb_user, short order, int cb_type, int cb_subtype)
+PyObject *Euler_CreatePyObject_cb(PyObject *cb_user, short order,
+ unsigned char cb_type, unsigned char cb_subtype)
{
EulerObject *self = (EulerObject *)Euler_CreatePyObject(NULL, order, Py_NEW, NULL);
if (self) {
Py_INCREF(cb_user);
- self->cb_user = cb_user;
- self->cb_type = (unsigned char)cb_type;
- self->cb_subtype = (unsigned char)cb_subtype;
+ self->cb_user = cb_user;
+ self->cb_type = cb_type;
+ self->cb_subtype = cb_subtype;
PyObject_GC_Track(self);
}
diff --git a/source/blender/python/mathutils/mathutils_Euler.h b/source/blender/python/mathutils/mathutils_Euler.h
index 3656aa14461..56199f4a546 100644
--- a/source/blender/python/mathutils/mathutils_Euler.h
+++ b/source/blender/python/mathutils/mathutils_Euler.h
@@ -44,14 +44,15 @@ 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);
-PyObject *Euler_CreatePyObject_cb(PyObject *cb_user, short order, int cb_type, int cb_subtype);
+PyObject *Euler_CreatePyObject(float *eul, short order, int type, PyTypeObject *base_type);
+PyObject *Euler_CreatePyObject_cb(PyObject *cb_user, short order,
+ unsigned char cb_type, unsigned char cb_subtype);
short euler_order_from_string(const char *str, const char *error_prefix);
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index d4f07def6d1..bd37b645cbb 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -44,6 +44,7 @@ typedef enum eMatrixAccess_t {
} eMatrixAccess_t;
static PyObject *Matrix_copy(MatrixObject *self);
+static PyObject *Matrix_deepcopy(MatrixObject *self, PyObject *args);
static int Matrix_ass_slice(MatrixObject *self, int begin, int end, PyObject *value);
static PyObject *matrix__apply_to_copy(PyNoArgsFunction matrix_func, MatrixObject *self);
static PyObject *MatrixAccess_CreatePyObject(MatrixObject *matrix, const eMatrixAccess_t type);
@@ -78,7 +79,7 @@ static int matrix_col_vector_check(MatrixObject *mat, VectorObject *vec, int col
* matrix row callbacks
* this is so you can do matrix[i][j] = val OR matrix.row[i][j] = val */
-int mathutils_matrix_row_cb_index = -1;
+unsigned char mathutils_matrix_row_cb_index = -1;
static int mathutils_matrix_row_check(BaseMathObject *bmo)
{
@@ -162,7 +163,7 @@ Mathutils_Callback mathutils_matrix_row_cb = {
* matrix row callbacks
* this is so you can do matrix.col[i][j] = val */
-int mathutils_matrix_col_cb_index = -1;
+unsigned char mathutils_matrix_col_cb_index = -1;
static int mathutils_matrix_col_check(BaseMathObject *bmo)
{
@@ -255,7 +256,7 @@ Mathutils_Callback mathutils_matrix_col_cb = {
* this is so you can do matrix.translation = val
* note, this is _exactly like matrix.col except the 4th component is always omitted */
-int mathutils_matrix_translation_cb_index = -1;
+unsigned char mathutils_matrix_translation_cb_index = -1;
static int mathutils_matrix_translation_check(BaseMathObject *bmo)
{
@@ -431,8 +432,8 @@ static PyObject *C_Matrix_Identity(PyObject *cls, PyObject *args)
if (matSize < 2 || matSize > 4) {
PyErr_SetString(PyExc_RuntimeError,
- "Matrix.Identity(): "
- "size must be between 2 and 4");
+ "Matrix.Identity(): "
+ "size must be between 2 and 4");
return NULL;
}
@@ -461,9 +462,9 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
int matSize;
double angle; /* use double because of precision problems at high values */
float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f};
+ 0.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f};
if (!PyArg_ParseTuple(args, "di|O:Matrix.Rotation", &angle, &matSize, &vec)) {
return NULL;
@@ -549,7 +550,7 @@ PyDoc_STRVAR(C_Matrix_Translation_doc,
);
static PyObject *C_Matrix_Translation(PyObject *cls, PyObject *value)
{
- float mat[4][4]= MAT4_UNITY;
+ float mat[4][4] = MAT4_UNITY;
if (mathutils_array_parse(mat[3], 3, 4, value, "mathutils.Matrix.Translation(vector), invalid vector arg") == -1)
return NULL;
@@ -601,7 +602,7 @@ static PyObject *C_Matrix_Scale(PyObject *cls, PyObject *args)
return NULL;
}
}
- if (vec == NULL) { //scaling along axis
+ if (vec == NULL) { //scaling along axis
if (matSize == 2) {
mat[0] = factor;
mat[3] = factor;
@@ -612,8 +613,9 @@ static PyObject *C_Matrix_Scale(PyObject *cls, PyObject *args)
mat[8] = factor;
}
}
- else { //scaling in arbitrary direction
- //normalize arbitrary axis
+ else {
+ /* scaling in arbitrary direction
+ * normalize arbitrary axis */
float norm = 0.0f;
int x;
for (x = 0; x < vec_size; x++) {
@@ -624,21 +626,21 @@ static PyObject *C_Matrix_Scale(PyObject *cls, PyObject *args)
tvec[x] /= norm;
}
if (matSize == 2) {
- mat[0] = 1 + ((factor - 1) *(tvec[0] * tvec[0]));
- mat[1] = ((factor - 1) *(tvec[0] * tvec[1]));
- mat[2] = ((factor - 1) *(tvec[0] * tvec[1]));
- mat[3] = 1 + ((factor - 1) *(tvec[1] * tvec[1]));
+ mat[0] = 1 + ((factor - 1) * (tvec[0] * tvec[0]));
+ mat[1] = ((factor - 1) * (tvec[0] * tvec[1]));
+ mat[2] = ((factor - 1) * (tvec[0] * tvec[1]));
+ mat[3] = 1 + ((factor - 1) * (tvec[1] * tvec[1]));
}
else {
- mat[0] = 1 + ((factor - 1) *(tvec[0] * tvec[0]));
- mat[1] = ((factor - 1) *(tvec[0] * tvec[1]));
- mat[2] = ((factor - 1) *(tvec[0] * tvec[2]));
- mat[3] = ((factor - 1) *(tvec[0] * tvec[1]));
- mat[4] = 1 + ((factor - 1) *(tvec[1] * tvec[1]));
- mat[5] = ((factor - 1) *(tvec[1] * tvec[2]));
- mat[6] = ((factor - 1) *(tvec[0] * tvec[2]));
- mat[7] = ((factor - 1) *(tvec[1] * tvec[2]));
- mat[8] = 1 + ((factor - 1) *(tvec[2] * tvec[2]));
+ mat[0] = 1 + ((factor - 1) * (tvec[0] * tvec[0]));
+ mat[1] = ((factor - 1) * (tvec[0] * tvec[1]));
+ mat[2] = ((factor - 1) * (tvec[0] * tvec[2]));
+ mat[3] = ((factor - 1) * (tvec[0] * tvec[1]));
+ mat[4] = 1 + ((factor - 1) * (tvec[1] * tvec[1]));
+ mat[5] = ((factor - 1) * (tvec[1] * tvec[2]));
+ mat[6] = ((factor - 1) * (tvec[0] * tvec[2]));
+ mat[7] = ((factor - 1) * (tvec[1] * tvec[2]));
+ mat[8] = 1 + ((factor - 1) * (tvec[2] * tvec[2]));
}
}
if (matSize == 4) {
@@ -684,7 +686,7 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args)
return NULL;
}
- if (PyUnicode_Check(axis)) { //ortho projection onto cardinal plane
+ if (PyUnicode_Check(axis)) { //ortho projection onto cardinal plane
Py_ssize_t plane_len;
const char *plane = _PyUnicode_AsStringAndSize(axis, &plane_len);
if (matSize == 2) {
@@ -780,7 +782,7 @@ PyDoc_STRVAR(C_Matrix_Shear_doc,
" :arg size: The size of the shear matrix to construct [2, 4].\n"
" :type size: int\n"
" :arg factor: The factor of shear to apply. For a 3 or 4 *size* matrix\n"
-" pass a pair of floats corrasponding with the *plane* axis.\n"
+" pass a pair of floats corresponding with the *plane* axis.\n"
" :type factor: float or float pair\n"
" :return: A new shear matrix.\n"
" :rtype: :class:`Matrix`\n"
@@ -971,10 +973,10 @@ static PyObject *Matrix_to_euler(MatrixObject *self, PyObject *args)
}
/*must be 3-4 cols, 3-4 rows, square matrix */
- if (self->num_row ==3 && self->num_col ==3) {
+ if (self->num_row == 3 && self->num_col == 3) {
mat = (float (*)[3])self->matrix;
}
- else if (self->num_row ==4 && self->num_col ==4) {
+ else if (self->num_row == 4 && self->num_col == 4) {
copy_m3_m4(tmat, (float (*)[4])self->matrix);
mat = tmat;
}
@@ -993,12 +995,12 @@ static PyObject *Matrix_to_euler(MatrixObject *self, PyObject *args)
}
if (eul_compat) {
- if (order == 1) mat3_to_compatible_eul(eul, eul_compatf, mat);
- else mat3_to_compatible_eulO(eul, eul_compatf, order, mat);
+ if (order == 1) mat3_to_compatible_eul(eul, eul_compatf, mat);
+ else mat3_to_compatible_eulO(eul, eul_compatf, order, mat);
}
else {
- if (order == 1) mat3_to_eul(eul, mat);
- else mat3_to_eulO(eul, order, mat);
+ if (order == 1) mat3_to_eul(eul, mat);
+ else mat3_to_eulO(eul, order, mat);
}
return Euler_CreatePyObject(eul, order, Py_NEW, NULL);
@@ -1202,10 +1204,10 @@ static PyObject *Matrix_invert(MatrixObject *self)
mat[3] = MATRIX_ITEM(self, 0, 0);
}
else if (self->num_col == 3) {
- adjoint_m3_m3((float (*)[3]) mat,(float (*)[3])self->matrix);
+ adjoint_m3_m3((float (*)[3])mat, (float (*)[3])self->matrix);
}
else if (self->num_col == 4) {
- adjoint_m4_m4((float (*)[4]) mat, (float (*)[4])self->matrix);
+ adjoint_m4_m4((float (*)[4])mat, (float (*)[4])self->matrix);
}
/* divide by determinate */
for (x = 0; x < (self->num_col * self->num_row); x++) {
@@ -1218,8 +1220,6 @@ static PyObject *Matrix_invert(MatrixObject *self)
z++;
}
}
- /*transpose
- Matrix_transpose(self);*/
}
else {
PyErr_SetString(PyExc_ValueError,
@@ -1520,6 +1520,12 @@ static PyObject *Matrix_copy(MatrixObject *self)
return Matrix_CreatePyObject((float (*))self->matrix, self->num_col, self->num_row, Py_NEW, Py_TYPE(self));
}
+static PyObject *Matrix_deepcopy(MatrixObject *self, PyObject *args)
+{
+ if (!mathutils_deepcopy_args_check(args))
+ return NULL;
+ return Matrix_copy(self);
+}
/*----------------------------print object (internal)-------------*/
/* print the object to screen */
@@ -1538,17 +1544,17 @@ static PyObject *Matrix_repr(MatrixObject *self)
}
}
switch (self->num_row) {
- case 2: return PyUnicode_FromFormat("Matrix((%R,\n"
- " %R))", rows[0], rows[1]);
+ case 2: return PyUnicode_FromFormat("Matrix((%R,\n"
+ " %R))", rows[0], rows[1]);
- case 3: return PyUnicode_FromFormat("Matrix((%R,\n"
- " %R,\n"
- " %R))", rows[0], rows[1], rows[2]);
+ case 3: return PyUnicode_FromFormat("Matrix((%R,\n"
+ " %R,\n"
+ " %R))", rows[0], rows[1], rows[2]);
- case 4: return PyUnicode_FromFormat("Matrix((%R,\n"
- " %R,\n"
- " %R,\n"
- " %R))", rows[0], rows[1], rows[2], rows[3]);
+ case 4: return PyUnicode_FromFormat("Matrix((%R,\n"
+ " %R,\n"
+ " %R,\n"
+ " %R))", rows[0], rows[1], rows[2], rows[3]);
}
Py_FatalError("Matrix(): invalid row size!");
@@ -1603,43 +1609,43 @@ static PyObject *Matrix_richcmpr(PyObject *a, PyObject *b, int op)
if (BaseMath_ReadCallback(matA) == -1 || BaseMath_ReadCallback(matB) == -1)
return NULL;
- ok = ( (matA->num_row == matB->num_row) &&
- (matA->num_col == matB->num_col) &&
- EXPP_VectorsAreEqual(matA->matrix, matB->matrix, (matA->num_col * matA->num_row), 1)
- ) ? 0 : -1;
+ ok = ((matA->num_row == matB->num_row) &&
+ (matA->num_col == matB->num_col) &&
+ EXPP_VectorsAreEqual(matA->matrix, matB->matrix, (matA->num_col * matA->num_row), 1)
+ ) ? 0 : -1;
}
switch (op) {
- case Py_NE:
- ok = !ok; /* pass through */
- case Py_EQ:
- res = ok ? Py_False : Py_True;
- break;
-
- case Py_LT:
- case Py_LE:
- case Py_GT:
- case Py_GE:
- res = Py_NotImplemented;
- break;
- default:
- PyErr_BadArgument();
- return NULL;
+ case Py_NE:
+ ok = !ok; /* pass through */
+ case Py_EQ:
+ res = ok ? Py_False : Py_True;
+ break;
+
+ case Py_LT:
+ case Py_LE:
+ case Py_GT:
+ case Py_GE:
+ res = Py_NotImplemented;
+ break;
+ default:
+ PyErr_BadArgument();
+ return NULL;
}
return Py_INCREF(res), res;
}
/*---------------------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 +1675,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 +1730,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)
{
@@ -1741,14 +1747,13 @@ static PyObject *Matrix_slice(MatrixObject *self, int begin, int end)
tuple = PyTuple_New(end - begin);
for (count = begin; count < end; count++) {
PyTuple_SET_ITEM(tuple, count - begin,
- Vector_CreatePyObject_cb((PyObject *)self, self->num_col, mathutils_matrix_row_cb_index, count));
-
+ Vector_CreatePyObject_cb((PyObject *)self, self->num_col, mathutils_matrix_row_cb_index, count));
}
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 +1812,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 +1844,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];
@@ -1852,8 +1857,7 @@ static PyObject *Matrix_sub(PyObject *m1, PyObject *m2)
PyErr_Format(PyExc_TypeError,
"Matrix subtraction: (%s - %s) "
"invalid type for this operation",
- Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name
- );
+ Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
return NULL;
}
@@ -1872,7 +1876,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];
@@ -1909,8 +1913,8 @@ static PyObject *Matrix_mul(PyObject *m1, PyObject *m2)
if (mat1->num_col != mat2->num_row) {
PyErr_SetString(PyExc_ValueError,
- "matrix1 * matrix2: matrix1 number of columns "
- "and the matrix2 number of rows must be the same");
+ "matrix1 * matrix2: matrix1 number of columns "
+ "and the matrix2 number of rows must be the same");
return NULL;
}
@@ -1970,16 +1974,16 @@ static PyObject *Matrix_mul(PyObject *m1, PyObject *m2)
/*-----------------PROTOCOL DECLARATIONS--------------------------*/
static PySequenceMethods Matrix_SeqMethods = {
- (lenfunc) Matrix_len, /* sq_length */
- (binaryfunc) NULL, /* sq_concat */
- (ssizeargfunc) NULL, /* sq_repeat */
- (ssizeargfunc) Matrix_item_row, /* sq_item */
- (ssizessizeargfunc) NULL, /* sq_slice, deprecated */
- (ssizeobjargproc) Matrix_ass_item_row, /* sq_ass_item */
- (ssizessizeobjargproc) NULL, /* sq_ass_slice, deprecated */
- (objobjproc) NULL, /* sq_contains */
- (binaryfunc) NULL, /* sq_inplace_concat */
- (ssizeargfunc) NULL, /* sq_inplace_repeat */
+ (lenfunc) Matrix_len, /* sq_length */
+ (binaryfunc) NULL, /* sq_concat */
+ (ssizeargfunc) NULL, /* sq_repeat */
+ (ssizeargfunc) Matrix_item_row, /* sq_item */
+ (ssizessizeargfunc) NULL, /* sq_slice, deprecated */
+ (ssizeobjargproc) Matrix_ass_item_row, /* sq_ass_item */
+ (ssizessizeobjargproc) NULL, /* sq_ass_slice, deprecated */
+ (objobjproc) NULL, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
};
@@ -2060,40 +2064,40 @@ static PyMappingMethods Matrix_AsMapping = {
static PyNumberMethods Matrix_NumMethods = {
- (binaryfunc) Matrix_add, /*nb_add*/
- (binaryfunc) Matrix_sub, /*nb_subtract*/
- (binaryfunc) Matrix_mul, /*nb_multiply*/
- NULL, /*nb_remainder*/
- NULL, /*nb_divmod*/
- NULL, /*nb_power*/
- (unaryfunc) 0, /*nb_negative*/
- (unaryfunc) 0, /*tp_positive*/
- (unaryfunc) 0, /*tp_absolute*/
- (inquiry) 0, /*tp_bool*/
- (unaryfunc) Matrix_inverted, /*nb_invert*/
- NULL, /*nb_lshift*/
- (binaryfunc)0, /*nb_rshift*/
- NULL, /*nb_and*/
- NULL, /*nb_xor*/
- NULL, /*nb_or*/
- NULL, /*nb_int*/
- NULL, /*nb_reserved*/
- NULL, /*nb_float*/
- NULL, /* nb_inplace_add */
- NULL, /* nb_inplace_subtract */
- NULL, /* nb_inplace_multiply */
- NULL, /* nb_inplace_remainder */
- NULL, /* nb_inplace_power */
- NULL, /* nb_inplace_lshift */
- NULL, /* nb_inplace_rshift */
- NULL, /* nb_inplace_and */
- NULL, /* nb_inplace_xor */
- NULL, /* nb_inplace_or */
- NULL, /* nb_floor_divide */
- NULL, /* nb_true_divide */
- NULL, /* nb_inplace_floor_divide */
- NULL, /* nb_inplace_true_divide */
- NULL, /* nb_index */
+ (binaryfunc) Matrix_add, /*nb_add*/
+ (binaryfunc) Matrix_sub, /*nb_subtract*/
+ (binaryfunc) Matrix_mul, /*nb_multiply*/
+ NULL, /*nb_remainder*/
+ NULL, /*nb_divmod*/
+ NULL, /*nb_power*/
+ (unaryfunc) 0, /*nb_negative*/
+ (unaryfunc) 0, /*tp_positive*/
+ (unaryfunc) 0, /*tp_absolute*/
+ (inquiry) 0, /*tp_bool*/
+ (unaryfunc) Matrix_inverted, /*nb_invert*/
+ NULL, /*nb_lshift*/
+ (binaryfunc)0, /*nb_rshift*/
+ NULL, /*nb_and*/
+ NULL, /*nb_xor*/
+ NULL, /*nb_or*/
+ NULL, /*nb_int*/
+ NULL, /*nb_reserved*/
+ NULL, /*nb_float*/
+ NULL, /* nb_inplace_add */
+ NULL, /* nb_inplace_subtract */
+ NULL, /* nb_inplace_multiply */
+ NULL, /* nb_inplace_remainder */
+ NULL, /* nb_inplace_power */
+ NULL, /* nb_inplace_lshift */
+ NULL, /* nb_inplace_rshift */
+ NULL, /* nb_inplace_and */
+ NULL, /* nb_inplace_xor */
+ NULL, /* nb_inplace_or */
+ NULL, /* nb_floor_divide */
+ NULL, /* nb_true_divide */
+ NULL, /* nb_inplace_floor_divide */
+ NULL, /* nb_inplace_true_divide */
+ NULL, /* nb_index */
};
PyDoc_STRVAR(Matrix_translation_doc,
@@ -2215,12 +2219,33 @@ static PyObject *Matrix_is_orthogonal_get(MatrixObject *self, void *UNUSED(closu
/*must be 3-4 cols, 3-4 rows, square matrix*/
if (self->num_row == 4 && self->num_col == 4)
+ return PyBool_FromLong(is_orthonormal_m4((float (*)[4])self->matrix));
+ else if (self->num_row == 3 && self->num_col == 3)
+ return PyBool_FromLong(is_orthonormal_m3((float (*)[3])self->matrix));
+ else {
+ PyErr_SetString(PyExc_AttributeError,
+ "Matrix.is_orthogonal: "
+ "inappropriate matrix size - expects 3x3 or 4x4 matrix");
+ return NULL;
+ }
+}
+
+PyDoc_STRVAR(Matrix_is_orthogonal_axis_vectors_doc,
+"True if this matrix has got orthogonal axis vectors, 3x3 and 4x4 only, (read-only).\n\n:type: bool"
+);
+static PyObject *Matrix_is_orthogonal_axis_vectors_get(MatrixObject *self, void *UNUSED(closure))
+{
+ if (BaseMath_ReadCallback(self) == -1)
+ return NULL;
+
+ /*must be 3-4 cols, 3-4 rows, square matrix*/
+ if (self->num_row == 4 && self->num_col == 4)
return PyBool_FromLong(is_orthogonal_m4((float (*)[4])self->matrix));
else if (self->num_row == 3 && self->num_col == 3)
return PyBool_FromLong(is_orthogonal_m3((float (*)[3])self->matrix));
else {
PyErr_SetString(PyExc_AttributeError,
- "Matrix.is_orthogonal: "
+ "Matrix.is_orthogonal_axis_vectors: "
"inappropriate matrix size - expects 3x3 or 4x4 matrix");
return NULL;
}
@@ -2236,8 +2261,9 @@ static PyGetSetDef Matrix_getseters[] = {
{(char *)"col", (getter)Matrix_col_get, (setter)NULL, Matrix_col_doc, NULL},
{(char *)"is_negative", (getter)Matrix_is_negative_get, (setter)NULL, Matrix_is_negative_doc, NULL},
{(char *)"is_orthogonal", (getter)Matrix_is_orthogonal_get, (setter)NULL, Matrix_is_orthogonal_doc, NULL},
+ {(char *)"is_orthogonal_axis_vectors", (getter)Matrix_is_orthogonal_axis_vectors_get, (setter)NULL, Matrix_is_orthogonal_axis_vectors_doc, NULL},
{(char *)"is_wrapped", (getter)BaseMathObject_is_wrapped_get, (setter)NULL, BaseMathObject_is_wrapped_doc, NULL},
- {(char *)"owner",(getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL},
+ {(char *)"owner", (getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL},
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
@@ -2272,6 +2298,7 @@ static struct PyMethodDef Matrix_methods[] = {
{"lerp", (PyCFunction) Matrix_lerp, METH_VARARGS, Matrix_lerp_doc},
{"copy", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc},
{"__copy__", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc},
+ {"__deepcopy__", (PyCFunction) Matrix_deepcopy, METH_VARARGS, Matrix_copy_doc},
/* class methods */
{"Identity", (PyCFunction) C_Matrix_Identity, METH_VARARGS | METH_CLASS, C_Matrix_Identity_doc},
@@ -2289,51 +2316,51 @@ PyDoc_STRVAR(matrix_doc,
);
PyTypeObject matrix_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
- "mathutils.Matrix", /*tp_name*/
- sizeof(MatrixObject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- (destructor)BaseMathObject_dealloc, /*tp_dealloc*/
- NULL, /*tp_print*/
- NULL, /*tp_getattr*/
- NULL, /*tp_setattr*/
- NULL, /*tp_compare*/
- (reprfunc) Matrix_repr, /*tp_repr*/
- &Matrix_NumMethods, /*tp_as_number*/
- &Matrix_SeqMethods, /*tp_as_sequence*/
- &Matrix_AsMapping, /*tp_as_mapping*/
- NULL, /*tp_hash*/
- NULL, /*tp_call*/
- (reprfunc) Matrix_str, /*tp_str*/
- NULL, /*tp_getattro*/
- NULL, /*tp_setattro*/
- NULL, /*tp_as_buffer*/
+ "mathutils.Matrix", /*tp_name*/
+ sizeof(MatrixObject), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ (destructor)BaseMathObject_dealloc, /*tp_dealloc*/
+ NULL, /*tp_print*/
+ NULL, /*tp_getattr*/
+ NULL, /*tp_setattr*/
+ NULL, /*tp_compare*/
+ (reprfunc) Matrix_repr, /*tp_repr*/
+ &Matrix_NumMethods, /*tp_as_number*/
+ &Matrix_SeqMethods, /*tp_as_sequence*/
+ &Matrix_AsMapping, /*tp_as_mapping*/
+ NULL, /*tp_hash*/
+ NULL, /*tp_call*/
+ (reprfunc) Matrix_str, /*tp_str*/
+ NULL, /*tp_getattro*/
+ NULL, /*tp_setattro*/
+ NULL, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- matrix_doc, /*tp_doc*/
- (traverseproc)BaseMathObject_traverse, //tp_traverse
- (inquiry)BaseMathObject_clear, //tp_clear
- (richcmpfunc)Matrix_richcmpr, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- NULL, /*tp_iter*/
- NULL, /*tp_iternext*/
- Matrix_methods, /*tp_methods*/
- NULL, /*tp_members*/
- Matrix_getseters, /*tp_getset*/
- NULL, /*tp_base*/
- NULL, /*tp_dict*/
- NULL, /*tp_descr_get*/
- NULL, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- NULL, /*tp_init*/
- NULL, /*tp_alloc*/
- Matrix_new, /*tp_new*/
- NULL, /*tp_free*/
- NULL, /*tp_is_gc*/
- NULL, /*tp_bases*/
- NULL, /*tp_mro*/
- NULL, /*tp_cache*/
- NULL, /*tp_subclasses*/
- NULL, /*tp_weaklist*/
- NULL /*tp_del*/
+ matrix_doc, /*tp_doc*/
+ (traverseproc)BaseMathObject_traverse, //tp_traverse
+ (inquiry)BaseMathObject_clear, //tp_clear
+ (richcmpfunc)Matrix_richcmpr, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ NULL, /*tp_iter*/
+ NULL, /*tp_iternext*/
+ Matrix_methods, /*tp_methods*/
+ NULL, /*tp_members*/
+ Matrix_getseters, /*tp_getset*/
+ NULL, /*tp_base*/
+ NULL, /*tp_dict*/
+ NULL, /*tp_descr_get*/
+ NULL, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ NULL, /*tp_init*/
+ NULL, /*tp_alloc*/
+ Matrix_new, /*tp_new*/
+ NULL, /*tp_free*/
+ NULL, /*tp_is_gc*/
+ NULL, /*tp_bases*/
+ NULL, /*tp_mro*/
+ NULL, /*tp_cache*/
+ NULL, /*tp_subclasses*/
+ NULL, /*tp_weaklist*/
+ NULL /*tp_del*/
};
/* pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
@@ -2378,7 +2405,7 @@ PyObject *Matrix_CreatePyObject(float *mat,
return NULL;
}
- if (mat) { /*if a float array passed*/
+ if (mat) { /*if a float array passed*/
memcpy(self->matrix, mat, num_col * num_row * sizeof(float));
}
else if (num_col == num_row) {
@@ -2402,14 +2429,14 @@ PyObject *Matrix_CreatePyObject(float *mat,
PyObject *Matrix_CreatePyObject_cb(PyObject *cb_user,
const unsigned short num_col, const unsigned short num_row,
- int cb_type, int cb_subtype)
+ unsigned char cb_type, unsigned char cb_subtype)
{
MatrixObject *self = (MatrixObject *)Matrix_CreatePyObject(NULL, num_col, num_row, Py_NEW, NULL);
if (self) {
Py_INCREF(cb_user);
- self->cb_user = cb_user;
- self->cb_type = (unsigned char)cb_type;
- self->cb_subtype = (unsigned char)cb_subtype;
+ self->cb_user = cb_user;
+ self->cb_type = cb_type;
+ self->cb_subtype = cb_subtype;
PyObject_GC_Track(self);
}
return (PyObject *) self;
@@ -2452,8 +2479,8 @@ static void MatrixAccess_dealloc(MatrixAccessObject *self)
static int MatrixAccess_len(MatrixAccessObject *self)
{
return (self->type == MAT_ACCESS_ROW) ?
- self->matrix_user->num_row :
- self->matrix_user->num_col;
+ self->matrix_user->num_row :
+ self->matrix_user->num_col;
}
static PyObject *MatrixAccess_slice(MatrixAccessObject *self, int begin, int end)
@@ -2589,30 +2616,30 @@ static PyMappingMethods MatrixAccess_AsMapping = {
PyTypeObject matrix_access_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
- "MatrixAccess", /*tp_name*/
- sizeof(MatrixAccessObject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- (destructor)MatrixAccess_dealloc, /*tp_dealloc*/
- NULL, /*tp_print*/
- NULL, /*tp_getattr*/
- NULL, /*tp_setattr*/
- NULL, /*tp_compare*/
- NULL, /*tp_repr*/
- NULL, /*tp_as_number*/
- NULL /*&MatrixAccess_SeqMethods*/ /* TODO */, /*tp_as_sequence*/
- &MatrixAccess_AsMapping, /*tp_as_mapping*/
- NULL, /*tp_hash*/
- NULL, /*tp_call*/
- NULL, /*tp_str*/
- NULL, /*tp_getattro*/
- NULL, /*tp_setattro*/
- NULL, /*tp_as_buffer*/
+ "MatrixAccess", /*tp_name*/
+ sizeof(MatrixAccessObject), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ (destructor)MatrixAccess_dealloc, /*tp_dealloc*/
+ NULL, /*tp_print*/
+ NULL, /*tp_getattr*/
+ NULL, /*tp_setattr*/
+ NULL, /*tp_compare*/
+ NULL, /*tp_repr*/
+ NULL, /*tp_as_number*/
+ NULL /*&MatrixAccess_SeqMethods*/ /* TODO */, /*tp_as_sequence*/
+ &MatrixAccess_AsMapping, /*tp_as_mapping*/
+ NULL, /*tp_hash*/
+ NULL, /*tp_call*/
+ NULL, /*tp_str*/
+ NULL, /*tp_getattro*/
+ NULL, /*tp_setattro*/
+ NULL, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- NULL, /*tp_doc*/
- (traverseproc)MatrixAccess_traverse, //tp_traverse
- (inquiry)MatrixAccess_clear, //tp_clear
+ NULL, /*tp_doc*/
+ (traverseproc)MatrixAccess_traverse, //tp_traverse
+ (inquiry)MatrixAccess_clear, //tp_clear
NULL /* (richcmpfunc)MatrixAccess_richcmpr */ /* TODO*/, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
+ 0, /*tp_weaklistoffset*/
(getiterfunc)MatrixAccess_iter, /* getiterfunc tp_iter; */
};
diff --git a/source/blender/python/mathutils/mathutils_Matrix.h b/source/blender/python/mathutils/mathutils_Matrix.h
index e8719e947ec..fe9bf2ccb2a 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.h
+++ b/source/blender/python/mathutils/mathutils_Matrix.h
@@ -71,11 +71,11 @@ PyObject *Matrix_CreatePyObject(float *mat,
int type, PyTypeObject *base_type);
PyObject *Matrix_CreatePyObject_cb(PyObject *user,
const unsigned short num_col, const unsigned short num_row,
- int cb_type, int cb_subtype);
+ unsigned char cb_type, unsigned char cb_subtype);
-extern int mathutils_matrix_row_cb_index; /* default */
-extern int mathutils_matrix_col_cb_index;
-extern int mathutils_matrix_translation_cb_index;
+extern unsigned char mathutils_matrix_row_cb_index; /* default */
+extern unsigned char mathutils_matrix_col_cb_index;
+extern unsigned char mathutils_matrix_translation_cb_index;
extern struct Mathutils_Callback mathutils_matrix_row_cb; /* default */
extern struct Mathutils_Callback mathutils_matrix_col_cb;
diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c
index c5159ce0fa2..2a1cef5a241 100644
--- a/source/blender/python/mathutils/mathutils_Quaternion.c
+++ b/source/blender/python/mathutils/mathutils_Quaternion.c
@@ -42,6 +42,7 @@
static PyObject *quat__apply_to_copy(PyNoArgsFunction quat_func, QuaternionObject *self);
static void quat__axis_angle_sanitize(float axis[3], float *angle);
static PyObject *Quaternion_copy(QuaternionObject *self);
+static PyObject *Quaternion_deepcopy(QuaternionObject *self, PyObject *args);
//-----------------------------METHODS------------------------------
@@ -113,12 +114,12 @@ static PyObject *Quaternion_to_euler(QuaternionObject *self, PyObject *args)
quat_to_mat3(mat, tquat);
- if (order == EULER_ORDER_XYZ) mat3_to_compatible_eul(eul, eul_compat->eul, mat);
- else mat3_to_compatible_eulO(eul, eul_compat->eul, order, mat);
+ if (order == EULER_ORDER_XYZ) mat3_to_compatible_eul(eul, eul_compat->eul, mat);
+ else mat3_to_compatible_eulO(eul, eul_compat->eul, order, mat);
}
else {
- if (order == EULER_ORDER_XYZ) quat_to_eul(eul, tquat);
- else quat_to_eulO(eul, order, tquat);
+ if (order == EULER_ORDER_XYZ) quat_to_eul(eul, tquat);
+ else quat_to_eulO(eul, order, tquat);
}
return Euler_CreatePyObject(eul, order, Py_NEW, NULL);
@@ -478,6 +479,12 @@ static PyObject *Quaternion_copy(QuaternionObject *self)
return Quaternion_CreatePyObject(self->quat, Py_NEW, Py_TYPE(self));
}
+static PyObject *Quaternion_deepcopy(QuaternionObject *self, PyObject *args)
+{
+ if (!mathutils_deepcopy_args_check(args))
+ return NULL;
+ return Quaternion_copy(self);
+}
//----------------------------print object (internal)--------------
//print the object to screen
@@ -527,21 +534,21 @@ static PyObject *Quaternion_richcmpr(PyObject *a, PyObject *b, int op)
}
switch (op) {
- case Py_NE:
- ok = !ok; /* pass through */
- case Py_EQ:
- res = ok ? Py_False : Py_True;
- break;
-
- case Py_LT:
- case Py_LE:
- case Py_GT:
- case Py_GE:
- res = Py_NotImplemented;
- break;
- default:
- PyErr_BadArgument();
- return NULL;
+ case Py_NE:
+ ok = !ok; /* pass through */
+ case Py_EQ:
+ res = ok ? Py_False : Py_True;
+ break;
+
+ case Py_LT:
+ case Py_LE:
+ case Py_GT:
+ case Py_GE:
+ res = Py_NotImplemented;
+ break;
+ default:
+ PyErr_BadArgument();
+ return NULL;
}
return Py_INCREF(res), res;
@@ -558,7 +565,7 @@ static int Quaternion_len(QuaternionObject *UNUSED(self))
//sequence accessor (get)
static PyObject *Quaternion_item(QuaternionObject *self, int i)
{
- if (i < 0) i = QUAT_SIZE-i;
+ if (i < 0) i = QUAT_SIZE - i;
if (i < 0 || i >= QUAT_SIZE) {
PyErr_SetString(PyExc_IndexError,
@@ -585,7 +592,7 @@ static int Quaternion_ass_item(QuaternionObject *self, int i, PyObject *ob)
return -1;
}
- if (i < 0) i = QUAT_SIZE-i;
+ if (i < 0) i = QUAT_SIZE - i;
if (i < 0 || i >= QUAT_SIZE) {
PyErr_SetString(PyExc_IndexError,
@@ -741,8 +748,8 @@ static PyObject *Quaternion_add(PyObject *q1, PyObject *q2)
Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);
return NULL;
}
- quat1 = (QuaternionObject*)q1;
- quat2 = (QuaternionObject*)q2;
+ quat1 = (QuaternionObject *)q1;
+ quat2 = (QuaternionObject *)q2;
if (BaseMath_ReadCallback(quat1) == -1 || BaseMath_ReadCallback(quat2) == -1)
return NULL;
@@ -766,8 +773,8 @@ static PyObject *Quaternion_sub(PyObject *q1, PyObject *q2)
return NULL;
}
- quat1 = (QuaternionObject*)q1;
- quat2 = (QuaternionObject*)q2;
+ quat1 = (QuaternionObject *)q1;
+ quat2 = (QuaternionObject *)q2;
if (BaseMath_ReadCallback(quat1) == -1 || BaseMath_ReadCallback(quat2) == -1)
return NULL;
@@ -795,22 +802,22 @@ static PyObject *Quaternion_mul(PyObject *q1, PyObject *q2)
QuaternionObject *quat1 = NULL, *quat2 = NULL;
if (QuaternionObject_Check(q1)) {
- quat1 = (QuaternionObject*)q1;
+ quat1 = (QuaternionObject *)q1;
if (BaseMath_ReadCallback(quat1) == -1)
return NULL;
}
if (QuaternionObject_Check(q2)) {
- quat2 = (QuaternionObject*)q2;
+ quat2 = (QuaternionObject *)q2;
if (BaseMath_ReadCallback(quat2) == -1)
return NULL;
}
- if (quat1 && quat2) { /* QUAT*QUAT (cross product) */
+ if (quat1 && quat2) { /* QUAT * QUAT (cross product) */
mul_qt_qtqt(quat, quat1->quat, quat2->quat);
return Quaternion_CreatePyObject(quat, Py_NEW, Py_TYPE(q1));
}
- /* the only case this can happen (for a supported type is "FLOAT*QUAT") */
- else if (quat2) { /* FLOAT*QUAT */
+ /* the only case this can happen (for a supported type is "FLOAT * QUAT") */
+ else if (quat2) { /* FLOAT * QUAT */
if (((scalar = PyFloat_AsDouble(q1)) == -1.0f && PyErr_Occurred()) == 0) {
return quat_mul_float(quat2, scalar);
}
@@ -823,8 +830,8 @@ static PyObject *Quaternion_mul(PyObject *q1, PyObject *q2)
if (vec2->size != 3) {
PyErr_SetString(PyExc_ValueError,
- "Vector multiplication: "
- "only 3D vector rotations (with quats) "
+ "Vector multiplication: "
+ "only 3D vector rotations (with quats) "
"currently supported");
return NULL;
}
@@ -854,7 +861,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];
@@ -869,16 +876,16 @@ static PyObject *Quaternion_neg(QuaternionObject *self)
//-----------------PROTOCOL DECLARATIONS--------------------------
static PySequenceMethods Quaternion_SeqMethods = {
- (lenfunc) Quaternion_len, /* sq_length */
- (binaryfunc) NULL, /* sq_concat */
- (ssizeargfunc) NULL, /* sq_repeat */
- (ssizeargfunc) Quaternion_item, /* sq_item */
- (ssizessizeargfunc) NULL, /* sq_slice, deprecated */
- (ssizeobjargproc) Quaternion_ass_item, /* sq_ass_item */
- (ssizessizeobjargproc) NULL, /* sq_ass_slice, deprecated */
- (objobjproc) NULL, /* sq_contains */
- (binaryfunc) NULL, /* sq_inplace_concat */
- (ssizeargfunc) NULL, /* sq_inplace_repeat */
+ (lenfunc) Quaternion_len, /* sq_length */
+ (binaryfunc) NULL, /* sq_concat */
+ (ssizeargfunc) NULL, /* sq_repeat */
+ (ssizeargfunc) Quaternion_item, /* sq_item */
+ (ssizessizeargfunc) NULL, /* sq_slice, deprecated */
+ (ssizeobjargproc) Quaternion_ass_item, /* sq_ass_item */
+ (ssizessizeobjargproc) NULL, /* sq_ass_slice, deprecated */
+ (objobjproc) NULL, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
};
static PyMappingMethods Quaternion_AsMapping = {
@@ -888,40 +895,40 @@ static PyMappingMethods Quaternion_AsMapping = {
};
static PyNumberMethods Quaternion_NumMethods = {
- (binaryfunc) Quaternion_add, /*nb_add*/
- (binaryfunc) Quaternion_sub, /*nb_subtract*/
- (binaryfunc) Quaternion_mul, /*nb_multiply*/
- NULL, /*nb_remainder*/
- NULL, /*nb_divmod*/
- NULL, /*nb_power*/
- (unaryfunc) Quaternion_neg, /*nb_negative*/
- (unaryfunc) 0, /*tp_positive*/
- (unaryfunc) 0, /*tp_absolute*/
- (inquiry) 0, /*tp_bool*/
- (unaryfunc) 0, /*nb_invert*/
- NULL, /*nb_lshift*/
- (binaryfunc)0, /*nb_rshift*/
- NULL, /*nb_and*/
- NULL, /*nb_xor*/
- NULL, /*nb_or*/
- NULL, /*nb_int*/
- NULL, /*nb_reserved*/
- NULL, /*nb_float*/
- NULL, /* nb_inplace_add */
- NULL, /* nb_inplace_subtract */
- NULL, /* nb_inplace_multiply */
- NULL, /* nb_inplace_remainder */
- NULL, /* nb_inplace_power */
- NULL, /* nb_inplace_lshift */
- NULL, /* nb_inplace_rshift */
- NULL, /* nb_inplace_and */
- NULL, /* nb_inplace_xor */
- NULL, /* nb_inplace_or */
- NULL, /* nb_floor_divide */
- NULL, /* nb_true_divide */
- NULL, /* nb_inplace_floor_divide */
- NULL, /* nb_inplace_true_divide */
- NULL, /* nb_index */
+ (binaryfunc) Quaternion_add, /*nb_add*/
+ (binaryfunc) Quaternion_sub, /*nb_subtract*/
+ (binaryfunc) Quaternion_mul, /*nb_multiply*/
+ NULL, /*nb_remainder*/
+ NULL, /*nb_divmod*/
+ NULL, /*nb_power*/
+ (unaryfunc) Quaternion_neg, /*nb_negative*/
+ (unaryfunc) 0, /*tp_positive*/
+ (unaryfunc) 0, /*tp_absolute*/
+ (inquiry) 0, /*tp_bool*/
+ (unaryfunc) 0, /*nb_invert*/
+ NULL, /*nb_lshift*/
+ (binaryfunc)0, /*nb_rshift*/
+ NULL, /*nb_and*/
+ NULL, /*nb_xor*/
+ NULL, /*nb_or*/
+ NULL, /*nb_int*/
+ NULL, /*nb_reserved*/
+ NULL, /*nb_float*/
+ NULL, /* nb_inplace_add */
+ NULL, /* nb_inplace_subtract */
+ NULL, /* nb_inplace_multiply */
+ NULL, /* nb_inplace_remainder */
+ NULL, /* nb_inplace_power */
+ NULL, /* nb_inplace_lshift */
+ NULL, /* nb_inplace_rshift */
+ NULL, /* nb_inplace_and */
+ NULL, /* nb_inplace_xor */
+ NULL, /* nb_inplace_or */
+ NULL, /* nb_floor_divide */
+ NULL, /* nb_true_divide */
+ NULL, /* nb_inplace_floor_divide */
+ NULL, /* nb_inplace_true_divide */
+ NULL, /* nb_index */
};
PyDoc_STRVAR(Quaternion_axis_doc,
@@ -1070,19 +1077,19 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw
return NULL;
switch (PyTuple_GET_SIZE(args)) {
- case 0:
- break;
- case 1:
- if (mathutils_array_parse(quat, QUAT_SIZE, QUAT_SIZE, seq, "mathutils.Quaternion()") == -1)
- return NULL;
- break;
- case 2:
- if (mathutils_array_parse(quat, 3, 3, seq, "mathutils.Quaternion()") == -1)
- return NULL;
- angle = angle_wrap_rad(angle); /* clamp because of precision issues */
- axis_angle_to_quat(quat, quat, angle);
- break;
- /* PyArg_ParseTuple assures no more then 2 */
+ case 0:
+ break;
+ case 1:
+ if (mathutils_array_parse(quat, QUAT_SIZE, QUAT_SIZE, seq, "mathutils.Quaternion()") == -1)
+ return NULL;
+ break;
+ case 2:
+ if (mathutils_array_parse(quat, 3, 3, seq, "mathutils.Quaternion()") == -1)
+ return NULL;
+ angle = angle_wrap_rad(angle); /* clamp because of precision issues */
+ axis_angle_to_quat(quat, quat, angle);
+ break;
+ /* PyArg_ParseTuple assures no more then 2 */
}
return Quaternion_CreatePyObject(quat, Py_NEW, type);
}
@@ -1101,21 +1108,22 @@ static PyObject *quat__apply_to_copy(PyNoArgsFunction quat_func, QuaternionObjec
}
}
-/* axis vector suffers from precission errors, use this function to ensure */
+/* axis vector suffers from precision errors, use this function to ensure */
static void quat__axis_angle_sanitize(float axis[3], float *angle)
{
if (axis) {
- if ( !finite(axis[0]) ||
- !finite(axis[1]) ||
- !finite(axis[2]))
+ if (is_zero_v3(axis) ||
+ !finite(axis[0]) ||
+ !finite(axis[1]) ||
+ !finite(axis[2]))
{
axis[0] = 1.0f;
axis[1] = 0.0f;
axis[2] = 0.0f;
}
- else if ( EXPP_FloatsAreEqual(axis[0], 0.0f, 10) &&
- EXPP_FloatsAreEqual(axis[1], 0.0f, 10) &&
- EXPP_FloatsAreEqual(axis[2], 0.0f, 10))
+ else if (EXPP_FloatsAreEqual(axis[0], 0.0f, 10) &&
+ EXPP_FloatsAreEqual(axis[1], 0.0f, 10) &&
+ EXPP_FloatsAreEqual(axis[2], 0.0f, 10))
{
axis[0] = 1.0f;
}
@@ -1156,8 +1164,9 @@ static struct PyMethodDef Quaternion_methods[] = {
{"slerp", (PyCFunction) Quaternion_slerp, METH_VARARGS, Quaternion_slerp_doc},
{"rotate", (PyCFunction) Quaternion_rotate, METH_O, Quaternion_rotate_doc},
- {"__copy__", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc},
{"copy", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc},
+ {"__copy__", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc},
+ {"__deepcopy__", (PyCFunction) Quaternion_deepcopy, METH_VARARGS, Quaternion_copy_doc},
{NULL, NULL, 0, NULL}
};
@@ -1171,7 +1180,7 @@ static PyGetSetDef Quaternion_getseters[] = {
{(char *)"z", (getter)Quaternion_axis_get, (setter)Quaternion_axis_set, Quaternion_axis_doc, (void *)3},
{(char *)"magnitude", (getter)Quaternion_magnitude_get, (setter)NULL, Quaternion_magnitude_doc, NULL},
{(char *)"angle", (getter)Quaternion_angle_get, (setter)Quaternion_angle_set, Quaternion_angle_doc, NULL},
- {(char *)"axis",(getter)Quaternion_axis_vector_get, (setter)Quaternion_axis_vector_set, Quaternion_axis_vector_doc, NULL},
+ {(char *)"axis", (getter)Quaternion_axis_vector_get, (setter)Quaternion_axis_vector_set, Quaternion_axis_vector_doc, NULL},
{(char *)"is_wrapped", (getter)BaseMathObject_is_wrapped_get, (setter)NULL, BaseMathObject_is_wrapped_doc, NULL},
{(char *)"owner", (getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL},
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
@@ -1183,58 +1192,58 @@ PyDoc_STRVAR(quaternion_doc,
);
PyTypeObject quaternion_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
- "mathutils.Quaternion", //tp_name
- sizeof(QuaternionObject), //tp_basicsize
- 0, //tp_itemsize
- (destructor)BaseMathObject_dealloc, //tp_dealloc
- NULL, //tp_print
- NULL, //tp_getattr
- NULL, //tp_setattr
- NULL, //tp_compare
- (reprfunc) Quaternion_repr, //tp_repr
- &Quaternion_NumMethods, //tp_as_number
- &Quaternion_SeqMethods, //tp_as_sequence
- &Quaternion_AsMapping, //tp_as_mapping
- NULL, //tp_hash
- NULL, //tp_call
- (reprfunc) Quaternion_str, //tp_str
- NULL, //tp_getattro
- NULL, //tp_setattro
- NULL, //tp_as_buffer
+ "mathutils.Quaternion", //tp_name
+ sizeof(QuaternionObject), //tp_basicsize
+ 0, //tp_itemsize
+ (destructor)BaseMathObject_dealloc, //tp_dealloc
+ NULL, //tp_print
+ NULL, //tp_getattr
+ NULL, //tp_setattr
+ NULL, //tp_compare
+ (reprfunc) Quaternion_repr, //tp_repr
+ &Quaternion_NumMethods, //tp_as_number
+ &Quaternion_SeqMethods, //tp_as_sequence
+ &Quaternion_AsMapping, //tp_as_mapping
+ NULL, //tp_hash
+ NULL, //tp_call
+ (reprfunc) Quaternion_str, //tp_str
+ NULL, //tp_getattro
+ NULL, //tp_setattro
+ NULL, //tp_as_buffer
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, //tp_flags
quaternion_doc, //tp_doc
- (traverseproc)BaseMathObject_traverse, //tp_traverse
- (inquiry)BaseMathObject_clear, //tp_clear
- (richcmpfunc)Quaternion_richcmpr, //tp_richcompare
- 0, //tp_weaklistoffset
- NULL, //tp_iter
- NULL, //tp_iternext
- Quaternion_methods, //tp_methods
- NULL, //tp_members
- Quaternion_getseters, //tp_getset
- NULL, //tp_base
- NULL, //tp_dict
- NULL, //tp_descr_get
- NULL, //tp_descr_set
- 0, //tp_dictoffset
- NULL, //tp_init
- NULL, //tp_alloc
- Quaternion_new, //tp_new
- NULL, //tp_free
- NULL, //tp_is_gc
- NULL, //tp_bases
- NULL, //tp_mro
- NULL, //tp_cache
- NULL, //tp_subclasses
- NULL, //tp_weaklist
- NULL, //tp_del
+ (traverseproc)BaseMathObject_traverse, //tp_traverse
+ (inquiry)BaseMathObject_clear, //tp_clear
+ (richcmpfunc)Quaternion_richcmpr, //tp_richcompare
+ 0, //tp_weaklistoffset
+ NULL, //tp_iter
+ NULL, //tp_iternext
+ Quaternion_methods, //tp_methods
+ NULL, //tp_members
+ Quaternion_getseters, //tp_getset
+ NULL, //tp_base
+ NULL, //tp_dict
+ NULL, //tp_descr_get
+ NULL, //tp_descr_set
+ 0, //tp_dictoffset
+ NULL, //tp_init
+ NULL, //tp_alloc
+ Quaternion_new, //tp_new
+ NULL, //tp_free
+ NULL, //tp_is_gc
+ NULL, //tp_bases
+ NULL, //tp_mro
+ NULL, //tp_cache
+ NULL, //tp_subclasses
+ NULL, //tp_weaklist
+ NULL, //tp_del
};
//------------------------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;
@@ -1268,14 +1277,15 @@ PyObject *Quaternion_CreatePyObject(float *quat, int type, PyTypeObject *base_ty
return (PyObject *) self;
}
-PyObject *Quaternion_CreatePyObject_cb(PyObject *cb_user, int cb_type, int cb_subtype)
+PyObject *Quaternion_CreatePyObject_cb(PyObject *cb_user,
+ unsigned char cb_type, unsigned char cb_subtype)
{
QuaternionObject *self = (QuaternionObject *)Quaternion_CreatePyObject(NULL, Py_NEW, NULL);
if (self) {
Py_INCREF(cb_user);
- self->cb_user = cb_user;
- self->cb_type = (unsigned char)cb_type;
- self->cb_subtype = (unsigned char)cb_subtype;
+ self->cb_user = cb_user;
+ self->cb_type = cb_type;
+ self->cb_subtype = cb_subtype;
PyObject_GC_Track(self);
}
diff --git a/source/blender/python/mathutils/mathutils_Quaternion.h b/source/blender/python/mathutils/mathutils_Quaternion.h
index 8e91f26b08f..09faff192de 100644
--- a/source/blender/python/mathutils/mathutils_Quaternion.h
+++ b/source/blender/python/mathutils/mathutils_Quaternion.h
@@ -42,13 +42,14 @@ 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);
-PyObject *Quaternion_CreatePyObject_cb(PyObject *cb_user, int cb_type, int cb_subtype);
+PyObject *Quaternion_CreatePyObject(float *quat, int type, PyTypeObject *base_type);
+PyObject *Quaternion_CreatePyObject_cb(PyObject *cb_user,
+ unsigned char cb_type, unsigned char cb_subtype);
#endif /* __MATHUTILS_QUATERNION_H__ */
diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c
index 765df7afcf9..17fa9cdd802 100644
--- a/source/blender/python/mathutils/mathutils_Vector.c
+++ b/source/blender/python/mathutils/mathutils_Vector.c
@@ -40,13 +40,14 @@
#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
static PyObject *Vector_copy(VectorObject *self);
+static PyObject *Vector_deepcopy(VectorObject *self, PyObject *args);
static PyObject *Vector_to_tuple_ext(VectorObject *self, int ndigits);
static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat);
@@ -59,31 +60,31 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED
int size = 3; /* default to a 3D vector */
switch (PyTuple_GET_SIZE(args)) {
- case 0:
- vec = PyMem_Malloc(size * sizeof(float));
+ case 0:
+ vec = PyMem_Malloc(size * sizeof(float));
- if (vec == NULL) {
- PyErr_SetString(PyExc_MemoryError,
- "Vector(): "
- "problem allocating pointer space");
- return NULL;
- }
+ if (vec == NULL) {
+ PyErr_SetString(PyExc_MemoryError,
+ "Vector(): "
+ "problem allocating pointer space");
+ return NULL;
+ }
- fill_vn_fl(vec, size, 0.0f);
- break;
- case 1:
- if ((size = mathutils_array_parse_alloc(&vec, 2, PyTuple_GET_ITEM(args, 0), "mathutils.Vector()")) == -1) {
- if (vec) {
- PyMem_Free(vec);
+ fill_vn_fl(vec, size, 0.0f);
+ break;
+ case 1:
+ if ((size = mathutils_array_parse_alloc(&vec, 2, PyTuple_GET_ITEM(args, 0), "mathutils.Vector()")) == -1) {
+ if (vec) {
+ PyMem_Free(vec);
+ }
+ return NULL;
}
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError,
+ "mathutils.Vector(): "
+ "more then a single arg given");
return NULL;
- }
- break;
- default:
- PyErr_SetString(PyExc_TypeError,
- "mathutils.Vector(): "
- "more then a single arg given");
- return NULL;
}
return Vector_CreatePyObject(vec, size, Py_NEW, type);
}
@@ -133,7 +134,7 @@ static PyObject *C_Vector_Fill(PyObject *cls, PyObject *args)
if (vec == NULL) {
PyErr_SetString(PyExc_MemoryError,
- "Vector.Fill(): "
+ "Vector.Fill(): "
"problem allocating pointer space");
return NULL;
}
@@ -167,36 +168,36 @@ static PyObject *C_Vector_Range(PyObject *cls, PyObject *args)
}
switch (PyTuple_GET_SIZE(args)) {
- case 1:
- size = start;
- start = 0;
- break;
- case 2:
- if (start >= stop) {
- PyErr_SetString(PyExc_RuntimeError,
- "Start value is larger "
- "than the stop value");
- return NULL;
- }
+ case 1:
+ size = start;
+ start = 0;
+ break;
+ case 2:
+ if (start >= stop) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "Start value is larger "
+ "than the stop value");
+ return NULL;
+ }
- size = stop - start;
- break;
- default:
- if (start >= stop) {
- PyErr_SetString(PyExc_RuntimeError,
- "Start value is larger "
- "than the stop value");
- return NULL;
- }
+ size = stop - start;
+ break;
+ default:
+ if (start >= stop) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "Start value is larger "
+ "than the stop value");
+ return NULL;
+ }
- size = (stop - start);
+ size = (stop - start);
- if ((size % step) != 0)
- size += step;
+ if ((size % step) != 0)
+ size += step;
- size /= step;
+ size /= step;
- break;
+ break;
}
if (size < 2) {
@@ -247,7 +248,7 @@ static PyObject *C_Vector_Linspace(PyObject *cls, PyObject *args)
return NULL;
}
- step = (end - start)/(float)(size-1);
+ step = (end - start) / (float)(size - 1);
vec = PyMem_Malloc(size * sizeof(float));
@@ -412,7 +413,7 @@ static PyObject *Vector_resize(VectorObject *self, PyObject *value)
self->vec = PyMem_Realloc(self->vec, (size * sizeof(float)));
if (self->vec == NULL) {
PyErr_SetString(PyExc_MemoryError,
- "Vector.resize(): "
+ "Vector.resize(): "
"problem allocating pointer space");
return NULL;
}
@@ -439,8 +440,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;
}
@@ -736,19 +735,19 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
}
else if (strlen(strack) == 1) {
switch (strack[0]) {
- case '-':
- case 'X':
- track = 0;
- break;
- case 'Y':
- track = 1;
- break;
- case 'Z':
- track = 2;
- break;
- default:
- PyErr_SetString(PyExc_ValueError, axis_err_msg);
- return NULL;
+ case '-':
+ case 'X':
+ track = 0;
+ break;
+ case 'Y':
+ track = 1;
+ break;
+ case 'Z':
+ track = 2;
+ break;
+ default:
+ PyErr_SetString(PyExc_ValueError, axis_err_msg);
+ return NULL;
}
}
else {
@@ -761,18 +760,18 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
const char *axis_err_msg = "only X, Y or Z for up axis";
if (strlen(sup) == 1) {
switch (*sup) {
- case 'X':
- up = 0;
- break;
- case 'Y':
- up = 1;
- break;
- case 'Z':
- up = 2;
- break;
- default:
- PyErr_SetString(PyExc_ValueError, axis_err_msg);
- return NULL;
+ case 'X':
+ up = 0;
+ break;
+ case 'Y':
+ up = 1;
+ break;
+ case 'Z':
+ up = 2;
+ break;
+ default:
+ PyErr_SetString(PyExc_ValueError, axis_err_msg);
+ return NULL;
}
}
else {
@@ -788,9 +787,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);
@@ -833,13 +832,11 @@ static PyObject *Vector_reflect(VectorObject *self, PyObject *value)
mirror[0] = tvec[0];
mirror[1] = tvec[1];
- if (value_size > 2) mirror[2] = tvec[2];
- else mirror[2] = 0.0;
+ mirror[2] = (value_size > 2) ? tvec[2] : 0.0f;
vec[0] = self->vec[0];
vec[1] = self->vec[1];
- if (self->size > 2) vec[2] = self->vec[2];
- else vec[2] = 0.0;
+ vec[2] = (value_size > 2) ? self->vec[2] : 0.0f;
normalize_v3(mirror);
reflect_v3_v3v3(reflect, vec, mirror);
@@ -922,7 +919,7 @@ PyDoc_STRVAR(Vector_angle_doc,
" :return: angle in radians or fallback when given\n"
" :rtype: float\n"
"\n"
-" .. note:: Zero length vectors raise an :exc:`AttributeError`.\n"
+" .. note:: Zero length vectors raise an :exc:`ValueError`.\n"
);
static PyObject *Vector_angle(VectorObject *self, PyObject *args)
{
@@ -973,6 +970,62 @@ static PyObject *Vector_angle(VectorObject *self, PyObject *args)
return PyFloat_FromDouble(saacos(dot / (sqrt(dot_self) * sqrt(dot_other))));
}
+PyDoc_STRVAR(Vector_angle_signed_doc,
+".. function:: angle_signed(other, fallback)\n"
+"\n"
+" Return the signed angle between two 2D vectors (clockwise is positive).\n"
+"\n"
+" :arg other: another vector to compare the angle with\n"
+" :type other: :class:`Vector`\n"
+" :arg fallback: return this value when the angle cant be calculated\n"
+" (zero length vector)\n"
+" :type fallback: any\n"
+" :return: angle in radians or fallback when given\n"
+" :rtype: float\n"
+"\n"
+" .. note:: Zero length vectors raise an :exc:`ValueError`.\n"
+);
+static PyObject *Vector_angle_signed(VectorObject *self, PyObject *args)
+{
+ float tvec[2];
+
+ PyObject *value;
+ PyObject *fallback = NULL;
+
+ if (!PyArg_ParseTuple(args, "O|O:angle_signed", &value, &fallback))
+ return NULL;
+
+ if (BaseMath_ReadCallback(self) == -1)
+ return NULL;
+
+ if (mathutils_array_parse(tvec, 2, 2, value, "Vector.angle_signed(other), invalid 'other' arg") == -1)
+ return NULL;
+
+ if (self->size != 2) {
+ PyErr_SetString(PyExc_ValueError,
+ "Vector must be 2D");
+ return NULL;
+ }
+
+ if (is_zero_v2(self->vec) || is_zero_v2(tvec)) {
+ /* avoid exception */
+ if (fallback) {
+ Py_INCREF(fallback);
+ return fallback;
+ }
+ else {
+ PyErr_SetString(PyExc_ValueError,
+ "Vector.angle_signed(other): "
+ "zero length vectors have no valid angle");
+ return NULL;
+ }
+ }
+
+
+ return PyFloat_FromDouble(angle_signed_v2v2(self->vec, tvec));
+}
+
+
PyDoc_STRVAR(Vector_rotation_difference_doc,
".. function:: rotation_difference(other)\n"
"\n"
@@ -1159,6 +1212,12 @@ static PyObject *Vector_copy(VectorObject *self)
return Vector_CreatePyObject(self->vec, self->size, Py_NEW, Py_TYPE(self));
}
+static PyObject *Vector_deepcopy(VectorObject *self, PyObject *args)
+{
+ if (!mathutils_deepcopy_args_check(args))
+ return NULL;
+ return Vector_copy(self);
+}
static PyObject *Vector_repr(VectorObject *self)
{
@@ -1205,10 +1264,10 @@ static int Vector_len(VectorObject *self)
/* sequence accessor (get): vector[index] */
static PyObject *vector_item_internal(VectorObject *self, int i, const int is_attr)
{
- if (i < 0) i = self->size-i;
+ if (i < 0) i = self->size - i;
if (i < 0 || i >= self->size) {
- if (is_attr) {
+ if (is_attr) {
PyErr_Format(PyExc_AttributeError,
"Vector.%c: unavailable on %dd vector",
*(((char *)"xyzw") + i), self->size);
@@ -1241,7 +1300,7 @@ static int vector_ass_item_internal(VectorObject *self, int i, PyObject *value,
return -1;
}
- if (i < 0) i = self->size-i;
+ if (i < 0) i = self->size - i;
if (i < 0 || i >= self->size) {
if (is_attr) {
@@ -1309,7 +1368,7 @@ static int Vector_ass_slice(VectorObject *self, int begin, int end, PyObject *se
if (vec == NULL) {
PyErr_SetString(PyExc_MemoryError,
- "vec[:] = seq: "
+ "vec[:] = seq: "
"problem allocating pointer space");
return -1;
}
@@ -1343,8 +1402,8 @@ static PyObject *Vector_add(PyObject *v1, PyObject *v2)
Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
- vec1 = (VectorObject*)v1;
- vec2 = (VectorObject*)v2;
+ vec1 = (VectorObject *)v1;
+ vec2 = (VectorObject *)v2;
if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
return NULL;
@@ -1383,8 +1442,8 @@ static PyObject *Vector_iadd(PyObject *v1, PyObject *v2)
Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
- vec1 = (VectorObject*)v1;
- vec2 = (VectorObject*)v2;
+ vec1 = (VectorObject *)v1;
+ vec2 = (VectorObject *)v2;
if (vec1->size != vec2->size) {
PyErr_SetString(PyExc_AttributeError,
@@ -1416,8 +1475,8 @@ static PyObject *Vector_sub(PyObject *v1, PyObject *v2)
Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
- vec1 = (VectorObject*)v1;
- vec2 = (VectorObject*)v2;
+ vec1 = (VectorObject *)v1;
+ vec2 = (VectorObject *)v2;
if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1)
return NULL;
@@ -1455,8 +1514,8 @@ static PyObject *Vector_isub(PyObject *v1, PyObject *v2)
Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
- vec1 = (VectorObject*)v1;
- vec2 = (VectorObject*)v2;
+ vec1 = (VectorObject *)v1;
+ vec2 = (VectorObject *)v2;
if (vec1->size != vec2->size) {
PyErr_SetString(PyExc_AttributeError,
@@ -1476,7 +1535,7 @@ static PyObject *Vector_isub(PyObject *v1, PyObject *v2)
}
/*------------------------obj * obj------------------------------
- mulplication*/
+ * mulplication*/
/* COLUMN VECTOR Multiplication (Matrix X Vector)
@@ -1499,7 +1558,7 @@ int column_vector_multiplication(float r_vec[MAX_DIMENSIONS], VectorObject *vec,
else {
PyErr_SetString(PyExc_ValueError,
"matrix * vector: "
- "len(matrix.col) and len(vector) must be the same, "
+ "len(matrix.col) and len(vector) must be the same, "
"except for 4x4 matrix * 3D vector.");
return -1;
}
@@ -1541,12 +1600,12 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
float scalar;
int vec_size;
- if VectorObject_Check(v1) {
+ if (VectorObject_Check(v1)) {
vec1 = (VectorObject *)v1;
if (BaseMath_ReadCallback(vec1) == -1)
return NULL;
}
- if VectorObject_Check(v2) {
+ if (VectorObject_Check(v2)) {
vec2 = (VectorObject *)v2;
if (BaseMath_ReadCallback(vec2) == -1)
return NULL;
@@ -1572,7 +1631,7 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
if (BaseMath_ReadCallback((MatrixObject *)v2) == -1)
return NULL;
- if (row_vector_multiplication(tvec, vec1, (MatrixObject*)v2) == -1) {
+ if (row_vector_multiplication(tvec, vec1, (MatrixObject *)v2) == -1) {
return NULL;
}
@@ -1594,7 +1653,7 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
"order (promoted to an Error for Debug builds)");
return NULL;
#else
- QuaternionObject *quat2 = (QuaternionObject*)v2;
+ QuaternionObject *quat2 = (QuaternionObject *)v2;
float tvec[3];
if (vec1->size != 3) {
@@ -1643,21 +1702,21 @@ 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
PyErr_SetString(PyExc_ValueError,
- "(Vector *= Matrix) is now removed, reverse the "
- "order (promoted to an Error for Debug builds) "
- "and uses the non in-place multiplication.");
+ "(Vector *= Matrix) is now removed, reverse the "
+ "order (promoted to an Error for Debug builds) "
+ "and uses the non in-place multiplication.");
return NULL;
#else
float rvec[MAX_DIMENSIONS];
if (BaseMath_ReadCallback((MatrixObject *)v2) == -1)
return NULL;
- if (column_vector_multiplication(rvec, vec, (MatrixObject*)v2) == -1)
+ if (column_vector_multiplication(rvec, vec, (MatrixObject *)v2) == -1)
return NULL;
memcpy(vec->vec, rvec, sizeof(float) * vec->size);
@@ -1670,12 +1729,12 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
/* ------ to be removed ------*/
#if 1
PyErr_SetString(PyExc_ValueError,
- "(Vector *= Quat) is now removed, reverse the "
- "order (promoted to an Error for Debug builds) "
- "and uses the non in-place multiplication.");
+ "(Vector *= Quat) is now removed, reverse the "
+ "order (promoted to an Error for Debug builds) "
+ "and uses the non in-place multiplication.");
return NULL;
#else
- QuaternionObject *quat2 = (QuaternionObject*)v2;
+ QuaternionObject *quat2 = (QuaternionObject *)v2;
if (vec->size != 3) {
PyErr_SetString(PyExc_ValueError,
@@ -1757,7 +1816,7 @@ static PyObject *Vector_div(PyObject *v1, PyObject *v2)
static PyObject *Vector_idiv(PyObject *v1, PyObject *v2)
{
float scalar;
- VectorObject *vec1 = (VectorObject*)v1;
+ VectorObject *vec1 = (VectorObject *)v1;
if (BaseMath_ReadCallback(vec1) == -1)
return NULL;
@@ -1785,7 +1844,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 +1860,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;
@@ -1826,8 +1885,8 @@ static PyObject *Vector_richcmpr(PyObject *objectA, PyObject *objectB, int compa
Py_RETURN_FALSE;
}
}
- vecA = (VectorObject*)objectA;
- vecB = (VectorObject*)objectB;
+ vecA = (VectorObject *)objectA;
+ vecB = (VectorObject *)objectB;
if (BaseMath_ReadCallback(vecA) == -1 || BaseMath_ReadCallback(vecB) == -1)
return NULL;
@@ -1896,16 +1955,16 @@ static PyObject *Vector_richcmpr(PyObject *objectA, PyObject *objectB, int compa
/*-----------------PROTCOL DECLARATIONS--------------------------*/
static PySequenceMethods Vector_SeqMethods = {
- (lenfunc) Vector_len, /* sq_length */
- (binaryfunc) NULL, /* sq_concat */
- (ssizeargfunc) NULL, /* sq_repeat */
- (ssizeargfunc) Vector_item, /* sq_item */
- NULL, /* py3 deprecated slice func */
- (ssizeobjargproc) Vector_ass_item, /* sq_ass_item */
- NULL, /* py3 deprecated slice assign func */
- (objobjproc) NULL, /* sq_contains */
- (binaryfunc) NULL, /* sq_inplace_concat */
- (ssizeargfunc) NULL, /* sq_inplace_repeat */
+ (lenfunc) Vector_len, /* sq_length */
+ (binaryfunc) NULL, /* sq_concat */
+ (ssizeargfunc) NULL, /* sq_repeat */
+ (ssizeargfunc) Vector_item, /* sq_item */
+ NULL, /* py3 deprecated slice func */
+ (ssizeobjargproc) Vector_ass_item, /* sq_ass_item */
+ NULL, /* py3 deprecated slice assign func */
+ (objobjproc) NULL, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
};
static PyObject *Vector_subscript(VectorObject *self, PyObject *item)
@@ -1985,40 +2044,40 @@ static PyMappingMethods Vector_AsMapping = {
static PyNumberMethods Vector_NumMethods = {
- (binaryfunc) Vector_add, /*nb_add*/
- (binaryfunc) Vector_sub, /*nb_subtract*/
- (binaryfunc) Vector_mul, /*nb_multiply*/
- NULL, /*nb_remainder*/
- NULL, /*nb_divmod*/
- NULL, /*nb_power*/
- (unaryfunc) Vector_neg, /*nb_negative*/
- (unaryfunc) NULL, /*tp_positive*/
- (unaryfunc) NULL, /*tp_absolute*/
- (inquiry) NULL, /*tp_bool*/
- (unaryfunc) NULL, /*nb_invert*/
- NULL, /*nb_lshift*/
- (binaryfunc)NULL, /*nb_rshift*/
- NULL, /*nb_and*/
- NULL, /*nb_xor*/
- NULL, /*nb_or*/
- NULL, /*nb_int*/
- NULL, /*nb_reserved*/
- NULL, /*nb_float*/
- Vector_iadd, /* nb_inplace_add */
- Vector_isub, /* nb_inplace_subtract */
- Vector_imul, /* nb_inplace_multiply */
- NULL, /* nb_inplace_remainder */
- NULL, /* nb_inplace_power */
- NULL, /* nb_inplace_lshift */
- NULL, /* nb_inplace_rshift */
- NULL, /* nb_inplace_and */
- NULL, /* nb_inplace_xor */
- NULL, /* nb_inplace_or */
- NULL, /* nb_floor_divide */
- Vector_div, /* nb_true_divide */
- NULL, /* nb_inplace_floor_divide */
- Vector_idiv, /* nb_inplace_true_divide */
- NULL, /* nb_index */
+ (binaryfunc) Vector_add, /*nb_add*/
+ (binaryfunc) Vector_sub, /*nb_subtract*/
+ (binaryfunc) Vector_mul, /*nb_multiply*/
+ NULL, /*nb_remainder*/
+ NULL, /*nb_divmod*/
+ NULL, /*nb_power*/
+ (unaryfunc) Vector_neg, /*nb_negative*/
+ (unaryfunc) NULL, /*tp_positive*/
+ (unaryfunc) NULL, /*tp_absolute*/
+ (inquiry) NULL, /*tp_bool*/
+ (unaryfunc) NULL, /*nb_invert*/
+ NULL, /*nb_lshift*/
+ (binaryfunc)NULL, /*nb_rshift*/
+ NULL, /*nb_and*/
+ NULL, /*nb_xor*/
+ NULL, /*nb_or*/
+ NULL, /*nb_int*/
+ NULL, /*nb_reserved*/
+ NULL, /*nb_float*/
+ Vector_iadd, /* nb_inplace_add */
+ Vector_isub, /* nb_inplace_subtract */
+ Vector_imul, /* nb_inplace_multiply */
+ NULL, /* nb_inplace_remainder */
+ NULL, /* nb_inplace_power */
+ NULL, /* nb_inplace_lshift */
+ NULL, /* nb_inplace_rshift */
+ NULL, /* nb_inplace_and */
+ NULL, /* nb_inplace_xor */
+ NULL, /* nb_inplace_or */
+ NULL, /* nb_floor_divide */
+ Vector_div, /* nb_true_divide */
+ NULL, /* nb_inplace_floor_divide */
+ Vector_idiv, /* nb_inplace_true_divide */
+ NULL, /* nb_index */
};
/*------------------PY_OBECT DEFINITION--------------------------*/
@@ -2147,7 +2206,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)
@@ -2192,9 +2251,9 @@ static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure
size_from = axis_from;
}
- else if ( (PyErr_Clear()), /* run but ignore the result */
- (size_from = mathutils_array_parse(vec_assign, 2, 4, value,
- "mathutils.Vector.**** = swizzle assignment")) == -1)
+ else if ((PyErr_Clear()), /* run but ignore the result */
+ (size_from = mathutils_array_parse(vec_assign, 2, 4, value,
+ "mathutils.Vector.**** = swizzle assignment")) == -1)
{
return -1;
}
@@ -2209,7 +2268,7 @@ static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure
axis_from = 0;
swizzleClosure = GET_INT_FROM_POINTER(closure);
- while (swizzleClosure & SWIZZLE_VALID_AXIS) {
+ while (swizzleClosure & SWIZZLE_VALID_AXIS) {
axis_to = swizzleClosure & SWIZZLE_AXIS;
tvec[axis_to] = vec_assign[axis_from];
swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS;
@@ -2240,342 +2299,342 @@ static PyGetSetDef Vector_getseters[] = {
{(char *)"owner", (getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL},
/* autogenerated swizzle attrs, see python script below */
- {(char *)"xx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 36
- {(char *)"xxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 292
- {(char *)"xxxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2340
- {(char *)"xxxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2852
- {(char *)"xxxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3364
- {(char *)"xxxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3876
- {(char *)"xxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 356
- {(char *)"xxyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2404
- {(char *)"xxyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2916
- {(char *)"xxyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3428
- {(char *)"xxyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3940
- {(char *)"xxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 420
- {(char *)"xxzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2468
- {(char *)"xxzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2980
- {(char *)"xxzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3492
- {(char *)"xxzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4004
- {(char *)"xxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 484
- {(char *)"xxwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2532
- {(char *)"xxwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3044
- {(char *)"xxwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3556
- {(char *)"xxww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4068
- {(char *)"xy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 44
- {(char *)"xyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 300
- {(char *)"xyxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2348
- {(char *)"xyxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2860
- {(char *)"xyxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3372
- {(char *)"xyxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3884
- {(char *)"xyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 364
- {(char *)"xyyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2412
- {(char *)"xyyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2924
- {(char *)"xyyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3436
- {(char *)"xyyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3948
- {(char *)"xyz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 428
- {(char *)"xyzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2476
- {(char *)"xyzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2988
- {(char *)"xyzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3500
- {(char *)"xyzw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4012
- {(char *)"xyw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 492
- {(char *)"xywx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2540
- {(char *)"xywy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3052
- {(char *)"xywz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3564
- {(char *)"xyww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4076
- {(char *)"xz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 52
- {(char *)"xzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 308
- {(char *)"xzxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2356
- {(char *)"xzxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2868
- {(char *)"xzxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3380
- {(char *)"xzxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3892
- {(char *)"xzy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 372
- {(char *)"xzyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2420
- {(char *)"xzyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2932
- {(char *)"xzyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3444
- {(char *)"xzyw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3956
- {(char *)"xzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 436
- {(char *)"xzzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2484
- {(char *)"xzzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2996
- {(char *)"xzzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3508
- {(char *)"xzzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4020
- {(char *)"xzw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 500
- {(char *)"xzwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2548
- {(char *)"xzwy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3060
- {(char *)"xzwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3572
- {(char *)"xzww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4084
- {(char *)"xw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 60
- {(char *)"xwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 316
- {(char *)"xwxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2364
- {(char *)"xwxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2876
- {(char *)"xwxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3388
- {(char *)"xwxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3900
- {(char *)"xwy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 380
- {(char *)"xwyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2428
- {(char *)"xwyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2940
- {(char *)"xwyz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3452
- {(char *)"xwyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3964
- {(char *)"xwz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 444
- {(char *)"xwzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2492
- {(char *)"xwzy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3004
- {(char *)"xwzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3516
- {(char *)"xwzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4028
- {(char *)"xww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 508
- {(char *)"xwwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2556
- {(char *)"xwwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3068
- {(char *)"xwwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3580
- {(char *)"xwww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4092
- {(char *)"yx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 37
- {(char *)"yxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 293
- {(char *)"yxxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2341
- {(char *)"yxxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2853
- {(char *)"yxxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3365
- {(char *)"yxxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3877
- {(char *)"yxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 357
- {(char *)"yxyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2405
- {(char *)"yxyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2917
- {(char *)"yxyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3429
- {(char *)"yxyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3941
- {(char *)"yxz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 421
- {(char *)"yxzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2469
- {(char *)"yxzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2981
- {(char *)"yxzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3493
- {(char *)"yxzw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4005
- {(char *)"yxw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 485
- {(char *)"yxwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2533
- {(char *)"yxwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3045
- {(char *)"yxwz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3557
- {(char *)"yxww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4069
- {(char *)"yy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 45
- {(char *)"yyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 301
- {(char *)"yyxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2349
- {(char *)"yyxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2861
- {(char *)"yyxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3373
- {(char *)"yyxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3885
- {(char *)"yyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 365
- {(char *)"yyyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2413
- {(char *)"yyyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2925
- {(char *)"yyyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3437
- {(char *)"yyyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3949
- {(char *)"yyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 429
- {(char *)"yyzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2477
- {(char *)"yyzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2989
- {(char *)"yyzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3501
- {(char *)"yyzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4013
- {(char *)"yyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 493
- {(char *)"yywx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2541
- {(char *)"yywy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3053
- {(char *)"yywz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3565
- {(char *)"yyww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4077
- {(char *)"yz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 53
- {(char *)"yzx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 309
- {(char *)"yzxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2357
- {(char *)"yzxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2869
- {(char *)"yzxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3381
- {(char *)"yzxw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3893
- {(char *)"yzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 373
- {(char *)"yzyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2421
- {(char *)"yzyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2933
- {(char *)"yzyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3445
- {(char *)"yzyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3957
- {(char *)"yzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 437
- {(char *)"yzzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2485
- {(char *)"yzzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2997
- {(char *)"yzzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3509
- {(char *)"yzzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4021
- {(char *)"yzw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 501
- {(char *)"yzwx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2549
- {(char *)"yzwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3061
- {(char *)"yzwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3573
- {(char *)"yzww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4085
- {(char *)"yw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 61
- {(char *)"ywx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 317
- {(char *)"ywxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2365
- {(char *)"ywxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2877
- {(char *)"ywxz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3389
- {(char *)"ywxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3901
- {(char *)"ywy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 381
- {(char *)"ywyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2429
- {(char *)"ywyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2941
- {(char *)"ywyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3453
- {(char *)"ywyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3965
- {(char *)"ywz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 445
- {(char *)"ywzx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2493
- {(char *)"ywzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3005
- {(char *)"ywzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3517
- {(char *)"ywzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4029
- {(char *)"yww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 509
- {(char *)"ywwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2557
- {(char *)"ywwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3069
- {(char *)"ywwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3581
- {(char *)"ywww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4093
- {(char *)"zx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 38
- {(char *)"zxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 294
- {(char *)"zxxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2342
- {(char *)"zxxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2854
- {(char *)"zxxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3366
- {(char *)"zxxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3878
- {(char *)"zxy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 358
- {(char *)"zxyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2406
- {(char *)"zxyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2918
- {(char *)"zxyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3430
- {(char *)"zxyw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3942
- {(char *)"zxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 422
- {(char *)"zxzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2470
- {(char *)"zxzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2982
- {(char *)"zxzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3494
- {(char *)"zxzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4006
- {(char *)"zxw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 486
- {(char *)"zxwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2534
- {(char *)"zxwy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3046
- {(char *)"zxwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3558
- {(char *)"zxww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4070
- {(char *)"zy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 46
- {(char *)"zyx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 302
- {(char *)"zyxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2350
- {(char *)"zyxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2862
- {(char *)"zyxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3374
- {(char *)"zyxw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3886
- {(char *)"zyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 366
- {(char *)"zyyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2414
- {(char *)"zyyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2926
- {(char *)"zyyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3438
- {(char *)"zyyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3950
- {(char *)"zyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 430
- {(char *)"zyzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2478
- {(char *)"zyzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2990
- {(char *)"zyzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3502
- {(char *)"zyzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4014
- {(char *)"zyw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 494
- {(char *)"zywx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2542
- {(char *)"zywy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3054
- {(char *)"zywz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3566
- {(char *)"zyww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4078
- {(char *)"zz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 54
- {(char *)"zzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 310
- {(char *)"zzxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2358
- {(char *)"zzxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2870
- {(char *)"zzxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3382
- {(char *)"zzxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3894
- {(char *)"zzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 374
- {(char *)"zzyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2422
- {(char *)"zzyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2934
- {(char *)"zzyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3446
- {(char *)"zzyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3958
- {(char *)"zzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 438
- {(char *)"zzzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2486
- {(char *)"zzzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2998
- {(char *)"zzzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3510
- {(char *)"zzzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4022
- {(char *)"zzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 502
- {(char *)"zzwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2550
- {(char *)"zzwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3062
- {(char *)"zzwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3574
- {(char *)"zzww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4086
- {(char *)"zw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 62
- {(char *)"zwx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 318
- {(char *)"zwxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2366
- {(char *)"zwxy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2878
- {(char *)"zwxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3390
- {(char *)"zwxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3902
- {(char *)"zwy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 382
- {(char *)"zwyx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2430
- {(char *)"zwyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2942
- {(char *)"zwyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3454
- {(char *)"zwyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3966
- {(char *)"zwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 446
- {(char *)"zwzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2494
- {(char *)"zwzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3006
- {(char *)"zwzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3518
- {(char *)"zwzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4030
- {(char *)"zww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 510
- {(char *)"zwwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2558
- {(char *)"zwwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3070
- {(char *)"zwwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3582
- {(char *)"zwww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4094
- {(char *)"wx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 39
- {(char *)"wxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 295
- {(char *)"wxxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2343
- {(char *)"wxxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2855
- {(char *)"wxxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3367
- {(char *)"wxxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3879
- {(char *)"wxy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 359
- {(char *)"wxyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2407
- {(char *)"wxyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2919
- {(char *)"wxyz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3431
- {(char *)"wxyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3943
- {(char *)"wxz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 423
- {(char *)"wxzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2471
- {(char *)"wxzy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2983
- {(char *)"wxzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3495
- {(char *)"wxzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4007
- {(char *)"wxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 487
- {(char *)"wxwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2535
- {(char *)"wxwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3047
- {(char *)"wxwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3559
- {(char *)"wxww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4071
- {(char *)"wy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 47
- {(char *)"wyx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 303
- {(char *)"wyxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2351
- {(char *)"wyxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2863
- {(char *)"wyxz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3375
- {(char *)"wyxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3887
- {(char *)"wyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 367
- {(char *)"wyyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2415
- {(char *)"wyyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2927
- {(char *)"wyyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3439
- {(char *)"wyyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3951
- {(char *)"wyz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 431
- {(char *)"wyzx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2479
- {(char *)"wyzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2991
- {(char *)"wyzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3503
- {(char *)"wyzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4015
- {(char *)"wyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 495
- {(char *)"wywx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2543
- {(char *)"wywy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3055
- {(char *)"wywz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3567
- {(char *)"wyww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4079
- {(char *)"wz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 55
- {(char *)"wzx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 311
- {(char *)"wzxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2359
- {(char *)"wzxy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2871
- {(char *)"wzxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3383
- {(char *)"wzxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3895
- {(char *)"wzy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 375
- {(char *)"wzyx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2423
- {(char *)"wzyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2935
- {(char *)"wzyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3447
- {(char *)"wzyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3959
- {(char *)"wzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 439
- {(char *)"wzzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2487
- {(char *)"wzzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2999
- {(char *)"wzzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3511
- {(char *)"wzzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4023
- {(char *)"wzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 503
- {(char *)"wzwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2551
- {(char *)"wzwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3063
- {(char *)"wzwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3575
- {(char *)"wzww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4087
- {(char *)"ww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 63
- {(char *)"wwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 319
- {(char *)"wwxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2367
- {(char *)"wwxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2879
- {(char *)"wwxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3391
- {(char *)"wwxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3903
- {(char *)"wwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 383
- {(char *)"wwyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2431
- {(char *)"wwyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2943
- {(char *)"wwyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3455
- {(char *)"wwyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3967
- {(char *)"wwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 447
- {(char *)"wwzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2495
- {(char *)"wwzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3007
- {(char *)"wwzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3519
- {(char *)"wwzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4031
- {(char *)"www", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 511
- {(char *)"wwwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2559
- {(char *)"wwwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3071
- {(char *)"wwwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3583
- {(char *)"wwww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4095
+ {(char *)"xx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 36
+ {(char *)"xxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 292
+ {(char *)"xxxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2340
+ {(char *)"xxxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2852
+ {(char *)"xxxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3364
+ {(char *)"xxxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3876
+ {(char *)"xxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 356
+ {(char *)"xxyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2404
+ {(char *)"xxyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2916
+ {(char *)"xxyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3428
+ {(char *)"xxyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3940
+ {(char *)"xxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 420
+ {(char *)"xxzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2468
+ {(char *)"xxzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2980
+ {(char *)"xxzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3492
+ {(char *)"xxzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4004
+ {(char *)"xxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 484
+ {(char *)"xxwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2532
+ {(char *)"xxwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3044
+ {(char *)"xxwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3556
+ {(char *)"xxww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4068
+ {(char *)"xy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 44
+ {(char *)"xyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 300
+ {(char *)"xyxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2348
+ {(char *)"xyxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2860
+ {(char *)"xyxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3372
+ {(char *)"xyxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3884
+ {(char *)"xyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 364
+ {(char *)"xyyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2412
+ {(char *)"xyyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2924
+ {(char *)"xyyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3436
+ {(char *)"xyyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3948
+ {(char *)"xyz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 428
+ {(char *)"xyzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2476
+ {(char *)"xyzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2988
+ {(char *)"xyzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3500
+ {(char *)"xyzw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4012
+ {(char *)"xyw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 492
+ {(char *)"xywx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2540
+ {(char *)"xywy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3052
+ {(char *)"xywz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3564
+ {(char *)"xyww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4076
+ {(char *)"xz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 52
+ {(char *)"xzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 308
+ {(char *)"xzxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2356
+ {(char *)"xzxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2868
+ {(char *)"xzxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3380
+ {(char *)"xzxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3892
+ {(char *)"xzy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 372
+ {(char *)"xzyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2420
+ {(char *)"xzyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2932
+ {(char *)"xzyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3444
+ {(char *)"xzyw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3956
+ {(char *)"xzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 436
+ {(char *)"xzzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2484
+ {(char *)"xzzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2996
+ {(char *)"xzzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3508
+ {(char *)"xzzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4020
+ {(char *)"xzw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 500
+ {(char *)"xzwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2548
+ {(char *)"xzwy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3060
+ {(char *)"xzwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3572
+ {(char *)"xzww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4084
+ {(char *)"xw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 60
+ {(char *)"xwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 316
+ {(char *)"xwxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2364
+ {(char *)"xwxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2876
+ {(char *)"xwxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3388
+ {(char *)"xwxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3900
+ {(char *)"xwy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 380
+ {(char *)"xwyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2428
+ {(char *)"xwyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2940
+ {(char *)"xwyz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3452
+ {(char *)"xwyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3964
+ {(char *)"xwz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 444
+ {(char *)"xwzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2492
+ {(char *)"xwzy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3004
+ {(char *)"xwzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3516
+ {(char *)"xwzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4028
+ {(char *)"xww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 508
+ {(char *)"xwwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2556
+ {(char *)"xwwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3068
+ {(char *)"xwwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3580
+ {(char *)"xwww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((0 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4092
+ {(char *)"yx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 37
+ {(char *)"yxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 293
+ {(char *)"yxxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2341
+ {(char *)"yxxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2853
+ {(char *)"yxxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3365
+ {(char *)"yxxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3877
+ {(char *)"yxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 357
+ {(char *)"yxyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2405
+ {(char *)"yxyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2917
+ {(char *)"yxyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3429
+ {(char *)"yxyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3941
+ {(char *)"yxz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 421
+ {(char *)"yxzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2469
+ {(char *)"yxzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2981
+ {(char *)"yxzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3493
+ {(char *)"yxzw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4005
+ {(char *)"yxw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 485
+ {(char *)"yxwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2533
+ {(char *)"yxwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3045
+ {(char *)"yxwz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3557
+ {(char *)"yxww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4069
+ {(char *)"yy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 45
+ {(char *)"yyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 301
+ {(char *)"yyxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2349
+ {(char *)"yyxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2861
+ {(char *)"yyxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3373
+ {(char *)"yyxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3885
+ {(char *)"yyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 365
+ {(char *)"yyyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2413
+ {(char *)"yyyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2925
+ {(char *)"yyyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3437
+ {(char *)"yyyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3949
+ {(char *)"yyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 429
+ {(char *)"yyzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2477
+ {(char *)"yyzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2989
+ {(char *)"yyzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3501
+ {(char *)"yyzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4013
+ {(char *)"yyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 493
+ {(char *)"yywx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2541
+ {(char *)"yywy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3053
+ {(char *)"yywz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3565
+ {(char *)"yyww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4077
+ {(char *)"yz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 53
+ {(char *)"yzx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 309
+ {(char *)"yzxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2357
+ {(char *)"yzxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2869
+ {(char *)"yzxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3381
+ {(char *)"yzxw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3893
+ {(char *)"yzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 373
+ {(char *)"yzyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2421
+ {(char *)"yzyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2933
+ {(char *)"yzyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3445
+ {(char *)"yzyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3957
+ {(char *)"yzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 437
+ {(char *)"yzzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2485
+ {(char *)"yzzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2997
+ {(char *)"yzzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3509
+ {(char *)"yzzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4021
+ {(char *)"yzw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 501
+ {(char *)"yzwx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2549
+ {(char *)"yzwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3061
+ {(char *)"yzwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3573
+ {(char *)"yzww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4085
+ {(char *)"yw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 61
+ {(char *)"ywx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 317
+ {(char *)"ywxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2365
+ {(char *)"ywxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2877
+ {(char *)"ywxz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3389
+ {(char *)"ywxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3901
+ {(char *)"ywy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 381
+ {(char *)"ywyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2429
+ {(char *)"ywyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2941
+ {(char *)"ywyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3453
+ {(char *)"ywyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3965
+ {(char *)"ywz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 445
+ {(char *)"ywzx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2493
+ {(char *)"ywzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3005
+ {(char *)"ywzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3517
+ {(char *)"ywzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4029
+ {(char *)"yww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 509
+ {(char *)"ywwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2557
+ {(char *)"ywwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3069
+ {(char *)"ywwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3581
+ {(char *)"ywww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((1 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4093
+ {(char *)"zx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 38
+ {(char *)"zxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 294
+ {(char *)"zxxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2342
+ {(char *)"zxxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2854
+ {(char *)"zxxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3366
+ {(char *)"zxxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3878
+ {(char *)"zxy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 358
+ {(char *)"zxyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2406
+ {(char *)"zxyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2918
+ {(char *)"zxyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3430
+ {(char *)"zxyw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3942
+ {(char *)"zxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 422
+ {(char *)"zxzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2470
+ {(char *)"zxzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2982
+ {(char *)"zxzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3494
+ {(char *)"zxzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4006
+ {(char *)"zxw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 486
+ {(char *)"zxwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2534
+ {(char *)"zxwy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3046
+ {(char *)"zxwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3558
+ {(char *)"zxww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4070
+ {(char *)"zy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 46
+ {(char *)"zyx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 302
+ {(char *)"zyxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2350
+ {(char *)"zyxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2862
+ {(char *)"zyxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3374
+ {(char *)"zyxw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3886
+ {(char *)"zyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 366
+ {(char *)"zyyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2414
+ {(char *)"zyyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2926
+ {(char *)"zyyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3438
+ {(char *)"zyyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3950
+ {(char *)"zyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 430
+ {(char *)"zyzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2478
+ {(char *)"zyzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2990
+ {(char *)"zyzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3502
+ {(char *)"zyzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4014
+ {(char *)"zyw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 494
+ {(char *)"zywx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2542
+ {(char *)"zywy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3054
+ {(char *)"zywz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3566
+ {(char *)"zyww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4078
+ {(char *)"zz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 54
+ {(char *)"zzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 310
+ {(char *)"zzxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2358
+ {(char *)"zzxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2870
+ {(char *)"zzxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3382
+ {(char *)"zzxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3894
+ {(char *)"zzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 374
+ {(char *)"zzyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2422
+ {(char *)"zzyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2934
+ {(char *)"zzyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3446
+ {(char *)"zzyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3958
+ {(char *)"zzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 438
+ {(char *)"zzzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2486
+ {(char *)"zzzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2998
+ {(char *)"zzzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3510
+ {(char *)"zzzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4022
+ {(char *)"zzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 502
+ {(char *)"zzwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2550
+ {(char *)"zzwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3062
+ {(char *)"zzwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3574
+ {(char *)"zzww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4086
+ {(char *)"zw", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 62
+ {(char *)"zwx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 318
+ {(char *)"zwxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2366
+ {(char *)"zwxy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2878
+ {(char *)"zwxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3390
+ {(char *)"zwxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3902
+ {(char *)"zwy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 382
+ {(char *)"zwyx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2430
+ {(char *)"zwyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2942
+ {(char *)"zwyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3454
+ {(char *)"zwyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3966
+ {(char *)"zwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 446
+ {(char *)"zwzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2494
+ {(char *)"zwzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3006
+ {(char *)"zwzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3518
+ {(char *)"zwzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4030
+ {(char *)"zww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 510
+ {(char *)"zwwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2558
+ {(char *)"zwwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3070
+ {(char *)"zwwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3582
+ {(char *)"zwww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((2 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4094
+ {(char *)"wx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 39
+ {(char *)"wxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 295
+ {(char *)"wxxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2343
+ {(char *)"wxxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2855
+ {(char *)"wxxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3367
+ {(char *)"wxxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3879
+ {(char *)"wxy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 359
+ {(char *)"wxyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2407
+ {(char *)"wxyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2919
+ {(char *)"wxyz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3431
+ {(char *)"wxyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3943
+ {(char *)"wxz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 423
+ {(char *)"wxzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2471
+ {(char *)"wxzy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2983
+ {(char *)"wxzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3495
+ {(char *)"wxzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4007
+ {(char *)"wxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 487
+ {(char *)"wxwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2535
+ {(char *)"wxwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3047
+ {(char *)"wxwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3559
+ {(char *)"wxww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4071
+ {(char *)"wy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 47
+ {(char *)"wyx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 303
+ {(char *)"wyxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2351
+ {(char *)"wyxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2863
+ {(char *)"wyxz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3375
+ {(char *)"wyxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3887
+ {(char *)"wyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 367
+ {(char *)"wyyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2415
+ {(char *)"wyyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2927
+ {(char *)"wyyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3439
+ {(char *)"wyyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3951
+ {(char *)"wyz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 431
+ {(char *)"wyzx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2479
+ {(char *)"wyzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2991
+ {(char *)"wyzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3503
+ {(char *)"wyzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4015
+ {(char *)"wyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 495
+ {(char *)"wywx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2543
+ {(char *)"wywy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3055
+ {(char *)"wywz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3567
+ {(char *)"wyww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4079
+ {(char *)"wz", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 55
+ {(char *)"wzx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 311
+ {(char *)"wzxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2359
+ {(char *)"wzxy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2871
+ {(char *)"wzxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3383
+ {(char *)"wzxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3895
+ {(char *)"wzy", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 375
+ {(char *)"wzyx", (getter)Vector_swizzle_get, (setter)Vector_swizzle_set, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2423
+ {(char *)"wzyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2935
+ {(char *)"wzyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3447
+ {(char *)"wzyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3959
+ {(char *)"wzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 439
+ {(char *)"wzzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2487
+ {(char *)"wzzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2999
+ {(char *)"wzzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3511
+ {(char *)"wzzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4023
+ {(char *)"wzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 503
+ {(char *)"wzwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2551
+ {(char *)"wzwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3063
+ {(char *)"wzwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3575
+ {(char *)"wzww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4087
+ {(char *)"ww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS)))}, // 63
+ {(char *)"wwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 319
+ {(char *)"wwxx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2367
+ {(char *)"wwxy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2879
+ {(char *)"wwxz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3391
+ {(char *)"wwxw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3903
+ {(char *)"wwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 383
+ {(char *)"wwyx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2431
+ {(char *)"wwyy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2943
+ {(char *)"wwyz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3455
+ {(char *)"wwyw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3967
+ {(char *)"wwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 447
+ {(char *)"wwzx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2495
+ {(char *)"wwzy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3007
+ {(char *)"wwzz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3519
+ {(char *)"wwzw", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4031
+ {(char *)"www", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))))}, // 511
+ {(char *)"wwwx", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((0 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 2559
+ {(char *)"wwwy", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((1 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3071
+ {(char *)"wwwz", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((2 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 3583
+ {(char *)"wwww", (getter)Vector_swizzle_get, (setter)NULL, NULL, SET_INT_IN_POINTER(((3 | SWIZZLE_VALID_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << SWIZZLE_BITS_PER_AXIS) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((3 | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) )}, // 4095
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
@@ -2597,11 +2656,11 @@ while len(axises) >= 2:
if len(axises)>2:
for axis_2 in axises:
axis_2_pos = axis_pos[axis_2]
- axis_dict[axis_0 + axis_1 + axis_2] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)))' % (axis_0_pos, axis_1_pos, axis_2_pos)
+ axis_dict[axis_0 + axis_1 + axis_2] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS * 2)))' % (axis_0_pos, axis_1_pos, axis_2_pos)
if len(axises)>3:
for axis_3 in axises:
axis_3_pos = axis_pos[axis_3]
- axis_dict[axis_0 + axis_1 + axis_2 + axis_3] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((%s|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) ' % (axis_0_pos, axis_1_pos, axis_2_pos, axis_3_pos)
+ axis_dict[axis_0 + axis_1 + axis_2 + axis_3] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((%s|SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)) | ((%s|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS * 3))) ' % (axis_0_pos, axis_1_pos, axis_2_pos, axis_3_pos)
axises = axises[:-1]
@@ -2613,7 +2672,7 @@ unique = set()
for key, val in items:
num = eval(val)
set_str = 'Vector_setSwizzle' if (len(set(key)) == len(key)) else 'NULL'
- print '\t{"%s", %s(getter)Vector_getSwizzle, (setter)%s, NULL, SET_INT_IN_POINTER(%s)}, // %s' % (key, (' '*(4-len(key))), set_str, axis_dict[key], num)
+ print '\t{"%s", %s(getter)Vector_getSwizzle, (setter)%s, NULL, SET_INT_IN_POINTER(%s)}, // %s' % (key, (' '*(4 - len(key))), set_str, axis_dict[key], num)
unique.add(num)
if len(unique) != len(items):
@@ -2707,6 +2766,7 @@ static struct PyMethodDef Vector_methods[] = {
{"cross", (PyCFunction) Vector_cross, METH_O, Vector_cross_doc},
{"dot", (PyCFunction) Vector_dot, METH_O, Vector_dot_doc},
{"angle", (PyCFunction) Vector_angle, METH_VARARGS, Vector_angle_doc},
+ {"angle_signed", (PyCFunction) Vector_angle_signed, METH_VARARGS, Vector_angle_signed_doc},
{"rotation_difference", (PyCFunction) Vector_rotation_difference, METH_O, Vector_rotation_difference_doc},
{"project", (PyCFunction) Vector_project, METH_O, Vector_project_doc},
{"lerp", (PyCFunction) Vector_lerp, METH_VARARGS, Vector_lerp_doc},
@@ -2714,15 +2774,16 @@ static struct PyMethodDef Vector_methods[] = {
{"copy", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc},
{"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, NULL},
+ {"__deepcopy__", (PyCFunction) Vector_deepcopy, METH_VARARGS, NULL},
{NULL, NULL, 0, NULL}
};
/* 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."
@@ -2736,7 +2797,7 @@ PyTypeObject vector_Type = {
/* Methods to implement standard operations */
- (destructor) BaseMathObject_dealloc,/* destructor tp_dealloc; */
+ (destructor) BaseMathObject_dealloc, /* destructor tp_dealloc; */
NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
@@ -2760,30 +2821,30 @@ PyTypeObject vector_Type = {
/* Functions to access object as input/output buffer */
NULL, /* PyBufferProcs *tp_as_buffer; */
- /*** Flags to define presence of optional/expanded features ***/
+ /*** Flags to define presence of optional/expanded features ***/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
vector_doc, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
+ /*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */
- (traverseproc)BaseMathObject_traverse, //tp_traverse
+ (traverseproc)BaseMathObject_traverse, //tp_traverse
/* delete references to contained objects */
- (inquiry)BaseMathObject_clear, //tp_clear
+ (inquiry)BaseMathObject_clear, //tp_clear
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
(richcmpfunc)Vector_richcmpr, /* richcmpfunc tp_richcompare; */
- /*** weak reference enabler ***/
+ /*** weak reference enabler ***/
0, /* long tp_weaklistoffset; */
- /*** Added in release 2.2 ***/
+ /*** Added in release 2.2 ***/
/* Iterators */
NULL, /* getiterfunc tp_iter; */
NULL, /* iternextfunc tp_iternext; */
- /*** Attribute descriptor and subclassing stuff ***/
+ /*** Attribute descriptor and subclassing stuff ***/
Vector_methods, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
Vector_getseters, /* struct PyGetSetDef *tp_getset; */
@@ -2809,11 +2870,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;
@@ -2858,15 +2919,15 @@ PyObject *Vector_CreatePyObject(float *vec, const int size, const int type, PyTy
return (PyObject *) self;
}
-PyObject *Vector_CreatePyObject_cb(PyObject *cb_user, int size, int cb_type, int cb_subtype)
+PyObject *Vector_CreatePyObject_cb(PyObject *cb_user, int size, unsigned char cb_type, unsigned char cb_subtype)
{
float dummy[4] = {0.0, 0.0, 0.0, 0.0}; /* dummy init vector, callbacks will be used on access */
VectorObject *self = (VectorObject *)Vector_CreatePyObject(dummy, size, Py_NEW, NULL);
if (self) {
Py_INCREF(cb_user);
- self->cb_user = cb_user;
- self->cb_type = (unsigned char)cb_type;
- self->cb_subtype = (unsigned char)cb_subtype;
+ self->cb_user = cb_user;
+ self->cb_type = cb_type;
+ self->cb_subtype = cb_subtype;
PyObject_GC_Track(self);
}
diff --git a/source/blender/python/mathutils/mathutils_Vector.h b/source/blender/python/mathutils/mathutils_Vector.h
index 88de991ba43..04fd0adcda5 100644
--- a/source/blender/python/mathutils/mathutils_Vector.h
+++ b/source/blender/python/mathutils/mathutils_Vector.h
@@ -46,7 +46,8 @@ typedef struct {
/*prototypes*/
PyObject *Vector_CreatePyObject(float *vec, const int size, const int type, PyTypeObject *base_type);
-PyObject *Vector_CreatePyObject_cb(PyObject *user, int size, int callback_type, int subtype);
+PyObject *Vector_CreatePyObject_cb(PyObject *user, int size,
+ unsigned char cb_type, unsigned char subtype);
PyObject *Vector_CreatePyObject_alloc(float *vec, const int size, PyTypeObject *base_type);
#endif /* __MATHUTILS_VECTOR_H__ */
diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c
index b4f3f4e470e..d6c426be54b 100644
--- a/source/blender/python/mathutils/mathutils_geometry.c
+++ b/source/blender/python/mathutils/mathutils_geometry.c
@@ -99,11 +99,11 @@ static PyObject *M_Geometry_intersect_ray_tri(PyObject *UNUSED(self), PyObject *
return NULL;
}
- if ( BaseMath_ReadCallback(vec1) == -1 ||
- BaseMath_ReadCallback(vec2) == -1 ||
- BaseMath_ReadCallback(vec3) == -1 ||
- BaseMath_ReadCallback(ray) == -1 ||
- BaseMath_ReadCallback(ray_off) == -1)
+ if (BaseMath_ReadCallback(vec1) == -1 ||
+ BaseMath_ReadCallback(vec2) == -1 ||
+ BaseMath_ReadCallback(vec3) == -1 ||
+ BaseMath_ReadCallback(ray) == -1 ||
+ BaseMath_ReadCallback(ray_off) == -1)
{
return NULL;
}
@@ -199,10 +199,10 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject
return NULL;
}
- if ( BaseMath_ReadCallback(vec1) == -1 ||
- BaseMath_ReadCallback(vec2) == -1 ||
- BaseMath_ReadCallback(vec3) == -1 ||
- BaseMath_ReadCallback(vec4) == -1)
+ if (BaseMath_ReadCallback(vec1) == -1 ||
+ BaseMath_ReadCallback(vec2) == -1 ||
+ BaseMath_ReadCallback(vec3) == -1 ||
+ BaseMath_ReadCallback(vec4) == -1)
{
return NULL;
}
@@ -298,9 +298,9 @@ static PyObject *M_Geometry_normal(PyObject *UNUSED(self), PyObject *args)
return NULL;
}
- if ( BaseMath_ReadCallback(vec1) == -1 ||
- BaseMath_ReadCallback(vec2) == -1 ||
- BaseMath_ReadCallback(vec3) == -1)
+ if (BaseMath_ReadCallback(vec1) == -1 ||
+ BaseMath_ReadCallback(vec2) == -1 ||
+ BaseMath_ReadCallback(vec3) == -1)
{
return NULL;
}
@@ -327,10 +327,10 @@ static PyObject *M_Geometry_normal(PyObject *UNUSED(self), PyObject *args)
return NULL;
}
- if ( BaseMath_ReadCallback(vec1) == -1 ||
- BaseMath_ReadCallback(vec2) == -1 ||
- BaseMath_ReadCallback(vec3) == -1 ||
- BaseMath_ReadCallback(vec4) == -1)
+ if (BaseMath_ReadCallback(vec1) == -1 ||
+ BaseMath_ReadCallback(vec2) == -1 ||
+ BaseMath_ReadCallback(vec3) == -1 ||
+ BaseMath_ReadCallback(vec4) == -1)
{
return NULL;
}
@@ -374,9 +374,9 @@ static PyObject *M_Geometry_area_tri(PyObject *UNUSED(self), PyObject *args)
return NULL;
}
- if ( BaseMath_ReadCallback(vec1) == -1 ||
- BaseMath_ReadCallback(vec2) == -1 ||
- BaseMath_ReadCallback(vec3) == -1)
+ if (BaseMath_ReadCallback(vec1) == -1 ||
+ BaseMath_ReadCallback(vec2) == -1 ||
+ BaseMath_ReadCallback(vec3) == -1)
{
return NULL;
}
@@ -424,10 +424,10 @@ static PyObject *M_Geometry_intersect_line_line_2d(PyObject *UNUSED(self), PyObj
return NULL;
}
- if ( BaseMath_ReadCallback(line_a1) == -1 ||
- BaseMath_ReadCallback(line_a2) == -1 ||
- BaseMath_ReadCallback(line_b1) == -1 ||
- BaseMath_ReadCallback(line_b2) == -1)
+ if (BaseMath_ReadCallback(line_a1) == -1 ||
+ BaseMath_ReadCallback(line_a2) == -1 ||
+ BaseMath_ReadCallback(line_b1) == -1 ||
+ BaseMath_ReadCallback(line_b2) == -1)
{
return NULL;
}
@@ -474,10 +474,10 @@ static PyObject *M_Geometry_intersect_line_plane(PyObject *UNUSED(self), PyObjec
return NULL;
}
- if ( BaseMath_ReadCallback(line_a) == -1 ||
- BaseMath_ReadCallback(line_b) == -1 ||
- BaseMath_ReadCallback(plane_co) == -1 ||
- BaseMath_ReadCallback(plane_no) == -1)
+ if (BaseMath_ReadCallback(line_a) == -1 ||
+ BaseMath_ReadCallback(line_b) == -1 ||
+ BaseMath_ReadCallback(plane_co) == -1 ||
+ BaseMath_ReadCallback(plane_no) == -1)
{
return NULL;
}
@@ -530,10 +530,10 @@ static PyObject *M_Geometry_intersect_plane_plane(PyObject *UNUSED(self), PyObje
return NULL;
}
- if ( BaseMath_ReadCallback(plane_a_co) == -1 ||
- BaseMath_ReadCallback(plane_a_no) == -1 ||
- BaseMath_ReadCallback(plane_b_co) == -1 ||
- BaseMath_ReadCallback(plane_b_no) == -1)
+ if (BaseMath_ReadCallback(plane_a_co) == -1 ||
+ BaseMath_ReadCallback(plane_a_no) == -1 ||
+ BaseMath_ReadCallback(plane_b_co) == -1 ||
+ BaseMath_ReadCallback(plane_b_no) == -1)
{
return NULL;
}
@@ -592,9 +592,9 @@ static PyObject *M_Geometry_intersect_line_sphere(PyObject *UNUSED(self), PyObje
return NULL;
}
- if ( BaseMath_ReadCallback(line_a) == -1 ||
- BaseMath_ReadCallback(line_b) == -1 ||
- BaseMath_ReadCallback(sphere_co) == -1)
+ if (BaseMath_ReadCallback(line_a) == -1 ||
+ BaseMath_ReadCallback(line_b) == -1 ||
+ BaseMath_ReadCallback(sphere_co) == -1)
{
return NULL;
}
@@ -613,24 +613,24 @@ static PyObject *M_Geometry_intersect_line_sphere(PyObject *UNUSED(self), PyObje
PyObject *ret = PyTuple_New(2);
switch (isect_line_sphere_v3(line_a->vec, line_b->vec, sphere_co->vec, sphere_radius, isect_a, isect_b)) {
- case 1:
- if (!(!clip || (((lambda = line_point_factor_v3(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = FALSE;
- use_b = FALSE;
- break;
- case 2:
- if (!(!clip || (((lambda = line_point_factor_v3(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = FALSE;
- if (!(!clip || (((lambda = line_point_factor_v3(isect_b, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_b = FALSE;
- break;
- default:
- use_a = FALSE;
- use_b = FALSE;
+ case 1:
+ if (!(!clip || (((lambda = line_point_factor_v3(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = FALSE;
+ use_b = FALSE;
+ break;
+ case 2:
+ if (!(!clip || (((lambda = line_point_factor_v3(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = FALSE;
+ if (!(!clip || (((lambda = line_point_factor_v3(isect_b, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_b = FALSE;
+ break;
+ default:
+ use_a = FALSE;
+ use_b = FALSE;
}
if (use_a) { PyTuple_SET_ITEM(ret, 0, Vector_CreatePyObject(isect_a, 3, Py_NEW, NULL)); }
- else { PyTuple_SET_ITEM(ret, 0, Py_None); Py_INCREF(Py_None); }
+ else { PyTuple_SET_ITEM(ret, 0, Py_None); Py_INCREF(Py_None); }
if (use_b) { PyTuple_SET_ITEM(ret, 1, Vector_CreatePyObject(isect_b, 3, Py_NEW, NULL)); }
- else { PyTuple_SET_ITEM(ret, 1, Py_None); Py_INCREF(Py_None); }
+ else { PyTuple_SET_ITEM(ret, 1, Py_None); Py_INCREF(Py_None); }
return ret;
}
@@ -672,9 +672,9 @@ static PyObject *M_Geometry_intersect_line_sphere_2d(PyObject *UNUSED(self), PyO
return NULL;
}
- if ( BaseMath_ReadCallback(line_a) == -1 ||
- BaseMath_ReadCallback(line_b) == -1 ||
- BaseMath_ReadCallback(sphere_co) == -1)
+ if (BaseMath_ReadCallback(line_a) == -1 ||
+ BaseMath_ReadCallback(line_b) == -1 ||
+ BaseMath_ReadCallback(sphere_co) == -1)
{
return NULL;
}
@@ -686,24 +686,24 @@ static PyObject *M_Geometry_intersect_line_sphere_2d(PyObject *UNUSED(self), PyO
PyObject *ret = PyTuple_New(2);
switch (isect_line_sphere_v2(line_a->vec, line_b->vec, sphere_co->vec, sphere_radius, isect_a, isect_b)) {
- case 1:
- if (!(!clip || (((lambda = line_point_factor_v2(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = FALSE;
- use_b = FALSE;
- break;
- case 2:
- if (!(!clip || (((lambda = line_point_factor_v2(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = FALSE;
- if (!(!clip || (((lambda = line_point_factor_v2(isect_b, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_b = FALSE;
- break;
- default:
- use_a = FALSE;
- use_b = FALSE;
+ case 1:
+ if (!(!clip || (((lambda = line_point_factor_v2(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = FALSE;
+ use_b = FALSE;
+ break;
+ case 2:
+ if (!(!clip || (((lambda = line_point_factor_v2(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a = FALSE;
+ if (!(!clip || (((lambda = line_point_factor_v2(isect_b, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_b = FALSE;
+ break;
+ default:
+ use_a = FALSE;
+ use_b = FALSE;
}
if (use_a) { PyTuple_SET_ITEM(ret, 0, Vector_CreatePyObject(isect_a, 2, Py_NEW, NULL)); }
- else { PyTuple_SET_ITEM(ret, 0, Py_None); Py_INCREF(Py_None); }
+ else { PyTuple_SET_ITEM(ret, 0, Py_None); Py_INCREF(Py_None); }
if (use_b) { PyTuple_SET_ITEM(ret, 1, Vector_CreatePyObject(isect_b, 2, Py_NEW, NULL)); }
- else { PyTuple_SET_ITEM(ret, 1, Py_None); Py_INCREF(Py_None); }
+ else { PyTuple_SET_ITEM(ret, 1, Py_None); Py_INCREF(Py_None); }
return ret;
}
@@ -737,21 +737,21 @@ static PyObject *M_Geometry_intersect_point_line(PyObject *UNUSED(self), PyObjec
return NULL;
}
- if ( BaseMath_ReadCallback(pt) == -1 ||
- BaseMath_ReadCallback(line_1) == -1 ||
- BaseMath_ReadCallback(line_2) == -1)
+ if (BaseMath_ReadCallback(pt) == -1 ||
+ BaseMath_ReadCallback(line_1) == -1 ||
+ BaseMath_ReadCallback(line_2) == -1)
{
return NULL;
}
/* accept 2d verts */
- if (pt->size == 3) { copy_v3_v3(pt_in, pt->vec);}
+ if (pt->size == 3) { copy_v3_v3(pt_in, pt->vec); }
else { pt_in[2] = 0.0f; copy_v2_v2(pt_in, pt->vec); }
- if (line_1->size == 3) { copy_v3_v3(l1, line_1->vec);}
+ if (line_1->size == 3) { copy_v3_v3(l1, line_1->vec); }
else { l1[2] = 0.0f; copy_v2_v2(l1, line_1->vec); }
- if (line_2->size == 3) { copy_v3_v3(l2, line_2->vec);}
+ if (line_2->size == 3) { copy_v3_v3(l2, line_2->vec); }
else { l2[2] = 0.0f; copy_v2_v2(l2, line_2->vec); }
/* do the calculation */
@@ -791,10 +791,10 @@ static PyObject *M_Geometry_intersect_point_tri_2d(PyObject *UNUSED(self), PyObj
return NULL;
}
- if ( BaseMath_ReadCallback(pt_vec) == -1 ||
- BaseMath_ReadCallback(tri_p1) == -1 ||
- BaseMath_ReadCallback(tri_p2) == -1 ||
- BaseMath_ReadCallback(tri_p3) == -1)
+ if (BaseMath_ReadCallback(pt_vec) == -1 ||
+ BaseMath_ReadCallback(tri_p1) == -1 ||
+ BaseMath_ReadCallback(tri_p2) == -1 ||
+ BaseMath_ReadCallback(tri_p3) == -1)
{
return NULL;
}
@@ -834,11 +834,11 @@ static PyObject *M_Geometry_intersect_point_quad_2d(PyObject *UNUSED(self), PyOb
return NULL;
}
- if ( BaseMath_ReadCallback(pt_vec) == -1 ||
- BaseMath_ReadCallback(quad_p1) == -1 ||
- BaseMath_ReadCallback(quad_p2) == -1 ||
- BaseMath_ReadCallback(quad_p3) == -1 ||
- BaseMath_ReadCallback(quad_p4) == -1)
+ if (BaseMath_ReadCallback(pt_vec) == -1 ||
+ BaseMath_ReadCallback(quad_p1) == -1 ||
+ BaseMath_ReadCallback(quad_p2) == -1 ||
+ BaseMath_ReadCallback(quad_p3) == -1 ||
+ BaseMath_ReadCallback(quad_p4) == -1)
{
return NULL;
}
@@ -872,9 +872,9 @@ static PyObject *M_Geometry_distance_point_to_plane(PyObject *UNUSED(self), PyOb
return NULL;
}
- if ( BaseMath_ReadCallback(pt) == -1 ||
- BaseMath_ReadCallback(plene_co) == -1 ||
- BaseMath_ReadCallback(plane_no) == -1)
+ if (BaseMath_ReadCallback(pt) == -1 ||
+ BaseMath_ReadCallback(plene_co) == -1 ||
+ BaseMath_ReadCallback(plane_no) == -1)
{
return NULL;
}
@@ -923,13 +923,13 @@ static PyObject *M_Geometry_barycentric_transform(PyObject *UNUSED(self), PyObje
return NULL;
}
- if ( vec_pt->size != 3 ||
- vec_t1_src->size != 3 ||
- vec_t2_src->size != 3 ||
- vec_t3_src->size != 3 ||
- vec_t1_tar->size != 3 ||
- vec_t2_tar->size != 3 ||
- vec_t3_tar->size != 3)
+ if (vec_pt->size != 3 ||
+ vec_t1_src->size != 3 ||
+ vec_t2_src->size != 3 ||
+ vec_t3_src->size != 3 ||
+ vec_t1_tar->size != 3 ||
+ vec_t2_tar->size != 3 ||
+ vec_t3_tar->size != 3)
{
PyErr_SetString(PyExc_ValueError,
"One of more of the vector arguments wasn't a 3D vector");
@@ -937,8 +937,8 @@ static PyObject *M_Geometry_barycentric_transform(PyObject *UNUSED(self), PyObje
}
barycentric_transform(vec, vec_pt->vec,
- vec_t1_tar->vec, vec_t2_tar->vec, vec_t3_tar->vec,
- vec_t1_src->vec, vec_t2_src->vec, vec_t3_src->vec);
+ vec_t1_tar->vec, vec_t2_tar->vec, vec_t3_tar->vec,
+ vec_t1_src->vec, vec_t2_src->vec, vec_t3_src->vec);
return Vector_CreatePyObject(vec, 3, Py_NEW, NULL);
}
@@ -993,10 +993,10 @@ static PyObject *M_Geometry_interpolate_bezier(PyObject *UNUSED(self), PyObject
return NULL;
}
- if ( BaseMath_ReadCallback(vec_k1) == -1 ||
- BaseMath_ReadCallback(vec_h1) == -1 ||
- BaseMath_ReadCallback(vec_k2) == -1 ||
- BaseMath_ReadCallback(vec_h2) == -1)
+ if (BaseMath_ReadCallback(vec_k1) == -1 ||
+ BaseMath_ReadCallback(vec_h1) == -1 ||
+ BaseMath_ReadCallback(vec_k2) == -1 ||
+ BaseMath_ReadCallback(vec_h2) == -1)
{
return NULL;
}
@@ -1010,7 +1010,7 @@ static PyObject *M_Geometry_interpolate_bezier(PyObject *UNUSED(self), PyObject
coord_array = MEM_callocN(dims * (resolu) * sizeof(float), "interpolate_bezier");
for (i = 0; i < dims; i++) {
- forward_diff_bezier(k1[i], h1[i], h2[i], k2[i], coord_array + i, resolu - 1, sizeof(float)*dims);
+ forward_diff_bezier(k1[i], h1[i], h2[i], k2[i], coord_array + i, resolu - 1, sizeof(float) * dims);
}
list = PyList_New(resolu);
@@ -1023,8 +1023,8 @@ static PyObject *M_Geometry_interpolate_bezier(PyObject *UNUSED(self), PyObject
}
-PyDoc_STRVAR(M_Geometry_tesselate_polygon_doc,
-".. function:: tesselate_polygon(veclist_list)\n"
+PyDoc_STRVAR(M_Geometry_tessellate_polygon_doc,
+".. function:: tessellate_polygon(veclist_list)\n"
"\n"
" Takes a list of polylines (each point a vector) and returns the point indices for a polyline filled with triangles.\n"
"\n"
@@ -1032,7 +1032,7 @@ PyDoc_STRVAR(M_Geometry_tesselate_polygon_doc,
" :rtype: list\n"
);
/* PolyFill function, uses Blenders scanfill to fill multiple poly lines */
-static PyObject *M_Geometry_tesselate_polygon(PyObject *UNUSED(self), PyObject *polyLineSeq)
+static PyObject *M_Geometry_tessellate_polygon(PyObject *UNUSED(self), PyObject *polyLineSeq)
{
PyObject *tri_list; /*return this list of tri's */
PyObject *polyLine, *polyVec;
@@ -1063,7 +1063,7 @@ static PyObject *M_Geometry_tesselate_polygon(PyObject *UNUSED(self), PyObject *
}
len_polypoints = PySequence_Size(polyLine);
- if (len_polypoints > 0) { /* dont bother adding edges as polylines */
+ if (len_polypoints > 0) { /* don't bother adding edges as polylines */
#if 0
if (EXPP_check_sequence_consistency(polyLine, &vector_Type) != 1) {
freedisplist(&dispbase);
@@ -1095,7 +1095,7 @@ static PyObject *M_Geometry_tesselate_polygon(PyObject *UNUSED(self), PyObject *
if (((VectorObject *)polyVec)->size > 2)
fp[2] = ((VectorObject *)polyVec)->vec[2];
else
- fp[2] = 0.0f; /* if its a 2d vector then set the z to be zero */
+ fp[2] = 0.0f; /* if its a 2d vector then set the z to be zero */
}
else {
ls_error = 1;
@@ -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);
@@ -1141,7 +1141,7 @@ static PyObject *M_Geometry_tesselate_polygon(PyObject *UNUSED(self), PyObject *
freedisplist(&dispbase);
}
else {
- /* no points, do this so scripts dont barf */
+ /* no points, do this so scripts don't barf */
freedisplist(&dispbase); /* possible some dl was allocated */
tri_list = PyList_New(0);
}
@@ -1280,7 +1280,7 @@ static PyMethodDef M_Geometry_methods[] = {
{"barycentric_transform", (PyCFunction) M_Geometry_barycentric_transform, METH_VARARGS, M_Geometry_barycentric_transform_doc},
#ifndef MATH_STANDALONE
{"interpolate_bezier", (PyCFunction) M_Geometry_interpolate_bezier, METH_VARARGS, M_Geometry_interpolate_bezier_doc},
- {"tesselate_polygon", (PyCFunction) M_Geometry_tesselate_polygon, METH_O, M_Geometry_tesselate_polygon_doc},
+ {"tessellate_polygon", (PyCFunction) M_Geometry_tessellate_polygon, METH_O, M_Geometry_tessellate_polygon_doc},
{"box_pack_2d", (PyCFunction) M_Geometry_box_pack_2d, METH_O, M_Geometry_box_pack_2d_doc},
#endif
{NULL, NULL, 0, NULL}
diff --git a/source/blender/python/mathutils/mathutils_noise.c b/source/blender/python/mathutils/mathutils_noise.c
index 47e93492e7a..9460c4d0b36 100644
--- a/source/blender/python/mathutils/mathutils_noise.c
+++ b/source/blender/python/mathutils/mathutils_noise.c
@@ -64,61 +64,61 @@
/*-----------------------------------------*/
/* '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
#define M 397
-#define MATRIX_A 0x9908b0dfUL /* constant vector a */
-#define UMASK 0x80000000UL /* most significant w-r bits */
-#define LMASK 0x7fffffffUL /* least significant r bits */
-#define MIXBITS(u,v) (((u) & UMASK) | ((v) & LMASK))
-#define TWIST(u,v) ((MIXBITS(u,v) >> 1) ^ ((v)&1UL ? MATRIX_A : 0UL))
+#define MATRIX_A 0x9908b0dfUL /* constant vector a */
+#define UMASK 0x80000000UL /* most significant w-r bits */
+#define LMASK 0x7fffffffUL /* least significant r bits */
+#define MIXBITS(u, v) (((u) & UMASK) | ((v) & LMASK))
+#define TWIST(u, v) ((MIXBITS(u, v) >> 1) ^ ((v) & 1UL ? MATRIX_A : 0UL))
-static unsigned long state[N]; /* the array for the state vector */
+static unsigned long state[N]; /* the array for the state vector */
static int left = 1;
static int initf = 0;
static unsigned long *next;
@@ -130,13 +130,13 @@ static void init_genrand(unsigned long s)
state[0] = s & 0xffffffffUL;
for (j = 1; j < N; j++) {
state[j] =
- (1812433253UL *
- (state[j - 1] ^ (state[j - 1] >> 30)) + j);
+ (1812433253UL *
+ (state[j - 1] ^ (state[j - 1] >> 30)) + j);
/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
/* In the previous versions, MSBs of the seed affect */
/* only MSBs of the array state[]. */
/* 2002/01/09 modified by Makoto Matsumoto */
- state[j] &= 0xffffffffUL; /* for >32 bit machines */
+ state[j] &= 0xffffffffUL; /* for >32 bit machines */
}
left = 1;
initf = 1;
@@ -199,7 +199,7 @@ static float frand(void)
/* Fills an array of length size with random numbers in the range (-1, 1)*/
static void rand_vn(float *array_tar, const int size)
{
- float *array_pt = array_tar + (size-1);
+ float *array_pt = array_tar + (size - 1);
int i = size;
while (i--) { *(array_pt--) = 2.0f * frand() - 1.0f; }
}
@@ -215,7 +215,7 @@ static void noise_vector(float x, float y, float z, int nb, float v[3])
/* Returns a turbulence value for a given position (x, y, z) */
static float turb(float x, float y, float z, int oct, int hard, int nb,
- float ampscale, float freqscale)
+ float ampscale, float freqscale)
{
float amp, out, t;
int i;
@@ -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"
@@ -334,8 +334,8 @@ PyDoc_STRVAR(M_Noise_random_vector_doc,
);
static PyObject *M_Noise_random_vector(PyObject *UNUSED(self), PyObject *args)
{
- float vec[4]= {0.0f, 0.0f, 0.0f, 0.0f};
- int size= 3;
+ float vec[4] = {0.0f, 0.0f, 0.0f, 0.0f};
+ int size = 3;
if (!PyArg_ParseTuple(args, "|i:random_vector", &size))
return NULL;
@@ -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"
@@ -484,7 +484,7 @@ static PyObject *M_Noise_turbulence_vector(PyObject *UNUSED(self), PyObject *arg
PyObject *value;
float vec[3], r_vec[3];
int oct, hd, nb = 1;
- float as =0.5f, fs = 2.0f;
+ float as = 0.5f, fs = 2.0f;
if (!PyArg_ParseTuple(args, "Oii|iff:turbulence_vector", &value, &oct, &hd, &nb, &as, &fs))
return NULL;
@@ -729,7 +729,7 @@ static PyObject *M_Noise_voronoi(PyObject *UNUSED(self), PyObject *args)
float vec[3];
float da[4], pa[12];
int dtype = 0;
- float me = 2.5f; /* default minkovsky exponent */
+ float me = 2.5f; /* default minkovsky exponent */
int i;
diff --git a/source/blender/python/simple_enum_gen.py b/source/blender/python/simple_enum_gen.py
index ec2eead522c..7e54f3dbb41 100644
--- a/source/blender/python/simple_enum_gen.py
+++ b/source/blender/python/simple_enum_gen.py
@@ -40,7 +40,7 @@ defs = """
"""
print '\tmod = PyModule_New("dummy");'
-print '\tPyModule_AddObject( submodule, "key", mod );'
+print '\tPyModule_AddObject(submodule, "key", mod);'
for d in defs.split('\n'):
@@ -58,7 +58,7 @@ for d in defs.split('\n'):
val = w[0]
py_val = w[0]
- print '\tPyModule_AddObject( mod, "%s", PyLong_FromSize_t(%s) );' % (val, py_val)
+ print '\tPyModule_AddObject(mod, "%s", PyLong_FromSize_t(%s));' % (val, py_val)
diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m
index db47952e45f..b4a89eae89e 100644
--- a/source/blender/quicktime/apple/qtkit_export.m
+++ b/source/blender/quicktime/apple/qtkit_export.m
@@ -243,7 +243,7 @@ void filepath_qt(char *string, RenderData *rd)
BLI_make_existing_file(string);
if (!BLI_testextensie(string, ".mov")) {
- /* if we dont have any #'s to insert numbers into, use 4 numbers by default */
+ /* if we don't have any #'s to insert numbers into, use 4 numbers by default */
if (strchr(string, '#')==NULL)
strcat(string, "####"); /* 4 numbers */
@@ -485,7 +485,8 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R
qtexport->audioFile = NULL;
[qtexport->audioFileName release];
qtexport->audioFileName = nil;
- } else {
+ }
+ else {
UInt32 prop,propSize;
/* Set up codec properties */
if (rd->qtcodecsettings.audiocodecType == kAudioFormatMPEG4AAC) { /*Lossy compressed format*/
@@ -535,7 +536,8 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R
qtexport->movie = [[QTMovie alloc] initToWritableFile:qtexport->videoTempFileName error:&error];
}
- } else
+ }
+ else
qtexport->movie = [[QTMovie alloc] initToWritableFile:qtexport->filename error:&error];
if(qtexport->movie == nil) {
@@ -548,7 +550,8 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R
if (qtexport->videoTempFileName) [qtexport->videoTempFileName release];
qtexport->videoTempFileName = nil;
[QTMovie exitQTKitOnThread];
- } else {
+ }
+ else {
[qtexport->movie retain];
[qtexport->movie setAttribute:[NSNumber numberWithBool:YES] forKey:QTMovieEditableAttribute];
[qtexport->movie setAttribute:@"Made with Blender" forKey:QTMovieCopyrightAttribute];
@@ -661,7 +664,8 @@ int append_qt(struct RenderData *rd, int start_frame, int frame, int *pixels, in
if (qtexport->audioOutputFormat.mFramesPerPacket) {
// this is the common case: format has constant frames per packet
qtexport->audioTotalSavedFrames += (audioPacketsConverted * qtexport->audioOutputFormat.mFramesPerPacket);
- } else {
+ }
+ else {
unsigned int i;
// if there are variable frames per packet, then we have to do this for each packeet
for (i = 0; i < audioPacketsConverted; ++i)
diff --git a/source/blender/quicktime/apple/qtkit_import.m b/source/blender/quicktime/apple/qtkit_import.m
index 633d92e05c1..197cbdc2f0b 100644
--- a/source/blender/quicktime/apple/qtkit_import.m
+++ b/source/blender/quicktime/apple/qtkit_import.m
@@ -81,7 +81,7 @@ int anim_is_quicktime (const char *name)
{
NSAutoreleasePool *pool;
- // dont let quicktime movie import handle these
+ // don't let quicktime movie import handle these
if( BLI_testextensie(name, ".swf") ||
BLI_testextensie(name, ".txt") ||
BLI_testextensie(name, ".mpg") ||
@@ -396,7 +396,7 @@ int imb_is_a_quicktime (char *name)
pool = [[NSAutoreleasePool alloc] init];
- // dont let quicktime image import handle these
+ // don't let quicktime image import handle these
if( BLI_testextensie(name, ".swf") ||
BLI_testextensie(name, ".txt") ||
BLI_testextensie(name, ".mpg") ||
diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c
index 6a4413fdc8d..599268b225a 100644
--- a/source/blender/quicktime/apple/quicktime_export.c
+++ b/source/blender/quicktime/apple/quicktime_export.c
@@ -187,7 +187,7 @@ int quicktime_videocodecType_from_rnatmpvalue(int rnatmpvalue)
static void CheckError(OSErr err, char *msg, ReportList *reports)
{
- if(err != noErr) {
+ if (err != noErr) {
BKE_reportf(reports, RPT_ERROR, "%s: %d", msg, err);
}
}
@@ -207,7 +207,8 @@ static OSErr QT_SaveCodecSettingsToScene(RenderData *rd, ReportList *reports)
// check if current scene already has qtcodec settings, and clear them
if (qcd) {
free_qtcodecdata(qcd);
- } else {
+ }
+ else {
qcd = rd->qtcodecdata = MEM_callocN(sizeof(QuicktimeCodecData), "QuicktimeCodecData");
}
@@ -237,7 +238,8 @@ static OSErr QT_SaveCodecSettingsToScene(RenderData *rd, ReportList *reports)
qcd->cdSize = mySize;
GetCodecInfo (&ci, qtdata->gSpatialSettings.codecType, 0);
- } else {
+ }
+ else {
BKE_reportf(reports, RPT_ERROR, "Quicktime: QT_SaveCodecSettingsToScene failed\n");
}
@@ -265,7 +267,7 @@ static OSErr QT_GetCodecSettingsFromScene(RenderData *rd, ReportList *reports)
}
// restore codecsettings to the quicktime component
- if(qcd->cdParms && qcd->cdSize) {
+ if (qcd->cdParms && qcd->cdSize) {
myErr = SCSetSettingsFromAtomContainer((GraphicsExportComponent)qtdata->theComponent, (QTAtomContainer)myHandle);
if (myErr != noErr) {
BKE_reportf(reports, RPT_ERROR, "Quicktime: SCSetSettingsFromAtomContainer failed\n");
@@ -293,7 +295,8 @@ static OSErr QT_GetCodecSettingsFromScene(RenderData *rd, ReportList *reports)
rd->qtcodecsettings.minTemporalQuality = (qtdata->aDataRateSetting.minTemporalQuality * 100) / codecLosslessQuality;
//Frame duration is already known (qtdata->aDataRateSetting.frameDuration)
- } else {
+ }
+ else {
BKE_reportf(reports, RPT_ERROR, "Quicktime: QT_GetCodecSettingsFromScene failed\n");
}
bail:
@@ -411,8 +414,8 @@ static void QT_StartAddVideoSamplesToMedia (const Rect *trackFrame, int rectx, i
// the new callback based api for proper encoding, but that's not
// really compatible with rendering out frames sequentially
gTemporalSettings = qtdata->gTemporalSettings;
- if(qtdata->gSpatialSettings.codecType == kH264CodecType) {
- if(gTemporalSettings.temporalQuality != codecMinQuality) {
+ if (qtdata->gSpatialSettings.codecType == kH264CodecType) {
+ if (gTemporalSettings.temporalQuality != codecMinQuality) {
BKE_reportf(reports, RPT_WARNING, "Only minimum quality compression supported for QuickTime H.264.\n");
gTemporalSettings.temporalQuality = codecMinQuality;
}
@@ -455,7 +458,7 @@ static void QT_DoAddVideoSamplesToMedia (int frame, int *pixels, int rectx, int
//parse RGBA bitmap into Quicktime's ARGB GWorld
boxsize = rectx * recty;
- for( index = 0; index < boxsize; index++) {
+ for ( index = 0; index < boxsize; index++) {
to[0] = from[3];
to[1] = from[0];
to[2] = from[1];
@@ -533,18 +536,19 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R
#endif
int success= 1;
- if(qtexport == NULL) qtexport = MEM_callocN(sizeof(QuicktimeExport), "QuicktimeExport");
+ if (qtexport == NULL) qtexport = MEM_callocN(sizeof(QuicktimeExport), "QuicktimeExport");
- if(qtdata) {
- if(qtdata->theComponent) CloseComponent(qtdata->theComponent);
+ if (qtdata) {
+ if (qtdata->theComponent) CloseComponent(qtdata->theComponent);
free_qtcomponentdata();
}
qtdata = MEM_callocN(sizeof(QuicktimeComponentData), "QuicktimeCodecDataExt");
- if(rd->qtcodecdata == NULL || rd->qtcodecdata->cdParms == NULL) {
+ if (rd->qtcodecdata == NULL || rd->qtcodecdata->cdParms == NULL) {
get_qtcodec_settings(rd, reports);
- } else {
+ }
+ else {
qtdata->theComponent = OpenDefaultComponent(StandardCompressionType, StandardCompressionSubType);
QT_GetCodecSettingsFromScene(rd, reports);
@@ -589,13 +593,14 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R
&qtexport->theMovie );
CheckError(err, "CreateMovieFile error", reports);
- if(err != noErr) {
+ if (err != noErr) {
BKE_reportf(reports, RPT_ERROR, "Unable to create Quicktime movie: %s", name);
success= 0;
#ifdef __APPLE__
ExitMoviesOnThread();
#endif
- } else {
+ }
+ else {
//printf("Created QuickTime movie: %s\n", name);
QT_CreateMyVideoTrack(rectx, recty, reports);
@@ -617,7 +622,7 @@ void end_qt(void)
OSErr err = noErr;
short resId = movieInDataForkResID;
- if(qtexport->theMovie) {
+ if (qtexport->theMovie) {
QT_EndCreateMyVideoTrack(NULL);
err = AddMovieResource (qtexport->theMovie, qtexport->resRefNum, &resId, qtexport->qtfilename);
@@ -629,7 +634,7 @@ void end_qt(void)
err = UpdateMovieResource(qtexport->theMovie, qtexport->resRefNum, resId, qtexport->qtfilename);
CheckError(err, "UpdateMovieResource error", NULL);
- if(qtexport->resRefNum) CloseMovieFile(qtexport->resRefNum);
+ if (qtexport->resRefNum) CloseMovieFile(qtexport->resRefNum);
DisposeMovie(qtexport->theMovie);
@@ -640,7 +645,7 @@ void end_qt(void)
ExitMoviesOnThread();
#endif
- if(qtexport) {
+ if (qtexport) {
MEM_freeN(qtexport);
qtexport = NULL;
}
@@ -649,8 +654,8 @@ void end_qt(void)
void free_qtcomponentdata(void)
{
- if(qtdata) {
- if(qtdata->theComponent) CloseComponent(qtdata->theComponent);
+ if (qtdata) {
+ if (qtdata->theComponent) CloseComponent(qtdata->theComponent);
MEM_freeN(qtdata);
qtdata = NULL;
}
@@ -665,7 +670,7 @@ static void check_renderbutton_framerate(RenderData *rd, ReportList *reports)
err = SCGetInfo(qtdata->theComponent, scTemporalSettingsType, &qtdata->gTemporalSettings);
CheckError(err, "SCGetInfo fr error", reports);
- if( (rd->frs_sec == 24 || rd->frs_sec == 30 || rd->frs_sec == 60) &&
+ if ( (rd->frs_sec == 24 || rd->frs_sec == 30 || rd->frs_sec == 60) &&
(qtdata->gTemporalSettings.frameRate == 1571553 ||
qtdata->gTemporalSettings.frameRate == 1964113 ||
qtdata->gTemporalSettings.frameRate == 3928227))
@@ -681,16 +686,19 @@ static void check_renderbutton_framerate(RenderData *rd, ReportList *reports)
err = SCSetInfo(qtdata->theComponent, scTemporalSettingsType, &qtdata->gTemporalSettings);
CheckError( err, "SCSetInfo error", reports );
- if(qtdata->gTemporalSettings.frameRate == 1571553) { // 23.98 fps
+ if (qtdata->gTemporalSettings.frameRate == 1571553) { // 23.98 fps
qtdata->kVideoTimeScale = 24000;
qtdata->duration = 1001;
- } else if (qtdata->gTemporalSettings.frameRate == 1964113) { // 29.97 fps
+ }
+ else if (qtdata->gTemporalSettings.frameRate == 1964113) { // 29.97 fps
qtdata->kVideoTimeScale = 30000;
qtdata->duration = 1001;
- } else if (qtdata->gTemporalSettings.frameRate == 3928227) { // 59.94 fps
+ }
+ else if (qtdata->gTemporalSettings.frameRate == 3928227) { // 59.94 fps
qtdata->kVideoTimeScale = 60000;
qtdata->duration = 1001;
- } else {
+ }
+ else {
qtdata->kVideoTimeScale = (qtdata->gTemporalSettings.frameRate >> 16) * 100;
qtdata->duration = 100;
}
@@ -717,8 +725,8 @@ int get_qtcodec_settings(RenderData *rd, ReportList *reports)
{
OSErr err = noErr;
// erase any existing codecsetting
- if(qtdata) {
- if(qtdata->theComponent) CloseComponent(qtdata->theComponent);
+ if (qtdata) {
+ if (qtdata->theComponent) CloseComponent(qtdata->theComponent);
free_qtcomponentdata();
}
@@ -727,9 +735,10 @@ int get_qtcodec_settings(RenderData *rd, ReportList *reports)
qtdata->theComponent = OpenDefaultComponent(StandardCompressionType, StandardCompressionSubType);
// get previous selected codecsetting, from qtatom or detailed settings
- if(rd->qtcodecdata && rd->qtcodecdata->cdParms) {
+ if (rd->qtcodecdata && rd->qtcodecdata->cdParms) {
QT_GetCodecSettingsFromScene(rd, reports);
- } else {
+ }
+ else {
SCGetInfo(qtdata->theComponent, scDataRateSettingsType, &qtdata->aDataRateSetting);
SCGetInfo(qtdata->theComponent, scSpatialSettingsType, &qtdata->gSpatialSettings);
SCGetInfo(qtdata->theComponent, scTemporalSettingsType, &qtdata->gTemporalSettings);
@@ -768,8 +777,8 @@ static int request_qtcodec_settings(bContext *C, wmOperator *op)
RenderData *rd = &scene->r;
// erase any existing codecsetting
- if(qtdata) {
- if(qtdata->theComponent) CloseComponent(qtdata->theComponent);
+ if (qtdata) {
+ if (qtdata->theComponent) CloseComponent(qtdata->theComponent);
free_qtcomponentdata();
}
@@ -778,9 +787,10 @@ static int request_qtcodec_settings(bContext *C, wmOperator *op)
qtdata->theComponent = OpenDefaultComponent(StandardCompressionType, StandardCompressionSubType);
// get previous selected codecsetting, from qtatom or detailed settings
- if(rd->qtcodecdata && rd->qtcodecdata->cdParms) {
+ if (rd->qtcodecdata && rd->qtcodecdata->cdParms) {
QT_GetCodecSettingsFromScene(rd, op->reports);
- } else {
+ }
+ else {
SCGetInfo(qtdata->theComponent, scDataRateSettingsType, &qtdata->aDataRateSetting);
SCGetInfo(qtdata->theComponent, scSpatialSettingsType, &qtdata->gSpatialSettings);
SCGetInfo(qtdata->theComponent, scTemporalSettingsType, &qtdata->gTemporalSettings);
@@ -836,25 +846,28 @@ static int request_qtcodec_settings(bContext *C, wmOperator *op)
QT_SaveCodecSettingsToScene(rd, op->reports);
// framerate jugglin'
- if(qtdata->gTemporalSettings.frameRate == 1571553) { // 23.98 fps
+ if (qtdata->gTemporalSettings.frameRate == 1571553) { // 23.98 fps
qtdata->kVideoTimeScale = 24000;
qtdata->duration = 1001;
rd->frs_sec = 24;
rd->frs_sec_base = 1.001;
- } else if (qtdata->gTemporalSettings.frameRate == 1964113) { // 29.97 fps
+ }
+ else if (qtdata->gTemporalSettings.frameRate == 1964113) { // 29.97 fps
qtdata->kVideoTimeScale = 30000;
qtdata->duration = 1001;
rd->frs_sec = 30;
rd->frs_sec_base = 1.001;
- } else if (qtdata->gTemporalSettings.frameRate == 3928227) { // 59.94 fps
+ }
+ else if (qtdata->gTemporalSettings.frameRate == 3928227) { // 59.94 fps
qtdata->kVideoTimeScale = 60000;
qtdata->duration = 1001;
rd->frs_sec = 60;
rd->frs_sec_base = 1.001;
- } else {
+ }
+ else {
double fps = qtdata->gTemporalSettings.frameRate;
qtdata->kVideoTimeScale = 60000;
@@ -863,7 +876,8 @@ static int request_qtcodec_settings(bContext *C, wmOperator *op)
if ((qtdata->gTemporalSettings.frameRate & 0xffff) == 0) {
rd->frs_sec = fps / 65536;
rd->frs_sec_base = 1.0;
- } else {
+ }
+ else {
/* we do our very best... */
rd->frs_sec = fps / 65536;
rd->frs_sec_base = 1.0;
@@ -893,20 +907,20 @@ int fromcocoa_request_qtcodec_settings(bContext *C, wmOperator *op)
void SCENE_OT_render_data_set_quicktime_codec(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Change codec";
- ot->description= "Change Quicktime codec Settings";
- ot->idname= "SCENE_OT_render_data_set_quicktime_codec";
+ ot->name = "Change codec";
+ ot->description = "Change Quicktime codec Settings";
+ ot->idname = "SCENE_OT_render_data_set_quicktime_codec";
/* api callbacks */
#if defined(__APPLE__) && defined(GHOST_COCOA)
ot->exec = cocoa_request_qtcodec_settings;
#else
- ot->exec= request_qtcodec_settings;
+ ot->exec = request_qtcodec_settings;
#endif
- ot->poll= ED_operator_setqtcodec;
+ ot->poll = ED_operator_setqtcodec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
#endif /* USE_QTKIT */
diff --git a/source/blender/quicktime/apple/quicktime_import.c b/source/blender/quicktime/apple/quicktime_import.c
index a7d09682a14..a1f35935877 100644
--- a/source/blender/quicktime/apple/quicktime_import.c
+++ b/source/blender/quicktime/apple/quicktime_import.c
@@ -125,7 +125,7 @@ void quicktime_exit(void)
{
#if defined(_WIN32) || defined(__APPLE__)
#ifdef WITH_QUICKTIME
- if(G.have_quicktime) {
+ if (G.have_quicktime) {
free_qtcomponentdata();
ExitMovies();
#ifdef _WIN32
@@ -147,22 +147,24 @@ char *get_valid_qtname(char *name)
dwRet = GetCurrentDirectory(MAX_PATH, Buffer);
- if(name[1] != ':') {
+ if (name[1] != ':') {
char drive[2];
- if(name[0] == '/' || name[0] == '\\') {
+ if (name[0] == '/' || name[0] == '\\') {
drive[0] = Buffer[0];
drive[1] = '\0';
BLI_dynstr_append(ds, drive);
BLI_dynstr_append(ds, ":");
BLI_dynstr_append(ds, name);
- } else {
+ }
+ else {
BLI_dynstr_append(ds, Buffer);
BLI_dynstr_append(ds, "/");
BLI_dynstr_append(ds, name);
}
- } else {
+ }
+ else {
BLI_dynstr_append(ds, name);
}
@@ -191,8 +193,8 @@ int anim_is_quicktime (const char *name)
#endif
OSErr err = noErr;
- // dont let quicktime movie import handle these
- if( BLI_testextensie(name, ".swf") ||
+ // don't let quicktime movie import handle these
+ if ( BLI_testextensie(name, ".swf") ||
BLI_testextensie(name, ".txt") ||
BLI_testextensie(name, ".mpg") ||
BLI_testextensie(name, ".avi") || // wouldnt be appropriate ;)
@@ -204,7 +206,7 @@ int anim_is_quicktime (const char *name)
BLI_testextensie(name, ".zip") ||
BLI_testextensie(name, ".mp3")) return 0;
- if(QTIME_DEBUG) printf("qt: checking as movie: %s\n", name);
+ if (QTIME_DEBUG) printf("qt: checking as movie: %s\n", name);
#ifdef __APPLE__
sprintf(theFullPath, "%s", name);
@@ -257,16 +259,16 @@ void free_anim_quicktime (struct anim *anim)
UnlockPixels(anim->qtime->offscreenPixMap);
- if(anim->qtime->have_gw)
+ if (anim->qtime->have_gw)
DisposeGWorld( anim->qtime->offscreenGWorld );
- if(anim->qtime->ibuf)
+ if (anim->qtime->ibuf)
IMB_freeImBuf(anim->qtime->ibuf);
DisposeMovie( anim->qtime->movie );
CloseMovieFile( anim->qtime->movieRefNum );
- if(anim->qtime->frameIndex) MEM_freeN (anim->qtime->frameIndex);
- if(anim->qtime) MEM_freeN (anim->qtime);
+ if (anim->qtime->frameIndex) MEM_freeN (anim->qtime->frameIndex);
+ if (anim->qtime) MEM_freeN (anim->qtime);
anim->qtime = NULL;
@@ -305,7 +307,7 @@ static OSErr QT_get_frameIndexes(struct anim *anim)
GetMovieNextInterestingTime(anim->qtime->movie, nextTimeMediaSample, 1, &media, (TimeValue)1, 0, &tmpstartPoint, NULL);
anim->qtime->frameIndex[0] = startPoint;
- for(i = 1; i < anim->qtime->framecount; i++) {
+ for (i = 1; i < anim->qtime->framecount; i++) {
nextTime = 0;
GetMovieNextInterestingTime(anim->qtime->movie, nextTimeMediaSample, 1, &media, startPoint, 0, &nextTime, NULL);
startPoint = nextTime;
@@ -367,7 +369,7 @@ ImBuf * qtime_fetchibuf (struct anim *anim, int position)
from= (unsigned char *)readPos;
to= (unsigned char *)changePos;
- for( index = 0; index < boxsize; index++, from+=4, to+=4 ) {
+ for ( index = 0; index < boxsize; index++, from+=4, to+=4 ) {
to[3] = from[0];
to[0] = from[1];
to[1] = from[2];
@@ -376,14 +378,14 @@ ImBuf * qtime_fetchibuf (struct anim *anim, int position)
#endif
#ifdef _WIN32
- for( index = 0; index < boxsize; index++, changePos++, readPos++ )
+ for ( index = 0; index < boxsize; index++, changePos++, readPos++ )
*( changePos ) = *(readPos );
- if(anim->qtime->depth < 32) {
+ if (anim->qtime->depth < 32) {
//add alpha to ibuf
boxsize = anim->x * anim->y * 4;
crect = (unsigned char *) rect;
- for( index = 0; index < boxsize; index+=4, crect+=4 ) {
+ for ( index = 0; index < boxsize; index+=4, crect+=4 ) {
crect[3] = 0xFF;
}
}
@@ -425,7 +427,7 @@ static short GetFirstVideoTrackPixelDepth(struct anim *anim)
SampleDescriptionHandle imageDescH = (SampleDescriptionHandle)NewHandle(sizeof(Handle));
// long trackIndex = 0; /*unused*/
- if(!GetFirstVideoMedia(anim))
+ if (!GetFirstVideoMedia(anim))
return -1;
if (!anim->qtime->trackIndex || !anim->qtime->theMedia) return -1; // we need both
@@ -453,11 +455,11 @@ int startquicktime (struct anim *anim)
anim->qtime->have_gw = FALSE;
if (anim->qtime == NULL) {
- if(QTIME_DEBUG) printf("Can't alloc qtime: %s\n", anim->name);
+ if (QTIME_DEBUG) printf("Can't alloc qtime: %s\n", anim->name);
return -1;
}
- if(QTIME_DEBUG) printf("qt: attempting to load as movie %s\n", anim->name);
+ if (QTIME_DEBUG) printf("qt: attempting to load as movie %s\n", anim->name);
#ifdef __APPLE__
sprintf(theFullPath, "%s", anim->name);
@@ -476,18 +478,18 @@ int startquicktime (struct anim *anim)
err = OpenMovieFile(&theFSSpec, &anim->qtime->movieRefNum, fsRdPerm);
if (err == noErr) {
- if(QTIME_DEBUG) printf("qt: movie opened\n");
+ if (QTIME_DEBUG) printf("qt: movie opened\n");
err = NewMovieFromFile(&anim->qtime->movie,
anim->qtime->movieRefNum,
&anim->qtime->movieResId, NULL, newMovieActive, NULL);
}
if (err) {
- if(QTIME_DEBUG) printf("qt: bad movie %s\n", anim->name);
+ if (QTIME_DEBUG) printf("qt: bad movie %s\n", anim->name);
if (anim->qtime->movie) {
DisposeMovie(anim->qtime->movie);
MEM_freeN(anim->qtime);
- if(QTIME_DEBUG) printf("qt: can't load %s\n", anim->name);
+ if (QTIME_DEBUG) printf("qt: can't load %s\n", anim->name);
return -1;
}
}
@@ -495,10 +497,10 @@ int startquicktime (struct anim *anim)
GetMovieBox(anim->qtime->movie, &anim->qtime->movieBounds);
anim->x = anim->qtime->movWidth = RECT_WIDTH(anim->qtime->movieBounds);
anim->y = anim->qtime->movHeight = RECT_HEIGHT(anim->qtime->movieBounds);
- if(QTIME_DEBUG) printf("qt: got bounds %s\n", anim->name);
+ if (QTIME_DEBUG) printf("qt: got bounds %s\n", anim->name);
- if(anim->x == 0 && anim->y == 0) {
- if(QTIME_DEBUG) printf("qt: error, no dimensions\n");
+ if (anim->x == 0 && anim->y == 0) {
+ if (QTIME_DEBUG) printf("qt: error, no dimensions\n");
free_anim_quicktime(anim);
return -1;
}
@@ -521,7 +523,7 @@ int startquicktime (struct anim *anim)
anim->x * 4);
#endif /* _WIN32 */
- if(err == noErr) {
+ if (err == noErr) {
anim->qtime->have_gw = TRUE;
SetMovieGWorld(anim->qtime->movie,
@@ -550,7 +552,7 @@ int startquicktime (struct anim *anim)
anim->curposition = 0;
- if(QTIME_DEBUG) printf("qt: load %s %dx%dx%d frames %d\n", anim->name, anim->qtime->movWidth,
+ if (QTIME_DEBUG) printf("qt: load %s %dx%dx%d frames %d\n", anim->name, anim->qtime->movWidth,
anim->qtime->movHeight, anim->qtime->depth, anim->qtime->framecount);
return 0;
@@ -575,12 +577,12 @@ int imb_is_a_quicktime (char *name)
#endif
OSErr err = noErr;
- if(!G.have_quicktime) return 0;
+ if (!G.have_quicktime) return 0;
- if(QTIME_DEBUG) printf("qt: checking as image %s\n", name);
+ if (QTIME_DEBUG) printf("qt: checking as image %s\n", name);
- // dont let quicktime image import handle these
- if( BLI_testextensie(name, ".swf") ||
+ // don't let quicktime image import handle these
+ if ( BLI_testextensie(name, ".swf") ||
BLI_testextensie(name, ".txt") ||
BLI_testextensie(name, ".mpg") ||
BLI_testextensie(name, ".wav") ||
@@ -600,7 +602,7 @@ int imb_is_a_quicktime (char *name)
GetGraphicsImporterForFile(&theFSSpec, &theImporter);
if (theImporter != NULL) {
- if(QTIME_DEBUG) printf("qt: %s valid\n", name);
+ if (QTIME_DEBUG) printf("qt: %s valid\n", name);
CloseComponent(theImporter);
return 1;
}
@@ -643,7 +645,7 @@ ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags)
if (mem == NULL || !G.have_quicktime)
goto bail;
- if(QTIME_DEBUG) printf("qt: attempt to load mem as image\n");
+ if (QTIME_DEBUG) printf("qt: attempt to load mem as image\n");
dataref= (PointerDataRef)NewHandle(sizeof(PointerDataRefRecord));
(**dataref).data = mem;
@@ -657,25 +659,25 @@ ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags)
kDataHCanRead,
&dataHandler);
if (err != noErr) {
- if(QTIME_DEBUG) printf("no datahandler\n");
+ if (QTIME_DEBUG) printf("no datahandler\n");
goto bail;
}
err = GetGraphicsImporterForDataRef((Handle)dataref, PointerDataHandlerSubType, &gImporter);
if (err != noErr) {
- if(QTIME_DEBUG) printf("no graphimport\n");
+ if (QTIME_DEBUG) printf("no graphimport\n");
goto bail;
}
err = GraphicsImportGetNaturalBounds(gImporter, &myRect);
if (err != noErr) {
- if(QTIME_DEBUG) printf("no bounds\n");
+ if (QTIME_DEBUG) printf("no bounds\n");
goto bail;
}
err = GraphicsImportGetImageDescription (gImporter, &desc );
if (err != noErr) {
- if(QTIME_DEBUG) printf("no imagedescription\n");
+ if (QTIME_DEBUG) printf("no imagedescription\n");
goto bail;
}
@@ -710,9 +712,10 @@ ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags)
#endif
if (err != noErr) {
- if(QTIME_DEBUG) printf("no newgworld\n");
+ if (QTIME_DEBUG) printf("no newgworld\n");
goto bail;
- } else {
+ }
+ else {
have_gw = TRUE;
}
@@ -740,7 +743,7 @@ ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags)
from= (unsigned char *)readPos;
to= (unsigned char *)changePos;
- for( index = 0; index < boxsize; index++, from+=4, to+=4 ) {
+ for ( index = 0; index < boxsize; index++, from+=4, to+=4 ) {
to[3] = from[0];
to[0] = from[1];
to[1] = from[2];
@@ -752,7 +755,7 @@ bail:
DisposeHandle((Handle)dataref);
UnlockPixels(myPixMap);
- if(have_gw) DisposeGWorld(offGWorld);
+ if (have_gw) DisposeGWorld(offGWorld);
#ifdef __APPLE__
if (wbuf) {
@@ -764,14 +767,14 @@ bail:
if (gImporter != NULL) CloseComponent(gImporter);
if (err != noErr) {
- if(QTIME_DEBUG) printf("quicktime import unsuccesfull\n");
+ if (QTIME_DEBUG) printf("quicktime import unsuccesfull\n");
if (ibuf) {
IMB_freeImBuf (ibuf);
ibuf = NULL;
}
}
- if(ibuf) {
+ if (ibuf) {
#ifdef _WIN32
// add non transparent alpha layer, so images without alpha show up in the sequence editor
@@ -781,8 +784,8 @@ bail:
int box = x * y;
unsigned char *arect = (unsigned char *) ibuf->rect;
- if( depth < 32 && (**desc).cType != kGIFCodecType) {
- for(i = 0; i < box; i++, arect+=4)
+ if ( depth < 32 && (**desc).cType != kGIFCodecType) {
+ for (i = 0; i < box; i++, arect+=4)
arect[3] = 0xFF;
}
#endif
diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt
index 51c5d49208e..a2d6e27bcb7 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 99ff10d19eb..53af2f9b2c2 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'
cflags_raytrace = env['CCFLAGS']
diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h
index a670446189e..315995475e9 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;
@@ -165,6 +165,8 @@ void RE_InitRenderCB(struct Render *re);
void RE_FreeRender (struct Render *re);
/* only called on exit */
void RE_FreeAllRender (void);
+/* only call on file load */
+void RE_FreeAllRenderResults(void);
/* get results and statistics */
void RE_FreeRenderResult(struct RenderResult *rr);
diff --git a/source/blender/render/intern/include/gammaCorrectionTables.h b/source/blender/render/intern/include/gammaCorrectionTables.h
index b41fc01eaaf..0df4248612b 100644
--- a/source/blender/render/intern/include/gammaCorrectionTables.h
+++ b/source/blender/render/intern/include/gammaCorrectionTables.h
@@ -37,7 +37,7 @@
#define __GAMMACORRECTIONTABLES_H__
/**
- * Initialise the gamma lookup tables
+ * Initialize the gamma lookup tables
*/
void makeGammaTables(float gamma);
diff --git a/source/blender/render/intern/include/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 17032283540..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__
@@ -46,7 +41,7 @@
* t[3] - type ZB_POLY or ZB_HALO
* t[4] - max. distance
* mask is pixel coverage in bits
- * @return pointer to the object
+ * \return pointer to the object
*/
int shadeHaloFloat(HaloRen *har,
float *col, int zz,
diff --git a/source/blender/render/intern/include/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 c93c4e1da63..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 dependant 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 886a6ce74f2..74255560025 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 */
@@ -190,7 +190,7 @@ struct Render
struct RayObject *raytree;
struct RayFace *rayfaces;
struct VlakPrimitive *rayprimitives;
- float maxdist; /* needed for keeping an incorrect behaviour of SUN and HEMI lights (avoid breaking old scenes) */
+ float maxdist; /* needed for keeping an incorrect behavior of SUN and HEMI lights (avoid breaking old scenes) */
/* occlusion tree */
void *occlusiontree;
@@ -229,8 +229,8 @@ struct Render
ListBase volume_precache_parts;
/* 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/shadbuf.h b/source/blender/render/intern/include/shadbuf.h
index ddcfc555f7a..4b3595a009f 100644
--- a/source/blender/render/intern/include/shadbuf.h
+++ b/source/blender/render/intern/include/shadbuf.h
@@ -42,7 +42,7 @@ struct ObjectRen;
/**
* Calculates shadowbuffers for a vector of shadow-giving lamps
- * @param lar The vector of lamps
+ * \param lar The vector of lamps
*/
void makeshadowbuf(struct Render *re, LampRen *lar);
void freeshadowbuf(struct LampRen *lar);
@@ -52,10 +52,10 @@ void threaded_makeshadowbufs(struct Render *re);
/**
* Determines the shadow factor for a face and lamp. There is some
* communication with global variables here.
- * @returns The shadow factors: 1.0 for no shadow, 0.0 for complete
- * shadow.
- * @param shb The shadowbuffer to find the shadow factor in.
- * @param inp The inproduct between viewvector and ?
+ * \return The shadow factors: 1.0 for no shadow, 0.0 for complete
+ * shadow.
+ * \param shb The shadowbuffer to find the shadow factor in.
+ * \param inp The inproduct between viewvector and ?
*
*/
float testshadowbuf(struct Render *re, struct ShadBuf *shb, const float rco[3], const float dxco[3], const float dyco[3], float inp, float mat_bias);
diff --git a/source/blender/render/intern/include/sunsky.h b/source/blender/render/intern/include/sunsky.h
index 5076a1541af..6a41517b113 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 ef31e730785..b2f85e8429d 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)
@@ -60,7 +60,7 @@ MALWAYS_INLINE RayObject* rayface_from_coords(RayFace *rayface, void *ob, void *
copy_v3_v3(rayface->v2, v2);
copy_v3_v3(rayface->v3, v3);
- if(v4)
+ if (v4)
{
copy_v3_v3(rayface->v4, v4);
rayface->quad = 1;
@@ -75,15 +75,15 @@ MALWAYS_INLINE RayObject* rayface_from_coords(RayFace *rayface, void *ob, void *
MALWAYS_INLINE void rayface_from_vlak(RayFace *rayface, ObjectInstanceRen *obi, VlakRen *vlr)
{
- rayface_from_coords(rayface, obi, vlr, vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->v4 ? vlr->v4->co : 0);
+ rayface_from_coords(rayface, obi, vlr, vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->v4 ? vlr->v4->co : NULL);
- if(obi->transform_primitives)
+ if (obi->transform_primitives)
{
mul_m4_v3(obi->mat, rayface->v1);
mul_m4_v3(obi->mat, rayface->v2);
mul_m4_v3(obi->mat, rayface->v3);
- if(RE_rayface_isQuad(rayface))
+ if (RE_rayface_isQuad(rayface))
mul_m4_v3(obi->mat, rayface->v4);
}
}
@@ -109,11 +109,11 @@ MALWAYS_INLINE int vlr_check_intersect(Isect *is, ObjectInstanceRen *obi, VlakRe
{
/* for baking selected to active non-traceable materials might still
* be in the raytree */
- if(!(vlr->flag & R_TRACEBLE))
+ if (!(vlr->flag & R_TRACEBLE))
return 0;
/* I know... cpu cycle waste, might do smarter once */
- if(is->mode==RE_RAY_MIRROR)
+ if (is->mode==RE_RAY_MIRROR)
return !(vlr->mat->mode & MA_ONLYCAST);
else
return (is->lay & obi->lay);
@@ -159,21 +159,21 @@ MALWAYS_INLINE int isec_tri_quad(float start[3], float dir[3], RayFace *face, fl
sub_v3_v3v3(m, start, co3);
det1= dot_v3v3(m, x);
- if(divdet != 0.0f) {
+ if (divdet != 0.0f) {
divdet= 1.0f/divdet;
v= det1*divdet;
- if(v < RE_RAYTRACE_EPSILON && v > -(1.0f+RE_RAYTRACE_EPSILON)) {
+ if (v < RE_RAYTRACE_EPSILON && v > -(1.0f+RE_RAYTRACE_EPSILON)) {
float cros[3];
cross_v3_v3v3(cros, m, t0);
u= divdet*dot_v3v3(cros, r);
- if(u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f+RE_RAYTRACE_EPSILON)) {
+ if (u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f+RE_RAYTRACE_EPSILON)) {
l= divdet*dot_v3v3(cros, t1);
/* check if intersection is within ray length */
- if(l > -RE_RAYTRACE_EPSILON && l < *lambda) {
+ if (l > -RE_RAYTRACE_EPSILON && l < *lambda) {
uv[0]= u;
uv[1]= v;
*lambda= l;
@@ -184,25 +184,25 @@ MALWAYS_INLINE int isec_tri_quad(float start[3], float dir[3], RayFace *face, fl
}
/* intersect second triangle in quad */
- if(quad) {
+ if (quad) {
copy_v3_v3(co4, face->v4);
sub_v3_v3v3(t0, co3, co4);
divdet= dot_v3v3(t0, x);
- if(divdet != 0.0f) {
+ if (divdet != 0.0f) {
divdet= 1.0f/divdet;
v = det1*divdet;
- if(v < RE_RAYTRACE_EPSILON && v > -(1.0f+RE_RAYTRACE_EPSILON)) {
+ if (v < RE_RAYTRACE_EPSILON && v > -(1.0f+RE_RAYTRACE_EPSILON)) {
float cros[3];
cross_v3_v3v3(cros, m, t0);
u= divdet*dot_v3v3(cros, r);
- if(u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f+RE_RAYTRACE_EPSILON)) {
+ if (u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f+RE_RAYTRACE_EPSILON)) {
l= divdet*dot_v3v3(cros, t1);
- if(l >- RE_RAYTRACE_EPSILON && l < *lambda) {
+ if (l >- RE_RAYTRACE_EPSILON && l < *lambda) {
uv[0]= u;
uv[1]= -(1.0f + v + u);
*lambda= l;
@@ -242,38 +242,38 @@ MALWAYS_INLINE int isec_tri_quad_neighbour(float start[3], float dir[3], RayFace
sub_v3_v3v3(m, start, co3);
det1= dot_v3v3(m, x);
- if(divdet != 0.0f) {
+ if (divdet != 0.0f) {
divdet= 1.0f/divdet;
v= det1*divdet;
- if(v < RE_RAYTRACE_EPSILON && v > -(1.0f+RE_RAYTRACE_EPSILON)) {
+ if (v < RE_RAYTRACE_EPSILON && v > -(1.0f+RE_RAYTRACE_EPSILON)) {
float cros[3];
cross_v3_v3v3(cros, m, t0);
u= divdet*dot_v3v3(cros, r);
- if(u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f+RE_RAYTRACE_EPSILON))
+ if (u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f+RE_RAYTRACE_EPSILON))
return 1;
}
}
/* intersect second triangle in quad */
- if(quad) {
+ if (quad) {
copy_v3_v3(co4, face->v4);
sub_v3_v3v3(t0, co3, co4);
divdet= dot_v3v3(t0, x);
- if(divdet != 0.0f) {
+ if (divdet != 0.0f) {
divdet= 1.0f/divdet;
v = det1*divdet;
- if(v < RE_RAYTRACE_EPSILON && v > -(1.0f+RE_RAYTRACE_EPSILON)) {
+ if (v < RE_RAYTRACE_EPSILON && v > -(1.0f+RE_RAYTRACE_EPSILON)) {
float cros[3];
cross_v3_v3v3(cros, m, t0);
u= divdet*dot_v3v3(cros, r);
- if(u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f+RE_RAYTRACE_EPSILON))
+ if (u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f+RE_RAYTRACE_EPSILON))
return 2;
}
}
@@ -282,8 +282,8 @@ MALWAYS_INLINE int isec_tri_quad_neighbour(float start[3], float dir[3], RayFace
return 0;
}
-/* RayFace intersection with checks and neighbour verifaction included,
- Isect is modified if the face is hit. */
+/* RayFace intersection with checks and neighbor verifaction included,
+ * Isect is modified if the face is hit. */
MALWAYS_INLINE int intersect_rayface(RayObject *hit_obj, RayFace *face, Isect *is)
{
@@ -291,24 +291,24 @@ MALWAYS_INLINE int intersect_rayface(RayObject *hit_obj, RayFace *face, Isect *i
int ok= 0;
/* avoid self-intersection */
- if(is->orig.ob == face->ob && is->orig.face == face->face)
+ if (is->orig.ob == face->ob && is->orig.face == face->face)
return 0;
/* check if we should intersect this face */
- if(is->check == RE_CHECK_VLR_RENDER)
+ if (is->check == RE_CHECK_VLR_RENDER)
{
- if(vlr_check_intersect(is, (ObjectInstanceRen*)face->ob, (VlakRen*)face->face) == 0)
+ if (vlr_check_intersect(is, (ObjectInstanceRen*)face->ob, (VlakRen*)face->face) == 0)
return 0;
}
- else if(is->check == RE_CHECK_VLR_NON_SOLID_MATERIAL)
+ else if (is->check == RE_CHECK_VLR_NON_SOLID_MATERIAL)
{
- if(vlr_check_intersect(is, (ObjectInstanceRen*)face->ob, (VlakRen*)face->face) == 0)
+ if (vlr_check_intersect(is, (ObjectInstanceRen*)face->ob, (VlakRen*)face->face) == 0)
return 0;
- if(vlr_check_intersect_solid(is, (ObjectInstanceRen*)face->ob, (VlakRen*)face->face) == 0)
+ if (vlr_check_intersect_solid(is, (ObjectInstanceRen*)face->ob, (VlakRen*)face->face) == 0)
return 0;
}
- else if(is->check == RE_CHECK_VLR_BAKE) {
- if(vlr_check_bake(is, (ObjectInstanceRen*)face->ob, (VlakRen*)face->face) == 0)
+ else if (is->check == RE_CHECK_VLR_BAKE) {
+ if (vlr_check_bake(is, (ObjectInstanceRen*)face->ob, (VlakRen*)face->face) == 0)
return 0;
}
@@ -318,21 +318,21 @@ MALWAYS_INLINE int intersect_rayface(RayObject *hit_obj, RayFace *face, Isect *i
dist= is->dist;
ok= isec_tri_quad(is->start, is->dir, face, uv, &dist);
- if(ok) {
+ if (ok) {
/* when a shadow ray leaves a face, it can be little outside the edges
- of it, causing intersection to be detected in its neighbour face */
- if(is->skip & RE_SKIP_VLR_NEIGHBOUR)
+ * 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)
+ if (dist < 0.1f && is->orig.ob == face->ob)
{
VlakRen * a = (VlakRen*)is->orig.face;
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 */
- if(a->v1==b->v1 || a->v2==b->v1 || a->v3==b->v1 || a->v4==b->v1
+ * 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
|| (b->v4 && (a->v1==b->v4 || a->v2==b->v4 || a->v3==b->v4 || a->v4==b->v4))) {
@@ -341,7 +341,7 @@ MALWAYS_INLINE int intersect_rayface(RayObject *hit_obj, RayFace *face, Isect *i
ObjectInstanceRen *ob= (ObjectInstanceRen*)is->orig.ob;
rayface_from_vlak(&origface, ob, (VlakRen*)is->orig.face);
- if(!isec_tri_quad_neighbour(is->start, is->dir, &origface))
+ if (!isec_tri_quad_neighbour(is->start, is->dir, &origface))
{
return 0;
}
@@ -375,7 +375,7 @@ int RE_rayobject_raycast(RayObject *r, Isect *isec)
RE_RC_COUNT(isec->raycounter->raycast.test);
/* setup vars used on raycast */
- for(i=0; i<3; i++)
+ for (i=0; i<3; i++)
{
isec->idot_axis[i] = 1.0f / isec->dir[i];
@@ -388,11 +388,11 @@ int RE_rayobject_raycast(RayObject *r, Isect *isec)
#ifdef RT_USE_LAST_HIT
/* last hit heuristic */
- if(isec->mode==RE_RAY_SHADOW && isec->last_hit)
+ if (isec->mode==RE_RAY_SHADOW && isec->last_hit)
{
RE_RC_COUNT(isec->raycounter->rayshadow_last_hit.test);
- if(RE_rayobject_intersect(isec->last_hit, isec))
+ if (RE_rayobject_intersect(isec->last_hit, isec))
{
RE_RC_COUNT(isec->raycounter->raycast.hit);
RE_RC_COUNT(isec->raycounter->rayshadow_last_hit.hit);
@@ -405,7 +405,7 @@ int RE_rayobject_raycast(RayObject *r, Isect *isec)
isec->hit_hint = 0;
#endif
- if(RE_rayobject_intersect(r, isec))
+ if (RE_rayobject_intersect(r, isec))
{
RE_RC_COUNT(isec->raycounter->raycast.hit);
@@ -420,11 +420,11 @@ int RE_rayobject_raycast(RayObject *r, Isect *isec)
int RE_rayobject_intersect(RayObject *r, Isect *i)
{
- if(RE_rayobject_isRayFace(r))
+ if (RE_rayobject_isRayFace(r))
{
return intersect_rayface(r, (RayFace*) RE_rayobject_align(r), i);
}
- else if(RE_rayobject_isVlakPrimitive(r))
+ else if (RE_rayobject_isVlakPrimitive(r))
{
//TODO optimize (useless copy to RayFace to avoid duplicate code)
VlakPrimitive *face = (VlakPrimitive*) RE_rayobject_align(r);
@@ -433,7 +433,7 @@ int RE_rayobject_intersect(RayObject *r, Isect *i)
return intersect_rayface(r, &nface, i);
}
- else if(RE_rayobject_isRayAPI(r))
+ else if (RE_rayobject_isRayAPI(r))
{
r = RE_rayobject_align(r);
return r->api->raycast(r, i);
@@ -466,11 +466,11 @@ void RE_rayobject_free(RayObject *r)
float RE_rayobject_cost(RayObject *r)
{
- if(RE_rayobject_isRayFace(r) || RE_rayobject_isVlakPrimitive(r))
+ if (RE_rayobject_isRayFace(r) || RE_rayobject_isVlakPrimitive(r))
{
return 1.0f;
}
- else if(RE_rayobject_isRayAPI(r))
+ else if (RE_rayobject_isRayAPI(r))
{
r = RE_rayobject_align(r);
return r->api->cost(r);
@@ -485,16 +485,16 @@ float RE_rayobject_cost(RayObject *r)
void RE_rayobject_merge_bb(RayObject *r, float *min, float *max)
{
- if(RE_rayobject_isRayFace(r))
+ if (RE_rayobject_isRayFace(r))
{
RayFace *face = (RayFace*) RE_rayobject_align(r);
DO_MINMAX(face->v1, min, max);
DO_MINMAX(face->v2, min, max);
DO_MINMAX(face->v3, min, max);
- if(RE_rayface_isQuad(face)) DO_MINMAX(face->v4, min, max);
+ if (RE_rayface_isQuad(face)) DO_MINMAX(face->v4, min, max);
}
- else if(RE_rayobject_isVlakPrimitive(r))
+ else if (RE_rayobject_isVlakPrimitive(r))
{
VlakPrimitive *face = (VlakPrimitive*) RE_rayobject_align(r);
RayFace nface;
@@ -503,9 +503,9 @@ void RE_rayobject_merge_bb(RayObject *r, float *min, float *max)
DO_MINMAX(nface.v1, min, max);
DO_MINMAX(nface.v2, min, max);
DO_MINMAX(nface.v3, min, max);
- if(RE_rayface_isQuad(&nface)) DO_MINMAX(nface.v4, min, max);
+ if (RE_rayface_isQuad(&nface)) DO_MINMAX(nface.v4, min, max);
}
- else if(RE_rayobject_isRayAPI(r))
+ else if (RE_rayobject_isRayAPI(r))
{
r = RE_rayobject_align(r);
r->api->bb(r, min, max);
@@ -518,11 +518,11 @@ void RE_rayobject_merge_bb(RayObject *r, float *min, float *max)
void RE_rayobject_hint_bb(RayObject *r, RayHint *hint, float *min, float *max)
{
- if(RE_rayobject_isRayFace(r) || RE_rayobject_isVlakPrimitive(r))
+ if (RE_rayobject_isRayFace(r) || RE_rayobject_isVlakPrimitive(r))
{
return;
}
- else if(RE_rayobject_isRayAPI(r))
+ else if (RE_rayobject_isRayAPI(r))
{
r = RE_rayobject_align(r);
return r->api->hint_bb(r, hint, min, max);
@@ -535,7 +535,7 @@ void RE_rayobject_hint_bb(RayObject *r, RayHint *hint, float *min, float *max)
int RE_rayobjectcontrol_test_break(RayObjectControl *control)
{
- if(control->test_break)
+ if (control->test_break)
return control->test_break(control->data);
return 0;
@@ -543,7 +543,7 @@ int RE_rayobjectcontrol_test_break(RayObjectControl *control)
void RE_rayobject_set_control(RayObject *r, void *data, RE_rayobjectcontrol_test_break_callback test_break)
{
- if(RE_rayobject_isRayAPI(r))
+ if (RE_rayobject_isRayAPI(r))
{
r = RE_rayobject_align(r);
r->control.data = data;
diff --git a/source/blender/render/intern/raytrace/rayobject_blibvh.cpp b/source/blender/render/intern/raytrace/rayobject_blibvh.cpp
index f5a60308561..165b62cfbe4 100644
--- a/source/blender/render/intern/raytrace/rayobject_blibvh.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_blibvh.cpp
@@ -102,11 +102,11 @@ static void bvh_callback(void *userdata, int index, const BVHTreeRay *UNUSED(ray
Isect *isec = data->isec;
RayObject *face = data->leafs[index];
- if(RE_rayobject_intersect(face,isec))
+ if (RE_rayobject_intersect(face,isec))
{
hit->index = index;
- if(isec->mode == RE_RAY_SHADOW)
+ if (isec->mode == RE_RAY_SHADOW)
hit->dist = 0;
else
hit->dist = isec->dist;
@@ -154,10 +154,10 @@ static void RE_rayobject_blibvh_free(RayObject *o)
{
BVHObject *obj = (BVHObject*)o;
- if(obj->bvh)
+ if (obj->bvh)
BLI_bvhtree_free(obj->bvh);
- if(obj->leafs)
+ if (obj->leafs)
MEM_freeN(obj->leafs);
MEM_freeN(obj);
diff --git a/source/blender/render/intern/raytrace/rayobject_empty.cpp b/source/blender/render/intern/raytrace/rayobject_empty.cpp
index 55696b5b827..eacec0b7eb9 100644
--- a/source/blender/render/intern/raytrace/rayobject_empty.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_empty.cpp
@@ -72,7 +72,7 @@ static RayObjectAPI empty_api =
RE_rayobject_empty_hint_bb
};
-static RayObject empty_raytree = { &empty_api, {0, 0} };
+static RayObject empty_raytree = { &empty_api, {NULL, NULL} };
RayObject *RE_rayobject_empty_create()
{
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_instance.cpp b/source/blender/render/intern/raytrace/rayobject_instance.cpp
index c7af501a808..2e803ce0fd3 100644
--- a/source/blender/render/intern/raytrace/rayobject_instance.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_instance.cpp
@@ -99,7 +99,7 @@ static int RE_rayobject_instance_intersect(RayObject *o, Isect *isec)
int changed = 0, i, res;
// TODO - this is disabling self intersection on instances
- if(isec->orig.ob == obj->ob && obj->ob)
+ if (isec->orig.ob == obj->ob && obj->ob)
{
changed = 1;
isec->orig.ob = obj->target_ob;
@@ -117,7 +117,7 @@ static int RE_rayobject_instance_intersect(RayObject *o, Isect *isec)
isec->dist *= normalize_v3(isec->dir);
// update idot_axis and bv_index
- for(i=0; i<3; i++)
+ for (i=0; i<3; i++)
{
isec->idot_axis[i] = 1.0f / isec->dir[i];
@@ -132,7 +132,7 @@ static int RE_rayobject_instance_intersect(RayObject *o, Isect *isec)
res = RE_rayobject_intersect(obj->target, isec);
// map dist into original coordinate space
- if(res == 0)
+ if (res == 0)
{
isec->dist = dist;
}
@@ -161,11 +161,11 @@ static int RE_rayobject_instance_intersect(RayObject *o, Isect *isec)
copy_v3_v3(isec->dir, dir);
copy_v3_v3(isec->idot_axis, idot_axis);
- if(changed)
+ if (changed)
isec->orig.ob = obj->ob;
// restore bv_index
- for(i=0; i<3; i++)
+ for (i=0; i<3; i++)
{
isec->bv_index[2*i] = isec->idot_axis[i] < 0.0 ? 1 : 0;
isec->bv_index[2*i+1] = 1 - isec->bv_index[2*i];
@@ -202,9 +202,9 @@ static void RE_rayobject_instance_bb(RayObject *o, float *min, float *max)
RE_rayobject_merge_bb(obj->target, m, M);
//There must be a faster way than rotating all the 8 vertexs of the BB
- for(i=0; i<8; i++)
+ for (i=0; i<8; i++)
{
- for(j=0; j<3; j++) t[j] = i&(1<<j) ? M[j] : m[j];
+ for (j=0; j<3; j++) t[j] = i&(1<<j) ? M[j] : m[j];
mul_m4_v3(obj->target2global, t);
DO_MINMAX(t, min, max);
}
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..ea1d5c2573c 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>
@@ -133,7 +133,7 @@ static void calc_ocval_face(float *v1, float *v2, float *v3, float *v4, short x,
copy_v3_v3(max, v1);
DO_MINMAX(v2, min, max);
DO_MINMAX(v3, min, max);
- if(v4) {
+ if (v4) {
DO_MINMAX(v4, min, max);
}
@@ -155,28 +155,31 @@ static void calc_ocval_ray(OcVal *ov, float xo, float yo, float zo, float *vec1,
{
int ocmin, ocmax;
- if(vec1[0]<vec2[0]) {
+ if (vec1[0]<vec2[0]) {
ocmin= OCVALRES*(vec1[0] - xo);
ocmax= OCVALRES*(vec2[0] - xo);
- } else {
+ }
+ else {
ocmin= OCVALRES*(vec2[0] - xo);
ocmax= OCVALRES*(vec1[0] - xo);
}
ov->ocx= BROW16(ocmin, ocmax);
- if(vec1[1]<vec2[1]) {
+ if (vec1[1]<vec2[1]) {
ocmin= OCVALRES*(vec1[1] - yo);
ocmax= OCVALRES*(vec2[1] - yo);
- } else {
+ }
+ else {
ocmin= OCVALRES*(vec2[1] - yo);
ocmax= OCVALRES*(vec1[1] - yo);
}
ov->ocy= BROW16(ocmin, ocmax);
- if(vec1[2]<vec2[2]) {
+ if (vec1[2]<vec2[2]) {
ocmin= OCVALRES*(vec1[2] - zo);
ocmax= OCVALRES*(vec2[2] - zo);
- } else {
+ }
+ else {
ocmin= OCVALRES*(vec2[2] - zo);
ocmax= OCVALRES*(vec1[2] - zo);
}
@@ -189,15 +192,15 @@ static Branch *addbranch(Octree *oc, Branch *br, short ocb)
{
int index;
- if(br->b[ocb]) return br->b[ocb];
+ if (br->b[ocb]) return br->b[ocb];
oc->branchcount++;
index= oc->branchcount>>12;
- if(oc->adrbranch[index]==NULL)
+ if (oc->adrbranch[index]==NULL)
oc->adrbranch[index]= (Branch*)MEM_callocN(4096*sizeof(Branch), "new oc branch");
- if(oc->branchcount>= BRANCH_ARRAY*4096) {
+ if (oc->branchcount>= BRANCH_ARRAY*4096) {
printf("error; octree branches full\n");
oc->branchcount=0;
}
@@ -212,10 +215,10 @@ static Node *addnode(Octree *oc)
oc->nodecount++;
index= oc->nodecount>>12;
- if(oc->adrnode[index]==NULL)
+ if (oc->adrnode[index]==NULL)
oc->adrnode[index]= (Node*)MEM_callocN(4096*sizeof(Node),"addnode");
- if(oc->nodecount> NODE_ARRAY*NODE_ARRAY) {
+ if (oc->nodecount> NODE_ARRAY*NODE_ARRAY) {
printf("error; octree nodes full\n");
oc->nodecount=0;
}
@@ -229,7 +232,7 @@ static int face_in_node(RayFace *face, short x, short y, short z, float rtf[][3]
float fx, fy, fz;
// init static vars
- if(face) {
+ if (face) {
normal_tri_v3( nor,rtf[0], rtf[1], rtf[2]);
d= -nor[0]*rtf[0][0] - nor[1]*rtf[0][1] - nor[2]*rtf[0][2];
return 0;
@@ -239,25 +242,25 @@ static int face_in_node(RayFace *face, short x, short y, short z, float rtf[][3]
fy= y;
fz= z;
- if((fx)*nor[0] + (fy)*nor[1] + (fz)*nor[2] + d > 0.0f) {
- if((fx+1)*nor[0] + (fy )*nor[1] + (fz )*nor[2] + d < 0.0f) return 1;
- if((fx )*nor[0] + (fy+1)*nor[1] + (fz )*nor[2] + d < 0.0f) return 1;
- if((fx+1)*nor[0] + (fy+1)*nor[1] + (fz )*nor[2] + d < 0.0f) return 1;
+ if ((fx)*nor[0] + (fy)*nor[1] + (fz)*nor[2] + d > 0.0f) {
+ if ((fx+1)*nor[0] + (fy )*nor[1] + (fz )*nor[2] + d < 0.0f) return 1;
+ if ((fx )*nor[0] + (fy+1)*nor[1] + (fz )*nor[2] + d < 0.0f) return 1;
+ if ((fx+1)*nor[0] + (fy+1)*nor[1] + (fz )*nor[2] + d < 0.0f) return 1;
- if((fx )*nor[0] + (fy )*nor[1] + (fz+1)*nor[2] + d < 0.0f) return 1;
- if((fx+1)*nor[0] + (fy )*nor[1] + (fz+1)*nor[2] + d < 0.0f) return 1;
- if((fx )*nor[0] + (fy+1)*nor[1] + (fz+1)*nor[2] + d < 0.0f) return 1;
- if((fx+1)*nor[0] + (fy+1)*nor[1] + (fz+1)*nor[2] + d < 0.0f) return 1;
+ if ((fx )*nor[0] + (fy )*nor[1] + (fz+1)*nor[2] + d < 0.0f) return 1;
+ if ((fx+1)*nor[0] + (fy )*nor[1] + (fz+1)*nor[2] + d < 0.0f) return 1;
+ if ((fx )*nor[0] + (fy+1)*nor[1] + (fz+1)*nor[2] + d < 0.0f) return 1;
+ if ((fx+1)*nor[0] + (fy+1)*nor[1] + (fz+1)*nor[2] + d < 0.0f) return 1;
}
else {
- if((fx+1)*nor[0] + (fy )*nor[1] + (fz )*nor[2] + d > 0.0f) return 1;
- if((fx )*nor[0] + (fy+1)*nor[1] + (fz )*nor[2] + d > 0.0f) return 1;
- if((fx+1)*nor[0] + (fy+1)*nor[1] + (fz )*nor[2] + d > 0.0f) return 1;
+ if ((fx+1)*nor[0] + (fy )*nor[1] + (fz )*nor[2] + d > 0.0f) return 1;
+ if ((fx )*nor[0] + (fy+1)*nor[1] + (fz )*nor[2] + d > 0.0f) return 1;
+ if ((fx+1)*nor[0] + (fy+1)*nor[1] + (fz )*nor[2] + d > 0.0f) return 1;
- if((fx )*nor[0] + (fy )*nor[1] + (fz+1)*nor[2] + d > 0.0f) return 1;
- if((fx+1)*nor[0] + (fy )*nor[1] + (fz+1)*nor[2] + d > 0.0f) return 1;
- if((fx )*nor[0] + (fy+1)*nor[1] + (fz+1)*nor[2] + d > 0.0f) return 1;
- if((fx+1)*nor[0] + (fy+1)*nor[1] + (fz+1)*nor[2] + d > 0.0f) return 1;
+ if ((fx )*nor[0] + (fy )*nor[1] + (fz+1)*nor[2] + d > 0.0f) return 1;
+ if ((fx+1)*nor[0] + (fy )*nor[1] + (fz+1)*nor[2] + d > 0.0f) return 1;
+ if ((fx )*nor[0] + (fy+1)*nor[1] + (fz+1)*nor[2] + d > 0.0f) return 1;
+ if ((fx+1)*nor[0] + (fy+1)*nor[1] + (fz+1)*nor[2] + d > 0.0f) return 1;
}
return 0;
@@ -274,15 +277,15 @@ static void ocwrite(Octree *oc, RayFace *face, int quad, short x, short y, short
br= oc->adrbranch[0];
- if(oc->ocres==512) {
+ if (oc->ocres==512) {
oc0= ((x & 1024)+(y & 512)+(z & 256))>>8;
br= addbranch(oc, br, oc0);
}
- if(oc->ocres>=256) {
+ if (oc->ocres>=256) {
oc0= ((x & 512)+(y & 256)+(z & 128))>>7;
br= addbranch(oc, br, oc0);
}
- if(oc->ocres>=128) {
+ if (oc->ocres>=128) {
oc0= ((x & 256)+(y & 128)+(z & 64))>>6;
br= addbranch(oc, br, oc0);
}
@@ -300,12 +303,12 @@ static void ocwrite(Octree *oc, RayFace *face, int quad, short x, short y, short
br= addbranch(oc, br,oc3);
br= addbranch(oc, br,oc4);
no= (Node *)br->b[oc5];
- if(no==NULL) br->b[oc5]= (Branch *)(no= addnode(oc));
+ if (no==NULL) br->b[oc5]= (Branch *)(no= addnode(oc));
while(no->next) no= no->next;
a= 0;
- if(no->v[7]) { /* node full */
+ if (no->v[7]) { /* node full */
no->next= addnode(oc);
no= no->next;
}
@@ -315,7 +318,7 @@ static void ocwrite(Octree *oc, RayFace *face, int quad, short x, short y, short
no->v[a]= (RayFace*) RE_rayobject_align(face);
- if(quad)
+ if (quad)
calc_ocval_face(rtf[0], rtf[1], rtf[2], rtf[3], x>>2, y>>1, z, &no->ov[a]);
else
calc_ocval_face(rtf[0], rtf[1], rtf[2], NULL, x>>2, y>>1, z, &no->ov[a]);
@@ -333,7 +336,7 @@ static void d2dda(Octree *oc, short b1, short b2, short c1, short c2, char *ocfa
ocx2= rts[b2][c1];
ocy2= rts[b2][c2];
- if(ocx1==ocx2 && ocy1==ocy2) {
+ if (ocx1==ocx2 && ocy1==ocy2) {
ocface[oc->ocres*ocx1+ocy1]= 1;
return;
}
@@ -343,32 +346,36 @@ static void d2dda(Octree *oc, short b1, short b2, short c1, short c2, char *ocfa
ox2= rtf[b2][c1];
oy2= rtf[b2][c2];
- if(ox1!=ox2) {
- if(ox2-ox1>0.0f) {
+ if (ox1!=ox2) {
+ if (ox2-ox1>0.0f) {
labdax= (ox1-ocx1-1.0f)/(ox1-ox2);
ldx= -1.0f/(ox1-ox2);
dx= 1;
- } else {
+ }
+ else {
labdax= (ox1-ocx1)/(ox1-ox2);
ldx= 1.0f/(ox1-ox2);
dx= -1;
}
- } else {
+ }
+ else {
labdax=1.0f;
ldx=0;
}
- if(oy1!=oy2) {
- if(oy2-oy1>0.0f) {
+ if (oy1!=oy2) {
+ if (oy2-oy1>0.0f) {
labday= (oy1-ocy1-1.0f)/(oy1-oy2);
ldy= -1.0f/(oy1-oy2);
dy= 1;
- } else {
+ }
+ else {
labday= (oy1-ocy1)/(oy1-oy2);
ldy= 1.0f/(oy1-oy2);
dy= -1;
}
- } else {
+ }
+ else {
labday=1.0f;
ldy=0;
}
@@ -378,27 +385,29 @@ static void d2dda(Octree *oc, short b1, short b2, short c1, short c2, char *ocfa
while(TRUE) {
- if(x<0 || y<0 || x>=oc->ocres || y>=oc->ocres);
+ if (x<0 || y<0 || x>=oc->ocres || y>=oc->ocres);
else ocface[oc->ocres*x+y]= 1;
labdao=labda;
- if(labdax==labday) {
+ if (labdax==labday) {
labdax+=ldx;
x+=dx;
labday+=ldy;
y+=dy;
- } else {
- if(labdax<labday) {
+ }
+ else {
+ if (labdax<labday) {
labdax+=ldx;
x+=dx;
- } else {
+ }
+ else {
labday+=ldy;
y+=dy;
}
}
labda=MIN2(labdax,labday);
- if(labda==labdao) break;
- if(labda>=1.0f) break;
+ if (labda==labdao) break;
+ if (labda>=1.0f) break;
}
ocface[oc->ocres*ocx2+ocy2]=1;
}
@@ -407,15 +416,15 @@ static void filltriangle(Octree *oc, short c1, short c2, char *ocface, short *oc
{
int a, x, y, y1, y2;
- for(x=ocmin[c1];x<=ocmax[c1];x++) {
+ for (x=ocmin[c1];x<=ocmax[c1];x++) {
a= oc->ocres*x;
- for(y=ocmin[c2];y<=ocmax[c2];y++) {
- if(ocface[a+y]) {
+ for (y=ocmin[c2];y<=ocmax[c2];y++) {
+ if (ocface[a+y]) {
y++;
while(ocface[a+y] && y!=ocmax[c2]) y++;
- for(y1=ocmax[c2];y1>y;y1--) {
- if(ocface[a+y1]) {
- for(y2=y;y2<=y1;y2++) ocface[a+y2]=1;
+ for (y1=ocmax[c2];y1>y;y1--) {
+ if (ocface[a+y1]) {
+ for (y2=y;y2<=y1;y2++) ocface[a+y2]=1;
y1=0;
}
}
@@ -431,14 +440,14 @@ static void RE_rayobject_octree_free(RayObject *tree)
#if 0
printf("branches %d nodes %d\n", oc->branchcount, oc->nodecount);
- printf("raycount %d \n", raycount);
- printf("ray coherent %d \n", coherent_ray);
+ printf("raycount %d\n", raycount);
+ printf("ray coherent %d\n", coherent_ray);
printf("accepted %d rejected %d\n", accepted, rejected);
#endif
- if(oc->ocface)
+ if (oc->ocface)
MEM_freeN(oc->ocface);
- if(oc->adrbranch) {
+ if (oc->adrbranch) {
int a= 0;
while(oc->adrbranch[a]) {
MEM_freeN(oc->adrbranch[a]);
@@ -450,7 +459,7 @@ static void RE_rayobject_octree_free(RayObject *tree)
}
oc->branchcount= 0;
- if(oc->adrnode) {
+ if (oc->adrnode) {
int a= 0;
while(oc->adrnode[a]) {
MEM_freeN(oc->adrnode[a]);
@@ -511,27 +520,27 @@ static void octree_fill_rayface(Octree *oc, RayFace *face)
copy_v3_v3(co1, face->v1);
copy_v3_v3(co2, face->v2);
copy_v3_v3(co3, face->v3);
- if(face->v4)
+ if (face->v4)
copy_v3_v3(co4, face->v4);
- for(c=0;c<3;c++) {
+ for (c=0;c<3;c++) {
rtf[0][c] = (co1[c] - oc->min[c]) * ocfac[c];
rts[0][c] = (short)rtf[0][c];
rtf[1][c] = (co2[c] - oc->min[c]) * ocfac[c];
rts[1][c] = (short)rtf[1][c];
rtf[2][c] = (co3[c] - oc->min[c]) * ocfac[c];
rts[2][c] = (short)rtf[2][c];
- if(RE_rayface_isQuad(face)) {
+ if (RE_rayface_isQuad(face)) {
rtf[3][c] = (co4[c] - oc->min[c]) * ocfac[c];
rts[3][c] = (short)rtf[3][c];
}
}
- for(c=0;c<3;c++) {
+ for (c=0;c<3;c++) {
oc1= rts[0][c];
oc2= rts[1][c];
oc3= rts[2][c];
- if(!RE_rayface_isQuad(face)) {
+ if (!RE_rayface_isQuad(face)) {
ocmin[c]= MIN3(oc1,oc2,oc3);
ocmax[c]= MAX3(oc1,oc2,oc3);
}
@@ -540,11 +549,11 @@ static void octree_fill_rayface(Octree *oc, RayFace *face)
ocmin[c]= MIN4(oc1,oc2,oc3,oc4);
ocmax[c]= MAX4(oc1,oc2,oc3,oc4);
}
- if(ocmax[c]>oc->ocres-1) ocmax[c]=oc->ocres-1;
- if(ocmin[c]<0) ocmin[c]=0;
+ if (ocmax[c]>oc->ocres-1) ocmax[c]=oc->ocres-1;
+ if (ocmin[c]<0) ocmin[c]=0;
}
- if(ocmin[0]==ocmax[0] && ocmin[1]==ocmax[1] && ocmin[2]==ocmax[2]) {
+ if (ocmin[0]==ocmax[0] && ocmin[1]==ocmax[1] && ocmin[2]==ocmax[2]) {
ocwrite(oc, face, RE_rayface_isQuad(face), ocmin[0], ocmin[1], ocmin[2], rtf);
}
else {
@@ -555,7 +564,7 @@ static void octree_fill_rayface(Octree *oc, RayFace *face)
d2dda(oc, 1,2,0,1,ocface+ocres2,rts,rtf);
d2dda(oc, 1,2,0,2,ocface,rts,rtf);
d2dda(oc, 1,2,1,2,ocface+2*ocres2,rts,rtf);
- if(!RE_rayface_isQuad(face)) {
+ if (!RE_rayface_isQuad(face)) {
d2dda(oc, 2,0,0,1,ocface+ocres2,rts,rtf);
d2dda(oc, 2,0,0,2,ocface,rts,rtf);
d2dda(oc, 2,0,1,2,ocface+2*ocres2,rts,rtf);
@@ -576,14 +585,14 @@ static void octree_fill_rayface(Octree *oc, RayFace *face)
/* init static vars here */
face_in_node(face, 0,0,0, rtf);
- for(x=ocmin[0];x<=ocmax[0];x++) {
+ for (x=ocmin[0];x<=ocmax[0];x++) {
a= oc->ocres*x;
- for(y=ocmin[1];y<=ocmax[1];y++) {
- if(ocface[a+y+ocres2]) {
+ for (y=ocmin[1];y<=ocmax[1];y++) {
+ if (ocface[a+y+ocres2]) {
b= oc->ocres*y+2*ocres2;
- for(z=ocmin[2];z<=ocmax[2];z++) {
- if(ocface[b+z] && ocface[a+z]) {
- if(face_in_node(NULL, x, y, z, rtf))
+ for (z=ocmin[2];z<=ocmax[2];z++) {
+ if (ocface[b+z] && ocface[a+z]) {
+ if (face_in_node(NULL, x, y, z, rtf))
ocwrite(oc, face, RE_rayface_isQuad(face), x,y,z, rtf);
}
}
@@ -592,14 +601,14 @@ static void octree_fill_rayface(Octree *oc, RayFace *face)
}
/* same loops to clear octree, doubt it can be done smarter */
- for(x=ocmin[0];x<=ocmax[0];x++) {
+ for (x=ocmin[0];x<=ocmax[0];x++) {
a= oc->ocres*x;
- for(y=ocmin[1];y<=ocmax[1];y++) {
+ for (y=ocmin[1];y<=ocmax[1];y++) {
/* x-y */
ocface[a+y+ocres2]= 0;
b= oc->ocres*y + 2*ocres2;
- for(z=ocmin[2];z<=ocmax[2];z++) {
+ for (z=ocmin[2];z<=ocmax[2];z++) {
/* y-z */
ocface[b+z]= 0;
/* x-z */
@@ -620,7 +629,7 @@ static void RE_rayobject_octree_done(RayObject *tree)
INIT_MINMAX(oc->min, oc->max);
/* Calculate Bounding Box */
- for(c=0; c<oc->ro_nodes_used; c++)
+ for (c=0; c<oc->ro_nodes_used; c++)
RE_rayobject_merge_bb( RE_rayobject_unalignRayFace(oc->ro_nodes[c]), oc->min, oc->max);
/* Alloc memory */
@@ -633,7 +642,7 @@ static void RE_rayobject_octree_done(RayObject *tree)
oc->ocface= (char*)MEM_callocN( 3*ocres2 + 8, "ocface");
memset(oc->ocface, 0, 3*ocres2);
- for(c=0;c<3;c++) { /* octree enlarge, still needed? */
+ for (c=0;c<3;c++) { /* octree enlarge, still needed? */
oc->min[c]-= 0.01f;
oc->max[c]+= 0.01f;
}
@@ -649,7 +658,7 @@ static void RE_rayobject_octree_done(RayObject *tree)
oc->ocsize= sqrt(t00*t00+t01*t01+t02*t02); /* global, max size octree */
- for(c=0; c<oc->ro_nodes_used; c++)
+ for (c=0; c<oc->ro_nodes_used; c++)
{
octree_fill_rayface(oc, oc->ro_nodes[c]);
}
@@ -677,19 +686,19 @@ static int testnode(Octree *UNUSED(oc), Isect *is, Node *no, OcVal ocval)
short nr=0;
/* return on any first hit */
- if(is->mode==RE_RAY_SHADOW) {
+ if (is->mode==RE_RAY_SHADOW) {
- for(; no; no = no->next)
- for(nr=0; nr<8; nr++)
+ for (; no; no = no->next)
+ for (nr=0; nr<8; nr++)
{
RayFace *face = no->v[nr];
OcVal *ov = no->ov+nr;
- if(!face) break;
+ if (!face) break;
- if( (ov->ocx & ocval.ocx) && (ov->ocy & ocval.ocy) && (ov->ocz & ocval.ocz) )
+ if ( (ov->ocx & ocval.ocx) && (ov->ocy & ocval.ocy) && (ov->ocz & ocval.ocz) )
{
- if( RE_rayobject_intersect( RE_rayobject_unalignRayFace(face),is) )
+ if ( RE_rayobject_intersect( RE_rayobject_unalignRayFace(face),is) )
return 1;
}
}
@@ -698,17 +707,17 @@ static int testnode(Octree *UNUSED(oc), Isect *is, Node *no, OcVal ocval)
{ /* else mirror or glass or shadowtra, return closest face */
int found= 0;
- for(; no; no = no->next)
- for(nr=0; nr<8; nr++)
+ for (; no; no = no->next)
+ for (nr=0; nr<8; nr++)
{
RayFace *face = no->v[nr];
OcVal *ov = no->ov+nr;
- if(!face) break;
+ if (!face) break;
- if( (ov->ocx & ocval.ocx) && (ov->ocy & ocval.ocy) && (ov->ocz & ocval.ocz) )
+ if ( (ov->ocx & ocval.ocx) && (ov->ocy & ocval.ocy) && (ov->ocz & ocval.ocz) )
{
- if( RE_rayobject_intersect( RE_rayobject_unalignRayFace(face),is) )
+ if ( RE_rayobject_intersect( RE_rayobject_unalignRayFace(face),is) )
found= 1;
}
}
@@ -730,43 +739,43 @@ static Node *ocread(Octree *oc, int x, int y, int z)
br= oc->adrbranch[0];
- if(oc->ocres==512) {
+ if (oc->ocres==512) {
oc1= ((x & 1024)+(y & 512)+(z & 256))>>8;
br= br->b[oc1];
- if(br==NULL) {
+ if (br==NULL) {
return NULL;
}
}
- if(oc->ocres>=256) {
+ if (oc->ocres>=256) {
oc1= ((x & 512)+(y & 256)+(z & 128))>>7;
br= br->b[oc1];
- if(br==NULL) {
+ if (br==NULL) {
return NULL;
}
}
- if(oc->ocres>=128) {
+ if (oc->ocres>=128) {
oc1= ((x & 256)+(y & 128)+(z & 64))>>6;
br= br->b[oc1];
- if(br==NULL) {
+ if (br==NULL) {
return NULL;
}
}
oc1= ((x & 128)+(y & 64)+(z & 32))>>5;
br= br->b[oc1];
- if(br) {
+ if (br) {
oc1= ((x & 64)+(y & 32)+(z & 16))>>4;
br= br->b[oc1];
- if(br) {
+ if (br) {
oc1= ((x & 32)+(y & 16)+(z & 8))>>3;
br= br->b[oc1];
- if(br) {
+ if (br) {
oc1= ((x & 16)+(y & 8)+(z & 4))>>2;
br= br->b[oc1];
- if(br) {
+ if (br) {
oc1= ((x & 8)+(y & 4)+(z & 2))>>1;
br= br->b[oc1];
- if(br) {
+ if (br) {
oc1= ((x & 4)+(y & 2)+(z & 1));
return (Node *)br->b[oc1];
}
@@ -782,32 +791,32 @@ static int cliptest(float p, float q, float *u1, float *u2)
{
float r;
- if(p<0.0f) {
- if(q<p) return 0;
- else if(q<0.0f) {
+ if (p<0.0f) {
+ if (q<p) return 0;
+ else if (q<0.0f) {
r= q/p;
- if(r>*u2) return 0;
- else if(r>*u1) *u1=r;
+ if (r>*u2) return 0;
+ else if (r>*u1) *u1=r;
}
}
else {
- if(p>0.0f) {
- if(q<0.0f) return 0;
- else if(q<p) {
+ if (p>0.0f) {
+ if (q<0.0f) return 0;
+ else if (q<p) {
r= q/p;
- if(r<*u1) return 0;
- else if(r<*u2) *u2=r;
+ if (r<*u1) return 0;
+ else if (r<*u2) *u2=r;
}
}
- else if(q<0.0f) return 0;
+ else if (q<0.0f) return 0;
}
return 1;
}
/* 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));
@@ -827,12 +836,12 @@ static int do_coherence_test(int ocx1, int ocx2, int ocy1, int ocy2, int ocz1, i
short *sp;
sp= coh_nodes[ (ocx2 & 15) + 16*(ocy2 & 15) + 256*(ocz2 & 15) ];
- if(sp[0]==ocx1 && sp[1]==ocy1 && sp[2]==ocz1 &&
+ if (sp[0]==ocx1 && sp[1]==ocy1 && sp[2]==ocz1 &&
sp[3]==ocx2 && sp[4]==ocy2 && sp[5]==ocz2) return 1;
return 0;
}
-*/
+#endif
/* return 1: found valid intersection */
/* starts with is->orig.face */
@@ -850,7 +859,7 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
int ocx1,ocx2,ocy1, ocy2,ocz1,ocz2;
/* clip with octree */
- if(oc->branchcount==0) return 0;
+ if (oc->branchcount==0) return 0;
/* do this before intersect calls */
#if 0
@@ -868,22 +877,22 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
u2= 1.0f;
/* clip with octree cube */
- if(cliptest(-ldx, start[0]-oc->min[0], &u1,&u2)) {
- if(cliptest(ldx, oc->max[0]-start[0], &u1,&u2)) {
+ if (cliptest(-ldx, start[0]-oc->min[0], &u1,&u2)) {
+ if (cliptest(ldx, oc->max[0]-start[0], &u1,&u2)) {
ldy= is->dir[1]*is->dist;
- if(cliptest(-ldy, start[1]-oc->min[1], &u1,&u2)) {
- if(cliptest(ldy, oc->max[1]-start[1], &u1,&u2)) {
+ if (cliptest(-ldy, start[1]-oc->min[1], &u1,&u2)) {
+ if (cliptest(ldy, oc->max[1]-start[1], &u1,&u2)) {
ldz = is->dir[2]*is->dist;
- if(cliptest(-ldz, start[2]-oc->min[2], &u1,&u2)) {
- if(cliptest(ldz, oc->max[2]-start[2], &u1,&u2)) {
+ if (cliptest(-ldz, start[2]-oc->min[2], &u1,&u2)) {
+ if (cliptest(ldz, oc->max[2]-start[2], &u1,&u2)) {
c1=1;
- if(u2<1.0f) {
+ if (u2<1.0f) {
end[0] = start[0]+u2*ldx;
end[1] = start[1]+u2*ldy;
end[2] = start[2]+u2*ldz;
}
- if(u1>0.0f) {
+ if (u1>0.0f) {
start[0] += u1*ldx;
start[1] += u1*ldy;
start[2] += u1*ldz;
@@ -895,7 +904,7 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
}
}
- if(c1==0) return 0;
+ if (c1==0) return 0;
/* reset static variables in ocread */
//ocread(oc, oc->ocres, 0, 0);
@@ -915,14 +924,14 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
ocy2= (int)oy2;
ocz2= (int)oz2;
- if(ocx1==ocx2 && ocy1==ocy2 && ocz1==ocz2) {
+ if (ocx1==ocx2 && ocy1==ocy2 && ocz1==ocz2) {
no= ocread(oc, ocx1, ocy1, ocz1);
- if(no) {
+ if (no) {
/* exact intersection with node */
vec1[0]= ox1; vec1[1]= oy1; vec1[2]= oz1;
vec2[0]= ox2; vec2[1]= oy2; vec2[2]= oz2;
calc_ocval_ray(&ocval, (float)ocx1, (float)ocy1, (float)ocz1, vec1, vec2);
- if( testnode(oc, is, no, ocval) ) return 1;
+ if ( testnode(oc, is, no, ocval) ) return 1;
}
}
else {
@@ -936,43 +945,49 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
doy= oy1-oy2;
doz= oz1-oz2;
- if(dox<-FLT_EPSILON) {
+ if (dox<-FLT_EPSILON) {
ldx= -1.0f/dox;
labdax= (ocx1-ox1+1.0f)*ldx;
dx= 1;
- } else if(dox>FLT_EPSILON) {
+ }
+ else if (dox>FLT_EPSILON) {
ldx= 1.0f/dox;
labdax= (ox1-ocx1)*ldx;
dx= -1;
- } else {
+ }
+ else {
labdax=1.0f;
ldx=0;
dx= 0;
}
- if(doy<-FLT_EPSILON) {
+ if (doy<-FLT_EPSILON) {
ldy= -1.0f/doy;
labday= (ocy1-oy1+1.0f)*ldy;
dy= 1;
- } else if(doy>FLT_EPSILON) {
+ }
+ else if (doy>FLT_EPSILON) {
ldy= 1.0f/doy;
labday= (oy1-ocy1)*ldy;
dy= -1;
- } else {
+ }
+ else {
labday=1.0f;
ldy=0;
dy= 0;
}
- if(doz<-FLT_EPSILON) {
+ if (doz<-FLT_EPSILON) {
ldz= -1.0f/doz;
labdaz= (ocz1-oz1+1.0f)*ldz;
dz= 1;
- } else if(doz>FLT_EPSILON) {
+ }
+ else if (doz>FLT_EPSILON) {
ldz= 1.0f/doz;
labdaz= (oz1-ocz1)*ldz;
dz= -1;
- } else {
+ }
+ else {
labdaz=1.0f;
ldz=0;
dz= 0;
@@ -986,12 +1001,12 @@ 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) {
no= ocread(oc, xo, yo, zo);
- if(no) {
+ if (no) {
/* calculate ray intersection with octree node */
copy_v3_v3(vec1, vec2);
@@ -1002,10 +1017,10 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
calc_ocval_ray(&ocval, (float)xo, (float)yo, (float)zo, vec1, vec2);
//is->dist = (u1+ddalabda*(u2-u1))*olabda;
- if( testnode(oc, is, no, ocval) )
+ if ( testnode(oc, is, no, ocval) )
found = 1;
- if(is->dist < (u1+ddalabda*(u2-u1))*olabda)
+ if (is->dist < (u1+ddalabda*(u2-u1))*olabda)
return found;
}
@@ -1013,19 +1028,19 @@ 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;
+ if (labday==labdaz) eqval += 2;
+ if (labdax==labdaz) eqval += 4;
- if(eqval) { // only 4 cases exist!
- if(eqval==7) { // x=y=z
+ if (eqval) { // only 4 cases exist!
+ if (eqval==7) { // x=y=z
xo+=dx; labdax+=ldx;
yo+=dy; labday+=ldy;
zo+=dz; labdaz+=ldz;
}
- else if(eqval==1) { // x=y
- if(labday < labdaz) {
+ else if (eqval==1) { // x=y
+ if (labday < labdaz) {
xo+=dx; labdax+=ldx;
yo+=dy; labday+=ldy;
}
@@ -1033,8 +1048,8 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
zo+=dz; labdaz+=ldz;
}
}
- else if(eqval==2) { // y=z
- if(labdax < labday) {
+ else if (eqval==2) { // y=z
+ if (labdax < labday) {
xo+=dx; labdax+=ldx;
}
else {
@@ -1043,7 +1058,7 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
}
}
else { // x=z
- if(labday < labdax) {
+ if (labday < labdax) {
yo+=dy; labday+=ldy;
}
else {
@@ -1054,13 +1069,13 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
}
else { // all three different, just three cases exist
eqval= (labdax<labday);
- if(labday<labdaz) eqval += 2;
- if(labdax<labdaz) eqval += 4;
+ if (labday<labdaz) eqval += 2;
+ if (labdax<labdaz) eqval += 4;
- if(eqval==7 || eqval==5) { // x smallest
+ if (eqval==7 || eqval==5) { // x smallest
xo+=dx; labdax+=ldx;
}
- else if(eqval==2 || eqval==6) { // y smallest
+ else if (eqval==2 || eqval==6) { // y smallest
yo+=dy; labday+=ldy;
}
else { // z smallest
@@ -1070,9 +1085,9 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
}
ddalabda=MIN3(labdax,labday,labdaz);
- if(ddalabda==labdao) break;
+ if (ddalabda==labdao) break;
/* to make sure the last node is always checked */
- if(labdao>=1.0f) break;
+ if (labdao>=1.0f) break;
}
}
diff --git a/source/blender/render/intern/raytrace/rayobject_qbvh.cpp b/source/blender/render/intern/raytrace/rayobject_qbvh.cpp
index f7d38bf0fa3..2edf1593e99 100644
--- a/source/blender/render/intern/raytrace/rayobject_qbvh.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_qbvh.cpp
@@ -71,14 +71,14 @@ void bvh_done<QBVHTree>(QBVHTree *obj)
//TODO do this in 1 pass (half memory usage during building)
VBVHNode *root = BuildBinaryVBVH<VBVHNode>(arena1, &obj->rayobj.control).transform(obj->builder);
- if(RE_rayobjectcontrol_test_break(&obj->rayobj.control))
+ if (RE_rayobjectcontrol_test_break(&obj->rayobj.control))
{
BLI_memarena_free(arena1);
BLI_memarena_free(arena2);
return;
}
- if(root) {
+ if (root) {
pushup_simd<VBVHNode,4>(root);
obj->root = Reorganize_SVBVH<VBVHNode>(arena2).transform(root);
}
@@ -99,8 +99,8 @@ template<int StackSize>
int intersect(QBVHTree *obj, Isect* isec)
{
//TODO renable hint support
- if(RE_rayobject_isAligned(obj->root)) {
- if(isec->mode == RE_RAY_SHADOW)
+ if (RE_rayobject_isAligned(obj->root)) {
+ if (isec->mode == RE_RAY_SHADOW)
return svbvh_node_stack_raycast<StackSize,true>(obj->root, isec);
else
return svbvh_node_stack_raycast<StackSize,false>(obj->root, isec);
@@ -141,9 +141,9 @@ RayObjectAPI* bvh_get_api(int maxstacksize)
{
static RayObjectAPI bvh_api256 = make_api<Tree,1024>();
- if(maxstacksize <= 1024) return &bvh_api256;
+ if (maxstacksize <= 1024) return &bvh_api256;
assert(maxstacksize <= 256);
- return 0;
+ return NULL;
}
RayObject *RE_rayobject_qbvh_create(int size)
diff --git a/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp b/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
index dc75ed5e37b..54901db8bdd 100644
--- a/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
@@ -54,10 +54,10 @@ static void rtbuild_init(RTBuilder *b)
b->primitives.end = 0;
b->primitives.maxsize = 0;
- for(int i=0; i<RTBUILD_MAX_CHILDS; i++)
+ for (int i=0; i<RTBUILD_MAX_CHILDS; i++)
b->child_offset[i] = 0;
- for(int i=0; i<3; i++)
+ for (int i=0; i<3; i++)
b->sorted_begin[i] = b->sorted_end[i] = 0;
INIT_MINMAX(b->bb, b->bb+3);
@@ -74,7 +74,7 @@ RTBuilder* rtbuild_create(int size)
builder->primitives.begin = builder->primitives.end = memblock;
builder->primitives.maxsize = size;
- for(int i=0; i<3; i++)
+ for (int i=0; i<3; i++)
{
builder->sorted_begin[i] = (RTBuilder::Object**)MEM_mallocN( sizeof(RTBuilder::Object*)*size,"RTBuilder.sorted_objects");
builder->sorted_end[i] = builder->sorted_begin[i];
@@ -86,10 +86,10 @@ RTBuilder* rtbuild_create(int size)
void rtbuild_free(RTBuilder *b)
{
- if(b->primitives.begin) MEM_freeN(b->primitives.begin);
+ if (b->primitives.begin) MEM_freeN(b->primitives.begin);
- for(int i=0; i<3; i++)
- if(b->sorted_begin[i])
+ for (int i=0; i<3; i++)
+ if (b->sorted_begin[i])
MEM_freeN(b->sorted_begin[i]);
MEM_freeN(b);
@@ -105,18 +105,18 @@ 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. */
- if(bb[0] > bb[3] || bb[1] > bb[4] || bb[2] > bb[5])
+ * 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 */
- if(!finite(bb[0]) || !finite(bb[1]) || !finite(bb[2]))
+ if (!finite(bb[0]) || !finite(bb[1]) || !finite(bb[2]))
return;
- if(!finite(bb[3]) || !finite(bb[4]) || !finite(bb[5]))
+ 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 */
- if(bb[0] == bb[3] && bb[1] == bb[4] && bb[2] == bb[5])
+ * will give problems in rtbuild_heuristic_object_split later */
+ if (bb[0] == bb[3] && bb[1] == bb[4] && bb[2] == bb[5])
return;
copy_v3_v3(b->primitives.end->bb, bb);
@@ -124,7 +124,7 @@ void rtbuild_add(RTBuilder *b, RayObject *o)
b->primitives.end->obj = o;
b->primitives.end->cost = RE_rayobject_cost(o);
- for(int i=0; i<3; i++)
+ for (int i=0; i<3; i++)
{
*(b->sorted_end[i]) = b->primitives.end;
b->sorted_end[i]++;
@@ -141,7 +141,7 @@ int rtbuild_size(RTBuilder *b)
template<class Obj,int Axis>
static bool obj_bb_compare(const Obj &a, const Obj &b)
{
- if(a->bb[Axis] != b->bb[Axis])
+ if (a->bb[Axis] != b->bb[Axis])
return a->bb[Axis] < b->bb[Axis];
return a->obj < b->obj;
}
@@ -149,18 +149,18 @@ static bool obj_bb_compare(const Obj &a, const Obj &b)
template<class Item>
static void object_sort(Item *begin, Item *end, int axis)
{
- if(axis == 0) return std::sort(begin, end, obj_bb_compare<Item,0> );
- if(axis == 1) return std::sort(begin, end, obj_bb_compare<Item,1> );
- if(axis == 2) return std::sort(begin, end, obj_bb_compare<Item,2> );
+ if (axis == 0) return std::sort(begin, end, obj_bb_compare<Item,0> );
+ if (axis == 1) return std::sort(begin, end, obj_bb_compare<Item,1> );
+ if (axis == 2) return std::sort(begin, end, obj_bb_compare<Item,2> );
assert(false);
}
void rtbuild_done(RTBuilder *b, RayObjectControl* ctrl)
{
- for(int i=0; i<3; i++)
- if(b->sorted_begin[i])
+ for (int i=0; i<3; i++)
+ if (b->sorted_begin[i])
{
- if(RE_rayobjectcontrol_test_break(ctrl)) break;
+ if (RE_rayobjectcontrol_test_break(ctrl)) break;
object_sort( b->sorted_begin[i], b->sorted_end[i], i );
}
}
@@ -174,8 +174,8 @@ RTBuilder* rtbuild_get_child(RTBuilder *b, int child, RTBuilder *tmp)
{
rtbuild_init( tmp );
- for(int i=0; i<3; i++)
- if(b->sorted_begin[i])
+ for (int i=0; i<3; i++)
+ if (b->sorted_begin[i])
{
tmp->sorted_begin[i] = b->sorted_begin[i] + b->child_offset[child ];
tmp->sorted_end [i] = b->sorted_begin[i] + b->child_offset[child+1];
@@ -191,9 +191,9 @@ RTBuilder* rtbuild_get_child(RTBuilder *b, int child, RTBuilder *tmp)
void rtbuild_calc_bb(RTBuilder *b)
{
- if(b->bb[0] == 1.0e30f)
+ if (b->bb[0] == 1.0e30f)
{
- for(RTBuilder::Object **index = b->sorted_begin[0]; index != b->sorted_end[0]; index++)
+ for (RTBuilder::Object **index = b->sorted_begin[0]; index != b->sorted_end[0]; index++)
RE_rayobject_merge_bb( (*index)->obj , b->bb, b->bb+3);
}
}
@@ -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);
@@ -225,20 +225,20 @@ int rtbuild_mean_split(RTBuilder *b, int nchilds, int axis)
assert(nchilds <= RTBUILD_MAX_CHILDS);
//TODO optimize calc of leafs_per_child
- for(s=nchilds; s<tot_leafs; s*=nchilds);
+ for (s=nchilds; s<tot_leafs; s*=nchilds);
Mleafs_per_child = s/nchilds;
mleafs_per_child = Mleafs_per_child/nchilds;
//split min leafs per child
b->child_offset[0] = 0;
- for(i=1; i<=nchilds; i++)
+ for (i=1; i<=nchilds; i++)
b->child_offset[i] = mleafs_per_child;
//split remaining leafs
missing_leafs = tot_leafs - mleafs_per_child*nchilds;
- for(i=1; i<=nchilds; i++)
+ for (i=1; i<=nchilds; i++)
{
- if(missing_leafs > Mleafs_per_child - mleafs_per_child)
+ if (missing_leafs > Mleafs_per_child - mleafs_per_child)
{
b->child_offset[i] += Mleafs_per_child - mleafs_per_child;
missing_leafs -= Mleafs_per_child - mleafs_per_child;
@@ -252,11 +252,11 @@ int rtbuild_mean_split(RTBuilder *b, int nchilds, int axis)
}
//adjust for accumulative offsets
- for(i=1; i<=nchilds; i++)
+ for (i=1; i<=nchilds; i++)
b->child_offset[i] += b->child_offset[i-1];
//Count created childs
- for(i=nchilds; b->child_offset[i] == b->child_offset[i-1]; i--);
+ for (i=nchilds; b->child_offset[i] == b->child_offset[i-1]; i--);
split_leafs(b, b->child_offset, i, axis);
assert( b->child_offset[0] == 0 && b->child_offset[i] == tot_leafs );
@@ -269,19 +269,19 @@ 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);
assert(nchilds <= RTBUILD_MAX_CHILDS);
- if(size <= nchilds)
+ if (size <= nchilds)
{
return rtbuild_mean_split(b, nchilds, axis);
}
@@ -293,12 +293,12 @@ int rtbuild_median_split(RTBuilder *b, float *separators, int nchilds, int axis)
//Calculate child offsets
b->child_offset[0] = 0;
- for(i=0; i<nchilds-1; i++)
+ for (i=0; i<nchilds-1; i++)
b->child_offset[i+1] = split_leafs_by_plane(b, b->child_offset[i], size, separators[i]);
b->child_offset[nchilds] = size;
- for(i=0; i<nchilds; i++)
- if(b->child_offset[i+1] - b->child_offset[i] == size)
+ for (i=0; i<nchilds; i++)
+ if (b->child_offset[i+1] - b->child_offset[i] == size)
return rtbuild_mean_split(b, nchilds, axis);
return nchilds;
@@ -313,12 +313,12 @@ int rtbuild_median_split_largest_axis(RTBuilder *b, int nchilds)
rtbuild_calc_bb(b);
la = bb_largest_axis(b->bb,b->bb+3);
- for(i=1; i<nchilds; i++)
+ for (i=1; i<nchilds; i++)
separators[i-1] = (b->bb[la+3]-b->bb[la])*i / nchilds;
return rtbuild_median_split(b, separators, nchilds, la);
}
-*/
+#endif
//Heuristics Object Splitter
@@ -337,23 +337,23 @@ int rtbuild_heuristic_object_split(RTBuilder *b, int nchilds)
assert(size > 1);
int baxis = -1, boffset = 0;
- if(size > nchilds)
+ if (size > nchilds)
{
float bcost = FLT_MAX;
baxis = -1, boffset = size/2;
SweepCost *sweep = (SweepCost*)MEM_mallocN( sizeof(SweepCost)*size, "RTBuilder.HeuristicSweep" );
- for(int axis=0; axis<3; axis++)
+ for (int axis=0; axis<3; axis++)
{
SweepCost sweep_left;
RTBuilder::Object **obj = b->sorted_begin[axis];
// float right_cost = 0;
- for(int i=size-1; i>=0; i--)
+ for (int i=size-1; i>=0; i--)
{
- if(i == size-1)
+ if (i == size-1)
{
copy_v3_v3(sweep[i].bb, obj[i]->bb);
copy_v3_v3(sweep[i].bb+3, obj[i]->bb+3);
@@ -380,9 +380,9 @@ int rtbuild_heuristic_object_split(RTBuilder *b, int nchilds)
sweep_left.bb[5] = obj[0]->bb[5];
sweep_left.cost = obj[0]->cost;
-// right_cost -= obj[0]->cost; if(right_cost < 0) right_cost = 0;
+// right_cost -= obj[0]->cost; if (right_cost < 0) right_cost = 0;
- for(int i=1; i<size; i++)
+ for (int i=1; i<size; i++)
{
//Worst case heuristic (cost of each child is linear)
float hcost, left_side, right_side;
@@ -398,10 +398,10 @@ int rtbuild_heuristic_object_split(RTBuilder *b, int nchilds)
assert(left_side >= 0);
assert(right_side >= 0);
- if(left_side > bcost) break; //No way we can find a better heuristic in this axis
+ if (left_side > bcost) break; //No way we can find a better heuristic in this axis
assert(hcost >= 0);
- if( hcost < bcost
+ if ( hcost < bcost
|| (hcost == bcost && axis < baxis)) //this makes sure the tree built is the same whatever is the order of the sorting axis
{
bcost = hcost;
@@ -412,7 +412,7 @@ int rtbuild_heuristic_object_split(RTBuilder *b, int nchilds)
DO_MAX( obj[i]->bb+3, sweep_left.bb+3 );
sweep_left.cost += obj[i]->cost;
-// right_cost -= obj[i]->cost; if(right_cost < 0) right_cost = 0;
+// right_cost -= obj[i]->cost; if (right_cost < 0) right_cost = 0;
}
//assert(baxis >= 0 && baxis < 3);
@@ -423,12 +423,12 @@ int rtbuild_heuristic_object_split(RTBuilder *b, int nchilds)
MEM_freeN(sweep);
}
- else if(size == 2)
+ else if (size == 2)
{
baxis = 0;
boffset = 1;
}
- else if(size == 1)
+ else if (size == 1)
{
b->child_offset[0] = 0;
b->child_offset[1] = 1;
@@ -441,9 +441,9 @@ int rtbuild_heuristic_object_split(RTBuilder *b, int nchilds)
/* Adjust sorted arrays for childs */
- for(int i=0; i<boffset; i++) b->sorted_begin[baxis][i]->selected = true;
- for(int i=boffset; i<size; i++) b->sorted_begin[baxis][i]->selected = false;
- for(int i=0; i<3; i++)
+ for (int i=0; i<boffset; i++) b->sorted_begin[baxis][i]->selected = true;
+ for (int i=boffset; i<size; i++) b->sorted_begin[baxis][i]->selected = false;
+ for (int i=0; i<3; i++)
std::stable_partition( b->sorted_begin[i], b->sorted_end[i], selected_node );
return nchilds;
@@ -454,22 +454,22 @@ 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;
b->split_axis = split_axis;
- for(i=0; i < partitions-1; i++)
+ for (i=0; i < partitions-1; i++)
{
assert(nth[i] < nth[i+1] && nth[i+1] < nth[partitions]);
- if(split_axis == 0) std::nth_element(b, nth[i], nth[i+1], nth[partitions], obj_bb_compare<RTBuilder::Object,0>);
- if(split_axis == 1) std::nth_element(b, nth[i], nth[i+1], nth[partitions], obj_bb_compare<RTBuilder::Object,1>);
- if(split_axis == 2) std::nth_element(b, nth[i], nth[i+1], nth[partitions], obj_bb_compare<RTBuilder::Object,2>);
+ if (split_axis == 0) std::nth_element(b, nth[i], nth[i+1], nth[partitions], obj_bb_compare<RTBuilder::Object,0>);
+ if (split_axis == 1) std::nth_element(b, nth[i], nth[i+1], nth[partitions], obj_bb_compare<RTBuilder::Object,1>);
+ 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
@@ -500,16 +500,16 @@ int bb_largest_axis(float *min, float *max)
sub[0] = max[0]-min[0];
sub[1] = max[1]-min[1];
sub[2] = max[2]-min[2];
- if(sub[0] > sub[1])
+ if (sub[0] > sub[1])
{
- if(sub[0] > sub[2])
+ if (sub[0] > sub[2])
return 0;
else
return 2;
}
else
{
- if(sub[1] > sub[2])
+ if (sub[1] > sub[2])
return 1;
else
return 2;
@@ -519,11 +519,11 @@ int bb_largest_axis(float *min, float *max)
int bb_fits_inside(float *outer_min, float *outer_max, float *inner_min, float *inner_max)
{
int i;
- for(i=0; i<3; i++)
- if(outer_min[i] > inner_min[i]) return 0;
+ for (i=0; i<3; i++)
+ if (outer_min[i] > inner_min[i]) return 0;
- for(i=0; i<3; i++)
- if(outer_max[i] < inner_max[i]) return 0;
+ for (i=0; i<3; i++)
+ if (outer_max[i] < inner_max[i]) return 0;
return 1;
}
diff --git a/source/blender/render/intern/raytrace/rayobject_svbvh.cpp b/source/blender/render/intern/raytrace/rayobject_svbvh.cpp
index 7ce444a2e99..4c2099eb1e3 100644
--- a/source/blender/render/intern/raytrace/rayobject_svbvh.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_svbvh.cpp
@@ -79,11 +79,11 @@ void bvh_done<SVBVHTree>(SVBVHTree *obj)
BLI_memarena_use_align(arena2, 16);
//Build and optimize the tree
- if(0)
+ if (0)
{
VBVHNode *root = BuildBinaryVBVH<VBVHNode>(arena1, &obj->rayobj.control).transform(obj->builder);
- if(RE_rayobjectcontrol_test_break(&obj->rayobj.control))
+ if (RE_rayobjectcontrol_test_break(&obj->rayobj.control))
{
BLI_memarena_free(arena1);
BLI_memarena_free(arena2);
@@ -106,14 +106,14 @@ void bvh_done<SVBVHTree>(SVBVHTree *obj)
//TODO this uses quite a lot of memory, find ways to reduce memory usage during building
OVBVHNode *root = BuildBinaryVBVH<OVBVHNode>(arena1,&obj->rayobj.control).transform(obj->builder);
- if(RE_rayobjectcontrol_test_break(&obj->rayobj.control))
+ if (RE_rayobjectcontrol_test_break(&obj->rayobj.control))
{
BLI_memarena_free(arena1);
BLI_memarena_free(arena2);
return;
}
- if(root) {
+ if (root) {
VBVH_optimalPackSIMD<OVBVHNode,PackCost>(PackCost()).transform(root);
obj->root = Reorganize_SVBVH<OVBVHNode>(arena2).transform(root);
}
@@ -135,8 +135,8 @@ template<int StackSize>
int intersect(SVBVHTree *obj, Isect* isec)
{
//TODO renable hint support
- if(RE_rayobject_isAligned(obj->root)) {
- if(isec->mode == RE_RAY_SHADOW)
+ if (RE_rayobject_isAligned(obj->root)) {
+ if (isec->mode == RE_RAY_SHADOW)
return svbvh_node_stack_raycast<StackSize,true>(obj->root, isec);
else
return svbvh_node_stack_raycast<StackSize,false>(obj->root, isec);
@@ -177,9 +177,9 @@ RayObjectAPI* bvh_get_api(int maxstacksize)
{
static RayObjectAPI bvh_api256 = make_api<Tree,1024>();
- if(maxstacksize <= 1024) return &bvh_api256;
+ if (maxstacksize <= 1024) return &bvh_api256;
assert(maxstacksize <= 256);
- return 0;
+ return NULL;
}
RayObject *RE_rayobject_svbvh_create(int size)
diff --git a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
index 75323cfe56a..e82623f1da9 100644
--- a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
@@ -87,16 +87,16 @@ void bvh_done<VBVHTree>(VBVHTree *obj)
BLI_memarena_use_malloc(arena1);
//Build and optimize the tree
- if(1)
+ if (1)
{
VBVHNode *root = BuildBinaryVBVH<VBVHNode>(arena1,&obj->rayobj.control).transform(obj->builder);
- if(RE_rayobjectcontrol_test_break(&obj->rayobj.control))
+ if (RE_rayobjectcontrol_test_break(&obj->rayobj.control))
{
BLI_memarena_free(arena1);
return;
}
- if(root) {
+ if (root) {
reorganize(root);
remove_useless(root, &root);
bvh_refit(root);
@@ -137,8 +137,8 @@ template<int StackSize>
int intersect(VBVHTree *obj, Isect* isec)
{
//TODO renable hint support
- if(RE_rayobject_isAligned(obj->root)) {
- if(isec->mode == RE_RAY_SHADOW)
+ if (RE_rayobject_isAligned(obj->root)) {
+ if (isec->mode == RE_RAY_SHADOW)
return bvh_node_stack_raycast<VBVHNode,StackSize,false,true>( obj->root, isec);
else
return bvh_node_stack_raycast<VBVHNode,StackSize,false,false>( obj->root, isec);
@@ -159,9 +159,9 @@ void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(m
void bfree(VBVHTree *tree)
{
- if(tot_pushup + tot_pushdown + tot_hints + tot_moves)
+ if (tot_pushup + tot_pushdown + tot_hints + tot_moves)
{
- if(G.f & G_DEBUG) {
+ if (G.debug & G_DEBUG) {
printf("tot pushups: %d\n", tot_pushup);
printf("tot pushdowns: %d\n", tot_pushdown);
printf("tot moves: %d\n", tot_moves);
@@ -199,7 +199,7 @@ RayObjectAPI* bvh_get_api(int maxstacksize)
{
static RayObjectAPI bvh_api256 = make_api<Tree,1024>();
- if(maxstacksize <= 1024) return &bvh_api256;
+ if (maxstacksize <= 1024) return &bvh_api256;
assert(maxstacksize <= 256);
return 0;
}
diff --git a/source/blender/render/intern/raytrace/reorganize.h b/source/blender/render/intern/raytrace/reorganize.h
index 6efe37b81a3..68b2b22ecdd 100644
--- a/source/blender/render/intern/raytrace/reorganize.h
+++ b/source/blender/render/intern/raytrace/reorganize.h
@@ -144,7 +144,7 @@ void remove_useless(Node *node, Node **new_node)
{
Node *next = (*prev)->sibling;
remove_useless(*prev, prev);
- if(*prev == 0)
+ if(*prev == NULL)
*prev = next;
else
{
@@ -158,8 +158,10 @@ void remove_useless(Node *node, Node **new_node)
if(RE_rayobject_isAligned(node->child) && node->child->sibling == 0)
*new_node = node->child;
}
- else if(node->child == 0)
- *new_node = 0;
+ else if(node->child == NULL)
+ {
+ *new_node = NULL;
+ }
}
/*
@@ -271,8 +273,9 @@ void pushdown(Node *parent)
s_child = next_s_child;
}
- for(Node *i = parent->child; RE_rayobject_isAligned(i) && i; i = i->sibling)
- pushdown( i );
+ for (Node *i = parent->child; RE_rayobject_isAligned(i) && i; i = i->sibling) {
+ pushdown(i);
+ }
}
@@ -526,7 +529,7 @@ struct VBVH_optimalPackSIMD
if(num == 0) { num++; first = true; }
calc_costs(node);
- if((G.f & G_DEBUG) && first) printf("expected cost = %f (%d)\n", node->cut_cost[0], node->best_cutsize );
+ if((G.debug & G_DEBUG) && first) printf("expected cost = %f (%d)\n", node->cut_cost[0], node->best_cutsize );
node->optimize();
}
return node;
diff --git a/source/blender/render/intern/raytrace/svbvh.h b/source/blender/render/intern/raytrace/svbvh.h
index 8fb2db63df6..e0e96781f36 100644
--- a/source/blender/render/intern/raytrace/svbvh.h
+++ b/source/blender/render/intern/raytrace/svbvh.h
@@ -224,7 +224,7 @@ struct Reorganize_SVBVH
~Reorganize_SVBVH()
{
- if(G.f & G_DEBUG) {
+ if(G.debug & G_DEBUG) {
printf("%f childs per node\n", childs_per_node / nodes);
printf("%d childs BB are useless\n", useless_bb);
for(int i=0; i<16; i++)
@@ -296,7 +296,7 @@ struct Reorganize_SVBVH
{
const static float def_bb[6] = { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MIN, FLT_MIN, FLT_MIN };
alloc_childs--;
- node->child[alloc_childs] = 0;
+ node->child[alloc_childs] = NULL;
copy_bb(node->child_bb+alloc_childs*6, def_bb);
}
diff --git a/source/blender/render/intern/raytrace/vbvh.h b/source/blender/render/intern/raytrace/vbvh.h
index ab6a1bbfd33..1c84cd23510 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;
}
}
@@ -164,8 +167,8 @@ struct BuildBinaryVBVH
{
Node *node = create_node();
INIT_MINMAX(node->bb, node->bb+3);
- rtbuild_merge_bb(builder, node->bb, node->bb+3);
- node->child = (Node*) rtbuild_get_primitive( builder, 0 );
+ rtbuild_merge_bb(builder, node->bb, node->bb+3);
+ node->child = (Node *) rtbuild_get_primitive(builder, 0);
return node;
}
else
@@ -191,13 +194,13 @@ struct BuildBinaryVBVH
child = &((*child)->sibling);
}
- *child = 0;
+ *child = NULL;
return node;
}
}
};
-/*
+#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 30dc401da27..9b12d556320 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -126,7 +126,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. */
@@ -149,10 +149,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))
@@ -171,7 +171,7 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
int x, y, z, sx, sy, sz, ex, ey, ez, done = 0;
unsigned int totstar= 0;
- if(initfunc) {
+ if (initfunc) {
scene= scenev3d;
wrld= scene->world;
}
@@ -195,18 +195,18 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
if (re) re->flag |= R_HALO;
else stargrid *= 1.0f; /* then it draws fewer */
- if(re) invert_m4_m4(mat, re->viewmat);
+ if (re) invert_m4_m4(mat, re->viewmat);
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;
- if(camera==NULL || camera->type != OB_CAMERA)
+ if (camera==NULL || camera->type != OB_CAMERA)
return;
cam = camera->data;
@@ -229,7 +229,7 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
initfunc();
}
- if(re) /* add render object for stars */
+ if (re) /* add render object for stars */
obr= RE_addRenderObject(re, NULL, NULL, 0, 0, 0);
for (x = sx, fx = sx * stargrid; x <= ex; x++, fx += stargrid) {
@@ -243,16 +243,16 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
vec[3] = 1.0;
if (vertexfunc) {
- if(done & 1) vertexfunc(vec);
+ if (done & 1) vertexfunc(vec);
done++;
}
else {
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;
@@ -267,7 +267,8 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
else if (alpha <= starmindist) alpha = 0.0;
else if (alpha <= 2.0f * starmindist) {
alpha = (alpha - starmindist) / starmindist;
- } else {
+ }
+ else {
alpha -= 2.0f * starmindist;
alpha /= (clipend - 2.0f * starmindist);
alpha = 1.0f - alpha;
@@ -298,8 +299,8 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
}
/* break out of the loop if generating stars takes too long */
- if(re && !(totstar % 1000000)) {
- if(re->test_break(re->tbh)) {
+ if (re && !(totstar % 1000000)) {
+ if (re->test_break(re->tbh)) {
x= ex + 1;
y= ey + 1;
z= ez + 1;
@@ -314,14 +315,14 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
}
if (termfunc) termfunc();
- if(obr)
+ if (obr)
re->tothalo += obr->tothalo;
}
/* ------------------------------------------------------------------------- */
/* tool functions/defines for ad hoc simplification and possible future
- cleanup */
+ * cleanup */
/* ------------------------------------------------------------------------- */
#define UVTOINDEX(u,v) (startvlak + (u) * sizev + (v))
@@ -354,11 +355,13 @@ static void split_v_renderfaces(ObjectRen *obr, int startvlak, int UNUSED(startv
if (v==vLen-1) {
VlakRen *vlr = RE_findOrAddVlak(obr, startvlak + vLen*uIndex + 0);
vlr->v1 = vert;
- } else {
+ }
+ else {
VlakRen *vlr = RE_findOrAddVlak(obr, startvlak + vLen*uIndex + v+1);
vlr->v1 = vert;
}
- } else {
+ }
+ else {
vlr->v2 = vert;
if (v<vLen-1) {
@@ -396,16 +399,16 @@ static void calc_edge_stress(Render *UNUSED(re), ObjectRen *obr, Mesh *me)
float loc[3], size[3], *accum, *acc, *accumoffs, *stress;
int a;
- if(obr->totvert==0) return;
+ if (obr->totvert==0) return;
mesh_get_texspace(me, loc, NULL, size);
accum= MEM_callocN(2*sizeof(float)*obr->totvert, "temp accum for stress");
/* de-normalize orco */
- for(a=0; a<obr->totvert; a++) {
+ for (a=0; a<obr->totvert; a++) {
VertRen *ver= RE_findOrAddVert(obr, a);
- if(ver->orco) {
+ if (ver->orco) {
ver->orco[0]= ver->orco[0]*size[0] +loc[0];
ver->orco[1]= ver->orco[1]*size[1] +loc[1];
ver->orco[2]= ver->orco[2]*size[2] +loc[2];
@@ -414,14 +417,14 @@ static void calc_edge_stress(Render *UNUSED(re), ObjectRen *obr, Mesh *me)
/* add stress values */
accumoffs= accum; /* so we can use vertex index */
- for(a=0; a<obr->totvlak; a++) {
+ for (a=0; a<obr->totvlak; a++) {
VlakRen *vlr= RE_findOrAddVlak(obr, a);
- if(vlr->v1->orco && vlr->v4) {
+ if (vlr->v1->orco && vlr->v4) {
calc_edge_stress_add(accumoffs, vlr->v1, vlr->v2);
calc_edge_stress_add(accumoffs, vlr->v2, vlr->v3);
calc_edge_stress_add(accumoffs, vlr->v3, vlr->v1);
- if(vlr->v4) {
+ if (vlr->v4) {
calc_edge_stress_add(accumoffs, vlr->v3, vlr->v4);
calc_edge_stress_add(accumoffs, vlr->v4, vlr->v1);
calc_edge_stress_add(accumoffs, vlr->v2, vlr->v4);
@@ -429,12 +432,12 @@ static void calc_edge_stress(Render *UNUSED(re), ObjectRen *obr, Mesh *me)
}
}
- for(a=0; a<obr->totvert; a++) {
+ for (a=0; a<obr->totvert; a++) {
VertRen *ver= RE_findOrAddVert(obr, a);
- if(ver->orco) {
+ if (ver->orco) {
/* find stress value */
acc= accumoffs + 2*ver->index;
- if(acc[1]!=0.0f)
+ if (acc[1]!=0.0f)
acc[0]/= acc[1];
stress= RE_vertren_get_stress(obr, ver, 1);
*stress= *acc;
@@ -458,25 +461,25 @@ static void calc_tangent_vector(ObjectRen *obr, VertexTangent **vtangents, MemAr
float *uv1, *uv2, *uv3, *uv4;
float uv[4][2];
- if(tface) {
+ if (tface) {
uv1= tface->uv[0];
uv2= tface->uv[1];
uv3= tface->uv[2];
uv4= tface->uv[3];
}
- else if(v1->orco) {
+ else if (v1->orco) {
uv1= uv[0]; uv2= uv[1]; uv3= uv[2]; uv4= uv[3];
map_to_sphere( &uv[0][0], &uv[0][1],v1->orco[0], v1->orco[1], v1->orco[2]);
map_to_sphere( &uv[1][0], &uv[1][1],v2->orco[0], v2->orco[1], v2->orco[2]);
map_to_sphere( &uv[2][0], &uv[2][1],v3->orco[0], v3->orco[1], v3->orco[2]);
- if(v4)
+ if (v4)
map_to_sphere( &uv[3][0], &uv[3][1],v4->orco[0], v4->orco[1], v4->orco[2]);
}
else return;
tangent_from_uv(uv1, uv2, uv3, v1->co, v2->co, v3->co, vlr->n, tang);
- if(do_tangent) {
+ if (do_tangent) {
tav= RE_vertren_get_tangent(obr, v1, 1);
add_v3_v3(tav, tang);
tav= RE_vertren_get_tangent(obr, v2, 1);
@@ -485,16 +488,16 @@ static void calc_tangent_vector(ObjectRen *obr, VertexTangent **vtangents, MemAr
add_v3_v3(tav, tang);
}
- if(do_nmap_tangent) {
+ if (do_nmap_tangent) {
sum_or_add_vertex_tangent(arena, &vtangents[v1->index], tang, uv1);
sum_or_add_vertex_tangent(arena, &vtangents[v2->index], tang, uv2);
sum_or_add_vertex_tangent(arena, &vtangents[v3->index], tang, uv3);
}
- if(v4) {
+ if (v4) {
tangent_from_uv(uv1, uv3, uv4, v1->co, v3->co, v4->co, vlr->n, tang);
- if(do_tangent) {
+ if (do_tangent) {
tav= RE_vertren_get_tangent(obr, v1, 1);
add_v3_v3(tav, tang);
tav= RE_vertren_get_tangent(obr, v3, 1);
@@ -503,7 +506,7 @@ static void calc_tangent_vector(ObjectRen *obr, VertexTangent **vtangents, MemAr
add_v3_v3(tav, tang);
}
- if(do_nmap_tangent) {
+ if (do_nmap_tangent) {
sum_or_add_vertex_tangent(arena, &vtangents[v1->index], tang, uv1);
sum_or_add_vertex_tangent(arena, &vtangents[v3->index], tang, uv3);
sum_or_add_vertex_tangent(arena, &vtangents[v4->index], tang, uv4);
@@ -514,8 +517,8 @@ static void calc_tangent_vector(ObjectRen *obr, VertexTangent **vtangents, MemAr
/****************************************************************
-************ tangent space generation interface *****************
-****************************************************************/
+ ************ tangent space generation interface ****************
+ ****************************************************************/
typedef struct
{
@@ -556,11 +559,11 @@ static void GetTextureCoordinate(const SMikkTSpaceContext * pContext, float fUV[
MTFace *tface= RE_vlakren_get_tface(pMesh->obr, vlr, pMesh->obr->actmtface, NULL, 0);
const float *coord;
- if(tface != NULL) {
+ if (tface != NULL) {
coord= tface->uv[vert_index];
fUV[0]= coord[0]; fUV[1]= coord[1];
}
- else if((coord= (&vlr->v1)[vert_index]->orco)) {
+ else if ((coord= (&vlr->v1)[vert_index]->orco)) {
map_to_sphere(&fUV[0], &fUV[1], coord[0], coord[1], coord[2]);
}
else { /* else we get un-initialized value, 0.0 ok default? */
@@ -582,7 +585,7 @@ static void SetTSpace(const SMikkTSpaceContext * pContext, const float fvTangent
SRenderMeshToTangent * pMesh = (SRenderMeshToTangent *) pContext->m_pUserData;
VlakRen *vlr= RE_findOrAddVlak(pMesh->obr, face_num);
float * ftang= RE_vlakren_get_nmap_tangent(pMesh->obr, vlr, 1);
- if(ftang!=NULL) {
+ if (ftang!=NULL) {
copy_v3_v3(&ftang[iVert*4+0], fvTangent);
ftang[iVert*4+3]=fSign;
}
@@ -594,7 +597,7 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, int do_tangen
VertexTangent **vtangents= NULL;
int a;
- if(do_nmap_tangent) {
+ if (do_nmap_tangent) {
arena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "nmap tangent arena");
BLI_memarena_use_calloc(arena);
@@ -602,23 +605,23 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, int do_tangen
}
/* clear all vertex normals */
- for(a=0; a<obr->totvert; a++) {
+ for (a=0; a<obr->totvert; a++) {
VertRen *ver= RE_findOrAddVert(obr, a);
ver->n[0]=ver->n[1]=ver->n[2]= 0.0f;
}
/* calculate cos of angles and point-masses, use as weight factor to
- add face normal to vertex */
- for(a=0; a<obr->totvlak; a++) {
+ * add face normal to vertex */
+ for (a=0; a<obr->totvlak; a++) {
VlakRen *vlr= RE_findOrAddVlak(obr, a);
- if(vlr->flag & ME_SMOOTH) {
+ if (vlr->flag & ME_SMOOTH) {
float *n4= (vlr->v4)? vlr->v4->n: NULL;
float *c4= (vlr->v4)? vlr->v4->co: NULL;
accumulate_vertex_normals(vlr->v1->n, vlr->v2->n, vlr->v3->n, n4,
vlr->n, vlr->v1->co, vlr->v2->co, vlr->v3->co, c4);
}
- if(do_nmap_tangent || do_tangent) {
+ if (do_nmap_tangent || do_tangent) {
/* tangents still need to be calculated for flat faces too */
/* weighting removed, they are not vertexnormals */
calc_tangent_vector(obr, vtangents, arena, vlr, do_nmap_tangent, do_tangent);
@@ -626,21 +629,21 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, int do_tangen
}
/* do solid faces */
- for(a=0; a<obr->totvlak; a++) {
+ for (a=0; a<obr->totvlak; a++) {
VlakRen *vlr= RE_findOrAddVlak(obr, a);
- if((vlr->flag & ME_SMOOTH)==0) {
- if(is_zero_v3(vlr->v1->n)) copy_v3_v3(vlr->v1->n, vlr->n);
- if(is_zero_v3(vlr->v2->n)) copy_v3_v3(vlr->v2->n, vlr->n);
- if(is_zero_v3(vlr->v3->n)) copy_v3_v3(vlr->v3->n, vlr->n);
- if(vlr->v4 && is_zero_v3(vlr->v4->n)) copy_v3_v3(vlr->v4->n, vlr->n);
+ if ((vlr->flag & ME_SMOOTH)==0) {
+ if (is_zero_v3(vlr->v1->n)) copy_v3_v3(vlr->v1->n, vlr->n);
+ if (is_zero_v3(vlr->v2->n)) copy_v3_v3(vlr->v2->n, vlr->n);
+ if (is_zero_v3(vlr->v3->n)) copy_v3_v3(vlr->v3->n, vlr->n);
+ if (vlr->v4 && is_zero_v3(vlr->v4->n)) copy_v3_v3(vlr->v4->n, vlr->n);
}
- if(do_nmap_tangent) {
+ if (do_nmap_tangent) {
VertRen *v1=vlr->v1, *v2=vlr->v2, *v3=vlr->v3, *v4=vlr->v4;
MTFace *tface= RE_vlakren_get_tface(obr, vlr, obr->actmtface, NULL, 0);
- if(tface) {
+ if (tface) {
int k=0;
float *vtang, *ftang= RE_vlakren_get_nmap_tangent(obr, vlr, 1);
@@ -653,21 +656,21 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, int do_tangen
vtang= find_vertex_tangent(vtangents[v3->index], tface->uv[2]);
copy_v3_v3(ftang+8, vtang);
normalize_v3(ftang+8);
- if(v4) {
+ if (v4) {
vtang= find_vertex_tangent(vtangents[v4->index], tface->uv[3]);
copy_v3_v3(ftang+12, vtang);
normalize_v3(ftang+12);
}
- for(k=0; k<4; k++) ftang[4*k+3]=1;
+ for (k=0; k<4; k++) ftang[4*k+3]=1;
}
}
}
- /* 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) {
+ if (do_tangent) {
float *tav= RE_vertren_get_tangent(obr, ver, 0);
if (tav) {
/* orthonorm. */
@@ -680,8 +683,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;
@@ -703,9 +705,9 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, int do_tangen
genTangSpaceDefault(&sContext);
}
- if(arena)
+ if (arena)
BLI_memarena_free(arena);
- if(vtangents)
+ if (vtangents)
MEM_freeN(vtangents);
}
@@ -729,16 +731,16 @@ static void as_addvert(ASvert *asv, VertRen *v1, VlakRen *vlr)
ASface *asf;
int a;
- if(v1 == NULL) return;
+ if (v1 == NULL) return;
- if(asv->faces.first==NULL) {
+ if (asv->faces.first==NULL) {
asf= MEM_callocN(sizeof(ASface), "asface");
BLI_addtail(&asv->faces, asf);
}
asf= asv->faces.last;
- for(a=0; a<4; a++) {
- if(asf->vlr[a]==NULL) {
+ for (a=0; a<4; a++) {
+ if (asf->vlr[a]==NULL) {
asf->vlr[a]= vlr;
asv->totface++;
break;
@@ -746,7 +748,7 @@ static void as_addvert(ASvert *asv, VertRen *v1, VlakRen *vlr)
}
/* new face struct */
- if(a==4) {
+ if (a==4) {
asf= MEM_callocN(sizeof(ASface), "asface");
BLI_addtail(&asv->faces, asf);
asf->vlr[0]= vlr;
@@ -761,14 +763,14 @@ static int as_testvertex(VlakRen *vlr, VertRen *UNUSED(ver), ASvert *asv, float
float inp;
int a;
- if(vlr==0) return 0;
+ if (vlr==0) return 0;
asf= asv->faces.first;
- while(asf) {
- for(a=0; a<4; a++) {
- if(asf->vlr[a] && asf->vlr[a]!=vlr) {
+ while (asf) {
+ for (a=0; a<4; a++) {
+ if (asf->vlr[a] && asf->vlr[a]!=vlr) {
inp = fabsf(dot_v3v3(vlr->n, asf->vlr[a]->n));
- if(inp < thresh) return 1;
+ if (inp < thresh) return 1;
}
}
asf= asf->next;
@@ -785,13 +787,13 @@ static VertRen *as_findvertex(VlakRen *vlr, VertRen *UNUSED(ver), ASvert *asv, f
int a;
asf= asv->faces.first;
- while(asf) {
- for(a=0; a<4; a++) {
- if(asf->vlr[a] && asf->vlr[a]!=vlr) {
+ while (asf) {
+ for (a=0; a<4; a++) {
+ if (asf->vlr[a] && asf->vlr[a]!=vlr) {
/* this face already made a copy for this vertex! */
- if(asf->nver[a]) {
+ if (asf->nver[a]) {
inp = fabsf(dot_v3v3(vlr->n, asf->vlr[a]->n));
- if(inp >= thresh) {
+ if (inp >= thresh) {
return asf->nver[a];
}
}
@@ -814,7 +816,7 @@ static void autosmooth(Render *UNUSED(re), ObjectRen *obr, float mat[][4], int d
float thresh;
int a, b, totvert;
- if(obr->totvert==0) return;
+ if (obr->totvert==0) return;
asverts= MEM_callocN(sizeof(ASvert)*obr->totvert, "all smooth verts");
thresh= cosf(DEG2RADF((0.5f + (float)degr)));
@@ -823,43 +825,43 @@ static void autosmooth(Render *UNUSED(re), ObjectRen *obr, float mat[][4], int d
/* step one: construct listbase of all vertices and pointers to faces */
- for(a=0; a<obr->totvlak; a++) {
+ for (a=0; a<obr->totvlak; a++) {
vlr= RE_findOrAddVlak(obr, a);
/* skip wire faces */
- if(vlr->v2 != vlr->v3) {
+ if (vlr->v2 != vlr->v3) {
as_addvert(asverts+vlr->v1->index, vlr->v1, vlr);
as_addvert(asverts+vlr->v2->index, vlr->v2, vlr);
as_addvert(asverts+vlr->v3->index, vlr->v3, vlr);
- if(vlr->v4)
+ if (vlr->v4)
as_addvert(asverts+vlr->v4->index, vlr->v4, vlr);
}
}
totvert= obr->totvert;
/* we now test all vertices, when faces have a normal too much different: they get a new vertex */
- for(a=0, asv=asverts; a<totvert; a++, asv++) {
- if(asv && asv->totface>1) {
+ for (a=0, asv=asverts; a<totvert; a++, asv++) {
+ if (asv && asv->totface>1) {
ver= RE_findOrAddVert(obr, a);
asf= asv->faces.first;
- while(asf) {
- for(b=0; b<4; b++) {
+ while (asf) {
+ for (b=0; b<4; b++) {
/* is there a reason to make a new vertex? */
vlr= asf->vlr[b];
- if( as_testvertex(vlr, ver, asv, thresh) ) {
+ if ( as_testvertex(vlr, ver, asv, thresh) ) {
/* already made a new vertex within threshold? */
v1= as_findvertex(vlr, ver, asv, thresh);
- if(v1==NULL) {
+ if (v1==NULL) {
/* make a new vertex */
v1= RE_vertren_copy(obr, ver);
}
asf->nver[b]= v1;
- if(vlr->v1==ver) vlr->v1= v1;
- if(vlr->v2==ver) vlr->v2= v1;
- if(vlr->v3==ver) vlr->v3= v1;
- if(vlr->v4==ver) vlr->v4= v1;
+ if (vlr->v1==ver) vlr->v1= v1;
+ if (vlr->v2==ver) vlr->v2= v1;
+ if (vlr->v3==ver) vlr->v3= v1;
+ if (vlr->v4==ver) vlr->v4= v1;
}
}
asf= asf->next;
@@ -868,22 +870,22 @@ static void autosmooth(Render *UNUSED(re), ObjectRen *obr, float mat[][4], int d
}
/* free */
- for(a=0; a<totvert; a++) {
+ for (a=0; a<totvert; a++) {
BLI_freelistN(&asverts[a].faces);
}
MEM_freeN(asverts);
/* rotate vertices and calculate normal of faces */
- for(a=0; a<obr->totvert; a++) {
+ for (a=0; a<obr->totvert; a++) {
ver= RE_findOrAddVert(obr, a);
mul_m4_v3(mat, ver->co);
}
- for(a=0; a<obr->totvlak; a++) {
+ for (a=0; a<obr->totvlak; a++) {
vlr= RE_findOrAddVlak(obr, a);
/* skip wire faces */
- if(vlr->v2 != vlr->v3) {
- if(vlr->v4)
+ if (vlr->v2 != vlr->v3) {
+ if (vlr->v4)
normal_quad_v3( vlr->n,vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
else
normal_tri_v3( vlr->n,vlr->v3->co, vlr->v2->co, vlr->v1->co);
@@ -907,7 +909,8 @@ static float *get_object_orco(Render *re, Object *ob)
if (!orco) {
if (ELEM(ob->type, OB_CURVE, OB_FONT)) {
orco = make_orco_curve(re->scene, ob);
- } else if (ob->type==OB_SURF) {
+ }
+ else if (ob->type==OB_SURF) {
orco = make_orco_surf(ob);
}
@@ -943,16 +946,16 @@ static void check_material_mapto(Material *ma)
* this can avoid a bit of time spent iterating through all the texture slots, map inputs and map tos
* every time a property which may or may not be textured is accessed */
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a] && ma->mtex[a]->tex) {
+ for (a=0; a<MAX_MTEX; a++) {
+ if (ma->mtex[a] && ma->mtex[a]->tex) {
/* currently used only in volume render, so we'll check for those flags */
- if(ma->mtex[a]->mapto & MAP_DENSITY) ma->mapto_textured |= MAP_DENSITY;
- if(ma->mtex[a]->mapto & MAP_EMISSION) ma->mapto_textured |= MAP_EMISSION;
- if(ma->mtex[a]->mapto & MAP_EMISSION_COL) ma->mapto_textured |= MAP_EMISSION_COL;
- if(ma->mtex[a]->mapto & MAP_SCATTERING) ma->mapto_textured |= MAP_SCATTERING;
- if(ma->mtex[a]->mapto & MAP_TRANSMISSION_COL) ma->mapto_textured |= MAP_TRANSMISSION_COL;
- if(ma->mtex[a]->mapto & MAP_REFLECTION) ma->mapto_textured |= MAP_REFLECTION;
- if(ma->mtex[a]->mapto & MAP_REFLECTION_COL) ma->mapto_textured |= MAP_REFLECTION_COL;
+ if (ma->mtex[a]->mapto & MAP_DENSITY) ma->mapto_textured |= MAP_DENSITY;
+ if (ma->mtex[a]->mapto & MAP_EMISSION) ma->mapto_textured |= MAP_EMISSION;
+ if (ma->mtex[a]->mapto & MAP_EMISSION_COL) ma->mapto_textured |= MAP_EMISSION_COL;
+ if (ma->mtex[a]->mapto & MAP_SCATTERING) ma->mapto_textured |= MAP_SCATTERING;
+ if (ma->mtex[a]->mapto & MAP_TRANSMISSION_COL) ma->mapto_textured |= MAP_TRANSMISSION_COL;
+ if (ma->mtex[a]->mapto & MAP_REFLECTION) ma->mapto_textured |= MAP_REFLECTION;
+ if (ma->mtex[a]->mapto & MAP_REFLECTION_COL) ma->mapto_textured |= MAP_REFLECTION_COL;
}
}
}
@@ -960,17 +963,17 @@ static void flag_render_node_material(Render *re, bNodeTree *ntree)
{
bNode *node;
- for(node=ntree->nodes.first; node; node= node->next) {
- if(node->id) {
- if(GS(node->id->name)==ID_MA) {
+ for (node=ntree->nodes.first; node; node= node->next) {
+ if (node->id) {
+ if (GS(node->id->name)==ID_MA) {
Material *ma= (Material *)node->id;
- if((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP))
+ if ((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP))
re->flag |= R_ZTRA;
ma->flag |= MA_IS_USED;
}
- else if(node->type==NODE_GROUP)
+ else if (node->type==NODE_GROUP)
flag_render_node_material(re, (bNodeTree *)node->id);
}
}
@@ -982,22 +985,22 @@ static Material *give_render_material(Render *re, Object *ob, short nr)
Material *ma;
ma= give_current_material(ob, nr);
- if(ma==NULL)
+ if (ma==NULL)
ma= &defmaterial;
- if(re->r.mode & R_SPEED) ma->texco |= NEED_UV;
+ if (re->r.mode & R_SPEED) ma->texco |= NEED_UV;
- if(ma->material_type == MA_TYPE_VOLUME) {
+ if (ma->material_type == MA_TYPE_VOLUME) {
ma->mode |= MA_TRANSP;
ma->mode &= ~MA_SHADBUF;
}
- if((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP))
+ if ((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP))
re->flag |= R_ZTRA;
/* for light groups and SSS */
ma->flag |= MA_IS_USED;
- if(ma->nodetree && ma->use_nodes)
+ if (ma->nodetree && ma->use_nodes)
flag_render_node_material(re, ma->nodetree);
check_material_mapto(ma);
@@ -1037,10 +1040,10 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
dy= re->winy*cross[1]*re->winmat[1][1];
w= sqrt(dx*dx + dy*dy)/w;
- if(w!=0.0f) {
+ if (w!=0.0f) {
float fac;
- if(ma->strand_ease!=0.0f) {
- if(ma->strand_ease<0.0f)
+ if (ma->strand_ease!=0.0f) {
+ if (ma->strand_ease<0.0f)
fac= pow(sd->time, 1.0f+ma->strand_ease);
else
fac= pow(sd->time, 1.0f/(1.0f-ma->strand_ease));
@@ -1050,11 +1053,11 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
width= ((1.0f-fac)*ma->strand_sta + (fac)*ma->strand_end);
/* use actual Blender units for strand width and fall back to minimum width */
- if(ma->mode & MA_STR_B_UNITS){
+ if (ma->mode & MA_STR_B_UNITS) {
crosslen= len_v3(cross);
w= 2.0f*crosslen*ma->strand_min/w;
- if(width < w)
+ if (width < w)
width= w;
/*cross is the radius of the strand so we want it to be half of full width */
@@ -1066,17 +1069,17 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
mul_v3_fl(cross, width);
}
- if(ma->mode & MA_TANGENT_STR)
+ if (ma->mode & MA_TANGENT_STR)
flag= R_SMOOTH|R_TANGENT;
else
flag= R_SMOOTH;
/* only 1 pixel wide strands filled in as quads now, otherwise zbuf errors */
- if(ma->strand_sta==1.0f)
+ if (ma->strand_sta==1.0f)
flag |= R_STRAND;
/* single face line */
- if(sd->line) {
+ if (sd->line) {
vlr= RE_findOrAddVlak(obr, obr->totvlak++);
vlr->flag= flag;
vlr->v1= RE_findOrAddVert(obr, obr->totvert++);
@@ -1113,13 +1116,13 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
vlr->mat= ma;
vlr->ec= ME_V2V3;
- if(sd->surfnor) {
+ if (sd->surfnor) {
float *snor= RE_vlakren_get_surfnor(obr, vlr, 1);
copy_v3_v3(snor, sd->surfnor);
}
- if(sd->uvco){
- for(i=0; i<sd->totuv; i++){
+ if (sd->uvco) {
+ for (i=0; i<sd->totuv; i++) {
MTFace *mtf;
mtf=RE_vlakren_get_tface(obr,vlr,i,NULL,1);
mtf->uv[0][0]=mtf->uv[1][0]=
@@ -1127,7 +1130,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
mtf->uv[0][1]=mtf->uv[1][1]=
mtf->uv[2][1]=mtf->uv[3][1]=(sd->uvco+2*i)[1];
}
- if(sd->override_uv>=0){
+ if (sd->override_uv>=0) {
MTFace *mtf;
mtf=RE_vlakren_get_tface(obr,vlr,sd->override_uv,NULL,0);
@@ -1138,8 +1141,8 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
mtf->uv[2][1]=mtf->uv[3][1]=1.0f;
}
}
- if(sd->mcol){
- for(i=0; i<sd->totcol; i++){
+ if (sd->mcol) {
+ for (i=0; i<sd->totcol; i++) {
MCol *mc;
mc=RE_vlakren_get_mcol(obr,vlr,i,NULL,1);
mc[0]=mc[1]=mc[2]=mc[3]=sd->mcol[i];
@@ -1148,8 +1151,8 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
}
}
/* first two vertices of a strand */
- else if(sd->first) {
- if(sd->adapt){
+ else if (sd->first) {
+ if (sd->adapt) {
copy_v3_v3(anor, nor);
copy_v3_v3(avec, vec);
second=1;
@@ -1172,7 +1175,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
}
/* more vertices & faces to strand */
else {
- if(sd->adapt==0 || second){
+ if (sd->adapt==0 || second) {
vlr= RE_findOrAddVlak(obr, obr->totvlak++);
vlr->flag= flag;
vlr->v1= v1;
@@ -1184,14 +1187,14 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
v2= vlr->v3; // cycle
- if(sd->adapt){
+ if (sd->adapt) {
second=0;
copy_v3_v3(anor,nor);
copy_v3_v3(avec,vec);
}
}
- else if(sd->adapt){
+ else if (sd->adapt) {
float dvec[3],pvec[3];
sub_v3_v3v3(dvec,avec,vec);
project_v3_v3v3(pvec,dvec,vec);
@@ -1201,7 +1204,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
dx= re->winx*dvec[0]*re->winmat[0][0]/w;
dy= re->winy*dvec[1]*re->winmat[1][1]/w;
w= sqrt(dx*dx + dy*dy);
- if(dot_v3v3(anor,nor)<sd->adapt_angle && w>sd->adapt_pix){
+ if (dot_v3v3(anor,nor)<sd->adapt_angle && w>sd->adapt_pix) {
vlr= RE_findOrAddVlak(obr, obr->totvlak++);
vlr->flag= flag;
vlr->v1= v1;
@@ -1215,7 +1218,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
copy_v3_v3(anor,nor);
copy_v3_v3(avec,vec);
}
- else{
+ else {
vlr= RE_findOrAddVlak(obr, obr->totvlak-1);
}
}
@@ -1237,13 +1240,13 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
vlr->mat= ma;
vlr->ec= ME_V2V3;
- if(sd->surfnor) {
+ if (sd->surfnor) {
float *snor= RE_vlakren_get_surfnor(obr, vlr, 1);
copy_v3_v3(snor, sd->surfnor);
}
- if(sd->uvco){
- for(i=0; i<sd->totuv; i++){
+ if (sd->uvco) {
+ for (i=0; i<sd->totuv; i++) {
MTFace *mtf;
mtf=RE_vlakren_get_tface(obr,vlr,i,NULL,1);
mtf->uv[0][0]=mtf->uv[1][0]=
@@ -1251,7 +1254,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
mtf->uv[0][1]=mtf->uv[1][1]=
mtf->uv[2][1]=mtf->uv[3][1]=(sd->uvco+2*i)[1];
}
- if(sd->override_uv>=0){
+ if (sd->override_uv>=0) {
MTFace *mtf;
mtf=RE_vlakren_get_tface(obr,vlr,sd->override_uv,NULL,0);
@@ -1262,8 +1265,8 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
mtf->uv[2][1]=mtf->uv[3][1]=(vlr->v3->accum+1.0f)/2.0f;
}
}
- if(sd->mcol){
- for(i=0; i<sd->totcol; i++){
+ if (sd->mcol) {
+ for (i=0; i<sd->totcol; i++) {
MCol *mc;
mc=RE_vlakren_get_mcol(obr,vlr,i,NULL,1);
mc[0]=mc[1]=mc[2]=mc[3]=sd->mcol[i];
@@ -1278,7 +1281,7 @@ static void static_particle_wire(ObjectRen *obr, Material *ma, const float vec[3
VlakRen *vlr;
static VertRen *v1;
- if(line) {
+ if (line) {
vlr= RE_findOrAddVlak(obr, obr->totvlak++);
vlr->v1= RE_findOrAddVert(obr, obr->totvert++);
vlr->v2= RE_findOrAddVert(obr, obr->totvert++);
@@ -1297,7 +1300,7 @@ static void static_particle_wire(ObjectRen *obr, Material *ma, const float vec[3
vlr->ec= ME_V1V2;
}
- else if(first) {
+ else if (first) {
v1= RE_findOrAddVert(obr, obr->totvert++);
copy_v3_v3(v1->co, vec);
}
@@ -1325,11 +1328,11 @@ static void particle_curve(Render *re, ObjectRen *obr, DerivedMesh *dm, Material
{
HaloRen *har=0;
- if(ma->material_type == MA_TYPE_WIRE)
+ if (ma->material_type == MA_TYPE_WIRE)
static_particle_wire(obr, ma, loc, loc1, sd->first, sd->line);
- else if(ma->material_type == MA_TYPE_HALO) {
+ else if (ma->material_type == MA_TYPE_HALO) {
har= RE_inithalo_particle(re, obr, dm, ma, loc, loc1, sd->orco, sd->uvco, sd->size, 1.0, seed, pa_co);
- if(har) har->lay= obr->ob->lay;
+ if (har) har->lay= obr->ob->lay;
}
else
static_particle_strand(re, obr, ma, sd, loc, loc1);
@@ -1378,17 +1381,17 @@ static void particle_billboard(Render *re, ObjectRen *obr, Material *ma, Particl
vlr->mat= ma;
vlr->ec= ME_V2V3;
- if(bb->uv_split > 1){
+ if (bb->uv_split > 1) {
uvdx = uvdy = 1.0f / (float)bb->uv_split;
- if(ELEM(bb->anim, PART_BB_ANIM_AGE, PART_BB_ANIM_FRAME)) {
- if(bb->anim == PART_BB_ANIM_FRAME)
+ if (ELEM(bb->anim, PART_BB_ANIM_AGE, PART_BB_ANIM_FRAME)) {
+ if (bb->anim == PART_BB_ANIM_FRAME)
time = ((int)(bb->time * bb->lifetime) % totsplit)/(float)totsplit;
else
time = bb->time;
}
- else if(bb->anim == PART_BB_ANIM_ANGLE) {
- if(bb->align == PART_BB_VIEW) {
+ else if (bb->anim == PART_BB_ANIM_ANGLE) {
+ if (bb->align == PART_BB_VIEW) {
time = (float)fmod((bb->tilt + 1.0f) / 2.0f, 1.0);
}
else {
@@ -1398,23 +1401,23 @@ static void particle_billboard(Render *re, ObjectRen *obr, Material *ma, Particl
axis1[(bb->align + 1) % 3] = 1.0f;
axis2[(bb->align + 2) % 3] = 1.0f;
- if(bb->lock == 0) {
+ if (bb->lock == 0) {
zvec[bb->align] = 0.0f;
normalize_v3(zvec);
}
time = saacos(dot_v3v3(zvec, axis1)) / (float)M_PI;
- if(dot_v3v3(zvec, axis2) < 0.0f)
+ if (dot_v3v3(zvec, axis2) < 0.0f)
time = 1.0f - time / 2.0f;
else
time /= 2.0f;
}
}
- if(bb->split_offset == PART_BB_OFF_LINEAR)
+ if (bb->split_offset == PART_BB_OFF_LINEAR)
time = (float)fmod(time + (float)bb->num / (float)totsplit, 1.0f);
- else if(bb->split_offset==PART_BB_OFF_RANDOM)
+ else if (bb->split_offset==PART_BB_OFF_RANDOM)
time = (float)fmod(time + bb->random, 1.0f);
/* Find the coordinates in tile space (integer), then convert to UV
@@ -1428,7 +1431,7 @@ static void particle_billboard(Render *re, ObjectRen *obr, Material *ma, Particl
}
/* normal UVs */
- if(bb->uv[0] >= 0){
+ if (bb->uv[0] >= 0) {
mtf = RE_vlakren_get_tface(obr, vlr, bb->uv[0], NULL, 1);
mtf->uv[0][0] = 1.0f;
mtf->uv[0][1] = 1.0f;
@@ -1441,14 +1444,14 @@ static void particle_billboard(Render *re, ObjectRen *obr, Material *ma, Particl
}
/* time-index UVs */
- if(bb->uv[1] >= 0){
+ if (bb->uv[1] >= 0) {
mtf = RE_vlakren_get_tface(obr, vlr, bb->uv[1], NULL, 1);
mtf->uv[0][0] = mtf->uv[1][0] = mtf->uv[2][0] = mtf->uv[3][0] = bb->time;
mtf->uv[0][1] = mtf->uv[1][1] = mtf->uv[2][1] = mtf->uv[3][1] = (float)bb->num/(float)bb->totnum;
}
/* split UVs */
- if(bb->uv_split > 1 && bb->uv[2] >= 0){
+ if (bb->uv_split > 1 && bb->uv[2] >= 0) {
mtf = RE_vlakren_get_tface(obr, vlr, bb->uv[2], NULL, 1);
mtf->uv[0][0] = uvx + uvdx;
mtf->uv[0][1] = uvy + uvdy;
@@ -1466,7 +1469,7 @@ static void particle_normal_ren(short ren_as, ParticleSettings *part, Render *re
copy_v3_v3(loc, state->co);
- if(ren_as != PART_DRAW_BB)
+ if (ren_as != PART_DRAW_BB)
mul_m4_v3(re->viewmat, loc);
switch(ren_as) {
@@ -1479,7 +1482,7 @@ static void particle_normal_ren(short ren_as, ParticleSettings *part, Render *re
mul_mat3_m4_v3(re->viewmat, vel);
normalize_v3(vel);
- if(part->draw & PART_DRAW_VEL_LENGTH)
+ if (part->draw & PART_DRAW_VEL_LENGTH)
mul_v3_fl(vel, len_v3(state->vel));
madd_v3_v3v3fl(loc0, loc, vel, -part->draw_line[0]);
@@ -1504,7 +1507,7 @@ static void particle_normal_ren(short ren_as, ParticleSettings *part, Render *re
har = RE_inithalo_particle(re, obr, dm, ma, loc, NULL, sd->orco, sd->uvco, hasize, 0.0, seed, pa_co);
- if(har) har->lay= obr->ob->lay;
+ if (har) har->lay= obr->ob->lay;
break;
}
@@ -1515,9 +1518,9 @@ static void get_particle_uvco_mcol(short from, DerivedMesh *dm, float *fuv, int
int i;
/* get uvco */
- if(sd->uvco && ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)) {
- for(i=0; i<sd->totuv; i++) {
- if(num != DMCACHE_NOTFOUND) {
+ if (sd->uvco && ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)) {
+ for (i=0; i<sd->totuv; i++) {
+ if (num != DMCACHE_NOTFOUND) {
MFace *mface = dm->getTessFaceData(dm, num, CD_MFACE);
MTFace *mtface = (MTFace*)CustomData_get_layer_n(&dm->faceData, CD_MTFACE, i);
mtface += num;
@@ -1532,9 +1535,9 @@ static void get_particle_uvco_mcol(short from, DerivedMesh *dm, float *fuv, int
}
/* get mcol */
- if(sd->mcol && ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)) {
- for(i=0; i<sd->totcol; i++) {
- if(num != DMCACHE_NOTFOUND) {
+ if (sd->mcol && ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)) {
+ for (i=0; i<sd->totcol; i++) {
+ if (num != DMCACHE_NOTFOUND) {
MFace *mface = dm->getTessFaceData(dm, num, CD_MFACE);
MCol *mc = (MCol*)CustomData_get_layer_n(&dm->faceData, CD_MCOL, i);
mc += num * 4;
@@ -1579,23 +1582,23 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
char **uv_name=0;
/* 1. check that everything is ok & updated */
- if(psys==NULL)
+ if (psys==NULL)
return 0;
part=psys->part;
pars=psys->particles;
- if(part==NULL || pars==NULL || !psys_check_enabled(ob, psys))
+ if (part==NULL || pars==NULL || !psys_check_enabled(ob, psys))
return 0;
- if(part->ren_as==PART_DRAW_OB || part->ren_as==PART_DRAW_GR || part->ren_as==PART_DRAW_NOT)
+ if (part->ren_as==PART_DRAW_OB || part->ren_as==PART_DRAW_GR || part->ren_as==PART_DRAW_NOT)
return 1;
-/* 2. start initialising things */
+/* 2. start initializing things */
/* last possibility to bail out! */
psmd = psys_get_modifier(ob,psys);
- if(!(psmd->modifier.mode & eModifierMode_Render))
+ if (!(psmd->modifier.mode & eModifierMode_Render))
return 0;
sim.scene= re->scene;
@@ -1603,16 +1606,16 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
sim.psys= psys;
sim.psmd= psmd;
- if(part->phystype==PART_PHYS_KEYED)
+ if (part->phystype==PART_PHYS_KEYED)
psys_count_keyed_targets(&sim);
totchild=psys->totchild;
/* can happen for disconnected/global hair */
- if(part->type==PART_HAIR && !psys->childcache)
+ if (part->type==PART_HAIR && !psys->childcache)
totchild= 0;
- if(G.rendering == 0) { /* preview render */
+ if (G.rendering == 0) { /* preview render */
totchild = (int)((float)totchild * (float)part->disp / 100.0f);
}
@@ -1629,7 +1632,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
ma= give_render_material(re, ob, part->omat);
#if 0 // XXX old animation system
- if(ma->ipo){
+ if (ma->ipo) {
calc_ipo(ma->ipo, cfra);
execute_ipo((ID *)ma, ma->ipo);
}
@@ -1644,10 +1647,10 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
sd.totuv = CustomData_number_of_layers(&psmd->dm->faceData, CD_MTFACE);
sd.totcol = CustomData_number_of_layers(&psmd->dm->faceData, CD_MCOL);
- if(ma->texco & TEXCO_UV && sd.totuv) {
+ if (ma->texco & TEXCO_UV && sd.totuv) {
sd.uvco = MEM_callocN(sd.totuv * 2 * sizeof(float), "particle_uvs");
- if(ma->strand_uvname[0]) {
+ if (ma->strand_uvname[0]) {
sd.override_uv = CustomData_get_named_layer_index(&psmd->dm->faceData, CD_MTFACE, ma->strand_uvname);
sd.override_uv -= CustomData_get_layer_index(&psmd->dm->faceData, CD_MTFACE);
}
@@ -1655,22 +1658,22 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
else
sd.uvco = NULL;
- if(sd.totcol)
+ if (sd.totcol)
sd.mcol = MEM_callocN(sd.totcol * sizeof(MCol), "particle_mcols");
/* 2.2 setup billboards */
- if(part->ren_as == PART_DRAW_BB) {
+ if (part->ren_as == PART_DRAW_BB) {
int first_uv = CustomData_get_layer_index(&psmd->dm->faceData, CD_MTFACE);
bb.uv[0] = CustomData_get_named_layer_index(&psmd->dm->faceData, CD_MTFACE, psys->bb_uvname[0]);
- if(bb.uv[0] < 0)
+ if (bb.uv[0] < 0)
bb.uv[0] = CustomData_get_active_layer_index(&psmd->dm->faceData, CD_MTFACE);
bb.uv[1] = CustomData_get_named_layer_index(&psmd->dm->faceData, CD_MTFACE, psys->bb_uvname[1]);
bb.uv[2] = CustomData_get_named_layer_index(&psmd->dm->faceData, CD_MTFACE, psys->bb_uvname[2]);
- if(first_uv >= 0) {
+ if (first_uv >= 0) {
bb.uv[0] -= first_uv;
bb.uv[1] -= first_uv;
bb.uv[2] -= first_uv;
@@ -1691,24 +1694,24 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
copy_m3_m4(nmat, ob->imat);
transpose_m3(nmat);
- if(psys->flag & PSYS_USE_IMAT) {
+ if (psys->flag & PSYS_USE_IMAT) {
/* psys->imat is the original emitter's inverse matrix, ob->obmat is the duplicated object's matrix */
mult_m4_m4m4(duplimat, ob->obmat, psys->imat);
use_duplimat = 1;
}
/* 2.6 setup strand rendering */
- if(part->ren_as == PART_DRAW_PATH && psys->pathcache){
+ if (part->ren_as == PART_DRAW_PATH && psys->pathcache) {
path_nbr=(int)pow(2.0,(double) part->ren_step);
- if(path_nbr) {
- if(!ELEM(ma->material_type, MA_TYPE_HALO, MA_TYPE_WIRE)) {
+ if (path_nbr) {
+ if (!ELEM(ma->material_type, MA_TYPE_HALO, MA_TYPE_WIRE)) {
sd.orco = MEM_mallocN(3*sizeof(float)*(totpart+totchild), "particle orcos");
set_object_orco(re, psys, sd.orco);
}
}
- if(part->draw & PART_DRAW_REN_ADAPT) {
+ if (part->draw & PART_DRAW_REN_ADAPT) {
sd.adapt = 1;
sd.adapt_pix = (float)part->adapt_pix;
sd.adapt_angle = cosf(DEG2RADF((float)part->adapt_angle));
@@ -1726,29 +1729,29 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
strandbuf->overrideuv= sd.override_uv;
strandbuf->minwidth= ma->strand_min;
- if(ma->strand_widthfade == 0.0f)
+ if (ma->strand_widthfade == 0.0f)
strandbuf->widthfade= 0.0f;
- else if(ma->strand_widthfade >= 1.0f)
+ else if (ma->strand_widthfade >= 1.0f)
strandbuf->widthfade= 2.0f - ma->strand_widthfade;
else
strandbuf->widthfade= 1.0f/MAX2(ma->strand_widthfade, 1e-5f);
- if(part->flag & PART_HAIR_BSPLINE)
+ if (part->flag & PART_HAIR_BSPLINE)
strandbuf->flag |= R_STRAND_BSPLINE;
- if(ma->mode & MA_STR_B_UNITS)
+ if (ma->mode & MA_STR_B_UNITS)
strandbuf->flag |= R_STRAND_B_UNITS;
svert= strandbuf->vert;
- if(re->r.mode & R_SPEED)
+ if (re->r.mode & R_SPEED)
dosurfacecache= 1;
- else if((re->wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) && (re->wrld.ao_gather_method == WO_AOGATHER_APPROX))
- if(ma->amb != 0.0f)
+ else if ((re->wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) && (re->wrld.ao_gather_method == WO_AOGATHER_APPROX))
+ if (ma->amb != 0.0f)
dosurfacecache= 1;
totface= psmd->dm->getNumTessFaces(psmd->dm);
origindex= psmd->dm->getTessFaceDataArray(psmd->dm, CD_ORIGINDEX);
- for(a=0; a<totface; a++)
+ for (a=0; a<totface; a++)
strandbuf->totbound= MAX2(strandbuf->totbound, (origindex)? origindex[a]: a);
strandbuf->totbound++;
@@ -1758,20 +1761,20 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
}
}
- if(sd.orco == 0) {
+ if (sd.orco == 0) {
sd.orco = MEM_mallocN(3 * sizeof(float), "particle orco");
orco1 = 1;
}
- if(path_nbr == 0)
+ if (path_nbr == 0)
psys->lattice = psys_get_lattice(&sim);
/* 3. start creating renderable things */
- for(a=0,pa=pars; a<totpart+totchild; a++, pa++, seed++) {
+ for (a=0,pa=pars; a<totpart+totchild; a++, pa++, seed++) {
random = rng_getFloat(rng);
/* setup per particle individual stuff */
- if(a<totpart){
- if(pa->flag & PARS_UNEXIST) continue;
+ if (a<totpart) {
+ if (pa->flag & PARS_UNEXIST) continue;
pa_time=(cfra-pa->time)/pa->lifetime;
pa_birthtime = pa->time;
@@ -1780,7 +1783,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
hasize = ma->hasize;
/* get orco */
- if(tpsys && part->phystype==PART_PHYS_NO){
+ if (tpsys && part->phystype==PART_PHYS_NO) {
tpa=tpsys->particles+pa->num;
psys_particle_on_emitter(psmd,tpart->from,tpa->num,pa->num_dmcache,tpa->fuv,tpa->foffset,co,nor,0,0,sd.orco,0);
}
@@ -1790,8 +1793,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
/* get uvco & mcol */
num= pa->num_dmcache;
- if(num == DMCACHE_NOTFOUND)
- if(pa->num < psmd->dm->getNumTessFaces(psmd->dm))
+ if (num == DMCACHE_NOTFOUND)
+ if (pa->num < psmd->dm->getNumTessFaces(psmd->dm))
num= pa->num;
get_particle_uvco_mcol(part->from, psmd->dm, pa->fuv, num, &sd);
@@ -1801,20 +1804,20 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
r_tilt = 2.0f*(PSYS_FRAND(a) - 0.5f);
r_length = PSYS_FRAND(a+1);
- if(path_nbr) {
+ if (path_nbr) {
cache = psys->pathcache[a];
max_k = (int)cache->steps;
}
- if(totchild && (part->draw&PART_DRAW_PARENT)==0) continue;
+ if (totchild && (part->draw&PART_DRAW_PARENT)==0) continue;
}
else {
ChildParticle *cpa= psys->child+a-totpart;
- if(path_nbr) {
+ if (path_nbr) {
cache = psys->childcache[a-totpart];
- if(cache->steps < 0)
+ if (cache->steps < 0)
continue;
max_k = (int)cache->steps;
@@ -1829,7 +1832,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
num = cpa->num;
/* get orco */
- if(part->childtype == PART_CHILD_FACES) {
+ if (part->childtype == PART_CHILD_FACES) {
psys_particle_on_emitter(psmd,
PART_FROM_FACE, cpa->num,DMCACHE_ISCHILD,
cpa->fuv,cpa->foffset,co,nor,0,0,sd.orco,0);
@@ -1842,15 +1845,15 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
}
/* get uvco & mcol */
- if(part->childtype==PART_CHILD_FACES) {
+ if (part->childtype==PART_CHILD_FACES) {
get_particle_uvco_mcol(PART_FROM_FACE, psmd->dm, cpa->fuv, cpa->num, &sd);
}
else {
ParticleData *parent = psys->particles + cpa->parent;
num = parent->num_dmcache;
- if(num == DMCACHE_NOTFOUND)
- if(parent->num < psmd->dm->getNumTessFaces(psmd->dm))
+ if (num == DMCACHE_NOTFOUND)
+ if (parent->num < psmd->dm->getNumTessFaces(psmd->dm))
num = parent->num;
get_particle_uvco_mcol(part->from, psmd->dm, parent->fuv, num, &sd);
@@ -1858,10 +1861,10 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
dosimplify = psys_render_simplify_params(psys, cpa, simplify);
- if(strandbuf) {
+ if (strandbuf) {
int orignum= (origindex)? origindex[cpa->num]: cpa->num;
- if(orignum > sbound - strandbuf->bound) {
+ if (orignum > sbound - strandbuf->bound) {
sbound= strandbuf->bound + orignum;
sbound->start= sbound->end= obr->totstrand;
}
@@ -1874,7 +1877,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
pa_co[2] = 0.f;
/* surface normal shading setup */
- if(ma->mode_l & MA_STR_SURFDIFF) {
+ if (ma->mode_l & MA_STR_SURFDIFF) {
mul_m3_v3(nmat, nor);
sd.surfnor= nor;
}
@@ -1882,31 +1885,31 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
sd.surfnor= NULL;
/* strand render setup */
- if(strandbuf) {
+ if (strandbuf) {
strand= RE_findOrAddStrand(obr, obr->totstrand++);
strand->buffer= strandbuf;
strand->vert= svert;
copy_v3_v3(strand->orco, sd.orco);
- if(dosimplify) {
+ if (dosimplify) {
float *ssimplify= RE_strandren_get_simplify(obr, strand, 1);
ssimplify[0]= simplify[0];
ssimplify[1]= simplify[1];
}
- if(sd.surfnor) {
+ if (sd.surfnor) {
float *snor= RE_strandren_get_surfnor(obr, strand, 1);
copy_v3_v3(snor, sd.surfnor);
}
- if(dosurfacecache && num >= 0) {
+ if (dosurfacecache && num >= 0) {
int *facenum= RE_strandren_get_face(obr, strand, 1);
*facenum= num;
}
- if(sd.uvco) {
- for(i=0; i<sd.totuv; i++) {
- if(i != sd.override_uv) {
+ if (sd.uvco) {
+ for (i=0; i<sd.totuv; i++) {
+ if (i != sd.override_uv) {
float *uv= RE_strandren_get_uv(obr, strand, i, NULL, 1);
uv[0]= sd.uvco[2*i];
@@ -1914,8 +1917,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
}
}
}
- if(sd.mcol) {
- for(i=0; i<sd.totcol; i++) {
+ if (sd.mcol) {
+ for (i=0; i<sd.totcol; i++) {
MCol *mc= RE_strandren_get_mcol(obr, strand, i, NULL, 1);
*mc = sd.mcol[i];
}
@@ -1925,43 +1928,43 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
}
/* strandco computation setup */
- if(path_nbr) {
+ if (path_nbr) {
strandlen= 0.0f;
curlen= 0.0f;
- for(k=1; k<=path_nbr; k++)
- if(k<=max_k)
+ for (k=1; k<=path_nbr; k++)
+ if (k<=max_k)
strandlen += len_v3v3((cache+k-1)->co, (cache+k)->co);
}
- if(path_nbr) {
+ if (path_nbr) {
/* render strands */
- for(k=0; k<=path_nbr; k++){
+ for (k=0; k<=path_nbr; k++) {
float time;
- if(k<=max_k){
+ if (k<=max_k) {
copy_v3_v3(state.co,(cache+k)->co);
copy_v3_v3(state.vel,(cache+k)->vel);
}
else
continue;
- if(k > 0)
+ if (k > 0)
curlen += len_v3v3((cache+k-1)->co, (cache+k)->co);
time= curlen/strandlen;
copy_v3_v3(loc,state.co);
mul_m4_v3(re->viewmat,loc);
- if(strandbuf) {
+ if (strandbuf) {
copy_v3_v3(svert->co, loc);
svert->strandco= -1.0f + 2.0f*time;
svert++;
strand->totvert++;
}
- else{
+ else {
sd.size = hasize;
- if(k==1){
+ if (k==1) {
sd.first = 1;
sd.time = 0.0f;
sub_v3_v3v3(loc0,loc1,loc);
@@ -1973,7 +1976,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
sd.first = 0;
sd.time = time;
- if(k)
+ if (k)
particle_curve(re, obr, psmd->dm, ma, &sd, loc, loc1, seed, pa_co);
copy_v3_v3(loc1,loc);
@@ -1983,7 +1986,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
}
else {
/* render normal particles */
- if(part->trail_count > 1) {
+ if (part->trail_count > 1) {
float length = part->path_end * (1.0f - part->randlength * r_length);
int trail_count = part->trail_count * (1.0f - part->randlength * r_length);
float ct = (part->draw & PART_ABS_PATH_TIME) ? cfra : pa_time;
@@ -1992,24 +1995,24 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
/* make sure we have pointcache in memory before getting particle on path */
psys_make_temp_pointcache(ob, psys);
- for(i=0; i < trail_count; i++, ct -= dt) {
- if(part->draw & PART_ABS_PATH_TIME) {
- if(ct < pa_birthtime || ct > pa_dietime)
+ for (i=0; i < trail_count; i++, ct -= dt) {
+ if (part->draw & PART_ABS_PATH_TIME) {
+ if (ct < pa_birthtime || ct > pa_dietime)
continue;
}
- else if(ct < 0.0f || ct > 1.0f)
+ else if (ct < 0.0f || ct > 1.0f)
continue;
state.time = (part->draw & PART_ABS_PATH_TIME) ? -ct : ct;
psys_get_particle_on_path(&sim,a,&state,1);
- if(psys->parent)
+ if (psys->parent)
mul_m4_v3(psys->parent->obmat, state.co);
- if(use_duplimat)
+ if (use_duplimat)
mul_m4_v4(duplimat, state.co);
- if(part->ren_as == PART_DRAW_BB) {
+ if (part->ren_as == PART_DRAW_BB) {
bb.random = random;
bb.offset[0] = part->bb_offset[0];
bb.offset[1] = part->bb_offset[1];
@@ -2038,16 +2041,16 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
}
else {
state.time=cfra;
- if(psys_get_particle_state(&sim,a,&state,0)==0)
+ if (psys_get_particle_state(&sim,a,&state,0)==0)
continue;
- if(psys->parent)
+ if (psys->parent)
mul_m4_v3(psys->parent->obmat, state.co);
- if(use_duplimat)
+ if (use_duplimat)
mul_m4_v3(duplimat, state.co);
- if(part->ren_as == PART_DRAW_BB) {
+ if (part->ren_as == PART_DRAW_BB) {
bb.random = random;
bb.offset[0] = part->bb_offset[0];
bb.offset[1] = part->bb_offset[1];
@@ -2073,46 +2076,46 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
}
}
- if(orco1==0)
+ if (orco1==0)
sd.orco+=3;
- if(re->test_break(re->tbh))
+ if (re->test_break(re->tbh))
break;
}
- if(dosurfacecache)
+ if (dosurfacecache)
strandbuf->surface= cache_strand_surface(re, obr, psmd->dm, mat, timeoffset);
/* 4. clean up */
#if 0 // XXX old animation system
- if(ma) do_mat_ipo(re->scene, ma);
+ if (ma) do_mat_ipo(re->scene, ma);
#endif // XXX old animation system
- if(orco1)
+ if (orco1)
MEM_freeN(sd.orco);
- if(sd.uvco)
+ if (sd.uvco)
MEM_freeN(sd.uvco);
- if(sd.mcol)
+ if (sd.mcol)
MEM_freeN(sd.mcol);
- if(uv_name)
+ if (uv_name)
MEM_freeN(uv_name);
- if(states)
+ if (states)
MEM_freeN(states);
rng_free(rng);
psys->flag &= ~PSYS_DRAWING;
- if(psys->lattice){
+ if (psys->lattice) {
end_latt_deform(psys->lattice);
psys->lattice= NULL;
}
- if(path_nbr && (ma->mode_l & MA_TANGENT_STR)==0)
+ if (path_nbr && (ma->mode_l & MA_TANGENT_STR)==0)
calc_vertexnormals(re, obr, 0, 0);
return 1;
@@ -2135,16 +2138,16 @@ static void make_render_halos(Render *re, ObjectRen *obr, Mesh *UNUSED(me), int
re->flag |= R_HALO;
- for(a=0; a<totvert; a++, mvert++) {
+ for (a=0; a<totvert; a++, mvert++) {
ok= 1;
- if(ok) {
+ if (ok) {
hasize= ma->hasize;
copy_v3_v3(vec, mvert->co);
mul_m4_v3(mat, vec);
- if(ma->mode & MA_HALOPUNO) {
+ if (ma->mode & MA_HALOPUNO) {
xn= mvert->no[0];
yn= mvert->no[1];
zn= mvert->no[2];
@@ -2159,15 +2162,15 @@ static void make_render_halos(Render *re, ObjectRen *obr, Mesh *UNUSED(me), int
normalize_v3(view);
zn = dot_v3v3(nor, view);
- if(zn>=0.0f) hasize= 0.0f;
+ if (zn>=0.0f) hasize= 0.0f;
else hasize*= zn*zn*zn*zn;
}
- if(orco) har= RE_inithalo(re, obr, ma, vec, NULL, orco, hasize, 0.0, seed);
+ if (orco) har= RE_inithalo(re, obr, ma, vec, NULL, orco, hasize, 0.0, seed);
else har= RE_inithalo(re, obr, ma, vec, NULL, mvert->co, hasize, 0.0, seed);
- if(har) har->lay= ob->lay;
+ if (har) har->lay= ob->lay;
}
- if(orco) orco+= 3;
+ if (orco) orco+= 3;
seed++;
}
}
@@ -2177,8 +2180,8 @@ static int verghalo(const void *a1, const void *a2)
const HaloRen *har1= *(const HaloRen**)a1;
const HaloRen *har2= *(const HaloRen**)a2;
- if(har1->zs < har2->zs) return 1;
- else if(har1->zs > har2->zs) return -1;
+ if (har1->zs < har2->zs) return 1;
+ else if (har1->zs > har2->zs) return -1;
return 0;
}
@@ -2188,14 +2191,14 @@ static void sort_halos(Render *re, int totsort)
HaloRen *har= NULL, **haso;
int a;
- if(re->tothalo==0) return;
+ if (re->tothalo==0) return;
re->sortedhalos= MEM_callocN(sizeof(HaloRen*)*re->tothalo, "sorthalos");
haso= re->sortedhalos;
- for(obr=re->objecttable.first; obr; obr=obr->next) {
- for(a=0; a<obr->tothalo; a++) {
- if((a & 255)==0) har= obr->bloha[a>>8];
+ for (obr=re->objecttable.first; obr; obr=obr->next) {
+ for (a=0; a<obr->tothalo; a++) {
+ if ((a & 255)==0) har= obr->bloha[a>>8];
else har++;
*(haso++)= har;
@@ -2218,7 +2221,7 @@ static short test_for_displace(Render *re, Object *ob)
for (i=1; i<=ob->totcol; i++) {
ma=give_render_material(re, ob, i);
/* ma->mapto is ORed total of all mapto channels */
- if(ma && (ma->mapto & MAP_DISPLACE)) return 1;
+ if (ma && (ma->mapto & MAP_DISPLACE)) return 1;
}
return 0;
}
@@ -2236,10 +2239,10 @@ static void displace_render_vert(Render *re, ObjectRen *obr, ShadeInput *shi, Ve
/* vertex normal is used for textures type 'col' and 'var' */
copy_v3_v3(shi->vn, vr->n);
- if(mat)
+ if (mat)
mul_m4_v3(mat, shi->co);
- if(imat) {
+ if (imat) {
shi->vn[0] = dot_v3v3(imat[0], vr->n);
shi->vn[1] = dot_v3v3(imat[1], vr->n);
shi->vn[2] = dot_v3v3(imat[2], vr->n);
@@ -2267,7 +2270,7 @@ static void displace_render_vert(Render *re, ObjectRen *obr, ShadeInput *shi, Ve
}
if (texco & TEXCO_STICKY) {
float *sticky= RE_vertren_get_sticky(obr, vr, 0);
- if(sticky) {
+ if (sticky) {
shi->sticky[0]= sticky[0];
shi->sticky[1]= sticky[1];
shi->sticky[2]= 0.0f;
@@ -2280,15 +2283,15 @@ static void displace_render_vert(Render *re, ObjectRen *obr, ShadeInput *shi, Ve
if (texco & TEXCO_NORM) {
copy_v3_v3(shi->orn, shi->vn);
}
- if(texco & TEXCO_REFL) {
+ if (texco & TEXCO_REFL) {
/* not (yet?) */
}
- if(texco & TEXCO_STRESS) {
+ if (texco & TEXCO_STRESS) {
float *s= RE_vertren_get_stress(obr, vr, 0);
- if(s) {
+ if (s) {
shi->stress= *s;
- if(shi->stress<1.0f) shi->stress-= 1.0f;
+ if (shi->stress<1.0f) shi->stress-= 1.0f;
else shi->stress= (shi->stress-1.0f)/shi->stress;
}
else
@@ -2306,7 +2309,7 @@ static void displace_render_vert(Render *re, ObjectRen *obr, ShadeInput *shi, Ve
displace[1]= shi->displace[1] * scale[1];
displace[2]= shi->displace[2] * scale[2];
- if(mat)
+ if (mat)
mul_m3_v3(imat, displace);
/* 0.5 could become button once? */
@@ -2317,7 +2320,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 */
@@ -2335,13 +2338,13 @@ 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 */
/* set up shadeinput struct for multitex() */
- /* memset above means we dont need this */
+ /* memset above means we don't need this */
/*shi.osatex= 0;*/ /* signal not to use dx[] and dy[] texture AA vectors */
shi.obr= obr;
@@ -2378,7 +2381,7 @@ static void displace_render_face(Render *re, ObjectRen *obr, VlakRen *vlr, float
}
/* Recalculate the face normal - if flipped before, flip now */
- if(vlr->v4) {
+ if (vlr->v4) {
normal_quad_v3( vlr->n,vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
}
else {
@@ -2397,19 +2400,19 @@ static void do_displacement(Render *re, ObjectRen *obr, float mat[][4], float im
/* Object Size with parenting */
obt=obr->ob;
- while(obt){
+ while (obt) {
mul_v3_v3v3(temp, obt->size, obt->dscale);
scale[0]*=temp[0]; scale[1]*=temp[1]; scale[2]*=temp[2];
obt=obt->parent;
}
/* Clear all flags */
- for(i=0; i<obr->totvert; i++){
+ for (i=0; i<obr->totvert; i++) {
vr= RE_findOrAddVert(obr, i);
vr->flag= 0;
}
- for(i=0; i<obr->totvlak; i++){
+ for (i=0; i<obr->totvlak; i++) {
vlr=RE_findOrAddVlak(obr, i);
displace_render_face(re, obr, vlr, scale, mat, imat);
}
@@ -2430,7 +2433,7 @@ static void init_render_mball(Render *re, ObjectRen *obr)
VlakRen *vlr, *vlr1;
Material *ma;
float *data, *nors, *orco=NULL, mat[4][4], imat[3][3], xn, yn, zn;
- int a, need_orco, vlakindex, *index;
+ int a, need_orco, vlakindex, *index, negative_scale;
ListBase dispbase= {NULL, NULL};
if (ob!=find_basis_mball(re->scene, ob))
@@ -2439,21 +2442,22 @@ static void init_render_mball(Render *re, ObjectRen *obr)
mult_m4_m4m4(mat, re->viewmat, ob->obmat);
invert_m4_m4(ob->imat, mat);
copy_m3_m4(imat, ob->imat);
+ negative_scale = is_negative_m4(mat);
ma= give_render_material(re, ob, 1);
need_orco= 0;
- if(ma->texco & TEXCO_ORCO) {
+ if (ma->texco & TEXCO_ORCO) {
need_orco= 1;
}
makeDispListMBall_forRender(re->scene, ob, &dispbase);
dl= dispbase.first;
- if(dl==0) return;
+ if (dl==0) return;
data= dl->verts;
nors= dl->nors;
- if(need_orco) {
+ if (need_orco) {
orco= get_object_orco(re, ob);
if (!orco) {
@@ -2463,7 +2467,7 @@ static void init_render_mball(Render *re, ObjectRen *obr)
}
}
- for(a=0; a<dl->nr; a++, data+=3, nors+=3) {
+ for (a=0; a<dl->nr; a++, data+=3, nors+=3) {
ver= RE_findOrAddVert(obr, obr->totvert++);
copy_v3_v3(ver->co, data);
@@ -2481,14 +2485,14 @@ static void init_render_mball(Render *re, ObjectRen *obr)
normalize_v3(ver->n);
//if(ob->transflag & OB_NEG_SCALE) negate_v3(ver->n);
- if(need_orco) {
+ if (need_orco) {
ver->orco= orco;
orco+=3;
}
}
index= dl->index;
- for(a=0; a<dl->parts; a++, index+=4) {
+ for (a=0; a<dl->parts; a++, index+=4) {
vlr= RE_findOrAddVlak(obr, obr->totvlak++);
vlr->v1= RE_findOrAddVert(obr, index[0]);
@@ -2496,7 +2500,7 @@ static void init_render_mball(Render *re, ObjectRen *obr)
vlr->v3= RE_findOrAddVert(obr, index[2]);
vlr->v4= 0;
- if(ob->transflag & OB_NEG_SCALE)
+ if (negative_scale)
normal_tri_v3( vlr->n,vlr->v1->co, vlr->v2->co, vlr->v3->co);
else
normal_tri_v3( vlr->n,vlr->v3->co, vlr->v2->co, vlr->v1->co);
@@ -2506,14 +2510,14 @@ static void init_render_mball(Render *re, ObjectRen *obr)
vlr->ec= 0;
/* mball -too bad- always has triangles, because quads can be non-planar */
- if(index[3] && index[3]!=index[2]) {
+ if (index[3] && index[3]!=index[2]) {
vlr1= RE_findOrAddVlak(obr, obr->totvlak++);
vlakindex= vlr1->index;
*vlr1= *vlr;
vlr1->index= vlakindex;
vlr1->v2= vlr1->v3;
vlr1->v3= RE_findOrAddVert(obr, index[3]);
- if(ob->transflag & OB_NEG_SCALE)
+ if (negative_scale)
normal_tri_v3( vlr1->n,vlr1->v1->co, vlr1->v2->co, vlr1->v3->co);
else
normal_tri_v3( vlr1->n,vlr1->v3->co, vlr1->v2->co, vlr1->v1->co);
@@ -2546,7 +2550,7 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar,
for (u = 0; u < sizeu; u++) {
v1 = RE_findOrAddVert(obr, obr->totvert++); /* save this for possible V wrapping */
copy_v3_v3(v1->co, data); data += 3;
- if(orco) {
+ if (orco) {
v1->orco= orco; orco+= 3; orcoret++;
}
mul_m4_v3(mat, v1->co);
@@ -2554,7 +2558,7 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar,
for (v = 1; v < sizev; v++) {
ver= RE_findOrAddVert(obr, obr->totvert++);
copy_v3_v3(ver->co, data); data += 3;
- if(orco) {
+ if (orco) {
ver->orco= orco; orco+= 3; orcoret++;
}
mul_m4_v3(mat, ver->co);
@@ -2563,7 +2567,7 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar,
if (dl->flag & DL_CYCL_U) {
ver= RE_findOrAddVert(obr, obr->totvert++);
copy_v3_v3(ver->co, v1->co);
- if(orco) {
+ if (orco) {
ver->orco= orco; orco+=3; orcoret++; //orcobase + 3*(u*sizev + 0);
}
}
@@ -2579,7 +2583,7 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar,
v1= RE_findOrAddVert(obr, startvert + v);
ver= RE_findOrAddVert(obr, obr->totvert++);
copy_v3_v3(ver->co, v1->co);
- if(orco) {
+ if (orco) {
ver->orco= orco; orco+=3; orcoret++; //ver->orco= orcobase + 3*(0*sizev + v);
}
}
@@ -2590,13 +2594,13 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar,
startvlak= obr->totvlak;
- for(u = 0; u < sizeu - 1; u++) {
+ for (u = 0; u < sizeu - 1; u++) {
p1 = startvert + u * sizev; /* walk through face list */
p2 = p1 + 1;
p3 = p2 + sizev;
p4 = p3 - 1;
- for(v = 0; v < sizev - 1; v++) {
+ for (v = 0; v < sizev - 1; v++) {
v1= RE_findOrAddVert(obr, p1);
v2= RE_findOrAddVert(obr, p2);
v3= RE_findOrAddVert(obr, p3);
@@ -2649,25 +2653,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);
@@ -2680,7 +2684,7 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar,
copy_v3_v3(vlr2->v2->n, n1);
copy_v3_v3(vlr3->v4->n, n1);
}
- for(a = startvert; a < obr->totvert; a++) {
+ for (a = startvert; a < obr->totvert; a++) {
ver= RE_findOrAddVert(obr, a);
normalize_v3(ver->n);
}
@@ -2705,18 +2709,18 @@ static void init_render_dm(DerivedMesh *dm, Render *re, ObjectRen *obr,
mvert= dm->getVertArray(dm);
totvert= dm->getNumVerts(dm);
- for(a=0; a<totvert; a++, mvert++) {
+ for (a=0; a<totvert; a++, mvert++) {
ver= RE_findOrAddVert(obr, obr->totvert++);
copy_v3_v3(ver->co, mvert->co);
mul_m4_v3(mat, ver->co);
- if(orco) {
+ if (orco) {
ver->orco= orco;
orco+=3;
}
}
- if(!timeoffset) {
+ if (!timeoffset) {
/* store customdata names, because DerivedMesh is freed */
RE_set_customdata_names(obr, &dm->faceData);
@@ -2724,16 +2728,16 @@ static void init_render_dm(DerivedMesh *dm, Render *re, ObjectRen *obr,
/* faces in order of color blocks */
vertofs= obr->totvert - totvert;
- for(mat_iter= 0; (mat_iter < ob->totcol || (mat_iter==0 && ob->totcol==0)); mat_iter++) {
+ for (mat_iter= 0; (mat_iter < ob->totcol || (mat_iter==0 && ob->totcol==0)); mat_iter++) {
ma= give_render_material(re, ob, mat_iter+1);
end= dm->getNumTessFaces(dm);
mface= dm->getTessFaceArray(dm);
- for(a=0; a<end; a++, mface++) {
+ for (a=0; a<end; a++, mface++) {
int v1, v2, v3, v4, flag;
- if(mface->mat_nr == mat_iter) {
+ if (mface->mat_nr == mat_iter) {
float len;
v1= mface->v1;
@@ -2746,11 +2750,11 @@ static void init_render_dm(DerivedMesh *dm, Render *re, ObjectRen *obr,
vlr->v1= RE_findOrAddVert(obr, vertofs+v1);
vlr->v2= RE_findOrAddVert(obr, vertofs+v2);
vlr->v3= RE_findOrAddVert(obr, vertofs+v3);
- if(v4) vlr->v4= RE_findOrAddVert(obr, vertofs+v4);
+ if (v4) vlr->v4= RE_findOrAddVert(obr, vertofs+v4);
else vlr->v4= 0;
/* render normals are inverted in render */
- if(vlr->v4)
+ if (vlr->v4)
len= normal_quad_v3( vlr->n,vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
else
len= normal_tri_v3( vlr->n,vlr->v3->co, vlr->v2->co, vlr->v1->co);
@@ -2759,7 +2763,7 @@ static void init_render_dm(DerivedMesh *dm, Render *re, ObjectRen *obr,
vlr->flag= flag;
vlr->ec= 0; /* mesh edges rendered separately */
- if(len==0) obr->totvlak--;
+ if (len==0) obr->totvlak--;
else {
CustomDataLayer *layer;
MTFace *mtface, *mtf;
@@ -2767,16 +2771,16 @@ static void init_render_dm(DerivedMesh *dm, Render *re, ObjectRen *obr,
int index, mtfn= 0, mcn= 0;
char *name;
- for(index=0; index<dm->faceData.totlayer; index++) {
+ for (index=0; index<dm->faceData.totlayer; index++) {
layer= &dm->faceData.layers[index];
name= layer->name;
- if(layer->type == CD_MTFACE && mtfn < MAX_MTFACE) {
+ if (layer->type == CD_MTFACE && mtfn < MAX_MTFACE) {
mtf= RE_vlakren_get_tface(obr, vlr, mtfn++, &name, 1);
mtface= (MTFace*)layer->data;
*mtf= mtface[a];
}
- else if(layer->type == CD_MCOL && mcn < MAX_MCOL) {
+ else if (layer->type == CD_MCOL && mcn < MAX_MCOL) {
mc= RE_vlakren_get_mcol(obr, vlr, mcn++, &name, 1);
mcol= (MCol*)layer->data;
memcpy(mc, &mcol[a*4], sizeof(MCol)*4);
@@ -2807,7 +2811,7 @@ static void init_render_surf(Render *re, ObjectRen *obr, int timeoffset)
cu= ob->data;
nu= cu->nurb.first;
- if(nu==0) return;
+ if (nu==0) return;
mult_m4_m4m4(mat, re->viewmat, ob->obmat);
invert_m4_m4(ob->imat, mat);
@@ -2816,36 +2820,37 @@ static void init_render_surf(Render *re, ObjectRen *obr, int timeoffset)
totmat= ob->totcol+1;
matar= MEM_callocN(sizeof(Material*)*totmat, "init_render_surf matar");
- for(a=0; a<totmat; a++) {
+ for (a=0; a<totmat; a++) {
matar[a]= give_render_material(re, ob, a+1);
- if(matar[a] && matar[a]->texco & TEXCO_ORCO)
+ if (matar[a] && matar[a]->texco & TEXCO_ORCO)
need_orco= 1;
}
- if(ob->parent && (ob->parent->type==OB_LATTICE)) need_orco= 1;
+ if (ob->parent && (ob->parent->type==OB_LATTICE)) need_orco= 1;
makeDispListSurf(re->scene, ob, &displist, &dm, 1, 0);
if (dm) {
- if(need_orco) {
+ if (need_orco) {
orco= makeOrcoDispList(re->scene, ob, dm, 1);
- if(orco) {
+ if (orco) {
set_object_orco(re, ob, orco);
}
}
init_render_dm(dm, re, obr, timeoffset, orco, mat);
dm->release(dm);
- } else {
- if(need_orco) {
+ }
+ else {
+ if (need_orco) {
orco= get_object_orco(re, ob);
}
/* walk along displaylist and create rendervertices/-faces */
- for(dl=displist.first; dl; dl=dl->next) {
+ for (dl=displist.first; dl; dl=dl->next) {
/* watch out: u ^= y, v ^= x !! */
- if(dl->type==DL_SURF)
+ if (dl->type==DL_SURF)
orco+= 3*dl_surf_to_renderdata(obr, dl, matar, orco, mat);
}
}
@@ -2871,12 +2876,12 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
int need_orco=0, totmat;
cu= ob->data;
- if(ob->type==OB_FONT && cu->str==NULL) return;
- else if(ob->type==OB_CURVE && cu->nurb.first==NULL) return;
+ if (ob->type==OB_FONT && cu->str==NULL) return;
+ else if (ob->type==OB_CURVE && cu->nurb.first==NULL) return;
makeDispListCurveTypes_forRender(re->scene, ob, &disp, &dm, 0);
dl= disp.first;
- if(dl==NULL) return;
+ if (dl==NULL) return;
mult_m4_m4m4(mat, re->viewmat, ob->obmat);
invert_m4_m4(ob->imat, mat);
@@ -2885,39 +2890,40 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
totmat= ob->totcol+1;
matar= MEM_callocN(sizeof(Material*)*totmat, "init_render_surf matar");
- for(a=0; a<totmat; a++) {
+ for (a=0; a<totmat; a++) {
matar[a]= give_render_material(re, ob, a+1);
- if(matar[a] && matar[a]->texco & TEXCO_ORCO)
+ if (matar[a] && matar[a]->texco & TEXCO_ORCO)
need_orco= 1;
}
if (dm) {
- if(need_orco) {
+ if (need_orco) {
orco= makeOrcoDispList(re->scene, ob, dm, 1);
- if(orco) {
+ if (orco) {
set_object_orco(re, ob, orco);
}
}
init_render_dm(dm, re, obr, timeoffset, orco, mat);
dm->release(dm);
- } else {
- if(need_orco) {
+ }
+ else {
+ if (need_orco) {
orco= get_object_orco(re, ob);
}
- while(dl) {
- if(dl->col > ob->totcol) {
+ while (dl) {
+ if (dl->col > ob->totcol) {
/* pass */
}
- else if(dl->type==DL_INDEX3) {
+ else if (dl->type==DL_INDEX3) {
int *index;
startvert= obr->totvert;
data= dl->verts;
- for(a=0; a<dl->nr; a++, data+=3) {
+ for (a=0; a<dl->nr; a++, data+=3) {
ver= RE_findOrAddVert(obr, obr->totvert++);
copy_v3_v3(ver->co, data);
@@ -2929,20 +2935,20 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
}
}
- if(timeoffset==0) {
+ if (timeoffset==0) {
float tmp[3];
const int startvlak= obr->totvlak;
zero_v3(n);
index= dl->index;
- for(a=0; a<dl->parts; a++, index+=3) {
+ for (a=0; a<dl->parts; a++, index+=3) {
vlr= RE_findOrAddVlak(obr, obr->totvlak++);
vlr->v1= RE_findOrAddVert(obr, startvert+index[0]);
vlr->v2= RE_findOrAddVert(obr, startvert+index[1]);
vlr->v3= RE_findOrAddVert(obr, startvert+index[2]);
vlr->v4= NULL;
- if(area_tri_v3(vlr->v3->co, vlr->v2->co, vlr->v1->co)>FLT_EPSILON) {
+ if (area_tri_v3(vlr->v3->co, vlr->v2->co, vlr->v1->co)>FLT_EPSILON) {
normal_tri_v3(tmp, vlr->v3->co, vlr->v2->co, vlr->v1->co);
add_v3_v3(n, tmp);
}
@@ -2955,7 +2961,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
normalize_v3(n);
/* vertex normals */
- for(a= startvlak; a<obr->totvlak; a++) {
+ for (a= startvlak; a<obr->totvlak; a++) {
vlr= RE_findOrAddVlak(obr, a);
copy_v3_v3(vlr->n, n);
@@ -2963,7 +2969,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
add_v3_v3(vlr->v3->n, vlr->n);
add_v3_v3(vlr->v2->n, vlr->n);
}
- for(a=startvert; a<obr->totvert; a++) {
+ for (a=startvert; a<obr->totvert; a++) {
ver= RE_findOrAddVert(obr, a);
normalize_v3(ver->n);
}
@@ -2982,7 +2988,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
startvert= obr->totvert;
nr= dl->nr*dl->parts;
- while(nr--) {
+ while (nr--) {
ver= RE_findOrAddVert(obr, obr->totvert++);
copy_v3_v3(ver->co, fp);
@@ -2995,10 +3001,10 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
}
}
- if(dl->bevelSplitFlag || timeoffset==0) {
+ if (dl->bevelSplitFlag || timeoffset==0) {
const int startvlak= obr->totvlak;
- for(a=0; a<dl->parts; a++) {
+ for (a=0; a<dl->parts; a++) {
if (surfindex_displist(dl, a, &b, &p1, &p2, &p3, &p4)==0)
break;
@@ -3008,7 +3014,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
p3+= startvert;
p4+= startvert;
- for(; b<dl->nr; b++) {
+ for (; b<dl->nr; b++) {
vlr= RE_findOrAddVlak(obr, obr->totvlak++);
/* important 1 offset in order is kept [#24913] */
vlr->v1= RE_findOrAddVert(obr, p2);
@@ -3016,7 +3022,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
vlr->v3= RE_findOrAddVert(obr, p3);
vlr->v4= RE_findOrAddVert(obr, p4);
vlr->ec= ME_V2V3+ME_V3V4;
- if(a==0) vlr->ec+= ME_V1V2;
+ if (a==0) vlr->ec+= ME_V1V2;
vlr->flag= dl->rt;
@@ -3031,13 +3037,13 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
}
if (dl->bevelSplitFlag) {
- for(a=0; a<dl->parts-1+!!(dl->flag&DL_CYCL_V); a++)
- if(dl->bevelSplitFlag[a>>5]&(1<<(a&0x1F)))
+ for (a=0; a<dl->parts-1+!!(dl->flag&DL_CYCL_V); a++)
+ if (dl->bevelSplitFlag[a>>5]&(1<<(a&0x1F)))
split_v_renderfaces(obr, startvlak, startvert, dl->parts, dl->nr, a, dl->flag&DL_CYCL_V, dl->flag&DL_CYCL_U);
}
/* vertex normals */
- for(a= startvlak; a<obr->totvlak; a++) {
+ for (a= startvlak; a<obr->totvlak; a++) {
vlr= RE_findOrAddVlak(obr, a);
add_v3_v3(vlr->v1->n, vlr->n);
@@ -3045,7 +3051,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
add_v3_v3(vlr->v2->n, vlr->n);
add_v3_v3(vlr->v4->n, vlr->n);
}
- for(a=startvert; a<obr->totvert; a++) {
+ for (a=startvert; a<obr->totvert; a++) {
ver= RE_findOrAddVert(obr, a);
normalize_v3(ver->n);
}
@@ -3093,10 +3099,10 @@ static int vergedgesort(const void *v1, const void *v2)
{
const struct edgesort *x1=v1, *x2=v2;
- if( x1->v1 > x2->v1) return 1;
- else if( x1->v1 < x2->v1) return -1;
- else if( x1->v2 > x2->v2) return 1;
- else if( x1->v2 < x2->v2) return -1;
+ if ( x1->v1 > x2->v1) return 1;
+ else if ( x1->v1 < x2->v1) return -1;
+ else if ( x1->v2 > x2->v2) return 1;
+ else if ( x1->v2 < x2->v2) return -1;
return 0;
}
@@ -3114,27 +3120,27 @@ static struct edgesort *make_mesh_edge_lookup(DerivedMesh *dm, int *totedgesort)
tface= dm->getTessFaceDataArray(dm, CD_MTFACE);
mcol= dm->getTessFaceDataArray(dm, CD_MCOL);
- if(mcol==NULL && tface==NULL) return NULL;
+ if (mcol==NULL && tface==NULL) return NULL;
/* make sorted table with edges and face indices in it */
- for(a= totface, mf= mface; a>0; a--, mf++) {
- if(mf->v4) totedge+=4;
- else if(mf->v3) totedge+=3;
+ for (a= totface, mf= mface; a>0; a--, mf++) {
+ if (mf->v4) totedge+=4;
+ else if (mf->v3) totedge+=3;
}
- if(totedge==0)
+ if (totedge==0)
return NULL;
ed= edsort= MEM_callocN(totedge*sizeof(struct edgesort), "edgesort");
- for(a=0, mf=mface; a<totface; a++, mf++) {
+ for (a=0, mf=mface; a<totface; a++, mf++) {
to_edgesort(ed++, 0, 1, mf->v1, mf->v2, a);
to_edgesort(ed++, 1, 2, mf->v2, mf->v3, a);
- if(mf->v4) {
+ if (mf->v4) {
to_edgesort(ed++, 2, 3, mf->v3, mf->v4, a);
to_edgesort(ed++, 3, 0, mf->v4, mf->v1, a);
}
- else if(mf->v3)
+ else if (mf->v3)
to_edgesort(ed++, 2, 3, mf->v3, mf->v1, a);
}
@@ -3154,7 +3160,7 @@ static void use_mesh_edge_lookup(ObjectRen *obr, DerivedMesh *dm, MEdge *medge,
int index, mtfn, mcn;
char *name;
- if(medge->v1 < medge->v2) {
+ if (medge->v1 < medge->v2) {
ed.v1= medge->v1;
ed.v2= medge->v2;
}
@@ -3166,14 +3172,14 @@ static void use_mesh_edge_lookup(ObjectRen *obr, DerivedMesh *dm, MEdge *medge,
edp= bsearch(&ed, edgetable, totedge, sizeof(struct edgesort), vergedgesort);
/* since edges have different index ordering, we have to duplicate mcol and tface */
- if(edp) {
+ if (edp) {
mtfn= mcn= 0;
- for(index=0; index<dm->faceData.totlayer; index++) {
+ for (index=0; index<dm->faceData.totlayer; index++) {
layer= &dm->faceData.layers[index];
name= layer->name;
- if(layer->type == CD_MTFACE && mtfn < MAX_MTFACE) {
+ if (layer->type == CD_MTFACE && mtfn < MAX_MTFACE) {
mtface= &((MTFace*)layer->data)[edp->f];
mtf= RE_vlakren_get_tface(obr, vlr, mtfn++, &name, 1);
@@ -3184,7 +3190,7 @@ static void use_mesh_edge_lookup(ObjectRen *obr, DerivedMesh *dm, MEdge *medge,
memcpy(mtf->uv[2], mtface->uv[1], sizeof(float)*2);
memcpy(mtf->uv[3], mtface->uv[1], sizeof(float)*2);
}
- else if(layer->type == CD_MCOL && mcn < MAX_MCOL) {
+ else if (layer->type == CD_MCOL && mcn < MAX_MCOL) {
mcol= &((MCol*)layer->data)[edp->f*4];
mc= RE_vlakren_get_mcol(obr, vlr, mcn++, &name, 1);
@@ -3206,8 +3212,8 @@ static void init_camera_inside_volumes(Render *re)
VolumeOb *vo;
float co[3] = {0.f, 0.f, 0.f};
- for(vo= re->volumes.first; vo; vo= vo->next) {
- for(obi= re->instancetable.first; obi; obi= obi->next) {
+ for (vo= re->volumes.first; vo; vo= vo->next) {
+ for (obi= re->instancetable.first; obi; obi= obi->next) {
if (obi->obr == vo->obr) {
if (point_inside_volume_objectinstance(re, obi, co)) {
MatInside *mi;
@@ -3225,7 +3231,7 @@ static void init_camera_inside_volumes(Render *re)
/* debug {
MatInside *m;
for (m=re->render_volumes_inside.first; m; m=m->next) {
- printf("matinside: ma: %s \n", m->ma->id.name+2);
+ printf("matinside: ma: %s\n", m->ma->id.name+2);
}
}*/
}
@@ -3270,25 +3276,25 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
copy_m3_m4(imat, ob->imat);
negative_scale= is_negative_m4(mat);
- if(me->totvert==0)
+ if (me->totvert==0)
return;
need_orco= 0;
- for(a=1; a<=ob->totcol; a++) {
+ for (a=1; a<=ob->totcol; a++) {
ma= give_render_material(re, ob, a);
- if(ma) {
- if(ma->texco & (TEXCO_ORCO|TEXCO_STRESS))
+ if (ma) {
+ if (ma->texco & (TEXCO_ORCO|TEXCO_STRESS))
need_orco= 1;
- if(ma->texco & TEXCO_STRESS)
+ if (ma->texco & TEXCO_STRESS)
need_stress= 1;
/* normalmaps, test if tangents needed, separated from shading */
- if(ma->mode_l & MA_TANGENT_V) {
+ if (ma->mode_l & MA_TANGENT_V) {
need_tangent= 1;
- if(me->mtface==NULL)
+ if (me->mtface==NULL)
need_orco= 1;
}
- if(ma->mode_l & MA_NORMAP_TANG) {
- if(me->mtface==NULL) {
+ if (ma->mode_l & MA_NORMAP_TANG) {
+ if (me->mtface==NULL) {
need_orco= 1;
need_tangent= 1;
}
@@ -3297,9 +3303,9 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
}
}
- if(re->flag & R_NEED_TANGENT) {
+ if (re->flag & R_NEED_TANGENT) {
/* exception for tangent space baking */
- if(me->mtface==NULL) {
+ if (me->mtface==NULL) {
need_orco= 1;
need_tangent= 1;
}
@@ -3308,22 +3314,22 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
/* check autosmooth and displacement, we then have to skip only-verts optimize */
do_autosmooth |= (me->flag & ME_AUTOSMOOTH);
- if(do_autosmooth)
+ if (do_autosmooth)
timeoffset= 0;
- if(test_for_displace(re, ob ) )
+ if (test_for_displace(re, ob ) )
timeoffset= 0;
mask= CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL;
- if(!timeoffset)
- if(need_orco)
+ if (!timeoffset)
+ if (need_orco)
mask |= CD_MASK_ORCO;
dm= mesh_create_derived_render(re->scene, ob, mask);
- if(dm==NULL) return; /* in case duplicated object fails? */
+ if (dm==NULL) return; /* in case duplicated object fails? */
- if(mask & CD_MASK_ORCO) {
+ if (mask & CD_MASK_ORCO) {
orco= dm->getVertDataArray(dm, CD_ORCO);
- if(orco) {
+ if (orco) {
orco= MEM_dupallocN(orco);
set_object_orco(re, ob, orco);
}
@@ -3333,7 +3339,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
totvert= dm->getNumVerts(dm);
/* attempt to autsmooth on original mesh, only without subsurf */
- if(do_autosmooth && me->totvert==totvert && me->totface==dm->getNumTessFaces(dm))
+ if (do_autosmooth && me->totvert==totvert && me->totface==dm->getNumTessFaces(dm))
use_original_normals= 1;
ms = (totvert==me->totvert)?me->msticky:NULL;
@@ -3341,15 +3347,15 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
ma= give_render_material(re, ob, 1);
- if(ma->material_type == MA_TYPE_HALO) {
+ if (ma->material_type == MA_TYPE_HALO) {
make_render_halos(re, obr, me, totvert, mvert, ma, orco);
}
else {
- for(a=0; a<totvert; a++, mvert++) {
+ for (a=0; a<totvert; a++, mvert++) {
ver= RE_findOrAddVert(obr, obr->totvert++);
copy_v3_v3(ver->co, mvert->co);
- if(do_autosmooth==0) { /* autosmooth on original unrotated data to prevent differences between frames */
+ if (do_autosmooth==0) { /* autosmooth on original unrotated data to prevent differences between frames */
normal_short_to_float_v3(ver->n, mvert->no);
mul_m4_v3(mat, ver->co);
mul_transposed_m3_v3(imat, ver->n);
@@ -3357,60 +3363,59 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
negate_v3(ver->n);
}
- if(orco) {
+ if (orco) {
ver->orco= orco;
orco+=3;
}
- if(ms) {
+ if (ms) {
float *sticky= RE_vertren_get_sticky(obr, ver, 1);
- sticky[0]= ms->co[0];
- sticky[1]= ms->co[1];
+ copy_v2_v2(sticky, ms->co);
ms++;
}
}
- if(!timeoffset) {
+ if (!timeoffset) {
/* store customdata names, because DerivedMesh is freed */
RE_set_customdata_names(obr, &dm->faceData);
/* add tangent layer if we need one */
- if(need_nmap_tangent!=0 && CustomData_get_layer_index(&dm->faceData, CD_TANGENT) == -1)
+ if (need_nmap_tangent!=0 && CustomData_get_layer_index(&dm->faceData, CD_TANGENT) == -1)
DM_add_tangent_layer(dm);
/* still to do for keys: the correct local texture coordinate */
/* faces in order of color blocks */
vertofs= obr->totvert - totvert;
- for(a1=0; (a1<ob->totcol || (a1==0 && ob->totcol==0)); a1++) {
+ for (a1=0; (a1<ob->totcol || (a1==0 && ob->totcol==0)); a1++) {
ma= give_render_material(re, ob, a1+1);
/* test for 100% transparant */
ok= 1;
- if(ma->alpha==0.0f && ma->spectra==0.0f && ma->filter==0.0f && (ma->mode & MA_TRANSP) && (ma->mode & MA_RAYMIRROR)==0) {
+ if (ma->alpha==0.0f && ma->spectra==0.0f && ma->filter==0.0f && (ma->mode & MA_TRANSP) && (ma->mode & MA_RAYMIRROR)==0) {
ok= 0;
/* texture on transparency? */
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a] && ma->mtex[a]->tex) {
- if(ma->mtex[a]->mapto & MAP_ALPHA) ok= 1;
+ for (a=0; a<MAX_MTEX; a++) {
+ if (ma->mtex[a] && ma->mtex[a]->tex) {
+ if (ma->mtex[a]->mapto & MAP_ALPHA) ok= 1;
}
}
}
/* if wire material, and we got edges, don't do the faces */
- if(ma->material_type == MA_TYPE_WIRE) {
+ if (ma->material_type == MA_TYPE_WIRE) {
end= dm->getNumEdges(dm);
- if(end) ok= 0;
+ if (end) ok= 0;
}
- if(ok) {
+ if (ok) {
end= dm->getNumTessFaces(dm);
mface= dm->getTessFaceArray(dm);
- for(a=0; a<end; a++, mface++) {
+ for (a=0; a<end; a++, mface++) {
int v1, v2, v3, v4, flag;
- if( mface->mat_nr==a1 ) {
+ if ( mface->mat_nr==a1 ) {
float len;
int reverse_verts = negative_scale!=0 && do_autosmooth==0;
int rev_tab[] = {reverse_verts==0 ? 0 : 2, 1, reverse_verts==0 ? 2 : 0, 3};
@@ -3424,21 +3429,21 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
vlr->v1= RE_findOrAddVert(obr, vertofs+v1);
vlr->v2= RE_findOrAddVert(obr, vertofs+v2);
vlr->v3= RE_findOrAddVert(obr, vertofs+v3);
- if(v4) vlr->v4= RE_findOrAddVert(obr, vertofs+v4);
+ if (v4) vlr->v4= RE_findOrAddVert(obr, vertofs+v4);
else vlr->v4= 0;
/* render normals are inverted in render */
- if(use_original_normals) {
+ if (use_original_normals) {
MFace *mf= me->mface+a;
MVert *mv= me->mvert;
- if(vlr->v4)
+ if (vlr->v4)
len= normal_quad_v3( vlr->n, mv[mf->v4].co, mv[mf->v3].co, mv[mf->v2].co, mv[mf->v1].co);
else
len= normal_tri_v3( vlr->n,mv[mf->v3].co, mv[mf->v2].co, mv[mf->v1].co);
}
else {
- if(vlr->v4)
+ if (vlr->v4)
len= normal_quad_v3( vlr->n,vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
else
len= normal_tri_v3( vlr->n,vlr->v3->co, vlr->v2->co, vlr->v1->co);
@@ -3448,7 +3453,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
vlr->flag= flag;
vlr->ec= 0; /* mesh edges rendered separately */
- if(len==0) obr->totvlak--;
+ if (len==0) obr->totvlak--;
else {
CustomDataLayer *layer;
MTFace *mtface, *mtf;
@@ -3457,32 +3462,30 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
char *name;
int nr_verts = v4!=0 ? 4 : 3;
- for(index=0; index<dm->faceData.totlayer; index++) {
+ for (index=0; index<dm->faceData.totlayer; index++) {
layer= &dm->faceData.layers[index];
name= layer->name;
- if(layer->type == CD_MTFACE && mtfn < MAX_MTFACE) {
+ if (layer->type == CD_MTFACE && mtfn < MAX_MTFACE) {
int t;
mtf= RE_vlakren_get_tface(obr, vlr, mtfn++, &name, 1);
mtface= (MTFace*)layer->data;
*mtf= mtface[a]; // copy face info
- for(vindex=0; vindex<nr_verts; vindex++)
- for(t=0; t<2; t++)
+ for (vindex=0; vindex<nr_verts; vindex++)
+ for (t=0; t<2; t++)
mtf->uv[vindex][t]=mtface[a].uv[rev_tab[vindex]][t];
}
- else if(layer->type == CD_MCOL && mcn < MAX_MCOL) {
+ else if (layer->type == CD_MCOL && mcn < MAX_MCOL) {
mc= RE_vlakren_get_mcol(obr, vlr, mcn++, &name, 1);
mcol= (MCol*)layer->data;
- for(vindex=0; vindex<nr_verts; vindex++)
+ 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++)
+ for (vindex=0; vindex<nr_verts; vindex++)
{
copy_v4_v4(ftang+vindex*4, tangent+a*16+rev_tab[vindex]*4);
mul_mat3_m4_v3(mat, ftang+vindex*4);
@@ -3501,7 +3504,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
end= dm->getNumEdges(dm);
mvert= dm->getVertArray(dm);
ma= give_render_material(re, ob, 1);
- if(end && (ma->material_type == MA_TYPE_WIRE)) {
+ if (end && (ma->material_type == MA_TYPE_WIRE)) {
MEdge *medge;
struct edgesort *edgetable;
int totedge= 0;
@@ -3512,7 +3515,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
/* we want edges to have UV and vcol too... */
edgetable= make_mesh_edge_lookup(dm, &totedge);
- for(a1=0; a1<end; a1++, medge++) {
+ for (a1=0; a1<end; a1++, medge++) {
if (medge->flag&ME_EDGERENDER) {
MVert *v0 = &mvert[medge->v1];
MVert *v1 = &mvert[medge->v2];
@@ -3523,7 +3526,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
vlr->v3= vlr->v2;
vlr->v4= NULL;
- if(edgetable)
+ if (edgetable)
use_mesh_edge_lookup(obr, dm, medge, vlr, edgetable, totedge);
xn= -(v0->no[0]+v1->no[0]);
@@ -3540,31 +3543,31 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
vlr->ec= ME_V1V2;
}
}
- if(edgetable)
+ if (edgetable)
MEM_freeN(edgetable);
}
}
}
- if(!timeoffset) {
- if(need_stress)
+ if (!timeoffset) {
+ if (need_stress)
calc_edge_stress(re, obr, me);
if (test_for_displace(re, ob ) ) {
recalc_normals= 1;
calc_vertexnormals(re, obr, 0, 0);
- if(do_autosmooth)
+ if (do_autosmooth)
do_displacement(re, obr, mat, imat);
else
do_displacement(re, obr, NULL, NULL);
}
- if(do_autosmooth) {
+ if (do_autosmooth) {
recalc_normals= 1;
autosmooth(re, obr, mat, me->smoothresh);
}
- if(recalc_normals!=0 || need_tangent!=0)
+ if (recalc_normals!=0 || need_tangent!=0)
calc_vertexnormals(re, obr, need_tangent, need_nmap_tangent);
}
@@ -3580,21 +3583,21 @@ static void initshadowbuf(Render *re, LampRen *lar, float mat[][4])
struct ShadBuf *shb;
float viewinv[4][4];
- /* if(la->spsi<16) return; */
+ /* if (la->spsi<16) return; */
/* memory alloc */
shb= (struct ShadBuf *)MEM_callocN( sizeof(struct ShadBuf),"initshadbuf");
lar->shb= shb;
- if(shb==NULL) return;
+ if (shb==NULL) return;
VECCOPY(shb->co, lar->co); /* int copy */
/* percentage render: keep track of min and max */
shb->size= (lar->bufsize*re->r.size)/100;
- if(shb->size<512) shb->size= 512;
- else if(shb->size > lar->bufsize) shb->size= lar->bufsize;
+ if (shb->size<512) shb->size= 512;
+ else if (shb->size > lar->bufsize) shb->size= lar->bufsize;
shb->size &= ~15; /* make sure its multiples of 16 */
@@ -3619,7 +3622,7 @@ static void initshadowbuf(Render *re, LampRen *lar, float mat[][4])
shb->bias= (0.02f*lar->bias)*0x7FFFFFFF;
/* halfway method (average of first and 2nd z) reduces bias issues */
- if(ELEM(lar->buftype, LA_SHADBUF_HALFWAY, LA_SHADBUF_DEEP))
+ if (ELEM(lar->buftype, LA_SHADBUF_HALFWAY, LA_SHADBUF_DEEP))
shb->bias= 0.1f*shb->bias;
shb->compressthresh= lar->compressthresh;
@@ -3668,11 +3671,11 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
int c;
/* previewrender sets this to zero... prevent accidents */
- if(la==NULL) return NULL;
+ if (la==NULL) return NULL;
/* prevent only shadow from rendering light */
- if(la->mode & LA_ONLYSHADOW)
- if((re->r.mode & R_SHADOW)==0)
+ if (la->mode & LA_ONLYSHADOW)
+ if ((re->r.mode & R_SHADOW)==0)
return NULL;
re->totlamp++;
@@ -3695,7 +3698,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
lar->bufsize = la->bufsize;
lar->samp = la->samp;
lar->buffers= la->buffers;
- if(lar->buffers==0) lar->buffers= 1;
+ if (lar->buffers==0) lar->buffers= 1;
lar->buftype= la->buftype;
lar->filtertype= la->filtertype;
lar->soft = la->soft;
@@ -3710,7 +3713,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
lar->mode= la->mode;
lar->energy= la->energy;
- if(la->mode & LA_NEG) lar->energy= -lar->energy;
+ if (la->mode & LA_NEG) lar->energy= -lar->energy;
lar->vec[0]= -mat[2][0];
lar->vec[1]= -mat[2][1];
@@ -3743,7 +3746,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
/* Annoying, lamp UI does this, but the UI might not have been used? - add here too.
* make sure this matches buttons_shading.c's logic */
- if(ELEM4(la->type, LA_AREA, LA_SPOT, LA_SUN, LA_LOCAL) && (la->mode & LA_SHAD_RAY))
+ if (ELEM4(la->type, LA_AREA, LA_SPOT, LA_SUN, LA_LOCAL) && (la->mode & LA_SHAD_RAY))
if (ELEM3(la->type, LA_SPOT, LA_SUN, LA_LOCAL))
if (la->ray_samp_method == LA_SAMP_CONSTANT) la->ray_samp_method = LA_SAMP_HALTON;
@@ -3753,12 +3756,12 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
lar->adapt_thresh= la->adapt_thresh;
lar->sunsky = NULL;
- if( ELEM(lar->type, LA_SPOT, LA_LOCAL)) {
+ if ( ELEM(lar->type, LA_SPOT, LA_LOCAL)) {
lar->ray_totsamp= lar->ray_samp*lar->ray_samp;
lar->area_shape = LA_AREA_SQUARE;
lar->area_sizey= lar->area_size;
}
- else if(lar->type==LA_AREA) {
+ else if (lar->type==LA_AREA) {
switch(lar->area_shape) {
case LA_AREA_SQUARE:
lar->ray_totsamp= lar->ray_samp*lar->ray_samp;
@@ -3783,13 +3786,13 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
area_lamp_vectors(lar);
init_jitter_plane(lar); // subsamples
}
- else if(lar->type==LA_SUN){
+ else if (lar->type==LA_SUN) {
lar->ray_totsamp= lar->ray_samp*lar->ray_samp;
lar->area_shape = LA_AREA_SQUARE;
lar->area_sizey= lar->area_size;
- if((la->sun_effect_type & LA_SUN_EFFECT_SKY) ||
- (la->sun_effect_type & LA_SUN_EFFECT_AP)){
+ if ((la->sun_effect_type & LA_SUN_EFFECT_SKY) ||
+ (la->sun_effect_type & LA_SUN_EFFECT_AP)) {
lar->sunsky = (struct SunSky*)MEM_callocN(sizeof(struct SunSky), "sunskyren");
lar->sunsky->effect_type = la->sun_effect_type;
@@ -3807,8 +3810,8 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
else lar->ray_totsamp= 0;
lar->spotsi= la->spotsize;
- if(lar->mode & LA_HALO) {
- if(lar->spotsi>170.0f) lar->spotsi= 170.0f;
+ if (lar->mode & LA_HALO) {
+ if (lar->spotsi>170.0f) lar->spotsi= 170.0f;
}
lar->spotsi= cosf( (float)M_PI*lar->spotsi/360.0f );
lar->spotbl= (1.0f-lar->spotsi)*la->spotblend;
@@ -3822,7 +3825,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
lar->ld2= la->att2;
lar->curfalloff = curvemapping_copy(la->curfalloff);
- if(lar->type==LA_SPOT) {
+ if (lar->type==LA_SPOT) {
normalize_v3(lar->imat[0]);
normalize_v3(lar->imat[1]);
@@ -3832,15 +3835,15 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
xn= sin(xn)/cos(xn);
lar->spottexfac= 1.0f/(xn);
- if(lar->mode & LA_ONLYSHADOW) {
- if((lar->mode & (LA_SHAD_BUF|LA_SHAD_RAY))==0) lar->mode -= LA_ONLYSHADOW;
+ if (lar->mode & LA_ONLYSHADOW) {
+ if ((lar->mode & (LA_SHAD_BUF|LA_SHAD_RAY))==0) lar->mode -= LA_ONLYSHADOW;
}
}
/* set flag for spothalo en initvars */
- if(la->type==LA_SPOT && (la->mode & LA_HALO) && (la->buftype != LA_SHADBUF_DEEP)) {
- if(la->haint>0.0f) {
+ if (la->type==LA_SPOT && (la->mode & LA_HALO) && (la->buftype != LA_SHADBUF_DEEP)) {
+ if (la->haint>0.0f) {
re->flag |= R_LAMPHALO;
/* camera position (0,0,0) rotate around lamp */
@@ -3858,25 +3861,25 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
lar->sh_invcampos[2]*= lar->sh_zfac;
/* halfway shadow buffer doesn't work for volumetric effects */
- if(lar->buftype == LA_SHADBUF_HALFWAY)
+ if (lar->buftype == LA_SHADBUF_HALFWAY)
lar->buftype = LA_SHADBUF_REGULAR;
}
}
- else if(la->type==LA_HEMI) {
+ else if (la->type==LA_HEMI) {
lar->mode &= ~(LA_SHAD_RAY|LA_SHAD_BUF);
}
- for(c=0; c<MAX_MTEX; c++) {
- if(la->mtex[c] && la->mtex[c]->tex) {
+ for (c=0; c<MAX_MTEX; c++) {
+ if (la->mtex[c] && la->mtex[c]->tex) {
if (la->mtex[c]->mapto & LAMAP_COL)
lar->mode |= LA_TEXTURE;
if (la->mtex[c]->mapto & LAMAP_SHAD)
lar->mode |= LA_SHAD_TEX;
- if(G.rendering) {
- if(re->osa) {
- if(la->mtex[c]->tex->type==TEX_IMAGE) lar->mode |= LA_OSATEX;
+ if (G.rendering) {
+ if (re->osa) {
+ if (la->mtex[c]->tex->type==TEX_IMAGE) lar->mode |= LA_OSATEX;
}
}
}
@@ -3885,15 +3888,15 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
/* old code checked for internal render (aka not yafray) */
{
/* to make sure we can check ray shadow easily in the render code */
- if(lar->mode & LA_SHAD_RAY) {
- if( (re->r.mode & R_RAYTRACE)==0)
+ if (lar->mode & LA_SHAD_RAY) {
+ if ( (re->r.mode & R_RAYTRACE)==0)
lar->mode &= ~LA_SHAD_RAY;
}
- if(re->r.mode & R_SHADOW) {
+ if (re->r.mode & R_SHADOW) {
- if(la->type==LA_AREA && (lar->mode & LA_SHAD_RAY) && (lar->ray_samp_method == LA_SAMP_CONSTANT)) {
+ if (la->type==LA_AREA && (lar->mode & LA_SHAD_RAY) && (lar->ray_samp_method == LA_SAMP_CONSTANT)) {
init_jitter_plane(lar);
}
else if (la->type==LA_SPOT && (lar->mode & LA_SHAD_BUF) ) {
@@ -3905,7 +3908,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
/* this is the way used all over to check for shadow */
- if(lar->shb || (lar->mode & LA_SHAD_RAY)) {
+ if (lar->shb || (lar->mode & LA_SHAD_RAY)) {
LampShadowSample *ls;
LampShadowSubSample *lss;
int a, b;
@@ -3916,9 +3919,9 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
ls= lar->shadsamp;
/* shadfacs actually mean light, let's put them to 1 to prevent unitialized accidents */
- for(a=0; a<re->r.threads; a++, ls++) {
+ for (a=0; a<re->r.threads; a++, ls++) {
lss= ls->s;
- for(b=0; b<re->r.osa; b++, lss++) {
+ for (b=0; b<re->r.osa; b++, lss++) {
lss->samplenr= -1; /* used to detect whether we store or read */
lss->shadfac[0]= 1.0f;
lss->shadfac[1]= 1.0f;
@@ -3942,20 +3945,20 @@ static void add_lightgroup(Render *re, Group *group, int exclusive)
/* it's a bit too many loops in loops... but will survive */
/* note that 'exclusive' will remove it from the global list */
- for(go= group->gobject.first; go; go= go->next) {
+ for (go= group->gobject.first; go; go= go->next) {
go->lampren= NULL;
- if(go->ob->lay & re->lay) {
- if(go->ob && go->ob->type==OB_LAMP) {
- for(gol= re->lights.first; gol; gol= gol->next) {
- if(gol->ob==go->ob) {
+ if (go->ob->lay & re->lay) {
+ if (go->ob && go->ob->type==OB_LAMP) {
+ for (gol= re->lights.first; gol; gol= gol->next) {
+ if (gol->ob==go->ob) {
go->lampren= gol->lampren;
break;
}
}
- if(go->lampren==NULL)
+ if (go->lampren==NULL)
gol= add_render_lamp(re, go->ob);
- if(gol && exclusive) {
+ if (gol && exclusive) {
BLI_remlink(&re->lights, gol);
MEM_freeN(gol);
}
@@ -3970,16 +3973,16 @@ static void set_material_lightgroups(Render *re)
Material *ma;
/* not for preview render */
- if(re->scene->r.scemode & R_PREVIEWBUTS)
+ if (re->scene->r.scemode & R_PREVIEWBUTS)
return;
- for(group= re->main->group.first; group; group=group->id.next)
+ for (group= re->main->group.first; group; group=group->id.next)
group->id.flag |= LIB_DOIT;
/* it's a bit too many loops in loops... but will survive */
/* hola! materials not in use...? */
- for(ma= re->main->mat.first; ma; ma=ma->id.next) {
- if(ma->group && (ma->group->id.flag & LIB_DOIT))
+ for (ma= re->main->mat.first; ma; ma=ma->id.next) {
+ if (ma->group && (ma->group->id.flag & LIB_DOIT))
add_lightgroup(re, ma->group, ma->mode & MA_GROUP_NOLAY);
}
}
@@ -3988,8 +3991,8 @@ static void set_renderlayer_lightgroups(Render *re, Scene *sce)
{
SceneRenderLayer *srl;
- for(srl= sce->r.layers.first; srl; srl= srl->next) {
- if(srl->light_override)
+ for (srl= sce->r.layers.first; srl; srl= srl->next) {
+ if (srl->light_override)
add_lightgroup(re, srl->light_override, 0);
}
}
@@ -4003,7 +4006,7 @@ void init_render_world(Render *re)
int a;
char *cp;
- if(re->scene && re->scene->world) {
+ if (re->scene && re->scene->world) {
re->wrld= *(re->scene->world);
cp= (char *)&re->wrld.fastcol;
@@ -4017,14 +4020,14 @@ void init_render_world(Render *re)
normalize_v3(re->grvec);
copy_m3_m4(re->imat, re->viewinv);
- for(a=0; a<MAX_MTEX; a++)
- if(re->wrld.mtex[a] && re->wrld.mtex[a]->tex) re->wrld.skytype |= WO_SKYTEX;
+ for (a=0; a<MAX_MTEX; a++)
+ if (re->wrld.mtex[a] && re->wrld.mtex[a]->tex) re->wrld.skytype |= WO_SKYTEX;
/* AO samples should be OSA minimum */
- if(re->osa)
- while(re->wrld.aosamp*re->wrld.aosamp < re->osa)
+ if (re->osa)
+ while (re->wrld.aosamp*re->wrld.aosamp < re->osa)
re->wrld.aosamp++;
- if(!(re->r.mode & R_RAYTRACE) && (re->wrld.ao_gather_method == WO_AOGATHER_RAYTRACE))
+ if (!(re->r.mode & R_RAYTRACE) && (re->wrld.ao_gather_method == WO_AOGATHER_RAYTRACE))
re->wrld.mode &= ~(WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT);
}
else {
@@ -4057,47 +4060,47 @@ 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++) {
+ for (i=0; i<obr->totvlak; i++) {
vlr= RE_findOrAddVlak(obr, i);
- if(vlr->flag & R_SMOOTH) {
+ if (vlr->flag & R_SMOOTH) {
dot= dot_v3v3(vlr->n, vlr->v1->n);
dot= ABS(dot);
- if(dot>0.9f) {
+ if (dot>0.9f) {
thresh+= dot; tot++;
}
dot= dot_v3v3(vlr->n, vlr->v2->n);
dot= ABS(dot);
- if(dot>0.9f) {
+ if (dot>0.9f) {
thresh+= dot; tot++;
}
dot= dot_v3v3(vlr->n, vlr->v3->n);
dot= ABS(dot);
- if(dot>0.9f) {
+ if (dot>0.9f) {
thresh+= dot; tot++;
}
- if(vlr->v4) {
+ if (vlr->v4) {
dot= dot_v3v3(vlr->n, vlr->v4->n);
dot= ABS(dot);
- if(dot>0.9f) {
+ if (dot>0.9f) {
thresh+= dot; tot++;
}
}
}
}
- if(tot) {
+ if (tot) {
thresh/= (float)tot;
obr->ob->smoothresh= cosf(0.5f*(float)M_PI-saacos(thresh));
}
}
/* 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;
@@ -4106,21 +4109,21 @@ static void set_fullsample_trace_flag(Render *re, ObjectRen *obr)
osa= re->osa;
trace= re->r.mode & R_RAYTRACE;
- for(a=obr->totvlak-1; a>=0; a--) {
+ for (a=obr->totvlak-1; a>=0; a--) {
vlr= RE_findOrAddVlak(obr, a);
mode= vlr->mat->mode;
- if(trace && (mode & MA_TRACEBLE))
+ if (trace && (mode & MA_TRACEBLE))
vlr->flag |= R_TRACEBLE;
- if(osa) {
- if(mode & MA_FULL_OSA) {
+ if (osa) {
+ if (mode & MA_FULL_OSA) {
vlr->flag |= R_FULL_OSA;
}
- else if(trace) {
- if(mode & MA_SHLESS);
- else if(vlr->mat->material_type == MA_TYPE_VOLUME);
- else if((mode & MA_RAYMIRROR) || ((mode & MA_TRANSP) && (mode & MA_RAYTRANSP))) {
+ else if (trace) {
+ if (mode & MA_SHLESS);
+ else if (vlr->mat->material_type == MA_TYPE_VOLUME);
+ else if ((mode & MA_RAYMIRROR) || ((mode & MA_TRANSP) && (mode & MA_RAYTRANSP))) {
/* for blurry reflect/refract, better to take more samples
* inside the raytrace than as OSA samples */
if ((vlr->mat->gloss_mir == 1.0f) && (vlr->mat->gloss_tra == 1.0f))
@@ -4139,18 +4142,18 @@ static void split_quads(ObjectRen *obr, int dir)
VlakRen *vlr, *vlr1;
int a;
- for(a=obr->totvlak-1; a>=0; a--) {
+ for (a=obr->totvlak-1; a>=0; a--) {
vlr= RE_findOrAddVlak(obr, a);
/* test if rendering as a quad or triangle, skip wire */
- if(vlr->v4 && (vlr->flag & R_STRAND)==0 && (vlr->mat->material_type != MA_TYPE_WIRE)) {
+ if (vlr->v4 && (vlr->flag & R_STRAND)==0 && (vlr->mat->material_type != MA_TYPE_WIRE)) {
- if(vlr->v4) {
+ if (vlr->v4) {
vlr1= RE_vlakren_copy(obr, vlr);
vlr1->flag |= R_FACE_SPLIT;
- if( dir==2 ) vlr->flag |= R_DIVIDE_24;
+ if ( dir==2 ) vlr->flag |= R_DIVIDE_24;
else vlr->flag &= ~R_DIVIDE_24;
/* new vertex pointers */
@@ -4189,11 +4192,11 @@ static void check_non_flat_quads(ObjectRen *obr)
float nor[3], xn, flen;
int a;
- for(a=obr->totvlak-1; a>=0; a--) {
+ for (a=obr->totvlak-1; a>=0; a--) {
vlr= RE_findOrAddVlak(obr, a);
/* test if rendering as a quad or triangle, skip wire */
- if(vlr->v4 && (vlr->flag & R_STRAND)==0 && (vlr->mat->material_type != MA_TYPE_WIRE)) {
+ if (vlr->v4 && (vlr->flag & R_STRAND)==0 && (vlr->mat->material_type != MA_TYPE_WIRE)) {
/* check if quad is actually triangle */
v1= vlr->v1;
@@ -4201,7 +4204,7 @@ static void check_non_flat_quads(ObjectRen *obr)
v3= vlr->v3;
v4= vlr->v4;
sub_v3_v3v3(nor, v1->co, v2->co);
- if( ABS(nor[0])<FLT_EPSILON10 && ABS(nor[1])<FLT_EPSILON10 && ABS(nor[2])<FLT_EPSILON10 ) {
+ if ( ABS(nor[0])<FLT_EPSILON10 && ABS(nor[1])<FLT_EPSILON10 && ABS(nor[2])<FLT_EPSILON10 ) {
vlr->v1= v2;
vlr->v2= v3;
vlr->v3= v4;
@@ -4209,26 +4212,26 @@ static void check_non_flat_quads(ObjectRen *obr)
}
else {
sub_v3_v3v3(nor, v2->co, v3->co);
- if( ABS(nor[0])<FLT_EPSILON10 && ABS(nor[1])<FLT_EPSILON10 && ABS(nor[2])<FLT_EPSILON10 ) {
+ if ( ABS(nor[0])<FLT_EPSILON10 && ABS(nor[1])<FLT_EPSILON10 && ABS(nor[2])<FLT_EPSILON10 ) {
vlr->v2= v3;
vlr->v3= v4;
vlr->v4= NULL;
}
else {
sub_v3_v3v3(nor, v3->co, v4->co);
- if( ABS(nor[0])<FLT_EPSILON10 && ABS(nor[1])<FLT_EPSILON10 && ABS(nor[2])<FLT_EPSILON10 ) {
+ if ( ABS(nor[0])<FLT_EPSILON10 && ABS(nor[1])<FLT_EPSILON10 && ABS(nor[2])<FLT_EPSILON10 ) {
vlr->v4= NULL;
}
else {
sub_v3_v3v3(nor, v4->co, v1->co);
- if( ABS(nor[0])<FLT_EPSILON10 && ABS(nor[1])<FLT_EPSILON10 && ABS(nor[2])<FLT_EPSILON10 ) {
+ if ( ABS(nor[0])<FLT_EPSILON10 && ABS(nor[1])<FLT_EPSILON10 && ABS(nor[2])<FLT_EPSILON10 ) {
vlr->v4= NULL;
}
}
}
}
- if(vlr->v4) {
+ if (vlr->v4) {
/* Face is divided along edge with the least gradient */
/* Flagged with R_DIVIDE_24 if divide is from vert 2 to 4 */
@@ -4239,11 +4242,11 @@ static void check_non_flat_quads(ObjectRen *obr)
/* render normals are inverted in render! we calculate normal of single tria here */
flen= normal_tri_v3( nor,vlr->v4->co, vlr->v3->co, vlr->v1->co);
- if(flen==0.0f) normal_tri_v3( nor,vlr->v4->co, vlr->v2->co, vlr->v1->co);
+ if (flen==0.0f) normal_tri_v3( nor,vlr->v4->co, vlr->v2->co, vlr->v1->co);
xn = dot_v3v3(nor, vlr->n);
- if(ABS(xn) < 0.999995f ) { // checked on noisy fractal grid
+ if (ABS(xn) < 0.999995f ) { // checked on noisy fractal grid
float d1, d2;
@@ -4257,7 +4260,7 @@ static void check_non_flat_quads(ObjectRen *obr)
normal_tri_v3( nor,vlr->v2->co, vlr->v3->co, vlr->v4->co);
d2 = dot_v3v3(nor, vlr->v2->n);
- if( fabs(d1) < fabs(d2) ) vlr->flag |= R_DIVIDE_24;
+ if ( fabs(d1) < fabs(d2) ) vlr->flag |= R_DIVIDE_24;
else vlr->flag &= ~R_DIVIDE_24;
/* new vertex pointers */
@@ -4299,25 +4302,26 @@ static void finalize_render_object(Render *re, ObjectRen *obr, int timeoffset)
float min[3], max[3], smin[3], smax[3];
int a, b;
- if(obr->totvert || obr->totvlak || obr->tothalo || obr->totstrand) {
+ if (obr->totvert || obr->totvlak || obr->tothalo || obr->totstrand) {
/* the exception below is because displace code now is in init_render_mesh call,
I will look at means to have autosmooth enabled for all object types
and have it as general postprocess, like displace */
- if(ob->type!=OB_MESH && test_for_displace(re, ob))
+ if (ob->type!=OB_MESH && test_for_displace(re, ob))
do_displacement(re, obr, NULL, NULL);
- if(!timeoffset) {
+ if (!timeoffset) {
/* phong normal interpolation can cause error in tracing
* (terminator problem) */
ob->smoothresh= 0.0;
- if((re->r.mode & R_RAYTRACE) && (re->r.mode & R_SHADOW))
+ if ((re->r.mode & R_RAYTRACE) && (re->r.mode & R_SHADOW))
set_phong_threshold(obr);
if (re->flag & R_BAKING && re->r.bake_quad_split != 0) {
/* Baking lets us define a quad split order */
split_quads(obr, re->r.bake_quad_split);
- } else {
- if((re->r.mode & R_SIMPLIFY && re->r.simplify_flag & R_SIMPLE_NO_TRIANGULATE) == 0)
+ }
+ else {
+ if ((re->r.mode & R_SIMPLIFY && re->r.simplify_flag & R_SIMPLE_NO_TRIANGULATE) == 0)
check_non_flat_quads(obr);
}
@@ -4325,29 +4329,29 @@ static void finalize_render_object(Render *re, ObjectRen *obr, int timeoffset)
/* compute bounding boxes for clipping */
INIT_MINMAX(min, max);
- for(a=0; a<obr->totvert; a++) {
- if((a & 255)==0) ver= obr->vertnodes[a>>8].vert;
+ for (a=0; a<obr->totvert; a++) {
+ if ((a & 255)==0) ver= obr->vertnodes[a>>8].vert;
else ver++;
DO_MINMAX(ver->co, min, max);
}
- if(obr->strandbuf) {
+ if (obr->strandbuf) {
float width;
/* compute average bounding box of strandpoint itself (width) */
- if(obr->strandbuf->flag & R_STRAND_B_UNITS)
+ if (obr->strandbuf->flag & R_STRAND_B_UNITS)
obr->strandbuf->maxwidth= MAX2(obr->strandbuf->ma->strand_sta, obr->strandbuf->ma->strand_end);
else
obr->strandbuf->maxwidth= 0.0f;
width= obr->strandbuf->maxwidth;
sbound= obr->strandbuf->bound;
- for(b=0; b<obr->strandbuf->totbound; b++, sbound++) {
+ for (b=0; b<obr->strandbuf->totbound; b++, sbound++) {
INIT_MINMAX(smin, smax);
- for(a=sbound->start; a<sbound->end; a++) {
+ for (a=sbound->start; a<sbound->end; a++) {
strand= RE_findOrAddStrand(obr, a);
strand_minmax(strand, smin, smax, width);
}
@@ -4387,8 +4391,8 @@ static void find_dupli_instances(Render *re, ObjectRen *obr)
/* for objects instanced by dupliverts/faces/particles, we go over the
* list of instances to find ones that instance obr, and setup their
* matrices and obr pointer */
- for(obi=re->instancetable.last; obi; obi=obi->prev) {
- if(!obi->obr && obi->ob == obr->ob && obi->psysindex == obr->psysindex) {
+ for (obi=re->instancetable.last; obi; obi=obi->prev) {
+ if (!obi->obr && obi->ob == obr->ob && obi->psysindex == obr->psysindex) {
obi->obr= obr;
/* compute difference between object matrix and
@@ -4400,7 +4404,7 @@ static void find_dupli_instances(Render *re, ObjectRen *obr)
invert_m3_m3(obi->nmat, nmat);
transpose_m3(obi->nmat);
- if(!first) {
+ if (!first) {
re->totvert += obr->totvert;
re->totvlak += obr->totvlak;
re->tothalo += obr->tothalo;
@@ -4442,13 +4446,13 @@ static ObjectRen *find_dupligroup_dupli(Render *re, Object *ob, int psysindex)
/* if the object is itself instanced, we don't want to create an instance
* for it */
- if(ob->transflag & OB_RENDER_DUPLI)
+ if (ob->transflag & OB_RENDER_DUPLI)
return NULL;
/* try to find an object that was already created so we can reuse it
* and save memory */
- for(obr=re->objecttable.first; obr; obr=obr->next)
- if(obr->ob == ob && obr->psysindex == psysindex && (obr->flag & R_INSTANCEABLE))
+ for (obr=re->objecttable.first; obr; obr=obr->next)
+ if (obr->ob == ob && obr->psysindex == psysindex && (obr->flag & R_INSTANCEABLE))
return obr;
return NULL;
@@ -4464,14 +4468,14 @@ static void set_dupli_tex_mat(Render *re, ObjectInstanceRen *obi, DupliObject *d
static int needtexmat= 0;
/* init */
- if(!re) {
+ if (!re) {
lastob= NULL;
needtexmat= 0;
return;
}
/* check if we actually need it */
- if(lastob != dob->ob) {
+ if (lastob != dob->ob) {
Material ***material;
short a, *totmaterial;
@@ -4481,13 +4485,13 @@ static void set_dupli_tex_mat(Render *re, ObjectInstanceRen *obi, DupliObject *d
totmaterial= give_totcolp(dob->ob);
material= give_matarar(dob->ob);
- if(totmaterial && material)
- for(a= 0; a<*totmaterial; a++)
- if((*material)[a] && (*material)[a]->texco & TEXCO_OBJECT)
+ if (totmaterial && material)
+ for (a= 0; a<*totmaterial; a++)
+ if ((*material)[a] && (*material)[a]->texco & TEXCO_OBJECT)
needtexmat= 1;
}
- if(needtexmat) {
+ if (needtexmat) {
float imat[4][4];
obi->duplitexmat= BLI_memarena_alloc(re->memArena, sizeof(float)*4*4);
@@ -4502,8 +4506,8 @@ static void init_render_object_data(Render *re, ObjectRen *obr, int timeoffset)
ParticleSystem *psys;
int i;
- if(obr->psysindex) {
- if((!obr->prev || obr->prev->ob != ob || (obr->prev->flag & R_INSTANCEABLE)==0) && ob->type==OB_MESH) {
+ if (obr->psysindex) {
+ if ((!obr->prev || obr->prev->ob != ob || (obr->prev->flag & R_INSTANCEABLE)==0) && ob->type==OB_MESH) {
/* the emitter mesh wasn't rendered so the modifier stack wasn't
* evaluated with render settings */
DerivedMesh *dm;
@@ -4511,19 +4515,19 @@ static void init_render_object_data(Render *re, ObjectRen *obr, int timeoffset)
dm->release(dm);
}
- for(psys=ob->particlesystem.first, i=0; i<obr->psysindex-1; i++)
+ for (psys=ob->particlesystem.first, i=0; i<obr->psysindex-1; i++)
psys= psys->next;
render_new_particle_system(re, obr, psys, timeoffset);
}
else {
- if ELEM(ob->type, OB_FONT, OB_CURVE)
+ if (ELEM(ob->type, OB_FONT, OB_CURVE))
init_render_curve(re, obr, timeoffset);
- else if(ob->type==OB_SURF)
+ else if (ob->type==OB_SURF)
init_render_surf(re, obr, timeoffset);
- else if(ob->type==OB_MESH)
+ else if (ob->type==OB_MESH)
init_render_mesh(re, obr, timeoffset);
- else if(ob->type==OB_MBALL)
+ else if (ob->type==OB_MBALL)
init_render_mball(re, obr);
}
@@ -4546,31 +4550,31 @@ static void add_render_object(Render *re, Object *ob, Object *par, DupliObject *
/* the emitter has to be processed first (render levels of modifiers) */
/* so here we only check if the emitter should be rendered */
- if(ob->particlesystem.first) {
+ if (ob->particlesystem.first) {
show_emitter= 0;
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
+ for (psys=ob->particlesystem.first; psys; psys=psys->next) {
show_emitter += psys->part->draw & PART_DRAW_EMITTER;
psys_render_set(ob, psys, re->viewmat, re->winmat, re->winx, re->winy, timeoffset);
}
/* if no psys has "show emitter" selected don't render emitter */
- if(show_emitter == 0)
+ if (show_emitter == 0)
allow_render= 0;
}
/* one render object for the data itself */
- if(allow_render) {
+ if (allow_render) {
obr= RE_addRenderObject(re, ob, par, index, 0, ob->lay);
- if((dob && !dob->animated) || (ob->transflag & OB_RENDER_DUPLI)) {
+ if ((dob && !dob->animated) || (ob->transflag & OB_RENDER_DUPLI)) {
obr->flag |= R_INSTANCEABLE;
copy_m4_m4(obr->obmat, ob->obmat);
}
init_render_object_data(re, obr, timeoffset);
/* only add instance for objects that have not been used for dupli */
- if(!(ob->transflag & OB_RENDER_DUPLI)) {
+ if (!(ob->transflag & OB_RENDER_DUPLI)) {
obi= RE_addRenderInstance(re, obr, ob, par, index, 0, NULL, ob->lay);
- if(dob) set_dupli_tex_mat(re, obi, dob);
+ if (dob) set_dupli_tex_mat(re, obi, dob);
}
else
find_dupli_instances(re, obr);
@@ -4583,24 +4587,24 @@ static void add_render_object(Render *re, Object *ob, Object *par, DupliObject *
}
/* and one render object per particle system */
- if(ob->particlesystem.first) {
+ if (ob->particlesystem.first) {
psysindex= 1;
- for(psys=ob->particlesystem.first; psys; psys=psys->next, psysindex++) {
+ for (psys=ob->particlesystem.first; psys; psys=psys->next, psysindex++) {
obr= RE_addRenderObject(re, ob, par, index, psysindex, ob->lay);
- if((dob && !dob->animated) || (ob->transflag & OB_RENDER_DUPLI)) {
+ if ((dob && !dob->animated) || (ob->transflag & OB_RENDER_DUPLI)) {
obr->flag |= R_INSTANCEABLE;
copy_m4_m4(obr->obmat, ob->obmat);
}
- if(dob)
+ if (dob)
psys->flag |= PSYS_USE_IMAT;
init_render_object_data(re, obr, timeoffset);
psys_render_restore(ob, psys);
psys->flag &= ~PSYS_USE_IMAT;
/* only add instance for objects that have not been used for dupli */
- if(!(ob->transflag & OB_RENDER_DUPLI)) {
+ if (!(ob->transflag & OB_RENDER_DUPLI)) {
obi= RE_addRenderInstance(re, obr, ob, par, index, psysindex, NULL, ob->lay);
- if(dob) set_dupli_tex_mat(re, obi, dob);
+ if (dob) set_dupli_tex_mat(re, obi, dob);
}
else
find_dupli_instances(re, obr);
@@ -4616,9 +4620,9 @@ static void init_render_object(Render *re, Object *ob, Object *par, DupliObject
double time;
float mat[4][4];
- if(ob->type==OB_LAMP)
+ if (ob->type==OB_LAMP)
add_render_lamp(re, ob);
- else if(render_object_type(ob->type))
+ else if (render_object_type(ob->type))
add_render_object(re, ob, par, dob, timeoffset);
else {
mult_m4_m4m4(mat, re->viewmat, ob->obmat);
@@ -4626,7 +4630,7 @@ static void init_render_object(Render *re, Object *ob, Object *par, DupliObject
}
time= PIL_check_seconds_timer();
- if(time - lasttime > 1.0) {
+ if (time - lasttime > 1.0) {
lasttime= time;
/* clumsy copying still */
re->i.totvert= re->totvert;
@@ -4645,8 +4649,8 @@ void RE_Database_Free(Render *re)
LampRen *lar;
/* statistics for debugging render memory usage */
- if((G.f & G_DEBUG) && (G.rendering)) {
- if((re->r.scemode & R_PREVIEWBUTS)==0) {
+ if ((G.debug & G_DEBUG) && (G.rendering)) {
+ if ((re->r.scemode & R_PREVIEWBUTS)==0) {
BKE_image_print_memlist();
MEM_printmemlist_stats();
}
@@ -4654,11 +4658,11 @@ void RE_Database_Free(Render *re)
/* FREE */
- for(lar= re->lampren.first; lar; lar= lar->next) {
+ for (lar= re->lampren.first; lar; lar= lar->next) {
freeshadowbuf(lar);
- if(lar->jitter) MEM_freeN(lar->jitter);
- if(lar->shadsamp) MEM_freeN(lar->shadsamp);
- if(lar->sunsky) MEM_freeN(lar->sunsky);
+ if (lar->jitter) MEM_freeN(lar->jitter);
+ if (lar->shadsamp) MEM_freeN(lar->shadsamp);
+ if (lar->sunsky) MEM_freeN(lar->sunsky);
curvemapping_free(lar->curfalloff);
}
@@ -4681,20 +4685,20 @@ void RE_Database_Free(Render *re)
free_camera_inside_volumes(re);
- if(re->wrld.aosphere) {
+ if (re->wrld.aosphere) {
MEM_freeN(re->wrld.aosphere);
re->wrld.aosphere= NULL;
re->scene->world->aosphere= NULL;
}
- if(re->wrld.aotables) {
+ if (re->wrld.aotables) {
MEM_freeN(re->wrld.aotables);
re->wrld.aotables= NULL;
re->scene->world->aotables= NULL;
}
- if(re->r.mode & R_RAYTRACE)
+ if (re->r.mode & R_RAYTRACE)
free_render_qmcsampler(re);
- if(re->r.mode & R_RAYTRACE) freeraytree(re);
+ if (re->r.mode & R_RAYTRACE) freeraytree(re);
free_sss(re);
free_occ(re);
@@ -4705,12 +4709,12 @@ void RE_Database_Free(Render *re)
re->bakebuf= NULL;
- if(re->scene)
- if(re->scene->r.scemode & R_FREE_IMAGE)
- if((re->r.scemode & R_PREVIEWBUTS)==0)
+ if (re->scene)
+ if (re->scene->r.scemode & R_FREE_IMAGE)
+ if ((re->r.scemode & R_PREVIEWBUTS)==0)
BKE_image_free_all_textures();
- if(re->memArena) {
+ if (re->memArena) {
BLI_memarena_free(re->memArena);
re->memArena = NULL;
}
@@ -4719,19 +4723,19 @@ void RE_Database_Free(Render *re)
static int allow_render_object(Render *re, Object *ob, int nolamps, int onlyselected, Object *actob)
{
/* override not showing object when duplis are used with particles */
- if(ob->transflag & OB_DUPLIPARTS)
+ if (ob->transflag & OB_DUPLIPARTS)
; /* let particle system(s) handle showing vs. not showing */
- else if((ob->transflag & OB_DUPLI) && !(ob->transflag & OB_DUPLIFRAMES))
+ else if ((ob->transflag & OB_DUPLI) && !(ob->transflag & OB_DUPLIFRAMES))
return 0;
/* don't add non-basic meta objects, ends up having renderobjects with no geometry */
if (ob->type == OB_MBALL && ob!=find_basis_mball(re->scene, ob))
return 0;
- if(nolamps && (ob->type==OB_LAMP))
+ if (nolamps && (ob->type==OB_LAMP))
return 0;
- if(onlyselected && (ob!=actob && !(ob->flag & SELECT)))
+ if (onlyselected && (ob!=actob && !(ob->flag & SELECT)))
return 0;
return 1;
@@ -4747,16 +4751,16 @@ static int allow_render_dupli_instance(Render *UNUSED(re), DupliObject *dob, Obj
* all halo's to sort them globally in advance */
totmaterial= give_totcolp(obd);
- if(totmaterial) {
- for(a= 0; a<*totmaterial; a++) {
+ if (totmaterial) {
+ for (a= 0; a<*totmaterial; a++) {
ma= give_current_material(obd, a);
- if(ma && (ma->material_type == MA_TYPE_HALO))
+ if (ma && (ma->material_type == MA_TYPE_HALO))
return 0;
}
}
- for(psys=obd->particlesystem.first; psys; psys=psys->next)
- if(!ELEM5(psys->part->ren_as, PART_DRAW_BB, PART_DRAW_LINE, PART_DRAW_PATH, PART_DRAW_OB, PART_DRAW_GR))
+ for (psys=obd->particlesystem.first; psys; psys=psys->next)
+ if (!ELEM5(psys->part->ren_as, PART_DRAW_BB, PART_DRAW_LINE, PART_DRAW_PATH, PART_DRAW_OB, PART_DRAW_GR))
return 0;
/* don't allow lamp, animated duplis, or radio render */
@@ -4773,35 +4777,35 @@ static void dupli_render_particle_set(Render *re, Object *ob, int timeoffset, in
ParticleSystem *psys;
DerivedMesh *dm;
- 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, re->viewmat, re->winmat, re->winx, re->winy, timeoffset);
else
psys_render_restore(ob, psys);
}
}
- if(enable) {
+ if (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 */
dm = mesh_create_derived_render(re->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;
+ 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(re, go->ob, timeoffset, level+1, enable);
}
@@ -4810,8 +4814,8 @@ static int get_vector_renderlayers(Scene *sce)
SceneRenderLayer *srl;
unsigned int lay= 0;
- for(srl= sce->r.layers.first; srl; srl= srl->next)
- if(srl->passflag & SCE_PASS_VECTOR)
+ for (srl= sce->r.layers.first; srl; srl= srl->next)
+ if (srl->passflag & SCE_PASS_VECTOR)
lay |= srl->lay;
return lay;
@@ -4823,20 +4827,20 @@ static void add_group_render_dupli_obs(Render *re, Group *group, int nolamps, in
Object *ob;
/* simple preventing of too deep nested groups */
- if(level>MAX_DUPLI_RECUR) return;
+ if (level>MAX_DUPLI_RECUR) return;
/* recursively go into dupligroups to find objects with OB_RENDER_DUPLI
* that were not created yet */
- for(go= group->gobject.first; go; go= go->next) {
+ for (go= group->gobject.first; go; go= go->next) {
ob= go->ob;
- if(ob->flag & OB_DONE) {
- if(ob->transflag & OB_RENDER_DUPLI) {
- if(allow_render_object(re, ob, nolamps, onlyselected, actob)) {
+ if (ob->flag & OB_DONE) {
+ if (ob->transflag & OB_RENDER_DUPLI) {
+ if (allow_render_object(re, ob, nolamps, onlyselected, actob)) {
init_render_object(re, ob, NULL, 0, timeoffset);
ob->transflag &= ~OB_RENDER_DUPLI;
- if(ob->dup_group)
+ if (ob->dup_group)
add_group_render_dupli_obs(re, ob->dup_group, nolamps, onlyselected, actob, timeoffset, level+1);
}
}
@@ -4860,12 +4864,12 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
set_dupli_tex_mat(NULL, NULL, NULL);
/* loop over all objects rather then using SETLOOPER because we may
- * reference an mtex-mapped object which isnt rendered or is an
+ * reference an mtex-mapped object which isn't rendered or is an
* empty in a dupli group. We could scan all render material/lamp/world
* mtex's for mapto objects but its easier just to set the
* 'imat' / 'imat_ren' on all and unlikely to be a performance hit
* See bug: [#28744] - campbell */
- for(ob= re->main->object.first; ob; ob= ob->id.next) {
+ for (ob= re->main->object.first; ob; ob= ob->id.next) {
/* imat objects has to be done here, since displace can have texture using Object map-input */
mult_m4_m4m4(mat, re->viewmat, ob->obmat);
invert_m4_m4(ob->imat_ren, mat);
@@ -4875,7 +4879,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
ob->transflag &= ~OB_RENDER_DUPLI;
}
- for(SETLOOPER(re->scene, sce_iter, base)) {
+ for (SETLOOPER(re->scene, sce_iter, base)) {
ob= base->object;
/* in the prev/next pass for making speed vectors, avoid creating
@@ -4885,21 +4889,21 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
lay= (timeoffset)? renderlay & vectorlay: renderlay;
/* if the object has been restricted from rendering in the outliner, ignore it */
- if(ob->restrictflag & OB_RESTRICT_RENDER) continue;
+ if (ob->restrictflag & OB_RESTRICT_RENDER) continue;
/* OB_DONE means the object itself got duplicated, so was already converted */
- if(ob->flag & OB_DONE) {
+ if (ob->flag & OB_DONE) {
/* OB_RENDER_DUPLI means instances for it were already created, now
* it still needs to create the ObjectRen containing the data */
- if(ob->transflag & OB_RENDER_DUPLI) {
- if(allow_render_object(re, ob, nolamps, onlyselected, actob)) {
+ if (ob->transflag & OB_RENDER_DUPLI) {
+ if (allow_render_object(re, ob, nolamps, onlyselected, actob)) {
init_render_object(re, ob, NULL, 0, timeoffset);
ob->transflag &= ~OB_RENDER_DUPLI;
}
}
}
- else if((base->lay & lay) || (ob->type==OB_LAMP && (base->lay & re->lay)) ) {
- if((ob->transflag & OB_DUPLI) && (ob->type!=OB_MBALL)) {
+ else if ((base->lay & lay) || (ob->type==OB_LAMP && (base->lay & re->lay)) ) {
+ if ((ob->transflag & OB_DUPLI) && (ob->type!=OB_MBALL)) {
DupliObject *dob;
ListBase *lb;
@@ -4909,25 +4913,25 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
lb= object_duplilist(re->scene, ob);
dupli_render_particle_set(re, ob, timeoffset, 0, 0);
- for(dob= lb->first; dob; dob= dob->next) {
+ for (dob= lb->first; dob; dob= dob->next) {
Object *obd= dob->ob;
copy_m4_m4(obd->obmat, dob->mat);
/* group duplis need to set ob matrices correct, for deform. so no_draw is part handled */
- if(!(obd->transflag & OB_RENDER_DUPLI) && dob->no_draw)
+ if (!(obd->transflag & OB_RENDER_DUPLI) && dob->no_draw)
continue;
- if(obd->restrictflag & OB_RESTRICT_RENDER)
+ if (obd->restrictflag & OB_RESTRICT_RENDER)
continue;
- if(obd->type==OB_MBALL)
+ if (obd->type==OB_MBALL)
continue;
- if(!allow_render_object(re, obd, nolamps, onlyselected, actob))
+ if (!allow_render_object(re, obd, nolamps, onlyselected, actob))
continue;
- if(allow_render_dupli_instance(re, dob, obd)) {
+ if (allow_render_dupli_instance(re, dob, obd)) {
ParticleSystem *psys;
ObjectRen *obr = NULL;
int psysindex;
@@ -4938,13 +4942,13 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
/* instances instead of the actual object are added in two cases, either
* this is a duplivert/face/particle, or it is a non-animated object in
* a dupligroup that has already been created before */
- if(dob->type != OB_DUPLIGROUP || (obr=find_dupligroup_dupli(re, obd, 0))) {
+ if (dob->type != OB_DUPLIGROUP || (obr=find_dupligroup_dupli(re, obd, 0))) {
mult_m4_m4m4(mat, re->viewmat, dob->mat);
obi= RE_addRenderInstance(re, NULL, obd, ob, dob->index, 0, mat, obd->lay);
/* fill in instance variables for texturing */
set_dupli_tex_mat(re, obi, dob);
- if(dob->type != OB_DUPLIGROUP) {
+ if (dob->type != OB_DUPLIGROUP) {
copy_v3_v3(obi->dupliorco, dob->orco);
obi->dupliuv[0]= dob->uv[0];
obi->dupliuv[1]= dob->uv[1];
@@ -4955,7 +4959,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
* itself was duplicated. for the first case find_dupli_instances
* will be called later. */
assign_dupligroup_dupli(re, obi, obr);
- if(obd->transflag & OB_RENDER_DUPLI)
+ if (obd->transflag & OB_RENDER_DUPLI)
find_dupli_instances(re, obr);
}
}
@@ -4963,31 +4967,31 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
/* same logic for particles, each particle system has it's own object, so
* need to go over them separately */
psysindex= 1;
- for(psys=obd->particlesystem.first; psys; psys=psys->next) {
- if(dob->type != OB_DUPLIGROUP || (obr=find_dupligroup_dupli(re, obd, psysindex))) {
- if(obi == NULL)
+ for (psys=obd->particlesystem.first; psys; psys=psys->next) {
+ if (dob->type != OB_DUPLIGROUP || (obr=find_dupligroup_dupli(re, obd, psysindex))) {
+ if (obi == NULL)
mult_m4_m4m4(mat, re->viewmat, dob->mat);
obi= RE_addRenderInstance(re, NULL, obd, ob, dob->index, psysindex++, mat, obd->lay);
set_dupli_tex_mat(re, obi, dob);
- if(dob->type != OB_DUPLIGROUP) {
+ if (dob->type != OB_DUPLIGROUP) {
copy_v3_v3(obi->dupliorco, dob->orco);
obi->dupliuv[0]= dob->uv[0];
obi->dupliuv[1]= dob->uv[1];
}
else {
assign_dupligroup_dupli(re, obi, obr);
- if(obd->transflag & OB_RENDER_DUPLI)
+ if (obd->transflag & OB_RENDER_DUPLI)
find_dupli_instances(re, obr);
}
}
}
- if(obi==NULL)
+ if (obi==NULL)
/* can't instance, just create the object */
init_render_object(re, obd, ob, dob, timeoffset);
- if(dob->type != OB_DUPLIGROUP) {
+ if (dob->type != OB_DUPLIGROUP) {
obd->flag |= OB_DONE;
obd->transflag |= OB_RENDER_DUPLI;
}
@@ -4995,26 +4999,26 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
else
init_render_object(re, obd, ob, dob, timeoffset);
- if(re->test_break(re->tbh)) break;
+ if (re->test_break(re->tbh)) break;
}
free_object_duplilist(lb);
- if(allow_render_object(re, ob, nolamps, onlyselected, actob))
+ if (allow_render_object(re, ob, nolamps, onlyselected, actob))
init_render_object(re, ob, NULL, 0, timeoffset);
}
- else if(allow_render_object(re, ob, nolamps, onlyselected, actob))
+ else if (allow_render_object(re, ob, nolamps, onlyselected, actob))
init_render_object(re, ob, NULL, 0, timeoffset);
}
- if(re->test_break(re->tbh)) break;
+ if (re->test_break(re->tbh)) break;
}
/* objects in groups with OB_RENDER_DUPLI set still need to be created,
* since they may not be part of the scene */
- for(group= re->main->group.first; group; group=group->id.next)
+ for (group= re->main->group.first; group; group=group->id.next)
add_group_render_dupli_obs(re, group, nolamps, onlyselected, actob, timeoffset, 0);
- if(!re->test_break(re->tbh))
+ if (!re->test_break(re->tbh))
RE_makeRenderInstances(re);
}
@@ -5046,18 +5050,18 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l
re->i.partsdone= 0; /* signal now in use for previewrender */
/* in localview, lamps are using normal layers, objects only local bits */
- if(re->lay & 0xFF000000)
+ if (re->lay & 0xFF000000)
lay &= 0xFF000000;
/* applies changes fully */
- if((re->r.scemode & (R_NO_FRAME_UPDATE|R_PREVIEWBUTS))==0)
+ if ((re->r.scemode & (R_NO_FRAME_UPDATE|R_PREVIEWBUTS))==0)
scene_update_for_newframe(re->main, re->scene, lay);
/* 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
+ if (use_camera_view && camera) {
+ /* 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' */
+ * following calls don't depend on 'RE_SetCamera' */
RE_SetCamera(re, camera);
normalize_m4(camera->obmat);
@@ -5067,10 +5071,10 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l
}
init_render_world(re); /* do first, because of ambient. also requires re->osa set correct */
- if(re->r.mode & R_RAYTRACE) {
+ if (re->r.mode & R_RAYTRACE) {
init_render_qmcsampler(re);
- if(re->wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT))
+ if (re->wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT))
if (re->wrld.ao_samp_method == WO_AOSAMP_CONSTANT)
init_ao_sphere(&re->wrld);
}
@@ -5084,11 +5088,11 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l
/* MAKE RENDER DATA */
database_init_objects(re, lay, 0, 0, 0, 0);
- if(!re->test_break(re->tbh)) {
+ if (!re->test_break(re->tbh)) {
int tothalo;
set_material_lightgroups(re);
- for(sce= re->scene; sce; sce= sce->set)
+ for (sce= re->scene; sce; sce= sce->set)
set_renderlayer_lightgroups(re, sce);
slurph_opt= 1;
@@ -5103,8 +5107,8 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l
/* don't sort stars */
tothalo= re->tothalo;
- if(!re->test_break(re->tbh)) {
- if(re->wrld.mode & WO_STARS) {
+ if (!re->test_break(re->tbh)) {
+ if (re->wrld.mode & WO_STARS) {
re->i.infostr= "Creating Starfield";
re->stats_draw(re->sdh, &re->i);
RE_make_stars(re, NULL, NULL, NULL, NULL);
@@ -5123,43 +5127,43 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l
/* old code checked for internal render (aka not yafray) */
{
/* raytree */
- if(!re->test_break(re->tbh)) {
- if(re->r.mode & R_RAYTRACE) {
+ if (!re->test_break(re->tbh)) {
+ if (re->r.mode & R_RAYTRACE) {
makeraytree(re);
}
}
/* ENVIRONMENT MAPS */
- if(!re->test_break(re->tbh))
+ if (!re->test_break(re->tbh))
make_envmaps(re);
/* point density texture */
- if(!re->test_break(re->tbh))
+ if (!re->test_break(re->tbh))
make_pointdensities(re);
/* voxel data texture */
- if(!re->test_break(re->tbh))
+ if (!re->test_break(re->tbh))
make_voxeldata(re);
}
- if(!re->test_break(re->tbh))
+ if (!re->test_break(re->tbh))
project_renderdata(re, projectverto, re->r.mode & R_PANORAMA, 0, 1);
/* Occlusion */
- if((re->wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) && !re->test_break(re->tbh))
- if(re->wrld.ao_gather_method == WO_AOGATHER_APPROX)
- if(re->r.mode & R_SHADOW)
+ if ((re->wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) && !re->test_break(re->tbh))
+ if (re->wrld.ao_gather_method == WO_AOGATHER_APPROX)
+ if (re->r.mode & R_SHADOW)
make_occ_tree(re);
/* SSS */
- if((re->r.mode & R_SSS) && !re->test_break(re->tbh))
+ if ((re->r.mode & R_SSS) && !re->test_break(re->tbh))
make_sss_tree(re);
- if(!re->test_break(re->tbh))
- if(re->r.mode & R_RAYTRACE)
+ if (!re->test_break(re->tbh))
+ if (re->r.mode & R_RAYTRACE)
volume_precache(re);
}
- if(re->test_break(re->tbh))
+ if (re->test_break(re->tbh))
RE_Database_Free(re);
else
re->i.convertdone= 1;
@@ -5201,7 +5205,7 @@ static void database_fromscene_vectors(Render *re, Scene *scene, unsigned int la
slurph_opt= 0;
/* in localview, lamps are using normal layers, objects only local bits */
- if(re->lay & 0xFF000000)
+ if (re->lay & 0xFF000000)
lay &= 0xFF000000;
/* applies changes fully */
@@ -5209,7 +5213,7 @@ static void database_fromscene_vectors(Render *re, Scene *scene, unsigned int la
scene_update_for_newframe(re->main, re->scene, lay);
/* if no camera, viewmat should have been set! */
- if(camera) {
+ if (camera) {
normalize_m4(camera->obmat);
invert_m4_m4(mat, camera->obmat);
RE_SetView(re, mat);
@@ -5218,7 +5222,7 @@ static void database_fromscene_vectors(Render *re, Scene *scene, unsigned int la
/* MAKE RENDER DATA */
database_init_objects(re, lay, 0, 0, 0, timeoffset);
- if(!re->test_break(re->tbh))
+ if (!re->test_break(re->tbh))
project_renderdata(re, projectverto, re->r.mode & R_PANORAMA, 0, 1);
/* do this in end, particles for example need cfra */
@@ -5233,11 +5237,11 @@ static void speedvector_project(Render *re, float zco[2], const float co[3], con
float div;
/* initialize */
- if(re) {
+ if (re) {
pano= re->r.mode & R_PANORAMA;
/* precalculate amount of radians 1 pixel rotates */
- if(pano) {
+ if (pano) {
/* size of 1 pixel mapped to viewplane coords */
float psize= (re->viewplane.xmax-re->viewplane.xmin)/(float)re->winx;
/* x angle of a pixel */
@@ -5254,17 +5258,17 @@ static void speedvector_project(Render *re, float zco[2], const float co[3], con
}
/* now map hocos to screenspace, uses very primitive clip still */
- if(ho[3]<0.1f) div= 10.0f;
+ if (ho[3]<0.1f) div= 10.0f;
else div= 1.0f/ho[3];
/* use cylinder projection */
- if(pano) {
+ if (pano) {
float vec[3], ang;
/* angle between (0,0,-1) and (co) */
copy_v3_v3(vec, co);
ang= saacos(-vec[2]/sqrtf(vec[0]*vec[0] + vec[2]*vec[2]));
- if(vec[0]<0.0f) ang= -ang;
+ if (vec[0]<0.0f) ang= -ang;
zco[0]= ang/pixelphix + zmulx;
ang= 0.5f*(float)M_PI - saacos(vec[1] / len_v3(vec));
@@ -5287,21 +5291,21 @@ static void calculate_speedvector(const float vectors[2], int step, float winsq,
zco[1]= vectors[1] - zco[1];
/* enable nice masks for hardly moving stuff or float inaccuracy */
- if(zco[0]<0.1f && zco[0]>-0.1f && zco[1]<0.1f && zco[1]>-0.1f ) {
+ if (zco[0]<0.1f && zco[0]>-0.1f && zco[1]<0.1f && zco[1]>-0.1f ) {
zco[0]= 0.0f;
zco[1]= 0.0f;
}
/* maximize speed for image width, otherwise it never looks good */
len= zco[0]*zco[0] + zco[1]*zco[1];
- if(len > winsq) {
+ if (len > winsq) {
len= winroot/sqrtf(len);
zco[0]*= len;
zco[1]*= len;
}
/* note; in main vecblur loop speedvec is negated again */
- if(step) {
+ if (step) {
speed[2]= -zco[0];
speed[3]= -zco[1];
}
@@ -5313,21 +5317,21 @@ static void calculate_speedvector(const float vectors[2], int step, float winsq,
static float *calculate_strandsurface_speedvectors(Render *re, ObjectInstanceRen *obi, StrandSurface *mesh)
{
- if(mesh->co && mesh->prevco && mesh->nextco) {
+ if (mesh->co && mesh->prevco && mesh->nextco) {
float winsq= (float)re->winx*(float)re->winy; /* int's can wrap on large images */
float winroot= sqrt(winsq);
float (*winspeed)[4];
float ho[4], prevho[4], nextho[4], winmat[4][4], vec[2];
int a;
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mult_m4_m4m4(winmat, re->winmat, obi->mat);
else
copy_m4_m4(winmat, re->winmat);
winspeed= MEM_callocN(sizeof(float)*4*mesh->totvert, "StrandSurfWin");
- for(a=0; a<mesh->totvert; a++) {
+ for (a=0; a<mesh->totvert; a++) {
projectvert(mesh->co[a], winmat, ho);
projectvert(mesh->prevco[a], winmat, prevho);
@@ -5357,14 +5361,14 @@ static void calculate_speedvectors(Render *re, ObjectInstanceRen *obi, float *ve
float winsq= (float)re->winx*(float)re->winy, winroot= sqrt(winsq); /* int's can wrap on large images */
int a, *face, *index;
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mult_m4_m4m4(winmat, re->winmat, obi->mat);
else
copy_m4_m4(winmat, re->winmat);
- if(obr->vertnodes) {
- for(a=0; a<obr->totvert; a++, vectors+=2) {
- if((a & 255)==0) ver= obr->vertnodes[a>>8].vert;
+ if (obr->vertnodes) {
+ for (a=0; a<obr->totvert; a++, vectors+=2) {
+ if ((a & 255)==0) ver= obr->vertnodes[a>>8].vert;
else ver++;
speed= RE_vertren_get_winspeed(obi, ver, 1);
@@ -5373,21 +5377,21 @@ static void calculate_speedvectors(Render *re, ObjectInstanceRen *obi, float *ve
}
}
- if(obr->strandnodes) {
+ if (obr->strandnodes) {
strandbuf= obr->strandbuf;
mesh= (strandbuf)? strandbuf->surface: NULL;
/* compute speed vectors at surface vertices */
- if(mesh)
+ if (mesh)
winspeed= (float(*)[4])calculate_strandsurface_speedvectors(re, obi, mesh);
- if(winspeed) {
- for(a=0; a<obr->totstrand; a++, vectors+=2) {
- if((a & 255)==0) strand= obr->strandnodes[a>>8].strand;
+ if (winspeed) {
+ for (a=0; a<obr->totstrand; a++, vectors+=2) {
+ if ((a & 255)==0) strand= obr->strandnodes[a>>8].strand;
else strand++;
index= RE_strandren_get_face(obr, strand, 0);
- if(index && *index < mesh->totface) {
+ if (index && *index < mesh->totface) {
speed= RE_strandren_get_winspeed(obi, strand, 1);
/* interpolate speed vectors from strand surface */
@@ -5404,7 +5408,7 @@ static void calculate_speedvectors(Render *re, ObjectInstanceRen *obi, float *ve
madd_v4_v4fl(speed, winspeed[face[0]], w[0]);
madd_v4_v4fl(speed, winspeed[face[1]], w[1]);
madd_v4_v4fl(speed, winspeed[face[2]], w[2]);
- if(face[3])
+ if (face[3])
madd_v4_v4fl(speed, winspeed[face[3]], w[3]);
}
}
@@ -5431,9 +5435,9 @@ static int load_fluidsimspeedvectors(Render *re, ObjectInstanceRen *obi, float *
FluidVertexVelocity *velarray = NULL;
/* only one step needed */
- if(step) return 1;
+ if (step) return 1;
- if(fluidmd)
+ if (fluidmd)
fss = fluidmd->fss;
else
return 0;
@@ -5442,16 +5446,16 @@ static int load_fluidsimspeedvectors(Render *re, ObjectInstanceRen *obi, float *
invert_m4_m4(imat, mat);
/* set first vertex OK */
- if(!fss->meshVelocities) return 0;
+ if (!fss->meshVelocities) return 0;
- if( obr->totvert != fss->totvert) {
+ if ( obr->totvert != fss->totvert) {
//fprintf(stderr, "load_fluidsimspeedvectors - modified fluidsim mesh, not using speed vectors (%d,%d)...\n", obr->totvert, fsob->fluidsimSettings->meshSurface->totvert); // DEBUG
return 0;
}
velarray = fss->meshVelocities;
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mult_m4_m4m4(winmat, re->winmat, obi->mat);
else
copy_m4_m4(winmat, re->winmat);
@@ -5460,15 +5464,15 @@ static int load_fluidsimspeedvectors(Render *re, ObjectInstanceRen *obi, float *
/* better solution would be fixing getVelocityAt() in intern/elbeem/intern/solver_util.cpp
so that also small drops/little water volumes return a velocity != 0.
But I had no luck in fixing that function - DG */
- for(a=0; a<obr->totvert; a++) {
- for(j=0;j<3;j++) avgvel[j] += velarray[a].vel[j];
+ for (a=0; a<obr->totvert; a++) {
+ for (j=0;j<3;j++) avgvel[j] += velarray[a].vel[j];
}
- for(j=0;j<3;j++) avgvel[j] /= (float)(obr->totvert);
+ for (j=0;j<3;j++) avgvel[j] /= (float)(obr->totvert);
- for(a=0; a<obr->totvert; a++, vectors+=2) {
- if((a & 255)==0)
+ for (a=0; a<obr->totvert; a++, vectors+=2) {
+ if ((a & 255)==0)
ver= obr->vertnodes[a>>8].vert;
else
ver++;
@@ -5476,11 +5480,10 @@ static int load_fluidsimspeedvectors(Render *re, ObjectInstanceRen *obi, float *
// get fluid velocity
fsvec[3] = 0.;
//fsvec[0] = fsvec[1] = fsvec[2] = fsvec[3] = 0.; fsvec[2] = 2.; // NT fixed test
- for(j=0;j<3;j++) fsvec[j] = velarray[a].vel[j];
+ 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];
@@ -5497,14 +5500,14 @@ static int load_fluidsimspeedvectors(Render *re, ObjectInstanceRen *obi, float *
/* now map hocos to screenspace, uses very primitive clip still */
// use ho[3] of original vertex, xy component of vel. direction
- if(ho[3]<0.1f) div= 10.0f;
+ if (ho[3]<0.1f) div= 10.0f;
else div= 1.0f/ho[3];
zco[0]= zmulx*hoco[0]*div;
zco[1]= zmuly*hoco[1]*div;
// maximize speed as usual
len= zco[0]*zco[0] + zco[1]*zco[1];
- if(len > winsq) {
+ if (len > winsq) {
len= winroot/sqrtf(len);
zco[0]*= len; zco[1]*= len;
}
@@ -5513,7 +5516,7 @@ static int load_fluidsimspeedvectors(Render *re, ObjectInstanceRen *obi, float *
// set both to the same value
speed[0]= speed[2]= zco[0];
speed[1]= speed[3]= zco[1];
- //if(a<20) fprintf(stderr,"speed %d %f,%f | camco %f,%f,%f | hoco %f,%f,%f,%f \n", a, speed[0], speed[1], camco[0],camco[1], camco[2], hoco[0],hoco[1], hoco[2],hoco[3]); // NT DEBUG
+ //if(a<20) fprintf(stderr,"speed %d %f,%f | camco %f,%f,%f | hoco %f,%f,%f,%f\n", a, speed[0], speed[1], camco[0],camco[1], camco[2], hoco[0],hoco[1], hoco[2],hoco[3]); // NT DEBUG
}
return 1;
@@ -5529,7 +5532,7 @@ static void copy_dbase_object_vectors(Render *re, ListBase *lb)
float *vec, ho[4], winmat[4][4];
int a, totvector;
- for(obi= re->instancetable.first; obi; obi= obi->next) {
+ for (obi= re->instancetable.first; obi; obi= obi->next) {
obr= obi->obr;
obilb= MEM_mallocN(sizeof(ObjectInstanceRen), "ObInstanceVector");
@@ -5538,16 +5541,16 @@ static void copy_dbase_object_vectors(Render *re, ListBase *lb)
obilb->totvector= totvector= obr->totvert;
- if(totvector > 0) {
+ if (totvector > 0) {
vec= obilb->vectors= MEM_mallocN(2*sizeof(float)*totvector, "vector array");
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mult_m4_m4m4(winmat, re->winmat, obi->mat);
else
copy_m4_m4(winmat, re->winmat);
- for(a=0; a<obr->totvert; a++, vec+=2) {
- if((a & 255)==0) ver= obr->vertnodes[a>>8].vert;
+ for (a=0; a<obr->totvert; a++, vec+=2) {
+ if ((a & 255)==0) ver= obr->vertnodes[a>>8].vert;
else ver++;
projectvert(ver->co, winmat, ho);
@@ -5561,8 +5564,8 @@ static void free_dbase_object_vectors(ListBase *lb)
{
ObjectInstanceRen *obi;
- for(obi= lb->first; obi; obi= obi->next)
- if(obi->vectors)
+ for (obi= lb->first; obi; obi= obi->next)
+ if (obi->vectors)
MEM_freeN(obi->vectors);
BLI_freelistN(lb);
}
@@ -5593,7 +5596,7 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned
RE_Database_Free(re);
re->strandsurface= strandsurface;
- if(!re->test_break(re->tbh)) {
+ if (!re->test_break(re->tbh)) {
/* creates entire dbase */
re->i.infostr= "Calculating next frame vectors";
@@ -5608,55 +5611,55 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned
RE_Database_Free(re);
re->strandsurface= strandsurface;
- if(!re->test_break(re->tbh))
+ if (!re->test_break(re->tbh))
RE_Database_FromScene(re, bmain, sce, lay, 1);
- if(!re->test_break(re->tbh)) {
+ if (!re->test_break(re->tbh)) {
int vectorlay= get_vector_renderlayers(re->scene);
- for(step= 0; step<2; step++) {
+ for (step= 0; step<2; step++) {
- if(step)
+ if (step)
table= &newtable;
else
table= &oldtable;
oldobi= table->first;
- for(obi= re->instancetable.first; obi && oldobi; obi= obi->next) {
+ for (obi= re->instancetable.first; obi && oldobi; obi= obi->next) {
int ok= 1;
FluidsimModifierData *fluidmd;
- if(!(obi->lay & vectorlay))
+ if (!(obi->lay & vectorlay))
continue;
obi->totvector= obi->obr->totvert;
/* find matching object in old table */
- if(oldobi->ob!=obi->ob || oldobi->par!=obi->par || oldobi->index!=obi->index || oldobi->psysindex!=obi->psysindex) {
+ if (oldobi->ob!=obi->ob || oldobi->par!=obi->par || oldobi->index!=obi->index || oldobi->psysindex!=obi->psysindex) {
ok= 0;
- for(oldobi= table->first; oldobi; oldobi= oldobi->next)
- if(oldobi->ob==obi->ob && oldobi->par==obi->par && oldobi->index==obi->index && oldobi->psysindex==obi->psysindex)
+ for (oldobi= table->first; oldobi; oldobi= oldobi->next)
+ if (oldobi->ob==obi->ob && oldobi->par==obi->par && oldobi->index==obi->index && oldobi->psysindex==obi->psysindex)
break;
- if(oldobi==NULL)
+ if (oldobi==NULL)
oldobi= table->first;
else
ok= 1;
}
- if(ok==0) {
+ if (ok==0) {
printf("speed table: missing object %s\n", obi->ob->id.name+2);
continue;
}
// NT check for fluidsim special treatment
fluidmd = (FluidsimModifierData *)modifiers_findByType(obi->ob, eModifierType_Fluidsim);
- if(fluidmd && fluidmd->fss && (fluidmd->fss->type & OB_FLUIDSIM_DOMAIN)) {
+ if (fluidmd && fluidmd->fss && (fluidmd->fss->type & OB_FLUIDSIM_DOMAIN)) {
// use preloaded per vertex simulation data , only does calculation for step=1
// NOTE/FIXME - velocities and meshes loaded unnecessarily often during the database_fromscene_vectors calls...
load_fluidsimspeedvectors(re, obi, oldobi->vectors, step);
}
else {
/* check if both have same amounts of vertices */
- if(obi->totvector==oldobi->totvector)
+ if (obi->totvector==oldobi->totvector)
calculate_speedvectors(re, obi, oldobi->vectors, step);
else
printf("Warning: object %s has different amount of vertices or strands on other frame\n", obi->ob->id.name+2);
@@ -5670,12 +5673,12 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned
free_dbase_object_vectors(&oldtable);
free_dbase_object_vectors(&newtable);
- for(mesh=re->strandsurface.first; mesh; mesh=mesh->next) {
- if(mesh->prevco) {
+ for (mesh=re->strandsurface.first; mesh; mesh=mesh->next) {
+ if (mesh->prevco) {
MEM_freeN(mesh->prevco);
mesh->prevco= NULL;
}
- if(mesh->nextco) {
+ if (mesh->nextco) {
MEM_freeN(mesh->nextco);
mesh->nextco= NULL;
}
@@ -5719,18 +5722,18 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay,
re->flag |= R_BAKING;
re->excludeob= actob;
- if(actob)
+ if (actob)
re->flag |= R_BAKE_TRACE;
- if(type==RE_BAKE_NORMALS && re->r.bake_normal_space==R_BAKE_SPACE_TANGENT)
+ if (type==RE_BAKE_NORMALS && re->r.bake_normal_space==R_BAKE_SPACE_TANGENT)
re->flag |= R_NEED_TANGENT;
- if(!actob && ELEM4(type, RE_BAKE_LIGHT, RE_BAKE_NORMALS, RE_BAKE_TEXTURE, RE_BAKE_DISPLACEMENT)) {
+ if (!actob && ELEM4(type, RE_BAKE_LIGHT, RE_BAKE_NORMALS, RE_BAKE_TEXTURE, RE_BAKE_DISPLACEMENT)) {
re->r.mode &= ~R_SHADOW;
re->r.mode &= ~R_RAYTRACE;
}
- if(!actob && (type==RE_BAKE_SHADOW)) {
+ if (!actob && (type==RE_BAKE_SHADOW)) {
re->r.mode |= R_SHADOW;
}
@@ -5742,13 +5745,13 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay,
re->lampren.first= re->lampren.last= NULL;
/* in localview, lamps are using normal layers, objects only local bits */
- if(re->lay & 0xFF000000)
+ if (re->lay & 0xFF000000)
lay &= 0xFF000000;
camera= RE_GetCamera(re);
/* if no camera, set unit */
- if(camera) {
+ if (camera) {
normalize_m4(camera->obmat);
invert_m4_m4(mat, camera->obmat);
RE_SetView(re, mat);
@@ -5767,10 +5770,10 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay,
/* done setting dummy values */
init_render_world(re); /* do first, because of ambient. also requires re->osa set correct */
- if(re->r.mode & R_RAYTRACE) {
+ if (re->r.mode & R_RAYTRACE) {
init_render_qmcsampler(re);
- if(re->wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT))
+ if (re->wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT))
if (re->wrld.ao_samp_method == WO_AOSAMP_CONSTANT)
init_ao_sphere(&re->wrld);
}
@@ -5789,27 +5792,27 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay,
set_material_lightgroups(re);
/* SHADOW BUFFER */
- if(type!=RE_BAKE_LIGHT)
- if(re->r.mode & R_SHADOW)
+ if (type!=RE_BAKE_LIGHT)
+ if (re->r.mode & R_SHADOW)
threaded_makeshadowbufs(re);
/* raytree */
- if(!re->test_break(re->tbh))
- if(re->r.mode & R_RAYTRACE)
+ if (!re->test_break(re->tbh))
+ if (re->r.mode & R_RAYTRACE)
makeraytree(re);
/* point density texture */
- if(!re->test_break(re->tbh))
+ if (!re->test_break(re->tbh))
make_pointdensities(re);
/* voxel data texture */
- if(!re->test_break(re->tbh))
+ if (!re->test_break(re->tbh))
make_voxeldata(re);
/* occlusion */
- if((re->wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) && !re->test_break(re->tbh))
- if(re->wrld.ao_gather_method == WO_AOGATHER_APPROX)
- if(re->r.mode & R_SHADOW)
+ if ((re->wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) && !re->test_break(re->tbh))
+ if (re->wrld.ao_gather_method == WO_AOGATHER_APPROX)
+ if (re->r.mode & R_SHADOW)
make_occ_tree(re);
}
@@ -5829,19 +5832,19 @@ void RE_make_sticky(Scene *scene, View3D *v3d)
int a;
Object *camera= NULL;
- if(v3d==NULL) {
+ if (v3d==NULL) {
printf("Need a 3d view to make sticky\n");
return;
}
- if(v3d) camera= V3D_CAMERA_LOCAL(v3d);
- if(camera == NULL) camera= scene->camera;
+ if (v3d) camera= V3D_CAMERA_LOCAL(v3d);
+ if (camera == NULL) camera= scene->camera;
- if(camera==NULL) {
+ if (camera==NULL) {
printf("Need camera to make sticky\n");
return;
}
- if(scene->obedit) {
+ if (scene->obedit) {
printf("Unable to make sticky in Edit Mode\n");
return;
}
@@ -5857,14 +5860,14 @@ void RE_make_sticky(Scene *scene, View3D *v3d)
invert_m4_m4(mat, camera->obmat);
RE_SetView(re, mat);
- for(base= FIRSTBASE; base; base= base->next) {
- if TESTBASELIB(v3d, base) {
- if(base->object->type==OB_MESH) {
+ for (base= FIRSTBASE; base; base= base->next) {
+ if (TESTBASELIB(v3d, base)) {
+ if (base->object->type==OB_MESH) {
ob= base->object;
me= ob->data;
mvert= me->mvert;
- if(me->msticky)
+ if (me->msticky)
CustomData_free_layer_active(&me->vdata, CD_MSTICKY, me->totvert);
me->msticky= CustomData_add_layer(&me->vdata, CD_MSTICKY,
CD_CALLOC, NULL, me->totvert);
@@ -5873,7 +5876,7 @@ void RE_make_sticky(Scene *scene, View3D *v3d)
mult_m4_m4m4(mat, re->viewmat, ob->obmat);
ms= me->msticky;
- for(a=0; a<me->totvert; a++, ms++, mvert++) {
+ for (a=0; a<me->totvert; a++, ms++, mvert++) {
copy_v3_v3(ho, mvert->co);
mul_m4_v3(mat, ho);
projectverto(ho, re->winmat, ho);
diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c
index a45bb63ff06..fa7b9cb7ea1 100644
--- a/source/blender/render/intern/source/envmap.c
+++ b/source/blender/render/intern/source/envmap.c
@@ -76,7 +76,7 @@ static void envmap_split_ima(EnvMap *env, ImBuf *ibuf)
/* after lock we test cube[1], if set the other thread has done it fine */
BLI_lock_thread(LOCK_IMAGE);
- if(env->cube[1]==NULL) {
+ if (env->cube[1]==NULL) {
BKE_free_envmapdata(env);
@@ -85,18 +85,20 @@ static void envmap_split_ima(EnvMap *env, ImBuf *ibuf)
if (3*dx == ibuf->x) {
env->type = ENV_CUBE;
env->ok= ENV_OSA;
- } else if (ibuf->x == ibuf->y) {
+ }
+ else if (ibuf->x == ibuf->y) {
env->type = ENV_PLANE;
env->ok= ENV_OSA;
- } else {
+ }
+ else {
printf("Incorrect envmap size\n");
env->ok= 0;
env->ima->ok= 0;
}
- if(env->ok) {
+ if (env->ok) {
if (env->type == ENV_CUBE) {
- for(part=0; part<6; part++) {
+ for (part=0; part<6; part++) {
env->cube[part]= IMB_allocImBuf(dx, dx, 24, IB_rect|IB_rectfloat);
}
IMB_float_from_rect(ibuf);
@@ -214,19 +216,24 @@ static void envmap_transmatrix(float mat[][4], int part)
eul[0]= eul[1]= eul[2]= 0.0;
- if(part==0) { /* neg z */
+ if (part==0) { /* neg z */
;
- } else if(part==1) { /* pos z */
+ }
+ else if (part==1) { /* pos z */
eul[0]= M_PI;
- } else if(part==2) { /* pos y */
+ }
+ else if (part==2) { /* pos y */
eul[0]= M_PI/2.0;
- } else if(part==3) { /* neg x */
+ }
+ else if (part==3) { /* neg x */
eul[0]= M_PI/2.0;
eul[2]= M_PI/2.0;
- } else if(part==4) { /* neg y */
+ }
+ else if (part==4) { /* neg y */
eul[0]= M_PI/2.0;
eul[2]= M_PI;
- } else { /* pos x */
+ }
+ else { /* pos x */
eul[0]= M_PI/2.0;
eul[2]= -M_PI/2.0;
}
@@ -250,7 +257,7 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode)
float imat[3][3], pmat[4][4], smat[4][4], tmat[4][4], cmat[3][3], tmpmat[4][4];
int a;
- if(mode==0) {
+ if (mode==0) {
invert_m4_m4(tmat, mat);
copy_m3_m4(imat, tmat);
}
@@ -259,13 +266,13 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode)
copy_m3_m4(imat, mat);
}
- for(obi=re->instancetable.first; obi; obi=obi->next) {
+ for (obi=re->instancetable.first; obi; obi=obi->next) {
/* append or set matrix depending on dupli */
- if(obi->flag & R_DUPLI_TRANSFORMED) {
+ if (obi->flag & R_DUPLI_TRANSFORMED) {
copy_m4_m4(tmpmat, obi->mat);
mult_m4_m4m4(obi->mat, tmat, tmpmat);
}
- else if(mode==1)
+ else if (mode==1)
copy_m4_m4(obi->mat, tmat);
else
unit_m4(obi->mat);
@@ -275,28 +282,28 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode)
transpose_m3(obi->nmat);
/* indicate the renderer has to use transform matrices */
- if(mode==0)
+ if (mode==0)
obi->flag &= ~R_ENV_TRANSFORMED;
else
obi->flag |= R_ENV_TRANSFORMED;
}
- for(obr=re->objecttable.first; obr; obr=obr->next) {
- for(a=0; a<obr->tothalo; a++) {
- if((a & 255)==0) har= obr->bloha[a>>8];
+ for (obr=re->objecttable.first; obr; obr=obr->next) {
+ for (a=0; a<obr->tothalo; a++) {
+ if ((a & 255)==0) har= obr->bloha[a>>8];
else har++;
mul_m4_v3(tmat, har->co);
}
}
- for(go=re->lights.first; go; go= go->next) {
+ for (go=re->lights.first; go; go= go->next) {
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);
@@ -309,8 +316,8 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode)
mul_m3_v3(lar->imat, lar->sh_invcampos);
lar->sh_invcampos[2]*= lar->sh_zfac;
- if(lar->shb) {
- if(mode==1) {
+ if (lar->shb) {
+ if (mode==1) {
invert_m4_m4(pmat, mat);
mult_m4_m4m4(smat, lar->shb->viewmat, pmat);
mult_m4_m4m4(lar->shb->persmat, lar->shb->winmat, smat);
@@ -330,19 +337,19 @@ 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;
- for(obr=re->objecttable.first; obr; obr=obr->next) {
- if((obr->lay & notlay)==0) {
- for(a=0; a<obr->totvlak; a++) {
- if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
+ for (obr=re->objecttable.first; obr; obr=obr->next) {
+ if ((obr->lay & notlay)==0) {
+ for (a=0; a<obr->totvlak; a++) {
+ if ((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
else vlr++;
vlr->flag |= R_HIDDEN;
@@ -357,12 +364,12 @@ static void env_hideobject(Render *re, Object *ob)
VlakRen *vlr = NULL;
int a;
- for(obr=re->objecttable.first; obr; obr=obr->next) {
- for(a=0; a<obr->totvlak; a++) {
- if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
+ for (obr=re->objecttable.first; obr; obr=obr->next) {
+ for (a=0; a<obr->totvlak; a++) {
+ if ((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
else vlr++;
- if(obr->ob == ob)
+ if (obr->ob == ob)
vlr->flag |= R_HIDDEN;
}
}
@@ -374,9 +381,9 @@ static void env_showobjects(Render *re)
VlakRen *vlr = NULL;
int a;
- for(obr=re->objecttable.first; obr; obr=obr->next) {
- for(a=0; a<obr->totvlak; a++) {
- if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
+ for (obr=re->objecttable.first; obr; obr=obr->next) {
+ for (a=0; a<obr->totvlak; a++) {
+ if ((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
else vlr++;
vlr->flag &= ~R_HIDDEN;
@@ -392,7 +399,7 @@ static void env_set_imats(Render *re)
float mat[4][4];
base= re->scene->base.first;
- while(base) {
+ while (base) {
mult_m4_m4m4(mat, re->viewmat, base->object->obmat);
invert_m4_m4(base->object->imat, mat);
@@ -426,8 +433,8 @@ static void render_envmap(Render *re, EnvMap *env)
invert_m4_m4(tmat, mat);
copy_m3_m4(env->obimat, tmat);
- for(part=0; part<6; part++) {
- if(env->type==ENV_PLANE && part!=1)
+ for (part=0; part<6; part++) {
+ if (env->type==ENV_PLANE && part!=1)
continue;
re->display_clear(re->dch, envre->result);
@@ -451,7 +458,7 @@ static void render_envmap(Render *re, EnvMap *env)
env_hideobject(envre, env->object);
env_set_imats(envre);
- if(re->test_break(re->tbh)==0) {
+ if (re->test_break(re->tbh)==0) {
RE_TileProcessor(envre);
}
@@ -459,7 +466,7 @@ static void render_envmap(Render *re, EnvMap *env)
env_showobjects(envre);
env_rotate_scene(envre, tmat, 0);
- if(re->test_break(re->tbh)==0) {
+ if (re->test_break(re->tbh)==0) {
RenderLayer *rl= envre->result->layers.first;
int y;
float *alpha;
@@ -472,19 +479,19 @@ static void render_envmap(Render *re, EnvMap *env)
/* envmap renders without alpha */
alpha= ((float *)ibuf->rect_float)+3;
- for(y= ibuf->x*ibuf->y - 1; y>=0; y--, alpha+=4)
+ for (y= ibuf->x*ibuf->y - 1; y>=0; y--, alpha+=4)
*alpha= 1.0;
env->cube[part]= ibuf;
}
- if(re->test_break(re->tbh)) break;
+ if (re->test_break(re->tbh)) break;
}
- if(re->test_break(re->tbh)) BKE_free_envmapdata(env);
+ if (re->test_break(re->tbh)) BKE_free_envmapdata(env);
else {
- if(envre->r.mode & R_OSA) env->ok= ENV_OSA;
+ if (envre->r.mode & R_OSA) env->ok= ENV_OSA;
else env->ok= ENV_NORMAL;
env->lastframe= re->scene->r.cfra;
}
@@ -504,7 +511,7 @@ void make_envmaps(Render *re)
if (!(re->r.mode & R_ENVMAP)) return;
- /* we dont raytrace, disabling the flag will cause ray_transp render solid */
+ /* we don't raytrace, disabling the flag will cause ray_transp render solid */
trace= (re->r.mode & R_RAYTRACE);
re->r.mode &= ~R_RAYTRACE;
@@ -512,15 +519,15 @@ void make_envmaps(Render *re)
re->stats_draw(re->sdh, &re->i);
/* 5 = hardcoded max recursion level */
- while(depth<5) {
+ while (depth<5) {
tex= re->main->tex.first;
- while(tex) {
- if(tex->id.us && tex->type==TEX_ENVMAP) {
- if(tex->env && tex->env->object) {
+ while (tex) {
+ if (tex->id.us && tex->type==TEX_ENVMAP) {
+ if (tex->env && tex->env->object) {
EnvMap *env= tex->env;
- if(env->object->lay & re->lay) {
- if(env->stype==ENV_LOAD) {
+ if (env->object->lay & re->lay) {
+ if (env->stype==ENV_LOAD) {
float orthmat[4][4], mat[4][4], tmat[4][4];
/* precalc orthmat for object */
@@ -535,29 +542,29 @@ void make_envmaps(Render *re)
else {
/* decide if to render an envmap (again) */
- if(env->depth >= depth) {
+ if (env->depth >= depth) {
/* set 'recalc' to make sure it does an entire loop of recalcs */
- if(env->ok) {
+ if (env->ok) {
/* free when OSA, and old one isn't OSA */
- if((re->r.mode & R_OSA) && env->ok==ENV_NORMAL)
+ if ((re->r.mode & R_OSA) && env->ok==ENV_NORMAL)
BKE_free_envmapdata(env);
/* free when size larger */
- else if(env->lastsize < re->r.size)
+ else if (env->lastsize < re->r.size)
BKE_free_envmapdata(env);
/* free when env is in recalcmode */
- else if(env->recalc)
+ else if (env->recalc)
BKE_free_envmapdata(env);
}
- if(env->ok==0 && depth==0) env->recalc= 1;
+ if (env->ok==0 && depth==0) env->recalc= 1;
- if(env->ok==0) {
+ if (env->ok==0) {
do_init= 1;
render_envmap(re, env);
- if(depth==env->depth) env->recalc= 0;
+ if (depth==env->depth) env->recalc= 0;
}
}
}
@@ -569,7 +576,7 @@ void make_envmaps(Render *re)
depth++;
}
- if(do_init) {
+ if (do_init) {
re->display_init(re->dih, re->result);
re->display_clear(re->dch, re->result);
// re->flag |= R_REDRAW_PRV;
@@ -586,7 +593,7 @@ static int envcube_isect(EnvMap *env, float *vec, float *answ)
float labda;
int face;
- if(env->type==ENV_PLANE) {
+ if (env->type==ENV_PLANE) {
face= 1;
labda= 1.0f/vec[2];
@@ -595,7 +602,7 @@ static int envcube_isect(EnvMap *env, float *vec, float *answ)
}
else {
/* which face */
- if( vec[2] <= -fabsf(vec[0]) && vec[2] <= -fabsf(vec[1]) ) {
+ if ( vec[2] <= -fabsf(vec[0]) && vec[2] <= -fabsf(vec[1]) ) {
face= 0;
labda= -1.0f/vec[2];
answ[0]= labda*vec[0];
@@ -642,13 +649,13 @@ static int envcube_isect(EnvMap *env, float *vec, float *answ)
static void set_dxtdyt(float *dxts, float *dyts, float *dxt, float *dyt, int face)
{
- if(face==2 || face==4) {
+ if (face==2 || face==4) {
dxts[0]= dxt[0];
dyts[0]= dyt[0];
dxts[1]= dxt[2];
dyts[1]= dyt[2];
}
- else if(face==3 || face==5) {
+ else if (face==3 || face==5) {
dxts[0]= dxt[1];
dxts[1]= dxt[2];
dyts[0]= dyt[1];
@@ -674,17 +681,17 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe
int face, face1;
env= tex->env;
- if(env==NULL || (env->stype!=ENV_LOAD && env->object==NULL)) {
+ if (env==NULL || (env->stype!=ENV_LOAD && env->object==NULL)) {
texres->tin= 0.0;
return 0;
}
- if(env->stype==ENV_LOAD) {
+ if (env->stype==ENV_LOAD) {
env->ima= tex->ima;
- if(env->ima && env->ima->ok) {
- if(env->cube[1]==NULL) {
+ if (env->ima && env->ima->ok) {
+ if (env->cube[1]==NULL) {
ImBuf *ibuf_ima= BKE_image_get_ibuf(env->ima, NULL);
- if(ibuf_ima)
+ if (ibuf_ima)
envmap_split_ima(env, ibuf_ima);
else
env->ok= 0;
@@ -692,21 +699,21 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe
}
}
- if(env->ok==0) {
+ if (env->ok==0) {
texres->tin= 0.0;
return 0;
}
/* rotate to envmap space, if object is set */
copy_v3_v3(vec, texvec);
- if(env->object) mul_m3_v3(env->obimat, vec);
+ if (env->object) mul_m3_v3(env->obimat, vec);
else mul_mat3_m4_v3(R.viewinv, vec);
face= envcube_isect(env, vec, sco);
ibuf= env->cube[face];
- if(osatex) {
- if(env->object) {
+ if (osatex) {
+ if (env->object) {
mul_m3_v3(env->obimat, dxt);
mul_m3_v3(env->obimat, dyt);
}
@@ -719,7 +726,7 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe
/* edges? */
- if(texres->ta<1.0f) {
+ if (texres->ta<1.0f) {
TexResult texr1, texr2;
texr1.nor= texr2.nor= NULL;
@@ -729,7 +736,7 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe
face1= envcube_isect(env, vec, sco);
sub_v3_v3(vec, dxt);
- if(face!=face1) {
+ if (face!=face1) {
ibuf= env->cube[face1];
set_dxtdyt(dxts, dyts, dxt, dyt, face1);
imagewraposa(tex, NULL, ibuf, sco, dxts, dyts, &texr1);
@@ -742,7 +749,7 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe
face1= envcube_isect(env, vec, sco);
sub_v3_v3(vec, dyt);
- if(face!=face1) {
+ if (face!=face1) {
ibuf= env->cube[face1];
set_dxtdyt(dxts, dyts, dxt, dyt, face1);
imagewraposa(tex, NULL, ibuf, sco, dxts, dyts, &texr2);
@@ -750,7 +757,7 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe
else texr2.tr= texr2.tg= texr2.tb= texr2.ta= 0.0;
fac= (texres->ta+texr1.ta+texr2.ta);
- if(fac!=0.0f) {
+ if (fac!=0.0f) {
fac= 1.0f/fac;
texres->tr= fac*(texres->ta*texres->tr + texr1.ta*texr1.tr + texr2.ta*texr2.tr );
diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c
index 703ca23c15b..ea352a16934 100644
--- a/source/blender/render/intern/source/external_engine.c
+++ b/source/blender/render/intern/source/external_engine.c
@@ -36,10 +36,13 @@
#include "MEM_guardedalloc.h"
+#include "BLF_translation.h"
+
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
+#include "BKE_global.h"
#include "BKE_report.h"
#include "BKE_scene.h"
@@ -60,7 +63,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 +71,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}};
@@ -88,13 +91,13 @@ void RE_engines_exit(void)
{
RenderEngineType *type, *next;
- for(type=R_engines.first; type; type=next) {
+ for (type=R_engines.first; type; type=next) {
next= type->next;
BLI_remlink(&R_engines, type);
- if(!(type->flag & RE_INTERNAL)) {
- if(type->ext.free)
+ if (!(type->flag & RE_INTERNAL)) {
+ if (type->ext.free)
type->ext.free(type->ext.data);
MEM_freeN(type);
@@ -107,7 +110,7 @@ RenderEngineType *RE_engines_find(const char *idname)
RenderEngineType *type;
type= BLI_findstring(&R_engines, idname, offsetof(RenderEngineType, idname));
- if(!type)
+ if (!type)
type= &internal_render_type;
return type;
@@ -132,12 +135,12 @@ RenderEngine *RE_engine_create(RenderEngineType *type)
void RE_engine_free(RenderEngine *engine)
{
#ifdef WITH_PYTHON
- if(engine->py_instance) {
+ if (engine->py_instance) {
BPY_DECREF(engine->py_instance);
}
#endif
- if(engine->text)
+ if (engine->text)
MEM_freeN(engine->text);
MEM_freeN(engine);
@@ -157,16 +160,16 @@ RenderResult *RE_engine_begin_result(RenderEngine *engine, int x, int y, int w,
CLAMP(w, 0, re->result->rectx);
CLAMP(h, 0, re->result->recty);
- if(x + w > re->result->rectx)
+ if (x + w > re->result->rectx)
w= re->result->rectx - x;
- if(y + h > re->result->recty)
+ if (y + h > re->result->recty)
h= re->result->recty - y;
/* allocate a render result */
- disprect.xmin= x;
- disprect.xmax= x+w;
- disprect.ymin= y;
- disprect.ymax= y+h;
+ disprect.xmin = x;
+ disprect.xmax = x+w;
+ disprect.ymin = y;
+ disprect.ymax = y+h;
result= render_result_new(re, &disprect, 0, RR_USE_MEM);
BLI_addtail(&engine->fullresult, result);
@@ -183,7 +186,7 @@ void RE_engine_update_result(RenderEngine *engine, RenderResult *result)
{
Render *re= engine->re;
- if(result) {
+ if (result) {
result->renlay= result->layers.first; // weak, draws first layer always
re->display_draw(re->ddh, result, NULL);
}
@@ -193,15 +196,15 @@ void RE_engine_end_result(RenderEngine *engine, RenderResult *result)
{
Render *re= engine->re;
- if(!result)
+ if (!result)
return;
/* merge. on break, don't merge in result for preview renders, looks nicer */
- if(!(re->test_break(re->tbh) && (re->r.scemode & R_PREVIEWBUTS)))
+ if (!(re->test_break(re->tbh) && (re->r.scemode & R_PREVIEWBUTS)))
render_result_merge(re->result, result);
/* draw */
- if(!re->test_break(re->tbh)) {
+ if (!re->test_break(re->tbh)) {
result->renlay= result->layers.first; // weak, draws first layer always
re->display_draw(re->ddh, result, NULL);
}
@@ -216,7 +219,7 @@ int RE_engine_test_break(RenderEngine *engine)
{
Render *re= engine->re;
- if(re)
+ if (re)
return re->test_break(re->tbh);
return 0;
@@ -229,7 +232,7 @@ void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char
Render *re= engine->re;
/* stats draw callback */
- if(re) {
+ if (re) {
re->i.statstr= stats;
re->i.infostr= info;
re->stats_draw(re->sdh, &re->i);
@@ -238,16 +241,16 @@ void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char
}
/* set engine text */
- if(engine->text) {
+ if (engine->text) {
MEM_freeN(engine->text);
engine->text= NULL;
}
- if(stats && stats[0] && info && info[0])
+ if (stats && stats[0] && info && info[0])
engine->text= BLI_sprintfN("%s | %s", stats, info);
- else if(info && info[0])
+ else if (info && info[0])
engine->text= BLI_strdup(info);
- else if(stats && stats[0])
+ else if (stats && stats[0])
engine->text= BLI_strdup(stats);
}
@@ -255,7 +258,7 @@ void RE_engine_update_progress(RenderEngine *engine, float progress)
{
Render *re= engine->re;
- if(re) {
+ if (re) {
CLAMP(progress, 0.0f, 1.0f);
re->progress(re->prh, progress);
}
@@ -274,25 +277,25 @@ int RE_engine_render(Render *re, int do_all)
RenderEngine *engine;
/* verify if we can render */
- if(!type->render)
+ if (!type->render)
return 0;
- if((re->r.scemode & R_PREVIEWBUTS) && !(type->flag & RE_USE_PREVIEW))
+ if ((re->r.scemode & R_PREVIEWBUTS) && !(type->flag & RE_USE_PREVIEW))
return 0;
- if(do_all && !(type->flag & RE_USE_POSTPROCESS))
+ if (do_all && !(type->flag & RE_USE_POSTPROCESS))
return 0;
- if(!do_all && (type->flag & RE_USE_POSTPROCESS))
+ if (!do_all && (type->flag & RE_USE_POSTPROCESS))
return 0;
/* create render result */
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
- if(re->result==NULL || !(re->r.scemode & R_PREVIEWBUTS)) {
- if(re->result)
+ if (re->result==NULL || !(re->r.scemode & R_PREVIEWBUTS)) {
+ if (re->result)
render_result_free(re->result);
re->result= render_result_new(re, &re->disprect, 0, 0);
}
BLI_rw_mutex_unlock(&re->resultmutex);
- if(re->result==NULL)
+ if (re->result==NULL)
return 1;
/* set render info */
@@ -304,23 +307,26 @@ int RE_engine_render(Render *re, int do_all)
engine = RE_engine_create(type);
engine->re= re;
- if(re->flag & R_ANIMATION)
+ if (re->flag & R_ANIMATION)
engine->flag |= RE_ENGINE_ANIMATION;
- if(re->r.scemode & R_PREVIEWBUTS)
+ if (re->r.scemode & R_PREVIEWBUTS)
engine->flag |= RE_ENGINE_PREVIEW;
- if((re->r.scemode & (R_NO_FRAME_UPDATE|R_PREVIEWBUTS))==0)
+ if ((re->r.scemode & (R_NO_FRAME_UPDATE|R_PREVIEWBUTS))==0)
scene_update_for_newframe(re->main, re->scene, re->lay);
- if(type->update)
+ if (type->update)
type->update(engine, re->main, re->scene);
- if(type->render)
+ if (type->render)
type->render(engine, re->scene);
render_result_free_list(&engine->fullresult, engine->fullresult.first);
RE_engine_free(engine);
+ if (BKE_reports_contain(re->reports, RPT_ERROR))
+ G.afbreek = 1;
+
return 1;
}
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 2d64828b6b3..260a2de4858 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -85,12 +85,12 @@ static void ibuf_get_color(float *col, struct ImBuf *ibuf, int x, int y)
{
int ofs = y * ibuf->x + x;
- if(ibuf->rect_float) {
- if(ibuf->channels==4) {
+ if (ibuf->rect_float) {
+ if (ibuf->channels==4) {
float *fp= ibuf->rect_float + 4*ofs;
copy_v4_v4(col, fp);
}
- else if(ibuf->channels==3) {
+ else if (ibuf->channels==3) {
float *fp= ibuf->rect_float + 3*ofs;
copy_v3_v3(col, fp);
col[3]= 1.0f;
@@ -122,23 +122,23 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
retval= texres->nor?3:1;
/* quick tests */
- if(ibuf==NULL && ima==NULL)
+ if (ibuf==NULL && ima==NULL)
return retval;
- if(ima) {
+ if (ima) {
/* hack for icon render */
- if(ima->ibufs.first==NULL && (R.r.scemode & R_NO_IMAGE_LOAD))
+ if (ima->ibufs.first==NULL && (R.r.scemode & R_NO_IMAGE_LOAD))
return retval;
ibuf= BKE_image_get_ibuf(ima, &tex->iuser);
ima->flag|= IMA_USED_FOR_RENDER;
}
- if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL))
+ if (ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL))
return retval;
/* setup mapping */
- if(tex->imaflag & TEX_IMAROT) {
+ if (tex->imaflag & TEX_IMAROT) {
fy= texvec[0];
fx= texvec[1];
}
@@ -147,7 +147,7 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
fy= texvec[1];
}
- if(tex->extend == TEX_CHECKER) {
+ if (tex->extend == TEX_CHECKER) {
int xs, ys;
xs= (int)floor(fx);
@@ -155,14 +155,14 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
fx-= xs;
fy-= ys;
- if( (tex->flag & TEX_CHECKER_ODD)==0) {
- if((xs+ys) & 1);else return retval;
+ if ( (tex->flag & TEX_CHECKER_ODD)==0) {
+ if ((xs+ys) & 1);else return retval;
}
- if( (tex->flag & TEX_CHECKER_EVEN)==0) {
- if((xs+ys) & 1) return retval;
+ if ( (tex->flag & TEX_CHECKER_EVEN)==0) {
+ if ((xs+ys) & 1) return retval;
}
/* scale around center, (0.5, 0.5) */
- if(tex->checkerdist<1.0f) {
+ if (tex->checkerdist<1.0f) {
fx= (fx-0.5f)/(1.0f-tex->checkerdist) +0.5f;
fy= (fy-0.5f)/(1.0f-tex->checkerdist) +0.5f;
}
@@ -171,37 +171,37 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
x= xi= (int)floorf(fx*ibuf->x);
y= yi= (int)floorf(fy*ibuf->y);
- if(tex->extend == TEX_CLIPCUBE) {
- if(x<0 || y<0 || x>=ibuf->x || y>=ibuf->y || texvec[2]<-1.0f || texvec[2]>1.0f) {
+ if (tex->extend == TEX_CLIPCUBE) {
+ if (x<0 || y<0 || x>=ibuf->x || y>=ibuf->y || texvec[2]<-1.0f || texvec[2]>1.0f) {
return retval;
}
}
- else if( tex->extend==TEX_CLIP || tex->extend==TEX_CHECKER) {
- if(x<0 || y<0 || x>=ibuf->x || y>=ibuf->y) {
+ else if ( tex->extend==TEX_CLIP || tex->extend==TEX_CHECKER) {
+ if (x<0 || y<0 || x>=ibuf->x || y>=ibuf->y) {
return retval;
}
}
else {
- if(tex->extend==TEX_EXTEND) {
- if(x>=ibuf->x) x = ibuf->x-1;
- else if(x<0) x= 0;
+ if (tex->extend==TEX_EXTEND) {
+ if (x>=ibuf->x) x = ibuf->x-1;
+ else if (x<0) x= 0;
}
else {
x= x % ibuf->x;
- if(x<0) x+= ibuf->x;
+ if (x<0) x+= ibuf->x;
}
- if(tex->extend==TEX_EXTEND) {
- if(y>=ibuf->y) y = ibuf->y-1;
- else if(y<0) y= 0;
+ if (tex->extend==TEX_EXTEND) {
+ if (y>=ibuf->y) y = ibuf->y-1;
+ else if (y<0) y= 0;
}
else {
y= y % ibuf->y;
- if(y<0) y+= ibuf->y;
+ if (y<0) y+= ibuf->y;
}
}
/* warning, no return before setting back! */
- if( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) ) {
+ if ( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) ) {
ibuf->rect+= (ibuf->x*ibuf->y);
}
@@ -230,12 +230,12 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
ibuf_get_color(&texres->tr, ibuf, x, y);
}
- if( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) ) {
+ if ( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) ) {
ibuf->rect-= (ibuf->x*ibuf->y);
}
- if(texres->nor) {
- if(tex->imaflag & TEX_NORMALMAP) {
+ if (texres->nor) {
+ if (tex->imaflag & TEX_NORMALMAP) {
// qdn: normal from color
// The invert of the red channel is to make
// the normal map compliant with the outside world.
@@ -251,14 +251,14 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
/* bump: take three samples */
val1= texres->tr+texres->tg+texres->tb;
- if(x<ibuf->x-1) {
+ if (x<ibuf->x-1) {
float col[4];
ibuf_get_color(col, ibuf, x+1, y);
val2= (col[0]+col[1]+col[2]);
}
else val2= val1;
- if(y<ibuf->y-1) {
+ if (y<ibuf->y-1) {
float col[4];
ibuf_get_color(col, ibuf, x, y+1);
val3= (col[0]+col[1]+col[2]);
@@ -271,16 +271,16 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
}
}
- if(texres->talpha) texres->tin= texres->ta;
- else if(tex->imaflag & TEX_CALCALPHA) {
+ if (texres->talpha) texres->tin= texres->ta;
+ else if (tex->imaflag & TEX_CALCALPHA) {
texres->ta= texres->tin= MAX3(texres->tr, texres->tg, texres->tb);
}
else texres->ta= texres->tin= 1.0;
- if(tex->flag & TEX_NEGALPHA) texres->ta= 1.0f-texres->ta;
+ if (tex->flag & TEX_NEGALPHA) texres->ta= 1.0f-texres->ta;
/* de-premul, this is being premulled in shade_input_do_shade() */
- if(texres->ta!=1.0f && texres->ta>1e-4f) {
+ if (texres->ta!=1.0f && texres->ta>1e-4f) {
fx= 1.0f/texres->ta;
texres->tr*= fx;
texres->tg*= fx;
@@ -299,45 +299,45 @@ static void clipx_rctf_swap(rctf *stack, short *count, float x1, float x2)
a= *count;
rf= stack;
- for(;a>0;a--) {
- if(rf->xmin<x1) {
- if(rf->xmax<x1) {
+ for (;a>0;a--) {
+ if (rf->xmin<x1) {
+ if (rf->xmax<x1) {
rf->xmin+= (x2-x1);
rf->xmax+= (x2-x1);
}
else {
- if(rf->xmax>x2) rf->xmax= x2;
+ if (rf->xmax>x2) rf->xmax = x2;
newrct= stack+ *count;
(*count)++;
- newrct->xmax= x2;
- newrct->xmin= rf->xmin+(x2-x1);
- newrct->ymin= rf->ymin;
- newrct->ymax= rf->ymax;
+ newrct->xmax = x2;
+ newrct->xmin = rf->xmin+(x2-x1);
+ newrct->ymin = rf->ymin;
+ newrct->ymax = rf->ymax;
- if(newrct->xmin==newrct->xmax) (*count)--;
+ if (newrct->xmin ==newrct->xmax) (*count)--;
- rf->xmin= x1;
+ rf->xmin = x1;
}
}
- else if(rf->xmax>x2) {
- if(rf->xmin>x2) {
+ else if (rf->xmax>x2) {
+ if (rf->xmin>x2) {
rf->xmin-= (x2-x1);
rf->xmax-= (x2-x1);
}
else {
- if(rf->xmin<x1) rf->xmin= x1;
+ if (rf->xmin<x1) rf->xmin = x1;
newrct= stack+ *count;
(*count)++;
- newrct->xmin= x1;
- newrct->xmax= rf->xmax-(x2-x1);
- newrct->ymin= rf->ymin;
- newrct->ymax= rf->ymax;
+ newrct->xmin = x1;
+ newrct->xmax = rf->xmax-(x2-x1);
+ newrct->ymin = rf->ymin;
+ newrct->ymax = rf->ymax;
- if(newrct->xmin==newrct->xmax) (*count)--;
+ if (newrct->xmin ==newrct->xmax) (*count)--;
- rf->xmax= x2;
+ rf->xmax = x2;
}
}
rf++;
@@ -352,45 +352,45 @@ static void clipy_rctf_swap(rctf *stack, short *count, float y1, float y2)
a= *count;
rf= stack;
- for(;a>0;a--) {
- if(rf->ymin<y1) {
- if(rf->ymax<y1) {
+ for (;a>0;a--) {
+ if (rf->ymin<y1) {
+ if (rf->ymax<y1) {
rf->ymin+= (y2-y1);
rf->ymax+= (y2-y1);
}
else {
- if(rf->ymax>y2) rf->ymax= y2;
+ if (rf->ymax>y2) rf->ymax = y2;
newrct= stack+ *count;
(*count)++;
- newrct->ymax= y2;
- newrct->ymin= rf->ymin+(y2-y1);
- newrct->xmin= rf->xmin;
- newrct->xmax= rf->xmax;
+ newrct->ymax = y2;
+ newrct->ymin = rf->ymin+(y2-y1);
+ newrct->xmin = rf->xmin;
+ newrct->xmax = rf->xmax;
- if(newrct->ymin==newrct->ymax) (*count)--;
+ if (newrct->ymin==newrct->ymax) (*count)--;
- rf->ymin= y1;
+ rf->ymin = y1;
}
}
- else if(rf->ymax>y2) {
- if(rf->ymin>y2) {
+ else if (rf->ymax>y2) {
+ if (rf->ymin>y2) {
rf->ymin-= (y2-y1);
rf->ymax-= (y2-y1);
}
else {
- if(rf->ymin<y1) rf->ymin= y1;
+ if (rf->ymin<y1) rf->ymin = y1;
newrct= stack+ *count;
(*count)++;
- newrct->ymin= y1;
- newrct->ymax= rf->ymax-(y2-y1);
- newrct->xmin= rf->xmin;
- newrct->xmax= rf->xmax;
+ newrct->ymin = y1;
+ newrct->ymax = rf->ymax-(y2-y1);
+ newrct->xmin = rf->xmin;
+ newrct->xmax = rf->xmax;
- if(newrct->ymin==newrct->ymax) (*count)--;
+ if (newrct->ymin==newrct->ymax) (*count)--;
- rf->ymax= y2;
+ rf->ymax = y2;
}
}
rf++;
@@ -412,17 +412,17 @@ static float clipx_rctf(rctf *rf, float x1, float x2)
size= rf->xmax - rf->xmin;
- if(rf->xmin<x1) {
- rf->xmin= x1;
+ if (rf->xmin<x1) {
+ rf->xmin = x1;
}
- if(rf->xmax>x2) {
- rf->xmax= x2;
+ if (rf->xmax>x2) {
+ rf->xmax = x2;
}
- if(rf->xmin > rf->xmax) {
+ if (rf->xmin > rf->xmax) {
rf->xmin = rf->xmax;
return 0.0;
}
- else if(size!=0.0f) {
+ else if (size!=0.0f) {
return (rf->xmax - rf->xmin)/size;
}
return 1.0;
@@ -434,18 +434,18 @@ static float clipy_rctf(rctf *rf, float y1, float y2)
size= rf->ymax - rf->ymin;
- if(rf->ymin<y1) {
- rf->ymin= y1;
+ if (rf->ymin<y1) {
+ rf->ymin = y1;
}
- if(rf->ymax>y2) {
- rf->ymax= y2;
+ if (rf->ymax>y2) {
+ rf->ymax = y2;
}
- if(rf->ymin > rf->ymax) {
+ if (rf->ymin > rf->ymax) {
rf->ymin = rf->ymax;
return 0.0;
}
- else if(size!=0.0f) {
+ else if (size!=0.0f) {
return (rf->ymax - rf->ymin)/size;
}
return 1.0;
@@ -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;
@@ -465,27 +465,27 @@ static void boxsampleclip(struct ImBuf *ibuf, rctf *rf, TexResult *texres)
starty= (int)floor(rf->ymin);
endy= (int)floor(rf->ymax);
- if(startx < 0) startx= 0;
- if(starty < 0) starty= 0;
- if(endx>=ibuf->x) endx= ibuf->x-1;
- if(endy>=ibuf->y) endy= ibuf->y-1;
+ if (startx < 0) startx= 0;
+ if (starty < 0) starty= 0;
+ if (endx>=ibuf->x) endx= ibuf->x-1;
+ if (endy>=ibuf->y) endy= ibuf->y-1;
- if(starty==endy && startx==endx) {
+ if (starty==endy && startx==endx) {
ibuf_get_color(&texres->tr, ibuf, startx, starty);
}
else {
div= texres->tr= texres->tg= texres->tb= texres->ta= 0.0;
- for(y=starty; y<=endy; y++) {
+ for (y=starty; y<=endy; y++) {
muly= 1.0;
- if(starty==endy);
+ if (starty==endy);
else {
- if(y==starty) muly= 1.0f-(rf->ymin - y);
- if(y==endy) muly= (rf->ymax - y);
+ if (y==starty) muly= 1.0f-(rf->ymin - y);
+ if (y==endy) muly= (rf->ymax - y);
}
- if(startx==endx) {
+ if (startx==endx) {
mulx= muly;
ibuf_get_color(col, ibuf, startx, y);
@@ -497,14 +497,14 @@ static void boxsampleclip(struct ImBuf *ibuf, rctf *rf, TexResult *texres)
div+= mulx;
}
else {
- for(x=startx; x<=endx; x++) {
+ for (x=startx; x<=endx; x++) {
mulx= muly;
- if(x==startx) mulx*= 1.0f-(rf->xmin - x);
- if(x==endx) mulx*= (rf->xmax - x);
+ if (x==startx) mulx*= 1.0f-(rf->xmin - x);
+ if (x==endx) mulx*= (rf->xmax - x);
ibuf_get_color(col, ibuf, x, y);
- if(mulx==1.0f) {
+ if (mulx==1.0f) {
texres->ta+= col[3];
texres->tr+= col[0];
texres->tg+= col[1];
@@ -522,7 +522,7 @@ static void boxsampleclip(struct ImBuf *ibuf, rctf *rf, TexResult *texres)
}
}
- if(div!=0.0f) {
+ if (div!=0.0f) {
div= 1.0f/div;
texres->tb*= div;
texres->tg*= div;
@@ -542,7 +542,7 @@ static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float max
* If variable 'imaprepeat' has been set, the
* clipped-away parts are sampled as well.
*/
- /* note: actually minx etc isnt in the proper range... this due to filter size and offset vectors for bump */
+ /* note: actually minx etc isn't in the proper range... this due to filter size and offset vectors for bump */
/* note: talpha must be initialized */
/* note: even when 'imaprepeat' is set, this can only repeate once in any direction.
* the point which min/max is derived from is assumed to be wrapped */
@@ -552,46 +552,46 @@ static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float max
short count=1;
rf= stack;
- rf->xmin= minx*(ibuf->x);
- rf->xmax= maxx*(ibuf->x);
- rf->ymin= miny*(ibuf->y);
- rf->ymax= maxy*(ibuf->y);
+ rf->xmin = minx*(ibuf->x);
+ rf->xmax = maxx*(ibuf->x);
+ rf->ymin = miny*(ibuf->y);
+ rf->ymax = maxy*(ibuf->y);
texr.talpha= texres->talpha; /* is read by boxsample_clip */
- if(imapextend) {
+ if (imapextend) {
CLAMP(rf->xmin, 0.0f, ibuf->x-1);
CLAMP(rf->xmax, 0.0f, ibuf->x-1);
}
- else if(imaprepeat)
+ else if (imaprepeat)
clipx_rctf_swap(stack, &count, 0.0, (float)(ibuf->x));
else {
alphaclip= clipx_rctf(rf, 0.0, (float)(ibuf->x));
- if(alphaclip<=0.0f) {
+ if (alphaclip<=0.0f) {
texres->tr= texres->tb= texres->tg= texres->ta= 0.0;
return;
}
}
- if(imapextend) {
+ if (imapextend) {
CLAMP(rf->ymin, 0.0f, ibuf->y-1);
CLAMP(rf->ymax, 0.0f, ibuf->y-1);
}
- else if(imaprepeat)
+ else if (imaprepeat)
clipy_rctf_swap(stack, &count, 0.0, (float)(ibuf->y));
else {
alphaclip*= clipy_rctf(rf, 0.0, (float)(ibuf->y));
- if(alphaclip<=0.0f) {
+ if (alphaclip<=0.0f) {
texres->tr= texres->tb= texres->tg= texres->ta= 0.0;
return;
}
}
- if(count>1) {
+ if (count>1) {
tot= texres->tr= texres->tb= texres->tg= texres->ta= 0.0;
- while(count--) {
+ while (count--) {
boxsampleclip(ibuf, rf, &texr);
opp= square_rctf(rf);
@@ -600,22 +600,22 @@ static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float max
texres->tr+= opp*texr.tr;
texres->tg+= opp*texr.tg;
texres->tb+= opp*texr.tb;
- if(texres->talpha) texres->ta+= opp*texr.ta;
+ if (texres->talpha) texres->ta+= opp*texr.ta;
rf++;
}
- if(tot!= 0.0f) {
+ if (tot!= 0.0f) {
texres->tr/= tot;
texres->tg/= tot;
texres->tb/= tot;
- if(texres->talpha) texres->ta/= tot;
+ if (texres->talpha) texres->ta/= tot;
}
}
else
boxsampleclip(ibuf, rf, texres);
- if(texres->talpha==0) texres->ta= 1.0;
+ if (texres->talpha==0) texres->ta= 1.0;
- if(alphaclip!=1.0f) {
+ if (alphaclip!=1.0f) {
/* premul it all */
texres->tr*= alphaclip;
texres->tg*= alphaclip;
@@ -978,17 +978,17 @@ static void alpha_clip_aniso(ImBuf *ibuf, float minx, float miny, float maxx, fl
// TXF apha: we're doing the same alphaclip here as boxsample, but i'm doubting
// if this is actually correct for the all the filtering algorithms ..
- if(!(extflag == TXC_REPT || extflag == TXC_EXTD)) {
- rf.xmin= minx*(ibuf->x);
- rf.xmax= maxx*(ibuf->x);
- rf.ymin= miny*(ibuf->y);
- rf.ymax= maxy*(ibuf->y);
+ if (!(extflag == TXC_REPT || extflag == TXC_EXTD)) {
+ rf.xmin = minx*(ibuf->x);
+ rf.xmax = maxx*(ibuf->x);
+ rf.ymin = miny*(ibuf->y);
+ rf.ymax = maxy*(ibuf->y);
alphaclip = clipx_rctf(&rf, 0.0, (float)(ibuf->x));
alphaclip*= clipy_rctf(&rf, 0.0, (float)(ibuf->y));
alphaclip= MAX2(alphaclip, 0.0f);
- if(alphaclip!=1.0f) {
+ if (alphaclip!=1.0f) {
/* premul it all */
texres->tr*= alphaclip;
texres->tg*= alphaclip;
@@ -1213,9 +1213,9 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
// brecht: added stupid clamping here, large dx/dy can give very large
// filter sizes which take ages to render, it may be better to do this
// more intelligently later in the code .. probably it's not noticeable
- if(AFD.dxt[0]*AFD.dxt[0] + AFD.dxt[1]*AFD.dxt[1] > 2.0f*2.0f)
+ if (AFD.dxt[0]*AFD.dxt[0] + AFD.dxt[1]*AFD.dxt[1] > 2.0f*2.0f)
mul_v2_fl(AFD.dxt, 2.0f/len_v2(AFD.dxt));
- if(AFD.dyt[0]*AFD.dyt[0] + AFD.dyt[1]*AFD.dyt[1] > 2.0f*2.0f)
+ if (AFD.dyt[0]*AFD.dyt[0] + AFD.dyt[1]*AFD.dyt[1] > 2.0f*2.0f)
mul_v2_fl(AFD.dyt, 2.0f/len_v2(AFD.dyt));
// choice:
@@ -1434,32 +1434,32 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
retval= texres->nor?3:1;
/* quick tests */
- if(ibuf==NULL && ima==NULL)
+ if (ibuf==NULL && ima==NULL)
return retval;
- if(ima) {
+ if (ima) {
/* hack for icon render */
- if(ima->ibufs.first==NULL && (R.r.scemode & R_NO_IMAGE_LOAD))
+ if (ima->ibufs.first==NULL && (R.r.scemode & R_NO_IMAGE_LOAD))
return retval;
ibuf= BKE_image_get_ibuf(ima, &tex->iuser);
ima->flag|= IMA_USED_FOR_RENDER;
}
- if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL))
+ if (ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL))
return retval;
/* mipmap test */
image_mipmap_test(tex, ibuf);
- if(tex->imaflag & TEX_USEALPHA) {
- if(tex->imaflag & TEX_CALCALPHA);
+ if (tex->imaflag & TEX_USEALPHA) {
+ if (tex->imaflag & TEX_CALCALPHA);
else texres->talpha= 1;
}
texr.talpha= texres->talpha;
- if(tex->imaflag & TEX_IMAROT) {
+ if (tex->imaflag & TEX_IMAROT) {
fy= texvec[0];
fx= texvec[1];
}
@@ -1468,9 +1468,9 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
fy= texvec[1];
}
- if(ibuf->flags & IB_fields) {
- if(R.r.mode & R_FIELDS) { /* field render */
- if(R.flag & R_SEC_FIELD) { /* correction for 2nd field */
+ if (ibuf->flags & IB_fields) {
+ if (R.r.mode & R_FIELDS) { /* field render */
+ if (R.flag & R_SEC_FIELD) { /* correction for 2nd field */
/* fac1= 0.5/( (float)ibuf->y ); */
/* fy-= fac1; */
}
@@ -1491,16 +1491,16 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
minx= (maxx-minx)/2.0f;
miny= (maxy-miny)/2.0f;
- if(tex->imaflag & TEX_FILTER_MIN) {
+ if (tex->imaflag & TEX_FILTER_MIN) {
/* make sure the filtersize is minimal in pixels (normal, ref map can have miniature pixel dx/dy) */
float addval= (0.5f * tex->filtersize) / (float) MIN2(ibuf->x, ibuf->y);
- if(addval > minx)
+ if (addval > minx)
minx= addval;
- if(addval > miny)
+ if (addval > miny)
miny= addval;
}
- else if(tex->filtersize!=1.0f) {
+ else if (tex->filtersize!=1.0f) {
minx*= tex->filtersize;
miny*= tex->filtersize;
@@ -1510,33 +1510,33 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
dyt[1]*= tex->filtersize;
}
- if(tex->imaflag & TEX_IMAROT) SWAP(float, minx, miny);
+ if (tex->imaflag & TEX_IMAROT) SWAP(float, minx, miny);
- if(minx>0.25f) minx= 0.25f;
- else if(minx<0.00001f) minx= 0.00001f; /* side faces of unit-cube */
- if(miny>0.25f) miny= 0.25f;
- else if(miny<0.00001f) miny= 0.00001f;
+ if (minx>0.25f) minx= 0.25f;
+ else if (minx<0.00001f) minx= 0.00001f; /* side faces of unit-cube */
+ if (miny>0.25f) miny= 0.25f;
+ else if (miny<0.00001f) miny= 0.00001f;
/* repeat and clip */
imaprepeat= (tex->extend==TEX_REPEAT);
imapextend= (tex->extend==TEX_EXTEND);
- if(tex->extend == TEX_REPEAT) {
- if(tex->flag & (TEX_REPEAT_XMIR|TEX_REPEAT_YMIR)) {
+ if (tex->extend == TEX_REPEAT) {
+ if (tex->flag & (TEX_REPEAT_XMIR|TEX_REPEAT_YMIR)) {
imaprepeat= 0;
imapextend= 1;
}
}
- if(tex->extend == TEX_CHECKER) {
+ if (tex->extend == TEX_CHECKER) {
int xs, ys, xs1, ys1, xs2, ys2, boundary;
xs= (int)floor(fx);
ys= (int)floor(fy);
// both checkers available, no boundary exceptions, checkerdist will eat aliasing
- if( (tex->flag & TEX_CHECKER_ODD) && (tex->flag & TEX_CHECKER_EVEN) ) {
+ if ( (tex->flag & TEX_CHECKER_ODD) && (tex->flag & TEX_CHECKER_EVEN) ) {
fx-= xs;
fy-= ys;
}
@@ -1548,37 +1548,37 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
ys2= (int)floor(fy+miny);
boundary= (xs1!=xs2) || (ys1!=ys2);
- if(boundary==0) {
- if( (tex->flag & TEX_CHECKER_ODD)==0) {
- if((xs+ys) & 1);
+ if (boundary==0) {
+ if ( (tex->flag & TEX_CHECKER_ODD)==0) {
+ if ((xs+ys) & 1);
else return retval;
}
- if( (tex->flag & TEX_CHECKER_EVEN)==0) {
- if((xs+ys) & 1) return retval;
+ if ( (tex->flag & TEX_CHECKER_EVEN)==0) {
+ if ((xs+ys) & 1) return retval;
}
fx-= xs;
fy-= ys;
}
else {
- if(tex->flag & TEX_CHECKER_ODD) {
- if((xs1+ys) & 1) fx-= xs2;
+ if (tex->flag & TEX_CHECKER_ODD) {
+ if ((xs1+ys) & 1) fx-= xs2;
else fx-= xs1;
- if((ys1+xs) & 1) fy-= ys2;
+ if ((ys1+xs) & 1) fy-= ys2;
else fy-= ys1;
}
- if(tex->flag & TEX_CHECKER_EVEN) {
- if((xs1+ys) & 1) fx-= xs1;
+ if (tex->flag & TEX_CHECKER_EVEN) {
+ if ((xs1+ys) & 1) fx-= xs1;
else fx-= xs2;
- if((ys1+xs) & 1) fy-= ys1;
+ if ((ys1+xs) & 1) fy-= ys1;
else fy-= ys2;
}
}
}
/* scale around center, (0.5, 0.5) */
- if(tex->checkerdist<1.0f) {
+ if (tex->checkerdist<1.0f) {
fx= (fx-0.5f)/(1.0f-tex->checkerdist) +0.5f;
fy= (fy-0.5f)/(1.0f-tex->checkerdist) +0.5f;
minx/= (1.0f-tex->checkerdist);
@@ -1586,74 +1586,74 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
}
}
- if(tex->extend == TEX_CLIPCUBE) {
- if(fx+minx<0.0f || fy+miny<0.0f || fx-minx>1.0f || fy-miny>1.0f || texvec[2]<-1.0f || texvec[2]>1.0f) {
+ if (tex->extend == TEX_CLIPCUBE) {
+ if (fx+minx<0.0f || fy+miny<0.0f || fx-minx>1.0f || fy-miny>1.0f || texvec[2]<-1.0f || texvec[2]>1.0f) {
return retval;
}
}
- else if(tex->extend==TEX_CLIP || tex->extend==TEX_CHECKER) {
- if(fx+minx<0.0f || fy+miny<0.0f || fx-minx>1.0f || fy-miny>1.0f) {
+ else if (tex->extend==TEX_CLIP || tex->extend==TEX_CHECKER) {
+ if (fx+minx<0.0f || fy+miny<0.0f || fx-minx>1.0f || fy-miny>1.0f) {
return retval;
}
}
else {
- if(imapextend) {
- if(fx>1.0f) fx = 1.0f;
- else if(fx<0.0f) fx= 0.0f;
+ if (imapextend) {
+ if (fx>1.0f) fx = 1.0f;
+ else if (fx<0.0f) fx= 0.0f;
}
else {
- if(fx>1.0f) fx -= (int)(fx);
- else if(fx<0.0f) fx+= 1-(int)(fx);
+ if (fx>1.0f) fx -= (int)(fx);
+ else if (fx<0.0f) fx+= 1-(int)(fx);
}
- if(imapextend) {
- if(fy>1.0f) fy = 1.0f;
- else if(fy<0.0f) fy= 0.0f;
+ if (imapextend) {
+ if (fy>1.0f) fy = 1.0f;
+ else if (fy<0.0f) fy= 0.0f;
}
else {
- if(fy>1.0f) fy -= (int)(fy);
- else if(fy<0.0f) fy+= 1-(int)(fy);
+ if (fy>1.0f) fy -= (int)(fy);
+ else if (fy<0.0f) fy+= 1-(int)(fy);
}
}
/* warning no return! */
- if( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) ) {
+ if ( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) ) {
ibuf->rect+= (ibuf->x*ibuf->y);
}
/* choice: */
- if(tex->imaflag & TEX_MIPMAP) {
+ if (tex->imaflag & TEX_MIPMAP) {
ImBuf *previbuf, *curibuf;
float bumpscale;
dx= minx;
dy= miny;
maxd= MAX2(dx, dy);
- if(maxd>0.5f) maxd= 0.5f;
+ if (maxd>0.5f) maxd= 0.5f;
pixsize = 1.0f/ (float) MIN2(ibuf->x, ibuf->y);
bumpscale= pixsize/maxd;
- if(bumpscale>1.0f) bumpscale= 1.0f;
+ if (bumpscale>1.0f) bumpscale= 1.0f;
else bumpscale*=bumpscale;
curmap= 0;
previbuf= curibuf= ibuf;
- while(curmap<IB_MIPMAP_LEVELS && ibuf->mipmap[curmap]) {
- if(maxd < pixsize) break;
+ while (curmap<IB_MIPMAP_LEVELS && ibuf->mipmap[curmap]) {
+ if (maxd < pixsize) break;
previbuf= curibuf;
curibuf= ibuf->mipmap[curmap];
pixsize= 1.0f / (float)MIN2(curibuf->x, curibuf->y);
curmap++;
}
- if(previbuf!=curibuf || (tex->imaflag & TEX_INTERPOL)) {
+ if (previbuf!=curibuf || (tex->imaflag & TEX_INTERPOL)) {
/* sample at least 1 pixel */
if (minx < 0.5f / ibuf->x) minx = 0.5f / ibuf->x;
if (miny < 0.5f / ibuf->y) miny = 0.5f / ibuf->y;
}
- if(texres->nor && (tex->imaflag & TEX_NORMALMAP)==0) {
+ if (texres->nor && (tex->imaflag & TEX_NORMALMAP)==0) {
/* a bit extra filter */
//minx*= 1.35f;
//miny*= 1.35f;
@@ -1669,13 +1669,13 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
texres->nor[0]= (val1-val2);
texres->nor[1]= (val1-val3);
- if(previbuf!=curibuf) { /* interpolate */
+ if (previbuf!=curibuf) { /* interpolate */
boxsample(previbuf, fx-minx, fy-miny, fx+minx, fy+miny, &texr, imaprepeat, imapextend);
/* calc rgb */
dx= 2.0f*(pixsize-maxd)/pixsize;
- if(dx>=1.0f) {
+ if (dx>=1.0f) {
texres->ta= texr.ta; texres->tb= texr.tb;
texres->tg= texr.tg; texres->tr= texr.tr;
}
@@ -1696,7 +1696,7 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
texres->nor[0]= (val1-val2); /* vals have been interpolated above! */
texres->nor[1]= (val1-val3);
- if(dx<1.0f) {
+ if (dx<1.0f) {
dy= 1.0f-dx;
texres->tb= dy*texres->tb+ dx*texr.tb;
texres->tg= dy*texres->tg+ dx*texr.tg;
@@ -1715,15 +1715,16 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
boxsample(curibuf, minx, miny, maxx, maxy, texres, imaprepeat, imapextend);
- if(previbuf!=curibuf) { /* interpolate */
+ if (previbuf!=curibuf) { /* interpolate */
boxsample(previbuf, minx, miny, maxx, maxy, &texr, imaprepeat, imapextend);
fx= 2.0f*(pixsize-maxd)/pixsize;
- if(fx>=1.0f) {
+ if (fx>=1.0f) {
texres->ta= texr.ta; texres->tb= texr.tb;
texres->tg= texr.tg; texres->tr= texr.tr;
- } else {
+ }
+ else {
fy= 1.0f-fx;
texres->tb= fy*texres->tb+ fx*texr.tb;
texres->tg= fy*texres->tg+ fx*texr.tg;
@@ -1741,7 +1742,7 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
if (miny < 0.5f / ibuf->y) miny = 0.5f / ibuf->y;
}
- if(texres->nor && (tex->imaflag & TEX_NORMALMAP)==0) {
+ if (texres->nor && (tex->imaflag & TEX_NORMALMAP)==0) {
boxsample(ibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend);
val1= texres->tr+texres->tg+texres->tb;
boxsample(ibuf, fx-minx+dxt[0], fy-miny+dxt[1], fx+minx+dxt[0], fy+miny+dxt[1], &texr, imaprepeat, imapextend);
@@ -1757,18 +1758,18 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
boxsample(ibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend);
}
- if(tex->imaflag & TEX_CALCALPHA) {
+ if (tex->imaflag & TEX_CALCALPHA) {
texres->ta= texres->tin= texres->ta*MAX3(texres->tr, texres->tg, texres->tb);
}
else texres->tin= texres->ta;
- if(tex->flag & TEX_NEGALPHA) texres->ta= 1.0f-texres->ta;
+ if (tex->flag & TEX_NEGALPHA) texres->ta= 1.0f-texres->ta;
- if( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) ) {
+ if ( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) ) {
ibuf->rect-= (ibuf->x*ibuf->y);
}
- if(texres->nor && (tex->imaflag & TEX_NORMALMAP)) {
+ if (texres->nor && (tex->imaflag & TEX_NORMALMAP)) {
// qdn: normal from color
// The invert of the red channel is to make
// the normal map compliant with the outside world.
@@ -1782,7 +1783,7 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
}
/* de-premul, this is being premulled in shade_input_do_shade() */
- if(texres->ta!=1.0f && texres->ta>1e-4f) {
+ if (texres->ta!=1.0f && texres->ta>1e-4f) {
fx= 1.0f/texres->ta;
texres->tr*= fx;
texres->tg*= fx;
@@ -1799,12 +1800,12 @@ void image_sample(Image *ima, float fx, float fy, float dx, float dy, float *res
TexResult texres;
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
- if(ibuf==NULL) {
+ if (ibuf==NULL) {
result[0]= result[1]= result[2]= result[3]= 0.0f;
return;
}
- if( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) )
+ if ( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) )
ibuf->rect+= (ibuf->x*ibuf->y);
texres.talpha= 1; /* boxsample expects to be initialized */
@@ -1814,7 +1815,7 @@ void image_sample(Image *ima, float fx, float fy, float dx, float dy, float *res
result[2]= texres.tb;
result[3]= texres.ta;
- if( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) )
+ if ( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) )
ibuf->rect-= (ibuf->x*ibuf->y);
ima->flag|= IMA_USED_FOR_RENDER;
@@ -1825,7 +1826,7 @@ void ibuf_sample(ImBuf *ibuf, float fx, float fy, float dx, float dy, float *res
TexResult texres;
afdata_t AFD;
- if(ibuf==NULL) {
+ if (ibuf==NULL) {
return;
}
diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c
index b7254cd1221..f7f592c9407 100644
--- a/source/blender/render/intern/source/initrender.c
+++ b/source/blender/render/intern/source/initrender.c
@@ -92,7 +92,7 @@ static void init_render_jit(Render *re)
static int lastjit= 0;
static int last_mblur_jit= 0;
- if(lastjit!=re->r.osa || last_mblur_jit != re->r.mblur_samples) {
+ if (lastjit!=re->r.osa || last_mblur_jit != re->r.mblur_samples) {
memset(jit, 0, sizeof(jit));
BLI_initjit(jit[0], re->r.osa);
@@ -169,11 +169,11 @@ float RE_filter_value(int type, float x)
switch(type) {
case R_FILTER_BOX:
- if(x>1.0f) return 0.0f;
+ if (x>1.0f) return 0.0f;
return 1.0f;
case R_FILTER_TENT:
- if(x>1.0f) return 0.0f;
+ if (x>1.0f) return 0.0f;
return 1.0f-x;
case R_FILTER_GAUSS:
@@ -200,7 +200,7 @@ static float calc_weight(Render *re, float *weight, int i, int j)
float x, y, dist, totw= 0.0;
int a;
- for(a=0; a<re->osa; a++) {
+ for (a=0; a<re->osa; a++) {
x= re->jit[a][0] + i;
y= re->jit[a][1] + j;
dist= sqrt(x*x+y*y);
@@ -210,11 +210,11 @@ static float calc_weight(Render *re, float *weight, int i, int j)
/* Weighting choices */
switch(re->r.filtertype) {
case R_FILTER_BOX:
- if(i==0 && j==0) weight[a]= 1.0;
+ if (i==0 && j==0) weight[a]= 1.0;
break;
case R_FILTER_TENT:
- if(dist < re->r.gauss)
+ if (dist < re->r.gauss)
weight[a]= re->r.gauss - dist;
break;
@@ -251,8 +251,8 @@ void free_sample_tables(Render *re)
{
int a;
- if(re->samples) {
- for(a=0; a<9; a++) {
+ if (re->samples) {
+ for (a=0; a<9; a++) {
MEM_freeN(re->samples->fmask1[a]);
MEM_freeN(re->samples->fmask2[a]);
}
@@ -273,7 +273,7 @@ void make_sample_tables(Render *re)
int i, j, a;
/* optimization tables, only once */
- if(firsttime) {
+ if (firsttime) {
firsttime= 0;
}
@@ -281,7 +281,7 @@ void make_sample_tables(Render *re)
init_render_jit(re); /* needed for mblur too */
- if(re->osa==0) {
+ if (re->osa==0) {
/* just prevents cpu cycles for larger render and copying */
re->r.filtertype= 0;
return;
@@ -289,78 +289,78 @@ void make_sample_tables(Render *re)
st= re->samples= MEM_callocN(sizeof(SampleTables), "sample tables");
- for(a=0; a<9;a++) {
+ for (a=0; a<9;a++) {
st->fmask1[a]= MEM_callocN(256*sizeof(float), "initfilt");
st->fmask2[a]= MEM_callocN(256*sizeof(float), "initfilt");
}
- for(a=0; a<256; a++) {
+ for (a=0; a<256; a++) {
st->cmask[a]= 0;
- if(a & 1) st->cmask[a]++;
- if(a & 2) st->cmask[a]++;
- if(a & 4) st->cmask[a]++;
- if(a & 8) st->cmask[a]++;
- if(a & 16) st->cmask[a]++;
- if(a & 32) st->cmask[a]++;
- if(a & 64) st->cmask[a]++;
- if(a & 128) st->cmask[a]++;
+ if (a & 1) st->cmask[a]++;
+ if (a & 2) st->cmask[a]++;
+ if (a & 4) st->cmask[a]++;
+ if (a & 8) st->cmask[a]++;
+ if (a & 16) st->cmask[a]++;
+ if (a & 32) st->cmask[a]++;
+ if (a & 64) st->cmask[a]++;
+ if (a & 128) st->cmask[a]++;
}
st->centmask= MEM_mallocN((1<<re->osa), "Initfilt3");
- for(a=0; a<16; a++) {
+ for (a=0; a<16; a++) {
st->centLut[a]= -0.45f+((float)a)/16.0f;
}
/* calculate totw */
totw= 0.0;
- for(j= -1; j<2; j++) {
- for(i= -1; i<2; i++) {
+ for (j= -1; j<2; j++) {
+ for (i= -1; i<2; i++) {
totw+= calc_weight(re, weight, i, j);
}
}
- for(j= -1; j<2; j++) {
- for(i= -1; i<2; i++) {
+ for (j= -1; j<2; j++) {
+ for (i= -1; i<2; i++) {
/* calculate using jit, with offset the weights */
memset(weight, 0, sizeof(weight));
calc_weight(re, weight, i, j);
- for(a=0; a<16; a++) flweight[a]= weight[a]*(1.0f/totw);
+ for (a=0; a<16; a++) flweight[a]= weight[a]*(1.0f/totw);
m3= st->fmask1[ 3*(j+1)+i+1 ];
m4= st->fmask2[ 3*(j+1)+i+1 ];
- for(a=0; a<256; a++) {
- if(a & 1) {
+ for (a=0; a<256; a++) {
+ if (a & 1) {
m3[a]+= flweight[0];
m4[a]+= flweight[8];
}
- if(a & 2) {
+ if (a & 2) {
m3[a]+= flweight[1];
m4[a]+= flweight[9];
}
- if(a & 4) {
+ if (a & 4) {
m3[a]+= flweight[2];
m4[a]+= flweight[10];
}
- if(a & 8) {
+ if (a & 8) {
m3[a]+= flweight[3];
m4[a]+= flweight[11];
}
- if(a & 16) {
+ if (a & 16) {
m3[a]+= flweight[4];
m4[a]+= flweight[12];
}
- if(a & 32) {
+ if (a & 32) {
m3[a]+= flweight[5];
m4[a]+= flweight[13];
}
- if(a & 64) {
+ if (a & 64) {
m3[a]+= flweight[6];
m4[a]+= flweight[14];
}
- if(a & 128) {
+ if (a & 128) {
m3[a]+= flweight[7];
m4[a]+= flweight[15];
}
@@ -374,52 +374,52 @@ void make_sample_tables(Render *re)
fpx2= MEM_mallocN(256*sizeof(float), "initgauss4");
fpy1= MEM_mallocN(256*sizeof(float), "initgauss4");
fpy2= MEM_mallocN(256*sizeof(float), "initgauss4");
- for(a=0; a<256; a++) {
+ for (a=0; a<256; a++) {
fpx1[a]= fpx2[a]= 0.0;
fpy1[a]= fpy2[a]= 0.0;
- if(a & 1) {
+ if (a & 1) {
fpx1[a]+= re->jit[0][0];
fpy1[a]+= re->jit[0][1];
fpx2[a]+= re->jit[8][0];
fpy2[a]+= re->jit[8][1];
}
- if(a & 2) {
+ if (a & 2) {
fpx1[a]+= re->jit[1][0];
fpy1[a]+= re->jit[1][1];
fpx2[a]+= re->jit[9][0];
fpy2[a]+= re->jit[9][1];
}
- if(a & 4) {
+ if (a & 4) {
fpx1[a]+= re->jit[2][0];
fpy1[a]+= re->jit[2][1];
fpx2[a]+= re->jit[10][0];
fpy2[a]+= re->jit[10][1];
}
- if(a & 8) {
+ if (a & 8) {
fpx1[a]+= re->jit[3][0];
fpy1[a]+= re->jit[3][1];
fpx2[a]+= re->jit[11][0];
fpy2[a]+= re->jit[11][1];
}
- if(a & 16) {
+ if (a & 16) {
fpx1[a]+= re->jit[4][0];
fpy1[a]+= re->jit[4][1];
fpx2[a]+= re->jit[12][0];
fpy2[a]+= re->jit[12][1];
}
- if(a & 32) {
+ if (a & 32) {
fpx1[a]+= re->jit[5][0];
fpy1[a]+= re->jit[5][1];
fpx2[a]+= re->jit[13][0];
fpy2[a]+= re->jit[13][1];
}
- if(a & 64) {
+ if (a & 64) {
fpx1[a]+= re->jit[6][0];
fpy1[a]+= re->jit[6][1];
fpx2[a]+= re->jit[14][0];
fpy2[a]+= re->jit[14][1];
}
- if(a & 128) {
+ if (a & 128) {
fpx1[a]+= re->jit[7][0];
fpy1[a]+= re->jit[7][1];
fpx2[a]+= re->jit[15][0];
@@ -427,7 +427,7 @@ void make_sample_tables(Render *re)
}
}
- for(a= (1<<re->osa)-1; a>0; a--) {
+ for (a= (1<<re->osa)-1; a>0; a--) {
val= st->cmask[a & 255] + st->cmask[a>>8];
i= 8+(15.9f*(fpy1[a & 255]+fpy2[a>>8])/val);
CLAMP(i, 0, 15);
@@ -531,9 +531,9 @@ void freeparts(Render *re)
{
RenderPart *part= re->parts.first;
- while(part) {
- if(part->rectp) MEM_freeN(part->rectp);
- if(part->rectz) MEM_freeN(part->rectz);
+ while (part) {
+ if (part->rectp) MEM_freeN(part->rectp);
+ if (part->rectz) MEM_freeN(part->rectz);
part= part->next;
}
BLI_freelistN(&re->parts);
@@ -561,16 +561,16 @@ void initparts(Render *re)
yparts= re->r.yparts;
/* mininum part size, but for exr tile saving it was checked already */
- if(!(re->r.scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE))) {
- if(re->r.mode & R_PANORAMA) {
- if(ceil(re->rectx/(float)xparts) < 8)
+ if (!(re->r.scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE))) {
+ if (re->r.mode & R_PANORAMA) {
+ if (ceil(re->rectx/(float)xparts) < 8)
xparts= 1 + re->rectx/8;
}
else
- if(ceil(re->rectx/(float)xparts) < 64)
+ if (ceil(re->rectx/(float)xparts) < 64)
xparts= 1 + re->rectx/64;
- if(ceil(re->recty/(float)yparts) < 64)
+ if (ceil(re->recty/(float)yparts) < 64)
yparts= 1 + re->recty/64;
}
@@ -584,43 +584,43 @@ void initparts(Render *re)
re->party= party;
/* calculate rotation factor of 1 pixel */
- if(re->r.mode & R_PANORAMA)
+ if (re->r.mode & R_PANORAMA)
re->panophi= panorama_pixel_rot(re);
- for(nr=0; nr<xparts*yparts; nr++) {
+ for (nr=0; nr<xparts*yparts; nr++) {
rcti disprect;
int rectx, recty;
xd= (nr % xparts);
yd= (nr-xd)/xparts;
- disprect.xmin= xminb+ xd*partx;
- disprect.ymin= yminb+ yd*party;
+ disprect.xmin = xminb+ xd*partx;
+ disprect.ymin = yminb+ yd*party;
/* ensure we cover the entire picture, so last parts go to end */
- if(xd<xparts-1) {
- disprect.xmax= disprect.xmin + partx;
- if(disprect.xmax > xmaxb)
+ if (xd<xparts-1) {
+ disprect.xmax = disprect.xmin + partx;
+ if (disprect.xmax > xmaxb)
disprect.xmax = xmaxb;
}
- else disprect.xmax= xmaxb;
+ else disprect.xmax = xmaxb;
- if(yd<yparts-1) {
- disprect.ymax= disprect.ymin + party;
- if(disprect.ymax > ymaxb)
+ if (yd<yparts-1) {
+ disprect.ymax = disprect.ymin + party;
+ if (disprect.ymax > ymaxb)
disprect.ymax = ymaxb;
}
- else disprect.ymax= ymaxb;
+ else disprect.ymax = ymaxb;
rectx= disprect.xmax - disprect.xmin;
recty= disprect.ymax - disprect.ymin;
/* so, now can we add this part? */
- if(rectx>0 && recty>0) {
+ if (rectx>0 && recty>0) {
RenderPart *pa= MEM_callocN(sizeof(RenderPart), "new part");
/* Non-box filters need 2 pixels extra to work */
- if((re->r.filtertype || (re->r.mode & R_EDGE))) {
+ if ((re->r.filtertype || (re->r.mode & R_EDGE))) {
pa->crop= 2;
disprect.xmin -= pa->crop;
disprect.ymin -= pa->crop;
diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c
index 669355c9977..436eaefd155 100644
--- a/source/blender/render/intern/source/occlusion.c
+++ b/source/blender/render/intern/source/occlusion.c
@@ -148,7 +148,7 @@ static void occ_shade(ShadeSample *ssamp, ObjectInstanceRen *obi, VlakRen *vlr,
float l, u, v, *v1, *v2, *v3;
/* init */
- if(vlr->v4) {
+ if (vlr->v4) {
shi->u= u= 0.5f;
shi->v= v= 0.5f;
}
@@ -184,13 +184,13 @@ static void occ_shade(ShadeSample *ssamp, ObjectInstanceRen *obi, VlakRen *vlr,
shade_input_set_normals(shi);
/* no normal flip */
- if(shi->flippednor)
+ if (shi->flippednor)
shade_input_flip_normals(shi);
madd_v3_v3fl(shi->co, shi->vn, 0.0001f); /* ugly.. */
/* not a pretty solution, but fixes common cases */
- if(shi->obr->ob && shi->obr->ob->transflag & OB_NEG_SCALE) {
+ if (shi->obr->ob && shi->obr->ob->transflag & OB_NEG_SCALE) {
negate_v3(shi->vn);
negate_v3(shi->vno);
negate_v3(shi->nmapnorm);
@@ -224,7 +224,7 @@ static void occ_build_shade(Render *re, OcclusionTree *tree)
ssamp.shi[0].combinedflag= ~(SCE_PASS_SPEC);
ssamp.tot= 1;
- for(a=0; a<tree->totface; a++) {
+ for (a=0; a<tree->totface; a++) {
obi= &R.objectinstance[tree->face[a].obi];
vlr= RE_findOrAddVlak(obi->obr, tree->face[a].facenr);
@@ -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)
{
@@ -248,7 +248,7 @@ static void sh_mul(float *sh, float f)
{
int i;
- for(i=0; i<9; i++)
+ for (i=0; i<9; i++)
sh[i] *= f;
}
@@ -256,14 +256,14 @@ static void sh_add(float *shresult, float *sh1, float *sh2)
{
int i;
- for(i=0; i<9; i++)
+ for (i=0; i<9; i++)
shresult[i]= sh1[i] + sh2[i];
}
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;
@@ -319,40 +319,40 @@ static void occ_face(const OccFace *face, float co[3], float normal[3], float *a
obi= &R.objectinstance[face->obi];
vlr= RE_findOrAddVlak(obi->obr, face->facenr);
- if(co) {
- if(vlr->v4)
+ if (co) {
+ if (vlr->v4)
mid_v3_v3v3(co, vlr->v1->co, vlr->v3->co);
else
cent_tri_v3(co, vlr->v1->co, vlr->v2->co, vlr->v3->co);
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mul_m4_v3(obi->mat, co);
}
- if(normal) {
+ if (normal) {
normal[0]= -vlr->n[0];
normal[1]= -vlr->n[1];
normal[2]= -vlr->n[2];
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mul_m3_v3(obi->nmat, normal);
}
- if(area) {
+ if (area) {
copy_v3_v3(v1, vlr->v1->co);
copy_v3_v3(v2, vlr->v2->co);
copy_v3_v3(v3, vlr->v3->co);
- if(vlr->v4) copy_v3_v3(v4, vlr->v4->co);
+ if (vlr->v4) copy_v3_v3(v4, vlr->v4->co);
- if(obi->flag & R_TRANSFORMED) {
+ if (obi->flag & R_TRANSFORMED) {
mul_m4_v3(obi->mat, v1);
mul_m4_v3(obi->mat, v2);
mul_m4_v3(obi->mat, v3);
- if(vlr->v4) mul_m4_v3(obi->mat, v4);
+ if (vlr->v4) mul_m4_v3(obi->mat, v4);
}
/* todo: correct area for instances */
- if(vlr->v4)
+ if (vlr->v4)
*area= area_quad_v3(v1, v2, v3, v4);
else
*area= area_tri_v3(v1, v2, v3);
@@ -367,33 +367,33 @@ static void occ_sum_occlusion(OcclusionTree *tree, OccNode *node)
occ= 0.0f;
totarea= 0.0f;
- if(indirect) zero_v3(rad);
+ if (indirect) zero_v3(rad);
- for(b=0; b<TOTCHILD; b++) {
- if(node->childflag & (1<<b)) {
+ for (b=0; b<TOTCHILD; b++) {
+ if (node->childflag & (1<<b)) {
a= node->child[b].face;
occ_face(&tree->face[a], 0, 0, &area);
occ += area*tree->occlusion[a];
- if(indirect) madd_v3_v3fl(rad, tree->rad[a], area);
+ if (indirect) madd_v3_v3fl(rad, tree->rad[a], area);
totarea += area;
}
- else if(node->child[b].node) {
+ else if (node->child[b].node) {
child= node->child[b].node;
occ_sum_occlusion(tree, child);
occ += child->area*child->occlusion;
- if(indirect) madd_v3_v3fl(rad, child->rad, child->area);
+ if (indirect) madd_v3_v3fl(rad, child->rad, child->area);
totarea += child->area;
}
}
- if(totarea != 0.0f) {
+ if (totarea != 0.0f) {
occ /= totarea;
- if(indirect) mul_v3_fl(rad, 1.0f/totarea);
+ if (indirect) mul_v3_fl(rad, 1.0f/totarea);
}
node->occlusion= occ;
- if(indirect) copy_v3_v3(node->rad, rad);
+ if (indirect) copy_v3_v3(node->rad, rad);
}
static int occ_find_bbox_axis(OcclusionTree *tree, int begin, int end, float *min, float *max)
@@ -403,13 +403,14 @@ static int occ_find_bbox_axis(OcclusionTree *tree, int begin, int end, float *mi
INIT_MINMAX(min, max);
- for(a=begin; a<end; a++)
- DO_MINMAX(tree->co[a], min, max)
+ for (a = begin; a < end; a++) {
+ DO_MINMAX(tree->co[a], min, max);
+ }
- for(a=0; a<3; a++) {
+ for (a=0; a<3; a++) {
len= max[a] - min[a];
- if(len > maxlen) {
+ if (len > maxlen) {
maxlen= len;
axis= a;
}
@@ -430,13 +431,13 @@ static void occ_node_from_face(OccFace *face, OccNode *node)
static void occ_build_dco(OcclusionTree *tree, OccNode *node, const float co[3], float *dco)
{
int b;
- for(b=0; b<TOTCHILD; b++) {
+ for (b=0; b<TOTCHILD; b++) {
float dist, d[3], nco[3];
- if(node->childflag & (1<<b)) {
+ if (node->childflag & (1<<b)) {
occ_face(tree->face+node->child[b].face, nco, NULL, NULL);
}
- else if(node->child[b].node) {
+ else if (node->child[b].node) {
OccNode *child= node->child[b].node;
occ_build_dco(tree, child, co, dco);
copy_v3_v3(nco, child->co);
@@ -447,7 +448,7 @@ static void occ_build_dco(OcclusionTree *tree, OccNode *node, const float co[3],
sub_v3_v3v3(d, nco, co);
dist= dot_v3v3(d, d);
- if(dist > *dco)
+ if (dist > *dco)
*dco= dist;
}
}
@@ -465,8 +466,8 @@ static void occ_build_split(OcclusionTree *tree, int begin, int end, int *split)
a= begin;
enda= end;
- while(a<enda) {
- if(tree->co[a][axis] > mid) {
+ while (a<enda) {
+ if (tree->co[a][axis] > mid) {
enda--;
SWAP(OccFace, tree->face[a], tree->face[enda]);
SWAP(float, tree->co[a][0], tree->co[enda][0]);
@@ -488,7 +489,7 @@ static void occ_build_8_split(OcclusionTree *tree, int begin, int end, int *offs
occ_build_split(tree, begin, end, &splitx);
/* force split if none found, to deal with degenerate geometry */
- if(splitx == begin || splitx == end)
+ if (splitx == begin || splitx == end)
splitx= (begin+end)/2;
occ_build_split(tree, begin, splitx, &splity[0]);
@@ -508,7 +509,7 @@ static void occ_build_8_split(OcclusionTree *tree, int begin, int end, int *offs
offset[6]= splity[1];
offset[7]= splitz[3];
- for(b=0; b<7; b++)
+ for (b=0; b<7; b++)
count[b]= offset[b+1] - offset[b];
count[7]= end - offset[7];
}
@@ -536,8 +537,8 @@ static void occ_build_recursive(OcclusionTree *tree, OccNode *node, int begin, i
node->occlusion= 1.0f;
/* leaf node with only children */
- if(end - begin <= TOTCHILD) {
- for(a=begin, b=0; a<end; a++, b++) {
+ if (end - begin <= TOTCHILD) {
+ for (a=begin, b=0; a<end; a++, b++) {
/* face= &tree->face[a]; */
node->child[b].face= a;
node->childflag |= (1<<b);
@@ -547,33 +548,33 @@ static void occ_build_recursive(OcclusionTree *tree, OccNode *node, int begin, i
/* order faces */
occ_build_8_split(tree, begin, end, offset, count);
- if(depth == 1 && tree->dothreadedbuild)
+ if (depth == 1 && tree->dothreadedbuild)
BLI_init_threads(&threads, exec_occ_build, tree->totbuildthread);
- for(b=0; b<TOTCHILD; b++) {
- if(count[b] == 0) {
+ for (b=0; b<TOTCHILD; b++) {
+ if (count[b] == 0) {
node->child[b].node= NULL;
}
- else if(count[b] == 1) {
+ else if (count[b] == 1) {
/* face= &tree->face[offset[b]]; */
node->child[b].face= offset[b];
node->childflag |= (1<<b);
}
else {
- if(tree->dothreadedbuild)
+ if (tree->dothreadedbuild)
BLI_lock_thread(LOCK_CUSTOM1);
child= BLI_memarena_alloc(tree->arena, sizeof(OccNode));
node->child[b].node= child;
/* keep track of maximum depth for stack */
- if(depth+1 > tree->maxdepth)
+ if (depth+1 > tree->maxdepth)
tree->maxdepth= depth+1;
- if(tree->dothreadedbuild)
+ if (tree->dothreadedbuild)
BLI_unlock_thread(LOCK_CUSTOM1);
- if(depth == 1 && tree->dothreadedbuild) {
+ if (depth == 1 && tree->dothreadedbuild) {
othreads[totthread].tree= tree;
othreads[totthread].node= child;
othreads[totthread].begin= offset[b];
@@ -587,13 +588,13 @@ static void occ_build_recursive(OcclusionTree *tree, OccNode *node, int begin, i
}
}
- if(depth == 1 && tree->dothreadedbuild)
+ if (depth == 1 && tree->dothreadedbuild)
BLI_end_threads(&threads);
}
/* combine area, position and sh */
- for(b=0; b<TOTCHILD; b++) {
- if(node->childflag & (1<<b)) {
+ for (b=0; b<TOTCHILD; b++) {
+ if (node->childflag & (1<<b)) {
child= &tmpnode;
occ_node_from_face(tree->face+node->child[b].face, &tmpnode);
}
@@ -601,19 +602,19 @@ static void occ_build_recursive(OcclusionTree *tree, OccNode *node, int begin, i
child= node->child[b].node;
}
- if(child) {
+ if (child) {
node->area += child->area;
sh_add(node->sh, node->sh, child->sh);
madd_v3_v3fl(node->co, child->co, child->area);
}
}
- if(node->area != 0.0f)
+ if (node->area != 0.0f)
mul_v3_fl(node->co, 1.0f/node->area);
/* compute maximum distance from center */
node->dco= 0.0f;
- if(node->area > 0.0f)
+ if (node->area > 0.0f)
occ_build_dco(tree, node, node->co, &node->dco);
}
@@ -623,12 +624,12 @@ static void occ_build_sh_normalize(OccNode *node)
* we can clamp the dot product and then mutliply by area */
int b;
- if(node->area != 0.0f)
+ if (node->area != 0.0f)
sh_mul(node->sh, 1.0f/node->area);
- for(b=0; b<TOTCHILD; b++) {
- if(node->childflag & (1<<b));
- else if(node->child[b].node)
+ for (b=0; b<TOTCHILD; b++) {
+ if (node->childflag & (1<<b));
+ else if (node->child[b].node)
occ_build_sh_normalize(node->child[b].node);
}
}
@@ -644,20 +645,20 @@ static OcclusionTree *occ_tree_build(Render *re)
/* count */
totface= 0;
- for(obi=re->instancetable.first; obi; obi=obi->next) {
+ for (obi=re->instancetable.first; obi; obi=obi->next) {
obr= obi->obr;
- for(a=0; a<obr->totvlak; a++) {
- if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
+ for (a=0; a<obr->totvlak; a++) {
+ if ((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
else vlr++;
ma= vlr->mat;
- if((ma->shade_flag & MA_APPROX_OCCLUSION) && (ma->material_type == MA_TYPE_SURFACE))
+ if ((ma->shade_flag & MA_APPROX_OCCLUSION) && (ma->material_type == MA_TYPE_SURFACE))
totface++;
}
}
- if(totface == 0)
+ if (totface == 0)
return NULL;
tree= MEM_callocN(sizeof(OcclusionTree), "OcclusionTree");
@@ -672,26 +673,26 @@ static OcclusionTree *occ_tree_build(Render *re)
tree->arena= BLI_memarena_new(0x8000 * sizeof(OccNode), "occ tree arena");
BLI_memarena_use_calloc(tree->arena);
- if(re->wrld.aomode & WO_AOCACHE)
+ if (re->wrld.aomode & WO_AOCACHE)
tree->cache= MEM_callocN(sizeof(OcclusionCache)*BLENDER_MAX_THREADS, "OcclusionCache");
tree->face= MEM_callocN(sizeof(OccFace)*totface, "OcclusionFace");
tree->co= MEM_callocN(sizeof(float)*3*totface, "OcclusionCo");
tree->occlusion= MEM_callocN(sizeof(float)*totface, "OcclusionOcclusion");
- if(tree->doindirect)
+ if (tree->doindirect)
tree->rad= MEM_callocN(sizeof(float)*3*totface, "OcclusionRad");
/* make array of face pointers */
- for(b=0, c=0, obi=re->instancetable.first; obi; obi=obi->next, c++) {
+ for (b=0, c=0, obi=re->instancetable.first; obi; obi=obi->next, c++) {
obr= obi->obr;
- for(a=0; a<obr->totvlak; a++) {
- if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
+ for (a=0; a<obr->totvlak; a++) {
+ if ((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
else vlr++;
ma= vlr->mat;
- if((ma->shade_flag & MA_APPROX_OCCLUSION) && (ma->material_type == MA_TYPE_SURFACE)) {
+ if ((ma->shade_flag & MA_APPROX_OCCLUSION) && (ma->material_type == MA_TYPE_SURFACE)) {
tree->face[b].obi= c;
tree->face[b].facenr= a;
tree->occlusion[b]= 1.0f;
@@ -710,7 +711,7 @@ static OcclusionTree *occ_tree_build(Render *re)
tree->maxdepth= 1;
occ_build_recursive(tree, tree->root, 0, totface, 1);
- if(tree->doindirect) {
+ if (tree->doindirect) {
occ_build_shade(re, tree);
occ_sum_occlusion(tree, tree->root);
}
@@ -720,7 +721,7 @@ static OcclusionTree *occ_tree_build(Render *re)
occ_build_sh_normalize(tree->root);
- for(a=0; a<BLENDER_MAX_THREADS; a++)
+ for (a=0; a<BLENDER_MAX_THREADS; a++)
tree->stack[a]= MEM_callocN(sizeof(OccNode)*TOTCHILD*(tree->maxdepth+1), "OccStack");
return tree;
@@ -730,15 +731,15 @@ static void occ_free_tree(OcclusionTree *tree)
{
int a;
- if(tree) {
- if(tree->arena) BLI_memarena_free(tree->arena);
- for(a=0; a<BLENDER_MAX_THREADS; a++)
- if(tree->stack[a])
+ if (tree) {
+ if (tree->arena) BLI_memarena_free(tree->arena);
+ for (a=0; a<BLENDER_MAX_THREADS; a++)
+ if (tree->stack[a])
MEM_freeN(tree->stack[a]);
- if(tree->occlusion) MEM_freeN(tree->occlusion);
- if(tree->cache) MEM_freeN(tree->cache);
- if(tree->face) MEM_freeN(tree->face);
- if(tree->rad) MEM_freeN(tree->rad);
+ if (tree->occlusion) MEM_freeN(tree->occlusion);
+ if (tree->cache) MEM_freeN(tree->cache);
+ if (tree->face) MEM_freeN(tree->face);
+ if (tree->rad) MEM_freeN(tree->rad);
MEM_freeN(tree);
}
}
@@ -781,20 +782,20 @@ static int occ_visible_quad(float *p, const float n[3], const float v0[3], const
sd[1]= dot_v3v3(n, v1) - c;
sd[2]= dot_v3v3(n, v2) - c;
- if(fabsf(sd[0]) < epsilon) sd[0] = 0.0f;
- if(fabsf(sd[1]) < epsilon) sd[1] = 0.0f;
- if(fabsf(sd[2]) < epsilon) sd[2] = 0.0f;
+ if (fabsf(sd[0]) < epsilon) sd[0] = 0.0f;
+ if (fabsf(sd[1]) < epsilon) sd[1] = 0.0f;
+ if (fabsf(sd[2]) < epsilon) sd[2] = 0.0f;
- if(sd[0] > 0) {
- if(sd[1] > 0) {
- if(sd[2] > 0) {
+ if (sd[0] > 0) {
+ if (sd[1] > 0) {
+ if (sd[2] > 0) {
// +++
copy_v3_v3(q0, v0);
copy_v3_v3(q1, v1);
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// ++-
copy_v3_v3(q0, v0);
copy_v3_v3(q1, v1);
@@ -809,15 +810,15 @@ static int occ_visible_quad(float *p, const float n[3], const float v0[3], const
copy_v3_v3(q3, q2);
}
}
- else if(sd[1] < 0) {
- if(sd[2] > 0) {
+ else if (sd[1] < 0) {
+ if (sd[2] > 0) {
// +-+
copy_v3_v3(q0, v0);
VecAddDir(q1, v0, v1, (sd[0]/(sd[0]-sd[1])));
VecAddDir(q2, v1, v2, (sd[1]/(sd[1]-sd[2])));
copy_v3_v3(q3, v2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// +--
copy_v3_v3(q0, v0);
VecAddDir(q1, v0, v1, (sd[0]/(sd[0]-sd[1])));
@@ -833,14 +834,14 @@ static int occ_visible_quad(float *p, const float n[3], const float v0[3], const
}
}
else {
- if(sd[2] > 0) {
+ if (sd[2] > 0) {
// +0+
copy_v3_v3(q0, v0);
copy_v3_v3(q1, v1);
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// +0-
copy_v3_v3(q0, v0);
copy_v3_v3(q1, v1);
@@ -856,16 +857,16 @@ static int occ_visible_quad(float *p, const float n[3], const float v0[3], const
}
}
}
- else if(sd[0] < 0) {
- if(sd[1] > 0) {
- if(sd[2] > 0) {
+ else if (sd[0] < 0) {
+ if (sd[1] > 0) {
+ if (sd[2] > 0) {
// -++
VecAddDir(q0, v0, v1, (sd[0]/(sd[0]-sd[1])));
copy_v3_v3(q1, v1);
copy_v3_v3(q2, v2);
VecAddDir(q3, v0, v2, (sd[0]/(sd[0]-sd[2])));
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// -+-
VecAddDir(q0, v0, v1, (sd[0]/(sd[0]-sd[1])));
copy_v3_v3(q1, v1);
@@ -880,15 +881,15 @@ static int occ_visible_quad(float *p, const float n[3], const float v0[3], const
copy_v3_v3(q3, q2);
}
}
- else if(sd[1] < 0) {
- if(sd[2] > 0) {
+ else if (sd[1] < 0) {
+ if (sd[2] > 0) {
// --+
VecAddDir(q0, v0, v2, (sd[0]/(sd[0]-sd[2])));
VecAddDir(q1, v1, v2, (sd[1]/(sd[1]-sd[2])));
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// ---
return 0;
}
@@ -898,14 +899,14 @@ static int occ_visible_quad(float *p, const float n[3], const float v0[3], const
}
}
else {
- if(sd[2] > 0) {
+ if (sd[2] > 0) {
// -0+
VecAddDir(q0, v0, v2, (sd[0]/(sd[0]-sd[2])));
copy_v3_v3(q1, v1);
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// -0-
return 0;
}
@@ -916,15 +917,15 @@ static int occ_visible_quad(float *p, const float n[3], const float v0[3], const
}
}
else {
- if(sd[1] > 0) {
- if(sd[2] > 0) {
+ if (sd[1] > 0) {
+ if (sd[2] > 0) {
// 0++
copy_v3_v3(q0, v0);
copy_v3_v3(q1, v1);
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// 0+-
copy_v3_v3(q0, v0);
copy_v3_v3(q1, v1);
@@ -939,15 +940,15 @@ static int occ_visible_quad(float *p, const float n[3], const float v0[3], const
copy_v3_v3(q3, q2);
}
}
- else if(sd[1] < 0) {
- if(sd[2] > 0) {
+ else if (sd[1] < 0) {
+ if (sd[2] > 0) {
// 0-+
copy_v3_v3(q0, v0);
VecAddDir(q1, v1, v2, (sd[1]/(sd[1]-sd[2])));
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// 0--
return 0;
}
@@ -957,14 +958,14 @@ static int occ_visible_quad(float *p, const float n[3], const float v0[3], const
}
}
else {
- if(sd[2] > 0) {
+ if (sd[2] > 0) {
// 00+
copy_v3_v3(q0, v0);
copy_v3_v3(q1, v1);
copy_v3_v3(q2, v2);
copy_v3_v3(q3, q2);
}
- else if(sd[2] < 0) {
+ else if (sd[2] < 0) {
// 00-
return 0;
}
@@ -990,20 +991,20 @@ typedef union {
static vFloat vec_splat_float(float val)
{
- return (vFloat){val, val, val, val};
+ return (vFloat) {val, val, val, val};
}
static float occ_quad_form_factor(float *p, float *n, float *q0, float *q1, float *q2, float *q3)
{
vFloat vcos, rlen, vrx, vry, vrz, vsrx, vsry, vsrz, gx, gy, gz, vangle;
- vUInt8 rotate = (vUInt8){4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3};
+ vUInt8 rotate = (vUInt8) {4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3};
vFloatResult vresult;
float result;
/* compute r* */
- vrx = (vFloat){q0[0], q1[0], q2[0], q3[0]} - vec_splat_float(p[0]);
- vry = (vFloat){q0[1], q1[1], q2[1], q3[1]} - vec_splat_float(p[1]);
- vrz = (vFloat){q0[2], q1[2], q2[2], q3[2]} - vec_splat_float(p[2]);
+ vrx = (vFloat) {q0[0], q1[0], q2[0], q3[0]} - vec_splat_float(p[0]);
+ vry = (vFloat) {q0[1], q1[1], q2[1], q3[1]} - vec_splat_float(p[1]);
+ vrz = (vFloat) {q0[2], q1[2], q2[2], q3[2]} - vec_splat_float(p[2]);
/* normalize r* */
rlen = vec_rsqrte(vrx*vrx + vry*vry + vrz*vrz + vec_splat_float(1e-16f));
@@ -1119,7 +1120,7 @@ static void normalizef(float *n)
d= dot_v3v3(n, n);
- if(d > 1.0e-35F) {
+ if (d > 1.0e-35F) {
d= 1.0f/sqrtf(d);
n[0] *= d;
@@ -1177,21 +1178,21 @@ static float occ_form_factor(OccFace *face, float *p, float *n)
copy_v3_v3(v2, vlr->v2->co);
copy_v3_v3(v3, vlr->v3->co);
- if(obi->flag & R_TRANSFORMED) {
+ if (obi->flag & R_TRANSFORMED) {
mul_m4_v3(obi->mat, v1);
mul_m4_v3(obi->mat, v2);
mul_m4_v3(obi->mat, v3);
}
- if(occ_visible_quad(p, n, v1, v2, v3, q0, q1, q2, q3))
+ if (occ_visible_quad(p, n, v1, v2, v3, q0, q1, q2, q3))
contrib += occ_quad_form_factor(p, n, q0, q1, q2, q3);
- if(vlr->v4) {
+ if (vlr->v4) {
copy_v3_v3(v4, vlr->v4->co);
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mul_m4_v3(obi->mat, v4);
- if(occ_visible_quad(p, n, v1, v3, v4, q0, q1, q2, q3))
+ if (occ_visible_quad(p, n, v1, v3, v4, q0, q1, q2, q3))
contrib += occ_quad_form_factor(p, n, q0, q1, q2, q3);
}
@@ -1211,7 +1212,7 @@ static void occ_lookup(OcclusionTree *tree, int thread, OccFace *exclude, float
copy_v3_v3(n, pn);
madd_v3_v3fl(p, n, 1e-4f);
- if(bentn)
+ if (bentn)
copy_v3_v3(bentn, n);
error= tree->error;
@@ -1225,7 +1226,7 @@ static void occ_lookup(OcclusionTree *tree, int thread, OccFace *exclude, float
stack[0]= tree->root;
totstack= 1;
- while(totstack) {
+ while (totstack) {
/* pop point off the stack */
node= stack[--totstack];
@@ -1233,10 +1234,10 @@ static void occ_lookup(OcclusionTree *tree, int thread, OccFace *exclude, float
d2= dot_v3v3(v, v) + 1e-16f;
emitarea= MAX2(node->area, node->dco);
- if(d2*error > emitarea) {
- if(distfac != 0.0f) {
+ if (d2*error > emitarea) {
+ if (distfac != 0.0f) {
fac= 1.0f/(1.0f + distfac*d2);
- if(fac < 0.01f)
+ if (fac < 0.01f)
continue;
}
else
@@ -1246,12 +1247,12 @@ static void occ_lookup(OcclusionTree *tree, int thread, OccFace *exclude, float
invd2 = 1.0f/sqrtf(d2);
weight= occ_solid_angle(node, v, d2, invd2, n);
- if(rad)
+ if (rad)
madd_v3_v3fl(resultrad, node->rad, weight*fac);
weight *= node->occlusion;
- if(bentn) {
+ if (bentn) {
bentn[0] -= weight*invd2*v[0];
bentn[1] -= weight*invd2*v[1];
bentn[2] -= weight*invd2*v[2];
@@ -1261,20 +1262,20 @@ static void occ_lookup(OcclusionTree *tree, int thread, OccFace *exclude, float
}
else {
/* traverse into children */
- for(b=0; b<TOTCHILD; b++) {
- if(node->childflag & (1<<b)) {
+ for (b=0; b<TOTCHILD; b++) {
+ if (node->childflag & (1<<b)) {
f= node->child[b].face;
face= &tree->face[f];
/* accumulate occlusion with face form factor */
- if(!exclude || !(face->obi == exclude->obi && face->facenr == exclude->facenr)) {
- if(bentn || distfac != 0.0f) {
+ if (!exclude || !(face->obi == exclude->obi && face->facenr == exclude->facenr)) {
+ if (bentn || distfac != 0.0f) {
occ_face(face, co, NULL, NULL);
sub_v3_v3v3(v, co, p);
d2= dot_v3v3(v, v) + 1e-16f;
fac= (distfac == 0.0f)? 1.0f: 1.0f/(1.0f + distfac*d2);
- if(fac < 0.01f)
+ if (fac < 0.01f)
continue;
}
else
@@ -1282,12 +1283,12 @@ static void occ_lookup(OcclusionTree *tree, int thread, OccFace *exclude, float
weight= occ_form_factor(face, p, n);
- if(rad)
+ if (rad)
madd_v3_v3fl(resultrad, tree->rad[f], weight*fac);
weight *= tree->occlusion[f];
- if(bentn) {
+ if (bentn) {
invd2= 1.0f/sqrtf(d2);
bentn[0] -= weight*invd2*v[0];
bentn[1] -= weight*invd2*v[1];
@@ -1297,7 +1298,7 @@ static void occ_lookup(OcclusionTree *tree, int thread, OccFace *exclude, float
resultocc += weight*fac;
}
}
- else if(node->child[b].node) {
+ else if (node->child[b].node) {
/* push child on the stack */
stack[totstack++]= node->child[b].node;
}
@@ -1305,15 +1306,17 @@ 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 (occ) *occ= resultocc;
+ if (rad) copy_v3_v3(rad, resultrad);
+#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))
+ 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]);
- }*/
- if(bentn) normalize_v3(bentn);
+ }
+#endif
+ if (bentn) normalize_v3(bentn);
}
static void occ_compute_bounces(Render *re, OcclusionTree *tree, int totbounce)
@@ -1324,8 +1327,8 @@ static void occ_compute_bounces(Render *re, OcclusionTree *tree, int totbounce)
rad= MEM_callocN(sizeof(float)*3*tree->totface, "OcclusionBounceRad");
sum= MEM_dupallocN(tree->rad);
- for(bounce=1; bounce<totbounce; bounce++) {
- for(i=0; i<tree->totface; i++) {
+ for (bounce=1; bounce<totbounce; bounce++) {
+ for (i=0; i<tree->totface; i++) {
occ_face(&tree->face[i], co, n, NULL);
madd_v3_v3fl(co, n, 1e-8f);
@@ -1335,11 +1338,11 @@ static void occ_compute_bounces(Render *re, OcclusionTree *tree, int totbounce)
rad[i][2]= MAX2(rad[i][2], 0.0f);
add_v3_v3(sum[i], rad[i]);
- if(re->test_break(re->tbh))
+ if (re->test_break(re->tbh))
break;
}
- if(re->test_break(re->tbh))
+ if (re->test_break(re->tbh))
break;
tmp= tree->rad;
@@ -1353,7 +1356,7 @@ static void occ_compute_bounces(Render *re, OcclusionTree *tree, int totbounce)
MEM_freeN(tree->rad);
tree->rad= sum;
- if(!re->test_break(re->tbh))
+ if (!re->test_break(re->tbh))
occ_sum_occlusion(tree, tree->root);
}
@@ -1364,23 +1367,23 @@ static void occ_compute_passes(Render *re, OcclusionTree *tree, int totpass)
occ= MEM_callocN(sizeof(float)*tree->totface, "OcclusionPassOcc");
- for(pass=0; pass<totpass; pass++) {
- for(i=0; i<tree->totface; i++) {
+ for (pass=0; pass<totpass; pass++) {
+ for (i=0; i<tree->totface; i++) {
occ_face(&tree->face[i], co, n, NULL);
negate_v3(n);
madd_v3_v3fl(co, n, 1e-8f);
occ_lookup(tree, 0, &tree->face[i], co, n, &occ[i], NULL, NULL);
- if(re->test_break(re->tbh))
+ if (re->test_break(re->tbh))
break;
}
- if(re->test_break(re->tbh))
+ if (re->test_break(re->tbh))
break;
- for(i=0; i<tree->totface; i++) {
+ for (i=0; i<tree->totface; i++) {
tree->occlusion[i] -= occ[i]; //MAX2(1.0f-occ[i], 0.0f);
- if(tree->occlusion[i] < 0.0f)
+ if (tree->occlusion[i] < 0.0f)
tree->occlusion[i]= 0.0f;
}
@@ -1396,7 +1399,7 @@ static void sample_occ_tree(Render *re, OcclusionTree *tree, OccFace *exclude, f
int envcolor;
envcolor= re->wrld.aocolor;
- if(onlyshadow)
+ if (onlyshadow)
envcolor= WO_AOPLAIN;
negate_v3_v3(nn, n);
@@ -1407,12 +1410,12 @@ static void sample_occ_tree(Render *re, OcclusionTree *tree, OccFace *exclude, f
occlusion= (1.0f-correction)*(1.0f-occ);
CLAMP(occlusion, 0.0f, 1.0f);
- if(correction != 0.0f)
+ if (correction != 0.0f)
occlusion += correction*expf(-occ);
- if(env) {
+ if (env) {
/* sky shading using bent normal */
- if(ELEM(envcolor, WO_AOSKYCOL, WO_AOSKYTEX)) {
+ if (ELEM(envcolor, WO_AOSKYCOL, WO_AOSKYTEX)) {
fac= 0.5f * (1.0f + dot_v3v3(bn, re->grvec));
env[0]= (1.0f-fac)*re->wrld.horr + fac*re->wrld.zenr;
env[1]= (1.0f-fac)*re->wrld.horg + fac*re->wrld.zeng;
@@ -1439,13 +1442,13 @@ static void sample_occ_tree(Render *re, OcclusionTree *tree, OccFace *exclude, f
#endif
}
- if(ao) {
+ if (ao) {
ao[0]= occlusion;
ao[1]= occlusion;
ao[2]= occlusion;
}
- if(tree->doindirect) copy_v3_v3(indirect, rad);
+ if (tree->doindirect) copy_v3_v3(indirect, rad);
else zero_v3(indirect);
}
@@ -1461,7 +1464,7 @@ static OcclusionCacheSample *find_occ_sample(OcclusionCache *cache, int x, int y
x *= cache->step;
y *= cache->step;
- if(x < 0 || x >= cache->w || y < 0 || y >= cache->h)
+ if (x < 0 || x >= cache->w || y < 0 || y >= cache->h)
return NULL;
else
return &cache->sample[y*cache->w + x];
@@ -1475,18 +1478,18 @@ static int sample_occ_cache(OcclusionTree *tree, float *co, float *n, int x, int
float d[3], dist2;
int i, x1, y1, x2, y2;
- if(!tree->cache)
+ if (!tree->cache)
return 0;
/* first try to find a sample in the same pixel */
cache= &tree->cache[thread];
- if(cache->sample && cache->step) {
+ if (cache->sample && cache->step) {
sample= &cache->sample[(y-cache->y)*cache->w + (x-cache->x)];
- if(sample->filled) {
+ if (sample->filled) {
sub_v3_v3v3(d, sample->co, co);
dist2= dot_v3v3(d, d);
- if(dist2 < 0.5f*sample->dist2 && dot_v3v3(sample->n, n) > 0.98f) {
+ if (dist2 < 0.5f*sample->dist2 && dot_v3v3(sample->n, n) > 0.98f) {
copy_v3_v3(ao, sample->ao);
copy_v3_v3(env, sample->env);
copy_v3_v3(indirect, sample->indirect);
@@ -1497,21 +1500,21 @@ static int sample_occ_cache(OcclusionTree *tree, float *co, float *n, int x, int
else
return 0;
- /* try to interpolate between 4 neighbouring pixels */
+ /* try to interpolate between 4 neighboring pixels */
samples[0]= find_occ_sample(cache, x, y);
samples[1]= find_occ_sample(cache, x+cache->step, y);
samples[2]= find_occ_sample(cache, x, y+cache->step);
samples[3]= find_occ_sample(cache, x+cache->step, y+cache->step);
- for(i=0; i<4; i++)
- if(!samples[i] || !samples[i]->filled)
+ for (i=0; i<4; i++)
+ if (!samples[i] || !samples[i]->filled)
return 0;
/* require intensities not being too different */
mino= MIN4(samples[0]->intensity, samples[1]->intensity, samples[2]->intensity, samples[3]->intensity);
maxo= MAX4(samples[0]->intensity, samples[1]->intensity, samples[2]->intensity, samples[3]->intensity);
- if(maxo - mino > 0.05f)
+ if (maxo - mino > 0.05f)
return 0;
/* compute weighted interpolation between samples */
@@ -1533,7 +1536,7 @@ static int sample_occ_cache(OcclusionTree *tree, float *co, float *n, int x, int
wb[1]= (1.0f-tx)*(ty);
wb[0]= tx*ty;
- for(i=0; i<4; i++) {
+ for (i=0; i<4; i++) {
sub_v3_v3v3(d, samples[i]->co, co);
//dist2= dot_v3v3(d, d);
@@ -1548,7 +1551,7 @@ static int sample_occ_cache(OcclusionTree *tree, float *co, float *n, int x, int
madd_v3_v3fl(indirect, samples[i]->indirect, w);
}
- if(totw >= 0.9f) {
+ if (totw >= 0.9f) {
totw= 1.0f/totw;
mul_v3_fl(ao, totw);
mul_v3_fl(env, totw);
@@ -1566,7 +1569,7 @@ static void sample_occ_surface(ShadeInput *shi)
int *face, *index = RE_strandren_get_face(shi->obr, strand, 0);
float w[4], *co1, *co2, *co3, *co4;
- if(mesh && mesh->face && mesh->co && mesh->ao && index) {
+ if (mesh && mesh->face && mesh->co && mesh->ao && index) {
face= mesh->face[*index];
co1= mesh->co[face[0]];
@@ -1589,7 +1592,7 @@ static void sample_occ_surface(ShadeInput *shi)
madd_v3_v3fl(shi->ao, mesh->ao[face[2]], w[2]);
madd_v3_v3fl(shi->env, mesh->env[face[2]], w[2]);
madd_v3_v3fl(shi->indirect, mesh->indirect[face[2]], w[2]);
- if(face[3]) {
+ if (face[3]) {
madd_v3_v3fl(shi->ao, mesh->ao[face[3]], w[3]);
madd_v3_v3fl(shi->env, mesh->env[face[3]], w[3]);
madd_v3_v3fl(shi->indirect, mesh->indirect[face[3]], w[3]);
@@ -1614,13 +1617,13 @@ static void *exec_strandsurface_sample(void *data)
float ao[3], env[3], indirect[3], co[3], n[3], *co1, *co2, *co3, *co4;
int a, *face;
- for(a=othread->begin; a<othread->end; a++) {
+ for (a=othread->begin; a<othread->end; a++) {
face= mesh->face[a];
co1= mesh->co[face[0]];
co2= mesh->co[face[1]];
co3= mesh->co[face[2]];
- if(face[3]) {
+ if (face[3]) {
co4= mesh->co[face[3]];
mid_v3_v3v3(co, co1, co3);
@@ -1658,14 +1661,14 @@ void make_occ_tree(Render *re)
re->occlusiontree= tree= occ_tree_build(re);
- if(tree) {
- if(re->wrld.ao_approx_passes > 0)
+ if (tree) {
+ if (re->wrld.ao_approx_passes > 0)
occ_compute_passes(re, tree, re->wrld.ao_approx_passes);
- if(tree->doindirect && (re->wrld.mode & WO_INDIRECT_LIGHT))
+ if (tree->doindirect && (re->wrld.mode & WO_INDIRECT_LIGHT))
occ_compute_bounces(re, tree, re->wrld.ao_indirect_bounces);
- for(mesh=re->strandsurface.first; mesh; mesh=mesh->next) {
- if(!mesh->face || !mesh->co || !mesh->ao)
+ for (mesh=re->strandsurface.first; mesh; mesh=mesh->next) {
+ if (!mesh->face || !mesh->co || !mesh->ao)
continue;
count= MEM_callocN(sizeof(int)*mesh->totvert, "OcclusionCount");
@@ -1675,7 +1678,7 @@ void make_occ_tree(Render *re)
totthread= (mesh->totface > 10000)? re->r.threads: 1;
totface= mesh->totface/totthread;
- for(a=0; a<totthread; a++) {
+ for (a=0; a<totthread; a++) {
othreads[a].re= re;
othreads[a].faceao= faceao;
othreads[a].faceenv= faceenv;
@@ -1686,19 +1689,19 @@ void make_occ_tree(Render *re)
othreads[a].end= (a == totthread-1)? mesh->totface: (a+1)*totface;
}
- if(totthread == 1) {
+ if (totthread == 1) {
exec_strandsurface_sample(&othreads[0]);
}
else {
BLI_init_threads(&threads, exec_strandsurface_sample, totthread);
- for(a=0; a<totthread; a++)
+ for (a=0; a<totthread; a++)
BLI_insert_thread(&threads, &othreads[a]);
BLI_end_threads(&threads);
}
- for(a=0; a<mesh->totface; a++) {
+ for (a=0; a<mesh->totface; a++) {
face= mesh->face[a];
copy_v3_v3(ao, faceao[a]);
@@ -1718,7 +1721,7 @@ void make_occ_tree(Render *re)
add_v3_v3(mesh->indirect[face[2]], indirect);
count[face[2]]++;
- if(face[3]) {
+ if (face[3]) {
add_v3_v3(mesh->ao[face[3]], ao);
add_v3_v3(mesh->env[face[3]], env);
add_v3_v3(mesh->indirect[face[3]], indirect);
@@ -1726,8 +1729,8 @@ void make_occ_tree(Render *re)
}
}
- for(a=0; a<mesh->totvert; a++) {
- if(count[a]) {
+ for (a=0; a<mesh->totvert; a++) {
+ if (count[a]) {
mul_v3_fl(mesh->ao[a], 1.0f/count[a]);
mul_v3_fl(mesh->env[a], 1.0f/count[a]);
mul_v3_fl(mesh->indirect[a], 1.0f/count[a]);
@@ -1744,7 +1747,7 @@ void make_occ_tree(Render *re)
void free_occ(Render *re)
{
- if(re->occlusiontree) {
+ if (re->occlusiontree) {
occ_free_tree(re->occlusiontree);
re->occlusiontree = NULL;
}
@@ -1758,12 +1761,12 @@ void sample_occ(Render *re, ShadeInput *shi)
OccFace exclude;
int onlyshadow;
- if(tree) {
- if(shi->strand) {
+ if (tree) {
+ if (shi->strand) {
sample_occ_surface(shi);
}
/* try to get result from the cache if possible */
- else if(shi->depth!=0 || !sample_occ_cache(tree, shi->co, shi->vno, shi->xs, shi->ys, shi->thread, shi->ao, shi->env, shi->indirect)) {
+ else if (shi->depth!=0 || !sample_occ_cache(tree, shi->co, shi->vno, shi->xs, shi->ys, shi->thread, shi->ao, shi->env, shi->indirect)) {
/* no luck, let's sample the occlusion */
exclude.obi= shi->obi - re->objectinstance;
exclude.facenr= shi->vlr->index;
@@ -1771,10 +1774,10 @@ void sample_occ(Render *re, ShadeInput *shi)
sample_occ_tree(re, tree, &exclude, shi->co, shi->vno, shi->thread, onlyshadow, shi->ao, shi->env, shi->indirect);
/* fill result into sample, each time */
- if(tree->cache) {
+ if (tree->cache) {
cache= &tree->cache[shi->thread];
- if(cache->sample && cache->step) {
+ if (cache->sample && cache->step) {
sample= &cache->sample[(shi->ys-cache->y)*cache->w + (shi->xs-cache->x)];
copy_v3_v3(sample->co, shi->co);
copy_v3_v3(sample->n, shi->vno);
@@ -1817,7 +1820,7 @@ void cache_occ_samples(Render *re, RenderPart *pa, ShadeSample *ssamp)
int *ro=NULL, *rp=NULL, *rz=NULL, onlyshadow;
int x, y, step = CACHE_STEP;
- if(!tree->cache)
+ if (!tree->cache)
return;
cache= &tree->cache[pa->thread];
@@ -1829,7 +1832,7 @@ void cache_occ_samples(Render *re, RenderPart *pa, ShadeSample *ssamp)
cache->sample= MEM_callocN(sizeof(OcclusionCacheSample)*cache->w*cache->h, "OcclusionCacheSample");
sample= cache->sample;
- if(re->osa) {
+ if (re->osa) {
rd= pa->rectdaps;
}
else {
@@ -1843,20 +1846,20 @@ void cache_occ_samples(Render *re, RenderPart *pa, ShadeSample *ssamp)
}
/* compute a sample at every step pixels */
- for(y=pa->disprect.ymin; y<pa->disprect.ymax; y++) {
- for(x=pa->disprect.xmin; x<pa->disprect.xmax; x++, sample++, rd++, ro++, rp++, rz++) {
- if(!(((x - pa->disprect.xmin + step) % step) == 0 || x == pa->disprect.xmax-1))
+ for (y=pa->disprect.ymin; y<pa->disprect.ymax; y++) {
+ for (x=pa->disprect.xmin; x<pa->disprect.xmax; x++, sample++, rd++, ro++, rp++, rz++) {
+ if (!(((x - pa->disprect.xmin + step) % step) == 0 || x == pa->disprect.xmax-1))
continue;
- if(!(((y - pa->disprect.ymin + step) % step) == 0 || y == pa->disprect.ymax-1))
+ if (!(((y - pa->disprect.ymin + step) % step) == 0 || y == pa->disprect.ymax-1))
continue;
- if(re->osa) {
- if(!*rd) continue;
+ if (re->osa) {
+ if (!*rd) continue;
shade_samples_fill_with_ps(ssamp, (PixStr *)(*rd), x, y);
}
else {
- if(!*rp) continue;
+ if (!*rp) continue;
ps.obi= *ro;
ps.facenr= *rp;
@@ -1865,7 +1868,7 @@ void cache_occ_samples(Render *re, RenderPart *pa, ShadeSample *ssamp)
}
shi= ssamp->shi;
- if(shi->vlr) {
+ if (shi->vlr) {
onlyshadow= (shi->mat->mode & MA_ONLYSHADOW);
exclude.obi= shi->obi - re->objectinstance;
exclude.facenr= shi->vlr->index;
@@ -1885,7 +1888,7 @@ void cache_occ_samples(Render *re, RenderPart *pa, ShadeSample *ssamp)
sample->filled= 1;
}
- if(re->test_break(re->tbh))
+ if (re->test_break(re->tbh))
break;
}
}
@@ -1896,10 +1899,10 @@ void free_occ_samples(Render *re, RenderPart *pa)
OcclusionTree *tree= re->occlusiontree;
OcclusionCache *cache;
- if(tree->cache) {
+ if (tree->cache) {
cache= &tree->cache[pa->thread];
- if(cache->sample)
+ if (cache->sample)
MEM_freeN(cache->sample);
cache->w= 0;
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 100b12aa169..a4a244daf43 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -86,31 +86,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 ******** */
@@ -159,16 +158,16 @@ static void stats_background(void *UNUSED(arg), RenderStats *rs)
fprintf(stdout, "Fra:%d Mem:%.2fM (%.2fM, peak %.2fM) ", rs->cfra,
megs_used_memory, mmap_used_memory, megs_peak_memory);
- if(rs->curfield)
+ if (rs->curfield)
fprintf(stdout, "Field %d ", rs->curfield);
- if(rs->curblur)
+ if (rs->curblur)
fprintf(stdout, "Blur %d ", rs->curblur);
- if(rs->infostr) {
+ if (rs->infostr) {
fprintf(stdout, "| %s", rs->infostr);
}
else {
- if(rs->tothalo)
+ if (rs->tothalo)
fprintf(stdout, "Sce: %s Ve:%d Fa:%d Ha:%d La:%d", rs->scenename, rs->totvert, rs->totface, rs->tothalo, rs->totlamp);
else
fprintf(stdout, "Sce: %s Ve:%d Fa:%d La:%d", rs->scenename, rs->totvert, rs->totface, rs->totlamp);
@@ -189,8 +188,8 @@ float *RE_RenderLayerGetPass(RenderLayer *rl, int passtype)
{
RenderPass *rpass;
- for(rpass=rl->passes.first; rpass; rpass= rpass->next)
- if(rpass->passtype== passtype)
+ for (rpass=rl->passes.first; rpass; rpass= rpass->next)
+ if (rpass->passtype== passtype)
return rpass->rect;
return NULL;
}
@@ -199,10 +198,10 @@ RenderLayer *RE_GetRenderLayer(RenderResult *rr, const char *name)
{
RenderLayer *rl;
- if(rr==NULL) return NULL;
+ if (rr==NULL) return NULL;
- for(rl= rr->layers.first; rl; rl= rl->next)
- if(strncmp(rl->name, name, RE_MAXNAME)==0)
+ for (rl= rr->layers.first; rl; rl= rl->next)
+ if (strncmp(rl->name, name, RE_MAXNAME)==0)
return rl;
return NULL;
}
@@ -216,7 +215,7 @@ RenderLayer *render_get_active_layer(Render *re, RenderResult *rr)
{
RenderLayer *rl= BLI_findlink(&rr->layers, re->r.actlay);
- if(rl)
+ if (rl)
return rl;
else
return rr->layers.first;
@@ -226,9 +225,9 @@ static int render_scene_needs_vector(Render *re)
{
SceneRenderLayer *srl;
- for(srl= re->scene->r.layers.first; srl; srl= srl->next)
- if(!(srl->layflag & SCE_LAY_DISABLE))
- if(srl->passflag & SCE_PASS_VECTOR)
+ for (srl= re->scene->r.layers.first; srl; srl= srl->next)
+ if (!(srl->layflag & SCE_LAY_DISABLE))
+ if (srl->passflag & SCE_PASS_VECTOR)
return 1;
return 0;
@@ -241,8 +240,8 @@ Render *RE_GetRender(const char *name)
Render *re;
/* search for existing renders */
- for(re= RenderGlobal.renderlist.first; re; re= re->next)
- if(strncmp(re->name, name, RE_MAXNAME)==0)
+ for (re= RenderGlobal.renderlist.first; re; re= re->next)
+ if (strncmp(re->name, name, RE_MAXNAME)==0)
break;
return re;
@@ -251,7 +250,7 @@ Render *RE_GetRender(const char *name)
/* if you want to know exactly what has been done */
RenderResult *RE_AcquireResultRead(Render *re)
{
- if(re) {
+ if (re) {
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_READ);
return re->result;
}
@@ -261,7 +260,7 @@ RenderResult *RE_AcquireResultRead(Render *re)
RenderResult *RE_AcquireResultWrite(Render *re)
{
- if(re) {
+ if (re) {
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
return re->result;
}
@@ -272,7 +271,7 @@ RenderResult *RE_AcquireResultWrite(Render *re)
void RE_SwapResult(Render *re, RenderResult **rr)
{
/* for keeping render buffers */
- if(re) {
+ if (re) {
SWAP(RenderResult*, re->result, *rr);
}
}
@@ -280,14 +279,14 @@ void RE_SwapResult(Render *re, RenderResult **rr)
void RE_ReleaseResult(Render *re)
{
- if(re)
+ if (re)
BLI_rw_mutex_unlock(&re->resultmutex);
}
/* displist.c util.... */
Scene *RE_GetScene(Render *re)
{
- if(re)
+ if (re)
return re->scene;
return NULL;
}
@@ -297,10 +296,10 @@ void RE_AcquireResultImage(Render *re, RenderResult *rr)
{
memset(rr, 0, sizeof(RenderResult));
- if(re) {
+ if (re) {
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_READ);
- if(re->result) {
+ if (re->result) {
RenderLayer *rl;
rr->rectx= re->result->rectx;
@@ -313,10 +312,10 @@ void RE_AcquireResultImage(Render *re, RenderResult *rr)
/* active layer */
rl= render_get_active_layer(re, re->result);
- if(rl) {
- if(rr->rectf==NULL)
+ if (rl) {
+ if (rr->rectf==NULL)
rr->rectf= rl->rectf;
- if(rr->rectz==NULL)
+ if (rr->rectz==NULL)
rr->rectz= RE_RenderLayerGetPass(rl, SCE_PASS_Z);
}
@@ -328,7 +327,7 @@ void RE_AcquireResultImage(Render *re, RenderResult *rr)
void RE_ReleaseResultImage(Render *re)
{
- if(re)
+ if (re)
BLI_rw_mutex_unlock(&re->resultmutex);
}
@@ -353,7 +352,7 @@ Render *RE_NewRender(const char *name)
/* only one render per name exists */
re= RE_GetRender(name);
- if(re==NULL) {
+ if (re==NULL) {
/* new render data struct */
re= MEM_callocN(sizeof(Render), "new render");
@@ -371,7 +370,7 @@ Render *RE_NewRender(const char *name)
}
/* called for new renders and when finishing rendering so
- * we calways have valid callbacks on a render */
+ * we always have valid callbacks on a render */
void RE_InitRenderCB(Render *re)
{
/* set default empty callbacks */
@@ -380,7 +379,7 @@ void RE_InitRenderCB(Render *re)
re->display_draw= result_rcti_nothing;
re->progress= float_nothing;
re->test_break= default_break;
- if(G.background)
+ if (G.background)
re->stats_draw= stats_background;
else
re->stats_draw= stats_nothing;
@@ -406,11 +405,25 @@ void RE_FreeRender(Render *re)
/* exit blender */
void RE_FreeAllRender(void)
{
- while(RenderGlobal.renderlist.first) {
+ while (RenderGlobal.renderlist.first) {
RE_FreeRender(RenderGlobal.renderlist.first);
}
}
+/* on file load, free all re */
+void RE_FreeAllRenderResults(void)
+{
+ Render *re;
+
+ for (re = RenderGlobal.renderlist.first; re; re = re->next) {
+ render_result_free(re->result);
+ render_result_free(re->pushedresult);
+
+ re->result = NULL;
+ re->pushedresult = NULL;
+ }
+}
+
/* ********* initialize state ******** */
@@ -425,36 +438,35 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer *
re->winx= winx;
re->winy= winy;
- if(disprect) {
+ if (disprect) {
re->disprect= *disprect;
re->rectx= disprect->xmax-disprect->xmin;
re->recty= disprect->ymax-disprect->ymin;
}
else {
- re->disprect.xmin= re->disprect.ymin= 0;
- re->disprect.xmax= winx;
- re->disprect.ymax= winy;
+ re->disprect.xmin = re->disprect.ymin = 0;
+ re->disprect.xmax = winx;
+ re->disprect.ymax = winy;
re->rectx= winx;
re->recty= winy;
}
- if(re->rectx < 2 || re->recty < 2 || (BKE_imtype_is_movie(rd->im_format.imtype) &&
+ if (re->rectx < 2 || re->recty < 2 || (BKE_imtype_is_movie(rd->im_format.imtype) &&
(re->rectx < 16 || re->recty < 16) )) {
BKE_report(re->reports, RPT_ERROR, "Image too small");
re->ok= 0;
return;
}
- if((re->r.mode & (R_OSA))==0)
+ if ((re->r.mode & (R_OSA))==0)
re->r.scemode &= ~R_FULL_SAMPLE;
#ifdef WITH_OPENEXR
- if(re->r.scemode & R_FULL_SAMPLE)
+ if (re->r.scemode & R_FULL_SAMPLE)
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);
}
@@ -464,18 +476,18 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer *
#endif
/* fullsample wants uniform osa levels */
- if(source && (re->r.scemode & R_FULL_SAMPLE)) {
+ if (source && (re->r.scemode & R_FULL_SAMPLE)) {
/* but, if source has no full sample we disable it */
- if((source->r.scemode & R_FULL_SAMPLE)==0)
+ if ((source->r.scemode & R_FULL_SAMPLE)==0)
re->r.scemode &= ~R_FULL_SAMPLE;
else
re->r.osa= re->osa= source->osa;
}
else {
/* check state variables, osa? */
- if(re->r.mode & (R_OSA)) {
+ if (re->r.mode & (R_OSA)) {
re->osa= re->r.osa;
- if(re->osa>16) re->osa= 16;
+ if (re->osa>16) re->osa= 16;
}
else re->osa= 0;
}
@@ -494,8 +506,8 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer *
/* if preview render, we try to keep old result */
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
- if(re->r.scemode & R_PREVIEWBUTS) {
- if(re->result && re->result->rectx==re->rectx && re->result->recty==re->recty);
+ if (re->r.scemode & R_PREVIEWBUTS) {
+ if (re->result && re->result->rectx==re->rectx && re->result->recty==re->recty);
else {
render_result_free(re->result);
re->result= NULL;
@@ -608,7 +620,7 @@ void RE_AddObject(Render *UNUSED(re), Object *UNUSED(ob))
static int render_display_draw_enabled(Render *re)
{
/* don't show preprocess for previewrender sss */
- if(re->sss_points)
+ if (re->sss_points)
return !(re->r.scemode & R_PREVIEWBUTS);
else
return 1;
@@ -620,27 +632,27 @@ static void *do_part_thread(void *pa_v)
RenderPart *pa= pa_v;
/* need to return nicely all parts on esc */
- if(R.test_break(R.tbh)==0) {
+ if (R.test_break(R.tbh)==0) {
- if(!R.sss_points && (R.r.scemode & R_FULL_SAMPLE))
+ if (!R.sss_points && (R.r.scemode & R_FULL_SAMPLE))
pa->result= render_result_new_full_sample(&R, &pa->fullresult, &pa->disprect, pa->crop, RR_USE_MEM);
else
pa->result= render_result_new(&R, &pa->disprect, pa->crop, RR_USE_MEM);
- if(R.sss_points)
+ if (R.sss_points)
zbufshade_sss_tile(pa);
- else if(R.osa)
+ else if (R.osa)
zbufshadeDA_tile(pa);
else
zbufshade_tile(pa);
/* merge too on break! */
- if(R.result->exrhandle) {
+ if (R.result->exrhandle) {
render_result_exr_file_merge(R.result, pa->result);
}
- else if(render_display_draw_enabled(&R)) {
+ else if (render_display_draw_enabled(&R)) {
/* on break, don't merge in result for preview renders, looks nicer */
- if(R.test_break(R.tbh) && (R.r.scemode & R_PREVIEWBUTS));
+ if (R.test_break(R.tbh) && (R.r.scemode & R_PREVIEWBUTS));
else render_result_merge(R.result, pa->result);
}
}
@@ -684,16 +696,16 @@ static RenderPart *find_next_pano_slice(Render *re, int *minx, rctf *viewplane)
*minx= re->winx;
/* most left part of the non-rendering parts */
- for(pa= re->parts.first; pa; pa= pa->next) {
- if(pa->ready==0 && pa->nr==0) {
- if(pa->disprect.xmin < *minx) {
+ for (pa= re->parts.first; pa; pa= pa->next) {
+ if (pa->ready==0 && pa->nr==0) {
+ if (pa->disprect.xmin < *minx) {
best= pa;
*minx= pa->disprect.xmin;
}
}
}
- if(best) {
+ if (best) {
float phi= panorama_pixel_rot(re);
R.panodxp= (re->winx - (best->disprect.xmin + best->disprect.xmax) )/2;
@@ -722,8 +734,8 @@ static RenderPart *find_next_part(Render *re, int minx)
long long int mindist= (long long int)re->winx * (long long int)re->winy;
/* find center of rendered parts, image center counts for 1 too */
- for(pa= re->parts.first; pa; pa= pa->next) {
- if(pa->ready) {
+ for (pa= re->parts.first; pa; pa= pa->next) {
+ if (pa->ready) {
centx+= (pa->disprect.xmin+pa->disprect.xmax)/2;
centy+= (pa->disprect.ymin+pa->disprect.ymax)/2;
tot++;
@@ -733,14 +745,14 @@ static RenderPart *find_next_part(Render *re, int minx)
centy/=tot;
/* closest of the non-rendering parts */
- for(pa= re->parts.first; pa; pa= pa->next) {
- if(pa->ready==0 && pa->nr==0) {
+ for (pa= re->parts.first; pa; pa= pa->next) {
+ if (pa->ready==0 && pa->nr==0) {
long long int distx= centx - (pa->disprect.xmin+pa->disprect.xmax)/2;
long long int disty= centy - (pa->disprect.ymin+pa->disprect.ymax)/2;
distx= (long long int)sqrt(distx*distx + disty*disty);
- if(distx<mindist) {
- if(re->r.mode & R_PANORAMA) {
- if(pa->disprect.xmin==minx) {
+ if (distx<mindist) {
+ if (re->r.mode & R_PANORAMA) {
+ if (pa->disprect.xmin==minx) {
best= pa;
mindist= distx;
}
@@ -775,12 +787,12 @@ static void threaded_tile_processor(Render *re)
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
/* first step; free the entire render result, make new, and/or prepare exr buffer saving */
- if(re->result==NULL || !(re->r.scemode & R_PREVIEWBUTS)) {
+ if (re->result==NULL || !(re->r.scemode & R_PREVIEWBUTS)) {
render_result_free(re->result);
- if(re->sss_points && render_display_draw_enabled(re))
+ if (re->sss_points && render_display_draw_enabled(re))
re->result= render_result_new(re, &re->disprect, 0, RR_USE_MEM);
- else if(re->r.scemode & R_FULL_SAMPLE)
+ else if (re->r.scemode & R_FULL_SAMPLE)
re->result= render_result_new_full_sample(re, &re->fullresult, &re->disprect, 0, RR_USE_EXR);
else
re->result= render_result_new(re, &re->disprect, 0,
@@ -789,14 +801,14 @@ static void threaded_tile_processor(Render *re)
BLI_rw_mutex_unlock(&re->resultmutex);
- if(re->result==NULL)
+ if (re->result==NULL)
return;
/* warning; no return here without closing exr file */
initparts(re);
- if(re->result->exrhandle)
+ if (re->result->exrhandle)
render_result_exr_file_begin(re);
BLI_init_threads(&threads, do_part_thread, re->r.threads);
@@ -808,16 +820,16 @@ static void threaded_tile_processor(Render *re)
R.test_break= thread_break;
/* timer loop demands to sleep when no parts are left, so we enter loop with a part */
- if(re->r.mode & R_PANORAMA)
+ if (re->r.mode & R_PANORAMA)
nextpa= find_next_pano_slice(re, &minx, &viewplane);
else
nextpa= find_next_part(re, 0);
- while(rendering) {
+ while (rendering) {
- if(re->test_break(re->tbh))
+ if (re->test_break(re->tbh))
PIL_sleep_ms(50);
- else if(nextpa && BLI_available_threads(&threads)) {
+ else if (nextpa && BLI_available_threads(&threads)) {
drawtimer= 0;
nextpa->nr= counter++; /* for nicest part, and for stats */
nextpa->thread= BLI_available_thread_index(&threads); /* sample index */
@@ -825,8 +837,8 @@ static void threaded_tile_processor(Render *re)
nextpa= find_next_part(re, minx);
}
- else if(re->r.mode & R_PANORAMA) {
- if(nextpa==NULL && BLI_available_threads(&threads)==re->r.threads)
+ else if (re->r.mode & R_PANORAMA) {
+ if (nextpa==NULL && BLI_available_threads(&threads)==re->r.threads)
nextpa= find_next_pano_slice(re, &minx, &viewplane);
else {
PIL_sleep_ms(50);
@@ -841,13 +853,13 @@ static void threaded_tile_processor(Render *re)
/* check for ready ones to display, and if we need to continue */
rendering= 0;
hasdrawn= 0;
- for(pa= re->parts.first; pa; pa= pa->next) {
- if(pa->ready) {
+ for (pa= re->parts.first; pa; pa= pa->next) {
+ if (pa->ready) {
BLI_remove_thread(&threads, pa);
- if(pa->result) {
- if(render_display_draw_enabled(re))
+ if (pa->result) {
+ if (render_display_draw_enabled(re))
re->display_draw(re->ddh, pa->result, NULL);
print_part_stats(re, pa);
@@ -860,23 +872,23 @@ static void threaded_tile_processor(Render *re)
}
else {
rendering= 1;
- if(pa->nr && pa->result && drawtimer>20) {
- if(render_display_draw_enabled(re))
+ if (pa->nr && pa->result && drawtimer>20) {
+ if (render_display_draw_enabled(re))
re->display_draw(re->ddh, pa->result, &pa->result->renrect);
hasdrawn= 1;
}
}
}
- if(hasdrawn)
+ if (hasdrawn)
drawtimer= 0;
/* on break, wait for all slots to get freed */
- if( (g_break=re->test_break(re->tbh)) && BLI_available_threads(&threads)==re->r.threads)
+ if ( (g_break=re->test_break(re->tbh)) && BLI_available_threads(&threads)==re->r.threads)
rendering= 0;
}
- if(re->result->exrhandle) {
+ if (re->result->exrhandle) {
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
render_result_exr_file_end(re);
BLI_rw_mutex_unlock(&re->resultmutex);
@@ -901,7 +913,7 @@ void RE_TileProcessor(Render *re)
static void do_render_3d(Render *re)
{
/* try external */
- if(RE_engine_render(re, 0))
+ if (RE_engine_render(re, 0))
return;
/* internal */
@@ -910,24 +922,24 @@ static void do_render_3d(Render *re)
re->scene->r.subframe = re->mblur_offs + re->field_offs;
/* lock drawing in UI during data phase */
- if(re->draw_lock)
+ if (re->draw_lock)
re->draw_lock(re->dlh, 1);
/* make render verts/faces/halos/lamps */
- if(render_scene_needs_vector(re))
+ if (render_scene_needs_vector(re))
RE_Database_FromScene_Vectors(re, re->main, re->scene, re->lay);
else
RE_Database_FromScene(re, re->main, re->scene, re->lay, 1);
/* clear UI drawing locks */
- if(re->draw_lock)
+ if (re->draw_lock)
re->draw_lock(re->dlh, 0);
threaded_tile_processor(re);
/* do left-over 3d post effects (flares) */
- if(re->flag & R_HALO)
- if(!re->test_break(re->tbh))
+ if (re->flag & R_HALO)
+ if (!re->test_break(re->tbh))
add_halo_flare(re);
/* free all render verts etc */
@@ -943,17 +955,17 @@ static void addblur_rect_key(RenderResult *rr, float *rectf, float *rectf1, floa
int a, b, stride= 4*rr->rectx;
int len= stride*sizeof(float);
- for(a=0; a<rr->recty; a++) {
- if(blurfac==1.0f) {
+ for (a=0; a<rr->recty; a++) {
+ if (blurfac==1.0f) {
memcpy(rectf, rectf1, len);
}
else {
float *rf= rectf, *rf1= rectf1;
- for( b= rr->rectx; b>0; b--, rf+=4, rf1+=4) {
- if(rf1[3]<0.01f)
+ for ( b= rr->rectx; b>0; b--, rf+=4, rf1+=4) {
+ if (rf1[3]<0.01f)
rf[3]= mfac*rf[3];
- else if(rf[3]<0.01f) {
+ else if (rf[3]<0.01f) {
rf[0]= rf1[0];
rf[1]= rf1[1];
rf[2]= rf1[2];
@@ -979,14 +991,14 @@ static void addblur_rect(RenderResult *rr, float *rectf, float *rectf1, float bl
int a, b, stride= channels*rr->rectx;
int len= stride*sizeof(float);
- for(a=0; a<rr->recty; a++) {
- if(blurfac==1.0f) {
+ for (a=0; a<rr->recty; a++) {
+ if (blurfac==1.0f) {
memcpy(rectf, rectf1, len);
}
else {
float *rf= rectf, *rf1= rectf1;
- for( b= rr->rectx*channels; b>0; b--, rf++, rf1++) {
+ for ( b= rr->rectx*channels; b>0; b--, rf++, rf1++) {
rf[0]= mfac*rf[0] + blurfac*rf1[0];
}
}
@@ -1003,11 +1015,11 @@ static void merge_renderresult_blur(RenderResult *rr, RenderResult *brr, float b
RenderPass *rpass, *rpass1;
rl1= brr->layers.first;
- for(rl= rr->layers.first; rl && rl1; rl= rl->next, rl1= rl1->next) {
+ for (rl= rr->layers.first; rl && rl1; rl= rl->next, rl1= rl1->next) {
/* combined */
- if(rl->rectf && rl1->rectf) {
- if(key_alpha)
+ if (rl->rectf && rl1->rectf) {
+ if (key_alpha)
addblur_rect_key(rr, rl->rectf, rl1->rectf, blurfac);
else
addblur_rect(rr, rl->rectf, rl1->rectf, blurfac, 4);
@@ -1015,7 +1027,7 @@ static void merge_renderresult_blur(RenderResult *rr, RenderResult *brr, float b
/* passes are allocated in sync */
rpass1= rl1->passes.first;
- for(rpass= rl->passes.first; rpass && rpass1; rpass= rpass->next, rpass1= rpass1->next) {
+ for (rpass= rl->passes.first; rpass && rpass1; rpass= rpass->next, rpass1= rpass1->next) {
addblur_rect(rr, rpass->rect, rpass1->rect, blurfac, rpass->channels);
}
}
@@ -1032,7 +1044,7 @@ static void do_render_blur_3d(Render *re)
rres= render_result_new(re, &re->disprect, 0, RR_USE_MEM);
/* do the blur steps */
- while(blur--) {
+ while (blur--) {
re->mblur_offs = re->r.blurfac*((float)(re->r.mblur_samples-blur))/(float)re->r.mblur_samples;
re->i.curblur= re->r.mblur_samples-blur; /* stats */
@@ -1042,7 +1054,7 @@ static void do_render_blur_3d(Render *re)
blurfac= 1.0f/(float)(re->r.mblur_samples-blur);
merge_renderresult_blur(rres, re->result, blurfac, re->r.alphamode & R_ALPHAKEY);
- if(re->test_break(re->tbh)) break;
+ if (re->test_break(re->tbh)) break;
}
/* swap results */
@@ -1066,7 +1078,7 @@ static void interleave_rect(RenderResult *rr, float *rectf, float *rectf1, float
int a, stride= channels*rr->rectx;
int len= stride*sizeof(float);
- for(a=0; a<rr->recty; a+=2) {
+ for (a=0; a<rr->recty; a+=2) {
memcpy(rectf, rectf1, len);
rectf+= stride;
rectf1+= stride;
@@ -1084,16 +1096,16 @@ static void merge_renderresult_fields(RenderResult *rr, RenderResult *rr1, Rende
rl1= rr1->layers.first;
rl2= rr2->layers.first;
- for(rl= rr->layers.first; rl && rl1 && rl2; rl= rl->next, rl1= rl1->next, rl2= rl2->next) {
+ for (rl= rr->layers.first; rl && rl1 && rl2; rl= rl->next, rl1= rl1->next, rl2= rl2->next) {
/* combined */
- if(rl->rectf && rl1->rectf && rl2->rectf)
+ if (rl->rectf && rl1->rectf && rl2->rectf)
interleave_rect(rr, rl->rectf, rl1->rectf, rl2->rectf, 4);
/* passes are allocated in sync */
rpass1= rl1->passes.first;
rpass2= rl2->passes.first;
- for(rpass= rl->passes.first; rpass && rpass1 && rpass2; rpass= rpass->next, rpass1= rpass1->next, rpass2= rpass2->next) {
+ for (rpass= rl->passes.first; rpass && rpass1 && rpass2; rpass= rpass->next, rpass1= rpass1->next, rpass2= rpass2->next) {
interleave_rect(rr, rpass->rect, rpass1->rect, rpass2->rect, rpass->channels);
}
}
@@ -1116,7 +1128,7 @@ static void do_render_fields_3d(Render *re)
/* first field, we have to call camera routine for correct aspect and subpixel offset */
RE_SetCamera(re, camera);
- if(re->r.mode & R_MBLUR && (re->r.scemode & R_FULL_SAMPLE)==0)
+ if (re->r.mode & R_MBLUR && (re->r.scemode & R_FULL_SAMPLE)==0)
do_render_blur_3d(re);
else
do_render_3d(re);
@@ -1127,16 +1139,16 @@ static void do_render_fields_3d(Render *re)
BLI_rw_mutex_unlock(&re->resultmutex);
/* second field */
- if(!re->test_break(re->tbh)) {
+ if (!re->test_break(re->tbh)) {
re->i.curfield= 2; /* stats */
re->flag |= R_SEC_FIELD;
- if((re->r.mode & R_FIELDSTILL)==0) {
+ if ((re->r.mode & R_FIELDSTILL)==0) {
re->field_offs = 0.5f;
}
RE_SetCamera(re, camera);
- if(re->r.mode & R_MBLUR && (re->r.scemode & R_FULL_SAMPLE)==0)
+ if (re->r.mode & R_MBLUR && (re->r.scemode & R_FULL_SAMPLE)==0)
do_render_blur_3d(re);
else
do_render_3d(re);
@@ -1156,8 +1168,8 @@ static void do_render_fields_3d(Render *re)
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
re->result= render_result_new(re, &re->disprect, 0, RR_USE_MEM);
- if(rr2) {
- if(re->r.mode & R_ODDFIELD)
+ if (rr2) {
+ if (re->r.mode & R_ODDFIELD)
merge_renderresult_fields(re->result, rr2, rr1);
else
merge_renderresult_fields(re->result, rr1, rr2);
@@ -1182,7 +1194,7 @@ static void do_render_fields_blur_3d(Render *re)
{
Object *camera= RE_GetCamera(re);
/* also check for camera here */
- if(camera == NULL) {
+ if (camera == NULL) {
printf("ERROR: Cannot render, no camera\n");
G.afbreek= 1;
return;
@@ -1191,17 +1203,17 @@ static void do_render_fields_blur_3d(Render *re)
/* now use renderdata and camera to set viewplane */
RE_SetCamera(re, camera);
- if(re->r.mode & R_FIELDS)
+ if (re->r.mode & R_FIELDS)
do_render_fields_3d(re);
- else if(re->r.mode & R_MBLUR && (re->r.scemode & R_FULL_SAMPLE)==0)
+ else if (re->r.mode & R_MBLUR && (re->r.scemode & R_FULL_SAMPLE)==0)
do_render_blur_3d(re);
else
do_render_3d(re);
/* when border render, check if we have to insert it in black */
- if(re->result) {
- if(re->r.mode & R_BORDER) {
- if((re->r.mode & R_CROP)==0) {
+ if (re->result) {
+ if (re->r.mode & R_BORDER) {
+ if ((re->r.mode & R_CROP)==0) {
RenderResult *rres;
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
@@ -1211,9 +1223,9 @@ static void do_render_fields_blur_3d(Render *re)
/* this copying sequence could become function? */
/* weak is: it chances disprect from border */
- re->disprect.xmin= re->disprect.ymin= 0;
- re->disprect.xmax= re->winx;
- re->disprect.ymax= re->winy;
+ re->disprect.xmin = re->disprect.ymin = 0;
+ re->disprect.xmax = re->winx;
+ re->disprect.ymax = re->winy;
re->rectx= re->winx;
re->recty= re->winy;
@@ -1242,8 +1254,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);
@@ -1254,7 +1266,7 @@ static void render_scene(Render *re, Scene *sce, int cfra)
scene_camera_switch_update(sce);
/* exception: scene uses own size (unfinished code) */
- if(0) {
+ if (0) {
winx= (sce->r.size*sce->r.xsch)/100;
winy= (sce->r.size*sce->r.ysch)/100;
}
@@ -1287,13 +1299,13 @@ static int composite_needs_render(Scene *sce, int this_scene)
bNodeTree *ntree= sce->nodetree;
bNode *node;
- if(ntree==NULL) return 1;
- if(sce->use_nodes==0) return 1;
- if((sce->r.scemode & R_DOCOMP)==0) return 1;
+ if (ntree==NULL) return 1;
+ if (sce->use_nodes==0) return 1;
+ if ((sce->r.scemode & R_DOCOMP)==0) return 1;
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS)
- if(this_scene==0 || node->id==NULL || node->id==&sce->id)
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->type==CMP_NODE_R_LAYERS)
+ if (this_scene==0 || node->id==NULL || node->id==&sce->id)
return 1;
}
return 0;
@@ -1304,19 +1316,19 @@ static void tag_scenes_for_render(Render *re)
bNode *node;
Scene *sce;
- for(sce= re->main->scene.first; sce; sce= sce->id.next)
+ for (sce= re->main->scene.first; sce; sce= sce->id.next)
sce->id.flag &= ~LIB_DOIT;
- if(RE_GetCamera(re) && composite_needs_render(re->scene, 1))
+ if (RE_GetCamera(re) && composite_needs_render(re->scene, 1))
re->scene->id.flag |= LIB_DOIT;
- if(re->scene->nodetree==NULL) return;
+ if (re->scene->nodetree==NULL) return;
/* check for render-layers nodes using other scenes, we tag them LIB_DOIT */
- for(node= re->scene->nodetree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS) {
- if(node->id) {
- if(node->id != (ID *)re->scene)
+ for (node= re->scene->nodetree->nodes.first; node; node= node->next) {
+ if (node->type==CMP_NODE_R_LAYERS) {
+ if (node->id) {
+ if (node->id != (ID *)re->scene)
node->id->flag |= LIB_DOIT;
}
}
@@ -1330,16 +1342,16 @@ static void ntree_render_scenes(Render *re)
int cfra= re->scene->r.cfra;
int restore_scene= 0;
- if(re->scene->nodetree==NULL) return;
+ if (re->scene->nodetree==NULL) return;
tag_scenes_for_render(re);
/* now foreach render-result node tagged we do a full render */
/* results are stored in a way compisitor will find it */
- for(node= re->scene->nodetree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS) {
- if(node->id && node->id != (ID *)re->scene) {
- if(node->id->flag & LIB_DOIT) {
+ for (node= re->scene->nodetree->nodes.first; node; node= node->next) {
+ if (node->type==CMP_NODE_R_LAYERS) {
+ if (node->id && node->id != (ID *)re->scene) {
+ if (node->id->flag & LIB_DOIT) {
Scene *scene = (Scene*)node->id;
render_scene(re, scene, cfra);
@@ -1353,7 +1365,7 @@ static void ntree_render_scenes(Render *re)
}
/* restore scene if we rendered another last */
- if(restore_scene)
+ if (restore_scene)
set_scene_bg(re->main, re->scene);
}
@@ -1373,7 +1385,7 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree)
int sample;
/* interaction callbacks */
- if(ntree) {
+ if (ntree) {
ntree->stats_draw= render_composit_stats;
ntree->test_break= re->test_break;
ntree->progress= re->progress;
@@ -1388,7 +1400,7 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree)
/* we accumulate in here */
rectf= MEM_mapallocN(re->rectx*re->recty*sizeof(float)*4, "fullsample rgba");
- for(sample=0; sample<re->r.osa; sample++) {
+ for (sample=0; sample<re->r.osa; sample++) {
Render *re1;
RenderResult rres;
int x, y, mask;
@@ -1400,10 +1412,10 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree)
/* also function below assumes this */
tag_scenes_for_render(re);
- for(re1= RenderGlobal.renderlist.first; re1; re1= re1->next) {
- if(re1->scene->id.flag & LIB_DOIT) {
- if(re1->r.scemode & R_FULL_SAMPLE) {
- if(sample) {
+ for (re1= RenderGlobal.renderlist.first; re1; re1= re1->next) {
+ if (re1->scene->id.flag & LIB_DOIT) {
+ if (re1->r.scemode & R_FULL_SAMPLE) {
+ if (sample) {
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
render_result_exr_file_read(re1, sample);
BLI_rw_mutex_unlock(&re->resultmutex);
@@ -1414,7 +1426,7 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree)
}
/* composite */
- if(ntree) {
+ if (ntree) {
ntreeCompositTagRender(re->scene);
ntreeCompositTagAnimated(ntree);
@@ -1428,15 +1440,15 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree)
mask= (1<<sample);
mask_array(mask, filt);
- for(y=0; y<re->recty; y++) {
+ for (y=0; y<re->recty; y++) {
float *rf= rectf + 4*y*re->rectx;
float *col= rres.rectf + 4*y*re->rectx;
- for(x=0; x<re->rectx; x++, rf+=4, col+=4) {
+ for (x=0; x<re->rectx; x++, rf+=4, col+=4) {
/* clamping to 1.0 is needed for correct AA */
- if(col[0]<0.0f) col[0]=0.0f; else if(col[0] > 1.0f) col[0]= 1.0f;
- if(col[1]<0.0f) col[1]=0.0f; else if(col[1] > 1.0f) col[1]= 1.0f;
- if(col[2]<0.0f) col[2]=0.0f; else if(col[2] > 1.0f) col[2]= 1.0f;
+ if (col[0]<0.0f) col[0]=0.0f; else if (col[0] > 1.0f) col[0]= 1.0f;
+ if (col[1]<0.0f) col[1]=0.0f; else if (col[1] > 1.0f) col[1]= 1.0f;
+ if (col[2]<0.0f) col[2]=0.0f; else if (col[2] > 1.0f) col[2]= 1.0f;
add_filt_fmask_coord(filt, col, rf, re->rectx, re->recty, x, y);
}
@@ -1445,18 +1457,18 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree)
RE_ReleaseResultImage(re);
/* show stuff */
- if(sample!=re->osa-1) {
+ if (sample!=re->osa-1) {
/* weak... the display callback wants an active renderlayer pointer... */
re->result->renlay= render_get_active_layer(re, re->result);
re->display_draw(re->ddh, re->result, NULL);
}
- if(re->test_break(re->tbh))
+ if (re->test_break(re->tbh))
break;
}
/* clear interaction callbacks */
- if(ntree) {
+ if (ntree) {
ntree->stats_draw= NULL;
ntree->test_break= NULL;
ntree->progress= NULL;
@@ -1467,7 +1479,7 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree)
R.i.curfsa= 0;
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
- if(re->result->rectf)
+ if (re->result->rectf)
MEM_freeN(re->result->rectf);
re->result->rectf= rectf;
BLI_rw_mutex_unlock(&re->resultmutex);
@@ -1488,15 +1500,15 @@ void RE_MergeFullSample(Render *re, Main *bmain, Scene *sce, bNodeTree *ntree)
/* first call RE_ReadRenderResult on every renderlayer scene. this creates Render structs */
/* tag scenes unread */
- for(scene= re->main->scene.first; scene; scene= scene->id.next)
+ for (scene= re->main->scene.first; scene; scene= scene->id.next)
scene->id.flag |= LIB_DOIT;
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS) {
+ for (node= ntree->nodes.first; node; node= node->next) {
+ if (node->type==CMP_NODE_R_LAYERS) {
Scene *nodescene= (Scene *)node->id;
- if(nodescene==NULL) nodescene= sce;
- if(nodescene->id.flag & LIB_DOIT) {
+ if (nodescene==NULL) nodescene= sce;
+ if (nodescene->id.flag & LIB_DOIT) {
nodescene->r.mode |= R_OSA; /* render struct needs tables */
RE_ReadRenderResult(sce, nodescene);
nodescene->id.flag &= ~LIB_DOIT;
@@ -1505,7 +1517,7 @@ void RE_MergeFullSample(Render *re, Main *bmain, Scene *sce, bNodeTree *ntree)
}
/* own render result should be read/allocated */
- if(re->scene->id.flag & LIB_DOIT) {
+ if (re->scene->id.flag & LIB_DOIT) {
RE_ReadRenderResult(re->scene, re->scene);
re->scene->id.flag &= ~LIB_DOIT;
}
@@ -1526,7 +1538,7 @@ static void do_render_composite_fields_blur_3d(Render *re)
/* INIT seeding, compositor can use random texture */
BLI_srandom(re->r.cfra);
- if(composite_needs_render(re->scene, 1)) {
+ if (composite_needs_render(re->scene, 1)) {
/* save memory... free all cached images */
ntreeFreeCache(ntree);
@@ -1546,25 +1558,25 @@ static void do_render_composite_fields_blur_3d(Render *re)
}
/* swap render result */
- if(re->r.scemode & R_SINGLE_LAYER) {
+ if (re->r.scemode & R_SINGLE_LAYER) {
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
render_result_single_layer_end(re);
BLI_rw_mutex_unlock(&re->resultmutex);
}
- if(!re->test_break(re->tbh)) {
+ if (!re->test_break(re->tbh)) {
- if(ntree) {
+ if (ntree) {
ntreeCompositTagRender(re->scene);
ntreeCompositTagAnimated(ntree);
}
- if(ntree && re->scene->use_nodes && re->r.scemode & R_DOCOMP) {
+ if (ntree && re->scene->use_nodes && re->r.scemode & R_DOCOMP) {
/* checks if there are render-result nodes that need scene */
- if((re->r.scemode & R_SINGLE_LAYER)==0)
+ if ((re->r.scemode & R_SINGLE_LAYER)==0)
ntree_render_scenes(re);
- if(!re->test_break(re->tbh)) {
+ if (!re->test_break(re->tbh)) {
ntree->stats_draw= render_composit_stats;
ntree->test_break= re->test_break;
ntree->progress= re->progress;
@@ -1579,7 +1591,7 @@ static void do_render_composite_fields_blur_3d(Render *re)
if (update_newframe)
scene_update_for_newframe(re->main, re->scene, re->lay);
- if(re->r.scemode & R_FULL_SAMPLE)
+ if (re->r.scemode & R_FULL_SAMPLE)
do_merge_fullsample(re, ntree);
else {
ntreeCompositExecTree(ntree, &re->r, G.background==0);
@@ -1591,7 +1603,7 @@ static void do_render_composite_fields_blur_3d(Render *re)
ntree->tbh= ntree->sdh= ntree->prh= NULL;
}
}
- else if(re->r.scemode & R_FULL_SAMPLE)
+ else if (re->r.scemode & R_FULL_SAMPLE)
do_merge_fullsample(re, NULL);
}
@@ -1638,20 +1650,21 @@ static void do_render_seq(Render * re)
re->i.cfra= cfra;
- if(recurs_depth==0) {
- /* otherwise sequencer animation isnt updated */
+ if (recurs_depth==0) {
+ /* otherwise sequencer animation isn't updated */
BKE_animsys_evaluate_all_animation(re->main, re->scene, (float)cfra); // XXX, was BKE_curframe(re->scene)
}
recurs_depth++;
- if((re->r.mode & R_BORDER) && (re->r.mode & R_CROP)==0) {
+ 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);
- } else {
+ }
+ else {
context = seq_new_render_data(re->main, re->scene,
re->result->rectx, re->result->recty,
100);
@@ -1665,7 +1678,7 @@ static void do_render_seq(Render * re)
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
- if(ibuf) {
+ if (ibuf) {
/* copy ibuf into combined pixel rect */
render_result_rect_from_ibuf(rr, &re->r, ibuf);
@@ -1687,7 +1700,7 @@ static void do_render_seq(Render * re)
re->r.scemode |= R_DOSEQ;
/* set overall progress of sequence rendering */
- if(re->r.efra!=re->r.sfra)
+ if (re->r.efra!=re->r.sfra)
re->progress(re->prh, (float)(cfra-re->r.sfra) / (re->r.efra-re->r.sfra));
else
re->progress(re->prh, 1.0f);
@@ -1705,12 +1718,12 @@ static void do_render_all_options(Render *re)
/* ensure no images are in memory from previous animated sequences */
BKE_image_all_free_anim_ibufs(re->r.cfra);
- if(RE_engine_render(re, 1)) {
+ if (RE_engine_render(re, 1)) {
/* in this case external render overrides all */
}
- else if(RE_seq_render_active(re->scene, &re->r)) {
+ else if (RE_seq_render_active(re->scene, &re->r)) {
/* note: do_render_seq() frees rect32 when sequencer returns float images */
- if(!re->test_break(re->tbh))
+ if (!re->test_break(re->tbh))
do_render_seq(re);
re->stats_draw(re->sdh, &re->i);
@@ -1725,7 +1738,7 @@ static void do_render_all_options(Render *re)
re->stats_draw(re->sdh, &re->i);
/* stamp image info here */
- if((re->r.stamp & R_STAMP_ALL) && (re->r.stamp & R_STAMP_DRAW)) {
+ if ((re->r.stamp & R_STAMP_ALL) && (re->r.stamp & R_STAMP_DRAW)) {
renderresult_stampinfo(re);
re->display_draw(re->ddh, re->result, NULL);
}
@@ -1738,20 +1751,21 @@ static int check_valid_camera(Scene *scene, Object *camera_override)
if (camera_override == NULL && scene->camera == NULL)
scene->camera= scene_find_camera(scene);
- if(scene->r.scemode&R_DOSEQ) {
- if(scene->ed) {
+ if (scene->r.scemode&R_DOSEQ) {
+ if (scene->ed) {
Sequence *seq= scene->ed->seqbase.first;
check_comp= 0;
- while(seq) {
- if(seq->type == SEQ_SCENE && seq->scene) {
- if(!seq->scene_camera) {
- if(!seq->scene->camera && !scene_find_camera(seq->scene)) {
- if(seq->scene == scene) {
+ while (seq) {
+ if (seq->type == SEQ_SCENE && seq->scene) {
+ if (!seq->scene_camera) {
+ if (!seq->scene->camera && !scene_find_camera(seq->scene)) {
+ if (seq->scene == scene) {
/* for current scene camera could be unneeded due to compisite nodes */
check_comp= 1;
- } else {
+ }
+ else {
/* for other scenes camera is necessary */
return 0;
}
@@ -1764,15 +1778,15 @@ static int check_valid_camera(Scene *scene, Object *camera_override)
}
}
- if(check_comp) { /* no sequencer or sequencer depends on compositor */
- if(scene->r.scemode&R_DOCOMP && scene->use_nodes) {
+ if (check_comp) { /* no sequencer or sequencer depends on compositor */
+ if (scene->r.scemode&R_DOCOMP && scene->use_nodes) {
bNode *node= scene->nodetree->nodes.first;
- while(node) {
- if(node->type == CMP_NODE_R_LAYERS) {
+ while (node) {
+ if (node->type == CMP_NODE_R_LAYERS) {
Scene *sce= node->id ? (Scene*)node->id : scene;
- if(!sce->camera && !scene_find_camera(sce)) {
+ if (!sce->camera && !scene_find_camera(sce)) {
/* all render layers nodes need camera */
return 0;
}
@@ -1780,7 +1794,8 @@ static int check_valid_camera(Scene *scene, Object *camera_override)
node= node->next;
}
- } else {
+ }
+ else {
return (camera_override != NULL || scene->camera != NULL);
}
}
@@ -1792,15 +1807,15 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
{
SceneRenderLayer *srl;
- if(scene->r.mode & R_BORDER) {
- if(scene->r.border.xmax <= scene->r.border.xmin ||
+ if (scene->r.mode & R_BORDER) {
+ if (scene->r.border.xmax <= scene->r.border.xmin ||
scene->r.border.ymax <= scene->r.border.ymin) {
BKE_report(reports, RPT_ERROR, "No border area selected.");
return 0;
}
}
- if(scene->r.scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) {
+ if (scene->r.scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) {
char str[FILE_MAX];
render_result_exr_file_path(scene, 0, str);
@@ -1811,7 +1826,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
}
/* no fullsample and edge */
- if((scene->r.scemode & R_FULL_SAMPLE) && (scene->r.mode & R_EDGE)) {
+ if ((scene->r.scemode & R_FULL_SAMPLE) && (scene->r.mode & R_EDGE)) {
BKE_report(reports, RPT_ERROR, "Full Sample doesn't support Edge Enhance");
return 0;
}
@@ -1820,27 +1835,27 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
else
scene->r.scemode &= ~R_FULL_SAMPLE; /* clear to be sure */
- if(scene->r.scemode & R_DOCOMP) {
- if(scene->use_nodes) {
+ if (scene->r.scemode & R_DOCOMP) {
+ if (scene->use_nodes) {
bNodeTree *ntree= scene->nodetree;
bNode *node;
- if(ntree==NULL) {
+ if (ntree==NULL) {
BKE_report(reports, RPT_ERROR, "No Nodetree in Scene");
return 0;
}
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->type==CMP_NODE_COMPOSITE)
+ for (node= ntree->nodes.first; node; node= node->next)
+ if (node->type==CMP_NODE_COMPOSITE)
break;
- if(node==NULL) {
+ if (node==NULL) {
BKE_report(reports, RPT_ERROR, "No Render Output Node in Scene");
return 0;
}
- if(scene->r.scemode & R_FULL_SAMPLE) {
- if(composite_needs_render(scene, 0)==0) {
+ if (scene->r.scemode & R_FULL_SAMPLE) {
+ if (composite_needs_render(scene, 0)==0) {
BKE_report(reports, RPT_ERROR, "Full Sample AA not supported without 3d rendering");
return 0;
}
@@ -1849,7 +1864,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
}
/* check valid camera, without camera render is OK (compo, seq) */
- if(!check_valid_camera(scene, camera_override)) {
+ if (!check_valid_camera(scene, camera_override)) {
BKE_report(reports, RPT_ERROR, "No camera");
return 0;
}
@@ -1858,24 +1873,24 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
object_camera_mode(&scene->r, camera_override ? camera_override : scene->camera);
/* forbidden combinations */
- if(scene->r.mode & R_PANORAMA) {
- if(scene->r.mode & R_ORTHO) {
+ if (scene->r.mode & R_PANORAMA) {
+ if (scene->r.mode & R_ORTHO) {
BKE_report(reports, RPT_ERROR, "No Ortho render possible for Panorama");
return 0;
}
}
/* layer flag tests */
- if(scene->r.scemode & R_SINGLE_LAYER) {
+ if (scene->r.scemode & R_SINGLE_LAYER) {
srl= BLI_findlink(&scene->r.layers, scene->r.actlay);
/* force layer to be enabled */
srl->layflag &= ~SCE_LAY_DISABLE;
}
- for(srl= scene->r.layers.first; srl; srl= srl->next)
- if(!(srl->layflag & SCE_LAY_DISABLE))
+ for (srl= scene->r.layers.first; srl; srl= srl->next)
+ if (!(srl->layflag & SCE_LAY_DISABLE))
break;
- if(srl==NULL) {
+ if (srl==NULL) {
BKE_report(reports, RPT_ERROR, "All RenderLayers are disabled");
return 0;
}
@@ -1885,16 +1900,17 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
static void validate_render_settings(Render *re)
{
- if(re->r.scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) {
+ if (re->r.scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) {
/* no osa + fullsample won't work... */
- if(re->r.osa==0)
+ if (re->r.osa==0)
re->r.scemode &= ~R_FULL_SAMPLE;
- } else re->r.scemode &= ~R_FULL_SAMPLE; /* clear to be sure */
+ }
+ else re->r.scemode &= ~R_FULL_SAMPLE; /* clear to be sure */
- if(RE_engine_is_external(re)) {
+ if (RE_engine_is_external(re)) {
/* not supported yet */
re->r.scemode &= ~(R_EXR_TILE_FILE|R_FULL_SAMPLE);
- re->r.mode &= ~R_FIELDS;
+ re->r.mode &= ~(R_FIELDS|R_MBLUR);
}
}
@@ -1922,24 +1938,24 @@ 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;
winy= (scene->r.size*scene->r.ysch)/100;
/* we always render smaller part, inserting it in larger image is compositor bizz, it uses disprect for it */
- if(scene->r.mode & R_BORDER) {
- disprect.xmin= scene->r.border.xmin*winx;
- disprect.xmax= scene->r.border.xmax*winx;
+ if (scene->r.mode & R_BORDER) {
+ disprect.xmin = scene->r.border.xmin*winx;
+ disprect.xmax = scene->r.border.xmax*winx;
- disprect.ymin= scene->r.border.ymin*winy;
- disprect.ymax= scene->r.border.ymax*winy;
+ disprect.ymin = scene->r.border.ymin*winy;
+ disprect.ymax = scene->r.border.ymax*winy;
}
else {
- disprect.xmin= disprect.ymin= 0;
- disprect.xmax= winx;
- disprect.ymax= winy;
+ disprect.xmin = disprect.ymin = 0;
+ disprect.xmax = winx;
+ disprect.ymax = winy;
}
re->main= bmain;
@@ -1948,7 +1964,7 @@ static int render_initialize_from_main(Render *re, Main *bmain, Scene *scene, Sc
re->lay= lay;
/* not too nice, but it survives anim-border render */
- if(anim) {
+ if (anim) {
re->disprect= disprect;
return 1;
}
@@ -1960,20 +1976,20 @@ 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) {
+ */
+ if (0) {
/* make sure dynamics are up to date */
update_physics_cache(re, scene, anim_init);
}
- if(srl || scene->r.scemode & R_SINGLE_LAYER) {
+ if (srl || scene->r.scemode & R_SINGLE_LAYER) {
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
render_result_single_layer_begin(re);
BLI_rw_mutex_unlock(&re->resultmutex);
}
RE_InitState(re, NULL, &scene->r, srl, winx, winy, &disprect);
- if(!re->ok) /* if an error was printed, abort */
+ if (!re->ok) /* if an error was printed, abort */
return 0;
/* initstate makes new result, have to send changed tags around */
@@ -2000,16 +2016,16 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr
scene->r.cfra= frame;
- if(render_initialize_from_main(re, bmain, scene, srl, camera_override, lay, 0, 0)) {
+ if (render_initialize_from_main(re, bmain, scene, srl, camera_override, lay, 0, 0)) {
MEM_reset_peak_memory();
BLI_exec_cb(re->main, (ID *)scene, BLI_CB_EVT_RENDER_PRE);
do_render_all_options(re);
- if(write_still && !G.afbreek) {
- if(BKE_imtype_is_movie(scene->r.im_format.imtype)) {
- /* operator checks this but incase its called from elsewhere */
+ if (write_still && !G.afbreek) {
+ if (BKE_imtype_is_movie(scene->r.im_format.imtype)) {
+ /* operator checks this but in case its called from elsewhere */
printf("Error: cant write single images with a movie format!\n");
}
else {
@@ -2024,6 +2040,8 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr
BLI_exec_cb(re->main, (ID *)scene, BLI_CB_EVT_RENDER_POST); /* keep after file save */
}
+ BLI_exec_cb(re->main, (ID *)scene, G.afbreek ? BLI_CB_EVT_RENDER_CANCEL : BLI_CB_EVT_RENDER_COMPLETE);
+
/* UGLY WARNING */
G.rendering= 0;
}
@@ -2038,11 +2056,11 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie
RE_AcquireResultImage(re, &rres);
/* write movie or image */
- if(BKE_imtype_is_movie(scene->r.im_format.imtype)) {
+ if (BKE_imtype_is_movie(scene->r.im_format.imtype)) {
int dofree = 0;
unsigned int *rect32 = (unsigned int *)rres.rect32;
/* note; the way it gets 32 bits rects is weak... */
- if(rres.rect32 == NULL) {
+ if (rres.rect32 == NULL) {
rect32 = MEM_mapallocN(sizeof(int)*rres.rectx*rres.recty, "temp 32 bits rect");
RE_ResultGet32(re, rect32);
dofree = 1;
@@ -2050,20 +2068,20 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie
ok= mh->append_movie(&re->r, scene->r.sfra, scene->r.cfra, (int *)rect32,
rres.rectx, rres.recty, re->reports);
- if(dofree) {
+ if (dofree) {
MEM_freeN(rect32);
}
printf("Append frame %d", scene->r.cfra);
}
else {
- if(name_override)
+ if (name_override)
BLI_strncpy(name, name_override, sizeof(name));
else
BKE_makepicstring(name, scene->r.pic, bmain->name, scene->r.cfra, scene->r.im_format.imtype, scene->r.scemode & R_EXTENSION, TRUE);
- if(re->r.im_format.imtype==R_IMF_IMTYPE_MULTILAYER) {
- if(re->result) {
- RE_WriteRenderResult(re->reports, re->result, name, scene->r.im_format.compress);
+ if (re->r.im_format.imtype==R_IMF_IMTYPE_MULTILAYER) {
+ if (re->result) {
+ RE_WriteRenderResult(re->reports, re->result, name, scene->r.im_format.exr_codec);
printf("Saved: %s", name);
}
}
@@ -2072,17 +2090,17 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie
ok= BKE_write_ibuf_stamp(scene, camera, ibuf, name, &scene->r.im_format);
- if(ok==0) {
+ if (ok==0) {
printf("Render error: cannot save %s\n", name);
}
else printf("Saved: %s", name);
/* optional preview images for exr */
- if(ok && scene->r.im_format.imtype==R_IMF_IMTYPE_OPENEXR && (scene->r.im_format.flag & R_IMF_FLAG_PREVIEW_JPG)) {
+ if (ok && scene->r.im_format.imtype==R_IMF_IMTYPE_OPENEXR && (scene->r.im_format.flag & R_IMF_FLAG_PREVIEW_JPG)) {
ImageFormatData imf= scene->r.im_format;
imf.imtype= R_IMF_IMTYPE_JPEG90;
- if(BLI_testextensie(name, ".exr"))
+ if (BLI_testextensie(name, ".exr"))
name[strlen(name)-4]= 0;
BKE_add_image_extension(name, R_IMF_IMTYPE_JPEG90);
ibuf->planes= 24;
@@ -2098,7 +2116,11 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie
RE_ReleaseResultImage(re);
BLI_timestr(re->i.lastframetime, name);
- printf(" Time: %s\n", name);
+ printf(" Time: %s", name);
+
+ BLI_exec_cb(G.main, NULL, BLI_CB_EVT_RENDER_STATS);
+
+ fputc('\n', stdout);
fflush(stdout); /* needed for renderd !! (not anymore... (ton)) */
return ok;
@@ -2112,7 +2134,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri
int nfra, totrendered= 0, totskipped= 0;
/* do not fully call for each frame, it initializes & pops output window */
- if(!render_initialize_from_main(re, bmain, scene, NULL, camera_override, lay, 0, 1))
+ if (!render_initialize_from_main(re, bmain, scene, NULL, camera_override, lay, 0, 1))
return;
/* ugly global still... is to prevent renderwin events and signal subsurfs etc to make full resol */
@@ -2121,8 +2143,8 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri
re->flag |= R_ANIMATION;
- if(BKE_imtype_is_movie(scene->r.im_format.imtype))
- if(!mh->start_movie(scene, &re->r, re->rectx, re->recty, re->reports))
+ if (BKE_imtype_is_movie(scene->r.im_format.imtype))
+ if (!mh->start_movie(scene, &re->r, re->rectx, re->recty, re->reports))
G.afbreek= 1;
if (mh->get_next_frame) {
@@ -2136,28 +2158,29 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri
do_render_all_options(re);
totrendered++;
- if(re->test_break(re->tbh) == 0) {
- if(!do_write_image_or_movie(re, bmain, scene, mh, NULL))
+ if (re->test_break(re->tbh) == 0) {
+ if (!do_write_image_or_movie(re, bmain, scene, mh, NULL))
G.afbreek= 1;
}
- if(G.afbreek == 0) {
+ if (G.afbreek == 0) {
BLI_exec_cb(re->main, (ID *)scene, BLI_CB_EVT_RENDER_POST); /* keep after file save */
}
}
else {
- if(re->test_break(re->tbh))
+ if (re->test_break(re->tbh))
G.afbreek= 1;
}
}
- } else {
- for(nfra= sfra, scene->r.cfra= sfra; scene->r.cfra<=efra; scene->r.cfra++) {
+ }
+ else {
+ for (nfra= sfra, scene->r.cfra= sfra; scene->r.cfra<=efra; scene->r.cfra++) {
char name[FILE_MAX];
/* only border now, todo: camera lens. (ton) */
render_initialize_from_main(re, bmain, scene, NULL, camera_override, lay, 1, 0);
- if(nfra!=scene->r.cfra) {
+ if (nfra!=scene->r.cfra) {
/*
* Skip this frame, but update for physics and particles system.
* From convertblender.c:
@@ -2165,7 +2188,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri
*/
unsigned int updatelay;
- if(re->lay & 0xFF000000)
+ if (re->lay & 0xFF000000)
updatelay= re->lay & 0xFF000000;
else
updatelay= re->lay;
@@ -2177,16 +2200,16 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri
nfra+= tfra;
/* Touch/NoOverwrite options are only valid for image's */
- if(BKE_imtype_is_movie(scene->r.im_format.imtype) == 0) {
- if(scene->r.mode & (R_NO_OVERWRITE | R_TOUCH))
+ if (BKE_imtype_is_movie(scene->r.im_format.imtype) == 0) {
+ if (scene->r.mode & (R_NO_OVERWRITE | R_TOUCH))
BKE_makepicstring(name, scene->r.pic, bmain->name, scene->r.cfra, scene->r.im_format.imtype, scene->r.scemode & R_EXTENSION, TRUE);
- if(scene->r.mode & R_NO_OVERWRITE && BLI_exists(name)) {
+ if (scene->r.mode & R_NO_OVERWRITE && BLI_exists(name)) {
printf("skipping existing frame \"%s\"\n", name);
totskipped++;
continue;
}
- if(scene->r.mode & R_TOUCH && !BLI_exists(name)) {
+ if (scene->r.mode & R_TOUCH && !BLI_exists(name)) {
BLI_make_existing_file(name); /* makes the dir if its not there */
BLI_file_touch(name);
}
@@ -2201,17 +2224,17 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri
do_render_all_options(re);
totrendered++;
- if(re->test_break(re->tbh) == 0) {
- if(!G.afbreek)
- if(!do_write_image_or_movie(re, bmain, scene, mh, NULL))
+ if (re->test_break(re->tbh) == 0) {
+ if (!G.afbreek)
+ if (!do_write_image_or_movie(re, bmain, scene, mh, NULL))
G.afbreek= 1;
}
else
G.afbreek= 1;
- if(G.afbreek==1) {
+ if (G.afbreek==1) {
/* remove touched file */
- if(BKE_imtype_is_movie(scene->r.im_format.imtype) == 0) {
+ if (BKE_imtype_is_movie(scene->r.im_format.imtype) == 0) {
if (scene->r.mode & R_TOUCH && BLI_exists(name) && BLI_file_size(name) == 0) {
BLI_delete(name, 0, 0);
}
@@ -2220,23 +2243,25 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri
break;
}
- if(G.afbreek==0) {
+ if (G.afbreek==0) {
BLI_exec_cb(re->main, (ID *)scene, BLI_CB_EVT_RENDER_POST); /* keep after file save */
}
}
}
/* end movie */
- if(BKE_imtype_is_movie(scene->r.im_format.imtype))
+ if (BKE_imtype_is_movie(scene->r.im_format.imtype))
mh->end_movie();
- if(totskipped && totrendered == 0)
+ if (totskipped && totrendered == 0)
BKE_report(re->reports, RPT_INFO, "No frames rendered, skipped to not overwrite");
scene->r.cfra= cfrao;
re->flag &= ~R_ANIMATION;
+ BLI_exec_cb(re->main, (ID *)scene, G.afbreek ? BLI_CB_EVT_RENDER_CANCEL : BLI_CB_EVT_RENDER_COMPLETE);
+
/* UGLY WARNING */
G.rendering= 0;
}
@@ -2275,25 +2300,25 @@ int RE_ReadRenderResult(Scene *scene, Scene *scenode)
winy= (scene->r.size*scene->r.ysch)/100;
/* only in movie case we render smaller part */
- if(scene->r.mode & R_BORDER) {
- disprect.xmin= scene->r.border.xmin*winx;
- disprect.xmax= scene->r.border.xmax*winx;
+ if (scene->r.mode & R_BORDER) {
+ disprect.xmin = scene->r.border.xmin*winx;
+ disprect.xmax = scene->r.border.xmax*winx;
- disprect.ymin= scene->r.border.ymin*winy;
- disprect.ymax= scene->r.border.ymax*winy;
+ disprect.ymin = scene->r.border.ymin*winy;
+ disprect.ymax = scene->r.border.ymax*winy;
}
else {
- disprect.xmin= disprect.ymin= 0;
- disprect.xmax= winx;
- disprect.ymax= winy;
+ disprect.xmin = disprect.ymin = 0;
+ disprect.xmax = winx;
+ disprect.ymax = winy;
}
- if(scenode)
+ if (scenode)
scene= scenode;
/* get render: it can be called from UI with draw callbacks */
re= RE_GetRender(scene->id.name);
- if(re==NULL)
+ if (re==NULL)
re= RE_NewRender(scene->id.name);
RE_InitState(re, NULL, &scene->r, NULL, winx, winy, &disprect);
re->scene= scene;
@@ -2309,43 +2334,47 @@ void RE_set_max_threads(int threads)
{
if (threads==0) {
RenderGlobal.threads = BLI_system_thread_count();
- } else if(threads>=1 && threads<=BLENDER_MAX_THREADS) {
+ }
+ else if (threads>=1 && threads<=BLENDER_MAX_THREADS) {
RenderGlobal.threads= threads;
- } else {
+ }
+ else {
printf("Error, threads has to be in range 0-%d\n", BLENDER_MAX_THREADS);
}
}
void RE_init_threadcount(Render *re)
{
- if(RenderGlobal.threads >= 1) { /* only set as an arg in background mode */
+ if (RenderGlobal.threads >= 1) { /* only set as an arg in background mode */
re->r.threads= MIN2(RenderGlobal.threads, BLENDER_MAX_THREADS);
- } else if ((re->r.mode & R_FIXED_THREADS)==0 || RenderGlobal.threads == 0) { /* Automatic threads */
+ }
+ else if ((re->r.mode & R_FIXED_THREADS)==0 || RenderGlobal.threads == 0) { /* Automatic threads */
re->r.threads = BLI_system_thread_count();
}
}
/* loads in image into a result, size must match
- * x/y offsets are only used on a partial copy when dimensions dont match */
+ * x/y offsets are only used on a partial copy when dimensions don't match */
void RE_layer_load_from_file(RenderLayer *layer, ReportList *reports, const char *filename, int x, int y)
{
ImBuf *ibuf = IMB_loadiffname(filename, IB_rect);
- if(ibuf && (ibuf->rect || ibuf->rect_float)) {
+ if (ibuf && (ibuf->rect || ibuf->rect_float)) {
if (ibuf->x == layer->rectx && ibuf->y == layer->recty) {
- if(ibuf->rect_float==NULL)
+ if (ibuf->rect_float==NULL)
IMB_float_from_rect(ibuf);
memcpy(layer->rectf, ibuf->rect_float, sizeof(float)*4*layer->rectx*layer->recty);
- } else {
+ }
+ else {
if ((ibuf->x - x >= layer->rectx) && (ibuf->y - y >= layer->recty)) {
ImBuf *ibuf_clip;
- if(ibuf->rect_float==NULL)
+ if (ibuf->rect_float==NULL)
IMB_float_from_rect(ibuf);
ibuf_clip = IMB_allocImBuf(layer->rectx, layer->recty, 32, IB_rectfloat);
- if(ibuf_clip) {
+ if (ibuf_clip) {
IMB_rectcpy(ibuf_clip, ibuf, 0,0, x,y, layer->rectx, layer->recty);
memcpy(layer->rectf, ibuf_clip->rect_float, sizeof(float)*4*layer->rectx*layer->recty);
@@ -2369,7 +2398,7 @@ void RE_layer_load_from_file(RenderLayer *layer, ReportList *reports, const char
void RE_result_load_from_file(RenderResult *result, ReportList *reports, const char *filename)
{
- if(!render_result_exr_file_read_path(result, filename)) {
+ if (!render_result_exr_file_read_path(result, filename)) {
BKE_reportf(reports, RPT_ERROR, "RE_result_rect_from_file: failed to load '%s'\n", filename);
return;
}
@@ -2386,7 +2415,7 @@ int RE_WriteEnvmapResult(struct ReportList *reports, Scene *scene, EnvMap *env,
int maxX=0,maxY=0,i=0;
char filepath[FILE_MAX];
- if(env->cube[1]==NULL) {
+ if (env->cube[1]==NULL) {
BKE_report(reports, RPT_ERROR, "There is no generated environment map available to save");
return 0;
}
@@ -2428,7 +2457,7 @@ int RE_WriteEnvmapResult(struct ReportList *reports, Scene *scene, EnvMap *env,
IMB_freeImBuf(ibuf);
- if(ok) {
+ if (ok) {
return TRUE;
}
else {
diff --git a/source/blender/render/intern/source/pixelblending.c b/source/blender/render/intern/source/pixelblending.c
index 708f46971be..48ce611fed7 100644
--- a/source/blender/render/intern/source/pixelblending.c
+++ b/source/blender/render/intern/source/pixelblending.c
@@ -55,7 +55,7 @@ extern struct Render R;
/* ------------------------------------------------------------------------- */
-/* Debug/behaviour defines */
+/* Debug/behavior defines */
/* if defined: alpha blending with floats clips color, as with shorts */
/* #define RE_FLOAT_COLOR_CLIPPING */
/* if defined: alpha values are clipped */
@@ -119,28 +119,28 @@ void addalphaAddfacFloat(float *dest, float *source, char addfac)
/* blend colors*/
c= (m * dest[0]) + source[0];
#ifdef RE_FLOAT_COLOR_CLIPPING
- if(c >= RE_FULL_COLOR_FLOAT) dest[0] = RE_FULL_COLOR_FLOAT;
+ if (c >= RE_FULL_COLOR_FLOAT) dest[0] = RE_FULL_COLOR_FLOAT;
else
#endif
dest[0]= c;
c= (m * dest[1]) + source[1];
#ifdef RE_FLOAT_COLOR_CLIPPING
- if(c >= RE_FULL_COLOR_FLOAT) dest[1] = RE_FULL_COLOR_FLOAT;
+ if (c >= RE_FULL_COLOR_FLOAT) dest[1] = RE_FULL_COLOR_FLOAT;
else
#endif
dest[1]= c;
c= (m * dest[2]) + source[2];
#ifdef RE_FLOAT_COLOR_CLIPPING
- if(c >= RE_FULL_COLOR_FLOAT) dest[2] = RE_FULL_COLOR_FLOAT;
+ if (c >= RE_FULL_COLOR_FLOAT) dest[2] = RE_FULL_COLOR_FLOAT;
else
#endif
dest[2]= c;
c= (m * dest[3]) + source[3];
#ifdef RE_ALPHA_CLIPPING
- if(c >= RE_FULL_COLOR_FLOAT) dest[3] = RE_FULL_COLOR_FLOAT;
+ if (c >= RE_FULL_COLOR_FLOAT) dest[3] = RE_FULL_COLOR_FLOAT;
else
#endif
dest[3]= c;
@@ -172,12 +172,12 @@ void add_filt_fmask(unsigned int mask, float *col, float *rowbuf, int row_w)
maskand= (mask & 255);
maskshift= (mask >>8);
- for(j=2; j>=0; j--) {
+ for (j=2; j>=0; j--) {
a= j;
val= *(fmask1[a] +maskand) + *(fmask2[a] +maskshift);
- if(val!=0.0f) {
+ if (val!=0.0f) {
rb1[0]+= val*r;
rb1[1]+= val*g;
rb1[2]+= val*b;
@@ -186,7 +186,7 @@ void add_filt_fmask(unsigned int mask, float *col, float *rowbuf, int row_w)
a+=3;
val= *(fmask1[a] +maskand) + *(fmask2[a] +maskshift);
- if(val!=0.0f) {
+ if (val!=0.0f) {
rb2[0]+= val*r;
rb2[1]+= val*g;
rb2[2]+= val*b;
@@ -195,7 +195,7 @@ void add_filt_fmask(unsigned int mask, float *col, float *rowbuf, int row_w)
a+=3;
val= *(fmask1[a] +maskand) + *(fmask2[a] +maskshift);
- if(val!=0.0f) {
+ if (val!=0.0f) {
rb3[0]+= val*r;
rb3[1]+= val*g;
rb3[2]+= val*b;
@@ -216,7 +216,7 @@ void mask_array(unsigned int mask, float filt[][3])
unsigned int maskshift= (mask >>8);
int a, j;
- for(j=2; j>=0; j--) {
+ for (j=2; j>=0; j--) {
a= j;
@@ -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)
{
@@ -270,7 +269,7 @@ void add_filt_fmask_coord(float filt[][3], float *col, float *rowbuf, int row_w,
fpoin[1][2]= fpoin[1][1] + 4;
fpoin[2][2]= fpoin[2][1] + 4;
- if(y==0) {
+ if (y==0) {
fpoin[0][0]= fpoin[1][0];
fpoin[0][1]= fpoin[1][1];
fpoin[0][2]= fpoin[1][2];
@@ -279,7 +278,7 @@ void add_filt_fmask_coord(float filt[][3], float *col, float *rowbuf, int row_w,
lfilt[0][1]= filt[2][1];
lfilt[0][2]= filt[2][2];
}
- else if(y==col_h-1) {
+ else if (y==col_h-1) {
fpoin[2][0]= fpoin[1][0];
fpoin[2][1]= fpoin[1][1];
fpoin[2][2]= fpoin[1][2];
@@ -289,7 +288,7 @@ void add_filt_fmask_coord(float filt[][3], float *col, float *rowbuf, int row_w,
lfilt[2][2]= filt[0][2];
}
- if(x==0) {
+ if (x==0) {
fpoin[2][0]= fpoin[2][1];
fpoin[1][0]= fpoin[1][1];
fpoin[0][0]= fpoin[0][1];
@@ -298,7 +297,7 @@ void add_filt_fmask_coord(float filt[][3], float *col, float *rowbuf, int row_w,
lfilt[1][0]= filt[1][2];
lfilt[0][0]= filt[0][2];
}
- else if(x==row_w-1) {
+ else if (x==row_w-1) {
fpoin[2][2]= fpoin[2][1];
fpoin[1][2]= fpoin[1][1];
fpoin[0][2]= fpoin[0][1];
@@ -310,7 +309,7 @@ void add_filt_fmask_coord(float filt[][3], float *col, float *rowbuf, int row_w,
/* loop unroll */
-#define MASKFILT(i, j) val= lfilt[i][j]; if(val!=0.0f) {float *fp= fpoin[i][j]; fp[0]+= val*r; fp[1]+= val*g; fp[2]+= val*b; fp[3]+= val*al; }
+#define MASKFILT(i, j) val= lfilt[i][j]; if (val!=0.0f) {float *fp= fpoin[i][j]; fp[0]+= val*r; fp[1]+= val*g; fp[2]+= val*b; fp[3]+= val*al; }
MASKFILT(0, 0)
MASKFILT(0, 1)
@@ -339,27 +338,27 @@ void add_filt_fmask_pixsize(unsigned int mask, float *in, float *rowbuf, int row
maskand= (mask & 255);
maskshift= (mask >>8);
- for(j=2; j>=0; j--) {
+ for (j=2; j>=0; j--) {
a= j;
val= *(fmask1[a] +maskand) + *(fmask2[a] +maskshift);
- if(val!=0.0f) {
- for(i= 0; i<pixsize; i++)
+ if (val!=0.0f) {
+ for (i= 0; i<pixsize; i++)
rb1[i]+= val*in[i];
}
a+=3;
val= *(fmask1[a] +maskand) + *(fmask2[a] +maskshift);
- if(val!=0.0f) {
- for(i= 0; i<pixsize; i++)
+ if (val!=0.0f) {
+ for (i= 0; i<pixsize; i++)
rb2[i]+= val*in[i];
}
a+=3;
val= *(fmask1[a] +maskand) + *(fmask2[a] +maskshift);
- if(val!=0.0f) {
- for(i= 0; i<pixsize; i++)
+ if (val!=0.0f) {
+ for (i= 0; i<pixsize; i++)
rb3[i]+= val*in[i];
}
@@ -374,7 +373,7 @@ void addalphaAddFloat(float *dest, float *source)
{
/* Makes me wonder whether this is required... */
- if( dest[3] < RE_EMPTY_COLOR_FLOAT) {
+ if ( dest[3] < RE_EMPTY_COLOR_FLOAT) {
dest[0] = source[0];
dest[1] = source[1];
dest[2] = source[2];
diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c
index 9746a6dbd86..826a31e17a8 100644
--- a/source/blender/render/intern/source/pixelshading.c
+++ b/source/blender/render/intern/source/pixelshading.c
@@ -89,14 +89,14 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
vn= har->no;
- for(go=R.lights.first; go; go= go->next) {
+ for (go=R.lights.first; go; go= go->next) {
lar= go->lampren;
/* test for lamplayer */
- if(lar->mode & LA_LAYER) if((lar->lay & har->lay)==0) continue;
+ if (lar->mode & LA_LAYER) if ((lar->lay & har->lay)==0) continue;
/* lampdist cacluation */
- if(lar->type==LA_SUN || lar->type==LA_HEMI) {
+ if (lar->type==LA_SUN || lar->type==LA_HEMI) {
copy_v3_v3(lv, lar->vec);
lampdist= 1.0;
}
@@ -111,11 +111,11 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
/* ld is re-used further on (texco's) */
- if(lar->mode & LA_QUAD) {
+ if (lar->mode & LA_QUAD) {
t= 1.0;
- if(lar->ld1>0.0f)
+ if (lar->ld1>0.0f)
t= lar->dist/(lar->dist+lar->ld1*ld);
- if(lar->ld2>0.0f)
+ if (lar->ld2>0.0f)
t*= lar->distkw/(lar->distkw+lar->ld2*ld*ld);
lampdist= t;
@@ -124,9 +124,9 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
lampdist= (lar->dist/(lar->dist+ld));
}
- if(lar->mode & LA_SPHERE) {
+ if (lar->mode & LA_SPHERE) {
t= lar->dist - ld;
- if(t<0.0f) continue;
+ if (t<0.0f) continue;
t/= lar->dist;
lampdist*= (t);
@@ -138,11 +138,12 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
lacol[1]= lar->g;
lacol[2]= lar->b;
- if(lar->mode & LA_TEXTURE) {
+ if (lar->mode & LA_TEXTURE) {
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 */
@@ -151,10 +152,10 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
do_lamp_tex(lar, lv, &shi, lacol, LA_TEXTURE);
}
- if(lar->type==LA_SPOT) {
+ if (lar->type==LA_SPOT) {
- if(lar->mode & LA_SQUARE) {
- if(lv[0]*lar->vec[0]+lv[1]*lar->vec[1]+lv[2]*lar->vec[2]>0.0f) {
+ if (lar->mode & LA_SQUARE) {
+ if (lv[0]*lar->vec[0]+lv[1]*lar->vec[1]+lv[2]*lar->vec[2]>0.0f) {
float x, lvrot[3];
/* rotate view to lampspace */
@@ -173,25 +174,25 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
}
t= lar->spotsi;
- if(inpr<t) continue;
+ if (inpr<t) continue;
else {
t= inpr-t;
soft= 1.0;
- if(t<lar->spotbl && lar->spotbl!=0.0f) {
+ if (t<lar->spotbl && lar->spotbl!=0.0f) {
/* soft area */
i= t/lar->spotbl;
t= i*i;
soft= (3.0f*t-2.0f*t*i);
inpr*= soft;
}
- if(lar->mode & LA_ONLYSHADOW) {
- /* if(ma->mode & MA_SHADOW) { */
+ if (lar->mode & LA_ONLYSHADOW) {
+ /* if (ma->mode & MA_SHADOW) { */
/* dot product positive: front side face! */
inp= vn[0]*lv[0] + vn[1]*lv[1] + vn[2]*lv[2];
- if(inp>0.0f) {
+ if (inp>0.0f) {
/* testshadowbuf==0.0 : 100% shadow */
shadfac = testshadowbuf(&R, lar->shb, rco, dco, dco, inp, 0.0f);
- if( shadfac>0.0f ) {
+ if ( shadfac>0.0f ) {
shadfac*= inp*soft*lar->energy;
ir -= shadfac;
ig -= shadfac;
@@ -204,7 +205,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
}
lampdist*=inpr;
}
- if(lar->mode & LA_ONLYSHADOW) continue;
+ if (lar->mode & LA_ONLYSHADOW) continue;
}
@@ -216,32 +217,32 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
i= inp;
- if(lar->type==LA_HEMI) {
+ if (lar->type==LA_HEMI) {
i= 0.5f*i+0.5f;
}
- if(i>0.0f) {
+ if (i>0.0f) {
i*= lampdist;
}
/* shadow */
- if(i> -0.41f) { /* heuristic valua! */
- if(lar->shb) {
+ if (i> -0.41f) { /* heuristic valua! */
+ if (lar->shb) {
shadfac = testshadowbuf(&R, lar->shb, rco, dco, dco, inp, 0.0f);
- if(shadfac==0.0f) continue;
+ if (shadfac==0.0f) continue;
i*= shadfac;
}
}
- if(i>0.0f) {
+ if (i>0.0f) {
ir+= i*lacol[0];
ig+= i*lacol[1];
ib+= i*lacol[2];
}
}
- if(ir<0.0f) ir= 0.0f;
- if(ig<0.0f) ig= 0.0f;
- if(ib<0.0f) ib= 0.0f;
+ if (ir<0.0f) ir= 0.0f;
+ if (ig<0.0f) ig= 0.0f;
+ if (ib<0.0f) ib= 0.0f;
col_r[0]*= ir;
col_r[1]*= ig;
@@ -252,18 +253,18 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
/**
* Converts a halo z-buffer value to distance from the camera's near plane
- * @param z The z-buffer value to convert
- * @return a distance from the camera's near plane in blender units
+ * \param z The z-buffer value to convert
+ * \return a distance from the camera's near plane in blender units
*/
static float haloZtoDist(int z)
{
float zco = 0;
- if(z >= 0x7FFFFF)
+ if (z >= 0x7FFFFF)
return 10e10;
else {
zco = (float)z/(float)0x7FFFFF;
- if(R.r.mode & R_ORTHO)
+ if (R.r.mode & R_ORTHO)
return (R.winmat[3][2] - zco*R.winmat[3][3])/(R.winmat[2][2]);
else
return (R.winmat[3][2])/(R.winmat[2][2] - R.winmat[2][3]*zco);
@@ -271,13 +272,13 @@ static float haloZtoDist(int z)
}
/**
- * @param col (float[4]) Store the rgb color here (with alpha)
+ * \param col (float[4]) Store the rgb color here (with alpha)
* The alpha is used to blend the color to the background
* color_new = (1-alpha)*color_background + color
- * @param zz The current zbuffer value at the place of this pixel
- * @param dist Distance of the pixel from the center of the halo squared. Given in pixels
- * @param xn The x coordinate of the pixel relaticve to the center of the halo. given in pixels
- * @param yn The y coordinate of the pixel relaticve to the center of the halo. given in pixels
+ * \param zz The current zbuffer value at the place of this pixel
+ * \param dist Distance of the pixel from the center of the halo squared. Given in pixels
+ * \param xn The x coordinate of the pixel relaticve to the center of the halo. given in pixels
+ * \param yn The y coordinate of the pixel relaticve to the center of the halo. given in pixels
*/
int shadeHaloFloat(HaloRen *har, float *col, int zz,
float dist, float xn, float yn, short flarec)
@@ -286,8 +287,8 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz,
float t, zn, radist, ringf=0.0f, linef=0.0f, alpha, si, co;
int a;
- if(R.wrld.mode & WO_MIST) {
- if(har->type & HA_ONLYSKY) {
+ if (R.wrld.mode & WO_MIST) {
+ if (har->type & HA_ONLYSKY) {
/* stars but no mist */
alpha= har->alfa;
}
@@ -298,37 +299,37 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz,
}
else alpha= har->alfa;
- if(alpha==0.0f)
+ if (alpha==0.0f)
return 0;
/* soften the halo if it intersects geometry */
- if(har->mat && har->mat->mode & MA_HALO_SOFT) {
+ if (har->mat && har->mat->mode & MA_HALO_SOFT) {
float segment_length, halo_depth, distance_from_z /* , visible_depth */ /* UNUSED */, soften;
/* calculate halo depth */
segment_length= har->hasize*sasqrt(1.0f - dist/(har->rad*har->rad));
halo_depth= 2.0f*segment_length;
- if(halo_depth < FLT_EPSILON)
+ if (halo_depth < FLT_EPSILON)
return 0;
/* calculate how much of this depth is visible */
distance_from_z = haloZtoDist(zz) - haloZtoDist(har->zs);
/* visible_depth = halo_depth; */ /* UNUSED */
- if(distance_from_z < segment_length) {
+ if (distance_from_z < segment_length) {
soften= (segment_length + distance_from_z)/halo_depth;
/* apply softening to alpha */
- if(soften < 1.0f)
+ if (soften < 1.0f)
alpha *= soften;
- if(alpha <= 0.0f)
+ if (alpha <= 0.0f)
return 0;
}
}
else {
/* not a soft halo. use the old softening code */
/* halo being intersected? */
- if(har->zs> zz-har->zd) {
+ if (har->zs> zz-har->zd) {
t= ((float)(zz-har->zs))/(float)har->zd;
alpha*= sqrtf(sqrtf(t));
}
@@ -337,31 +338,31 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz,
radist= sqrt(dist);
/* watch it: not used nicely: flarec is set at zero in pixstruct */
- if(flarec) har->pixels+= (int)(har->rad-radist);
+ if (flarec) har->pixels+= (int)(har->rad-radist);
- if(har->ringc) {
+ if (har->ringc) {
float *rc, fac;
int ofs;
/* per ring an antialised circle */
ofs= har->seed;
- for(a= har->ringc; a>0; a--, ofs+=2) {
+ for (a= har->ringc; a>0; a--, ofs+=2) {
rc= hashvectf + (ofs % 768);
fac= fabsf( rc[1]*(har->rad*fabsf(rc[0]) - radist) );
- if(fac< 1.0f) {
+ if (fac< 1.0f) {
ringf+= (1.0f-fac);
}
}
}
- if(har->type & HA_VECT) {
+ if (har->type & HA_VECT) {
dist= fabsf( har->cos*(yn) - har->sin*(xn) )/har->rad;
- if(dist>1.0f) dist= 1.0f;
- if(har->tex) {
+ if (dist>1.0f) dist= 1.0f;
+ if (har->tex) {
zn= har->sin*xn - har->cos*yn;
yn= har->cos*xn + har->sin*yn;
xn= zn;
@@ -369,49 +370,49 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz,
}
else dist= dist/har->radsq;
- if(har->type & HA_FLARECIRC) {
+ if (har->type & HA_FLARECIRC) {
dist= 0.5+fabs(dist-0.5f);
}
- if(har->hard>=30) {
+ if (har->hard>=30) {
dist= sqrt(dist);
- if(har->hard>=40) {
+ if (har->hard>=40) {
dist= sinf(dist*(float)M_PI_2);
- if(har->hard>=50) {
+ if (har->hard>=50) {
dist= sqrt(dist);
}
}
}
- else if(har->hard<20) dist*=dist;
+ else if (har->hard<20) dist*=dist;
- if(dist < 1.0f)
+ if (dist < 1.0f)
dist= (1.0f-dist);
else
dist= 0.0f;
- if(har->linec) {
+ if (har->linec) {
float *rc, fac;
int ofs;
/* per starpoint an antialiased line */
ofs= har->seed;
- for(a= har->linec; a>0; a--, ofs+=3) {
+ for (a= har->linec; a>0; a--, ofs+=3) {
rc= hashvectf + (ofs % 768);
fac= fabs( (xn)*rc[0]+(yn)*rc[1]);
- if(fac< 1.0f )
+ if (fac< 1.0f )
linef+= (1.0f-fac);
}
linef*= dist;
}
- if(har->starpoints) {
+ if (har->starpoints) {
float ster, angle;
/* rotation */
angle= atan2(yn, xn);
@@ -423,15 +424,15 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz,
angle= (co*xn+si*yn)*(co*yn-si*xn);
ster= fabs(angle);
- if(ster>1.0f) {
+ if (ster>1.0f) {
ster= (har->rad)/(ster);
- if(ster<1.0f) dist*= sqrtf(ster);
+ if (ster<1.0f) dist*= sqrtf(ster);
}
}
/* disputable optimize... (ton) */
- if(dist<=0.00001f)
+ if (dist<=0.00001f)
return 0;
dist*= alpha;
@@ -440,7 +441,7 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz,
/* The color is either the rgb spec-ed by the user, or extracted from */
/* the texture */
- if(har->tex) {
+ if (har->tex) {
col[0]= har->r;
col[1]= har->g;
col[2]= har->b;
@@ -457,41 +458,41 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz,
col[0]= dist*har->r;
col[1]= dist*har->g;
col[2]= dist*har->b;
- if(har->type & HA_XALPHA) col[3]= dist*dist;
+ if (har->type & HA_XALPHA) col[3]= dist*dist;
else col[3]= dist;
}
- if(har->mat) {
- if(har->mat->mode & MA_HALO_SHADE) {
+ if (har->mat) {
+ if (har->mat->mode & MA_HALO_SHADE) {
/* we test for lights because of preview... */
- if(R.lights.first) render_lighting_halo(har, col);
+ if (R.lights.first) render_lighting_halo(har, col);
}
/* Next, we do the line and ring factor modifications. */
- if(linef!=0.0f) {
+ if (linef!=0.0f) {
Material *ma= har->mat;
col[0]+= linef * ma->specr;
col[1]+= linef * ma->specg;
col[2]+= linef * ma->specb;
- if(har->type & HA_XALPHA) col[3]+= linef*linef;
+ if (har->type & HA_XALPHA) col[3]+= linef*linef;
else col[3]+= linef;
}
- if(ringf!=0.0f) {
+ if (ringf!=0.0f) {
Material *ma= har->mat;
col[0]+= ringf * ma->mirr;
col[1]+= ringf * ma->mirg;
col[2]+= ringf * ma->mirb;
- if(har->type & HA_XALPHA) col[3]+= ringf*ringf;
+ if (har->type & HA_XALPHA) col[3]+= ringf*ringf;
else col[3]+= ringf;
}
}
/* alpha requires clip, gives black dots */
- if(col[3] > 1.0f)
+ if (col[3] > 1.0f)
col[3]= 1.0f;
return 1;
@@ -509,15 +510,15 @@ void shadeSkyView(float col_r[3], const float rco[3], const float view[3], const
skyflag = WO_ZENUP;
/* Some view vector stuff. */
- if(R.wrld.skytype & WO_SKYREAL) {
+ if (R.wrld.skytype & WO_SKYREAL) {
blend = dot_v3v3(view, R.grvec);
- if(blend<0.0f) skyflag= 0;
+ if (blend<0.0f) skyflag= 0;
blend= fabs(blend);
}
- else if(R.wrld.skytype & WO_SKYPAPER) {
+ else if (R.wrld.skytype & WO_SKYPAPER) {
blend= 0.5f + 0.5f * view[1];
}
else {
@@ -530,9 +531,9 @@ void shadeSkyView(float col_r[3], const float rco[3], const float view[3], const
/* Careful: SKYTEX and SKYBLEND are NOT mutually exclusive! If */
/* SKYBLEND is active, the texture and color blend are added. */
- if(R.wrld.skytype & WO_SKYTEX) {
+ if (R.wrld.skytype & WO_SKYTEX) {
copy_v3_v3(lo, view);
- if(R.wrld.skytype & WO_SKYREAL) {
+ if (R.wrld.skytype & WO_SKYREAL) {
mul_m3_v3(R.imat, lo);
@@ -542,15 +543,16 @@ void shadeSkyView(float col_r[3], const float rco[3], const float view[3], const
do_sky_tex(rco, lo, dxyview, hor, zen, &blend, skyflag, thread);
}
- if(blend>1.0f) blend= 1.0f;
+ if (blend>1.0f) blend= 1.0f;
blendm= 1.0f-blend;
/* No clipping, no conversion! */
- if(R.wrld.skytype & WO_SKYBLEND) {
+ if (R.wrld.skytype & WO_SKYBLEND) {
col_r[0] = (blendm*hor[0] + blend*zen[0]);
col_r[1] = (blendm*hor[1] + blend*zen[1]);
col_r[2] = (blendm*hor[2] + blend*zen[2]);
- } else {
+ }
+ else {
/* Done when a texture was grabbed. */
col_r[0]= hor[0];
col_r[1]= hor[1];
@@ -566,13 +568,13 @@ void shadeSunView(float col_r[3], const float view[3])
float sview[3];
int do_init= 1;
- for(go=R.lights.first; go; go= go->next) {
+ for (go=R.lights.first; go; go= go->next) {
lar= go->lampren;
- if(lar->type==LA_SUN && lar->sunsky && (lar->sunsky->effect_type & LA_SUN_EFFECT_SKY)){
+ if (lar->type==LA_SUN && lar->sunsky && (lar->sunsky->effect_type & LA_SUN_EFFECT_SKY)) {
float sun_collector[3];
float colorxyz[3];
- if(do_init) {
+ if (do_init) {
normalize_v3_v3(sview, view);
mul_m3_v3(R.imat, sview);
@@ -593,21 +595,21 @@ 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;
- if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) {
+ if ((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) {
/* 1. solid color */
copy_v3_v3(collector, &R.wrld.horr);
@@ -617,7 +619,7 @@ void shadeSkyPixel(float collector[4], float fx, float fy, short thread)
/* 2. */
/* This one true because of the context of this routine */
- if(R.wrld.skytype & WO_SKYPAPER) {
+ if (R.wrld.skytype & WO_SKYPAPER) {
view[0]= -1.0f + 2.0f*(fx/(float)R.winx);
view[1]= -1.0f + 2.0f*(fy/(float)R.winy);
view[2]= 0.0;
@@ -629,7 +631,7 @@ void shadeSkyPixel(float collector[4], float fx, float fy, short thread)
calc_view_vector(view, fx, fy);
fac= normalize_v3(view);
- if(R.wrld.skytype & WO_SKYTEX) {
+ if (R.wrld.skytype & WO_SKYTEX) {
dxyview[0]= -R.viewdx/fac;
dxyview[1]= -R.viewdy/fac;
}
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
index ae3748755ff..5d4f9db9a02 100644
--- a/source/blender/render/intern/source/pointdensity.c
+++ b/source/blender/render/intern/source/pointdensity.c
@@ -151,7 +151,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa
for (i=0, pa=psys->particles; i < total_particles; i++, pa++) {
state.time = cfra;
- if(psys_get_particle_state(&sim, i, &state, 0)) {
+ if (psys_get_particle_state(&sim, i, &state, 0)) {
copy_v3_v3(partco, state.co);
@@ -159,7 +159,8 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa
mul_m4_v3(ob->imat, partco);
else if (pd->psys_cache_space == TEX_PD_OBJECTLOC) {
sub_v3_v3(partco, ob->loc);
- } else {
+ }
+ else {
/* TEX_PD_WORLDSPACE */
}
@@ -175,7 +176,8 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa
if (i < psys->totpart) {
pa_time = (cfra - pa->time)/pa->lifetime;
- } else {
+ }
+ else {
ChildParticle *cpa= (psys->child + i) - psys->totpart;
float pa_birthtime, pa_dietime;
@@ -191,7 +193,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa
BLI_bvhtree_balance(pd->point_tree);
dm->release(dm);
- if(psys->lattice){
+ if (psys->lattice) {
end_latt_deform(psys->lattice);
psys->lattice=0;
}
@@ -214,7 +216,7 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, Object *ob)
pd->point_tree = BLI_bvhtree_new(pd->totpoints, 0.0, 4, 6);
- for(i=0; i < pd->totpoints; i++, mvert++) {
+ for (i=0; i < pd->totpoints; i++, mvert++) {
float co[3];
copy_v3_v3(co, mvert->co);
@@ -243,7 +245,7 @@ void cache_pointdensity(Render *re, Tex *tex)
{
PointDensity *pd = tex->pd;
- if(!pd)
+ if (!pd)
return;
if (pd->point_tree) {
@@ -293,14 +295,14 @@ void make_pointdensities(Render *re)
{
Tex *tex;
- if(re->scene->r.scemode & R_PREVIEWBUTS)
+ if (re->scene->r.scemode & R_PREVIEWBUTS)
return;
re->i.infostr= "Caching Point Densities";
re->stats_draw(re->sdh, &re->i);
for (tex= re->main->tex.first; tex; tex= tex->id.next) {
- if(tex->id.us && tex->type==TEX_POINTDENSITY) {
+ if (tex->id.us && tex->type==TEX_POINTDENSITY) {
cache_pointdensity(re, tex);
}
}
@@ -313,11 +315,11 @@ void free_pointdensities(Render *re)
{
Tex *tex;
- if(re->scene->r.scemode & R_PREVIEWBUTS)
+ if (re->scene->r.scemode & R_PREVIEWBUTS)
return;
for (tex= re->main->tex.first; tex; tex= tex->id.next) {
- if(tex->id.us && tex->type==TEX_POINTDENSITY) {
+ if (tex->id.us && tex->type==TEX_POINTDENSITY) {
free_pointdensity(re, tex);
}
}
@@ -346,9 +348,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 +517,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 6c0386cc8b1..1222dd121a7 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -87,7 +87,7 @@ static int test_break(void *data)
static void RE_rayobject_config_control(RayObject *r, Render *re)
{
- if(RE_rayobject_isRayAPI(r))
+ if (RE_rayobject_isRayAPI(r))
{
r = RE_rayobject_align( r );
r->control.data = re;
@@ -99,7 +99,7 @@ static RayObject* RE_rayobject_create(Render *re, int type, int size)
{
RayObject * res = NULL;
- if(type == R_RAYSTRUCTURE_AUTO)
+ if (type == R_RAYSTRUCTURE_AUTO)
{
//TODO
//if(detect_simd())
@@ -111,7 +111,7 @@ static RayObject* RE_rayobject_create(Render *re, int type, int size)
}
#ifndef __SSE__
- if(type == R_RAYSTRUCTURE_SIMD_SVBVH || type == R_RAYSTRUCTURE_SIMD_QBVH)
+ if (type == R_RAYSTRUCTURE_SIMD_SVBVH || type == R_RAYSTRUCTURE_SIMD_QBVH)
{
puts("Warning: Using VBVH (SSE was disabled at compile time)");
type = R_RAYSTRUCTURE_VBVH;
@@ -119,22 +119,22 @@ static RayObject* RE_rayobject_create(Render *re, int type, int size)
#endif
- if(type == R_RAYSTRUCTURE_OCTREE) //TODO dynamic ocres
+ if (type == R_RAYSTRUCTURE_OCTREE) //TODO dynamic ocres
res = RE_rayobject_octree_create(re->r.ocres, size);
- else if(type == R_RAYSTRUCTURE_BLIBVH)
+ else if (type == R_RAYSTRUCTURE_BLIBVH)
res = RE_rayobject_blibvh_create(size);
- else if(type == R_RAYSTRUCTURE_VBVH)
+ else if (type == R_RAYSTRUCTURE_VBVH)
res = RE_rayobject_vbvh_create(size);
- else if(type == R_RAYSTRUCTURE_SIMD_SVBVH)
+ else if (type == R_RAYSTRUCTURE_SIMD_SVBVH)
res = RE_rayobject_svbvh_create(size);
- else if(type == R_RAYSTRUCTURE_SIMD_QBVH)
+ else if (type == R_RAYSTRUCTURE_SIMD_QBVH)
res = RE_rayobject_qbvh_create(size);
else
res = RE_rayobject_vbvh_create(size); //Fallback
- if(res)
- RE_rayobject_config_control( res, re );
+ if (res)
+ RE_rayobject_config_control(res, re);
return res;
}
@@ -148,36 +148,36 @@ void freeraytree(Render *re)
{
ObjectInstanceRen *obi;
- if(re->raytree)
+ if (re->raytree)
{
RE_rayobject_free(re->raytree);
re->raytree = NULL;
}
- if(re->rayfaces)
+ if (re->rayfaces)
{
MEM_freeN(re->rayfaces);
re->rayfaces = NULL;
}
- if(re->rayprimitives)
+ if (re->rayprimitives)
{
MEM_freeN(re->rayprimitives);
re->rayprimitives = NULL;
}
- for(obi=re->instancetable.first; obi; obi=obi->next)
+ for (obi=re->instancetable.first; obi; obi=obi->next)
{
ObjectRen *obr = obi->obr;
- if(obr->raytree)
+ if (obr->raytree)
{
RE_rayobject_free(obr->raytree);
obr->raytree = NULL;
}
- if(obr->rayfaces)
+ if (obr->rayfaces)
{
MEM_freeN(obr->rayfaces);
obr->rayfaces = NULL;
}
- if(obi->raytree)
+ if (obi->raytree)
{
RE_rayobject_free(obi->raytree);
obi->raytree = NULL;
@@ -189,7 +189,7 @@ void freeraytree(Render *re)
RayCounter sum;
memset( &sum, 0, sizeof(sum) );
int i;
- for(i=0; i<BLENDER_MAX_THREADS; i++)
+ for (i=0; i<BLENDER_MAX_THREADS; i++)
RE_RC_MERGE(&sum, re_rc_counter+i);
RE_RC_INFO(&sum);
}
@@ -199,8 +199,8 @@ void freeraytree(Render *re)
static int is_raytraceable_vlr(Render *re, VlakRen *vlr)
{
/* note: volumetric must be tracable, wire must not */
- if((re->flag & R_BAKE_TRACE) || (vlr->flag & R_TRACEBLE) || (vlr->mat->material_type == MA_TYPE_VOLUME))
- if(vlr->mat->material_type != MA_TYPE_WIRE)
+ if ((re->flag & R_BAKE_TRACE) || (vlr->flag & R_TRACEBLE) || (vlr->mat->material_type == MA_TYPE_VOLUME))
+ if (vlr->mat->material_type != MA_TYPE_WIRE)
return 1;
return 0;
}
@@ -210,13 +210,13 @@ static int is_raytraceable(Render *re, ObjectInstanceRen *obi)
int v;
ObjectRen *obr = obi->obr;
- if(re->excludeob && obr->ob == re->excludeob)
+ if (re->excludeob && obr->ob == re->excludeob)
return 0;
- for(v=0;v<obr->totvlak;v++) {
+ for (v=0;v<obr->totvlak;v++) {
VlakRen *vlr = obr->vlaknodes[v>>8].vlak + (v&255);
- if(is_raytraceable_vlr(re, vlr))
+ if (is_raytraceable_vlr(re, vlr))
return 1;
}
@@ -232,7 +232,7 @@ RayObject* makeraytree_object(Render *re, ObjectInstanceRen *obi)
// update render stats
ObjectRen *obr = obi->obr;
- if(obr->raytree == NULL)
+ if (obr->raytree == NULL)
{
RayObject *raytree;
RayFace *face = NULL;
@@ -241,10 +241,10 @@ RayObject* makeraytree_object(Render *re, ObjectInstanceRen *obi)
//Count faces
int faces = 0;
- for(v=0;v<obr->totvlak;v++)
+ for (v=0;v<obr->totvlak;v++)
{
VlakRen *vlr = obr->vlaknodes[v>>8].vlak + (v&255);
- if(is_raytraceable_vlr(re, vlr))
+ if (is_raytraceable_vlr(re, vlr))
faces++;
}
@@ -253,26 +253,24 @@ RayObject* makeraytree_object(Render *re, ObjectInstanceRen *obi)
//Create Ray cast accelaration structure
raytree = RE_rayobject_create( re, re->r.raytrace_structure, faces );
- if( (re->r.raytrace_options & R_RAYTRACE_USE_LOCAL_COORDS) )
+ if ( (re->r.raytrace_options & R_RAYTRACE_USE_LOCAL_COORDS) )
vlakprimitive = obr->rayprimitives = (VlakPrimitive*)MEM_callocN(faces*sizeof(VlakPrimitive), "ObjectRen primitives");
else
face = obr->rayfaces = (RayFace*)MEM_callocN(faces*sizeof(RayFace), "ObjectRen faces");
obr->rayobi = obi;
- for(v=0;v<obr->totvlak;v++)
+ for (v=0;v<obr->totvlak;v++)
{
VlakRen *vlr = obr->vlaknodes[v>>8].vlak + (v&255);
- if(is_raytraceable_vlr(re, vlr))
+ 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++;
}
@@ -281,38 +279,38 @@ RayObject* makeraytree_object(Render *re, ObjectInstanceRen *obi)
RE_rayobject_done( raytree );
/* in case of cancel during build, raytree is not usable */
- if(test_break(re))
+ if (test_break(re))
RE_rayobject_free(raytree);
else
obr->raytree= raytree;
}
- if(obr->raytree) {
- if((obi->flag & R_TRANSFORMED) && obi->raytree == NULL)
+ if (obr->raytree) {
+ if ((obi->flag & R_TRANSFORMED) && obi->raytree == NULL)
{
obi->transform_primitives = 0;
obi->raytree = RE_rayobject_instance_create( obr->raytree, obi->mat, obi, obi->obr->rayobi );
}
}
- if(obi->raytree) return obi->raytree;
+ if (obi->raytree) return obi->raytree;
return obi->obr->raytree;
}
static int has_special_rayobject(Render *re, ObjectInstanceRen *obi)
{
- if( (obi->flag & R_TRANSFORMED) && (re->r.raytrace_options & R_RAYTRACE_USE_INSTANCES) )
+ if ( (obi->flag & R_TRANSFORMED) && (re->r.raytrace_options & R_RAYTRACE_USE_INSTANCES) )
{
ObjectRen *obr = obi->obr;
int v, faces = 0;
- for(v=0;v<obr->totvlak;v++)
+ for (v=0;v<obr->totvlak;v++)
{
VlakRen *vlr = obr->vlaknodes[v>>8].vlak + (v&255);
- if(is_raytraceable_vlr(re, vlr))
+ if (is_raytraceable_vlr(re, vlr))
{
faces++;
- if(faces > 4)
+ if (faces > 4)
return 1;
}
}
@@ -330,29 +328,27 @@ static void makeraytree_single(Render *re)
VlakPrimitive *vlakprimitive = NULL;
int faces = 0, obs = 0, special = 0;
- for(obi=re->instancetable.first; obi; obi=obi->next)
- if(is_raytraceable(re, obi))
+ for (obi=re->instancetable.first; obi; obi=obi->next)
+ if (is_raytraceable(re, obi))
{
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++)
+ for (v=0;v<obr->totvlak;v++)
{
VlakRen *vlr = obr->vlaknodes[v>>8].vlak + (v&255);
- if(is_raytraceable_vlr(re, vlr))
+ if (is_raytraceable_vlr(re, vlr))
faces++;
}
}
}
- if(faces + special == 0)
+ if (faces + special == 0)
{
re->raytree = RE_rayobject_empty_create();
return;
@@ -361,61 +357,55 @@ static void makeraytree_single(Render *re)
//Create raytree
raytree = re->raytree = RE_rayobject_create( re, re->r.raytrace_structure, faces+special );
- if( (re->r.raytrace_options & R_RAYTRACE_USE_LOCAL_COORDS) )
+ if ( (re->r.raytrace_options & R_RAYTRACE_USE_LOCAL_COORDS) )
{
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");
}
- for(obi=re->instancetable.first; obi; obi=obi->next)
- if(is_raytraceable(re, obi))
+ for (obi=re->instancetable.first; obi; obi=obi->next)
+ if (is_raytraceable(re, obi))
{
- if(test_break(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))
+ if (test_break(re))
break;
if (obj)
RE_rayobject_add( re->raytree, obj );
}
- else
- {
+ else {
int v;
ObjectRen *obr = obi->obr;
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
{
obi->transform_primitives = 1;
}
- for(v=0;v<obr->totvlak;v++)
+ 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))
+ if ((obi->flag & R_TRANSFORMED))
{
mul_m4_v3(obi->mat, face->v1);
mul_m4_v3(obi->mat, face->v2);
mul_m4_v3(obi->mat, face->v3);
- if(RE_rayface_isQuad(face))
+ if (RE_rayface_isQuad(face))
mul_m4_v3(obi->mat, face->v4);
}
@@ -427,7 +417,7 @@ static void makeraytree_single(Render *re)
}
}
- if(!test_break(re))
+ if (!test_break(re))
{
re->i.infostr= "Raytree.. building";
re->stats_draw(re->sdh, &re->i);
@@ -445,26 +435,24 @@ 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) */
- if(re->r.raytrace_structure == R_RAYSTRUCTURE_OCTREE)
+ * 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 behaviour of SUN and HEMI lights
+ //This is ONLY needed to kept a bogus behavior of SUN and HEMI lights
INIT_MINMAX(min, max);
RE_rayobject_merge_bb( re->raytree, min, max );
- for(i=0; i<3; i++)
+ for (i=0; i<3; i++)
{
min[i] += 0.01f;
max[i] += 0.01f;
@@ -472,7 +460,7 @@ void makeraytree(Render *re)
}
re->maxdist = dot_v3v3(sub, sub);
- if(re->maxdist > 0.0f) re->maxdist= sqrt(re->maxdist);
+ if (re->maxdist > 0.0f) re->maxdist= sqrt(re->maxdist);
re->i.infostr= "Raytree finished";
re->stats_draw(re->sdh, &re->i);
@@ -483,7 +471,7 @@ void makeraytree(Render *re)
#endif
}
-/* if(shi->osatex) */
+/* if (shi->osatex) */
static void shade_ray_set_derivative(ShadeInput *shi)
{
float detsh, t00, t10, t01, t11;
@@ -493,7 +481,7 @@ static void shade_ray_set_derivative(ShadeInput *shi)
axis_dominant_v3(&axis1, &axis2, shi->facenor);
/* compute u,v and derivatives */
- if(shi->obi->flag & R_TRANSFORMED) {
+ if (shi->obi->flag & R_TRANSFORMED) {
float v1[3], v2[3], v3[3];
mul_v3_m3v3(v1, shi->obi->nmat, shi->v1->co);
@@ -547,7 +535,7 @@ void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
shi->mat= vlr->mat;
shade_input_init_material(shi);
- if(is->isect==2)
+ if (is->isect==2)
shade_input_set_triangle_i(shi, obi, vlr, 0, 2, 3);
else
shade_input_set_triangle_i(shi, obi, vlr, 0, 1, 2);
@@ -556,21 +544,22 @@ void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
shi->v= is->v;
shi->dx_u= shi->dx_v= shi->dy_u= shi->dy_v= 0.0f;
- if(shi->osatex)
+ if (shi->osatex)
shade_ray_set_derivative(shi);
shade_input_set_normals(shi);
shade_input_set_shade_texco(shi);
if (shi->mat->material_type == MA_TYPE_VOLUME) {
- if(ELEM(is->mode, RE_RAY_SHADOW, RE_RAY_SHADOW_TRA)) {
+ if (ELEM(is->mode, RE_RAY_SHADOW, RE_RAY_SHADOW_TRA)) {
shade_volume_shadow(shi, shr, is);
- } else {
+ }
+ else {
shade_volume_outside(shi, shr);
}
}
- else if(is->mode==RE_RAY_SHADOW_TRA) {
+ else if (is->mode==RE_RAY_SHADOW_TRA) {
/* temp hack to prevent recursion */
- if(shi->nodes==0 && shi->mat->nodetree && shi->mat->use_nodes) {
+ if (shi->nodes==0 && shi->mat->nodetree && shi->mat->use_nodes) {
ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
shi->mat= vlr->mat; /* shi->mat is being set in nodetree */
}
@@ -578,7 +567,7 @@ void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
shade_color(shi, shr);
}
else {
- if(shi->mat->nodetree && shi->mat->use_nodes) {
+ if (shi->mat->nodetree && shi->mat->use_nodes) {
ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
shi->mat= vlr->mat; /* shi->mat is being set in nodetree */
}
@@ -600,15 +589,15 @@ static int refraction(float refract[3], const float n[3], const float view[3], f
dot = dot_v3v3(view, n);
- if(dot>0.0f) {
+ if (dot>0.0f) {
index = 1.0f/index;
fac= 1.0f - (1.0f - dot*dot)*index*index;
- if(fac<= 0.0f) return 0;
+ if (fac<= 0.0f) return 0;
fac= -dot*index + sqrtf(fac);
}
else {
fac= 1.0f - (1.0f - dot*dot)*index*index;
- if(fac<= 0.0f) return 0;
+ if (fac<= 0.0f) return 0;
fac= -dot*index - sqrtf(fac);
}
@@ -634,7 +623,7 @@ static void reflection(float ref[3], float n[3], const float view[3], const floa
/* test phong normals, then we should prevent vector going to the back */
f1= dot_v3v3(ref, orn);
- if(f1>0.0f) {
+ if (f1>0.0f) {
f1+= 0.01f;
ref[0]-= f1*orn[0];
ref[1]-= f1*orn[1];
@@ -684,7 +673,7 @@ static float shade_by_transmission(Isect *is, ShadeInput *shi, ShadeResult *shr)
d= shi->mat->tx_limit;
p = shi->mat->tx_falloff;
- if(p < 0.0f) p= 0.0f;
+ if (p < 0.0f) p= 0.0f;
else if (p > 10.0f) p= 10.0f;
shr->alpha *= powf(d, p);
@@ -700,7 +689,8 @@ static void ray_fadeout_endcolor(float col[3], ShadeInput *origshi, ShadeInput *
/* un-intersected rays get either rendered material color or sky color */
if (origshi->mat->fadeto_mir == MA_RAYMIR_FADETOMAT) {
copy_v3_v3(col, shr->combined);
- } else if (origshi->mat->fadeto_mir == MA_RAYMIR_FADETOSKY) {
+ }
+ else if (origshi->mat->fadeto_mir == MA_RAYMIR_FADETOSKY) {
copy_v3_v3(shi->view, vec);
normalize_v3(shi->view);
@@ -741,7 +731,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con
isec.orig.face = vlr;
RE_RC_INIT(isec, shi);
- if(RE_rayobject_raycast(R.raytree, &isec)) {
+ if (RE_rayobject_raycast(R.raytree, &isec)) {
ShadeResult shr= {{0}};
float d= 1.0f;
@@ -753,13 +743,13 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con
shi.osatex= origshi->osatex;
shi.depth= origshi->depth + 1; /* only used to indicate tracing */
shi.thread= origshi->thread;
- //shi.sample= 0; // memset above, so dont need this
+ //shi.sample= 0; // memset above, so don't need this
shi.xs= origshi->xs;
shi.ys= origshi->ys;
shi.lay= origshi->lay;
shi.passflag= SCE_PASS_COMBINED; /* result of tracing needs no pass info */
shi.combinedflag= 0xFFFFFF; /* ray trace does all options */
- //shi.do_preview= 0; // memset above, so dont need this
+ //shi.do_preview= 0; // memset above, so don't need this
shi.light_override= origshi->light_override;
shi.mat_override= origshi->mat_override;
@@ -768,10 +758,10 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con
if (traflag & RAY_INSIDE)
d= shade_by_transmission(&isec, &shi, &shr);
- if(depth>0) {
+ if (depth>0) {
float fr, fg, fb, f, f1;
- if((shi.mat->mode_l & MA_TRANSP) && shr.alpha < 1.0f && (shi.mat->mode_l & (MA_ZTRANSP | MA_RAYTRANSP))) {
+ if ((shi.mat->mode_l & MA_TRANSP) && shr.alpha < 1.0f && (shi.mat->mode_l & (MA_ZTRANSP | MA_RAYTRANSP))) {
float nf, f, refract[3], tracol[4];
tracol[0]= shi.r;
@@ -779,11 +769,11 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con
tracol[2]= shi.b;
tracol[3]= col[3]; // we pass on and accumulate alpha
- if((shi.mat->mode & MA_TRANSP) && (shi.mat->mode & MA_RAYTRANSP)) {
+ if ((shi.mat->mode & MA_TRANSP) && (shi.mat->mode & MA_RAYTRANSP)) {
/* don't overwrite traflag, it's value is used in mirror reflection */
int new_traflag = traflag;
- if(new_traflag & RAY_INSIDE) {
+ if (new_traflag & RAY_INSIDE) {
/* inside the material, so use inverse normal */
float norm[3];
norm[0]= - shi.vn[0];
@@ -832,13 +822,13 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con
else
col[3]= 1.0f;
- if(shi.mat->mode_l & MA_RAYMIRROR) {
+ if (shi.mat->mode_l & MA_RAYMIRROR) {
f= shi.ray_mirror;
- if(f!=0.0f) f*= fresnel_fac(shi.view, shi.vn, shi.mat->fresnel_mir_i, shi.mat->fresnel_mir);
+ if (f!=0.0f) f*= fresnel_fac(shi.view, shi.vn, shi.mat->fresnel_mir_i, shi.mat->fresnel_mir);
}
else f= 0.0f;
- if(f!=0.0f) {
+ if (f!=0.0f) {
float mircol[4];
float ref[3];
@@ -903,16 +893,16 @@ static void DP_energy(float *table, float vec[2], int tot, float xsize, float ys
min*= min;
result[0]= result[1]= 0.0f;
- for(y= -1; y<2; y++) {
+ for (y= -1; y<2; y++) {
dy= ysize*y;
- for(x= -1; x<2; x++) {
+ for (x= -1; x<2; x++) {
dx= xsize*x;
fp= table;
- for(a=0; a<tot; a++, fp+= 2) {
+ for (a=0; a<tot; a++, fp+= 2) {
force[0]= vec[0] - fp[0]-dx;
force[1]= vec[1] - fp[1]-dy;
dist= force[0]*force[0] + force[1]*force[1];
- if(dist < min && dist>0.0f) {
+ if (dist < min && dist>0.0f) {
result[0]+= force[0]/dist;
result[1]+= force[1]/dist;
}
@@ -934,11 +924,11 @@ static void jitter_plane_offset(float *jitter1, float *jitter2, int tot, float s
float hsizex= 0.5f*sizex, hsizey= 0.5f*sizey;
int x;
- for(x=tot; x>0; x--, jitter1+=2, jitter2+=2) {
+ for (x=tot; x>0; x--, jitter1+=2, jitter2+=2) {
jitter2[0]= jitter1[0] + dsizex;
jitter2[1]= jitter1[1] + dsizey;
- if(jitter2[0] > hsizex) jitter2[0]-= sizex;
- if(jitter2[1] > hsizey) jitter2[1]-= sizey;
+ if (jitter2[0] > hsizex) jitter2[0]-= sizex;
+ if (jitter2[1] > hsizey) jitter2[1]-= sizey;
}
}
@@ -950,29 +940,29 @@ void init_jitter_plane(LampRen *lar)
int x, tot= lar->ray_totsamp;
/* test if already initialized */
- if(lar->jitter) return;
+ if (lar->jitter) return;
/* at least 4, or max threads+1 tables */
- if(BLENDER_MAX_THREADS < 4) x= 4;
+ if (BLENDER_MAX_THREADS < 4) x= 4;
else x= BLENDER_MAX_THREADS+1;
fp= lar->jitter= MEM_callocN(x*tot*2*sizeof(float), "lamp jitter tab");
/* if 1 sample, we leave table to be zero's */
- if(tot>1) {
+ if (tot>1) {
int iter=12;
/* set per-lamp fixed seed */
BLI_srandom(tot);
/* fill table with random locations, area_size large */
- for(x=0; x<tot; x++, fp+=2) {
+ for (x=0; x<tot; x++, fp+=2) {
fp[0]= (BLI_frand()-0.5f)*lar->area_size;
fp[1]= (BLI_frand()-0.5f)*lar->area_sizey;
}
- while(iter--) {
+ while (iter--) {
fp= lar->jitter;
- for(x=tot; x>0; x--, fp+=2) {
+ for (x=tot; x>0; x--, fp+=2) {
DP_energy(lar->jitter, fp, tot, lar->area_size, lar->area_sizey);
}
}
@@ -990,17 +980,17 @@ static float *give_jitter_plane(LampRen *lar, int thread, int xs, int ys)
tot= lar->ray_totsamp;
- if(lar->ray_samp_type & LA_SAMP_JITTER) {
+ if (lar->ray_samp_type & LA_SAMP_JITTER) {
/* made it threadsafe */
- if(lar->xold[thread]!=xs || lar->yold[thread]!=ys) {
+ if (lar->xold[thread]!=xs || lar->yold[thread]!=ys) {
jitter_plane_offset(lar->jitter, lar->jitter+2*(thread+1)*tot, tot, lar->area_size, lar->area_sizey, BLI_thread_frand(thread), BLI_thread_frand(thread));
lar->xold[thread]= xs;
lar->yold[thread]= ys;
}
return lar->jitter+2*(thread+1)*tot;
}
- if(lar->ray_samp_type & LA_SAMP_DITHER) {
+ if (lar->ray_samp_type & LA_SAMP_DITHER) {
return lar->jitter + 2*tot*((xs & 1)+2*(ys & 1));
}
@@ -1085,7 +1075,7 @@ static void QMC_initPixel(QMCSampler *qsa, int thread)
else { /* SAMP_TYPE_HALTON */
/* generate a new randomised halton sequence per pixel
- * to alleviate qmc artifacts and make it reproducable
+ * to alleviate qmc artifacts and make it reproducible
* between threads/frames */
double ht_invprimes[2], ht_nums[2];
double r[2];
@@ -1215,8 +1205,8 @@ static QMCSampler *get_thread_qmcsampler(Render *re, int thread, int type, int t
/* create qmc samplers as needed, since recursion makes it hard to
* predict how many are needed */
- for(qsa=re->qmcsamplers[thread].first; qsa; qsa=qsa->next) {
- if(qsa->type == type && qsa->tot == tot && !qsa->used) {
+ for (qsa=re->qmcsamplers[thread].first; qsa; qsa=qsa->next) {
+ if (qsa->type == type && qsa->tot == tot && !qsa->used) {
qsa->used= 1;
return qsa;
}
@@ -1236,11 +1226,11 @@ static void release_thread_qmcsampler(Render *UNUSED(re), int UNUSED(thread), QM
void free_render_qmcsampler(Render *re)
{
- if(re->qmcsamplers) {
+ if (re->qmcsamplers) {
QMCSampler *qsa, *next;
int a;
- for(a=0; a<BLENDER_MAX_THREADS; a++) {
- for(qsa=re->qmcsamplers[a].first; qsa; qsa=next) {
+ for (a=0; a<BLENDER_MAX_THREADS; a++) {
+ for (qsa=re->qmcsamplers[a].first; qsa; qsa=next) {
next= qsa->next;
QMC_freeSampler(qsa);
}
@@ -1282,7 +1272,8 @@ static int adaptive_sample_contrast_val(int samples, float prev, float val, floa
* going to be the same is wasting effort */
if (fabsf( prev/(float)(samples-1) - val/(float)samples ) < thresh) {
return 1;
- } else
+ }
+ else
return 0;
}
@@ -1330,16 +1321,18 @@ static void trace_refract(float col[4], ShadeInput *shi, ShadeResult *shr)
/* all samples are generated per pixel */
qsa = get_thread_qmcsampler(&R, shi->thread, samp_type, max_samples);
QMC_initPixel(qsa, shi->thread);
- } else
+ }
+ else
max_samples = 1;
while (samples < max_samples) {
- if(refraction(v_refract, shi->vn, shi->view, shi->ang)) {
+ if (refraction(v_refract, shi->vn, shi->view, shi->ang)) {
traflag |= RAY_INSIDE;
- } else {
+ }
+ else {
/* total external reflection can happen for materials with IOR < 1.0 */
- if((shi->vlr->flag & R_SMOOTH))
+ if ((shi->vlr->flag & R_SMOOTH))
reflection(v_refract, shi->vn, shi->view, shi->facenor);
else
reflection_simple(v_refract, shi->vn, shi->view);
@@ -1361,7 +1354,8 @@ static void trace_refract(float col[4], ShadeInput *shi, ShadeResult *shr)
add_v3_v3(v_refract_new, orthy);
normalize_v3(v_refract_new);
- } else {
+ }
+ else {
/* no blurriness, use the original normal */
copy_v3_v3(v_refract_new, v_refract);
}
@@ -1429,7 +1423,8 @@ static void trace_reflect(float col[3], ShadeInput *shi, ShadeResult *shr, float
/* all samples are generated per pixel */
qsa = get_thread_qmcsampler(&R, shi->thread, samp_type, max_samples);
QMC_initPixel(qsa, shi->thread);
- } else
+ }
+ else
max_samples = 1;
while (samples < max_samples) {
@@ -1445,7 +1440,8 @@ static void trace_reflect(float col[3], ShadeInput *shi, ShadeResult *shr, float
copy_v3_v3(orthy, shi->tang);
mul_v3_fl(orthx, samp3d[0]);
mul_v3_fl(orthy, samp3d[1]*aniso);
- } else {
+ }
+ else {
ortho_basis_v3v3_v3( orthx, orthy,shi->vn);
mul_v3_fl(orthx, samp3d[0]);
mul_v3_fl(orthy, samp3d[1]);
@@ -1455,12 +1451,13 @@ static void trace_reflect(float col[3], ShadeInput *shi, ShadeResult *shr, float
add_v3_v3v3(v_nor_new, shi->vn, orthx);
add_v3_v3(v_nor_new, orthy);
normalize_v3(v_nor_new);
- } else {
+ }
+ else {
/* no blurriness, use the original normal */
copy_v3_v3(v_nor_new, shi->vn);
}
- if((shi->vlr->flag & R_SMOOTH))
+ if ((shi->vlr->flag & R_SMOOTH))
reflection(v_reflect, v_nor_new, shi->view, shi->facenor);
else
reflection_simple(v_reflect, v_nor_new, shi->view);
@@ -1523,12 +1520,12 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr)
do_mir= ((shi->mat->mode & MA_RAYMIRROR) && shi->ray_mirror!=0.0f && (shi->depth <= shi->mat->ray_depth));
/* raytrace mirror and refract like to separate the spec color */
- if(shi->combinedflag & SCE_PASS_SPEC)
+ if (shi->combinedflag & SCE_PASS_SPEC)
sub_v3_v3v3(diff, shr->combined, shr->spec);
else
copy_v3_v3(diff, shr->combined);
- if(do_tra) {
+ if (do_tra) {
float olddiff[3], f;
trace_refract(tracol, shi, shr);
@@ -1545,18 +1542,18 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr)
diff[1]= f*diff[1] + f1*fg*tracol[1];
diff[2]= f*diff[2] + f1*fb*tracol[2];
- if(shi->passflag & SCE_PASS_REFRACT)
+ if (shi->passflag & SCE_PASS_REFRACT)
sub_v3_v3v3(shr->refr, diff, olddiff);
- if(!(shi->combinedflag & SCE_PASS_REFRACT))
+ if (!(shi->combinedflag & SCE_PASS_REFRACT))
sub_v3_v3v3(diff, diff, shr->refr);
shr->alpha= MIN2(1.0f, tracol[3]);
}
- if(do_mir) {
+ if (do_mir) {
const float i= shi->ray_mirror*fresnel_fac(shi->view, shi->vn, shi->mat->fresnel_mir_i, shi->mat->fresnel_mir);
- if(i!=0.0f) {
+ if (i!=0.0f) {
trace_reflect(mircol, shi, shr, i);
@@ -1564,14 +1561,14 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr)
fg= i*shi->mirg;
fb= i*shi->mirb;
- if(shi->passflag & SCE_PASS_REFLECT) {
+ if (shi->passflag & SCE_PASS_REFLECT) {
/* mirror pass is not blocked out with spec */
shr->refl[0]= fr*mircol[0] - fr*diff[0];
shr->refl[1]= fg*mircol[1] - fg*diff[1];
shr->refl[2]= fb*mircol[2] - fb*diff[2];
}
- if(shi->combinedflag & SCE_PASS_REFLECT) {
+ if (shi->combinedflag & SCE_PASS_REFLECT) {
/* values in shr->spec can be greater then 1.0.
* In this case the mircol uses a zero blending factor, so ignoring it is ok.
* Fixes bug #18837 - when the spec is higher then 1.0,
@@ -1583,14 +1580,14 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr)
diff[1] *= f1;
diff[2] *= f1;
- if(shr->spec[0]<1.0f) diff[0] += mircol[0] * (fr*(1.0f-shr->spec[0]));
- if(shr->spec[1]<1.0f) diff[1] += mircol[1] * (fg*(1.0f-shr->spec[1]));
- if(shr->spec[2]<1.0f) diff[2] += mircol[2] * (fb*(1.0f-shr->spec[2]));
+ if (shr->spec[0]<1.0f) diff[0] += mircol[0] * (fr*(1.0f-shr->spec[0]));
+ if (shr->spec[1]<1.0f) diff[1] += mircol[1] * (fg*(1.0f-shr->spec[1]));
+ if (shr->spec[2]<1.0f) diff[2] += mircol[2] * (fb*(1.0f-shr->spec[2]));
}
}
}
/* put back together */
- if(shi->combinedflag & SCE_PASS_SPEC)
+ if (shi->combinedflag & SCE_PASS_SPEC)
add_v3_v3v3(shr->combined, diff, shr->spec);
else
copy_v3_v3(shr->combined, diff);
@@ -1616,10 +1613,10 @@ 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)) {
+ if (RE_rayobject_raycast(R.raytree, is)) {
/* Warning regarding initializing to zero's, This is not that nice,
* and possibly a bit slow for every ray, however some variables were
* not initialized properly in, unless using
@@ -1649,7 +1646,8 @@ static void ray_trace_shadow_tra(Isect *is, ShadeInput *origshi, int depth, int
1.0f;
/* mix colors based on shadfac (rgb + amount of light factor) */
addAlphaLight(col, shr.diff, shr.alpha, d*shi.mat->filter);
- } else if (shi.mat->material_type == MA_TYPE_VOLUME) {
+ }
+ else if (shi.mat->material_type == MA_TYPE_VOLUME) {
const float a = col[3];
col[0] = a*col[0] + shr.alpha*shr.combined[0];
@@ -1659,7 +1657,7 @@ static void ray_trace_shadow_tra(Isect *is, ShadeInput *origshi, int depth, int
col[3] = (1.0f - shr.alpha)*a;
}
- if(depth>0 && col[3]>0.0f) {
+ if (depth>0 && col[3]>0.0f) {
/* adapt isect struct */
copy_v3_v3(is->start, shi.co);
@@ -1688,7 +1686,7 @@ static int UNUSED_FUNCTION(ray_trace_shadow_rad)(ShadeInput *ship, ShadeResult *
assert(0);
- if(only_one) {
+ if (only_one) {
return 0;
}
only_one= 1;
@@ -1703,7 +1701,7 @@ static int UNUSED_FUNCTION(ray_trace_shadow_rad)(ShadeInput *ship, ShadeResult *
RE_RC_INIT(isec, shi);
- for(a=0; a<8*8; a++) {
+ for (a=0; a<8*8; a++) {
counter+=3;
counter %= 768;
@@ -1717,11 +1715,11 @@ static int UNUSED_FUNCTION(ray_trace_shadow_rad)(ShadeInput *ship, ShadeResult *
copy_v3_v3(isec.dir, vec );
isec.dist = RE_RAYTRACE_MAXDIST;
- if(RE_rayobject_raycast(R.raytree, &isec)) {
+ if (RE_rayobject_raycast(R.raytree, &isec)) {
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 */
@@ -1736,7 +1734,7 @@ static int UNUSED_FUNCTION(ray_trace_shadow_rad)(ShadeInput *ship, ShadeResult *
else div+= 1.0f;
}
- if(div!=0.0f) {
+ if (div!=0.0f) {
shr->diff[0]+= accum[0]/div;
shr->diff[1]+= accum[1]/div;
shr->diff[2]+= accum[2]/div;
@@ -1769,10 +1767,10 @@ static void DS_energy(float *sphere, int tot, float vec[3])
res[0]= res[1]= res[2]= 0.0f;
- for(a=0, fp=sphere; a<tot; a++, fp+=3) {
+ for (a=0, fp=sphere; a<tot; a++, fp+=3) {
sub_v3_v3v3(force, vec, fp);
fac = dot_v3v3(force, force);
- if(fac!=0.0f) {
+ if (fac!=0.0f) {
fac= 1.0f/fac;
res[0]+= fac*force[0];
res[1]+= fac*force[1];
@@ -1804,12 +1802,12 @@ void init_ao_sphere(World *wrld)
/* init */
fp= wrld->aosphere;
- for(a=0; a<tot; a++, fp+= 3) {
+ for (a=0; a<tot; a++, fp+= 3) {
RandomSpherical(fp);
}
- while(iter--) {
- for(a=0, fp= wrld->aosphere; a<tot; a++, fp+= 3) {
+ while (iter--) {
+ for (a=0, fp= wrld->aosphere; a<tot; a++, fp+= 3) {
DS_energy(wrld->aosphere, tot, fp);
}
}
@@ -1824,14 +1822,14 @@ static float *threadsafe_table_sphere(int test, int thread, int xs, int ys, int
static int xso[BLENDER_MAX_THREADS], yso[BLENDER_MAX_THREADS];
static int firsttime= 1;
- if(firsttime) {
+ if (firsttime) {
memset(xso, 255, sizeof(xso));
memset(yso, 255, sizeof(yso));
firsttime= 0;
}
- if(xs==xso[thread] && ys==yso[thread]) return R.wrld.aotables+ thread*tot*3;
- if(test) return NULL;
+ if (xs==xso[thread] && ys==yso[thread]) return R.wrld.aotables+ thread*tot*3;
+ if (test) return NULL;
xso[thread]= xs; yso[thread]= ys;
return R.wrld.aotables+ thread*tot*3;
}
@@ -1864,7 +1862,7 @@ static float *sphere_sampler(int type, int resol, int thread, int xs, int ys, in
// returns table if xs and ys were equal to last call, and not resetting
sphere= (reset)? NULL: threadsafe_table_sphere(1, thread, xs, ys, tot);
- if(sphere==NULL) {
+ if (sphere==NULL) {
float cosfi, sinfi, cost, sint;
float ang;
int a;
@@ -1932,16 +1930,16 @@ static void ray_ao_qmc(ShadeInput *shi, float ao[3], float env[3])
/* prevent sky colors to be added for only shadow (shadow becomes alpha) */
envcolor= R.wrld.aocolor;
- if(shi->mat->mode & MA_ONLYSHADOW)
+ if (shi->mat->mode & MA_ONLYSHADOW)
envcolor= WO_AOPLAIN;
- if(envcolor == WO_AOSKYTEX) {
+ if (envcolor == WO_AOSKYTEX) {
dxyview[0]= 1.0f/(float)R.wrld.aosamp;
dxyview[1]= 1.0f/(float)R.wrld.aosamp;
dxyview[2]= 0.0f;
}
- if(shi->vlr->flag & R_SMOOTH) {
+ if (shi->vlr->flag & R_SMOOTH) {
copy_v3_v3(nrm, shi->vn);
}
else {
@@ -1960,7 +1958,8 @@ static void ray_ao_qmc(ShadeInput *shi, float ao[3], float env[3])
if (max_samples < 5) max_samples = 5;
qsa = get_thread_qmcsampler(&R, shi->thread, SAMP_TYPE_HALTON, max_samples);
- } else if (R.wrld.ao_samp_method==WO_AOSAMP_HAMMERSLEY)
+ }
+ else if (R.wrld.ao_samp_method==WO_AOSAMP_HAMMERSLEY)
qsa = get_thread_qmcsampler(&R, shi->thread, SAMP_TYPE_HAMMERSLEY, max_samples);
QMC_initPixel(qsa, shi->thread);
@@ -1983,11 +1982,11 @@ static void ray_ao_qmc(ShadeInput *shi, float ao[3], float env[3])
prev = fac;
- if(RE_rayobject_raycast(R.raytree, &isec)) {
+ if (RE_rayobject_raycast(R.raytree, &isec)) {
if (R.wrld.aomode & WO_AODIST) fac+= expf(-isec.dist*R.wrld.aodistfac);
else fac+= 1.0f;
}
- else if(envcolor!=WO_AOPLAIN) {
+ else if (envcolor!=WO_AOPLAIN) {
float skycol[4];
float view[3];
@@ -1996,7 +1995,7 @@ static void ray_ao_qmc(ShadeInput *shi, float ao[3], float env[3])
view[2]= -dir[2];
normalize_v3(view);
- if(envcolor==WO_AOSKYCOL) {
+ if (envcolor==WO_AOSKYCOL) {
const float skyfac= 0.5f * (1.0f + dot_v3v3(view, R.grvec));
env[0]+= (1.0f-skyfac)*R.wrld.horr + skyfac*R.wrld.zenr;
env[1]+= (1.0f-skyfac)*R.wrld.horg + skyfac*R.wrld.zeng;
@@ -2028,7 +2027,7 @@ static void ray_ao_qmc(ShadeInput *shi, float ao[3], float env[3])
/* average color times distances/hits formula */
ao[0]= ao[1]= ao[2]= 1.0f - fac/(float)samples;
- if(envcolor!=WO_AOPLAIN && skyadded)
+ if (envcolor!=WO_AOPLAIN && skyadded)
mul_v3_fl(env, (1.0f - fac/(float)samples)/((float)skyadded));
else
copy_v3_v3(env, ao);
@@ -2070,7 +2069,7 @@ static void ray_ao_spheresamp(ShadeInput *shi, float ao[3], float env[3])
zero_v3(env);
/* bias prevents smoothed faces to appear flat */
- if(shi->vlr->flag & R_SMOOTH) {
+ if (shi->vlr->flag & R_SMOOTH) {
bias= R.wrld.aobias;
nrm= shi->vn;
}
@@ -2081,32 +2080,32 @@ static void ray_ao_spheresamp(ShadeInput *shi, float ao[3], float env[3])
/* prevent sky colors to be added for only shadow (shadow becomes alpha) */
envcolor= R.wrld.aocolor;
- if(shi->mat->mode & MA_ONLYSHADOW)
+ if (shi->mat->mode & MA_ONLYSHADOW)
envcolor= WO_AOPLAIN;
- if(resol>32) resol= 32;
+ 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
tot= 2*resol*resol;
- if(envcolor == WO_AOSKYTEX) {
+ if (envcolor == WO_AOSKYTEX) {
dxyview[0]= 1.0f/(float)resol;
dxyview[1]= 1.0f/(float)resol;
dxyview[2]= 0.0f;
}
- while(tot--) {
+ while (tot--) {
if (dot_v3v3(vec, nrm) > bias) {
/* only ao samples for mask */
- if(R.r.mode & R_OSA) {
+ if (R.r.mode & R_OSA) {
j++;
- if(j==R.osa) j= 0;
- if(!(shi->mask & (1<<j))) {
+ if (j==R.osa) j= 0;
+ if (!(shi->mask & (1<<j))) {
vec+=3;
continue;
}
@@ -2121,11 +2120,11 @@ static void ray_ao_spheresamp(ShadeInput *shi, float ao[3], float env[3])
isec.dist = maxdist;
/* do the trace */
- if(RE_rayobject_raycast(R.raytree, &isec)) {
+ if (RE_rayobject_raycast(R.raytree, &isec)) {
if (R.wrld.aomode & WO_AODIST) sh+= expf(-isec.dist*R.wrld.aodistfac);
else sh+= 1.0f;
}
- else if(envcolor!=WO_AOPLAIN) {
+ else if (envcolor!=WO_AOPLAIN) {
float skycol[4];
float view[3];
@@ -2134,7 +2133,7 @@ static void ray_ao_spheresamp(ShadeInput *shi, float ao[3], float env[3])
view[2]= -vec[2];
normalize_v3(view);
- if(envcolor==WO_AOSKYCOL) {
+ if (envcolor==WO_AOSKYCOL) {
const float fac = 0.5f * (1.0f + dot_v3v3(view, R.grvec));
env[0]+= (1.0f-fac)*R.wrld.horr + fac*R.wrld.zenr;
env[1]+= (1.0f-fac)*R.wrld.horg + fac*R.wrld.zeng;
@@ -2154,13 +2153,13 @@ static void ray_ao_spheresamp(ShadeInput *shi, float ao[3], float env[3])
vec+= 3;
}
- if(actual==0) sh= 1.0f;
+ if (actual==0) sh= 1.0f;
else sh = 1.0f - sh/((float)actual);
/* average color times distances/hits formula */
ao[0]= ao[1]= ao[2]= sh;
- if(envcolor!=WO_AOPLAIN && skyadded)
+ if (envcolor!=WO_AOPLAIN && skyadded)
mul_v3_fl(env, sh/((float)skyadded));
else
copy_v3_v3(env, ao);
@@ -2189,17 +2188,17 @@ static void ray_shadow_jittered_coords(ShadeInput *shi, int max, float jitco[RE_
/* for better antialising shadow samples are distributed over the subpixel
* sample coordinates, this only works for raytracing depth 0 though */
- if(!shi->strand && shi->depth == 0 && count > 1 && count <= max) {
+ if (!shi->strand && shi->depth == 0 && count > 1 && count <= max) {
float xs, ys, zs, view[3];
int samp, ordsamp, tot= 0;
- for(samp=0; samp<R.osa; samp++) {
- if(R.osa == 8) ordsamp = order8[samp];
- else if(R.osa == 11) ordsamp = order11[samp];
- else if(R.osa == 16) ordsamp = order16[samp];
+ for (samp=0; samp<R.osa; samp++) {
+ if (R.osa == 8) ordsamp = order8[samp];
+ else if (R.osa == 11) ordsamp = order11[samp];
+ else if (R.osa == 16) ordsamp = order16[samp];
else ordsamp = samp;
- if(shi->mask & (1<<ordsamp)) {
+ if (shi->mask & (1<<ordsamp)) {
/* zbuffer has this inverse corrected, ensures xs,ys are inside pixel */
xs= (float)shi->scanco[0] + R.jit[ordsamp][0] + 0.5f;
ys= (float)shi->scanco[1] + R.jit[ordsamp][1] + 0.5f;
@@ -2238,9 +2237,10 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, const float lampco[3],
int totjitco;
colsq[0] = colsq[1] = colsq[2] = 0.0;
- if(isec->mode==RE_RAY_SHADOW_TRA) {
+ if (isec->mode==RE_RAY_SHADOW_TRA) {
shadfac[0]= shadfac[1]= shadfac[2]= shadfac[3]= 0.0f;
- } else
+ }
+ else
shadfac[3]= 1.0f;
if (lar->ray_totsamp < 2) do_soft = 0;
@@ -2249,7 +2249,8 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, const float lampco[3],
if (full_osa) {
if (do_soft) max_samples = max_samples/R.osa + 1;
else max_samples = 1;
- } else {
+ }
+ else {
if (do_soft) max_samples = lar->ray_totsamp;
else if (shi->depth == 0) max_samples = (R.osa > 4)?R.osa:5;
else max_samples = 1;
@@ -2266,7 +2267,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, const float lampco[3],
QMC_initPixel(qsa, shi->thread);
INIT_MINMAX(min, max);
- for(i=0; i<totjitco; i++)
+ for (i=0; i<totjitco; i++)
{
DO_MINMAX(jitco[i], min, max);
}
@@ -2317,11 +2318,12 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, const float lampco[3],
end[0] = vec[0]+samp3d[0];
end[1] = vec[1]+samp3d[1];
end[2] = vec[2]+samp3d[2];
- } else {
+ }
+ else {
copy_v3_v3(end, vec);
}
- if(shi->strand) {
+ if (shi->strand) {
/* bias away somewhat to avoid self intersection */
float jitbias= 0.5f*(len_v3(shi->dxco) + len_v3(shi->dyco));
float v[3];
@@ -2341,7 +2343,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, const float lampco[3],
isec->dist = normalize_v3(isec->dir);
/* trace the ray */
- if(isec->mode==RE_RAY_SHADOW_TRA) {
+ if (isec->mode==RE_RAY_SHADOW_TRA) {
float col[4] = {1.0f, 1.0f, 1.0f, 1.0f};
ray_trace_shadow_tra(isec, shi, DEPTH_SHADOW_TRA, 0, col);
@@ -2356,7 +2358,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, const float lampco[3],
colsq[2] += col[2]*col[2];
}
else {
- if( RE_rayobject_raycast(R.raytree, isec) ) fac+= 1.0f;
+ if ( RE_rayobject_raycast(R.raytree, isec) ) fac+= 1.0f;
}
samples++;
@@ -2370,7 +2372,8 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, const float lampco[3],
break;
else if (adaptive_sample_variance(samples, shadfac, colsq, adapt_thresh))
break;
- } else {
+ }
+ else {
if ((fac / samples > (1.0f-adapt_thresh)) || (fac / samples < adapt_thresh))
break;
}
@@ -2378,12 +2381,13 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, const float lampco[3],
}
}
- if(isec->mode==RE_RAY_SHADOW_TRA) {
+ if (isec->mode==RE_RAY_SHADOW_TRA) {
shadfac[0] /= samples;
shadfac[1] /= samples;
shadfac[2] /= samples;
shadfac[3] /= samples;
- } else
+ }
+ else
shadfac[3]= 1.0f-fac/samples;
if (qsa)
@@ -2398,7 +2402,7 @@ static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, const float lampco[
int a, j= -1, mask;
RayHint point_hint;
- if(isec->mode==RE_RAY_SHADOW_TRA) {
+ if (isec->mode==RE_RAY_SHADOW_TRA) {
shadfac[0]= shadfac[1]= shadfac[2]= shadfac[3]= 0.0f;
}
else shadfac[3]= 1.0f;
@@ -2410,8 +2414,8 @@ static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, const float lampco[
/* this correction to make sure we always take at least 1 sample */
mask= shi->mask;
- if(a==4) mask |= (mask>>4)|(mask>>8);
- else if(a==9) mask |= (mask>>9);
+ if (a==4) mask |= (mask>>4)|(mask>>8);
+ else if (a==9) mask |= (mask>>9);
copy_v3_v3(isec->start, shi->co);
isec->orig.ob = shi->obi;
@@ -2419,12 +2423,12 @@ static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, const float lampco[
RE_rayobject_hint_bb( R.raytree, &point_hint, isec->start, isec->start );
isec->hint = &point_hint;
- while(a--) {
+ while (a--) {
- if(R.r.mode & R_OSA) {
+ if (R.r.mode & R_OSA) {
j++;
- if(j>=R.osa) j= 0;
- if(!(mask & (1<<j))) {
+ if (j>=R.osa) j= 0;
+ if (!(mask & (1<<j))) {
jitlamp+= 2;
continue;
}
@@ -2443,7 +2447,7 @@ static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, const float lampco[
isec->check = RE_CHECK_VLR_RENDER;
isec->skip = RE_SKIP_VLR_NEIGHBOUR;
- if(isec->mode==RE_RAY_SHADOW_TRA) {
+ if (isec->mode==RE_RAY_SHADOW_TRA) {
/* isec.col is like shadfac, so defines amount of light (0.0 is full shadow) */
float col[4] = {1.0f, 1.0f, 1.0f, 1.0f};
@@ -2453,13 +2457,13 @@ static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, const float lampco[
shadfac[2] += col[2];
shadfac[3] += col[3];
}
- else if( RE_rayobject_raycast(R.raytree, isec) ) fac+= 1.0f;
+ else if ( RE_rayobject_raycast(R.raytree, isec) ) fac+= 1.0f;
div+= 1.0f;
jitlamp+= 2;
}
- if(isec->mode==RE_RAY_SHADOW_TRA) {
+ if (isec->mode==RE_RAY_SHADOW_TRA) {
shadfac[0] /= div;
shadfac[1] /= div;
shadfac[2] /= div;
@@ -2467,7 +2471,7 @@ static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, const float lampco[
}
else {
// sqrt makes nice umbra effect
- if(lar->ray_samp_type & LA_SAMP_UMBRA)
+ if (lar->ray_samp_type & LA_SAMP_UMBRA)
shadfac[3]= sqrt(1.0f-fac/div);
else
shadfac[3]= 1.0f-fac/div;
@@ -2481,24 +2485,24 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float shadfac[4])
/* setup isec */
RE_RC_INIT(isec, *shi);
- if(shi->mat->mode & MA_SHADOW_TRA) isec.mode= RE_RAY_SHADOW_TRA;
+ if (shi->mat->mode & MA_SHADOW_TRA) isec.mode= RE_RAY_SHADOW_TRA;
else isec.mode= RE_RAY_SHADOW;
isec.hint = 0;
- if(lar->mode & (LA_LAYER|LA_LAYER_SHADOW))
+ if (lar->mode & (LA_LAYER|LA_LAYER_SHADOW))
isec.lay= lar->lay;
else
isec.lay= -1;
/* only when not mir tracing, first hit optimm */
- if(shi->depth==0) {
+ if (shi->depth==0) {
isec.last_hit = lar->last_hit[shi->thread];
}
else {
isec.last_hit = NULL;
}
- if(lar->type==LA_SUN || lar->type==LA_HEMI) {
+ if (lar->type==LA_SUN || lar->type==LA_HEMI) {
/* jitter and QMC sampling add a displace vector to the lamp position
* that's incorrect because a SUN lamp does not has an exact position
* and the displace should be done at the ray vector instead of the
@@ -2524,8 +2528,9 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float shadfac[4])
ray_shadow_qmc(shi, lar, lampco, shadfac, &isec);
- } else {
- if(lar->ray_totsamp<2) {
+ }
+ else {
+ if (lar->ray_totsamp<2) {
isec.orig.ob = shi->obi;
isec.orig.face = shi->vlr;
@@ -2537,14 +2542,14 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float shadfac[4])
sub_v3_v3v3(isec.dir, lampco, isec.start);
isec.dist = normalize_v3(isec.dir);
- if(isec.mode==RE_RAY_SHADOW_TRA) {
+ if (isec.mode==RE_RAY_SHADOW_TRA) {
/* isec.col is like shadfac, so defines amount of light (0.0 is full shadow) */
float col[4] = {1.0f, 1.0f, 1.0f, 1.0f};
ray_trace_shadow_tra(&isec, shi, DEPTH_SHADOW_TRA, 0, col);
copy_v4_v4(shadfac, col);
}
- else if(RE_rayobject_raycast(R.raytree, &isec))
+ else if (RE_rayobject_raycast(R.raytree, &isec))
shadfac[3]= 0.0f;
}
else {
@@ -2553,7 +2558,7 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float shadfac[4])
}
/* for first hit optim, set last interesected shadow face */
- if(shi->depth==0) {
+ if (shi->depth==0) {
lar->last_hit[shi->thread] = isec.last_hit;
}
@@ -2573,9 +2578,9 @@ static void ray_translucent(ShadeInput *shi, LampRen *lar, float *distfac, float
isec.mode= RE_RAY_SHADOW_TRA;
isec.hint = 0;
- if(lar->mode & LA_LAYER) isec.lay= lar->lay; else isec.lay= -1;
+ if (lar->mode & LA_LAYER) isec.lay= lar->lay; else isec.lay= -1;
- if(lar->type==LA_SUN || lar->type==LA_HEMI) {
+ if (lar->type==LA_SUN || lar->type==LA_HEMI) {
lampco[0]= shi->co[0] - RE_RAYTRACE_MAXDIST*lar->vec[0];
lampco[1]= shi->co[1] - RE_RAYTRACE_MAXDIST*lar->vec[1];
lampco[2]= shi->co[2] - RE_RAYTRACE_MAXDIST*lar->vec[2];
@@ -2591,7 +2596,7 @@ static void ray_translucent(ShadeInput *shi, LampRen *lar, float *distfac, float
copy_v3_v3(isec.start, shi->co);
copy_v3_v3(isec.end, lampco);
- if(RE_rayobject_raycast(R.raytree, &isec)) {
+ if (RE_rayobject_raycast(R.raytree, &isec)) {
/* we got a face */
/* render co */
diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c
index 30853e8e1f6..37d6479e7bc 100644
--- a/source/blender/render/intern/source/render_result.c
+++ b/source/blender/render/intern/source/render_result.c
@@ -60,19 +60,19 @@
void render_result_free(RenderResult *res)
{
- if(res==NULL) return;
+ if (res==NULL) return;
- while(res->layers.first) {
+ while (res->layers.first) {
RenderLayer *rl= res->layers.first;
- if(rl->rectf) MEM_freeN(rl->rectf);
+ if (rl->rectf) MEM_freeN(rl->rectf);
/* acolrect and scolrect are optionally allocated in shade_tile, only free here since it can be used for drawing */
- if(rl->acolrect) MEM_freeN(rl->acolrect);
- if(rl->scolrect) MEM_freeN(rl->scolrect);
+ if (rl->acolrect) MEM_freeN(rl->acolrect);
+ if (rl->scolrect) MEM_freeN(rl->scolrect);
- while(rl->passes.first) {
+ while (rl->passes.first) {
RenderPass *rpass= rl->passes.first;
- if(rpass->rect) MEM_freeN(rpass->rect);
+ if (rpass->rect) MEM_freeN(rpass->rect);
BLI_remlink(&rl->passes, rpass);
MEM_freeN(rpass);
}
@@ -80,13 +80,13 @@ void render_result_free(RenderResult *res)
MEM_freeN(rl);
}
- if(res->rect32)
+ if (res->rect32)
MEM_freeN(res->rect32);
- if(res->rectz)
+ if (res->rectz)
MEM_freeN(res->rectz);
- if(res->rectf)
+ if (res->rectf)
MEM_freeN(res->rectf);
- if(res->text)
+ if (res->text)
MEM_freeN(res->text);
MEM_freeN(res);
@@ -97,10 +97,10 @@ void render_result_free_list(ListBase *lb, RenderResult *rr)
{
RenderResult *rrnext;
- for(; rr; rr= rrnext) {
+ for (; rr; rr= rrnext) {
rrnext= rr->next;
- if(lb && lb->first)
+ if (lb && lb->first)
BLI_remlink(lb, rr);
render_result_free(rr);
@@ -110,172 +110,171 @@ 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)
{
- if(passtype == SCE_PASS_COMBINED) {
- if(channel==-1) return "Combined";
- if(channel==0) return "Combined.R";
- if(channel==1) return "Combined.G";
- if(channel==2) return "Combined.B";
+ if (passtype == SCE_PASS_COMBINED) {
+ if (channel==-1) return "Combined";
+ if (channel==0) return "Combined.R";
+ if (channel==1) return "Combined.G";
+ if (channel==2) return "Combined.B";
return "Combined.A";
}
- if(passtype == SCE_PASS_Z) {
- if(channel==-1) return "Depth";
+ if (passtype == SCE_PASS_Z) {
+ if (channel==-1) return "Depth";
return "Depth.Z";
}
- if(passtype == SCE_PASS_VECTOR) {
- if(channel==-1) return "Vector";
- if(channel==0) return "Vector.X";
- if(channel==1) return "Vector.Y";
- if(channel==2) return "Vector.Z";
+ if (passtype == SCE_PASS_VECTOR) {
+ if (channel==-1) return "Vector";
+ if (channel==0) return "Vector.X";
+ if (channel==1) return "Vector.Y";
+ if (channel==2) return "Vector.Z";
return "Vector.W";
}
- if(passtype == SCE_PASS_NORMAL) {
- if(channel==-1) return "Normal";
- if(channel==0) return "Normal.X";
- if(channel==1) return "Normal.Y";
+ if (passtype == SCE_PASS_NORMAL) {
+ if (channel==-1) return "Normal";
+ if (channel==0) return "Normal.X";
+ if (channel==1) return "Normal.Y";
return "Normal.Z";
}
- if(passtype == SCE_PASS_UV) {
- if(channel==-1) return "UV";
- if(channel==0) return "UV.U";
- if(channel==1) return "UV.V";
+ if (passtype == SCE_PASS_UV) {
+ if (channel==-1) return "UV";
+ if (channel==0) return "UV.U";
+ if (channel==1) return "UV.V";
return "UV.A";
}
- if(passtype == SCE_PASS_RGBA) {
- if(channel==-1) return "Color";
- if(channel==0) return "Color.R";
- if(channel==1) return "Color.G";
- if(channel==2) return "Color.B";
+ if (passtype == SCE_PASS_RGBA) {
+ if (channel==-1) return "Color";
+ if (channel==0) return "Color.R";
+ if (channel==1) return "Color.G";
+ if (channel==2) return "Color.B";
return "Color.A";
}
- if(passtype == SCE_PASS_EMIT) {
- if(channel==-1) return "Emit";
- if(channel==0) return "Emit.R";
- if(channel==1) return "Emit.G";
+ if (passtype == SCE_PASS_EMIT) {
+ if (channel==-1) return "Emit";
+ if (channel==0) return "Emit.R";
+ if (channel==1) return "Emit.G";
return "Emit.B";
}
- if(passtype == SCE_PASS_DIFFUSE) {
- if(channel==-1) return "Diffuse";
- if(channel==0) return "Diffuse.R";
- if(channel==1) return "Diffuse.G";
+ if (passtype == SCE_PASS_DIFFUSE) {
+ if (channel==-1) return "Diffuse";
+ if (channel==0) return "Diffuse.R";
+ if (channel==1) return "Diffuse.G";
return "Diffuse.B";
}
- if(passtype == SCE_PASS_SPEC) {
- if(channel==-1) return "Spec";
- if(channel==0) return "Spec.R";
- if(channel==1) return "Spec.G";
+ if (passtype == SCE_PASS_SPEC) {
+ if (channel==-1) return "Spec";
+ if (channel==0) return "Spec.R";
+ if (channel==1) return "Spec.G";
return "Spec.B";
}
- if(passtype == SCE_PASS_SHADOW) {
- if(channel==-1) return "Shadow";
- if(channel==0) return "Shadow.R";
- if(channel==1) return "Shadow.G";
+ if (passtype == SCE_PASS_SHADOW) {
+ if (channel==-1) return "Shadow";
+ if (channel==0) return "Shadow.R";
+ if (channel==1) return "Shadow.G";
return "Shadow.B";
}
- if(passtype == SCE_PASS_AO) {
- if(channel==-1) return "AO";
- if(channel==0) return "AO.R";
- if(channel==1) return "AO.G";
+ if (passtype == SCE_PASS_AO) {
+ if (channel==-1) return "AO";
+ if (channel==0) return "AO.R";
+ if (channel==1) return "AO.G";
return "AO.B";
}
- if(passtype == SCE_PASS_ENVIRONMENT) {
- if(channel==-1) return "Env";
- if(channel==0) return "Env.R";
- if(channel==1) return "Env.G";
+ if (passtype == SCE_PASS_ENVIRONMENT) {
+ if (channel==-1) return "Env";
+ if (channel==0) return "Env.R";
+ if (channel==1) return "Env.G";
return "Env.B";
}
- if(passtype == SCE_PASS_INDIRECT) {
- if(channel==-1) return "Indirect";
- if(channel==0) return "Indirect.R";
- if(channel==1) return "Indirect.G";
+ if (passtype == SCE_PASS_INDIRECT) {
+ if (channel==-1) return "Indirect";
+ if (channel==0) return "Indirect.R";
+ if (channel==1) return "Indirect.G";
return "Indirect.B";
}
- if(passtype == SCE_PASS_REFLECT) {
- if(channel==-1) return "Reflect";
- if(channel==0) return "Reflect.R";
- if(channel==1) return "Reflect.G";
+ if (passtype == SCE_PASS_REFLECT) {
+ if (channel==-1) return "Reflect";
+ if (channel==0) return "Reflect.R";
+ if (channel==1) return "Reflect.G";
return "Reflect.B";
}
- if(passtype == SCE_PASS_REFRACT) {
- if(channel==-1) return "Refract";
- if(channel==0) return "Refract.R";
- if(channel==1) return "Refract.G";
+ if (passtype == SCE_PASS_REFRACT) {
+ if (channel==-1) return "Refract";
+ if (channel==0) return "Refract.R";
+ if (channel==1) return "Refract.G";
return "Refract.B";
}
- if(passtype == SCE_PASS_INDEXOB) {
- if(channel==-1) return "IndexOB";
+ if (passtype == SCE_PASS_INDEXOB) {
+ if (channel==-1) return "IndexOB";
return "IndexOB.X";
}
- if(passtype == SCE_PASS_INDEXMA) {
- if(channel==-1) return "IndexMA";
+ if (passtype == SCE_PASS_INDEXMA) {
+ if (channel==-1) return "IndexMA";
return "IndexMA.X";
}
- if(passtype == SCE_PASS_MIST) {
- if(channel==-1) return "Mist";
+ if (passtype == SCE_PASS_MIST) {
+ if (channel==-1) return "Mist";
return "Mist.Z";
}
- if(passtype == SCE_PASS_RAYHITS)
- {
- if(channel==-1) return "Rayhits";
- if(channel==0) return "Rayhits.R";
- if(channel==1) return "Rayhits.G";
+ if (passtype == SCE_PASS_RAYHITS) {
+ if (channel==-1) return "Rayhits";
+ if (channel==0) return "Rayhits.R";
+ if (channel==1) return "Rayhits.G";
return "Rayhits.B";
}
- if(passtype == SCE_PASS_DIFFUSE_DIRECT) {
- if(channel==-1) return "DiffDir";
- if(channel==0) return "DiffDir.R";
- if(channel==1) return "DiffDir.G";
+ if (passtype == SCE_PASS_DIFFUSE_DIRECT) {
+ if (channel==-1) return "DiffDir";
+ if (channel==0) return "DiffDir.R";
+ if (channel==1) return "DiffDir.G";
return "DiffDir.B";
}
- if(passtype == SCE_PASS_DIFFUSE_INDIRECT) {
- if(channel==-1) return "DiffInd";
- if(channel==0) return "DiffInd.R";
- if(channel==1) return "DiffInd.G";
+ if (passtype == SCE_PASS_DIFFUSE_INDIRECT) {
+ if (channel==-1) return "DiffInd";
+ if (channel==0) return "DiffInd.R";
+ if (channel==1) return "DiffInd.G";
return "DiffInd.B";
}
- if(passtype == SCE_PASS_DIFFUSE_COLOR) {
- if(channel==-1) return "DiffCol";
- if(channel==0) return "DiffCol.R";
- if(channel==1) return "DiffCol.G";
+ if (passtype == SCE_PASS_DIFFUSE_COLOR) {
+ if (channel==-1) return "DiffCol";
+ if (channel==0) return "DiffCol.R";
+ if (channel==1) return "DiffCol.G";
return "DiffCol.B";
}
- if(passtype == SCE_PASS_GLOSSY_DIRECT) {
- if(channel==-1) return "GlossDir";
- if(channel==0) return "GlossDir.R";
- if(channel==1) return "GlossDir.G";
+ if (passtype == SCE_PASS_GLOSSY_DIRECT) {
+ if (channel==-1) return "GlossDir";
+ if (channel==0) return "GlossDir.R";
+ if (channel==1) return "GlossDir.G";
return "GlossDir.B";
}
- if(passtype == SCE_PASS_GLOSSY_INDIRECT) {
- if(channel==-1) return "GlossInd";
- if(channel==0) return "GlossInd.R";
- if(channel==1) return "GlossInd.G";
+ if (passtype == SCE_PASS_GLOSSY_INDIRECT) {
+ if (channel==-1) return "GlossInd";
+ if (channel==0) return "GlossInd.R";
+ if (channel==1) return "GlossInd.G";
return "GlossInd.B";
}
- if(passtype == SCE_PASS_GLOSSY_COLOR) {
- if(channel==-1) return "GlossCol";
- if(channel==0) return "GlossCol.R";
- if(channel==1) return "GlossCol.G";
+ if (passtype == SCE_PASS_GLOSSY_COLOR) {
+ if (channel==-1) return "GlossCol";
+ if (channel==0) return "GlossCol.R";
+ if (channel==1) return "GlossCol.G";
return "GlossCol.B";
}
- if(passtype == SCE_PASS_TRANSM_DIRECT) {
- if(channel==-1) return "TransDir";
- if(channel==0) return "TransDir.R";
- if(channel==1) return "TransDir.G";
+ if (passtype == SCE_PASS_TRANSM_DIRECT) {
+ if (channel==-1) return "TransDir";
+ if (channel==0) return "TransDir.R";
+ if (channel==1) return "TransDir.G";
return "TransDir.B";
}
- if(passtype == SCE_PASS_TRANSM_INDIRECT) {
- if(channel==-1) return "TransInd";
- if(channel==0) return "TransInd.R";
- if(channel==1) return "TransInd.G";
+ if (passtype == SCE_PASS_TRANSM_INDIRECT) {
+ if (channel==-1) return "TransInd";
+ if (channel==0) return "TransInd.R";
+ if (channel==1) return "TransInd.G";
return "TransInd.B";
}
- if(passtype == SCE_PASS_TRANSM_COLOR) {
- if(channel==-1) return "TransCol";
- if(channel==0) return "TransCol.R";
- if(channel==1) return "TransCol.G";
+ if (passtype == SCE_PASS_TRANSM_COLOR) {
+ if (channel==-1) return "TransCol";
+ if (channel==0) return "TransCol.R";
+ if (channel==1) return "TransCol.G";
return "TransCol.B";
}
return "Unknown";
@@ -284,88 +283,88 @@ static const char *get_pass_name(int passtype, int channel)
static int passtype_from_name(const char *str)
{
- if(strcmp(str, "Combined")==0)
+ if (strcmp(str, "Combined")==0)
return SCE_PASS_COMBINED;
- if(strcmp(str, "Depth")==0)
+ if (strcmp(str, "Depth")==0)
return SCE_PASS_Z;
- if(strcmp(str, "Vector")==0)
+ if (strcmp(str, "Vector")==0)
return SCE_PASS_VECTOR;
- if(strcmp(str, "Normal")==0)
+ if (strcmp(str, "Normal")==0)
return SCE_PASS_NORMAL;
- if(strcmp(str, "UV")==0)
+ if (strcmp(str, "UV")==0)
return SCE_PASS_UV;
- if(strcmp(str, "Color")==0)
+ if (strcmp(str, "Color")==0)
return SCE_PASS_RGBA;
- if(strcmp(str, "Emit")==0)
+ if (strcmp(str, "Emit")==0)
return SCE_PASS_EMIT;
- if(strcmp(str, "Diffuse")==0)
+ if (strcmp(str, "Diffuse")==0)
return SCE_PASS_DIFFUSE;
- if(strcmp(str, "Spec")==0)
+ if (strcmp(str, "Spec")==0)
return SCE_PASS_SPEC;
- if(strcmp(str, "Shadow")==0)
+ if (strcmp(str, "Shadow")==0)
return SCE_PASS_SHADOW;
- if(strcmp(str, "AO")==0)
+ if (strcmp(str, "AO")==0)
return SCE_PASS_AO;
- if(strcmp(str, "Env")==0)
+ if (strcmp(str, "Env")==0)
return SCE_PASS_ENVIRONMENT;
- if(strcmp(str, "Indirect")==0)
+ if (strcmp(str, "Indirect")==0)
return SCE_PASS_INDIRECT;
- if(strcmp(str, "Reflect")==0)
+ if (strcmp(str, "Reflect")==0)
return SCE_PASS_REFLECT;
- if(strcmp(str, "Refract")==0)
+ if (strcmp(str, "Refract")==0)
return SCE_PASS_REFRACT;
- if(strcmp(str, "IndexOB")==0)
+ if (strcmp(str, "IndexOB")==0)
return SCE_PASS_INDEXOB;
- if(strcmp(str, "IndexMA")==0)
+ if (strcmp(str, "IndexMA")==0)
return SCE_PASS_INDEXMA;
- if(strcmp(str, "Mist")==0)
+ if (strcmp(str, "Mist")==0)
return SCE_PASS_MIST;
- if(strcmp(str, "RayHits")==0)
+ if (strcmp(str, "RayHits")==0)
return SCE_PASS_RAYHITS;
- if(strcmp(str, "DiffDir")==0)
+ if (strcmp(str, "DiffDir")==0)
return SCE_PASS_DIFFUSE_DIRECT;
- if(strcmp(str, "DiffInd")==0)
+ if (strcmp(str, "DiffInd")==0)
return SCE_PASS_DIFFUSE_INDIRECT;
- if(strcmp(str, "DiffCol")==0)
+ if (strcmp(str, "DiffCol")==0)
return SCE_PASS_DIFFUSE_COLOR;
- if(strcmp(str, "GlossDir")==0)
+ if (strcmp(str, "GlossDir")==0)
return SCE_PASS_GLOSSY_DIRECT;
- if(strcmp(str, "GlossInd")==0)
+ if (strcmp(str, "GlossInd")==0)
return SCE_PASS_GLOSSY_INDIRECT;
- if(strcmp(str, "GlossCol")==0)
+ if (strcmp(str, "GlossCol")==0)
return SCE_PASS_GLOSSY_COLOR;
- if(strcmp(str, "TransDir")==0)
+ if (strcmp(str, "TransDir")==0)
return SCE_PASS_TRANSM_DIRECT;
- if(strcmp(str, "TransInd")==0)
+ if (strcmp(str, "TransInd")==0)
return SCE_PASS_TRANSM_INDIRECT;
- if(strcmp(str, "TransCol")==0)
+ if (strcmp(str, "TransCol")==0)
return SCE_PASS_TRANSM_COLOR;
return 0;
@@ -386,9 +385,9 @@ static void render_layer_add_pass(RenderResult *rr, RenderLayer *rl, int channel
rpass->recty= rl->recty;
BLI_strncpy(rpass->name, get_pass_name(rpass->passtype, -1), sizeof(rpass->name));
- if(rr->exrhandle) {
+ if (rr->exrhandle) {
int a;
- for(a=0; a<channels; a++)
+ for (a=0; a<channels; a++)
IMB_exr_add_channel(rr->exrhandle, rl->name, get_pass_name(passtype, a), 0, 0, NULL);
}
else {
@@ -397,15 +396,15 @@ static void render_layer_add_pass(RenderResult *rr, RenderLayer *rl, int channel
rpass->rect= MEM_mapallocN(sizeof(float)*rectsize, typestr);
- if(passtype==SCE_PASS_VECTOR) {
+ if (passtype==SCE_PASS_VECTOR) {
/* initialize to max speed */
rect= rpass->rect;
- for(x= rectsize-1; x>=0; x--)
+ for (x= rectsize-1; x>=0; x--)
rect[x]= PASS_VECTOR_MAX;
}
- else if(passtype==SCE_PASS_Z) {
+ else if (passtype==SCE_PASS_Z) {
rect= rpass->rect;
- for(x= rectsize-1; x>=0; x--)
+ for (x= rectsize-1; x>=0; x--)
rect[x]= 10e10;
}
}
@@ -425,32 +424,32 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf
rectx= partrct->xmax - partrct->xmin;
recty= partrct->ymax - partrct->ymin;
- if(rectx<=0 || recty<=0)
+ if (rectx<=0 || recty<=0)
return NULL;
rr= MEM_callocN(sizeof(RenderResult), "new render result");
rr->rectx= rectx;
rr->recty= recty;
- rr->renrect.xmin= 0; rr->renrect.xmax= rectx-2*crop;
+ rr->renrect.xmin = 0; rr->renrect.xmax = rectx-2*crop;
/* crop is one or two extra pixels rendered for filtering, is used for merging and display too */
rr->crop= crop;
/* tilerect is relative coordinates within render disprect. do not subtract crop yet */
- rr->tilerect.xmin= partrct->xmin - re->disprect.xmin;
- rr->tilerect.xmax= partrct->xmax - re->disprect.xmax;
- rr->tilerect.ymin= partrct->ymin - re->disprect.ymin;
- rr->tilerect.ymax= partrct->ymax - re->disprect.ymax;
+ rr->tilerect.xmin = partrct->xmin - re->disprect.xmin;
+ rr->tilerect.xmax = partrct->xmax - re->disprect.xmax;
+ rr->tilerect.ymin = partrct->ymin - re->disprect.ymin;
+ rr->tilerect.ymax = partrct->ymax - re->disprect.ymax;
- if(savebuffers) {
+ if (savebuffers) {
rr->exrhandle= IMB_exr_get_handle();
}
/* check renderdata for amount of layers */
- for(nr=0, srl= re->r.layers.first; srl; srl= srl->next, nr++) {
+ for (nr=0, srl= re->r.layers.first; srl; srl= srl->next, nr++) {
- if((re->r.scemode & R_SINGLE_LAYER) && nr!=re->r.actlay)
+ if ((re->r.scemode & R_SINGLE_LAYER) && nr!=re->r.actlay)
continue;
- if(srl->layflag & SCE_LAY_DISABLE)
+ if (srl->layflag & SCE_LAY_DISABLE)
continue;
rl= MEM_callocN(sizeof(RenderLayer), "new render layer");
@@ -467,7 +466,7 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf
rl->rectx= rectx;
rl->recty= recty;
- if(rr->exrhandle) {
+ if (rr->exrhandle) {
IMB_exr_add_channel(rr->exrhandle, rl->name, "Combined.R", 0, 0, NULL);
IMB_exr_add_channel(rr->exrhandle, rl->name, "Combined.G", 0, 0, NULL);
IMB_exr_add_channel(rr->exrhandle, rl->name, "Combined.B", 0, 0, NULL);
@@ -476,64 +475,64 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf
else
rl->rectf= MEM_mapallocN(rectx*recty*sizeof(float)*4, "Combined rgba");
- if(srl->passflag & SCE_PASS_Z)
+ if (srl->passflag & SCE_PASS_Z)
render_layer_add_pass(rr, rl, 1, SCE_PASS_Z);
- if(srl->passflag & SCE_PASS_VECTOR)
+ if (srl->passflag & SCE_PASS_VECTOR)
render_layer_add_pass(rr, rl, 4, SCE_PASS_VECTOR);
- if(srl->passflag & SCE_PASS_NORMAL)
+ if (srl->passflag & SCE_PASS_NORMAL)
render_layer_add_pass(rr, rl, 3, SCE_PASS_NORMAL);
- if(srl->passflag & SCE_PASS_UV)
+ if (srl->passflag & SCE_PASS_UV)
render_layer_add_pass(rr, rl, 3, SCE_PASS_UV);
- if(srl->passflag & SCE_PASS_RGBA)
+ if (srl->passflag & SCE_PASS_RGBA)
render_layer_add_pass(rr, rl, 4, SCE_PASS_RGBA);
- if(srl->passflag & SCE_PASS_EMIT)
+ if (srl->passflag & SCE_PASS_EMIT)
render_layer_add_pass(rr, rl, 3, SCE_PASS_EMIT);
- if(srl->passflag & SCE_PASS_DIFFUSE)
+ if (srl->passflag & SCE_PASS_DIFFUSE)
render_layer_add_pass(rr, rl, 3, SCE_PASS_DIFFUSE);
- if(srl->passflag & SCE_PASS_SPEC)
+ if (srl->passflag & SCE_PASS_SPEC)
render_layer_add_pass(rr, rl, 3, SCE_PASS_SPEC);
- if(srl->passflag & SCE_PASS_AO)
+ if (srl->passflag & SCE_PASS_AO)
render_layer_add_pass(rr, rl, 3, SCE_PASS_AO);
- if(srl->passflag & SCE_PASS_ENVIRONMENT)
+ if (srl->passflag & SCE_PASS_ENVIRONMENT)
render_layer_add_pass(rr, rl, 3, SCE_PASS_ENVIRONMENT);
- if(srl->passflag & SCE_PASS_INDIRECT)
+ if (srl->passflag & SCE_PASS_INDIRECT)
render_layer_add_pass(rr, rl, 3, SCE_PASS_INDIRECT);
- if(srl->passflag & SCE_PASS_SHADOW)
+ if (srl->passflag & SCE_PASS_SHADOW)
render_layer_add_pass(rr, rl, 3, SCE_PASS_SHADOW);
- if(srl->passflag & SCE_PASS_REFLECT)
+ if (srl->passflag & SCE_PASS_REFLECT)
render_layer_add_pass(rr, rl, 3, SCE_PASS_REFLECT);
- if(srl->passflag & SCE_PASS_REFRACT)
+ if (srl->passflag & SCE_PASS_REFRACT)
render_layer_add_pass(rr, rl, 3, SCE_PASS_REFRACT);
- if(srl->passflag & SCE_PASS_INDEXOB)
+ if (srl->passflag & SCE_PASS_INDEXOB)
render_layer_add_pass(rr, rl, 1, SCE_PASS_INDEXOB);
- if(srl->passflag & SCE_PASS_INDEXMA)
+ if (srl->passflag & SCE_PASS_INDEXMA)
render_layer_add_pass(rr, rl, 1, SCE_PASS_INDEXMA);
- if(srl->passflag & SCE_PASS_MIST)
+ if (srl->passflag & SCE_PASS_MIST)
render_layer_add_pass(rr, rl, 1, SCE_PASS_MIST);
- if(rl->passflag & SCE_PASS_RAYHITS)
+ if (rl->passflag & SCE_PASS_RAYHITS)
render_layer_add_pass(rr, rl, 4, SCE_PASS_RAYHITS);
- if(srl->passflag & SCE_PASS_DIFFUSE_DIRECT)
+ if (srl->passflag & SCE_PASS_DIFFUSE_DIRECT)
render_layer_add_pass(rr, rl, 3, SCE_PASS_DIFFUSE_DIRECT);
- if(srl->passflag & SCE_PASS_DIFFUSE_INDIRECT)
+ if (srl->passflag & SCE_PASS_DIFFUSE_INDIRECT)
render_layer_add_pass(rr, rl, 3, SCE_PASS_DIFFUSE_INDIRECT);
- if(srl->passflag & SCE_PASS_DIFFUSE_COLOR)
+ if (srl->passflag & SCE_PASS_DIFFUSE_COLOR)
render_layer_add_pass(rr, rl, 3, SCE_PASS_DIFFUSE_COLOR);
- if(srl->passflag & SCE_PASS_GLOSSY_DIRECT)
+ if (srl->passflag & SCE_PASS_GLOSSY_DIRECT)
render_layer_add_pass(rr, rl, 3, SCE_PASS_GLOSSY_DIRECT);
- if(srl->passflag & SCE_PASS_GLOSSY_INDIRECT)
+ if (srl->passflag & SCE_PASS_GLOSSY_INDIRECT)
render_layer_add_pass(rr, rl, 3, SCE_PASS_GLOSSY_INDIRECT);
- if(srl->passflag & SCE_PASS_GLOSSY_COLOR)
+ if (srl->passflag & SCE_PASS_GLOSSY_COLOR)
render_layer_add_pass(rr, rl, 3, SCE_PASS_GLOSSY_COLOR);
- if(srl->passflag & SCE_PASS_TRANSM_DIRECT)
+ if (srl->passflag & SCE_PASS_TRANSM_DIRECT)
render_layer_add_pass(rr, rl, 3, SCE_PASS_TRANSM_DIRECT);
- if(srl->passflag & SCE_PASS_TRANSM_INDIRECT)
+ if (srl->passflag & SCE_PASS_TRANSM_INDIRECT)
render_layer_add_pass(rr, rl, 3, SCE_PASS_TRANSM_INDIRECT);
- if(srl->passflag & SCE_PASS_TRANSM_COLOR)
+ if (srl->passflag & SCE_PASS_TRANSM_COLOR)
render_layer_add_pass(rr, rl, 3, SCE_PASS_TRANSM_COLOR);
}
/* sss, previewrender and envmap don't do layers, so we make a default one */
- if(rr->layers.first==NULL) {
+ if (rr->layers.first==NULL) {
rl= MEM_callocN(sizeof(RenderLayer), "new render layer");
BLI_addtail(&rr->layers, rl);
@@ -541,7 +540,7 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf
rl->recty= recty;
/* duplicate code... */
- if(rr->exrhandle) {
+ if (rr->exrhandle) {
IMB_exr_add_channel(rr->exrhandle, rl->name, "Combined.R", 0, 0, NULL);
IMB_exr_add_channel(rr->exrhandle, rl->name, "Combined.G", 0, 0, NULL);
IMB_exr_add_channel(rr->exrhandle, rl->name, "Combined.B", 0, 0, NULL);
@@ -570,10 +569,10 @@ RenderResult *render_result_new_full_sample(Render *re, ListBase *lb, rcti *part
{
int a;
- if(re->osa==0)
+ if (re->osa==0)
return render_result_new(re, partrct, crop, savebuffers);
- for(a=0; a<re->osa; a++) {
+ for (a=0; a<re->osa; a++) {
RenderResult *rr= render_result_new(re, partrct, crop, savebuffers);
BLI_addtail(lb, rr);
rr->sample_nr= a;
@@ -605,12 +604,12 @@ static void ml_addpass_cb(void *UNUSED(base), void *lay, char *str, float *rect,
rpass->channels= totchan;
rpass->passtype= passtype_from_name(str);
- if(rpass->passtype==0) printf("unknown pass %s\n", str);
+ if (rpass->passtype==0) printf("unknown pass %s\n", str);
rl->passflag |= rpass->passtype;
BLI_strncpy(rpass->name, str, EXR_PASS_MAXNAME);
/* channel id chars */
- for(a=0; a<totchan; a++)
+ for (a=0; a<totchan; a++)
rpass->chan_id[a]= chan_id[a];
rpass->rect= rect;
@@ -628,11 +627,11 @@ RenderResult *render_result_new_from_exr(void *exrhandle, int rectx, int recty)
IMB_exr_multilayer_convert(exrhandle, rr, ml_addlayer_cb, ml_addpass_cb);
- for(rl=rr->layers.first; rl; rl=rl->next) {
+ for (rl=rr->layers.first; rl; rl=rl->next) {
rl->rectx= rectx;
rl->recty= recty;
- for(rpass=rl->passes.first; rpass; rpass=rpass->next) {
+ for (rpass=rl->passes.first; rpass; rpass=rpass->next) {
rpass->rectx= rectx;
rpass->recty= recty;
}
@@ -650,7 +649,7 @@ static void do_merge_tile(RenderResult *rr, RenderResult *rrpart, float *target,
copylen= tilex= rrpart->rectx;
tiley= rrpart->recty;
- if(rrpart->crop) { /* filters add pixel extra */
+ if (rrpart->crop) { /* filters add pixel extra */
tile+= pixsize*(rrpart->crop + rrpart->crop*tilex);
copylen= tilex - 2*rrpart->crop;
@@ -668,7 +667,7 @@ static void do_merge_tile(RenderResult *rr, RenderResult *rrpart, float *target,
tilex *= pixsize;
ofs= pixsize*rr->rectx;
- for(y=0; y<tiley; y++) {
+ for (y=0; y<tiley; y++) {
memcpy(target, tile, copylen);
target+= ofs;
tile+= tilex;
@@ -683,14 +682,14 @@ void render_result_merge(RenderResult *rr, RenderResult *rrpart)
RenderLayer *rl, *rlp;
RenderPass *rpass, *rpassp;
- for(rl= rr->layers.first, rlp= rrpart->layers.first; rl && rlp; rl= rl->next, rlp= rlp->next) {
+ for (rl= rr->layers.first, rlp= rrpart->layers.first; rl && rlp; rl= rl->next, rlp= rlp->next) {
/* combined */
- if(rl->rectf && rlp->rectf)
+ if (rl->rectf && rlp->rectf)
do_merge_tile(rr, rrpart, rl->rectf, rlp->rectf, 4);
/* passes are allocated in sync */
- for(rpass= rl->passes.first, rpassp= rlp->passes.first; rpass && rpassp; rpass= rpass->next, rpassp= rpassp->next) {
+ for (rpass= rl->passes.first, rpassp= rlp->passes.first; rpass && rpassp; rpass= rpass->next, rpassp= rpassp->next) {
do_merge_tile(rr, rrpart, rpass->rect, rpassp->rect, rpass->channels);
}
}
@@ -723,7 +722,7 @@ int RE_WriteRenderResult(ReportList *reports, RenderResult *rr, const char *file
BLI_make_existing_file(filename);
/* composite result */
- if(rr->rectf) {
+ if (rr->rectf) {
IMB_exr_add_channel(exrhandle, "Composite", "Combined.R", 4, 4*rr->rectx, rr->rectf);
IMB_exr_add_channel(exrhandle, "Composite", "Combined.G", 4, 4*rr->rectx, rr->rectf+1);
IMB_exr_add_channel(exrhandle, "Composite", "Combined.B", 4, 4*rr->rectx, rr->rectf+2);
@@ -731,21 +730,21 @@ int RE_WriteRenderResult(ReportList *reports, RenderResult *rr, const char *file
}
/* add layers/passes and assign channels */
- for(rl= rr->layers.first; rl; rl= rl->next) {
+ for (rl= rr->layers.first; rl; rl= rl->next) {
/* combined */
- if(rl->rectf) {
+ if (rl->rectf) {
int a, xstride= 4;
- for(a=0; a<xstride; a++)
+ for (a=0; a<xstride; a++)
IMB_exr_add_channel(exrhandle, rl->name, get_pass_name(SCE_PASS_COMBINED, a),
xstride, xstride*rr->rectx, rl->rectf+a);
}
/* passes are allocated in sync */
- for(rpass= rl->passes.first; rpass; rpass= rpass->next) {
+ for (rpass= rl->passes.first; rpass; rpass= rpass->next) {
int a, xstride= rpass->channels;
- for(a=0; a<xstride; a++) {
- if(rpass->passtype)
+ for (a=0; a<xstride; a++) {
+ if (rpass->passtype)
IMB_exr_add_channel(exrhandle, rl->name, get_pass_name(rpass->passtype, a),
xstride, xstride*rr->rectx, rpass->rect+a);
else
@@ -756,7 +755,7 @@ int RE_WriteRenderResult(ReportList *reports, RenderResult *rr, const char *file
}
/* when the filename has no permissions, this can fail */
- if(IMB_exr_begin_write(exrhandle, filename, rr->rectx, rr->recty, compress)) {
+ if (IMB_exr_begin_write(exrhandle, filename, rr->rectx, rr->recty, compress)) {
IMB_exr_write_channels(exrhandle);
success= TRUE;
}
@@ -791,15 +790,15 @@ void render_result_single_layer_end(Render *re)
RenderLayer *rl;
int nr;
- if(re->result==NULL) {
+ if (re->result==NULL) {
printf("pop render result error; no current result!\n");
return;
}
- if(!re->pushedresult)
+ if (!re->pushedresult)
return;
- if(re->pushedresult->rectx==re->result->rectx && re->pushedresult->recty==re->result->recty) {
+ if (re->pushedresult->rectx==re->result->rectx && re->pushedresult->recty==re->result->recty) {
/* find which layer in re->pushedresult should be replaced */
rl= re->result->layers.first;
@@ -807,12 +806,12 @@ void render_result_single_layer_end(Render *re)
BLI_remlink(&re->result->layers, rl);
/* reconstruct render result layers */
- for(nr=0, srl= re->scene->r.layers.first; srl; srl= srl->next, nr++) {
- if(nr==re->r.actlay)
+ for (nr=0, srl= re->scene->r.layers.first; srl; srl= srl->next, nr++) {
+ if (nr==re->r.actlay)
BLI_addtail(&re->result->layers, rl);
else {
rlpush= RE_GetRenderLayer(re->pushedresult, srl->name);
- if(rlpush) {
+ if (rlpush) {
BLI_remlink(&re->pushedresult->layers, rlpush);
BLI_addtail(&re->result->layers, rlpush);
}
@@ -834,9 +833,9 @@ static void save_render_result_tile(RenderResult *rr, RenderResult *rrpart)
BLI_lock_thread(LOCK_IMAGE);
- for(rlp= rrpart->layers.first; rlp; rlp= rlp->next) {
+ for (rlp= rrpart->layers.first; rlp; rlp= rlp->next) {
- if(rrpart->crop) { /* filters add pixel extra */
+ if (rrpart->crop) { /* filters add pixel extra */
offs= (rrpart->crop + rrpart->crop*rrpart->rectx);
}
else {
@@ -844,17 +843,17 @@ static void save_render_result_tile(RenderResult *rr, RenderResult *rrpart)
}
/* combined */
- if(rlp->rectf) {
+ if (rlp->rectf) {
int a, xstride= 4;
- for(a=0; a<xstride; a++)
+ for (a=0; a<xstride; a++)
IMB_exr_set_channel(rr->exrhandle, rlp->name, get_pass_name(SCE_PASS_COMBINED, a),
xstride, xstride*rrpart->rectx, rlp->rectf+a + xstride*offs);
}
/* passes are allocated in sync */
- for(rpassp= rlp->passes.first; rpassp; rpassp= rpassp->next) {
+ for (rpassp= rlp->passes.first; rpassp; rpassp= rpassp->next) {
int a, xstride= rpassp->channels;
- for(a=0; a<xstride; a++)
+ for (a=0; a<xstride; a++)
IMB_exr_set_channel(rr->exrhandle, rlp->name, get_pass_name(rpassp->passtype, a),
xstride, xstride*rrpart->rectx, rpassp->rect+a + xstride*offs);
}
@@ -873,11 +872,11 @@ static void save_empty_result_tiles(Render *re)
RenderPart *pa;
RenderResult *rr;
- for(rr= re->result; rr; rr= rr->next) {
+ for (rr= re->result; rr; rr= rr->next) {
IMB_exrtile_clear_channels(rr->exrhandle);
- for(pa= re->parts.first; pa; pa= pa->next) {
- if(pa->ready==0) {
+ for (pa= re->parts.first; pa; pa= pa->next) {
+ if (pa->ready==0) {
int party= pa->disprect.ymin - re->disprect.ymin + pa->crop;
int partx= pa->disprect.xmin - re->disprect.xmin + pa->crop;
IMB_exrtile_write_channels(rr->exrhandle, partx, party, 0);
@@ -892,7 +891,7 @@ void render_result_exr_file_begin(Render *re)
RenderResult *rr;
char str[FILE_MAX];
- for(rr= re->result; rr; rr= rr->next) {
+ for (rr= re->result; rr; rr= rr->next) {
render_result_exr_file_path(re->scene, rr->sample_nr, str);
printf("write exr tmp file, %dx%d, %s\n", rr->rectx, rr->recty, str);
@@ -907,7 +906,7 @@ void render_result_exr_file_end(Render *re)
save_empty_result_tiles(re);
- for(rr= re->result; rr; rr= rr->next) {
+ for (rr= re->result; rr; rr= rr->next) {
IMB_exr_close(rr->exrhandle);
rr->exrhandle= NULL;
}
@@ -921,7 +920,7 @@ void render_result_exr_file_end(Render *re)
/* save part into exr file */
void render_result_exr_file_merge(RenderResult *rr, RenderResult *rrpart)
{
- for(; rr && rrpart; rr= rr->next, rrpart= rrpart->next)
+ for (; rr && rrpart; rr= rr->next, rrpart= rrpart->next)
save_render_result_tile(rr, rrpart);
}
@@ -933,7 +932,7 @@ void render_result_exr_file_path(Scene *scene, int sample, char *filepath)
BLI_strncpy(di, G.main->name, FILE_MAX);
BLI_splitdirstring(di, fi);
- if(sample==0)
+ if (sample==0)
BLI_snprintf(name, sizeof(name), "%s_%s.exr", fi, scene->id.name+2);
else
BLI_snprintf(name, sizeof(name), "%s_%s%d.exr", fi, scene->id.name+2, sample);
@@ -953,7 +952,7 @@ int render_result_exr_file_read(Render *re, int sample)
render_result_exr_file_path(re->scene, sample, str);
printf("read exr tmp file: %s\n", str);
- if(render_result_exr_file_read_path(re->result, str)) {
+ if (render_result_exr_file_read_path(re->result, str)) {
success= TRUE;
}
else {
@@ -973,14 +972,14 @@ int render_result_exr_file_read_path(RenderResult *rr, const char *filepath)
void *exrhandle= IMB_exr_get_handle();
int rectx, recty;
- if(IMB_exr_begin_read(exrhandle, filepath, &rectx, &recty)==0) {
+ if (IMB_exr_begin_read(exrhandle, filepath, &rectx, &recty)==0) {
printf("failed being read %s\n", filepath);
IMB_exr_close(exrhandle);
return 0;
}
- if(rr == NULL || rectx!=rr->rectx || recty!=rr->recty) {
- if(rr)
+ if (rr == NULL || rectx!=rr->rectx || recty!=rr->recty) {
+ if (rr)
printf("error in reading render result: dimensions don't match\n");
else
printf("error in reading render result: NULL result pointer\n");
@@ -988,19 +987,19 @@ int render_result_exr_file_read_path(RenderResult *rr, const char *filepath)
return 0;
}
- for(rl= rr->layers.first; rl; rl= rl->next) {
+ for (rl= rr->layers.first; rl; rl= rl->next) {
/* combined */
- if(rl->rectf) {
+ if (rl->rectf) {
int a, xstride= 4;
- for(a=0; a<xstride; a++)
+ for (a=0; a<xstride; a++)
IMB_exr_set_channel(exrhandle, rl->name, get_pass_name(SCE_PASS_COMBINED, a),
xstride, xstride*rectx, rl->rectf+a);
}
/* passes are allocated in sync */
- for(rpass= rl->passes.first; rpass; rpass= rpass->next) {
+ for (rpass= rl->passes.first; rpass; rpass= rpass->next) {
int a, xstride= rpass->channels;
- for(a=0; a<xstride; a++)
+ for (a=0; a<xstride; a++)
IMB_exr_set_channel(exrhandle, rl->name, get_pass_name(rpass->passtype, a),
xstride, xstride*rectx, rpass->rect+a);
@@ -1036,14 +1035,15 @@ ImBuf *render_result_rect_to_ibuf(RenderResult *rr, RenderData *rd)
ibuf->profile = IB_PROFILE_SRGB;
if (BKE_imtype_valid_depths(rd->im_format.imtype) & (R_IMF_CHAN_DEPTH_12|R_IMF_CHAN_DEPTH_16|R_IMF_CHAN_DEPTH_24|R_IMF_CHAN_DEPTH_32))
IMB_float_from_rect(ibuf);
- } else {
+ }
+ else {
ibuf->profile = IB_PROFILE_LINEAR_RGB;
}
}
/* color -> greyscale */
/* editing directly would alter the render view */
- if(rd->im_format.planes == R_IMF_PLANES_BW) {
+ if (rd->im_format.planes == R_IMF_PLANES_BW) {
ImBuf *ibuf_bw= IMB_dupImBuf(ibuf);
IMB_color_to_bw(ibuf_bw);
IMB_freeImBuf(ibuf);
@@ -1055,7 +1055,7 @@ ImBuf *render_result_rect_to_ibuf(RenderResult *rr, RenderData *rd)
void render_result_rect_from_ibuf(RenderResult *rr, RenderData *rd, ImBuf *ibuf)
{
- if(ibuf->rect_float) {
+ if (ibuf->rect_float) {
/* color management: when off ensure rectf is non-lin, since thats what the internal
* render engine delivers */
int profile_to= (rd->color_mgt_flag & R_COLOR_MANAGEMENT)? IB_PROFILE_LINEAR_RGB: IB_PROFILE_SRGB;
@@ -1070,20 +1070,20 @@ 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 */
- if(rr->rect32) {
+ * can hang around when sequence render has rendered a 32 bits one before */
+ if (rr->rect32) {
MEM_freeN(rr->rect32);
rr->rect32= NULL;
}
}
- else if(ibuf->rect) {
+ else if (ibuf->rect) {
if (!rr->rect32)
rr->rect32= MEM_mallocN(sizeof(int)*rr->rectx*rr->recty, "render_seq rect");
memcpy(rr->rect32, ibuf->rect, 4*rr->rectx*rr->recty);
/* Same things as above, old rectf can hang around from previous render. */
- if(rr->rectf) {
+ if (rr->rectf) {
MEM_freeN(rr->rectf);
rr->rectf= NULL;
}
@@ -1102,10 +1102,10 @@ void render_result_rect_fill_zero(RenderResult *rr)
void render_result_rect_get_pixels(RenderResult *rr, RenderData *rd, unsigned int *rect, int rectx, int recty)
{
- if(rr->rect32) {
+ if (rr->rect32) {
memcpy(rect, rr->rect32, sizeof(int)*rr->rectx*rr->recty);
}
- else if(rr->rectf) {
+ else if (rr->rectf) {
int profile_from= (rd->color_mgt_flag & R_COLOR_MANAGEMENT)? IB_PROFILE_LINEAR_RGB: IB_PROFILE_SRGB;
int predivide= (rd->color_mgt_flag & R_COLOR_MANAGEMENT_PREDIVIDE);
int dither= 0;
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index 49bacbaf693..453bb0aeeb6 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -96,39 +96,39 @@ static void init_render_texture(Render *re, Tex *tex)
{
int cfra= re->scene->r.cfra;
- if(re) cfra= re->r.cfra;
+ if (re) cfra= re->r.cfra;
/* imap test */
- if(tex->ima && ELEM(tex->ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
+ if (tex->ima && ELEM(tex->ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
BKE_image_user_calc_frame(&tex->iuser, cfra, re?re->flag & R_SEC_FIELD:0);
}
- if(tex->type==TEX_PLUGIN) {
- if(tex->plugin && tex->plugin->doit) {
- if(tex->plugin->cfra) {
+ if (tex->type==TEX_PLUGIN) {
+ if (tex->plugin && tex->plugin->doit) {
+ if (tex->plugin->cfra) {
*(tex->plugin->cfra)= (float)cfra; //BKE_curframe(re->scene); // XXX old animsys - timing stuff to be fixed
}
}
}
- else if(tex->type==TEX_ENVMAP) {
+ else if (tex->type==TEX_ENVMAP) {
/* just in case */
tex->imaflag |= TEX_INTERPOL | TEX_MIPMAP;
tex->extend= TEX_CLIP;
- if(tex->env) {
- if(tex->env->type==ENV_PLANE)
+ if (tex->env) {
+ if (tex->env->type==ENV_PLANE)
tex->extend= TEX_EXTEND;
/* only free envmap when rendermode was set to render envmaps, for previewrender */
- if(G.rendering && re) {
+ if (G.rendering && re) {
if (re->r.mode & R_ENVMAP)
- if(tex->env->stype==ENV_ANIM)
+ if (tex->env->stype==ENV_ANIM)
BKE_free_envmapdata(tex->env);
}
}
}
- if(tex->nodetree && tex->use_nodes) {
+ if (tex->nodetree && tex->use_nodes) {
ntreeTexBeginExecTree(tex->nodetree, 1); /* has internal flag to detect it only does it once */
}
}
@@ -140,23 +140,23 @@ void init_render_textures(Render *re)
Tex *tex;
tex= re->main->tex.first;
- while(tex) {
- if(tex->id.us) init_render_texture(re, tex);
+ while (tex) {
+ if (tex->id.us) init_render_texture(re, tex);
tex= tex->id.next;
}
}
static void end_render_texture(Tex *tex)
{
- if(tex && tex->use_nodes && tex->nodetree && tex->nodetree->execdata)
+ if (tex && tex->use_nodes && tex->nodetree && tex->nodetree->execdata)
ntreeTexEndExecTree(tex->nodetree->execdata, 1);
}
void end_render_textures(Render *re)
{
Tex *tex;
- for(tex= re->main->tex.first; tex; tex= tex->id.next)
- if(tex->id.us)
+ for (tex= re->main->tex.first; tex; tex= tex->id.next)
+ if (tex->id.us)
end_render_texture(tex);
}
@@ -197,7 +197,7 @@ static int blend(Tex *tex, float *texvec, TexResult *texres)
{
float x, y, t;
- if(tex->flag & TEX_FLIPBLEND) {
+ if (tex->flag & TEX_FLIPBLEND) {
x= texvec[1];
y= texvec[0];
}
@@ -206,33 +206,33 @@ static int blend(Tex *tex, float *texvec, TexResult *texres)
y= texvec[1];
}
- if(tex->stype==TEX_LIN) { /* lin */
+ if (tex->stype==TEX_LIN) { /* lin */
texres->tin= (1.0f+x)/2.0f;
}
- else if(tex->stype==TEX_QUAD) { /* quad */
+ else if (tex->stype==TEX_QUAD) { /* quad */
texres->tin= (1.0f+x)/2.0f;
- if(texres->tin<0.0f) texres->tin= 0.0f;
+ if (texres->tin<0.0f) texres->tin= 0.0f;
else texres->tin*= texres->tin;
}
- else if(tex->stype==TEX_EASE) { /* ease */
+ else if (tex->stype==TEX_EASE) { /* ease */
texres->tin= (1.0f+x)/2.0f;
- if(texres->tin<=0.0f) texres->tin= 0.0f;
- else if(texres->tin>=1.0f) texres->tin= 1.0f;
+ if (texres->tin<=0.0f) texres->tin= 0.0f;
+ else if (texres->tin>=1.0f) texres->tin= 1.0f;
else {
t= texres->tin*texres->tin;
texres->tin= (3.0f*t-2.0f*t*texres->tin);
}
}
- else if(tex->stype==TEX_DIAG) { /* diag */
+ else if (tex->stype==TEX_DIAG) { /* diag */
texres->tin= (2.0f+x+y)/4.0f;
}
- else if(tex->stype==TEX_RAD) { /* radial */
+ else if (tex->stype==TEX_RAD) { /* radial */
texres->tin= (atan2(y,x) / (2*M_PI) + 0.5);
}
else { /* sphere TEX_SPHERE */
texres->tin= 1.0-sqrt(x*x+ y*y+texvec[2]*texvec[2]);
- if(texres->tin<0.0f) texres->tin= 0.0f;
- if(tex->stype==TEX_HALO) texres->tin*= texres->tin; /* halo */
+ if (texres->tin<0.0f) texres->tin= 0.0f;
+ if (tex->stype==TEX_HALO) texres->tin*= texres->tin; /* halo */
}
BRICONT;
@@ -426,37 +426,37 @@ static int magic(Tex *tex, float *texvec, TexResult *texres)
x= sin( ( texvec[0]+texvec[1]+texvec[2])*5.0f );
y= cos( (-texvec[0]+texvec[1]-texvec[2])*5.0f );
z= -cos( (-texvec[0]-texvec[1]+texvec[2])*5.0f );
- if(n>0) {
+ if (n>0) {
x*= turb;
y*= turb;
z*= turb;
y= -cos(x-y+z);
y*= turb;
- if(n>1) {
+ if (n>1) {
x= cos(x-y-z);
x*= turb;
- if(n>2) {
+ if (n>2) {
z= sin(-x-y-z);
z*= turb;
- if(n>3) {
+ if (n>3) {
x= -cos(-x+y-z);
x*= turb;
- if(n>4) {
+ if (n>4) {
y= -sin(-x+y+z);
y*= turb;
- if(n>5) {
+ if (n>5) {
y= -cos(-x+y+z);
y*= turb;
- if(n>6) {
+ if (n>6) {
x= cos(x+y+z);
x*= turb;
- if(n>7) {
+ if (n>7) {
z= sin(x+y-z);
z*= turb;
- if(n>8) {
+ if (n>8) {
x= -cos(-x-y+z);
x*= turb;
- if(n>9) {
+ if (n>9) {
y= -sin(x-y+z);
y*= turb;
}
@@ -470,7 +470,7 @@ static int magic(Tex *tex, float *texvec, TexResult *texres)
}
}
- if(turb!=0.0f) {
+ if (turb!=0.0f) {
turb*= 2.0f;
x/= turb;
y/= turb;
@@ -500,19 +500,19 @@ static int stucci(Tex *tex, float *texvec, TexResult *texres)
ofs= tex->turbul/200.0f;
- if(tex->stype) ofs*=(b2*b2);
+ if (tex->stype) ofs*=(b2*b2);
nor[0] = BLI_gNoise(tex->noisesize, texvec[0]+ofs, texvec[1], texvec[2], (tex->noisetype!=TEX_NOISESOFT), tex->noisebasis);
nor[1] = BLI_gNoise(tex->noisesize, texvec[0], texvec[1]+ofs, texvec[2], (tex->noisetype!=TEX_NOISESOFT), tex->noisebasis);
nor[2] = BLI_gNoise(tex->noisesize, texvec[0], texvec[1], texvec[2]+ofs, (tex->noisetype!=TEX_NOISESOFT), tex->noisebasis);
texres->tin= nor[2];
- if(texres->nor) {
+ if (texres->nor) {
copy_v3_v3(texres->nor, nor);
tex_normal_derivate(tex, texres);
- if(tex->stype==TEX_WALLOUT) {
+ if (tex->stype==TEX_WALLOUT) {
texres->nor[0]= -texres->nor[0];
texres->nor[1]= -texres->nor[1];
texres->nor[2]= -texres->nor[2];
@@ -521,10 +521,10 @@ static int stucci(Tex *tex, float *texvec, TexResult *texres)
retval |= TEX_NOR;
}
- if(tex->stype==TEX_WALLOUT)
+ if (tex->stype==TEX_WALLOUT)
texres->tin= 1.0f-texres->tin;
- if(texres->tin<0.0f)
+ if (texres->tin<0.0f)
texres->tin= 0.0f;
return retval;
@@ -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);
@@ -733,7 +733,7 @@ static int texnoise(Tex *tex, TexResult *texres)
val= (ran & 3);
loop= tex->noisedepth;
- while(loop--) {
+ while (loop--) {
ran= (ran>>2);
val*= (ran & 3);
div*= 3.0f;
@@ -756,21 +756,23 @@ static int plugintex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex
texres->tin= 0.0;
pit= tex->plugin;
- if(pit && pit->doit) {
- if(texres->nor) {
+ if (pit && pit->doit) {
+ if (texres->nor) {
if (pit->version < 6) {
copy_v3_v3(pit->result+5, texres->nor);
- } else {
+ }
+ else {
copy_v3_v3(result+5, texres->nor);
}
}
if (pit->version < 6) {
- if(osatex) rgbnor= ((TexDoitold)pit->doit)(tex->stype,
+ if (osatex) rgbnor= ((TexDoitold)pit->doit)(tex->stype,
pit->data, texvec, dxt, dyt);
else rgbnor= ((TexDoitold)pit->doit)(tex->stype,
pit->data, texvec, NULL, NULL);
- } else {
- if(osatex) rgbnor= ((TexDoit)pit->doit)(tex->stype,
+ }
+ else {
+ if (osatex) rgbnor= ((TexDoit)pit->doit)(tex->stype,
pit->data, texvec, dxt, dyt, result);
else rgbnor= ((TexDoit)pit->doit)(tex->stype,
pit->data, texvec, NULL, NULL, result);
@@ -778,27 +780,30 @@ static int plugintex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex
if (pit->version < 6) {
texres->tin = pit->result[0];
- } else {
+ }
+ else {
texres->tin = result[0]; /* XXX, assigning garbage value, fixme! */
}
- if(rgbnor & TEX_NOR) {
- if(texres->nor) {
+ if (rgbnor & TEX_NOR) {
+ if (texres->nor) {
if (pit->version < 6) {
copy_v3_v3(texres->nor, pit->result+5);
- } else {
+ }
+ else {
copy_v3_v3(texres->nor, result+5);
}
}
}
- if(rgbnor & TEX_RGB) {
+ if (rgbnor & TEX_RGB) {
if (pit->version < 6) {
texres->tr = pit->result[1];
texres->tg = pit->result[2];
texres->tb = pit->result[3];
texres->ta = pit->result[4];
- } else {
+ }
+ else {
texres->tr = result[1];
texres->tg = result[2];
texres->tb = result[3];
@@ -820,7 +825,7 @@ static int cubemap_glob(float *n, float x, float y, float z, float *adr1, float
float x1, y1, z1, nor[3];
int ret;
- if(n==NULL) {
+ if (n==NULL) {
nor[0]= x; nor[1]= y; nor[2]= z; // use local render coord
}
else {
@@ -832,12 +837,12 @@ static int cubemap_glob(float *n, float x, float y, float z, float *adr1, float
y1= fabs(nor[1]);
z1= fabs(nor[2]);
- if(z1>=x1 && z1>=y1) {
+ if (z1>=x1 && z1>=y1) {
*adr1 = (x + 1.0f) / 2.0f;
*adr2 = (y + 1.0f) / 2.0f;
ret= 0;
}
- else if(y1>=x1 && y1>=z1) {
+ else if (y1>=x1 && y1>=z1) {
*adr1 = (x + 1.0f) / 2.0f;
*adr2 = (z + 1.0f) / 2.0f;
ret= 1;
@@ -857,24 +862,24 @@ static int cubemap(MTex *mtex, VlakRen *vlr, float *n, float x, float y, float z
{
int proj[4]={0, ME_PROJXY, ME_PROJXZ, ME_PROJYZ}, ret= 0;
- if(vlr) {
+ if (vlr) {
int index;
/* Mesh vertices have such flags, for others we calculate it once based on orco */
- if((vlr->puno & (ME_PROJXY|ME_PROJXZ|ME_PROJYZ))==0) {
+ if ((vlr->puno & (ME_PROJXY|ME_PROJXZ|ME_PROJYZ))==0) {
/* test for v1, vlr can be faked for baking */
- if(vlr->v1 && vlr->v1->orco) {
+ if (vlr->v1 && vlr->v1->orco) {
float nor[3];
normal_tri_v3( nor,vlr->v1->orco, vlr->v2->orco, vlr->v3->orco);
- if( fabs(nor[0])<fabs(nor[2]) && fabs(nor[1])<fabs(nor[2]) ) vlr->puno |= ME_PROJXY;
- else if( fabs(nor[0])<fabs(nor[1]) && fabs(nor[2])<fabs(nor[1]) ) vlr->puno |= ME_PROJXZ;
+ if ( fabs(nor[0])<fabs(nor[2]) && fabs(nor[1])<fabs(nor[2]) ) vlr->puno |= ME_PROJXY;
+ else if ( fabs(nor[0])<fabs(nor[1]) && fabs(nor[2])<fabs(nor[1]) ) vlr->puno |= ME_PROJXZ;
else vlr->puno |= ME_PROJYZ;
}
else return cubemap_glob(n, x, y, z, adr1, adr2);
}
- if(mtex) {
+ if (mtex) {
/* the mtex->proj{xyz} have type char. maybe this should be wider? */
/* casting to int ensures that the index type is right. */
index = (int) mtex->projx;
@@ -887,11 +892,11 @@ static int cubemap(MTex *mtex, VlakRen *vlr, float *n, float x, float y, float z
proj[index]= ME_PROJYZ;
}
- if(vlr->puno & proj[1]) {
+ if (vlr->puno & proj[1]) {
*adr1 = (x + 1.0f) / 2.0f;
*adr2 = (y + 1.0f) / 2.0f;
}
- else if(vlr->puno & proj[2]) {
+ else if (vlr->puno & proj[2]) {
*adr1 = (x + 1.0f) / 2.0f;
*adr2 = (z + 1.0f) / 2.0f;
ret= 1;
@@ -916,21 +921,21 @@ static int cubemap_ob(Object *ob, float *n, float x, float y, float z, float *ad
float x1, y1, z1, nor[3];
int ret;
- if(n==NULL) return 0;
+ if (n==NULL) return 0;
copy_v3_v3(nor, n);
- if(ob) mul_mat3_m4_v3(ob->imat, nor);
+ if (ob) mul_mat3_m4_v3(ob->imat, nor);
x1= fabs(nor[0]);
y1= fabs(nor[1]);
z1= fabs(nor[2]);
- if(z1>=x1 && z1>=y1) {
+ if (z1>=x1 && z1>=y1) {
*adr1 = (x + 1.0f) / 2.0f;
*adr2 = (y + 1.0f) / 2.0f;
ret= 0;
}
- else if(y1>=x1 && y1>=z1) {
+ else if (y1>=x1 && y1>=z1) {
*adr1 = (x + 1.0f) / 2.0f;
*adr2 = (z + 1.0f) / 2.0f;
ret= 1;
@@ -958,53 +963,53 @@ static void do_2d_mapping(MTex *mtex, float *t, VlakRen *vlr, float *n, float *d
ob= mtex->object;
texco= mtex->texco;
- if(R.osa==0) {
+ if (R.osa==0) {
- if(wrap==MTEX_FLAT) {
+ if (wrap==MTEX_FLAT) {
fx = (t[0] + 1.0f) / 2.0f;
fy = (t[1] + 1.0f) / 2.0f;
}
- else if(wrap==MTEX_TUBE) map_to_tube( &fx, &fy,t[0], t[1], t[2]);
- else if(wrap==MTEX_SPHERE) map_to_sphere( &fx, &fy,t[0], t[1], t[2]);
+ else if (wrap==MTEX_TUBE) map_to_tube( &fx, &fy,t[0], t[1], t[2]);
+ else if (wrap==MTEX_SPHERE) map_to_sphere( &fx, &fy,t[0], t[1], t[2]);
else {
- if(texco==TEXCO_OBJECT) cubemap_ob(ob, n, t[0], t[1], t[2], &fx, &fy);
- else if(texco==TEXCO_GLOB) cubemap_glob(n, t[0], t[1], t[2], &fx, &fy);
+ if (texco==TEXCO_OBJECT) cubemap_ob(ob, n, t[0], t[1], t[2], &fx, &fy);
+ else if (texco==TEXCO_GLOB) cubemap_glob(n, t[0], t[1], t[2], &fx, &fy);
else cubemap(mtex, vlr, n, t[0], t[1], t[2], &fx, &fy);
}
/* repeat */
- if(tex->extend==TEX_REPEAT) {
- if(tex->xrepeat>1) {
+ if (tex->extend==TEX_REPEAT) {
+ if (tex->xrepeat>1) {
float origf= fx *= tex->xrepeat;
- if(fx>1.0f) fx -= (int)(fx);
- else if(fx<0.0f) fx+= 1-(int)(fx);
+ if (fx>1.0f) fx -= (int)(fx);
+ else if (fx<0.0f) fx+= 1-(int)(fx);
- if(tex->flag & TEX_REPEAT_XMIR) {
+ if (tex->flag & TEX_REPEAT_XMIR) {
int orig= (int)floor(origf);
- if(orig & 1)
+ if (orig & 1)
fx= 1.0f-fx;
}
}
- if(tex->yrepeat>1) {
+ if (tex->yrepeat>1) {
float origf= fy *= tex->yrepeat;
- if(fy>1.0f) fy -= (int)(fy);
- else if(fy<0.0f) fy+= 1-(int)(fy);
+ if (fy>1.0f) fy -= (int)(fy);
+ else if (fy<0.0f) fy+= 1-(int)(fy);
- if(tex->flag & TEX_REPEAT_YMIR) {
+ if (tex->flag & TEX_REPEAT_YMIR) {
int orig= (int)floor(origf);
- if(orig & 1)
+ if (orig & 1)
fy= 1.0f-fy;
}
}
}
/* crop */
- if(tex->cropxmin!=0.0f || tex->cropxmax!=1.0f) {
+ if (tex->cropxmin!=0.0f || tex->cropxmax!=1.0f) {
fac1= tex->cropxmax - tex->cropxmin;
fx= tex->cropxmin+ fx*fac1;
}
- if(tex->cropymin!=0.0f || tex->cropymax!=1.0f) {
+ if (tex->cropymin!=0.0f || tex->cropymax!=1.0f) {
fac1= tex->cropymax - tex->cropymin;
fy= tex->cropymin+ fy*fac1;
}
@@ -1014,7 +1019,7 @@ static void do_2d_mapping(MTex *mtex, float *t, VlakRen *vlr, float *n, float *d
}
else {
- if(wrap==MTEX_FLAT) {
+ if (wrap==MTEX_FLAT) {
fx= (t[0] + 1.0f) / 2.0f;
fy= (t[1] + 1.0f) / 2.0f;
dxt[0]/= 2.0f;
@@ -1024,18 +1029,18 @@ static void do_2d_mapping(MTex *mtex, float *t, VlakRen *vlr, float *n, float *d
dyt[1]/= 2.0f;
dyt[2]/= 2.0f;
}
- else if ELEM(wrap, MTEX_TUBE, MTEX_SPHERE) {
+ else if (ELEM(wrap, MTEX_TUBE, MTEX_SPHERE)) {
/* exception: the seam behind (y<0.0) */
ok= 1;
- if(t[1]<=0.0f) {
+ if (t[1]<=0.0f) {
fx= t[0]+dxt[0];
fy= t[0]+dyt[0];
- if(fx>=0.0f && fy>=0.0f && t[0]>=0.0f);
- else if(fx<=0.0f && fy<=0.0f && t[0]<=0.0f);
+ if (fx>=0.0f && fy>=0.0f && t[0]>=0.0f);
+ else if (fx<=0.0f && fy<=0.0f && t[0]<=0.0f);
else ok= 0;
}
- if(ok) {
- if(wrap==MTEX_TUBE) {
+ if (ok) {
+ if (wrap==MTEX_TUBE) {
map_to_tube( area, area+1,t[0], t[1], t[2]);
map_to_tube( area+2, area+3,t[0]+dxt[0], t[1]+dxt[1], t[2]+dxt[2]);
map_to_tube( area+4, area+5,t[0]+dyt[0], t[1]+dyt[1], t[2]+dyt[2]);
@@ -1048,7 +1053,7 @@ static void do_2d_mapping(MTex *mtex, float *t, VlakRen *vlr, float *n, float *d
areaflag= 1;
}
else {
- if(wrap==MTEX_TUBE) map_to_tube( &fx, &fy,t[0], t[1], t[2]);
+ if (wrap==MTEX_TUBE) map_to_tube( &fx, &fy,t[0], t[1], t[2]);
else map_to_sphere( &fx, &fy,t[0], t[1], t[2]);
dxt[0]/= 2.0f;
dxt[1]/= 2.0f;
@@ -1058,15 +1063,15 @@ static void do_2d_mapping(MTex *mtex, float *t, VlakRen *vlr, float *n, float *d
}
else {
- if(texco==TEXCO_OBJECT) proj = cubemap_ob(ob, n, t[0], t[1], t[2], &fx, &fy);
+ if (texco==TEXCO_OBJECT) proj = cubemap_ob(ob, n, t[0], t[1], t[2], &fx, &fy);
else if (texco==TEXCO_GLOB) proj = cubemap_glob(n, t[0], t[1], t[2], &fx, &fy);
else proj = cubemap(mtex, vlr, n, t[0], t[1], t[2], &fx, &fy);
- if(proj==1) {
+ if (proj==1) {
SWAP(float, dxt[1], dxt[2]);
SWAP(float, dyt[1], dyt[2]);
}
- else if(proj==2) {
+ else if (proj==2) {
float f1= dxt[0], f2= dyt[0];
dxt[0]= dxt[1];
dyt[0]= dyt[1];
@@ -1087,7 +1092,7 @@ static void do_2d_mapping(MTex *mtex, float *t, VlakRen *vlr, float *n, float *d
}
/* if area, then reacalculate dxt[] and dyt[] */
- if(areaflag) {
+ if (areaflag) {
fx= area[0];
fy= area[1];
dxt[0]= area[2]-fx;
@@ -1097,19 +1102,19 @@ static void do_2d_mapping(MTex *mtex, float *t, VlakRen *vlr, float *n, float *d
}
/* repeat */
- if(tex->extend==TEX_REPEAT) {
+ if (tex->extend==TEX_REPEAT) {
float max= 1.0f;
- if(tex->xrepeat>1) {
+ if (tex->xrepeat>1) {
float origf= fx *= tex->xrepeat;
// TXF: omit mirror here, see comments in do_material_tex() after do_2d_mapping() call
if (tex->texfilter == TXF_BOX) {
- if(fx>1.0f) fx -= (int)(fx);
- else if(fx<0.0f) fx+= 1-(int)(fx);
+ if (fx>1.0f) fx -= (int)(fx);
+ else if (fx<0.0f) fx+= 1-(int)(fx);
- if(tex->flag & TEX_REPEAT_XMIR) {
+ if (tex->flag & TEX_REPEAT_XMIR) {
int orig= (int)floor(origf);
- if(orig & 1)
+ if (orig & 1)
fx= 1.0f-fx;
}
}
@@ -1119,41 +1124,41 @@ static void do_2d_mapping(MTex *mtex, float *t, VlakRen *vlr, float *n, float *d
dxt[0]*= tex->xrepeat;
dyt[0]*= tex->xrepeat;
}
- if(tex->yrepeat>1) {
+ if (tex->yrepeat>1) {
float origf= fy *= tex->yrepeat;
// TXF: omit mirror here, see comments in do_material_tex() after do_2d_mapping() call
if (tex->texfilter == TXF_BOX) {
- if(fy>1.0f) fy -= (int)(fy);
- else if(fy<0.0f) fy+= 1-(int)(fy);
+ if (fy>1.0f) fy -= (int)(fy);
+ else if (fy<0.0f) fy+= 1-(int)(fy);
- if(tex->flag & TEX_REPEAT_YMIR) {
+ if (tex->flag & TEX_REPEAT_YMIR) {
int orig= (int)floor(origf);
- if(orig & 1)
+ if (orig & 1)
fy= 1.0f-fy;
}
}
- if(max<tex->yrepeat)
+ if (max<tex->yrepeat)
max= tex->yrepeat;
dxt[1]*= tex->yrepeat;
dyt[1]*= tex->yrepeat;
}
- if(max!=1.0f) {
+ if (max!=1.0f) {
dxt[2]*= max;
dyt[2]*= max;
}
}
/* crop */
- if(tex->cropxmin!=0.0f || tex->cropxmax!=1.0f) {
+ if (tex->cropxmin!=0.0f || tex->cropxmax!=1.0f) {
fac1= tex->cropxmax - tex->cropxmin;
fx= tex->cropxmin+ fx*fac1;
dxt[0]*= fac1;
dyt[0]*= fac1;
}
- if(tex->cropymin!=0.0f || tex->cropymax!=1.0f) {
+ if (tex->cropymin!=0.0f || tex->cropymax!=1.0f) {
fac1= tex->cropymax - tex->cropymin;
fy= tex->cropymin+ fy*fac1;
dxt[1]*= fac1;
@@ -1175,7 +1180,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex,
texres->talpha= 0; /* is set when image texture returns alpha (considered premul) */
- if(tex->use_nodes && tex->nodetree) {
+ if (tex->use_nodes && tex->nodetree) {
retval = ntreeTexExecTree(tex->nodetree, texres, texvec, dxt, dyt, osatex, thread,
tex, which_output, R.r.cfra, (R.r.scemode & R_TEXNODE_PREVIEW) != 0, NULL, NULL);
}
@@ -1207,7 +1212,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex,
retval= texnoise(tex, texres);
break;
case TEX_IMAGE:
- if(osatex) retval= imagewraposa(tex, tex->ima, NULL, texvec, dxt, dyt, texres);
+ if (osatex) retval= imagewraposa(tex, tex->ima, NULL, texvec, dxt, dyt, texres);
else retval= imagewrap(tex, tex->ima, NULL, texvec, texres);
tag_image_time(tex->ima); /* tag image as having being used */
break;
@@ -1287,27 +1292,27 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex,
/* this is called from the shader and texture nodes */
int multitex_nodes(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexResult *texres, short thread, short which_output, ShadeInput *shi, MTex *mtex)
{
- if(tex==NULL) {
+ if (tex==NULL) {
memset(texres, 0, sizeof(TexResult));
return 0;
}
- if(mtex)
+ if (mtex)
which_output= mtex->which_output;
- if(tex->type==TEX_IMAGE) {
+ if (tex->type==TEX_IMAGE) {
int rgbnor;
- if(mtex) {
+ if (mtex) {
/* we have mtex, use it for 2d mapping images only */
do_2d_mapping(mtex, texvec, shi->vlr, shi->facenor, dxt, dyt);
rgbnor= multitex(tex, texvec, dxt, dyt, osatex, texres, thread, which_output);
- if(mtex->mapto & (MAP_COL+MAP_COLSPEC+MAP_COLMIR)) {
+ if (mtex->mapto & (MAP_COL+MAP_COLSPEC+MAP_COLMIR)) {
ImBuf *ibuf = BKE_image_get_ibuf(tex->ima, &tex->iuser);
/* don't linearize float buffers, assumed to be linear */
- if(ibuf && !(ibuf->rect_float) && R.r.color_mgt_flag & R_COLOR_MANAGEMENT)
+ if (ibuf && !(ibuf->rect_float) && R.r.color_mgt_flag & R_COLOR_MANAGEMENT)
srgb_to_linearrgb_v3_v3(&texres->tr, &texres->tr);
}
}
@@ -1322,7 +1327,7 @@ int multitex_nodes(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex,
localmtex.texco= TEXCO_ORCO;
copy_v3_v3(texvec_l, texvec);
- if(dxt && dyt) {
+ if (dxt && dyt) {
copy_v3_v3(dxt_l, dxt);
copy_v3_v3(dyt_l, dyt);
}
@@ -1346,9 +1351,9 @@ int multitex_mtex(ShadeInput *shi, MTex *mtex, float *texvec, float *dxt, float
{
Tex *tex= mtex->tex;
- if(tex->use_nodes && tex->nodetree) {
+ 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);
}
@@ -1414,15 +1419,15 @@ void texture_rgb_blend(float in[3], const float tex[3], const float out[3], floa
fact*= facg;
facm= 1.0f-facg;
- if(out[0] < 0.5f)
+ if (out[0] < 0.5f)
in[0] = out[0] * (facm + 2.0f*fact*tex[0]);
else
in[0] = 1.0f - (facm + 2.0f*fact*(1.0f - tex[0])) * (1.0f - out[0]);
- if(out[1] < 0.5f)
+ if (out[1] < 0.5f)
in[1] = out[1] * (facm + 2.0f*fact*tex[1]);
else
in[1] = 1.0f - (facm + 2.0f*fact*(1.0f - tex[1])) * (1.0f - out[1]);
- if(out[2] < 0.5f)
+ if (out[2] < 0.5f)
in[2] = out[2] * (facm + 2.0f*fact*tex[2]);
else
in[2] = 1.0f - (facm + 2.0f*fact*(1.0f - tex[2])) * (1.0f - out[2]);
@@ -1441,11 +1446,11 @@ void texture_rgb_blend(float in[3], const float tex[3], const float out[3], floa
fact*= facg;
facm= 1.0f-fact;
- if(tex[0]!=0.0f)
+ if (tex[0]!=0.0f)
in[0]= facm*out[0] + fact*out[0]/tex[0];
- if(tex[1]!=0.0f)
+ if (tex[1]!=0.0f)
in[1]= facm*out[1] + fact*out[1]/tex[1];
- if(tex[2]!=0.0f)
+ if (tex[2]!=0.0f)
in[2]= facm*out[2] + fact*out[2]/tex[2];
break;
@@ -1463,22 +1468,22 @@ void texture_rgb_blend(float in[3], const float tex[3], const float out[3], floa
facm= 1.0f-fact;
col= tex[0]+((1-tex[0])*facm);
- if(col < out[0]) in[0]= col; else in[0]= out[0];
+ if (col < out[0]) in[0]= col; else in[0]= out[0];
col= tex[1]+((1-tex[1])*facm);
- if(col < out[1]) in[1]= col; else in[1]= out[1];
+ if (col < out[1]) in[1]= col; else in[1]= out[1];
col= tex[2]+((1-tex[2])*facm);
- if(col < out[2]) in[2]= col; else in[2]= out[2];
+ if (col < out[2]) in[2]= col; else in[2]= out[2];
break;
case MTEX_LIGHT:
fact*= facg;
col= fact*tex[0];
- if(col > out[0]) in[0]= col; else in[0]= out[0];
+ if (col > out[0]) in[0]= col; else in[0]= out[0];
col= fact*tex[1];
- if(col > out[1]) in[1]= col; else in[1]= out[1];
+ if (col > out[1]) in[1]= col; else in[1]= out[1];
col= fact*tex[2];
- if(col > out[2]) in[2]= col; else in[2]= out[2];
+ if (col > out[2]) in[2]= col; else in[2]= out[2];
break;
case MTEX_BLEND_HUE:
@@ -1523,7 +1528,7 @@ float texture_value_blend(float tex, float out, float fact, float facg, int blen
fact*= facg;
facm= 1.0f-fact;
- if(flip) SWAP(float, fact, facm);
+ if (flip) SWAP(float, fact, facm);
switch(blendtype) {
case MTEX_BLEND:
@@ -1542,7 +1547,7 @@ float texture_value_blend(float tex, float out, float fact, float facg, int blen
case MTEX_OVERLAY:
facm= 1.0f-facg;
- if(out < 0.5f)
+ if (out < 0.5f)
in = out * (facm + 2.0f*fact*tex);
else
in = 1.0f - (facm + 2.0f*fact*(1.0f - tex)) * (1.0f - out);
@@ -1555,7 +1560,7 @@ float texture_value_blend(float tex, float out, float fact, float facg, int blen
break;
case MTEX_DIV:
- if(tex!=0.0f)
+ if (tex!=0.0f)
in= facm*out + fact*out/tex;
break;
@@ -1565,12 +1570,12 @@ float texture_value_blend(float tex, float out, float fact, float facg, int blen
case MTEX_DARK:
col= fact*tex;
- if(col < out) in= col; else in= out;
+ if (col < out) in= col; else in= out;
break;
case MTEX_LIGHT:
col= fact*tex;
- if(col > out) in= col; else in= out;
+ if (col > out) in= col; else in= out;
break;
case MTEX_SOFT_LIGHT:
@@ -1702,14 +1707,14 @@ static void compatible_bump_uv_derivs(CompatibleBump *compat_bump, ShadeInput *s
// NOTE: test for shi->obr->ob here, since vlr/obr/obi can be 'fake' when called from fastshade(), another reason to move it..
// NOTE: shi->v1 is NULL when called from displace_render_vert, assigning verts in this case is not trivial because the shi quad face side is not know.
if ((mtex->texflag & MTEX_COMPAT_BUMP) && shi->obr && shi->obr->ob && shi->v1) {
- if(mtex->mapto & (MAP_NORM|MAP_WARP) && !((mtex->tex->type==TEX_IMAGE) && (mtex->tex->imaflag & TEX_NORMALMAP))) {
+ if (mtex->mapto & (MAP_NORM|MAP_WARP) && !((mtex->tex->type==TEX_IMAGE) && (mtex->tex->imaflag & TEX_NORMALMAP))) {
MTFace* tf = RE_vlakren_get_tface(shi->obr, shi->vlr, i, NULL, 0);
int j1 = shi->i1, j2 = shi->i2, j3 = shi->i3;
vlr_set_uv_indices(shi->vlr, &j1, &j2, &j3);
// compute ortho basis around normal
- if(!compat_bump->nunvdone) {
+ if (!compat_bump->nunvdone) {
// render normal is negated
compat_bump->nn[0] = -shi->vn[0];
compat_bump->nn[1] = -shi->vn[1];
@@ -1763,7 +1768,7 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi,
du = dv = 0.01f;
// compute ortho basis around normal
- if(!compat_bump->nunvdone) {
+ if (!compat_bump->nunvdone) {
// render normal is negated
negate_v3_v3(compat_bump->nn, shi->vn);
ortho_basis_v3v3_v3(compat_bump->nu, compat_bump->nv, compat_bump->nn);
@@ -1932,15 +1937,16 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
float *nvec = texres->nor;
texres->nor = NULL;
- if(found_deriv_map==0) {
- if( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) {
- if(tex->ima)
+ if (found_deriv_map==0) {
+ if ( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) {
+ if (tex->ima)
Hscale *= 13.0f; // appears to be a sensible default value
- } else
+ }
+ else
Hscale *= 0.1f; // factor 0.1 proved to look like the previous bump code
}
- if( !ntap_bump->init_done ) {
+ if ( !ntap_bump->init_done ) {
copy_v3_v3(ntap_bump->vNacc, shi->vn);
copy_v3_v3(ntap_bump->vNorg, shi->vn);
ntap_bump->fPrevMagnitude = 1.0f;
@@ -1950,7 +1956,7 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
}
// resolve image dimensions
- if(found_deriv_map || (mtex->texflag&MTEX_BUMP_TEXTURESPACE)!=0) {
+ if (found_deriv_map || (mtex->texflag&MTEX_BUMP_TEXTURESPACE)!=0) {
ImBuf* ibuf = BKE_image_get_ibuf(tex->ima, &tex->iuser);
if (ibuf) {
dimx = ibuf->x;
@@ -1959,16 +1965,16 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
}
}
- if(found_deriv_map) {
+ if (found_deriv_map) {
float dBdu, dBdv, auto_bump = 1.0f;
float s = 1; // negate this if flipped texture coordinate
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);
@@ -1982,14 +1988,14 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
dHdx = dBdu*dxt[0] + s * dBdv*dxt[1];
dHdy = dBdu*dyt[0] + s * dBdv*dyt[1];
}
- else if(!(mtex->texflag & MTEX_5TAP_BUMP)) {
+ else if (!(mtex->texflag & MTEX_5TAP_BUMP)) {
// compute height derivatives with respect to output image pixel coordinates x and y
float STll[3], STlr[3], STul[3];
float Hll, Hlr, Hul;
texco_mapping(shi, tex, mtex, co, dx, dy, texvec, dxt, dyt);
- for(c=0; c<nr_channels; c++) {
+ for (c=0; c<nr_channels; c++) {
// dx contains the derivatives (du/dx, dv/dx)
// dy contains the derivatives (du/dy, dv/dy)
STll[c] = texvec[c];
@@ -1998,7 +2004,7 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
}
// clear unused derivatives
- for(c=nr_channels; c<3; c++) {
+ for (c=nr_channels; c<3; c++) {
STll[c] = 0.0f;
STlr[c] = 0.0f;
STul[c] = 0.0f;
@@ -2025,7 +2031,7 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
texco_mapping(shi, tex, mtex, co, dx, dy, texvec, dxt, dyt);
- for(c=0; c<nr_channels; c++) {
+ for (c=0; c<nr_channels; c++) {
STc[c] = texvec[c];
STl[c] = texvec[c] - 0.5f*dxt[c];
STr[c] = texvec[c] + 0.5f*dxt[c];
@@ -2034,7 +2040,7 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
}
// clear unused derivatives
- for(c=nr_channels; c<3; c++) {
+ for (c=nr_channels; c<3; c++) {
STc[c] = 0.0f;
STl[c] = 0.0f;
STr[c] = 0.0f;
@@ -2064,17 +2070,17 @@ 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 )
+ if ( mtex->texflag & MTEX_BUMP_OBJECTSPACE )
iBumpSpace = 1;
- else if( mtex->texflag & MTEX_BUMP_TEXTURESPACE )
+ else if ( mtex->texflag & MTEX_BUMP_TEXTURESPACE )
iBumpSpace = 2;
else
iBumpSpace = 4; // ViewSpace
- if( ntap_bump->iPrevBumpSpace != iBumpSpace ) {
+ if ( ntap_bump->iPrevBumpSpace != iBumpSpace ) {
// initialize normal perturbation vectors
int xyz;
@@ -2087,7 +2093,7 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
copy_v3_v3(dPdy, shi->dyco);
copy_v3_v3(vN, ntap_bump->vNorg);
- if( mtex->texflag & MTEX_BUMP_OBJECTSPACE ) {
+ if ( mtex->texflag & MTEX_BUMP_OBJECTSPACE ) {
// TODO: these calculations happen for every pixel!
// -> move to shi->obi
mult_m4_m4m4(tmp, R.viewmat, shi->obr->ob->obmat);
@@ -2108,8 +2114,8 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
ntap_bump->sgn_det = (fDet < 0)? -1.0f: 1.0f;
abs_fDet = ntap_bump->sgn_det * fDet;
- if( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) {
- if(tex->ima) {
+ if ( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) {
+ if (tex->ima) {
// crazy hack solution that gives results similar to normal mapping - part 1
normalize_v3(ntap_bump->vR1);
normalize_v3(ntap_bump->vR2);
@@ -2118,7 +2124,7 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
}
fMagnitude = abs_fDet;
- if( mtex->texflag & MTEX_BUMP_OBJECTSPACE ) {
+ if ( mtex->texflag & MTEX_BUMP_OBJECTSPACE ) {
// pre do transform of texres->nor by the inverse transposed of obj2view
mul_transposed_m3_v3( view2obj, vN );
mul_transposed_m3_v3( view2obj, ntap_bump->vR1 );
@@ -2127,16 +2133,16 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
fMagnitude *= len_v3(vN);
}
- if(ntap_bump->fPrevMagnitude > 0.0f)
- for(xyz=0; xyz<3; xyz++)
+ if (ntap_bump->fPrevMagnitude > 0.0f)
+ for (xyz=0; xyz<3; xyz++)
ntap_bump->vNacc[xyz] *= fMagnitude / ntap_bump->fPrevMagnitude;
ntap_bump->fPrevMagnitude = fMagnitude;
ntap_bump->iPrevBumpSpace = iBumpSpace;
}
- if( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) {
- if(tex->ima) {
+ if ( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) {
+ if (tex->ima) {
// crazy hack solution that gives results similar to normal mapping - part 2
float vec[2];
const float imag_tspace_dimension_y = aspect*imag_tspace_dimension_x;
@@ -2151,7 +2157,7 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
}
// subtract the surface gradient from vNacc
- for(c=0; c<3; c++) {
+ for (c=0; c<3; c++) {
float vSurfGrad_compi = ntap_bump->sgn_det * (dHdx * ntap_bump->vR1[c] + dHdy * ntap_bump->vR2[c]);
ntap_bump->vNacc[c] -= vSurfGrad_compi;
texres->nor[c] = ntap_bump->vNacc[c]; // copy
@@ -2182,42 +2188,42 @@ void do_material_tex(ShadeInput *shi, Render *re)
if (re->r.scemode & R_NO_TEX) return;
/* here: test flag if there's a tex (todo) */
- for(tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
+ for (tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
/* separate tex switching */
- if(shi->mat->septex & (1<<tex_nr)) continue;
+ if (shi->mat->septex & (1<<tex_nr)) continue;
- if(shi->mat->mtex[tex_nr]) {
+ if (shi->mat->mtex[tex_nr]) {
mtex= shi->mat->mtex[tex_nr];
tex= mtex->tex;
- if(tex==0) continue;
+ if (tex==0) continue;
found_deriv_map = (tex->type==TEX_IMAGE) && (tex->imaflag & TEX_DERIVATIVEMAP);
use_compat_bump= (mtex->texflag & MTEX_COMPAT_BUMP);
use_ntap_bump= ((mtex->texflag & (MTEX_3TAP_BUMP|MTEX_5TAP_BUMP|MTEX_BICUBIC_BUMP))!=0 || found_deriv_map!=0) ? 1 : 0;
/* XXX texture node trees don't work for this yet */
- if(tex->nodetree && tex->use_nodes) {
+ if (tex->nodetree && tex->use_nodes) {
use_compat_bump = 0;
use_ntap_bump = 0;
}
/* case displacement mapping */
- if(shi->osatex==0 && use_ntap_bump) {
+ if (shi->osatex==0 && use_ntap_bump) {
use_ntap_bump = 0;
use_compat_bump = 1;
}
/* case ocean */
- if(tex->type == TEX_OCEAN) {
+ if (tex->type == TEX_OCEAN) {
use_ntap_bump = 0;
use_compat_bump = 0;
}
/* which coords */
- if(mtex->texco==TEXCO_ORCO) {
- if(mtex->texflag & MTEX_DUPLI_MAPTO) {
+ if (mtex->texco==TEXCO_ORCO) {
+ if (mtex->texflag & MTEX_DUPLI_MAPTO) {
co= shi->duplilo; dx= dxt; dy= dyt;
dxt[0]= dxt[1]= dxt[2]= 0.0f;
dyt[0]= dyt[1]= dyt[2]= 0.0f;
@@ -2226,21 +2232,21 @@ void do_material_tex(ShadeInput *shi, Render *re)
co= shi->lo; dx= shi->dxlo; dy= shi->dylo;
}
}
- else if(mtex->texco==TEXCO_STICKY) {
+ else if (mtex->texco==TEXCO_STICKY) {
co= shi->sticky; dx= shi->dxsticky; dy= shi->dysticky;
}
- else if(mtex->texco==TEXCO_OBJECT) {
+ else if (mtex->texco==TEXCO_OBJECT) {
Object *ob= mtex->object;
- if(ob) {
+ if (ob) {
co= tempvec;
dx= dxt;
dy= dyt;
copy_v3_v3(tempvec, shi->co);
- if(mtex->texflag & MTEX_OB_DUPLI_ORIG)
- if(shi->obi && shi->obi->duplitexmat)
+ if (mtex->texflag & MTEX_OB_DUPLI_ORIG)
+ if (shi->obi && shi->obi->duplitexmat)
mul_m4_v3(shi->obi->duplitexmat, tempvec);
mul_m4_v3(ob->imat_ren, tempvec);
- if(shi->osatex) {
+ if (shi->osatex) {
copy_v3_v3(dxt, shi->dxco);
copy_v3_v3(dyt, shi->dyco);
mul_mat3_m4_v3(ob->imat_ren, dxt);
@@ -2253,21 +2259,21 @@ void do_material_tex(ShadeInput *shi, Render *re)
dx= shi->dxco; dy= shi->dyco;
}
}
- else if(mtex->texco==TEXCO_REFL) {
+ else if (mtex->texco==TEXCO_REFL) {
calc_R_ref(shi);
co= shi->ref; dx= shi->dxref; dy= shi->dyref;
}
- else if(mtex->texco==TEXCO_NORM) {
+ else if (mtex->texco==TEXCO_NORM) {
co= shi->orn; dx= shi->dxno; dy= shi->dyno;
}
- else if(mtex->texco==TEXCO_TANGENT) {
+ else if (mtex->texco==TEXCO_TANGENT) {
co= shi->tang; dx= shi->dxno; dy= shi->dyno;
}
- else if(mtex->texco==TEXCO_GLOB) {
+ else if (mtex->texco==TEXCO_GLOB) {
co= shi->gl; dx= shi->dxgl; dy= shi->dygl;
}
- else if(mtex->texco==TEXCO_UV) {
- if(mtex->texflag & MTEX_DUPLI_MAPTO) {
+ else if (mtex->texco==TEXCO_UV) {
+ if (mtex->texflag & MTEX_DUPLI_MAPTO) {
co= shi->dupliuv; dx= dxt; dy= dyt;
dxt[0]= dxt[1]= dxt[2]= 0.0f;
dyt[0]= dyt[1]= dyt[2]= 0.0f;
@@ -2276,9 +2282,9 @@ void do_material_tex(ShadeInput *shi, Render *re)
ShadeInputUV *suv= &shi->uv[shi->actuv];
int i = shi->actuv;
- if(mtex->uvname[0] != 0) {
- for(i = 0; i < shi->totuv; i++) {
- if(strcmp(shi->uv[i].name, mtex->uvname)==0) {
+ if (mtex->uvname[0] != 0) {
+ for (i = 0; i < shi->totuv; i++) {
+ if (strcmp(shi->uv[i].name, mtex->uvname)==0) {
suv= &shi->uv[i];
break;
}
@@ -2292,10 +2298,10 @@ void do_material_tex(ShadeInput *shi, Render *re)
compatible_bump_uv_derivs(&compat_bump, shi, mtex, i);
}
}
- else if(mtex->texco==TEXCO_WINDOW) {
+ else if (mtex->texco==TEXCO_WINDOW) {
co= shi->winco; dx= shi->dxwin; dy= shi->dywin;
}
- else if(mtex->texco==TEXCO_STRAND) {
+ else if (mtex->texco==TEXCO_STRAND) {
co= tempvec; dx= dxt; dy= dyt;
co[0]= shi->strandco;
co[1]= co[2]= 0.0f;
@@ -2304,7 +2310,7 @@ void do_material_tex(ShadeInput *shi, Render *re)
dy[0]= shi->dystrand;
dy[1]= dy[2]= 0.0f;
}
- else if(mtex->texco==TEXCO_STRESS) {
+ else if (mtex->texco==TEXCO_STRESS) {
co= tempvec; dx= dxt; dy= dyt;
co[0]= shi->stress;
co[1]= co[2]= 0.0f;
@@ -2316,24 +2322,24 @@ void do_material_tex(ShadeInput *shi, Render *re)
else continue; // can happen when texco defines disappear and it renders old files
/* the pointer defines if bumping happens */
- if(mtex->mapto & (MAP_NORM|MAP_WARP)) {
+ if (mtex->mapto & (MAP_NORM|MAP_WARP)) {
texres.nor= norvec;
norvec[0]= norvec[1]= norvec[2]= 0.0;
}
else texres.nor= NULL;
- if(warpdone) {
+ if (warpdone) {
add_v3_v3v3(tempvec, co, warpvec);
co= tempvec;
}
/* XXX texture node trees don't work for this yet */
- if(texres.nor && !((tex->type==TEX_IMAGE) && (tex->imaflag & TEX_NORMALMAP))) {
- if(use_compat_bump) {
+ if (texres.nor && !((tex->type==TEX_IMAGE) && (tex->imaflag & TEX_NORMALMAP))) {
+ if (use_compat_bump) {
rgbnor = compatible_bump_compute(&compat_bump, shi, mtex, tex,
&texres, Tnor*stencilTin, co, dx, dy, texvec, dxt, dyt);
}
- else if(use_ntap_bump) {
+ else if (use_ntap_bump) {
rgbnor = ntap_bump_compute(&ntap_bump, shi, mtex, tex,
&texres, Tnor*stencilTin, co, dx, dy, texvec, dxt, dyt);
}
@@ -2349,20 +2355,20 @@ void do_material_tex(ShadeInput *shi, Render *re)
/* texture output */
- if( (rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
+ if ( (rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
rgbnor-= TEX_RGB;
}
- if(mtex->texflag & MTEX_NEGATIVE) {
- if(rgbnor & TEX_RGB) {
+ if (mtex->texflag & MTEX_NEGATIVE) {
+ if (rgbnor & TEX_RGB) {
texres.tr= 1.0f-texres.tr;
texres.tg= 1.0f-texres.tg;
texres.tb= 1.0f-texres.tb;
}
texres.tin= 1.0f-texres.tin;
}
- if(mtex->texflag & MTEX_STENCIL) {
- if(rgbnor & TEX_RGB) {
+ if (mtex->texflag & MTEX_STENCIL) {
+ if (rgbnor & TEX_RGB) {
fact= texres.ta;
texres.ta*= stencilTin;
stencilTin*= fact;
@@ -2377,10 +2383,10 @@ void do_material_tex(ShadeInput *shi, Render *re)
Tnor*= stencilTin;
}
- if(texres.nor) {
- if((rgbnor & TEX_NOR)==0) {
+ if (texres.nor) {
+ if ((rgbnor & TEX_NOR)==0) {
/* make our own normal */
- if(rgbnor & TEX_RGB) {
+ if (rgbnor & TEX_RGB) {
texres.nor[0]= texres.tr;
texres.nor[1]= texres.tg;
texres.nor[2]= texres.tb;
@@ -2400,10 +2406,10 @@ void do_material_tex(ShadeInput *shi, Render *re)
}
}
// warping, local space
- if(mtex->mapto & MAP_WARP) {
+ if (mtex->mapto & MAP_WARP) {
float *warpnor= texres.nor, warpnor_[3];
- if(use_ntap_bump) {
+ if (use_ntap_bump) {
copy_v3_v3(warpnor_, texres.nor);
warpnor= warpnor_;
normalize_v3(warpnor_);
@@ -2414,10 +2420,10 @@ void do_material_tex(ShadeInput *shi, Render *re)
warpdone= 1;
}
#if 0
- if(mtex->texflag & MTEX_VIEWSPACE) {
+ if (mtex->texflag & MTEX_VIEWSPACE) {
// rotate to global coords
- if(mtex->texco==TEXCO_ORCO || mtex->texco==TEXCO_UV) {
- if(shi->vlr && shi->obr && shi->obr->ob) {
+ if (mtex->texco==TEXCO_ORCO || mtex->texco==TEXCO_UV) {
+ if (shi->vlr && shi->obr && shi->obr->ob) {
float len= normalize_v3(texres.nor);
// can be optimized... (ton)
mul_mat3_m4_v3(shi->obr->ob->obmat, texres.nor);
@@ -2431,19 +2437,19 @@ void do_material_tex(ShadeInput *shi, Render *re)
}
/* mapping */
- if(mtex->mapto & (MAP_COL+MAP_COLSPEC+MAP_COLMIR)) {
+ if (mtex->mapto & (MAP_COL+MAP_COLSPEC+MAP_COLMIR)) {
float tcol[3];
/* stencil maps on the texture control slider, not texture intensity value */
tcol[0]=texres.tr; tcol[1]=texres.tg; tcol[2]=texres.tb;
- if((rgbnor & TEX_RGB)==0) {
+ if ((rgbnor & TEX_RGB)==0) {
tcol[0]= mtex->r;
tcol[1]= mtex->g;
tcol[2]= mtex->b;
}
- else if(mtex->mapto & MAP_ALPHA) {
+ else if (mtex->mapto & MAP_ALPHA) {
texres.tin= stencilTin;
}
else texres.tin= texres.ta;
@@ -2458,19 +2464,19 @@ void do_material_tex(ShadeInput *shi, Render *re)
srgb_to_linearrgb_v3_v3(tcol, tcol);
}
- if(mtex->mapto & MAP_COL) {
+ if (mtex->mapto & MAP_COL) {
float colfac= mtex->colfac*stencilTin;
texture_rgb_blend(&shi->r, tcol, &shi->r, texres.tin, colfac, mtex->blendtype);
}
- if(mtex->mapto & MAP_COLSPEC) {
+ if (mtex->mapto & MAP_COLSPEC) {
float colspecfac= mtex->colspecfac*stencilTin;
texture_rgb_blend(&shi->specr, tcol, &shi->specr, texres.tin, colspecfac, mtex->blendtype);
}
- if(mtex->mapto & MAP_COLMIR) {
+ if (mtex->mapto & MAP_COLMIR) {
float mirrfac= mtex->mirrfac*stencilTin;
// exception for envmap only
- if(tex->type==TEX_ENVMAP && mtex->blendtype==MTEX_BLEND) {
+ if (tex->type==TEX_ENVMAP && mtex->blendtype==MTEX_BLEND) {
fact= texres.tin*mirrfac;
facm= 1.0f- fact;
shi->refcol[0]= fact + facm*shi->refcol[0];
@@ -2483,8 +2489,8 @@ void do_material_tex(ShadeInput *shi, Render *re)
}
}
}
- if( (mtex->mapto & MAP_NORM) ) {
- if(texres.nor) {
+ if ( (mtex->mapto & MAP_NORM) ) {
+ if (texres.nor) {
float norfac= mtex->norfac;
/* we need to code blending modes for normals too once.. now 1 exception hardcoded */
@@ -2494,7 +2500,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];
@@ -2502,7 +2508,7 @@ void do_material_tex(ShadeInput *shi, Render *re)
fact = Tnor*fabsf(norfac);
if (fact>1.f) fact = 1.f;
facm = 1.f-fact;
- if(mtex->normapspace == MTEX_NSPACE_TANGENT) {
+ if (mtex->normapspace == MTEX_NSPACE_TANGENT) {
/* qdn: tangent space */
float B[3], tv[3];
const float * no = iFirstTimeNMap!=0 ? shi->nmapnorm : shi->vn;
@@ -2522,12 +2528,12 @@ void do_material_tex(ShadeInput *shi, Render *re)
copy_v3_v3(nor, texres.nor);
- if(mtex->normapspace == MTEX_NSPACE_CAMERA);
- else if(mtex->normapspace == MTEX_NSPACE_WORLD) {
+ if (mtex->normapspace == MTEX_NSPACE_CAMERA);
+ else if (mtex->normapspace == MTEX_NSPACE_WORLD) {
mul_mat3_m4_v3(re->viewmat, nor);
}
- else if(mtex->normapspace == MTEX_NSPACE_OBJECT) {
- if(shi->obr && shi->obr->ob)
+ else if (mtex->normapspace == MTEX_NSPACE_OBJECT) {
+ if (shi->obr && shi->obr->ob)
mul_mat3_m4_v3(shi->obr->ob->obmat, nor);
mul_mat3_m4_v3(re->viewmat, nor);
}
@@ -2550,7 +2556,7 @@ void do_material_tex(ShadeInput *shi, Render *re)
else {
float nor[3], dot;
- if(shi->mat->mode & MA_TANGENT_V) {
+ if (shi->mat->mode & MA_TANGENT_V) {
shi->tang[0]+= Tnor*norfac*texres.nor[0];
shi->tang[1]+= Tnor*norfac*texres.nor[1];
shi->tang[2]+= Tnor*norfac*texres.nor[2];
@@ -2577,10 +2583,10 @@ void do_material_tex(ShadeInput *shi, Render *re)
}
}
- if( mtex->mapto & MAP_DISPLACE ) {
+ if ( mtex->mapto & MAP_DISPLACE ) {
/* Now that most textures offer both Nor and Intensity, allow */
/* both to work, and let user select with slider. */
- if(texres.nor) {
+ if (texres.nor) {
float norfac= mtex->norfac;
shi->displace[0]+= 0.2f*Tnor*norfac*texres.nor[0];
@@ -2588,94 +2594,94 @@ void do_material_tex(ShadeInput *shi, Render *re)
shi->displace[2]+= 0.2f*Tnor*norfac*texres.nor[2];
}
- if(rgbnor & TEX_RGB) {
+ if (rgbnor & TEX_RGB) {
texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
}
factt= (0.5f-texres.tin)*mtex->dispfac*stencilTin; facmm= 1.0f-factt;
- if(mtex->blendtype==MTEX_BLEND) {
+ if (mtex->blendtype==MTEX_BLEND) {
shi->displace[0]= factt*shi->vn[0] + facmm*shi->displace[0];
shi->displace[1]= factt*shi->vn[1] + facmm*shi->displace[1];
shi->displace[2]= factt*shi->vn[2] + facmm*shi->displace[2];
}
- else if(mtex->blendtype==MTEX_MUL) {
+ else if (mtex->blendtype==MTEX_MUL) {
shi->displace[0]*= factt*shi->vn[0];
shi->displace[1]*= factt*shi->vn[1];
shi->displace[2]*= factt*shi->vn[2];
}
else { /* add or sub */
- if(mtex->blendtype==MTEX_SUB) factt= -factt;
+ if (mtex->blendtype==MTEX_SUB) factt= -factt;
shi->displace[0]+= factt*shi->vn[0];
shi->displace[1]+= factt*shi->vn[1];
shi->displace[2]+= factt*shi->vn[2];
}
}
- if(mtex->mapto & MAP_VARS) {
+ if (mtex->mapto & MAP_VARS) {
/* stencil maps on the texture control slider, not texture intensity value */
- if(rgbnor & TEX_RGB) {
- if(texres.talpha) texres.tin= texres.ta;
+ if (rgbnor & TEX_RGB) {
+ if (texres.talpha) texres.tin= texres.ta;
else texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
}
- if(mtex->mapto & MAP_REF) {
+ if (mtex->mapto & MAP_REF) {
float difffac= mtex->difffac*stencilTin;
shi->refl= texture_value_blend(mtex->def_var, shi->refl, texres.tin, difffac, mtex->blendtype);
- if(shi->refl<0.0f) shi->refl= 0.0f;
+ if (shi->refl<0.0f) shi->refl= 0.0f;
}
- if(mtex->mapto & MAP_SPEC) {
+ if (mtex->mapto & MAP_SPEC) {
float specfac= mtex->specfac*stencilTin;
shi->spec= texture_value_blend(mtex->def_var, shi->spec, texres.tin, specfac, mtex->blendtype);
- if(shi->spec<0.0f) shi->spec= 0.0f;
+ if (shi->spec<0.0f) shi->spec= 0.0f;
}
- if(mtex->mapto & MAP_EMIT) {
+ if (mtex->mapto & MAP_EMIT) {
float emitfac= mtex->emitfac*stencilTin;
shi->emit= texture_value_blend(mtex->def_var, shi->emit, texres.tin, emitfac, mtex->blendtype);
- if(shi->emit<0.0f) shi->emit= 0.0f;
+ if (shi->emit<0.0f) shi->emit= 0.0f;
}
- if(mtex->mapto & MAP_ALPHA) {
+ if (mtex->mapto & MAP_ALPHA) {
float alphafac= mtex->alphafac*stencilTin;
shi->alpha= texture_value_blend(mtex->def_var, shi->alpha, texres.tin, alphafac, mtex->blendtype);
- if(shi->alpha<0.0f) shi->alpha= 0.0f;
- else if(shi->alpha>1.0f) shi->alpha= 1.0f;
+ if (shi->alpha<0.0f) shi->alpha= 0.0f;
+ else if (shi->alpha>1.0f) shi->alpha= 1.0f;
}
- if(mtex->mapto & MAP_HAR) {
+ if (mtex->mapto & MAP_HAR) {
float har; // have to map to 0-1
float hardfac= mtex->hardfac*stencilTin;
har= ((float)shi->har)/128.0f;
har= 128.0f*texture_value_blend(mtex->def_var, har, texres.tin, hardfac, mtex->blendtype);
- if(har<1.0f) shi->har= 1;
- else if(har>511) shi->har= 511;
+ if (har<1.0f) shi->har= 1;
+ else if (har>511) shi->har= 511;
else shi->har= (int)har;
}
- if(mtex->mapto & MAP_RAYMIRR) {
+ if (mtex->mapto & MAP_RAYMIRR) {
float raymirrfac= mtex->raymirrfac*stencilTin;
shi->ray_mirror= texture_value_blend(mtex->def_var, shi->ray_mirror, texres.tin, raymirrfac, mtex->blendtype);
- if(shi->ray_mirror<0.0f) shi->ray_mirror= 0.0f;
- else if(shi->ray_mirror>1.0f) shi->ray_mirror= 1.0f;
+ if (shi->ray_mirror<0.0f) shi->ray_mirror= 0.0f;
+ else if (shi->ray_mirror>1.0f) shi->ray_mirror= 1.0f;
}
- if(mtex->mapto & MAP_TRANSLU) {
+ if (mtex->mapto & MAP_TRANSLU) {
float translfac= mtex->translfac*stencilTin;
shi->translucency= texture_value_blend(mtex->def_var, shi->translucency, texres.tin, translfac, mtex->blendtype);
- if(shi->translucency<0.0f) shi->translucency= 0.0f;
- else if(shi->translucency>1.0f) shi->translucency= 1.0f;
+ if (shi->translucency<0.0f) shi->translucency= 0.0f;
+ else if (shi->translucency>1.0f) shi->translucency= 1.0f;
}
- if(mtex->mapto & MAP_AMB) {
+ if (mtex->mapto & MAP_AMB) {
float ambfac= mtex->ambfac*stencilTin;
shi->amb= texture_value_blend(mtex->def_var, shi->amb, texres.tin, ambfac, mtex->blendtype);
- if(shi->amb<0.0f) shi->amb= 0.0f;
- else if(shi->amb>1.0f) shi->amb= 1.0f;
+ if (shi->amb<0.0f) shi->amb= 0.0f;
+ else if (shi->amb>1.0f) shi->amb= 1.0f;
shi->ambr= shi->amb*re->wrld.ambr;
shi->ambg= shi->amb*re->wrld.ambg;
@@ -2705,35 +2711,35 @@ void do_volume_tex(ShadeInput *shi, const float *xyz, int mapto_flag, float *col
if (re->r.scemode & R_NO_TEX) return;
/* here: test flag if there's a tex (todo) */
- for(tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
+ for (tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
/* separate tex switching */
- if(shi->mat->septex & (1<<tex_nr)) continue;
+ if (shi->mat->septex & (1<<tex_nr)) continue;
- if(shi->mat->mtex[tex_nr]) {
+ if (shi->mat->mtex[tex_nr]) {
mtex= shi->mat->mtex[tex_nr];
tex= mtex->tex;
- if(tex==0) continue;
+ if (tex==0) continue;
/* only process if this texture is mapped
* to one that we're interested in */
if (!(mtex->mapto & mapto_flag)) continue;
/* which coords */
- if(mtex->texco==TEXCO_OBJECT) {
+ if (mtex->texco==TEXCO_OBJECT) {
Object *ob= mtex->object;
- if(ob) {
+ if (ob) {
copy_v3_v3(co, xyz);
- if(mtex->texflag & MTEX_OB_DUPLI_ORIG) {
- if(shi->obi && shi->obi->duplitexmat)
+ if (mtex->texflag & MTEX_OB_DUPLI_ORIG) {
+ if (shi->obi && shi->obi->duplitexmat)
mul_m4_v3(shi->obi->duplitexmat, co);
}
mul_m4_v3(ob->imat_ren, co);
}
}
/* not really orco, but 'local' */
- else if(mtex->texco==TEXCO_ORCO) {
+ else if (mtex->texco==TEXCO_ORCO) {
- if(mtex->texflag & MTEX_DUPLI_MAPTO) {
+ if (mtex->texflag & MTEX_DUPLI_MAPTO) {
copy_v3_v3(co, shi->duplilo);
}
else {
@@ -2742,7 +2748,7 @@ void do_volume_tex(ShadeInput *shi, const float *xyz, int mapto_flag, float *col
mul_m4_v3(ob->imat_ren, co);
}
}
- else if(mtex->texco==TEXCO_GLOB) {
+ else if (mtex->texco==TEXCO_GLOB) {
copy_v3_v3(co, xyz);
mul_m4_v3(re->viewinv, co);
}
@@ -2750,19 +2756,19 @@ void do_volume_tex(ShadeInput *shi, const float *xyz, int mapto_flag, float *col
texres.nor= NULL;
- if(tex->type==TEX_IMAGE) {
+ if (tex->type==TEX_IMAGE) {
continue; /* not supported yet */
//do_2d_mapping(mtex, texvec, NULL, NULL, dxt, dyt);
}
else {
/* placement */
- if(mtex->projx) texvec[0]= mtex->size[0]*(co[mtex->projx-1]+mtex->ofs[0]);
+ if (mtex->projx) texvec[0]= mtex->size[0]*(co[mtex->projx-1]+mtex->ofs[0]);
else texvec[0]= mtex->size[0]*(mtex->ofs[0]);
- if(mtex->projy) texvec[1]= mtex->size[1]*(co[mtex->projy-1]+mtex->ofs[1]);
+ if (mtex->projy) texvec[1]= mtex->size[1]*(co[mtex->projy-1]+mtex->ofs[1]);
else texvec[1]= mtex->size[1]*(mtex->ofs[1]);
- if(mtex->projz) texvec[2]= mtex->size[2]*(co[mtex->projz-1]+mtex->ofs[2]);
+ if (mtex->projz) texvec[2]= mtex->size[2]*(co[mtex->projz-1]+mtex->ofs[2]);
else texvec[2]= mtex->size[2]*(mtex->ofs[2]);
}
@@ -2770,20 +2776,20 @@ void do_volume_tex(ShadeInput *shi, const float *xyz, int mapto_flag, float *col
/* texture output */
- if( (rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
+ if ( (rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
rgbnor-= TEX_RGB;
}
- if(mtex->texflag & MTEX_NEGATIVE) {
- if(rgbnor & TEX_RGB) {
+ if (mtex->texflag & MTEX_NEGATIVE) {
+ if (rgbnor & TEX_RGB) {
texres.tr= 1.0f-texres.tr;
texres.tg= 1.0f-texres.tg;
texres.tb= 1.0f-texres.tb;
}
texres.tin= 1.0f-texres.tin;
}
- if(mtex->texflag & MTEX_STENCIL) {
- if(rgbnor & TEX_RGB) {
+ if (mtex->texflag & MTEX_STENCIL) {
+ if (rgbnor & TEX_RGB) {
fact= texres.ta;
texres.ta*= stencilTin;
stencilTin*= fact;
@@ -2796,70 +2802,71 @@ void do_volume_tex(ShadeInput *shi, const float *xyz, int mapto_flag, float *col
}
- if((mapto_flag & (MAP_EMISSION_COL+MAP_TRANSMISSION_COL+MAP_REFLECTION_COL)) && (mtex->mapto & (MAP_EMISSION_COL+MAP_TRANSMISSION_COL+MAP_REFLECTION_COL))) {
+ if ((mapto_flag & (MAP_EMISSION_COL+MAP_TRANSMISSION_COL+MAP_REFLECTION_COL)) && (mtex->mapto & (MAP_EMISSION_COL+MAP_TRANSMISSION_COL+MAP_REFLECTION_COL))) {
float tcol[3];
/* stencil maps on the texture control slider, not texture intensity value */
- if((rgbnor & TEX_RGB)==0) {
+ if ((rgbnor & TEX_RGB)==0) {
tcol[0]= mtex->r;
tcol[1]= mtex->g;
tcol[2]= mtex->b;
- } else {
+ }
+ else {
tcol[0]=texres.tr;
tcol[1]=texres.tg;
tcol[2]=texres.tb;
- if(texres.talpha)
+ if (texres.talpha)
texres.tin= texres.ta;
}
/* used for emit */
- if((mapto_flag & MAP_EMISSION_COL) && (mtex->mapto & MAP_EMISSION_COL)) {
+ if ((mapto_flag & MAP_EMISSION_COL) && (mtex->mapto & MAP_EMISSION_COL)) {
float colemitfac= mtex->colemitfac*stencilTin;
texture_rgb_blend(col, tcol, col, texres.tin, colemitfac, mtex->blendtype);
}
- if((mapto_flag & MAP_REFLECTION_COL) && (mtex->mapto & MAP_REFLECTION_COL)) {
+ if ((mapto_flag & MAP_REFLECTION_COL) && (mtex->mapto & MAP_REFLECTION_COL)) {
float colreflfac= mtex->colreflfac*stencilTin;
texture_rgb_blend(col, tcol, col, texres.tin, colreflfac, mtex->blendtype);
}
- if((mapto_flag & MAP_TRANSMISSION_COL) && (mtex->mapto & MAP_TRANSMISSION_COL)) {
+ if ((mapto_flag & MAP_TRANSMISSION_COL) && (mtex->mapto & MAP_TRANSMISSION_COL)) {
float coltransfac= mtex->coltransfac*stencilTin;
texture_rgb_blend(col, tcol, col, texres.tin, coltransfac, mtex->blendtype);
}
}
- if((mapto_flag & MAP_VARS) && (mtex->mapto & MAP_VARS)) {
+ if ((mapto_flag & MAP_VARS) && (mtex->mapto & MAP_VARS)) {
/* stencil maps on the texture control slider, not texture intensity value */
/* convert RGB to intensity if intensity info isn't provided */
if (!(rgbnor & TEX_INT)) {
if (rgbnor & TEX_RGB) {
- if(texres.talpha) texres.tin= texres.ta;
+ if (texres.talpha) texres.tin= texres.ta;
else texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
}
}
- if((mapto_flag & MAP_EMISSION) && (mtex->mapto & MAP_EMISSION)) {
+ if ((mapto_flag & MAP_EMISSION) && (mtex->mapto & MAP_EMISSION)) {
float emitfac= mtex->emitfac*stencilTin;
*val = texture_value_blend(mtex->def_var, *val, texres.tin, emitfac, mtex->blendtype);
- if(*val<0.0f) *val= 0.0f;
+ if (*val<0.0f) *val= 0.0f;
}
- if((mapto_flag & MAP_DENSITY) && (mtex->mapto & MAP_DENSITY)) {
+ if ((mapto_flag & MAP_DENSITY) && (mtex->mapto & MAP_DENSITY)) {
float densfac= mtex->densfac*stencilTin;
*val = texture_value_blend(mtex->def_var, *val, texres.tin, densfac, mtex->blendtype);
CLAMP(*val, 0.0f, 1.0f);
}
- if((mapto_flag & MAP_SCATTERING) && (mtex->mapto & MAP_SCATTERING)) {
+ if ((mapto_flag & MAP_SCATTERING) && (mtex->mapto & MAP_SCATTERING)) {
float scatterfac= mtex->scatterfac*stencilTin;
*val = texture_value_blend(mtex->def_var, *val, texres.tin, scatterfac, mtex->blendtype);
CLAMP(*val, 0.0f, 1.0f);
}
- if((mapto_flag & MAP_REFLECTION) && (mtex->mapto & MAP_REFLECTION)) {
+ if ((mapto_flag & MAP_REFLECTION) && (mtex->mapto & MAP_REFLECTION)) {
float reflfac= mtex->reflfac*stencilTin;
*val = texture_value_blend(mtex->def_var, *val, texres.tin, reflfac, mtex->blendtype);
@@ -2883,8 +2890,8 @@ void do_halo_tex(HaloRen *har, float xn, float yn, float col_r[4])
if (R.r.scemode & R_NO_TEX) return;
mtex= har->mat->mtex[0];
- if(har->mat->septex & (1<<0)) return;
- if(mtex->tex==NULL) return;
+ if (har->mat->septex & (1<<0)) return;
+ if (mtex->tex==NULL) return;
/* no normal mapping */
texres.nor= NULL;
@@ -2896,32 +2903,32 @@ void do_halo_tex(HaloRen *har, float xn, float yn, float col_r[4])
osatex= (har->mat->texco & TEXCO_OSA);
/* placement */
- if(mtex->projx) texvec[0]= mtex->size[0]*(texvec[mtex->projx-1]+mtex->ofs[0]);
+ if (mtex->projx) texvec[0]= mtex->size[0]*(texvec[mtex->projx-1]+mtex->ofs[0]);
else texvec[0]= mtex->size[0]*(mtex->ofs[0]);
- if(mtex->projy) texvec[1]= mtex->size[1]*(texvec[mtex->projy-1]+mtex->ofs[1]);
+ if (mtex->projy) texvec[1]= mtex->size[1]*(texvec[mtex->projy-1]+mtex->ofs[1]);
else texvec[1]= mtex->size[1]*(mtex->ofs[1]);
- if(mtex->projz) texvec[2]= mtex->size[2]*(texvec[mtex->projz-1]+mtex->ofs[2]);
+ if (mtex->projz) texvec[2]= mtex->size[2]*(texvec[mtex->projz-1]+mtex->ofs[2]);
else texvec[2]= mtex->size[2]*(mtex->ofs[2]);
- if(osatex) {
+ if (osatex) {
dx= 1.0f/har->rad;
- if(mtex->projx) {
+ if (mtex->projx) {
dxt[0]= mtex->size[0]*dx;
dyt[0]= mtex->size[0]*dx;
}
else dxt[0]= dyt[0]= 0.0;
- if(mtex->projy) {
+ if (mtex->projy) {
dxt[1]= mtex->size[1]*dx;
dyt[1]= mtex->size[1]*dx;
}
else dxt[1]= dyt[1]= 0.0;
- if(mtex->projz) {
+ if (mtex->projz) {
dxt[2]= 0.0;
dyt[2]= 0.0;
}
@@ -2929,17 +2936,17 @@ void do_halo_tex(HaloRen *har, float xn, float yn, float col_r[4])
}
- if(mtex->tex->type==TEX_IMAGE) do_2d_mapping(mtex, texvec, NULL, NULL, dxt, dyt);
+ if (mtex->tex->type==TEX_IMAGE) do_2d_mapping(mtex, texvec, NULL, NULL, dxt, dyt);
rgb= multitex(mtex->tex, texvec, dxt, dyt, osatex, &texres, 0, mtex->which_output);
/* texture output */
- if(rgb && (mtex->texflag & MTEX_RGBTOINT)) {
+ if (rgb && (mtex->texflag & MTEX_RGBTOINT)) {
texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
rgb= 0;
}
- if(mtex->texflag & MTEX_NEGATIVE) {
- if(rgb) {
+ if (mtex->texflag & MTEX_NEGATIVE) {
+ if (rgb) {
texres.tr= 1.0f-texres.tr;
texres.tg= 1.0f-texres.tg;
texres.tb= 1.0f-texres.tb;
@@ -2948,14 +2955,14 @@ void do_halo_tex(HaloRen *har, float xn, float yn, float col_r[4])
}
/* mapping */
- if(mtex->mapto & MAP_COL) {
+ if (mtex->mapto & MAP_COL) {
- if(rgb==0) {
+ if (rgb==0) {
texres.tr= mtex->r;
texres.tg= mtex->g;
texres.tb= mtex->b;
}
- else if(mtex->mapto & MAP_ALPHA) {
+ else if (mtex->mapto & MAP_ALPHA) {
texres.tin= 1.0;
}
else texres.tin= texres.ta;
@@ -2973,18 +2980,18 @@ void do_halo_tex(HaloRen *har, float xn, float yn, float col_r[4])
fact= texres.tin*mtex->colfac;
facm= 1.0f-fact;
- if(mtex->blendtype==MTEX_MUL) {
+ if (mtex->blendtype==MTEX_MUL) {
facm= 1.0f-mtex->colfac;
}
- if(mtex->blendtype==MTEX_SUB) fact= -fact;
+ if (mtex->blendtype==MTEX_SUB) fact= -fact;
- if(mtex->blendtype==MTEX_BLEND) {
+ if (mtex->blendtype==MTEX_BLEND) {
col_r[0]= (fact*texres.tr + facm*har->r);
col_r[1]= (fact*texres.tg + facm*har->g);
col_r[2]= (fact*texres.tb + facm*har->b);
}
- else if(mtex->blendtype==MTEX_MUL) {
+ else if (mtex->blendtype==MTEX_MUL) {
col_r[0]= (facm+fact*texres.tr)*har->r;
col_r[1]= (facm+fact*texres.tg)*har->g;
col_r[2]= (facm+fact*texres.tb)*har->b;
@@ -2999,9 +3006,9 @@ void do_halo_tex(HaloRen *har, float xn, float yn, float col_r[4])
CLAMP(col_r[2], 0.0f, 1.0f);
}
}
- if(mtex->mapto & MAP_ALPHA) {
- if(rgb) {
- if(texres.talpha) texres.tin= texres.ta;
+ if (mtex->mapto & MAP_ALPHA) {
+ if (rgb) {
+ if (texres.talpha) texres.tin= texres.ta;
else texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
}
@@ -3025,19 +3032,19 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
/* todo: add flag to test if there's a tex */
texres.nor= NULL;
- for(tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
- if(R.wrld.mtex[tex_nr]) {
+ for (tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
+ if (R.wrld.mtex[tex_nr]) {
mtex= R.wrld.mtex[tex_nr];
tex= mtex->tex;
- if(tex==0) continue;
- /* if(mtex->mapto==0) continue; */
+ if (tex==0) continue;
+ /* if (mtex->mapto==0) continue; */
/* which coords */
co= lo;
/* dxt dyt just from 1 value */
- if(dxyview) {
+ if (dxyview) {
dxt[0]= dxt[1]= dxt[2]= dxyview[0];
dyt[0]= dyt[1]= dyt[2]= dxyview[1];
}
@@ -3051,7 +3058,7 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
case TEXCO_ANGMAP:
/* only works with texture being "real" */
/* use saacos(), fixes bug [#22398], float precision caused lo[2] to be slightly less then -1.0 */
- if(lo[0] || lo[1]) { /* check for zero case [#24807] */
+ if (lo[0] || lo[1]) { /* check for zero case [#24807] */
fact= (1.0f/(float)M_PI)*saacos(lo[2])/(sqrtf(lo[0]*lo[0] + lo[1]*lo[1]));
tempvec[0]= lo[0]*fact;
tempvec[1]= lo[1]*fact;
@@ -3069,8 +3076,8 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
case TEXCO_H_SPHEREMAP:
case TEXCO_H_TUBEMAP:
- if(skyflag & WO_ZENUP) {
- if(mtex->texco==TEXCO_H_TUBEMAP) map_to_tube( tempvec, tempvec+1,lo[0], lo[2], lo[1]);
+ if (skyflag & WO_ZENUP) {
+ if (mtex->texco==TEXCO_H_TUBEMAP) map_to_tube( tempvec, tempvec+1,lo[0], lo[2], lo[1]);
else map_to_sphere( tempvec, tempvec+1,lo[0], lo[2], lo[1]);
/* tube/spheremap maps for outside view, not inside */
tempvec[0]= 1.0f-tempvec[0];
@@ -3094,7 +3101,7 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
co= tempvec;
break;
case TEXCO_OBJECT:
- if(mtex->object) {
+ if (mtex->object) {
copy_v3_v3(tempvec, lo);
mul_m4_v3(mtex->object->imat_ren, tempvec);
co= tempvec;
@@ -3102,7 +3109,7 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
break;
case TEXCO_GLOB:
- if(rco) {
+ if (rco) {
copy_v3_v3(tempvec, rco);
mul_m4_v3(R.viewinv, tempvec);
co= tempvec;
@@ -3118,35 +3125,35 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
}
/* placement */
- if(mtex->projx) texvec[0]= mtex->size[0]*(co[mtex->projx-1]+mtex->ofs[0]);
+ if (mtex->projx) texvec[0]= mtex->size[0]*(co[mtex->projx-1]+mtex->ofs[0]);
else texvec[0]= mtex->size[0]*(mtex->ofs[0]);
- if(mtex->projy) texvec[1]= mtex->size[1]*(co[mtex->projy-1]+mtex->ofs[1]);
+ if (mtex->projy) texvec[1]= mtex->size[1]*(co[mtex->projy-1]+mtex->ofs[1]);
else texvec[1]= mtex->size[1]*(mtex->ofs[1]);
- if(mtex->projz) texvec[2]= mtex->size[2]*(co[mtex->projz-1]+mtex->ofs[2]);
+ if (mtex->projz) texvec[2]= mtex->size[2]*(co[mtex->projz-1]+mtex->ofs[2]);
else texvec[2]= mtex->size[2]*(mtex->ofs[2]);
/* texture */
- if(tex->type==TEX_IMAGE) do_2d_mapping(mtex, texvec, NULL, NULL, dxt, dyt);
+ if (tex->type==TEX_IMAGE) do_2d_mapping(mtex, texvec, NULL, NULL, dxt, dyt);
rgb= multitex(mtex->tex, texvec, dxt, dyt, R.osa, &texres, thread, mtex->which_output);
/* texture output */
- if(rgb && (mtex->texflag & MTEX_RGBTOINT)) {
+ if (rgb && (mtex->texflag & MTEX_RGBTOINT)) {
texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
rgb= 0;
}
- if(mtex->texflag & MTEX_NEGATIVE) {
- if(rgb) {
+ if (mtex->texflag & MTEX_NEGATIVE) {
+ if (rgb) {
texres.tr= 1.0f-texres.tr;
texres.tg= 1.0f-texres.tg;
texres.tb= 1.0f-texres.tb;
}
else texres.tin= 1.0f-texres.tin;
}
- if(mtex->texflag & MTEX_STENCIL) {
- if(rgb) {
+ if (mtex->texflag & MTEX_STENCIL) {
+ if (rgb) {
fact= texres.ta;
texres.ta*= stencilTin;
stencilTin*= fact;
@@ -3158,15 +3165,15 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
}
}
else {
- if(rgb) texres.ta *= stencilTin;
+ if (rgb) texres.ta *= stencilTin;
else texres.tin*= stencilTin;
}
/* color mapping */
- if(mtex->mapto & (WOMAP_HORIZ+WOMAP_ZENUP+WOMAP_ZENDOWN)) {
+ if (mtex->mapto & (WOMAP_HORIZ+WOMAP_ZENUP+WOMAP_ZENDOWN)) {
float tcol[3];
- if(rgb==0) {
+ if (rgb==0) {
texres.tr= mtex->r;
texres.tg= mtex->g;
texres.tb= mtex->b;
@@ -3185,29 +3192,29 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
srgb_to_linearrgb_v3_v3(tcol, tcol);
}
- if(mtex->mapto & WOMAP_HORIZ) {
+ if (mtex->mapto & WOMAP_HORIZ) {
texture_rgb_blend(hor, tcol, hor, texres.tin, mtex->colfac, mtex->blendtype);
}
- if(mtex->mapto & (WOMAP_ZENUP+WOMAP_ZENDOWN)) {
+ if (mtex->mapto & (WOMAP_ZENUP+WOMAP_ZENDOWN)) {
float zenfac = 0.0f;
- if(R.wrld.skytype & WO_SKYREAL) {
- if((skyflag & WO_ZENUP)) {
- if(mtex->mapto & WOMAP_ZENUP) zenfac= mtex->zenupfac;
+ if (R.wrld.skytype & WO_SKYREAL) {
+ if ((skyflag & WO_ZENUP)) {
+ if (mtex->mapto & WOMAP_ZENUP) zenfac= mtex->zenupfac;
}
- else if(mtex->mapto & WOMAP_ZENDOWN) zenfac= mtex->zendownfac;
+ else if (mtex->mapto & WOMAP_ZENDOWN) zenfac= mtex->zendownfac;
}
else {
- if(mtex->mapto & WOMAP_ZENUP) zenfac= mtex->zenupfac;
- else if(mtex->mapto & WOMAP_ZENDOWN) zenfac= mtex->zendownfac;
+ if (mtex->mapto & WOMAP_ZENUP) zenfac= mtex->zenupfac;
+ else if (mtex->mapto & WOMAP_ZENDOWN) zenfac= mtex->zendownfac;
}
- if(zenfac != 0.0f)
+ if (zenfac != 0.0f)
texture_rgb_blend(zen, tcol, zen, texres.tin, zenfac, mtex->blendtype);
}
}
- if(mtex->mapto & WOMAP_BLEND) {
- if(rgb) texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
+ if (mtex->mapto & WOMAP_BLEND) {
+ if (rgb) texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
*blend= texture_value_blend(mtex->def_var, *blend, texres.tin, mtex->blendfac, mtex->blendtype);
}
@@ -3231,25 +3238,25 @@ void do_lamp_tex(LampRen *la, const float lavec[3], ShadeInput *shi, float col_r
if (R.r.scemode & R_NO_TEX) return;
tex_nr= 0;
- for(; tex_nr<MAX_MTEX; tex_nr++) {
+ for (; tex_nr<MAX_MTEX; tex_nr++) {
- if(la->mtex[tex_nr]) {
+ if (la->mtex[tex_nr]) {
mtex= la->mtex[tex_nr];
tex= mtex->tex;
- if(tex==NULL) continue;
+ if (tex==NULL) continue;
texres.nor= NULL;
/* which coords */
- if(mtex->texco==TEXCO_OBJECT) {
+ if (mtex->texco==TEXCO_OBJECT) {
ob= mtex->object;
- if(ob) {
+ if (ob) {
co= tempvec;
dx= dxt;
dy= dyt;
copy_v3_v3(tempvec, shi->co);
mul_m4_v3(ob->imat_ren, tempvec);
- if(shi->osatex) {
+ if (shi->osatex) {
copy_v3_v3(dxt, shi->dxco);
copy_v3_v3(dyt, shi->dyco);
mul_mat3_m4_v3(ob->imat_ren, dxt);
@@ -3261,17 +3268,17 @@ void do_lamp_tex(LampRen *la, const float lavec[3], ShadeInput *shi, float col_r
dx= shi->dxco; dy= shi->dyco;
}
}
- else if(mtex->texco==TEXCO_GLOB) {
+ else if (mtex->texco==TEXCO_GLOB) {
co= shi->gl; dx= shi->dxco; dy= shi->dyco;
copy_v3_v3(shi->gl, shi->co);
mul_m4_v3(R.viewinv, shi->gl);
}
- else if(mtex->texco==TEXCO_VIEW) {
+ else if (mtex->texco==TEXCO_VIEW) {
copy_v3_v3(tempvec, lavec);
mul_m3_v3(la->imat, tempvec);
- if(la->type==LA_SPOT) {
+ if (la->type==LA_SPOT) {
tempvec[0]*= la->spottexfac;
tempvec[1]*= la->spottexfac;
/* project from 3d to 2d */
@@ -3281,7 +3288,7 @@ void do_lamp_tex(LampRen *la, const float lavec[3], ShadeInput *shi, float col_r
co= tempvec;
dx= dxt; dy= dyt;
- if(shi->osatex) {
+ if (shi->osatex) {
copy_v3_v3(dxt, shi->dxlv);
copy_v3_v3(dyt, shi->dylv);
/* need some matrix conversion here? la->imat is a [3][3] matrix!!! **/
@@ -3295,39 +3302,43 @@ void do_lamp_tex(LampRen *la, const float lavec[3], ShadeInput *shi, float col_r
/* placement */
- if(mtex->projx && co) texvec[0]= mtex->size[0]*(co[mtex->projx-1]+mtex->ofs[0]);
+ if (mtex->projx && co) texvec[0]= mtex->size[0]*(co[mtex->projx-1]+mtex->ofs[0]);
else texvec[0]= mtex->size[0]*(mtex->ofs[0]);
- if(mtex->projy && co) texvec[1]= mtex->size[1]*(co[mtex->projy-1]+mtex->ofs[1]);
+ if (mtex->projy && co) texvec[1]= mtex->size[1]*(co[mtex->projy-1]+mtex->ofs[1]);
else texvec[1]= mtex->size[1]*(mtex->ofs[1]);
- if(mtex->projz && co) texvec[2]= mtex->size[2]*(co[mtex->projz-1]+mtex->ofs[2]);
+ if (mtex->projz && co) texvec[2]= mtex->size[2]*(co[mtex->projz-1]+mtex->ofs[2]);
else texvec[2]= mtex->size[2]*(mtex->ofs[2]);
- if(shi->osatex) {
+ if (shi->osatex) {
if (!dx) {
- for(i=0;i<2;i++) {
+ for (i=0;i<2;i++) {
dxt[i] = dyt[i] = 0.0;
}
- } else {
- if(mtex->projx) {
+ }
+ else {
+ if (mtex->projx) {
dxt[0]= mtex->size[0]*dx[mtex->projx-1];
dyt[0]= mtex->size[0]*dy[mtex->projx-1];
- } else {
+ }
+ else {
dxt[0]= 0.0;
dyt[0]= 0.0;
}
- if(mtex->projy) {
+ if (mtex->projy) {
dxt[1]= mtex->size[1]*dx[mtex->projy-1];
dyt[1]= mtex->size[1]*dy[mtex->projy-1];
- } else {
+ }
+ else {
dxt[1]= 0.0;
dyt[1]= 0.0;
}
- if(mtex->projz) {
+ if (mtex->projz) {
dxt[2]= mtex->size[2]*dx[mtex->projz-1];
dyt[2]= mtex->size[2]*dy[mtex->projz-1];
- } else {
+ }
+ else {
dxt[2]= 0.0;
dyt[2]= 0.0;
}
@@ -3335,27 +3346,27 @@ void do_lamp_tex(LampRen *la, const float lavec[3], ShadeInput *shi, float col_r
}
/* texture */
- if(tex->type==TEX_IMAGE) {
+ if (tex->type==TEX_IMAGE) {
do_2d_mapping(mtex, texvec, NULL, NULL, dxt, dyt);
}
rgb= multitex(tex, texvec, dxt, dyt, shi->osatex, &texres, shi->thread, mtex->which_output);
/* texture output */
- if(rgb && (mtex->texflag & MTEX_RGBTOINT)) {
+ if (rgb && (mtex->texflag & MTEX_RGBTOINT)) {
texres.tin= (0.35f*texres.tr+0.45f*texres.tg+0.2f*texres.tb);
rgb= 0;
}
- if(mtex->texflag & MTEX_NEGATIVE) {
- if(rgb) {
+ if (mtex->texflag & MTEX_NEGATIVE) {
+ if (rgb) {
texres.tr= 1.0f-texres.tr;
texres.tg= 1.0f-texres.tg;
texres.tb= 1.0f-texres.tb;
}
else texres.tin= 1.0f-texres.tin;
}
- if(mtex->texflag & MTEX_STENCIL) {
- if(rgb) {
+ if (mtex->texflag & MTEX_STENCIL) {
+ if (rgb) {
fact= texres.ta;
texres.ta*= stencilTin;
stencilTin*= fact;
@@ -3367,20 +3378,20 @@ void do_lamp_tex(LampRen *la, const float lavec[3], ShadeInput *shi, float col_r
}
}
else {
- if(rgb) texres.ta*= stencilTin;
+ if (rgb) texres.ta*= stencilTin;
else texres.tin*= stencilTin;
}
/* mapping */
- if(((mtex->mapto & LAMAP_COL) && (effect & LA_TEXTURE))||((mtex->mapto & LAMAP_SHAD) && (effect & LA_SHAD_TEX))) {
+ if (((mtex->mapto & LAMAP_COL) && (effect & LA_TEXTURE))||((mtex->mapto & LAMAP_SHAD) && (effect & LA_SHAD_TEX))) {
float col[3];
- if(rgb==0) {
+ if (rgb==0) {
texres.tr= mtex->r;
texres.tg= mtex->g;
texres.tb= mtex->b;
}
- else if(mtex->mapto & MAP_ALPHA) {
+ else if (mtex->mapto & MAP_ALPHA) {
texres.tin= stencilTin;
}
else texres.tin= texres.ta;
@@ -3416,27 +3427,27 @@ int externtex(MTex *mtex, const float vec[3], float *tin, float *tr, float *tg,
int rgb;
tex= mtex->tex;
- if(tex==NULL) return 0;
+ if (tex==NULL) return 0;
texr.nor= NULL;
/* placement */
- if(mtex->projx) texvec[0]= mtex->size[0]*(vec[mtex->projx-1]+mtex->ofs[0]);
+ if (mtex->projx) texvec[0]= mtex->size[0]*(vec[mtex->projx-1]+mtex->ofs[0]);
else texvec[0]= mtex->size[0]*(mtex->ofs[0]);
- if(mtex->projy) texvec[1]= mtex->size[1]*(vec[mtex->projy-1]+mtex->ofs[1]);
+ if (mtex->projy) texvec[1]= mtex->size[1]*(vec[mtex->projy-1]+mtex->ofs[1]);
else texvec[1]= mtex->size[1]*(mtex->ofs[1]);
- if(mtex->projz) texvec[2]= mtex->size[2]*(vec[mtex->projz-1]+mtex->ofs[2]);
+ if (mtex->projz) texvec[2]= mtex->size[2]*(vec[mtex->projz-1]+mtex->ofs[2]);
else texvec[2]= mtex->size[2]*(mtex->ofs[2]);
/* texture */
- if(tex->type==TEX_IMAGE) {
+ if (tex->type==TEX_IMAGE) {
do_2d_mapping(mtex, texvec, NULL, NULL, dxt, dyt);
}
rgb= multitex(tex, texvec, dxt, dyt, 0, &texr, thread, mtex->which_output);
- if(rgb) {
+ if (rgb) {
texr.tin= (0.35f*texr.tr+0.45f*texr.tg+0.2f*texr.tb);
}
else {
@@ -3467,12 +3478,12 @@ void render_realtime_texture(ShadeInput *shi, Image *ima)
ShadeInputUV *suv= &shi->uv[shi->actuv];
int a;
- if(R.r.scemode & R_NO_TEX) return;
+ if (R.r.scemode & R_NO_TEX) return;
- if(firsttime) {
+ if (firsttime) {
BLI_lock_thread(LOCK_IMAGE);
- if(firsttime) {
- for(a=0; a<BLENDER_MAX_THREADS; a++) {
+ if (firsttime) {
+ for (a=0; a<BLENDER_MAX_THREADS; a++) {
memset(&imatex[a], 0, sizeof(Tex));
default_tex(&imatex[a]);
imatex[a].type= TEX_IMAGE;
@@ -3489,7 +3500,7 @@ void render_realtime_texture(ShadeInput *shi, Image *ima)
texvec[0]= 0.5f+0.5f*suv->uv[0];
texvec[1]= 0.5f+0.5f*suv->uv[1];
texvec[2] = 0.0f; // initalize it because imagewrap looks at it.
- if(shi->osatex) {
+ if (shi->osatex) {
dx[0]= 0.5f*suv->dxuv[0];
dx[1]= 0.5f*suv->dxuv[1];
dy[0]= 0.5f*suv->dyuv[0];
@@ -3498,7 +3509,7 @@ void render_realtime_texture(ShadeInput *shi, Image *ima)
texr.nor= NULL;
- if(shi->osatex) imagewraposa(tex, ima, NULL, texvec, dx, dy, &texr);
+ if (shi->osatex) imagewraposa(tex, ima, NULL, texvec, dx, dy, &texr);
else imagewrap(tex, ima, NULL, texvec, &texr);
shi->vcol[0]*= texr.tr;
@@ -3508,7 +3519,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)
{
@@ -3550,12 +3561,14 @@ Material *RE_init_sample_material(Material *orig_mat, Scene *scene)
BKE_animsys_evaluate_animdata(scene, &mat->id, mat->adt, BKE_curframe(scene), ADT_RECALC_ANIM);
/* strip material copy from unsupported flags */
- for(tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
- if(mat->septex & (1<<tex_nr)) continue;
+ for (tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
+ if (mat->septex & (1<<tex_nr)) continue;
- if(mat->mtex[tex_nr]) {
+ if (mat->mtex[tex_nr]) {
MTex *mtex = mat->mtex[tex_nr];
+ if (!mtex->tex) continue;
+
/* only keep compatible texflags */
mtex->texflag = mtex->texflag & (MTEX_RGBTOINT | MTEX_STENCIL | MTEX_NEGATIVE | MTEX_ALPHAMIX);
@@ -3580,9 +3593,9 @@ Material *RE_init_sample_material(Material *orig_mat, Scene *scene)
}
/* if mapped to an object, calculate inverse matrices */
- if(mtex->texco==TEXCO_OBJECT) {
+ if (mtex->texco==TEXCO_OBJECT) {
Object *ob= mtex->object;
- if(ob) {
+ if (ob) {
invert_m4_m4(ob->imat, ob->obmat);
copy_m4_m4(ob->imat_ren, ob->imat);
}
@@ -3595,10 +3608,10 @@ Material *RE_init_sample_material(Material *orig_mat, Scene *scene)
BKE_animsys_evaluate_animdata(scene, &tex->id, tex->adt, BKE_curframe(scene), ADT_RECALC_ANIM);
/* update texture cache if required */
- if(tex->type==TEX_VOXELDATA) {
+ if (tex->type==TEX_VOXELDATA) {
cache_voxeldata(tex, (int)scene->r.cfra);
}
- if(tex->type==TEX_POINTDENSITY) {
+ if (tex->type==TEX_POINTDENSITY) {
/* set dummy values for render and do cache */
Render dummy_re = {0};
dummy_re.scene = scene;
@@ -3610,8 +3623,8 @@ Material *RE_init_sample_material(Material *orig_mat, Scene *scene)
}
/* update image sequences and movies */
- if(tex->ima && ELEM(tex->ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
- if(tex->iuser.flag & IMA_ANIM_ALWAYS)
+ if (tex->ima && ELEM(tex->ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
+ if (tex->iuser.flag & IMA_ANIM_ALWAYS)
BKE_image_user_calc_frame(&tex->iuser, (int)scene->r.cfra, 0);
}
}
@@ -3625,13 +3638,16 @@ void RE_free_sample_material(Material *mat)
int tex_nr;
/* free textures */
- for(tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
- if(mat->septex & (1<<tex_nr)) continue;
- if(mat->mtex[tex_nr]) {
+ for (tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
+ if (mat->septex & (1<<tex_nr)) continue;
+ if (mat->mtex[tex_nr]) {
MTex *mtex= mat->mtex[tex_nr];
- free_texture(mtex->tex);
- MEM_freeN(mtex->tex);
- mtex->tex = NULL;
+
+ if (mtex->tex) {
+ free_texture(mtex->tex);
+ MEM_freeN(mtex->tex);
+ mtex->tex = NULL;
+ }
}
}
@@ -3642,15 +3658,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;
@@ -3698,7 +3714,7 @@ void RE_sample_material_color(Material *mat, float color[3], float *alpha, const
/* for every uv map set coords and name */
for (i=0; i<layers; i++) {
- if(layer_index >= 0) {
+ if (layer_index >= 0) {
float *uv1, *uv2, *uv3;
float l;
CustomData *data = &orcoDm->faceData;
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 2d3837acbfa..f5e36125299 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -97,12 +97,12 @@ void calc_view_vector(float *view, float x, float y)
view[2]= -ABS(R.clipsta);
- if(R.r.mode & R_ORTHO) {
+ if (R.r.mode & R_ORTHO) {
view[0]= view[1]= 0.0f;
}
else {
- if(R.r.mode & R_PANORAMA) {
+ if (R.r.mode & R_PANORAMA) {
x-= R.panodxp;
}
@@ -113,13 +113,13 @@ void calc_view_vector(float *view, float x, float y)
y= (y/(float)R.winy);
view[1]= R.viewplane.ymin + y*(R.viewplane.ymax - R.viewplane.ymin);
-// if(R.flag & R_SEC_FIELD) {
-// if(R.r.mode & R_ODDFIELD) view[1]= (y+R.ystart)*R.ycor;
+// if (R.flag & R_SEC_FIELD) {
+// if (R.r.mode & R_ODDFIELD) view[1]= (y+R.ystart)*R.ycor;
// else view[1]= (y+R.ystart+1.0)*R.ycor;
// }
// else view[1]= (y+R.ystart+R.bluroffsy+0.5)*R.ycor;
- if(R.r.mode & R_PANORAMA) {
+ if (R.r.mode & R_PANORAMA) {
float u= view[0] + R.panodxv; float v= view[2];
view[0]= R.panoco*u + R.panosi*v;
view[2]= -R.panosi*u + R.panoco*v;
@@ -157,7 +157,7 @@ void calc_renderco_zbuf(float co[3], const float view[3], int z)
/* also used in zbuf.c and shadbuf.c */
int count_mask(unsigned short mask)
{
- if(R.samples)
+ if (R.samples)
return (R.samples->cmask[mask & 255]+R.samples->cmask[mask>>8]);
return 0;
}
@@ -165,8 +165,8 @@ int count_mask(unsigned short mask)
static int calchalo_z(HaloRen *har, int zz)
{
- if(har->type & HA_ONLYSKY) {
- if(zz < 0x7FFFFFF0) zz= - 0x7FFFFF; /* edge render messes zvalues */
+ if (har->type & HA_ONLYSKY) {
+ if (zz < 0x7FFFFFF0) zz= - 0x7FFFFF; /* edge render messes zvalues */
}
else {
zz= (zz>>8);
@@ -186,18 +186,18 @@ static void halo_pixelstruct(HaloRen *har, RenderLayer **rlpp, int totsample, in
accol[0]=accol[1]=accol[2]=accol[3]= 0.0f;
flarec= har->flarec;
- while(ps) {
+ while (ps) {
amountm= count_mask(ps->mask);
amount+= amountm;
zz= calchalo_z(har, ps->z);
- if((zz> har->zs) || (har->mat && (har->mat->mode & MA_HALO_SOFT))) {
- if(shadeHaloFloat(har, col, zz, dist, xn, yn, flarec)) {
+ if ((zz> har->zs) || (har->mat && (har->mat->mode & MA_HALO_SOFT))) {
+ if (shadeHaloFloat(har, col, zz, dist, xn, yn, flarec)) {
flarec= 0;
- if(fullsample) {
- for(sample=0; sample<totsample; sample++)
- if(ps->mask & (1 << sample))
+ if (fullsample) {
+ for (sample=0; sample<totsample; sample++)
+ if (ps->mask & (1 << sample))
addalphaAddfacFloat(rlpp[sample]->rectf + od*4, col, har->add);
}
else {
@@ -216,9 +216,9 @@ static void halo_pixelstruct(HaloRen *har, RenderLayer **rlpp, int totsample, in
/* now do the sky sub-pixels */
amount= R.osa-amount;
- if(amount) {
- if(shadeHaloFloat(har, col, 0x7FFFFF, dist, xn, yn, flarec)) {
- if(!fullsample) {
+ if (amount) {
+ if (shadeHaloFloat(har, col, 0x7FFFFF, dist, xn, yn, flarec)) {
+ if (!fullsample) {
fac= ((float)amount)/(float)R.osa;
accol[0]+= fac*col[0];
accol[1]+= fac*col[1];
@@ -228,9 +228,9 @@ static void halo_pixelstruct(HaloRen *har, RenderLayer **rlpp, int totsample, in
}
}
- if(fullsample) {
- for(sample=0; sample<totsample; sample++)
- if(!(mask & (1 << sample)))
+ if (fullsample) {
+ for (sample=0; sample<totsample; sample++)
+ if (!(mask & (1 << sample)))
addalphaAddfacFloat(rlpp[sample]->rectf + od*4, col, har->add);
}
else {
@@ -239,7 +239,7 @@ static void halo_pixelstruct(HaloRen *har, RenderLayer **rlpp, int totsample, in
col[2]= accol[2];
col[3]= accol[3];
- for(sample=0; sample<totsample; sample++)
+ for (sample=0; sample<totsample; sample++)
addalphaAddfacFloat(rlpp[sample]->rectf + od*4, col, har->add);
}
}
@@ -257,7 +257,7 @@ static void halo_tile(RenderPart *pa, RenderLayer *rl)
unsigned int lay= rl->lay;
/* we don't render halos in the cropped area, gives errors in flare counter */
- if(pa->crop) {
+ if (pa->crop) {
testrect.xmin+= pa->crop;
testrect.xmax-= pa->crop;
testrect.ymin+= pa->crop;
@@ -266,20 +266,20 @@ static void halo_tile(RenderPart *pa, RenderLayer *rl)
totsample= get_sample_layers(pa, rl, rlpp);
- for(a=0; a<R.tothalo; a++) {
+ for (a=0; a<R.tothalo; a++) {
har= R.sortedhalos[a];
/* layer test, clip halo with y */
- if((har->lay & lay)==0);
- else if(testrect.ymin > har->maxy);
- else if(testrect.ymax < har->miny);
+ if ((har->lay & lay)==0);
+ else if (testrect.ymin > har->maxy);
+ else if (testrect.ymax < har->miny);
else {
minx= floor(har->xs-har->rad);
maxx= ceil(har->xs+har->rad);
- if(testrect.xmin > maxx);
- else if(testrect.xmax < minx);
+ if (testrect.xmin > maxx);
+ else if (testrect.xmax < minx);
else {
minx= MAX2(minx, testrect.xmin);
@@ -288,41 +288,41 @@ static void halo_tile(RenderPart *pa, RenderLayer *rl)
miny= MAX2(har->miny, testrect.ymin);
maxy= MIN2(har->maxy, testrect.ymax);
- for(y=miny; y<maxy; y++) {
+ for (y=miny; y<maxy; y++) {
int rectofs= (y-disprect.ymin)*pa->rectx + (minx - disprect.xmin);
rz= pa->rectz + rectofs;
od= rectofs;
- if(pa->rectdaps)
+ if (pa->rectdaps)
rd= pa->rectdaps + rectofs;
yn= (y-har->ys)*R.ycor;
ysq= yn*yn;
- for(x=minx; x<maxx; x++, rz++, od++) {
+ for (x=minx; x<maxx; x++, rz++, od++) {
xn= x- har->xs;
xsq= xn*xn;
dist= xsq+ysq;
- if(dist<har->radsq) {
- if(rd && *rd) {
+ if (dist<har->radsq) {
+ if (rd && *rd) {
halo_pixelstruct(har, rlpp, totsample, od, dist, xn, yn, (PixStr *)*rd);
}
else {
zz= calchalo_z(har, *rz);
- if((zz> har->zs) || (har->mat && (har->mat->mode & MA_HALO_SOFT))) {
- if(shadeHaloFloat(har, col, zz, dist, xn, yn, har->flarec)) {
- for(sample=0; sample<totsample; sample++)
+ if ((zz> har->zs) || (har->mat && (har->mat->mode & MA_HALO_SOFT))) {
+ if (shadeHaloFloat(har, col, zz, dist, xn, yn, har->flarec)) {
+ for (sample=0; sample<totsample; sample++)
addalphaAddfacFloat(rlpp[sample]->rectf + od*4, col, har->add);
}
}
}
}
- if(rd) rd++;
+ if (rd) rd++;
}
}
}
}
- if(R.test_break(R.tbh) ) break;
+ if (R.test_break(R.tbh) ) break;
}
}
@@ -341,17 +341,17 @@ static void lamphalo_tile(RenderPart *pa, RenderLayer *rl)
shade_input_initialize(&shi, pa, rl, 0); /* this zero's ShadeInput for us */
- for(od=0, y=pa->disprect.ymin; y<pa->disprect.ymax; y++) {
- for(x=pa->disprect.xmin; x<pa->disprect.xmax; x++, rz++, od++) {
+ for (od=0, y=pa->disprect.ymin; y<pa->disprect.ymax; y++) {
+ for (x=pa->disprect.xmin; x<pa->disprect.xmax; x++, rz++, od++) {
calc_view_vector(shi.view, x, y);
- if(rd && *rd) {
+ if (rd && *rd) {
PixStr *ps= (PixStr *)*rd;
int count, totsamp= 0, mask= 0;
- while(ps) {
- if(R.r.mode & R_ORTHO)
+ while (ps) {
+ if (R.r.mode & R_ORTHO)
calc_renderco_ortho(shi.co, (float)x, (float)y, ps->z);
else
calc_renderco_zbuf(shi.co, shi.view, ps->z);
@@ -362,15 +362,15 @@ static void lamphalo_tile(RenderPart *pa, RenderLayer *rl)
col[0]= col[1]= col[2]= col[3]= 0.0f;
renderspothalo(&shi, col, 1.0f);
- if(fullsample) {
- for(sample=0; sample<totsample; sample++) {
- if(ps->mask & (1 << sample)) {
+ if (fullsample) {
+ for (sample=0; sample<totsample; sample++) {
+ if (ps->mask & (1 << sample)) {
pass= rlpp[sample]->rectf + od*4;
pass[0]+= col[0];
pass[1]+= col[1];
pass[2]+= col[2];
pass[3]+= col[3];
- if(pass[3]>1.0f) pass[3]= 1.0f;
+ if (pass[3]>1.0f) pass[3]= 1.0f;
}
}
}
@@ -381,27 +381,27 @@ static void lamphalo_tile(RenderPart *pa, RenderLayer *rl)
pass[1]+= fac*col[1];
pass[2]+= fac*col[2];
pass[3]+= fac*col[3];
- if(pass[3]>1.0f) pass[3]= 1.0f;
+ if (pass[3]>1.0f) pass[3]= 1.0f;
}
ps= ps->next;
}
- if(totsamp<R.osa) {
+ if (totsamp<R.osa) {
shi.co[2]= 0.0f;
col[0]= col[1]= col[2]= col[3]= 0.0f;
renderspothalo(&shi, col, 1.0f);
- if(fullsample) {
- for(sample=0; sample<totsample; sample++) {
- if(!(mask & (1 << sample))) {
+ if (fullsample) {
+ for (sample=0; sample<totsample; sample++) {
+ if (!(mask & (1 << sample))) {
pass= rlpp[sample]->rectf + od*4;
pass[0]+= col[0];
pass[1]+= col[1];
pass[2]+= col[2];
pass[3]+= col[3];
- if(pass[3]>1.0f) pass[3]= 1.0f;
+ if (pass[3]>1.0f) pass[3]= 1.0f;
}
}
}
@@ -412,12 +412,12 @@ static void lamphalo_tile(RenderPart *pa, RenderLayer *rl)
pass[1]+= fac*col[1];
pass[2]+= fac*col[2];
pass[3]+= fac*col[3];
- if(pass[3]>1.0f) pass[3]= 1.0f;
+ if (pass[3]>1.0f) pass[3]= 1.0f;
}
}
}
else {
- if(R.r.mode & R_ORTHO)
+ if (R.r.mode & R_ORTHO)
calc_renderco_ortho(shi.co, (float)x, (float)y, *rz);
else
calc_renderco_zbuf(shi.co, shi.view, *rz);
@@ -425,20 +425,20 @@ static void lamphalo_tile(RenderPart *pa, RenderLayer *rl)
col[0]= col[1]= col[2]= col[3]= 0.0f;
renderspothalo(&shi, col, 1.0f);
- for(sample=0; sample<totsample; sample++) {
+ for (sample=0; sample<totsample; sample++) {
pass= rlpp[sample]->rectf + od*4;
pass[0]+= col[0];
pass[1]+= col[1];
pass[2]+= col[2];
pass[3]+= col[3];
- if(pass[3]>1.0f) pass[3]= 1.0f;
+ if (pass[3]>1.0f) pass[3]= 1.0f;
}
}
- if(rd) rd++;
+ if (rd) rd++;
}
- if(y&1)
- if(R.test_break(R.tbh)) break;
+ if (y&1)
+ if (R.test_break(R.tbh)) break;
}
}
@@ -453,7 +453,7 @@ static void add_filt_passes(RenderLayer *rl, int curmask, int rectx, int offset,
/* combined rgb */
add_filt_fmask(curmask, shr->combined, rl->rectf + 4*offset, rectx);
- for(rpass= rl->passes.first; rpass; rpass= rpass->next) {
+ for (rpass= rl->passes.first; rpass; rpass= rpass->next) {
float *fp, *col= NULL;
int pixsize= 3;
@@ -498,7 +498,7 @@ static void add_filt_passes(RenderLayer *rl, int curmask, int rectx, int offset,
break;
case SCE_PASS_UV:
/* box filter only, gauss will screwup UV too much */
- if(shi->totuv) {
+ if (shi->totuv) {
float mult= (float)count_mask(curmask)/(float)R.osa;
fp= rpass->rect + 3*offset;
fp[0]+= mult*(0.5f + 0.5f*shi->uv[shi->actuv].uv[0]);
@@ -508,17 +508,17 @@ static void add_filt_passes(RenderLayer *rl, int curmask, int rectx, int offset,
break;
case SCE_PASS_INDEXOB:
/* no filter */
- if(shi->vlr) {
+ if (shi->vlr) {
fp= rpass->rect + offset;
- if(*fp==0.0f)
+ if (*fp==0.0f)
*fp= (float)shi->obr->ob->index;
}
break;
case SCE_PASS_INDEXMA:
/* no filter */
- if(shi->vlr) {
+ if (shi->vlr) {
fp= rpass->rect + offset;
- if(*fp==0.0f)
+ if (*fp==0.0f)
*fp= (float)shi->mat->index;
}
break;
@@ -532,11 +532,11 @@ static void add_filt_passes(RenderLayer *rl, int curmask, int rectx, int offset,
{
/* add minimum speed in pixel, no filter */
fp= rpass->rect + 4*offset;
- if( (ABS(shr->winspeed[0]) + ABS(shr->winspeed[1]))< (ABS(fp[0]) + ABS(fp[1])) ) {
+ if ( (ABS(shr->winspeed[0]) + ABS(shr->winspeed[1]))< (ABS(fp[0]) + ABS(fp[1])) ) {
fp[0]= shr->winspeed[0];
fp[1]= shr->winspeed[1];
}
- if( (ABS(shr->winspeed[2]) + ABS(shr->winspeed[3]))< (ABS(fp[2]) + ABS(fp[3])) ) {
+ if ( (ABS(shr->winspeed[2]) + ABS(shr->winspeed[3]))< (ABS(fp[2]) + ABS(fp[3])) ) {
fp[2]= shr->winspeed[2];
fp[3]= shr->winspeed[3];
}
@@ -549,7 +549,7 @@ static void add_filt_passes(RenderLayer *rl, int curmask, int rectx, int offset,
pixsize= 4;
break;
}
- if(col) {
+ if (col) {
fp= rpass->rect + pixsize*offset;
add_filt_fmask_pixsize(curmask, col, fp, rectx, pixsize);
}
@@ -565,7 +565,7 @@ static void add_passes(RenderLayer *rl, int offset, ShadeInput *shi, ShadeResult
fp= rl->rectf + 4*offset;
copy_v4_v4(fp, shr->combined);
- for(rpass= rl->passes.first; rpass; rpass= rpass->next) {
+ for (rpass= rl->passes.first; rpass; rpass= rpass->next) {
float *col= NULL, uvcol[3];
int a, pixsize= 3;
@@ -609,7 +609,7 @@ static void add_passes(RenderLayer *rl, int offset, ShadeInput *shi, ShadeResult
col= shr->nor;
break;
case SCE_PASS_UV:
- if(shi->totuv) {
+ if (shi->totuv) {
uvcol[0]= 0.5f + 0.5f*shi->uv[shi->actuv].uv[0];
uvcol[1]= 0.5f + 0.5f*shi->uv[shi->actuv].uv[1];
uvcol[2]= 1.0f;
@@ -621,13 +621,13 @@ static void add_passes(RenderLayer *rl, int offset, ShadeInput *shi, ShadeResult
pixsize= 4;
break;
case SCE_PASS_INDEXOB:
- if(shi->vlr) {
+ if (shi->vlr) {
fp= rpass->rect + offset;
*fp= (float)shi->obr->ob->index;
}
break;
case SCE_PASS_INDEXMA:
- if(shi->vlr) {
+ if (shi->vlr) {
fp= rpass->rect + offset;
*fp= (float)shi->mat->index;
}
@@ -641,9 +641,9 @@ static void add_passes(RenderLayer *rl, int offset, ShadeInput *shi, ShadeResult
pixsize= 4;
break;
}
- if(col) {
+ if (col) {
fp= rpass->rect + pixsize*offset;
- for(a=0; a<pixsize; a++)
+ for (a=0; a<pixsize; a++)
fp[a]= col[a];
}
}
@@ -652,10 +652,10 @@ static void add_passes(RenderLayer *rl, int offset, ShadeInput *shi, ShadeResult
int get_sample_layers(RenderPart *pa, RenderLayer *rl, RenderLayer **rlpp)
{
- if(pa->fullresult.first) {
+ if (pa->fullresult.first) {
int sample, nr= BLI_findindex(&pa->result->layers, rl);
- for(sample=0; sample<R.osa; sample++) {
+ for (sample=0; sample<R.osa; sample++) {
RenderResult *rr= BLI_findlink(&pa->fullresult, sample);
rlpp[sample]= BLI_findlink(&rr->layers, nr);
@@ -675,27 +675,27 @@ static void sky_tile(RenderPart *pa, RenderLayer *rl)
RenderLayer *rlpp[RE_MAX_OSA];
int x, y, od=0, totsample;
- if(R.r.alphamode!=R_ADDSKY)
+ if (R.r.alphamode!=R_ADDSKY)
return;
totsample= get_sample_layers(pa, rl, rlpp);
- for(y=pa->disprect.ymin; y<pa->disprect.ymax; y++) {
- for(x=pa->disprect.xmin; x<pa->disprect.xmax; x++, od+=4) {
+ for (y=pa->disprect.ymin; y<pa->disprect.ymax; y++) {
+ for (x=pa->disprect.xmin; x<pa->disprect.xmax; x++, od+=4) {
float col[4];
int sample, done= 0;
- for(sample= 0; sample<totsample; sample++) {
+ for (sample= 0; sample<totsample; sample++) {
float *pass= rlpp[sample]->rectf + od;
- if(pass[3]<1.0f) {
+ if (pass[3]<1.0f) {
- if(done==0) {
+ if (done==0) {
shadeSkyPixel(col, x, y, pa->thread);
done= 1;
}
- if(pass[3]==0.0f) {
+ if (pass[3]==0.0f) {
copy_v4_v4(pass, col);
}
else {
@@ -705,8 +705,8 @@ static void sky_tile(RenderPart *pa, RenderLayer *rl)
}
}
- if(y&1)
- if(R.test_break(R.tbh)) break;
+ if (y&1)
+ if (R.test_break(R.tbh)) break;
}
}
@@ -722,67 +722,67 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl)
totsample= get_sample_layers(pa, rl, rlpp);
/* check that z pass is enabled */
- if(pa->rectz==NULL) return;
- for(zpass= rl->passes.first; zpass; zpass= zpass->next)
- if(zpass->passtype==SCE_PASS_Z)
+ if (pa->rectz==NULL) return;
+ for (zpass= rl->passes.first; zpass; zpass= zpass->next)
+ if (zpass->passtype==SCE_PASS_Z)
break;
- if(zpass==NULL) return;
+ if (zpass==NULL) return;
/* check for at least one sun lamp that its atmosphere flag is enabled */
- for(go=R.lights.first; go; go= go->next) {
+ for (go=R.lights.first; go; go= go->next) {
lar= go->lampren;
- if(lar->type==LA_SUN && lar->sunsky && (lar->sunsky->effect_type & LA_SUN_EFFECT_AP))
+ if (lar->type==LA_SUN && lar->sunsky && (lar->sunsky->effect_type & LA_SUN_EFFECT_AP))
break;
}
/* do nothign and return if there is no sun lamp */
- if(go==NULL)
+ if (go==NULL)
return;
/* for each x,y and each sample, and each sun lamp*/
- for(y=pa->disprect.ymin; y<pa->disprect.ymax; y++) {
- for(x=pa->disprect.xmin; x<pa->disprect.xmax; x++, od++) {
+ for (y=pa->disprect.ymin; y<pa->disprect.ymax; y++) {
+ for (x=pa->disprect.xmin; x<pa->disprect.xmax; x++, od++) {
int sample;
- for(sample=0; sample<totsample; sample++) {
+ for (sample=0; sample<totsample; sample++) {
float *zrect= RE_RenderLayerGetPass(rlpp[sample], SCE_PASS_Z) + od;
float *rgbrect = rlpp[sample]->rectf + 4*od;
float rgb[3] = {0};
int done= 0;
- for(go=R.lights.first; go; go= go->next) {
+ for (go=R.lights.first; go; go= go->next) {
lar= go->lampren;
- if(lar->type==LA_SUN && lar->sunsky) {
+ if (lar->type==LA_SUN && lar->sunsky) {
/* if it's sky continue and don't apply atmosphere effect on it */
- if(*zrect >= 9.9e10f || rgbrect[3]==0.0f) {
+ if (*zrect >= 9.9e10f || rgbrect[3]==0.0f) {
continue;
}
- if((lar->sunsky->effect_type & LA_SUN_EFFECT_AP)) {
+ if ((lar->sunsky->effect_type & LA_SUN_EFFECT_AP)) {
float tmp_rgb[3];
/* skip if worldspace lamp vector is below horizon */
- if(go->ob->obmat[2][2] < 0.f) {
+ if (go->ob->obmat[2][2] < 0.f) {
continue;
}
copy_v3_v3(tmp_rgb, rgbrect);
- if(rgbrect[3]!=1.0f) { /* de-premul */
+ if (rgbrect[3]!=1.0f) { /* de-premul */
mul_v3_fl(tmp_rgb, 1.0f/rgbrect[3]);
}
shadeAtmPixel(lar->sunsky, tmp_rgb, x, y, *zrect);
- if(rgbrect[3]!=1.0f) { /* premul */
+ if (rgbrect[3]!=1.0f) { /* premul */
mul_v3_fl(tmp_rgb, rgbrect[3]);
}
- if(done==0) {
+ if (done==0) {
copy_v3_v3(rgb, tmp_rgb);
done = 1;
}
- else{
+ else {
rgb[0] = 0.5f*rgb[0] + 0.5f*tmp_rgb[0];
rgb[1] = 0.5f*rgb[1] + 0.5f*tmp_rgb[1];
rgb[2] = 0.5f*rgb[2] + 0.5f*tmp_rgb[2];
@@ -792,7 +792,7 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl)
}
/* if at least for one sun lamp aerial perspective was applied*/
- if(done) {
+ if (done) {
copy_v3_v3(rgbrect, rgb);
}
}
@@ -808,10 +808,10 @@ static void shadeDA_tile(RenderPart *pa, RenderLayer *rl)
int samp;
int x, y, seed, crop=0, offs=0, od;
- if(R.test_break(R.tbh)) return;
+ if (R.test_break(R.tbh)) return;
/* irregular shadowb buffer creation */
- if(R.r.mode & R_SHADOW)
+ if (R.r.mode & R_SHADOW)
ISB_create(pa, NULL);
/* we set per pixel a fixed seed, for random AO and shadow samples */
@@ -821,45 +821,45 @@ static void shadeDA_tile(RenderPart *pa, RenderLayer *rl)
shade_sample_initialize(&ssamp, pa, rl);
/* occlusion caching */
- if(R.occlusiontree)
+ if (R.occlusiontree)
cache_occ_samples(&R, pa, &ssamp);
/* filtered render, for now we assume only 1 filter size */
- if(pa->crop) {
+ if (pa->crop) {
crop= 1;
rectdaps+= pa->rectx + 1;
offs= pa->rectx + 1;
}
/* scanline updates have to be 2 lines behind */
- rr->renrect.ymin= 0;
- rr->renrect.ymax= -2*crop;
+ rr->renrect.ymin = 0;
+ rr->renrect.ymax = -2*crop;
rr->renlay= rl;
- for(y=pa->disprect.ymin+crop; y<pa->disprect.ymax-crop; y++, rr->renrect.ymax++) {
+ for (y=pa->disprect.ymin+crop; y<pa->disprect.ymax-crop; y++, rr->renrect.ymax++) {
rd= rectdaps;
od= offs;
- for(x=pa->disprect.xmin+crop; x<pa->disprect.xmax-crop; x++, rd++, od++) {
+ for (x=pa->disprect.xmin+crop; x<pa->disprect.xmax-crop; x++, rd++, od++) {
BLI_thread_srandom(pa->thread, seed++);
- if(*rd) {
- if(shade_samples(&ssamp, (PixStr *)(*rd), x, y)) {
+ if (*rd) {
+ if (shade_samples(&ssamp, (PixStr *)(*rd), x, y)) {
/* multisample buffers or filtered mask filling? */
- if(pa->fullresult.first) {
+ if (pa->fullresult.first) {
int a;
- for(samp=0; samp<ssamp.tot; samp++) {
+ for (samp=0; samp<ssamp.tot; samp++) {
int smask= ssamp.shi[samp].mask;
- for(a=0; a<R.osa; a++) {
+ for (a=0; a<R.osa; a++) {
int mask= 1<<a;
- if(smask & mask)
+ if (smask & mask)
add_passes(ssamp.rlpp[a], od, &ssamp.shi[samp], &ssamp.shr[samp]);
}
}
}
else {
- for(samp=0; samp<ssamp.tot; samp++)
+ for (samp=0; samp<ssamp.tot; samp++)
add_filt_passes(rl, ssamp.shi[samp].mask, pa->rectx, od, &ssamp.shi[samp], &ssamp.shr[samp]);
}
}
@@ -869,16 +869,16 @@ static void shadeDA_tile(RenderPart *pa, RenderLayer *rl)
rectdaps+= pa->rectx;
offs+= pa->rectx;
- if(y&1) if(R.test_break(R.tbh)) break;
+ if (y&1) if (R.test_break(R.tbh)) break;
}
/* disable scanline updating */
rr->renlay= NULL;
- if(R.r.mode & R_SHADOW)
+ if (R.r.mode & R_SHADOW)
ISB_free(pa);
- if(R.occlusiontree)
+ if (R.occlusiontree)
free_occ_samples(&R, pa);
}
@@ -902,9 +902,9 @@ static void freeps(ListBase *lb)
{
PixStrMain *psm, *psmnext;
- for(psm= lb->first; psm; psm= psmnext) {
+ for (psm= lb->first; psm; psm= psmnext) {
psmnext= psm->next;
- if(psm->ps)
+ if (psm->ps)
MEM_freeN(psm->ps);
MEM_freeN(psm);
}
@@ -916,11 +916,11 @@ static void addps(ListBase *lb, intptr_t *rd, int obi, int facenr, int z, int ma
PixStrMain *psm;
PixStr *ps, *last= NULL;
- if(*rd) {
+ if (*rd) {
ps= (PixStr *)(*rd);
- while(ps) {
- if( ps->obi == obi && ps->facenr == facenr ) {
+ while (ps) {
+ if ( ps->obi == obi && ps->facenr == facenr ) {
ps->mask |= mask;
return;
}
@@ -932,12 +932,12 @@ static void addps(ListBase *lb, intptr_t *rd, int obi, int facenr, int z, int ma
/* make new PS (pixel struct) */
psm= lb->last;
- if(psm->counter==4095)
+ if (psm->counter==4095)
psm= addpsmain(lb);
ps= psm->ps + psm->counter++;
- if(last) last->next= ps;
+ if (last) last->next= ps;
else *rd= (intptr_t)ps;
ps->next= NULL;
@@ -954,11 +954,11 @@ static void edge_enhance_add(RenderPart *pa, float *rectf, float *arect)
float addcol[4];
int pix;
- if(arect==NULL)
+ if (arect==NULL)
return;
- for(pix= pa->rectx*pa->recty; pix>0; pix--, arect++, rectf+=4) {
- if(*arect != 0.0f) {
+ for (pix= pa->rectx*pa->recty; pix>0; pix--, arect++, rectf+=4) {
+ if (*arect != 0.0f) {
addcol[0]= *arect * R.r.edgeR;
addcol[1]= *arect * R.r.edgeG;
addcol[2]= *arect * R.r.edgeB;
@@ -975,12 +975,12 @@ static void convert_to_key_alpha(RenderPart *pa, RenderLayer *rl)
totsample= get_sample_layers(pa, rl, rlpp);
- for(sample= 0; sample<totsample; sample++) {
+ for (sample= 0; sample<totsample; sample++) {
float *rectf= rlpp[sample]->rectf;
- for(y= pa->rectx*pa->recty; y>0; y--, rectf+=4) {
- if(rectf[3] >= 1.0f);
- else if(rectf[3] > 0.0f) {
+ for (y= pa->rectx*pa->recty; y>0; y--, rectf+=4) {
+ if (rectf[3] >= 1.0f);
+ else if (rectf[3] > 0.0f) {
rectf[0] /= rectf[3];
rectf[1] /= rectf[3];
rectf[2] /= rectf[3];
@@ -999,10 +999,10 @@ static void edge_enhance_tile(RenderPart *pa, float *rectf, int *rectz)
/* shift values in zbuffer 4 to the right (anti overflows), for filter we need multiplying with 12 max */
rz= rectz;
- if(rz==NULL) return;
+ if (rz==NULL) return;
- for(y=0; y<pa->recty; y++)
- for(x=0; x<pa->rectx; x++, rz++) (*rz)>>= 4;
+ for (y=0; y<pa->recty; y++)
+ for (x=0; x<pa->rectx; x++, rz++) (*rz)>>= 4;
rz1= rectz;
rz2= rz1+pa->rectx;
@@ -1010,8 +1010,8 @@ static void edge_enhance_tile(RenderPart *pa, float *rectf, int *rectz)
rf= rectf+pa->rectx+1;
- for(y=0; y<pa->recty-2; y++) {
- for(x=0; x<pa->rectx-2; x++, rz1++, rz2++, rz3++, rf++) {
+ for (y=0; y<pa->recty-2; y++) {
+ for (x=0; x<pa->rectx-2; x++, rz1++, rz2++, rz3++, rf++) {
/* prevent overflow with sky z values */
zval1= rz1[0] + 2*rz1[1] + rz1[2];
@@ -1019,19 +1019,19 @@ static void edge_enhance_tile(RenderPart *pa, float *rectf, int *rectz)
zval3= rz3[0] + 2*rz3[1] + rz3[2];
col= ( 4*rz2[1] - (zval1 + zval2 + zval3)/3 );
- if(col<0) col= -col;
+ if (col<0) col= -col;
col >>= 5;
- if(col > (1<<16)) col= (1<<16);
+ if (col > (1<<16)) col= (1<<16);
else col= (R.r.edgeint*col)>>8;
- if(col>0) {
+ if (col>0) {
float fcol;
- if(col>255) fcol= 1.0f;
+ if (col>255) fcol= 1.0f;
else fcol= (float)col/255.0f;
- if(R.osa)
+ if (R.osa)
*rf+= fcol/(float)R.osa;
else
*rf= fcol;
@@ -1045,8 +1045,8 @@ static void edge_enhance_tile(RenderPart *pa, float *rectf, int *rectz)
/* shift back zbuf values, we might need it still */
rz= rectz;
- for(y=0; y<pa->recty; y++)
- for(x=0; x<pa->rectx; x++, rz++) (*rz)<<= 4;
+ for (y=0; y<pa->recty; y++)
+ for (x=0; x<pa->rectx; x++, rz++) (*rz)<<= 4;
}
@@ -1059,12 +1059,12 @@ static void reset_sky_speed(RenderPart *pa, RenderLayer *rl)
totsample= get_sample_layers(pa, rl, rlpp);
- for(sample= 0; sample<totsample; sample++) {
+ for (sample= 0; sample<totsample; sample++) {
fp= RE_RenderLayerGetPass(rlpp[sample], SCE_PASS_VECTOR);
- if(fp==NULL) break;
+ if (fp==NULL) break;
- for(a= 4*pa->rectx*pa->recty - 1; a>=0; a--)
- if(fp[a] == PASS_VECTOR_MAX) fp[a]= 0.0f;
+ for (a= 4*pa->rectx*pa->recty - 1; a>=0; a--)
+ if (fp[a] == PASS_VECTOR_MAX) fp[a]= 0.0f;
}
}
@@ -1074,16 +1074,16 @@ static unsigned short *make_solid_mask(RenderPart *pa)
unsigned short *solidmask, *sp;
int x;
- if(rd==NULL) return NULL;
+ if (rd==NULL) return NULL;
sp=solidmask= MEM_mallocN(sizeof(short)*pa->rectx*pa->recty, "solidmask");
- for(x=pa->rectx*pa->recty; x>0; x--, rd++, sp++) {
- if(*rd) {
+ for (x=pa->rectx*pa->recty; x>0; x--, rd++, sp++) {
+ if (*rd) {
PixStr *ps= (PixStr *)*rd;
*sp= ps->mask;
- for(ps= ps->next; ps; ps= ps->next)
+ for (ps= ps->next; ps; ps= ps->next)
*sp |= ps->mask;
}
else
@@ -1098,10 +1098,10 @@ static void addAlphaOverFloatMask(float *dest, float *source, unsigned short dma
unsigned short shared= dmask & smask;
float mul= 1.0f - source[3];
- if(shared) { /* overlapping masks */
+ if (shared) { /* overlapping masks */
/* masks differ, we make a mixture of 'add' and 'over' */
- if(shared!=dmask) {
+ if (shared!=dmask) {
float shared_bits= (float)count_mask(shared); /* alpha over */
float tot_bits= (float)count_mask(smask|dmask); /* alpha add */
@@ -1109,7 +1109,7 @@ static void addAlphaOverFloatMask(float *dest, float *source, unsigned short dma
mul= add + (1.0f-add)*mul;
}
}
- else if(dmask && smask) {
+ else if (dmask && smask) {
/* works for premul only, of course */
dest[0]+= source[0];
dest[1]+= source[1];
@@ -1143,16 +1143,16 @@ static void make_pixelstructs(RenderPart *pa, ZSpan *zspan, int sample, void *da
int x, y;
int mask= 1<<sample;
- for(y=0; y<pa->recty; y++) {
- for(x=0; x<pa->rectx; x++, rd++, rp++, ro++, rz++, rm++) {
- if(*rp) {
+ for (y=0; y<pa->recty; y++) {
+ for (x=0; x<pa->rectx; x++, rd++, rp++, ro++, rz++, rm++) {
+ if (*rp) {
addps(lb, rd, *ro, *rp, *rz, (zspan->rectmask)? *rm: 0, mask);
}
}
}
- if(sdata->rl->layflag & SCE_LAY_EDGE)
- if(R.r.mode & R_EDGE)
+ if (sdata->rl->layflag & SCE_LAY_EDGE)
+ if (R.r.mode & R_EDGE)
edge_enhance_tile(pa, sdata->edgerect, zspan->rectz);
}
@@ -1170,47 +1170,47 @@ void zbufshadeDA_tile(RenderPart *pa)
pa->recto= MEM_mallocN(sizeof(int)*pa->rectx*pa->recty, "recto");
pa->rectp= MEM_mallocN(sizeof(int)*pa->rectx*pa->recty, "rectp");
pa->rectz= MEM_mallocN(sizeof(int)*pa->rectx*pa->recty, "rectz");
- for(rl= rr->layers.first; rl; rl= rl->next) {
- if((rl->layflag & SCE_LAY_ZMASK) && (rl->layflag & SCE_LAY_NEG_ZMASK))
+ for (rl= rr->layers.first; rl; rl= rl->next) {
+ if ((rl->layflag & SCE_LAY_ZMASK) && (rl->layflag & SCE_LAY_NEG_ZMASK))
pa->rectmask= MEM_mallocN(sizeof(int)*pa->rectx*pa->recty, "rectmask");
/* initialize pixelstructs and edge buffer */
addpsmain(&psmlist);
pa->rectdaps= MEM_callocN(sizeof(intptr_t)*pa->rectx*pa->recty+4, "zbufDArectd");
- if(rl->layflag & SCE_LAY_EDGE)
- if(R.r.mode & R_EDGE)
+ if (rl->layflag & SCE_LAY_EDGE)
+ if (R.r.mode & R_EDGE)
edgerect= MEM_callocN(sizeof(float)*pa->rectx*pa->recty, "rectedge");
/* always fill visibility */
- for(pa->sample=0; pa->sample<R.osa; pa->sample+=4) {
+ for (pa->sample=0; pa->sample<R.osa; pa->sample+=4) {
ZbufSolidData sdata;
sdata.rl= rl;
sdata.psmlist= &psmlist;
sdata.edgerect= edgerect;
zbuffer_solid(pa, rl, make_pixelstructs, &sdata);
- if(R.test_break(R.tbh)) break;
+ if (R.test_break(R.tbh)) break;
}
/* shades solid */
- if(rl->layflag & SCE_LAY_SOLID)
+ if (rl->layflag & SCE_LAY_SOLID)
shadeDA_tile(pa, rl);
/* lamphalo after solid, before ztra, looks nicest because ztra does own halo */
- if(R.flag & R_LAMPHALO)
- if(rl->layflag & SCE_LAY_HALO)
+ if (R.flag & R_LAMPHALO)
+ if (rl->layflag & SCE_LAY_HALO)
lamphalo_tile(pa, rl);
/* halo before ztra, because ztra fills in zbuffer now */
- if(R.flag & R_HALO)
- if(rl->layflag & SCE_LAY_HALO)
+ if (R.flag & R_HALO)
+ if (rl->layflag & SCE_LAY_HALO)
halo_tile(pa, rl);
/* transp layer */
- if(R.flag & R_ZTRA || R.totstrand) {
- if(rl->layflag & (SCE_LAY_ZTRA|SCE_LAY_STRAND)) {
- if(pa->fullresult.first) {
+ if (R.flag & R_ZTRA || R.totstrand) {
+ if (rl->layflag & (SCE_LAY_ZTRA|SCE_LAY_STRAND)) {
+ if (pa->fullresult.first) {
zbuffer_transp_shade(pa, rl, rl->rectf, &psmlist);
}
else {
@@ -1225,17 +1225,17 @@ void zbufshadeDA_tile(RenderPart *pa)
SWAP(float *, rl->acolrect, rl->rectf);
/* zbuffer transp only returns ztramask if there's solid rendered */
- if(ztramask)
+ if (ztramask)
solidmask= make_solid_mask(pa);
- if(ztramask && solidmask) {
+ if (ztramask && solidmask) {
unsigned short *sps= solidmask, *spz= ztramask;
unsigned short fullmask= (1<<R.osa)-1;
float *fcol= rl->rectf; float *acol= rl->acolrect;
int x;
- for(x=pa->rectx*pa->recty; x>0; x--, acol+=4, fcol+=4, sps++, spz++) {
- if(*sps == fullmask)
+ for (x=pa->rectx*pa->recty; x>0; x--, acol+=4, fcol+=4, sps++, spz++) {
+ if (*sps == fullmask)
addAlphaOverFloat(fcol, acol);
else
addAlphaOverFloatMask(fcol, acol, *sps, *spz);
@@ -1244,44 +1244,44 @@ void zbufshadeDA_tile(RenderPart *pa)
else {
float *fcol= rl->rectf; float *acol= rl->acolrect;
int x;
- for(x=pa->rectx*pa->recty; x>0; x--, acol+=4, fcol+=4) {
+ for (x=pa->rectx*pa->recty; x>0; x--, acol+=4, fcol+=4) {
addAlphaOverFloat(fcol, acol);
}
}
- if(solidmask) MEM_freeN(solidmask);
- if(ztramask) MEM_freeN(ztramask);
+ if (solidmask) MEM_freeN(solidmask);
+ if (ztramask) MEM_freeN(ztramask);
}
}
}
/* sun/sky */
- if(rl->layflag & SCE_LAY_SKY)
+ if (rl->layflag & SCE_LAY_SKY)
atm_tile(pa, rl);
/* sky before edge */
- if(rl->layflag & SCE_LAY_SKY)
+ if (rl->layflag & SCE_LAY_SKY)
sky_tile(pa, rl);
/* extra layers */
- if(rl->layflag & SCE_LAY_EDGE)
- if(R.r.mode & R_EDGE)
+ if (rl->layflag & SCE_LAY_EDGE)
+ if (R.r.mode & R_EDGE)
edge_enhance_add(pa, rl->rectf, edgerect);
- if(rl->passflag & SCE_PASS_VECTOR)
+ if (rl->passflag & SCE_PASS_VECTOR)
reset_sky_speed(pa, rl);
/* de-premul alpha */
- if(R.r.alphamode & R_ALPHAKEY)
+ if (R.r.alphamode & R_ALPHAKEY)
convert_to_key_alpha(pa, rl);
/* free stuff within loop! */
MEM_freeN(pa->rectdaps); pa->rectdaps= NULL;
freeps(&psmlist);
- if(edgerect) MEM_freeN(edgerect);
+ if (edgerect) MEM_freeN(edgerect);
edgerect= NULL;
- if(pa->rectmask) {
+ if (pa->rectmask) {
MEM_freeN(pa->rectmask);
pa->rectmask= NULL;
}
@@ -1293,7 +1293,7 @@ void zbufshadeDA_tile(RenderPart *pa)
MEM_freeN(pa->rectz); pa->rectz= NULL;
/* display active layer */
- rr->renrect.ymin=rr->renrect.ymax= 0;
+ rr->renrect.ymin=rr->renrect.ymax = 0;
rr->renlay= render_get_active_layer(&R, rr);
}
@@ -1319,8 +1319,8 @@ void zbufshade_tile(RenderPart *pa)
pa->rectp= MEM_mallocN(sizeof(int)*pa->rectx*pa->recty, "rectp");
pa->rectz= MEM_mallocN(sizeof(int)*pa->rectx*pa->recty, "rectz");
- for(rl= rr->layers.first; rl; rl= rl->next) {
- if((rl->layflag & SCE_LAY_ZMASK) && (rl->layflag & SCE_LAY_NEG_ZMASK))
+ for (rl= rr->layers.first; rl; rl= rl->next) {
+ if ((rl->layflag & SCE_LAY_ZMASK) && (rl->layflag & SCE_LAY_NEG_ZMASK))
pa->rectmask= MEM_mallocN(sizeof(int)*pa->rectx*pa->recty, "rectmask");
/* general shader info, passes */
@@ -1328,21 +1328,21 @@ void zbufshade_tile(RenderPart *pa)
zbuffer_solid(pa, rl, NULL, NULL);
- if(!R.test_break(R.tbh)) { /* NOTE: this if() is not consistent */
+ if (!R.test_break(R.tbh)) { /* NOTE: this if () is not consistent */
/* edges only for solid part, ztransp doesn't support it yet anti-aliased */
- if(rl->layflag & SCE_LAY_EDGE) {
- if(R.r.mode & R_EDGE) {
+ if (rl->layflag & SCE_LAY_EDGE) {
+ if (R.r.mode & R_EDGE) {
edgerect= MEM_callocN(sizeof(float)*pa->rectx*pa->recty, "rectedge");
edge_enhance_tile(pa, edgerect, pa->rectz);
}
}
/* initialize scanline updates for main thread */
- rr->renrect.ymin= 0;
+ rr->renrect.ymin = 0;
rr->renlay= rl;
- if(rl->layflag & SCE_LAY_SOLID) {
+ if (rl->layflag & SCE_LAY_SOLID) {
float *fcol= rl->rectf;
int *ro= pa->recto, *rp= pa->rectp, *rz= pa->rectz;
int x, y, offs=0, seed;
@@ -1351,35 +1351,35 @@ void zbufshade_tile(RenderPart *pa)
seed= pa->rectx*pa->disprect.ymin;
/* irregular shadowb buffer creation */
- if(R.r.mode & R_SHADOW)
+ if (R.r.mode & R_SHADOW)
ISB_create(pa, NULL);
- if(R.occlusiontree)
+ if (R.occlusiontree)
cache_occ_samples(&R, pa, &ssamp);
- for(y=pa->disprect.ymin; y<pa->disprect.ymax; y++, rr->renrect.ymax++) {
- for(x=pa->disprect.xmin; x<pa->disprect.xmax; x++, ro++, rz++, rp++, fcol+=4, offs++) {
+ for (y=pa->disprect.ymin; y<pa->disprect.ymax; y++, rr->renrect.ymax++) {
+ for (x=pa->disprect.xmin; x<pa->disprect.xmax; x++, ro++, rz++, rp++, fcol+=4, offs++) {
/* per pixel fixed seed */
BLI_thread_srandom(pa->thread, seed++);
- if(*rp) {
+ if (*rp) {
ps.obi= *ro;
ps.facenr= *rp;
ps.z= *rz;
- if(shade_samples(&ssamp, &ps, x, y)) {
+ if (shade_samples(&ssamp, &ps, x, y)) {
/* combined and passes */
add_passes(rl, offs, ssamp.shi, ssamp.shr);
}
}
}
- if(y&1)
- if(R.test_break(R.tbh)) break;
+ if (y&1)
+ if (R.test_break(R.tbh)) break;
}
- if(R.occlusiontree)
+ if (R.occlusiontree)
free_occ_samples(&R, pa);
- if(R.r.mode & R_SHADOW)
+ if (R.r.mode & R_SHADOW)
ISB_free(pa);
}
@@ -1388,17 +1388,17 @@ void zbufshade_tile(RenderPart *pa)
}
/* lamphalo after solid, before ztra, looks nicest because ztra does own halo */
- if(R.flag & R_LAMPHALO)
- if(rl->layflag & SCE_LAY_HALO)
+ if (R.flag & R_LAMPHALO)
+ if (rl->layflag & SCE_LAY_HALO)
lamphalo_tile(pa, rl);
/* halo before ztra, because ztra fills in zbuffer now */
- if(R.flag & R_HALO)
- if(rl->layflag & SCE_LAY_HALO)
+ if (R.flag & R_HALO)
+ if (rl->layflag & SCE_LAY_HALO)
halo_tile(pa, rl);
- if(R.flag & R_ZTRA || R.totstrand) {
- if(rl->layflag & (SCE_LAY_ZTRA|SCE_LAY_STRAND)) {
+ if (R.flag & R_ZTRA || R.totstrand) {
+ if (rl->layflag & (SCE_LAY_ZTRA|SCE_LAY_STRAND)) {
float *fcol, *acol;
int x;
@@ -1411,44 +1411,44 @@ void zbufshade_tile(RenderPart *pa)
SWAP(float *, rl->acolrect, rl->rectf);
fcol= rl->rectf; acol= rl->acolrect;
- for(x=pa->rectx*pa->recty; x>0; x--, acol+=4, fcol+=4) {
+ for (x=pa->rectx*pa->recty; x>0; x--, acol+=4, fcol+=4) {
addAlphaOverFloat(fcol, acol);
}
}
}
/* sun/sky */
- if(rl->layflag & SCE_LAY_SKY)
+ if (rl->layflag & SCE_LAY_SKY)
atm_tile(pa, rl);
/* sky before edge */
- if(rl->layflag & SCE_LAY_SKY)
+ if (rl->layflag & SCE_LAY_SKY)
sky_tile(pa, rl);
- if(!R.test_break(R.tbh)) {
- if(rl->layflag & SCE_LAY_EDGE)
- if(R.r.mode & R_EDGE)
+ if (!R.test_break(R.tbh)) {
+ if (rl->layflag & SCE_LAY_EDGE)
+ if (R.r.mode & R_EDGE)
edge_enhance_add(pa, rl->rectf, edgerect);
}
- if(rl->passflag & SCE_PASS_VECTOR)
+ if (rl->passflag & SCE_PASS_VECTOR)
reset_sky_speed(pa, rl);
/* de-premul alpha */
- if(R.r.alphamode & R_ALPHAKEY)
+ if (R.r.alphamode & R_ALPHAKEY)
convert_to_key_alpha(pa, rl);
- if(edgerect) MEM_freeN(edgerect);
+ if (edgerect) MEM_freeN(edgerect);
edgerect= NULL;
- if(pa->rectmask) {
+ if (pa->rectmask) {
MEM_freeN(pa->rectmask);
pa->rectmask= NULL;
}
}
/* display active layer */
- rr->renrect.ymin=rr->renrect.ymax= 0;
+ rr->renrect.ymin=rr->renrect.ymax = 0;
rr->renlay= render_get_active_layer(&R, rr);
MEM_freeN(pa->recto); pa->recto= NULL;
@@ -1469,38 +1469,38 @@ 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 */
- if(x<pa->crop || x>=pa->rectx-pa->crop)
+ * don't use those */
+ if (x<pa->crop || x>=pa->rectx-pa->crop)
return;
- if(y<pa->crop || y>=pa->recty-pa->crop)
+ if (y<pa->crop || y>=pa->recty-pa->crop)
return;
- if(pa->rectall) {
+ if (pa->rectall) {
intptr_t *rs= pa->rectall + pa->rectx*y + x;
addps(&handle->psmlist, rs, obi, facenr, z, 0, 0);
handle->totps++;
}
- if(pa->rectz) {
+ if (pa->rectz) {
int *rz= pa->rectz + pa->rectx*y + x;
int *rp= pa->rectp + pa->rectx*y + x;
int *ro= pa->recto + pa->rectx*y + x;
- if(z < *rz) {
- if(*rp == 0)
+ if (z < *rz) {
+ if (*rp == 0)
handle->totps++;
*rz= z;
*rp= facenr;
*ro= obi;
}
}
- if(pa->rectbackz) {
+ if (pa->rectbackz) {
int *rz= pa->rectbackz + pa->rectx*y + x;
int *rp= pa->rectbackp + pa->rectx*y + x;
int *ro= pa->rectbacko + pa->rectx*y + x;
- if(z >= *rz) {
- if(*rp == 0)
+ if (z >= *rz) {
+ if (*rp == 0)
handle->totps++;
*rz= z;
*rp= facenr;
@@ -1518,7 +1518,7 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
/* cache for shadow */
shi->samplenr= R.shadowsamplenr[shi->thread]++;
- if(quad)
+ if (quad)
shade_input_set_triangle_i(shi, obi, vlr, 0, 2, 3);
else
shade_input_set_triangle_i(shi, obi, vlr, 0, 1, 2);
@@ -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);
@@ -1548,19 +1548,19 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
shade_input_set_normals(shi);
/* we don't want flipped normals, they screw up back scattering */
- if(shi->flippednor)
+ if (shi->flippednor)
shade_input_flip_normals(shi);
/* not a pretty solution, but fixes common cases */
- if(shi->obr->ob && shi->obr->ob->transflag & OB_NEG_SCALE) {
+ if (shi->obr->ob && shi->obr->ob->transflag & OB_NEG_SCALE) {
negate_v3(shi->vn);
negate_v3(shi->vno);
negate_v3(shi->nmapnorm);
}
/* if nodetree, use the material that we are currently preprocessing
- instead of the node material */
- if(shi->mat->nodetree && shi->mat->use_nodes)
+ * instead of the node material */
+ if (shi->mat->nodetree && shi->mat->use_nodes)
shi->mat= mat;
/* init material vars */
@@ -1638,7 +1638,7 @@ void zbufshade_sss_tile(RenderPart *pa)
shade_sample_initialize(&ssamp, pa, rr->layers.first);
ssamp.tot= 1;
- for(rl=rr->layers.first; rl; rl=rl->next) {
+ for (rl=rr->layers.first; rl; rl=rl->next) {
ssamp.shi[0].lay |= rl->lay;
ssamp.shi[0].layflag |= rl->layflag;
ssamp.shi[0].passflag |= rl->passflag;
@@ -1655,7 +1655,7 @@ void zbufshade_sss_tile(RenderPart *pa)
/* create the pixelstrs to be used later */
zbuffer_sss(pa, lay, &handle, addps_sss);
- if(handle.totps==0) {
+ if (handle.totps==0) {
zbufshade_sss_free(pa);
return;
}
@@ -1668,13 +1668,13 @@ void zbufshade_sss_tile(RenderPart *pa)
#if 0
/* create ISB (does not work currently!) */
- if(re->r.mode & R_SHADOW)
+ if (re->r.mode & R_SHADOW)
ISB_create(pa, NULL);
#endif
- if(display) {
+ if (display) {
/* initialize scanline updates for main thread */
- rr->renrect.ymin= 0;
+ rr->renrect.ymin = 0;
rr->renlay= rl;
}
@@ -1691,15 +1691,15 @@ void zbufshade_sss_tile(RenderPart *pa)
#endif
totpoint= 0;
- for(y=pa->disprect.ymin; y<pa->disprect.ymax; y++, rr->renrect.ymax++) {
- for(x=pa->disprect.xmin; x<pa->disprect.xmax; x++, fcol+=4) {
+ for (y=pa->disprect.ymin; y<pa->disprect.ymax; y++, rr->renrect.ymax++) {
+ for (x=pa->disprect.xmin; x<pa->disprect.xmax; x++, fcol+=4) {
/* per pixel fixed seed */
BLI_thread_srandom(pa->thread, seed++);
#if 0
- if(rs) {
+ if (rs) {
/* for each sample in this pixel, shade it */
- for(ps=(PixStr*)*rs; ps; ps=ps->next) {
+ for (ps=(PixStr*)*rs; ps; ps=ps->next) {
ObjectInstanceRen *obi= &re->objectinstance[ps->obi];
ObjectRen *obr= obi->obr;
vlr= RE_findOrAddVlak(obr, (ps->facenr-1) & RE_QUAD_MASK);
@@ -1718,8 +1718,8 @@ void zbufshade_sss_tile(RenderPart *pa)
rs++;
}
#else
- if(rp) {
- if(*rp != 0) {
+ if (rp) {
+ if (*rp != 0) {
ObjectInstanceRen *obi= &re->objectinstance[*ro];
ObjectRen *obr= obi->obr;
@@ -1738,8 +1738,8 @@ void zbufshade_sss_tile(RenderPart *pa)
rp++; rz++; ro++;
}
- if(rbp) {
- if(*rbp != 0 && !(*rbp == *(rp-1) && *rbo == *(ro-1))) {
+ if (rbp) {
+ if (*rbp != 0 && !(*rbp == *(rp-1) && *rbo == *(ro-1))) {
ObjectInstanceRen *obi= &re->objectinstance[*rbo];
ObjectRen *obr= obi->obr;
@@ -1763,12 +1763,12 @@ void zbufshade_sss_tile(RenderPart *pa)
#endif
}
- if(y&1)
- if(re->test_break(re->tbh)) break;
+ if (y&1)
+ if (re->test_break(re->tbh)) break;
}
/* note: after adding we do not free these arrays, sss keeps them */
- if(totpoint > 0) {
+ if (totpoint > 0) {
sss_add_points(re, co, color, area, totpoint);
}
else {
@@ -1778,13 +1778,13 @@ void zbufshade_sss_tile(RenderPart *pa)
}
#if 0
- if(re->r.mode & R_SHADOW)
+ if (re->r.mode & R_SHADOW)
ISB_free(pa);
#endif
- if(display) {
+ if (display) {
/* display active layer */
- rr->renrect.ymin=rr->renrect.ymax= 0;
+ rr->renrect.ymin=rr->renrect.ymax = 0;
rr->renlay= render_get_active_layer(&R, rr);
}
@@ -1806,37 +1806,37 @@ static void renderhalo_post(RenderResult *rr, float *rectf, HaloRen *har) /* pos
har->miny= miny= haloys - har->rad/R.ycor;
har->maxy= maxy= haloys + har->rad/R.ycor;
- if(maxy<0);
- else if(rr->recty<miny);
+ if (maxy<0);
+ else if (rr->recty<miny);
else {
minx= floor(haloxs-har->rad);
maxx= ceil(haloxs+har->rad);
- if(maxx<0);
- else if(rr->rectx<minx);
+ if (maxx<0);
+ else if (rr->rectx<minx);
else {
- if(minx<0) minx= 0;
- if(maxx>=rr->rectx) maxx= rr->rectx-1;
- if(miny<0) miny= 0;
- if(maxy>rr->recty) maxy= rr->recty;
+ if (minx<0) minx= 0;
+ if (maxx>=rr->rectx) maxx= rr->rectx-1;
+ if (miny<0) miny= 0;
+ if (maxy>rr->recty) maxy= rr->recty;
rectft= rectf+ 4*rr->rectx*miny;
- for(y=miny; y<maxy; y++) {
+ for (y=miny; y<maxy; y++) {
rtf= rectft+4*minx;
yn= (y - haloys)*R.ycor;
ysq= yn*yn;
- for(x=minx; x<=maxx; x++) {
+ for (x=minx; x<=maxx; x++) {
xn= x - haloxs;
xsq= xn*xn;
dist= xsq+ysq;
- if(dist<har->radsq) {
+ if (dist<har->radsq) {
- if(shadeHaloFloat(har, colf, 0x7FFFFF, dist, xn, yn, har->flarec))
+ if (shadeHaloFloat(har, colf, 0x7FFFFF, dist, xn, yn, har->flarec))
addalphaAddfacFloat(rtf, colf, har->add);
}
rtf+=4;
@@ -1844,7 +1844,7 @@ static void renderhalo_post(RenderResult *rr, float *rectf, HaloRen *har) /* pos
rectft+= 4*rr->rectx;
- if(R.test_break(R.tbh)) break;
+ if (R.test_break(R.tbh)) break;
}
}
}
@@ -1885,7 +1885,7 @@ static void renderflare(RenderResult *rr, float *rectf, HaloRen *har)
/* next halo's: the flares */
rc= hashvectf + ma->seed2;
- for(b=1; b<har->flarec; b++) {
+ for (b=1; b<har->flarec; b++) {
fla.r= fabs(rc[0]);
fla.g= fabs(rc[1]);
@@ -1898,7 +1898,7 @@ static void renderflare(RenderResult *rr, float *rectf, HaloRen *har)
fla.rad= ma->subsize*sqrtf(fabs(2.0f*har->rad*rc[4]));
- if(type==3) {
+ if (type==3) {
fla.rad*= 3.0f;
fla.rad+= R.rectx/10;
}
@@ -1912,16 +1912,16 @@ static void renderflare(RenderResult *rr, float *rectf, HaloRen *har)
fla.xs= R.winx/2 + vec[0] + (1.2f+rc[8])*R.rectx*vec[0]/vec[2];
fla.ys= R.winy/2 + vec[1] + (1.2f+rc[8])*R.rectx*vec[1]/vec[2];
- if(R.flag & R_SEC_FIELD) {
- if(R.r.mode & R_ODDFIELD) fla.ys += 0.5f;
+ if (R.flag & R_SEC_FIELD) {
+ if (R.r.mode & R_ODDFIELD) fla.ys += 0.5f;
else fla.ys -= 0.5f;
}
- if(type & 1) fla.type= HA_FLARECIRC;
+ if (type & 1) fla.type= HA_FLARECIRC;
else fla.type= 0;
renderhalo_post(rr, rectf, &fla);
fla.alfa*= 0.5f;
- if(type & 2) fla.type= HA_FLARECIRC;
+ if (type & 2) fla.type= HA_FLARECIRC;
else fla.type= 0;
renderhalo_post(rr, rectf, &fla);
@@ -1938,11 +1938,11 @@ void add_halo_flare(Render *re)
int a, mode, do_draw=0;
/* for now, we get the first renderlayer in list with halos set */
- for(rl= rr->layers.first; rl; rl= rl->next)
- if(rl->layflag & SCE_LAY_HALO)
+ for (rl= rr->layers.first; rl; rl= rl->next)
+ if (rl->layflag & SCE_LAY_HALO)
break;
- if(rl==NULL || rl->rectf==NULL)
+ if (rl==NULL || rl->rectf==NULL)
return;
mode= R.r.mode;
@@ -1950,16 +1950,16 @@ void add_halo_flare(Render *re)
project_renderdata(&R, projectverto, 0, 0, 0);
- for(a=0; a<R.tothalo; a++) {
+ for (a=0; a<R.tothalo; a++) {
har= R.sortedhalos[a];
- if(har->flarec) {
+ if (har->flarec) {
do_draw= 1;
renderflare(rr, rl->rectf, har);
}
}
- if(do_draw) {
+ if (do_draw) {
/* weak... the display callback wants an active renderlayer pointer... */
rr->renlay= rl;
re->display_draw(re->ddh, rr, NULL);
@@ -1998,7 +1998,7 @@ typedef struct BakeShade {
static void bake_set_shade_input(ObjectInstanceRen *obi, VlakRen *vlr, ShadeInput *shi, int quad, int UNUSED(isect), int x, int y, float u, float v)
{
- if(quad)
+ if (quad)
shade_input_set_triangle_i(shi, obi, vlr, 0, 2, 3);
else
shade_input_set_triangle_i(shi, obi, vlr, 0, 1, 2);
@@ -2017,7 +2017,7 @@ static void bake_set_shade_input(ObjectInstanceRen *obi, VlakRen *vlr, ShadeInpu
shade_input_set_normals(shi);
/* no normal flip */
- if(shi->flippednor)
+ if (shi->flippednor)
shade_input_flip_normals(shi);
/* set up view vector to look right at the surface (note that the normal
@@ -2036,10 +2036,10 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
shade_input_init_material(shi);
- if(bs->type==RE_BAKE_AO) {
+ if (bs->type==RE_BAKE_AO) {
ambient_occlusion(shi);
- if(R.r.bake_flag & R_BAKE_NORMALIZE) {
+ if (R.r.bake_flag & R_BAKE_NORMALIZE) {
copy_v3_v3(shr.combined, shi->ao);
}
else {
@@ -2054,28 +2054,28 @@ 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 */
- if( ELEM3(bs->type, RE_BAKE_ALL, RE_BAKE_AO, RE_BAKE_LIGHT))
+ * 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);
- if(shi->mat->nodetree && shi->mat->use_nodes) {
+ if (shi->mat->nodetree && shi->mat->use_nodes) {
ntreeShaderExecTree(shi->mat->nodetree, shi, &shr);
shi->mat= vlr->mat; /* shi->mat is being set in nodetree */
}
else
shade_material_loop(shi, &shr);
- if(bs->type==RE_BAKE_NORMALS) {
+ if (bs->type==RE_BAKE_NORMALS) {
float nor[3];
copy_v3_v3(nor, shi->vn);
- if(R.r.bake_normal_space == R_BAKE_SPACE_CAMERA);
- else if(R.r.bake_normal_space == R_BAKE_SPACE_TANGENT) {
+ if (R.r.bake_normal_space == R_BAKE_SPACE_CAMERA);
+ else if (R.r.bake_normal_space == R_BAKE_SPACE_TANGENT) {
float mat[3][3], imat[3][3];
/* bitangent */
- if(tvn && ttang) {
+ if (tvn && ttang) {
copy_v3_v3(mat[0], ttang);
cross_v3_v3v3(mat[1], tvn, ttang);
mul_v3_fl(mat[1], ttang[3]);
@@ -2091,9 +2091,9 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
invert_m3_m3(imat, mat);
mul_m3_v3(imat, nor);
}
- else if(R.r.bake_normal_space == R_BAKE_SPACE_OBJECT)
+ else if (R.r.bake_normal_space == R_BAKE_SPACE_OBJECT)
mul_mat3_m4_v3(ob->imat_ren, nor); /* ob->imat_ren includes viewinv! */
- else if(R.r.bake_normal_space == R_BAKE_SPACE_WORLD)
+ else if (R.r.bake_normal_space == R_BAKE_SPACE_WORLD)
mul_mat3_m4_v3(R.viewinv, nor);
normalize_v3(nor); /* in case object has scaling */
@@ -2108,47 +2108,47 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
shr.combined[1]= nor[1]/2.0f + 0.5f;
shr.combined[2]= nor[2]/2.0f + 0.5f;
}
- else if(bs->type==RE_BAKE_TEXTURE) {
+ else if (bs->type==RE_BAKE_TEXTURE) {
shr.combined[0]= shi->r;
shr.combined[1]= shi->g;
shr.combined[2]= shi->b;
shr.alpha = shi->alpha;
}
- else if(bs->type==RE_BAKE_SHADOW) {
+ else if (bs->type==RE_BAKE_SHADOW) {
copy_v3_v3(shr.combined, shr.shad);
shr.alpha = shi->alpha;
}
- else if(bs->type==RE_BAKE_SPEC_COLOR) {
+ else if (bs->type==RE_BAKE_SPEC_COLOR) {
shr.combined[0]= shi->specr;
shr.combined[1]= shi->specg;
shr.combined[2]= shi->specb;
shr.alpha = 1.0f;
}
- else if(bs->type==RE_BAKE_SPEC_INTENSITY) {
+ else if (bs->type==RE_BAKE_SPEC_INTENSITY) {
shr.combined[0]=
shr.combined[1]=
shr.combined[2]= shi->spec;
shr.alpha = 1.0f;
}
- else if(bs->type==RE_BAKE_MIRROR_COLOR) {
+ else if (bs->type==RE_BAKE_MIRROR_COLOR) {
shr.combined[0]= shi->mirr;
shr.combined[1]= shi->mirg;
shr.combined[2]= shi->mirb;
shr.alpha = 1.0f;
}
- else if(bs->type==RE_BAKE_MIRROR_INTENSITY) {
+ else if (bs->type==RE_BAKE_MIRROR_INTENSITY) {
shr.combined[0]=
shr.combined[1]=
shr.combined[2]= shi->ray_mirror;
shr.alpha = 1.0f;
}
- else if(bs->type==RE_BAKE_ALPHA) {
+ else if (bs->type==RE_BAKE_ALPHA) {
shr.combined[0]=
shr.combined[1]=
shr.combined[2]= shi->alpha;
shr.alpha = 1.0f;
}
- else if(bs->type==RE_BAKE_EMIT) {
+ else if (bs->type==RE_BAKE_EMIT) {
shr.combined[0]=
shr.combined[1]=
shr.combined[2]= shi->emit;
@@ -2156,12 +2156,13 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
}
}
- if(bs->rect_float) {
+ if (bs->rect_float) {
float *col= bs->rect_float + 4*(bs->rectx*y + x);
copy_v3_v3(col, shr.combined);
if (bs->type==RE_BAKE_ALL || bs->type==RE_BAKE_TEXTURE) {
col[3]= shr.alpha;
- } else {
+ }
+ else {
col[3]= 1.0;
}
}
@@ -2177,7 +2178,8 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
if (ELEM(bs->type, RE_BAKE_ALL, RE_BAKE_TEXTURE)) {
col[3]= FTOCHAR(shr.alpha);
- } else {
+ }
+ else {
col[3]= 255;
}
}
@@ -2192,17 +2194,19 @@ static void bake_displacement(void *handle, ShadeInput *UNUSED(shi), float dist,
BakeShade *bs= handle;
float disp;
- if(R.r.bake_flag & R_BAKE_NORMALIZE && R.r.bake_maxdist) {
+ if (R.r.bake_flag & R_BAKE_NORMALIZE && R.r.bake_maxdist) {
disp = (dist+R.r.bake_maxdist) / (R.r.bake_maxdist*2); /* alter the range from [-bake_maxdist, bake_maxdist] to [0, 1]*/
- } else {
+ }
+ else {
disp = 0.5f + dist; /* alter the range from [-0.5,0.5] to [0,1]*/
}
- if(bs->rect_float) {
+ if (bs->rect_float) {
float *col= bs->rect_float + 4*(bs->rectx*y + x);
col[0] = col[1] = col[2] = disp;
col[3]= 1.0f;
- } else {
+ }
+ else {
char *col= (char *)(bs->rect + bs->rectx*y + x);
col[0] = col[1] = col[2] = FTOCHAR(disp);
col[3]= 255;
@@ -2218,7 +2222,7 @@ static int bake_intersect_tree(RayObject* raytree, Isect* isect, float *start, f
int hit;
/* might be useful to make a user setting for maxsize*/
- if(R.r.bake_maxdist > 0.0f)
+ if (R.r.bake_maxdist > 0.0f)
maxdist= R.r.bake_maxdist;
else
maxdist= RE_RAYTRACE_MAXDIST + R.r.bake_biasdist;
@@ -2231,7 +2235,7 @@ static int bake_intersect_tree(RayObject* raytree, Isect* isect, float *start, f
isect->dist = maxdist;
hit = RE_rayobject_raycast(raytree, isect);
- if(hit) {
+ if (hit) {
madd_v3_v3v3fl(hitco, isect->start, isect->dir, isect->dist);
*dist= isect->dist;
@@ -2245,7 +2249,7 @@ static void bake_set_vlr_dxyco(BakeShade *bs, float *uv1, float *uv2, float *uv3
VlakRen *vlr= bs->vlr;
float A, d1, d2, d3, *v1, *v2, *v3;
- if(bs->quad) {
+ if (bs->quad) {
v1= vlr->v1->co;
v2= vlr->v3->co;
v3= vlr->v4->co;
@@ -2261,7 +2265,7 @@ static void bake_set_vlr_dxyco(BakeShade *bs, float *uv1, float *uv2, float *uv3
* then taking u and v partial derivatives to get dxco and dyco */
A= (uv2[0] - uv1[0])*(uv3[1] - uv1[1]) - (uv3[0] - uv1[0])*(uv2[1] - uv1[1]);
- if(fabsf(A) > FLT_EPSILON) {
+ if (fabsf(A) > FLT_EPSILON) {
A= 0.5f/A;
d1= uv2[1] - uv3[1];
@@ -2283,7 +2287,7 @@ static void bake_set_vlr_dxyco(BakeShade *bs, float *uv1, float *uv2, float *uv3
bs->dyco[0]= bs->dyco[1]= bs->dyco[2]= 0.0f;
}
- if(bs->obi->flag & R_TRANSFORMED) {
+ if (bs->obi->flag & R_TRANSFORMED) {
mul_m3_v3(bs->obi->nmat, bs->dxco);
mul_m3_v3(bs->obi->nmat, bs->dyco);
}
@@ -2301,11 +2305,11 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
ShadeInput *shi= ssamp->shi;
/* fast threadsafe break test */
- if(R.test_break(R.tbh))
+ if (R.test_break(R.tbh))
return;
/* setup render coordinates */
- if(bs->quad) {
+ if (bs->quad) {
v1= vlr->v1->co;
v2= vlr->v3->co;
v3= vlr->v4->co;
@@ -2323,7 +2327,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
shi->co[1]= l*v3[1]+u*v1[1]+v*v2[1];
shi->co[2]= l*v3[2]+u*v1[2]+v*v2[2];
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mul_m4_v3(obi->mat, shi->co);
copy_v3_v3(shi->dxco, bs->dxco);
@@ -2332,14 +2336,14 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
quad= bs->quad;
bake_set_shade_input(obi, vlr, shi, quad, 0, x, y, u, v);
- if(bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT) {
+ if (bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT) {
shade_input_set_shade_texco(shi);
copy_v3_v3(tvn, shi->nmapnorm);
copy_v4_v4(ttang, shi->nmaptang);
}
/* if we are doing selected to active baking, find point on other face */
- if(bs->actob) {
+ if (bs->actob) {
Isect isec, minisec;
float co[3], minco[3], dist, mindist=0.0f;
int hit, sign, dir=1;
@@ -2351,7 +2355,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
copy_v3_v3(bs->dir, shi->vn);
- for(sign=-1; sign<=1; sign+=2) {
+ for (sign=-1; sign<=1; sign+=2) {
memset(&isec, 0, sizeof(isec));
isec.mode= RE_RAY_MIRROR;
@@ -2361,8 +2365,8 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
isec.check = RE_CHECK_VLR_BAKE;
isec.skip = RE_SKIP_VLR_NEIGHBOUR;
- if(bake_intersect_tree(R.raytree, &isec, shi->co, shi->vn, sign, co, &dist)) {
- if(!hit || len_squared_v3v3(shi->co, co) < len_squared_v3v3(shi->co, minco)) {
+ if (bake_intersect_tree(R.raytree, &isec, shi->co, shi->vn, sign, co, &dist)) {
+ if (!hit || len_squared_v3v3(shi->co, co) < len_squared_v3v3(shi->co, minco)) {
minisec= isec;
mindist= dist;
copy_v3_v3(minco, co);
@@ -2373,7 +2377,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
}
if (bs->type==RE_BAKE_DISPLACEMENT) {
- if(hit)
+ if (hit)
bake_displacement(handle, shi, (dir==-1)? mindist:-mindist, x, y);
else
bake_displacement(handle, shi, 0.0f, x, y);
@@ -2381,7 +2385,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
}
/* if hit, we shade from the new point, otherwise from point one starting face */
- if(hit) {
+ if (hit) {
obi= (ObjectInstanceRen*)minisec.hit.ob;
vlr= (VlakRen*)minisec.hit.face;
quad= (minisec.isect == 2);
@@ -2393,7 +2397,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
}
}
- if(bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT)
+ if (bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT)
bake_shade(handle, ob, shi, quad, x, y, u, v, tvn, ttang);
else
bake_shade(handle, ob, shi, quad, x, y, u, v, 0, 0);
@@ -2407,7 +2411,7 @@ static int get_next_bake_face(BakeShade *bs)
static int v= 0, vdone= 0;
static ObjectInstanceRen *obi= NULL;
- if(bs==NULL) {
+ if (bs==NULL) {
vlr= NULL;
v= vdone= 0;
obi= R.instancetable.first;
@@ -2416,44 +2420,44 @@ static int get_next_bake_face(BakeShade *bs)
BLI_lock_thread(LOCK_CUSTOM1);
- for(; obi; obi=obi->next, v=0) {
+ for (; obi; obi=obi->next, v=0) {
obr= obi->obr;
- for(; v<obr->totvlak; v++) {
+ for (; v<obr->totvlak; v++) {
vlr= RE_findOrAddVlak(obr, v);
- if((bs->actob && bs->actob == obr->ob) || (!bs->actob && (obr->ob->flag & SELECT))) {
+ if ((bs->actob && bs->actob == obr->ob) || (!bs->actob && (obr->ob->flag & SELECT))) {
tface= RE_vlakren_get_tface(obr, vlr, obr->bakemtface, NULL, 0);
- if(tface && tface->tpage) {
+ if (tface && tface->tpage) {
Image *ima= tface->tpage;
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
const float vec_alpha[4]= {0.0f, 0.0f, 0.0f, 0.0f};
const float vec_solid[4]= {0.0f, 0.0f, 0.0f, 1.0f};
- if(ibuf==NULL)
+ if (ibuf==NULL)
continue;
- if(ibuf->rect==NULL && ibuf->rect_float==NULL)
+ if (ibuf->rect==NULL && ibuf->rect_float==NULL)
continue;
- if(ibuf->rect_float && !(ibuf->channels==0 || ibuf->channels==4))
+ if (ibuf->rect_float && !(ibuf->channels==0 || ibuf->channels==4))
continue;
- if(ima->flag & IMA_USED_FOR_RENDER) {
+ if (ima->flag & IMA_USED_FOR_RENDER) {
ima->id.flag &= ~LIB_DOIT;
continue;
}
/* find the image for the first time? */
- if(ima->id.flag & LIB_DOIT) {
+ if (ima->id.flag & LIB_DOIT) {
ima->id.flag &= ~LIB_DOIT;
/* we either fill in float or char, this ensures things go fine */
- if(ibuf->rect_float)
+ if (ibuf->rect_float)
imb_freerectImBuf(ibuf);
/* clear image */
- if(R.r.bake_flag & R_BAKE_CLEAR)
+ if (R.r.bake_flag & R_BAKE_CLEAR)
IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? vec_alpha : vec_solid);
/* might be read by UI to set active image for display */
@@ -2489,7 +2493,7 @@ static void shade_tface(BakeShade *bs)
int a, i1, i2, i3;
/* check valid zspan */
- if(ima!=bs->ima) {
+ if (ima!=bs->ima) {
bs->ima= ima;
bs->ibuf= BKE_image_get_ibuf(ima, NULL);
/* note, these calls only free/fill contents of zspan struct, not zspan itself */
@@ -2510,13 +2514,14 @@ static void shade_tface(BakeShade *bs)
bs->ibuf->userdata = (void *)MEM_callocN(sizeof(char)*bs->rectx*bs->recty, "BakeMask");
bs->rect_mask= (char *)bs->ibuf->userdata;
BLI_unlock_thread(LOCK_CUSTOM1);
- } else {
+ }
+ else {
bs->rect_mask= (char *)bs->ibuf->userdata;
}
}
/* get pixel level vertex coordinates */
- for(a=0; a<4; a++) {
+ for (a=0; a<4; a++) {
/* Note, workaround for pixel aligned UVs which are common and can screw up our intersection tests
* where a pixel gets in between 2 faces or the middle of a quad,
* camera aligned quads also have this problem but they are less common.
@@ -2531,7 +2536,7 @@ static void shade_tface(BakeShade *bs)
bake_set_vlr_dxyco(bs, vec[i1], vec[i2], vec[i3]);
zspan_scanconvert(bs->zspan, bs, vec[i1], vec[i2], vec[i3], do_bake_shade);
- if(vlr->v4) {
+ if (vlr->v4) {
bs->quad= 1;
bake_set_vlr_dxyco(bs, vec[0], vec[2], vec[3]);
zspan_scanconvert(bs->zspan, bs, vec[0], vec[2], vec[3], do_bake_shade);
@@ -2542,16 +2547,16 @@ static void *do_bake_thread(void *bs_v)
{
BakeShade *bs= bs_v;
- while(get_next_bake_face(bs)) {
+ while (get_next_bake_face(bs)) {
shade_tface(bs);
/* fast threadsafe break test */
- if(R.test_break(R.tbh))
+ if (R.test_break(R.tbh))
break;
/* access is not threadsafe but since its just true/false probably ok
* only used for interactive baking */
- if(bs->do_update)
+ if (bs->do_update)
*bs->do_update= TRUE;
}
bs->ready= 1;
@@ -2565,16 +2570,16 @@ void RE_bake_ibuf_filter(ImBuf *ibuf, char *mask, const int filter)
const short is_new_alpha= (ibuf->planes != R_IMF_PLANES_RGBA) && BKE_alphatest_ibuf(ibuf);
/* Margin */
- if(filter) {
+ if (filter) {
IMB_filter_extend(ibuf, mask, filter);
}
/* if the bake results in new alpha then change the image setting */
- if(is_new_alpha) {
+ if (is_new_alpha) {
ibuf->planes= R_IMF_PLANES_RGBA;
}
else {
- if(filter && ibuf->planes != R_IMF_PLANES_RGBA) {
+ if (filter && ibuf->planes != R_IMF_PLANES_RGBA) {
/* clear alpha added by filtering */
IMB_rectfill_alpha(ibuf, 1.0f);
}
@@ -2603,13 +2608,13 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up
usemask = 1;
/* baker uses this flag to detect if image was initialized */
- for(ima= G.main->image.first; ima; ima= ima->id.next) {
+ for (ima= G.main->image.first; ima; ima= ima->id.next) {
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
ima->id.flag |= LIB_DOIT;
ima->flag&= ~IMA_USED_FOR_RENDER;
- if(ibuf) {
+ if (ibuf) {
ibuf->userdata = NULL; /* use for masking if needed */
- if(ibuf->rect_float)
+ if (ibuf->rect_float)
ibuf->profile = IB_PROFILE_LINEAR_RGB;
}
}
@@ -2619,13 +2624,14 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up
handles= MEM_callocN(sizeof(BakeShade)*re->r.threads, "BakeShade");
/* get the threads running */
- for(a=0; a<re->r.threads; a++) {
+ for (a=0; a<re->r.threads; a++) {
/* set defaults in handles */
handles[a].ssamp.shi[0].lay= re->lay;
if (type==RE_BAKE_SHADOW) {
handles[a].ssamp.shi[0].passflag= SCE_PASS_SHADOW;
- } else {
+ }
+ else {
handles[a].ssamp.shi[0].passflag= SCE_PASS_COMBINED;
}
handles[a].ssamp.shi[0].combinedflag= ~(SCE_PASS_SPEC);
@@ -2645,30 +2651,30 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up
/* wait for everything to be done */
a= 0;
- while(a!=re->r.threads) {
+ while (a!=re->r.threads) {
PIL_sleep_ms(50);
/* calculate progress */
- for(vdone=0, a=0; a<re->r.threads; a++)
+ for (vdone=0, a=0; a<re->r.threads; a++)
vdone+= handles[a].vdone;
if (progress)
*progress = (float)(vdone / (float)re->totvlak);
- for(a=0; a<re->r.threads; a++) {
- if(handles[a].ready==0)
+ for (a=0; a<re->r.threads; a++) {
+ if (handles[a].ready==0)
break;
}
}
/* filter and refresh images */
- for(ima= G.main->image.first; ima; ima= ima->id.next) {
- if((ima->id.flag & LIB_DOIT)==0) {
+ for (ima= G.main->image.first; ima; ima= ima->id.next) {
+ if ((ima->id.flag & LIB_DOIT)==0) {
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
- if(ima->flag & IMA_USED_FOR_RENDER)
+ if (ima->flag & IMA_USED_FOR_RENDER)
result= BAKE_RESULT_FEEDBACK_LOOP;
- if(!ibuf)
+ if (!ibuf)
continue;
RE_bake_ibuf_filter(ibuf, (char *)ibuf->userdata, re->r.bake_filter);
@@ -2679,7 +2685,7 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up
}
/* calculate return value */
- for(a=0; a<re->r.threads; a++) {
+ for (a=0; a<re->r.threads; a++) {
zbuf_free_span(handles[a].zspan);
MEM_freeN(handles[a].zspan);
}
@@ -2688,7 +2694,7 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up
BLI_end_threads(&threads);
- if(vdone==0)
+ if (vdone==0)
result= BAKE_RESULT_NO_OBJECTS;
return result;
diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c
index 43761be9d71..d238087cfb1 100644
--- a/source/blender/render/intern/source/renderdatabase.c
+++ b/source/blender/render/intern/source/renderdatabase.c
@@ -90,11 +90,11 @@
/* ------------------------------------------------------------------------- */
-/* 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 */
+/* More dynamic allocation of options for render vertices and faces, so we don't
+ * 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 */
@@ -120,8 +120,8 @@ float *RE_vertren_get_sticky(ObjectRen *obr, VertRen *ver, int verify)
int nr= ver->index>>8;
sticky= obr->vertnodes[nr].sticky;
- if(sticky==NULL) {
- if(verify)
+ if (sticky==NULL) {
+ if (verify)
sticky= obr->vertnodes[nr].sticky= MEM_mallocN(256*RE_STICKY_ELEMS*sizeof(float), "sticky table");
else
return NULL;
@@ -135,8 +135,8 @@ float *RE_vertren_get_stress(ObjectRen *obr, VertRen *ver, int verify)
int nr= ver->index>>8;
stress= obr->vertnodes[nr].stress;
- if(stress==NULL) {
- if(verify)
+ if (stress==NULL) {
+ if (verify)
stress= obr->vertnodes[nr].stress= MEM_mallocN(256*RE_STRESS_ELEMS*sizeof(float), "stress table");
else
return NULL;
@@ -151,8 +151,8 @@ float *RE_vertren_get_rad(ObjectRen *obr, VertRen *ver, int verify)
int nr= ver->index>>8;
rad= obr->vertnodes[nr].rad;
- if(rad==NULL) {
- if(verify)
+ if (rad==NULL) {
+ if (verify)
rad= obr->vertnodes[nr].rad= MEM_callocN(256*RE_RAD_ELEMS*sizeof(float), "rad table");
else
return NULL;
@@ -166,8 +166,8 @@ float *RE_vertren_get_strand(ObjectRen *obr, VertRen *ver, int verify)
int nr= ver->index>>8;
strand= obr->vertnodes[nr].strand;
- if(strand==NULL) {
- if(verify)
+ if (strand==NULL) {
+ if (verify)
strand= obr->vertnodes[nr].strand= MEM_mallocN(256*RE_STRAND_ELEMS*sizeof(float), "strand table");
else
return NULL;
@@ -182,8 +182,8 @@ float *RE_vertren_get_tangent(ObjectRen *obr, VertRen *ver, int verify)
int nr= ver->index>>8;
tangent= obr->vertnodes[nr].tangent;
- if(tangent==NULL) {
- if(verify)
+ if (tangent==NULL) {
+ if (verify)
tangent= obr->vertnodes[nr].tangent= MEM_callocN(256*RE_TANGENT_ELEMS*sizeof(float), "tangent table");
else
return NULL;
@@ -199,8 +199,8 @@ float *RE_vertren_get_winspeed(ObjectInstanceRen *obi, VertRen *ver, int verify)
int totvector;
winspeed= obi->vectors;
- if(winspeed==NULL) {
- if(verify) {
+ if (winspeed==NULL) {
+ if (verify) {
totvector= obi->obr->totvert + obi->obr->totstrand;
winspeed= obi->vectors= MEM_callocN(totvector*RE_WINSPEED_ELEMS*sizeof(float), "winspeed table");
}
@@ -220,27 +220,27 @@ VertRen *RE_vertren_copy(ObjectRen *obr, VertRen *ver)
v1->index= index;
fp1= RE_vertren_get_sticky(obr, ver, 0);
- if(fp1) {
+ if (fp1) {
fp2= RE_vertren_get_sticky(obr, v1, 1);
memcpy(fp2, fp1, RE_STICKY_ELEMS*sizeof(float));
}
fp1= RE_vertren_get_stress(obr, ver, 0);
- if(fp1) {
+ if (fp1) {
fp2= RE_vertren_get_stress(obr, v1, 1);
memcpy(fp2, fp1, RE_STRESS_ELEMS*sizeof(float));
}
fp1= RE_vertren_get_rad(obr, ver, 0);
- if(fp1) {
+ if (fp1) {
fp2= RE_vertren_get_rad(obr, v1, 1);
memcpy(fp2, fp1, RE_RAD_ELEMS*sizeof(float));
}
fp1= RE_vertren_get_strand(obr, ver, 0);
- if(fp1) {
+ if (fp1) {
fp2= RE_vertren_get_strand(obr, v1, 1);
memcpy(fp2, fp1, RE_STRAND_ELEMS*sizeof(float));
}
fp1= RE_vertren_get_tangent(obr, ver, 0);
- if(fp1) {
+ if (fp1) {
fp2= RE_vertren_get_tangent(obr, v1, 1);
memcpy(fp2, fp1, RE_TANGENT_ELEMS*sizeof(float));
}
@@ -253,7 +253,7 @@ VertRen *RE_findOrAddVert(ObjectRen *obr, int nr)
VertRen *v;
int a;
- if(nr<0) {
+ if (nr<0) {
printf("error in findOrAddVert: %d\n",nr);
return NULL;
}
@@ -263,21 +263,21 @@ VertRen *RE_findOrAddVert(ObjectRen *obr, int nr)
temp= obr->vertnodes;
obr->vertnodes= MEM_mallocN(sizeof(VertTableNode)*(obr->vertnodeslen+TABLEINITSIZE) , "vertnodes");
- if(temp) memcpy(obr->vertnodes, temp, obr->vertnodeslen*sizeof(VertTableNode));
+ if (temp) memcpy(obr->vertnodes, temp, obr->vertnodeslen*sizeof(VertTableNode));
memset(obr->vertnodes+obr->vertnodeslen, 0, TABLEINITSIZE*sizeof(VertTableNode));
obr->vertnodeslen+=TABLEINITSIZE;
- if(temp) MEM_freeN(temp);
+ if (temp) MEM_freeN(temp);
}
v= obr->vertnodes[a].vert;
- if(v==NULL) {
+ if (v==NULL) {
int i;
v= (VertRen *)MEM_callocN(256*sizeof(VertRen),"findOrAddVert");
obr->vertnodes[a].vert= v;
- for(i= (nr & 0xFFFFFF00), a=0; a<256; a++, i++) {
+ for (i= (nr & 0xFFFFFF00), a=0; a<256; a++, i++) {
v[a].index= i;
}
}
@@ -295,14 +295,14 @@ MTFace *RE_vlakren_get_tface(ObjectRen *obr, VlakRen *vlr, int n, char **name, i
node= &obr->vlaknodes[nr];
- if(verify) {
- if(n>=node->totmtface) {
+ if (verify) {
+ if (n>=node->totmtface) {
MTFace *mtface= node->mtface;
int size= (n+1)*256;
node->mtface= MEM_callocN(size*sizeof(MTFace), "Vlak mtface");
- if(mtface) {
+ if (mtface) {
size= node->totmtface*256;
memcpy(node->mtface, mtface, size*sizeof(MTFace));
MEM_freeN(mtface);
@@ -312,10 +312,10 @@ MTFace *RE_vlakren_get_tface(ObjectRen *obr, VlakRen *vlr, int n, char **name, i
}
}
else {
- if(n>=node->totmtface)
+ if (n>=node->totmtface)
return NULL;
- if(name) *name= obr->mtface[n];
+ if (name) *name= obr->mtface[n];
}
return node->mtface + index;
@@ -329,14 +329,14 @@ MCol *RE_vlakren_get_mcol(ObjectRen *obr, VlakRen *vlr, int n, char **name, int
node= &obr->vlaknodes[nr];
- if(verify) {
- if(n>=node->totmcol) {
+ if (verify) {
+ if (n>=node->totmcol) {
MCol *mcol= node->mcol;
int size= (n+1)*256;
node->mcol= MEM_callocN(size*sizeof(MCol)*RE_MCOL_ELEMS, "Vlak mcol");
- if(mcol) {
+ if (mcol) {
size= node->totmcol*256;
memcpy(node->mcol, mcol, size*sizeof(MCol)*RE_MCOL_ELEMS);
MEM_freeN(mcol);
@@ -346,10 +346,10 @@ MCol *RE_vlakren_get_mcol(ObjectRen *obr, VlakRen *vlr, int n, char **name, int
}
}
else {
- if(n>=node->totmcol)
+ if (n>=node->totmcol)
return NULL;
- if(name) *name= obr->mcol[n];
+ if (name) *name= obr->mcol[n];
}
return node->mcol + index*RE_MCOL_ELEMS;
@@ -361,8 +361,8 @@ float *RE_vlakren_get_surfnor(ObjectRen *obr, VlakRen *vlak, int verify)
int nr= vlak->index>>8;
surfnor= obr->vlaknodes[nr].surfnor;
- if(surfnor==NULL) {
- if(verify)
+ if (surfnor==NULL) {
+ if (verify)
surfnor= obr->vlaknodes[nr].surfnor= MEM_callocN(256*RE_SURFNOR_ELEMS*sizeof(float), "surfnor table");
else
return NULL;
@@ -376,8 +376,8 @@ float *RE_vlakren_get_nmap_tangent(ObjectRen *obr, VlakRen *vlak, int verify)
int nr= vlak->index>>8;
tangent= obr->vlaknodes[nr].tangent;
- if(tangent==NULL) {
- if(verify)
+ if (tangent==NULL) {
+ if (verify)
tangent= obr->vlaknodes[nr].tangent= MEM_callocN(256*RE_NMAP_TANGENT_ELEMS*sizeof(float), "tangent table");
else
return NULL;
@@ -391,8 +391,8 @@ RadFace **RE_vlakren_get_radface(ObjectRen *obr, VlakRen *vlak, int verify)
int nr= vlak->index>>8;
radface= obr->vlaknodes[nr].radface;
- if(radface==NULL) {
- if(verify)
+ if (radface==NULL) {
+ if (verify)
radface= obr->vlaknodes[nr].radface= MEM_callocN(256*RE_RADFACE_ELEMS*sizeof(void*), "radface table");
else
return NULL;
@@ -424,19 +424,19 @@ VlakRen *RE_vlakren_copy(ObjectRen *obr, VlakRen *vlr)
}
surfnor= RE_vlakren_get_surfnor(obr, vlr, 0);
- if(surfnor) {
+ if (surfnor) {
surfnor1= RE_vlakren_get_surfnor(obr, vlr1, 1);
copy_v3_v3(surfnor1, surfnor);
}
tangent= RE_vlakren_get_nmap_tangent(obr, vlr, 0);
- if(tangent) {
+ if (tangent) {
tangent1= RE_vlakren_get_nmap_tangent(obr, vlr1, 1);
memcpy(tangent1, tangent, sizeof(float)*RE_NMAP_TANGENT_ELEMS);
}
radface= RE_vlakren_get_radface(obr, vlr, 0);
- if(radface) {
+ if (radface) {
radface1= RE_vlakren_get_radface(obr, vlr1, 1);
*radface1= *radface;
}
@@ -448,7 +448,7 @@ void RE_vlakren_get_normal(Render *UNUSED(re), ObjectInstanceRen *obi, VlakRen *
{
float (*nmat)[3]= obi->nmat;
- if(obi->flag & R_TRANSFORMED) {
+ if (obi->flag & R_TRANSFORMED) {
mul_v3_m3v3(nor, nmat, vlr->n);
normalize_v3(nor);
}
@@ -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;
@@ -496,32 +496,32 @@ VlakRen *RE_findOrAddVlak(ObjectRen *obr, int nr)
VlakRen *v;
int a;
- if(nr<0) {
+ if (nr<0) {
printf("error in findOrAddVlak: %d\n",nr);
return obr->vlaknodes[0].vlak;
}
a= nr>>8;
- if (a>=obr->vlaknodeslen-1){ /* Need to allocate more columns..., and keep last element NULL for free loop */
+ if (a>=obr->vlaknodeslen-1) { /* Need to allocate more columns..., and keep last element NULL for free loop */
temp= obr->vlaknodes;
obr->vlaknodes= MEM_mallocN(sizeof(VlakTableNode)*(obr->vlaknodeslen+TABLEINITSIZE) , "vlaknodes");
- if(temp) memcpy(obr->vlaknodes, temp, obr->vlaknodeslen*sizeof(VlakTableNode));
+ if (temp) memcpy(obr->vlaknodes, temp, obr->vlaknodeslen*sizeof(VlakTableNode));
memset(obr->vlaknodes+obr->vlaknodeslen, 0, TABLEINITSIZE*sizeof(VlakTableNode));
obr->vlaknodeslen+=TABLEINITSIZE; /*Does this really need to be power of 2?*/
- if(temp) MEM_freeN(temp);
+ if (temp) MEM_freeN(temp);
}
v= obr->vlaknodes[a].vlak;
- if(v==NULL) {
+ if (v==NULL) {
int i;
v= (VlakRen *)MEM_callocN(256*sizeof(VlakRen),"findOrAddVlak");
obr->vlaknodes[a].vlak= v;
- for(i= (nr & 0xFFFFFF00), a=0; a<256; a++, i++)
+ for (i= (nr & 0xFFFFFF00), a=0; a<256; a++, i++)
v[a].index= i;
}
v+= (nr & 255);
@@ -536,8 +536,8 @@ float *RE_strandren_get_surfnor(ObjectRen *obr, StrandRen *strand, int verify)
int nr= strand->index>>8;
surfnor= obr->strandnodes[nr].surfnor;
- if(surfnor==NULL) {
- if(verify)
+ if (surfnor==NULL) {
+ if (verify)
surfnor= obr->strandnodes[nr].surfnor= MEM_callocN(256*RE_SURFNOR_ELEMS*sizeof(float), "surfnor strand table");
else
return NULL;
@@ -553,14 +553,14 @@ float *RE_strandren_get_uv(ObjectRen *obr, StrandRen *strand, int n, char **name
node= &obr->strandnodes[nr];
- if(verify) {
- if(n>=node->totuv) {
+ if (verify) {
+ if (n>=node->totuv) {
float *uv= node->uv;
int size= (n+1)*256;
node->uv= MEM_callocN(size*sizeof(float)*RE_UV_ELEMS, "strand uv table");
- if(uv) {
+ if (uv) {
size= node->totuv*256;
memcpy(node->uv, uv, size*sizeof(float)*RE_UV_ELEMS);
MEM_freeN(uv);
@@ -570,10 +570,10 @@ float *RE_strandren_get_uv(ObjectRen *obr, StrandRen *strand, int n, char **name
}
}
else {
- if(n>=node->totuv)
+ if (n>=node->totuv)
return NULL;
- if(name) *name= obr->mtface[n];
+ if (name) *name= obr->mtface[n];
}
return node->uv + index*RE_UV_ELEMS;
@@ -587,14 +587,14 @@ MCol *RE_strandren_get_mcol(ObjectRen *obr, StrandRen *strand, int n, char **nam
node= &obr->strandnodes[nr];
- if(verify) {
- if(n>=node->totmcol) {
+ if (verify) {
+ if (n>=node->totmcol) {
MCol *mcol= node->mcol;
int size= (n+1)*256;
node->mcol= MEM_callocN(size*sizeof(MCol)*RE_MCOL_ELEMS, "strand mcol table");
- if(mcol) {
+ if (mcol) {
size= node->totmcol*256;
memcpy(node->mcol, mcol, size*sizeof(MCol)*RE_MCOL_ELEMS);
MEM_freeN(mcol);
@@ -604,10 +604,10 @@ MCol *RE_strandren_get_mcol(ObjectRen *obr, StrandRen *strand, int n, char **nam
}
}
else {
- if(n>=node->totmcol)
+ if (n>=node->totmcol)
return NULL;
- if(name) *name= obr->mcol[n];
+ if (name) *name= obr->mcol[n];
}
return node->mcol + index*RE_MCOL_ELEMS;
@@ -619,8 +619,8 @@ float *RE_strandren_get_simplify(struct ObjectRen *obr, struct StrandRen *strand
int nr= strand->index>>8;
simplify= obr->strandnodes[nr].simplify;
- if(simplify==NULL) {
- if(verify)
+ if (simplify==NULL) {
+ if (verify)
simplify= obr->strandnodes[nr].simplify= MEM_callocN(256*RE_SIMPLIFY_ELEMS*sizeof(float), "simplify strand table");
else
return NULL;
@@ -634,8 +634,8 @@ int *RE_strandren_get_face(ObjectRen *obr, StrandRen *strand, int verify)
int nr= strand->index>>8;
face= obr->strandnodes[nr].face;
- if(face==NULL) {
- if(verify)
+ if (face==NULL) {
+ if (verify)
face= obr->strandnodes[nr].face= MEM_callocN(256*RE_FACE_ELEMS*sizeof(int), "face strand table");
else
return NULL;
@@ -650,8 +650,8 @@ float *RE_strandren_get_winspeed(ObjectInstanceRen *obi, StrandRen *strand, int
int totvector;
winspeed= obi->vectors;
- if(winspeed==NULL) {
- if(verify) {
+ if (winspeed==NULL) {
+ if (verify) {
totvector= obi->obr->totvert + obi->obr->totstrand;
winspeed= obi->vectors= MEM_callocN(totvector*RE_WINSPEED_ELEMS*sizeof(float), "winspeed strand table");
}
@@ -667,32 +667,32 @@ StrandRen *RE_findOrAddStrand(ObjectRen *obr, int nr)
StrandRen *v;
int a;
- if(nr<0) {
+ if (nr<0) {
printf("error in findOrAddStrand: %d\n",nr);
return obr->strandnodes[0].strand;
}
a= nr>>8;
- if (a>=obr->strandnodeslen-1){ /* Need to allocate more columns..., and keep last element NULL for free loop */
+ if (a>=obr->strandnodeslen-1) { /* Need to allocate more columns..., and keep last element NULL for free loop */
temp= obr->strandnodes;
obr->strandnodes= MEM_mallocN(sizeof(StrandTableNode)*(obr->strandnodeslen+TABLEINITSIZE) , "strandnodes");
- if(temp) memcpy(obr->strandnodes, temp, obr->strandnodeslen*sizeof(StrandTableNode));
+ if (temp) memcpy(obr->strandnodes, temp, obr->strandnodeslen*sizeof(StrandTableNode));
memset(obr->strandnodes+obr->strandnodeslen, 0, TABLEINITSIZE*sizeof(StrandTableNode));
obr->strandnodeslen+=TABLEINITSIZE; /*Does this really need to be power of 2?*/
- if(temp) MEM_freeN(temp);
+ if (temp) MEM_freeN(temp);
}
v= obr->strandnodes[a].strand;
- if(v==NULL) {
+ if (v==NULL) {
int i;
v= (StrandRen *)MEM_callocN(256*sizeof(StrandRen),"findOrAddStrand");
obr->strandnodes[a].strand= v;
- for(i= (nr & 0xFFFFFF00), a=0; a<256; a++, i++)
+ for (i= (nr & 0xFFFFFF00), a=0; a<256; a++, i++)
v[a].index= i;
}
v+= (nr & 255);
@@ -733,22 +733,22 @@ void free_renderdata_vertnodes(VertTableNode *vertnodes)
{
int a;
- if(vertnodes==NULL) return;
+ if (vertnodes==NULL) return;
- for(a=0; vertnodes[a].vert; a++) {
+ for (a=0; vertnodes[a].vert; a++) {
MEM_freeN(vertnodes[a].vert);
- if(vertnodes[a].rad)
+ if (vertnodes[a].rad)
MEM_freeN(vertnodes[a].rad);
- if(vertnodes[a].sticky)
+ if (vertnodes[a].sticky)
MEM_freeN(vertnodes[a].sticky);
- if(vertnodes[a].strand)
+ if (vertnodes[a].strand)
MEM_freeN(vertnodes[a].strand);
- if(vertnodes[a].tangent)
+ if (vertnodes[a].tangent)
MEM_freeN(vertnodes[a].tangent);
- if(vertnodes[a].stress)
+ if (vertnodes[a].stress)
MEM_freeN(vertnodes[a].stress);
- if(vertnodes[a].winspeed)
+ if (vertnodes[a].winspeed)
MEM_freeN(vertnodes[a].winspeed);
}
@@ -759,20 +759,20 @@ void free_renderdata_vlaknodes(VlakTableNode *vlaknodes)
{
int a;
- if(vlaknodes==NULL) return;
+ if (vlaknodes==NULL) return;
- for(a=0; vlaknodes[a].vlak; a++) {
+ for (a=0; vlaknodes[a].vlak; a++) {
MEM_freeN(vlaknodes[a].vlak);
- if(vlaknodes[a].mtface)
+ if (vlaknodes[a].mtface)
MEM_freeN(vlaknodes[a].mtface);
- if(vlaknodes[a].mcol)
+ if (vlaknodes[a].mcol)
MEM_freeN(vlaknodes[a].mcol);
- if(vlaknodes[a].surfnor)
+ if (vlaknodes[a].surfnor)
MEM_freeN(vlaknodes[a].surfnor);
- if(vlaknodes[a].tangent)
+ if (vlaknodes[a].tangent)
MEM_freeN(vlaknodes[a].tangent);
- if(vlaknodes[a].radface)
+ if (vlaknodes[a].radface)
MEM_freeN(vlaknodes[a].radface);
}
@@ -783,22 +783,22 @@ static void free_renderdata_strandnodes(StrandTableNode *strandnodes)
{
int a;
- if(strandnodes==NULL) return;
+ if (strandnodes==NULL) return;
- for(a=0; strandnodes[a].strand; a++) {
+ for (a=0; strandnodes[a].strand; a++) {
MEM_freeN(strandnodes[a].strand);
- if(strandnodes[a].uv)
+ if (strandnodes[a].uv)
MEM_freeN(strandnodes[a].uv);
- if(strandnodes[a].mcol)
+ if (strandnodes[a].mcol)
MEM_freeN(strandnodes[a].mcol);
- if(strandnodes[a].winspeed)
+ if (strandnodes[a].winspeed)
MEM_freeN(strandnodes[a].winspeed);
- if(strandnodes[a].surfnor)
+ if (strandnodes[a].surfnor)
MEM_freeN(strandnodes[a].surfnor);
- if(strandnodes[a].simplify)
+ if (strandnodes[a].simplify)
MEM_freeN(strandnodes[a].simplify);
- if(strandnodes[a].face)
+ if (strandnodes[a].face)
MEM_freeN(strandnodes[a].face);
}
@@ -812,22 +812,22 @@ void free_renderdata_tables(Render *re)
StrandBuffer *strandbuf;
int a=0;
- for(obr=re->objecttable.first; obr; obr=obr->next) {
- if(obr->vertnodes) {
+ for (obr=re->objecttable.first; obr; obr=obr->next) {
+ 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) {
- for(a=0; obr->bloha[a]; a++)
+ if (obr->bloha) {
+ for (a=0; obr->bloha[a]; a++)
MEM_freeN(obr->bloha[a]);
MEM_freeN(obr->bloha);
@@ -835,48 +835,48 @@ 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;
}
strandbuf= obr->strandbuf;
- if(strandbuf) {
- if(strandbuf->vert) MEM_freeN(strandbuf->vert);
- if(strandbuf->bound) MEM_freeN(strandbuf->bound);
+ if (strandbuf) {
+ if (strandbuf->vert) MEM_freeN(strandbuf->vert);
+ if (strandbuf->bound) MEM_freeN(strandbuf->bound);
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;
}
}
- if(re->objectinstance) {
- for(obi=re->instancetable.first; obi; obi=obi->next)
+ if (re->objectinstance) {
+ for (obi=re->instancetable.first; obi; obi=obi->next)
{
- if(obi->vectors)
+ if (obi->vectors)
MEM_freeN(obi->vectors);
- if(obi->raytree)
+ if (obi->raytree)
RE_rayobject_free(obi->raytree);
}
@@ -886,7 +886,7 @@ void free_renderdata_tables(Render *re)
re->instancetable.first= re->instancetable.last= NULL;
}
- if(re->sortedhalos) {
+ if (re->sortedhalos) {
MEM_freeN(re->sortedhalos);
re->sortedhalos= NULL;
}
@@ -903,26 +903,26 @@ HaloRen *RE_findOrAddHalo(ObjectRen *obr, int nr)
HaloRen *h, **temp;
int a;
- if(nr<0) {
+ if (nr<0) {
printf("error in findOrAddHalo: %d\n",nr);
return NULL;
}
a= nr>>8;
- if (a>=obr->blohalen-1){ /* Need to allocate more columns..., and keep last element NULL for free loop */
+ if (a>=obr->blohalen-1) { /* Need to allocate more columns..., and keep last element NULL for free loop */
//printf("Allocating %i more halo groups. %i total.\n",
// TABLEINITSIZE, obr->blohalen+TABLEINITSIZE );
temp=obr->bloha;
obr->bloha=(HaloRen**)MEM_callocN(sizeof(void*)*(obr->blohalen+TABLEINITSIZE) , "Bloha");
- if(temp) memcpy(obr->bloha, temp, obr->blohalen*sizeof(void*));
+ if (temp) memcpy(obr->bloha, temp, obr->blohalen*sizeof(void*));
memset(&(obr->bloha[obr->blohalen]), 0, TABLEINITSIZE*sizeof(void*));
obr->blohalen+=TABLEINITSIZE; /*Does this really need to be power of 2?*/
- if(temp) MEM_freeN(temp);
+ if (temp) MEM_freeN(temp);
}
h= obr->bloha[a];
- if(h==NULL) {
+ if (h==NULL) {
h= (HaloRen *)MEM_callocN(256*sizeof(HaloRen),"findOrAdHalo");
obr->bloha[a]= h;
}
@@ -940,13 +940,13 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f
float tin, tr, tg, tb, ta;
float xn, yn, zn, texvec[3], hoco[4], hoco1[4];
- if(hasize==0.0f) return NULL;
+ if (hasize==0.0f) return NULL;
projectverto(vec, re->winmat, hoco);
- if(hoco[3]==0.0f) return NULL;
- if(vec1) {
+ if (hoco[3]==0.0f) return NULL;
+ if (vec1) {
projectverto(vec1, re->winmat, hoco1);
- if(hoco1[3]==0.0f) return NULL;
+ if (hoco1[3]==0.0f) return NULL;
}
har= RE_findOrAddHalo(obr, obr->tothalo++);
@@ -963,13 +963,13 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f
har->zBufDist = 0x7FFFFFFF*(hoco[2]/zn);
/* halovect */
- if(vec1) {
+ if (vec1) {
har->type |= HA_VECT;
xn= har->xs - 0.5f*re->winx*(hoco1[0]/hoco1[3]);
yn= har->ys - 0.5f*re->winy*(hoco1[1]/hoco1[3]);
- if(xn==0.0f || (xn==0.0f && yn==0.0f)) zn= 0.0f;
+ if (xn==0.0f || (xn==0.0f && yn==0.0f)) zn= 0.0f;
else zn= atan2(yn, xn);
har->sin= sin(zn);
@@ -982,7 +982,7 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f
normalize_v3(har->no);
}
- if(ma->mode & MA_HALO_XALPHA) har->type |= HA_XALPHA;
+ if (ma->mode & MA_HALO_XALPHA) har->type |= HA_XALPHA;
har->alfa= ma->alpha;
har->r= ma->r;
@@ -993,32 +993,32 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f
har->hard= ma->har;
har->seed= seed % 256;
- if(ma->mode & MA_STAR) har->starpoints= ma->starc;
- if(ma->mode & MA_HALO_LINES) har->linec= ma->linec;
- if(ma->mode & MA_HALO_RINGS) har->ringc= ma->ringc;
- if(ma->mode & MA_HALO_FLARE) har->flarec= ma->flarec;
+ if (ma->mode & MA_STAR) har->starpoints= ma->starc;
+ if (ma->mode & MA_HALO_LINES) har->linec= ma->linec;
+ if (ma->mode & MA_HALO_RINGS) har->ringc= ma->ringc;
+ if (ma->mode & MA_HALO_FLARE) har->flarec= ma->flarec;
- if(ma->mtex[0]) {
+ if (ma->mtex[0]) {
- if( (ma->mode & MA_HALOTEX) ) har->tex= 1;
- else if(har->mat->septex & (1<<0)); /* only 1 level textures */
+ if ( (ma->mode & MA_HALOTEX) ) har->tex= 1;
+ else if (har->mat->septex & (1<<0)); /* only 1 level textures */
else {
mtex= ma->mtex[0];
copy_v3_v3(texvec, vec);
- if(mtex->texco & TEXCO_NORM) {
+ if (mtex->texco & TEXCO_NORM) {
;
}
- else if(mtex->texco & TEXCO_OBJECT) {
+ else if (mtex->texco & TEXCO_OBJECT) {
/* texvec[0]+= imatbase->ivec[0]; */
/* texvec[1]+= imatbase->ivec[1]; */
/* texvec[2]+= imatbase->ivec[2]; */
/* mul_m3_v3(imatbase->imat, texvec); */
}
else {
- if(orco) {
+ if (orco) {
copy_v3_v3(texvec, orco);
}
}
@@ -1028,16 +1028,16 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f
yn= tin*mtex->colfac;
//zn= tin*mtex->alphafac;
- if(mtex->mapto & MAP_COL) {
+ if (mtex->mapto & MAP_COL) {
zn= 1.0f-yn;
har->r= (yn*tr+ zn*ma->r);
har->g= (yn*tg+ zn*ma->g);
har->b= (yn*tb+ zn*ma->b);
}
- if(mtex->texco & TEXCO_UV) {
+ if (mtex->texco & TEXCO_UV) {
har->alfa= tin;
}
- if(mtex->mapto & MAP_ALPHA)
+ if (mtex->mapto & MAP_ALPHA)
har->alfa= tin;
}
}
@@ -1054,13 +1054,13 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
float xn, yn, zn, texvec[3], hoco[4], hoco1[4], in[3],tex[3],out[3];
int i, hasrgb;
- if(hasize==0.0f) return NULL;
+ if (hasize==0.0f) return NULL;
projectverto(vec, re->winmat, hoco);
- if(hoco[3]==0.0f) return NULL;
- if(vec1) {
+ if (hoco[3]==0.0f) return NULL;
+ if (vec1) {
projectverto(vec1, re->winmat, hoco1);
- if(hoco1[3]==0.0f) return NULL;
+ if (hoco1[3]==0.0f) return NULL;
}
har= RE_findOrAddHalo(obr, obr->tothalo++);
@@ -1077,13 +1077,13 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
har->zBufDist = 0x7FFFFFFF*(hoco[2]/zn);
/* halovect */
- if(vec1) {
+ if (vec1) {
har->type |= HA_VECT;
xn= har->xs - 0.5f*re->winx*(hoco1[0]/hoco1[3]);
yn= har->ys - 0.5f*re->winy*(hoco1[1]/hoco1[3]);
- if(xn==0.0f || (xn==0.0f && yn==0.0f)) zn= 0.0;
+ if (xn==0.0f || (xn==0.0f && yn==0.0f)) zn= 0.0;
else zn= atan2(yn, xn);
har->sin= sin(zn);
@@ -1096,7 +1096,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
normalize_v3(har->no);
}
- if(ma->mode & MA_HALO_XALPHA) har->type |= HA_XALPHA;
+ if (ma->mode & MA_HALO_XALPHA) har->type |= HA_XALPHA;
har->alfa= ma->alpha;
har->r= ma->r;
@@ -1107,32 +1107,32 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
har->hard= ma->har;
har->seed= seed % 256;
- if(ma->mode & MA_STAR) har->starpoints= ma->starc;
- if(ma->mode & MA_HALO_LINES) har->linec= ma->linec;
- if(ma->mode & MA_HALO_RINGS) har->ringc= ma->ringc;
- if(ma->mode & MA_HALO_FLARE) har->flarec= ma->flarec;
+ if (ma->mode & MA_STAR) har->starpoints= ma->starc;
+ if (ma->mode & MA_HALO_LINES) har->linec= ma->linec;
+ if (ma->mode & MA_HALO_RINGS) har->ringc= ma->ringc;
+ if (ma->mode & MA_HALO_FLARE) har->flarec= ma->flarec;
- if((ma->mode & MA_HALOTEX) && ma->mtex[0])
+ if ((ma->mode & MA_HALOTEX) && ma->mtex[0])
har->tex= 1;
- for(i=0; i<MAX_MTEX; i++)
- if(ma->mtex[i] && (ma->septex & (1<<i))==0) {
+ for (i=0; i<MAX_MTEX; i++)
+ if (ma->mtex[i] && (ma->septex & (1<<i))==0) {
mtex= ma->mtex[i];
copy_v3_v3(texvec, vec);
- if(mtex->texco & TEXCO_NORM) {
+ if (mtex->texco & TEXCO_NORM) {
;
}
- else if(mtex->texco & TEXCO_OBJECT) {
- if(mtex->object)
+ else if (mtex->texco & TEXCO_OBJECT) {
+ if (mtex->object)
mul_m4_v3(mtex->object->imat_ren,texvec);
}
- else if(mtex->texco & TEXCO_GLOB){
+ else if (mtex->texco & TEXCO_GLOB) {
copy_v3_v3(texvec,vec);
}
- else if(mtex->texco & TEXCO_UV && uvco){
+ else if (mtex->texco & TEXCO_UV && uvco) {
int uv_index=CustomData_get_named_layer_index(&dm->faceData,CD_MTFACE,mtex->uvname);
- if(uv_index<0)
+ if (uv_index<0)
uv_index=CustomData_get_active_layer_index(&dm->faceData,CD_MTFACE);
uv_index-=CustomData_get_layer_index(&dm->faceData,CD_MTFACE);
@@ -1141,13 +1141,13 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
texvec[1]=2.0f*uvco[2*uv_index+1]-1.0f;
texvec[2]=0.0f;
}
- else if(mtex->texco & TEXCO_PARTICLE) {
+ else if (mtex->texco & TEXCO_PARTICLE) {
/* particle coordinates in range [0,1] */
texvec[0] = 2.f * pa_co[0] - 1.f;
texvec[1] = 2.f * pa_co[1] - 1.f;
texvec[2] = pa_co[2];
}
- else if(orco) {
+ else if (orco) {
copy_v3_v3(texvec, orco);
}
@@ -1155,7 +1155,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
//yn= tin*mtex->colfac;
//zn= tin*mtex->alphafac;
- if(mtex->mapto & MAP_COL) {
+ if (mtex->mapto & MAP_COL) {
tex[0]=tr;
tex[1]=tg;
tex[2]=tb;
@@ -1174,16 +1174,16 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
}
/* alpha returned, so let's use it instead of intensity */
- if(hasrgb)
+ if (hasrgb)
tin = ta;
- if(mtex->mapto & MAP_ALPHA)
+ if (mtex->mapto & MAP_ALPHA)
har->alfa = texture_value_blend(mtex->def_var,har->alfa,tin,mtex->alphafac,mtex->blendtype);
- if(mtex->mapto & MAP_HAR)
+ if (mtex->mapto & MAP_HAR)
har->hard = 1.0f+126.0f*texture_value_blend(mtex->def_var,((float)har->hard)/127.0f,tin,mtex->hardfac,mtex->blendtype);
- if(mtex->mapto & MAP_RAYMIRR)
+ if (mtex->mapto & MAP_RAYMIRR)
har->hasize = 100.0f*texture_value_blend(mtex->def_var,har->hasize/100.0f,tin,mtex->raymirrfac,mtex->blendtype);
- if(mtex->mapto & MAP_TRANSLU) {
+ if (mtex->mapto & MAP_TRANSLU) {
float add = texture_value_blend(mtex->def_var,(float)har->add/255.0f,tin,mtex->translfac,mtex->blendtype);
CLAMP(add, 0.f, 1.f);
har->add = 255.0f*add;
@@ -1206,32 +1206,32 @@ static int panotestclip(Render *re, int do_pano, float *v)
float abs4;
short c=0;
- if(do_pano==0) return testclip(v);
+ if (do_pano==0) return testclip(v);
abs4= fabs(v[3]);
- if(v[2]< -abs4) c=16; /* this used to be " if(v[2]<0) ", see clippz() */
- else if(v[2]> abs4) c+= 32;
+ if (v[2]< -abs4) c=16; /* this used to be " if (v[2]<0) ", see clippz() */
+ else if (v[2]> abs4) c+= 32;
- if( v[1]>abs4) c+=4;
- else if( v[1]< -abs4) c+=8;
+ if ( v[1]>abs4) c+=4;
+ else if ( v[1]< -abs4) c+=8;
abs4*= re->xparts;
- if( v[0]>abs4) c+=2;
- else if( v[0]< -abs4) c+=1;
+ if ( v[0]>abs4) c+=2;
+ else if ( v[0]< -abs4) c+=1;
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))
{
@@ -1240,20 +1240,20 @@ void project_renderdata(Render *re, void (*projectfunc)(const float *, float mat
float zn, vec[3], hoco[4];
int a;
- if(do_pano) {
+ if (do_pano) {
float panophi= xoffs;
re->panosi= sin(panophi);
re->panoco= cos(panophi);
}
- for(obr=re->objecttable.first; obr; obr=obr->next) {
+ for (obr=re->objecttable.first; obr; obr=obr->next) {
/* calculate view coordinates (and zbuffer value) */
- for(a=0; a<obr->tothalo; a++) {
- if((a & 255)==0) har= obr->bloha[a>>8];
+ for (a=0; a<obr->tothalo; a++) {
+ if ((a & 255)==0) har= obr->bloha[a>>8];
else har++;
- if(do_pano) {
+ if (do_pano) {
vec[0]= re->panoco*har->co[0] + re->panosi*har->co[2];
vec[1]= har->co[1];
vec[2]= -re->panosi*har->co[0] + re->panoco*har->co[2];
@@ -1268,10 +1268,10 @@ void project_renderdata(Render *re, void (*projectfunc)(const float *, float mat
hoco[0]*= 0.5f;
hoco[1]*= 0.5f;
- if( panotestclip(re, do_pano, hoco) ) {
+ if ( panotestclip(re, do_pano, hoco) ) {
har->miny= har->maxy= -10000; /* that way render clips it */
}
- else if(hoco[3]<0.0f) {
+ else if (hoco[3]<0.0f) {
har->miny= har->maxy= -10000; /* render clips it */
}
else /* do the projection...*/
@@ -1296,8 +1296,8 @@ void project_renderdata(Render *re, void (*projectfunc)(const float *, float mat
har->rad= fabsf(har->xs- 0.5f*re->winx*(1.0f+hoco[0]/zn));
/* this clip is not really OK, to prevent stars to become too large */
- if(har->type & HA_ONLYSKY) {
- if(har->rad>3.0f) har->rad= 3.0f;
+ if (har->type & HA_ONLYSKY) {
+ if (har->rad>3.0f) har->rad= 3.0f;
}
har->radsq= har->rad*har->rad;
@@ -1334,7 +1334,7 @@ ObjectInstanceRen *RE_addRenderInstance(Render *re, ObjectRen *obr, Object *ob,
obi->psysindex= psysindex;
obi->lay= lay;
- if(mat) {
+ if (mat) {
copy_m4_m4(obi->mat, mat);
copy_m3_m4(mat3, mat);
invert_m3_m3(obi->nmat, mat3);
@@ -1360,10 +1360,10 @@ void RE_makeRenderInstances(Render *re)
newlist.first= newlist.last= NULL;
obi= re->objectinstance;
- for(oldobi=re->instancetable.first; oldobi; oldobi=oldobi->next) {
+ for (oldobi=re->instancetable.first; oldobi; oldobi=oldobi->next) {
*obi= *oldobi;
- if(obi->obr) {
+ if (obi->obr) {
obi->prev= obi->next= NULL;
BLI_addtail(&newlist, obi);
obi++;
@@ -1383,7 +1383,7 @@ int clip_render_object(float boundbox[][3], float *bounds, float winmat[][4])
copy_m4_m4(mat, winmat);
- for(a=0; a<8; a++) {
+ for (a=0; a<8; a++) {
vec[0]= (a & 1)? boundbox[0][0]: boundbox[1][0];
vec[1]= (a & 2)? boundbox[0][1]: boundbox[1][1];
vec[2]= (a & 4)? boundbox[0][2]: boundbox[1][2];
@@ -1391,25 +1391,25 @@ int clip_render_object(float boundbox[][3], float *bounds, float winmat[][4])
mul_m4_v4(mat, vec);
fl= 0;
- if(bounds) {
- if(vec[0] < bounds[0]*vec[3]) fl |= 1;
- else if(vec[0] > bounds[1]*vec[3]) fl |= 2;
+ if (bounds) {
+ if (vec[0] < bounds[0]*vec[3]) fl |= 1;
+ else if (vec[0] > bounds[1]*vec[3]) fl |= 2;
- if(vec[1] > bounds[3]*vec[3]) fl |= 4;
- else if(vec[1]< bounds[2]*vec[3]) fl |= 8;
+ if (vec[1] > bounds[3]*vec[3]) fl |= 4;
+ else if (vec[1]< bounds[2]*vec[3]) fl |= 8;
}
else {
- if(vec[0] < -vec[3]) fl |= 1;
- else if(vec[0] > vec[3]) fl |= 2;
+ if (vec[0] < -vec[3]) fl |= 1;
+ else if (vec[0] > vec[3]) fl |= 2;
- if(vec[1] > vec[3]) fl |= 4;
- else if(vec[1] < -vec[3]) fl |= 8;
+ if (vec[1] > vec[3]) fl |= 4;
+ else if (vec[1] < -vec[3]) fl |= 8;
}
- if(vec[2] < -vec[3]) fl |= 16;
- else if(vec[2] > vec[3]) fl |= 32;
+ if (vec[2] < -vec[3]) fl |= 16;
+ else if (vec[2] > vec[3]) fl |= 32;
flag &= fl;
- if(flag==0) return 0;
+ if (flag==0) return 0;
}
return flag;
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index 0cd5c361499..742d28d89b7 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
@@ -92,14 +91,14 @@ static void copy_to_ztile(int *rectz, int size, int x1, int y1, int tile, char *
x2= x1+tile;
y2= y1+tile;
- if(x2>=size) x2= size-1;
- if(y2>=size) y2= size-1;
+ if (x2>=size) x2= size-1;
+ if (y2>=size) y2= size-1;
- if(x1>=x2 || y1>=y2) return;
+ if (x1>=x2 || y1>=y2) return;
len4= 4*(x2- x1);
rz= rectz + size*y1 + x1;
- for(; y1<y2; y1++) {
+ for (; y1<y2; y1++) {
memcpy(r1, rz, len4);
rz+= size;
r1+= len4;
@@ -133,12 +132,12 @@ static float *give_jitter_tab(int samp)
static char ctab[17]= {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int a, offset=0;
- if(samp<2) samp= 2;
- else if(samp>16) samp= 16;
+ if (samp<2) samp= 2;
+ else if (samp>16) samp= 16;
- for(a=0; a<samp-1; a++) offset+= tab[a];
+ for (a=0; a<samp-1; a++) offset+= tab[a];
- if(ctab[samp]==0) {
+ if (ctab[samp]==0) {
ctab[samp]= 1;
BLI_initjit(jit[offset], samp*samp);
}
@@ -155,10 +154,10 @@ static void make_jitter_weight_tab(Render *re, ShadBuf *shb, short filtertype)
shb->weight= MEM_mallocN(sizeof(float)*tot, "weight tab lamp");
- for(jit= shb->jit, a=0; a<tot; a++, jit+=2) {
- if(filtertype==LA_SHADBUF_TENT)
+ for (jit= shb->jit, a=0; a<tot; a++, jit+=2) {
+ if (filtertype==LA_SHADBUF_TENT)
shb->weight[a]= 0.71f - sqrt(jit[0]*jit[0] + jit[1]*jit[1]);
- else if(filtertype==LA_SHADBUF_GAUSS)
+ else if (filtertype==LA_SHADBUF_GAUSS)
shb->weight[a]= RE_filter_value(R_FILTER_GAUSS, 1.8f*sqrt(jit[0]*jit[0] + jit[1]*jit[1]));
else
shb->weight[a]= 1.0f;
@@ -167,7 +166,7 @@ static void make_jitter_weight_tab(Render *re, ShadBuf *shb, short filtertype)
}
totw= 1.0f/totw;
- for(a=0; a<tot; a++) {
+ for (a=0; a<tot; a++) {
shb->weight[a]*= totw;
}
}
@@ -177,25 +176,27 @@ static int verg_deepsample(const void *poin1, const void *poin2)
const DeepSample *ds1= (const DeepSample*)poin1;
const DeepSample *ds2= (const DeepSample*)poin2;
- if(ds1->z < ds2->z) return -1;
- else if(ds1->z == ds2->z) return 0;
+ if (ds1->z < ds2->z) return -1;
+ else if (ds1->z == ds2->z) return 0;
else return 1;
}
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) {
- for(a=0, ds=dsample; a<tot; a++, ds++)
+#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;
@@ -203,17 +204,17 @@ static int compress_deepsamples(DeepSample *dsample, int tot, float epsilon)
a= 0;
/* as long as we are not at the end of the array */
- for(a++, ds++; a<tot; a++, ds++) {
+ for (a++, ds++; a<tot; a++, ds++) {
slopemin= 0.0f;
slopemax= 0.0f;
first= 1;
- for(; a<tot; a++, ds++) {
+ for (; a<tot; a++, ds++) {
//dz= ds->z - newds->z;
- if(ds->z == newds->z) {
+ if (ds->z == newds->z) {
/* still in same z position, simply check
- visibility difference against epsilon */
- if(!(fabs(newds->v - ds->v) <= epsilon)) {
+ * visibility difference against epsilon */
+ if (!(fabs(newds->v - ds->v) <= epsilon)) {
break;
}
}
@@ -224,7 +225,7 @@ static int compress_deepsamples(DeepSample *dsample, int tot, float epsilon)
max= ((ds->v + epsilon) - newds->v)*div;
/* adapt existing slopes */
- if(first) {
+ if (first) {
newmin= min;
newmax= max;
first= 0;
@@ -234,7 +235,7 @@ static int compress_deepsamples(DeepSample *dsample, int tot, float epsilon)
newmax= MIN2(slopemax, max);
/* verify if there is still space between the slopes */
- if(newmin > newmax) {
+ if (newmin > newmax) {
ds--;
a--;
break;
@@ -246,7 +247,7 @@ static int compress_deepsamples(DeepSample *dsample, int tot, float epsilon)
}
}
- if(a == tot) {
+ if (a == tot) {
ds--;
a--;
}
@@ -254,7 +255,7 @@ static int compress_deepsamples(DeepSample *dsample, int tot, float epsilon)
/* always previous z */
z= ds->z;
- if(first || a==tot-1) {
+ if (first || a==tot-1) {
/* if slopes were not initialized, use last visibility */
v= ds->v;
}
@@ -271,14 +272,16 @@ static int compress_deepsamples(DeepSample *dsample, int tot, float epsilon)
newds->v= v;
}
- if(newtot == 0 || (newds->v != (newds-1)->v))
+ if (newtot == 0 || (newds->v != (newds-1)->v))
newtot++;
- /*if(print) {
- for(a=0, ds=dsample; a<newtot; a++, ds++)
+#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;
}
@@ -288,7 +291,7 @@ static float deep_alpha(Render *re, int obinr, int facenr, int strand)
ObjectInstanceRen *obi= &re->objectinstance[obinr];
Material *ma;
- if(strand) {
+ if (strand) {
StrandRen *strand= RE_findOrAddStrand(obi->obr, facenr-1);
ma= strand->buffer->ma;
}
@@ -324,32 +327,32 @@ static void compress_deepshadowbuf(Render *re, ShadBuf *shb, APixstr *apixbuf, A
ap= apixbuf;
aps= apixbufstrand;
- for(a=0; a<size*size; a++, ap++, aps++) {
+ for (a=0; a<size*size; a++, ap++, aps++) {
/* count number of samples */
- for(c=0; c<totbuf; c++)
+ for (c=0; c<totbuf; c++)
sampletot[c]= 0;
tot= 0;
- for(apn=ap; apn; apn=apn->next)
- for(b=0; b<4; b++)
- if(apn->p[b])
- for(c=0; c<totbuf; c++)
- if(apn->mask[b] & (1<<c))
+ for (apn=ap; apn; apn=apn->next)
+ for (b=0; b<4; b++)
+ if (apn->p[b])
+ for (c=0; c<totbuf; c++)
+ if (apn->mask[b] & (1<<c))
sampletot[c]++;
- if(apixbufstrand) {
- for(apns=aps; apns; apns=apns->next)
- for(b=0; b<4; b++)
- if(apns->p[b])
- for(c=0; c<totbuf; c++)
- if(apns->mask[b] & (1<<c))
+ if (apixbufstrand) {
+ for (apns=aps; apns; apns=apns->next)
+ for (b=0; b<4; b++)
+ if (apns->p[b])
+ for (c=0; c<totbuf; c++)
+ if (apns->mask[b] & (1<<c))
sampletot[c]++;
}
- for(c=0; c<totbuf; c++)
+ for (c=0; c<totbuf; c++)
tot += sampletot[c];
- if(tot == 0) {
+ if (tot == 0) {
shsample->deepbuf[a]= NULL;
shsample->totbuf[a]= 0;
continue;
@@ -357,14 +360,14 @@ static void compress_deepshadowbuf(Render *re, ShadBuf *shb, APixstr *apixbuf, A
/* fill samples */
ds[0]= sampleds[0]= MEM_callocN(sizeof(DeepSample)*tot*2, "deepsample");
- for(c=1; c<totbuf; c++)
+ for (c=1; c<totbuf; c++)
ds[c]= sampleds[c]= sampleds[c-1] + sampletot[c-1]*2;
- for(apn=ap; apn; apn=apn->next) {
- for(b=0; b<4; b++) {
- if(apn->p[b]) {
- for(c=0; c<totbuf; c++) {
- if(apn->mask[b] & (1<<c)) {
+ for (apn=ap; apn; apn=apn->next) {
+ for (b=0; b<4; b++) {
+ if (apn->p[b]) {
+ for (c=0; c<totbuf; c++) {
+ if (apn->mask[b] & (1<<c)) {
/* two entries to create step profile */
ds[c]->z= apn->z[b];
ds[c]->v= 1.0f; /* not used */
@@ -378,12 +381,12 @@ static void compress_deepshadowbuf(Render *re, ShadBuf *shb, APixstr *apixbuf, A
}
}
- if(apixbufstrand) {
- for(apns=aps; apns; apns=apns->next) {
- for(b=0; b<4; b++) {
- if(apns->p[b]) {
- for(c=0; c<totbuf; c++) {
- if(apns->mask[b] & (1<<c)) {
+ if (apixbufstrand) {
+ for (apns=aps; apns; apns=apns->next) {
+ for (b=0; b<4; b++) {
+ if (apns->p[b]) {
+ for (c=0; c<totbuf; c++) {
+ if (apns->mask[b] & (1<<c)) {
/* two entries to create step profile */
ds[c]->z= apns->z[b];
ds[c]->v= 1.0f; /* not used */
@@ -398,7 +401,7 @@ static void compress_deepshadowbuf(Render *re, ShadBuf *shb, APixstr *apixbuf, A
}
}
- for(c=0; c<totbuf; c++) {
+ for (c=0; c<totbuf; c++) {
/* sort by increasing z */
qsort(sampleds[c], sampletot[c], sizeof(DeepSample)*2, verg_deepsample);
@@ -406,7 +409,7 @@ static void compress_deepshadowbuf(Render *re, ShadBuf *shb, APixstr *apixbuf, A
visibility= 1.0f;
ds[c]= sampleds[c];
- for(b=0; b<sampletot[c]; b++) {
+ for (b=0; b<sampletot[c]; b++) {
/* two entries creating step profile */
ds[c]->v= visibility;
ds[c]++;
@@ -418,8 +421,8 @@ static void compress_deepshadowbuf(Render *re, ShadBuf *shb, APixstr *apixbuf, A
/* halfway trick, probably won't work well for volumes? */
ds[c]= sampleds[c];
- for(b=0; b<sampletot[c]; b++) {
- if(b+1 < sampletot[c]) {
+ for (b=0; b<sampletot[c]; b++) {
+ if (b+1 < sampletot[c]) {
ds[c]->z= (ds[c]->z>>1) + ((ds[c]+2)->z>>1);
ds[c]++;
ds[c]->z= (ds[c]->z>>1) + ((ds[c]+2)->z>>1);
@@ -447,27 +450,27 @@ static void compress_deepshadowbuf(Render *re, ShadBuf *shb, APixstr *apixbuf, A
minz= 0;
found= 0;
- for(c=0; c<totbuf; c++) {
- if(sampletot[c] && (!found || ds[c]->z < minz)) {
+ for (c=0; c<totbuf; c++) {
+ if (sampletot[c] && (!found || ds[c]->z < minz)) {
minz= ds[c]->z;
found= 1;
}
}
- if(!found)
+ if (!found)
break;
dsb->z= minz;
dsb->v= 0.0f;
visibility= 0.0f;
- for(c=0; c<totbuf; c++) {
- if(sampletot[c] && ds[c]->z == minz) {
+ for (c=0; c<totbuf; c++) {
+ if (sampletot[c] && ds[c]->z == minz) {
ds[c]++;
sampletot[c]--;
}
- if(sampleds[c] == ds[c])
+ if (sampleds[c] == ds[c])
visibility += totbuf_f_inv;
else
visibility += (ds[c]-1)->v / totbuf_f;
@@ -485,7 +488,7 @@ static void compress_deepshadowbuf(Render *re, ShadBuf *shb, APixstr *apixbuf, A
shsample->totbuf[a]= newtot;
totsamplec += newtot;
- if(newtot < prevtot) {
+ if (newtot < prevtot) {
newbuf= MEM_mallocN(sizeof(DeepSample)*newtot, "cdeepsample");
memcpy(newbuf, shsample->deepbuf[a], sizeof(DeepSample)*newtot);
MEM_freeN(shsample->deepbuf[a]);
@@ -520,20 +523,20 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
/* help buffer */
rcline= MEM_mallocN(256*4+sizeof(int), "makeshadbuf2");
- for(y=0; y<size; y+=16) {
- if(y< size/2) miny= y+15-size/2;
+ for (y=0; y<size; y+=16) {
+ if (y< size/2) miny= y+15-size/2;
else miny= y-size/2;
- for(x=0; x<size; x+=16) {
+ for (x=0; x<size; x+=16) {
/* is tile within spotbundle? */
a= size/2;
- if(x< a) minx= x+15-a;
+ if (x< a) minx= x+15-a;
else minx= x-a;
dist= sqrt( (float)(minx*minx+miny*miny) );
- if(square==0 && dist>(float)(a+12)) { /* 12, tested with a onlyshadow lamp */
+ if (square==0 && dist>(float)(a+12)) { /* 12, tested with a onlyshadow lamp */
a= 256; verg= 0; /* 0x80000000; */ /* 0x7FFFFFFF; */
rz1= (&verg)+1;
}
@@ -543,11 +546,11 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
verg= (*rz1 & 0xFFFFFF00);
- for(a=0;a<256;a++,rz1++) {
- if( (*rz1 & 0xFFFFFF00) !=verg) break;
+ for (a=0;a<256;a++,rz1++) {
+ if ( (*rz1 & 0xFFFFFF00) !=verg) break;
}
}
- if(a==256) { /* complete empty tile */
+ if (a==256) { /* complete empty tile */
*ctile= 0;
*ztile= *(rz1-1);
}
@@ -561,13 +564,13 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
verg1= rc[BCOMP];
rc+= 4;
byt1= 1; byt2= 1;
- for(a=1;a<256;a++,rc+=4) {
+ for (a=1;a<256;a++,rc+=4) {
byt1 &= (verg==rc[ACOMP]);
byt2 &= (verg1==rc[BCOMP]);
- if(byt1==0) break;
+ if (byt1==0) break;
}
- if(byt1 && byt2) { /* only store byte */
+ if (byt1 && byt2) { /* only store byte */
*ctile= 1;
*ztile= (uintptr_t)MEM_mallocN(256+4, "tile1");
rz= (int *)*ztile;
@@ -575,9 +578,9 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
zt= (char *)(rz+1);
rc= rcline;
- for(a=0; a<256; a++, zt++, rc+=4) *zt= rc[GCOMP];
+ for (a=0; a<256; a++, zt++, rc+=4) *zt= rc[GCOMP];
}
- else if(byt1) { /* only store short */
+ else if (byt1) { /* only store short */
*ctile= 2;
*ztile= (uintptr_t)MEM_mallocN(2*256+4,"Tile2");
rz= (int *)*ztile;
@@ -585,7 +588,7 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
zt= (char *)(rz+1);
rc= rcline;
- for(a=0; a<256; a++, zt+=2, rc+=4) {
+ for (a=0; a<256; a++, zt+=2, rc+=4) {
zt[0]= rc[BCOMP];
zt[1]= rc[GCOMP];
}
@@ -596,7 +599,7 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
zt= (char *)*ztile;
rc= rcline;
- for(a=0; a<256; a++, zt+=3, rc+=4) {
+ for (a=0; a<256; a++, zt+=3, rc+=4) {
zt[0]= rc[ACOMP];
zt[1]= rc[BCOMP];
zt[2]= rc[GCOMP];
@@ -627,19 +630,19 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar)
minz= 1.0e30f; maxz= -1.0e30f;
copy_m4_m4(viewmat, lar->shb->viewmat);
- if(lar->mode & (LA_LAYER|LA_LAYER_SHADOW)) lay= lar->lay;
+ if (lar->mode & (LA_LAYER|LA_LAYER_SHADOW)) lay= lar->lay;
maxtotvert= 0;
- for(obr=re->objecttable.first; obr; obr=obr->next)
+ for (obr=re->objecttable.first; obr; obr=obr->next)
maxtotvert= MAX2(obr->totvert, maxtotvert);
clipflag= MEM_callocN(sizeof(char)*maxtotvert, "autoclipflag");
/* set clip in vertices when face visible */
- for(i=0, obi=re->instancetable.first; obi; i++, obi=obi->next) {
+ for (i=0, obi=re->instancetable.first; obi; i++, obi=obi->next) {
obr= obi->obr;
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mult_m4_m4m4(obviewmat, viewmat, obi->mat);
else
copy_m4_m4(obviewmat, viewmat);
@@ -647,35 +650,35 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar)
memset(clipflag, 0, sizeof(char)*obr->totvert);
/* clear clip, is being set if face is visible (clip is calculated for real later) */
- for(a=0; a<obr->totvlak; a++) {
- if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
+ for (a=0; a<obr->totvlak; a++) {
+ if ((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
else vlr++;
/* note; these conditions are copied from zbuffer_shadow() */
- if(vlr->mat!= ma) {
+ if (vlr->mat!= ma) {
ma= vlr->mat;
ok= 1;
- if((ma->mode & MA_SHADBUF)==0) ok= 0;
+ if ((ma->mode & MA_SHADBUF)==0) ok= 0;
}
- if(ok && (obi->lay & lay)) {
+ if (ok && (obi->lay & lay)) {
clipflag[vlr->v1->index]= 1;
clipflag[vlr->v2->index]= 1;
clipflag[vlr->v3->index]= 1;
- if(vlr->v4) clipflag[vlr->v4->index]= 1;
+ if (vlr->v4) clipflag[vlr->v4->index]= 1;
}
}
/* calculate min and max */
- for(a=0; a< obr->totvert;a++) {
- if((a & 255)==0) ver= RE_findOrAddVert(obr, a);
+ for (a=0; a< obr->totvert;a++) {
+ if ((a & 255)==0) ver= RE_findOrAddVert(obr, a);
else ver++;
- if(clipflag[a]) {
+ if (clipflag[a]) {
copy_v3_v3(vec, ver->co);
mul_m4_v3(obviewmat, vec);
/* Z on visible side of lamp space */
- if(vec[2] < 0.0f) {
+ if (vec[2] < 0.0f) {
float inpr, z= -vec[2];
/* since vec is rotated in lampspace, this is how to get the cosine of angle */
@@ -684,9 +687,9 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar)
normalize_v3(vec);
inpr= - vec[2];
- if(inpr>=lar->spotsi) {
- if(z<minz) minz= z;
- if(z>maxz) maxz= z;
+ if (inpr>=lar->spotsi) {
+ if (z<minz) minz= z;
+ if (z>maxz) maxz= z;
}
}
}
@@ -696,13 +699,13 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar)
MEM_freeN(clipflag);
/* set clipping min and max */
- if(minz < maxz) {
+ if (minz < maxz) {
float delta= (maxz - minz); /* threshold to prevent precision issues */
//printf("minz %f maxz %f delta %f\n", minz, maxz, delta);
- if(lar->bufflag & LA_SHADBUF_AUTO_START)
+ if (lar->bufflag & LA_SHADBUF_AUTO_START)
lar->shb->d= minz - delta*0.02f; /* 0.02 is arbitrary... needs more thinking! */
- if(lar->bufflag & LA_SHADBUF_AUTO_END)
+ if (lar->bufflag & LA_SHADBUF_AUTO_END)
lar->shb->clipend= maxz + delta*0.1f;
/* bias was calculated as percentage, we scale it to prevent animation issues */
@@ -720,12 +723,12 @@ static void makeflatshadowbuf(Render *re, LampRen *lar, float *jitbuf)
/* zbuffering */
rectz= MEM_mapallocN(sizeof(int)*shb->size*shb->size, "makeshadbuf");
- for(samples=0; samples<shb->totbuf; samples++) {
+ for (samples=0; samples<shb->totbuf; samples++) {
zbuffer_shadow(re, shb->persmat, lar, rectz, shb->size, jitbuf[2*samples], jitbuf[2*samples+1]);
/* create Z tiles (for compression): this system is 24 bits!!! */
compress_shadowbuf(shb, rectz, lar->mode & LA_SQUARE);
- if(re->test_break(re->tbh))
+ if (re->test_break(re->tbh))
break;
}
@@ -741,7 +744,7 @@ static void makedeepshadowbuf(Render *re, LampRen *lar, float *jitbuf)
/* zbuffering */
apixbuf= MEM_callocN(sizeof(APixstr)*shb->size*shb->size, "APixbuf");
- if(re->totstrand)
+ if (re->totstrand)
apixbufstrand= MEM_callocN(sizeof(APixstrand)*shb->size*shb->size, "APixbufstrand");
zbuffer_abuf_shadow(re, lar, shb->persmat, apixbuf, apixbufstrand, &apsmbase, shb->size,
@@ -751,7 +754,7 @@ static void makedeepshadowbuf(Render *re, LampRen *lar, float *jitbuf)
compress_deepshadowbuf(re, shb, apixbuf, apixbufstrand);
MEM_freeN(apixbuf);
- if(apixbufstrand)
+ if (apixbufstrand)
MEM_freeN(apixbufstrand);
freepsA(&apsmbase);
}
@@ -761,15 +764,15 @@ void makeshadowbuf(Render *re, LampRen *lar)
ShadBuf *shb= lar->shb;
float wsize, *jitbuf, twozero[2]= {0.0f, 0.0f}, angle, temp;
- if(lar->bufflag & (LA_SHADBUF_AUTO_START|LA_SHADBUF_AUTO_END))
+ if (lar->bufflag & (LA_SHADBUF_AUTO_START|LA_SHADBUF_AUTO_END))
shadowbuf_autoclip(re, lar);
- /* just to enforce identical behaviour of all irregular buffers */
- if(lar->buftype==LA_SHADBUF_IRREGULAR)
+ /* just to enforce identical behavior of all irregular buffers */
+ if (lar->buftype==LA_SHADBUF_IRREGULAR)
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);
@@ -779,7 +782,7 @@ void makeshadowbuf(Render *re, LampRen *lar)
perspective_m4( shb->winmat,-wsize, wsize, -wsize, wsize, shb->d, shb->clipend);
mult_m4_m4m4(shb->persmat, shb->winmat, shb->viewmat);
- if(ELEM3(lar->buftype, LA_SHADBUF_REGULAR, LA_SHADBUF_HALFWAY, LA_SHADBUF_DEEP)) {
+ if (ELEM3(lar->buftype, LA_SHADBUF_REGULAR, LA_SHADBUF_HALFWAY, LA_SHADBUF_DEEP)) {
shb->totbuf= lar->buffers;
/* jitter, weights - not threadsafe! */
@@ -788,12 +791,12 @@ void makeshadowbuf(Render *re, LampRen *lar)
make_jitter_weight_tab(re, shb, lar->filtertype);
BLI_unlock_thread(LOCK_CUSTOM1);
- if(shb->totbuf==4) jitbuf= give_jitter_tab(2);
- else if(shb->totbuf==9) jitbuf= give_jitter_tab(3);
+ if (shb->totbuf==4) jitbuf= give_jitter_tab(2);
+ else if (shb->totbuf==9) jitbuf= give_jitter_tab(3);
else jitbuf= twozero;
/* zbuffering */
- if(lar->buftype == LA_SHADBUF_DEEP) {
+ if (lar->buftype == LA_SHADBUF_DEEP) {
makedeepshadowbuf(re, lar, jitbuf);
shb->totbuf= 1;
}
@@ -811,8 +814,8 @@ static void *do_shadow_thread(void *re_v)
do {
BLI_lock_thread(LOCK_CUSTOM1);
- for(lar=re->lampren.first; lar; lar=lar->next) {
- if(lar->shb && !lar->thread_assigned) {
+ for (lar=re->lampren.first; lar; lar=lar->next) {
+ if (lar->shb && !lar->thread_assigned) {
lar->thread_assigned= 1;
break;
}
@@ -820,7 +823,7 @@ static void *do_shadow_thread(void *re_v)
BLI_unlock_thread(LOCK_CUSTOM1);
/* if type is irregular, this only sets the perspective matrix and autoclips */
- if(lar) {
+ if (lar) {
makeshadowbuf(re, lar);
BLI_lock_thread(LOCK_CUSTOM1);
lar->thread_ready= 1;
@@ -845,9 +848,9 @@ void threaded_makeshadowbufs(Render *re)
int (*test_break)(void *);
/* count number of threads to use */
- if(G.rendering) {
- for(lar=re->lampren.first; lar; lar= lar->next)
- if(lar->shb)
+ if (G.rendering) {
+ for (lar=re->lampren.first; lar; lar= lar->next)
+ if (lar->shb)
totthread++;
totthread= MIN2(totthread, re->r.threads);
@@ -855,10 +858,10 @@ void threaded_makeshadowbufs(Render *re)
else
totthread= 1; /* preview render */
- if(totthread <= 1) {
- for(lar=re->lampren.first; lar; lar= lar->next) {
- if(re->test_break(re->tbh)) break;
- if(lar->shb) {
+ if (totthread <= 1) {
+ for (lar=re->lampren.first; lar; lar= lar->next) {
+ if (re->test_break(re->tbh)) break;
+ if (lar->shb) {
/* if type is irregular, this only sets the perspective matrix and autoclips */
makeshadowbuf(re, lar);
}
@@ -869,26 +872,26 @@ void threaded_makeshadowbufs(Render *re)
test_break= re->test_break;
re->test_break= thread_break;
- for(lar=re->lampren.first; lar; lar= lar->next) {
+ for (lar=re->lampren.first; lar; lar= lar->next) {
lar->thread_assigned= 0;
lar->thread_ready= 0;
}
BLI_init_threads(&threads, do_shadow_thread, totthread);
- for(a=0; a<totthread; a++)
+ for (a=0; a<totthread; a++)
BLI_insert_thread(&threads, re);
/* keep rendering as long as there are shadow buffers not ready */
do {
- if((g_break=test_break(re->tbh)))
+ if ((g_break=test_break(re->tbh)))
break;
PIL_sleep_ms(50);
BLI_lock_thread(LOCK_CUSTOM1);
- for(lar=re->lampren.first; lar; lar= lar->next)
- if(lar->shb && !lar->thread_ready)
+ for (lar=re->lampren.first; lar; lar= lar->next)
+ if (lar->shb && !lar->thread_ready)
break;
BLI_unlock_thread(LOCK_CUSTOM1);
} while(lar);
@@ -903,16 +906,16 @@ void threaded_makeshadowbufs(Render *re)
void freeshadowbuf(LampRen *lar)
{
- if(lar->shb) {
+ if (lar->shb) {
ShadBuf *shb= lar->shb;
ShadSampleBuf *shsample;
int b, v;
- for(shsample= shb->buffers.first; shsample; shsample= shsample->next) {
- if(shsample->deepbuf) {
+ for (shsample= shb->buffers.first; shsample; shsample= shsample->next) {
+ if (shsample->deepbuf) {
v= shb->size*shb->size;
- for(b=0; b<v; b++)
- if(shsample->deepbuf[b])
+ for (b=0; b<v; b++)
+ if (shsample->deepbuf[b])
MEM_freeN(shsample->deepbuf[b]);
MEM_freeN(shsample->deepbuf);
@@ -923,8 +926,8 @@ void freeshadowbuf(LampRen *lar)
char *ctile= shsample->cbuf;
v= (shb->size*shb->size)/256;
- for(b=0; b<v; b++, ztile++, ctile++)
- if(*ctile) MEM_freeN((void *) *ztile);
+ for (b=0; b<v; b++, ztile++, ctile++)
+ if (*ctile) MEM_freeN((void *) *ztile);
MEM_freeN(shsample->zbuf);
MEM_freeN(shsample->cbuf);
@@ -932,7 +935,7 @@ void freeshadowbuf(LampRen *lar)
}
BLI_freelistN(&shb->buffers);
- if(shb->weight) MEM_freeN(shb->weight);
+ if (shb->weight) MEM_freeN(shb->weight);
MEM_freeN(lar->shb);
lar->shb= NULL;
@@ -946,22 +949,22 @@ static int firstreadshadbuf(ShadBuf *shb, ShadSampleBuf *shsample, int **rz, int
int ofs;
char *ct;
- if(shsample->deepbuf)
+ if (shsample->deepbuf)
return 0;
/* always test borders of shadowbuffer */
- if(xs<0) xs= 0; else if(xs>=shb->size) xs= shb->size-1;
- if(ys<0) ys= 0; else if(ys>=shb->size) ys= shb->size-1;
+ if (xs<0) xs= 0; else if (xs>=shb->size) xs= shb->size-1;
+ if (ys<0) ys= 0; else if (ys>=shb->size) ys= shb->size-1;
/* calc z */
ofs= (ys>>4)*(shb->size>>4) + (xs>>4);
ct= shsample->cbuf+ofs;
- if(*ct==0) {
- if(nr==0) {
+ if (*ct==0) {
+ if (nr==0) {
*rz= *( (int **)(shsample->zbuf+ofs) );
return 1;
}
- else if(*rz!= *( (int **)(shsample->zbuf+ofs) )) return 0;
+ else if (*rz!= *( (int **)(shsample->zbuf+ofs) )) return 0;
return 1;
}
@@ -980,21 +983,21 @@ static float readdeepvisibility(DeepSample *dsample, int tot, int z, int bias, f
ds= dsample;
for (a=0; a<tot && (z-bias > ds->z); a++, ds++) {}
- if(a == tot) {
- if(biast)
+ if (a == tot) {
+ if (biast)
*biast= 0.0f;
return (ds-1)->v; /* completely behind all samples */
}
/* check if this read needs bias blending */
- if(biast) {
- if(z > ds->z)
+ if (biast) {
+ if (z > ds->z)
*biast= (float)(z - ds->z)/(float)bias;
else
*biast= 0.0f;
}
- if(a == 0)
+ if (a == 0)
return 1.0f; /* completely in front of all samples */
/* converting to float early here because ds->z - prevds->z can overflow */
@@ -1008,18 +1011,18 @@ static float readdeepshadowbuf(ShadBuf *shb, ShadSampleBuf *shsample, int bias,
float v, biasv, biast;
int ofs, tot;
- if(zs < - 0x7FFFFE00 + bias)
+ if (zs < - 0x7FFFFE00 + bias)
return 1.0; /* extreme close to clipstart */
/* calc z */
ofs= ys*shb->size + xs;
tot= shsample->totbuf[ofs];
- if(tot == 0)
+ if (tot == 0)
return 1.0f;
v= readdeepvisibility(shsample->deepbuf[ofs], tot, zs, bias, &biast);
- if(biast != 0.0f) {
+ if (biast != 0.0f) {
/* in soft bias area */
biasv= readdeepvisibility(shsample->deepbuf[ofs], tot, zs, 0, 0);
@@ -1039,14 +1042,14 @@ static float readshadowbuf(ShadBuf *shb, ShadSampleBuf *shsample, int bias, int
char *ct, *cz;
/* simpleclip */
- /* if(xs<0 || ys<0) return 1.0; */
- /* if(xs>=shb->size || ys>=shb->size) return 1.0; */
+ /* if (xs<0 || ys<0) return 1.0; */
+ /* if (xs>=shb->size || ys>=shb->size) return 1.0; */
/* always test borders of shadowbuffer */
- if(xs<0) xs= 0; else if(xs>=shb->size) xs= shb->size-1;
- if(ys<0) ys= 0; else if(ys>=shb->size) ys= shb->size-1;
+ if (xs<0) xs= 0; else if (xs>=shb->size) xs= shb->size-1;
+ if (ys<0) ys= 0; else if (ys>=shb->size) ys= shb->size-1;
- if(shsample->deepbuf)
+ if (shsample->deepbuf)
return readdeepshadowbuf(shb, shsample, bias, xs, ys, zs);
/* calc z */
@@ -1054,14 +1057,14 @@ static float readshadowbuf(ShadBuf *shb, ShadSampleBuf *shsample, int bias, int
ct= shsample->cbuf+ofs;
rz= *( (int **)(shsample->zbuf+ofs) );
- if(*ct==3) {
+ if (*ct==3) {
ct= ((char *)rz)+3*16*(ys & 15)+3*(xs & 15);
cz= (char *)&zsamp;
cz[ACOMP]= ct[0];
cz[BCOMP]= ct[1];
cz[GCOMP]= ct[2];
}
- else if(*ct==2) {
+ else if (*ct==2) {
ct= ((char *)rz);
ct+= 4+2*16*(ys & 15)+2*(xs & 15);
zsamp= *rz;
@@ -1070,7 +1073,7 @@ static float readshadowbuf(ShadBuf *shb, ShadSampleBuf *shsample, int bias, int
cz[BCOMP]= ct[0];
cz[GCOMP]= ct[1];
}
- else if(*ct==1) {
+ else if (*ct==1) {
ct= ((char *)rz);
ct+= 4+16*(ys & 15)+(xs & 15);
zsamp= *rz;
@@ -1087,9 +1090,9 @@ static float readshadowbuf(ShadBuf *shb, ShadSampleBuf *shsample, int bias, int
/* tricky stuff here; we use ints which can overflow easily with bias values */
- if(zsamp > zs) return 1.0; /* absolute no shadow */
- else if(zs < - 0x7FFFFE00 + bias) return 1.0; /* extreme close to clipstart */
- else if(zsamp < zs-bias) return 0.0 ; /* absolute in shadow */
+ if (zsamp > zs) return 1.0; /* absolute no shadow */
+ else if (zs < - 0x7FFFFE00 + bias) return 1.0; /* extreme close to clipstart */
+ else if (zsamp < zs-bias) return 0.0; /* absolute in shadow */
else { /* soft area */
temp= ( (float)(zs- zsamp) )/(float)bias;
@@ -1109,7 +1112,7 @@ static void shadowbuf_project_co(float *x, float *y, float *z, ShadBuf *shb, con
*x= size*(1.0f+hco[0]/hco[3]);
*y= size*(1.0f+hco[1]/hco[3]);
- if(z) *z= (hco[2]/hco[3]);
+ if (z) *z= (hco[2]/hco[3]);
}
/* the externally called shadow testing (reading) function */
@@ -1123,21 +1126,21 @@ float testshadowbuf(Render *re, ShadBuf *shb, const float co[3], const float dxc
short a, num;
/* crash preventer */
- if(shb->buffers.first==NULL)
+ if (shb->buffers.first==NULL)
return 1.0f;
/* when facing away, assume fully in shadow */
- if(inp <= 0.0f)
+ if (inp <= 0.0f)
return 0.0f;
/* project coordinate to pixel space */
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 */
- if(zs1>=1.0f)
+ * (clipstart, clipend), so we can do this simple test */
+ if (zs1>=1.0f)
return 0.0f;
- else if(zs1<= -1.0f)
+ else if (zs1<= -1.0f)
return 1.0f;
zs= ((float)0x7FFFFFFF)*zs1;
@@ -1148,15 +1151,15 @@ float testshadowbuf(Render *re, ShadBuf *shb, const float co[3], const float dxc
fac= shb->soft;
/* compute z bias */
- if(mat_bias!=0.0f) biasf= shb->bias*mat_bias;
+ 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 */
- if(num==1) {
- for(shsample= shb->buffers.first; shsample; shsample= shsample->next)
+ if (num==1) {
+ for (shsample= shb->buffers.first; shsample; shsample= shsample->next)
shadfac += readshadowbuf(shb, shsample, bias, (int)xs1, (int)ys1, zs);
return shadfac/(float)shb->totbuf;
@@ -1175,20 +1178,20 @@ float testshadowbuf(Render *re, ShadBuf *shb, const float co[3], const float dxc
xres= fac*(fabs(dx[0]) + fabs(dy[0]));
yres= fac*(fabs(dx[1]) + fabs(dy[1]));
- if(xres<1.0f) xres= 1.0f;
- if(yres<1.0f) yres= 1.0f;
+ if (xres<1.0f) xres= 1.0f;
+ if (yres<1.0f) yres= 1.0f;
/* make xs1/xs1 corner of sample area */
xs1 -= xres*0.5f;
ys1 -= yres*0.5f;
/* in case we have a constant value in a tile, we can do quicker lookup */
- if(xres<16.0f && yres<16.0f) {
+ if (xres<16.0f && yres<16.0f) {
shsample= shb->buffers.first;
- if(firstreadshadbuf(shb, shsample, &rz, (int)xs1, (int)ys1, 0)) {
- if(firstreadshadbuf(shb, shsample, &rz, (int)(xs1+xres), (int)ys1, 1)) {
- if(firstreadshadbuf(shb, shsample, &rz, (int)xs1, (int)(ys1+yres), 1)) {
- if(firstreadshadbuf(shb, shsample, &rz, (int)(xs1+xres), (int)(ys1+yres), 1)) {
+ if (firstreadshadbuf(shb, shsample, &rz, (int)xs1, (int)ys1, 0)) {
+ if (firstreadshadbuf(shb, shsample, &rz, (int)(xs1+xres), (int)ys1, 1)) {
+ if (firstreadshadbuf(shb, shsample, &rz, (int)xs1, (int)(ys1+yres), 1)) {
+ if (firstreadshadbuf(shb, shsample, &rz, (int)(xs1+xres), (int)(ys1+yres), 1)) {
return readshadowbuf(shb, shsample, bias,(int)xs1, (int)ys1, zs);
}
}
@@ -1197,11 +1200,11 @@ float testshadowbuf(Render *re, ShadBuf *shb, const float co[3], const float dxc
}
/* full jittered shadow buffer lookup */
- for(shsample= shb->buffers.first; shsample; shsample= shsample->next) {
+ for (shsample= shb->buffers.first; shsample; shsample= shsample->next) {
jit= shb->jit;
weight= shb->weight;
- for(a=num; a>0; a--, jit+=2, weight++) {
+ for (a=num; a>0; a--, jit+=2, weight++) {
/* instead of jit i tried random: ugly! */
/* note: the plus 0.5 gives best sampling results, jit goes from -0.5 to 0.5 */
/* xs1 and ys1 are already corrected to be corner of sample area */
@@ -1229,15 +1232,15 @@ static float readshadowbuf_halo(ShadBuf *shb, ShadSampleBuf *shsample, int xs, i
bias= -shb->bias;
/* simpleclip */
- if(xs<0 || ys<0) return 0.0;
- if(xs>=shb->size || ys>=shb->size) return 0.0;
+ if (xs<0 || ys<0) return 0.0;
+ if (xs>=shb->size || ys>=shb->size) return 0.0;
/* calc z */
ofs= (ys>>4)*(shb->size>>4) + (xs>>4);
ct= shsample->cbuf+ofs;
rz= *( (int **)(shsample->zbuf+ofs) );
- if(*ct==3) {
+ if (*ct==3) {
ct= ((char *)rz)+3*16*(ys & 15)+3*(xs & 15);
cz= (char *)&zsamp;
zsamp= 0;
@@ -1245,7 +1248,7 @@ static float readshadowbuf_halo(ShadBuf *shb, ShadSampleBuf *shsample, int xs, i
cz[BCOMP]= ct[1];
cz[GCOMP]= ct[2];
}
- else if(*ct==2) {
+ else if (*ct==2) {
ct= ((char *)rz);
ct+= 4+2*16*(ys & 15)+2*(xs & 15);
zsamp= *rz;
@@ -1254,7 +1257,7 @@ static float readshadowbuf_halo(ShadBuf *shb, ShadSampleBuf *shsample, int xs, i
cz[BCOMP]= ct[0];
cz[GCOMP]= ct[1];
}
- else if(*ct==1) {
+ else if (*ct==1) {
ct= ((char *)rz);
ct+= 4+16*(ys & 15)+(xs & 15);
zsamp= *rz;
@@ -1271,16 +1274,16 @@ static float readshadowbuf_halo(ShadBuf *shb, ShadSampleBuf *shsample, int xs, i
/* NO schadow when sampled at 'eternal' distance */
- if(zsamp >= 0x7FFFFE00) return 1.0;
+ if (zsamp >= 0x7FFFFE00) return 1.0;
- if(zsamp > zs) return 1.0; /* absolute no shadww */
+ if (zsamp > zs) return 1.0; /* absolute no shadww */
else {
/* bias is negative, so the (zs-bias) can be beyond 0x7fffffff */
zbias= 0x7fffffff - zs;
- if(zbias > -bias) {
- if( zsamp < zs-bias) return 0.0 ; /* absolute in shadow */
+ if (zbias > -bias) {
+ if ( zsamp < zs-bias) return 0.0; /* absolute in shadow */
}
- else return 0.0 ; /* absolute shadow */
+ else return 0.0; /* absolute shadow */
}
/* soft area */
@@ -1328,8 +1331,8 @@ float shadow_halo(LampRen *lar, const float p1[3], const float p2[3])
xs1= (int)xf1;
ys1= (int)yf1;
- if(xf1 != xf2) {
- if(xf2-xf1 > 0.0f) {
+ if (xf1 != xf2) {
+ if (xf2-xf1 > 0.0f) {
labdax= (xf1-xs1-1.0f)/(xf1-xf2);
ldx= -shb->shadhalostep/(xf1-xf2);
dx= shb->shadhalostep;
@@ -1345,8 +1348,8 @@ float shadow_halo(LampRen *lar, const float p1[3], const float p2[3])
ldx= 0.0;
}
- if(yf1 != yf2) {
- if(yf2-yf1 > 0.0f) {
+ if (yf1 != yf2) {
+ if (yf2-yf1 > 0.0f) {
labday= (yf1-ys1-1.0f)/(yf1-yf2);
ldy= -shb->shadhalostep/(yf1-yf2);
dy= shb->shadhalostep;
@@ -1371,42 +1374,43 @@ float shadow_halo(LampRen *lar, const float p1[3], const float p2[3])
while(1) {
labdao= labda;
- if(labdax==labday) {
+ if (labdax==labday) {
labdax+= ldx;
x+= dx;
labday+= ldy;
y+= dy;
}
else {
- if(labdax<labday) {
+ if (labdax<labday) {
labdax+= ldx;
x+= dx;
- } else {
+ }
+ else {
labday+= ldy;
y+= dy;
}
}
labda= MIN2(labdax, labday);
- if(labda==labdao || labda>=1.0f) break;
+ if (labda==labdao || labda>=1.0f) break;
zf= zf1 + labda*(zf2-zf1);
count+= (float)shb->totbuf;
- if(zf<= -1.0f) lightcount += 1.0f; /* close to the spot */
+ if (zf<= -1.0f) lightcount += 1.0f; /* close to the spot */
else {
/* make sure, behind the clipend we extend halolines. */
- if(zf>=1.0f) z= 0x7FFFF000;
+ if (zf>=1.0f) z= 0x7FFFF000;
else z= (int)(0x7FFFF000*zf);
- for(shsample= shb->buffers.first; shsample; shsample= shsample->next)
+ for (shsample= shb->buffers.first; shsample; shsample= shsample->next)
lightcount+= readshadowbuf_halo(shb, shsample, x, y, z);
}
}
- if(count!=0.0f) return (lightcount/count);
+ if (count!=0.0f) return (lightcount/count);
return 0.0f;
}
@@ -1416,12 +1420,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) */
@@ -1459,10 +1463,10 @@ typedef struct BSPFace {
/* boxes are in lamp projection */
static void init_box(Boxf *box)
{
- box->xmin= 1000000.0f;
- box->xmax= 0;
- box->ymin= 1000000.0f;
- box->ymax= 0;
+ box->xmin = 1000000.0f;
+ box->xmax = 0;
+ box->ymin = 1000000.0f;
+ box->ymax = 0;
box->zmin= 0x7FFFFFFF;
box->zmax= - 0x7FFFFFFF;
}
@@ -1470,21 +1474,21 @@ static void init_box(Boxf *box)
/* use v1 to calculate boundbox */
static void bound_boxf(Boxf *box, const float v1[3])
{
- if(v1[0] < box->xmin) box->xmin= v1[0];
- if(v1[0] > box->xmax) box->xmax= v1[0];
- if(v1[1] < box->ymin) box->ymin= v1[1];
- if(v1[1] > box->ymax) box->ymax= v1[1];
- if(v1[2] < box->zmin) box->zmin= v1[2];
- if(v1[2] > box->zmax) box->zmax= v1[2];
+ if (v1[0] < box->xmin) box->xmin = v1[0];
+ if (v1[0] > box->xmax) box->xmax = v1[0];
+ if (v1[1] < box->ymin) box->ymin = v1[1];
+ if (v1[1] > box->ymax) box->ymax = v1[1];
+ if (v1[2] < box->zmin) box->zmin= v1[2];
+ if (v1[2] > box->zmax) box->zmax= v1[2];
}
/* use v1 to calculate boundbox */
static void bound_rectf(rctf *box, const float v1[2])
{
- if(v1[0] < box->xmin) box->xmin= v1[0];
- if(v1[0] > box->xmax) box->xmax= v1[0];
- if(v1[1] < box->ymin) box->ymin= v1[1];
- if(v1[1] > box->ymax) box->ymax= v1[1];
+ if (v1[0] < box->xmin) box->xmin = v1[0];
+ if (v1[0] > box->xmax) box->xmax = v1[0];
+ if (v1[1] < box->ymin) box->ymin = v1[1];
+ if (v1[1] > box->ymax) box->ymax = v1[1];
}
@@ -1493,7 +1497,7 @@ static void isb_bsp_split_init(ISBBranch *root, MemArena *mem, int level)
{
/* if level > 0 we create new branches and go deeper*/
- if(level > 0) {
+ if (level > 0) {
ISBBranch *left, *right;
int i;
@@ -1502,7 +1506,7 @@ static void isb_bsp_split_init(ISBBranch *root, MemArena *mem, int level)
root->divider[1]= 0.5f*(root->box.ymin+root->box.ymax);
/* find best splitpoint */
- if(root->box.xmax-root->box.xmin > root->box.ymax-root->box.ymin)
+ if (root->box.xmax-root->box.xmin > root->box.ymax-root->box.ymin)
i= root->index= 0;
else
i= root->index= 1;
@@ -1513,13 +1517,13 @@ static void isb_bsp_split_init(ISBBranch *root, MemArena *mem, int level)
/* box info */
left->box= root->box;
right->box= root->box;
- if(i==0) {
- left->box.xmax= root->divider[0];
- right->box.xmin= root->divider[0];
+ if (i==0) {
+ left->box.xmax = root->divider[0];
+ right->box.xmin = root->divider[0];
}
else {
- left->box.ymax= root->divider[1];
- right->box.ymin= root->divider[1];
+ left->box.ymax = root->divider[1];
+ right->box.ymin = root->divider[1];
}
isb_bsp_split_init(left, mem, level-1);
isb_bsp_split_init(right, mem, level-1);
@@ -1539,7 +1543,7 @@ static void isb_bsp_split(ISBBranch *root, MemArena *mem)
/* splitpoint */
root->divider[0]= root->divider[1]= 0.0f;
- for(a=BSPMAX_SAMPLE-1; a>=0; a--) {
+ for (a=BSPMAX_SAMPLE-1; a>=0; a--) {
root->divider[0]+= root->samples[a]->zco[0];
root->divider[1]+= root->samples[a]->zco[1];
}
@@ -1547,7 +1551,7 @@ static void isb_bsp_split(ISBBranch *root, MemArena *mem)
root->divider[1]/= BSPMAX_SAMPLE;
/* find best splitpoint */
- if(root->box.xmax-root->box.xmin > root->box.ymax-root->box.ymin)
+ if (root->box.xmax-root->box.xmin > root->box.ymax-root->box.ymin)
i= root->index= 0;
else
i= root->index= 1;
@@ -1561,15 +1565,15 @@ static void isb_bsp_split(ISBBranch *root, MemArena *mem)
right->samples= samples; // tmp
/* split samples */
- for(a=BSPMAX_SAMPLE-1; a>=0; a--) {
+ for (a=BSPMAX_SAMPLE-1; a>=0; a--) {
int comp= 0;
/* this prevents adding samples all to 1 branch when divider is equal to samples */
- if(root->samples[a]->zco[i] == root->divider[i])
+ if (root->samples[a]->zco[i] == root->divider[i])
comp= a & 1;
- else if(root->samples[a]->zco[i] < root->divider[i])
+ else if (root->samples[a]->zco[i] < root->divider[i])
comp= 1;
- if(comp==1) {
+ if (comp==1) {
left->samples[left->totsamp]= root->samples[a];
left->totsamp++;
}
@@ -1587,13 +1591,13 @@ static void isb_bsp_split(ISBBranch *root, MemArena *mem)
/* box info */
left->box= root->box;
right->box= root->box;
- if(i==0) {
- left->box.xmax= root->divider[0];
- right->box.xmin= root->divider[0];
+ if (i==0) {
+ left->box.xmax = root->divider[0];
+ right->box.xmin = root->divider[0];
}
else {
- left->box.ymax= root->divider[1];
- right->box.ymin= root->divider[1];
+ left->box.ymax = root->divider[1];
+ right->box.ymin = root->divider[1];
}
}
@@ -1610,7 +1614,7 @@ static int isb_bsp_insert(ISBBranch *root, MemArena *memarena, ISBSample *sample
/* going over branches until last one found */
while(bspn->left) {
- if(zco[bspn->index] <= bspn->divider[bspn->index])
+ if (zco[bspn->index] <= bspn->divider[bspn->index])
bspn= bspn->left;
else
bspn= bspn->right;
@@ -1618,7 +1622,7 @@ static int isb_bsp_insert(ISBBranch *root, MemArena *memarena, ISBSample *sample
}
/* bspn now is the last branch */
- if(bspn->totsamp==BSPMAX_SAMPLE) {
+ if (bspn->totsamp==BSPMAX_SAMPLE) {
printf("error in bsp branch\n"); /* only for debug, cannot happen */
return 1;
}
@@ -1628,8 +1632,8 @@ static int isb_bsp_insert(ISBBranch *root, MemArena *memarena, ISBSample *sample
bspn->totsamp++;
/* split if allowed and needed */
- if(bspn->totsamp==BSPMAX_SAMPLE) {
- if(i==BSPMAX_DEPTH) {
+ if (bspn->totsamp==BSPMAX_SAMPLE) {
+ if (i==BSPMAX_DEPTH) {
bspn->totsamp--; /* stop filling in... will give errors */
return 1;
}
@@ -1645,7 +1649,7 @@ static void bspface_init_strand(BSPFace *face)
face->radline= 0.5f* len_v2v2(face->v1, face->v2);
mid_v3_v3v3(face->vec1, face->v1, face->v2);
- if(face->v4)
+ if (face->v4)
mid_v3_v3v3(face->vec2, face->v3, face->v4);
else
copy_v3_v3(face->vec2, face->v3);
@@ -1656,7 +1660,7 @@ static void bspface_init_strand(BSPFace *face)
face->len= face->rc[0]*face->rc[0]+ face->rc[1]*face->rc[1];
- if(face->len!=0.0f) {
+ if (face->len!=0.0f) {
face->radline_end= face->radline/sqrt(face->len);
face->len= 1.0f/face->len;
}
@@ -1670,18 +1674,18 @@ static int point_behind_strand(const float p[3], BSPFace *face)
/* using code from dist_to_line_segment_v2(), distance vec to line-piece */
- if(face->len==0.0f) {
+ if (face->len==0.0f) {
rc[0]= p[0]-face->vec1[0];
rc[1]= p[1]-face->vec1[1];
dist= (float)(sqrt(rc[0]*rc[0]+ rc[1]*rc[1]));
- if(dist < face->radline)
+ if (dist < face->radline)
return 1;
}
else {
float labda= ( face->rc[0]*(p[0]-face->vec1[0]) + face->rc[1]*(p[1]-face->vec1[1]) )*face->len;
- if(labda > -face->radline_end && labda < 1.0f+face->radline_end) {
+ if (labda > -face->radline_end && labda < 1.0f+face->radline_end) {
/* hesse for dist: */
//dist= (float)(fabs( (p[0]-vec2[0])*rc[1] + (p[1]-vec2[1])*rc[0])/len);
@@ -1692,9 +1696,9 @@ static int point_behind_strand(const float p[3], BSPFace *face)
rc[1]= pt[1]-p[1];
dist= (float)sqrt(rc[0]*rc[0]+ rc[1]*rc[1]);
- if(dist < face->radline) {
+ if (dist < face->radline) {
float zval= face->vec1[2] + labda*face->rc[2];
- if(p[2] > zval)
+ if (p[2] > zval)
return 1;
}
}
@@ -1715,7 +1719,7 @@ static int point_behind_tria2d(const float p[3], const float v1[3], const float
c[1] = v3[1] - v1[1];
div = a[0]*c[1] - a[1]*c[0];
- if(div==0.0f)
+ if (div==0.0f)
return 0;
h[0] = p[0] - v1[0];
@@ -1724,13 +1728,13 @@ static int point_behind_tria2d(const float p[3], const float v1[3], const float
div = 1.0f/div;
u = (h[0]*c[1] - h[1]*c[0])*div;
- if(u >= 0.0f) {
+ if (u >= 0.0f) {
v = (a[0]*h[1] - a[1]*h[0])*div;
- if(v >= 0.0f) {
- if( u + v <= 1.0f) {
+ if (v >= 0.0f) {
+ if ( u + v <= 1.0f) {
/* inside, now check if point p is behind */
float z= (1.0f-u-v)*v1[2] + u*v2[2] + v*v3[2];
- if(z <= p[2])
+ if (z <= p[2])
return 1;
}
}
@@ -1755,10 +1759,10 @@ static int rect_outside_line(rctf *rect, const float v1[3], const float v2[3], c
side= a*v3[0] + b*v3[1] + c < 0.0f;
/* the four quad points */
- if( side==(rect->xmin*a + rect->ymin*b + c >= 0.0f) )
- if( side==(rect->xmax*a + rect->ymin*b + c >= 0.0f) )
- if( side==(rect->xmax*a + rect->ymax*b + c >= 0.0f) )
- if( side==(rect->xmin*a + rect->ymax*b + c >= 0.0f) )
+ if ( side==(rect->xmin*a + rect->ymin*b + c >= 0.0f) )
+ if ( side==(rect->xmax*a + rect->ymin*b + c >= 0.0f) )
+ if ( side==(rect->xmax*a + rect->ymax*b + c >= 0.0f) )
+ if ( side==(rect->xmin*a + rect->ymax*b + c >= 0.0f) )
return 1;
return 0;
}
@@ -1766,11 +1770,11 @@ static int rect_outside_line(rctf *rect, const float v1[3], const float v2[3], c
/* check if one of the triangle edges separates all rect points on 1 side */
static int rect_isect_tria(rctf *rect, const float v1[3], const float v2[3], const float v3[3])
{
- if(rect_outside_line(rect, v1, v2, v3))
+ if (rect_outside_line(rect, v1, v2, v3))
return 0;
- if(rect_outside_line(rect, v2, v3, v1))
+ if (rect_outside_line(rect, v2, v3, v1))
return 0;
- if(rect_outside_line(rect, v3, v1, v2))
+ if (rect_outside_line(rect, v3, v1, v2))
return 0;
return 1;
}
@@ -1781,18 +1785,18 @@ static void isb_bsp_face_inside(ISBBranch *bspn, BSPFace *face)
{
/* are we descending? */
- if(bspn->left) {
+ if (bspn->left) {
/* hrmf, the box struct cannot be addressed with index */
- if(bspn->index==0) {
- if(face->box.xmin <= bspn->divider[0])
+ if (bspn->index==0) {
+ if (face->box.xmin <= bspn->divider[0])
isb_bsp_face_inside(bspn->left, face);
- if(face->box.xmax > bspn->divider[0])
+ if (face->box.xmax > bspn->divider[0])
isb_bsp_face_inside(bspn->right, face);
}
else {
- if(face->box.ymin <= bspn->divider[1])
+ if (face->box.ymin <= bspn->divider[1])
isb_bsp_face_inside(bspn->left, face);
- if(face->box.ymax > bspn->divider[1])
+ if (face->box.ymax > bspn->divider[1])
isb_bsp_face_inside(bspn->right, face);
}
}
@@ -1800,42 +1804,42 @@ static void isb_bsp_face_inside(ISBBranch *bspn, BSPFace *face)
/* else: end branch reached */
int a;
- if(bspn->totsamp==0) return;
+ if (bspn->totsamp==0) return;
/* check for nodes entirely in shadow, can be skipped */
- if(bspn->totsamp==bspn->full)
+ if (bspn->totsamp==bspn->full)
return;
/* if bsp node is entirely in front of face, give up */
- if(bspn->box.zmax < face->box.zmin)
+ if (bspn->box.zmax < face->box.zmin)
return;
/* if face boundbox is outside of branch rect, give up */
- if(0==BLI_isect_rctf((rctf *)&face->box, (rctf *)&bspn->box, NULL))
+ if (0==BLI_isect_rctf((rctf *)&face->box, (rctf *)&bspn->box, NULL))
return;
/* test all points inside branch */
- for(a=bspn->totsamp-1; a>=0; a--) {
+ for (a=bspn->totsamp-1; a>=0; a--) {
ISBSample *samp= bspn->samples[a];
- if((samp->facenr!=face->facenr || samp->obi!=face->obi) && samp->shadfac) {
- if(face->box.zmin < samp->zco[2]) {
- if(BLI_in_rctf((rctf *)&face->box, samp->zco[0], samp->zco[1])) {
+ if ((samp->facenr!=face->facenr || samp->obi!=face->obi) && samp->shadfac) {
+ if (face->box.zmin < samp->zco[2]) {
+ if (BLI_in_rctf((rctf *)&face->box, samp->zco[0], samp->zco[1])) {
int inshadow= 0;
- if(face->type) {
- if(point_behind_strand(samp->zco, face))
+ if (face->type) {
+ if (point_behind_strand(samp->zco, face))
inshadow= 1;
}
- else if( point_behind_tria2d(samp->zco, face->v1, face->v2, face->v3))
+ else if ( point_behind_tria2d(samp->zco, face->v1, face->v2, face->v3))
inshadow= 1;
- else if(face->v4 && point_behind_tria2d(samp->zco, face->v1, face->v3, face->v4))
+ else if (face->v4 && point_behind_tria2d(samp->zco, face->v1, face->v3, face->v4))
inshadow= 1;
- if(inshadow) {
+ if (inshadow) {
*(samp->shadfac) += face->shad_alpha;
/* optimize; is_full means shad_alpha==4096 */
- if(*(samp->shadfac) >= 4096 || face->is_full) {
+ if (*(samp->shadfac) >= 4096 || face->is_full) {
bspn->full++;
samp->shadfac= NULL;
}
@@ -1850,15 +1854,15 @@ static void isb_bsp_face_inside(ISBBranch *bspn, BSPFace *face)
/* based on available samples, recalculate the bounding box for bsp nodes, recursive */
static void isb_bsp_recalc_box(ISBBranch *root)
{
- if(root->left) {
+ if (root->left) {
isb_bsp_recalc_box(root->left);
isb_bsp_recalc_box(root->right);
}
- else if(root->totsamp) {
+ else if (root->totsamp) {
int a;
init_box(&root->box);
- for(a=root->totsamp-1; a>=0; a--)
+ for (a=root->totsamp-1; a>=0; a--)
bound_boxf(&root->box, root->samples[a]->zco);
}
}
@@ -1875,7 +1879,7 @@ static void isb_bsp_test_strand(ZSpan *zspan, int obi, int zvlnr, float *v1, flo
face.obi= obi;
face.facenr= zvlnr & ~RE_QUAD_OFFS;
face.type= R_STRAND;
- if(R.osa)
+ if (R.osa)
face.shad_alpha= (short)ceil(4096.0f*zspan->shad_alpha/(float)R.osa);
else
face.shad_alpha= (short)ceil(4096.0f*zspan->shad_alpha);
@@ -1887,7 +1891,7 @@ static void isb_bsp_test_strand(ZSpan *zspan, int obi, int zvlnr, float *v1, flo
bound_boxf(&face.box, v1);
bound_boxf(&face.box, v2);
bound_boxf(&face.box, v3);
- if(v4)
+ if (v4)
bound_boxf(&face.box, v4);
/* optimize values */
@@ -1909,7 +1913,7 @@ static void isb_bsp_test_face(ZSpan *zspan, int obi, int zvlnr, float *v1, float
face.obi= obi;
face.facenr= zvlnr & ~RE_QUAD_OFFS;
face.type= 0;
- if(R.osa)
+ if (R.osa)
face.shad_alpha= (short)ceil(4096.0f*zspan->shad_alpha/(float)R.osa);
else
face.shad_alpha= (short)ceil(4096.0f*zspan->shad_alpha);
@@ -1921,7 +1925,7 @@ static void isb_bsp_test_face(ZSpan *zspan, int obi, int zvlnr, float *v1, float
bound_boxf(&face.box, v1);
bound_boxf(&face.box, v2);
bound_boxf(&face.box, v3);
- if(v4)
+ if (v4)
bound_boxf(&face.box, v4);
isb_bsp_face_inside((ISBBranch *)zspan->rectz, &face);
@@ -1932,11 +1936,11 @@ static int testclip_minmax(const float ho[4], const float minmax[4])
float wco= ho[3];
int flag= 0;
- if( ho[0] > minmax[1]*wco) flag = 1;
- else if( ho[0]< minmax[0]*wco) flag = 2;
+ if ( ho[0] > minmax[1]*wco) flag = 1;
+ else if ( ho[0]< minmax[0]*wco) flag = 2;
- if( ho[1] > minmax[3]*wco) flag |= 4;
- else if( ho[1]< minmax[2]*wco) flag |= 8;
+ if ( ho[1] > minmax[3]*wco) flag |= 4;
+ else if ( ho[1]< minmax[2]*wco) flag |= 8;
return flag;
}
@@ -1963,7 +1967,7 @@ static void isb_bsp_fillfaces(Render *re, LampRen *lar, ISBBranch *root)
minmaxf[2]= (2.0f*root->box.ymin - size-2.0f)/size;
minmaxf[3]= (2.0f*root->box.ymax - size+2.0f)/size;
- if(lar->mode & (LA_LAYER|LA_LAYER_SHADOW)) lay= lar->lay;
+ if (lar->mode & (LA_LAYER|LA_LAYER_SHADOW)) lay= lar->lay;
/* (ab)use zspan, since we use zbuffer clipping code */
zbuf_alloc_span(&zspan, size, size, re->clipcrop);
@@ -1982,29 +1986,29 @@ static void isb_bsp_fillfaces(Render *re, LampRen *lar, ISBBranch *root)
zspan.zbuffunc= isb_bsp_test_face;
zspanstrand.zbuffunc= isb_bsp_test_strand;
- for(i=0, obi=re->instancetable.first; obi; i++, obi=obi->next) {
+ for (i=0, obi=re->instancetable.first; obi; i++, obi=obi->next) {
obr= obi->obr;
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mult_m4_m4m4(winmat, shb->persmat, obi->mat);
else
copy_m4_m4(winmat, shb->persmat);
- for(a=0; a<obr->totvlak; a++) {
+ for (a=0; a<obr->totvlak; a++) {
- if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
+ if ((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
else vlr++;
/* note, these conditions are copied in shadowbuf_autoclip() */
- if(vlr->mat!= ma) {
+ if (vlr->mat!= ma) {
ma= vlr->mat;
ok= 1;
- if((ma->mode & MA_SHADBUF)==0) ok= 0;
- if(ma->material_type == MA_TYPE_WIRE) ok= 0;
+ if ((ma->mode & MA_SHADBUF)==0) ok= 0;
+ if (ma->material_type == MA_TYPE_WIRE) ok= 0;
zspanstrand.shad_alpha= zspan.shad_alpha= ma->shad_alpha;
}
- if(ok && (obi->lay & lay)) {
+ if (ok && (obi->lay & lay)) {
float hoco[4][4];
int c1, c2, c3, c4=0;
int d1, d2, d3, d4=0;
@@ -2014,32 +2018,32 @@ static void isb_bsp_fillfaces(Render *re, LampRen *lar, ISBBranch *root)
projectvert(vlr->v1->co, winmat, hoco[0]); d1= testclip_minmax(hoco[0], minmaxf);
projectvert(vlr->v2->co, winmat, hoco[1]); d2= testclip_minmax(hoco[1], minmaxf);
projectvert(vlr->v3->co, winmat, hoco[2]); d3= testclip_minmax(hoco[2], minmaxf);
- if(vlr->v4) {
+ if (vlr->v4) {
projectvert(vlr->v4->co, winmat, hoco[3]); d4= testclip_minmax(hoco[3], minmaxf);
}
/* minmax clipping */
- if(vlr->v4) partclip= d1 & d2 & d3 & d4;
+ if (vlr->v4) partclip= d1 & d2 & d3 & d4;
else partclip= d1 & d2 & d3;
- if(partclip==0) {
+ if (partclip==0) {
/* window clipping */
c1= testclip(hoco[0]);
c2= testclip(hoco[1]);
c3= testclip(hoco[2]);
- if(vlr->v4)
+ if (vlr->v4)
c4= testclip(hoco[3]);
/* ***** NO WIRE YET */
- if(ma->material_type == MA_TYPE_WIRE) {
- if(vlr->v4)
+ if (ma->material_type == MA_TYPE_WIRE) {
+ if (vlr->v4)
zbufclipwire(&zspan, i, a+1, vlr->ec, hoco[0], hoco[1], hoco[2], hoco[3], c1, c2, c3, c4);
else
zbufclipwire(&zspan, i, a+1, vlr->ec, hoco[0], hoco[1], hoco[2], 0, c1, c2, c3, 0);
}
- else if(vlr->v4) {
- if(vlr->flag & R_STRAND)
+ else if (vlr->v4) {
+ if (vlr->flag & R_STRAND)
zbufclip4(&zspanstrand, i, a+1, hoco[0], hoco[1], hoco[2], hoco[3], c1, c2, c3, c4);
else
zbufclip4(&zspan, i, a+1, hoco[0], hoco[1], hoco[2], hoco[3], c1, c2, c3, c4);
@@ -2063,7 +2067,7 @@ static int viewpixel_to_lampbuf(ShadBuf *shb, ObjectInstanceRen *obi, VlakRen *v
RE_vlakren_get_normal(&R, obi, vlr, nor);
copy_v3_v3(v1, vlr->v1->co);
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mul_m4_v3(obi->mat, v1);
/* from shadepixel() */
@@ -2071,7 +2075,7 @@ static int viewpixel_to_lampbuf(ShadBuf *shb, ObjectInstanceRen *obi, VlakRen *v
hoco[3]= 1.0f;
/* ortho viewplane cannot intersect using view vector originating in (0,0,0) */
- if(R.r.mode & R_ORTHO) {
+ if (R.r.mode & R_ORTHO) {
/* x and y 3d coordinate can be derived from pixel coord and winmat */
float fx= 2.0f/(R.winx*R.winmat[0][0]);
float fy= 2.0f/(R.winy*R.winmat[1][1]);
@@ -2080,7 +2084,7 @@ static int viewpixel_to_lampbuf(ShadBuf *shb, ObjectInstanceRen *obi, VlakRen *v
hoco[1]= (y - 0.5f*R.winy)*fy - R.winmat[3][1]/R.winmat[1][1];
/* using a*x + b*y + c*z = d equation, (a b c) is normal */
- if(nor[2]!=0.0f)
+ if (nor[2]!=0.0f)
hoco[2]= (dface - nor[0]*hoco[0] - nor[1]*hoco[1])/nor[2];
else
hoco[2]= 0.0f;
@@ -2107,11 +2111,11 @@ static int viewpixel_to_lampbuf(ShadBuf *shb, ObjectInstanceRen *obi, VlakRen *v
/* clip We can test for -1.0/1.0 because of the properties of the
* coordinate transformations. */
fac= fabs(hoco[3]);
- if(hoco[0]<-fac || hoco[0]>fac)
+ if (hoco[0]<-fac || hoco[0]>fac)
return 0;
- if(hoco[1]<-fac || hoco[1]>fac)
+ if (hoco[1]<-fac || hoco[1]>fac)
return 0;
- if(hoco[2]<-fac || hoco[2]>fac)
+ if (hoco[2]<-fac || hoco[2]>fac)
return 0;
siz= 0.5f*(float)shb->size;
@@ -2132,7 +2136,7 @@ static void isb_add_shadfac(ISBShadfacA **isbsapp, MemArena *mem, int obi, int f
float shadfacf;
/* in osa case, the samples were filled in with factor 1.0/R.osa. if fewer samples we have to correct */
- if(R.osa)
+ if (R.osa)
shadfacf= ((float)shadfac*R.osa)/(4096.0f*samples);
else
shadfacf= ((float)shadfac)/(4096.0f);
@@ -2141,7 +2145,7 @@ static void isb_add_shadfac(ISBShadfacA **isbsapp, MemArena *mem, int obi, int f
new->obi= obi;
new->facenr= facenr & ~RE_QUAD_OFFS;
new->shadfac= shadfacf;
- if(*isbsapp)
+ if (*isbsapp)
new->next= (*isbsapp);
else
new->next= NULL;
@@ -2158,25 +2162,25 @@ static int isb_add_samples(RenderPart *pa, ISBBranch *root, MemArena *memarena,
/* bsp split doesn't like to handle regular sequences */
xcos= MEM_mallocN( pa->rectx*sizeof(int), "xcos");
ycos= MEM_mallocN( pa->recty*sizeof(int), "ycos");
- for(xi=0; xi<pa->rectx; xi++)
+ for (xi=0; xi<pa->rectx; xi++)
xcos[xi]= xi;
- for(yi=0; yi<pa->recty; yi++)
+ for (yi=0; yi<pa->recty; yi++)
ycos[yi]= yi;
BLI_array_randomize(xcos, sizeof(int), pa->rectx, 12345);
BLI_array_randomize(ycos, sizeof(int), pa->recty, 54321);
- for(sample=0; sample<(R.osa?R.osa:1); sample++) {
+ for (sample=0; sample<(R.osa?R.osa:1); sample++) {
ISBSample *samp= samplebuf[sample], *samp1;
- for(yi=0; yi<pa->recty; yi++) {
+ for (yi=0; yi<pa->recty; yi++) {
int y= ycos[yi];
- for(xi=0; xi<pa->rectx; xi++) {
+ for (xi=0; xi<pa->rectx; xi++) {
int x= xcos[xi];
samp1= samp + y*pa->rectx + x;
- if(samp1->facenr)
+ if (samp1->facenr)
bsp_err |= isb_bsp_insert(root, memarena, samp1);
}
- if(bsp_err) break;
+ if (bsp_err) break;
}
}
@@ -2212,47 +2216,47 @@ static void isb_make_buffer(RenderPart *pa, LampRen *lar)
BLI_memarena_use_calloc(memarena);
/* samplebuf is in camera view space (pixels) */
- for(sample=0; sample<(R.osa?R.osa:1); sample++)
+ for (sample=0; sample<(R.osa?R.osa:1); sample++)
samplebuf[sample]= MEM_callocN(sizeof(ISBSample)*pa->rectx*pa->recty, "isb samplebuf");
/* for end result, ISBSamples point to this in non OSA case, otherwise to pixstruct->shadfac */
- if(R.osa==0)
+ if (R.osa==0)
isbdata->shadfacs= MEM_callocN(pa->rectx*pa->recty*sizeof(short), "isb shadfacs");
/* setup bsp root */
memset(&root, 0, sizeof(ISBBranch));
- root.box.xmin= (float)shb->size;
- root.box.ymin= (float)shb->size;
+ root.box.xmin = (float)shb->size;
+ root.box.ymin = (float)shb->size;
/* create the sample buffers */
- for(sindex=0, y=0; y<pa->recty; y++) {
- for(x=0; x<pa->rectx; x++, sindex++) {
+ for (sindex=0, y=0; y<pa->recty; y++) {
+ for (x=0; x<pa->rectx; x++, sindex++) {
/* this makes it a long function, but splitting it out would mean 10+ arguments */
/* first check OSA case */
- if(R.osa) {
+ if (R.osa) {
rd= pa->rectdaps + sindex;
- if(*rd) {
+ if (*rd) {
float xs= (float)(x + pa->disprect.xmin);
float ys= (float)(y + pa->disprect.ymin);
- for(sample=0; sample<R.osa; sample++) {
+ for (sample=0; sample<R.osa; sample++) {
PixStr *ps= (PixStr *)(*rd);
int mask= (1<<sample);
while(ps) {
- if(ps->mask & mask)
+ if (ps->mask & mask)
break;
ps= ps->next;
}
- if(ps && ps->facenr>0) {
+ if (ps && ps->facenr>0) {
ObjectInstanceRen *obi= &R.objectinstance[ps->obi];
ObjectRen *obr= obi->obr;
VlakRen *vlr= RE_findOrAddVlak(obr, (ps->facenr-1) & RE_QUAD_MASK);
samp= samplebuf[sample] + sindex;
/* convert image plane pixel location to lamp buffer space */
- if(viewpixel_to_lampbuf(shb, obi, vlr, xs + R.jit[sample][0], ys + R.jit[sample][1], samp->zco)) {
+ if (viewpixel_to_lampbuf(shb, obi, vlr, xs + R.jit[sample][0], ys + R.jit[sample][1], samp->zco)) {
samp->obi= ps->obi;
samp->facenr= ps->facenr & ~RE_QUAD_OFFS;
ps->shadfac= 0;
@@ -2266,7 +2270,7 @@ static void isb_make_buffer(RenderPart *pa, LampRen *lar)
else {
rectp= pa->rectp + sindex;
recto= pa->recto + sindex;
- if(*rectp>0) {
+ if (*rectp>0) {
ObjectInstanceRen *obi= &R.objectinstance[*recto];
ObjectRen *obr= obi->obr;
VlakRen *vlr= RE_findOrAddVlak(obr, (*rectp-1) & RE_QUAD_MASK);
@@ -2275,7 +2279,7 @@ static void isb_make_buffer(RenderPart *pa, LampRen *lar)
samp= samplebuf[0] + sindex;
/* convert image plane pixel location to lamp buffer space */
- if(viewpixel_to_lampbuf(shb, obi, vlr, xs, ys, samp->zco)) {
+ if (viewpixel_to_lampbuf(shb, obi, vlr, xs, ys, samp->zco)) {
samp->obi= *recto;
samp->facenr= *rectp & ~RE_QUAD_OFFS;
samp->shadfac= isbdata->shadfacs + sindex;
@@ -2287,7 +2291,7 @@ static void isb_make_buffer(RenderPart *pa, LampRen *lar)
}
/* simple method to see if we have samples */
- if(root.box.xmin != (float)shb->size) {
+ if (root.box.xmin != (float)shb->size) {
/* now create a regular split, root.box has the initial bounding box of all pixels */
/* split bsp 8 levels deep, in regular grid (16 x 16) */
isb_bsp_split_init(&root, memarena, 8);
@@ -2295,24 +2299,24 @@ static void isb_make_buffer(RenderPart *pa, LampRen *lar)
/* insert all samples in BSP now */
bsp_err= isb_add_samples(pa, &root, memarena, samplebuf);
- if(bsp_err==0) {
+ if (bsp_err==0) {
/* go over all faces and fill in shadow values */
isb_bsp_fillfaces(&R, lar, &root); /* shb->persmat should have been calculated */
/* copy shadow samples to persistent buffer, reduce memory overhead */
- if(R.osa) {
+ if (R.osa) {
ISBShadfacA **isbsa= isbdata->shadfaca= MEM_callocN(pa->rectx*pa->recty*sizeof(void *), "isb shadfacs");
isbdata->memarena = BLI_memarena_new(0x8000 * sizeof(ISBSampleA), "isb arena");
BLI_memarena_use_calloc(isbdata->memarena);
- for(rd= pa->rectdaps, x=pa->rectx*pa->recty; x>0; x--, rd++, isbsa++) {
+ for (rd= pa->rectdaps, x=pa->rectx*pa->recty; x>0; x--, rd++, isbsa++) {
- if(*rd) {
+ if (*rd) {
PixStr *ps= (PixStr *)(*rd);
while(ps) {
- if(ps->shadfac)
+ if (ps->shadfac)
isb_add_shadfac(isbsa, isbdata->memarena, ps->obi, ps->facenr, ps->shadfac, count_mask(ps->mask));
ps= ps->next;
}
@@ -2322,7 +2326,7 @@ static void isb_make_buffer(RenderPart *pa, LampRen *lar)
}
}
else {
- if(isbdata->shadfacs) {
+ if (isbdata->shadfacs) {
MEM_freeN(isbdata->shadfacs);
isbdata->shadfacs= NULL;
}
@@ -2332,10 +2336,10 @@ static void isb_make_buffer(RenderPart *pa, LampRen *lar)
BLI_memarena_free(memarena);
/* free samples */
- for(x=0; x<(R.osa?R.osa:1); x++)
+ for (x=0; x<(R.osa?R.osa:1); x++)
MEM_freeN(samplebuf[x]);
- if(bsp_err) printf("error in filling bsp\n");
+ if (bsp_err) printf("error in filling bsp\n");
}
/* add sample to buffer, isbsa is the root sample in a buffer */
@@ -2344,7 +2348,7 @@ static ISBSampleA *isb_alloc_sample_transp(ISBSampleA **isbsa, MemArena *mem)
ISBSampleA *new;
new= BLI_memarena_alloc(mem, sizeof(ISBSampleA));
- if(*isbsa)
+ if (*isbsa)
new->next= (*isbsa);
else
new->next= NULL;
@@ -2362,19 +2366,19 @@ static int isb_add_samples_transp(RenderPart *pa, ISBBranch *root, MemArena *mem
/* bsp split doesn't like to handle regular sequences */
xcos= MEM_mallocN( pa->rectx*sizeof(int), "xcos");
ycos= MEM_mallocN( pa->recty*sizeof(int), "ycos");
- for(xi=0; xi<pa->rectx; xi++)
+ for (xi=0; xi<pa->rectx; xi++)
xcos[xi]= xi;
- for(yi=0; yi<pa->recty; yi++)
+ for (yi=0; yi<pa->recty; yi++)
ycos[yi]= yi;
BLI_array_randomize(xcos, sizeof(int), pa->rectx, 12345);
BLI_array_randomize(ycos, sizeof(int), pa->recty, 54321);
- for(sample=0; sample<(R.osa?R.osa:1); sample++) {
+ for (sample=0; sample<(R.osa?R.osa:1); sample++) {
ISBSampleA **samp= samplebuf[sample], *samp1;
- for(yi=0; yi<pa->recty; yi++) {
+ for (yi=0; yi<pa->recty; yi++) {
int y= ycos[yi];
- for(xi=0; xi<pa->rectx; xi++) {
+ for (xi=0; xi<pa->rectx; xi++) {
int x= xcos[xi];
samp1= *(samp + y*pa->rectx + x);
@@ -2383,7 +2387,7 @@ static int isb_add_samples_transp(RenderPart *pa, ISBBranch *root, MemArena *mem
samp1= samp1->next;
}
}
- if(bsp_err) break;
+ if (bsp_err) break;
}
}
@@ -2420,27 +2424,27 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la
BLI_memarena_use_calloc(memarena);
/* samplebuf is in camera view space (pixels) */
- for(sample=0; sample<(R.osa?R.osa:1); sample++)
+ for (sample=0; sample<(R.osa?R.osa:1); sample++)
samplebuf[sample]= MEM_callocN(sizeof(void *)*pa->rectx*pa->recty, "isb alpha samplebuf");
/* setup bsp root */
memset(&root, 0, sizeof(ISBBranch));
- root.box.xmin= (float)shb->size;
- root.box.ymin= (float)shb->size;
+ root.box.xmin = (float)shb->size;
+ root.box.ymin = (float)shb->size;
/* create the sample buffers */
- for(ap= apixbuf, sindex=0, y=0; y<pa->recty; y++) {
- for(x=0; x<pa->rectx; x++, sindex++, ap++) {
+ for (ap= apixbuf, sindex=0, y=0; y<pa->recty; y++) {
+ for (x=0; x<pa->rectx; x++, sindex++, ap++) {
- if(ap->p[0]) {
+ if (ap->p[0]) {
APixstr *apn;
float xs= (float)(x + pa->disprect.xmin);
float ys= (float)(y + pa->disprect.ymin);
- for(apn=ap; apn; apn= apn->next) {
+ for (apn=ap; apn; apn= apn->next) {
int a;
- for(a=0; a<4; a++) {
- if(apn->p[a]) {
+ for (a=0; a<4; a++) {
+ if (apn->p[a]) {
ObjectInstanceRen *obi= &R.objectinstance[apn->obi[a]];
ObjectRen *obr= obi->obr;
VlakRen *vlr= RE_findOrAddVlak(obr, (apn->p[a]-1) & RE_QUAD_MASK);
@@ -2449,14 +2453,14 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la
/* here we store shadfac, easier to create the end storage buffer. needs zero'ed, multiple shadowbufs use it */
apn->shadfac[a]= 0;
- if(R.osa) {
- for(sample=0; sample<R.osa; sample++) {
+ if (R.osa) {
+ for (sample=0; sample<R.osa; sample++) {
int mask= (1<<sample);
- if(apn->mask[a] & mask) {
+ if (apn->mask[a] & mask) {
/* convert image plane pixel location to lamp buffer space */
- if(viewpixel_to_lampbuf(shb, obi, vlr, xs + R.jit[sample][0], ys + R.jit[sample][1], zco)) {
+ if (viewpixel_to_lampbuf(shb, obi, vlr, xs + R.jit[sample][0], ys + R.jit[sample][1], zco)) {
samp= isb_alloc_sample_transp(samplebuf[sample] + sindex, memarena);
samp->obi= apn->obi[a];
samp->facenr= apn->p[a] & ~RE_QUAD_OFFS;
@@ -2471,7 +2475,7 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la
else {
/* convert image plane pixel location to lamp buffer space */
- if(viewpixel_to_lampbuf(shb, obi, vlr, xs, ys, zco)) {
+ if (viewpixel_to_lampbuf(shb, obi, vlr, xs, ys, zco)) {
samp= isb_alloc_sample_transp(samplebuf[0] + sindex, memarena);
samp->obi= apn->obi[a];
@@ -2490,7 +2494,7 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la
}
/* simple method to see if we have samples */
- if(root.box.xmin != (float)shb->size) {
+ if (root.box.xmin != (float)shb->size) {
/* now create a regular split, root.box has the initial bounding box of all pixels */
/* split bsp 8 levels deep, in regular grid (16 x 16) */
isb_bsp_split_init(&root, memarena, 8);
@@ -2498,7 +2502,7 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la
/* insert all samples in BSP now */
bsp_err= isb_add_samples_transp(pa, &root, memarena, samplebuf);
- if(bsp_err==0) {
+ if (bsp_err==0) {
ISBShadfacA **isbsa;
/* go over all faces and fill in shadow values */
@@ -2509,15 +2513,15 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la
isbdata->memarena = BLI_memarena_new(0x8000 * sizeof(ISBSampleA), "isb arena");
- for(ap= apixbuf, x=pa->rectx*pa->recty; x>0; x--, ap++, isbsa++) {
+ for (ap= apixbuf, x=pa->rectx*pa->recty; x>0; x--, ap++, isbsa++) {
- if(ap->p[0]) {
+ if (ap->p[0]) {
APixstr *apn;
- for(apn=ap; apn; apn= apn->next) {
+ for (apn=ap; apn; apn= apn->next) {
int a;
- for(a=0; a<4; a++) {
- if(apn->p[a] && apn->shadfac[a]) {
- if(R.osa)
+ for (a=0; a<4; a++) {
+ if (apn->p[a] && apn->shadfac[a]) {
+ if (R.osa)
isb_add_shadfac(isbsa, isbdata->memarena, apn->obi[a], apn->p[a], apn->shadfac[a], count_mask(apn->mask[a]));
else
isb_add_shadfac(isbsa, isbdata->memarena, apn->obi[a], apn->p[a], apn->shadfac[a], 0);
@@ -2533,10 +2537,10 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la
BLI_memarena_free(memarena);
/* free samples */
- for(x=0; x<(R.osa?R.osa:1); x++)
+ for (x=0; x<(R.osa?R.osa:1); x++)
MEM_freeN(samplebuf[x]);
- if(bsp_err) printf("error in filling bsp\n");
+ if (bsp_err) printf("error in filling bsp\n");
}
@@ -2548,18 +2552,18 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la
float ISB_getshadow(ShadeInput *shi, ShadBuf *shb)
{
/* if raytracing, we can't accept irregular shadow */
- if(shi->depth==0) {
+ if (shi->depth==0) {
ISBData *isbdata= shb->isb_result[shi->thread];
- if(isbdata) {
- if(isbdata->shadfacs || isbdata->shadfaca) {
+ if (isbdata) {
+ if (isbdata->shadfacs || isbdata->shadfaca) {
int x= shi->xs - isbdata->minx;
- if(x >= 0 && x < isbdata->rectx) {
+ if (x >= 0 && x < isbdata->rectx) {
int y= shi->ys - isbdata->miny;
- if(y >= 0 && y < isbdata->recty) {
- if(isbdata->shadfacs) {
+ if (y >= 0 && y < isbdata->recty) {
+ if (isbdata->shadfacs) {
short *sp= isbdata->shadfacs + y*isbdata->rectx + x;
return *sp>=4096?0.0f:1.0f - ((float)*sp)/4096.0f;
}
@@ -2569,7 +2573,7 @@ float ISB_getshadow(ShadeInput *shi, ShadBuf *shb)
ISBShadfacA *isbsa= *(isbdata->shadfaca + sindex);
while(isbsa) {
- if(isbsa->facenr==shi->facenr+1 && isbsa->obi==obi)
+ if (isbsa->facenr==shi->facenr+1 && isbsa->obi==obi)
return isbsa->shadfac>=1.0f?0.0f:1.0f - isbsa->shadfac;
isbsa= isbsa->next;
}
@@ -2588,15 +2592,15 @@ void ISB_create(RenderPart *pa, APixstr *apixbuf)
GroupObject *go;
/* go over all lamps, and make the irregular buffers */
- for(go=R.lights.first; go; go= go->next) {
+ for (go=R.lights.first; go; go= go->next) {
LampRen *lar= go->lampren;
- if(lar->type==LA_SPOT && lar->shb && lar->buftype==LA_SHADBUF_IRREGULAR) {
+ if (lar->type==LA_SPOT && lar->shb && lar->buftype==LA_SHADBUF_IRREGULAR) {
/* create storage for shadow, per thread */
lar->shb->isb_result[pa->thread]= MEM_callocN(sizeof(ISBData), "isb data");
- if(apixbuf)
+ if (apixbuf)
isb_make_buffer_transp(pa, apixbuf, lar);
else
isb_make_buffer(pa, lar);
@@ -2611,19 +2615,19 @@ void ISB_free(RenderPart *pa)
GroupObject *go;
/* go over all lamps, and free the irregular buffers */
- for(go=R.lights.first; go; go= go->next) {
+ for (go=R.lights.first; go; go= go->next) {
LampRen *lar= go->lampren;
- if(lar->type==LA_SPOT && lar->shb && lar->buftype==LA_SHADBUF_IRREGULAR) {
+ if (lar->type==LA_SPOT && lar->shb && lar->buftype==LA_SHADBUF_IRREGULAR) {
ISBData *isbdata= lar->shb->isb_result[pa->thread];
- if(isbdata) {
- if(isbdata->shadfacs)
+ if (isbdata) {
+ if (isbdata->shadfacs)
MEM_freeN(isbdata->shadfacs);
- if(isbdata->shadfaca)
+ if (isbdata->shadfaca)
MEM_freeN(isbdata->shadfaca);
- if(isbdata->memarena)
+ if (isbdata->memarena)
BLI_memarena_free(isbdata->memarena);
MEM_freeN(isbdata);
diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c
index 052f9769b4e..611c21cf0f2 100644
--- a/source/blender/render/intern/source/shadeinput.c
+++ b/source/blender/render/intern/source/shadeinput.c
@@ -66,32 +66,33 @@
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
-
- */
-
-/* initialise material variables in shadeinput,
+#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 */
void shade_input_init_material(ShadeInput *shi)
{
@@ -107,7 +108,7 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr)
shade_lamp_loop(shi, shr); /* clears shr */
- if(shi->translucency!=0.0f) {
+ if (shi->translucency!=0.0f) {
ShadeResult shr_t;
float fac= shi->translucency;
@@ -120,11 +121,11 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr)
/* a couple of passes */
VECADDISFAC(shr->combined, shr_t.combined, fac);
- if(shi->passflag & SCE_PASS_SPEC)
+ if (shi->passflag & SCE_PASS_SPEC)
VECADDISFAC(shr->spec, shr_t.spec, fac);
- if(shi->passflag & SCE_PASS_DIFFUSE)
+ if (shi->passflag & SCE_PASS_DIFFUSE)
VECADDISFAC(shr->diff, shr_t.diff, fac);
- if(shi->passflag & SCE_PASS_SHADOW)
+ if (shi->passflag & SCE_PASS_SHADOW)
VECADDISFAC(shr->shad, shr_t.shad, fac);
negate_v3(shi->vn);
@@ -132,20 +133,20 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr)
}
/* depth >= 1 when ray-shading */
- if(shi->depth==0 || shi->volume_depth > 0) {
- if(R.r.mode & R_RAYTRACE) {
- if(shi->ray_mirror!=0.0f || ((shi->mode & MA_TRANSP) && (shi->mode & MA_RAYTRANSP) && shr->alpha!=1.0f)) {
+ if (shi->depth==0 || shi->volume_depth > 0) {
+ if (R.r.mode & R_RAYTRACE) {
+ if (shi->ray_mirror!=0.0f || ((shi->mode & MA_TRANSP) && (shi->mode & MA_RAYTRANSP) && shr->alpha!=1.0f)) {
/* ray trace works on combined, but gives pass info */
ray_trace(shi, shr);
}
}
/* disable adding of sky for raytransp */
- if((shi->mode & MA_TRANSP) && (shi->mode & MA_RAYTRANSP))
- if((shi->layflag & SCE_LAY_SKY) && (R.r.alphamode==R_ADDSKY))
+ if ((shi->mode & MA_TRANSP) && (shi->mode & MA_RAYTRANSP))
+ if ((shi->layflag & SCE_LAY_SKY) && (R.r.alphamode==R_ADDSKY))
shr->alpha= 1.0f;
}
- if(R.r.mode & R_RAYTRACE) {
+ if (R.r.mode & R_RAYTRACE) {
if (R.render_volumes_inside.first)
shade_volume_inside(shi, shr);
}
@@ -162,7 +163,7 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
memset(&shi->raycounter, 0, sizeof(shi->raycounter));
#endif
- if(shi->mat->nodetree && shi->mat->use_nodes) {
+ if (shi->mat->nodetree && shi->mat->use_nodes) {
ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
}
else {
@@ -170,36 +171,37 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
shade_input_init_material(shi);
if (shi->mat->material_type == MA_TYPE_VOLUME) {
- if(R.r.mode & R_RAYTRACE) {
+ if (R.r.mode & R_RAYTRACE) {
shade_volume_outside(shi, shr);
}
- } else { /* MA_TYPE_SURFACE, MA_TYPE_WIRE */
+ }
+ else { /* MA_TYPE_SURFACE, MA_TYPE_WIRE */
shade_material_loop(shi, shr);
}
}
/* copy additional passes */
- if(shi->passflag & (SCE_PASS_VECTOR|SCE_PASS_NORMAL)) {
+ if (shi->passflag & (SCE_PASS_VECTOR|SCE_PASS_NORMAL)) {
copy_v4_v4(shr->winspeed, shi->winspeed);
copy_v3_v3(shr->nor, shi->vn);
}
/* MIST */
- if((shi->passflag & SCE_PASS_MIST) || ((R.wrld.mode & WO_MIST) && (shi->mat->mode & MA_NOMIST)==0)) {
- if(R.r.mode & R_ORTHO)
+ if ((shi->passflag & SCE_PASS_MIST) || ((R.wrld.mode & WO_MIST) && (shi->mat->mode & MA_NOMIST)==0)) {
+ if (R.r.mode & R_ORTHO)
shr->mist= mistfactor(-shi->co[2], shi->co);
else
shr->mist= mistfactor(len_v3(shi->co), shi->co);
}
else shr->mist= 0.0f;
- if((R.wrld.mode & WO_MIST) && (shi->mat->mode & MA_NOMIST)==0 ) {
+ if ((R.wrld.mode & WO_MIST) && (shi->mat->mode & MA_NOMIST)==0 ) {
alpha= shr->mist;
}
else alpha= 1.0f;
/* add mist and premul color */
- if(shr->alpha!=1.0f || alpha!=1.0f) {
+ if (shr->alpha!=1.0f || alpha!=1.0f) {
float fac= alpha*(shr->alpha);
shr->combined[3]= fac;
@@ -213,15 +215,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);
}
@@ -239,15 +241,15 @@ void vlr_set_uv_indices(VlakRen *vlr, int *i1, int *i2, int *i3)
/* 1---2 1---2 0 = orig face, 1 = new face */
/* Update vert nums to point to correct verts of original face */
- if(vlr->flag & R_DIVIDE_24) {
- if(vlr->flag & R_FACE_SPLIT) {
+ if (vlr->flag & R_DIVIDE_24) {
+ if (vlr->flag & R_FACE_SPLIT) {
(*i1)++; (*i2)++; (*i3)++;
}
else {
(*i3)++;
}
}
- else if(vlr->flag & R_FACE_SPLIT) {
+ else if (vlr->flag & R_FACE_SPLIT) {
(*i2)++; (*i3)++;
}
}
@@ -281,12 +283,12 @@ void shade_input_set_triangle_i(ShadeInput *shi, ObjectInstanceRen *obi, VlakRen
RE_vlakren_get_normal(&R, obi, vlr, shi->facenor);
/* calculate vertexnormals */
- if(vlr->flag & R_SMOOTH) {
+ if (vlr->flag & R_SMOOTH) {
copy_v3_v3(shi->n1, shi->v1->n);
copy_v3_v3(shi->n2, shi->v2->n);
copy_v3_v3(shi->n3, shi->v3->n);
- if(obi->flag & R_TRANSFORMED) {
+ if (obi->flag & R_TRANSFORMED) {
mul_m3_v3(obi->nmat, shi->n1); normalize_v3(shi->n1);
mul_m3_v3(obi->nmat, shi->n2); normalize_v3(shi->n2);
mul_m3_v3(obi->nmat, shi->n3); normalize_v3(shi->n3);
@@ -294,21 +296,21 @@ 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)
*/
/* copy data from face to ShadeInput, scanline case */
void shade_input_set_triangle(ShadeInput *shi, volatile int obi, volatile int facenr, int UNUSED(normal_flip))
{
- if(facenr>0) {
+ if (facenr>0) {
shi->obi= &R.objectinstance[obi];
shi->obr= shi->obi->obr;
shi->facenr= (facenr-1) & RE_QUAD_MASK;
- if( shi->facenr < shi->obr->totvlak ) {
+ if ( shi->facenr < shi->obr->totvlak ) {
VlakRen *vlr= RE_findOrAddVlak(shi->obr, shi->facenr);
- if(facenr & RE_QUAD_OFFS)
+ if (facenr & RE_QUAD_OFFS)
shade_input_set_triangle_i(shi, shi->obi, vlr, 0, 2, 3);
else
shade_input_set_triangle_i(shi, shi->obi, vlr, 0, 1, 2);
@@ -344,7 +346,7 @@ void shade_input_set_strand(ShadeInput *shi, StrandRen *strand, StrandPoint *spo
shi->xs= (int)spoint->x;
shi->ys= (int)spoint->y;
- if(shi->osatex || (R.r.mode & R_SHADOW)) {
+ if (shi->osatex || (R.r.mode & R_SHADOW)) {
copy_v3_v3(shi->dxco, spoint->dtco);
copy_v3_v3(shi->dyco, spoint->dsco);
}
@@ -355,7 +357,7 @@ void shade_input_set_strand(ShadeInput *shi, StrandRen *strand, StrandPoint *spo
copy_v3_v3(shi->facenor, spoint->nor);
/* shade_input_set_normals equivalent */
- if(shi->mat->mode & MA_TANGENT_STR) {
+ if (shi->mat->mode & MA_TANGENT_STR) {
copy_v3_v3(shi->vn, spoint->tan);
}
else {
@@ -365,7 +367,7 @@ void shade_input_set_strand(ShadeInput *shi, StrandRen *strand, StrandPoint *spo
cross_v3_v3v3(shi->vn, cross, spoint->tan);
normalize_v3(shi->vn);
- if(dot_v3v3(shi->vn, shi->view) < 0.0f)
+ if (dot_v3v3(shi->vn, shi->view) < 0.0f)
negate_v3(shi->vn);
}
@@ -380,57 +382,57 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
int mode= shi->mode; /* or-ed result for all nodes */
short texco= shi->mat->texco;
- if((shi->mat->texco & TEXCO_REFL)) {
+ if ((shi->mat->texco & TEXCO_REFL)) {
/* shi->dxview, shi->dyview, not supported */
}
- if(shi->osatex && (texco & (TEXCO_NORM|TEXCO_REFL))) {
+ if (shi->osatex && (texco & (TEXCO_NORM|TEXCO_REFL))) {
/* not supported */
}
- if(mode & (MA_TANGENT_V|MA_NORMAP_TANG)) {
+ if (mode & (MA_TANGENT_V|MA_NORMAP_TANG)) {
copy_v3_v3(shi->tang, spoint->tan);
copy_v3_v3(shi->nmaptang, spoint->tan);
}
- if(mode & MA_STR_SURFDIFF) {
+ if (mode & MA_STR_SURFDIFF) {
float *surfnor= RE_strandren_get_surfnor(obr, strand, 0);
- if(surfnor)
+ if (surfnor)
copy_v3_v3(shi->surfnor, surfnor);
else
copy_v3_v3(shi->surfnor, shi->vn);
- if(shi->mat->strand_surfnor > 0.0f) {
+ if (shi->mat->strand_surfnor > 0.0f) {
shi->surfdist= 0.0f;
- for(sv=strand->vert; sv!=svert; sv++)
+ for (sv=strand->vert; sv!=svert; sv++)
shi->surfdist+=len_v3v3(sv->co, (sv+1)->co);
shi->surfdist += spoint->t*len_v3v3(sv->co, (sv+1)->co);
}
}
- if(R.r.mode & R_SPEED) {
+ if (R.r.mode & R_SPEED) {
float *speed;
speed= RE_strandren_get_winspeed(shi->obi, strand, 0);
- if(speed)
+ if (speed)
copy_v4_v4(shi->winspeed, speed);
else
shi->winspeed[0]= shi->winspeed[1]= shi->winspeed[2]= shi->winspeed[3]= 0.0f;
}
/* shade_input_set_shade_texco equivalent */
- if(texco & NEED_UV) {
- if(texco & TEXCO_ORCO) {
+ if (texco & NEED_UV) {
+ if (texco & TEXCO_ORCO) {
copy_v3_v3(shi->lo, strand->orco);
/* no shi->osatex, orco derivatives are zero */
}
- if(texco & TEXCO_GLOB) {
+ if (texco & TEXCO_GLOB) {
copy_v3_v3(shi->gl, shi->co);
mul_m4_v3(R.viewinv, shi->gl);
- if(shi->osatex) {
+ if (shi->osatex) {
copy_v3_v3(shi->dxgl, shi->dxco);
mul_mat3_m4_v3(R.viewinv, shi->dxgl);
copy_v3_v3(shi->dygl, shi->dyco);
@@ -438,16 +440,16 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
}
}
- if(texco & TEXCO_STRAND) {
+ if (texco & TEXCO_STRAND) {
shi->strandco= spoint->strandco;
- if(shi->osatex) {
+ if (shi->osatex) {
shi->dxstrand= spoint->dtstrandco;
shi->dystrand= 0.0f;
}
}
- if((texco & TEXCO_UV) || (mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE))) {
+ if ((texco & TEXCO_UV) || (mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE))) {
MCol *mcol;
float *uv;
char *name;
@@ -458,7 +460,7 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
shi->actuv= obr->actmtface;
shi->actcol= obr->actmcol;
- if(mode & (MA_VERTEXCOL|MA_VERTEXCOLP)) {
+ if (mode & (MA_VERTEXCOL|MA_VERTEXCOLP)) {
for (i=0; (mcol=RE_strandren_get_mcol(obr, strand, i, &name, 0)); i++) {
ShadeInputCol *scol= &shi->col[i];
char *cp= (char*)mcol;
@@ -472,7 +474,7 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
scol->col[3]= cp[0]/255.0f;
}
- if(shi->totcol) {
+ if (shi->totcol) {
shi->vcol[0]= shi->col[shi->actcol].col[0];
shi->vcol[1]= shi->col[shi->actcol].col[1];
shi->vcol[2]= shi->col[shi->actcol].col[2];
@@ -492,7 +494,7 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
shi->totuv++;
suv->name= name;
- if(strandbuf->overrideuv == i) {
+ if (strandbuf->overrideuv == i) {
suv->uv[0]= -1.0f;
suv->uv[1]= spoint->strandco;
suv->uv[2]= 0.0f;
@@ -503,15 +505,15 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
suv->uv[2]= 0.0f; /* texture.c assumes there are 3 coords */
}
- if(shi->osatex) {
+ if (shi->osatex) {
suv->dxuv[0]= 0.0f;
suv->dxuv[1]= 0.0f;
suv->dyuv[0]= 0.0f;
suv->dyuv[1]= 0.0f;
}
- if((mode & MA_FACETEXTURE) && i==obr->actmtface) {
- if((mode & (MA_VERTEXCOL|MA_VERTEXCOLP))==0) {
+ if ((mode & MA_FACETEXTURE) && i==obr->actmtface) {
+ if ((mode & (MA_VERTEXCOL|MA_VERTEXCOLP))==0) {
shi->vcol[0]= 1.0f;
shi->vcol[1]= 1.0f;
shi->vcol[2]= 1.0f;
@@ -520,14 +522,14 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
}
}
- if(shi->totuv == 0) {
+ if (shi->totuv == 0) {
ShadeInputUV *suv= &shi->uv[0];
suv->uv[0]= 0.0f;
suv->uv[1]= spoint->strandco;
suv->uv[2]= 0.0f; /* texture.c assumes there are 3 coords */
- if(mode & MA_FACETEXTURE) {
+ if (mode & MA_FACETEXTURE) {
/* no tface? set at 1.0f */
shi->vcol[0]= 1.0f;
shi->vcol[1]= 1.0f;
@@ -538,18 +540,18 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
}
- if(texco & TEXCO_NORM) {
+ if (texco & TEXCO_NORM) {
shi->orn[0]= -shi->vn[0];
shi->orn[1]= -shi->vn[1];
shi->orn[2]= -shi->vn[2];
}
- if(texco & TEXCO_STRESS) {
+ if (texco & TEXCO_STRESS) {
/* not supported */
}
- if(texco & TEXCO_TANGENT) {
- if((mode & MA_TANGENT_V)==0) {
+ if (texco & TEXCO_TANGENT) {
+ if ((mode & MA_TANGENT_V)==0) {
/* just prevent surprises */
shi->tang[0]= shi->tang[1]= shi->tang[2]= 0.0f;
shi->nmaptang[0]= shi->nmaptang[1]= shi->nmaptang[2]= 0.0f;
@@ -558,14 +560,14 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
}
/* this only avalailable for scanline renders */
- if(shi->depth==0) {
- if(texco & TEXCO_WINDOW) {
+ if (shi->depth==0) {
+ if (texco & TEXCO_WINDOW) {
shi->winco[0]= -1.0f + 2.0f*spoint->x/(float)R.winx;
shi->winco[1]= -1.0f + 2.0f*spoint->y/(float)R.winy;
shi->winco[2]= 0.0f;
/* not supported */
- if(shi->osatex) {
+ if (shi->osatex) {
shi->dxwin[0]= 0.0f;
shi->dywin[1]= 0.0f;
shi->dxwin[0]= 0.0f;
@@ -573,13 +575,13 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
}
}
- if(texco & TEXCO_STICKY) {
+ if (texco & TEXCO_STICKY) {
/* not supported */
}
}
if (shi->do_manage) {
- if(mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE)) {
+ if (mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE)) {
srgb_to_linearrgb_v3_v3(shi->vcol, shi->vcol);
}
}
@@ -592,10 +594,10 @@ void shade_input_calc_viewco(ShadeInput *shi, float x, float y, float z, float v
/* returns not normalized, so is in viewplane coords */
calc_view_vector(view, x, y);
- if(shi->mat->material_type == MA_TYPE_WIRE) {
+ if (shi->mat->material_type == MA_TYPE_WIRE) {
/* wire cannot use normal for calculating shi->co, so
* we reconstruct the coordinate less accurate */
- if(R.r.mode & R_ORTHO)
+ if (R.r.mode & R_ORTHO)
calc_renderco_ortho(co, x, y, z);
else
calc_renderco_zbuf(co, view, z);
@@ -605,13 +607,13 @@ void shade_input_calc_viewco(ShadeInput *shi, float x, float y, float z, float v
float fac, dface, v1[3];
copy_v3_v3(v1, shi->v1->co);
- if(shi->obi->flag & R_TRANSFORMED)
+ if (shi->obi->flag & R_TRANSFORMED)
mul_m4_v3(shi->obi->mat, v1);
dface = dot_v3v3(v1, shi->facenor);
/* ortho viewplane cannot intersect using view vector originating in (0,0,0) */
- if(R.r.mode & R_ORTHO) {
+ if (R.r.mode & R_ORTHO) {
/* x and y 3d coordinate can be derived from pixel coord and winmat */
float fx= 2.0f/(R.winx*R.winmat[0][0]);
float fy= 2.0f/(R.winy*R.winmat[1][1]);
@@ -620,28 +622,28 @@ void shade_input_calc_viewco(ShadeInput *shi, float x, float y, float z, float v
co[1]= (y - 0.5f*R.winy)*fy - R.winmat[3][1]/R.winmat[1][1];
/* using a*x + b*y + c*z = d equation, (a b c) is normal */
- if(shi->facenor[2]!=0.0f)
+ if (shi->facenor[2]!=0.0f)
co[2]= (dface - shi->facenor[0]*co[0] - shi->facenor[1]*co[1])/shi->facenor[2];
else
co[2]= 0.0f;
- if(dxco && dyco) {
+ if (dxco && dyco) {
dxco[0]= fx;
dxco[1]= 0.0f;
- if(shi->facenor[2]!=0.0f)
+ if (shi->facenor[2]!=0.0f)
dxco[2]= -(shi->facenor[0]*fx)/shi->facenor[2];
else
dxco[2]= 0.0f;
dyco[0]= 0.0f;
dyco[1]= fy;
- if(shi->facenor[2]!=0.0f)
+ if (shi->facenor[2]!=0.0f)
dyco[2]= -(shi->facenor[1]*fy)/shi->facenor[2];
else
dyco[2]= 0.0f;
- if(dxyview) {
- if(co[2]!=0.0f) fac= 1.0f/co[2]; else fac= 0.0f;
+ if (dxyview) {
+ if (co[2]!=0.0f) fac= 1.0f/co[2]; else fac= 0.0f;
dxyview[0]= -R.viewdx*fac;
dxyview[1]= -R.viewdy*fac;
}
@@ -659,7 +661,7 @@ void shade_input_calc_viewco(ShadeInput *shi, float x, float y, float z, float v
co[2]= fac*view[2];
/* pixel dx/dy for render coord */
- if(dxco && dyco) {
+ if (dxco && dyco) {
float u= dface/(div - R.viewdx*shi->facenor[0]);
float v= dface/(div - R.viewdy*shi->facenor[1]);
@@ -671,8 +673,8 @@ void shade_input_calc_viewco(ShadeInput *shi, float x, float y, float z, float v
dyco[1]= co[1]- (view[1]-R.viewdy)*v;
dyco[2]= co[2]- (view[2])*v;
- if(dxyview) {
- if(fac!=0.0f) fac= 1.0f/fac;
+ if (dxyview) {
+ if (fac!=0.0f) fac= 1.0f/fac;
dxyview[0]= -R.viewdx*fac;
dxyview[1]= -R.viewdy*fac;
}
@@ -703,11 +705,11 @@ void shade_input_set_viewco(ShadeInput *shi, float x, float y, float xs, float y
shi->scanco[2]= z;
/* check if we need derivatives */
- if(shi->osatex || (R.r.mode & R_SHADOW)) {
+ if (shi->osatex || (R.r.mode & R_SHADOW)) {
dxco= shi->dxco;
dyco= shi->dyco;
- if((shi->mat->texco & TEXCO_REFL))
+ if ((shi->mat->texco & TEXCO_REFL))
dxyview= &shi->dxview;
}
@@ -719,27 +721,27 @@ void shade_input_set_uv(ShadeInput *shi)
{
VlakRen *vlr= shi->vlr;
- if((vlr->flag & R_SMOOTH) || (shi->mat->texco & NEED_UV) || (shi->passflag & SCE_PASS_UV)) {
+ if ((vlr->flag & R_SMOOTH) || (shi->mat->texco & NEED_UV) || (shi->passflag & SCE_PASS_UV)) {
float v1[3], v2[3], v3[3];
copy_v3_v3(v1, shi->v1->co);
copy_v3_v3(v2, shi->v2->co);
copy_v3_v3(v3, shi->v3->co);
- if(shi->obi->flag & R_TRANSFORMED) {
+ if (shi->obi->flag & R_TRANSFORMED) {
mul_m4_v3(shi->obi->mat, v1);
mul_m4_v3(shi->obi->mat, v2);
mul_m4_v3(shi->obi->mat, v3);
}
/* exception case for wire render of edge */
- if(vlr->v2==vlr->v3) {
+ if (vlr->v2==vlr->v3) {
float lend, lenc;
lend= len_v3v3(v2, v1);
lenc= len_v3v3(shi->co, v1);
- if(lend==0.0f) {
+ if (lend==0.0f) {
shi->u=shi->v= 0.0f;
}
else {
@@ -747,7 +749,7 @@ void shade_input_set_uv(ShadeInput *shi)
shi->v= 0.0f;
}
- if(shi->osatex) {
+ if (shi->osatex) {
shi->dx_u= 0.0f;
shi->dx_v= 0.0f;
shi->dy_u= 0.0f;
@@ -773,7 +775,7 @@ void shade_input_set_uv(ShadeInput *shi)
shi->u= (shi->co[axis1]-v3[axis1])*t11-(shi->co[axis2]-v3[axis2])*t10;
shi->v= (shi->co[axis2]-v3[axis2])*t00-(shi->co[axis1]-v3[axis1])*t01;
- if(shi->osatex) {
+ if (shi->osatex) {
shi->dx_u= shi->dxco[axis1]*t11- shi->dxco[axis2]*t10;
shi->dx_v= shi->dxco[axis2]*t00- shi->dxco[axis1]*t01;
shi->dy_u= shi->dyco[axis1]*t11- shi->dyco[axis2]*t10;
@@ -795,18 +797,18 @@ void shade_input_set_normals(ShadeInput *shi)
shi->flippednor = 0;
/* test flip normals to viewing direction */
- if(!(shi->vlr->flag & R_TANGENT)) {
- if(dot_v3v3(shi->facenor, shi->view) < 0.0f) {
+ if (!(shi->vlr->flag & R_TANGENT)) {
+ if (dot_v3v3(shi->facenor, shi->view) < 0.0f) {
negate_v3(shi->facenor);
shi->flippednor= 1;
}
}
/* calculate vertexnormals */
- if(shi->vlr->flag & R_SMOOTH) {
+ if (shi->vlr->flag & R_SMOOTH) {
float *n1= shi->n1, *n2= shi->n2, *n3= shi->n3;
- if(shi->flippednor) {
+ if (shi->flippednor) {
negate_v3(n1);
negate_v3(n2);
negate_v3(n3);
@@ -821,8 +823,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);
}
@@ -831,8 +832,8 @@ void shade_input_set_normals(ShadeInput *shi)
copy_v3_v3(shi->vno, shi->vn);
/* flip normals to viewing direction */
- if(!(shi->vlr->flag & R_TANGENT))
- if(dot_v3v3(shi->facenor, shi->view) < 0.0f)
+ if (!(shi->vlr->flag & R_TANGENT))
+ if (dot_v3v3(shi->facenor, shi->view) < 0.0f)
shade_input_flip_normals(shi);
}
@@ -843,7 +844,7 @@ void shade_input_set_vertex_normals(ShadeInput *shi)
float l= 1.0f+u+v;
/* calculate vertexnormals */
- if(shi->vlr->flag & R_SMOOTH) {
+ if (shi->vlr->flag & R_SMOOTH) {
float *n1= shi->n1, *n2= shi->n2, *n3= shi->n3;
shi->vn[0]= l*n3[0]-u*n1[0]-v*n2[0];
@@ -855,8 +856,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);
}
@@ -899,9 +899,9 @@ void shade_input_set_shade_texco(ShadeInput *shi)
short texco= shi->mat->texco;
/* calculate dxno */
- if(shi->vlr->flag & R_SMOOTH) {
+ if (shi->vlr->flag & R_SMOOTH) {
- if(shi->osatex && (texco & (TEXCO_NORM|TEXCO_REFL)) ) {
+ if (shi->osatex && (texco & (TEXCO_NORM|TEXCO_REFL)) ) {
float *n1= shi->n1, *n2= shi->n2, *n3= shi->n3;
dl= shi->dx_u+shi->dx_v;
@@ -921,14 +921,14 @@ void shade_input_set_shade_texco(ShadeInput *shi)
float *tangent, *s1, *s2, *s3;
float tl, tu, tv;
- if(shi->vlr->flag & R_SMOOTH) {
+ if (shi->vlr->flag & R_SMOOTH) {
tl= l;
tu= u;
tv= v;
}
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;
@@ -937,17 +937,17 @@ void shade_input_set_shade_texco(ShadeInput *shi)
shi->tang[0]= shi->tang[1]= shi->tang[2]= 0.0f;
shi->nmaptang[0]= shi->nmaptang[1]= shi->nmaptang[2]= 0.0f;
- if(mode & MA_TANGENT_V) {
+ if (mode & MA_TANGENT_V) {
s1 = RE_vertren_get_tangent(obr, v1, 0);
s2 = RE_vertren_get_tangent(obr, v2, 0);
s3 = RE_vertren_get_tangent(obr, v3, 0);
- if(s1 && s2 && s3) {
+ if (s1 && s2 && s3) {
shi->tang[0]= (tl*s3[0] - tu*s1[0] - tv*s2[0]);
shi->tang[1]= (tl*s3[1] - tu*s1[1] - tv*s2[1]);
shi->tang[2]= (tl*s3[2] - tu*s1[2] - tv*s2[2]);
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mul_m3_v3(obi->nmat, shi->tang);
normalize_v3(shi->tang);
@@ -955,10 +955,10 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
}
- if(mode & MA_NORMAP_TANG || R.flag & R_NEED_TANGENT) {
+ if (mode & MA_NORMAP_TANG || R.flag & R_NEED_TANGENT) {
tangent= RE_vlakren_get_nmap_tangent(obr, shi->vlr, 0);
- if(tangent) {
+ if (tangent) {
int j1= shi->i1, j2= shi->i2, j3= shi->i3;
float c0[3], c1[3], c2[3];
@@ -970,8 +970,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);
@@ -990,12 +989,12 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
}
- if(mode & MA_STR_SURFDIFF) {
+ if (mode & MA_STR_SURFDIFF) {
float *surfnor= RE_vlakren_get_surfnor(obr, shi->vlr, 0);
- if(surfnor) {
+ if (surfnor) {
copy_v3_v3(shi->surfnor, surfnor);
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mul_m3_v3(obi->nmat, shi->surfnor);
}
else
@@ -1004,13 +1003,13 @@ void shade_input_set_shade_texco(ShadeInput *shi)
shi->surfdist= 0.0f;
}
- if(R.r.mode & R_SPEED) {
+ if (R.r.mode & R_SPEED) {
float *s1, *s2, *s3;
s1= RE_vertren_get_winspeed(obi, v1, 0);
s2= RE_vertren_get_winspeed(obi, v2, 0);
s3= RE_vertren_get_winspeed(obi, v3, 0);
- if(s1 && s2 && s3) {
+ if (s1 && s2 && s3) {
shi->winspeed[0]= (l*s3[0] - u*s1[0] - v*s2[0]);
shi->winspeed[1]= (l*s3[1] - u*s1[1] - v*s2[1]);
shi->winspeed[2]= (l*s3[2] - u*s1[2] - v*s2[2]);
@@ -1022,14 +1021,14 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
/* pass option forces UV calc */
- if(shi->passflag & SCE_PASS_UV)
+ if (shi->passflag & SCE_PASS_UV)
texco |= (NEED_UV|TEXCO_UV);
/* texture coordinates. shi->dxuv shi->dyuv have been set */
- if(texco & NEED_UV) {
+ if (texco & NEED_UV) {
- if(texco & TEXCO_ORCO) {
- if(v1->orco) {
+ if (texco & TEXCO_ORCO) {
+ if (v1->orco) {
float *o1, *o2, *o3;
o1= v1->orco;
@@ -1040,7 +1039,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
shi->lo[1]= l*o3[1]-u*o1[1]-v*o2[1];
shi->lo[2]= l*o3[2]-u*o1[2]-v*o2[2];
- if(shi->osatex) {
+ if (shi->osatex) {
dl= shi->dx_u+shi->dx_v;
shi->dxlo[0]= dl*o3[0]-shi->dx_u*o1[0]-shi->dx_v*o2[0];
shi->dxlo[1]= dl*o3[1]-shi->dx_u*o1[1]-shi->dx_v*o2[1];
@@ -1055,10 +1054,10 @@ void shade_input_set_shade_texco(ShadeInput *shi)
copy_v3_v3(shi->duplilo, obi->dupliorco);
}
- if(texco & TEXCO_GLOB) {
+ if (texco & TEXCO_GLOB) {
copy_v3_v3(shi->gl, shi->co);
mul_m4_v3(R.viewinv, shi->gl);
- if(shi->osatex) {
+ if (shi->osatex) {
copy_v3_v3(shi->dxgl, shi->dxco);
mul_mat3_m4_v3(R.viewinv, shi->dxgl);
copy_v3_v3(shi->dygl, shi->dyco);
@@ -1066,9 +1065,9 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
}
- if(texco & TEXCO_STRAND) {
+ if (texco & TEXCO_STRAND) {
shi->strandco= (l*v3->accum - u*v1->accum - v*v2->accum);
- if(shi->osatex) {
+ if (shi->osatex) {
dl= shi->dx_u+shi->dx_v;
shi->dxstrand= dl*v3->accum-shi->dx_u*v1->accum-shi->dx_v*v2->accum;
dl= shi->dy_u+shi->dy_v;
@@ -1076,7 +1075,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
}
- if((texco & TEXCO_UV) || (mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE))) {
+ if ((texco & TEXCO_UV) || (mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE))) {
VlakRen *vlr= shi->vlr;
MTFace *tface;
MCol *mcol;
@@ -1091,7 +1090,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
shi->actuv= obr->actmtface;
shi->actcol= obr->actmcol;
- if(mode & (MA_VERTEXCOL|MA_VERTEXCOLP)) {
+ if (mode & (MA_VERTEXCOL|MA_VERTEXCOLP)) {
for (i=0; (mcol=RE_vlakren_get_mcol(obr, vlr, i, &name, 0)); i++) {
ShadeInputCol *scol= &shi->col[i];
char *cp1, *cp2, *cp3;
@@ -1121,7 +1120,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
}
- if(shi->totcol) {
+ if (shi->totcol) {
shi->vcol[0]= shi->col[shi->actcol].col[0];
shi->vcol[1]= shi->col[shi->actcol].col[1];
shi->vcol[2]= shi->col[shi->actcol].col[2];
@@ -1150,7 +1149,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
suv->uv[1]= -1.0f + 2.0f*(l*uv3[1]-u*uv1[1]-v*uv2[1]);
suv->uv[2]= 0.0f; /* texture.c assumes there are 3 coords */
- if(shi->osatex) {
+ if (shi->osatex) {
float duv[2];
dl= shi->dx_u+shi->dx_v;
@@ -1168,14 +1167,14 @@ void shade_input_set_shade_texco(ShadeInput *shi)
suv->dyuv[1]= 2.0f*(dl*uv3[1]-duv[0]*uv1[1]-duv[1]*uv2[1]);
}
- if((mode & MA_FACETEXTURE) && i==obr->actmtface) {
- if((mode & (MA_VERTEXCOL|MA_VERTEXCOLP))==0) {
+ if ((mode & MA_FACETEXTURE) && i==obr->actmtface) {
+ if ((mode & (MA_VERTEXCOL|MA_VERTEXCOLP))==0) {
shi->vcol[0]= 1.0f;
shi->vcol[1]= 1.0f;
shi->vcol[2]= 1.0f;
shi->vcol[3]= 1.0f;
}
- if(tface->tpage) {
+ if (tface->tpage) {
render_realtime_texture(shi, tface->tpage);
}
}
@@ -1187,14 +1186,14 @@ void shade_input_set_shade_texco(ShadeInput *shi)
shi->dupliuv[1]= -1.0f + 2.0f*obi->dupliuv[1];
shi->dupliuv[2]= 0.0f;
- if(shi->totuv == 0) {
+ if (shi->totuv == 0) {
ShadeInputUV *suv= &shi->uv[0];
suv->uv[0]= 2.0f*(u+.5f);
suv->uv[1]= 2.0f*(v+.5f);
suv->uv[2]= 0.0f; /* texture.c assumes there are 3 coords */
- if(mode & MA_FACETEXTURE) {
+ if (mode & MA_FACETEXTURE) {
/* no tface? set at 1.0f */
shi->vcol[0]= 1.0f;
shi->vcol[1]= 1.0f;
@@ -1204,28 +1203,28 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
}
- if(texco & TEXCO_NORM) {
+ if (texco & TEXCO_NORM) {
shi->orn[0]= -shi->vn[0];
shi->orn[1]= -shi->vn[1];
shi->orn[2]= -shi->vn[2];
}
- if(texco & TEXCO_STRESS) {
+ if (texco & TEXCO_STRESS) {
float *s1, *s2, *s3;
s1= RE_vertren_get_stress(obr, v1, 0);
s2= RE_vertren_get_stress(obr, v2, 0);
s3= RE_vertren_get_stress(obr, v3, 0);
- if(s1 && s2 && s3) {
+ if (s1 && s2 && s3) {
shi->stress= l*s3[0] - u*s1[0] - v*s2[0];
- if(shi->stress<1.0f) shi->stress-= 1.0f;
+ if (shi->stress<1.0f) shi->stress-= 1.0f;
else shi->stress= (shi->stress-1.0f)/shi->stress;
}
else shi->stress= 0.0f;
}
- if(texco & TEXCO_TANGENT) {
- if((mode & MA_TANGENT_V)==0) {
+ if (texco & TEXCO_TANGENT) {
+ if ((mode & MA_TANGENT_V)==0) {
/* just prevent surprises */
shi->tang[0]= shi->tang[1]= shi->tang[2]= 0.0f;
shi->nmaptang[0]= shi->nmaptang[1]= shi->nmaptang[2]= 0.0f;
@@ -1234,15 +1233,15 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
/* this only avalailable for scanline renders */
- if(shi->depth==0) {
+ if (shi->depth==0) {
float x= shi->xs;
float y= shi->ys;
- if(texco & TEXCO_WINDOW) {
+ if (texco & TEXCO_WINDOW) {
shi->winco[0]= -1.0f + 2.0f*x/(float)R.winx;
shi->winco[1]= -1.0f + 2.0f*y/(float)R.winy;
shi->winco[2]= 0.0f;
- if(shi->osatex) {
+ if (shi->osatex) {
shi->dxwin[0]= 2.0f/(float)R.winx;
shi->dywin[1]= 2.0f/(float)R.winy;
shi->dxwin[1]= shi->dxwin[2]= 0.0f;
@@ -1250,14 +1249,14 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
}
- if(texco & TEXCO_STICKY) {
+ if (texco & TEXCO_STICKY) {
float *s1, *s2, *s3;
s1= RE_vertren_get_sticky(obr, v1, 0);
s2= RE_vertren_get_sticky(obr, v2, 0);
s3= RE_vertren_get_sticky(obr, v3, 0);
- if(s1 && s2 && s3) {
+ if (s1 && s2 && s3) {
float obwinmat[4][4], winmat[4][4], ho1[4], ho2[4], ho3[4];
float Zmulx, Zmuly;
float hox, hoy, l, dl, u, v;
@@ -1267,7 +1266,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
Zmulx= ((float)R.winx)/2.0f; Zmuly= ((float)R.winy)/2.0f;
zbuf_make_winmat(&R, winmat);
- if(shi->obi->flag & R_TRANSFORMED)
+ if (shi->obi->flag & R_TRANSFORMED)
mult_m4_m4m4(obwinmat, winmat, obi->mat);
else
copy_m4_m4(obwinmat, winmat);
@@ -1297,7 +1296,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
shi->sticky[1]= l*s3[1]-u*s1[1]-v*s2[1];
shi->sticky[2]= 0.0f;
- if(shi->osatex) {
+ if (shi->osatex) {
float dxuv[2], dyuv[2];
dxuv[0]= s11/Zmulx;
dxuv[1]= - s01/Zmulx;
@@ -1313,11 +1312,14 @@ 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)) {
+ if (mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE)) {
srgb_to_linearrgb_v3_v3(shi->vcol, shi->vcol);
}
}
@@ -1354,7 +1356,7 @@ void shade_sample_initialize(ShadeSample *ssamp, RenderPart *pa, RenderLayer *rl
tot= R.osa==0?1:R.osa;
- for(a=0; a<tot; a++) {
+ for (a=0; a<tot; a++) {
shade_input_initialize(&ssamp->shi[a], pa, rl, a);
memset(&ssamp->shr[a], 0, sizeof(ShadeResult));
}
@@ -1365,19 +1367,19 @@ void shade_sample_initialize(ShadeSample *ssamp, RenderPart *pa, RenderLayer *rl
/* Do AO or (future) GI */
void shade_samples_do_AO(ShadeSample *ssamp)
{
- if(!(R.r.mode & R_SHADOW))
+ if (!(R.r.mode & R_SHADOW))
return;
- if(!(R.r.mode & R_RAYTRACE) && !(R.wrld.ao_gather_method == WO_AOGATHER_APPROX))
+ if (!(R.r.mode & R_RAYTRACE) && !(R.wrld.ao_gather_method == WO_AOGATHER_APPROX))
return;
- if(R.wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) {
+ if (R.wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) {
ShadeInput *shi= &ssamp->shi[0];
int sample;
- if(((shi->passflag & SCE_PASS_COMBINED) && (shi->combinedflag & (SCE_PASS_AO|SCE_PASS_ENVIRONMENT|SCE_PASS_INDIRECT)))
+ if (((shi->passflag & SCE_PASS_COMBINED) && (shi->combinedflag & (SCE_PASS_AO|SCE_PASS_ENVIRONMENT|SCE_PASS_INDIRECT)))
|| (shi->passflag & (SCE_PASS_AO|SCE_PASS_ENVIRONMENT|SCE_PASS_INDIRECT)))
- for(sample=0; sample<ssamp->tot; shi++, sample++)
- if(!(shi->mode & MA_SHLESS))
+ for (sample=0; sample<ssamp->tot; shi++, sample++)
+ if (!(shi->mode & MA_SHLESS))
ambient_occlusion(shi); /* stores in shi->ao[] */
}
}
@@ -1390,23 +1392,23 @@ void shade_samples_fill_with_ps(ShadeSample *ssamp, PixStr *ps, int x, int y)
ssamp->tot= 0;
- for(shi= ssamp->shi; ps; ps= ps->next) {
+ for (shi= ssamp->shi; ps; ps= ps->next) {
shade_input_set_triangle(shi, ps->obi, ps->facenr, 1);
- if(shi->vlr) { /* NULL happens for env material or for 'all z' */
+ if (shi->vlr) { /* NULL happens for env material or for 'all z' */
unsigned short curmask= ps->mask;
/* full osa is only set for OSA renders */
- if(shi->vlr->flag & R_FULL_OSA) {
+ if (shi->vlr->flag & R_FULL_OSA) {
short shi_cp= 0, samp;
- for(samp=0; samp<R.osa; samp++) {
- if(curmask & (1<<samp)) {
+ for (samp=0; samp<R.osa; samp++) {
+ if (curmask & (1<<samp)) {
/* zbuffer has this inverse corrected, ensures xs,ys are inside pixel */
xs= (float)x + R.jit[samp][0] + 0.5f;
ys= (float)y + R.jit[samp][1] + 0.5f;
- if(shi_cp)
+ if (shi_cp)
shade_input_copy_triangle(shi, shi-1);
shi->mask= (1<<samp);
@@ -1414,7 +1416,7 @@ void shade_samples_fill_with_ps(ShadeSample *ssamp, PixStr *ps, int x, int y)
shi->samplenr= R.shadowsamplenr[shi->thread]++; /* this counter is not being reset per pixel */
shade_input_set_viewco(shi, x, y, xs, ys, (float)ps->z);
shade_input_set_uv(shi);
- if(shi_cp==0)
+ if (shi_cp==0)
shade_input_set_normals(shi);
else /* XXX shi->flippednor messes up otherwise */
shade_input_set_vertex_normals(shi);
@@ -1425,7 +1427,7 @@ void shade_samples_fill_with_ps(ShadeSample *ssamp, PixStr *ps, int x, int y)
}
}
else {
- if(R.osa) {
+ if (R.osa) {
short b= R.samples->centmask[curmask];
xs= (float)x + R.samples->centLut[b & 15] + 0.5f;
ys= (float)y + R.samples->centLut[b>>4] + 0.5f;
@@ -1444,7 +1446,7 @@ void shade_samples_fill_with_ps(ShadeSample *ssamp, PixStr *ps, int x, int y)
}
/* total sample amount, shi->sample is static set in initialize */
- if(shi!=ssamp->shi)
+ if (shi!=ssamp->shi)
ssamp->tot= (shi-1)->sample + 1;
}
}
@@ -1455,7 +1457,7 @@ int shade_samples(ShadeSample *ssamp, PixStr *ps, int x, int y)
{
shade_samples_fill_with_ps(ssamp, ps, x, y);
- if(ssamp->tot) {
+ if (ssamp->tot) {
ShadeInput *shi= ssamp->shi;
ShadeResult *shr= ssamp->shr;
int samp;
@@ -1464,15 +1466,15 @@ int shade_samples(ShadeSample *ssamp, PixStr *ps, int x, int y)
shade_samples_do_AO(ssamp);
/* if shade (all shadepinputs have same passflag) */
- if(ssamp->shi[0].passflag & ~(SCE_PASS_Z|SCE_PASS_INDEXOB|SCE_PASS_INDEXMA)) {
+ if (ssamp->shi[0].passflag & ~(SCE_PASS_Z|SCE_PASS_INDEXOB|SCE_PASS_INDEXMA)) {
- for(samp=0; samp<ssamp->tot; samp++, shi++, shr++) {
+ for (samp=0; samp<ssamp->tot; samp++, shi++, shr++) {
shade_input_set_shade_texco(shi);
shade_input_do_shade(shi, shr);
}
}
- else if(shi->passflag & SCE_PASS_Z) {
- for(samp=0; samp<ssamp->tot; samp++, shi++, shr++)
+ else if (shi->passflag & SCE_PASS_Z) {
+ for (samp=0; samp<ssamp->tot; samp++, shi++, shr++)
shr->z= -shi->co[2];
}
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index 78420aa6ca8..5951006c7b5 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -66,11 +66,11 @@ extern struct Render R;
ListBase *get_lights(ShadeInput *shi)
{
- if(R.r.scemode & R_PREVIEWBUTS)
+ if (R.r.scemode & R_PREVIEWBUTS)
return &R.lights;
- if(shi->light_override)
+ if (shi->light_override)
return &shi->light_override->gobject;
- if(shi->mat && shi->mat->group)
+ if (shi->mat && shi->mat->group)
return &shi->mat->group->gobject;
return &R.lights;
@@ -96,7 +96,7 @@ static void fogcolor(float *colf, float *rco, float *view)
dview[2]= -stepsize;
startdist= -rco[2] + BLI_frand();
- for(dist= startdist; dist>R.wrld.miststa; dist-= stepsize) {
+ for (dist= startdist; dist>R.wrld.miststa; dist-= stepsize) {
hor[0]= R.wrld.horr; hor[1]= R.wrld.horg; hor[2]= R.wrld.horb;
alpha= 1.0f;
@@ -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
@@ -127,13 +127,13 @@ float mistfactor(float zcor, float const co[3])
/* fac= -co[2]-R.wrld.miststa; */
- if(fac>0.0f) {
- if(fac< R.wrld.mistdist) {
+ if (fac>0.0f) {
+ if (fac< R.wrld.mistdist) {
fac= (fac/(R.wrld.mistdist));
- if(R.wrld.mistype==0) fac*= fac;
- else if(R.wrld.mistype==1);
+ if (R.wrld.mistype==0) fac*= fac;
+ else if (R.wrld.mistype==1);
else fac= sqrt(fac);
}
else fac= 1.0f;
@@ -141,13 +141,13 @@ float mistfactor(float zcor, float const co[3])
else fac= 0.0f;
/* height switched off mist */
- if(R.wrld.misthi!=0.0f && fac!=0.0f) {
+ if (R.wrld.misthi!=0.0f && fac!=0.0f) {
/* at height misthi the mist is completely gone */
hi= R.viewinv[0][2]*co[0]+R.viewinv[1][2]*co[1]+R.viewinv[2][2]*co[2]+R.viewinv[3][2];
- if(hi>R.wrld.misthi) fac= 0.0f;
- else if(hi>0.0f) {
+ if (hi>R.wrld.misthi) fac= 0.0f;
+ else if (hi>0.0f) {
hi= (R.wrld.misthi-hi)/R.wrld.misthi;
fac*= hi*hi;
}
@@ -166,37 +166,37 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens)
*intens= 0.0f;
haint= lar->haint;
- if(R.r.mode & R_ORTHO) {
+ if (R.r.mode & R_ORTHO) {
/* camera pos (view vector) cannot be used... */
/* camera position (cox,coy,0) rotate around lamp */
p1[0]= shi->co[0]-lar->co[0];
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) {
+ if (R.wrld.mode & WO_MIST) {
/* patchy... */
haint *= mistfactor(-lar->co[2], lar->co);
- if(haint==0.0f) {
+ if (haint==0.0f) {
return;
}
}
/* rotate maxz */
- if(shi->co[2]==0.0f) doclip= 0; /* for when halo at sky */
+ if (shi->co[2]==0.0f) doclip= 0; /* for when halo at sky */
else {
p1[0]= shi->co[0]-lar->co[0];
p1[1]= shi->co[1]-lar->co[1];
@@ -206,7 +206,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens)
maxz*= lar->sh_zfac;
maxy= lar->imat[0][1]*p1[0]+lar->imat[1][1]*p1[1]+lar->imat[2][1]*p1[2];
- if( fabs(nray[2]) < FLT_EPSILON ) use_yco= 1;
+ if ( fabs(nray[2]) < FLT_EPSILON ) use_yco= 1;
}
/* scale z to make sure volume is normalized */
@@ -230,7 +230,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens)
else {
disc = b*b - a*c;
- if(disc==0.0) {
+ if (disc==0.0) {
t1=t2= (-b)/ a;
snijp= 2;
}
@@ -241,11 +241,11 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens)
snijp= 2;
}
}
- if(snijp==2) {
+ if (snijp==2) {
int ok1=0, ok2=0;
/* sort */
- if(t1>t2) {
+ if (t1>t2) {
a= t1; t1= t2; t2= a;
}
@@ -254,52 +254,52 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens)
p2[2]= npos[2] + t2*nray[2];
/* evaluate both points */
- if(p1[2]<=0.0f) ok1= 1;
- if(p2[2]<=0.0f && t1!=t2) ok2= 1;
+ if (p1[2]<=0.0f) ok1= 1;
+ if (p2[2]<=0.0f && t1!=t2) ok2= 1;
/* at least 1 point with negative z */
- if(ok1==0 && ok2==0) return;
+ if (ok1==0 && ok2==0) return;
/* intersction point with -ladist, the bottom of the cone */
- if(use_yco==0) {
+ if (use_yco==0) {
t3= ((double)(-ladist)-npos[2])/nray[2];
/* de we have to replace one of the intersection points? */
- if(ok1) {
- if(p1[2]<-ladist) t1= t3;
+ if (ok1) {
+ if (p1[2]<-ladist) t1= t3;
}
else {
t1= t3;
}
- if(ok2) {
- if(p2[2]<-ladist) t2= t3;
+ if (ok2) {
+ if (p2[2]<-ladist) t2= t3;
}
else {
t2= t3;
}
}
- else if(ok1==0 || ok2==0) return;
+ else if (ok1==0 || ok2==0) return;
/* at least 1 visible interesction point */
- if(t1<0.0 && t2<0.0) return;
+ if (t1<0.0 && t2<0.0) return;
- if(t1<0.0) t1= 0.0;
- if(t2<0.0) t2= 0.0;
+ if (t1<0.0) t1= 0.0;
+ if (t2<0.0) t2= 0.0;
- if(t1==t2) return;
+ if (t1==t2) return;
/* sort again to be sure */
- if(t1>t2) {
+ if (t1>t2) {
a= t1; t1= t2; t2= a;
}
/* calculate t0: is the maximum visible z (when halo is intersected by face) */
- if(doclip) {
- if(use_yco==0) t0= (maxz-npos[2])/nray[2];
+ if (doclip) {
+ if (use_yco==0) t0= (maxz-npos[2])/nray[2];
else t0= (maxy-npos[1])/nray[1];
- if(t0<t1) return;
- if(t0<t2) t2= t0;
+ if (t0<t1) return;
+ if (t0<t2) t2= t0;
}
/* calc points */
@@ -326,18 +326,18 @@ 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) */
- if(*intens<=0.0f) return;
+ * at the edges (especially with narrow halos) */
+ if (*intens<=0.0f) return;
/* soft area */
/* not needed because t0 has been used for p1/p2 as well */
- /* if(doclip && t0<t2) { */
+ /* if (doclip && t0<t2) { */
/* *intens *= (t0-t1)/(t2-t1); */
/* } */
*intens *= haint;
- if(lar->shb && lar->shb->shadhalostep) {
+ if (lar->shb && lar->shb->shadhalostep) {
*intens *= shadow_halo(lar, p1, p2);
}
@@ -351,23 +351,23 @@ void renderspothalo(ShadeInput *shi, float col[4], float alpha)
LampRen *lar;
float i;
- if(alpha==0.0f) return;
+ if (alpha==0.0f) return;
lights= get_lights(shi);
- for(go=lights->first; go; go= go->next) {
+ for (go=lights->first; go; go= go->next) {
lar= go->lampren;
- if(lar==NULL) continue;
+ if (lar==NULL) continue;
- if(lar->type==LA_SPOT && (lar->mode & LA_HALO) && (lar->buftype != LA_SHADBUF_DEEP) && lar->haint>0) {
+ if (lar->type==LA_SPOT && (lar->mode & LA_HALO) && (lar->buftype != LA_SHADBUF_DEEP) && lar->haint>0) {
- if(lar->mode & LA_LAYER)
- if(shi->vlr && (lar->lay & shi->obi->lay)==0)
+ if (lar->mode & LA_LAYER)
+ if (shi->vlr && (lar->lay & shi->obi->lay)==0)
continue;
- if((lar->lay & shi->lay)==0)
+ if ((lar->lay & shi->lay)==0)
continue;
spothalo(lar, shi, &i);
- if(i>0.0f) {
+ if (i>0.0f) {
col[3]+= i*alpha; // all premul
col[0]+= i*lar->r*alpha;
col[1]+= i*lar->g*alpha;
@@ -376,7 +376,7 @@ void renderspothalo(ShadeInput *shi, float col[4], float alpha)
}
}
/* clip alpha, is needed for unified 'alpha threshold' (vanillaRenderPipe.c) */
- if(col[3]>1.0f) col[3]= 1.0f;
+ if (col[3]>1.0f) col[3]= 1.0f;
}
@@ -389,13 +389,14 @@ static double Normalize_d(double *n)
d= n[0]*n[0]+n[1]*n[1]+n[2]*n[2];
- if(d>0.00000000000000001) {
+ if (d>0.00000000000000001) {
d= sqrt(d);
n[0]/=d;
n[1]/=d;
n[2]/=d;
- } else {
+ }
+ else {
n[0]=n[1]=n[2]= 0.0;
d= 0.0;
}
@@ -407,23 +408,23 @@ float fresnel_fac(float *view, float *vn, float grad, float fac)
{
float t1, t2;
- if(fac==0.0f) return 1.0f;
+ if (fac==0.0f) return 1.0f;
t1= (view[0]*vn[0] + view[1]*vn[1] + view[2]*vn[2]);
- if(t1>0.0f) t2= 1.0f+t1;
+ if (t1>0.0f) t2= 1.0f+t1;
else t2= 1.0f-t1;
t2= grad + (1.0f-grad)*powf(t2, fac);
- if(t2<0.0f) return 0.0f;
- else if(t2>1.0f) return 1.0f;
+ if (t2<0.0f) return 0.0f;
+ else if (t2>1.0f) return 1.0f;
return t2;
}
static double saacos_d(double fac)
{
- if(fac<= -1.0) return M_PI;
- else if(fac>=1.0) return 0.0;
+ if (fac<= -1.0) return M_PI;
+ else if (fac>=1.0) return 0.0;
else return acos(fac);
}
@@ -473,7 +474,7 @@ static float area_lamp_energy(float (*area)[3], float *co, float *vn)
fac+= rad[2]*(vn[0]*cross[2][0]+ vn[1]*cross[2][1]+ vn[2]*cross[2][2]);
fac+= rad[3]*(vn[0]*cross[3][0]+ vn[1]*cross[3][1]+ vn[2]*cross[3][2]);
- if(fac<=0.0) return 0.0;
+ if (fac<=0.0) return 0.0;
return fac;
}
@@ -486,10 +487,10 @@ static float area_lamp_energy_multisample(LampRen *lar, float *co, float *vn)
/* test if co is behind lamp */
sub_v3_v3v3(vec, co, lar->co);
- if(dot_v3v3(vec, lar->vec) < 0.0f)
+ if (dot_v3v3(vec, lar->vec) < 0.0f)
return 0.0f;
- while(a--) {
+ while (a--) {
vec[0]= jitlamp[0];
vec[1]= jitlamp[1];
vec[2]= 0.0f;
@@ -513,35 +514,35 @@ static float spec(float inp, int hard)
{
float b1;
- if(inp>=1.0f) return 1.0f;
+ if (inp>=1.0f) return 1.0f;
else if (inp<=0.0f) return 0.0f;
b1= inp*inp;
/* avoid FPE */
- if(b1<0.01f) b1= 0.01f;
+ if (b1<0.01f) b1= 0.01f;
- if((hard & 1)==0) inp= 1.0f;
- if(hard & 2) inp*= b1;
+ if ((hard & 1)==0) inp= 1.0f;
+ if (hard & 2) inp*= b1;
b1*= b1;
- if(hard & 4) inp*= b1;
+ if (hard & 4) inp*= b1;
b1*= b1;
- if(hard & 8) inp*= b1;
+ if (hard & 8) inp*= b1;
b1*= b1;
- if(hard & 16) inp*= b1;
+ if (hard & 16) inp*= b1;
b1*= b1;
/* avoid FPE */
- if(b1<0.001f) b1= 0.0f;
+ if (b1<0.001f) b1= 0.0f;
- if(hard & 32) inp*= b1;
+ if (hard & 32) inp*= b1;
b1*= b1;
- if(hard & 64) inp*=b1;
+ if (hard & 64) inp*=b1;
b1*= b1;
- if(hard & 128) inp*=b1;
+ if (hard & 128) inp*=b1;
- if(b1<0.001f) b1= 0.0f;
+ if (b1<0.001f) b1= 0.0f;
- if(hard & 256) {
+ if (hard & 256) {
b1*= b1;
inp*=b1;
}
@@ -560,9 +561,9 @@ static float Phong_Spec( float *n, float *l, float *v, int hard, int tangent )
normalize_v3(h);
rslt = h[0]*n[0] + h[1]*n[1] + h[2]*n[2];
- if(tangent) rslt= sasqrt(1.0f - rslt*rslt);
+ if (tangent) rslt= sasqrt(1.0f - rslt*rslt);
- if( rslt > 0.0f ) rslt= spec(rslt, hard);
+ if ( rslt > 0.0f ) rslt= spec(rslt, hard);
else rslt = 0.0f;
return rslt;
@@ -580,12 +581,12 @@ static float CookTorr_Spec(float *n, float *l, float *v, int hard, int tangent)
normalize_v3(h);
nh= n[0]*h[0]+n[1]*h[1]+n[2]*h[2];
- if(tangent) nh= sasqrt(1.0f - nh*nh);
- else if(nh<0.0f) return 0.0f;
+ if (tangent) nh= sasqrt(1.0f - nh*nh);
+ else if (nh<0.0f) return 0.0f;
nv= n[0]*v[0]+n[1]*v[1]+n[2]*v[2];
- if(tangent) nv= sasqrt(1.0f - nv*nv);
- else if(nv<0.0f) nv= 0.0f;
+ if (tangent) nv= sasqrt(1.0f - nv*nv);
+ else if (nv<0.0f) nv= 0.0f;
i= spec(nh, hard);
@@ -599,11 +600,11 @@ static float Blinn_Spec(float *n, float *l, float *v, float refrac, float spec_p
float i, nh, nv, nl, vh, h[3];
float a, b, c, g=0.0f, p, f, ang;
- if(refrac < 1.0f) return 0.0f;
- if(spec_power == 0.0f) return 0.0f;
+ if (refrac < 1.0f) return 0.0f;
+ if (spec_power == 0.0f) return 0.0f;
/* conversion from 'hardness' (1-255) to 'spec_power' (50 maps at 0.1) */
- if(spec_power<100.0f)
+ if (spec_power<100.0f)
spec_power= sqrt(1.0f/spec_power);
else spec_power= 10.0f/spec_power;
@@ -613,36 +614,36 @@ static float Blinn_Spec(float *n, float *l, float *v, float refrac, float spec_p
normalize_v3(h);
nh= n[0]*h[0]+n[1]*h[1]+n[2]*h[2]; /* Dot product between surface normal and half-way vector */
- if(tangent) nh= sasqrt(1.0f - nh*nh);
- else if(nh<0.0f) return 0.0f;
+ if (tangent) nh= sasqrt(1.0f - nh*nh);
+ else if (nh<0.0f) return 0.0f;
nv= n[0]*v[0]+n[1]*v[1]+n[2]*v[2]; /* Dot product between surface normal and view vector */
- if(tangent) nv= sasqrt(1.0f - nv*nv);
- if(nv<=0.01f) nv= 0.01f; /* hrms... */
+ if (tangent) nv= sasqrt(1.0f - nv*nv);
+ if (nv<=0.01f) nv= 0.01f; /* hrms... */
nl= n[0]*l[0]+n[1]*l[1]+n[2]*l[2]; /* Dot product between surface normal and light vector */
- if(tangent) nl= sasqrt(1.0f - nl*nl);
- if(nl<=0.01f) {
+ if (tangent) nl= sasqrt(1.0f - nl*nl);
+ if (nl<=0.01f) {
return 0.0f;
}
vh= v[0]*h[0]+v[1]*h[1]+v[2]*h[2]; /* Dot product between view vector and half-way vector */
- if(vh<=0.0f) vh= 0.01f;
+ if (vh<=0.0f) vh= 0.01f;
a = 1.0f;
b = (2.0f*nh*nv)/vh;
c = (2.0f*nh*nl)/vh;
- if( a < b && a < c ) g = a;
- else if( b < a && b < c ) g = b;
- else if( c < a && c < b ) g = c;
+ if ( a < b && a < c ) g = a;
+ else if ( b < a && b < c ) g = b;
+ else if ( c < a && c < b ) g = c;
p = sqrt( (double)((refrac * refrac)+(vh*vh)-1.0f) );
f = (((p-vh)*(p-vh))/((p+vh)*(p+vh)))*(1+((((vh*(p+vh))-1.0f)*((vh*(p+vh))-1.0f))/(((vh*(p-vh))+1.0f)*((vh*(p-vh))+1.0f))));
ang = saacos(nh);
i= f * g * exp((double)(-(ang*ang) / (2.0f*spec_power*spec_power)));
- if(i<0.0f) i= 0.0f;
+ if (i<0.0f) i= 0.0f;
return i;
}
@@ -660,12 +661,12 @@ static float Toon_Spec( float *n, float *l, float *v, float size, float smooth,
normalize_v3(h);
rslt = h[0]*n[0] + h[1]*n[1] + h[2]*n[2];
- if(tangent) rslt = sasqrt(1.0f - rslt*rslt);
+ if (tangent) rslt = sasqrt(1.0f - rslt*rslt);
ang = saacos( rslt );
- if( ang < size ) rslt = 1.0f;
- else if( ang >= (size + smooth) || smooth == 0.0f ) rslt = 0.0f;
+ if ( ang < size ) rslt = 1.0f;
+ else if ( ang >= (size + smooth) || smooth == 0.0f ) rslt = 0.0f;
else rslt = 1.0f - ((ang - size) / smooth);
return rslt;
@@ -684,16 +685,16 @@ static float WardIso_Spec( float *n, float *l, float *v, float rms, int tangent)
normalize_v3(h);
nh = n[0]*h[0]+n[1]*h[1]+n[2]*h[2]; /* Dot product between surface normal and half-way vector */
- if(tangent) nh = sasqrt(1.0f - nh*nh);
- if(nh<=0.0f) nh = 0.001f;
+ if (tangent) nh = sasqrt(1.0f - nh*nh);
+ if (nh<=0.0f) nh = 0.001f;
nv = n[0]*v[0]+n[1]*v[1]+n[2]*v[2]; /* Dot product between surface normal and view vector */
- if(tangent) nv = sasqrt(1.0f - nv*nv);
- if(nv<=0.0f) nv = 0.001f;
+ if (tangent) nv = sasqrt(1.0f - nv*nv);
+ if (nv<=0.0f) nv = 0.001f;
nl = n[0]*l[0]+n[1]*l[1]+n[2]*l[2]; /* Dot product between surface normal and light vector */
- if(tangent) nl = sasqrt(1.0f - nl*nl);
- if(nl<=0.0f) nl = 0.001f;
+ if (tangent) nl = sasqrt(1.0f - nl*nl);
+ if (nl<=0.0f) nl = 0.001f;
angle = tan(saacos(nh));
alpha = MAX2(rms, 0.001f);
@@ -712,8 +713,8 @@ static float Toon_Diff( float *n, float *l, float *UNUSED(v), float size, float
ang = saacos( (double)(rslt) );
- if( ang < size ) rslt = 1.0f;
- else if( ang >= (size + smooth) || smooth == 0.0f ) rslt = 0.0f;
+ if ( ang < size ) rslt = 1.0f;
+ else if ( ang >= (size + smooth) || smooth == 0.0f ) rslt = 0.0f;
else rslt = 1.0f - ((ang - size) / smooth);
return rslt;
@@ -735,17 +736,17 @@ static float OrenNayar_Diff(float nl, float *n, float *l, float *v, float rough
normalize_v3(h);
/* nh= n[0]*h[0]+n[1]*h[1]+n[2]*h[2]; */ /* Dot product between surface normal and half-way vector */
- /* if(nh<0.0f) nh = 0.0f; */
+ /* if (nh<0.0f) nh = 0.0f; */
nv= n[0]*v[0]+n[1]*v[1]+n[2]*v[2]; /* Dot product between surface normal and view vector */
- if(nv<=0.0f) nv= 0.0f;
+ if (nv<=0.0f) nv= 0.0f;
realnl= n[0]*l[0]+n[1]*l[1]+n[2]*l[2]; /* Dot product between surface normal and light vector */
- if(realnl<=0.0f) return 0.0f;
- if(nl<0.0f) return 0.0f; /* value from area light */
+ if (realnl<=0.0f) return 0.0f;
+ if (nl<0.0f) return 0.0f; /* value from area light */
/* vh= v[0]*h[0]+v[1]*h[1]+v[2]*h[2]; */ /* Dot product between view vector and halfway vector */
- /* if(vh<=0.0f) vh= 0.0f; */
+ /* if (vh<=0.0f) vh= 0.0f; */
Lit_A = saacos(realnl);
View_A = saacos( nv );
@@ -761,9 +762,9 @@ static float OrenNayar_Diff(float nl, float *n, float *l, float *v, float rough
normalize_v3( View_B );
t = Lit_B[0]*View_B[0] + Lit_B[1]*View_B[1] + Lit_B[2]*View_B[2];
- if( t < 0 ) t = 0;
+ if ( t < 0 ) t = 0;
- if( Lit_A > View_A ) {
+ if ( Lit_A > View_A ) {
a = Lit_A;
b = View_A;
}
@@ -822,8 +823,8 @@ void calc_R_ref(ShadeInput *shi)
shi->ref[0]= (shi->view[0]+i*shi->vn[0]);
shi->ref[1]= (shi->view[1]+i*shi->vn[1]);
shi->ref[2]= (shi->view[2]+i*shi->vn[2]);
- if(shi->osatex) {
- if(shi->vlr->flag & R_SMOOTH) {
+ if (shi->osatex) {
+ if (shi->vlr->flag & R_SMOOTH) {
i= -2*( (shi->vn[0]+shi->dxno[0])*(shi->view[0]+shi->dxview) +
(shi->vn[1]+shi->dxno[1])*shi->view[1]+ (shi->vn[2]+shi->dxno[2])*shi->view[2] );
@@ -864,24 +865,24 @@ void shade_color(ShadeInput *shi, ShadeResult *shr)
{
Material *ma= shi->mat;
- if(ma->mode & (MA_FACETEXTURE)) {
+ if (ma->mode & (MA_FACETEXTURE)) {
shi->r= shi->vcol[0];
shi->g= shi->vcol[1];
shi->b= shi->vcol[2];
- if(ma->mode & (MA_FACETEXTURE_ALPHA))
+ if (ma->mode & (MA_FACETEXTURE_ALPHA))
shi->alpha= shi->vcol[3];
}
- else if(ma->mode & (MA_VERTEXCOLP)) {
+ else if (ma->mode & (MA_VERTEXCOLP)) {
float neg_alpha = 1.0f - shi->vcol[3];
shi->r= shi->r*neg_alpha + shi->vcol[0]*shi->vcol[3];
shi->g= shi->g*neg_alpha + shi->vcol[1]*shi->vcol[3];
shi->b= shi->b*neg_alpha + shi->vcol[2]*shi->vcol[3];
}
- if(ma->texco)
+ if (ma->texco)
do_material_tex(shi, &R);
- if(ma->fresnel_tra!=0.0f)
+ if (ma->fresnel_tra!=0.0f)
shi->alpha*= fresnel_fac(shi->view, shi->vn, ma->fresnel_tra_i, ma->fresnel_tra);
if (!(shi->mode & MA_TRANSP)) shi->alpha= 1.0f;
@@ -898,8 +899,8 @@ static void ramp_diffuse_result(float *diff, ShadeInput *shi)
Material *ma= shi->mat;
float col[4];
- if(ma->ramp_col) {
- if(ma->rampin_col==MA_RAMP_IN_RESULT) {
+ if (ma->ramp_col) {
+ if (ma->rampin_col==MA_RAMP_IN_RESULT) {
float fac = rgb_to_grayscale(diff);
do_colorband(ma->ramp_col, fac, col);
@@ -916,10 +917,10 @@ static void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, floa
{
Material *ma= shi->mat;
- if(ma->ramp_col && (ma->mode & MA_RAMP_COL)) {
+ if (ma->ramp_col && (ma->mode & MA_RAMP_COL)) {
/* MA_RAMP_IN_RESULT is exceptional */
- if(ma->rampin_col==MA_RAMP_IN_RESULT) {
+ if (ma->rampin_col==MA_RAMP_IN_RESULT) {
// normal add
diff[0] += r * shi->r;
diff[1] += g * shi->g;
@@ -973,7 +974,7 @@ static void ramp_spec_result(float spec_col[3], ShadeInput *shi)
{
Material *ma= shi->mat;
- if(ma->ramp_spec && (ma->rampin_spec==MA_RAMP_IN_RESULT)) {
+ if (ma->ramp_spec && (ma->rampin_spec==MA_RAMP_IN_RESULT)) {
float col[4];
float fac = rgb_to_grayscale(spec_col);
@@ -997,7 +998,7 @@ static void do_specular_ramp(ShadeInput *shi, float is, float t, float spec[3])
spec[2]= shi->specb;
/* MA_RAMP_IN_RESULT is exception */
- if(ma->ramp_spec && (ma->rampin_spec!=MA_RAMP_IN_RESULT)) {
+ if (ma->ramp_spec && (ma->rampin_spec!=MA_RAMP_IN_RESULT)) {
float fac;
float col[4];
@@ -1030,10 +1031,10 @@ static void do_specular_ramp(ShadeInput *shi, float is, float t, float spec[3])
/* preprocess, textures were not done, don't use shi->amb for that reason */
void ambient_occlusion(ShadeInput *shi)
{
- if((R.wrld.ao_gather_method == WO_AOGATHER_APPROX) && shi->mat->amb!=0.0f) {
+ if ((R.wrld.ao_gather_method == WO_AOGATHER_APPROX) && shi->mat->amb!=0.0f) {
sample_occ(&R, shi);
}
- else if((R.r.mode & R_RAYTRACE) && shi->mat->amb!=0.0f) {
+ else if ((R.r.mode & R_RAYTRACE) && shi->mat->amb!=0.0f) {
ray_ao(shi, shi->ao, shi->env);
}
else {
@@ -1050,21 +1051,21 @@ static void ambient_occlusion_apply(ShadeInput *shi, ShadeResult *shr)
float f= R.wrld.aoenergy;
float tmp[3], tmpspec[3];
- if(!((R.r.mode & R_RAYTRACE) || R.wrld.ao_gather_method == WO_AOGATHER_APPROX))
+ if (!((R.r.mode & R_RAYTRACE) || R.wrld.ao_gather_method == WO_AOGATHER_APPROX))
return;
- if(f == 0.0f)
+ if (f == 0.0f)
return;
- if(R.wrld.aomix==WO_AOADD) {
+ if (R.wrld.aomix==WO_AOADD) {
shr->combined[0] += shi->ao[0]*shi->r*shi->refl*f;
shr->combined[1] += shi->ao[1]*shi->g*shi->refl*f;
shr->combined[2] += shi->ao[2]*shi->b*shi->refl*f;
}
- else if(R.wrld.aomix==WO_AOMUL) {
+ else if (R.wrld.aomix==WO_AOMUL) {
mul_v3_v3v3(tmp, shr->combined, shi->ao);
mul_v3_v3v3(tmpspec, shr->spec, shi->ao);
- if(f == 1.0f) {
+ if (f == 1.0f) {
copy_v3_v3(shr->combined, tmp);
copy_v3_v3(shr->spec, tmpspec);
}
@@ -1079,9 +1080,9 @@ void environment_lighting_apply(ShadeInput *shi, ShadeResult *shr)
{
float f= R.wrld.ao_env_energy*shi->amb;
- if(!((R.r.mode & R_RAYTRACE) || R.wrld.ao_gather_method == WO_AOGATHER_APPROX))
+ if (!((R.r.mode & R_RAYTRACE) || R.wrld.ao_gather_method == WO_AOGATHER_APPROX))
return;
- if(f == 0.0f)
+ if (f == 0.0f)
return;
shr->combined[0] += shi->env[0]*shi->r*shi->refl*f;
@@ -1093,9 +1094,9 @@ static void indirect_lighting_apply(ShadeInput *shi, ShadeResult *shr)
{
float f= R.wrld.ao_indirect_energy;
- if(!((R.r.mode & R_RAYTRACE) || R.wrld.ao_gather_method == WO_AOGATHER_APPROX))
+ if (!((R.r.mode & R_RAYTRACE) || R.wrld.ao_gather_method == WO_AOGATHER_APPROX))
return;
- if(f == 0.0f)
+ if (f == 0.0f)
return;
shr->combined[0] += shi->indirect[0]*shi->r*shi->refl*f;
@@ -1108,21 +1109,21 @@ void lamp_get_shadow(LampRen *lar, ShadeInput *shi, float inp, float shadfac[4],
{
LampShadowSubSample *lss= &(lar->shadsamp[shi->thread].s[shi->sample]);
- if(do_real || lss->samplenr!=shi->samplenr) {
+ if (do_real || lss->samplenr!=shi->samplenr) {
shadfac[0]= shadfac[1]= shadfac[2]= shadfac[3]= 1.0f;
- if(lar->shb) {
- if(lar->buftype==LA_SHADBUF_IRREGULAR)
+ if (lar->shb) {
+ if (lar->buftype==LA_SHADBUF_IRREGULAR)
shadfac[3]= ISB_getshadow(shi, lar->shb);
else
shadfac[3] = testshadowbuf(&R, lar->shb, shi->co, shi->dxco, shi->dyco, inp, shi->mat->lbias);
}
- else if(lar->mode & LA_SHAD_RAY) {
+ else if (lar->mode & LA_SHAD_RAY) {
ray_shadow(shi, lar, shadfac);
}
- if(shi->depth==0) {
+ if (shi->depth==0) {
copy_v4_v4(lss->shadfac, shadfac);
lss->samplenr= shi->samplenr;
}
@@ -1135,7 +1136,7 @@ void lamp_get_shadow(LampRen *lar, ShadeInput *shi, float inp, float shadfac[4],
/* lampdistance and spot angle, writes in lv and dist */
float lamp_get_visibility(LampRen *lar, const float co[3], float lv[3], float *dist)
{
- if(lar->type==LA_SUN || lar->type==LA_HEMI) {
+ if (lar->type==LA_SUN || lar->type==LA_HEMI) {
*dist= 1.0f;
copy_v3_v3(lv, lar->vec);
return 1.0f;
@@ -1149,7 +1150,7 @@ float lamp_get_visibility(LampRen *lar, const float co[3], float lv[3], float *d
mul_v3_fl(lv, t);
/* area type has no quad or sphere option */
- if(lar->type==LA_AREA) {
+ if (lar->type==LA_AREA) {
/* area is single sided */
//if(dot_v3v3(lv, lar->vec) > 0.0f)
// visifac= 1.0f;
@@ -1174,9 +1175,9 @@ float lamp_get_visibility(LampRen *lar, const float co[3], float lv[3], float *d
visifac = lar->dist / (lar->dist + dist[0]*dist[0]);
break;
case LA_FALLOFF_SLIDERS:
- if(lar->ld1>0.0f)
+ if (lar->ld1>0.0f)
visifac= lar->dist/(lar->dist+lar->ld1*dist[0]);
- if(lar->ld2>0.0f)
+ if (lar->ld2>0.0f)
visifac*= lar->distkw/(lar->distkw+lar->ld2*dist[0]*dist[0]);
break;
case LA_FALLOFF_CURVE:
@@ -1184,20 +1185,20 @@ float lamp_get_visibility(LampRen *lar, const float co[3], float lv[3], float *d
break;
}
- if(lar->mode & LA_SPHERE) {
+ if (lar->mode & LA_SPHERE) {
float t= lar->dist - dist[0];
- if(t<=0.0f)
+ if (t<=0.0f)
visifac= 0.0f;
else
visifac*= t/lar->dist;
}
- if(visifac > 0.0f) {
- if(lar->type==LA_SPOT) {
+ if (visifac > 0.0f) {
+ if (lar->type==LA_SPOT) {
float inpr;
- if(lar->mode & LA_SQUARE) {
- if(dot_v3v3(lv, lar->vec) > 0.0f) {
+ if (lar->mode & LA_SQUARE) {
+ if (dot_v3v3(lv, lar->vec) > 0.0f) {
float lvrot[3], x;
/* rotate view to lampspace */
@@ -1216,11 +1217,11 @@ float lamp_get_visibility(LampRen *lar, const float co[3], float lv[3], float *d
}
t= lar->spotsi;
- if(inpr<=t)
+ if (inpr<=t)
visifac= 0.0f;
else {
t= inpr-t;
- if(t<lar->spotbl && lar->spotbl!=0.0f) {
+ if (t<lar->spotbl && lar->spotbl!=0.0f) {
/* soft area */
float i= t/lar->spotbl;
t= i*i;
@@ -1253,17 +1254,17 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
/* only shadow lamps shouldn't affect shadow-less materials at all */
if ((lar->mode & LA_ONLYSHADOW) && (!(ma->mode & MA_SHADOW) || !(R.r.mode & R_SHADOW)))
return;
- /* optimisation, don't render fully black lamps */
+ /* optimization, don't render fully black lamps */
if (!(lar->mode & LA_TEXTURE) && (lar->r + lar->g + lar->b == 0.0f))
return;
/* lampdist, spot angle, area side, ... */
visifac= lamp_get_visibility(lar, shi->co, lv, &lampdist);
- if(visifac==0.0f)
+ if (visifac==0.0f)
return;
- if(lar->type==LA_SPOT) {
- if(lar->mode & LA_OSATEX) {
+ if (lar->type==LA_SPOT) {
+ if (lar->mode & LA_OSATEX) {
shi->osatex= 1; /* signal for multitex() */
shi->dxlv[0]= lv[0] - (shi->co[0]-lar->co[0]+shi->dxco[0])/lampdist;
@@ -1285,15 +1286,15 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
lashdw[1]= lar->shdwg;
lashdw[2]= lar->shdwb;
- if(lar->mode & LA_TEXTURE) do_lamp_tex(lar, lv, shi, lacol, LA_TEXTURE);
- if(lar->mode & LA_SHAD_TEX) do_lamp_tex(lar, lv, shi, lashdw, LA_SHAD_TEX);
+ if (lar->mode & LA_TEXTURE) do_lamp_tex(lar, lv, shi, lacol, LA_TEXTURE);
+ if (lar->mode & LA_SHAD_TEX) do_lamp_tex(lar, lv, shi, lashdw, LA_SHAD_TEX);
/* tangent case; calculate fake face normal, aligned with lampvector */
/* note, vnor==vn is used as tangent trigger for buffer shadow */
- if(vlr->flag & R_TANGENT) {
+ if (vlr->flag & R_TANGENT) {
float cross[3], nstrand[3], blend;
- if(ma->mode & MA_STR_SURFDIFF) {
+ if (ma->mode & MA_STR_SURFDIFF) {
cross_v3_v3v3(cross, shi->surfnor, vn);
cross_v3_v3v3(nstrand, vn, cross);
@@ -1310,8 +1311,8 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
normalize_v3(vnor);
}
- if(ma->strand_surfnor > 0.0f) {
- if(ma->strand_surfnor > shi->surfdist) {
+ if (ma->strand_surfnor > 0.0f) {
+ if (ma->strand_surfnor > shi->surfdist) {
blend= (ma->strand_surfnor - shi->surfdist)/ma->strand_surfnor;
interp_v3_v3v3(vnor, vnor, shi->surfnor, blend);
normalize_v3(vnor);
@@ -1336,18 +1337,18 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
/* phong threshold to prevent backfacing faces having artefacts on ray shadow (terminator problem) */
/* this complex construction screams for a nicer implementation! (ton) */
- if(R.r.mode & R_SHADOW) {
- if(ma->mode & MA_SHADOW) {
- if(lar->type==LA_HEMI || lar->type==LA_AREA);
- else if((ma->mode & MA_RAYBIAS) && (lar->mode & LA_SHAD_RAY) && (vlr->flag & R_SMOOTH)) {
+ if (R.r.mode & R_SHADOW) {
+ if (ma->mode & MA_SHADOW) {
+ if (lar->type==LA_HEMI || lar->type==LA_AREA);
+ else if ((ma->mode & MA_RAYBIAS) && (lar->mode & LA_SHAD_RAY) && (vlr->flag & R_SMOOTH)) {
float thresh= shi->obr->ob->smoothresh;
- if(inp>thresh)
+ if (inp>thresh)
phongcorr= (inp-thresh)/(inp*(1.0f-thresh));
else
phongcorr= 0.0f;
}
- else if(ma->sbias!=0.0f && ((lar->mode & LA_SHAD_RAY) || lar->shb)) {
- if(inp>ma->sbias)
+ else if (ma->sbias!=0.0f && ((lar->mode & LA_SHAD_RAY) || lar->shb)) {
+ if (inp>ma->sbias)
phongcorr= (inp-ma->sbias)/(inp*(1.0f-ma->sbias));
else
phongcorr= 0.0f;
@@ -1356,57 +1357,57 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
}
/* diffuse shaders */
- if(lar->mode & LA_NO_DIFF) {
+ if (lar->mode & LA_NO_DIFF) {
is= 0.0f; // skip shaders
}
- else if(lar->type==LA_HEMI) {
+ else if (lar->type==LA_HEMI) {
is= 0.5f*inp + 0.5f;
}
else {
- if(lar->type==LA_AREA)
+ if (lar->type==LA_AREA)
inp= area_lamp_energy_multisample(lar, shi->co, vn);
/* diffuse shaders (oren nayer gets inp from area light) */
- if(ma->diff_shader==MA_DIFF_ORENNAYAR) is= OrenNayar_Diff(inp, vn, lv, view, ma->roughness);
- else if(ma->diff_shader==MA_DIFF_TOON) is= Toon_Diff(vn, lv, view, ma->param[0], ma->param[1]);
- else if(ma->diff_shader==MA_DIFF_MINNAERT) is= Minnaert_Diff(inp, vn, view, ma->darkness);
- else if(ma->diff_shader==MA_DIFF_FRESNEL) is= Fresnel_Diff(vn, lv, view, ma->param[0], ma->param[1]);
+ if (ma->diff_shader==MA_DIFF_ORENNAYAR) is= OrenNayar_Diff(inp, vn, lv, view, ma->roughness);
+ else if (ma->diff_shader==MA_DIFF_TOON) is= Toon_Diff(vn, lv, view, ma->param[0], ma->param[1]);
+ else if (ma->diff_shader==MA_DIFF_MINNAERT) is= Minnaert_Diff(inp, vn, view, ma->darkness);
+ else if (ma->diff_shader==MA_DIFF_FRESNEL) is= Fresnel_Diff(vn, lv, view, ma->param[0], ma->param[1]);
else is= inp; // Lambert
}
/* 'is' is diffuse */
- if((ma->shade_flag & MA_CUBIC) && is>0.0f && is<1.0f)
+ if ((ma->shade_flag & MA_CUBIC) && is>0.0f && is<1.0f)
is= 3.0f*is*is - 2.0f*is*is*is; // nicer termination of shades
i= is*phongcorr;
- if(i>0.0f) {
+ if (i>0.0f) {
i*= visifac*shi->refl;
}
i_noshad= i;
vn= shi->vn; // bring back original vector, we use special specular shaders for tangent
- if(ma->mode & MA_TANGENT_V)
+ if (ma->mode & MA_TANGENT_V)
vn= shi->tang;
/* init transp shadow */
shadfac[0]= shadfac[1]= shadfac[2]= shadfac[3]= 1.0f;
/* shadow and spec, (visifac==0 outside spot) */
- if(visifac> 0.0f) {
+ if (visifac> 0.0f) {
- if((R.r.mode & R_SHADOW)) {
- if(ma->mode & MA_SHADOW) {
- if(lar->shb || (lar->mode & LA_SHAD_RAY)) {
+ if ((R.r.mode & R_SHADOW)) {
+ if (ma->mode & MA_SHADOW) {
+ if (lar->shb || (lar->mode & LA_SHAD_RAY)) {
- if(vn==vnor) /* tangent trigger */
+ if (vn==vnor) /* tangent trigger */
lamp_get_shadow(lar, shi, dot_v3v3(shi->vn, lv), shadfac, shi->depth);
else
lamp_get_shadow(lar, shi, inp, shadfac, shi->depth);
/* warning, here it skips the loop */
- if((lar->mode & LA_ONLYSHADOW) && i>0.0f) {
+ if ((lar->mode & LA_ONLYSHADOW) && i>0.0f) {
shadfac[3]= i*lar->energy*(1.0f-shadfac[3]);
shr->shad[0] -= shadfac[3]*shi->r*(1.0f-lashdw[0]);
@@ -1427,9 +1428,9 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
}
/* in case 'no diffuse' we still do most calculus, spec can be in shadow.*/
- if(!(lar->mode & LA_NO_DIFF)) {
- if(i>0.0f) {
- if(ma->mode & MA_SHADOW_TRA)
+ if (!(lar->mode & LA_NO_DIFF)) {
+ if (i>0.0f) {
+ if (ma->mode & MA_SHADOW_TRA)
add_to_diffuse(shr->shad, shi, is, i*shadfac[0]*lacol[0], i*shadfac[1]*lacol[1], i*shadfac[2]*lacol[2]);
else
add_to_diffuse(shr->shad, shi, is, i*lacol[0], i*lacol[1], i*lacol[2]);
@@ -1438,8 +1439,8 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
if (i_noshad>i && !(lashdw[0]==0 && lashdw[1]==0 && lashdw[2]==0)) {
add_to_diffuse(shr->shad, shi, is, lashdw[0]*(i_noshad-i)*lacol[0], lashdw[1]*(i_noshad-i)*lacol[1], lashdw[2]*(i_noshad-i)*lacol[2]);
}
- if(i_noshad>0.0f) {
- if(passflag & (SCE_PASS_DIFFUSE|SCE_PASS_SHADOW)) {
+ if (i_noshad>0.0f) {
+ if (passflag & (SCE_PASS_DIFFUSE|SCE_PASS_SHADOW)) {
add_to_diffuse(shr->diff, shi, is, i_noshad*lacol[0], i_noshad*lacol[1], i_noshad*lacol[2]);
}
else
@@ -1450,10 +1451,10 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
/* specularity */
shadfac[3]*= phongcorr; /* note, shadfac not allowed to be stored nonlocal */
- if(shadfac[3]>0.0f && shi->spec!=0.0f && !(lar->mode & LA_NO_SPEC) && !(lar->mode & LA_ONLYSHADOW)) {
+ if (shadfac[3]>0.0f && shi->spec!=0.0f && !(lar->mode & LA_NO_SPEC) && !(lar->mode & LA_ONLYSHADOW)) {
- if(!(passflag & (SCE_PASS_COMBINED|SCE_PASS_SPEC)));
- else if(lar->type==LA_HEMI) {
+ if (!(passflag & (SCE_PASS_COMBINED|SCE_PASS_SPEC)));
+ else if (lar->type==LA_HEMI) {
float t;
/* hemi uses no spec shaders (yet) */
@@ -1465,7 +1466,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
t= vn[0]*lv[0]+vn[1]*lv[1]+vn[2]*lv[2];
- if(lar->type==LA_HEMI) {
+ if (lar->type==LA_HEMI) {
t= 0.5f*t+0.5f;
}
@@ -1479,23 +1480,23 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
/* specular shaders */
float specfac, t;
- if(ma->spec_shader==MA_SPEC_PHONG)
+ if (ma->spec_shader==MA_SPEC_PHONG)
specfac= Phong_Spec(vn, lv, view, shi->har, (vlr->flag & R_TANGENT) || (ma->mode & MA_TANGENT_V));
- else if(ma->spec_shader==MA_SPEC_COOKTORR)
+ else if (ma->spec_shader==MA_SPEC_COOKTORR)
specfac= CookTorr_Spec(vn, lv, view, shi->har, (vlr->flag & R_TANGENT) || (ma->mode & MA_TANGENT_V));
- else if(ma->spec_shader==MA_SPEC_BLINN)
+ else if (ma->spec_shader==MA_SPEC_BLINN)
specfac= Blinn_Spec(vn, lv, view, ma->refrac, (float)shi->har, (vlr->flag & R_TANGENT) || (ma->mode & MA_TANGENT_V));
- else if(ma->spec_shader==MA_SPEC_WARDISO)
+ else if (ma->spec_shader==MA_SPEC_WARDISO)
specfac= WardIso_Spec( vn, lv, view, ma->rms, (vlr->flag & R_TANGENT) || (ma->mode & MA_TANGENT_V));
else
specfac= Toon_Spec(vn, lv, view, ma->param[2], ma->param[3], (vlr->flag & R_TANGENT) || (ma->mode & MA_TANGENT_V));
/* area lamp correction */
- if(lar->type==LA_AREA) specfac*= inp;
+ if (lar->type==LA_AREA) specfac*= inp;
t= shadfac[3]*shi->spec*visifac*specfac;
- if(ma->mode & MA_RAMP_SPEC) {
+ if (ma->mode & MA_RAMP_SPEC) {
float spec[3];
do_specular_ramp(shi, specfac, t, spec);
shr->spec[0]+= t*(lacol[0] * spec[0]);
@@ -1515,7 +1516,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
static void shade_lamp_loop_only_shadow(ShadeInput *shi, ShadeResult *shr)
{
- if(R.r.mode & R_SHADOW) {
+ if (R.r.mode & R_SHADOW) {
ListBase *lights;
LampRen *lar;
GroupObject *go;
@@ -1529,28 +1530,28 @@ static void shade_lamp_loop_only_shadow(ShadeInput *shi, ShadeResult *shr)
accum= ir= 0.0f;
lights= get_lights(shi);
- for(go=lights->first; go; go= go->next) {
+ for (go=lights->first; go; go= go->next) {
lar= go->lampren;
- if(lar==NULL) continue;
+ if (lar==NULL) continue;
/* yafray: ignore shading by photonlights, not used in Blender */
if (lar->type==LA_YF_PHOTON) continue;
- if(lar->mode & LA_LAYER) if((lar->lay & shi->obi->lay)==0) continue;
- if((lar->lay & shi->lay)==0) continue;
+ if (lar->mode & LA_LAYER) if ((lar->lay & shi->obi->lay)==0) continue;
+ if ((lar->lay & shi->lay)==0) continue;
- if(lar->shb || (lar->mode & LA_SHAD_RAY)) {
+ if (lar->shb || (lar->mode & LA_SHAD_RAY)) {
visifac= lamp_get_visibility(lar, shi->co, lv, &lampdist);
ir+= 1.0f;
- if(visifac <= 0.0f) {
+ if (visifac <= 0.0f) {
if (shi->mat->shadowonly_flag == MA_SO_OLD)
accum+= 1.0f;
continue;
}
inpr= dot_v3v3(shi->vn, lv);
- if(inpr <= 0.0f) {
+ if (inpr <= 0.0f) {
if (shi->mat->shadowonly_flag == MA_SO_OLD)
accum+= 1.0f;
@@ -1574,7 +1575,7 @@ static void shade_lamp_loop_only_shadow(ShadeInput *shi, ShadeResult *shr)
}
/* Apply shadows as alpha */
- if(ir>0.0f) {
+ if (ir>0.0f) {
if (shi->mat->shadowonly_flag == MA_SO_OLD) {
accum = 1.0f - accum/ir;
}
@@ -1604,13 +1605,13 @@ static void shade_lamp_loop_only_shadow(ShadeInput *shi, ShadeResult *shr)
}
/* quite disputable this... also note it doesn't mirror-raytrace */
- if((R.wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT)) && shi->amb!=0.0f) {
+ if ((R.wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT)) && shi->amb!=0.0f) {
float f;
- if(R.wrld.mode & WO_AMB_OCC) {
+ if (R.wrld.mode & WO_AMB_OCC) {
f= R.wrld.aoenergy*shi->amb;
- if(R.wrld.aomix==WO_AOADD) {
+ if (R.wrld.aomix==WO_AOADD) {
if (shi->mat->shadowonly_flag == MA_SO_OLD) {
f= f*(1.0f - rgb_to_grayscale(shi->ao));
shr->alpha= (shr->alpha + f)*f;
@@ -1624,7 +1625,7 @@ static void shade_lamp_loop_only_shadow(ShadeInput *shi, ShadeResult *shr)
shr->alpha= (1.0f - f)*shr->alpha + f*(1.0f - (1.0f - shr->alpha)*rgb_to_grayscale(shi->ao));
}
- if(R.wrld.mode & WO_ENV_LIGHT) {
+ if (R.wrld.mode & WO_ENV_LIGHT) {
if (shi->mat->shadowonly_flag == MA_SO_OLD) {
f= R.wrld.ao_env_energy*shi->amb*(1.0f - rgb_to_grayscale(shi->env));
shr->alpha= (shr->alpha + f)*f;
@@ -1654,10 +1655,10 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
memset(shr, 0, sizeof(ShadeResult));
- if(!(shi->mode & MA_TRANSP)) shi->alpha = 1.0f;
+ if (!(shi->mode & MA_TRANSP)) shi->alpha = 1.0f;
/* separate loop */
- if(ma->mode & MA_ONLYSHADOW) {
+ if (ma->mode & MA_ONLYSHADOW) {
shade_lamp_loop_only_shadow(shi, shr);
return;
}
@@ -1666,21 +1667,21 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
shi->refcol[0]= shi->refcol[1]= shi->refcol[2]= shi->refcol[3]= 0.0f;
/* material color itself */
- if(passflag & (SCE_PASS_COMBINED|SCE_PASS_RGBA)) {
- if(ma->mode & (MA_FACETEXTURE)) {
+ if (passflag & (SCE_PASS_COMBINED|SCE_PASS_RGBA)) {
+ if (ma->mode & (MA_FACETEXTURE)) {
shi->r= shi->vcol[0];
shi->g= shi->vcol[1];
shi->b= shi->vcol[2];
- if(ma->mode & (MA_FACETEXTURE_ALPHA))
+ if (ma->mode & (MA_FACETEXTURE_ALPHA))
shi->alpha= shi->vcol[3];
}
- else if(ma->mode & (MA_VERTEXCOLP)) {
+ else if (ma->mode & (MA_VERTEXCOLP)) {
float neg_alpha = 1.0f - shi->vcol[3];
shi->r= shi->r*neg_alpha + shi->vcol[0]*shi->vcol[3];
shi->g= shi->g*neg_alpha + shi->vcol[1]*shi->vcol[3];
shi->b= shi->b*neg_alpha + shi->vcol[2]*shi->vcol[3];
}
- if(ma->texco){
+ if (ma->texco) {
do_material_tex(shi, &R);
if (!(shi->mode & MA_TRANSP)) shi->alpha = 1.0f;
}
@@ -1690,8 +1691,8 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
shr->col[2]= shi->b*shi->alpha;
shr->col[3]= shi->alpha;
- if((ma->sss_flag & MA_DIFF_SSS) && !sss_pass_done(&R, ma)) {
- if(ma->sss_texfac == 0.0f) {
+ if ((ma->sss_flag & MA_DIFF_SSS) && !sss_pass_done(&R, ma)) {
+ if (ma->sss_texfac == 0.0f) {
shi->r= shi->g= shi->b= shi->alpha= 1.0f;
shr->col[0]= shr->col[1]= shr->col[2]= shr->col[3]= 1.0f;
}
@@ -1709,7 +1710,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
}
}
- if(ma->mode & MA_SHLESS) {
+ if (ma->mode & MA_SHLESS) {
shr->combined[0]= shi->r;
shr->combined[1]= shi->g;
shr->combined[2]= shi->b;
@@ -1717,7 +1718,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
return;
}
- if( (ma->mode & (MA_VERTEXCOL|MA_VERTEXCOLP))== MA_VERTEXCOL ) { // vertexcolor light
+ if ( (ma->mode & (MA_VERTEXCOL|MA_VERTEXCOLP))== MA_VERTEXCOL ) { // vertexcolor light
shr->emit[0]= shi->r*(shi->emit+shi->vcol[0]*shi->vcol[3]);
shr->emit[1]= shi->g*(shi->emit+shi->vcol[1]*shi->vcol[3]);
shr->emit[2]= shi->b*(shi->emit+shi->vcol[2]*shi->vcol[3]);
@@ -1729,12 +1730,12 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
}
/* AO pass */
- if(R.wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) {
- if(((passflag & SCE_PASS_COMBINED) && (shi->combinedflag & (SCE_PASS_AO|SCE_PASS_ENVIRONMENT|SCE_PASS_INDIRECT)))
+ if (R.wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) {
+ if (((passflag & SCE_PASS_COMBINED) && (shi->combinedflag & (SCE_PASS_AO|SCE_PASS_ENVIRONMENT|SCE_PASS_INDIRECT)))
|| (passflag & (SCE_PASS_AO|SCE_PASS_ENVIRONMENT|SCE_PASS_INDIRECT))) {
- if(R.r.mode & R_SHADOW) {
+ if (R.r.mode & R_SHADOW) {
/* AO was calculated for scanline already */
- if(shi->depth || shi->volume_depth)
+ if (shi->depth || shi->volume_depth)
ambient_occlusion(shi);
copy_v3_v3(shr->ao, shi->ao);
copy_v3_v3(shr->env, shi->env); // XXX multiply
@@ -1744,29 +1745,29 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
}
/* lighting pass */
- if(passflag & (SCE_PASS_COMBINED|SCE_PASS_DIFFUSE|SCE_PASS_SPEC|SCE_PASS_SHADOW)) {
+ if (passflag & (SCE_PASS_COMBINED|SCE_PASS_DIFFUSE|SCE_PASS_SPEC|SCE_PASS_SHADOW)) {
GroupObject *go;
ListBase *lights;
LampRen *lar;
lights= get_lights(shi);
- for(go=lights->first; go; go= go->next) {
+ for (go=lights->first; go; go= go->next) {
lar= go->lampren;
- if(lar==NULL) continue;
+ if (lar==NULL) continue;
/* yafray: ignore shading by photonlights, not used in Blender */
if (lar->type==LA_YF_PHOTON) continue;
/* test for lamp layer */
- if(lar->mode & LA_LAYER) if((lar->lay & shi->obi->lay)==0) continue;
- if((lar->lay & shi->lay)==0) continue;
+ if (lar->mode & LA_LAYER) if ((lar->lay & shi->obi->lay)==0) continue;
+ if ((lar->lay & shi->lay)==0) continue;
/* accumulates in shr->diff and shr->spec and shr->shad (diffuse with shadow!) */
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;
@@ -1775,18 +1776,18 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
if (shr->shad[1] < 0) shr->shad[1] = 0;
if (shr->shad[2] < 0) shr->shad[2] = 0;
- if(ma->sss_flag & MA_DIFF_SSS) {
+ if (ma->sss_flag & MA_DIFF_SSS) {
float sss[3], col[3], invalpha, texfac= ma->sss_texfac;
/* this will return false in the preprocess stage */
- if(sample_sss(&R, ma, shi->co, sss)) {
+ if (sample_sss(&R, ma, shi->co, sss)) {
invalpha= (shr->col[3] > FLT_EPSILON)? 1.0f/shr->col[3]: 1.0f;
- if(texfac==0.0f) {
+ if (texfac==0.0f) {
copy_v3_v3(col, shr->col);
mul_v3_fl(col, invalpha);
}
- else if(texfac==1.0f) {
+ else if (texfac==1.0f) {
col[0]= col[1]= col[2]= 1.0f;
mul_v3_fl(col, invalpha);
}
@@ -1802,7 +1803,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
shr->diff[1]= sss[1]*col[1];
shr->diff[2]= sss[2]*col[2];
- if(shi->combinedflag & SCE_PASS_SHADOW) {
+ if (shi->combinedflag & SCE_PASS_SHADOW) {
shr->shad[0]= shr->diff[0];
shr->shad[1]= shr->diff[1];
shr->shad[2]= shr->diff[2];
@@ -1810,43 +1811,43 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
}
}
- if(shi->combinedflag & SCE_PASS_SHADOW)
+ if (shi->combinedflag & SCE_PASS_SHADOW)
copy_v3_v3(shr->combined, shr->shad); /* note, no ';' ! */
else
copy_v3_v3(shr->combined, shr->diff);
/* calculate shadow pass, we use a multiplication mask */
/* if diff = 0,0,0 it doesn't matter what the shadow pass is, so leave it as is */
- if(passflag & SCE_PASS_SHADOW && !(shr->diff[0]==0.0f && shr->diff[1]==0.0f && shr->diff[2]==0.0f)) {
- if(shr->diff[0]!=0.0f) shr->shad[0]= shr->shad[0]/shr->diff[0];
+ if (passflag & SCE_PASS_SHADOW && !(shr->diff[0]==0.0f && shr->diff[1]==0.0f && shr->diff[2]==0.0f)) {
+ if (shr->diff[0]!=0.0f) shr->shad[0]= shr->shad[0]/shr->diff[0];
/* can't determine proper shadow from shad/diff (0/0), so use shadow intensity */
- else if(shr->shad[0]==0.0f) shr->shad[0]= shr->shad[3];
+ else if (shr->shad[0]==0.0f) shr->shad[0]= shr->shad[3];
- if(shr->diff[1]!=0.0f) shr->shad[1]= shr->shad[1]/shr->diff[1];
- else if(shr->shad[1]==0.0f) shr->shad[1]= shr->shad[3];
+ if (shr->diff[1]!=0.0f) shr->shad[1]= shr->shad[1]/shr->diff[1];
+ else if (shr->shad[1]==0.0f) shr->shad[1]= shr->shad[3];
- if(shr->diff[2]!=0.0f) shr->shad[2]= shr->shad[2]/shr->diff[2];
- else if(shr->shad[2]==0.0f) shr->shad[2]= shr->shad[3];
+ if (shr->diff[2]!=0.0f) shr->shad[2]= shr->shad[2]/shr->diff[2];
+ else if (shr->shad[2]==0.0f) shr->shad[2]= shr->shad[3];
}
/* exposure correction */
- if((R.wrld.exp!=0.0f || R.wrld.range!=1.0f) && !R.sss_points) {
+ if ((R.wrld.exp!=0.0f || R.wrld.range!=1.0f) && !R.sss_points) {
wrld_exposure_correct(shr->combined); /* has no spec! */
wrld_exposure_correct(shr->spec);
}
}
/* alpha in end, spec can influence it */
- if(passflag & (SCE_PASS_COMBINED)) {
- if((ma->fresnel_tra!=0.0f) && (shi->mode & MA_TRANSP))
+ if (passflag & (SCE_PASS_COMBINED)) {
+ if ((ma->fresnel_tra!=0.0f) && (shi->mode & MA_TRANSP))
shi->alpha*= fresnel_fac(shi->view, shi->vn, ma->fresnel_tra_i, ma->fresnel_tra);
/* note: shi->mode! */
- if(shi->mode & MA_TRANSP && (shi->mode & (MA_ZTRANSP|MA_RAYTRANSP))) {
- if(shi->spectra!=0.0f) {
+ if (shi->mode & MA_TRANSP && (shi->mode & (MA_ZTRANSP|MA_RAYTRANSP))) {
+ if (shi->spectra!=0.0f) {
float t = MAX3(shr->spec[0], shr->spec[1], shr->spec[2]);
t *= shi->spectra;
- if(t>1.0f) t= 1.0f;
+ if (t>1.0f) t= 1.0f;
shi->alpha= (1.0f-t)*shi->alpha+t;
}
}
@@ -1854,19 +1855,19 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
shr->alpha= shi->alpha;
/* from now stuff everything in shr->combined: ambient, AO, radio, ramps, exposure */
- if(!(ma->sss_flag & MA_DIFF_SSS) || !sss_pass_done(&R, ma)) {
- if(R.r.mode & R_SHADOW) {
+ if (!(ma->sss_flag & MA_DIFF_SSS) || !sss_pass_done(&R, ma)) {
+ if (R.r.mode & R_SHADOW) {
/* add AO in combined? */
- if(R.wrld.mode & WO_AMB_OCC)
- if(shi->combinedflag & SCE_PASS_AO)
+ if (R.wrld.mode & WO_AMB_OCC)
+ if (shi->combinedflag & SCE_PASS_AO)
ambient_occlusion_apply(shi, shr);
- if(R.wrld.mode & WO_ENV_LIGHT)
- if(shi->combinedflag & SCE_PASS_ENVIRONMENT)
+ if (R.wrld.mode & WO_ENV_LIGHT)
+ if (shi->combinedflag & SCE_PASS_ENVIRONMENT)
environment_lighting_apply(shi, shr);
- if(R.wrld.mode & WO_INDIRECT_LIGHT)
- if(shi->combinedflag & SCE_PASS_INDIRECT)
+ if (R.wrld.mode & WO_INDIRECT_LIGHT)
+ if (shi->combinedflag & SCE_PASS_INDIRECT)
indirect_lighting_apply(shi, shr);
}
@@ -1874,36 +1875,36 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
shr->combined[1]+= shi->ambg;
shr->combined[2]+= shi->ambb;
- if(ma->mode & MA_RAMP_COL) ramp_diffuse_result(shr->combined, shi);
+ if (ma->mode & MA_RAMP_COL) ramp_diffuse_result(shr->combined, shi);
}
- if(ma->mode & MA_RAMP_SPEC) ramp_spec_result(shr->spec, shi);
+ if (ma->mode & MA_RAMP_SPEC) ramp_spec_result(shr->spec, shi);
/* refcol is for envmap only */
- if(shi->refcol[0]!=0.0f) {
+ if (shi->refcol[0]!=0.0f) {
float result[3];
result[0]= shi->mirr*shi->refcol[1] + (1.0f - shi->mirr*shi->refcol[0])*shr->combined[0];
result[1]= shi->mirg*shi->refcol[2] + (1.0f - shi->mirg*shi->refcol[0])*shr->combined[1];
result[2]= shi->mirb*shi->refcol[3] + (1.0f - shi->mirb*shi->refcol[0])*shr->combined[2];
- if(passflag & SCE_PASS_REFLECT)
+ if (passflag & SCE_PASS_REFLECT)
sub_v3_v3v3(shr->refl, result, shr->combined);
- if(shi->combinedflag & SCE_PASS_REFLECT)
+ if (shi->combinedflag & SCE_PASS_REFLECT)
copy_v3_v3(shr->combined, result);
}
/* and add emit and spec */
- if(shi->combinedflag & SCE_PASS_EMIT)
+ if (shi->combinedflag & SCE_PASS_EMIT)
add_v3_v3(shr->combined, shr->emit);
- if(shi->combinedflag & SCE_PASS_SPEC)
+ if (shi->combinedflag & SCE_PASS_SPEC)
add_v3_v3(shr->combined, shr->spec);
/* modulate by the object color */
- if((ma->shade_flag & MA_OBCOLOR) && shi->obr->ob) {
- if(!(ma->sss_flag & MA_DIFF_SSS) || !sss_pass_done(&R, ma)) {
+ if ((ma->shade_flag & MA_OBCOLOR) && shi->obr->ob) {
+ if (!(ma->sss_flag & MA_DIFF_SSS) || !sss_pass_done(&R, ma)) {
float obcol[4];
copy_v4_v4(obcol, shi->obr->ob->col);
diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c
index 4192aaf42aa..dd1bddc5020 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>
@@ -77,16 +77,14 @@
#include "sss.h"
#include "zbuf.h"
-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 +162,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,30 +180,30 @@ 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);
- for(i= 0; i < max_iteration_count; i++) {
+ for (i= 0; i < max_iteration_count; i++) {
fsub= (fxn - fxn_1);
- if(fabsf(fsub) < tolerance)
+ if (fabsf(fsub) < tolerance)
break;
d= ((xn - xn_1)/fsub)*fxn;
- if(fabsf(d) < tolerance)
+ if (fabsf(d) < tolerance)
break;
xn_1= xn;
fxn_1= fxn;
xn= xn - d;
- if(xn > 1.0f) xn= 1.0f;
- if(xn_1 > 1.0f) xn_1= 1.0f;
+ if (xn > 1.0f) xn= 1.0f;
+ if (xn_1 > 1.0f) xn_1= 1.0f;
fxn= f_Rd(xn, ss->A, ss->ro);
}
/* avoid division by zero later */
- if(xn <= 0.0f)
+ if (xn <= 0.0f)
xn= 0.00001f;
return xn;
@@ -232,25 +230,25 @@ 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)
{
float indexf, t, idxf;
int index;
- if(rr > (RD_TABLE_RANGE_2*RD_TABLE_RANGE_2));
- else if(rr > RD_TABLE_RANGE) {
+ if (rr > (RD_TABLE_RANGE_2*RD_TABLE_RANGE_2));
+ else if (rr > RD_TABLE_RANGE) {
rr= sqrt(rr);
indexf= rr*(RD_TABLE_SIZE/RD_TABLE_RANGE_2);
index= (int)indexf;
idxf= (float)index;
t= indexf - idxf;
- if(index >= 0 && index < RD_TABLE_SIZE) {
+ if (index >= 0 && index < RD_TABLE_SIZE) {
rd[0]= (ss[0]->tableRd2[index]*(1-t) + ss[0]->tableRd2[index+1]*t);
rd[1]= (ss[1]->tableRd2[index]*(1-t) + ss[1]->tableRd2[index+1]*t);
rd[2]= (ss[2]->tableRd2[index]*(1-t) + ss[2]->tableRd2[index+1]*t);
@@ -263,7 +261,7 @@ static void approximate_Rd_rgb(ScatterSettings **ss, float rr, float *rd)
idxf= (float)index;
t= indexf - idxf;
- if(index >= 0 && index < RD_TABLE_SIZE) {
+ if (index >= 0 && index < RD_TABLE_SIZE) {
rd[0]= (ss[0]->tableRd[index]*(1-t) + ss[0]->tableRd[index+1]*t);
rd[1]= (ss[1]->tableRd[index]*(1-t) + ss[1]->tableRd[index+1]*t);
rd[2]= (ss[2]->tableRd[index]*(1-t) + ss[2]->tableRd[index+1]*t);
@@ -285,7 +283,7 @@ static void build_Rd_table(ScatterSettings *ss)
ss->tableRd= MEM_mallocN(sizeof(float)*size, "scatterTableRd");
ss->tableRd2= MEM_mallocN(sizeof(float)*size, "scatterTableRd");
- for(i= 0; i < size; i++) {
+ for (i= 0; i < size; i++) {
r= i*(RD_TABLE_RANGE/RD_TABLE_SIZE);
/*if(r < ss->invsigma_t_*ss->invsigma_t_)
r= ss->invsigma_t_*ss->invsigma_t_;*/
@@ -355,7 +353,7 @@ static void add_radiance(ScatterTree *tree, float *frontrad, float *backrad, flo
approximate_Rd_rgb(tree->ss, rr, rd);
- if(frontrad && area) {
+ if (frontrad && area) {
frontrd[0] = rd[0]*area;
frontrd[1] = rd[1]*area;
frontrd[2] = rd[2]*area;
@@ -368,7 +366,7 @@ static void add_radiance(ScatterTree *tree, float *frontrad, float *backrad, flo
result->rdsum[1] += frontrd[1];
result->rdsum[2] += frontrd[2];
}
- if(backrad && backarea) {
+ if (backrad && backarea) {
backrd[0] = rd[0]*backarea;
backrd[1] = rd[1]*backarea;
backrd[2] = rd[2]*backarea;
@@ -388,15 +386,15 @@ static void traverse_octree(ScatterTree *tree, ScatterNode *node, float *co, int
float sub[3], dist;
int i, index = 0;
- if(node->totpoint > 0) {
+ if (node->totpoint > 0) {
/* leaf - add radiance from all samples */
- for(i=0; i<node->totpoint; i++) {
+ for (i=0; i<node->totpoint; i++) {
ScatterPoint *p= &node->points[i];
sub_v3_v3v3(sub, co, p->co);
dist= dot_v3v3(sub, sub);
- if(p->back)
+ if (p->back)
add_radiance(tree, NULL, p->rad, 0.0f, p->area, dist, result);
else
add_radiance(tree, p->rad, NULL, p->area, 0.0f, dist, result);
@@ -407,11 +405,11 @@ static void traverse_octree(ScatterTree *tree, ScatterNode *node, float *co, int
if (self)
index = SUBNODE_INDEX(co, node->split);
- for(i=0; i<8; i++) {
- if(node->child[i]) {
+ for (i=0; i<8; i++) {
+ if (node->child[i]) {
ScatterNode *subnode= node->child[i];
- if(self && index == i) {
+ if (self && index == i) {
/* always traverse node containing the point */
traverse_octree(tree, subnode, co, 1, result);
}
@@ -421,7 +419,7 @@ static void traverse_octree(ScatterTree *tree, ScatterNode *node, float *co, int
dist= dot_v3v3(sub, sub);
/* actually area/dist > error, but this avoids division */
- if(subnode->area+subnode->backarea>tree->error*dist) {
+ if (subnode->area+subnode->backarea>tree->error*dist) {
traverse_octree(tree, subnode, co, 0, result);
}
else {
@@ -444,10 +442,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);
@@ -458,13 +456,13 @@ static void compute_radiance(ScatterTree *tree, float *co, float *rad)
copy_v3_v3(rdsum, result.rdsum);
add_v3_v3v3(backrdsum, result.rdsum, result.backrdsum);
- if(rdsum[0] > 1e-16f) rad[0]= tree->ss[0]->color*rad[0]/rdsum[0];
- if(rdsum[1] > 1e-16f) rad[1]= tree->ss[1]->color*rad[1]/rdsum[1];
- if(rdsum[2] > 1e-16f) rad[2]= tree->ss[2]->color*rad[2]/rdsum[2];
+ if (rdsum[0] > 1e-16f) rad[0]= tree->ss[0]->color*rad[0]/rdsum[0];
+ if (rdsum[1] > 1e-16f) rad[1]= tree->ss[1]->color*rad[1]/rdsum[1];
+ if (rdsum[2] > 1e-16f) rad[2]= tree->ss[2]->color*rad[2]/rdsum[2];
- if(backrdsum[0] > 1e-16f) backrad[0]= tree->ss[0]->color*backrad[0]/backrdsum[0];
- if(backrdsum[1] > 1e-16f) backrad[1]= tree->ss[1]->color*backrad[1]/backrdsum[1];
- if(backrdsum[2] > 1e-16f) backrad[2]= tree->ss[2]->color*backrad[2]/backrdsum[2];
+ if (backrdsum[0] > 1e-16f) backrad[0]= tree->ss[0]->color*backrad[0]/backrdsum[0];
+ if (backrdsum[1] > 1e-16f) backrad[1]= tree->ss[1]->color*backrad[1]/backrdsum[1];
+ if (backrdsum[2] > 1e-16f) backrad[2]= tree->ss[2]->color*backrad[2]/backrdsum[2];
rad[0]= MAX2(rad[0], backrad[0]);
rad[1]= MAX2(rad[1], backrad[1]);
@@ -484,8 +482,8 @@ 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 */
- for(i=0; i<node->totpoint; i++) {
+ * and total area */
+ for (i=0; i<node->totpoint; i++) {
p= &node->points[i];
rad= p->area*fabsf(p->rad[0] + p->rad[1] + p->rad[2]);
@@ -495,7 +493,7 @@ static void sum_leaf_radiance(ScatterTree *UNUSED(tree), ScatterNode *node)
node->co[1] += rad*p->co[1];
node->co[2] += rad*p->co[2];
- if(p->back) {
+ if (p->back) {
node->backrad[0] += p->rad[0]*p->area;
node->backrad[1] += p->rad[1]*p->area;
node->backrad[2] += p->rad[2]*p->area;
@@ -511,20 +509,20 @@ static void sum_leaf_radiance(ScatterTree *UNUSED(tree), ScatterNode *node)
}
}
- if(node->area > 1e-16f) {
+ if (node->area > 1e-16f) {
inv= 1.0f/node->area;
node->rad[0] *= inv;
node->rad[1] *= inv;
node->rad[2] *= inv;
}
- if(node->backarea > 1e-16f) {
+ if (node->backarea > 1e-16f) {
inv= 1.0f/node->backarea;
node->backrad[0] *= inv;
node->backrad[1] *= inv;
node->backrad[2] *= inv;
}
- if(totrad > 1e-16f) {
+ if (totrad > 1e-16f) {
inv= 1.0f/totrad;
node->co[0] *= inv;
node->co[1] *= inv;
@@ -532,8 +530,8 @@ 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 */
- for(i=0; i<node->totpoint; i++) {
+ * the tree at a good position, they count for rdsum too */
+ for (i=0; i<node->totpoint; i++) {
p= &node->points[i];
node->co[0] += p->co[0];
@@ -558,9 +556,9 @@ 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 */
- for(i=0; i<8; i++) {
- if(node->child[i] == NULL)
+ * and total area */
+ for (i=0; i<8; i++) {
+ if (node->child[i] == NULL)
continue;
subnode= node->child[i];
@@ -585,20 +583,20 @@ static void sum_branch_radiance(ScatterTree *UNUSED(tree), ScatterNode *node)
node->backarea += subnode->backarea;
}
- if(node->area > 1e-16f) {
+ if (node->area > 1e-16f) {
inv= 1.0f/node->area;
node->rad[0] *= inv;
node->rad[1] *= inv;
node->rad[2] *= inv;
}
- if(node->backarea > 1e-16f) {
+ if (node->backarea > 1e-16f) {
inv= 1.0f/node->backarea;
node->backrad[0] *= inv;
node->backrad[1] *= inv;
node->backrad[2] *= inv;
}
- if(totrad > 1e-16f) {
+ if (totrad > 1e-16f) {
inv= 1.0f/totrad;
node->co[0] *= inv;
node->co[1] *= inv;
@@ -606,11 +604,11 @@ 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++) {
- if(node->child[i]) {
+ for (i=0; i<8; i++) {
+ if (node->child[i]) {
subnode= node->child[i];
node->co[0] += subnode->co[0];
@@ -629,14 +627,14 @@ static void sum_branch_radiance(ScatterTree *UNUSED(tree), ScatterNode *node)
static void sum_radiance(ScatterTree *tree, ScatterNode *node)
{
- if(node->totpoint > 0) {
+ if (node->totpoint > 0) {
sum_leaf_radiance(tree, node);
}
else {
int i;
- for(i=0; i<8; i++)
- if(node->child[i])
+ for (i=0; i<8; i++)
+ if (node->child[i])
sum_radiance(tree, node->child[i]);
sum_branch_radiance(tree, node);
@@ -660,8 +658,8 @@ static void create_octree_node(ScatterTree *tree, ScatterNode *node, float *mid,
float submid[3], subsize[3];
/* stopping condition */
- if(node->totpoint <= MAX_OCTREE_NODE_POINTS || depth == MAX_OCTREE_DEPTH) {
- for(i=0; i<node->totpoint; i++)
+ if (node->totpoint <= MAX_OCTREE_NODE_POINTS || depth == MAX_OCTREE_DEPTH) {
+ for (i=0; i<node->totpoint; i++)
node->points[i]= *(refpoints[i]);
return;
@@ -679,40 +677,40 @@ static void create_octree_node(ScatterTree *tree, ScatterNode *node, float *mid,
memset(noffset, 0, sizeof(noffset));
/* count points in subnodes */
- for(i=0; i<node->totpoint; i++) {
+ for (i=0; i<node->totpoint; i++) {
index= SUBNODE_INDEX(refpoints[i]->co, node->split);
tmppoints[i]= refpoints[i];
nsize[index]++;
}
/* 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. */
- for(usedi=0, usednodes=0, i=0; i<8; i++) {
- if(nsize[i]) {
+ * 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++;
usedi = i;
}
- if(i != 0)
+ if (i != 0)
noffset[i]= noffset[i-1]+nsize[i-1];
}
- if(usednodes<=1) {
+ if (usednodes<=1) {
subnode_middle(usedi, mid, subsize, submid);
create_octree_node(tree, node, submid, subsize, refpoints, depth+1);
return;
}
/* reorder refpoints by subnode */
- for(i=0; i<node->totpoint; i++) {
+ for (i=0; i<node->totpoint; i++) {
index= SUBNODE_INDEX(tmppoints[i]->co, node->split);
refpoints[noffset[index]]= tmppoints[i];
noffset[index]++;
}
/* create subnodes */
- for(subco=0, i=0; i<8; subco+=nsize[i], i++) {
- if(nsize[i] > 0) {
+ for (subco=0, i=0; i<8; subco+=nsize[i], i++) {
+ if (nsize[i] > 0) {
subnode= BLI_memarena_alloc(tree->arena, sizeof(ScatterNode));
node->child[i]= subnode;
subnode->points= node->points + subco;
@@ -760,7 +758,7 @@ ScatterTree *scatter_tree_new(ScatterSettings *ss[3], float scale, float error,
/* build points */
INIT_MINMAX(tree->min, tree->max);
- for(i=0; i<totpoint; i++) {
+ for (i=0; i<totpoint; i++) {
copy_v3_v3(points[i].co, co[i]);
copy_v3_v3(points[i].rad, color[i]);
points[i].area= fabsf(area[i])/(tree->scale*tree->scale);
@@ -859,13 +857,13 @@ static void sss_create_tree_mat(Render *re, Material *mat)
float (*co)[3] = NULL, (*color)[3] = NULL, *area = NULL;
int totpoint = 0, osa, osaflag, partsdone;
- if(re->test_break(re->tbh))
+ if (re->test_break(re->tbh))
return;
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);
@@ -880,14 +878,14 @@ static void sss_create_tree_mat(Render *re, Material *mat)
re->sss_mat= mat;
re->i.partsdone= 0;
- if(!(re->r.scemode & R_PREVIEWBUTS))
+ if (!(re->r.scemode & R_PREVIEWBUTS))
re->result= NULL;
BLI_rw_mutex_unlock(&re->resultmutex);
RE_TileProcessor(re);
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
- if(!(re->r.scemode & R_PREVIEWBUTS)) {
+ if (!(re->r.scemode & R_PREVIEWBUTS)) {
RE_FreeRenderResult(re->result);
re->result= rr;
}
@@ -900,19 +898,19 @@ static void sss_create_tree_mat(Render *re, Material *mat)
if (osaflag) re->r.mode |= R_OSA;
/* no points? no tree */
- if(!points.first)
+ if (!points.first)
return;
/* merge points together into a single buffer */
- if(!re->test_break(re->tbh)) {
- for(totpoint=0, p=points.first; p; p=p->next)
+ if (!re->test_break(re->tbh)) {
+ for (totpoint=0, p=points.first; p; p=p->next)
totpoint += p->totpoint;
co= MEM_mallocN(sizeof(*co)*totpoint, "SSSCo");
color= MEM_mallocN(sizeof(*color)*totpoint, "SSSColor");
area= MEM_mallocN(sizeof(*area)*totpoint, "SSSArea");
- for(totpoint=0, p=points.first; p; p=p->next) {
+ for (totpoint=0, p=points.first; p; p=p->next) {
memcpy(co+totpoint, p->co, sizeof(*co)*p->totpoint);
memcpy(color+totpoint, p->color, sizeof(*color)*p->totpoint);
memcpy(area+totpoint, p->area, sizeof(*area)*p->totpoint);
@@ -921,7 +919,7 @@ static void sss_create_tree_mat(Render *re, Material *mat)
}
/* free points */
- for(p=points.first; p; p=p->next) {
+ for (p=points.first; p; p=p->next) {
MEM_freeN(p->co);
MEM_freeN(p->color);
MEM_freeN(p->area);
@@ -929,7 +927,7 @@ static void sss_create_tree_mat(Render *re, Material *mat)
BLI_freelistN(&points);
/* build tree */
- if(!re->test_break(re->tbh)) {
+ if (!re->test_break(re->tbh)) {
SSSData *sss= MEM_callocN(sizeof(*sss), "SSSData");
float ior= mat->sss_ior, cfac= mat->sss_colfac;
float *radius= mat->sss_radius;
@@ -937,7 +935,7 @@ static void sss_create_tree_mat(Render *re, Material *mat)
float error = mat->sss_error;
error= get_render_aosss_error(&re->r, error);
- if((re->r.scemode & R_PREVIEWBUTS) && error < 0.5f)
+ if ((re->r.scemode & R_PREVIEWBUTS) && error < 0.5f)
error= 0.5f;
sss->ss[0]= scatter_settings_new(mat->sss_col[0], radius[0], ior, cfac, fw, bw);
@@ -965,7 +963,7 @@ void sss_add_points(Render *re, float (*co)[3], float (*color)[3], float *area,
{
SSSPoints *p;
- if(totpoint > 0) {
+ if (totpoint > 0) {
p= MEM_callocN(sizeof(SSSPoints), "SSSPoints");
p->co= co;
@@ -999,15 +997,15 @@ void make_sss_tree(Render *re)
re->i.infostr= "SSS preprocessing";
re->stats_draw(re->sdh, &re->i);
- for(mat= re->main->mat.first; mat; mat= mat->id.next)
- if(mat->id.us && (mat->flag & MA_IS_USED) && (mat->sss_flag & MA_DIFF_SSS))
+ for (mat= re->main->mat.first; mat; mat= mat->id.next)
+ if (mat->id.us && (mat->flag & MA_IS_USED) && (mat->sss_flag & MA_DIFF_SSS))
sss_create_tree_mat(re, mat);
/* XXX preview exception */
/* localizing preview render data is not fun for node trees :( */
- if(re->main!=G.main) {
- for(mat= G.main->mat.first; mat; mat= mat->id.next)
- if(mat->id.us && (mat->flag & MA_IS_USED) && (mat->sss_flag & MA_DIFF_SSS))
+ if (re->main!=G.main) {
+ for (mat= G.main->mat.first; mat; mat= mat->id.next)
+ if (mat->id.us && (mat->flag & MA_IS_USED) && (mat->sss_flag & MA_DIFF_SSS))
sss_create_tree_mat(re, mat);
}
@@ -1015,10 +1013,10 @@ void make_sss_tree(Render *re)
void free_sss(Render *re)
{
- if(re->sss_hash) {
+ if (re->sss_hash) {
GHashIterator *it= BLI_ghashIterator_new(re->sss_hash);
- while(!BLI_ghashIterator_isDone(it)) {
+ while (!BLI_ghashIterator_isDone(it)) {
sss_free_tree(BLI_ghashIterator_getValue(it));
BLI_ghashIterator_step(it);
}
@@ -1031,10 +1029,10 @@ void free_sss(Render *re)
int sample_sss(Render *re, Material *mat, float *co, float *color)
{
- if(re->sss_hash) {
+ if (re->sss_hash) {
SSSData *sss= BLI_ghash_lookup(re->sss_hash, mat);
- if(sss) {
+ if (sss) {
scatter_tree_sample(sss->tree, co, color);
return 1;
}
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c
index cdc185160d5..e29623aee22 100644
--- a/source/blender/render/intern/source/strand.c
+++ b/source/blender/render/intern/source/strand.c
@@ -74,8 +74,8 @@ static float strand_eval_width(Material *ma, float strandco)
strandco= 0.5f*(strandco + 1.0f);
- if(ma->strand_ease!=0.0f) {
- if(ma->strand_ease<0.0f)
+ if (ma->strand_ease!=0.0f) {
+ if (ma->strand_ease<0.0f)
fac= pow(strandco, 1.0f+ma->strand_ease);
else
fac= pow(strandco, 1.0f/(1.0f-ma->strand_ease));
@@ -103,27 +103,27 @@ void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint)
copy_v3_v3(p[2], sseg->v[2]->co);
copy_v3_v3(p[3], sseg->v[3]->co);
- if(sseg->obi->flag & R_TRANSFORMED) {
+ if (sseg->obi->flag & R_TRANSFORMED) {
mul_m4_v3(sseg->obi->mat, p[0]);
mul_m4_v3(sseg->obi->mat, p[1]);
mul_m4_v3(sseg->obi->mat, p[2]);
mul_m4_v3(sseg->obi->mat, p[3]);
}
- if(t == 0.0f) {
+ if (t == 0.0f) {
copy_v3_v3(spoint->co, p[1]);
spoint->strandco= sseg->v[1]->strandco;
spoint->dtstrandco= (sseg->v[2]->strandco - sseg->v[0]->strandco);
- if(sseg->v[0] != sseg->v[1])
+ if (sseg->v[0] != sseg->v[1])
spoint->dtstrandco *= 0.5f;
}
- else if(t == 1.0f) {
+ else if (t == 1.0f) {
copy_v3_v3(spoint->co, p[2]);
spoint->strandco= sseg->v[2]->strandco;
spoint->dtstrandco= (sseg->v[3]->strandco - sseg->v[1]->strandco);
- if(sseg->v[3] != sseg->v[2])
+ if (sseg->v[3] != sseg->v[2])
spoint->dtstrandco *= 0.5f;
}
else {
@@ -157,17 +157,17 @@ void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint)
dy= strandbuf->winy*cross[1]*strandbuf->winmat[1][1]/w;
w= sqrt(dx*dx + dy*dy);
- if(w > 0.0f) {
- if(strandbuf->flag & R_STRAND_B_UNITS) {
+ if (w > 0.0f) {
+ if (strandbuf->flag & R_STRAND_B_UNITS) {
const float crosslen= len_v3(cross);
w= 2.0f*crosslen*strandbuf->minwidth/w;
- if(spoint->width < w) {
+ if (spoint->width < w) {
spoint->alpha= spoint->width/w;
spoint->width= w;
}
- if(simplify)
+ if (simplify)
/* squared because we only change width, not length */
spoint->width *= simplify[0]*simplify[0];
@@ -211,45 +211,45 @@ static void interpolate_shade_result(ShadeResult *shr1, ShadeResult *shr2, float
interpolate_vec4(shr1->combined, shr2->combined, t, negt, shr->combined);
- if(addpassflag & SCE_PASS_VECTOR) {
+ if (addpassflag & SCE_PASS_VECTOR) {
interpolate_vec4(shr1->winspeed, shr2->winspeed, t, negt, shr->winspeed);
}
/* optim... */
- if(addpassflag & ~(SCE_PASS_VECTOR)) {
- if(addpassflag & SCE_PASS_Z)
+ if (addpassflag & ~(SCE_PASS_VECTOR)) {
+ if (addpassflag & SCE_PASS_Z)
interpolate_vec1(&shr1->z, &shr2->z, t, negt, &shr->z);
- if(addpassflag & SCE_PASS_RGBA)
+ if (addpassflag & SCE_PASS_RGBA)
interpolate_vec4(shr1->col, shr2->col, t, negt, shr->col);
- if(addpassflag & SCE_PASS_NORMAL) {
+ if (addpassflag & SCE_PASS_NORMAL) {
interpolate_vec3(shr1->nor, shr2->nor, t, negt, shr->nor);
normalize_v3(shr->nor);
}
- if(addpassflag & SCE_PASS_EMIT)
+ if (addpassflag & SCE_PASS_EMIT)
interpolate_vec3(shr1->emit, shr2->emit, t, negt, shr->emit);
- if(addpassflag & SCE_PASS_DIFFUSE)
+ if (addpassflag & SCE_PASS_DIFFUSE)
interpolate_vec3(shr1->diff, shr2->diff, t, negt, shr->diff);
- if(addpassflag & SCE_PASS_SPEC)
+ if (addpassflag & SCE_PASS_SPEC)
interpolate_vec3(shr1->spec, shr2->spec, t, negt, shr->spec);
- if(addpassflag & SCE_PASS_SHADOW)
+ if (addpassflag & SCE_PASS_SHADOW)
interpolate_vec3(shr1->shad, shr2->shad, t, negt, shr->shad);
- if(addpassflag & SCE_PASS_AO)
+ if (addpassflag & SCE_PASS_AO)
interpolate_vec3(shr1->ao, shr2->ao, t, negt, shr->ao);
- if(addpassflag & SCE_PASS_ENVIRONMENT)
+ if (addpassflag & SCE_PASS_ENVIRONMENT)
interpolate_vec3(shr1->env, shr2->env, t, negt, shr->env);
- if(addpassflag & SCE_PASS_INDIRECT)
+ if (addpassflag & SCE_PASS_INDIRECT)
interpolate_vec3(shr1->indirect, shr2->indirect, t, negt, shr->indirect);
- if(addpassflag & SCE_PASS_REFLECT)
+ if (addpassflag & SCE_PASS_REFLECT)
interpolate_vec3(shr1->refl, shr2->refl, t, negt, shr->refl);
- if(addpassflag & SCE_PASS_REFRACT)
+ if (addpassflag & SCE_PASS_REFRACT)
interpolate_vec3(shr1->refr, shr2->refr, t, negt, shr->refr);
- if(addpassflag & SCE_PASS_MIST)
+ if (addpassflag & SCE_PASS_MIST)
interpolate_vec1(&shr1->mist, &shr2->mist, t, negt, &shr->mist);
}
}
static void strand_apply_shaderesult_alpha(ShadeResult *shr, float alpha)
{
- if(alpha < 1.0f) {
+ if (alpha < 1.0f) {
shr->combined[0] *= alpha;
shr->combined[1] *= alpha;
shr->combined[2] *= alpha;
@@ -273,7 +273,7 @@ static void strand_shade_point(Render *re, ShadeSample *ssamp, StrandSegment *ss
memset(&vlr, 0, sizeof(vlr));
vlr.flag= R_SMOOTH;
- if(sseg->buffer->ma->mode & MA_TANGENT_STR)
+ if (sseg->buffer->ma->mode & MA_TANGENT_STR)
vlr.flag |= R_TANGENT;
shi->vlr= &vlr;
@@ -308,8 +308,8 @@ static void strand_shade_point(Render *re, ShadeSample *ssamp, StrandSegment *ss
strand_apply_shaderesult_alpha(shr, spoint->alpha);
/* include lamphalos for strand, since halo layer was added already */
- if(re->flag & R_LAMPHALO)
- if(shi->layflag & SCE_LAY_HALO)
+ if (re->flag & R_LAMPHALO)
+ if (shi->layflag & SCE_LAY_HALO)
renderspothalo(shi, shr->combined, shr->combined[3]);
shi->strand= NULL;
@@ -352,7 +352,7 @@ static void strand_shade_get(Render *re, StrandShadeCache *cache, ShadeSample *s
hashshr= BLI_ghash_lookup(cache->resulthash, svert);
refcount= BLI_ghash_lookup(cache->refcounthash, svert);
- if(!hashshr) {
+ if (!hashshr) {
/* not shaded yet, shade and insert into hash */
p.t= (sseg->v[1] == svert)? 0.0f: 1.0f;
strand_eval_point(sseg, &p);
@@ -368,7 +368,7 @@ static void strand_shade_get(Render *re, StrandShadeCache *cache, ShadeSample *s
/* lower reference count and remove if not needed anymore by any samples */
(*refcount)--;
- if(*refcount == 0) {
+ if (*refcount == 0) {
BLI_ghash_remove(cache->resulthash, svert, NULL, (GHashValFreeFP)MEM_freeN);
BLI_ghash_remove(cache->refcounthash, svert, NULL, NULL);
}
@@ -387,7 +387,7 @@ void strand_shade_segment(Render *re, StrandShadeCache *cache, StrandSegment *ss
interpolate_shade_result(&shr1, &shr2, t, ssamp->shr, addpassflag);
/* apply alpha along width */
- if(sseg->buffer->widthfade != 0.0f) {
+ if (sseg->buffer->widthfade != 0.0f) {
s = 1.0f - pow(fabs(s), sseg->buffer->widthfade);
strand_apply_shaderesult_alpha(ssamp->shr, s);
@@ -402,7 +402,7 @@ void strand_shade_unref(StrandShadeCache *cache, StrandVert *svert)
refcount= BLI_ghash_lookup(cache->refcounthash, svert);
(*refcount)--;
- if(*refcount == 0) {
+ if (*refcount == 0) {
BLI_ghash_remove(cache->resulthash, svert, NULL, (GHashValFreeFP)MEM_freeN);
BLI_ghash_remove(cache->refcounthash, svert, NULL, NULL);
}
@@ -412,7 +412,7 @@ static void strand_shade_refcount(StrandShadeCache *cache, StrandVert *svert)
{
int *refcount= BLI_ghash_lookup(cache->refcounthash, svert);
- if(!refcount) {
+ if (!refcount) {
refcount= BLI_memarena_alloc(cache->memarena, sizeof(int));
*refcount= 1;
BLI_ghash_insert(cache->refcounthash, svert, refcount);
@@ -454,9 +454,9 @@ static int compare_strand_segment(const void *poin1, const void *poin2)
const StrandSortSegment *seg1= (const StrandSortSegment*)poin1;
const StrandSortSegment *seg2= (const StrandSortSegment*)poin2;
- if(seg1->z < seg2->z)
+ if (seg1->z < seg2->z)
return -1;
- else if(seg1->z == seg2->z)
+ else if (seg1->z == seg2->z)
return 0;
else
return 1;
@@ -493,7 +493,7 @@ static APixstrand *addpsmainAstrand(ListBase *lb)
static APixstrand *addpsAstrand(ZSpan *zspan)
{
/* make new PS */
- if(zspan->apstrandmcounter==0) {
+ if (zspan->apstrandmcounter==0) {
zspan->curpstrand= addpsmainAstrand(zspan->apsmbase);
zspan->apstrandmcounter= 4095;
}
@@ -524,19 +524,19 @@ static void do_strand_fillac(void *handle, int x, int y, float u, float v, float
/* check against solid z-buffer */
zverg= (int)z;
- if(spart->rectdaps) {
+ if (spart->rectdaps) {
/* find the z of the sample */
PixStr *ps;
intptr_t *rd= spart->rectdaps + offset;
bufferz= 0x7FFFFFFF;
- if(spart->rectmask) maskz= 0x7FFFFFFF;
+ if (spart->rectmask) maskz= 0x7FFFFFFF;
- if(*rd) {
- for(ps= (PixStr *)(*rd); ps; ps= ps->next) {
- if(mask & ps->mask) {
+ if (*rd) {
+ for (ps= (PixStr *)(*rd); ps; ps= ps->next) {
+ if (mask & ps->mask) {
bufferz= ps->z;
- if(spart->rectmask)
+ if (spart->rectmask)
maskz= ps->maskz;
break;
}
@@ -545,25 +545,25 @@ static void do_strand_fillac(void *handle, int x, int y, float u, float v, float
}
else {
bufferz= (spart->rectz)? spart->rectz[offset]: 0x7FFFFFFF;
- if(spart->rectmask)
+ if (spart->rectmask)
maskz= spart->rectmask[offset];
}
#define CHECK_ADD(n) \
- if(apn->p[n]==strnr && apn->obi[n]==obi && apn->seg[n]==seg) \
- { if(!(apn->mask[n] & mask)) { apn->mask[n] |= mask; apn->v[n] += t; apn->u[n] += s; } break; }
+ if (apn->p[n]==strnr && apn->obi[n]==obi && apn->seg[n]==seg) \
+ { if (!(apn->mask[n] & mask)) { apn->mask[n] |= mask; apn->v[n] += t; apn->u[n] += s; } break; }
#define CHECK_ASSIGN(n) \
- if(apn->p[n]==0) \
+ if (apn->p[n]==0) \
{apn->obi[n]= obi; apn->p[n]= strnr; apn->z[n]= zverg; apn->mask[n]= mask; apn->v[n]= t; apn->u[n]= s; apn->seg[n]= seg; break; }
/* add to pixel list */
- if(zverg < bufferz && (spart->totapixbuf[offset] < MAX_ZROW)) {
- if(!spart->rectmask || zverg > maskz) {
+ if (zverg < bufferz && (spart->totapixbuf[offset] < MAX_ZROW)) {
+ if (!spart->rectmask || zverg > maskz) {
t = u*spart->t[0] + v*spart->t[1] + (1.0f-u-v)*spart->t[2];
s = fabs(u*spart->s[0] + v*spart->s[1] + (1.0f-u-v)*spart->s[2]);
apn= spart->apixbuf + offset;
- while(apn) {
+ while (apn) {
CHECK_ADD(0);
CHECK_ADD(1);
CHECK_ADD(2);
@@ -579,7 +579,7 @@ static void do_strand_fillac(void *handle, int x, int y, float u, float v, float
CHECK_ASSIGN(0);
}
- if(cache) {
+ if (cache) {
strand_shade_refcount(cache, sseg->v[1]);
strand_shade_refcount(cache, sseg->v[2]);
}
@@ -599,11 +599,11 @@ static int strand_test_clip(float winmat[][4], ZSpan *UNUSED(zspan), float *boun
/* we compare z without perspective division for segment sorting */
*zcomp= hoco[2];
- if(hoco[0]+widthx < bounds[0]*hoco[3]) clipflag |= 1;
- else if(hoco[0]-widthx > bounds[1]*hoco[3]) clipflag |= 2;
+ if (hoco[0]+widthx < bounds[0]*hoco[3]) clipflag |= 1;
+ else if (hoco[0]-widthx > bounds[1]*hoco[3]) clipflag |= 2;
- if(hoco[1]-widthy > bounds[3]*hoco[3]) clipflag |= 4;
- else if(hoco[1]+widthy < bounds[2]*hoco[3]) clipflag |= 8;
+ if (hoco[1]-widthy > bounds[3]*hoco[3]) clipflag |= 4;
+ else if (hoco[1]+widthy < bounds[2]*hoco[3]) clipflag |= 8;
clipflag |= testclip(hoco);
@@ -619,7 +619,7 @@ static void do_scanconvert_strand(Render *UNUSED(re), StrandPart *spart, ZSpan *
copy_v3_v3(jco3, co3);
copy_v3_v3(jco4, co4);
- if(spart->jit) {
+ if (spart->jit) {
jx= -spart->jit[sample][0];
jy= -spart->jit[sample][1];
@@ -651,13 +651,13 @@ static void do_scanconvert_strand(Render *UNUSED(re), StrandPart *spart, ZSpan *
static void strand_render(Render *re, StrandSegment *sseg, float winmat[][4], StrandPart *spart, ZSpan *zspan, int totzspan, StrandPoint *p1, StrandPoint *p2)
{
- if(spart) {
+ if (spart) {
float t= p2->t;
float dt= p2->t - p1->t;
int a;
- if(re->osa) {
- for(a=0; a<re->osa; a++)
+ if (re->osa) {
+ for (a=0; a<re->osa; a++)
do_scanconvert_strand(re, spart, zspan, t, dt, p1->zco2, p1->zco1, p2->zco1, p2->zco2, a);
}
else
@@ -674,13 +674,13 @@ static void strand_render(Render *re, StrandSegment *sseg, float winmat[][4], St
projectvert(p2->co, winmat, hoco2);
- for(a=0; a<totzspan; a++) {
+ for (a=0; a<totzspan; a++) {
#if 0
/* render both strand and single pixel wire to counter aliasing */
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 */
+ * similar across frames, and so reduces flicker */
zbufsinglewire(&zspan[a], obi, index, hoco1, hoco2);
}
}
@@ -692,7 +692,7 @@ static int strand_segment_recursive(Render *re, float winmat[][4], StrandPart *s
StrandBuffer *buffer= sseg->buffer;
float dot, d1[2], d2[2], len1, len2;
- if(depth == buffer->maxdepth)
+ if (depth == buffer->maxdepth)
return 0;
p.t= (p1->t + p2->t)*0.5f;
@@ -707,14 +707,14 @@ static int strand_segment_recursive(Render *re, float winmat[][4], StrandPart *s
d2[1]= (p2->y - p.y);
len2= d2[0]*d2[0] + d2[1]*d2[1];
- if(len1 == 0.0f || len2 == 0.0f)
+ if (len1 == 0.0f || len2 == 0.0f)
return 0;
dot= d1[0]*d2[0] + d1[1]*d2[1];
- if(dot*dot > sseg->sqadaptcos*len1*len2)
+ if (dot*dot > sseg->sqadaptcos*len1*len2)
return 0;
- if(spart) {
+ if (spart) {
do_strand_point_project(winmat, zspan, p.co1, p.hoco1, p.zco1);
do_strand_point_project(winmat, zspan, p.co2, p.hoco2, p.zco2);
}
@@ -727,9 +727,9 @@ static int strand_segment_recursive(Render *re, float winmat[][4], StrandPart *s
#endif
}
- if(!strand_segment_recursive(re, winmat, spart, zspan, totzspan, sseg, p1, &p, depth+1))
+ if (!strand_segment_recursive(re, winmat, spart, zspan, totzspan, sseg, p1, &p, depth+1))
strand_render(re, sseg, winmat, spart, zspan, totzspan, p1, &p);
- if(!strand_segment_recursive(re, winmat, spart, zspan, totzspan, sseg, &p, p2, depth+1))
+ if (!strand_segment_recursive(re, winmat, spart, zspan, totzspan, sseg, &p, p2, depth+1))
strand_render(re, sseg, winmat, spart, zspan, totzspan, &p, p2);
return 1;
@@ -749,7 +749,7 @@ void render_strand_segment(Render *re, float winmat[][4], StrandPart *spart, ZSp
strand_eval_point(sseg, p2);
strand_project_point(buffer->winmat, buffer->winx, buffer->winy, p2);
- if(spart) {
+ if (spart) {
do_strand_point_project(winmat, zspan, p1->co1, p1->hoco1, p1->zco1);
do_strand_point_project(winmat, zspan, p1->co2, p1->hoco2, p1->zco2);
do_strand_point_project(winmat, zspan, p2->co1, p2->hoco1, p2->zco1);
@@ -768,7 +768,7 @@ void render_strand_segment(Render *re, float winmat[][4], StrandPart *spart, ZSp
#endif
}
- if(!strand_segment_recursive(re, winmat, spart, zspan, totzspan, sseg, p1, p2, 0))
+ if (!strand_segment_recursive(re, winmat, spart, zspan, totzspan, sseg, p1, p2, 0))
strand_render(re, sseg, winmat, spart, zspan, totzspan, p1, p2);
}
@@ -788,9 +788,9 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa
float z[4], bounds[4], obwinmat[4][4];
int a, b, c, i, totsegment, clip[4];
- if(re->test_break(re->tbh))
+ if (re->test_break(re->tbh))
return 0;
- if(re->totstrand == 0)
+ if (re->totstrand == 0)
return 0;
/* setup StrandPart */
@@ -818,7 +818,7 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa
zspan.zofsy= -pa->disprect.ymin;
/* to center the sample position */
- if(!shadow) {
+ if (!shadow) {
zspan.zofsx -= 0.5f;
zspan.zofsy -= 0.5f;
}
@@ -836,17 +836,17 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa
totsegment= 0;
/* for all object instances */
- for(obi=re->instancetable.first, i=0; obi; obi=obi->next, i++) {
+ for (obi=re->instancetable.first, i=0; obi; obi=obi->next, i++) {
Material *ma;
float widthx, widthy;
obr= obi->obr;
- if(!obr->strandbuf || !(obr->strandbuf->lay & lay))
+ if (!obr->strandbuf || !(obr->strandbuf->lay & lay))
continue;
/* compute matrix and try clipping whole object */
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mult_m4_m4m4(obwinmat, winmat, obi->mat);
else
copy_m4_m4(obwinmat, winmat);
@@ -854,12 +854,12 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa
/* test if we should skip it */
ma = obr->strandbuf->ma;
- if(shadow && !(ma->mode & MA_SHADBUF))
+ if (shadow && !(ma->mode & MA_SHADBUF))
continue;
- else if(!shadow && (ma->mode & MA_ONLYCAST))
+ else if (!shadow && (ma->mode & MA_ONLYCAST))
continue;
- if(clip_render_object(obi->obr->boundbox, bounds, obwinmat))
+ if (clip_render_object(obi->obr->boundbox, bounds, obwinmat))
continue;
widthx= obr->strandbuf->maxwidth*obwinmat[0][0];
@@ -867,12 +867,12 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa
/* for each bounding box containing a number of strands */
sbound= obr->strandbuf->bound;
- for(c=0; c<obr->strandbuf->totbound; c++, sbound++) {
- if(clip_render_object(sbound->boundbox, bounds, obwinmat))
+ for (c=0; c<obr->strandbuf->totbound; c++, sbound++) {
+ if (clip_render_object(sbound->boundbox, bounds, obwinmat))
continue;
/* for each strand in this bounding box */
- for(a=sbound->start; a<sbound->end; a++) {
+ for (a=sbound->start; a<sbound->end; a++) {
strand= RE_findOrAddStrand(obr, a);
svert= strand->vert;
@@ -881,9 +881,9 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa
clip[2]= strand_test_clip(obwinmat, &zspan, bounds, (svert+1)->co, &z[2], widthx, widthy);
clip[0]= clip[1]; z[0]= z[1];
- for(b=0; b<strand->totvert-1; b++, svert++) {
+ for (b=0; b<strand->totvert-1; b++, svert++) {
/* compute 4th point clipping and z depth */
- if(b < strand->totvert-2) {
+ if (b < strand->totvert-2) {
clip[3]= strand_test_clip(obwinmat, &zspan, bounds, (svert+2)->co, &z[3], widthx, widthy);
}
else {
@@ -891,7 +891,7 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa
}
/* check clipping and add to sortsegments buffer */
- if(!(clip[0] & clip[1] & clip[2] & clip[3])) {
+ if (!(clip[0] & clip[1] & clip[2] & clip[3])) {
sortseg= BLI_memarena_alloc(memarena, sizeof(StrandSortSegment));
sortseg->obi= i;
sortseg->strand= strand->index;
@@ -913,10 +913,10 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa
}
}
- if(!re->test_break(re->tbh)) {
+ if (!re->test_break(re->tbh)) {
/* convert list to array and sort */
sortsegments= MEM_mallocN(sizeof(StrandSortSegment)*totsegment, "StrandSortSegment");
- for(a=0, sortseg=firstseg; a<totsegment; a++, sortseg=sortseg->next)
+ for (a=0, sortseg=firstseg; a<totsegment; a++, sortseg=sortseg->next)
sortsegments[a]= *sortseg;
qsort(sortsegments, totsegment, sizeof(StrandSortSegment), compare_strand_segment);
}
@@ -925,11 +925,11 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa
spart.totapixbuf= MEM_callocN(sizeof(int)*pa->rectx*pa->recty, "totapixbuf");
- if(!re->test_break(re->tbh)) {
+ if (!re->test_break(re->tbh)) {
/* render segments in sorted order */
sortseg= sortsegments;
- for(a=0; a<totsegment; a++, sortseg++) {
- if(re->test_break(re->tbh))
+ for (a=0; a<totsegment; a++, sortseg++) {
+ if (re->test_break(re->tbh))
break;
obi= &re->objectinstance[sortseg->obi];
@@ -954,7 +954,7 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa
}
}
- if(sortsegments)
+ if (sortsegments)
MEM_freeN(sortsegments);
MEM_freeN(spart.totapixbuf);
@@ -976,12 +976,12 @@ StrandSurface *cache_strand_surface(Render *re, ObjectRen *obr, DerivedMesh *dm,
totvert= dm->getNumVerts(dm);
totface= dm->getNumTessFaces(dm);
- for(mesh=re->strandsurface.first; mesh; mesh=mesh->next)
- if(mesh->obr.ob == obr->ob && mesh->obr.par == obr->par
+ for (mesh=re->strandsurface.first; mesh; mesh=mesh->next)
+ if (mesh->obr.ob == obr->ob && mesh->obr.par == obr->par
&& mesh->obr.index == obr->index && mesh->totvert==totvert && mesh->totface==totface)
break;
- if(!mesh) {
+ if (!mesh) {
mesh= MEM_callocN(sizeof(StrandSurface), "StrandSurface");
mesh->obr= *obr;
mesh->totvert= totvert;
@@ -993,23 +993,23 @@ StrandSurface *cache_strand_surface(Render *re, ObjectRen *obr, DerivedMesh *dm,
BLI_addtail(&re->strandsurface, mesh);
}
- if(timeoffset == -1 && !mesh->prevco)
+ if (timeoffset == -1 && !mesh->prevco)
mesh->prevco= co= MEM_callocN(sizeof(float)*3*mesh->totvert, "StrandSurfCo");
- else if(timeoffset == 0 && !mesh->co)
+ else if (timeoffset == 0 && !mesh->co)
mesh->co= co= MEM_callocN(sizeof(float)*3*mesh->totvert, "StrandSurfCo");
- else if(timeoffset == 1 && !mesh->nextco)
+ else if (timeoffset == 1 && !mesh->nextco)
mesh->nextco= co= MEM_callocN(sizeof(float)*3*mesh->totvert, "StrandSurfCo");
else
return mesh;
mvert= dm->getVertArray(dm);
- for(a=0; a<mesh->totvert; a++, mvert++) {
+ for (a=0; a<mesh->totvert; a++, mvert++) {
copy_v3_v3(co[a], mvert->co);
mul_m4_v3(mat, co[a]);
}
mface= dm->getTessFaceArray(dm);
- for(a=0; a<mesh->totface; a++, mface++) {
+ for (a=0; a<mesh->totface; a++, mface++) {
mesh->face[a][0]= mface->v1;
mesh->face[a][1]= mface->v2;
mesh->face[a][2]= mface->v3;
@@ -1023,14 +1023,14 @@ void free_strand_surface(Render *re)
{
StrandSurface *mesh;
- for(mesh=re->strandsurface.first; mesh; mesh=mesh->next) {
- if(mesh->co) MEM_freeN(mesh->co);
- if(mesh->prevco) MEM_freeN(mesh->prevco);
- if(mesh->nextco) MEM_freeN(mesh->nextco);
- if(mesh->ao) MEM_freeN(mesh->ao);
- if(mesh->env) MEM_freeN(mesh->env);
- if(mesh->indirect) MEM_freeN(mesh->indirect);
- if(mesh->face) MEM_freeN(mesh->face);
+ for (mesh=re->strandsurface.first; mesh; mesh=mesh->next) {
+ if (mesh->co) MEM_freeN(mesh->co);
+ if (mesh->prevco) MEM_freeN(mesh->prevco);
+ if (mesh->nextco) MEM_freeN(mesh->nextco);
+ if (mesh->ao) MEM_freeN(mesh->ao);
+ if (mesh->env) MEM_freeN(mesh->env);
+ if (mesh->indirect) MEM_freeN(mesh->indirect);
+ if (mesh->face) MEM_freeN(mesh->face);
}
BLI_freelistN(&re->strandsurface);
@@ -1042,11 +1042,11 @@ void strand_minmax(StrandRen *strand, float *min, float *max, float width)
float vec[3], width2= 2.0f*width;
int a;
- for(a=0, svert=strand->vert; a<strand->totvert; a++, svert++) {
+ for (a=0, svert=strand->vert; a<strand->totvert; a++, svert++) {
copy_v3_v3(vec, svert->co);
DO_MINMAX(vec, min, max);
- if(width!=0.0f) {
+ if (width!=0.0f) {
vec[0]+= width; vec[1]+= width; vec[2]+= width;
DO_MINMAX(vec, min, max);
vec[0]-= width2; vec[1]-= width2; vec[2]-= width2;
diff --git a/source/blender/render/intern/source/sunsky.c b/source/blender/render/intern/source/sunsky.c
index 71ca2e056ac..00370fb51bf 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/
*/
@@ -37,30 +41,36 @@
* compute v1 = v2 op v3
* v1, v2 and v3 are vectors contains 3 float
* */
-#define vec3opv(v1, v2, op, v3) \
- v1[0] = (v2[0] op v3[0]); \
- v1[1] = (v2[1] op v3[1]);\
- v1[2] = (v2[2] op v3[2]);
+#define VEC3OPV(v1, v2, op, v3) \
+ { \
+ v1[0] = (v2[0] op v3[0]); \
+ v1[1] = (v2[1] op v3[1]); \
+ v1[2] = (v2[2] op v3[2]); \
+ } (void)0
/**
* compute v1 = v2 op f1
* v1, v2 are vectors contains 3 float
* and f1 is a float
* */
-#define vec3opf(v1, v2, op, f1)\
- v1[0] = (v2[0] op (f1));\
- v1[1] = (v2[1] op (f1));\
- v1[2] = (v2[2] op (f1));
+#define VEC3OPF(v1, v2, op, f1) \
+ { \
+ v1[0] = (v2[0] op (f1)); \
+ v1[1] = (v2[1] op (f1)); \
+ v1[2] = (v2[2] op (f1)); \
+ } (void)0
/**
* compute v1 = f1 op v2
* v1, v2 are vectors contains 3 float
* and f1 is a float
* */
-#define fopvec3(v1, f1, op, v2)\
- v1[0] = ((f1) op v2[0]);\
- v1[1] = ((f1) op v2[1]);\
- v1[2] = ((f1) op v2[2]);
+#define FOPVEC3(v1, f1, op, v2) \
+ { \
+ v1[0] = ((f1) op v2[0]); \
+ v1[1] = ((f1) op v2[1]); \
+ v1[2] = ((f1) op v2[2]); \
+ } (void)0
/**
* ClipColor:
@@ -129,7 +139,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
@@ -269,7 +279,7 @@ void GetSkyXYZRadiance(struct SunSky* sunsky, float theta, float phi, float colo
y = PerezFunction(sunsky, sunsky->perez_y, theta, gamma, sunsky->zenith_y);
Y = 6.666666667e-5f * nfade * hfade * PerezFunction(sunsky, sunsky->perez_Y, theta, gamma, sunsky->zenith_Y);
- if(sunsky->sky_exposure!=0.0f)
+ if (sunsky->sky_exposure!=0.0f)
Y = 1.0 - exp(Y*sunsky->sky_exposure);
X = (x / y) * Y;
@@ -331,7 +341,7 @@ static void ComputeAttenuatedSunlight(float theta, int turbidity, float fTau[3])
m = 1.0f/(cosf(theta) + 0.15f*powf(93.885f-theta/(float)M_PI*180.0f,-1.253f));
- for(i = 0; i < 3; i++)
+ for (i = 0; i < 3; i++)
{
// Rayleigh Scattering
fTauR = expf( -m * 0.008735f * powf(fLambda[i], (float)(-4.08f)));
@@ -345,7 +355,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
@@ -404,19 +414,19 @@ void InitAtmosphere(struct SunSky *sunSky, float sun_intens, float mief, float r
fTemp = pi*pi*(n*n-1)*(n*n-1)*(6+3*pn)/(6-7*pn)/N;
fBeta = 8*fTemp*pi/3;
- vec3opf(sunSky->atm_BetaRay, vLambda4, *, fBeta);
+ VEC3OPF(sunSky->atm_BetaRay, vLambda4, *, fBeta);
fBetaDash = fTemp/2;
- vec3opf(sunSky->atm_BetaDashRay, vLambda4,*, fBetaDash);
+ VEC3OPF(sunSky->atm_BetaDashRay, vLambda4,*, fBetaDash);
// Mie scattering constants.
fTemp2 = 0.434f*c*(2*pi)*(2*pi)*0.5f;
- vec3opf(sunSky->atm_BetaDashMie, vLambda2, *, fTemp2);
+ VEC3OPF(sunSky->atm_BetaDashMie, vLambda2, *, fTemp2);
fTemp3 = 0.434f*c*pi*(2*pi)*(2*pi);
- vec3opv(vBetaMieTemp, K, *, fLambda);
- vec3opf(sunSky->atm_BetaMie, vBetaMieTemp,*, fTemp3);
+ VEC3OPV(vBetaMieTemp, K, *, fLambda);
+ VEC3OPF(sunSky->atm_BetaMie, vBetaMieTemp,*, fTemp3);
}
@@ -455,12 +465,12 @@ void AtmospherePixleShader( struct SunSky* sunSky, float view[3], float s, float
costheta = dot_v3v3(view, sunDirection); // cos(theta)
Phase_1 = 1 + (costheta * costheta); // Phase_1
- vec3opf(sunSky->atm_BetaRay, sunSky->atm_BetaRay, *, sunSky->atm_BetaRayMultiplier);
- vec3opf(sunSky->atm_BetaMie, sunSky->atm_BetaMie, *, sunSky->atm_BetaMieMultiplier);
- vec3opv(sunSky->atm_BetaRM, sunSky->atm_BetaRay, +, sunSky->atm_BetaMie);
+ VEC3OPF(sunSky->atm_BetaRay, sunSky->atm_BetaRay, *, sunSky->atm_BetaRayMultiplier);
+ VEC3OPF(sunSky->atm_BetaMie, sunSky->atm_BetaMie, *, sunSky->atm_BetaMieMultiplier);
+ VEC3OPV(sunSky->atm_BetaRM, sunSky->atm_BetaRay, +, sunSky->atm_BetaMie);
//e^(-(beta_1 + beta_2) * s) = E1
- vec3opf(E1, sunSky->atm_BetaRM, *, -s/(float)M_LN2);
+ VEC3OPF(E1, sunSky->atm_BetaRM, *, -s/(float)M_LN2);
E1[0] = exp(E1[0]);
E1[1] = exp(E1[1]);
E1[2] = exp(E1[2]);
@@ -472,32 +482,32 @@ void AtmospherePixleShader( struct SunSky* sunSky, float view[3], float s, float
fTemp = fTemp * sqrtf(fTemp);
Phase_2 = (1 - sunSky->atm_HGg * sunSky->atm_HGg)/fTemp;
- vec3opf(vTemp1, sunSky->atm_BetaDashRay, *, Phase_1);
- vec3opf(vTemp2, sunSky->atm_BetaDashMie, *, Phase_2);
+ VEC3OPF(vTemp1, sunSky->atm_BetaDashRay, *, Phase_1);
+ VEC3OPF(vTemp2, sunSky->atm_BetaDashMie, *, Phase_2);
- vec3opv(vTemp1, vTemp1, +, vTemp2);
- fopvec3(vTemp2, 1.0f, -, E1);
- vec3opv(vTemp1, vTemp1, *, vTemp2);
+ VEC3OPV(vTemp1, vTemp1, +, vTemp2);
+ FOPVEC3(vTemp2, 1.0f, -, E1);
+ VEC3OPV(vTemp1, vTemp1, *, vTemp2);
- fopvec3(vTemp2, 1.0f, / , sunSky->atm_BetaRM);
+ FOPVEC3(vTemp2, 1.0f, / , sunSky->atm_BetaRM);
- vec3opv(I, vTemp1, *, vTemp2);
+ VEC3OPV(I, vTemp1, *, vTemp2);
- vec3opf(I, I, *, sunSky->atm_InscatteringMultiplier);
- vec3opf(E, E, *, sunSky->atm_ExtinctionMultiplier);
+ VEC3OPF(I, I, *, sunSky->atm_InscatteringMultiplier);
+ VEC3OPF(E, E, *, sunSky->atm_ExtinctionMultiplier);
//scale to color sun
ComputeAttenuatedSunlight(sunSky->theta, sunSky->turbidity, sunColor);
- vec3opv(E, E, *, sunColor);
+ VEC3OPV(E, E, *, sunColor);
- vec3opf(I, I, *, sunSky->atm_SunIntensity);
+ VEC3OPF(I, I, *, sunSky->atm_SunIntensity);
- vec3opv(rgb, rgb, *, E);
- vec3opv(rgb, rgb, +, I);
+ VEC3OPV(rgb, rgb, *, E);
+ VEC3OPV(rgb, rgb, +, I);
}
-#undef vec3opv
-#undef vec3opf
-#undef fopvec3
+#undef VEC3OPV
+#undef VEC3OPF
+#undef FOPVEC3
/* EOF */
diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c
index 8b3c3ec5c3d..759bc622bc2 100644
--- a/source/blender/render/intern/source/volume_precache.c
+++ b/source/blender/render/intern/source/volume_precache.c
@@ -57,10 +57,6 @@
#include "volumetric.h"
#include "volume_precache.h"
-#if defined( _MSC_VER ) && !defined( __cplusplus )
-# define inline __inline
-#endif // defined( _MSC_VER ) && !defined( __cplusplus )
-
#include "BKE_global.h"
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
@@ -89,7 +85,8 @@ static int intersect_outside_volume(RayObject *tree, Isect *isect, float *offset
isect->orig.ob= isect->hit.ob;
return intersect_outside_volume(tree, isect, offset, limit-1, depth+1);
- } else {
+ }
+ else {
return depth;
}
}
@@ -140,14 +137,14 @@ void global_bounds_obi(Render *re, ObjectInstanceRen *obi, float *bbmin, float *
INIT_MINMAX(bbmin, bbmax);
- for(a=0; a<obr->totvert; a++) {
- if((a & 255)==0) ver= obr->vertnodes[a>>8].vert;
+ for (a=0; a<obr->totvert; a++) {
+ if ((a & 255)==0) ver= obr->vertnodes[a>>8].vert;
else ver++;
copy_v3_v3(co, ver->co);
/* transformed object instance in camera space */
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mul_m4_v3(obi->mat, co);
/* convert to global space */
@@ -264,19 +261,19 @@ static void lightcache_filter2(VolumePrecache *vp)
}
#endif
-static inline int ms_I(int x, int y, int z, int *n) //has a pad of 1 voxel surrounding the core for boundary simulation
+BLI_INLINE int ms_I(int x, int y, int z, int *n) //has a pad of 1 voxel surrounding the core for boundary simulation
{
/* different ordering to light cache */
return x*(n[1]+2)*(n[2]+2) + y*(n[2]+2) + z;
}
-static inline int v_I_pad(int x, int y, int z, int *n) //has a pad of 1 voxel surrounding the core for boundary simulation
+BLI_INLINE int v_I_pad(int x, int y, int z, int *n) //has a pad of 1 voxel surrounding the core for boundary simulation
{
/* same ordering to light cache, with padding */
return z*(n[1]+2)*(n[0]+2) + y*(n[0]+2) + x;
}
-static inline int lc_to_ms_I(int x, int y, int z, int *n)
+BLI_INLINE int lc_to_ms_I(int x, int y, int z, int *n)
{
/* converting light cache index to multiple scattering index */
return (x-1)*(n[1]*n[2]) + (y-1)*(n[2]) + z-1;
@@ -284,7 +281,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;
@@ -409,7 +406,7 @@ static void multiple_scattering_diffusion(Render *re, VolumePrecache *vp, Materi
sb[j] += vp->data_b[i];
/* Displays progress every second */
- if(time-lasttime>1.0) {
+ if (time-lasttime>1.0) {
char str[64];
BLI_snprintf(str, sizeof(str), "Simulating multiple scattering: %d%%", (int)(100.0f * (c / total)));
re->i.infostr= str;
@@ -437,7 +434,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);
@@ -446,7 +443,8 @@ static void multiple_scattering_diffusion(Render *re, VolumePrecache *vp, Materi
/* conserve energy - half single, half multiple */
origf = 0.5f;
fac *= 0.5f;
- } else {
+ }
+ else {
origf = 0.0f;
}
@@ -483,11 +481,11 @@ static void *vol_precache_part_test(void *data)
{
VolPrecachePart *pa = data;
- printf("part number: %d \n", pa->num);
- printf("done: %d \n", pa->done);
- printf("x min: %d x max: %d \n", pa->minx, pa->maxx);
- printf("y min: %d y max: %d \n", pa->miny, pa->maxy);
- printf("z min: %d z max: %d \n", pa->minz, pa->maxz);
+ printf("part number: %d\n", pa->num);
+ printf("done: %d\n", pa->done);
+ printf("x min: %d x max: %d\n", pa->minx, pa->maxx);
+ printf("y min: %d y max: %d\n", pa->miny, pa->maxy);
+ printf("z min: %d z max: %d\n", pa->minz, pa->maxz);
return NULL;
}
@@ -735,25 +733,25 @@ static void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *o
queue.done = BLI_thread_queue_init();
BLI_thread_queue_nowait(queue.work);
- for(pa= re->volume_precache_parts.first; pa; pa= pa->next)
+ for (pa= re->volume_precache_parts.first; pa; pa= pa->next)
BLI_thread_queue_push(queue.work, pa);
/* launch threads */
BLI_init_threads(&threads, vol_precache_part, totthread);
- for(thread= 0; thread<totthread; thread++)
+ for (thread= 0; thread<totthread; thread++)
BLI_insert_thread(&threads, &queue);
/* loop waiting for work to be done */
- while(counter < totparts) {
- if(re->test_break && re->test_break(re->tbh))
+ while (counter < totparts) {
+ if (re->test_break && re->test_break(re->tbh))
break;
- if(BLI_thread_queue_pop_timeout(queue.done, 50))
+ if (BLI_thread_queue_pop_timeout(queue.done, 50))
counter++;
time= PIL_check_seconds_timer();
- if(time-lasttime>1.0) {
+ if (time-lasttime>1.0) {
char str[64];
BLI_snprintf(str, sizeof(str), "Precaching volume: %d%%", (int)(100.0f * ((float)counter / (float)totparts)));
re->i.infostr= str;
@@ -769,14 +767,13 @@ static void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *o
BLI_thread_queue_free(queue.done);
BLI_freelistN(&re->volume_precache_parts);
- if(tree) {
+ if (tree) {
//TODO: makeraytree_object creates a tree and saves it on OBI, if we free this tree we should also clear other pointers to it
//RE_rayobject_free(tree);
//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);
}
@@ -800,18 +797,18 @@ void volume_precache(Render *re)
re->i.infostr= "Volume preprocessing";
re->stats_draw(re->sdh, &re->i);
- for(vo= re->volumes.first; vo; vo= vo->next) {
+ for (vo= re->volumes.first; vo; vo= vo->next) {
if (using_lightcache(vo->ma)) {
- for(obi= re->instancetable.first; obi; obi= obi->next) {
+ for (obi= re->instancetable.first; obi; obi= obi->next) {
if (obi->obr == vo->obr) {
vol_precache_objectinstance_threads(re, obi, vo->ma);
- if(re->test_break && re->test_break(re->tbh))
+ if (re->test_break && re->test_break(re->tbh))
break;
}
}
- if(re->test_break && re->test_break(re->tbh))
+ if (re->test_break && re->test_break(re->tbh))
break;
}
}
@@ -824,7 +821,7 @@ void free_volume_precache(Render *re)
{
ObjectInstanceRen *obi;
- for(obi= re->instancetable.first; obi; obi= obi->next) {
+ for (obi= re->instancetable.first; obi; obi= obi->next) {
if (obi->volume_precache != NULL) {
MEM_freeN(obi->volume_precache->data_r);
MEM_freeN(obi->volume_precache->data_g);
diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c
index 66cbb18bc57..fa0326e2c97 100644
--- a/source/blender/render/intern/source/volumetric.c
+++ b/source/blender/render/intern/source/volumetric.c
@@ -69,7 +69,7 @@ extern struct Render R;
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* luminance rec. 709 */
-BM_INLINE float luminance(const float col[3])
+BLI_INLINE float luminance(const float col[3])
{
return (0.212671f*col[0] + 0.71516f*col[1] + 0.072169f*col[2]);
}
@@ -79,21 +79,23 @@ static float vol_get_shadow(ShadeInput *shi, LampRen *lar, const float co[3])
{
float visibility = 1.f;
- if(lar->shb) {
+ if (lar->shb) {
float dxco[3]={0.f, 0.f, 0.f}, dyco[3]={0.f, 0.f, 0.f};
visibility = testshadowbuf(&R, lar->shb, co, dxco, dyco, 1.0, 0.0);
- } else if (lar->mode & LA_SHAD_RAY) {
+ }
+ else if (lar->mode & LA_SHAD_RAY) {
/* trace shadow manually, no good lamp api atm */
Isect is;
copy_v3_v3(is.start, co);
- if(lar->type==LA_SUN || lar->type==LA_HEMI) {
+ if (lar->type==LA_SUN || lar->type==LA_HEMI) {
is.dir[0] = -lar->vec[0];
is.dir[1] = -lar->vec[1];
is.dir[2] = -lar->vec[2];
is.dist = R.maxdist;
- } else {
+ }
+ else {
sub_v3_v3v3(is.dir, lar->co, is.start);
is.dist = normalize_v3( is.dir );
}
@@ -102,7 +104,7 @@ static float vol_get_shadow(ShadeInput *shi, LampRen *lar, const float co[3])
is.check = RE_CHECK_VLR_NON_SOLID_MATERIAL;
is.skip = 0;
- if(lar->mode & (LA_LAYER|LA_LAYER_SHADOW))
+ if (lar->mode & (LA_LAYER|LA_LAYER_SHADOW))
is.lay= lar->lay;
else
is.lay= -1;
@@ -111,7 +113,7 @@ static float vol_get_shadow(ShadeInput *shi, LampRen *lar, const float co[3])
is.orig.face = NULL;
is.last_hit = lar->last_hit[shi->thread];
- if(RE_rayobject_raycast(R.raytree,&is)) {
+ if (RE_rayobject_raycast(R.raytree,&is)) {
visibility = 0.f;
}
@@ -135,19 +137,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;
}
}
@@ -202,9 +205,10 @@ static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, const float co[3], f
isect.lay= -1;
/* check to see if there's anything behind the volume, otherwise shade the sky */
- if(RE_rayobject_raycast(R.raytree, &isect)) {
+ if (RE_rayobject_raycast(R.raytree, &isect)) {
shade_intersection(shi, col_r, &isect);
- } else {
+ }
+ else {
shadeSkyView(col_r, co, shi->view, NULL, shi->thread);
shadeSunView(col_r, shi->view);
}
@@ -365,7 +369,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,
@@ -376,14 +380,15 @@ static float vol_get_phasefunc(ShadeInput *UNUSED(shi), float g, const float w[3
if (g == 0.f) { /* isotropic */
return normalize * 1.f;
- } else { /* schlick */
+ }
+ else { /* schlick */
const float k = 1.55f * g - .55f * g * g * g;
const float kcostheta = k * dot_v3v3(w, wp);
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));
@@ -392,7 +397,7 @@ static float vol_get_phasefunc(ShadeInput *UNUSED(shi), float g, const float w[3
case MA_VOL_PH_RAYLEIGH:
return normalize * 3.f/4.f * (1 + costheta * costheta);
case MA_VOL_PH_HG:
- return normalize * (1.f - g*g) / powf(1.f + g*g - 2.f * g * costheta, 1.5f));
+ return normalize * (1.f - g * g) / powf(1.f + g * g - 2.f * g * costheta, 1.5f);
case MA_VOL_PH_SCHLICK:
{
const float k = 1.55f * g - .55f * g * g * g;
@@ -403,7 +408,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) */
@@ -470,7 +475,7 @@ static void vol_shade_one_lamp(struct ShadeInput *shi, const float co[3], const
float hitco[3], *atten_co;
float p, ref_col[3];
- if (lar->mode & LA_LAYER) if((lar->lay & shi->obi->lay)==0) return;
+ if (lar->mode & LA_LAYER) if ((lar->lay & shi->obi->lay)==0) return;
if ((lar->lay & shi->lay)==0) return;
if (lar->energy == 0.0f) return;
@@ -478,7 +483,7 @@ static void vol_shade_one_lamp(struct ShadeInput *shi, const float co[3], const
copy_v3_v3(lacol, &lar->r);
- if(lar->mode & LA_TEXTURE) {
+ if (lar->mode & LA_TEXTURE) {
shi->osatex= 0;
do_lamp_tex(lar, lv, shi, lacol, LA_TEXTURE);
}
@@ -492,8 +497,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) {
@@ -517,7 +521,8 @@ static void vol_shade_one_lamp(struct ShadeInput *shi, const float co[3], const
atten_co = hitco;
else if ( lampdist < dist ) {
atten_co = lar->co;
- } else
+ }
+ else
atten_co = hitco;
vol_get_transmittance(shi, tr, co, atten_co);
@@ -554,7 +559,7 @@ void vol_get_scattering(ShadeInput *shi, float scatter_col[3], const float co[3]
zero_v3(scatter_col);
lights= get_lights(shi);
- for(go=lights->first; go; go= go->next)
+ for (go=lights->first; go; go= go->next)
{
float lacol[3] = {0.f, 0.f, 0.f};
lar= go->lampren;
@@ -568,15 +573,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
@@ -627,7 +632,8 @@ static void volumeintegrate(struct ShadeInput *shi, float col[4], const float co
p2[2] = p[2] + (step_vec[2] * 0.5f);
vol_get_precached_scattering(&R, shi, scatter_col, p2);
- } else
+ }
+ else
vol_get_scattering(shi, scatter_col, p, shi->view);
radiance[0] += stepd * tr[0] * (emit_col[0] + scatter_col[0]);
@@ -667,12 +673,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 +692,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;
@@ -695,7 +700,8 @@ static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int in
if (!ztransp)
/* trace behind the volume object */
vol_trace_behind(shi, shi->vlr, endco, col);
- } else {
+ }
+ else {
/* we're tracing through the volume between the camera
* and a solid surface, so use that pre-shaded radiance */
copy_v4_v4(col, shr->combined);
@@ -706,8 +712,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;
@@ -718,7 +723,8 @@ static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int in
if (vlr->mat == shi->mat) {
/* trace behind the 2nd (raytrace) hit point */
vol_trace_behind(shi, (VlakRen *)is.hit.face, endco, col);
- } else {
+ }
+ else {
shade_intersection(shi, col, &is);
}
}
diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c
index ce5561b3e34..1f49b654ef8 100644
--- a/source/blender/render/intern/source/voxeldata.c
+++ b/source/blender/render/intern/source/voxeldata.c
@@ -65,7 +65,7 @@
static int is_vd_res_ok(VoxelData *vd)
{
- /* arbitrary large value so corrupt headers dont break */
+ /* arbitrary large value so corrupt headers don't break */
const int min= 1, max= 100000;
return (vd->resol[0] >= min && vd->resol[0] <= max) &&
(vd->resol[1] >= min && vd->resol[1] <= max) &&
@@ -83,15 +83,15 @@ static int load_frame_blendervoxel(VoxelData *vd, FILE *fp, int frame)
const size_t size = vd_resol_size(vd);
size_t offset = sizeof(VoxelDataHeader);
- if(is_vd_res_ok(vd) == FALSE)
+ if (is_vd_res_ok(vd) == FALSE)
return 0;
vd->dataset = MEM_mapallocN(sizeof(float)*size, "voxel dataset");
- if(vd->dataset == NULL) return 0;
+ if (vd->dataset == NULL) return 0;
- if(fseek(fp, frame*size*sizeof(float)+offset, 0) == -1)
+ if (fseek(fp, frame*size*sizeof(float)+offset, 0) == -1)
return 0;
- if(fread(vd->dataset, sizeof(float), size, fp) != size)
+ if (fread(vd->dataset, sizeof(float), size, fp) != size)
return 0;
vd->cachedframe = frame;
@@ -105,25 +105,25 @@ static int load_frame_raw8(VoxelData *vd, FILE *fp, int frame)
char *data_c;
int i;
- if(is_vd_res_ok(vd) == FALSE)
+ if (is_vd_res_ok(vd) == FALSE)
return 0;
vd->dataset = MEM_mapallocN(sizeof(float)*size, "voxel dataset");
- if(vd->dataset == NULL) return 0;
+ if (vd->dataset == NULL) return 0;
data_c = (char *)MEM_mallocN(sizeof(char)*size, "temporary voxel file reading storage");
- if(data_c == NULL) {
+ if (data_c == NULL) {
MEM_freeN(vd->dataset);
vd->dataset= NULL;
return 0;
}
- if(fseek(fp,(frame-1)*size*sizeof(char),0) == -1) {
+ if (fseek(fp,(frame-1)*size*sizeof(char),0) == -1) {
MEM_freeN(data_c);
MEM_freeN(vd->dataset);
vd->dataset= NULL;
return 0;
}
- if(fread(data_c, sizeof(char), size, fp) != size) {
+ if (fread(data_c, sizeof(char), size, fp) != size) {
MEM_freeN(data_c);
MEM_freeN(vd->dataset);
vd->dataset= NULL;
@@ -155,7 +155,7 @@ static void load_frame_image_sequence(VoxelData *vd, Tex *tex)
ima->source = IMA_SRC_SEQUENCE;
iuser.framenr = 1 + iuser.offset;
- /* find the first valid ibuf and use it to initialise the resolution of the data set */
+ /* find the first valid ibuf and use it to initialize the resolution of the data set */
/* need to do this in advance so we know how much memory to allocate */
ibuf= BKE_image_get_ibuf(ima, &iuser);
while (!ibuf && (iuser.framenr < iuser.frames)) {
@@ -204,7 +204,7 @@ static int read_voxeldata_header(FILE *fp, struct VoxelData *vd)
VoxelDataHeader *h=(VoxelDataHeader *)MEM_mallocN(sizeof(VoxelDataHeader), "voxel data header");
rewind(fp);
- if(fread(h,sizeof(VoxelDataHeader),1,fp) != 1) {
+ if (fread(h,sizeof(VoxelDataHeader),1,fp) != 1) {
MEM_freeN(h);
return 0;
}
@@ -228,13 +228,12 @@ 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;
- if(smd->domain && smd->domain->fluid) {
- if(cfra < smd->domain->point_cache[0]->startframe)
+ 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 (vd->smoked_type == TEX_VD_SMOKEHEAT) {
size_t totRes;
@@ -285,7 +284,8 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
if (smd->domain->flags & MOD_SMOKE_HIGHRES) {
smoke_turbulence_get_res(smd->domain->wt, vd->resol);
density = smoke_turbulence_get_density(smd->domain->wt);
- } else {
+ }
+ else {
copy_v3_v3_int(vd->resol, smd->domain->res);
density = smoke_get_density(smd->domain->fluid);
}
@@ -343,10 +343,10 @@ void cache_voxeldata(Tex *tex, int scene_frame)
case TEX_VD_BLENDERVOXEL:
BLI_path_abs(path, G.main->name);
if (!BLI_exists(path)) return;
- fp = fopen(path,"rb");
+ fp = BLI_fopen(path,"rb");
if (!fp) return;
- if(read_voxeldata_header(fp, vd))
+ if (read_voxeldata_header(fp, vd))
load_frame_blendervoxel(vd, fp, curframe-1);
fclose(fp);
@@ -354,7 +354,7 @@ void cache_voxeldata(Tex *tex, int scene_frame)
case TEX_VD_RAW_8BIT:
BLI_path_abs(path, G.main->name);
if (!BLI_exists(path)) return;
- fp = fopen(path,"rb");
+ fp = BLI_fopen(path,"rb");
if (!fp) return;
load_frame_raw8(vd, fp, curframe);
@@ -372,7 +372,7 @@ void make_voxeldata(struct Render *re)
/* XXX: should be doing only textures used in this render */
for (tex= re->main->tex.first; tex; tex= tex->id.next) {
- if(tex->id.us && tex->type==TEX_VOXELDATA) {
+ if (tex->id.us && tex->type==TEX_VOXELDATA) {
cache_voxeldata(tex, re->r.cfra);
}
}
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index 807a3d7d0eb..74c4bf19faf 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -101,9 +101,9 @@ void zbuf_alloc_span(ZSpan *zspan, int rectx, int recty, float clipcrop)
void zbuf_free_span(ZSpan *zspan)
{
- if(zspan) {
- if(zspan->span1) MEM_freeN(zspan->span1);
- if(zspan->span2) MEM_freeN(zspan->span2);
+ if (zspan) {
+ if (zspan->span1) MEM_freeN(zspan->span1);
+ if (zspan->span2) MEM_freeN(zspan->span2);
zspan->span1= zspan->span2= NULL;
}
}
@@ -122,7 +122,7 @@ static void zbuf_add_to_span(ZSpan *zspan, float *v1, float *v2)
float xx1, dx0, xs0;
int y, my0, my2;
- if(v1[1]<v2[1]) {
+ if (v1[1]<v2[1]) {
minv= v1; maxv= v2;
}
else {
@@ -132,18 +132,18 @@ static void zbuf_add_to_span(ZSpan *zspan, float *v1, float *v2)
my0= ceil(minv[1]);
my2= floor(maxv[1]);
- if(my2<0 || my0>= zspan->recty) return;
+ if (my2<0 || my0>= zspan->recty) return;
/* clip top */
- if(my2>=zspan->recty) my2= zspan->recty-1;
+ if (my2>=zspan->recty) my2= zspan->recty-1;
/* clip bottom */
- if(my0<0) my0= 0;
+ if (my0<0) my0= 0;
- if(my0>my2) return;
- /* if(my0>my2) should still fill in, that way we get spans that skip nicely */
+ if (my0>my2) return;
+ /* if (my0>my2) should still fill in, that way we get spans that skip nicely */
xx1= maxv[1]-minv[1];
- if(xx1>FLT_EPSILON) {
+ if (xx1>FLT_EPSILON) {
dx0= (minv[0]-maxv[0])/xx1;
xs0= dx0*(minv[1]-my2) + minv[0];
}
@@ -153,11 +153,11 @@ static void zbuf_add_to_span(ZSpan *zspan, float *v1, float *v2)
}
/* empty span */
- if(zspan->maxp1 == NULL) {
+ if (zspan->maxp1 == NULL) {
span= zspan->span1;
}
else { /* does it complete left span? */
- if( maxv == zspan->minp1 || minv==zspan->maxp1) {
+ if ( maxv == zspan->minp1 || minv==zspan->maxp1) {
span= zspan->span1;
}
else {
@@ -165,30 +165,30 @@ static void zbuf_add_to_span(ZSpan *zspan, float *v1, float *v2)
}
}
- if(span==zspan->span1) {
+ if (span==zspan->span1) {
// printf("left span my0 %d my2 %d\n", my0, my2);
- if(zspan->minp1==NULL || zspan->minp1[1] > minv[1] ) {
+ if (zspan->minp1==NULL || zspan->minp1[1] > minv[1] ) {
zspan->minp1= minv;
}
- if(zspan->maxp1==NULL || zspan->maxp1[1] < maxv[1] ) {
+ if (zspan->maxp1==NULL || zspan->maxp1[1] < maxv[1] ) {
zspan->maxp1= maxv;
}
- if(my0<zspan->miny1) zspan->miny1= my0;
- if(my2>zspan->maxy1) zspan->maxy1= my2;
+ if (my0<zspan->miny1) zspan->miny1= my0;
+ if (my2>zspan->maxy1) zspan->maxy1= my2;
}
else {
// printf("right span my0 %d my2 %d\n", my0, my2);
- if(zspan->minp2==NULL || zspan->minp2[1] > minv[1] ) {
+ if (zspan->minp2==NULL || zspan->minp2[1] > minv[1] ) {
zspan->minp2= minv;
}
- if(zspan->maxp2==NULL || zspan->maxp2[1] < maxv[1] ) {
+ if (zspan->maxp2==NULL || zspan->maxp2[1] < maxv[1] ) {
zspan->maxp2= maxv;
}
- if(my0<zspan->miny2) zspan->miny2= my0;
- if(my2>zspan->maxy2) zspan->maxy2= my2;
+ if (my0<zspan->miny2) zspan->miny2= my0;
+ if (my2>zspan->maxy2) zspan->maxy2= my2;
}
- for(y=my2; y>=my0; y--, xs0+= dx0) {
+ for (y=my2; y>=my0; y--, xs0+= dx0) {
/* xs0 is the xcoord! */
span[y]= xs0;
}
@@ -204,7 +204,7 @@ void fillrect(int *rect, int x, int y, int val)
len= x*y;
drect= rect;
- while(len>0) {
+ while (len>0) {
len--;
*drect= val;
drect++;
@@ -216,24 +216,24 @@ static short cliptestf(float a, float b, float c, float d, float *u1, float *u2)
{
float p= a + b, q= c + d, r;
- if(p<0.0f) {
- if(q<p) return 0;
- else if(q<0.0f) {
+ if (p<0.0f) {
+ if (q<p) return 0;
+ else if (q<0.0f) {
r= q/p;
- if(r>*u2) return 0;
- else if(r>*u1) *u1=r;
+ if (r>*u2) return 0;
+ else if (r>*u1) *u1=r;
}
}
else {
- if(p>0.0f) {
- if(q<0.0f) return 0;
- else if(q<p) {
+ if (p>0.0f) {
+ if (q<0.0f) return 0;
+ else if (q<p) {
r= q/p;
- if(r<*u1) return 0;
- else if(r<*u2) *u2=r;
+ if (r<*u1) return 0;
+ else if (r<*u2) *u2=r;
}
}
- else if(q<0.0f) return 0;
+ else if (q<0.0f) return 0;
}
return 1;
}
@@ -244,17 +244,17 @@ 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;
- else if( v[0] > abs4) c+=2;
+ if ( v[0] < -abs4) c+=1;
+ else if ( v[0] > abs4) c+=2;
- if( v[1] > abs4) c+=4;
- else if( v[1] < -abs4) c+=8;
+ if ( v[1] > abs4) c+=4;
+ else if ( v[1] < -abs4) c+=8;
- if(v[2] < -abs4) c+=16; /* this used to be " if(v[2]<0) ", see clippz() */
- else if(v[2]> abs4) c+= 32;
+ if (v[2] < -abs4) c+=16; /* this used to be " if (v[2]<0) ", see clippz() */
+ else if (v[2]> abs4) c+= 32;
return c;
}
@@ -279,9 +279,9 @@ void freepsA(ListBase *lb)
{
APixstrMain *psm, *psmnext;
- for(psm= lb->first; psm; psm= psmnext) {
+ for (psm= lb->first; psm; psm= psmnext) {
psmnext= psm->next;
- if(psm->ps)
+ if (psm->ps)
MEM_freeN(psm->ps);
MEM_freeN(psm);
}
@@ -290,7 +290,7 @@ void freepsA(ListBase *lb)
static APixstr *addpsA(ZSpan *zspan)
{
/* make new PS */
- if(zspan->apsmcounter==0) {
+ if (zspan->apsmcounter==0) {
zspan->curpstr= addpsmainA(zspan->apsmbase);
zspan->apsmcounter= 4095;
}
@@ -317,7 +317,7 @@ static void zbuffillAc4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
/* set spans */
zbuf_add_to_span(zspan, v1, v2);
zbuf_add_to_span(zspan, v2, v3);
- if(v4) {
+ if (v4) {
zbuf_add_to_span(zspan, v3, v4);
zbuf_add_to_span(zspan, v4, v1);
}
@@ -325,12 +325,12 @@ static void zbuffillAc4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
zbuf_add_to_span(zspan, v3, v1);
/* clipped */
- if(zspan->minp2==NULL || zspan->maxp2==NULL) return;
+ if (zspan->minp2==NULL || zspan->maxp2==NULL) return;
- if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
- if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
+ if (zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
+ if (zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
- if(my2<my0) return;
+ if (my2<my0) return;
/* ZBUF DX DY, in floats still */
x1= v1[0]- v2[0];
@@ -343,7 +343,7 @@ static void zbuffillAc4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
y0= z1*x2-x1*z2;
z0= x1*y2-y1*x2;
- if(z0==0.0f) return;
+ if (z0==0.0f) return;
xx1= (x0*v1[0] + y0*v1[1])/z0 + v1[2];
@@ -360,7 +360,7 @@ static void zbuffillAc4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
/* correct span */
sn1= (my0 + my2)/2;
- if(zspan->span1[sn1] < zspan->span2[sn1]) {
+ if (zspan->span1[sn1] < zspan->span2[sn1]) {
span1= zspan->span1+my2;
span2= zspan->span2+my2;
}
@@ -369,16 +369,16 @@ static void zbuffillAc4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
span2= zspan->span1+my2;
}
- for(y=my2; y>=my0; y--, span1--, span2--) {
+ for (y=my2; y>=my0; y--, span1--, span2--) {
sn1= floor(*span1);
sn2= floor(*span2);
sn1++;
- if(sn2>=rectx) sn2= rectx-1;
- if(sn1<0) sn1= 0;
+ if (sn2>=rectx) sn2= rectx-1;
+ if (sn1<0) sn1= 0;
- if(sn2>=sn1) {
+ if (sn2>=sn1) {
int intzverg;
zverg= (double)sn1*zxd + zy0;
@@ -389,23 +389,23 @@ static void zbuffillAc4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
zverg-= zspan->polygon_offset;
- while(x>=0) {
+ while (x>=0) {
intzverg= (int)CLAMPIS(zverg, INT_MIN, INT_MAX);
- if( intzverg < *rz) {
- if(!zspan->rectmask || intzverg > *rm) {
+ if ( intzverg < *rz) {
+ if (!zspan->rectmask || intzverg > *rm) {
apn= ap;
- while(apn) {
- if(apn->p[0]==0) {apn->obi[0]= obi; apn->p[0]= zvlnr; apn->z[0]= intzverg; apn->mask[0]= mask; break; }
- if(apn->p[0]==zvlnr && apn->obi[0]==obi) {apn->mask[0]|= mask; break; }
- if(apn->p[1]==0) {apn->obi[1]= obi; apn->p[1]= zvlnr; apn->z[1]= intzverg; apn->mask[1]= mask; break; }
- if(apn->p[1]==zvlnr && apn->obi[1]==obi) {apn->mask[1]|= mask; break; }
- if(apn->p[2]==0) {apn->obi[2]= obi; apn->p[2]= zvlnr; apn->z[2]= intzverg; apn->mask[2]= mask; break; }
- if(apn->p[2]==zvlnr && apn->obi[2]==obi) {apn->mask[2]|= mask; break; }
- if(apn->p[3]==0) {apn->obi[3]= obi; apn->p[3]= zvlnr; apn->z[3]= intzverg; apn->mask[3]= mask; break; }
- if(apn->p[3]==zvlnr && apn->obi[3]==obi) {apn->mask[3]|= mask; break; }
- if(apn->next==NULL) apn->next= addpsA(zspan);
+ while (apn) {
+ if (apn->p[0]==0) {apn->obi[0]= obi; apn->p[0]= zvlnr; apn->z[0]= intzverg; apn->mask[0]= mask; break; }
+ if (apn->p[0]==zvlnr && apn->obi[0]==obi) {apn->mask[0]|= mask; break; }
+ if (apn->p[1]==0) {apn->obi[1]= obi; apn->p[1]= zvlnr; apn->z[1]= intzverg; apn->mask[1]= mask; break; }
+ if (apn->p[1]==zvlnr && apn->obi[1]==obi) {apn->mask[1]|= mask; break; }
+ if (apn->p[2]==0) {apn->obi[2]= obi; apn->p[2]= zvlnr; apn->z[2]= intzverg; apn->mask[2]= mask; break; }
+ if (apn->p[2]==zvlnr && apn->obi[2]==obi) {apn->mask[2]|= mask; break; }
+ if (apn->p[3]==0) {apn->obi[3]= obi; apn->p[3]= zvlnr; apn->z[3]= intzverg; apn->mask[3]= mask; break; }
+ if (apn->p[3]==zvlnr && apn->obi[3]==obi) {apn->mask[3]|= mask; break; }
+ if (apn->next==NULL) apn->next= addpsA(zspan);
apn= apn->next;
}
}
@@ -441,10 +441,10 @@ static void zbuflineAc(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec
mask= zspan->mask;
- if(fabs(dx) > fabs(dy)) {
+ if (fabs(dx) > fabs(dy)) {
/* all lines from left to right */
- if(vec1[0]<vec2[0]) {
+ if (vec1[0]<vec2[0]) {
copy_v3_v3(v1, vec1);
copy_v3_v3(v2, vec2);
}
@@ -456,7 +456,7 @@ static void zbuflineAc(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec
start= floor(v1[0]);
end= start+floor(dx);
- if(end>=zspan->rectx) end= zspan->rectx-1;
+ if (end>=zspan->rectx) end= zspan->rectx-1;
oldy= floor(v1[1]);
dy/= dx;
@@ -464,40 +464,40 @@ static void zbuflineAc(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec
vergz= v1[2];
vergz-= zspan->polygon_offset;
dz= (v2[2]-v1[2])/dx;
- if(vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow
+ if (vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow
rectz= (int *)(zspan->arectz+zspan->rectx*(oldy) +start);
rectmask= (int *)(zspan->rectmask+zspan->rectx*(oldy) +start);
ap= (zspan->apixbuf+ zspan->rectx*(oldy) +start);
- if(dy<0) ofs= -zspan->rectx;
+ if (dy<0) ofs= -zspan->rectx;
else ofs= zspan->rectx;
- for(x= start; x<=end; x++, rectz++, rectmask++, ap++) {
+ for (x= start; x<=end; x++, rectz++, rectmask++, ap++) {
y= floor(v1[1]);
- if(y!=oldy) {
+ if (y!=oldy) {
oldy= y;
rectz+= ofs;
rectmask+= ofs;
ap+= ofs;
}
- if(x>=0 && y>=0 && y<zspan->recty) {
- if(vergz<*rectz) {
- if(!zspan->rectmask || vergz>*rectmask) {
+ if (x>=0 && y>=0 && y<zspan->recty) {
+ if (vergz<*rectz) {
+ if (!zspan->rectmask || vergz>*rectmask) {
apn= ap;
- while(apn) { /* loop unrolled */
- if(apn->p[0]==0) {apn->obi[0]= obi; apn->p[0]= zvlnr; apn->z[0]= vergz; apn->mask[0]= mask; break; }
- if(apn->p[0]==zvlnr && apn->obi[0]==obi) {apn->mask[0]|= mask; break; }
- if(apn->p[1]==0) {apn->obi[1]= obi; apn->p[1]= zvlnr; apn->z[1]= vergz; apn->mask[1]= mask; break; }
- if(apn->p[1]==zvlnr && apn->obi[1]==obi) {apn->mask[1]|= mask; break; }
- if(apn->p[2]==0) {apn->obi[2]= obi; apn->p[2]= zvlnr; apn->z[2]= vergz; apn->mask[2]= mask; break; }
- if(apn->p[2]==zvlnr && apn->obi[2]==obi) {apn->mask[2]|= mask; break; }
- if(apn->p[3]==0) {apn->obi[3]= obi; apn->p[3]= zvlnr; apn->z[3]= vergz; apn->mask[3]= mask; break; }
- if(apn->p[3]==zvlnr && apn->obi[3]==obi) {apn->mask[3]|= mask; break; }
- if(apn->next==0) apn->next= addpsA(zspan);
+ while (apn) { /* loop unrolled */
+ if (apn->p[0]==0) {apn->obi[0]= obi; apn->p[0]= zvlnr; apn->z[0]= vergz; apn->mask[0]= mask; break; }
+ if (apn->p[0]==zvlnr && apn->obi[0]==obi) {apn->mask[0]|= mask; break; }
+ if (apn->p[1]==0) {apn->obi[1]= obi; apn->p[1]= zvlnr; apn->z[1]= vergz; apn->mask[1]= mask; break; }
+ if (apn->p[1]==zvlnr && apn->obi[1]==obi) {apn->mask[1]|= mask; break; }
+ if (apn->p[2]==0) {apn->obi[2]= obi; apn->p[2]= zvlnr; apn->z[2]= vergz; apn->mask[2]= mask; break; }
+ if (apn->p[2]==zvlnr && apn->obi[2]==obi) {apn->mask[2]|= mask; break; }
+ if (apn->p[3]==0) {apn->obi[3]= obi; apn->p[3]= zvlnr; apn->z[3]= vergz; apn->mask[3]= mask; break; }
+ if (apn->p[3]==zvlnr && apn->obi[3]==obi) {apn->mask[3]|= mask; break; }
+ if (apn->next==0) apn->next= addpsA(zspan);
apn= apn->next;
}
}
@@ -505,14 +505,14 @@ static void zbuflineAc(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec
}
v1[1]+= dy;
- if(maxtest && (vergz > 0x7FFFFFF0 - dz)) vergz= 0x7FFFFFF0;
+ if (maxtest && (vergz > 0x7FFFFFF0 - dz)) vergz= 0x7FFFFFF0;
else vergz+= dz;
}
}
else {
/* all lines from top to bottom */
- if(vec1[1]<vec2[1]) {
+ if (vec1[1]<vec2[1]) {
copy_v3_v3(v1, vec1);
copy_v3_v3(v2, vec2);
}
@@ -525,9 +525,9 @@ static void zbuflineAc(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec
start= floor(v1[1]);
end= start+floor(dy);
- if(start>=zspan->recty || end<0) return;
+ if (start>=zspan->recty || end<0) return;
- if(end>=zspan->recty) end= zspan->recty-1;
+ if (end>=zspan->recty) end= zspan->recty-1;
oldx= floor(v1[0]);
dx/= dy;
@@ -535,40 +535,40 @@ static void zbuflineAc(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec
vergz= v1[2];
vergz-= zspan->polygon_offset;
dz= (v2[2]-v1[2])/dy;
- if(vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow
+ if (vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow
rectz= (int *)( zspan->arectz+ (start)*zspan->rectx+ oldx );
rectmask= (int *)( zspan->rectmask+ (start)*zspan->rectx+ oldx );
ap= (zspan->apixbuf+ zspan->rectx*(start) +oldx);
- if(dx<0) ofs= -1;
+ if (dx<0) ofs= -1;
else ofs= 1;
- for(y= start; y<=end; y++, rectz+=zspan->rectx, rectmask+=zspan->rectx, ap+=zspan->rectx) {
+ for (y= start; y<=end; y++, rectz+=zspan->rectx, rectmask+=zspan->rectx, ap+=zspan->rectx) {
x= floor(v1[0]);
- if(x!=oldx) {
+ if (x!=oldx) {
oldx= x;
rectz+= ofs;
rectmask+= ofs;
ap+= ofs;
}
- if(x>=0 && y>=0 && x<zspan->rectx) {
- if(vergz<*rectz) {
- if(!zspan->rectmask || vergz>*rectmask) {
+ if (x>=0 && y>=0 && x<zspan->rectx) {
+ if (vergz<*rectz) {
+ if (!zspan->rectmask || vergz>*rectmask) {
apn= ap;
- while(apn) { /* loop unrolled */
- if(apn->p[0]==0) {apn->obi[0]= obi; apn->p[0]= zvlnr; apn->z[0]= vergz; apn->mask[0]= mask; break; }
- if(apn->p[0]==zvlnr) {apn->mask[0]|= mask; break; }
- if(apn->p[1]==0) {apn->obi[1]= obi; apn->p[1]= zvlnr; apn->z[1]= vergz; apn->mask[1]= mask; break; }
- if(apn->p[1]==zvlnr) {apn->mask[1]|= mask; break; }
- if(apn->p[2]==0) {apn->obi[2]= obi; apn->p[2]= zvlnr; apn->z[2]= vergz; apn->mask[2]= mask; break; }
- if(apn->p[2]==zvlnr) {apn->mask[2]|= mask; break; }
- if(apn->p[3]==0) {apn->obi[3]= obi; apn->p[3]= zvlnr; apn->z[3]= vergz; apn->mask[3]= mask; break; }
- if(apn->p[3]==zvlnr) {apn->mask[3]|= mask; break; }
- if(apn->next==0) apn->next= addpsA(zspan);
+ while (apn) { /* loop unrolled */
+ if (apn->p[0]==0) {apn->obi[0]= obi; apn->p[0]= zvlnr; apn->z[0]= vergz; apn->mask[0]= mask; break; }
+ if (apn->p[0]==zvlnr) {apn->mask[0]|= mask; break; }
+ if (apn->p[1]==0) {apn->obi[1]= obi; apn->p[1]= zvlnr; apn->z[1]= vergz; apn->mask[1]= mask; break; }
+ if (apn->p[1]==zvlnr) {apn->mask[1]|= mask; break; }
+ if (apn->p[2]==0) {apn->obi[2]= obi; apn->p[2]= zvlnr; apn->z[2]= vergz; apn->mask[2]= mask; break; }
+ if (apn->p[2]==zvlnr) {apn->mask[2]|= mask; break; }
+ if (apn->p[3]==0) {apn->obi[3]= obi; apn->p[3]= zvlnr; apn->z[3]= vergz; apn->mask[3]= mask; break; }
+ if (apn->p[3]==zvlnr) {apn->mask[3]|= mask; break; }
+ if (apn->next==0) apn->next= addpsA(zspan);
apn= apn->next;
}
}
@@ -576,7 +576,7 @@ static void zbuflineAc(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec
}
v1[0]+= dx;
- if(maxtest && (vergz > 0x7FFFFFF0 - dz)) vergz= 0x7FFFFFF0;
+ if (maxtest && (vergz > 0x7FFFFFF0 - dz)) vergz= 0x7FFFFFF0;
else vergz+= dz;
}
}
@@ -595,10 +595,10 @@ static void zbufline(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec2)
dx= vec2[0]-vec1[0];
dy= vec2[1]-vec1[1];
- if(fabs(dx) > fabs(dy)) {
+ if (fabs(dx) > fabs(dy)) {
/* all lines from left to right */
- if(vec1[0]<vec2[0]) {
+ if (vec1[0]<vec2[0]) {
copy_v3_v3(v1, vec1);
copy_v3_v3(v2, vec2);
}
@@ -610,27 +610,27 @@ static void zbufline(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec2)
start= floor(v1[0]);
end= start+floor(dx);
- if(end>=zspan->rectx) end= zspan->rectx-1;
+ if (end>=zspan->rectx) end= zspan->rectx-1;
oldy= floor(v1[1]);
dy/= dx;
vergz= floor(v1[2]);
dz= floor((v2[2]-v1[2])/dx);
- if(vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow
+ if (vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow
rectz= zspan->rectz + oldy*zspan->rectx+ start;
rectp= zspan->rectp + oldy*zspan->rectx+ start;
recto= zspan->recto + oldy*zspan->rectx+ start;
rectmask= zspan->rectmask + oldy*zspan->rectx+ start;
- if(dy<0) ofs= -zspan->rectx;
+ if (dy<0) ofs= -zspan->rectx;
else ofs= zspan->rectx;
- for(x= start; x<=end; x++, rectz++, rectp++, recto++, rectmask++) {
+ for (x= start; x<=end; x++, rectz++, rectp++, recto++, rectmask++) {
y= floor(v1[1]);
- if(y!=oldy) {
+ if (y!=oldy) {
oldy= y;
rectz+= ofs;
rectp+= ofs;
@@ -638,9 +638,9 @@ static void zbufline(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec2)
rectmask+= ofs;
}
- if(x>=0 && y>=0 && y<zspan->recty) {
- if(vergz<*rectz) {
- if(!zspan->rectmask || vergz>*rectmask) {
+ if (x>=0 && y>=0 && y<zspan->recty) {
+ if (vergz<*rectz) {
+ if (!zspan->rectmask || vergz>*rectmask) {
*recto= obi;
*rectz= vergz;
*rectp= zvlnr;
@@ -650,13 +650,13 @@ static void zbufline(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec2)
v1[1]+= dy;
- if(maxtest && (vergz > 0x7FFFFFF0 - dz)) vergz= 0x7FFFFFF0;
+ if (maxtest && (vergz > 0x7FFFFFF0 - dz)) vergz= 0x7FFFFFF0;
else vergz+= dz;
}
}
else {
/* all lines from top to bottom */
- if(vec1[1]<vec2[1]) {
+ if (vec1[1]<vec2[1]) {
copy_v3_v3(v1, vec1);
copy_v3_v3(v2, vec2);
}
@@ -669,27 +669,27 @@ static void zbufline(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec2)
start= floor(v1[1]);
end= start+floor(dy);
- if(end>=zspan->recty) end= zspan->recty-1;
+ if (end>=zspan->recty) end= zspan->recty-1;
oldx= floor(v1[0]);
dx/= dy;
vergz= floor(v1[2]);
dz= floor((v2[2]-v1[2])/dy);
- if(vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow
+ if (vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow
rectz= zspan->rectz + start*zspan->rectx+ oldx;
rectp= zspan->rectp + start*zspan->rectx+ oldx;
recto= zspan->recto + start*zspan->rectx+ oldx;
rectmask= zspan->rectmask + start*zspan->rectx+ oldx;
- if(dx<0) ofs= -1;
+ if (dx<0) ofs= -1;
else ofs= 1;
- for(y= start; y<=end; y++, rectz+=zspan->rectx, rectp+=zspan->rectx, recto+=zspan->rectx, rectmask+=zspan->rectx) {
+ for (y= start; y<=end; y++, rectz+=zspan->rectx, rectp+=zspan->rectx, recto+=zspan->rectx, rectmask+=zspan->rectx) {
x= floor(v1[0]);
- if(x!=oldx) {
+ if (x!=oldx) {
oldx= x;
rectz+= ofs;
rectp+= ofs;
@@ -697,9 +697,9 @@ static void zbufline(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec2)
rectmask+= ofs;
}
- if(x>=0 && y>=0 && x<zspan->rectx) {
- if(vergz<*rectz) {
- if(!zspan->rectmask || vergz>*rectmask) {
+ if (x>=0 && y>=0 && x<zspan->rectx) {
+ if (vergz<*rectz) {
+ if (!zspan->rectmask || vergz>*rectmask) {
*rectz= vergz;
*rectp= zvlnr;
*recto= obi;
@@ -708,7 +708,7 @@ static void zbufline(ZSpan *zspan, int obi, int zvlnr, float *vec1, float *vec2)
}
v1[0]+= dx;
- if(maxtest && (vergz > 0x7FFFFFF0 - dz)) vergz= 0x7FFFFFF0;
+ if (maxtest && (vergz > 0x7FFFFFF0 - dz)) vergz= 0x7FFFFFF0;
else vergz+= dz;
}
}
@@ -725,10 +725,10 @@ static void zbufline_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), flo
dx= vec2[0]-vec1[0];
dy= vec2[1]-vec1[1];
- if(fabs(dx) > fabs(dy)) {
+ if (fabs(dx) > fabs(dy)) {
/* all lines from left to right */
- if(vec1[0]<vec2[0]) {
+ if (vec1[0]<vec2[0]) {
copy_v3_v3(v1, vec1);
copy_v3_v3(v2, vec2);
}
@@ -740,51 +740,51 @@ static void zbufline_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), flo
start= floor(v1[0]);
end= start+floor(dx);
- if(end>=zspan->rectx) end= zspan->rectx-1;
+ if (end>=zspan->rectx) end= zspan->rectx-1;
oldy= floor(v1[1]);
dy/= dx;
vergz= floor(v1[2]);
dz= floor((v2[2]-v1[2])/dx);
- if(vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow
+ if (vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow
rectz= zspan->rectz + oldy*zspan->rectx+ start;
- if(zspan->rectz1)
+ if (zspan->rectz1)
rectz1= zspan->rectz1 + oldy*zspan->rectx+ start;
- if(dy<0) ofs= -zspan->rectx;
+ if (dy<0) ofs= -zspan->rectx;
else ofs= zspan->rectx;
- for(x= start; x<=end; x++, rectz++) {
+ for (x= start; x<=end; x++, rectz++) {
y= floor(v1[1]);
- if(y!=oldy) {
+ if (y!=oldy) {
oldy= y;
rectz+= ofs;
- if(rectz1) rectz1+= ofs;
+ if (rectz1) rectz1+= ofs;
}
- if(x>=0 && y>=0 && y<zspan->recty) {
- if(vergz < *rectz) {
- if(rectz1) *rectz1= *rectz;
+ if (x>=0 && y>=0 && y<zspan->recty) {
+ if (vergz < *rectz) {
+ if (rectz1) *rectz1= *rectz;
*rectz= vergz;
}
- else if(rectz1 && vergz < *rectz1)
+ else if (rectz1 && vergz < *rectz1)
*rectz1= vergz;
}
v1[1]+= dy;
- if(maxtest && (vergz > 0x7FFFFFF0 - dz)) vergz= 0x7FFFFFF0;
+ if (maxtest && (vergz > 0x7FFFFFF0 - dz)) vergz= 0x7FFFFFF0;
else vergz+= dz;
- if(rectz1) rectz1++;
+ if (rectz1) rectz1++;
}
}
else {
/* all lines from top to bottom */
- if(vec1[1]<vec2[1]) {
+ if (vec1[1]<vec2[1]) {
copy_v3_v3(v1, vec1);
copy_v3_v3(v2, vec2);
}
@@ -797,45 +797,45 @@ static void zbufline_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), flo
start= floor(v1[1]);
end= start+floor(dy);
- if(end>=zspan->recty) end= zspan->recty-1;
+ if (end>=zspan->recty) end= zspan->recty-1;
oldx= floor(v1[0]);
dx/= dy;
vergz= floor(v1[2]);
dz= floor((v2[2]-v1[2])/dy);
- if(vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow
+ if (vergz>0x50000000 && dz>0) maxtest= 1; // prevent overflow
rectz= zspan->rectz + start*zspan->rectx+ oldx;
- if(zspan->rectz1)
+ if (zspan->rectz1)
rectz1= zspan->rectz1 + start*zspan->rectx+ oldx;
- if(dx<0) ofs= -1;
+ if (dx<0) ofs= -1;
else ofs= 1;
- for(y= start; y<=end; y++, rectz+=zspan->rectx) {
+ for (y= start; y<=end; y++, rectz+=zspan->rectx) {
x= floor(v1[0]);
- if(x!=oldx) {
+ if (x!=oldx) {
oldx= x;
rectz+= ofs;
- if(rectz1) rectz1+= ofs;
+ if (rectz1) rectz1+= ofs;
}
- if(x>=0 && y>=0 && x<zspan->rectx) {
- if(vergz < *rectz) {
- if(rectz1) *rectz1= *rectz;
+ if (x>=0 && y>=0 && x<zspan->rectx) {
+ if (vergz < *rectz) {
+ if (rectz1) *rectz1= *rectz;
*rectz= vergz;
}
- else if(rectz1 && vergz < *rectz1)
+ else if (rectz1 && vergz < *rectz1)
*rectz1= vergz;
}
v1[0]+= dx;
- if(maxtest && (vergz > 0x7FFFFFF0 - dz)) vergz= 0x7FFFFFF0;
+ if (maxtest && (vergz > 0x7FFFFFF0 - dz)) vergz= 0x7FFFFFF0;
else vergz+= dz;
- if(rectz1)
+ if (rectz1)
rectz1+=zspan->rectx;
}
}
@@ -851,31 +851,31 @@ 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)) {
+ if (cliptestf(-dz, -dw, v1[3], v1[2], &u1,&u2)) {
+ if (cliptestf(dz, -dw, v1[3], -v1[2], &u1,&u2)) {
dx= v2[0]-v1[0];
dz= 1.01f*(v2[3]-v1[3]);
v13= 1.01f*v1[3];
- if(cliptestf(-dx, -dz, v1[0], v13, &u1,&u2)) {
- if(cliptestf(dx, -dz, v13, -v1[0], &u1,&u2)) {
+ if (cliptestf(-dx, -dz, v1[0], v13, &u1,&u2)) {
+ if (cliptestf(dx, -dz, v13, -v1[0], &u1,&u2)) {
dy= v2[1]-v1[1];
- if(cliptestf(-dy, -dz, v1[1], v13, &u1,&u2)) {
- if(cliptestf(dy, -dz, v13, -v1[1], &u1,&u2)) {
+ if (cliptestf(-dy, -dz, v1[1], v13, &u1,&u2)) {
+ if (cliptestf(dy, -dz, v13, -v1[1], &u1,&u2)) {
- if(u2<1.0f) {
+ if (u2<1.0f) {
v2[0]= v1[0]+u2*dx;
v2[1]= v1[1]+u2*dy;
v2[2]= v1[2]+u2*dz;
v2[3]= v1[3]+u2*dw;
}
- if(u1>0.0f) {
+ if (u1>0.0f) {
v1[0]= v1[0]+u1*dx;
v1[1]= v1[1]+u1*dy;
v1[2]= v1[2]+u1*dz;
@@ -908,9 +908,9 @@ void zbufclipwire(ZSpan *zspan, int obi, int zvlnr, int ec, float *ho1, float *h
int and, or;
/* edgecode: 1= draw */
- if(ec==0) return;
+ if (ec==0) return;
- if(ho4) {
+ if (ho4) {
and= (c1 & c2 & c3 & c4);
or= (c1 | c2 | c3 | c4);
}
@@ -919,44 +919,44 @@ void zbufclipwire(ZSpan *zspan, int obi, int zvlnr, int ec, float *ho1, float *h
or= (c1 | c2 | c3);
}
- if(or) { /* not in the middle */
- if(and) { /* out completely */
+ if (or) { /* not in the middle */
+ if (and) { /* out completely */
return;
}
else { /* clipping */
- if(ec & ME_V1V2) {
+ if (ec & ME_V1V2) {
copy_v4_v4(vez, ho1);
copy_v4_v4(vez+4, ho2);
- if( clipline(vez, vez+4)) {
+ if ( clipline(vez, vez+4)) {
hoco_to_zco(zspan, vez, vez);
hoco_to_zco(zspan, vez+4, vez+4);
zspan->zbuflinefunc(zspan, obi, zvlnr, vez, vez+4);
}
}
- if(ec & ME_V2V3) {
+ if (ec & ME_V2V3) {
copy_v4_v4(vez, ho2);
copy_v4_v4(vez+4, ho3);
- if( clipline(vez, vez+4)) {
+ if ( clipline(vez, vez+4)) {
hoco_to_zco(zspan, vez, vez);
hoco_to_zco(zspan, vez+4, vez+4);
zspan->zbuflinefunc(zspan, obi, zvlnr, vez, vez+4);
}
}
- if(ho4) {
- if(ec & ME_V3V4) {
+ if (ho4) {
+ if (ec & ME_V3V4) {
copy_v4_v4(vez, ho3);
copy_v4_v4(vez+4, ho4);
- if( clipline(vez, vez+4)) {
+ if ( clipline(vez, vez+4)) {
hoco_to_zco(zspan, vez, vez);
hoco_to_zco(zspan, vez+4, vez+4);
zspan->zbuflinefunc(zspan, obi, zvlnr, vez, vez+4);
}
}
- if(ec & ME_V4V1) {
+ if (ec & ME_V4V1) {
copy_v4_v4(vez, ho4);
copy_v4_v4(vez+4, ho1);
- if( clipline(vez, vez+4)) {
+ if ( clipline(vez, vez+4)) {
hoco_to_zco(zspan, vez, vez);
hoco_to_zco(zspan, vez+4, vez+4);
zspan->zbuflinefunc(zspan, obi, zvlnr, vez, vez+4);
@@ -964,10 +964,10 @@ void zbufclipwire(ZSpan *zspan, int obi, int zvlnr, int ec, float *ho1, float *h
}
}
else {
- if(ec & ME_V3V1) {
+ if (ec & ME_V3V1) {
copy_v4_v4(vez, ho3);
copy_v4_v4(vez+4, ho1);
- if( clipline(vez, vez+4)) {
+ if ( clipline(vez, vez+4)) {
hoco_to_zco(zspan, vez, vez);
hoco_to_zco(zspan, vez+4, vez+4);
zspan->zbuflinefunc(zspan, obi, zvlnr, vez, vez+4);
@@ -982,18 +982,18 @@ void zbufclipwire(ZSpan *zspan, int obi, int zvlnr, int ec, float *ho1, float *h
hoco_to_zco(zspan, vez, ho1);
hoco_to_zco(zspan, vez+4, ho2);
hoco_to_zco(zspan, vez+8, ho3);
- if(ho4) {
+ if (ho4) {
hoco_to_zco(zspan, vez+12, ho4);
- if(ec & ME_V3V4) zspan->zbuflinefunc(zspan, obi, zvlnr, vez+8, vez+12);
- if(ec & ME_V4V1) zspan->zbuflinefunc(zspan, obi, zvlnr, vez+12, vez);
+ if (ec & ME_V3V4) zspan->zbuflinefunc(zspan, obi, zvlnr, vez+8, vez+12);
+ if (ec & ME_V4V1) zspan->zbuflinefunc(zspan, obi, zvlnr, vez+12, vez);
}
else {
- if(ec & ME_V3V1) zspan->zbuflinefunc(zspan, obi, zvlnr, vez+8, vez);
+ if (ec & ME_V3V1) zspan->zbuflinefunc(zspan, obi, zvlnr, vez+8, vez);
}
- if(ec & ME_V1V2) zspan->zbuflinefunc(zspan, obi, zvlnr, vez, vez+4);
- if(ec & ME_V2V3) zspan->zbuflinefunc(zspan, obi, zvlnr, vez+4, vez+8);
+ if (ec & ME_V1V2) zspan->zbuflinefunc(zspan, obi, zvlnr, vez, vez+4);
+ if (ec & ME_V2V3) zspan->zbuflinefunc(zspan, obi, zvlnr, vez+4, vez+8);
}
@@ -1005,12 +1005,12 @@ void zbufsinglewire(ZSpan *zspan, int obi, int zvlnr, const float ho1[4], const
c1= testclip(ho1);
c2= testclip(ho2);
- if(c1 | c2) { /* not in the middle */
- if(!(c1 & c2)) { /* not out completely */
+ if (c1 | c2) { /* not in the middle */
+ if (!(c1 & c2)) { /* not out completely */
copy_v4_v4(f1, ho1);
copy_v4_v4(f2, ho2);
- if(clipline(f1, f2)) {
+ if (clipline(f1, f2)) {
hoco_to_zco(zspan, f1, f1);
hoco_to_zco(zspan, f2, f2);
zspan->zbuflinefunc(zspan, obi, zvlnr, f1, f2);
@@ -1032,9 +1032,9 @@ void zbufsinglewire(ZSpan *zspan, int obi, int zvlnr, const float ho1[4], const
* This is one of the z buffer fill functions called in zbufclip() and
* zbufwireclip().
*
- * @param v1 [4 floats, world coordinates] first vertex
- * @param v2 [4 floats, world coordinates] second vertex
- * @param v3 [4 floats, world coordinates] third vertex
+ * \param v1 [4 floats, world coordinates] first vertex
+ * \param v2 [4 floats, world coordinates] second vertex
+ * \param v3 [4 floats, world coordinates] third vertex
*/
/* WATCH IT: zbuffillGLinv4 and zbuffillGL4 are identical except for a 2 lines,
@@ -1057,7 +1057,7 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v
/* set spans */
zbuf_add_to_span(zspan, v1, v2);
zbuf_add_to_span(zspan, v2, v3);
- if(v4) {
+ if (v4) {
zbuf_add_to_span(zspan, v3, v4);
zbuf_add_to_span(zspan, v4, v1);
}
@@ -1065,13 +1065,13 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v
zbuf_add_to_span(zspan, v3, v1);
/* clipped */
- if(zspan->minp2==NULL || zspan->maxp2==NULL) return;
+ if (zspan->minp2==NULL || zspan->maxp2==NULL) return;
- if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
- if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
+ if (zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
+ if (zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
// printf("my %d %d\n", my0, my2);
- if(my2<my0) return;
+ if (my2<my0) return;
/* ZBUF DX DY, in floats still */
@@ -1085,7 +1085,7 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v
y0= z1*x2-x1*z2;
z0= x1*y2-y1*x2;
- if(z0==0.0f) return;
+ if (z0==0.0f) return;
xx1= (x0*v1[0] + y0*v1[1])/z0 + v1[2];
@@ -1102,7 +1102,7 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v
/* correct span */
sn1= (my0 + my2)/2;
- if(zspan->span1[sn1] < zspan->span2[sn1]) {
+ if (zspan->span1[sn1] < zspan->span2[sn1]) {
span1= zspan->span1+my2;
span2= zspan->span2+my2;
}
@@ -1111,16 +1111,16 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v
span2= zspan->span1+my2;
}
- for(y=my2; y>=my0; y--, span1--, span2--) {
+ for (y=my2; y>=my0; y--, span1--, span2--) {
sn1= floor(*span1);
sn2= floor(*span2);
sn1++;
- if(sn2>=rectx) sn2= rectx-1;
- if(sn1<0) sn1= 0;
+ if (sn2>=rectx) sn2= rectx-1;
+ if (sn1<0) sn1= 0;
- if(sn2>=sn1) {
+ if (sn2>=sn1) {
int intzverg;
zverg= (double)sn1*zxd + zy0;
@@ -1130,11 +1130,11 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v
rm= rectmaskofs+sn1;
x= sn2-sn1;
- while(x>=0) {
+ while (x>=0) {
intzverg= (int)CLAMPIS(zverg, INT_MIN, INT_MAX);
- if( intzverg > *rz || *rz==0x7FFFFFFF) { /* UNIQUE LINE: see comment above */
- if(!zspan->rectmask || intzverg > *rm) {
+ if ( intzverg > *rz || *rz==0x7FFFFFFF) { /* UNIQUE LINE: see comment above */
+ if (!zspan->rectmask || intzverg > *rm) {
*ro= obi; /* UNIQUE LINE: see comment above (order differs) */
*rz= intzverg;
*rp= zvlnr;
@@ -1179,7 +1179,7 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
/* set spans */
zbuf_add_to_span(zspan, v1, v2);
zbuf_add_to_span(zspan, v2, v3);
- if(v4) {
+ if (v4) {
zbuf_add_to_span(zspan, v3, v4);
zbuf_add_to_span(zspan, v4, v1);
}
@@ -1187,13 +1187,13 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
zbuf_add_to_span(zspan, v3, v1);
/* clipped */
- if(zspan->minp2==NULL || zspan->maxp2==NULL) return;
+ if (zspan->minp2==NULL || zspan->maxp2==NULL) return;
- if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
- if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
+ if (zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
+ if (zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
// printf("my %d %d\n", my0, my2);
- if(my2<my0) return;
+ if (my2<my0) return;
/* ZBUF DX DY, in floats still */
@@ -1207,7 +1207,7 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
y0= z1*x2-x1*z2;
z0= x1*y2-y1*x2;
- if(z0==0.0f) return;
+ if (z0==0.0f) return;
xx1= (x0*v1[0] + y0*v1[1])/z0 + v1[2];
@@ -1224,7 +1224,7 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
/* correct span */
sn1= (my0 + my2)/2;
- if(zspan->span1[sn1] < zspan->span2[sn1]) {
+ if (zspan->span1[sn1] < zspan->span2[sn1]) {
span1= zspan->span1+my2;
span2= zspan->span2+my2;
}
@@ -1233,16 +1233,16 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
span2= zspan->span1+my2;
}
- for(y=my2; y>=my0; y--, span1--, span2--) {
+ for (y=my2; y>=my0; y--, span1--, span2--) {
sn1= floor(*span1);
sn2= floor(*span2);
sn1++;
- if(sn2>=rectx) sn2= rectx-1;
- if(sn1<0) sn1= 0;
+ if (sn2>=rectx) sn2= rectx-1;
+ if (sn1<0) sn1= 0;
- if(sn2>=sn1) {
+ if (sn2>=sn1) {
int intzverg;
zverg= (double)sn1*zxd + zy0;
@@ -1252,11 +1252,11 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
rm= rectmaskofs+sn1;
x= sn2-sn1;
- while(x>=0) {
+ while (x>=0) {
intzverg= (int)CLAMPIS(zverg, INT_MIN, INT_MAX);
- if(intzverg < *rz) { /* ONLY UNIQUE LINE: see comment above */
- if(!zspan->rectmask || intzverg > *rm) {
+ if (intzverg < *rz) { /* ONLY UNIQUE LINE: see comment above */
+ if (!zspan->rectmask || intzverg > *rm) {
*rz= intzverg;
*rp= zvlnr;
*ro= obi; /* UNIQUE LINE: see comment above (order differs) */
@@ -1285,9 +1285,9 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
* This is one of the z buffer fill functions called in zbufclip() and
* zbufwireclip().
*
- * @param v1 [4 floats, world coordinates] first vertex
- * @param v2 [4 floats, world coordinates] second vertex
- * @param v3 [4 floats, world coordinates] third vertex
+ * \param v1 [4 floats, world coordinates] first vertex
+ * \param v2 [4 floats, world coordinates] second vertex
+ * \param v3 [4 floats, world coordinates] third vertex
*/
/* now: filling two Z values, the closest and 2nd closest */
@@ -1306,7 +1306,7 @@ static void zbuffillGL_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), f
/* set spans */
zbuf_add_to_span(zspan, v1, v2);
zbuf_add_to_span(zspan, v2, v3);
- if(v4) {
+ if (v4) {
zbuf_add_to_span(zspan, v3, v4);
zbuf_add_to_span(zspan, v4, v1);
}
@@ -1314,13 +1314,13 @@ static void zbuffillGL_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), f
zbuf_add_to_span(zspan, v3, v1);
/* clipped */
- if(zspan->minp2==NULL || zspan->maxp2==NULL) return;
+ if (zspan->minp2==NULL || zspan->maxp2==NULL) return;
- if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
- if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
+ if (zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
+ if (zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
// printf("my %d %d\n", my0, my2);
- if(my2<my0) return;
+ if (my2<my0) return;
/* ZBUF DX DY, in floats still */
@@ -1334,7 +1334,7 @@ static void zbuffillGL_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), f
y0= z1*x2-x1*z2;
z0= x1*y2-y1*x2;
- if(z0==0.0f) return;
+ if (z0==0.0f) return;
xx1= (x0*v1[0] + y0*v1[1])/z0 + v1[2];
@@ -1345,12 +1345,12 @@ static void zbuffillGL_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), f
/* start-offset in rect */
rectx= zspan->rectx;
rectzofs= (zspan->rectz+rectx*my2);
- if(zspan->rectz1)
+ if (zspan->rectz1)
rectzofs1= (zspan->rectz1+rectx*my2);
/* correct span */
sn1= (my0 + my2)/2;
- if(zspan->span1[sn1] < zspan->span2[sn1]) {
+ if (zspan->span1[sn1] < zspan->span2[sn1]) {
span1= zspan->span1+my2;
span2= zspan->span2+my2;
}
@@ -1359,30 +1359,30 @@ static void zbuffillGL_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), f
span2= zspan->span1+my2;
}
- for(y=my2; y>=my0; y--, span1--, span2--) {
+ for (y=my2; y>=my0; y--, span1--, span2--) {
sn1= floor(*span1);
sn2= floor(*span2);
sn1++;
- if(sn2>=rectx) sn2= rectx-1;
- if(sn1<0) sn1= 0;
+ if (sn2>=rectx) sn2= rectx-1;
+ if (sn1<0) sn1= 0;
- if(sn2>=sn1) {
+ if (sn2>=sn1) {
zverg= (double)sn1*zxd + zy0;
rz= rectzofs+sn1;
rz1= rectzofs1+sn1;
x= sn2-sn1;
- while(x>=0) {
+ while (x>=0) {
int zvergi= (int)CLAMPIS(zverg, INT_MIN, INT_MAX);
/* option: maintain two depth values, closest and 2nd closest */
- if(zvergi < *rz) {
- if(rectzofs1) *rz1= *rz;
+ if (zvergi < *rz) {
+ if (rectzofs1) *rz1= *rz;
*rz= zvergi;
}
- else if(rectzofs1 && zvergi < *rz1)
+ else if (rectzofs1 && zvergi < *rz1)
*rz1= zvergi;
zverg+= zxd;
@@ -1395,7 +1395,7 @@ static void zbuffillGL_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), f
zy0-=zyd;
rectzofs-= rectx;
- if(rectzofs1) rectzofs1-= rectx;
+ if (rectzofs1) rectzofs1-= rectx;
}
}
@@ -1416,13 +1416,13 @@ void zspan_scanconvert_strand(ZSpan *zspan, void *handle, float *v1, float *v2,
zbuf_add_to_span(zspan, v3, v1);
/* clipped */
- if(zspan->minp2==NULL || zspan->maxp2==NULL) return;
+ if (zspan->minp2==NULL || zspan->maxp2==NULL) return;
- if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
- if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
+ if (zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
+ if (zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
// printf("my %d %d\n", my0, my2);
- if(my2<my0) return;
+ if (my2<my0) return;
/* ZBUF DX DY, in floats still */
x1= v1[0]- v2[0];
@@ -1436,7 +1436,7 @@ void zspan_scanconvert_strand(ZSpan *zspan, void *handle, float *v1, float *v2,
y0= z1*x2-x1*z2;
z0= x1*y2-y1*x2;
- if(z0==0.0f) return;
+ if (z0==0.0f) return;
xx1= (x0*v1[0] + y0*v1[1])/z0 + v1[2];
zxd= -(double)x0/(double)z0;
@@ -1467,7 +1467,7 @@ void zspan_scanconvert_strand(ZSpan *zspan, void *handle, float *v1, float *v2,
/* correct span */
sn1= (my0 + my2)/2;
- if(zspan->span1[sn1] < zspan->span2[sn1]) {
+ if (zspan->span1[sn1] < zspan->span2[sn1]) {
span1= zspan->span1+my2;
span2= zspan->span2+my2;
}
@@ -1476,20 +1476,20 @@ void zspan_scanconvert_strand(ZSpan *zspan, void *handle, float *v1, float *v2,
span2= zspan->span1+my2;
}
- for(y=my2; y>=my0; y--, span1--, span2--) {
+ for (y=my2; y>=my0; y--, span1--, span2--) {
sn1= floor(*span1);
sn2= floor(*span2);
sn1++;
- if(sn2>=rectx) sn2= rectx-1;
- if(sn1<0) sn1= 0;
+ if (sn2>=rectx) sn2= rectx-1;
+ if (sn1<0) sn1= 0;
u= (double)sn1*uxd + uy0;
v= (double)sn1*vxd + vy0;
z= (double)sn1*zxd + zy0;
- for(x= sn1; x<=sn2; x++, u+=uxd, v+=vxd, z+=zxd)
+ for (x= sn1; x<=sn2; x++, u+=uxd, v+=vxd, z+=zxd)
func(handle, x, y, u, v, z);
uy0 -= uyd;
@@ -1516,13 +1516,13 @@ void zspan_scanconvert(ZSpan *zspan, void *handle, float *v1, float *v2, float *
zbuf_add_to_span(zspan, v3, v1);
/* clipped */
- if(zspan->minp2==NULL || zspan->maxp2==NULL) return;
+ if (zspan->minp2==NULL || zspan->maxp2==NULL) return;
- if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
- if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
+ if (zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
+ if (zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
// printf("my %d %d\n", my0, my2);
- if(my2<my0) return;
+ if (my2<my0) return;
/* ZBUF DX DY, in floats still */
x1= v1[0]- v2[0];
@@ -1537,7 +1537,7 @@ void zspan_scanconvert(ZSpan *zspan, void *handle, float *v1, float *v2, float *
y0= z1*x2-x1*z2;
z0= x1*y2-y1*x2;
- if(z0==0.0f) return;
+ if (z0==0.0f) return;
xx1= (x0*v1[0] + y0*v1[1])/z0 + 1.0f;
uxd= -(double)x0/(double)z0;
@@ -1557,7 +1557,7 @@ void zspan_scanconvert(ZSpan *zspan, void *handle, float *v1, float *v2, float *
/* correct span */
sn1= (my0 + my2)/2;
- if(zspan->span1[sn1] < zspan->span2[sn1]) {
+ if (zspan->span1[sn1] < zspan->span2[sn1]) {
span1= zspan->span1+my2;
span2= zspan->span2+my2;
}
@@ -1566,19 +1566,19 @@ void zspan_scanconvert(ZSpan *zspan, void *handle, float *v1, float *v2, float *
span2= zspan->span1+my2;
}
- for(y=my2; y>=my0; y--, span1--, span2--) {
+ for (y=my2; y>=my0; y--, span1--, span2--) {
sn1= floor(*span1);
sn2= floor(*span2);
sn1++;
- if(sn2>=rectx) sn2= rectx-1;
- if(sn1<0) sn1= 0;
+ if (sn2>=rectx) sn2= rectx-1;
+ if (sn1<0) sn1= 0;
u= (double)sn1*uxd + uy0;
v= (double)sn1*vxd + vy0;
- for(x= sn1; x<=sn2; x++, u+=uxd, v+=vxd)
+ for (x= sn1; x<=sn2; x++, u+=uxd, v+=vxd)
func(handle, x, y, u, v);
uy0 -= uyd;
@@ -1591,15 +1591,14 @@ 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
- * @param b1
- * @param b2
- * @param b3
- * @param a index for coordinate (x, y, or z)
+ * \param v1 start coordinate s
+ * \param v2 target coordinate t
+ * \param b1
+ * \param b2
+ * \param b3
+ * \param a index for coordinate (x, y, or z)
*/
static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a, float clipcrop)
@@ -1613,7 +1612,7 @@ static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a
da= v2[a]-v1[a];
/* prob; we clip slightly larger, osa renders add 2 pixels on edges, should become variable? */
/* or better; increase r.winx/y size, but thats quite a complex one. do it later */
- if(a==2) {
+ if (a==2) {
dw= (v2[3]-v1[3]);
v13= v1[3];
}
@@ -1628,18 +1627,21 @@ static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a
* who would have thought that of L&B!
*/
- if(cliptestf(-da, -dw, v13, v1[a], &u1,&u2)) {
- if(cliptestf(da, -dw, v13, -v1[a], &u1,&u2)) {
+ if (cliptestf(-da, -dw, v13, v1[a], &u1,&u2)) {
+ if (cliptestf(da, -dw, v13, -v1[a], &u1,&u2)) {
*b3=1;
- if(u2<1.0f) {
+ if (u2<1.0f) {
labda[1]= u2;
*b2=1;
}
else labda[1]=1.0; /* u2 */
- if(u1>0.0f) {
- labda[0]= u1;
- *b2=1;
- } else labda[0]=0.0;
+ if (u1>0.0f) {
+ labda[0] = u1;
+ *b2 = 1;
+ }
+ else {
+ labda[0] = 0.0;
+ }
}
}
}
@@ -1652,11 +1654,11 @@ static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a
* vertex list of this face.
*
*
- * @param v1 start coordinate s
- * @param v2 target coordinate t
- * @param b1
- * @param b2
- * @param clve vertex vector.
+ * \param v1 start coordinate s
+ * \param v2 target coordinate t
+ * \param b1
+ * \param b2
+ * \param clve vertex vector.
*/
static void makevertpyra(float *vez, float *labda, float **trias, float *v1, float *v2, int *b1, int *clve)
@@ -1666,8 +1668,8 @@ static void makevertpyra(float *vez, float *labda, float **trias, float *v1, flo
l1= labda[0];
l2= labda[1];
- if(l1!= -1.0f) {
- if(l1!= 0.0f) {
+ if (l1!= -1.0f) {
+ if (l1!= 0.0f) {
adr= vez+4*(*clve);
trias[*b1]=adr;
(*clve)++;
@@ -1680,8 +1682,8 @@ static void makevertpyra(float *vez, float *labda, float **trias, float *v1, flo
(*b1)++;
}
- if(l2!= -1.0f) {
- if(l2!= 1.0f) {
+ if (l2!= -1.0f) {
+ if (l2!= 1.0f) {
adr= vez+4*(*clve);
trias[*b1]=adr;
(*clve)++;
@@ -1741,11 +1743,11 @@ static void zbuf_project_cache_clear(ZbufProjectCache *cache, int size)
{
int i;
- if(size > ZBUF_PROJECT_CACHE_SIZE)
+ if (size > ZBUF_PROJECT_CACHE_SIZE)
size= ZBUF_PROJECT_CACHE_SIZE;
memset(cache, 0, sizeof(ZbufProjectCache)*size);
- for(i=0; i<size; i++)
+ for (i=0; i<size; i++)
cache[i].index= -1;
}
@@ -1753,7 +1755,7 @@ static int zbuf_shadow_project(ZbufProjectCache *cache, int index, float winmat[
{
int cindex= index & 255;
- if(cache[cindex].index == index) {
+ if (cache[cindex].index == index) {
copy_v4_v4(ho, cache[cindex].ho);
return cache[cindex].clip;
}
@@ -1783,7 +1785,7 @@ static int zbuf_part_project(ZbufProjectCache *cache, int index, float winmat[][
float vec[3];
int cindex= index & 255;
- if(cache[cindex].index == index) {
+ if (cache[cindex].index == index) {
copy_v4_v4(ho, cache[cindex].ho);
return cache[cindex].clip;
}
@@ -1794,10 +1796,10 @@ static int zbuf_part_project(ZbufProjectCache *cache, int index, float winmat[][
projectvert(co, winmat, ho);
wco= ho[3];
- if(ho[0] < bounds[0]*wco) clipflag |= 1;
- else if(ho[0] > bounds[1]*wco) clipflag |= 2;
- if(ho[1] > bounds[3]*wco) clipflag |= 4;
- else if(ho[1] < bounds[2]*wco) clipflag |= 8;
+ if (ho[0] < bounds[0]*wco) clipflag |= 1;
+ else if (ho[0] > bounds[1]*wco) clipflag |= 2;
+ if (ho[1] > bounds[3]*wco) clipflag |= 4;
+ else if (ho[1] < bounds[2]*wco) clipflag |= 8;
copy_v4_v4(cache[cindex].ho, ho);
cache[cindex].clip= clipflag;
@@ -1817,7 +1819,7 @@ void zbuf_render_project(float winmat[][4], const float co[3], float ho[4])
void zbuf_make_winmat(Render *re, float winmat[][4])
{
- if(re->r.mode & R_PANORAMA) {
+ if (re->r.mode & R_PANORAMA) {
float panomat[4][4]= MAT4_UNITY;
panomat[0][0]= re->panoco;
@@ -1838,10 +1840,11 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
float *vlzp[32][3], labda[3][2];
float vez[400], *trias[40];
- if(c1 | c2 | c3) { /* not in middle */
- if(c1 & c2 & c3) { /* completely out */
+ if (c1 | c2 | c3) { /* not in middle */
+ if (c1 & c2 & c3) { /* completely out */
return;
- } else { /* clipping */
+ }
+ else { /* clipping */
int arg, v, b, clipflag[3], b1, b2, b3, c4, clve=3, clvlo, clvl=1;
vez[0]= f1[0]; vez[1]= f1[1]; vez[2]= f1[2]; vez[3]= f1[3];
@@ -1853,24 +1856,24 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
vlzp[0][2]= vez+8;
clipflag[0]= ( (c1 & 48) | (c2 & 48) | (c3 & 48) );
- if(clipflag[0]==0) { /* othwerwise it needs to be calculated again, after the first (z) clip */
+ if (clipflag[0]==0) { /* othwerwise it needs to be calculated again, after the first (z) clip */
clipflag[1]= ( (c1 & 3) | (c2 & 3) | (c3 & 3) );
clipflag[2]= ( (c1 & 12) | (c2 & 12) | (c3 & 12) );
}
else clipflag[1]=clipflag[2]= 0;
- for(b=0;b<3;b++) {
+ for (b=0;b<3;b++) {
- if(clipflag[b]) {
+ if (clipflag[b]) {
clvlo= clvl;
- for(v=0; v<clvlo; v++) {
+ for (v=0; v<clvlo; v++) {
- if(vlzp[v][0]!=NULL) { /* face is still there */
+ if (vlzp[v][0]!=NULL) { /* face is still there */
b2= b3 =0; /* clip flags */
- if(b==0) arg= 2;
+ if (b==0) arg= 2;
else if (b==1) arg= 0;
else arg= 1;
@@ -1878,27 +1881,29 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
clippyra(labda[1], vlzp[v][1],vlzp[v][2], &b2,&b3, arg, zspan->clipcrop);
clippyra(labda[2], vlzp[v][2],vlzp[v][0], &b2,&b3, arg, zspan->clipcrop);
- if(b2==0 && b3==1) {
- /* completely 'in', but we copy because of last for() loop in this section */;
+ if (b2==0 && b3==1) {
+ /* completely 'in', but we copy because of last for () loop in this section */;
vlzp[clvl][0]= vlzp[v][0];
vlzp[clvl][1]= vlzp[v][1];
vlzp[clvl][2]= vlzp[v][2];
vlzp[v][0]= NULL;
clvl++;
- } else if(b3==0) {
+ }
+ else if (b3==0) {
vlzp[v][0]= NULL;
/* completely 'out' */;
- } else {
+ }
+ else {
b1=0;
makevertpyra(vez, labda[0], trias, vlzp[v][0],vlzp[v][1], &b1,&clve);
makevertpyra(vez, labda[1], trias, vlzp[v][1],vlzp[v][2], &b1,&clve);
makevertpyra(vez, labda[2], trias, vlzp[v][2],vlzp[v][0], &b1,&clve);
/* after front clip done: now set clip flags */
- if(b==0) {
+ if (b==0) {
clipflag[1]= clipflag[2]= 0;
f1= vez;
- for(b3=0; b3<clve; b3++) {
+ for (b3=0; b3<clve; b3++) {
c4= testclip(f1);
clipflag[1] |= (c4 & 3);
clipflag[2] |= (c4 & 12);
@@ -1907,8 +1912,8 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
}
vlzp[v][0]= NULL;
- if(b1>2) {
- for(b3=3; b3<=b1; b3++) {
+ if (b1>2) {
+ for (b3=3; b3<=b1; b3++) {
vlzp[clvl][0]= trias[0];
vlzp[clvl][1]= trias[b3-2];
vlzp[clvl][2]= trias[b3-1];
@@ -1922,16 +1927,16 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
}
/* warning, this should never happen! */
- if(clve>38 || clvl>31) printf("clip overflow: clve clvl %d %d\n",clve,clvl);
+ if (clve>38 || clvl>31) printf("clip overflow: clve clvl %d %d\n",clve,clvl);
/* perspective division */
f1=vez;
- for(c1=0;c1<clve;c1++) {
+ for (c1=0;c1<clve;c1++) {
hoco_to_zco(zspan, f1, f1);
f1+=4;
}
- for(b=1;b<clvl;b++) {
- if(vlzp[b][0]) {
+ for (b=1;b<clvl;b++) {
+ if (vlzp[b][0]) {
zspan->zbuffunc(zspan, obi, zvlnr, vlzp[b][0],vlzp[b][1],vlzp[b][2], NULL);
}
}
@@ -1950,10 +1955,11 @@ void zbufclip4(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3
{
float vez[16];
- if(c1 | c2 | c3 | c4) { /* not in middle */
- if(c1 & c2 & c3 & c4) { /* completely out */
+ if (c1 | c2 | c3 | c4) { /* not in middle */
+ if (c1 & c2 & c3 & c4) { /* completely out */
return;
- } else { /* clipping */
+ }
+ else { /* clipping */
zbufclip(zspan, obi, zvlnr, f1, f2, f3, c1, c2, c3);
zbufclip(zspan, obi, zvlnr, f1, f3, f4, c1, c3, c4);
}
@@ -1971,7 +1977,7 @@ void zbufclip4(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3
/* ************** ZMASK ******************************** */
-#define EXTEND_PIXEL(a) if(temprectp[a]) {z+= rectz[a]; tot++;}
+#define EXTEND_PIXEL(a) if (temprectp[a]) {z+= rectz[a]; tot++;}
/* changes the zbuffer to be ready for z-masking: applies an extend-filter, and then clears */
static void zmask_rect(int *rectz, int *rectp, int xs, int ys, int neg)
@@ -1984,21 +1990,21 @@ static void zmask_rect(int *rectz, int *rectp, int xs, int ys, int neg)
/* extend: if pixel is not filled in, we check surrounding pixels and average z value */
- for(y=1; y<=ys; y++) {
+ for (y=1; y<=ys; y++) {
/* setup row indices */
row1= (y-2)*xs;
row2= row1 + xs;
row3= row2 + xs;
- if(y==1)
+ if (y==1)
row1= row2;
- else if(y==ys)
+ else if (y==ys)
row3= row2;
curp= rectp + (y-1)*xs;
curz= rectz + (y-1)*xs;
- for(x=0; x<xs; x++, curp++, curz++) {
- if(curp[0]==0) {
+ for (x=0; x<xs; x++, curp++, curz++) {
+ if (curp[0]==0) {
int tot= 0;
float z= 0.0f;
@@ -2007,19 +2013,19 @@ static void zmask_rect(int *rectz, int *rectp, int xs, int ys, int neg)
EXTEND_PIXEL(row3);
EXTEND_PIXEL(row1 + 1);
EXTEND_PIXEL(row3 + 1);
- if(x!=xs-1) {
+ if (x!=xs-1) {
EXTEND_PIXEL(row1 + 2);
EXTEND_PIXEL(row2 + 2);
EXTEND_PIXEL(row3 + 2);
}
- if(tot) {
+ if (tot) {
len++;
curz[0]= (int)(z/(float)tot);
curp[0]= -1; /* env */
}
}
- if(x!=0) {
+ if (x!=0) {
row1++; row2++; row3++;
}
}
@@ -2027,11 +2033,11 @@ static void zmask_rect(int *rectz, int *rectp, int xs, int ys, int neg)
MEM_freeN(temprectp);
- if(neg); /* z values for negative are already correct */
+ if (neg); /* z values for negative are already correct */
else {
/* clear not filled z values */
- for(len= xs*ys -1; len>=0; len--) {
- if(rectp[len]==0) {
+ for (len= xs*ys -1; len>=0; len--) {
+ if (rectp[len]==0) {
rectz[len] = -0x7FFFFFFF;
rectp[len]= -1; /* env code */
}
@@ -2066,7 +2072,7 @@ void zbuffer_solid(RenderPart *pa, RenderLayer *rl, void(*fillfunc)(RenderPart*,
samples= (R.osa? R.osa: 1);
samples= MIN2(4, samples-pa->sample);
- for(zsample=0; zsample<samples; zsample++) {
+ for (zsample=0; zsample<samples; zsample++) {
zspan= &zspans[zsample];
zbuffer_part_bounds(R.winx, R.winy, pa, bounds);
@@ -2076,11 +2082,11 @@ void zbuffer_solid(RenderPart *pa, RenderLayer *rl, void(*fillfunc)(RenderPart*,
zspan->zmulx= ((float)R.winx)/2.0f;
zspan->zmuly= ((float)R.winy)/2.0f;
- if(R.osa) {
+ if (R.osa) {
zspan->zofsx= -pa->disprect.xmin - R.jit[pa->sample+zsample][0];
zspan->zofsy= -pa->disprect.ymin - R.jit[pa->sample+zsample][1];
}
- else if(R.i.curblur) {
+ else if (R.i.curblur) {
zspan->zofsx= -pa->disprect.xmin - R.mblur_jit[R.i.curblur-1][0];
zspan->zofsy= -pa->disprect.ymin - R.mblur_jit[R.i.curblur-1][1];
}
@@ -2093,11 +2099,11 @@ void zbuffer_solid(RenderPart *pa, RenderLayer *rl, void(*fillfunc)(RenderPart*,
zspan->zofsy -= 0.5f;
/* the buffers */
- if(zsample == samples-1) {
+ if (zsample == samples-1) {
zspan->rectp= pa->rectp;
zspan->recto= pa->recto;
- if(neg_zmask)
+ if (neg_zmask)
zspan->rectz= pa->rectmask;
else
zspan->rectz= pa->rectz;
@@ -2114,17 +2120,17 @@ void zbuffer_solid(RenderPart *pa, RenderLayer *rl, void(*fillfunc)(RenderPart*,
}
/* in case zmask we fill Z for objects in lay_zmask first, then clear Z, and then do normal zbuffering */
- if(rl->layflag & SCE_LAY_ZMASK)
+ if (rl->layflag & SCE_LAY_ZMASK)
zmaskpass= 1;
- for(; zmaskpass >=0; zmaskpass--) {
+ for (; zmaskpass >=0; zmaskpass--) {
ma= NULL;
/* filling methods */
- for(zsample=0; zsample<samples; zsample++) {
+ for (zsample=0; zsample<samples; zsample++) {
zspan= &zspans[zsample];
- if(zmaskpass && neg_zmask)
+ if (zmaskpass && neg_zmask)
zspan->zbuffunc= zbuffillGLinv4;
else
zspan->zbuffunc= zbuffillGL4;
@@ -2132,48 +2138,48 @@ void zbuffer_solid(RenderPart *pa, RenderLayer *rl, void(*fillfunc)(RenderPart*,
}
/* regular zbuffering loop, does all sample buffers */
- for(i=0, obi=R.instancetable.first; obi; i++, obi=obi->next) {
+ for (i=0, obi=R.instancetable.first; obi; i++, obi=obi->next) {
obr= obi->obr;
/* continue happens in 2 different ways... zmaskpass only does lay_zmask stuff */
- if(zmaskpass) {
- if((obi->lay & lay_zmask)==0)
+ if (zmaskpass) {
+ if ((obi->lay & lay_zmask)==0)
continue;
}
- else if(!all_z && !(obi->lay & (lay|lay_zmask)))
+ else if (!all_z && !(obi->lay & (lay|lay_zmask)))
continue;
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mult_m4_m4m4(obwinmat, winmat, obi->mat);
else
copy_m4_m4(obwinmat, winmat);
- if(clip_render_object(obi->obr->boundbox, bounds, obwinmat))
+ if (clip_render_object(obi->obr->boundbox, bounds, obwinmat))
continue;
zbuf_project_cache_clear(cache, obr->totvert);
- for(v=0; v<obr->totvlak; v++) {
- if((v & 255)==0) vlr= obr->vlaknodes[v>>8].vlak;
+ for (v=0; v<obr->totvlak; v++) {
+ if ((v & 255)==0) vlr= obr->vlaknodes[v>>8].vlak;
else vlr++;
/* the cases: visible for render, only z values, zmask, nothing */
- if(obi->lay & lay) {
- if(vlr->mat!=ma) {
+ if (obi->lay & lay) {
+ if (vlr->mat!=ma) {
ma= vlr->mat;
nofill= (ma->mode & MA_ONLYCAST) || ((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP));
env= (ma->mode & MA_ENV);
wire= (ma->material_type == MA_TYPE_WIRE);
- for(zsample=0; zsample<samples; zsample++) {
- if(ma->mode & MA_ZINV || (zmaskpass && neg_zmask))
+ for (zsample=0; zsample<samples; zsample++) {
+ if (ma->mode & MA_ZINV || (zmaskpass && neg_zmask))
zspans[zsample].zbuffunc= zbuffillGLinv4;
else
zspans[zsample].zbuffunc= zbuffillGL4;
}
}
}
- else if(all_z || (obi->lay & lay_zmask)) {
+ else if (all_z || (obi->lay & lay_zmask)) {
env= 1;
nofill= 0;
ma= NULL;
@@ -2183,7 +2189,7 @@ void zbuffer_solid(RenderPart *pa, RenderLayer *rl, void(*fillfunc)(RenderPart*,
ma= NULL; /* otherwise nofill can hang */
}
- if(!(vlr->flag & R_HIDDEN) && nofill==0) {
+ if (!(vlr->flag & R_HIDDEN) && nofill==0) {
unsigned short partclip;
v1= vlr->v1;
@@ -2197,39 +2203,39 @@ void zbuffer_solid(RenderPart *pa, RenderLayer *rl, void(*fillfunc)(RenderPart*,
/* partclipping doesn't need viewplane clipping */
partclip= c1 & c2 & c3;
- if(v4) {
+ if (v4) {
c4= zbuf_part_project(cache, v4->index, obwinmat, bounds, v4->co, ho4);
partclip &= c4;
}
- if(partclip==0) {
+ if (partclip==0) {
- if(env) zvlnr= -1;
+ if (env) zvlnr= -1;
else zvlnr= v+1;
c1= testclip(ho1);
c2= testclip(ho2);
c3= testclip(ho3);
- if(v4)
+ if (v4)
c4= testclip(ho4);
- for(zsample=0; zsample<samples; zsample++) {
+ for (zsample=0; zsample<samples; zsample++) {
zspan= &zspans[zsample];
- if(wire) {
- if(v4)
+ if (wire) {
+ if (v4)
zbufclipwire(zspan, i, zvlnr, vlr->ec, ho1, ho2, ho3, ho4, c1, c2, c3, c4);
else
zbufclipwire(zspan, i, zvlnr, vlr->ec, ho1, ho2, ho3, 0, c1, c2, c3, 0);
}
else {
/* strands allow to be filled in as quad */
- if(v4 && (vlr->flag & R_STRAND)) {
+ if (v4 && (vlr->flag & R_STRAND)) {
zbufclip4(zspan, i, zvlnr, ho1, ho2, ho3, ho4, c1, c2, c3, c4);
}
else {
zbufclip(zspan, i, zvlnr, ho1, ho2, ho3, c1, c2, c3);
- if(v4)
+ if (v4)
zbufclip(zspan, i, (env)? zvlnr: zvlnr+RE_QUAD_OFFS, ho1, ho3, ho4, c1, c3, c4);
}
}
@@ -2240,13 +2246,13 @@ void zbuffer_solid(RenderPart *pa, RenderLayer *rl, void(*fillfunc)(RenderPart*,
}
/* clear all z to close value, so it works as mask for next passes (ztra+strand) */
- if(zmaskpass) {
- for(zsample=0; zsample<samples; zsample++) {
+ if (zmaskpass) {
+ for (zsample=0; zsample<samples; zsample++) {
zspan= &zspans[zsample];
- if(neg_zmask) {
+ if (neg_zmask) {
zspan->rectmask= zspan->rectz;
- if(zsample == samples-1)
+ if (zsample == samples-1)
zspan->rectz= pa->rectz;
else
zspan->rectz= MEM_mallocN(sizeof(int)*pa->rectx*pa->recty, "rectz");
@@ -2260,17 +2266,17 @@ void zbuffer_solid(RenderPart *pa, RenderLayer *rl, void(*fillfunc)(RenderPart*,
}
}
- for(zsample=0; zsample<samples; zsample++) {
+ for (zsample=0; zsample<samples; zsample++) {
zspan= &zspans[zsample];
- if(fillfunc)
+ if (fillfunc)
fillfunc(pa, zspan, pa->sample+zsample, data);
- if(zsample != samples-1) {
+ if (zsample != samples-1) {
MEM_freeN(zspan->rectz);
MEM_freeN(zspan->rectp);
MEM_freeN(zspan->recto);
- if(zspan->rectmask)
+ if (zspan->rectmask)
MEM_freeN(zspan->rectmask);
}
@@ -2293,7 +2299,7 @@ void zbuffer_shadow(Render *re, float winmat[][4], LampRen *lar, int *rectz, int
float obwinmat[4][4], ho1[4], ho2[4], ho3[4], ho4[4];
int a, b, c, i, c1, c2, c3, c4, ok=1, lay= -1;
- if(lar->mode & (LA_LAYER|LA_LAYER_SHADOW)) lay= lar->lay;
+ if (lar->mode & (LA_LAYER|LA_LAYER_SHADOW)) lay= lar->lay;
/* 1.0f for clipping in clippyra()... bad stuff actually */
zbuf_alloc_span(&zspan, size, size, 1.0f);
@@ -2306,7 +2312,7 @@ void zbuffer_shadow(Render *re, float winmat[][4], LampRen *lar, int *rectz, int
/* the buffers */
zspan.rectz= rectz;
fillrect(rectz, size, size, 0x7FFFFFFE);
- if(lar->buftype==LA_SHADBUF_HALFWAY) {
+ if (lar->buftype==LA_SHADBUF_HALFWAY) {
zspan.rectz1= MEM_mallocN(size*size*sizeof(int), "seconday z buffer");
fillrect(zspan.rectz1, size, size, 0x7FFFFFFE);
}
@@ -2315,44 +2321,44 @@ void zbuffer_shadow(Render *re, float winmat[][4], LampRen *lar, int *rectz, int
zspan.zbuflinefunc= zbufline_onlyZ;
zspan.zbuffunc= zbuffillGL_onlyZ;
- for(i=0, obi=re->instancetable.first; obi; i++, obi=obi->next) {
+ for (i=0, obi=re->instancetable.first; obi; i++, obi=obi->next) {
obr= obi->obr;
- if(obr->ob==re->excludeob)
+ if (obr->ob==re->excludeob)
continue;
- else if(!(obi->lay & lay))
+ else if (!(obi->lay & lay))
continue;
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mult_m4_m4m4(obwinmat, winmat, obi->mat);
else
copy_m4_m4(obwinmat, winmat);
- if(clip_render_object(obi->obr->boundbox, NULL, obwinmat))
+ if (clip_render_object(obi->obr->boundbox, NULL, obwinmat))
continue;
zbuf_project_cache_clear(cache, obr->totvert);
/* faces */
- for(a=0; a<obr->totvlak; a++) {
+ for (a=0; a<obr->totvlak; a++) {
- if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
+ if ((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
else vlr++;
/* note, these conditions are copied in shadowbuf_autoclip() */
- if(vlr->mat!= ma) {
+ if (vlr->mat!= ma) {
ma= vlr->mat;
ok= 1;
- if((ma->mode & MA_SHADBUF)==0) ok= 0;
+ if ((ma->mode & MA_SHADBUF)==0) ok= 0;
}
- if(ok && (obi->lay & lay) && !(vlr->flag & R_HIDDEN)) {
+ if (ok && (obi->lay & lay) && !(vlr->flag & R_HIDDEN)) {
c1= zbuf_shadow_project(cache, vlr->v1->index, obwinmat, vlr->v1->co, ho1);
c2= zbuf_shadow_project(cache, vlr->v2->index, obwinmat, vlr->v2->co, ho2);
c3= zbuf_shadow_project(cache, vlr->v3->index, obwinmat, vlr->v3->co, ho3);
- if((ma->material_type == MA_TYPE_WIRE) || (vlr->flag & R_STRAND)) {
- if(vlr->v4) {
+ if ((ma->material_type == MA_TYPE_WIRE) || (vlr->flag & R_STRAND)) {
+ if (vlr->v4) {
c4= zbuf_shadow_project(cache, vlr->v4->index, obwinmat, vlr->v4->co, ho4);
zbufclipwire(&zspan, 0, a+1, vlr->ec, ho1, ho2, ho3, ho4, c1, c2, c3, c4);
}
@@ -2360,7 +2366,7 @@ void zbuffer_shadow(Render *re, float winmat[][4], LampRen *lar, int *rectz, int
zbufclipwire(&zspan, 0, a+1, vlr->ec, ho1, ho2, ho3, 0, c1, c2, c3, 0);
}
else {
- if(vlr->v4) {
+ if (vlr->v4) {
c4= zbuf_shadow_project(cache, vlr->v4->index, obwinmat, vlr->v4->co, ho4);
zbufclip4(&zspan, 0, 0, ho1, ho2, ho3, ho4, c1, c2, c3, c4);
}
@@ -2369,20 +2375,20 @@ void zbuffer_shadow(Render *re, float winmat[][4], LampRen *lar, int *rectz, int
}
}
- if((a & 255)==255 && re->test_break(re->tbh))
+ if ((a & 255)==255 && re->test_break(re->tbh))
break;
}
/* strands */
- if(obr->strandbuf) {
+ if (obr->strandbuf) {
/* for each bounding box containing a number of strands */
sbound= obr->strandbuf->bound;
- for(c=0; c<obr->strandbuf->totbound; c++, sbound++) {
- if(clip_render_object(sbound->boundbox, NULL, obwinmat))
+ for (c=0; c<obr->strandbuf->totbound; c++, sbound++) {
+ if (clip_render_object(sbound->boundbox, NULL, obwinmat))
continue;
/* for each strand in this bounding box */
- for(a=sbound->start; a<sbound->end; a++) {
+ for (a=sbound->start; a<sbound->end; a++) {
strand= RE_findOrAddStrand(obr, a);
sseg.obi= obi;
@@ -2393,16 +2399,16 @@ void zbuffer_shadow(Render *re, float winmat[][4], LampRen *lar, int *rectz, int
svert= strand->vert;
/* note, these conditions are copied in shadowbuf_autoclip() */
- if(sseg.buffer->ma!= ma) {
+ if (sseg.buffer->ma!= ma) {
ma= sseg.buffer->ma;
ok= 1;
- if((ma->mode & MA_SHADBUF)==0) ok= 0;
+ if ((ma->mode & MA_SHADBUF)==0) ok= 0;
}
- if(ok && (sseg.buffer->lay & lay)) {
+ if (ok && (sseg.buffer->lay & lay)) {
zbuf_project_cache_clear(cache, strand->totvert);
- for(b=0; b<strand->totvert-1; b++, svert++) {
+ for (b=0; b<strand->totvert-1; b++, svert++) {
sseg.v[0]= (b > 0)? (svert-1): svert;
sseg.v[1]= svert;
sseg.v[2]= svert+1;
@@ -2413,24 +2419,24 @@ void zbuffer_shadow(Render *re, float winmat[][4], LampRen *lar, int *rectz, int
c3= zbuf_shadow_project(cache, sseg.v[2]-strand->vert, obwinmat, sseg.v[2]->co, ho3);
c4= zbuf_shadow_project(cache, sseg.v[3]-strand->vert, obwinmat, sseg.v[3]->co, ho4);
- if(!(c1 & c2 & c3 & c4))
+ if (!(c1 & c2 & c3 & c4))
render_strand_segment(re, winmat, NULL, &zspan, 1, &sseg);
}
}
- if((a & 255)==255 && re->test_break(re->tbh))
+ if ((a & 255)==255 && re->test_break(re->tbh))
break;
}
}
}
- if(re->test_break(re->tbh))
+ if (re->test_break(re->tbh))
break;
}
/* merge buffers */
- if(lar->buftype==LA_SHADBUF_HALFWAY) {
- for(a=size*size -1; a>=0; a--)
+ if (lar->buftype==LA_SHADBUF_HALFWAY) {
+ for (a=size*size -1; a>=0; a--)
rectz[a]= (rectz[a]>>1) + (zspan.rectz1[a]>>1);
MEM_freeN(zspan.rectz1);
@@ -2450,7 +2456,7 @@ static void zbuffill_sss(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
/* set spans */
zbuf_add_to_span(zspan, v1, v2);
zbuf_add_to_span(zspan, v2, v3);
- if(v4) {
+ if (v4) {
zbuf_add_to_span(zspan, v3, v4);
zbuf_add_to_span(zspan, v4, v1);
}
@@ -2458,12 +2464,12 @@ static void zbuffill_sss(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
zbuf_add_to_span(zspan, v3, v1);
/* clipped */
- if(zspan->minp2==NULL || zspan->maxp2==NULL) return;
+ if (zspan->minp2==NULL || zspan->maxp2==NULL) return;
- if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
- if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
+ if (zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
+ if (zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
- if(my2<my0) return;
+ if (my2<my0) return;
/* ZBUF DX DY, in floats still */
x1= v1[0]- v2[0];
@@ -2477,7 +2483,7 @@ static void zbuffill_sss(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
y0= z1*x2-x1*z2;
z0= x1*y2-y1*x2;
- if(z0==0.0f) return;
+ if (z0==0.0f) return;
xx1= (x0*v1[0] + y0*v1[1])/z0 + v1[2];
zxd= -(double)x0/(double)z0;
@@ -2486,7 +2492,7 @@ static void zbuffill_sss(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
/* correct span */
sn1= (my0 + my2)/2;
- if(zspan->span1[sn1] < zspan->span2[sn1]) {
+ if (zspan->span1[sn1] < zspan->span2[sn1]) {
span1= zspan->span1+my2;
span2= zspan->span2+my2;
}
@@ -2495,17 +2501,17 @@ static void zbuffill_sss(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
span2= zspan->span1+my2;
}
- for(y=my2; y>=my0; y--, span1--, span2--) {
+ for (y=my2; y>=my0; y--, span1--, span2--) {
sn1= floor(*span1);
sn2= floor(*span2);
sn1++;
- if(sn2>=rectx) sn2= rectx-1;
- if(sn1<0) sn1= 0;
+ if (sn2>=rectx) sn2= rectx-1;
+ if (sn1<0) sn1= 0;
z= (double)sn1*zxd + zy0;
- for(x= sn1; x<=sn2; x++, z+=zxd)
+ for (x= sn1; x<=sn2; x++, z+=zxd)
zspan->sss_func(zspan->sss_handle, obi, zvlnr, x, y, z);
zy0 -= zyd;
@@ -2545,41 +2551,41 @@ void zbuffer_sss(RenderPart *pa, unsigned int lay, void *handle, void (*func)(vo
zspan.zbuffunc= zbuffill_sss;
/* fill front and back zbuffer */
- if(pa->rectz) {
+ if (pa->rectz) {
fillrect(pa->recto, pa->rectx, pa->recty, 0);
fillrect(pa->rectp, pa->rectx, pa->recty, 0);
fillrect(pa->rectz, pa->rectx, pa->recty, 0x7FFFFFFF);
}
- if(pa->rectbackz) {
+ if (pa->rectbackz) {
fillrect(pa->rectbacko, pa->rectx, pa->recty, 0);
fillrect(pa->rectbackp, pa->rectx, pa->recty, 0);
fillrect(pa->rectbackz, pa->rectx, pa->recty, -0x7FFFFFFF);
}
- for(i=0, obi=R.instancetable.first; obi; i++, obi=obi->next) {
+ for (i=0, obi=R.instancetable.first; obi; i++, obi=obi->next) {
obr= obi->obr;
- if(!(obi->lay & lay))
+ if (!(obi->lay & lay))
continue;
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mult_m4_m4m4(obwinmat, winmat, obi->mat);
else
copy_m4_m4(obwinmat, winmat);
- if(clip_render_object(obi->obr->boundbox, bounds, obwinmat))
+ if (clip_render_object(obi->obr->boundbox, bounds, obwinmat))
continue;
zbuf_project_cache_clear(cache, obr->totvert);
- for(v=0; v<obr->totvlak; v++) {
- if((v & 255)==0) vlr= obr->vlaknodes[v>>8].vlak;
+ for (v=0; v<obr->totvlak; v++) {
+ if ((v & 255)==0) vlr= obr->vlaknodes[v>>8].vlak;
else vlr++;
- if(material_in_material(vlr->mat, sss_ma)) {
+ if (material_in_material(vlr->mat, sss_ma)) {
/* three cases, visible for render, only z values and nothing */
- if(obi->lay & lay) {
- if(vlr->mat!=ma) {
+ if (obi->lay & lay) {
+ if (vlr->mat!=ma) {
ma= vlr->mat;
nofill= ma->mode & MA_ONLYCAST;
env= (ma->mode & MA_ENV);
@@ -2591,7 +2597,7 @@ void zbuffer_sss(RenderPart *pa, unsigned int lay, void *handle, void (*func)(vo
ma= NULL; /* otherwise nofill can hang */
}
- if(nofill==0 && wire==0 && env==0) {
+ if (nofill==0 && wire==0 && env==0) {
unsigned short partclip;
v1= vlr->v1;
@@ -2605,19 +2611,19 @@ void zbuffer_sss(RenderPart *pa, unsigned int lay, void *handle, void (*func)(vo
/* partclipping doesn't need viewplane clipping */
partclip= c1 & c2 & c3;
- if(v4) {
+ if (v4) {
c4= zbuf_part_project(cache, v4->index, obwinmat, bounds, v4->co, ho4);
partclip &= c4;
}
- if(partclip==0) {
+ if (partclip==0) {
c1= testclip(ho1);
c2= testclip(ho2);
c3= testclip(ho3);
zvlnr= v+1;
zbufclip(&zspan, i, zvlnr, ho1, ho2, ho3, c1, c2, c3);
- if(v4) {
+ if (v4) {
c4= testclip(ho4);
zbufclip(&zspan, i, zvlnr+RE_QUAD_OFFS, ho1, ho3, ho4, c1, c3, c4);
}
@@ -2659,13 +2665,13 @@ static void zbuf_fill_in_rgba(ZSpan *zspan, DrawBufPixel *col, float *v1, float
zbuf_add_to_span(zspan, v4, v1);
/* clipped */
- if(zspan->minp2==NULL || zspan->maxp2==NULL) return;
+ if (zspan->minp2==NULL || zspan->maxp2==NULL) return;
- if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
- if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
+ if (zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
+ if (zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
// printf("my %d %d\n", my0, my2);
- if(my2<my0) return;
+ if (my2<my0) return;
/* ZBUF DX DY, in floats still */
x1= v1[0]- v2[0];
@@ -2678,7 +2684,7 @@ static void zbuf_fill_in_rgba(ZSpan *zspan, DrawBufPixel *col, float *v1, float
y0= z1*x2-x1*z2;
z0= x1*y2-y1*x2;
- if(z0==0.0f) return;
+ if (z0==0.0f) return;
xx1= (x0*v1[0] + y0*v1[1])/z0 + v1[2];
@@ -2693,7 +2699,7 @@ static void zbuf_fill_in_rgba(ZSpan *zspan, DrawBufPixel *col, float *v1, float
/* correct span */
sn1= (my0 + my2)/2;
- if(zspan->span1[sn1] < zspan->span2[sn1]) {
+ if (zspan->span1[sn1] < zspan->span2[sn1]) {
span1= zspan->span1+my2;
span2= zspan->span2+my2;
}
@@ -2702,23 +2708,23 @@ static void zbuf_fill_in_rgba(ZSpan *zspan, DrawBufPixel *col, float *v1, float
span2= zspan->span1+my2;
}
- for(y=my2; y>=my0; y--, span1--, span2--) {
+ for (y=my2; y>=my0; y--, span1--, span2--) {
sn1= floor(*span1);
sn2= floor(*span2);
sn1++;
- if(sn2>=rectx) sn2= rectx-1;
- if(sn1<0) sn1= 0;
+ if (sn2>=rectx) sn2= rectx-1;
+ if (sn1<0) sn1= 0;
- if(sn2>=sn1) {
+ if (sn2>=sn1) {
zverg= (double)sn1*zxd + zy0;
rz= rectzofs+sn1;
rp= rectpofs+sn1;
x= sn2-sn1;
- while(x>=0) {
- if( zverg < *rz) {
+ while (x>=0) {
+ if ( zverg < *rz) {
*rz= zverg;
*rp= *col;
}
@@ -2736,7 +2742,7 @@ static void zbuf_fill_in_rgba(ZSpan *zspan, DrawBufPixel *col, float *v1, float
}
/* char value==255 is filled in, rest should be zero */
-/* returns alpha values, but sets alpha to 1 for zero alpha pixels that have an alpha value as neighbour */
+/* returns alpha values, but sets alpha to 1 for zero alpha pixels that have an alpha value as neighbor */
void antialias_tagbuf(int xsize, int ysize, char *rectmove)
{
char *row1, *row2, *row3;
@@ -2744,14 +2750,14 @@ void antialias_tagbuf(int xsize, int ysize, char *rectmove)
int a, x, y, step;
/* 1: tag pixels to be candidate for AA */
- for(y=2; y<ysize; y++) {
+ for (y=2; y<ysize; y++) {
/* setup rows */
row1= rectmove + (y-2)*xsize;
row2= row1 + xsize;
row3= row2 + xsize;
- for(x=2; x<xsize; x++, row1++, row2++, row3++) {
- if(row2[1]) {
- if(row2[0]==0 || row2[2]==0 || row1[1]==0 || row3[1]==0)
+ for (x=2; x<xsize; x++, row1++, row2++, row3++) {
+ if (row2[1]) {
+ if (row2[0]==0 || row2[2]==0 || row1[1]==0 || row3[1]==0)
row2[1]= 128;
}
}
@@ -2759,22 +2765,22 @@ void antialias_tagbuf(int xsize, int ysize, char *rectmove)
/* 2: evaluate horizontal scanlines and calculate alphas */
row1= rectmove;
- for(y=0; y<ysize; y++) {
+ for (y=0; y<ysize; y++) {
row1++;
- for(x=1; x<xsize; x++, row1++) {
- if(row1[0]==128 && row1[1]==128) {
+ for (x=1; x<xsize; x++, row1++) {
+ if (row1[0]==128 && row1[1]==128) {
/* find previous color and next color and amount of steps to blend */
prev= row1[-1];
step= 1;
- while(x+step<xsize && row1[step]==128)
+ while (x+step<xsize && row1[step]==128)
step++;
- if(x+step!=xsize) {
+ if (x+step!=xsize) {
/* now we can blend values */
next= row1[step];
/* note, prev value can be next value, but we do this loop to clear 128 then */
- for(a=0; a<step; a++) {
+ for (a=0; a<step; a++) {
int fac, mfac;
fac= ((a+1)<<8)/(step+1);
@@ -2789,22 +2795,22 @@ void antialias_tagbuf(int xsize, int ysize, char *rectmove)
/* 3: evaluate vertical scanlines and calculate alphas */
/* use for reading a copy of the original tagged buffer */
- for(x=0; x<xsize; x++) {
+ for (x=0; x<xsize; x++) {
row1= rectmove + x+xsize;
- for(y=1; y<ysize; y++, row1+=xsize) {
- if(row1[0]==128 && row1[xsize]==128) {
+ for (y=1; y<ysize; y++, row1+=xsize) {
+ if (row1[0]==128 && row1[xsize]==128) {
/* find previous color and next color and amount of steps to blend */
prev= row1[-xsize];
step= 1;
- while(y+step<ysize && row1[step*xsize]==128)
+ while (y+step<ysize && row1[step*xsize]==128)
step++;
- if(y+step!=ysize) {
+ if (y+step!=ysize) {
/* now we can blend values */
next= row1[step*xsize];
/* note, prev value can be next value, but we do this loop to clear 128 then */
- for(a=0; a<step; a++) {
+ for (a=0; a<step; a++) {
int fac, mfac;
fac= ((a+1)<<8)/(step+1);
@@ -2818,14 +2824,14 @@ void antialias_tagbuf(int xsize, int ysize, char *rectmove)
}
/* last: pixels with 0 we fill in zbuffer, with 1 we skip for mask */
- for(y=2; y<ysize; y++) {
+ for (y=2; y<ysize; y++) {
/* setup rows */
row1= rectmove + (y-2)*xsize;
row2= row1 + xsize;
row3= row2 + xsize;
- for(x=2; x<xsize; x++, row1++, row2++, row3++) {
- if(row2[1]==0) {
- if(row2[0]>1 || row2[2]>1 || row1[1]>1 || row3[1]>1)
+ for (x=2; x<xsize; x++, row1++, row2++, row3++) {
+ if (row2[1]==0) {
+ if (row2[0]>1 || row2[2]>1 || row1[1]>1 || row3[1]>1)
row2[1]= 1;
}
}
@@ -2896,16 +2902,16 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
/* debug... check if PASS_VECTOR_MAX still is in buffers */
dvec1= vecbufrect;
- for(x= 4*xsize*ysize; x>0; x--, dvec1++) {
- if(dvec1[0]==PASS_VECTOR_MAX) {
+ for (x= 4*xsize*ysize; x>0; x--, dvec1++) {
+ if (dvec1[0]==PASS_VECTOR_MAX) {
dvec1[0]= 0.0f;
tsktsk= 1;
}
}
- if(tsktsk) printf("Found uninitialized speed in vector buffer... fixed.\n");
+ if (tsktsk) printf("Found uninitialized speed in vector buffer... fixed.\n");
/* min speed? then copy speedbuffer to recalculate speed vectors */
- if(nbd->minspeed) {
+ if (nbd->minspeed) {
float minspeed= (float)nbd->minspeed;
float minspeedsq= minspeed*minspeed;
@@ -2913,14 +2919,14 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
dvec1= vecbufrect;
dvec2= minvecbufrect;
- for(x= 2*xsize*ysize; x>0; x--, dvec1+=2, dvec2+=2) {
- if(dvec1[0]==0.0f && dvec1[1]==0.0f) {
+ for (x= 2*xsize*ysize; x>0; x--, dvec1+=2, dvec2+=2) {
+ if (dvec1[0]==0.0f && dvec1[1]==0.0f) {
dvec2[0]= dvec1[0];
dvec2[1]= dvec1[1];
}
else {
float speedsq= dvec1[0]*dvec1[0] + dvec1[1]*dvec1[1];
- if(speedsq <= minspeedsq) {
+ if (speedsq <= minspeedsq) {
dvec2[0]= 0.0f;
dvec2[1]= 0.0f;
}
@@ -2937,70 +2943,70 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
/* make vertex buffer with averaged speed and zvalues */
rectvz= MEM_mapallocN(4*sizeof(float)*(xsize+1)*(ysize+1), "vertices");
dvz= rectvz;
- for(y=0; y<=ysize; y++) {
+ for (y=0; y<=ysize; y++) {
- if(y==0)
+ if (y==0)
dvec1= vecbufrect + 4*y*xsize;
else
dvec1= vecbufrect + 4*(y-1)*xsize;
- if(y==ysize)
+ if (y==ysize)
dvec2= vecbufrect + 4*(y-1)*xsize;
else
dvec2= vecbufrect + 4*y*xsize;
- for(x=0; x<=xsize; x++) {
+ for (x=0; x<=xsize; x++) {
/* two vectors, so a step loop */
- for(step=0; step<2; step++, dvec1+=2, dvec2+=2, dvz+=2) {
+ for (step=0; step<2; step++, dvec1+=2, dvec2+=2, dvz+=2) {
/* average on minimal speed */
int div= 0;
- if(x!=0) {
- if(dvec1[-4]!=0.0f || dvec1[-3]!=0.0f) {
+ if (x!=0) {
+ if (dvec1[-4]!=0.0f || dvec1[-3]!=0.0f) {
dvz[0]= dvec1[-4];
dvz[1]= dvec1[-3];
div++;
}
- if(dvec2[-4]!=0.0f || dvec2[-3]!=0.0f) {
- if(div==0) {
+ if (dvec2[-4]!=0.0f || dvec2[-3]!=0.0f) {
+ if (div==0) {
dvz[0]= dvec2[-4];
dvz[1]= dvec2[-3];
div++;
}
- else if( (ABS(dvec2[-4]) + ABS(dvec2[-3]))< (ABS(dvz[0]) + ABS(dvz[1])) ) {
+ else if ( (ABS(dvec2[-4]) + ABS(dvec2[-3]))< (ABS(dvz[0]) + ABS(dvz[1])) ) {
dvz[0]= dvec2[-4];
dvz[1]= dvec2[-3];
}
}
}
- if(x!=xsize) {
- if(dvec1[0]!=0.0f || dvec1[1]!=0.0f) {
- if(div==0) {
+ if (x!=xsize) {
+ if (dvec1[0]!=0.0f || dvec1[1]!=0.0f) {
+ if (div==0) {
dvz[0]= dvec1[0];
dvz[1]= dvec1[1];
div++;
}
- else if( (ABS(dvec1[0]) + ABS(dvec1[1]))< (ABS(dvz[0]) + ABS(dvz[1])) ) {
+ else if ( (ABS(dvec1[0]) + ABS(dvec1[1]))< (ABS(dvz[0]) + ABS(dvz[1])) ) {
dvz[0]= dvec1[0];
dvz[1]= dvec1[1];
}
}
- if(dvec2[0]!=0.0f || dvec2[1]!=0.0f) {
- if(div==0) {
+ if (dvec2[0]!=0.0f || dvec2[1]!=0.0f) {
+ if (div==0) {
dvz[0]= dvec2[0];
dvz[1]= dvec2[1];
}
- else if( (ABS(dvec2[0]) + ABS(dvec2[1]))< (ABS(dvz[0]) + ABS(dvz[1])) ) {
+ else if ( (ABS(dvec2[0]) + ABS(dvec2[1]))< (ABS(dvz[0]) + ABS(dvz[1])) ) {
dvz[0]= dvec2[0];
dvz[1]= dvec2[1];
}
}
}
- if(maxspeed) {
+ if (maxspeed) {
float speedsq= dvz[0]*dvz[0] + dvz[1]*dvz[1];
- if(speedsq > maxspeedsq) {
+ if (speedsq > maxspeedsq) {
speedsq= (float)maxspeed/sqrt(speedsq);
dvz[0]*= speedsq;
dvz[1]*= speedsq;
@@ -3013,7 +3019,7 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
/* set border speeds to keep border speeds on border */
dz1= rectvz;
dz2= rectvz+4*(ysize)*(xsize+1);
- for(x=0; x<=xsize; x++, dz1+=4, dz2+=4) {
+ for (x=0; x<=xsize; x++, dz1+=4, dz2+=4) {
dz1[1]= 0.0f;
dz2[1]= 0.0f;
dz1[3]= 0.0f;
@@ -3021,7 +3027,7 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
}
dz1= rectvz;
dz2= rectvz+4*(xsize);
- for(y=0; y<=ysize; y++, dz1+=4*(xsize+1), dz2+=4*(xsize+1)) {
+ for (y=0; y<=ysize; y++, dz1+=4*(xsize+1), dz2+=4*(xsize+1)) {
dz1[0]= 0.0f;
dz2[0]= 0.0f;
dz1[2]= 0.0f;
@@ -3031,15 +3037,15 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
/* tag moving pixels, only these faces we draw */
dm= rectmove;
dvec1= vecbufrect;
- for(x=xsize*ysize; x>0; x--, dm++, dvec1+=4) {
- if((dvec1[0]!=0.0f || dvec1[1]!=0.0f || dvec1[2]!=0.0f || dvec1[3]!=0.0f))
+ for (x=xsize*ysize; x>0; x--, dm++, dvec1+=4) {
+ if ((dvec1[0]!=0.0f || dvec1[1]!=0.0f || dvec1[2]!=0.0f || dvec1[3]!=0.0f))
*dm= 255;
}
antialias_tagbuf(xsize, ysize, rectmove);
/* has to become static, the init-jit calls a random-seed, screwing up texture noise node */
- if(firsttime) {
+ if (firsttime) {
firsttime= 0;
BLI_initjit(jit[0], 256);
}
@@ -3048,26 +3054,26 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
/* accumulate */
samples/= 2;
- for(step= 1; step<=samples; step++) {
+ for (step= 1; step<=samples; step++) {
float speedfac= 0.5f*nbd->fac*(float)step/(float)(samples+1);
int side;
- for(side=0; side<2; side++) {
+ for (side=0; side<2; side++) {
float blendfac, ipodata[4];
/* clear zbuf, if we draw future we fill in not moving pixels */
- if(0)
- for(x= xsize*ysize-1; x>=0; x--) rectz[x]= 10e16;
+ if (0)
+ for (x= xsize*ysize-1; x>=0; x--) rectz[x]= 10e16;
else
- for(x= xsize*ysize-1; x>=0; x--) {
- if(rectmove[x]==0)
+ for (x= xsize*ysize-1; x>=0; x--) {
+ if (rectmove[x]==0)
rectz[x]= zbufrect[x];
else
rectz[x]= 10e16;
}
/* clear drawing buffer */
- for(x= xsize*ysize-1; x>=0; x--) rectdraw[x].colpoin= NULL;
+ for (x= xsize*ysize-1; x>=0; x--) rectdraw[x].colpoin= NULL;
dimg= imgrect;
dm= rectmove;
@@ -3075,8 +3081,8 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
dz1= rectvz;
dz2= rectvz + 4*(xsize + 1);
- if(side) {
- if(nbd->curved==0) {
+ if (side) {
+ if (nbd->curved==0) {
dz1+= 2;
dz2+= 2;
}
@@ -3085,15 +3091,15 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
set_quad_bezier_ipo(0.5f + 0.5f*speedfac, ipodata);
- for(fy= -0.5f+jit[step & 255][0], y=0; y<ysize; y++, fy+=1.0f) {
- for(fx= -0.5f+jit[step & 255][1], x=0; x<xsize; x++, fx+=1.0f, dimg+=4, dz1+=4, dz2+=4, dm++, dz++) {
- if(*dm>1) {
+ for (fy= -0.5f+jit[step & 255][0], y=0; y<ysize; y++, fy+=1.0f) {
+ for (fx= -0.5f+jit[step & 255][1], x=0; x<xsize; x++, fx+=1.0f, dimg+=4, dz1+=4, dz2+=4, dm++, dz++) {
+ if (*dm>1) {
float jfx = fx + 0.5f;
float jfy = fy + 0.5f;
DrawBufPixel col;
/* make vertices */
- if(nbd->curved) { /* curved */
+ if (nbd->curved) { /* curved */
quad_bezier_2d(v1, dz1, dz1+2, ipodata);
v1[0]+= jfx; v1[1]+= jfy; v1[2]= *dz;
@@ -3112,8 +3118,8 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
v3[0]= speedfac*dz2[4]+jfx+1.0f; v3[1]= speedfac*dz2[5]+jfy+1.0f; v3[2]= *dz;
v4[0]= speedfac*dz2[0]+jfx; v4[1]= speedfac*dz2[1]+jfy+1.0f; v4[2]= *dz;
}
- if(*dm==255) col.alpha= 1.0f;
- else if(*dm<2) col.alpha= 0.0f;
+ if (*dm==255) col.alpha= 1.0f;
+ else if (*dm<2) col.alpha= 0.0f;
else col.alpha= ((float)*dm)/255.0f;
col.colpoin= dimg;
@@ -3138,8 +3144,8 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
/* accum */
rw= rectweight;
rm= rectmax;
- for(dr= rectdraw, dz2=newrect, x= xsize*ysize-1; x>=0; x--, dr++, dz2+=4, rw++, rm++) {
- if(dr->colpoin) {
+ for (dr= rectdraw, dz2=newrect, x= xsize*ysize-1; x>=0; x--, dr++, dz2+=4, rw++, rm++) {
+ if (dr->colpoin) {
float bfac= dr->alpha*blendfac;
dz2[0] += bfac*dr->colpoin[0];
@@ -3159,7 +3165,7 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
rm= rectmax;
ro= imgrect;
dm= rectmove;
- for(dz2=newrect, x= xsize*ysize-1; x>=0; x--, dz2+=4, ro+=4, rw++, rm++, dm++) {
+ for (dz2=newrect, x= xsize*ysize-1; x>=0; x--, dz2+=4, ro+=4, rw++, rm++, dm++) {
float mfac = *rm;
float fac = (*rw == 0.0f)? 0.0f: mfac/(*rw);
float nfac = 1.0f - mfac;
@@ -3176,7 +3182,7 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
MEM_freeN(rectvz);
MEM_freeN(rectweight);
MEM_freeN(rectmax);
- if(minvecbufrect) MEM_freeN(vecbufrect); /* rects were swapped! */
+ if (minvecbufrect) MEM_freeN(vecbufrect); /* rects were swapped! */
zbuf_free_span(&zspan);
}
@@ -3192,18 +3198,18 @@ static void copyto_abufz(RenderPart *pa, int *arectz, int *rectmask, int sample)
int x, y, *rza, *rma;
intptr_t *rd;
- if(R.osa==0) {
- if(!pa->rectz)
+ if (R.osa==0) {
+ if (!pa->rectz)
fillrect(arectz, pa->rectx, pa->recty, 0x7FFFFFFE);
else
memcpy(arectz, pa->rectz, sizeof(int)*pa->rectx*pa->recty);
- if(rectmask && pa->rectmask)
+ if (rectmask && pa->rectmask)
memcpy(rectmask, pa->rectmask, sizeof(int)*pa->rectx*pa->recty);
return;
}
- else if(!pa->rectdaps) {
+ else if (!pa->rectdaps) {
fillrect(arectz, pa->rectx, pa->recty, 0x7FFFFFFE);
return;
}
@@ -3214,17 +3220,17 @@ static void copyto_abufz(RenderPart *pa, int *arectz, int *rectmask, int sample)
sample= (1<<sample);
- for(y=0; y<pa->recty; y++) {
- for(x=0; x<pa->rectx; x++) {
+ for (y=0; y<pa->recty; y++) {
+ for (x=0; x<pa->rectx; x++) {
*rza= 0x7FFFFFFF;
- if(rectmask) *rma= 0x7FFFFFFF;
- if(*rd) {
+ if (rectmask) *rma= 0x7FFFFFFF;
+ if (*rd) {
/* when there's a sky pixstruct, fill in sky-Z, otherwise solid Z */
- for(ps= (PixStr *)(*rd); ps; ps= ps->next) {
- if(sample & ps->mask) {
+ for (ps= (PixStr *)(*rd); ps; ps= ps->next) {
+ if (sample & ps->mask) {
*rza= ps->z;
- if(rectmask) *rma= ps->maskz;
+ if (rectmask) *rma= ps->maskz;
break;
}
}
@@ -3258,7 +3264,7 @@ static int zbuffer_abuf(Render *re, RenderPart *pa, APixstr *APixbuf, ListBase *
zbuffer_part_bounds(winx, winy, pa, bounds);
- for(zsample=0; zsample<samples; zsample++) {
+ for (zsample=0; zsample<samples; zsample++) {
zspan= &zspans[zsample];
zbuf_alloc_span(zspan, pa->rectx, pa->recty, re->clipcrop);
@@ -3272,7 +3278,7 @@ static int zbuffer_abuf(Render *re, RenderPart *pa, APixstr *APixbuf, ListBase *
zspan->apixbuf= APixbuf;
zspan->apsmbase= apsmbase;
- if(negzmask)
+ if (negzmask)
zspan->rectmask= MEM_mallocN(sizeof(int)*pa->rectx*pa->recty, "Arectmask");
/* filling methods */
@@ -3282,7 +3288,7 @@ static int zbuffer_abuf(Render *re, RenderPart *pa, APixstr *APixbuf, ListBase *
copyto_abufz(pa, zspan->arectz, zspan->rectmask, zsample); /* init zbuffer */
zspan->mask= 1<<zsample;
- if(jit) {
+ if (jit) {
zspan->zofsx= -pa->disprect.xmin - jit[zsample][0];
zspan->zofsy= -pa->disprect.ymin - jit[zsample][1];
}
@@ -3299,37 +3305,37 @@ static int zbuffer_abuf(Render *re, RenderPart *pa, APixstr *APixbuf, ListBase *
/* we use this to test if nothing was filled in */
zvlnr= 0;
- for(i=0, obi=re->instancetable.first; obi; i++, obi=obi->next) {
+ for (i=0, obi=re->instancetable.first; obi; i++, obi=obi->next) {
obr= obi->obr;
- if(!(obi->lay & lay))
+ if (!(obi->lay & lay))
continue;
- if(obi->flag & R_TRANSFORMED)
+ if (obi->flag & R_TRANSFORMED)
mult_m4_m4m4(obwinmat, winmat, obi->mat);
else
copy_m4_m4(obwinmat, winmat);
- if(clip_render_object(obi->obr->boundbox, bounds, obwinmat))
+ if (clip_render_object(obi->obr->boundbox, bounds, obwinmat))
continue;
zbuf_project_cache_clear(cache, obr->totvert);
- for(v=0; v<obr->totvlak; v++) {
- if((v & 255)==0)
+ for (v=0; v<obr->totvlak; v++) {
+ if ((v & 255)==0)
vlr= obr->vlaknodes[v>>8].vlak;
else vlr++;
- if(vlr->mat!=ma) {
+ if (vlr->mat!=ma) {
ma= vlr->mat;
- if(shadow)
+ if (shadow)
dofill= (ma->mode & MA_SHADBUF);
else
dofill= (((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP)) && !(ma->mode & MA_ONLYCAST));
}
- if(dofill) {
- if(!(vlr->flag & R_HIDDEN) && (obi->lay & lay)) {
+ if (dofill) {
+ if (!(vlr->flag & R_HIDDEN) && (obi->lay & lay)) {
unsigned short partclip;
v1= vlr->v1;
@@ -3343,14 +3349,14 @@ static int zbuffer_abuf(Render *re, RenderPart *pa, APixstr *APixbuf, ListBase *
/* partclipping doesn't need viewplane clipping */
partclip= c1 & c2 & c3;
- if(v4) {
+ if (v4) {
c4= zbuf_part_project(cache, v4->index, obwinmat, bounds, v4->co, ho4);
partclip &= c4;
}
- if(partclip==0) {
+ if (partclip==0) {
/* a little advantage for transp rendering (a z offset) */
- if(!shadow && ma->zoffs != 0.0f) {
+ if (!shadow && ma->zoffs != 0.0f) {
mul= 0x7FFFFFFF;
zval= mul*(1.0f+ho1[2]/ho1[3]);
@@ -3369,45 +3375,45 @@ static int zbuffer_abuf(Render *re, RenderPart *pa, APixstr *APixbuf, ListBase *
c1= testclip(ho1);
c2= testclip(ho2);
c3= testclip(ho3);
- if(v4)
+ if (v4)
c4= testclip(ho4);
- for(zsample=0; zsample<samples; zsample++) {
+ for (zsample=0; zsample<samples; zsample++) {
zspan= &zspans[zsample];
zspan->polygon_offset= polygon_offset;
- if(ma->material_type == MA_TYPE_WIRE) {
- if(v4)
+ if (ma->material_type == MA_TYPE_WIRE) {
+ if (v4)
zbufclipwire(zspan, i, zvlnr, vlr->ec, ho1, ho2, ho3, ho4, c1, c2, c3, c4);
else
zbufclipwire(zspan, i, zvlnr, vlr->ec, ho1, ho2, ho3, 0, c1, c2, c3, 0);
}
else {
- if(v4 && (vlr->flag & R_STRAND)) {
+ if (v4 && (vlr->flag & R_STRAND)) {
zbufclip4(zspan, i, zvlnr, ho1, ho2, ho3, ho4, c1, c2, c3, c4);
}
else {
zbufclip(zspan, i, zvlnr, ho1, ho2, ho3, c1, c2, c3);
- if(v4)
+ if (v4)
zbufclip(zspan, i, zvlnr+RE_QUAD_OFFS, ho1, ho3, ho4, c1, c3, c4);
}
}
}
}
- if((v & 255)==255)
- if(re->test_break(re->tbh))
+ if ((v & 255)==255)
+ if (re->test_break(re->tbh))
break;
}
}
}
- if(re->test_break(re->tbh)) break;
+ if (re->test_break(re->tbh)) break;
}
- for(zsample=0; zsample<samples; zsample++) {
+ for (zsample=0; zsample<samples; zsample++) {
zspan= &zspans[zsample];
MEM_freeN(zspan->arectz);
- if(zspan->rectmask)
+ if (zspan->rectmask)
MEM_freeN(zspan->rectmask);
zbuf_free_span(zspan);
}
@@ -3423,18 +3429,18 @@ static int zbuffer_abuf_render(RenderPart *pa, APixstr *APixbuf, APixstrand *APi
samples= (R.osa)? R.osa: 1;
negzmask= ((rl->layflag & SCE_LAY_ZMASK) && (rl->layflag & SCE_LAY_NEG_ZMASK));
- if(R.osa)
+ if (R.osa)
jit= R.jit;
- else if(R.i.curblur)
+ else if (R.i.curblur)
jit= &R.mblur_jit[R.i.curblur-1];
else
jit= NULL;
zbuf_make_winmat(&R, winmat);
- if(rl->layflag & SCE_LAY_ZTRA)
+ if (rl->layflag & SCE_LAY_ZTRA)
doztra+= zbuffer_abuf(&R, pa, APixbuf, apsmbase, rl->lay, negzmask, winmat, R.winx, R.winy, samples, jit, R.clipcrop, 0);
- if((rl->layflag & SCE_LAY_STRAND) && APixbufstrand)
+ if ((rl->layflag & SCE_LAY_STRAND) && APixbufstrand)
doztra+= zbuffer_strands_abuf(&R, pa, APixbufstrand, apsmbase, rl->lay, negzmask, winmat, R.winx, R.winy, samples, jit, R.clipcrop, 0, sscache);
return doztra;
@@ -3445,18 +3451,18 @@ void zbuffer_abuf_shadow(Render *re, LampRen *lar, float winmat[][4], APixstr *A
RenderPart pa;
int lay= -1;
- if(lar->mode & LA_LAYER) lay= lar->lay;
+ if (lar->mode & LA_LAYER) lay= lar->lay;
memset(&pa, 0, sizeof(RenderPart));
pa.rectx= size;
pa.recty= size;
- pa.disprect.xmin= 0;
- pa.disprect.ymin= 0;
- pa.disprect.xmax= size;
- pa.disprect.ymax= size;
+ pa.disprect.xmin = 0;
+ pa.disprect.ymin = 0;
+ pa.disprect.xmax = size;
+ pa.disprect.ymax = size;
zbuffer_abuf(re, &pa, APixbuf, apsmbase, lay, 0, winmat, size, size, samples, jit, 1.0f, 1);
- if(APixbufstrand)
+ if (APixbufstrand)
zbuffer_strands_abuf(re, &pa, APixbufstrand, apsmbase, lay, 0, winmat, size, size, samples, jit, 1.0f, 1, NULL);
}
@@ -3468,27 +3474,27 @@ void add_transp_speed(RenderLayer *rl, int offset, float *speed, float alpha, in
{
RenderPass *rpass;
- for(rpass= rl->passes.first; rpass; rpass= rpass->next) {
- if(rpass->passtype==SCE_PASS_VECTOR) {
+ for (rpass= rl->passes.first; rpass; rpass= rpass->next) {
+ if (rpass->passtype==SCE_PASS_VECTOR) {
float *fp= rpass->rect + 4*offset;
- if(speed==NULL) {
+ if (speed==NULL) {
/* clear */
- if(fp[0]==PASS_VECTOR_MAX) fp[0]= 0.0f;
- if(fp[1]==PASS_VECTOR_MAX) fp[1]= 0.0f;
- if(fp[2]==PASS_VECTOR_MAX) fp[2]= 0.0f;
- if(fp[3]==PASS_VECTOR_MAX) fp[3]= 0.0f;
+ if (fp[0]==PASS_VECTOR_MAX) fp[0]= 0.0f;
+ if (fp[1]==PASS_VECTOR_MAX) fp[1]= 0.0f;
+ if (fp[2]==PASS_VECTOR_MAX) fp[2]= 0.0f;
+ if (fp[3]==PASS_VECTOR_MAX) fp[3]= 0.0f;
}
- else if(rdrect==NULL || rdrect[offset]==0 || alpha>0.95f) {
+ else if (rdrect==NULL || rdrect[offset]==0 || alpha>0.95f) {
copy_v4_v4(fp, speed);
}
else {
/* add minimum speed in pixel */
- if( (ABS(speed[0]) + ABS(speed[1]))< (ABS(fp[0]) + ABS(fp[1])) ) {
+ if ( (ABS(speed[0]) + ABS(speed[1]))< (ABS(fp[0]) + ABS(fp[1])) ) {
fp[0]= speed[0];
fp[1]= speed[1];
}
- if( (ABS(speed[2]) + ABS(speed[3]))< (ABS(fp[2]) + ABS(fp[3])) ) {
+ if ( (ABS(speed[2]) + ABS(speed[3]))< (ABS(fp[2]) + ABS(fp[3])) ) {
fp[2]= speed[2];
fp[3]= speed[3];
}
@@ -3502,8 +3508,8 @@ static void add_transp_obindex(RenderLayer *rl, int offset, Object *ob)
{
RenderPass *rpass;
- for(rpass= rl->passes.first; rpass; rpass= rpass->next) {
- if(rpass->passtype == SCE_PASS_INDEXOB||rpass->passtype == SCE_PASS_INDEXMA) {
+ for (rpass= rl->passes.first; rpass; rpass= rpass->next) {
+ if (rpass->passtype == SCE_PASS_INDEXOB||rpass->passtype == SCE_PASS_INDEXMA) {
float *fp= rpass->rect + offset;
*fp= (float)ob->index;
break;
@@ -3519,7 +3525,7 @@ void merge_transp_passes(RenderLayer *rl, ShadeResult *shr)
float weight= 1.0f/((float)R.osa);
int delta= sizeof(ShadeResult)/4;
- for(rpass= rl->passes.first; rpass; rpass= rpass->next) {
+ for (rpass= rl->passes.first; rpass; rpass= rpass->next) {
float *col= NULL;
int pixsize= 3;
@@ -3574,16 +3580,16 @@ void merge_transp_passes(RenderLayer *rl, ShadeResult *shr)
int samp;
/* add minimum speed in pixel */
- for(samp= 1; samp<R.osa; samp++, shr_t++) {
+ for (samp= 1; samp<R.osa; samp++, shr_t++) {
- if(shr_t->combined[3] > 0.0f) {
+ if (shr_t->combined[3] > 0.0f) {
float *speed= shr_t->winspeed;
- if( (ABS(speed[0]) + ABS(speed[1]))< (ABS(fp[0]) + ABS(fp[1])) ) {
+ if ( (ABS(speed[0]) + ABS(speed[1]))< (ABS(fp[0]) + ABS(fp[1])) ) {
fp[0]= speed[0];
fp[1]= speed[1];
}
- if( (ABS(speed[2]) + ABS(speed[3]))< (ABS(fp[2]) + ABS(fp[3])) ) {
+ if ( (ABS(speed[2]) + ABS(speed[3]))< (ABS(fp[2]) + ABS(fp[3])) ) {
fp[2]= speed[2];
fp[3]= speed[3];
}
@@ -3592,23 +3598,23 @@ void merge_transp_passes(RenderLayer *rl, ShadeResult *shr)
}
break;
}
- if(col) {
+ if (col) {
float *fp= col+delta;
int samp;
- for(samp= 1; samp<R.osa; samp++, fp+=delta) {
+ for (samp= 1; samp<R.osa; samp++, fp+=delta) {
col[0]+= fp[0];
- if(pixsize>1) {
+ if (pixsize>1) {
col[1]+= fp[1];
col[2]+= fp[2];
- if(pixsize==4) col[3]+= fp[3];
+ if (pixsize==4) col[3]+= fp[3];
}
}
col[0]*= weight;
- if(pixsize>1) {
+ if (pixsize>1) {
col[1]*= weight;
col[2]*= weight;
- if(pixsize==4) col[3]*= weight;
+ if (pixsize==4) col[3]*= weight;
}
}
}
@@ -3619,14 +3625,14 @@ void add_transp_passes(RenderLayer *rl, int offset, ShadeResult *shr, float alph
{
RenderPass *rpass;
- for(rpass= rl->passes.first; rpass; rpass= rpass->next) {
+ for (rpass= rl->passes.first; rpass; rpass= rpass->next) {
float *fp, *col= NULL;
int pixsize= 3;
switch(rpass->passtype) {
case SCE_PASS_Z:
fp= rpass->rect + offset;
- if(shr->z < *fp)
+ if (shr->z < *fp)
*fp= shr->z;
break;
case SCE_PASS_RGBA:
@@ -3668,11 +3674,11 @@ void add_transp_passes(RenderLayer *rl, int offset, ShadeResult *shr, float alph
pixsize= 1;
break;
}
- if(col) {
+ if (col) {
fp= rpass->rect + pixsize*offset;
fp[0]= col[0] + (1.0f-alpha)*fp[0];
- if(pixsize==3) {
+ if (pixsize==3) {
fp[1]= col[1] + (1.0f-alpha)*fp[1];
fp[2]= col[2] + (1.0f-alpha)*fp[2];
}
@@ -3693,8 +3699,8 @@ static int vergzvlak(const void *a1, const void *a2)
{
const ZTranspRow *r1 = a1, *r2 = a2;
- if(r1->z < r2->z) return 1;
- else if(r1->z > r2->z) return -1;
+ if (r1->z < r2->z) return 1;
+ else if (r1->z > r2->z) return -1;
return 0;
}
@@ -3733,10 +3739,10 @@ static void unref_strand_samples(StrandShadeCache *cache, ZTranspRow *row, int t
/* remove references to samples that are not being rendered, but we still
* need to remove them so that the reference count of strand vertex shade
* samples correctly drops to zero */
- while(totface > 0) {
+ while (totface > 0) {
totface--;
- if(row[totface].segment != -1) {
+ if (row[totface].segment != -1) {
obi= R.objectinstance + row[totface].obi;
obr= obi->obr;
strand= RE_findOrAddStrand(obr, row[totface].p-1);
@@ -3758,18 +3764,18 @@ static void shade_tra_samples_fill(ShadeSample *ssamp, int x, int y, int z, int
shade_input_set_triangle(shi, obi, facenr, 1);
/* officially should always be true... we have no sky info */
- if(shi->vlr) {
+ if (shi->vlr) {
/* full osa is only set for OSA renders */
- if(shi->vlr->flag & R_FULL_OSA) {
+ if (shi->vlr->flag & R_FULL_OSA) {
short shi_inc= 0, samp;
- for(samp=0; samp<R.osa; samp++) {
- if(curmask & (1<<samp)) {
+ for (samp=0; samp<R.osa; samp++) {
+ if (curmask & (1<<samp)) {
xs= (float)x + R.jit[samp][0] + 0.5f; /* zbuffer has this inverse corrected, ensures xs,ys are inside pixel */
ys= (float)y + R.jit[samp][1] + 0.5f;
- if(shi_inc) {
+ if (shi_inc) {
shade_input_copy_triangle(shi+1, shi);
shi++;
}
@@ -3777,7 +3783,7 @@ static void shade_tra_samples_fill(ShadeSample *ssamp, int x, int y, int z, int
shi->samplenr= R.shadowsamplenr[shi->thread]++;
shade_input_set_viewco(shi, x, y, xs, ys, (float)z);
shade_input_set_uv(shi);
- if(shi_inc==0)
+ if (shi_inc==0)
shade_input_set_normals(shi);
else /* XXX shi->flippednor messes up otherwise */
shade_input_set_vertex_normals(shi);
@@ -3787,7 +3793,7 @@ static void shade_tra_samples_fill(ShadeSample *ssamp, int x, int y, int z, int
}
}
else {
- if(R.osa) {
+ if (R.osa) {
short b= R.samples->centmask[curmask];
xs= (float)x + R.samples->centLut[b & 15] + 0.5f;
ys= (float)y + R.samples->centLut[b>>4] + 0.5f;
@@ -3810,14 +3816,14 @@ static void shade_tra_samples_fill(ShadeSample *ssamp, int x, int y, int z, int
static int shade_tra_samples(ShadeSample *ssamp, StrandShadeCache *cache, int x, int y, ZTranspRow *row, int addpassflag)
{
- if(row->segment != -1) {
+ if (row->segment != -1) {
shade_strand_samples(cache, ssamp, x, y, row, addpassflag);
return 1;
}
shade_tra_samples_fill(ssamp, x, y, row->z, row->obi, row->p, row->mask);
- if(ssamp->tot) {
+ if (ssamp->tot) {
ShadeInput *shi= ssamp->shi;
ShadeResult *shr= ssamp->shr;
int samp;
@@ -3826,19 +3832,19 @@ static int shade_tra_samples(ShadeSample *ssamp, StrandShadeCache *cache, int x,
shade_samples_do_AO(ssamp);
/* if shade (all shadepinputs have same passflag) */
- if(shi->passflag & ~(SCE_PASS_Z|SCE_PASS_INDEXOB|SCE_PASS_INDEXMA)) {
- for(samp=0; samp<ssamp->tot; samp++, shi++, shr++) {
+ if (shi->passflag & ~(SCE_PASS_Z|SCE_PASS_INDEXOB|SCE_PASS_INDEXMA)) {
+ for (samp=0; samp<ssamp->tot; samp++, shi++, shr++) {
shade_input_set_shade_texco(shi);
shade_input_do_shade(shi, shr);
/* include lamphalos for ztra, since halo layer was added already */
- if(R.flag & R_LAMPHALO)
- if(shi->layflag & SCE_LAY_HALO)
+ if (R.flag & R_LAMPHALO)
+ if (shi->layflag & SCE_LAY_HALO)
renderspothalo(shi, shr->combined, shr->combined[3]);
}
}
- else if(shi->passflag & SCE_PASS_Z) {
- for(samp=0; samp<ssamp->tot; samp++, shi++, shr++)
+ else if (shi->passflag & SCE_PASS_Z) {
+ for (samp=0; samp<ssamp->tot; samp++, shi++, shr++)
shr->z= -shi->co[2];
}
@@ -3858,66 +3864,66 @@ static int addtosamp_shr(ShadeResult *samp_shr, ShadeSample *ssamp, int addpassf
{
int a, sample, osa = (R.osa? R.osa: 1), retval = osa;
- for(a=0; a < osa; a++, samp_shr++) {
+ for (a=0; a < osa; a++, samp_shr++) {
ShadeInput *shi= ssamp->shi;
ShadeResult *shr= ssamp->shr;
- for(sample=0; sample<ssamp->tot; sample++, shi++, shr++) {
+ for (sample=0; sample<ssamp->tot; sample++, shi++, shr++) {
- if(shi->mask & (1<<a)) {
+ if (shi->mask & (1<<a)) {
float fac= (1.0f - samp_shr->combined[3])*shr->combined[3];
addAlphaUnderFloat(samp_shr->combined, shr->combined);
samp_shr->z= MIN2(samp_shr->z, shr->z);
- if(addpassflag & SCE_PASS_VECTOR) {
+ if (addpassflag & SCE_PASS_VECTOR) {
copy_v4_v4(samp_shr->winspeed, shr->winspeed);
}
/* optim... */
- if(addpassflag & ~(SCE_PASS_VECTOR)) {
+ if (addpassflag & ~(SCE_PASS_VECTOR)) {
- if(addpassflag & SCE_PASS_RGBA)
+ if (addpassflag & SCE_PASS_RGBA)
addAlphaUnderFloat(samp_shr->col, shr->col);
- if(addpassflag & SCE_PASS_NORMAL)
+ if (addpassflag & SCE_PASS_NORMAL)
addvecmul(samp_shr->nor, shr->nor, fac);
- if(addpassflag & SCE_PASS_EMIT)
+ if (addpassflag & SCE_PASS_EMIT)
addvecmul(samp_shr->emit, shr->emit, fac);
- if(addpassflag & SCE_PASS_DIFFUSE)
+ if (addpassflag & SCE_PASS_DIFFUSE)
addvecmul(samp_shr->diff, shr->diff, fac);
- if(addpassflag & SCE_PASS_SPEC)
+ if (addpassflag & SCE_PASS_SPEC)
addvecmul(samp_shr->spec, shr->spec, fac);
- if(addpassflag & SCE_PASS_SHADOW)
+ if (addpassflag & SCE_PASS_SHADOW)
addvecmul(samp_shr->shad, shr->shad, fac);
- if(addpassflag & SCE_PASS_AO)
+ if (addpassflag & SCE_PASS_AO)
addvecmul(samp_shr->ao, shr->ao, fac);
- if(addpassflag & SCE_PASS_ENVIRONMENT)
+ if (addpassflag & SCE_PASS_ENVIRONMENT)
addvecmul(samp_shr->env, shr->env, fac);
- if(addpassflag & SCE_PASS_INDIRECT)
+ if (addpassflag & SCE_PASS_INDIRECT)
addvecmul(samp_shr->indirect, shr->indirect, fac);
- if(addpassflag & SCE_PASS_REFLECT)
+ if (addpassflag & SCE_PASS_REFLECT)
addvecmul(samp_shr->refl, shr->refl, fac);
- if(addpassflag & SCE_PASS_REFRACT)
+ if (addpassflag & SCE_PASS_REFRACT)
addvecmul(samp_shr->refr, shr->refr, fac);
- if(addpassflag & SCE_PASS_MIST)
+ if (addpassflag & SCE_PASS_MIST)
samp_shr->mist= samp_shr->mist+fac*shr->mist;
}
}
}
- if(samp_shr->combined[3]>0.999f) retval--;
+ if (samp_shr->combined[3]>0.999f) retval--;
}
return retval;
}
@@ -3930,11 +3936,11 @@ static void reset_sky_speedvectors(RenderPart *pa, RenderLayer *rl, float *rectf
int a;
fp= RE_RenderLayerGetPass(rl, SCE_PASS_VECTOR);
- if(fp==NULL) return;
+ if (fp==NULL) return;
col= rectf+3;
- for(a= 4*pa->rectx*pa->recty -4; a>=0; a-=4) {
- if(col[a]==0.0f) {
+ for (a= 4*pa->rectx*pa->recty -4; a>=0; a-=4) {
+ if (col[a]==0.0f) {
fp[a]= PASS_VECTOR_MAX;
fp[a+1]= PASS_VECTOR_MAX;
fp[a+2]= PASS_VECTOR_MAX;
@@ -3967,17 +3973,17 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
unsigned short *ztramask= NULL, filled;
/* looks nicer for calling code */
- if(R.test_break(R.tbh))
+ if (R.test_break(R.tbh))
return NULL;
- if(R.osa>16) { /* MAX_OSA */
+ if (R.osa>16) { /* MAX_OSA */
printf("zbuffer_transp_shade: osa too large\n");
G.afbreek= 1;
return NULL;
}
APixbuf= MEM_callocN(pa->rectx*pa->recty*sizeof(APixstr), "APixbuf");
- if(R.totstrand && (rl->layflag & SCE_LAY_STRAND)) {
+ if (R.totstrand && (rl->layflag & SCE_LAY_STRAND)) {
APixbufstrand= MEM_callocN(pa->rectx*pa->recty*sizeof(APixstrand), "APixbufstrand");
sscache= strand_shade_cache_create();
}
@@ -3986,7 +3992,7 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
shade_sample_initialize(&ssamp, pa, rl);
addpassflag= rl->passflag & ~(SCE_PASS_COMBINED);
- if(R.osa)
+ if (R.osa)
sampalpha= 1.0f/(float)R.osa;
else
sampalpha= 1.0f;
@@ -3994,12 +4000,12 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
/* fill the Apixbuf */
doztra= zbuffer_abuf_render(pa, APixbuf, APixbufstrand, &apsmbase, rl, sscache);
- if(doztra == 0) {
+ if (doztra == 0) {
/* nothing filled in */
MEM_freeN(APixbuf);
- if(APixbufstrand)
+ if (APixbufstrand)
MEM_freeN(APixbufstrand);
- if(sscache)
+ if (sscache)
strand_shade_cache_free(sscache);
freepsA(&apsmbase);
return NULL;
@@ -4013,20 +4019,20 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
totfullsample= get_sample_layers(pa, rl, rlpp);
/* irregular shadowb buffer creation */
- if(R.r.mode & R_SHADOW)
+ if (R.r.mode & R_SHADOW)
ISB_create(pa, APixbuf);
/* masks, to have correct alpha combine */
- if(R.osa && (rl->layflag & SCE_LAY_SOLID) && pa->fullresult.first==NULL)
+ if (R.osa && (rl->layflag & SCE_LAY_SOLID) && pa->fullresult.first==NULL)
ztramask= MEM_callocN(pa->rectx*pa->recty*sizeof(short), "ztramask");
/* zero alpha pixels get speed vector max again */
- if(addpassflag & SCE_PASS_VECTOR)
- if(rl->layflag & SCE_LAY_SOLID)
+ if (addpassflag & SCE_PASS_VECTOR)
+ if (rl->layflag & SCE_LAY_SOLID)
reset_sky_speedvectors(pa, rl, rl->acolrect?rl->acolrect:rl->rectf); /* if acolrect is set we use it */
/* filtered render, for now we assume only 1 filter size */
- if(pa->crop) {
+ if (pa->crop) {
crop= 1;
offs= pa->rectx + 1;
passrect+= 4*offs;
@@ -4035,40 +4041,40 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
}
/* init scanline updates */
- rr->renrect.ymin= 0;
- rr->renrect.ymax= -pa->crop;
+ rr->renrect.ymin = 0;
+ rr->renrect.ymax = -pa->crop;
rr->renlay= rl;
/* render the tile */
- for(y=pa->disprect.ymin+crop; y<pa->disprect.ymax-crop; y++, rr->renrect.ymax++) {
+ for (y=pa->disprect.ymin+crop; y<pa->disprect.ymax-crop; y++, rr->renrect.ymax++) {
pass= passrect;
ap= aprect;
apstrand= aprectstrand;
od= offs;
- if(R.test_break(R.tbh))
+ if (R.test_break(R.tbh))
break;
- for(x=pa->disprect.xmin+crop; x<pa->disprect.xmax-crop; x++, ap++, apstrand++, pass+=4, od++) {
+ for (x=pa->disprect.xmin+crop; x<pa->disprect.xmax-crop; x++, ap++, apstrand++, pass+=4, od++) {
- if(ap->p[0]==0 && (!APixbufstrand || apstrand->p[0]==0)) {
- if(addpassflag & SCE_PASS_VECTOR)
+ if (ap->p[0]==0 && (!APixbufstrand || apstrand->p[0]==0)) {
+ if (addpassflag & SCE_PASS_VECTOR)
add_transp_speed(rl, od, NULL, 0.0f, rdrect);
}
else {
/* sort in z */
totface= 0;
apn= ap;
- while(apn) {
- for(a=0; a<4; a++) {
- if(apn->p[a]) {
+ while (apn) {
+ for (a=0; a<4; a++) {
+ if (apn->p[a]) {
zrow[totface].obi= apn->obi[a];
zrow[totface].z= apn->z[a];
zrow[totface].p= apn->p[a];
zrow[totface].mask= apn->mask[a];
zrow[totface].segment= -1;
totface++;
- if(totface>=MAX_ZROW) totface= MAX_ZROW-1;
+ if (totface>=MAX_ZROW) totface= MAX_ZROW-1;
}
else break;
}
@@ -4076,19 +4082,19 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
}
apnstrand= (APixbufstrand)? apstrand: NULL;
- while(apnstrand) {
- for(a=0; a<4; a++) {
- if(apnstrand->p[a]) {
+ while (apnstrand) {
+ for (a=0; a<4; a++) {
+ if (apnstrand->p[a]) {
zrow[totface].obi= apnstrand->obi[a];
zrow[totface].z= apnstrand->z[a];
zrow[totface].p= apnstrand->p[a];
zrow[totface].mask= apnstrand->mask[a];
zrow[totface].segment= apnstrand->seg[a];
- if(R.osa) {
+ if (R.osa) {
totsample= 0;
- for(b=0; b<R.osa; b++)
- if(zrow[totface].mask & (1<<b))
+ for (b=0; b<R.osa; b++)
+ if (zrow[totface].mask & (1<<b))
totsample++;
}
else
@@ -4097,43 +4103,43 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
zrow[totface].u= apnstrand->u[a]/totsample;
zrow[totface].v= apnstrand->v[a]/totsample;
totface++;
- if(totface>=MAX_ZROW) totface= MAX_ZROW-1;
+ if (totface>=MAX_ZROW) totface= MAX_ZROW-1;
}
}
apnstrand= apnstrand->next;
}
- if(totface==2) {
- if(zrow[0].z < zrow[1].z) {
+ if (totface==2) {
+ if (zrow[0].z < zrow[1].z) {
SWAP(ZTranspRow, zrow[0], zrow[1]);
}
}
- else if(totface>2) {
+ else if (totface>2) {
qsort(zrow, totface, sizeof(ZTranspRow), vergzvlak);
}
/* front face does index pass for transparent, no AA or filters, but yes FSA */
- if(addpassflag & SCE_PASS_INDEXOB) {
+ if (addpassflag & SCE_PASS_INDEXOB) {
ObjectRen *obr= R.objectinstance[zrow[totface-1].obi].obr;
- if(obr->ob) {
- for(a= 0; a<totfullsample; a++)
+ if (obr->ob) {
+ for (a= 0; a<totfullsample; a++)
add_transp_obindex(rlpp[a], od, obr->ob);
}
}
- if(addpassflag & SCE_PASS_INDEXMA) {
+ if (addpassflag & SCE_PASS_INDEXMA) {
ObjectRen *obr= R.objectinstance[zrow[totface-1].obi].obr;
- if(obr->ob) {
- for(a= 0; a<totfullsample; a++)
+ if (obr->ob) {
+ for (a= 0; a<totfullsample; a++)
add_transp_obindex(rlpp[a], od, obr->ob);
}
}
/* for each mask-sample we alpha-under colors. then in end it's added using filter */
memset(samp_shr, 0, sizeof(ShadeResult)*osa);
- for(a=0; a<osa; a++) {
+ for (a=0; a<osa; a++) {
samp_shr[a].z= 10e10f;
- if(addpassflag & SCE_PASS_VECTOR) {
+ if (addpassflag & SCE_PASS_VECTOR) {
samp_shr[a].winspeed[0]= PASS_VECTOR_MAX;
samp_shr[a].winspeed[1]= PASS_VECTOR_MAX;
samp_shr[a].winspeed[2]= PASS_VECTOR_MAX;
@@ -4141,16 +4147,16 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
}
}
- if(R.osa==0) {
- while(totface>0) {
+ if (R.osa==0) {
+ while (totface>0) {
totface--;
- if(shade_tra_samples(&ssamp, sscache, x, y, &zrow[totface], addpassflag)) {
+ if (shade_tra_samples(&ssamp, sscache, x, y, &zrow[totface], addpassflag)) {
filled= addtosamp_shr(samp_shr, &ssamp, addpassflag);
addAlphaUnderFloat(pass, ssamp.shr[0].combined);
- if(filled == 0) {
- if(sscache)
+ if (filled == 0) {
+ if (sscache)
unref_strand_samples(sscache, zrow, totface);
break;
}
@@ -4158,25 +4164,25 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
}
alpha= samp_shr->combined[3];
- if(alpha!=0.0f) {
+ if (alpha!=0.0f) {
add_transp_passes(rl, od, samp_shr, alpha);
- if(addpassflag & SCE_PASS_VECTOR)
+ if (addpassflag & SCE_PASS_VECTOR)
add_transp_speed(rl, od, samp_shr->winspeed, alpha, rdrect);
}
}
else {
short *sp= (short *)(ztramask+od);
- while(totface>0) {
+ while (totface>0) {
totface--;
- if(shade_tra_samples(&ssamp, sscache, x, y, &zrow[totface], addpassflag)) {
+ if (shade_tra_samples(&ssamp, sscache, x, y, &zrow[totface], addpassflag)) {
filled= addtosamp_shr(samp_shr, &ssamp, addpassflag);
- if(ztramask)
+ if (ztramask)
*sp |= zrow[totface].mask;
- if(filled==0) {
- if(sscache)
+ if (filled==0) {
+ if (sscache)
unref_strand_samples(sscache, zrow, totface);
break;
}
@@ -4184,16 +4190,16 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
}
/* multisample buffers or filtered mask filling? */
- if(pa->fullresult.first) {
- for(a=0; a<R.osa; a++) {
+ if (pa->fullresult.first) {
+ for (a=0; a<R.osa; a++) {
alpha= samp_shr[a].combined[3];
- if(alpha!=0.0f) {
+ if (alpha!=0.0f) {
RenderLayer *rl= ssamp.rlpp[a];
addAlphaOverFloat(rl->rectf + 4*od, samp_shr[a].combined);
add_transp_passes(rl, od, &samp_shr[a], alpha);
- if(addpassflag & SCE_PASS_VECTOR)
+ if (addpassflag & SCE_PASS_VECTOR)
add_transp_speed(rl, od, samp_shr[a].winspeed, alpha, rdrect);
}
}
@@ -4202,19 +4208,19 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
alpha= 0.0f;
/* note; cannot use pass[3] for alpha due to filtermask */
- for(a=0; a<R.osa; a++) {
+ for (a=0; a<R.osa; a++) {
add_filt_fmask(1<<a, samp_shr[a].combined, pass, rr->rectx);
alpha+= samp_shr[a].combined[3];
}
- if(addpassflag) {
+ if (addpassflag) {
alpha*= sampalpha;
/* merge all in one, and then add */
merge_transp_passes(rl, samp_shr);
add_transp_passes(rl, od, samp_shr, alpha);
- if(addpassflag & SCE_PASS_VECTOR)
+ if (addpassflag & SCE_PASS_VECTOR)
add_transp_speed(rl, od, samp_shr[0].winspeed, alpha, rdrect);
}
}
@@ -4232,13 +4238,13 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
rr->renlay= NULL;
MEM_freeN(APixbuf);
- if(APixbufstrand)
+ if (APixbufstrand)
MEM_freeN(APixbufstrand);
- if(sscache)
+ if (sscache)
strand_shade_cache_free(sscache);
freepsA(&apsmbase);
- if(R.r.mode & R_SHADOW)
+ if (R.r.mode & R_SHADOW)
ISB_free(pa);
return ztramask;
diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt
index 521074463e0..2a1a1d5649d 100644
--- a/source/blender/windowmanager/CMakeLists.txt
+++ b/source/blender/windowmanager/CMakeLists.txt
@@ -136,4 +136,10 @@ if(WITH_BUILDINFO)
add_definitions(-DWITH_BUILDINFO)
endif()
+if(WIN322)
+ list(APPEND INC
+ ../../../intern/utfconv
+ )
+endif()
+
blender_add_lib_nolist(bf_windowmanager "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/windowmanager/SConscript b/source/blender/windowmanager/SConscript
index be037452284..ddb61d721cc 100644
--- a/source/blender/windowmanager/SConscript
+++ b/source/blender/windowmanager/SConscript
@@ -32,6 +32,7 @@ if env['OURPLATFORM'] == 'linux':
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
+ incs += ' ../../intern/utfconv'
if env['OURPLATFORM'] != 'darwin' or env['WITH_GHOST_COCOA']:
sources.remove('intern' + os.sep + 'wm_apple.c')
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index eecc9cab028..a794cf10a86 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -214,6 +214,9 @@ void WM_operator_properties_select_all(struct wmOperatorType *ot);
int WM_operator_check_ui_enabled(const struct bContext *C, const char *idname);
wmOperator *WM_operator_last_redo(const struct bContext *C);
+int WM_operator_last_properties_init(struct wmOperator *op);
+int WM_operator_last_properties_store(struct wmOperator *op);
+
/* MOVE THIS SOMEWHERE ELSE */
#define SEL_TOGGLE 0
#define SEL_SELECT 1
@@ -230,7 +233,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 3a62faeab8a..4aa2c3f6405 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
@@ -348,8 +348,8 @@ typedef struct wmEvent {
int mval[2]; /* region mouse position, name convention pre 2.5 :) */
char utf8_buf[6]; /* from, ghost if utf8 is enabled for the platform,
* BLI_str_utf8_size() must _always_ be valid, check
- * when assigning s we dont need to check on every access after */
- char ascii; /* from ghost, fallback if utf8 isnt set */
+ * when assigning s we don't need to check on every access after */
+ char ascii; /* from ghost, fallback if utf8 isn't set */
char pad;
/* previous state */
@@ -428,6 +428,8 @@ typedef struct wmTimer {
int sleep; /* internal, put timers to sleep when needed */
} wmTimer;
+/* Default context for operator names/labels. */
+#define WM_OPERATOR_DEFAULT_I18NCONTEXT "Operator"
typedef struct wmOperatorType {
const char *name; /* text for ui, undo */
@@ -448,7 +450,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 *);
@@ -464,6 +466,9 @@ typedef struct wmOperatorType {
/* rna for properties */
struct StructRNA *srna;
+ /* previous settings - for initializing on re-use */
+ struct IDProperty *last_properties;
+
/* rna property to use for generic invoke functions.
* menus, enum search... etc */
PropertyRNA *prop;
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index c6c67e22bfd..638dd4ca807 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -69,37 +69,37 @@
/* ****************************************************** */
-#define MAX_OP_REGISTERED 32
+#define MAX_OP_REGISTERED 32
void WM_operator_free(wmOperator *op)
{
#ifdef WITH_PYTHON
- if(op->py_instance) {
- /* do this first incase there are any __del__ functions or
+ if (op->py_instance) {
+ /* do this first in case there are any __del__ functions or
* similar that use properties */
BPY_DECREF(op->py_instance);
}
#endif
- if(op->ptr) {
- op->properties= op->ptr->data;
+ if (op->ptr) {
+ op->properties = op->ptr->data;
MEM_freeN(op->ptr);
}
- if(op->properties) {
+ if (op->properties) {
IDP_FreeProperty(op->properties);
MEM_freeN(op->properties);
}
- if(op->reports && (op->reports->flag & RPT_FREE)) {
+ if (op->reports && (op->reports->flag & RPT_FREE)) {
BKE_reports_clear(op->reports);
MEM_freeN(op->reports);
}
- if(op->macro.first) {
+ if (op->macro.first) {
wmOperator *opm, *opmnext;
- for(opm= op->macro.first; opm; opm= opmnext) {
+ for (opm = op->macro.first; opm; opm = opmnext) {
opmnext = opm->next;
WM_operator_free(opm);
}
@@ -118,22 +118,22 @@ static void wm_reports_free(wmWindowManager *wm)
/* called on event handling by event_system.c */
void wm_operator_register(bContext *C, wmOperator *op)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
int tot;
BLI_addtail(&wm->operators, op);
- tot= BLI_countlist(&wm->operators);
+ tot = BLI_countlist(&wm->operators);
- while(tot>MAX_OP_REGISTERED) {
- wmOperator *opt= wm->operators.first;
+ while (tot > MAX_OP_REGISTERED) {
+ wmOperator *opt = wm->operators.first;
BLI_remlink(&wm->operators, opt);
WM_operator_free(opt);
tot--;
}
/* so the console is redrawn */
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
- WM_event_add_notifier(C, NC_WM|ND_HISTORY, NULL);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
+ WM_event_add_notifier(C, NC_WM | ND_HISTORY, NULL);
}
@@ -141,41 +141,41 @@ void WM_operator_stack_clear(wmWindowManager *wm)
{
wmOperator *op;
- while((op= wm->operators.first)) {
+ while ((op = wm->operators.first)) {
BLI_remlink(&wm->operators, op);
WM_operator_free(op);
}
- WM_main_add_notifier(NC_WM|ND_HISTORY, NULL);
+ WM_main_add_notifier(NC_WM | ND_HISTORY, NULL);
}
/* ****************************************** */
-static GHash *menutypes_hash= NULL;
+static GHash *menutypes_hash = NULL;
MenuType *WM_menutype_find(const char *idname, int quiet)
{
- MenuType* mt;
+ MenuType *mt;
if (idname[0]) {
- mt= BLI_ghash_lookup(menutypes_hash, idname);
- if(mt)
+ mt = BLI_ghash_lookup(menutypes_hash, idname);
+ if (mt)
return mt;
}
- if(!quiet)
+ if (!quiet)
printf("search for unknown menutype %s\n", idname);
return NULL;
}
-int WM_menutype_add(MenuType* mt)
+int WM_menutype_add(MenuType *mt)
{
BLI_ghash_insert(menutypes_hash, (void *)mt->idname, mt);
return 1;
}
-void WM_menutype_freelink(MenuType* mt)
+void WM_menutype_freelink(MenuType *mt)
{
BLI_ghash_remove(menutypes_hash, mt->idname, NULL, (GHashValFreeFP)MEM_freeN);
}
@@ -183,45 +183,45 @@ void WM_menutype_freelink(MenuType* mt)
/* called on initialize WM_init() */
void WM_menutype_init(void)
{
- menutypes_hash= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "menutypes_hash gh");
+ menutypes_hash = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "menutypes_hash gh");
}
void WM_menutype_free(void)
{
- GHashIterator *iter= BLI_ghashIterator_new(menutypes_hash);
+ GHashIterator *iter = BLI_ghashIterator_new(menutypes_hash);
- for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
- MenuType *mt= BLI_ghashIterator_getValue(iter);
- if(mt->ext.free) {
+ for (; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+ MenuType *mt = BLI_ghashIterator_getValue(iter);
+ if (mt->ext.free) {
mt->ext.free(mt->ext.data);
}
}
BLI_ghashIterator_free(iter);
BLI_ghash_free(menutypes_hash, NULL, (GHashValFreeFP)MEM_freeN);
- menutypes_hash= NULL;
+ menutypes_hash = NULL;
}
/* ****************************************** */
void WM_keymap_init(bContext *C)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
/* create standard key configs */
- if(!wm->defaultconf)
- wm->defaultconf= WM_keyconfig_new(wm, "Blender");
- if(!wm->addonconf)
- wm->addonconf= WM_keyconfig_new(wm, "Blender Addon");
- if(!wm->userconf)
- wm->userconf= WM_keyconfig_new(wm, "Blender User");
+ if (!wm->defaultconf)
+ wm->defaultconf = WM_keyconfig_new(wm, "Blender");
+ if (!wm->addonconf)
+ wm->addonconf = WM_keyconfig_new(wm, "Blender Addon");
+ if (!wm->userconf)
+ wm->userconf = WM_keyconfig_new(wm, "Blender User");
/* initialize only after python init is done, for keymaps that
- use python operators */
- if(CTX_py_init_get(C) && (wm->initialized & WM_INIT_KEYMAP) == 0) {
+ * 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 */
- if(!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) {
+ * it's persistent across sessions */
+ if (!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) {
wm_window_keymap(wm->defaultconf);
ED_spacetypes_keymap(wm->defaultconf);
@@ -237,30 +237,30 @@ void WM_keymap_init(bContext *C)
void WM_check(bContext *C)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
/* wm context */
- if(wm==NULL) {
- wm= CTX_data_main(C)->wm.first;
+ if (wm == NULL) {
+ wm = CTX_data_main(C)->wm.first;
CTX_wm_manager_set(C, wm);
}
- if(wm==NULL) return;
- if(wm->windows.first==NULL) return;
+ if (wm == NULL) return;
+ if (wm->windows.first == NULL) return;
if (!G.background) {
/* case: fileread */
- if((wm->initialized & WM_INIT_WINDOW) == 0) {
+ if ((wm->initialized & WM_INIT_WINDOW) == 0) {
WM_keymap_init(C);
WM_autosave_init(wm);
}
/* case: no open windows at all, for old file reads */
- wm_window_add_ghostwindows(C, wm);
+ wm_window_add_ghostwindows(wm);
}
/* case: fileread */
/* note: this runs in bg mode to set the screen context cb */
- if((wm->initialized & WM_INIT_WINDOW) == 0) {
+ if ((wm->initialized & WM_INIT_WINDOW) == 0) {
ED_screens_initialize(wm);
wm->initialized |= WM_INIT_WINDOW;
}
@@ -268,18 +268,18 @@ void WM_check(bContext *C)
void wm_clear_default_size(bContext *C)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
wmWindow *win;
/* wm context */
- if(wm==NULL) {
- wm= CTX_data_main(C)->wm.first;
+ if (wm == NULL) {
+ wm = CTX_data_main(C)->wm.first;
CTX_wm_manager_set(C, wm);
}
- if(wm==NULL) return;
- if(wm->windows.first==NULL) return;
+ if (wm == NULL) return;
+ if (wm->windows.first == NULL) return;
- for(win= wm->windows.first; win; win= win->next) {
+ for (win = wm->windows.first; win; win = win->next) {
win->sizex = 0;
win->sizey = 0;
win->posx = 0;
@@ -291,18 +291,18 @@ void wm_clear_default_size(bContext *C)
/* on startup, it adds all data, for matching */
void wm_add_default(bContext *C)
{
- wmWindowManager *wm= alloc_libblock(&CTX_data_main(C)->wm, ID_WM, "WinMan");
+ wmWindowManager *wm = alloc_libblock(&CTX_data_main(C)->wm, ID_WM, "WinMan");
wmWindow *win;
- bScreen *screen= CTX_wm_screen(C); /* XXX from file read hrmf */
+ bScreen *screen = CTX_wm_screen(C); /* XXX from file read hrmf */
CTX_wm_manager_set(C, wm);
- win= wm_window_new(C);
- win->screen= screen;
- screen->winid= win->winid;
- BLI_strncpy(win->screenname, screen->id.name+2, sizeof(win->screenname));
+ win = wm_window_new(C);
+ win->screen = screen;
+ screen->winid = win->winid;
+ BLI_strncpy(win->screenname, screen->id.name + 2, sizeof(win->screenname));
- wm->winactive= win;
- wm->file_saved= 1;
+ wm->winactive = win;
+ wm->file_saved = 1;
wm_window_make_drawable(C, win);
}
@@ -314,22 +314,22 @@ void wm_close_and_free(bContext *C, wmWindowManager *wm)
wmOperator *op;
wmKeyConfig *keyconf;
- if(wm->autosavetimer)
+ if (wm->autosavetimer)
wm_autosave_timer_ended(wm);
- while((win= wm->windows.first)) {
+ while ((win = wm->windows.first)) {
BLI_remlink(&wm->windows, win);
- win->screen= NULL; /* prevent draw clear to use screen */
+ win->screen = NULL; /* prevent draw clear to use screen */
wm_draw_window_clear(win);
wm_window_free(C, wm, win);
}
- while((op= wm->operators.first)) {
+ while ((op = wm->operators.first)) {
BLI_remlink(&wm->operators, op);
WM_operator_free(op);
}
- while((keyconf=wm->keyconfigs.first)) {
+ while ((keyconf = wm->keyconfigs.first)) {
BLI_remlink(&wm->keyconfigs, keyconf);
WM_keyconfig_free(keyconf);
}
@@ -341,14 +341,14 @@ void wm_close_and_free(bContext *C, wmWindowManager *wm)
wm_reports_free(wm);
- if(C && CTX_wm_manager(C)==wm) CTX_wm_manager_set(C, NULL);
+ if (C && CTX_wm_manager(C) == wm) CTX_wm_manager_set(C, NULL);
}
void wm_close_and_free_all(bContext *C, ListBase *wmlist)
{
wmWindowManager *wm;
- while((wm=wmlist->first)) {
+ while ((wm = wmlist->first)) {
wm_close_and_free(C, wm);
BLI_remlink(wmlist, wm);
MEM_freeN(wm);
@@ -357,7 +357,7 @@ void wm_close_and_free_all(bContext *C, ListBase *wmlist)
void WM_main(bContext *C)
{
- while(1) {
+ while (1) {
/* get events from ghost, handle window events, add to window queues */
wm_window_process_events(C);
diff --git a/source/blender/windowmanager/intern/wm_apple.c b/source/blender/windowmanager/intern/wm_apple.c
index e17441873d5..161725386c5 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;
@@ -62,23 +62,23 @@ static int checkAppleVideoCard(void)
long value;
long maxvram = 0; /* we get always more than 1 renderer, check one, at least, has 8 Mo */
- display_mask = CGDisplayIDToOpenGLDisplayMask (CGMainDisplayID() );
+ display_mask = CGDisplayIDToOpenGLDisplayMask(CGMainDisplayID() );
- theErr = CGLQueryRendererInfo( display_mask, &rend, &nrend);
+ theErr = CGLQueryRendererInfo(display_mask, &rend, &nrend);
if (theErr == 0) {
- theErr = CGLDescribeRenderer (rend, 0, kCGLRPRendererCount, &nrend);
+ theErr = CGLDescribeRenderer(rend, 0, kCGLRPRendererCount, &nrend);
if (theErr == 0) {
for (j = 0; j < nrend; j++) {
- theErr = CGLDescribeRenderer (rend, j, kCGLRPVideoMemory, &value);
+ theErr = CGLDescribeRenderer(rend, j, kCGLRPVideoMemory, &value);
if (value > maxvram)
maxvram = value;
if ((theErr == 0) && (value >= 20000000)) {
- theErr = CGLDescribeRenderer (rend, j, kCGLRPAccelerated, &value);
+ theErr = CGLDescribeRenderer(rend, j, kCGLRPAccelerated, &value);
if ((theErr == 0) && (value != 0)) {
- theErr = CGLDescribeRenderer (rend, j, kCGLRPCompliant, &value);
+ theErr = CGLDescribeRenderer(rend, j, kCGLRPCompliant, &value);
if ((theErr == 0) && (value != 0)) {
/*fprintf(stderr,"make it big\n");*/
- CGLDestroyRendererInfo (rend);
+ CGLDestroyRendererInfo(rend);
macPrefState = 8;
return 1;
}
@@ -87,18 +87,18 @@ static int checkAppleVideoCard(void)
}
}
}
- if (maxvram < 7500000 ) { /* put a standard alert and quit*/
+ if (maxvram < 7500000) { /* put a standard alert and quit*/
SInt16 junkHit;
- char inError[] = "* Not enough VRAM ";
- char inText[] = "* blender needs at least 8Mb ";
+ char inError[] = "* Not enough VRAM ";
+ char inText[] = "* blender needs at least 8Mb ";
inError[0] = 16;
inText[0] = 28;
fprintf(stderr, " vram is %li . not enough, aborting\n", maxvram);
- StandardAlert ( kAlertStopAlert, (ConstStr255Param) &inError, (ConstStr255Param)&inText,NULL,&junkHit);
+ StandardAlert(kAlertStopAlert, (ConstStr255Param) & inError, (ConstStr255Param) & inText, NULL, &junkHit);
abort();
}
- CGLDestroyRendererInfo (rend);
+ CGLDestroyRendererInfo(rend);
return 0;
}
@@ -106,7 +106,7 @@ static void getMacAvailableBounds(short *top, short *left, short *bottom, short
{
Rect outAvailableRect;
- GetAvailableWindowPositioningBounds ( GetMainDevice(), &outAvailableRect);
+ GetAvailableWindowPositioningBounds(GetMainDevice(), &outAvailableRect);
*top = outAvailableRect.top;
*left = outAvailableRect.left;
@@ -124,13 +124,14 @@ void wm_set_apple_prefsize(int scr_x, int scr_y)
short top, left, bottom, right;
getMacAvailableBounds(&top, &left, &bottom, &right);
- WM_setprefsize(left +10,scr_y - bottom +10,right-left -20,bottom - 64);
- G.windowstate= 0;
+ WM_setprefsize(left + 10, scr_y - bottom + 10, right - left - 20, bottom - 64);
+ G.windowstate = 0;
- } else {
+ }
+ else {
/* 40 + 684 + (headers) 22 + 22 = 768, the powerbook screen height */
WM_setprefsize(120, 40, 850, 684);
- G.windowstate= 0;
+ G.windowstate = 0;
}
}
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index 0770faa8d47..f97391c0d6e 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -55,27 +55,27 @@
/* Some simple ghost <-> blender conversions */
static GHOST_TStandardCursor convert_cursor(int curs)
{
- switch(curs) {
+ switch (curs) {
default:
- case CURSOR_STD: return GHOST_kStandardCursorDefault;
- case CURSOR_FACESEL: return GHOST_kStandardCursorRightArrow;
- case CURSOR_WAIT: return GHOST_kStandardCursorWait;
- case CURSOR_EDIT: return GHOST_kStandardCursorCrosshair;
+ case CURSOR_STD: return GHOST_kStandardCursorDefault;
+ case CURSOR_FACESEL: return GHOST_kStandardCursorRightArrow;
+ case CURSOR_WAIT: return GHOST_kStandardCursorWait;
+ case CURSOR_EDIT: return GHOST_kStandardCursorCrosshair;
case CURSOR_HELP:
#ifdef __APPLE__
return GHOST_kStandardCursorLeftRight;
#else
return GHOST_kStandardCursorHelp;
#endif
- case CURSOR_X_MOVE: return GHOST_kStandardCursorLeftRight;
- case CURSOR_Y_MOVE: return GHOST_kStandardCursorUpDown;
- case CURSOR_PENCIL: return GHOST_kStandardCursorPencil;
- case CURSOR_COPY: return GHOST_kStandardCursorCopy;
+ case CURSOR_X_MOVE: return GHOST_kStandardCursorLeftRight;
+ case CURSOR_Y_MOVE: return GHOST_kStandardCursorUpDown;
+ case CURSOR_PENCIL: return GHOST_kStandardCursorPencil;
+ case CURSOR_COPY: return GHOST_kStandardCursorCopy;
}
}
static void window_set_custom_cursor(wmWindow *win, unsigned char mask[16][2],
- unsigned char bitmap[16][2], int hotx, int hoty)
+ unsigned char bitmap[16][2], int hotx, int hoty)
{
GHOST_SetCustomCursorShape(win->ghostwin, bitmap, mask, hotx, hoty);
}
@@ -84,16 +84,17 @@ static void window_set_custom_cursor_ex(wmWindow *win, BCursor *cursor, int useB
{
if (useBig) {
GHOST_SetCustomCursorShapeEx(win->ghostwin,
- (GHOST_TUns8 *)cursor->big_bm, (GHOST_TUns8 *)cursor->big_mask,
- cursor->big_sizex,cursor->big_sizey,
- cursor->big_hotx,cursor->big_hoty,
- cursor->fg_color, cursor->bg_color);
- } else {
+ (GHOST_TUns8 *)cursor->big_bm, (GHOST_TUns8 *)cursor->big_mask,
+ cursor->big_sizex, cursor->big_sizey,
+ cursor->big_hotx, cursor->big_hoty,
+ cursor->fg_color, cursor->bg_color);
+ }
+ else {
GHOST_SetCustomCursorShapeEx(win->ghostwin,
- (GHOST_TUns8 *)cursor->small_bm, (GHOST_TUns8 *)cursor->small_mask,
- cursor->small_sizex,cursor->small_sizey,
- cursor->small_hotx,cursor->small_hoty,
- cursor->fg_color, cursor->bg_color);
+ (GHOST_TUns8 *)cursor->small_bm, (GHOST_TUns8 *)cursor->small_mask,
+ cursor->small_sizex, cursor->small_sizey,
+ cursor->small_hotx, cursor->small_hoty,
+ cursor->fg_color, cursor->bg_color);
}
}
@@ -104,9 +105,9 @@ static BCursor *BlenderCursor[BC_NUMCURSORS]; /*Points to static BCursor Structs
void WM_cursor_set(wmWindow *win, int curs)
{
- if (win==NULL) return; /* Can't set custom cursor before Window init */
+ if (win == NULL) return; /* Can't set custom cursor before Window init */
- if (curs==CURSOR_NONE) {
+ if (curs == CURSOR_NONE) {
GHOST_SetCursorVisibility(win->ghostwin, 0);
return;
}
@@ -114,28 +115,28 @@ void WM_cursor_set(wmWindow *win, int curs)
#ifdef _WIN32
/* the default win32 cross cursor is barely visible,
* only 1 pixel thick, use another one instead */
- if(curs==CURSOR_EDIT)
- curs= BC_CROSSCURSOR;
+ if (curs == CURSOR_EDIT)
+ curs = BC_CROSSCURSOR;
#endif
GHOST_SetCursorVisibility(win->ghostwin, 1);
- if(curs == CURSOR_STD && win->modalcursor)
- curs= win->modalcursor;
+ if (curs == CURSOR_STD && win->modalcursor)
+ curs = win->modalcursor;
- win->cursor= curs;
+ win->cursor = curs;
/* detect if we use system cursor or Blender cursor */
- if(curs>=BC_GHOST_CURSORS) {
+ if (curs >= BC_GHOST_CURSORS) {
GHOST_SetCursorShape(win->ghostwin, convert_cursor(curs));
}
else {
- if ((curs<SYSCURSOR) || (curs>=BC_NUMCURSORS)) return;
+ if ((curs < SYSCURSOR) || (curs >= BC_NUMCURSORS)) return;
- if (curs==SYSCURSOR) { /* System default Cursor */
+ if (curs == SYSCURSOR) { /* System default Cursor */
GHOST_SetCursorShape(win->ghostwin, convert_cursor(CURSOR_STD));
}
- else if ( (U.curssize==0) || (BlenderCursor[curs]->big_bm == NULL) ) {
+ else if ( (U.curssize == 0) || (BlenderCursor[curs]->big_bm == NULL) ) {
window_set_custom_cursor_ex(win, BlenderCursor[curs], 0);
}
else {
@@ -146,7 +147,7 @@ void WM_cursor_set(wmWindow *win, int curs)
void WM_cursor_modal(wmWindow *win, int val)
{
- if(win->lastcursor == 0)
+ if (win->lastcursor == 0)
win->lastcursor = win->cursor;
win->modalcursor = val;
WM_cursor_set(win, val);
@@ -155,7 +156,7 @@ void WM_cursor_modal(wmWindow *win, int val)
void WM_cursor_restore(wmWindow *win)
{
win->modalcursor = 0;
- if(win->lastcursor)
+ if (win->lastcursor)
WM_cursor_set(win, win->lastcursor);
win->lastcursor = 0;
}
@@ -163,14 +164,15 @@ void WM_cursor_restore(wmWindow *win)
/* to allow usage all over, we do entire WM */
void WM_cursor_wait(int val)
{
- if(!G.background) {
- wmWindowManager *wm= G.main->wm.first;
- wmWindow *win= wm?wm->windows.first:NULL;
+ if (!G.background) {
+ wmWindowManager *wm = G.main->wm.first;
+ wmWindow *win = wm ? wm->windows.first : NULL;
- for(; win; win= win->next) {
- if(val) {
+ for (; win; win = win->next) {
+ if (val) {
WM_cursor_modal(win, BC_WAITCURSOR);
- } else {
+ }
+ else {
WM_cursor_restore(win);
}
}
@@ -184,11 +186,11 @@ void WM_cursor_grab(wmWindow *win, int wrap, int hide, int *bounds)
* */
GHOST_TGrabCursorMode mode = GHOST_kGrabNormal;
- if(hide) mode = GHOST_kGrabHide;
- else if(wrap) mode = GHOST_kGrabWrap;
- if ((G.f & G_DEBUG) == 0) {
+ if (hide) mode = GHOST_kGrabHide;
+ else if (wrap) mode = GHOST_kGrabWrap;
+ if ((G.debug & G_DEBUG) == 0) {
if (win && win->ghostwin) {
- const GHOST_TabletData *tabletdata= GHOST_GetTabletData(win->ghostwin);
+ const GHOST_TabletData *tabletdata = GHOST_GetTabletData(win->ghostwin);
// Note: There is no tabletdata on Windows if no tablet device is connected.
if (!tabletdata)
GHOST_SetCursorGrab(win->ghostwin, mode, bounds);
@@ -202,8 +204,8 @@ void WM_cursor_grab(wmWindow *win, int wrap, int hide, int *bounds)
void WM_cursor_ungrab(wmWindow *win)
{
- if ((G.f & G_DEBUG) == 0) {
- if(win && win->ghostwin) {
+ if ((G.debug & G_DEBUG) == 0) {
+ if (win && win->ghostwin) {
GHOST_SetCursorGrab(win->ghostwin, GHOST_kGrabDisable, NULL);
win->grabcursor = GHOST_kGrabDisable;
}
@@ -213,19 +215,22 @@ void WM_cursor_ungrab(wmWindow *win)
/* give it a modal keymap one day? */
int wm_cursor_arrow_move(wmWindow *win, wmEvent *event)
{
- if(win && event->val==KM_PRESS) {
+ if (win && event->val == KM_PRESS) {
- if(event->type==UPARROWKEY) {
- WM_cursor_warp(win, event->x, event->y+1);
+ if (event->type == UPARROWKEY) {
+ WM_cursor_warp(win, event->x, event->y + 1);
return 1;
- } else if(event->type==DOWNARROWKEY) {
- WM_cursor_warp(win, event->x, event->y-1);
+ }
+ else if (event->type == DOWNARROWKEY) {
+ WM_cursor_warp(win, event->x, event->y - 1);
return 1;
- } else if(event->type==LEFTARROWKEY) {
- WM_cursor_warp(win, event->x-1, event->y);
+ }
+ else if (event->type == LEFTARROWKEY) {
+ WM_cursor_warp(win, event->x - 1, event->y);
return 1;
- } else if(event->type==RIGHTARROWKEY) {
- WM_cursor_warp(win, event->x+1, event->y);
+ }
+ else if (event->type == RIGHTARROWKEY) {
+ WM_cursor_warp(win, event->x + 1, event->y);
return 1;
}
}
@@ -237,80 +242,80 @@ int wm_cursor_arrow_move(wmWindow *win, wmEvent *event)
void WM_timecursor(wmWindow *win, int nr)
{
/* 10 8x8 digits */
- static char number_bitmaps[10][8]= {
- {0, 56, 68, 68, 68, 68, 68, 56},
- {0, 24, 16, 16, 16, 16, 16, 56},
- {0, 60, 66, 32, 16, 8, 4, 126},
- {0, 124, 32, 16, 56, 64, 66, 60},
- {0, 32, 48, 40, 36, 126, 32, 32},
- {0, 124, 4, 60, 64, 64, 68, 56},
- {0, 56, 4, 4, 60, 68, 68, 56},
- {0, 124, 64, 32, 16, 8, 8, 8},
- {0, 60, 66, 66, 60, 66, 66, 60},
- {0, 56, 68, 68, 120, 64, 68, 56}
+ static char number_bitmaps[10][8] = {
+ {0, 56, 68, 68, 68, 68, 68, 56},
+ {0, 24, 16, 16, 16, 16, 16, 56},
+ {0, 60, 66, 32, 16, 8, 4, 126},
+ {0, 124, 32, 16, 56, 64, 66, 60},
+ {0, 32, 48, 40, 36, 126, 32, 32},
+ {0, 124, 4, 60, 64, 64, 68, 56},
+ {0, 56, 4, 4, 60, 68, 68, 56},
+ {0, 124, 64, 32, 16, 8, 8, 8},
+ {0, 60, 66, 66, 60, 66, 66, 60},
+ {0, 56, 68, 68, 120, 64, 68, 56}
};
unsigned char mask[16][2];
- unsigned char bitmap[16][2]= {{0}};
+ unsigned char bitmap[16][2] = {{0}};
int i, idx;
- if(win->lastcursor == 0)
- win->lastcursor= win->cursor;
+ if (win->lastcursor == 0)
+ win->lastcursor = win->cursor;
memset(&mask, 0xFF, sizeof(mask));
/* print number bottom right justified */
- for (idx= 3; nr && idx>=0; idx--) {
- char *digit= number_bitmaps[nr%10];
- int x = idx%2;
- int y = idx/2;
-
- for (i=0; i<8; i++)
- bitmap[i + y*8][x]= digit[i];
- nr/= 10;
+ for (idx = 3; nr && idx >= 0; idx--) {
+ char *digit = number_bitmaps[nr % 10];
+ int x = idx % 2;
+ int y = idx / 2;
+
+ for (i = 0; i < 8; i++)
+ bitmap[i + y * 8][x] = digit[i];
+ nr /= 10;
}
window_set_custom_cursor(win, mask, bitmap, 7, 7);
}
-/* ******************************************************************
-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 }
@@ -319,78 +324,78 @@ void wm_init_cursor_data(void)
{
/********************** NW_ARROW Cursor **************************/
BEGIN_CURSOR_BLOCK
- static char nw_sbm[]={
- 0x03, 0x00, 0x05, 0x00, 0x09, 0x00, 0x11, 0x00,
- 0x21, 0x00, 0x41, 0x00, 0x81, 0x00, 0x01, 0x01,
- 0x01, 0x02, 0xc1, 0x03, 0x49, 0x00, 0x8d, 0x00,
- 0x8b, 0x00, 0x10, 0x01, 0x90, 0x01, 0x60, 0x00,
- };
-
- static char nw_smsk[]={
- 0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00,
- 0x3f, 0x00, 0x7f, 0x00, 0xff, 0x00, 0xff, 0x01,
- 0xff, 0x03, 0xff, 0x03, 0x7f, 0x00, 0xff, 0x00,
- 0xfb, 0x00, 0xf0, 0x01, 0xf0, 0x01, 0x60, 0x00,
- };
-
- static BCursor NWArrowCursor = {
- /*small*/
- nw_sbm, nw_smsk,
- 16, 16,
- 6, 7,
- /*big*/
- NULL, NULL,
- 32,32,
- 15, 15,
- /*color*/
- BC_BLACK, BC_WHITE
- };
-
- BlenderCursor[BC_NW_ARROWCURSOR]=&NWArrowCursor;
+ static char nw_sbm[] = {
+ 0x03, 0x00, 0x05, 0x00, 0x09, 0x00, 0x11, 0x00,
+ 0x21, 0x00, 0x41, 0x00, 0x81, 0x00, 0x01, 0x01,
+ 0x01, 0x02, 0xc1, 0x03, 0x49, 0x00, 0x8d, 0x00,
+ 0x8b, 0x00, 0x10, 0x01, 0x90, 0x01, 0x60, 0x00,
+ };
+
+ static char nw_smsk[] = {
+ 0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00,
+ 0x3f, 0x00, 0x7f, 0x00, 0xff, 0x00, 0xff, 0x01,
+ 0xff, 0x03, 0xff, 0x03, 0x7f, 0x00, 0xff, 0x00,
+ 0xfb, 0x00, 0xf0, 0x01, 0xf0, 0x01, 0x60, 0x00,
+ };
+
+ static BCursor NWArrowCursor = {
+ /*small*/
+ nw_sbm, nw_smsk,
+ 16, 16,
+ 6, 7,
+ /*big*/
+ NULL, NULL,
+ 32, 32,
+ 15, 15,
+ /*color*/
+ BC_BLACK, BC_WHITE
+ };
+
+ BlenderCursor[BC_NW_ARROWCURSOR] = &NWArrowCursor;
END_CURSOR_BLOCK
///********************** NS_ARROW Cursor *************************/
BEGIN_CURSOR_BLOCK
- static char ns_sbm[]={
- 0x40, 0x01, 0x20, 0x02, 0x10, 0x04, 0x08, 0x08,
- 0x04, 0x10, 0x3c, 0x1e, 0x20, 0x02, 0x20, 0x02,
- 0x20, 0x02, 0x20, 0x02, 0x3c, 0x1e, 0x04, 0x10,
- 0x08, 0x08, 0x10, 0x04, 0x20, 0x02, 0x40, 0x01
- };
-
- static char ns_smsk[]={
- 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0f,
- 0xfc, 0x1f, 0xfc, 0x1f, 0xe0, 0x03, 0xe0, 0x03,
- 0xe0, 0x03, 0xe0, 0x03, 0xfc, 0x1f, 0xfc, 0x1f,
- 0xf8, 0x0f, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01
- };
-
- static BCursor NSArrowCursor = {
- /*small*/
- ns_sbm, ns_smsk,
- 16, 16,
- 6, 7,
- /*big*/
- NULL, NULL,
- 32,32,
- 15, 15,
- /*color*/
- BC_BLACK, BC_WHITE
- };
-
- BlenderCursor[BC_NS_ARROWCURSOR]=&NSArrowCursor;
+ static char ns_sbm[] = {
+ 0x40, 0x01, 0x20, 0x02, 0x10, 0x04, 0x08, 0x08,
+ 0x04, 0x10, 0x3c, 0x1e, 0x20, 0x02, 0x20, 0x02,
+ 0x20, 0x02, 0x20, 0x02, 0x3c, 0x1e, 0x04, 0x10,
+ 0x08, 0x08, 0x10, 0x04, 0x20, 0x02, 0x40, 0x01
+ };
+
+ static char ns_smsk[] = {
+ 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0f,
+ 0xfc, 0x1f, 0xfc, 0x1f, 0xe0, 0x03, 0xe0, 0x03,
+ 0xe0, 0x03, 0xe0, 0x03, 0xfc, 0x1f, 0xfc, 0x1f,
+ 0xf8, 0x0f, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01
+ };
+
+ static BCursor NSArrowCursor = {
+ /*small*/
+ ns_sbm, ns_smsk,
+ 16, 16,
+ 6, 7,
+ /*big*/
+ NULL, NULL,
+ 32, 32,
+ 15, 15,
+ /*color*/
+ BC_BLACK, BC_WHITE
+ };
+
+ BlenderCursor[BC_NS_ARROWCURSOR] = &NSArrowCursor;
END_CURSOR_BLOCK
/********************** EW_ARROW Cursor *************************/
BEGIN_CURSOR_BLOCK
- static char ew_sbm[]={
+ static char ew_sbm[] = {
0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x38, 0x1c,
0x2c, 0x34, 0xe6, 0x67, 0x03, 0xc0, 0x01, 0x80,
0x03, 0xc0, 0xe6, 0x67, 0x2c, 0x34, 0x38, 0x1c,
0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
- static char ew_smsk[]={
+ static char ew_smsk[] = {
0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x38, 0x1c,
0x3c, 0x3c, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xfe, 0x7f, 0x3c, 0x3c, 0x38, 0x1c,
@@ -404,32 +409,32 @@ BEGIN_CURSOR_BLOCK
7, 6,
/*big*/
NULL, NULL,
- 32,32,
+ 32, 32,
15, 15,
/*color*/
BC_BLACK, BC_WHITE
};
- BlenderCursor[BC_EW_ARROWCURSOR]=&EWArrowCursor;
+ BlenderCursor[BC_EW_ARROWCURSOR] = &EWArrowCursor;
END_CURSOR_BLOCK
/********************** Wait Cursor *****************************/
BEGIN_CURSOR_BLOCK
- static char wait_sbm[]={
+ static char wait_sbm[] = {
0xfe, 0x7f, 0x02, 0x40, 0x02, 0x40, 0x84, 0x21,
0xc8, 0x13, 0xd0, 0x0b, 0xa0, 0x04, 0x20, 0x05,
0xa0, 0x04, 0x10, 0x09, 0x88, 0x11, 0xc4, 0x23,
0xe2, 0x47, 0xfa, 0x5f, 0x02, 0x40, 0xfe, 0x7f,
};
- static char wait_smsk[]={
+ static char wait_smsk[] = {
0xfe, 0x7f, 0xfe, 0x7f, 0x06, 0x60, 0x8c, 0x31,
0xd8, 0x1b, 0xf0, 0x0f, 0xe0, 0x06, 0x60, 0x07,
0xe0, 0x06, 0x30, 0x0d, 0x98, 0x19, 0xcc, 0x33,
0xe6, 0x67, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f,
};
- static char wait_lbm[]={
+ static char wait_lbm[] = {
0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
0x0c, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x30,
0x0c, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x18,
@@ -448,7 +453,7 @@ BEGIN_CURSOR_BLOCK
0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
};
- static char wait_lmsk[]={
+ static char wait_lmsk[] = {
0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
0x3c, 0x00, 0x00, 0x3c, 0x3c, 0x00, 0x00, 0x1e,
@@ -469,36 +474,36 @@ BEGIN_CURSOR_BLOCK
static BCursor WaitCursor = {
/*small*/
- wait_sbm, wait_smsk,
+ wait_sbm, wait_smsk,
16, 16,
7, 7,
/*big*/
wait_lbm, wait_lmsk,
- 32,32,
+ 32, 32,
15, 15,
/*color*/
BC_BLACK, BC_WHITE
};
- BlenderCursor[BC_WAITCURSOR]=&WaitCursor;
+ BlenderCursor[BC_WAITCURSOR] = &WaitCursor;
END_CURSOR_BLOCK
/********************** Cross Cursor ***************************/
BEGIN_CURSOR_BLOCK
- static char cross_sbm[]={
+ static char cross_sbm[] = {
0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x7e, 0x7e,
0x7e, 0x7e, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x00, 0x00,
};
- static char cross_smsk[]={
+ static char cross_smsk[] = {
0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
0x80, 0x01, 0x80, 0x01, 0xc0, 0x03, 0x7f, 0xfe,
0x7f, 0xfe, 0xc0, 0x03, 0x80, 0x01, 0x80, 0x01,
0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01,
};
- static char cross_lbm[]={
+ static char cross_lbm[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
@@ -517,7 +522,7 @@ BEGIN_CURSOR_BLOCK
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
- static char cross_lmsk[]={
+ static char cross_lmsk[] = {
0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
@@ -543,25 +548,25 @@ BEGIN_CURSOR_BLOCK
7, 7,
/*big*/
cross_lbm, cross_lmsk,
- 32,32,
+ 32, 32,
15, 15,
/*color*/
BC_BLACK, BC_WHITE
};
- BlenderCursor[BC_CROSSCURSOR]=&CrossCursor;
+ BlenderCursor[BC_CROSSCURSOR] = &CrossCursor;
END_CURSOR_BLOCK
/********************** EditCross Cursor ***********************/
BEGIN_CURSOR_BLOCK
- static char editcross_sbm[]={
+ static char editcross_sbm[] = {
0x0e, 0x00, 0x11, 0x00, 0x1d, 0x00, 0x19, 0x03,
0x1d, 0x03, 0x11, 0x03, 0x0e, 0x03, 0x00, 0x03,
0xf8, 0x7c, 0xf8, 0x7c, 0x00, 0x03, 0x00, 0x03,
0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00,
};
- static char editcross_smsk[]={
+ static char editcross_smsk[] = {
0x0e, 0x00, 0x1f, 0x00, 0x1f, 0x03, 0x1f, 0x03,
0x1f, 0x03, 0x1f, 0x03, 0x0e, 0x03, 0x80, 0x07,
0xfc, 0xfc, 0xfc, 0xfc, 0x80, 0x07, 0x00, 0x03,
@@ -575,26 +580,26 @@ BEGIN_CURSOR_BLOCK
9, 8,
/*big*/
NULL, NULL,
- 32,32,
+ 32, 32,
15, 15,
/*color*/
BC_BLACK, BC_WHITE
};
- BlenderCursor[BC_EDITCROSSCURSOR]=&EditCrossCursor;
+ BlenderCursor[BC_EDITCROSSCURSOR] = &EditCrossCursor;
END_CURSOR_BLOCK
/********************** Box Select *************************/
BEGIN_CURSOR_BLOCK
- static char box_sbm[32]={
- 0x7f, 0x00, 0x41, 0x00, 0x41, 0x00, 0x41, 0x06,
+ static char box_sbm[32] = {
+ 0x7f, 0x00, 0x41, 0x00, 0x41, 0x00, 0x41, 0x06,
0x41, 0x06, 0x41, 0x06, 0x7f, 0x06, 0x00, 0x06,
0xe0, 0x79, 0xe0, 0x79, 0x00, 0x06, 0x00, 0x06,
0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00,
};
- static char box_smsk[32]={
- 0x7f, 0x00, 0x7f, 0x00, 0x63, 0x06, 0x63, 0x06,
+ static char box_smsk[32] = {
+ 0x7f, 0x00, 0x7f, 0x00, 0x63, 0x06, 0x63, 0x06,
0x63, 0x06, 0x7f, 0x06, 0x7f, 0x06, 0x00, 0x0f,
0xf0, 0xf9, 0xf0, 0xf9, 0x00, 0x0f, 0x00, 0x06,
0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06,
@@ -608,32 +613,32 @@ BEGIN_CURSOR_BLOCK
9, 8,
/*big*/
NULL, NULL,
- 32,32,
+ 32, 32,
15, 15,
/*color*/
BC_BLACK, BC_WHITE
};
- BlenderCursor[BC_BOXSELCURSOR]=&BoxSelCursor;
+ BlenderCursor[BC_BOXSELCURSOR] = &BoxSelCursor;
END_CURSOR_BLOCK
/********************** Knife Cursor ***********************/
BEGIN_CURSOR_BLOCK
- static char knife_sbm[]={
+ static char knife_sbm[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x2c,
0x00, 0x5a, 0x00, 0x34, 0x00, 0x2a, 0x00, 0x17,
0x80, 0x06, 0x40, 0x03, 0xa0, 0x03, 0xd0, 0x01,
0x68, 0x00, 0x1c, 0x00, 0x06, 0x00, 0x00, 0x00
};
- static char knife_smsk[]={
+ static char knife_smsk[] = {
0x00, 0x60, 0x00, 0xf0, 0x00, 0xfc, 0x00, 0xfe,
0x00, 0xfe, 0x00, 0x7e, 0x00, 0x7f, 0x80, 0x3f,
0xc0, 0x0e, 0x60, 0x07, 0xb0, 0x07, 0xd8, 0x03,
0xec, 0x01, 0x7e, 0x00, 0x1f, 0x00, 0x07, 0x00
};
- static char knife_lbm[]={
+ static char knife_lbm[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c,
@@ -653,7 +658,7 @@ BEGIN_CURSOR_BLOCK
};
- static char knife_lmsk[]={
+ static char knife_lmsk[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x7e,
@@ -675,41 +680,41 @@ BEGIN_CURSOR_BLOCK
static BCursor KnifeCursor = {
/*small*/
- knife_sbm, knife_smsk,
+ knife_sbm, knife_smsk,
16, 16,
0, 15,
/*big*/
knife_lbm, knife_lmsk,
- 32,32,
+ 32, 32,
0, 31,
/*color*/
BC_BLACK, BC_WHITE
};
- BlenderCursor[BC_KNIFECURSOR]=&KnifeCursor;
+ BlenderCursor[BC_KNIFECURSOR] = &KnifeCursor;
END_CURSOR_BLOCK
/********************** Loop Select Cursor ***********************/
BEGIN_CURSOR_BLOCK
-static char vloop_sbm[]={
+ static char vloop_sbm[] = {
0x00, 0x00, 0x7e, 0x00, 0x3e, 0x00, 0x1e, 0x00,
0x0e, 0x00, 0x66, 0x60, 0x62, 0x6f, 0x00, 0x00,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x00, 0x00, 0x60, 0x60, 0x60, 0x6f, 0x00, 0x00,
-};
+ };
-static char vloop_smsk[]={
+ static char vloop_smsk[] = {
0xff, 0x01, 0xff, 0x00, 0x7f, 0x00, 0x3f, 0x00,
0xff, 0xf0, 0xff, 0xff, 0xf7, 0xff, 0xf3, 0xf0,
0x61, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xff, 0xf0, 0xf0,
-};
+ };
-static char vloop_lbm[]={
+ static char vloop_lbm[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfc, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00,
0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00,
@@ -726,9 +731,9 @@ static char vloop_lbm[]={
0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
0x00, 0x3c, 0xff, 0x3c, 0x00, 0x3c, 0xff, 0x3c,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
+ };
-static char vloop_lmsk[]={
+ static char vloop_lmsk[] = {
0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0x03, 0x00,
0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
0xff, 0x3f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00,
@@ -745,38 +750,38 @@ static char vloop_lmsk[]={
0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff,
0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff,
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
-};
+ };
static BCursor VLoopCursor = {
/*small*/
- vloop_sbm, vloop_smsk,
+ vloop_sbm, vloop_smsk,
16, 16,
0, 0,
/*big*/
vloop_lbm, vloop_lmsk,
- 32,32,
+ 32, 32,
0, 0,
/*color*/
BC_BLACK, BC_WHITE
};
- BlenderCursor[BC_VLOOPCURSOR]=&VLoopCursor;
+ BlenderCursor[BC_VLOOPCURSOR] = &VLoopCursor;
-END_CURSOR_BLOCK
+END_CURSOR_BLOCK
/********************** TextEdit Cursor ***********************/
BEGIN_CURSOR_BLOCK
- static char textedit_sbm[]={
+ static char textedit_sbm[] = {
0xe0, 0x03, 0x10, 0x04, 0x60, 0x03, 0x40, 0x01,
0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01,
0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01,
0x40, 0x01, 0x60, 0x03, 0x10, 0x04, 0xe0, 0x03,
};
- static char textedit_smsk[]={
+ static char textedit_smsk[] = {
0xe0, 0x03, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01,
0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01,
0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01,
@@ -790,19 +795,19 @@ BEGIN_CURSOR_BLOCK
9, 8,
/*big*/
NULL, NULL,
- 32,32,
+ 32, 32,
15, 15,
/*color*/
BC_BLACK, BC_WHITE
};
- BlenderCursor[BC_TEXTEDITCURSOR]=&TextEditCursor;
+ BlenderCursor[BC_TEXTEDITCURSOR] = &TextEditCursor;
END_CURSOR_BLOCK
/********************** Paintbrush Cursor ***********************/
BEGIN_CURSOR_BLOCK
- static char paintbrush_sbm[]={
+ static char paintbrush_sbm[] = {
0x00, 0xe0, 0x00, 0x98, 0x00, 0x44, 0x00, 0x42,
0x00, 0x21, 0x80, 0x20, 0x40, 0x13, 0x40, 0x17,
@@ -813,7 +818,7 @@ BEGIN_CURSOR_BLOCK
};
- static char paintbrush_smsk[]={
+ static char paintbrush_smsk[] = {
0x00, 0xe0, 0x00, 0xf8, 0x00, 0x7c, 0x00, 0x7e,
0x00, 0x3f, 0x80, 0x3f, 0xc0, 0x1f, 0xc0, 0x1f,
0xe0, 0x0f, 0xf8, 0x07, 0xfc, 0x03, 0xfe, 0x01,
@@ -829,83 +834,83 @@ BEGIN_CURSOR_BLOCK
0, 15,
/*big*/
NULL, NULL,
- 32,32,
+ 32, 32,
15, 15,
/*color*/
BC_BLACK, BC_WHITE
};
- BlenderCursor[BC_PAINTBRUSHCURSOR]=&PaintBrushCursor;
+ BlenderCursor[BC_PAINTBRUSHCURSOR] = &PaintBrushCursor;
END_CURSOR_BLOCK
/********************** Hand Cursor ***********************/
BEGIN_CURSOR_BLOCK
-static char hand_sbm[]={
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80, 0x0d,
- 0x98, 0x6d, 0x98, 0x6d, 0xb0, 0x6d, 0xb0, 0x6d,
- 0xe0, 0x6f, 0xe6, 0x7f, 0xee, 0x7f, 0xfc, 0x3f,
- 0xf8, 0x3f, 0xf0, 0x1f, 0xc0, 0x1f, 0xc0, 0x1f,
-};
-
-static char hand_smsk[]={
- 0x00, 0x00, 0x80, 0x01, 0xc0, 0x0f, 0xd8, 0x7f,
- 0xfc, 0xff, 0xfc, 0xff, 0xf8, 0xff, 0xf8, 0xff,
- 0xf6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f,
- 0xfc, 0x7f, 0xf8, 0x3f, 0xf0, 0x3f, 0xe0, 0x3f,
-};
-
-
-static BCursor HandCursor = {
- /*small*/
- hand_sbm, hand_smsk,
- 16, 16,
- 8, 8,
- /*big*/
- NULL, NULL,
- 32,32,
- 15, 15,
- /*color*/
- BC_BLACK, BC_WHITE
-};
-
-BlenderCursor[BC_HANDCURSOR]=&HandCursor;
+ static char hand_sbm[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80, 0x0d,
+ 0x98, 0x6d, 0x98, 0x6d, 0xb0, 0x6d, 0xb0, 0x6d,
+ 0xe0, 0x6f, 0xe6, 0x7f, 0xee, 0x7f, 0xfc, 0x3f,
+ 0xf8, 0x3f, 0xf0, 0x1f, 0xc0, 0x1f, 0xc0, 0x1f,
+ };
+
+ static char hand_smsk[] = {
+ 0x00, 0x00, 0x80, 0x01, 0xc0, 0x0f, 0xd8, 0x7f,
+ 0xfc, 0xff, 0xfc, 0xff, 0xf8, 0xff, 0xf8, 0xff,
+ 0xf6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f,
+ 0xfc, 0x7f, 0xf8, 0x3f, 0xf0, 0x3f, 0xe0, 0x3f,
+ };
+
+
+ static BCursor HandCursor = {
+ /*small*/
+ hand_sbm, hand_smsk,
+ 16, 16,
+ 8, 8,
+ /*big*/
+ NULL, NULL,
+ 32, 32,
+ 15, 15,
+ /*color*/
+ BC_BLACK, BC_WHITE
+ };
+
+ BlenderCursor[BC_HANDCURSOR] = &HandCursor;
END_CURSOR_BLOCK
/********************** NSEW Scroll Cursor ***********************/
BEGIN_CURSOR_BLOCK
-static char nsewscroll_sbm[]={
- 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xc0, 0x03,
- 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x0e, 0x70,
- 0x0e, 0x70, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00,
- 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00,
-};
-
-static char nsewscroll_smsk[]={
- 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07,
- 0xc0, 0x03, 0x0c, 0x30, 0x1e, 0x78, 0x1f, 0xf8,
- 0x1f, 0xf8, 0x1e, 0x78, 0x0c, 0x30, 0xc0, 0x03,
- 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01,
-};
-
-
-static BCursor NSEWScrollCursor = {
- /*small*/
- nsewscroll_sbm, nsewscroll_smsk,
- 16, 16,
- 8, 8,
- /*big*/
- NULL, NULL,
- 32,32,
- 15, 15,
- /*color*/
- BC_BLACK, BC_WHITE
-};
-
-BlenderCursor[BC_NSEW_SCROLLCURSOR]=&NSEWScrollCursor;
+ static char nsewscroll_sbm[] = {
+ 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xc0, 0x03,
+ 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x0e, 0x70,
+ 0x0e, 0x70, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00,
+ 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00,
+ };
+
+ static char nsewscroll_smsk[] = {
+ 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07,
+ 0xc0, 0x03, 0x0c, 0x30, 0x1e, 0x78, 0x1f, 0xf8,
+ 0x1f, 0xf8, 0x1e, 0x78, 0x0c, 0x30, 0xc0, 0x03,
+ 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01,
+ };
+
+
+ static BCursor NSEWScrollCursor = {
+ /*small*/
+ nsewscroll_sbm, nsewscroll_smsk,
+ 16, 16,
+ 8, 8,
+ /*big*/
+ NULL, NULL,
+ 32, 32,
+ 15, 15,
+ /*color*/
+ BC_BLACK, BC_WHITE
+ };
+
+ BlenderCursor[BC_NSEW_SCROLLCURSOR] = &NSEWScrollCursor;
END_CURSOR_BLOCK
@@ -913,35 +918,35 @@ END_CURSOR_BLOCK
/********************** NS Scroll Cursor ***********************/
BEGIN_CURSOR_BLOCK
-static char nsscroll_sbm[]={
- 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xc0, 0x03,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00,
-};
-
-static char nsscroll_smsk[]={
- 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07,
- 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03,
- 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01,
-};
-
-
-static BCursor NSScrollCursor = {
- /*small*/
- nsscroll_sbm, nsscroll_smsk,
- 16, 16,
- 8, 8,
- /*big*/
- NULL, NULL,
- 32,32,
- 15, 15,
- /*color*/
- BC_BLACK, BC_WHITE
-};
-
-BlenderCursor[BC_NS_SCROLLCURSOR]=&NSScrollCursor;
+ static char nsscroll_sbm[] = {
+ 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xc0, 0x03,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00,
+ };
+
+ static char nsscroll_smsk[] = {
+ 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07,
+ 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03,
+ 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01,
+ };
+
+
+ static BCursor NSScrollCursor = {
+ /*small*/
+ nsscroll_sbm, nsscroll_smsk,
+ 16, 16,
+ 8, 8,
+ /*big*/
+ NULL, NULL,
+ 32, 32,
+ 15, 15,
+ /*color*/
+ BC_BLACK, BC_WHITE
+ };
+
+ BlenderCursor[BC_NS_SCROLLCURSOR] = &NSScrollCursor;
END_CURSOR_BLOCK
@@ -949,110 +954,105 @@ END_CURSOR_BLOCK
/********************** EW Scroll Cursor ***********************/
BEGIN_CURSOR_BLOCK
-static char ewscroll_sbm[]={
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x0e, 0x70,
- 0x0e, 0x70, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static char ewscroll_smsk[]={
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0c, 0x30, 0x1e, 0x78, 0x1f, 0xf8,
- 0x1f, 0xf8, 0x1e, 0x78, 0x0c, 0x30, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-
-static BCursor EWScrollCursor = {
- /*small*/
- ewscroll_sbm, ewscroll_smsk,
- 16, 16,
- 8, 8,
- /*big*/
- NULL, NULL,
- 32,32,
- 15, 15,
- /*color*/
- BC_BLACK, BC_WHITE
-};
-
-BlenderCursor[BC_EW_SCROLLCURSOR]=&EWScrollCursor;
+ static char ewscroll_sbm[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x0e, 0x70,
+ 0x0e, 0x70, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ };
+
+ static char ewscroll_smsk[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0c, 0x30, 0x1e, 0x78, 0x1f, 0xf8,
+ 0x1f, 0xf8, 0x1e, 0x78, 0x0c, 0x30, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ };
+
+
+ static BCursor EWScrollCursor = {
+ /*small*/
+ ewscroll_sbm, ewscroll_smsk,
+ 16, 16,
+ 8, 8,
+ /*big*/
+ NULL, NULL,
+ 32, 32,
+ 15, 15,
+ /*color*/
+ BC_BLACK, BC_WHITE
+ };
+
+ BlenderCursor[BC_EW_SCROLLCURSOR] = &EWScrollCursor;
END_CURSOR_BLOCK
/********************** Eyedropper Cursor ***********************/
BEGIN_CURSOR_BLOCK
-static char eyedropper_sbm[]={
- 0x00, 0x30, 0x00, 0x48, 0x00, 0x85, 0x80, 0x82,
- 0x40, 0x40, 0x80, 0x20, 0x40, 0x11, 0xa0, 0x23,
- 0xd0, 0x15, 0xe8, 0x0a, 0x74, 0x01, 0xb4, 0x00,
- 0x4a, 0x00, 0x35, 0x00, 0x08, 0x00, 0x04, 0x00,
-};
-
-static char eyedropper_smsk[]={
- 0x00, 0x30, 0x00, 0x78, 0x00, 0xfd, 0x80, 0xff,
- 0xc0, 0x7f, 0x80, 0x3f, 0xc0, 0x1f, 0xe0, 0x3f,
- 0xf0, 0x1f, 0xf8, 0x0b, 0xfc, 0x01, 0xfc, 0x00,
- 0x7e, 0x00, 0x3f, 0x00, 0x0c, 0x00, 0x04, 0x00,
-};
-
-
-static BCursor EyedropperCursor = {
- /*small*/
- eyedropper_sbm, eyedropper_smsk,
- 16, 16,
- 1, 15,
- /*big*/
- NULL, NULL,
- 32,32,
- 15, 15,
- /*color*/
- BC_BLACK, BC_WHITE
-};
-
-BlenderCursor[BC_EYEDROPPER_CURSOR]=&EyedropperCursor;
+ static char eyedropper_sbm[] = {
+ 0x00, 0x30, 0x00, 0x48, 0x00, 0x85, 0x80, 0x82,
+ 0x40, 0x40, 0x80, 0x20, 0x40, 0x11, 0xa0, 0x23,
+ 0xd0, 0x15, 0xe8, 0x0a, 0x74, 0x01, 0xb4, 0x00,
+ 0x4a, 0x00, 0x35, 0x00, 0x08, 0x00, 0x04, 0x00,
+ };
+
+ static char eyedropper_smsk[] = {
+ 0x00, 0x30, 0x00, 0x78, 0x00, 0xfd, 0x80, 0xff,
+ 0xc0, 0x7f, 0x80, 0x3f, 0xc0, 0x1f, 0xe0, 0x3f,
+ 0xf0, 0x1f, 0xf8, 0x0b, 0xfc, 0x01, 0xfc, 0x00,
+ 0x7e, 0x00, 0x3f, 0x00, 0x0c, 0x00, 0x04, 0x00,
+ };
+
+
+ static BCursor EyedropperCursor = {
+ /*small*/
+ eyedropper_sbm, eyedropper_smsk,
+ 16, 16,
+ 1, 15,
+ /*big*/
+ NULL, NULL,
+ 32, 32,
+ 15, 15,
+ /*color*/
+ BC_BLACK, BC_WHITE
+ };
+
+ BlenderCursor[BC_EYEDROPPER_CURSOR] = &EyedropperCursor;
END_CURSOR_BLOCK
/********************** Swap Area Cursor ***********************/
BEGIN_CURSOR_BLOCK
-static char swap_sbm[]={
- 0xc0, 0xff, 0x40, 0x80, 0x40, 0x80, 0x40, 0x9c,
- 0x40, 0x98, 0x40, 0x94, 0x00, 0x82, 0xfe, 0x80,
- 0x7e, 0xfd, 0xbe, 0x01, 0xda, 0x01, 0xe2, 0x01,
- 0xe2, 0x01, 0xc2, 0x01, 0xfe, 0x01, 0x00, 0x00,
-};
-
-static char swap_smsk[]={
- 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff,
- 0xc0, 0xff, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03,
- 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03,
-};
-
-static BCursor SwapCursor = {
- /*small*/
- swap_sbm, swap_smsk,
- 16, 16,
- 8, 8,
- /*big*/
- NULL, NULL,
- 32,32,
- 15, 15,
- /*color*/
- BC_YELLOW, BC_BLUE
-};
-
-BlenderCursor[BC_SWAPAREA_CURSOR]=&SwapCursor;
-
-END_CURSOR_BLOCK
-/********************** Put the cursors in the array ***********************/
-
+ static char swap_sbm[] = {
+ 0xc0, 0xff, 0x40, 0x80, 0x40, 0x80, 0x40, 0x9c,
+ 0x40, 0x98, 0x40, 0x94, 0x00, 0x82, 0xfe, 0x80,
+ 0x7e, 0xfd, 0xbe, 0x01, 0xda, 0x01, 0xe2, 0x01,
+ 0xe2, 0x01, 0xc2, 0x01, 0xfe, 0x01, 0x00, 0x00,
+ };
+ static char swap_smsk[] = {
+ 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff,
+ 0xc0, 0xff, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03,
+ 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03,
+ };
-}
+ static BCursor SwapCursor = {
+ /*small*/
+ swap_sbm, swap_smsk,
+ 16, 16,
+ 8, 8,
+ /*big*/
+ NULL, NULL,
+ 32, 32,
+ 15, 15,
+ /*color*/
+ BC_YELLOW, BC_BLUE
+ };
+ BlenderCursor[BC_SWAPAREA_CURSOR] = &SwapCursor;
+END_CURSOR_BLOCK
+/********************** Put the cursors in the array ***********************/
+}
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c
index 299266154dd..5283bc0a7a5 100644
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@ -63,7 +63,7 @@
/* ****************************************************** */
-static ListBase dropboxes= {NULL, NULL};
+static ListBase dropboxes = {NULL, NULL};
/* drop box maps are stored global for now */
/* these are part of blender's UI/space specs, and not like keymaps */
@@ -83,15 +83,15 @@ ListBase *WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
{
wmDropBoxMap *dm;
- for(dm= dropboxes.first; dm; dm= dm->next)
- if(dm->spaceid==spaceid && dm->regionid==regionid)
- if(0==strncmp(idname, dm->idname, KMAP_MAX_NAME))
+ for (dm = dropboxes.first; dm; dm = dm->next)
+ if (dm->spaceid == spaceid && dm->regionid == regionid)
+ if (0 == strncmp(idname, dm->idname, KMAP_MAX_NAME))
return &dm->dropboxes;
- dm= MEM_callocN(sizeof(struct wmDropBoxMap), "dropmap list");
+ dm = MEM_callocN(sizeof(struct wmDropBoxMap), "dropmap list");
BLI_strncpy(dm->idname, idname, KMAP_MAX_NAME);
- dm->spaceid= spaceid;
- dm->regionid= regionid;
+ dm->spaceid = spaceid;
+ dm->regionid = regionid;
BLI_addtail(&dropboxes, dm);
return &dm->dropboxes;
@@ -100,16 +100,16 @@ ListBase *WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
wmDropBox *WM_dropbox_add(ListBase *lb, const char *idname, int (*poll)(bContext *, wmDrag *, wmEvent *),
- void (*copy)(wmDrag *, wmDropBox *))
+ void (*copy)(wmDrag *, wmDropBox *))
{
- wmDropBox *drop= MEM_callocN(sizeof(wmDropBox), "wmDropBox");
+ wmDropBox *drop = MEM_callocN(sizeof(wmDropBox), "wmDropBox");
- drop->poll= poll;
- drop->copy= copy;
- drop->ot= WM_operatortype_find(idname, 0);
- drop->opcontext= WM_OP_INVOKE_DEFAULT;
+ drop->poll = poll;
+ drop->copy = copy;
+ drop->ot = WM_operatortype_find(idname, 0);
+ drop->opcontext = WM_OP_INVOKE_DEFAULT;
- if(drop->ot==NULL) {
+ if (drop->ot == NULL) {
MEM_freeN(drop);
printf("Error: dropbox with unknown operator: %s\n", idname);
return NULL;
@@ -125,11 +125,11 @@ void wm_dropbox_free(void)
{
wmDropBoxMap *dm;
- for(dm= dropboxes.first; dm; dm= dm->next) {
+ for (dm = dropboxes.first; dm; dm = dm->next) {
wmDropBox *drop;
- for(drop= dm->dropboxes.first; drop; drop= drop->next) {
- if(drop->ptr) {
+ for (drop = dm->dropboxes.first; drop; drop = drop->next) {
+ if (drop->ptr) {
WM_operator_properties_free(drop->ptr);
MEM_freeN(drop->ptr);
}
@@ -145,41 +145,41 @@ void wm_dropbox_free(void)
/* note that the pointer should be valid allocated and not on stack */
wmDrag *WM_event_start_drag(struct bContext *C, int icon, int type, void *poin, double value)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- wmDrag *drag= MEM_callocN(sizeof(struct wmDrag), "new drag");
+ wmWindowManager *wm = CTX_wm_manager(C);
+ wmDrag *drag = MEM_callocN(sizeof(struct wmDrag), "new drag");
/* keep track of future multitouch drag too, add a mousepointer id or so */
/* if multiple drags are added, they're drawn as list */
BLI_addtail(&wm->drags, drag);
- drag->icon= icon;
- drag->type= type;
- if(type==WM_DRAG_PATH)
+ drag->icon = icon;
+ drag->type = type;
+ if (type == WM_DRAG_PATH)
BLI_strncpy(drag->path, poin, FILE_MAX);
else
- drag->poin= poin;
- drag->value= value;
+ drag->poin = poin;
+ drag->value = value;
return drag;
}
void WM_event_drag_image(wmDrag *drag, ImBuf *imb, float scale, int sx, int sy)
{
- drag->imb= imb;
- drag->scale= scale;
- drag->sx= sx;
- drag->sy= sy;
+ drag->imb = imb;
+ drag->scale = scale;
+ drag->sx = sx;
+ drag->sy = sy;
}
static const char *dropbox_active(bContext *C, ListBase *handlers, wmDrag *drag, wmEvent *event)
{
- wmEventHandler *handler= handlers->first;
- for(; handler; handler= handler->next) {
- if(handler->dropboxes) {
- wmDropBox *drop= handler->dropboxes->first;
- for(; drop; drop= drop->next) {
- if(drop->poll(C, drag, event))
+ wmEventHandler *handler = handlers->first;
+ for (; handler; handler = handler->next) {
+ if (handler->dropboxes) {
+ wmDropBox *drop = handler->dropboxes->first;
+ for (; drop; drop = drop->next) {
+ if (drop->poll(C, drag, event))
return drop->ot->name;
}
}
@@ -190,19 +190,19 @@ static const char *dropbox_active(bContext *C, ListBase *handlers, wmDrag *drag,
/* return active operator name when mouse is in box */
static const char *wm_dropbox_active(bContext *C, wmDrag *drag, wmEvent *event)
{
- wmWindow *win= CTX_wm_window(C);
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= CTX_wm_region(C);
+ wmWindow *win = CTX_wm_window(C);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = CTX_wm_region(C);
const char *name;
- name= dropbox_active(C, &win->handlers, drag, event);
- if(name) return name;
+ name = dropbox_active(C, &win->handlers, drag, event);
+ if (name) return name;
- name= dropbox_active(C, &sa->handlers, drag, event);
- if(name) return name;
+ name = dropbox_active(C, &sa->handlers, drag, event);
+ if (name) return name;
- name= dropbox_active(C, &ar->handlers, drag, event);
- if(name) return name;
+ name = dropbox_active(C, &ar->handlers, drag, event);
+ if (name) return name;
return NULL;
}
@@ -210,22 +210,22 @@ static const char *wm_dropbox_active(bContext *C, wmDrag *drag, wmEvent *event)
static void wm_drop_operator_options(bContext *C, wmDrag *drag, wmEvent *event)
{
- wmWindow *win= CTX_wm_window(C);
+ wmWindow *win = CTX_wm_window(C);
/* for multiwin drags, we only do this if mouse inside */
- if(event->x<0 || event->y<0 || event->x>win->sizex || event->y>win->sizey)
+ if (event->x < 0 || event->y < 0 || event->x > win->sizex || event->y > win->sizey)
return;
- drag->opname[0]= 0;
+ drag->opname[0] = 0;
/* check buttons (XXX todo rna and value) */
- if( UI_but_active_drop_name(C) ) {
+ if (UI_but_active_drop_name(C) ) {
strcpy(drag->opname, "Paste name");
}
else {
- const char *opname= wm_dropbox_active(C, drag, event);
+ const char *opname = wm_dropbox_active(C, drag, event);
- if(opname) {
+ if (opname) {
BLI_strncpy(drag->opname, opname, FILE_MAX);
// WM_cursor_modal(win, CURSOR_COPY);
}
@@ -238,10 +238,10 @@ static void wm_drop_operator_options(bContext *C, wmDrag *drag, wmEvent *event)
/* called in inner handler loop, region context */
void wm_drags_check_ops(bContext *C, wmEvent *event)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
wmDrag *drag;
- for(drag= wm->drags.first; drag; drag= drag->next) {
+ for (drag = wm->drags.first; drag; drag = drag->next) {
wm_drop_operator_options(C, drag, event);
}
}
@@ -250,7 +250,7 @@ void wm_drags_check_ops(bContext *C, wmEvent *event)
static void wm_drop_operator_draw(const char *name, int x, int y)
{
- int width= UI_GetStringWidth(name);
+ int width = UI_GetStringWidth(name);
glColor4ub(0, 0, 0, 50);
@@ -258,16 +258,16 @@ static void wm_drop_operator_draw(const char *name, int x, int y)
uiRoundBox(x, y, x + width + 8, y + 15, 4);
glColor4ub(255, 255, 255, 255);
- UI_DrawString(x+4, y+4, name);
+ UI_DrawString(x + 4, y + 4, name);
}
static const char *wm_drag_name(wmDrag *drag)
{
- switch(drag->type) {
+ switch (drag->type) {
case WM_DRAG_ID:
{
- ID *id= (ID *)drag->poin;
- return id->name+2;
+ ID *id = (ID *)drag->poin;
+ return id->name + 2;
}
case WM_DRAG_PATH:
return drag->path;
@@ -279,71 +279,71 @@ static const char *wm_drag_name(wmDrag *drag)
static void drag_rect_minmax(rcti *rect, int x1, int y1, int x2, int y2)
{
- if(rect->xmin > x1)
- rect->xmin= x1;
- if(rect->xmax < x2)
- rect->xmax= x2;
- if(rect->ymin > y1)
- rect->ymin= y1;
- if(rect->ymax < y2)
- rect->ymax= y2;
+ if (rect->xmin > x1)
+ rect->xmin = x1;
+ if (rect->xmax < x2)
+ rect->xmax = x2;
+ if (rect->ymin > y1)
+ rect->ymin = y1;
+ if (rect->ymax < y2)
+ rect->ymax = y2;
}
/* called in wm_draw.c */
/* if rect set, do not draw */
void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
wmDrag *drag;
int cursorx, cursory, x, y;
- cursorx= win->eventstate->x;
- cursory= win->eventstate->y;
- if(rect) {
- rect->xmin= rect->xmax= cursorx;
- rect->ymin= rect->ymax= cursory;
+ cursorx = win->eventstate->x;
+ cursory = win->eventstate->y;
+ if (rect) {
+ rect->xmin = rect->xmax = cursorx;
+ rect->ymin = rect->ymax = cursory;
}
/* XXX todo, multiline drag draws... but maybe not, more types mixed wont work well */
glEnable(GL_BLEND);
- for(drag= wm->drags.first; drag; drag= drag->next) {
+ for (drag = wm->drags.first; drag; drag = drag->next) {
/* image or icon */
- if(drag->imb) {
- x= cursorx - drag->sx/2;
- y= cursory - drag->sy/2;
+ if (drag->imb) {
+ x = cursorx - drag->sx / 2;
+ y = cursory - drag->sy / 2;
- if(rect)
- drag_rect_minmax(rect, x, y, x+drag->sx, y+drag->sy);
+ if (rect)
+ drag_rect_minmax(rect, x, y, x + drag->sx, y + drag->sy);
else {
- glColor4f(1.0, 1.0, 1.0, 0.65); /* this blends texture */
+ glColor4f(1.0, 1.0, 1.0, 0.65); /* this blends texture */
glaDrawPixelsTexScaled(x, y, drag->imb->x, drag->imb->y, GL_UNSIGNED_BYTE, drag->imb->rect, drag->scale, drag->scale);
}
}
else {
- x= cursorx - 8;
- y= cursory - 2;
+ x = cursorx - 8;
+ y = cursory - 2;
/* icons assumed to be 16 pixels */
- if(rect)
- drag_rect_minmax(rect, x, y, x+16, y+16);
+ if (rect)
+ drag_rect_minmax(rect, x, y, x + 16, y + 16);
else
UI_icon_draw_aspect(x, y, drag->icon, 1.0, 0.8);
}
/* item name */
- if(drag->imb) {
- x= cursorx - drag->sx/2;
- y= cursory - drag->sy/2 - 16;
+ if (drag->imb) {
+ x = cursorx - drag->sx / 2;
+ y = cursory - drag->sy / 2 - 16;
}
else {
- x= cursorx + 10;
- y= cursory + 1;
+ x = cursorx + 10;
+ y = cursory + 1;
}
- if(rect) {
- int w= UI_GetStringWidth(wm_drag_name(drag));
- drag_rect_minmax(rect, x, y, x+w, y+16);
+ if (rect) {
+ int w = UI_GetStringWidth(wm_drag_name(drag));
+ drag_rect_minmax(rect, x, y, x + w, y + 16);
}
else {
glColor4ub(255, 255, 255, 255);
@@ -351,19 +351,19 @@ void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect)
}
/* operator name with roundbox */
- if(drag->opname[0]) {
- if(drag->imb) {
- x= cursorx - drag->sx/2;
- y= cursory + drag->sy/2 + 4;
+ if (drag->opname[0]) {
+ if (drag->imb) {
+ x = cursorx - drag->sx / 2;
+ y = cursory + drag->sy / 2 + 4;
}
else {
- x= cursorx - 8;
- y= cursory + 16;
+ x = cursorx - 8;
+ y = cursory + 16;
}
- if(rect) {
- int w= UI_GetStringWidth(wm_drag_name(drag));
- drag_rect_minmax(rect, x, y, x+w, y+16);
+ if (rect) {
+ int w = UI_GetStringWidth(wm_drag_name(drag));
+ drag_rect_minmax(rect, x, y, x + w, y + 16);
}
else
wm_drop_operator_draw(drag->opname, x, y);
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index df4ebfd9b9f..66cadf1e76a 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -66,27 +66,27 @@
#include "wm_event_system.h"
/* swap */
-#define WIN_NONE_OK 0
+#define WIN_NONE_OK 0
#define WIN_BACK_OK 1
#define WIN_FRONT_OK 2
-#define WIN_BOTH_OK 3
+#define WIN_BOTH_OK 3
/* ******************* drawing, overlays *************** */
static void wm_paintcursor_draw(bContext *C, ARegion *ar)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
- if(wm->paintcursors.first) {
- wmWindow *win= CTX_wm_window(C);
- bScreen *screen= win->screen;
+ if (wm->paintcursors.first) {
+ wmWindow *win = CTX_wm_window(C);
+ bScreen *screen = win->screen;
wmPaintCursor *pc;
- if(screen->subwinactive == ar->swinid) {
- for(pc= wm->paintcursors.first; pc; pc= pc->next) {
- if(pc->poll == NULL || pc->poll(C)) {
- ARegion *ar_other= CTX_wm_region(C);
+ if (screen->subwinactive == ar->swinid) {
+ for (pc = wm->paintcursors.first; pc; pc = pc->next) {
+ if (pc->poll == NULL || pc->poll(C)) {
+ ARegion *ar_other = CTX_wm_region(C);
if (ELEM(win->grabcursor, GHOST_kGrabWrap, GHOST_kGrabHide)) {
int x = 0, y = 0;
wm_get_cursor_position(win, &x, &y);
@@ -111,25 +111,25 @@ static void wm_paintcursor_draw(bContext *C, ARegion *ar)
static void wm_area_mark_invalid_backbuf(ScrArea *sa)
{
- if(sa->spacetype == SPACE_VIEW3D)
- ((View3D*)sa->spacedata.first)->flag |= V3D_INVALID_BACKBUF;
+ if (sa->spacetype == SPACE_VIEW3D)
+ ((View3D *)sa->spacedata.first)->flag |= V3D_INVALID_BACKBUF;
}
static int wm_area_test_invalid_backbuf(ScrArea *sa)
{
- if(sa->spacetype == SPACE_VIEW3D)
- return (((View3D*)sa->spacedata.first)->flag & V3D_INVALID_BACKBUF);
+ if (sa->spacetype == SPACE_VIEW3D)
+ return (((View3D *)sa->spacedata.first)->flag & V3D_INVALID_BACKBUF);
else
return 1;
}
static void wm_region_test_render_do_draw(ScrArea *sa, ARegion *ar)
{
- if(sa->spacetype == SPACE_VIEW3D) {
+ if (sa->spacetype == SPACE_VIEW3D) {
RegionView3D *rv3d = ar->regiondata;
- RenderEngine *engine = (rv3d)? rv3d->render_engine: NULL;
+ RenderEngine *engine = (rv3d) ? rv3d->render_engine : NULL;
- if(engine && (engine->flag & RE_ENGINE_DO_DRAW)) {
+ if (engine && (engine->flag & RE_ENGINE_DO_DRAW)) {
ar->do_draw = 1;
engine->flag &= ~RE_ENGINE_DO_DRAW;
}
@@ -141,16 +141,16 @@ static void wm_region_test_render_do_draw(ScrArea *sa, ARegion *ar)
static void wm_method_draw_full(bContext *C, wmWindow *win)
{
- bScreen *screen= win->screen;
+ bScreen *screen = win->screen;
ScrArea *sa;
ARegion *ar;
/* draw area regions */
- for(sa= screen->areabase.first; sa; sa= sa->next) {
+ for (sa = screen->areabase.first; sa; sa = sa->next) {
CTX_wm_area_set(C, sa);
- for(ar=sa->regionbase.first; ar; ar= ar->next) {
- if(ar->swinid) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar->swinid) {
CTX_wm_region_set(C, ar);
ED_region_do_draw(C, ar);
wm_paintcursor_draw(C, ar);
@@ -167,15 +167,15 @@ static void wm_method_draw_full(bContext *C, wmWindow *win)
ED_area_overdraw(C);
/* draw overlapping regions */
- for(ar=screen->regionbase.first; ar; ar= ar->next) {
- if(ar->swinid) {
+ for (ar = screen->regionbase.first; ar; ar = ar->next) {
+ if (ar->swinid) {
CTX_wm_menu_set(C, ar);
ED_region_do_draw(C, ar);
CTX_wm_menu_set(C, NULL);
}
}
- if(screen->do_draw_gesture)
+ if (screen->do_draw_gesture)
wm_gesture_draw(win);
}
@@ -191,12 +191,12 @@ static void wm_flush_regions_down(bScreen *screen, rcti *dirty)
ScrArea *sa;
ARegion *ar;
- for(sa= screen->areabase.first; sa; sa= sa->next) {
- for(ar= sa->regionbase.first; ar; ar= ar->next) {
- if(BLI_isect_rcti(dirty, &ar->winrct, NULL)) {
- ar->do_draw= RGN_DRAW;
+ for (sa = screen->areabase.first; sa; sa = sa->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (BLI_isect_rcti(dirty, &ar->winrct, NULL)) {
+ ar->do_draw = RGN_DRAW;
memset(&ar->drawrct, 0, sizeof(ar->drawrct));
- ar->swap= WIN_NONE_OK;
+ ar->swap = WIN_NONE_OK;
}
}
}
@@ -207,88 +207,88 @@ static void wm_flush_regions_up(bScreen *screen, rcti *dirty)
{
ARegion *ar;
- for(ar= screen->regionbase.first; ar; ar= ar->next) {
- if(BLI_isect_rcti(dirty, &ar->winrct, NULL)) {
- ar->do_draw= RGN_DRAW;
+ for (ar = screen->regionbase.first; ar; ar = ar->next) {
+ if (BLI_isect_rcti(dirty, &ar->winrct, NULL)) {
+ ar->do_draw = RGN_DRAW;
memset(&ar->drawrct, 0, sizeof(ar->drawrct));
- ar->swap= WIN_NONE_OK;
+ ar->swap = WIN_NONE_OK;
}
}
}
static void wm_method_draw_overlap_all(bContext *C, wmWindow *win, int exchange)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- bScreen *screen= win->screen;
+ wmWindowManager *wm = CTX_wm_manager(C);
+ bScreen *screen = win->screen;
ScrArea *sa;
ARegion *ar;
- static rcti rect= {0, 0, 0, 0};
+ static rcti rect = {0, 0, 0, 0};
/* after backbuffer selection draw, we need to redraw */
- for(sa= screen->areabase.first; sa; sa= sa->next)
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->swinid && !wm_area_test_invalid_backbuf(sa))
+ for (sa = screen->areabase.first; sa; sa = sa->next)
+ for (ar = sa->regionbase.first; ar; ar = ar->next)
+ if (ar->swinid && !wm_area_test_invalid_backbuf(sa))
ED_region_tag_redraw(ar);
/* flush overlapping regions */
- if(screen->regionbase.first) {
+ if (screen->regionbase.first) {
/* flush redraws of area regions up to overlapping regions */
- for(sa= screen->areabase.first; sa; sa= sa->next)
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->swinid && ar->do_draw)
+ for (sa = screen->areabase.first; sa; sa = sa->next)
+ for (ar = sa->regionbase.first; ar; ar = ar->next)
+ if (ar->swinid && ar->do_draw)
wm_flush_regions_up(screen, &ar->winrct);
/* flush between overlapping regions */
- for(ar= screen->regionbase.last; ar; ar= ar->prev)
- if(ar->swinid && ar->do_draw)
+ for (ar = screen->regionbase.last; ar; ar = ar->prev)
+ if (ar->swinid && ar->do_draw)
wm_flush_regions_up(screen, &ar->winrct);
/* flush redraws of overlapping regions down to area regions */
- for(ar= screen->regionbase.last; ar; ar= ar->prev)
- if(ar->swinid && ar->do_draw)
+ for (ar = screen->regionbase.last; ar; ar = ar->prev)
+ if (ar->swinid && ar->do_draw)
wm_flush_regions_down(screen, &ar->winrct);
}
/* flush drag item */
- if(rect.xmin!=rect.xmax) {
+ if (rect.xmin != rect.xmax) {
wm_flush_regions_down(screen, &rect);
- rect.xmin= rect.xmax = 0;
+ rect.xmin = rect.xmax = 0;
}
- if(wm->drags.first) {
+ if (wm->drags.first) {
/* doesnt draw, fills rect with boundbox */
wm_drags_draw(C, win, &rect);
}
/* draw marked area regions */
- for(sa= screen->areabase.first; sa; sa= sa->next) {
+ for (sa = screen->areabase.first; sa; sa = sa->next) {
CTX_wm_area_set(C, sa);
- for(ar=sa->regionbase.first; ar; ar= ar->next) {
- if(ar->swinid) {
- if(ar->do_draw) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar->swinid) {
+ if (ar->do_draw) {
CTX_wm_region_set(C, ar);
ED_region_do_draw(C, ar);
wm_paintcursor_draw(C, ar);
ED_area_overdraw_flush(sa, ar);
CTX_wm_region_set(C, NULL);
- if(exchange)
- ar->swap= WIN_FRONT_OK;
+ if (exchange)
+ ar->swap = WIN_FRONT_OK;
}
- else if(exchange) {
- if(ar->swap == WIN_FRONT_OK) {
+ else if (exchange) {
+ if (ar->swap == WIN_FRONT_OK) {
CTX_wm_region_set(C, ar);
ED_region_do_draw(C, ar);
wm_paintcursor_draw(C, ar);
ED_area_overdraw_flush(sa, ar);
CTX_wm_region_set(C, NULL);
- ar->swap= WIN_BOTH_OK;
+ ar->swap = WIN_BOTH_OK;
}
- else if(ar->swap == WIN_BACK_OK)
- ar->swap= WIN_FRONT_OK;
- else if(ar->swap == WIN_BOTH_OK)
- ar->swap= WIN_BOTH_OK;
+ else if (ar->swap == WIN_BACK_OK)
+ ar->swap = WIN_FRONT_OK;
+ else if (ar->swap == WIN_BOTH_OK)
+ ar->swap = WIN_BOTH_OK;
}
}
}
@@ -298,39 +298,39 @@ static void wm_method_draw_overlap_all(bContext *C, wmWindow *win, int exchange)
}
/* after area regions so we can do area 'overlay' drawing */
- if(screen->do_draw) {
+ if (screen->do_draw) {
ED_screen_draw(win);
- if(exchange)
- screen->swap= WIN_FRONT_OK;
+ if (exchange)
+ screen->swap = WIN_FRONT_OK;
}
- else if(exchange) {
- if(screen->swap==WIN_FRONT_OK) {
+ else if (exchange) {
+ if (screen->swap == WIN_FRONT_OK) {
ED_screen_draw(win);
- screen->swap= WIN_BOTH_OK;
+ screen->swap = WIN_BOTH_OK;
}
- else if(screen->swap==WIN_BACK_OK)
- screen->swap= WIN_FRONT_OK;
- else if(screen->swap==WIN_BOTH_OK)
- screen->swap= WIN_BOTH_OK;
+ else if (screen->swap == WIN_BACK_OK)
+ screen->swap = WIN_FRONT_OK;
+ else if (screen->swap == WIN_BOTH_OK)
+ screen->swap = WIN_BOTH_OK;
}
ED_area_overdraw(C);
/* draw marked overlapping regions */
- for(ar=screen->regionbase.first; ar; ar= ar->next) {
- if(ar->swinid && ar->do_draw) {
+ for (ar = screen->regionbase.first; ar; ar = ar->next) {
+ if (ar->swinid && ar->do_draw) {
CTX_wm_menu_set(C, ar);
ED_region_do_draw(C, ar);
CTX_wm_menu_set(C, NULL);
}
}
- if(screen->do_draw_gesture)
+ if (screen->do_draw_gesture)
wm_gesture_draw(win);
/* needs pixel coords in screen */
- if(wm->drags.first) {
+ if (wm->drags.first) {
wm_drags_draw(C, win, NULL);
}
}
@@ -357,7 +357,7 @@ static void wm_method_draw_damage(bContext *C, wmWindow *win)
#define MAX_N_TEX 3
typedef struct wmDrawTriple {
- GLuint bind[MAX_N_TEX*MAX_N_TEX];
+ GLuint bind[MAX_N_TEX * MAX_N_TEX];
int x[MAX_N_TEX], y[MAX_N_TEX];
int nx, ny;
GLenum target;
@@ -368,47 +368,47 @@ static void split_width(int x, int n, int *splitx, int *nx)
int a, newnx, waste;
/* if already power of two just use it */
- if(is_power_of_2_i(x)) {
- splitx[0]= x;
+ if (is_power_of_2_i(x)) {
+ splitx[0] = x;
(*nx)++;
return;
}
- if(n == 1) {
+ if (n == 1) {
/* last part, we have to go larger */
- splitx[0]= power_of_2_max_i(x);
+ splitx[0] = power_of_2_max_i(x);
(*nx)++;
}
else {
/* two or more parts to go, use smaller part */
- splitx[0]= power_of_2_min_i(x);
- newnx= ++(*nx);
- split_width(x-splitx[0], n-1, splitx+1, &newnx);
+ splitx[0] = power_of_2_min_i(x);
+ newnx = ++(*nx);
+ split_width(x - splitx[0], n - 1, splitx + 1, &newnx);
- for(waste=0, a=0; a<n; a++)
+ for (waste = 0, a = 0; a < n; a++)
waste += splitx[a];
/* if we waste more space or use the same amount,
* revert deeper splits and just use larger */
- if(waste >= power_of_2_max_i(x)) {
- splitx[0]= power_of_2_max_i(x);
- memset(splitx+1, 0, sizeof(int)*(n-1));
+ if (waste >= power_of_2_max_i(x)) {
+ splitx[0] = power_of_2_max_i(x);
+ memset(splitx + 1, 0, sizeof(int) * (n - 1));
}
else
- *nx= newnx;
+ *nx = newnx;
}
}
static void wm_draw_triple_free(wmWindow *win)
{
- if(win->drawdata) {
- wmDrawTriple *triple= win->drawdata;
+ if (win->drawdata) {
+ wmDrawTriple *triple = win->drawdata;
- glDeleteTextures(triple->nx*triple->ny, triple->bind);
+ glDeleteTextures(triple->nx * triple->ny, triple->bind);
MEM_freeN(triple);
- win->drawdata= NULL;
+ win->drawdata = NULL;
}
}
@@ -416,7 +416,7 @@ static void wm_draw_triple_fail(bContext *C, wmWindow *win)
{
wm_draw_window_clear(win);
- win->drawfail= 1;
+ win->drawfail = 1;
wm_method_draw_overlap_all(C, win, 0);
}
@@ -426,44 +426,44 @@ static int wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple)
int x, y;
/* compute texture sizes */
- if(GLEW_ARB_texture_rectangle || GLEW_NV_texture_rectangle || GLEW_EXT_texture_rectangle) {
- triple->target= GL_TEXTURE_RECTANGLE_ARB;
- triple->nx= 1;
- triple->ny= 1;
- triple->x[0]= win->sizex;
- triple->y[0]= win->sizey;
- }
- else if(GPU_non_power_of_two_support()) {
- triple->target= GL_TEXTURE_2D;
- triple->nx= 1;
- triple->ny= 1;
- triple->x[0]= win->sizex;
- triple->y[0]= win->sizey;
+ if (GLEW_ARB_texture_rectangle || GLEW_NV_texture_rectangle || GLEW_EXT_texture_rectangle) {
+ triple->target = GL_TEXTURE_RECTANGLE_ARB;
+ triple->nx = 1;
+ triple->ny = 1;
+ triple->x[0] = win->sizex;
+ triple->y[0] = win->sizey;
+ }
+ else if (GPU_non_power_of_two_support()) {
+ triple->target = GL_TEXTURE_2D;
+ triple->nx = 1;
+ triple->ny = 1;
+ triple->x[0] = win->sizex;
+ triple->y[0] = win->sizey;
}
else {
- triple->target= GL_TEXTURE_2D;
- triple->nx= 0;
- triple->ny= 0;
+ triple->target = GL_TEXTURE_2D;
+ triple->nx = 0;
+ triple->ny = 0;
split_width(win->sizex, MAX_N_TEX, triple->x, &triple->nx);
split_width(win->sizey, MAX_N_TEX, triple->y, &triple->ny);
}
/* generate texture names */
- glGenTextures(triple->nx*triple->ny, triple->bind);
+ glGenTextures(triple->nx * triple->ny, triple->bind);
- if(!triple->bind[0]) {
+ if (!triple->bind[0]) {
/* not the typical failure case but we handle it anyway */
printf("WM: failed to allocate texture for triple buffer drawing (glGenTextures).\n");
return 0;
}
- for(y=0; y<triple->ny; y++) {
- for(x=0; x<triple->nx; x++) {
+ for (y = 0; y < triple->ny; y++) {
+ for (x = 0; x < triple->nx; x++) {
/* proxy texture is only guaranteed to test for the cases that
* there is only one texture in use, which may not be the case */
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
- if(triple->x[x] > maxsize || triple->y[y] > maxsize) {
+ if (triple->x[x] > maxsize || triple->y[y] > maxsize) {
glBindTexture(triple->target, 0);
printf("WM: failed to allocate texture for triple buffer drawing "
"(texture too large for graphics card).\n");
@@ -471,7 +471,7 @@ static int wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple)
}
/* setup actual texture */
- glBindTexture(triple->target, triple->bind[x + y*triple->nx]);
+ glBindTexture(triple->target, triple->bind[x + y * triple->nx]);
glTexImage2D(triple->target, 0, GL_RGB8, triple->x[x], triple->y[y], 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(triple->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(triple->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -480,7 +480,7 @@ static int wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple)
glBindTexture(triple->target, 0);
/* not sure if this works everywhere .. */
- if(glGetError() == GL_OUT_OF_MEMORY) {
+ if (glGetError() == GL_OUT_OF_MEMORY) {
printf("WM: failed to allocate texture for triple buffer drawing (out of memory).\n");
return 0;
}
@@ -497,40 +497,40 @@ static void wm_triple_draw_textures(wmWindow *win, wmDrawTriple *triple)
glEnable(triple->target);
- for(y=0, offy=0; y<triple->ny; offy+=triple->y[y], y++) {
- for(x=0, offx=0; x<triple->nx; offx+=triple->x[x], x++) {
- sizex= (x == triple->nx-1)? win->sizex-offx: triple->x[x];
- sizey= (y == triple->ny-1)? win->sizey-offy: triple->y[y];
+ for (y = 0, offy = 0; y < triple->ny; offy += triple->y[y], y++) {
+ for (x = 0, offx = 0; x < triple->nx; offx += triple->x[x], x++) {
+ sizex = (x == triple->nx - 1) ? win->sizex - offx : triple->x[x];
+ sizey = (y == triple->ny - 1) ? win->sizey - offy : triple->y[y];
/* wmOrtho for the screen has this same offset */
- ratiox= sizex;
- ratioy= sizey;
- halfx= 0.375f;
- halfy= 0.375f;
+ ratiox = sizex;
+ ratioy = sizey;
+ halfx = 0.375f;
+ halfy = 0.375f;
/* texture rectangle has unnormalized coordinates */
- if(triple->target == GL_TEXTURE_2D) {
+ if (triple->target == GL_TEXTURE_2D) {
ratiox /= triple->x[x];
ratioy /= triple->y[y];
halfx /= triple->x[x];
halfy /= triple->y[y];
}
- glBindTexture(triple->target, triple->bind[x + y*triple->nx]);
+ glBindTexture(triple->target, triple->bind[x + y * triple->nx]);
glColor3f(1.0f, 1.0f, 1.0f);
glBegin(GL_QUADS);
- glTexCoord2f(halfx, halfy);
- glVertex2f(offx, offy);
+ glTexCoord2f(halfx, halfy);
+ glVertex2f(offx, offy);
- glTexCoord2f(ratiox+halfx, halfy);
- glVertex2f(offx+sizex, offy);
+ glTexCoord2f(ratiox + halfx, halfy);
+ glVertex2f(offx + sizex, offy);
- glTexCoord2f(ratiox+halfx, ratioy+halfy);
- glVertex2f(offx+sizex, offy+sizey);
+ glTexCoord2f(ratiox + halfx, ratioy + halfy);
+ glVertex2f(offx + sizex, offy + sizey);
- glTexCoord2f(halfx, ratioy+halfy);
- glVertex2f(offx, offy+sizey);
+ glTexCoord2f(halfx, ratioy + halfy);
+ glVertex2f(offx, offy + sizey);
glEnd();
}
}
@@ -543,12 +543,12 @@ static void wm_triple_copy_textures(wmWindow *win, wmDrawTriple *triple)
{
int x, y, sizex, sizey, offx, offy;
- for(y=0, offy=0; y<triple->ny; offy+=triple->y[y], y++) {
- for(x=0, offx=0; x<triple->nx; offx+=triple->x[x], x++) {
- sizex= (x == triple->nx-1)? win->sizex-offx: triple->x[x];
- sizey= (y == triple->ny-1)? win->sizey-offy: triple->y[y];
+ for (y = 0, offy = 0; y < triple->ny; offy += triple->y[y], y++) {
+ for (x = 0, offx = 0; x < triple->nx; offx += triple->x[x], x++) {
+ sizex = (x == triple->nx - 1) ? win->sizex - offx : triple->x[x];
+ sizey = (y == triple->ny - 1) ? win->sizey - offy : triple->y[y];
- glBindTexture(triple->target, triple->bind[x + y*triple->nx]);
+ glBindTexture(triple->target, triple->bind[x + y * triple->nx]);
glCopyTexSubImage2D(triple->target, 0, 0, 0, offx, offy, sizex, sizey);
}
}
@@ -558,44 +558,43 @@ static void wm_triple_copy_textures(wmWindow *win, wmDrawTriple *triple)
static void wm_method_draw_triple(bContext *C, wmWindow *win)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
wmDrawTriple *triple;
- bScreen *screen= win->screen;
+ bScreen *screen = win->screen;
ScrArea *sa;
ARegion *ar;
- int copytex= 0, paintcursor= 1;
+ int copytex = 0, paintcursor = 1;
- if(win->drawdata) {
+ if (win->drawdata) {
glClearColor(0, 0, 0, 0);
- glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
wmSubWindowSet(win, screen->mainwin);
wm_triple_draw_textures(win, win->drawdata);
}
else {
- win->drawdata= MEM_callocN(sizeof(wmDrawTriple), "wmDrawTriple");
+ 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;
}
}
- triple= win->drawdata;
+ triple = win->drawdata;
/* draw marked area regions */
- for(sa= screen->areabase.first; sa; sa= sa->next) {
+ for (sa = screen->areabase.first; sa; sa = sa->next) {
CTX_wm_area_set(C, sa);
- for(ar=sa->regionbase.first; ar; ar= ar->next) {
- if(ar->swinid && ar->do_draw) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar->swinid && ar->do_draw) {
CTX_wm_region_set(C, ar);
ED_region_do_draw(C, ar);
ED_area_overdraw_flush(sa, ar);
CTX_wm_region_set(C, NULL);
- copytex= 1;
+ copytex = 1;
}
}
@@ -603,7 +602,7 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win)
CTX_wm_area_set(C, NULL);
}
- if(copytex) {
+ if (copytex) {
wmSubWindowSet(win, screen->mainwin);
ED_area_overdraw(C);
@@ -614,24 +613,24 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win)
ED_screen_draw(win);
/* draw overlapping regions */
- for(ar=screen->regionbase.first; ar; ar= ar->next) {
- if(ar->swinid) {
+ for (ar = screen->regionbase.first; ar; ar = ar->next) {
+ if (ar->swinid) {
CTX_wm_menu_set(C, ar);
ED_region_do_draw(C, ar);
CTX_wm_menu_set(C, NULL);
/* when a menu is being drawn, don't do the paint cursors */
- paintcursor= 0;
+ paintcursor = 0;
}
}
/* always draw, not only when screen tagged */
- if(win->gesture.first)
+ if (win->gesture.first)
wm_gesture_draw(win);
- if(paintcursor && wm->paintcursors.first) {
- for(sa= screen->areabase.first; sa; sa= sa->next) {
- for(ar=sa->regionbase.first; ar; ar= ar->next) {
- if(ar->swinid == screen->subwinactive) {
+ if (paintcursor && wm->paintcursors.first) {
+ for (sa = screen->areabase.first; sa; sa = sa->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar->swinid == screen->subwinactive) {
CTX_wm_area_set(C, sa);
CTX_wm_region_set(C, ar);
@@ -649,7 +648,7 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win)
}
/* needs pixel coords in screen */
- if(wm->drags.first) {
+ if (wm->drags.first) {
wm_drags_draw(C, win, NULL);
}
@@ -662,38 +661,38 @@ static int wm_draw_update_test_window(wmWindow *win)
{
ScrArea *sa;
ARegion *ar;
- int do_draw= 0;
+ int do_draw = 0;
- for(ar= win->screen->regionbase.first; ar; ar= ar->next) {
- if(ar->do_draw_overlay) {
+ for (ar = win->screen->regionbase.first; ar; ar = ar->next) {
+ if (ar->do_draw_overlay) {
wm_tag_redraw_overlay(win, ar);
- ar->do_draw_overlay= 0;
+ ar->do_draw_overlay = 0;
}
- if(ar->swinid && ar->do_draw)
- do_draw= 1;
+ if (ar->swinid && ar->do_draw)
+ do_draw = 1;
}
- for(sa= win->screen->areabase.first; sa; sa= sa->next) {
- for(ar=sa->regionbase.first; ar; ar= ar->next) {
+ for (sa = win->screen->areabase.first; sa; sa = sa->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
wm_region_test_render_do_draw(sa, ar);
- if(ar->swinid && ar->do_draw)
+ if (ar->swinid && ar->do_draw)
do_draw = 1;
}
}
- if(do_draw)
+ if (do_draw)
return 1;
- if(win->screen->do_refresh)
+ if (win->screen->do_refresh)
return 1;
- if(win->screen->do_draw)
+ if (win->screen->do_draw)
return 1;
- if(win->screen->do_draw_gesture)
+ if (win->screen->do_draw_gesture)
return 1;
- if(win->screen->do_draw_paintcursor)
+ if (win->screen->do_draw_paintcursor)
return 1;
- if(win->screen->do_draw_drag)
+ if (win->screen->do_draw_drag)
return 1;
return 0;
@@ -702,28 +701,28 @@ 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) {
+ if (win->drawmethod == USER_DRAW_AUTOMATIC) {
/* ATI opensource driver is known to be very slow at this */
- if(GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE))
+ if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE))
return USER_DRAW_OVERLAP;
/* also Intel drivers are slow */
- else if(GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_UNIX, GPU_DRIVER_ANY))
+ else if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_UNIX, GPU_DRIVER_ANY))
return USER_DRAW_OVERLAP;
- else if(GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_WIN, GPU_DRIVER_ANY))
+ else if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_WIN, GPU_DRIVER_ANY))
return USER_DRAW_OVERLAP_FLIP;
- else if(GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_MAC, GPU_DRIVER_ANY))
+ else if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_MAC, GPU_DRIVER_ANY))
return USER_DRAW_OVERLAP_FLIP;
/* Windows software driver darkens color on each redraw */
- else if(GPU_type_matches(GPU_DEVICE_SOFTWARE, GPU_OS_WIN, GPU_DRIVER_SOFTWARE))
+ else if (GPU_type_matches(GPU_DEVICE_SOFTWARE, GPU_OS_WIN, GPU_DRIVER_SOFTWARE))
return USER_DRAW_OVERLAP_FLIP;
- else if(GPU_type_matches(GPU_DEVICE_SOFTWARE, GPU_OS_UNIX, GPU_DRIVER_SOFTWARE))
+ else if (GPU_type_matches(GPU_DEVICE_SOFTWARE, GPU_OS_UNIX, GPU_DRIVER_SOFTWARE))
return USER_DRAW_OVERLAP;
/* drawing lower color depth again degrades colors each time */
- else if(GPU_color_depth() < 24)
+ else if (GPU_color_depth() < 24)
return USER_DRAW_OVERLAP;
else
return USER_DRAW_TRIPLE;
@@ -735,53 +734,53 @@ static int wm_automatic_draw_method(wmWindow *win)
void wm_tag_redraw_overlay(wmWindow *win, ARegion *ar)
{
/* for draw triple gestures, paint cursors don't need region redraw */
- if(ar && win) {
- if(wm_automatic_draw_method(win) != USER_DRAW_TRIPLE)
+ if (ar && win) {
+ if (wm_automatic_draw_method(win) != USER_DRAW_TRIPLE)
ED_region_tag_redraw(ar);
- win->screen->do_draw_paintcursor= 1;
+ win->screen->do_draw_paintcursor = 1;
}
}
void wm_draw_update(bContext *C)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
wmWindow *win;
int drawmethod;
GPU_free_unused_buffers();
- for(win= wm->windows.first; win; win= win->next) {
- if(win->drawmethod != U.wmdrawmethod) {
+ for (win = wm->windows.first; win; win = win->next) {
+ if (win->drawmethod != U.wmdrawmethod) {
wm_draw_window_clear(win);
- win->drawmethod= U.wmdrawmethod;
+ win->drawmethod = U.wmdrawmethod;
}
- if(wm_draw_update_test_window(win)) {
+ if (wm_draw_update_test_window(win)) {
CTX_wm_window_set(C, win);
/* sets context window+screen */
wm_window_make_drawable(C, win);
/* notifiers for screen redraw */
- if(win->screen->do_refresh)
+ if (win->screen->do_refresh)
ED_screen_refresh(wm, win);
- drawmethod= wm_automatic_draw_method(win);
+ drawmethod = wm_automatic_draw_method(win);
- if(win->drawfail)
+ if (win->drawfail)
wm_method_draw_overlap_all(C, win, 0);
- else if(drawmethod == USER_DRAW_FULL)
+ else if (drawmethod == USER_DRAW_FULL)
wm_method_draw_full(C, win);
- else if(drawmethod == USER_DRAW_OVERLAP)
+ else if (drawmethod == USER_DRAW_OVERLAP)
wm_method_draw_overlap_all(C, win, 0);
- else if(drawmethod == USER_DRAW_OVERLAP_FLIP)
+ else if (drawmethod == USER_DRAW_OVERLAP_FLIP)
wm_method_draw_overlap_all(C, win, 1);
- else // if(drawmethod == USER_DRAW_TRIPLE)
+ else // if (drawmethod == USER_DRAW_TRIPLE)
wm_method_draw_triple(C, win);
- win->screen->do_draw_gesture= 0;
- win->screen->do_draw_paintcursor= 0;
- win->screen->do_draw_drag= 0;
+ win->screen->do_draw_gesture = 0;
+ win->screen->do_draw_paintcursor = 0;
+ win->screen->do_draw_drag = 0;
wm_window_swap_buffers(win);
@@ -792,39 +791,39 @@ void wm_draw_update(bContext *C)
void wm_draw_window_clear(wmWindow *win)
{
- bScreen *screen= win->screen;
+ bScreen *screen = win->screen;
ScrArea *sa;
ARegion *ar;
- int drawmethod= wm_automatic_draw_method(win);
+ int drawmethod = wm_automatic_draw_method(win);
- if(drawmethod == USER_DRAW_TRIPLE)
+ if (drawmethod == USER_DRAW_TRIPLE)
wm_draw_triple_free(win);
/* clear screen swap flags */
- if(screen) {
- for(sa= screen->areabase.first; sa; sa= sa->next)
- for(ar=sa->regionbase.first; ar; ar= ar->next)
- ar->swap= WIN_NONE_OK;
+ if (screen) {
+ for (sa = screen->areabase.first; sa; sa = sa->next)
+ for (ar = sa->regionbase.first; ar; ar = ar->next)
+ ar->swap = WIN_NONE_OK;
- screen->swap= WIN_NONE_OK;
+ screen->swap = WIN_NONE_OK;
}
}
void wm_draw_region_clear(wmWindow *win, ARegion *ar)
{
- int drawmethod= wm_automatic_draw_method(win);
+ int drawmethod = wm_automatic_draw_method(win);
- if(ELEM(drawmethod, USER_DRAW_OVERLAP, USER_DRAW_OVERLAP_FLIP))
+ if (ELEM(drawmethod, USER_DRAW_OVERLAP, USER_DRAW_OVERLAP_FLIP))
wm_flush_regions_down(win->screen, &ar->winrct);
- win->screen->do_draw= 1;
+ win->screen->do_draw = 1;
}
void WM_redraw_windows(bContext *C)
{
- wmWindow *win_prev= CTX_wm_window(C);
- ScrArea *area_prev= CTX_wm_area(C);
- ARegion *ar_prev= CTX_wm_region(C);
+ wmWindow *win_prev = CTX_wm_window(C);
+ ScrArea *area_prev = CTX_wm_area(C);
+ ARegion *ar_prev = CTX_wm_region(C);
wm_draw_update(C);
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index d78faa76855..42fb03d5d64 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -89,18 +89,18 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA
void wm_event_add(wmWindow *win, wmEvent *event_to_add)
{
- wmEvent *event= MEM_callocN(sizeof(wmEvent), "wmEvent");
+ wmEvent *event = MEM_callocN(sizeof(wmEvent), "wmEvent");
- *event= *event_to_add;
+ *event = *event_to_add;
BLI_addtail(&win->queue, event);
}
void wm_event_free(wmEvent *event)
{
- if(event->customdata) {
- if(event->customdatafree) {
+ if (event->customdata) {
+ if (event->customdatafree) {
/* note: pointer to listbase struct elsewhere */
- if(event->custom==EVT_DATA_LISTBASE)
+ if (event->custom == EVT_DATA_LISTBASE)
BLI_freelistN(event->customdata);
else
MEM_freeN(event->customdata);
@@ -113,7 +113,7 @@ void wm_event_free_all(wmWindow *win)
{
wmEvent *event;
- while((event= win->queue.first)) {
+ while ((event = win->queue.first)) {
BLI_remlink(&win->queue, event);
wm_event_free(event);
}
@@ -125,8 +125,8 @@ static int wm_test_duplicate_notifier(wmWindowManager *wm, unsigned int type, vo
{
wmNotifier *note;
- for(note=wm->queue.first; note; note=note->next)
- if((note->category|note->data|note->subtype|note->action) == type && note->reference == reference)
+ for (note = wm->queue.first; note; note = note->next)
+ if ((note->category | note->data | note->subtype | note->action) == type && note->reference == reference)
return 1;
return 0;
@@ -135,114 +135,114 @@ static int wm_test_duplicate_notifier(wmWindowManager *wm, unsigned int type, vo
/* XXX: in future, which notifiers to send to other windows? */
void WM_event_add_notifier(const bContext *C, unsigned int type, void *reference)
{
- wmNotifier *note= MEM_callocN(sizeof(wmNotifier), "notifier");
+ wmNotifier *note = MEM_callocN(sizeof(wmNotifier), "notifier");
- note->wm= CTX_wm_manager(C);
+ note->wm = CTX_wm_manager(C);
BLI_addtail(&note->wm->queue, note);
- note->window= CTX_wm_window(C);
+ note->window = CTX_wm_window(C);
- if(CTX_wm_region(C))
- note->swinid= CTX_wm_region(C)->swinid;
+ if (CTX_wm_region(C))
+ note->swinid = CTX_wm_region(C)->swinid;
- note->category= type & NOTE_CATEGORY;
- note->data= type & NOTE_DATA;
- note->subtype= type & NOTE_SUBTYPE;
- note->action= type & NOTE_ACTION;
+ note->category = type & NOTE_CATEGORY;
+ note->data = type & NOTE_DATA;
+ note->subtype = type & NOTE_SUBTYPE;
+ note->action = type & NOTE_ACTION;
- note->reference= reference;
+ note->reference = reference;
}
void WM_main_add_notifier(unsigned int type, void *reference)
{
- Main *bmain= G.main;
- wmWindowManager *wm= bmain->wm.first;
+ Main *bmain = G.main;
+ wmWindowManager *wm = bmain->wm.first;
- if(wm && !wm_test_duplicate_notifier(wm, type, reference)) {
- wmNotifier *note= MEM_callocN(sizeof(wmNotifier), "notifier");
+ if (wm && !wm_test_duplicate_notifier(wm, type, reference)) {
+ wmNotifier *note = MEM_callocN(sizeof(wmNotifier), "notifier");
- note->wm= wm;
+ note->wm = wm;
BLI_addtail(&note->wm->queue, note);
- note->category= type & NOTE_CATEGORY;
- note->data= type & NOTE_DATA;
- note->subtype= type & NOTE_SUBTYPE;
- note->action= type & NOTE_ACTION;
+ note->category = type & NOTE_CATEGORY;
+ note->data = type & NOTE_DATA;
+ note->subtype = type & NOTE_SUBTYPE;
+ note->action = type & NOTE_ACTION;
- note->reference= reference;
+ note->reference = reference;
}
}
static wmNotifier *wm_notifier_next(wmWindowManager *wm)
{
- wmNotifier *note= wm->queue.first;
+ wmNotifier *note = wm->queue.first;
- if(note) BLI_remlink(&wm->queue, note);
+ if (note) BLI_remlink(&wm->queue, note);
return note;
}
/* called in mainloop */
void wm_event_do_notifiers(bContext *C)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
wmNotifier *note, *next;
wmWindow *win;
- uint64_t win_combine_v3d_datamask= 0;
+ uint64_t win_combine_v3d_datamask = 0;
- if(wm==NULL)
+ if (wm == NULL)
return;
/* cache & catch WM level notifiers, such as frame change, scene/screen set */
- for(win= wm->windows.first; win; win= win->next) {
- int do_anim= 0;
+ for (win = wm->windows.first; win; win = win->next) {
+ int do_anim = 0;
CTX_wm_window_set(C, win);
- for(note= wm->queue.first; note; note= next) {
- next= note->next;
+ for (note = wm->queue.first; note; note = next) {
+ next = note->next;
- if(note->category==NC_WM) {
- if( ELEM(note->data, ND_FILEREAD, ND_FILESAVE)) {
- wm->file_saved= 1;
+ if (note->category == NC_WM) {
+ if (ELEM(note->data, ND_FILEREAD, ND_FILESAVE)) {
+ wm->file_saved = 1;
wm_window_title(wm, win);
}
- else if(note->data==ND_DATACHANGED)
+ else if (note->data == ND_DATACHANGED)
wm_window_title(wm, win);
}
- if(note->window==win) {
- if(note->category==NC_SCREEN) {
- if(note->data==ND_SCREENBROWSE) {
- ED_screen_set(C, note->reference); // XXX hrms, think this over!
- if(G.f & G_DEBUG)
- printf("screen set %p\n", note->reference);
+ if (note->window == win) {
+ if (note->category == NC_SCREEN) {
+ if (note->data == ND_SCREENBROWSE) {
+ ED_screen_set(C, note->reference); // XXX hrms, think this over!
+ if (G.debug & G_DEBUG_EVENTS)
+ printf("%s: screen set %p\n", __func__, note->reference);
}
- else if(note->data==ND_SCREENDELETE) {
- ED_screen_delete(C, note->reference); // XXX hrms, think this over!
- if(G.f & G_DEBUG)
- printf("screen delete %p\n", note->reference);
+ else if (note->data == ND_SCREENDELETE) {
+ ED_screen_delete(C, note->reference); // XXX hrms, think this over!
+ if (G.debug & G_DEBUG_EVENTS)
+ printf("%s: screen delete %p\n", __func__, note->reference);
}
}
}
if (note->window == win ||
- (note->window == NULL && (note->reference == NULL || note->reference == CTX_data_scene(C))))
+ (note->window == NULL && (note->reference == NULL || note->reference == CTX_data_scene(C))))
{
- if(note->category==NC_SCENE) {
- if(note->data==ND_FRAME)
- do_anim= 1;
+ if (note->category == NC_SCENE) {
+ if (note->data == ND_FRAME)
+ do_anim = 1;
}
}
- if(ELEM5(note->category, NC_SCENE, NC_OBJECT, NC_GEOM, NC_SCENE, NC_WM)) {
+ if (ELEM5(note->category, NC_SCENE, NC_OBJECT, NC_GEOM, NC_SCENE, NC_WM)) {
ED_info_stats_clear(CTX_data_scene(C));
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_INFO, NULL);
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO, NULL);
}
}
- if(do_anim) {
+ if (do_anim) {
/* XXX, quick frame changes can cause a crash if framechange and rendering
* collide (happens on slow scenes), scene_update_for_newframe can be called
* twice which can depgraph update the same object at once */
- if(!G.rendering) {
+ if (!G.rendering) {
/* depsgraph gets called, might send more notifiers */
ED_update_for_newframe(CTX_data_main(C), win->screen->scene, win->screen, 1);
@@ -251,12 +251,12 @@ void wm_event_do_notifiers(bContext *C)
}
/* the notifiers are sent without context, to keep it clean */
- while( (note=wm_notifier_next(wm)) ) {
- for(win= wm->windows.first; win; win= win->next) {
+ while ( (note = wm_notifier_next(wm)) ) {
+ for (win = wm->windows.first; win; win = win->next) {
/* filter out notifiers */
- if(note->category==NC_SCREEN && note->reference && note->reference!=win->screen);
- else if(note->category==NC_SCENE && note->reference && note->reference!=win->screen->scene);
+ if (note->category == NC_SCREEN && note->reference && note->reference != win->screen) ;
+ else if (note->category == NC_SCENE && note->reference && note->reference != win->screen->scene) ;
else {
ScrArea *sa;
ARegion *ar;
@@ -267,13 +267,13 @@ void wm_event_do_notifiers(bContext *C)
/* printf("notifier win %d screen %s cat %x\n", win->winid, win->screen->id.name+2, note->category); */
ED_screen_do_listen(C, note);
- for(ar=win->screen->regionbase.first; ar; ar= ar->next) {
+ for (ar = win->screen->regionbase.first; ar; ar = ar->next) {
ED_region_do_listen(ar, note);
}
- for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+ for (sa = win->screen->areabase.first; sa; sa = sa->next) {
ED_area_do_listen(sa, note);
- for(ar=sa->regionbase.first; ar; ar= ar->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
ED_region_do_listen(ar, note);
}
}
@@ -284,29 +284,29 @@ void wm_event_do_notifiers(bContext *C)
}
/* combine datamasks so 1 win doesn't disable UV's in another [#26448] */
- for(win= wm->windows.first; win; win= win->next) {
+ for (win = wm->windows.first; win; win = win->next) {
win_combine_v3d_datamask |= ED_view3d_screen_datamask(win->screen);
}
/* cached: editor refresh callbacks now, they get context */
- for(win= wm->windows.first; win; win= win->next) {
+ for (win = wm->windows.first; win; win = win->next) {
ScrArea *sa;
CTX_wm_window_set(C, win);
- for(sa= win->screen->areabase.first; sa; sa= sa->next) {
- if(sa->do_refresh) {
+ for (sa = win->screen->areabase.first; sa; sa = sa->next) {
+ if (sa->do_refresh) {
CTX_wm_area_set(C, sa);
ED_area_do_refresh(C, sa);
}
}
/* XXX make lock in future, or separated derivedmesh users in scene */
- if(!G.rendering) {
+ if (!G.rendering) {
/* depsgraph & animation: update tagged datablocks */
Main *bmain = CTX_data_main(C);
/* copied to set's in scene_update_tagged_recursive() */
- win->screen->scene->customdata_mask= win_combine_v3d_datamask;
+ win->screen->scene->customdata_mask = win_combine_v3d_datamask;
/* XXX, hack so operators can enforce datamasks [#26482], gl render */
win->screen->scene->customdata_mask |= win->screen->scene->customdata_mask_modal;
@@ -328,31 +328,31 @@ static int wm_event_always_pass(wmEvent *event)
static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, wmEvent *event, int always_pass)
{
- ScrArea *area= CTX_wm_area(C);
- ARegion *region= CTX_wm_region(C);
- ARegion *menu= CTX_wm_menu(C);
- static int do_wheel_ui= 1;
- int is_wheel= ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE);
+ ScrArea *area = CTX_wm_area(C);
+ ARegion *region = CTX_wm_region(C);
+ ARegion *menu = CTX_wm_menu(C);
+ static int do_wheel_ui = 1;
+ int is_wheel = ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE);
int retval;
/* UI is quite aggressive with swallowing events, like scrollwheel */
/* I realize this is not extremely nice code... when UI gets keymaps it can be maybe smarter */
- if(do_wheel_ui==0) {
- if(is_wheel)
+ if (do_wheel_ui == 0) {
+ if (is_wheel)
return WM_HANDLER_CONTINUE;
- else if(wm_event_always_pass(event)==0)
- do_wheel_ui= 1;
+ else if (wm_event_always_pass(event) == 0)
+ do_wheel_ui = 1;
}
/* we set context to where ui handler came from */
- if(handler->ui_area) CTX_wm_area_set(C, handler->ui_area);
- if(handler->ui_region) CTX_wm_region_set(C, handler->ui_region);
- if(handler->ui_menu) CTX_wm_menu_set(C, handler->ui_menu);
+ if (handler->ui_area) CTX_wm_area_set(C, handler->ui_area);
+ if (handler->ui_region) CTX_wm_region_set(C, handler->ui_region);
+ if (handler->ui_menu) CTX_wm_menu_set(C, handler->ui_menu);
- retval= handler->ui_handle(C, event, handler->ui_userdata);
+ retval = handler->ui_handle(C, event, handler->ui_userdata);
/* putting back screen context */
- if((retval != WM_UI_HANDLER_BREAK) || always_pass) {
+ if ((retval != WM_UI_HANDLER_BREAK) || always_pass) {
CTX_wm_area_set(C, area);
CTX_wm_region_set(C, region);
CTX_wm_menu_set(C, menu);
@@ -364,31 +364,31 @@ static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, wmEvent *eve
CTX_wm_menu_set(C, NULL);
}
- if(retval == WM_UI_HANDLER_BREAK)
+ if (retval == WM_UI_HANDLER_BREAK)
return WM_HANDLER_BREAK;
/* event not handled in UI, if wheel then we temporarily disable it */
- if(is_wheel)
- do_wheel_ui= 0;
+ if (is_wheel)
+ do_wheel_ui = 0;
return WM_HANDLER_CONTINUE;
}
static void wm_handler_ui_cancel(bContext *C)
{
- wmWindow *win= CTX_wm_window(C);
- ARegion *ar= CTX_wm_region(C);
+ wmWindow *win = CTX_wm_window(C);
+ ARegion *ar = CTX_wm_region(C);
wmEventHandler *handler, *nexthandler;
- if(!ar)
+ if (!ar)
return;
- for(handler= ar->handlers.first; handler; handler= nexthandler) {
- nexthandler= handler->next;
+ for (handler = ar->handlers.first; handler; handler = nexthandler) {
+ nexthandler = handler->next;
- if(handler->ui_handle) {
- wmEvent event= *(win->eventstate);
- event.type= EVT_BUT_CANCEL;
+ if (handler->ui_handle) {
+ wmEvent event = *(win->eventstate);
+ event.type = EVT_BUT_CANCEL;
handler->ui_handle(C, &event, handler->ui_userdata);
}
}
@@ -400,17 +400,17 @@ int WM_operator_poll(bContext *C, wmOperatorType *ot)
{
wmOperatorTypeMacro *otmacro;
- for(otmacro= ot->macro.first; otmacro; otmacro= otmacro->next) {
- wmOperatorType *ot_macro= WM_operatortype_find(otmacro->idname, 0);
+ for (otmacro = ot->macro.first; otmacro; otmacro = otmacro->next) {
+ wmOperatorType *ot_macro = WM_operatortype_find(otmacro->idname, 0);
- if(0==WM_operator_poll(C, ot_macro))
+ if (0 == WM_operator_poll(C, ot_macro))
return 0;
}
/* python needs operator type, so we added exception for it */
- if(ot->pyop_poll)
+ if (ot->pyop_poll)
return ot->pyop_poll(C, ot);
- else if(ot->poll)
+ else if (ot->poll)
return ot->poll(C);
return 1;
@@ -435,10 +435,10 @@ static void wm_operator_print(bContext *C, wmOperator *op)
void WM_event_print(wmEvent *event)
{
- if(event) {
- const char *unknown= "UNKNOWN";
- const char *type_id= unknown;
- const char *val_id= unknown;
+ if (event) {
+ const char *unknown = "UNKNOWN";
+ const char *type_id = unknown;
+ const char *val_id = unknown;
RNA_enum_identifier(event_type_items, event->type, &type_id);
RNA_enum_identifier(event_value_items, event->val, &val_id);
@@ -464,13 +464,13 @@ void WM_event_print(wmEvent *event)
static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int caller_owns_reports)
{
if (caller_owns_reports == FALSE) { /* popup */
- if(op->reports->list.first) {
+ if (op->reports->list.first) {
/* FIXME, temp setting window, see other call to uiPupMenuReports for why */
- wmWindow *win_prev= CTX_wm_window(C);
- ScrArea *area_prev= CTX_wm_area(C);
- ARegion *ar_prev= CTX_wm_region(C);
+ wmWindow *win_prev = CTX_wm_window(C);
+ ScrArea *area_prev = CTX_wm_area(C);
+ ARegion *ar_prev = CTX_wm_region(C);
- if(win_prev==NULL)
+ if (win_prev == NULL)
CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first);
uiPupMenuReports(C, op->reports);
@@ -481,8 +481,8 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int cal
}
}
- if(retval & OPERATOR_FINISHED) {
- if(G.f & G_DEBUG) {
+ if (retval & OPERATOR_FINISHED) {
+ if (G.debug & G_DEBUG_WM) {
/* todo - this print may double up, might want to check more flags then the FINISHED */
wm_operator_print(C, op);
}
@@ -492,7 +492,7 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int cal
}
if (op->type->flag & OPTYPE_REGISTER) {
- if(G.background == 0) { /* ends up printing these in the terminal, gets annoying */
+ if (G.background == 0) { /* ends up printing these in the terminal, gets annoying */
/* Report the python string representation of the operator */
char *buf = WM_operator_pystring(C, op->type, op->ptr, 1);
BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf);
@@ -505,7 +505,7 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int cal
if (op->reports->list.first && (op->reports->flag & RPT_OP_HOLD) == 0) {
wmWindowManager *wm = CTX_wm_manager(C);
- ReportList *wm_reports= CTX_wm_reports(C);
+ ReportList *wm_reports = CTX_wm_reports(C);
ReportTimerInfo *rti;
/* add reports to the global list, otherwise they are not seen */
@@ -515,7 +515,7 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int cal
WM_event_remove_timer(wm, NULL, wm_reports->reporttimer);
/* Records time since last report was added */
- wm_reports->reporttimer= WM_event_add_timer(wm, CTX_wm_window(C), TIMERREPORT, 0.05);
+ wm_reports->reporttimer = WM_event_add_timer(wm, CTX_wm_window(C), TIMERREPORT, 0.05);
rti = MEM_callocN(sizeof(ReportTimerInfo), "ReportTimerInfo");
wm_reports->reporttimer->customdata = rti;
@@ -532,25 +532,25 @@ static int wm_operator_register_check(wmWindowManager *wm, wmOperatorType *ot)
static void wm_operator_finished(bContext *C, wmOperator *op, int repeat)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
- op->customdata= NULL;
+ 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 */
- if(wm->op_undo_depth == 0)
- if(op->type->flag & OPTYPE_UNDO)
+ * 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);
- if(repeat==0) {
- if(G.f & G_DEBUG) {
+ if (repeat == 0) {
+ if (G.debug & G_DEBUG_WM) {
char *buf = WM_operator_pystring(C, op->type, op->ptr, 1);
BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf);
MEM_freeN(buf);
}
- if(wm_operator_register_check(wm, op->type))
+ if (wm_operator_register_check(wm, op->type))
wm_operator_register(C, op);
else
WM_operator_free(op);
@@ -560,35 +560,42 @@ static void wm_operator_finished(bContext *C, wmOperator *op, int repeat)
/* if repeat is true, it doesn't register again, nor does it free */
static int wm_operator_exec(bContext *C, wmOperator *op, int repeat)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- int retval= OPERATOR_CANCELLED;
+ wmWindowManager *wm = CTX_wm_manager(C);
+ int retval = OPERATOR_CANCELLED;
CTX_wm_operator_poll_msg_set(C, NULL);
- if(op==NULL || op->type==NULL)
+ if (op == NULL || op->type == NULL)
return retval;
- if(0==WM_operator_poll(C, op->type))
+ if (0 == WM_operator_poll(C, op->type))
return retval;
- if(op->type->exec) {
- if(op->type->flag & OPTYPE_UNDO)
+ if (op->type->exec) {
+ if (op->type->flag & OPTYPE_UNDO)
wm->op_undo_depth++;
- retval= op->type->exec(C, op);
+ retval = op->type->exec(C, op);
OPERATOR_RETVAL_CHECK(retval);
- if(op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm)
+ if (op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm)
wm->op_undo_depth--;
}
- if (retval & (OPERATOR_FINISHED|OPERATOR_CANCELLED) && repeat == 0)
+ if (retval & (OPERATOR_FINISHED | OPERATOR_CANCELLED) && repeat == 0)
wm_operator_reports(C, op, retval, FALSE);
- if(retval & OPERATOR_FINISHED)
+ if (retval & OPERATOR_FINISHED) {
+ if (repeat) {
+ if (wm->op_undo_depth == 0) { /* not called by py script */
+ WM_operator_last_properties_store(op);
+ }
+ }
wm_operator_finished(C, op, repeat);
- else if(repeat==0)
+ }
+ else if (repeat == 0) {
WM_operator_free(op);
+ }
return retval | OPERATOR_HANDLED;
@@ -597,12 +604,12 @@ static int wm_operator_exec(bContext *C, wmOperator *op, int repeat)
/* simply calls exec with basic checks */
static int wm_operator_exec_notest(bContext *C, wmOperator *op)
{
- int retval= OPERATOR_CANCELLED;
+ int retval = OPERATOR_CANCELLED;
- if(op==NULL || op->type==NULL || op->type->exec==NULL)
+ if (op == NULL || op->type == NULL || op->type->exec == NULL)
return retval;
- retval= op->type->exec(C, op);
+ retval = op->type->exec(C, op);
OPERATOR_RETVAL_CHECK(retval);
return retval;
@@ -641,40 +648,40 @@ int WM_operator_repeat_check(const bContext *UNUSED(C), wmOperator *op)
static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, PointerRNA *properties, ReportList *reports)
{
/* XXX operatortype names are static still. for debug */
- wmOperator *op= MEM_callocN(sizeof(wmOperator), ot->idname);
+ wmOperator *op = MEM_callocN(sizeof(wmOperator), ot->idname);
/* XXX adding new operator could be function, only happens here now */
- op->type= ot;
+ op->type = ot;
BLI_strncpy(op->idname, ot->idname, OP_MAX_TYPENAME);
/* initialize properties, either copy or create */
- op->ptr= MEM_callocN(sizeof(PointerRNA), "wmOperatorPtrRNA");
- if(properties && properties->data) {
- op->properties= IDP_CopyProperty(properties->data);
+ op->ptr = MEM_callocN(sizeof(PointerRNA), "wmOperatorPtrRNA");
+ if (properties && properties->data) {
+ op->properties = IDP_CopyProperty(properties->data);
}
else {
IDPropertyTemplate val = {0};
- op->properties= IDP_New(IDP_GROUP, &val, "wmOperatorProperties");
+ op->properties = IDP_New(IDP_GROUP, &val, "wmOperatorProperties");
}
RNA_pointer_create(&wm->id, ot->srna, op->properties, op->ptr);
/* initialize error reports */
if (reports) {
- op->reports= reports; /* must be initialized already */
+ op->reports = reports; /* must be initialized already */
}
else {
- op->reports= MEM_mallocN(sizeof(ReportList), "wmOperatorReportList");
- BKE_reports_init(op->reports, RPT_STORE|RPT_FREE);
+ op->reports = MEM_mallocN(sizeof(ReportList), "wmOperatorReportList");
+ BKE_reports_init(op->reports, RPT_STORE | RPT_FREE);
}
/* recursive filling of operator macro list */
- if(ot->macro.first) {
- static wmOperator *motherop= NULL;
+ if (ot->macro.first) {
+ static wmOperator *motherop = NULL;
wmOperatorTypeMacro *otmacro;
int root = 0;
/* ensure all ops are in execution order in 1 list */
- if(motherop==NULL) {
+ if (motherop == NULL) {
motherop = op;
root = 1;
}
@@ -682,41 +689,42 @@ static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, P
/* if properties exist, it will contain everything needed */
if (properties) {
- otmacro= ot->macro.first;
+ otmacro = ot->macro.first;
- RNA_STRUCT_BEGIN(properties, prop) {
+ RNA_STRUCT_BEGIN(properties, prop)
+ {
if (otmacro == NULL)
break;
/* skip invalid properties */
- if (strcmp(RNA_property_identifier(prop), otmacro->idname) == 0)
- {
- wmOperatorType *otm= WM_operatortype_find(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);
+ wmOperator *opm = wm_operator_create(wm, otm, &someptr, NULL);
IDP_ReplaceGroupInGroup(opm->properties, otmacro->properties);
BLI_addtail(&motherop->macro, opm);
- opm->opm= motherop; /* pointer to mom, for modal() */
+ opm->opm = motherop; /* pointer to mom, for modal() */
- otmacro= otmacro->next;
+ otmacro = otmacro->next;
}
}
RNA_STRUCT_END;
- } else {
+ }
+ else {
for (otmacro = ot->macro.first; otmacro; otmacro = otmacro->next) {
- wmOperatorType *otm= WM_operatortype_find(otmacro->idname, 0);
- wmOperator *opm= wm_operator_create(wm, otm, otmacro->ptr, NULL);
+ wmOperatorType *otm = WM_operatortype_find(otmacro->idname, 0);
+ wmOperator *opm = wm_operator_create(wm, otm, otmacro->ptr, NULL);
BLI_addtail(&motherop->macro, opm);
- opm->opm= motherop; /* pointer to mom, for modal() */
+ opm->opm = motherop; /* pointer to mom, for modal() */
}
}
if (root)
- motherop= NULL;
+ motherop = NULL;
}
WM_operator_properties_sanitize(op->ptr, 0);
@@ -726,42 +734,39 @@ static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, P
static void wm_region_mouse_co(bContext *C, wmEvent *event)
{
- ARegion *ar= CTX_wm_region(C);
- if(ar) {
+ ARegion *ar = CTX_wm_region(C);
+ if (ar) {
/* compatibility convention */
- event->mval[0]= event->x - ar->winrct.xmin;
- event->mval[1]= event->y - ar->winrct.ymin;
+ event->mval[0] = event->x - ar->winrct.xmin;
+ event->mval[1] = event->y - ar->winrct.ymin;
}
else {
/* these values are invalid (avoid odd behavior by relying on old mval values) */
- event->mval[0]= -1;
- event->mval[1]= -1;
+ event->mval[0] = -1;
+ event->mval[1] = -1;
}
}
-static int wm_operator_init_from_last(wmWindowManager *wm, wmOperator *op)
+int WM_operator_last_properties_init(wmOperator *op)
{
- int change= FALSE;
- wmOperator *lastop;
+ int change = FALSE;
- for(lastop= wm->operators.last; lastop; lastop= lastop->prev) {
- /* equality check is a bit paranoid but just incase */
- if((op != lastop) && (op->type == (lastop->type))) {
- break;
+ if (op->type->last_properties) {
+ PropertyRNA *iterprop;
+
+ if (G.debug & G_DEBUG_WM) {
+ printf("%s: loading previous properties for '%s'\n", __func__, op->type->idname);
}
- }
- if (lastop && op != lastop) {
- PropertyRNA *iterprop;
- iterprop= RNA_struct_iterator_property(op->type->srna);
+ iterprop = RNA_struct_iterator_property(op->type->srna);
RNA_PROP_BEGIN(op->ptr, itemptr, iterprop) {
- PropertyRNA *prop= itemptr.data;
- if((RNA_property_flag(prop) & PROP_SKIP_SAVE) == 0) {
+ PropertyRNA *prop = itemptr.data;
+ if ((RNA_property_flag(prop) & PROP_SKIP_SAVE) == 0) {
if (!RNA_property_is_set(op->ptr, prop)) { /* don't override a setting already set */
- const char *identifier= RNA_property_identifier(prop);
- IDProperty *idp_src= IDP_GetPropertyFromGroup(lastop->properties, identifier);
- if(idp_src) {
+ const char *identifier = RNA_property_identifier(prop);
+ IDProperty *idp_src = IDP_GetPropertyFromGroup(op->type->last_properties, identifier);
+ if (idp_src) {
IDProperty *idp_dst = IDP_CopyProperty(idp_src);
/* note - in the future this may need to be done recursively,
@@ -769,7 +774,7 @@ static int wm_operator_init_from_last(wmWindowManager *wm, wmOperator *op)
idp_dst->flag |= IDP_FLAG_GHOST;
IDP_ReplaceInGroup(op->properties, idp_dst);
- change= TRUE;
+ change = TRUE;
}
}
}
@@ -780,46 +785,68 @@ static int wm_operator_init_from_last(wmWindowManager *wm, wmOperator *op)
return change;
}
+int WM_operator_last_properties_store(wmOperator *op)
+{
+ if (op->type->last_properties) {
+ IDP_FreeProperty(op->type->last_properties);
+ MEM_freeN(op->type->last_properties);
+ op->type->last_properties = NULL;
+ }
+
+ if (op->properties) {
+ if (G.debug & G_DEBUG_WM) {
+ printf("%s: storing properties for '%s'\n", __func__, op->type->idname);
+ }
+ op->type->last_properties = IDP_CopyProperty(op->properties);
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
+
static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerRNA *properties, ReportList *reports, short poll_only)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- int retval= OPERATOR_PASS_THROUGH;
+ wmWindowManager *wm = CTX_wm_manager(C);
+ int retval = OPERATOR_PASS_THROUGH;
/* this is done because complicated setup is done to call this function that is better not duplicated */
- if(poll_only)
+ if (poll_only)
return WM_operator_poll(C, ot);
- if(WM_operator_poll(C, ot)) {
- wmOperator *op= wm_operator_create(wm, ot, properties, reports); /* if reports==NULL, theyll be initialized */
+ if (WM_operator_poll(C, ot)) {
+ wmOperator *op = wm_operator_create(wm, ot, properties, reports); /* if reports==NULL, theyll be initialized */
+ const short is_nested_call = (wm->op_undo_depth != 0);
/* initialize setting from previous run */
- if(wm->op_undo_depth == 0 && (ot->flag & OPTYPE_REGISTER)) { /* not called by py script */
- wm_operator_init_from_last(wm, op);
+ if (!is_nested_call) { /* not called by py script */
+ WM_operator_last_properties_init(op);
}
- if((G.f & G_DEBUG) && event && event->type!=MOUSEMOVE)
- printf("handle evt %d win %d op %s\n", event?event->type:0, CTX_wm_screen(C)->subwinactive, ot->idname);
+ if ((G.debug & G_DEBUG_EVENTS) && event && event->type != MOUSEMOVE) {
+ printf("%s: handle evt %d win %d op %s\n", __func__, event ? event->type : 0, CTX_wm_screen(C)->subwinactive, ot->idname);
+ }
- if(op->type->invoke && event) {
+ if (op->type->invoke && event) {
wm_region_mouse_co(C, event);
- if(op->type->flag & OPTYPE_UNDO)
+ if (op->type->flag & OPTYPE_UNDO)
wm->op_undo_depth++;
- retval= op->type->invoke(C, op, event);
+ retval = op->type->invoke(C, op, event);
OPERATOR_RETVAL_CHECK(retval);
- if(op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm)
+ if (op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm)
wm->op_undo_depth--;
}
- else if(op->type->exec) {
- if(op->type->flag & OPTYPE_UNDO)
+ else if (op->type->exec) {
+ if (op->type->flag & OPTYPE_UNDO)
wm->op_undo_depth++;
- retval= op->type->exec(C, op);
+ retval = op->type->exec(C, op);
OPERATOR_RETVAL_CHECK(retval);
- if(op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm)
+ if (op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm)
wm->op_undo_depth--;
}
else {
@@ -829,22 +856,25 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P
/* Note, if the report is given as an argument then assume the caller will deal with displaying them
* currently python only uses this */
- if (!(retval & OPERATOR_HANDLED) && (retval & (OPERATOR_FINISHED|OPERATOR_CANCELLED))) {
+ if (!(retval & OPERATOR_HANDLED) && (retval & (OPERATOR_FINISHED | OPERATOR_CANCELLED))) {
/* only show the report if the report list was not given in the function */
wm_operator_reports(C, op, retval, (reports != NULL));
}
- if(retval & OPERATOR_HANDLED)
- ; /* do nothing, wm_operator_exec() has been called somewhere */
- else if(retval & OPERATOR_FINISHED) {
+ if (retval & OPERATOR_HANDLED)
+ ; /* do nothing, wm_operator_exec() has been called somewhere */
+ else if (retval & OPERATOR_FINISHED) {
+ if (!is_nested_call) { /* not called by py script */
+ WM_operator_last_properties_store(op);
+ }
wm_operator_finished(C, op, 0);
}
- else if(retval & OPERATOR_RUNNING_MODAL) {
+ else if (retval & OPERATOR_RUNNING_MODAL) {
/* grab cursor during blocking modal ops (X11)
* Also check for macro
*/
- if(ot->flag & OPTYPE_BLOCKING || (op->opm && op->opm->type->flag & OPTYPE_BLOCKING)) {
- int bounds[4] = {-1,-1,-1,-1};
+ if (ot->flag & OPTYPE_BLOCKING || (op->opm && op->opm->type->flag & OPTYPE_BLOCKING)) {
+ int bounds[4] = {-1, -1, -1, -1};
int wrap;
if (op->opm) {
@@ -857,32 +887,32 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P
}
/* exception, cont. grab in header is annoying */
- if(wrap) {
- ARegion *ar= CTX_wm_region(C);
- if(ar && ar->regiontype == RGN_TYPE_HEADER) {
- wrap= FALSE;
+ if (wrap) {
+ ARegion *ar = CTX_wm_region(C);
+ if (ar && ar->regiontype == RGN_TYPE_HEADER) {
+ wrap = FALSE;
}
}
- if(wrap) {
- rcti *winrect= NULL;
- ARegion *ar= CTX_wm_region(C);
- ScrArea *sa= CTX_wm_area(C);
+ if (wrap) {
+ rcti *winrect = NULL;
+ ARegion *ar = CTX_wm_region(C);
+ ScrArea *sa = CTX_wm_area(C);
if (ar && ar->regiontype == RGN_TYPE_WINDOW && event &&
BLI_in_rcti(&ar->winrct, event->x, event->y))
{
- winrect= &ar->winrct;
+ winrect = &ar->winrct;
}
- else if(sa) {
- winrect= &sa->totrct;
+ else if (sa) {
+ winrect = &sa->totrct;
}
- if(winrect) {
- bounds[0]= winrect->xmin;
- bounds[1]= winrect->ymax;
- bounds[2]= winrect->xmax;
- bounds[3]= winrect->ymin;
+ if (winrect) {
+ bounds[0] = winrect->xmin;
+ bounds[1] = winrect->ymax;
+ bounds[2] = winrect->xmax;
+ bounds[3] = winrect->ymin;
}
}
@@ -890,13 +920,14 @@ 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
+ else {
WM_operator_free(op);
+ }
}
return retval;
@@ -909,7 +940,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P
static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA *properties, ReportList *reports,
short context, short poll_only)
{
- wmWindow *window= CTX_wm_window(C);
+ wmWindow *window = CTX_wm_window(C);
wmEvent *event;
int retval;
@@ -917,8 +948,8 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA
CTX_wm_operator_poll_msg_set(C, NULL);
/* dummie test */
- if(ot && C) {
- switch(context) {
+ if (ot && C) {
+ switch (context) {
case WM_OP_INVOKE_DEFAULT:
case WM_OP_INVOKE_REGION_WIN:
case WM_OP_INVOKE_AREA:
@@ -927,13 +958,13 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA
if (window == NULL)
return 0;
else
- event= window->eventstate;
+ event = window->eventstate;
break;
default:
event = NULL;
}
- switch(context) {
+ switch (context) {
case WM_OP_EXEC_REGION_WIN:
case WM_OP_INVOKE_REGION_WIN:
@@ -945,8 +976,8 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA
/* forces operator to go to the region window/channels/preview, for header menus
* but we stay in the same region if we are already in one
*/
- ARegion *ar= CTX_wm_region(C);
- ScrArea *area= CTX_wm_area(C);
+ ARegion *ar = CTX_wm_region(C);
+ ScrArea *area = CTX_wm_area(C);
int type = RGN_TYPE_WINDOW;
switch (context) {
@@ -967,13 +998,13 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA
break;
}
- if(!(ar && ar->regiontype == type) && area) {
- ARegion *ar1= BKE_area_find_region_type(area, type);
- if(ar1)
+ if (!(ar && ar->regiontype == type) && area) {
+ ARegion *ar1 = BKE_area_find_region_type(area, type);
+ if (ar1)
CTX_wm_region_set(C, ar1);
}
- retval= wm_operator_invoke(C, ot, event, properties, reports, poll_only);
+ retval = wm_operator_invoke(C, ot, event, properties, reports, poll_only);
/* set region back */
CTX_wm_region_set(C, ar);
@@ -983,11 +1014,11 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA
case WM_OP_EXEC_AREA:
case WM_OP_INVOKE_AREA:
{
- /* remove region from context */
- ARegion *ar= CTX_wm_region(C);
+ /* remove region from context */
+ ARegion *ar = CTX_wm_region(C);
CTX_wm_region_set(C, NULL);
- retval= wm_operator_invoke(C, ot, event, properties, reports, poll_only);
+ retval = wm_operator_invoke(C, ot, event, properties, reports, poll_only);
CTX_wm_region_set(C, ar);
return retval;
@@ -996,12 +1027,12 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA
case WM_OP_INVOKE_SCREEN:
{
/* remove region + area from context */
- ARegion *ar= CTX_wm_region(C);
- ScrArea *area= CTX_wm_area(C);
+ ARegion *ar = CTX_wm_region(C);
+ ScrArea *area = CTX_wm_area(C);
CTX_wm_region_set(C, NULL);
CTX_wm_area_set(C, NULL);
- retval= wm_operator_invoke(C, ot, event, properties, reports, poll_only);
+ retval = wm_operator_invoke(C, ot, event, properties, reports, poll_only);
CTX_wm_area_set(C, area);
CTX_wm_region_set(C, ar);
@@ -1020,46 +1051,56 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA
/* invokes operator in context */
int WM_operator_name_call(bContext *C, const char *opstring, int context, PointerRNA *properties)
{
- wmOperatorType *ot= WM_operatortype_find(opstring, 0);
- if(ot)
+ wmOperatorType *ot = WM_operatortype_find(opstring, 0);
+ if (ot)
return wm_operator_call_internal(C, ot, properties, NULL, context, FALSE);
return 0;
}
/* 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;
+ int retval = OPERATOR_CANCELLED;
#if 0
wmOperator *op;
- op= wm_operator_create(wm, ot, properties, reports);
+ op = wm_operator_create(wm, ot, properties, reports);
if (op->type->exec) {
- if(op->type->flag & OPTYPE_UNDO)
+ if (op->type->flag & OPTYPE_UNDO)
wm->op_undo_depth++;
- retval= op->type->exec(C, op);
+ retval = op->type->exec(C, op);
OPERATOR_RETVAL_CHECK(retval);
- if(op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm)
+ if (op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm)
wm->op_undo_depth--;
}
else
printf("error \"%s\" operator has no exec function, python cannot call it\n", op->type->name);
#endif
- retval= wm_operator_call_internal(C, ot, properties, reports, context, FALSE);
+ /* not especially nice using undo depth here, its used so py never
+ * triggers undo or stores operators last used state.
+ *
+ * we could have some more obvious way of doing this like passing a flag.
+ */
+ wmWindowManager *wm = CTX_wm_manager(C);
+ if (wm) wm->op_undo_depth++;
+
+ retval = wm_operator_call_internal(C, ot, properties, reports, context, FALSE);
+ if (wm && (wm == CTX_wm_manager(C))) wm->op_undo_depth--;
+
/* keep the reports around if needed later */
- if ( (retval & OPERATOR_RUNNING_MODAL) ||
- ((retval & OPERATOR_FINISHED) && wm_operator_register_check(CTX_wm_manager(C), ot))
- ) {
+ if ((retval & OPERATOR_RUNNING_MODAL) ||
+ ((retval & OPERATOR_FINISHED) && wm_operator_register_check(CTX_wm_manager(C), ot)))
+ {
reports->flag |= RPT_FREE; /* let blender manage freeing */
}
@@ -1078,31 +1119,31 @@ void wm_event_free_handler(wmEventHandler *handler)
/* only set context when area/region is part of screen */
static void wm_handler_op_context(bContext *C, wmEventHandler *handler)
{
- bScreen *screen= CTX_wm_screen(C);
+ bScreen *screen = CTX_wm_screen(C);
- if(screen && handler->op) {
- if(handler->op_area==NULL)
+ if (screen && handler->op) {
+ if (handler->op_area == NULL)
CTX_wm_area_set(C, NULL);
else {
ScrArea *sa;
- for(sa= screen->areabase.first; sa; sa= sa->next)
- if(sa==handler->op_area)
+ for (sa = screen->areabase.first; sa; sa = sa->next)
+ if (sa == handler->op_area)
break;
- if(sa==NULL) {
+ if (sa == NULL) {
/* when changing screen layouts with running modal handlers (like render display), this
- is not an error to print */
- if(handler->op==NULL)
+ * is not an error to print */
+ if (handler->op == NULL)
printf("internal error: handler (%s) has invalid area\n", handler->op->type->idname);
}
else {
ARegion *ar;
CTX_wm_area_set(C, sa);
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar==handler->op_region)
+ for (ar = sa->regionbase.first; ar; ar = ar->next)
+ if (ar == handler->op_region)
break;
/* XXX no warning print here, after full-area and back regions are remade */
- if(ar)
+ if (ar)
CTX_wm_region_set(C, ar);
}
}
@@ -1113,25 +1154,25 @@ static void wm_handler_op_context(bContext *C, wmEventHandler *handler)
void WM_event_remove_handlers(bContext *C, ListBase *handlers)
{
wmEventHandler *handler;
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
/* C is zero on freeing database, modal handlers then already were freed */
- while((handler=handlers->first)) {
+ while ((handler = handlers->first)) {
BLI_remlink(handlers, handler);
- if(handler->op) {
- if(handler->op->type->cancel) {
- ScrArea *area= CTX_wm_area(C);
- ARegion *region= CTX_wm_region(C);
+ if (handler->op) {
+ if (handler->op->type->cancel) {
+ ScrArea *area = CTX_wm_area(C);
+ ARegion *region = CTX_wm_region(C);
wm_handler_op_context(C, handler);
- if(handler->op->type->flag & OPTYPE_UNDO)
+ if (handler->op->type->flag & OPTYPE_UNDO)
wm->op_undo_depth++;
handler->op->type->cancel(C, handler->op);
- if(handler->op->type->flag & OPTYPE_UNDO)
+ if (handler->op->type->flag & OPTYPE_UNDO)
wm->op_undo_depth--;
CTX_wm_area_set(C, area);
@@ -1141,14 +1182,14 @@ void WM_event_remove_handlers(bContext *C, ListBase *handlers)
WM_cursor_ungrab(CTX_wm_window(C));
WM_operator_free(handler->op);
}
- else if(handler->ui_remove) {
- ScrArea *area= CTX_wm_area(C);
- ARegion *region= CTX_wm_region(C);
- ARegion *menu= CTX_wm_menu(C);
+ else if (handler->ui_remove) {
+ ScrArea *area = CTX_wm_area(C);
+ ARegion *region = CTX_wm_region(C);
+ ARegion *menu = CTX_wm_menu(C);
- if(handler->ui_area) CTX_wm_area_set(C, handler->ui_area);
- if(handler->ui_region) CTX_wm_region_set(C, handler->ui_region);
- if(handler->ui_menu) CTX_wm_menu_set(C, handler->ui_menu);
+ if (handler->ui_area) CTX_wm_area_set(C, handler->ui_area);
+ if (handler->ui_region) CTX_wm_region_set(C, handler->ui_region);
+ if (handler->ui_menu) CTX_wm_menu_set(C, handler->ui_menu);
handler->ui_remove(C, handler->ui_userdata);
@@ -1164,39 +1205,39 @@ void WM_event_remove_handlers(bContext *C, ListBase *handlers)
/* do userdef mappings */
int WM_userdef_event_map(int kmitype)
{
- switch(kmitype) {
+ switch (kmitype) {
case SELECTMOUSE:
- if(U.flag & USER_LMOUSESELECT)
+ if (U.flag & USER_LMOUSESELECT)
return LEFTMOUSE;
else
return RIGHTMOUSE;
case ACTIONMOUSE:
- if(U.flag & USER_LMOUSESELECT)
+ if (U.flag & USER_LMOUSESELECT)
return RIGHTMOUSE;
else
return LEFTMOUSE;
case WHEELOUTMOUSE:
- if(U.uiflag & USER_WHEELZOOMDIR)
+ if (U.uiflag & USER_WHEELZOOMDIR)
return WHEELUPMOUSE;
else
return WHEELDOWNMOUSE;
case WHEELINMOUSE:
- if(U.uiflag & USER_WHEELZOOMDIR)
+ if (U.uiflag & USER_WHEELZOOMDIR)
return WHEELDOWNMOUSE;
else
return WHEELUPMOUSE;
case EVT_TWEAK_A:
- if(U.flag & USER_LMOUSESELECT)
+ if (U.flag & USER_LMOUSESELECT)
return EVT_TWEAK_R;
else
return EVT_TWEAK_L;
case EVT_TWEAK_S:
- if(U.flag & USER_LMOUSESELECT)
+ if (U.flag & USER_LMOUSESELECT)
return EVT_TWEAK_L;
else
return EVT_TWEAK_R;
@@ -1210,8 +1251,8 @@ static void wm_eventemulation(wmEvent *event)
static int mmb_emulated = 0; /* this should be in a data structure somwhere */
/* middlemouse emulation */
- if(U.flag & USER_TWOBUTTONMOUSE) {
- if(event->type == LEFTMOUSE && (event->alt || mmb_emulated == KM_PRESS)) {
+ if (U.flag & USER_TWOBUTTONMOUSE) {
+ if (event->type == LEFTMOUSE && (event->alt || mmb_emulated == KM_PRESS)) {
event->type = MIDDLEMOUSE;
event->alt = 0;
mmb_emulated = event->val;
@@ -1220,8 +1261,8 @@ static void wm_eventemulation(wmEvent *event)
#ifdef __APPLE__
/* rightmouse emulation */
- if(U.flag & USER_TWOBUTTONMOUSE) {
- if(event->type == LEFTMOUSE && (event->oskey || mmb_emulated == KM_PRESS)) {
+ if (U.flag & USER_TWOBUTTONMOUSE) {
+ if (event->type == LEFTMOUSE && (event->oskey || mmb_emulated == KM_PRESS)) {
event->type = RIGHTMOUSE;
event->oskey = 0;
mmb_emulated = event->val;
@@ -1230,8 +1271,8 @@ static void wm_eventemulation(wmEvent *event)
#endif
/* numpad emulation */
- if(U.flag & USER_NONUMPAD) {
- switch(event->type) {
+ if (U.flag & USER_NONUMPAD) {
+ switch (event->type) {
case ZEROKEY: event->type = PAD0; break;
case ONEKEY: event->type = PAD1; break;
case TWOKEY: event->type = PAD2; break;
@@ -1251,37 +1292,37 @@ static void wm_eventemulation(wmEvent *event)
static int wm_eventmatch(wmEvent *winevent, wmKeyMapItem *kmi)
{
- int kmitype= WM_userdef_event_map(kmi->type);
+ int kmitype = WM_userdef_event_map(kmi->type);
- if(kmi->flag & KMI_INACTIVE) return 0;
+ if (kmi->flag & KMI_INACTIVE) return 0;
/* the matching rules */
- if(kmitype==KM_TEXTINPUT)
- if(ISTEXTINPUT(winevent->type) && (winevent->ascii || winevent->utf8_buf[0])) return 1;
- if(kmitype!=KM_ANY)
- if(winevent->type!=kmitype) return 0;
+ if (kmitype == KM_TEXTINPUT)
+ if (ISTEXTINPUT(winevent->type) && (winevent->ascii || winevent->utf8_buf[0])) return 1;
+ if (kmitype != KM_ANY)
+ if (winevent->type != kmitype) return 0;
- if(kmi->val!=KM_ANY)
- if(winevent->val!=kmi->val) return 0;
+ if (kmi->val != KM_ANY)
+ if (winevent->val != kmi->val) return 0;
/* modifiers also check bits, so it allows modifier order */
- if(kmi->shift!=KM_ANY)
- if(winevent->shift != kmi->shift && !(winevent->shift & kmi->shift)) return 0;
- if(kmi->ctrl!=KM_ANY)
- if(winevent->ctrl != kmi->ctrl && !(winevent->ctrl & kmi->ctrl)) return 0;
- if(kmi->alt!=KM_ANY)
- if(winevent->alt != kmi->alt && !(winevent->alt & kmi->alt)) return 0;
- if(kmi->oskey!=KM_ANY)
- if(winevent->oskey != kmi->oskey && !(winevent->oskey & kmi->oskey)) return 0;
-
- if(kmi->keymodifier)
- if(winevent->keymodifier!=kmi->keymodifier) return 0;
+ if (kmi->shift != KM_ANY)
+ if (winevent->shift != kmi->shift && !(winevent->shift & kmi->shift)) return 0;
+ if (kmi->ctrl != KM_ANY)
+ if (winevent->ctrl != kmi->ctrl && !(winevent->ctrl & kmi->ctrl)) return 0;
+ if (kmi->alt != KM_ANY)
+ if (winevent->alt != kmi->alt && !(winevent->alt & kmi->alt)) return 0;
+ if (kmi->oskey != KM_ANY)
+ if (winevent->oskey != kmi->oskey && !(winevent->oskey & kmi->oskey)) return 0;
+
+ if (kmi->keymodifier)
+ if (winevent->keymodifier != kmi->keymodifier) return 0;
/* key modifiers always check when event has it */
/* otherwise regular keypresses with keymodifier still work */
- if(winevent->keymodifier)
- if(ISTEXTINPUT(winevent->type))
- if(winevent->keymodifier!=kmi->keymodifier) return 0;
+ if (winevent->keymodifier)
+ if (ISTEXTINPUT(winevent->type))
+ if (winevent->keymodifier != kmi->keymodifier) return 0;
return 1;
}
@@ -1294,15 +1335,15 @@ static void wm_event_modalkeymap(const bContext *C, wmOperator *op, wmEvent *eve
if (op->opm)
op = op->opm;
- if(op->type->modalkeymap) {
- wmKeyMap *keymap= WM_keymap_active(CTX_wm_manager(C), op->type->modalkeymap);
+ if (op->type->modalkeymap) {
+ wmKeyMap *keymap = WM_keymap_active(CTX_wm_manager(C), op->type->modalkeymap);
wmKeyMapItem *kmi;
- for(kmi= keymap->items.first; kmi; kmi= kmi->next) {
- if(wm_eventmatch(event, kmi)) {
+ for (kmi = keymap->items.first; kmi; kmi = kmi->next) {
+ if (wm_eventmatch(event, kmi)) {
- event->type= EVT_MODAL_MAP;
- event->val= kmi->propvalue;
+ event->type = EVT_MODAL_MAP;
+ event->val = kmi->propvalue;
}
}
}
@@ -1312,39 +1353,39 @@ static void wm_event_modalkeymap(const bContext *C, wmOperator *op, wmEvent *eve
static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHandler *handler,
wmEvent *event, PointerRNA *properties)
{
- int retval= OPERATOR_PASS_THROUGH;
+ int retval = OPERATOR_PASS_THROUGH;
/* derived, modal or blocking operator */
- if(handler->op) {
- wmOperator *op= handler->op;
- wmOperatorType *ot= op->type;
+ if (handler->op) {
+ wmOperator *op = handler->op;
+ wmOperatorType *ot = op->type;
- if(ot->modal) {
+ if (ot->modal) {
/* we set context to where modal handler came from */
- wmWindowManager *wm= CTX_wm_manager(C);
- ScrArea *area= CTX_wm_area(C);
- ARegion *region= CTX_wm_region(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
+ ScrArea *area = CTX_wm_area(C);
+ ARegion *region = CTX_wm_region(C);
wm_handler_op_context(C, handler);
wm_region_mouse_co(C, event);
wm_event_modalkeymap(C, op, event);
- if(ot->flag & OPTYPE_UNDO)
+ if (ot->flag & OPTYPE_UNDO)
wm->op_undo_depth++;
- retval= ot->modal(C, op, event);
+ retval = ot->modal(C, op, event);
OPERATOR_RETVAL_CHECK(retval);
/* when this is _not_ the case the modal modifier may have loaded
* a new blend file (demo mode does this), so we have to assume
* the event, operator etc have all been freed. - campbell */
- if(CTX_wm_manager(C) == wm) {
+ if (CTX_wm_manager(C) == wm) {
- if(ot->flag & OPTYPE_UNDO)
+ if (ot->flag & OPTYPE_UNDO)
wm->op_undo_depth--;
/* putting back screen context, reval can pass trough after modal failures! */
- if((retval & OPERATOR_PASS_THROUGH) || wm_event_always_pass(event)) {
+ if ((retval & OPERATOR_PASS_THROUGH) || wm_event_always_pass(event)) {
CTX_wm_area_set(C, area);
CTX_wm_region_set(C, region);
}
@@ -1354,20 +1395,20 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
CTX_wm_region_set(C, NULL);
}
- if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED))
+ if (retval & (OPERATOR_CANCELLED | OPERATOR_FINISHED))
wm_operator_reports(C, op, retval, FALSE);
- if(retval & OPERATOR_FINISHED) {
+ if (retval & OPERATOR_FINISHED) {
wm_operator_finished(C, op, 0);
- handler->op= NULL;
+ handler->op = NULL;
}
- else if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) {
+ else if (retval & (OPERATOR_CANCELLED | OPERATOR_FINISHED)) {
WM_operator_free(op);
- handler->op= NULL;
+ handler->op = NULL;
}
- /* remove modal handler, operator itself should have been cancelled and freed */
- if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) {
+ /* remove modal handler, operator itself should have been canceled and freed */
+ if (retval & (OPERATOR_CANCELLED | OPERATOR_FINISHED)) {
WM_cursor_ungrab(CTX_wm_window(C));
BLI_remlink(handlers, handler);
@@ -1383,22 +1424,22 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
printf("wm_handler_operator_call error\n");
}
else {
- wmOperatorType *ot= WM_operatortype_find(event->keymap_idname, 0);
+ wmOperatorType *ot = WM_operatortype_find(event->keymap_idname, 0);
- if(ot)
- retval= wm_operator_invoke(C, ot, event, properties, NULL, FALSE);
+ if (ot)
+ retval = wm_operator_invoke(C, ot, event, properties, NULL, FALSE);
}
/* Finished and pass through flag as handled */
/* Finished and pass through flag as handled */
- if(retval == (OPERATOR_FINISHED|OPERATOR_PASS_THROUGH))
+ if (retval == (OPERATOR_FINISHED | OPERATOR_PASS_THROUGH))
return WM_HANDLER_HANDLED;
/* Modal unhandled, break */
- if(retval == (OPERATOR_PASS_THROUGH|OPERATOR_RUNNING_MODAL))
- return (WM_HANDLER_BREAK|WM_HANDLER_MODAL);
+ if (retval == (OPERATOR_PASS_THROUGH | OPERATOR_RUNNING_MODAL))
+ return (WM_HANDLER_BREAK | WM_HANDLER_MODAL);
- if(retval & OPERATOR_PASS_THROUGH)
+ if (retval & OPERATOR_PASS_THROUGH)
return WM_HANDLER_CONTINUE;
return WM_HANDLER_BREAK;
@@ -1407,159 +1448,163 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
/* fileselect handlers are only in the window queue, so it's save to switch screens or area types */
static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHandler *handler, wmEvent *event)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
SpaceFile *sfile;
- int action= WM_HANDLER_CONTINUE;
+ int action = WM_HANDLER_CONTINUE;
- if(event->type != EVT_FILESELECT)
+ if (event->type != EVT_FILESELECT)
return action;
- if(handler->op != (wmOperator *)event->customdata)
+ if (handler->op != (wmOperator *)event->customdata)
return action;
- switch(event->val) {
+ switch (event->val) {
case EVT_FILESELECT_OPEN:
case EVT_FILESELECT_FULL_OPEN:
- {
- ScrArea *sa;
+ {
+ ScrArea *sa;
- /* sa can be null when window A is active, but mouse is over window B */
- /* in this case, open file select in original window A */
- if (handler->op_area == NULL) {
- bScreen *screen = CTX_wm_screen(C);
- sa = (ScrArea *)screen->areabase.first;
- }
- else {
- sa = handler->op_area;
- }
+ /* sa can be null when window A is active, but mouse is over window B */
+ /* in this case, open file select in original window A */
+ if (handler->op_area == NULL) {
+ bScreen *screen = CTX_wm_screen(C);
+ sa = (ScrArea *)screen->areabase.first;
+ }
+ else {
+ sa = handler->op_area;
+ }
- if(event->val==EVT_FILESELECT_OPEN) {
- ED_area_newspace(C, sa, SPACE_FILE); /* 'sa' is modified in-place */
- }
- else {
- sa= ED_screen_full_newspace(C, sa, SPACE_FILE); /* sets context */
- }
+ if (event->val == EVT_FILESELECT_OPEN) {
+ ED_area_newspace(C, sa, SPACE_FILE); /* 'sa' is modified in-place */
+ }
+ else {
+ sa = ED_screen_full_newspace(C, sa, SPACE_FILE); /* sets context */
+ }
- /* note, getting the 'sa' back from the context causes a nasty bug where the newly created
- * 'sa' != CTX_wm_area(C). removed the line below and set 'sa' in the 'if' above */
- /* sa = CTX_wm_area(C); */
+ /* note, getting the 'sa' back from the context causes a nasty bug where the newly created
+ * 'sa' != CTX_wm_area(C). removed the line below and set 'sa' in the 'if' above */
+ /* sa = CTX_wm_area(C); */
- /* settings for filebrowser, sfile is not operator owner but sends events */
- sfile= (SpaceFile*)sa->spacedata.first;
- sfile->op= handler->op;
+ /* settings for filebrowser, sfile is not operator owner but sends events */
+ sfile = (SpaceFile *)sa->spacedata.first;
+ sfile->op = handler->op;
- ED_fileselect_set_params(sfile);
+ ED_fileselect_set_params(sfile);
- action= WM_HANDLER_BREAK;
- }
- break;
+ action = WM_HANDLER_BREAK;
+ }
+ break;
case EVT_FILESELECT_EXEC:
case EVT_FILESELECT_CANCEL:
case EVT_FILESELECT_EXTERNAL_CANCEL:
- {
- /* XXX validate area and region? */
- bScreen *screen= CTX_wm_screen(C);
+ {
+ /* XXX validate area and region? */
+ bScreen *screen = CTX_wm_screen(C);
- /* remlink now, for load file case before removing*/
- BLI_remlink(handlers, handler);
+ /* remlink now, for load file case before removing*/
+ BLI_remlink(handlers, handler);
- if(event->val!=EVT_FILESELECT_EXTERNAL_CANCEL) {
- if(screen != handler->filescreen) {
- ED_screen_full_prevspace(C, CTX_wm_area(C));
- }
- else {
- ED_area_prevspace(C, CTX_wm_area(C));
- }
+ if (event->val != EVT_FILESELECT_EXTERNAL_CANCEL) {
+ if (screen != handler->filescreen) {
+ ED_screen_full_prevspace(C, CTX_wm_area(C));
+ }
+ else {
+ ED_area_prevspace(C, CTX_wm_area(C));
}
+ }
- wm_handler_op_context(C, handler);
+ wm_handler_op_context(C, handler);
- /* needed for uiPupMenuReports */
+ /* needed for uiPupMenuReports */
- if(event->val==EVT_FILESELECT_EXEC) {
-#if 0 // use REDALERT now
+ if (event->val == EVT_FILESELECT_EXEC) {
+#if 0 // use REDALERT now
- /* a bit weak, might become arg for WM_event_fileselect? */
- /* XXX also extension code in image-save doesnt work for this yet */
- if (RNA_struct_find_property(handler->op->ptr, "check_existing") &&
- RNA_boolean_get(handler->op->ptr, "check_existing")) {
- char *path= RNA_string_get_alloc(handler->op->ptr, "filepath", NULL, 0);
- /* this gives ownership to pupmenu */
- uiPupMenuSaveOver(C, handler->op, (path)? path: "");
- if(path)
- MEM_freeN(path);
- }
- else
+ /* a bit weak, might become arg for WM_event_fileselect? */
+ /* XXX also extension code in image-save doesnt work for this yet */
+ if (RNA_struct_find_property(handler->op->ptr, "check_existing") &&
+ RNA_boolean_get(handler->op->ptr, "check_existing")) {
+ char *path = RNA_string_get_alloc(handler->op->ptr, "filepath", NULL, 0);
+ /* this gives ownership to pupmenu */
+ uiPupMenuSaveOver(C, handler->op, (path) ? path : "");
+ if (path)
+ MEM_freeN(path);
+ }
+ else
#endif
- {
- int retval;
+ {
+ int retval;
- if(handler->op->type->flag & OPTYPE_UNDO)
- wm->op_undo_depth++;
+ if (handler->op->type->flag & OPTYPE_UNDO)
+ wm->op_undo_depth++;
+
+ retval = handler->op->type->exec(C, handler->op);
- retval= handler->op->type->exec(C, handler->op);
+ /* XXX check this carefully, CTX_wm_manager(C) == wm is a bit hackish */
+ if (handler->op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm)
+ wm->op_undo_depth--;
- /* XXX check this carefully, CTX_wm_manager(C) == wm is a bit hackish */
- if(handler->op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm)
- wm->op_undo_depth--;
-
- if (retval & OPERATOR_FINISHED)
- if(G.f & G_DEBUG)
- wm_operator_print(C, handler->op);
-
- /* XXX check this carefully, CTX_wm_manager(C) == wm is a bit hackish */
- if(CTX_wm_manager(C) == wm && wm->op_undo_depth == 0)
- if(handler->op->type->flag & OPTYPE_UNDO)
- ED_undo_push_op(C, handler->op);
+ if (retval & OPERATOR_FINISHED)
+ if (G.debug & G_DEBUG_WM)
+ wm_operator_print(C, handler->op);
- if(handler->op->reports->list.first) {
+ /* XXX check this carefully, CTX_wm_manager(C) == wm is a bit hackish */
+ if (CTX_wm_manager(C) == wm && wm->op_undo_depth == 0)
+ if (handler->op->type->flag & OPTYPE_UNDO)
+ ED_undo_push_op(C, handler->op);
- /* FIXME, temp setting window, this is really bad!
- * only have because lib linking errors need to be seen by users :(
- * it can be removed without breaking anything but then no linking errors - campbell */
- wmWindow *win_prev= CTX_wm_window(C);
- ScrArea *area_prev= CTX_wm_area(C);
- ARegion *ar_prev= CTX_wm_region(C);
+ if (handler->op->reports->list.first) {
- if(win_prev==NULL)
- CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first);
+ /* FIXME, temp setting window, this is really bad!
+ * only have because lib linking errors need to be seen by users :(
+ * it can be removed without breaking anything but then no linking errors - campbell */
+ wmWindow *win_prev = CTX_wm_window(C);
+ ScrArea *area_prev = CTX_wm_area(C);
+ ARegion *ar_prev = CTX_wm_region(C);
- handler->op->reports->printlevel = RPT_WARNING;
- uiPupMenuReports(C, handler->op->reports);
+ if (win_prev == NULL)
+ CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first);
- /* XXX - copied from 'wm_operator_finished()' */
- /* add reports to the global list, otherwise they are not seen */
- BLI_movelisttolist(&CTX_wm_reports(C)->list, &handler->op->reports->list);
+ handler->op->reports->printlevel = RPT_WARNING;
+ uiPupMenuReports(C, handler->op->reports);
- CTX_wm_window_set(C, win_prev);
- CTX_wm_area_set(C, area_prev);
- CTX_wm_region_set(C, ar_prev);
- }
+ /* XXX - copied from 'wm_operator_finished()' */
+ /* add reports to the global list, otherwise they are not seen */
+ BLI_movelisttolist(&CTX_wm_reports(C)->list, &handler->op->reports->list);
- WM_operator_free(handler->op);
+ CTX_wm_window_set(C, win_prev);
+ CTX_wm_area_set(C, area_prev);
+ CTX_wm_region_set(C, ar_prev);
}
- }
- else {
- if(handler->op->type->cancel) {
- if(handler->op->type->flag & OPTYPE_UNDO)
- wm->op_undo_depth++;
-
- handler->op->type->cancel(C, handler->op);
- if(handler->op->type->flag & OPTYPE_UNDO)
- wm->op_undo_depth--;
+ if (retval & OPERATOR_FINISHED) {
+ WM_operator_last_properties_store(handler->op);
}
WM_operator_free(handler->op);
}
+ }
+ else {
+ if (handler->op->type->cancel) {
+ if (handler->op->type->flag & OPTYPE_UNDO)
+ wm->op_undo_depth++;
- CTX_wm_area_set(C, NULL);
+ handler->op->type->cancel(C, handler->op);
- wm_event_free_handler(handler);
+ if (handler->op->type->flag & OPTYPE_UNDO)
+ wm->op_undo_depth--;
+ }
- action= WM_HANDLER_BREAK;
+ WM_operator_free(handler->op);
}
- break;
+
+ CTX_wm_area_set(C, NULL);
+
+ wm_event_free_handler(handler);
+
+ action = WM_HANDLER_BREAK;
+ }
+ break;
}
return action;
@@ -1567,22 +1612,22 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa
static int handler_boundbox_test(wmEventHandler *handler, wmEvent *event)
{
- if(handler->bbwin) {
- if(handler->bblocal) {
- rcti rect= *handler->bblocal;
+ if (handler->bbwin) {
+ if (handler->bblocal) {
+ rcti rect = *handler->bblocal;
BLI_translate_rcti(&rect, handler->bbwin->xmin, handler->bbwin->ymin);
- if(BLI_in_rcti(&rect, event->x, event->y))
+ if (BLI_in_rcti(&rect, event->x, event->y))
return 1;
- else if(event->type==MOUSEMOVE && BLI_in_rcti(&rect, event->prevx, event->prevy))
+ else if (event->type == MOUSEMOVE && BLI_in_rcti(&rect, event->prevx, event->prevy))
return 1;
else
return 0;
}
else {
- if(BLI_in_rcti(handler->bbwin, event->x, event->y))
+ if (BLI_in_rcti(handler->bbwin, event->x, event->y))
return 1;
- else if(event->type==MOUSEMOVE && BLI_in_rcti(handler->bbwin, event->prevx, event->prevy))
+ else if (event->type == MOUSEMOVE && BLI_in_rcti(handler->bbwin, event->prevx, event->prevy))
return 1;
else
return 0;
@@ -1593,83 +1638,83 @@ static int handler_boundbox_test(wmEventHandler *handler, wmEvent *event)
static int wm_action_not_handled(int action)
{
- return action == WM_HANDLER_CONTINUE || action == (WM_HANDLER_BREAK|WM_HANDLER_MODAL);
+ return action == WM_HANDLER_CONTINUE || action == (WM_HANDLER_BREAK | WM_HANDLER_MODAL);
}
static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
wmEventHandler *handler, *nexthandler;
- int action= WM_HANDLER_CONTINUE;
+ int action = WM_HANDLER_CONTINUE;
int always_pass;
- if(handlers==NULL) return action;
+ if (handlers == NULL) return action;
/* modal handlers can get removed in this loop, we keep the loop this way */
- for(handler= handlers->first; handler; handler= nexthandler) {
+ for (handler = handlers->first; handler; handler = nexthandler) {
- nexthandler= handler->next;
+ nexthandler = handler->next;
/* during this loop, ui handlers for nested menus can tag multiple handlers free */
- if(handler->flag & WM_HANDLER_DO_FREE);
- /* optional boundbox */
- else if(handler_boundbox_test(handler, event)) {
+ if (handler->flag & WM_HANDLER_DO_FREE) ;
+ /* optional boundbox */
+ else if (handler_boundbox_test(handler, event)) {
/* in advance to avoid access to freed event on window close */
- always_pass= wm_event_always_pass(event);
+ always_pass = wm_event_always_pass(event);
/* modal+blocking handler */
- if(handler->flag & WM_HANDLER_BLOCKING)
+ if (handler->flag & WM_HANDLER_BLOCKING)
action |= WM_HANDLER_BREAK;
- if(handler->keymap) {
- wmKeyMap *keymap= WM_keymap_active(wm, handler->keymap);
+ if (handler->keymap) {
+ wmKeyMap *keymap = WM_keymap_active(wm, handler->keymap);
wmKeyMapItem *kmi;
- if(!keymap->poll || keymap->poll(C)) {
- for(kmi= keymap->items.first; kmi; kmi= kmi->next) {
- if(wm_eventmatch(event, kmi)) {
+ if (!keymap->poll || keymap->poll(C)) {
+ for (kmi = keymap->items.first; kmi; kmi = kmi->next) {
+ if (wm_eventmatch(event, kmi)) {
/* weak, but allows interactive callback to not use rawkey */
event->keymap_idname = kmi->idname;
action |= wm_handler_operator_call(C, handlers, handler, event, kmi->ptr);
- if(action & WM_HANDLER_BREAK) /* not always_pass here, it denotes removed handler */
+ if (action & WM_HANDLER_BREAK) /* not always_pass here, it denotes removed handler */
break;
}
}
}
}
- else if(handler->ui_handle) {
+ else if (handler->ui_handle) {
action |= wm_handler_ui_call(C, handler, event, always_pass);
}
- else if(handler->type==WM_HANDLER_FILESELECT) {
+ else if (handler->type == WM_HANDLER_FILESELECT) {
/* screen context changes here */
action |= wm_handler_fileselect_call(C, handlers, handler, event);
}
- else if(handler->dropboxes) {
- if(event->type==EVT_DROP) {
- wmDropBox *drop= handler->dropboxes->first;
- for(; drop; drop= drop->next) {
+ else if (handler->dropboxes) {
+ if (event->type == EVT_DROP) {
+ wmDropBox *drop = handler->dropboxes->first;
+ for (; drop; drop = drop->next) {
/* other drop custom types allowed */
- if(event->custom==EVT_DATA_LISTBASE) {
- ListBase *lb= (ListBase *)event->customdata;
+ if (event->custom == EVT_DATA_LISTBASE) {
+ ListBase *lb = (ListBase *)event->customdata;
wmDrag *drag;
- for(drag= lb->first; drag; drag= drag->next) {
- if(drop->poll(C, drag, event)) {
+ for (drag = lb->first; drag; drag = drag->next) {
+ if (drop->poll(C, drag, event)) {
drop->copy(drag, drop);
/* free the drags before calling operator */
BLI_freelistN(event->customdata);
- event->customdata= NULL;
- event->custom= 0;
+ event->customdata = NULL;
+ event->custom = 0;
WM_operator_name_call(C, drop->ot->idname, drop->opcontext, drop->ptr);
action |= WM_HANDLER_BREAK;
/* XXX fileread case */
- if(CTX_wm_window(C)==NULL)
+ if (CTX_wm_window(C) == NULL)
return action;
/* escape from drag loop, got freed */
@@ -1685,8 +1730,8 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
action |= wm_handler_operator_call(C, handlers, handler, event, NULL);
}
- if(action & WM_HANDLER_BREAK) {
- if(always_pass)
+ if (action & WM_HANDLER_BREAK) {
+ if (always_pass)
action &= ~WM_HANDLER_BREAK;
else
break;
@@ -1695,15 +1740,15 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
/* XXX fileread case, if the wm is freed then the handler's
* will have been too so the code below need not run. */
- if(CTX_wm_window(C)==NULL) {
+ if (CTX_wm_window(C) == NULL) {
return action;
}
/* 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(handler->flag & WM_HANDLER_DO_FREE) {
+ 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);
}
@@ -1724,10 +1769,10 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
* If no double click events are found it will fallback to a single click.
* So a double click event can result in 2 successive single click calls
* if its not handled by the keymap - campbell */
- if ( (ABS(event->x - win->eventstate->prevclickx)) <= 2 &&
- (ABS(event->y - win->eventstate->prevclicky)) <= 2 &&
- ((PIL_check_seconds_timer() - win->eventstate->prevclicktime) * 1000 < U.dbl_click_time)
- ) {
+ if ((ABS(event->x - win->eventstate->prevclickx)) <= 2 &&
+ (ABS(event->y - win->eventstate->prevclicky)) <= 2 &&
+ ((PIL_check_seconds_timer() - win->eventstate->prevclicktime) * 1000 < U.dbl_click_time))
+ {
event->val = KM_DBL_CLICK;
/* removed this because in cases where we're this is used as a single click
* event, this will give old coords,
@@ -1750,7 +1795,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
}
}
- if(action == (WM_HANDLER_BREAK|WM_HANDLER_MODAL))
+ if (action == (WM_HANDLER_BREAK | WM_HANDLER_MODAL))
wm_cursor_arrow_move(CTX_wm_window(C), event);
return action;
@@ -1758,12 +1803,12 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
static int wm_event_inside_i(wmEvent *event, rcti *rect)
{
- if(wm_event_always_pass(event))
+ if (wm_event_always_pass(event))
return 1;
- if(BLI_in_rcti(rect, event->x, event->y))
+ if (BLI_in_rcti(rect, event->x, event->y))
return 1;
- if(event->type==MOUSEMOVE) {
- if( BLI_in_rcti(rect, event->prevx, event->prevy)) {
+ if (event->type == MOUSEMOVE) {
+ if (BLI_in_rcti(rect, event->prevx, event->prevy)) {
return 1;
}
return 0;
@@ -1773,36 +1818,36 @@ static int wm_event_inside_i(wmEvent *event, rcti *rect)
static ScrArea *area_event_inside(bContext *C, int x, int y)
{
- bScreen *screen= CTX_wm_screen(C);
+ bScreen *screen = CTX_wm_screen(C);
ScrArea *sa;
- if(screen)
- for(sa= screen->areabase.first; sa; sa= sa->next)
- if(BLI_in_rcti(&sa->totrct, x, y))
+ if (screen)
+ for (sa = screen->areabase.first; sa; sa = sa->next)
+ if (BLI_in_rcti(&sa->totrct, x, y))
return sa;
return NULL;
}
static ARegion *region_event_inside(bContext *C, int x, int y)
{
- bScreen *screen= CTX_wm_screen(C);
- ScrArea *area= CTX_wm_area(C);
+ bScreen *screen = CTX_wm_screen(C);
+ ScrArea *area = CTX_wm_area(C);
ARegion *ar;
- if(screen && area)
- for(ar= area->regionbase.first; ar; ar= ar->next)
- if(BLI_in_rcti(&ar->winrct, x, y))
+ if (screen && area)
+ for (ar = area->regionbase.first; ar; ar = ar->next)
+ if (BLI_in_rcti(&ar->winrct, x, y))
return ar;
return NULL;
}
static void wm_paintcursor_tag(bContext *C, wmPaintCursor *pc, ARegion *ar)
{
- if(ar) {
- for(; pc; pc= pc->next) {
- if(pc->poll == NULL || pc->poll(C)) {
- wmWindow *win= CTX_wm_window(C);
- win->screen->do_draw_paintcursor= 1;
+ if (ar) {
+ for (; pc; pc = pc->next) {
+ if (pc->poll == NULL || pc->poll(C)) {
+ wmWindow *win = CTX_wm_window(C);
+ win->screen->do_draw_paintcursor = 1;
wm_tag_redraw_overlay(win, ar);
}
}
@@ -1813,17 +1858,17 @@ static void wm_paintcursor_tag(bContext *C, wmPaintCursor *pc, ARegion *ar)
/* context was set on active area and region */
static void wm_paintcursor_test(bContext *C, wmEvent *event)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
- if(wm->paintcursors.first) {
- ARegion *ar= CTX_wm_region(C);
+ if (wm->paintcursors.first) {
+ ARegion *ar = CTX_wm_region(C);
- if(ar)
+ if (ar)
wm_paintcursor_tag(C, wm->paintcursors.first, ar);
/* if previous position was not in current region, we have to set a temp new context */
- if(ar==NULL || !BLI_in_rcti(&ar->winrct, event->prevx, event->prevy)) {
- ScrArea *sa= CTX_wm_area(C);
+ if (ar == NULL || !BLI_in_rcti(&ar->winrct, event->prevx, event->prevy)) {
+ ScrArea *sa = CTX_wm_area(C);
CTX_wm_area_set(C, area_event_inside(C, event->prevx, event->prevy));
CTX_wm_region_set(C, region_event_inside(C, event->prevx, event->prevy));
@@ -1838,38 +1883,38 @@ static void wm_paintcursor_test(bContext *C, wmEvent *event)
static void wm_event_drag_test(wmWindowManager *wm, wmWindow *win, wmEvent *event)
{
- if(wm->drags.first==NULL) return;
+ if (wm->drags.first == NULL) return;
- if(event->type==MOUSEMOVE)
- win->screen->do_draw_drag= 1;
- else if(event->type==ESCKEY) {
+ if (event->type == MOUSEMOVE)
+ win->screen->do_draw_drag = 1;
+ else if (event->type == ESCKEY) {
BLI_freelistN(&wm->drags);
- win->screen->do_draw_drag= 1;
+ win->screen->do_draw_drag = 1;
}
- else if(event->type==LEFTMOUSE && event->val==KM_RELEASE) {
- event->type= EVT_DROP;
+ else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
+ event->type = EVT_DROP;
/* create customdata, first free existing */
- if(event->customdata) {
- if(event->customdatafree)
+ if (event->customdata) {
+ if (event->customdatafree)
MEM_freeN(event->customdata);
}
- event->custom= EVT_DATA_LISTBASE;
- event->customdata= &wm->drags;
- event->customdatafree= 1;
+ event->custom = EVT_DATA_LISTBASE;
+ event->customdata = &wm->drags;
+ event->customdatafree = 1;
/* clear drop icon */
- win->screen->do_draw_drag= 1;
+ win->screen->do_draw_drag = 1;
/* restore cursor (disabled, see wm_dragdrop.c) */
// WM_cursor_restore(win);
}
/* overlap fails otherwise */
- if(win->screen->do_draw_drag)
- if(win->drawmethod == USER_DRAW_OVERLAP)
- win->screen->do_draw= 1;
+ if (win->screen->do_draw_drag)
+ if (win->drawmethod == USER_DRAW_OVERLAP)
+ win->screen->do_draw = 1;
}
@@ -1877,37 +1922,37 @@ static void wm_event_drag_test(wmWindowManager *wm, wmWindow *win, wmEvent *even
/* goes over entire hierarchy: events -> window -> screen -> area -> region */
void wm_event_do_handlers(bContext *C)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
wmWindow *win;
/* update key configuration before handling events */
WM_keyconfig_update(wm);
- for(win= wm->windows.first; win; win= win->next) {
+ for (win = wm->windows.first; win; win = win->next) {
wmEvent *event;
- if( win->screen==NULL )
+ if (win->screen == NULL)
wm_event_free_all(win);
else {
- Scene* scene = win->screen->scene;
+ Scene *scene = win->screen->scene;
- if(scene) {
+ if (scene) {
int playing = sound_scene_playing(win->screen->scene);
- if(playing != -1) {
+ if (playing != -1) {
CTX_wm_window_set(C, win);
CTX_wm_screen_set(C, win->screen);
CTX_data_scene_set(C, scene);
- if(((playing == 1) && (!win->screen->animtimer)) || ((playing == 0) && (win->screen->animtimer))){
+ if (((playing == 1) && (!win->screen->animtimer)) || ((playing == 0) && (win->screen->animtimer))) {
ED_screen_animation_play(C, -1, 1);
}
- if(playing == 0) {
+ if (playing == 0) {
float time = sound_sync_scene(scene);
- if(finite(time)) {
+ if (finite(time)) {
int ncfra = sound_sync_scene(scene) * (float)FPS + 0.5f;
- if(ncfra != scene->r.cfra) {
+ if (ncfra != scene->r.cfra) {
scene->r.cfra = ncfra;
ED_update_for_newframe(CTX_data_main(C), scene, win->screen, 1);
WM_event_add_notifier(C, NC_WINDOW, NULL);
@@ -1922,12 +1967,13 @@ void wm_event_do_handlers(bContext *C)
}
}
- while( (event= win->queue.first) ) {
+ while ( (event = win->queue.first) ) {
int action = WM_HANDLER_CONTINUE;
- if((G.f & G_DEBUG) && event && !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE))
- printf("pass on evt %d val %d\n", event->type, event->val);
-
+ if ((G.debug & G_DEBUG_EVENTS) && event && !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
+ printf("%s: pass on evt %d val %d\n", __func__, event->type, event->val);
+ }
+
wm_eventemulation(event);
CTX_wm_window_set(C, win);
@@ -1945,7 +1991,7 @@ void wm_event_do_handlers(bContext *C)
action |= wm_handlers_do(C, event, &win->modalhandlers);
/* fileread case */
- if(CTX_wm_window(C)==NULL)
+ if (CTX_wm_window(C) == NULL)
return;
/* check dragging, creates new event or frees, adds draw tag */
@@ -1954,29 +2000,29 @@ void wm_event_do_handlers(bContext *C)
/* builtin tweak, if action is break it removes tweak */
wm_tweakevent_test(C, event, action);
- if((action & WM_HANDLER_BREAK) == 0) {
+ if ((action & WM_HANDLER_BREAK) == 0) {
ScrArea *sa;
ARegion *ar;
- int doit= 0;
+ int doit = 0;
/* Note: setting subwin active should be done here, after modal handlers have been done */
- if(event->type==MOUSEMOVE) {
+ if (event->type == MOUSEMOVE) {
/* state variables in screen, cursors. Also used in wm_draw.c, fails for modal handlers though */
ED_screen_set_subwinactive(C, event);
/* for regions having custom cursors */
wm_paintcursor_test(C, event);
}
- else if (event->type==NDOF_MOTION) {
+ else if (event->type == NDOF_MOTION) {
win->addmousemove = TRUE;
}
- for(sa= win->screen->areabase.first; sa; sa= sa->next) {
- if(wm_event_inside_i(event, &sa->totrct)) {
+ for (sa = win->screen->areabase.first; sa; sa = sa->next) {
+ if (wm_event_inside_i(event, &sa->totrct)) {
CTX_wm_area_set(C, sa);
- if((action & WM_HANDLER_BREAK) == 0) {
- for(ar=sa->regionbase.first; ar; ar= ar->next) {
- if(wm_event_inside_i(event, &ar->winrct)) {
+ if ((action & WM_HANDLER_BREAK) == 0) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (wm_event_inside_i(event, &ar->winrct)) {
CTX_wm_region_set(C, ar);
/* call even on non mouse events, since the */
@@ -1984,19 +2030,19 @@ void wm_event_do_handlers(bContext *C)
/* does polls for drop regions and checks uibuts */
/* need to be here to make sure region context is true */
- if(ELEM(event->type, MOUSEMOVE, EVT_DROP)) {
+ if (ELEM(event->type, MOUSEMOVE, EVT_DROP)) {
wm_drags_check_ops(C, event);
}
action |= wm_handlers_do(C, event, &ar->handlers);
/* fileread case (python), [#29489] */
- if(CTX_wm_window(C)==NULL)
+ if (CTX_wm_window(C) == NULL)
return;
doit |= (BLI_in_rcti(&ar->winrct, event->x, event->y));
- if(action & WM_HANDLER_BREAK)
+ if (action & WM_HANDLER_BREAK)
break;
}
}
@@ -2004,7 +2050,7 @@ void wm_event_do_handlers(bContext *C)
CTX_wm_region_set(C, NULL);
- if((action & WM_HANDLER_BREAK) == 0) {
+ if ((action & WM_HANDLER_BREAK) == 0) {
wm_region_mouse_co(C, event); /* only invalidates event->mval in this case */
action |= wm_handlers_do(C, event, &sa->handlers);
}
@@ -2014,7 +2060,7 @@ void wm_event_do_handlers(bContext *C)
}
}
- if((action & WM_HANDLER_BREAK) == 0) {
+ if ((action & WM_HANDLER_BREAK) == 0) {
/* also some non-modal handlers need active area/region */
CTX_wm_area_set(C, area_event_inside(C, event->x, event->y));
CTX_wm_region_set(C, region_event_inside(C, event->x, event->y));
@@ -2024,15 +2070,15 @@ void wm_event_do_handlers(bContext *C)
action |= wm_handlers_do(C, event, &win->handlers);
/* fileread case */
- if(CTX_wm_window(C)==NULL)
+ if (CTX_wm_window(C) == NULL)
return;
}
/* 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 */
- if(doit && win->screen && win->screen->subwinactive != win->screen->mainwin) {
- win->eventstate->prevx= event->x;
- win->eventstate->prevy= event->y;
+ * 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;
//printf("win->eventstate->prev = %d %d\n", event->x, event->y);
}
else {
@@ -2051,20 +2097,23 @@ void wm_event_do_handlers(bContext *C)
win->eventstate->prevclickx = event->x;
win->eventstate->prevclicky = event->y;
}
- } else {
+ }
+ else {
/* reset click time if event type not the same */
win->eventstate->prevclicktime = 0;
}
win->eventstate->prevval = event->val;
win->eventstate->prevtype = event->type;
- } else if (event->val == KM_CLICK) { /* keep click for double click later */
+ }
+ else if (event->val == KM_CLICK) { /* keep click for double click later */
win->eventstate->prevtype = event->type;
win->eventstate->prevval = event->val;
win->eventstate->prevclicktime = PIL_check_seconds_timer();
win->eventstate->prevclickx = event->x;
win->eventstate->prevclicky = event->y;
- } else { /* reset if not */
+ }
+ else { /* reset if not */
win->eventstate->prevtype = -1;
win->eventstate->prevval = 0;
win->eventstate->prevclicktime = 0;
@@ -2078,14 +2127,14 @@ void wm_event_do_handlers(bContext *C)
}
/* only add mousemove when queue was read entirely */
- if(win->addmousemove && win->eventstate) {
- wmEvent tevent= *(win->eventstate);
+ if (win->addmousemove && win->eventstate) {
+ wmEvent tevent = *(win->eventstate);
//printf("adding MOUSEMOVE %d %d\n", tevent.x, tevent.y);
- tevent.type= MOUSEMOVE;
- tevent.prevx= tevent.x;
- tevent.prevy= tevent.y;
+ tevent.type = MOUSEMOVE;
+ tevent.prevx = tevent.x;
+ tevent.prevy = tevent.y;
wm_event_add(win, &tevent);
- win->addmousemove= 0;
+ win->addmousemove = 0;
}
CTX_wm_window_set(C, NULL);
@@ -2102,12 +2151,12 @@ void WM_event_fileselect_event(bContext *C, void *ophandle, int eventval)
/* add to all windows! */
wmWindow *win;
- for(win= CTX_wm_manager(C)->windows.first; win; win= win->next) {
- wmEvent event= *win->eventstate;
+ for (win = CTX_wm_manager(C)->windows.first; win; win = win->next) {
+ wmEvent event = *win->eventstate;
- event.type= EVT_FILESELECT;
- event.val= eventval;
- event.customdata= ophandle; // only as void pointer type check
+ event.type = EVT_FILESELECT;
+ event.val = eventval;
+ event.customdata = ophandle; // only as void pointer type check
wm_event_add(win, &event);
}
@@ -2117,22 +2166,22 @@ 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)
{
wmEventHandler *handler, *handlernext;
- wmWindow *win= CTX_wm_window(C);
- int full= 1; // XXX preset?
+ wmWindow *win = CTX_wm_window(C);
+ int full = 1; // XXX preset?
/* only allow 1 file selector open per window */
- for(handler= win->modalhandlers.first; handler; handler=handlernext) {
- handlernext= handler->next;
+ for (handler = win->modalhandlers.first; handler; handler = handlernext) {
+ handlernext = handler->next;
- if(handler->type == WM_HANDLER_FILESELECT) {
- if(handler->op)
+ if (handler->type == WM_HANDLER_FILESELECT) {
+ if (handler->op)
WM_operator_free(handler->op);
BLI_remlink(&win->modalhandlers, handler);
wm_event_free_handler(handler);
@@ -2141,48 +2190,48 @@ void WM_event_add_fileselect(bContext *C, wmOperator *op)
handler = MEM_callocN(sizeof(wmEventHandler), "fileselect handler");
- handler->type= WM_HANDLER_FILESELECT;
- handler->op= op;
- handler->op_area= CTX_wm_area(C);
- handler->op_region= CTX_wm_region(C);
- handler->filescreen= CTX_wm_screen(C);
+ handler->type = WM_HANDLER_FILESELECT;
+ handler->op = op;
+ handler->op_area = CTX_wm_area(C);
+ handler->op_region = CTX_wm_region(C);
+ handler->filescreen = CTX_wm_screen(C);
BLI_addhead(&win->modalhandlers, handler);
/* check props once before invoking if check is available
* ensures initial properties are valid */
- if(op->type->check) {
+ if (op->type->check) {
op->type->check(C, op); /* ignore return value */
}
- WM_event_fileselect_event(C, op, full?EVT_FILESELECT_FULL_OPEN:EVT_FILESELECT_OPEN);
+ WM_event_fileselect_event(C, op, full ? EVT_FILESELECT_FULL_OPEN : EVT_FILESELECT_OPEN);
}
#if 0
/* lets not expose struct outside wm? */
static void WM_event_set_handler_flag(wmEventHandler *handler, int flag)
{
- handler->flag= flag;
+ handler->flag = flag;
}
#endif
wmEventHandler *WM_event_add_modal_handler(bContext *C, wmOperator *op)
{
- wmEventHandler *handler= MEM_callocN(sizeof(wmEventHandler), "event modal handler");
- wmWindow *win= CTX_wm_window(C);
+ wmEventHandler *handler = MEM_callocN(sizeof(wmEventHandler), "event modal handler");
+ wmWindow *win = CTX_wm_window(C);
/* operator was part of macro */
- if(op->opm) {
+ if (op->opm) {
/* give the mother macro to the handler */
- handler->op= op->opm;
+ handler->op = op->opm;
/* mother macro opm becomes the macro element */
- handler->op->opm= op;
+ handler->op->opm = op;
}
else
- handler->op= op;
+ handler->op = op;
- handler->op_area= CTX_wm_area(C); /* means frozen screen context for modal handlers! */
- handler->op_region= CTX_wm_region(C);
+ handler->op_area = CTX_wm_area(C); /* means frozen screen context for modal handlers! */
+ handler->op_region = CTX_wm_region(C);
BLI_addhead(&win->modalhandlers, handler);
@@ -2193,19 +2242,19 @@ wmEventHandler *WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap *keymap
{
wmEventHandler *handler;
- if(!keymap) {
+ if (!keymap) {
printf("WM_event_add_keymap_handler called with NULL keymap\n");
return NULL;
}
/* only allow same keymap once */
- for(handler= handlers->first; handler; handler= handler->next)
- if(handler->keymap==keymap)
+ for (handler = handlers->first; handler; handler = handler->next)
+ if (handler->keymap == keymap)
return handler;
- handler= MEM_callocN(sizeof(wmEventHandler), "event keymap handler");
+ handler = MEM_callocN(sizeof(wmEventHandler), "event keymap handler");
BLI_addtail(handlers, handler);
- handler->keymap= keymap;
+ handler->keymap = keymap;
return handler;
}
@@ -2217,20 +2266,20 @@ wmEventHandler *WM_event_add_keymap_handler_priority(ListBase *handlers, wmKeyMa
WM_event_remove_keymap_handler(handlers, keymap);
- handler= MEM_callocN(sizeof(wmEventHandler), "event keymap handler");
+ handler = MEM_callocN(sizeof(wmEventHandler), "event keymap handler");
BLI_addhead(handlers, handler);
- handler->keymap= keymap;
+ handler->keymap = keymap;
return handler;
}
wmEventHandler *WM_event_add_keymap_handler_bb(ListBase *handlers, wmKeyMap *keymap, rcti *bblocal, rcti *bbwin)
{
- wmEventHandler *handler= WM_event_add_keymap_handler(handlers, keymap);
+ wmEventHandler *handler = WM_event_add_keymap_handler(handlers, keymap);
- if(handler) {
- handler->bblocal= bblocal;
- handler->bbwin= bbwin;
+ if (handler) {
+ handler->bblocal = bblocal;
+ handler->bbwin = bbwin;
}
return handler;
}
@@ -2239,8 +2288,8 @@ void WM_event_remove_keymap_handler(ListBase *handlers, wmKeyMap *keymap)
{
wmEventHandler *handler;
- for(handler= handlers->first; handler; handler= handler->next) {
- if(handler->keymap==keymap) {
+ for (handler = handlers->first; handler; handler = handler->next) {
+ if (handler->keymap == keymap) {
BLI_remlink(handlers, handler);
wm_event_free_handler(handler);
break;
@@ -2251,29 +2300,29 @@ void WM_event_remove_keymap_handler(ListBase *handlers, wmKeyMap *keymap)
wmEventHandler *WM_event_add_ui_handler(const bContext *C, ListBase *handlers,
wmUIHandlerFunc func, wmUIHandlerRemoveFunc remove, void *userdata)
{
- wmEventHandler *handler= MEM_callocN(sizeof(wmEventHandler), "event ui handler");
- handler->ui_handle= func;
- handler->ui_remove= remove;
- handler->ui_userdata= userdata;
- handler->ui_area= (C)? CTX_wm_area(C): NULL;
- handler->ui_region= (C)? CTX_wm_region(C): NULL;
- handler->ui_menu= (C)? CTX_wm_menu(C): NULL;
+ wmEventHandler *handler = MEM_callocN(sizeof(wmEventHandler), "event ui handler");
+ handler->ui_handle = func;
+ handler->ui_remove = remove;
+ handler->ui_userdata = userdata;
+ handler->ui_area = (C) ? CTX_wm_area(C) : NULL;
+ handler->ui_region = (C) ? CTX_wm_region(C) : NULL;
+ handler->ui_menu = (C) ? CTX_wm_menu(C) : NULL;
BLI_addhead(handlers, handler);
return handler;
}
-/* set "postpone" for win->modalhandlers, this is in a running for() loop in wm_handlers_do() */
+/* set "postpone" for win->modalhandlers, this is in a running for () loop in wm_handlers_do() */
void WM_event_remove_ui_handler(ListBase *handlers,
wmUIHandlerFunc func, wmUIHandlerRemoveFunc remove, void *userdata, int postpone)
{
wmEventHandler *handler;
- for(handler= handlers->first; handler; handler= handler->next) {
- if(handler->ui_handle == func && handler->ui_remove == remove && handler->ui_userdata == userdata) {
+ for (handler = handlers->first; handler; handler = handler->next) {
+ if (handler->ui_handle == func && handler->ui_remove == remove && handler->ui_userdata == userdata) {
/* handlers will be freed in wm_handlers_do() */
- if(postpone) {
+ if (postpone) {
handler->flag |= WM_HANDLER_DO_FREE;
}
else {
@@ -2290,14 +2339,14 @@ wmEventHandler *WM_event_add_dropbox_handler(ListBase *handlers, ListBase *dropb
wmEventHandler *handler;
/* only allow same dropbox once */
- for(handler= handlers->first; handler; handler= handler->next)
- if(handler->dropboxes==dropboxes)
+ for (handler = handlers->first; handler; handler = handler->next)
+ if (handler->dropboxes == dropboxes)
return handler;
- handler= MEM_callocN(sizeof(wmEventHandler), "dropbox handler");
+ handler = MEM_callocN(sizeof(wmEventHandler), "dropbox handler");
/* dropbox stored static, no free or copy */
- handler->dropboxes= dropboxes;
+ handler->dropboxes = dropboxes;
BLI_addhead(handlers, handler);
return handler;
@@ -2308,7 +2357,7 @@ void WM_event_remove_area_handler(ListBase *handlers, void *area)
{
wmEventHandler *handler, *nexthandler;
- for(handler = handlers->first; handler; handler= nexthandler) {
+ for (handler = handlers->first; handler; handler = nexthandler) {
nexthandler = handler->next;
if (handler->type != WM_HANDLER_FILESELECT) {
if (handler->ui_area == area) {
@@ -2329,16 +2378,16 @@ static void WM_event_remove_handler(ListBase *handlers, wmEventHandler *handler)
void WM_event_add_mousemove(bContext *C)
{
- wmWindow *window= CTX_wm_window(C);
+ wmWindow *window = CTX_wm_window(C);
- window->addmousemove= 1;
+ window->addmousemove = 1;
}
/* for modal callbacks, check configuration for how to interpret exit with tweaks */
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 */
@@ -2353,7 +2402,7 @@ int WM_modal_tweak_exit(wmEvent *evt, int tweak_event)
else {
/* if the initial event wasn't a tweak event then
* ignore USER_RELEASECONFIRM setting: see [#26756] */
- if(ELEM3(tweak_event, EVT_TWEAK_L, EVT_TWEAK_M, EVT_TWEAK_R) == 0) {
+ if (ELEM3(tweak_event, EVT_TWEAK_L, EVT_TWEAK_M, EVT_TWEAK_R) == 0) {
return 1;
}
}
@@ -2374,81 +2423,85 @@ int WM_modal_tweak_exit(wmEvent *evt, int tweak_event)
static int convert_key(GHOST_TKey key)
{
- if (key>=GHOST_kKeyA && key<=GHOST_kKeyZ) {
+ if (key >= GHOST_kKeyA && key <= GHOST_kKeyZ) {
return (AKEY + ((int) key - GHOST_kKeyA));
- } else if (key>=GHOST_kKey0 && key<=GHOST_kKey9) {
+ }
+ else if (key >= GHOST_kKey0 && key <= GHOST_kKey9) {
return (ZEROKEY + ((int) key - GHOST_kKey0));
- } else if (key>=GHOST_kKeyNumpad0 && key<=GHOST_kKeyNumpad9) {
+ }
+ else if (key >= GHOST_kKeyNumpad0 && key <= GHOST_kKeyNumpad9) {
return (PAD0 + ((int) key - GHOST_kKeyNumpad0));
- } else if (key>=GHOST_kKeyF1 && key<=GHOST_kKeyF19) {
+ }
+ else if (key >= GHOST_kKeyF1 && key <= GHOST_kKeyF19) {
return (F1KEY + ((int) key - GHOST_kKeyF1));
- } else {
+ }
+ else {
switch (key) {
- case GHOST_kKeyBackSpace: return BACKSPACEKEY;
- case GHOST_kKeyTab: return TABKEY;
- case GHOST_kKeyLinefeed: return LINEFEEDKEY;
- case GHOST_kKeyClear: return 0;
- case GHOST_kKeyEnter: return RETKEY;
-
- case GHOST_kKeyEsc: return ESCKEY;
- case GHOST_kKeySpace: return SPACEKEY;
- case GHOST_kKeyQuote: return QUOTEKEY;
- case GHOST_kKeyComma: return COMMAKEY;
- case GHOST_kKeyMinus: return MINUSKEY;
- case GHOST_kKeyPeriod: return PERIODKEY;
- case GHOST_kKeySlash: return SLASHKEY;
-
- case GHOST_kKeySemicolon: return SEMICOLONKEY;
- case GHOST_kKeyEqual: return EQUALKEY;
-
- case GHOST_kKeyLeftBracket: return LEFTBRACKETKEY;
- case GHOST_kKeyRightBracket: return RIGHTBRACKETKEY;
- case GHOST_kKeyBackslash: return BACKSLASHKEY;
- case GHOST_kKeyAccentGrave: return ACCENTGRAVEKEY;
-
- case GHOST_kKeyLeftShift: return LEFTSHIFTKEY;
- case GHOST_kKeyRightShift: return RIGHTSHIFTKEY;
- case GHOST_kKeyLeftControl: return LEFTCTRLKEY;
- case GHOST_kKeyRightControl: return RIGHTCTRLKEY;
- case GHOST_kKeyOS: return OSKEY;
- case GHOST_kKeyLeftAlt: return LEFTALTKEY;
- case GHOST_kKeyRightAlt: return RIGHTALTKEY;
-
- case GHOST_kKeyCapsLock: return CAPSLOCKKEY;
- case GHOST_kKeyNumLock: return 0;
- case GHOST_kKeyScrollLock: return 0;
-
- case GHOST_kKeyLeftArrow: return LEFTARROWKEY;
- case GHOST_kKeyRightArrow: return RIGHTARROWKEY;
- case GHOST_kKeyUpArrow: return UPARROWKEY;
- case GHOST_kKeyDownArrow: return DOWNARROWKEY;
-
- case GHOST_kKeyPrintScreen: return 0;
- case GHOST_kKeyPause: return PAUSEKEY;
-
- case GHOST_kKeyInsert: return INSERTKEY;
- case GHOST_kKeyDelete: return DELKEY;
- case GHOST_kKeyHome: return HOMEKEY;
- case GHOST_kKeyEnd: return ENDKEY;
- case GHOST_kKeyUpPage: return PAGEUPKEY;
- case GHOST_kKeyDownPage: return PAGEDOWNKEY;
-
- case GHOST_kKeyNumpadPeriod: return PADPERIOD;
- case GHOST_kKeyNumpadEnter: return PADENTER;
- case GHOST_kKeyNumpadPlus: return PADPLUSKEY;
- case GHOST_kKeyNumpadMinus: return PADMINUS;
- case GHOST_kKeyNumpadAsterisk: return PADASTERKEY;
- case GHOST_kKeyNumpadSlash: return PADSLASHKEY;
-
- case GHOST_kKeyGrLess: return GRLESSKEY;
-
- case GHOST_kKeyMediaPlay: return MEDIAPLAY;
- case GHOST_kKeyMediaStop: return MEDIASTOP;
- case GHOST_kKeyMediaFirst: return MEDIAFIRST;
- case GHOST_kKeyMediaLast: return MEDIALAST;
+ case GHOST_kKeyBackSpace: return BACKSPACEKEY;
+ case GHOST_kKeyTab: return TABKEY;
+ case GHOST_kKeyLinefeed: return LINEFEEDKEY;
+ case GHOST_kKeyClear: return 0;
+ case GHOST_kKeyEnter: return RETKEY;
+
+ case GHOST_kKeyEsc: return ESCKEY;
+ case GHOST_kKeySpace: return SPACEKEY;
+ case GHOST_kKeyQuote: return QUOTEKEY;
+ case GHOST_kKeyComma: return COMMAKEY;
+ case GHOST_kKeyMinus: return MINUSKEY;
+ case GHOST_kKeyPeriod: return PERIODKEY;
+ case GHOST_kKeySlash: return SLASHKEY;
+
+ case GHOST_kKeySemicolon: return SEMICOLONKEY;
+ case GHOST_kKeyEqual: return EQUALKEY;
+
+ case GHOST_kKeyLeftBracket: return LEFTBRACKETKEY;
+ case GHOST_kKeyRightBracket: return RIGHTBRACKETKEY;
+ case GHOST_kKeyBackslash: return BACKSLASHKEY;
+ case GHOST_kKeyAccentGrave: return ACCENTGRAVEKEY;
+
+ case GHOST_kKeyLeftShift: return LEFTSHIFTKEY;
+ case GHOST_kKeyRightShift: return RIGHTSHIFTKEY;
+ case GHOST_kKeyLeftControl: return LEFTCTRLKEY;
+ case GHOST_kKeyRightControl: return RIGHTCTRLKEY;
+ case GHOST_kKeyOS: return OSKEY;
+ case GHOST_kKeyLeftAlt: return LEFTALTKEY;
+ case GHOST_kKeyRightAlt: return RIGHTALTKEY;
+
+ case GHOST_kKeyCapsLock: return CAPSLOCKKEY;
+ case GHOST_kKeyNumLock: return 0;
+ case GHOST_kKeyScrollLock: return 0;
+
+ case GHOST_kKeyLeftArrow: return LEFTARROWKEY;
+ case GHOST_kKeyRightArrow: return RIGHTARROWKEY;
+ case GHOST_kKeyUpArrow: return UPARROWKEY;
+ case GHOST_kKeyDownArrow: return DOWNARROWKEY;
+
+ case GHOST_kKeyPrintScreen: return 0;
+ case GHOST_kKeyPause: return PAUSEKEY;
+
+ case GHOST_kKeyInsert: return INSERTKEY;
+ case GHOST_kKeyDelete: return DELKEY;
+ case GHOST_kKeyHome: return HOMEKEY;
+ case GHOST_kKeyEnd: return ENDKEY;
+ case GHOST_kKeyUpPage: return PAGEUPKEY;
+ case GHOST_kKeyDownPage: return PAGEDOWNKEY;
+
+ case GHOST_kKeyNumpadPeriod: return PADPERIOD;
+ case GHOST_kKeyNumpadEnter: return PADENTER;
+ case GHOST_kKeyNumpadPlus: return PADPLUSKEY;
+ case GHOST_kKeyNumpadMinus: return PADMINUS;
+ case GHOST_kKeyNumpadAsterisk: return PADASTERKEY;
+ case GHOST_kKeyNumpadSlash: return PADSLASHKEY;
+
+ case GHOST_kKeyGrLess: return GRLESSKEY;
+
+ case GHOST_kKeyMediaPlay: return MEDIAPLAY;
+ case GHOST_kKeyMediaStop: return MEDIASTOP;
+ case GHOST_kKeyMediaFirst: return MEDIAFIRST;
+ case GHOST_kKeyMediaLast: return MEDIALAST;
default:
- return UNKNOWNKEY; /* GHOST_kKeyUnknown */
+ return UNKNOWNKEY; /* GHOST_kKeyUnknown */
}
}
}
@@ -2456,27 +2509,27 @@ static int convert_key(GHOST_TKey key)
/* adds customdata to event */
static void update_tablet_data(wmWindow *win, wmEvent *event)
{
- const GHOST_TabletData *td= GHOST_GetTabletData(win->ghostwin);
+ const GHOST_TabletData *td = GHOST_GetTabletData(win->ghostwin);
/* if there's tablet data from an active tablet device then add it */
if ((td != NULL) && td->Active != GHOST_kTabletModeNone) {
- struct wmTabletData *wmtab= MEM_mallocN(sizeof(wmTabletData), "customdata tablet");
+ struct wmTabletData *wmtab = MEM_mallocN(sizeof(wmTabletData), "customdata tablet");
wmtab->Active = (int)td->Active;
wmtab->Pressure = td->Pressure;
wmtab->Xtilt = td->Xtilt;
wmtab->Ytilt = td->Ytilt;
- event->custom= EVT_DATA_TABLET;
- event->customdata= wmtab;
- event->customdatafree= 1;
+ event->custom = EVT_DATA_TABLET;
+ event->customdata = wmtab;
+ event->customdatafree = 1;
}
}
/* adds customdata to event */
-static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* ghost)
+static void attach_ndof_data(wmEvent *event, const GHOST_TEventNDOFMotionData *ghost)
{
- wmNDOFMotionData* data = MEM_mallocN(sizeof(wmNDOFMotionData), "customdata NDOF");
+ wmNDOFMotionData *data = MEM_mallocN(sizeof(wmNDOFMotionData), "customdata NDOF");
const float s = U.ndof_sensitivity;
@@ -2486,8 +2539,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;
@@ -2501,12 +2553,11 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g
data->ry = s * ghost->rz;
data->rz = s * ghost->ry;
#endif
- }
- else
- {
+ }
+ else {
data->ty = s * ghost->ty;
data->tz = s * ghost->tz;
- }
+ }
data->dt = ghost->dt;
@@ -2520,20 +2571,20 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g
/* imperfect but probably usable... draw/enable drags to other windows */
static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *win, wmEvent *evt)
{
- int mx= evt->x, my= evt->y;
+ int mx = evt->x, my = evt->y;
- if(wm->windows.first== wm->windows.last)
+ if (wm->windows.first == wm->windows.last)
return NULL;
/* top window bar... */
- if(mx<0 || my<0 || mx>win->sizex || my>win->sizey+30) {
+ if (mx < 0 || my < 0 || mx > win->sizex || my > win->sizey + 30) {
wmWindow *owin;
wmEventHandler *handler;
/* let's skip windows having modal handlers now */
/* potential XXX ugly... I wouldn't have added a modalhandlers list (introduced in rev 23331, ton) */
- for(handler= win->modalhandlers.first; handler; handler= handler->next)
- if(handler->ui_handle || handler->op)
+ for (handler = win->modalhandlers.first; handler; handler = handler->next)
+ if (handler->ui_handle || handler->op)
return NULL;
/* to desktop space */
@@ -2541,13 +2592,13 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi
my += (int)win->posy;
/* check other windows to see if it has mouse inside */
- for(owin= wm->windows.first; owin; owin= owin->next) {
+ for (owin = wm->windows.first; owin; owin = owin->next) {
- if(owin!=win) {
- if(mx-owin->posx >= 0 && my-owin->posy >= 0 &&
- mx-owin->posx <= owin->sizex && my-owin->posy <= owin->sizey) {
- evt->x= mx - (int)owin->posx;
- evt->y= my - (int)owin->posy;
+ if (owin != win) {
+ if (mx - owin->posx >= 0 && my - owin->posy >= 0 &&
+ mx - owin->posx <= owin->sizex && my - owin->posy <= owin->sizey) {
+ evt->x = mx - (int)owin->posx;
+ evt->y = my - (int)owin->posy;
return owin;
}
@@ -2562,32 +2613,32 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi
void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int UNUSED(time), void *customdata)
{
wmWindow *owin;
- wmEvent event, *evt= win->eventstate;
+ wmEvent event, *evt = win->eventstate;
/* initialize and copy state (only mouse x y and modifiers) */
- event= *evt;
+ event = *evt;
switch (type) {
/* mouse move */
case GHOST_kEventCursorMove: {
- if(win->active) {
- GHOST_TEventCursorData *cd= customdata;
- wmEvent *lastevent= win->queue.last;
+ if (win->active) {
+ GHOST_TEventCursorData *cd = customdata;
+ wmEvent *lastevent = win->queue.last;
int cx, cy;
GHOST_ScreenToClient(win->ghostwin, cd->x, cd->y, &cx, &cy);
- evt->x= cx;
- evt->y= (win->sizey-1) - cy;
+ evt->x = cx;
+ evt->y = (win->sizey - 1) - cy;
- event.x= evt->x;
- event.y= evt->y;
+ event.x = evt->x;
+ event.y = evt->y;
- event.type= MOUSEMOVE;
+ 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 */
- if(lastevent && lastevent->type == MOUSEMOVE)
+ * handle in between mouse move moves, others can happily ignore
+ * them for better performance */
+ if (lastevent && lastevent->type == MOUSEMOVE)
lastevent->type = INBETWEEN_MOUSEMOVE;
update_tablet_data(win, &event);
@@ -2597,13 +2648,13 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
/* also add to other window if event is there, this makes overdraws disappear nicely */
/* it remaps mousecoord to other window in event */
- owin= wm_event_cursor_other_windows(wm, win, &event);
- if(owin) {
- wmEvent oevent= *(owin->eventstate);
+ owin = wm_event_cursor_other_windows(wm, win, &event);
+ if (owin) {
+ wmEvent oevent = *(owin->eventstate);
- oevent.x=owin->eventstate->x= event.x;
- oevent.y=owin->eventstate->y= event.y;
- oevent.type= MOUSEMOVE;
+ oevent.x = owin->eventstate->x = event.x;
+ oevent.y = owin->eventstate->y = event.y;
+ oevent.type = MOUSEMOVE;
update_tablet_data(owin, &oevent);
wm_event_add(owin, &oevent);
@@ -2613,7 +2664,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
break;
}
case GHOST_kEventTrackpad: {
- GHOST_TEventTrackpadData * pd = customdata;
+ GHOST_TEventTrackpadData *pd = customdata;
switch (pd->subtype) {
case GHOST_kTrackpadEventMagnify:
event.type = MOUSEZOOM;
@@ -2623,20 +2674,20 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
break;
case GHOST_kTrackpadEventScroll:
default:
- event.type= MOUSEPAN;
+ event.type = MOUSEPAN;
break;
}
{
int cx, cy;
GHOST_ScreenToClient(win->ghostwin, pd->x, pd->y, &cx, &cy);
- event.x= evt->x= cx;
- event.y= evt->y= (win->sizey-1) - cy;
+ event.x = evt->x = cx;
+ event.y = evt->y = (win->sizey - 1) - cy;
}
// Use prevx/prevy so we can calculate the delta later
- event.prevx= event.x - pd->deltaX;
- event.prevy= event.y - (-pd->deltaY);
+ event.prevx = event.x - pd->deltaX;
+ event.prevy = event.y - (-pd->deltaY);
update_tablet_data(win, &event);
wm_event_add(win, &event);
@@ -2645,41 +2696,41 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
/* mouse button */
case GHOST_kEventButtonDown:
case GHOST_kEventButtonUp: {
- GHOST_TEventButtonData *bd= customdata;
+ GHOST_TEventButtonData *bd = customdata;
/* Note!, this starts as 0/1 but later is converted to KM_PRESS/KM_RELEASE by tweak */
- event.val= (type==GHOST_kEventButtonDown) ? KM_PRESS:KM_RELEASE;
+ event.val = (type == GHOST_kEventButtonDown) ? KM_PRESS : KM_RELEASE;
if (bd->button == GHOST_kButtonMaskLeft)
- event.type= LEFTMOUSE;
+ event.type = LEFTMOUSE;
else if (bd->button == GHOST_kButtonMaskRight)
- event.type= RIGHTMOUSE;
+ event.type = RIGHTMOUSE;
else if (bd->button == GHOST_kButtonMaskButton4)
- event.type= BUTTON4MOUSE;
+ event.type = BUTTON4MOUSE;
else if (bd->button == GHOST_kButtonMaskButton5)
- event.type= BUTTON5MOUSE;
+ event.type = BUTTON5MOUSE;
else
- event.type= MIDDLEMOUSE;
+ event.type = MIDDLEMOUSE;
- if(win->active==0) {
+ if (win->active == 0) {
int cx, cy;
/* entering window, update mouse pos. (ghost sends win-activate *after* the mouseclick in window!) */
wm_get_cursor_position(win, &cx, &cy);
- event.x= evt->x= cx;
- event.y= evt->y= cy;
+ event.x = evt->x = cx;
+ event.y = evt->y = cy;
}
/* add to other window if event is there (not to both!) */
- owin= wm_event_cursor_other_windows(wm, win, &event);
- if(owin) {
- wmEvent oevent= *(owin->eventstate);
+ owin = wm_event_cursor_other_windows(wm, win, &event);
+ if (owin) {
+ wmEvent oevent = *(owin->eventstate);
- oevent.x= event.x;
- oevent.y= event.y;
- oevent.type= event.type;
- oevent.val= event.val;
+ oevent.x = event.x;
+ oevent.y = event.y;
+ oevent.type = event.type;
+ oevent.val = event.val;
update_tablet_data(owin, &oevent);
wm_event_add(owin, &oevent);
@@ -2694,106 +2745,106 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
/* keyboard */
case GHOST_kEventKeyDown:
case GHOST_kEventKeyUp: {
- GHOST_TEventKeyData *kd= customdata;
- event.type= convert_key(kd->key);
- event.ascii= kd->ascii;
- memcpy(event.utf8_buf, kd->utf8_buf,sizeof(event.utf8_buf));/* might be not null terminated*/
- event.val= (type==GHOST_kEventKeyDown)?KM_PRESS:KM_RELEASE;
+ GHOST_TEventKeyData *kd = customdata;
+ event.type = convert_key(kd->key);
+ event.ascii = kd->ascii;
+ memcpy(event.utf8_buf, kd->utf8_buf, sizeof(event.utf8_buf)); /* might be not null terminated*/
+ event.val = (type == GHOST_kEventKeyDown) ? KM_PRESS : KM_RELEASE;
/* exclude arrow keys, esc, etc from text input */
- if(type==GHOST_kEventKeyUp) {
- event.ascii= '\0';
+ if (type == GHOST_kEventKeyUp) {
+ event.ascii = '\0';
/* ghost should do this already for key up */
if (event.utf8_buf[0]) {
printf("%s: ghost on your platform is misbehaving, utf8 events on key up!\n", __func__);
}
- event.utf8_buf[0]= '\0';
+ event.utf8_buf[0] = '\0';
}
else {
- if (event.ascii<32 && event.ascii > 0)
- event.ascii= '\0';
- if (event.utf8_buf[0]<32 && event.utf8_buf[0] > 0)
- event.utf8_buf[0]= '\0';
+ if (event.ascii < 32 && event.ascii > 0)
+ event.ascii = '\0';
+ if (event.utf8_buf[0] < 32 && event.utf8_buf[0] > 0)
+ event.utf8_buf[0] = '\0';
}
if (event.utf8_buf[0]) {
if (BLI_str_utf8_size(event.utf8_buf) == -1) {
printf("%s: ghost detected an invalid unicode character '%d'!\n",
__func__, (int)(unsigned char)event.utf8_buf[0]);
- event.utf8_buf[0]= '\0';
+ event.utf8_buf[0] = '\0';
}
}
/* modifiers */
/* assigning both first and second is strange - campbell */
- switch(event.type) {
- case LEFTSHIFTKEY: case RIGHTSHIFTKEY:
- event.shift = evt->shift = (event.val == KM_PRESS) ?
- ((evt->ctrl || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) :
- FALSE;
- break;
- case LEFTCTRLKEY: case RIGHTCTRLKEY:
- event.ctrl = evt->ctrl = (event.val == KM_PRESS) ?
- ((evt->shift || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) :
- FALSE;
- break;
- case LEFTALTKEY: case RIGHTALTKEY:
- event.alt = evt->alt = (event.val == KM_PRESS) ?
- ((evt->ctrl || evt->shift || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) :
- FALSE;
- break;
- case OSKEY:
- event.oskey = evt->oskey = (event.val == KM_PRESS) ?
- ((evt->ctrl || evt->alt || evt->shift) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) :
- FALSE;
- break;
- default:
- if(event.val == KM_PRESS && event.keymodifier==0)
- evt->keymodifier= event.type; /* only set in eventstate, for next event */
- else if(event.val==KM_RELEASE && event.keymodifier==event.type)
- event.keymodifier= evt->keymodifier= 0;
- break;
+ switch (event.type) {
+ case LEFTSHIFTKEY: case RIGHTSHIFTKEY:
+ event.shift = evt->shift = (event.val == KM_PRESS) ?
+ ((evt->ctrl || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) :
+ FALSE;
+ break;
+ case LEFTCTRLKEY: case RIGHTCTRLKEY:
+ event.ctrl = evt->ctrl = (event.val == KM_PRESS) ?
+ ((evt->shift || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) :
+ FALSE;
+ break;
+ case LEFTALTKEY: case RIGHTALTKEY:
+ event.alt = evt->alt = (event.val == KM_PRESS) ?
+ ((evt->ctrl || evt->shift || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) :
+ FALSE;
+ break;
+ case OSKEY:
+ event.oskey = evt->oskey = (event.val == KM_PRESS) ?
+ ((evt->ctrl || evt->alt || evt->shift) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) :
+ FALSE;
+ break;
+ default:
+ if (event.val == KM_PRESS && event.keymodifier == 0)
+ evt->keymodifier = event.type; /* only set in eventstate, for next event */
+ else if (event.val == KM_RELEASE && event.keymodifier == event.type)
+ event.keymodifier = evt->keymodifier = 0;
+ break;
}
/* 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 */
- if(event.keymodifier == event.type)
- event.keymodifier= 0;
+ * 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 */
- if(event.keymodifier == UNKNOWNKEY)
- event.keymodifier= 0;
+ * 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;
/* if test_break set, it catches this. XXX Keep global for now? */
- if(event.type==ESCKEY)
- G.afbreek= 1;
+ if (event.type == ESCKEY)
+ G.afbreek = 1;
wm_event_add(win, &event);
break;
}
- case GHOST_kEventWheel: {
- GHOST_TEventWheelData* wheelData = customdata;
+ case GHOST_kEventWheel: {
+ GHOST_TEventWheelData *wheelData = customdata;
if (wheelData->z > 0)
- event.type= WHEELUPMOUSE;
+ event.type = WHEELUPMOUSE;
else
- event.type= WHEELDOWNMOUSE;
+ event.type = WHEELDOWNMOUSE;
- event.val= KM_PRESS;
+ event.val = KM_PRESS;
wm_event_add(win, &event);
break;
}
case GHOST_kEventTimer: {
- event.type= TIMER;
- event.custom= EVT_DATA_TIMER;
- event.customdata= customdata;
+ event.type = TIMER;
+ event.custom = EVT_DATA_TIMER;
+ event.customdata = customdata;
wm_event_add(win, &event);
break;
@@ -2810,7 +2861,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
}
case GHOST_kEventNDOFButton: {
- GHOST_TEventNDOFButtonData* e = customdata;
+ GHOST_TEventNDOFButtonData *e = customdata;
event.type = NDOF_BUTTON_NONE + e->button;
@@ -2821,7 +2872,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
case GHOST_kRelease:
event.val = KM_RELEASE;
break;
- }
+ }
event.custom = 0;
event.customdata = NULL;
@@ -2836,7 +2887,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
break;
case GHOST_kEventWindowDeactivate: {
- event.type= WINDEACTIVATE;
+ event.type = WINDEACTIVATE;
wm_event_add(win, &event);
break;
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index bae6c7abcda..763f1e3b11b 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -28,9 +28,9 @@
*/
- /* placed up here because of crappy
- * winsock stuff.
- */
+/* placed up here because of crappy
+ * winsock stuff.
+ */
#include <stddef.h>
#include <string.h>
#include <errno.h>
@@ -120,31 +120,31 @@
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;
wmWindow *win, *active_win;
- *wmlist= G.main->wm;
- G.main->wm.first= G.main->wm.last= NULL;
+ *wmlist = G.main->wm;
+ G.main->wm.first = G.main->wm.last = NULL;
active_win = CTX_wm_window(C);
/* first wrap up running stuff */
/* code copied from wm_init_exit.c */
- for(wm= wmlist->first; wm; wm= wm->id.next) {
+ for (wm = wmlist->first; wm; wm = wm->id.next) {
WM_jobs_stop_all(wm);
- for(win= wm->windows.first; win; win= win->next) {
+ for (win = wm->windows.first; win; win = win->next) {
- CTX_wm_window_set(C, win); /* needed by operator close callbacks */
+ CTX_wm_window_set(C, win); /* needed by operator close callbacks */
WM_event_remove_handlers(C, &win->handlers);
WM_event_remove_handlers(C, &win->modalhandlers);
ED_screen_exit(C, win, win->screen);
@@ -158,13 +158,13 @@ static void wm_window_match_init(bContext *C, ListBase *wmlist)
/* just had return; here from r12991, this code could just get removed?*/
#if 0
- if(wm==NULL) return;
- if(G.fileflags & G_FILE_NO_UI) return;
+ if (wm == NULL) return;
+ if (G.fileflags & G_FILE_NO_UI) return;
/* we take apart the used screens from non-active window */
- for(win= wm->windows.first; win; win= win->next) {
+ for (win = wm->windows.first; win; win = win->next) {
BLI_strncpy(win->screenname, win->screen->id.name, MAX_ID_NAME);
- if(win!=wm->winactive) {
+ if (win != wm->winactive) {
BLI_remlink(&G.main->screen, win->screen);
//BLI_addtail(screenbase, win->screen);
}
@@ -173,11 +173,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)
{
@@ -185,8 +185,8 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist)
wmWindow *oldwin, *win;
/* cases 1 and 2 */
- if(oldwmlist->first==NULL) {
- if(G.main->wm.first); /* nothing todo */
+ if (oldwmlist->first == NULL) {
+ if (G.main->wm.first) ; /* nothing todo */
else
wm_add_default(C);
}
@@ -194,29 +194,29 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist)
/* cases 3 and 4 */
/* we've read file without wm..., keep current one entirely alive */
- if(G.main->wm.first==NULL) {
- bScreen *screen= NULL;
+ if (G.main->wm.first == NULL) {
+ bScreen *screen = NULL;
/* when loading without UI, no matching needed */
- if(!(G.fileflags & G_FILE_NO_UI) && (screen= CTX_wm_screen(C))) {
+ if (!(G.fileflags & G_FILE_NO_UI) && (screen = CTX_wm_screen(C))) {
/* match oldwm to new dbase, only old files */
- for(wm= oldwmlist->first; wm; wm= wm->id.next) {
+ for (wm = oldwmlist->first; wm; wm = wm->id.next) {
- for(win= wm->windows.first; win; win= win->next) {
+ for (win = wm->windows.first; win; win = win->next) {
/* all windows get active screen from file */
- if(screen->winid==0)
- win->screen= screen;
+ if (screen->winid == 0)
+ win->screen = screen;
else
- win->screen= ED_screen_duplicate(win, screen);
+ win->screen = ED_screen_duplicate(win, screen);
- BLI_strncpy(win->screenname, win->screen->id.name+2, sizeof(win->screenname));
- win->screen->winid= win->winid;
+ BLI_strncpy(win->screenname, win->screen->id.name + 2, sizeof(win->screenname));
+ win->screen->winid = win->winid;
}
}
}
- G.main->wm= *oldwmlist;
+ G.main->wm = *oldwmlist;
/* screens were read from file! */
ED_screens_initialize(G.main->wm.first);
@@ -224,47 +224,47 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist)
else {
/* what if old was 3, and loaded 1? */
/* this code could move to setup_appdata */
- oldwm= oldwmlist->first;
- wm= G.main->wm.first;
+ oldwm = oldwmlist->first;
+ wm = G.main->wm.first;
/* preserve key configurations in new wm, to preserve their keymaps */
- wm->keyconfigs= oldwm->keyconfigs;
- wm->addonconf= oldwm->addonconf;
- wm->defaultconf= oldwm->defaultconf;
- wm->userconf= oldwm->userconf;
+ wm->keyconfigs = oldwm->keyconfigs;
+ wm->addonconf = oldwm->addonconf;
+ wm->defaultconf = oldwm->defaultconf;
+ wm->userconf = oldwm->userconf;
- oldwm->keyconfigs.first= oldwm->keyconfigs.last= NULL;
- oldwm->addonconf= NULL;
- oldwm->defaultconf= NULL;
- oldwm->userconf= NULL;
+ oldwm->keyconfigs.first = oldwm->keyconfigs.last = NULL;
+ oldwm->addonconf = NULL;
+ oldwm->defaultconf = NULL;
+ oldwm->userconf = NULL;
/* ensure making new keymaps and set space types */
- wm->initialized= 0;
- wm->winactive= NULL;
+ wm->initialized = 0;
+ wm->winactive = NULL;
/* only first wm in list has ghostwins */
- for(win= wm->windows.first; win; win= win->next) {
- for(oldwin= oldwm->windows.first; oldwin; oldwin= oldwin->next) {
+ for (win = wm->windows.first; win; win = win->next) {
+ for (oldwin = oldwm->windows.first; oldwin; oldwin = oldwin->next) {
- if(oldwin->winid == win->winid ) {
- win->ghostwin= oldwin->ghostwin;
- win->active= oldwin->active;
- if(win->active)
- wm->winactive= win;
+ if (oldwin->winid == win->winid) {
+ win->ghostwin = oldwin->ghostwin;
+ win->active = oldwin->active;
+ if (win->active)
+ wm->winactive = win;
- if(!G.background) /* file loading in background mode still calls this */
- GHOST_SetWindowUserData(win->ghostwin, win); /* pointer back */
+ if (!G.background) /* file loading in background mode still calls this */
+ GHOST_SetWindowUserData(win->ghostwin, win); /* pointer back */
- oldwin->ghostwin= NULL;
+ oldwin->ghostwin = NULL;
- win->eventstate= oldwin->eventstate;
- oldwin->eventstate= NULL;
+ win->eventstate = oldwin->eventstate;
+ oldwin->eventstate = NULL;
/* ensure proper screen rescaling */
- win->sizex= oldwin->sizex;
- win->sizey= oldwin->sizey;
- win->posx= oldwin->posx;
- win->posy= oldwin->posy;
+ win->sizex = oldwin->sizex;
+ win->sizey = oldwin->sizey;
+ win->posx = oldwin->posx;
+ win->posy = oldwin->posy;
}
}
}
@@ -281,14 +281,14 @@ static void wm_init_userdef(bContext *C)
sound_init(CTX_data_main(C));
/* needed so loading a file from the command line respects user-pref [#26156] */
- if(U.flag & USER_FILENOUI) G.fileflags |= G_FILE_NO_UI;
- else G.fileflags &= ~G_FILE_NO_UI;
+ if (U.flag & USER_FILENOUI) G.fileflags |= G_FILE_NO_UI;
+ else G.fileflags &= ~G_FILE_NO_UI;
/* set the python auto-execute setting from user prefs */
/* enabled by default, unless explicitly enabled in the command line which overrides */
- if((G.f & G_SCRIPT_OVERRIDE_PREF) == 0) {
+ if ((G.f & G_SCRIPT_OVERRIDE_PREF) == 0) {
if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |= G_SCRIPT_AUTOEXEC;
- else G.f &= ~G_SCRIPT_AUTOEXEC;
+ else G.f &= ~G_SCRIPT_AUTOEXEC;
}
/* update tempdir from user preferences */
@@ -298,11 +298,12 @@ static void wm_init_userdef(bContext *C)
/* return codes */
-#define BKE_READ_EXOTIC_FAIL_PATH -3 /* file format is not supported */
-#define BKE_READ_EXOTIC_FAIL_FORMAT -2 /* file format is not supported */
-#define BKE_READ_EXOTIC_FAIL_OPEN -1 /* Can't open the file */
-#define BKE_READ_EXOTIC_OK_BLEND 0 /* .blend file */
-#define BKE_READ_EXOTIC_OK_OTHER 1 /* other supported formats */
+#define BKE_READ_EXOTIC_FAIL_PATH -3 /* file format is not supported */
+#define BKE_READ_EXOTIC_FAIL_FORMAT -2 /* file format is not supported */
+#define BKE_READ_EXOTIC_FAIL_OPEN -1 /* Can't open the file */
+#define BKE_READ_EXOTIC_OK_BLEND 0 /* .blend file */
+#define BKE_READ_EXOTIC_OK_OTHER 1 /* other supported formats */
+
/* intended to check for non-blender formats but for now it only reads blends */
static int wm_read_exotic(Scene *UNUSED(scene), const char *name)
@@ -314,33 +315,32 @@ static int wm_read_exotic(Scene *UNUSED(scene), const char *name)
// make sure we're not trying to read a directory....
- len= strlen(name);
- if (ELEM(name[len-1], '/', '\\')) {
- retval= BKE_READ_EXOTIC_FAIL_PATH;
+ len = strlen(name);
+ if (ELEM(name[len - 1], '/', '\\')) {
+ retval = BKE_READ_EXOTIC_FAIL_PATH;
}
else {
- gzfile = gzopen(name,"rb");
-
+ gzfile = BLI_gzopen(name, "rb");
if (gzfile == NULL) {
- retval= BKE_READ_EXOTIC_FAIL_OPEN;
+ retval = BKE_READ_EXOTIC_FAIL_OPEN;
}
else {
- len= gzread(gzfile, header, sizeof(header));
+ len = gzread(gzfile, header, sizeof(header));
gzclose(gzfile);
if (len == sizeof(header) && strncmp(header, "BLENDER", 7) == 0) {
- retval= BKE_READ_EXOTIC_OK_BLEND;
+ retval = BKE_READ_EXOTIC_OK_BLEND;
}
else {
//XXX waitcursor(1);
- /*
- if(is_foo_format(name)) {
+#if 0 /* historic stuff - no longer used */
+ if (is_foo_format(name)) {
read_foo(name);
- retval= BKE_READ_EXOTIC_OK_OTHER;
+ retval = BKE_READ_EXOTIC_OK_OTHER;
}
else
- */
+#endif
{
- retval= BKE_READ_EXOTIC_FAIL_FORMAT;
+ retval = BKE_READ_EXOTIC_FAIL_FORMAT;
}
//XXX waitcursor(0);
}
@@ -364,25 +364,25 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports)
/* first try to append data from exotic file formats... */
/* it throws error box when file doesn't exist and returns -1 */
/* note; it should set some error message somewhere... (ton) */
- retval= wm_read_exotic(CTX_data_scene(C), filepath);
+ retval = wm_read_exotic(CTX_data_scene(C), filepath);
/* we didn't succeed, now try to read Blender file */
if (retval == BKE_READ_EXOTIC_OK_BLEND) {
- int G_f= G.f;
+ int G_f = G.f;
ListBase wmbase;
/* put aside screens to match with persistent windows later */
/* also exit screens and editors */
wm_window_match_init(C, &wmbase);
- retval= BKE_read_file(C, filepath, reports);
+ retval = BKE_read_file(C, filepath, reports);
G.save_over = 1;
/* this flag is initialized by the operator but overwritten on read.
* need to re-enable it here else drivers + registered scripts wont work. */
- if(G.f != G_f) {
- const int flags_keep= (G_SCRIPT_AUTOEXEC | G_SCRIPT_OVERRIDE_PREF);
- G.f= (G.f & ~flags_keep) | (G_f & flags_keep);
+ if (G.f != G_f) {
+ const int flags_keep = (G_SCRIPT_AUTOEXEC | G_SCRIPT_OVERRIDE_PREF);
+ G.f = (G.f & ~flags_keep) | (G_f & flags_keep);
}
/* match the read WM with current WM */
@@ -391,19 +391,19 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports)
// XXX mainwindow_set_filename_to_title(G.main->name);
- if(retval == BKE_READ_FILE_OK_USERPREFS) {
+ if (retval == BKE_READ_FILE_OK_USERPREFS) {
/* in case a userdef is read from regular .blend */
wm_init_userdef(C);
}
if (retval != BKE_READ_FILE_FAIL) {
G.relbase_valid = 1;
- if(!G.background) /* assume automated tasks with background, dont write recent file list */
+ if (!G.background) /* assume automated tasks with background, don't write recent file list */
write_history();
}
- WM_event_add_notifier(C, NC_WM|ND_FILEREAD, NULL);
+ WM_event_add_notifier(C, NC_WM | ND_FILEREAD, NULL);
// refresh_interface_font();
CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first);
@@ -421,7 +421,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
@@ -429,14 +434,14 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports)
/* TODO, make this show in header info window */
{
Scene *sce;
- for (sce= G.main->scene.first; sce; sce= sce->id.next) {
+ for (sce = G.main->scene.first; sce; sce = sce->id.next) {
if (sce->r.engine[0] &&
BLI_findstring(&R_engines, sce->r.engine, offsetof(RenderEngineType, idname)) == NULL)
{
BKE_reportf(reports, RPT_WARNING,
"Engine not available: '%s' for scene: %s, "
"an addon may need to be installed or enabled",
- sce->r.engine, sce->id.name+2);
+ sce->r.engine, sce->id.name + 2);
}
}
}
@@ -444,18 +449,18 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports)
// XXX undo_editmode_clear();
BKE_reset_undo();
- BKE_write_undo(C, "original"); /* save current state */
+ BKE_write_undo(C, "original"); /* save current state */
}
- else if(retval == BKE_READ_EXOTIC_OK_OTHER)
+ else if (retval == BKE_READ_EXOTIC_OK_OTHER)
BKE_write_undo(C, "Import file");
- else if(retval == BKE_READ_EXOTIC_FAIL_OPEN) {
+ else if (retval == BKE_READ_EXOTIC_FAIL_OPEN) {
BKE_reportf(reports, RPT_ERROR, IFACE_("Can't read file: \"%s\", %s."), filepath,
- errno ? strerror(errno) : IFACE_("Unable to open the file"));
+ errno ? strerror(errno) : IFACE_("Unable to open the file"));
}
- else if(retval == BKE_READ_EXOTIC_FAIL_FORMAT) {
+ else if (retval == BKE_READ_EXOTIC_FAIL_FORMAT) {
BKE_reportf(reports, RPT_ERROR, IFACE_("File format is not supported in file: \"%s\"."), filepath);
}
- else if(retval == BKE_READ_EXOTIC_FAIL_PATH) {
+ else if (retval == BKE_READ_EXOTIC_FAIL_PATH) {
BKE_reportf(reports, RPT_ERROR, IFACE_("File path invalid: \"%s\"."), filepath);
}
else {
@@ -475,7 +480,7 @@ int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory
{
ListBase wmbase;
char tstr[FILE_MAX];
- int success= 0;
+ int success = 0;
free_ttfont(); /* still weird... what does it here? */
@@ -484,7 +489,8 @@ int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory
char *cfgdir = BLI_get_folder(BLENDER_USER_CONFIG, NULL);
if (cfgdir) {
BLI_make_file_string(G.main->name, tstr, cfgdir, BLENDER_STARTUP_FILE);
- } else {
+ }
+ else {
tstr[0] = '\0';
from_memory = 1;
}
@@ -499,12 +505,12 @@ int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory
if (!from_memory && BLI_exists(tstr)) {
success = (BKE_read_file(C, tstr, NULL) != BKE_READ_FILE_FAIL);
- if(U.themes.first==NULL) {
- printf("\nError: No valid "STRINGIFY(BLENDER_STARTUP_FILE)", fall back to built-in default.\n\n");
+ if (U.themes.first == NULL) {
+ printf("\nError: No valid "STRINGIFY (BLENDER_STARTUP_FILE)", fall back to built-in default.\n\n");
success = 0;
}
}
- if(success==0) {
+ if (success == 0) {
success = BKE_read_file_from_memory(C, datatoc_startup_blend, datatoc_startup_blend_size, NULL);
if (wmbase.first == NULL) wm_clear_default_size(C);
@@ -526,27 +532,27 @@ int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory
wm_window_match_do(C, &wmbase);
WM_check(C); /* opens window(s), checks keymaps */
- G.main->name[0]= '\0';
+ G.main->name[0] = '\0';
/* When loading factory settings, the reset solid OpenGL lights need to be applied. */
if (!G.background) GPU_default_lights();
/* XXX */
- G.save_over = 0; // start with save preference untitled.blend
- G.fileflags &= ~G_FILE_AUTOPLAY; /* disable autoplay in startup.blend... */
+ G.save_over = 0; // start with save preference untitled.blend
+ G.fileflags &= ~G_FILE_AUTOPLAY; /* disable autoplay in startup.blend... */
// mainwindow_set_filename_to_title(""); // empty string re-initializes title to "Blender"
// refresh_interface_font();
// undo_editmode_clear();
BKE_reset_undo();
- BKE_write_undo(C, "original"); /* save current state */
+ BKE_write_undo(C, "original"); /* save current state */
ED_editors_init(C);
DAG_on_visible_update(CTX_data_main(C), TRUE);
#ifdef WITH_PYTHON
- if(CTX_py_init_get(C)) {
+ if (CTX_py_init_get(C)) {
/* sync addons, these may have changed from the defaults */
BPY_string_exec(C, "__import__('addon_utils').reset_all()");
@@ -556,10 +562,10 @@ int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory
}
#endif
- WM_event_add_notifier(C, NC_WM|ND_FILEREAD, NULL);
+ WM_event_add_notifier(C, NC_WM | ND_FILEREAD, NULL);
/* in background mode the scene will stay NULL */
- if(!G.background) {
+ if (!G.background) {
CTX_wm_window_set(C, NULL); /* exits queues */
}
@@ -568,7 +574,7 @@ int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory
int WM_read_homefile_exec(bContext *C, wmOperator *op)
{
- int from_memory= strcmp(op->type->idname, "WM_OT_read_factory_settings") == 0;
+ int from_memory = strcmp(op->type->idname, "WM_OT_read_factory_settings") == 0;
return WM_read_homefile(C, op->reports, from_memory) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}
@@ -585,15 +591,15 @@ void WM_read_history(void)
BLI_make_file_string("/", name, cfgdir, BLENDER_HISTORY_FILE);
- lines= BLI_file_read_as_lines(name);
+ lines = BLI_file_read_as_lines(name);
G.recent_files.first = G.recent_files.last = NULL;
/* read list of recent opened files from recent-files.txt to memory */
- for (l= lines, num= 0; l && (num<U.recent_files); l= l->next) {
+ for (l = lines, num = 0; l && (num < U.recent_files); l = l->next) {
line = l->link;
if (line[0] && BLI_exists(line)) {
- recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile");
+ recent = (RecentFile *)MEM_mallocN(sizeof(RecentFile), "RecentFile");
BLI_addtail(&(G.recent_files), recent);
recent->filepath = BLI_strdup(line);
num++;
@@ -614,28 +620,28 @@ static void write_history(void)
/* will be NULL in background mode */
user_config_dir = BLI_get_folder_create(BLENDER_USER_CONFIG, NULL);
- if(!user_config_dir)
+ if (!user_config_dir)
return;
BLI_make_file_string("/", name, user_config_dir, BLENDER_HISTORY_FILE);
recent = G.recent_files.first;
/* refresh recent-files.txt of recent opened files, when current file was changed */
- if(!(recent) || (BLI_path_cmp(recent->filepath, G.main->name)!=0)) {
- fp= fopen(name, "w");
+ if (!(recent) || (BLI_path_cmp(recent->filepath, G.main->name) != 0)) {
+ fp = BLI_fopen(name, "w");
if (fp) {
/* add current file to the beginning of list */
- recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile");
+ recent = (RecentFile *)MEM_mallocN(sizeof(RecentFile), "RecentFile");
recent->filepath = BLI_strdup(G.main->name);
BLI_addhead(&(G.recent_files), recent);
/* write current file to recent-files.txt */
fprintf(fp, "%s\n", recent->filepath);
recent = recent->next;
- i=1;
+ i = 1;
/* write rest of recent opened files to recent-files.txt */
- while((i<U.recent_files) && (recent)){
+ while ((i < U.recent_files) && (recent)) {
/* this prevents to have duplicities in list */
- if (BLI_path_cmp(recent->filepath, G.main->name)!=0) {
+ if (BLI_path_cmp(recent->filepath, G.main->name) != 0) {
fprintf(fp, "%s\n", recent->filepath);
recent = recent->next;
}
@@ -660,21 +666,21 @@ static ImBuf *blend_file_thumb(Scene *scene, int **thumb_pt)
/* will be scaled down, but gives some nice oversampling */
ImBuf *ibuf;
int *thumb;
- char err_out[256]= "unknown";
+ char err_out[256] = "unknown";
- *thumb_pt= NULL;
+ *thumb_pt = NULL;
/* scene can be NULL if running a script at startup and calling the save operator */
- if(G.background || scene==NULL || scene->camera==NULL)
+ if (G.background || scene == NULL || scene->camera == NULL)
return NULL;
/* 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);
+ ibuf = ED_view3d_draw_offscreen_imbuf_simple(scene, scene->camera,
+ BLEN_THUMB_SIZE * 2, BLEN_THUMB_SIZE * 2,
+ IB_rect, OB_SOLID, FALSE, err_out);
- if(ibuf) {
- float aspect= (scene->r.xsch*scene->r.xasp) / (scene->r.ysch*scene->r.yasp);
+ if (ibuf) {
+ float aspect = (scene->r.xsch * scene->r.xasp) / (scene->r.ysch * scene->r.yasp);
/* dirty oversampling */
IMB_scaleImBuf(ibuf, BLEN_THUMB_SIZE, BLEN_THUMB_SIZE);
@@ -683,7 +689,7 @@ static ImBuf *blend_file_thumb(Scene *scene, int **thumb_pt)
IMB_overlayblend_thumb(ibuf->rect, ibuf->x, ibuf->y, aspect);
/* first write into thumb buffer */
- thumb= MEM_mallocN(((2 + (BLEN_THUMB_SIZE * BLEN_THUMB_SIZE))) * sizeof(int), "write_file thumb");
+ thumb = MEM_mallocN(((2 + (BLEN_THUMB_SIZE * BLEN_THUMB_SIZE))) * sizeof(int), "write_file thumb");
thumb[0] = BLEN_THUMB_SIZE;
thumb[1] = BLEN_THUMB_SIZE;
@@ -693,11 +699,11 @@ static ImBuf *blend_file_thumb(Scene *scene, int **thumb_pt)
else {
/* '*thumb_pt' needs to stay NULL to prevent a bad thumbnail from being handled */
fprintf(stderr, "blend_file_thumb failed to create thumbnail: %s\n", err_out);
- thumb= NULL;
+ thumb = NULL;
}
/* must be freed by caller */
- *thumb_pt= thumb;
+ *thumb_pt = thumb;
return ibuf;
}
@@ -710,7 +716,7 @@ int write_crash_blend(void)
BLI_strncpy(path, G.main->name, sizeof(path));
BLI_replace_extension(path, sizeof(path), "_crash.blend");
- if(BLO_write_file(G.main, path, fileflags, NULL, NULL)) {
+ if (BLO_write_file(G.main, path, fileflags, NULL, NULL)) {
printf("written: %s\n", path);
return 1;
}
@@ -726,8 +732,8 @@ int WM_write_file(bContext *C, const char *target, int fileflags, ReportList *re
int len;
char filepath[FILE_MAX];
- int *thumb= NULL;
- ImBuf *ibuf_thumb= NULL;
+ int *thumb = NULL;
+ ImBuf *ibuf_thumb = NULL;
len = strlen(target);
@@ -743,10 +749,10 @@ int WM_write_file(bContext *C, const char *target, int fileflags, ReportList *re
BLI_strncpy(filepath, target, FILE_MAX);
BLI_replace_extension(filepath, FILE_MAX, ".blend");
- /* dont use 'target' anymore */
+ /* don't use 'target' anymore */
/* send the OnSave event */
- for (li= G.main->library.first; li; li= li->id.next) {
+ for (li = G.main->library.first; li; li = li->id.next) {
if (BLI_path_cmp(li->filepath, filepath) == 0) {
BKE_reportf(reports, RPT_ERROR, "Can't overwrite used library '%.240s'", filepath);
return -1;
@@ -755,8 +761,8 @@ int WM_write_file(bContext *C, const char *target, int fileflags, ReportList *re
/* blend file thumbnail */
/* save before exit_editmode, otherwise derivedmeshes for shared data corrupt #27765) */
- if(U.flag & USER_SAVE_PREVIEWS) {
- ibuf_thumb= blend_file_thumb(CTX_data_scene(C), &thumb);
+ if (U.flag & USER_SAVE_PREVIEWS) {
+ ibuf_thumb = blend_file_thumb(CTX_data_scene(C), &thumb);
}
BLI_exec_cb(G.main, NULL, BLI_CB_EVT_SAVE_PRE);
@@ -776,21 +782,21 @@ int WM_write_file(bContext *C, const char *target, int fileflags, ReportList *re
fileflags |= G_FILE_HISTORY; /* write file history */
if (BLO_write_file(CTX_data_main(C), filepath, fileflags, reports, thumb)) {
- if(!copy) {
+ if (!copy) {
G.relbase_valid = 1;
- BLI_strncpy(G.main->name, filepath, sizeof(G.main->name)); /* is guaranteed current file */
+ BLI_strncpy(G.main->name, filepath, sizeof(G.main->name)); /* is guaranteed current file */
G.save_over = 1; /* disable untitled.blend convention */
}
- if(fileflags & G_FILE_COMPRESS) G.fileflags |= G_FILE_COMPRESS;
+ if (fileflags & G_FILE_COMPRESS) G.fileflags |= G_FILE_COMPRESS;
else G.fileflags &= ~G_FILE_COMPRESS;
- if(fileflags & G_FILE_AUTOPLAY) G.fileflags |= G_FILE_AUTOPLAY;
+ if (fileflags & G_FILE_AUTOPLAY) G.fileflags |= G_FILE_AUTOPLAY;
else G.fileflags &= ~G_FILE_AUTOPLAY;
/* prevent background mode scripts from clobbering history */
- if(!G.background) {
+ if (!G.background) {
write_history();
}
@@ -798,15 +804,15 @@ int WM_write_file(bContext *C, const char *target, int fileflags, ReportList *re
/* run this function after because the file cant be written before the blend is */
if (ibuf_thumb) {
- ibuf_thumb= IMB_thumb_create(filepath, THB_NORMAL, THB_SOURCE_BLEND, ibuf_thumb);
+ ibuf_thumb = IMB_thumb_create(filepath, THB_NORMAL, THB_SOURCE_BLEND, ibuf_thumb);
IMB_freeImBuf(ibuf_thumb);
}
- if(thumb) MEM_freeN(thumb);
+ if (thumb) MEM_freeN(thumb);
}
else {
- if(ibuf_thumb) IMB_freeImBuf(ibuf_thumb);
- if(thumb) MEM_freeN(thumb);
+ if (ibuf_thumb) IMB_freeImBuf(ibuf_thumb);
+ if (thumb) MEM_freeN(thumb);
WM_cursor_wait(0);
return -1;
@@ -820,13 +826,13 @@ int WM_write_file(bContext *C, const char *target, int fileflags, ReportList *re
/* operator entry */
int WM_write_homefile(bContext *C, wmOperator *op)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- wmWindow *win= CTX_wm_window(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
+ wmWindow *win = CTX_wm_window(C);
char filepath[FILE_MAX];
int fileflags;
/* check current window and close it if temp */
- if(win->screen->temp)
+ if (win->screen->temp)
wm_window_close(C, wm, win);
/* update keymaps in user preferences */
@@ -838,14 +844,14 @@ int WM_write_homefile(bContext *C, wmOperator *op)
/* force save as regular blend file */
fileflags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_AUTOPLAY | G_FILE_LOCK | G_FILE_SIGN | G_FILE_HISTORY);
- if(BLO_write_file(CTX_data_main(C), filepath, fileflags, op->reports, NULL) == 0) {
+ if (BLO_write_file(CTX_data_main(C), filepath, fileflags, op->reports, NULL) == 0) {
printf("fail\n");
return OPERATOR_CANCELLED;
}
printf("ok\n");
- G.save_over= 0;
+ G.save_over = 0;
return OPERATOR_FINISHED;
}
@@ -884,8 +890,8 @@ void WM_autosave_init(wmWindowManager *wm)
{
wm_autosave_timer_ended(wm);
- if(U.flag & USER_AUTOSAVE)
- wm->autosavetimer= WM_event_add_timer(wm, NULL, TIMERAUTOSAVE, U.savetime*60.0);
+ if (U.flag & USER_AUTOSAVE)
+ wm->autosavetimer = WM_event_add_timer(wm, NULL, TIMERAUTOSAVE, U.savetime * 60.0);
}
void wm_autosave_timer(const bContext *C, wmWindowManager *wm, wmTimer *UNUSED(wt))
@@ -898,10 +904,10 @@ void wm_autosave_timer(const bContext *C, wmWindowManager *wm, wmTimer *UNUSED(w
WM_event_remove_timer(wm, NULL, wm->autosavetimer);
/* if a modal operator is running, don't autosave, but try again in 10 seconds */
- for(win=wm->windows.first; win; win=win->next) {
- for(handler=win->modalhandlers.first; handler; handler=handler->next) {
- if(handler->op) {
- wm->autosavetimer= WM_event_add_timer(wm, NULL, TIMERAUTOSAVE, 10.0);
+ for (win = wm->windows.first; win; win = win->next) {
+ for (handler = win->modalhandlers.first; handler; handler = handler->next) {
+ if (handler->op) {
+ wm->autosavetimer = WM_event_add_timer(wm, NULL, TIMERAUTOSAVE, 10.0);
return;
}
}
@@ -910,20 +916,20 @@ void wm_autosave_timer(const bContext *C, wmWindowManager *wm, wmTimer *UNUSED(w
wm_autosave_location(filepath);
/* force save as regular blend file */
- fileflags = G.fileflags & ~(G_FILE_COMPRESS|G_FILE_AUTOPLAY |G_FILE_LOCK|G_FILE_SIGN|G_FILE_HISTORY);
+ fileflags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_AUTOPLAY | G_FILE_LOCK | G_FILE_SIGN | G_FILE_HISTORY);
/* no error reporting to console */
BLO_write_file(CTX_data_main(C), filepath, fileflags, NULL, NULL);
/* do timer after file write, just in case file write takes a long time */
- wm->autosavetimer= WM_event_add_timer(wm, NULL, TIMERAUTOSAVE, U.savetime*60.0);
+ wm->autosavetimer = WM_event_add_timer(wm, NULL, TIMERAUTOSAVE, U.savetime * 60.0);
}
void wm_autosave_timer_ended(wmWindowManager *wm)
{
- if(wm->autosavetimer) {
+ if (wm->autosavetimer) {
WM_event_remove_timer(wm, NULL, wm->autosavetimer);
- wm->autosavetimer= NULL;
+ wm->autosavetimer = NULL;
}
}
@@ -933,12 +939,12 @@ void wm_autosave_delete(void)
wm_autosave_location(filename);
- if(BLI_exists(filename)) {
+ if (BLI_exists(filename)) {
char str[FILE_MAX];
BLI_make_file_string("/", str, BLI_temporary_dir(), "quit.blend");
/* if global undo; remove tempsave, otherwise rename */
- if(U.uiflag & USER_GLOBALUNDO) BLI_delete(filename, 0, 0);
+ if (U.uiflag & USER_GLOBALUNDO) BLI_delete(filename, 0, 0);
else BLI_rename(filename, str);
}
}
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index b9b8f57b971..593d1b35abe 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -38,7 +38,7 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
-#include "BLI_scanfill.h" /* lasso tessellation */
+#include "BLI_scanfill.h" /* lasso tessellation */
#include "BLI_utildefines.h"
#include "BKE_context.h"
@@ -60,44 +60,45 @@
/* context checked on having screen, window and area */
wmGesture *WM_gesture_new(bContext *C, wmEvent *event, int type)
{
- wmGesture *gesture= MEM_callocN(sizeof(wmGesture), "new gesture");
- wmWindow *window= CTX_wm_window(C);
- ARegion *ar= CTX_wm_region(C);
+ wmGesture *gesture = MEM_callocN(sizeof(wmGesture), "new gesture");
+ wmWindow *window = CTX_wm_window(C);
+ ARegion *ar = CTX_wm_region(C);
int sx, sy;
BLI_addtail(&window->gesture, gesture);
- gesture->type= type;
- gesture->event_type= event->type;
- gesture->swinid= ar->swinid; /* means only in area-region context! */
+ gesture->type = type;
+ gesture->event_type = event->type;
+ gesture->swinid = ar->swinid; /* means only in area-region context! */
wm_subwindow_getorigin(window, gesture->swinid, &sx, &sy);
if (ELEM5(type, WM_GESTURE_RECT, WM_GESTURE_CROSS_RECT, WM_GESTURE_TWEAK,
- WM_GESTURE_CIRCLE, WM_GESTURE_STRAIGHTLINE))
+ WM_GESTURE_CIRCLE, WM_GESTURE_STRAIGHTLINE))
{
- rcti *rect= MEM_callocN(sizeof(rcti), "gesture rect new");
+ rcti *rect = MEM_callocN(sizeof(rcti), "gesture rect new");
- gesture->customdata= rect;
- rect->xmin= event->x - sx;
- rect->ymin= event->y - sy;
- if(type==WM_GESTURE_CIRCLE) {
+ gesture->customdata = rect;
+ rect->xmin = event->x - sx;
+ rect->ymin = event->y - sy;
+ if (type == WM_GESTURE_CIRCLE) {
#ifdef GESTURE_MEMORY
- rect->xmax= circle_select_size;
+ rect->xmax = circle_select_size;
#else
- rect->xmax= 25; // XXX temp
+ rect->xmax = 25; // XXX temp
#endif
- } else {
- rect->xmax= event->x - sx;
- rect->ymax= event->y - sy;
+ }
+ else {
+ rect->xmax = event->x - sx;
+ rect->ymax = event->y - sy;
}
}
else if (ELEM(type, WM_GESTURE_LINES, WM_GESTURE_LASSO)) {
short *lasso;
- gesture->customdata= lasso= MEM_callocN(2*sizeof(short)*WM_LASSO_MIN_POINTS, "lasso points");
+ gesture->customdata = lasso = MEM_callocN(2 * sizeof(short) * WM_LASSO_MIN_POINTS, "lasso points");
lasso[0] = event->x - sx;
lasso[1] = event->y - sy;
- gesture->points= 1;
+ gesture->points = 1;
gesture->size = WM_LASSO_MIN_POINTS;
}
@@ -106,10 +107,10 @@ wmGesture *WM_gesture_new(bContext *C, wmEvent *event, int type)
void WM_gesture_end(bContext *C, wmGesture *gesture)
{
- wmWindow *win= CTX_wm_window(C);
+ wmWindow *win = CTX_wm_window(C);
- if(win->tweak==gesture)
- win->tweak= NULL;
+ if (win->tweak == gesture)
+ win->tweak = NULL;
BLI_remlink(&win->gesture, gesture);
MEM_freeN(gesture->customdata);
MEM_freeN(gesture);
@@ -117,9 +118,9 @@ void WM_gesture_end(bContext *C, wmGesture *gesture)
void WM_gestures_remove(bContext *C)
{
- wmWindow *win= CTX_wm_window(C);
+ wmWindow *win = CTX_wm_window(C);
- while(win->gesture.first)
+ while (win->gesture.first)
WM_gesture_end(C, win->gesture.first);
}
@@ -127,32 +128,32 @@ void WM_gestures_remove(bContext *C)
/* tweak and line gestures */
int wm_gesture_evaluate(wmGesture *gesture)
{
- if(gesture->type==WM_GESTURE_TWEAK) {
- rcti *rect= gesture->customdata;
- int dx= rect->xmax - rect->xmin;
- int dy= rect->ymax - rect->ymin;
- if(ABS(dx)+ABS(dy) > U.tweak_threshold) {
- int theta= (int)floor(4.0f*atan2f((float)dy, (float)dx)/(float)M_PI + 0.5f);
- int val= EVT_GESTURE_W;
-
- if(theta==0) val= EVT_GESTURE_E;
- else if(theta==1) val= EVT_GESTURE_NE;
- else if(theta==2) val= EVT_GESTURE_N;
- else if(theta==3) val= EVT_GESTURE_NW;
- else if(theta==-1) val= EVT_GESTURE_SE;
- else if(theta==-2) val= EVT_GESTURE_S;
- else if(theta==-3) val= EVT_GESTURE_SW;
+ if (gesture->type == WM_GESTURE_TWEAK) {
+ rcti *rect = gesture->customdata;
+ int dx = rect->xmax - rect->xmin;
+ int dy = rect->ymax - rect->ymin;
+ if (ABS(dx) + ABS(dy) > U.tweak_threshold) {
+ int theta = (int)floor(4.0f * atan2f((float)dy, (float)dx) / (float)M_PI + 0.5f);
+ int val = EVT_GESTURE_W;
+
+ if (theta == 0) val = EVT_GESTURE_E;
+ else if (theta == 1) val = EVT_GESTURE_NE;
+ else if (theta == 2) val = EVT_GESTURE_N;
+ else if (theta == 3) val = EVT_GESTURE_NW;
+ else if (theta == -1) val = EVT_GESTURE_SE;
+ else if (theta == -2) val = EVT_GESTURE_S;
+ else if (theta == -3) val = EVT_GESTURE_SW;
#if 0
/* debug */
- if(val==1) printf("tweak north\n");
- if(val==2) printf("tweak north-east\n");
- if(val==3) printf("tweak east\n");
- if(val==4) printf("tweak south-east\n");
- if(val==5) printf("tweak south\n");
- if(val==6) printf("tweak south-west\n");
- if(val==7) printf("tweak west\n");
- if(val==8) printf("tweak north-west\n");
+ if (val == 1) printf("tweak north\n");
+ if (val == 2) printf("tweak north-east\n");
+ if (val == 3) printf("tweak east\n");
+ if (val == 4) printf("tweak south-east\n");
+ if (val == 5) printf("tweak south\n");
+ if (val == 6) printf("tweak south-west\n");
+ if (val == 7) printf("tweak west\n");
+ if (val == 8) printf("tweak north-west\n");
#endif
return val;
}
@@ -165,7 +166,7 @@ int wm_gesture_evaluate(wmGesture *gesture)
static void wm_gesture_draw_rect(wmGesture *gt)
{
- rcti *rect= (rcti *)gt->customdata;
+ rcti *rect = (rcti *)gt->customdata;
glEnable(GL_BLEND);
glColor4f(1.0, 1.0, 1.0, 0.05);
@@ -189,7 +190,7 @@ static void wm_gesture_draw_rect(wmGesture *gt)
static void wm_gesture_draw_line(wmGesture *gt)
{
- rcti *rect= (rcti *)gt->customdata;
+ rcti *rect = (rcti *)gt->customdata;
glEnable(GL_LINE_STIPPLE);
glColor3ub(96, 96, 96);
@@ -205,22 +206,22 @@ static void wm_gesture_draw_line(wmGesture *gt)
static void wm_gesture_draw_circle(wmGesture *gt)
{
- rcti *rect= (rcti *)gt->customdata;
+ rcti *rect = (rcti *)gt->customdata;
glTranslatef((float)rect->xmin, (float)rect->ymin, 0.0f);
glEnable(GL_BLEND);
glColor4f(1.0, 1.0, 1.0, 0.05);
- glutil_draw_filled_arc(0.0, M_PI*2.0, rect->xmax, 40);
+ glutil_draw_filled_arc(0.0, M_PI * 2.0, rect->xmax, 40);
glDisable(GL_BLEND);
glEnable(GL_LINE_STIPPLE);
glColor3ub(96, 96, 96);
glLineStipple(1, 0xAAAA);
- glutil_draw_lined_arc(0.0, M_PI*2.0, rect->xmax, 40);
+ glutil_draw_lined_arc(0.0, M_PI * 2.0, rect->xmax, 40);
glColor3ub(255, 255, 255);
glLineStipple(1, 0x5555);
- glutil_draw_lined_arc(0.0, M_PI*2.0, rect->xmax, 40);
+ glutil_draw_lined_arc(0.0, M_PI * 2.0, rect->xmax, 40);
glDisable(GL_LINE_STIPPLE);
glTranslatef((float)-rect->xmin, (float)-rect->ymin, 0.0f);
@@ -229,35 +230,35 @@ static void wm_gesture_draw_circle(wmGesture *gt)
static void draw_filled_lasso(wmGesture *gt)
{
- ScanFillVert *v=NULL, *lastv=NULL, *firstv=NULL;
+ ScanFillVert *v = NULL, *lastv = NULL, *firstv = NULL;
ScanFillFace *efa;
- short *lasso= (short *)gt->customdata;
+ short *lasso = (short *)gt->customdata;
int i;
BLI_begin_edgefill();
- for (i=0; i<gt->points; i++, lasso+=2) {
+ for (i = 0; i < gt->points; i++, lasso += 2) {
float co[3];
- co[0]= (float)lasso[0];
- co[1]= (float)lasso[1];
- co[2]= 0.0f;
+ co[0] = (float)lasso[0];
+ co[1] = (float)lasso[1];
+ co[2] = 0.0f;
v = BLI_addfillvert(co);
if (lastv)
/* e = */ /* UNUSED */ BLI_addfilledge(lastv, v);
lastv = v;
- if (firstv==NULL) firstv = v;
+ if (firstv == NULL) firstv = v;
}
/* highly unlikely this will fail, but could crash if (gt->points == 0) */
- if(firstv) {
+ if (firstv) {
BLI_addfilledge(firstv, v);
BLI_edgefill(0);
glEnable(GL_BLEND);
glColor4f(1.0, 1.0, 1.0, 0.05);
glBegin(GL_TRIANGLES);
- for (efa = fillfacebase.first; efa; efa=efa->next) {
+ for (efa = fillfacebase.first; efa; efa = efa->next) {
glVertex2fv(efa->v1->co);
glVertex2fv(efa->v2->co);
glVertex2fv(efa->v3->co);
@@ -271,7 +272,7 @@ static void draw_filled_lasso(wmGesture *gt)
static void wm_gesture_draw_lasso(wmGesture *gt)
{
- short *lasso= (short *)gt->customdata;
+ short *lasso = (short *)gt->customdata;
int i;
draw_filled_lasso(gt);
@@ -280,19 +281,19 @@ static void wm_gesture_draw_lasso(wmGesture *gt)
glColor3ub(96, 96, 96);
glLineStipple(1, 0xAAAA);
glBegin(GL_LINE_STRIP);
- for(i=0; i<gt->points; i++, lasso+=2)
+ for (i = 0; i < gt->points; i++, lasso += 2)
glVertex2sv(lasso);
- if(gt->type==WM_GESTURE_LASSO)
+ if (gt->type == WM_GESTURE_LASSO)
glVertex2sv((short *)gt->customdata);
glEnd();
glColor3ub(255, 255, 255);
glLineStipple(1, 0x5555);
glBegin(GL_LINE_STRIP);
- lasso= (short *)gt->customdata;
- for(i=0; i<gt->points; i++, lasso+=2)
+ lasso = (short *)gt->customdata;
+ for (i = 0; i < gt->points; i++, lasso += 2)
glVertex2sv(lasso);
- if(gt->type==WM_GESTURE_LASSO)
+ if (gt->type == WM_GESTURE_LASSO)
glVertex2sv((short *)gt->customdata);
glEnd();
@@ -302,7 +303,7 @@ static void wm_gesture_draw_lasso(wmGesture *gt)
static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt)
{
- rcti *rect= (rcti *)gt->customdata;
+ rcti *rect = (rcti *)gt->customdata;
glEnable(GL_LINE_STIPPLE);
glColor3ub(96, 96, 96);
@@ -320,41 +321,41 @@ static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt)
/* called in wm_draw.c */
void wm_gesture_draw(wmWindow *win)
{
- wmGesture *gt= (wmGesture *)win->gesture.first;
+ wmGesture *gt = (wmGesture *)win->gesture.first;
- for(; gt; gt= gt->next) {
+ for (; gt; gt = gt->next) {
/* all in subwindow space */
wmSubWindowSet(win, gt->swinid);
- if(gt->type==WM_GESTURE_RECT)
+ if (gt->type == WM_GESTURE_RECT)
wm_gesture_draw_rect(gt);
-// else if(gt->type==WM_GESTURE_TWEAK)
+// else if (gt->type==WM_GESTURE_TWEAK)
// wm_gesture_draw_line(gt);
- else if(gt->type==WM_GESTURE_CIRCLE)
+ else if (gt->type == WM_GESTURE_CIRCLE)
wm_gesture_draw_circle(gt);
- else if(gt->type==WM_GESTURE_CROSS_RECT) {
- if(gt->mode==1)
+ else if (gt->type == WM_GESTURE_CROSS_RECT) {
+ if (gt->mode == 1)
wm_gesture_draw_rect(gt);
else
wm_gesture_draw_cross(win, gt);
}
- else if(gt->type==WM_GESTURE_LINES)
+ else if (gt->type == WM_GESTURE_LINES)
wm_gesture_draw_lasso(gt);
- else if(gt->type==WM_GESTURE_LASSO)
+ else if (gt->type == WM_GESTURE_LASSO)
wm_gesture_draw_lasso(gt);
- else if(gt->type==WM_GESTURE_STRAIGHTLINE)
+ else if (gt->type == WM_GESTURE_STRAIGHTLINE)
wm_gesture_draw_line(gt);
}
}
void wm_gesture_tag_redraw(bContext *C)
{
- wmWindow *win= CTX_wm_window(C);
- bScreen *screen= CTX_wm_screen(C);
- ARegion *ar= CTX_wm_region(C);
+ wmWindow *win = CTX_wm_window(C);
+ bScreen *screen = CTX_wm_screen(C);
+ ARegion *ar = CTX_wm_region(C);
- if(screen)
- screen->do_draw_gesture= 1;
+ if (screen)
+ screen->do_draw_gesture = 1;
wm_tag_redraw_overlay(win, ar);
}
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 1ae03ca9f6f..39651cea3ab 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -68,7 +68,7 @@
#include "BLI_utildefines.h"
#include "RE_engine.h"
-#include "RE_pipeline.h" /* RE_ free stuff */
+#include "RE_pipeline.h" /* RE_ free stuff */
#ifdef WITH_PYTHON
#include "BPY_extern.h"
@@ -125,20 +125,20 @@ int wm_start_with_console = 0; /* used in creator.c */
void WM_init(bContext *C, int argc, const char **argv)
{
if (!G.background) {
- wm_ghost_init(C); /* note: it assigns C to ghost! */
+ wm_ghost_init(C); /* note: it assigns C to ghost! */
wm_init_cursor_data();
}
GHOST_CreateSystemPaths();
wm_operatortype_init();
WM_menutype_init();
- set_free_windowmanager_cb(wm_close_and_free); /* library.c */
+ set_free_windowmanager_cb(wm_close_and_free); /* library.c */
set_blender_test_break_cb(wm_window_testbreak); /* blender.c */
DAG_editors_update_cb(ED_render_id_flush_update, ED_render_scene_update); /* depsgraph.c */
- ED_spacetypes_init(); /* editors/space_api/spacetype.c */
+ ED_spacetypes_init(); /* editors/space_api/spacetype.c */
- ED_file_init(); /* for fsmenu */
+ ED_file_init(); /* for fsmenu */
ED_init_node_butfuncs();
BLF_init(11, U.dpi); /* Please update source/gamengine/GamePlayer/GPG_ghost.cpp if you change this */
@@ -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,21 +192,21 @@ 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(G.main->name[0] == 0)
+#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);
}
void WM_init_splash(bContext *C)
{
- if((U.uiflag & USER_SPLASH_DISABLE) == 0) {
- wmWindowManager *wm= CTX_wm_manager(C);
- wmWindow *prevwin= CTX_wm_window(C);
+ if ((U.uiflag & USER_SPLASH_DISABLE) == 0) {
+ wmWindowManager *wm = CTX_wm_manager(C);
+ wmWindow *prevwin = CTX_wm_window(C);
- if(wm->windows.first) {
+ if (wm->windows.first) {
CTX_wm_window_set(C, wm->windows.first);
WM_operator_name_call(C, "WM_OT_splash", WM_OP_INVOKE_DEFAULT, NULL);
CTX_wm_window_set(C, prevwin);
@@ -216,28 +216,28 @@ void WM_init_splash(bContext *C)
int WM_init_game(bContext *C)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- wmWindow* win;
+ wmWindowManager *wm = CTX_wm_manager(C);
+ wmWindow *win;
ScrArea *sa;
- ARegion *ar= NULL;
+ ARegion *ar = NULL;
- Scene *scene= CTX_data_scene(C);
+ Scene *scene = CTX_data_scene(C);
if (!scene) {
// XXX, this should not be needed.
Main *bmain = CTX_data_main(C);
- scene= bmain->scene.first;
+ scene = bmain->scene.first;
}
win = wm->windows.first;
//first to get a valid window
- if(win)
+ if (win)
CTX_wm_window_set(C, win);
sa = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_VIEW3D, 0);
- ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
// if we have a valid 3D view
if (sa && ar) {
@@ -247,32 +247,31 @@ int WM_init_game(bContext *C)
CTX_wm_region_set(C, ar);
/* disable quad view */
- if(ar->alignment == RGN_ALIGN_QSPLIT)
+ if (ar->alignment == RGN_ALIGN_QSPLIT)
WM_operator_name_call(C, "SCREEN_OT_region_quadview", WM_OP_EXEC_DEFAULT, NULL);
/* toolbox, properties panel and header are hidden */
- for(arhide=sa->regionbase.first; arhide; arhide=arhide->next) {
- if(arhide->regiontype != RGN_TYPE_WINDOW) {
- if(!(arhide->flag & RGN_FLAG_HIDDEN)) {
+ for (arhide = sa->regionbase.first; arhide; arhide = arhide->next) {
+ if (arhide->regiontype != RGN_TYPE_WINDOW) {
+ if (!(arhide->flag & RGN_FLAG_HIDDEN)) {
ED_region_toggle_hidden(C, arhide);
}
}
}
/* full screen the area */
- if(!sa->full) {
+ if (!sa->full) {
ED_screen_full_toggle(C, win, sa);
}
/* Fullscreen */
- if((scene->gm.playerflag & GAME_PLAYER_FULLSCREEN)) {
+ if ((scene->gm.playerflag & GAME_PLAYER_FULLSCREEN)) {
WM_operator_name_call(C, "WM_OT_window_fullscreen_toggle", WM_OP_EXEC_DEFAULT, NULL);
wm_get_screensize(&ar->winrct.xmax, &ar->winrct.ymax);
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.");
@@ -310,7 +308,7 @@ static void free_openrecent(void)
{
struct RecentFile *recent;
- for(recent = G.recent_files.first; recent; recent=recent->next)
+ for (recent = G.recent_files.first; recent; recent = recent->next)
MEM_freeN(recent->filepath);
BLI_freelistN(&(G.recent_files));
@@ -319,10 +317,7 @@ static void free_openrecent(void)
/* bad stuff*/
-extern wchar_t *copybuf;
-extern wchar_t *copybufinfo;
-
- // XXX copy/paste buffer stuff...
+// XXX copy/paste buffer stuff...
extern void free_anim_copybuf(void);
extern void free_anim_drivers_copybuf(void);
extern void free_fmodifiers_copybuf(void);
@@ -340,13 +335,13 @@ void WM_exit_ext(bContext *C, const short do_python)
/* first wrap up running stuff, we assume only the active WM is running */
/* modal handlers are on window level freed, others too? */
/* note; same code copied in wm_files.c */
- if(C && CTX_wm_manager(C)) {
+ if (C && CTX_wm_manager(C)) {
WM_jobs_stop_all(CTX_wm_manager(C));
- for(win= CTX_wm_manager(C)->windows.first; win; win= win->next) {
+ for (win = CTX_wm_manager(C)->windows.first; win; win = win->next) {
- CTX_wm_window_set(C, win); /* needed by operator close callbacks */
+ CTX_wm_window_set(C, win); /* needed by operator close callbacks */
WM_event_remove_handlers(C, &win->handlers);
WM_event_remove_handlers(C, &win->modalhandlers);
ED_screen_exit(C, win, win->screen);
@@ -357,7 +352,7 @@ void WM_exit_ext(bContext *C, const short do_python)
WM_menutype_free();
/* all non-screen and non-space stuff editors did, like editmode */
- if(C)
+ if (C)
ED_editors_exit(C);
// XXX
@@ -371,15 +366,15 @@ void WM_exit_ext(bContext *C, const short do_python)
BKE_freecubetable();
- ED_preview_free_dbase(); /* frees a Main dbase, before free_blender! */
+ ED_preview_free_dbase(); /* frees a Main dbase, before free_blender! */
- if(C && CTX_wm_manager(C))
- wm_free_reports(C); /* before free_blender! - since the ListBases get freed there */
+ if (C && CTX_wm_manager(C))
+ wm_free_reports(C); /* before free_blender! - since the ListBases get freed there */
seq_free_clipboard(); /* sequencer.c */
BKE_tracking_free_clipboard();
- free_blender(); /* blender.c, does entire library and spacetypes */
+ free_blender(); /* blender.c, does entire library and spacetypes */
// free_matcopybuf();
free_anim_copybuf();
free_anim_drivers_copybuf();
@@ -404,7 +399,7 @@ void WM_exit_ext(bContext *C, const short do_python)
#ifdef WITH_PYTHON
/* option not to close python so we can use 'atexit' */
- if(do_python) {
+ if (do_python) {
/* XXX - old note */
/* before free_blender so py's gc happens while library still exists */
/* needed at least for a rare sigsegv that can happen in pydrivers */
@@ -421,11 +416,9 @@ void WM_exit_ext(bContext *C, const short do_python)
GPU_global_buffer_pool_free();
GPU_free_unused_buffers();
GPU_extensions_exit();
-
-// if (copybuf) MEM_freeN(copybuf);
-// if (copybufinfo) MEM_freeN(copybufinfo);
+
if (!G.background) {
- BKE_undo_save_quit(); // saves quit.blend if global undo is on
+ BKE_undo_save_quit(); /* saves quit.blend if global undo is on */
}
BKE_reset_undo();
@@ -445,7 +438,7 @@ void WM_exit_ext(bContext *C, const short do_python)
GHOST_DisposeSystemPaths();
- if(MEM_get_memory_blocks_in_use()!=0) {
+ if (MEM_get_memory_blocks_in_use() != 0) {
printf("Error: Not freed memory blocks: %d\n", MEM_get_memory_blocks_in_use());
MEM_printmemlist();
}
@@ -455,7 +448,7 @@ void WM_exit_ext(bContext *C, const short do_python)
#ifdef WIN32
/* ask user to press enter when in debug mode */
- if(G.f & G_DEBUG) {
+ if (G.debug & G_DEBUG) {
printf("press enter key to exit...\n\n");
getchar();
}
@@ -465,5 +458,5 @@ void WM_exit_ext(bContext *C, const short do_python)
void WM_exit(bContext *C)
{
WM_exit_ext(C, 1);
- exit(G.afbreek==1);
+ exit(G.afbreek == 1);
}
diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c
index f2ee5a328d6..a55a8df3301 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 {
@@ -134,12 +134,12 @@ struct wmJob {
*/
static wmJob *wm_job_find(wmWindowManager *wm, void *owner, const char *name)
{
- wmJob *steve, *found=NULL;
+ wmJob *steve, *found = NULL;
- for(steve= wm->jobs.first; steve; steve= steve->next)
- if(steve->owner==owner) {
- found= steve;
- if (name && strcmp(steve->name, name)==0)
+ for (steve = wm->jobs.first; steve; steve = steve->next)
+ if (steve->owner == owner) {
+ found = steve;
+ if (name && strcmp(steve->name, name) == 0)
return steve;
}
@@ -150,18 +150,18 @@ 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);
+ wmJob *steve = wm_job_find(wm, owner, name);
- if(steve==NULL) {
- steve= MEM_callocN(sizeof(wmJob), "new job");
+ if (steve == NULL) {
+ steve = MEM_callocN(sizeof(wmJob), "new job");
BLI_addtail(&wm->jobs, steve);
- steve->win= win;
- steve->owner= owner;
- steve->flag= flag;
+ steve->win = win;
+ steve->owner = owner;
+ steve->flag = flag;
BLI_strncpy(steve->name, name, sizeof(steve->name));
}
@@ -173,16 +173,16 @@ int WM_jobs_test(wmWindowManager *wm, void *owner)
{
wmJob *steve;
- for(steve= wm->jobs.first; steve; steve= steve->next)
- if(steve->owner==owner)
- if(steve->running)
+ for (steve = wm->jobs.first; steve; steve = steve->next)
+ if (steve->owner == owner)
+ if (steve->running)
return 1;
return 0;
}
float WM_jobs_progress(wmWindowManager *wm, void *owner)
{
- wmJob *steve= wm_job_find(wm, owner, NULL);
+ wmJob *steve = wm_job_find(wm, owner, NULL);
if (steve && steve->flag & WM_JOB_PROGRESS)
return steve->progress;
@@ -192,7 +192,7 @@ float WM_jobs_progress(wmWindowManager *wm, void *owner)
char *WM_jobs_name(wmWindowManager *wm, void *owner)
{
- wmJob *steve= wm_job_find(wm, owner, NULL);
+ wmJob *steve = wm_job_find(wm, owner, NULL);
if (steve)
return steve->name;
@@ -205,11 +205,12 @@ int WM_jobs_is_running(wmJob *steve)
return steve->running;
}
-void* WM_jobs_get_customdata(wmJob * steve)
+void *WM_jobs_get_customdata(wmJob *steve)
{
if (!steve->customdata) {
return steve->run_customdata;
- } else {
+ }
+ else {
return steve->customdata;
}
}
@@ -217,15 +218,15 @@ void* WM_jobs_get_customdata(wmJob * steve)
void WM_jobs_customdata(wmJob *steve, void *customdata, void (*free)(void *))
{
/* pending job? just free */
- if(steve->customdata)
+ if (steve->customdata)
steve->free(steve->customdata);
- steve->customdata= customdata;
- steve->free= free;
+ steve->customdata = customdata;
+ steve->free = free;
- if(steve->running) {
+ if (steve->running) {
/* signal job to end */
- steve->stop= 1;
+ steve->stop = 1;
}
}
@@ -237,98 +238,98 @@ void WM_jobs_timer(wmJob *steve, double timestep, unsigned int note, unsigned in
}
void WM_jobs_callbacks(wmJob *steve,
- void (*startjob)(void *, short *, short *, float *),
- void (*initjob)(void *),
- void (*update)(void *),
- void (*endjob)(void *))
+ void (*startjob)(void *, short *, short *, float *),
+ void (*initjob)(void *),
+ void (*update)(void *),
+ void (*endjob)(void *))
{
- steve->startjob= startjob;
- steve->initjob= initjob;
- steve->update= update;
- steve->endjob= endjob;
+ steve->startjob = startjob;
+ steve->initjob = initjob;
+ steve->update = update;
+ steve->endjob = endjob;
}
static void *do_job_thread(void *job_v)
{
- wmJob *steve= job_v;
+ wmJob *steve = job_v;
steve->startjob(steve->run_customdata, &steve->stop, &steve->do_update, &steve->progress);
- steve->ready= 1;
+ steve->ready = 1;
return NULL;
}
-/* dont allow same startjob to be executed twice */
+/* don't allow same startjob to be executed twice */
static void wm_jobs_test_suspend_stop(wmWindowManager *wm, wmJob *test)
{
wmJob *steve;
- int suspend= 0;
+ int suspend = 0;
/* job added with suspend flag, we wait 1 timer step before activating it */
- if(test->flag & WM_JOB_SUSPEND) {
- suspend= 1;
+ if (test->flag & WM_JOB_SUSPEND) {
+ suspend = 1;
test->flag &= ~WM_JOB_SUSPEND;
}
else {
/* check other jobs */
- for(steve= wm->jobs.first; steve; steve= steve->next) {
+ for (steve = wm->jobs.first; steve; steve = steve->next) {
/* obvious case, no test needed */
- if(steve==test || !steve->running) continue;
+ if (steve == test || !steve->running) continue;
/* if new job is not render, then check for same startjob */
- if(0==(test->flag & WM_JOB_EXCL_RENDER))
- if(steve->startjob!=test->startjob)
+ if (0 == (test->flag & WM_JOB_EXCL_RENDER))
+ if (steve->startjob != test->startjob)
continue;
/* if new job is render, any render job should be stopped */
- if(test->flag & WM_JOB_EXCL_RENDER)
- if(0==(steve->flag & WM_JOB_EXCL_RENDER))
+ if (test->flag & WM_JOB_EXCL_RENDER)
+ if (0 == (steve->flag & WM_JOB_EXCL_RENDER))
continue;
- suspend= 1;
+ suspend = 1;
/* if this job has higher priority, stop others */
- if(test->flag & WM_JOB_PRIORITY) {
- steve->stop= 1;
+ if (test->flag & WM_JOB_PRIORITY) {
+ steve->stop = 1;
// printf("job stopped: %s\n", steve->name);
}
}
}
/* possible suspend ourselfs, waiting for other jobs, or de-suspend */
- test->suspended= suspend;
- // if(suspend) printf("job suspended: %s\n", test->name);
+ test->suspended = suspend;
+ // if (suspend) printf("job suspended: %s\n", test->name);
}
/* if job running, the same owner gave it a new job */
/* if different owner starts existing startjob, it suspends itself */
void WM_jobs_start(wmWindowManager *wm, wmJob *steve)
{
- if(steve->running) {
+ if (steve->running) {
/* signal job to end and restart */
- steve->stop= 1;
+ steve->stop = 1;
// printf("job started a running job, ending... %s\n", steve->name);
}
else {
- if(steve->customdata && steve->startjob) {
+ if (steve->customdata && steve->startjob) {
wm_jobs_test_suspend_stop(wm, steve);
- if(steve->suspended==0) {
+ if (steve->suspended == 0) {
/* copy to ensure proper free in end */
- steve->run_customdata= steve->customdata;
- steve->run_free= steve->free;
- steve->free= NULL;
- steve->customdata= NULL;
- steve->running= 1;
+ steve->run_customdata = steve->customdata;
+ steve->run_free = steve->free;
+ steve->free = NULL;
+ steve->customdata = NULL;
+ steve->running = 1;
- if(steve->initjob)
+ if (steve->initjob)
steve->initjob(steve->run_customdata);
- steve->stop= 0;
- steve->ready= 0;
- steve->progress= 0.0;
+ steve->stop = 0;
+ steve->ready = 0;
+ steve->progress = 0.0;
// printf("job started: %s\n", steve->name);
@@ -337,8 +338,8 @@ void WM_jobs_start(wmWindowManager *wm, wmJob *steve)
}
/* restarted job has timer already */
- if(steve->wt==NULL)
- steve->wt= WM_event_add_timer(wm, steve->win, TIMERJOBS, steve->timestep);
+ if (steve->wt == NULL)
+ steve->wt = WM_event_add_timer(wm, steve->win, TIMERJOBS, steve->timestep);
}
else printf("job fails, not initialized\n");
}
@@ -347,20 +348,20 @@ void WM_jobs_start(wmWindowManager *wm, wmJob *steve)
/* stop job, free data completely */
static void wm_jobs_kill_job(wmWindowManager *wm, wmJob *steve)
{
- if(steve->running) {
+ if (steve->running) {
/* signal job to end */
- steve->stop= 1;
+ steve->stop = 1;
BLI_end_threads(&steve->threads);
- if(steve->endjob)
+ if (steve->endjob)
steve->endjob(steve->run_customdata);
}
- if(steve->wt)
+ if (steve->wt)
WM_event_remove_timer(wm, steve->win, steve->wt);
- if(steve->customdata)
+ if (steve->customdata)
steve->free(steve->customdata);
- if(steve->run_customdata)
+ if (steve->run_customdata)
steve->run_free(steve->run_customdata);
/* remove steve */
@@ -373,7 +374,7 @@ void WM_jobs_stop_all(wmWindowManager *wm)
{
wmJob *steve;
- while((steve= wm->jobs.first))
+ while ((steve = wm->jobs.first))
wm_jobs_kill_job(wm, steve);
}
@@ -383,10 +384,10 @@ void WM_jobs_stop(wmWindowManager *wm, void *owner, void *startjob)
{
wmJob *steve;
- for(steve= wm->jobs.first; steve; steve= steve->next)
- if(steve->owner==owner || steve->startjob==startjob)
- if(steve->running)
- steve->stop= 1;
+ for (steve = wm->jobs.first; steve; steve = steve->next)
+ if (steve->owner == owner || steve->startjob == startjob)
+ if (steve->running)
+ steve->stop = 1;
}
/* actually terminate thread and job timer */
@@ -394,14 +395,15 @@ void WM_jobs_kill(wmWindowManager *wm, void *owner, void (*startjob)(void *, sho
{
wmJob *steve;
- steve= wm->jobs.first;
- while(steve) {
- if(steve->owner==owner || steve->startjob==startjob) {
- wmJob* bill = steve;
- steve= steve->next;
+ steve = wm->jobs.first;
+ while (steve) {
+ if (steve->owner == owner || steve->startjob == startjob) {
+ wmJob *bill = steve;
+ steve = steve->next;
wm_jobs_kill_job(wm, bill);
- } else {
- steve= steve->next;
+ }
+ else {
+ steve = steve->next;
}
}
}
@@ -412,8 +414,8 @@ void wm_jobs_timer_ended(wmWindowManager *wm, wmTimer *wt)
{
wmJob *steve;
- for(steve= wm->jobs.first; steve; steve= steve->next) {
- if(steve->wt==wt) {
+ for (steve = wm->jobs.first; steve; steve = steve->next) {
+ if (steve->wt == wt) {
wm_jobs_kill_job(wm, steve);
return;
}
@@ -423,76 +425,77 @@ void wm_jobs_timer_ended(wmWindowManager *wm, wmTimer *wt)
/* hardcoded to event TIMERJOBS */
void wm_jobs_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt)
{
- wmJob *steve= wm->jobs.first, *stevenext;
- float total_progress= 0.f;
- float jobs_progress=0;
+ wmJob *steve = wm->jobs.first, *stevenext;
+ float total_progress = 0.f;
+ float jobs_progress = 0;
- for(; steve; steve= stevenext) {
- stevenext= steve->next;
+ for (; steve; steve = stevenext) {
+ stevenext = steve->next;
- if(steve->wt==wt) {
+ if (steve->wt == wt) {
/* running threads */
- if(steve->threads.first) {
+ if (steve->threads.first) {
/* always call note and update when ready */
- if(steve->do_update || steve->ready) {
- if(steve->update)
+ if (steve->do_update || steve->ready) {
+ if (steve->update)
steve->update(steve->run_customdata);
- if(steve->note)
+ if (steve->note)
WM_event_add_notifier(C, steve->note, NULL);
if (steve->flag & WM_JOB_PROGRESS)
- WM_event_add_notifier(C, NC_WM|ND_JOB, NULL);
- steve->do_update= 0;
+ WM_event_add_notifier(C, NC_WM | ND_JOB, NULL);
+ steve->do_update = 0;
}
- if(steve->ready) {
- if(steve->endjob)
+ if (steve->ready) {
+ if (steve->endjob)
steve->endjob(steve->run_customdata);
/* free own data */
steve->run_free(steve->run_customdata);
- steve->run_customdata= NULL;
- steve->run_free= NULL;
+ steve->run_customdata = NULL;
+ steve->run_free = NULL;
- // if(steve->stop) printf("job ready but stopped %s\n", steve->name);
+ // if (steve->stop) printf("job ready but stopped %s\n", steve->name);
// else printf("job finished %s\n", steve->name);
- steve->running= 0;
+ steve->running = 0;
BLI_end_threads(&steve->threads);
- if(steve->endnote)
+ if (steve->endnote)
WM_event_add_notifier(C, steve->endnote, NULL);
- WM_event_add_notifier(C, NC_WM|ND_JOB, NULL);
+ WM_event_add_notifier(C, NC_WM | ND_JOB, NULL);
/* new job added for steve? */
- if(steve->customdata) {
+ if (steve->customdata) {
// printf("job restarted with new data %s\n", steve->name);
WM_jobs_start(wm, steve);
}
else {
WM_event_remove_timer(wm, steve->win, steve->wt);
- steve->wt= NULL;
+ steve->wt = NULL;
/* remove steve */
BLI_remlink(&wm->jobs, steve);
MEM_freeN(steve);
}
- } else if (steve->flag & WM_JOB_PROGRESS) {
+ }
+ else if (steve->flag & WM_JOB_PROGRESS) {
/* accumulate global progress for running jobs */
jobs_progress++;
total_progress += steve->progress;
}
}
- else if(steve->suspended) {
+ else if (steve->suspended) {
WM_jobs_start(wm, steve);
}
}
- else if(steve->threads.first && !steve->ready) {
- if(steve->flag & WM_JOB_PROGRESS) {
+ else if (steve->threads.first && !steve->ready) {
+ if (steve->flag & WM_JOB_PROGRESS) {
/* accumulate global progress for running jobs */
jobs_progress++;
total_progress += steve->progress;
@@ -501,12 +504,13 @@ void wm_jobs_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt)
}
/* on file load 'winactive' can be NULL, possibly it should not happen but for now do a NULL check - campbell */
- if(wm->winactive) {
+ if (wm->winactive) {
/* if there are running jobs, set the global progress indicator */
if (jobs_progress > 0) {
float progress = total_progress / (float)jobs_progress;
WM_progress_set(wm->winactive, progress);
- } else {
+ }
+ else {
WM_progress_clear(wm->winactive);
}
}
@@ -516,8 +520,8 @@ int WM_jobs_has_running(wmWindowManager *wm)
{
wmJob *steve;
- for(steve= wm->jobs.first; steve; steve= steve->next)
- if(steve->running)
+ for (steve = wm->jobs.first; steve; steve = steve->next)
+ if (steve->running)
return 1;
return 0;
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index d603262227f..ddbacc6b747 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -61,21 +61,21 @@
#include "wm_event_types.h"
/******************************* Keymap Item **********************************
- * Item in a keymap, that maps from an event to an operator or modal map item */
+* Item in a keymap, that maps from an event to an operator or modal map item */
static wmKeyMapItem *wm_keymap_item_copy(wmKeyMapItem *kmi)
{
wmKeyMapItem *kmin = MEM_dupallocN(kmi);
- kmin->prev= kmin->next= NULL;
+ kmin->prev = kmin->next = NULL;
kmin->flag &= ~KMI_UPDATE;
- if(kmin->properties) {
- kmin->ptr= MEM_callocN(sizeof(PointerRNA), "UserKeyMapItemPtr");
+ if (kmin->properties) {
+ kmin->ptr = MEM_callocN(sizeof(PointerRNA), "UserKeyMapItemPtr");
WM_operator_properties_create(kmin->ptr, kmin->idname);
- kmin->properties= IDP_CopyProperty(kmin->properties);
- kmin->ptr->data= kmin->properties;
+ kmin->properties = IDP_CopyProperty(kmin->properties);
+ kmin->ptr->data = kmin->properties;
}
return kmin;
@@ -84,7 +84,7 @@ static wmKeyMapItem *wm_keymap_item_copy(wmKeyMapItem *kmi)
static void wm_keymap_item_free(wmKeyMapItem *kmi)
{
/* not kmi itself */
- if(kmi->ptr) {
+ if (kmi->ptr) {
WM_operator_properties_free(kmi->ptr);
MEM_freeN(kmi->ptr);
}
@@ -98,14 +98,14 @@ static void wm_keymap_item_properties_set(wmKeyMapItem *kmi)
static int wm_keymap_item_equals_result(wmKeyMapItem *a, wmKeyMapItem *b)
{
- if(strcmp(a->idname, b->idname) != 0)
+ if (strcmp(a->idname, b->idname) != 0)
return 0;
- if(!((a->ptr==NULL && b->ptr==NULL) ||
- (a->ptr && b->ptr && IDP_EqualsProperties(a->ptr->data, b->ptr->data))))
+ if (!((a->ptr == NULL && b->ptr == NULL) ||
+ (a->ptr && b->ptr && IDP_EqualsProperties(a->ptr->data, b->ptr->data))))
return 0;
- if((a->flag & KMI_INACTIVE) != (b->flag & KMI_INACTIVE))
+ if ((a->flag & KMI_INACTIVE) != (b->flag & KMI_INACTIVE))
return 0;
return (a->propvalue == b->propvalue);
@@ -144,9 +144,9 @@ static wmKeyMapDiffItem *wm_keymap_diff_item_copy(wmKeyMapDiffItem *kmdi)
wmKeyMapDiffItem *kmdin = MEM_dupallocN(kmdi);
kmdin->next = kmdin->prev = NULL;
- if(kmdi->add_item)
+ if (kmdi->add_item)
kmdin->add_item = wm_keymap_item_copy(kmdi->add_item);
- if(kmdi->remove_item)
+ if (kmdi->remove_item)
kmdin->remove_item = wm_keymap_item_copy(kmdi->remove_item);
return kmdin;
@@ -154,11 +154,11 @@ static wmKeyMapDiffItem *wm_keymap_diff_item_copy(wmKeyMapDiffItem *kmdi)
static void wm_keymap_diff_item_free(wmKeyMapDiffItem *kmdi)
{
- if(kmdi->remove_item) {
+ if (kmdi->remove_item) {
wm_keymap_item_free(kmdi->remove_item);
MEM_freeN(kmdi->remove_item);
}
- if(kmdi->add_item) {
+ if (kmdi->add_item) {
wm_keymap_item_free(kmdi->add_item);
MEM_freeN(kmdi->add_item);
}
@@ -172,7 +172,7 @@ wmKeyConfig *WM_keyconfig_new(wmWindowManager *wm, const char *idname)
{
wmKeyConfig *keyconf;
- keyconf= MEM_callocN(sizeof(wmKeyConfig), "wmKeyConfig");
+ keyconf = MEM_callocN(sizeof(wmKeyConfig), "wmKeyConfig");
BLI_strncpy(keyconf->idname, idname, sizeof(keyconf->idname));
BLI_addtail(&wm->keyconfigs, keyconf);
@@ -205,7 +205,7 @@ void WM_keyconfig_free(wmKeyConfig *keyconf)
{
wmKeyMap *km;
- while((km= keyconf->keymaps.first)) {
+ while ((km = keyconf->keymaps.first)) {
WM_keymap_free(km);
BLI_freelinkN(&keyconf->keymaps, km);
}
@@ -217,8 +217,8 @@ static wmKeyConfig *wm_keyconfig_list_find(ListBase *lb, char *idname)
{
wmKeyConfig *kc;
- for(kc= lb->first; kc; kc= kc->next)
- if(0==strncmp(idname, kc->idname, KMAP_MAX_NAME))
+ for (kc = lb->first; kc; kc = kc->next)
+ if (0 == strncmp(idname, kc->idname, KMAP_MAX_NAME))
return kc;
return NULL;
@@ -229,8 +229,8 @@ static wmKeyConfig *WM_keyconfig_active(wmWindowManager *wm)
wmKeyConfig *keyconf;
/* first try from preset */
- keyconf= wm_keyconfig_list_find(&wm->keyconfigs, U.keyconfigstr);
- if(keyconf)
+ keyconf = wm_keyconfig_list_find(&wm->keyconfigs, U.keyconfigstr);
+ if (keyconf)
return keyconf;
/* otherwise use default */
@@ -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);
@@ -255,11 +255,11 @@ void WM_keyconfig_set_active(wmWindowManager *wm, const char *idname)
static wmKeyMap *wm_keymap_new(const char *idname, int spaceid, int regionid)
{
- wmKeyMap *km= MEM_callocN(sizeof(struct wmKeyMap), "keymap list");
+ wmKeyMap *km = MEM_callocN(sizeof(struct wmKeyMap), "keymap list");
BLI_strncpy(km->idname, idname, KMAP_MAX_NAME);
- km->spaceid= spaceid;
- km->regionid= regionid;
+ km->spaceid = spaceid;
+ km->regionid = regionid;
return km;
}
@@ -270,18 +270,18 @@ static wmKeyMap *wm_keymap_copy(wmKeyMap *keymap)
wmKeyMapItem *kmi, *kmin;
wmKeyMapDiffItem *kmdi, *kmdin;
- keymapn->modal_items= keymap->modal_items;
- keymapn->poll= keymap->poll;
- keymapn->items.first= keymapn->items.last= NULL;
- keymapn->flag &= ~(KEYMAP_UPDATE|KEYMAP_EXPANDED);
+ keymapn->modal_items = keymap->modal_items;
+ keymapn->poll = keymap->poll;
+ keymapn->items.first = keymapn->items.last = NULL;
+ keymapn->flag &= ~(KEYMAP_UPDATE | KEYMAP_EXPANDED);
- for(kmdi=keymap->diff_items.first; kmdi; kmdi=kmdi->next) {
- kmdin= wm_keymap_diff_item_copy(kmdi);
+ for (kmdi = keymap->diff_items.first; kmdi; kmdi = kmdi->next) {
+ kmdin = wm_keymap_diff_item_copy(kmdi);
BLI_addtail(&keymapn->items, kmdin);
}
- for(kmi=keymap->items.first; kmi; kmi=kmi->next) {
- kmin= wm_keymap_item_copy(kmi);
+ for (kmi = keymap->items.first; kmi; kmi = kmi->next) {
+ kmin = wm_keymap_item_copy(kmi);
BLI_addtail(&keymapn->items, kmin);
}
@@ -293,10 +293,10 @@ void WM_keymap_free(wmKeyMap *keymap)
wmKeyMapItem *kmi;
wmKeyMapDiffItem *kmdi;
- for(kmdi=keymap->diff_items.first; kmdi; kmdi=kmdi->next)
+ for (kmdi = keymap->diff_items.first; kmdi; kmdi = kmdi->next)
wm_keymap_diff_item_free(kmdi);
- for(kmi=keymap->items.first; kmi; kmi=kmi->next)
+ for (kmi = keymap->items.first; kmi; kmi = kmi->next)
wm_keymap_item_free(kmi);
BLI_freelistN(&keymap->diff_items);
@@ -305,18 +305,18 @@ void WM_keymap_free(wmKeyMap *keymap)
static void keymap_event_set(wmKeyMapItem *kmi, short type, short val, int modifier, short keymodifier)
{
- kmi->type= type;
- kmi->val= val;
- kmi->keymodifier= keymodifier;
+ kmi->type = type;
+ kmi->val = val;
+ kmi->keymodifier = keymodifier;
- if(modifier == KM_ANY) {
- kmi->shift= kmi->ctrl= kmi->alt= kmi->oskey= KM_ANY;
+ if (modifier == KM_ANY) {
+ kmi->shift = kmi->ctrl = kmi->alt = kmi->oskey = KM_ANY;
}
else {
- kmi->shift= (modifier & KM_SHIFT) ? KM_MOD_FIRST : ((modifier & KM_SHIFT2) ? KM_MOD_SECOND : FALSE);
- kmi->ctrl= (modifier & KM_CTRL) ? KM_MOD_FIRST : ((modifier & KM_CTRL2) ? KM_MOD_SECOND : FALSE);
- kmi->alt= (modifier & KM_ALT) ? KM_MOD_FIRST : ((modifier & KM_ALT2) ? KM_MOD_SECOND : FALSE);
- kmi->oskey= (modifier & KM_OSKEY) ? KM_MOD_FIRST : ((modifier & KM_OSKEY2) ? KM_MOD_SECOND : FALSE);
+ kmi->shift = (modifier & KM_SHIFT) ? KM_MOD_FIRST : ((modifier & KM_SHIFT2) ? KM_MOD_SECOND : FALSE);
+ kmi->ctrl = (modifier & KM_CTRL) ? KM_MOD_FIRST : ((modifier & KM_CTRL2) ? KM_MOD_SECOND : FALSE);
+ kmi->alt = (modifier & KM_ALT) ? KM_MOD_FIRST : ((modifier & KM_ALT2) ? KM_MOD_SECOND : FALSE);
+ kmi->oskey = (modifier & KM_OSKEY) ? KM_MOD_FIRST : ((modifier & KM_OSKEY2) ? KM_MOD_SECOND : FALSE);
}
}
@@ -325,7 +325,8 @@ static void keymap_item_set_id(wmKeyMap *keymap, wmKeyMapItem *kmi)
keymap->kmi_id++;
if ((keymap->flag & KEYMAP_USER) == 0) {
kmi->id = keymap->kmi_id;
- } else {
+ }
+ else {
kmi->id = -keymap->kmi_id; // User defined keymap entries have negative ids
}
}
@@ -335,11 +336,11 @@ wmKeyMapItem *WM_keymap_verify_item(wmKeyMap *keymap, const char *idname, int ty
{
wmKeyMapItem *kmi;
- for(kmi= keymap->items.first; kmi; kmi= kmi->next)
- if(strncmp(kmi->idname, idname, OP_MAX_TYPENAME)==0)
+ for (kmi = keymap->items.first; kmi; kmi = kmi->next)
+ if (strncmp(kmi->idname, idname, OP_MAX_TYPENAME) == 0)
break;
- if(kmi==NULL) {
- kmi= MEM_callocN(sizeof(wmKeyMapItem), "keymap entry");
+ if (kmi == NULL) {
+ kmi = MEM_callocN(sizeof(wmKeyMapItem), "keymap entry");
BLI_addtail(&keymap->items, kmi);
BLI_strncpy(kmi->idname, idname, OP_MAX_TYPENAME);
@@ -355,7 +356,7 @@ wmKeyMapItem *WM_keymap_verify_item(wmKeyMap *keymap, const char *idname, int ty
/* always add item */
wmKeyMapItem *WM_keymap_add_item(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier)
{
- wmKeyMapItem *kmi= MEM_callocN(sizeof(wmKeyMapItem), "keymap entry");
+ wmKeyMapItem *kmi = MEM_callocN(sizeof(wmKeyMapItem), "keymap entry");
BLI_addtail(&keymap->items, kmi);
BLI_strncpy(kmi->idname, idname, OP_MAX_TYPENAME);
@@ -373,15 +374,15 @@ wmKeyMapItem *WM_keymap_add_item(wmKeyMap *keymap, const char *idname, int type,
/* menu wrapper for WM_keymap_add_item */
wmKeyMapItem *WM_keymap_add_menu(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier)
{
- wmKeyMapItem *kmi= WM_keymap_add_item(keymap, "WM_OT_call_menu", type, val, modifier, keymodifier);
+ wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_call_menu", type, val, modifier, keymodifier);
RNA_string_set(kmi->ptr, "name", idname);
return kmi;
}
void WM_keymap_remove_item(wmKeyMap *keymap, wmKeyMapItem *kmi)
{
- if(BLI_findindex(&keymap->items, kmi) != -1) {
- if(kmi->ptr) {
+ if (BLI_findindex(&keymap->items, kmi) != -1) {
+ if (kmi->ptr) {
WM_operator_properties_free(kmi->ptr);
MEM_freeN(kmi->ptr);
}
@@ -401,7 +402,7 @@ static void wm_keymap_addon_add(wmKeyMap *keymap, wmKeyMap *addonmap)
{
wmKeyMapItem *kmi, *kmin;
- for(kmi=addonmap->items.first; kmi; kmi=kmi->next) {
+ for (kmi = addonmap->items.first; kmi; kmi = kmi->next) {
kmin = wm_keymap_item_copy(kmi);
keymap_item_set_id(keymap, kmin);
BLI_addhead(&keymap->items, kmin);
@@ -412,8 +413,8 @@ static wmKeyMapItem *wm_keymap_find_item_equals(wmKeyMap *km, wmKeyMapItem *need
{
wmKeyMapItem *kmi;
- for(kmi=km->items.first; kmi; kmi=kmi->next)
- if(wm_keymap_item_equals(kmi, needle))
+ for (kmi = km->items.first; kmi; kmi = kmi->next)
+ if (wm_keymap_item_equals(kmi, needle))
return kmi;
return NULL;
@@ -423,8 +424,8 @@ static wmKeyMapItem *wm_keymap_find_item_equals_result(wmKeyMap *km, wmKeyMapIte
{
wmKeyMapItem *kmi;
- for(kmi=km->items.first; kmi; kmi=kmi->next)
- if(wm_keymap_item_equals_result(kmi, needle))
+ for (kmi = km->items.first; kmi; kmi = kmi->next)
+ if (wm_keymap_item_equals_result(kmi, needle))
return kmi;
return NULL;
@@ -435,16 +436,16 @@ static void wm_keymap_diff(wmKeyMap *diff_km, wmKeyMap *from_km, wmKeyMap *to_km
wmKeyMapItem *kmi, *to_kmi, *orig_kmi;
wmKeyMapDiffItem *kmdi;
- for(kmi=from_km->items.first; kmi; kmi=kmi->next) {
+ for (kmi = from_km->items.first; kmi; kmi = kmi->next) {
to_kmi = WM_keymap_item_find_id(to_km, kmi->id);
- if(!to_kmi) {
+ if (!to_kmi) {
/* remove item */
kmdi = MEM_callocN(sizeof(wmKeyMapDiffItem), "wmKeyMapDiffItem");
kmdi->remove_item = wm_keymap_item_copy(kmi);
BLI_addtail(&diff_km->diff_items, kmdi);
}
- else if(to_kmi && !wm_keymap_item_equals(kmi, to_kmi)) {
+ else if (to_kmi && !wm_keymap_item_equals(kmi, to_kmi)) {
/* replace item */
kmdi = MEM_callocN(sizeof(wmKeyMapDiffItem), "wmKeyMapDiffItem");
kmdi->remove_item = wm_keymap_item_copy(kmi);
@@ -453,21 +454,21 @@ static void wm_keymap_diff(wmKeyMap *diff_km, wmKeyMap *from_km, wmKeyMap *to_km
}
/* sync expanded flag back to original so we don't loose it on repatch */
- if(to_kmi) {
+ if (to_kmi) {
orig_kmi = WM_keymap_item_find_id(orig_km, kmi->id);
- if(!orig_kmi)
+ if (!orig_kmi)
orig_kmi = wm_keymap_find_item_equals(addon_km, kmi);
- if(orig_kmi) {
+ if (orig_kmi) {
orig_kmi->flag &= ~KMI_EXPANDED;
orig_kmi->flag |= (to_kmi->flag & KMI_EXPANDED);
}
}
}
- for(kmi=to_km->items.first; kmi; kmi=kmi->next) {
- if(kmi->id < 0) {
+ for (kmi = to_km->items.first; kmi; kmi = kmi->next) {
+ if (kmi->id < 0) {
/* add item */
kmdi = MEM_callocN(sizeof(wmKeyMapDiffItem), "wmKeyMapDiffItem");
kmdi->add_item = wm_keymap_item_copy(kmi);
@@ -481,23 +482,23 @@ static void wm_keymap_patch(wmKeyMap *km, wmKeyMap *diff_km)
wmKeyMapDiffItem *kmdi;
wmKeyMapItem *kmi_remove, *kmi_add;
- for(kmdi=diff_km->diff_items.first; kmdi; kmdi=kmdi->next) {
+ for (kmdi = diff_km->diff_items.first; kmdi; kmdi = kmdi->next) {
/* find item to remove */
kmi_remove = NULL;
- if(kmdi->remove_item) {
+ if (kmdi->remove_item) {
kmi_remove = wm_keymap_find_item_equals(km, kmdi->remove_item);
- if(!kmi_remove)
+ if (!kmi_remove)
kmi_remove = wm_keymap_find_item_equals_result(km, kmdi->remove_item);
}
/* add item */
- if(kmdi->add_item) {
+ if (kmdi->add_item) {
/* only if nothing to remove or item to remove found */
- if(!kmdi->remove_item || kmi_remove) {
+ if (!kmdi->remove_item || kmi_remove) {
kmi_add = wm_keymap_item_copy(kmdi->add_item);
kmi_add->flag |= KMI_USER_MODIFIED;
- if(kmi_remove) {
+ if (kmi_remove) {
kmi_add->flag &= ~KMI_EXPANDED;
kmi_add->flag |= (kmi_remove->flag & KMI_EXPANDED);
kmi_add->id = kmi_remove->id;
@@ -511,7 +512,7 @@ static void wm_keymap_patch(wmKeyMap *km, wmKeyMap *diff_km)
}
/* remove item */
- if(kmi_remove) {
+ if (kmi_remove) {
wm_keymap_item_free(kmi_remove);
BLI_freelinkN(&km->items, kmi_remove);
}
@@ -525,27 +526,27 @@ static wmKeyMap *wm_keymap_patch_update(ListBase *lb, wmKeyMap *defaultmap, wmKe
/* remove previous keymap in list, we will replace it */
km = WM_keymap_list_find(lb, defaultmap->idname, defaultmap->spaceid, defaultmap->regionid);
- if(km) {
- expanded = (km->flag & (KEYMAP_EXPANDED|KEYMAP_CHILDREN_EXPANDED));
+ if (km) {
+ expanded = (km->flag & (KEYMAP_EXPANDED | KEYMAP_CHILDREN_EXPANDED));
WM_keymap_free(km);
BLI_freelinkN(lb, km);
}
/* copy new keymap from an existing one */
- if(usermap && !(usermap->flag & KEYMAP_DIFF)) {
+ 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);
/* try to find corresponding id's for items */
- for(kmi=km->items.first; kmi; kmi=kmi->next) {
+ for (kmi = km->items.first; kmi; kmi = kmi->next) {
orig_kmi = wm_keymap_find_item_equals(defaultmap, kmi);
- if(!orig_kmi)
+ if (!orig_kmi)
orig_kmi = wm_keymap_find_item_equals_result(defaultmap, kmi);
- if(orig_kmi)
+ if (orig_kmi)
kmi->id = orig_kmi->id;
else
kmi->id = -(km->kmi_id++);
@@ -557,16 +558,16 @@ static wmKeyMap *wm_keymap_patch_update(ListBase *lb, wmKeyMap *defaultmap, wmKe
km = wm_keymap_copy(defaultmap);
/* add addon keymap items */
- if(addonmap)
+ if (addonmap)
wm_keymap_addon_add(km, addonmap);
/* tag as being user edited */
- if(usermap)
+ if (usermap)
km->flag |= KEYMAP_USER_MODIFIED;
- km->flag |= KEYMAP_USER|expanded;
+ km->flag |= KEYMAP_USER | expanded;
/* apply user changes of diff keymap */
- if(usermap && (usermap->flag & KEYMAP_DIFF))
+ if (usermap && (usermap->flag & KEYMAP_DIFF))
wm_keymap_patch(km, usermap);
/* add to list */
@@ -582,27 +583,27 @@ static void wm_keymap_diff_update(ListBase *lb, wmKeyMap *defaultmap, wmKeyMap *
/* create temporary default + addon keymap for diff */
origmap = defaultmap;
- if(addonmap) {
+ if (addonmap) {
defaultmap = wm_keymap_copy(defaultmap);
wm_keymap_addon_add(defaultmap, addonmap);
}
/* remove previous diff keymap in list, we will replace it */
prevmap = WM_keymap_list_find(lb, km->idname, km->spaceid, km->regionid);
- if(prevmap) {
+ if (prevmap) {
WM_keymap_free(prevmap);
BLI_freelinkN(lb, prevmap);
}
/* create diff keymap */
- diffmap= wm_keymap_new(km->idname, km->spaceid, km->regionid);
+ diffmap = wm_keymap_new(km->idname, km->spaceid, km->regionid);
diffmap->flag |= KEYMAP_DIFF;
- if(defaultmap->flag & KEYMAP_MODAL)
+ if (defaultmap->flag & KEYMAP_MODAL)
diffmap->flag |= KEYMAP_MODAL;
wm_keymap_diff(diffmap, defaultmap, km, origmap, addonmap);
/* add to list if not empty */
- if(diffmap->diff_items.first) {
+ if (diffmap->diff_items.first) {
BLI_addtail(lb, diffmap);
}
else {
@@ -611,7 +612,7 @@ static void wm_keymap_diff_update(ListBase *lb, wmKeyMap *defaultmap, wmKeyMap *
}
/* free temporary default map */
- if(addonmap) {
+ if (addonmap) {
WM_keymap_free(defaultmap);
MEM_freeN(defaultmap);
}
@@ -620,16 +621,16 @@ 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)
{
wmKeyMap *km;
- for(km= lb->first; km; km= km->next)
- if(km->spaceid==spaceid && km->regionid==regionid)
- if(0==strncmp(idname, km->idname, KMAP_MAX_NAME))
+ for (km = lb->first; km; km = km->next)
+ if (km->spaceid == spaceid && km->regionid == regionid)
+ if (0 == strncmp(idname, km->idname, KMAP_MAX_NAME))
return km;
return NULL;
@@ -637,10 +638,10 @@ wmKeyMap *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int
wmKeyMap *WM_keymap_find(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
{
- wmKeyMap *km= WM_keymap_list_find(&keyconf->keymaps, idname, spaceid, regionid);
+ wmKeyMap *km = WM_keymap_list_find(&keyconf->keymaps, idname, spaceid, regionid);
- if(km==NULL) {
- km= wm_keymap_new(idname, spaceid, regionid);
+ if (km == NULL) {
+ km = wm_keymap_new(idname, spaceid, regionid);
BLI_addtail(&keyconf->keymaps, km);
WM_keyconfig_update_tag(km, NULL);
@@ -651,7 +652,7 @@ wmKeyMap *WM_keymap_find(wmKeyConfig *keyconf, const char *idname, int spaceid,
wmKeyMap *WM_keymap_find_all(const bContext *C, const char *idname, int spaceid, int regionid)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
return WM_keymap_list_find(&wm->userconf->keymaps, idname, spaceid, regionid);
}
@@ -662,16 +663,16 @@ wmKeyMap *WM_keymap_find_all(const bContext *C, const char *idname, int spaceid,
wmKeyMap *WM_modalkeymap_add(wmKeyConfig *keyconf, const char *idname, EnumPropertyItem *items)
{
- wmKeyMap *km= WM_keymap_find(keyconf, idname, 0, 0);
+ wmKeyMap *km = WM_keymap_find(keyconf, idname, 0, 0);
km->flag |= KEYMAP_MODAL;
- km->modal_items= items;
+ km->modal_items = items;
- if(!items) {
+ if (!items) {
/* init modal items from default config */
wmWindowManager *wm = G.main->wm.first;
- wmKeyMap *defaultkm= WM_keymap_list_find(&wm->defaultconf->keymaps, km->idname, 0, 0);
+ wmKeyMap *defaultkm = WM_keymap_list_find(&wm->defaultconf->keymaps, km->idname, 0, 0);
- if(defaultkm) {
+ if (defaultkm) {
km->modal_items = defaultkm->modal_items;
km->poll = defaultkm->poll;
}
@@ -684,9 +685,9 @@ wmKeyMap *WM_modalkeymap_get(wmKeyConfig *keyconf, const char *idname)
{
wmKeyMap *km;
- for(km= keyconf->keymaps.first; km; km= km->next)
- if(km->flag & KEYMAP_MODAL)
- if(0==strncmp(idname, km->idname, KMAP_MAX_NAME))
+ for (km = keyconf->keymaps.first; km; km = km->next)
+ if (km->flag & KEYMAP_MODAL)
+ if (0 == strncmp(idname, km->idname, KMAP_MAX_NAME))
break;
return km;
@@ -695,10 +696,10 @@ wmKeyMap *WM_modalkeymap_get(wmKeyConfig *keyconf, const char *idname)
wmKeyMapItem *WM_modalkeymap_add_item(wmKeyMap *km, int type, int val, int modifier, int keymodifier, int value)
{
- wmKeyMapItem *kmi= MEM_callocN(sizeof(wmKeyMapItem), "keymap entry");
+ wmKeyMapItem *kmi = MEM_callocN(sizeof(wmKeyMapItem), "keymap entry");
BLI_addtail(&km->items, kmi);
- kmi->propvalue= value;
+ kmi->propvalue = value;
keymap_event_set(kmi, type, val, modifier, keymodifier);
@@ -711,10 +712,10 @@ wmKeyMapItem *WM_modalkeymap_add_item(wmKeyMap *km, int type, int val, int modif
void WM_modalkeymap_assign(wmKeyMap *km, const char *opname)
{
- wmOperatorType *ot= WM_operatortype_find(opname, 0);
+ wmOperatorType *ot = WM_operatortype_find(opname, 0);
- if(ot)
- ot->modalkeymap= km;
+ if (ot)
+ ot->modalkeymap = km;
else
printf("error: modalkeymap_assign, unknown operator %s\n", opname);
}
@@ -723,8 +724,8 @@ void WM_modalkeymap_assign(wmKeyMap *km, const char *opname)
const char *WM_key_event_string(short type)
{
- const char *name= NULL;
- if(RNA_enum_name(event_type_items, (int)type, &name))
+ const char *name = NULL;
+ if (RNA_enum_name(event_type_items, (int)type, &name))
return name;
return "";
@@ -734,29 +735,30 @@ char *WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, int len)
{
char buf[128];
- buf[0]= 0;
+ buf[0] = 0;
if (kmi->shift == KM_ANY &&
- kmi->ctrl == KM_ANY &&
- kmi->alt == KM_ANY &&
- kmi->oskey == KM_ANY) {
+ kmi->ctrl == KM_ANY &&
+ kmi->alt == KM_ANY &&
+ kmi->oskey == KM_ANY) {
strcat(buf, "Any ");
- } else {
- if(kmi->shift)
+ }
+ else {
+ if (kmi->shift)
strcat(buf, "Shift ");
- if(kmi->ctrl)
+ if (kmi->ctrl)
strcat(buf, "Ctrl ");
- if(kmi->alt)
+ if (kmi->alt)
strcat(buf, "Alt ");
- if(kmi->oskey)
+ if (kmi->oskey)
strcat(buf, "Cmd ");
}
- if(kmi->keymodifier) {
+ if (kmi->keymodifier) {
strcat(buf, WM_key_event_string(kmi->keymodifier));
strcat(buf, " ");
}
@@ -768,34 +770,34 @@ char *WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, int len)
}
static wmKeyMapItem *wm_keymap_item_find_handlers(
- const bContext *C, ListBase *handlers, const char *opname, int UNUSED(opcontext),
- IDProperty *properties, int compare_props, int hotkey, wmKeyMap **keymap_r)
+ const bContext *C, ListBase *handlers, const char *opname, int UNUSED(opcontext),
+ IDProperty *properties, int compare_props, int hotkey, wmKeyMap **keymap_r)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
wmEventHandler *handler;
wmKeyMap *keymap;
wmKeyMapItem *kmi;
/* find keymap item in handlers */
- for(handler=handlers->first; handler; handler=handler->next) {
- keymap= WM_keymap_active(wm, handler->keymap);
+ for (handler = handlers->first; handler; handler = handler->next) {
+ keymap = WM_keymap_active(wm, handler->keymap);
- if(keymap && (!keymap->poll || keymap->poll((bContext*)C))) {
- for(kmi=keymap->items.first; kmi; kmi=kmi->next) {
+ if (keymap && (!keymap->poll || keymap->poll((bContext *)C))) {
+ for (kmi = keymap->items.first; kmi; kmi = kmi->next) {
- if(strcmp(kmi->idname, opname) == 0 && WM_key_event_string(kmi->type)[0]) {
+ if (strcmp(kmi->idname, opname) == 0 && WM_key_event_string(kmi->type)[0]) {
if (hotkey)
if (!ISHOTKEY(kmi->type))
continue;
- if(compare_props) {
- if(kmi->ptr && IDP_EqualsProperties(properties, kmi->ptr->data)) {
- if(keymap_r) *keymap_r= keymap;
+ if (compare_props) {
+ if (kmi->ptr && IDP_EqualsProperties(properties, kmi->ptr->data)) {
+ if (keymap_r) *keymap_r = keymap;
return kmi;
}
}
else {
- if(keymap_r) *keymap_r= keymap;
+ if (keymap_r) *keymap_r = keymap;
return kmi;
}
}
@@ -804,54 +806,54 @@ static wmKeyMapItem *wm_keymap_item_find_handlers(
}
/* ensure un-initialized keymap is never used */
- if(keymap_r) *keymap_r= NULL;
+ if (keymap_r) *keymap_r = NULL;
return NULL;
}
static wmKeyMapItem *wm_keymap_item_find_props(
- const bContext *C, const char *opname, int opcontext,
- IDProperty *properties, int compare_props, int hotkey, wmKeyMap **keymap_r)
+ const bContext *C, const char *opname, int opcontext,
+ IDProperty *properties, int compare_props, int hotkey, wmKeyMap **keymap_r)
{
- wmWindow *win= CTX_wm_window(C);
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= CTX_wm_region(C);
- wmKeyMapItem *found= NULL;
+ wmWindow *win = CTX_wm_window(C);
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = CTX_wm_region(C);
+ wmKeyMapItem *found = NULL;
/* look into multiple handler lists to find the item */
- if(win)
- found= wm_keymap_item_find_handlers(C, &win->handlers, opname, opcontext, properties, compare_props, hotkey, keymap_r);
+ if (win)
+ found = wm_keymap_item_find_handlers(C, &win->handlers, opname, opcontext, properties, compare_props, hotkey, keymap_r);
- if(sa && found==NULL)
- found= wm_keymap_item_find_handlers(C, &sa->handlers, opname, opcontext, properties, compare_props, hotkey, keymap_r);
+ if (sa && found == NULL)
+ found = wm_keymap_item_find_handlers(C, &sa->handlers, opname, opcontext, properties, compare_props, hotkey, keymap_r);
- if(found==NULL) {
- if(ELEM(opcontext, WM_OP_EXEC_REGION_WIN, WM_OP_INVOKE_REGION_WIN)) {
- if(sa) {
+ if (found == NULL) {
+ if (ELEM(opcontext, WM_OP_EXEC_REGION_WIN, WM_OP_INVOKE_REGION_WIN)) {
+ if (sa) {
if (!(ar && ar->regiontype == RGN_TYPE_WINDOW))
- ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
- if(ar)
- found= wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, compare_props, hotkey, keymap_r);
+ if (ar)
+ found = wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, compare_props, hotkey, keymap_r);
}
}
- else if(ELEM(opcontext, WM_OP_EXEC_REGION_CHANNELS, WM_OP_INVOKE_REGION_CHANNELS)) {
+ else if (ELEM(opcontext, WM_OP_EXEC_REGION_CHANNELS, WM_OP_INVOKE_REGION_CHANNELS)) {
if (!(ar && ar->regiontype == RGN_TYPE_CHANNELS))
- ar= BKE_area_find_region_type(sa, RGN_TYPE_CHANNELS);
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_CHANNELS);
- if(ar)
- found= wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, compare_props, hotkey, keymap_r);
+ if (ar)
+ found = wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, compare_props, hotkey, keymap_r);
}
- else if(ELEM(opcontext, WM_OP_EXEC_REGION_PREVIEW, WM_OP_INVOKE_REGION_PREVIEW)) {
+ else if (ELEM(opcontext, WM_OP_EXEC_REGION_PREVIEW, WM_OP_INVOKE_REGION_PREVIEW)) {
if (!(ar && ar->regiontype == RGN_TYPE_PREVIEW))
- ar= BKE_area_find_region_type(sa, RGN_TYPE_PREVIEW);
+ ar = BKE_area_find_region_type(sa, RGN_TYPE_PREVIEW);
- if(ar)
- found= wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, compare_props, hotkey, keymap_r);
+ if (ar)
+ found = wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, compare_props, hotkey, keymap_r);
}
else {
- if(ar)
- found= wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, compare_props, hotkey, keymap_r);
+ if (ar)
+ found = wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, compare_props, hotkey, keymap_r);
}
}
@@ -859,24 +861,24 @@ static wmKeyMapItem *wm_keymap_item_find_props(
}
static wmKeyMapItem *wm_keymap_item_find(
- const bContext *C, const char *opname, int opcontext,
- IDProperty *properties, const short hotkey, const short sloppy, wmKeyMap **keymap_r)
+ const bContext *C, const char *opname, int opcontext,
+ IDProperty *properties, const short hotkey, const short sloppy, wmKeyMap **keymap_r)
{
- wmKeyMapItem *found= wm_keymap_item_find_props(C, opname, opcontext, properties, 1, hotkey, keymap_r);
+ wmKeyMapItem *found = wm_keymap_item_find_props(C, opname, opcontext, properties, 1, hotkey, keymap_r);
- if(!found && sloppy)
- found= wm_keymap_item_find_props(C, opname, opcontext, NULL, 0, hotkey, keymap_r);
+ if (!found && sloppy)
+ found = wm_keymap_item_find_props(C, opname, opcontext, NULL, 0, hotkey, keymap_r);
return found;
}
char *WM_key_event_operator_string(
- const bContext *C, const char *opname, int opcontext,
- IDProperty *properties, const short sloppy, char *str, int len)
+ const bContext *C, const char *opname, int opcontext,
+ IDProperty *properties, const short sloppy, char *str, int len)
{
- wmKeyMapItem *kmi= wm_keymap_item_find(C, opname, opcontext, properties, 0, sloppy, NULL);
+ wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, properties, 0, sloppy, NULL);
- if(kmi) {
+ if (kmi) {
WM_keymap_item_to_string(kmi, str, len);
return str;
}
@@ -885,18 +887,18 @@ char *WM_key_event_operator_string(
}
int WM_key_event_operator_id(
- const bContext *C, const char *opname, int opcontext,
- IDProperty *properties, int hotkey, wmKeyMap **keymap_r)
+ const bContext *C, const char *opname, int opcontext,
+ IDProperty *properties, int hotkey, wmKeyMap **keymap_r)
{
- wmKeyMapItem *kmi= wm_keymap_item_find(C, opname, opcontext, properties, hotkey, TRUE, keymap_r);
+ wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, properties, hotkey, TRUE, keymap_r);
- if(kmi)
+ if (kmi)
return kmi->id;
else
return 0;
}
-int WM_keymap_item_compare(wmKeyMapItem *k1, wmKeyMapItem *k2)
+int WM_keymap_item_compare(wmKeyMapItem *k1, wmKeyMapItem *k2)
{
int k1type, k2type;
@@ -907,10 +909,10 @@ int WM_keymap_item_compare(wmKeyMapItem *k1, wmKeyMapItem *k2)
k1type = WM_userdef_event_map(k1->type);
k2type = WM_userdef_event_map(k2->type);
- if(k1type != KM_ANY && k2type != KM_ANY && k1type != k2type)
+ if (k1type != KM_ANY && k2type != KM_ANY && k1type != k2type)
return 0;
- if(k1->val != KM_ANY && k2->val != KM_ANY) {
+ if (k1->val != KM_ANY && k2->val != KM_ANY) {
/* take click, press, release conflict into account */
if (k1->val == KM_CLICK && ELEM3(k2->val, KM_PRESS, KM_RELEASE, KM_CLICK) == 0)
return 0;
@@ -920,19 +922,19 @@ int WM_keymap_item_compare(wmKeyMapItem *k1, wmKeyMapItem *k2)
return 0;
}
- if(k1->shift != KM_ANY && k2->shift != KM_ANY && k1->shift != k2->shift)
+ if (k1->shift != KM_ANY && k2->shift != KM_ANY && k1->shift != k2->shift)
return 0;
- if(k1->ctrl != KM_ANY && k2->ctrl != KM_ANY && k1->ctrl != k2->ctrl)
+ if (k1->ctrl != KM_ANY && k2->ctrl != KM_ANY && k1->ctrl != k2->ctrl)
return 0;
- if(k1->alt != KM_ANY && k2->alt != KM_ANY && k1->alt != k2->alt)
+ if (k1->alt != KM_ANY && k2->alt != KM_ANY && k1->alt != k2->alt)
return 0;
- if(k1->oskey != KM_ANY && k2->oskey != KM_ANY && k1->oskey != k2->oskey)
+ if (k1->oskey != KM_ANY && k2->oskey != KM_ANY && k1->oskey != k2->oskey)
return 0;
- if(k1->keymodifier != k2->keymodifier)
+ if (k1->keymodifier != k2->keymodifier)
return 0;
return 1;
@@ -948,11 +950,11 @@ static int WM_KEYMAP_UPDATE = 0;
void WM_keyconfig_update_tag(wmKeyMap *km, wmKeyMapItem *kmi)
{
/* quick tag to do delayed keymap updates */
- WM_KEYMAP_UPDATE= 1;
+ WM_KEYMAP_UPDATE = 1;
- if(km)
+ if (km)
km->flag |= KEYMAP_UPDATE;
- if(kmi)
+ if (kmi)
kmi->flag |= KMI_UPDATE;
}
@@ -961,11 +963,11 @@ static int wm_keymap_test_and_clear_update(wmKeyMap *km)
wmKeyMapItem *kmi;
int update;
- update= (km->flag & KEYMAP_UPDATE);
+ update = (km->flag & KEYMAP_UPDATE);
km->flag &= ~KEYMAP_UPDATE;
- for(kmi=km->items.first; kmi; kmi=kmi->next) {
- update= update || (kmi->flag & KMI_UPDATE);
+ for (kmi = km->items.first; kmi; kmi = kmi->next) {
+ update = update || (kmi->flag & KMI_UPDATE);
kmi->flag &= ~KMI_UPDATE;
}
@@ -974,12 +976,12 @@ static int wm_keymap_test_and_clear_update(wmKeyMap *km)
static wmKeyMap *wm_keymap_preset(wmWindowManager *wm, wmKeyMap *km)
{
- wmKeyConfig *keyconf= WM_keyconfig_active(wm);
+ wmKeyConfig *keyconf = WM_keyconfig_active(wm);
wmKeyMap *keymap;
- keymap= WM_keymap_list_find(&keyconf->keymaps, km->idname, km->spaceid, km->regionid);
- if(!keymap)
- keymap= WM_keymap_list_find(&wm->defaultconf->keymaps, km->idname, km->spaceid, km->regionid);
+ keymap = WM_keymap_list_find(&keyconf->keymaps, km->idname, km->spaceid, km->regionid);
+ if (!keymap)
+ keymap = WM_keymap_list_find(&wm->defaultconf->keymaps, km->idname, km->spaceid, km->regionid);
return keymap;
}
@@ -991,62 +993,62 @@ void WM_keyconfig_update(wmWindowManager *wm)
wmKeyMapDiffItem *kmdi;
int compat_update = 0;
- if(G.background)
+ if (G.background)
return;
- if(!WM_KEYMAP_UPDATE)
+ if (!WM_KEYMAP_UPDATE)
return;
/* update operator properties for non-modal user keymaps */
- for(km=U.user_keymaps.first; km; km=km->next) {
- if((km->flag & KEYMAP_MODAL) == 0) {
- for(kmdi=km->diff_items.first; kmdi; kmdi=kmdi->next) {
- if(kmdi->add_item)
+ for (km = U.user_keymaps.first; km; km = km->next) {
+ if ((km->flag & KEYMAP_MODAL) == 0) {
+ for (kmdi = km->diff_items.first; kmdi; kmdi = kmdi->next) {
+ if (kmdi->add_item)
wm_keymap_item_properties_set(kmdi->add_item);
- if(kmdi->remove_item)
+ if (kmdi->remove_item)
wm_keymap_item_properties_set(kmdi->remove_item);
}
- for(kmi=km->items.first; kmi; kmi=kmi->next)
+ for (kmi = km->items.first; kmi; kmi = kmi->next)
wm_keymap_item_properties_set(kmi);
}
}
/* update U.user_keymaps with user key configuration changes */
- for(km=wm->userconf->keymaps.first; km; km=km->next) {
+ for (km = wm->userconf->keymaps.first; km; km = km->next) {
/* only diff if the user keymap was modified */
- if(wm_keymap_test_and_clear_update(km)) {
+ if (wm_keymap_test_and_clear_update(km)) {
/* find keymaps */
- defaultmap= wm_keymap_preset(wm, km);
- addonmap= WM_keymap_list_find(&wm->addonconf->keymaps, km->idname, km->spaceid, km->regionid);
+ defaultmap = wm_keymap_preset(wm, km);
+ addonmap = WM_keymap_list_find(&wm->addonconf->keymaps, km->idname, km->spaceid, km->regionid);
/* diff */
- if(defaultmap)
+ if (defaultmap)
wm_keymap_diff_update(&U.user_keymaps, defaultmap, addonmap, km);
}
}
/* create user key configuration from preset + addon + user preferences */
- for(km=wm->defaultconf->keymaps.first; km; km=km->next) {
+ for (km = wm->defaultconf->keymaps.first; km; km = km->next) {
/* find keymaps */
- defaultmap= wm_keymap_preset(wm, km);
- addonmap= WM_keymap_list_find(&wm->addonconf->keymaps, km->idname, km->spaceid, km->regionid);
- usermap= WM_keymap_list_find(&U.user_keymaps, km->idname, km->spaceid, km->regionid);
+ defaultmap = wm_keymap_preset(wm, km);
+ addonmap = WM_keymap_list_find(&wm->addonconf->keymaps, km->idname, km->spaceid, km->regionid);
+ usermap = WM_keymap_list_find(&U.user_keymaps, km->idname, km->spaceid, km->regionid);
/* add */
- kmn= wm_keymap_patch_update(&wm->userconf->keymaps, defaultmap, addonmap, usermap);
+ kmn = wm_keymap_patch_update(&wm->userconf->keymaps, defaultmap, addonmap, usermap);
- if(kmn) {
- kmn->modal_items= km->modal_items;
- kmn->poll= km->poll;
+ if (kmn) {
+ kmn->modal_items = km->modal_items;
+ kmn->poll = km->poll;
}
/* in case of old non-diff keymaps, force extra update to create diffs */
compat_update = compat_update || (usermap && !(usermap->flag & KEYMAP_DIFF));
}
- WM_KEYMAP_UPDATE= 0;
+ WM_KEYMAP_UPDATE = 0;
- if(compat_update) {
+ if (compat_update) {
WM_keyconfig_update_tag(NULL, NULL);
WM_keyconfig_update(wm);
}
@@ -1061,13 +1063,13 @@ wmKeyMap *WM_keymap_active(wmWindowManager *wm, wmKeyMap *keymap)
{
wmKeyMap *km;
- if(!keymap)
+ if (!keymap)
return NULL;
/* first user defined keymaps */
- km= WM_keymap_list_find(&wm->userconf->keymaps, keymap->idname, keymap->spaceid, keymap->regionid);
+ km = WM_keymap_list_find(&wm->userconf->keymaps, keymap->idname, keymap->spaceid, keymap->regionid);
- if(km)
+ if (km)
return km;
return keymap;
@@ -1082,14 +1084,14 @@ void WM_keymap_restore_item_to_default(bContext *C, wmKeyMap *keymap, wmKeyMapIt
wmKeyMap *defaultmap, *addonmap;
wmKeyMapItem *orig;
- if(!keymap)
+ if (!keymap)
return;
/* construct default keymap from preset + addons */
- defaultmap= wm_keymap_preset(wm, keymap);
- addonmap= WM_keymap_list_find(&wm->addonconf->keymaps, keymap->idname, keymap->spaceid, keymap->regionid);
+ defaultmap = wm_keymap_preset(wm, keymap);
+ addonmap = WM_keymap_list_find(&wm->addonconf->keymaps, keymap->idname, keymap->spaceid, keymap->regionid);
- if(addonmap) {
+ if (addonmap) {
defaultmap = wm_keymap_copy(defaultmap);
wm_keymap_addon_add(defaultmap, addonmap);
}
@@ -1097,22 +1099,22 @@ void WM_keymap_restore_item_to_default(bContext *C, wmKeyMap *keymap, wmKeyMapIt
/* find original item */
orig = WM_keymap_item_find_id(defaultmap, kmi->id);
- if(orig) {
+ if (orig) {
/* restore to original */
- if(strcmp(orig->idname, kmi->idname) != 0) {
+ if (strcmp(orig->idname, kmi->idname) != 0) {
BLI_strncpy(kmi->idname, orig->idname, sizeof(kmi->idname));
WM_keymap_properties_reset(kmi, NULL);
}
if (orig->properties) {
- if(kmi->properties) {
+ if (kmi->properties) {
IDP_FreeProperty(kmi->properties);
MEM_freeN(kmi->properties);
- kmi->properties= NULL;
+ kmi->properties = NULL;
}
- kmi->properties= IDP_CopyProperty(orig->properties);
- kmi->ptr->data= kmi->properties;
+ kmi->properties = IDP_CopyProperty(orig->properties);
+ kmi->ptr->data = kmi->properties;
}
kmi->propvalue = orig->propvalue;
@@ -1129,7 +1131,7 @@ void WM_keymap_restore_item_to_default(bContext *C, wmKeyMap *keymap, wmKeyMapIt
}
/* free temporary keymap */
- if(addonmap) {
+ if (addonmap) {
WM_keymap_free(defaultmap);
MEM_freeN(defaultmap);
}
@@ -1141,9 +1143,9 @@ void WM_keymap_restore_to_default(wmKeyMap *keymap, bContext *C)
wmKeyMap *usermap;
/* remove keymap from U.user_keymaps and update */
- usermap= WM_keymap_list_find(&U.user_keymaps, keymap->idname, keymap->spaceid, keymap->regionid);
+ usermap = WM_keymap_list_find(&U.user_keymaps, keymap->idname, keymap->spaceid, keymap->regionid);
- if(usermap) {
+ if (usermap) {
WM_keymap_free(usermap);
BLI_freelinkN(&U.user_keymaps, usermap);
@@ -1156,7 +1158,7 @@ wmKeyMapItem *WM_keymap_item_find_id(wmKeyMap *keymap, int id)
{
wmKeyMapItem *kmi;
- for (kmi=keymap->items.first; kmi; kmi=kmi->next) {
+ for (kmi = keymap->items.first; kmi; kmi = kmi->next) {
if (kmi->id == id) {
return kmi;
}
@@ -1169,7 +1171,7 @@ wmKeyMapItem *WM_keymap_item_find_id(wmKeyMap *keymap, int id)
/* Needs to be kept up to date with Keymap and Operator naming */
wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
{
- wmKeyMap *km=NULL;
+ wmKeyMap *km = NULL;
SpaceLink *sl = CTX_wm_space_data(C);
/* Window */
@@ -1204,7 +1206,7 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
km = WM_keymap_find_all(C, "Mesh", 0, 0);
/* some mesh operators are active in object mode too, like add-prim */
- if(km && km->poll && km->poll((bContext *)C)==0) {
+ if (km && km->poll && km->poll((bContext *)C) == 0) {
km = WM_keymap_find_all(C, "Object Mode", 0, 0);
}
}
@@ -1212,7 +1214,7 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
km = WM_keymap_find_all(C, "Curve", 0, 0);
/* some curve operators are active in object mode too, like add-prim */
- if(km && km->poll && km->poll((bContext *)C)==0) {
+ if (km && km->poll && km->poll((bContext *)C) == 0) {
km = WM_keymap_find_all(C, "Object Mode", 0, 0);
}
}
@@ -1223,7 +1225,7 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
km = WM_keymap_find_all(C, "Pose", 0, 0);
}
else if (strstr(opname, "SCULPT_OT")) {
- switch(CTX_data_mode_enum(C)) {
+ switch (CTX_data_mode_enum(C)) {
case OB_MODE_SCULPT:
km = WM_keymap_find_all(C, "Sculpt", 0, 0);
break;
@@ -1236,7 +1238,7 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
km = WM_keymap_find_all(C, "Metaball", 0, 0);
/* some mball operators are active in object mode too, like add-prim */
- if(km && km->poll && km->poll((bContext *)C)==0) {
+ if (km && km->poll && km->poll((bContext *)C) == 0) {
km = WM_keymap_find_all(C, "Object Mode", 0, 0);
}
}
@@ -1252,7 +1254,7 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
else if (strstr(opname, "PAINT_OT")) {
/* check for relevant mode */
- switch(CTX_data_mode_enum(C)) {
+ switch (CTX_data_mode_enum(C)) {
case OB_MODE_WEIGHT_PAINT:
km = WM_keymap_find_all(C, "Weight Paint", 0, 0);
break;
@@ -1329,7 +1331,7 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
else if (strstr(opname, "TRANSFORM_OT")) {
/* check for relevant editor */
- switch(sl->spacetype) {
+ switch (sl->spacetype) {
case SPACE_VIEW3D:
km = WM_keymap_find_all(C, "3D View", sl->spacetype, 0);
break;
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index a7502dd8c22..123cc60e4fa 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -101,31 +101,31 @@
#include "wm_subwindow.h"
#include "wm_window.h"
-static GHash *global_ops_hash= NULL;
+static GHash *global_ops_hash = NULL;
/* ************ operator API, exported ********** */
wmOperatorType *WM_operatortype_find(const char *idname, int quiet)
{
- if(idname[0]) {
+ if (idname[0]) {
wmOperatorType *ot;
/* needed to support python style names without the _OT_ syntax */
char idname_bl[OP_MAX_TYPENAME];
WM_operator_bl_idname(idname_bl, idname);
- ot= BLI_ghash_lookup(global_ops_hash, idname_bl);
- if(ot) {
+ ot = BLI_ghash_lookup(global_ops_hash, idname_bl);
+ if (ot) {
return ot;
}
- if(!quiet) {
+ if (!quiet) {
printf("search for unknown operator '%s', '%s'\n", idname_bl, idname);
}
}
else {
- if(!quiet) {
+ if (!quiet) {
printf("search for empty operator\n");
}
}
@@ -140,35 +140,38 @@ GHashIterator *WM_operatortype_iter(void)
}
/* all ops in 1 list (for time being... needs evaluation later) */
-void WM_operatortype_append(void (*opfunc)(wmOperatorType*))
+void WM_operatortype_append(void (*opfunc)(wmOperatorType *))
{
wmOperatorType *ot;
- ot= MEM_callocN(sizeof(wmOperatorType), "operatortype");
- ot->srna= RNA_def_struct(&BLENDER_RNA, "", "OperatorProperties");
+ ot = MEM_callocN(sizeof(wmOperatorType), "operatortype");
+ ot->srna = RNA_def_struct(&BLENDER_RNA, "", "OperatorProperties");
+ /* Set the default i18n context now, so that opfunc can redefine it if needed! */
+ RNA_def_struct_translation_context(ot->srna, WM_OPERATOR_DEFAULT_I18NCONTEXT);
opfunc(ot);
- if(ot->name==NULL) {
+ if (ot->name == NULL) {
fprintf(stderr, "ERROR: Operator %s has no name property!\n", ot->idname);
- ot->name= IFACE_("Dummy Name");
+ ot->name = N_("Dummy Name");
}
// XXX All ops should have a description but for now allow them not to.
- RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:IFACE_("(undocumented operator)"));
-
+ RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description : N_("(undocumented operator)"));
RNA_def_struct_identifier(ot->srna, ot->idname);
BLI_ghash_insert(global_ops_hash, (void *)ot->idname, ot);
}
-void WM_operatortype_append_ptr(void (*opfunc)(wmOperatorType*, void*), void *userdata)
+void WM_operatortype_append_ptr(void (*opfunc)(wmOperatorType *, void *), void *userdata)
{
wmOperatorType *ot;
- ot= MEM_callocN(sizeof(wmOperatorType), "operatortype");
- ot->srna= RNA_def_struct(&BLENDER_RNA, "", "OperatorProperties");
+ ot = MEM_callocN(sizeof(wmOperatorType), "operatortype");
+ ot->srna = RNA_def_struct(&BLENDER_RNA, "", "OperatorProperties");
+ /* Set the default i18n context now, so that opfunc can redefine it if needed! */
+ RNA_def_struct_translation_context(ot->srna, WM_OPERATOR_DEFAULT_I18NCONTEXT);
opfunc(ot, userdata);
- RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:IFACE_("(undocumented operator)"));
+ RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description : N_("(undocumented operator)"));
RNA_def_struct_identifier(ot->srna, ot->idname);
BLI_ghash_insert(global_ops_hash, (void *)ot->idname, ot);
@@ -199,7 +202,7 @@ static int wm_macro_end(wmOperator *op, int retval)
}
/* if modal is ending, free custom data */
- if (retval & (OPERATOR_FINISHED|OPERATOR_CANCELLED)) {
+ if (retval & (OPERATOR_FINISHED | OPERATOR_CANCELLED)) {
if (op->customdata) {
MEM_freeN(op->customdata);
op->customdata = NULL;
@@ -213,20 +216,21 @@ static int wm_macro_end(wmOperator *op, int retval)
static int wm_macro_exec(bContext *C, wmOperator *op)
{
wmOperator *opm;
- int retval= OPERATOR_FINISHED;
+ int retval = OPERATOR_FINISHED;
wm_macro_start(op);
- for(opm= op->macro.first; opm; opm= opm->next) {
+ for (opm = op->macro.first; opm; opm = opm->next) {
- if(opm->type->exec) {
- retval= opm->type->exec(C, opm);
+ if (opm->type->exec) {
+ retval = opm->type->exec(C, opm);
OPERATOR_RETVAL_CHECK(retval);
if (retval & OPERATOR_FINISHED) {
MacroData *md = op->customdata;
md->retval = OPERATOR_FINISHED; /* keep in mind that at least one operator finished */
- } else {
+ }
+ else {
break; /* operator didn't finish, end macro */
}
}
@@ -237,14 +241,14 @@ static int wm_macro_exec(bContext *C, wmOperator *op)
static int wm_macro_invoke_internal(bContext *C, wmOperator *op, wmEvent *event, wmOperator *opm)
{
- int retval= OPERATOR_FINISHED;
+ int retval = OPERATOR_FINISHED;
/* start from operator received as argument */
- for( ; opm; opm= opm->next) {
- if(opm->type->invoke)
- retval= opm->type->invoke(C, opm, event);
- else if(opm->type->exec)
- retval= opm->type->exec(C, opm);
+ for (; opm; opm = opm->next) {
+ if (opm->type->invoke)
+ retval = opm->type->invoke(C, opm, event);
+ else if (opm->type->exec)
+ retval = opm->type->exec(C, opm);
OPERATOR_RETVAL_CHECK(retval);
@@ -253,7 +257,8 @@ static int wm_macro_invoke_internal(bContext *C, wmOperator *op, wmEvent *event,
if (retval & OPERATOR_FINISHED) {
MacroData *md = op->customdata;
md->retval = OPERATOR_FINISHED; /* keep in mind that at least one operator finished */
- } else {
+ }
+ else {
break; /* operator didn't finish, end macro */
}
}
@@ -270,9 +275,9 @@ static int wm_macro_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int wm_macro_modal(bContext *C, wmOperator *op, wmEvent *event)
{
wmOperator *opm = op->opm;
- int retval= OPERATOR_FINISHED;
+ int retval = OPERATOR_FINISHED;
- if(opm==NULL)
+ if (opm == NULL)
printf("%s: macro error, calling NULL modal()\n", __func__);
else {
retval = opm->type->modal(C, opm, event);
@@ -305,17 +310,17 @@ static int wm_macro_modal(bContext *C, wmOperator *op, wmEvent *event)
/* if operator is blocking, grab cursor
* This may end up grabbing twice, but we don't care.
* */
- if(op->opm->type->flag & OPTYPE_BLOCKING) {
- int bounds[4] = {-1,-1,-1,-1};
+ if (op->opm->type->flag & OPTYPE_BLOCKING) {
+ int bounds[4] = {-1, -1, -1, -1};
int wrap = (U.uiflag & USER_CONTINUOUS_MOUSE) && ((op->opm->flag & OP_GRAB_POINTER) || (op->opm->type->flag & OPTYPE_GRAB_POINTER));
- if(wrap) {
- ARegion *ar= CTX_wm_region(C);
- if(ar) {
- bounds[0]= ar->winrct.xmin;
- bounds[1]= ar->winrct.ymax;
- bounds[2]= ar->winrct.xmax;
- bounds[3]= ar->winrct.ymin;
+ if (wrap) {
+ ARegion *ar = CTX_wm_region(C);
+ if (ar) {
+ bounds[0] = ar->winrct.xmin;
+ bounds[1] = ar->winrct.ymax;
+ bounds[2] = ar->winrct.xmax;
+ bounds[3] = ar->winrct.ymin;
}
}
@@ -343,52 +348,55 @@ wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *nam
{
wmOperatorType *ot;
- if(WM_operatortype_find(idname, TRUE)) {
+ if (WM_operatortype_find(idname, TRUE)) {
printf("%s: macro error: operator %s exists\n", __func__, idname);
return NULL;
}
- ot= MEM_callocN(sizeof(wmOperatorType), "operatortype");
- ot->srna= RNA_def_struct(&BLENDER_RNA, "", "OperatorProperties");
+ ot = MEM_callocN(sizeof(wmOperatorType), "operatortype");
+ ot->srna = RNA_def_struct(&BLENDER_RNA, "", "OperatorProperties");
- ot->idname= idname;
- ot->name= name;
- ot->flag= OPTYPE_MACRO|flag;
+ ot->idname = idname;
+ ot->name = name;
+ ot->flag = OPTYPE_MACRO | flag;
- ot->exec= wm_macro_exec;
- ot->invoke= wm_macro_invoke;
- ot->modal= wm_macro_modal;
- ot->cancel= wm_macro_cancel;
- ot->poll= NULL;
+ ot->exec = wm_macro_exec;
+ ot->invoke = wm_macro_invoke;
+ ot->modal = wm_macro_modal;
+ ot->cancel = wm_macro_cancel;
+ ot->poll = NULL;
- if(!ot->description)
- ot->description= IFACE_("(undocumented operator)");
+ if (!ot->description) /* XXX All ops should have a description but for now allow them not to. */
+ ot->description = N_("(undocumented operator)");
- RNA_def_struct_ui_text(ot->srna, ot->name, ot->description); // XXX All ops should have a description but for now allow them not to.
+ RNA_def_struct_ui_text(ot->srna, ot->name, ot->description);
RNA_def_struct_identifier(ot->srna, ot->idname);
+ RNA_def_struct_translation_context(ot->srna, WM_OPERATOR_DEFAULT_I18NCONTEXT);
BLI_ghash_insert(global_ops_hash, (void *)ot->idname, ot);
return ot;
}
-void WM_operatortype_append_macro_ptr(void (*opfunc)(wmOperatorType*, void*), void *userdata)
+void WM_operatortype_append_macro_ptr(void (*opfunc)(wmOperatorType *, void *), void *userdata)
{
wmOperatorType *ot;
- ot= MEM_callocN(sizeof(wmOperatorType), "operatortype");
- ot->srna= RNA_def_struct(&BLENDER_RNA, "", "OperatorProperties");
+ ot = MEM_callocN(sizeof(wmOperatorType), "operatortype");
+ ot->srna = RNA_def_struct(&BLENDER_RNA, "", "OperatorProperties");
- ot->flag= OPTYPE_MACRO;
- ot->exec= wm_macro_exec;
- ot->invoke= wm_macro_invoke;
- ot->modal= wm_macro_modal;
- ot->cancel= wm_macro_cancel;
- ot->poll= NULL;
+ ot->flag = OPTYPE_MACRO;
+ ot->exec = wm_macro_exec;
+ ot->invoke = wm_macro_invoke;
+ ot->modal = wm_macro_modal;
+ ot->cancel = wm_macro_cancel;
+ ot->poll = NULL;
- if(!ot->description)
- ot->description= IFACE_("(undocumented operator)");
+ if (!ot->description)
+ ot->description = N_("(undocumented operator)");
+ /* Set the default i18n context now, so that opfunc can redefine it if needed! */
+ RNA_def_struct_translation_context(ot->srna, WM_OPERATOR_DEFAULT_I18NCONTEXT);
opfunc(ot, userdata);
RNA_def_struct_ui_text(ot->srna, ot->name, ot->description);
@@ -399,7 +407,7 @@ void WM_operatortype_append_macro_ptr(void (*opfunc)(wmOperatorType*, void*), vo
wmOperatorTypeMacro *WM_operatortype_macro_define(wmOperatorType *ot, const char *idname)
{
- wmOperatorTypeMacro *otmacro= MEM_callocN(sizeof(wmOperatorTypeMacro), "wmOperatorTypeMacro");
+ wmOperatorTypeMacro *otmacro = MEM_callocN(sizeof(wmOperatorTypeMacro), "wmOperatorTypeMacro");
BLI_strncpy(otmacro->idname, idname, OP_MAX_TYPENAME);
@@ -410,11 +418,11 @@ wmOperatorTypeMacro *WM_operatortype_macro_define(wmOperatorType *ot, const char
BLI_addtail(&ot->macro, otmacro);
{
- /* operator should always be found but in the event its not. dont segfault */
+ /* operator should always be found but in the event its not. don't segfault */
wmOperatorType *otsub = WM_operatortype_find(idname, 0);
- if(otsub) {
+ if (otsub) {
RNA_def_pointer_runtime(ot->srna, otsub->idname, otsub->srna,
- otsub->name, otsub->description);
+ otsub->name, otsub->description);
}
}
@@ -425,8 +433,8 @@ static void wm_operatortype_free_macro(wmOperatorType *ot)
{
wmOperatorTypeMacro *otmacro;
- for(otmacro= ot->macro.first; otmacro; otmacro= otmacro->next) {
- if(otmacro->ptr) {
+ for (otmacro = ot->macro.first; otmacro; otmacro = otmacro->next) {
+ if (otmacro->ptr) {
WM_operator_properties_free(otmacro->ptr);
MEM_freeN(otmacro->ptr);
}
@@ -439,12 +447,17 @@ int WM_operatortype_remove(const char *idname)
{
wmOperatorType *ot = WM_operatortype_find(idname, 0);
- if (ot==NULL)
+ if (ot == NULL)
return 0;
RNA_struct_free(&BLENDER_RNA, ot->srna);
-
- if(ot->macro.first)
+
+ if (ot->last_properties) {
+ IDP_FreeProperty(ot->last_properties);
+ MEM_freeN(ot->last_properties);
+ }
+
+ if (ot->macro.first)
wm_operatortype_free_macro(ot);
BLI_ghash_remove(global_ops_hash, (void *)ot->idname, NULL, NULL);
@@ -456,20 +469,20 @@ int WM_operatortype_remove(const char *idname)
/* SOME_OT_op -> some.op */
void WM_operator_py_idname(char *to, const char *from)
{
- char *sep= strstr(from, "_OT_");
- if(sep) {
- int ofs= (sep-from);
+ char *sep = strstr(from, "_OT_");
+ if (sep) {
+ 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 */
- memcpy(to, from, sizeof(char)*ofs);
+ * latter depends on the locale, and can lead to idname mistmatch */
+ memcpy(to, from, sizeof(char) * ofs);
BLI_ascii_strtolower(to, ofs);
to[ofs] = '.';
- BLI_strncpy(to+(ofs+1), sep+4, OP_MAX_TYPENAME);
+ 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);
}
}
@@ -478,24 +491,24 @@ void WM_operator_py_idname(char *to, const char *from)
void WM_operator_bl_idname(char *to, const char *from)
{
if (from) {
- char *sep= strchr(from, '.');
+ char *sep = strchr(from, '.');
- if(sep) {
- int ofs= (sep-from);
+ if (sep) {
+ int ofs = (sep - from);
- memcpy(to, from, sizeof(char)*ofs);
+ memcpy(to, from, sizeof(char) * ofs);
BLI_ascii_strtoupper(to, ofs);
- BLI_strncpy(to+ofs, "_OT_", OP_MAX_TYPENAME);
- BLI_strncpy(to+(ofs+4), sep+1, OP_MAX_TYPENAME);
+ BLI_strncpy(to + ofs, "_OT_", OP_MAX_TYPENAME);
+ 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);
}
}
else
- to[0]= 0;
+ to[0] = 0;
}
/* print a string representation of the operator, with the args that it runs
@@ -506,70 +519,31 @@ void WM_operator_bl_idname(char *to, const char *from)
*/
char *WM_operator_pystring(bContext *C, wmOperatorType *ot, PointerRNA *opptr, int all_args)
{
- const char *arg_name= NULL;
char idname_py[OP_MAX_TYPENAME];
- PropertyRNA *prop, *iterprop;
-
/* for building the string */
- DynStr *dynstr= BLI_dynstr_new();
- char *cstring, *buf;
- int first_iter=1, ok= 1;
-
+ DynStr *dynstr = BLI_dynstr_new();
+ char *cstring;
+ char *cstring_args;
/* only to get the orginal props for comparisons */
PointerRNA opptr_default;
- PropertyRNA *prop_default;
- char *buf_default;
- if(all_args==0 || opptr==NULL) {
+
+ if (all_args == 0 || opptr == NULL) {
WM_operator_properties_create_ptr(&opptr_default, ot);
- if(opptr==NULL)
+ if (opptr == NULL)
opptr = &opptr_default;
}
-
WM_operator_py_idname(idname_py, ot->idname);
BLI_dynstr_appendf(dynstr, "bpy.ops.%s(", idname_py);
- iterprop= RNA_struct_iterator_property(opptr->type);
-
- RNA_PROP_BEGIN(opptr, propptr, iterprop) {
- prop= propptr.data;
- arg_name= RNA_property_identifier(prop);
-
- if (strcmp(arg_name, "rna_type")==0) continue;
-
- buf= RNA_property_as_string(C, opptr, prop);
-
- ok= 1;
-
- if(!all_args) {
- /* not verbose, so only add in attributes that use non-default values
- * slow but good for tooltips */
- prop_default= RNA_struct_find_property(&opptr_default, arg_name);
-
- if(prop_default) {
- buf_default= RNA_property_as_string(C, &opptr_default, prop_default);
-
- if(strcmp(buf, buf_default)==0)
- ok= 0; /* values match, dont bother printing */
+ cstring_args = RNA_pointer_as_string_keywords(C, opptr, &opptr_default, FALSE, all_args);
+ BLI_dynstr_append(dynstr, cstring_args);
+ MEM_freeN(cstring_args);
- MEM_freeN(buf_default);
- }
-
- }
- if(ok) {
- BLI_dynstr_appendf(dynstr, first_iter?"%s=%s":", %s=%s", arg_name, buf);
- first_iter = 0;
- }
-
- MEM_freeN(buf);
-
- }
- RNA_PROP_END;
-
- if(all_args==0 || opptr==&opptr_default )
+ if (all_args == 0 || opptr == &opptr_default)
WM_operator_properties_free(&opptr_default);
BLI_dynstr_append(dynstr, ")");
@@ -586,9 +560,9 @@ void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
void WM_operator_properties_create(PointerRNA *ptr, const char *opstring)
{
- wmOperatorType *ot= WM_operatortype_find(opstring, 0);
+ wmOperatorType *ot = WM_operatortype_find(opstring, 0);
- if(ot)
+ if (ot)
WM_operator_properties_create_ptr(ptr, ot);
else
RNA_pointer_create(NULL, &RNA_OperatorProperties, NULL, ptr);
@@ -598,33 +572,33 @@ void WM_operator_properties_create(PointerRNA *ptr, const char *opstring)
* used for keymaps and macros */
void WM_operator_properties_alloc(PointerRNA **ptr, IDProperty **properties, const char *opstring)
{
- if(*properties==NULL) {
+ if (*properties == NULL) {
IDPropertyTemplate val = {0};
- *properties= IDP_New(IDP_GROUP, &val, "wmOpItemProp");
+ *properties = IDP_New(IDP_GROUP, &val, "wmOpItemProp");
}
- if(*ptr==NULL) {
- *ptr= MEM_callocN(sizeof(PointerRNA), "wmOpItemPtr");
+ if (*ptr == NULL) {
+ *ptr = MEM_callocN(sizeof(PointerRNA), "wmOpItemPtr");
WM_operator_properties_create(*ptr, opstring);
}
- (*ptr)->data= *properties;
+ (*ptr)->data = *properties;
}
void WM_operator_properties_sanitize(PointerRNA *ptr, const short no_context)
{
RNA_STRUCT_BEGIN(ptr, prop) {
- switch(RNA_property_type(prop)) {
- case PROP_ENUM:
- if (no_context)
- RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT);
- else
- RNA_def_property_clear_flag(prop, PROP_ENUM_NO_CONTEXT);
- break;
- case PROP_POINTER:
+ switch (RNA_property_type(prop)) {
+ case PROP_ENUM:
+ if (no_context)
+ RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT);
+ else
+ RNA_def_property_clear_flag(prop, PROP_ENUM_NO_CONTEXT);
+ break;
+ case PROP_POINTER:
{
- StructRNA *ptype= RNA_property_pointer_type(ptr, prop);
+ StructRNA *ptype = RNA_property_pointer_type(ptr, prop);
/* recurse into operator properties */
if (RNA_struct_is_a(ptype, &RNA_OperatorProperties)) {
@@ -633,8 +607,8 @@ void WM_operator_properties_sanitize(PointerRNA *ptr, const short no_context)
}
break;
}
- default:
- break;
+ default:
+ break;
}
}
RNA_STRUCT_END;
@@ -645,12 +619,12 @@ void WM_operator_properties_reset(wmOperator *op)
{
if (op->ptr->data) {
PropertyRNA *iterprop;
- iterprop= RNA_struct_iterator_property(op->type->srna);
+ iterprop = RNA_struct_iterator_property(op->type->srna);
RNA_PROP_BEGIN(op->ptr, itemptr, iterprop) {
- PropertyRNA *prop= itemptr.data;
+ PropertyRNA *prop = itemptr.data;
- if((RNA_property_flag(prop) & PROP_SKIP_SAVE) == 0) {
+ if ((RNA_property_flag(prop) & PROP_SKIP_SAVE) == 0) {
const char *identifier = RNA_property_identifier(prop);
RNA_struct_idprops_unset(op->ptr, identifier);
}
@@ -661,12 +635,12 @@ void WM_operator_properties_reset(wmOperator *op)
void WM_operator_properties_free(PointerRNA *ptr)
{
- IDProperty *properties= ptr->data;
+ IDProperty *properties = ptr->data;
- if(properties) {
+ if (properties) {
IDP_FreeProperty(properties);
MEM_freeN(properties);
- ptr->data= NULL; /* just incase */
+ ptr->data = NULL; /* just in case */
}
}
@@ -675,11 +649,11 @@ void WM_operator_properties_free(PointerRNA *ptr)
/* invoke callback, uses enum property named "type" */
int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- PropertyRNA *prop= op->type->prop;
+ PropertyRNA *prop = op->type->prop;
uiPopupMenu *pup;
uiLayout *layout;
- if(prop==NULL) {
+ if (prop == NULL) {
printf("%s: %s has no enum property set\n", __func__, op->type->idname);
}
else if (RNA_property_type(prop) != PROP_ENUM) {
@@ -687,13 +661,13 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
__func__, op->type->idname, RNA_property_identifier(prop));
}
else if (RNA_property_is_set(op->ptr, prop)) {
- const int retval= op->type->exec(C, op);
+ const int retval = op->type->exec(C, op);
OPERATOR_RETVAL_CHECK(retval);
return retval;
}
else {
- pup= uiPupMenuBegin(C, op->type->name, ICON_NONE);
- layout= uiPupMenuLayout(pup);
+ 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);
}
@@ -706,9 +680,9 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
static void operator_enum_search_cb(const struct bContext *C, void *arg_ot, const char *str, uiSearchItems *items)
{
wmOperatorType *ot = (wmOperatorType *)arg_ot;
- PropertyRNA *prop= ot->prop;
+ PropertyRNA *prop = ot->prop;
- if(prop==NULL) {
+ if (prop == NULL) {
printf("%s: %s has no enum property set\n",
__func__, ot->idname);
}
@@ -725,24 +699,24 @@ static void operator_enum_search_cb(const struct bContext *C, void *arg_ot, cons
RNA_pointer_create(NULL, ot->srna, NULL, &ptr);
RNA_property_enum_items((bContext *)C, &ptr, prop, &item_array, NULL, &do_free);
- for(item= item_array; item->identifier; item++) {
+ for (item = item_array; item->identifier; item++) {
/* note: need to give the intex rather than the dientifier because the enum can be freed */
- if(BLI_strcasestr(item->name, str))
- if(0==uiSearchItemAdd(items, item->name, SET_INT_IN_POINTER(item->value), 0))
+ if (BLI_strcasestr(item->name, str))
+ if (0 == uiSearchItemAdd(items, item->name, SET_INT_IN_POINTER(item->value), 0))
break;
}
- if(do_free)
+ if (do_free)
MEM_freeN(item_array);
}
}
static void operator_enum_call_cb(struct bContext *C, void *arg1, void *arg2)
{
- wmOperatorType *ot= arg1;
+ wmOperatorType *ot = arg1;
- if(ot) {
- if(ot->prop) {
+ if (ot) {
+ if (ot->prop) {
PointerRNA props_ptr;
WM_operator_properties_create_ptr(&props_ptr, ot);
RNA_property_enum_set(&props_ptr, ot->prop, GET_INT_FROM_POINTER(arg2));
@@ -757,31 +731,31 @@ static void operator_enum_call_cb(struct bContext *C, void *arg1, void *arg2)
static uiBlock *wm_enum_search_menu(bContext *C, ARegion *ar, void *arg_op)
{
- static char search[256]= "";
+ static char search[256] = "";
wmEvent event;
- wmWindow *win= CTX_wm_window(C);
+ wmWindow *win = CTX_wm_window(C);
uiBlock *block;
uiBut *but;
- wmOperator *op= (wmOperator *)arg_op;
+ wmOperator *op = (wmOperator *)arg_op;
- block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT);
+ block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
+ uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_RET_1 | UI_BLOCK_MOVEMOUSE_QUIT);
- //uiDefBut(block, LABEL, 0, op->type->name, 10, 10, 180, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); // ok, this isnt so easy...
- but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, 9*UI_UNIT_X, UI_UNIT_Y, 0, 0, "");
+ //uiDefBut(block, LABEL, 0, op->type->name, 10, 10, 180, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); // ok, this isn't so easy...
+ but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, 9 * UI_UNIT_X, UI_UNIT_Y, 0, 0, "");
uiButSetSearchFunc(but, operator_enum_search_cb, op->type, operator_enum_call_cb, NULL);
/* fake button, it holds space for search items */
- uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxhHeight(), 9*UI_UNIT_X, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
+ uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxhHeight(), 9 * UI_UNIT_X, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
uiPopupBoundsBlock(block, 6, 0, -UI_UNIT_Y); /* move it downwards, mouse over button */
uiEndBlock(C, block);
- event= *(win->eventstate); /* XXX huh huh? make api call */
- event.type= EVT_BUT_OPEN;
- event.val= KM_PRESS;
- event.customdata= but;
- event.customdatafree= FALSE;
+ event = *(win->eventstate); /* XXX huh huh? make api call */
+ event.type = EVT_BUT_OPEN;
+ event.val = KM_PRESS;
+ event.customdata = but;
+ event.customdatafree = FALSE;
wm_event_add(win, &event);
return block;
@@ -799,15 +773,15 @@ int WM_operator_confirm_message(bContext *C, wmOperator *op, const char *message
{
uiPopupMenu *pup;
uiLayout *layout;
- IDProperty *properties= op->ptr->data;
+ IDProperty *properties = op->ptr->data;
- if(properties && properties->len)
- properties= IDP_CopyProperty(op->ptr->data);
+ if (properties && properties->len)
+ properties = IDP_CopyProperty(op->ptr->data);
else
- properties= NULL;
+ properties = NULL;
- pup= uiPupMenuBegin(C, IFACE_("OK?"), ICON_QUESTION);
- layout= uiPupMenuLayout(pup);
+ pup = uiPupMenuBegin(C, IFACE_("OK?"), ICON_QUESTION);
+ layout = uiPupMenuLayout(pup);
uiItemFullO_ptr(layout, op->type, message, ICON_NONE, properties, WM_OP_EXEC_REGION_WIN, 0);
uiPupMenuEnd(C, pup);
@@ -842,67 +816,68 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type,
{FILE_SHORTDISPLAY, "FILE_SHORTDISPLAY", ICON_SHORTDISPLAY, "Short List", "Display files as short list"},
{FILE_LONGDISPLAY, "FILE_LONGDISPLAY", ICON_LONGDISPLAY, "Long List", "Display files as a detailed list"},
{FILE_IMGDISPLAY, "FILE_IMGDISPLAY", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}
+ };
- if(flag & WM_FILESEL_FILEPATH)
+ if (flag & WM_FILESEL_FILEPATH)
RNA_def_string_file_path(ot->srna, "filepath", "", FILE_MAX, "File Path", "Path to file");
- if(flag & WM_FILESEL_DIRECTORY)
+ if (flag & WM_FILESEL_DIRECTORY)
RNA_def_string_dir_path(ot->srna, "directory", "", FILE_MAX, "Directory", "Directory of the file");
- if(flag & WM_FILESEL_FILENAME)
+ if (flag & WM_FILESEL_FILENAME)
RNA_def_string_file_name(ot->srna, "filename", "", FILE_MAX, "File Name", "Name of the file");
- if(flag & WM_FILESEL_FILES)
+ if (flag & WM_FILESEL_FILES)
RNA_def_collection_runtime(ot->srna, "files", &RNA_OperatorFileListElement, "Files", "");
if (action == FILE_SAVE) {
- prop= RNA_def_boolean(ot->srna, "check_existing", 1, "Check Existing", "Check and warn on overwriting existing files");
+ prop = RNA_def_boolean(ot->srna, "check_existing", 1, "Check Existing", "Check and warn on overwriting existing files");
RNA_def_property_flag(prop, PROP_HIDDEN);
}
- prop= RNA_def_boolean(ot->srna, "filter_blender", (filter & BLENDERFILE), "Filter .blend files", "");
+ prop = RNA_def_boolean(ot->srna, "filter_blender", (filter & BLENDERFILE), "Filter .blend files", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
- prop= RNA_def_boolean(ot->srna, "filter_image", (filter & IMAGEFILE), "Filter image files", "");
+ prop = RNA_def_boolean(ot->srna, "filter_image", (filter & IMAGEFILE), "Filter image files", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
- prop= RNA_def_boolean(ot->srna, "filter_movie", (filter & MOVIEFILE), "Filter movie files", "");
+ prop = RNA_def_boolean(ot->srna, "filter_movie", (filter & MOVIEFILE), "Filter movie files", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
- prop= RNA_def_boolean(ot->srna, "filter_python", (filter & PYSCRIPTFILE), "Filter python files", "");
+ prop = RNA_def_boolean(ot->srna, "filter_python", (filter & PYSCRIPTFILE), "Filter python files", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
- prop= RNA_def_boolean(ot->srna, "filter_font", (filter & FTFONTFILE), "Filter font files", "");
+ prop = RNA_def_boolean(ot->srna, "filter_font", (filter & FTFONTFILE), "Filter font files", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
- prop= RNA_def_boolean(ot->srna, "filter_sound", (filter & SOUNDFILE), "Filter sound files", "");
+ prop = RNA_def_boolean(ot->srna, "filter_sound", (filter & SOUNDFILE), "Filter sound files", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
- prop= RNA_def_boolean(ot->srna, "filter_text", (filter & TEXTFILE), "Filter text files", "");
+ prop = RNA_def_boolean(ot->srna, "filter_text", (filter & TEXTFILE), "Filter text files", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
- prop= RNA_def_boolean(ot->srna, "filter_btx", (filter & BTXFILE), "Filter btx files", "");
+ prop = RNA_def_boolean(ot->srna, "filter_btx", (filter & BTXFILE), "Filter btx files", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
- prop= RNA_def_boolean(ot->srna, "filter_collada", (filter & COLLADAFILE), "Filter COLLADA files", "");
+ prop = RNA_def_boolean(ot->srna, "filter_collada", (filter & COLLADAFILE), "Filter COLLADA files", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
- prop= RNA_def_boolean(ot->srna, "filter_folder", (filter & FOLDERFILE), "Filter folders", "");
+ prop = RNA_def_boolean(ot->srna, "filter_folder", (filter & FOLDERFILE), "Filter folders", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
- prop= RNA_def_int(ot->srna, "filemode", type, FILE_LOADLIB, FILE_SPECIAL,
- "File Browser Mode", "The setting for the file browser mode to load a .blend file, a library or a special file",
- FILE_LOADLIB, FILE_SPECIAL);
+ prop = RNA_def_int(ot->srna, "filemode", type, FILE_LOADLIB, FILE_SPECIAL,
+ "File Browser Mode", "The setting for the file browser mode to load a .blend file, a library or a special file",
+ FILE_LOADLIB, FILE_SPECIAL);
RNA_def_property_flag(prop, PROP_HIDDEN);
- if(flag & WM_FILESEL_RELPATH)
+ if (flag & WM_FILESEL_RELPATH)
RNA_def_boolean(ot->srna, "relative_path", TRUE, "Relative Path", "Select the file relative to the blend file");
- prop= RNA_def_enum(ot->srna, "display_type", file_display_items, display, "Display Type", "");
+ prop = RNA_def_enum(ot->srna, "display_type", file_display_items, display, "Display Type", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
}
void WM_operator_properties_select_all(wmOperatorType *ot)
{
static EnumPropertyItem select_all_actions[] = {
- {SEL_TOGGLE, "TOGGLE", 0, "Toggle", "Toggle selection for all elements"},
- {SEL_SELECT, "SELECT", 0, "Select", "Select all elements"},
- {SEL_DESELECT, "DESELECT", 0, "Deselect", "Deselect all elements"},
- {SEL_INVERT, "INVERT", 0, "Invert", "Invert selection of all elements"},
- {0, NULL, 0, NULL, NULL}
+ {SEL_TOGGLE, "TOGGLE", 0, "Toggle", "Toggle selection for all elements"},
+ {SEL_SELECT, "SELECT", 0, "Select", "Select all elements"},
+ {SEL_DESELECT, "DESELECT", 0, "Deselect", "Deselect all elements"},
+ {SEL_INVERT, "INVERT", 0, "Invert", "Invert selection of all elements"},
+ {0, NULL, 0, NULL, NULL}
};
RNA_def_enum(ot->srna, "action", select_all_actions, SEL_TOGGLE, "Action", "Selection action to execute");
@@ -916,7 +891,7 @@ void WM_operator_properties_gesture_border(wmOperatorType *ot, int extend)
RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
- if(extend)
+ if (extend)
RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first");
}
@@ -927,7 +902,7 @@ void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor)
RNA_def_int(ot->srna, "ystart", 0, INT_MIN, INT_MAX, "Y Start", "", INT_MIN, INT_MAX);
RNA_def_int(ot->srna, "yend", 0, INT_MIN, INT_MAX, "Y End", "", INT_MIN, INT_MAX);
- if(cursor)
+ if (cursor)
RNA_def_int(ot->srna, "cursor", cursor, 0, INT_MAX, "Cursor", "Mouse cursor style to use during the modal operator", 0, INT_MAX);
}
@@ -935,27 +910,27 @@ void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor)
/* op->poll */
int WM_operator_winactive(bContext *C)
{
- if(CTX_wm_window(C)==NULL) return 0;
+ if (CTX_wm_window(C) == NULL) return 0;
return 1;
}
/* return FALSE, if the UI should be disabled */
int WM_operator_check_ui_enabled(const bContext *C, const char *idname)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- Scene *scene= CTX_data_scene(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
+ Scene *scene = CTX_data_scene(C);
- return !(ED_undo_valid(C, idname)==0 || WM_jobs_test(wm, scene));
+ return !(ED_undo_valid(C, idname) == 0 || WM_jobs_test(wm, scene));
}
wmOperator *WM_operator_last_redo(const bContext *C)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
wmOperator *op;
/* only for operators that are registered and did an undo push */
- for(op= wm->operators.last; op; op= op->prev)
- if((op->type->flag & OPTYPE_REGISTER) && (op->type->flag & OPTYPE_UNDO))
+ for (op = wm->operators.last; op; op = op->prev)
+ if ((op->type->flag & OPTYPE_REGISTER) && (op->type->flag & OPTYPE_UNDO))
break;
return op;
@@ -963,29 +938,29 @@ wmOperator *WM_operator_last_redo(const bContext *C)
static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
{
- wmOperator *op= arg_op;
+ wmOperator *op = arg_op;
uiBlock *block;
uiLayout *layout;
- uiStyle *style= UI_GetStyle();
- int width= 300;
+ uiStyle *style = UI_GetStyle();
+ int width = 300;
- block= uiBeginBlock(C, ar, __func__, UI_EMBOSS);
+ block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);
uiBlockClearFlag(block, UI_BLOCK_LOOP);
- uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT);
+ uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_RET_1 | UI_BLOCK_MOVEMOUSE_QUIT);
/* if register is not enabled, the operator gets freed on OPERATOR_FINISHED
- * ui_apply_but_funcs_after calls ED_undo_operator_repeate_cb and crashes */
+ * ui_apply_but_funcs_after calls ED_undo_operator_repeate_cb and crashes */
assert(op->type->flag & OPTYPE_REGISTER);
uiBlockSetHandleFunc(block, ED_undo_operator_repeat_cb_evt, arg_op);
- layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, width, UI_UNIT_Y, style);
+ layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, width, UI_UNIT_Y, style);
if (!WM_operator_check_ui_enabled(C, op->type->name))
uiLayoutSetEnabled(layout, 0);
- if(op->type->flag & OPTYPE_MACRO) {
- for(op= op->macro.first; op; op= op->next) {
+ if (op->type->flag & OPTYPE_MACRO) {
+ for (op = op->macro.first; op; op = op->next) {
uiItemL(layout, op->type->name, ICON_NONE);
uiLayoutOperatorButs(C, layout, op, NULL, 'H', UI_LAYOUT_OP_SHOW_TITLE);
}
@@ -1001,8 +976,7 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
return block;
}
-typedef struct wmOpPopUp
-{
+typedef struct wmOpPopUp {
wmOperator *op;
int width;
int height;
@@ -1012,8 +986,8 @@ typedef struct wmOpPopUp
/* Only invoked by OK button in popups created with wm_block_dialog_create() */
static void dialog_exec_cb(bContext *C, void *arg1, void *arg2)
{
- wmOpPopUp *data= arg1;
- uiBlock *block= arg2;
+ wmOpPopUp *data = arg1;
+ uiBlock *block = arg2;
WM_operator_call(C, data->op);
@@ -1029,9 +1003,9 @@ static void dialog_exec_cb(bContext *C, void *arg1, void *arg2)
static void dialog_check_cb(bContext *C, void *op_ptr, void *UNUSED(arg))
{
- wmOperator *op= op_ptr;
- if(op->type->check) {
- if(op->type->check(C, op)) {
+ wmOperator *op = op_ptr;
+ if (op->type->check) {
+ if (op->type->check(C, op)) {
/* refresh */
}
}
@@ -1040,17 +1014,17 @@ static void dialog_check_cb(bContext *C, void *op_ptr, void *UNUSED(arg))
/* Dialogs are popups that require user verification (click OK) before exec */
static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData)
{
- wmOpPopUp *data= userData;
- wmOperator *op= data->op;
+ wmOpPopUp *data = userData;
+ wmOperator *op = data->op;
uiBlock *block;
uiLayout *layout;
- uiStyle *style= UI_GetStyle();
+ uiStyle *style = UI_GetStyle();
block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);
uiBlockClearFlag(block, UI_BLOCK_LOOP);
- uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT);
+ uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_RET_1 | UI_BLOCK_MOVEMOUSE_QUIT);
- layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, style);
+ layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, style);
uiBlockSetFunc(block, dialog_check_cb, op, NULL);
@@ -1065,15 +1039,15 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData)
uiLayout *col;
uiBut *btn;
- col= uiLayoutColumn(layout, FALSE);
- col_block= uiLayoutGetBlock(col);
+ col = uiLayoutColumn(layout, FALSE);
+ col_block = uiLayoutGetBlock(col);
/* Create OK button, the callback of which will execute op */
- btn= uiDefBut(col_block, BUT, 0, IFACE_("OK"), 0, -30, 0, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
+ btn = uiDefBut(col_block, BUT, 0, IFACE_("OK"), 0, -30, 0, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
uiButSetFunc(btn, dialog_exec_cb, data, col_block);
}
/* center around the mouse */
- uiPopupBoundsBlock(block, 4, data->width/-2, data->height/2);
+ uiPopupBoundsBlock(block, 4, data->width / -2, data->height / 2);
uiEndBlock(C, block);
return block;
@@ -1081,17 +1055,17 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData)
static uiBlock *wm_operator_ui_create(bContext *C, ARegion *ar, void *userData)
{
- wmOpPopUp *data= userData;
- wmOperator *op= data->op;
+ wmOpPopUp *data = userData;
+ wmOperator *op = data->op;
uiBlock *block;
uiLayout *layout;
- uiStyle *style= UI_GetStyle();
+ uiStyle *style = UI_GetStyle();
- block= uiBeginBlock(C, ar, __func__, UI_EMBOSS);
+ block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);
uiBlockClearFlag(block, UI_BLOCK_LOOP);
- uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT);
+ uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_RET_1 | UI_BLOCK_MOVEMOUSE_QUIT);
- layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, style);
+ layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, style);
/* since ui is defined the auto-layout args are not used */
uiLayoutOperatorButs(C, layout, op, NULL, 'V', 0);
@@ -1104,9 +1078,9 @@ static uiBlock *wm_operator_ui_create(bContext *C, ARegion *ar, void *userData)
static void wm_operator_ui_popup_cancel(void *userData)
{
- wmOpPopUp *data= userData;
- if(data->free_op && data->op) {
- wmOperator *op= data->op;
+ wmOpPopUp *data = userData;
+ if (data->free_op && data->op) {
+ wmOperator *op = data->op;
WM_operator_free(op);
}
@@ -1115,20 +1089,20 @@ static void wm_operator_ui_popup_cancel(void *userData)
static void wm_operator_ui_popup_ok(struct bContext *C, void *arg, int retval)
{
- wmOpPopUp *data= arg;
- wmOperator *op= data->op;
+ wmOpPopUp *data = arg;
+ wmOperator *op = data->op;
- if(op && retval > 0)
+ if (op && retval > 0)
WM_operator_call(C, op);
}
int WM_operator_ui_popup(bContext *C, wmOperator *op, int width, int height)
{
- wmOpPopUp *data= MEM_callocN(sizeof(wmOpPopUp), "WM_operator_ui_popup");
- data->op= op;
- data->width= width;
- data->height= height;
- data->free_op= TRUE; /* if this runs and gets registered we may want not to free it */
+ wmOpPopUp *data = MEM_callocN(sizeof(wmOpPopUp), "WM_operator_ui_popup");
+ data->op = op;
+ data->width = width;
+ data->height = height;
+ data->free_op = TRUE; /* if this runs and gets registered we may want not to free it */
uiPupBlockEx(C, wm_operator_ui_create, NULL, wm_operator_ui_popup_cancel, data);
return OPERATOR_RUNNING_MODAL;
}
@@ -1137,7 +1111,7 @@ int WM_operator_ui_popup(bContext *C, wmOperator *op, int width, int height)
int WM_operator_props_popup(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- if((op->type->flag & OPTYPE_REGISTER)==0) {
+ if ((op->type->flag & OPTYPE_REGISTER) == 0) {
BKE_reportf(op->reports, RPT_ERROR,
"Operator '%s' does not have register enabled, incorrect invoke function.", op->type->idname);
return OPERATOR_CANCELLED;
@@ -1153,12 +1127,12 @@ int WM_operator_props_popup(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width, int height)
{
- wmOpPopUp *data= MEM_callocN(sizeof(wmOpPopUp), "WM_operator_props_dialog_popup");
+ wmOpPopUp *data = MEM_callocN(sizeof(wmOpPopUp), "WM_operator_props_dialog_popup");
- data->op= op;
- data->width= width;
- data->height= height;
- data->free_op= TRUE; /* if this runs and gets registered we may want not to free it */
+ data->op = op;
+ data->width = width;
+ data->height = height;
+ data->free_op = TRUE; /* if this runs and gets registered we may want not to free it */
/* op is not executed until popup OK but is clicked */
uiPupBlockEx(C, wm_block_dialog_create, wm_operator_ui_popup_ok, wm_operator_ui_popup_cancel, data);
@@ -1169,11 +1143,11 @@ int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width, int h
int WM_operator_redo_popup(bContext *C, wmOperator *op)
{
/* CTX_wm_reports(C) because operator is on stack, not active in event system */
- if((op->type->flag & OPTYPE_REGISTER)==0) {
+ if ((op->type->flag & OPTYPE_REGISTER) == 0) {
BKE_reportf(CTX_wm_reports(C), RPT_ERROR, "Operator redo '%s' does not have register enabled, incorrect invoke function.", op->type->idname);
return OPERATOR_CANCELLED;
}
- if(op->type->poll && op->type->poll(C)==0) {
+ if (op->type->poll && op->type->poll(C) == 0) {
BKE_reportf(CTX_wm_reports(C), RPT_ERROR, "Operator redo '%s': wrong context.", op->type->idname);
return OPERATOR_CANCELLED;
}
@@ -1187,7 +1161,7 @@ int WM_operator_redo_popup(bContext *C, wmOperator *op)
static int wm_debug_menu_exec(bContext *C, wmOperator *op)
{
- G.rt= RNA_int_get(op->ptr, "debug_value");
+ G.rt = RNA_int_get(op->ptr, "debug_value");
ED_screen_refresh(CTX_wm_manager(C), CTX_wm_window(C));
WM_event_add_notifier(C, NC_WINDOW, NULL);
@@ -1197,18 +1171,18 @@ static int wm_debug_menu_exec(bContext *C, wmOperator *op)
static int wm_debug_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
RNA_int_set(op->ptr, "debug_value", G.rt);
- return WM_operator_props_dialog_popup(C, op, 9*UI_UNIT_X, UI_UNIT_Y);
+ return WM_operator_props_dialog_popup(C, op, 9 * UI_UNIT_X, UI_UNIT_Y);
}
static void WM_OT_debug_menu(wmOperatorType *ot)
{
- ot->name= "Debug Menu";
- ot->idname= "WM_OT_debug_menu";
- ot->description= "Open a popup to set the debug level";
+ ot->name = "Debug Menu";
+ ot->idname = "WM_OT_debug_menu";
+ ot->description = "Open a popup to set the debug level";
- ot->invoke= wm_debug_menu_invoke;
- ot->exec= wm_debug_menu_exec;
- ot->poll= WM_operator_winactive;
+ ot->invoke = wm_debug_menu_invoke;
+ ot->exec = wm_debug_menu_exec;
+ ot->poll = WM_operator_winactive;
RNA_def_int(ot->srna, "debug_value", 0, -10000, 10000, "Debug Value", "", INT_MIN, INT_MAX);
}
@@ -1225,31 +1199,32 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse
/* XXX: hack to refresh splash screen with updated prest menu name,
* since popup blocks don't get regenerated like panels do */
-static void wm_block_splash_refreshmenu (bContext *UNUSED(C), void *UNUSED(arg_block), void *UNUSED(arg))
+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)
{
- char *res= BLI_get_folder_version(BLENDER_RESOURCE_PATH_USER, BLENDER_VERSION, TRUE);
+ char *res = BLI_get_folder_version(BLENDER_RESOURCE_PATH_USER, BLENDER_VERSION, TRUE);
- // if(res) printf("USER: %s\n", res);
+ // if (res) printf("USER: %s\n", res);
#if 0 /* ignore the local folder */
- if(res == NULL) {
- /* with a local dir, copying old files isnt useful since local dir get priority for config */
- res= BLI_get_folder_version(BLENDER_RESOURCE_PATH_LOCAL, BLENDER_VERSION, TRUE);
+ if (res == NULL) {
+ /* with a local dir, copying old files isn't useful since local dir get priority for config */
+ res = BLI_get_folder_version(BLENDER_RESOURCE_PATH_LOCAL, BLENDER_VERSION, TRUE);
}
#endif
- // if(res) printf("LOCAL: %s\n", res);
- if(res) {
+ // if (res) printf("LOCAL: %s\n", res);
+ if (res) {
return FALSE;
}
else {
@@ -1262,19 +1237,19 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
uiBlock *block;
uiBut *but;
uiLayout *layout, *split, *col;
- uiStyle *style= UI_GetStyle();
+ uiStyle *style = UI_GetStyle();
struct RecentFile *recent;
int i;
- MenuType *mt= WM_menutype_find("USERPREF_MT_splash", TRUE);
+ MenuType *mt = WM_menutype_find("USERPREF_MT_splash", TRUE);
char url[96];
#ifndef WITH_HEADLESS
extern char datatoc_splash_png[];
extern int datatoc_splash_png_size;
- ImBuf *ibuf= IMB_ibImageFromMemory((unsigned char*)datatoc_splash_png, datatoc_splash_png_size, IB_rect, "<splash screen>");
+ ImBuf *ibuf = IMB_ibImageFromMemory((unsigned char *)datatoc_splash_png, datatoc_splash_png_size, IB_rect, "<splash screen>");
#else
- ImBuf *ibuf= NULL;
+ ImBuf *ibuf = NULL;
#endif
@@ -1285,7 +1260,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
extern char build_rev[];
BLI_snprintf(version_buf, sizeof(version_buf),
- "%d.%02d.%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION);
+ "%d.%02d.%d", BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION);
BLI_snprintf(revision_buf, sizeof(revision_buf), "r%s", build_rev);
BLF_size(style->widgetlabel.uifont_id, style->widgetlabel.points, U.dpi);
@@ -1293,26 +1268,26 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
rev_width = (int)BLF_width(style->widgetlabel.uifont_id, revision_buf) + 5;
#endif //WITH_BUILDINFO
- block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
+ block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN);
- but= uiDefBut(block, BUT_IMAGE, 0, "", 0, 10, 501, 282, ibuf, 0.0, 0.0, 0, 0, ""); /* button owns the imbuf now */
+ but = uiDefBut(block, BUT_IMAGE, 0, "", 0, 10, 501, 282, ibuf, 0.0, 0.0, 0, 0, ""); /* button owns the imbuf now */
uiButSetFunc(but, wm_block_splash_close, block, NULL);
uiBlockSetFunc(block, wm_block_splash_refreshmenu, block, NULL);
#ifdef WITH_BUILDINFO
- uiDefBut(block, LABEL, 0, version_buf, 494-ver_width, 282-24, ver_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
- uiDefBut(block, LABEL, 0, revision_buf, 494-rev_width, 282-36, rev_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
+ uiDefBut(block, LABEL, 0, version_buf, 494 - ver_width, 282 - 24, ver_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
+ uiDefBut(block, LABEL, 0, revision_buf, 494 - rev_width, 282 - 36, rev_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
#endif //WITH_BUILDINFO
- layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 10, 2, 480, 110, style);
+ layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 10, 2, 480, 110, style);
uiBlockSetEmboss(block, UI_EMBOSS);
/* show the splash menu (containing interaction presets), using python */
if (mt) {
- Menu menu= {NULL};
- menu.layout= layout;
- menu.type= mt;
+ Menu menu = {NULL};
+ menu.layout = layout;
+ menu.type = mt;
mt->draw(C, &menu);
// wmWindowManager *wm= CTX_wm_manager(C);
@@ -1331,24 +1306,24 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
uiItemStringO(col, IFACE_("Manual"), ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.5/Manual");
uiItemStringO(col, IFACE_("Blender Website"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org");
uiItemStringO(col, IFACE_("User Community"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community");
- if(strcmp(STRINGIFY(BLENDER_VERSION_CYCLE), "release")==0) {
- BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d" STRINGIFY(BLENDER_VERSION_CHAR) "_release", BLENDER_VERSION/100, BLENDER_VERSION%100);
+ if (strcmp(STRINGIFY(BLENDER_VERSION_CYCLE), "release") == 0) {
+ BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d" STRINGIFY(BLENDER_VERSION_CHAR) "_release", BLENDER_VERSION / 100, BLENDER_VERSION % 100);
}
else {
- BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d_%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION);
+ BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d_%d", BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION);
}
uiItemStringO(col, IFACE_("Python API Reference"), ICON_URL, "WM_OT_url_open", "url", url);
uiItemL(col, "", ICON_NONE);
col = uiLayoutColumn(split, 0);
- if(wm_resource_check_prev()) {
+ if (wm_resource_check_prev()) {
uiItemO(col, NULL, ICON_NEW, "WM_OT_copy_prev_settings");
uiItemS(col);
}
uiItemL(col, IFACE_("Recent"), ICON_NONE);
- for(recent = G.recent_files.first, i=0; (i<5) && (recent); recent = recent->next, i++) {
+ for (recent = G.recent_files.first, i = 0; (i < 5) && (recent); recent = recent->next, i++) {
uiItemStringO(col, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath);
}
@@ -1371,38 +1346,38 @@ static int wm_splash_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED
static void WM_OT_splash(wmOperatorType *ot)
{
- ot->name= "Splash Screen";
- ot->idname= "WM_OT_splash";
- ot->description= "Opens a blocking popup region with release info";
+ ot->name = "Splash Screen";
+ ot->idname = "WM_OT_splash";
+ ot->description = "Opens a blocking popup region with release info";
- ot->invoke= wm_splash_invoke;
- ot->poll= WM_operator_winactive;
+ ot->invoke = wm_splash_invoke;
+ ot->poll = WM_operator_winactive;
}
/* ***************** Search menu ************************* */
static void operator_call_cb(struct bContext *C, void *UNUSED(arg1), void *arg2)
{
- wmOperatorType *ot= arg2;
+ wmOperatorType *ot = arg2;
- if(ot)
+ if (ot)
WM_operator_name_call(C, ot->idname, WM_OP_INVOKE_DEFAULT, NULL);
}
static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items)
{
- GHashIterator *iter= WM_operatortype_iter();
+ GHashIterator *iter = WM_operatortype_iter();
- for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
- wmOperatorType *ot= BLI_ghashIterator_getValue(iter);
+ for (; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+ wmOperatorType *ot = BLI_ghashIterator_getValue(iter);
- if((ot->flag & OPTYPE_INTERNAL) && (G.f & G_DEBUG) == 0)
+ if ((ot->flag & OPTYPE_INTERNAL) && (G.debug & G_DEBUG_WM) == 0)
continue;
- if(BLI_strcasestr(ot->name, str)) {
- if(WM_operator_poll((bContext*)C, ot)) {
+ if (BLI_strcasestr(ot->name, str)) {
+ if (WM_operator_poll((bContext *)C, ot)) {
char name[256];
- int len= strlen(ot->name);
+ int len = strlen(ot->name);
/* display name for menu, can hold hotkey */
BLI_strncpy(name, ot->name, sizeof(name));
@@ -1410,13 +1385,13 @@ static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), cons
/* check for hotkey */
if (len < sizeof(name) - 6) {
if (WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, TRUE,
- &name[len+1], sizeof(name)-len-1))
+ &name[len + 1], sizeof(name) - len - 1))
{
- name[len]= '|';
+ name[len] = '|';
}
}
- if(0==uiSearchItemAdd(items, name, ot, 0))
+ if (0 == uiSearchItemAdd(items, name, ot, 0))
break;
}
}
@@ -1426,29 +1401,29 @@ static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), cons
static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *UNUSED(arg_op))
{
- static char search[256]= "";
+ static char search[256] = "";
wmEvent event;
- wmWindow *win= CTX_wm_window(C);
+ wmWindow *win = CTX_wm_window(C);
uiBlock *block;
uiBut *but;
- block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT);
+ block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
+ uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_RET_1 | UI_BLOCK_MOVEMOUSE_QUIT);
- but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, 9*UI_UNIT_X, UI_UNIT_Y, 0, 0, "");
+ but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, 9 * UI_UNIT_X, UI_UNIT_Y, 0, 0, "");
uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL);
/* fake button, it holds space for search items */
- uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxhHeight(), 9*UI_UNIT_X, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
+ uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxhHeight(), 9 * UI_UNIT_X, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
uiPopupBoundsBlock(block, 6, 0, -UI_UNIT_Y); /* move it downwards, mouse over button */
uiEndBlock(C, block);
- event= *(win->eventstate); /* XXX huh huh? make api call */
- event.type= EVT_BUT_OPEN;
- event.val= KM_PRESS;
- event.customdata= but;
- event.customdatafree= FALSE;
+ event = *(win->eventstate); /* XXX huh huh? make api call */
+ event.type = EVT_BUT_OPEN;
+ event.val = KM_PRESS;
+ event.customdata = but;
+ event.customdatafree = FALSE;
wm_event_add(win, &event);
return block;
@@ -1469,18 +1444,18 @@ static int wm_search_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev
/* op->poll */
static int wm_search_menu_poll(bContext *C)
{
- if(CTX_wm_window(C)==NULL) {
+ if (CTX_wm_window(C) == NULL) {
return 0;
}
else {
- ScrArea *sa= CTX_wm_area(C);
- if(sa) {
- if(sa->spacetype==SPACE_CONSOLE) return 0; // XXX - so we can use the shortcut in the console
- if(sa->spacetype==SPACE_TEXT) return 0; // XXX - so we can use the spacebar in the text editor
+ ScrArea *sa = CTX_wm_area(C);
+ if (sa) {
+ if (sa->spacetype == SPACE_CONSOLE) return 0; // XXX - so we can use the shortcut in the console
+ if (sa->spacetype == SPACE_TEXT) return 0; // XXX - so we can use the spacebar in the text editor
}
else {
- Object *editob= CTX_data_edit_object(C);
- if(editob && editob->type==OB_FONT) return 0; // XXX - so we can use the spacebar for entering text
+ Object *editob = CTX_data_edit_object(C);
+ if (editob && editob->type == OB_FONT) return 0; // XXX - so we can use the spacebar for entering text
}
}
return 1;
@@ -1488,12 +1463,12 @@ static int wm_search_menu_poll(bContext *C)
static void WM_OT_search_menu(wmOperatorType *ot)
{
- ot->name= "Search Menu";
- ot->idname= "WM_OT_search_menu";
+ ot->name = "Search Menu";
+ ot->idname = "WM_OT_search_menu";
- ot->invoke= wm_search_menu_invoke;
- ot->exec= wm_search_menu_exec;
- ot->poll= wm_search_menu_poll;
+ ot->invoke = wm_search_menu_invoke;
+ ot->exec = wm_search_menu_exec;
+ ot->poll = wm_search_menu_poll;
}
static int wm_call_menu_exec(bContext *C, wmOperator *op)
@@ -1508,13 +1483,13 @@ static int wm_call_menu_exec(bContext *C, wmOperator *op)
static void WM_OT_call_menu(wmOperatorType *ot)
{
- ot->name= "Call Menu";
- ot->idname= "WM_OT_call_menu";
+ ot->name = "Call Menu";
+ ot->idname = "WM_OT_call_menu";
- ot->exec= wm_call_menu_exec;
- ot->poll= WM_operator_winactive;
+ ot->exec = wm_call_menu_exec;
+ ot->poll = WM_operator_winactive;
- ot->flag= OPTYPE_INTERNAL;
+ ot->flag = OPTYPE_INTERNAL;
RNA_def_string(ot->srna, "name", "", BKE_ST_MAXNAME, "Name", "Name of the menu");
}
@@ -1525,9 +1500,9 @@ static void WM_OT_call_menu(wmOperatorType *ot)
* while it crashes on full screen */
static int wm_operator_winactive_normal(bContext *C)
{
- wmWindow *win= CTX_wm_window(C);
+ wmWindow *win = CTX_wm_window(C);
- if(win==NULL || win->screen==NULL || win->screen->full != SCREENNORMAL)
+ if (win == NULL || win->screen == NULL || win->screen->full != SCREENNORMAL)
return 0;
return 1;
@@ -1535,44 +1510,44 @@ static int wm_operator_winactive_normal(bContext *C)
static void WM_OT_window_duplicate(wmOperatorType *ot)
{
- ot->name= "Duplicate Window";
- ot->idname= "WM_OT_window_duplicate";
- ot->description="Duplicate the current Blender window";
+ ot->name = "Duplicate Window";
+ ot->idname = "WM_OT_window_duplicate";
+ ot->description = "Duplicate the current Blender window";
- ot->exec= wm_window_duplicate_exec;
- ot->poll= wm_operator_winactive_normal;
+ ot->exec = wm_window_duplicate_exec;
+ ot->poll = wm_operator_winactive_normal;
}
static void WM_OT_save_homefile(wmOperatorType *ot)
{
- ot->name= "Save User Settings";
- ot->idname= "WM_OT_save_homefile";
- ot->description="Make the current file the default .blend file";
+ ot->name = "Save User Settings";
+ ot->idname = "WM_OT_save_homefile";
+ ot->description = "Make the current file the default .blend file";
- ot->invoke= WM_operator_confirm;
- ot->exec= WM_write_homefile;
- ot->poll= WM_operator_winactive;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = WM_write_homefile;
+ ot->poll = WM_operator_winactive;
}
static void WM_OT_read_homefile(wmOperatorType *ot)
{
- ot->name= "Reload Start-Up File";
- ot->idname= "WM_OT_read_homefile";
- ot->description="Open the default file (doesn't save the current file)";
+ ot->name = "Reload Start-Up File";
+ ot->idname = "WM_OT_read_homefile";
+ ot->description = "Open the default file (doesn't save the current file)";
- ot->invoke= WM_operator_confirm;
- ot->exec= WM_read_homefile_exec;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = WM_read_homefile_exec;
/* ommit poll to run in background mode */
}
static void WM_OT_read_factory_settings(wmOperatorType *ot)
{
- ot->name= "Load Factory Settings";
- ot->idname= "WM_OT_read_factory_settings";
- ot->description="Load default file and user preferences";
+ ot->name = "Load Factory Settings";
+ ot->idname = "WM_OT_read_factory_settings";
+ ot->description = "Load default file and user preferences";
- ot->invoke= WM_operator_confirm;
- ot->exec= WM_read_homefile_exec;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = WM_read_homefile_exec;
/* ommit poll to run in background mode */
}
@@ -1580,13 +1555,13 @@ static void WM_OT_read_factory_settings(wmOperatorType *ot)
static void open_set_load_ui(wmOperator *op)
{
- if(!RNA_struct_property_is_set(op->ptr, "load_ui"))
+ if (!RNA_struct_property_is_set(op->ptr, "load_ui"))
RNA_boolean_set(op->ptr, "load_ui", !(U.flag & USER_FILENOUI));
}
static void open_set_use_scripts(wmOperator *op)
{
- if(!RNA_struct_property_is_set(op->ptr, "use_scripts")) {
+ if (!RNA_struct_property_is_set(op->ptr, "use_scripts")) {
/* use G_SCRIPT_AUTOEXEC rather than the userpref because this means if
* the flag has been disabled from the command line, then opening
* from the menu wont enable this setting. */
@@ -1596,9 +1571,9 @@ static void open_set_use_scripts(wmOperator *op)
static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- const char *openname= G.main->name;
+ const char *openname = G.main->name;
- if(CTX_wm_window(C) == NULL) {
+ if (CTX_wm_window(C) == NULL) {
/* in rare cases this could happen, when trying to invoke in background
* mode on load for example. Don't use poll for this because exec()
* can still run without a window */
@@ -1629,12 +1604,12 @@ static int wm_open_mainfile_exec(bContext *C, wmOperator *op)
open_set_load_ui(op);
open_set_use_scripts(op);
- if(RNA_boolean_get(op->ptr, "load_ui"))
+ if (RNA_boolean_get(op->ptr, "load_ui"))
G.fileflags &= ~G_FILE_NO_UI;
else
G.fileflags |= G_FILE_NO_UI;
- if(RNA_boolean_get(op->ptr, "use_scripts"))
+ if (RNA_boolean_get(op->ptr, "use_scripts"))
G.f |= G_SCRIPT_AUTOEXEC;
else
G.f &= ~G_SCRIPT_AUTOEXEC;
@@ -1650,30 +1625,32 @@ static int wm_open_mainfile_exec(bContext *C, wmOperator *op)
static void WM_OT_open_mainfile(wmOperatorType *ot)
{
- ot->name= "Open Blender File";
- ot->idname= "WM_OT_open_mainfile";
- ot->description="Open a Blender file";
-
- ot->invoke= wm_open_mainfile_invoke;
- ot->exec= wm_open_mainfile_exec;
+ ot->name = "Open Blender File";
+ ot->idname = "WM_OT_open_mainfile";
+ ot->description = "Open a Blender file";
+
+ ot->invoke = wm_open_mainfile_invoke;
+ ot->exec = wm_open_mainfile_exec;
/* ommit window poll so this can work in background mode */
-
- WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
+
+ WM_operator_properties_filesel(ot, FOLDERFILE | BLENDERFILE, FILE_BLENDER, FILE_OPENFILE,
+ WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
RNA_def_boolean(ot->srna, "load_ui", 1, "Load UI", "Load user interface setup in the .blend file");
- RNA_def_boolean(ot->srna, "use_scripts", 1, "Trusted Source", "Allow blend file execute scripts automatically, default available from system preferences");
+ RNA_def_boolean(ot->srna, "use_scripts", 1, "Trusted Source",
+ "Allow .blend file to execute scripts automatically, default available from system preferences");
}
/* **************** link/append *************** */
int wm_link_append_poll(bContext *C)
{
- if(WM_operator_winactive(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) */
- if(CTX_data_edit_object(C))
+ * 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;
return 1;
@@ -1684,15 +1661,15 @@ int wm_link_append_poll(bContext *C)
static int wm_link_append_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- if(RNA_struct_property_is_set(op->ptr, "filepath")) {
+ if (RNA_struct_property_is_set(op->ptr, "filepath")) {
return WM_operator_call_notest(C, op);
}
else {
/* XXX TODO solve where to get last linked library from */
- if(G.lib[0] != '\0') {
+ if (G.lib[0] != '\0') {
RNA_string_set(op->ptr, "filepath", G.lib);
}
- else if(G.relbase_valid) {
+ else if (G.relbase_valid) {
char path[FILE_MAX];
BLI_strncpy(path, G.main->name, sizeof(G.main->name));
BLI_parent_dir(path);
@@ -1705,64 +1682,64 @@ static int wm_link_append_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev
static short wm_link_append_flag(wmOperator *op)
{
- short flag= 0;
+ short flag = 0;
- if(RNA_boolean_get(op->ptr, "autoselect")) flag |= FILE_AUTOSELECT;
- if(RNA_boolean_get(op->ptr, "active_layer")) flag |= FILE_ACTIVELAY;
- if(RNA_boolean_get(op->ptr, "relative_path")) flag |= FILE_RELPATH;
- if(RNA_boolean_get(op->ptr, "link")) flag |= FILE_LINK;
- if(RNA_boolean_get(op->ptr, "instance_groups")) flag |= FILE_GROUP_INSTANCE;
+ if (RNA_boolean_get(op->ptr, "autoselect")) flag |= FILE_AUTOSELECT;
+ if (RNA_boolean_get(op->ptr, "active_layer")) flag |= FILE_ACTIVELAY;
+ if (RNA_boolean_get(op->ptr, "relative_path")) flag |= FILE_RELPATH;
+ if (RNA_boolean_get(op->ptr, "link")) flag |= FILE_LINK;
+ if (RNA_boolean_get(op->ptr, "instance_groups")) flag |= FILE_GROUP_INSTANCE;
return flag;
}
static int wm_link_append_exec(bContext *C, wmOperator *op)
{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
- Main *mainl= NULL;
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
+ Main *mainl = NULL;
BlendHandle *bh;
PropertyRNA *prop;
char name[FILE_MAX], dir[FILE_MAX], libname[FILE_MAX], group[GROUP_MAX];
- int idcode, totfiles=0;
+ int idcode, totfiles = 0;
short flag;
RNA_string_get(op->ptr, "filename", name);
RNA_string_get(op->ptr, "directory", dir);
/* test if we have a valid data */
- if(BLO_is_a_library(dir, libname, group) == 0) {
+ if (BLO_is_a_library(dir, libname, group) == 0) {
BKE_report(op->reports, RPT_ERROR, "Not a library");
return OPERATOR_CANCELLED;
}
- else if(group[0] == 0) {
+ else if (group[0] == 0) {
BKE_report(op->reports, RPT_ERROR, "Nothing indicated");
return OPERATOR_CANCELLED;
}
- else if(BLI_path_cmp(bmain->name, libname) == 0) {
+ else if (BLI_path_cmp(bmain->name, libname) == 0) {
BKE_report(op->reports, RPT_ERROR, "Cannot use current file as library");
return OPERATOR_CANCELLED;
}
/* check if something is indicated for append/link */
prop = RNA_struct_find_property(op->ptr, "files");
- if(prop) {
- totfiles= RNA_property_collection_length(op->ptr, prop);
- if(totfiles == 0) {
- if(name[0] == '\0') {
+ if (prop) {
+ totfiles = RNA_property_collection_length(op->ptr, prop);
+ if (totfiles == 0) {
+ if (name[0] == '\0') {
BKE_report(op->reports, RPT_ERROR, "Nothing indicated");
return OPERATOR_CANCELLED;
}
}
}
- else if(name[0] == '\0') {
+ else if (name[0] == '\0') {
BKE_report(op->reports, RPT_ERROR, "Nothing indicated");
return OPERATOR_CANCELLED;
}
bh = BLO_blendhandle_from_file(libname, op->reports);
- if(bh == NULL) {
+ if (bh == NULL) {
/* unlikely since we just browsed it, but possible
* error reports will have been made by BLO_blendhandle_from_file() */
return OPERATOR_CANCELLED;
@@ -1774,16 +1751,16 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
idcode = BKE_idcode_from_name(group);
/* now we have or selected, or an indicated file */
- if(RNA_boolean_get(op->ptr, "autoselect"))
+ if (RNA_boolean_get(op->ptr, "autoselect"))
scene_deselect_all(scene);
flag = wm_link_append_flag(op);
/* sanity checks for flag */
- if(scene->id.lib && (flag & FILE_GROUP_INSTANCE)) {
+ if (scene->id.lib && (flag & FILE_GROUP_INSTANCE)) {
/* TODO, user never gets this message */
- BKE_reportf(op->reports, RPT_WARNING, "Scene '%s' is linked, group instance disabled", scene->id.name+2);
+ BKE_reportf(op->reports, RPT_WARNING, "Scene '%s' is linked, group instance disabled", scene->id.name + 2);
flag &= ~FILE_GROUP_INSTANCE;
}
@@ -1796,7 +1773,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
/* here appending/linking starts */
mainl = BLO_library_append_begin(bmain, &bh, libname);
- if(totfiles == 0) {
+ if (totfiles == 0) {
BLO_library_append_named_part_ex(C, mainl, &bh, name, idcode, flag);
}
else {
@@ -1812,10 +1789,10 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
recalc_all_library_objects(bmain);
/* append, rather than linking */
- if((flag & FILE_LINK)==0) {
- Library *lib= BLI_findstring(&bmain->library, libname, offsetof(Library, filepath));
- if(lib) BKE_library_make_local(bmain, lib, 1);
- else BLI_assert(!"cant find name of just added library!");
+ if ((flag & FILE_LINK) == 0) {
+ Library *lib = BLI_findstring(&bmain->library, libname, offsetof(Library, filepath));
+ if (lib) BKE_library_make_local(bmain, lib, 1);
+ else BLI_assert(!"cant find name of just added library!");
}
/* important we unset, otherwise these object wont
@@ -1838,20 +1815,20 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
static void WM_OT_link_append(wmOperatorType *ot)
{
- ot->name= "Link/Append from Library";
- ot->idname= "WM_OT_link_append";
- ot->description= "Link or Append from a Library .blend file";
+ ot->name = "Link/Append from Library";
+ ot->idname = "WM_OT_link_append";
+ ot->description = "Link or Append from a Library .blend file";
- ot->invoke= wm_link_append_invoke;
- ot->exec= wm_link_append_exec;
- ot->poll= wm_link_append_poll;
+ ot->invoke = wm_link_append_invoke;
+ ot->exec = wm_link_append_exec;
+ ot->poll = wm_link_append_poll;
ot->flag |= OPTYPE_UNDO;
WM_operator_properties_filesel(
- ot, FOLDERFILE|BLENDERFILE, FILE_LOADLIB, FILE_OPENFILE,
- WM_FILESEL_FILEPATH|WM_FILESEL_DIRECTORY|WM_FILESEL_FILENAME|WM_FILESEL_RELPATH|WM_FILESEL_FILES,
- FILE_DEFAULTDISPLAY);
+ ot, FOLDERFILE | BLENDERFILE, FILE_LOADLIB, FILE_OPENFILE,
+ WM_FILESEL_FILEPATH | WM_FILESEL_DIRECTORY | WM_FILESEL_FILENAME | WM_FILESEL_RELPATH | WM_FILESEL_FILES,
+ FILE_DEFAULTDISPLAY);
RNA_def_boolean(ot->srna, "link", 1, "Link", "Link the objects or datablocks rather than appending");
RNA_def_boolean(ot->srna, "autoselect", 1, "Select", "Select the linked objects");
@@ -1881,12 +1858,12 @@ static int wm_recover_last_session_exec(bContext *C, wmOperator *op)
static void WM_OT_recover_last_session(wmOperatorType *ot)
{
- ot->name= "Recover Last Session";
- ot->idname= "WM_OT_recover_last_session";
- ot->description="Open the last closed file (\"quit.blend\")";
+ ot->name = "Recover Last Session";
+ ot->idname = "WM_OT_recover_last_session";
+ ot->description = "Open the last closed file (\"quit.blend\")";
- ot->exec= wm_recover_last_session_exec;
- ot->poll= WM_operator_winactive;
+ ot->exec = wm_recover_last_session_exec;
+ ot->poll = WM_operator_winactive;
}
/* *************** recover auto save **************** */
@@ -1924,13 +1901,13 @@ static int wm_recover_auto_save_invoke(bContext *C, wmOperator *op, wmEvent *UNU
static void WM_OT_recover_auto_save(wmOperatorType *ot)
{
- ot->name= "Recover Auto Save";
- ot->idname= "WM_OT_recover_auto_save";
- ot->description="Open an automatically saved file to recover it";
+ ot->name = "Recover Auto Save";
+ ot->idname = "WM_OT_recover_auto_save";
+ ot->description = "Open an automatically saved file to recover it";
- ot->exec= wm_recover_auto_save_exec;
- ot->invoke= wm_recover_auto_save_invoke;
- ot->poll= WM_operator_winactive;
+ ot->exec = wm_recover_auto_save_exec;
+ ot->invoke = wm_recover_auto_save_invoke;
+ ot->poll = WM_operator_winactive;
WM_operator_properties_filesel(ot, BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_LONGDISPLAY);
}
@@ -1939,10 +1916,10 @@ static void WM_OT_recover_auto_save(wmOperatorType *ot)
static void untitled(char *name)
{
- if(G.save_over == 0 && strlen(name) < FILE_MAX-16) {
- char *c= BLI_last_slash(name);
+ if (G.save_over == 0 && strlen(name) < FILE_MAX - 16) {
+ char *c = BLI_last_slash(name);
- if(c)
+ if (c)
strcpy(&c[1], "untitled.blend");
else
strcpy(name, "untitled.blend");
@@ -1951,8 +1928,8 @@ static void untitled(char *name)
static void save_set_compress(wmOperator *op)
{
- if(!RNA_struct_property_is_set(op->ptr, "compress")) {
- if(G.save_over) /* keep flag for existing file */
+ if (!RNA_struct_property_is_set(op->ptr, "compress")) {
+ if (G.save_over) /* keep flag for existing file */
RNA_boolean_set(op->ptr, "compress", G.fileflags & G_FILE_COMPRESS);
else /* use userdef for new file */
RNA_boolean_set(op->ptr, "compress", U.flag & USER_FILECOMPRESS);
@@ -1966,7 +1943,7 @@ static int wm_save_as_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUS
save_set_compress(op);
/* if not saved before, get the name of the most recently used .blend file */
- if(G.main->name[0]==0 && G.recent_files.first) {
+ if (G.main->name[0] == 0 && G.recent_files.first) {
struct RecentFile *recent = G.recent_files.first;
BLI_strncpy(name, recent->filepath, FILE_MAX);
}
@@ -1986,42 +1963,42 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
{
char path[FILE_MAX];
int fileflags;
- int copy=0;
+ int copy = 0;
save_set_compress(op);
- if(RNA_struct_property_is_set(op->ptr, "filepath"))
+ if (RNA_struct_property_is_set(op->ptr, "filepath"))
RNA_string_get(op->ptr, "filepath", path);
else {
BLI_strncpy(path, G.main->name, FILE_MAX);
untitled(path);
}
- if(RNA_struct_property_is_set(op->ptr, "copy"))
+ if (RNA_struct_property_is_set(op->ptr, "copy"))
copy = RNA_boolean_get(op->ptr, "copy");
- fileflags= G.fileflags;
+ fileflags = G.fileflags;
/* set compression flag */
- if(RNA_boolean_get(op->ptr, "compress")) fileflags |= G_FILE_COMPRESS;
- else fileflags &= ~G_FILE_COMPRESS;
- if(RNA_boolean_get(op->ptr, "relative_remap")) fileflags |= G_FILE_RELATIVE_REMAP;
- else fileflags &= ~G_FILE_RELATIVE_REMAP;
+ if (RNA_boolean_get(op->ptr, "compress")) fileflags |= G_FILE_COMPRESS;
+ else fileflags &= ~G_FILE_COMPRESS;
+ if (RNA_boolean_get(op->ptr, "relative_remap")) fileflags |= G_FILE_RELATIVE_REMAP;
+ else fileflags &= ~G_FILE_RELATIVE_REMAP;
#ifdef USE_BMESH_SAVE_AS_COMPAT
/* property only exists for 'Save As' */
if (RNA_struct_find_property(op->ptr, "use_mesh_compat")) {
- if(RNA_boolean_get(op->ptr, "use_mesh_compat")) fileflags |= G_FILE_MESH_COMPAT;
- else fileflags &= ~G_FILE_MESH_COMPAT;
+ if (RNA_boolean_get(op->ptr, "use_mesh_compat")) fileflags |= G_FILE_MESH_COMPAT;
+ else fileflags &= ~G_FILE_MESH_COMPAT;
}
else {
fileflags &= ~G_FILE_MESH_COMPAT;
}
#endif
- if ( WM_write_file(C, path, fileflags, op->reports, copy) != 0)
+ if (WM_write_file(C, path, fileflags, op->reports, copy) != 0)
return OPERATOR_CANCELLED;
- WM_event_add_notifier(C, NC_WM|ND_FILESAVE, NULL);
+ WM_event_add_notifier(C, NC_WM | ND_FILESAVE, NULL);
return OPERATOR_FINISHED;
}
@@ -2031,7 +2008,7 @@ static int blend_save_check(bContext *UNUSED(C), wmOperator *op)
{
char filepath[FILE_MAX];
RNA_string_get(op->ptr, "filepath", filepath);
- if(!BLO_has_bfile_extension(filepath)) {
+ if (!BLO_has_bfile_extension(filepath)) {
/* some users would prefer BLI_replace_extension(),
* we keep getting knit-picking bug reports about this - campbell */
BLI_ensure_extension(filepath, FILE_MAX, ".blend");
@@ -2043,16 +2020,16 @@ static int blend_save_check(bContext *UNUSED(C), wmOperator *op)
static void WM_OT_save_as_mainfile(wmOperatorType *ot)
{
- ot->name= "Save As Blender File";
- ot->idname= "WM_OT_save_as_mainfile";
- ot->description="Save the current file in the desired location";
+ ot->name = "Save As Blender File";
+ ot->idname = "WM_OT_save_as_mainfile";
+ ot->description = "Save the current file in the desired location";
- ot->invoke= wm_save_as_mainfile_invoke;
- ot->exec= wm_save_as_mainfile_exec;
- ot->check= blend_save_check;
+ ot->invoke = wm_save_as_mainfile_invoke;
+ ot->exec = wm_save_as_mainfile_exec;
+ ot->check = blend_save_check;
/* ommit window poll so this can work in background mode */
- WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | BLENDERFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
RNA_def_boolean(ot->srna, "compress", 0, "Compress", "Write compressed .blend file");
RNA_def_boolean(ot->srna, "relative_remap", 1, "Remap Relative", "Remap relative paths when saving in a different directory");
RNA_def_boolean(ot->srna, "copy", 0, "Save Copy", "Save a copy of the actual working state but does not make saved file active");
@@ -2066,7 +2043,7 @@ static void WM_OT_save_as_mainfile(wmOperatorType *ot)
static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
char name[FILE_MAX];
- int check_existing=1;
+ int check_existing = 1;
int ret;
/* cancel if no active window */
@@ -2076,7 +2053,7 @@ static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(
save_set_compress(op);
/* if not saved before, get the name of the most recently used .blend file */
- if(G.main->name[0]==0 && G.recent_files.first) {
+ if (G.main->name[0] == 0 && G.recent_files.first) {
struct RecentFile *recent = G.recent_files.first;
BLI_strncpy(name, recent->filepath, FILE_MAX);
}
@@ -2088,21 +2065,21 @@ static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(
RNA_string_set(op->ptr, "filepath", name);
if (RNA_struct_find_property(op->ptr, "check_existing"))
- if (RNA_boolean_get(op->ptr, "check_existing")==0)
+ if (RNA_boolean_get(op->ptr, "check_existing") == 0)
check_existing = 0;
if (G.save_over) {
if (check_existing && BLI_exists(name)) {
uiPupMenuSaveOver(C, op, name);
- ret= OPERATOR_RUNNING_MODAL;
+ ret = OPERATOR_RUNNING_MODAL;
}
else {
- ret= wm_save_as_mainfile_exec(C, op);
+ ret = wm_save_as_mainfile_exec(C, op);
}
}
else {
WM_event_add_fileselect(C, op);
- ret= OPERATOR_RUNNING_MODAL;
+ ret = OPERATOR_RUNNING_MODAL;
}
return ret;
@@ -2110,16 +2087,16 @@ static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(
static void WM_OT_save_mainfile(wmOperatorType *ot)
{
- ot->name= "Save Blender File";
- ot->idname= "WM_OT_save_mainfile";
- ot->description="Save the current Blender file";
+ ot->name = "Save Blender File";
+ ot->idname = "WM_OT_save_mainfile";
+ ot->description = "Save the current Blender file";
- ot->invoke= wm_save_mainfile_invoke;
- ot->exec= wm_save_as_mainfile_exec;
- ot->check= blend_save_check;
+ ot->invoke = wm_save_mainfile_invoke;
+ ot->exec = wm_save_as_mainfile_exec;
+ ot->check = blend_save_check;
/* ommit window poll so this can work in background mode */
- WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | BLENDERFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
RNA_def_boolean(ot->srna, "compress", 0, "Compress", "Write compressed .blend file");
RNA_def_boolean(ot->srna, "relative_remap", 0, "Remap Relative", "Remap relative paths when saving in a different directory");
}
@@ -2131,7 +2108,7 @@ static void WM_OT_save_mainfile(wmOperatorType *ot)
static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- if(!RNA_struct_property_is_set(op->ptr, "filepath")) {
+ if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
char filepath[FILE_MAX];
BLI_strncpy(filepath, G.main->name, sizeof(filepath));
BLI_replace_extension(filepath, sizeof(filepath), ".dae");
@@ -2149,7 +2126,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
char filename[FILE_MAX];
int selected, second_life;
- if(!RNA_struct_property_is_set(op->ptr, "filepath")) {
+ if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
BKE_report(op->reports, RPT_ERROR, "No filename given");
return OPERATOR_CANCELLED;
}
@@ -2157,7 +2134,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filepath", filename);
selected = RNA_boolean_get(op->ptr, "selected");
second_life = RNA_boolean_get(op->ptr, "second_life");
- if(collada_export(CTX_data_scene(C), filename, selected, second_life)) {
+ if (collada_export(CTX_data_scene(C), filename, selected, second_life)) {
return OPERATOR_FINISHED;
}
else {
@@ -2167,18 +2144,18 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
static void WM_OT_collada_export(wmOperatorType *ot)
{
- ot->name= "Export COLLADA";
- ot->idname= "WM_OT_collada_export";
+ ot->name = "Export COLLADA";
+ ot->idname = "WM_OT_collada_export";
- ot->invoke= wm_collada_export_invoke;
- ot->exec= wm_collada_export_exec;
- ot->poll= WM_operator_winactive;
+ ot->invoke = wm_collada_export_invoke;
+ ot->exec = wm_collada_export_exec;
+ ot->poll = WM_operator_winactive;
- WM_operator_properties_filesel(ot, FOLDERFILE|COLLADAFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | COLLADAFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
RNA_def_boolean(ot->srna, "selected", 0, "Export only selected",
- "Export only selected elements");
+ "Export only selected elements");
RNA_def_boolean(ot->srna, "second_life", 0, "Export for Second Life",
- "Compatibility mode for Second Life");
+ "Compatibility mode for Second Life");
}
/* function used for WM_OT_save_mainfile too */
@@ -2186,13 +2163,13 @@ static int wm_collada_import_exec(bContext *C, wmOperator *op)
{
char filename[FILE_MAX];
- if(!RNA_struct_property_is_set(op->ptr, "filepath")) {
+ if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
BKE_report(op->reports, RPT_ERROR, "No filename given");
return OPERATOR_CANCELLED;
}
RNA_string_get(op->ptr, "filepath", filename);
- if(collada_import(C, filename)) return OPERATOR_FINISHED;
+ if (collada_import(C, filename)) return OPERATOR_FINISHED;
BKE_report(op->reports, RPT_ERROR, "Errors found during parsing COLLADA document. Please see console for error log.");
@@ -2201,14 +2178,14 @@ static int wm_collada_import_exec(bContext *C, wmOperator *op)
static void WM_OT_collada_import(wmOperatorType *ot)
{
- ot->name= "Import COLLADA";
- ot->idname= "WM_OT_collada_import";
+ ot->name = "Import COLLADA";
+ ot->idname = "WM_OT_collada_import";
- ot->invoke= WM_operator_filesel;
- ot->exec= wm_collada_import_exec;
- ot->poll= WM_operator_winactive;
+ ot->invoke = WM_operator_filesel;
+ ot->exec = wm_collada_import_exec;
+ ot->poll = WM_operator_winactive;
- WM_operator_properties_filesel(ot, FOLDERFILE|COLLADAFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | COLLADAFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
}
#endif
@@ -2218,12 +2195,12 @@ static void WM_OT_collada_import(wmOperatorType *ot)
static void WM_OT_window_fullscreen_toggle(wmOperatorType *ot)
{
- ot->name= "Toggle Fullscreen";
- ot->idname= "WM_OT_window_fullscreen_toggle";
- ot->description="Toggle the current window fullscreen";
+ ot->name = "Toggle Fullscreen";
+ ot->idname = "WM_OT_window_fullscreen_toggle";
+ ot->description = "Toggle the current window fullscreen";
- ot->exec= wm_window_fullscreen_toggle_exec;
- ot->poll= WM_operator_winactive;
+ ot->exec = wm_window_fullscreen_toggle_exec;
+ ot->poll = WM_operator_winactive;
}
static int wm_exit_blender_op(bContext *C, wmOperator *op)
@@ -2237,13 +2214,13 @@ static int wm_exit_blender_op(bContext *C, wmOperator *op)
static void WM_OT_quit_blender(wmOperatorType *ot)
{
- ot->name= "Quit Blender";
- ot->idname= "WM_OT_quit_blender";
- ot->description= "Quit Blender";
+ ot->name = "Quit Blender";
+ ot->idname = "WM_OT_quit_blender";
+ ot->description = "Quit Blender";
- ot->invoke= WM_operator_confirm;
- ot->exec= wm_exit_blender_op;
- ot->poll= WM_operator_winactive;
+ ot->invoke = WM_operator_confirm;
+ ot->exec = wm_exit_blender_op;
+ ot->poll = WM_operator_winactive;
}
/* *********************** */
@@ -2258,33 +2235,33 @@ static int wm_console_toggle_op(bContext *UNUSED(C), wmOperator *UNUSED(op))
static void WM_OT_console_toggle(wmOperatorType *ot)
{
- ot->name= "Toggle System Console";
- ot->idname= "WM_OT_console_toggle";
- ot->description= "Toggle System Console";
+ ot->name = "Toggle System Console";
+ ot->idname = "WM_OT_console_toggle";
+ ot->description = "Toggle System Console";
- ot->exec= wm_console_toggle_op;
- ot->poll= WM_operator_winactive;
+ ot->exec = wm_console_toggle_op;
+ ot->poll = WM_operator_winactive;
}
#endif
/* ************ 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)
+ wmPaintCursorDraw draw, void *customdata)
{
- wmPaintCursor *pc= MEM_callocN(sizeof(wmPaintCursor), "paint cursor");
+ wmPaintCursor *pc = MEM_callocN(sizeof(wmPaintCursor), "paint cursor");
BLI_addtail(&wm->paintcursors, pc);
pc->customdata = customdata;
- pc->poll= poll;
- pc->draw= draw;
+ pc->poll = poll;
+ pc->draw = draw;
return pc;
}
@@ -2293,8 +2270,8 @@ void WM_paint_cursor_end(wmWindowManager *wm, void *handle)
{
wmPaintCursor *pc;
- for(pc= wm->paintcursors.first; pc; pc= pc->next) {
- if(pc == (wmPaintCursor *)handle) {
+ for (pc = wm->paintcursors.first; pc; pc = pc->next) {
+ if (pc == (wmPaintCursor *)handle) {
BLI_remlink(&wm->paintcursors, pc);
MEM_freeN(pc);
return;
@@ -2310,18 +2287,18 @@ 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)
{
- wmGesture *gesture= op->customdata;
- rcti *rect= gesture->customdata;
+ wmGesture *gesture = op->customdata;
+ rcti *rect = gesture->customdata;
- if(rect->xmin==rect->xmax || rect->ymin==rect->ymax)
+ if (rect->xmin == rect->xmax || rect->ymin == rect->ymax)
return 0;
@@ -2340,7 +2317,7 @@ static int border_apply(bContext *C, wmOperator *op, int gesture_mode)
return 0;
/* XXX weak; border should be configured for this without reading event types */
- if( RNA_struct_find_property(op->ptr, "gesture_mode") )
+ if (RNA_struct_find_property(op->ptr, "gesture_mode") )
RNA_int_set(op->ptr, "gesture_mode", gesture_mode);
op->type->exec(C, op);
@@ -2349,23 +2326,23 @@ static int border_apply(bContext *C, wmOperator *op, int gesture_mode)
static void wm_gesture_end(bContext *C, wmOperator *op)
{
- wmGesture *gesture= op->customdata;
+ wmGesture *gesture = op->customdata;
- WM_gesture_end(C, gesture); /* frees gesture itself, and unregisters from window */
- op->customdata= NULL;
+ WM_gesture_end(C, gesture); /* frees gesture itself, and unregisters from window */
+ op->customdata = NULL;
ED_area_tag_redraw(CTX_wm_area(C));
- if( RNA_struct_find_property(op->ptr, "cursor") )
+ if (RNA_struct_find_property(op->ptr, "cursor") )
WM_cursor_restore(CTX_wm_window(C));
}
int WM_border_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if(ISTWEAK(event->type))
- op->customdata= WM_gesture_new(C, event, WM_GESTURE_RECT);
+ if (ISTWEAK(event->type))
+ op->customdata = WM_gesture_new(C, event, WM_GESTURE_RECT);
else
- op->customdata= WM_gesture_new(C, event, WM_GESTURE_CROSS_RECT);
+ op->customdata = WM_gesture_new(C, event, WM_GESTURE_CROSS_RECT);
/* add modal handler */
WM_event_add_modal_handler(C, op);
@@ -2377,48 +2354,48 @@ int WM_border_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
int WM_border_select_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- wmGesture *gesture= op->customdata;
- rcti *rect= gesture->customdata;
+ wmGesture *gesture = op->customdata;
+ rcti *rect = gesture->customdata;
int sx, sy;
- if(event->type== MOUSEMOVE) {
+ if (event->type == MOUSEMOVE) {
wm_subwindow_getorigin(CTX_wm_window(C), gesture->swinid, &sx, &sy);
- if(gesture->type==WM_GESTURE_CROSS_RECT && gesture->mode==0) {
- rect->xmin= rect->xmax= event->x - sx;
- rect->ymin= rect->ymax= event->y - sy;
+ if (gesture->type == WM_GESTURE_CROSS_RECT && gesture->mode == 0) {
+ rect->xmin = rect->xmax = event->x - sx;
+ rect->ymin = rect->ymax = event->y - sy;
}
else {
- rect->xmax= event->x - sx;
- rect->ymax= event->y - sy;
+ rect->xmax = event->x - sx;
+ rect->ymax = event->y - sy;
}
border_apply_rect(op);
wm_gesture_tag_redraw(C);
}
- else if (event->type==EVT_MODAL_MAP) {
+ else if (event->type == EVT_MODAL_MAP) {
switch (event->val) {
- case GESTURE_MODAL_BEGIN:
- if(gesture->type==WM_GESTURE_CROSS_RECT && gesture->mode==0) {
- gesture->mode= 1;
- wm_gesture_tag_redraw(C);
- }
- break;
- case GESTURE_MODAL_SELECT:
- case GESTURE_MODAL_DESELECT:
- case GESTURE_MODAL_IN:
- case GESTURE_MODAL_OUT:
- if(border_apply(C, op, event->val)) {
+ case GESTURE_MODAL_BEGIN:
+ if (gesture->type == WM_GESTURE_CROSS_RECT && gesture->mode == 0) {
+ gesture->mode = 1;
+ wm_gesture_tag_redraw(C);
+ }
+ break;
+ case GESTURE_MODAL_SELECT:
+ case GESTURE_MODAL_DESELECT:
+ case GESTURE_MODAL_IN:
+ case GESTURE_MODAL_OUT:
+ if (border_apply(C, op, event->val)) {
+ wm_gesture_end(C, op);
+ return OPERATOR_FINISHED;
+ }
wm_gesture_end(C, op);
- return OPERATOR_FINISHED;
- }
- wm_gesture_end(C, op);
- return OPERATOR_CANCELLED;
- break;
+ return OPERATOR_CANCELLED;
+ break;
- case GESTURE_MODAL_CANCEL:
- wm_gesture_end(C, op);
- return OPERATOR_CANCELLED;
+ case GESTURE_MODAL_CANCEL:
+ wm_gesture_end(C, op);
+ return OPERATOR_CANCELLED;
}
}
@@ -2441,12 +2418,12 @@ int WM_border_select_cancel(bContext *C, wmOperator *op)
/* works now only for selection or modal paint stuff, calls exec while hold mouse, exit on release */
#ifdef GESTURE_MEMORY
-int circle_select_size= 25; // XXX - need some operator memory thing\!
+int circle_select_size = 25; // XXX - need some operator memory thing\!
#endif
int WM_gesture_circle_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- op->customdata= WM_gesture_new(C, event, WM_GESTURE_CIRCLE);
+ op->customdata = WM_gesture_new(C, event, WM_GESTURE_CIRCLE);
/* add modal handler */
WM_event_add_modal_handler(C, op);
@@ -2458,10 +2435,10 @@ int WM_gesture_circle_invoke(bContext *C, wmOperator *op, wmEvent *event)
static void gesture_circle_apply(bContext *C, wmOperator *op)
{
- wmGesture *gesture= op->customdata;
- rcti *rect= gesture->customdata;
+ wmGesture *gesture = op->customdata;
+ rcti *rect = gesture->customdata;
- if(RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_NOP)
+ if (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_NOP)
return;
/* operator arguments and storage. */
@@ -2469,59 +2446,59 @@ static void gesture_circle_apply(bContext *C, wmOperator *op)
RNA_int_set(op->ptr, "y", rect->ymin);
RNA_int_set(op->ptr, "radius", rect->xmax);
- if(op->type->exec)
+ if (op->type->exec)
op->type->exec(C, op);
#ifdef GESTURE_MEMORY
- circle_select_size= rect->xmax;
+ circle_select_size = rect->xmax;
#endif
}
int WM_gesture_circle_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- wmGesture *gesture= op->customdata;
- rcti *rect= gesture->customdata;
+ wmGesture *gesture = op->customdata;
+ rcti *rect = gesture->customdata;
int sx, sy;
- if(event->type== MOUSEMOVE) {
+ if (event->type == MOUSEMOVE) {
wm_subwindow_getorigin(CTX_wm_window(C), gesture->swinid, &sx, &sy);
- rect->xmin= event->x - sx;
- rect->ymin= event->y - sy;
+ rect->xmin = event->x - sx;
+ rect->ymin = event->y - sy;
wm_gesture_tag_redraw(C);
- if(gesture->mode)
+ if (gesture->mode)
gesture_circle_apply(C, op);
}
- else if (event->type==EVT_MODAL_MAP) {
+ else if (event->type == EVT_MODAL_MAP) {
switch (event->val) {
- case GESTURE_MODAL_CIRCLE_ADD:
- rect->xmax += 2 + rect->xmax/10;
- wm_gesture_tag_redraw(C);
- break;
- case GESTURE_MODAL_CIRCLE_SUB:
- rect->xmax -= 2 + rect->xmax/10;
- if(rect->xmax < 1) rect->xmax= 1;
- wm_gesture_tag_redraw(C);
- break;
- case GESTURE_MODAL_SELECT:
- case GESTURE_MODAL_DESELECT:
- case GESTURE_MODAL_NOP:
- if(RNA_struct_find_property(op->ptr, "gesture_mode"))
- RNA_int_set(op->ptr, "gesture_mode", event->val);
-
- if(event->val != GESTURE_MODAL_NOP) {
- /* apply first click */
- gesture_circle_apply(C, op);
- gesture->mode= 1;
+ case GESTURE_MODAL_CIRCLE_ADD:
+ rect->xmax += 2 + rect->xmax / 10;
wm_gesture_tag_redraw(C);
- }
- break;
+ break;
+ case GESTURE_MODAL_CIRCLE_SUB:
+ rect->xmax -= 2 + rect->xmax / 10;
+ if (rect->xmax < 1) rect->xmax = 1;
+ wm_gesture_tag_redraw(C);
+ break;
+ case GESTURE_MODAL_SELECT:
+ case GESTURE_MODAL_DESELECT:
+ case GESTURE_MODAL_NOP:
+ if (RNA_struct_find_property(op->ptr, "gesture_mode"))
+ RNA_int_set(op->ptr, "gesture_mode", event->val);
+
+ if (event->val != GESTURE_MODAL_NOP) {
+ /* apply first click */
+ gesture_circle_apply(C, op);
+ gesture->mode = 1;
+ wm_gesture_tag_redraw(C);
+ }
+ break;
- case GESTURE_MODAL_CANCEL:
- case GESTURE_MODAL_CONFIRM:
- wm_gesture_end(C, op);
- return OPERATOR_FINISHED; /* use finish or we dont get an undo */
+ case GESTURE_MODAL_CANCEL:
+ case GESTURE_MODAL_CONFIRM:
+ wm_gesture_end(C, op);
+ return OPERATOR_FINISHED; /* use finish or we don't get an undo */
}
}
// // Allow view navigation???
@@ -2543,14 +2520,14 @@ int WM_gesture_circle_cancel(bContext *C, wmOperator *op)
/* template to copy from */
void WM_OT_circle_gesture(wmOperatorType *ot)
{
- ot->name= "Circle Gesture";
- ot->idname= "WM_OT_circle_gesture";
- ot->description="Enter rotate mode with a circular gesture";
+ ot->name = "Circle Gesture";
+ ot->idname = "WM_OT_circle_gesture";
+ ot->description = "Enter rotate mode with a circular gesture";
- ot->invoke= WM_gesture_circle_invoke;
- ot->modal= WM_gesture_circle_modal;
+ ot->invoke = WM_gesture_circle_invoke;
+ ot->modal = WM_gesture_circle_modal;
- ot->poll= WM_operator_winactive;
+ ot->poll = WM_operator_winactive;
RNA_def_property(ot->srna, "x", PROP_INT, PROP_NONE);
RNA_def_property(ot->srna, "y", PROP_INT, PROP_NONE);
@@ -2563,35 +2540,35 @@ void WM_OT_circle_gesture(wmOperatorType *ot)
static void tweak_gesture_modal(bContext *C, wmEvent *event)
{
- wmWindow *window= CTX_wm_window(C);
- wmGesture *gesture= window->tweak;
- rcti *rect= gesture->customdata;
+ wmWindow *window = CTX_wm_window(C);
+ wmGesture *gesture = window->tweak;
+ rcti *rect = gesture->customdata;
int sx, sy, val;
- switch(event->type) {
+ switch (event->type) {
case MOUSEMOVE:
case INBETWEEN_MOUSEMOVE:
wm_subwindow_getorigin(window, gesture->swinid, &sx, &sy);
- rect->xmax= event->x - sx;
- rect->ymax= event->y - sy;
+ rect->xmax = event->x - sx;
+ rect->ymax = event->y - sy;
- if((val= wm_gesture_evaluate(gesture))) {
+ if ((val = wm_gesture_evaluate(gesture))) {
wmEvent tevent;
- tevent= *(window->eventstate);
- if(gesture->event_type==LEFTMOUSE)
- tevent.type= EVT_TWEAK_L;
- else if(gesture->event_type==RIGHTMOUSE)
- tevent.type= EVT_TWEAK_R;
+ tevent = *(window->eventstate);
+ if (gesture->event_type == LEFTMOUSE)
+ tevent.type = EVT_TWEAK_L;
+ else if (gesture->event_type == RIGHTMOUSE)
+ tevent.type = EVT_TWEAK_R;
else
- tevent.type= EVT_TWEAK_M;
- tevent.val= val;
+ tevent.type = EVT_TWEAK_M;
+ tevent.val = val;
/* mouse coords! */
wm_event_add(window, &tevent);
- WM_gesture_end(C, gesture); /* frees gesture itself, and unregisters from window */
+ WM_gesture_end(C, gesture); /* frees gesture itself, and unregisters from window */
}
break;
@@ -2599,15 +2576,15 @@ static void tweak_gesture_modal(bContext *C, wmEvent *event)
case LEFTMOUSE:
case RIGHTMOUSE:
case MIDDLEMOUSE:
- if(gesture->event_type==event->type) {
+ if (gesture->event_type == event->type) {
WM_gesture_end(C, gesture);
/* when tweak fails we should give the other keymap entries a chance */
- event->val= KM_RELEASE;
+ event->val = KM_RELEASE;
}
break;
default:
- if(!ISTIMER(event->type)) {
+ if (!ISTIMER(event->type)) {
WM_gesture_end(C, gesture);
}
break;
@@ -2617,19 +2594,19 @@ static void tweak_gesture_modal(bContext *C, wmEvent *event)
/* standard tweak, called after window handlers passed on event */
void wm_tweakevent_test(bContext *C, wmEvent *event, int action)
{
- wmWindow *win= CTX_wm_window(C);
+ wmWindow *win = CTX_wm_window(C);
- if(win->tweak==NULL) {
- if(CTX_wm_region(C)) {
- if(event->val==KM_PRESS) {
- if( ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) )
- win->tweak= WM_gesture_new(C, event, WM_GESTURE_TWEAK);
+ if (win->tweak == NULL) {
+ if (CTX_wm_region(C)) {
+ if (event->val == KM_PRESS) {
+ if (ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) )
+ win->tweak = WM_gesture_new(C, event, WM_GESTURE_TWEAK);
}
}
}
else {
/* no tweaks if event was handled */
- if((action & WM_HANDLER_BREAK)) {
+ if ((action & WM_HANDLER_BREAK)) {
WM_gesture_end(C, win->tweak);
}
else
@@ -2641,14 +2618,14 @@ void wm_tweakevent_test(bContext *C, wmEvent *event, int action)
int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- op->customdata= WM_gesture_new(C, event, WM_GESTURE_LASSO);
+ op->customdata = WM_gesture_new(C, event, WM_GESTURE_LASSO);
/* add modal handler */
WM_event_add_modal_handler(C, op);
wm_gesture_tag_redraw(C);
- if( RNA_struct_find_property(op->ptr, "cursor") )
+ if (RNA_struct_find_property(op->ptr, "cursor") )
WM_cursor_modal(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
return OPERATOR_RUNNING_MODAL;
@@ -2656,14 +2633,14 @@ int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, wmEvent *event)
int WM_gesture_lines_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- op->customdata= WM_gesture_new(C, event, WM_GESTURE_LINES);
+ op->customdata = WM_gesture_new(C, event, WM_GESTURE_LINES);
/* add modal handler */
WM_event_add_modal_handler(C, op);
wm_gesture_tag_redraw(C);
- if( RNA_struct_find_property(op->ptr, "cursor") )
+ if (RNA_struct_find_property(op->ptr, "cursor") )
WM_cursor_modal(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
return OPERATOR_RUNNING_MODAL;
@@ -2672,33 +2649,34 @@ int WM_gesture_lines_invoke(bContext *C, wmOperator *op, wmEvent *event)
static void gesture_lasso_apply(bContext *C, wmOperator *op)
{
- wmGesture *gesture= op->customdata;
+ wmGesture *gesture = op->customdata;
PointerRNA itemptr;
float loc[2];
int i;
- short *lasso= gesture->customdata;
+ short *lasso = gesture->customdata;
/* operator storage as path. */
- for(i=0; i<gesture->points; i++, lasso+=2) {
- loc[0]= lasso[0];
- loc[1]= lasso[1];
+ RNA_collection_clear(op->ptr, "path");
+ for (i = 0; i < gesture->points; i++, lasso += 2) {
+ loc[0] = lasso[0];
+ loc[1] = lasso[1];
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
}
wm_gesture_end(C, op);
- if(op->type->exec)
+ if (op->type->exec)
op->type->exec(C, op);
}
int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- wmGesture *gesture= op->customdata;
+ wmGesture *gesture = op->customdata;
int sx, sy;
- switch(event->type) {
+ switch (event->type) {
case MOUSEMOVE:
case INBETWEEN_MOUSEMOVE:
@@ -2706,10 +2684,10 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event)
wm_subwindow_getorigin(CTX_wm_window(C), gesture->swinid, &sx, &sy);
- if(gesture->points == gesture->size) {
+ if (gesture->points == gesture->size) {
short *old_lasso = gesture->customdata;
- gesture->customdata= MEM_callocN(2*sizeof(short)*(gesture->size + WM_LASSO_MIN_POINTS), "lasso points");
- memcpy(gesture->customdata, old_lasso, 2*sizeof(short)*gesture->size);
+ gesture->customdata = MEM_callocN(2 * sizeof(short) * (gesture->size + WM_LASSO_MIN_POINTS), "lasso points");
+ memcpy(gesture->customdata, old_lasso, 2 * sizeof(short) * gesture->size);
gesture->size = gesture->size + WM_LASSO_MIN_POINTS;
MEM_freeN(old_lasso);
// printf("realloc\n");
@@ -2717,15 +2695,15 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event)
{
int x, y;
- short *lasso= gesture->customdata;
+ short *lasso = gesture->customdata;
lasso += (2 * gesture->points - 2);
x = (event->x - sx - lasso[0]);
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 */
- if((x*x+y*y) > 4) {
+ * 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;
lasso[1] = event->y - sy;
@@ -2737,7 +2715,7 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event)
case LEFTMOUSE:
case MIDDLEMOUSE:
case RIGHTMOUSE:
- if(event->val==KM_RELEASE) { /* key release */
+ if (event->val == KM_RELEASE) { /* key release */
gesture_lasso_apply(C, op);
return OPERATOR_FINISHED;
}
@@ -2773,7 +2751,8 @@ int WM_gesture_lines_cancel(bContext *C, wmOperator *op)
static int gesture_lasso_exec(bContext *C, wmOperator *op)
{
- RNA_BEGIN(op->ptr, itemptr, "path") {
+ RNA_BEGIN(op->ptr, itemptr, "path")
+ {
float loc[2];
RNA_float_get_array(&itemptr, "loc", loc);
@@ -2788,17 +2767,17 @@ void WM_OT_lasso_gesture(wmOperatorType *ot)
{
PropertyRNA *prop;
- ot->name= "Lasso Gesture";
- ot->idname= "WM_OT_lasso_gesture";
- ot->description="Select objects within the lasso as you move the pointer";
+ ot->name = "Lasso Gesture";
+ ot->idname = "WM_OT_lasso_gesture";
+ ot->description = "Select objects within the lasso as you move the pointer";
- ot->invoke= WM_gesture_lasso_invoke;
- ot->modal= WM_gesture_lasso_modal;
- ot->exec= gesture_lasso_exec;
+ ot->invoke = WM_gesture_lasso_invoke;
+ ot->modal = WM_gesture_lasso_modal;
+ ot->exec = gesture_lasso_exec;
- ot->poll= WM_operator_winactive;
+ ot->poll = WM_operator_winactive;
- prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
+ prop = RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
}
#endif
@@ -2807,10 +2786,10 @@ void WM_OT_lasso_gesture(wmOperatorType *ot)
static int straightline_apply(bContext *C, wmOperator *op)
{
- wmGesture *gesture= op->customdata;
- rcti *rect= gesture->customdata;
+ wmGesture *gesture = op->customdata;
+ rcti *rect = gesture->customdata;
- if(rect->xmin==rect->xmax && rect->ymin==rect->ymax)
+ if (rect->xmin == rect->xmax && rect->ymin == rect->ymax)
return 0;
/* operator arguments and storage. */
@@ -2819,7 +2798,7 @@ static int straightline_apply(bContext *C, wmOperator *op)
RNA_int_set(op->ptr, "xend", rect->xmax);
RNA_int_set(op->ptr, "yend", rect->ymax);
- if(op->type->exec)
+ if (op->type->exec)
op->type->exec(C, op);
return 1;
@@ -2828,14 +2807,14 @@ static int straightline_apply(bContext *C, wmOperator *op)
int WM_gesture_straightline_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- op->customdata= WM_gesture_new(C, event, WM_GESTURE_STRAIGHTLINE);
+ op->customdata = WM_gesture_new(C, event, WM_GESTURE_STRAIGHTLINE);
/* add modal handler */
WM_event_add_modal_handler(C, op);
wm_gesture_tag_redraw(C);
- if( RNA_struct_find_property(op->ptr, "cursor") )
+ if (RNA_struct_find_property(op->ptr, "cursor") )
WM_cursor_modal(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
return OPERATOR_RUNNING_MODAL;
@@ -2843,35 +2822,35 @@ int WM_gesture_straightline_invoke(bContext *C, wmOperator *op, wmEvent *event)
int WM_gesture_straightline_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- wmGesture *gesture= op->customdata;
- rcti *rect= gesture->customdata;
+ wmGesture *gesture = op->customdata;
+ rcti *rect = gesture->customdata;
int sx, sy;
- if(event->type== MOUSEMOVE) {
+ if (event->type == MOUSEMOVE) {
wm_subwindow_getorigin(CTX_wm_window(C), gesture->swinid, &sx, &sy);
- if(gesture->mode==0) {
- rect->xmin= rect->xmax= event->x - sx;
- rect->ymin= rect->ymax= event->y - sy;
+ if (gesture->mode == 0) {
+ rect->xmin = rect->xmax = event->x - sx;
+ rect->ymin = rect->ymax = event->y - sy;
}
else {
- rect->xmax= event->x - sx;
- rect->ymax= event->y - sy;
+ rect->xmax = event->x - sx;
+ rect->ymax = event->y - sy;
straightline_apply(C, op);
}
wm_gesture_tag_redraw(C);
}
- else if (event->type==EVT_MODAL_MAP) {
+ else if (event->type == EVT_MODAL_MAP) {
switch (event->val) {
case GESTURE_MODAL_BEGIN:
- if(gesture->mode==0) {
- gesture->mode= 1;
+ if (gesture->mode == 0) {
+ gesture->mode = 1;
wm_gesture_tag_redraw(C);
}
break;
case GESTURE_MODAL_SELECT:
- if(straightline_apply(C, op)) {
+ if (straightline_apply(C, op)) {
wm_gesture_end(C, op);
return OPERATOR_FINISHED;
}
@@ -2902,15 +2881,15 @@ void WM_OT_straightline_gesture(wmOperatorType *ot)
{
PropertyRNA *prop;
- ot->name= "Straight Line Gesture";
- ot->idname= "WM_OT_straightline_gesture";
- ot->description="Draw a straight line as you move the pointer";
+ ot->name = "Straight Line Gesture";
+ ot->idname = "WM_OT_straightline_gesture";
+ ot->description = "Draw a straight line as you move the pointer";
- ot->invoke= WM_gesture_straightline_invoke;
- ot->modal= WM_gesture_straightline_modal;
- ot->exec= gesture_straightline_exec;
+ ot->invoke = WM_gesture_straightline_invoke;
+ ot->modal = WM_gesture_straightline_modal;
+ ot->exec = gesture_straightline_exec;
- ot->poll= WM_operator_winactive;
+ ot->poll = WM_operator_winactive;
WM_operator_properties_gesture_straightline(ot, 0);
}
@@ -2938,51 +2917,51 @@ static void radial_control_set_initial_mouse(RadialControl *rc, wmEvent *event)
float d[2] = {0, 0};
float zoom[2] = {1, 1};
- rc->initial_mouse[0]= event->x;
- rc->initial_mouse[1]= event->y;
-
- switch(rc->subtype) {
- case PROP_DISTANCE:
- d[0] = rc->initial_value;
- break;
- case PROP_FACTOR:
- d[0] = WM_RADIAL_CONTROL_DISPLAY_SIZE * (1 - rc->initial_value);
- break;
- case PROP_ANGLE:
- d[0] = WM_RADIAL_CONTROL_DISPLAY_SIZE * cos(rc->initial_value);
- d[1] = WM_RADIAL_CONTROL_DISPLAY_SIZE * sin(rc->initial_value);
- break;
- default:
- return;
+ rc->initial_mouse[0] = event->x;
+ rc->initial_mouse[1] = event->y;
+
+ switch (rc->subtype) {
+ case PROP_DISTANCE:
+ d[0] = rc->initial_value;
+ break;
+ case PROP_FACTOR:
+ d[0] = WM_RADIAL_CONTROL_DISPLAY_SIZE * (1 - rc->initial_value);
+ break;
+ case PROP_ANGLE:
+ d[0] = WM_RADIAL_CONTROL_DISPLAY_SIZE * cos(rc->initial_value);
+ d[1] = WM_RADIAL_CONTROL_DISPLAY_SIZE * sin(rc->initial_value);
+ break;
+ default:
+ return;
}
- if(rc->zoom_prop) {
+ if (rc->zoom_prop) {
RNA_property_float_get_array(&rc->zoom_ptr, rc->zoom_prop, zoom);
d[0] *= zoom[0];
d[1] *= zoom[1];
}
- rc->initial_mouse[0]-= d[0];
- rc->initial_mouse[1]-= d[1];
+ rc->initial_mouse[0] -= d[0];
+ rc->initial_mouse[1] -= d[1];
}
static void radial_control_set_tex(RadialControl *rc)
{
ImBuf *ibuf;
- switch(RNA_type_to_ID_code(rc->image_id_ptr.type)) {
- case ID_BR:
- if((ibuf = brush_gen_radial_control_imbuf(rc->image_id_ptr.data))) {
- glGenTextures(1, &rc->gltex);
- glBindTexture(GL_TEXTURE_2D, rc->gltex);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, ibuf->x, ibuf->y, 0,
- GL_ALPHA, GL_FLOAT, ibuf->rect_float);
- MEM_freeN(ibuf->rect_float);
- MEM_freeN(ibuf);
- }
- break;
- default:
- break;
+ switch (RNA_type_to_ID_code(rc->image_id_ptr.type)) {
+ case ID_BR:
+ if ((ibuf = brush_gen_radial_control_imbuf(rc->image_id_ptr.data))) {
+ glGenTextures(1, &rc->gltex);
+ glBindTexture(GL_TEXTURE_2D, rc->gltex);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, ibuf->x, ibuf->y, 0,
+ GL_ALPHA, GL_FLOAT, ibuf->rect_float);
+ MEM_freeN(ibuf->rect_float);
+ MEM_freeN(ibuf);
+ }
+ break;
+ default:
+ break;
}
}
@@ -2992,18 +2971,18 @@ static void radial_control_paint_tex(RadialControl *rc, float radius, float alph
float rot;
/* set fill color */
- if(rc->fill_col_prop)
+ if (rc->fill_col_prop)
RNA_property_float_get_array(&rc->fill_col_ptr, rc->fill_col_prop, col);
glColor4f(col[0], col[1], col[2], alpha);
- if(rc->gltex) {
+ if (rc->gltex) {
glBindTexture(GL_TEXTURE_2D, rc->gltex);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
/* set up rotation if available */
- if(rc->rot_prop) {
+ if (rc->rot_prop) {
rot = RNA_property_float_get(&rc->rot_ptr, rc->rot_prop);
glPushMatrix();
glRotatef(RAD2DEGF(rot), 0, 0, 1);
@@ -3012,19 +2991,19 @@ static void radial_control_paint_tex(RadialControl *rc, float radius, float alph
/* draw textured quad */
glEnable(GL_TEXTURE_2D);
glBegin(GL_QUADS);
- glTexCoord2f(0,0);
+ glTexCoord2f(0, 0);
glVertex2f(-radius, -radius);
- glTexCoord2f(1,0);
+ glTexCoord2f(1, 0);
glVertex2f(radius, -radius);
- glTexCoord2f(1,1);
+ glTexCoord2f(1, 1);
glVertex2f(radius, radius);
- glTexCoord2f(0,1);
+ glTexCoord2f(0, 1);
glVertex2f(-radius, radius);
glEnd();
glDisable(GL_TEXTURE_2D);
/* undo rotation */
- if(rc->rot_prop)
+ if (rc->rot_prop)
glPopMatrix();
}
else {
@@ -3037,29 +3016,29 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd
{
RadialControl *rc = customdata;
ARegion *ar = CTX_wm_region(C);
- float r1=0.0f, r2=0.0f, tex_radius, alpha;
+ float r1 = 0.0f, r2 = 0.0f, tex_radius, alpha;
float zoom[2], col[3] = {1, 1, 1};
- switch(rc->subtype) {
- case PROP_DISTANCE:
- r1= rc->current_value;
- r2= rc->initial_value;
- tex_radius= r1;
- alpha = 0.75;
- break;
- case PROP_FACTOR:
- r1= (1 - rc->current_value) * WM_RADIAL_CONTROL_DISPLAY_SIZE;
- r2= tex_radius= WM_RADIAL_CONTROL_DISPLAY_SIZE;
- alpha = rc->current_value / 2.0f + 0.5f;
- break;
- case PROP_ANGLE:
- r1= r2= tex_radius= WM_RADIAL_CONTROL_DISPLAY_SIZE;
- alpha = 0.75;
- break;
- default:
- tex_radius= WM_RADIAL_CONTROL_DISPLAY_SIZE; /* note, this is a dummy value */
- alpha = 0.75;
- break;
+ switch (rc->subtype) {
+ case PROP_DISTANCE:
+ r1 = rc->current_value;
+ r2 = rc->initial_value;
+ tex_radius = r1;
+ alpha = 0.75;
+ break;
+ case PROP_FACTOR:
+ r1 = (1 - rc->current_value) * WM_RADIAL_CONTROL_DISPLAY_SIZE;
+ r2 = tex_radius = WM_RADIAL_CONTROL_DISPLAY_SIZE;
+ alpha = rc->current_value / 2.0f + 0.5f;
+ break;
+ case PROP_ANGLE:
+ r1 = r2 = tex_radius = WM_RADIAL_CONTROL_DISPLAY_SIZE;
+ alpha = 0.75;
+ break;
+ default:
+ tex_radius = WM_RADIAL_CONTROL_DISPLAY_SIZE; /* note, this is a dummy value */
+ alpha = 0.75;
+ break;
}
/* Keep cursor in the original place */
@@ -3071,7 +3050,7 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd
glEnable(GL_LINE_SMOOTH);
/* apply zoom if available */
- if(rc->zoom_prop) {
+ if (rc->zoom_prop) {
RNA_property_float_get_array(&rc->zoom_ptr, rc->zoom_prop, zoom);
glScalef(zoom[0], zoom[1], 1);
}
@@ -3080,11 +3059,11 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd
radial_control_paint_tex(rc, tex_radius, alpha);
/* set line color */
- if(rc->col_prop)
+ if (rc->col_prop)
RNA_property_float_get_array(&rc->col_ptr, rc->col_prop, col);
glColor4f(col[0], col[1], col[2], 0.5);
- if(rc->subtype == PROP_ANGLE) {
+ if (rc->subtype == PROP_ANGLE) {
glPushMatrix();
/* draw original angle line */
glRotatef(RAD2DEGF(rc->initial_value), 0, 0, 1);
@@ -3096,8 +3075,8 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd
}
/* draw circles on top */
- glutil_draw_lined_arc(0.0, (float)(M_PI*2.0), r1, 40);
- glutil_draw_lined_arc(0.0, (float)(M_PI*2.0), r2, 40);
+ glutil_draw_lined_arc(0.0, (float)(M_PI * 2.0), r1, 40);
+ glutil_draw_lined_arc(0.0, (float)(M_PI * 2.0), r2, 40);
glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
@@ -3110,39 +3089,39 @@ 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)
+ const char *name, PointerRNA *r_ptr,
+ PropertyRNA **r_prop, int req_length, RCPropFlags flags)
{
PropertyRNA *unused_prop;
int len;
char *str;
/* check flags */
- if((flags & RC_PROP_REQUIRE_BOOL) && (flags & RC_PROP_REQUIRE_FLOAT)) {
+ if ((flags & RC_PROP_REQUIRE_BOOL) && (flags & RC_PROP_REQUIRE_FLOAT)) {
BKE_reportf(op->reports, RPT_ERROR, "Property can't be both boolean and float");
return 0;
}
/* get an rna string path from the operator's properties */
- if(!(str = RNA_string_get_alloc(op->ptr, name, NULL, 0)))
+ if (!(str = RNA_string_get_alloc(op->ptr, name, NULL, 0)))
return 1;
- if(str[0] == '\0') {
- if(r_prop) *r_prop = NULL;
+ if (str[0] == '\0') {
+ if (r_prop) *r_prop = NULL;
MEM_freeN(str);
return 1;
}
- if(!r_prop)
+ if (!r_prop)
r_prop = &unused_prop;
/* get rna from path */
- if(!RNA_path_resolve(ctx_ptr, str, r_ptr, r_prop)) {
+ if (!RNA_path_resolve(ctx_ptr, str, r_ptr, r_prop)) {
MEM_freeN(str);
- if(flags & RC_PROP_ALLOW_MISSING)
+ if (flags & RC_PROP_ALLOW_MISSING)
return 1;
else {
BKE_reportf(op->reports, RPT_ERROR, "Couldn't resolve path %s", name);
@@ -3151,20 +3130,20 @@ static int radial_control_get_path(PointerRNA *ctx_ptr, wmOperator *op,
}
/* check property type */
- if(flags & (RC_PROP_REQUIRE_BOOL | RC_PROP_REQUIRE_FLOAT)) {
+ if (flags & (RC_PROP_REQUIRE_BOOL | RC_PROP_REQUIRE_FLOAT)) {
PropertyType prop_type = RNA_property_type(*r_prop);
- if(((flags & RC_PROP_REQUIRE_BOOL) && (prop_type != PROP_BOOLEAN)) ||
- ((flags & RC_PROP_REQUIRE_FLOAT) && prop_type != PROP_FLOAT)) {
+ if (((flags & RC_PROP_REQUIRE_BOOL) && (prop_type != PROP_BOOLEAN)) ||
+ ((flags & RC_PROP_REQUIRE_FLOAT) && prop_type != PROP_FLOAT)) {
MEM_freeN(str);
BKE_reportf(op->reports, RPT_ERROR,
- "Property from path %s is not a float", name);
+ "Property from path %s is not a float", name);
return 0;
}
}
/* check property's array length */
- if(*r_prop && (len = RNA_property_array_length(r_ptr, *r_prop)) != req_length) {
+ if (*r_prop && (len = RNA_property_array_length(r_ptr, *r_prop)) != req_length) {
MEM_freeN(str);
BKE_reportf(op->reports, RPT_ERROR,
"Property from path %s has length %d instead of %d",
@@ -3188,49 +3167,50 @@ static int radial_control_get_properties(bContext *C, wmOperator *op)
RNA_pointer_create(NULL, &RNA_Context, C, &ctx_ptr);
/* check if we use primary or secondary path */
- if(!radial_control_get_path(&ctx_ptr, op, "use_secondary",
- &use_secondary_ptr, &use_secondary_prop,
- 0, (RC_PROP_ALLOW_MISSING|
- RC_PROP_REQUIRE_BOOL))) {
+ if (!radial_control_get_path(&ctx_ptr, op, "use_secondary",
+ &use_secondary_ptr, &use_secondary_prop,
+ 0, (RC_PROP_ALLOW_MISSING |
+ RC_PROP_REQUIRE_BOOL)))
+ {
return 0;
}
else {
- if(use_secondary_prop &&
- RNA_property_boolean_get(&use_secondary_ptr, use_secondary_prop))
+ if (use_secondary_prop &&
+ RNA_property_boolean_get(&use_secondary_ptr, use_secondary_prop))
data_path = "data_path_secondary";
else
data_path = "data_path_primary";
}
- if(!radial_control_get_path(&ctx_ptr, op, data_path, &rc->ptr, &rc->prop, 0, 0))
+ if (!radial_control_get_path(&ctx_ptr, op, data_path, &rc->ptr, &rc->prop, 0, 0))
return 0;
/* data path is required */
- if(!rc->prop)
+ if (!rc->prop)
return 0;
- if(!radial_control_get_path(&ctx_ptr, op, "rotation_path", &rc->rot_ptr, &rc->rot_prop, 0, RC_PROP_REQUIRE_FLOAT))
+ if (!radial_control_get_path(&ctx_ptr, op, "rotation_path", &rc->rot_ptr, &rc->rot_prop, 0, RC_PROP_REQUIRE_FLOAT))
return 0;
- if(!radial_control_get_path(&ctx_ptr, op, "color_path", &rc->col_ptr, &rc->col_prop, 3, RC_PROP_REQUIRE_FLOAT))
+ if (!radial_control_get_path(&ctx_ptr, op, "color_path", &rc->col_ptr, &rc->col_prop, 3, RC_PROP_REQUIRE_FLOAT))
return 0;
- if(!radial_control_get_path(&ctx_ptr, op, "fill_color_path", &rc->fill_col_ptr, &rc->fill_col_prop, 3, RC_PROP_REQUIRE_FLOAT))
+ if (!radial_control_get_path(&ctx_ptr, op, "fill_color_path", &rc->fill_col_ptr, &rc->fill_col_prop, 3, RC_PROP_REQUIRE_FLOAT))
return 0;
/* slightly ugly; allow this property to not resolve
* correctly. needed because 3d texture paint shares the same
* keymap as 2d image paint */
- if(!radial_control_get_path(&ctx_ptr, op, "zoom_path",
- &rc->zoom_ptr, &rc->zoom_prop, 2,
- RC_PROP_REQUIRE_FLOAT|RC_PROP_ALLOW_MISSING))
+ if (!radial_control_get_path(&ctx_ptr, op, "zoom_path",
+ &rc->zoom_ptr, &rc->zoom_prop, 2,
+ RC_PROP_REQUIRE_FLOAT | RC_PROP_ALLOW_MISSING))
return 0;
- if(!radial_control_get_path(&ctx_ptr, op, "image_id", &rc->image_id_ptr, NULL, 0, 0))
+ if (!radial_control_get_path(&ctx_ptr, op, "image_id", &rc->image_id_ptr, NULL, 0, 0))
return 0;
- else if(rc->image_id_ptr.data) {
+ else if (rc->image_id_ptr.data) {
/* extra check, pointer must be to an ID */
- if(!RNA_struct_is_ID(rc->image_id_ptr.type)) {
+ if (!RNA_struct_is_ID(rc->image_id_ptr.type)) {
BKE_report(op->reports, RPT_ERROR,
- "Pointer from path image_id is not an ID");
+ "Pointer from path image_id is not an ID");
return 0;
}
}
@@ -3245,37 +3225,37 @@ static int radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event)
int min_value_int, max_value_int, step_int;
float step_float, precision;
- if(!(op->customdata = rc = MEM_callocN(sizeof(RadialControl), "RadialControl")))
+ if (!(op->customdata = rc = MEM_callocN(sizeof(RadialControl), "RadialControl")))
return OPERATOR_CANCELLED;
- if(!radial_control_get_properties(C, op)) {
+ if (!radial_control_get_properties(C, op)) {
MEM_freeN(rc);
return OPERATOR_CANCELLED;
}
/* get type, initial, min, and max values of the property */
- switch((rc->type = RNA_property_type(rc->prop))) {
- case PROP_INT:
- rc->initial_value = RNA_property_int_get(&rc->ptr, rc->prop);
- RNA_property_int_ui_range(&rc->ptr, rc->prop, &min_value_int,
- &max_value_int, &step_int);
- rc->min_value = min_value_int;
- rc->max_value = max_value_int;
- break;
- case PROP_FLOAT:
- rc->initial_value = RNA_property_float_get(&rc->ptr, rc->prop);
- RNA_property_float_ui_range(&rc->ptr, rc->prop, &rc->min_value,
- &rc->max_value, &step_float, &precision);
- break;
- default:
- BKE_report(op->reports, RPT_ERROR, "Property must be an integer or a float");
- MEM_freeN(rc);
- return OPERATOR_CANCELLED;
+ switch ((rc->type = RNA_property_type(rc->prop))) {
+ case PROP_INT:
+ rc->initial_value = RNA_property_int_get(&rc->ptr, rc->prop);
+ RNA_property_int_ui_range(&rc->ptr, rc->prop, &min_value_int,
+ &max_value_int, &step_int);
+ rc->min_value = min_value_int;
+ rc->max_value = max_value_int;
+ break;
+ case PROP_FLOAT:
+ rc->initial_value = RNA_property_float_get(&rc->ptr, rc->prop);
+ RNA_property_float_ui_range(&rc->ptr, rc->prop, &rc->min_value,
+ &rc->max_value, &step_float, &precision);
+ break;
+ default:
+ BKE_report(op->reports, RPT_ERROR, "Property must be an integer or a float");
+ MEM_freeN(rc);
+ return OPERATOR_CANCELLED;
}
/* get subtype of property */
rc->subtype = RNA_property_subtype(rc->prop);
- if(!ELEM3(rc->subtype, PROP_DISTANCE, PROP_FACTOR, PROP_ANGLE)) {
+ if (!ELEM3(rc->subtype, PROP_DISTANCE, PROP_FACTOR, PROP_ANGLE)) {
BKE_report(op->reports, RPT_ERROR, "Property must be a distance, a factor, or an angle");
MEM_freeN(rc);
return OPERATOR_CANCELLED;
@@ -3292,7 +3272,7 @@ static int radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* add radial control paint cursor */
rc->cursor = WM_paint_cursor_activate(wm, op->type->poll,
- radial_control_paint_cursor, rc);
+ radial_control_paint_cursor, rc);
WM_event_add_modal_handler(C, op);
@@ -3301,15 +3281,15 @@ static int radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event)
static void radial_control_set_value(RadialControl *rc, float val)
{
- switch(rc->type) {
- case PROP_INT:
- RNA_property_int_set(&rc->ptr, rc->prop, val);
- break;
- case PROP_FLOAT:
- RNA_property_float_set(&rc->ptr, rc->prop, val);
- break;
- default:
- break;
+ switch (rc->type) {
+ case PROP_INT:
+ RNA_property_int_set(&rc->ptr, rc->prop, val);
+ break;
+ case PROP_FLOAT:
+ RNA_property_float_set(&rc->ptr, rc->prop, val);
+ break;
+ default:
+ break;
}
}
@@ -3324,8 +3304,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);
@@ -3345,61 +3325,61 @@ static int radial_control_modal(bContext *C, wmOperator *op, wmEvent *event)
snap = event->ctrl;
- switch(event->type) {
- case MOUSEMOVE:
- delta[0]= rc->initial_mouse[0] - event->x;
- delta[1]= rc->initial_mouse[1] - event->y;
+ switch (event->type) {
+ case MOUSEMOVE:
+ delta[0] = rc->initial_mouse[0] - event->x;
+ delta[1] = rc->initial_mouse[1] - event->y;
- if(rc->zoom_prop) {
- RNA_property_float_get_array(&rc->zoom_ptr, rc->zoom_prop, zoom);
- delta[0] /= zoom[0];
- delta[1] /= zoom[1];
- }
+ if (rc->zoom_prop) {
+ RNA_property_float_get_array(&rc->zoom_ptr, rc->zoom_prop, zoom);
+ delta[0] /= zoom[0];
+ delta[1] /= zoom[1];
+ }
- dist= sqrt(delta[0]*delta[0]+delta[1]*delta[1]);
+ dist = sqrt(delta[0] * delta[0] + delta[1] * delta[1]);
- /* calculate new value and apply snapping */
- switch(rc->subtype) {
- case PROP_DISTANCE:
- new_value = dist;
- if(snap) new_value = ((int)new_value + 5) / 10*10;
- break;
- case PROP_FACTOR:
- new_value = 1 - dist / WM_RADIAL_CONTROL_DISPLAY_SIZE;
- if(snap) new_value = ((int)ceil(new_value * 10.f) * 10.0f) / 100.f;
- break;
- case PROP_ANGLE:
- new_value = atan2(delta[1], delta[0]) + M_PI;
- if(snap) new_value = DEG2RADF(((int)RAD2DEGF(new_value) + 5) / 10*10);
+ /* calculate new value and apply snapping */
+ switch (rc->subtype) {
+ case PROP_DISTANCE:
+ new_value = dist;
+ if (snap) new_value = ((int)new_value + 5) / 10 * 10;
+ break;
+ case PROP_FACTOR:
+ new_value = 1 - dist / WM_RADIAL_CONTROL_DISPLAY_SIZE;
+ if (snap) new_value = ((int)ceil(new_value * 10.f) * 10.0f) / 100.f;
+ break;
+ case PROP_ANGLE:
+ new_value = atan2(delta[1], delta[0]) + M_PI;
+ if (snap) new_value = DEG2RADF(((int)RAD2DEGF(new_value) + 5) / 10 * 10);
+ break;
+ default:
+ new_value = dist; /* dummy value, should this ever happen? - campbell */
+ break;
+ }
+
+ /* clamp and update */
+ CLAMP(new_value, rc->min_value, rc->max_value);
+ radial_control_set_value(rc, new_value);
+ rc->current_value = new_value;
break;
- default:
- new_value = dist; /* dummy value, should this ever happen? - campbell */
+
+ case ESCKEY:
+ case RIGHTMOUSE:
+ /* canceled; restore original value */
+ radial_control_set_value(rc, rc->initial_value);
+ ret = OPERATOR_CANCELLED;
break;
- }
- /* clamp and update */
- CLAMP(new_value, rc->min_value, rc->max_value);
- radial_control_set_value(rc, new_value);
- rc->current_value = new_value;
- break;
-
- case ESCKEY:
- case RIGHTMOUSE:
- /* cancelled; restore original value */
- radial_control_set_value(rc, rc->initial_value);
- ret = OPERATOR_CANCELLED;
- break;
-
- case LEFTMOUSE:
- case PADENTER:
- /* done; value already set */
- ret = OPERATOR_FINISHED;
- break;
+ case LEFTMOUSE:
+ case PADENTER:
+ /* done; value already set */
+ ret = OPERATOR_FINISHED;
+ break;
}
ED_region_tag_redraw(CTX_wm_region(C));
- if(ret != OPERATOR_RUNNING_MODAL)
+ if (ret != OPERATOR_RUNNING_MODAL)
radial_control_cancel(C, op);
return ret;
@@ -3407,14 +3387,14 @@ static int radial_control_modal(bContext *C, wmOperator *op, wmEvent *event)
static void WM_OT_radial_control(wmOperatorType *ot)
{
- ot->name= "Radial Control";
- ot->idname= "WM_OT_radial_control";
+ ot->name = "Radial Control";
+ ot->idname = "WM_OT_radial_control";
- ot->invoke= radial_control_invoke;
- ot->modal= radial_control_modal;
- ot->cancel= radial_control_cancel;
+ ot->invoke = radial_control_invoke;
+ ot->modal = radial_control_modal;
+ ot->cancel = radial_control_cancel;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
/* all paths relative to the context */
RNA_def_string(ot->srna, "data_path_primary", "", 0, "Primary Data Path", "Primary path of property to be set by the radial control");
@@ -3433,14 +3413,14 @@ static void WM_OT_radial_control(wmOperatorType *ot)
static void redraw_timer_window_swap(bContext *C)
{
- wmWindow *win= CTX_wm_window(C);
+ wmWindow *win = CTX_wm_window(C);
ScrArea *sa;
- for(sa= CTX_wm_screen(C)->areabase.first; sa; sa= sa->next)
+ for (sa = CTX_wm_screen(C)->areabase.first; sa; sa = sa->next)
ED_area_tag_redraw(sa);
wm_draw_update(C);
- CTX_wm_window_set(C, win); /* XXX context manipulation warning! */
+ CTX_wm_window_set(C, win); /* XXX context manipulation warning! */
}
static EnumPropertyItem redraw_timer_type_items[] = {
@@ -3451,80 +3431,81 @@ static EnumPropertyItem redraw_timer_type_items[] = {
{4, "ANIM_STEP", 0, "Anim Step", "Animation Steps"},
{5, "ANIM_PLAY", 0, "Anim Play", "Animation Playback"},
{6, "UNDO", 0, "Undo/Redo", "Undo/Redo"},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}
+};
static int redraw_timer_exec(bContext *C, wmOperator *op)
{
- ARegion *ar= CTX_wm_region(C);
- double stime= PIL_check_seconds_timer();
+ ARegion *ar = CTX_wm_region(C);
+ double stime = PIL_check_seconds_timer();
int type = RNA_enum_get(op->ptr, "type");
int iter = RNA_int_get(op->ptr, "iterations");
int a;
float time;
- const char *infostr= "";
+ const char *infostr = "";
WM_cursor_wait(1);
- for(a=0; a<iter; a++) {
- if (type==0) {
- if(ar)
+ for (a = 0; a < iter; a++) {
+ if (type == 0) {
+ if (ar)
ED_region_do_draw(C, ar);
}
- else if (type==1) {
- wmWindow *win= CTX_wm_window(C);
+ else if (type == 1) {
+ wmWindow *win = CTX_wm_window(C);
ED_region_tag_redraw(ar);
wm_draw_update(C);
- CTX_wm_window_set(C, win); /* XXX context manipulation warning! */
+ CTX_wm_window_set(C, win); /* XXX context manipulation warning! */
}
- else if (type==2) {
- wmWindow *win= CTX_wm_window(C);
+ else if (type == 2) {
+ wmWindow *win = CTX_wm_window(C);
ScrArea *sa;
- ScrArea *sa_back= CTX_wm_area(C);
- ARegion *ar_back= CTX_wm_region(C);
+ ScrArea *sa_back = CTX_wm_area(C);
+ ARegion *ar_back = CTX_wm_region(C);
- for(sa= CTX_wm_screen(C)->areabase.first; sa; sa= sa->next) {
+ for (sa = CTX_wm_screen(C)->areabase.first; sa; sa = sa->next) {
ARegion *ar_iter;
CTX_wm_area_set(C, sa);
- for(ar_iter= sa->regionbase.first; ar_iter; ar_iter= ar_iter->next) {
- if(ar_iter->swinid) {
+ for (ar_iter = sa->regionbase.first; ar_iter; ar_iter = ar_iter->next) {
+ if (ar_iter->swinid) {
CTX_wm_region_set(C, ar_iter);
ED_region_do_draw(C, ar_iter);
}
}
}
- CTX_wm_window_set(C, win); /* XXX context manipulation warning! */
+ CTX_wm_window_set(C, win); /* XXX context manipulation warning! */
CTX_wm_area_set(C, sa_back);
CTX_wm_region_set(C, ar_back);
}
- else if (type==3) {
+ else if (type == 3) {
redraw_timer_window_swap(C);
}
- else if (type==4) {
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
+ else if (type == 4) {
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
- if(a & 1) scene->r.cfra--;
+ if (a & 1) scene->r.cfra--;
else scene->r.cfra++;
scene_update_for_newframe(bmain, scene, scene->lay);
}
- else if (type==5) {
+ else if (type == 5) {
/* play anim, return on same frame as started with */
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
- int tot= (scene->r.efra - scene->r.sfra) + 1;
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
+ int tot = (scene->r.efra - scene->r.sfra) + 1;
- while(tot--) {
+ while (tot--) {
/* todo, ability to escape! */
scene->r.cfra++;
- if(scene->r.cfra > scene->r.efra)
- scene->r.cfra= scene->r.sfra;
+ if (scene->r.cfra > scene->r.efra)
+ scene->r.cfra = scene->r.sfra;
scene_update_for_newframe(bmain, scene, scene->lay);
redraw_timer_window_swap(C);
@@ -3536,29 +3517,29 @@ static int redraw_timer_exec(bContext *C, wmOperator *op)
}
}
- time= (float)((PIL_check_seconds_timer()-stime)*1000);
+ time = (float)((PIL_check_seconds_timer() - stime) * 1000);
RNA_enum_description(redraw_timer_type_items, type, &infostr);
WM_cursor_wait(0);
- BKE_reportf(op->reports, RPT_WARNING, "%d x %s: %.2f ms, average: %.4f", iter, infostr, time, time/iter);
+ BKE_reportf(op->reports, RPT_WARNING, "%d x %s: %.2f ms, average: %.4f", iter, infostr, time, time / iter);
return OPERATOR_FINISHED;
}
static void WM_OT_redraw_timer(wmOperatorType *ot)
{
- ot->name= "Redraw Timer";
- ot->idname= "WM_OT_redraw_timer";
- ot->description="Simple redraw timer to test the speed of updating the interface";
+ ot->name = "Redraw Timer";
+ ot->idname = "WM_OT_redraw_timer";
+ ot->description = "Simple redraw timer to test the speed of updating the interface";
- ot->invoke= WM_menu_invoke;
- ot->exec= redraw_timer_exec;
- ot->poll= WM_operator_winactive;
+ ot->invoke = WM_menu_invoke;
+ ot->exec = redraw_timer_exec;
+ ot->poll = WM_operator_winactive;
- ot->prop= RNA_def_enum(ot->srna, "type", redraw_timer_type_items, 0, "Type", "");
- RNA_def_int(ot->srna, "iterations", 10, 1,INT_MAX, "Iterations", "Number of times to redraw", 1,1000);
+ ot->prop = RNA_def_enum(ot->srna, "type", redraw_timer_type_items, 0, "Type", "");
+ RNA_def_int(ot->srna, "iterations", 10, 1, INT_MAX, "Iterations", "Number of times to redraw", 1, 1000);
}
@@ -3572,20 +3553,20 @@ static int memory_statistics_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
static void WM_OT_memory_statistics(wmOperatorType *ot)
{
- ot->name= "Memory Statistics";
- ot->idname= "WM_OT_memory_statistics";
- ot->description= "Print memory statistics to the console";
+ ot->name = "Memory Statistics";
+ ot->idname = "WM_OT_memory_statistics";
+ ot->description = "Print memory statistics to the console";
- ot->exec= memory_statistics_exec;
+ ot->exec = memory_statistics_exec;
}
/* ************************** memory statistics for testing ***************** */
static int dependency_relations_exec(bContext *C, wmOperator *UNUSED(op))
{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_active_object(C);
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = CTX_data_active_object(C);
DAG_print_dependencies(bmain, scene, ob);
@@ -3594,11 +3575,11 @@ static int dependency_relations_exec(bContext *C, wmOperator *UNUSED(op))
static void WM_OT_dependency_relations(wmOperatorType *ot)
{
- ot->name= "Dependency Relations";
- ot->idname= "WM_OT_dependency_relations";
- ot->description= "Print dependency graph relations to the console";
+ ot->name = "Dependency Relations";
+ ot->idname = "WM_OT_dependency_relations";
+ ot->description = "Print dependency graph relations to the console";
- ot->exec= dependency_relations_exec;
+ ot->exec = dependency_relations_exec;
}
/* ******************************************************* */
@@ -3609,12 +3590,12 @@ static int wm_ndof_sensitivity_exec(bContext *UNUSED(C), wmOperator *op)
float change;
float sensitivity = U.ndof_sensitivity;
- if(RNA_boolean_get(op->ptr, "fast"))
- change = 0.5f; // 50% change
+ if (RNA_boolean_get(op->ptr, "fast"))
+ change = 0.5f; // 50% change
else
- change = 0.1f; // 10%
+ change = 0.1f; // 10%
- if(RNA_boolean_get(op->ptr, "decrease")) {
+ if (RNA_boolean_get(op->ptr, "decrease")) {
sensitivity -= sensitivity * change;
if (sensitivity < min)
sensitivity = min;
@@ -3634,11 +3615,11 @@ static int wm_ndof_sensitivity_exec(bContext *UNUSED(C), wmOperator *op)
static void WM_OT_ndof_sensitivity_change(wmOperatorType *ot)
{
- ot->name= "Change NDOF sensitivity";
- ot->idname= "WM_OT_ndof_sensitivity_change";
- ot->description="Change NDOF sensitivity";
+ ot->name = "Change NDOF sensitivity";
+ ot->idname = "WM_OT_ndof_sensitivity_change";
+ ot->description = "Change NDOF sensitivity";
- ot->exec= wm_ndof_sensitivity_exec;
+ ot->exec = wm_ndof_sensitivity_exec;
RNA_def_boolean(ot->srna, "decrease", 1, "Decrease NDOF sensitivity", "If true then action decreases NDOF sensitivity instead of increasing");
RNA_def_boolean(ot->srna, "fast", 0, "Fast NDOF sensitivity change", "If true then sensitivity changes 50%, otherwise 10%");
@@ -3647,10 +3628,15 @@ static void WM_OT_ndof_sensitivity_change(wmOperatorType *ot)
static void operatortype_ghash_free_cb(wmOperatorType *ot)
{
- if(ot->macro.first)
+ if (ot->last_properties) {
+ IDP_FreeProperty(ot->last_properties);
+ MEM_freeN(ot->last_properties);
+ }
+
+ if (ot->macro.first)
wm_operatortype_free_macro(ot);
- if(ot->ext.srna) /* python operator, allocs own string */
+ if (ot->ext.srna) /* python operator, allocs own string */
MEM_freeN((void *)ot->idname);
MEM_freeN(ot);
@@ -3661,13 +3647,13 @@ static void operatortype_ghash_free_cb(wmOperatorType *ot)
void wm_operatortype_free(void)
{
BLI_ghash_free(global_ops_hash, NULL, (GHashValFreeFP)operatortype_ghash_free_cb);
- global_ops_hash= NULL;
+ global_ops_hash = NULL;
}
/* called on initialize WM_init() */
void wm_operatortype_init(void)
{
- global_ops_hash= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "wm_operatortype_init gh");
+ global_ops_hash = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "wm_operatortype_init gh");
WM_operatortype_append(WM_OT_window_duplicate);
WM_operatortype_append(WM_OT_read_homefile);
@@ -3705,24 +3691,23 @@ void wm_operatortype_init(void)
static void gesture_circle_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
- {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
- {GESTURE_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
- {GESTURE_MODAL_CIRCLE_ADD, "ADD", 0, "Add", ""},
- {GESTURE_MODAL_CIRCLE_SUB, "SUBTRACT", 0, "Subtract", ""},
-
- {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""},
- {GESTURE_MODAL_DESELECT,"DESELECT", 0, "DeSelect", ""},
- {GESTURE_MODAL_NOP,"NOP", 0, "No Operation", ""},
+ {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
+ {GESTURE_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
+ {GESTURE_MODAL_CIRCLE_ADD, "ADD", 0, "Add", ""},
+ {GESTURE_MODAL_CIRCLE_SUB, "SUBTRACT", 0, "Subtract", ""},
+ {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""},
+ {GESTURE_MODAL_DESELECT, "DESELECT", 0, "DeSelect", ""},
+ {GESTURE_MODAL_NOP, "NOP", 0, "No Operation", ""},
- {0, NULL, 0, NULL, NULL}};
+ {0, NULL, 0, NULL, NULL}};
- wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "View3D Gesture Circle");
+ wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "View3D Gesture Circle");
/* 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 Gesture Circle", modal_items);
+ keymap = WM_modalkeymap_add(keyconf, "View3D Gesture Circle", modal_items);
/* items for modal map */
WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, GESTURE_MODAL_CANCEL);
@@ -3759,17 +3744,17 @@ static void gesture_circle_modal_keymap(wmKeyConfig *keyconf)
static void gesture_straightline_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
- {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
- {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""},
- {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""},
+ {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
+ {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""},
+ {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""},
{0, NULL, 0, NULL, NULL}};
- wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Gesture Straight Line");
+ wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "Gesture Straight Line");
/* this function is called for each spacetype, only needs to add map once */
- if(keymap) return;
+ if (keymap) return;
- keymap= WM_modalkeymap_add(keyconf, "Gesture Straight Line", modal_items);
+ keymap = WM_modalkeymap_add(keyconf, "Gesture Straight Line", modal_items);
/* items for modal map */
WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, GESTURE_MODAL_CANCEL);
@@ -3787,22 +3772,22 @@ static void gesture_straightline_modal_keymap(wmKeyConfig *keyconf)
static void gesture_border_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
- {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
- {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""},
- {GESTURE_MODAL_DESELECT,"DESELECT", 0, "DeSelect", ""},
- {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""},
- {0, NULL, 0, NULL, NULL}};
+ {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
+ {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""},
+ {GESTURE_MODAL_DESELECT, "DESELECT", 0, "DeSelect", ""},
+ {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""},
+ {0, NULL, 0, NULL, NULL}};
- wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Gesture Border");
+ wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "Gesture Border");
/* this function is called for each spacetype, only needs to add map once */
- if(keymap) return;
+ if (keymap) return;
- keymap= WM_modalkeymap_add(keyconf, "Gesture Border", modal_items);
+ keymap = WM_modalkeymap_add(keyconf, "Gesture Border", modal_items);
/* items for modal map */
WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, GESTURE_MODAL_CANCEL);
- /* Note: cancel only on press otherwise you cannot map this to RMB-gesture */
+ /* Note: cancel only on press otherwise you cannot map this to RMB-gesture */
WM_modalkeymap_add_item(keymap, RIGHTMOUSE, KM_PRESS, KM_ANY, 0, GESTURE_MODAL_CANCEL);
WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_PRESS, 0, 0, GESTURE_MODAL_BEGIN);
@@ -3827,12 +3812,14 @@ static void gesture_border_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_assign(keymap, "MARKER_OT_select_border");
WM_modalkeymap_assign(keymap, "NLA_OT_select_border");
WM_modalkeymap_assign(keymap, "NODE_OT_select_border");
+ WM_modalkeymap_assign(keymap, "PAINT_OT_hide_show");
WM_modalkeymap_assign(keymap, "OUTLINER_OT_select_border");
// WM_modalkeymap_assign(keymap, "SCREEN_OT_border_select"); // template
WM_modalkeymap_assign(keymap, "SEQUENCER_OT_select_border");
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");
@@ -3844,18 +3831,18 @@ static void gesture_border_modal_keymap(wmKeyConfig *keyconf)
static void gesture_zoom_border_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
- {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
- {GESTURE_MODAL_IN, "IN", 0, "In", ""},
- {GESTURE_MODAL_OUT, "OUT", 0, "Out", ""},
- {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""},
- {0, NULL, 0, NULL, NULL}};
+ {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
+ {GESTURE_MODAL_IN, "IN", 0, "In", ""},
+ {GESTURE_MODAL_OUT, "OUT", 0, "Out", ""},
+ {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""},
+ {0, NULL, 0, NULL, NULL}};
- wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Gesture Zoom Border");
+ wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "Gesture Zoom Border");
/* this function is called for each spacetype, only needs to add map once */
- if(keymap) return;
+ if (keymap) return;
- keymap= WM_modalkeymap_add(keyconf, "Gesture Zoom Border", modal_items);
+ keymap = WM_modalkeymap_add(keyconf, "Gesture Zoom Border", modal_items);
/* items for modal map */
WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, GESTURE_MODAL_CANCEL);
@@ -3875,42 +3862,42 @@ static void gesture_zoom_border_modal_keymap(wmKeyConfig *keyconf)
/* default keymap for windows and screens, only call once per WM */
void wm_window_keymap(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap= WM_keymap_find(keyconf, "Window", 0, 0);
+ wmKeyMap *keymap = WM_keymap_find(keyconf, "Window", 0, 0);
wmKeyMapItem *kmi;
/* note, this doesn't replace existing keymap items */
- WM_keymap_verify_item(keymap, "WM_OT_window_duplicate", WKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_window_duplicate", WKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
#ifdef __APPLE__
WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_OSKEY, 0);
- WM_keymap_add_menu(keymap, "INFO_MT_file_open_recent", OKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0);
+ WM_keymap_add_menu(keymap, "INFO_MT_file_open_recent", OKEY, KM_PRESS, KM_SHIFT | KM_OSKEY, 0);
WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_OSKEY, 0);
- WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0);
+ WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT | KM_OSKEY, 0);
WM_keymap_add_item(keymap, "WM_OT_quit_blender", QKEY, KM_PRESS, KM_OSKEY, 0);
#endif
WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_add_menu(keymap, "INFO_MT_file_open_recent", OKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ WM_keymap_add_menu(keymap, "INFO_MT_file_open_recent", OKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_open_mainfile", F1KEY, KM_PRESS, 0, 0);
- WM_keymap_add_item(keymap, "WM_OT_link_append", OKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
- kmi= WM_keymap_add_item(keymap, "WM_OT_link_append", F1KEY, KM_PRESS, KM_SHIFT, 0);
+ WM_keymap_add_item(keymap, "WM_OT_link_append", OKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "WM_OT_link_append", F1KEY, KM_PRESS, KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "link", FALSE);
RNA_boolean_set(kmi->ptr, "instance_groups", FALSE);
WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_save_mainfile", WKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", F2KEY, KM_PRESS, 0, 0);
- kmi= WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
+ kmi = WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_ALT | KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "copy", TRUE);
WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "WM_OT_quit_blender", QKEY, KM_PRESS, KM_CTRL, 0);
/* debug/testing */
- WM_keymap_verify_item(keymap, "WM_OT_redraw_timer", TKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
- WM_keymap_verify_item(keymap, "WM_OT_debug_menu", DKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_redraw_timer", TKEY, KM_PRESS, KM_ALT | KM_CTRL, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_debug_menu", DKEY, KM_PRESS, KM_ALT | KM_CTRL, 0);
/* menus that can be accessed anywhere in blender */
WM_keymap_verify_item(keymap, "WM_OT_search_menu", SPACEKEY, KM_PRESS, 0, 0);
@@ -3962,19 +3949,19 @@ void wm_window_keymap(wmKeyConfig *keyconf)
RNA_string_set(kmi->ptr, "value", "DOPESHEET_EDITOR");
/* ndof speed */
- kmi= WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_PLUS, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_PLUS, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "decrease", FALSE);
RNA_boolean_set(kmi->ptr, "fast", FALSE);
- kmi= WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_MINUS, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_MINUS, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "decrease", TRUE);
RNA_boolean_set(kmi->ptr, "fast", FALSE);
- kmi= WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_PLUS, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_PLUS, KM_PRESS, KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "decrease", FALSE);
RNA_boolean_set(kmi->ptr, "fast", TRUE);
- kmi= WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_MINUS, KM_PRESS, KM_SHIFT, 0);
+ kmi = WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_MINUS, KM_PRESS, KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "decrease", TRUE);
RNA_boolean_set(kmi->ptr, "fast", TRUE);
@@ -3987,20 +3974,20 @@ void wm_window_keymap(wmKeyConfig *keyconf)
/* Generic itemf's for operators that take library args */
static EnumPropertyItem *rna_id_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), int *do_free, ID *id, int local)
{
- EnumPropertyItem item_tmp= {0}, *item= NULL;
- int totitem= 0;
- int i= 0;
+ EnumPropertyItem item_tmp = {0}, *item = NULL;
+ int totitem = 0;
+ int i = 0;
- for( ; id; id= id->next) {
- if(local==FALSE || id->lib==NULL) {
- item_tmp.identifier= item_tmp.name= id->name+2;
- item_tmp.value= i++;
+ for (; id; id = id->next) {
+ if (local == FALSE || id->lib == NULL) {
+ item_tmp.identifier = item_tmp.name = id->name + 2;
+ item_tmp.value = i++;
RNA_enum_item_add(&item, &totitem, &item_tmp);
}
}
RNA_enum_item_end(&item, &totitem);
- *do_free= 1;
+ *do_free = 1;
return item;
}
@@ -4041,3 +4028,12 @@ EnumPropertyItem *RNA_scene_local_itemf(bContext *C, PointerRNA *ptr, PropertyRN
{
return rna_id_itemf(C, ptr, do_free, C ? (ID *)CTX_data_main(C)->scene.first : NULL, TRUE);
}
+
+EnumPropertyItem *RNA_movieclip_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *do_free)
+{
+ return rna_id_itemf(C, ptr, do_free, C ? (ID *)CTX_data_main(C)->movieclip.first : NULL, FALSE);
+}
+EnumPropertyItem *RNA_movieclip_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *do_free)
+{
+ return rna_id_itemf(C, ptr, do_free, C ? (ID *)CTX_data_main(C)->movieclip.first : NULL, TRUE);
+}
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c
index 8a4dd3df134..6ffb28ba013 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;
@@ -87,7 +87,7 @@ void wm_subwindows_free(wmWindow *win)
{
wmSubWindow *swin;
- for(swin= win->subwindows.first; swin; swin= swin->next)
+ for (swin = win->subwindows.first; swin; swin = swin->next)
wm_subwindow_free(swin);
BLI_freelistN(&win->subwindows);
@@ -96,7 +96,7 @@ void wm_subwindows_free(wmWindow *win)
int wm_subwindow_get(wmWindow *win)
{
- if(win->curswin)
+ if (win->curswin)
return win->curswin->swinid;
return 0;
}
@@ -105,46 +105,46 @@ static wmSubWindow *swin_from_swinid(wmWindow *win, int swinid)
{
wmSubWindow *swin;
- for(swin= win->subwindows.first; swin; swin= swin->next)
- if(swin->swinid==swinid)
+ for (swin = win->subwindows.first; swin; swin = swin->next)
+ if (swin->swinid == swinid)
break;
return swin;
}
void wm_subwindow_getsize(wmWindow *win, int swinid, int *x, int *y)
{
- wmSubWindow *swin= swin_from_swinid(win, swinid);
+ wmSubWindow *swin = swin_from_swinid(win, swinid);
- if(swin) {
- *x= swin->winrct.xmax - swin->winrct.xmin + 1;
- *y= swin->winrct.ymax - swin->winrct.ymin + 1;
+ if (swin) {
+ *x = swin->winrct.xmax - swin->winrct.xmin + 1;
+ *y = swin->winrct.ymax - swin->winrct.ymin + 1;
}
}
void wm_subwindow_getorigin(wmWindow *win, int swinid, int *x, int *y)
{
- wmSubWindow *swin= swin_from_swinid(win, swinid);
+ wmSubWindow *swin = swin_from_swinid(win, swinid);
- if(swin) {
- *x= swin->winrct.xmin;
- *y= swin->winrct.ymin;
+ if (swin) {
+ *x = swin->winrct.xmin;
+ *y = swin->winrct.ymin;
}
}
void wm_subwindow_getmatrix(wmWindow *win, int swinid, float mat[][4])
{
- wmSubWindow *swin= swin_from_swinid(win, swinid);
+ wmSubWindow *swin = swin_from_swinid(win, swinid);
- if(swin) {
+ if (swin) {
/* used by UI, should find a better way to get the matrix there */
- if(swinid == win->screen->mainwin) {
+ if (swinid == win->screen->mainwin) {
int width, height;
wm_subwindow_getsize(win, swin->swinid, &width, &height);
- orthographic_m4(mat, -0.375f, (float)width-0.375f, -0.375f, (float)height-0.375f, -100, 100);
+ orthographic_m4(mat, -0.375f, (float)width - 0.375f, -0.375f, (float)height - 0.375f, -100, 100);
}
else
- glGetFloatv(GL_PROJECTION_MATRIX, (float*)mat);
+ glGetFloatv(GL_PROJECTION_MATRIX, (float *)mat);
}
}
@@ -154,25 +154,28 @@ int wm_subwindow_open(wmWindow *win, rcti *winrct)
{
wmSubWindow *swin;
int width, height;
- int freewinid= 1;
+ int freewinid = 1;
- for(swin= win->subwindows.first; swin; swin= swin->next)
- if(freewinid <= swin->swinid)
- freewinid= swin->swinid+1;
+ for (swin = win->subwindows.first; swin; swin = swin->next)
+ if (freewinid <= swin->swinid)
+ freewinid = swin->swinid + 1;
- win->curswin= swin= MEM_callocN(sizeof(wmSubWindow), "swinopen");
+ win->curswin = swin = MEM_callocN(sizeof(wmSubWindow), "swinopen");
BLI_addtail(&win->subwindows, swin);
- if(G.f & G_DEBUG) printf("swin %d added\n", freewinid);
- swin->swinid= freewinid;
- swin->winrct= *winrct;
+ if (G.debug & G_DEBUG_EVENTS) {
+ printf("%s: swin %d added\n", __func__, freewinid);
+ }
+
+ swin->swinid = freewinid;
+ swin->winrct = *winrct;
/* and we appy it all right away */
wmSubWindowSet(win, swin->swinid);
/* extra service */
wm_subwindow_getsize(win, swin->swinid, &width, &height);
- wmOrtho2(-0.375f, (float)width-0.375f, -0.375f, (float)height-0.375f);
+ wmOrtho2(-0.375f, (float)width - 0.375f, -0.375f, (float)height - 0.375f);
glLoadIdentity();
return swin->swinid;
@@ -181,11 +184,11 @@ int wm_subwindow_open(wmWindow *win, rcti *winrct)
void wm_subwindow_close(wmWindow *win, int swinid)
{
- wmSubWindow *swin= swin_from_swinid(win, swinid);
+ wmSubWindow *swin = swin_from_swinid(win, swinid);
if (swin) {
- if (swin==win->curswin)
- win->curswin= NULL;
+ if (swin == win->curswin)
+ win->curswin = NULL;
wm_subwindow_free(swin);
BLI_remlink(&win->subwindows, swin);
MEM_freeN(swin);
@@ -199,35 +202,35 @@ void wm_subwindow_close(wmWindow *win, int swinid)
/* pixels go from 0-99 for a 100 pixel window */
void wm_subwindow_position(wmWindow *win, int swinid, rcti *winrct)
{
- wmSubWindow *swin= swin_from_swinid(win, swinid);
+ wmSubWindow *swin = swin_from_swinid(win, swinid);
- if(swin) {
+ if (swin) {
int width, height;
- swin->winrct= *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;
+ swin->winrct.xmax = win->sizex;
if (swin->winrct.ymax > win->sizey)
- swin->winrct.ymax= win->sizey;
+ swin->winrct.ymax = win->sizey;
/* extra service */
wmSubWindowSet(win, swinid);
wm_subwindow_getsize(win, swinid, &width, &height);
- wmOrtho2(-0.375f, (float)width-0.375f, -0.375f, (float)height-0.375f);
+ wmOrtho2(-0.375f, (float)width - 0.375f, -0.375f, (float)height - 0.375f);
}
else {
printf("wm_subwindow_position: Internal error, bad winid: %d\n", swinid);
@@ -238,35 +241,35 @@ void wm_subwindow_position(wmWindow *win, int swinid, rcti *winrct)
/* ----------------- exported in WM_api.h ------------------------------------------------------ */
/* internal state, no threaded opengl! XXX */
-static wmWindow *_curwindow= NULL;
-static wmSubWindow *_curswin= NULL;
+static wmWindow *_curwindow = NULL;
+static wmSubWindow *_curswin = NULL;
void wmSubWindowScissorSet(wmWindow *win, int swinid, rcti *srct)
{
int width, height;
- _curswin= swin_from_swinid(win, swinid);
+ _curswin = swin_from_swinid(win, swinid);
- if(_curswin==NULL) {
+ if (_curswin == NULL) {
printf("wmSubWindowSet %d: doesn't exist\n", swinid);
return;
}
- win->curswin= _curswin;
- _curwindow= win;
+ win->curswin = _curswin;
+ _curwindow = win;
- width= _curswin->winrct.xmax - _curswin->winrct.xmin + 1;
- height= _curswin->winrct.ymax - _curswin->winrct.ymin + 1;
+ width = _curswin->winrct.xmax - _curswin->winrct.xmin + 1;
+ height = _curswin->winrct.ymax - _curswin->winrct.ymin + 1;
glViewport(_curswin->winrct.xmin, _curswin->winrct.ymin, width, height);
- if(srct) {
- width= srct->xmax - srct->xmin + 1;
- height= srct->ymax - srct->ymin + 1;
+ if (srct) {
+ width = srct->xmax - srct->xmin + 1;
+ height = srct->ymax - srct->ymin + 1;
glScissor(srct->xmin, srct->ymin, width, height);
}
else
glScissor(_curswin->winrct.xmin, _curswin->winrct.ymin, width, height);
- wmOrtho2(-0.375f, (float)width-0.375f, -0.375f, (float)height-0.375f);
+ wmOrtho2(-0.375f, (float)width - 0.375f, -0.375f, (float)height - 0.375f);
glLoadIdentity();
glFlush();
@@ -300,8 +303,8 @@ void wmOrtho(float x1, float x2, float y1, float y2, float n, float f)
void wmOrtho2(float x1, float x2, float y1, float y2)
{
/* prevent opengl from generating errors */
- if(x1==x2) x2+=1.0f;
- if(y1==y2) y2+=1.0f;
+ if (x1 == x2) x2 += 1.0f;
+ if (y1 == y2) y2 += 1.0f;
wmOrtho(x1, x2, y1, y2, -100, 100);
}
@@ -314,25 +317,25 @@ void wmOrtho2(float x1, float x2, float y1, float y2)
unsigned int index_to_framebuffer(int index)
{
- unsigned int i= index;
-
- switch(GPU_color_depth()) {
- case 12:
- i= ((i & 0xF00)<<12) + ((i & 0xF0)<<8) + ((i & 0xF)<<4);
- /* sometimes dithering subtracts! */
- i |= 0x070707;
- break;
- case 15:
- case 16:
- i= ((i & 0x7C00)<<9) + ((i & 0x3E0)<<6) + ((i & 0x1F)<<3);
- i |= 0x030303;
- break;
- case 24:
- break;
- default: // 18 bits...
- i= ((i & 0x3F000)<<6) + ((i & 0xFC0)<<4) + ((i & 0x3F)<<2);
- i |= 0x010101;
- break;
+ unsigned int i = index;
+
+ switch (GPU_color_depth()) {
+ case 12:
+ i = ((i & 0xF00) << 12) + ((i & 0xF0) << 8) + ((i & 0xF) << 4);
+ /* sometimes dithering subtracts! */
+ i |= 0x070707;
+ break;
+ case 15:
+ case 16:
+ i = ((i & 0x7C00) << 9) + ((i & 0x3E0) << 6) + ((i & 0x1F) << 3);
+ i |= 0x030303;
+ break;
+ case 24:
+ break;
+ default: // 18 bits...
+ i = ((i & 0x3F000) << 6) + ((i & 0xFC0) << 4) + ((i & 0x3F) << 2);
+ i |= 0x010101;
+ break;
}
return i;
@@ -344,27 +347,27 @@ unsigned int index_to_framebuffer(int index)
unsigned int index_to_framebuffer(int index)
{
- unsigned int i= index;
+ unsigned int i = index;
- switch(GPU_color_depth()) {
+ switch (GPU_color_depth()) {
case 8:
- i= ((i & 48)<<18) + ((i & 12)<<12) + ((i & 3)<<6);
+ i = ((i & 48) << 18) + ((i & 12) << 12) + ((i & 3) << 6);
i |= 0x3F3F3F;
break;
case 12:
- i= ((i & 0xF00)<<12) + ((i & 0xF0)<<8) + ((i & 0xF)<<4);
+ i = ((i & 0xF00) << 12) + ((i & 0xF0) << 8) + ((i & 0xF) << 4);
/* sometimes dithering subtracts! */
i |= 0x0F0F0F;
break;
case 15:
case 16:
- i= ((i & 0x7C00)<<9) + ((i & 0x3E0)<<6) + ((i & 0x1F)<<3);
+ i = ((i & 0x7C00) << 9) + ((i & 0x3E0) << 6) + ((i & 0x1F) << 3);
i |= 0x070707;
break;
case 24:
break;
- default: // 18 bits...
- i= ((i & 0x3F000)<<6) + ((i & 0xFC0)<<4) + ((i & 0x3F)<<2);
+ default: // 18 bits...
+ i = ((i & 0x3F000) << 6) + ((i & 0xFC0) << 4) + ((i & 0x3F) << 2);
i |= 0x030303;
break;
}
@@ -376,26 +379,26 @@ unsigned int index_to_framebuffer(int index)
void WM_set_framebuffer_index_color(int index)
{
- const int col= index_to_framebuffer(index);
+ const int col = index_to_framebuffer(index);
cpack(col);
}
int WM_framebuffer_to_index(unsigned int col)
{
- if (col==0) return 0;
-
- switch(GPU_color_depth()) {
- case 8:
- return ((col & 0xC00000)>>18) + ((col & 0xC000)>>12) + ((col & 0xC0)>>6);
- case 12:
- return ((col & 0xF00000)>>12) + ((col & 0xF000)>>8) + ((col & 0xF0)>>4);
- case 15:
- case 16:
- return ((col & 0xF80000)>>9) + ((col & 0xF800)>>6) + ((col & 0xF8)>>3);
- case 24:
- return col & 0xFFFFFF;
- default: // 18 bits...
- return ((col & 0xFC0000)>>6) + ((col & 0xFC00)>>4) + ((col & 0xFC)>>2);
+ if (col == 0) return 0;
+
+ switch (GPU_color_depth()) {
+ case 8:
+ return ((col & 0xC00000) >> 18) + ((col & 0xC000) >> 12) + ((col & 0xC0) >> 6);
+ case 12:
+ return ((col & 0xF00000) >> 12) + ((col & 0xF000) >> 8) + ((col & 0xF0) >> 4);
+ case 15:
+ case 16:
+ return ((col & 0xF80000) >> 9) + ((col & 0xF800) >> 6) + ((col & 0xF8) >> 3);
+ case 24:
+ return col & 0xFFFFFF;
+ default: // 18 bits...
+ return ((col & 0xFC0000) >> 6) + ((col & 0xFC00) >> 4) + ((col & 0xFC) >> 2);
}
}
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 6842b6be497..031cfe90042 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -76,24 +76,35 @@
#include "UI_interface.h"
/* the global to talk to ghost */
-static GHOST_SystemHandle g_system= NULL;
+static GHOST_SystemHandle g_system = NULL;
+
+typedef enum WinOverrideFlag {
+ WIN_OVERRIDE_GEOM = (1 << 0),
+ WIN_OVERRIDE_WINSTATE = (1 << 1)
+} WinOverrideFlag;
/* set by commandline */
-static int prefsizx= 0, prefsizy= 0, prefstax= 0, prefstay= 0, initialstate= GHOST_kWindowStateNormal;
-static unsigned short useprefsize= 0;
+static struct WMInitStruct {
+ /* window geometry */
+ int size_x, size_y;
+ int start_x, start_y;
+
+ int windowstate;
+ WinOverrideFlag override_flag;
+} wm_init_state = {0, 0, 0, 0, GHOST_kWindowStateNormal, 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;
unsigned int uiheight;
GHOST_GetMainDisplayDimensions(g_system, &uiwidth, &uiheight);
- *width_r= uiwidth;
- *height_r= uiheight;
+ *width_r = uiwidth;
+ *height_r = uiheight;
}
/* keeps offset and size within monitor bounds */
@@ -108,78 +119,78 @@ static void wm_window_check_position(rcti *rect)
height -= 70;
#endif
- if(rect->xmin < 0) {
+ if (rect->xmin < 0) {
rect->xmax -= rect->xmin;
rect->xmin = 0;
}
- if(rect->ymin < 0) {
+ if (rect->ymin < 0) {
rect->ymax -= rect->ymin;
rect->ymin = 0;
}
- if(rect->xmax > width) {
- d= rect->xmax - width;
+ if (rect->xmax > width) {
+ d = rect->xmax - width;
rect->xmax -= d;
rect->xmin -= d;
}
- if(rect->ymax > height) {
- d= rect->ymax - height;
+ if (rect->ymax > height) {
+ d = rect->ymax - height;
rect->ymax -= d;
rect->ymin -= d;
}
- if(rect->xmin < 0) rect->xmin= 0;
- if(rect->ymin < 0) rect->ymin= 0;
+ if (rect->xmin < 0) rect->xmin = 0;
+ if (rect->ymin < 0) rect->ymin = 0;
}
static void wm_ghostwindow_destroy(wmWindow *win)
{
- if(win->ghostwin) {
+ if (win->ghostwin) {
GHOST_DisposeWindow(g_system, win->ghostwin);
- win->ghostwin= NULL;
+ win->ghostwin = NULL;
}
}
/* 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;
/* update context */
- if(C) {
+ if (C) {
WM_event_remove_handlers(C, &win->handlers);
WM_event_remove_handlers(C, &win->modalhandlers);
- if(CTX_wm_window(C)==win)
+ if (CTX_wm_window(C) == win)
CTX_wm_window_set(C, NULL);
}
/* always set drawable and active to NULL,
* prevents non-drawable state of main windows (bugs #22967 and #25071, possibly #22477 too) */
- wm->windrawable= NULL;
- wm->winactive= NULL;
+ wm->windrawable = NULL;
+ wm->winactive = NULL;
/* end running jobs, a job end also removes its timer */
- for(wt= wm->timers.first; wt; wt= wtnext) {
- wtnext= wt->next;
- if(wt->win==win && wt->event_type==TIMERJOBS)
+ for (wt = wm->timers.first; wt; wt = wtnext) {
+ wtnext = wt->next;
+ if (wt->win == win && wt->event_type == TIMERJOBS)
wm_jobs_timer_ended(wm, wt);
}
/* timer removing, need to call this api function */
- for(wt= wm->timers.first; wt; wt=wtnext) {
- wtnext= wt->next;
- if(wt->win==win)
+ for (wt = wm->timers.first; wt; wt = wtnext) {
+ wtnext = wt->next;
+ if (wt->win == win)
WM_event_remove_timer(wm, win, wt);
}
- if(win->eventstate) MEM_freeN(win->eventstate);
+ if (win->eventstate) MEM_freeN(win->eventstate);
wm_event_free_all(win);
wm_subwindows_free(win);
- if(win->drawdata)
+ if (win->drawdata)
MEM_freeN(win->drawdata);
wm_ghostwindow_destroy(win);
@@ -190,23 +201,23 @@ void wm_window_free(bContext *C, wmWindowManager *wm, wmWindow *win)
static int find_free_winid(wmWindowManager *wm)
{
wmWindow *win;
- int id= 1;
+ int id = 1;
- for(win= wm->windows.first; win; win= win->next)
- if(id <= win->winid)
- id= win->winid+1;
+ for (win = wm->windows.first; win; win = win->next)
+ if (id <= win->winid)
+ id = win->winid + 1;
return id;
}
-/* dont change context itself */
+/* don't change context itself */
wmWindow *wm_window_new(bContext *C)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- wmWindow *win= MEM_callocN(sizeof(wmWindow), "window");
+ wmWindowManager *wm = CTX_wm_manager(C);
+ wmWindow *win = MEM_callocN(sizeof(wmWindow), "window");
BLI_addtail(&wm->windows, win);
- win->winid= find_free_winid(wm);
+ win->winid = find_free_winid(wm);
return win;
}
@@ -215,23 +226,23 @@ wmWindow *wm_window_new(bContext *C)
/* part of wm_window.c api */
wmWindow *wm_window_copy(bContext *C, wmWindow *winorig)
{
- wmWindow *win= wm_window_new(C);
+ wmWindow *win = wm_window_new(C);
- win->posx= winorig->posx+10;
- win->posy= winorig->posy;
- win->sizex= winorig->sizex;
- win->sizey= winorig->sizey;
+ win->posx = winorig->posx + 10;
+ win->posy = winorig->posy;
+ win->sizex = winorig->sizex;
+ win->sizey = winorig->sizey;
/* duplicate assigns to window */
- win->screen= ED_screen_duplicate(win, winorig->screen);
- BLI_strncpy(win->screenname, win->screen->id.name+2, sizeof(win->screenname));
- win->screen->winid= win->winid;
+ win->screen = ED_screen_duplicate(win, winorig->screen);
+ BLI_strncpy(win->screenname, win->screen->id.name + 2, sizeof(win->screenname));
+ win->screen->winid = win->winid;
- win->screen->do_refresh= 1;
- win->screen->do_draw= 1;
+ win->screen->do_refresh = 1;
+ win->screen->do_draw = 1;
- win->drawmethod= -1;
- win->drawdata= NULL;
+ win->drawmethod = -1;
+ win->drawdata = NULL;
return win;
}
@@ -239,12 +250,29 @@ wmWindow *wm_window_copy(bContext *C, wmWindow *winorig)
/* this is event from ghost, or exit-blender op */
void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win)
{
- bScreen *screen= win->screen;
-
+ wmWindow *tmpwin;
+ bScreen *screen = win->screen;
+
+ /* first check if we have any non-temp remaining windows */
+ if ((U.uiflag & USER_QUIT_PROMPT) && !wm->file_saved) {
+ if (wm->windows.first) {
+ for (tmpwin = wm->windows.first; tmpwin; tmpwin = tmpwin->next) {
+ if (tmpwin == win)
+ continue;
+ if (tmpwin->screen->temp == 0)
+ break;
+ }
+ if (tmpwin == NULL) {
+ if (!GHOST_confirmQuit(win->ghostwin))
+ return;
+ }
+ }
+ }
+
BLI_remlink(&wm->windows, win);
wm_draw_window_clear(win);
- CTX_wm_window_set(C, win); /* needed by handlers */
+ CTX_wm_window_set(C, win); /* needed by handlers */
WM_event_remove_handlers(C, &win->handlers);
WM_event_remove_handlers(C, &win->modalhandlers);
ED_screen_exit(C, win, win->screen);
@@ -252,18 +280,18 @@ void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win)
wm_window_free(C, wm, win);
/* if temp screen, delete it after window free (it stops jobs that can access it) */
- if(screen->temp) {
- Main *bmain= CTX_data_main(C);
+ if (screen->temp) {
+ Main *bmain = CTX_data_main(C);
free_libblock(&bmain->screen, screen);
}
/* check remaining windows */
- if(wm->windows.first) {
- for(win= wm->windows.first; win; win= win->next)
- if(win->screen->temp == 0)
+ if (wm->windows.first) {
+ for (win = wm->windows.first; win; win = win->next)
+ if (win->screen->temp == 0)
break;
/* in this case we close all */
- if(win==NULL)
+ if (win == NULL)
WM_exit(C);
}
else
@@ -273,29 +301,29 @@ void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win)
void wm_window_title(wmWindowManager *wm, wmWindow *win)
{
/* handle the 'temp' window, only set title when not set before */
- if(win->screen && win->screen->temp) {
- char *title= GHOST_GetTitle(win->ghostwin);
- if(title==NULL || title[0]==0)
+ if (win->screen && win->screen->temp) {
+ char *title = GHOST_GetTitle(win->ghostwin);
+ if (title == NULL || title[0] == 0)
GHOST_SetTitle(win->ghostwin, "Blender");
}
else {
/* this is set to 1 if you don't have startup.blend open */
- if(G.save_over && G.main->name[0]) {
+ if (G.save_over && G.main->name[0]) {
char str[sizeof(G.main->name) + 12];
- BLI_snprintf(str, sizeof(str), "Blender%s [%s]", wm->file_saved ? "":"*", G.main->name);
+ BLI_snprintf(str, sizeof(str), "Blender%s [%s]", wm->file_saved ? "" : "*", G.main->name);
GHOST_SetTitle(win->ghostwin, str);
}
else
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) */
- GHOST_SetWindowModifiedState(win->ghostwin, (GHOST_TUns8)!wm->file_saved);
+ * 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)
- if(wm->file_saved)
+ if (wm->file_saved)
GHOST_SetWindowState(win->ghostwin, GHOST_kWindowStateUnModified);
else
GHOST_SetWindowState(win->ghostwin, GHOST_kWindowStateModified);
@@ -304,20 +332,13 @@ 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);
+ posy = (scr_h - win->posy - win->sizey);
#if defined(__APPLE__) && !defined(GHOST_COCOA)
{
@@ -326,31 +347,31 @@ 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. */
- ghostwin= GHOST_CreateWindow(g_system, title,
- win->posx, posy, win->sizex, win->sizey,
- initial_state,
- GHOST_kDrawingContextTypeOpenGL,
- 0 /* no stereo */,
- 0 /* no AA */);
+ * 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,
+ (GHOST_TWindowState)win->windowstate,
+ GHOST_kDrawingContextTypeOpenGL,
+ 0 /* no stereo */,
+ 0 /* no AA */);
if (ghostwin) {
/* needed so we can detect the graphics card below */
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 */
+ win->ghostwin = ghostwin;
+ GHOST_SetWindowUserData(ghostwin, win); /* pointer back */
- if(win->eventstate==NULL)
- win->eventstate= MEM_callocN(sizeof(wmEvent), "window event state");
+ if (win->eventstate == NULL)
+ win->eventstate = MEM_callocN(sizeof(wmEvent), "window event state");
/* until screens get drawn, make it nice grey */
glClearColor(.55, .55, .55, 0.0);
/* Crash on OSS ATI: bugs.launchpad.net/ubuntu/+source/mesa/+bug/656100 */
- if(!GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE)) {
+ if (!GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE)) {
glClear(GL_COLOR_BUFFER_BIT);
}
@@ -368,7 +389,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;
@@ -377,52 +398,57 @@ void wm_window_add_ghostwindows(bContext* C, wmWindowManager *wm)
* Note that these values will be used only
* when there is no startup.blend yet.
*/
- if (!prefsizx) {
- wm_get_screensize(&prefsizx, &prefsizy);
+ if (wm_init_state.size_x == 0) {
+ wm_get_screensize(&wm_init_state.size_x, &wm_init_state.size_y);
#if defined(__APPLE__) && !defined(GHOST_COCOA)
//Cocoa provides functions to get correct max window size
{
- extern void wm_set_apple_prefsize(int, int); /* wm_apple.c */
+ extern void wm_set_apple_prefsize(int, int); /* wm_apple.c */
- wm_set_apple_prefsize(prefsizx, prefsizy);
+ wm_set_apple_prefsize(wm_init_state.size_x, wm_init_state.size_y);
}
#else
- prefstax= 0;
- prefstay= 0;
+ wm_init_state.start_x = 0;
+ wm_init_state.start_y = 0;
#endif
}
- for(win= wm->windows.first; win; win= win->next) {
- if(win->ghostwin==NULL) {
- if(win->sizex==0 || useprefsize) {
- win->posx= prefstax;
- win->posy= prefstay;
- win->sizex= prefsizx;
- win->sizey= prefsizy;
- win->windowstate= initialstate;
- useprefsize= 0;
+ for (win = wm->windows.first; win; win = win->next) {
+ if (win->ghostwin == NULL) {
+ if ((win->sizex == 0) || (wm_init_state.override_flag & WIN_OVERRIDE_GEOM)) {
+ win->posx = wm_init_state.start_x;
+ win->posy = wm_init_state.start_y;
+ win->sizex = wm_init_state.size_x;
+ win->sizey = wm_init_state.size_y;
+ wm_init_state.override_flag &= ~WIN_OVERRIDE_GEOM;
}
- wm_window_add_ghostwindow(C, "Blender", win);
+
+ if (wm_init_state.override_flag & WIN_OVERRIDE_WINSTATE) {
+ win->windowstate = wm_init_state.windowstate;
+ wm_init_state.override_flag &= ~WIN_OVERRIDE_WINSTATE;
+ }
+
+ wm_window_add_ghostwindow("Blender", win);
}
/* happens after fileread */
- if(win->eventstate==NULL)
- win->eventstate= MEM_callocN(sizeof(wmEvent), "window event state");
+ if (win->eventstate == NULL)
+ win->eventstate = MEM_callocN(sizeof(wmEvent), "window event state");
/* add keymap handlers (1 handler for all keys in map!) */
- keymap= WM_keymap_find(wm->defaultconf, "Window", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Window", 0, 0);
WM_event_add_keymap_handler(&win->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Screen", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Screen", 0, 0);
WM_event_add_keymap_handler(&win->handlers, keymap);
- keymap= WM_keymap_find(wm->defaultconf, "Screen Editing", 0, 0);
+ keymap = WM_keymap_find(wm->defaultconf, "Screen Editing", 0, 0);
WM_event_add_keymap_handler(&win->modalhandlers, keymap);
/* add drop boxes */
{
- ListBase *lb= WM_dropboxmap_find("Window", 0, 0);
+ ListBase *lb = WM_dropboxmap_find("Window", 0, 0);
WM_event_add_dropbox_handler(&win->handlers, lb);
}
wm_window_title(wm, win);
@@ -434,15 +460,15 @@ void wm_window_add_ghostwindows(bContext* C, wmWindowManager *wm)
/* area-rip calls this */
wmWindow *WM_window_open(bContext *C, rcti *rect)
{
- wmWindow *win= wm_window_new(C);
+ wmWindow *win = wm_window_new(C);
- win->posx= rect->xmin;
- win->posy= rect->ymin;
- win->sizex= rect->xmax - rect->xmin;
- win->sizey= rect->ymax - rect->ymin;
+ win->posx = rect->xmin;
+ win->posy = rect->ymin;
+ win->sizex = rect->xmax - rect->xmin;
+ win->sizey = rect->ymax - rect->ymin;
- win->drawmethod= -1;
- win->drawdata= NULL;
+ win->drawmethod = -1;
+ win->drawdata = NULL;
WM_check(C);
@@ -450,7 +476,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)
@@ -462,29 +488,29 @@ void WM_window_open_temp(bContext *C, rcti *position, int type)
wm_window_check_position(position);
/* test if we have a temp screen already */
- for(win= CTX_wm_manager(C)->windows.first; win; win= win->next)
- if(win->screen->temp)
+ for (win = CTX_wm_manager(C)->windows.first; win; win = win->next)
+ if (win->screen->temp)
break;
/* add new window? */
- if(win==NULL) {
- win= wm_window_new(C);
+ if (win == NULL) {
+ win = wm_window_new(C);
- win->posx= position->xmin;
- win->posy= position->ymin;
+ win->posx = position->xmin;
+ win->posy = position->ymin;
}
- win->sizex= position->xmax - position->xmin;
- win->sizey= position->ymax - position->ymin;
+ win->sizex = position->xmax - position->xmin;
+ win->sizey = position->ymax - position->ymin;
- if(win->ghostwin) {
+ if (win->ghostwin) {
wm_window_set_size(win, win->sizex, win->sizey);
wm_window_raise(win);
}
/* add new screen? */
- if(win->screen==NULL)
- win->screen= ED_screen_add(win, CTX_data_scene(C), "temp");
+ if (win->screen == NULL)
+ win->screen = ED_screen_add(win, CTX_data_scene(C), "temp");
win->screen->temp = 1;
/* make window active, and validate/resize */
@@ -492,10 +518,10 @@ void WM_window_open_temp(bContext *C, rcti *position, int type)
WM_check(C);
/* ensure it shows the right spacetype editor */
- sa= win->screen->areabase.first;
+ sa = win->screen->areabase.first;
CTX_wm_area_set(C, sa);
- if(type==WM_WINDOW_RENDER) {
+ if (type == WM_WINDOW_RENDER) {
ED_area_newspace(C, sa, SPACE_IMAGE);
}
else {
@@ -504,11 +530,11 @@ void WM_window_open_temp(bContext *C, rcti *position, int type)
ED_screen_set(C, win->screen);
- if(sa->spacetype==SPACE_IMAGE)
+ if (sa->spacetype == SPACE_IMAGE)
GHOST_SetTitle(win->ghostwin, IFACE_("Blender Render"));
- else if(ELEM(sa->spacetype, SPACE_OUTLINER, SPACE_USERPREF))
+ else if (ELEM(sa->spacetype, SPACE_OUTLINER, SPACE_USERPREF))
GHOST_SetTitle(win->ghostwin, IFACE_("Blender User Preferences"));
- else if(sa->spacetype==SPACE_FILE)
+ else if (sa->spacetype == SPACE_FILE)
GHOST_SetTitle(win->ghostwin, IFACE_("Blender File View"));
else
GHOST_SetTitle(win->ghostwin, "Blender");
@@ -523,7 +549,7 @@ int wm_window_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
wm_window_copy(C, CTX_wm_window(C));
WM_check(C);
- WM_event_add_notifier(C, NC_WINDOW|NA_ADDED, NULL);
+ WM_event_add_notifier(C, NC_WINDOW | NA_ADDED, NULL);
return OPERATOR_FINISHED;
}
@@ -532,14 +558,14 @@ int wm_window_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
/* fullscreen operator callback */
int wm_window_fullscreen_toggle_exec(bContext *C, wmOperator *UNUSED(op))
{
- wmWindow *window= CTX_wm_window(C);
+ wmWindow *window = CTX_wm_window(C);
GHOST_TWindowState state;
- if(G.background)
+ if (G.background)
return OPERATOR_CANCELLED;
- state= GHOST_GetWindowState(window->ghostwin);
- if(state!=GHOST_kWindowStateFullScreen)
+ state = GHOST_GetWindowState(window->ghostwin);
+ if (state != GHOST_kWindowStateFullScreen)
GHOST_SetWindowState(window->ghostwin, GHOST_kWindowStateFullScreen);
else
GHOST_SetWindowState(window->ghostwin, GHOST_kWindowStateNormal);
@@ -563,24 +589,24 @@ typedef enum
static int query_qual(modifierKeyType qual)
{
GHOST_TModifierKeyMask left, right;
- int val= 0;
+ int val = 0;
- switch(qual) {
+ switch (qual) {
case SHIFT:
- left= GHOST_kModifierKeyLeftShift;
- right= GHOST_kModifierKeyRightShift;
+ left = GHOST_kModifierKeyLeftShift;
+ right = GHOST_kModifierKeyRightShift;
break;
case CONTROL:
- left= GHOST_kModifierKeyLeftControl;
- right= GHOST_kModifierKeyRightControl;
+ left = GHOST_kModifierKeyLeftControl;
+ right = GHOST_kModifierKeyRightControl;
break;
case OS:
- left= right= GHOST_kModifierKeyOS;
+ left = right = GHOST_kModifierKeyOS;
break;
case ALT:
default:
- left= GHOST_kModifierKeyLeftAlt;
- right= GHOST_kModifierKeyRightAlt;
+ left = GHOST_kModifierKeyLeftAlt;
+ right = GHOST_kModifierKeyRightAlt;
break;
}
@@ -593,13 +619,15 @@ static int query_qual(modifierKeyType qual)
void wm_window_make_drawable(bContext *C, wmWindow *win)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
if (win != wm->windrawable && win->ghostwin) {
// win->lmbut= 0; /* keeps hanging when mousepressed while other window opened */
- wm->windrawable= win;
- if(G.f & G_DEBUG) printf("set drawable %d\n", win->winid);
+ wm->windrawable = win;
+ if (G.debug & G_DEBUG_EVENTS) {
+ printf("%s: set drawable %d\n", __func__, win->winid);
+ }
GHOST_ActivateWindowDrawingContext(win->ghostwin);
}
}
@@ -607,16 +635,17 @@ void wm_window_make_drawable(bContext *C, wmWindow *win)
/* called by ghost, here we handle events for windows themselves or send to event system */
static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
{
- bContext *C= private;
- wmWindowManager *wm= CTX_wm_manager(C);
- GHOST_TEventType type= GHOST_GetEventType(evt);
- int time= GHOST_GetEventTime(evt);
+ bContext *C = private;
+ wmWindowManager *wm = CTX_wm_manager(C);
+ GHOST_TEventType type = GHOST_GetEventType(evt);
+ int time = GHOST_GetEventTime(evt);
if (type == GHOST_kEventQuit) {
WM_exit(C);
- } else {
- GHOST_WindowHandle ghostwin= GHOST_GetEventWindow(evt);
- GHOST_TEventDataPtr data= GHOST_GetEventData(evt);
+ }
+ else {
+ GHOST_WindowHandle ghostwin = GHOST_GetEventWindow(evt);
+ GHOST_TEventDataPtr data = GHOST_GetEventData(evt);
wmWindow *win;
if (!ghostwin) {
@@ -624,60 +653,62 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
// what is it?
puts("<!> event has no window");
return 1;
- } else if (!GHOST_ValidWindow(g_system, ghostwin)) {
+ }
+ else if (!GHOST_ValidWindow(g_system, ghostwin)) {
// XXX - should be checked, why are we getting an event here, and
// what is it?
puts("<!> event has invalid window");
return 1;
- } else {
- win= GHOST_GetWindowUserData(ghostwin);
+ }
+ else {
+ win = GHOST_GetWindowUserData(ghostwin);
}
- switch(type) {
+ switch (type) {
case GHOST_kEventWindowDeactivate:
wm_event_add_ghostevent(wm, win, type, time, data);
- win->active= 0; /* XXX */
+ win->active = 0; /* XXX */
break;
case GHOST_kEventWindowActivate:
{
GHOST_TEventKeyData kdata;
int cx, cy, wx, wy;
- wm->winactive= win; /* no context change! c->wm->windrawable is drawable, or for area queues */
+ wm->winactive = win; /* no context change! c->wm->windrawable is drawable, or for area queues */
- win->active= 1;
+ win->active = 1;
// window_handle(win, INPUTCHANGE, win->active);
/* bad ghost support for modifier keys... so on activate we set the modifiers again */
- kdata.ascii= '\0';
- kdata.utf8_buf[0]= '\0';
+ kdata.ascii = '\0';
+ kdata.utf8_buf[0] = '\0';
if (win->eventstate->shift && !query_qual(SHIFT)) {
- kdata.key= GHOST_kKeyLeftShift;
+ kdata.key = GHOST_kKeyLeftShift;
wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, time, &kdata);
}
if (win->eventstate->ctrl && !query_qual(CONTROL)) {
- kdata.key= GHOST_kKeyLeftControl;
+ kdata.key = GHOST_kKeyLeftControl;
wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, time, &kdata);
}
if (win->eventstate->alt && !query_qual(ALT)) {
- kdata.key= GHOST_kKeyLeftAlt;
+ kdata.key = GHOST_kKeyLeftAlt;
wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, time, &kdata);
}
if (win->eventstate->oskey && !query_qual(OS)) {
- kdata.key= GHOST_kKeyOS;
+ kdata.key = GHOST_kKeyOS;
wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, time, &kdata);
}
/* keymodifier zero, it hangs on hotkeys that open windows otherwise */
- win->eventstate->keymodifier= 0;
+ win->eventstate->keymodifier = 0;
/* entering window, update mouse pos. but no event */
GHOST_GetCursorPosition(g_system, &wx, &wy);
GHOST_ScreenToClient(win->ghostwin, wx, wy, &cx, &cy);
- win->eventstate->x= cx;
- win->eventstate->y= (win->sizey-1) - cy;
+ win->eventstate->x = cx;
+ win->eventstate->y = (win->sizey - 1) - cy;
- win->addmousemove= 1; /* enables highlighted buttons */
+ win->addmousemove = 1; /* enables highlighted buttons */
wm_window_make_drawable(C, win);
break;
@@ -687,7 +718,9 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
break;
}
case GHOST_kEventWindowUpdate: {
- if(G.f & G_DEBUG) printf("ghost redraw\n");
+ if (G.debug & G_DEBUG_EVENTS) {
+ printf("%s: ghost redraw %d\n", __func__, win->winid);
+ }
wm_window_make_drawable(C, win);
WM_event_add_notifier(C, NC_WINDOW, NULL);
@@ -698,23 +731,24 @@ 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) {
+ /* win32: gives undefined window size when minimized */
+ if (state != GHOST_kWindowStateMinimized) {
GHOST_RectangleHandle client_rect;
int l, t, r, b, scr_w, scr_h;
int sizex, sizey, posx, posy;
- client_rect= GHOST_GetClientBounds(win->ghostwin);
+ client_rect = GHOST_GetClientBounds(win->ghostwin);
GHOST_GetRectangle(client_rect, &l, &t, &r, &b);
GHOST_DisposeRectangle(client_rect);
wm_get_screensize(&scr_w, &scr_h);
- sizex= r-l;
- sizey= b-t;
- posx= l;
- posy= scr_h - t - win->sizey;
+ sizex = r - l;
+ sizey = b - t;
+ posx = l;
+ posy = scr_h - t - win->sizey;
/*
* Ghost sometimes send size or move events when the window hasn't changed.
@@ -725,45 +759,48 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
* another time.
*/
if (win->sizex != sizex ||
- win->sizey != sizey ||
- win->posx != posx ||
- win->posy != posy)
+ win->sizey != sizey ||
+ win->posx != posx ||
+ win->posy != posy)
{
- win->sizex= sizex;
- win->sizey= sizey;
- win->posx= posx;
- win->posy= posy;
+ win->sizex = sizex;
+ win->sizey = sizey;
+ win->posx = posx;
+ win->posy = posy;
/* debug prints */
- if(0) {
+ if (G.debug & G_DEBUG_EVENTS) {
+ const char *state_str;
state = GHOST_GetWindowState(win->ghostwin);
-
- if(state==GHOST_kWindowStateNormal) {
- if(G.f & G_DEBUG) printf("window state: normal\n");
+
+ if (state == GHOST_kWindowStateNormal) {
+ state_str = "normal";
+ }
+ else if (state == GHOST_kWindowStateMinimized) {
+ state_str = "minimized";
}
- else if(state==GHOST_kWindowStateMinimized) {
- if(G.f & G_DEBUG) printf("window state: minimized\n");
+ else if (state == GHOST_kWindowStateMaximized) {
+ state_str = "maximized";
}
- else if(state==GHOST_kWindowStateMaximized) {
- if(G.f & G_DEBUG) printf("window state: maximized\n");
+ else if (state == GHOST_kWindowStateFullScreen) {
+ state_str = "fullscreen";
}
- else if(state==GHOST_kWindowStateFullScreen) {
- if(G.f & G_DEBUG) printf("window state: fullscreen\n");
+ else {
+ state_str = "<unknown>";
}
-
- if(type!=GHOST_kEventWindowSize) {
- if(G.f & G_DEBUG) {
- printf("win move event pos %d %d size %d %d\n",
- win->posx, win->posy, win->sizex, win->sizey);
- }
+
+ printf("%s: window %d state = %s\n", __func__, win->winid, state_str);
+
+ if (type != GHOST_kEventWindowSize) {
+ printf("win move event pos %d %d size %d %d\n",
+ win->posx, win->posy, win->sizex, win->sizey);
}
-
}
wm_window_make_drawable(C, win);
wm_draw_window_clear(win);
- WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
- WM_event_add_notifier(C, NC_WINDOW|NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_WINDOW | NA_EDITED, NULL);
}
}
break;
@@ -777,7 +814,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);
@@ -793,35 +830,35 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
case GHOST_kEventDraggingDropDone:
{
wmEvent event;
- GHOST_TEventDragnDropData *ddd= GHOST_GetEventData(evt);
+ GHOST_TEventDragnDropData *ddd = GHOST_GetEventData(evt);
int cx, cy, wx, wy;
/* entering window, update mouse pos */
GHOST_GetCursorPosition(g_system, &wx, &wy);
GHOST_ScreenToClient(win->ghostwin, wx, wy, &cx, &cy);
- win->eventstate->x= cx;
- win->eventstate->y= (win->sizey-1) - cy;
+ win->eventstate->x = cx;
+ win->eventstate->y = (win->sizey - 1) - cy;
- event= *(win->eventstate); /* copy last state, like mouse coords */
+ event = *(win->eventstate); /* copy last state, like mouse coords */
// activate region
- event.type= MOUSEMOVE;
- event.prevx= event.x;
- event.prevy= event.y;
+ event.type = MOUSEMOVE;
+ event.prevx = event.x;
+ event.prevy = event.y;
- wm->winactive= win; /* no context change! c->wm->windrawable is drawable, or for area queues */
- win->active= 1;
+ wm->winactive = win; /* no context change! c->wm->windrawable is drawable, or for area queues */
+ win->active = 1;
wm_event_add(win, &event);
/* make blender drop event with custom data pointing to wm drags */
- event.type= EVT_DROP;
- event.val= KM_RELEASE;
- event.custom= EVT_DATA_LISTBASE;
- event.customdata= &wm->drags;
- event.customdatafree= 1;
+ event.type = EVT_DROP;
+ event.val = KM_RELEASE;
+ event.custom = EVT_DATA_LISTBASE;
+ event.customdata = &wm->drags;
+ event.customdatafree = 1;
wm_event_add(win, &event);
@@ -829,14 +866,14 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
/* add drag data to wm for paths: */
- if(ddd->dataType == GHOST_kDragnDropTypeFilenames) {
- GHOST_TStringArray *stra= ddd->data;
+ if (ddd->dataType == GHOST_kDragnDropTypeFilenames) {
+ GHOST_TStringArray *stra = ddd->data;
int a, icon;
- for(a=0; a<stra->count; a++) {
+ for (a = 0; a < stra->count; a++) {
printf("drop file %s\n", stra->strings[a]);
/* try to get icon type from extension */
- icon= ED_file_extension_icon((char *)stra->strings[a]);
+ icon = ED_file_extension_icon((char *)stra->strings[a]);
WM_event_start_drag(C, icon, WM_DRAG_PATH, stra->strings[a], 0.0);
/* void poin should point to string, it makes a copy */
@@ -860,43 +897,43 @@ 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);
+ wmWindowManager *wm = CTX_wm_manager(C);
wmTimer *wt, *wtnext;
wmWindow *win;
- double time= PIL_check_seconds_timer();
- int retval= 0;
+ double time = PIL_check_seconds_timer();
+ int retval = 0;
- for(wt= wm->timers.first; wt; wt= wtnext) {
- wtnext= wt->next; /* in case timer gets removed */
- win= wt->win;
+ for (wt = wm->timers.first; wt; wt = wtnext) {
+ wtnext = wt->next; /* in case timer gets removed */
+ win = wt->win;
- if(wt->sleep==0) {
- if(time > wt->ntime) {
- wt->delta= time - wt->ltime;
+ if (wt->sleep== 0) {
+ if (time > wt->ntime) {
+ wt->delta = time - wt->ltime;
wt->duration += wt->delta;
- wt->ltime= time;
- wt->ntime= wt->stime + wt->timestep*ceil(wt->duration/wt->timestep);
+ wt->ltime = time;
+ wt->ntime = wt->stime + wt->timestep *ceil(wt->duration / wt->timestep);
- if(wt->event_type == TIMERJOBS)
+ if (wt->event_type == TIMERJOBS)
wm_jobs_timer(C, wm, wt);
- else if(wt->event_type == TIMERAUTOSAVE)
+ else if (wt->event_type == TIMERAUTOSAVE)
wm_autosave_timer(C, wm, wt);
- else if(win) {
- wmEvent event= *(win->eventstate);
+ else if (win) {
+ wmEvent event = *(win->eventstate);
- event.type= wt->event_type;
- event.custom= EVT_DATA_TIMER;
- event.customdata= wt;
+ event.type = wt->event_type;
+ event.custom = EVT_DATA_TIMER;
+ event.customdata = wt;
wm_event_add(win, &event);
- retval= 1;
+ retval = 1;
}
}
}
@@ -906,40 +943,40 @@ static int wm_window_timer(const bContext *C)
void wm_window_process_events(const bContext *C)
{
- int hasevent= GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */
+ int hasevent = GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */
- if(hasevent)
+ if (hasevent)
GHOST_DispatchEvents(g_system);
hasevent |= wm_window_timer(C);
/* no event, we sleep 5 milliseconds */
- if(hasevent==0)
+ if (hasevent == 0)
PIL_sleep_ms(5);
}
void wm_window_process_events_nosleep(void)
{
- if(GHOST_ProcessEvents(g_system, 0))
+ if (GHOST_ProcessEvents(g_system, 0))
GHOST_DispatchEvents(g_system);
}
/* exported as handle callback to bke blender.c */
void wm_window_testbreak(void)
{
- static double ltime= 0;
- double curtime= PIL_check_seconds_timer();
+ static double ltime = 0;
+ double curtime = PIL_check_seconds_timer();
/* only check for breaks every 50 milliseconds
- * if we get called more often.
- */
- if ((curtime-ltime)>.05) {
- int hasevent= GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */
+ * if we get called more often.
+ */
+ if ((curtime - ltime) > .05) {
+ int hasevent = GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */
- if(hasevent)
+ if (hasevent)
GHOST_DispatchEvents(g_system);
- ltime= curtime;
+ ltime = curtime;
}
}
@@ -948,19 +985,19 @@ void wm_window_testbreak(void)
void wm_ghost_init(bContext *C)
{
if (!g_system) {
- GHOST_EventConsumerHandle consumer= GHOST_CreateEventConsumer(ghost_event_proc, C);
+ GHOST_EventConsumerHandle consumer = GHOST_CreateEventConsumer(ghost_event_proc, C);
- g_system= GHOST_CreateSystem();
+ g_system = GHOST_CreateSystem();
GHOST_AddEventConsumer(g_system, consumer);
}
}
void wm_ghost_exit(void)
{
- if(g_system)
+ if (g_system)
GHOST_DisposeSystem(g_system);
- g_system= NULL;
+ g_system = NULL;
}
/* **************** timer ********************** */
@@ -970,24 +1007,24 @@ void WM_event_timer_sleep(wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *t
{
wmTimer *wt;
- for(wt= wm->timers.first; wt; wt= wt->next)
- if(wt==timer)
+ for (wt = wm->timers.first; wt; wt = wt->next)
+ if (wt == timer)
break;
- if(wt)
- wt->sleep= dosleep;
+ if (wt)
+ wt->sleep = dosleep;
}
wmTimer *WM_event_add_timer(wmWindowManager *wm, wmWindow *win, int event_type, double timestep)
{
- wmTimer *wt= MEM_callocN(sizeof(wmTimer), "window timer");
+ wmTimer *wt = MEM_callocN(sizeof(wmTimer), "window timer");
- wt->event_type= event_type;
- wt->ltime= PIL_check_seconds_timer();
- wt->ntime= wt->ltime + timestep;
- wt->stime= wt->ltime;
- wt->timestep= timestep;
- wt->win= win;
+ wt->event_type = event_type;
+ wt->ltime = PIL_check_seconds_timer();
+ wt->ntime = wt->ltime + timestep;
+ wt->stime = wt->ltime;
+ wt->timestep = timestep;
+ wt->win = win;
BLI_addtail(&wm->timers, wt);
@@ -999,15 +1036,15 @@ void WM_event_remove_timer(wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *
wmTimer *wt;
/* extra security check */
- for(wt= wm->timers.first; wt; wt= wt->next)
- if(wt==timer)
+ for (wt = wm->timers.first; wt; wt = wt->next)
+ if (wt == timer)
break;
- if(wt) {
- if(wm->reports.reporttimer == wt)
- wm->reports.reporttimer= NULL;
+ if (wt) {
+ if (wm->reports.reporttimer == wt)
+ wm->reports.reporttimer = NULL;
BLI_remlink(&wm->timers, wt);
- if(wt->customdata)
+ if (wt->customdata)
MEM_freeN(wt->customdata);
MEM_freeN(wt);
}
@@ -1019,21 +1056,21 @@ char *WM_clipboard_text_get(int selection)
{
char *p, *p2, *buf, *newbuf;
- if(G.background)
+ if (G.background)
return NULL;
- buf= (char*)GHOST_getClipboard(selection);
- if(!buf)
+ buf = (char *)GHOST_getClipboard(selection);
+ if (!buf)
return NULL;
/* always convert from \r\n to \n */
- newbuf= MEM_callocN(strlen(buf)+1, "WM_clipboard_text_get");
+ newbuf = MEM_callocN(strlen(buf) + 1, "WM_clipboard_text_get");
- for(p= buf, p2= newbuf; *p; p++) {
- if(*p != '\r')
- *(p2++)= *p;
+ for (p = buf, p2 = newbuf; *p; p++) {
+ if (*p != '\r')
+ *(p2++) = *p;
}
- *p2= '\0';
+ *p2 = '\0';
free(buf); /* ghost uses regular malloc */
@@ -1042,33 +1079,33 @@ char *WM_clipboard_text_get(int selection)
void WM_clipboard_text_set(char *buf, int selection)
{
- if(!G.background) {
+ if (!G.background) {
#ifdef _WIN32
/* do conversion from \n to \r\n on Windows */
char *p, *p2, *newbuf;
- int newlen= 0;
+ int newlen = 0;
- for(p= buf; *p; p++) {
- if(*p == '\n')
+ for (p = buf; *p; p++) {
+ if (*p == '\n')
newlen += 2;
else
newlen++;
}
- newbuf= MEM_callocN(newlen+1, "WM_clipboard_text_set");
+ newbuf = MEM_callocN(newlen + 1, "WM_clipboard_text_set");
- for(p= buf, p2= newbuf; *p; p++, p2++) {
- if(*p == '\n') {
- *(p2++)= '\r'; *p2= '\n';
+ for (p = buf, p2 = newbuf; *p; p++, p2++) {
+ if (*p == '\n') {
+ *(p2++) = '\r'; *p2 = '\n';
}
- else *p2= *p;
+ else *p2 = *p;
}
- *p2= '\0';
+ *p2 = '\0';
- GHOST_putClipboard((GHOST_TInt8*)newbuf, selection);
+ GHOST_putClipboard((GHOST_TInt8 *)newbuf, selection);
MEM_freeN(newbuf);
#else
- GHOST_putClipboard((GHOST_TInt8*)buf, selection);
+ GHOST_putClipboard((GHOST_TInt8 *)buf, selection);
#endif
}
}
@@ -1089,23 +1126,23 @@ void WM_progress_clear(wmWindow *win)
void wm_window_get_position(wmWindow *win, int *posx_r, int *posy_r)
{
- *posx_r= win->posx;
- *posy_r= win->posy;
+ *posx_r = win->posx;
+ *posy_r = win->posy;
}
void wm_window_get_size(wmWindow *win, int *width_r, int *height_r)
{
- *width_r= win->sizex;
- *height_r= win->sizey;
+ *width_r = win->sizex;
+ *height_r = win->sizey;
}
/* exceptional case: - splash is called before events are processed
- * this means we dont actually know the window size so get this from GHOST */
+ * this means we don't actually know the window size so get this from GHOST */
void wm_window_get_size_ghost(wmWindow *win, int *width_r, int *height_r)
{
- GHOST_RectangleHandle bounds= GHOST_GetClientBounds(win->ghostwin);
- *width_r= GHOST_GetWidthRectangle(bounds);
- *height_r= GHOST_GetHeightRectangle(bounds);
+ GHOST_RectangleHandle bounds = GHOST_GetClientBounds(win->ghostwin);
+ *width_r = GHOST_GetWidthRectangle(bounds);
+ *height_r = GHOST_GetHeightRectangle(bounds);
GHOST_DisposeRectangle(bounds);
}
@@ -1141,7 +1178,7 @@ void wm_get_cursor_position(wmWindow *win, int *x, int *y)
{
GHOST_GetCursorPosition(g_system, x, y);
GHOST_ScreenToClient(win->ghostwin, *x, *y, x, y);
- *y = (win->sizey-1) - *y;
+ *y = (win->sizey - 1) - *y;
}
/* ******************* exported api ***************** */
@@ -1150,37 +1187,39 @@ void wm_get_cursor_position(wmWindow *win, int *x, int *y)
/* called whem no ghost system was initialized */
void WM_setprefsize(int stax, int stay, int sizx, int sizy)
{
- prefstax= stax;
- prefstay= stay;
- prefsizx= sizx;
- prefsizy= sizy;
- useprefsize= 1;
+ wm_init_state.start_x = stax; /* left hand pos */
+ wm_init_state.start_y = stay; /* bottom pos */
+ wm_init_state.size_x = sizx;
+ wm_init_state.size_y = sizy;
+ wm_init_state.override_flag |= WIN_OVERRIDE_GEOM;
}
/* for borderless and border windows set from command-line */
void WM_setinitialstate_fullscreen(void)
{
- initialstate= GHOST_kWindowStateFullScreen;
+ wm_init_state.windowstate = GHOST_kWindowStateFullScreen;
+ wm_init_state.override_flag |= WIN_OVERRIDE_WINSTATE;
}
void WM_setinitialstate_normal(void)
{
- initialstate= GHOST_kWindowStateNormal;
+ wm_init_state.windowstate = GHOST_kWindowStateNormal;
+ wm_init_state.override_flag |= WIN_OVERRIDE_WINSTATE;
}
/* This function requires access to the GHOST_SystemHandle (g_system) */
void WM_cursor_warp(wmWindow *win, int x, int y)
{
if (win && win->ghostwin) {
- int oldx=x, oldy=y;
+ int oldx = x, oldy = y;
- y= win->sizey -y - 1;
+ y = win->sizey - y - 1;
GHOST_ClientToScreen(win->ghostwin, x, y, &x, &y);
GHOST_SetCursorPosition(g_system, x, y);
- win->eventstate->prevx= oldx;
- win->eventstate->prevy= oldy;
+ win->eventstate->prevx = oldx;
+ win->eventstate->prevy = oldy;
}
}
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);